From 3e65a5ddd4e007d5975aa69138477509f049d92e Mon Sep 17 00:00:00 2001 From: "brendan%mozilla.org" Date: Tue, 7 Nov 2006 05:35:54 +0000 Subject: [PATCH] Tamarin (AVM2 open source) initial revision. git-svn-id: svn://10.0.0.236/trunk@214853 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/js/tamarin/MMgc/FixedAlloc.cpp | 216 + mozilla/js/tamarin/MMgc/FixedAlloc.h | 298 + mozilla/js/tamarin/MMgc/FixedMalloc.cpp | 141 + mozilla/js/tamarin/MMgc/FixedMalloc.h | 168 + mozilla/js/tamarin/MMgc/GC.cpp | 2603 ++ mozilla/js/tamarin/MMgc/GC.h | 1030 + mozilla/js/tamarin/MMgc/GCAlloc.cpp | 673 + mozilla/js/tamarin/MMgc/GCAlloc.h | 395 + mozilla/js/tamarin/MMgc/GCAllocObject.h | 58 + mozilla/js/tamarin/MMgc/GCAllocObjectMac.cpp | 58 + mozilla/js/tamarin/MMgc/GCAllocObjectUnix.cpp | 58 + mozilla/js/tamarin/MMgc/GCAllocObjectWin.cpp | 58 + mozilla/js/tamarin/MMgc/GCDebug.h | 107 + mozilla/js/tamarin/MMgc/GCDebugMac.cpp | 71 + mozilla/js/tamarin/MMgc/GCDebugUnix.cpp | 53 + mozilla/js/tamarin/MMgc/GCDebugWin.cpp | 102 + mozilla/js/tamarin/MMgc/GCHashtable.cpp | 173 + mozilla/js/tamarin/MMgc/GCHashtable.h | 113 + mozilla/js/tamarin/MMgc/GCHeap.cpp | 1167 + mozilla/js/tamarin/MMgc/GCHeap.h | 391 + mozilla/js/tamarin/MMgc/GCHeapMac.cpp | 367 + mozilla/js/tamarin/MMgc/GCHeapUnix.cpp | 319 + mozilla/js/tamarin/MMgc/GCHeapWin.cpp | 546 + mozilla/js/tamarin/MMgc/GCLargeAlloc.cpp | 162 + mozilla/js/tamarin/MMgc/GCLargeAlloc.h | 180 + mozilla/js/tamarin/MMgc/GCMemoryProfiler.cpp | 551 + mozilla/js/tamarin/MMgc/GCMemoryProfiler.h | 215 + mozilla/js/tamarin/MMgc/GCObject.cpp | 78 + mozilla/js/tamarin/MMgc/GCObject.h | 391 + mozilla/js/tamarin/MMgc/GCSpinLockLinux.h | 100 + mozilla/js/tamarin/MMgc/GCSpinLockMac.h | 135 + mozilla/js/tamarin/MMgc/GCSpinLockWin.h | 98 + mozilla/js/tamarin/MMgc/GCStack.h | 122 + mozilla/js/tamarin/MMgc/GCTests.cpp | 154 + mozilla/js/tamarin/MMgc/GCTests.h | 41 + mozilla/js/tamarin/MMgc/GCTypes.h | 95 + mozilla/js/tamarin/MMgc/GCWeakRef.h | 111 + mozilla/js/tamarin/MMgc/MMgc.cpp | 32 + mozilla/js/tamarin/MMgc/MMgc.h | 125 + mozilla/js/tamarin/MMgc/MMgc.mcp | Bin 0 -> 247825 bytes mozilla/js/tamarin/MMgc/MMgc.sln | 30 + mozilla/js/tamarin/MMgc/MMgc.vcproj | 410 + mozilla/js/tamarin/MMgc/MMgc_8.sln | 28 + mozilla/js/tamarin/MMgc/MMgc_8.vcproj | 531 + mozilla/js/tamarin/MMgc/Makefile | 108 + mozilla/js/tamarin/MMgc/Makefile.arm | 172 + mozilla/js/tamarin/MMgc/WriteBarrier.h | 188 + mozilla/js/tamarin/MMgc/armbuild.h | 78 + mozilla/js/tamarin/MMgc/linuxbuild.h | 86 + mozilla/js/tamarin/MMgc/macbuild.h | 94 + mozilla/js/tamarin/MMgc/makecommon | 95 + .../js/tamarin/MMgc/run_alloc/run_alloc.cpp | 67 + .../js/tamarin/MMgc/run_alloc/run_alloc.sln | 60 + .../tamarin/MMgc/run_alloc/run_alloc.vcproj | 188 + mozilla/js/tamarin/MMgc/winbuild.h | 112 + mozilla/js/tamarin/codegen/ArmAssembler.cpp | 1170 + mozilla/js/tamarin/codegen/ArmAssembler.h | 224 + mozilla/js/tamarin/codegen/CodegenMIR.cpp | 10084 +++++++ mozilla/js/tamarin/codegen/CodegenMIR.h | 1526 ++ mozilla/js/tamarin/codegen/Ia32Assembler.cpp | 1135 + mozilla/js/tamarin/codegen/PpcAssembler.cpp | 1298 + mozilla/js/tamarin/core/AbcData.cpp | 38 + mozilla/js/tamarin/core/AbcEnv.cpp | 58 + mozilla/js/tamarin/core/AbcEnv.h | 77 + mozilla/js/tamarin/core/AbcGen.cpp | 84 + mozilla/js/tamarin/core/AbcGen.h | 73 + mozilla/js/tamarin/core/AbcParser.cpp | 1986 ++ mozilla/js/tamarin/core/AbcParser.h | 208 + mozilla/js/tamarin/core/AbstractFunction.cpp | 433 + mozilla/js/tamarin/core/AbstractFunction.h | 296 + .../js/tamarin/core/ActionBlockConstants.cpp | 116 + .../js/tamarin/core/ActionBlockConstants.h | 131 + mozilla/js/tamarin/core/Array.as | 428 + mozilla/js/tamarin/core/ArrayClass.cpp | 1613 ++ mozilla/js/tamarin/core/ArrayClass.h | 97 + mozilla/js/tamarin/core/ArrayObject.cpp | 515 + mozilla/js/tamarin/core/ArrayObject.h | 136 + mozilla/js/tamarin/core/AtomArray.cpp | 304 + mozilla/js/tamarin/core/AtomArray.h | 127 + mozilla/js/tamarin/core/AtomConstants.cpp | 38 + mozilla/js/tamarin/core/AtomConstants.h | 143 + mozilla/js/tamarin/core/AtomWriteBarrier.h | 88 + mozilla/js/tamarin/core/AvmCore.cpp | 3877 +++ mozilla/js/tamarin/core/AvmCore.h | 1389 + mozilla/js/tamarin/core/AvmDebug.h | 108 + mozilla/js/tamarin/core/AvmDebugWin.cpp | 98 + mozilla/js/tamarin/core/AvmError.h | 43 + .../tamarin/core/AvmPlusScriptableObject.cpp | 73 + .../js/tamarin/core/AvmPlusScriptableObject.h | 70 + mozilla/js/tamarin/core/BigInteger.cpp | 636 + mozilla/js/tamarin/core/BigInteger.h | 255 + mozilla/js/tamarin/core/BitSet.h | 156 + mozilla/js/tamarin/core/Boolean.as | 82 + mozilla/js/tamarin/core/BooleanClass.cpp | 55 + mozilla/js/tamarin/core/BooleanClass.h | 63 + mozilla/js/tamarin/core/BuiltinTraits.cpp | 150 + mozilla/js/tamarin/core/BuiltinTraits.h | 92 + mozilla/js/tamarin/core/Class.as | 45 + mozilla/js/tamarin/core/ClassClass.cpp | 69 + mozilla/js/tamarin/core/ClassClass.h | 55 + mozilla/js/tamarin/core/ClassClosure.cpp | 193 + mozilla/js/tamarin/core/ClassClosure.h | 83 + mozilla/js/tamarin/core/CodeContext.h | 82 + mozilla/js/tamarin/core/Date.as | 395 + mozilla/js/tamarin/core/Date.cpp | 712 + mozilla/js/tamarin/core/Date.h | 128 + mozilla/js/tamarin/core/DateClass.cpp | 449 + mozilla/js/tamarin/core/DateClass.h | 77 + mozilla/js/tamarin/core/DateObject.cpp | 121 + mozilla/js/tamarin/core/DateObject.h | 81 + mozilla/js/tamarin/core/Domain.cpp | 92 + mozilla/js/tamarin/core/Domain.h | 58 + mozilla/js/tamarin/core/DomainEnv.cpp | 95 + mozilla/js/tamarin/core/DomainEnv.h | 73 + mozilla/js/tamarin/core/DynamicProfiler.cpp | 138 + mozilla/js/tamarin/core/DynamicProfiler.h | 148 + mozilla/js/tamarin/core/E4XNode.cpp | 988 + mozilla/js/tamarin/core/E4XNode.h | 356 + mozilla/js/tamarin/core/Error.as | 262 + mozilla/js/tamarin/core/ErrorClass.cpp | 115 + mozilla/js/tamarin/core/ErrorClass.h | 120 + mozilla/js/tamarin/core/ErrorConstants.as | 168 + mozilla/js/tamarin/core/ErrorConstants.cpp | 1381 + mozilla/js/tamarin/core/ErrorConstants.h | 205 + mozilla/js/tamarin/core/Exception.cpp | 141 + mozilla/js/tamarin/core/Exception.h | 239 + mozilla/js/tamarin/core/FrameState.cpp | 38 + mozilla/js/tamarin/core/FrameState.h | 164 + mozilla/js/tamarin/core/Function.as | 115 + mozilla/js/tamarin/core/FunctionClass.cpp | 102 + mozilla/js/tamarin/core/FunctionClass.h | 63 + mozilla/js/tamarin/core/GrowableBuffer.cpp | 967 + mozilla/js/tamarin/core/GrowableBuffer.h | 227 + mozilla/js/tamarin/core/IntClass.cpp | 75 + mozilla/js/tamarin/core/IntClass.h | 87 + mozilla/js/tamarin/core/Interpreter.cpp | 1555 ++ mozilla/js/tamarin/core/Interpreter.h | 85 + mozilla/js/tamarin/core/Math.as | 78 + mozilla/js/tamarin/core/MathClass.cpp | 212 + mozilla/js/tamarin/core/MathClass.h | 93 + mozilla/js/tamarin/core/MathUtils.cpp | 1967 ++ mozilla/js/tamarin/core/MathUtils.h | 215 + mozilla/js/tamarin/core/MethodClosure.cpp | 132 + mozilla/js/tamarin/core/MethodClosure.h | 102 + mozilla/js/tamarin/core/MethodEnv.cpp | 1645 ++ mozilla/js/tamarin/core/MethodEnv.h | 295 + mozilla/js/tamarin/core/MethodInfo.cpp | 330 + mozilla/js/tamarin/core/MethodInfo.h | 98 + mozilla/js/tamarin/core/Multiname.cpp | 222 + mozilla/js/tamarin/core/Multiname.h | 357 + .../js/tamarin/core/MultinameHashtable.cpp | 264 + mozilla/js/tamarin/core/MultinameHashtable.h | 132 + mozilla/js/tamarin/core/Namespace.as | 75 + mozilla/js/tamarin/core/Namespace.cpp | 136 + mozilla/js/tamarin/core/Namespace.h | 107 + mozilla/js/tamarin/core/NamespaceClass.cpp | 107 + mozilla/js/tamarin/core/NamespaceClass.h | 59 + mozilla/js/tamarin/core/NamespaceSet.cpp | 61 + mozilla/js/tamarin/core/NamespaceSet.h | 79 + mozilla/js/tamarin/core/NativeFunction.cpp | 175 + mozilla/js/tamarin/core/NativeFunction.h | 239 + mozilla/js/tamarin/core/NativeObjectHelpers.h | 163 + mozilla/js/tamarin/core/Number.as | 254 + mozilla/js/tamarin/core/NumberClass.cpp | 110 + mozilla/js/tamarin/core/NumberClass.h | 67 + mozilla/js/tamarin/core/OSDep.h | 57 + mozilla/js/tamarin/core/Object.as | 118 + mozilla/js/tamarin/core/ObjectClass.cpp | 225 + mozilla/js/tamarin/core/ObjectClass.h | 71 + mozilla/js/tamarin/core/OutputStream.h | 55 + mozilla/js/tamarin/core/PoolObject.cpp | 889 + mozilla/js/tamarin/core/PoolObject.h | 199 + mozilla/js/tamarin/core/PrintWriter.cpp | 464 + mozilla/js/tamarin/core/PrintWriter.h | 156 + mozilla/js/tamarin/core/RegExp.as | 97 + mozilla/js/tamarin/core/RegExpClass.cpp | 135 + mozilla/js/tamarin/core/RegExpClass.h | 63 + mozilla/js/tamarin/core/RegExpObject.cpp | 763 + mozilla/js/tamarin/core/RegExpObject.h | 113 + mozilla/js/tamarin/core/ScopeChain.cpp | 37 + mozilla/js/tamarin/core/ScopeChain.h | 139 + mozilla/js/tamarin/core/ScriptBuffer.cpp | 36 + mozilla/js/tamarin/core/ScriptBuffer.h | 143 + mozilla/js/tamarin/core/ScriptObject.cpp | 874 + mozilla/js/tamarin/core/ScriptObject.h | 210 + mozilla/js/tamarin/core/SortedIntMap.h | 291 + mozilla/js/tamarin/core/StackTrace.cpp | 231 + mozilla/js/tamarin/core/StackTrace.h | 192 + mozilla/js/tamarin/core/StaticProfiler.cpp | 130 + mozilla/js/tamarin/core/StaticProfiler.h | 80 + mozilla/js/tamarin/core/String.as | 245 + mozilla/js/tamarin/core/StringBuffer.cpp | 74 + mozilla/js/tamarin/core/StringBuffer.h | 94 + mozilla/js/tamarin/core/StringClass.cpp | 385 + mozilla/js/tamarin/core/StringClass.h | 69 + mozilla/js/tamarin/core/StringObject.cpp | 1211 + mozilla/js/tamarin/core/StringObject.h | 463 + mozilla/js/tamarin/core/Toplevel.cpp | 1509 ++ mozilla/js/tamarin/core/Toplevel.h | 318 + mozilla/js/tamarin/core/Traits.cpp | 865 + mozilla/js/tamarin/core/Traits.h | 368 + mozilla/js/tamarin/core/TraitsIterator.h | 84 + mozilla/js/tamarin/core/UnicodeUtils.cpp | 520 + mozilla/js/tamarin/core/UnicodeUtils.h | 135 + mozilla/js/tamarin/core/VTable.cpp | 186 + mozilla/js/tamarin/core/VTable.h | 78 + mozilla/js/tamarin/core/Verifier.cpp | 3304 +++ mozilla/js/tamarin/core/Verifier.h | 158 + mozilla/js/tamarin/core/XML.as | 699 + mozilla/js/tamarin/core/XMLClass.cpp | 421 + mozilla/js/tamarin/core/XMLClass.h | 150 + mozilla/js/tamarin/core/XMLListClass.cpp | 194 + mozilla/js/tamarin/core/XMLListClass.h | 62 + mozilla/js/tamarin/core/XMLListObject.cpp | 1504 ++ mozilla/js/tamarin/core/XMLListObject.h | 214 + mozilla/js/tamarin/core/XMLObject.cpp | 3025 +++ mozilla/js/tamarin/core/XMLObject.h | 302 + mozilla/js/tamarin/core/XMLParser16.cpp | 504 + mozilla/js/tamarin/core/XMLParser16.h | 146 + mozilla/js/tamarin/core/abcFormat.txt | 237 + mozilla/js/tamarin/core/abcFormat470.txt | 180 + mozilla/js/tamarin/core/actionscript.lang.as | 99 + mozilla/js/tamarin/core/avmbuild.h | 169 + mozilla/js/tamarin/core/avmplus.cpp | 54 + mozilla/js/tamarin/core/avmplus.h | 305 + mozilla/js/tamarin/core/avmplusDebugger.cpp | 834 + mozilla/js/tamarin/core/avmplusDebugger.h | 596 + mozilla/js/tamarin/core/avmplusHashtable.cpp | 394 + mozilla/js/tamarin/core/avmplusHashtable.h | 289 + mozilla/js/tamarin/core/avmplusList.h | 284 + mozilla/js/tamarin/core/avmplusProfiler.cpp | 74 + mozilla/js/tamarin/core/avmplusProfiler.h | 213 + mozilla/js/tamarin/core/avmplusStack.h | 101 + mozilla/js/tamarin/core/avmplusTypes.h | 87 + mozilla/js/tamarin/core/avmplusVersion.h | 52 + mozilla/js/tamarin/core/avmsetjmp.h | 58 + mozilla/js/tamarin/core/builtin.as | 45 + mozilla/js/tamarin/core/builtin.cpp | 1675 ++ mozilla/js/tamarin/core/builtin.h | 299 + mozilla/js/tamarin/core/opcodes.cpp | 1596 ++ mozilla/js/tamarin/core/opcodes.h | 202 + mozilla/js/tamarin/core/opcodes.tbl | 332 + mozilla/js/tamarin/esc/debugger.as | 137 + mozilla/js/tamarin/esc/definer.as | 991 + mozilla/js/tamarin/esc/emitter.as | 1489 ++ mozilla/js/tamarin/esc/es4.as | 135 + mozilla/js/tamarin/esc/es4_help.txt | 92 + mozilla/js/tamarin/esc/es4_start.txt | 13 + mozilla/js/tamarin/esc/evaluator.as | 80 + mozilla/js/tamarin/esc/interpreter.as | 1184 + mozilla/js/tamarin/esc/parser.as | 6121 +++++ mozilla/js/tamarin/esc/readme.txt | 8 + mozilla/js/tamarin/extensions/Dictionary.as | 78 + .../js/tamarin/extensions/DictionaryGlue.cpp | 193 + .../js/tamarin/extensions/DictionaryGlue.h | 73 + mozilla/js/tamarin/extensions/JavaGlue.cpp | 1685 ++ mozilla/js/tamarin/extensions/JavaGlue.h | 283 + .../localization/lang/de/ErrorConstants.xml | 736 + .../js/tamarin/localization/lang/de/build.xml | 72 + .../localization/lang/es/ErrorConstants.xml | 736 + .../js/tamarin/localization/lang/es/build.xml | 72 + .../localization/lang/fr/ErrorConstants.xml | 736 + .../js/tamarin/localization/lang/fr/build.xml | 72 + .../localization/lang/it/ErrorConstants.xml | 736 + .../js/tamarin/localization/lang/it/build.xml | 72 + .../localization/lang/ja/ErrorConstants.xml | 736 + .../js/tamarin/localization/lang/ja/build.xml | 72 + .../localization/lang/ko/ErrorConstants.xml | 736 + .../js/tamarin/localization/lang/ko/build.xml | 72 + mozilla/js/tamarin/localization/lang/populate | 48 + .../lang/zh_CN/ErrorConstants.xml | 736 + .../tamarin/localization/lang/zh_CN/build.xml | 72 + .../lang/zh_TW/ErrorConstants.xml | 736 + .../tamarin/localization/lang/zh_TW/build.xml | 72 + mozilla/js/tamarin/pcre/AUTHORS | 23 + mozilla/js/tamarin/pcre/COPYING | 68 + mozilla/js/tamarin/pcre/ChangeLog | 1881 ++ mozilla/js/tamarin/pcre/INSTALL | 185 + mozilla/js/tamarin/pcre/LICENCE | 68 + mozilla/js/tamarin/pcre/Makefile.in | 568 + mozilla/js/tamarin/pcre/NEWS | 233 + mozilla/js/tamarin/pcre/NON-UNIX-USE | 277 + mozilla/js/tamarin/pcre/README | 494 + mozilla/js/tamarin/pcre/RunGrepTest.in | 140 + mozilla/js/tamarin/pcre/RunTest.in | 255 + mozilla/js/tamarin/pcre/config.guess | 1479 + mozilla/js/tamarin/pcre/config.h | 132 + mozilla/js/tamarin/pcre/config.h.in | 107 + mozilla/js/tamarin/pcre/config.sub | 1586 ++ mozilla/js/tamarin/pcre/configure | 22187 ++++++++++++++++ mozilla/js/tamarin/pcre/configure.in | 290 + mozilla/js/tamarin/pcre/dftables.cpp | 172 + mozilla/js/tamarin/pcre/doc/Tech.Notes | 339 + mozilla/js/tamarin/pcre/doc/html/index.html | 122 + mozilla/js/tamarin/pcre/doc/html/pcre.html | 241 + .../tamarin/pcre/doc/html/pcre_compile.html | 76 + .../tamarin/pcre/doc/html/pcre_compile2.html | 81 + .../js/tamarin/pcre/doc/html/pcre_config.html | 60 + .../doc/html/pcre_copy_named_substring.html | 53 + .../pcre/doc/html/pcre_copy_substring.html | 51 + .../tamarin/pcre/doc/html/pcre_dfa_exec.html | 88 + .../js/tamarin/pcre/doc/html/pcre_exec.html | 79 + .../pcre/doc/html/pcre_free_substring.html | 40 + .../doc/html/pcre_free_substring_list.html | 40 + .../tamarin/pcre/doc/html/pcre_fullinfo.html | 71 + .../doc/html/pcre_get_named_substring.html | 54 + .../pcre/doc/html/pcre_get_stringnumber.html | 46 + .../pcre/doc/html/pcre_get_substring.html | 52 + .../doc/html/pcre_get_substring_list.html | 51 + .../js/tamarin/pcre/doc/html/pcre_info.html | 39 + .../pcre/doc/html/pcre_maketables.html | 42 + .../tamarin/pcre/doc/html/pcre_refcount.html | 45 + .../js/tamarin/pcre/doc/html/pcre_study.html | 56 + .../tamarin/pcre/doc/html/pcre_version.html | 39 + mozilla/js/tamarin/pcre/doc/html/pcreapi.html | 1618 ++ .../js/tamarin/pcre/doc/html/pcrebuild.html | 201 + .../js/tamarin/pcre/doc/html/pcrecallout.html | 186 + .../js/tamarin/pcre/doc/html/pcrecompat.html | 154 + mozilla/js/tamarin/pcre/doc/html/pcrecpp.html | 333 + .../js/tamarin/pcre/doc/html/pcregrep.html | 274 + .../tamarin/pcre/doc/html/pcrematching.html | 192 + .../js/tamarin/pcre/doc/html/pcrepartial.html | 205 + .../js/tamarin/pcre/doc/html/pcrepattern.html | 1494 ++ .../js/tamarin/pcre/doc/html/pcreperform.html | 97 + .../js/tamarin/pcre/doc/html/pcreposix.html | 223 + .../tamarin/pcre/doc/html/pcreprecompile.html | 135 + .../js/tamarin/pcre/doc/html/pcresample.html | 81 + .../js/tamarin/pcre/doc/html/pcretest.html | 580 + mozilla/js/tamarin/pcre/doc/pcre.3 | 232 + mozilla/js/tamarin/pcre/doc/pcre.txt | 4723 ++++ mozilla/js/tamarin/pcre/doc/pcre_compile.3 | 65 + mozilla/js/tamarin/pcre/doc/pcre_compile2.3 | 70 + mozilla/js/tamarin/pcre/doc/pcre_config.3 | 48 + .../pcre/doc/pcre_copy_named_substring.3 | 44 + .../js/tamarin/pcre/doc/pcre_copy_substring.3 | 41 + mozilla/js/tamarin/pcre/doc/pcre_dfa_exec.3 | 80 + mozilla/js/tamarin/pcre/doc/pcre_exec.3 | 68 + .../js/tamarin/pcre/doc/pcre_free_substring.3 | 28 + .../pcre/doc/pcre_free_substring_list.3 | 28 + mozilla/js/tamarin/pcre/doc/pcre_fullinfo.3 | 59 + .../pcre/doc/pcre_get_named_substring.3 | 45 + .../tamarin/pcre/doc/pcre_get_stringnumber.3 | 35 + .../js/tamarin/pcre/doc/pcre_get_substring.3 | 42 + .../pcre/doc/pcre_get_substring_list.3 | 40 + mozilla/js/tamarin/pcre/doc/pcre_info.3 | 27 + mozilla/js/tamarin/pcre/doc/pcre_maketables.3 | 30 + mozilla/js/tamarin/pcre/doc/pcre_refcount.3 | 33 + mozilla/js/tamarin/pcre/doc/pcre_study.3 | 43 + mozilla/js/tamarin/pcre/doc/pcre_version.3 | 27 + mozilla/js/tamarin/pcre/doc/pcreapi.3 | 1636 ++ mozilla/js/tamarin/pcre/doc/pcrebuild.3 | 189 + mozilla/js/tamarin/pcre/doc/pcrecallout.3 | 161 + mozilla/js/tamarin/pcre/doc/pcrecompat.3 | 124 + mozilla/js/tamarin/pcre/doc/pcrecpp.3 | 308 + mozilla/js/tamarin/pcre/doc/pcregrep.txt | 225 + mozilla/js/tamarin/pcre/doc/pcrematching.3 | 157 + mozilla/js/tamarin/pcre/doc/pcrepartial.3 | 184 + mozilla/js/tamarin/pcre/doc/pcrepattern.3 | 1480 ++ mozilla/js/tamarin/pcre/doc/pcreperform.3 | 76 + mozilla/js/tamarin/pcre/doc/pcreposix.3 | 206 + mozilla/js/tamarin/pcre/doc/pcreprecompile.3 | 127 + mozilla/js/tamarin/pcre/doc/pcresample.3 | 66 + mozilla/js/tamarin/pcre/doc/pcretest.txt | 529 + mozilla/js/tamarin/pcre/doc/perltest.txt | 33 + mozilla/js/tamarin/pcre/install-sh | 251 + mozilla/js/tamarin/pcre/libpcre.def | 20 + mozilla/js/tamarin/pcre/libpcre.pc.in | 12 + mozilla/js/tamarin/pcre/libpcreposix.def | 25 + mozilla/js/tamarin/pcre/ltmain.sh | 6604 +++++ mozilla/js/tamarin/pcre/makevp.txt | 5 + mozilla/js/tamarin/pcre/mkinstalldirs | 40 + mozilla/js/tamarin/pcre/pcre-config.in | 66 + mozilla/js/tamarin/pcre/pcre.def | 23 + mozilla/js/tamarin/pcre/pcre.h | 262 + mozilla/js/tamarin/pcre/pcre.h.in | 258 + mozilla/js/tamarin/pcre/pcre_chartables.cpp | 186 + mozilla/js/tamarin/pcre/pcre_compile.cpp | 5131 ++++ mozilla/js/tamarin/pcre/pcre_config.cpp | 114 + mozilla/js/tamarin/pcre/pcre_dfa_exec.cpp | 1920 ++ mozilla/js/tamarin/pcre/pcre_exec.cpp | 3810 +++ mozilla/js/tamarin/pcre/pcre_fullinfo.cpp | 151 + mozilla/js/tamarin/pcre/pcre_get.cpp | 354 + mozilla/js/tamarin/pcre/pcre_globals.cpp | 101 + mozilla/js/tamarin/pcre/pcre_info.cpp | 91 + mozilla/js/tamarin/pcre/pcre_internal.h | 910 + mozilla/js/tamarin/pcre/pcre_maketables.cpp | 147 + mozilla/js/tamarin/pcre/pcre_ord2utf8.cpp | 80 + mozilla/js/tamarin/pcre/pcre_printint.src | 455 + mozilla/js/tamarin/pcre/pcre_refcount.cpp | 79 + mozilla/js/tamarin/pcre/pcre_scanner.cc | 169 + mozilla/js/tamarin/pcre/pcre_scanner.h | 163 + .../js/tamarin/pcre/pcre_scanner_unittest.cc | 125 + mozilla/js/tamarin/pcre/pcre_stringpiece.cc | 39 + mozilla/js/tamarin/pcre/pcre_stringpiece.h.in | 172 + .../tamarin/pcre/pcre_stringpiece_unittest.cc | 145 + mozilla/js/tamarin/pcre/pcre_study.cpp | 484 + mozilla/js/tamarin/pcre/pcre_tables.cpp | 132 + mozilla/js/tamarin/pcre/pcre_try_flipped.cpp | 134 + mozilla/js/tamarin/pcre/pcre_ucp_findchar.cpp | 161 + mozilla/js/tamarin/pcre/pcre_valid_utf8.cpp | 132 + mozilla/js/tamarin/pcre/pcre_version.cpp | 63 + mozilla/js/tamarin/pcre/pcre_xclass.cpp | 123 + mozilla/js/tamarin/pcre/pcrecpp.cc | 770 + mozilla/js/tamarin/pcre/pcrecpp.h.in | 786 + mozilla/js/tamarin/pcre/pcrecpp_unittest.cc | 1042 + mozilla/js/tamarin/pcre/pcredemo.cpp | 324 + mozilla/js/tamarin/pcre/pcregrep.cpp | 1164 + mozilla/js/tamarin/pcre/pcreposix.cpp | 294 + mozilla/js/tamarin/pcre/pcreposix.h | 121 + mozilla/js/tamarin/pcre/pcretest.cpp | 1898 ++ mozilla/js/tamarin/pcre/perltest | 211 + mozilla/js/tamarin/pcre/testdata/grepinput | 588 + mozilla/js/tamarin/pcre/testdata/grepinputx | 42 + mozilla/js/tamarin/pcre/testdata/greplist | 4 + mozilla/js/tamarin/pcre/testdata/grepoutput | 334 + mozilla/js/tamarin/pcre/testdata/testinput1 | 3849 +++ mozilla/js/tamarin/pcre/testdata/testinput2 | 1453 + mozilla/js/tamarin/pcre/testdata/testinput3 | 65 + mozilla/js/tamarin/pcre/testdata/testinput4 | 513 + mozilla/js/tamarin/pcre/testdata/testinput5 | 263 + mozilla/js/tamarin/pcre/testdata/testinput6 | 517 + mozilla/js/tamarin/pcre/testdata/testinput7 | 4013 +++ mozilla/js/tamarin/pcre/testdata/testinput8 | 540 + mozilla/js/tamarin/pcre/testdata/testinput9 | 599 + mozilla/js/tamarin/pcre/testdata/testoutput1 | 6286 +++++ mozilla/js/tamarin/pcre/testdata/testoutput2 | 5946 +++++ mozilla/js/tamarin/pcre/testdata/testoutput3 | 115 + mozilla/js/tamarin/pcre/testdata/testoutput4 | 903 + mozilla/js/tamarin/pcre/testdata/testoutput5 | 1075 + mozilla/js/tamarin/pcre/testdata/testoutput6 | 1013 + mozilla/js/tamarin/pcre/testdata/testoutput7 | 6516 +++++ mozilla/js/tamarin/pcre/testdata/testoutput8 | 1033 + mozilla/js/tamarin/pcre/testdata/testoutput9 | 1234 + mozilla/js/tamarin/pcre/ucp.h | 58 + mozilla/js/tamarin/pcre/ucpinternal.h | 91 + mozilla/js/tamarin/pcre/ucptable.cpp | 15105 +++++++++++ mozilla/js/tamarin/platform/arm/DateUnix.cpp | 113 + mozilla/js/tamarin/platform/arm/Makefile | 286 + .../js/tamarin/platform/arm/MathUtilsUnix.cpp | 125 + mozilla/js/tamarin/platform/arm/OSDepUnix.cpp | 47 + .../js/tamarin/platform/mac/AvmDebugMac.cpp | 84 + mozilla/js/tamarin/platform/mac/DateMac.cpp | 242 + mozilla/js/tamarin/platform/mac/DateMac.h | 52 + .../mac/MMgc/MMgc.xcodeproj/project.pbxproj | 495 + mozilla/js/tamarin/platform/mac/Makefile | 262 + mozilla/js/tamarin/platform/mac/Makefile.2 | 231 + .../js/tamarin/platform/mac/MathUtilsMac.cpp | 124 + .../platform/mac/NativeFunctionMac.cpp | 64 + mozilla/js/tamarin/platform/mac/OSDepMac.cpp | 77 + mozilla/js/tamarin/platform/mac/avmplus.mcp | Bin 0 -> 1593130 bytes .../js/tamarin/platform/mac/avmplus.mcp.xml | 1 + .../avmplus/avmplus.xcodeproj/project.pbxproj | 1155 + mozilla/js/tamarin/platform/mac/carb.r | 40 + .../js/tamarin/platform/mac/macho_debug.pch++ | 68 + .../platform/mac/macho_debuggerdebug.pch++ | 69 + .../platform/mac/macho_debuggerrelease.pch++ | 67 + .../tamarin/platform/mac/macho_release.pch++ | 66 + .../platform/mac/macprefix_debug.pch++ | 58 + .../mac/macprefix_debuggerdebug.pch++ | 59 + .../platform/mac/macprefix_debuggerrel.pch++ | 57 + .../platform/mac/macprefix_release.pch++ | 56 + mozilla/js/tamarin/platform/mac/shell.mcp | Bin 0 -> 151141 bytes .../mac/shell/shell.xcodeproj/project.pbxproj | 689 + .../js/tamarin/platform/mac/shellCarbon.mcp | Bin 0 -> 147164 bytes mozilla/js/tamarin/platform/unix/DateUnix.cpp | 116 + mozilla/js/tamarin/platform/unix/Makefile | 144 + .../tamarin/platform/unix/MathUtilsUnix.cpp | 124 + .../js/tamarin/platform/unix/OSDepUnix.cpp | 94 + mozilla/js/tamarin/platform/unix/makecommon | 218 + mozilla/js/tamarin/platform/win32/DateWin.cpp | 204 + .../tamarin/platform/win32/MathUtilsWin.cpp | 376 + .../platform/win32/NativeFunctionWin.cpp | 54 + .../js/tamarin/platform/win32/OSDepWin.cpp | 64 + mozilla/js/tamarin/platform/win32/avmplus.cpp | 54 + mozilla/js/tamarin/platform/win32/avmplus.sln | 68 + .../js/tamarin/platform/win32/avmplus.vcproj | 935 + .../tamarin/platform/win32/avmplus_8.vcproj | 1272 + mozilla/js/tamarin/platform/win32/coff.cpp | 215 + mozilla/js/tamarin/platform/win32/coff.h | 201 + .../js/tamarin/platform/win32/shell.vcproj | 511 + .../js/tamarin/platform/win32/win32cpuid.cpp | 198 + .../js/tamarin/platform/win32/win32setjmp.cpp | 83 + mozilla/js/tamarin/shell/ByteArray.as | 562 + mozilla/js/tamarin/shell/ByteArrayGlue.cpp | 696 + mozilla/js/tamarin/shell/ByteArrayGlue.h | 168 + .../js/tamarin/shell/ConsoleOutputStream.cpp | 44 + .../js/tamarin/shell/ConsoleOutputStream.h | 53 + mozilla/js/tamarin/shell/DataIO.cpp | 233 + mozilla/js/tamarin/shell/DataIO.h | 186 + mozilla/js/tamarin/shell/DebugCLI.cpp | 784 + mozilla/js/tamarin/shell/DebugCLI.h | 234 + mozilla/js/tamarin/shell/Domain.as | 50 + mozilla/js/tamarin/shell/DomainClass.cpp | 185 + mozilla/js/tamarin/shell/DomainClass.h | 68 + mozilla/js/tamarin/shell/DoubleArray.as | 40 + mozilla/js/tamarin/shell/Endian.as | 39 + mozilla/js/tamarin/shell/FileClass.cpp | 154 + mozilla/js/tamarin/shell/FileClass.h | 74 + mozilla/js/tamarin/shell/FileInputStream.cpp | 74 + mozilla/js/tamarin/shell/FileInputStream.h | 72 + mozilla/js/tamarin/shell/FloatArray.as | 40 + mozilla/js/tamarin/shell/IntArray.as | 40 + mozilla/js/tamarin/shell/Java.as | 48 + mozilla/js/tamarin/shell/Profiler.h | 61 + mozilla/js/tamarin/shell/ShortArray.as | 40 + mozilla/js/tamarin/shell/StringBuilder.as | 65 + .../js/tamarin/shell/StringBuilderClass.cpp | 399 + mozilla/js/tamarin/shell/StringBuilderClass.h | 80 + mozilla/js/tamarin/shell/SystemClass.cpp | 205 + mozilla/js/tamarin/shell/SystemClass.h | 112 + mozilla/js/tamarin/shell/TypedArrayClass.cpp | 163 + mozilla/js/tamarin/shell/TypedArrayClass.h | 272 + mozilla/js/tamarin/shell/UIntArray.as | 40 + mozilla/js/tamarin/shell/UShortArray.as | 40 + mozilla/js/tamarin/shell/avmshell.cpp | 1143 + mozilla/js/tamarin/shell/avmshell.h | 151 + mozilla/js/tamarin/shell/genericzlib.h | 194 + mozilla/js/tamarin/shell/toplevel.as | 105 + mozilla/js/tamarin/shell/toplevel.cpp | 312 + mozilla/js/tamarin/shell/toplevel.h | 148 + .../test/as3/AbcDecoder/accessSpecifiers.as | 56 + .../AbcDecoder/accessSpecifiers/varsDef.as | 131 + .../tamarin/test/as3/AbcDecoder/extClass.as | 55 + .../as3/AbcDecoder/extClass/parentClass.as | 37 + .../tamarin/test/as3/AbcDecoder/impClass.as | 50 + .../test/as3/AbcDecoder/impClass/varsDef.as | 125 + .../js/tamarin/test/as3/AbcDecoder/impVars.as | 53 + .../test/as3/AbcDecoder/impVars/varsDef.as | 123 + .../test/as3/AbcDecoder/inheritClass.as | 61 + .../as3/AbcDecoder/inheritClass/varsDef.as | 127 + .../js/tamarin/test/as3/AbcDecoder/simple.as | 47 + .../test/as3/AbcDecoder/simple/varsDef.as | 128 + .../test/as3/AbcDecoder/typeAnnotation.as | 47 + .../as3/AbcDecoder/typeAnnotation/varsDef.as | 125 + .../js/tamarin/test/as3/AbcDecoder/useNS.as | 60 + .../test/as3/AbcDecoder/useNS/varsDef.as | 124 + .../Classes/ClassDef/Bug118272Package.as | 65 + .../ClassDef/Bug118272Package/BugTest.as | 87 + .../Definitions/Classes/ClassDef/Bug155775.as | 172 + .../Definitions/Classes/ClassDef/Bug162570.as | 86 + .../Classes/ClassDef/DefaultClass.as | 124 + .../ClassDef/DefaultClass/DefaultClassSame.as | 144 + .../Classes/ClassDef/DefaultClassPrototype.as | 118 + .../DefaultClassPrototype.as | 99 + .../Classes/ClassDef/DefaultDynamicClass.as | 152 + .../DefaultDynamicClass.as | 266 + .../Classes/ClassDef/DynamicClass.as | 122 + .../ClassDef/DynamicClass/DynamicClassSame.as | 143 + .../ClassDef/DynamicClassHasOwnProperty.as | 57 + .../DynamicClassHasOwnProperty.as | 47 + .../Classes/ClassDef/DynamicClassMeth.as | 60 + .../DynamicClassMeth/DynamicClassMeth.as | 168 + .../Classes/ClassDef/DynamicClassProp.as | 118 + .../DynamicClassProp/DynamicClassProp.as | 170 + .../Classes/ClassDef/DynamicClassPrototype.as | 119 + .../DynamicClassPrototype.as | 96 + .../ClassDef/DynamicClassSameMethPropName.as | 68 + .../DynamicClassSameMethPropName.as | 168 + .../Classes/ClassDef/FinalClassPrototype.as | 118 + .../FinalClassPrototype.as | 96 + .../Classes/ClassDef/FinalDefaultClass.as | 153 + .../FinalDefaultClass/FinalDefaultClass.as | 266 + .../ClassDef/FinalDefaultDynamicClass.as | 153 + .../FinalDefaultDynamicClass.as | 267 + .../Classes/ClassDef/FinalInternalClass.as | 162 + .../FinalInternalClass/FinalInternalClass.as | 288 + .../ClassDef/FinalInternalDynamicClass.as | 152 + .../FinalInternDynamicClass.as | 268 + .../Classes/ClassDef/FinalPublicClass.as | 182 + .../FinalPublicClass/FinalPublicClass.as | 244 + .../ClassDef/FinalPublicDynamicClass.as | 183 + .../FinalPublicDynamicClass.as | 241 + .../FinalPublicDynamicClassMethodAndProp.as | 152 + .../AccFinPubDynClassMAndP.as | 169 + .../ClassDef/IntClassWithStrParamCons.as | 67 + .../IntClassWithStrParamCons.as | 125 + .../Classes/ClassDef/InternalClass.as | 153 + .../ClassDef/InternalClass/InternalClass.as | 267 + .../ClassDef/InternalClassPrototype.as | 118 + .../InternalClassPrototype.as | 96 + .../Classes/ClassDef/InternalDynamicClass.as | 152 + .../InternalDynamicClass.as | 267 + .../PrivateStaticClassMethodAndProp.as | 126 + .../AccPrivStatClassMAndP.as | 204 + .../Classes/ClassDef/PublicClass.as | 193 + .../ClassDef/PublicClass/PublicClass.as | 254 + .../ClassDef/PublicClassMethodAndProp.as | 153 + .../AccPubClassMAndP.as | 168 + .../Classes/ClassDef/PublicClassPrototype.as | 118 + .../PublicClassPrototype.as | 96 + .../Classes/ClassDef/PublicDynamicClass.as | 191 + .../PublicDynamicClass/PublicDynamicClass.as | 251 + ...licStaticFinalDynamicClassMethodAndProp.as | 151 + .../AccPubStatFinDynClassMAndP.as | 173 + .../ClassDef/StatClassSameNamePackage.as | 50 + .../StatClassSameNamePackage.as | 39 + .../ClassDef/StaticClassMethodAndProp.as | 127 + .../AccStatClassMAndP.as | 200 + .../Definitions/Classes/ClassDef/bug113887.as | 48 + .../Classes/ClassDef/bug113887/bug113887.as | 69 + .../Classes/ClassDef/dynfinClassCons.as | 60 + .../dynfinClassCons/dynfinClassCons.as | 45 + .../Classes/ClassDef/dynfinClassDefCons.as | 60 + .../dynfinClassDefCons/dynfinClassDefCons.as | 44 + .../dynfinClassWithMultiStrParamCons.as | 57 + .../dynfinClassWithMultiStrParamCons.as | 66 + .../ClassDef/dynfinClassWithParamCons.as | 56 + .../dynfinClassWithParamCons.as | 47 + .../ClassDef/dynfinClassWithStrParamCons.as | 87 + .../dynfinClassWithStrParamCons.as | 95 + .../Classes/ClassDef/finClassNoParamCons.as | 55 + .../finClassNoParamCons.as | 45 + .../Classes/ClassDef/finalClassDefCons.as | 55 + .../finalClassDefCons/finalClassDefCons.as | 44 + .../ClassDef/finalClassWithParamCons.as | 56 + .../finalClassWithParamCons.as | 49 + .../Classes/ClassDef/intClassDefCons.as | 60 + .../intClassDefCons/intClassDefCons.as | 55 + .../Classes/ClassDef/intClassNoParamCons.as | 55 + .../intClassNoParamCons.as | 58 + .../Classes/ClassDef/intClassWithParamCons.as | 55 + .../intClassWithParamCons.as | 62 + .../ClassDef/publicClassConsNoParam.as | 56 + .../publicClassConsNoParam.as | 43 + .../Classes/ClassDef/publicClassDefCons.as | 63 + .../publicClassDefCons/publicClassDefCons.as | 67 + .../ClassDef/publicClassWithParamCons.as | 58 + .../publicClassWithParamCons.as | 55 + .../Classes/ClassDef/testClassInitializers.as | 51 + .../testClassInitializers.as | 72 + .../testdynfinpublicClassInitializers.as | 51 + .../testdynfinpublicClassInitializers.as | 72 + .../ClassDef/testinternalClassInitializers.as | 51 + .../testinternalClassInitializers.as | 72 + .../Classes/Ext/AccNSStatMethSubClassMeth.as | 68 + .../AccNSStatMethSubClassMeth.as | 51 + .../Classes/Ext/AccNSStatPropSubClassMeth.as | 68 + .../AccNSStatPropSubClassMeth.as | 50 + .../AccStatMethIntermediateSubClassMeth.as | 62 + .../AccStatMethIntermediateSubClassMeth.as | 54 + .../Classes/Ext/AccStatMethSubClassMeth.as | 74 + .../AccStatMethSubClassMeth.as | 57 + .../Ext/AccStatMethSubClassMethSuper.as | 62 + .../AccStatMethSubClassMethSuper.as | 46 + .../Ext/AccStatMethSubClassStatMeth.as | 60 + .../AccStatMethSubClassStatMeth.as | 53 + .../AccStatPropIntermediateSubClassMeth.as | 71 + .../AccStatPropIntermediateSubClassMeth.as | 52 + .../Classes/Ext/AccStatPropSubClassInit.as | 65 + .../AccStatPropSubClassInit.as | 45 + .../Classes/Ext/AccStatPropSubClassMeth.as | 69 + .../AccStatPropSubClassMeth.as | 48 + .../Ext/AccStatPropSubClassStatMeth.as | 67 + .../AccStatPropSubClassStatMeth.as | 48 + .../Classes/Ext/AccStatPropViaSubClass.as | 91 + .../AccStatPropViaSubClass.as | 46 + .../AccStatPropViaSubClassWIntermediate.as | 71 + .../AccStatPropViaSubClassWIntermediate.as | 46 + .../Classes/Ext/DynExtDefaultClass.as | 267 + .../Ext/DynExtDefaultClass/DefaultClass.as | 267 + .../DynExtDefaultClass/DynExtDefaultClass.as | 282 + .../Classes/Ext/DynExtDefaultClassFin.as | 166 + .../Ext/DynExtDefaultClassFin/DefaultClass.as | 264 + .../DynExtDefaultClassFin.as | 195 + .../Classes/Ext/DynExtDefaultClassPub.as | 245 + .../Ext/DynExtDefaultClassPub/DefaultClass.as | 264 + .../DynExtDefaultClassPub.as | 272 + .../Classes/Ext/DynExtDefaultClassPubStat.as | 135 + .../DynExtDefaultClassPubStat/DefaultClass.as | 264 + .../DynExtDefaultClassPubStat.as | 231 + .../Classes/Ext/DynExtDefaultClassStat.as | 184 + .../DynExtDefaultClassStat/DefaultClass.as | 264 + .../DynExtDefaultClassStat.as | 209 + .../Classes/Ext/DynExtDynamicClass.as | 42 + .../Ext/DynExtDynamicClass/ADynamicClass.as | 243 + .../DynExtDynamicClass/DynExtDynamicClass.as | 143 + .../Classes/Ext/DynExtDynamicClassFin.as | 43 + .../DynExtDynamicClassFin/ADynamicClass.as | 243 + .../DynExtDynamicClassFin.as | 174 + .../Classes/Ext/DynExtDynamicClassPub.as | 43 + .../DynExtDynamicClassPub/ADynamicClass.as | 243 + .../DynExtDynamicClassPub.as | 135 + .../Classes/Ext/DynExtDynamicClassPubStat.as | 165 + .../ADynamicClass.as | 243 + .../DynExtDynamicClassPubStat.as | 197 + .../Classes/Ext/DynExtDynamicClassStat.as | 225 + .../DynExtDynamicClassStat/ADynamicClass.as | 243 + .../DynExtDynamicClassStat.as | 257 + .../Classes/Ext/DynExtInternalClass.as | 250 + .../Ext/DynExtInternalClass/AInternalClass.as | 264 + .../DynExtInternalClass.as | 282 + .../Classes/Ext/DynExtPublicClass.as | 43 + .../Ext/DynExtPublicClass/APublicClass.as | 262 + .../DynExtPublicClass/DynExtPublicClass.as | 139 + .../Classes/Ext/DynExtPublicClassFin.as | 42 + .../Ext/DynExtPublicClassFin/APublicClass.as | 262 + .../DynExtPublicClassFin.as | 234 + .../Classes/Ext/DynExtPublicClassPub.as | 134 + .../Ext/DynExtPublicClassPub/APublicClass.as | 262 + .../DynExtPublicClassPub.as | 151 + .../Classes/Ext/DynExtPublicClassPubStat.as | 196 + .../DynExtPublicClassPubStat/APublicClass.as | 262 + .../DynExtPublicClassPubStat.as | 200 + .../Classes/Ext/DynExtPublicClassStat.as | 194 + .../Ext/DynExtPublicClassStat/APublicClass.as | 262 + .../DynExtPublicClassStat.as | 186 + .../Classes/Ext/ExtDefaultClass.as | 239 + .../Ext/ExtDefaultClass/DefaultClass.as | 264 + .../Ext/ExtDefaultClass/ExtDefaultClass.as | 276 + .../Classes/Ext/ExtDefaultClassPub.as | 44 + .../Ext/ExtDefaultClassPub/DefaultClass.as | 264 + .../ExtDefaultClassPub/ExtDefaultClassPub.as | 112 + .../Classes/Ext/ExtDefaultClassPubStat.as | 183 + .../ExtDefaultClassPubStat/DefaultClass.as | 264 + .../ExtDefaultClassPubStat.as | 206 + .../Classes/Ext/ExtDefaultClassStat.as | 179 + .../Ext/ExtDefaultClassStat/DefaultClass.as | 264 + .../ExtDefaultClassStat.as | 191 + .../Classes/Ext/ExtDefaultProtClass.as | 239 + .../ExtDefaultProtClass/DefaultProtClass.as | 112 + .../ExtDefaultProtClass.as | 276 + .../Classes/Ext/ExtDynamicClass.as | 42 + .../Ext/ExtDynamicClass/DynamicClass.as | 243 + .../Ext/ExtDynamicClass/ExtDynamicClass.as | 113 + .../Classes/Ext/ExtDynamicClassPub.as | 43 + .../Ext/ExtDynamicClassPub/DynamicClass.as | 243 + .../ExtDynamicClassPub/ExtDynamicClassPub.as | 113 + .../Classes/Ext/ExtDynamicClassPubStat.as | 43 + .../ExtDynamicClassPubStat/DynamicClass.as | 243 + .../ExtDynamicClassPubStat.as | 198 + .../Classes/Ext/ExtDynamicClassStat.as | 185 + .../Ext/ExtDynamicClassStat/DynamicClass.as | 243 + .../ExtDynamicClassStat.as | 197 + .../as3/Definitions/Classes/Ext/ExtError.as | 136 + .../Classes/Ext/ExtError/CustError.as | 37 + .../Classes/Ext/ExtError/CustError2.as | 41 + .../Classes/Ext/ExtError/CustEvalError.as | 37 + .../Classes/Ext/ExtError/CustEvalError2.as | 41 + .../Classes/Ext/ExtError/CustRangeError.as | 37 + .../Classes/Ext/ExtError/CustRangeError2.as | 41 + .../Ext/ExtError/CustReferenceError.as | 37 + .../Ext/ExtError/CustReferenceError2.as | 41 + .../Classes/Ext/ExtError/CustTypeError.as | 37 + .../Classes/Ext/ExtError/CustTypeError2.as | 41 + .../Classes/Ext/ExtInternalClass.as | 239 + .../Ext/ExtInternalClass/AInternalClass.as | 264 + .../Ext/ExtInternalClass/ExtInternalClass.as | 276 + .../Definitions/Classes/Ext/ExtPublicClass.as | 113 + .../Ext/ExtPublicClass/ExtPublicClass.as | 344 + .../Classes/Ext/ExtPublicClassFin.as | 42 + .../Ext/ExtPublicClassFin/APublicClass.as | 262 + .../ExtPublicClassFin/ExtPublicClassFin.as | 135 + .../Classes/Ext/ExtPublicClassPriv.as | 159 + .../Ext/ExtPublicClassPriv/APublicClass.as | 262 + .../ExtPublicClassPriv/ExtPublicClassPriv.as | 118 + .../Classes/Ext/ExtPublicClassPub.as | 44 + .../Ext/ExtPublicClassPub/APublicClass.as | 262 + .../ExtPublicClassPub/ExtPublicClassPub.as | 119 + .../Classes/Ext/ExtPublicClassStat.as | 199 + .../Ext/ExtPublicClassStat/APublicClass.as | 262 + .../ExtPublicClassStat/ExtPublicClassStat.as | 220 + .../Classes/Ext/FinExtDefaultClass.as | 185 + .../Ext/FinExtDefaultClass/DefaultClass.as | 264 + .../FinExtDefaultClass/FinExtDefaultClass.as | 425 + .../Classes/Ext/FinExtDefaultClassFin.as | 191 + .../Ext/FinExtDefaultClassFin/DefaultClass.as | 264 + .../FinExtDefaultClassFin.as | 422 + .../Classes/Ext/FinExtDefaultClassPub.as | 190 + .../Ext/FinExtDefaultClassPub/DefaultClass.as | 264 + .../FinExtDefaultClassPub.as | 422 + .../Classes/Ext/FinExtDefaultClassPubStat.as | 186 + .../FinExtDefaultClassPubStat/DefaultClass.as | 264 + .../FinExtDefaultClassPubStat.as | 404 + .../Classes/Ext/FinExtDefaultClassStat.as | 187 + .../FinExtDefaultClassStat/DefaultClass.as | 264 + .../FinExtDefaultClassStat.as | 418 + .../Classes/Ext/FinExtDynamicClass.as | 209 + .../Ext/FinExtDynamicClass/DynamicClass.as | 246 + .../FinExtDynamicClass/FinExtDynamicClass.as | 418 + .../Classes/Ext/FinExtDynamicClassFin.as | 191 + .../Ext/FinExtDynamicClassFin/DynamicClass.as | 243 + .../FinExtDynamicClassFin.as | 423 + .../Classes/Ext/FinExtDynamicClassPub.as | 191 + .../Ext/FinExtDynamicClassPub/DynamicClass.as | 243 + .../FinExtDynamicClassPub.as | 422 + .../Classes/Ext/FinExtDynamicClassPubStat.as | 191 + .../FinExtDynamicClassPubStat/DynamicClass.as | 243 + .../FinExtDynamicClassPubStat.as | 405 + .../Classes/Ext/FinExtDynamicClassStat.as | 191 + .../FinExtDynamicClassStat/DynamicClass.as | 243 + .../FinExtDynamicClassStat.as | 419 + .../Classes/Ext/FinExtInternalClass.as | 185 + .../Ext/FinExtInternalClass/AInternalClass.as | 264 + .../FinExtInternalClass.as | 424 + .../Classes/Ext/FinExtPublicClass.as | 185 + .../Ext/FinExtPublicClass/APublicClass.as | 262 + .../FinExtPublicClass/FinExtPublicClass.as | 407 + .../Classes/Ext/FinExtPublicClassFin.as | 192 + .../Ext/FinExtPublicClassFin/APublicClass.as | 262 + .../FinExtPublicClassFin.as | 410 + .../Classes/Ext/FinExtPublicClassPub.as | 191 + .../Ext/FinExtPublicClassPub/APublicClass.as | 262 + .../FinExtPublicClassPub.as | 409 + .../Classes/Ext/FinExtPublicClassPubStat.as | 186 + .../FinExtPublicClassPubStat/APublicClass.as | 262 + .../FinExtPublicClassPubStat.as | 390 + .../Classes/Ext/FinExtPublicClassStat.as | 187 + .../Ext/FinExtPublicClassStat/APublicClass.as | 262 + .../FinExtPublicClassStat.as | 405 + .../Classes/Ext/IntExtDefaultClass.as | 256 + .../Ext/IntExtDefaultClass/DefaultClass.as | 267 + .../IntExtDefaultClass/IntExtDefaultClass.as | 276 + .../Classes/Ext/IntExtDynamicClass.as | 239 + .../Ext/IntExtDynamicClass/DynamicClass.as | 243 + .../IntExtDynamicClass/IntExtDynamicClass.as | 276 + .../Classes/Ext/IntExtInternalClass.as | 239 + .../IntExtInternalClass.as | 508 + .../Classes/Ext/IntExtPublicClass.as | 239 + .../IntExtPublicClass/IntExtPublicClass.as | 505 + .../Classes/Ext/PubExtDefaultClass.as | 177 + .../Ext/PubExtDefaultClass/DefaultClass.as | 267 + .../PubExtDefaultClass/PubExtDefaultClass.as | 140 + .../Classes/Ext/PubExtDefaultClassFin.as | 142 + .../Ext/PubExtDefaultClassFin/DefaultClass.as | 264 + .../PubExtDefaultClassFin.as | 142 + .../Classes/Ext/PubExtDefaultClassPub.as | 43 + .../Ext/PubExtDefaultClassPub/DefaultClass.as | 264 + .../PubExtDefaultClassPub.as | 139 + .../Classes/Ext/PubExtDefaultClassPubStat.as | 45 + .../PubExtDefaultClassPubStat/DefaultClass.as | 264 + .../PubExtDefaultClassPubStat.as | 212 + .../Classes/Ext/PubExtDefaultClassStat.as | 45 + .../PubExtDefaultClassStat/DefaultClass.as | 264 + .../PubExtDefaultClassStat.as | 211 + .../Classes/Ext/PubExtDynamicClass.as | 42 + .../Ext/PubExtDynamicClass/DynamicClass.as | 243 + .../PubExtDynamicClass/PubExtDynamicClass.as | 139 + .../Classes/Ext/PubExtDynamicClassFin.as | 42 + .../Ext/PubExtDynamicClassFin/DynamicClass.as | 243 + .../PubExtDynamicClassFin.as | 140 + .../Classes/Ext/PubExtDynamicClassPub.as | 43 + .../Ext/PubExtDynamicClassPub/DynamicClass.as | 243 + .../PubExtDynamicClassPub.as | 138 + .../Classes/Ext/PubExtDynamicClassPubStat.as | 44 + .../PubExtDynamicClassPubStat/DynamicClass.as | 243 + .../PubExtDynamicClassPubStat.as | 212 + .../Classes/Ext/PubExtDynamicClassStat.as | 44 + .../PubExtDynamicClassStat/DynamicClass.as | 243 + .../PubExtDynamicClassStat.as | 210 + .../Classes/Ext/PubExtInternalClass.as | 162 + .../Ext/PubExtInternalClass/InternalClass.as | 264 + .../PubExtInternalClass.as | 140 + .../Classes/Ext/PubExtPublicClass.as | 119 + .../Ext/PubExtPublicClass/APublicClass.as | 262 + .../PubExtPublicClass/PubExtPublicClass.as | 113 + .../Classes/Ext/PubExtPublicClassFin.as | 138 + .../Ext/PubExtPublicClassFin/APublicClass.as | 262 + .../PubExtPublicClassFin.as | 139 + .../Classes/Ext/PubExtPublicClassStat.as | 190 + .../Ext/PubExtPublicClassStat/APublicClass.as | 262 + .../PubExtPublicClassStat.as | 214 + .../Classes/Ext/PubFinExtDefaultClass.as | 236 + .../Ext/PubFinExtDefaultClass/DefaultClass.as | 264 + .../PubFinExtDefaultClass.as | 271 + .../ExtImpl/DefsubExtDefClassImpDefInt.as | 61 + .../DefaultClass.as | 70 + .../DefaultInterface.as | 50 + .../DefaultsubClass.as | 74 + .../ExtImpl/DefsubExtDefClassImpIntInt.as | 63 + .../DefaultClass.as | 81 + .../DefaultsubClass.as | 75 + .../InternalInterface.as | 55 + .../ExtImpl/DefsubExtDefClassImpPubInt.as | 61 + .../DefaultClass.as | 69 + .../DefaultsubClass.as | 73 + .../PublicInterface.as | 50 + .../ExtImpl/DefsubExtIntClassImpIntInt.as | 60 + .../DefsubExtIntClassImpIntInt.as | 103 + .../ExtImpl/DefsubExtPubClassImpIntInt.as | 61 + .../DefaultsubClass.as | 41 + .../InternalInterface.as | 44 + .../DefsubExtPubClassImpIntInt/PublicClass.as | 109 + .../ExtImpl/DynExtDefaultImplDefDefPub.as | 82 + .../DefaultClass.as | 251 + .../DynExtDefaultImplDefDefPub/DefaultInt.as | 40 + .../DefaultIntDef.as | 41 + .../DynExtDefaultImplDefDefPub.as | 126 + .../ExtImpl/DynExtDefaultImplDefPub.as | 54 + .../DynExtDefaultImplDefPub/DefaultClass.as | 251 + .../DynExtDefaultImplDefPub/DefaultIntDef.as | 41 + .../DynExtDefaultImplDefPub.as | 94 + .../ExtImpl/DynExtDefaultImplDefPubStat.as | 145 + .../DefaultClass.as | 251 + .../DefaultIntDef.as | 40 + .../DynExtDefaultImplDefPubStat.as | 246 + .../ExtImpl/DynExtDynamicImplDefDef.as | 165 + .../DynExtDynamicImplDefDef/ADynamicClass.as | 230 + .../DynExtDynamicImplDefDef/DefaultInt.as | 40 + .../DynExtDynamicImplDefDef/DefaultIntDef.as | 41 + .../DynExtDynamicImplDefDef.as | 169 + .../ExtImpl/DynExtDynamicImplDefDefPub.as | 81 + .../ADynamicClass.as | 230 + .../DynExtDynamicImplDefDefPub/DefaultInt.as | 40 + .../DefaultIntDef.as | 41 + .../DynExtDynamicImplDefDefPub.as | 127 + .../ExtImpl/DynExtDynamicImplDefPub.as | 63 + .../DynExtDynamicImplDefPub/ADynamicClass.as | 230 + .../DynExtDynamicImplDefPub/DefaultIntDef.as | 41 + .../DynExtDynamicImplDefPub.as | 107 + ...ubClassExtDynIntClassImpIntIntExtPubPub.as | 102 + .../PublicSubClass.as | 93 + ...inPubClassExtIntClassImpIntIntExtPubPub.as | 101 + .../PublicSubClass.as | 93 + .../ExtImpl/ExtDefImplDefDefPrivStatErr1.as | 57 + .../ExtImpl/ExtDefImplDefDefPubStatErr1.as | 61 + .../Classes/ExtImpl/ExtDefaultImplDefDef.as | 79 + .../ExtDefaultImplDefDef/DefaultClass.as | 251 + .../ExtDefaultImplDefDef/DefaultInt.as | 39 + .../ExtDefaultImplDefDef/DefaultIntDef.as | 41 + .../ExtDefaultImplDefDef.as | 163 + .../ExtImpl/ExtDefaultImplDefDefPub.as | 61 + .../ExtDefaultImplDefDefPub/DefaultClass.as | 251 + .../ExtDefaultImplDefDefPub/DefaultInt.as | 41 + .../ExtDefaultImplDefDefPub/DefaultIntDef.as | 41 + .../ExtDefaultImplDefDefPub.as | 105 + .../Classes/ExtImpl/ExtDefaultImplDefPub.as | 54 + .../ExtDefaultImplDefPub/DefaultClass.as | 152 + .../ExtDefaultImplDefPub/DefaultIntDef.as | 40 + .../ExtDefaultImplDefPub.as | 93 + .../ExtImpl/ExtDynamicImplDefDefPub.as | 79 + .../ExtDynamicImplDefDefPub/DefaultInt.as | 41 + .../ExtDynamicImplDefDefPub/DefaultIntDef.as | 41 + .../ExtDynamicImplDefDefPub/DynamicClass.as | 230 + .../ExtDynamicImplDefDefPub.as | 127 + .../ExtImpl/ExtDynamicImplDefDefStat.as | 222 + .../ExtDynamicImplDefDefStat/DefaultInt.as | 40 + .../ExtDynamicImplDefDefStat/DefaultIntDef.as | 41 + .../ExtDynamicImplDefDefStat/DynamicClass.as | 243 + .../ExtDynamicImplDefDefStat.as | 248 + .../Classes/ExtImpl/ExtDynamicImplDefPub.as | 61 + .../ExtDynamicImplDefPub/DefaultIntDef.as | 41 + .../ExtDynamicImplDefPub/DynamicClass.as | 230 + .../ExtDynamicImplDefPub.as | 100 + .../ExtImpl/FinExtDefaultImplDefDefPub.as | 51 + .../DefaultClass.as | 251 + .../FinExtDefaultImplDefDefPub/DefaultInt.as | 40 + .../DefaultIntDef.as | 40 + .../FinExtDefaultImplDefDefPub.as | 172 + .../ExtImpl/FinExtDefaultImplDefPub.as | 46 + .../FinExtDefaultImplDefPub/DefaultClass.as | 251 + .../FinExtDefaultImplDefPub/DefaultIntDef.as | 40 + .../FinExtDefaultImplDefPub.as | 189 + .../ExtImpl/FinExtDefaultImplDefStat.as | 46 + .../FinExtDefaultImplDefStat/DefaultClass.as | 251 + .../FinExtDefaultImplDefStat/DefaultIntDef.as | 41 + .../FinExtDefaultImplDefStat.as | 260 + .../ExtImpl/FinExtDynamicImplDefDefPub.as | 50 + .../FinExtDynamicImplDefDefPub/DefaultInt.as | 40 + .../DefaultIntDef.as | 41 + .../DynamicClass.as | 230 + .../FinExtDynamicImplDefDefPub.as | 173 + .../ExtImpl/FinExtDynamicImplDefPub.as | 46 + .../FinExtDynamicImplDefPub/DefaultIntDef.as | 41 + .../FinExtDynamicImplDefPub/DynamicClass.as | 230 + .../FinExtDynamicImplDefPub.as | 145 + .../ExtImpl/FinExtDynamicImplDefPubStat.as | 47 + .../FinExtDynamicImplDefPubStat/DefaultInt.as | 40 + .../DefaultIntDef.as | 41 + .../DynamicClass.as | 230 + .../FinExtDynamicImplDefPubStat.as | 253 + .../Classes/ExtImpl/FinExtPublicImplDef.as | 46 + .../FinExtPublicImplDef/APublicClass.as | 249 + .../FinExtPublicImplDef/DefaultIntDef.as | 41 + .../FinExtPublicImplDef.as | 224 + .../ExtImpl/FinExtPublicImplDefDefPub.as | 50 + .../FinExtPublicImplDefDefPub/APublicClass.as | 249 + .../FinExtPublicImplDefDefPub/DefaultInt.as | 40 + .../DefaultIntDef.as | 41 + .../FinExtPublicImplDefDefPub.as | 173 + .../Classes/ExtImpl/FinExtPublicImplDefPub.as | 47 + .../FinExtPublicImplDefPub/APublicClass.as | 249 + .../FinExtPublicImplDefPub/DefaultIntDef.as | 41 + .../FinExtPublicImplDefPub.as | 146 + .../IntClassExtIntClassImpIntIntExtIntPub.as | 92 + .../InternalSubClass.as | 96 + .../IntClassExtPubClassImpPubIntExtPubPub.as | 93 + .../InternalSubClass.as | 78 + .../ExtImpl/IntsubExtIntClassImpDefInt.as | 57 + .../DefaultInterface.as | 51 + .../InternalClass.as | 66 + .../InternalsubClass.as | 72 + .../ExtImpl/IntsubExtIntClassImpIntInt.as | 55 + .../IntsubExtIntClassImpIntInt.as | 91 + .../ExtImpl/IntsubExtIntClassImpPubInt.as | 57 + .../IntsubExtIntClassImpPubInt.as | 87 + .../PubClassExtIntClassImpIntIntExtIntPub.as | 101 + .../PublicSubClass.as | 95 + .../PubClassExtIntClassImpIntIntExtPubPub.as | 101 + .../PublicSubClass.as | 93 + .../PubClassExtIntClassImpPubIntExtPubPub.as | 93 + .../PublicSubClass.as | 78 + .../PubClassExtPubClassImpIntIntExtIntPub.as | 101 + .../PublicSubClass.as | 92 + .../PubClassExtPubClassImpIntIntExtPubPub.as | 101 + .../PublicSubClass.as | 92 + .../PubClassExtPubClassImpPubIntExtIntPub.as | 93 + .../PublicSubClass.as | 76 + .../PubClassExtPubClassImpPubIntExtPubPub.as | 97 + .../PublicSuperClass.as | 68 + .../PubClassExtPubClassImpPubIntExtPubPub2.as | 94 + .../PublicSubClass.as | 76 + .../ExtImpl/PubExtDefaultImplDefDefPub.as | 79 + .../DefaultClass.as | 251 + .../PubExtDefaultImplDefDefPub/DefaultInt.as | 40 + .../DefaultIntDef.as | 41 + .../PubExtDefaultImplDefDefPub.as | 130 + .../ExtImpl/PubExtDefaultImplDefDefPubStat.as | 64 + .../DefaultClass.as | 264 + .../DefaultInt.as | 40 + .../DefaultIntDef.as | 41 + .../PubExtDefaultImplDefDefPubStat.as | 239 + .../ExtImpl/PubExtDefaultImplDefPub.as | 54 + .../PubExtDefaultImplDefPub/DefaultClass.as | 251 + .../PubExtDefaultImplDefPub/DefaultIntDef.as | 41 + .../PubExtDefaultImplDefPub.as | 106 + .../ExtImpl/PubExtDynamicImplDefDefPub.as | 81 + .../PubExtDynamicImplDefDefPub/DefaultInt.as | 40 + .../DefaultIntDef.as | 41 + .../DynamicClass.as | 230 + .../PubExtDynamicImplDefDefPub.as | 124 + .../ExtImpl/PubExtDynamicImplDefPub.as | 63 + .../PubExtDynamicImplDefPub/DefaultIntDef.as | 41 + .../PubExtDynamicImplDefPub/DynamicClass.as | 230 + .../PubExtDynamicImplDefPub.as | 106 + .../ExtImpl/PubExtDynamicImplDefStat.as | 169 + .../PubExtDynamicImplDefStat/DefaultInt.as | 40 + .../PubExtDynamicImplDefStat/DefaultIntDef.as | 41 + .../PubExtDynamicImplDefStat/DynamicClass.as | 230 + .../PubExtDynamicImplDefStat.as | 192 + .../Classes/ExtImpl/PubExtPublicImplDefDef.as | 166 + .../PubExtPublicImplDefDef/APublicClass.as | 249 + .../PubExtPublicImplDefDef/DefaultInt.as | 41 + .../PubExtPublicImplDefDef/DefaultIntDef.as | 41 + .../PubExtPublicImplDefDef.as | 183 + .../ExtImpl/PubExtPublicImplDefDefPub.as | 81 + .../PubExtPublicImplDefDefPub/APublicClass.as | 249 + .../PubExtPublicImplDefDefPub/DefaultInt.as | 40 + .../DefaultIntDef.as | 41 + .../PubExtPublicImplDefDefPub.as | 125 + .../Classes/ExtImpl/PubExtPublicImplDefPub.as | 63 + .../PubExtPublicImplDefPub/APublicClass.as | 249 + .../PubExtPublicImplDefPub/DefaultIntDef.as | 41 + .../PubExtPublicImplDefPub.as | 104 + .../ExtImpl/PubSubExtIntClassImpDefaultInt.as | 57 + .../DefaultInterface.as | 51 + .../InternalClass.as | 66 + .../PublicsubClass.as | 63 + .../ExtImpl/PubSubExtPubClassImpDefInt.as | 58 + .../DefaultInterface.as | 51 + .../PubSubExtPubClassImpDefInt/PublicClass.as | 63 + .../PublicsubClass.as | 59 + .../ExtImpl/PubSubExtPubClassImpIntInt.as | 58 + .../InternalInterface.as | 51 + .../PubSubExtPubClassImpIntInt/PublicClass.as | 64 + .../PublicsubClass.as | 59 + .../ExtImpl/PubSubExtPubClassImpPubInt.as | 58 + .../PubSubExtPubClassImpPubInt/PublicClass.as | 63 + .../PublicInterface.as | 51 + .../PublicsubClass.as | 59 + .../Classes/Impl/DefClassImpDefInt.as | 51 + .../Impl/DefClassImpDefInt/DefaultClass.as | 55 + .../DefClassImpDefInt/DefaultInterface.as | 45 + .../Classes/Impl/DefClassImpDefIntInt.as | 51 + .../Impl/DefClassImpDefIntInt/DefaultClass.as | 55 + .../DefClassImpDefIntInt/DefaultInterface.as | 45 + .../DefaultInterface_S.as | 45 + .../Classes/Impl/DefClassImpDefIntIntname.as | 54 + .../DefClassImpDefIntIntname/DefaultClass.as | 57 + .../DefaultInterface.as | 45 + .../DefaultInterface_S.as | 45 + .../Classes/Impl/DefClassImpDefIntname.as | 52 + .../DefClassImpDefIntname/DefaultClass.as | 59 + .../DefClassImpDefIntname/DefaultInterface.as | 45 + .../Classes/Impl/DefClassImpDefIntpubname.as | 52 + .../DefClassImpDefIntpubname/DefaultClass.as | 56 + .../DefaultInterface.as | 48 + .../Classes/Impl/DefClassImpInternalInt.as | 51 + .../DefClassImpInternalInt/DefaultClass.as | 51 + .../InternalInterface.as | 46 + .../Classes/Impl/DefClassImpInternalIntInt.as | 51 + .../DefClassImpInternalIntInt/DefaultClass.as | 55 + .../DefaultInterface.as | 45 + .../DefaultInterface_S.as | 45 + .../Impl/DefClassImpInternalIntIntname.as | 54 + .../DefaultClass.as | 61 + .../InternalInterface.as | 46 + .../InternalInterface_S.as | 46 + .../Impl/DefClassImpInternalIntname.as | 52 + .../DefaultClass.as | 58 + .../InternalInterface.as | 51 + .../Impl/DefClassImpInternalIntpubname.as | 52 + .../DefaultClass.as | 53 + .../InternalInterface.as | 45 + .../Classes/Impl/DefClassImpPublicInt.as | 56 + .../Impl/DefClassImpPublicInt/DefaultClass.as | 51 + .../DefClassImpPublicInt/PublicInterface.as | 45 + .../Classes/Impl/DefClassImpPublicIntInt.as | 56 + .../DefClassImpPublicIntInt/DefaultClass.as | 51 + .../PublicInterface.as | 44 + .../PublicInterface_S.as | 44 + .../Impl/DefClassImpPublicIntIntname.as | 54 + .../DefaultClass.as | 57 + .../PublicInterface.as | 45 + .../PublicInterface_S.as | 45 + .../Classes/Impl/DefClassImpPublicIntname.as | 56 + .../DefClassImpPublicIntname/DefaultClass.as | 54 + .../PublicInterface.as | 45 + .../Impl/DefClassImpPublicIntpubname.as | 54 + .../DefaultClass.as | 53 + .../PublicInterface.as | 45 + .../Classes/Impl/DynamicClassImpDefInt.as | 52 + .../DynamicClassImpDefInt/DefaultInterface.as | 45 + .../DynamicClassImpDefInt/DynamicClass.as | 59 + .../Classes/Impl/DynamicClassImpDefIntname.as | 52 + .../DefaultInterface.as | 45 + .../DynamicClassImpDefIntname/DynamicClass.as | 55 + .../Impl/DynamicClassImpDefIntpubname.as | 52 + .../DefaultInterface.as | 45 + .../DynamicClass.as | 55 + .../Impl/DynamicClassImpInternalInt.as | 51 + .../DynamicClass.as | 63 + .../InternalInterface.as | 45 + .../Impl/DynamicClassImpInternalIntname.as | 51 + .../DynamicClass.as | 60 + .../InternalInterface.as | 45 + .../Impl/DynamicClassImpInternalIntpubname.as | 51 + .../DynamicClass.as | 52 + .../InternalInterface.as | 45 + .../Classes/Impl/DynamicClassImpPublicInt.as | 51 + .../DynamicClassImpPublicInt/DynamicClass.as | 60 + .../PublicInterface.as | 45 + .../Impl/DynamicClassImpPublicIntname.as | 51 + .../DynamicClass.as | 62 + .../PublicInterface.as | 45 + .../Impl/DynamicClassImpPublicIntpubname.as | 51 + .../DynamicClass.as | 60 + .../PublicInterface.as | 45 + .../Classes/Impl/FinalClassImpDefInt.as | 52 + .../FinalClassImpDefInt/DefaultInterface.as | 45 + .../Impl/FinalClassImpDefInt/FinalClass.as | 53 + .../Classes/Impl/FinalClassImpDefIntInt.as | 52 + .../DefaultInterface.as | 45 + .../DefaultInterface_S.as | 45 + .../Impl/FinalClassImpDefIntInt/FinalClass.as | 52 + .../Impl/FinalClassImpDefIntIntname.as | 54 + .../DefaultInterface.as | 45 + .../DefaultInterface_S.as | 45 + .../FinalClassImpDefIntIntname/FinalClass.as | 59 + .../Classes/Impl/FinalClassImpDefIntname.as | 52 + .../DefaultInterface.as | 45 + .../FinalClassImpDefIntname/FinalClass.as | 54 + .../Impl/FinalClassImpDefIntpubname.as | 52 + .../DefaultInterface.as | 45 + .../FinalClassImpDefIntpubname/FinalClass.as | 53 + .../Classes/Impl/FinalClassImpInternalInt.as | 51 + .../FinalClassImpInternalInt/FinalClass.as | 54 + .../InternalInterface.as | 44 + .../Impl/FinalClassImpInternalIntInt.as | 51 + .../FinalClassImpInternalIntInt/FinalClass.as | 52 + .../InternalInterface.as | 43 + .../InternalInterface_S.as | 43 + .../Impl/FinalClassImpInternalIntIntname.as | 53 + .../FinalClass.as | 57 + .../InternalInterface.as | 44 + .../InternalInterface_S.as | 44 + .../Impl/FinalClassImpInternalIntname.as | 51 + .../FinalClass.as | 53 + .../InternalInterface.as | 44 + .../Impl/FinalClassImpInternalIntpubname.as | 51 + .../FinalClass.as | 54 + .../InternalInterface.as | 44 + .../Classes/Impl/FinalClassImpPublicInt.as | 50 + .../Impl/FinalClassImpPublicInt/FinalClass.as | 54 + .../FinalClassImpPublicInt/PublicInterface.as | 45 + .../Classes/Impl/FinalClassImpPublicIntInt.as | 50 + .../FinalClassImpPublicIntInt/FinalClass.as | 54 + .../PublicInterface.as | 45 + .../PublicInterface_S.as | 45 + .../Impl/FinalClassImpPublicIntIntname.as | 53 + .../FinalClass.as | 60 + .../PublicInterface.as | 45 + .../PublicInterface_S.as | 45 + .../Impl/FinalClassImpPublicIntname.as | 50 + .../FinalClassImpPublicIntname/FinalClass.as | 55 + .../PublicInterface.as | 45 + .../Impl/FinalClassImpPublicIntpubname.as | 50 + .../FinalClass.as | 52 + .../PublicInterface.as | 45 + .../Classes/Impl/InternalClassImpDefInt.as | 52 + .../DefaultInterface.as | 45 + .../InternalClassImpDefInt/InternalClass.as | 54 + .../Impl/InternalClassImpDefIntname.as | 52 + .../DefaultInterface.as | 45 + .../InternalClass.as | 55 + .../Impl/InternalClassImpDefIntpubname.as | 52 + .../DefaultInterface.as | 45 + .../InternalClass.as | 54 + .../Impl/InternalClassImpInternalInt.as | 53 + .../InternalClass.as | 55 + .../InternalInterface.as | 45 + .../Impl/InternalClassImpInternalIntname.as | 53 + .../InternalClass.as | 58 + .../InternalInterface.as | 45 + .../InternalClassImpInternalIntpubname.as | 53 + .../InternalClass.as | 55 + .../InternalInterface.as | 45 + .../Classes/Impl/PublicClassImpDefInt.as | 51 + .../PublicClassImpDefInt/DefaultInterface.as | 45 + .../Impl/PublicClassImpDefInt/PublicClass.as | 46 + .../Classes/Impl/PublicClassImpDefIntInt.as | 51 + .../DefaultInterface.as | 45 + .../DefaultInterface_S.as | 45 + .../PublicClassImpDefIntInt/PublicClass.as | 46 + .../Impl/PublicClassImpDefIntIntname.as | 52 + .../DefaultInterface.as | 45 + .../DefaultInterface_S.as | 45 + .../PublicClass.as | 54 + .../Classes/Impl/PublicClassImpDefIntname.as | 51 + .../DefaultInterface.as | 45 + .../PublicClassImpDefIntname/PublicClass.as | 51 + .../Impl/PublicClassImpDefIntpubname.as | 51 + .../DefaultInterface.as | 45 + .../PublicClass.as | 46 + .../Classes/Impl/PublicClassImpInternalInt.as | 51 + .../InternalInterface.as | 44 + .../PublicClassImpInternalInt/PublicClass.as | 48 + .../Impl/PublicClassImpInternalIntInt.as | 51 + .../InternalInterface.as | 44 + .../InternalInterface_S.as | 44 + .../PublicClass.as | 48 + .../Impl/PublicClassImpInternalIntIntname.as | 53 + .../InternalInterface.as | 44 + .../InternalInterface_S.as | 44 + .../PublicClass.as | 54 + .../Impl/PublicClassImpInternalIntname.as | 51 + .../InternalInterface.as | 44 + .../PublicClass.as | 50 + .../Impl/PublicClassImpInternalIntpubname.as | 51 + .../InternalInterface.as | 44 + .../PublicClass.as | 48 + .../Classes/Impl/PublicClassImpPublicInt.as | 52 + .../PublicClassImpPublicInt/PublicClass.as | 47 + .../PublicInterface.as | 45 + .../Impl/PublicClassImpPublicIntInt.as | 52 + .../PublicClassImpPublicIntInt/PublicClass.as | 47 + .../PublicInterface.as | 45 + .../PublicInterface_S.as | 45 + .../Impl/PublicClassImpPublicIntIntname.as | 54 + .../PublicClass.as | 51 + .../PublicInterface.as | 45 + .../PublicInterface_S.as | 45 + .../Impl/PublicClassImpPublicIntname.as | 52 + .../PublicClass.as | 47 + .../PublicInterface.as | 45 + .../Impl/PublicClassImpPublicIntpubname.as | 52 + .../PublicClass.as | 47 + .../PublicInterface.as | 45 + .../MethodClosures/AddMCToDynamicClass.as | 67 + .../AddMCToDynamicClass/DynamicClass.as | 35 + .../AddMCToDynamicClass/SomeClass.as | 39 + .../MethodClosures/DefClassExtractMeth.as | 59 + .../DefClassExtractMeth/ADefaultClass.as | 46 + .../DefClassExtractMeth.as | 33 + .../MethodClosures/FinClassExtractMeth.as | 65 + .../FinClassExtractMeth.as | 46 + .../MethodClosures/GetMCFromDynamicClass.as | 71 + .../GetMCFromDynamicClass/DynamicClass.as | 35 + .../MethodClosures/GetMCFromNamespace.as | 70 + .../GetMCFromNamespace/GetMCFromNamespace.as | 41 + .../MethodClosures/GetMCFromOverRideMethod.as | 68 + .../GetMCFromOverRideMethod/BaseClass.as | 37 + .../GetMCFromOverRideMethod.as | 37 + .../MethodClosures/GetMCFromSuperClass.as | 67 + .../GetMCFromSuperClass/BaseClass.as | 37 + .../GetMCFromSuperClass.as | 33 + .../MethodClosures/IntClassExtractMeth.as | 60 + .../IntClassExtractMeth/AInternalClass.as | 46 + .../IntClassExtractMeth.as | 33 + .../MethodClosures/PubClassExtractMeth.as | 65 + .../PubClassExtractMeth.as | 46 + .../Override/DynExtDefaultOverRideDefault.as | 53 + .../DefaultClass.as | 287 + .../DynExtDefaultOverRideDefault.as | 65 + .../Override/DynExtDefaultOverRidePublic.as | 56 + .../DefaultClass.as | 286 + .../DynExtDefaultOverRidePublic.as | 61 + .../Override/DynExtDefaultOverRideVirtual.as | 57 + .../DefaultClass.as | 286 + .../DynExtDefaultOverRideVirtual.as | 74 + .../Override/DynExtDynamicOverRideDefault.as | 53 + .../ADynamicClass.as | 212 + .../DynExtDynamicOverRideDefault.as | 64 + .../Override/DynExtDynamicOverRidePublic.as | 53 + .../ADynamicClass.as | 210 + .../DynExtDynamicOverRidePublic.as | 59 + .../Override/DynExtInternalOverRidePublic.as | 53 + .../AInternalClass.as | 70 + .../DynExtInternalOverRidePublic.as | 59 + .../Override/DynExtPublicOverRideDefault.as | 55 + .../APublicClass.as | 272 + .../DynExtPublicOverRideDefault.as | 71 + .../Override/DynExtPublicOverRidePublic.as | 56 + .../APublicClass.as | 271 + .../DynExtPublicOverRidePublic.as | 63 + .../Override/ExtDefaultOverRideDefault.as | 51 + .../ExtDefaultOverRideDefault/DefaultClass.as | 286 + .../ExtDefaultOverRideDefault.as | 65 + .../Override/ExtDefaultOverRideInternal.as | 51 + .../DefaultClass.as | 70 + .../ExtDefaultOverRideInternal.as | 63 + .../Override/ExtDefaultOverRidePublic.as | 57 + .../ExtDefaultOverRidePublic/DefaultClass.as | 287 + .../ExtDefaultOverRidePublic.as | 62 + .../Override/ExtDynamicOverRideDefault.as | 53 + .../ExtDynamicOverRideDefault/DynamicClass.as | 210 + .../ExtDynamicOverRideDefault.as | 64 + .../Override/ExtDynamicOverRidePublic.as | 53 + .../ExtDynamicOverRidePublic/DynamicClass.as | 209 + .../ExtDynamicOverRidePublic.as | 59 + .../Override/ExtInternalOverRideInternal.as | 51 + .../AInternalClass.as | 70 + .../ExtInternalOverRideInternal.as | 63 + .../Override/ExtPublicOverRideDefault.as | 56 + .../ExtPublicOverRideDefault/APublicClass.as | 270 + .../ExtPublicOverRideDefault.as | 68 + .../Override/ExtPublicOverRideProtected.as | 53 + .../APublicClass.as | 75 + .../ExtPublicOverRideProtected.as | 66 + .../Override/ExtPublicOverRidePublic.as | 56 + .../ExtPublicOverRidePublic/APublicClass.as | 270 + .../ExtPublicOverRidePublic.as | 63 + .../Override/ExtPublicOverRideVirtual.as | 58 + .../ExtPublicOverRideVirtual/APublicClass.as | 270 + .../ExtPublicOverRideVirtual.as | 68 + .../Override/FinExtDefaultOverRideDefault.as | 53 + .../DefaultClass.as | 286 + .../FinExtDefaultOverRideDefault.as | 64 + .../Override/FinExtDefaultOverRidePublic.as | 53 + .../DefaultClass.as | 285 + .../FinExtDefaultOverRidePublic.as | 58 + .../Override/FinExtDynamicOverRideDefault.as | 54 + .../DynamicClass.as | 209 + .../FinExtDynamicOverRideDefault.as | 62 + .../Override/FinExtDynamicOverRidePublic.as | 53 + .../DynamicClass.as | 210 + .../FinExtDynamicOverRidePublic.as | 58 + .../Override/FinExtPublicOverRideDefault.as | 56 + .../APublicClass.as | 270 + .../FinExtPublicOverRideDefault.as | 66 + .../Override/FinExtPublicOverRidePublic.as | 55 + .../APublicClass.as | 271 + .../FinExtPublicOverRidePublic.as | 61 + .../IntExtDefaultOverRideProtected.as | 55 + .../DefaultClass.as | 48 + .../IntExtDefaultOverRideProtected.as | 58 + .../Override/IntExtDynamicOverRidePublic.as | 55 + .../DynamicClass.as | 49 + .../IntExtDynamicOverRidePublic.as | 58 + .../Override/IntExtInternalOverRidePublic.as | 55 + .../AInternalClass.as | 49 + .../IntExtInternalOverRidePublic.as | 58 + .../Override/IntExtPublicOverRideInternal.as | 55 + .../APublicClass.as | 49 + .../IntExtPublicOverRideInternal.as | 58 + .../Classes/Override/MethodInNamespace.as | 57 + .../Override/MethodInNamespace/BaseClass.as | 47 + .../MethodInNamespace/MethodInNamespace.as | 41 + .../Classes/Override/OverrideGetterSetter.as | 54 + .../OverrideGetterSetter/BaseClass.as | 42 + .../OverrideGetterSetter.as | 51 + .../Override/OverrideMethAtRuntimeErr.as | 59 + .../Classes/Override/OverrideNoParamType.as | 52 + .../Override/OverrideNoParamType/BaseClass.as | 37 + .../OverrideNoParamType.as | 37 + .../Override/OverrideWithOptionalParams.as | 67 + .../OverrideWithOptionalParams/BaseClass.as | 52 + .../OverrideWithOptionalParams.as | 50 + .../Override/PubExtDefaultOverRideDefault.as | 53 + .../DefaultClass.as | 285 + .../PubExtDefaultOverRideDefault.as | 62 + .../Override/PubExtDefaultOverRideInternal.as | 54 + .../DefaultClass.as | 70 + .../PubExtDefaultOverRideInternal.as | 61 + .../Override/PubExtDefaultOverRidePublic.as | 52 + .../DefaultClass.as | 285 + .../PubExtDefaultOverRidePublic.as | 56 + .../Override/PubExtDynamicOverRideDefault.as | 53 + .../DynamicClass.as | 210 + .../PubExtDynamicOverRideDefault.as | 62 + .../Override/PubExtDynamicOverRidePublic.as | 53 + .../DynamicClass.as | 210 + .../PubExtDynamicOverRidePublic.as | 58 + .../Override/PubExtInternalOverRidePublic.as | 51 + .../InternalClass.as | 70 + .../PubExtInternalOverRidePublic.as | 54 + .../Override/PubExtPublicOverRideDefault.as | 56 + .../APublicClass.as | 271 + .../PubExtPublicOverRideDefault.as | 66 + .../Override/PubExtPublicOverRidePublic.as | 56 + .../APublicClass.as | 271 + .../PubExtPublicOverRidePublic.as | 61 + .../Classes/Override/SuperDifferentMethod.as | 56 + .../SuperDifferentMethod/BaseClass.as | 41 + .../SuperDifferentMethod.as | 43 + .../Override/SuperDifferentNamespace.as | 56 + .../SuperDifferentNamespace/BaseClass.as | 40 + .../SuperDifferentNamespace.as | 39 + .../Classes/Override/SuperRTError.as | 65 + .../Override/SuperRTError/BaseClass.as | 39 + .../SuperRTError/SuperInNamespaceErr.as | 40 + .../Classes/Override/SuperSameMethod.as | 55 + .../Override/SuperSameMethod/BaseClass.as | 35 + .../SuperSameMethod/SuperSameMethod.as | 37 + .../Classes/Override/SuperSameNamespace.as | 56 + .../Override/SuperSameNamespace/BaseClass.as | 37 + .../SuperSameNamespace/SuperSameNamespace.as | 37 + .../Definitions/Function/EmptyFunctionBody.as | 100 + .../Function/EmptyFunctionBody/Custom.as | 34 + .../Function/EmptyFunctionBody/TestObj.as | 53 + .../EmptyFunctionBody/noReturnCustomParam.as | 35 + .../EmptyFunctionBody/noReturnNoParams.as | 35 + .../EmptyFunctionBody/noReturnParams.as | 35 + .../EmptyFunctionBody/returnCustomNoParams.as | 36 + .../EmptyFunctionBody/returnNoParams.as | 35 + .../EmptyFunctionBody/returnParams.as | 35 + .../Definitions/Function/EmptyFunctionName.as | 144 + .../Function/EmptyFunctionName/TestNameObj.as | 76 + .../Function/EmptyFunctionName/pub$a1.as | 35 + .../Function/EmptyFunctionName/pubC1.as | 35 + .../Function/EmptyFunctionName/pub__a1.as | 35 + .../Function/EmptyFunctionName/pub__a1__.as | 35 + .../Function/EmptyFunctionName/pub_a1.as | 35 + .../Function/EmptyFunctionName/pub_a1_.as | 35 + .../Function/EmptyFunctionName/puba$1.as | 35 + .../Function/EmptyFunctionName/puba1$.as | 35 + .../Function/EmptyFunctionName/puba1.as | 35 + .../Function/EmptyFunctionName/puba_1.as | 35 + .../Function/EmptyFunctionName/pubcases.as | 39 + .../Definitions/Function/FinalFunctionBody.as | 75 + .../Function/FinalFunctionBody/Custom.as | 34 + .../Function/FinalFunctionBody/TestObj.as | 53 + .../Definitions/Function/FinalFunctionName.as | 101 + .../Function/FinalFunctionName/TestNameObj.as | 76 + .../Function/FinalFunctionName/pub$a1.as | 35 + .../Function/FinalFunctionName/pubC1.as | 35 + .../Function/FinalFunctionName/pub__a1.as | 35 + .../Function/FinalFunctionName/pub__a1__.as | 35 + .../Function/FinalFunctionName/pub_a1.as | 35 + .../Function/FinalFunctionName/pub_a1_.as | 35 + .../Function/FinalFunctionName/puba$1.as | 35 + .../Function/FinalFunctionName/puba1$.as | 35 + .../Function/FinalFunctionName/puba1.as | 35 + .../Function/FinalFunctionName/puba_1.as | 35 + .../Function/FinalFunctionName/pubcases.as | 39 + .../Function/MultiOptArgFunction.as | 190 + .../Function/MultiOptArgFunction/Boolean.as | 35 + .../Function/MultiOptArgFunction/Number.as | 35 + .../Function/MultiOptArgFunction/String.as | 36 + .../Function/MultiOptArgFunction/TestObj.as | 44 + .../MultiOptArgFunction/returnArguments.as | 41 + .../Function/MultipleExtraArgFunction1.as | 61 + .../MultipleExtraArgFunction1Class.as | 36 + .../MultipleExtraArgFunction1/TestObj.as | 42 + .../MultipleExtraArgFunction1/returnRest.as | 36 + .../Function/MultipleExtraArgFunction2.as | 65 + .../MultipleExtraArgFunction2Class.as | 49 + .../MultipleExtraArgFunction2/TestObj.as | 58 + .../MultipleExtraArgFunction2/returnRest.as | 52 + .../Function/MultipleExtraArgFunction3.as | 67 + .../MultipleExtraArgFunction3/Inter.as | 37 + .../MultipleExtraArgFunction3Class.as | 49 + .../MultipleExtraArgFunction3/TestObj.as | 49 + .../MultipleExtraArgFunction3/returnRest.as | 43 + .../Function/NamespaceFunctionBody.as | 78 + .../Function/NamespaceFunctionBody/Custom.as | 35 + .../Function/NamespaceFunctionBody/TestObj.as | 43 + .../Function/NamespaceFunctionName.as | 103 + .../NamespaceFunctionName/TestNameObj.as | 58 + .../Function/NoExtraArgFunction.as | 62 + .../NoExtraArgFunctionClass.as | 38 + .../Function/NoExtraArgFunction/TestObj.as | 42 + .../Function/NoExtraArgFunction/returnRest.as | 35 + .../Function/OneExtraArgFunction.as | 117 + .../OneExtraArgFunctionClass.as | 37 + .../Function/OneExtraArgFunction/TestObj.as | 42 + .../OneExtraArgFunction/returnRest.as | 35 + .../Definitions/Function/OneOptArgFunction.as | 94 + .../Function/OneOptArgFunction/Boolean.as | 36 + .../Function/OneOptArgFunction/Number.as | 36 + .../OneOptArgFunctionClass.as | 39 + .../Function/OneOptArgFunction/String.as | 37 + .../Function/OneOptArgFunction/TestObj.as | 48 + .../Function/OverrideFunctionBody.as | 87 + .../Function/OverrideFunctionBody/Custom.as | 34 + .../Function/OverrideFunctionBody/TestObj.as | 51 + .../Function/OverrideFunctionName.as | 124 + .../OverrideFunctionName/TestNameObj.as | 78 + .../Function/PrivateFunctionBody.as | 82 + .../Function/PrivateFunctionBody/Custom.as | 34 + .../Function/PrivateFunctionBody/TestObj.as | 51 + .../Function/PrivateFunctionName.as | 108 + .../PrivateFunctionName/TestNameObj.as | 65 + .../Function/PublicFunctionBody.as | 97 + .../Function/PublicFunctionBody/Custom.as | 34 + .../Function/PublicFunctionBody/TestObj.as | 52 + .../PublicFunctionBody/noReturnCustomParam.as | 35 + .../PublicFunctionBody/noReturnNoParams.as | 35 + .../PublicFunctionBody/noReturnParams.as | 35 + .../returnCustomNoParams.as | 36 + .../PublicFunctionBody/returnNoParams.as | 35 + .../PublicFunctionBody/returnParams.as | 35 + .../Function/PublicFunctionName.as | 146 + .../PublicFunctionName/TestNameObj.as | 74 + .../Function/PublicFunctionName/pub$a1.as | 35 + .../Function/PublicFunctionName/pubC1.as | 35 + .../Function/PublicFunctionName/pub__a1.as | 35 + .../Function/PublicFunctionName/pub__a1__.as | 35 + .../Function/PublicFunctionName/pub_a1.as | 35 + .../Function/PublicFunctionName/pub_a1_.as | 35 + .../Function/PublicFunctionName/puba$1.as | 35 + .../Function/PublicFunctionName/puba1$.as | 35 + .../Function/PublicFunctionName/puba1.as | 35 + .../Function/PublicFunctionName/puba_1.as | 35 + .../Function/PublicFunctionName/puball.as | 35 + .../Function/PublicFunctionName/pubcases.as | 38 + .../as3/Definitions/Function/RestGlobal.as | 64 + .../Function/StaticFunctionBody.as | 74 + .../Function/StaticFunctionBody/Custom.as | 34 + .../Function/StaticFunctionBody/TestObj.as | 52 + .../Function/StaticFunctionName.as | 97 + .../StaticFunctionName/TestNameObj.as | 74 + .../Function/StaticPrivateFunctionName.as | 60 + .../StaticPrivateFunctionName/TestNameObj.as | 72 + .../Function/StaticPublicFunctionName.as | 62 + .../StaticPublicFunctionName/TestNameObj.as | 74 + .../Function/ThreeOptArgFunction.as | 105 + .../Function/ThreeOptArgFunction/Boolean.as | 35 + .../Function/ThreeOptArgFunction/Number.as | 35 + .../Function/ThreeOptArgFunction/String.as | 36 + .../Function/ThreeOptArgFunction/TestObj.as | 50 + .../ThreeOptArgFunction/returnArguments.as | 44 + .../Function/VirtualFunctionBody.as | 74 + .../Function/VirtualFunctionBody/Custom.as | 34 + .../Function/VirtualFunctionBody/TestObj.as | 52 + .../Function/VirtualFunctionName.as | 101 + .../VirtualFunctionName/TestNameObj.as | 74 + .../Definitions/Function/VoidEvaluation.as | 59 + .../Function/VoidEvaluation/TestObj.as | 50 + .../as3/Definitions/Function/bug152222.as | 50 + .../Function/functionReturnTypes.as | 430 + .../functionReturnTypes/TestClassA.as | 33 + .../functionReturnTypes/TestClassB.as | 33 + .../functionReturnTypes/TestClassC.as | 33 + .../functionReturnTypes/TestInterface.as | 33 + .../FunctionAccessors/GetSetAllowedNames.as | 82 + .../GetSetAllowedNames/GetSetAllowedNames.as | 93 + .../FunctionAccessors/GetSetDefaultVars.as | 151 + .../GetSetDefaultVars/GetSetPrivate.as | 124 + .../FunctionAccessors/GetSetDiffScope.as | 129 + .../GetSetDiffScope/GetSetDiffScope.as | 104 + .../FunctionAccessors/GetSetDynamicAccess.as | 149 + .../GetSetDynamicAccess/GetSetPrivate.as | 127 + .../FunctionAccessors/GetSetExtended.as | 150 + .../GetSetExtended/GetSetPrivate.as | 132 + .../GetSetExtendedOverride.as | 162 + .../GetSetExtendedOverride/GetSetPrivate.as | 161 + .../FunctionAccessors/GetSetFinal.as | 126 + .../GetSetFinal/GetSetFinal.as | 138 + .../FunctionAccessors/GetSetImpl.as | 152 + .../GetSetImpl/GetSetImpl.as | 139 + .../FunctionAccessors/GetSetInternal.as | 65 + .../GetSetInternal/GetSetInternal.as | 113 + .../GetSetPackagePrivateFuncs.as | 173 + .../GetSetPackagePrivateFuncs.as | 125 + .../GetSetPackagePrivateVars.as | 148 + .../GetSetPackagePrivate.as | 125 + .../FunctionAccessors/GetSetPrivateVars.as | 150 + .../GetSetPrivateVars/GetSetPrivate.as | 127 + .../FunctionAccessors/GetSetPropertyMixup.as | 59 + .../GetSetPropertyMixup.as | 76 + .../FunctionAccessors/GetSetProtected.as | 64 + .../GetSetProtected/GetSetProtected.as | 113 + .../GetSetProtectedExtended.as | 64 + .../GetSetProtectedExtended.as | 108 + .../FunctionAccessors/GetSetPublicVars.as | 150 + .../GetSetPublicVars/GetSetPublic.as | 124 + .../FunctionAccessors/GetSetSameName.as | 96 + .../GetSetSameName/GetSetSame.as | 48 + .../GetSetSameName/GetSetSameName.as | 48 + .../GetSetSameName/GetSetSameNameArg.as | 43 + .../FunctionAccessors/GetSetStatic.as | 161 + .../GetSetStatic/GetSetStatic.as | 134 + .../GetSetStatic/GetSetStaticSameName.as | 124 + .../FunctionAccessors/GetSetStaticExtended.as | 131 + .../GetSetStaticExtended/GetSetStatic.as | 82 + .../FunctionAccessors/GetSetVirtual.as | 151 + .../GetSetVirtual/GetSetVirtual.as | 124 + .../Definitions/FunctionAccessors/GetSuper.as | 85 + .../GetterInNewExpression.as | 70 + .../GetterInNewExpression.as | 41 + .../Definitions/FunctionAccessors/InfRec.as | 60 + .../Definitions/Interfaces/Example_1_1_6.as | 48 + .../Interfaces/Example_1_1_6/Example_1_1_6.as | 59 + .../Interfaces/Example_9_2_const.as | 47 + .../Example_9_2_const/Example_9_2_const.as | 52 + .../Interfaces/Example_9_2_qual.as | 47 + .../Example_9_2_qual/Example_9_2_qual.as | 51 + .../as3/Definitions/Interfaces/Example_9_3.as | 50 + .../Interfaces/Example_9_3/Example_9_3.as | 74 + .../as3/Definitions/Interfaces/Example_9_4.as | 50 + .../Interfaces/Example_9_4/Example_9_4.as | 79 + .../Interfaces/ExtendMultipleInterfaces.as | 55 + .../ExtendMultipleInterfaces.as | 184 + .../test/as3/Definitions/Interfaces/GetSet.as | 57 + .../Definitions/Interfaces/GetSet/GetSet.as | 139 + .../Interfaces/ImplTwoInterfacesSameMethod.as | 47 + .../ImplTwoInterfacesSameMethod/A.as | 37 + .../ImplTwoInterfacesSameMethod/B.as | 37 + .../ImplTwoInterfacesSameMethod/C.as | 36 + .../Interfaces/ImplementByExtension.as | 52 + .../ImplementByExtension.as | 152 + .../Interfaces/ImplementMultipleInterfaces.as | 55 + .../ImplementMultipleInterfaces.as | 147 + .../Definitions/Interfaces/InterfaceAsType.as | 58 + .../InterfaceAsType/InterfaceAsType.as | 128 + .../as3/Definitions/Interfaces/Lattice.as | 57 + .../Definitions/Interfaces/Lattice/IFuncF.as | 36 + .../Definitions/Interfaces/Lattice/IFuncFG.as | 37 + .../Definitions/Interfaces/Lattice/IFuncG.as | 36 + .../Interfaces/Lattice/IFuncGxF.as | 36 + .../Definitions/Interfaces/Lattice/IFuncH.as | 36 + .../Definitions/Interfaces/Lattice/ImplFG.as | 41 + .../Definitions/Interfaces/Lattice/ImplGxF.as | 41 + .../Interfaces/Lattice/ImplHxFG.as | 38 + .../Interfaces/LatticeAmbiguous.as | 62 + .../Interfaces/LatticeAmbiguous/IFuncF.as | 36 + .../Interfaces/LatticeAmbiguous/IFuncFG.as | 37 + .../Interfaces/LatticeAmbiguous/IFuncG.as | 36 + .../Interfaces/LatticeAmbiguous/IFuncGxF.as | 36 + .../Interfaces/LatticeAmbiguous/IFuncH.as | 36 + .../Interfaces/LatticeAmbiguous/ImplFFG.as | 41 + .../Interfaces/LatticeAmbiguous/ImplFG.as | 41 + .../Interfaces/LatticeAmbiguous/ImplGxF.as | 41 + .../Interfaces/LatticeAmbiguous/ImplHxFG.as | 38 + .../Interfaces/QualUnqualAccess.as | 77 + .../QualUnqualAccess/QualUnqualAccess.as | 160 + .../as3/Definitions/Interfaces/Qualifiers.as | 53 + .../Interfaces/Qualifiers/Qualifiers.as | 114 + .../Interfaces/TraitsNotAccessible.as | 57 + .../TraitsNotAccessible.as | 57 + .../as3/Definitions/Interfaces/bug127174.as | 41 + .../bug127174/CoerceErrorForInterfaces.as | 45 + .../Interfaces/bug127174/IBaseInterface.as | 37 + .../Interfaces/bug127174/ITestInterface.as | 36 + .../bug127174/InterfacecorceErrorTest.as | 39 + .../AccessClassByFullyQualifiedName.as | 68 + .../Packages/AccessDefaultPackageClass.as | 59 + .../AccessDefaultPackageClassGlobally.as | 56 + .../Packages/AccessDefaultPackageFunction.as | 56 + .../AccessDefaultPackageFunctionGlobally.as | 49 + .../Packages/AccessDefaultPackageInterface.as | 56 + .../AccessDefaultPackageInterfaceGlobally.as | 54 + .../Packages/AccessDefaultPackageVariable.as | 53 + .../AccessDefaultPackageVariableGlobally.as | 46 + .../AccessFunctionByFullyQualifiedName.as | 60 + .../Packages/ClassOutsidePackage.as | 54 + .../Packages/DiscontinuousPackage.as | 64 + .../Packages/DiscontinuousPackage/A.as | 39 + .../Packages/DiscontinuousPackage/B.as | 40 + .../Packages/DiscontinuousPackage/C.as | 49 + .../DiscontinuousPackage/IClickable.as | 36 + .../Packages/DiscontinuousPackage/vars.as | 40 + .../Packages/DiscontinuousPackage2.as | 124 + .../as3/Definitions/Packages/EmptyPackage.as | 46 + .../Packages/FullyQualifiedNames.as | 118 + .../Packages/FullyQualifiedNames2.as | 114 + .../Packages/FuncNameSameAsPackageDef.as | 67 + .../Packages/FunctionOutsidePackage.as | 52 + .../Packages/FutureReservedPackageNames.as | 57 + .../Packages/IdentifierPackageNames.as | 69 + .../Packages/ImportIndividualClasses.as | 131 + .../Packages/ImportIntoAnotherPackage.as | 120 + .../Packages/ImportOutsidePackage.as | 76 + .../Packages/ImportPackageInItself.as | 67 + .../Packages/InterfaceOutsidePackage.as | 59 + .../as3/Definitions/Packages/MatchingNames.as | 141 + .../Packages/MultiplePackageDef.as | 115 + .../Packages/MultiplePackageDefSame.as | 125 + .../Packages/MultiplePackageDefSame2.as | 71 + .../Packages/MultiplePackageDefSameEmpty.as | 51 + .../Packages/MultiplePackageName.as | 50 + .../Packages/MultiplePackageName100.as | 50 + .../Packages/NamespaceOutsidePackage.as | 66 + .../as3/Definitions/Packages/NestedImports.as | 82 + .../as3/Definitions/Packages/NoPackageName.as | 125 + .../Definitions/Packages/PackageName256.as | 56 + .../Packages/PackageShadowLocalVar.as | 53 + .../Definitions/Packages/PackageWithAll.as | 114 + .../Definitions/Packages/PackageWithClass.as | 51 + .../Packages/PackageWithFunction.as | 49 + .../Definitions/Packages/PackageWithImport.as | 54 + .../Packages/PackageWithInterface.as | 55 + .../Packages/PackageWithNamespace.as | 58 + .../Packages/PackageWithOverride.as | 64 + .../Packages/SameNameDiffPackage.as | 70 + .../Definitions/Packages/SingleNameAliases.as | 52 + .../Packages/SingleNameAliases/A.as | 39 + .../Packages/SingleNameAliases/B.as | 39 + .../Definitions/Packages/SinglePackageName.as | 50 + .../Definitions/Packages/UnnamedPackage.as | 59 + .../Packages/UnnamedPackage/unnamed.as | 80 + .../Definitions/Regress/IncrementTypeNaN.as | 56 + .../as3/Definitions/Super/SuperArgsCall.as | 58 + .../Super/SuperArgsCall/SuperArgsCall.as | 57 + .../Definitions/Super/SuperExprChainAccess.as | 65 + .../SuperExprChainAccess.as | 111 + .../Super/SuperImplicitlyCalled.as | 57 + .../SuperImplicitlyCalled.as | 54 + .../test/as3/Definitions/Super/SuperObject.as | 52 + .../Super/SuperObject/SuperObject.as | 38 + .../as3/Definitions/Super/SuperObjectCall.as | 59 + .../Super/SuperObjectCall/SuperObjectCall.as | 40 + .../test/as3/Definitions/Super/SuperProps.as | 87 + .../Super/SuperProps/SuperProps.as | 54 + .../Definitions/Super/SuperRuntimeError.as | 80 + .../SuperRuntimeError/SuperRuntimeError.as | 61 + .../Variable/AccessPrivateClassVariable_rt.as | 67 + .../Definitions/Variable/ConstVariables.as | 78 + .../ConstVariables/ConstVariablesClass.as | 79 + .../Variable/ModifyClassConstGlobally_rt.as | 60 + .../ModifyClassVariableInObjectInstance_rt.as | 61 + .../Variable/ModifyPackageConstGlobally_rt.as | 55 + .../Definitions/Variable/ModifyVariables.as | 112 + .../ModifyVariables/ModifyVariablesClass.as | 79 + .../Variable/ProtectedVariables.as | 61 + .../ProtectedVariablesClass.as | 93 + .../as3/Definitions/Variable/VarDefEmpty.as | 108 + .../Variable/VarDefEmpty/VarDefEmpty.as | 152 + .../as3/Definitions/Variable/VarDefOutside.as | 151 + .../Variable/VarDefOutsideNoVar.as | 71 + .../as3/Definitions/Variable/VarDefPrivate.as | 119 + .../Variable/VarDefPrivate/VarDefPrivate.as | 148 + .../Variable/VarDefPrivateStatic.as | 108 + .../VarDefPrivateStaticClass.as | 148 + .../as3/Definitions/Variable/VarDefPublic.as | 119 + .../VarDefPublic/VarDefPublicClass.as | 152 + .../Variable/VarDefPublicStatic.as | 113 + .../VarDefPublicStaticClass.as | 151 + .../as3/Definitions/Variable/VarDefStatic.as | 111 + .../VarDefStatic/VarDefStaticClass.as | 150 + .../Definitions/const/ConstAccessFromClass.as | 59 + .../const/ConstAccessWithinClass.as | 58 + .../const/ConstAndClassFuncArgWithSameName.as | 53 + .../ConstAndClassFuncArgWithSameName2.as | 53 + .../const/ConstAndFunctionArgWithSameName.as | 49 + .../const/ConstAndFunctionArgWithSameName2.as | 49 + .../const/ConstAsVarReplacement.as | 51 + .../const/ConstConditionalInitialization.as | 45 + .../ConstConditionalInitializationInClass.as | 56 + .../ConstConditionalInitializationInClass2.as | 63 + ...nstConditionalInitializationInClass3_rt.as | 71 + .../ConstConditionalInitializationInFunc.as | 48 + .../as3/Definitions/const/ConstInPackage.as | 49 + .../as3/Definitions/const/ConstInPackage2.as | 52 + .../const/ConstInPackageWithClass.as | 60 + .../const/ConstInPackageWithFunction.as | 54 + .../ConstInitializationInsideConstructor.as | 57 + .../ConstInitializationOutsideClass_rt.as | 64 + .../as3/Definitions/const/ConstInsideClass.as | 59 + .../as3/Definitions/const/ConstKeyword.as | 53 + .../as3/Definitions/const/ConstReinit_rt.as | 56 + .../Definitions/const/ConstVarAsClassProp.as | 66 + .../const/ConstVarInsideClassFunction.as | 52 + .../const/ConstVarInsideClassFunction2_rt.as | 77 + .../const/ConstVarInsideGlobalFunction.as | 50 + .../const/ConstVarInsideGlobalFunction2.as | 50 + .../const/ConstVarInsideGlobalFunction3.as | 50 + .../const/ConstVarInsideGlobalFunction4.as | 51 + .../const/ConstVarInsideGlobalFunction5_rt.as | 62 + .../as3/Definitions/const/ConstWithinClass.as | 57 + .../Definitions/const/ConstWithinPackage.as | 62 + .../const/GlobalConstInitialization2_rt.as | 61 + .../const/GlobalConstInitialization_rt.as | 56 + .../test/as3/Definitions/const/StaticConst.as | 47 + .../const/StaticConstInDerivedClass.as | 50 + ...taticConstInitializationOutsideClass_rt.as | 59 + .../as3/Directives/Attributes/Attributes.as | 133 + .../Directives/Attributes/Attributes/Attrs.as | 84 + .../test/as3/Directives/Import/Importall.as | 126 + .../test/as3/Directives/Import/Importclass.as | 63 + .../Directives/Import/ImportclassAssign.as | 55 + .../test/as3/Directives/Import/Importfunc.as | 81 + .../as3/Directives/Import/Importinterface.as | 72 + .../Directives/Import/Importinterfaceclass.as | 72 + .../as3/Directives/Import/Importnamespace.as | 75 + .../Directives/Import/Importtwonamespace.as | 70 + .../as3/Directives/Import/Importtwovar.as | 63 + .../test/as3/Directives/Import/Importvar.as | 59 + .../as3/Directives/Import/ImportvarAssign.as | 54 + .../test/as3/Directives/Include/Inc.as | 51 + .../as3/Directives/Include/IncLineBreak.as | 51 + .../test/as3/Directives/Include/IncSlash.as | 50 + .../test/as3/Directives/Include/Include.txt | 3 + .../test/as3/Directives/Include/Include1.txt | 3 + .../as3/Directives/Include/MultipleInc.as | 55 + .../Include/MultipleInc/Include2.txt | 3 + .../Directives/Include/MultipleIncOrder.as | 54 + .../Include/MultipleIncOrder/Include1.txt | 3 + .../Include/MultipleIncOrder/Include2.txt | 3 + .../test/as3/Directives/Include/NoHashInc.as | 51 + .../Include/NoHashWithFrontSlashInc.as | 51 + .../Directives/usenamespace/AssignmentExp.as | 126 + .../usenamespace/NSInsideTryCatch.as | 74 + .../usenamespace/NSInterfacefunc.as | 79 + .../usenamespace/NSReturnedByFunc.as | 69 + .../Directives/usenamespace/NSValueAssig.as | 74 + .../usenamespace/NsAttributeFunc.as | 80 + .../Directives/usenamespace/NsAttributeVar.as | 95 + .../Directives/usenamespace/NsClassesfunc.as | 65 + .../usenamespace/NsExpressionRef.as | 57 + .../usenamespace/OverrideBaseNsMethod.as | 71 + .../usenamespace/PublicNSFuncAttr.as | 72 + .../usenamespace/PublicNSVarAttr.as | 75 + .../usenamespace/QNSpropertyAccess.as | 149 + .../Directives/usenamespace/QNSvarsingle.as | 47 + .../usenamespace/UNSDefinPackageDifNs.as | 69 + .../usenamespace/UNSDefinPackageOneNs.as | 63 + .../usenamespace/UNSDiffInFunOnly.as | 78 + .../usenamespace/UNSEmbFuncSingle.as | 65 + .../usenamespace/UNSFuncDiffAttr.as | 79 + .../usenamespace/UNSFuncMultipleAttr.as | 78 + .../usenamespace/UNSFuncMultipleDiff.as | 73 + .../Directives/usenamespace/UNSInsideFun.as | 110 + .../usenamespace/UNSReDefinPackage.as | 67 + .../Directives/usenamespace/UNSfuncsingle.as | 81 + .../Directives/usenamespace/UNSvarmultiple.as | 90 + .../Directives/usenamespace/UNSvarsingle.as | 60 + .../Directives/usenamespace/longQualifier.as | 74 + .../QualifiedReferences/AS3NSReferences.as | 47 + .../AS3NSReferences/foo.as | 48 + .../QualifiedReferences/AssignmentExp.as | 55 + .../QualifiedReferences/AssignmentExp/foo.as | 81 + .../QualifiedReferences/DescendantOperator.as | 79 + .../QualifiedReferences/FilterOperator.as | 68 + .../QualifiedReferences/MultipleNamespaces.as | 55 + .../MultipleNamespaces/foo.as | 46 + .../QualifiedReferences/NSSingleFunc.as | 55 + .../QualifiedReferences/NSSingleFunc/foo.as | 49 + .../QualifiedReferences/ReturnNSReference.as | 51 + .../ReturnNSReference/foo.as | 56 + .../QualifiedReferences/ReturnNamespace.as | 51 + .../QualifiedReferences/ReturnNamespace/A.as | 49 + .../QualifiedReferences/ReturnNamespace/B.as | 41 + .../QualifiedReferences/WildcardOperator.as | 79 + .../test/as3/Expressions/asOperator/asOper.as | 127 + .../asOperator/asOper/TestClassA.as | 33 + .../asOperator/asOper/TestClassB.as | 33 + .../asOperator/asOper/TestClassC.as | 33 + .../asOperator/asOper/TestInterface.as | 33 + .../as3/Expressions/asOperator/asOperator.as | 148 + .../asOperator/asOperatorConversions.as | 187 + .../asOperator/asOperatorMuliti.as | 82 + .../Expressions/asOperator/asOperatorTypes.as | 91 + .../as3/Expressions/asOperator/asTypeError.as | 104 + .../Expressions/deleteOperator/deleteArray.as | 59 + .../Expressions/deleteOperator/deleteClass.as | 49 + .../deleteOperator/deleteFixedFunction.as | 50 + .../deleteOperator/deleteFixedVar.as | 50 + .../deleteInstantiatedFunction.as | 52 + .../deleteOperator/deleteInstantiatedVar.as | 51 + .../deleteNonexistentDynamicProperty.as | 50 + .../deleteNonexistentFixedProperty.as | 50 + .../deleteNoninstantiatedFunction.as | 50 + .../deleteNoninstantiatedVar.as | 50 + .../test/as3/Expressions/isOperator/isOper.as | 120 + .../isOperator/isOper/TestClassA.as | 33 + .../isOperator/isOper/TestClassB.as | 33 + .../isOperator/isOper/TestClassC.as | 33 + .../isOperator/isOper/TestInterface.as | 33 + .../Expressions/isOperator/isOperTypeError.as | 93 + .../test/as3/MethodClosures/MethodClosure.as | 65 + .../as3/MethodClosures/MethodClosureFunc.as | 61 + .../Error1002PrecisionArgOutOfRange.as | 49 + .../Error1003RadixArgOutOfRange.as | 49 + ...Error1004MethodInvokedOnIncompatibleObj.as | 50 + .../Error1005ArrayIndexNotInteger.as | 48 + .../Error1006CallNonFunctionObject.as | 50 + .../Error1007InstantiationOnNonConstructor.as | 48 + .../Error1009CannotAccessPropOfNullRef.as | 52 + .../RuntimeErrors/Error1010UndefinedTerm.as | 53 + .../RuntimeErrors/Error1014ClassNotFound.as | 52 + .../Error1016DescendantsOpNotSupported.as | 49 + .../Error1034TypeCoercionFailed.as | 49 + .../Error1037CannotAssignMethod.as | 54 + .../Error1040InvalidRHSOfInstanceof.as | 48 + .../Error1041RHSOfIsMustBeClass.as | 50 + .../Error1050CannotConvertToPrimitive.as | 50 + .../Error1052InvalidUriPassed.as | 50 + .../Error1056CannotCreatePropInSealedClass.as | 51 + .../Error1064CannotCallMethodAsConstructor.as | 57 + .../Error1065VariableNotDefined.as | 48 + .../Error1066Function-body-NotAllowed.as | 48 + .../Error1069PropertyNotFound.as | 55 + .../RuntimeErrors/Error1070MethodNotFound.as | 58 + .../Error1074IllegalWriteToReadOnlyProp.as | 49 + .../Error1075MathNotAFunction.as | 48 + .../Error1076MathNotAConstructor.as | 52 + .../Error1077IllegalReadOfWriteOnlyProp.as | 56 + .../Error1081ReadSealedErrorNs.as | 70 + .../Error1083XmlPrefixNotFound.as | 48 + .../Error1084XmlQNameProductionMismatch.as | 49 + .../Error1085XmlEndTagMissing.as | 49 + ...Error1086XmlMethodOnlyOnListWithOneItem.as | 49 + .../Error1087XmlAssignToIndexedXml.as | 50 + .../Error1088XmlDocNotWellFormed.as | 50 + ...Error1089XmlAssignToMoreThanOneItemList.as | 50 + .../Error1090XmlElementMalformed.as | 49 + .../Error1091XmlUnterminatedCdata.as | 49 + .../Error1092XmlUnterminatedXmlDecl.as | 49 + .../Error1093XmlUnterminatedDoctype.as | 49 + .../Error1094XmlUnterminatedComment.as | 49 + .../Error1095XmlUnterminatedAttr.as | 49 + ...Error1097XmlUnterminatedProcessingInstr.as | 49 + .../Error1098XmlIllegalPrefixFoNoNamespace.as | 48 + .../RuntimeErrors/Error1100RegExpFlagsArg.as | 49 + .../Error1104XmlDuplicateAttr.as | 48 + ...rror1112ArgCountMismatchOnClassCoercion.as | 52 + .../RuntimeErrors/Error1115NotAConstructor.as | 49 + ...or1116FunctionProtoApply2ndArgMustBeArr.as | 48 + .../RuntimeErrors/Error1117InvalidXmlName.as | 50 + .../Error1118IllegalCyclicalLoop.as | 54 + ...r1119DeleteDoesNotSupportXMLListOperand.as | 53 + .../Error1120CannotDeleteProperty.as | 49 + .../Error1042InvalidABCFile.as | 31 + .../Exceptions/MultipleCatchBlocks2.as | 82 + .../MultipleCatchBlocks2/MyErrors2.as | 45 + .../Exceptions/MultipleCatchBlocksArgument.as | 75 + .../ArgumentErrors.as | 45 + .../Exceptions/MultipleCatchBlocksEval.as | 75 + .../MultipleCatchBlocksEval/EvalErrors.as | 44 + .../Exceptions/MultipleCatchBlocksRange.as | 75 + .../MultipleCatchBlocksRange/RangeErrors.as | 45 + ...tipleCatchBlocksRefErrorCaughtWithError.as | 64 + .../MultipleCatchBlocksReference.as | 75 + .../ReferenceErrors.as | 46 + .../Exceptions/MultipleCatchBlocksType.as | 80 + .../MultipleCatchBlocksType/TypeErrors.as | 45 + .../Exceptions/MultipleCatchBlocksType1.as | 66 + .../Exceptions/MultipleCatchBlocksType2.as | 66 + .../Exceptions/MultipleCatchBlocksType3.as | 66 + .../Exceptions/MultipleCatchBlocksType4.as | 66 + .../Exceptions/MultipleCatchBlocksType5.as | 66 + .../Exceptions/MultipleCatchBlocksType6.as | 66 + .../Exceptions/MultipleCatchBlocksType7.as | 66 + .../Exceptions/MultipleCatchBlocksURI.as | 75 + .../MultipleCatchBlocksURI/URIErrors.as | 46 + .../Exceptions/MultipleCatchBlocksWithArg1.as | 74 + ...pleCatchBlocksWithArgErrorCaughtByError.as | 72 + .../Exceptions/MultipleCatchBlocksWithDef1.as | 68 + ...eCatchBlocksWithDefErrorCaughtWithError.as | 66 + .../MultipleCatchBlocksWithEval1.as | 74 + ...leCatchBlocksWithEvalErrorCaughtByError.as | 72 + ...pleCatchBlocksWithNoTypeErrorCatchBlock.as | 64 + .../MultipleCatchBlocksWithRange1.as | 74 + ...eCatchBlocksWithRangeErrorCaughtByError.as | 72 + .../MultipleCatchBlocksWithRefError1.as | 66 + .../MultipleCatchBlocksWithSyntax.as | 74 + ...CatchBlocksWithSyntaxErrorCaughtByError.as | 72 + .../MultipleCatchBlocksWithTwoType.as | 79 + .../TypeErrors.as | 48 + .../Exceptions/MultipleCatchBlocksWithURI1.as | 74 + ...MultipleCatchBlocksWithURICaughtByError.as | 72 + .../MultipleCatchBlocksWithUninitialized1.as | 70 + ...tchBlocksWithUnitializedCaughtWithError.as | 68 + .../MultipleCatchBlocksWithVerify1.as | 74 + ...tipleCatchBlocksWithVerifyCaughtByError.as | 72 + ...ipleCatchBlocksTypeWithNoInnerCatchType.as | 83 + .../NestedTryBlockWithMultipleCatchRefType.as | 88 + ...edTryWithMulitpleCatchInsideEighthCatch.as | 91 + ...tedTryWithMulitpleCatchInsideFifthCatch.as | 90 + ...dTryWithMulitpleCatchInsideSeventhCatch.as | 90 + ...tedTryWithMulitpleCatchInsideSixthCatch.as | 90 + ...NestedTryWithMultipleCatchInsideFinally.as | 89 + ...ipleCatchInsideFinallyExceptionBubbling.as | 78 + ...NestedTryWithMultipleCatchInsideFinally.as | 79 + ...edTryWithMultipleCatchInsideFourthCatch.as | 90 + ...chInsideFourthCatchWithoutMatchingCatch.as | 85 + ...edTryWithMultipleCatchInsideSecondCatch.as | 89 + ...chInsideSecondCatchWithoutMatchingCatch.as | 84 + ...tedTryWithMultipleCatchInsideThirdCatch.as | 89 + ...tchInsideThirdCatchWithoutMatchingCatch.as | 83 + .../NestedTryWithMultipleCatchInsideTry.as | 88 + ...tipleCatchInsideTryWithoutMatchingCatch.as | 84 + .../Exceptions/TryCatchBlockPackage.as | 50 + .../TryAndCatchBlockWithUserDefinedErrors.as | 122 + .../Exceptions/TryCatchBlockPackage2.as | 50 + .../TryAndCatchBlockWithUserDefinedErrors.as | 121 + .../Exceptions/TryCatchBlockPackage3.as | 50 + .../TryAndCatchBlockWithUserDefinedErrors.as | 114 + .../TryCatchBlockUserWithBuiltInExceptions.as | 50 + .../TryAndCatchBlockWithUserDefinedErrors.as | 154 + .../Exceptions/UserDefinedErrorsInPackage.as | 50 + ...atchBlockWithUserDefinedErrorsInPackage.as | 120 + .../Exceptions/UserDefinedErrorsPackage.as | 50 + .../TryAndCatchBlockWithUserDefinedErrors.as | 112 + .../Exceptions/UserDefinedErrorsPackage2.as | 50 + .../TryAndCatchBlockWithUserDefinedErrors2.as | 112 + .../Exceptions/UserDefinedErrorsPackage3.as | 50 + .../TryAndCatchBlockWithUserDefinedErrors3.as | 105 + ...efinedErrorsPackageWithoutMatchingCatch.as | 50 + ...thUserDefinedErrorsWithoutMatchingcatch.as | 121 + .../Statements/Exceptions/getStackTrace.as | 47 + .../getStackTrace/StackTraceCaller.as | 57 + .../Exceptions/getStackTrace/SubError.as | 38 + .../Statements/for-each-in/eforeachin_001.as | 385 + .../Statements/for-each-in/eforeachin_002.as | 73 + .../Types/Conversions/ExplicitConversions.as | 113 + .../Conversions/ImplicitConversions1_23.as | 105 + .../Conversions/ImplicitConversionsFalse.as | 97 + .../Conversions/ImplicitConversionsNaN.as | 105 + .../Conversions/ImplicitConversionsNeg1_23.as | 96 + .../Conversions/ImplicitConversionsNull.as | 91 + .../Conversions/ImplicitConversionsString.as | 145 + .../Conversions/ImplicitConversionsTrue.as | 97 + .../ImplicitConversionsUndefined.as | 99 + .../test/as3/Types/Int/intConstructor.as | 81 + .../js/tamarin/test/as3/Types/Int/intIs.as | 81 + .../tamarin/test/as3/Types/Int/intMaxValue.as | 86 + .../tamarin/test/as3/Types/Int/intMinValue.as | 85 + .../js/tamarin/test/as3/Types/Int/intType.as | 73 + .../tamarin/test/as3/Types/Int/wraparound.as | 135 + .../test/as3/Types/Uint/UintFunctionArg.as | 181 + .../js/tamarin/test/as3/Types/Uint/UintHex.as | 42 + .../js/tamarin/test/as3/Types/Uint/UintIs.as | 81 + .../Types/Uint/UintPublicClassMethodArg.as | 196 + .../UintPublicClass.as | 74 + .../tamarin/test/as3/Types/Uint/UintType.as | 67 + .../test/as3/Types/Uint/UintVarAsClassProp.as | 43 + .../UintVarAsClassProp/UintVarAsClassProp.as | 39 + .../as3/Types/Uint/UintVarOperationInFunc.as | 58 + .../Types/Uint/UintVarOperationInFuncRet.as | 49 + .../test/as3/Types/Uint/UintVarOperations.as | 118 + .../tamarin/test/e4x/Expressions/e11_1_1.as | 210 + .../tamarin/test/e4x/Expressions/e11_1_2.as | 213 + .../tamarin/test/e4x/Expressions/e11_1_3.as | 103 + .../tamarin/test/e4x/Expressions/e11_1_4.as | 261 + .../tamarin/test/e4x/Expressions/e11_1_5.as | 146 + .../tamarin/test/e4x/Expressions/e11_2_1.as | 293 + .../tamarin/test/e4x/Expressions/e11_2_2.as | 158 + .../tamarin/test/e4x/Expressions/e11_2_3.as | 128 + .../tamarin/test/e4x/Expressions/e11_2_4.as | 213 + .../tamarin/test/e4x/Expressions/e11_3_1.as | 515 + .../tamarin/test/e4x/Expressions/e11_3_2.as | 90 + .../tamarin/test/e4x/Expressions/e11_4_1.as | 197 + .../tamarin/test/e4x/Expressions/e11_5_1.as | 225 + .../tamarin/test/e4x/Expressions/e11_6_1.as | 522 + .../tamarin/test/e4x/Expressions/e11_6_2.as | 433 + .../tamarin/test/e4x/Expressions/e11_6_3.as | 173 + .../test/e4x/Expressions/kXMLBadQNameErr.as | 113 + .../js/tamarin/test/e4x/Global/e13_1_2_1.as | 578 + .../test/e4x/Global/isXMLNameTypeErr.as | 112 + .../js/tamarin/test/e4x/Namespace/e13_2_1.as | 116 + .../js/tamarin/test/e4x/Namespace/e13_2_2.as | 117 + .../tamarin/test/e4x/Namespace/e13_2_3_1.as | 75 + .../tamarin/test/e4x/Namespace/e13_2_4_1.as | 73 + .../tamarin/test/e4x/Namespace/e13_2_4_2.as | 78 + .../js/tamarin/test/e4x/Namespace/e13_2_5.as | 228 + mozilla/js/tamarin/test/e4x/QName/e13_3_1.as | 127 + mozilla/js/tamarin/test/e4x/QName/e13_3_2.as | 178 + .../js/tamarin/test/e4x/QName/e13_3_3_1.as | 73 + .../js/tamarin/test/e4x/QName/e13_3_4_1.as | 72 + .../js/tamarin/test/e4x/QName/e13_3_4_2.as | 79 + mozilla/js/tamarin/test/e4x/QName/e13_3_5.as | 109 + .../js/tamarin/test/e4x/Regress/b121219.as | 70 + .../js/tamarin/test/e4x/Regress/error1085.as | 86 + .../test/e4x/Regress/regress-257679.as | 75 + .../test/e4x/Regress/regress-263934.as | 89 + .../test/e4x/Regress/regress-263935.as | 90 + .../test/e4x/Regress/regress-263936.as | 88 + .../test/e4x/Regress/regress-264369.as | 76 + .../test/e4x/Regress/regress-271545.as | 102 + .../test/e4x/Regress/regress-277650.as | 93 + .../test/e4x/Regress/regress-277664.as | 93 + .../test/e4x/Regress/regress-277683.as | 94 + .../test/e4x/Regress/regress-277779.as | 89 + .../test/e4x/Regress/regress-278112.as | 86 + .../js/tamarin/test/e4x/Statements/e12_1.as | 200 + .../js/tamarin/test/e4x/Statements/e12_2.as | 168 + .../js/tamarin/test/e4x/Statements/e12_3.as | 110 + .../test/e4x/TypeConversion/bug153363.as | 108 + .../test/e4x/TypeConversion/bug153363_2.as | 108 + .../test/e4x/TypeConversion/e10_1_1.as | 92 + .../test/e4x/TypeConversion/e10_1_2.as | 102 + .../test/e4x/TypeConversion/e10_2_1.as | 108 + .../test/e4x/TypeConversion/e10_2_1_1.as | 75 + .../test/e4x/TypeConversion/e10_2_1_2.as | 81 + .../test/e4x/TypeConversion/e10_2_2.as | 78 + .../tamarin/test/e4x/TypeConversion/e10_3.as | 187 + .../test/e4x/TypeConversion/e10_3_1.as | 94 + .../tamarin/test/e4x/TypeConversion/e10_4.as | 108 + .../test/e4x/TypeConversion/e10_4_1.as | 118 + .../tamarin/test/e4x/TypeConversion/e10_5.as | 72 + .../test/e4x/TypeConversion/e10_5_1.as | 72 + .../tamarin/test/e4x/TypeConversion/e10_6.as | 72 + .../test/e4x/TypeConversion/e10_6_1.as | 72 + mozilla/js/tamarin/test/e4x/Types/e9_1_1_1.as | 337 + .../js/tamarin/test/e4x/Types/e9_1_1_10.as | 75 + .../js/tamarin/test/e4x/Types/e9_1_1_11.as | 74 + .../js/tamarin/test/e4x/Types/e9_1_1_12.as | 72 + .../js/tamarin/test/e4x/Types/e9_1_1_13.as | 72 + mozilla/js/tamarin/test/e4x/Types/e9_1_1_2.as | 114 + mozilla/js/tamarin/test/e4x/Types/e9_1_1_3.as | 150 + mozilla/js/tamarin/test/e4x/Types/e9_1_1_4.as | 99 + mozilla/js/tamarin/test/e4x/Types/e9_1_1_5.as | 73 + mozilla/js/tamarin/test/e4x/Types/e9_1_1_6.as | 82 + mozilla/js/tamarin/test/e4x/Types/e9_1_1_7.as | 73 + mozilla/js/tamarin/test/e4x/Types/e9_1_1_8.as | 74 + mozilla/js/tamarin/test/e4x/Types/e9_1_1_9.as | 161 + mozilla/js/tamarin/test/e4x/Types/e9_2_1_1.as | 187 + .../js/tamarin/test/e4x/Types/e9_2_1_10.as | 73 + mozilla/js/tamarin/test/e4x/Types/e9_2_1_2.as | 163 + mozilla/js/tamarin/test/e4x/Types/e9_2_1_3.as | 72 + mozilla/js/tamarin/test/e4x/Types/e9_2_1_4.as | 73 + mozilla/js/tamarin/test/e4x/Types/e9_2_1_5.as | 75 + mozilla/js/tamarin/test/e4x/Types/e9_2_1_6.as | 73 + mozilla/js/tamarin/test/e4x/Types/e9_2_1_7.as | 73 + mozilla/js/tamarin/test/e4x/Types/e9_2_1_8.as | 79 + mozilla/js/tamarin/test/e4x/Types/e9_2_1_9.as | 104 + mozilla/js/tamarin/test/e4x/XML/bug157597.as | 88 + .../js/tamarin/test/e4x/XML/bug157597_2.as | 88 + mozilla/js/tamarin/test/e4x/XML/bug157735.as | 78 + mozilla/js/tamarin/test/e4x/XML/bug158506.as | 83 + mozilla/js/tamarin/test/e4x/XML/e13_4_1.as | 155 + mozilla/js/tamarin/test/e4x/XML/e13_4_2.as | 203 + mozilla/js/tamarin/test/e4x/XML/e13_4_3.as | 241 + mozilla/js/tamarin/test/e4x/XML/e13_4_3_1.as | 76 + mozilla/js/tamarin/test/e4x/XML/e13_4_3_2.as | 105 + mozilla/js/tamarin/test/e4x/XML/e13_4_3_3.as | 106 + mozilla/js/tamarin/test/e4x/XML/e13_4_3_4.as | 118 + mozilla/js/tamarin/test/e4x/XML/e13_4_3_5.as | 95 + mozilla/js/tamarin/test/e4x/XML/e13_4_3_6.as | 119 + mozilla/js/tamarin/test/e4x/XML/e13_4_3_7.as | 115 + mozilla/js/tamarin/test/e4x/XML/e13_4_3_8.as | 149 + mozilla/js/tamarin/test/e4x/XML/e13_4_3_9.as | 99 + mozilla/js/tamarin/test/e4x/XML/e13_4_4_1.as | 73 + mozilla/js/tamarin/test/e4x/XML/e13_4_4_10.as | 113 + mozilla/js/tamarin/test/e4x/XML/e13_4_4_11.as | 135 + mozilla/js/tamarin/test/e4x/XML/e13_4_4_12.as | 135 + mozilla/js/tamarin/test/e4x/XML/e13_4_4_13.as | 100 + mozilla/js/tamarin/test/e4x/XML/e13_4_4_14.as | 110 + mozilla/js/tamarin/test/e4x/XML/e13_4_4_15.as | 126 + mozilla/js/tamarin/test/e4x/XML/e13_4_4_16.as | 143 + mozilla/js/tamarin/test/e4x/XML/e13_4_4_17.as | 144 + mozilla/js/tamarin/test/e4x/XML/e13_4_4_18.as | 206 + mozilla/js/tamarin/test/e4x/XML/e13_4_4_19.as | 206 + mozilla/js/tamarin/test/e4x/XML/e13_4_4_2.as | 166 + mozilla/js/tamarin/test/e4x/XML/e13_4_4_20.as | 111 + mozilla/js/tamarin/test/e4x/XML/e13_4_4_21.as | 134 + mozilla/js/tamarin/test/e4x/XML/e13_4_4_22.as | 130 + mozilla/js/tamarin/test/e4x/XML/e13_4_4_23.as | 167 + mozilla/js/tamarin/test/e4x/XML/e13_4_4_24.as | 147 + mozilla/js/tamarin/test/e4x/XML/e13_4_4_25.as | 135 + mozilla/js/tamarin/test/e4x/XML/e13_4_4_26.as | 121 + mozilla/js/tamarin/test/e4x/XML/e13_4_4_27.as | 127 + mozilla/js/tamarin/test/e4x/XML/e13_4_4_28.as | 140 + mozilla/js/tamarin/test/e4x/XML/e13_4_4_29.as | 261 + mozilla/js/tamarin/test/e4x/XML/e13_4_4_3.as | 208 + mozilla/js/tamarin/test/e4x/XML/e13_4_4_30.as | 97 + mozilla/js/tamarin/test/e4x/XML/e13_4_4_31.as | 146 + mozilla/js/tamarin/test/e4x/XML/e13_4_4_32.as | 154 + mozilla/js/tamarin/test/e4x/XML/e13_4_4_33.as | 121 + mozilla/js/tamarin/test/e4x/XML/e13_4_4_34.as | 168 + mozilla/js/tamarin/test/e4x/XML/e13_4_4_35.as | 216 + mozilla/js/tamarin/test/e4x/XML/e13_4_4_36.as | 192 + mozilla/js/tamarin/test/e4x/XML/e13_4_4_37.as | 120 + mozilla/js/tamarin/test/e4x/XML/e13_4_4_38.as | 173 + mozilla/js/tamarin/test/e4x/XML/e13_4_4_39.as | 202 + mozilla/js/tamarin/test/e4x/XML/e13_4_4_4.as | 141 + mozilla/js/tamarin/test/e4x/XML/e13_4_4_40.as | 113 + mozilla/js/tamarin/test/e4x/XML/e13_4_4_5.as | 113 + mozilla/js/tamarin/test/e4x/XML/e13_4_4_6.as | 161 + mozilla/js/tamarin/test/e4x/XML/e13_4_4_7.as | 99 + mozilla/js/tamarin/test/e4x/XML/e13_4_4_8.as | 106 + mozilla/js/tamarin/test/e4x/XML/e13_4_4_9.as | 105 + ...kXMLAssignmentToIndexedXMLNotAllowedErr.as | 95 + .../e4x/XML/kXMLMarkupMustBeWellFormedErr.as | 115 + .../test/e4x/XML/kXMLPrefixNotBoundErr.as | 128 + .../e4x/XML/kXMLUnterminatedElementTagErr.as | 110 + .../js/tamarin/test/e4x/XML/misc_errors.as | 398 + .../js/tamarin/test/e4x/XMLList/bug157735.as | 79 + .../js/tamarin/test/e4x/XMLList/e13_5_1.as | 151 + .../js/tamarin/test/e4x/XMLList/e13_5_2.as | 175 + .../js/tamarin/test/e4x/XMLList/e13_5_3_1.as | 75 + .../js/tamarin/test/e4x/XMLList/e13_5_4_1.as | 73 + .../js/tamarin/test/e4x/XMLList/e13_5_4_10.as | 97 + .../js/tamarin/test/e4x/XMLList/e13_5_4_11.as | 118 + .../js/tamarin/test/e4x/XMLList/e13_5_4_12.as | 153 + .../js/tamarin/test/e4x/XMLList/e13_5_4_13.as | 169 + .../js/tamarin/test/e4x/XMLList/e13_5_4_14.as | 133 + .../js/tamarin/test/e4x/XMLList/e13_5_4_15.as | 87 + .../js/tamarin/test/e4x/XMLList/e13_5_4_16.as | 150 + .../js/tamarin/test/e4x/XMLList/e13_5_4_17.as | 113 + .../js/tamarin/test/e4x/XMLList/e13_5_4_18.as | 84 + .../js/tamarin/test/e4x/XMLList/e13_5_4_19.as | 93 + .../js/tamarin/test/e4x/XMLList/e13_5_4_2.as | 156 + .../js/tamarin/test/e4x/XMLList/e13_5_4_20.as | 124 + .../js/tamarin/test/e4x/XMLList/e13_5_4_21.as | 124 + .../js/tamarin/test/e4x/XMLList/e13_5_4_22.as | 93 + .../js/tamarin/test/e4x/XMLList/e13_5_4_3.as | 121 + .../js/tamarin/test/e4x/XMLList/e13_5_4_4.as | 178 + .../js/tamarin/test/e4x/XMLList/e13_5_4_5.as | 126 + .../js/tamarin/test/e4x/XMLList/e13_5_4_6.as | 89 + .../js/tamarin/test/e4x/XMLList/e13_5_4_7.as | 95 + .../js/tamarin/test/e4x/XMLList/e13_5_4_8.as | 120 + .../js/tamarin/test/e4x/XMLList/e13_5_4_9.as | 99 + .../kXMLOnlyWorksWithOneItemListsErr.as | 354 + .../js/tamarin/test/ecma3/Array/e15_4_1.as | 119 + .../js/tamarin/test/ecma3/Array/e15_4_1_1.as | 73 + .../js/tamarin/test/ecma3/Array/e15_4_1_2.as | 81 + .../js/tamarin/test/ecma3/Array/e15_4_1_3.as | 70 + .../js/tamarin/test/ecma3/Array/e15_4_2.as | 63 + .../tamarin/test/ecma3/Array/e15_4_2_1_1.as | 61 + .../tamarin/test/ecma3/Array/e15_4_2_1_2.as | 69 + .../tamarin/test/ecma3/Array/e15_4_2_1_3.as | 73 + .../tamarin/test/ecma3/Array/e15_4_2_2_1.as | 87 + .../tamarin/test/ecma3/Array/e15_4_2_2_2.as | 62 + .../js/tamarin/test/ecma3/Array/e15_4_2_3.as | 60 + .../js/tamarin/test/ecma3/Array/e15_4_3.as | 49 + .../tamarin/test/ecma3/Array/e15_4_3_1_2.as | 76 + .../js/tamarin/test/ecma3/Array/e15_4_3_2.as | 47 + .../js/tamarin/test/ecma3/Array/e15_4_4.as | 63 + .../js/tamarin/test/ecma3/Array/e15_4_4_1.as | 50 + .../js/tamarin/test/ecma3/Array/e15_4_4_10.as | 149 + .../js/tamarin/test/ecma3/Array/e15_4_4_11.as | 102 + .../js/tamarin/test/ecma3/Array/e15_4_4_12.as | 82 + .../js/tamarin/test/ecma3/Array/e15_4_4_13.as | 104 + .../js/tamarin/test/ecma3/Array/e15_4_4_2.as | 100 + .../tamarin/test/ecma3/Array/e15_4_4_3_1.as | 95 + .../tamarin/test/ecma3/Array/e15_4_4_4_001.as | 160 + .../tamarin/test/ecma3/Array/e15_4_4_4_1.as | 254 + .../tamarin/test/ecma3/Array/e15_4_4_4_2.as | 116 + .../js/tamarin/test/ecma3/Array/e15_4_4_5.as | 100 + .../tamarin/test/ecma3/Array/e15_4_4_5_1.as | 145 + .../tamarin/test/ecma3/Array/e15_4_4_5_2.as | 163 + .../tamarin/test/ecma3/Array/e15_4_4_5_3.as | 162 + .../js/tamarin/test/ecma3/Array/e15_4_4_6.as | 118 + .../tamarin/test/ecma3/Array/e15_4_4_6_1.as | 86 + .../js/tamarin/test/ecma3/Array/e15_4_4_7.as | 107 + .../js/tamarin/test/ecma3/Array/e15_4_4_8.as | 113 + .../js/tamarin/test/ecma3/Array/e15_4_4_9.as | 137 + .../tamarin/test/ecma3/Array/e15_4_4_9_1.as | 105 + .../tamarin/test/ecma3/Array/e15_4_5_1_1.as | 163 + .../tamarin/test/ecma3/Array/e15_4_5_1_2.as | 104 + .../tamarin/test/ecma3/Array/e15_4_5_2_1.as | 84 + .../tamarin/test/ecma3/Array/e15_4_5_2_2.as | 105 + .../js/tamarin/test/ecma3/Array/e15_4__1.as | 112 + .../test/ecma3/Array/eregress_130451.as | 229 + .../js/tamarin/test/ecma3/Array/general1.as | 68 + .../js/tamarin/test/ecma3/Array/general2.as | 84 + .../js/tamarin/test/ecma3/Array/general3.as | 106 + mozilla/js/tamarin/test/ecma3/Array/slice.as | 114 + mozilla/js/tamarin/test/ecma3/Array/sortOn.as | 232 + .../tamarin/test/ecma3/Array/sparseArray.as | 222 + .../js/tamarin/test/ecma3/Array/splice1.as | 143 + .../js/tamarin/test/ecma3/Array/splice2.as | 141 + .../test/ecma3/Array/toLocaleString.as | 96 + .../js/tamarin/test/ecma3/Boolean/e15_6_1.as | 71 + .../js/tamarin/test/ecma3/Boolean/e15_6_2.as | 133 + .../js/tamarin/test/ecma3/Boolean/e15_6_3.as | 53 + .../tamarin/test/ecma3/Boolean/e15_6_3_1.as | 50 + .../tamarin/test/ecma3/Boolean/e15_6_3_1_1.as | 55 + .../tamarin/test/ecma3/Boolean/e15_6_3_1_2.as | 49 + .../tamarin/test/ecma3/Boolean/e15_6_3_1_3.as | 50 + .../tamarin/test/ecma3/Boolean/e15_6_3_1_4.as | 68 + .../tamarin/test/ecma3/Boolean/e15_6_3_1_5.as | 51 + .../js/tamarin/test/ecma3/Boolean/e15_6_4.as | 60 + .../tamarin/test/ecma3/Boolean/e15_6_4_1.as | 50 + .../tamarin/test/ecma3/Boolean/e15_6_4_2_1.as | 79 + .../tamarin/test/ecma3/Boolean/e15_6_4_2_2.as | 70 + .../tamarin/test/ecma3/Boolean/e15_6_4_2_3.as | 60 + .../tamarin/test/ecma3/Boolean/e15_6_4_3.as | 72 + .../tamarin/test/ecma3/Boolean/e15_6_4_3_1.as | 73 + .../tamarin/test/ecma3/Boolean/e15_6_4_3_2.as | 70 + .../tamarin/test/ecma3/Boolean/e15_6_4_3_3.as | 61 + .../tamarin/test/ecma3/Boolean/e15_6_4__1.as | 68 + .../ecma3/Boolean/ecma4_sealedtype_1_rt.as | 62 + .../ecma3/Boolean/ecma4_sealedtype_2_rt.as | 60 + .../ecma3/Boolean/ecma4_sealedtype_3_rt.as | 65 + .../ecma3/Boolean/ecma4_sealedtype_4_rt.as | 61 + .../ecma3/Boolean/ecma4_sealedtype_5_rt.as | 62 + .../ecma3/Boolean/ecma4_st_valueOf_1_rt.as | 75 + .../ecma3/Boolean/ecma4_st_valueOf_2_rt.as | 74 + .../ecma3/Boolean/ecma4_st_valueOf_3_rt.as | 68 + .../ecma3/Boolean/ecma4_st_valueOf_4_rt.as | 67 + .../ecma3/Boolean/ecma4_st_valueOf_5_rt.as | 65 + .../js/tamarin/test/ecma3/Date/e15_9_1_1_1.as | 64 + .../js/tamarin/test/ecma3/Date/e15_9_1_1_2.as | 67 + .../js/tamarin/test/ecma3/Date/e15_9_2_1.as | 93 + .../js/tamarin/test/ecma3/Date/e15_9_2_2_1.as | 88 + .../js/tamarin/test/ecma3/Date/e15_9_2_2_2.as | 82 + .../js/tamarin/test/ecma3/Date/e15_9_2_2_3.as | 74 + .../js/tamarin/test/ecma3/Date/e15_9_2_2_4.as | 68 + .../js/tamarin/test/ecma3/Date/e15_9_2_2_5.as | 61 + .../js/tamarin/test/ecma3/Date/e15_9_2_2_6.as | 55 + .../js/tamarin/test/ecma3/Date/e15_9_3_1_1.as | 287 + .../js/tamarin/test/ecma3/Date/e15_9_3_1_2.as | 197 + .../js/tamarin/test/ecma3/Date/e15_9_3_1_3.as | 175 + .../js/tamarin/test/ecma3/Date/e15_9_3_1_4.as | 159 + .../js/tamarin/test/ecma3/Date/e15_9_3_1_5.as | 136 + .../js/tamarin/test/ecma3/Date/e15_9_3_2_1.as | 207 + .../js/tamarin/test/ecma3/Date/e15_9_3_2_2.as | 185 + .../js/tamarin/test/ecma3/Date/e15_9_3_2_3.as | 171 + .../js/tamarin/test/ecma3/Date/e15_9_3_2_4.as | 153 + .../js/tamarin/test/ecma3/Date/e15_9_3_2_5.as | 136 + .../js/tamarin/test/ecma3/Date/e15_9_3_8_1.as | 274 + .../js/tamarin/test/ecma3/Date/e15_9_3_8_2.as | 249 + .../js/tamarin/test/ecma3/Date/e15_9_3_8_3.as | 227 + .../js/tamarin/test/ecma3/Date/e15_9_3_8_4.as | 193 + .../js/tamarin/test/ecma3/Date/e15_9_3_8_5.as | 159 + .../js/tamarin/test/ecma3/Date/e15_9_4_2.as | 191 + .../js/tamarin/test/ecma3/Date/e15_9_4_2_1.as | 85 + .../js/tamarin/test/ecma3/Date/e15_9_4_3.as | 210 + mozilla/js/tamarin/test/ecma3/Date/e15_9_5.as | 65 + .../js/tamarin/test/ecma3/Date/e15_9_5_1.as | 51 + .../js/tamarin/test/ecma3/Date/e15_9_5_10.as | 98 + .../tamarin/test/ecma3/Date/e15_9_5_10_1.as | 107 + .../tamarin/test/ecma3/Date/e15_9_5_10_10.as | 98 + .../tamarin/test/ecma3/Date/e15_9_5_10_11.as | 97 + .../tamarin/test/ecma3/Date/e15_9_5_10_12.as | 96 + .../tamarin/test/ecma3/Date/e15_9_5_10_13.as | 93 + .../tamarin/test/ecma3/Date/e15_9_5_10_3.as | 105 + .../tamarin/test/ecma3/Date/e15_9_5_10_4.as | 103 + .../tamarin/test/ecma3/Date/e15_9_5_10_5.as | 103 + .../tamarin/test/ecma3/Date/e15_9_5_10_6.as | 102 + .../tamarin/test/ecma3/Date/e15_9_5_10_7.as | 101 + .../tamarin/test/ecma3/Date/e15_9_5_10_8.as | 100 + .../tamarin/test/ecma3/Date/e15_9_5_10_9.as | 99 + .../js/tamarin/test/ecma3/Date/e15_9_5_11.as | 94 + .../tamarin/test/ecma3/Date/e15_9_5_11_1.as | 90 + .../tamarin/test/ecma3/Date/e15_9_5_11_3.as | 87 + .../tamarin/test/ecma3/Date/e15_9_5_11_4.as | 87 + .../tamarin/test/ecma3/Date/e15_9_5_11_5.as | 86 + .../tamarin/test/ecma3/Date/e15_9_5_11_6.as | 88 + .../tamarin/test/ecma3/Date/e15_9_5_11_7.as | 89 + .../js/tamarin/test/ecma3/Date/e15_9_5_12.as | 93 + .../tamarin/test/ecma3/Date/e15_9_5_12_1.as | 99 + .../tamarin/test/ecma3/Date/e15_9_5_12_3.as | 97 + .../tamarin/test/ecma3/Date/e15_9_5_12_4.as | 97 + .../tamarin/test/ecma3/Date/e15_9_5_12_5.as | 96 + .../tamarin/test/ecma3/Date/e15_9_5_12_6.as | 95 + .../tamarin/test/ecma3/Date/e15_9_5_12_7.as | 92 + .../tamarin/test/ecma3/Date/e15_9_5_12_8.as | 90 + .../js/tamarin/test/ecma3/Date/e15_9_5_13.as | 88 + .../tamarin/test/ecma3/Date/e15_9_5_13_1.as | 69 + .../tamarin/test/ecma3/Date/e15_9_5_13_2.as | 71 + .../tamarin/test/ecma3/Date/e15_9_5_13_3.as | 66 + .../tamarin/test/ecma3/Date/e15_9_5_13_4.as | 66 + .../tamarin/test/ecma3/Date/e15_9_5_13_5.as | 66 + .../tamarin/test/ecma3/Date/e15_9_5_13_6.as | 70 + .../tamarin/test/ecma3/Date/e15_9_5_13_7.as | 71 + .../tamarin/test/ecma3/Date/e15_9_5_13_8.as | 90 + .../js/tamarin/test/ecma3/Date/e15_9_5_14.as | 92 + .../js/tamarin/test/ecma3/Date/e15_9_5_15.as | 106 + .../tamarin/test/ecma3/Date/e15_9_5_15_1.as | 70 + .../js/tamarin/test/ecma3/Date/e15_9_5_16.as | 94 + .../js/tamarin/test/ecma3/Date/e15_9_5_17.as | 105 + .../tamarin/test/ecma3/Date/e15_9_5_17_1.as | 70 + .../js/tamarin/test/ecma3/Date/e15_9_5_18.as | 91 + .../js/tamarin/test/ecma3/Date/e15_9_5_19.as | 106 + .../js/tamarin/test/ecma3/Date/e15_9_5_2.as | 138 + .../js/tamarin/test/ecma3/Date/e15_9_5_20.as | 93 + .../tamarin/test/ecma3/Date/e15_9_5_21_1.as | 103 + .../tamarin/test/ecma3/Date/e15_9_5_21_2.as | 90 + .../tamarin/test/ecma3/Date/e15_9_5_21_3.as | 73 + .../tamarin/test/ecma3/Date/e15_9_5_21_4.as | 73 + .../tamarin/test/ecma3/Date/e15_9_5_21_5.as | 73 + .../tamarin/test/ecma3/Date/e15_9_5_21_6.as | 73 + .../tamarin/test/ecma3/Date/e15_9_5_21_7.as | 73 + .../tamarin/test/ecma3/Date/e15_9_5_21_8.as | 76 + .../tamarin/test/ecma3/Date/e15_9_5_22_1.as | 94 + .../tamarin/test/ecma3/Date/e15_9_5_22_2.as | 93 + .../tamarin/test/ecma3/Date/e15_9_5_22_3.as | 92 + .../tamarin/test/ecma3/Date/e15_9_5_22_4.as | 91 + .../tamarin/test/ecma3/Date/e15_9_5_22_5.as | 90 + .../tamarin/test/ecma3/Date/e15_9_5_22_6.as | 89 + .../tamarin/test/ecma3/Date/e15_9_5_22_7.as | 87 + .../tamarin/test/ecma3/Date/e15_9_5_22_8.as | 75 + .../tamarin/test/ecma3/Date/e15_9_5_23_1.as | 130 + .../tamarin/test/ecma3/Date/e15_9_5_23_10.as | 121 + .../tamarin/test/ecma3/Date/e15_9_5_23_11.as | 121 + .../tamarin/test/ecma3/Date/e15_9_5_23_12.as | 120 + .../tamarin/test/ecma3/Date/e15_9_5_23_13.as | 119 + .../tamarin/test/ecma3/Date/e15_9_5_23_14.as | 120 + .../tamarin/test/ecma3/Date/e15_9_5_23_15.as | 116 + .../tamarin/test/ecma3/Date/e15_9_5_23_16.as | 119 + .../tamarin/test/ecma3/Date/e15_9_5_23_17.as | 119 + .../tamarin/test/ecma3/Date/e15_9_5_23_18.as | 119 + .../tamarin/test/ecma3/Date/e15_9_5_23_2.as | 101 + .../test/ecma3/Date/e15_9_5_23_3_rt.as | 65 + .../tamarin/test/ecma3/Date/e15_9_5_23_4.as | 119 + .../tamarin/test/ecma3/Date/e15_9_5_23_5.as | 118 + .../tamarin/test/ecma3/Date/e15_9_5_23_6.as | 115 + .../tamarin/test/ecma3/Date/e15_9_5_23_7.as | 117 + .../tamarin/test/ecma3/Date/e15_9_5_23_8.as | 104 + .../tamarin/test/ecma3/Date/e15_9_5_23_9.as | 107 + .../tamarin/test/ecma3/Date/e15_9_5_24_1.as | 116 + .../tamarin/test/ecma3/Date/e15_9_5_24_2.as | 116 + .../tamarin/test/ecma3/Date/e15_9_5_24_3.as | 114 + .../tamarin/test/ecma3/Date/e15_9_5_24_4.as | 115 + .../tamarin/test/ecma3/Date/e15_9_5_24_5.as | 117 + .../tamarin/test/ecma3/Date/e15_9_5_24_6.as | 114 + .../tamarin/test/ecma3/Date/e15_9_5_24_7.as | 116 + .../tamarin/test/ecma3/Date/e15_9_5_24_8.as | 114 + .../tamarin/test/ecma3/Date/e15_9_5_25_1.as | 183 + .../tamarin/test/ecma3/Date/e15_9_5_26_1.as | 187 + .../tamarin/test/ecma3/Date/e15_9_5_27_1.as | 187 + .../tamarin/test/ecma3/Date/e15_9_5_28_1.as | 199 + .../tamarin/test/ecma3/Date/e15_9_5_29_1.as | 185 + .../js/tamarin/test/ecma3/Date/e15_9_5_2_1.as | 139 + .../tamarin/test/ecma3/Date/e15_9_5_2_2_rt.as | 73 + .../js/tamarin/test/ecma3/Date/e15_9_5_3.as | 149 + .../tamarin/test/ecma3/Date/e15_9_5_30_1.as | 191 + .../tamarin/test/ecma3/Date/e15_9_5_31_1.as | 190 + .../tamarin/test/ecma3/Date/e15_9_5_32_1.as | 142 + .../tamarin/test/ecma3/Date/e15_9_5_33_1.as | 151 + .../tamarin/test/ecma3/Date/e15_9_5_34_1.as | 531 + .../tamarin/test/ecma3/Date/e15_9_5_35_1.as | 146 + .../tamarin/test/ecma3/Date/e15_9_5_36_1.as | 232 + .../tamarin/test/ecma3/Date/e15_9_5_36_2.as | 215 + .../tamarin/test/ecma3/Date/e15_9_5_36_3.as | 201 + .../tamarin/test/ecma3/Date/e15_9_5_36_4.as | 187 + .../tamarin/test/ecma3/Date/e15_9_5_36_5.as | 186 + .../tamarin/test/ecma3/Date/e15_9_5_36_6.as | 166 + .../tamarin/test/ecma3/Date/e15_9_5_36_7.as | 145 + .../tamarin/test/ecma3/Date/e15_9_5_37_1.as | 266 + .../tamarin/test/ecma3/Date/e15_9_5_37_2.as | 193 + .../tamarin/test/ecma3/Date/e15_9_5_37_3.as | 173 + .../tamarin/test/ecma3/Date/e15_9_5_37_4.as | 160 + .../tamarin/test/ecma3/Date/e15_9_5_37_5.as | 146 + .../tamarin/test/ecma3/Date/e15_9_5_3_1_rt.as | 79 + .../js/tamarin/test/ecma3/Date/e15_9_5_3_2.as | 126 + .../js/tamarin/test/ecma3/Date/e15_9_5_4.as | 172 + .../js/tamarin/test/ecma3/Date/e15_9_5_42.as | 139 + .../js/tamarin/test/ecma3/Date/e15_9_5_4_1.as | 115 + .../tamarin/test/ecma3/Date/e15_9_5_4_2_rt.as | 62 + .../js/tamarin/test/ecma3/Date/e15_9_5_5.as | 115 + .../js/tamarin/test/ecma3/Date/e15_9_5_6.as | 125 + .../js/tamarin/test/ecma3/Date/e15_9_5_7.as | 186 + .../test/ecma3/ErrorObject/e15_11_1.as | 144 + .../test/ecma3/ErrorObject/e15_11_2_1.as | 117 + .../test/ecma3/Exceptions/binding_001.as | 123 + .../test/ecma3/Exceptions/boolean_001_rt.as | 142 + .../test/ecma3/Exceptions/boolean_002_rt.as | 144 + .../test/ecma3/Exceptions/bug127913.as | 59 + .../test/ecma3/Exceptions/date_001_rt.as | 72 + .../test/ecma3/Exceptions/date_002_rt.as | 71 + .../test/ecma3/Exceptions/date_003_rt.as | 74 + .../test/ecma3/Exceptions/date_004_rt.as | 71 + .../test/ecma3/Exceptions/e15_11_4_4_1.as | 182 + .../test/ecma3/Exceptions/exception_001_rt.as | 65 + .../test/ecma3/Exceptions/exception_002_rt.as | 64 + .../test/ecma3/Exceptions/exception_003_rt.as | 71 + .../test/ecma3/Exceptions/exception_004_rt.as | 65 + .../test/ecma3/Exceptions/exception_005_rt.as | 65 + .../test/ecma3/Exceptions/exception_006_rt.as | 72 + .../test/ecma3/Exceptions/exception_007_rt.as | 72 + .../test/ecma3/Exceptions/exception_009.as | 71 + .../test/ecma3/Exceptions/exception_010_rt.as | 71 + .../test/ecma3/Exceptions/exception_011_rt.as | 70 + .../test/ecma3/Exceptions/exception_014_rt.as | 58 + .../ecma3/Exceptions/expression_002_rt.as | 80 + .../ecma3/Exceptions/expression_003_rt.as | 76 + .../ecma3/Exceptions/expression_004_rt.as | 72 + .../ecma3/Exceptions/expression_005_rt.as | 65 + .../ecma3/Exceptions/expression_006_rt.as | 66 + .../ecma3/Exceptions/expression_007_rt.as | 68 + .../ecma3/Exceptions/expression_008_rt.as | 66 + .../ecma3/Exceptions/expression_009_rt.as | 65 + .../ecma3/Exceptions/expression_010_rt.as | 66 + .../ecma3/Exceptions/expression_011_rt.as | 67 + .../ecma3/Exceptions/expression_012_rt.as | 67 + .../ecma3/Exceptions/expression_013_rt.as | 68 + .../ecma3/Exceptions/expression_014_rt.as | 69 + .../ecma3/Exceptions/expression_016_rt.as | 64 + .../ecma3/Exceptions/expression_017_rt.as | 64 + .../ecma3/Exceptions/expression_019_rt.as | 67 + .../test/ecma3/Exceptions/global_001_rt.as | 65 + .../test/ecma3/Exceptions/global_002_rt.as | 64 + .../test/ecma3/Exceptions/number_001_rt.as | 70 + .../test/ecma3/Exceptions/number_002_rt.as | 69 + .../test/ecma3/Exceptions/number_003_rt.as | 121 + .../test/ecma3/Exceptions/number_004_rt.as | 123 + .../test/ecma3/Exceptions/regress_58946.as | 92 + .../test/ecma3/Exceptions/regress_95101.as | 113 + .../test/ecma3/Exceptions/string_001_rt.as | 69 + .../test/ecma3/Exceptions/string_002_rt.as | 68 + .../test/ecma3/ExecutionContexts/e10_1_3.as | 85 + .../test/ecma3/ExecutionContexts/e10_1_3_1.as | 205 + .../test/ecma3/ExecutionContexts/e10_1_4_1.as | 92 + .../ecma3/ExecutionContexts/e10_1_4_10.as | 58 + .../test/ecma3/ExecutionContexts/e10_1_4_2.as | 66 + .../test/ecma3/ExecutionContexts/e10_1_4_8.as | 67 + .../test/ecma3/ExecutionContexts/e10_1_4_9.as | 64 + .../test/ecma3/ExecutionContexts/e10_1_5_1.as | 108 + .../test/ecma3/ExecutionContexts/e10_1_5_2.as | 78 + .../test/ecma3/ExecutionContexts/e10_1_5_3.as | 94 + .../test/ecma3/ExecutionContexts/e10_1_5_4.as | 69 + .../test/ecma3/ExecutionContexts/e10_1_6.as | 106 + .../test/ecma3/ExecutionContexts/e10_1_8_1.as | 91 + .../test/ecma3/ExecutionContexts/e10_1_8_2.as | 76 + .../test/ecma3/ExecutionContexts/e10_2_1.as | 69 + .../test/ecma3/ExecutionContexts/e10_2_3_1.as | 69 + .../test/ecma3/ExecutionContexts/e10_2_3_2.as | 75 + .../ecma3/Expressions/StrictEquality_001.as | 96 + .../test/ecma3/Expressions/e11_10_1.as | 248 + .../test/ecma3/Expressions/e11_10_2.as | 243 + .../test/ecma3/Expressions/e11_10_3.as | 242 + .../tamarin/test/ecma3/Expressions/e11_11.as | 109 + .../test/ecma3/Expressions/e11_12_1.as | 54 + .../test/ecma3/Expressions/e11_12_3.as | 55 + .../test/ecma3/Expressions/e11_12_4.as | 55 + .../tamarin/test/ecma3/Expressions/e11_13.as | 54 + .../test/ecma3/Expressions/e11_13_1.as | 48 + .../test/ecma3/Expressions/e11_13_2_1.as | 118 + .../test/ecma3/Expressions/e11_13_2_2.as | 142 + .../test/ecma3/Expressions/e11_13_2_3.as | 162 + .../test/ecma3/Expressions/e11_13_2_4.as | 140 + .../test/ecma3/Expressions/e11_13_2_5.as | 142 + .../test/ecma3/Expressions/e11_14_1.as | 47 + .../tamarin/test/ecma3/Expressions/e11_1_1.as | 102 + .../tamarin/test/ecma3/Expressions/e11_1_4.as | 226 + .../tamarin/test/ecma3/Expressions/e11_1_5.as | 119 + .../tamarin/test/ecma3/Expressions/e11_1_6.as | 150 + .../test/ecma3/Expressions/e11_2_1_1.as | 361 + .../test/ecma3/Expressions/e11_2_1_2.as | 84 + .../test/ecma3/Expressions/e11_2_1_3.as | 80 + .../test/ecma3/Expressions/e11_2_1_4_rt.as | 84 + .../test/ecma3/Expressions/e11_2_1_5.as | 84 + .../test/ecma3/Expressions/e11_2_2_1.as | 97 + .../test/ecma3/Expressions/e11_2_2_10_rt.as | 68 + .../test/ecma3/Expressions/e11_2_2_11.as | 67 + .../test/ecma3/Expressions/e11_2_2_12_rt.as | 54 + .../test/ecma3/Expressions/e11_2_2_1_rt.as | 69 + .../test/ecma3/Expressions/e11_2_2_2_rt.as | 69 + .../test/ecma3/Expressions/e11_2_2_3_rt.as | 68 + .../test/ecma3/Expressions/e11_2_2_4_rt.as | 69 + .../test/ecma3/Expressions/e11_2_2_5_rt.as | 68 + .../test/ecma3/Expressions/e11_2_2_6_rt.as | 67 + .../test/ecma3/Expressions/e11_2_2_7_rt.as | 68 + .../test/ecma3/Expressions/e11_2_2_8_rt.as | 68 + .../test/ecma3/Expressions/e11_2_2_9_rt.as | 67 + .../test/ecma3/Expressions/e11_2_3_1.as | 74 + .../test/ecma3/Expressions/e11_2_3_3_rt.as | 58 + .../test/ecma3/Expressions/e11_2_3_4_rt.as | 58 + .../test/ecma3/Expressions/e11_2_3_5.as | 50 + .../tamarin/test/ecma3/Expressions/e11_2_4.as | 252 + .../tamarin/test/ecma3/Expressions/e11_3_1.as | 176 + .../tamarin/test/ecma3/Expressions/e11_3_2.as | 202 + .../tamarin/test/ecma3/Expressions/e11_4_1.as | 95 + .../tamarin/test/ecma3/Expressions/e11_4_2.as | 86 + .../tamarin/test/ecma3/Expressions/e11_4_3.as | 155 + .../tamarin/test/ecma3/Expressions/e11_4_4.as | 176 + .../tamarin/test/ecma3/Expressions/e11_4_5.as | 176 + .../tamarin/test/ecma3/Expressions/e11_4_6.as | 289 + .../tamarin/test/ecma3/Expressions/e11_4_7.as | 238 + .../tamarin/test/ecma3/Expressions/e11_4_8.as | 195 + .../tamarin/test/ecma3/Expressions/e11_4_9.as | 78 + .../tamarin/test/ecma3/Expressions/e11_5_1.as | 103 + .../tamarin/test/ecma3/Expressions/e11_5_2.as | 137 + .../tamarin/test/ecma3/Expressions/e11_5_3.as | 145 + .../test/ecma3/Expressions/e11_6_1_1.as | 144 + .../test/ecma3/Expressions/e11_6_1_2.as | 166 + .../test/ecma3/Expressions/e11_6_1_3.as | 142 + .../test/ecma3/Expressions/e11_6_2_1.as | 175 + .../tamarin/test/ecma3/Expressions/e11_6_3.as | 98 + .../tamarin/test/ecma3/Expressions/e11_7_1.as | 200 + .../tamarin/test/ecma3/Expressions/e11_7_2.as | 216 + .../tamarin/test/ecma3/Expressions/e11_7_3.as | 199 + .../tamarin/test/ecma3/Expressions/e11_8_1.as | 128 + .../tamarin/test/ecma3/Expressions/e11_8_2.as | 127 + .../tamarin/test/ecma3/Expressions/e11_8_3.as | 131 + .../tamarin/test/ecma3/Expressions/e11_8_4.as | 132 + .../tamarin/test/ecma3/Expressions/e11_8_7.as | 241 + .../tamarin/test/ecma3/Expressions/e11_9_1.as | 145 + .../tamarin/test/ecma3/Expressions/e11_9_2.as | 144 + .../tamarin/test/ecma3/Expressions/e11_9_3.as | 141 + .../tamarin/test/ecma3/Expressions/e11_9_4.as | 157 + .../tamarin/test/ecma3/Expressions/e11_9_5.as | 154 + .../test/ecma3/Expressions/e11_9_6_1.as | 228 + .../test/ecma3/Expressions/instanceof_001.as | 131 + .../test/ecma3/Expressions/instanceof_002.as | 108 + .../ecma3/Expressions/instanceof_003_rt.as | 107 + .../ecma3/Expressions/instanceof_004_rt.as | 74 + .../test/ecma3/Expressions/instanceof_006.as | 118 + .../test/ecma3/Function/call_001_rt.as | 194 + .../test/ecma3/Function/e15_3_4_3_1.as | 262 + .../test/ecma3/Function/e15_3_4_4_1_rt.as | 232 + .../tamarin/test/ecma3/Function/e15_3_FPQA.as | 56 + .../tamarin/test/ecma3/Function/function.as | 57 + .../test/ecma3/Function/regress_104584.as | 99 + .../test/ecma3/Function/regress_137181.as | 151 + .../test/ecma3/Function/regress_49286.as | 161 + .../test/ecma3/Function/regress_58274_rt.as | 290 + .../test/ecma3/Function/regress_97921.as | 184 + .../test/ecma3/Function/scope_001_rt.as | 299 + .../tamarin/test/ecma3/Function/scope_002.as | 277 + .../ecma3/FunctionObjects/e15_3_1_1_1_rt.as | 81 + .../ecma3/FunctionObjects/e15_3_1_1_2_rt.as | 56 + .../ecma3/FunctionObjects/e15_3_1_1_3_rt.as | 72 + .../ecma3/FunctionObjects/e15_3_2_1_1_rt.as | 128 + .../ecma3/FunctionObjects/e15_3_2_1_2_rt.as | 85 + .../ecma3/FunctionObjects/e15_3_2_1_3_rt.as | 73 + .../test/ecma3/FunctionObjects/e15_3_3_1_1.as | 50 + .../test/ecma3/FunctionObjects/e15_3_3_1_2.as | 54 + .../test/ecma3/FunctionObjects/e15_3_3_1_3.as | 60 + .../test/ecma3/FunctionObjects/e15_3_3_1_4.as | 55 + .../test/ecma3/FunctionObjects/e15_3_3_2.as | 47 + .../test/ecma3/FunctionObjects/e15_3_4_1.as | 49 + .../test/ecma3/FunctionObjects/e15_3_4_2.as | 70 + .../ecma3/FunctionObjects/e15_3_4__1_rt.as | 72 + .../test/ecma3/FunctionObjects/e15_3_4_rt.as | 78 + .../ecma3/FunctionObjects/e15_3_5_1_rt.as | 70 + .../ecma3/FunctionObjects/e15_3_5_2_rt.as | 73 + .../ecma3/FunctionObjects/e15_3_5_3_rt.as | 61 + .../ecma3/FunctionObjects/e15_3_5__1_rt.as | 86 + .../ecma3/FunctionObjects/eapply_001_rt.as | 93 + .../test/ecma3/FunctionObjects/ecall_1.as | 65 + .../test/ecma3/GlobalObject/decodeURI.as | 148 + .../ecma3/GlobalObject/decodeURIComponent.as | 116 + .../test/ecma3/GlobalObject/e15_1_1_1.as | 51 + .../test/ecma3/GlobalObject/e15_1_1_2.as | 51 + .../test/ecma3/GlobalObject/e15_1_1_n.as | 60 + .../test/ecma3/GlobalObject/e15_1_2_1_2_rt.as | 54 + .../test/ecma3/GlobalObject/e15_1_2_2_1.as | 270 + .../test/ecma3/GlobalObject/e15_1_2_2_2.as | 216 + .../test/ecma3/GlobalObject/e15_1_2_3_1.as | 510 + .../test/ecma3/GlobalObject/e15_1_2_3_2.as | 254 + .../test/ecma3/GlobalObject/e15_1_2_4.as | 178 + .../test/ecma3/GlobalObject/e15_1_2_5_1.as | 182 + .../test/ecma3/GlobalObject/e15_1_2_5_2.as | 135 + .../test/ecma3/GlobalObject/e15_1_2_5_3.as | 157 + .../test/ecma3/GlobalObject/e15_1_2_6.as | 161 + .../test/ecma3/GlobalObject/e15_1_2_7.as | 140 + .../test/ecma3/GlobalObject/e15_1_2_n.as | 52 + .../test/ecma3/GlobalObject/e15_1_3.as | 57 + .../test/ecma3/GlobalObject/encodeURI.as | 126 + .../ecma3/GlobalObject/encodeURIComponent.as | 91 + .../test/ecma3/GlobalObject/undefined.as | 51 + .../test/ecma3/LexicalConventions/e7_1_1.as | 87 + .../ecma3/LexicalConventions/e7_2_10_rt.as | 53 + .../ecma3/LexicalConventions/e7_2_2_rt.as | 53 + .../ecma3/LexicalConventions/e7_2_3_rt.as | 56 + .../ecma3/LexicalConventions/e7_2_4_rt.as | 54 + .../ecma3/LexicalConventions/e7_2_5_rt.as | 59 + .../ecma3/LexicalConventions/e7_2_6_rt.as | 58 + .../ecma3/LexicalConventions/e7_2_7_rt.as | 58 + .../ecma3/LexicalConventions/e7_2_8_rt.as | 58 + .../ecma3/LexicalConventions/e7_2_9_rt.as | 55 + .../test/ecma3/LexicalConventions/e7_3_1.as | 60 + .../test/ecma3/LexicalConventions/e7_3_10.as | 51 + .../test/ecma3/LexicalConventions/e7_3_11.as | 50 + .../test/ecma3/LexicalConventions/e7_3_12.as | 50 + .../test/ecma3/LexicalConventions/e7_3_2.as | 51 + .../test/ecma3/LexicalConventions/e7_3_3.as | 52 + .../test/ecma3/LexicalConventions/e7_3_4.as | 51 + .../test/ecma3/LexicalConventions/e7_3_5.as | 50 + .../test/ecma3/LexicalConventions/e7_3_6.as | 53 + .../test/ecma3/LexicalConventions/e7_3_7.as | 52 + .../test/ecma3/LexicalConventions/e7_3_9.as | 51 + .../test/ecma3/LexicalConventions/e7_5_1.as | 56 + .../test/ecma3/LexicalConventions/e7_5_6.as | 48 + .../test/ecma3/LexicalConventions/e7_5_7.as | 48 + .../test/ecma3/LexicalConventions/e7_6.as | 445 + .../test/ecma3/LexicalConventions/e7_7_1.as | 49 + .../test/ecma3/LexicalConventions/e7_7_2.as | 52 + .../test/ecma3/LexicalConventions/e7_7_3.as | 316 + .../test/ecma3/LexicalConventions/e7_7_3_1.as | 180 + .../test/ecma3/LexicalConventions/e7_7_3_2.as | 69 + .../test/ecma3/LexicalConventions/e7_7_4.as | 209 + .../test/ecma3/LexicalConventions/e7_9_1.as | 73 + .../eregexp_literals_001.as | 93 + .../eregexp_literals_002.as | 258 + mozilla/js/tamarin/test/ecma3/Math/e15_8_1.as | 72 + .../js/tamarin/test/ecma3/Math/e15_8_1_1_1.as | 53 + .../js/tamarin/test/ecma3/Math/e15_8_1_1_2.as | 50 + .../js/tamarin/test/ecma3/Math/e15_8_1_2_1.as | 53 + .../js/tamarin/test/ecma3/Math/e15_8_1_2_2.as | 48 + .../js/tamarin/test/ecma3/Math/e15_8_1_3_1.as | 56 + .../js/tamarin/test/ecma3/Math/e15_8_1_3_2.as | 55 + .../js/tamarin/test/ecma3/Math/e15_8_1_4_1.as | 55 + .../js/tamarin/test/ecma3/Math/e15_8_1_4_2.as | 50 + .../js/tamarin/test/ecma3/Math/e15_8_1_5_1.as | 58 + .../js/tamarin/test/ecma3/Math/e15_8_1_5_2.as | 51 + .../js/tamarin/test/ecma3/Math/e15_8_1_6_1.as | 55 + .../js/tamarin/test/ecma3/Math/e15_8_1_6_2.as | 50 + .../js/tamarin/test/ecma3/Math/e15_8_1_7_1.as | 56 + .../js/tamarin/test/ecma3/Math/e15_8_1_7_2.as | 50 + .../js/tamarin/test/ecma3/Math/e15_8_1_8_1.as | 55 + .../js/tamarin/test/ecma3/Math/e15_8_1_8_2.as | 49 + .../js/tamarin/test/ecma3/Math/e15_8_1_8_3.as | 44 + .../js/tamarin/test/ecma3/Math/e15_8_2_1.as | 151 + .../js/tamarin/test/ecma3/Math/e15_8_2_10.as | 82 + .../js/tamarin/test/ecma3/Math/e15_8_2_11.as | 85 + .../js/tamarin/test/ecma3/Math/e15_8_2_12.as | 86 + .../js/tamarin/test/ecma3/Math/e15_8_2_13.as | 127 + .../js/tamarin/test/ecma3/Math/e15_8_2_14.as | 79 + .../js/tamarin/test/ecma3/Math/e15_8_2_15.as | 87 + .../js/tamarin/test/ecma3/Math/e15_8_2_16.as | 71 + .../js/tamarin/test/ecma3/Math/e15_8_2_17.as | 88 + .../tamarin/test/ecma3/Math/e15_8_2_17_1.as | 66 + .../js/tamarin/test/ecma3/Math/e15_8_2_18.as | 88 + .../js/tamarin/test/ecma3/Math/e15_8_2_2.as | 102 + .../js/tamarin/test/ecma3/Math/e15_8_2_3.as | 77 + .../js/tamarin/test/ecma3/Math/e15_8_2_4.as | 76 + .../js/tamarin/test/ecma3/Math/e15_8_2_5.as | 100 + .../js/tamarin/test/ecma3/Math/e15_8_2_6.as | 104 + .../js/tamarin/test/ecma3/Math/e15_8_2_7.as | 103 + .../js/tamarin/test/ecma3/Math/e15_8_2_8.as | 109 + .../js/tamarin/test/ecma3/Math/e15_8_2_9.as | 117 + .../js/tamarin/test/ecma3/Math/e15_8_2_rt.as | 61 + .../js/tamarin/test/ecma3/Math/e15_8_3_rt.as | 58 + .../js/tamarin/test/ecma3/Math/e15_8__1.as | 56 + mozilla/js/tamarin/test/ecma3/Misc/smoke.as | 89 + .../test/ecma3/NativeObjects/e15_2_rt.as | 55 + .../js/tamarin/test/ecma3/Number/e15_7_1.as | 180 + .../js/tamarin/test/ecma3/Number/e15_7_2.as | 306 + .../js/tamarin/test/ecma3/Number/e15_7_3.as | 49 + .../tamarin/test/ecma3/Number/e15_7_3_1_1.as | 55 + .../tamarin/test/ecma3/Number/e15_7_3_1_2.as | 76 + .../tamarin/test/ecma3/Number/e15_7_3_1_3.as | 60 + .../tamarin/test/ecma3/Number/e15_7_3_2_1.as | 51 + .../tamarin/test/ecma3/Number/e15_7_3_2_2.as | 52 + .../tamarin/test/ecma3/Number/e15_7_3_2_3.as | 60 + .../tamarin/test/ecma3/Number/e15_7_3_2_4.as | 57 + .../tamarin/test/ecma3/Number/e15_7_3_3_1.as | 51 + .../tamarin/test/ecma3/Number/e15_7_3_3_2.as | 53 + .../tamarin/test/ecma3/Number/e15_7_3_3_3.as | 58 + .../tamarin/test/ecma3/Number/e15_7_3_3_4.as | 59 + .../tamarin/test/ecma3/Number/e15_7_3_4_1.as | 48 + .../tamarin/test/ecma3/Number/e15_7_3_4_2.as | 53 + .../tamarin/test/ecma3/Number/e15_7_3_4_3.as | 61 + .../tamarin/test/ecma3/Number/e15_7_3_4_4.as | 59 + .../tamarin/test/ecma3/Number/e15_7_3_5_1.as | 47 + .../tamarin/test/ecma3/Number/e15_7_3_5_2.as | 59 + .../test/ecma3/Number/e15_7_3_5_3_rt.as | 60 + .../tamarin/test/ecma3/Number/e15_7_3_5_4.as | 56 + .../tamarin/test/ecma3/Number/e15_7_3_6_1.as | 46 + .../tamarin/test/ecma3/Number/e15_7_3_6_2.as | 50 + .../test/ecma3/Number/e15_7_3_6_3_rt.as | 65 + .../tamarin/test/ecma3/Number/e15_7_3_6_4.as | 56 + .../js/tamarin/test/ecma3/Number/e15_7_4_1.as | 50 + .../test/ecma3/Number/e15_7_4_2_1_rt.as | 115 + .../test/ecma3/Number/e15_7_4_2_2_rt.as | 59 + .../test/ecma3/Number/e15_7_4_2_3_rt.as | 61 + .../tamarin/test/ecma3/Number/e15_7_4_2_4.as | 225 + .../test/ecma3/Number/e15_7_4_3_1_rt.as | 55 + .../tamarin/test/ecma3/Number/e15_7_4_3_2.as | 64 + .../test/ecma3/Number/e15_7_4_3_3_rt.as | 65 + .../tamarin/test/ecma3/Number/e15_7_4_6_1.as | 208 + .../tamarin/test/ecma3/Number/e15_7_4_7_1.as | 225 + .../test/ecma3/Number/e15_7_4__1_rt.as | 52 + .../tamarin/test/ecma3/Number/e15_7_4_rt.as | 59 + .../ecma3/Number/ecma4_sealedtype_1_rt.as | 65 + .../ecma3/Number/ecma4_sealedtype_2_rt.as | 66 + .../ecma3/Number/ecma4_sealedtype_3_rt.as | 66 + .../ecma3/Number/ecma4_sealedtype_4_rt.as | 69 + .../ecma3/Number/ecma4_st_valueOf_1_rt.as | 71 + .../ecma3/Number/ecma4_st_valueOf_2_rt.as | 70 + .../ecma3/Number/ecma4_st_valueOf_3_rt.as | 69 + .../test/ecma3/Number/eregress_121952.as | 129 + .../test/ecma3/Number/toLocaleString2_rt.as | 51 + .../test/ecma3/Number/toLocaleString3_rt.as | 55 + .../test/ecma3/Number/toLocaleString4_rt.as | 58 + .../test/ecma3/Number/toLocaleString_rt.as | 197 + .../tamarin/test/ecma3/Number/tostring_001.as | 80 + .../test/ecma3/ObjectObjects/bug129539.as | 67 + .../test/ecma3/ObjectObjects/class_001.as | 141 + .../test/ecma3/ObjectObjects/class_002.as | 129 + .../test/ecma3/ObjectObjects/class_003.as | 123 + .../test/ecma3/ObjectObjects/class_004.as | 122 + .../test/ecma3/ObjectObjects/class_005.as | 108 + .../test/ecma3/ObjectObjects/class_006.as | 154 + .../test/ecma3/ObjectObjects/e15_2_1_1_rt.as | 310 + .../test/ecma3/ObjectObjects/e15_2_1_2_rt.as | 60 + .../test/ecma3/ObjectObjects/e15_2_2_1_rt.as | 146 + .../test/ecma3/ObjectObjects/e15_2_2_2.as | 50 + .../test/ecma3/ObjectObjects/e15_2_3_1_1.as | 52 + .../test/ecma3/ObjectObjects/e15_2_3_1_2.as | 55 + .../test/ecma3/ObjectObjects/e15_2_3_1_3.as | 65 + .../test/ecma3/ObjectObjects/e15_2_3_1_4.as | 50 + .../test/ecma3/ObjectObjects/e15_2_3_1_rt.as | 47 + .../test/ecma3/ObjectObjects/e15_2_3_rt.as | 50 + .../test/ecma3/ObjectObjects/e15_2_4_1_rt.as | 49 + .../test/ecma3/ObjectObjects/e15_2_4_2.as | 158 + .../test/ecma3/ObjectObjects/e15_2_4_3.as | 166 + .../test/ecma3/ObjectObjects/e8_6_2_6_001.as | 117 + .../ecma3/ObjectObjects/hasOwnProperty.as | 69 + .../test/ecma3/ObjectObjects/isPrototypeOf.as | 71 + .../ObjectObjects/propertyIsEnumerable.as | 53 + .../ecma3/ObjectObjects/regress_72773_rt.as | 105 + .../ecma3/ObjectObjects/regress_79129_001.as | 91 + .../ecma3/ObjectObjects/toLocaleString_rt.as | 122 + .../tamarin/test/ecma3/RegExp/e15_10_2_1.as | 190 + .../tamarin/test/ecma3/RegExp/e15_10_3_1_1.as | 144 + .../tamarin/test/ecma3/RegExp/e15_10_3_1_2.as | 157 + .../tamarin/test/ecma3/RegExp/e15_10_4_1_1.as | 164 + .../tamarin/test/ecma3/RegExp/e15_10_4_1_2.as | 173 + .../tamarin/test/ecma3/RegExp/e15_10_4_1_3.as | 177 + .../tamarin/test/ecma3/RegExp/e15_10_4_1_4.as | 126 + .../test/ecma3/RegExp/e15_10_4_1_5_rt.as | 151 + .../tamarin/test/ecma3/RegExp/e15_10_6_1.as | 50 + .../tamarin/test/ecma3/RegExp/e15_10_6_2_1.as | 131 + .../tamarin/test/ecma3/RegExp/e15_10_6_2_2.as | 370 + .../tamarin/test/ecma3/RegExp/e15_10_6_3.as | 165 + .../tamarin/test/ecma3/RegExp/e15_10_6_4.as | 199 + .../test/ecma3/RegExp/econstructor_001.as | 93 + .../js/tamarin/test/ecma3/RegExp/eexec_001.as | 64 + .../js/tamarin/test/ecma3/RegExp/eexec_002.as | 212 + .../test/ecma3/RegExp/efunction_001.as | 99 + .../js/tamarin/test/ecma3/RegExp/ehex_001.as | 95 + .../test/ecma3/RegExp/emultiline_001.as | 93 + .../tamarin/test/ecma3/RegExp/eoctal_001.as | 143 + .../tamarin/test/ecma3/RegExp/eoctal_003.as | 95 + .../test/ecma3/RegExp/eperlstress_001.as | 3227 +++ .../test/ecma3/RegExp/eperlstress_002.as | 1822 ++ .../test/ecma3/RegExp/eproperties_001.as | 197 + .../test/ecma3/RegExp/eproperties_002.as | 156 + .../ecma3/RegExp/eregexp_enumerate_001.as | 92 + .../tamarin/test/ecma3/RegExp/eregress_001.as | 68 + .../test/ecma3/RegExp/eregress_100199.as | 297 + .../test/ecma3/RegExp/eregress_103087.as | 174 + .../test/ecma3/RegExp/eregress_105972.as | 147 + .../test/ecma3/RegExp/eregress_119909.as | 125 + .../test/ecma3/RegExp/eregress_122076.as | 163 + .../test/ecma3/RegExp/eregress_123437.as | 121 + .../test/ecma3/RegExp/eregress_165353.as | 130 + .../test/ecma3/RegExp/eregress_169497.as | 113 + .../test/ecma3/RegExp/eregress_169534.as | 100 + .../test/ecma3/RegExp/eregress_170798.as | 105 + .../test/ecma3/RegExp/eregress_171999.as | 98 + .../test/ecma3/RegExp/eregress_28686.as | 78 + .../test/ecma3/RegExp/eregress_31316.as | 89 + .../test/ecma3/RegExp/eregress_57631.as | 166 + .../test/ecma3/RegExp/eregress_67773.as | 202 + .../test/ecma3/RegExp/eregress_72964.as | 112 + .../test/ecma3/RegExp/eregress_76683.as | 104 + .../test/ecma3/RegExp/eregress_78156.as | 113 + .../test/ecma3/RegExp/eregress_87231.as | 136 + .../test/ecma3/RegExp/eregress_98306.as | 113 + .../tamarin/test/ecma3/RegExp/eunicode_001.as | 83 + .../test/ecma3/RegExp/multibyte_regress.as | 63 + .../js/tamarin/test/ecma3/SourceText/e6_1.as | 124 + .../js/tamarin/test/ecma3/SourceText/e6_2.as | 90 + .../js/tamarin/test/ecma3/Statements/block.as | 80 + .../tamarin/test/ecma3/Statements/e12_10.as | 56 + .../tamarin/test/ecma3/Statements/e12_10_1.as | 144 + .../tamarin/test/ecma3/Statements/e12_2_1.as | 135 + .../tamarin/test/ecma3/Statements/e12_5_1.as | 101 + .../tamarin/test/ecma3/Statements/e12_5_2.as | 87 + .../tamarin/test/ecma3/Statements/e12_5_3.as | 176 + .../test/ecma3/Statements/e12_6_1_1.as | 70 + .../test/ecma3/Statements/e12_6_2_1.as | 60 + .../test/ecma3/Statements/e12_6_2_2.as | 61 + .../test/ecma3/Statements/e12_6_2_3.as | 58 + .../test/ecma3/Statements/e12_6_2_4.as | 59 + .../test/ecma3/Statements/e12_6_2_5.as | 58 + .../test/ecma3/Statements/e12_6_2_6.as | 60 + .../test/ecma3/Statements/e12_6_2_7.as | 58 + .../test/ecma3/Statements/e12_6_2_8.as | 55 + .../test/ecma3/Statements/e12_6_3_1.as | 72 + .../test/ecma3/Statements/e12_6_3_10.as | 92 + .../test/ecma3/Statements/e12_6_3_11.as | 57 + .../test/ecma3/Statements/e12_6_3_12.as | 69 + .../test/ecma3/Statements/e12_6_3_19.as | 93 + .../test/ecma3/Statements/e12_6_3_2.as | 57 + .../test/ecma3/Statements/e12_6_3_3.as | 68 + .../test/ecma3/Statements/e12_6_3_4.as | 162 + .../test/ecma3/Statements/e12_6_3_9_rt.as | 74 + .../tamarin/test/ecma3/Statements/e12_9_1.as | 82 + .../test/ecma3/Statements/edowhile_001.as | 68 + .../test/ecma3/Statements/edowhile_002.as | 93 + .../test/ecma3/Statements/edowhile_003.as | 86 + .../test/ecma3/Statements/edowhile_004.as | 89 + .../test/ecma3/Statements/edowhile_005.as | 91 + .../test/ecma3/Statements/edowhile_006.as | 114 + .../test/ecma3/Statements/edowhile_007.as | 120 + .../test/ecma3/Statements/eforin_001.as | 388 + .../test/ecma3/Statements/eforin_002.as | 198 + .../tamarin/test/ecma3/Statements/eif_001.as | 61 + .../test/ecma3/Statements/elabel_001.as | 64 + .../test/ecma3/Statements/elabel_002.as | 78 + .../test/ecma3/Statements/eregress_131348.as | 229 + .../ecma3/Statements/eregress_74474_001.as | 164 + .../ecma3/Statements/eregress_74474_002.as | 9116 +++++++ .../ecma3/Statements/eregress_74474_003.as | 9123 +++++++ .../ecma3/Statements/eregress_83532_001.as | 93 + .../ecma3/Statements/eregress_83532_002.as | 93 + .../test/ecma3/Statements/eswitch_001.as | 168 + .../test/ecma3/Statements/eswitch_002.as | 85 + .../test/ecma3/Statements/eswitch_003.as | 81 + .../test/ecma3/Statements/eswitch_004.as | 112 + .../tamarin/test/ecma3/Statements/etry_001.as | 91 + .../tamarin/test/ecma3/Statements/etry_003.as | 194 + .../tamarin/test/ecma3/Statements/etry_004.as | 102 + .../tamarin/test/ecma3/Statements/etry_005.as | 112 + .../tamarin/test/ecma3/Statements/etry_006.as | 101 + .../tamarin/test/ecma3/Statements/etry_007.as | 91 + .../tamarin/test/ecma3/Statements/etry_008.as | 81 + .../tamarin/test/ecma3/Statements/etry_009.as | 87 + .../tamarin/test/ecma3/Statements/etry_010.as | 93 + .../tamarin/test/ecma3/Statements/etry_012.as | 204 + .../test/ecma3/Statements/ewhile_001.as | 64 + .../test/ecma3/Statements/ewhile_002.as | 101 + .../test/ecma3/Statements/ewhile_003.as | 103 + .../test/ecma3/Statements/ewhile_004.as | 211 + .../test/ecma3/Statements/expression.as | 56 + .../js/tamarin/test/ecma3/Statements/throw.as | 94 + mozilla/js/tamarin/test/ecma3/String/Split.as | 101 + .../js/tamarin/test/ecma3/String/concat.as | 87 + .../js/tamarin/test/ecma3/String/e15_5_1.as | 117 + .../js/tamarin/test/ecma3/String/e15_5_2.as | 152 + .../js/tamarin/test/ecma3/String/e15_5_3.as | 49 + .../tamarin/test/ecma3/String/e15_5_3_1_1.as | 61 + .../tamarin/test/ecma3/String/e15_5_3_1_2.as | 58 + .../tamarin/test/ecma3/String/e15_5_3_1_3.as | 48 + .../tamarin/test/ecma3/String/e15_5_3_1_4.as | 49 + .../tamarin/test/ecma3/String/e15_5_3_2_1.as | 181 + .../tamarin/test/ecma3/String/e15_5_3_2_2.as | 79 + .../tamarin/test/ecma3/String/e15_5_3_2_3.as | 100 + .../js/tamarin/test/ecma3/String/e15_5_4.as | 62 + .../test/ecma3/String/e15_5_4_10_1_rt.as | 226 + .../tamarin/test/ecma3/String/e15_5_4_11_1.as | 496 + .../tamarin/test/ecma3/String/e15_5_4_11_2.as | 493 + .../tamarin/test/ecma3/String/e15_5_4_11_3.as | 491 + .../tamarin/test/ecma3/String/e15_5_4_11_4.as | 485 + .../tamarin/test/ecma3/String/e15_5_4_11_5.as | 499 + .../tamarin/test/ecma3/String/e15_5_4_11_6.as | 493 + .../tamarin/test/ecma3/String/e15_5_4_12_1.as | 496 + .../tamarin/test/ecma3/String/e15_5_4_12_2.as | 496 + .../tamarin/test/ecma3/String/e15_5_4_12_3.as | 539 + .../tamarin/test/ecma3/String/e15_5_4_12_4.as | 493 + .../tamarin/test/ecma3/String/e15_5_4_12_5.as | 493 + .../tamarin/test/ecma3/String/e15_5_4_13.as | 145 + .../tamarin/test/ecma3/String/e15_5_4_1_rt.as | 62 + .../tamarin/test/ecma3/String/e15_5_4_2_1.as | 52 + .../tamarin/test/ecma3/String/e15_5_4_2_3.as | 68 + .../tamarin/test/ecma3/String/e15_5_4_2_rt.as | 77 + .../tamarin/test/ecma3/String/e15_5_4_3_1.as | 55 + .../tamarin/test/ecma3/String/e15_5_4_3_2.as | 69 + .../test/ecma3/String/e15_5_4_3_3_rt.as | 61 + .../tamarin/test/ecma3/String/e15_5_4_4_1.as | 66 + .../tamarin/test/ecma3/String/e15_5_4_4_2.as | 110 + .../tamarin/test/ecma3/String/e15_5_4_4_3.as | 80 + .../test/ecma3/String/e15_5_4_4_4_rt.as | 525 + .../tamarin/test/ecma3/String/e15_5_4_5_1.as | 54 + .../tamarin/test/ecma3/String/e15_5_4_5_2.as | 122 + .../tamarin/test/ecma3/String/e15_5_4_5_3.as | 98 + .../tamarin/test/ecma3/String/e15_5_4_5_4.as | 63 + .../tamarin/test/ecma3/String/e15_5_4_5_5.as | 81 + .../test/ecma3/String/e15_5_4_5_6_rt.as | 195 + .../tamarin/test/ecma3/String/e15_5_4_6_1.as | 127 + .../test/ecma3/String/e15_5_4_6_2_rt.as | 303 + .../tamarin/test/ecma3/String/e15_5_4_7_1.as | 178 + .../tamarin/test/ecma3/String/e15_5_4_7_2.as | 198 + .../test/ecma3/String/e15_5_4_7_3_rt.as | 189 + .../test/ecma3/String/e15_5_4_8_1_rt.as | 340 + .../tamarin/test/ecma3/String/e15_5_4_8_2.as | 189 + .../tamarin/test/ecma3/String/e15_5_4_8_3.as | 146 + .../test/ecma3/String/e15_5_4_9_1_rt.as | 206 + .../js/tamarin/test/ecma3/String/e15_5_5_1.as | 132 + .../tamarin/test/ecma3/String/ematch_001.as | 130 + .../tamarin/test/ecma3/String/ematch_002.as | 197 + .../tamarin/test/ecma3/String/ematch_003.as | 156 + .../tamarin/test/ecma3/String/ematch_004.as | 200 + .../test/ecma3/String/eregress_104375.as | 110 + .../test/ecma3/String/eregress_137879.as | 80 + .../test/ecma3/String/eregress_137890.as | 57 + .../test/ecma3/String/eregress_83293.as | 152 + .../tamarin/test/ecma3/String/ereplace_001.as | 227 + .../tamarin/test/ecma3/String/esplit_001.as | 135 + .../tamarin/test/ecma3/String/esplit_002.as | 289 + .../tamarin/test/ecma3/String/esplit_003.as | 147 + .../test/ecma3/String/localeCompare_rt.as | 75 + .../js/tamarin/test/ecma3/String/search.as | 69 + .../js/tamarin/test/ecma3/String/substr.as | 175 + .../test/ecma3/String/toLocaleLowerCase.as | 498 + .../test/ecma3/String/toLocaleLowerCase2.as | 494 + .../test/ecma3/String/toLocaleLowerCase3.as | 493 + .../test/ecma3/String/toLocaleLowerCase4.as | 486 + .../test/ecma3/String/toLocaleLowerCase5.as | 497 + .../test/ecma3/String/toLocaleLowerCase6.as | 494 + .../test/ecma3/String/toLocaleUpperCase.as | 494 + .../test/ecma3/String/toLocaleUpperCase2.as | 494 + .../test/ecma3/String/toLocaleUpperCase3.as | 543 + .../test/ecma3/String/toLocaleUpperCase4.as | 496 + .../test/ecma3/String/toLocaleUpperCase5.as | 497 + .../test/ecma3/TypeConversion/e9_2_rt.as | 97 + .../tamarin/test/ecma3/TypeConversion/e9_3.as | 67 + .../test/ecma3/TypeConversion/e9_3_1.as | 83 + .../test/ecma3/TypeConversion/e9_3_1_1.as | 299 + .../test/ecma3/TypeConversion/e9_3_1_2.as | 64 + .../test/ecma3/TypeConversion/e9_3_1_3_rt.as | 604 + .../test/ecma3/TypeConversion/e9_4_1.as | 92 + .../test/ecma3/TypeConversion/e9_4_2.as | 92 + .../test/ecma3/TypeConversion/e9_5_2.as | 137 + .../tamarin/test/ecma3/TypeConversion/e9_6.as | 106 + .../tamarin/test/ecma3/TypeConversion/e9_7.as | 136 + .../test/ecma3/TypeConversion/e9_8_1.as | 103 + .../test/ecma3/TypeConversion/e9_9_1_rt.as | 118 + mozilla/js/tamarin/test/ecma3/Types/e8_1.as | 62 + mozilla/js/tamarin/test/ecma3/Types/e8_2.as | 57 + mozilla/js/tamarin/test/ecma3/Types/e8_3.as | 70 + mozilla/js/tamarin/test/ecma3/Types/e8_4.as | 111 + mozilla/js/tamarin/test/ecma3/Types/e8_5.as | 161 + mozilla/js/tamarin/test/ecma3/Types/e8_6_1.as | 98 + .../test/ecma3/Unicode/u0000_BasicLatin.as | 52 + .../ecma3/Unicode/u0080_Latin_1Supplement.as | 52 + .../ecma3/Unicode/u0100_LatinExtended_A.as | 52 + .../ecma3/Unicode/u0180_LatinExtended_B.as | 52 + .../test/ecma3/Unicode/u0250_IPAExtensions.as | 52 + .../Unicode/u02B0_SpacingModifierLetters.as | 52 + .../u0300_CombiningDiacriticalMarks.as | 52 + .../ecma3/Unicode/u0370_GreekandCoptic.as | 52 + .../test/ecma3/Unicode/u0400_Cyrillic.as | 52 + .../Unicode/u0500_CyrillicSupplementary.as | 52 + .../test/ecma3/Unicode/u0530_Armenian.as | 52 + .../test/ecma3/Unicode/u0590_Hebrew.as | 52 + .../test/ecma3/Unicode/u0600_Arabic.as | 52 + .../test/ecma3/Unicode/u0700_Syriac.as | 52 + .../test/ecma3/Unicode/u0780_Thaana.as | 52 + .../test/ecma3/Unicode/u0900_Devanagari.as | 52 + .../test/ecma3/Unicode/u0980_Bengali.as | 52 + .../test/ecma3/Unicode/u0A00_Gurmukhi.as | 52 + .../test/ecma3/Unicode/u0A80_Gujarati.as | 52 + .../tamarin/test/ecma3/Unicode/u0B00_Oriya.as | 52 + .../tamarin/test/ecma3/Unicode/u0B80_Tamil.as | 52 + .../test/ecma3/Unicode/u0C00_Telugu.as | 52 + .../test/ecma3/Unicode/u0C80_Kannada.as | 52 + .../test/ecma3/Unicode/u0D00_Malayalam.as | 52 + .../test/ecma3/Unicode/u0D80_Sinhala.as | 52 + .../tamarin/test/ecma3/Unicode/u0E00_Thai.as | 52 + .../tamarin/test/ecma3/Unicode/u0E80_Lao.as | 52 + .../test/ecma3/Unicode/u0F00_Tibetan.as | 52 + .../test/ecma3/Unicode/u1000_Myanmar.as | 52 + .../test/ecma3/Unicode/u10A0_Georgian.as | 52 + .../test/ecma3/Unicode/u1100_HangulJamo.as | 52 + .../test/ecma3/Unicode/u1200_Ethiopic.as | 52 + .../test/ecma3/Unicode/u13A0_Cherokee.as | 52 + ...1400_UnifiedCanadianAboriginalSyllabics.as | 52 + .../tamarin/test/ecma3/Unicode/u1680_Ogham.as | 52 + .../tamarin/test/ecma3/Unicode/u16A0_Runic.as | 52 + .../test/ecma3/Unicode/u1700_Tagalog.as | 52 + .../test/ecma3/Unicode/u1720_Hanunoo.as | 52 + .../tamarin/test/ecma3/Unicode/u1740_Buhid.as | 52 + .../test/ecma3/Unicode/u1760_Tagbanwa.as | 52 + .../tamarin/test/ecma3/Unicode/u1780_Khmer.as | 52 + .../test/ecma3/Unicode/u1800_Mongolian.as | 52 + .../Unicode/u1E00_LatinExtendedAdditional.as | 52 + .../test/ecma3/Unicode/u1F00_GreekExtended.as | 52 + .../ecma3/Unicode/u2000_GeneralPunctuation.as | 52 + .../u2070_SuperscriptsandSubscripts.as | 52 + .../ecma3/Unicode/u20A0_CurrencySymbols.as | 52 + ...0D0_CombiningDiacriticalMarksforSymbols.as | 52 + .../ecma3/Unicode/u2100_LetterlikeSymbols.as | 52 + .../test/ecma3/Unicode/u2150_NumberForms.as | 52 + .../test/ecma3/Unicode/u2190_Arrows.as | 52 + .../Unicode/u2200_MathematicalOperators.as | 52 + .../Unicode/u2300_MiscellaneousTechnical.as | 52 + .../ecma3/Unicode/u2400_ControlPictures.as | 52 + .../u2440_OpticalCharacterRecognition.as | 52 + .../Unicode/u2460_EnclosedAlphanumerics.as | 52 + .../test/ecma3/Unicode/u2500_BoxDrawing.as | 52 + .../test/ecma3/Unicode/u2580_BlockElements.as | 52 + .../ecma3/Unicode/u25A0_GeometricShapes.as | 52 + .../Unicode/u2600_MiscellaneousSymbols.as | 52 + .../test/ecma3/Unicode/u2700_Dingbats.as | 52 + ...27C0_MiscellaneousMathematicalSymbols_A.as | 52 + .../Unicode/u27F0_SupplementalArrows_A.as | 52 + .../ecma3/Unicode/u2800_BraillePatterns.as | 52 + .../Unicode/u2900_SupplementalArrows_B.as | 52 + ...2980_MiscellaneousMathematicalSymbols_B.as | 52 + ...u2A00_SupplementalMathematicalOperators.as | 52 + .../Unicode/u2E80_CJKRadicalsSupplement.as | 52 + .../ecma3/Unicode/u2F00_KangxiRadicals.as | 52 + .../u2FF0_IdeographicDescriptionCharacters.as | 52 + .../Unicode/u3000_CJKSymbolsandPunctuation.as | 52 + .../test/ecma3/Unicode/u3040_Hiragana.as | 52 + .../test/ecma3/Unicode/u30A0_Katakana.as | 52 + .../test/ecma3/Unicode/u3100_Bopomofo.as | 52 + .../Unicode/u3130_HangulCompatibilityJamo.as | 52 + .../test/ecma3/Unicode/u3190_Kanbun.as | 52 + .../ecma3/Unicode/u31A0_BopomofoExtended.as | 52 + .../u31F0_KatakanaPhoneticExtensions.as | 52 + .../u3200_EnclosedCJKLettersandMonths.as | 52 + .../ecma3/Unicode/u3300_CJKCompatibility.as | 52 + .../u3400_CJKUnifiedIdeographsExtensionA.as | 52 + .../Unicode/u4E00_CJKUnifiedIdeographs.as | 52 + .../Unicode/u5000_CJKUnifiedIdeographs.as | 52 + .../Unicode/u6000_CJKUnifiedIdeographs.as | 52 + .../Unicode/u7000_CJKUnifiedIdeographs.as | 52 + .../Unicode/u8000_CJKUnifiedIdeographs.as | 52 + .../Unicode/u9000_CJKUnifiedIdeographs.as | 52 + .../test/ecma3/Unicode/uA000_YiSyllables.as | 52 + .../test/ecma3/Unicode/uA490_YiRadicals.as | 52 + .../ecma3/Unicode/uAC00_HangulSyllables.as | 52 + .../ecma3/Unicode/uD800_HighSurrogates.as | 52 + .../Unicode/uDB80_HighPrivateUseSurrogates.as | 52 + .../test/ecma3/Unicode/uDC00_LowSurrogates.as | 52 + .../ecma3/Unicode/uE000_PrivateUseArea.as | 52 + .../uF900_CJKCompatibilityIdeographs.as | 52 + .../uFB00_AlphabeticPresentationForms.as | 52 + .../uFB50_ArabicPresentationForms_A.as | 52 + .../ecma3/Unicode/uFE00_VariationSelectors.as | 52 + .../ecma3/Unicode/uFE20_CombiningHalfMarks.as | 52 + .../Unicode/uFE30_CJKCompatibilityForms.as | 52 + .../ecma3/Unicode/uFE50_SmallFormVariants.as | 52 + .../uFE70_ArabicPresentationForms_B.as | 52 + .../uFF00_HalfwidthandFullwidthForms.as | 52 + .../test/ecma3/Unicode/uFFF0_Specials.as | 52 + .../js/tamarin/test/ecma3/Unicode/uc_001.as | 86 + .../js/tamarin/test/ecma3/Unicode/uc_003.as | 99 + .../js/tamarin/test/ecma3/Unicode/uc_004.as | 82 + .../js/tamarin/test/ecma3/Unicode/uc_005.as | 340 + .../js/tamarin/test/ecma3/Unicode/uc_006.as | 296 + .../test/ecma3/Unicode/unicodeNegativeUtil.as | 257 + .../tamarin/test/ecma3/Unicode/unicodeUtil.as | 315 + .../test/ecma3/instanceof/instanceof_001.as | 58 + .../test/ecma3/instanceof/instanceof_002.as | 73 + .../ecma3/instanceof/instanceof_003_rt.as | 74 + .../test/ecma3/instanceof/regress_7635_rt.as | 118 + mozilla/js/tamarin/test/shell.as | 850 + mozilla/js/tamarin/utils/abcdump.as | 1660 ++ mozilla/js/tamarin/utils/errorgen.as | 754 + mozilla/js/tamarin/utils/modules.txt | 283 + mozilla/js/tamarin/utils/opcodes.as | 193 + mozilla/js/tamarin/utils/stale | 83 + 3146 files changed, 559663 insertions(+) create mode 100644 mozilla/js/tamarin/MMgc/FixedAlloc.cpp create mode 100644 mozilla/js/tamarin/MMgc/FixedAlloc.h create mode 100644 mozilla/js/tamarin/MMgc/FixedMalloc.cpp create mode 100644 mozilla/js/tamarin/MMgc/FixedMalloc.h create mode 100644 mozilla/js/tamarin/MMgc/GC.cpp create mode 100644 mozilla/js/tamarin/MMgc/GC.h create mode 100644 mozilla/js/tamarin/MMgc/GCAlloc.cpp create mode 100644 mozilla/js/tamarin/MMgc/GCAlloc.h create mode 100644 mozilla/js/tamarin/MMgc/GCAllocObject.h create mode 100644 mozilla/js/tamarin/MMgc/GCAllocObjectMac.cpp create mode 100644 mozilla/js/tamarin/MMgc/GCAllocObjectUnix.cpp create mode 100644 mozilla/js/tamarin/MMgc/GCAllocObjectWin.cpp create mode 100644 mozilla/js/tamarin/MMgc/GCDebug.h create mode 100644 mozilla/js/tamarin/MMgc/GCDebugMac.cpp create mode 100644 mozilla/js/tamarin/MMgc/GCDebugUnix.cpp create mode 100644 mozilla/js/tamarin/MMgc/GCDebugWin.cpp create mode 100644 mozilla/js/tamarin/MMgc/GCHashtable.cpp create mode 100644 mozilla/js/tamarin/MMgc/GCHashtable.h create mode 100644 mozilla/js/tamarin/MMgc/GCHeap.cpp create mode 100644 mozilla/js/tamarin/MMgc/GCHeap.h create mode 100644 mozilla/js/tamarin/MMgc/GCHeapMac.cpp create mode 100644 mozilla/js/tamarin/MMgc/GCHeapUnix.cpp create mode 100644 mozilla/js/tamarin/MMgc/GCHeapWin.cpp create mode 100644 mozilla/js/tamarin/MMgc/GCLargeAlloc.cpp create mode 100644 mozilla/js/tamarin/MMgc/GCLargeAlloc.h create mode 100644 mozilla/js/tamarin/MMgc/GCMemoryProfiler.cpp create mode 100644 mozilla/js/tamarin/MMgc/GCMemoryProfiler.h create mode 100644 mozilla/js/tamarin/MMgc/GCObject.cpp create mode 100644 mozilla/js/tamarin/MMgc/GCObject.h create mode 100644 mozilla/js/tamarin/MMgc/GCSpinLockLinux.h create mode 100644 mozilla/js/tamarin/MMgc/GCSpinLockMac.h create mode 100644 mozilla/js/tamarin/MMgc/GCSpinLockWin.h create mode 100644 mozilla/js/tamarin/MMgc/GCStack.h create mode 100644 mozilla/js/tamarin/MMgc/GCTests.cpp create mode 100644 mozilla/js/tamarin/MMgc/GCTests.h create mode 100644 mozilla/js/tamarin/MMgc/GCTypes.h create mode 100644 mozilla/js/tamarin/MMgc/GCWeakRef.h create mode 100644 mozilla/js/tamarin/MMgc/MMgc.cpp create mode 100644 mozilla/js/tamarin/MMgc/MMgc.h create mode 100644 mozilla/js/tamarin/MMgc/MMgc.mcp create mode 100644 mozilla/js/tamarin/MMgc/MMgc.sln create mode 100644 mozilla/js/tamarin/MMgc/MMgc.vcproj create mode 100644 mozilla/js/tamarin/MMgc/MMgc_8.sln create mode 100644 mozilla/js/tamarin/MMgc/MMgc_8.vcproj create mode 100644 mozilla/js/tamarin/MMgc/Makefile create mode 100644 mozilla/js/tamarin/MMgc/Makefile.arm create mode 100644 mozilla/js/tamarin/MMgc/WriteBarrier.h create mode 100644 mozilla/js/tamarin/MMgc/armbuild.h create mode 100644 mozilla/js/tamarin/MMgc/linuxbuild.h create mode 100644 mozilla/js/tamarin/MMgc/macbuild.h create mode 100644 mozilla/js/tamarin/MMgc/makecommon create mode 100644 mozilla/js/tamarin/MMgc/run_alloc/run_alloc.cpp create mode 100644 mozilla/js/tamarin/MMgc/run_alloc/run_alloc.sln create mode 100644 mozilla/js/tamarin/MMgc/run_alloc/run_alloc.vcproj create mode 100644 mozilla/js/tamarin/MMgc/winbuild.h create mode 100644 mozilla/js/tamarin/codegen/ArmAssembler.cpp create mode 100644 mozilla/js/tamarin/codegen/ArmAssembler.h create mode 100644 mozilla/js/tamarin/codegen/CodegenMIR.cpp create mode 100644 mozilla/js/tamarin/codegen/CodegenMIR.h create mode 100644 mozilla/js/tamarin/codegen/Ia32Assembler.cpp create mode 100644 mozilla/js/tamarin/codegen/PpcAssembler.cpp create mode 100644 mozilla/js/tamarin/core/AbcData.cpp create mode 100644 mozilla/js/tamarin/core/AbcEnv.cpp create mode 100644 mozilla/js/tamarin/core/AbcEnv.h create mode 100644 mozilla/js/tamarin/core/AbcGen.cpp create mode 100644 mozilla/js/tamarin/core/AbcGen.h create mode 100644 mozilla/js/tamarin/core/AbcParser.cpp create mode 100644 mozilla/js/tamarin/core/AbcParser.h create mode 100644 mozilla/js/tamarin/core/AbstractFunction.cpp create mode 100644 mozilla/js/tamarin/core/AbstractFunction.h create mode 100644 mozilla/js/tamarin/core/ActionBlockConstants.cpp create mode 100644 mozilla/js/tamarin/core/ActionBlockConstants.h create mode 100644 mozilla/js/tamarin/core/Array.as create mode 100644 mozilla/js/tamarin/core/ArrayClass.cpp create mode 100644 mozilla/js/tamarin/core/ArrayClass.h create mode 100644 mozilla/js/tamarin/core/ArrayObject.cpp create mode 100644 mozilla/js/tamarin/core/ArrayObject.h create mode 100644 mozilla/js/tamarin/core/AtomArray.cpp create mode 100644 mozilla/js/tamarin/core/AtomArray.h create mode 100644 mozilla/js/tamarin/core/AtomConstants.cpp create mode 100644 mozilla/js/tamarin/core/AtomConstants.h create mode 100644 mozilla/js/tamarin/core/AtomWriteBarrier.h create mode 100644 mozilla/js/tamarin/core/AvmCore.cpp create mode 100644 mozilla/js/tamarin/core/AvmCore.h create mode 100644 mozilla/js/tamarin/core/AvmDebug.h create mode 100644 mozilla/js/tamarin/core/AvmDebugWin.cpp create mode 100644 mozilla/js/tamarin/core/AvmError.h create mode 100644 mozilla/js/tamarin/core/AvmPlusScriptableObject.cpp create mode 100644 mozilla/js/tamarin/core/AvmPlusScriptableObject.h create mode 100644 mozilla/js/tamarin/core/BigInteger.cpp create mode 100644 mozilla/js/tamarin/core/BigInteger.h create mode 100644 mozilla/js/tamarin/core/BitSet.h create mode 100644 mozilla/js/tamarin/core/Boolean.as create mode 100644 mozilla/js/tamarin/core/BooleanClass.cpp create mode 100644 mozilla/js/tamarin/core/BooleanClass.h create mode 100644 mozilla/js/tamarin/core/BuiltinTraits.cpp create mode 100644 mozilla/js/tamarin/core/BuiltinTraits.h create mode 100644 mozilla/js/tamarin/core/Class.as create mode 100644 mozilla/js/tamarin/core/ClassClass.cpp create mode 100644 mozilla/js/tamarin/core/ClassClass.h create mode 100644 mozilla/js/tamarin/core/ClassClosure.cpp create mode 100644 mozilla/js/tamarin/core/ClassClosure.h create mode 100644 mozilla/js/tamarin/core/CodeContext.h create mode 100644 mozilla/js/tamarin/core/Date.as create mode 100644 mozilla/js/tamarin/core/Date.cpp create mode 100644 mozilla/js/tamarin/core/Date.h create mode 100644 mozilla/js/tamarin/core/DateClass.cpp create mode 100644 mozilla/js/tamarin/core/DateClass.h create mode 100644 mozilla/js/tamarin/core/DateObject.cpp create mode 100644 mozilla/js/tamarin/core/DateObject.h create mode 100644 mozilla/js/tamarin/core/Domain.cpp create mode 100644 mozilla/js/tamarin/core/Domain.h create mode 100644 mozilla/js/tamarin/core/DomainEnv.cpp create mode 100644 mozilla/js/tamarin/core/DomainEnv.h create mode 100644 mozilla/js/tamarin/core/DynamicProfiler.cpp create mode 100644 mozilla/js/tamarin/core/DynamicProfiler.h create mode 100644 mozilla/js/tamarin/core/E4XNode.cpp create mode 100644 mozilla/js/tamarin/core/E4XNode.h create mode 100644 mozilla/js/tamarin/core/Error.as create mode 100644 mozilla/js/tamarin/core/ErrorClass.cpp create mode 100644 mozilla/js/tamarin/core/ErrorClass.h create mode 100644 mozilla/js/tamarin/core/ErrorConstants.as create mode 100644 mozilla/js/tamarin/core/ErrorConstants.cpp create mode 100644 mozilla/js/tamarin/core/ErrorConstants.h create mode 100644 mozilla/js/tamarin/core/Exception.cpp create mode 100644 mozilla/js/tamarin/core/Exception.h create mode 100644 mozilla/js/tamarin/core/FrameState.cpp create mode 100644 mozilla/js/tamarin/core/FrameState.h create mode 100644 mozilla/js/tamarin/core/Function.as create mode 100644 mozilla/js/tamarin/core/FunctionClass.cpp create mode 100644 mozilla/js/tamarin/core/FunctionClass.h create mode 100644 mozilla/js/tamarin/core/GrowableBuffer.cpp create mode 100644 mozilla/js/tamarin/core/GrowableBuffer.h create mode 100644 mozilla/js/tamarin/core/IntClass.cpp create mode 100644 mozilla/js/tamarin/core/IntClass.h create mode 100644 mozilla/js/tamarin/core/Interpreter.cpp create mode 100644 mozilla/js/tamarin/core/Interpreter.h create mode 100644 mozilla/js/tamarin/core/Math.as create mode 100644 mozilla/js/tamarin/core/MathClass.cpp create mode 100644 mozilla/js/tamarin/core/MathClass.h create mode 100644 mozilla/js/tamarin/core/MathUtils.cpp create mode 100644 mozilla/js/tamarin/core/MathUtils.h create mode 100644 mozilla/js/tamarin/core/MethodClosure.cpp create mode 100644 mozilla/js/tamarin/core/MethodClosure.h create mode 100644 mozilla/js/tamarin/core/MethodEnv.cpp create mode 100644 mozilla/js/tamarin/core/MethodEnv.h create mode 100644 mozilla/js/tamarin/core/MethodInfo.cpp create mode 100644 mozilla/js/tamarin/core/MethodInfo.h create mode 100644 mozilla/js/tamarin/core/Multiname.cpp create mode 100644 mozilla/js/tamarin/core/Multiname.h create mode 100644 mozilla/js/tamarin/core/MultinameHashtable.cpp create mode 100644 mozilla/js/tamarin/core/MultinameHashtable.h create mode 100644 mozilla/js/tamarin/core/Namespace.as create mode 100644 mozilla/js/tamarin/core/Namespace.cpp create mode 100644 mozilla/js/tamarin/core/Namespace.h create mode 100644 mozilla/js/tamarin/core/NamespaceClass.cpp create mode 100644 mozilla/js/tamarin/core/NamespaceClass.h create mode 100644 mozilla/js/tamarin/core/NamespaceSet.cpp create mode 100644 mozilla/js/tamarin/core/NamespaceSet.h create mode 100644 mozilla/js/tamarin/core/NativeFunction.cpp create mode 100644 mozilla/js/tamarin/core/NativeFunction.h create mode 100644 mozilla/js/tamarin/core/NativeObjectHelpers.h create mode 100644 mozilla/js/tamarin/core/Number.as create mode 100644 mozilla/js/tamarin/core/NumberClass.cpp create mode 100644 mozilla/js/tamarin/core/NumberClass.h create mode 100644 mozilla/js/tamarin/core/OSDep.h create mode 100644 mozilla/js/tamarin/core/Object.as create mode 100644 mozilla/js/tamarin/core/ObjectClass.cpp create mode 100644 mozilla/js/tamarin/core/ObjectClass.h create mode 100644 mozilla/js/tamarin/core/OutputStream.h create mode 100644 mozilla/js/tamarin/core/PoolObject.cpp create mode 100644 mozilla/js/tamarin/core/PoolObject.h create mode 100644 mozilla/js/tamarin/core/PrintWriter.cpp create mode 100644 mozilla/js/tamarin/core/PrintWriter.h create mode 100644 mozilla/js/tamarin/core/RegExp.as create mode 100644 mozilla/js/tamarin/core/RegExpClass.cpp create mode 100644 mozilla/js/tamarin/core/RegExpClass.h create mode 100644 mozilla/js/tamarin/core/RegExpObject.cpp create mode 100644 mozilla/js/tamarin/core/RegExpObject.h create mode 100644 mozilla/js/tamarin/core/ScopeChain.cpp create mode 100644 mozilla/js/tamarin/core/ScopeChain.h create mode 100644 mozilla/js/tamarin/core/ScriptBuffer.cpp create mode 100644 mozilla/js/tamarin/core/ScriptBuffer.h create mode 100644 mozilla/js/tamarin/core/ScriptObject.cpp create mode 100644 mozilla/js/tamarin/core/ScriptObject.h create mode 100644 mozilla/js/tamarin/core/SortedIntMap.h create mode 100644 mozilla/js/tamarin/core/StackTrace.cpp create mode 100644 mozilla/js/tamarin/core/StackTrace.h create mode 100644 mozilla/js/tamarin/core/StaticProfiler.cpp create mode 100644 mozilla/js/tamarin/core/StaticProfiler.h create mode 100644 mozilla/js/tamarin/core/String.as create mode 100644 mozilla/js/tamarin/core/StringBuffer.cpp create mode 100644 mozilla/js/tamarin/core/StringBuffer.h create mode 100644 mozilla/js/tamarin/core/StringClass.cpp create mode 100644 mozilla/js/tamarin/core/StringClass.h create mode 100644 mozilla/js/tamarin/core/StringObject.cpp create mode 100644 mozilla/js/tamarin/core/StringObject.h create mode 100644 mozilla/js/tamarin/core/Toplevel.cpp create mode 100644 mozilla/js/tamarin/core/Toplevel.h create mode 100644 mozilla/js/tamarin/core/Traits.cpp create mode 100644 mozilla/js/tamarin/core/Traits.h create mode 100644 mozilla/js/tamarin/core/TraitsIterator.h create mode 100644 mozilla/js/tamarin/core/UnicodeUtils.cpp create mode 100644 mozilla/js/tamarin/core/UnicodeUtils.h create mode 100644 mozilla/js/tamarin/core/VTable.cpp create mode 100644 mozilla/js/tamarin/core/VTable.h create mode 100644 mozilla/js/tamarin/core/Verifier.cpp create mode 100644 mozilla/js/tamarin/core/Verifier.h create mode 100644 mozilla/js/tamarin/core/XML.as create mode 100644 mozilla/js/tamarin/core/XMLClass.cpp create mode 100644 mozilla/js/tamarin/core/XMLClass.h create mode 100644 mozilla/js/tamarin/core/XMLListClass.cpp create mode 100644 mozilla/js/tamarin/core/XMLListClass.h create mode 100644 mozilla/js/tamarin/core/XMLListObject.cpp create mode 100644 mozilla/js/tamarin/core/XMLListObject.h create mode 100644 mozilla/js/tamarin/core/XMLObject.cpp create mode 100644 mozilla/js/tamarin/core/XMLObject.h create mode 100644 mozilla/js/tamarin/core/XMLParser16.cpp create mode 100644 mozilla/js/tamarin/core/XMLParser16.h create mode 100644 mozilla/js/tamarin/core/abcFormat.txt create mode 100644 mozilla/js/tamarin/core/abcFormat470.txt create mode 100644 mozilla/js/tamarin/core/actionscript.lang.as create mode 100644 mozilla/js/tamarin/core/avmbuild.h create mode 100644 mozilla/js/tamarin/core/avmplus.cpp create mode 100644 mozilla/js/tamarin/core/avmplus.h create mode 100644 mozilla/js/tamarin/core/avmplusDebugger.cpp create mode 100644 mozilla/js/tamarin/core/avmplusDebugger.h create mode 100644 mozilla/js/tamarin/core/avmplusHashtable.cpp create mode 100644 mozilla/js/tamarin/core/avmplusHashtable.h create mode 100644 mozilla/js/tamarin/core/avmplusList.h create mode 100644 mozilla/js/tamarin/core/avmplusProfiler.cpp create mode 100644 mozilla/js/tamarin/core/avmplusProfiler.h create mode 100644 mozilla/js/tamarin/core/avmplusStack.h create mode 100644 mozilla/js/tamarin/core/avmplusTypes.h create mode 100644 mozilla/js/tamarin/core/avmplusVersion.h create mode 100644 mozilla/js/tamarin/core/avmsetjmp.h create mode 100644 mozilla/js/tamarin/core/builtin.as create mode 100644 mozilla/js/tamarin/core/builtin.cpp create mode 100644 mozilla/js/tamarin/core/builtin.h create mode 100644 mozilla/js/tamarin/core/opcodes.cpp create mode 100644 mozilla/js/tamarin/core/opcodes.h create mode 100644 mozilla/js/tamarin/core/opcodes.tbl create mode 100644 mozilla/js/tamarin/esc/debugger.as create mode 100644 mozilla/js/tamarin/esc/definer.as create mode 100644 mozilla/js/tamarin/esc/emitter.as create mode 100644 mozilla/js/tamarin/esc/es4.as create mode 100644 mozilla/js/tamarin/esc/es4_help.txt create mode 100644 mozilla/js/tamarin/esc/es4_start.txt create mode 100644 mozilla/js/tamarin/esc/evaluator.as create mode 100644 mozilla/js/tamarin/esc/interpreter.as create mode 100644 mozilla/js/tamarin/esc/parser.as create mode 100644 mozilla/js/tamarin/esc/readme.txt create mode 100644 mozilla/js/tamarin/extensions/Dictionary.as create mode 100644 mozilla/js/tamarin/extensions/DictionaryGlue.cpp create mode 100644 mozilla/js/tamarin/extensions/DictionaryGlue.h create mode 100644 mozilla/js/tamarin/extensions/JavaGlue.cpp create mode 100644 mozilla/js/tamarin/extensions/JavaGlue.h create mode 100644 mozilla/js/tamarin/localization/lang/de/ErrorConstants.xml create mode 100644 mozilla/js/tamarin/localization/lang/de/build.xml create mode 100644 mozilla/js/tamarin/localization/lang/es/ErrorConstants.xml create mode 100644 mozilla/js/tamarin/localization/lang/es/build.xml create mode 100644 mozilla/js/tamarin/localization/lang/fr/ErrorConstants.xml create mode 100644 mozilla/js/tamarin/localization/lang/fr/build.xml create mode 100644 mozilla/js/tamarin/localization/lang/it/ErrorConstants.xml create mode 100644 mozilla/js/tamarin/localization/lang/it/build.xml create mode 100644 mozilla/js/tamarin/localization/lang/ja/ErrorConstants.xml create mode 100644 mozilla/js/tamarin/localization/lang/ja/build.xml create mode 100644 mozilla/js/tamarin/localization/lang/ko/ErrorConstants.xml create mode 100644 mozilla/js/tamarin/localization/lang/ko/build.xml create mode 100644 mozilla/js/tamarin/localization/lang/populate create mode 100644 mozilla/js/tamarin/localization/lang/zh_CN/ErrorConstants.xml create mode 100644 mozilla/js/tamarin/localization/lang/zh_CN/build.xml create mode 100644 mozilla/js/tamarin/localization/lang/zh_TW/ErrorConstants.xml create mode 100644 mozilla/js/tamarin/localization/lang/zh_TW/build.xml create mode 100644 mozilla/js/tamarin/pcre/AUTHORS create mode 100644 mozilla/js/tamarin/pcre/COPYING create mode 100644 mozilla/js/tamarin/pcre/ChangeLog create mode 100644 mozilla/js/tamarin/pcre/INSTALL create mode 100644 mozilla/js/tamarin/pcre/LICENCE create mode 100644 mozilla/js/tamarin/pcre/Makefile.in create mode 100644 mozilla/js/tamarin/pcre/NEWS create mode 100644 mozilla/js/tamarin/pcre/NON-UNIX-USE create mode 100644 mozilla/js/tamarin/pcre/README create mode 100644 mozilla/js/tamarin/pcre/RunGrepTest.in create mode 100644 mozilla/js/tamarin/pcre/RunTest.in create mode 100644 mozilla/js/tamarin/pcre/config.guess create mode 100644 mozilla/js/tamarin/pcre/config.h create mode 100644 mozilla/js/tamarin/pcre/config.h.in create mode 100644 mozilla/js/tamarin/pcre/config.sub create mode 100644 mozilla/js/tamarin/pcre/configure create mode 100644 mozilla/js/tamarin/pcre/configure.in create mode 100644 mozilla/js/tamarin/pcre/dftables.cpp create mode 100644 mozilla/js/tamarin/pcre/doc/Tech.Notes create mode 100644 mozilla/js/tamarin/pcre/doc/html/index.html create mode 100644 mozilla/js/tamarin/pcre/doc/html/pcre.html create mode 100644 mozilla/js/tamarin/pcre/doc/html/pcre_compile.html create mode 100644 mozilla/js/tamarin/pcre/doc/html/pcre_compile2.html create mode 100644 mozilla/js/tamarin/pcre/doc/html/pcre_config.html create mode 100644 mozilla/js/tamarin/pcre/doc/html/pcre_copy_named_substring.html create mode 100644 mozilla/js/tamarin/pcre/doc/html/pcre_copy_substring.html create mode 100644 mozilla/js/tamarin/pcre/doc/html/pcre_dfa_exec.html create mode 100644 mozilla/js/tamarin/pcre/doc/html/pcre_exec.html create mode 100644 mozilla/js/tamarin/pcre/doc/html/pcre_free_substring.html create mode 100644 mozilla/js/tamarin/pcre/doc/html/pcre_free_substring_list.html create mode 100644 mozilla/js/tamarin/pcre/doc/html/pcre_fullinfo.html create mode 100644 mozilla/js/tamarin/pcre/doc/html/pcre_get_named_substring.html create mode 100644 mozilla/js/tamarin/pcre/doc/html/pcre_get_stringnumber.html create mode 100644 mozilla/js/tamarin/pcre/doc/html/pcre_get_substring.html create mode 100644 mozilla/js/tamarin/pcre/doc/html/pcre_get_substring_list.html create mode 100644 mozilla/js/tamarin/pcre/doc/html/pcre_info.html create mode 100644 mozilla/js/tamarin/pcre/doc/html/pcre_maketables.html create mode 100644 mozilla/js/tamarin/pcre/doc/html/pcre_refcount.html create mode 100644 mozilla/js/tamarin/pcre/doc/html/pcre_study.html create mode 100644 mozilla/js/tamarin/pcre/doc/html/pcre_version.html create mode 100644 mozilla/js/tamarin/pcre/doc/html/pcreapi.html create mode 100644 mozilla/js/tamarin/pcre/doc/html/pcrebuild.html create mode 100644 mozilla/js/tamarin/pcre/doc/html/pcrecallout.html create mode 100644 mozilla/js/tamarin/pcre/doc/html/pcrecompat.html create mode 100644 mozilla/js/tamarin/pcre/doc/html/pcrecpp.html create mode 100644 mozilla/js/tamarin/pcre/doc/html/pcregrep.html create mode 100644 mozilla/js/tamarin/pcre/doc/html/pcrematching.html create mode 100644 mozilla/js/tamarin/pcre/doc/html/pcrepartial.html create mode 100644 mozilla/js/tamarin/pcre/doc/html/pcrepattern.html create mode 100644 mozilla/js/tamarin/pcre/doc/html/pcreperform.html create mode 100644 mozilla/js/tamarin/pcre/doc/html/pcreposix.html create mode 100644 mozilla/js/tamarin/pcre/doc/html/pcreprecompile.html create mode 100644 mozilla/js/tamarin/pcre/doc/html/pcresample.html create mode 100644 mozilla/js/tamarin/pcre/doc/html/pcretest.html create mode 100644 mozilla/js/tamarin/pcre/doc/pcre.3 create mode 100644 mozilla/js/tamarin/pcre/doc/pcre.txt create mode 100644 mozilla/js/tamarin/pcre/doc/pcre_compile.3 create mode 100644 mozilla/js/tamarin/pcre/doc/pcre_compile2.3 create mode 100644 mozilla/js/tamarin/pcre/doc/pcre_config.3 create mode 100644 mozilla/js/tamarin/pcre/doc/pcre_copy_named_substring.3 create mode 100644 mozilla/js/tamarin/pcre/doc/pcre_copy_substring.3 create mode 100644 mozilla/js/tamarin/pcre/doc/pcre_dfa_exec.3 create mode 100644 mozilla/js/tamarin/pcre/doc/pcre_exec.3 create mode 100644 mozilla/js/tamarin/pcre/doc/pcre_free_substring.3 create mode 100644 mozilla/js/tamarin/pcre/doc/pcre_free_substring_list.3 create mode 100644 mozilla/js/tamarin/pcre/doc/pcre_fullinfo.3 create mode 100644 mozilla/js/tamarin/pcre/doc/pcre_get_named_substring.3 create mode 100644 mozilla/js/tamarin/pcre/doc/pcre_get_stringnumber.3 create mode 100644 mozilla/js/tamarin/pcre/doc/pcre_get_substring.3 create mode 100644 mozilla/js/tamarin/pcre/doc/pcre_get_substring_list.3 create mode 100644 mozilla/js/tamarin/pcre/doc/pcre_info.3 create mode 100644 mozilla/js/tamarin/pcre/doc/pcre_maketables.3 create mode 100644 mozilla/js/tamarin/pcre/doc/pcre_refcount.3 create mode 100644 mozilla/js/tamarin/pcre/doc/pcre_study.3 create mode 100644 mozilla/js/tamarin/pcre/doc/pcre_version.3 create mode 100644 mozilla/js/tamarin/pcre/doc/pcreapi.3 create mode 100644 mozilla/js/tamarin/pcre/doc/pcrebuild.3 create mode 100644 mozilla/js/tamarin/pcre/doc/pcrecallout.3 create mode 100644 mozilla/js/tamarin/pcre/doc/pcrecompat.3 create mode 100644 mozilla/js/tamarin/pcre/doc/pcrecpp.3 create mode 100644 mozilla/js/tamarin/pcre/doc/pcregrep.txt create mode 100644 mozilla/js/tamarin/pcre/doc/pcrematching.3 create mode 100644 mozilla/js/tamarin/pcre/doc/pcrepartial.3 create mode 100644 mozilla/js/tamarin/pcre/doc/pcrepattern.3 create mode 100644 mozilla/js/tamarin/pcre/doc/pcreperform.3 create mode 100644 mozilla/js/tamarin/pcre/doc/pcreposix.3 create mode 100644 mozilla/js/tamarin/pcre/doc/pcreprecompile.3 create mode 100644 mozilla/js/tamarin/pcre/doc/pcresample.3 create mode 100644 mozilla/js/tamarin/pcre/doc/pcretest.txt create mode 100644 mozilla/js/tamarin/pcre/doc/perltest.txt create mode 100644 mozilla/js/tamarin/pcre/install-sh create mode 100644 mozilla/js/tamarin/pcre/libpcre.def create mode 100644 mozilla/js/tamarin/pcre/libpcre.pc.in create mode 100644 mozilla/js/tamarin/pcre/libpcreposix.def create mode 100644 mozilla/js/tamarin/pcre/ltmain.sh create mode 100644 mozilla/js/tamarin/pcre/makevp.txt create mode 100644 mozilla/js/tamarin/pcre/mkinstalldirs create mode 100644 mozilla/js/tamarin/pcre/pcre-config.in create mode 100644 mozilla/js/tamarin/pcre/pcre.def create mode 100644 mozilla/js/tamarin/pcre/pcre.h create mode 100644 mozilla/js/tamarin/pcre/pcre.h.in create mode 100644 mozilla/js/tamarin/pcre/pcre_chartables.cpp create mode 100644 mozilla/js/tamarin/pcre/pcre_compile.cpp create mode 100644 mozilla/js/tamarin/pcre/pcre_config.cpp create mode 100644 mozilla/js/tamarin/pcre/pcre_dfa_exec.cpp create mode 100644 mozilla/js/tamarin/pcre/pcre_exec.cpp create mode 100644 mozilla/js/tamarin/pcre/pcre_fullinfo.cpp create mode 100644 mozilla/js/tamarin/pcre/pcre_get.cpp create mode 100644 mozilla/js/tamarin/pcre/pcre_globals.cpp create mode 100644 mozilla/js/tamarin/pcre/pcre_info.cpp create mode 100644 mozilla/js/tamarin/pcre/pcre_internal.h create mode 100644 mozilla/js/tamarin/pcre/pcre_maketables.cpp create mode 100644 mozilla/js/tamarin/pcre/pcre_ord2utf8.cpp create mode 100644 mozilla/js/tamarin/pcre/pcre_printint.src create mode 100644 mozilla/js/tamarin/pcre/pcre_refcount.cpp create mode 100644 mozilla/js/tamarin/pcre/pcre_scanner.cc create mode 100644 mozilla/js/tamarin/pcre/pcre_scanner.h create mode 100644 mozilla/js/tamarin/pcre/pcre_scanner_unittest.cc create mode 100644 mozilla/js/tamarin/pcre/pcre_stringpiece.cc create mode 100644 mozilla/js/tamarin/pcre/pcre_stringpiece.h.in create mode 100644 mozilla/js/tamarin/pcre/pcre_stringpiece_unittest.cc create mode 100644 mozilla/js/tamarin/pcre/pcre_study.cpp create mode 100644 mozilla/js/tamarin/pcre/pcre_tables.cpp create mode 100644 mozilla/js/tamarin/pcre/pcre_try_flipped.cpp create mode 100644 mozilla/js/tamarin/pcre/pcre_ucp_findchar.cpp create mode 100644 mozilla/js/tamarin/pcre/pcre_valid_utf8.cpp create mode 100644 mozilla/js/tamarin/pcre/pcre_version.cpp create mode 100644 mozilla/js/tamarin/pcre/pcre_xclass.cpp create mode 100644 mozilla/js/tamarin/pcre/pcrecpp.cc create mode 100644 mozilla/js/tamarin/pcre/pcrecpp.h.in create mode 100644 mozilla/js/tamarin/pcre/pcrecpp_unittest.cc create mode 100644 mozilla/js/tamarin/pcre/pcredemo.cpp create mode 100644 mozilla/js/tamarin/pcre/pcregrep.cpp create mode 100644 mozilla/js/tamarin/pcre/pcreposix.cpp create mode 100644 mozilla/js/tamarin/pcre/pcreposix.h create mode 100644 mozilla/js/tamarin/pcre/pcretest.cpp create mode 100644 mozilla/js/tamarin/pcre/perltest create mode 100644 mozilla/js/tamarin/pcre/testdata/grepinput create mode 100644 mozilla/js/tamarin/pcre/testdata/grepinputx create mode 100644 mozilla/js/tamarin/pcre/testdata/greplist create mode 100644 mozilla/js/tamarin/pcre/testdata/grepoutput create mode 100644 mozilla/js/tamarin/pcre/testdata/testinput1 create mode 100644 mozilla/js/tamarin/pcre/testdata/testinput2 create mode 100644 mozilla/js/tamarin/pcre/testdata/testinput3 create mode 100644 mozilla/js/tamarin/pcre/testdata/testinput4 create mode 100644 mozilla/js/tamarin/pcre/testdata/testinput5 create mode 100644 mozilla/js/tamarin/pcre/testdata/testinput6 create mode 100644 mozilla/js/tamarin/pcre/testdata/testinput7 create mode 100644 mozilla/js/tamarin/pcre/testdata/testinput8 create mode 100644 mozilla/js/tamarin/pcre/testdata/testinput9 create mode 100644 mozilla/js/tamarin/pcre/testdata/testoutput1 create mode 100644 mozilla/js/tamarin/pcre/testdata/testoutput2 create mode 100644 mozilla/js/tamarin/pcre/testdata/testoutput3 create mode 100644 mozilla/js/tamarin/pcre/testdata/testoutput4 create mode 100644 mozilla/js/tamarin/pcre/testdata/testoutput5 create mode 100644 mozilla/js/tamarin/pcre/testdata/testoutput6 create mode 100644 mozilla/js/tamarin/pcre/testdata/testoutput7 create mode 100644 mozilla/js/tamarin/pcre/testdata/testoutput8 create mode 100644 mozilla/js/tamarin/pcre/testdata/testoutput9 create mode 100644 mozilla/js/tamarin/pcre/ucp.h create mode 100644 mozilla/js/tamarin/pcre/ucpinternal.h create mode 100644 mozilla/js/tamarin/pcre/ucptable.cpp create mode 100644 mozilla/js/tamarin/platform/arm/DateUnix.cpp create mode 100644 mozilla/js/tamarin/platform/arm/Makefile create mode 100644 mozilla/js/tamarin/platform/arm/MathUtilsUnix.cpp create mode 100644 mozilla/js/tamarin/platform/arm/OSDepUnix.cpp create mode 100644 mozilla/js/tamarin/platform/mac/AvmDebugMac.cpp create mode 100644 mozilla/js/tamarin/platform/mac/DateMac.cpp create mode 100644 mozilla/js/tamarin/platform/mac/DateMac.h create mode 100644 mozilla/js/tamarin/platform/mac/MMgc/MMgc.xcodeproj/project.pbxproj create mode 100644 mozilla/js/tamarin/platform/mac/Makefile create mode 100644 mozilla/js/tamarin/platform/mac/Makefile.2 create mode 100644 mozilla/js/tamarin/platform/mac/MathUtilsMac.cpp create mode 100644 mozilla/js/tamarin/platform/mac/NativeFunctionMac.cpp create mode 100644 mozilla/js/tamarin/platform/mac/OSDepMac.cpp create mode 100644 mozilla/js/tamarin/platform/mac/avmplus.mcp create mode 100644 mozilla/js/tamarin/platform/mac/avmplus.mcp.xml create mode 100644 mozilla/js/tamarin/platform/mac/avmplus/avmplus.xcodeproj/project.pbxproj create mode 100644 mozilla/js/tamarin/platform/mac/carb.r create mode 100644 mozilla/js/tamarin/platform/mac/macho_debug.pch++ create mode 100644 mozilla/js/tamarin/platform/mac/macho_debuggerdebug.pch++ create mode 100644 mozilla/js/tamarin/platform/mac/macho_debuggerrelease.pch++ create mode 100644 mozilla/js/tamarin/platform/mac/macho_release.pch++ create mode 100644 mozilla/js/tamarin/platform/mac/macprefix_debug.pch++ create mode 100644 mozilla/js/tamarin/platform/mac/macprefix_debuggerdebug.pch++ create mode 100644 mozilla/js/tamarin/platform/mac/macprefix_debuggerrel.pch++ create mode 100644 mozilla/js/tamarin/platform/mac/macprefix_release.pch++ create mode 100644 mozilla/js/tamarin/platform/mac/shell.mcp create mode 100644 mozilla/js/tamarin/platform/mac/shell/shell.xcodeproj/project.pbxproj create mode 100644 mozilla/js/tamarin/platform/mac/shellCarbon.mcp create mode 100644 mozilla/js/tamarin/platform/unix/DateUnix.cpp create mode 100644 mozilla/js/tamarin/platform/unix/Makefile create mode 100644 mozilla/js/tamarin/platform/unix/MathUtilsUnix.cpp create mode 100644 mozilla/js/tamarin/platform/unix/OSDepUnix.cpp create mode 100644 mozilla/js/tamarin/platform/unix/makecommon create mode 100644 mozilla/js/tamarin/platform/win32/DateWin.cpp create mode 100644 mozilla/js/tamarin/platform/win32/MathUtilsWin.cpp create mode 100644 mozilla/js/tamarin/platform/win32/NativeFunctionWin.cpp create mode 100644 mozilla/js/tamarin/platform/win32/OSDepWin.cpp create mode 100644 mozilla/js/tamarin/platform/win32/avmplus.cpp create mode 100644 mozilla/js/tamarin/platform/win32/avmplus.sln create mode 100644 mozilla/js/tamarin/platform/win32/avmplus.vcproj create mode 100644 mozilla/js/tamarin/platform/win32/avmplus_8.vcproj create mode 100644 mozilla/js/tamarin/platform/win32/coff.cpp create mode 100644 mozilla/js/tamarin/platform/win32/coff.h create mode 100644 mozilla/js/tamarin/platform/win32/shell.vcproj create mode 100644 mozilla/js/tamarin/platform/win32/win32cpuid.cpp create mode 100644 mozilla/js/tamarin/platform/win32/win32setjmp.cpp create mode 100644 mozilla/js/tamarin/shell/ByteArray.as create mode 100644 mozilla/js/tamarin/shell/ByteArrayGlue.cpp create mode 100644 mozilla/js/tamarin/shell/ByteArrayGlue.h create mode 100644 mozilla/js/tamarin/shell/ConsoleOutputStream.cpp create mode 100644 mozilla/js/tamarin/shell/ConsoleOutputStream.h create mode 100644 mozilla/js/tamarin/shell/DataIO.cpp create mode 100644 mozilla/js/tamarin/shell/DataIO.h create mode 100644 mozilla/js/tamarin/shell/DebugCLI.cpp create mode 100644 mozilla/js/tamarin/shell/DebugCLI.h create mode 100644 mozilla/js/tamarin/shell/Domain.as create mode 100644 mozilla/js/tamarin/shell/DomainClass.cpp create mode 100644 mozilla/js/tamarin/shell/DomainClass.h create mode 100644 mozilla/js/tamarin/shell/DoubleArray.as create mode 100644 mozilla/js/tamarin/shell/Endian.as create mode 100644 mozilla/js/tamarin/shell/FileClass.cpp create mode 100644 mozilla/js/tamarin/shell/FileClass.h create mode 100644 mozilla/js/tamarin/shell/FileInputStream.cpp create mode 100644 mozilla/js/tamarin/shell/FileInputStream.h create mode 100644 mozilla/js/tamarin/shell/FloatArray.as create mode 100644 mozilla/js/tamarin/shell/IntArray.as create mode 100644 mozilla/js/tamarin/shell/Java.as create mode 100644 mozilla/js/tamarin/shell/Profiler.h create mode 100644 mozilla/js/tamarin/shell/ShortArray.as create mode 100644 mozilla/js/tamarin/shell/StringBuilder.as create mode 100644 mozilla/js/tamarin/shell/StringBuilderClass.cpp create mode 100644 mozilla/js/tamarin/shell/StringBuilderClass.h create mode 100644 mozilla/js/tamarin/shell/SystemClass.cpp create mode 100644 mozilla/js/tamarin/shell/SystemClass.h create mode 100644 mozilla/js/tamarin/shell/TypedArrayClass.cpp create mode 100644 mozilla/js/tamarin/shell/TypedArrayClass.h create mode 100644 mozilla/js/tamarin/shell/UIntArray.as create mode 100644 mozilla/js/tamarin/shell/UShortArray.as create mode 100644 mozilla/js/tamarin/shell/avmshell.cpp create mode 100644 mozilla/js/tamarin/shell/avmshell.h create mode 100644 mozilla/js/tamarin/shell/genericzlib.h create mode 100644 mozilla/js/tamarin/shell/toplevel.as create mode 100644 mozilla/js/tamarin/shell/toplevel.cpp create mode 100644 mozilla/js/tamarin/shell/toplevel.h create mode 100644 mozilla/js/tamarin/test/as3/AbcDecoder/accessSpecifiers.as create mode 100644 mozilla/js/tamarin/test/as3/AbcDecoder/accessSpecifiers/varsDef.as create mode 100644 mozilla/js/tamarin/test/as3/AbcDecoder/extClass.as create mode 100644 mozilla/js/tamarin/test/as3/AbcDecoder/extClass/parentClass.as create mode 100644 mozilla/js/tamarin/test/as3/AbcDecoder/impClass.as create mode 100644 mozilla/js/tamarin/test/as3/AbcDecoder/impClass/varsDef.as create mode 100644 mozilla/js/tamarin/test/as3/AbcDecoder/impVars.as create mode 100644 mozilla/js/tamarin/test/as3/AbcDecoder/impVars/varsDef.as create mode 100644 mozilla/js/tamarin/test/as3/AbcDecoder/inheritClass.as create mode 100644 mozilla/js/tamarin/test/as3/AbcDecoder/inheritClass/varsDef.as create mode 100644 mozilla/js/tamarin/test/as3/AbcDecoder/simple.as create mode 100644 mozilla/js/tamarin/test/as3/AbcDecoder/simple/varsDef.as create mode 100644 mozilla/js/tamarin/test/as3/AbcDecoder/typeAnnotation.as create mode 100644 mozilla/js/tamarin/test/as3/AbcDecoder/typeAnnotation/varsDef.as create mode 100644 mozilla/js/tamarin/test/as3/AbcDecoder/useNS.as create mode 100644 mozilla/js/tamarin/test/as3/AbcDecoder/useNS/varsDef.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/Bug118272Package.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/Bug118272Package/BugTest.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/Bug155775.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/Bug162570.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DefaultClass/DefaultClassSame.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DefaultClassPrototype.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DefaultClassPrototype/DefaultClassPrototype.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DefaultDynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DefaultDynamicClass/DefaultDynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DynamicClass/DynamicClassSame.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DynamicClassHasOwnProperty.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DynamicClassHasOwnProperty/DynamicClassHasOwnProperty.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DynamicClassMeth.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DynamicClassMeth/DynamicClassMeth.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DynamicClassProp.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DynamicClassProp/DynamicClassProp.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DynamicClassPrototype.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DynamicClassPrototype/DynamicClassPrototype.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DynamicClassSameMethPropName.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DynamicClassSameMethPropName/DynamicClassSameMethPropName.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalClassPrototype.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalClassPrototype/FinalClassPrototype.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalDefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalDefaultClass/FinalDefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalDefaultDynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalDefaultDynamicClass/FinalDefaultDynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalInternalClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalInternalClass/FinalInternalClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalInternalDynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalInternalDynamicClass/FinalInternDynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalPublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalPublicClass/FinalPublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalPublicDynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalPublicDynamicClass/FinalPublicDynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalPublicDynamicClassMethodAndProp.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalPublicDynamicClassMethodAndProp/AccFinPubDynClassMAndP.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/IntClassWithStrParamCons.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/IntClassWithStrParamCons/IntClassWithStrParamCons.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/InternalClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/InternalClass/InternalClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/InternalClassPrototype.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/InternalClassPrototype/InternalClassPrototype.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/InternalDynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/InternalDynamicClass/InternalDynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/PrivateStaticClassMethodAndProp.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/PrivateStaticClassMethodAndProp/AccPrivStatClassMAndP.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/PublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/PublicClass/PublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/PublicClassMethodAndProp.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/PublicClassMethodAndProp/AccPubClassMAndP.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/PublicClassPrototype.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/PublicClassPrototype/PublicClassPrototype.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/PublicDynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/PublicDynamicClass/PublicDynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/PublicStaticFinalDynamicClassMethodAndProp.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/PublicStaticFinalDynamicClassMethodAndProp/AccPubStatFinDynClassMAndP.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/StatClassSameNamePackage.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/StatClassSameNamePackage/StatClassSameNamePackage.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/StaticClassMethodAndProp.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/StaticClassMethodAndProp/AccStatClassMAndP.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/bug113887.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/bug113887/bug113887.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/dynfinClassCons.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/dynfinClassCons/dynfinClassCons.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/dynfinClassDefCons.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/dynfinClassDefCons/dynfinClassDefCons.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/dynfinClassWithMultiStrParamCons.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/dynfinClassWithMultiStrParamCons/dynfinClassWithMultiStrParamCons.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/dynfinClassWithParamCons.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/dynfinClassWithParamCons/dynfinClassWithParamCons.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/dynfinClassWithStrParamCons.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/dynfinClassWithStrParamCons/dynfinClassWithStrParamCons.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/finClassNoParamCons.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/finClassNoParamCons/finClassNoParamCons.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/finalClassDefCons.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/finalClassDefCons/finalClassDefCons.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/finalClassWithParamCons.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/finalClassWithParamCons/finalClassWithParamCons.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/intClassDefCons.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/intClassDefCons/intClassDefCons.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/intClassNoParamCons.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/intClassNoParamCons/intClassNoParamCons.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/intClassWithParamCons.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/intClassWithParamCons/intClassWithParamCons.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/publicClassConsNoParam.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/publicClassConsNoParam/publicClassConsNoParam.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/publicClassDefCons.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/publicClassDefCons/publicClassDefCons.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/publicClassWithParamCons.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/publicClassWithParamCons/publicClassWithParamCons.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/testClassInitializers.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/testClassInitializers/testClassInitializers.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/testdynfinpublicClassInitializers.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/testdynfinpublicClassInitializers/testdynfinpublicClassInitializers.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/testinternalClassInitializers.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/testinternalClassInitializers/testinternalClassInitializers.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccNSStatMethSubClassMeth.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccNSStatMethSubClassMeth/AccNSStatMethSubClassMeth.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccNSStatPropSubClassMeth.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccNSStatPropSubClassMeth/AccNSStatPropSubClassMeth.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatMethIntermediateSubClassMeth.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatMethIntermediateSubClassMeth/AccStatMethIntermediateSubClassMeth.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatMethSubClassMeth.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatMethSubClassMeth/AccStatMethSubClassMeth.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatMethSubClassMethSuper.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatMethSubClassMethSuper/AccStatMethSubClassMethSuper.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatMethSubClassStatMeth.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatMethSubClassStatMeth/AccStatMethSubClassStatMeth.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatPropIntermediateSubClassMeth.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatPropIntermediateSubClassMeth/AccStatPropIntermediateSubClassMeth.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatPropSubClassInit.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatPropSubClassInit/AccStatPropSubClassInit.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatPropSubClassMeth.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatPropSubClassMeth/AccStatPropSubClassMeth.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatPropSubClassStatMeth.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatPropSubClassStatMeth/AccStatPropSubClassStatMeth.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatPropViaSubClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatPropViaSubClass/AccStatPropViaSubClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatPropViaSubClassWIntermediate.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatPropViaSubClassWIntermediate/AccStatPropViaSubClassWIntermediate.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDefaultClass/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDefaultClass/DynExtDefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDefaultClassFin.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDefaultClassFin/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDefaultClassFin/DynExtDefaultClassFin.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDefaultClassPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDefaultClassPub/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDefaultClassPub/DynExtDefaultClassPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDefaultClassPubStat.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDefaultClassPubStat/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDefaultClassPubStat/DynExtDefaultClassPubStat.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDefaultClassStat.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDefaultClassStat/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDefaultClassStat/DynExtDefaultClassStat.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDynamicClass/ADynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDynamicClass/DynExtDynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDynamicClassFin.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDynamicClassFin/ADynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDynamicClassFin/DynExtDynamicClassFin.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDynamicClassPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDynamicClassPub/ADynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDynamicClassPub/DynExtDynamicClassPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDynamicClassPubStat.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDynamicClassPubStat/ADynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDynamicClassPubStat/DynExtDynamicClassPubStat.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDynamicClassStat.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDynamicClassStat/ADynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDynamicClassStat/DynExtDynamicClassStat.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtInternalClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtInternalClass/AInternalClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtInternalClass/DynExtInternalClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtPublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtPublicClass/APublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtPublicClass/DynExtPublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtPublicClassFin.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtPublicClassFin/APublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtPublicClassFin/DynExtPublicClassFin.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtPublicClassPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtPublicClassPub/APublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtPublicClassPub/DynExtPublicClassPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtPublicClassPubStat.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtPublicClassPubStat/APublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtPublicClassPubStat/DynExtPublicClassPubStat.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtPublicClassStat.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtPublicClassStat/APublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtPublicClassStat/DynExtPublicClassStat.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDefaultClass/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDefaultClass/ExtDefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDefaultClassPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDefaultClassPub/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDefaultClassPub/ExtDefaultClassPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDefaultClassPubStat.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDefaultClassPubStat/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDefaultClassPubStat/ExtDefaultClassPubStat.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDefaultClassStat.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDefaultClassStat/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDefaultClassStat/ExtDefaultClassStat.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDefaultProtClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDefaultProtClass/DefaultProtClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDefaultProtClass/ExtDefaultProtClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDynamicClass/DynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDynamicClass/ExtDynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDynamicClassPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDynamicClassPub/DynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDynamicClassPub/ExtDynamicClassPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDynamicClassPubStat.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDynamicClassPubStat/DynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDynamicClassPubStat/ExtDynamicClassPubStat.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDynamicClassStat.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDynamicClassStat/DynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDynamicClassStat/ExtDynamicClassStat.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtError.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtError/CustError.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtError/CustError2.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtError/CustEvalError.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtError/CustEvalError2.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtError/CustRangeError.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtError/CustRangeError2.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtError/CustReferenceError.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtError/CustReferenceError2.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtError/CustTypeError.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtError/CustTypeError2.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtInternalClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtInternalClass/AInternalClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtInternalClass/ExtInternalClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtPublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtPublicClass/ExtPublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtPublicClassFin.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtPublicClassFin/APublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtPublicClassFin/ExtPublicClassFin.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtPublicClassPriv.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtPublicClassPriv/APublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtPublicClassPriv/ExtPublicClassPriv.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtPublicClassPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtPublicClassPub/APublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtPublicClassPub/ExtPublicClassPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtPublicClassStat.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtPublicClassStat/APublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtPublicClassStat/ExtPublicClassStat.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDefaultClass/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDefaultClass/FinExtDefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDefaultClassFin.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDefaultClassFin/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDefaultClassFin/FinExtDefaultClassFin.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDefaultClassPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDefaultClassPub/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDefaultClassPub/FinExtDefaultClassPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDefaultClassPubStat.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDefaultClassPubStat/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDefaultClassPubStat/FinExtDefaultClassPubStat.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDefaultClassStat.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDefaultClassStat/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDefaultClassStat/FinExtDefaultClassStat.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDynamicClass/DynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDynamicClass/FinExtDynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDynamicClassFin.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDynamicClassFin/DynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDynamicClassFin/FinExtDynamicClassFin.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDynamicClassPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDynamicClassPub/DynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDynamicClassPub/FinExtDynamicClassPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDynamicClassPubStat.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDynamicClassPubStat/DynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDynamicClassPubStat/FinExtDynamicClassPubStat.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDynamicClassStat.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDynamicClassStat/DynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDynamicClassStat/FinExtDynamicClassStat.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtInternalClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtInternalClass/AInternalClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtInternalClass/FinExtInternalClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtPublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtPublicClass/APublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtPublicClass/FinExtPublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtPublicClassFin.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtPublicClassFin/APublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtPublicClassFin/FinExtPublicClassFin.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtPublicClassPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtPublicClassPub/APublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtPublicClassPub/FinExtPublicClassPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtPublicClassPubStat.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtPublicClassPubStat/APublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtPublicClassPubStat/FinExtPublicClassPubStat.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtPublicClassStat.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtPublicClassStat/APublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtPublicClassStat/FinExtPublicClassStat.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/IntExtDefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/IntExtDefaultClass/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/IntExtDefaultClass/IntExtDefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/IntExtDynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/IntExtDynamicClass/DynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/IntExtDynamicClass/IntExtDynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/IntExtInternalClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/IntExtInternalClass/IntExtInternalClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/IntExtPublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/IntExtPublicClass/IntExtPublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDefaultClass/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDefaultClass/PubExtDefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDefaultClassFin.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDefaultClassFin/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDefaultClassFin/PubExtDefaultClassFin.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDefaultClassPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDefaultClassPub/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDefaultClassPub/PubExtDefaultClassPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDefaultClassPubStat.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDefaultClassPubStat/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDefaultClassPubStat/PubExtDefaultClassPubStat.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDefaultClassStat.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDefaultClassStat/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDefaultClassStat/PubExtDefaultClassStat.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDynamicClass/DynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDynamicClass/PubExtDynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDynamicClassFin.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDynamicClassFin/DynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDynamicClassFin/PubExtDynamicClassFin.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDynamicClassPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDynamicClassPub/DynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDynamicClassPub/PubExtDynamicClassPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDynamicClassPubStat.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDynamicClassPubStat/DynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDynamicClassPubStat/PubExtDynamicClassPubStat.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDynamicClassStat.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDynamicClassStat/DynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDynamicClassStat/PubExtDynamicClassStat.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtInternalClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtInternalClass/InternalClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtInternalClass/PubExtInternalClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtPublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtPublicClass/APublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtPublicClass/PubExtPublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtPublicClassFin.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtPublicClassFin/APublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtPublicClassFin/PubExtPublicClassFin.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtPublicClassStat.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtPublicClassStat/APublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtPublicClassStat/PubExtPublicClassStat.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubFinExtDefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubFinExtDefaultClass/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubFinExtDefaultClass/PubFinExtDefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtDefClassImpDefInt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtDefClassImpDefInt/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtDefClassImpDefInt/DefaultInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtDefClassImpDefInt/DefaultsubClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtDefClassImpIntInt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtDefClassImpIntInt/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtDefClassImpIntInt/DefaultsubClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtDefClassImpIntInt/InternalInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtDefClassImpPubInt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtDefClassImpPubInt/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtDefClassImpPubInt/DefaultsubClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtDefClassImpPubInt/PublicInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtIntClassImpIntInt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtIntClassImpIntInt/DefsubExtIntClassImpIntInt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtPubClassImpIntInt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtPubClassImpIntInt/DefaultsubClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtPubClassImpIntInt/InternalInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtPubClassImpIntInt/PublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDefaultImplDefDefPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDefaultImplDefDefPub/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDefaultImplDefDefPub/DefaultInt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDefaultImplDefDefPub/DefaultIntDef.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDefaultImplDefDefPub/DynExtDefaultImplDefDefPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDefaultImplDefPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDefaultImplDefPub/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDefaultImplDefPub/DefaultIntDef.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDefaultImplDefPub/DynExtDefaultImplDefPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDefaultImplDefPubStat.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDefaultImplDefPubStat/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDefaultImplDefPubStat/DefaultIntDef.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDefaultImplDefPubStat/DynExtDefaultImplDefPubStat.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDynamicImplDefDef.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDynamicImplDefDef/ADynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDynamicImplDefDef/DefaultInt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDynamicImplDefDef/DefaultIntDef.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDynamicImplDefDef/DynExtDynamicImplDefDef.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDynamicImplDefDefPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDynamicImplDefDefPub/ADynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDynamicImplDefDefPub/DefaultInt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDynamicImplDefDefPub/DefaultIntDef.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDynamicImplDefDefPub/DynExtDynamicImplDefDefPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDynamicImplDefPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDynamicImplDefPub/ADynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDynamicImplDefPub/DefaultIntDef.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDynamicImplDefPub/DynExtDynamicImplDefPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynFinPubClassExtDynIntClassImpIntIntExtPubPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynFinPubClassExtDynIntClassImpIntIntExtPubPub/PublicSubClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynFinPubClassExtIntClassImpIntIntExtPubPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynFinPubClassExtIntClassImpIntIntExtPubPub/PublicSubClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefImplDefDefPrivStatErr1.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefImplDefDefPubStatErr1.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefaultImplDefDef.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefaultImplDefDef/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefaultImplDefDef/DefaultInt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefaultImplDefDef/DefaultIntDef.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefaultImplDefDef/ExtDefaultImplDefDef.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefaultImplDefDefPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefaultImplDefDefPub/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefaultImplDefDefPub/DefaultInt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefaultImplDefDefPub/DefaultIntDef.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefaultImplDefDefPub/ExtDefaultImplDefDefPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefaultImplDefPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefaultImplDefPub/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefaultImplDefPub/DefaultIntDef.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefaultImplDefPub/ExtDefaultImplDefPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDynamicImplDefDefPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDynamicImplDefDefPub/DefaultInt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDynamicImplDefDefPub/DefaultIntDef.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDynamicImplDefDefPub/DynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDynamicImplDefDefPub/ExtDynamicImplDefDefPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDynamicImplDefDefStat.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDynamicImplDefDefStat/DefaultInt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDynamicImplDefDefStat/DefaultIntDef.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDynamicImplDefDefStat/DynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDynamicImplDefDefStat/ExtDynamicImplDefDefStat.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDynamicImplDefPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDynamicImplDefPub/DefaultIntDef.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDynamicImplDefPub/DynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDynamicImplDefPub/ExtDynamicImplDefPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDefaultImplDefDefPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDefaultImplDefDefPub/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDefaultImplDefDefPub/DefaultInt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDefaultImplDefDefPub/DefaultIntDef.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDefaultImplDefDefPub/FinExtDefaultImplDefDefPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDefaultImplDefPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDefaultImplDefPub/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDefaultImplDefPub/DefaultIntDef.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDefaultImplDefPub/FinExtDefaultImplDefPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDefaultImplDefStat.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDefaultImplDefStat/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDefaultImplDefStat/DefaultIntDef.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDefaultImplDefStat/FinExtDefaultImplDefStat.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDynamicImplDefDefPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDynamicImplDefDefPub/DefaultInt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDynamicImplDefDefPub/DefaultIntDef.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDynamicImplDefDefPub/DynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDynamicImplDefDefPub/FinExtDynamicImplDefDefPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDynamicImplDefPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDynamicImplDefPub/DefaultIntDef.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDynamicImplDefPub/DynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDynamicImplDefPub/FinExtDynamicImplDefPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDynamicImplDefPubStat.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDynamicImplDefPubStat/DefaultInt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDynamicImplDefPubStat/DefaultIntDef.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDynamicImplDefPubStat/DynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDynamicImplDefPubStat/FinExtDynamicImplDefPubStat.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtPublicImplDef.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtPublicImplDef/APublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtPublicImplDef/DefaultIntDef.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtPublicImplDef/FinExtPublicImplDef.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtPublicImplDefDefPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtPublicImplDefDefPub/APublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtPublicImplDefDefPub/DefaultInt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtPublicImplDefDefPub/DefaultIntDef.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtPublicImplDefDefPub/FinExtPublicImplDefDefPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtPublicImplDefPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtPublicImplDefPub/APublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtPublicImplDefPub/DefaultIntDef.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtPublicImplDefPub/FinExtPublicImplDefPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/IntClassExtIntClassImpIntIntExtIntPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/IntClassExtIntClassImpIntIntExtIntPub/InternalSubClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/IntClassExtPubClassImpPubIntExtPubPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/IntClassExtPubClassImpPubIntExtPubPub/InternalSubClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/IntsubExtIntClassImpDefInt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/IntsubExtIntClassImpDefInt/DefaultInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/IntsubExtIntClassImpDefInt/InternalClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/IntsubExtIntClassImpDefInt/InternalsubClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/IntsubExtIntClassImpIntInt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/IntsubExtIntClassImpIntInt/IntsubExtIntClassImpIntInt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/IntsubExtIntClassImpPubInt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/IntsubExtIntClassImpPubInt/IntsubExtIntClassImpPubInt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtIntClassImpIntIntExtIntPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtIntClassImpIntIntExtIntPub/PublicSubClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtIntClassImpIntIntExtPubPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtIntClassImpIntIntExtPubPub/PublicSubClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtIntClassImpPubIntExtPubPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtIntClassImpPubIntExtPubPub/PublicSubClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtPubClassImpIntIntExtIntPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtPubClassImpIntIntExtIntPub/PublicSubClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtPubClassImpIntIntExtPubPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtPubClassImpIntIntExtPubPub/PublicSubClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtPubClassImpPubIntExtIntPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtPubClassImpPubIntExtIntPub/PublicSubClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtPubClassImpPubIntExtPubPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtPubClassImpPubIntExtPubPub/PublicSuperClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtPubClassImpPubIntExtPubPub2.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtPubClassImpPubIntExtPubPub2/PublicSubClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDefaultImplDefDefPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDefaultImplDefDefPub/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDefaultImplDefDefPub/DefaultInt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDefaultImplDefDefPub/DefaultIntDef.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDefaultImplDefDefPub/PubExtDefaultImplDefDefPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDefaultImplDefDefPubStat.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDefaultImplDefDefPubStat/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDefaultImplDefDefPubStat/DefaultInt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDefaultImplDefDefPubStat/DefaultIntDef.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDefaultImplDefDefPubStat/PubExtDefaultImplDefDefPubStat.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDefaultImplDefPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDefaultImplDefPub/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDefaultImplDefPub/DefaultIntDef.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDefaultImplDefPub/PubExtDefaultImplDefPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDynamicImplDefDefPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDynamicImplDefDefPub/DefaultInt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDynamicImplDefDefPub/DefaultIntDef.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDynamicImplDefDefPub/DynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDynamicImplDefDefPub/PubExtDynamicImplDefDefPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDynamicImplDefPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDynamicImplDefPub/DefaultIntDef.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDynamicImplDefPub/DynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDynamicImplDefPub/PubExtDynamicImplDefPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDynamicImplDefStat.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDynamicImplDefStat/DefaultInt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDynamicImplDefStat/DefaultIntDef.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDynamicImplDefStat/DynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDynamicImplDefStat/PubExtDynamicImplDefStat.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtPublicImplDefDef.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtPublicImplDefDef/APublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtPublicImplDefDef/DefaultInt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtPublicImplDefDef/DefaultIntDef.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtPublicImplDefDef/PubExtPublicImplDefDef.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtPublicImplDefDefPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtPublicImplDefDefPub/APublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtPublicImplDefDefPub/DefaultInt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtPublicImplDefDefPub/DefaultIntDef.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtPublicImplDefDefPub/PubExtPublicImplDefDefPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtPublicImplDefPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtPublicImplDefPub/APublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtPublicImplDefPub/DefaultIntDef.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtPublicImplDefPub/PubExtPublicImplDefPub.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtIntClassImpDefaultInt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtIntClassImpDefaultInt/DefaultInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtIntClassImpDefaultInt/InternalClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtIntClassImpDefaultInt/PublicsubClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtPubClassImpDefInt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtPubClassImpDefInt/DefaultInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtPubClassImpDefInt/PublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtPubClassImpDefInt/PublicsubClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtPubClassImpIntInt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtPubClassImpIntInt/InternalInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtPubClassImpIntInt/PublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtPubClassImpIntInt/PublicsubClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtPubClassImpPubInt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtPubClassImpPubInt/PublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtPubClassImpPubInt/PublicInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtPubClassImpPubInt/PublicsubClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefInt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefInt/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefInt/DefaultInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefIntInt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefIntInt/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefIntInt/DefaultInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefIntInt/DefaultInterface_S.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefIntIntname.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefIntIntname/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefIntIntname/DefaultInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefIntIntname/DefaultInterface_S.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefIntname.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefIntname/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefIntname/DefaultInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefIntpubname.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefIntpubname/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefIntpubname/DefaultInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalInt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalInt/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalInt/InternalInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalIntInt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalIntInt/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalIntInt/DefaultInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalIntInt/DefaultInterface_S.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalIntIntname.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalIntIntname/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalIntIntname/InternalInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalIntIntname/InternalInterface_S.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalIntname.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalIntname/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalIntname/InternalInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalIntpubname.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalIntpubname/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalIntpubname/InternalInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicInt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicInt/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicInt/PublicInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicIntInt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicIntInt/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicIntInt/PublicInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicIntInt/PublicInterface_S.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicIntIntname.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicIntIntname/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicIntIntname/PublicInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicIntIntname/PublicInterface_S.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicIntname.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicIntname/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicIntname/PublicInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicIntpubname.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicIntpubname/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicIntpubname/PublicInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpDefInt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpDefInt/DefaultInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpDefInt/DynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpDefIntname.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpDefIntname/DefaultInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpDefIntname/DynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpDefIntpubname.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpDefIntpubname/DefaultInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpDefIntpubname/DynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpInternalInt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpInternalInt/DynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpInternalInt/InternalInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpInternalIntname.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpInternalIntname/DynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpInternalIntname/InternalInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpInternalIntpubname.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpInternalIntpubname/DynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpInternalIntpubname/InternalInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpPublicInt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpPublicInt/DynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpPublicInt/PublicInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpPublicIntname.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpPublicIntname/DynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpPublicIntname/PublicInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpPublicIntpubname.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpPublicIntpubname/DynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpPublicIntpubname/PublicInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefInt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefInt/DefaultInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefInt/FinalClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefIntInt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefIntInt/DefaultInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefIntInt/DefaultInterface_S.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefIntInt/FinalClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefIntIntname.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefIntIntname/DefaultInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefIntIntname/DefaultInterface_S.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefIntIntname/FinalClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefIntname.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefIntname/DefaultInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefIntname/FinalClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefIntpubname.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefIntpubname/DefaultInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefIntpubname/FinalClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalInt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalInt/FinalClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalInt/InternalInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalIntInt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalIntInt/FinalClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalIntInt/InternalInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalIntInt/InternalInterface_S.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalIntIntname.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalIntIntname/FinalClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalIntIntname/InternalInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalIntIntname/InternalInterface_S.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalIntname.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalIntname/FinalClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalIntname/InternalInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalIntpubname.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalIntpubname/FinalClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalIntpubname/InternalInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicInt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicInt/FinalClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicInt/PublicInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicIntInt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicIntInt/FinalClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicIntInt/PublicInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicIntInt/PublicInterface_S.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicIntIntname.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicIntIntname/FinalClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicIntIntname/PublicInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicIntIntname/PublicInterface_S.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicIntname.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicIntname/FinalClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicIntname/PublicInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicIntpubname.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicIntpubname/FinalClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicIntpubname/PublicInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpDefInt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpDefInt/DefaultInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpDefInt/InternalClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpDefIntname.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpDefIntname/DefaultInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpDefIntname/InternalClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpDefIntpubname.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpDefIntpubname/DefaultInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpDefIntpubname/InternalClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpInternalInt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpInternalInt/InternalClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpInternalInt/InternalInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpInternalIntname.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpInternalIntname/InternalClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpInternalIntname/InternalInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpInternalIntpubname.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpInternalIntpubname/InternalClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpInternalIntpubname/InternalInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefInt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefInt/DefaultInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefInt/PublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefIntInt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefIntInt/DefaultInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefIntInt/DefaultInterface_S.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefIntInt/PublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefIntIntname.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefIntIntname/DefaultInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefIntIntname/DefaultInterface_S.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefIntIntname/PublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefIntname.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefIntname/DefaultInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefIntname/PublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefIntpubname.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefIntpubname/DefaultInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefIntpubname/PublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalInt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalInt/InternalInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalInt/PublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalIntInt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalIntInt/InternalInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalIntInt/InternalInterface_S.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalIntInt/PublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalIntIntname.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalIntIntname/InternalInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalIntIntname/InternalInterface_S.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalIntIntname/PublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalIntname.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalIntname/InternalInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalIntname/PublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalIntpubname.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalIntpubname/InternalInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalIntpubname/PublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicInt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicInt/PublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicInt/PublicInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicIntInt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicIntInt/PublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicIntInt/PublicInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicIntInt/PublicInterface_S.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicIntIntname.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicIntIntname/PublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicIntIntname/PublicInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicIntIntname/PublicInterface_S.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicIntname.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicIntname/PublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicIntname/PublicInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicIntpubname.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicIntpubname/PublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicIntpubname/PublicInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/AddMCToDynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/AddMCToDynamicClass/DynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/AddMCToDynamicClass/SomeClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/DefClassExtractMeth.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/DefClassExtractMeth/ADefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/DefClassExtractMeth/DefClassExtractMeth.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/FinClassExtractMeth.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/FinClassExtractMeth/FinClassExtractMeth.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/GetMCFromDynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/GetMCFromDynamicClass/DynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/GetMCFromNamespace.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/GetMCFromNamespace/GetMCFromNamespace.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/GetMCFromOverRideMethod.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/GetMCFromOverRideMethod/BaseClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/GetMCFromOverRideMethod/GetMCFromOverRideMethod.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/GetMCFromSuperClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/GetMCFromSuperClass/BaseClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/GetMCFromSuperClass/GetMCFromSuperClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/IntClassExtractMeth.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/IntClassExtractMeth/AInternalClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/IntClassExtractMeth/IntClassExtractMeth.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/PubClassExtractMeth.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/PubClassExtractMeth/PubClassExtractMeth.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtDefaultOverRideDefault.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtDefaultOverRideDefault/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtDefaultOverRideDefault/DynExtDefaultOverRideDefault.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtDefaultOverRidePublic.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtDefaultOverRidePublic/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtDefaultOverRidePublic/DynExtDefaultOverRidePublic.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtDefaultOverRideVirtual.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtDefaultOverRideVirtual/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtDefaultOverRideVirtual/DynExtDefaultOverRideVirtual.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtDynamicOverRideDefault.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtDynamicOverRideDefault/ADynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtDynamicOverRideDefault/DynExtDynamicOverRideDefault.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtDynamicOverRidePublic.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtDynamicOverRidePublic/ADynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtDynamicOverRidePublic/DynExtDynamicOverRidePublic.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtInternalOverRidePublic.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtInternalOverRidePublic/AInternalClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtInternalOverRidePublic/DynExtInternalOverRidePublic.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtPublicOverRideDefault.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtPublicOverRideDefault/APublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtPublicOverRideDefault/DynExtPublicOverRideDefault.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtPublicOverRidePublic.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtPublicOverRidePublic/APublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtPublicOverRidePublic/DynExtPublicOverRidePublic.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtDefaultOverRideDefault.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtDefaultOverRideDefault/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtDefaultOverRideDefault/ExtDefaultOverRideDefault.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtDefaultOverRideInternal.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtDefaultOverRideInternal/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtDefaultOverRideInternal/ExtDefaultOverRideInternal.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtDefaultOverRidePublic.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtDefaultOverRidePublic/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtDefaultOverRidePublic/ExtDefaultOverRidePublic.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtDynamicOverRideDefault.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtDynamicOverRideDefault/DynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtDynamicOverRideDefault/ExtDynamicOverRideDefault.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtDynamicOverRidePublic.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtDynamicOverRidePublic/DynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtDynamicOverRidePublic/ExtDynamicOverRidePublic.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtInternalOverRideInternal.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtInternalOverRideInternal/AInternalClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtInternalOverRideInternal/ExtInternalOverRideInternal.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtPublicOverRideDefault.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtPublicOverRideDefault/APublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtPublicOverRideDefault/ExtPublicOverRideDefault.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtPublicOverRideProtected.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtPublicOverRideProtected/APublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtPublicOverRideProtected/ExtPublicOverRideProtected.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtPublicOverRidePublic.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtPublicOverRidePublic/APublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtPublicOverRidePublic/ExtPublicOverRidePublic.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtPublicOverRideVirtual.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtPublicOverRideVirtual/APublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtPublicOverRideVirtual/ExtPublicOverRideVirtual.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtDefaultOverRideDefault.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtDefaultOverRideDefault/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtDefaultOverRideDefault/FinExtDefaultOverRideDefault.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtDefaultOverRidePublic.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtDefaultOverRidePublic/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtDefaultOverRidePublic/FinExtDefaultOverRidePublic.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtDynamicOverRideDefault.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtDynamicOverRideDefault/DynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtDynamicOverRideDefault/FinExtDynamicOverRideDefault.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtDynamicOverRidePublic.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtDynamicOverRidePublic/DynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtDynamicOverRidePublic/FinExtDynamicOverRidePublic.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtPublicOverRideDefault.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtPublicOverRideDefault/APublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtPublicOverRideDefault/FinExtPublicOverRideDefault.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtPublicOverRidePublic.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtPublicOverRidePublic/APublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtPublicOverRidePublic/FinExtPublicOverRidePublic.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/IntExtDefaultOverRideProtected.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/IntExtDefaultOverRideProtected/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/IntExtDefaultOverRideProtected/IntExtDefaultOverRideProtected.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/IntExtDynamicOverRidePublic.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/IntExtDynamicOverRidePublic/DynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/IntExtDynamicOverRidePublic/IntExtDynamicOverRidePublic.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/IntExtInternalOverRidePublic.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/IntExtInternalOverRidePublic/AInternalClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/IntExtInternalOverRidePublic/IntExtInternalOverRidePublic.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/IntExtPublicOverRideInternal.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/IntExtPublicOverRideInternal/APublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/IntExtPublicOverRideInternal/IntExtPublicOverRideInternal.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/MethodInNamespace.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/MethodInNamespace/BaseClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/MethodInNamespace/MethodInNamespace.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/OverrideGetterSetter.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/OverrideGetterSetter/BaseClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/OverrideGetterSetter/OverrideGetterSetter.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/OverrideMethAtRuntimeErr.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/OverrideNoParamType.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/OverrideNoParamType/BaseClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/OverrideNoParamType/OverrideNoParamType.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/OverrideWithOptionalParams.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/OverrideWithOptionalParams/BaseClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/OverrideWithOptionalParams/OverrideWithOptionalParams.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtDefaultOverRideDefault.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtDefaultOverRideDefault/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtDefaultOverRideDefault/PubExtDefaultOverRideDefault.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtDefaultOverRideInternal.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtDefaultOverRideInternal/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtDefaultOverRideInternal/PubExtDefaultOverRideInternal.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtDefaultOverRidePublic.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtDefaultOverRidePublic/DefaultClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtDefaultOverRidePublic/PubExtDefaultOverRidePublic.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtDynamicOverRideDefault.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtDynamicOverRideDefault/DynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtDynamicOverRideDefault/PubExtDynamicOverRideDefault.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtDynamicOverRidePublic.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtDynamicOverRidePublic/DynamicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtDynamicOverRidePublic/PubExtDynamicOverRidePublic.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtInternalOverRidePublic.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtInternalOverRidePublic/InternalClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtInternalOverRidePublic/PubExtInternalOverRidePublic.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtPublicOverRideDefault.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtPublicOverRideDefault/APublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtPublicOverRideDefault/PubExtPublicOverRideDefault.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtPublicOverRidePublic.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtPublicOverRidePublic/APublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtPublicOverRidePublic/PubExtPublicOverRidePublic.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/SuperDifferentMethod.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/SuperDifferentMethod/BaseClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/SuperDifferentMethod/SuperDifferentMethod.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/SuperDifferentNamespace.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/SuperDifferentNamespace/BaseClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/SuperDifferentNamespace/SuperDifferentNamespace.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/SuperRTError.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/SuperRTError/BaseClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/SuperRTError/SuperInNamespaceErr.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/SuperSameMethod.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/SuperSameMethod/BaseClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/SuperSameMethod/SuperSameMethod.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/SuperSameNamespace.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/SuperSameNamespace/BaseClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Classes/Override/SuperSameNamespace/SuperSameNamespace.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionBody.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionBody/Custom.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionBody/TestObj.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionBody/noReturnCustomParam.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionBody/noReturnNoParams.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionBody/noReturnParams.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionBody/returnCustomNoParams.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionBody/returnNoParams.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionBody/returnParams.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionName.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionName/TestNameObj.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionName/pub$a1.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionName/pubC1.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionName/pub__a1.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionName/pub__a1__.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionName/pub_a1.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionName/pub_a1_.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionName/puba$1.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionName/puba1$.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionName/puba1.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionName/puba_1.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionName/pubcases.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionBody.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionBody/Custom.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionBody/TestObj.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionName.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionName/TestNameObj.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionName/pub$a1.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionName/pubC1.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionName/pub__a1.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionName/pub__a1__.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionName/pub_a1.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionName/pub_a1_.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionName/puba$1.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionName/puba1$.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionName/puba1.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionName/puba_1.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionName/pubcases.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/MultiOptArgFunction.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/MultiOptArgFunction/Boolean.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/MultiOptArgFunction/Number.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/MultiOptArgFunction/String.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/MultiOptArgFunction/TestObj.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/MultiOptArgFunction/returnArguments.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/MultipleExtraArgFunction1.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/MultipleExtraArgFunction1/MultipleExtraArgFunction1Class.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/MultipleExtraArgFunction1/TestObj.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/MultipleExtraArgFunction1/returnRest.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/MultipleExtraArgFunction2.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/MultipleExtraArgFunction2/MultipleExtraArgFunction2Class.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/MultipleExtraArgFunction2/TestObj.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/MultipleExtraArgFunction2/returnRest.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/MultipleExtraArgFunction3.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/MultipleExtraArgFunction3/Inter.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/MultipleExtraArgFunction3/MultipleExtraArgFunction3Class.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/MultipleExtraArgFunction3/TestObj.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/MultipleExtraArgFunction3/returnRest.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/NamespaceFunctionBody.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/NamespaceFunctionBody/Custom.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/NamespaceFunctionBody/TestObj.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/NamespaceFunctionName.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/NamespaceFunctionName/TestNameObj.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/NoExtraArgFunction.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/NoExtraArgFunction/NoExtraArgFunctionClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/NoExtraArgFunction/TestObj.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/NoExtraArgFunction/returnRest.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/OneExtraArgFunction.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/OneExtraArgFunction/OneExtraArgFunctionClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/OneExtraArgFunction/TestObj.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/OneExtraArgFunction/returnRest.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/OneOptArgFunction.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/OneOptArgFunction/Boolean.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/OneOptArgFunction/Number.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/OneOptArgFunction/OneOptArgFunctionClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/OneOptArgFunction/String.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/OneOptArgFunction/TestObj.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/OverrideFunctionBody.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/OverrideFunctionBody/Custom.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/OverrideFunctionBody/TestObj.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/OverrideFunctionName.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/OverrideFunctionName/TestNameObj.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/PrivateFunctionBody.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/PrivateFunctionBody/Custom.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/PrivateFunctionBody/TestObj.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/PrivateFunctionName.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/PrivateFunctionName/TestNameObj.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/PublicFunctionBody.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/PublicFunctionBody/Custom.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/PublicFunctionBody/TestObj.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/PublicFunctionBody/noReturnCustomParam.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/PublicFunctionBody/noReturnNoParams.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/PublicFunctionBody/noReturnParams.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/PublicFunctionBody/returnCustomNoParams.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/PublicFunctionBody/returnNoParams.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/PublicFunctionBody/returnParams.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/PublicFunctionName.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/PublicFunctionName/TestNameObj.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/PublicFunctionName/pub$a1.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/PublicFunctionName/pubC1.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/PublicFunctionName/pub__a1.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/PublicFunctionName/pub__a1__.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/PublicFunctionName/pub_a1.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/PublicFunctionName/pub_a1_.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/PublicFunctionName/puba$1.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/PublicFunctionName/puba1$.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/PublicFunctionName/puba1.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/PublicFunctionName/puba_1.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/PublicFunctionName/puball.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/PublicFunctionName/pubcases.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/RestGlobal.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/StaticFunctionBody.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/StaticFunctionBody/Custom.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/StaticFunctionBody/TestObj.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/StaticFunctionName.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/StaticFunctionName/TestNameObj.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/StaticPrivateFunctionName.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/StaticPrivateFunctionName/TestNameObj.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/StaticPublicFunctionName.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/StaticPublicFunctionName/TestNameObj.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/ThreeOptArgFunction.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/ThreeOptArgFunction/Boolean.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/ThreeOptArgFunction/Number.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/ThreeOptArgFunction/String.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/ThreeOptArgFunction/TestObj.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/ThreeOptArgFunction/returnArguments.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/VirtualFunctionBody.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/VirtualFunctionBody/Custom.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/VirtualFunctionBody/TestObj.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/VirtualFunctionName.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/VirtualFunctionName/TestNameObj.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/VoidEvaluation.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/VoidEvaluation/TestObj.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/bug152222.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/functionReturnTypes.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/functionReturnTypes/TestClassA.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/functionReturnTypes/TestClassB.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/functionReturnTypes/TestClassC.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Function/functionReturnTypes/TestInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/FunctionAccessors/GetSetAllowedNames.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/FunctionAccessors/GetSetAllowedNames/GetSetAllowedNames.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/FunctionAccessors/GetSetDefaultVars.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/FunctionAccessors/GetSetDefaultVars/GetSetPrivate.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/FunctionAccessors/GetSetDiffScope.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/FunctionAccessors/GetSetDiffScope/GetSetDiffScope.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/FunctionAccessors/GetSetDynamicAccess.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/FunctionAccessors/GetSetDynamicAccess/GetSetPrivate.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/FunctionAccessors/GetSetExtended.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/FunctionAccessors/GetSetExtended/GetSetPrivate.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/FunctionAccessors/GetSetExtendedOverride.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/FunctionAccessors/GetSetExtendedOverride/GetSetPrivate.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/FunctionAccessors/GetSetFinal.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/FunctionAccessors/GetSetFinal/GetSetFinal.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/FunctionAccessors/GetSetImpl.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/FunctionAccessors/GetSetImpl/GetSetImpl.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/FunctionAccessors/GetSetInternal.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/FunctionAccessors/GetSetInternal/GetSetInternal.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/FunctionAccessors/GetSetPackagePrivateFuncs.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/FunctionAccessors/GetSetPackagePrivateFuncs/GetSetPackagePrivateFuncs.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/FunctionAccessors/GetSetPackagePrivateVars.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/FunctionAccessors/GetSetPackagePrivateVars/GetSetPackagePrivate.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/FunctionAccessors/GetSetPrivateVars.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/FunctionAccessors/GetSetPrivateVars/GetSetPrivate.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/FunctionAccessors/GetSetPropertyMixup.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/FunctionAccessors/GetSetPropertyMixup/GetSetPropertyMixup.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/FunctionAccessors/GetSetProtected.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/FunctionAccessors/GetSetProtected/GetSetProtected.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/FunctionAccessors/GetSetProtectedExtended.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/FunctionAccessors/GetSetProtectedExtended/GetSetProtectedExtended.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/FunctionAccessors/GetSetPublicVars.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/FunctionAccessors/GetSetPublicVars/GetSetPublic.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/FunctionAccessors/GetSetSameName.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/FunctionAccessors/GetSetSameName/GetSetSame.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/FunctionAccessors/GetSetSameName/GetSetSameName.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/FunctionAccessors/GetSetSameName/GetSetSameNameArg.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/FunctionAccessors/GetSetStatic.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/FunctionAccessors/GetSetStatic/GetSetStatic.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/FunctionAccessors/GetSetStatic/GetSetStaticSameName.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/FunctionAccessors/GetSetStaticExtended.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/FunctionAccessors/GetSetStaticExtended/GetSetStatic.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/FunctionAccessors/GetSetVirtual.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/FunctionAccessors/GetSetVirtual/GetSetVirtual.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/FunctionAccessors/GetSuper.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/FunctionAccessors/GetterInNewExpression.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/FunctionAccessors/GetterInNewExpression/GetterInNewExpression.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/FunctionAccessors/InfRec.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Interfaces/Example_1_1_6.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Interfaces/Example_1_1_6/Example_1_1_6.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Interfaces/Example_9_2_const.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Interfaces/Example_9_2_const/Example_9_2_const.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Interfaces/Example_9_2_qual.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Interfaces/Example_9_2_qual/Example_9_2_qual.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Interfaces/Example_9_3.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Interfaces/Example_9_3/Example_9_3.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Interfaces/Example_9_4.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Interfaces/Example_9_4/Example_9_4.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Interfaces/ExtendMultipleInterfaces.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Interfaces/ExtendMultipleInterfaces/ExtendMultipleInterfaces.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Interfaces/GetSet.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Interfaces/GetSet/GetSet.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Interfaces/ImplTwoInterfacesSameMethod.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Interfaces/ImplTwoInterfacesSameMethod/A.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Interfaces/ImplTwoInterfacesSameMethod/B.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Interfaces/ImplTwoInterfacesSameMethod/C.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Interfaces/ImplementByExtension.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Interfaces/ImplementByExtension/ImplementByExtension.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Interfaces/ImplementMultipleInterfaces.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Interfaces/ImplementMultipleInterfaces/ImplementMultipleInterfaces.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Interfaces/InterfaceAsType.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Interfaces/InterfaceAsType/InterfaceAsType.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Interfaces/Lattice.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Interfaces/Lattice/IFuncF.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Interfaces/Lattice/IFuncFG.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Interfaces/Lattice/IFuncG.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Interfaces/Lattice/IFuncGxF.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Interfaces/Lattice/IFuncH.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Interfaces/Lattice/ImplFG.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Interfaces/Lattice/ImplGxF.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Interfaces/Lattice/ImplHxFG.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Interfaces/LatticeAmbiguous.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Interfaces/LatticeAmbiguous/IFuncF.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Interfaces/LatticeAmbiguous/IFuncFG.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Interfaces/LatticeAmbiguous/IFuncG.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Interfaces/LatticeAmbiguous/IFuncGxF.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Interfaces/LatticeAmbiguous/IFuncH.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Interfaces/LatticeAmbiguous/ImplFFG.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Interfaces/LatticeAmbiguous/ImplFG.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Interfaces/LatticeAmbiguous/ImplGxF.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Interfaces/LatticeAmbiguous/ImplHxFG.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Interfaces/QualUnqualAccess.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Interfaces/QualUnqualAccess/QualUnqualAccess.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Interfaces/Qualifiers.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Interfaces/Qualifiers/Qualifiers.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Interfaces/TraitsNotAccessible.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Interfaces/TraitsNotAccessible/TraitsNotAccessible.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Interfaces/bug127174.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Interfaces/bug127174/CoerceErrorForInterfaces.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Interfaces/bug127174/IBaseInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Interfaces/bug127174/ITestInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Interfaces/bug127174/InterfacecorceErrorTest.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Packages/AccessClassByFullyQualifiedName.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Packages/AccessDefaultPackageClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Packages/AccessDefaultPackageClassGlobally.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Packages/AccessDefaultPackageFunction.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Packages/AccessDefaultPackageFunctionGlobally.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Packages/AccessDefaultPackageInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Packages/AccessDefaultPackageInterfaceGlobally.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Packages/AccessDefaultPackageVariable.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Packages/AccessDefaultPackageVariableGlobally.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Packages/AccessFunctionByFullyQualifiedName.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Packages/ClassOutsidePackage.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Packages/DiscontinuousPackage.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Packages/DiscontinuousPackage/A.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Packages/DiscontinuousPackage/B.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Packages/DiscontinuousPackage/C.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Packages/DiscontinuousPackage/IClickable.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Packages/DiscontinuousPackage/vars.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Packages/DiscontinuousPackage2.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Packages/EmptyPackage.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Packages/FullyQualifiedNames.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Packages/FullyQualifiedNames2.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Packages/FuncNameSameAsPackageDef.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Packages/FunctionOutsidePackage.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Packages/FutureReservedPackageNames.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Packages/IdentifierPackageNames.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Packages/ImportIndividualClasses.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Packages/ImportIntoAnotherPackage.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Packages/ImportOutsidePackage.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Packages/ImportPackageInItself.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Packages/InterfaceOutsidePackage.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Packages/MatchingNames.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Packages/MultiplePackageDef.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Packages/MultiplePackageDefSame.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Packages/MultiplePackageDefSame2.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Packages/MultiplePackageDefSameEmpty.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Packages/MultiplePackageName.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Packages/MultiplePackageName100.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Packages/NamespaceOutsidePackage.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Packages/NestedImports.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Packages/NoPackageName.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Packages/PackageName256.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Packages/PackageShadowLocalVar.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Packages/PackageWithAll.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Packages/PackageWithClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Packages/PackageWithFunction.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Packages/PackageWithImport.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Packages/PackageWithInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Packages/PackageWithNamespace.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Packages/PackageWithOverride.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Packages/SameNameDiffPackage.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Packages/SingleNameAliases.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Packages/SingleNameAliases/A.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Packages/SingleNameAliases/B.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Packages/SinglePackageName.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Packages/UnnamedPackage.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Packages/UnnamedPackage/unnamed.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Regress/IncrementTypeNaN.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Super/SuperArgsCall.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Super/SuperArgsCall/SuperArgsCall.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Super/SuperExprChainAccess.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Super/SuperExprChainAccess/SuperExprChainAccess.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Super/SuperImplicitlyCalled.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Super/SuperImplicitlyCalled/SuperImplicitlyCalled.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Super/SuperObject.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Super/SuperObject/SuperObject.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Super/SuperObjectCall.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Super/SuperObjectCall/SuperObjectCall.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Super/SuperProps.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Super/SuperProps/SuperProps.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Super/SuperRuntimeError.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Super/SuperRuntimeError/SuperRuntimeError.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Variable/AccessPrivateClassVariable_rt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Variable/ConstVariables.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Variable/ConstVariables/ConstVariablesClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Variable/ModifyClassConstGlobally_rt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Variable/ModifyClassVariableInObjectInstance_rt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Variable/ModifyPackageConstGlobally_rt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Variable/ModifyVariables.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Variable/ModifyVariables/ModifyVariablesClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Variable/ProtectedVariables.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Variable/ProtectedVariables/ProtectedVariablesClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Variable/VarDefEmpty.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Variable/VarDefEmpty/VarDefEmpty.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Variable/VarDefOutside.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Variable/VarDefOutsideNoVar.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Variable/VarDefPrivate.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Variable/VarDefPrivate/VarDefPrivate.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Variable/VarDefPrivateStatic.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Variable/VarDefPrivateStatic/VarDefPrivateStaticClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Variable/VarDefPublic.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Variable/VarDefPublic/VarDefPublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Variable/VarDefPublicStatic.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Variable/VarDefPublicStatic/VarDefPublicStaticClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Variable/VarDefStatic.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/Variable/VarDefStatic/VarDefStaticClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/const/ConstAccessFromClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/const/ConstAccessWithinClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/const/ConstAndClassFuncArgWithSameName.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/const/ConstAndClassFuncArgWithSameName2.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/const/ConstAndFunctionArgWithSameName.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/const/ConstAndFunctionArgWithSameName2.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/const/ConstAsVarReplacement.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/const/ConstConditionalInitialization.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/const/ConstConditionalInitializationInClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/const/ConstConditionalInitializationInClass2.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/const/ConstConditionalInitializationInClass3_rt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/const/ConstConditionalInitializationInFunc.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/const/ConstInPackage.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/const/ConstInPackage2.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/const/ConstInPackageWithClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/const/ConstInPackageWithFunction.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/const/ConstInitializationInsideConstructor.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/const/ConstInitializationOutsideClass_rt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/const/ConstInsideClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/const/ConstKeyword.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/const/ConstReinit_rt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/const/ConstVarAsClassProp.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/const/ConstVarInsideClassFunction.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/const/ConstVarInsideClassFunction2_rt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/const/ConstVarInsideGlobalFunction.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/const/ConstVarInsideGlobalFunction2.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/const/ConstVarInsideGlobalFunction3.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/const/ConstVarInsideGlobalFunction4.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/const/ConstVarInsideGlobalFunction5_rt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/const/ConstWithinClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/const/ConstWithinPackage.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/const/GlobalConstInitialization2_rt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/const/GlobalConstInitialization_rt.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/const/StaticConst.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/const/StaticConstInDerivedClass.as create mode 100644 mozilla/js/tamarin/test/as3/Definitions/const/StaticConstInitializationOutsideClass_rt.as create mode 100644 mozilla/js/tamarin/test/as3/Directives/Attributes/Attributes.as create mode 100644 mozilla/js/tamarin/test/as3/Directives/Attributes/Attributes/Attrs.as create mode 100644 mozilla/js/tamarin/test/as3/Directives/Import/Importall.as create mode 100644 mozilla/js/tamarin/test/as3/Directives/Import/Importclass.as create mode 100644 mozilla/js/tamarin/test/as3/Directives/Import/ImportclassAssign.as create mode 100644 mozilla/js/tamarin/test/as3/Directives/Import/Importfunc.as create mode 100644 mozilla/js/tamarin/test/as3/Directives/Import/Importinterface.as create mode 100644 mozilla/js/tamarin/test/as3/Directives/Import/Importinterfaceclass.as create mode 100644 mozilla/js/tamarin/test/as3/Directives/Import/Importnamespace.as create mode 100644 mozilla/js/tamarin/test/as3/Directives/Import/Importtwonamespace.as create mode 100644 mozilla/js/tamarin/test/as3/Directives/Import/Importtwovar.as create mode 100644 mozilla/js/tamarin/test/as3/Directives/Import/Importvar.as create mode 100644 mozilla/js/tamarin/test/as3/Directives/Import/ImportvarAssign.as create mode 100644 mozilla/js/tamarin/test/as3/Directives/Include/Inc.as create mode 100644 mozilla/js/tamarin/test/as3/Directives/Include/IncLineBreak.as create mode 100644 mozilla/js/tamarin/test/as3/Directives/Include/IncSlash.as create mode 100644 mozilla/js/tamarin/test/as3/Directives/Include/Include.txt create mode 100644 mozilla/js/tamarin/test/as3/Directives/Include/Include1.txt create mode 100644 mozilla/js/tamarin/test/as3/Directives/Include/MultipleInc.as create mode 100644 mozilla/js/tamarin/test/as3/Directives/Include/MultipleInc/Include2.txt create mode 100644 mozilla/js/tamarin/test/as3/Directives/Include/MultipleIncOrder.as create mode 100644 mozilla/js/tamarin/test/as3/Directives/Include/MultipleIncOrder/Include1.txt create mode 100644 mozilla/js/tamarin/test/as3/Directives/Include/MultipleIncOrder/Include2.txt create mode 100644 mozilla/js/tamarin/test/as3/Directives/Include/NoHashInc.as create mode 100644 mozilla/js/tamarin/test/as3/Directives/Include/NoHashWithFrontSlashInc.as create mode 100644 mozilla/js/tamarin/test/as3/Directives/usenamespace/AssignmentExp.as create mode 100644 mozilla/js/tamarin/test/as3/Directives/usenamespace/NSInsideTryCatch.as create mode 100644 mozilla/js/tamarin/test/as3/Directives/usenamespace/NSInterfacefunc.as create mode 100644 mozilla/js/tamarin/test/as3/Directives/usenamespace/NSReturnedByFunc.as create mode 100644 mozilla/js/tamarin/test/as3/Directives/usenamespace/NSValueAssig.as create mode 100644 mozilla/js/tamarin/test/as3/Directives/usenamespace/NsAttributeFunc.as create mode 100644 mozilla/js/tamarin/test/as3/Directives/usenamespace/NsAttributeVar.as create mode 100644 mozilla/js/tamarin/test/as3/Directives/usenamespace/NsClassesfunc.as create mode 100644 mozilla/js/tamarin/test/as3/Directives/usenamespace/NsExpressionRef.as create mode 100644 mozilla/js/tamarin/test/as3/Directives/usenamespace/OverrideBaseNsMethod.as create mode 100644 mozilla/js/tamarin/test/as3/Directives/usenamespace/PublicNSFuncAttr.as create mode 100644 mozilla/js/tamarin/test/as3/Directives/usenamespace/PublicNSVarAttr.as create mode 100644 mozilla/js/tamarin/test/as3/Directives/usenamespace/QNSpropertyAccess.as create mode 100644 mozilla/js/tamarin/test/as3/Directives/usenamespace/QNSvarsingle.as create mode 100644 mozilla/js/tamarin/test/as3/Directives/usenamespace/UNSDefinPackageDifNs.as create mode 100644 mozilla/js/tamarin/test/as3/Directives/usenamespace/UNSDefinPackageOneNs.as create mode 100644 mozilla/js/tamarin/test/as3/Directives/usenamespace/UNSDiffInFunOnly.as create mode 100644 mozilla/js/tamarin/test/as3/Directives/usenamespace/UNSEmbFuncSingle.as create mode 100644 mozilla/js/tamarin/test/as3/Directives/usenamespace/UNSFuncDiffAttr.as create mode 100644 mozilla/js/tamarin/test/as3/Directives/usenamespace/UNSFuncMultipleAttr.as create mode 100644 mozilla/js/tamarin/test/as3/Directives/usenamespace/UNSFuncMultipleDiff.as create mode 100644 mozilla/js/tamarin/test/as3/Directives/usenamespace/UNSInsideFun.as create mode 100644 mozilla/js/tamarin/test/as3/Directives/usenamespace/UNSReDefinPackage.as create mode 100644 mozilla/js/tamarin/test/as3/Directives/usenamespace/UNSfuncsingle.as create mode 100644 mozilla/js/tamarin/test/as3/Directives/usenamespace/UNSvarmultiple.as create mode 100644 mozilla/js/tamarin/test/as3/Directives/usenamespace/UNSvarsingle.as create mode 100644 mozilla/js/tamarin/test/as3/Directives/usenamespace/longQualifier.as create mode 100644 mozilla/js/tamarin/test/as3/Expressions/QualifiedReferences/AS3NSReferences.as create mode 100644 mozilla/js/tamarin/test/as3/Expressions/QualifiedReferences/AS3NSReferences/foo.as create mode 100644 mozilla/js/tamarin/test/as3/Expressions/QualifiedReferences/AssignmentExp.as create mode 100644 mozilla/js/tamarin/test/as3/Expressions/QualifiedReferences/AssignmentExp/foo.as create mode 100644 mozilla/js/tamarin/test/as3/Expressions/QualifiedReferences/DescendantOperator.as create mode 100644 mozilla/js/tamarin/test/as3/Expressions/QualifiedReferences/FilterOperator.as create mode 100644 mozilla/js/tamarin/test/as3/Expressions/QualifiedReferences/MultipleNamespaces.as create mode 100644 mozilla/js/tamarin/test/as3/Expressions/QualifiedReferences/MultipleNamespaces/foo.as create mode 100644 mozilla/js/tamarin/test/as3/Expressions/QualifiedReferences/NSSingleFunc.as create mode 100644 mozilla/js/tamarin/test/as3/Expressions/QualifiedReferences/NSSingleFunc/foo.as create mode 100644 mozilla/js/tamarin/test/as3/Expressions/QualifiedReferences/ReturnNSReference.as create mode 100644 mozilla/js/tamarin/test/as3/Expressions/QualifiedReferences/ReturnNSReference/foo.as create mode 100644 mozilla/js/tamarin/test/as3/Expressions/QualifiedReferences/ReturnNamespace.as create mode 100644 mozilla/js/tamarin/test/as3/Expressions/QualifiedReferences/ReturnNamespace/A.as create mode 100644 mozilla/js/tamarin/test/as3/Expressions/QualifiedReferences/ReturnNamespace/B.as create mode 100644 mozilla/js/tamarin/test/as3/Expressions/QualifiedReferences/WildcardOperator.as create mode 100644 mozilla/js/tamarin/test/as3/Expressions/asOperator/asOper.as create mode 100644 mozilla/js/tamarin/test/as3/Expressions/asOperator/asOper/TestClassA.as create mode 100644 mozilla/js/tamarin/test/as3/Expressions/asOperator/asOper/TestClassB.as create mode 100644 mozilla/js/tamarin/test/as3/Expressions/asOperator/asOper/TestClassC.as create mode 100644 mozilla/js/tamarin/test/as3/Expressions/asOperator/asOper/TestInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Expressions/asOperator/asOperator.as create mode 100644 mozilla/js/tamarin/test/as3/Expressions/asOperator/asOperatorConversions.as create mode 100644 mozilla/js/tamarin/test/as3/Expressions/asOperator/asOperatorMuliti.as create mode 100644 mozilla/js/tamarin/test/as3/Expressions/asOperator/asOperatorTypes.as create mode 100644 mozilla/js/tamarin/test/as3/Expressions/asOperator/asTypeError.as create mode 100644 mozilla/js/tamarin/test/as3/Expressions/deleteOperator/deleteArray.as create mode 100644 mozilla/js/tamarin/test/as3/Expressions/deleteOperator/deleteClass.as create mode 100644 mozilla/js/tamarin/test/as3/Expressions/deleteOperator/deleteFixedFunction.as create mode 100644 mozilla/js/tamarin/test/as3/Expressions/deleteOperator/deleteFixedVar.as create mode 100644 mozilla/js/tamarin/test/as3/Expressions/deleteOperator/deleteInstantiatedFunction.as create mode 100644 mozilla/js/tamarin/test/as3/Expressions/deleteOperator/deleteInstantiatedVar.as create mode 100644 mozilla/js/tamarin/test/as3/Expressions/deleteOperator/deleteNonexistentDynamicProperty.as create mode 100644 mozilla/js/tamarin/test/as3/Expressions/deleteOperator/deleteNonexistentFixedProperty.as create mode 100644 mozilla/js/tamarin/test/as3/Expressions/deleteOperator/deleteNoninstantiatedFunction.as create mode 100644 mozilla/js/tamarin/test/as3/Expressions/deleteOperator/deleteNoninstantiatedVar.as create mode 100644 mozilla/js/tamarin/test/as3/Expressions/isOperator/isOper.as create mode 100644 mozilla/js/tamarin/test/as3/Expressions/isOperator/isOper/TestClassA.as create mode 100644 mozilla/js/tamarin/test/as3/Expressions/isOperator/isOper/TestClassB.as create mode 100644 mozilla/js/tamarin/test/as3/Expressions/isOperator/isOper/TestClassC.as create mode 100644 mozilla/js/tamarin/test/as3/Expressions/isOperator/isOper/TestInterface.as create mode 100644 mozilla/js/tamarin/test/as3/Expressions/isOperator/isOperTypeError.as create mode 100644 mozilla/js/tamarin/test/as3/MethodClosures/MethodClosure.as create mode 100644 mozilla/js/tamarin/test/as3/MethodClosures/MethodClosureFunc.as create mode 100644 mozilla/js/tamarin/test/as3/RuntimeErrors/Error1002PrecisionArgOutOfRange.as create mode 100644 mozilla/js/tamarin/test/as3/RuntimeErrors/Error1003RadixArgOutOfRange.as create mode 100644 mozilla/js/tamarin/test/as3/RuntimeErrors/Error1004MethodInvokedOnIncompatibleObj.as create mode 100644 mozilla/js/tamarin/test/as3/RuntimeErrors/Error1005ArrayIndexNotInteger.as create mode 100644 mozilla/js/tamarin/test/as3/RuntimeErrors/Error1006CallNonFunctionObject.as create mode 100644 mozilla/js/tamarin/test/as3/RuntimeErrors/Error1007InstantiationOnNonConstructor.as create mode 100644 mozilla/js/tamarin/test/as3/RuntimeErrors/Error1009CannotAccessPropOfNullRef.as create mode 100644 mozilla/js/tamarin/test/as3/RuntimeErrors/Error1010UndefinedTerm.as create mode 100644 mozilla/js/tamarin/test/as3/RuntimeErrors/Error1014ClassNotFound.as create mode 100644 mozilla/js/tamarin/test/as3/RuntimeErrors/Error1016DescendantsOpNotSupported.as create mode 100644 mozilla/js/tamarin/test/as3/RuntimeErrors/Error1034TypeCoercionFailed.as create mode 100644 mozilla/js/tamarin/test/as3/RuntimeErrors/Error1037CannotAssignMethod.as create mode 100644 mozilla/js/tamarin/test/as3/RuntimeErrors/Error1040InvalidRHSOfInstanceof.as create mode 100644 mozilla/js/tamarin/test/as3/RuntimeErrors/Error1041RHSOfIsMustBeClass.as create mode 100644 mozilla/js/tamarin/test/as3/RuntimeErrors/Error1050CannotConvertToPrimitive.as create mode 100644 mozilla/js/tamarin/test/as3/RuntimeErrors/Error1052InvalidUriPassed.as create mode 100644 mozilla/js/tamarin/test/as3/RuntimeErrors/Error1056CannotCreatePropInSealedClass.as create mode 100644 mozilla/js/tamarin/test/as3/RuntimeErrors/Error1064CannotCallMethodAsConstructor.as create mode 100644 mozilla/js/tamarin/test/as3/RuntimeErrors/Error1065VariableNotDefined.as create mode 100644 mozilla/js/tamarin/test/as3/RuntimeErrors/Error1066Function-body-NotAllowed.as create mode 100644 mozilla/js/tamarin/test/as3/RuntimeErrors/Error1069PropertyNotFound.as create mode 100644 mozilla/js/tamarin/test/as3/RuntimeErrors/Error1070MethodNotFound.as create mode 100644 mozilla/js/tamarin/test/as3/RuntimeErrors/Error1074IllegalWriteToReadOnlyProp.as create mode 100644 mozilla/js/tamarin/test/as3/RuntimeErrors/Error1075MathNotAFunction.as create mode 100644 mozilla/js/tamarin/test/as3/RuntimeErrors/Error1076MathNotAConstructor.as create mode 100644 mozilla/js/tamarin/test/as3/RuntimeErrors/Error1077IllegalReadOfWriteOnlyProp.as create mode 100644 mozilla/js/tamarin/test/as3/RuntimeErrors/Error1081ReadSealedErrorNs.as create mode 100644 mozilla/js/tamarin/test/as3/RuntimeErrors/Error1083XmlPrefixNotFound.as create mode 100644 mozilla/js/tamarin/test/as3/RuntimeErrors/Error1084XmlQNameProductionMismatch.as create mode 100644 mozilla/js/tamarin/test/as3/RuntimeErrors/Error1085XmlEndTagMissing.as create mode 100644 mozilla/js/tamarin/test/as3/RuntimeErrors/Error1086XmlMethodOnlyOnListWithOneItem.as create mode 100644 mozilla/js/tamarin/test/as3/RuntimeErrors/Error1087XmlAssignToIndexedXml.as create mode 100644 mozilla/js/tamarin/test/as3/RuntimeErrors/Error1088XmlDocNotWellFormed.as create mode 100644 mozilla/js/tamarin/test/as3/RuntimeErrors/Error1089XmlAssignToMoreThanOneItemList.as create mode 100644 mozilla/js/tamarin/test/as3/RuntimeErrors/Error1090XmlElementMalformed.as create mode 100644 mozilla/js/tamarin/test/as3/RuntimeErrors/Error1091XmlUnterminatedCdata.as create mode 100644 mozilla/js/tamarin/test/as3/RuntimeErrors/Error1092XmlUnterminatedXmlDecl.as create mode 100644 mozilla/js/tamarin/test/as3/RuntimeErrors/Error1093XmlUnterminatedDoctype.as create mode 100644 mozilla/js/tamarin/test/as3/RuntimeErrors/Error1094XmlUnterminatedComment.as create mode 100644 mozilla/js/tamarin/test/as3/RuntimeErrors/Error1095XmlUnterminatedAttr.as create mode 100644 mozilla/js/tamarin/test/as3/RuntimeErrors/Error1097XmlUnterminatedProcessingInstr.as create mode 100644 mozilla/js/tamarin/test/as3/RuntimeErrors/Error1098XmlIllegalPrefixFoNoNamespace.as create mode 100644 mozilla/js/tamarin/test/as3/RuntimeErrors/Error1100RegExpFlagsArg.as create mode 100644 mozilla/js/tamarin/test/as3/RuntimeErrors/Error1104XmlDuplicateAttr.as create mode 100644 mozilla/js/tamarin/test/as3/RuntimeErrors/Error1112ArgCountMismatchOnClassCoercion.as create mode 100644 mozilla/js/tamarin/test/as3/RuntimeErrors/Error1115NotAConstructor.as create mode 100644 mozilla/js/tamarin/test/as3/RuntimeErrors/Error1116FunctionProtoApply2ndArgMustBeArr.as create mode 100644 mozilla/js/tamarin/test/as3/RuntimeErrors/Error1117InvalidXmlName.as create mode 100644 mozilla/js/tamarin/test/as3/RuntimeErrors/Error1118IllegalCyclicalLoop.as create mode 100644 mozilla/js/tamarin/test/as3/RuntimeErrors/Error1119DeleteDoesNotSupportXMLListOperand.as create mode 100644 mozilla/js/tamarin/test/as3/RuntimeErrors/Error1120CannotDeleteProperty.as create mode 100644 mozilla/js/tamarin/test/as3/RuntimeErrors/SpecialTestCases/Error1042InvalidABCFile/Error1042InvalidABCFile.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocks2.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocks2/MyErrors2.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksArgument.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksArgument/ArgumentErrors.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksEval.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksEval/EvalErrors.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksRange.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksRange/RangeErrors.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksRefErrorCaughtWithError.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksReference.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksReference/ReferenceErrors.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksType.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksType/TypeErrors.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksType1.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksType2.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksType3.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksType4.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksType5.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksType6.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksType7.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksURI.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksURI/URIErrors.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithArg1.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithArgErrorCaughtByError.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithDef1.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithDefErrorCaughtWithError.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithEval1.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithEvalErrorCaughtByError.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithNoTypeErrorCatchBlock.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithRange1.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithRangeErrorCaughtByError.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithRefError1.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithSyntax.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithSyntaxErrorCaughtByError.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithTwoType.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithTwoType/TypeErrors.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithURI1.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithURICaughtByError.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithUninitialized1.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithUnitializedCaughtWithError.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithVerify1.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithVerifyCaughtByError.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryBlockWithMultipleCatchBlocksTypeWithNoInnerCatchType.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryBlockWithMultipleCatchRefType.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryWithMulitpleCatchInsideEighthCatch.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryWithMulitpleCatchInsideFifthCatch.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryWithMulitpleCatchInsideSeventhCatch.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryWithMulitpleCatchInsideSixthCatch.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryWithMultipleCatchInsideFinally.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryWithMultipleCatchInsideFinallyExceptionBubbling.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryWithMultipleCatchInsideFinallyExceptionBubbling/NestedTryWithMultipleCatchInsideFinally.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryWithMultipleCatchInsideFourthCatch.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryWithMultipleCatchInsideFourthCatchWithoutMatchingCatch.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryWithMultipleCatchInsideSecondCatch.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryWithMultipleCatchInsideSecondCatchWithoutMatchingCatch.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryWithMultipleCatchInsideThirdCatch.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryWithMultipleCatchInsideThirdCatchWithoutMatchingCatch.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryWithMultipleCatchInsideTry.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryWithMultipleCatchInsideTryWithoutMatchingCatch.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/TryCatchBlockPackage.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/TryCatchBlockPackage/TryAndCatchBlockWithUserDefinedErrors.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/TryCatchBlockPackage2.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/TryCatchBlockPackage2/TryAndCatchBlockWithUserDefinedErrors.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/TryCatchBlockPackage3.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/TryCatchBlockPackage3/TryAndCatchBlockWithUserDefinedErrors.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/TryCatchBlockUserWithBuiltInExceptions.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/TryCatchBlockUserWithBuiltInExceptions/TryAndCatchBlockWithUserDefinedErrors.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/UserDefinedErrorsInPackage.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/UserDefinedErrorsInPackage/TryAndCatchBlockWithUserDefinedErrorsInPackage.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/UserDefinedErrorsPackage.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/UserDefinedErrorsPackage/TryAndCatchBlockWithUserDefinedErrors.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/UserDefinedErrorsPackage2.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/UserDefinedErrorsPackage2/TryAndCatchBlockWithUserDefinedErrors2.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/UserDefinedErrorsPackage3.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/UserDefinedErrorsPackage3/TryAndCatchBlockWithUserDefinedErrors3.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/UserDefinedErrorsPackageWithoutMatchingCatch.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/UserDefinedErrorsPackageWithoutMatchingCatch/TryAndCatchBlockWithUserDefinedErrorsWithoutMatchingcatch.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/getStackTrace.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/getStackTrace/StackTraceCaller.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/Exceptions/getStackTrace/SubError.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/for-each-in/eforeachin_001.as create mode 100644 mozilla/js/tamarin/test/as3/Statements/for-each-in/eforeachin_002.as create mode 100644 mozilla/js/tamarin/test/as3/Types/Conversions/ExplicitConversions.as create mode 100644 mozilla/js/tamarin/test/as3/Types/Conversions/ImplicitConversions1_23.as create mode 100644 mozilla/js/tamarin/test/as3/Types/Conversions/ImplicitConversionsFalse.as create mode 100644 mozilla/js/tamarin/test/as3/Types/Conversions/ImplicitConversionsNaN.as create mode 100644 mozilla/js/tamarin/test/as3/Types/Conversions/ImplicitConversionsNeg1_23.as create mode 100644 mozilla/js/tamarin/test/as3/Types/Conversions/ImplicitConversionsNull.as create mode 100644 mozilla/js/tamarin/test/as3/Types/Conversions/ImplicitConversionsString.as create mode 100644 mozilla/js/tamarin/test/as3/Types/Conversions/ImplicitConversionsTrue.as create mode 100644 mozilla/js/tamarin/test/as3/Types/Conversions/ImplicitConversionsUndefined.as create mode 100644 mozilla/js/tamarin/test/as3/Types/Int/intConstructor.as create mode 100644 mozilla/js/tamarin/test/as3/Types/Int/intIs.as create mode 100644 mozilla/js/tamarin/test/as3/Types/Int/intMaxValue.as create mode 100644 mozilla/js/tamarin/test/as3/Types/Int/intMinValue.as create mode 100644 mozilla/js/tamarin/test/as3/Types/Int/intType.as create mode 100644 mozilla/js/tamarin/test/as3/Types/Int/wraparound.as create mode 100644 mozilla/js/tamarin/test/as3/Types/Uint/UintFunctionArg.as create mode 100644 mozilla/js/tamarin/test/as3/Types/Uint/UintHex.as create mode 100644 mozilla/js/tamarin/test/as3/Types/Uint/UintIs.as create mode 100644 mozilla/js/tamarin/test/as3/Types/Uint/UintPublicClassMethodArg.as create mode 100644 mozilla/js/tamarin/test/as3/Types/Uint/UintPublicClassMethodArg/UintPublicClass.as create mode 100644 mozilla/js/tamarin/test/as3/Types/Uint/UintType.as create mode 100644 mozilla/js/tamarin/test/as3/Types/Uint/UintVarAsClassProp.as create mode 100644 mozilla/js/tamarin/test/as3/Types/Uint/UintVarAsClassProp/UintVarAsClassProp.as create mode 100644 mozilla/js/tamarin/test/as3/Types/Uint/UintVarOperationInFunc.as create mode 100644 mozilla/js/tamarin/test/as3/Types/Uint/UintVarOperationInFuncRet.as create mode 100644 mozilla/js/tamarin/test/as3/Types/Uint/UintVarOperations.as create mode 100644 mozilla/js/tamarin/test/e4x/Expressions/e11_1_1.as create mode 100644 mozilla/js/tamarin/test/e4x/Expressions/e11_1_2.as create mode 100644 mozilla/js/tamarin/test/e4x/Expressions/e11_1_3.as create mode 100644 mozilla/js/tamarin/test/e4x/Expressions/e11_1_4.as create mode 100644 mozilla/js/tamarin/test/e4x/Expressions/e11_1_5.as create mode 100644 mozilla/js/tamarin/test/e4x/Expressions/e11_2_1.as create mode 100644 mozilla/js/tamarin/test/e4x/Expressions/e11_2_2.as create mode 100644 mozilla/js/tamarin/test/e4x/Expressions/e11_2_3.as create mode 100644 mozilla/js/tamarin/test/e4x/Expressions/e11_2_4.as create mode 100644 mozilla/js/tamarin/test/e4x/Expressions/e11_3_1.as create mode 100644 mozilla/js/tamarin/test/e4x/Expressions/e11_3_2.as create mode 100644 mozilla/js/tamarin/test/e4x/Expressions/e11_4_1.as create mode 100644 mozilla/js/tamarin/test/e4x/Expressions/e11_5_1.as create mode 100644 mozilla/js/tamarin/test/e4x/Expressions/e11_6_1.as create mode 100644 mozilla/js/tamarin/test/e4x/Expressions/e11_6_2.as create mode 100644 mozilla/js/tamarin/test/e4x/Expressions/e11_6_3.as create mode 100644 mozilla/js/tamarin/test/e4x/Expressions/kXMLBadQNameErr.as create mode 100644 mozilla/js/tamarin/test/e4x/Global/e13_1_2_1.as create mode 100644 mozilla/js/tamarin/test/e4x/Global/isXMLNameTypeErr.as create mode 100644 mozilla/js/tamarin/test/e4x/Namespace/e13_2_1.as create mode 100644 mozilla/js/tamarin/test/e4x/Namespace/e13_2_2.as create mode 100644 mozilla/js/tamarin/test/e4x/Namespace/e13_2_3_1.as create mode 100644 mozilla/js/tamarin/test/e4x/Namespace/e13_2_4_1.as create mode 100644 mozilla/js/tamarin/test/e4x/Namespace/e13_2_4_2.as create mode 100644 mozilla/js/tamarin/test/e4x/Namespace/e13_2_5.as create mode 100644 mozilla/js/tamarin/test/e4x/QName/e13_3_1.as create mode 100644 mozilla/js/tamarin/test/e4x/QName/e13_3_2.as create mode 100644 mozilla/js/tamarin/test/e4x/QName/e13_3_3_1.as create mode 100644 mozilla/js/tamarin/test/e4x/QName/e13_3_4_1.as create mode 100644 mozilla/js/tamarin/test/e4x/QName/e13_3_4_2.as create mode 100644 mozilla/js/tamarin/test/e4x/QName/e13_3_5.as create mode 100644 mozilla/js/tamarin/test/e4x/Regress/b121219.as create mode 100644 mozilla/js/tamarin/test/e4x/Regress/error1085.as create mode 100644 mozilla/js/tamarin/test/e4x/Regress/regress-257679.as create mode 100644 mozilla/js/tamarin/test/e4x/Regress/regress-263934.as create mode 100644 mozilla/js/tamarin/test/e4x/Regress/regress-263935.as create mode 100644 mozilla/js/tamarin/test/e4x/Regress/regress-263936.as create mode 100644 mozilla/js/tamarin/test/e4x/Regress/regress-264369.as create mode 100644 mozilla/js/tamarin/test/e4x/Regress/regress-271545.as create mode 100644 mozilla/js/tamarin/test/e4x/Regress/regress-277650.as create mode 100644 mozilla/js/tamarin/test/e4x/Regress/regress-277664.as create mode 100644 mozilla/js/tamarin/test/e4x/Regress/regress-277683.as create mode 100644 mozilla/js/tamarin/test/e4x/Regress/regress-277779.as create mode 100644 mozilla/js/tamarin/test/e4x/Regress/regress-278112.as create mode 100644 mozilla/js/tamarin/test/e4x/Statements/e12_1.as create mode 100644 mozilla/js/tamarin/test/e4x/Statements/e12_2.as create mode 100644 mozilla/js/tamarin/test/e4x/Statements/e12_3.as create mode 100644 mozilla/js/tamarin/test/e4x/TypeConversion/bug153363.as create mode 100644 mozilla/js/tamarin/test/e4x/TypeConversion/bug153363_2.as create mode 100644 mozilla/js/tamarin/test/e4x/TypeConversion/e10_1_1.as create mode 100644 mozilla/js/tamarin/test/e4x/TypeConversion/e10_1_2.as create mode 100644 mozilla/js/tamarin/test/e4x/TypeConversion/e10_2_1.as create mode 100644 mozilla/js/tamarin/test/e4x/TypeConversion/e10_2_1_1.as create mode 100644 mozilla/js/tamarin/test/e4x/TypeConversion/e10_2_1_2.as create mode 100644 mozilla/js/tamarin/test/e4x/TypeConversion/e10_2_2.as create mode 100644 mozilla/js/tamarin/test/e4x/TypeConversion/e10_3.as create mode 100644 mozilla/js/tamarin/test/e4x/TypeConversion/e10_3_1.as create mode 100644 mozilla/js/tamarin/test/e4x/TypeConversion/e10_4.as create mode 100644 mozilla/js/tamarin/test/e4x/TypeConversion/e10_4_1.as create mode 100644 mozilla/js/tamarin/test/e4x/TypeConversion/e10_5.as create mode 100644 mozilla/js/tamarin/test/e4x/TypeConversion/e10_5_1.as create mode 100644 mozilla/js/tamarin/test/e4x/TypeConversion/e10_6.as create mode 100644 mozilla/js/tamarin/test/e4x/TypeConversion/e10_6_1.as create mode 100644 mozilla/js/tamarin/test/e4x/Types/e9_1_1_1.as create mode 100644 mozilla/js/tamarin/test/e4x/Types/e9_1_1_10.as create mode 100644 mozilla/js/tamarin/test/e4x/Types/e9_1_1_11.as create mode 100644 mozilla/js/tamarin/test/e4x/Types/e9_1_1_12.as create mode 100644 mozilla/js/tamarin/test/e4x/Types/e9_1_1_13.as create mode 100644 mozilla/js/tamarin/test/e4x/Types/e9_1_1_2.as create mode 100644 mozilla/js/tamarin/test/e4x/Types/e9_1_1_3.as create mode 100644 mozilla/js/tamarin/test/e4x/Types/e9_1_1_4.as create mode 100644 mozilla/js/tamarin/test/e4x/Types/e9_1_1_5.as create mode 100644 mozilla/js/tamarin/test/e4x/Types/e9_1_1_6.as create mode 100644 mozilla/js/tamarin/test/e4x/Types/e9_1_1_7.as create mode 100644 mozilla/js/tamarin/test/e4x/Types/e9_1_1_8.as create mode 100644 mozilla/js/tamarin/test/e4x/Types/e9_1_1_9.as create mode 100644 mozilla/js/tamarin/test/e4x/Types/e9_2_1_1.as create mode 100644 mozilla/js/tamarin/test/e4x/Types/e9_2_1_10.as create mode 100644 mozilla/js/tamarin/test/e4x/Types/e9_2_1_2.as create mode 100644 mozilla/js/tamarin/test/e4x/Types/e9_2_1_3.as create mode 100644 mozilla/js/tamarin/test/e4x/Types/e9_2_1_4.as create mode 100644 mozilla/js/tamarin/test/e4x/Types/e9_2_1_5.as create mode 100644 mozilla/js/tamarin/test/e4x/Types/e9_2_1_6.as create mode 100644 mozilla/js/tamarin/test/e4x/Types/e9_2_1_7.as create mode 100644 mozilla/js/tamarin/test/e4x/Types/e9_2_1_8.as create mode 100644 mozilla/js/tamarin/test/e4x/Types/e9_2_1_9.as create mode 100644 mozilla/js/tamarin/test/e4x/XML/bug157597.as create mode 100644 mozilla/js/tamarin/test/e4x/XML/bug157597_2.as create mode 100644 mozilla/js/tamarin/test/e4x/XML/bug157735.as create mode 100644 mozilla/js/tamarin/test/e4x/XML/bug158506.as create mode 100644 mozilla/js/tamarin/test/e4x/XML/e13_4_1.as create mode 100644 mozilla/js/tamarin/test/e4x/XML/e13_4_2.as create mode 100644 mozilla/js/tamarin/test/e4x/XML/e13_4_3.as create mode 100644 mozilla/js/tamarin/test/e4x/XML/e13_4_3_1.as create mode 100644 mozilla/js/tamarin/test/e4x/XML/e13_4_3_2.as create mode 100644 mozilla/js/tamarin/test/e4x/XML/e13_4_3_3.as create mode 100644 mozilla/js/tamarin/test/e4x/XML/e13_4_3_4.as create mode 100644 mozilla/js/tamarin/test/e4x/XML/e13_4_3_5.as create mode 100644 mozilla/js/tamarin/test/e4x/XML/e13_4_3_6.as create mode 100644 mozilla/js/tamarin/test/e4x/XML/e13_4_3_7.as create mode 100644 mozilla/js/tamarin/test/e4x/XML/e13_4_3_8.as create mode 100644 mozilla/js/tamarin/test/e4x/XML/e13_4_3_9.as create mode 100644 mozilla/js/tamarin/test/e4x/XML/e13_4_4_1.as create mode 100644 mozilla/js/tamarin/test/e4x/XML/e13_4_4_10.as create mode 100644 mozilla/js/tamarin/test/e4x/XML/e13_4_4_11.as create mode 100644 mozilla/js/tamarin/test/e4x/XML/e13_4_4_12.as create mode 100644 mozilla/js/tamarin/test/e4x/XML/e13_4_4_13.as create mode 100644 mozilla/js/tamarin/test/e4x/XML/e13_4_4_14.as create mode 100644 mozilla/js/tamarin/test/e4x/XML/e13_4_4_15.as create mode 100644 mozilla/js/tamarin/test/e4x/XML/e13_4_4_16.as create mode 100644 mozilla/js/tamarin/test/e4x/XML/e13_4_4_17.as create mode 100644 mozilla/js/tamarin/test/e4x/XML/e13_4_4_18.as create mode 100644 mozilla/js/tamarin/test/e4x/XML/e13_4_4_19.as create mode 100644 mozilla/js/tamarin/test/e4x/XML/e13_4_4_2.as create mode 100644 mozilla/js/tamarin/test/e4x/XML/e13_4_4_20.as create mode 100644 mozilla/js/tamarin/test/e4x/XML/e13_4_4_21.as create mode 100644 mozilla/js/tamarin/test/e4x/XML/e13_4_4_22.as create mode 100644 mozilla/js/tamarin/test/e4x/XML/e13_4_4_23.as create mode 100644 mozilla/js/tamarin/test/e4x/XML/e13_4_4_24.as create mode 100644 mozilla/js/tamarin/test/e4x/XML/e13_4_4_25.as create mode 100644 mozilla/js/tamarin/test/e4x/XML/e13_4_4_26.as create mode 100644 mozilla/js/tamarin/test/e4x/XML/e13_4_4_27.as create mode 100644 mozilla/js/tamarin/test/e4x/XML/e13_4_4_28.as create mode 100644 mozilla/js/tamarin/test/e4x/XML/e13_4_4_29.as create mode 100644 mozilla/js/tamarin/test/e4x/XML/e13_4_4_3.as create mode 100644 mozilla/js/tamarin/test/e4x/XML/e13_4_4_30.as create mode 100644 mozilla/js/tamarin/test/e4x/XML/e13_4_4_31.as create mode 100644 mozilla/js/tamarin/test/e4x/XML/e13_4_4_32.as create mode 100644 mozilla/js/tamarin/test/e4x/XML/e13_4_4_33.as create mode 100644 mozilla/js/tamarin/test/e4x/XML/e13_4_4_34.as create mode 100644 mozilla/js/tamarin/test/e4x/XML/e13_4_4_35.as create mode 100644 mozilla/js/tamarin/test/e4x/XML/e13_4_4_36.as create mode 100644 mozilla/js/tamarin/test/e4x/XML/e13_4_4_37.as create mode 100644 mozilla/js/tamarin/test/e4x/XML/e13_4_4_38.as create mode 100644 mozilla/js/tamarin/test/e4x/XML/e13_4_4_39.as create mode 100644 mozilla/js/tamarin/test/e4x/XML/e13_4_4_4.as create mode 100644 mozilla/js/tamarin/test/e4x/XML/e13_4_4_40.as create mode 100644 mozilla/js/tamarin/test/e4x/XML/e13_4_4_5.as create mode 100644 mozilla/js/tamarin/test/e4x/XML/e13_4_4_6.as create mode 100644 mozilla/js/tamarin/test/e4x/XML/e13_4_4_7.as create mode 100644 mozilla/js/tamarin/test/e4x/XML/e13_4_4_8.as create mode 100644 mozilla/js/tamarin/test/e4x/XML/e13_4_4_9.as create mode 100644 mozilla/js/tamarin/test/e4x/XML/kXMLAssignmentToIndexedXMLNotAllowedErr.as create mode 100644 mozilla/js/tamarin/test/e4x/XML/kXMLMarkupMustBeWellFormedErr.as create mode 100644 mozilla/js/tamarin/test/e4x/XML/kXMLPrefixNotBoundErr.as create mode 100644 mozilla/js/tamarin/test/e4x/XML/kXMLUnterminatedElementTagErr.as create mode 100644 mozilla/js/tamarin/test/e4x/XML/misc_errors.as create mode 100644 mozilla/js/tamarin/test/e4x/XMLList/bug157735.as create mode 100644 mozilla/js/tamarin/test/e4x/XMLList/e13_5_1.as create mode 100644 mozilla/js/tamarin/test/e4x/XMLList/e13_5_2.as create mode 100644 mozilla/js/tamarin/test/e4x/XMLList/e13_5_3_1.as create mode 100644 mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_1.as create mode 100644 mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_10.as create mode 100644 mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_11.as create mode 100644 mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_12.as create mode 100644 mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_13.as create mode 100644 mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_14.as create mode 100644 mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_15.as create mode 100644 mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_16.as create mode 100644 mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_17.as create mode 100644 mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_18.as create mode 100644 mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_19.as create mode 100644 mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_2.as create mode 100644 mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_20.as create mode 100644 mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_21.as create mode 100644 mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_22.as create mode 100644 mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_3.as create mode 100644 mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_4.as create mode 100644 mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_5.as create mode 100644 mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_6.as create mode 100644 mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_7.as create mode 100644 mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_8.as create mode 100644 mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_9.as create mode 100644 mozilla/js/tamarin/test/e4x/XMLList/kXMLOnlyWorksWithOneItemListsErr.as create mode 100644 mozilla/js/tamarin/test/ecma3/Array/e15_4_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Array/e15_4_1_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Array/e15_4_1_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Array/e15_4_1_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/Array/e15_4_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Array/e15_4_2_1_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Array/e15_4_2_1_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Array/e15_4_2_1_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/Array/e15_4_2_2_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Array/e15_4_2_2_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Array/e15_4_2_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/Array/e15_4_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/Array/e15_4_3_1_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Array/e15_4_3_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Array/e15_4_4.as create mode 100644 mozilla/js/tamarin/test/ecma3/Array/e15_4_4_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Array/e15_4_4_10.as create mode 100644 mozilla/js/tamarin/test/ecma3/Array/e15_4_4_11.as create mode 100644 mozilla/js/tamarin/test/ecma3/Array/e15_4_4_12.as create mode 100644 mozilla/js/tamarin/test/ecma3/Array/e15_4_4_13.as create mode 100644 mozilla/js/tamarin/test/ecma3/Array/e15_4_4_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Array/e15_4_4_3_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Array/e15_4_4_4_001.as create mode 100644 mozilla/js/tamarin/test/ecma3/Array/e15_4_4_4_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Array/e15_4_4_4_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Array/e15_4_4_5.as create mode 100644 mozilla/js/tamarin/test/ecma3/Array/e15_4_4_5_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Array/e15_4_4_5_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Array/e15_4_4_5_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/Array/e15_4_4_6.as create mode 100644 mozilla/js/tamarin/test/ecma3/Array/e15_4_4_6_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Array/e15_4_4_7.as create mode 100644 mozilla/js/tamarin/test/ecma3/Array/e15_4_4_8.as create mode 100644 mozilla/js/tamarin/test/ecma3/Array/e15_4_4_9.as create mode 100644 mozilla/js/tamarin/test/ecma3/Array/e15_4_4_9_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Array/e15_4_5_1_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Array/e15_4_5_1_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Array/e15_4_5_2_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Array/e15_4_5_2_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Array/e15_4__1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Array/eregress_130451.as create mode 100644 mozilla/js/tamarin/test/ecma3/Array/general1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Array/general2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Array/general3.as create mode 100644 mozilla/js/tamarin/test/ecma3/Array/slice.as create mode 100644 mozilla/js/tamarin/test/ecma3/Array/sortOn.as create mode 100644 mozilla/js/tamarin/test/ecma3/Array/sparseArray.as create mode 100644 mozilla/js/tamarin/test/ecma3/Array/splice1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Array/splice2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Array/toLocaleString.as create mode 100644 mozilla/js/tamarin/test/ecma3/Boolean/e15_6_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Boolean/e15_6_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Boolean/e15_6_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/Boolean/e15_6_3_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Boolean/e15_6_3_1_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Boolean/e15_6_3_1_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Boolean/e15_6_3_1_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/Boolean/e15_6_3_1_4.as create mode 100644 mozilla/js/tamarin/test/ecma3/Boolean/e15_6_3_1_5.as create mode 100644 mozilla/js/tamarin/test/ecma3/Boolean/e15_6_4.as create mode 100644 mozilla/js/tamarin/test/ecma3/Boolean/e15_6_4_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Boolean/e15_6_4_2_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Boolean/e15_6_4_2_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Boolean/e15_6_4_2_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/Boolean/e15_6_4_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/Boolean/e15_6_4_3_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Boolean/e15_6_4_3_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Boolean/e15_6_4_3_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/Boolean/e15_6_4__1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Boolean/ecma4_sealedtype_1_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Boolean/ecma4_sealedtype_2_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Boolean/ecma4_sealedtype_3_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Boolean/ecma4_sealedtype_4_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Boolean/ecma4_sealedtype_5_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Boolean/ecma4_st_valueOf_1_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Boolean/ecma4_st_valueOf_2_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Boolean/ecma4_st_valueOf_3_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Boolean/ecma4_st_valueOf_4_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Boolean/ecma4_st_valueOf_5_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_1_1_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_1_1_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_2_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_2_2_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_2_2_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_2_2_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_2_2_4.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_2_2_5.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_2_2_6.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_3_1_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_3_1_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_3_1_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_3_1_4.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_3_1_5.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_3_2_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_3_2_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_3_2_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_3_2_4.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_3_2_5.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_3_8_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_3_8_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_3_8_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_3_8_4.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_3_8_5.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_4_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_4_2_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_4_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_10.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_10_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_10_10.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_10_11.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_10_12.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_10_13.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_10_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_10_4.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_10_5.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_10_6.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_10_7.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_10_8.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_10_9.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_11.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_11_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_11_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_11_4.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_11_5.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_11_6.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_11_7.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_12.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_12_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_12_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_12_4.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_12_5.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_12_6.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_12_7.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_12_8.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_13.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_13_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_13_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_13_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_13_4.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_13_5.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_13_6.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_13_7.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_13_8.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_14.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_15.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_15_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_16.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_17.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_17_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_18.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_19.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_20.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_21_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_21_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_21_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_21_4.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_21_5.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_21_6.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_21_7.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_21_8.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_22_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_22_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_22_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_22_4.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_22_5.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_22_6.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_22_7.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_22_8.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_10.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_11.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_12.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_13.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_14.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_15.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_16.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_17.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_18.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_3_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_4.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_5.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_6.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_7.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_8.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_9.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_24_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_24_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_24_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_24_4.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_24_5.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_24_6.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_24_7.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_24_8.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_25_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_26_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_27_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_28_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_29_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_2_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_2_2_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_30_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_31_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_32_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_33_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_34_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_35_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_36_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_36_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_36_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_36_4.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_36_5.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_36_6.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_36_7.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_37_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_37_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_37_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_37_4.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_37_5.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_3_1_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_3_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_4.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_42.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_4_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_4_2_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_5.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_6.as create mode 100644 mozilla/js/tamarin/test/ecma3/Date/e15_9_5_7.as create mode 100644 mozilla/js/tamarin/test/ecma3/ErrorObject/e15_11_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/ErrorObject/e15_11_2_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Exceptions/binding_001.as create mode 100644 mozilla/js/tamarin/test/ecma3/Exceptions/boolean_001_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Exceptions/boolean_002_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Exceptions/bug127913.as create mode 100644 mozilla/js/tamarin/test/ecma3/Exceptions/date_001_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Exceptions/date_002_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Exceptions/date_003_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Exceptions/date_004_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Exceptions/e15_11_4_4_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Exceptions/exception_001_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Exceptions/exception_002_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Exceptions/exception_003_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Exceptions/exception_004_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Exceptions/exception_005_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Exceptions/exception_006_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Exceptions/exception_007_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Exceptions/exception_009.as create mode 100644 mozilla/js/tamarin/test/ecma3/Exceptions/exception_010_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Exceptions/exception_011_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Exceptions/exception_014_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Exceptions/expression_002_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Exceptions/expression_003_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Exceptions/expression_004_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Exceptions/expression_005_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Exceptions/expression_006_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Exceptions/expression_007_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Exceptions/expression_008_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Exceptions/expression_009_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Exceptions/expression_010_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Exceptions/expression_011_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Exceptions/expression_012_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Exceptions/expression_013_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Exceptions/expression_014_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Exceptions/expression_016_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Exceptions/expression_017_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Exceptions/expression_019_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Exceptions/global_001_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Exceptions/global_002_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Exceptions/number_001_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Exceptions/number_002_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Exceptions/number_003_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Exceptions/number_004_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Exceptions/regress_58946.as create mode 100644 mozilla/js/tamarin/test/ecma3/Exceptions/regress_95101.as create mode 100644 mozilla/js/tamarin/test/ecma3/Exceptions/string_001_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Exceptions/string_002_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/ExecutionContexts/e10_1_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/ExecutionContexts/e10_1_3_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/ExecutionContexts/e10_1_4_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/ExecutionContexts/e10_1_4_10.as create mode 100644 mozilla/js/tamarin/test/ecma3/ExecutionContexts/e10_1_4_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/ExecutionContexts/e10_1_4_8.as create mode 100644 mozilla/js/tamarin/test/ecma3/ExecutionContexts/e10_1_4_9.as create mode 100644 mozilla/js/tamarin/test/ecma3/ExecutionContexts/e10_1_5_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/ExecutionContexts/e10_1_5_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/ExecutionContexts/e10_1_5_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/ExecutionContexts/e10_1_5_4.as create mode 100644 mozilla/js/tamarin/test/ecma3/ExecutionContexts/e10_1_6.as create mode 100644 mozilla/js/tamarin/test/ecma3/ExecutionContexts/e10_1_8_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/ExecutionContexts/e10_1_8_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/ExecutionContexts/e10_2_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/ExecutionContexts/e10_2_3_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/ExecutionContexts/e10_2_3_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/StrictEquality_001.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_10_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_10_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_10_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_11.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_12_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_12_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_12_4.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_13.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_13_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_13_2_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_13_2_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_13_2_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_13_2_4.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_13_2_5.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_14_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_1_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_1_4.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_1_5.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_1_6.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_2_1_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_2_1_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_2_1_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_2_1_4_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_2_1_5.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_2_2_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_2_2_10_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_2_2_11.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_2_2_12_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_2_2_1_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_2_2_2_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_2_2_3_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_2_2_4_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_2_2_5_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_2_2_6_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_2_2_7_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_2_2_8_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_2_2_9_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_2_3_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_2_3_3_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_2_3_4_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_2_3_5.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_2_4.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_3_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_3_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_4_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_4_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_4_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_4_4.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_4_5.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_4_6.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_4_7.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_4_8.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_4_9.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_5_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_5_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_5_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_6_1_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_6_1_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_6_1_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_6_2_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_6_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_7_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_7_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_7_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_8_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_8_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_8_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_8_4.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_8_7.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_9_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_9_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_9_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_9_4.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_9_5.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/e11_9_6_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/instanceof_001.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/instanceof_002.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/instanceof_003_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/instanceof_004_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Expressions/instanceof_006.as create mode 100644 mozilla/js/tamarin/test/ecma3/Function/call_001_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Function/e15_3_4_3_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Function/e15_3_4_4_1_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Function/e15_3_FPQA.as create mode 100644 mozilla/js/tamarin/test/ecma3/Function/function.as create mode 100644 mozilla/js/tamarin/test/ecma3/Function/regress_104584.as create mode 100644 mozilla/js/tamarin/test/ecma3/Function/regress_137181.as create mode 100644 mozilla/js/tamarin/test/ecma3/Function/regress_49286.as create mode 100644 mozilla/js/tamarin/test/ecma3/Function/regress_58274_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Function/regress_97921.as create mode 100644 mozilla/js/tamarin/test/ecma3/Function/scope_001_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Function/scope_002.as create mode 100644 mozilla/js/tamarin/test/ecma3/FunctionObjects/e15_3_1_1_1_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/FunctionObjects/e15_3_1_1_2_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/FunctionObjects/e15_3_1_1_3_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/FunctionObjects/e15_3_2_1_1_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/FunctionObjects/e15_3_2_1_2_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/FunctionObjects/e15_3_2_1_3_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/FunctionObjects/e15_3_3_1_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/FunctionObjects/e15_3_3_1_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/FunctionObjects/e15_3_3_1_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/FunctionObjects/e15_3_3_1_4.as create mode 100644 mozilla/js/tamarin/test/ecma3/FunctionObjects/e15_3_3_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/FunctionObjects/e15_3_4_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/FunctionObjects/e15_3_4_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/FunctionObjects/e15_3_4__1_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/FunctionObjects/e15_3_4_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/FunctionObjects/e15_3_5_1_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/FunctionObjects/e15_3_5_2_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/FunctionObjects/e15_3_5_3_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/FunctionObjects/e15_3_5__1_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/FunctionObjects/eapply_001_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/FunctionObjects/ecall_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/GlobalObject/decodeURI.as create mode 100644 mozilla/js/tamarin/test/ecma3/GlobalObject/decodeURIComponent.as create mode 100644 mozilla/js/tamarin/test/ecma3/GlobalObject/e15_1_1_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/GlobalObject/e15_1_1_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/GlobalObject/e15_1_1_n.as create mode 100644 mozilla/js/tamarin/test/ecma3/GlobalObject/e15_1_2_1_2_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/GlobalObject/e15_1_2_2_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/GlobalObject/e15_1_2_2_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/GlobalObject/e15_1_2_3_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/GlobalObject/e15_1_2_3_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/GlobalObject/e15_1_2_4.as create mode 100644 mozilla/js/tamarin/test/ecma3/GlobalObject/e15_1_2_5_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/GlobalObject/e15_1_2_5_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/GlobalObject/e15_1_2_5_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/GlobalObject/e15_1_2_6.as create mode 100644 mozilla/js/tamarin/test/ecma3/GlobalObject/e15_1_2_7.as create mode 100644 mozilla/js/tamarin/test/ecma3/GlobalObject/e15_1_2_n.as create mode 100644 mozilla/js/tamarin/test/ecma3/GlobalObject/e15_1_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/GlobalObject/encodeURI.as create mode 100644 mozilla/js/tamarin/test/ecma3/GlobalObject/encodeURIComponent.as create mode 100644 mozilla/js/tamarin/test/ecma3/GlobalObject/undefined.as create mode 100644 mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_1_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_2_10_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_2_2_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_2_3_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_2_4_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_2_5_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_2_6_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_2_7_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_2_8_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_2_9_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_3_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_3_10.as create mode 100644 mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_3_11.as create mode 100644 mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_3_12.as create mode 100644 mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_3_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_3_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_3_4.as create mode 100644 mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_3_5.as create mode 100644 mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_3_6.as create mode 100644 mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_3_7.as create mode 100644 mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_3_9.as create mode 100644 mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_5_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_5_6.as create mode 100644 mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_5_7.as create mode 100644 mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_6.as create mode 100644 mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_7_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_7_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_7_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_7_3_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_7_3_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_7_4.as create mode 100644 mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_9_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/LexicalConventions/eregexp_literals_001.as create mode 100644 mozilla/js/tamarin/test/ecma3/LexicalConventions/eregexp_literals_002.as create mode 100644 mozilla/js/tamarin/test/ecma3/Math/e15_8_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Math/e15_8_1_1_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Math/e15_8_1_1_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Math/e15_8_1_2_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Math/e15_8_1_2_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Math/e15_8_1_3_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Math/e15_8_1_3_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Math/e15_8_1_4_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Math/e15_8_1_4_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Math/e15_8_1_5_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Math/e15_8_1_5_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Math/e15_8_1_6_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Math/e15_8_1_6_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Math/e15_8_1_7_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Math/e15_8_1_7_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Math/e15_8_1_8_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Math/e15_8_1_8_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Math/e15_8_1_8_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/Math/e15_8_2_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Math/e15_8_2_10.as create mode 100644 mozilla/js/tamarin/test/ecma3/Math/e15_8_2_11.as create mode 100644 mozilla/js/tamarin/test/ecma3/Math/e15_8_2_12.as create mode 100644 mozilla/js/tamarin/test/ecma3/Math/e15_8_2_13.as create mode 100644 mozilla/js/tamarin/test/ecma3/Math/e15_8_2_14.as create mode 100644 mozilla/js/tamarin/test/ecma3/Math/e15_8_2_15.as create mode 100644 mozilla/js/tamarin/test/ecma3/Math/e15_8_2_16.as create mode 100644 mozilla/js/tamarin/test/ecma3/Math/e15_8_2_17.as create mode 100644 mozilla/js/tamarin/test/ecma3/Math/e15_8_2_17_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Math/e15_8_2_18.as create mode 100644 mozilla/js/tamarin/test/ecma3/Math/e15_8_2_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Math/e15_8_2_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/Math/e15_8_2_4.as create mode 100644 mozilla/js/tamarin/test/ecma3/Math/e15_8_2_5.as create mode 100644 mozilla/js/tamarin/test/ecma3/Math/e15_8_2_6.as create mode 100644 mozilla/js/tamarin/test/ecma3/Math/e15_8_2_7.as create mode 100644 mozilla/js/tamarin/test/ecma3/Math/e15_8_2_8.as create mode 100644 mozilla/js/tamarin/test/ecma3/Math/e15_8_2_9.as create mode 100644 mozilla/js/tamarin/test/ecma3/Math/e15_8_2_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Math/e15_8_3_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Math/e15_8__1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Misc/smoke.as create mode 100644 mozilla/js/tamarin/test/ecma3/NativeObjects/e15_2_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Number/e15_7_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Number/e15_7_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Number/e15_7_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/Number/e15_7_3_1_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Number/e15_7_3_1_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Number/e15_7_3_1_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/Number/e15_7_3_2_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Number/e15_7_3_2_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Number/e15_7_3_2_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/Number/e15_7_3_2_4.as create mode 100644 mozilla/js/tamarin/test/ecma3/Number/e15_7_3_3_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Number/e15_7_3_3_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Number/e15_7_3_3_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/Number/e15_7_3_3_4.as create mode 100644 mozilla/js/tamarin/test/ecma3/Number/e15_7_3_4_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Number/e15_7_3_4_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Number/e15_7_3_4_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/Number/e15_7_3_4_4.as create mode 100644 mozilla/js/tamarin/test/ecma3/Number/e15_7_3_5_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Number/e15_7_3_5_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Number/e15_7_3_5_3_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Number/e15_7_3_5_4.as create mode 100644 mozilla/js/tamarin/test/ecma3/Number/e15_7_3_6_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Number/e15_7_3_6_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Number/e15_7_3_6_3_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Number/e15_7_3_6_4.as create mode 100644 mozilla/js/tamarin/test/ecma3/Number/e15_7_4_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Number/e15_7_4_2_1_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Number/e15_7_4_2_2_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Number/e15_7_4_2_3_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Number/e15_7_4_2_4.as create mode 100644 mozilla/js/tamarin/test/ecma3/Number/e15_7_4_3_1_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Number/e15_7_4_3_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Number/e15_7_4_3_3_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Number/e15_7_4_6_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Number/e15_7_4_7_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Number/e15_7_4__1_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Number/e15_7_4_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Number/ecma4_sealedtype_1_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Number/ecma4_sealedtype_2_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Number/ecma4_sealedtype_3_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Number/ecma4_sealedtype_4_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Number/ecma4_st_valueOf_1_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Number/ecma4_st_valueOf_2_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Number/ecma4_st_valueOf_3_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Number/eregress_121952.as create mode 100644 mozilla/js/tamarin/test/ecma3/Number/toLocaleString2_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Number/toLocaleString3_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Number/toLocaleString4_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Number/toLocaleString_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Number/tostring_001.as create mode 100644 mozilla/js/tamarin/test/ecma3/ObjectObjects/bug129539.as create mode 100644 mozilla/js/tamarin/test/ecma3/ObjectObjects/class_001.as create mode 100644 mozilla/js/tamarin/test/ecma3/ObjectObjects/class_002.as create mode 100644 mozilla/js/tamarin/test/ecma3/ObjectObjects/class_003.as create mode 100644 mozilla/js/tamarin/test/ecma3/ObjectObjects/class_004.as create mode 100644 mozilla/js/tamarin/test/ecma3/ObjectObjects/class_005.as create mode 100644 mozilla/js/tamarin/test/ecma3/ObjectObjects/class_006.as create mode 100644 mozilla/js/tamarin/test/ecma3/ObjectObjects/e15_2_1_1_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/ObjectObjects/e15_2_1_2_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/ObjectObjects/e15_2_2_1_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/ObjectObjects/e15_2_2_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/ObjectObjects/e15_2_3_1_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/ObjectObjects/e15_2_3_1_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/ObjectObjects/e15_2_3_1_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/ObjectObjects/e15_2_3_1_4.as create mode 100644 mozilla/js/tamarin/test/ecma3/ObjectObjects/e15_2_3_1_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/ObjectObjects/e15_2_3_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/ObjectObjects/e15_2_4_1_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/ObjectObjects/e15_2_4_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/ObjectObjects/e15_2_4_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/ObjectObjects/e8_6_2_6_001.as create mode 100644 mozilla/js/tamarin/test/ecma3/ObjectObjects/hasOwnProperty.as create mode 100644 mozilla/js/tamarin/test/ecma3/ObjectObjects/isPrototypeOf.as create mode 100644 mozilla/js/tamarin/test/ecma3/ObjectObjects/propertyIsEnumerable.as create mode 100644 mozilla/js/tamarin/test/ecma3/ObjectObjects/regress_72773_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/ObjectObjects/regress_79129_001.as create mode 100644 mozilla/js/tamarin/test/ecma3/ObjectObjects/toLocaleString_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/RegExp/e15_10_2_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/RegExp/e15_10_3_1_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/RegExp/e15_10_3_1_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/RegExp/e15_10_4_1_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/RegExp/e15_10_4_1_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/RegExp/e15_10_4_1_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/RegExp/e15_10_4_1_4.as create mode 100644 mozilla/js/tamarin/test/ecma3/RegExp/e15_10_4_1_5_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/RegExp/e15_10_6_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/RegExp/e15_10_6_2_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/RegExp/e15_10_6_2_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/RegExp/e15_10_6_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/RegExp/e15_10_6_4.as create mode 100644 mozilla/js/tamarin/test/ecma3/RegExp/econstructor_001.as create mode 100644 mozilla/js/tamarin/test/ecma3/RegExp/eexec_001.as create mode 100644 mozilla/js/tamarin/test/ecma3/RegExp/eexec_002.as create mode 100644 mozilla/js/tamarin/test/ecma3/RegExp/efunction_001.as create mode 100644 mozilla/js/tamarin/test/ecma3/RegExp/ehex_001.as create mode 100644 mozilla/js/tamarin/test/ecma3/RegExp/emultiline_001.as create mode 100644 mozilla/js/tamarin/test/ecma3/RegExp/eoctal_001.as create mode 100644 mozilla/js/tamarin/test/ecma3/RegExp/eoctal_003.as create mode 100644 mozilla/js/tamarin/test/ecma3/RegExp/eperlstress_001.as create mode 100644 mozilla/js/tamarin/test/ecma3/RegExp/eperlstress_002.as create mode 100644 mozilla/js/tamarin/test/ecma3/RegExp/eproperties_001.as create mode 100644 mozilla/js/tamarin/test/ecma3/RegExp/eproperties_002.as create mode 100644 mozilla/js/tamarin/test/ecma3/RegExp/eregexp_enumerate_001.as create mode 100644 mozilla/js/tamarin/test/ecma3/RegExp/eregress_001.as create mode 100644 mozilla/js/tamarin/test/ecma3/RegExp/eregress_100199.as create mode 100644 mozilla/js/tamarin/test/ecma3/RegExp/eregress_103087.as create mode 100644 mozilla/js/tamarin/test/ecma3/RegExp/eregress_105972.as create mode 100644 mozilla/js/tamarin/test/ecma3/RegExp/eregress_119909.as create mode 100644 mozilla/js/tamarin/test/ecma3/RegExp/eregress_122076.as create mode 100644 mozilla/js/tamarin/test/ecma3/RegExp/eregress_123437.as create mode 100644 mozilla/js/tamarin/test/ecma3/RegExp/eregress_165353.as create mode 100644 mozilla/js/tamarin/test/ecma3/RegExp/eregress_169497.as create mode 100644 mozilla/js/tamarin/test/ecma3/RegExp/eregress_169534.as create mode 100644 mozilla/js/tamarin/test/ecma3/RegExp/eregress_170798.as create mode 100644 mozilla/js/tamarin/test/ecma3/RegExp/eregress_171999.as create mode 100644 mozilla/js/tamarin/test/ecma3/RegExp/eregress_28686.as create mode 100644 mozilla/js/tamarin/test/ecma3/RegExp/eregress_31316.as create mode 100644 mozilla/js/tamarin/test/ecma3/RegExp/eregress_57631.as create mode 100644 mozilla/js/tamarin/test/ecma3/RegExp/eregress_67773.as create mode 100644 mozilla/js/tamarin/test/ecma3/RegExp/eregress_72964.as create mode 100644 mozilla/js/tamarin/test/ecma3/RegExp/eregress_76683.as create mode 100644 mozilla/js/tamarin/test/ecma3/RegExp/eregress_78156.as create mode 100644 mozilla/js/tamarin/test/ecma3/RegExp/eregress_87231.as create mode 100644 mozilla/js/tamarin/test/ecma3/RegExp/eregress_98306.as create mode 100644 mozilla/js/tamarin/test/ecma3/RegExp/eunicode_001.as create mode 100644 mozilla/js/tamarin/test/ecma3/RegExp/multibyte_regress.as create mode 100644 mozilla/js/tamarin/test/ecma3/SourceText/e6_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/SourceText/e6_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/block.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/e12_10.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/e12_10_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/e12_2_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/e12_5_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/e12_5_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/e12_5_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/e12_6_1_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/e12_6_2_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/e12_6_2_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/e12_6_2_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/e12_6_2_4.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/e12_6_2_5.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/e12_6_2_6.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/e12_6_2_7.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/e12_6_2_8.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/e12_6_3_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/e12_6_3_10.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/e12_6_3_11.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/e12_6_3_12.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/e12_6_3_19.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/e12_6_3_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/e12_6_3_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/e12_6_3_4.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/e12_6_3_9_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/e12_9_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/edowhile_001.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/edowhile_002.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/edowhile_003.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/edowhile_004.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/edowhile_005.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/edowhile_006.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/edowhile_007.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/eforin_001.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/eforin_002.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/eif_001.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/elabel_001.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/elabel_002.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/eregress_131348.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/eregress_74474_001.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/eregress_74474_002.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/eregress_74474_003.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/eregress_83532_001.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/eregress_83532_002.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/eswitch_001.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/eswitch_002.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/eswitch_003.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/eswitch_004.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/etry_001.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/etry_003.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/etry_004.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/etry_005.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/etry_006.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/etry_007.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/etry_008.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/etry_009.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/etry_010.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/etry_012.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/ewhile_001.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/ewhile_002.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/ewhile_003.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/ewhile_004.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/expression.as create mode 100644 mozilla/js/tamarin/test/ecma3/Statements/throw.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/Split.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/concat.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/e15_5_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/e15_5_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/e15_5_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/e15_5_3_1_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/e15_5_3_1_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/e15_5_3_1_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/e15_5_3_1_4.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/e15_5_3_2_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/e15_5_3_2_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/e15_5_3_2_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/e15_5_4.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/e15_5_4_10_1_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/e15_5_4_11_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/e15_5_4_11_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/e15_5_4_11_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/e15_5_4_11_4.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/e15_5_4_11_5.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/e15_5_4_11_6.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/e15_5_4_12_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/e15_5_4_12_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/e15_5_4_12_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/e15_5_4_12_4.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/e15_5_4_12_5.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/e15_5_4_13.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/e15_5_4_1_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/e15_5_4_2_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/e15_5_4_2_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/e15_5_4_2_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/e15_5_4_3_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/e15_5_4_3_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/e15_5_4_3_3_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/e15_5_4_4_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/e15_5_4_4_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/e15_5_4_4_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/e15_5_4_4_4_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/e15_5_4_5_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/e15_5_4_5_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/e15_5_4_5_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/e15_5_4_5_4.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/e15_5_4_5_5.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/e15_5_4_5_6_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/e15_5_4_6_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/e15_5_4_6_2_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/e15_5_4_7_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/e15_5_4_7_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/e15_5_4_7_3_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/e15_5_4_8_1_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/e15_5_4_8_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/e15_5_4_8_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/e15_5_4_9_1_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/e15_5_5_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/ematch_001.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/ematch_002.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/ematch_003.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/ematch_004.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/eregress_104375.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/eregress_137879.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/eregress_137890.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/eregress_83293.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/ereplace_001.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/esplit_001.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/esplit_002.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/esplit_003.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/localeCompare_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/search.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/substr.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/toLocaleLowerCase.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/toLocaleLowerCase2.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/toLocaleLowerCase3.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/toLocaleLowerCase4.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/toLocaleLowerCase5.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/toLocaleLowerCase6.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/toLocaleUpperCase.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/toLocaleUpperCase2.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/toLocaleUpperCase3.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/toLocaleUpperCase4.as create mode 100644 mozilla/js/tamarin/test/ecma3/String/toLocaleUpperCase5.as create mode 100644 mozilla/js/tamarin/test/ecma3/TypeConversion/e9_2_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/TypeConversion/e9_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/TypeConversion/e9_3_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/TypeConversion/e9_3_1_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/TypeConversion/e9_3_1_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/TypeConversion/e9_3_1_3_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/TypeConversion/e9_4_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/TypeConversion/e9_4_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/TypeConversion/e9_5_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/TypeConversion/e9_6.as create mode 100644 mozilla/js/tamarin/test/ecma3/TypeConversion/e9_7.as create mode 100644 mozilla/js/tamarin/test/ecma3/TypeConversion/e9_8_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/TypeConversion/e9_9_1_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/Types/e8_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Types/e8_2.as create mode 100644 mozilla/js/tamarin/test/ecma3/Types/e8_3.as create mode 100644 mozilla/js/tamarin/test/ecma3/Types/e8_4.as create mode 100644 mozilla/js/tamarin/test/ecma3/Types/e8_5.as create mode 100644 mozilla/js/tamarin/test/ecma3/Types/e8_6_1.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u0000_BasicLatin.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u0080_Latin_1Supplement.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u0100_LatinExtended_A.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u0180_LatinExtended_B.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u0250_IPAExtensions.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u02B0_SpacingModifierLetters.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u0300_CombiningDiacriticalMarks.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u0370_GreekandCoptic.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u0400_Cyrillic.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u0500_CyrillicSupplementary.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u0530_Armenian.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u0590_Hebrew.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u0600_Arabic.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u0700_Syriac.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u0780_Thaana.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u0900_Devanagari.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u0980_Bengali.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u0A00_Gurmukhi.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u0A80_Gujarati.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u0B00_Oriya.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u0B80_Tamil.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u0C00_Telugu.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u0C80_Kannada.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u0D00_Malayalam.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u0D80_Sinhala.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u0E00_Thai.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u0E80_Lao.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u0F00_Tibetan.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u1000_Myanmar.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u10A0_Georgian.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u1100_HangulJamo.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u1200_Ethiopic.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u13A0_Cherokee.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u1400_UnifiedCanadianAboriginalSyllabics.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u1680_Ogham.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u16A0_Runic.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u1700_Tagalog.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u1720_Hanunoo.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u1740_Buhid.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u1760_Tagbanwa.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u1780_Khmer.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u1800_Mongolian.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u1E00_LatinExtendedAdditional.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u1F00_GreekExtended.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u2000_GeneralPunctuation.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u2070_SuperscriptsandSubscripts.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u20A0_CurrencySymbols.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u20D0_CombiningDiacriticalMarksforSymbols.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u2100_LetterlikeSymbols.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u2150_NumberForms.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u2190_Arrows.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u2200_MathematicalOperators.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u2300_MiscellaneousTechnical.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u2400_ControlPictures.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u2440_OpticalCharacterRecognition.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u2460_EnclosedAlphanumerics.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u2500_BoxDrawing.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u2580_BlockElements.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u25A0_GeometricShapes.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u2600_MiscellaneousSymbols.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u2700_Dingbats.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u27C0_MiscellaneousMathematicalSymbols_A.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u27F0_SupplementalArrows_A.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u2800_BraillePatterns.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u2900_SupplementalArrows_B.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u2980_MiscellaneousMathematicalSymbols_B.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u2A00_SupplementalMathematicalOperators.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u2E80_CJKRadicalsSupplement.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u2F00_KangxiRadicals.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u2FF0_IdeographicDescriptionCharacters.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u3000_CJKSymbolsandPunctuation.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u3040_Hiragana.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u30A0_Katakana.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u3100_Bopomofo.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u3130_HangulCompatibilityJamo.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u3190_Kanbun.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u31A0_BopomofoExtended.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u31F0_KatakanaPhoneticExtensions.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u3200_EnclosedCJKLettersandMonths.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u3300_CJKCompatibility.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u3400_CJKUnifiedIdeographsExtensionA.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u4E00_CJKUnifiedIdeographs.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u5000_CJKUnifiedIdeographs.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u6000_CJKUnifiedIdeographs.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u7000_CJKUnifiedIdeographs.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u8000_CJKUnifiedIdeographs.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/u9000_CJKUnifiedIdeographs.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/uA000_YiSyllables.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/uA490_YiRadicals.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/uAC00_HangulSyllables.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/uD800_HighSurrogates.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/uDB80_HighPrivateUseSurrogates.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/uDC00_LowSurrogates.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/uE000_PrivateUseArea.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/uF900_CJKCompatibilityIdeographs.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/uFB00_AlphabeticPresentationForms.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/uFB50_ArabicPresentationForms_A.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/uFE00_VariationSelectors.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/uFE20_CombiningHalfMarks.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/uFE30_CJKCompatibilityForms.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/uFE50_SmallFormVariants.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/uFE70_ArabicPresentationForms_B.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/uFF00_HalfwidthandFullwidthForms.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/uFFF0_Specials.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/uc_001.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/uc_003.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/uc_004.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/uc_005.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/uc_006.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/unicodeNegativeUtil.as create mode 100644 mozilla/js/tamarin/test/ecma3/Unicode/unicodeUtil.as create mode 100644 mozilla/js/tamarin/test/ecma3/instanceof/instanceof_001.as create mode 100644 mozilla/js/tamarin/test/ecma3/instanceof/instanceof_002.as create mode 100644 mozilla/js/tamarin/test/ecma3/instanceof/instanceof_003_rt.as create mode 100644 mozilla/js/tamarin/test/ecma3/instanceof/regress_7635_rt.as create mode 100644 mozilla/js/tamarin/test/shell.as create mode 100644 mozilla/js/tamarin/utils/abcdump.as create mode 100644 mozilla/js/tamarin/utils/errorgen.as create mode 100644 mozilla/js/tamarin/utils/modules.txt create mode 100644 mozilla/js/tamarin/utils/opcodes.as create mode 100644 mozilla/js/tamarin/utils/stale diff --git a/mozilla/js/tamarin/MMgc/FixedAlloc.cpp b/mozilla/js/tamarin/MMgc/FixedAlloc.cpp new file mode 100644 index 00000000000..7b812b3eb28 --- /dev/null +++ b/mozilla/js/tamarin/MMgc/FixedAlloc.cpp @@ -0,0 +1,216 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include +#include +#include + +#include "MMgc.h" + +#define kBlockHeadSize offsetof(MMgc::FixedAlloc::FixedBlock, items) + +namespace MMgc +{ + FixedAlloc::FixedAlloc(int itemSize, GCHeap* heap) + { + m_heap = heap; + + m_firstBlock = NULL; + m_lastBlock = NULL; + m_firstFree = NULL; + m_maxAlloc = 0; + +#ifdef MEMORY_INFO + itemSize += DebugSize(); +#endif + + m_itemSize = itemSize; + + // The number of items per block is kBlockSize minus + // the # of pointers at the base of each page. + size_t usableSpace = GCHeap::kBlockSize - kBlockHeadSize; + m_itemsPerBlock = usableSpace / m_itemSize; + } + + FixedAlloc::~FixedAlloc() + { + // Free all of the blocks + while (m_firstBlock) { +#ifdef MEMORY_INFO + if(m_firstBlock->numAlloc > 0) { + // go through every memory location, if the fourth 4 bytes cast as + // an integer isn't 0xedededed then its allocated space and the integer is + // an index into the stack trace table, the first 4 bytes will contain + // the freelist pointer for free'd items (which is why the trace index is + // stored in the second 4) + // first 4 bytes - free list pointer + // 2nd 4 bytes - alloc stack trace + // 3rd 4 bytes - free stack trace + // 4th 4 bytes - 0xedededed if freed correctly + unsigned int *mem = (unsigned int*) m_firstBlock->items; + unsigned int itemNum = 0; + while(itemNum++ < m_itemsPerBlock) { + unsigned int fourthInt = *(mem+3); + if(fourthInt != 0xedededed) { + GCDebugMsg(false, "Leaked %d byte item. Addr: 0x%x\n", GetItemSize(), mem+2); + PrintStackTraceByIndex(*(mem+1)); + } + mem += (m_itemSize / sizeof(int)); + } + GCAssert(false); + } + + // go through every item on the free list and make sure it wasn't written to + // after being poisoned. + void *item = m_firstBlock->firstFree; + while(item) { + for(int i=3, n=(m_firstBlock->size>>2)-1; inumAlloc * b->size; + b = b->next; + } + return bytes; + } + + FixedAlloc::FixedBlock* FixedAlloc::CreateChunk() + { + // Allocate a new block + m_maxAlloc += m_itemsPerBlock; + + FixedBlock* b = (FixedBlock*) m_heap->Alloc(1, true, false); + + GCAssert(m_itemSize <= 0xffff); + b->numAlloc = 0; + b->size = (uint16)m_itemSize; + b->firstFree = 0; + b->nextItem = b->items; + b->alloc = this; + +#ifdef _DEBUG + // deleted and unused memory is 0xed'd, this is important for leak diagnostics + memset(b->items, 0xed, m_itemSize * m_itemsPerBlock); +#endif + + // Link the block at the end of the list + b->prev = m_lastBlock; + b->next = 0; + if (m_lastBlock) { + m_lastBlock->next = b; + } + if (!m_firstBlock) { + m_firstBlock = b; + } + m_lastBlock = b; + + // Add our new ChunkBlock to the firstFree list (which should be empty) + if (m_firstFree) + { + GCAssert(m_firstFree->prevFree == 0); + m_firstFree->prevFree = b; + } + b->nextFree = m_firstFree; + b->prevFree = 0; + m_firstFree = b; + + return b; + } + + void FixedAlloc::FreeChunk(FixedBlock* b) + { + m_maxAlloc -= m_itemsPerBlock; + + // Unlink the block from the list + if (b == m_firstBlock) { + m_firstBlock = b->next; + } else { + b->prev->next = b->next; + } + + if (b == m_lastBlock) { + m_lastBlock = b->prev; + } else { + b->next->prev = b->prev; + } + + // If this is the first free block, pick a new one... + if ( m_firstFree == b ) + m_firstFree = b->nextFree; + else if (b->prevFree) + b->prevFree->nextFree = b->nextFree; + + if (b->nextFree) + b->nextFree->prevFree = b->prevFree; + + // Free the memory + m_heap->Free(b); + } + + size_t FixedAlloc::GetItemSize() const + { + return m_itemSize - DebugSize(); + } + + void *FastAllocator::operator new[](size_t size) + { + return FixedMalloc::GetInstance()->Alloc(size); + } + + void FastAllocator::operator delete [](void *item) + { + FixedMalloc::GetInstance()->Free(item); + } +} diff --git a/mozilla/js/tamarin/MMgc/FixedAlloc.h b/mozilla/js/tamarin/MMgc/FixedAlloc.h new file mode 100644 index 00000000000..4116408444b --- /dev/null +++ b/mozilla/js/tamarin/MMgc/FixedAlloc.h @@ -0,0 +1,298 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __FixedAlloc__ +#define __FixedAlloc__ + + +namespace MMgc +{ + /** + * This is a fast, fixed-size memory allocator for manually freed + * objects. + * + * Memory is allocated from the system in 4096 byte chunks + * via the GCHeap class. Not that this won't work well for + * large objects (>400 bytes). For that, we have the + * FixedAllocLarge allocator which will allocate multiple + * pages at a time to minimize waste. + */ + class FixedAlloc : public GCAllocObject + { + friend class FixedMalloc; + friend class FastAllocator; + friend class GC; + public: + FixedAlloc(int itemSize, GCHeap* heap); + ~FixedAlloc(); + + inline void* Alloc(size_t size) + { + (void)size; + + GCAssertMsg(((size_t)m_itemSize >= size), "allocator itemsize too small"); + + if(!m_firstFree) { + if(CreateChunk() == NULL) { + GCAssertMsg(false, "Out of memory!"); + return NULL; + } + } + + FixedBlock* b = m_firstFree; + GCAssert(b && !IsFull(b)); + + b->numAlloc++; + + // Consume the free list if available + void *item = NULL; + if (b->firstFree) { + item = b->firstFree; + b->firstFree = *((void**)item); + // assert that the freelist hasn't been tampered with (by writing to the first 4 bytes) + GCAssert(b->firstFree == NULL || + (b->firstFree >= b->items && + (((intptr)b->firstFree - (intptr)b->items) % b->size) == 0 && + (intptr) b->firstFree < ((intptr)b & ~0xfff) + GCHeap::kBlockSize)); +#ifdef MEMORY_INFO + // ensure previously used item wasn't written to + // -1 because write back pointer space isn't poisoned. + for(int i=3, n=(b->size>>2)-1; inextItem; + GCAssert(item != 0); + if(!IsFull(b)) { + // There are more items at the end of the block + b->nextItem = (void *) ((intptr)item+m_itemSize); +#ifdef MEMORY_INFO + // space made in ctor + item = DebugDecorate(item, size + DebugSize(), 6); + memset(item, 0xfa, size); +#endif + return item; + } + b->nextItem = 0; + } + + + // If we're out of free items, be sure to remove ourselves from the + // list of blocks with free items. + if (IsFull(b)) { + m_firstFree = b->nextFree; + b->nextFree = NULL; + GCAssert(b->prevFree == NULL); + + if (m_firstFree) + m_firstFree->prevFree = 0; + else + CreateChunk(); + } + +#ifdef MEMORY_INFO + // space made in ctor + item = DebugDecorate(item, size + DebugSize(), 6); + memset(item, 0xfa, size); +#endif + + GCAssertMsg(item != NULL, "Out of memory"); + return item; + } + + static inline void Free(void *item) + { + FixedBlock *b = (FixedBlock*) ((uint32)item & ~0xFFF); + +#ifdef MEMORY_INFO + item = DebugFree(item, 0xED, 6); +#endif + +#ifdef _DEBUG + // ensure that we are freeing a pointer on a item boundary + GCAssert(((intptr)item - (intptr)b->items) % b->alloc->m_itemSize == 0); +#endif + + // Add this item to the free list + *((void**)item) = b->firstFree; + b->firstFree = item; + + // We were full but now we have a free spot, add us to the free block list. + if (b->numAlloc == b->alloc->m_itemsPerBlock) + { + GCAssert(!b->nextFree && !b->prevFree); + b->nextFree = b->alloc->m_firstFree; + if (b->alloc->m_firstFree) + b->alloc->m_firstFree->prevFree = b; + b->alloc->m_firstFree = b; + } +#ifdef _DEBUG + else // we should already be on the free list + { + GCAssert ((b == b->alloc->m_firstFree) || b->prevFree); + } +#endif + + b->numAlloc--; + + if(b->numAlloc == 0) { + b->alloc->FreeChunk(b); + } + } + + size_t Allocated(); + + size_t GetItemSize() const; + int GetMaxAlloc() const { return m_maxAlloc; } + + static FixedAlloc *GetFixedAlloc(void *item) + { + FixedBlock *b = (FixedBlock*) ((uint32)item & ~0xFFF); +#ifdef _DEBUG + // Attempt to sanity check this ptr: numAllocs * size should be less than kBlockSize + GCAssertMsg(((b->numAlloc * b->size) < GCHeap::kBlockSize), "Size called on ptr not part of FixedBlock"); +#endif + return b->alloc; + } + + private: + + struct FixedBlock + { + void* firstFree; // first item on free list + void* nextItem; // next free item + FixedBlock* next; + FixedBlock* prev; + uint16 numAlloc; + uint16 size; + FixedBlock *prevFree; + FixedBlock *nextFree; + FixedAlloc *alloc; + char items[1]; + }; + + GCHeap *m_heap; + unsigned int m_itemsPerBlock; + size_t m_itemSize; + + // The list of chunk blocks + FixedBlock* m_firstBlock; + FixedBlock* m_lastBlock; + + // The lowest priority block that has free items + FixedBlock* m_firstFree; + + int m_maxAlloc; + + bool IsFull(FixedBlock *b) const { return b->numAlloc == m_itemsPerBlock; } + FixedBlock* CreateChunk(); + void FreeChunk(FixedBlock* b); + + static inline size_t Size(const void *item) + { + FixedBlock *b = (FixedBlock*) ((uint32)item & ~0xFFF); +#ifdef _DEBUG + // Attempt to sanity check this ptr: numAllocs * size should be less than kBlockSize + GCAssertMsg(((b->numAlloc * b->size) < GCHeap::kBlockSize), "Size called on ptr not part of FixedBlock"); +#endif + return b->size; + } + }; + + class FixedAllocSafe : public FixedAlloc + { + public: + FixedAllocSafe(int itemSize, GCHeap* heap) : FixedAlloc(itemSize, heap) {} + + void* Alloc(size_t size) + { +#ifdef GCHEAP_LOCK + GCAcquireSpinlock lock(m_spinlock); +#endif + return FixedAlloc::Alloc(size); + } + + void Free(void *ptr) + { +#ifdef GCHEAP_LOCK + GCAcquireSpinlock lock(m_spinlock); +#endif + FixedAlloc::Free(ptr); + } + + static FixedAllocSafe *GetFixedAllocSafe(void *item) + { + return (FixedAllocSafe*) FixedAlloc::GetFixedAlloc(item); + } + + private: + +#ifdef GCHEAP_LOCK + GCSpinLock m_spinlock; +#endif + }; + + /** + * classes that need fast lock free allocation should subclass this and pass + * a FixedAlloc * to the new parameter. One new/delete are lock free, scalar + * allocations use the normal locked general size allocator. + */ + class FastAllocator + { + public: + static void *operator new(size_t size, FixedAlloc *alloc) + { + return alloc->Alloc(size); + } + + static void operator delete (void *item) + { + FixedAlloc::Free(item); + } + + // allow array allocation as well + static void *operator new[](size_t size); + static void operator delete [](void *item); + }; +} + +#endif /* __FixedAlloc__ */ diff --git a/mozilla/js/tamarin/MMgc/FixedMalloc.cpp b/mozilla/js/tamarin/MMgc/FixedMalloc.cpp new file mode 100644 index 00000000000..7b43af169b3 --- /dev/null +++ b/mozilla/js/tamarin/MMgc/FixedMalloc.cpp @@ -0,0 +1,141 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +// For memset +#include + +#include "MMgc.h" + +namespace MMgc +{ + FixedMalloc *FixedMalloc::instance = NULL; + + // Size classes for our Malloc. We start with a 4 byte allocator and then from + // 8 to 128, size classes are spaced evenly 8 bytes apart, then from 128 to 1968 they + const int16 FixedMalloc::kSizeClasses[kNumSizeClasses] = { + 4, 8, 16, 24, 32, 40, 48, 56, 64, 72, //0-9 + 80, 88, 96, 104, 112, 120, 128, 144, 160, 176, //10-19 + 184, 192, 200, 208, 224, 232, 248, 264, 288, 312, //20-29 + 336, 368, 400, 448, 504, 576, 672, 808, 1016, 1352, //30-39 + 2032, //40 + }; + + // This is an index which indicates that allocator i should be used + // if kSizeClassIndex[i] items fit into a 4096 byte page. + const uint8 FixedMalloc::kSizeClassIndex[32] = { + 40, 40, 40, 39, 38, 37, 36, 35, 34, 33, //0-10 + 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, //10-19 + 22, 21, 20, 19, 19, 18, 18, 18, 17, 17, //20-29 + 17, 16 //30-31 + }; + + void FixedMalloc::Init() + { + GCAssert(instance == NULL); + instance = new FixedMalloc(GCHeap::GetGCHeap()); + } + + void FixedMalloc::Destroy() + { + GCAssert(instance != NULL); + delete instance; + instance = NULL; + } + + FixedMalloc::FixedMalloc(GCHeap* heap) + { + m_heap = heap; + // Create all the allocators up front (not lazy) + // so that we don't have to check the pointers for + // NULL on every allocation. + for (int i=0; iAllocated(); + } + // FIXME: what about big blocks? + return bytes; + } + + FixedAllocSafe *FixedMalloc::FindSizeClass(size_t size) const + { + GCAssertMsg(size > 0, "cannot allocate a 0 sized block\n"); + + size_t size8 = (size+7)&~7; // round up to multiple of 8 + + // Buckets up to 128 are spaced evenly at 8 bytes. + if (size <= 128) { + unsigned index = size > 4 ? size8 >> 3 : 0; + FixedAllocSafe *a = m_allocs[index]; + // make sure I fit + GCAssert(size <= a->GetItemSize()); + + // make sure I don't fit + GCAssert(index == 0 || size > m_allocs[index-1]->GetItemSize()); + + return a; + } + + // This is the fast lookup table implementation to + // find the right allocator. + // FIXME: do this w/o division! + unsigned index = kSizeClassIndex[kPageUsableSpace/size8]; + + // assert that I fit + GCAssert(size <= m_allocs[index]->GetItemSize()); + + // assert that I don't fit (makes sure we don't waste space + GCAssert(size > m_allocs[index-1]->GetItemSize()); + + return m_allocs[index]; + } +} + diff --git a/mozilla/js/tamarin/MMgc/FixedMalloc.h b/mozilla/js/tamarin/MMgc/FixedMalloc.h new file mode 100644 index 00000000000..f5fa56d8d0f --- /dev/null +++ b/mozilla/js/tamarin/MMgc/FixedMalloc.h @@ -0,0 +1,168 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __Malloc__ +#define __Malloc__ + + +namespace MMgc +{ + /** + * A general purpose memory allocator using size classes + */ + class FixedMalloc : public GCAllocObject + { + friend class GC; + public: + static void Init(); + static void Destroy(); + /** + * return the number of bytes of memory issued + */ + size_t Allocated(); + + static FixedMalloc *GetInstance() { + GCAssert(instance != NULL); + return instance; + } + + inline void* Alloc(size_t size) + { + void *item; + GCAssert(size + 3 > size); + // overflow detection + if(size+3 < size) + return NULL; + size = (size+3)&~3; + if (size <= (size_t)kLargestAlloc) { + item = FindSizeClass(size)->Alloc(size); + } else { + item = LargeAlloc(size); + } + return item; + } + + inline void Free(void *item) + { + if(item == 0) + return; + + // small things are never allocated on the 4K boundary b/c the block + // header structure is stored there, large things always are + if(IsLargeAlloc(item)) { + LargeFree(item); + } else { + FixedAllocSafe::GetFixedAllocSafe(item)->Free(item); + } + } + + size_t Size(const void *item) + { + size_t size; + if(IsLargeAlloc(item)) { + size = LargeSize(item); + } else { + size = FixedAlloc::Size(item); + } +#ifdef MEMORY_INFO + size -= DebugSize(); +#endif + return size; + } + + void *Calloc(size_t num, size_t elsize) + { + uint64 size = (uint64)num * (uint64)elsize; + if(size > 0xfffffff0) + { + GCAssertMsg(false, "Attempted allocation overflows size_t\n"); + return NULL; + } + return Alloc(num * elsize); + } + +// private: + FixedMalloc(GCHeap* heap); + ~FixedMalloc(); + static FixedMalloc *instance; + const static int kLargestAlloc = 2032; + const static int kNumSizeClasses = 41; + const static int kPageUsableSpace = GCHeap::kBlockSize - offsetof(MMgc::FixedAlloc::FixedBlock, items); + + const static int16 kSizeClasses[kNumSizeClasses]; + const static uint8 kSizeClassIndex[32]; + + GCHeap *m_heap; + FixedAllocSafe *m_allocs[kNumSizeClasses]; + FixedAllocSafe *FindSizeClass(size_t size) const; + + static bool IsLargeAlloc(const void *item) + { + // space made in ctor + item = GetRealPointer(item); + return ((intptr) item & 0xFFF) == 0; + } + + inline void *LargeAlloc(size_t size) + { + size += DebugSize(); + size_t blocksNeeded = ((size+0xfff)&~0xfff) >> 12; + void *item = m_heap->Alloc(blocksNeeded, true, false); + if(!item) + { + GCAssertMsg(item != NULL, "Large allocation of %d blocks failed!"); + } + else + { +#ifdef MEMORY_INFO + item = DebugDecorate(item, size, 5); + memset(item, 0xfb, size - DebugSize()); +#endif + } + return item; + } + + + inline void LargeFree(void *item) + { +#ifdef MEMORY_INFO + item = DebugFree(item, 0xed, 5); +#endif + m_heap->Free(item); + } + + size_t LargeSize(const void *item) + { + return m_heap->Size(item) * GCHeap::kBlockSize; + } + }; +} +#endif /* __Malloc__ */ diff --git a/mozilla/js/tamarin/MMgc/GC.cpp b/mozilla/js/tamarin/MMgc/GC.cpp new file mode 100644 index 00000000000..dcdfc14ba1e --- /dev/null +++ b/mozilla/js/tamarin/MMgc/GC.cpp @@ -0,0 +1,2603 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +// For memset +#include + +#include "MMgc.h" + +#if defined(_DEBUG) || defined(DEBUGGER) +#include +#endif + +#ifdef _DEBUG +#include "GCTests.h" +#endif + +#ifdef DARWIN +#include +#endif + +// get alloca for CleanStack +#ifdef WIN32 +#include "malloc.h" +#else +#include "alloca.h" +#endif + +#if defined(_MAC) && defined(MMGC_IA32) +#include +#endif + +#if defined(_MSC_VER) && defined(_DEBUG) +// we turn on exceptions in DEBUG builds +#pragma warning(disable:4291) // no matching operator delete found; memory will not be freed if initialization throws an exception +#endif + +#ifdef DEBUGGER +// sampling support +#include "avmplus.h" +#else +#define SAMPLE_FRAME(_x, _s) +#define SAMPLE_CHECK() +#endif + +namespace MMgc +{ + +#ifdef MMGC_DRC + + // how many objects trigger a reap, should be high + // enough that the stack scan time is noise but low enough + // so that objects to away in a timely manner + const int ZCT::ZCT_REAP_THRESHOLD = 512; + + // size of table in pages + const int ZCT::ZCT_START_SIZE = 1; +#endif + + // get detailed info on each size class allocators + const bool dumpSizeClassState = false; + + // Expand, don't collect, until we hit this threshold + const size_t GC::collectThreshold = 256; + + /** + * Free Space Divisor. This value may be tuned for optimum + * performance. The FSD is based on the Boehm collector. + */ + const static int kFreeSpaceDivisor = 4; + + const static int kMaxIncrement = 4096; + + /** + * delay between GC incremental marks + */ + const static int kIncrementalMarkDelayTicks = int(10 * GC::GetPerformanceFrequency() / 1000); + + const static int kMarkSweepBurstTicks = 1515909; // 200 ms on a 2ghz machine + + // Size classes for our GC. From 8 to 128, size classes are spaced + // evenly 8 bytes apart. The finest granularity we can achieve is + // 8 bytes, as pointers must be 8-byte aligned thanks to our use + // of the bottom 3 bits of 32-bit atoms for Special Purposes. + // Above that, the size classes have been chosen to maximize the + // number of items that fit in a 4096-byte block, given our block + // header information. + const int16 GC::kSizeClasses[kNumSizeClasses] = { + 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, //0-9 + 88, 96, 104, 112, 120, 128, 144, 160, 168, 176, //10-19 + 184, 192, 200, 216, 224, 240, 256, 280, 296, 328, //20-29 + 352, 392, 432, 488, 560, 656, 784, 984, 1312, 1968 //30-39 + }; + + /* kSizeClassIndex[] generated with this code: + kSizeClassIndex[0] = 0; + for (var i:int = 1; i < kNumSizeClasses; i++) + for (var j:int = (kSizeClasses[i-1]>>3), n=(kSizeClasses[i]>>3); j < n; j++) + kSizeClassIndex[j] = i; + */ + + // index'd by size>>3 - 1 + const uint8 GC::kSizeClassIndex[246] = { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 16, 17, 17, + 18, 19, 20, 21, 22, 23, 23, 24, 25, 25, + 26, 26, 27, 27, 27, 28, 28, 29, 29, 29, + 29, 30, 30, 30, 31, 31, 31, 31, 31, 32, + 32, 32, 32, 32, 33, 33, 33, 33, 33, 33, + 33, 34, 34, 34, 34, 34, 34, 34, 34, 34, + 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, + 35, 35, 36, 36, 36, 36, 36, 36, 36, 36, + 36, 36, 36, 36, 36, 36, 36, 36, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 38, 38, 38, 38, 38, 38, 38, + 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, + 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, + 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, + 38, 38, 38, 38, 39, 39, 39, 39, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, + 39, 39, 39, 39, 39, 39 + }; + const int kLargestAlloc = 1968; + + +#ifdef _DEBUG + // dump memory profile after sweeps + const bool GC::enableMemoryProfiling = false; +#endif + + GC::GC(GCHeap *gcheap) + : disableThreadCheck(false), +#ifdef MMGC_DRC + zct(gcheap), +#endif + nogc(false), + greedy(false), + findUnmarkedPointers(false), + validateDefRef(false), + keepDRCHistory(false), + gcstats(false), +#ifdef WRITE_BARRIERS + incremental(true), +#else + incremental(false), +#endif + +#ifdef _DEBUG + // this doens't hurt performance too much so alway leave it on in DEBUG builds + // before sweeping we check for missing write barriers + incrementalValidation(false), + + // check for missing write barriers at every Alloc + incrementalValidationPedantic(false), +#endif + + marking(false), + memStart(0xffffffff), + memEnd(0), + heap(gcheap), + allocsSinceCollect(0), + collecting(false), + m_roots(0), + m_callbacks(0), + markTicks(0), + bytesMarked(0), + markIncrements(0), + marks(0), + sweeps(0), + totalGCPages(0), + stackCleaned(true), + rememberedStackTop(0), + destroying(false), + lastMarkTicks(0), + lastSweepTicks(0), + lastStartMarkIncrementCount(0), + t0(GetPerformanceCounter()), + dontAddToZCTDuringCollection(false), + numObjects(0), + hitZeroObjects(false), + smallEmptyPageList(NULL), + largeEmptyPageList(NULL), + sweepStart(0), + heapSizeAtLastAlloc(gcheap->GetTotalHeapSize()), + finalizedValue(true) + { +#ifdef MMGC_DRC + zct.gc = this; +#endif + // Create all the allocators up front (not lazy) + // so that we don't have to check the pointers for + // NULL on every allocation. + for (int i=0; iAlloc(1); + + memset(m_bitsFreelists, 0, sizeof(uint32*) * kNumSizeClasses); + m_bitsNext = (uint32*)heap->Alloc(1); + + // precondition for emptyPageList + GCAssert(offsetof(GCLargeAlloc::LargeBlock, next) == offsetof(GCAlloc::GCBlock, next)); + + + for(int i=0; iFree((void*)pageList); + pageList = next; + } + + for (int i=0; i < kNumSizeClasses; i++) { + delete containsPointersAllocs[i]; +#ifdef MMGC_DRC + delete containsPointersRCAllocs[i]; +#endif + delete noPointersAllocs[i]; + } + + if (largeAlloc) { + delete largeAlloc; + } + + // dtors for each GCAlloc will use this + pageList = NULL; + + heap->Free(pageMap); + +#ifdef _DEBUG + delete [] msgBuf; +#endif + + CheckThread(); + + GCAssert(!m_roots); + GCAssert(!m_callbacks); + } + + void GC::Collect() + { + if (nogc || collecting) { + + return; + } + + // Don't start a collection if we are in the midst of a ZCT reap. + if (zct.reaping) + { + + return; + } + + ReapZCT(); + + // if we're in the middle of an incremental mark kill it + // FIXME: we should just push it to completion + if(marking) + { + marking = false; + m_incrementalWork.Keep(0); + } + +#ifdef DEBUGGER + StartGCActivity(); +#endif + + // Dumping the stack trace at GC time can be very helpful with stack walk bugs + // where something was created, stored away in untraced, unmanaged memory and not + // reachable by the conservative stack walk + //DumpStackTrace(); + + Trace(); + + Sweep(); + +#ifdef _DEBUG + FindUnmarkedPointers(); +#endif + + CheckThread(); + +#ifdef DEBUGGER + StopGCActivity(); +#endif + } + + void GC::Trace(const void *stackStart/*=NULL*/, size_t stackSize/*=0*/) + { + SAMPLE_FRAME("[mark]", core()); + + // Clear all mark bits. + ClearMarks(); + + SAMPLE_CHECK(); + + GCStack work; + { +#ifdef GCHEAP_LOCK + GCAcquireSpinlock lock(m_rootListLock); +#endif + GCRoot *r = m_roots; + while(r) { + GCWorkItem item = r->GetWorkItem(); + MarkItem(item, work); + r = r->next; + } + } + + SAMPLE_CHECK(); + + if(stackStart == NULL) { + MarkQueueAndStack(work); + } else { + GCWorkItem item(stackStart, stackSize, false); + PushWorkItem(work, item); + Mark(work); + } + + SAMPLE_CHECK(); + } + + void *GC::Alloc(size_t size, int flags/*0*/, int skip/*3*/) + { +#ifdef DEBUGGER + avmplus::AvmCore *core = (avmplus::AvmCore*)GetGCContextVariable(GCV_AVMCORE); + if(core) + core->sampleCheck(); +#endif + (void)skip; + (void)skip; + GCAssertMsg(size > 0, "cannot allocate a 0 sized block\n"); + +#ifdef _DEBUG + GCAssert(size + 7 > size); + CheckThread(); + if (GC::greedy) { + Collect(); + } + // always be marking in pedantic mode + if(incrementalValidationPedantic) { + if(!marking) + StartIncrementalMark(); + } +#endif + + // overflow detection + if(size+7 < size) + return NULL; + + size = (size+7)&~7; // round up to multiple of 8 + + size += DebugSize(); + + GCAssertMsg(size > 0, "debug overflow, adding space for Debug stuff overflowed size_t\n"); + + GCAlloc **allocs = noPointersAllocs; +#ifdef MMGC_DRC + if(flags & kRCObject) { + allocs = containsPointersRCAllocs; + } else +#endif + if(flags & kContainsPointers) { + allocs = containsPointersAllocs; + } + + void *item; + // Buckets up to 128 are spaced evenly at 8 bytes. + if (size <= 128) { + GCAlloc *b = (GCAlloc*)allocs[(size >> 3) - 1]; + GCAssert(size <= b->GetItemSize()); + item = b->Alloc(size, flags); + } else if (size <= kLargestAlloc) { + // This is the fast lookup table implementation to + // find the right allocator. + unsigned index = kSizeClassIndex[(size>>3)-1]; + + // assert that I fit + GCAssert(size <= allocs[index]->GetItemSize()); + + // assert that I don't fit (makes sure we don't waste space) + GCAssert(size > allocs[index-1]->GetItemSize()); + + item = allocs[index]->Alloc(size, flags); + } else { + item = largeAlloc->Alloc(size, flags); + } + +#ifdef MEMORY_INFO + item = DebugDecorate(item, GC::Size(GetUserPointer(item)) + DebugSize(), skip); +#endif + +#ifdef _DEBUG + // in debug mode memory is poisoned so we have to clear it here + // in release builds memory is zero'd to start and on free/sweep + // in pedantic mode uninitialized data can trip the write barrier + // detector, only do it for pedantic because otherwise we want the + // mutator to get the poisoned data so it crashes if it relies on + // uninitialized values + if(item && (flags&kZero || incrementalValidationPedantic)) { + memset(item, 0, Size(item)); + } +#endif + + return item; + } + + void *GC::Calloc(size_t num, size_t elsize, int flags, int skip) + { + uint64 size = (uint64)num * (uint64)elsize; + if(size > 0xfffffff0) + { + GCAssertMsg(false, "Attempted allocation overflows size_t\n"); + return NULL; + } + return Alloc(num * elsize, flags, skip); + } + + void GC::Free(void *item) + { + CheckThread(); + // we can't allow free'ing something during Sweeping, otherwise alloc counters + // get decremented twice and destructors will be called twice. + if(item == NULL) { + return; + } + + if(collecting) { + goto bail; + } + + bool isLarge = GCLargeAlloc::IsLargeBlock(GetRealPointer(item)); + + if (marking) { + // if its on the work queue don't delete it, if this item is + // really garbage we're just leaving it for the next sweep + if(IsQueued(item)) + goto bail; + } + +#ifdef _DEBUG +#ifdef MMGC_DRC + // RCObject have constract that they must clean themselves, since they + // have to scan themselves to decrement other RCObjects they might as well + // clean themselves too, better than suffering a memset later + if(isLarge ? GCLargeAlloc::IsRCObject(item) : GCAlloc::IsRCObject(item)) + { + RCObjectZeroCheck((RCObject*)item); + } +#endif // MMGC_DRC +#endif + +#ifdef MEMORY_INFO + DebugFree(item, 0xca, 4); +#endif + + if (isLarge) { + largeAlloc->Free(GetRealPointer(item)); + } else { + GCAlloc::Free(GetRealPointer(item)); + } + return; + +bail: + + // this presumes we got here via delete, maybe we should have + // delete call something other than the public Free to distinguish + if(IsFinalized(item)) + ClearFinalized(item); + if(HasWeakRef(item)) + ClearWeakRef(item); + } + + void GC::ClearMarks() + { + for (int i=0; i < kNumSizeClasses; i++) { +#ifdef MMGC_DRC + containsPointersRCAllocs[i]->ClearMarks(); +#endif + containsPointersAllocs[i]->ClearMarks(); + noPointersAllocs[i]->ClearMarks(); + } + largeAlloc->ClearMarks(); + } + + void GC::Finalize() + { + for(int i=0; i < kNumSizeClasses; i++) { +#ifdef MMGC_DRC + containsPointersRCAllocs[i]->Finalize(); +#endif + containsPointersAllocs[i]->Finalize(); + noPointersAllocs[i]->Finalize(); + } + largeAlloc->Finalize(); + finalizedValue = !finalizedValue; + + + for(int i=0; i < kNumSizeClasses; i++) { +#ifdef MMGC_DRC + containsPointersRCAllocs[i]->m_finalized = false; +#endif + containsPointersAllocs[i]->m_finalized = false; + noPointersAllocs[i]->m_finalized = false; + } + } + + void GC::Sweep(bool force) + { + SAMPLE_FRAME("[sweep]", core()); + sweeps++; + + int heapSize = heap->GetUsedHeapSize(); + +#ifdef MEMORY_INFO + if(enableMemoryProfiling) { + GCDebugMsg(false, "Pre sweep memory info:\n"); + DumpMemoryInfo(); + } +#endif + + // collecting must be true because it indicates allocations should + // start out marked, we can't rely on write barriers below since + // presweep could write a new GC object to a root + collecting = true; + + // invoke presweep on all callbacks + GCCallback *cb = m_callbacks; + while(cb) { + cb->presweep(); + cb = cb->nextCB; + } + + SAMPLE_CHECK(); + + Finalize(); + + SAMPLE_CHECK(); + + // if force is true we're being called from ~GC and this isn't necessary + if(!force) { + // we just executed mutator code which could have fired some WB's + Mark(m_incrementalWork); + } + + // ISSUE: this could be done lazily at the expense other GC's potentially expanding + // unnecessarily, not sure its worth it as this should be pretty fast + GCAlloc::GCBlock *b = smallEmptyPageList; + while(b) { + GCAlloc::GCBlock *next = b->next; +#ifdef _DEBUG + b->alloc->SweepGuts(b); +#endif + b->alloc->FreeChunk(b); + b = next; + } + smallEmptyPageList = NULL; + + SAMPLE_CHECK(); + + GCLargeAlloc::LargeBlock *lb = largeEmptyPageList; + while(lb) { + GCLargeAlloc::LargeBlock *next = lb->next; + // FIXME: this makes for some chatty locking, maybe not a problem? + FreeBlock(lb, lb->GetNumBlocks()); + lb = next; + } + largeEmptyPageList = NULL; + + SAMPLE_CHECK(); + +#ifdef MEMORY_INFO + if(enableMemoryProfiling) { + GCDebugMsg(false, "Post sweep memory info:\n"); + DumpMemoryInfo(); + } +#endif + + // don't want postsweep to fire WB's + marking = false; + collecting = false; + + // invoke postsweep callback + cb = m_callbacks; + while(cb) { + cb->postsweep(); + cb = cb->nextCB; + } + + SAMPLE_CHECK(); + + allocsSinceCollect = 0; + lastSweepTicks = GetPerformanceCounter(); + + if(GC::gcstats) { + int sweepResults = 0; + GCAlloc::GCBlock *b = smallEmptyPageList; + while(b) { + sweepResults++; + b = b->next; + } + + GCLargeAlloc::LargeBlock *lb = largeEmptyPageList; + while(lb) { + sweepResults += lb->GetNumBlocks(); + lb = lb->next; + } + // include large pages given back + sweepResults += (heapSize - heap->GetUsedHeapSize()); + double millis = duration(sweepStart); + gclog("[GC] sweep(%d) reclaimed %d whole pages (%d kb) in %4Lf millis (%4Lf s)\n", + sweeps, sweepResults, sweepResults*GCHeap::kBlockSize>>10, millis, + duration(t0)/1000);\ + } +#ifdef DEBUGGER + StopGCActivity(); +#endif + +#ifdef MEMORY_INFO + m_gcLastStackTrace = GetStackTraceIndex(5); +#endif + } + + void* GC::AllocBlock(int size, int pageType, bool zero) + { +#ifdef DEBUGGER + AllocActivity(size); +#endif + GCAssert(size > 0); + + // perform gc if heap expanded due to fixed memory allocations + // utilize burst logic to prevent this from happening back to back + // this logic is here to apply to incremental and non-incremental + uint64 now = GetPerformanceCounter(); + if(!marking && !collecting && + heapSizeAtLastAlloc > collectThreshold && + now - lastSweepTicks > kMarkSweepBurstTicks && + heapSizeAtLastAlloc < heap->GetTotalHeapSize()) + { + if(incremental) + StartIncrementalMark(); + else + Collect(); + } + + void *item; + + if(incremental) + item = AllocBlockIncremental(size, zero); + else + item = AllocBlockNonIncremental(size, zero); + + if(!item) { + int incr = size + totalGCPages / kFreeSpaceDivisor; + if(incr > kMaxIncrement) { + incr = size < kMaxIncrement ? kMaxIncrement : size; + } + heap->ExpandHeap(incr); + item = heap->Alloc(size, false); + } + + GCAssert(item != NULL); + if (item != NULL) + { + allocsSinceCollect += size; + + // mark GC pages in page map, small pages get marked one, + // the first page of large pages is 3 and the rest are 2 + MarkGCPages(item, 1, pageType); + if(pageType == kGCLargeAllocPageFirst) { + MarkGCPages((char*)item+GCHeap::kBlockSize, size - 1, kGCLargeAllocPageRest); + } + totalGCPages += size; + } + + // do this after any heap expansions from GC + heapSizeAtLastAlloc = heap->GetTotalHeapSize(); + + return item; + } + + void* GC::AllocBlockIncremental(int size, bool zero) + { + if(!nogc && !collecting) { + uint64 now = GetPerformanceCounter(); + if (marking) { + if(now - lastMarkTicks > kIncrementalMarkDelayTicks) { + IncrementalMark(); + } + } else if (totalGCPages > collectThreshold && + allocsSinceCollect * kFreeSpaceDivisor >= totalGCPages) { + // burst detection + if(now - lastSweepTicks > kMarkSweepBurstTicks) + StartIncrementalMark(); + } + } + + void *item = heap->Alloc(size, false, zero); + if(!item && !collecting) { + if(marking) { + GCAssert(!nogc); + FinishIncrementalMark(); + item = heap->Alloc(size, false, zero); + } + } + return item; + } + + void* GC::AllocBlockNonIncremental(int size, bool zero) + { + void *item = heap->Alloc(size, false, zero); + if (!item) { + if (heap->GetTotalHeapSize() >= collectThreshold && + allocsSinceCollect >= totalGCPages / kFreeSpaceDivisor) + { + Collect(); + item = heap->Alloc(size, false, zero); + } + } + return item; + } + + void GC::FreeBlock(void *ptr, uint32 size) + { +#ifdef DEBUGGER + AllocActivity(- (int)size); +#endif + if(!collecting) { + allocsSinceCollect -= size; + } + totalGCPages -= size; + heap->Free(ptr); + UnmarkGCPages(ptr, size); + } + + void GC::SetPageMapValue(uint32 addr, int val) + { + uint32 index = (addr-memStart) >> 12; + GCAssert(index >> 2 < 64 * GCHeap::kBlockSize); + pageMap[index >> 2] |= (val<<((index&0x3)*2)); + } + + void GC::ClearPageMapValue(uint32 addr) + { + uint32 index = (addr-memStart) >> 12; + GCAssert(index >> 2 < 64 * GCHeap::kBlockSize); + pageMap[index >> 2] &= ~(3<<((index&0x3)*2)); + } + + void GC::Mark(GCStack &work) + { + while(work.Count()) { + MarkItem(work); + } + } + + void GC::MarkGCPages(void *item, uint32 numPages, int to) + { + intptr addr = (intptr)item; + int shiftAmount=0; + unsigned char *dst = pageMap; + + // save the current live range in case we need to move/copy + int numBytesToCopy = (memEnd-memStart)>>14; + + if(addr < memStart) { + // round down to nearest 16k boundary, makes shift logic work cause it works + // in bytes, ie 16k chunks + addr &= ~0x3fff; + // marking earlier pages + if(memStart != 0xffffffff) { + shiftAmount = (memStart - addr) >> 14; + } + memStart = addr; + } + + if(addr + (numPages+1)*GCHeap::kBlockSize > memEnd) { + // marking later pages + memEnd = addr + (numPages+1)*GCHeap::kBlockSize; + // round up to 16k + memEnd = (memEnd+0x3fff)&~0x3fff; + } + + size_t numPagesNeeded = ((memEnd-memStart)>>14)/GCHeap::kBlockSize + 1; + if(numPagesNeeded > heap->Size(pageMap)) { + dst = (unsigned char*)heap->Alloc(numPagesNeeded); + } + + if(shiftAmount || dst != pageMap) { + memmove(dst + shiftAmount, pageMap, numBytesToCopy); + memset(dst, 0, shiftAmount); + if(dst != pageMap) { + heap->Free(pageMap); + pageMap = dst; + } + } + + addr = (intptr)item; + while(numPages--) + { + SetPageMapValue(addr, to); + addr += GCHeap::kBlockSize; + } + } + + void GC::UnmarkGCPages(void *item, uint32 numpages) + { + intptr addr = (uint32) item; + while(numpages--) + { + ClearPageMapValue(addr); + addr += GCHeap::kBlockSize; + } + } + + void GC::CleanStack(bool force) + { +#if defined(_MSC_VER) && defined(_DEBUG) + // debug builds poison the stack already + (void)force; + return; +#else + if(!force && (stackCleaned || rememberedStackTop == 0)) + return; + + stackCleaned = true; + + register void *stackP; +#if defined MMGC_IA32 + #ifdef WIN32 + __asm { + mov stackP,esp + } + #else + asm("movl %%esp,%0" : "=r" (stackP)); + #endif +#endif + +#if defined MMGC_PPC + // save off sp + asm("mr %0,r1" : "=r" (stackP)); +#endif + if((char*) stackP > (char*)rememberedStackTop) { + size_t amount = (char*) stackP - (char*)rememberedStackTop; + void *stack = alloca(amount); + if(stack) { + memset(stack, 0, amount); + } + } +#endif + } + + void GC::MarkQueueAndStack(GCStack& work) + { + GCWorkItem item; + + MMGC_GET_STACK_EXENTS(this, item.ptr, item._size); + + // this is where we will clear to when CleanStack is called + if(rememberedStackTop == 0 || rememberedStackTop > item.ptr) { + rememberedStackTop = item.ptr; + } + + PushWorkItem(work, item); + Mark(work); + } + + GCRoot::GCRoot(GC *gc) : gc(gc) + { + // I think this makes some non-guaranteed assumptions about object layout, + // like with multiple inheritance this might not be the beginning + object = this; + size = FixedMalloc::GetInstance()->Size(this); + gc->AddRoot(this); + } + + GCRoot::GCRoot(GC *gc, const void *object, size_t size) + : gc(gc), object(object), size(size) + { + gc->AddRoot(this); + } + + GCRoot::~GCRoot() + { + if(gc) { + gc->RemoveRoot(this); + } + } + + void GCRoot::Set(const void *object, size_t size) + { + this->object = object; + this->size = size; + } + + void GCRoot::Destroy() + { + Set(NULL, 0); + if(gc) { + gc->RemoveRoot(this); + } + gc = NULL; + } + + GCCallback::GCCallback(GC *gc) : gc(gc) + { + gc->AddCallback(this); + } + + GCCallback::~GCCallback() + { + if(gc) { + gc->RemoveCallback(this); + } + } + + void GCCallback::Destroy() + { + if(gc) { + gc->RemoveCallback(this); + } + gc = NULL; + } + + void GC::CheckThread() + { +#ifdef _DEBUG +#ifdef WIN32 + GCAssertMsg(disableThreadCheck || m_gcThread == GetCurrentThreadId(), "Unsafe access to GC from wrong thread!"); +#endif +#endif + } + + + bool GC::IsPointerToGCPage(const void *item) + { + if((intptr)item >= memStart && (intptr)item < memEnd) + return GetPageMapValue((intptr) item) != 0; + return false; + } + +#ifdef MMGC_DRC + + ZCT::ZCT(GCHeap *heap) + { + zctSize = ZCT_START_SIZE; + zct = (RCObject**) heap->Alloc(zctSize); + zctNext = zct; + zctFreelist = NULL; + reaping = false; + gc = NULL; + count = 0; + zctReapThreshold = ZCT_REAP_THRESHOLD; + } + + ZCT::~ZCT() + { + gc->heap->Free(zct); + } + + void ZCT::Add(RCObject *obj) + { + if(gc->collecting) + { + // this is a vestige from FP8 to fix bug 165100, it has the affect of delaying + // the deletion of some objects which causes the site to work + if(gc->dontAddToZCTDuringCollection) + return; + + // unmarked objects are gonna get swept anyways + if(!GC::GetMark(obj)) + return; + } + +#if 0 + // note if we add things while reaping we could delete the object + // here if we had a way to monitor our stack usage + if(reaping && PLENTY_OF_STACK()) { + GCCallback *cb = gc->m_callbacks; + while(cb) { + cb->prereap(obj); + cb = cb->nextCB; + } + if(gc->IsFinalized(obj)) + ((GCFinalizedObject*)obj)->~GCFinalizedObject(); + gc->Free(obj); + return; + } +#endif + + if(zctFreelist) { + RCObject **nextFree = (RCObject**)*zctFreelist; + *zctFreelist = obj; + obj->setZCTIndex(zctFreelist - zct); + zctFreelist = nextFree; + } else if(reaping && zctIndex > nextPinnedIndex) { + // we're going over the list, insert this guy at the front if possible + zctIndex--; + GCAssert(zct[zctIndex] == NULL); + obj->setZCTIndex(zctIndex); + zct[zctIndex] = obj; + } else { + *zctNext = obj; + obj->setZCTIndex(zctNext - zct); + zctNext++; + } + count++; + + if(!reaping) { + // object that were pinned last reap should be unpinned + if(obj->IsPinned()) + obj->Unpin(); + if(!gc->collecting && zctNext >= zct+zctReapThreshold) + Reap(); + } + + if(zctNext >= zct + zctSize*1024) { + // grow + RCObject **newZCT = (RCObject**) gc->heap->Alloc(zctSize*2); + memcpy(newZCT, zct, zctSize*GCHeap::kBlockSize); + gc->heap->Free(zct); + zctNext = newZCT + (zctNext-zct); + zct = newZCT; + zctSize *= 2; + GCAssert(!zctFreelist); + } + } + + void ZCT::Remove(RCObject *obj) + { + int index = obj->getZCTIndex(); + GCAssert(zct[index] == obj); + + if(reaping) + { + // freelist doesn't exist during reaping, simplifies things, holes will + // be compacted next go around if index < nextPinnedIndex. the freelist + // allows incoming object to be added behind zctIndex which would mean + // the reap process wouldn't cascade like its supposed to. + zct[index] = NULL; + } + else + { + zct[index] = (RCObject*) zctFreelist; + zctFreelist = &zct[index]; + } + obj->ClearZCTFlag(); + count--; + } + + void ZCT::PinStackObjects(const void *start, size_t len) + { + RCObject **p = (RCObject**)start; + RCObject **end = p + len/sizeof(RCObject*); + + const void *_memStart = (const void*)gc->memStart; + const void *_memEnd = (const void*)gc->memEnd; + + while(p < end) + { + const void *val = GC::Pointer(*p++); + + if(val < _memStart || val >= _memEnd) + continue; + + int bits = gc->GetPageMapValue((intptr)val); + bool doit = false; + if (bits == GC::kGCAllocPage) { + doit = GCAlloc::IsRCObject(val) && GCAlloc::FindBeginning(val) == GetRealPointer(val); + } else if(bits == GC::kGCLargeAllocPageFirst) { + doit = GCLargeAlloc::IsRCObject(val) && GCLargeAlloc::FindBeginning(val) == GetRealPointer(val); + } + + if(doit) { + RCObject *obj = (RCObject*)val; + obj->Pin(); + } + } + } + +#ifdef _DEBUG + + void GC::RCObjectZeroCheck(RCObject *item) + { + int size = Size(item)/sizeof(int); + int *p = (int*)item; + // skip vtable, first 4 bytes are cleared in Alloc + p++; + // in incrementalValidation mode manually deleted items + // aren't put on the freelist so skip them + if(incrementalValidation) { + if(*p == 0xcacacaca) + return; + } + for(int i=1; icollecting || reaping || count == 0) + return; + +#ifdef DEBUGGER + uint64 start = GC::GetPerformanceCounter(); + uint32 pagesStart = gc->totalGCPages; + uint32 numObjects=0; + uint32 objSize=0; +#endif + + reaping = true; + + SAMPLE_FRAME("[reap]", gc->core()); + + // start by pinning live stack objects + GCWorkItem item; + MMGC_GET_STACK_EXENTS(gc, item.ptr, item._size); + PinStackObjects(item.ptr, item._size); + + // important to do this before calling prereap + // use index to iterate in case it grows, as we go through the list we + // unpin pinned objects and pack them at the front of the list, that + // way the ZCT is in a good state at the end + zctIndex = 0; + nextPinnedIndex = 0; + + // invoke prereap on all callbacks + GCCallback *cb = gc->m_callbacks; + while(cb) { + cb->prereap(); + cb = cb->nextCB; + } + +#ifdef _DEBUG + if(gc->validateDefRef) { + // kill incremental mark since we're gonna wipe the marks + gc->marking = false; + gc->m_incrementalWork.Keep(0); + + CleanEntireStack(); + gc->Trace(item.ptr, item._size); + } +#endif + + // first nuke the freelist, we won't have one when we're done reaping + // and we don't want secondary objects put on the freelist (otherwise + // reaping couldn't be a linear scan) + while(zctFreelist) { + RCObject **next = (RCObject**)*zctFreelist; + *zctFreelist = 0; + zctFreelist = next; + } + + while(zct+zctIndex < zctNext) { + SAMPLE_CHECK(); + RCObject *rcobj = zct[zctIndex++]; + if(rcobj && !rcobj->IsPinned()) { + rcobj->ClearZCTFlag(); + zct[zctIndex-1] = NULL; + count--; +#ifdef _DEBUG + if(gc->validateDefRef) { + if(gc->GetMark(rcobj)) { + rcobj->DumpHistory(); + GCDebugMsg(false, "Back pointer chain:"); + gc->DumpBackPointerChain(rcobj); + GCAssertMsg(false, "Zero count object reachable, ref counts not correct!"); + } + } +#endif + // invoke prereap on all callbacks + GCCallback *cb = gc->m_callbacks; + while(cb) { + cb->prereap(rcobj); + cb = cb->nextCB; + } + + GCAssert(*(int*)rcobj != 0); + GCAssert(gc->IsFinalized(rcobj)); + ((GCFinalizedObject*)rcobj)->~GCFinalizedObject(); +#ifdef DEBUGGER + numObjects++; + objSize += GC::Size(rcobj); +#endif + gc->Free(rcobj); + + GCAssert(gc->weakRefs.get(rcobj) == NULL); + } else if(rcobj) { + // move it to front + rcobj->Unpin(); + if(nextPinnedIndex != zctIndex-1) { + rcobj->setZCTIndex(nextPinnedIndex); + GCAssert(zct[nextPinnedIndex] == NULL); + zct[nextPinnedIndex] = rcobj; + zct[zctIndex-1] = NULL; + } + nextPinnedIndex++; + } + } + + zctNext = zct + nextPinnedIndex; + zctReapThreshold = count + ZCT_REAP_THRESHOLD; + if(zctReapThreshold > int(zctSize*GCHeap::kBlockSize/sizeof(RCObject*))) + zctReapThreshold = zctSize*GCHeap::kBlockSize/sizeof(RCObject*); + GCAssert(nextPinnedIndex == count); + zctIndex = nextPinnedIndex = 0; + + // invoke postreap on all callbacks + cb = gc->m_callbacks; + while(cb) { + cb->postreap(); + cb = cb->nextCB; + } +#ifdef DEBUGGER + if(gc->gcstats && numObjects) { + gc->gclog("[GC] DRC reaped %d objects (%d kb) freeing %d pages (%d kb) in %f millis (%f s)", + numObjects, objSize>>10, pagesStart - gc->totalGCPages, gc->totalGCPages*GCHeap::kBlockSize >> 10, + GC::duration(start), gc->duration(gc->t0)/1000); + } +#endif + reaping = false; + } + +//#define ENABLE_GC_LOG + + #if defined(WIN32) && defined(ENABLE_GC_LOG) + static bool called_cfltcvt_init = false; + extern "C" void _cfltcvt_init(); + #endif + + void GC::gclog(const char *format, ...) + { + (void)format; +#ifdef ENABLE_GC_LOG + char buf[4096]; + va_list argptr; + +#ifdef WIN32 + if(!called_cfltcvt_init) { + _cfltcvt_init(); + called_cfltcvt_init = true; + } +#endif + + va_start(argptr, format); + vsprintf(buf, format, argptr); + va_end(argptr); + + GCAssert(strlen(buf) < 4096); + + GCCallback *cb = m_callbacks; + while(cb) { + cb->log(buf); + cb = cb->nextCB; + } +#endif + } + +#ifdef MEMORY_INFO + void GC::DumpBackPointerChain(void *o) + { + int *p = (int*)GetRealPointer ( o ) ; + int size = *p++; + int traceIndex = *p++; + //if(*(p+1) == 0xcacacaca || *(p+1) == 0xbabababa) { + // bail, object was deleted + // return; + //} + GCDebugMsg(false, "Object: %s:0x%x\n", GetTypeName(traceIndex, o), p); + PrintStackTraceByIndex(traceIndex); + GCDebugMsg(false, "---\n"); + // skip data + endMarker + p += 1 + (size>>2); + void *container = (void*) *p; + if(container && IsPointerToGCPage(container)) + DumpBackPointerChain(container); + else + { + GCDebugMsg(false, "GCRoot object: 0x%x\n", container); + if((intptr)container >= memStart && (intptr)container < memEnd) + PrintStackTrace(container); + } + } + + void GC::WriteBackPointer(const void *item, const void *container, size_t itemSize) + { + GCAssert(container != NULL); + int *p = (int*) item; + size_t size = *p++; + if(size && size <= itemSize) { + // skip traceIndex + data + endMarker + p += (2 + (size>>2)); + GCAssert(sizeof(int) == sizeof(void*)); + *p = (int) container; + } + } + +#endif + + bool GC::IsRCObject(const void *item) + { + if((intptr)item >= memStart && (intptr)item < memEnd && ((intptr)item&0xfff) != 0) + { + int bits = GetPageMapValue((intptr)item); + item = GetRealPointer(item); + switch(bits) + { + case kGCAllocPage: + if((char*)item < ((GCAlloc::GCBlock*)((intptr)item&~0xfff))->items) + return false; + return GCAlloc::IsRCObject(item); + case kGCLargeAllocPageFirst: + return GCLargeAlloc::IsRCObject(item); + default: + return false; + } + } + return false; + } + +#endif // MMGC_DRC + +#ifdef MEMORY_INFO + + int DumpAlloc(GCAlloc *a) + { + int inUse = a->GetNumAlloc() * a->GetItemSize(); + int maxAlloc = a->GetMaxAlloc()* a->GetItemSize(); + int efficiency = maxAlloc > 0 ? inUse * 100 / maxAlloc : 100; + if(inUse) { + GCDebugMsg(false, "Allocator(%d): %d%% efficiency %d kb out of %d kb\n", a->GetItemSize(), efficiency, inUse>>10, maxAlloc>>10); + } + return maxAlloc-inUse; + } + + void GC::DumpMemoryInfo() + { + if(enableMemoryProfiling) + { + DumpFatties(); + if (dumpSizeClassState) + { + int waste=0; + for(int i=0; i < kNumSizeClasses; i++) + { + waste += DumpAlloc(containsPointersAllocs[i]); +#ifdef MMGC_DRC + waste += DumpAlloc(containsPointersRCAllocs[i]); +#endif + waste += DumpAlloc(noPointersAllocs[i]); + } + GCDebugMsg(false, "Wasted %d kb\n", waste>>10); + + } + } + } + +#endif + +#ifdef _DEBUG + + void GC::CheckFreelist(GCAlloc *gca) + { + GCAlloc::GCBlock *b = gca->m_firstFree; + while(b) + { + void *freelist = b->firstFree; + while(freelist) + { + // b->firstFree should be either 0 end of free list or a pointer into b, otherwise, someone + // wrote to freed memory and hosed our freelist + GCAssert(freelist == 0 || ((intptr) freelist >= (intptr) b->items && (intptr) freelist < (intptr) b + GCHeap::kBlockSize)); + freelist = *((void**)freelist); + } + b = b->nextFree; + } + } + + void GC::CheckFreelists() + { + for(int i=0; i < kNumSizeClasses; i++) + { + CheckFreelist(containsPointersAllocs[i]); + CheckFreelist(noPointersAllocs[i]); + } + } + + void GC::UnmarkedScan(const void *mem, size_t size) + { + intptr lowerBound = memStart; + intptr upperBound = memEnd; + + intptr *p = (intptr *) mem; + intptr *end = p + (size / sizeof(void*)); + + while(p < end) + { + intptr val = *p++; + + if(val < lowerBound || val >= upperBound) + continue; + + // normalize and divide by 4K to get index + int bits = GetPageMapValue(val); + switch(bits) + { + case 0: + continue; + break; + case kGCAllocPage: + GCAssert(GCAlloc::ConservativeGetMark((const void*) (val&~7), true)); + break; + case kGCLargeAllocPageFirst: + GCAssert(GCLargeAlloc::ConservativeGetMark((const void*) (val&~7), true)); + break; + default: + GCAssertMsg(false, "Invalid pageMap value"); + break; + } + } + } + + void GC::FindUnmarkedPointers() + { + if(findUnmarkedPointers) + { + intptr m = memStart; + + while(m < memEnd) + { +#ifdef WIN32 + // first skip uncommitted memory + MEMORY_BASIC_INFORMATION mib; + VirtualQuery((void*) m, &mib, sizeof(MEMORY_BASIC_INFORMATION)); + if((mib.Protect & PAGE_READWRITE) == 0) { + m += mib.RegionSize; + continue; + } +#endif + // divide by 4K to get index + int bits = GetPageMapValue(m); + if(bits == kNonGC) { + UnmarkedScan((const void*)m, GCHeap::kBlockSize); + m += GCHeap::kBlockSize; + } else if(bits == kGCLargeAllocPageFirst) { + GCLargeAlloc::LargeBlock *lb = (GCLargeAlloc::LargeBlock*)m; + const void *item = GetUserPointer((const void*)(lb+1)); + if(GCLargeAlloc::GetMark(item) && GCLargeAlloc::ContainsPointers(GetRealPointer(item))) { + UnmarkedScan(item, GC::Size(item)); + } + m += lb->GetNumBlocks() * GCHeap::kBlockSize; + } else if(bits == kGCAllocPage) { + // go through all marked objects + GCAlloc::GCBlock *b = (GCAlloc::GCBlock *) m; + for (int i=0; i < b->alloc->m_itemsPerBlock; i++) { + // If the mark is 0, delete it. + int marked = GCAlloc::GetBit(b, i, GCAlloc::kMark); + if (!marked) { + void* item = (char*)b->items + b->alloc->m_itemSize*i; + if(GCAlloc::ContainsPointers(item)) { + UnmarkedScan(GetUserPointer(item), b->alloc->m_itemSize - DebugSize()); + } + } + } + + m += GCHeap::kBlockSize; + } + } + } + } + +/* macro to stack allocate a string containing 3*i (indent) spaces */ +#define ALLOCA_AND_FILL_WITH_SPACES(b, i) \ + { b = (char*)alloca((3*(i))+1); \ + int n = 0; \ + for(; n<3*(i); n++) b[n] = ' '; \ + b[n] = '\0'; } + + void GC::ProbeForMatch(const void *mem, size_t size, intptr value, int recurseDepth, int currentDepth) + { + intptr lowerBound = memStart; + intptr upperBound = memEnd; + + intptr *p = (intptr *) mem; + intptr *end = p + (size / sizeof(void*)); + + int bits = GetPageMapValue((uint32)mem); + + while(p < end) + { + intptr val = *p++; + + if(val < lowerBound || val >= upperBound) + continue; + + // did we hit ? + if (val == value) + { + // ok so let's see where we are + intptr* where = p-1; + GCHeap::HeapBlock* block = heap->AddrToBlock(where); + //GCAssertMsg(block->inUse(), "Not sure how we got here if the block is not in use?"); + GCAssertMsg(block->committed, "Means we are probing uncommitted memory. not good"); + int* ptr; + + switch(bits) + { + case kNonGC: + { + if (block->size == 1) + { + // fixed sized entries find out the size of the block + FixedAlloc::FixedBlock* fixed = (FixedAlloc::FixedBlock*) block->baseAddr; + int size = fixed->size; + + // now compute which element we are + int startAt = (int) &(fixed->items[0]); + int item = ((int)where-startAt) / size; + + ptr = (int*) ( startAt + (item*size) ); + } + else + { + // fixed large allocs ; start is after the block + ptr = (int*) block->baseAddr; + } + } + break; + + default: + ptr = ((int*)FindBeginning(where)) - 2; + break; + } + + int taggedSize = *ptr; + int traceIndex = *(ptr+1); + int* real = (ptr+2); + + char* buffer = 0; + ALLOCA_AND_FILL_WITH_SPACES(buffer, currentDepth); + + if (buffer) GCDebugMsg(false, buffer); + GCDebugMsg(false, "Location: 0x%08x Object: 0x%08x (size %d)\n", where, real, taggedSize); + if (buffer) GCDebugMsg(false, buffer); + PrintStackTraceByIndex(traceIndex); + + if (recurseDepth > 0) + WhosPointingAtMe(real, recurseDepth-1, currentDepth+1); + } + } + } + + /** + * This routine searches through all of GC memory looking for references to 'me' + * It ignores already claimed memory thus locating active references only. + * recurseDepth can be set to a +ve value in order to follow the chain of + * pointers arbitrarily deep. Watch out when setting it since you may see + * an exponential blow-up (usu. 1 or 2 is enough). 'currentDepth' is for + * indenting purposes and should be left alone. + */ + void GC::WhosPointingAtMe(void* me, int recurseDepth, int currentDepth) + { + intptr val = (intptr)me; + intptr m = memStart; + + char* buffer = 0; + ALLOCA_AND_FILL_WITH_SPACES(buffer, currentDepth); + + if (buffer) GCDebugMsg(false, buffer); + GCDebugMsg(false, "[%d] Probing for pointers to : 0x%08x\n", currentDepth, me); + while(m < memEnd) + { +#ifdef WIN32 + // first skip uncommitted memory + MEMORY_BASIC_INFORMATION mib; + VirtualQuery((void*) m, &mib, sizeof(MEMORY_BASIC_INFORMATION)); + if((mib.Protect & PAGE_READWRITE) == 0) + { + m += mib.RegionSize; + continue; + } +#endif + + // divide by 4K to get index + int bits = GetPageMapValue(m); + if(bits == kNonGC) + { + ProbeForMatch((const void*)m, GCHeap::kBlockSize, val, recurseDepth, currentDepth); + m += GCHeap::kBlockSize; + } + else if(bits == kGCLargeAllocPageFirst) + { + GCLargeAlloc::LargeBlock *lb = (GCLargeAlloc::LargeBlock*)m; + const void *item = GetUserPointer((const void*)(lb+1)); + bool marked = GCLargeAlloc::GetMark(item); + if (marked) + { + if(GCLargeAlloc::ContainsPointers(GetRealPointer(item))) + { + ProbeForMatch(item, GC::Size(item), val, recurseDepth, currentDepth); + } + } + m += lb->GetNumBlocks() * GCHeap::kBlockSize; + } + else if(bits == kGCAllocPage) + { + // go through all marked objects + GCAlloc::GCBlock *b = (GCAlloc::GCBlock *) m; + for (int i=0; i < b->alloc->m_itemsPerBlock; i++) + { + int marked = GCAlloc::GetBit(b, i, GCAlloc::kMark); + if (marked) + { + void* item = (char*)b->items + b->alloc->m_itemSize*i; + if(GCAlloc::ContainsPointers(item)) + { + ProbeForMatch(GetUserPointer(item), b->alloc->m_itemSize - DebugSize(), val, recurseDepth, currentDepth); + } + } + } + m += GCHeap::kBlockSize; + } + else + { + GCAssertMsg(false, "Oh seems we missed a case...Tom any ideas here?"); + + } + } + } +#undef ALLOCA_AND_FILL_WITH_SPACES +#endif + + + void GC::StartIncrementalMark() + { + GCAssert(!marking); + GCAssert(!collecting); + + lastStartMarkIncrementCount = markIncrements; + + // set the stack cleaning trigger + stackCleaned = false; + + marking = true; + + GCAssert(m_incrementalWork.Count() == 0); + + uint64 start = GetPerformanceCounter(); + + // clean up any pages that need sweeping + for(int i=0; i < kNumSizeClasses; i++) { +#ifdef MMGC_DRC + containsPointersRCAllocs[i]->SweepNeedsSweeping(); +#endif + containsPointersAllocs[i]->SweepNeedsSweeping(); + noPointersAllocs[i]->SweepNeedsSweeping(); + } + + // at this point every object should have no marks or be marked kFreelist +#ifdef _DEBUG + for(int i=0; i < kNumSizeClasses; i++) { +#ifdef MMGC_DRC + containsPointersRCAllocs[i]->CheckMarks(); +#endif + containsPointersAllocs[i]->CheckMarks(); + noPointersAllocs[i]->CheckMarks(); + } +#endif + + { +#ifdef GCHEAP_LOCK + GCAcquireSpinlock lock(m_rootListLock); +#endif + GCRoot *r = m_roots; + while(r) { + GCWorkItem item = r->GetWorkItem(); + MarkItem(item, m_incrementalWork); + r = r->next; + } + } + markTicks += GetPerformanceCounter() - start; + IncrementalMark(); + } + +#if 0 + // TODO: SSE2 version + void GC::MarkItem_MMX(const void *ptr, size_t size, GCStack &work) + { + intptr *p = (intptr*) ptr; + // deleted things are removed from the queue by setting them to null + if(!p) + return; + + bytesMarked += size; + marks++; + + intptr *end = p + (size / sizeof(void*)); + intptr thisPage = (intptr)p & ~0xfff; + + // since MarkItem recurses we have to do this before entering the loop + if(IsPointerToGCPage(ptr)) + { + int b = SetMark(ptr); +#ifdef _DEBUG + // def ref validation does a Trace which can + // cause things on the work queue to be already marked + // in incremental GC + if(!validateDefRef) { + GCAssert(!b); + } +#endif + } + + + _asm { + // load memStart and End into mm0 + movq mm0,memStart + } + + while(p < end) + { + _asm { + mov ebx, [p] + mov ecx, [count] + sar ecx, 1 + mov eax, dword ptr [lowerBound] + dec eax + movd mm1, eax + movd mm2, dword ptr [upperBound] + punpckldq mm1, mm1 + punpckldq mm2, mm2 + mov eax, 3 + movd mm5, eax + punpckldq mm5, mm5 + MarkLoop: + movq mm0, qword ptr [ebx] + movq mm3, mm0 + pcmpgtd mm3, mm1 + movq mm4, mm2 + pcmpgtd mm4, mm0 + pand mm3, mm4 + packssdw mm3, mm3 + movd eax, mm3 + or eax, eax + jz Advance + + // normalize and divide by 4K to get index + psubd mm0, mm1 + psrld mm0, 12 + + // shift amount to determine position in the byte (times 2 b/c 2 bits per page) + movq mm6, mm0 + pand mm6, mm5 + pslld mm6, 1 + packssdw mm6, mm6 + + // index = index >> 2 for pageMap index + psrld mm0, 2 + packssdw mm0, mm0 + + // check + push ecx + + + + push [workAddr] + movd edx, mm6 + push edx // packShiftAmount + movd edx, mm0 + push edx // packIndex4 + push eax // packTest + push dword ptr [ebx+4] // val2 + push dword ptr [ebx] // val1 + mov ecx, [this] + call ConservativeMarkMMXHelper + + pop ecx + + Advance: + add ebx, 8 + loop MarkLoop + mov dword ptr [p], ebx + } + } + } + +#endif + + void GC::MarkItem(GCWorkItem &wi, GCStack &work) + { + size_t size = wi.GetSize(); + intptr *p = (intptr*) wi.ptr; + + bytesMarked += size; + marks++; + + intptr *end = p + (size / sizeof(void*)); + intptr thisPage = (intptr)p & ~0xfff; + + // set the mark bits on this guy + if(wi.IsGCItem()) + { + int b = SetMark(wi.ptr); + (void)b; +#ifdef _DEBUG + // def ref validation does a Trace which can + // cause things on the work queue to be already marked + // in incremental GC + if(!validateDefRef) { + GCAssert(!b); + } +#endif + } + else + { + GCAssert(!IsPointerToGCPage(wi.ptr)); + } + + intptr _memStart = memStart; + intptr _memEnd = memEnd; + +#ifdef DEBUGGER + numObjects++; + objSize+=size; +#endif + + while(p < end) + { + intptr val = *p++; + + if(val < _memStart || val >= _memEnd) + continue; + + // normalize and divide by 4K to get index + int bits = GetPageMapValue(val); + + if (bits == 1) + { + //GCAlloc::ConservativeMark(work, (void*) (val&~7), workitem.ptr); + const void* item = (void*) (val&~7); + + GCAlloc::GCBlock *block = (GCAlloc::GCBlock*) ((intptr) item & ~0xFFF); + + // back up to real beginning + item = GetRealPointer((const void*) item); + + // guard against bogus pointers to the block header + if(item < block->items) + continue; + + // make sure this is a pointer to the beginning + + int itemNum = GCAlloc::GetIndex(block, item); + + if(block->items + itemNum * block->size != item) + continue; + + // inline IsWhite/SetBit + // FIXME: see if using 32 bit values is faster + uint32 *pbits = &block->GetBits()[itemNum>>3]; + int shift = (itemNum&0x7)<<2; + int bits = *pbits; + //if(GCAlloc::IsWhite(block, itemNum)) + if((bits & ((GCAlloc::kMark|GCAlloc::kQueued)<alloc->ContainsPointers()) + { + const void *realItem = item; + size_t itemSize = block->size; + #ifdef MEMORY_INFO + realItem = GetUserPointer(realItem); + itemSize -= DebugSize(); + #endif + if(((intptr)realItem & ~0xfff) != thisPage) + { + *pbits = bits | (GCAlloc::kQueued << shift); + block->gc->PushWorkItem(work, GCWorkItem(realItem, itemSize, true)); + } + else + { + // clear queued bit + *pbits = bits & ~(GCAlloc::kQueued << shift); + // skip stack for same page items, this recursion is naturally limited by + // how many item can appear on a page, worst case is 8 byte linked list or + // 512 + GCWorkItem newItem(realItem, itemSize, true); + MarkItem(newItem, work); + } + } + else + { + //GCAlloc::SetBit(block, itemNum, GCAlloc::kMark); + // clear queued bit + *pbits = bits & ~(GCAlloc::kQueued << shift); + *pbits = bits | (GCAlloc::kMark << shift); + } + #if defined(MEMORY_INFO) + GC::WriteBackPointer(item, (end==(void*)0x130000) ? p-1 : wi.ptr, block->size); + #endif + } + } + else if (bits == 3) + { + //largeAlloc->ConservativeMark(work, (void*) (val&~7), workitem.ptr); + const void* item = (void*) (val&~7); + + // back up to real beginning + item = GetRealPointer((const void*) item); + + if(((intptr) item & 0xfff) == sizeof(GCLargeAlloc::LargeBlock)) + { + GCLargeAlloc::LargeBlock *b = GCLargeAlloc::GetBlockHeader(item); + if((b->flags & (GCLargeAlloc::kQueuedFlag|GCLargeAlloc::kMarkFlag)) == 0) + { + size_t size = b->usableSize; + if((b->flags & GCLargeAlloc::kContainsPointers) != 0) + { + b->flags |= GCLargeAlloc::kQueuedFlag; + const void *realItem = item; + #ifdef MEMORY_INFO + realItem = GetUserPointer(item); + size -= DebugSize(); + #endif + b->gc->PushWorkItem(work, GCWorkItem(realItem, size, true)); + } + else + { + // doesn't need marking go right to black + b->flags |= GCLargeAlloc::kMarkFlag; + } + #if defined(MEMORY_INFO) + GC::WriteBackPointer(item, end==(void*)0x130000 ? p-1 : wi.ptr, size); + #endif + } + } + } + } + } + + uint64 GC::GetPerformanceCounter() + { + #ifdef WIN32 + LARGE_INTEGER value; + QueryPerformanceCounter(&value); + return value.QuadPart; + #else + #ifndef AVMPLUS_LINUX // TODO_LINUX + #ifndef MMGC_ARM + UnsignedWide microsecs; + ::Microseconds(µsecs); + + UInt64 retval; + memcpy(&retval, µsecs, sizeof(retval)); + return retval; + #endif //MMGC_ARM + #endif //AVMPLUS_LINUX + #endif + } + + uint64 GC::GetPerformanceFrequency() + { + #ifdef WIN32 + static uint64 gPerformanceFrequency = 0; + if (gPerformanceFrequency == 0) { + QueryPerformanceFrequency((LARGE_INTEGER*)&gPerformanceFrequency); + } + return gPerformanceFrequency; + #else + return 1000000; + #endif + } + + void GC::IncrementalMark(uint32 time) + { + SAMPLE_FRAME("[mark]", core()); + if(m_incrementalWork.Count() == 0 || hitZeroObjects) { + FinishIncrementalMark(); + return; + } + +#ifdef DEBUGGER + StartGCActivity(); +#endif + + markIncrements++; + // FIXME: tune this so that getPerformanceCounter() overhead is noise + static unsigned int checkTimeIncrements = 100; + uint64 start = GetPerformanceCounter(); + +#ifdef DEBUGGER + numObjects=0; + objSize=0; +#endif + + uint64 ticks = start + time * GetPerformanceFrequency() / 1000; + do { + unsigned int count = m_incrementalWork.Count(); + if (count == 0) { + hitZeroObjects = true; + break; + } + if (count > checkTimeIncrements) { + count = checkTimeIncrements; + } + for(unsigned int i=0; i>10; + gclog("[GC] mark(%d) %d objects (%d kb %d mb/s) in %4Lf millis (%4Lf s)\n", + markIncrements-lastStartMarkIncrementCount, numObjects, kb, + uint32(double(kb)/millis), millis, duration(t0)/1000); + } + StopGCActivity(); +#endif + } + + void GC::FinishIncrementalMark() + { + // Don't finish an incremental mark (i.e., sweep) if we + // are in the midst of a ZCT reap. + if (zct.reaping) + { + return; + } + + hitZeroObjects = false; + + // finished in Sweep + sweepStart = GetPerformanceCounter(); + + // mark roots again, could have changed (alternative is to put WB's on the roots + // which we may need to do if we find FinishIncrementalMark taking too long) + + { +#ifdef GCHEAP_LOCK + GCAcquireSpinlock lock(m_rootListLock); +#endif + GCRoot *r = m_roots; + while(r) { + GCWorkItem item = r->GetWorkItem(); + // need to do this while holding the root lock so we don't end + // up trying to scan a deleted item later, another reason to keep + // the root set small + MarkItem(item, m_incrementalWork); + r = r->next; + } + } + MarkQueueAndStack(m_incrementalWork); + +#ifdef _DEBUG + // need to traverse all marked objects and make sure they don't contain + // pointers to unmarked objects + FindMissingWriteBarriers(); +#endif + + GCAssert(!collecting); + collecting = true; + GCAssert(m_incrementalWork.Count() == 0); + Sweep(); + GCAssert(m_incrementalWork.Count() == 0); + collecting = false; + marking = false; + } + + int GC::IsWhite(const void *item) + { + // back up to real beginning + item = GetRealPointer((const void*) item); + + // normalize and divide by 4K to get index + if(!IsPointerToGCPage(item)) + return false; + int bits = GetPageMapValue((intptr)item); + switch(bits) { + case 1: + return GCAlloc::IsWhite(item); + case 3: + // FIXME: we only want pointers to the first page for large items, fix + // this by marking the first page and subsequent pages of large items differently + // in the page map (ie use 2). + return GCLargeAlloc::IsWhite(item); + } + return false; + } + + // TODO: fix headers so this can be declared there and inlined + void GC::WriteBarrierWrite(const void *address, const void *value) + { + GCAssert(!IsRCObject(value)); + *(int32*)address = (int32) value; + } + + // optimized version with no RC checks or pointer swizzling + void GC::writeBarrierRC(const void *container, const void *address, const void *value) + { + GCAssert(IsPointerToGCPage(container)); + GCAssert(((int32)container & 3) == 0); + GCAssert(((int32)address & 2) == 0); + GCAssert(address >= container); + GCAssert(address < (char*)container + Size(container)); + + WriteBarrierNoSubstitute(container, value); + WriteBarrierWriteRC(address, value); + } + + // TODO: fix headers so this can be declared there and inlined + void GC::WriteBarrierWriteRC(const void *address, const void *value) + { + #ifdef MMGC_DRC + RCObject *rc = (RCObject*)Pointer(*(RCObject**)address); + if(rc != NULL) { + GCAssert(rc == FindBeginning(rc)); + GCAssert(IsRCObject(rc)); + rc->DecrementRef(); + } + #endif + *(int32*)address = (int32) value; + #ifdef MMGC_DRC + rc = (RCObject*)Pointer(value); + if(rc != NULL) { + GCAssert(IsRCObject(rc)); + GCAssert(rc == FindBeginning(value)); + rc->IncrementRef(); + } + #endif + } + + void GC::WriteBarrier(const void *address, const void *value) + { + GC* gc = GC::GetGC(address); + if(Pointer(value) != NULL && gc->marking) { + void *container = gc->FindBeginning(address); + gc->WriteBarrierNoSubstitute(container, value); + } + gc->WriteBarrierWrite(address, value); + } + + void GC::WriteBarrierNoSub(const void *address, const void *value) + { + GC *gc = NULL; + if(value != NULL && (gc = GC::GetGC(address))->marking) { + void *container = gc->FindBeginning(address); + gc->WriteBarrierNoSubstitute(container, value); + } + } + + void GC::TrapWrite(const void *black, const void *white) + { + // assert fast path preconditions + (void)black; + GCAssert(marking); + GCAssert(GetMark(black)); + GCAssert(IsWhite(white)); + // currently using the simplest finest grained implementation, + // which could result in huge work queues. should try the + // more granular approach of moving the black object to grey + // (smaller work queue, less frequent wb slow path) but if the + // black object is big we end up doing useless redundant + // marking. optimal approach from lit is card marking (mark a + // region of the black object as needing to be re-marked) + if(ContainsPointers(white)) { + SetQueued(white); + PushWorkItem(m_incrementalWork, GCWorkItem(white, Size(white), true)); + } else { + SetMark(white); + } + } + + bool GC::ContainsPointers(const void *item) + { + item = GetRealPointer(item); + if (GCLargeAlloc::IsLargeBlock(item)) { + return GCLargeAlloc::ContainsPointers(item); + } else { + return GCAlloc::ContainsPointers(item); + } + } + + bool GC::IsGCMemory (const void *item) + { + int bits = GetPageMapValue((intptr)item); + return (bits != 0); + } + + bool GC::IsQueued(const void *item) + { + return !GetMark(item) && !IsWhite(item); + } + + uint32 *GC::GetBits(int numBytes, int sizeClass) + { + uint32 *bits; + + GCAssert(numBytes % 4 == 0); + + // hit freelists first + if(m_bitsFreelists[sizeClass]) { + bits = m_bitsFreelists[sizeClass]; + m_bitsFreelists[sizeClass] = *(uint32**)bits; + memset(bits, 0, sizeof(uint32*)); + return bits; + } + + if(!m_bitsNext) + m_bitsNext = (uint32*)heap->Alloc(1); + + int leftOver = GCHeap::kBlockSize - ((int)m_bitsNext & 0xfff); + if(leftOver >= numBytes) { + bits = m_bitsNext; + if(leftOver == numBytes) + m_bitsNext = 0; + else + m_bitsNext += numBytes/sizeof(uint32); + } else { + if(leftOver > 0) { + // put waste in freelist + for(int i=0, n=kNumSizeClasses; im_bitsInPage && a->m_numBitmapBytes <= leftOver) { + FreeBits(m_bitsNext, a->m_sizeClassIndex); + break; + } + } + } + m_bitsNext = 0; + // recurse rather than duplicating code + return GetBits(numBytes, sizeClass); + } + return bits; + } + + void GC::AddRoot(GCRoot *root) + { +#ifdef GCHEAP_LOCK + GCAcquireSpinlock lock(m_rootListLock); +#endif + root->prev = NULL; + root->next = m_roots; + if(m_roots) + m_roots->prev = root; + m_roots = root; + } + + void GC::RemoveRoot(GCRoot *root) + { +#ifdef GCHEAP_LOCK + GCAcquireSpinlock lock(m_rootListLock); +#endif + if( m_roots == root ) + m_roots = root->next; + else + root->prev->next = root->next; + + if(root->next) + root->next->prev = root->prev; + } + + void GC::AddCallback(GCCallback *cb) + { + CheckThread(); + cb->prevCB = NULL; + cb->nextCB = m_callbacks; + if(m_callbacks) + m_callbacks->prevCB = cb; + m_callbacks = cb; + } + + void GC::RemoveCallback(GCCallback *cb) + { + CheckThread(); + if( m_callbacks == cb ) + m_callbacks = cb->nextCB; + else + cb->prevCB->nextCB = cb->nextCB; + + if(cb->nextCB) + cb->nextCB->prevCB = cb->prevCB; + } + + void GC::PushWorkItem(GCStack &stack, GCWorkItem item) + { + if(item.ptr) { + stack.Push(item); + } + } + + GCWeakRef* GC::GetWeakRef(const void *item) + { + GC *gc = GetGC(item); + GCWeakRef *ref = (GCWeakRef*) gc->weakRefs.get(item); + if(ref == NULL) { + ref = new (gc) GCWeakRef(item); + gc->weakRefs.put(item, ref); + item = GetRealPointer(item); + if (GCLargeAlloc::IsLargeBlock(item)) { + GCLargeAlloc::SetHasWeakRef(item, true); + } else { + GCAlloc::SetHasWeakRef(item, true); + } + } else { + GCAssert(ref->get() == item); + } + return ref; + } + + void GC::ClearWeakRef(const void *item) + { + GCWeakRef *ref = (GCWeakRef*) weakRefs.remove(item); + GCAssert(weakRefs.get(item) == NULL); + GCAssert(ref != NULL); + GCAssert(ref->get() == item || ref->get() == NULL); + if(ref) { + ref->m_obj = NULL; + item = GetRealPointer(item); + if (GCLargeAlloc::IsLargeBlock(item)) { + GCLargeAlloc::SetHasWeakRef(item, false); + } else { + GCAlloc::SetHasWeakRef(item, false); + } + } + } + +#ifdef _DEBUG + + void GC::WhitePointerScan(const void *mem, size_t size) + { + intptr *p = (intptr *) mem; + // the minus 8 skips the deadbeef and back pointer + intptr *end = p + ((size) / sizeof(void*)); + + while(p < end) + { + intptr val = *p; + if(val == 0xdeadbeef) + break; + if(IsWhite((const void*) (val&~7)) && + *(((int*)(val&~7))+1) != 0xcacacaca && // Free'd + *(((int*)(val&~7))+1) != 0xbabababa) // Swept + { + GCDebugMsg(false, "Object 0x%x allocated here:\n", mem); + PrintStackTrace(mem); + GCDebugMsg(false, "Didn't mark pointer at 0x%x, object 0x%x allocated here:\n", p, val); + PrintStackTrace((const void*)(val&~7)); + GCAssert(false); + } + p++; + } + } + + void GC::FindMissingWriteBarriers() + { + if(!incrementalValidation) + return; + + intptr m = memStart; + while(m < memEnd) + { +#ifdef WIN32 + // first skip uncommitted memory + MEMORY_BASIC_INFORMATION mib; + VirtualQuery((void*) m, &mib, sizeof(MEMORY_BASIC_INFORMATION)); + if((mib.Protect & PAGE_READWRITE) == 0) { + m += mib.RegionSize; + continue; + } +#endif + // divide by 4K to get index + int bits = GetPageMapValue(m); + switch(bits) + { + case 0: + m += GCHeap::kBlockSize; + break; + case 3: + { + GCLargeAlloc::LargeBlock *lb = (GCLargeAlloc::LargeBlock*)m; + const void *item = GetUserPointer((const void*)(lb+1)); + if(GCLargeAlloc::GetMark(item) && GCLargeAlloc::ContainsPointers(item)) { + WhitePointerScan(item, lb->usableSize - DebugSize()); + } + m += lb->GetNumBlocks() * GCHeap::kBlockSize; + } + break; + case 1: + { + // go through all marked objects in this page + GCAlloc::GCBlock *b = (GCAlloc::GCBlock *) m; + for (int i=0; i< b->alloc->m_itemsPerBlock; i++) { + // find all marked objects and search them + if(!GCAlloc::GetBit(b, i, GCAlloc::kMark)) + continue; + + if(b->alloc->ContainsPointers()) { + void* item = (char*)b->items + b->alloc->m_itemSize*i; + WhitePointerScan(GetUserPointer(item), b->alloc->m_itemSize - DebugSize()); + } + } + m += GCHeap::kBlockSize; + } + break; + default: + GCAssert(false); + break; + } + } + } +#endif + +#ifdef DEBUGGER + void GC::StartGCActivity() + { + // invoke postsweep callback + GCCallback *cb = m_callbacks; + while(cb) { + cb->startGCActivity(); + cb = cb->nextCB; + } + } + + void GC::StopGCActivity() + { + // invoke postsweep callback + GCCallback *cb = m_callbacks; + while(cb) { + cb->stopGCActivity(); + cb = cb->nextCB; + } + } + + void GC::AllocActivity(int blocks) + { + // invoke postsweep callback + GCCallback *cb = m_callbacks; + while(cb) { + cb->allocActivity(blocks); + cb = cb->nextCB; + } + } +#endif /* DEBUGGER*/ + +#if defined(_MAC) && defined(MMGC_IA32) + // FIXME: 64 bit problem, use intptr + int GC::GetStackTop() const + { + return (int)pthread_get_stackaddr_np(pthread_self()); + } +#endif + + +} diff --git a/mozilla/js/tamarin/MMgc/GC.h b/mozilla/js/tamarin/MMgc/GC.h new file mode 100644 index 00000000000..5653158a5fb --- /dev/null +++ b/mozilla/js/tamarin/MMgc/GC.h @@ -0,0 +1,1030 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __GC__ +#define __GC__ + + + +#if defined MMGC_IA32 + +#ifdef WIN32 +// save all registers: they might have pointers in them. In theory, only +// need to save callee-saved regs. In practice, saving three extra pointers +// is cheap insurance. +#define MMGC_GET_STACK_EXENTS(_gc, _stack, _size) \ + int save1,save2,save3,save4,save5,save6,save7;\ + __asm mov save1, eax \ + __asm mov save2, ebx \ + __asm mov save3, ecx \ + __asm mov save4, edx \ + __asm mov save5, ebp \ + __asm mov save6, esi \ + __asm mov save7, edi \ + __asm { mov _stack,esp } ;\ + MEMORY_BASIC_INFORMATION __mib;\ + VirtualQuery(_stack, &__mib, sizeof(MEMORY_BASIC_INFORMATION)); \ + _size = __mib.RegionSize - ((intptr) _stack - (intptr)__mib.BaseAddress); + +#else +#define MMGC_GET_STACK_EXENTS(_gc, _stack, _size) \ + do { \ + volatile auto int save1,save2,save3,save4,save5,save6,save7;\ + asm("movl %%eax,%0" : "=r" (save1));\ + asm("movl %%ebx,%0" : "=r" (save2));\ + asm("movl %%ecx,%0" : "=r" (save3));\ + asm("movl %%edx,%0" : "=r" (save4));\ + asm("movl %%ebp,%0" : "=r" (save5));\ + asm("movl %%esi,%0" : "=r" (save6));\ + asm("movl %%edi,%0" : "=r" (save7));\ + asm("movl %%esp,%0" : "=r" (_stack));\ + _size = (intptr)_gc->GetStackTop() - (intptr)_stack; } while (0) +#endif + +#elif defined MMGC_PPC + +/* On PowerPC, we need to mark the PPC non-volatile registers, + * since they may contain register variables that aren't + * anywhere on the machine stack. */ +// TPR - increasing to 20 causes this code to not get optimized out + +#ifdef __GNUC__ + +#define MMGC_GET_STACK_EXENTS(_gc, _stack, _size) \ + int __ppcregs[20]; \ + asm("stmw r13,0(%0)" : : "b" (__ppcregs));\ + _stack = __ppcregs;\ + void *__stackBase;\ + asm ("mr r3,r1\n"\ + "StackBaseLoop%1%2: mr %0,r3\n" \ + "lwz r3,0(%0)\n"\ + "rlwinm r3,r3,0,0,30\n"\ + "cmpi cr0,r3,0\n"\ + "bne StackBaseLoop%1%2" : "=b" (__stackBase) : "i" (__FILE__), "i" (__LINE__) : "r3"); \ + _size = (intptr) __stackBase - (intptr) _stack; + +#else + +#define MMGC_GET_STACK_EXENTS(_gc, _stack, _size) \ + int __ppcregs[20]; \ + asm("stmw r13,0(%0)" : : "b" (__ppcregs));\ + _stack = __ppcregs;\ + void *__stackBase;\ + asm ("mr r3,r1\n"\ + "StackBaseLoop: mr %0,r3\n"\ + "lwz r3,0(%0)\n"\ + "rlwinm r3,r3,0,0,30\n"\ + "cmpi cr0,r3,0\n"\ + "bne StackBaseLoop" : "=b" (__stackBase) : : "r3"); \ + _size = (intptr) __stackBase - (intptr) _stack; + +#endif + +#elif defined MMGC_ARM + +// Store nonvolatile registers r4-r10 +// Find stack pointer +#define MMGC_GET_STACK_EXENTS(_gc, _stack, _size) \ + int regs[7];\ + asm("stmia %0,{r4-r10}" : : "r" (regs));\ + asm("mov %0,sp" : "=r" (_stack));\ + _size = (intptr)StackTop - (intptr)_stack; + +#endif + +#ifdef DEBUGGER +namespace avmplus +{ + class AvmCore; +} +#endif + +namespace MMgc +{ + /** + * GCRoot is root in the reachability graph, it contains a pointer a size + * and will be searched for things. + */ + class GCRoot + { + friend class GC; + public: + /** subclassing constructor */ + GCRoot(GC *gc); + /** general constructor */ + GCRoot(GC *gc, const void *object, size_t size); + virtual ~GCRoot(); + + // override new and delete so we can know the objects extents (via FixedMalloc::Size()) + void *operator new(size_t size) + { + return FixedMalloc::GetInstance()->Alloc(size); + } + + void operator delete (void *object) + { + FixedMalloc::GetInstance()->Free(object); + } + + const void *Get() const { return object; } + void Set(const void *object, size_t size); + + GC *GetGC() const { return gc; } + /** if your object goes away after the GC is deleted this can be useful */ + void Destroy(); + + private: + FixedMalloc* fm; + GC * gc; + GCRoot *next; + GCRoot *prev; + const void *object; + size_t size; + + GCWorkItem GetWorkItem() const { return GCWorkItem(object, size, false); } + }; + + /** + * GCCallback is an interface that allows the application to get + * callbacks at interesting GC points. + */ + class GCCallback + { + friend class GC; + friend class ZCT; + public: + GCCallback(GC *gc); + virtual ~GCCallback(); + + GC *GetGC() const { return gc; } + /** if your object goes away after the GC is deleted this can be useful */ + void Destroy(); + + /** + * This method is invoked after all marking and before any + * sweeping, useful for bookkeeping based on whether things + * got marked + */ + virtual void presweep() {} + + /** + * This method is invoked after all sweeping + */ + virtual void postsweep() {} + + /** + * This method is called whenever the collector decides to expand the heap + */ + virtual void heapgrew() {} + +#ifdef MMGC_DRC + // called before a ZCT reap begins + virtual void prereap() {} + + // called after a ZCT reap completes + virtual void postreap() {} +#endif + + /** + * This method is called before an RC object is reaped + */ + virtual void prereap(void* /*rcobj*/) {} + +#ifdef DEBUGGER + virtual void log(const char* /*str*/) {} + + virtual void startGCActivity() {} + virtual void stopGCActivity() {} + // negative when blocks are reclaimed + virtual void allocActivity(int /*blocks*/) {} +#endif + + private: + GC *gc; + GCCallback *nextCB; + GCCallback *prevCB; + }; + + template + class GCHiddenPointer + { + public: + GCHiddenPointer(T obj) { set(obj); } + operator T() const { return (T) (low16|high16<<16); } + T operator=(T tNew) + { + set(tNew); + return (T)this; + } + T operator->() const { return (T) (low16|high16<<16); } + + private: + // private to prevent its use and someone adding it, GCC creates + // WriteBarrier's on the stack with it + GCHiddenPointer(const GCHiddenPointer& toCopy) { GCAssert(false); } + + void set(T obj) + { + uint32 p = (uint32)obj; + high16 = p >> 16; + low16 = p & 0x0000ffff; + } + uint32 high16; + uint32 low16; + }; + + /** + * The Zero Count Table used by DRC. + */ + class ZCT + { + friend class GC; + // how many items there have to be to trigger a Reap + static const int ZCT_REAP_THRESHOLD; + + // size of table in pages + static const int ZCT_START_SIZE; + public: + ZCT(GCHeap *heap); + ~ZCT(); + void Add(RCObject *obj); + void Remove(RCObject *obj); + void Reap(); +#if !defined(WIN32) && defined(MMGC_IA32) + int StackTop; +#endif // !defined(WIN32) && defined(MMGC_IA32) + private: + GC *gc; + + // in pages + int zctSize; + + // the zero count table + RCObject **zct; + + // index to the end + RCObject **zctNext; + + // freelist of open slots + RCObject **zctFreelist; + + // during a reap where we are + int zctIndex; + + // during a reap becomes zctNext + int nextPinnedIndex; + + int count; + int zctReapThreshold; + + // are we reaping the zct? + bool reaping; + + void PinStackObjects(const void *start, size_t len); + bool IsZCTFreelist(RCObject **obj) + { + return obj >= zct && obj < (RCObject**)(zct+zctSize/sizeof(RCObject*)); + } + }; + + /** + * This is a general-purpose garbage collector used by the Flash Player. + * Application code must implement the GCRoot interface to mark all + * reachable data. Unreachable data is automatically destroyed. + * Objects may optionally be finalized by subclassing the GCObject + * interface. + * + * This garbage collector is intended to be modular, such that + * it can be used in other products or replaced with a different + * collector in the future. + * + * Memory allocation and garbage collection strategy: + * Mark and sweep garbage collector using fixed size classes + * implemented by the GCAlloc class. Memory blocks are obtained + * from the OS via the GCHeap heap manager class. + * + * When an allocation fails because a suitable memory block is + * not available, the garbage collector decides either to garbage + * collect to free up space, or to expand the heap. The heuristic + * used to make the decision to collect or expand is taken from the + * Boehm-Demers-Weiser (BDW) garbage collector and memory allocator. + * The BDW algorithm is (pseudo-code): + * + * if (allocs since collect >= heap size / FSD) + * collect + * else + * expand(request size + heap size / FSD) + * + * The FSD is the "Free Space Divisor." For the first cut, I'm trying + * 4. TODO: Try various FSD values against real Player workloads + * to find the optimum value. + * + */ + class GC : public GCAllocObject + { + friend class GCRoot; + friend class GCCallback; + friend class GCAlloc; + friend class GCLargeAlloc; + friend class RCObject; + friend class GCInterval; + friend class ZCT; + public: + + /** + * If you need context vars use this! + */ + enum + { + GCV_COREPLAYER, + GCV_AVMCORE, + GCV_COUNT + }; + void *GetGCContextVariable(int var) const { return m_contextVars[var]; } + void SetGCContextVariable(int var, void *val) { m_contextVars[var] = val; } + +#ifdef DEBUGGER + avmplus::AvmCore *core() const { return (avmplus::AvmCore*)GetGCContextVariable(GCV_AVMCORE); } +#endif + + /** + * greedy is a debugging flag. When set, every allocation + * will cause a garbage collection. This makes code run + * abysmally slow, but can be useful for detecting mark + * bugs. + */ + bool greedy; + + /** + * nogc is a debugging flag. When set, garbage collection + * never happens. + */ + bool nogc; + + /** + * findUnmarkedPointers is a debugging flag, only + */ + bool findUnmarkedPointers; + + /** + * turns on code that does a trace before reaping zero count object and asserting on + * any objects that get marked, debug builds only + */ + bool validateDefRef; + bool keepDRCHistory; + + /** + * incremental space divisor + */ + int ISD; + + const static size_t collectThreshold; + + bool gcstats; + + bool dontAddToZCTDuringCollection; + +#ifdef _DEBUG + bool incrementalValidation; + bool incrementalValidationPedantic; +#endif + + bool incremental; + +#ifdef _DEBUG + /** + * turn on memory profiling + */ + const static bool enableMemoryProfiling; +#endif + + // -- Interface + GC(GCHeap *heap); + ~GC(); + + /** + * Causes an immediate garbage collection + */ + void Collect(); + + /** + * flags to be passed as second argument to alloc + */ + enum AllocFlags + { + kZero=1, + kContainsPointers=2, + kFinalize=4, + kRCObject=8 + }; + + enum PageType + { + kNonGC = 0, + kGCAllocPage = 1, + kGCLargeAllocPageRest = 2, + kGCLargeAllocPageFirst = 3 + }; + + /** + * Main interface for allocating memory. Default flags is no + * finalization, contains pointers is set and zero is set + */ + void *Alloc(size_t size, int flags=0, int skip=3); + + + /** + * overflow checking way to call Alloc for a # of n size'd items, + * all instance of Alloc(num*sizeof(thing)) should be replaced with: + * Calloc(num, sizeof(thing)) + */ + void *Calloc(size_t num, size_t elsize, int flags=0, int skip=3); + + /** + * One can free a GC allocated pointer, this will throw an assertion + * if called during the Sweep phase (ie via a finalizer) it can only be + * used outside the scope of a collection + */ + void Free(void *ptr); + + /** + * return the size of a piece of memory, may be bigger than what was asked for + */ + static size_t Size(const void *ptr) + { + GCAssert(GetGC(ptr)->IsGCMemory(ptr)); + size_t size = GCLargeAlloc::GetBlockHeader(ptr)->usableSize; + size -= DebugSize(); + return size; + + } + + /** + * Tracers should employ GetMark and SetMark to + * set the mark bits during the mark pass. + */ + static int GetMark(const void *item) + { + item = GetRealPointer(item); + if (GCLargeAlloc::IsLargeBlock(item)) { + return GCLargeAlloc::GetMark(item); + } else { + return GCAlloc::GetMark(item); + } + } + + static int SetMark(const void *item) + { + GCAssert(item != NULL); +#ifdef MEMORY_INFO + GC *gc = GetGC(item); + item = GetRealPointer(item); + GCAssert(gc->IsPointerToGCPage(item)); +#endif + if (GCLargeAlloc::IsLargeBlock(item)) { + return GCLargeAlloc::SetMark(item); + } else { + return GCAlloc::SetMark(item); + } + } + + void SetQueued(const void *item) + { +#ifdef MEMORY_INFO + item = GetRealPointer(item); + GCAssert(IsPointerToGCPage(item)); +#endif + if (GCLargeAlloc::IsLargeBlock(item)) { + GCLargeAlloc::SetQueued(item); + } else { + GCAlloc::SetQueued(item); + } + } + + static void ClearFinalized(const void *item) + { +#ifdef MEMORY_INFO + GC *gc = GetGC(item); + item = GetRealPointer(item); + GCAssert(gc->IsPointerToGCPage(item)); +#endif + if (GCLargeAlloc::IsLargeBlock(item)) { + GCLargeAlloc::ClearFinalized(item); + } else { + GCAlloc::ClearFinalized(item); + } + } + + static void SetFinalize(const void *item) + { +#ifdef MEMORY_INFO + GC *gc = GetGC(item); + item = GetRealPointer(item); + GCAssert(gc->IsPointerToGCPage(item)); +#endif + if (GCLargeAlloc::IsLargeBlock(item)) { + GCLargeAlloc::SetFinalize(item); + } else { + GCAlloc::SetFinalize(item); + } + } + + static int IsFinalized(const void *item) + { +#ifdef MEMORY_INFO + GC *gc = GetGC(item); + item = GetRealPointer(item); + GCAssert(gc->IsPointerToGCPage(item)); +#endif + if (GCLargeAlloc::IsLargeBlock(item)) { + return GCLargeAlloc::IsFinalized(item); + } else { + return GCAlloc::IsFinalized(item); + } + } + + static int HasWeakRef(const void *item) + { +#ifdef MEMORY_INFO + GC *gc = GetGC(item); + item = GetRealPointer(item); + GCAssert(gc->IsPointerToGCPage(item)); +#endif + if (GCLargeAlloc::IsLargeBlock(item)) { + return GCLargeAlloc::HasWeakRef(item); + } else { + return GCAlloc::HasWeakRef(item); + } + } + + /** + * Utility function: Returns the GC object + * associated with an allocated object + */ + static GC* GetGC(const void *item) + { + GC **gc = (GC**) ((intptr)item&~0xfff); + return *gc; + } + + /** + * Used by sub-allocators to obtain memory + */ + void* AllocBlock(int size, int pageType, bool zero=true); + void FreeBlock(void *ptr, uint32 size); + + GCHeap *GetGCHeap() const { return heap; } + +#ifdef MMGC_DRC + void ReapZCT() { zct.Reap(); } + bool Reaping() { return zct.reaping; } +#ifdef _DEBUG + void RCObjectZeroCheck(RCObject *); +#endif +#endif + + /** + * debugging tool + */ + bool IsPointerToGCPage(const void *item); + + /** + * Do as much marking as possible in time milliseconds + */ + void IncrementalMark(uint32 time=10); + + /** + * Are we currently marking + */ + bool IncrementalMarking() { return marking; } + + // a magical write barriers that finds the container's address and the GC, just + // make sure address is a pointer to a GC page, only used by WB smart pointers + static void WriteBarrier(const void *address, const void *value); + static void WriteBarrierNoSub(const void *address, const void *value); + + void writeBarrier(const void *container, const void *address, const void *value) + { + GCAssert(IsPointerToGCPage(container)); + GCAssert(((int32)address & 3) == 0); + GCAssert(address >= container); + GCAssert(address < (char*)container + Size(container)); + + WriteBarrierNoSubstitute(container, value); + WriteBarrierWrite(address, value); + } + + // optimized version with no RC checks or pointer masking + void writeBarrierRC(const void *container, const void *address, const void *value); + + /** + Write barrier when the value could be a pointer with anything in the lower 3 bits + FIXME: maybe assert that the lower 3 bits are either zero or a pointer type signature, + this would require the application to tell us what bit patterns are pointers. + */ + __forceinline void WriteBarrierNoSubstitute(const void *container, const void *value) + { + WriteBarrierTrap(container, (const void*)((intptr)value&~7)); + } + + /** + AVM+ write barrier, valuePtr is known to be pointer and the caller + does the write + */ + __forceinline void WriteBarrierTrap(const void *container, const void *valuePtr) + { + GCAssert(IsPointerToGCPage(container)); + GCAssert(((intptr)valuePtr&7) == 0); + GCAssert(IsPointerToGCPage(container)); + if(marking && valuePtr && GetMark(container) && IsWhite(valuePtr)) + { + TrapWrite(container, valuePtr); + } + } + + void ConservativeWriteBarrierNoSubstitute(const void *address, const void *value) + { + if(IsPointerToGCPage(address)) + WriteBarrierNoSubstitute(FindBeginning(address), value); + } + + private: + __forceinline void WriteBarrierWrite(const void *address, const void *value); + __forceinline void WriteBarrierWriteRC(const void *address, const void *value); + + public: + + bool ContainsPointers(const void *item); + + void *FindBeginning(const void *gcItem) + { + GCAssert(gcItem != NULL); + GCAssert(GetPageMapValue((intptr)gcItem) != 0); + void *realItem = NULL; + int bits = GetPageMapValue((intptr)gcItem); + switch(bits) + { + case kGCAllocPage: + realItem = GCAlloc::FindBeginning(gcItem); + break; + case kGCLargeAllocPageFirst: + realItem = GCLargeAlloc::FindBeginning(gcItem); + break; + case kGCLargeAllocPageRest: + while(bits == kGCLargeAllocPageRest) + { + gcItem = (void*) ((intptr)gcItem - GCHeap::kBlockSize); + bits = GetPageMapValue((intptr)gcItem); + } + realItem = GCLargeAlloc::FindBeginning(gcItem); + break; + } +#ifdef MEMORY_INFO + realItem = GetUserPointer(realItem); +#endif + return realItem; + } + +#ifdef MMGC_DRC + bool IsRCObject(const void *); +#else + bool IsRCObject(const void *) { return false; } +#endif + + + bool Collecting() const { return collecting; } + + bool IsGCMemory (const void *); + + bool IsQueued(const void *item); + + static uint64 GetPerformanceCounter(); + static uint64 GetPerformanceFrequency(); + + static double duration(uint64 start) + { + return (double(GC::GetPerformanceCounter() - start) * 1000) / GC::GetPerformanceFrequency(); + } + + void DisableThreadCheck() { disableThreadCheck = true; } + + uint64 t0; + +#ifdef _DEBUG + char *msgBuf; + const char *msg(); +#endif + + static uint64 ticksToMicros(uint64 ticks) { return (ticks*1000000)/GetPerformanceFrequency(); } + + static uint64 ticksToMillis(uint64 ticks) { return (ticks*1000)/GetPerformanceFrequency(); } + + // marking rate counter + uint64 bytesMarked; + uint64 markTicks; + + // calls to mark item + uint32 lastStartMarkIncrementCount; + uint32 markIncrements; + uint32 marks; + uint32 sweeps; + + uint32 numObjects; + uint32 objSize; + + uint64 sweepStart; + + // if we hit zero in a marking incremental force completion in the next one + bool hitZeroObjects; + + // called at some apropos moment from the mututor, ideally at a point + // where all possible GC references will be below the current stack pointer + // (ie in memory we can safely zero). This will return right away if + // called more than once between collections so it can safely be called + // a lot without impacting performance + void CleanStack(bool force=false); + + bool Destroying() { return destroying; } + + void ClearWeakRef(const void *obj); + + int GetStackTop() const; + + private: + + void gclog(const char *format, ...); + + const static int kNumSizeClasses = 40; + + // FIXME: only used for FixedAlloc, GCAlloc sized dynamically + const static int kPageUsableSpace = 3936; + + uint32 *GetBits(int numBytes, int sizeClass); + void FreeBits(uint32 *bits, int sizeClass) + { +#ifdef _DEBUG + for(int i=0, n=noPointersAllocs[sizeClass]->m_numBitmapBytes; i m_incrementalWork; + void StartIncrementalMark(); + void FinishIncrementalMark(); + int IsWhite(const void *item); + + uint64 lastMarkTicks; + uint64 lastSweepTicks; + + const static int16 kSizeClasses[kNumSizeClasses]; + const static uint8 kSizeClassIndex[246]; + + void *m_contextVars[GCV_COUNT]; + + // bitmap for what pages are in use, 2 bits for every page + // 0 - not in use + // 1 - used by GCAlloc + // 3 - used by GCLargeAlloc + intptr memStart; + intptr memEnd; + + size_t totalGCPages; + + unsigned char *pageMap; + + inline int GetPageMapValue(uint32 addr) const + { + uint32 index = (addr-memStart) >> 12; + + GCAssert(index >> 2 < 64 * GCHeap::kBlockSize); + // shift amount to determine position in the byte (times 2 b/c 2 bits per page) + uint32 shiftAmount = (index&0x3) * 2; + // 3 ... is mask for 2 bits, shifted to the left by shiftAmount + // finally shift back by shift amount to get the value 0, 1 or 3 + //return (pageMap[addr >> 2] & (3<> shiftAmount; + return (pageMap[index >> 2] >> shiftAmount) & 3; + } + void SetPageMapValue(uint32 addr, int val); + void ClearPageMapValue(uint32 addr); + + void MarkGCPages(void *item, uint32 numpages, int val); + void UnmarkGCPages(void *item, uint32 numpages); + + /** + * Mark a region of memory, this will search all memory pointed to recursively + * and mark any GC Objects it finds + */ + void ConservativeMarkRegion(const void *base, size_t bytes); + + GCAlloc *containsPointersAllocs[kNumSizeClasses]; +#ifdef MMGC_DRC + GCAlloc *containsPointersRCAllocs[kNumSizeClasses]; +#endif + GCAlloc *noPointersAllocs[kNumSizeClasses]; + GCLargeAlloc *largeAlloc; + GCHeap *heap; + + void* AllocBlockIncremental(int size, bool zero=true); + void* AllocBlockNonIncremental(int size, bool zero=true); + + void ClearMarks(); +#ifdef _DEBUG + public: + // sometimes useful for mutator to call this + void Trace(const void *stackStart=NULL, size_t stackSize=0); + private: +#else + void Trace(const void *stackStart=NULL, size_t stackSize=0); +#endif + + void Finalize(); + void Sweep(bool force=false); + void ForceSweep() { Sweep(true); } + void Mark(GCStack &work); + void MarkQueueAndStack(GCStack &work); + void MarkItem(GCStack &work) + { + GCWorkItem workitem = work.Pop(); + MarkItem(workitem, work); + } + void MarkItem(GCWorkItem &workitem, GCStack &work); + // Write barrier slow path + + void TrapWrite(const void *black, const void *white); + + unsigned int allocsSinceCollect; + // The collecting flag prevents an unwanted recursive collection. + bool collecting; + + bool finalizedValue; + + // list of pages to be swept, built up in Finalize + void AddToSmallEmptyBlockList(GCAlloc::GCBlock *b) + { + b->next = smallEmptyPageList; + smallEmptyPageList = b; + } + GCAlloc::GCBlock *smallEmptyPageList; + + // list of pages to be swept, built up in Finalize + void AddToLargeEmptyBlockList(GCLargeAlloc::LargeBlock *lb) + { + lb->next = largeEmptyPageList; + largeEmptyPageList = lb; + } + GCLargeAlloc::LargeBlock *largeEmptyPageList; + +#ifdef GCHEAP_LOCK + GCSpinLock m_rootListLock; +#endif + + GCRoot *m_roots; + void AddRoot(GCRoot *root); + void RemoveRoot(GCRoot *root); + + GCCallback *m_callbacks; + void AddCallback(GCCallback *cb); + void RemoveCallback(GCCallback *cb); + +#ifdef MMGC_DRC + // Deferred ref counting implementation + ZCT zct; + void AddToZCT(RCObject *obj) { zct.Add(obj); } + // public for one hack from Interval.cpp - no one else should call + // this out of the GC +public: + void RemoveFromZCT(RCObject *obj) { zct.Remove(obj); } +private: +#endif + + static const void *Pointer(const void *p) { return (const void*)(((int)p)&~7); } + +#ifdef MEMORY_INFO +public: + void DumpMemoryInfo(); +private: +#endif + + void CheckThread(); + + void PushWorkItem(GCStack &stack, GCWorkItem item); + +#ifdef DEBUGGER + // sent for Collect (fullgc) + // and Start/IncrementalMark/Sweep for incremental + void StartGCActivity(); + void StopGCActivity(); + void AllocActivity(int blocks); +#endif + +#ifdef _DEBUG + void CheckFreelist(GCAlloc *gca); + void CheckFreelists(); + + int m_gcLastStackTrace; + void UnmarkedScan(const void *mem, size_t size); + // find unmarked pointers in entire heap + void FindUnmarkedPointers(); + + // methods for incremental verification + + // scan a region of memory for white pointers, used by FindMissingWriteBarriers + void WhitePointerScan(const void *mem, size_t size); + + // scan all GC memory (skipping roots) If a GC object is black make sure + // it has no white pointers, skip it if its grey. + void FindMissingWriteBarriers(); +#ifdef WIN32 + // store a handle to the thread that create the GC to ensure thread safety + DWORD m_gcThread; +#endif +#endif + +public: +#ifdef MEMORY_INFO + void DumpBackPointerChain(void *o); + + // debugging routine that records who marked who, can be used to + // answer the question, how did I get marked? also could be used to + // find false positives by verifying the back pointer chain gets back + // to a GC root + static void WriteBackPointer(const void *item, const void *container, size_t itemSize); +#endif +#ifdef _DEBUG + // Dump a list of objects that have pointers to the given location. + void WhosPointingAtMe(void* me, int recurseDepth=0, int currentDepth=0); + void ProbeForMatch(const void *mem, size_t size, intptr value, int recurseDepth, int currentDepth); +#endif + }; + + // helper class to wipe out vtable pointer of members for DRC + class Cleaner + { + public: + Cleaner() {} + // don't let myself move between objects + Cleaner& operator=(const Cleaner& /*rhs*/) { return *this; } + void set(const void *v, size_t size) { this->v = (int*)v; this->size = size; } + ~Cleaner() { + if(v) + memset(v, 0, size); + v = 0; + size = 0; + } + int *v; + size_t size; + }; +} + +#endif /* __GC__ */ diff --git a/mozilla/js/tamarin/MMgc/GCAlloc.cpp b/mozilla/js/tamarin/MMgc/GCAlloc.cpp new file mode 100644 index 00000000000..43a2c733daf --- /dev/null +++ b/mozilla/js/tamarin/MMgc/GCAlloc.cpp @@ -0,0 +1,673 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include +#include +#include + +#include "MMgc.h" + +namespace MMgc +{ + GCAlloc::GCAlloc(GC* gc, int itemSize, bool containsPointers, bool isRC, int sizeClassIndex) : + m_gc(gc), + containsPointers(containsPointers), + containsRCObjects(isRC), + m_sizeClassIndex(sizeClassIndex) + { + // Round itemSize to the nearest boundary of 8 + itemSize = (itemSize+7)&~7; + + m_firstBlock = NULL; + m_lastBlock = NULL; + m_firstFree = NULL; + m_needsSweeping = NULL; + m_numAlloc = 0; + m_maxAlloc = 0; + m_itemSize = itemSize; + m_numBlocks = 0; + m_finalized = false; + + // The number of items per block is kBlockSize minus + // the # of pointers at the base of each page. + + m_itemsPerBlock = (kBlockSize - sizeof(GCBlock)) / m_itemSize; + + m_numBitmapBytes = (m_itemsPerBlock>>1) + (m_itemsPerBlock & 1); + // round up to 4 bytes so we can go through the bits 8 items at a time + m_numBitmapBytes = (m_numBitmapBytes+3)&~3; + + GCAssert(m_numBitmapBytes<<1 >= m_itemsPerBlock); + + int usedSpace = m_itemsPerBlock * m_itemSize + sizeof(GCBlock); + GCAssert(usedSpace <= kBlockSize); + GCAssert(kBlockSize - usedSpace < (int)m_itemSize); + + // never store the bits in the page for !containsPointers b/c we don't want + // to force pages into memory for bit marking purposes when we don't need + // to bring them in for scanning purposes + // ISSUE: is this bitsInPage stuff really worth it? Maybe simplicity and + // locality suggest otherwise? + m_bitsInPage = containsPointers && kBlockSize - usedSpace >= m_numBitmapBytes; + + // compute values that let us avoid division + GCAssert(m_itemSize <= 0xffff); + ComputeMultiplyShift((uint16)m_itemSize, multiple, shift); + } + + GCAlloc::~GCAlloc() + { + // Free all of the blocks + GCAssertMsg(GetNumAlloc() == 0, "You have leaks"); + + while (m_firstBlock) { + if(((intptr)m_firstBlock->bits & 0xfff) == 0) + m_gc->GetGCHeap()->Free(m_firstBlock->bits); +#ifdef _DEBUG + // go through every item on the free list and make sure it wasn't written to + // after being poisoned. + void *item = m_firstBlock->firstFree; + while(item) { + for(int i=3, n=(m_firstBlock->size>>2)-1; iGetBits(m_numBitmapBytes, m_sizeClassIndex); + + // Allocate a new block + m_maxAlloc += m_itemsPerBlock; + m_numBlocks++; + + int numBlocks = kBlockSize/GCHeap::kBlockSize; + GCBlock* b = (GCBlock*) m_gc->AllocBlock(numBlocks, GC::kGCAllocPage); + + b->gc = m_gc; + b->alloc = this; + b->size = m_itemSize; + b->needsSweeping = false; + if(m_gc->collecting && m_finalized) + b->finalizeState = m_gc->finalizedValue; + else + b->finalizeState = !m_gc->finalizedValue; + + b->bits = m_bitsInPage ? (uint32*)((char*)b + sizeof(GCBlock)) : bits; + + // Link the block at the end of the list + b->prev = m_lastBlock; + b->next = 0; + + if (m_lastBlock) { + m_lastBlock->next = b; + } + if (!m_firstBlock) { + m_firstBlock = b; + } + m_lastBlock = b; + + // Add our new ChunkBlock to the firstFree list (which should be empty) + if (m_firstFree) + { + GCAssert(m_firstFree->prevFree == 0); + m_firstFree->prevFree = b; + } + b->nextFree = m_firstFree; + b->prevFree = 0; + m_firstFree = b; + + // calculate back from end (better alignment, no dead space at end) + b->items = (char*)b+GCHeap::kBlockSize - m_itemsPerBlock * m_itemSize; + b->nextItem = b->items; + b->numItems = 0; + + return b; + } + + void GCAlloc::UnlinkChunk(GCBlock *b) + { + m_maxAlloc -= m_itemsPerBlock; + m_numBlocks--; + + // Unlink the block from the list + if (b == m_firstBlock) { + m_firstBlock = b->next; + } else { + b->prev->next = b->next; + } + + if (b == m_lastBlock) { + m_lastBlock = b->prev; + } else { + b->next->prev = b->prev; + } + + if(b->nextFree || b->prevFree || b == m_firstFree) { + RemoveFromFreeList(b); + } +#ifdef _DEBUG + b->next = b->prev = NULL; + b->nextFree = b->prevFree = NULL; +#endif + } + + void GCAlloc::FreeChunk(GCBlock* b) + { + GCAssert(b->numItems == 0); + if(!m_bitsInPage) { + memset(b->GetBits(), 0, m_numBitmapBytes); + m_gc->FreeBits(b->GetBits(), m_sizeClassIndex); + b->bits = NULL; + } + + // Free the memory + m_gc->FreeBlock(b, 1); + } + + void* GCAlloc::Alloc(size_t size, int flags) + { + (void)size; + GCAssertMsg(((size_t)m_itemSize >= size), "allocator itemsize too small"); +start: + if (m_firstFree == NULL && m_needsSweeping == NULL) { + if (CreateChunk() == NULL) { + return NULL; + } + } + + GCBlock* b = m_firstFree ? m_firstFree : m_needsSweeping; + + // lazy sweeping + if(b->needsSweeping) { + if(m_gc->collecting) { + CreateChunk(); + b = m_firstFree; + } + else if(Sweep(b)) { + goto start; + } + } + + GCAssert(b == m_firstFree); + + GCAssert(b && !b->IsFull()); + + void *item; + if(b->firstFree) { + item = b->firstFree; + b->firstFree = *((void**)item); + // clear free list pointer, the rest was zero'd in free + *(int*) item = 0; +#ifdef MEMORY_INFO + // ensure previously used item wasn't written to + // -1 because write back pointer space isn't poisoned. + for(int i=3, n=(b->size>>2)-1; inextItem; + if(((int)((char*)item + b->size) & 0xfff) != 0) { + b->nextItem = (char*)item + b->size; + } else { + b->nextItem = NULL; + } + } + + // set up bits, items start out white and whether they need finalization + // is determined by the caller + + // make sure we ended up in the right place + GCAssert(((flags&GC::kContainsPointers) != 0) == ContainsPointers()); + + // this assumes what we assert + GCAssert((unsigned long)GC::kFinalize == (unsigned long)GCAlloc::kFinalize); + int index = GetIndex(b, item); + + GCAssert(index >= 0); + + ClearBits(b, index, 0xf); + SetBit(b, index, flags & kFinalize); + + b->numItems++; +#ifdef MEMORY_INFO + m_numAlloc++; +#endif + + // If we're out of free items, be sure to remove ourselves from the + // list of blocks with free items. + if (b->IsFull()) { + m_firstFree = b->nextFree; + b->nextFree = NULL; + GCAssert(b->prevFree == NULL); + + if (m_firstFree) + m_firstFree->prevFree = 0; + } + + // prevent mid-collection (ie destructor) allocations on un-swept pages from + // getting swept. If the page is finalized and doesn't need sweeping we don't want + // to set the mark otherwise it will be marked when we start the next marking phase + // and write barrier's won't fire (since its black) + if(m_gc->collecting) + { + if((b->finalizeState != m_gc->finalizedValue) || b->needsSweeping) + SetBit(b, index, kMark); + } + + return item; + } + + /* static */ + void GCAlloc::Free(void *item) + { + GCBlock *b = (GCBlock*) ((intptr) item & ~0xFFF); + GCAlloc *a = b->alloc; + +#ifdef _DEBUG + // check that its not already been freed + void *free = b->firstFree; + while(free) { + GCAssert(free != item); + free = *((void**) free); + } +#endif + + int index = GetIndex(b, item); + if(GetBit(b, index, kHasWeakRef)) { + b->gc->ClearWeakRef(GetUserPointer(item)); + } + + bool wasFull = b->IsFull(); + + if(b->needsSweeping) { + bool gone = a->Sweep(b); + if(gone) { + GCAssertMsg(false, "How can a page I'm about to free an item on be empty?"); + } + wasFull = false; + } + + if(wasFull) { + a->AddToFreeList(b); + } + + b->FreeItem(item, index); + + if(b->numItems == 0) { + a->UnlinkChunk(b); + a->FreeChunk(b); + } + } + + void GCAlloc::Finalize() + { + m_finalized = true; + // Go through every item of every block. Look for items + // that are in use but not marked as reachable, and delete + // them. + + GCBlock *next = NULL; + for (GCBlock* b = m_firstBlock; b != NULL; b = next) + { + // we can unlink block below + next = b->next; + + // remove from freelist to avoid mutator destructor allocations + // from using this block + bool putOnFreeList = false; + if(m_firstFree == b || b->prevFree != NULL || b->nextFree != NULL) { + putOnFreeList = true; + RemoveFromFreeList(b); + } + + GCAssert(kMark == 0x1 && kFinalize == 0x4 && kHasWeakRef == 0x8); + + int numMarkedItems = 0; + + // TODO: MMX version for IA32 + uint32 *bits = (uint32*) b->GetBits(); + uint32 count = b->nextItem ? GetIndex(b, b->nextItem) : m_itemsPerBlock; + // round up to eight + uint32 numInts = ((count+7)&~7) >> 3; + for(uint32 i=0; i < numInts; i++) + { + uint32 marks = bits[i]; + // hmm, is it better to screw around with exact counts or just examine + // 8 items on each pass, with the later we open the door to unrolling + uint32 subCount = i==(numInts-1) ? ((count-1)&7)+1 : 8; + for(uint32 j=0; j>=4) + { + int mq = marks & kFreelist; + if(mq == kFreelist) + continue; + + if(mq == kMark) { + numMarkedItems++; + continue; + } + + GCAssertMsg(mq != kQueued, "No queued objects should exist when finalizing"); + + if(!(marks & (kFinalize|kHasWeakRef))) + continue; + + void* item = (char*)b->items + m_itemSize*((i*8)+j); + + if (marks & kFinalize) + { + GCFinalizedObject *obj = (GCFinalizedObject*)GetUserPointer(item); + GCAssert(*(int*)obj != 0); + obj->~GCFinalizedObject(); + + bits[i] &= ~(kFinalize<<(j*4)); + +#if defined(_DEBUG) && defined(MMGC_DRC) + if(b->alloc->IsRCObject()) { + m_gc->RCObjectZeroCheck((RCObject*)obj); + } +#endif + } + + if (marks & kHasWeakRef) { + b->gc->ClearWeakRef(GetUserPointer(item)); + } + } + } + + if(numMarkedItems == 0) { + // add to list of block to be returned to the Heap after finalization + // we don't do this during finalization b/c we want finalizers to be able + // to reference the memory of other objects being finalized + UnlinkChunk(b); + b->gc->AddToSmallEmptyBlockList(b); + putOnFreeList = false; + } else if(numMarkedItems == b->numItems) { + // nothing changed on this page, clear marks + ClearMarks(b); + } else if(!b->needsSweeping) { + // free'ing some items but not all + if(b->nextFree || b->prevFree || b == m_firstFree) { + RemoveFromFreeList(b); + b->nextFree = b->prevFree = NULL; + } + AddToSweepList(b); + putOnFreeList = false; + } + b->finalizeState = m_gc->finalizedValue; + if(putOnFreeList) + AddToFreeList(b); + } + } + + void GCAlloc::SweepGuts(GCBlock *b) + { + // TODO: MMX version for IA32 + uint32 *bits = (uint32*) b->GetBits(); + uint32 count = b->nextItem ? GetIndex(b, b->nextItem) : m_itemsPerBlock; + // round up to eight + uint32 numInts = ((count+7)&~7) >> 3; + for(uint32 i=0; i < numInts; i++) + { + uint32 marks = bits[i]; + // hmm, is it better to screw around with exact counts or just examine + // 8 items on each pass, with the later we open the door to unrolling + uint32 subCount = i==(numInts-1) ? ((count-1)&7)+1 : 8; + for(uint32 j=0; j>=4) + { + int mq = marks & kFreelist; + if(mq == kMark) + { + // live item, clear bits + bits[i] &= ~(kFreelist<<(j*4)); + continue; + } + + if(mq == kFreelist) + continue; // freelist item, ignore + + // garbage, freelist it + void *item = (char*)b->items + m_itemSize*(i*8+j); + +#ifdef MEMORY_INFO + DebugFreeReverse(item, 0xba, 4); +#endif + b->FreeItem(item, (i*8+j)); + } + } + } + + bool GCAlloc::Sweep(GCBlock *b) + { + GCAssert(b->needsSweeping); + RemoveFromSweepList(b); + + SweepGuts(b); + + if(b->numItems == 0) + { + UnlinkChunk(b); + FreeChunk(b); + return true; + } + + AddToFreeList(b); + + return false; + } + + void GCAlloc::SweepNeedsSweeping() + { + GCBlock* next; + for (GCBlock* b = m_needsSweeping; b != NULL; b = next) + { + next = b->nextFree; + Sweep(b); + } + GCAssert(m_needsSweeping == NULL); + } + + void GCAlloc::ClearMarks(GCAlloc::GCBlock* block) + { + // Clear all the mark bits + uint32 *pbits = (uint32*)block->GetBits(); + const static uint32 mq32 = 0x33333333; + GCAssert((kMark|kQueued) == 0x3); + // TODO: MMX version for IA32 + for(int i=0, n=m_numBitmapBytes>>2; i < n; i++) { + pbits[i] &= ~mq32; + } + + const void *item = block->firstFree; + while(item != NULL) { + // set freelist bit pattern + SetBit(block, GetIndex(block, item), kFreelist); + item = *(const void**)item; + } + } + + void GCAlloc::ClearMarks() + { + GCBlock *block = m_firstBlock; +start: + while (block) { + GCBlock *next = block->next; + + if(block->needsSweeping) { + if(Sweep(block)) { + UnlinkChunk(block); + FreeChunk(block); + block = next; + goto start; + } + } + + ClearMarks(block); + + // Advance to next block + block = next; + } + } + +#ifdef _DEBUG + void GCAlloc::CheckMarks() + { + GCBlock *b = m_firstBlock; + + while (b) { + GCBlock *next = b->next; + GCAssertMsg(!b->needsSweeping, "All needsSweeping should have been swept at this point."); + + // TODO: MMX version for IA32 + uint32 *bits = (uint32*) b->GetBits(); + uint32 count = b->nextItem ? GetIndex(b, b->nextItem) : m_itemsPerBlock; + + // round up to eight + uint32 numInts = ((count+7)&~7) >> 3; + for(uint32 i=0; i < numInts; i++) + { + uint32 marks = bits[i]; + // hmm, is it better to screw around with exact counts or just examine + // 8 items on each pass, with the later we open the door to unrolling + uint32 subCount = i==(numInts-1) ? ((count-1)&7)+1 : 8; + for(uint32 j=0; j>=4) + { + uint32 m = marks&kFreelist; + GCAssertMsg(m == 0 || m == kFreelist, "All items should be free or clear, nothing should be marked or queued."); + } + } + + // Advance to next block + b = next; + } + } +#endif + + /*static*/ + int GCAlloc::ConservativeGetMark(const void *item, bool bogusPointerReturnValue) + { + GCBlock *block = (GCBlock*) ((intptr) item & ~0xFFF); + +#ifdef MEMORY_INFO + item = GetRealPointer(item); +#endif + + // guard against bogus pointers to the block header + if (item < block->items) + return bogusPointerReturnValue; + + // floor value to start of item + // FIXME: do this w/o division if we can + int itemNum = GetIndex(block, item); + + // skip pointers into dead space at end of block + if (itemNum > block->alloc->m_itemsPerBlock - 1) + return bogusPointerReturnValue; + + // skip pointers into objects + if(block->items + itemNum * block->size != item) + return bogusPointerReturnValue; + + return GetMark(item); + } + + // allows us to avoid division in GetItemIndex, kudos to Tinic + void GCAlloc::ComputeMultiplyShift(uint16 d, uint16 &muli, uint16 &shft) + { + uint32 s = 0; + uint32 n = 0; + uint32 m = 0; + for ( ; n < ( 1 << 13 ) ; s++) { + m = n; + n = ( ( 1 << ( s + 1 ) ) / d ) + 1; + } + shft = (uint16) s - 1; + muli = (uint16) m; + } + + void GCAlloc::GCBlock::FreeItem(void *item, int index) + { + GCAssert(alloc->m_numAlloc != 0); + + void *oldFree = firstFree; + firstFree = item; +#ifdef MEMORY_INFO + alloc->m_numAlloc--; +#endif + numItems--; + + SetBit(this, index, kFreelist); + +#ifndef _DEBUG + // memset rest of item not including free list pointer, in _DEBUG + // we poison the memory (and clear in Alloc) + // FIXME: can we do something faster with MMX here? + if(!alloc->IsRCObject()) + memset((char*)item, 0, size); +#endif + // Add this item to the free list + *((void**)item) = oldFree; + } +} diff --git a/mozilla/js/tamarin/MMgc/GCAlloc.h b/mozilla/js/tamarin/MMgc/GCAlloc.h new file mode 100644 index 00000000000..cb2cc02d380 --- /dev/null +++ b/mozilla/js/tamarin/MMgc/GCAlloc.h @@ -0,0 +1,395 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __GCAlloc__ +#define __GCAlloc__ + + +namespace MMgc +{ + /** + * + * This is a fast, fixed-size memory allocator for garbage-collected + * objects. + * + * Memory is allocated from the system on 4096-byte aligned boundaries, + * which corresponds to the size of an OS page in Windows XP. Allocation + * of pages is performed via the GCPageAlloc class. + * + * In each 4096-byte block, there is a block header with marked bits, + * finalize bits, the pointer to the next free item and "recycling" + * free item linked list. + * + * The bits of the "marked" bitmap are controlled by the SetMark method. + * + * The bits of the "finalize" bitmap are set when an item is + * allocated. The value for the finalize bit is passed in as a + * parameter to the allocation call. + * + * When the Sweep method is invoked, all objects that are not marked + * with the specified mark flag are disposed of. If the corresponding + * finalize bit is set, the GCObject destructor is invoked on that + * item. + * + * When an allocation is requested and there are no more free + * entries, GCAlloc will request that a garbage collection take + * place. It will allocate new blocks if more than 20% of its + * blocks are used after the collection, targeting a 5:1 + * heap size / minimim heap size ratio. + * + */ + class GCAlloc : public GCAllocObject + { + friend class GC; + public: + enum ItemBit { kMark=1, kQueued=2, kFinalize=4, kHasWeakRef=8, kFreelist=kMark|kQueued }; + + GCAlloc(GC* gc, int itemSize, bool containsPointers, bool isRC, int sizeClassIndex); + ~GCAlloc(); + + void* Alloc(size_t size, int flags); + static void Free(void *ptr); + void Finalize(); + size_t GetItemSize() { return m_itemSize; } + void ClearMarks(); +#ifdef _DEBUG + void CheckMarks(); +#endif + + static int SetMark(const void *item) + { + // Zero low 12 bits of address to get to the Block header + GCBlock *block = (GCBlock*) ((uint32)item & ~0xFFF); + int index = GetIndex(block, item); + int mask = kMark << ((index&7)<<2); + uint32 *bits = &block->GetBits()[index>>3]; + int set = *bits & mask; + *bits |= mask; + *bits &= ~(kQueued << ((index&7)<<2)); + return set; + } + + static int SetQueued(const void *item) + { + // Zero low 12 bits of address to get to the Block header + GCBlock *block = (GCBlock*) ((uint32)item & ~0xFFF); + return SetBit(block, GetIndex(block, item), kQueued); + } + + static int SetFinalize(const void *item) + { + // Zero low 12 bits of address to get to the Block header + GCBlock *block = (GCBlock*) ((uint32)item & ~0xFFF); + return SetBit(block, GetIndex(block, item), kFinalize); + } + + static int IsWhite(const void *item) + { + // Zero low 12 bits of address to get to the Block header + GCBlock *block = (GCBlock*) ((uint32)item & ~0xFFF); + + // not a real item + if(item < block->items) + return false; + + if(FindBeginning(item) != item) + return false; + + return IsWhite(block, GetIndex(block, item)); + } + + + static int GetMark(const void *item) + { + // Zero low 12 bits of address to get to the Block header + GCBlock *block = (GCBlock*) ((uint32)item & ~0xFFF); + + // Return the "marked" bit + return GetBit(block, GetIndex(block, item), kMark); + } + + static void *FindBeginning(const void *item) + { + // Zero low 12 bits of address to get to the Block header + GCBlock *block = (GCBlock*) ((uint32)item & ~0xFFF); + + return block->items + block->size * GetIndex(block, item); + } + + static void ClearFinalized(const void *item) + { + // Zero low 12 bits of address to get to the Block header + GCBlock *block = (GCBlock*) ((uint32)item & ~0xFFF); + ClearBits(block, GetIndex(block, item), kFinalize); + } + + static int IsFinalized(const void *item) + { + // Zero low 12 bits of address to get to the Block header + GCBlock *block = (GCBlock*) ((uint32)item & ~0xFFF); + return GetBit(block, GetIndex(block, item), kFinalize); + } + static int HasWeakRef(const void *item) + { + // Zero low 12 bits of address to get to the Block header + GCBlock *block = (GCBlock*) ((uint32)item & ~0xFFF); + return GetBit(block, GetIndex(block, item), kHasWeakRef); + } + + static bool ContainsPointers(const void *item) + { + // Zero low 12 bits of address to get to the Block header + GCBlock *block = (GCBlock*) ((uint32)item & ~0xFFF); + return block->alloc->ContainsPointers(); + } + + static bool IsRCObject(const void *item) + { + // Zero low 12 bits of address to get to the Block header + GCBlock *block = (GCBlock*) ((uint32)item & ~0xFFF); + return item >= block->items && block->alloc->IsRCObject(); + } + + static bool IsUnmarkedPointer(const void *val); + + int GetNumAlloc() const { return m_numAlloc; } + int GetMaxAlloc() const { return m_maxAlloc; } + int GetNumBlocks() const { return m_numBlocks; } + + bool ContainsPointers() const { return containsPointers; } + bool IsRCObject() const { return containsRCObjects; } + + void GetBitsPages(void **pages); + + static void SetHasWeakRef(const void *item, bool to) + { + GCBlock *block = (GCBlock*) ((uint32)item & ~0xFFF); + if(to) { + SetBit(block, GetIndex(block, item), kHasWeakRef); + } else { + ClearBits(block, GetIndex(block, item), kHasWeakRef); + } + } + + private: + const static int kBlockSize = 4096; + + struct GCBlock; + + friend struct GCAlloc::GCBlock; + + struct GCBlock + { + GC *gc; + uint32 size; + GCAlloc *alloc; + GCBlock* next; + GCBlock* prev; + char* nextItem; + void* firstFree; // first item on free list + GCBlock *prevFree; + GCBlock *nextFree; + uint32* bits; + short numItems; + bool needsSweeping:1; + bool finalizeState:1; // whether we've been visited during the Finalize stage + char *items; + + int GetCount() const + { + if (nextItem) { + return GCAlloc::GetIndex(this, nextItem); + } else { + return alloc->m_itemsPerBlock; + } + } + + uint32 *GetBits() const + { + return bits; + } + + void FreeItem(void *item, int index); + + bool IsFull() const + { + bool full = (nextItem == firstFree); + // the only time nextItem and firstFree should be equal is when they + // are both zero which is also when we are full, assert to be sure + GCAssert(!full || nextItem==0); + GCAssert(!full || numItems == alloc->m_itemsPerBlock); + return full; + } + }; + + // The list of chunk blocks + GCBlock* m_firstBlock; + GCBlock* m_lastBlock; + + // The lowest priority block that has free items + GCBlock* m_firstFree; + + // List of blocks that need sweeping + GCBlock* m_needsSweeping; + + int m_itemsPerBlock; + size_t m_itemSize; + int m_numBitmapBytes; + int m_sizeClassIndex; + + bool m_bitsInPage; + + int m_maxAlloc; + int m_numAlloc; + int m_numBlocks; + + // fast divide numbers + uint16 multiple; + uint16 shift; + + bool containsPointers; + bool containsRCObjects; + bool m_finalized; + + bool IsOnEitherList(GCBlock *b) + { + return b->nextFree != NULL || b->prevFree != NULL || b == m_firstFree || b == m_needsSweeping; + } + + GCBlock* CreateChunk(); + void UnlinkChunk(GCBlock *b); + void FreeChunk(GCBlock* b); + void AddToFreeList(GCBlock *b) + { + GCAssert(!IsOnEitherList(b)); + b->prevFree = NULL; + b->nextFree = m_firstFree; + if (m_firstFree) { + GCAssert(m_firstFree->prevFree == 0 && m_firstFree != b); + m_firstFree->prevFree = b; + } + m_firstFree = b; + } + + void RemoveFromFreeList(GCBlock *b) + { + GCAssert(m_firstFree == b || b->prevFree != NULL); + if ( m_firstFree == b ) + m_firstFree = b->nextFree; + else + b->prevFree->nextFree = b->nextFree; + + if (b->nextFree) + b->nextFree->prevFree = b->prevFree; + b->nextFree = b->prevFree = NULL; + } + + void AddToSweepList(GCBlock *b) + { + GCAssert(!IsOnEitherList(b) && !b->needsSweeping); + b->prevFree = NULL; + b->nextFree = m_needsSweeping; + if (m_needsSweeping) { + GCAssert(m_needsSweeping->prevFree == 0); + m_needsSweeping->prevFree = b; + } + m_needsSweeping = b; + b->needsSweeping = true; + } + + void RemoveFromSweepList(GCBlock *b) + { + GCAssert(m_needsSweeping == b || b->prevFree != NULL); + if ( m_needsSweeping == b ) + m_needsSweeping = b->nextFree; + else + b->prevFree->nextFree = b->nextFree; + + if (b->nextFree) + b->nextFree->prevFree = b->prevFree; + b->needsSweeping = false; + b->nextFree = b->prevFree = NULL; + } + + bool Sweep(GCBlock *b); + void SweepGuts(GCBlock *b); + + + void ClearMarks(GCAlloc::GCBlock* block); + void SweepNeedsSweeping(); + + bool IsLastFreeBlock(GCBlock *b) { return m_firstFree == NULL || (m_firstFree == b && b->nextFree == NULL); } + + static int ConservativeGetMark(const void *item, bool bogusPointerReturnValue); + + static int GetIndex(const GCBlock *block, const void *item) + { + int index = (((char*) item - block->items) * block->alloc->multiple) >> block->alloc->shift; +#ifdef _DEBUG + GCAssert(((char*) item - block->items) / block->size == (uint32) index); +#endif + return index; + } + + static int IsWhite(GCBlock *block, int index) + { + return (block->GetBits()[index>>3] & ((kMark|kQueued)<<((index&7)<<2))) == 0; + } + + static int SetBit(GCBlock *block, int index, int bit) + { + int mask = bit << ((index&7)<<2); + int set = (block->GetBits()[index>>3] & mask); + block->GetBits()[index>>3] |= mask; + return set; + } + + static int GetBit(GCBlock *block, int index, int bit) + { + int mask = bit << ((index&7)<<2); + return block->GetBits()[index>>3] & mask; + } + + static void ClearBits(GCBlock *block, int index, int bits) + { + int mask = bits << ((index&7)<<2); + block->GetBits()[index>>3] &= ~mask; + } + + void ComputeMultiplyShift(uint16 d, uint16 &muli, uint16 &shft); + + protected: + GC *m_gc; + + }; +} + +#endif /* __GCAlloc__ */ diff --git a/mozilla/js/tamarin/MMgc/GCAllocObject.h b/mozilla/js/tamarin/MMgc/GCAllocObject.h new file mode 100644 index 00000000000..c8eb6bf83db --- /dev/null +++ b/mozilla/js/tamarin/MMgc/GCAllocObject.h @@ -0,0 +1,58 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __GCAllocObject__ +#define __GCAllocObject__ + + +namespace MMgc +{ + /** + * GCAllocObject is a base class for allocated objects. MMgc + * cannot have any dependency on the C runtime library, because + * Flash Player does not. MMgc also cannot rely on global + * operator new and delete, because it may be used to implement + * them! So, GCAllocObject provides a simple operator new and + * delete implementation for classes used internally by MMgc. + * + * The implementation of GCAllocObject is platform-dependent. + */ + class GCAllocObject + { + public: + void* operator new (size_t size); + void* operator new [] (size_t size); + void operator delete (void *ptr); + void operator delete [] (void *ptr); + }; +} + +#endif /* __GCAllocObject__ */ diff --git a/mozilla/js/tamarin/MMgc/GCAllocObjectMac.cpp b/mozilla/js/tamarin/MMgc/GCAllocObjectMac.cpp new file mode 100644 index 00000000000..cfaed7fca18 --- /dev/null +++ b/mozilla/js/tamarin/MMgc/GCAllocObjectMac.cpp @@ -0,0 +1,58 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#include + +#include "MMgc.h" + +namespace MMgc +{ + void* GCAllocObject::operator new (size_t size) + { + return malloc(size); + } + + void* GCAllocObject::operator new[] (size_t size) + { + return malloc(size); + } + + void GCAllocObject::operator delete (void *ptr) + { + free(ptr); + } + + void GCAllocObject::operator delete[](void *ptr) + { + free(ptr); + } +} + diff --git a/mozilla/js/tamarin/MMgc/GCAllocObjectUnix.cpp b/mozilla/js/tamarin/MMgc/GCAllocObjectUnix.cpp new file mode 100644 index 00000000000..cc4bb5cd4ba --- /dev/null +++ b/mozilla/js/tamarin/MMgc/GCAllocObjectUnix.cpp @@ -0,0 +1,58 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#include + +#include "MMgc.h" + +namespace MMgc +{ + void* GCAllocObject::operator new (size_t size) + { + return malloc(size); + } + + void* GCAllocObject::operator new[] (size_t size) + { + return malloc(size); + } + + void GCAllocObject::operator delete (void *ptr) + { + free(ptr); + } + + void GCAllocObject::operator delete [] (void *ptr) + { + free(ptr); + } +} + diff --git a/mozilla/js/tamarin/MMgc/GCAllocObjectWin.cpp b/mozilla/js/tamarin/MMgc/GCAllocObjectWin.cpp new file mode 100644 index 00000000000..3c75768bb73 --- /dev/null +++ b/mozilla/js/tamarin/MMgc/GCAllocObjectWin.cpp @@ -0,0 +1,58 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#include + +#include "MMgc.h" + +namespace MMgc +{ + void* GCAllocObject::operator new (size_t size) + { + return HeapAlloc(GetProcessHeap(), 0, size); + } + + void* GCAllocObject::operator new[] (size_t size) + { + return HeapAlloc(GetProcessHeap(), 0, size); + } + + void GCAllocObject::operator delete (void *ptr) + { + HeapFree(GetProcessHeap(), 0, ptr); + } + + void GCAllocObject::operator delete [] (void *ptr) + { + HeapFree(GetProcessHeap(), 0, ptr); + } +} + diff --git a/mozilla/js/tamarin/MMgc/GCDebug.h b/mozilla/js/tamarin/MMgc/GCDebug.h new file mode 100644 index 00000000000..f877acc1c93 --- /dev/null +++ b/mozilla/js/tamarin/MMgc/GCDebug.h @@ -0,0 +1,107 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 1993-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#ifndef __GCDebug__ +#define __GCDebug__ + +#include "GCTypes.h" + +#ifdef WIN32 +#include +#endif + +#ifdef _MAC +typedef const unsigned char* ConstStr255Param; +extern "C" +{ +#if defined(TARGET_RT_MAC_MACHO) // DBC + //extern pascal void DebugStr(ConstStr255Param aStr); +#else + // extern pascal void DebugStr(ConstStr255Param aStr) = 0xABFF; + extern pascal void SysBreakStr(ConstStr255Param aStr) = {0x303C, 0xFE15, 0xA9C9}; +#endif +} +#endif + +namespace MMgc +{ + void GCDebugMsg(bool debuggerBreak, const char* format, ...); + void GCDebugMsg(const char* msg, bool debuggerBreak); + void GCDebugMsg(const wchar* msg, bool debuggerBreak); + + #ifdef _DEBUG + inline void _GCAssertMsg(int32 assertion, const char* msg) + { + if (assertion == 0) + GCDebugMsg(msg, true); + } + + #define GCAssertMsg(x,y) do { _GCAssertMsg((x), (y)); } while (0) /* no semi */ + + #define GCAssert(x) _GCAssert((x), __LINE__,__FILE__) + #define _GCAssert(x, line_, file_) __GCAssert((x), line_, file_) + #define __GCAssert(x, line_, file_) do { _GCAssertMsg((x), "Assertion failed: \"" #x "\" (" #file_ ":" #line_ ")"); } while (0) /* no semi */ + + #else + #define GCAssertMsg(x,y) do { } while (0) /* no semi */ + #define GCAssert(x) do { } while (0) /* no semi */ + #endif + + /*************************************************************************/ + /******************************* Debugging *******************************/ + /*************************************************************************/ + + /* This mess serves to define the DebugMsg function on each platform. + * DebugMsg is only defined when the Debug flag is turned on; it halts + * program execution and drops into the debugger with the given message. + * We define it as in inline so that when you fall into the debugger, + * you're in the function that issued the call and not in a "DebugMsg" + * subroutine. + */ + #ifdef _MAC + // WARNING: this function is NOT THREAD SAFE + /*plugin_export*/ ConstStr255Param MakePascalMsg(const char* theString); + + #if SOFT_ASSERTS + inline void DebugMsg_(const char* /*msg*/) { } + #else + #ifdef powerc + inline void DebugMsg_(const char* msg) { DebugStr(MakePascalMsg(msg)); } + #else + inline void DebugMsg_(const char* msg) { SysBreakStr(MakePascalMsg(msg)); } + #endif + #endif // SOFT_ASSERTS + #endif + +} + +#endif /* __GCDebug__ */ diff --git a/mozilla/js/tamarin/MMgc/GCDebugMac.cpp b/mozilla/js/tamarin/MMgc/GCDebugMac.cpp new file mode 100644 index 00000000000..a5f8f03367a --- /dev/null +++ b/mozilla/js/tamarin/MMgc/GCDebugMac.cpp @@ -0,0 +1,71 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "MMgc.h" + +#ifndef __MWERKS__ +#include +#endif + +#ifndef __MACH__ + #include +#endif +#include +#include +#include + +namespace MMgc +{ + void GCDebugMsg(bool debuggerBreak, const char* format, ...) + { + char buf[4096]; + va_list args; + va_start(args, format); + + vsprintf(buf, format, args); + va_end(args); + GCDebugMsg(buf, debuggerBreak); + } + + void GCDebugMsg(const char* p, bool debugBreak) + { + char buf[256]; + strcpy(buf, p); + if(debugBreak) { + ::CopyCStringToPascal(buf, (StringPtr)buf); + DebugStr((StringPtr) buf); + } else { + CFStringRef cfStr = ::CFStringCreateWithCString(NULL, buf, kCFStringEncodingUTF8); + ::CFShow(cfStr); + } + } +} diff --git a/mozilla/js/tamarin/MMgc/GCDebugUnix.cpp b/mozilla/js/tamarin/MMgc/GCDebugUnix.cpp new file mode 100644 index 00000000000..f254f143f13 --- /dev/null +++ b/mozilla/js/tamarin/MMgc/GCDebugUnix.cpp @@ -0,0 +1,53 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "MMgc.h" + +#include +#include +#include + +namespace MMgc +{ + void GCDebugMsg(bool debuggerBreak, const char* format, ...) + { + va_list args; + va_start(args, format); + vfprintf(stderr, format, args); + va_end(args); + } + + void GCDebugMsg(const char* p, bool debugBreak) + { + fprintf(stderr, "%s\n", p); + } +} diff --git a/mozilla/js/tamarin/MMgc/GCDebugWin.cpp b/mozilla/js/tamarin/MMgc/GCDebugWin.cpp new file mode 100644 index 00000000000..a5ca2a9f213 --- /dev/null +++ b/mozilla/js/tamarin/MMgc/GCDebugWin.cpp @@ -0,0 +1,102 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "MMgc.h" + +#include +#include +#include + +#ifdef _DEBUG +#include +#include +#endif + + +/*************************************************************************/ +/******************************* Debugging *******************************/ +/*************************************************************************/ + +#ifndef MB_SERVICE_NOTIFICATION +#define MB_SERVICE_NOTIFICATION 0x00200000L +#endif + +namespace MMgc +{ + static const bool logToStdErr = true; + + void GCDebugMsg(bool debuggerBreak, const char *format, ...) + { + // [ggrossman 09.24.04] + // Changed this to _DEBUG only because we don't link to + // CRT in Release builds, so vsprintf is unavailable!! +#ifdef _DEBUG + va_list argptr; + va_start(argptr, format); + int bufferSize = _vscprintf(format, argptr)+1; + + char *buffer = (char*)alloca(bufferSize+2); + if (buffer) { + StringCbVPrintf(buffer, bufferSize+1, format, argptr); + GCDebugMsg(buffer, debuggerBreak); + } +#else + (void)debuggerBreak; + (void)format; +#endif + } + + void GCDebugMsg(const char* msg, bool debugBreak) + { + OutputDebugString(msg); + if(logToStdErr) { + fprintf( stderr, "%s\n", msg ); + } + + if (debugBreak) { + DebugBreak(); + } + } + + void GCDebugMsg(const wchar* msg, bool debugBreak) + { + OutputDebugStringW((LPCWSTR)msg); + if(logToStdErr) { + fprintf( stderr, "%S\n", msg ); + } + + if (debugBreak) { + DebugBreak(); + } + } + +} diff --git a/mozilla/js/tamarin/MMgc/GCHashtable.cpp b/mozilla/js/tamarin/MMgc/GCHashtable.cpp new file mode 100644 index 00000000000..144c859584d --- /dev/null +++ b/mozilla/js/tamarin/MMgc/GCHashtable.cpp @@ -0,0 +1,173 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 1993-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + + +#include "MMgc.h" + +namespace MMgc +{ + const void *GCHashtable::DELETED = (const void*)1; + + GCHashtable::GCHashtable(unsigned int capacity) + { + tableSize = capacity*2; + table = new const void*[tableSize]; + memset(table, 0, tableSize * sizeof(void*)); + numValues = 0; + numDeleted = 0; + } + + GCHashtable::~GCHashtable() + { + delete [] table; + table = 0; + tableSize = 0; + numDeleted = 0; + numValues = 0; + } + + void GCHashtable::put(const void *key, const void *value) + { + int i = find(key, table, tableSize); + if (table[i] != key) { + // .75 load factor, note we don't take numDeleted into account + // we want to rehash a table with lots of deleted slots + if(numValues * 8 > tableSize * 3) + { + grow(); + // grow rehashes + i = find(key, table, tableSize); + } + table[i] = key; + numValues++; + } + table[i+1] = value; + } + + const void *GCHashtable::remove(const void *key) + { + const void *ret = NULL; + int i = find(key, table, tableSize); + if (table[i] == key) { + table[i] = (const void*)DELETED; + ret = table[i+1]; + table[i+1] = NULL; + numDeleted++; + } + return ret; + } + + const void *GCHashtable::get(const void *key) + { + return table[find(key, table, tableSize)+1]; + } + + /* static */ + int GCHashtable::find(const void *key, const void **table, unsigned int tableSize) + { + GCAssert(key != (const void*)DELETED); + int bitmask = (tableSize - 1) & ~0x1; + + // this is a quadratic probe but we only hit even numbered slots since those hold keys. + int n = 7 << 1; + #ifdef _DEBUG + unsigned loopCount = 0; + #endif + // Note: Mask off MSB to avoid negative indices. Mask off bottom + // 2 bits because of alignment. Double it because names, values stored adjacently. + unsigned i = ((0x7FFFFFF8 & (int)key)>>1) & bitmask; + const void *k; + while ((k=table[i]) != key && k != NULL) + { + i = (i + (n += 2)) & bitmask; // quadratic probe + GCAssert(loopCount++ < tableSize); // don't scan forever + } + GCAssert(i <= ((tableSize-1)&~0x1)); + return i; + } + + void GCHashtable::grow() + { + int newTableSize = tableSize; + + unsigned int occupiedSlots = numValues - numDeleted; + GCAssert(numValues >= numDeleted); + + // grow or shrink as appropriate: + // if we're greater than %50 full grow + // if we're less than %10 shrink + // else stay the same + if (4*occupiedSlots > tableSize) + newTableSize <<= 1; + else if(20*occupiedSlots < tableSize && + tableSize > kDefaultSize) + newTableSize >>= 1; + + const void **newTable = new const void*[newTableSize]; + memset(newTable, 0, newTableSize*sizeof(void*)); + + numValues = 0; + numDeleted = 0; + + for (int i=0, n=tableSize; i < n; i += 2) + { + const void *oldKey; + if ((oldKey=table[i]) != NULL) + { + // inlined & simplified version of put() + if(oldKey != (const void*)DELETED) { + int j = find(oldKey, newTable, newTableSize); + newTable[j] = oldKey; + newTable[j+1] = table[i+1]; + numValues++; + } + } + } + + delete [] table; + table = newTable; + tableSize = newTableSize; + } + + int GCHashtable::nextIndex(int index) + { + unsigned int i = index<<1; + while(i < tableSize) + { + if(table[i] > DELETED) + return (i>>1)+1; + i += 2; + } + return 0; + } +} + diff --git a/mozilla/js/tamarin/MMgc/GCHashtable.h b/mozilla/js/tamarin/MMgc/GCHashtable.h new file mode 100644 index 00000000000..54692929a71 --- /dev/null +++ b/mozilla/js/tamarin/MMgc/GCHashtable.h @@ -0,0 +1,113 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __GCHashtable__ +#define __GCHashtable__ + +namespace MMgc +{ + class GCHashtableIterator; + /** + * simplified version of avmplus hashtable, doesn't shrink or handle deletions for instance + */ + class GCHashtable + { + friend class GCHashtableIterator; + public: + const static uint32 kDefaultSize=16; + const static void * DELETED; + GCHashtable(unsigned int capacity=kDefaultSize); + ~GCHashtable(); + const void *get(const void *key); + const void *get(int key) { return get((const void*)key); } + const void *remove(const void *key); + // updates value if present, adds and grows if necessary if not + void put(const void *key, const void *value); + void add(const void *key, const void *value) { put(key, value); } + void add(int key, const void *value) { put((const void*)key, value); } + int count() { return numValues; } + + int nextIndex(int index); + const void *keyAt(int index) { return table[index<<1]; } + const void *valueAt(int index) { return table[((index)<<1)+1]; } + + private: + // capacity + unsigned int tableSize; + + // size of table array + unsigned int numValues; + + // number of delete items + unsigned int numDeleted; + + // table elements + const void **table; + + static int find(const void *key, const void **table, unsigned int tableSize); + void grow(); + }; + + class GCHashtableIterator + { + public: + GCHashtableIterator(GCHashtable *ht) : ht(ht), index(-2) {} + + const void *nextKey() + { + do { + index+=2; + } while(index < (int)ht->tableSize && ht->table[index] <= GCHashtable::DELETED); + if(index < (int)ht->tableSize) + return ht->table[index]; + return NULL; + } + + const void *value() + { + GCAssert(ht->table[index] != NULL); + return ht->table[index+1]; + } + + void remove() + { + GCAssert(ht->table[index] != NULL); + ht->table[index] = (const void*)GCHashtable::DELETED; + ht->table[index+1] = NULL; + } + private: + GCHashtable *ht; + int index; + }; +} + +#endif + diff --git a/mozilla/js/tamarin/MMgc/GCHeap.cpp b/mozilla/js/tamarin/MMgc/GCHeap.cpp new file mode 100644 index 00000000000..9b194fa10ae --- /dev/null +++ b/mozilla/js/tamarin/MMgc/GCHeap.cpp @@ -0,0 +1,1167 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include + +#if defined(DARWIN) || defined(MMGC_ARM) +#include +#endif + +#include "MMgc.h" + +namespace MMgc +{ +#ifdef _DEBUG + uint8 GCHeap::m_megamap[1048576]; +#endif + + GCHeap *GCHeap::instance = NULL; + + const bool decommit = true; + + // set this to true to disable code that prevents decommmission from + // happening too frequently + const bool decommitStress = false; + + void GCHeap::Init(GCMallocFuncPtr m, GCFreeFuncPtr f) + { + GCAssert(instance == NULL); + instance = new GCHeap(m,f); + } + + void GCHeap::Destroy() + { + GCAssert(instance != NULL); + delete instance; + instance = NULL; + } + + const int GCHeap::kInitialHeapSize = 128; + + GCHeap::GCHeap(GCMallocFuncPtr m, GCFreeFuncPtr f) + : heapVerbose(false), + kNativePageSize(0) + { +#if defined(_MAC) || defined(MMGC_ARM) + m_malloc = m ? m : malloc; + m_free = f ? f : free; +#else + (void)m; + (void)f; +#endif + #ifdef _DEBUG + // Initialize the megamap for debugging. + memset(m_megamap, 0, sizeof(m_megamap)); + #endif + + lastRegion = 0; + blocksLen = 0; + numAlloc = 0; + numDecommitted = 0; + blocks = NULL; + + // Initialize free lists + HeapBlock *block = freelists; + for (int i=0; ibaseAddr = NULL; + block->size = 0; + block->sizePrevious = 0; + block->prev = block; + block->next = block; + block->committed = true; + block->dirty = true; + block++; + } + +#ifdef MMGC_AVMPLUS + // get native page size from OS + kNativePageSize = vmPageSize(); + committedCodeMemory = 0; + + #ifdef WIN32 + // Check OS version to see if PAGE_GUARD is supported + // (It is not supported on Win9x) + OSVERSIONINFO osvi; + ::GetVersionEx(&osvi); + useGuardPages = (osvi.dwPlatformId != VER_PLATFORM_WIN32_WINDOWS); + #endif +#endif + + // Create the initial heap + ExpandHeap(kInitialHeapSize); + + decommitTicks = 0; + decommitThresholdTicks = kDecommitThresholdMillis * GC::GetPerformanceFrequency() / 1000; + } + + GCHeap::~GCHeap() + { +#ifdef MEMORY_INFO + if(numAlloc != 0) + { + for (unsigned int i=0; ibaseAddr) + { + int megamapIndex = ((uint32)block->baseAddr) >> 12; + GCAssert(m_megamap[megamapIndex] == 0); + } + if(block->inUse() && block->baseAddr) + { + GCDebugMsg(false, "Block 0x%x not freed\n", block->baseAddr); + PrintStackTraceByIndex(block->allocTrace); + } + } + GCAssert(false); + } +#endif + FreeAll(); + } + + void* GCHeap::Alloc(int size, bool expand/*=true*/, bool zero/*true*/) + { + GCAssert(size > 0); + + char *baseAddr; + + // nested block to keep memset/memory commit out of critical section + { +#ifdef GCHEAP_LOCK + GCAcquireSpinlock spinlock(m_spinlock); +#endif /* GCHEAP_LOCK */ + + HeapBlock *block = AllocBlock(size, zero); + + if (!block && expand) { + ExpandHeapPrivate(size); + block = AllocBlock(size, zero); + } + + if (!block) { + return NULL; + } + + GCAssert(block->size == size); + + numAlloc += size; + +#ifdef _DEBUG + // Check for debug builds only: + // Use the megamap to double-check that we haven't handed + // any of these pages out already. + int megamapIndex = ((uint32)block->baseAddr)>>12; + for (int i=0; ibaseAddr; + } + +#ifdef MEMORY_INFO + // do this outside of the spinlock to prevent deadlock w/ trace table lock + AddrToBlock(baseAddr)->allocTrace = GetStackTraceIndex(2); +#endif + // Zero out the memory, if requested to do so + // FIXME: if we know that this memory was just committed we shouldn't do this + // maybe zero should pass deeper into the system so that on initial expansions + // and re-commit we avoid this, should be a noise optimization over all but + // possibly a big win for startup + if (zero) { + memset(baseAddr, 0, size * kBlockSize); + } + + return baseAddr; + } + + void GCHeap::Free(void *item) + { +#ifdef GCHEAP_LOCK + GCAcquireSpinlock spinlock(m_spinlock); +#endif /* GCHEAP_LOCK */ + + HeapBlock *block = AddrToBlock(item); + if (block) { + + #ifdef _DEBUG + // For debug builds only: + // Check the megamap to ensure that all the pages + // being freed are in fact allocated. + int megamapIndex = ((uint32)block->baseAddr) >> 12; + for (int i=0; isize; i++) { + if(m_megamap[megamapIndex] != 1) { + GCAssertMsg(false, "Megamap is screwed up, are you freeing freed memory?"); + int *data = (int*)item; + (void)data; // silence compiler warning + } + + // Clear the entry + m_megamap[megamapIndex++] = 0; + } + #endif + + // Update metrics + GCAssert(numAlloc >= (unsigned int)block->size); + numAlloc -= block->size; + + FreeBlock(block); + } + } + + + size_t GCHeap::Size(const void *item) + { +#ifdef GCHEAP_LOCK + GCAcquireSpinlock spinlock(m_spinlock); +#endif /* GCHEAP_LOCK */ + HeapBlock *block = AddrToBlock(item); + return block->size; + } + + void GCHeap::Decommit() + { +#ifdef DECOMMIT_MEMORY + +#ifdef GCHEAP_LOCK + GCAcquireSpinlock spinlock(m_spinlock); +#endif /* GCHEAP_LOCK */ + + // commit if > %25 of the heap stays free + int decommitSize = GetFreeHeapSize() * 100 - GetTotalHeapSize() * kDecommitThresholdPercentage; + + decommitSize /= 100; + + if(!decommitStress) + { + if(!decommit || decommitSize < 0) { + + decommitTicks = 0; + return; + } + + if(decommitTicks == 0) { + decommitTicks = GC::GetPerformanceCounter(); + return; + } else if ((GC::GetPerformanceCounter() - decommitTicks) < decommitThresholdTicks) { + return; + } + } + + decommitTicks = 0; + + // don't trifle + if(decommitSize < kMinHeapIncrement) + return; + + // search from the end of the free list so we decommit big blocks, if + // a free block is bigger than + HeapBlock *freelist = freelists+kNumFreeLists-1; + + HeapBlock *endOfBigFreelists = &freelists[GetFreeListIndex(kMinHeapIncrement)]; + + for (; freelist >= endOfBigFreelists && decommitSize > 0; freelist--) + { + HeapBlock *block = freelist; + while ((block = block->prev) != freelist && decommitSize > 0) + { + // decommitting already decommitted blocks doesn't help + if(!block->committed || block->size == 0) + continue; + +#ifdef USE_MMAP + RemoveFromList(block); + if(block->size > decommitSize) + { + HeapBlock *newBlock = block + decommitSize; + newBlock->baseAddr = block->baseAddr + kBlockSize * decommitSize; + + newBlock->size = block->size - decommitSize; + newBlock->sizePrevious = decommitSize; + newBlock->committed = block->committed; + newBlock->dirty = block->dirty; + block->size = decommitSize; + + // Update sizePrevious in block after that + HeapBlock *nextBlock = newBlock + newBlock->size; + nextBlock->sizePrevious = newBlock->size; + + // Add the newly created block to the + // free list + AddToFreeList(newBlock); + } + + if(DecommitMemoryThatMaySpanRegions(block->baseAddr, block->size * kBlockSize)) + { + block->committed = false; + block->dirty = false; + decommitSize -= block->size; +#ifdef MEMORY_INFO + if(heapVerbose) + GCDebugMsg(false, "Decommitted %d page block\n", block->size); +#endif + } + else + { + GCAssert(false); + } + + numDecommitted += block->size; + + // merge with previous/next if not in use and not committed + HeapBlock *prev = block - block->sizePrevious; + if(block->sizePrevious != 0 && !prev->committed && !prev->inUse()) { + RemoveFromList(prev); + + prev->size += block->size; + + block->size = 0; + block->sizePrevious = 0; + block->baseAddr = 0; + + block = prev; + } + + HeapBlock *next = block + block->size; + if(next->size != 0 && !next->committed && !next->inUse()) { + RemoveFromList(next); + + block->size += next->size; + + next->size = 0; + next->sizePrevious = 0; + next->baseAddr = 0; + } + + next = block + block->size; + next->sizePrevious = block->size; + + // add this block to the back of the bus to make sure we consume committed memory + // first + HeapBlock *backOfTheBus = &freelists[kNumFreeLists-1]; + HeapBlock *pointToInsert = backOfTheBus; + while ((pointToInsert = pointToInsert->next) != backOfTheBus) { + if (pointToInsert->size >= block->size && !pointToInsert->committed) { + break; + } + } + AddToFreeList(block, pointToInsert); + + // so we keep going through freelist properly + block = freelist; +#else + // if we aren't using mmap we can only do something if the block maps to a region + // that is completely empty + Region *region = AddrToRegion(block->baseAddr); + if(block->baseAddr == region->baseAddr && // beginnings match + region->commitTop == block->baseAddr + block->size*kBlockSize) { + + RemoveFromList(block); + + // we're removing a region so re-allocate the blocks w/o the blocks for this region + HeapBlock *newBlocks = new HeapBlock[blocksLen - block->size]; + + // copy blocks before this block + memcpy(newBlocks, blocks, (block - blocks) * sizeof(HeapBlock)); + + // copy blocks after + size_t lastChunkSize = (char*)(blocks + blocksLen) - (char*)(block + block->size); + memcpy(newBlocks + (block - blocks), block + block->size, lastChunkSize); + + // Fix up the prev/next pointers of each freelist. This is a little more complicated + // than the similiar code in ExpandHeap because blocks after the one we are free'ing + // are sliding down by block->size + HeapBlock *fl = freelists; + for (int i=0; iprev != fl) { + if(temp->prev > block) { + temp->prev = newBlocks + (temp->prev-blocks-block->size); + } else { + temp->prev = newBlocks + (temp->prev-blocks); + } + } + if (temp->next != fl) { + if(temp->next > block) { + temp->next = newBlocks + (temp->next-blocks-block->size); + } else { + temp->next = newBlocks + (temp->next-blocks); + } + } + } while ((temp = temp->next) != fl); + fl++; + } + + // need to decrement blockId for regions in blocks after block + Region *r = lastRegion; + while(r) { + if(r->blockId > region->blockId) { + r->blockId -= block->size; + } + r = r->prev; + } + + blocksLen -= block->size; + decommitSize -= block->size; + + delete [] blocks; + blocks = newBlocks; + RemoveRegion(region); + + // start over at beginning of freelist + block = freelist; + } +#endif + } + } +#endif + } + + GCHeap::Region *GCHeap::AddrToRegion(const void *item) const + { + // Linear search of regions list to find this address. + // The regions list should usually be pretty short. + for (Region *region = lastRegion; + region != NULL; + region = region->prev) + { + if (item >= region->baseAddr && item < region->reserveTop) { + return region; + } + } + return NULL; + } + + GCHeap::HeapBlock* GCHeap::AddrToBlock(const void *item) const + { + Region *region = AddrToRegion(item); + if(region) { + int index = ((char*)item - region->baseAddr) / kBlockSize; + HeapBlock *b = blocks + region->blockId + index; + GCAssert(item >= b->baseAddr && item < b->baseAddr + b->size * GCHeap::kBlockSize); + return b; + } + return NULL; + } + + GCHeap::HeapBlock* GCHeap::AllocBlock(int size, bool& zero) + { + int startList = GetFreeListIndex(size); + HeapBlock *freelist = &freelists[startList]; + + HeapBlock *decommittedSuitableBlock = NULL; + + for (int i = startList; i < kNumFreeLists; i++) + { + // Search for a big enough block in free list + HeapBlock *block = freelist; + while ((block = block->next) != freelist) + { + if (block->size >= size && block->committed) + { + // why do we do this? putting in assert but I think it should be removed + GCAssert(!block->inUse()); + if( !block->prev || !block->next ) return NULL; + + + RemoveFromList(block); + + if(block->size > size) + { + HeapBlock *newBlock = Split(block, size); + + // Add the newly created block to the free list + AddToFreeList(newBlock); + } + + CheckFreelist(); + + zero = block->dirty && zero; + + return block; + } + +#if defined(USE_MMAP) && defined(DECOMMIT_MEMORY) + // if the block isn't committed see if this request can be met with by committing + // it and combining it with its neighbors + if(!block->committed && !decommittedSuitableBlock) + { + int totalSize = block->size; + + // first try predecessors + HeapBlock *firstFree = block; + + // loop because we could have interleaved committed/non-committed blocks + while(totalSize < size && firstFree->sizePrevious != 0) + { + HeapBlock *prevBlock = firstFree - firstFree->sizePrevious; + if(!prevBlock->inUse() && prevBlock->size > 0) { + totalSize += prevBlock->size; + firstFree = prevBlock; + } else { + break; + } + } + + if(totalSize > size) { + decommittedSuitableBlock = firstFree; + } else { + // now try successors + HeapBlock *nextBlock = block + block->size; + while(nextBlock->size > 0 && !nextBlock->inUse() && totalSize < size) { + totalSize += nextBlock->size; + nextBlock = nextBlock + nextBlock->size; + } + + if(totalSize > size) { + decommittedSuitableBlock = firstFree; + } + } + } +#endif + } + freelist++; + } + +#if defined(USE_MMAP) && defined(DECOMMIT_MEMORY) + if(decommittedSuitableBlock) + { + // first handle case where its too big + if(decommittedSuitableBlock->size > size) + { + int toCommit = size > kMinHeapIncrement ? size : kMinHeapIncrement; + + if(toCommit > decommittedSuitableBlock->size) + toCommit = decommittedSuitableBlock->size; + + RemoveFromList(decommittedSuitableBlock); + + // first split off part we're gonna commit + if(decommittedSuitableBlock->size > toCommit) { + HeapBlock *newBlock = Split(decommittedSuitableBlock, toCommit); + + // put the still uncommitted part back on freelist + AddToFreeList(newBlock); + } + + Commit(decommittedSuitableBlock); + + if(toCommit > size) { + HeapBlock *newBlock = Split(decommittedSuitableBlock, size); + AddToFreeList(newBlock); + } + } + else // too small + { + // need to stitch blocks together committing uncommitted blocks + HeapBlock *block = decommittedSuitableBlock; + RemoveFromList(block); + + int amountRecommitted = block->committed ? 0 : block->size; + + while(block->size < size) + { + HeapBlock *nextBlock = block + block->size; + + RemoveFromList(nextBlock); + + // Increase size of current block + block->size += nextBlock->size; + amountRecommitted += nextBlock->committed ? 0 : nextBlock->size; + + nextBlock->size = 0; + nextBlock->baseAddr = 0; + nextBlock->sizePrevious = 0; + + block->dirty |= nextBlock->dirty; + } + + GCAssert(amountRecommitted > 0); + + if(!CommitMemoryThatMaySpanRegions(block->baseAddr, block->size * kBlockSize)) + { + GCAssert(false); + } +#ifdef MEMORY_INFO + if(heapVerbose) + GCDebugMsg(false, "Recommitted %d pages\n", amountRecommitted); +#endif + numDecommitted -= amountRecommitted; + block->committed = true; + + GCAssert(decommittedSuitableBlock->size >= size); + + // split last block + if(block->size > size) + { + HeapBlock *newBlock = Split(block, size); + AddToFreeList(newBlock); + } + } + + GCAssert(decommittedSuitableBlock->size == size); + + // update sizePrevious in next block + HeapBlock *nextBlock = decommittedSuitableBlock + size; + nextBlock->sizePrevious = size; + + CheckFreelist(); + + return decommittedSuitableBlock; + } +#endif + + CheckFreelist(); + return 0; + } + + GCHeap::HeapBlock *GCHeap::Split(HeapBlock *block, int size) + { + GCAssert(block->size > size); + HeapBlock *newBlock = block + size; + newBlock->baseAddr = block->baseAddr + kBlockSize * size; + + newBlock->size = block->size - size; + newBlock->sizePrevious = size; + newBlock->committed = block->committed; + newBlock->dirty = block->dirty; + block->size = size; + + // Update sizePrevious in block after that + HeapBlock *nextBlock = newBlock + newBlock->size; + nextBlock->sizePrevious = newBlock->size; + + return newBlock; + } + + +#if defined(DECOMMIT_MEMORY) && defined(USE_MMAP) + void GCHeap::Commit(HeapBlock *block) + { + if(!block->committed) + { + if(!CommitMemoryThatMaySpanRegions(block->baseAddr, block->size * kBlockSize)) + { + GCAssert(false); + } +#ifdef MEMORY_INFO + if(heapVerbose) + GCDebugMsg(false, "Recommitted %d pages\n", block->size); +#endif + numDecommitted -= block->size; + block->committed = true; + block->dirty = false; + } + } +#endif + + + void GCHeap::CheckFreelist() + { +#ifdef _DEBUG + HeapBlock *freelist = freelists; + for (int i = 0; i < kNumFreeLists; i++) + { + HeapBlock *block = freelist; + while((block = block->next) != freelist) + { + GCAssert(block != block->next); + GCAssert(block != block->next->next || block->next == freelist); + if(block->sizePrevious) + { + HeapBlock *prev = block - block->sizePrevious; + GCAssert(block->sizePrevious == prev->size); + } + } + freelist++; + } +#endif + } + + bool GCHeap::BlocksAreContiguous(void *item1, void *item2) + { + Region *r1 = AddrToRegion(item1); + Region *r2 = AddrToRegion(item2); + return r1 == r2 || r1->reserveTop == r2->baseAddr; + } + + void GCHeap::AddToFreeList(HeapBlock *block) + { + GCAssert(m_megamap[((uint32)block->baseAddr)>>12] == 0); + + int index = GetFreeListIndex(block->size); + HeapBlock *freelist = &freelists[index]; + + HeapBlock *pointToInsert = freelist; + + // Note: We don't need to bother searching for the right + // insertion point if we know all blocks on this free list + // are the same size. + if (block->size >= kUniqueThreshold) { + while ((pointToInsert = pointToInsert->next) != freelist) { + if (pointToInsert->size >= block->size) { + break; + } + } + } + + AddToFreeList(block, pointToInsert); + } + + void GCHeap::AddToFreeList(HeapBlock *block, HeapBlock* pointToInsert) + { + CheckFreelist(); + + block->next = pointToInsert; + block->prev = pointToInsert->prev; + block->prev->next = block; + pointToInsert->prev = block; + + CheckFreelist(); + } + + void GCHeap::FreeBlock(HeapBlock *block) + { + GCAssert(block->inUse()); + + // Try to coalesce this block with its predecessor + HeapBlock *prevBlock = block - block->sizePrevious; + if (!prevBlock->inUse() && prevBlock->committed) { + GCAssert(m_megamap[((uint32)prevBlock->baseAddr)>>12] == 0); + // Remove predecessor block from free list + RemoveFromList(prevBlock); + + // Increase size of predecessor block + prevBlock->size += block->size; + + block->size = 0; + block->sizePrevious = 0; + block->baseAddr = 0; + + block = prevBlock; + } + + // Try to coalesce this block with its successor + HeapBlock *nextBlock = block + block->size; + + if (!nextBlock->inUse() && nextBlock->committed) { + // Remove successor block from free list + RemoveFromList(nextBlock); + + // Increase size of current block + block->size += nextBlock->size; + nextBlock->size = 0; + nextBlock->baseAddr = 0; + nextBlock->sizePrevious = 0; + } + + // Update sizePrevious in the next block + nextBlock = block + block->size; + nextBlock->sizePrevious = block->size; + + // Add this block to the right free list + block->dirty = true; + + AddToFreeList(block); + + CheckFreelist(); + } + + bool GCHeap::ExpandHeap(int askSize) + { +#ifdef GCHEAP_LOCK + // Acquire the spinlock, as this is a publicly + // accessible API. + GCAcquireSpinlock spinlock(m_spinlock); +#endif /* GCHEAP_LOCK */ + return ExpandHeapPrivate(askSize); + } + + bool GCHeap::ExpandHeapPrivate(int askSize) + { + int size = askSize; +#ifdef _DEBUG + // Turn this switch on to force non-contiguous heaps. + bool debug_noncontiguous = false; + + // Turn this switch on to test bridging of contiguous + // regions. + bool test_bridging = false; + int defaultReserve = test_bridging ? (size+kMinHeapIncrement) : kDefaultReserve; +#else + const int defaultReserve = kDefaultReserve; +#endif + + char *baseAddr = NULL; + char *newRegionAddr = NULL; + int newRegionSize = 0; + bool contiguous = false; + int commitAvail = 0; + + // Allocate at least kMinHeapIncrement blocks + if (size < kMinHeapIncrement) { + size = kMinHeapIncrement; + } + + // Round to the nearest kMinHeapIncrement + size = ((size + kMinHeapIncrement - 1) / kMinHeapIncrement) * kMinHeapIncrement; + + #ifdef USE_MMAP +#ifdef _DEBUG + if (lastRegion != NULL && !debug_noncontiguous) +#else + if (lastRegion != NULL) +#endif + { + commitAvail = (lastRegion->reserveTop - lastRegion->commitTop) / kBlockSize; + + // Can this request be satisfied purely by committing more memory that + // is already reserved? + if (size <= commitAvail) { + if (CommitMemory(lastRegion->commitTop, size * kBlockSize)) + { + // Succeeded! + baseAddr = lastRegion->commitTop; + contiguous = true; + + // Update the commit top. + lastRegion->commitTop += size*kBlockSize; + + // Go set up the block list. + goto gotMemory; + } + else + { + // If we can't commit memory we've already reserved, + // no other trick is going to work. Fail. + return false; + } + } + + // Try to reserve a region contiguous to the last region. + + // - Try for the "default reservation size" if it's larger than + // the requested block. + if (defaultReserve > size) { + newRegionAddr = ReserveMemory(lastRegion->reserveTop, + defaultReserve * kBlockSize); + newRegionSize = defaultReserve; + } + + // - If the default reservation size didn't work or isn't big + // enough, go for the exact amount requested, minus the + // committable space in the current region. + if (newRegionAddr == NULL) { + newRegionAddr = ReserveMemory(lastRegion->reserveTop, + (size - commitAvail)*kBlockSize); + newRegionSize = size - commitAvail; + } + + if (newRegionAddr != NULL) { + // We were able to reserve some space. + + // Commit available space from the existing region. + if (commitAvail != 0) { + if (!CommitMemory(lastRegion->commitTop, commitAvail * kBlockSize)) + { + // We couldn't commit even this space. We're doomed. + // Un-reserve the space we just reserved and fail. + ReleaseMemory(newRegionAddr, newRegionSize); + return false; + } + } + + // Commit needed space from the new region. + if (!CommitMemory(newRegionAddr, (size - commitAvail) * kBlockSize)) + { + // We couldn't commit this space. We can't meet the + // request. Un-commit any memory we just committed, + // un-reserve any memory we just reserved, and fail. + if (commitAvail != 0) { + DecommitMemory(lastRegion->commitTop, + commitAvail * kBlockSize); + } + ReleaseMemory(newRegionAddr, + (size-commitAvail)*kBlockSize); + return false; + } + + // We successfully reserved a new contiguous region + // and committed the memory we need. Finish up. + baseAddr = lastRegion->commitTop; + lastRegion->commitTop = lastRegion->reserveTop; + contiguous = true; + + goto gotMemory; + } + } + + // We were unable to allocate a contiguous region, or there + // was no existing region to be contiguous to because this + // is the first-ever expansion. Allocate a non-contiguous region. + + // Don't use any of the available space in the current region. + commitAvail = 0; + + // - Go for the default reservation size unless the requested + // size is bigger. + if (size < defaultReserve) { + newRegionAddr = ReserveMemory(NULL, + defaultReserve*kBlockSize); + newRegionSize = defaultReserve; + } + + // - If that failed or the requested size is bigger than default, + // go for the requested size exactly. + if (newRegionAddr == NULL) { + newRegionAddr = ReserveMemory(NULL, + size*kBlockSize); + newRegionSize = size; + } + + // - If that didn't work, give up. + if (newRegionAddr == NULL) { + return false; + } + + // - Try to commit the memory. + if (CommitMemory(newRegionAddr, + size*kBlockSize) == 0) + { + // Failed. Un-reserve the memory and fail. + ReleaseMemory(newRegionAddr, newRegionSize*kBlockSize); + return false; + } + + // If we got here, we've successfully allocated a + // non-contiguous region. + baseAddr = newRegionAddr; + contiguous = false; + + gotMemory: + +#else + // Allocate the requested amount of space as a new region. + newRegionAddr = AllocateMemory(size * kBlockSize); + baseAddr = newRegionAddr; + newRegionSize = size; + + // If that didn't work, give up. + if (newRegionAddr == NULL) { + return false; + } +#endif + + // If we were able to allocate a contiguous block, remove + // the old top sentinel. + if (contiguous) { + blocksLen--; + } + + // Expand the block list. + int newBlocksLen = blocksLen + size; + + // Add space for the "top" sentinel + newBlocksLen++; + + HeapBlock *newBlocks = new HeapBlock[newBlocksLen]; + if (!newBlocks) { + // Could not get the memory. + #ifdef USE_MMAP + ReleaseMemory(newRegionAddr, newRegionSize); + #else + ReleaseMemory(newRegionAddr); + #endif + return false; + } + + // Copy all the existing blocks. + if (blocksLen) { + memcpy(newBlocks, blocks, blocksLen * sizeof(HeapBlock)); + + // Fix up the prev/next pointers of each freelist. + HeapBlock *freelist = freelists; + for (int i=0; iprev != freelist) { + temp->prev = newBlocks + (temp->prev-blocks); + } + if (temp->next != freelist) { + temp->next = newBlocks + (temp->next-blocks); + } + } while ((temp = temp->next) != freelist); + freelist++; + } + CheckFreelist(); + } + + // Create a single free block for the new space, + // and add it to the free list. + HeapBlock *block = newBlocks+blocksLen; + block->baseAddr = baseAddr; + + block->size = size; + block->sizePrevious = 0; + // link up contiguous blocks + if(blocksLen && contiguous) + { + // search backwards for first real block + HeapBlock *b = &blocks[blocksLen-1]; + while(b->size == 0) + { + b--; + GCAssert(b >= blocks); + } + block->sizePrevious = b->size; + } + block->prev = NULL; + block->next = NULL; + block->committed = true; +#ifdef USE_MMAP + block->dirty = false; // correct? +#else + block->dirty = true; +#endif + +#ifdef MEMORY_INFO + block->allocTrace = 0; +#endif + + AddToFreeList(block); + + // Initialize the rest of the new blocks to empty. + for (int i=1; ibaseAddr = NULL; + block->size = 0; + block->sizePrevious = 0; + block->prev = NULL; + block->next = NULL; + block->committed = false; + block->dirty = false; +#ifdef MEMORY_INFO + block->allocTrace = 0; +#endif + } + + // Fill in the sentinel for the top of the heap. + block++; + block->baseAddr = NULL; + block->size = 0; + block->sizePrevious = size; + block->prev = NULL; + block->next = NULL; +#ifdef MEMORY_INFO + block->allocTrace = 0; +#endif + + // Replace the blocks list + if (blocks) { + delete [] blocks; + } + blocks = newBlocks; + blocksLen = newBlocksLen; + + // If we created a new region, save the base address so we can free later. + if (newRegionAddr) { + Region *newRegion = new Region; + if (newRegion == NULL) { + // Ugh, FUBAR. + return false; + } + newRegion->baseAddr = newRegionAddr; + newRegion->reserveTop = newRegionAddr+newRegionSize*kBlockSize; + newRegion->commitTop = newRegionAddr+(size-commitAvail)*kBlockSize; + newRegion->blockId = newBlocksLen-(size-commitAvail)-1; + newRegion->prev = lastRegion; + lastRegion = newRegion; + + #ifdef TRACE + printf("ExpandHeap: new region, %d reserve, %d commit, %s\n", + newRegion->reserveTop-newRegion->baseAddr, + newRegion->commitTop-newRegion->baseAddr, + contiguous ? "contiguous" : "non-contiguous"); + #endif + } + + CheckFreelist(); + +#ifdef MEMORY_INFO + if(heapVerbose) + GCDebugMsg(false, "Heap expanded by %d pages:\n", size); +#endif + + // Success! + return true; + } + + void GCHeap::RemoveRegion(Region *region) + { + Region **next = &lastRegion; + while(*next != region) + next = &((*next)->prev); + *next = region->prev; +#ifdef USE_MMAP + ReleaseMemory(region->baseAddr, + region->reserveTop-region->baseAddr); +#else + ReleaseMemory(region->baseAddr); +#endif + delete region; + } + + void GCHeap::FreeAll() + { + // Release all of the heap regions + while (lastRegion != NULL) { + Region *region = lastRegion; + lastRegion = lastRegion->prev; + #ifdef USE_MMAP + ReleaseMemory(region->baseAddr, + region->reserveTop-region->baseAddr); + #else + ReleaseMemory(region->baseAddr); + #endif + delete region; + } + delete [] blocks; + + } + +} diff --git a/mozilla/js/tamarin/MMgc/GCHeap.h b/mozilla/js/tamarin/MMgc/GCHeap.h new file mode 100644 index 00000000000..f80381be849 --- /dev/null +++ b/mozilla/js/tamarin/MMgc/GCHeap.h @@ -0,0 +1,391 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __GCHeap__ +#define __GCHeap__ + + +namespace MMgc +{ + /** + * GCHeap is a heap manager for the Flash Player's garbage collector. + * + * Memory is allocated from the operating system in large chunks + * aligned on page boundaries (4096-byte aligned). All allocation + * requests are specified in numbers of 4096-byte pages. The first + * 4 bytes of each page is reserved for GCHeap's use. + * + * Allocations may fail if there is no free block large enough + * to satisfy the request. When this occurs, the GC class will + * choose to either garbage collect or expand the heap, and then + * call GCHeap again to retry the allocation. + * + * When blocks are freed, they are coalesced with their neighbors + * when possible to reduce fragmentation. A "boundary tag" scheme + * similar to Doug Lea's malloc is used to make coalescing fast. + * To keep things simple, coalescing is always performed immediately + * when a block is freed, and not deferred. + * + * Allocations are performed using multiple free lists. Blocks that + * are <= kUniqueThreshold pages in size get their own free list. + * Blocks above the threshold get mapped to more granular free lists, + * and all blocks above kHugeThreshold get mapped to the last free list. + * This approach is borrowed from Hans Boehm's C/C++ Garbage Collector. + * + * Free lists are doubly-linked lists sorted in size order. The + * sorting is done to ensure best-fit allocation. Each free list + * is itself a list node, and the lists are circular, in a technique + * also borrowed from Doug Lea's malloc. This makes for very simple + * logic to insert/remove nodes. + * + * Only Windows is currently supported, although this should be easy + * to get working on other platforms. Memory is allocated in large + * (64K minimum) chunks using the VirtualAlloc API. Every time the + * heap is expanded, a new heap region is created corresponding to + * the address space returned by VirtualAlloc. Heap regions are + * allocated contiguously if possible to reduce fragmentation. + */ + class GCHeap : public GCAllocObject + { + public: + // -- Constants + + /** Size of a block */ + const static int kBlockSize = 4096; + + /** Initial heap size, in blocks */ + const static int kInitialHeapSize; + + /** Default size of address space reserved per region */ + const static int kDefaultReserve = 4096; + + /** Sizes up to this many blocks each have their own free list. */ + const static int kUniqueThreshold = 16; + + /** + * Sizes of at least this many heap blocks are mapped to a + * single free list. + */ + const static int kHugeThreshold = 128; + + /** In between sizes map this many distinct sizes to a single bin. */ + const static int kFreeListCompression = 8; + + /** Calculated number of free lists */ + const static int kNumFreeLists = (kHugeThreshold-kUniqueThreshold)/kFreeListCompression+kUniqueThreshold; + + /** Minimum heap increment, in blocks */ + const static int kMinHeapIncrement = 32; + + /** if this much of the heap stays free for kDecommitThresholdMillis decommit some memory */ + const static int kDecommitThresholdPercentage = 25; + + + const static int kDecommitThresholdMillis = 1000; + + /** The native VM page size (in bytes) for the current architecture */ + int kNativePageSize; + + bool heapVerbose; + + /** + * Init must be called to set up the GCHeap singleton + */ + static void Init(GCMallocFuncPtr malloc = NULL, GCFreeFuncPtr free = NULL); + + /** + * Destroy the GCHeap singleton + */ + static void Destroy(); + + /** + * Get the GCHeap singleton + */ + static GCHeap *GetGCHeap() { GCAssert(instance != NULL); return instance; } + + /** + * Allocates a block from the heap. + * @param size the number of pages (kBlockSize bytes apiece) + * to allocate. + * @return pointer to beginning of block, or NULL if failed. + */ + void *Alloc(int size, bool expand=true, bool zero=true); + + /** + * Frees a block. + * @param item the block to free. This must be the same + * pointer that was previously returned by + * a call to Alloc. + */ + void Free(void *item); + + size_t Size(const void *item); + + /** + * Expands the heap by size pages. + * + * Expands the heap by "size" blocks, such that a single contiguous + * allocation of "size" blocks can be performed. This method is + * also called to create the initial heap. + * + * On Windows, this uses the VirtualAlloc API to obtain memory. + * VirtualAlloc can _reserve_ memory, _commit_ memory or both at + * the same time. Reserved memory is just virtual address space. + * It consumes the address space of the process but isn't really + * allocated yet; there are no pages committed to it yet. + * Memory allocation really occurs when reserved pages are + * committed. Our strategy in GCHeap is to reserve a fairly large + * chunk of address space, and then commit pages from it as needed. + * By doing this, we're more likely to get contiguous regions in + * memory for our heap. + * + * By default, we reserve 16MB (4096 pages) per heap region. + * The amount to reserve by default is controlled by kDefaultReserve. + * That shouldn't be a big deal, as the process address space is 2GB. + * As we're usually a plug-in, however, we don't want to make it too + * big because it's not all our memory. + * + * The goal of reserving so much address space is so that subsequent + * expansions of the heap are able to obtain contiguous memory blocks. + * If we can keep the heap contiguous, that reduces fragmentation + * and the possibility of many small "Balkanized" heap regions. + * + * Algorithm: When an allocation is requested, + * 1. If there is enough reserved but uncommitted memory in the + * last-created region to satisfy the request, commit that memory + * and exit with success, also check decommitted list + * 2. Try to reserve a new region contiguous with the last-created + * region. Go for a 16MB reservation or the requested size, + * whichever is bigger. + * 3. If we tried for 16MB reserved space and it didn't work, try + * to reserve again, but for the requested size. + * 4. If we were able to retrieve a contiguous region in Step 2 or 3, + * commit any leftover memory from the last-created region, + * commit the remainer from the newly created region, and exit + * with success. + * 5. OK, the contiguous region didn't work out, so allocate a + * non-contiguous region. Go for 16MB or the requested size + * again, whichever is bigger. + * 6. If we tried for 16MB reserved space and it didn't work, try + * to reserve again, but for the requested size. + * 7. Commit the requested size out of the newly created region + * and exit with success. + * + * If we are able to reserve memory but can't commit it, then, well + * there isn't enough memory. We free the reserved memory and + * exit with failure. + * + * @param size the number of pages to expand the heap by + */ + bool ExpandHeap(int size); + + + /** + * Returns the used heap size, that is, the total + * space actually used by allocated objects. + * @return the minimum heap size in pages (kBlockSize bytes apiece) + */ + unsigned int GetUsedHeapSize() const { return numAlloc; } + + /** + * Returns the "free heap size", that is, the difference in the + * total heap size and the used heap size + * @return the minimum heap size in pages (kBlockSize bytes apiece) + */ + unsigned int GetFreeHeapSize() const { return GetTotalHeapSize()-numAlloc; } + + /** + * Returns the total heap size, that is, the total amount + * of space managed by the heap, including all used and + * free space. + * @return the total heap size in pages (kBlockSize bytes apiece) + */ + unsigned int GetTotalHeapSize() const { return blocksLen - numDecommitted; } + + /** + * gives memory back to the OS when there hasn't been any memory activity in a while + * and we have lots of free memory + */ + void Decommit(); + private: + + // -- Implementation + static GCHeap *instance; + GCHeap(GCMallocFuncPtr m, GCFreeFuncPtr f); + ~GCHeap(); + + // Heap regions + class Region : public GCAllocObject + { + public: + Region *prev; + char *baseAddr; + char *reserveTop; + char *commitTop; + int blockId; + }; + Region *lastRegion; + + // Block struct used for free lists and memory traversal + class HeapBlock : public GCAllocObject + { + public: + char *baseAddr; // base address of block's memory + int size; // size of this block + int sizePrevious; // size of previous block + HeapBlock *prev; // prev entry on free list + HeapBlock *next; // next entry on free list + bool committed; // is block fully committed? + bool dirty; // needs zero'ing, only valid if committed +#ifdef MEMORY_INFO + int allocTrace; +#endif + bool inUse() { return prev == NULL; } + }; + + bool ExpandHeapPrivate(int size); + + // Core data structures + HeapBlock *blocks; + unsigned int blocksLen; + unsigned int numDecommitted; + HeapBlock freelists[kNumFreeLists]; + unsigned int numAlloc; + + // Core methods + void AddToFreeList(HeapBlock *block); + void AddToFreeList(HeapBlock *block, HeapBlock* pointToInsert); + HeapBlock *AllocBlock(int size, bool& zero); + void FreeBlock(HeapBlock *block); + void FreeAll(); + + HeapBlock *Split(HeapBlock *block, int size); + +#ifdef DECOMMIT_MEMORY + void Commit(HeapBlock *block); +#endif + +#ifdef _DEBUG + friend class GC; +#endif + HeapBlock *AddrToBlock(const void *item) const; + Region *AddrToRegion(const void *item) const; + void RemoveRegion(Region *r); + + // only used on mac + GCMallocFuncPtr m_malloc; + GCFreeFuncPtr m_free; + + // debug only freelist consistency checks + void CheckFreelist(); + bool BlocksAreContiguous(void *item1, void *item2); + + // Remove a block from a free list (inlined for speed) + inline void RemoveFromList(HeapBlock *block) + { + GCAssert(!block->inUse()); + block->prev->next = block->next; + block->next->prev = block->prev; + block->next = block->prev = 0; + } + + + // Map a number of blocks to the appropriate large block free list index + // (inlined for speed) + inline int GetFreeListIndex(int size) + { + if (size <= kUniqueThreshold) { + return size-1; + } else if (size >= kHugeThreshold) { + return kNumFreeLists-1; + } else { + return (size-kUniqueThreshold)/kFreeListCompression+kUniqueThreshold-1; + } + } + + // used for decommit smoothing + // millis to wait before decommitting anything + uint64 decommitTicks; + uint64 decommitThresholdTicks; + +#ifdef GCHEAP_LOCK + GCSpinLock m_spinlock; +#endif /* GCHEAP_LOCK */ + +#ifdef MMGC_AVMPLUS + // OS abstraction to determine native page size + int vmPageSize(); + size_t committedCodeMemory; + + #ifdef WIN32 + bool useGuardPages; + #endif +public: + // support for jit buffers + void* ReserveCodeMemory(void* address, size_t size); + void* CommitCodeMemory(void* address, size_t size=0); // size=0 => 1 page + void* DecommitCodeMemory(void* address, size_t size=0); // size=0 => 1 page + void ReleaseCodeMemory(void* address, size_t size); + bool SetGuardPage(void *address); +#ifdef AVMPLUS_JIT_READONLY + void SetExecuteBit(void *address, size_t size, bool executeFlag); +#endif /* AVMPLUS_JIT_READONLY */ + size_t GetCodeMemorySize() const { return committedCodeMemory; } +#endif + +#ifdef USE_MMAP + public: + char *ReserveMemory(char *address, size_t size); + bool CommitMemory(char *address, size_t size); + bool DecommitMemory(char *address, size_t size); + void ReleaseMemory(char *address, size_t size); + + + bool CommitMemoryThatMaySpanRegions(char *address, size_t size); + bool DecommitMemoryThatMaySpanRegions(char *address, size_t size); +#else + char *AllocateMemory(size_t size); + void ReleaseMemory(char *address); +#endif + +private: + +#ifdef _DEBUG + /* m_megamap is a debugging aid for finding bugs in this + memory allocator. It tracks allocated/free pages in + the crudest way possible ... a 1MB byte array with a + 0/1 byte for every page in the 32-bit address space. */ + static uint8 m_megamap[1048576]; +#endif + }; +} + +#endif /* __GCHeap__ */ diff --git a/mozilla/js/tamarin/MMgc/GCHeapMac.cpp b/mozilla/js/tamarin/MMgc/GCHeapMac.cpp new file mode 100644 index 00000000000..b9e7aa4d403 --- /dev/null +++ b/mozilla/js/tamarin/MMgc/GCHeapMac.cpp @@ -0,0 +1,367 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include +#include +#include +#include + +#include "MMgc.h" +#include "GC.h" + +#ifdef USE_MMAP +#include +#endif + +#if defined(__MACH__) +#include +#endif + +#ifdef _MAC +#define MAP_ANONYMOUS MAP_ANON +#endif + +#if defined(MMGC_IA32) && defined(MEMORY_INFO) +#include +#endif + +namespace MMgc +{ +#ifndef USE_MMAP + void *aligned_malloc(size_t size, size_t align_size, GCMallocFuncPtr m_malloc) + { + char *ptr, *ptr2, *aligned_ptr; + int align_mask = align_size - 1; + + int alloc_size = size + align_size + sizeof(int); + ptr=(char *)m_malloc(alloc_size); + + if(ptr==NULL) return(NULL); + + ptr2 = ptr + sizeof(int); + aligned_ptr = ptr2 + (align_size - ((size_t)ptr2 & align_mask)); + + ptr2 = aligned_ptr - sizeof(int); + *((int *)ptr2)=(int)(aligned_ptr - ptr); + + return(aligned_ptr); + } + + void aligned_free(void *ptr, GCFreeFuncPtr m_free) + { + int *ptr2=(int *)ptr - 1; + char *unaligned_ptr = (char*) ptr - *ptr2; + m_free(unaligned_ptr); + } +#endif /* !USE_MMAP */ + +#ifdef MMGC_AVMPLUS +#ifdef USE_MMAP + int GCHeap::vmPageSize() + { + long v = sysconf(_SC_PAGESIZE); + if (v == -1) v = 4096; // Mac 10.1 needs this + return v; + } + + void* GCHeap::ReserveCodeMemory(void* address, + size_t size) + { + return mmap(address, + size, + PROT_NONE, + MAP_PRIVATE | MAP_ANONYMOUS, + -1, 0); + } + + void GCHeap::ReleaseCodeMemory(void* address, + size_t size) + { + if (munmap(address, size) != 0) + GCAssert(false); + } + + bool GCHeap::SetGuardPage(void* /*address*/) + { + return false; + } + +#ifdef AVMPLUS_JIT_READONLY + /** + * SetExecuteBit changes the page access protections on a block of pages, + * to make JIT-ted code executable or not. + * + * If executableFlag is true, the memory is made executable and read-only. + * + * If executableFlag is false, the memory is made non-executable and + * read-write. + */ + void GCHeap::SetExecuteBit(void *address, + size_t size, + bool executableFlag) + { + // mprotect requires that the addresses be aligned on page boundaries + void *endAddress = (void*) ((char*)address + size); + void *beginPage = (void*) ((size_t)address & ~0xFFF); + void *endPage = (void*) (((size_t)endAddress + 0xFFF) & ~0xFFF); + size_t sizePaged = (size_t)endPage - (size_t)beginPage; + + int retval = mprotect(beginPage, sizePaged, + executableFlag ? (PROT_READ|PROT_EXEC) : (PROT_READ|PROT_WRITE|PROT_EXEC)); + + GCAssert(retval == 0); + (void)retval; + } +#endif /* AVMPLUS_JIT_READONLY */ + + void* GCHeap::CommitCodeMemory(void* address, + size_t size) + { + if (size == 0) + size = GCHeap::kNativePageSize; // default of one page + +#ifdef AVMPLUS_JIT_READONLY + void *res = mmap(address, + size, + PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED, + -1, 0); +#else + void *res = mmap(address, + size, + PROT_READ | PROT_WRITE | PROT_EXEC, + MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED, + -1, 0); +#endif /* AVMPLUS_JIT_READONLY */ + + if (res == MAP_FAILED) + address = 0; + else + address = (void*)( (int)address + size ); + + return address; + } + + void* GCHeap::DecommitCodeMemory(void* address, + size_t size) + { + if (size == 0) + size = GCHeap::kNativePageSize; // default of one page + + char *addr = (char*)mmap(address, + size, + PROT_NONE, + MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED, + -1, 0); + GCAssert(addr == address); + (void)addr; + return address; + } +#else + int GCHeap::vmPageSize() + { + return 4096; + } + + void* GCHeap::ReserveCodeMemory(void* address, + size_t size) + { + return aligned_malloc(size, 4096, m_malloc); + } + + void GCHeap::ReleaseCodeMemory(void* address, + size_t size) + { + aligned_free(address, m_free); + } + + bool GCHeap::SetGuardPage(void *address) + { + return false; + } + +#ifdef AVMPLUS_JIT_READONLY + void GCHeap::SetExecuteBit(void *address, + size_t size, + bool executableFlag) + { + // No-op on Mac CFM + } +#endif /* AVMPLUS_JIT_READONLY */ + + + void* GCHeap::CommitCodeMemory(void* address, + size_t size) + { + return address; + } + void* GCHeap::DecommitCodeMemory(void* address, + size_t size) + { + return address; + } +#endif /* USE_MMAP */ +#endif /* MMGC_AVMPLUS */ + +#ifdef USE_MMAP + char* GCHeap::ReserveMemory(char *address, size_t size) + { + char *addr = (char*)mmap(address, + size, + PROT_NONE, + MAP_PRIVATE | MAP_ANONYMOUS, + -1, 0); + + // the man page for mmap documents it returns -1 to signal failure. + if (addr == (char *)-1) return NULL; + + if(address && address != addr) { + // behave like windows and fail if we didn't get the right address + ReleaseMemory(addr, size); + return NULL; + } + return addr; + } + + bool GCHeap::CommitMemory(char *address, size_t size) + { + char *addr = (char*)mmap(address, + size, + PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_FIXED | MAP_ANONYMOUS, + -1, 0); + GCAssert(addr == address); + return addr == address; + } + + bool GCHeap::DecommitMemory(char *address, size_t size) + { + char *addr = (char*)mmap(address, + size, + PROT_NONE, + MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED, + -1, 0); + GCAssert(addr == address); + return addr == address; + } + + bool GCHeap::CommitMemoryThatMaySpanRegions(char *address, size_t size) + { + return CommitMemory(address, size); + } + + bool GCHeap::DecommitMemoryThatMaySpanRegions(char *address, size_t size) + { + return DecommitMemory(address, size); + } + + void GCHeap::ReleaseMemory(char *address, size_t size) + { + int result = munmap(address, size); + GCAssert(result == 0); + (void)result; + } +#else + + char* GCHeap::AllocateMemory(size_t size) + { + return (char *) aligned_malloc(size, 4096, m_malloc); + //return (char *) MPAllocateAligned(size, kMPAllocate4096ByteAligned, 0); + } + + void GCHeap::ReleaseMemory(char *address) + { + aligned_free(address, m_free); + //MPFree(address); + } +#endif + +#ifdef MEMORY_INFO + +#ifdef MMGC_PPC + // no idea how to do this with codewarrior + void GetInfoFromPC(int pc, char *buff, int /*buffSize*/) + { + sprintf(buff, "0x%x", pc); + } + + void GetStackTrace(int *trace, int len, int skip) + { + register int stackp; + int pc; + asm("mr %0,r1" : "=r" (stackp)); + while(skip--) { + stackp = *(int*)stackp; + } + int i=0; + // save space for 0 terminator + len--; + while(i +#include +#include + +#ifdef USE_MMAP +#include +#endif + +#include + +#include "GCDebug.h" +#include "MMgc.h" +#include "GC.h" + +// avmplus standalone uses UNIX +#ifdef _MAC +#define MAP_ANONYMOUS MAP_ANON +#endif + +namespace MMgc +{ +#ifndef USE_MMAP + void *aligned_malloc(size_t size, size_t align_size, GCMallocFuncPtr m_malloc) + { + char *ptr, *ptr2, *aligned_ptr; + int align_mask = align_size - 1; + + int alloc_size = size + align_size + sizeof(int); + ptr=(char *)m_malloc(alloc_size); + + if(ptr==NULL) return(NULL); + + ptr2 = ptr + sizeof(int); + aligned_ptr = ptr2 + (align_size - ((size_t)ptr2 & align_mask)); + + ptr2 = aligned_ptr - sizeof(int); + *((int *)ptr2)=(int)(aligned_ptr - ptr); + + return(aligned_ptr); + } + + void aligned_free(void *ptr, GCFreeFuncPtr m_free) + { + int *ptr2=(int *)ptr - 1; + char *unaligned_ptr = (char*) ptr - *ptr2; + m_free(unaligned_ptr); + } +#endif /* !USE_MMAP */ + +#ifdef USE_MMAP + int GCHeap::vmPageSize() + { + long v = sysconf(_SC_PAGESIZE); + return v; + } + + void* GCHeap::ReserveCodeMemory(void* address, + size_t size) + { + return (char*) mmap(address, + size, + PROT_NONE, + MAP_PRIVATE | MAP_ANONYMOUS, + -1, 0); + } + + void GCHeap::ReleaseCodeMemory(void* address, + size_t size) + { + if (munmap(address, size) != 0) + GCAssert(false); + } + + bool GCHeap::SetGuardPage(void *address) + { + return false; + } + +#ifdef AVMPLUS_JIT_READONLY + /** + * SetExecuteBit changes the page access protections on a block of pages, + * to make JIT-ted code executable or not. + * + * If executableFlag is true, the memory is made executable and read-only. + * + * If executableFlag is false, the memory is made non-executable and + * read-write. + */ + void GCHeap::SetExecuteBit(void *address, + size_t size, + bool executableFlag) + { + // mprotect requires that the addresses be aligned on page boundaries + void *endAddress = (void*) ((char*)address + size); + void *beginPage = (void*) ((size_t)address & ~0xFFF); + void *endPage = (void*) (((size_t)endAddress + 0xFFF) & ~0xFFF); + size_t sizePaged = (size_t)endPage - (size_t)beginPage; + + int retval = mprotect(beginPage, sizePaged, + executableFlag ? (PROT_READ|PROT_EXEC) : (PROT_READ|PROT_WRITE|PROT_EXEC)); + + GCAssert(retval == 0); + } +#endif /* AVMPLUS_JIT_READONLY */ + + void* GCHeap::CommitCodeMemory(void* address, + size_t size) + { + void* res; + if (size == 0) + size = GCHeap::kNativePageSize; // default of one page + +#ifdef AVMPLUS_JIT_READONLY + mmap(address, + size, + PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_FIXED | MAP_ANONYMOUS, + -1, 0); +#else + mmap(address, + size, + PROT_READ | PROT_WRITE | PROT_EXEC, + MAP_PRIVATE | MAP_FIXED | MAP_ANONYMOUS, + -1, 0); +#endif /* AVMPLUS_JIT_READONLY */ + res = address; + + if (res == address) + address = (void*)( (int)address + size ); + else + address = 0; + return address; + } + + void* GCHeap::DecommitCodeMemory(void* address, + size_t size) + { + if (size == 0) + size = GCHeap::kNativePageSize; // default of one page + + // release and re-reserve it + ReleaseCodeMemory(address, size); + address = ReserveCodeMemory(address, size); + return address; + } +#else + int GCHeap::vmPageSize() + { + return 4096; + } + + void* GCHeap::ReserveCodeMemory(void* address, + size_t size) + { + return aligned_malloc(size, 4096, m_malloc); + } + + void GCHeap::ReleaseCodeMemory(void* address, + size_t size) + { + aligned_free(address, m_free); + } + + bool GCHeap::SetGuardPage(void *address) + { + return false; + } + + void* GCHeap::CommitCodeMemory(void* address, + size_t size) + { + return address; + } + void* GCHeap::DecommitCodeMemory(void* address, + size_t size) + { + return address; + } +#endif /* USE_MMAP */ + +#ifdef USE_MMAP + char* GCHeap::ReserveMemory(char *address, size_t size) + { + char *addr = (char*)mmap(address, + size, + PROT_NONE, + MAP_PRIVATE | MAP_ANONYMOUS, + -1, 0); + if(address && address != addr) { + // behave like windows and fail if we didn't get the right address + ReleaseMemory(addr, size); + return NULL; + } + return addr; + } + + bool GCHeap::CommitMemory(char *address, size_t size) + { + char *addr = (char*)mmap(address, + size, + PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_FIXED | MAP_ANONYMOUS, + -1, 0); + GCAssert(addr == address); + return addr == address; + } + + bool GCHeap::DecommitMemory(char *address, size_t size) + { + ReleaseMemory(address, size); + // re-reserve it + char *addr = (char*)mmap(address, + size, + PROT_NONE, + MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED, + -1, 0); + GCAssert(addr == address); + return addr == address; + } + + bool GCHeap::CommitMemoryThatMaySpanRegions(char *address, size_t size) + { + return CommitMemory(address, size); + } + + bool GCHeap::DecommitMemoryThatMaySpanRegions(char *address, size_t size) + { + return DecommitMemory(address, size); + } + + void GCHeap::ReleaseMemory(char *address, size_t size) + { + int result = munmap(address, size); + GCAssert(result == 0); + } +#else + char* GCHeap::AllocateMemory(size_t size) + { + return (char *) aligned_malloc(size, 4096, m_malloc); + } + + void GCHeap::ReleaseMemory(char *address) + { + aligned_free(address, m_free); + } +#endif + + +#ifdef MEMORY_INFO + + // Bandaid implementations for these functions. Windows has its own version. + void GetInfoFromPC(int pc, char *buff, int buffSize) + { + sprintf(buff, "0x%x", pc); + } + +#ifdef MMGC_PPC + void GetStackTrace(int *trace, int len, int skip) + { + register int stackp; + int pc; + asm("mr %0,r1" : "=r" (stackp)); + while(skip--) { + stackp = *(int*)stackp; + } + int i=0; + // save space for 0 terminator + len--; + while(i + +#include "MMgc.h" + +#ifdef MEMORY_INFO +#include +#include +#include +#endif + +#ifdef MEMORY_INFO + +namespace MMgc +{ + // -------------------------------------------------------------------------- + // -------------------------------------------------------------------------- + // -------------------------------------------------------------------------- + + // helper snarfed and simplified from main flash player code. + // since we only need it here and only for debug, I didn't bother + // migrating the whole thing. + class DynamicLoadLibraryHelper + { + protected: + DynamicLoadLibraryHelper(const char* p_dllName, bool p_required = true); + virtual ~DynamicLoadLibraryHelper(); + + FARPROC GetProc(const char* p_funcName, bool p_required = true); + + public: + // note that this is only if any of the *required* ones failed; + // some "optional" ones may be missing and still have this return true. + bool AllRequiredItemsPresent() const { return m_allRequiredItemsPresent; } + + private: + HMODULE m_lib; + bool m_allRequiredItemsPresent; + }; + + // -------------------------------------------------------------------------- + // -------------------------------------------------------------------------- + // -------------------------------------------------------------------------- + + #define GETPROC(n) do { m_##n = (n##ProcPtr)GetProc(#n); } while (0) + #define GETPROC_OPTIONAL(n) do { m_##n = (n##ProcPtr)GetProc(#n, false); } while (0) + + // -------------------------------------------------------------------------- + DynamicLoadLibraryHelper::DynamicLoadLibraryHelper(const char* p_dllName, bool p_required) : + m_lib(NULL), + m_allRequiredItemsPresent(true) // assume the best + { + m_lib = ::LoadLibraryA(p_dllName); + if (p_required && (m_lib == NULL || m_lib == INVALID_HANDLE_VALUE)) + { + // don't assert here... it will trigger a DebugBreak(), which will crash + // systems not running a debugger... and QE insists that they be able + // to run Debug builds on debuggerless Win98 systems... (sigh) + //GCAssertMsg(0, p_dllName); + m_allRequiredItemsPresent = false; + } + } + + // -------------------------------------------------------------------------- + FARPROC DynamicLoadLibraryHelper::GetProc(const char* p_funcName, bool p_required) + { + FARPROC a_proc = NULL; + if (m_lib != NULL && m_lib != INVALID_HANDLE_VALUE) + { + a_proc = ::GetProcAddress(m_lib, p_funcName); + } + if (p_required && a_proc == NULL) + { + // don't assert here... it will trigger a DebugBreak(), which will crash + // systems not running a debugger... and QE insists that they be able + // to run Debug builds on debuggerless Win98 systems... (sigh) + //GCAssertMsg(0, p_funcName); + m_allRequiredItemsPresent = false; + } + return a_proc; + } + + // -------------------------------------------------------------------------- + DynamicLoadLibraryHelper::~DynamicLoadLibraryHelper() + { + if (m_lib != NULL && m_lib != INVALID_HANDLE_VALUE) + { + ::FreeLibrary(m_lib); + } + } + + // -------------------------------------------------------------------------- + // -------------------------------------------------------------------------- + // -------------------------------------------------------------------------- + + // -------------------------------------------------------------------------- + class DbgHelpDllHelper : public DynamicLoadLibraryHelper + { + public: + DbgHelpDllHelper(); + + public: + + typedef BOOL (__stdcall *StackWalk64ProcPtr)( + DWORD MachineType, + HANDLE hProcess, + HANDLE hThread, + LPSTACKFRAME64 StackFrame, + PVOID ContextRecord, + PREAD_PROCESS_MEMORY_ROUTINE64 ReadMemoryRoutine, + PFUNCTION_TABLE_ACCESS_ROUTINE64 FunctionTableAccessRoutine, + PGET_MODULE_BASE_ROUTINE64 GetModuleBaseRoutine, + PTRANSLATE_ADDRESS_ROUTINE64 TranslateAddress + ); + + typedef PVOID (__stdcall *SymFunctionTableAccess64ProcPtr)( + HANDLE hProcess, + DWORD64 AddrBase + ); + + typedef DWORD64 (__stdcall *SymGetModuleBase64ProcPtr)( + HANDLE hProcess, + DWORD64 qwAddr + ); + + typedef BOOL (__stdcall *SymGetLineFromAddr64ProcPtr)( + HANDLE hProcess, + DWORD64 qwAddr, + PDWORD pdwDisplacement, + PIMAGEHLP_LINE64 Line64 + ); + + typedef BOOL (__stdcall *SymGetSymFromAddr64ProcPtr)( + HANDLE hProcess, + DWORD64 qwAddr, + PDWORD64 pdwDisplacement, + PIMAGEHLP_SYMBOL64 Symbol + ); + + typedef BOOL (__stdcall *SymInitializeProcPtr)( + HANDLE hProcess, + PSTR UserSearchPath, + BOOL fInvadeProcess + ); + + public: + StackWalk64ProcPtr m_StackWalk64; + SymFunctionTableAccess64ProcPtr m_SymFunctionTableAccess64; + SymGetModuleBase64ProcPtr m_SymGetModuleBase64; + SymGetLineFromAddr64ProcPtr m_SymGetLineFromAddr64; + SymGetSymFromAddr64ProcPtr m_SymGetSymFromAddr64; + SymInitializeProcPtr m_SymInitialize; + }; + + // -------------------------------------------------------------------------- + DbgHelpDllHelper::DbgHelpDllHelper() : + DynamicLoadLibraryHelper("dbghelp.dll"), + m_StackWalk64(NULL), + m_SymFunctionTableAccess64(NULL), + m_SymGetModuleBase64(NULL), + m_SymGetLineFromAddr64(NULL), + m_SymGetSymFromAddr64(NULL), + m_SymInitialize(NULL) + { + GETPROC(StackWalk64); + GETPROC(SymFunctionTableAccess64); + GETPROC(SymGetModuleBase64); + GETPROC(SymGetLineFromAddr64); + GETPROC(SymGetSymFromAddr64); + GETPROC(SymInitialize); + } + + // declaring this statically will dynamically load the dll and procs + // at startup, and never ever release them... if this ever becomes NON-debug + // code, you might want to have a way to toss all this... but for _DEBUG + // only, it should be fine + static DbgHelpDllHelper g_DbgHelpDll; + +} +#endif + +namespace MMgc +{ +#ifdef MMGC_AVMPLUS + int GCHeap::vmPageSize() + { + SYSTEM_INFO sysinfo; + GetSystemInfo(&sysinfo); + + return sysinfo.dwPageSize; + } + + void* GCHeap::ReserveCodeMemory(void* address, + size_t size) + { + return VirtualAlloc(address, + size, + MEM_RESERVE, + PAGE_NOACCESS); + } + + void GCHeap::ReleaseCodeMemory(void* address, + size_t /*size*/) + { + VirtualFree(address, 0, MEM_RELEASE); + } + + void* GCHeap::CommitCodeMemory(void* address, + size_t size) + { + if (size == 0) + size = GCHeap::kNativePageSize; // default of one page + +#ifdef AVMPLUS_JIT_READONLY + void* addr = VirtualAlloc(address, + size, + MEM_COMMIT, + PAGE_READWRITE); +#else + void* addr = VirtualAlloc(address, + size, + MEM_COMMIT, + PAGE_EXECUTE_READWRITE); +#endif /* AVMPLUS_JIT_READONLY */ + if (addr == NULL) + address = 0; + else { + address = (void*)( (int)address + size ); + committedCodeMemory += size; + } + return address; + } + +#ifdef AVMPLUS_JIT_READONLY + /** + * SetExecuteBit changes the page access protections on a block of pages, + * to make JIT-ted code executable or not. + * + * If executableFlag is true, the memory is made executable and read-only. + * + * If executableFlag is false, the memory is made non-executable and + * read-write. + * + * [rickr] bug #182323 The codegen can bail in the middle of generating + * code for any number of reasons. When this occurs we need to ensure + * that any code that was previously on the page still executes, so we + * leave the page as PAGE_EXECUTE_READWRITE rather than PAGE_READWRITE. + * Ideally we'd use PAGE_READWRITE and then on failure revert it back to + * read/execute but this is a little tricker and doesn't add too much + * protection since only a single page is 'exposed' with this technique. + */ + void GCHeap::SetExecuteBit(void *address, + size_t size, + bool executableFlag) + { + DWORD oldProtectFlags = 0; + BOOL retval = VirtualProtect(address, + size, + executableFlag ? PAGE_EXECUTE_READ : PAGE_EXECUTE_READWRITE, + &oldProtectFlags); + + (void)retval; + GCAssert(retval); + + // We should not be clobbering PAGE_GUARD protections + GCAssert((oldProtectFlags & PAGE_GUARD) == 0); + } +#endif /* AVMPLUS_JIT_READONLY */ + + bool GCHeap::SetGuardPage(void *address) + { + if (!useGuardPages) + { + return false; + } + void *res = VirtualAlloc(address, + GCHeap::kNativePageSize, + MEM_COMMIT, + PAGE_GUARD | PAGE_READWRITE); + return res != 0; + } + + void* GCHeap::DecommitCodeMemory(void* address, + size_t size) + { + if (size == 0) + size = GCHeap::kNativePageSize; // default of one page + + if (VirtualFree(address, size, MEM_DECOMMIT) == false) + address = 0; + else + committedCodeMemory -= size; + + return address; + } +#endif + + #ifdef USE_MMAP + char* GCHeap::ReserveMemory(char *address, + size_t size) + { + return (char*) VirtualAlloc(address, + size, + MEM_RESERVE, + PAGE_NOACCESS); + } + + bool GCHeap::CommitMemory(char *address, + size_t size) + { + void *addr = VirtualAlloc(address, + size, + MEM_COMMIT, + PAGE_READWRITE); +#ifdef _DEBUG + if(addr == NULL) { + MEMORY_BASIC_INFORMATION mbi; + VirtualQuery(address, &mbi, sizeof(MEMORY_BASIC_INFORMATION)); + LPVOID lpMsgBuf; + FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language + (LPTSTR) &lpMsgBuf, 0, NULL ); + GCAssertMsg(false, (const char*)lpMsgBuf); + } +#endif + return addr != NULL; + } + + bool GCHeap::DecommitMemory(char *address, size_t size) + { + return VirtualFree(address, size, MEM_DECOMMIT) != 0; + } + + void GCHeap::ReleaseMemory(char *address, + size_t /*size*/) + { + VirtualFree(address, 0, MEM_RELEASE); + } + + bool GCHeap::CommitMemoryThatMaySpanRegions(char *address, size_t size) + { + bool success = false; + MEMORY_BASIC_INFORMATION mbi; + do { + VirtualQuery(address, &mbi, sizeof(MEMORY_BASIC_INFORMATION)); + size_t commitSize = size > mbi.RegionSize ? mbi.RegionSize : size; + success = CommitMemory(address, commitSize); + address += commitSize; + size -= commitSize; + } while(size > 0 && success); + return success; + } + + bool GCHeap::DecommitMemoryThatMaySpanRegions(char *address, size_t size) + { + bool success = false; + MEMORY_BASIC_INFORMATION mbi; + do { + VirtualQuery(address, &mbi, sizeof(MEMORY_BASIC_INFORMATION)); + size_t commitSize = size > mbi.RegionSize ? mbi.RegionSize : size; + success = DecommitMemory(address, commitSize); + address += commitSize; + size -= commitSize; + } while(size > 0 && success); + return success; + } + + #else + char* GCHeap::AllocateMemory(size_t size) + { + return (char*)_aligned_malloc(size, kBlockSize); + } + + void GCHeap::ReleaseMemory(char *address) + { + _aligned_free(address); + } + #endif + +#ifdef MEMORY_INFO +#ifndef MEMORY_INFO + + // empty when MEMORY_INFO not defined + void GetInfoFromPC(int pc, char *buff, int buffSize) { } + void GetStackTrace(int *trace, int len, int skip) {} + +#else + + void GetStackTrace(int *trace, int len, int skip) + { + HANDLE ht = GetCurrentThread(); + HANDLE hp = GetCurrentProcess(); + + CONTEXT c; + memset( &c, '\0', sizeof c ); + c.ContextFlags = CONTEXT_FULL; + +#if 0 + // broken with SP2 + if ( !GetThreadContext( ht, &c ) ) + return; +#else + __asm + { + call x + x: pop eax + mov c.Eip, eax + mov c.Ebp, ebp + } +#endif + + // skip an extra frame + skip++; + + STACKFRAME64 frame; + memset(&frame, 0, sizeof frame); + + frame.AddrPC.Offset = c.Eip; + frame.AddrPC.Mode = AddrModeFlat; + frame.AddrFrame.Offset = c.Ebp; + frame.AddrFrame.Mode = AddrModeFlat; + + int i=0; + // save space for 0 pc terminator + len--; + while(i < len && + g_DbgHelpDll.m_StackWalk64 != NULL && + g_DbgHelpDll.m_SymFunctionTableAccess64 != NULL && + g_DbgHelpDll.m_SymGetModuleBase64 != NULL && + (*g_DbgHelpDll.m_StackWalk64)(IMAGE_FILE_MACHINE_I386, hp, ht, &frame, + NULL, NULL, g_DbgHelpDll.m_SymFunctionTableAccess64, g_DbgHelpDll.m_SymGetModuleBase64, NULL)) { + if(skip-- > 0) + continue; + // FIXME: not 64 bit safe + trace[i++] = (int) frame.AddrPC.Offset; + } + trace[i] = 0; + } + + static bool inited = false; + static const int MaxNameLength = 256; + void GetInfoFromPC(int pc, char *buff, int buffSize) + { + if(!inited) { + if(!g_DbgHelpDll.m_SymInitialize || + !(*g_DbgHelpDll.m_SymInitialize)(GetCurrentProcess(), NULL, true)) { + LPVOID lpMsgBuf; + if(FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language + (LPTSTR) &lpMsgBuf, 0, NULL )) + { + GCDebugMsg("See lpMsgBuf", true); + LocalFree(lpMsgBuf); + } + goto nosym; + } + inited = true; + } + + // gleaned from IMAGEHLP_SYMBOL64 docs + IMAGEHLP_SYMBOL64 *pSym = (IMAGEHLP_SYMBOL64 *) alloca(sizeof(IMAGEHLP_SYMBOL64) + MaxNameLength); + pSym->SizeOfStruct = sizeof(IMAGEHLP_SYMBOL64); + pSym->MaxNameLength = MaxNameLength; + + DWORD64 offsetFromSymbol; + if(!g_DbgHelpDll.m_SymGetSymFromAddr64 || + !(*g_DbgHelpDll.m_SymGetSymFromAddr64)(GetCurrentProcess(), pc, &offsetFromSymbol, pSym)) { + goto nosym; + } + + // get line + IMAGEHLP_LINE64 line; + memset(&line, 0, sizeof(IMAGEHLP_LINE64)); + line.SizeOfStruct = sizeof(IMAGEHLP_LINE64); + DWORD offsetFromLine; + if(!g_DbgHelpDll.m_SymGetLineFromAddr64 || + !(*g_DbgHelpDll.m_SymGetLineFromAddr64)(GetCurrentProcess(), pc, &offsetFromLine, &line)) { + goto nosym; + } + + /* + this isn't working, I think i need to call SymLoadModule64 or something + IMAGEHLP_MODULE64 module; + memset(&module, 0, sizeof module); + module.SizeOfStruct = sizeof module; + if(!SymGetModuleInfo64(GetCurrentProcess(), pSym->Address, &module)) + { + LPVOID lpMsgBuf; + if(FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language + (LPTSTR) &lpMsgBuf, 0, NULL )) + { + GCDebugMsg((wchar*)lpMsgBuf, true); + LocalFree(lpMsgBuf); + } + } + */ + + // success! + char *fileName = line.FileName + strlen(line.FileName); + + // skip everything up to last slash + while(fileName > line.FileName && *fileName != '\\') + fileName--; + fileName++; + StringCchPrintfA(buff, buffSize, "%s:%d", fileName, line.LineNumber); + return; + +nosym: + StringCchPrintfA(buff, buffSize, "0x%x", pc); + } +#endif +#endif // MEMORY_INFO + +} diff --git a/mozilla/js/tamarin/MMgc/GCLargeAlloc.cpp b/mozilla/js/tamarin/MMgc/GCLargeAlloc.cpp new file mode 100644 index 00000000000..4ff3c9d5da2 --- /dev/null +++ b/mozilla/js/tamarin/MMgc/GCLargeAlloc.cpp @@ -0,0 +1,162 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include +#include +#include +#include + +#include "MMgc.h" + +namespace MMgc +{ + GCLargeAlloc::GCLargeAlloc(GC* gc) : m_gc(gc) + { + m_blocks = NULL; + m_startedFinalize = false; + } + + void* GCLargeAlloc::Alloc(size_t size, int flags) + { + int blocks = (size+sizeof(LargeBlock)+GCHeap::kBlockSize-1) / GCHeap::kBlockSize; + + LargeBlock *block = (LargeBlock*) m_gc->AllocBlock(blocks, GC::kGCLargeAllocPageFirst, (flags&GC::kZero) != 0); + void *item = NULL; + + if (block) + { + block->flags = ((flags&GC::kFinalize) != 0) ? kFinalizeFlag : 0; + block->flags |= ((flags&GC::kContainsPointers) != 0) ? kContainsPointers : 0; + block->flags |= ((flags&GC::kRCObject) != 0) ? kRCObject : 0; + block->gc = this->m_gc; + block->next = m_blocks; + block->usableSize = blocks*GCHeap::kBlockSize - sizeof(LargeBlock); + m_blocks = block; + + item = (void*)(block+1); + + if(m_gc->collecting && !m_startedFinalize) + block->flags |= kMarkFlag; + +#ifdef _DEBUG + if (flags & GC::kZero) + { + // AllocBlock should take care of this + for(int i=0, n=size/sizeof(int); iflags & kHasWeakRef) + b->gc->ClearWeakRef(GetUserPointer(item)); + + LargeBlock **prev = &m_blocks; + while(*prev) + { + if(b == *prev) + { + *prev = b->next; + m_gc->FreeBlock(b, b->GetNumBlocks()); + return; + } + prev = &(*prev)->next; + } + GCAssertMsg(false, "Bad free!"); + } + + void GCLargeAlloc::ClearMarks() + { + LargeBlock *block = m_blocks; + while (block) { + block->flags &= ~(kMarkFlag|kQueuedFlag); + block = block->next; + } + } + + void GCLargeAlloc::Finalize() + { + m_startedFinalize = true; + LargeBlock **prev = &m_blocks; + while (*prev) { + LargeBlock *b = *prev; + if ((b->flags & kMarkFlag) == 0) { + void *item = b+1; + if (NeedsFinalize(b)) { + GCFinalizedObject *obj = (GCFinalizedObject *) item; + obj = (GCFinalizedObject *) GetUserPointer(obj); + obj->~GCFinalizedObject(); +#if defined(_DEBUG) && defined(MMGC_DRC) + if((b->flags & kRCObject) != 0) { + b->gc->RCObjectZeroCheck((RCObject*)obj); + } +#endif + } + if(b->flags & kHasWeakRef) { + b->gc->ClearWeakRef(GetUserPointer(item)); + } + // unlink from list + *prev = b->next; + b->gc->AddToLargeEmptyBlockList(b); + continue; + } + // clear marks + b->flags &= ~(kMarkFlag|kQueuedFlag); + prev = &b->next; + } + m_startedFinalize = false; + } + + GCLargeAlloc::~GCLargeAlloc() + { + GCAssert(!m_blocks); + } + + /* static */ + bool GCLargeAlloc::ConservativeGetMark(const void *item, bool bogusPointerReturnValue) + { + if(((intptr) item & 0xfff) == sizeof(LargeBlock)) + { + return GetMark(item); + } + return bogusPointerReturnValue; + } +} diff --git a/mozilla/js/tamarin/MMgc/GCLargeAlloc.h b/mozilla/js/tamarin/MMgc/GCLargeAlloc.h new file mode 100644 index 00000000000..1389232fc32 --- /dev/null +++ b/mozilla/js/tamarin/MMgc/GCLargeAlloc.h @@ -0,0 +1,180 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __GCLargeAlloc__ +#define __GCLargeAlloc__ + +namespace MMgc +{ + /** + * This is a garbage collecting allocator for large memory blocks. + */ + class GCLargeAlloc : public GCAllocObject + { + friend class GC; + private: + enum { + kMarkFlag = 0x1, + kQueuedFlag = 0x2, + kFinalizeFlag = 0x4, + kHasWeakRef = 0x8, + kContainsPointers = 0x10, + kRCObject = 0x20 + }; + + public: + GCLargeAlloc(GC* gc); + ~GCLargeAlloc(); + + void* Alloc(size_t size, int flags); + void Free(void *ptr); + void Finalize(); + void ClearMarks(); + + static void SetHasWeakRef(const void *item, bool to) + { + if(to) { + GetBlockHeader(item)->flags |= kHasWeakRef; + } else { + GetBlockHeader(item)->flags &= ~kHasWeakRef; + } + } + + static bool HasWeakRef(const void *item) + { + return (GetBlockHeader(item)->flags & kHasWeakRef) != 0; + } + + static bool IsLargeBlock(const void *item) + { + // The pointer should be 4K aligned plus 16 bytes + // Mac inserts 16 bytes for new[] so make it more general + return (((uint32)item & 0xFFF) == sizeof(LargeBlock)); + } + + static bool SetMark(const void *item) + { + LargeBlock *block = GetBlockHeader(item); + bool oldMark = (block->flags & kMarkFlag) != 0; + block->flags |= kMarkFlag; + block->flags &= ~kQueuedFlag; + return oldMark; + } + + static void SetQueued(const void *item) + { + LargeBlock *block = GetBlockHeader(item); + block->flags |= kQueuedFlag; + } + + static void SetFinalize(const void *item) + { + LargeBlock *block = GetBlockHeader(item); + block->flags |= kFinalizeFlag; + } + + static bool GetMark(const void *item) + { + LargeBlock *block = GetBlockHeader(item); + return (block->flags & kMarkFlag) != 0; + } + + static bool IsWhite(const void *item) + { + LargeBlock *block = GetBlockHeader(item); + if(!IsLargeBlock(item)) + return false; + return (block->flags & (kMarkFlag|kQueuedFlag)) == 0; + } + + static void* FindBeginning(const void *item) + { + LargeBlock *block = GetBlockHeader(item); + return (void*) (block+1); + } + + static void ClearFinalized(const void *item) + { + LargeBlock *block = GetBlockHeader(item); + block->flags &= ~kFinalizeFlag; + } + + static bool ContainsPointers(const void *item) + { + LargeBlock *block = GetBlockHeader(item); + return (block->flags & kContainsPointers) != 0; + } + + static bool IsFinalized(const void *item) + { + LargeBlock *block = GetBlockHeader(item); + return (block->flags & kFinalizeFlag) != 0; + } + + static bool IsRCObject(const void *item) + { + LargeBlock *block = GetBlockHeader(item); + return (block->flags & kRCObject) != 0; + } + + private: + struct LargeBlock + { + GC *gc; + uint32 usableSize; + uint32 flags; + LargeBlock *next; + + int GetNumBlocks() const { return (usableSize + sizeof(LargeBlock)) / GCHeap::kBlockSize; } + }; + + static LargeBlock* GetBlockHeader(const void *addr) + { + return (LargeBlock*) ((uint32)addr & ~0xFFF); + } + + static bool NeedsFinalize(LargeBlock *block) + { + return (block->flags & kFinalizeFlag) != 0; + } + + // The list of chunk blocks + LargeBlock* m_blocks; + bool m_startedFinalize; + static bool ConservativeGetMark(const void *item, bool bogusPointerReturnValue); + + protected: + GC *m_gc; + + }; +} + +#endif /* __GCLargeAlloc__ */ diff --git a/mozilla/js/tamarin/MMgc/GCMemoryProfiler.cpp b/mozilla/js/tamarin/MMgc/GCMemoryProfiler.cpp new file mode 100644 index 00000000000..2091588cfb7 --- /dev/null +++ b/mozilla/js/tamarin/MMgc/GCMemoryProfiler.cpp @@ -0,0 +1,551 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "MMgc.h" + +#ifdef MEMORY_INFO + +#ifndef __MWERKS__ +#include +#endif + +namespace MMgc +{ + GCThreadLocal memtag; + GCThreadLocal memtype; + + // Turn this to see GC stack traces. + const bool enableTraces = false; + + // this is how many stack frames we'll attempt to lookup, we may not get this many and + // we may leave some out + const int kMaxTraceDepth = 7; + + // include total and swept memory totals in memory profiling dumps + const bool showTotal = false; + const bool showSwept = false; + + // controls size of table which is fixed + const int kNumTracesPow = 20; + const int kNumTraces = (enableTraces ? 1 << kNumTracesPow : 1); + +#ifdef GCHEAP_LOCK + GCCriticalSection m_traceTableLock; +#endif + + struct StackTrace + { + int ips[kMaxTraceDepth]; + int size; + int totalSize; + int sweepSize; + int vtable; + const char *memtag; + int count; + int totalCount; + int sweepCount; + bool lumped; + }; + + static StackTrace traceTable[kNumTraces]; + + unsigned int hashTrace(int *trace) + { + unsigned int hash = *trace++; + while(*trace++ != 0) { + hash ^= *trace; + } + return hash; + } + + bool tracesEqual(int *trace1, int *trace2) + { + while(*trace1) { + if(*trace1 != *trace2) + return false; + trace1++; + trace2++; + } + return *trace1 == *trace2; + } + + unsigned int LookupTrace(int *trace) + { +#ifdef GCHEAP_LOCK + GCEnterCriticalSection lock(m_traceTableLock); +#endif + // this is true when traces are off + if(*trace == 0) + return 0; + + static int numTraces = 0; + int modmask = kNumTraces - 1; + unsigned int hash = hashTrace(trace); + unsigned int index = hash & modmask; + unsigned int n = 17; // small number means cluster at start + int c = 1; + while(traceTable[index].ips[0] && !tracesEqual(traceTable[index].ips, trace)) { + // probe + index = (index + (n=n+c)) & modmask; + } + if(traceTable[index].ips[0] == 0) { + memcpy(traceTable[index].ips, trace, kMaxTraceDepth * sizeof(int)); + numTraces++; + } + if(numTraces == kNumTraces) { + GCAssertMsg(false, "Increase trace table size!"); + } + return index; + } + + // increase this to get more + const int kNumTypes = 10; + const int kNumTracesPerType=5; + + // data structure to gather allocations by type with the top 5 traces + struct TypeGroup + { + const char *name; + size_t size; + int count; + int traces[kNumTracesPerType ? kNumTracesPerType : 1]; + }; + + const char* GetTypeName(int index, void *obj) + { + // cache + if(index > kNumTraces) + return "unknown"; + if(traceTable[index].memtag) + return traceTable[index].memtag; + const char*name="unknown"; +#ifdef WIN32 + try { + const std::type_info *ti = &typeid(*(MMgc::GCObject*)obj); + if(ti->name()) + name = ti->name(); + // sometimes name will get set to bogus memory with no exceptions catch that + char c = *name; + (void)c; // silence compiler warning + } catch(...) { + name = "unknown"; + } +#else + (void)obj; +#endif + // cache + traceTable[index].memtag = name; + return name; + } + +#define PERCENT(all, some) ((((float)some)/(float)all)*100.0) + + void DumpFatties() + { + GCHashtable typeTable(128); +#ifdef GCHEAP_LOCK + //GCEnterCriticalSection lock(m_traceTableLock); +#endif + int residentSize=0; + int residentCount=0; + + for(int i=0; i < kNumTraces; i++) + { + int size; + + if(showSwept) { + size = traceTable[i].sweepSize; + } else if(showTotal) { + size = traceTable[i].totalSize; + } else { + size = traceTable[i].size; + } + + if(size == 0) + continue; + residentSize += size; + + int count = traceTable[i].lumped ? 0 : traceTable[i].count; + residentCount += traceTable[i].count; + + const char *name = "unknown"; +#ifndef _MAC +#ifndef AVMPLUS_LINUX // TODO_LINUX +#ifndef MMGC_ARM + name = GetTypeName(i, &traceTable[i].vtable); +#endif //AVMPLUS_LINUX +#endif //MMGC_ARM +#endif + TypeGroup *tg = (TypeGroup*) typeTable.get((void*)name); + if(tg) { + GCAssert(tg->name == name); + tg->size += size; + tg->count += count; + for(int j=0; jtraces[j]].size < size) { + if(j != kNumTracesPerType-1) { + memmove(&tg->traces[j+1], &tg->traces[j], (kNumTracesPerType-j-1)*sizeof(int)); + } + tg->traces[j] = i; + break; + } + } + } else { + tg = new TypeGroup(); + tg->size = size; + tg->count = count; + tg->name = name; + tg->traces[0] = i; + if(kNumTracesPerType) { + int num = kNumTracesPerType - 1; + memset(&tg->traces[1], 0, sizeof(int)*num); + } + typeTable.put((void*)name, tg); + } + } + + int codeSize = 0; + + GCHeap* heap = GCHeap::GetGCHeap(); + +#ifdef MMGC_AVMPLUS + codeSize = heap->GetCodeMemorySize(); +#endif + int inUse = heap->GetUsedHeapSize() * GCHeap::kBlockSize; + int committed = heap->GetTotalHeapSize() * GCHeap::kBlockSize + codeSize; + int free = heap->GetFreeHeapSize() * GCHeap::kBlockSize; + + int memInfo = residentCount*16; + + // executive summary + GCDebugMsg(false, "Code Size %d kb \n", codeSize>>10); + GCDebugMsg(false, "Total in use (used pages, ignoring code) %d kb \n", inUse>>10); + GCDebugMsg(false, "Total resident (individual allocations - code) %d kb \n", (residentSize-codeSize)>>10); + GCDebugMsg(false, "Allocator overhead (used pages - resident, ignoring code and mem_info): %d kb \n", ((inUse-memInfo)-(residentSize-codeSize))>>10); + GCDebugMsg(false, "Heap overhead (unused committed pages, ignoring code): %d kb \n", free>>10); + GCDebugMsg(false, "Total committed (including code) %d kb \n\n", committed>>10); + + TypeGroup *residentFatties[kNumTypes]; + memset(residentFatties, 0, kNumTypes * sizeof(TypeGroup *)); + GCHashtableIterator iter(&typeTable); + const char *name; + while((name = (const char*)iter.nextKey()) != NULL) + { + TypeGroup *tg = (TypeGroup*)iter.value(); + for(int j=0; jsize < tg->size) { + if(j != kNumTypes-1) { + memmove(&residentFatties[j+1], &residentFatties[j], (kNumTypes-j-1) * sizeof(TypeGroup *)); + } + residentFatties[j] = tg; + break; + } + } + } + + for(int i=0; i < kNumTypes; i++) + { + TypeGroup *tg = residentFatties[i]; + if(!tg) + break; + GCDebugMsg(false, "%s - %3.1f%% - %d kb %d items, avg %d b\n", tg->name, PERCENT(residentSize, tg->size), tg->size>>10, tg->count, tg->count ? tg->size/tg->count : 0); + for(int j=0; j < kNumTracesPerType; j++) { + int traceIndex = tg->traces[j]; + if(traceIndex) { + int size = traceTable[traceIndex].size; + int count = traceTable[traceIndex].count; + if(showSwept) { + size = traceTable[traceIndex].sweepSize; + count = traceTable[traceIndex].sweepCount; + } else if(showTotal) { + size = traceTable[traceIndex].totalSize; + count = traceTable[traceIndex].totalCount; + } + GCDebugMsg(false, "\t %3.1f%% - %d kb - %d items - ", PERCENT(tg->size, size), size>>10, count); + PrintStackTraceByIndex(traceIndex); + } + } + } + + GCHashtableIterator iter2(&typeTable); + while(iter2.nextKey() != NULL) + delete (TypeGroup*)iter2.value(); + } + + size_t DebugSize() + { + return 4 * sizeof(int); + } + + /* + * allocate the memory such that we can detect underwrites, overwrites and remember + * the allocation stack in case of a leak. Memory is laid out like so: + * + * first four bytes == size / 4 + * second four bytes == stack trace index + * size data bytes + * last 4 bytes == 0xdeadbeef + * + * Its important that the stack trace index is not stored in the first 4 bytes, + * it enables the leak detection to work see ~FixedAlloc. Underwrite detection isn't + * perfect, an assert will be fired if the stack table index is invalid (greater than + * the table size or to an unused table entry) or it the size gets mangled and the + * end tag isn't at mem+size. + */ + void *DebugDecorate(void *item, size_t size, int skip) + { + if (!item) return NULL; + + static void *lastItem = 0; + static int lastTrace = 0; + +#ifndef _MAC + if(lastItem) + { + // this guy might be deleted so swallow access violations + try { + traceTable[lastTrace].vtable = *(int*)lastItem; + } catch(...) {} + lastItem = 0; + } +#endif + + int traceIndex; + + // get index into trace table + { +#ifdef GCHEAP_LOCK + GCEnterCriticalSection lock(m_traceTableLock); +#endif + traceIndex = GetStackTraceIndex(skip); + } + + if(GC::enableMemoryProfiling && memtype) + { + // if an allocation is tagged with MMGC_MEM_TYPE its a sub + // allocation of a "master" type and this flag prevents it + // from contributing to the count so averages make more sense + traceTable[traceIndex].lumped = true; + } + + // subtract decoration space + size -= DebugSize(); + + ChangeSize(traceIndex, size); + + int *mem = (int*)item; + // set up the memory + *mem++ = size; + *mem++ = traceIndex; + void *ret = mem; + mem += (size>>2); + *mem++ = 0xdeadbeef; + *mem = 0; + + // save these off so we can save the vtable (which is assigned after memory is + // allocated) + if(GC::enableMemoryProfiling) + { + if(memtag || memtype) { + if(memtag) + traceTable[traceIndex].memtag = memtag; + else + traceTable[traceIndex].vtable = *(int*)(void*)memtype; + memtag = NULL; + memtype = NULL; + } else { + lastTrace = traceIndex; + lastItem = ret; + } + } + + return ret; + } + + void DebugFreeHelper(void *item, int poison, int skip) + { + int *ip = (int*) item; + int size = *ip; + int traceIndex = *(ip+1); + int *endMarker = ip + 2 + (size>>2); + + // clean up + *ip = 0; + ip += 2; + + // this can be called twice on some memory in inc gc + if(size == 0) + return; + + if (*endMarker != 0xdeadbeef) + { + // if you get here, you have a buffer overrun. The stack trace about to + // be printed tells you where the block was allocated from. To find the + // overrun, put a memory breakpoint on the location endMarker is pointing to. + GCDebugMsg("Memory overwrite detected\n", false); + PrintStackTraceByIndex(traceIndex); + GCAssert(false); + } + + { +#ifdef GCHEAP_LOCK + GCEnterCriticalSection lock(m_traceTableLock); +#endif + ChangeSize(traceIndex, -1 * size); + if(poison == 0xba) { + traceTable[traceIndex].sweepSize += size; + traceTable[traceIndex].sweepCount++; + } + traceIndex = GetStackTraceIndex(skip); + } + + // whack the entire thing except the first 8 bytes, + // the free list + if(poison == 0xca || poison == 0xba) + size = GC::Size(ip); + else + size = FixedMalloc::GetInstance()->Size(ip); + + // size is the non-Debug size, so add 4 to get last 4 bytes, don't + // touch write back pointer space + memset(ip, poison, size+4); + // write stack index to ip (currently 3rd 4 bytes of item) + *ip = traceIndex; + } + + void *DebugFree(void *item, int poison, int skip) + { + item = (int*) item - 2; + DebugFreeHelper(item, poison, skip); + return item; + } + + void *DebugFreeReverse(void *item, int poison, int skip) + { + DebugFreeHelper(item, poison, skip); + item = (int*) item + 2; + return item; + } + + void ChangeSize(int traceIndex, int delta) + { +#ifdef GCHEAP_LOCK + GCEnterCriticalSection lock(m_traceTableLock); +#endif + if(!enableTraces) + return; + traceTable[traceIndex].size += delta; + traceTable[traceIndex].count += (delta > 0) ? 1 : -1; + GCAssert(traceTable[traceIndex].size >= 0); + if(delta > 0) { + traceTable[traceIndex].totalSize += delta; + traceTable[traceIndex].totalCount++; + } + } + + unsigned int GetStackTraceIndex(int skip) + { + if(!enableTraces) + return 0; + int trace[kMaxTraceDepth]; // an array of pcs + GetStackTrace(trace, kMaxTraceDepth, skip); + + // get index into trace table + return LookupTrace(trace); + } + + void DumpStackTraceHelper(int *trace) + { + if(!enableTraces) + return; + + char out[2048]; + char *tp = out; + for(int i=0; trace[i] != 0; i++) { + char buff[256]; + GetInfoFromPC(trace[i], buff, 256); + strcpy(tp, buff); + tp += strlen(buff); + *tp++ = ' '; + } + *tp++ = '\n'; + *tp = '\0'; + + GCDebugMsg(out, false); + } + + void DumpStackTrace() + { + if(!enableTraces) + return; + int trace[kMaxTraceDepth]; + GetStackTrace(trace, kMaxTraceDepth, 1); + DumpStackTraceHelper(trace); + } + + void PrintStackTrace(const void *item) + { + if (item) + PrintStackTraceByIndex(*((int*)item - 1)); + } + + void PrintStackTraceByIndex(unsigned int i) + { +#ifdef GCHEAP_LOCK + GCEnterCriticalSection lock(m_traceTableLock); +#endif + if(i < kNumTraces) + DumpStackTraceHelper(traceTable[i].ips); + } + + void ChangeSizeForObject(void *object, int size) + { + int traceIndex = *(((int*)object)-1); + ChangeSize(traceIndex, size); + } + + void SetMemTag(const char *s) + { + if(memtag == NULL) + memtag = s; + } + void SetMemType(void *s) + { + if(memtype == NULL) + memtype = s; + } +} +#endif diff --git a/mozilla/js/tamarin/MMgc/GCMemoryProfiler.h b/mozilla/js/tamarin/MMgc/GCMemoryProfiler.h new file mode 100644 index 00000000000..4dcd112eabd --- /dev/null +++ b/mozilla/js/tamarin/MMgc/GCMemoryProfiler.h @@ -0,0 +1,215 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __GCMemoryProfiler__ +#define __GCMemoryProfiler__ + + +#ifndef MEMORY_INFO + +#define MMGC_MEM_TAG(_x) +#define MMGC_MEM_TYPE(_x) +#define GetRealPointer(_x) _x +#define GetUserPointer(_x) _x +#define DebugSize() 0 +#else + +#define MMGC_MEM_TAG(_x) MMgc::SetMemTag(_x) +#define MMGC_MEM_TYPE(_x) MMgc::SetMemType(_x) + +namespace MMgc +{ +#ifdef WIN32 + /** + * GCCriticalSection is a simple Critical Section class used by GCMemoryProfiler to + * ensure mutually exclusive access. GCSpinLock doesn't suffice since its not + * re-entrant and we need that + */ + class GCCriticalSection + { + public: + GCCriticalSection() + { + InitializeCriticalSection(&cs); + } + + inline void Acquire() + { + EnterCriticalSection(&cs); + } + + inline void Release() + { + LeaveCriticalSection(&cs); + } + + private: + CRITICAL_SECTION cs; + }; + + template + class GCThreadLocal + { + public: + GCThreadLocal() + { + GCAssert(sizeof(T) == sizeof(LPVOID)); + tlsId = TlsAlloc(); + } + T operator=(T tNew) + { + TlsSetValue(tlsId, (LPVOID) tNew); + return tNew; + } + operator T() const + { + return (T) TlsGetValue(tlsId); + } + private: + DWORD tlsId; + }; +#else + + // FIXME: implement + template + class GCThreadLocal + { + public: + GCThreadLocal() + { + } + T operator=(T tNew) + { + tlsId = tNew; + return tNew; + } + operator T() const + { + return tlsId; + } + private: + T tlsId; + }; + + class GCCriticalSection + { + public: + GCCriticalSection() + { + } + + inline void Acquire() + { + } + + inline void Release() + { + } + }; +#endif + + class GCEnterCriticalSection + { + public: + GCEnterCriticalSection(GCCriticalSection& cs) : m_cs(cs) + { + m_cs.Acquire(); + } + ~GCEnterCriticalSection() + { + m_cs.Release(); + } + + private: + GCCriticalSection& m_cs; + }; + + void SetMemTag(const char *memtag); + void SetMemType(void *memtype); + + /** + * calculate a stack trace skipping skip frames and return index into + * trace table of stored trace + */ + unsigned int GetStackTraceIndex(int skip); + unsigned int LookupTrace(int *trace); + void ChangeSize(int traceIndex, int delta); + void DumpFatties(); + + /** + * Manually set me, for special memory not new/deleted, like the code memory region + */ + void ChangeSizeForObject(void *object, int size); + + /** + * How much extra size does DebugDecorate need? + */ + size_t DebugSize(); + + /** + * decorate memory with debug information, return pointer to memory to return to caller + */ + void *DebugDecorate(void *item, size_t size, int skip); + + /** + * Given a pointer to user memory do debug checks and return pointer to real memory + */ + void *DebugFree(void *item, int poison, int skip); + + /** + * Given a pointer to real memory do debug checks and return pointer to user memory + */ + void *DebugFreeReverse(void *item, int poison, int skip); + + /** + * Given a user pointer back up to real beginning + */ + inline void *GetRealPointer(const void *item) { return (void*)((intptr) item - 2 * sizeof(int)); } + + /** + * Given a user pointer back up to real beginning + */ + inline void *GetUserPointer(const void *item) { return (void*)((intptr) item + 2 * sizeof(int)); } + + const char* GetTypeName(int index, void *obj); + + void GetInfoFromPC(int pc, char *buff, int buffSize); + void GetStackTrace(int *trace, int len, int skip); + // print stack trace of index into trace table + void PrintStackTraceByIndex(unsigned int index); + void PrintStackTrace(const void *item); + // print stack trace of caller + void DumpStackTrace(); +} + +#endif //MEMORY_INFO +#endif //!__GCMemoryProfiler__ + diff --git a/mozilla/js/tamarin/MMgc/GCObject.cpp b/mozilla/js/tamarin/MMgc/GCObject.cpp new file mode 100644 index 00000000000..1bcd26db483 --- /dev/null +++ b/mozilla/js/tamarin/MMgc/GCObject.cpp @@ -0,0 +1,78 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "MMgc.h" + +namespace MMgc +{ + GCWeakRef* GCObject::GetWeakRef() const + { + return GC::GetWeakRef(this); + } + + GCWeakRef* GCFinalizedObject::GetWeakRef() const + { + return GC::GetWeakRef(this); + } + + void* GCFinalizedObject::operator new(size_t size, GC *gc, size_t extra) + { + return gc->Alloc(size + extra, GC::kFinalize|GC::kContainsPointers|GC::kZero, 4); + } + + void GCFinalizedObject::operator delete (void *gcObject) + { + GC::GetGC(gcObject)->Free(gcObject); + } + + void* GCFinalizedObjectOptIn::operator new(size_t size, GC *gc, size_t extra) + { + return gc->Alloc(size + extra, GC::kContainsPointers|GC::kZero, 4); + } + + void GCFinalizedObjectOptIn::operator delete (void *gcObject) + { + GC::GetGC(gcObject)->Free(gcObject); + } + +#if defined(MMGC_DRC) && defined(_DEBUG) + void RCObject::DumpHistory() + { + GCDebugMsg(false, "Ref count modification history for object 0x%x:\n", this); + int *traces = history.GetData(); + for(int i=0, n=history.Count(); iAlloc(size, flags, 4); +} + +namespace MMgc +{ + /** + * + */ + class GCCustomSizer + { + public: + virtual ~GCCustomSizer() {} // here since gcc complains otherwise + virtual size_t Size() = 0; + }; + + /** + * Baseclass for GC managed objects that aren't finalized + */ + class GCObject + { + public: + static void *operator new(size_t size, GC *gc, size_t extra = 0) +#ifdef __GNUC__ + // add this to avoid GCC warning: 'operator new' must not return NULL unless it is declared 'throw()' (or -fcheck-new is in effect) + throw() +#endif + { + // TODO throw exception and shutdown player? + if (size + extra < size) + { + GCAssert(0); + return 0; + } + return gc->Alloc(size + extra, GC::kContainsPointers|GC::kZero, 4); + } + + static void operator delete (void *gcObject) + { + GC::GetGC(gcObject)->Free(gcObject); + } + + GCWeakRef *GetWeakRef() const; +#ifdef MEMORY_INFO + // give everyone a vtable for rtti type info purposes + virtual ~GCObject() {} +#endif + }; + + /** + * Baseclass for GC managed objects that are finalized + */ + class GCFinalizedObject + //: public GCObject can't do this, get weird compile errors in AVM plus, I think it has to do with + // the most base class (GCObject) not having any virtual methods) + { + public: + virtual ~GCFinalizedObject() {} + GCWeakRef *GetWeakRef() const; + static void *operator new(size_t size, GC *gc, size_t extra = 0); + static void operator delete (void *gcObject); + }; + + /** + * Baseclass for GC managed objects that are finalized + */ + class GCFinalizedObjectOptIn : public GCFinalizedObject + //: public GCObject can't do this, get weird compile errors in AVM plus, I think it has to do with + // the most base class (GCObject) not having any virtual methods) + { + public: + static void *operator new(size_t size, GC *gc, size_t extra = 0); + static void operator delete (void *gcObject); + }; + +#ifdef MMGC_DRC + class RCObject : public GCFinalizedObject + { + friend class GC; + public: + RCObject() +#ifdef _DEBUG + : history(0) +#endif + { + // composite == 0 is special, it means a deleted object in Release builds + // b/c RCObjects have a vtable we know composite isn't the first 4 byte and thus + // won't be trampled by the freelist + composite = 1; + GC::GetGC(this)->AddToZCT(this); + } + + ~RCObject() + { + // for explicit deletion + if (InZCT()) + GC::GetGC(this)->RemoveFromZCT(this); + composite = 0; + } + + bool IsPinned() + { + return (composite & STACK_PIN) != 0; + } + + void Pin() + { +#ifdef _DEBUG + // this is a deleted object but 0xca indicates the InZCT flag so we + // might erroneously get here for a deleted RCObject + if(composite == 0xcacacaca || composite == 0xbabababa) + return; +#endif + + // In Release builds, a deleted object is indicated by + // composite == 0. We must not set the STACK_PIN bit + // on a deleted object, because if we do, it transforms + // from a deleted object into a zero-ref count live object, + // causing nasty crashes down the line. + if (composite == 0) + return; + + composite |= STACK_PIN; + } + + void Unpin() + { + composite &= ~STACK_PIN; + } + + int InZCT() const { return composite & ZCTFLAG; } + int RefCount() const { return (composite & RCBITS) - 1; } + int Sticky() const { return composite & STICKYFLAG; } + void Stick() { composite = STICKYFLAG; } + + // called by EnqueZCT + void ClearZCTFlag() + { + composite &= ~(ZCTFLAG|ZCT_INDEX); + } + + void IncrementRef() + { + if(Sticky() || composite == 0) + return; + +#ifdef _DEBUG + GC* gc = GC::GetGC(this); + GCAssert(gc->IsRCObject(this)); + GCAssert(this == gc->FindBeginning(this)); + // don't touch swept objects + if(composite == 0xcacacaca || composite == 0xbabababa) + return; +#endif + + composite++; + if((composite&RCBITS) == RCBITS) { + composite |= STICKYFLAG; + } else if(InZCT()) { + GCAssert(RefCount() == 1); + GC::GetGC(this)->RemoveFromZCT(this); + } +#ifdef _DEBUG + if(gc->keepDRCHistory) + history.Push(GetStackTraceIndex(2)); +#endif + } + + __forceinline void DecrementRef() + { + if(Sticky() || composite == 0) + return; +#ifdef _DEBUG + GC* gc = GC::GetGC(this); + GCAssert(gc->IsRCObject(this)); + GCAssert(this == gc->FindBeginning(this)); + // don't touch swept objects + if(composite == 0xcacacaca || composite == 0xbabababa) + return; + + if(gc->Destroying()) + return; + + if(RefCount() == 0) { + DumpHistory(); + GCAssert(false); + } +#endif + + if (RefCount() == 0) + { + // This is a defensive measure. If DecrementRef is + // ever called on a zero ref-count object, composite-- + // will cause an underflow, flipping all kinds of bits + // in bad ways and resulting in a crash later. Often, + // such a DecrementRef bug would be caught by the + // _DEBUG asserts above, but sometimes we have + // release-only crashers like this. Better to fail + // gracefully at the point of failure, rather than + // push the failure to some later point. + return; + } + + composite--; + +#ifdef _DEBUG + // the delete flag works around the fact that DecrementRef + // may be called after ~RCObject since all dtors are called + // in one pass. For example a FunctionScriptObject may be + // the sole reference to a ScopeChain and dec its ref in + // ~FunctionScriptObject during a sweep, but since ScopeChain's + // are smaller the ScopeChain was already finalized, thus the + // push crashes b/c the history object has been destructed. + if(gc->keepDRCHistory) + history.Push(GetStackTraceIndex(1)); +#endif + // composite == 1 is the same as (rc == 1 && !notSticky && !notInZCT) + if(RefCount() == 0) { + GC::GetGC(this)->AddToZCT(this); + } + } +#ifdef _DEBUG + void DumpHistory(); +#endif + + void setZCTIndex(int index) + { + GCAssert(index >= 0 && index < (ZCT_INDEX>>8)); + GCAssert(index < ZCT_INDEX>>8); + composite = (composite&~ZCT_INDEX) | ((index<<8)|ZCTFLAG); + } + + int getZCTIndex() const + { + return (composite & ZCT_INDEX) >> 8; + } + + static void *operator new(size_t size, GC *gc, size_t extra = 0) + { + return gc->Alloc(size + extra, GC::kContainsPointers|GC::kZero|GC::kRCObject|GC::kFinalize, 4); + } + + private: + // 1 bit for inZCT flag (0x80000000) + // 1 bit for sticky flag (0x40000000) + // 20 bits for ZCT index + // 8 bits for RC count (0x000000FF) + static const int ZCTFLAG = 0x80000000; + static const int STICKYFLAG = 0x40000000; + static const int STACK_PIN = 0x20000000; + static const int RCBITS = 0x000000FF; + static const int ZCT_INDEX = 0x0FFFFF00; +#ifdef MMGC_DRC + int32 composite; +#ifdef _DEBUG + // addref/decref stack traces + GCStack history; + int padto32bytes; +#endif +#endif + }; + + class RCFinalizedObject : public RCObject{}; + + template + class ZeroPtr + { + public: + ZeroPtr() { t = NULL; } + ZeroPtr(T t) : t(t) { } + ~ZeroPtr() + { + t = NULL; + } + + operator T() { return t; } + bool operator!=(T other) { return other != t; } + T operator->() const { return t; } + private: + T t; + }; + + template + class RCPtr + { + public: + RCPtr() { t = NULL; } + RCPtr(T t) : t(t) { if(t && (int)t != 1) t->IncrementRef(); } + ~RCPtr() + { + if(t && t != (T)1) + t->DecrementRef(); + + // 02may06 grandma : I want to enable + // class DataIOBase { DRC(PlayerToplevel *) const m_toplevel; } + // + // DataIOBase is a virtual base class, so we don't know if the + // subclass is GCObject or not. We need it to be const, or + // a GCObject would require a DWB(), and if it's const, we + // cannot zero it out during ~DataIOBase. The simplest solution + // seemed to be zeroing out the member here. + + t = NULL; + } + + T operator=(T tNew) + { + if(t && (int)t != 1) + t->DecrementRef(); + t = tNew; + if(t && (int)t != 1) + t->IncrementRef(); + // this cast is safe b/c other wise compilation would fail + return (T) t; + } + + operator T() const + { + return (T) t; + } + + operator ZeroPtr() const { return t; } + + bool operator!=(T other) { return other != t; } + + T operator->() const + { + return (T) t; + } + + void Clear() { t = NULL; } + + private: + T t; + }; + + +#define DRC(_type) MMgc::RCPtr<_type> + +#else // !MMGC_DRC + +#define DRC(_type) _type + +class RCObject : public GCObject {}; +class RCFinalizedObject : public GCFinalizedObject {}; + +#endif +} + + +#endif /* __GCObject__ */ diff --git a/mozilla/js/tamarin/MMgc/GCSpinLockLinux.h b/mozilla/js/tamarin/MMgc/GCSpinLockLinux.h new file mode 100644 index 00000000000..ddb410e3d3e --- /dev/null +++ b/mozilla/js/tamarin/MMgc/GCSpinLockLinux.h @@ -0,0 +1,100 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __GCSpinLock__ +#define __GCSpinLock__ + +#include + +namespace MMgc +{ + /** + * GCSpinLock is a simple spin lock class used by GCHeap to + * ensure mutually exclusive access. The GCHeap may be accessed + * by multiple threads, so this is necessary to ensure that + * the threads do not step on each other. + */ + class GCSpinLock + { + public: + GCSpinLock() + { + pthread_spin_init( &m1, 0 ); + } + + ~GCSpinLock() + { + pthread_spin_destroy( &m1 ); + } + + inline void Acquire() + { + pthread_spin_lock( &m1 ); + } + + inline void Release() + { + pthread_spin_unlock( &m1 ); + } + + private: + pthread_spinlock_t m1; + }; + + /** + * GCAcquireSpinlock is a convenience class which acquires + * the specified spinlock at construct time, then releases + * the spinlock at desruct time. The single statement + * + * GCAcquireSpinlock acquire(spinlock); + * + * ... will acquire the spinlock at the top of the function + * and release it at the end. This makes for less error-prone + * code than explicit acquire/release. + */ + class GCAcquireSpinlock + { + public: + GCAcquireSpinlock(GCSpinLock& spinlock) : m_spinlock(spinlock) + { + m_spinlock.Acquire(); + } + ~GCAcquireSpinlock() + { + m_spinlock.Release(); + } + + private: + GCSpinLock& m_spinlock; + }; +} + +#endif /* __GCSpinLock__ */ diff --git a/mozilla/js/tamarin/MMgc/GCSpinLockMac.h b/mozilla/js/tamarin/MMgc/GCSpinLockMac.h new file mode 100644 index 00000000000..bb9bbd11d1f --- /dev/null +++ b/mozilla/js/tamarin/MMgc/GCSpinLockMac.h @@ -0,0 +1,135 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __GCSpinLock__ +#define __GCSpinLock__ + +#ifdef __GNUC__ +#include +#else // __GNUC__ +#include +#endif // __GNUC__ + +#if TARGET_RT_MAC_MACHO +extern "C" +{ +extern void _spin_lock(uint32_t *); +extern void _spin_unlock(uint32_t *); +} +#endif + +namespace MMgc +{ + /** + * GCSpinLock is a simple spin lock class used by GCHeap to + * ensure mutually exclusive access. The GCHeap may be accessed + * by multiple threads, so this is necessary to ensure that + * the threads do not step on each other. + */ + class GCSpinLock + { + public: + GCSpinLock() + { +#if TARGET_RT_MAC_MACHO + m1 = 0; +#else + OSStatus critErr = ::MPCreateCriticalRegion( &mCriticalRegion ); + GCAssert( critErr == noErr ); +#endif + } + + ~GCSpinLock() + { +#if !TARGET_RT_MAC_MACHO + OSStatus critErr = ::MPDeleteCriticalRegion( mCriticalRegion ); + GCAssert( critErr == noErr ); +#endif + } + + inline void Acquire() + { +#if TARGET_RT_MAC_MACHO + _spin_lock(&m1); +#else + OSStatus critErr = ::MPEnterCriticalRegion( mCriticalRegion, kDurationForever ); + GCAssert( critErr == noErr ); +#endif + } + + inline void Release() + { +#if TARGET_RT_MAC_MACHO + _spin_unlock(&m1); +#else + OSStatus critErr = ::MPExitCriticalRegion( mCriticalRegion ); + GCAssert( critErr == noErr ); +#endif + } + + private: + +#if TARGET_RT_MAC_MACHO + uint32_t m1; +#else + MPCriticalRegionID mCriticalRegion; +#endif + }; + + /** + * GCAcquireSpinlock is a convenience class which acquires + * the specified spinlock at construct time, then releases + * the spinlock at desruct time. The single statement + * + * GCAcquireSpinlock acquire(spinlock); + * + * ... will acquire the spinlock at the top of the function + * and release it at the end. This makes for less error-prone + * code than explicit acquire/release. + */ + class GCAcquireSpinlock + { + public: + GCAcquireSpinlock(GCSpinLock& spinlock) : m_spinlock(spinlock) + { + m_spinlock.Acquire(); + } + ~GCAcquireSpinlock() + { + m_spinlock.Release(); + } + + private: + GCSpinLock& m_spinlock; + }; +} + +#endif /* __GCSpinLock__ */ diff --git a/mozilla/js/tamarin/MMgc/GCSpinLockWin.h b/mozilla/js/tamarin/MMgc/GCSpinLockWin.h new file mode 100644 index 00000000000..f0ee667f619 --- /dev/null +++ b/mozilla/js/tamarin/MMgc/GCSpinLockWin.h @@ -0,0 +1,98 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __GCSpinLock__ +#define __GCSpinLock__ + +#include + +namespace MMgc +{ + /** + * GCSpinLock is a simple spin lock class used by GCHeap to + * ensure mutually exclusive access. The GCHeap may be accessed + * by multiple threads, so this is necessary to ensure that + * the threads do not step on each other. + */ + class GCSpinLock + { + public: + GCSpinLock() + { + sl = 0; + } + + inline void Acquire() + { + GCAssert(sl==0 || sl==1 || sl==0); // Poor mans defense against thread timing issues, per Tom R. + while (InterlockedCompareExchange(&sl, 1, 0) != 0) { + Sleep(0); + } + } + + inline void Release() + { + InterlockedExchange(&sl, 0); + } + + private: + long sl; + }; + + /** + * GCAcquireSpinlock is a convenience class which acquires + * the specified spinlock at construct time, then releases + * the spinlock at desruct time. The single statement + * + * GCAcquireSpinlock acquire(spinlock); + * + * ... will acquire the spinlock at the top of the function + * and release it at the end. This makes for less error-prone + * code than explicit acquire/release. + */ + class GCAcquireSpinlock + { + public: + GCAcquireSpinlock(GCSpinLock& spinlock) : m_spinlock(spinlock) + { + m_spinlock.Acquire(); + } + ~GCAcquireSpinlock() + { + m_spinlock.Release(); + } + + private: + GCSpinLock& m_spinlock; + }; +} + +#endif /* __GCSpinLock__ */ diff --git a/mozilla/js/tamarin/MMgc/GCStack.h b/mozilla/js/tamarin/MMgc/GCStack.h new file mode 100644 index 00000000000..8a7beae4ba2 --- /dev/null +++ b/mozilla/js/tamarin/MMgc/GCStack.h @@ -0,0 +1,122 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __GCStack__ +#define __GCStack__ + +namespace MMgc +{ + template + class GCStack + { + enum { kDefSize = defSize }; + public: + GCStack(int defaultSize=kDefSize) : m_iCount(0), m_iAllocSize(defaultSize), m_items(NULL) + { + Alloc(); + } + + ~GCStack() + { + if ( m_items ) + { + delete [] m_items; + m_items = NULL; + } + m_iCount = m_iAllocSize = 0; + } + + void Push(T item) + { + if ( ( m_iCount + 1 ) > m_iAllocSize ) + { + // need to allocate a new block first + m_iAllocSize = m_iAllocSize ? m_iAllocSize*2 : kDefSize; + Alloc(); + } + + m_items[m_iCount++] = item; + } + + T Pop() + { + T t = m_items[--m_iCount]; +#ifdef _DEBUG + GCAssert(m_iCount>=0); + memset(&m_items[m_iCount], 0, sizeof(T)); +#endif + return t; + } + + T Peek() + { +#ifdef _DEBUG + GCAssert(m_iCount>=0); +#endif + T t = m_items[m_iCount-1]; + return t; + } + + unsigned int Count() { return m_iCount; } + + void Keep(unsigned int num) + { + GCAssert(num <= m_iCount); + m_iCount = num; + } + + T* GetData() { return m_items; } + + protected: + // no impl + GCStack(const GCStack& other); + GCStack& operator=(const GCStack& other); + + private: + void Alloc() + { + // need to allocate a new block first + if(m_iAllocSize) { + T* items = new T[ m_iAllocSize ]; + if ( items ) + { + ::memcpy(items, m_items, m_iCount * sizeof(T)); + } + delete [] m_items; + m_items = items; + } + } + unsigned int m_iCount, m_iAllocSize; + T *m_items; + }; +} + +#endif /* __GCStack__ */ diff --git a/mozilla/js/tamarin/MMgc/GCTests.cpp b/mozilla/js/tamarin/MMgc/GCTests.cpp new file mode 100644 index 00000000000..d1912906095 --- /dev/null +++ b/mozilla/js/tamarin/MMgc/GCTests.cpp @@ -0,0 +1,154 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "MMgc.h" + +#ifdef _MSC_VER +// "behavior change: an object of POD type constructed with an initializer of the form () will be default-initialized" +#pragma warning(disable:4345) // b/c GCObject doesn't have a ctor +#ifdef _DEBUG +// we turn on exceptions in DEBUG builds +#pragma warning(disable:4291) // no matching operator delete found; memory will not be freed if initialization throws an exception +#endif +#endif + +#ifdef _DEBUG + +namespace MMgc +{ + GC *gc; + + GCWeakRef* createWeakRef(int extra=0) + { + return (new (gc, extra) GCObject())->GetWeakRef(); + } + + void weakRefSweepSmall() + { + GCWeakRef *ref = createWeakRef(); + gc->Collect(); + gc->CleanStack(true); + gc->Collect(); + (void)ref; + GCAssert(ref->get() == NULL); + } + + void weakRefSweepLarge() + { + GCWeakRef *ref = createWeakRef(5000); + gc->Collect(); + gc->CleanStack(true); + gc->Collect(); + (void)ref; + GCAssert(ref->get() == NULL); + } + + void weakRefFreeSmall() + { + GCWeakRef *ref = createWeakRef(); + delete ref->get(); + GCAssert(ref->get() == NULL); + } + + void weakRefFreeLarge() + { + GCWeakRef *ref = createWeakRef(5000); + delete ref->get(); + GCAssert(ref->get() == NULL); + } + + class RCObjectAddRefInDtor : public RCObject + { + public: + RCObjectAddRefInDtor(RCObject **stackPinners, int length) : rcs(stackPinners), length(length) {} + ~RCObjectAddRefInDtor() + { + // whack these, used create freelist + for(int i=0, n=length; iGetWeakRef(); + } + + /* see bug 182420 */ + void drcApolloTest() + { + // prime ZCT with some pinners + RCObject *stackPinners[3]; + + GCWeakRef *wr = createProblem(stackPinners); + + stackPinners[0] = new (gc) RCObject(); + stackPinners[1] = new (gc) RCObject(); + stackPinners[2] = new (gc) RCObject(); + + // force ZCT + for(int i=0, n=1000;iget()) + delete wr->get(); + } + + void RunGCTests(GC *g) + { + gc = g; + weakRefSweepSmall(); + weakRefSweepLarge(); + weakRefFreeSmall(); + weakRefFreeLarge(); + drcApolloTest(); + } +} + +#endif // _DEBUG diff --git a/mozilla/js/tamarin/MMgc/GCTests.h b/mozilla/js/tamarin/MMgc/GCTests.h new file mode 100644 index 00000000000..d60ad43c407 --- /dev/null +++ b/mozilla/js/tamarin/MMgc/GCTests.h @@ -0,0 +1,41 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __GCTests__ +#define __GCTests__ + + +namespace MMgc +{ + void RunGCTests(GC *gc); +} + +#endif /* __GCTests__ */ diff --git a/mozilla/js/tamarin/MMgc/GCTypes.h b/mozilla/js/tamarin/MMgc/GCTypes.h new file mode 100644 index 00000000000..20e9cbdc7cd --- /dev/null +++ b/mozilla/js/tamarin/MMgc/GCTypes.h @@ -0,0 +1,95 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 1993-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#ifndef __GCTypes__ +#define __GCTypes__ + +#ifdef _MAC +#include +#endif + +namespace MMgc +{ + #ifdef _MSC_VER + typedef __int64 int64; + typedef __int64 sint64; + typedef unsigned __int64 uint64; + #elif defined(_MAC) + typedef int64_t int64; + typedef int64_t sint64; + typedef uint64_t uint64; + #else + typedef long long int64; + typedef long long sint64; + typedef unsigned long long uint64; + #endif + + typedef unsigned long uint32; + typedef signed long int32; + + typedef unsigned short uint16; + typedef signed short int16; + + typedef unsigned char uint8; + typedef signed char int8; + + // math friendly pointer (64 bits in LP 64 systems) + typedef unsigned long intptr; + + /* wchar is our version of wchar_t, since wchar_t is different sizes + on different platforms, but we want to use UTF-16 uniformly. */ + typedef unsigned short wchar; + + /** + * Conservative collector unit of work + */ + class GCWorkItem + { + public: + GCWorkItem() : ptr(0), _size(0) {} + GCWorkItem(const void *p, uint32 s, bool isGCItem) : ptr(p), _size(s | uint32(isGCItem)) {} + uint32 GetSize() const { return _size & ~1; } + int IsGCItem() const { return _size & 1; } + const void *ptr; + uint32 _size; + }; + + + typedef void* (*GCMallocFuncPtr)(size_t size); + typedef void (*GCFreeFuncPtr)(void* mem); + + #ifndef NULL + #define NULL 0 + #endif +} + +#endif /* __GCTypes__ */ diff --git a/mozilla/js/tamarin/MMgc/GCWeakRef.h b/mozilla/js/tamarin/MMgc/GCWeakRef.h new file mode 100644 index 00000000000..84d256e3fed --- /dev/null +++ b/mozilla/js/tamarin/MMgc/GCWeakRef.h @@ -0,0 +1,111 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 1993-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +// +// GCWeakRef.h +// GC weak references (aka safe handles) as template classes +// + +#ifndef _GC_WEAK_REF_H_ +#define _GC_WEAK_REF_H_ + +namespace MMgc +{ + // new improved weak ref + class GCWeakRef : public GCFinalizedObject + { + friend class GC; + public: + GCObject *get() { return (GCObject*)m_obj; } + ~GCWeakRef() + { + if(m_obj) { + GC::GetGC(this)->ClearWeakRef(m_obj); + } + } + private: + // override new so we can be tell the GC we don't contain pointers + static void *operator new(size_t size, GC *gc) + { + return gc->Alloc(size, GC::kFinalize, 4); + } + // private, only GC can access + GCWeakRef(const void *obj) : m_obj(obj) + { +#ifdef _DEBUG + obj_creation = *((int*)GetRealPointer(obj)+1); +#endif + } + const void *m_obj; +#ifdef _DEBUG + int obj_creation; +#endif + }; + +#if 0 + // something like this would be nice + template class GCWeakRefPtr + { + + public: + GCWeakRefPtr() {} + GCWeakRefPtr(T t) { set(t);} + ~GCWeakRefPtr() { t = NULL; } + + T operator=(const GCWeakRefPtr& wb) + { + return set(wb.t); + } + + T operator=(T tNew) + { + return set(tNew); + } + + operator T() const { return (T) t->get(); } + + bool operator!=(T other) const { return other != t; } + + T operator->() const + { + return (T) t->get(); + } + private: + T set(const T tNew) + { + t = tNew->GetWeakRef(); + } + GCWeakRef* t; + }; +#endif +} + +#endif // _GC_WEAK_REF_H_ diff --git a/mozilla/js/tamarin/MMgc/MMgc.cpp b/mozilla/js/tamarin/MMgc/MMgc.cpp new file mode 100644 index 00000000000..7892087d0cf --- /dev/null +++ b/mozilla/js/tamarin/MMgc/MMgc.cpp @@ -0,0 +1,32 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#include "MMgc.h" diff --git a/mozilla/js/tamarin/MMgc/MMgc.h b/mozilla/js/tamarin/MMgc/MMgc.h new file mode 100644 index 00000000000..f6b8f15d6a1 --- /dev/null +++ b/mozilla/js/tamarin/MMgc/MMgc.h @@ -0,0 +1,125 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __MMgc__ +#define __MMgc__ + + +// For size_t +#include + +#ifdef WIN32 +#include "winbuild.h" +#endif + +#ifdef _MAC +#include "macbuild.h" +#endif + +#ifdef AVMPLUS_LINUX +#include "linuxbuild.h" +#endif + +#ifdef MMGC_ARM +#include "armbuild.h" +#endif + +#ifdef SCRIPT_DEBUGGER +#ifndef DEBUGGER +#define DEBUGGER +#endif +#endif + +#if defined(_DEBUG) || defined(_MAC) +// for memset +#include +#endif + +#ifndef _MSC_VER +#define __forceinline +#endif + +#include "GCDebug.h" +/* + * If _GCHeapLock is defined, a spin lock is used for thread safety + * on all public API's (Alloc, Free, ExpandHeap) + * + * Warning: + * We may use GCHeap for allocation on other threads, hence the + * spinlock, but the MMgc garbage collector in general is not + * thread-safe. + */ + +#ifdef GCHEAP_LOCK +#ifdef WIN32 +#include "GCSpinLockWin.h" +#endif +#ifdef _MAC +#include "GCSpinLockMac.h" +#endif +#ifdef AVMPLUS_LINUX +#include "GCSpinLockLinux.h" +#endif +#endif + +namespace MMgc +{ + class GC; + class GCTraceObject; + class RCObject; + class GCWeakRef; + class GCObject; + class GCHashtable; + class Cleaner; + class GCAlloc; +} + +#include "GCTypes.h" +#include "GCStack.h" +#include "GCAllocObject.h" +#include "GCHeap.h" +#include "GCAlloc.h" +#include "GCLargeAlloc.h" +#include "GCMemoryProfiler.h" +#include "FixedAlloc.h" +#include "FixedMalloc.h" +#include "GCHashtable.h" +#include "GC.h" +#include "GCObject.h" +#include "GCWeakRef.h" +#include "WriteBarrier.h" + +#if defined(MMGC_DRC) && !defined(WRITE_BARRIERS) +#error "Need write barriers for DRC" +#endif + +#endif /* __MMgc__ */ + diff --git a/mozilla/js/tamarin/MMgc/MMgc.mcp b/mozilla/js/tamarin/MMgc/MMgc.mcp new file mode 100644 index 0000000000000000000000000000000000000000..fde41b3e88267ec71503c16402ee8879b0536003 GIT binary patch literal 247825 zcmeF431C#k{m19+<^ll`5l~T9?#pm^A(shBxFjSJ5X6Hl$wC54HYPy>qD1ko2OhPy zURYae?V-KYS`R#`y{lIHw^duLy}Vjmt<|=e|K~UFx0_u^HVat}lQ+rt&G*flH^+B= zGw+_Qh(yB17{4*jNaO!zzVY8zZOnjsSkHER4x3z85UC6;4%XFGN9qElb&*w}iiYT> zF5>&2K&EZRoKs{>BXyQ_W3uPY*<#F*0W-i9&Mr5{5cEZ`)tK%D#`J))zP7$0vZgH5 z&`@2ovfenE&-=#92Al}&1L$uuKqkln*&qjW1Kq&^KoaW-dVvE$Z*UOk0}ci$xyX6$ zACYC>fMg7g0fT_74+cZPP%sP(2P42pFba$YW58ID3&w+qK)aG1%8o8O!!Zv3iQ&@dQI{btPlO$! zxRzlfkp~eZMtq$3G@@xG`V!mjLG#49Xz-yLCaJf$SY8DA*nMEjrX5&Zv1}FG%{lBu zf>syH2#(L8C4IZUrrFwFIn-C2B#@X!w8?0g1Lp?M2^NHd_4T3p+*QFkO)usxol_bp zUc9u_2DlaNX8T(##ty_`Yj@il?FL&j7Exbg=ZP;}5cr~{w1t$S%Eq?C-IhI`7`KRF z?qpPM$lfunT?cA+Q3R4$cBA!8zbuAg4H0fU`lf3akcUum;qC z2&e^TgEN7QyY)a$3)g}fpa2wtA}}4~gPC9!m<^_ZJTM0=1dG6_U@kZrNJl9K^FawH z1*d=opbUsLF9u7%X<#Yfz@KmiB`V0!9e*aps@1OtezG&FzHC1P^aK6D03gRq8EOs# zhXXk}9s!1eVPH5I0RmtM7zsv!(O?i5490-5;AoHw#sL{+CV+`R&Qy*C$ARO)31AX9 z3Y-WggDGGtcoIAXo(4YzkAkh>8SpIl5qJbV0UifG20sBm1s{TcgP(z)gI|DOg6F{V z;05p)_!W2&yaav?{ttWtnlUmo5Q*(U`eS@4_y6$G$ngWw{v&*;?{@HCIBn!)0km__ z&N&iX3ed+10P5*v1M2Tke6e(){u9q?W7J@5c{5Ih9F4;}{J20s9g zfJeb&;BoL<@Cw)po&ZmRrvUcoyb8Vseh8icUjknN&w?L;*T9bf_UQZ+{0#h@t~n7* z1}6gA-#-;h1Jl72KwJ80FaL4iB#;O4!3Pb?Yd>w^UkpwMrvci?kA3*D2S4`XUkR`uKlbCt ze*D;sADi)GGk)yAj~)2W0N8?m5m*AS2S2vp#}@q9f*%|3V*`F{z%Ol2Jss-lP)~*MMumW^f%q9|wILv~jKi=;B-t z(8fU<2W^~RgZ~3JfExi?IcVjemGd&7J)AEBbaT+zp}idH<)ESS8-P|0b#&0mK}!eS zd_BMu;9$@j90HyM{Xk#P6C4B%1pUDPa2UY;e20U9;0SOe7z6^~C~znk42FQAU>Fz< zMu3rE6c`Q0fU)3ckPG^Nao_;Z3ycR7z(jBiI2IfSjt3`zXTUGO&%sZ?bKrUK0{A6( z7W@?a82k#n2wnnc=|f8&y7|z?_gnA^con<`eg}RJeg?LIAA%o&*TEma8{m)NPvFns zFW|3eD*HTzPnbg-hcMsM_-_K@IHcvUpFdya)aP{t4a(AAonj zzrcs!-{2$gG58PoFZdtW4n6_Rq-THwm-4aVP#;Ii?gtql6J&vGkOR7b?qCI216F|u zs0B4(C0Grr!P%e=G=R0>9B?jZ1naVN$a1*#4+yU+cUj%o7FM%(E zyTMn$Jzxv?D!3PX4SXGZ1AG(Q2kr;o0^bJT0pA7R1D^*Efa}3$!Gqu-@O|(w_yKqX zJPIBICxSdM4a@)qARkNy)4^0w2#UZgFdNJPbHT}A9w-L$!AwvBO2H{$0Vo3t!6I-f zSPYhc)4)=2IyecO0VaVd;7o89SO&^L5G)53pc1?V{t5m8{suk({{kO^_rcrX@8DhV zZ}1WL82ktP7yJ)w2cLju#!~|v-~+7q-owwpe-pd|&jeW@8{~j)pgTAK^Z>U5+RjfK z`e{=??dPZM{Is2)_Vm-<{=2}PfVTA0mVVmOPh0wFOFwPtr!D=orJuI+)0TeP(oZ}3 zX+J;q;inD#w}CByw)E4Me%jJcTlyabkAcU*R5_|?+1+E6yfNQ~Ka2>#={5OCma3fd;HUR9*e-ro|xEXvNd;#17Zbe-5F=$}6 z05mXcGt|Z2B}ErQ{S5mU>S!cB^)qN`sJlT|gN6o84Rto?YS7i7qd`Z5js_hKIvR8| z=xET9yDG+@r9n%BP6j;;{hJz8HFBl1Wg5F>h7!AgNvEXQs3&w%*l<9Zi_l%2_#cTtwgWs^ucJnIu z19$`c5xh(|>6zESE8tJy&xBE4hkPCCe6;L*2|@@X5!S0RI5|3r=~QCiq|R zu@&KL;qgvxW7);ZslZTkv=A9_!D8iSU2mqo?^N zcpo$Y%4H-k(lzVB1ppf~lE)1;fB_FanGOqrhk|28;!{U_6)z_Gg`?&BX%52I5`&cR*ZJ` z@uS=2cox6E9NT0)n!X(4WIdX{9Pea(IN*H19{XgSW3gPD+v8xg{3aaYcqsjejftbc zxY2=neIOmEUQ-*XYY0^aR@6n-1R~+ez~F*$1!Kkp<^^k3t_`jX4Gz=>YeM0`=y5%J z4yj%dIBMClNNq!Pq-JDoU8o|mrnWj98pW2HityUXP+)Lzuwr&7SQ)CTF9_BxkJRK= z4GxguxxxCt;L^I#it5I|3U(PR2@VO>R93H$qt32Bce53fMQo@^98ugOSu9p7q#;<> z&`NNsLGH6jjosE$K-t{d(@iNWaF?+h6Q7=W&pJdHIcISlVs&j76Ch^tR*&9UOMksp zm3c1f?wRG>2=qC{U!RmYY}>Z1rR#cUp7Pjxgk_j1cg>bCE*4f~7S!Ysmec(4#=mOV z%FL3bTM6rC&VTJS4Xes53I3I^1DtuWu+_S6Pc!wIn>Aj2=Ip*BiPu}MWi+fIbGBTR zOzYFU{qZIZTc3SQ(?f*yH)E%5*07D5o}7=m<5la;%n8>nJ~5PZ618eQ<<@#=Vqe_# z@hOwmlA8-r7e6}na>wKNplGyKd^ZspEOu02eRb`Q@#T$&x%sE&6YiZZ?I=!{TQ4q~ zQ*_XrnubtaO{gJI)L0vi)P?GHO@=ukcemV7V`$g*^kR1o1!Mr?G&9k~4Q+`Vy3pFP zWz{v+4b{PL_4?iF8q1c|cjzQ^*)n?en(CTh!)|3SEyZCa?l6>auuNEKwN>NxOy$@V zmqseq!@HAu1oe(&anf~7>K)0tX1k}i*6vZv4n7GZP-c3w+0E1vE(^LZDxH(dEf#K= zw4R(>0l6&5a4#oXkCtMnk4rCk6wq-e;{hJz7cBp3xogE3$%$OYrUL|{M55I^qWikM03&V9REdVttmw*@67 z3*#d?vlc8W)c}8XS!8WpMW~+jgJ#Z|SHz8mLFxz8AFTcm^@plIO#R{Nk5GT4`lHkz zt^RoR$EZJ6{ap1Ys?XD-_=k7n7=*@~Z1AeybfF_aFK|1M zhqD&|c@aqZ6%R@63oeJ@_W*;z;XqzH7zT!bBf(H`5Euk1!P#IrklUseAP6`;u^)$g z9-q?{`;kaF{t|EsI1MZXc_1Hj1BZfB!FgZ?xCIn|@n8Wc1h<0QKoOV;`h!`Z3Piy5 zAOv#2Y%mv;fcfBLa1M~mg$IOH*I%UJQ+0i^KGj^RPp1m>S2C9zt@%`|KS$GFsQ!r(k0MUc`m~&h`m3kD_qN-&0w!zaBh|Ib zBf+}LLdOZ_@t#Dpzj|74woAVm&-U-yg85jJ-iebFD2WH{?XOAbMoTBHqdH+0|XAI1k+2dwlI0Kz7O6hTP@VHEmi+rXEb% zjF7^HwB995sFEB@k~{k~sYbEa>&oR^$a7s<0q@~Zmu~*_R6c85_qB89EHtlg-0UXk z@Ui7(@3|)@lh<;=yVm#mhArk-hh2QOTw@L7RpJBenU&8hUl_D!N|$m*HH5Rd>-9|Q z0X@@tQqQb@p=Vsbl?OYd@n=0l`=_3Ped3;ZIo%8EBDLf^IHRhiav9b3%xjs1WUR8+ zhIiSmP4+tWBjL_i`%<&L9N=@EkpcUWF5ySZb+UXQk83h{@NX;U8uEZ|TJE07Why61 zjCE0xAb@xM60-uUOX3l`)4YVbn^!LS0=R22ay*KO<&iF_KvhFS?c{OeRxv?YZvEPt zTt1Z;S6dgUTwBplKWTwftCyc9%RMd|P)>g|s-A?B6=asHVY8c3%&eSG_zi$9{qmIDXQ}rnq!*{OXKgI2?)81ZIcAwWfG+!2L4CMqC^y z4c1o#!*;g?q4lP;XlDGblXuMDzKuXa;mG1hUAQv0!W5Uy3l!v%T3}{y`T3TQW zmr!B?O`JHg8WTWQQ~+56`Sokel7f<%F%@ihizs#{sWCN!x70MYX5SND5v&MV5!|X; zF|=m!d%5+AhG>0a%`JJkwMhta1(%&<9yD2tOF0@;CJJkKtdK47D80mNB}Y5C+RnM! zV96`Lwl+T59aD&#p>0-hO-SZEmBMpE#ygf~W;oQy+@~RWFfS3*N9xRs>Uu0QA!u^q zoNrXrX5M<}4w2)s*Zl$s`VkFEq58>Msi+@d_sOkjo5CJDDm0_I#->zY zO~f{k7`5aOm{(o18eIzP^rnH6L+j3s)K%7-{0fnWzS&S!Z{(zy*Un>;pU&jFuRw9I zw$@ICI%91$Uz-&*Hq-^{O<`#H+LbFqbpdxD_lSvf!&U zGiO1dgs;)o@B(g~(GC&YOV?w&Nx7w6XN78{#{>$i>t*K1HOs@Yb4#U!GMw0;=zO4yURP!#(tdIAD&lr0 zmLy3<14w1!caVb33P+YR?6uU|eX%95ur9>gEioO{DvV5!8T*#cl!ofUT8GJQIcUh` zfdaP*#fz6=IJU9Ns=~_+ca&<^HU#7vr5sX z4Gp21gu3NQ!^-!IftCu@8mys~0bw1g)i)S7vB1I*$2IZ{Sn;EwEj6T{t}}L$(&~y> zHCzL_v zT&=D!v6hueV!5(AQowfDQrohrR=ab;*l8_up-f0!R>eV@8bDRxvW8#-(qS7`%Hrac z74CsmNR^pYuy9>1^S=r!V{DlhsaS1SN|wu1)t1hap$J2XxI4tHR?x?074XSwt&M1j z8)l==2-b(}hL*Lstu0$}-B25#+?vDUYEJ!Z7IxKcw~Y6abc19WU2{!nK`0y|-)Q~a zKoujpjXkQ4E>ZKaE8_#PZ3we$4H1@Axu(;Titw3c2UT9V(N_OPz8NT?pKV=k6O7@|K0Tvw);1al)Y6 zp?_xSzM;ZhujTS~#71yHWsyz)v+y334J_Shhk9D(PASw&`HT1mezMKJ?eQ+W_wrSh zc=lTUAam&R!sU)yAApmoD|y?-KJB(s-t>*w9b{TQ`&Nj=S-_$nz&UcqjyE~%ojG}% zW`Ma&%H~L^4z0Cilc_E3w4!)2wVu7BC;Uq+28KB)hszy1-f)@5Gg+B_(Hz;&^rn!` zv+zOgs~s{WqX{(Iw@sXP;775&Nu?jmI!>nAvv0cyXS*5t{pVQPsqM_L22s`c=CBy< zzwU~yaM66kn)(KwEy+}C@+OT;3nf#bnNeosntJ#a_-KHWsm9D0nQ9*X3;0;G<-BtE zHu%x_7bnv|+P9&Em$H}$aDFMzF_zjXs_Yw768GTvk{*HV-59=^N{gv{C=SY)ZmybS+T<+lsBeuna{B} z-BOeJdwkIsm-!DCXIg5q{PHqZ(w;%(Qt#!;rHv|-%bQWs*>PFd zu%Mrb%laYKz!Sycu_0>U!&n- zk2T7r9U{u5ytT?3@y}L%IewjTc|%NW3zvN#iv~+g_E!A0%3r{j_P}NTnT6C7m;E6N zNf(zRi*>SqAH-t4r6y+}{&~v99yTbKzH+{DvDpihOS^4UF1j`;7d6FdVO%%S;YLeMw^Q)N)^Xj+S==NHE^Yof zOHDV?@@C~yuFor%x_?3WxA0{h*X?N*w_0kt{U5%xJ+9l^EN-{defLYo5nT7)EVc-P z4`p$urKbBa_+rzZ+j|Q1AgjUPa3D4|3=9EB0%;rRbAv!7I2$Yn(#NF_1wj@#1c;4f zgMOeK$oMI?b{dermk07eHz4+VDmV|!0Afc4K*q%dpb&^Xi5(SznV>(I1*$*Xs7!cx9r#JjYOcx-YV@rJ`LYa?EKdLxK;c^mOGHLHu<*SeyOc=73t zBHop4#EVaFG%KHJBVK%ZV~BTE8}Z`P8_UYoZN!UDPwqQh+eWhb#26pPj4de z?o1(`y_dGX#;a@S$pi3U*l}is<%`Uo?h7LeBQ~`AEOX5>P24=}OI-ua%^$uj*H;ox zE-w79zp>R^^Q?U78QuO)R7iO&C-K-mp6#6HXY^+OkL3N4_&4|*Coo6iHP|=v+J1wN zc%>4r%{Ta@|7KP7cAT09i8nrPsqt4IwwW(gOQYpu`_OQxFxU{x%X6HPc@mH9wQ<`A zF5ne_youw@NrjO@+23)dZkBjbfA$|)5z5OuCBNw8lS^kT()90_{i!bcG&j4i*W~4q z{Ykq0xw!OuMD>g6w8y`sm5g?MhLvdXKc*7`PyT>)+rF2{)UP{L`;-z$4BVJ0!HR7doTqE8X z>f7#djd&>?*NB(WagBH>9oLAL(s7M=DIM4LRXp#w*2#}+GD`#}ySydT{xODVxK2JB zLP1Gk(TKo^!u*B#c%^d+7Ro@_WnA(f1K9O5m)3;y%iCrxx7EGxwptUZYlU_7@3!Ku z4t8kxK(d)z;>PT5b7w@>)>QHu_znr^>Pa|DxfGFi4CE?HuE!S7nO|75HXLq!FE7+n zpo=Nca-H7AD(+P`K>;6c$_5y^Xj@c z6lk|s?u|ltdF*oq_P^iqV6^W(zhr)XaZzs3lA_iH%9CJu_0K*Rbp6(T%R{z!&Qris zz*E3eAejQ~o)5Hlo-a4oqAv54x3*<2=&{XR&oG(ipQAIFyCLrOo@TZDmelB%n=;Q| zt8rVlyUbgrQ-Q92uX)R;{J%S9aM}2&=4tHHy5jWZUouV%vOd>zS~vB_%)GdL?YT zAhury+YU_Fwmh~ilWn~dw#|%f%VOKX3EM`;wsm7$pM-6_#t)jkc-%OruatW123xFH}dNlpbx*pB{I$h_@5$9#Ne5ok=^X7;1 zYxoTyT7DA_@fD=^6(W-CzT+s;awI}&oLz4TB!pK&_FtE994s5VEwgO?Hn+4K2UiEn zcivv&9tZnhFWd9tYnI9W@#`K>j{@FtFzz^5How-Y+P~yIYk%>_L9svYI4DQ{T{#ZA z<5rxhCX8Nj;a!P#ieJ-+4&F@FPTTqNrN;a7l&v^<+KbLn)@?0tWZDAC|4Ht&Mng(M7Goy|mHsBKg~=T~;Bl;+_IsQ-Q3| zwyo~zrem@~Z$4+gRZuCiLNAwhdR4kJdF0Mh1b6ysdlmE)h$?{nx6HX64eUz3cWvF3 zTD$$aW=Rx#H*LRu2GD**ycp?LK;}j0^7Hn|UC9>LX?`QmWJ~MP^E+@8dD*i1hMWZOp_fC1@!m}2BV90yk z(iJTsvCeUJk>T2fy;-2Q)IAGHRIBT(#o2{F{+?OaQNXLIr+}wGYYKSx)T8&*9}Mr15f-XA}Pu#3`n{b2Rr^d2xu} z9o~7P8`3ksv~*ru8&eJEx5$%5EoUoJaiyexvV>B}XF=J5f@Eo=vMrT-78Wg8n7cfw zshEVBr&Gzel{hw^+HgfHn_@u;KMCIQGu*9jkA)@@%_ov9qqODI&ZyCz{_Sm-ngwfX z+cf&bnzy~yUOwgQT326}OtQ8UkK2+;KJ``M<#D_07Huz|XrkU&8&x88-yLg{UPFyY z$5`85iOPwPjnE*d3+t3+@&R-#RY}QbLsfja*~KY zMm^sA2a^?8wQY;p@?AFhGagvKE#rZjyp;Otea|l0JaXa(q>*P{de3YgIri1ZoBueT zbewV)c1#b}wKLihv4hUdr?Iw!$+Ww>&1Y{NbK4o!ix&q9#ubbi6KK_{`N31!*iMaX zeJYYiOJ6?8E0n%`lAA#q^GTXf`toUPOxBEP%O|v#`cLvxR@2e?^hPXe*HwGgu3PeH zYmQ&H)zVj=J!=QC`qWk=ZK00VrzzS#OChsHPUiSxHquK7xflBvdYD#36#5~&Hy4u#u1Ue-6PZTH$T9r;L;us2D5?_Dd`M%rzpB=v1?Q@KXiYxh636WRXr`lP%)(SM{$d+$E$61fy; z>j~yhMQ0FjMA3RF5H{h9Xn`>)@K*)&2%)MWXg3^xA^+3Ns>|e^6~C9 zVL~yN^1Y_La1Ur-+?$CBk!Dh^>E#BKC!CJ+c*$X}-7~3N7p_inlOb*ONt%m&AGyQV zjaIjIUO7tNJ7b;m-b`}q-uMC0sPtqA?$G23kU3OEqCJG$QC#C1g9nGhm*De_k82a0O z7dVyYV$~_!dyaeWtc@DA-;&iOGvpT$lDd-RtD;XwcRL@+puKa}bkxV@Qx*Ut5mf4Gsh??dWBN#6jG z!7Ws;U8og-QyJfEKTTepw0wtRx;f0!(Mln^R#5D)*nPx2J(tbw-TkI>#ss|{~r=^m$(Mw9dQ(qMf>Ff7+j$)mQp z)y*fE)Q;QS+1t>i6liZeOGON8Z|joBoKaoR+fcjTftob=y>?G-ubmI<`QtQW%G}^N z!NN#|dow25QruUZ9ST;4>gsco-?WJC(7Al7UsATr{Rn*-UkxlHpe|CM+s>7H=MrI$ z*Tzo{KK@d3z5Cwr?sz>AZ|i%xlOy|_nQv0%A&4TJmc}r@2*}??@{7V<|DHHzn!H}IT@b+`CdE(z&v7%1) zf6_FuRG0m{=?OhdRDYv}IOov~fyfk2PuCUygMaE3H z-ty>KnEQJ~b}brYw`b}e``(M51-1OHjyDJ3zHgQNrUYWOvESA4<^bGp+GSrCB+f3p zIRN){W9&!y$JvE92jG6xE?!YQ1@^T9-W-7Tog3aRPx1xJzHTHhe@}rusDRD^SQuKq zcBSF=)bhGuT|2iD_h4!ELDJqFfcrr7{Wwc+4!|}WCvDGo_rkMRdviJ9%>meEW45uO zy?5u!+0Q<2+FSDxd2;|Jv{ZZTBayv1023s$E2-!v5%=D_2FVA(Pv2OZ^cu>W1F&Fc zn@r_hC2tPEoprMz-W-5C36qLF?X=Sl0ruG5&f5sFZw^|SuSk+h`!^vS&L??=(pR6_ z9n?%*O=CVuGfH1RDSivk(e~L7zt2x>Id`o+yOu}yw*RF1O~`KQ){;+(--L8HpFL{_ zvHGO?t;TNFrzzS#yYQX4+wzIa_Uxb~AMd;Dc;!+#2eIba*ZYZw|m6RZZ>M zve=sgaA)CC2(jm0!M!ved-6;2miZGn+1s7Do}{|&y^PrBXRRs_f34iHe3DlvefcE4 z^iQL1sb5=mOt;jpEjyIYet3^zcj^tM~ z4!{KM+gmBu2<^?Ml8);i$!f3NGx6pC)RuL<)PFbDn*%UGxOP^`b-OnQ;LbwDu94c9 zdZWGPE|Q{q&6nb}ScmgT@mj3o`6SIKeY&N14&KrFcyj>fSpa@a6zaY=OPD zW?vub@^b)YiQaZTy8UM!y1ixsUPj3ja4?HC!Rnf1aXS4ruYYvV+`y-I<9$pD_7tX$_D0?B@&vzhT??K-PzVSKu3UeK6~< z!kcvcDAr$tZ_@Pu>%W6vsq4}0SL=Fo|7&zTn*L^8kLG`!t`8@@m*FyttCVLX_%-|n z5G}t6hs=4bN1Z=PJl|7bpD1vMj7pyK6z~)wz$90C9cy;g;*nI`Oevq;wJNR`xU{v`_Uzj49GhD^(HgQ z7!7+Yv!Eu=IQ0)Sf1LA?hCQxf4>xZ&Jv8je?1|6ZOuQeMX=aOtJ)`j+Y2M!aKMng) zW=T#J@g6fH9}H;N&otiSarypS!=5llZ`!KyeyL&4l5ezp&r6v}@5g3JpGJ-Mg2wx0 z^T)AxztXVhoWTzUj9cHAH0*iG*R1=#l6_3mL!|eD8J#sf8t%VXno(*eBX_$$J<(uznLi;AJu)| z(Rd#;f86wthP|s{AG2?chW$Nr=wYJ$f8)~oB(rqmc;hrUW?EFgGLt#yLJ7;JzJGQ1 zE%Rm0{T6NC(9MkeM0GC9cJpXB(2Sa1uJLl%_kQ9Hkay}dth>fLjC`kRSP$0@8jdnk zV(|{loI9_aeTOxFd`>jq-n#DuXPOzR`}Waz6I<$A);F{8pd9u+fp^?`YrKBC?}^PH z$LiK!>vmF0Tb3Q>>e7(kyggQrQMB6@dH}kZk(%CE-S_0??F)|9uw2!z*i1PnTHkS+ z@4^ebEGZn&9tcPmd(yS?!Na3Ti3ijYAquMWU?Y`j(GiAV6HQqvvccoJk)AUp{=uKI!iraUI=5d1= z8`E?t@n#e63r#-h*azOy{*4_E4Oio};>a-;9mv+^F#$Hlt(pSg&^V12iqyJkC>H z9x!{} zxTiqpQD9J>)TPq<{m;(Rq+U&SU4eu2-bEiiOPn1FR)*^8-QUN}tx8CYvnL)|*vN5@ zE}ZsuOGu*=u5f^ilVd-tU^Zt>!Q4<|X!pw{SCGX;ONvM#&rK!0rvxJ2r}6%qtHu7a z^zQ%cKW(uuO5)2Mw=c5w^4w1p=;%1VpHySFi_zg@$ZqGnpX}&e*Y76{;T2=wD&Sq$ z?_2%7-1iFwymutxo_?m`9gj3L>OQ?j^WKp#`&9ol*pHV)2Nl@)9f=I%JGiVWSQn~f zBILSY-MZX%eiLKo63890`l|49w&b~6(|3m~dTX&yVi|Y+Z8fj=d%b^W)9q3rUHuN3 zli#J9d#B1CRJ_i8uoW9icZ%W#bY=y*8~=gD#Vadv_4y`8{N+1L%_GNhal0jhcZ~Ip zvAbnB-cBhi;I#D4_WE+lX?hVo1wM@m*f~FkG;X}>?Z&=$Jeb$_j(_C2)yOh^pL*0> z{uoo3-u-stY~E0j?HkTJym8~kR~k2N%RY825%VuHf$zL-CQZ4}Oq#^i>&A=UXq>dg z7>Qrbc1gF%F;$a}GUXd`{CEE#*!<4?CKF&2pI-&?n=&oC+#H#kUteFnvS!(`3CET- zMQE1Ya1eUGfN8=RTQn2c#h1pKr z{J{+uHov#oF*!FL)qMYk3l4AGe4z<%eCmCxOF3ywEniVTsiHp6L^$=Ix$&8nZ5uYA z*&T1}tl6Ea*_Yl<)Qoh|Yzdl`ie{TA$0o|LiE?bB90~eSOWYPSq;35c6dXUZtgJRv zLBu#6N5*uNbB-1rtKxKQP#q_->yA3U9FX)}9hq$wzS_u(OwvY;#vJmVF%<<-9aX!n z8#W%^*fhvwNE=`~12(?#-A7n|=iwVR(X z4I4MTVe8fuG-2$bw&_m7E_K7oNp!>c*u~>-?`#)Os9ik$eu7=>qD|atj?SGGYA6lX z1=mP#YDFk4!|iE{!i&Q3wlQAqB%5Lu#`Uq*Y~y(1Bxu=$UI7ACOVKZ?9;TAm>ZZXU#diGMTwPx=}*d4}j(PMBSnz9sOPQhfK1)voONjwmQ8EE*9QQJB9l zAFp&y!NL(;SrD)8pFRb;IX>I3KYb-nXNkREQcI_rURs?>0q>X85}UJBSG`|SOVp(k zu6e(tMx*lLFINYq$>(10xZi2D(%8fc5PV?@@dgubQws6q9?Zol#2ZSyOWKI%-W4DM zD+zOT25_h!>yUcvh}!BVK%Za_{KQ6ynJ}nJ@0I@#-3S z&Wlt8!;Uj6%#T7f_nZ}uEDwekMr>&JS>~E&n%*|1FLeksH-GrDeBvnaEAE=Q(g3FZZ3I!-W8((_kO>&^Ba#2;_6R(==R?i`^9B((CQ7UcHU@E7+u@N*#&Qrid_UNO3DId zYini1_AI2UT1T8+_+<_@&v^=X3U~^L0$HJLTiw%5zDNqa`CRU zSz21a%u6+^Lv@|L&RzvQ1>zLI{;Q52A6O6yhl2H?xD8!}de_!nrKMA=r}vCobn>2Y zr)Di)tS+d4_l!HS(MxsJd&ZrpODA0Oo^eZ~%JZNW$E?-A-m0t5*;%WdX+Ed;>yu=T zYnin=^OVP!6Mb5SnR3@`cP{KhR=D$HPs?fkc%#nQe#pwqlBHXT*Ug;&+G`rGDzhZ` zSHcc(=EcHR>%KkB)Ms>l_CxA3XZIaRyxvZq=-l6jG-S>`g!gc#^=aPzc$22LKHL7b zz_k8m?6l1qwo%hFCR?6vvCFb$)iu=()xmJ}`dz&wShlRbA!uY#XTO3_T~hXzEo%tX z*~Oabnqb4OW^YVR{9TNcv+ev5<=(Gv2g_}{*1h}Q@$Pti6uGVM9q%#3i)kG9p)tpP zXut0{_Qe}BE+S~4dCTO?3uUqr-HOG_imS+7}8T{#bbec8eV0sKoB7V{fN z##|o^*_OTi9Om~W{=F3|>SX^X<^A)h%YNSUgdZmB*)Ny?-a_H#LL+YieBR~qq&TPC z@+LDKeu47RfXTVSawA{(Ot{{1Yu~U;TOHlJo1PC#;|@|99HojD%%;XmB~d5ihc_#J zR1MGXS_%xxllpqI;&-i9_iDR?0=&)T{lZ`xe<5)Pd3R@ZpT1Gy&F$gM?Xf#X+nM%h zZT7qjI}69MH9XT=Rw;L*#8u0cNQ$mt@tmUKd2?nEJuk&wQjQio!;jAGx9jufxp{fL z-|PJ;TV3aj=*^zjIombWT6J`sPca>x(Uoz;lO`BT9;@(zjbB8?H!eeZAW)kan zpIrDr@%f}!0XTZya~Jlcna(#1-v;y_L9(EHf<ac`f0-ZsDHFc{d zPCTwN)WoZUr@-zj;Pr!)wevHH2(Mj4523|nbBa>l*NfOG6{u=xsGU4++^XO?!QA?_ zHMtd$HREdQB9&_^8tTWbs$4y8Lhgidm63}2alzW^ah*^CZgVIL88U);WD>b~D<-rn?(=24M7ae6uN9x&5md4x6I zgU#D7dQaokWDa}ta^gK?re4%r!`5rO@0;z{lxo;{T91d#SmS6|lg|DASo8LaM{3wb zTIMI?>U+7C`RV5E=h}JWjnnT+E#FVf^v`{y``(~)y8p}!k7;nDmgTwT?Xh~?q-B2I zOpR&!MUD4T^Y-aR)4NN{{E8VH+xH%g_iFR@RnfBCt7ZPZ85^CizTf>C@AbI!zO7~c zi zaS8E0jH~Z2vnM_>fUtj?u?OpX`u(2MeLsqe_kz~A*LI3_5c8VDttH+TVR^}9M_>tx@$o-v$ z>5I&iXuI_vqVY~``8|jJLp5x%IsbHRqyEFF2fqa|eTg$KI$rf3sqxM*v9YuNc+KNX zr%!C(3GP@jJ=oIU`k&z1^YoQw?EUv^`KIc=RZgE+J*K^k)v}!J^oi**Ps8e(w;!@u_g&!j^Xb>h*u<|2*sn;2G;X}>?MD0S0C)T&Pmc z6OJuw$S*1k)mPM2*EU4zW|kH#swi43@tiR%2D)5+8^BB|s<*#&@N@VX8vX*js;H(1 zR|U=lc#kF)QP*V5LnB!!I#)uRA+nrPvm%nq3ybykcP|dP*qGpL8*+Si-|%|#|897q z`J)@|Z2sVe3!C5D?3kPzk7~Yu!v%*oZobfjH$L^g)uo&?rk1a$pHxvFXd;~Y&)oP- z%eD<0(Cm&kcGm1p)$B`eCu&BzXto5+N=36xlw%X+*hD!tQH})t?5DYAiy6|kehUhY zpIKH`8>*n3aXOBS=_u#REjm`k>DZt;%I`MpsN>54Nzc`BIMfuaHZ+E9qef#6dC!=N zf~bzF-PR2o4{vN5WHO`;u$=)L-}rA#!zicjv#EPtwC)M@b#HvkHUo1DtLtkc^`TY_ z=A39fO%>S;)%x&z6K1^D=NNcGeYjp}%pp+gBX$<8&#}-~jp>I5l|PNvr&YV4oy9IT z-)U+$KVcd+ZhFJkttn{2*hOvAorGQLhLw}(hV!wD$KT%BE}l@kc>4VWyVymWxYZn; zJ1f*s8mtShk>1pbP*{fB(-wsnh2w2wyxK`N#Vm~LW3Ac7@x)2cvI)Hc1ge&zUsTHz zpnpWmhmBcz)s9-m`WLz+=*So{8^cP_QOBfm5)_+q$D@x=$EL>aG&ZH6XKmQ_e%r?q z?9Gmk=2ml@XjxJ#uQUh4yQS&aI8F27G!4h~w??(kNmOe`P5(H6K-E-qR87sFpiRc~ zpK46?@1mN<_cydWLlWFPhyfG-X8ND>HEi+>(Y2f~yDojp?O&4BLXHmNCP}ZxEz;lT zIZ=N*Wir3TB5sQ5X8ozg{r>m_^{1JGZ1{P)-*gRMs_7OOu`cXO^DI-pNW*8E9J_s% z<~Li@saAiErgN)1J%PDR{oB>IJ9~>b1$xEt*68m3^pmEQaN8xDE2&^^s4>)9MyZ9# z)oQUj$wZ#Jhiizb?cIJXG4&4LD@&+!`+0W882j{IUuP8bQ&y+0K9AI=thv%&+>Va( zX)n-TPO!trkiA^qv}YGL?~M1WcWGDGOYl>pz@R)Ss`smRpPB~q3c4p0@a7QS6RPf) zX?oXw`(?B2wL*3EYdAlk_-#~fqbhf-V?Y+|}Bc!}@-WA{J zjC)4ka-i6O<;l8zp`3;5d%yLxgGSz}r+}xx{-J>TuDVkktgbn_ARMf(-#?1Aw@Z<~ zwjpx#tWZs;F4z#N+}pW(`FRTLBL(dDDFcV;cO%|7;EetKRXL^jFM|(SSQo5-e;yv_!3MbKhVD)i{AKuH zz?G-}WBeiaH5M&Hdil0+D8OaNx1+->H5q02!SM{wA5tXi_a}8aaliM!JGu*vi`z? zZ#l(f`&mr0)MN+nnbtyFb^(i%EH&A*fyq;TDZbPbm;DtMGb}aP&*IBIxa>c(5F5hf zbZ1dysmT$IXDXkCFTmwUADC^a$q^f#qx{SGbCv%P|77KF;m>n=-S|tDKaGF7@;C6$aQOk<@y}E)wsV$p$y00ycffiU<-*{%v!EY{JKzZx z%PlnryooREgzF(?uC&zjkTj)yxE@lc6_%PFlIBX~H{(|+7n_v!!1eeOi&d7Io;~na zD;GNrD;GUv48rxifQ8s1uICmOj3459KF*@nQq%Jf_-DJkR~CMqa?w`W3D-;7it#{P zFA0;ritF`R7Ux)MdOd{C*e0&mD=ZoVP}&MHU+^H3xo(-{kV%{qZkUF8%Bx<>mOBl*{&umEVPbiSi%eU#k3Fe6bbW zL1F`!TWStE8vhFAV!u}^7o9$%d^7%4%0&mM1MZ;TvAD)k(WglFhViwW| zaDAk$uD8_mk@Rj*{!RQFl|PR!y5stMz~UxL&B2G_e@?lKD`G>qgT<~tZ>c$0wETkd zFX7*!{8{{4m5UCyxxDW|__r%R7XJ?AVq;sBOIzKkT;hIF`Br?<8rN6sR`SCgBHDi0 zQgg@%{JWLU#s7+OvE_S|i)LR{{tf(lmA{1lHRb=s|GLZj9fdFPaQzBch<3Pst61D; zsp%)}cE55-TkH(i@24!jZK>(^H~jCoyuax1UFFB)e^2=m{0EeajX$VdbQL?m^_RZ( zeM?P$(cxj256Hy-f$}l<($8@NMB7I#H3Qb*Kc-x4Skl4`kha|_3@&wj!csFp{3n&a zjQ^DKxAC8L`JsONA1Xft{~6^Y@x=~shfZf9eFJysLKZ)^)Ev4T|0l|291y*5hhE0w zXO@~nx8VO=x#;%`-J9$z0G<<1$++n3G zer>5aOl;==lwW`^^~W7{9gE*sY7P?{`K@x%;}zw<$A4A%NBB}c+~K`h{LWHyxU`YP z!yP_@#WrE^vsk=tsX4p>{}0MPga3wdvG+eJmo^kTz#T62{=&O zxqJ|DoowX;;W^4D!@DV`Z#vzTQ(s5QiW_t#yod6yz95WJ<=CcksB$!R4s-cYl9$*P z?x?A7)-9L3j!=Fc{7B`Wg%48xJ$OJlecd@qIX3JJcKKl1!5N|)-;uV&4W14cdlD{s z4p)xdIwO>0w~mZQxWU-1GfKJWIa;~2;~3@GvNP7@Luf1KXyv5s9=_(bKm!;ew^F#K5Mzk(m9oc`w=@A9G8mve%0baEys7i~{eemZ=z^7Zg3%5Q@c zPux(kRmy7l@8RfW`6uv`Ts|xS&r?oV^oxXHXToP__(phva!J2X`Br$5a>g5Hrpt#* z`DZDo4V~G_NyC|=yb?ZF`T6jZmEQ@Ur+h2CSh?8VeC5sX5|@vV^h=eKwsVT|74QYh zo8V>2r7adJe-uvpi5u}M92>HHJAARrM`G6wV}v-S!!yol%0uv_%CCac9^yuR6@G^D zXW?fm|1uZ6Ex{tY;GEN=8K;A@os9bV(|F*)#v^0Dw*<&yr{%1Of^ z4{>9zgx4#V^c$4F2w$uGAMkTrKK1}OeOTPsQSe6Pv*GKMQ$Gj07dQ5D_<73jhHp^* zV>q@YZmjg{3tWD5e>gTR?r8d=(`2bR8hddrR4(PeNV$}Mlk$7u7c2iE{1WAVfM2Ry z?B_C<=MIEZK5@D9QHQp)96NGI*K+D=@9(gZdjtF`4Sx`RwepwY*C_u8PMe7vcLaR1 za!LO><=Ccky>j$$NLSoA>0dW0m-2sB`J3>YTs}S%{yF8M|INzh!auKk75odz#eQy4 zF711(@}I$PQ~ozNeNWtkgW-25KLNf)`RQ=VCvF1m<9t#1m*96P|0SGtaTERn|FX*` z9tNlF#Z8;oo)nvAyBnQ_k4$JfNI0$)WAV9ZUak9#T#_INw+P zDEwjNufczyyczz8%a1z}PCRkP6~Z4=UIl+#Ikw|$RZjh!CzSsRjxOSk6MK8g<;P3g zJ*|8q{D;b=?>wXY0{FAaZ-@U#`BwOkmH!_86PKUhhyPUh7&vw#?u0Tp+F8!H;`~Cn zlo>m);k1MEoN~gP=av5z{(|!V!Ksh9Ndw`GJC;v_zodLI{MX9E@c&bOJ^W?mXz%<+ zIll8-{Z<4CitH%HIpUHzbL1D9JCNO`EB@{E}tT{_m=YG;A|5&MQraK<>$jG zhqx)yU+BY@OF6M)%kiD}Tt4+6_&<~%3;(BbDd+pjFM^|&xT#-;|4TWx;C!f@{GETh zeA*#!>`&aZsql}LuY~_c`Q`BcD*rZ|_7*n{?Var|pPmW-METKh`iZ#dCvz{`rDpmX zxZ|!&$HweEbcyp_xL?Du3txtE^6`l>>4diXHq--i!ZPXF+YaCsr^;~S}b9DJ1WrSQ?pFM^Lz zelL8i@*lym6>)`c!E;?+M4R|XOI*Dn5gfl@;L{?=PQ@=OO#9crOIpItc#l?TmTi{ETKMFrx`77`Y~Qrpr$j{m)W93BF7@`TNS1 zN8mx_*TI)7e-K`w{53db5_ht+Z^-5I`oUKy$1Z#;m6NBBzAbLvrEvO><==p>QvL#b zwQ|vfek-o{2>2T1q6zwnD;7;CtL2}8)2^0(3x2lp|AW^l{|H|1^7%)>8fLxyru}Z&WUIU+40Y4ETEGN5jukPW$^dC?^fy`O3clzd-rZ@Qupffj7Cl zRNCl5<)R_ug1AyNw$Dd}OS@cbgH7qf@Jp1x0Y_hPr}*I5isi%Lmn+BieOD+KTfI`b z*eW`TJLMtxRm#Pdu2%kE_%$wHz*y+JRyqB^w^=zF_$Z&a1-HRT*Yd6K8AP9^7Wn6tKMO}wab<7AZ*lp;UhrF$9|xx#;uf9`zg;;R z`|eQwMfeuwKZW0^{2y?(iCfeUewXq*_?MK^CwyO4j^4hzm46fd73Kd2zel-f_*Ivm zDt36U@%77~tEgoHp@2q5MTSbryG8GyEx+FC7VgT6r1#hswoHo>4C8JgZ!E`;qcD z;Xiiy>7v_Dlph19?ZusbD*R{4B~9uh?sQ4>7s@H45ADRA{to;(m!HuG{=D)N;4dgI zhyO~s=tkYdok82$cN&C~hVR!l*qrfCICdlM%){X?E1v=Xjq)|{-zvWb{)%$i%J-`B zH{h?i{459lJLN;*zgIpJzD>Eb#p}wihW|l1cH|>1ac4=pV1Jg2&HTyb%MOG8S$Prs zFUo7-e^t)d;G+%1E&C4qE#Cj_7E46`ZnKz6t(;^3TKnrJTOy`%pQy|0#ua(J%tFT=+ve-e(S z;zBRMCn$dtPCdn~z;^uPXE}QKk5xVeew^|p@Z*)&!x_KCt+*OKNx9g-iOQdbV^88% zyap#N%du?r?Xq;X%CCTzDgPRLq4KBTiRQ@a++Y-0x4{&r5w>k@64#BO)mi?q99p7r?{HzX)HW{QK}40SO59SFNIS#aW!|sH!A-Dyh-`XaBNgu%|GE6xjb?J9Noo5 zj)q^XT*i${l%u_$Jj6vLugjE+hKwEJB2U1vMa!j)u2lX3{4*}E?F+|-#MLr>_^(#J z5YAXEu9o)kU#pz${>{pzA6=*XY54WZUxVME{NL~!U4C{S_-B=mh0`a+olSrBe@=N2 zezS7g#J;a7aoEpKn~6L7LHI4oe*?c&`9I*dxxB7B{C4HT;ddyX0pFs0Ih?i;S4TVe z(av)A^WUZXVK{bg!zHgTEB_b#ZkNlC(fGfj{8;!s%B9bKRXKL*zgIch_`jz7Tkx+d ze*yjt<$r^J)8!4_;AkzbVGR6!7?P54uSiTmH9b1kq_#aVDz5S0W{}KE#_K5n#ZB;jfJZ z$_dY}ZKna-*f%~nm3$VIEhvcJXLooi`7A72vM_gfQd2QAg5hu^QWKaR3fJyVIbTPDk>ID_d*DX;1(5 zwo979+S)dazO_7C3u`Z*a&}6`4^*d;PkmLGbCQm^_VS6Q?v1rkB~tg@v9`3dfKFJm zI==VC(ioABu{M@k8>F1@bd0raBp(Zwe2RlGLFQF256oFp8>wpuAkNN_QW+zQ zOXtnpdC$a4APiS(u~rVPh(@UW=vZ? zp}o|9lAp46*sgmcmbL4uJ!{u3`PA-FJ7~#g&)PvOpW2F~E!0taYl^lH`6O$h^yTAS zyTp$lsT|jB|EZ7PYiG{MRDS)Mox`Icshn5Ye9m3n;p?Pmo^AO{3QF2Nf0H;flbk80 zQlH951@|BKtScw^_-j5nf6IJmeAAvde@o?>ue2zcYP{i?!aa!khPCZpTc#r)X_;Ia zN&G$KN;TnJ?s_M4>999RfA3u@*GAfHq+}ItXIr^$&#g^ zd!qkHR(tP0>k_#XXzS{KOsBi{FFb9YHf5V0_e82nbWCsUjz}ukNX7H!w0n;sE%~Hy zFC#7aq;M}IE&1$&dl_vSLI*dLv%fu8>1_8h+Bp)&pMwW5iU3b@mc(h9O8>FC?ZQ2V zj^&fQLg}kd(o4RCYuJv}C-rN~j^&g3wPlC$*$?kA>`r}R*UCw+U=#1rbu6DfYX>d$ z*|T;K%O_m1B5oMjBh-#NNv=;N)3l8TYm#S_wtRNs-puaUTN9dC-FD&LOh@xcrd&sL zi?2_zCQ4sE-n}MFDCSbW*R&Vz0qu)>Gch63Ov*LAT;51b=F)Knx+ONeroKK3^Vja#W#cQ#S=aV#}^tDfl=inW!Pi1KDoP#HQnizKu zzMJ)lT~nlbE!N?DQoI)Ha6Wt14r01R>MC0sPtq9{y{1T(W=H!^6NyLjN$I)rZnjS> zpSpI(H-`SU-vv(Pxma}y_nzb4J8Ppx$y9f@RhP_|+g_}a<*TAkM|V3P$)mk<)^yaz z=2IC?`o4YPym{%V&)#~T7-~%VoIGvyY3JNHZSB*}^U<`~TV(mFWVW5QeD>P8{@!{% z8cO;GhzxF_dhJ532%O6JX8URK>ZIj66yyCac`GfH-k{0pP0mZrQy@_R?{~=)_3+lZ zt^$6k`jEzrcm02RR{|zSRjsSLIw1*=1PCA`VuwX|5JCtL1_&})F_2|Q!X{fLlO~xk z8#5CK7|Z|xg9ro=6cIu|7IA?GC{eZ`3Mx-O@Zs_Rl|}R^K~zNHdtlyw>fT#*@44qz zHvyv0*Yzb;)&KeH)~$2T`A=1KP4&x5hpoQ1aoFlVH7aNHkA^++K(rEn-MsvkmzRDN ze}_T#Wgj2DbougUmM(v8v;9YbIN`jgeE0KF!y)HJ4Gp;8x_rfpOB-&$8|U=jZBV;? zg=kU3$Y|cO0r4&OHE&oyvo9(q`=H_@-$@fKJgK1J^789hABOC^_l#h!HF9GF+MMv(y>JeUDy}vTl8UO zrat`c!yfoB1%Gu9`z|z})^Tblo_)g~9MY$4SKu%1u3I*sc*~W~Z+PpUh$6Z!0X^y7T=<9zhveDuTdAC3~!4bd)P|IMB>Zt9#l zT@|{@wEVb7>c{%;lGBeq)qj^f%dz_Jl2cawfBjwZ`a2V7^u_5tduDhOT&v={$ND=H z#8J!#t37Kl51S|Vhd0&VZ`R+L;0#!`@gZ{koe7T1k`J}`jfk7>??CcJ@c*9H=KR$J zehlYd?(ZgQ_&WpZ9)JCv3COK^_+Ni#0-UfB(rQb1&QC)v$LdbRRo!@GF zcH&)+PmRw`yxaZ!6aGDeG=|ll4NIQ|sr4C}jr3c#pZ7Novi-cjaggrk9Xyx6G2_#R zjo#6-EgLyL*?#KJvD@QR%Q<*5KDpnR;}L)bdH)XRW_8f&1#c_}iEII}^B9YrD3bQGaKG@3Yd}_b8d{_JVC%nh7F~^f$E5Cz#4DW6~ z?{6Gr$MgQiLAsy%I}Mmo z2{Y$R!_T#L^mMjW%HtYNJ9yHPp5D&(@{yIZ&cvy7Pvj9Mw6s)uddf}By^93v+-Cfu zaBq1|rMI`WW1&Epir=5b&HSz|**tMcYukeIl%>7h&BDgx8jeI~7gP?fbod=3J(?M|Cr zp4HXc+TMD$)ZHVR&uA{sTGHFKMCejt40brN9y7z=qxCn87{ZQ9n@?$K?rCXm%Q;$2 z2p=vUrVI}g8S{sU7@=Vz8-8y{=rtKa7&;WP znI7w9Imr(Csb=>8(f|C!Btkeb$(oy(M94`@GKUkBtii-I#_)(6hU6w=Gj4JckBoVV znc3w?P3%Hq5*|)WvIY|~H3mB@CMIoGB{7MTo0t|Me7GRVv6^fRWBxGF=AmICo0piT z*`PZ>2qY$L8cs~I<|QWCgNbR3p+m6~Q$-w{rYaF9j@=hJ-<-31SL~ck#pHDue)@Xmu*>pOxQsV)){w>t ztx75+4l>CFPA*u5P zE7?y%sp1?XTyuIClu6vv;-9p@PXJ_=BOEe?>xRs7WkcpTsu7^H_H=gWOCXsswXL!= zmtgCT+ypTk*$LD1SceH_jARDWoIFyRxdD<=9NFjyj!dy*E{BnSIQbFhOPahRu4uWe zDsHj$EYJ>@voI}pu#K37H_!K-BV}?Uj*`g~CS)?n*0C@n_h@Yuqa&xcgF8)mXC^Ys z(HEJ*^+jg6`XX~2eUT})ID{FFID~21gJFV+2${jeA&-=1L4c&hK{h(#AX98{$YJCk zju8jB0bd+s9v6pPRu#9=W~dnp3ua;FS<+CmEh^kBBnvqUbi&TU{m`?FcK9(kbi7s=vMneSIi$b1ap5c^ zE!+u93umEeS?us+uot4t?hjZXRC#T++R>(T$aIGAEnL`P<2%JNzA*Ljfi^KVCn0PD z&j{P*ri5*Aa>6$7q_AyvR&d-26K=HBz#I>?WfH@tv&`^Kvga}>Hap0Y!*0XL4%^_T zhi#Px)9gqZ|J250-Nu6+vog!+gQfCzJCYYYy*C>;*=4s*ai5nhG+u|db_( zew*Msz_X@jb)JQ}z_V)~c(`!_H`rdVZK4}&0#jMrWXmkab6rOp3JO55>Ay8nb2^uF zw^Yh=yDNC0&%#q-n!Th0PgFSZmHe2idfLJ6nbVYQ@Y=GCR%6!gXII)gdn@H+OS@YW zmh^V+-J3iVW5a5|%2V5#@r;bsOjC2qX*jR%*5}cdh1?O81ZVGdXYJkFxU+xTz&c=? zgdTLy$1O#xlgy*s%!(8@3vTBWznXCduW8)QDjPSaeNcPCIWuQ4UvsnTacitWq#AN@$cB%^hWC43DxbMb_rB6xjqviY!A=iY$&KMV48XBAeh#5wlkDaGn&g zmVzE;Qp7e3`(BbFYhy`@EVC>{7J<^6NfEPF@eMT)k|Nep4MFNl5o^OZ$~qltN^YSh zH)C;uWuNCIR|7L8`-AXn94?Wmw|S~C=0z_{B<|}Rj_dJkSPu3)ZrOq!w>YxLErRHAZWleyNv_Aam3f?*1&>>d zu*Vrm^tjB?9=Ea*KgX*sTXDhH+gs^KFYvMky707Xki>_#8Z~RSYO5KwtI9c3m-~dd zcSh88aC*iPJZtLmov~;iBKO=$x)qxYk?qWCrzU7* zpGkY|RpysTb{jbH9HiK^_mnc5{hAuk+n z{ux;po}qVcum~+!ieMz(_J(E73ZXan#L7QCL07=3e&V5cp_4adt)fj1DV!42AM28o zA9T*(VN36#)ZV;yxuV3h{uoCXo@(cfUCwj=LIZRnS8Zr&J9SjMs$~fCP99Y&#=BP0 zpz*-Smhqc&$A!=Ilv&!myR)m(-Fp@`#h(*d?NVnZ&6=vd4>mXcrJdPB=-AEP9D=hu z+hXmH*D`yjjmRpo%j&nmprlft+IwZ54>MT?20xdK64UPaS zDZ(hDUHHS)?kJCxR%)4)6>HhaSL}2QP=Jqh6(sE#jfBo3xZ~T zLsNgpA@iI%E>l=350D_D<}N~2hAHS_qEk4+G_NLvsakBp1YQDaVCD~$);io(FjXbD zN#f-uE44@G4dGU*_9r`g2sGm8smyUs9ApYRcaTYmH0wX-%3)9e4V!C-6WWh=dn(*w zjUh#?=7tmz*m%rQk6htZMcvKaXNkp!QKaI-D5=o1;=^cx;=@>C@nIaP_%KS^CpVrM zODaB$A`~CS2oxXA5{r*W;>CxNyyC;`!Q#Vsa`9m#vG_JGQMC5Ky6WlyUOXLyB%6IhMmX1Ba>Yr20^SvbKhD%|SS6K?cMiAP{nM7C!I zgxjs!!A(Nh;1pglxSbUX(ah?E$T1~CGzNppD-3*dp(b#OTMoFDR|3y&7l9mOs{azl zO=*eYr>Mj-f-l)Ttca&Q+ zCZa7_@&{LzYN?&-Az%x%)B+z=Cg098HIsA$j3eqas-;9&? zi>WxHiCWG$lA<$8NY^<{R(Fx*X*^^3O3w&ky=TOL>NA$C{Sry801}hc0f|y2j6*en zH5IN5j40Lz#tBpj&Jt=xn8GWDz!arL;02{a;IbMbFhZ3ik6LBS!c|3XRH!Wi(XKF( znbjGe;#V8a5o-=3iIs{=w)YYCg&x+Jt&YlsOoN@$ITi@Ayrzd&K7 zPIJUc#o9?L0Vw6y&;xxHZi7c;DF_vGc z7$ID#7%@<(7)!2H5=pL95|dRbiBctuLzRj(6|Pi_C{`-Q2~;Z15-L@g!Yh@)6eUOC z1!Y9wvPvZ|LX|3yT4l__l}c_@s8j;cu2hnlRVtt2S1QgCD-|P&m5Ol!m5Q;XN+nV3 zN+sB937gzXCA3*z`+fwvsf>l#e^jH(_?YwE6ab$8Oso;yR|i|4h;ToG<_PH%HB z?gQq2{p3>I%B}tCQqlsM7H*N|)oqc*%C^XHtF}l<`(%o?$Z~78NO4NG%*Y#T*Hd0` z7aL?xGn$*}tf}M#K#ChS#_Y*Qxiz7xiCuGxnn)o{W={dI9$AdESOuGMMJGt}btFhN zl`2T^3RQI`7an)4=z#4nP6Vr|DWP3iB}JyV6-DH@1x2LrdLojXauR0PU!1r{Obyg9 zu5v92?y$xXuq#QhEi;~pjJV&HD9DjT1*MW>WKh9e_7v*MoWdMgQ&2Lu-Y%q2N46AX z%aleWSyCo0LmG82DQwV@8QYLvS}4$$5rsRlp&&~HA`daLkQtnC$zX5HGm}p94B%-k zSlnSZX`2x}dzO}(8*`3()tX_$=7$HMa2vDr!O z8?3WRKuUUJlhWSU(nMs5Z|s58H)b*UjZsQ}V@vnz z3V<<75@2kC2&ASQ88DoH5Ts^N3S6rs1}=lkfw2Y!!4M=#Fg8IH1QU}5n;}K5Z4X7I z&2h!Swxro#10@i}Od{;o!&`VVk!~glg)vG}VQjKk7^@%`j>!@X8_#ooo@m%@R2v{) zIP9&B3o%f1Us|b|BOH#!kqyU^Ca)0<$I2zcF}i}`m>juqEb0EVSU5&UDjbU~6s|#% z35UT&!Zo@QA=n&&5bUWuI5vD>e?H@w9cgeZwlIVYMixA~6PKRVi#U&=v)#i1IDg$3 zCWvuqq`=!O#Li^E-NX?A$K*(WV_^c|*zEN84V3&I8g{Xm_}=#UgJ31Sx25B(F=e9$ ze$r<)KkYMHnut!~XLd35GqaHVnbA-G%$Dxg7J$s`OF(AxM8GlyWgz2-LSUH%Dd1LL z3^>D;gUpKIlmsCo_>z#>JW&u$jx4wgKWbgO9F;D|76;dYWAo)9KnX;#BN6VV;Vqa< zSeyAmkr{od$ZV2WWL8fum?;$u7teEkSTx)=stphq4tHzg!hhtCX4eZxlXU65!eG zjRx8~-Mi)VPQ1CHP&mA81EwvNV$SVM&_Rbs zmp;+4A}t+aJTGmb5*@6m|}UK8=!lFd+yB7C`P zw?z5df6>rFp`(|0V;Vme#jQK8id)Awnf}4PYg=VI`Lrdvg{*fb77TDN~EZI8o+e>QATr6!oWZ*;3(y2>%M9Q8WYN zP#Buvg?q^dYZEw{btJ}n>jaNhT>$Jph4;g_Mq9K)Db!~(KaBMFJMGO~3?D`N+Bs=w ztKYnY^{3PpyPb%o+V9o_zK8XnDEz7`u~g%=)x52+{xgMNy&INlytdwp#^~n?FRjFK zm}>uNiiKZkobpY@!&WE#57wX4_!qDotoWzVcs;N10e8U<{S|)oO~77I_?~+Ke_G)! zlYr4NU@Fmgsd3!usFSh&TS5_Umtm&-zxicf$NKAp!vEJ}ru@J8&_P)LE1?*#0hp=& z4;l6<);ACe{&>t(|A(x227O3S@JC=p^?%4>#5pMtO%vfa-T%RV#+VmKr7%sp2J5Q- zgZ~B}7y2oD6fIT%ha7q_@XZuHr3XvZ{~>4LT&plp^Jy$p{|A2)ekjl}VA_qwTeWjk z=@Y=WN#JND;-}wg%2tG+F!ue#iX5R z^=E-&JZQQR<6!X1_6M$YV+R_G58&;4tqCoim1sZZ_TC=qZ=Ax>85pB}QG0I^w-#QY zJn92Z{;=^k@Odb3YTv?(G>((od)r7$EW9)upVjyde3Hgx5eCp5e;MdAIa9X0L)Kfe#~sS4lhIIOF<9r)}Qv3|J154s%dYTO4tPU}Y~ zd?dB6`!k2eeWAulS5u4Gx<7j^0lrxC5$C2q7t#2h zrtn*kAErMqwqU(O;g{Ww<-}xshqWU{3Tre@d86=cdUpeUqr$JfHpAD#Cxx37J_Wut z{5znrg+~*-P&onPduh`C;Ct5te_8Rb#yIs;`aJkd@;_`e#n?95Dd7*|4H#L zKpw}s{lD)C{LhMi5&GGGJH>wp$66r2U@HF-vo^Kgt#1eZb^;eZdpfQf)+_$oYk~hg z!HdI@-^LHG-;0|50fm>Z%KY$c#7Gh6B{U7hw%QMaSD|mk9TPa3zAf6+{cJ)!6fwq_ zio0Ex`C-&Y0qDHm700gqFl0P5ulPa5Kj5s?4@35P82C;K{|Ju5_~8zWOHt`S@o?ya z@xyE91BW(YDjt0h=GqSf-UI;OCHT#$ABOCH7x29le%?Ujo*MVrE4~AKox(5ND#KrR z2srvg(`LJ3W^|)p0wuF^E`i^SZdiD6I?P5lZ2Uif8{M$*9j*p$bi=}98VA+S`0SDJ z$yj`b>xTmGuXHtjyao7v3g2!C`lIS;eE%uHp^3yFegXJuyyB;B1%80SM_v;}`>XSc z_^rQ$jrozcvV!fQiRs4;WSZ`4HWz@dj@1pyFAC%xxj6Uo0 zllTJUO03V*c0$}1)OkyM@yCE4qWQaFxua_T4r*t-!pA)W{`3Sd6~T=URrrTq!16YQ zA4vZBh{EH;uvF(8rG_5>r_X3&#WeWm!-_xhBH)b)9_>PL{&Th8tBwXfLE&*Tma3ij zCB#oWQR9d`gFiM4_#}AO9He!xOx?`AKO!$A4=FjvS+@5&ByAfZ{)cSc-9+n2KFTVO*X_@X|OOON`v6 zX#)CRP`X_jh_Q~3OyJ^~=$na?D{lZ!ag6B_#7uDu)&6Z=z-K5t#uyntmp1^PsqoTY zuvGe4I*^VFKBB4L)|jdD+xYSmf#ckTrheon-T${f4;=lbsec(W9S^r6cjDQEBBV-~ zss5BkeH-|k1dgV>g5~wL09X|#*#+atZ&&~YSvIp?v75?N^S$?gjILCiXg?=xk`BfT> zT!>Flc=O&^SNT;M_7kkbN5o%^aX0z3dS~GHOjG;|%yb?to`}yl2Aam+gpCwl8u21< zXaPJy7{o znnZqEq;bj{9iKO@1Kz6e1FpnU=hstz2fkS04OIVieqHz@;K(0Lh1`%oih|(x*bcMUz5piXDYn)OIWJ>ikFcNEKTru^aru7{m^$E z)^W@SogE1TH*|d`jzPhDSR*4ZEqE7G8W7xT%{Kz9agU)=dkKW8gZk|7$4v zb2dI>x(%^p>gMf;r5IyC(;eu)uA8MX7~6Q6!tdET8?RY3j^`wJ@y#D*dHofPN&JZf zFFdken%8kB`2q1k)3+vIUDwSgAHaHF0vG;pE!rQdboIGGz|T$aDBc`Po!39u3HW&m zU;Qfti^fmKvBc*qeE7Gq)Z=*UzQ9)~{Dv37pRV+9(s1AxXg>K<>+K_70e+#zNw;;~ zJP0uve=@-fe?gq+ypHdo{-gHO^guIaI&$mEAXomINFu^rR(PQF983n!p9+BbY7RX zBfa{Z!bcu~rOxZ&iERnDiRc2#Ra%&$Yl}90R7}Algpn^(Xs)e}Ukr zxcv@T*LnRo`WRoA;L#3eU}^GtGlgLu-wywzd7a_W@QJXRyteS-df+CnEqs5Bb(+@} zUit=bmDeS@hZkRu&lr*?;3t#Uw=4#}TH!x^EzRrrC5&}^gTkMUv+=qHxe~8Q@Zwtd z!JH5O`V`#lH%1Wb%64Tfo1h`0cdR=fh)11HWD2 zJ5n9c`S`s%fs^iId?#*|<@FN>0*4l0D*XNs%vD~Owm%v8R}(zi5iwxeIeTB=U(@*7 z3~!qc{0@ch{}7hCUiUu_IQC7`RBBJh;pyvu|2v_$EZ+umo!2M)8TefaA95y^x?bOj zT#xTg@L~(bZL{@CKR*r)j_* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mozilla/js/tamarin/MMgc/MMgc_8.sln b/mozilla/js/tamarin/MMgc/MMgc_8.sln new file mode 100644 index 00000000000..a013f982566 --- /dev/null +++ b/mozilla/js/tamarin/MMgc/MMgc_8.sln @@ -0,0 +1,28 @@ +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MMgc", "MMgc_8.vcproj", "{B004A8CC-B3A9-4600-A1A9-EF1BBCF2434B}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug Debugger|Win32 = Debug Debugger|Win32 + Debug|Win32 = Debug|Win32 + Release Debugger|Win32 = Release Debugger|Win32 + Release|Win32 = Release|Win32 + VTune|Win32 = VTune|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B004A8CC-B3A9-4600-A1A9-EF1BBCF2434B}.Debug Debugger|Win32.ActiveCfg = Debug Debugger|Win32 + {B004A8CC-B3A9-4600-A1A9-EF1BBCF2434B}.Debug Debugger|Win32.Build.0 = Debug Debugger|Win32 + {B004A8CC-B3A9-4600-A1A9-EF1BBCF2434B}.Debug|Win32.ActiveCfg = Debug|Win32 + {B004A8CC-B3A9-4600-A1A9-EF1BBCF2434B}.Debug|Win32.Build.0 = Debug|Win32 + {B004A8CC-B3A9-4600-A1A9-EF1BBCF2434B}.Release Debugger|Win32.ActiveCfg = Release Debugger|Win32 + {B004A8CC-B3A9-4600-A1A9-EF1BBCF2434B}.Release Debugger|Win32.Build.0 = Release Debugger|Win32 + {B004A8CC-B3A9-4600-A1A9-EF1BBCF2434B}.Release|Win32.ActiveCfg = Release|Win32 + {B004A8CC-B3A9-4600-A1A9-EF1BBCF2434B}.Release|Win32.Build.0 = Release|Win32 + {B004A8CC-B3A9-4600-A1A9-EF1BBCF2434B}.VTune|Win32.ActiveCfg = VTune|Win32 + {B004A8CC-B3A9-4600-A1A9-EF1BBCF2434B}.VTune|Win32.Build.0 = VTune|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/mozilla/js/tamarin/MMgc/MMgc_8.vcproj b/mozilla/js/tamarin/MMgc/MMgc_8.vcproj new file mode 100644 index 00000000000..fea9c53ab99 --- /dev/null +++ b/mozilla/js/tamarin/MMgc/MMgc_8.vcproj @@ -0,0 +1,531 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mozilla/js/tamarin/MMgc/Makefile b/mozilla/js/tamarin/MMgc/Makefile new file mode 100644 index 00000000000..2970aec58bf --- /dev/null +++ b/mozilla/js/tamarin/MMgc/Makefile @@ -0,0 +1,108 @@ +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# The contents of this file are subject to the Mozilla Public License Version 1.1 (the +# "License"); you may not use this file except in compliance with the License. You may obtain +# a copy of the License at http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +# WARRANTY OF ANY KIND, either express or implied. See the License for the specific +# language governing rights and limitations under the License. +# +# The Original Code is [Open Source Virtual Machine.] +# +# The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +# by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights +# Reserved. +# +# Contributor(s): Adobe AS3 Team +# +# Alternatively, the contents of this file may be used under the terms of either the GNU +# General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +# License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +# LGPL are applicable instead of those above. If you wish to allow use of your version of this +# file only under the terms of either the GPL or the LGPL, and not to allow others to use your +# version of this file under the terms of the MPL, indicate your decision by deleting provisions +# above and replace them with the notice and other provisions required by the GPL or the +# LGPL. If you do not delete the provisions above, a recipient may use your version of this file +# under the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** */ + + +# DEBUG can be set to YES to include debugging info, or NO otherwise +DEBUG := YES + +# DEBUGGER can be set to choose the Content Debugger version of the gc +DEBUGGER := YES + +MMGC_ROOT := . + +CC := gcc +CXX := g++ +AR := ar + +UNAME := $(shell uname) + +ARCH := ${shell uname -m} + +ifeq ($(UNAME),Linux) + MMGC_PLATFORM_DEFS := -DSOFT_ASSERTS -D_DEBUG +endif + +ifeq ($(UNAME),Darwin) + MMGC_PLATFORM_DEFS := -DDARWIN -D_MAC -Dpowerc -DSOFT_ASSERTS -DDEBUGGER -DTARGET_RT_MAC_MACHO=1 -D_DEBUG -DDEBUG + ifeq (${ARCH},i386) + MMGC_PLATFORM_DEFS := ${MMGC_PLATFORM_DEFS} -DAVMPLUS_IA32 + else + MMGC_PLATFORM_DEFS := ${MMGC_PLATFORM_DEFS} -DAVMPLUS_PPC + endif +endif + +ifeq ($(UNAME),CYGWIN_NT-5.1) + MMGC_PLATFORM_DEFS := -DCYGWIN -DAVMPLUS_IA32 +endif + +include makecommon + +#**************************************************************************** +# Targets of the build +#**************************************************************************** + +OUTPUT := libmmgc.a + +all: ${OUTPUT} + +#**************************************************************************** +# Output +#**************************************************************************** + +OBJS := $(addsuffix .o,$(basename ${MMGC_SRCS})) + +${OUTPUT}: ${OBJS} + @echo "=== creating libmmgc.a ===" + ${AR} rcs $@ ${OBJS} + @echo "Done" + +#**************************************************************************** +# Dependencies +#**************************************************************************** + +# Create a lists of object and .d files to create - +# one for each source file in the directory +DEPS := ${patsubst %${strip .cpp},%.d,${MMGC_SRCS}} + +# make any non-existent make files (using the g++ preprocessor) +${DEPS} : %.d : %.cpp + ${CXX} ${MMGC_CXXFLAGS} ${MMGC_INCS} -MM $< > $@ + +# Rules + +clean: + -rm -f core* ${OBJS} ${OUTPUT} ${DEPS} log outputdebug.txt + +ifneq (${MAKECMDGOALS},clean) +ifneq (${UNAME},Linux) +include ${DEPS} # include the generated make files, which make the object files +endif +endif diff --git a/mozilla/js/tamarin/MMgc/Makefile.arm b/mozilla/js/tamarin/MMgc/Makefile.arm new file mode 100644 index 00000000000..21d84275780 --- /dev/null +++ b/mozilla/js/tamarin/MMgc/Makefile.arm @@ -0,0 +1,172 @@ +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# The contents of this file are subject to the Mozilla Public License Version 1.1 (the +# "License"); you may not use this file except in compliance with the License. You may obtain +# a copy of the License at http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +# WARRANTY OF ANY KIND, either express or implied. See the License for the specific +# language governing rights and limitations under the License. +# +# The Original Code is [Open Source Virtual Machine.] +# +# The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +# by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights +# Reserved. +# +# Contributor(s): Adobe AS3 Team +# +# Alternatively, the contents of this file may be used under the terms of either the GNU +# General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +# License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +# LGPL are applicable instead of those above. If you wish to allow use of your version of this +# file only under the terms of either the GPL or the LGPL, and not to allow others to use your +# version of this file under the terms of the MPL, indicate your decision by deleting provisions +# above and replace them with the notice and other provisions required by the GPL or the +# LGPL. If you do not delete the provisions above, a recipient may use your version of this file +# under the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** */ + + +# Set this to yes if doing ARM skunkworks +ARM_SKUNKWORKS := YES + +# Set this to yes for GNUARM +GNUARM := YES + +# DEBUG can be set to YES to include debugging info, or NO otherwise +DEBUG := YES + +CC := arm-elf-gcc +CXX := arm-elf-g++ +AR := arm-elf-ar +RANLIB := arm-elf-ranlib + +UNAME := $(shell uname) + +ifeq ($(UNAME),Linux) + PLATFORM_DEFS := -DAVMPLUS_LINUX -DSOFT_ASSERTS -DDEBUGGER -DAVMPLUS_IA32 -D_DEBUG -DDEBUG -DCYGWIN -DAVMPLUS_IA32 +endif + +ifeq ($(UNAME),Darwin) + PLATFORM_DEFS := -DDARWIN -D_MAC -Dpowerc -DSOFT_ASSERTS -DAVMPLUS_PPC -DDEBUGGER -DTARGET_RT_MAC_MACHO=1 -D_DEBUG -DDEBUG +endif + +ifeq ($(UNAME),CYGWIN_NT-5.1) + PLATFORM_DEFS := -DCYGWIN -DAVMPLUS_IA32 +endif + +ifeq (YES, ${ARM_SKUNKWORKS}) + ifeq (YES, ${GNUARM}) + SOFT_FLOAT := + USE_MMAP := + else + SOFT_FLOAT := -msoft-float + USE_MMAP := -DUSE_MMAP + endif +else + SOFT_FLOAT := + USE_MMAP := -DUSE_MMAP +endif + +ifeq (YES, ${ARM_SKUNKWORKS}) + PLATFORM_DEFS := -DSOFT_ASSERTS -DMMGC_ARM -DAVMPLUS_ARM -DAVMPLUS_UCLINUX -DDEBUGGER -D_DEBUG -DDEBUG +endif + +DEBUG_CFLAGS := -g -MMD +RELEASE_CFLAGS := -O3 -MMD + +DEBUG_CXXFLAGS := ${DEBUG_CFLAGS} -fno-rtti -fcheck-new ${SOFT_FLOAT} ${USE_MMAP} +RELEASE_CXXFLAGS := ${RELEASE_CFLAGS} -fno-rtti -fcheck-new ${SOFT_FLOAT} ${USE_MMAP} + +ifeq (YES, ${DEBUG}) + CFLAGS := ${DEBUG_CFLAGS} + CXXFLAGS := ${DEBUG_CXXFLAGS} +else + CFLAGS := ${RELEASE_CFLAGS} + CXXFLAGS := ${RELEASE_CXXFLAGS} +endif + +#**************************************************************************** +# Preprocessor directives +#**************************************************************************** + +DEFS := -DUNIX ${PLATFORM_DEFS} -DENABLE_PROFILER + +CFLAGS := ${CFLAGS} ${DEFS} +CXXFLAGS := ${CXXFLAGS} ${DEFS} + +#**************************************************************************** +# Include paths +#**************************************************************************** + +INCS := -I. -I../core -I../codegen + +#**************************************************************************** +# Targets of the build +#**************************************************************************** + +OUTPUT := libmmgc.a + +all: ${OUTPUT} + +#**************************************************************************** +# Source files +#**************************************************************************** + +SRCS := GCObject.cpp \ + GCMemoryProfiler.cpp \ + GCLargeAlloc.cpp \ + GCHeapUnix.cpp \ + GCHeap.cpp \ + GCHashtable.cpp \ + GCDebugUnix.cpp \ + GCAllocObjectUnix.cpp \ + GCAllocBase.cpp \ + GCAlloc.cpp \ + GC.cpp \ + FixedMalloc.cpp \ + FixedAlloc.cpp + +#**************************************************************************** +# Output +#**************************************************************************** + +OBJS := $(addsuffix .o,$(basename ${SRCS})) + +${OUTPUT}: ${OBJS} + ${AR} rcs $@ ${OBJS} + ${RANLIB} $@ + @echo "Done" + +#**************************************************************************** +# Dependencies +#**************************************************************************** + +# Create a lists of object and .d files to create - +# one for each source file in the directory +DEPS := $(addsufix .d,$(basename ${SRCS})) + +# make any non-existent make files (using the g++ preprocessor) +${DEPS} : %.d : %.cpp + ${CXX} ${CXXFLAGS} ${INCS} -MM $< > $@ + +#**************************************************************************** +# Rules +#**************************************************************************** + +# Rules for compiling source files to object files +%.o : %.cpp + @echo "=== compiling:" $@ ${OPT} + @${CXX} -c ${OPT} ${CXXFLAGS} ${INCS} $< -o $@ + +clean: + -rm -f core* ${OBJS} ${OUTPUT} ${DEPS} log outputdebug.txt + +ifneq (${MAKECMDGOALS},clean) +ifneq (${UNAME},Linux) +include ${DEPS} # include the generated make files, which make the object files +endif +endif diff --git a/mozilla/js/tamarin/MMgc/WriteBarrier.h b/mozilla/js/tamarin/MMgc/WriteBarrier.h new file mode 100644 index 00000000000..efc37754c7b --- /dev/null +++ b/mozilla/js/tamarin/MMgc/WriteBarrier.h @@ -0,0 +1,188 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 1993-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +// +// GCWriteBarrier +// + +#ifndef _WRITE_BARRIER_H_ +#define _WRITE_BARRIER_H_ + +#ifdef WRITE_BARRIERS + +// inline write barrier +#define WB(gc, container, addr, value) gc->writeBarrier(container, addr, (const void *) (value)) + +// fast manual RC write barrier +#define WBRC(gc, container, addr, value) gc->writeBarrierRC(container, addr, (const void *) (value)) + +// declare write barrier +#define DWB(type) MMgc::WriteBarrier + +// declare an optimized RCObject write barrier +#define DRCWB(type) MMgc::WriteBarrierRC + +#else + +#define WB(gc, container, addr, value) *addr = value + +#define WBRC(gc, container, addr, value) *addr = value + +// declare write barrier +#define DWB(type) type + +#define DVWB(type) type + +#endif + +namespace MMgc +{ + /** + * WB is a smart pointer write barrier meant to be used on any field of a GC object that + * may point to another GC object. A write barrier may only be avoided if if the field is + * const and no allocations occur between the construction of the object holding the field + * and the assignment. + */ + template class WriteBarrier + { + public: + WriteBarrier() {} + WriteBarrier(T t) + { + set(t); + } + + ~WriteBarrier() + { + t = 0; + } + + T operator=(const WriteBarrier& wb) + { + return set(wb.t); + } + + T operator=(T tNew) + { + return set(tNew); + } + + // BEHOLD ... The weird power of C++ operator overloading + operator T() const { return t; } + +#ifdef MMGC_DRC + operator ZeroPtr() const { return t; } +#endif + + bool operator!=(T other) const { return other != t; } + + T operator->() const + { + return t; + } + private: + + // private to prevent its use and someone adding it, GCC creates + // WriteBarrier's on the stack with it + WriteBarrier(const WriteBarrier& toCopy) { GCAssert(false); } + + T set(const T tNew) + { + if(t != tNew || tNew != 0) + GC::WriteBarrier(this, (const void*)tNew); + else + t = tNew; + return tNew; + } + T t; + }; + + /** + * WriteBarrierRC is a write barrier for naked (not pointer swizzled) RC objects. + * the only thing going in and out of the slot is NULL or a valid RCObject + */ + template class WriteBarrierRC + { + public: + WriteBarrierRC() {} + WriteBarrierRC(T t) + { + set(t); + } + + ~WriteBarrierRC() + { + if(t != 0) { + ((RCObject*)t)->DecrementRef(); + t=0; + } + } + + T operator=(const WriteBarrierRC& wb) + { + return set(wb.t); + } + + T operator=(T tNew) + { + return set(tNew); + } + + operator T() const { return t; } + +#ifdef MMGC_DRC + operator ZeroPtr() const { return t; } +#endif + + bool operator!=(T other) const { return other != t; } + + T operator->() const + { + return t; + } + + void Clear() { t = 0; } + private: + + // see note for WriteBarrier + WriteBarrierRC(const WriteBarrierRC& toCopy); + + T set(const T tNew) + { + GC *gc = GC::GetGC(this); + gc->writeBarrierRC(gc->FindBeginning(this), this, (const void*)tNew); + return tNew; + } + T t; + }; +} + +#endif // _WRITE_BARRIER_H_ diff --git a/mozilla/js/tamarin/MMgc/armbuild.h b/mozilla/js/tamarin/MMgc/armbuild.h new file mode 100644 index 00000000000..6f591ec9733 --- /dev/null +++ b/mozilla/js/tamarin/MMgc/armbuild.h @@ -0,0 +1,78 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 1993-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#ifdef DEBUG +#ifndef _DEBUG +#define _DEBUG +#endif +#endif + +/** + * Critical section on GCHeap allocations. + */ +//#define GCHEAP_LOCK + +/** + * Define this to get stack traces. Helps with memory leaks. + */ +#ifdef DEBUG +#define MEMORY_INFO +#endif + +/** + * This turns on incremental collection as well as all of + * the write barriers. + */ +// TODO_LINUX +//#define WRITE_BARRIERS + +/** + * Define this if MMgc is being integrated with avmplus. + * Activates dynamic profiling support, etc. + */ +#define MMGC_AVMPLUS + +/** + * + */ +#define DECOMMIT_MEMORY + +/** + * USE_MMAP not used for ARM skunkworks + */ +//#define USE_MMAP + +/** + * Controls whether DRC is in use + */ + +//#define MMGC_DRC diff --git a/mozilla/js/tamarin/MMgc/linuxbuild.h b/mozilla/js/tamarin/MMgc/linuxbuild.h new file mode 100644 index 00000000000..c032a19d6d2 --- /dev/null +++ b/mozilla/js/tamarin/MMgc/linuxbuild.h @@ -0,0 +1,86 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifdef DEBUG +#ifndef _DEBUG +#define _DEBUG +#endif +#endif + +/** + * Critical section on GCHeap allocations. + */ +#define GCHEAP_LOCK + +/** + * IA-32 + */ +#define MMGC_IA32 + +/** + * Define this to get stack traces. Helps with memory leaks. + */ +#ifdef DEBUG +#define MEMORY_INFO +#endif + +/** + * This turns on incremental collection as well as all of + * the write barriers. + */ +// TODO_LINUX +#define WRITE_BARRIERS + +/** + * Define this if MMgc is being integrated with avmplus. + * Activates dynamic profiling support, etc. + */ +#define MMGC_AVMPLUS + +/** + * + */ +#define DECOMMIT_MEMORY + +/** + * USE_MMAP only for MACHO builds + */ +#if TARGET_RT_MAC_MACHO +#ifndef USE_MMAP +#define USE_MMAP +#endif +#endif + +/** + * Controls whether DRC is in use + */ + +#define MMGC_DRC diff --git a/mozilla/js/tamarin/MMgc/macbuild.h b/mozilla/js/tamarin/MMgc/macbuild.h new file mode 100644 index 00000000000..a11f48facea --- /dev/null +++ b/mozilla/js/tamarin/MMgc/macbuild.h @@ -0,0 +1,94 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 1993-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#ifdef DEBUG +#ifndef _DEBUG +#define _DEBUG +#endif +#endif + +/** + * Critical section on GCHeap allocations. + */ +#define GCHEAP_LOCK + +/** + * PowerPC (MacOS) + */ +#ifdef __i386__ + #define MMGC_IA32 +#else + #define MMGC_PPC +#endif + +#define MMGC_MAC + +/** + * Define this to get stack traces. Helps with memory leaks. + */ +#ifdef DEBUG +#define MEMORY_INFO +#endif + +/** + * This turns on incremental collection as well as all of + * the write barriers. + */ +#define WRITE_BARRIERS + +/** + * Define this if MMgc is being integrated with avmplus. + * Activates dynamic profiling support, etc. + */ +#define MMGC_AVMPLUS + +/** + * + */ +#define DECOMMIT_MEMORY + +/** + * USE_MMAP only for MACHO builds + */ +#if TARGET_RT_MAC_MACHO +#ifndef USE_MMAP +#define USE_MMAP +#endif +#endif + +#define MMGC_DRC + +/** + * This makes JIT code buffers read-only to reduce the probability of + * heap overflow attacks. + */ +#define AVMPLUS_JIT_READONLY diff --git a/mozilla/js/tamarin/MMgc/makecommon b/mozilla/js/tamarin/MMgc/makecommon new file mode 100644 index 00000000000..9392d51bf1e --- /dev/null +++ b/mozilla/js/tamarin/MMgc/makecommon @@ -0,0 +1,95 @@ +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# The contents of this file are subject to the Mozilla Public License Version 1.1 (the +# "License"); you may not use this file except in compliance with the License. You may obtain +# a copy of the License at http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +# WARRANTY OF ANY KIND, either express or implied. See the License for the specific +# language governing rights and limitations under the License. +# +# The Original Code is [Open Source Virtual Machine.] +# +# The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +# by the Initial Developer are Copyright (C)[ 2006 ] Adobe Systems Incorporated. All Rights +# Reserved. +# +# Contributor(s): Adobe AS3 Team +# +# Alternatively, the contents of this file may be used under the terms of either the GNU +# General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +# License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +# LGPL are applicable instead of those above. If you wish to allow use of your version of this +# file only under the terms of either the GPL or the LGPL, and not to allow others to use your +# version of this file under the terms of the MPL, indicate your decision by deleting provisions +# above and replace them with the notice and other provisions required by the GPL or the +# LGPL. If you do not delete the provisions above, a recipient may use your version of this file +# under the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** */ + +MMGC_DEBUG_CFLAGS := -g -MMD +MMGC_RELEASE_CFLAGS := -O3 -MMD + +MMGC_DEBUG_CXXFLAGS := ${MMGC_DEBUG_CFLAGS} -fno-rtti -fcheck-new +MMGC_RELEASE_CXXFLAGS := ${MMGC_RELEASE_CFLAGS} -fno-rtti -fcheck-new + +ifeq (YES, ${DEBUG}) + MMGC_CFLAGS := ${MMGC_DEBUG_CFLAGS} + MMGC_CXXFLAGS := ${MMGC_DEBUG_CXXFLAGS} +else + MMGC_CFLAGS := ${MMGC_RELEASE_CFLAGS} + MMGC_CXXFLAGS := ${MMGC_RELEASE_CXXFLAGS} +endif + +#************************************************************************ +# DEFS +#************************************************************************ + +MMGC_DEFS := ${MMGC_DEFS} -DAVMPLUS_LINUX -DSOFT_ASSERTS -DDEBUGGER -DAVMPLUS_IA32 -DDEBUG -DCYGWIN -DUSE_MMAP -DENABLE_PROFILER -DENABLE_COMPILER + +#************************************************************************ +# Include Paths +#************************************************************************ + +MMGC_INCS := -I${MMGC_ROOT} -I${MMGC_ROOT}/../core -I${MMGC_ROOT}/../codegen + +#**************************************************************************** +# Preprocessor directives +#**************************************************************************** + +MMGC_DEFS := ${MMGC_DEFS} -DUNIX ${MMGC_PLATFORM_DEFS} -DUSE_MMAP -DENABLE_PROFILER +MMGC_CFLAGS := ${MMGC_CFLAGS} ${MMGC_DEFS} +MMGC_CXXFLAGS := ${MMGC_CXXFLAGS} ${MMGC_DEFS} + +#************************************************************************ +# MMgc common files +#************************************************************************ + +MMGC_SRCS := ${MMGC_ROOT}/GCObject.cpp \ + ${MMGC_ROOT}/GCMemoryProfiler.cpp \ + ${MMGC_ROOT}/GCLargeAlloc.cpp \ + ${MMGC_ROOT}/GCHeapUnix.cpp \ + ${MMGC_ROOT}/GCHeap.cpp \ + ${MMGC_ROOT}/GCHashtable.cpp \ + ${MMGC_ROOT}/GCDebugUnix.cpp \ + ${MMGC_ROOT}/GCAllocObjectUnix.cpp \ + ${MMGC_ROOT}/GCAllocBase.cpp \ + ${MMGC_ROOT}/GCAlloc.cpp \ + ${MMGC_ROOT}/GC.cpp \ + ${MMGC_ROOT}/GCTests.cpp \ + ${MMGC_ROOT}/FixedMalloc.cpp \ + ${MMGC_ROOT}/FixedAlloc.cpp + +#************************************************************************ +# MMgc rules +#************************************************************************ + +define mmgc-cmd + @echo "=== compiling MMgc: ===" $@ ${OPT} + @${CXX} -c ${OPT} ${MMGC_CXXFLAGS} ${MMGC_INCS} $< -o $@ +endef + +${MMGC_ROOT}/%.o : ${MMGC_ROOT}/%.cpp + $(mmgc-cmd) diff --git a/mozilla/js/tamarin/MMgc/run_alloc/run_alloc.cpp b/mozilla/js/tamarin/MMgc/run_alloc/run_alloc.cpp new file mode 100644 index 00000000000..56fe7beda25 --- /dev/null +++ b/mozilla/js/tamarin/MMgc/run_alloc/run_alloc.cpp @@ -0,0 +1,67 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include +#include "MMgc.h" + +using namespace MMgc; +using namespace avmplus; + +int main(int argc, char*argv[]) +{ + GCHeap::Init(); + GC *gc = new GC(GCHeap::GetGCHeap()); + int buffer[1024]; + + List allocations(gc, 1024*16, false); + + FILE *file = fopen("alloc.log", "rb"); + int read = 0; + + while((read = fread(buffer, 4, 1024, file)) > 0) + { + for(int i=0; i < read; i++) { + int allocSize = buffer[i]; + + // positive # is alloc, negative is index of alloc to free + if(allocSize > 0) + allocations.add(gc->Alloc(allocSize&~7, allocSize&6)); + else { + int index = -allocSize; + void *obj = allocations[index]; + allocations.set(index, 0); + //gc->Free(obj); + } + } + } + fclose(file); +} diff --git a/mozilla/js/tamarin/MMgc/run_alloc/run_alloc.sln b/mozilla/js/tamarin/MMgc/run_alloc/run_alloc.sln new file mode 100644 index 00000000000..1970ab9ff5d --- /dev/null +++ b/mozilla/js/tamarin/MMgc/run_alloc/run_alloc.sln @@ -0,0 +1,60 @@ +Microsoft Visual Studio Solution File, Format Version 8.00 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "run_alloc", "run_alloc.vcproj", "{AE14C92F-2B7C-4B33-9B2C-425A4152A0A7}" + ProjectSection(ProjectDependencies) = postProject + {B004A8CC-B3A9-4600-A1A9-EF1BBCF2434B} = {B004A8CC-B3A9-4600-A1A9-EF1BBCF2434B} + {437E43D2-ED2D-406B-88DB-B5940F838AE8} = {437E43D2-ED2D-406B-88DB-B5940F838AE8} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MMgc", "..\MMgc.vcproj", "{B004A8CC-B3A9-4600-A1A9-EF1BBCF2434B}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "avmplus", "..\..\platform\win32\avmplus.vcproj", "{437E43D2-ED2D-406B-88DB-B5940F838AE8}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfiguration) = preSolution + Debug = Debug + Debug Debugger = Debug Debugger + Release = Release + Release Debugger = Release Debugger + VTune = VTune + EndGlobalSection + GlobalSection(ProjectConfiguration) = postSolution + {AE14C92F-2B7C-4B33-9B2C-425A4152A0A7}.Debug.ActiveCfg = Debug|Win32 + {AE14C92F-2B7C-4B33-9B2C-425A4152A0A7}.Debug.Build.0 = Debug|Win32 + {AE14C92F-2B7C-4B33-9B2C-425A4152A0A7}.Debug Debugger.ActiveCfg = Debug|Win32 + {AE14C92F-2B7C-4B33-9B2C-425A4152A0A7}.Debug Debugger.Build.0 = Debug|Win32 + {AE14C92F-2B7C-4B33-9B2C-425A4152A0A7}.Release.ActiveCfg = Release|Win32 + {AE14C92F-2B7C-4B33-9B2C-425A4152A0A7}.Release.Build.0 = Release|Win32 + {AE14C92F-2B7C-4B33-9B2C-425A4152A0A7}.Release Debugger.ActiveCfg = Release|Win32 + {AE14C92F-2B7C-4B33-9B2C-425A4152A0A7}.Release Debugger.Build.0 = Release|Win32 + {AE14C92F-2B7C-4B33-9B2C-425A4152A0A7}.VTune.ActiveCfg = VTune|Win32 + {AE14C92F-2B7C-4B33-9B2C-425A4152A0A7}.VTune.Build.0 = VTune|Win32 + {B004A8CC-B3A9-4600-A1A9-EF1BBCF2434B}.Debug.ActiveCfg = Debug|Win32 + {B004A8CC-B3A9-4600-A1A9-EF1BBCF2434B}.Debug.Build.0 = Debug|Win32 + {B004A8CC-B3A9-4600-A1A9-EF1BBCF2434B}.Debug Debugger.ActiveCfg = Debug Debugger|Win32 + {B004A8CC-B3A9-4600-A1A9-EF1BBCF2434B}.Debug Debugger.Build.0 = Debug Debugger|Win32 + {B004A8CC-B3A9-4600-A1A9-EF1BBCF2434B}.Release.ActiveCfg = Release|Win32 + {B004A8CC-B3A9-4600-A1A9-EF1BBCF2434B}.Release.Build.0 = Release|Win32 + {B004A8CC-B3A9-4600-A1A9-EF1BBCF2434B}.Release Debugger.ActiveCfg = Release Debugger|Win32 + {B004A8CC-B3A9-4600-A1A9-EF1BBCF2434B}.Release Debugger.Build.0 = Release Debugger|Win32 + {B004A8CC-B3A9-4600-A1A9-EF1BBCF2434B}.VTune.ActiveCfg = VTune|Win32 + {B004A8CC-B3A9-4600-A1A9-EF1BBCF2434B}.VTune.Build.0 = VTune|Win32 + {437E43D2-ED2D-406B-88DB-B5940F838AE8}.Debug.ActiveCfg = Debug|Win32 + {437E43D2-ED2D-406B-88DB-B5940F838AE8}.Debug.Build.0 = Debug|Win32 + {437E43D2-ED2D-406B-88DB-B5940F838AE8}.Debug Debugger.ActiveCfg = Debug Debugger|Win32 + {437E43D2-ED2D-406B-88DB-B5940F838AE8}.Debug Debugger.Build.0 = Debug Debugger|Win32 + {437E43D2-ED2D-406B-88DB-B5940F838AE8}.Release.ActiveCfg = Release|Win32 + {437E43D2-ED2D-406B-88DB-B5940F838AE8}.Release.Build.0 = Release|Win32 + {437E43D2-ED2D-406B-88DB-B5940F838AE8}.Release Debugger.ActiveCfg = Release Debugger|Win32 + {437E43D2-ED2D-406B-88DB-B5940F838AE8}.Release Debugger.Build.0 = Release Debugger|Win32 + {437E43D2-ED2D-406B-88DB-B5940F838AE8}.VTune.ActiveCfg = VTune|Win32 + {437E43D2-ED2D-406B-88DB-B5940F838AE8}.VTune.Build.0 = VTune|Win32 + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddIns) = postSolution + EndGlobalSection +EndGlobal diff --git a/mozilla/js/tamarin/MMgc/run_alloc/run_alloc.vcproj b/mozilla/js/tamarin/MMgc/run_alloc/run_alloc.vcproj new file mode 100644 index 00000000000..43696420bbd --- /dev/null +++ b/mozilla/js/tamarin/MMgc/run_alloc/run_alloc.vcproj @@ -0,0 +1,188 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mozilla/js/tamarin/MMgc/winbuild.h b/mozilla/js/tamarin/MMgc/winbuild.h new file mode 100644 index 00000000000..90a10f36ac8 --- /dev/null +++ b/mozilla/js/tamarin/MMgc/winbuild.h @@ -0,0 +1,112 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 1993-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +/** + * Critical section on GCHeap allocations. + */ +#define GCHEAP_LOCK + +/** + * IA32 (Intel architecture) + */ +#define MMGC_IA32 + +/** + * Define this to get stack traces. Helps with memory leaks. + */ +#ifdef _DEBUG +#define MEMORY_INFO +#endif + +/** + * This turns on incremental collection as well as all of + * the write barriers. + */ +#define WRITE_BARRIERS + +/** + * Define this if MMgc is being integrated with avmplus. + * Activates dynamic profiling support, etc. + */ +#define MMGC_AVMPLUS + +/** + * Use VirtualAlloc to reserve/commit memory + */ +#define USE_MMAP + +/** + * Define this to track GC pause times + */ +// uncommenting requires you to link with C runtime +//#define GC_STATS + +/** + * Turn this on to decommit memory + */ +#define DECOMMIT_MEMORY + +/** + * Controls whether DRC is in use + */ +#define MMGC_DRC + +/** + * This makes JIT code buffers read-only to reduce the probability of + * heap overflow attacks. + */ +#define AVMPLUS_JIT_READONLY + +/** + * compiled with the /W4 warning level + * which is quite picky. Disable warnings we don't care about. + */ +#ifdef _MSC_VER + + #pragma warning(disable:4512) //assignment operator could not be generated + #pragma warning(disable:4511) //can't generate copy ctor + #pragma warning(disable:4127) //conditional expression is constant + + // enable some that are off even in /W4 mode, but are still handy + #pragma warning(error:4265) // 'class' : class has virtual functions, but destructor is not virtual + #pragma warning(error:4905) // wide string literal cast to 'LPSTR' + #pragma warning(error:4906) // string literal cast to 'LPWSTR' + + // some that might be useful to turn on someday, but would require too much twiddly code tweaking right now +// #pragma warning(error:4263) // 'function' : member function does not override any base class virtual member function +// #pragma warning(error:4264) // 'virtual_function' : no override available for virtual member function from base 'class'; function is hidden +// #pragma warning(error:4266) // 'function' : no override available for virtual member function from base 'type'; function is hidden +// #pragma warning(error:4242) // 'identifier' : conversion from 'type1' to 'type2', possible loss of data +// #pragma warning(error:4263) // member function does not override any base class virtual member function +// #pragma warning(error:4296) // expression is always true (false) (Generally, an unsigned variable was used in a comparison operation with zero.) + +#endif diff --git a/mozilla/js/tamarin/codegen/ArmAssembler.cpp b/mozilla/js/tamarin/codegen/ArmAssembler.cpp new file mode 100644 index 00000000000..b1616be7bab --- /dev/null +++ b/mozilla/js/tamarin/codegen/ArmAssembler.cpp @@ -0,0 +1,1170 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmplus.h" + +//hack +#if !defined(AVMPLUS_SYMBIAN) && !defined(UNDER_CE) +#include +#endif + +#include + +namespace avmplus +{ +#ifdef AVMPLUS_ARM + + #ifdef AVMPLUS_VERBOSE + const char* const ArmAssembler::conditionCodes[] = + { + "eq", + "ne", + "cs", + "cc", + "mi", + "pl", + "vs", + "vc", + "hi", + "ls", + "ge", + "lt", + "gt", + "le", + " ", + "nv" + }; + + const char* const ArmAssembler::regNames[] = + { + "r0", + "r1", + "r2", + "r3", + "r4", + "r5", + "r6", + "r7", + "r8", + "r9", + "r10", + "fp", + "ip", + "sp", + "lr", + "pc" + }; + #endif /* AVMPLUS_VERBOSE */ + + ArmAssembler::ArmAssembler() + { + mip = 0; + mipStart = 0; + mInstructionCount = 0; + #ifdef AVMPLUS_VERBOSE + verboseFlag = false; + #endif + console = 0; + conditionCode = AL; + immediatePool = 0; + immediatePoolCount = 0; + } + + #define PRINT_LAST_INSTRUCTION() + //#define PRINT_LAST_INSTRUCTION() console->format("%A\n", mip[-1]) + + void ArmAssembler::IMM32(int value) + { + #ifdef AVMPLUS_VERBOSE + if (verboseFlag) + console->format(" %A %d // 0x%A\n", mip, value, value); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = value; + } + + void ArmAssembler::MOV(Register dst, Register src) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (verboseFlag) + console->format(" %A mov%s %R, %R\n", mip, conditionCodes[conditionCode], dst, src); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0x01A00000 | (conditionCode<<28) | (dst<<12) | src; + + PRINT_LAST_INSTRUCTION(); + } + + void ArmAssembler::LSL(Register dst, Register src, Register rShift) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (verboseFlag) + console->format(" %A lsl%s %R, %R, %R\n", mip, conditionCodes[conditionCode], dst, src, rShift); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0x01A00010 | (conditionCode<<28) | (dst<<12) | src | (rShift<<8); + + PRINT_LAST_INSTRUCTION(); + } + + void ArmAssembler::LSR(Register dst, Register src, Register rShift) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (verboseFlag) + console->format(" %A lsr%s %R, %R, %R\n", mip, conditionCodes[conditionCode], dst, src, rShift); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0x01A00030 | (conditionCode<<28) | (dst<<12) | src | (rShift<<8); + + PRINT_LAST_INSTRUCTION(); + } + + void ArmAssembler::ASR(Register dst, Register src, Register rShift) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (verboseFlag) + console->format(" %A asr%s %R, %R, %R\n", mip, conditionCodes[conditionCode], dst, src, rShift); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0x01A00050 | (conditionCode<<28) | (dst<<12) | src | (rShift<<8); + + PRINT_LAST_INSTRUCTION(); + } + + void ArmAssembler::LSL_i(Register dst, Register src, int iShift) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (verboseFlag) + console->format(" %A lsl%s %R, %R, %d\n", mip, conditionCodes[conditionCode], dst, src, iShift); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0x01A00000 | (conditionCode<<28) | (dst<<12) | src | (iShift<<7); + + PRINT_LAST_INSTRUCTION(); + } + + void ArmAssembler::LSR_i(Register dst, Register src, int iShift) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (verboseFlag) + console->format(" %A lsr%s %R, %R, %d\n", mip, conditionCodes[conditionCode], dst, src, iShift); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0x01A00020 | (conditionCode<<28) | (dst<<12) | src | (iShift<<7); + + PRINT_LAST_INSTRUCTION(); + } + + void ArmAssembler::ASR_i(Register dst, Register src, int iShift) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (verboseFlag) + console->format(" %A asr%s %R, %R, %d\n", mip, conditionCodes[conditionCode], dst, src, iShift); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0x01A00040 | (conditionCode<<28) | (dst<<12) | src | (iShift<<7); + + PRINT_LAST_INSTRUCTION(); + } + + void ArmAssembler::CMP(Register Rn, Register Rm) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (verboseFlag) + console->format(" %A cmp%s %R, %R\n", mip, conditionCodes[conditionCode], Rn, Rm); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0x01500000 | (conditionCode<<28) | (Rn<<16) | Rm; + + PRINT_LAST_INSTRUCTION(); + } + + void ArmAssembler::ADD(Register dst, Register src1, Register src2) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (verboseFlag) + console->format(" %A add%s %R, %R, %R\n", mip, conditionCodes[conditionCode], dst, src1, src2); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0x00800000 | (conditionCode<<28) | (dst<<12) | (src1<<16) | src2; + + PRINT_LAST_INSTRUCTION(); + } + + void ArmAssembler::AND(Register dst, Register src1, Register src2) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (verboseFlag) + console->format(" %A and%s %R, %R, %R\n", mip, conditionCodes[conditionCode], dst, src1, src2); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0x00000000 | (conditionCode<<28) | (dst<<12) | (src1<<16) | src2; + + PRINT_LAST_INSTRUCTION(); + } + + void ArmAssembler::ORR(Register dst, Register src1, Register src2) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (verboseFlag) + console->format(" %A orr%s %R, %R, %R\n", mip, conditionCodes[conditionCode], dst, src1, src2); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0x01800000 | (conditionCode<<28) | (dst<<12) | (src1<<16) | src2; + + PRINT_LAST_INSTRUCTION(); + } + + void ArmAssembler::EOR(Register dst, Register src1, Register src2) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (verboseFlag) + console->format(" %A eor%s %R, %R, %R\n", mip, conditionCodes[conditionCode], dst, src1, src2); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0x00200000 | (conditionCode<<28) | (dst<<12) | (src1<<16) | src2; + + PRINT_LAST_INSTRUCTION(); + } + + void ArmAssembler::MUL(Register dst, Register src1, Register src2) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (verboseFlag) + console->format(" %A mul%s %R, %R, %R\n", mip, conditionCodes[conditionCode], dst, src1, src2); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0x00000090 | (conditionCode<<28) | (dst<<16) | (src1<<8) | src2; + + PRINT_LAST_INSTRUCTION(); + } + + void ArmAssembler::SUB(Register dst, Register src1, Register src2) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (verboseFlag) + console->format(" %A sub%s %R, %R, %R\n", mip, conditionCodes[conditionCode], dst, src1, src2); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0x00400000 | (conditionCode<<28) | (dst<<12) | (src1<<16) | src2; + + PRINT_LAST_INSTRUCTION(); + } + + void ArmAssembler::STMFD_bang(Register dst, int mask) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (verboseFlag) + console->format(" %A stmfd%s %R!, %A\n", mip, conditionCodes[conditionCode], dst, mask); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0x09200000 | (conditionCode<<28) | (dst<<16) | mask; + + PRINT_LAST_INSTRUCTION(); + } + + void ArmAssembler::SUB_imm8(Register dst, Register src, int imm8) + { + AvmAssert((imm8 & 0xFFFFFF00) == 0); + + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (verboseFlag) + console->format(" %A sub%s %R, %R, %d\n", mip, conditionCodes[conditionCode], dst, src, imm8); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0x02400000 | (conditionCode<<28) | (src<<16) | (dst<<12) | (imm8&0xFF); + PRINT_LAST_INSTRUCTION(); + } + + void ArmAssembler::EOR_imm8(Register dst, Register src, int imm8) + { + AvmAssert((imm8 & 0xFFFFFF00) == 0); + + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (verboseFlag) + console->format(" %A eor%s %R, %R, %d\n", mip, conditionCodes[conditionCode], dst, src, imm8); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0x02200000 | (conditionCode<<28) | (src<<16) | (dst<<12) | (imm8&0xFF); + PRINT_LAST_INSTRUCTION(); + } + + void ArmAssembler::ORR_imm8(Register dst, Register src, int imm8) + { + AvmAssert((imm8 & 0xFFFFFF00) == 0); + + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (verboseFlag) + console->format(" %A orr%s %R, %R, %d\n", mip, conditionCodes[conditionCode], dst, src, imm8); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0x03800000 | (conditionCode<<28) | (src<<16) | (dst<<12) | (imm8&0xFF); + PRINT_LAST_INSTRUCTION(); + } + + void ArmAssembler::RSB_imm8(Register dst, Register src, int imm8) + { + AvmAssert((imm8 & 0xFFFFFF00) == 0); + + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (verboseFlag) + console->format(" %A rsb%s %R, %R, %d\n", mip, conditionCodes[conditionCode], dst, src, imm8); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0x02600000 | (conditionCode<<28) | (src<<16) | (dst<<12) | (imm8&0xFF); + PRINT_LAST_INSTRUCTION(); + } + + void ArmAssembler::BL(int offset24) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (verboseFlag) + console->format(" %A bl%s %A\n", mip, conditionCodes[conditionCode], offset24); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0x0B000000 | (conditionCode<<28) | ((offset24-8)>>2)&0xFFFFFF; + PRINT_LAST_INSTRUCTION(); + } + + void ArmAssembler::B(int offset24) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (verboseFlag) + console->format(" %A b%s %A\n", mip, conditionCodes[conditionCode], offset24); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0x0A000000 | (conditionCode<<28) | ((offset24-8)>>2)&0xFFFFFF; + PRINT_LAST_INSTRUCTION(); + } + + void ArmAssembler::LDR(Register dst, int offset, Register base) + { + int off = offset; + int opcode; + if (off<0) { + off = -off; + opcode = 0x05100000; + } else { + opcode = 0x05900000; + } + + if (off > 0xFFF) + { + AvmAssert(base != IP); + AvmAssert(base != PC); + MOV_imm32(IP, off); + off = (int)IP; + opcode |= 0x02000000; + } + + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (verboseFlag) { + if (base == PC) { + console->format(" %A ldr%s %R, %d(%R) // %A\n", + mip, conditionCodes[conditionCode], dst, offset, base, offset+8+(int)mip); + } else if (opcode & 0x02000000) { + console->format(" %A ldr%s %R, %R(%R)\n", mip, conditionCodes[conditionCode], dst, off, base); + } else { + console->format(" %A ldr%s %R, %d(%R)\n", mip, conditionCodes[conditionCode], dst, offset, base); + } + } + #endif /* AVMPLUS_VERBOSE */ + AvmAssert(off <= 0xFFF); + *mip++ = opcode | (conditionCode<<28) | (base<<16) | (dst<<12) | (off&0xFFF); + PRINT_LAST_INSTRUCTION(); + } + + void ArmAssembler::BIC_imm8(Register dst, Register src, int imm8) + { + AvmAssert((imm8 & 0xFFFFFF00) == 0); + + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (verboseFlag) + console->format(" %A bic%s %R, %R, %d\n", mip, conditionCodes[conditionCode], dst, src, imm8); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0x03C00000 | (conditionCode<<28) | (src<<16) | (dst<<12) | (imm8&0xFF); + PRINT_LAST_INSTRUCTION(); + } + + void ArmAssembler::MOV_imm8(Register dst, int imm8) + { + AvmAssert((imm8 & 0xFFFFFF00) == 0); + + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (verboseFlag) + console->format(" %A mov%s %R, %d\n", mip, conditionCodes[conditionCode], dst, imm8); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0x03A00000 | (conditionCode<<28) | (dst<<12) | (imm8&0xFF); + PRINT_LAST_INSTRUCTION(); + } + + void ArmAssembler::MOV_imm16(Register dst, int imm16) + { + AvmAssert((imm16 & 0xFFFF0000) == 0); + + MOV_imm8 (dst, imm16 & 0xFF); + + if (imm16 & 0xFF00) + { + ADD_imm8_hi (dst, dst, (imm16 >> 8) & 0xFF); + } + } + + void ArmAssembler::ADD_imm16(Register dst, Register src, int imm16) + { + AvmAssert((imm16 & 0xFFFF0000) == 0); + + ADD_imm8 (dst, src, imm16 & 0xFF); + + if (imm16 & 0xFF00) + { + ADD_imm8_hi (dst, dst, (imm16 >> 8) & 0xFF); + } + } + + // Cheesy macro for doing IMM32. Needs work. + void ArmAssembler::MOV_imm32(Register dst, int imm32) + { + if ((imm32&0xFFFF0000) == 0) + { + // Use imm8/imm16 instead + MOV_imm16(dst, imm32); + return; + } + + // If there is still immediate pool available, and it is in range of LDR, + // use it. + if (immediatePool != 0 && mip-immediatePool < 500) + { + // Use existing immediate pool + } + else + { + // Allocate immediate pool + + // - Branch to instruction after immediate pool + B(4+kImmediatePoolMax*4); + + // - New immediate pool starts here + immediatePool = mip; + immediatePoolCount = kImmediatePoolMax; + mip += immediatePoolCount; + } + + MDInstruction *savedMip = mip; + mip = immediatePool; + + // Write the constant + IMM32(imm32); + + mip = savedMip; + + // Load the constant (-8 due to ARM pipeline's +8 bias) + LDR(dst, -8-(mip-immediatePool)*4, PC); + + immediatePool++; + if (!--immediatePoolCount) + { + immediatePool = 0; + } + } + + void ArmAssembler::CMP_imm8(Register src, int imm8) + { + AvmAssert((imm8 & 0xFFFFFF00) == 0); + + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (verboseFlag) + console->format(" %A cmp%s %R, %d\n", mip, conditionCodes[conditionCode], src, imm8); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0x03500000 | (conditionCode<<28) | (src<<16) | (imm8&0xFF); + PRINT_LAST_INSTRUCTION(); + } + + void ArmAssembler::STR(Register src, int offset, Register base) + { + int off = offset; + int opcode; + if (off<0) { + off = -off; + opcode = 0x05000000; + } else { + opcode = 0x05800000; + } + + if (off > 0xFFF) + { + AvmAssert(base != IP); + AvmAssert(src != IP); + AvmAssert(base != PC); + MOV_imm32(IP, off); + off = (int)IP; + opcode |= 0x02000000; + } + + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (verboseFlag) { + if (base == PC) { + console->format(" %A str%s %R, %d(%R) // %A\n", mip, conditionCodes[conditionCode], src, offset, base, + offset+8+(int)mip); + } else if (opcode & 0x02000000) { + console->format(" %A str%s %R, %R(%R)\n", mip, conditionCodes[conditionCode], src, off, base); + } else { + console->format(" %A str%s %R, %d(%R)\n", mip, conditionCodes[conditionCode], src, offset, base); + } + } + #endif /* AVMPLUS_VERBOSE */ + AvmAssert(off <= 0xFFF); + *mip++ = opcode | (conditionCode<<28) | (base<<16) | (src<<12) | (off&0xFFF); + PRINT_LAST_INSTRUCTION(); + } + + void ArmAssembler::ADD_imm8(Register dst, Register src, int imm8) + { + AvmAssert((imm8 & 0xFFFFFF00) == 0); + + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (verboseFlag) + console->format(" %A add%s %R, %R, %d\n", mip, conditionCodes[conditionCode], dst, src, imm8); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0x02800000 | (conditionCode<<28) | (src<<16) | (dst<<12) | (imm8&0xFF); + PRINT_LAST_INSTRUCTION(); + } + + void ArmAssembler::ADD_imm8_hi(Register dst, Register src, int imm8) + { + AvmAssert((imm8 & 0xFFFFFF00) == 0); + + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (verboseFlag) + console->format(" %A add%s %R, %R, %d\n", mip, conditionCodes[conditionCode], dst, src, imm8 << 8); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0x02800C00 | (conditionCode<<28) | (src<<16) | (dst<<12) | (imm8&0xFF); + PRINT_LAST_INSTRUCTION(); + } + + void ArmAssembler::AND_imm8(Register dst, Register src, int imm8) + { + AvmAssert((imm8 & 0xFFFFFF00) == 0); + + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (verboseFlag) + console->format(" %A and%s %R, %R, %d\n", mip, conditionCodes[conditionCode], dst, src, imm8); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0x02000000 | (conditionCode<<28) | (src<<16) | (dst<<12) | (imm8&0xFF); + PRINT_LAST_INSTRUCTION(); + } + + void ArmAssembler::LDMFD(Register src, int mask) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (verboseFlag) + console->format(" %A ldmfd%s %R, %A\n", mip, conditionCodes[conditionCode], src, mask); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0x08900000 | (conditionCode<<28) | (src<<16) | mask; + PRINT_LAST_INSTRUCTION(); + } + + void ArmAssembler::LDMFD_bang(Register src, int mask) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (verboseFlag) + console->format(" %A ldmfd%s! %R, %A\n", mip, conditionCodes[conditionCode], src, mask); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0x08B00000 | (conditionCode<<28) | (src<<16) | mask; + PRINT_LAST_INSTRUCTION(); + } + + void ArmAssembler::SET_CONDITION_CODE(ConditionCode conditionCode) + { + this->conditionCode = conditionCode; + } + +#ifdef AVMPLUS_MIR + + void CodegenMIR::emitNativeThunk(NativeMethod *info) + { + SET_CONDITION_CODE(AL); + + // Hack to see what instructions we're generating + //bool hack = true; + //verboseFlag = true; + //core->console << " native thunk for " << info << "\n"; + + const Register TEMP = R7; + const Register AP = R6; + const Register ARGC = R5; +#ifdef DEBUGGER + const Register ENV = R4; + const Register SAVE0 = R5; + const Register SAVE1 = R6; + const int NonVolatileMask = R4_mask | R5_mask | R6_mask | R7_mask; + const int NonVolatileCount = 4; +#else + const int NonVolatileMask = R5_mask | R6_mask | R7_mask; + const int NonVolatileCount = 3; +#endif + + if (!pool) + core->console << "no pool " << info << "\n"; + + code = getMDBuffer(pool); + mip = (MDInstruction*)code; + if (!code) + { + overflow = true; + return; + } + +#ifdef FEATURE_BUFFER_GUARD + GrowthGuard guard(pool->codeBuffer); +#else + if (!ensureMDBufferCapacity(pool, md_native_thunk_size)) + return; +#endif /* FEATURE_BUFFER_GUARD */ + + int in_arg_offset = 0; + + const int kMaxGPRIndex = 4; + + #ifdef DEBUGGER + uint32 *sendEnterAddr = mip; + IMM32(ENVADDR(MethodEnv::sendEnter)); + + uint32 *sendExitAddr = mip; + IMM32(ENVADDR(MethodEnv::sendExit)); + #endif + +#ifdef _MSC_VER + uint32 *handlerAddr = mip; + IMM32(info->m_handler_addr); +#else + union { + int handler_addr[2]; + NativeMethod::Handler handler; + }; + handler = info->m_handler; + + uint32 *handlerAddr = mip; + IMM32(handler_addr[1]); +#endif + + // scan for double optional arguments; these will + // be constants stored up front + uint32 *const_ip = mip; + int first_optional = 1+info->param_count-info->optional_count; + for (int i=first_optional; i <= info->param_count; i++) + { + Traits* type = info->paramTraits(i); + Atom arg = info->getDefaultValue(i-first_optional); + + if (type == OBJECT_TYPE || type == VOID_TYPE) + { + IMM32(arg); + } + else if (type == BOOLEAN_TYPE) + { + IMM32(arg>>3); + } + else if (type == NUMBER_TYPE) + { + double d = core->number_d(arg); + int *dp = (int*)&d; + IMM32(dp[0]); + IMM32(dp[1]); + } + else if (type == INT_TYPE) + { + int i = core->integer_i(arg); + IMM32(i); + } + else if (type == UINT_TYPE) + { + uint32 u = core->integer_u(arg); + IMM32(u); + } + else + { + // push pointer type + // this case includes kStringType, kObjectType, and kNamespaceType + int p = (arg&7)==kSpecialType ? 0 : arg & ~7; + IMM32(p); + } + } + + mipStart = mip; + + // prologue + MOV (IP, SP); + + // save callee-saved registers + STMFD_bang (SP, NonVolatileMask | FP_mask | IP_mask | LR_mask | PC_mask); + SUB_imm8 (FP, IP, 4); + + // the frame size will be updated later + uint32 *patch_frame_size = mip; + SUB_imm8 (SP, SP, 0); + + // set up other registers + MOV (AP, R2); + MOV (ARGC, R1); +#ifdef DEBUGGER + MOV (ENV, R0); +#endif + +#ifdef DEBUGGER + //MOV (R0, ENV); + //MOV (R1, ARGC); + //MOV (R2, AP); + LDR (IP, (int)sendEnterAddr-(int)mip-8, PC); + MOV (LR, PC); + MOV (PC, IP); + //thincall(ENVADDR(MethodEnv::sendEnter)); +#endif + + // Push receiver object as first argument +#ifdef NATIVE_GLOBAL_FUNCTION_HACK + // hack - native toplevel functions get invoked with user defined receiver + // but are expecting the global object. this hack is totally unsound + // because it gives users the power to crash the vm. we need to either + // directly support toplevel native functions, or not use them. + LDR (R0, 0, AP); // this is ap[0] + BIC_imm (R0, R0, 7); +#else + LDR (R0, 0, AP); // this is ap[0] +#endif + in_arg_offset += 4; + int GPRIndex = 1; + + bool need_rest = ((info->flags & AbstractFunction::NEED_REST) != 0); + + if (info->flags & AbstractFunction::NATIVE_COOKIE) + { + MOV_imm8 (R1, info->m_cookie); + GPRIndex++; + } + + // push args left to right + for (int i=1; i <= info->param_count; i++) + { + // param 0 is receiver, real params start at 1 + Traits* type = info->paramTraits(i); + + if (i >= first_optional) { +#ifdef AVMPLUS_VERBOSE + if (verboseFlag) core->console << "optional " << i << "\n"; +#endif /* AVMPLUS_VERBOSE */ + // emit code to check whether argument + // was specified + CMP_imm8 (ARGC, i); + + SET_CONDITION_CODE(LT); + + // emit code to push the default value + Atom arg = info->getDefaultValue(i-first_optional); + + // the arguments have already been coerced to the right type + // by the caller. We do not do type conversions here. + + int offset = (int)const_ip - (int)mip - 8; // -8 for pc-relative bias + + if (type == NUMBER_TYPE) + { + // Do first word of double + if (GPRIndex < kMaxGPRIndex) { + LDR ((Register)(R0+GPRIndex), offset, PC); + } else { + LDR (TEMP, offset, PC); + STR (TEMP, (GPRIndex-kMaxGPRIndex)*4, SP); + } + + // Do second word of double + if ((GPRIndex+1) < kMaxGPRIndex) { + LDR ((Register)(R0+GPRIndex+1), offset+4, PC); + } else { + LDR (TEMP, offset+4, PC); + STR (TEMP, (GPRIndex+1-kMaxGPRIndex)*4, SP); + } + + const_ip += 2; + } + else + { + if (GPRIndex < kMaxGPRIndex) { + LDR ((Register)(R0+GPRIndex), offset, PC); + } else { + LDR (TEMP, offset, PC); + STR (TEMP, (GPRIndex-kMaxGPRIndex)*4, SP); + } + + const_ip++; + } + + SET_CONDITION_CODE(GE); + } + + // Generate the code for the non-optional case. + // these args will already be converted to native form by the caller + if (type == NUMBER_TYPE) + { + // Copy first word of double + if (GPRIndex < kMaxGPRIndex) { + LDR((Register)(R0+GPRIndex), in_arg_offset, AP); + } else { + LDR(TEMP, in_arg_offset, AP); + STR(TEMP, (GPRIndex-kMaxGPRIndex)*4, SP); + } + GPRIndex++; + in_arg_offset += 4; + + // Copy second word of double + if (GPRIndex < kMaxGPRIndex) { + LDR((Register)(R0+GPRIndex), in_arg_offset, AP); + } else { + LDR(TEMP, in_arg_offset, AP); + STR(TEMP, (GPRIndex-kMaxGPRIndex)*4, SP); + } + + GPRIndex++; + in_arg_offset += 4; + } + else + { + // push general type + // this case includes everything except Number/double + if (GPRIndex < kMaxGPRIndex) { + LDR((Register)(R0+GPRIndex), in_arg_offset, AP); + } else { + LDR(TEMP, in_arg_offset, AP); + STR(TEMP, (GPRIndex-kMaxGPRIndex)*4, SP); + } + in_arg_offset += 4; + GPRIndex++; + } + + SET_CONDITION_CODE(AL); + } + + if (need_rest) { +#ifdef AVMPLUS_VERBOSE + if (verboseFlag) + core->console << "need_rest\n"; +#endif /* AVMPLUS_VERBOSE */ + // If the method signature ends with "...", + // deliver any arguments after the explicitly + // specified ones as (Atom *argv, int argc) + + // rest_count = argc-param_count + CMP_imm8 (ARGC, info->param_count); + SET_CONDITION_CODE (LT); + + // rest_count<0, push argc=0, argv=NULL + + // push argc + if (GPRIndex < kMaxGPRIndex) { + MOV_imm8((Register)(R0+GPRIndex), 0); + } else { + MOV_imm8(TEMP, 0); + STR(TEMP, (GPRIndex-kMaxGPRIndex)*4, SP); + } + + // push argv + if ((GPRIndex+1) < kMaxGPRIndex) { + MOV_imm8((Register)(R0+GPRIndex+1), 0); + } else { + MOV_imm8(TEMP, 0); + STR(TEMP, (GPRIndex+1-kMaxGPRIndex)*4, SP); + } + + SET_CONDITION_CODE(GE); + + // rest_count>=0 + // push rest_count + // push rest_argv = argv+param_count + + // push argv + if (GPRIndex < kMaxGPRIndex) { + ADD_imm8((Register)(R0+GPRIndex), AP, info->restOffset); + } else { + ADD_imm8(TEMP, AP, info->restOffset); + STR(TEMP, (GPRIndex-kMaxGPRIndex)*4, SP); + } + GPRIndex++; + + // push argc + if (GPRIndex < kMaxGPRIndex) { + SUB_imm8((Register)(R0+GPRIndex), ARGC, info->param_count); + } else { + SUB_imm8(TEMP, ARGC, info->param_count); + STR(TEMP, (GPRIndex-kMaxGPRIndex)*4, SP); + } + GPRIndex++; + + SET_CONDITION_CODE(AL); + } + + // all args have been pushed, now call function using thiscall calling conventions + Traits* type = info->returnTraits(); + + LDR (IP, (int)handlerAddr-(int)mip-8, PC); + MOV (LR, PC); + MOV (PC, IP); + //thincall(handler_addr); + +#ifdef DEBUGGER + if (type == NUMBER_TYPE) + { + // result is in R0, R1. Store in nonvolatile while + // we call sendExit. + MOV (SAVE0, R0); + MOV (SAVE1, R1); + } + else + { + // result is in R0. Store in nonvolatile while we + // call sendExit. + MOV (SAVE0, R0); + } + + MOV (R0, ENV); + LDR (IP, (int)sendExitAddr-(int)mip-8, PC); + MOV (LR, PC); + MOV (PC, IP); + //thincall(ENVADDR(MethodEnv::sendExit)); + + if (type == NUMBER_TYPE) + { + MOV (R0, SAVE0); + MOV (R1, SAVE1); + } + else + { + MOV (R0, SAVE0); + } +#endif + + if (type != NUMBER_TYPE) + { + // result in R3 + if (type == BOOLEAN_TYPE) + { + // return value already in R3 + // bool is just a byte, so mask it off + AND_imm8 (R0, R0, 255); + } + else if (type == VOID_TYPE) + { + MOV_imm8 (R0, undefinedAtom); + } + } + // else, result in FPU register F1 + + // epilogue + SUB_imm8 (SP, FP, 12 + NonVolatileCount * 4); + LDMFD (SP, NonVolatileMask | FP_mask | SP_mask | PC_mask); + + // Patch up the frame size. + // For each arg, we need 4 bytes in the called parameter + // area. We also leave a little cushion in the called + // parameter area, since there are a few other function + // calls the thunk makes (intToAtom, doubleToAtom) + if (GPRIndex > kMaxGPRIndex) + { + int frameSize = (GPRIndex-kMaxGPRIndex)*4; + *patch_frame_size |= (frameSize & 0xFF); + } + + bindMethod(info); + + //if (hack) + //verboseFlag = false; + } + + void ArmAssembler::flushDataCache(void *start, int len) + { + #ifdef AVMPLUS_SYMBIAN + + // Adjust start and len to page boundaries + start = (void*) ((int)start & ~0xFFF); + len = (len+8192) & ~0xFFF; + void *end = (void*)((int)start+len); + + User::IMB_Range(start, end); + + #elif defined AVMPLUS_IYONIX + + // Adjust start and len to page boundaries + start = (void*) ((int)start & ~0xFFF); + len = (len+8192) & ~0xFFF; + void *end = (void*)((int)start+len); + + register unsigned long _beg __asm ("a1") = (unsigned long)(start); + register unsigned long _end __asm ("a2") = (unsigned long)(end); + register unsigned long _flg __asm ("a3") = 0; + __asm __volatile ("swi 0x9f0002 @ sys_cacheflush" + : /* no outputs */ + : /* no inputs */ + : "a1"); + + #elif defined(UNDER_CE) + + // This seems to work, but might not be correct + // Might be better to call CacheSync(...) + FlushInstructionCache(GetCurrentProcess(), 0, 0); + + #else + + // Flush the data cache crudely + #define SCRATCH_SIZE 32768 + volatile int scratch[SCRATCH_SIZE]; + int sum = 0; + for (int i=0; icodeBuffer); +#else + if (!ensureMDBufferCapacity(pool, md_native_thunk_size)) + return NULL; +#endif /* FEATURE_BUFFER_GUARD */ + + // the generated thunk does not call any helper methods, so we are + // free to use eax, ecx, edx as scratch regs without touchning the + // stack. + + // in: R0 = MethodEnv for interface thunk + // R1 = argc + // R2 = ap + // R3 = iid + // 0(ap) = ScriptObject (concrete instance of class) + +#ifdef AVMPLUS_VERBOSE + if (pool->verbose) + { + core->console << "imt thunk\n"; + } +#endif + + AvmAssert(e->next != NULL); // must have 2 or more entries + + while (e->next) + { + ImtBuilder::ImtEntry *next = e->next; + + #ifdef AVMPLUS_VERBOSE + if (pool->verbose) + { + core->console << " disp_id="<< e->disp_id << " " << e->virt << "\n"; + } + #endif + + MOV_imm32(IP, e->virt->iid()); + CMP(R3, IP); + + SET_CONDITION_CODE(EQ); + LDR (IP, 0, R2); // obj + LDR (IP, offsetof(ScriptObject, vtable), IP); // vtable + LDR (R0, offsetof(VTable,methods)+4*e->disp_id, IP); // load concrete env + LDR (PC, offsetof(MethodEnv, impl32), R0); // invoke real method indirectly + SET_CONDITION_CODE(AL); + + pool->core->gc->Free(e); + e = next; + } + + // last one is unconditional + #ifdef AVMPLUS_VERBOSE + if (pool->verbose) + { + core->console << " disp_id="<< e->disp_id << " " << e->virt << "\n"; + } + #endif + LDR (IP, 0, R2); // obj + LDR (IP, offsetof(ScriptObject, vtable), IP); // vtable + LDR (R0, offsetof(VTable,methods)+4*e->disp_id, IP); // load concrete env + LDR (PC, offsetof(MethodEnv, impl32), R0); // invoke real method indirectly + + MDInstruction *retval; + + retval = mipStart; + + // lock in the next available location in the buffer (16B aligned) + pool->codeBuffer->setPos((byte*) ( (size_t)mip+15 & ~15 )); + + return retval; + } + + bool CodegenMIR::canImmFold(OP* ins, OP* rhs) const + { + if (rhs->code != MIR_imm) + return false; + if (rhs->imm & 0xFFFFFF00) + return false; + switch (ins->code) + { + case MIR_add: + return (rhs->imm & 0xFFFF0000) == 0; + case MIR_and: + case MIR_or: + case MIR_xor: + case MIR_sub: + return (rhs->imm & 0xFFFFFF00) == 0; + case MIR_lsh: + case MIR_rsh: + case MIR_ush: + return true; + } + return false; + } +#endif /* AVMPLUS_MIR */ + +#endif /* AVMPLUS_ARM */ +} diff --git a/mozilla/js/tamarin/codegen/ArmAssembler.h b/mozilla/js/tamarin/codegen/ArmAssembler.h new file mode 100644 index 00000000000..1cf9a7a4340 --- /dev/null +++ b/mozilla/js/tamarin/codegen/ArmAssembler.h @@ -0,0 +1,224 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_ArmAssembler__ +#define __avmplus_ArmAssembler__ + + +namespace avmplus +{ + class ArmAssembler + { + public: + /* ARM registers */ + typedef enum + { + R0 = 0, + R1 = 1, + R2 = 2, + R3 = 3, + R4 = 4, + R5 = 5, + R6 = 6, + R7 = 7, + R8 = 8, + R9 = 9, + R10 = 10, + FP = 11, + IP = 12, + SP = 13, + LR = 14, + PC = 15, + + // Pseudo-register for floating point + F0 = 0, + + Unknown = -1 + } + Register; + + /* ARM registers */ + typedef enum + { + R0_mask = (1<<0), + R1_mask = (1<<1), + R2_mask = (1<<2), + R3_mask = (1<<3), + R4_mask = (1<<4), + R5_mask = (1<<5), + R6_mask = (1<<6), + R7_mask = (1<<7), + R8_mask = (1<<8), + R9_mask = (1<<9), + R10_mask = (1<<10), + FP_mask = (1<<11), + IP_mask = (1<<12), + SP_mask = (1<<13), + LR_mask = (1<<14), + PC_mask = (1<<15) + } + RegisterMask; + + /* ARM condition codes */ + typedef enum + { + EQ = 0x0, // Equal + NE = 0x1, // Not Equal + CS = 0x2, // Carry Set (or HS) + CC = 0x3, // Carry Clear (or LO) + MI = 0x4, // MInus + PL = 0x5, // PLus + VS = 0x6, // oVerflow Set + VC = 0x7, // oVerflow Clear + HI = 0x8, // HIgher + LS = 0x9, // Lower or Same + GE = 0xA, // Greater or Equal + LT = 0xB, // Less Than + GT = 0xC, // Greater Than + LE = 0xD, // Less or Equal + AL = 0xE, // ALways + NV = 0xF // NeVer + } + ConditionCode; + + /* --- Data Processing Instructions --- */ + + /* Values for operator "a" */ + typedef enum + { + AND_op = 0x0, // Boolean And Rd = Rn AND Op2 + EOR_op = 0x1, // Boolean Eor Rd = Rn EOR Op2 + SUB_op = 0x2, // Subtract Rd = Rn - Op2 + RSB_op = 0x3, // Reverse Subtract Rd = Op2 - Rn + ADD_op = 0x4, // Addition Rd = Rn + Op2 + ADC_op = 0x5, // Add with Carry Rd = Rn + Op2 + C + SBC_op = 0x6, // Subtract with Carry Rd = Rn - Op2 - (1-C) + RSC_op = 0x7, // Reverse Subtract with Carry Rd - Op2 - Rn - (1-C) + TST_op = 0x8, // Test bit Rn AND Op2 + TEQ_op = 0x9, // Test equality Rn EOR Op2 + CMP_op = 0xA, // Compare Rn - Op2 + CMN_op = 0xB, // Compare Negative Rn + Op2 + ORR_op = 0xC, // Boolean Or Rd = Rn OR Op2 + MOV_op = 0xD, // Move value Rd = Op2 + BIC_op = 0xE, // Bit Clear Rd = Rn AND NOT Op2 + MVN_op = 0xF // Move Not Rd = NOT Op2 + } + Operator; + + /* Values for operand "t" */ + typedef enum + { + LSL_imm = 0, // LSL #c - Logical Shift Left + LSL_reg = 1, // LSL Rc - Logical Shift Left + LSR_imm = 2, // LSR #c - Logical Shift Right + LSR_reg = 3, // LSR Rc - Logical Shift Right + ASR_imm = 4, // ASR #c - Arithmetic Shift Right + ASR_reg = 5, // ASR Rc - Arithmetic Shift Right + ROR_imm = 6, // Rotate Right (c != 0) + RRX = 6, // Rotate Right one bit with extend (c == 0) + ROR_reg = 7 // Rotate Right + } + ShiftOperator; + + typedef uint32 MDInstruction; + + /* Instruction pointer */ + MDInstruction *mip; + MDInstruction *mipStart; + + int mInstructionCount; // number of machine instructions + #define incInstructionCount() mInstructionCount++ + + /* Current condition code */ + ConditionCode conditionCode; + + ArmAssembler(); + + void SET_CONDITION_CODE(ConditionCode conditionCode); + + void IMM32(int value); + void MOV(Register dst, Register src); + void STMFD_bang(Register dst, int mask); + void SUB_imm8(Register dst, Register src, int imm8); + void RSB_imm8(Register dst, Register src, int imm8); + void B(int offset24); + void BL(int offset24); + void LDR(Register dst, int offset, Register base); + void BIC_imm8(Register dst, Register src, int imm8); + void MOV_imm8(Register dst, int imm8); + void MOV_imm16(Register dst, int imm16); + void CMP_imm8(Register src, int imm8); + void ADD(Register dst, Register src1, Register src2); + void SUB(Register dst, Register src1, Register src2); + void AND(Register dst, Register src1, Register src2); + void ORR(Register dst, Register src1, Register src2); + void EOR(Register dst, Register src1, Register src2); + void MUL(Register dst, Register src1, Register src2); + void CMP(Register Rn, Register Rm); + void LSL(Register dst, Register src, Register rShift); + void LSR(Register dst, Register src, Register rShift); + void ASR(Register dst, Register src, Register rShift); + void LSL_i(Register dst, Register src, int iShift); + void LSR_i(Register dst, Register src, int iShift); + void ASR_i(Register dst, Register src, int iShift); + void STR(Register src, int offset, Register base); + void ADD_imm8(Register dst, Register src, int imm8); + void ADD_imm8_hi(Register dst, Register src, int imm8); + void ADD_imm16(Register dst, Register src, int imm16); + void AND_imm8(Register dst, Register src, int imm8); + void ORR_imm8(Register dst, Register src, int imm8); + void EOR_imm8(Register dst, Register src, int imm8); + void LDMFD(Register src, int mask); + void LDMFD_bang(Register src, int mask); + + // Cheeseball way of doing imm32. + void MOV_imm32(Register dst, int imm32); + + void flushDataCache(void *start, int len); + + // Set if verbose output desired + #ifdef AVMPLUS_VERBOSE + bool verboseFlag; + #endif + PrintWriter *console; + + // Immediate pool + MDInstruction *immediatePool; + int immediatePoolCount; + const static int kImmediatePoolMax = 16; + + static const char* const regNames[]; +#define gpregNames regNames + static const char* const conditionCodes[]; + }; +} + +#endif /* __avmplus_ArmAssembler__ */ diff --git a/mozilla/js/tamarin/codegen/CodegenMIR.cpp b/mozilla/js/tamarin/codegen/CodegenMIR.cpp new file mode 100644 index 00000000000..cb000d14956 --- /dev/null +++ b/mozilla/js/tamarin/codegen/CodegenMIR.cpp @@ -0,0 +1,10084 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmplus.h" + +#ifdef DARWIN +#include +#endif + +#if defined(WIN32) && defined(AVMPLUS_ARM) +#include +#endif + +#ifdef _MSC_VER +#if !defined (AVMPLUS_ARM) +extern "C" +{ + int __cdecl _setjmp3(jmp_buf jmpbuf, int arg); +} +#else +#include +jmp_buf buf; +#endif // AVMPLUS_ARM +#endif // _MSC_VER + +#if defined(AVMPLUS_MAC) || defined(AVMPLUS_ARM) +// Hack; can't take addr of a virtual function +#define getUintProperty _getUintProperty +#define getIntProperty _getIntProperty +#define setUintProperty _setUintProperty +#define setIntProperty _setIntProperty +#endif + +#ifdef AVMPLUS_ARM +#ifdef _MSC_VER +#define RETURN_METHOD_PTR(_class, _method) \ +return *((int*)&_method); +#else +#define RETURN_METHOD_PTR(_class, _method) \ +union { \ + int (_class::*bar)(); \ + int foo[2]; \ +}; \ +bar = _method; \ +return foo[1]; +#endif + +#elif defined AVMPLUS_MAC +#if !TARGET_RT_MAC_MACHO +// CodeWarrior makes us jump through some hoops +// to dereference pointer->method... +// Convert pointer->method to integer for Carbon. +#define RETURN_METHOD_PTR(_class, _method) \ +int foo; \ +asm("lwz %0,0(r5)" : "=r" (foo)); \ +return foo; +#else +#define RETURN_METHOD_PTR(_class, _method) \ +union { \ + int (_class::*bar)(); \ + int foo; \ +}; \ +bar = _method; \ +return foo; +#endif + +#else +#define RETURN_METHOD_PTR(_class, _method) \ +return *((int*)&_method); +#endif + +namespace avmplus +{ + int CodegenMIR::coreAddr( int (AvmCore::*f)() ) + { + RETURN_METHOD_PTR(AvmCore, f); + } + + int CodegenMIR::gcAddr( int (MMgc::GC::*f)() ) + { + RETURN_METHOD_PTR(MMgc::GC, f); + } + + int CodegenMIR::envAddr( int (MethodEnv::*f)() ) + { + RETURN_METHOD_PTR(MethodEnv, f); + } + + int CodegenMIR::toplevelAddr( int (Toplevel::*f)() ) + { + RETURN_METHOD_PTR(Toplevel, f); + } + + #ifdef DEBUGGER + int CodegenMIR::callStackAddr( int (CallStackNode::*f)() ) + { + RETURN_METHOD_PTR(CallStackNode, f); + } + + int CodegenMIR::debuggerAddr( int (Debugger::*f)() ) + { + RETURN_METHOD_PTR(Debugger, f); + } + #endif /* DEBUGGER */ + + int CodegenMIR::scriptAddr(int (ScriptObject::*f)()) + { + RETURN_METHOD_PTR(ScriptObject, f); + } + + int CodegenMIR::arrayAddr(int (ArrayObject::*f)()) + { + RETURN_METHOD_PTR(ArrayObject, f); + } + + int CodegenMIR::efAddr( int (ExceptionFrame::*f)() ) + { + RETURN_METHOD_PTR(ExceptionFrame, f); + } + + using namespace MMgc; + #ifdef AVMPLUS_MIR + + #ifdef AVMPLUS_SYMBIAN + static const int mir_buffer_reserve_size = 1*1024*1024; // 2MB + #else + static const int mir_buffer_reserve_size = 32*1024*1024; // 32MB + #endif + static const int mir_buffer_size_min = 1024*1024; // 1MB + + static const int prologue_size = 32768; //3840; + static const int epilogue_size = 208; + + #ifndef AVMPLUS_MAC + #define FUNCADDR(addr) (int)addr + #else + #if TARGET_RT_MAC_MACHO + #define FUNCADDR(addr) (int)addr + #else + #define FUNCADDR(addr) (*((int*)addr)) + #endif + #endif + +#ifdef AVMPLUS_VERBOSE +#ifndef AVMPLUS_SYMBIAN + char *mirNames[CodegenMIR::MIR_last]; +#endif +#endif /* AVMPLUS_VERBOSE */ + + #if defined(_MSC_VER) && !defined(AVMPLUS_ARM) + #define SETJMP ((int)_setjmp3) + #else + #ifdef AVMPLUS_MAC_CARBON + #define SETJMP setjmpAddress + #else + #define SETJMP ((int)setjmp) + #endif + #endif /* _MSC_VER */ + + + typedef CodegenMIR::OP OP; + + /** + * 3 instruction formats + * + * format 1 : oprnd1 = 0 and value = imm32 + * format 2 : oprnd1 = ptr | imm8 and value = imm32 (conditional branches oprnd1 = ptr [MIR_cm / MIR_cs / MIR_fcm / MIR_fcs] oprnd1 = imm8) + * format 3 : oprnd1 = ptr oprnd2 / oprnd3 are optional ptr (only MIR_st should use oprnd3) + */ + + // format 1 + OP* CodegenMIR::Ins(MirOpcode code, int32 v) + { + OP* ip = this->ip; +#ifndef FEATURE_BUFFER_GUARD + if (checkOverflow()) + return ip; +#endif /* FEATURE_BUFFER_GUARD */ + + AvmAssert(code >= 0 && code < MIR_last); + OP* o = 0; + + if (core->cseopt && (code & MIR_oper)) + o = cseMatch(code, 0, (OP*) v); + + if (o == 0) + { + ip->code = code; + ip->oprnd1 = 0; // not used + ip->imm = v; + ip->lastUse = 0; + //ip->prevcse = 0; + ip->liveAcrossCall = 0; + ip->reg = Unknown; +#ifdef AVMPLUS_VERBOSE + if (verbose()) + { + core->console << " @"<< InsNbr(ip)<<"\t"; + formatOpcode(core->console, ipStart, ip, pool, core->codegenMethodNames); + core->console <<"\n"; + } +#endif /* AVMPLUS_VERBOSE */ + o = ip++; + ip->prevcse = 0; + this->ip = ip; + } + return o; + } + + // format 2 + OP* CodegenMIR::Ins(MirOpcode code, OP* a1, int32 v2) + { + OP* ip = this->ip; +#ifndef FEATURE_BUFFER_GUARD + if (checkOverflow()) + return ip; +#endif /* FEATURE_BUFFER_GUARD */ + + AvmAssert(code >= 0 && code < MIR_last); + OP* o = 0; + + if (core->cseopt && ((code & MIR_oper) || (code&~MIR_float)==MIR_ld)) + o = cseMatch(code, a1, (OP*) v2); + + if (o == 0) + { + ip->code = code; + ip->lastUse = 0; + ip->oprnd1 = a1; + ip->disp = v2; + ip->liveAcrossCall = 0; + ip->reg = Unknown; + //ip->prevcse = 0; +#ifdef AVMPLUS_VERBOSE + if (verbose()) + { + core->console << " @"<console, ipStart, ip, pool, core->codegenMethodNames); + core->console << "\n"; + } +#endif /* AVMPLUS_VERBOSE */ + o = ip++; + ip->prevcse = 0; + this->ip = ip; + if (a1) + updateUse(o, a1); + } + return o; + } + + OP* CodegenMIR::Ins(MirOpcode code, OP* a1, OP* a2) + { + OP* ip = this->ip; +#ifndef FEATURE_BUFFER_GUARD + if (checkOverflow()) + return ip; +#endif /* FEATURE_BUFFER_GUARD */ + + AvmAssert(code >= 0 && code < MIR_last); + OP* o = 0; + + if (core->cseopt && (code & MIR_oper)) + o = cseMatch(code, a1, a2); + + if (o == 0) + { + ip->code = code; + ip->lastUse = 0; + ip->oprnd1 = a1; + ip->oprnd2 = a2; + ip->liveAcrossCall = 0; + ip->reg = Unknown; + //ip->prevcse = 0; +#ifdef AVMPLUS_VERBOSE + if (verbose()) + { + core->console << " @"<console, ipStart, ip, pool, core->codegenMethodNames); + core->console << "\n"; + } +#endif /* AVMPLUS_VERBOSE */ + o = ip++; + ip->prevcse = 0; + this->ip = ip; + if (a1) + updateUse(o, a1); + if (a2) + updateUse(o, a2); + } + return o; + } + + void CodegenMIR::argIns(OP* arg) + { + // leave arg1 empty and use binaryIns so second arg has special treatment + // if it is an immediate value + OP* call = this->ip-1; + + AvmAssert((call->code&~MIR_float&~MIR_oper) == MIR_cm + || (call->code&~MIR_float&~MIR_oper) == MIR_cs + || (call->code&~MIR_float) == MIR_ci); + AvmAssert(arg_index <= call->argc); + + call->args[arg_index] = arg; + + if (arg) + { + Register hint = Unknown; + bool canFold = canImmFold(call, arg); + + // processor specific register hints + #ifdef AVMPLUS_IA32 + if (!canFold && arg_index == 1 && (call->code&~MIR_float&~MIR_oper) == MIR_cm) + hint = ECX; + #endif //AVMPLUS_IA32 + + if (!canFold) + updateUse(call, arg, hint); + } + + // after the last arg, move ip to skip args + if (++arg_index > call->argc) + { + lastFunctionCall = call; + this->ip = call + (call->argc+7)/4; // NB. DCE depends on this layout! + #ifdef AVMPLUS_VERBOSE + if (verbose()) + core->console << "@" << (arg ? InsNbr(arg) : -1) << ")\n"; + #endif //AVMPLUS_VERBOSE + } + #ifdef AVMPLUS_VERBOSE + else + { + if (verbose()) + core->console << "@" << (arg ? InsNbr(arg) : -1) << ", "; + } + #endif // AVMPLUS_VERBOSE + } + + OP* CodegenMIR::binaryIns(MirOpcode code, OP* a1, OP* a2) + { + #ifdef AVMPLUS_ARM + // On ARM, MIR_fadd/fsub/fmul/fdiv are helper functions + switch (code) + { + case MIR_fadd: + return callIns(MIR_fcsop, FUNCADDR(CodegenMIR::fadd), 2, a1, a2); + case MIR_fsub: + return callIns(MIR_fcsop, FUNCADDR(CodegenMIR::fsub), 2, a1, a2); + case MIR_fmul: + return callIns(MIR_fcsop, FUNCADDR(CodegenMIR::fmul), 2, a1, a2); + case MIR_fdiv: + return callIns(MIR_fcsop, FUNCADDR(CodegenMIR::fdiv), 2, a1, a2); + } + #endif + + if (a1->code == MIR_imm && a2->code == MIR_imm) + { + // constant folding + switch (code) + { + case MIR_or: return InsConst(a1->imm | a2->imm); + case MIR_and: return InsConst(a1->imm & a2->imm); + default: break; + } + } + + OP* ip = this->ip; +#ifndef FEATURE_BUFFER_GUARD + if (checkOverflow()) + return ip; +#endif /* FEATURE_BUFFER_GUARD */ + + AvmAssert(code >= 0 && code < MIR_last); + OP* o = 0; + + if (core->cseopt && (code & MIR_oper)) + o = cseMatch(code, a1, a2); + + if (o == 0) + { + ip->code = code; + ip->lastUse = 0; + ip->oprnd1 = a1; + ip->oprnd2 = a2; + ip->liveAcrossCall = 0; + ip->reg = Unknown; + //ip->prevcse = 0; +#ifdef AVMPLUS_VERBOSE + if (verbose()) + { + core->console << " @"<console, ipStart, ip, pool, core->codegenMethodNames); + core->console << "\n"; + } +#endif /* AVMPLUS_VERBOSE */ + o = ip++; + ip->prevcse = 0; + this->ip = ip; + + if (a1) + updateUse(o, a1); + if (a2 && !canImmFold(o, a2)) + updateUse(o, a2); + } + return o; + } + + /** + * A simple CSE-like optimzer that works by identifing + * identical instructions used in the same basic block. + * When we hit a match we simply return the instruction + * number without generating a new MIR instruction. + * + * This code may generate more spills across MIR function + * calls, but the underlying assumption is that a + * spill/remateralize pair is less expensive than + * re-generating the value. + */ + OP* CodegenMIR::cseMatch(MirOpcode code, OP* a1, OP* a2) + { + int count=0; + OP* ins = cseTable[code]; + OP* stop = firstCse; // start of EBB + + while (ins >= stop) + { + AvmAssert(ins->code == code); + if (ins->code == code && + ins->oprnd1 == a1 && + ins->oprnd2 == a2) + { + incCseHits(); + #ifdef AVMPLUS_VERBOSE + if (verbose()) + core->console << " \tcse @" << InsNbr(ins) << "\n"; + #endif /* AVMPLUS_VERBOSE */ + return ins; + } + + if (count++ < 20 && ins->prevcse) + ins -= ins->prevcse; + else + break; + } + + ins = cseTable[code]; + if (ins >= stop && ip-ins <= 0xFFFF) + ip->prevcse = ip-ins; + else + ip->prevcse = 0; + cseTable[code] = ip; + + return 0; + } + + /** + * Check to see if the given instruction is used in our state + */ + bool CodegenMIR::usedInState(OP* ins) + { + for (int i=0, n=state->verifier->frameSize; i < n; i++) + { + Value& v = state->value(i); + if (ins == v.ins) + return true; + } + return false; + } + + /** + * Dead code eliminator. Given an instruction we mark it + * as unused. The operands of the instruction are then + * placed on a list wherein we search backwards through the + * code looking for references. If we reach the instruction + * that generated the data and found no other use of the reference + * then we mark it as unsed. We continue this process all + * until no more instructions are in the list. + */ + void CodegenMIR::markDead(OP* ins) + { + if (!core->dceopt) + return; + + // if there is already a use or its stored in state then don't kill it + if (ins->lastUse || usedInState(ins)) + return; + + List search(4); + search.add(ins); + + OP* currIns = ins; // start the search from the given instruction + OP* stop = firstCse; // the search MUST end prior to a bb start + + while(!search.isEmpty() && currIns >= stop) + { + AvmAssert(currIns > stop); // we should not cross this border + + //core->console << " currIns @" << InsNbr(currIns) << " stop @" << InsNbr(stop) << "\n"; + + int n = search.size(); + for(int i=n-1; i>=0; i--) + { + OP* elm = search.get(i); + if (elm == currIns) + { + // no need to search for it anymore + search.removeAt(i); + + // we hit the instruction and didn't see a ref for + // elm, therefore it has no other use. + elm->lastUse = 0; + + // clear out the instruction if its in the cse table + if (cseTable[elm->code] == elm) + cseTable[elm->code] = 0; + + incDceHits(); + #ifdef AVMPLUS_VERBOSE + if (verbose()) + core->console << " \tdead @" << InsNbr(elm) << "\n"; + #endif //AVMPLUS_VERBOSE + + // now inspect it to see if its operands should be added as well + if (elm->code & MIR_oper) + { + if (elm->oprnd1 < currIns && elm->oprnd1 > stop ) + { + // looks promising but not confirmed yet + OP* inspect = elm->oprnd1; + if ( (inspect->lastUse == elm) && + (inspect->code & MIR_oper) && + (inspect->code != MIR_imm) && + !usedInState(inspect) ) + { + //looks good to add + search.add(inspect); + //core->console << " search.1 @" << InsNbr(inspect) << "\n"; + } + } + + if (elm->oprnd2 < currIns && elm->oprnd2 > stop ) + { + // looks promising but not confirmed yet + OP* inspect = elm->oprnd2; + if ( (inspect->lastUse == elm) && + (inspect->code & MIR_oper) && + (inspect->code != MIR_imm) && + !usedInState(inspect) ) + { + // yup looks good to add + search.add(inspect); + //core->console << " search.2 @" << InsNbr(inspect) << "\n"; + } + } + } + } + else + { + bool remove = false; + + /** + * Be ultra conservative and just check every 32 bit value over the 16 Bytes + * but only check the last slot (which contains lastUse) if the instruction + * looks like a store or a call + */ + AvmAssert(sizeof(OP) == 16); + uint32* slot = (uint32*)currIns; + if (*slot == (uint32)elm || *(slot+1) == (uint32)elm || *(slot+2) == (uint32)elm) + { + remove = true; + } + else if ( ( (currIns->code == MIR_st) || + ((currIns->code&~MIR_float&~MIR_oper) == MIR_cm) || + ((currIns->code&~MIR_float&~MIR_oper) == MIR_cs) || + ((currIns->code&~MIR_float) == MIR_ci) ) && + (*(slot+3) == (uint32)elm) ) + { + remove = true; + } + + // its being used by this instruction (most likely) so we can't mark it dead + if (remove) + { + elm->lastUse = currIns; + search.removeAt(i); + //core->console << " found @" << InsNbr(elm) << "\n"; + } + } + } + + // move to the previous instruction + currIns--; + } + } + + /** + * --------------------------------- + * Instruction convenience functions + * --------------------------------- + */ + + /** + * Define an incoming method argument that resides on the stack. + * The spOffset value is the position of the arg relative to + * stack pointer at the start of the method. + */ + OP* CodegenMIR::defineArgInsPos(int pos) + { + OP* op = Ins(MIR_arg); + op->pos = -pos - op->spillSize(); + return op; + } + + /** + * Define an incoming method argument that resides in a register. + */ + OP* CodegenMIR::defineArgInsReg(Register r) + { + OP* op = Ins(MIR_arg, (int)r); + op->reg = r; + return op; + } + + // store to register + offset + void CodegenMIR::storeIns(OP* value, int disp, OP* base) + { + OP* ip = this->ip; +#ifndef FEATURE_BUFFER_GUARD + if (checkOverflow()) + return; +#endif /* FEATURE_BUFFER_GUARD */ + + if (base && base->code == MIR_imm) { + disp += base->imm; + base = 0; + } + + // invalidate any previous loads + if (value->isDouble()) + cseTable[MIR_fld] = 0; + else + cseTable[MIR_ld] = 0; + + AvmAssert((disp % 4) == 0); + ip->code = MIR_st; + ip->base = base; + ip->disp = disp; + ip->value = value; + ip->liveAcrossCall = 0; + +#ifdef AVMPLUS_VERBOSE + if (verbose()) + { + core->console << " @"<console, ipStart, ip, pool, core->codegenMethodNames); + core->console << "\n"; + } +#endif /* AVMPLUS_VERBOSE */ + + OP* o = ip++; + ip->prevcse = 0; + this->ip = ip; + if (base) + updateUse(o, base); + + if (!canImmFold(o, value)) + updateUse(o, value); + } + + OP* CodegenMIR::defIns(OP* value) + { + return Ins(value->isDouble() ? MIR_fdef : MIR_def, value); + } + + OP* CodegenMIR::useIns(OP* def, int i) + { + while (def->join) + def = def->join; + return Ins(def->isDouble() ? MIR_fuse : MIR_use, def, i); + } + + // address calc instruction + OP* CodegenMIR::leaIns(int disp, OP* base) + { + AvmAssert((disp % 4) == 0); + + return Ins(MIR_lea, base, (int32)disp); + } + + // call + OP* CodegenMIR::callIns(MirOpcode code, int32 addr, uint32 argCount, ...) + { + // if this is a pure operator function + if (core->cseopt && (code&MIR_oper)) + { +#ifndef FEATURE_BUFFER_GUARD + if (checkOverflow()) + return ip; +#endif /* FEATURE_BUFFER_GUARD */ + + int count=0; + OP* ins = cseTable[code]; + while (ins >= firstCse) + { + AvmAssert(ins->code == code); + if (ins->argc == argCount && + ins->addr == addr) + { + // previous call is in this BB and argc/addr match + va_list ap; + va_start(ap, argCount); + uint32 i=1; + for (; i <= argCount && ins; i++) + { + OP* arg = va_arg(ap, OP*); + OP* arg2 = ins->args[i]; + if (arg2 != arg) + break; + } + va_end(ap); + + if (i == argCount+1) + { + incCseHits(); + #ifdef AVMPLUS_VERBOSE + if (verbose()) + core->console << " \tcse @" << InsNbr(ins) << "\n"; + #endif /* AVMPLUS_VERBOSE */ + return ins; + } + } + if (count++ < 20 && ins->prevcse) + ins -= ins->prevcse; + else + break; + } + ins = cseTable[code]; + if (ins >= firstCse && ip-ins <= 0xFFFF) + ip->prevcse = ip-ins; + else + ip->prevcse = 0; + cseTable[code] = ip; + } + + OP* result = callIns(addr, argCount, code); + va_list ap; + va_start(ap, argCount); + while (argCount-- > 0) + argIns(va_arg(ap, OP*)); + va_end(ap); + return result; + } + + OP* CodegenMIR::callIns(int32 addr, uint32 argCount, MirOpcode code) + { + #ifdef DEBUGGER + if (!(code & MIR_oper)) + saveState(); + #endif + + OP* ip = this->ip; +#ifndef FEATURE_BUFFER_GUARD + if (checkOverflow()) + return ip; +#endif /* FEATURE_BUFFER_GUARD */ + + // ensure it's actually a call + AvmAssert((code&~MIR_float&~MIR_oper) == MIR_cm || (code&~MIR_float&~MIR_oper) == MIR_cs); + + if (argCount > maxArgCount) + maxArgCount = argCount; + + if (!(code & MIR_oper)) + { + // call could have side effects, ignore any previous loads + cseTable[MIR_fld] = 0; + cseTable[MIR_ld] = 0; + } + + ip->code = code; + ip->lastUse = 0; + ip->argc = argCount; + ip->addr = addr; + ip->liveAcrossCall = 0; + ip->reg = Unknown; + //ip->prevcse = 0; + + #ifdef AVMPLUS_VERBOSE + if (verbose()) + { + core->console << " @"<code] +#endif + <<" "; + const char *name; + if ( ((int)(name = (const char *)core->codegenMethodNames->get(ip->addr)) != undefinedAtom) && name ) + { + core->console << name; + } + else + { + AvmAssertMsg(false, "Add method name to codegenMethodNames table\n"); + core->console.writeHexDWord(ip->addr); + } + core->console << " ("; + + if (argCount == 0) + core->console << ")\n"; + } + #endif /* AVMPLUS_VERBOSE */ + + arg_index = 1; + OP* where = ip++; + ip->prevcse = 0; + this->ip = ip; + if (argCount == 0) + lastFunctionCall = where;// + (argCount+3)/4; // look past the last fnc arg + + #ifdef DEBUGGER + if (!(code & MIR_oper)) + extendDefLifetime(where); + #endif + + return where; + } + + OP* CodegenMIR::callIndirect(MirOpcode code, OP* target, uint32 argCount, ...) + { + #ifdef DEBUGGER + if (!(code & MIR_oper)) + saveState(); + #endif + + OP* ip = this->ip; +#ifndef FEATURE_BUFFER_GUARD + if (checkOverflow()) + return ip; +#endif /* FEATURE_BUFFER_GUARD */ + + // ensure it's actually a call + AvmAssert(code == MIR_ci || code == MIR_fci); + + if (argCount > maxArgCount) + maxArgCount = argCount; + + // call could have side effects, ignore any previous loads + cseTable[MIR_fld] = 0; + cseTable[MIR_ld] = 0; + + ip->code = code; + ip->lastUse = 0; + ip->argc = argCount; + ip->target = target; + ip->liveAcrossCall = 0; + ip->reg = Unknown; + + #ifdef AVMPLUS_VERBOSE + if (verbose()) + { + core->console << " @"<code] +#endif + << " @" << InsNbr(target) + << " ("; + if (argCount == 0) + core->console << ")\n"; + } + #endif /* AVMPLUS_VERBOSE */ + + arg_index = 1; + OP* where = ip++; + ip->prevcse = 0; + this->ip = ip; + + // peek through the lea since MD callindirect can use disp+reg + if (target->code == MIR_lea) + target = target->base; + +#ifdef AVMPLUS_IA32 + Register hint = ECX; +#else + Register hint = Unknown; +#endif + updateUse(where, target, hint); + lastFunctionCall = where;// + (argCount+3)/4; // look past the last fnc arg + + // args + va_list ap; + va_start(ap, argCount); + while (argCount-- > 0) + argIns(va_arg(ap, OP*)); + va_end(ap); + + #ifdef DEBUGGER + if (!(code & MIR_oper)) + extendDefLifetime(where); + #endif + + return where; + } + + OP* CodegenMIR::localGet(uint32 i) + { + Value& v = state->value(i); + OP* op = v.ins; + if (op && ((op->code&~MIR_float)==MIR_def)) + v.ins = op = useIns(op, i); + return op; + } + + void CodegenMIR::localSet(uint32 i, OP* o) + { + Value &v = state->value(i); + v.ins = o; + v.stored = false; + + #ifdef VERBOSE_LOCALS + core->console << " lset " << (double)i << " "; + formatOpcode(core->console, ipStart, o, pool, core->codegenMethodNames); + core->console <<"\n"; + #endif + } + + OP* CodegenMIR::atomToNativeRep(int i, OP* atom) + { + return atomToNativeRep(state->value(i).traits, atom); + } + + OP* CodegenMIR::ptrToNativeRep(Traits*t, OP* ptr) + { + if (t->isMachineType) + { + return binaryIns(MIR_or, ptr, InsConst(kObjectType)); + } + return ptr; + } + + bool CodegenMIR::isPointer(int i) + { + return !state->value(i).traits->isMachineType; + } + + bool CodegenMIR::isDouble(int i) + { + return state->value(i).traits == NUMBER_TYPE; + } + + OP* CodegenMIR::loadAtomRep(uint32 i) + { + Value& v = state->value(i); + Traits* t = v.traits; + OP* native = localGet(i); + + if (!t || t == OBJECT_TYPE || t == VOID_TYPE) + { + return native; + } + + // short circuit immediates + if (native->code == MIR_imm) + { + if (t == INT_TYPE) + { + Atom a = core->intToAtom(native->imm); + if(AvmCore::isInteger(a)) + return InsConst(a); + } + + if (t == UINT_TYPE) + { + Atom a = core->uintToAtom(native->imm); + if(AvmCore::isInteger(a)) + return InsConst(a); + } + + if (t == BOOLEAN_TYPE) + { + return InsConst(native->imm ? trueAtom : falseAtom); + } + + if (!t->isMachineType && native->imm == 0) + { + return InsConst(nullObjectAtom); + } + } + + if (t == NUMBER_TYPE) + { + int funcaddr = COREADDR(AvmCore::doubleToAtom); +#ifdef AVMPLUS_IA32 + if (core->sse2) + funcaddr = COREADDR(AvmCore::doubleToAtom_sse2); +#endif + return callIns(MIR_cmop, funcaddr, 2, InsConst((int32)core), native); + } + if (t == INT_TYPE) + { + return callIns(MIR_cmop, COREADDR(AvmCore::intToAtom), 2, + InsConst((int32)core), native); + } + if (t == UINT_TYPE) + { + return callIns(MIR_cmop, COREADDR(AvmCore::uintToAtom), 2, + InsConst((int32)core), native); + } + if (t == BOOLEAN_TYPE) + { + OP* i1 = binaryIns(MIR_lsh, native, InsConst(3)); + return binaryIns(MIR_or, i1, InsConst(kBooleanType)); + } + + // possibly null pointers + if (t == STRING_TYPE) + { + return binaryIns(MIR_or, native, InsConst(kStringType)); + } + if (t == NAMESPACE_TYPE) + { + return binaryIns(MIR_or, native, InsConst(kNamespaceType)); + } + + return binaryIns(MIR_or, native, InsConst(kObjectType)); + } + + OP* CodegenMIR::storeAtomArgs(int count, int index) + { + #ifdef AVMPLUS_VERBOSE + if (verbose()) + core->console << " store boxed args\n"; + #endif + OP* ap = InsAlloc(4*count); + for (int i=0; i < count; i++) + { + OP* v = loadAtomRep(index++); + storeIns(v, 4*i, ap); + } + return ap; + } + + OP* CodegenMIR::storeAtomArgs(OP* receiver, int count, int index) + { + #ifdef AVMPLUS_VERBOSE + if (verbose()) + core->console << " store args\n"; + #endif + OP* ap = InsAlloc(4*(count+1)); + storeIns(receiver, 0, ap); + for (int i=1; i <= count; i++) + { + OP* v = loadAtomRep(index++); + storeIns(v, 4*i, ap); + } + return ap; + } + +#ifdef DEBUGGER + void CodegenMIR::extendDefLifetime(OP* current) + { + for (int i=0, n=state->verifier->local_count; i < n; i++) + { + OP* def = state->value(i).ins; + if (!def) + continue; + if ((def->code & ~MIR_float) == MIR_use) + def = def->oprnd1; + AvmAssert(def && (def->code & ~MIR_float) == MIR_def); + while (def->join) + def = def->join; + def->lastUse = current; + } + } +#endif + + void CodegenMIR::saveState() + { +#ifdef AVMPLUS_VERBOSE + if (verbose()) + core->console << " save state\n"; +#endif + // locals and scopes + int stackBase = state->verifier->stackBase; + int scopeTop = state->verifier->scopeBase+state->scopeDepth; + for (int i=0, n = stackBase+state->stackDepth; i < n; i++) + { + #ifndef DEBUGGER + if (i >= scopeTop && i < stackBase) + { + // not live + continue; + } + #endif + Value& v = state->value(i); + if (v.stored) + { + // unused + if ((v.ins->code & ~MIR_float) == MIR_use && v.ins->disp == i) + { + // used but not changed, revert to unused def + v.ins = v.ins->oprnd1; + } + continue; + } + + // changed + + // store the stack elements onto the real stack + if (v.ins) + { + v.ins = defIns(v.ins); + v.stored = true; + + #ifdef DEBUGGER + // store the traits ptr so the debugger knows what was stored. + if (i < state->verifier->local_count) + { + storeIns(InsConst((int)v.traits ), i*sizeof(Traits*), localTraits); + storeIns(Ins(MIR_usea, v.ins), i*sizeof(void*), localPtrs); + } + else if (i >= state->verifier->scopeBase && i < state->verifier->scopeBase + state->verifier->max_scope) + { + OP* scope; + + if (i < scopeTop) + { + Value& v = state->value(i); + Traits* t = v.traits; + + if (t == VOID_TYPE || t == INT_TYPE || t == UINT_TYPE || t == BOOLEAN_TYPE || + t == NUMBER_TYPE || t == STRING_TYPE || t == NAMESPACE_TYPE) + { + scope = InsConst(0); + } + else + { + scope = Ins(MIR_use, v.ins); + } + } + else // not live + { + // warning, v.traits are garbage at this point, so don't use them + scope = InsConst(0); + } + + storeIns(scope, i * sizeof(void*), localPtrs); + } + #endif //DEBUGGER + } + } + } + + void CodegenMIR::updateUse(OP* currentIns, OP* ins, Register hint) + { + AvmAssert(currentIns < ip); + AvmAssert((ins->code&~MIR_float) != MIR_def || ins->join == 0); + + ins->lastUse = currentIns; + + if (ins < lastFunctionCall && currentIns > lastFunctionCall) + { + // if the def occured prior to our last know function call then it + // means that we need the value to survive past the function + ins->liveAcrossCall = true; + } + + if (hint != Unknown && !ins->liveAcrossCall && ins->code != MIR_arg) + ins->reg = hint; + } + + // position label at OP->target (will trigger patching) + void CodegenMIR::mirPatch(OP* i, int targetpc) + { + mirPatchPtr(&i->target, targetpc); + if (targetpc < state->pc) + extendLastUse(i, targetpc); + } + + void CodegenMIR::extendLastUse(OP* ins, OP* use, OP* target) + { + if (!ins) + return; + if ((ins->code & ~MIR_float) == MIR_def) + while (ins->join) + ins = ins->join; + if (ins < target && target < ins->lastUse) + ins->lastUse = use; + } + + void CodegenMIR::extendLastUse(OP* use, int targetpc) + { + // if target of the branch is in the middle of any + // live range, extend the live range to include + // the branch + + FrameState* targetState = state->verifier->getFrameState(targetpc); + MirLabel &l = targetState->label; + OP* target = l.bb; + AvmAssert(target && target->code == MIR_bb); + + // check the args + for(int i=0; i<3; i++) + extendLastUse(&methodArgs[i], use, target); + + // check the frame state variables + for (int i=0, n=targetState->verifier->frameSize; i < n; i++) + extendLastUse(targetState->value(i).ins, use, target); + + extendLastUse(undefConst, use, target); + + // other misc, re-usable expressions + if (info->exceptions) + extendLastUse(exAtom, use, target); + } + + void CodegenMIR::InsDealloc(OP* alloc) + { + AvmAssert(alloc->code == MIR_alloc); + alloc->lastUse = ip-1; + } + + CodegenMIR::CodegenMIR(PoolObject* p) + : core(p->core), pool(p), info(NULL), activation(p->core->GetGC()) + { + mirBuffer = NULL; + state = NULL; + framep = SP; + interruptable = true; + + #if defined(AVMPLUS_IA32) && defined(_MAC) + patch_esp_padding = NULL; + #endif + + #ifdef AVMPLUS_ARM + #ifdef AVMPLUS_VERBOSE + this->verboseFlag = pool->verbose; + #endif + this->console = &core->console; + #endif + } + + CodegenMIR::CodegenMIR(MethodInfo* i) + : core(i->core()), pool(i->pool), info(i), activation(i->core()->GetGC()) + { + state = NULL; + framep = SP; + interruptable = true; + + #ifdef AVMPLUS_MAC_CARBON + setjmpInit(); + #endif + + #if defined(AVMPLUS_IA32) && defined(_MAC) + patch_esp_padding = NULL; + #endif + + #ifdef AVMPLUS_ARM + // Hack for debugging + //pool->verbose = true; + #endif + + #ifdef AVMPLUS_ARM + #ifdef AVMPLUS_VERBOSE + this->verboseFlag = pool->verbose; + #endif + this->console = &core->console; + #endif + + abcStart = NULL; + abcEnd = NULL; + casePtr = NULL; + ipStart = NULL; + + #ifdef AVMPLUS_ARM + patch_frame_size = NULL; + patch_stmfd = NULL; + gpregs.nonVolatileMask = 0; + fpregs.nonVolatileMask = 0; + #endif + + #ifdef AVMPLUS_PPC + gpregs.LowerBound = Unknown; + fpregs.LowerBound = Unknown; + patch_stwu = NULL; + patch_stmw = NULL; + #endif + + overflow = false; + expansionFactor = 1; + + // get a buffer from the global list + mirBuffer = core->requestMirBuffer(); + +#ifdef AVMPLUS_PROFILE + cseHits = 0; + dceHits = 0; + // time stuff + verifyStartTime = GC::GetPerformanceCounter(); +#endif /* AVMPLUS_PROFILE */ + } + + CodegenMIR::CodegenMIR(NativeMethod* m) + : core(m->core()), pool(m->pool), info(NULL), activation(m->core()->GetGC()) + { + state = NULL; + framep = SP; + interruptable = true; + + #ifdef AVMPLUS_MAC_CARBON + setjmpInit(); + #endif + + #ifdef AVMPLUS_ARM + #ifdef AVMPLUS_VERBOSE + this->verboseFlag = pool->verbose; + #endif + this->console = &core->console; + #endif + + #if defined(AVMPLUS_IA32) && defined(_MAC) + patch_esp_padding = NULL; + #endif + + abcStart = NULL; + abcEnd = NULL; + + casePtr = NULL; + ipStart = NULL; + + #ifdef AVMPLUS_ARM + patch_frame_size = NULL; + patch_stmfd = NULL; + gpregs.nonVolatileMask = 0; + fpregs.nonVolatileMask = 0; + #endif + + #ifdef AVMPLUS_PPC + fpregs.LowerBound = Unknown; + gpregs.LowerBound = Unknown; + patch_stwu = NULL; + patch_stmw = NULL; + #endif + + overflow = false; + expansionFactor = 1; + + // native method generation doesn't require a intermediate mir buffer + mirBuffer = 0; + } + + CodegenMIR::~CodegenMIR() + { + //if (arg_count > 0) + // core->console << "mir_arg " << arg_count << " of " << InsNbr(ip) << "\n"; + //arg_count = 0; + + // free scratch buffers explicitly. None of these have any pointers + // in them, and none of them will have escaped into other objects. + // freeing them now reduces GC pressure at startup time. + + // return the buffer back to the global list + if (mirBuffer) + { + if (mirBuffer->size() > 0) + mirBuffer->shrinkTo(mir_buffer_size_min); + core->releaseMirBuffer(mirBuffer); + } + } + + #ifdef AVMPLUS_MAC_CARBON + int CodegenMIR::setjmpAddress = 0; + + extern "C" int __setjmp(); + + asm int CodegenMIR::setjmpDummy(jmp_buf buf) + { + b __setjmp; + } + + void CodegenMIR::setjmpInit() + { + // CodeWarrior defies all reasonable efforts to get + // the address of __vec_setjmp. So, we resort to + // a crude hack: We'll search the actual code + // of setjmpDummy for the branch instruction. + if (setjmpAddress == 0) + { + setjmpAddress = *((int*)&setjmpDummy); + } + } + #endif + +#ifdef AVMPLUS_VERBOSE + GCHashtable* CodegenMIR::initMethodNames(AvmCore* /*core*/) + { + #ifdef AVMPLUS_MAC_CARBON + // setjmpInit() is also called in the constructor, but initMethodNames() is + // a static function and thus may get called before the constructor. + setjmpInit(); + #endif + + // make sure we can do bit masking on the call opcodes. + AvmAssert(MIR_cmop == (MIR_cm|MIR_oper)); + AvmAssert(MIR_csop == (MIR_cs|MIR_oper)); + AvmAssert(MIR_fcm == (MIR_cm|MIR_float)); + AvmAssert(MIR_fcs == (MIR_cs|MIR_float)); + AvmAssert(MIR_fcmop == (MIR_cm|MIR_float|MIR_oper)); + AvmAssert(MIR_fcsop == (MIR_cs|MIR_float|MIR_oper)); + + // first init our own opcode names +#ifndef AVMPLUS_SYMBIAN + mirNames[MIR_bb] = "bb "; + mirNames[MIR_imm] = "imm "; + mirNames[MIR_ld] = "ld "; + mirNames[MIR_fld] = "fld "; + mirNames[MIR_ldop] = "ldop "; + mirNames[MIR_fldop] = "fldop"; + mirNames[MIR_st] = "st "; + mirNames[MIR_arg] = "arg "; + mirNames[MIR_cm] = "cm "; + mirNames[MIR_cs] = "cs "; + mirNames[MIR_ci] = "ci "; + mirNames[MIR_neg] = "neg "; + mirNames[MIR_lsh] = "lsh "; + mirNames[MIR_rsh] = "rsh "; + mirNames[MIR_ush] = "ush "; + mirNames[MIR_and] = "and "; + mirNames[MIR_or] = "or "; + mirNames[MIR_xor] = "xor "; + mirNames[MIR_add] = "add "; + mirNames[MIR_sub] = "sub "; + mirNames[MIR_imul] = "imul "; + mirNames[MIR_icmp] = "icmp "; + mirNames[MIR_ucmp] = "ucmp "; + mirNames[MIR_fcmp] = "fcmp "; + mirNames[MIR_jeq] = "jeq "; + mirNames[MIR_jne] = "jne "; + mirNames[MIR_jlt] = "jlt "; + mirNames[MIR_jle] = "jle "; + mirNames[MIR_jnlt] = "jnlt "; + mirNames[MIR_jnle] = "jnle "; + mirNames[MIR_ret] = "ret "; + mirNames[MIR_jmp] = "jmp "; + mirNames[MIR_jmpi] = "jmpi "; + mirNames[MIR_jmpt] = "jmpt "; + mirNames[MIR_le] = "le "; + mirNames[MIR_lt] = "lt "; + mirNames[MIR_eq] = "eq "; + mirNames[MIR_ne] = "ne "; + mirNames[MIR_lea] = "lea "; + mirNames[MIR_alloc] = "alloc"; + mirNames[MIR_def] = "def "; + mirNames[MIR_fdef] = "fdef "; + mirNames[MIR_use] = "use "; + mirNames[MIR_fuse] = "fuse "; + mirNames[MIR_usea] = "usea "; + mirNames[MIR_fcm] = "fcm "; + mirNames[MIR_fcs] = "fcs "; + mirNames[MIR_fci] = "fci "; + mirNames[MIR_i2d] = "i2d "; + mirNames[MIR_u2d] = "u2d "; + mirNames[MIR_fadd] = "fadd "; + mirNames[MIR_fsub] = "fsub "; + mirNames[MIR_fmul] = "fmul "; + mirNames[MIR_fdiv] = "fdiv "; + mirNames[MIR_fneg] = "fneg "; + mirNames[MIR_cmop] = "cmop "; + mirNames[MIR_csop] = "csop "; + mirNames[MIR_fcmop] = "fcmop"; + mirNames[MIR_fcsop] = "fcsop"; +#endif + GCHashtable* names = new GCHashtable(); + + #ifdef DEBUGGER + #ifdef AVMPLUS_PROFILE + names->add(COREADDR(DynamicProfiler::mark), "DynamicProfiler::mark"); + #endif + names->add(ENVADDR(MethodEnv::debugEnter), "MethodEnv::debugEnter"); + names->add(ENVADDR(MethodEnv::debugExit), "MethodEnv::debugExit"); + names->add(ENVADDR(MethodEnv::sendEnter), "MethodEnv::sendEnter"); + names->add(ENVADDR(MethodEnv::sendExit), "MethodEnv::sendExit"); + names->add(CALLSTACKADDR(CallStackNode::initialize), "CallStackNode::initialize"); + names->add(DEBUGGERADDR(Debugger::debugFile), "Debugger::debugFile"); + names->add(DEBUGGERADDR(Debugger::debugLine), "Debugger::debugLine"); + names->add(DEBUGGERADDR(Debugger::_debugMethod), "Debugger::_debugMethod"); + #endif + + names->add(FUNCADDR(AvmCore::atomWriteBarrier), "AvmCore::atomWriteBarrier"); + names->add(GCADDR(GC::writeBarrierRC), "GC::writeBarrierRC"); + names->add(GCADDR(GC::WriteBarrierTrap), "GCADDR(GC::WriteBarrierTrap)"); + + // type -> atom conversions + names->add(COREADDR(AvmCore::intToAtom), "AvmCore::intToAtom"); + names->add(COREADDR(AvmCore::doubleToAtom), "AvmCore::doubleToAtom"); + names->add(COREADDR(AvmCore::uintToAtom), "AvmCore::uintToAtom"); + + // atom -> type conversions + names->add(COREADDR(AvmCore::integer), "AvmCore::integer"); + names->add(FUNCADDR(AvmCore::number_d), "AvmCore::number_d"); + names->add(COREADDR(AvmCore::number), "AvmCore::number"); + names->add(FUNCADDR(AvmCore::integer_i), "AvmCore::integer_i"); + names->add(FUNCADDR(AvmCore::integer_u), "AvmCore::integer_u"); + names->add(COREADDR(AvmCore::string), "AvmCore::string"); + names->add(COREADDR(AvmCore::intToString), "AvmCore::intToString"); + names->add(COREADDR(AvmCore::uintToString), "AvmCore::uintToString"); + names->add(COREADDR(AvmCore::doubleToString), "AvmCore::doubleToString"); + names->add(COREADDR(AvmCore::coerce_s), "AvmCore::coerce_s"); + names->add(COREADDR(AvmCore::ToXMLString), "AvmCore::ToXMLString"); + names->add(COREADDR(AvmCore::boolean), "AvmCore::boolean"); + + // operator helpers + names->add(COREADDR(AvmCore::concatStrings), "AvmCore::concatStrings"); + names->add(TOPLEVELADDR(Toplevel::toVTable), "Toplevel::toVTable"); + names->add(ENVADDR(MethodEnv::newfunction), "MethodEnv::newfunction"); + names->add(ENVADDR(MethodEnv::newclass), "MethodEnv::newclass"); + names->add(ENVADDR(MethodEnv::findproperty), "MethodEnv::findproperty"); + names->add(TOPLEVELADDR(Toplevel::op_call), "Toplevel::op_call"); + names->add(TOPLEVELADDR(Toplevel::op_construct), "Toplevel::op_construct"); + names->add(TOPLEVELADDR(Toplevel::callproperty), "Toplevel::callproperty"); + names->add(TOPLEVELADDR(Toplevel::constructprop), "Toplevel::constructprop"); + names->add(ENVADDR(MethodEnv::callsuper), "MethodEnv::callsuper"); + names->add(ENVADDR(MethodEnv::op_newobject), "MethodEnv::op_newobject"); + names->add(SCRIPTADDR(ArrayClass::newarray), "ArrayClass::newarray"); + names->add(ENVADDR(MethodEnv::createRestHelper), "MethodEnv::createRestHelper"); + names->add(ENVADDR(MethodEnv::getpropertyHelper), "MethodEnv::getpropertyHelper"); + names->add(ENVADDR(MethodEnv::setpropertyHelper), "MethodEnv::setpropertyHelper"); + names->add(ENVADDR(MethodEnv::initpropertyHelper), "MethodEnv::initpropertyHelper"); + names->add(COREADDR(AvmCore::initMultinameLate), "AvmCore::initMultinameLate"); + names->add(ENVADDR(MethodEnv::initMultinameLateForDelete), "MethodEnv::initMultinameLateForDelete"); + names->add(ENVADDR(MethodEnv::newcatch), "MethodEnv::newcatch"); + names->add(ENVADDR(MethodEnv::createArgumentsHelper), "MethodEnv::createArgumentsHelper"); + names->add(FUNCADDR(CodegenMIR::coerce_o), "CodegenMIR::coerce_o"); +#ifdef AVMPLUS_ARM + names->add(FUNCADDR(CodegenMIR::fadd), "CodegenMIR::fadd"); + names->add(FUNCADDR(CodegenMIR::fsub), "CodegenMIR::fsub"); + names->add(FUNCADDR(CodegenMIR::fmul), "CodegenMIR::fmul"); + names->add(FUNCADDR(CodegenMIR::fdiv), "CodegenMIR::fdiv"); + names->add(FUNCADDR(CodegenMIR::fcmp), "CodegenMIR::fcmp"); + names->add(FUNCADDR(CodegenMIR::i2d), "CodegenMIR::i2d"); + names->add(FUNCADDR(CodegenMIR::u2d), "CodegenMIR::u2d"); +#endif /* AVMPLUS_ARM */ +#ifdef AVMPLUS_PPC + names->add(FUNCADDR(CodegenMIR::stackOverflow), "CodegenMIR::stackOverflow"); +#endif /* AVMPLUS_PPC */ + names->add(FUNCADDR(MathUtils::mod), "MathUtils::mod"); + names->add(FUNCADDR(AvmCore::integer_d), "AvmCore::integer_d"); + names->add(COREADDR(AvmCore::newPublicNamespace), "AvmCore::newPublicNamespace"); + +#ifdef AVMPLUS_IA32 + names->add(COREADDR(AvmCore::doubleToAtom_sse2), "AvmCore::doubleToAtom_sse2"); + names->add(FUNCADDR(AvmCore::integer_d_sse2), "AvmCore::integer_d_sse2"); +#endif + names->add(ENVADDR (MethodEnv::finddef), "MethodEnv::finddef"); + names->add(ENVADDR (MethodEnv::finddefNsset), "MethodEnv::finddefNsset"); + names->add(ENVADDR (MethodEnv::finddefNs), "MethodEnv::finddefNs"); + names->add(COREADDR(AvmCore::_typeof), "AvmCore::_typeof"); + names->add(COREADDR(AvmCore::throwAtom), "AvmCore::throwAtom"); + names->add(ENVADDR(MethodEnv::getsuper), "MethodEnv::getsuper"); + names->add(ENVADDR(MethodEnv::setsuper), "MethodEnv::setsuper"); + names->add(ENVADDR(MethodEnv::nextname), "MethodEnv::nextname"); + names->add(ENVADDR(MethodEnv::nextvalue), "MethodEnv::nextvalue"); + names->add(ENVADDR(MethodEnv::hasnext), "MethodEnv::hasnext"); + names->add(ENVADDR(MethodEnv::hasnext2), "MethodEnv::hasnext2"); + names->add(ENVADDR(MethodEnv::getdescendants), "MethodEnv::getdescendants"); + names->add(ENVADDR(MethodEnv::getdescendantslate), "MethodEnv::getdescendantslate"); + names->add(TOPLEVELADDR(Toplevel::setproperty), "Toplevel::setproperty"); + names->add(ENVADDR(MethodEnv::initproperty), "MethodEnv::initproperty"); + names->add(ENVADDR(MethodEnv::setpropertylate_i), "MethodEnv::setpropertylate_i"); + names->add(ENVADDR(MethodEnv::setpropertylate_u), "MethodEnv::setpropertylate_u"); + names->add(COREADDR(AvmCore::eq), "AvmCore::eq"); + names->add(COREADDR(AvmCore::stricteq), "AvmCore::stricteq"); + names->add(COREADDR(AvmCore::compare), "AvmCore::compare"); + names->add(TOPLEVELADDR(Toplevel::add2), "Toplevel::add2"); + names->add(COREADDR(AvmCore::intern), "AvmCore::intern"); + names->add(ENVADDR(MethodEnv::internRtns), "MethodEnv::internRtns"); + names->add(TOPLEVELADDR(Toplevel::coerce), "Toplevel::coerce"); + names->add(TOPLEVELADDR(Toplevel::coerceobj), "Toplevel::coerceobj"); + names->add(ENVADDR(MethodEnv::coerceAtom2SO), "MethodEnv::coerceAtom2SO"); + names->add(COREADDR(AvmCore::toUInt32), "AvmCore::toUInt32"); + names->add(COREADDR(AvmCore::istypeAtom), "AvmCore::istypeAtom"); + + names->add(ENVADDR(MethodEnv::astype), "MethodEnv::astype"); + names->add(TOPLEVELADDR(Toplevel::instanceof), "Toplevel::instanceof"); + names->add(TOPLEVELADDR(Toplevel::getproperty), "Toplevel::getproperty"); + names->add(ARRAYADDR(ArrayObject::getUintProperty), "ArrayObject::getUintProperty"); + names->add(ARRAYADDR(ArrayObject::getIntProperty), "ArrayObject::getIntProperty"); + names->add(ARRAYADDR(ArrayObject::setUintProperty), "ArrayObject::setUintProperty"); + names->add(ARRAYADDR(ArrayObject::setIntProperty), "ArrayObject::setIntProperty"); + names->add(ENVADDR(MethodEnv::getpropertylate_i), "MethodEnv::getpropertylate_i"); + names->add(ENVADDR(MethodEnv::getpropertylate_u), "MethodEnv::getpropertylate_u"); + names->add(ENVADDR(MethodEnv::npe), "MethodEnv::npe"); + names->add(ENVADDR(MethodEnv::nullcheck), "MethodEnv::nullcheck"); + names->add(ENVADDR(MethodEnv::interrupt), "MethodEnv::interrupt"); + names->add(ENVADDR(MethodEnv::toClassITraits), "MethodEnv::toClassITraits"); + names->add(COREADDR(AvmCore::newObject), "AvmCore::newObject"); + names->add(COREADDR(AvmCore::newActivation), "AvmCore::newActivation"); + names->add(ENVADDR(MethodEnv::delproperty), "MethodEnv::delproperty"); + names->add(ENVADDR(MethodEnv::delpropertyHelper), "MethodEnv::delpropertyHelper"); + names->add(ENVADDR(MethodEnv::in), "MethodEnv::in"); + + // exception handling + names->add(COREADDR(AvmCore::beginCatch), "AvmCore::beginCatch"); + names->add(EFADDR(ExceptionFrame::beginTry), "ExceptionFrame::beginTry"); + names->add(EFADDR(ExceptionFrame::endTry), "ExceptionFrame::endTry"); + names->add(SETJMP, "setjmp"); + return names; + } +#endif + + Atom CodegenMIR::coerce_o(Atom v) + { + return v == undefinedAtom ? nullObjectAtom : v; + } + +#ifdef AVMPLUS_PPC + // This helper function exists only on PowerPC in order to + // minimize the code size of generated stack overflow checks. + // It is static and takes only one parameter, env. + // The env parameter goes into R3, which is where it also goes + // in a JIT-ted function's method signature (env, argc, ap) + // This enables us to not move any registers around. + void CodegenMIR::stackOverflow(MethodEnv *env) + { + env->core()->stackOverflow(env); + } +#endif + +#ifdef AVMPLUS_ARM + double CodegenMIR::fadd(double x, double y) + { + return x+y; + } + + double CodegenMIR::fsub(double x, double y) + { + return x-y; + } + + double CodegenMIR::fmul(double x, double y) + { + return x*y; + } + + double CodegenMIR::fdiv(double x, double y) + { + return x/y; + } + + int CodegenMIR::fcmp(double x, double y) + { + if (xy) + { + return 1; + } + else + { + return 0; + } + } + + double CodegenMIR::i2d(int i) + { + return (double)i; + } + + double CodegenMIR::u2d(uint32 i) + { + return (double)i; + } +#endif /* AVMPLUS_ARM */ + +#ifndef FEATURE_BUFFER_GUARD + bool CodegenMIR::checkOverflow() + { + if (overflow) + return overflow; + + // if this fails, we aren't estimating a big enough space for MIR + int curSize = (int)ip-(int)ipStart; + if (curSize >= mirBuffSize) + { + // start over with bigger buffer. + expansionFactor *= 2; + #ifdef AVMPLUS_PROFILE + if (StaticProfiler::sprofile) + { + core->console << "INFO: MIR buffer expanding (" + << " abc " << (abcEnd-abcStart) + << " factor " << expansionFactor + << " pro " << prologue_size << " epi " << epilogue_size + << " est " << mirBuffSize + #if defined(AVMPLUS_VERBOSE) || defined(DEBUGGER) + << " name " << info->name + #endif + << " )\n"; + } + #endif /* AVMPLUS_PROFILE */ + + overflow = true; + } + return overflow; + } +#endif + + OP* CodegenMIR::atomToNativeRep(Traits* t, OP* atom) + { + if (!t || t == OBJECT_TYPE || t == VOID_TYPE) + { + return atom; + } + else if (t == NUMBER_TYPE) + { + if (atom->code == MIR_imm) { + Atom a = atom->imm; + if (AvmCore::isDouble(a)) { + return loadIns(MIR_fldop, a&~7, 0); + } else { + AvmAssert(AvmCore::isInteger(a)); + return i2dIns(InsConst(a>>3)); + } + } else { + return callIns(MIR_fcsop, FUNCADDR(AvmCore::number_d), 1, atom); + } + } + else if (t == INT_TYPE) + { + if (atom->code == MIR_imm) + return InsConst(AvmCore::integer_i(atom->imm)); + else + return callIns(MIR_csop, FUNCADDR(AvmCore::integer_i), 1, atom); + } + else if (t == UINT_TYPE) + { + if (atom->code == MIR_imm) + return InsConst(AvmCore::integer_u(atom->imm)); + else + return callIns(MIR_csop, FUNCADDR(AvmCore::integer_u), 1, atom); + } + else if (t == BOOLEAN_TYPE) + { + if (atom->code == MIR_imm) + return InsConst(urshift(atom->imm,3)); + else + return binaryIns(MIR_ush, atom, InsConst(3)); + } + else + { + // pointer type + if (atom->code == MIR_imm) + return InsConst(atom->imm & ~7); + else + return binaryIns(MIR_and, atom, InsConst(~7)); + } + } + + // f(env, argc, instance, argv) + bool CodegenMIR::prologue(FrameState* state) + { + this->state = state; + + #ifdef AVMPLUS_PROFILE + DynamicProfiler::StackMark mark(OP_codegenop, &core->dprof); + #endif /* AVMPLUS_PROFILE */ + + abcStart = state->verifier->code_pos; + abcEnd = abcStart + state->verifier->code_length; + + #ifdef AVMPLUS_PPC + // On PowerPC, maxArgCount should initially be 4, + // because any varargs routine will immediately + // store r3...r10 into the PPC callee area. + // So, the callee area must always be big enough + // to accomodate r3...r10. + // Because we count maxArgCount in doubles, 4 is + // sufficient to cover r3...r10. + maxArgCount = 4; + #else + maxArgCount = 0; + #endif + + // buffer is empty reserve some space in it + overflow = false; + if (mirBuffer->size() == 0) + mirBuffer->reserve(expansionFactor * mir_buffer_reserve_size); + +#ifndef FEATURE_BUFFER_GUARD + // if we aren't growing the buffer dynamically then commit a whole bunch of it + mirBuffSize = sizeof(OP) * (40*expansionFactor*(abcEnd-abcStart)) + epilogue_size + prologue_size; // MIR instructions + mirBuffSize = BIT_ROUND_UP(mirBuffSize, mirBuffer->pageSize()); + mirBuffer->growBy(mirBuffSize); +#endif /* FEATURE_BUFFER_GUARD */ + + case_count = 0; + + // reset to start of buffer + ipStart = (OP*) mirBuffer->getPos(); + if (!ipStart) + { + overflow = true; + return false; + } + + // align the start of the buffer to OP and get ready to generate mir + ip = ipStart = (OP*) BIT_ROUND_UP(ipStart, sizeof(OP)); + + // reset the cse engine + memset(cseTable, 0, sizeof(OP*)*MIR_last); + firstCse = ip; + + // instruction # of last function call + lastFunctionCall = 0; + + // last pc value that we generated a store for + lastPcSave = 0; + + // + // mir to define incoming method arguments. Stack + // frame allocations follow. + // + + #ifdef AVMPLUS_VERBOSE + if (verbose()) + core->console << " define incoming args\n"; + #endif + + #ifdef AVMPLUS_IA32 + // callee saved args + calleeVars = defineArgInsReg(EBX); + defineArgInsReg(ESI); + defineArgInsReg(EDI); + // incoming args either in a register or stack position relative to stack on entry + methodArgs = defineArgInsPos(4); + defineArgInsPos(8); + defineArgInsPos(12); + #endif /* AVMPLUS_IA32 */ + + #ifdef AVMPLUS_PPC + calleeVars = NULL; + methodArgs = defineArgInsReg(R3); + defineArgInsReg(R4); + defineArgInsReg(R5); + #endif /* AVMPLUS_PPC */ + + #ifdef AVMPLUS_ARM + calleeVars = NULL; + methodArgs = defineArgInsReg(R0); + defineArgInsReg(R1); + defineArgInsReg(R2); + #endif + + #ifdef DEBUGGER + #ifdef AVMPLUS_VERBOSE + if (verbose()) + core->console << " alloc local traits\n"; + #endif + // pointers to traits so that the debugger can decode the locals + // IMPORTANT don't move this around unless you change MethodInfo::boxLocals() + localTraits = InsAlloc(state->verifier->local_count * sizeof(Traits*)); + localPtrs = InsAlloc((state->verifier->local_count + state->verifier->max_scope) * sizeof(void*)); + #endif //DEBUGGER + + // whether this sequence is interruptable or not. + interruptable = (info->flags & AbstractFunction::NON_INTERRUPTABLE) ? false : true; + + // then space for the exception frame, be safe if its an init stub + if (info->isFlagSet(AbstractFunction::HAS_EXCEPTIONS)) + { + #ifdef AVMPLUS_VERBOSE + if (verbose()) + core->console << " alloc exception frame\n"; + #endif + // [_save_eip][ExceptionFrame] + // offsets of local vars, rel to current ESP + _save_eip = InsAlloc(sizeof(byte*)); + _ef = InsAlloc(sizeof(ExceptionFrame)); + } + + if (info->setsDxns()) + { + #ifdef AVMPLUS_VERBOSE + if (verbose()) + core->console << " alloc saved dxns\n"; + #endif + + dxns = InsAlloc(sizeof(Namespace*)); + } + + #ifdef DEBUGGER + #ifdef AVMPLUS_VERBOSE + if (verbose()) + core->console << " alloc CallStackNode\n"; + #endif + + // Allocate space for the call stack + _callStackNode = InsAlloc(sizeof(CallStackNode)); + #endif + + #ifdef AVMPLUS_PROFILE + if (core->dprof.dprofile) + { + callIns(MIR_cm, COREADDR(DynamicProfiler::mark), 2, + (int)&core->dprof, InsConst(OP_prologue)); + } + #endif + + if (info->setsDxns()) + { + #ifdef AVMPLUS_VERBOSE + if (verbose()) + core->console << " init dxns\n"; + #endif + + // dxns = env->vtable->scope->defaultXmlNamespace + OP* declVTable = loadIns(MIR_ldop, offsetof(MethodEnv, vtable), ldargIns(_env)); + OP* scope = loadIns(MIR_ldop, offsetof(VTable, scope), declVTable); + OP* capturedDxns = loadIns(MIR_ldop, offsetof(ScopeChain, defaultXmlNamespace), scope); + storeIns(capturedDxns, 0, dxns); + + // dxnsSave = AvmCore::dxnsAddr + dxnsAddrSave = loadIns(MIR_ldop, offsetof(AvmCore, dxnsAddr), InsConst((int)core)); + } + + for (int i=0, n = state->verifier->stackBase+state->stackDepth; i < n; i++) + { + Value& v = state->value(i); + v.ins = 0; + v.stored = false; + } + + // + // copy args to local frame + // + + // copy required args, and initialize optional args. + // this whole section only applies to functions that actually + // have arguments. + + OP* apArg = ldargIns(_ap); + if (info->flags & AbstractFunction::HAS_OPTIONAL) + { + #ifdef AVMPLUS_VERBOSE + if (verbose()) + core->console << " required and optional args\n"; + #endif + + // compute offset of first optional arg + int offset = 0; + for (int i=0, n=info->param_count-info->optional_count; i <= n; i++) + { + if (info->paramTraits(i) == NUMBER_TYPE) + { + offset += 8; + } + else + { + offset += 4; + } + } + + // now copy the default optional values + OP* argcarg = ldargIns(_argc); + for (int i=0, n=info->optional_count; i < n; i++) + { + // first set the local[p+1] = defaultvalue + int param = i + info->param_count - info->optional_count; // 0..N + int loc = param+1; + + #ifdef AVMPLUS_VERBOSE + if (verbose()) + core->console << " init optional param " << loc << "\n"; + #endif + + OP* defaultVal = InsConst((int)info->getDefaultValue(i)); + defaultVal = defIns(atomToNativeRep(loc, defaultVal)); + + // then generate: if (argc > p) local[p+1] = arg[p+1] + OP* cmp = binaryIns(MIR_icmp, argcarg, InsConst((int32)param)); + OP* br = Ins(MIR_jle, cmp); // will patch + OP* arg; + if (isDouble(loc)) + { + arg = loadIns(MIR_fldop, offset, apArg); + offset += 8; + } + else + { + arg = loadIns(MIR_ldop, offset, apArg); + offset += 4; + } + arg = defIns(arg); + arg->join = defaultVal; + localSet(loc, defaultVal); + + br->target = Ins(MIR_bb); + + firstCse = ip; + } + } + else + { + // !HAS_OPTIONAL + AvmAssert(info->optional_count == 0); + } + + // now set up the required args (we can ignore argc) + // for (int i=0, n=param_count; i <= n; i++) + // framep[i] = argv[i]; + int offset = 0; + for (int i=0, n=info->param_count-info->optional_count; i <= n; i++) + { + #ifdef AVMPLUS_VERBOSE + if (verbose()) + core->console << " param " << i << "\n"; + #endif + Traits* t = info->paramTraits(i); + OP* arg; + if (t == NUMBER_TYPE) + { + arg = loadIns(MIR_fldop, offset, apArg); + localSet(i, arg); + offset += 8; + } + else + { + arg = loadIns(MIR_ldop, offset, apArg); + localSet(i, arg); + offset += 4; + } + } + + if (info->flags & AbstractFunction::UNBOX_THIS) + { + localSet(0, atomToNativeRep(0, localGet(0))); + } + + int firstLocal = 1+info->param_count; + + // capture remaining args + if (info->flags & AbstractFunction::NEED_REST) + { + #ifdef AVMPLUS_VERBOSE + if (verbose()) + core->console << " create rest\n"; + #endif + + //framep[info->param_count+1] = createRest(env, argv, argc); + OP* argcArg = ldargIns(_argc); + OP* apArg = ldargIns(_ap); + + // use csop so if rest value never used, we don't bother creating array + OP* rest = callIns(MIR_cmop, ENVADDR(MethodEnv::createRestHelper), 3, + ldargIns(_env), argcArg, apArg); + + localSet(firstLocal, rest); + firstLocal++; + } + else if (info->flags & AbstractFunction::NEED_ARGUMENTS) + { + #ifdef AVMPLUS_VERBOSE + if (verbose()) + core->console << " create arguments\n"; + #endif + + //framep[info->param_count+1] = createArguments(env, argv, argc); + OP* argcArg = ldargIns(_argc); + OP* apArg = ldargIns(_ap); + + // use csop so if arguments never used, we don't create it + OP* arguments = callIns(MIR_cmop, ENVADDR(MethodEnv::createArgumentsHelper), 3, + ldargIns(_env), argcArg, apArg); + + localSet(firstLocal, arguments); + firstLocal++; + } + + undefConst = InsConst(undefinedAtom); + if (firstLocal < state->verifier->local_count) + { + // set remaining locals to undefined + for (int i=firstLocal, n=state->verifier->local_count; i < n; i++) + { + if(!(state->value(i).traits == NULL)){ // expecting * + AvmAssertMsg(0,"(state->value(i).traits != NULL)"); + return false; // fail verify + } + localSet(i, undefConst); + } + } + + #ifdef DEBUGGER + + for (int i=state->verifier->scopeBase; iverifier->scopeBase+state->verifier->max_scope; ++i) + { + localSet(i, undefConst); + } + + #ifdef AVMPLUS_VERBOSE + if (verbose()) + core->console << " debug_enter\n"; + #endif + + callIns(MIR_cm, ENVADDR(MethodEnv::debugEnter), 8, + ldargIns(_env), ldargIns(_argc), ldargIns(_ap), // for sendEnter + leaIns(0, localTraits), InsConst(state->verifier->local_count), // for clearing traits pointers + leaIns(0, _callStackNode), + leaIns(0, localPtrs), + info->hasExceptions() ? leaIns(0, _save_eip) : InsConst(0) + ); + + #endif // DEBUGGER + + if (info->isFlagSet(AbstractFunction::HAS_EXCEPTIONS)) + { + #ifdef AVMPLUS_VERBOSE + if (verbose()) + core->console << " exception setup\n"; + #endif + + // _ef.beginTry(core); + callIns(MIR_cm, EFADDR(ExceptionFrame::beginTry), 2, + leaIns(0,_ef), InsConst((int32)core)); + + // spill prior to jmp so that our stack is cleared of + // any transient locals. + saveState(); + + // force the locals to be clean for the setjmp call + Ins(MIR_bb); + firstCse = ip; + + // Exception* _ee = setjmp(_ef.jmpBuf); + // ISSUE this needs to be a cdecl call + OP* jmpbuf = leaIns(offsetof(ExceptionFrame, jmpbuf), _ef); + OP* ee = callIns(MIR_cs, SETJMP, 2, + jmpbuf, InsConst(0)); + + // if (setjmp() == 0) goto start + OP* cond = binaryIns(MIR_ucmp, ee, InsConst(0)); + OP* exBranch = Ins(MIR_jeq, cond); + + // exception case + exAtom = loadIns(MIR_ld, offsetof(Exception, atom), ee); + // need to convert exception from atom to native rep, at top of + // catch handler. can't do it here because it could be any type. + + // _ef.beginCatch() + // ISSUE why do we have to redefine ef? it is NULL when exception happens + OP* pc = loadIns(MIR_ld, 0, _save_eip); + OP* handler = callIns(MIR_cm, COREADDR(AvmCore::beginCatch), 5, + InsConst((int)core), leaIns(0,_ef), InsConst((int)info), pc, ee); + + // jump to catch handler + Ins(MIR_jmpi, handler, (int32)offsetof(ExceptionHandler, target)); + + // target of conditional + exBranch->target = Ins(MIR_bb); + + // don't want cse's to live past indirect jumps + firstCse = ip; + } + + // If interrupts are enabled, generate an interrupt check. + // This ensures at least one interrupt check per method. + if (interruptable && core->interrupts) + { + if (state->insideTryBlock) + storeIns(InsConst(state->pc), 0, _save_eip); + + OP* interrupted = loadIns(MIR_ld, (int)&core->interrupted, NULL); + OP* br = Ins(MIR_jne, binaryIns(MIR_ucmp, interrupted, InsConst(0))); + mirPatchPtr(&br->target, interrupt_label); + } + + // this is not fatal but its good to know if our prologue estimation code is off. + #if defined(AVMPLUS_PROFILE) && defined(_DEBUG) + sizingStats[SZ_ABC] = (int)abcEnd-(int)abcStart; + sizingStats[SZ_MIREXP] = expansionFactor; + int actual_prologue_size = ((int)ip-(int)ipStart); + sizingStats[SZ_MIRPRO] = (double)(actual_prologue_size-prologue_size) / prologue_size; + AvmAssertMsg( prologue_size >= actual_prologue_size , "Increase prologue_size estimation\n"); + #endif + + InsAlloc(0); + + return true; + } + + void CodegenMIR::emitCopy(FrameState* state, int src, int dest) + { + this->state = state; + // local[dest] = local[src] + localSet(dest, localGet(src)); + } + + void CodegenMIR::emitGetscope(FrameState* state, int scope_index, int dest) + { + this->state = state; + Traits* t = info->declaringTraits->scope->scopes[scope_index].traits; + OP* declVTable = loadIns(MIR_ldop, offsetof(MethodEnv, vtable), ldargIns(_env)); + OP* scope = loadIns(MIR_ldop, offsetof(VTable, scope), declVTable); + OP* scopeobj = loadIns(MIR_ldop, offsetof(ScopeChain, scopes) + scope_index*sizeof(Atom), scope); + localSet(dest, atomToNativeRep(t, scopeobj)); + } + + void CodegenMIR::emitSwap(FrameState* state, int i, int j) + { + this->state = state; + OP* a = localGet(i); + OP* b = localGet(j); + localSet(i, b); + localSet(j, a); + } + + void CodegenMIR::emitKill(FrameState* state, int i) + { + this->state = state; + localSet(i, undefConst); + } + + void CodegenMIR::emitSetContext(FrameState *state, AbstractFunction *f) + { + this->state = state; + // + // initialize the code context + // + if (isCodeContextChanged()) + { + if (!f || f->usesCallerContext()) + { + #ifdef AVMPLUS_VERBOSE + if (verbose()) + core->console << " set code context\n"; + #endif + + // core->codeContext = env; + storeIns(ldargIns(_env), (int)&core->codeContextAtom, 0); + } + + if (!f || f->usesDefaultXmlNamespace()) + { + emitSetDxns(state); + + // used to dump all functions that still say they required DXNS code + #if 0//def _DEBUG + if (f && (f->flags & AbstractFunction::NATIVE)) + { + StringBuffer buffer(core); + const wchar *foo = f->name->c_str(); + buffer << "function is:" << foo << "\r\n"; + + AvmDebugMsg (false, buffer.c_str()); + //core->console << " f-> + } + #endif + } + } + } + + void CodegenMIR::emitSetDxns(FrameState* state) + { + this->state = state; + + OP* dxnsAddr; + + #ifdef AVMPLUS_VERBOSE + if (verbose()) + core->console << " set dxns addr\n"; + #endif + if (info->isFlagSet(AbstractFunction::SETS_DXNS)) + { + dxnsAddr = leaIns(0,dxns); + } + else + { + // dxnsAddr = &env->vtable->scope->defaultXmlNamespace + OP* env = ldargIns(_env); + OP* declVTable = loadIns(MIR_ldop, offsetof(MethodEnv, vtable), env); + OP* scope = loadIns(MIR_ldop, offsetof(VTable, scope), declVTable); + dxnsAddr = leaIns(offsetof(ScopeChain, defaultXmlNamespace), scope); + } + + storeIns(dxnsAddr, (int)&core->dxnsAddr, 0); + } + + void CodegenMIR::merge(const Value& current, Value& target) + { + if (target.ins != current.ins) + { + AvmAssert((target.ins->code&~MIR_float) == MIR_def); + AvmAssert(current.ins->code == target.ins->code); + + OP* t = target.ins; + while (t->join) t = t->join; + + OP* c = current.ins; + while (c->join) c = c->join; + + // t and c are both original defs now. one needs to be joined + // to the other based on which one came first. + // lastUse is the end of the combined live range of all defs + // we can see. + + if (c < t) + { + #ifdef AVMPLUS_VERBOSE + if (verbose()) + core->console << " f @" << InsNbr(t) << "->join = @" << InsNbr(c) << "\n"; + #endif + + t->join = c; + if (t->lastUse > c->lastUse) + c->lastUse = t->lastUse; + t->lastUse = 0; + target.ins = c; + } + else if (c > t) + { + #ifdef AVMPLUS_VERBOSE + if (verbose()) + core->console << " b @" << InsNbr(c) << "->join = @" << InsNbr(t) << "\n"; + #endif + + c->join = t; + if (c->lastUse > t->lastUse) + t->lastUse = c->lastUse; + c->lastUse = 0; + } + } + } + + + void CodegenMIR::emitBlockStart(FrameState* state) + { + // our new extended BB now starts here, this means that any branch targets + // should hit the next instruction our bb start instruction + OP* bb = Ins(MIR_bb); // mark start of block + firstCse = ip; + + // get a label for our block start and tie it to this location + mirLabel(state->verifier->getFrameState(state->pc)->label, bb); + + lastFunctionCall = 0; // reset location of last function call + + // If this is a backwards branch, generate an interrupt check. + // current verifier state, includes tack pointer. + if (interruptable && core->interrupts && state->targetOfBackwardsBranch) + { + if (state->insideTryBlock) + storeIns(InsConst(state->pc), 0, _save_eip); + + OP* interrupted = loadIns(MIR_ld, (int)&core->interrupted, NULL); + OP* br = Ins(MIR_jne, binaryIns(MIR_ucmp, interrupted, InsConst(0))); + mirPatchPtr(&br->target, interrupt_label); + } + } + + void CodegenMIR::emitBlockEnd(FrameState* state) + { + this->state = state; + +#ifdef AVMPLUS_VERBOSE + if (verbose()) + core->console << " block end\n"; +#endif + + // our eBB now terminates. For all branch instructions we are + // able to detect this situation and have already generated the + // correct spill code prior to the jump, only for the case where + // the pc is a target of a jump do we not know enough during emit() + // to do this. The Verifier tracks this information and merges + // the states across the various blocks generating this op prior + // to the merge. After this emit, we should receive an emitBlockStart() + // from the Verifier. + saveState(); + } + + void CodegenMIR::emitIntConst(FrameState* state, int index, int c) + { + this->state = state; + localSet(index, InsConst(c)); + } + + void CodegenMIR::emitDoubleConst(FrameState* state, int index, double* pd) + { + this->state = state; + localSet(index, loadIns(MIR_fldop, (int)pd, NULL)); + } + + void CodegenMIR::emitCoerce(FrameState* state, int loc, Traits* result) + { + this->state = state; + emitPrep(OP_coerce); + + Value& value = state->value(loc); + Traits* in = value.traits; + + if (result == NULL) + { + // coerce to * is simple, we just save the atom rep. + localSet(loc, loadAtomRep(loc)); + } + else if (result == OBJECT_TYPE) + { + if (in == NULL || in == VOID_TYPE) + { + // value already boxed but we need to coerce undefined->null + if (!value.notNull) + localSet(loc, callIns(MIR_csop, FUNCADDR(CodegenMIR::coerce_o), 1, + localGet(loc))); + } + else + { + // value cannot be undefined so just box it + localSet(loc, loadAtomRep(loc)); + } + } + else if (!result->isMachineType && in == NULL_TYPE) + { + // do nothing, it's fine to coerce null to a pointer type + } + else if (result == NUMBER_TYPE) + { + if (in && in->isNumeric || in == BOOLEAN_TYPE) + { + localSet(loc, promoteNumberIns(in, loc)); + } + else + { + // * -> Number + localSet(loc, callIns(MIR_fcmop, COREADDR(AvmCore::number), 2, + InsConst((int)core), loadAtomRep(loc))); + } + } + else if (result == INT_TYPE) + { + if (in == UINT_TYPE || in == BOOLEAN_TYPE) + { + //do nothing + } + else if (in == NUMBER_TYPE) + { + OP* ins = value.ins; + if (ins != NULL && ins->code == MIR_fadd && + (ins->oprnd1->code == MIR_u2d || ins->oprnd1->code == MIR_i2d) && + (ins->oprnd2->code == MIR_u2d || ins->oprnd2->code == MIR_i2d)) + { + // old: int(fadd(Number(int),Number(int))) + // new: iadd(int,int) + OP* orig = value.ins; + localSet(loc, binaryIns(MIR_add, ins->oprnd1->oprnd1, ins->oprnd2->oprnd1)); + markDead(orig); + } + else if (ins != NULL && ins->code == MIR_fsub && + ins->oprnd1->code == MIR_i2d && + ins->oprnd2->code == MIR_i2d) + { + OP* orig = value.ins; + localSet(loc, binaryIns(MIR_sub, ins->oprnd1->oprnd1, ins->oprnd2->oprnd1)); + markDead(orig); + } + else if (ins != NULL && ((ins->code == MIR_i2d) || (ins->code == MIR_u2d))) + { + OP* orig = value.ins; + localSet(loc, ins->oprnd1); + markDead(orig); + } + else + { + int funcaddr = FUNCADDR(AvmCore::integer_d); + // narrowing conversion number->int + #ifdef AVMPLUS_IA32 + if (core->sse2) + funcaddr = FUNCADDR(AvmCore::integer_d_sse2); + #endif + localSet(loc, callIns(MIR_csop, funcaddr, 1, localGet(loc))); + } + } + else + { + // * -> int + localSet(loc, callIns(MIR_cmop, COREADDR(AvmCore::integer), 2, + InsConst((int)core), loadAtomRep(loc))); + } + } + else if (result == UINT_TYPE) + { + if (in == INT_TYPE || in == BOOLEAN_TYPE) + { + //do nothing + } + else if (in == NUMBER_TYPE) + { + OP* ins = value.ins; + if (ins != NULL && ins->code == MIR_fadd && + (ins->oprnd1->code == MIR_u2d || ins->oprnd1->code == MIR_i2d) && + (ins->oprnd2->code == MIR_u2d || ins->oprnd2->code == MIR_i2d)) + { + // old: uint(fadd(Number(uint),Number(uint))) + // new: iadd(int,int) + OP* orig = value.ins; + localSet(loc, binaryIns(MIR_add, ins->oprnd1->oprnd1, ins->oprnd2->oprnd1)); + markDead(orig); + } + else if (ins != NULL && ((ins->code == MIR_i2d) || (ins->code == MIR_u2d))) + { + OP* orig = value.ins; + localSet(loc, ins->oprnd1); + markDead(orig); + } + else + { + + #ifdef AVMPLUS_IA32 + if (core->sse2) + { + localSet(loc, callIns(MIR_csop, FUNCADDR(AvmCore::integer_d_sse2), 1, + localGet(loc))); + } + else + #endif + { + localSet(loc, callIns(MIR_csop, FUNCADDR(AvmCore::integer_d), 1, + localGet(loc))); + } + } + } + else + { + // * -> uint + localSet(loc, callIns(MIR_cmop, COREADDR(AvmCore::toUInt32), 2, + InsConst((int)core), loadAtomRep(loc))); + } + } + else if (result == BOOLEAN_TYPE) + { + if (in == NUMBER_TYPE) + { + localSet(loc, Ins(MIR_ne, binaryFcmpIns( + localGet(loc), i2dIns(InsConst(0))))); + } + else if (in == INT_TYPE || in == UINT_TYPE || (in && !in->notDerivedObjectOrXML)) + { + localSet(loc, Ins(MIR_ne, binaryIns(MIR_icmp, + localGet(loc), InsConst(0)))); + } + else + { + // * -> Boolean + localSet(loc, callIns(MIR_cmop, COREADDR(AvmCore::boolean), 2, + InsConst((int)core), loadAtomRep(loc))); + } + } + else if (result == STRING_TYPE) + { + if (in == INT_TYPE) + { + localSet(loc, callIns(MIR_cmop, COREADDR(AvmCore::intToString), 2, + InsConst((int)core), localGet(loc))); + } + else if (in == UINT_TYPE) + { + localSet(loc, callIns(MIR_cmop, COREADDR(AvmCore::uintToString), 2, + InsConst((int)core), localGet(loc))); + } + else if (in == NUMBER_TYPE) + { + localSet(loc, callIns(MIR_cmop, COREADDR(AvmCore::doubleToString), 2, + InsConst((int)core), localGet(loc))); + } + else if (in == BOOLEAN_TYPE) + { + // load "true" or "false" + OP *index = binaryIns(MIR_lsh, localGet(loc), InsConst(2)); + localSet(loc, loadIns(MIR_ldop, (int)&core->booleanStrings, index)); + } + else if (value.notNull) + { + // not eligible for CSE, and we know it's not null/undefined + localSet(loc, callIns(MIR_cm, COREADDR(AvmCore::string), 2, + InsConst((int)core), loadAtomRep(loc))); + } + else + { + localSet(loc, callIns(MIR_cm, COREADDR(AvmCore::coerce_s), 2, + InsConst((int)core), loadAtomRep(loc))); + } + } + else if (in && !in->isMachineType && !result->isMachineType + && in != STRING_TYPE && in != NAMESPACE_TYPE) + { + OP* toplevel = loadToplevel(ldargIns(_env)); + // coerceobj is void, but we mustn't optimize it out; verifier only calls it when required + callIns(MIR_cm, TOPLEVELADDR(Toplevel::coerceobj), 3, + toplevel, localGet(loc), InsConst((int32)result)); + // the input pointer has now been checked but it's still the same value. + // verifier remembers this fact by updating the verify time type. + } + else if (!result->isMachineType && result != NAMESPACE_TYPE) + { + // result is a ScriptObject based type. + localSet(loc, callIns(MIR_cm, ENVADDR(MethodEnv::coerceAtom2SO), 3, + ldargIns(_env), loadAtomRep(loc), InsConst((int)result))); + } + else + { + OP* value = loadAtomRep(loc); + OP* toplevel = loadToplevel(ldargIns(_env)); + // sp[0] = toplevel->coerce(sp[0], traits) + OP* out = callIns(MIR_cmop, TOPLEVELADDR(Toplevel::coerce), 3, + toplevel, + value, + InsConst((int32)result)); + + // store the result + localSet(loc, atomToNativeRep(result, out)); + } + } + + void CodegenMIR::emitCheckNull(FrameState* state, int index) + { + this->state = state; + emitPrep(OP_convert_o); + + // The result is either unchanged or an exception is thrown, so + // we don't save the result. This is the null pointer check. + Traits* t = state->value(index).traits; + if (!t || t == OBJECT_TYPE || t == VOID_TYPE) + { + // checking atom for null or undefined (AvmCore::isNullOrUndefined()) + OP* value = localGet(index); + callIns(MIR_cm, ENVADDR(MethodEnv::nullcheck), 2, ldargIns(_env), value); + } + else if (!t->isMachineType) + { + // checking pointer for null + OP* value = localGet(index); + OP* br = Ins(MIR_jeq, binaryIns(MIR_ucmp, value, InsConst(0))); // will be patched + mirPatchPtr(&br->target, npe_label); + } + // else: number, int, uint, and boolean, are never null + } + + void CodegenMIR::emitPrep(AbcOpcode opcode) + { + #ifdef AVMPLUS_PROFILE + DynamicProfiler::StackMark mark(OP_codegenop, &core->dprof); + if (core->dprof.dprofile) + { + callIns(MIR_cm, COREADDR(DynamicProfiler::mark), 1, + (int)&core->dprof, InsConst(opcode)); + } + #else + (void)opcode; + #endif /* AVMPLUS_PROFILE */ + + // update bytecode ip if necessary + if (state->insideTryBlock && lastPcSave != state->pc) + { + storeIns(InsConst(state->pc), 0, _save_eip); + lastPcSave = state->pc; + } + } + + void CodegenMIR::emitCall(FrameState *state, AbcOpcode opcode, int method_id, int argc, Traits* result) + { + this->state = state; + emitPrep(opcode); + + int sp = state->sp(); + + int dest = sp-argc; + int objDisp = dest; + + // make sure null check happened. + AvmAssert(state->value(objDisp).notNull); + + OP *method = NULL; + OP *iid = NULL; + switch (opcode) + { + case OP_constructsuper: + { + // env->vtable->base->init->enter32v(argc, ...); + OP* envArg = ldargIns(_env); + OP* vtable = loadIns(MIR_ldop, offsetof(MethodEnv, vtable), envArg); + OP* base = loadIns(MIR_ldop, offsetof(VTable,base), vtable); + method = loadIns(MIR_ldop, offsetof(VTable,init), base); + break; + } + case OP_callmethod: + { + // stack in: obj arg1..N + // stack out: result + // sp[-argc] = callmethod(disp_id, argc, ...); + // method_id is disp_id of virtual method + OP* vtable = loadVTable(objDisp); + method = loadIns(MIR_ldop, offsetof(VTable, methods)+4*method_id, vtable); + break; + } + case OP_callsuperid: + { + // stack in: obj arg1..N + // stack out: result + // method_id is disp_id of super method + OP* declvtable = loadIns(MIR_ldop, offsetof(MethodEnv, vtable), ldargIns(_env)); + OP* basevtable = loadIns(MIR_ldop, offsetof(VTable, base), declvtable); + method = loadIns(MIR_ldop, offsetof(VTable, methods)+4*method_id, basevtable); + break; + } + case OP_callstatic: + { + // stack in: obj arg1..N + // stack out: result + + OP* vtable = loadIns(MIR_ldop, offsetof(MethodEnv, vtable), ldargIns(_env)); + OP* abcenv = loadIns(MIR_ldop, offsetof(VTable, abcEnv), vtable); + method = loadIns(MIR_ldop, offsetof(AbcEnv,methods)+4*method_id, abcenv); + break; + } + case OP_callinterface: + { + // method_id is pointer to interface method name (multiname) + int index = method_id % Traits::IMT_SIZE; + OP* vtable = loadVTable(objDisp); + method = loadIns(MIR_ldop, offsetof(VTable, imt)+4*index, vtable); + iid = InsConst(method_id); + break; + } + default: + AvmAssert(false); + } + + // store args for the call + int index = objDisp; + OP* ap = InsAlloc(4); + int disp = 0; + for (int i=0; i <= argc; i++) + { + OP* v = localGet(index++); + storeIns(v, disp, ap); + disp += v->spillSize(); + } + // patch the size to what we actually need + ap->size = disp; + + OP* target = leaIns(offsetof(MethodEnv, impl32), method); + OP* apAddr = leaIns(0, ap); + + OP* out = callIndirect(result==NUMBER_TYPE ? MIR_fci : MIR_ci, target, 4, + method, InsConst(argc), apAddr, iid); + + InsDealloc(ap); + + if (opcode != OP_constructsuper) + { + localSet(dest, out); + } + } + + void CodegenMIR::emit(FrameState* state, AbcOpcode opcode, int op1, int op2, Traits* result) + { + this->state = state; + emitPrep(opcode); + + int sp = state->sp(); + + switch (opcode) + { + case OP_jump: + { + // spill everything first + int targetpc = op1; + + saveState(); + +#ifdef DEBUGGER + if(core->sampling && targetpc < state->pc) + { + emitSampleCheck(); + } +#endif + + // relative branch + OP* p = Ins(MIR_jmp); // will be patched + + mirPatch(p, targetpc); + break; + } + + case OP_lookupswitch: + { + //int index = integer(*(sp--)); + //pc += readS24(index < readU16(pc+4) ? + // (pc+6+3*index) : // matched case + // (pc+1)); // default + int count = 1 + op2; + int targetpc = op1; + + AvmAssert(state->value(sp).traits == INT_TYPE); + + saveState(); + + OP* input = localGet(sp); + OP* cmp = binaryIns(MIR_ucmp, input, InsConst(count)); + OP* p = Ins(MIR_jnlt, cmp); // will be patched + mirPatch(p, targetpc); + + // now for non-default + OP* offset = binaryIns(MIR_lsh, input, InsConst(2)); // const mul by 4 + + //OP* target = loadIns((int)casePtr, offset); + OP* jmpt = Ins(MIR_jmpt, offset, count); // indirect jump using jmp table + + // fill in case address entries. These are absolute bytecode offsets + // that later we will resolve to absolute machine addresses. + // we can't do it now because they could be forward branches + const byte* pc = 4 + abcStart + state->pc; + AvmCore::readU30(pc); + + for (int i=0; i < count; i++) + { + int off = state->pc + AvmCore::readS24(pc+3*i); + mirPatchPtr(&jmpt->args[i+1], off); // patch case table + if (off < state->pc) + extendLastUse(jmpt, off); + } + AvmAssert(sizeof(OP)==16); // jump table size calc relies on this + ip += (count+3)/4; // skip jump table + case_count += count; + + // don't want cse's to live past indirect jumps + firstCse = ip; + break; + } + + case OP_setglobalslot: + case OP_setslot: + case OP_getslot: + { + Traits* t; + OP* ptr; + int ptr_index; + + if (opcode == OP_getslot || opcode == OP_setslot) + { + ptr_index = op2; + t = state->value(ptr_index).traits; + ptr = localGet(ptr_index); + AvmAssert(state->value(ptr_index).notNull); + AvmAssert(isPointer(ptr_index)); // obj + } + else + { + ScopeTypeChain* scopeTypes = info->declaringTraits->scope; + if (scopeTypes->size == 0) + { + // no captured scopes, so scope 0 is a local scope + ptr_index = state->verifier->scopeBase; + t = state->value(ptr_index).traits; + ptr = localGet(ptr_index); + AvmAssert(state->value(ptr_index).notNull); + AvmAssert(isPointer(ptr_index)); // obj + } + else + { + t = scopeTypes->scopes[0].traits; + OP* declVTable = loadIns(MIR_ldop, offsetof(MethodEnv, vtable), ldargIns(_env)); + OP* scope = loadIns(MIR_ldop, offsetof(VTable, scope), declVTable); + OP* scopeobj = loadIns(MIR_ld, offsetof(ScopeChain, scopes) + 0*sizeof(Atom), scope); + ptr = atomToNativeRep(t, scopeobj); + } + } + + int slot = op1; + + AvmAssert(t->linked); + int offset = t->getOffsets()[slot]; + + if (pool->isBuiltin && !t->final) + { + // t's slots aren't locked in, so we have to adjust for the actual runtime + // traits->sizeofInstance. + OP* vtable = loadIns(MIR_ldop, offsetof(ScriptObject,vtable), ptr); + OP* traits = loadIns(MIR_ldop, offsetof(VTable,traits), vtable); + offset -= t->sizeofInstance; + OP* sizeofInstance = loadIns(MIR_ldop, offsetof(Traits, sizeofInstance), traits); + ptr = binaryIns(MIR_add, sizeofInstance, ptr); + } + + if (opcode == OP_getslot) + { + // get + localSet(op2, loadIns(result == NUMBER_TYPE ? MIR_fld : MIR_ld, offset, ptr)); + } + else + { + // set + OP* value = localGet(sp); + + #ifndef MMGC_DRC + storeIns(value, offset, ptr); + #endif + + #ifdef WRITE_BARRIERS + // if storing to a pointer-typed slot, inline a WB + Traits* slotType = t->getSlotTraits(slot); + + if (core->GetGC()->incremental && + (!slotType || !slotType->isMachineType || slotType == OBJECT_TYPE) && + value->code != MIR_imm) + { + #ifdef MMGC_DRC + MirOpcode op = MIR_cm; + int32 wbAddr = GCADDR(GC::writeBarrierRC); + if(slotType == NULL || slotType == OBJECT_TYPE) { + // use fast atom wb + // TODO: inline pointer check + op = MIR_cs; + wbAddr = FUNCADDR(AvmCore::atomWriteBarrier); + } + callIns(op, wbAddr, 4, + InsConst((int)core->GetGC()), + ptr, + leaIns(offset, ptr), + value); + #else // !DRC + // use non-substitute WB + callIns(MIR_cm, GCADDR(GC::WriteBarrierTrap), 3, + InsConst((int)core->gc), + ptr, + (slotType && slotType != OBJECT_TYPE) ? value : + binaryIns(MIR_and, value, InsConst(~7))); + #endif + } + #ifdef MMGC_DRC + else { + storeIns(value, offset, ptr); + } + #endif //MMGC_DRC + #endif //WRITE_BARRIERS + } + break; + } + + case OP_returnvoid: + case OP_returnvalue: + { + // ISSUE if a method has multiple returns this causes some bloat + + // restore AvmCore::dxnsAddr if we set it to a stack addr in our frame + if(info->setsDxns()) { + storeIns(dxnsAddrSave, (int)&core->dxnsAddr, 0); + } + + #ifdef DEBUGGER + callIns(MIR_cm, ENVADDR(MethodEnv::debugExit), 2, + ldargIns(_env), leaIns(0, _callStackNode)); + // now we toast the cse and restore contents in order to + // ensure that any variable modifications made by the debugger + // will be pulled in. + firstCse = ip; + #endif // DEBUGGER + + if (info->exceptions) + { + // _ef.endTry(); + OP* ef = leaIns(0, _ef); + callIns(MIR_cm, EFADDR(ExceptionFrame::endTry), 1, + ef); + } + + OP* retvalue; + if (opcode == OP_returnvalue) + { + // already coerced to required native type + retvalue = localGet(op1); + } + else + { + retvalue = undefConst; + Traits* t = info->returnTraits(); + if (t && t != VOID_TYPE) + { + // implicitly coerce undefined to the return type + OP* toplevel = loadToplevel(ldargIns(_env)); + retvalue = callIns(MIR_cmop, TOPLEVELADDR(Toplevel::coerce), 3, + toplevel, retvalue, InsConst((int32)t)); + retvalue = atomToNativeRep(t, retvalue); + } + } +#ifdef AVMPLUS_IA32 + OP* ret = Ins(MIR_ret, retvalue); + // try to make sure return value ends up in EAX + if (!retvalue->isDouble()) + updateUse(ret, ret->oprnd1, EAX); +#else + Ins(MIR_ret, retvalue); +#endif + break; + } + + case OP_typeof: + { + //sp[0] = typeof(sp[0]); + OP* value = loadAtomRep(op1); + OP* i3 = callIns(MIR_cmop, COREADDR(AvmCore::_typeof), 2, + InsConst((int32)core), value); + AvmAssert(result == STRING_TYPE); + localSet(op1, i3); + break; + } + + case OP_not: + { + AvmAssert(state->value(op1).traits == BOOLEAN_TYPE); + + OP* value = localGet(op1); + OP* i3 = binaryIns(MIR_xor, value, InsConst(1)); + localSet(op1, i3); + break; + } + + case OP_negate: + { + OP* in = localGet(op1); + OP* out = Ins(MIR_fneg, in); + localSet(op1, out); + break; + } + + case OP_negate_i: + { + //framep[op1] = -framep[op1] + AvmAssert(state->value(op1).traits == INT_TYPE); + OP* value = localGet(op1); + OP* i2 = Ins(MIR_neg, value); // -number + localSet(op1, i2); + break; + } + + case OP_increment: + case OP_decrement: + case OP_inclocal: + case OP_declocal: + { + OP* in = localGet(op1); + OP* inc = i2dIns(InsConst(op2)); // 1 or -1 + OP* out = binaryIns(MIR_fadd, in, inc); + localSet(op1, out); + break; + } + + case OP_inclocal_i: + case OP_declocal_i: + case OP_increment_i: + case OP_decrement_i: + { + AvmAssert(state->value(op1).traits == INT_TYPE); + OP* in = localGet(op1); + OP* out = binaryIns(MIR_add, in, InsConst(op2)); + localSet(op1, out); + break; + } + + case OP_bitnot: + { + // *sp = core->intToAtom(~integer(*sp)); + AvmAssert(state->value(op1).traits == INT_TYPE); + OP* value = localGet(op1); + OP* out = binaryIns(MIR_xor, value, InsConst(~0)); + localSet(op1, out); + break; + } + + case OP_modulo: + { + OP* lhs = localGet(sp-1); + OP* rhs = localGet(sp); + OP* out = callIns(MIR_fcsop, FUNCADDR(MathUtils::mod), 2, + lhs, rhs); + localSet(sp-1, out); + break; + } + + case OP_add_d: + case OP_subtract: + case OP_subtract_i: + case OP_add_i: + case OP_multiply: + case OP_multiply_i: + case OP_divide: + case OP_lshift: + case OP_rshift: + case OP_urshift: + case OP_bitand: + case OP_bitor: + case OP_bitxor: + { + MirOpcode mircode=MIR_last; + switch (opcode) { + case OP_bitxor: mircode = MIR_xor; break; + case OP_bitor: mircode = MIR_or; break; + case OP_bitand: mircode = MIR_and; break; + case OP_urshift: mircode = MIR_ush; break; + case OP_rshift: mircode = MIR_rsh; break; + case OP_lshift: mircode = MIR_lsh; break; + case OP_divide: mircode = MIR_fdiv; break; + case OP_multiply: mircode = MIR_fmul; break; + case OP_multiply_i: mircode = MIR_imul; break; + case OP_add_i: mircode = MIR_add; break; + case OP_subtract_i: mircode = MIR_sub; break; + case OP_subtract: mircode = MIR_fsub; break; + case OP_add_d: mircode = MIR_fadd; break; + default: break; + } + OP* lhs = localGet(sp-1); + OP* rhs = localGet(sp); + OP* out = binaryIns(mircode, lhs, rhs); + localSet(sp-1, out); + break; + } + + case OP_throw: + { + // flush it all out + OP* value = loadAtomRep(op1); + saveState(); + //throwAtom(*sp--); + callIns(MIR_cm, COREADDR(AvmCore::throwAtom), 2, + InsConst((int32)core), value); + break; + } + + case OP_getsuper: + { + // stack in: obj [ns [name]] + // stack out: value + // sp[0] = env->getsuper(sp[0], multiname) + int objDisp = sp; + OP* multi = initMultiname((Multiname*)op1, objDisp); + AvmAssert(state->value(objDisp).notNull); + + OP* obj = loadAtomRep(objDisp); + + OP* i3 = callIns(MIR_cm, ENVADDR(MethodEnv::getsuper), 3, + ldargIns(_env), obj, leaIns(0,multi)); + + InsDealloc(multi); + + i3 = atomToNativeRep(result, i3); + localSet(objDisp, i3); + break; + } + + case OP_setsuper: + { + // stack in: obj [ns [name]] value + // stack out: nothing + // core->setsuper(sp[-1], multiname, sp[0], env->vtable->base) + int objDisp = sp-1; + OP* multi = initMultiname((Multiname*)op1, objDisp); + AvmAssert(state->value(objDisp).notNull); + + OP* obj = loadAtomRep(objDisp); + OP* value = loadAtomRep(sp); + + callIns(MIR_cm, ENVADDR(MethodEnv::setsuper), 4, + ldargIns(_env), obj, leaIns(0, multi), value); + + InsDealloc(multi); + break; + } + + case OP_nextname: + case OP_nextvalue: + { + // sp[-1] = next[name|value](sp[-1], sp[0]); + OP* obj = loadAtomRep(sp-1); + AvmAssert(state->value(sp).traits == INT_TYPE); + OP* index = localGet(sp); + OP* i1 = callIns(MIR_cm, (opcode == OP_nextname) ? ENVADDR(MethodEnv::nextname) : ENVADDR(MethodEnv::nextvalue), 3, + ldargIns(_env), obj, index); + localSet(sp-1, atomToNativeRep(result, i1)); + break; + } + + case OP_hasnext: + { + // sp[-1] = hasnext(sp[-1], sp[0]); + OP* obj = loadAtomRep(sp-1); + AvmAssert(state->value(sp).traits == INT_TYPE); + OP* index = localGet(sp); + OP* i1 = callIns(MIR_cm, ENVADDR(MethodEnv::hasnext), 3, + ldargIns(_env), obj, index); + AvmAssert(result == INT_TYPE); + localSet(sp-1, i1); + break; + } + + case OP_hasnext2: + { + OP* obj = InsAlloc(sizeof(Atom)); + OP* index = InsAlloc(sizeof(int)); + storeIns(loadAtomRep(op1), 0, obj); + storeIns(localGet(op2), 0, index); + OP* i1 = callIns(MIR_cm, ENVADDR(MethodEnv::hasnext2), 3, + ldargIns(_env), leaIns(0, obj), leaIns(0, index)); + localSet(op1, loadIns(MIR_ldop, 0, obj)); + localSet(op2, loadIns(MIR_ldop, 0, index)); + AvmAssert(result == BOOLEAN_TYPE); + localSet(sp+1, i1); + InsDealloc(obj); + InsDealloc(index); + break; + } + + case OP_newfunction: + { + //sp[0] = core->newfunction(env, body, _scopeBase, scopeDepth); + AbstractFunction* func = pool->getMethodInfo(op1); + int extraScopes = state->scopeDepth; + + // prepare scopechain args for call + OP* ap = storeAtomArgs(extraScopes, state->verifier->scopeBase); + + OP* envArg = ldargIns(_env); + OP* vtable = loadIns(MIR_ldop, offsetof(MethodEnv, vtable), envArg); + OP* outer = loadIns(MIR_ldop, offsetof(VTable, scope), vtable); + OP* argv = leaIns(0, ap); + + OP* i3 = callIns(MIR_cm, ENVADDR(MethodEnv::newfunction), 4, + envArg, InsConst((int32)func), outer, argv); + + InsDealloc(ap); + + AvmAssert(!result->isMachineType); + localSet(op2, i3); + break; + } + + case OP_call: + { + // stack in: method obj arg1..N + // sp[-argc-1] = call(env, sp[-argc], argc, ...) + int argc = op1; + int funcDisp = sp - argc - 1; + int dest = funcDisp; + + // convert args to Atom[] for the call + OP* func = loadAtomRep(funcDisp); + OP* ap = storeAtomArgs(loadAtomRep(funcDisp+1), argc, funcDisp+2); + + OP* toplevel = loadToplevel(ldargIns(_env)); + OP* argv = leaIns(0, ap); + + OP* i3 = callIns(MIR_cm, TOPLEVELADDR(Toplevel::op_call), 4, + toplevel, func, InsConst(argc), argv); + + InsDealloc(ap); + + localSet(dest, atomToNativeRep(result, i3)); + break; + } + + case OP_callproperty: + case OP_callproplex: + case OP_callpropvoid: + { + // stack in: obj [ns [name]] arg1..N + // stack out: result + + int argc = op2; + // obj = sp[-argc] + //tempAtom = callproperty(env, name, toVTable(obj), argc, ...); + // *(sp -= argc) = tempAtom; + int argv = sp-argc+1; + + int baseDisp = sp-argc; + OP* multi = initMultiname((Multiname*)op1, baseDisp); + + AvmAssert(state->value(baseDisp).notNull); + + // convert args to Atom[] for the call + OP* base = loadAtomRep(baseDisp); + OP* receiver = opcode == OP_callproplex ? InsConst(nullObjectAtom) : base; + OP* ap = storeAtomArgs(receiver, argc, argv); + + OP* vtable = loadVTable(baseDisp); + OP* toplevel = loadToplevel(ldargIns(_env)); + OP* atomv = leaIns(0, ap); + + OP* out = callIns(MIR_cm, TOPLEVELADDR(Toplevel::callproperty), 6, + toplevel, base, leaIns(0, multi), InsConst(argc), atomv, vtable); + + InsDealloc(ap); + InsDealloc(multi); + + localSet(baseDisp, atomToNativeRep(result, out)); + break; + } + + case OP_constructprop: + { + // stack in: obj [ns [name]] arg1..N + // stack out: result + + int argc = op2; + // obj = sp[-argc] + //tempAtom = callproperty(env, name, toVTable(obj), argc, ...); + // *(sp -= argc) = tempAtom; + int argv = sp-argc+1; + + int objDisp = sp-argc; + OP* multi = initMultiname((Multiname*)op1, objDisp); + AvmAssert(state->value(objDisp).notNull); + + // convert args to Atom[] for the call + OP* obj = loadAtomRep(objDisp); + OP* vtable = loadVTable(objDisp); + OP* ap = storeAtomArgs(obj, argc, argv); + + OP* toplevel = loadToplevel(ldargIns(_env)); + OP* atomv = leaIns(0, ap); + OP* i3 = callIns(MIR_cm, TOPLEVELADDR(Toplevel::constructprop), 5, + toplevel, leaIns(0, multi), InsConst(argc), atomv, vtable); + + InsDealloc(ap); + InsDealloc(multi); + + localSet(objDisp, atomToNativeRep(result, i3)); + break; + } + + case OP_callsuper: + case OP_callsupervoid: + { + // stack in: obj [ns [name]] arg1..N + // stack out: result + // null check must have already happened. + // tempAtom = callsuper(multiname, obj, sp-argc+1, argc, vtable->base); + int argc = op2; + int argv = sp - argc + 1; + int objDisp = sp - argc; + OP* multi = initMultiname((Multiname*)op1, objDisp); + AvmAssert(state->value(objDisp).notNull); + + // convert args to Atom[] for the call + OP* obj = loadAtomRep(objDisp); + + OP* ap = storeAtomArgs(obj, argc, argv); + + OP* atomv = leaIns(0, ap); + OP* i3 = callIns(MIR_cm, ENVADDR(MethodEnv::callsuper), 4, + ldargIns(_env), leaIns(0, multi), InsConst(argc), atomv); + + InsDealloc(ap); + InsDealloc(multi); + + localSet(objDisp, atomToNativeRep(result, i3)); + break; + } + + case OP_construct: + { + // stack in: method arg1..N + // sp[-argc] = construct(env, sp[-argc], argc, null, arg1..N) + int argc = op1; + int funcDisp = sp - argc; + int dest = funcDisp; + + OP* func = loadAtomRep(funcDisp); + + // convert args to Atom[] for the call + OP* ap = storeAtomArgs(InsConst(nullObjectAtom), argc, funcDisp+1); + + OP* toplevel = loadToplevel(ldargIns(_env)); + OP* argv = leaIns(0, ap); + + OP* i3 = callIns(MIR_cm, TOPLEVELADDR(Toplevel::op_construct), 4, + toplevel, func, InsConst(argc), argv); + + InsDealloc(ap); + + localSet(dest, atomToNativeRep(result, i3)); + break; + } + + case OP_newobject: + { + // result = env->op_newobject(sp, argc) + int argc = op1; + int dest = sp - (2*argc-1); + int arg0 = dest; + + // convert args to Atom for the call[] + OP* ap = storeAtomArgs(2*argc, arg0); + + OP* i3 = callIns(MIR_cm, ENVADDR(MethodEnv::op_newobject), 3, + ldargIns(_env), leaIns(4*(2*argc-1), ap), InsConst(argc)); + InsDealloc(ap); + + localSet(dest, ptrToNativeRep(result, i3)); + break; + } + + case OP_newactivation: + { + // result = core->newObject(env->activation, NULL); + int dest = sp+1; + + OP* envArg = ldargIns(_env); + OP* activationVTable = callIns(MIR_cm, ENVADDR(MethodEnv::getActivation), 1, envArg); + OP* activation = callIns(MIR_cm, COREADDR(AvmCore::newActivation), 3, + InsConst((int)core), activationVTable, InsConst(0)); + + localSet(dest, ptrToNativeRep(result, activation)); + break; + } + + case OP_newcatch: + { + // result = core->newObject(env->activation, NULL); + int dest = sp+1; + + OP* activation = callIns(MIR_cm, ENVADDR(MethodEnv::newcatch), 2, + ldargIns(_env), InsConst((int)result)); + + localSet(dest, ptrToNativeRep(result, activation)); + break; + } + + case OP_newarray: + { + // sp[-argc+1] = core->arrayClass->newarray(sp-argc+1, argc) + int argc = op1; + int arg0 = sp - 1*argc+1; + + // convert array elements to Atom[] + OP* ap = storeAtomArgs(argc, arg0); + OP* toplevel = loadToplevel(ldargIns(_env)); + OP* arrayClass = loadIns(MIR_ldop, offsetof(Toplevel,arrayClass), toplevel); + OP* i3 = callIns(MIR_cm, SCRIPTADDR(ArrayClass::newarray), 3, + arrayClass, leaIns(0,ap), InsConst(argc)); + InsDealloc(ap); + + AvmAssert(!result->isMachineType); + localSet(arg0, i3); + break; + } + + case OP_newclass: + { + // sp[0] = core->newclass(env, cinit, scopeBase, scopeDepth, base) + int32 cinit = op1; + int localindex = op2; + int extraScopes = state->scopeDepth; + + OP* envArg = ldargIns(_env); + OP* vtable = loadIns(MIR_ldop, offsetof(MethodEnv, vtable), envArg); + OP* outer = loadIns(MIR_ldop, offsetof(VTable, scope), vtable); + OP* base = localGet(localindex); + + // prepare scopechain args for call + OP* ap = storeAtomArgs(extraScopes, state->verifier->scopeBase); + OP* argv = leaIns(0, ap); + + OP* i3 = callIns(MIR_cm, ENVADDR(MethodEnv::newclass), 5, + envArg, InsConst((int32)cinit), base, outer, argv); + InsDealloc(ap); + + AvmAssert(!result->isMachineType); + localSet(localindex, i3); + break; + } + + case OP_getdescendants: + { + // stack in: obj [ns [name]] + // stack out: value + //sp[0] = core->getdescendants(sp[0], name); + int objDisp = sp; + Multiname* multiname = (Multiname*) op1; + + OP* envArg = ldargIns(_env); + OP* out; + OP* multi = initMultiname(multiname, objDisp); + OP* obj = loadAtomRep(objDisp); + AvmAssert(state->value(objDisp).notNull); + + out = callIns(MIR_cm, ENVADDR(MethodEnv::getdescendants), 3, + envArg, obj, leaIns(0, multi)); + + InsDealloc(multi); + localSet(objDisp, atomToNativeRep(result, out)); + break; + } + + case OP_checkfilter: + { + // stack in: obj + // stack out: obj + OP* envArg = ldargIns(_env); + OP* value = loadAtomRep(op1); + + callIns(MIR_cm, ENVADDR(MethodEnv::checkfilter), 2, + envArg, value); + + break; + } + + case OP_findpropstrict: + case OP_findproperty: + { + // stack in: [ns [name]] + // stack out: obj + // sp[1] = env->findproperty(scopeBase, scopedepth, name, strict) + int dest = sp; + OP* multi = initMultiname((Multiname*)op1, dest); + dest++; + int extraScopes = state->scopeDepth; + + // prepare scopechain args for call + OP* ap = storeAtomArgs(extraScopes, state->verifier->scopeBase); + + OP* envArg = ldargIns(_env); + OP* vtable = loadIns(MIR_ldop, offsetof(MethodEnv,vtable), envArg); + OP* outer = loadIns(MIR_ldop, offsetof(VTable,scope), vtable); + + OP* withBase; + if (state->withBase == -1) + { + withBase = InsConst(0); + } + else + { + withBase = leaIns(state->withBase*sizeof(Atom), ap); + } + + // return env->findproperty(outer, argv, extraScopes, name, strict); + + OP* i3 = callIns(MIR_cm, ENVADDR(MethodEnv::findproperty), 7, + envArg, outer, leaIns(0,ap), InsConst(extraScopes), leaIns(0, multi), + InsConst((int32)(opcode == OP_findpropstrict)), + withBase); + + InsDealloc(ap); + InsDealloc(multi); + + localSet(dest, atomToNativeRep(result, i3)); + break; + } + + case OP_finddef: + { + // stack in: + // stack out: obj + // framep[op2] = env->finddef(name) + Multiname* multiname = (Multiname*) op1; + int dest = op2; + OP* name = InsConst((int)multiname->getName()); + OP* out; + + AvmAssert(multiname->isBinding()); + if (multiname->isNsset()) + { + out = callIns(MIR_cmop, ENVADDR(MethodEnv::finddefNsset), 3, + ldargIns(_env), + InsConst((int)multiname->getNsset()), + name); + } + else + { + out = callIns(MIR_cmop, ENVADDR(MethodEnv::finddefNs), 3, + ldargIns(_env), + InsConst((int)multiname->getNamespace()), + name); + } + localSet(dest, ptrToNativeRep(result, out)); + break; + } + + case OP_getproperty: + { + // stack in: obj [ns] [name] + // stack out: value + // obj=sp[0] + //sp[0] = env->getproperty(obj, multiname); + + Multiname* multiname = (Multiname*)op1; + bool attr = multiname->isAttr(); + Traits* indexType = state->value(sp).traits; + int objDisp = sp; + + bool maybeIntegerIndex = !attr && multiname->isRtname() && multiname->contains(core->publicNamespace); + + if (maybeIntegerIndex && indexType == INT_TYPE) + { + OP* index = localGet(objDisp--); + + if (multiname->isRtns()) + { + // Discard runtime namespace + objDisp--; + } + + Traits* objType = state->value(objDisp).traits; + + OP *value; + if (objType == ARRAY_TYPE) + { + value = callIns(MIR_cm, ARRAYADDR(ArrayObject::getIntProperty), 2, + localGet(sp-1), index); + } + else + { + value = callIns(MIR_cm, ENVADDR(MethodEnv::getpropertylate_i), 3, + ldargIns(_env), loadAtomRep(sp-1), index); + } + + localSet(sp-1, atomToNativeRep(result, value)); + } + else if (maybeIntegerIndex && indexType == UINT_TYPE) + { + OP* index = localGet(objDisp--); + + if (multiname->isRtns()) + { + // Discard runtime namespace + objDisp--; + } + + Traits* objType = state->value(objDisp).traits; + + OP *value; + if (objType == ARRAY_TYPE) + { + value = callIns(MIR_cm, ARRAYADDR(ArrayObject::getUintProperty), 2, + localGet(sp-1), index); + } + else + { + value = callIns(MIR_cm, ENVADDR(MethodEnv::getpropertylate_u), 3, + ldargIns(_env), loadAtomRep(sp-1), index); + } + + localSet(sp-1, atomToNativeRep(result, value)); + } + else if (maybeIntegerIndex && indexType != STRING_TYPE) + { + OP* _tempname = InsAlloc(sizeof(Multiname)); + + // copy the flags + OP* mFlag = InsConst(multiname->ctFlags()); + storeIns(mFlag, offsetof(Multiname,flags), _tempname); + + OP* index = loadAtomRep(objDisp--); + AvmAssert(state->value(objDisp).notNull); + + OP* obj = loadAtomRep(objDisp); + + // copy the compile-time namespace to the temp multiname + OP* mSpace = InsConst((int32)multiname->ns); + storeIns(mSpace, offsetof(Multiname, ns), _tempname); + + OP *multi = leaIns(0, _tempname); + + OP* value = callIns(MIR_cm, ENVADDR(MethodEnv::getpropertyHelper), 5, + ldargIns(_env), obj, multi, loadVTable(objDisp), index); + + InsDealloc(_tempname); + + localSet(objDisp, atomToNativeRep(result, value)); + } + else + { + OP* multi = initMultiname((Multiname*)op1, objDisp); + AvmAssert(state->value(objDisp).notNull); + + OP* vtable = loadVTable(objDisp); + OP* obj = loadAtomRep(objDisp); + OP* toplevel = loadToplevel(ldargIns(_env)); + + //return toplevel->getproperty(obj, name, toplevel->toVTable(obj)); + OP* value = callIns(MIR_cm, TOPLEVELADDR(Toplevel::getproperty), 4, + toplevel, obj, leaIns(0, multi), vtable); + + InsDealloc(multi); + + localSet(objDisp, atomToNativeRep(result, value)); + } + break; + } + + case OP_initproperty: + case OP_setproperty: + { + // stack in: obj [ns] [name] value + // stack out: + // obj = sp[-1] + //env->setproperty(obj, multiname, sp[0], toVTable(obj)); + OP* value = loadAtomRep(sp); + + Multiname* multiname = (Multiname*)op1; + bool attr = multiname->isAttr(); + Traits* indexType = state->value(sp-1).traits; + int objDisp = sp-1; + + bool maybeIntegerIndex = !attr && multiname->isRtname() && multiname->contains(core->publicNamespace); + + if (maybeIntegerIndex && indexType == INT_TYPE) + { + OP* index = localGet(objDisp--); + + if (multiname->isRtns()) + { + // Discard runtime namespace + objDisp--; + } + + Traits* objType = state->value(objDisp).traits; + + if (objType == ARRAY_TYPE) + { + callIns(MIR_cm, ARRAYADDR(ArrayObject::setIntProperty), 3, + localGet(objDisp), index, value); + } + else + { + callIns(MIR_cm, ENVADDR(MethodEnv::setpropertylate_i), 4, + ldargIns(_env), loadAtomRep(objDisp), index, value); + } + } + else if (maybeIntegerIndex && indexType == UINT_TYPE) + { + OP* index = localGet(objDisp--); + + if (multiname->isRtns()) + { + // Discard runtime namespace + objDisp--; + } + + Traits* objType = state->value(objDisp).traits; + + if (objType == ARRAY_TYPE) + { + callIns(MIR_cm, ARRAYADDR(ArrayObject::setUintProperty), 3, + localGet(objDisp), index, value); + } + else + { + callIns(MIR_cm, ENVADDR(MethodEnv::setpropertylate_u), 4, + ldargIns(_env), loadAtomRep(objDisp), index, value); + } + } + else if (maybeIntegerIndex) + { + OP* _tempname = InsAlloc(sizeof(Multiname)); + + // copy the flags + OP* mFlag = InsConst(multiname->ctFlags()); + storeIns(mFlag, offsetof(Multiname,flags), _tempname); + + OP* index = loadAtomRep(objDisp--); + AvmAssert(state->value(objDisp).notNull); + + OP* vtable = loadVTable(objDisp); + OP* obj = loadAtomRep(objDisp); + OP* envarg = ldargIns(_env); + + // copy the compile-time namespace to the temp multiname + OP* mSpace = InsConst((int32)multiname->ns); + storeIns(mSpace, offsetof(Multiname, ns), _tempname); + + OP *multi = leaIns(0, _tempname); + + int func = opcode==OP_setproperty ? ENVADDR(MethodEnv::setpropertyHelper) : + ENVADDR(MethodEnv::initpropertyHelper); + callIns(MIR_cm, func, 6, + envarg, obj, multi, value, vtable, index); + + InsDealloc(_tempname); + + localSet(objDisp, atomToNativeRep(result, value)); + } + else + { + OP* multi = initMultiname((Multiname*)op1, objDisp); + AvmAssert(state->value(objDisp).notNull); + + OP* vtable = loadVTable(objDisp); + OP* obj = loadAtomRep(objDisp); + OP* envarg = ldargIns(_env); + + if (OP_setproperty) + { + OP* toplevel = loadToplevel(envarg); + callIns(MIR_cm, TOPLEVELADDR(Toplevel::setproperty), 5, + toplevel, obj, leaIns(0, multi), value, vtable); + } + else + { + callIns(MIR_cm, ENVADDR(MethodEnv::initproperty), 5, + envarg, obj, leaIns(0, multi), value, vtable); + } + + InsDealloc(multi); + } + break; + } + + case OP_deleteproperty: + { + // stack in: obj [ns] [name] + // stack out: Boolean + //sp[0] = delproperty(sp[0], multiname); + int objDisp = sp; + Multiname *multiname = (Multiname*)op1; + if(!multiname->isRtname()) { + OP* multi = initMultiname(multiname, objDisp, true); + + OP* obj = loadAtomRep(objDisp); + + OP* i3 = callIns(MIR_cm, ENVADDR(MethodEnv::delproperty), 3, + ldargIns(_env), obj, leaIns(0, multi)); + + InsDealloc(multi); + + localSet(objDisp, atomToNativeRep(result, i3)); + } else { + OP* _tempname = InsAlloc(sizeof(Multiname)); + + // copy the flags + OP* mFlag = InsConst(multiname->ctFlags()); + storeIns(mFlag, offsetof(Multiname,flags), _tempname); + + OP* index = loadAtomRep(objDisp--); + + if( !multiname->isRtns() ) + { + // copy the compile-time namespace to the temp multiname + OP* mSpace = InsConst((int32)multiname->ns); + storeIns(mSpace, offsetof(Multiname, ns), _tempname); + } + else + { + // intern the runtime namespace and copy to the temp multiname + OP* nsAtom = loadAtomRep(objDisp--); + OP* internNs = callIns(MIR_cm, ENVADDR(MethodEnv::internRtns), 2, + ldargIns(_env), nsAtom); + + storeIns(internNs, offsetof(Multiname,ns), _tempname); + } + + AvmAssert(state->value(objDisp).notNull); + OP* obj = loadAtomRep(objDisp); + + OP *multi = leaIns(0, _tempname); + + OP* value = callIns(MIR_cm, ENVADDR(MethodEnv::delpropertyHelper), 4, + ldargIns(_env), obj, multi, index); + + InsDealloc(_tempname); + + localSet(objDisp, atomToNativeRep(result, value)); + } + break; + } + + case OP_convert_s: + { + localSet(op1, callIns(MIR_cm, COREADDR(AvmCore::string), 2, + InsConst((int32)core), loadAtomRep(op1))); + break; + } + + case OP_esc_xelem: // ToXMLString will call EscapeElementValue + { + //sp[0] = core->ToXMLString(sp[0]); + OP* value = loadAtomRep(op1); + OP* i3 = callIns(MIR_cmop, COREADDR(AvmCore::ToXMLString), 2, + InsConst((int32)core), value); + AvmAssert(result == STRING_TYPE); + localSet(op1, i3); + break; + } + + case OP_esc_xattr: + { + //sp[0] = core->EscapeAttributeValue(sp[0]); + OP* value = loadAtomRep(op1); + OP* i3 = callIns(MIR_cmop, COREADDR(AvmCore::EscapeAttributeValue), 2, + InsConst((int32)core), value); + AvmAssert(result == STRING_TYPE); + localSet(op1, i3); + break; + } + + case OP_astype: + { + // sp[0] = core->astype(sp[0], traits) + OP* obj = loadAtomRep(op2); + OP* i1 = callIns(MIR_cmop, ENVADDR(MethodEnv::astype), 3, + ldargIns(_env), + obj, + InsConst(op1)); // traits + + i1 = atomToNativeRep(result, i1); + localSet(op2, i1); + break; + } + + case OP_astypelate: + { + //sp[-1] = astype(sp[-1], toClassITraits(sp[0])); + //sp--; + OP* type = loadAtomRep(sp); + + OP* envarg = ldargIns(_env); + OP* itraits = callIns(MIR_cmop, ENVADDR(MethodEnv::toClassITraits), 2, + envarg, type); + + OP* obj = loadAtomRep(sp-1); + + OP* i3 = callIns(MIR_cmop, ENVADDR(MethodEnv::astype), 3, + envarg, obj, itraits); + + i3 = atomToNativeRep(result, i3); + localSet(sp-1, i3); + break; + } + + + case OP_add: + { + OP* lhs = loadAtomRep(sp-1); + OP* rhs = loadAtomRep(sp); + OP* toplevel = loadToplevel(ldargIns(_env)); + OP* out = callIns(MIR_cm, TOPLEVELADDR(Toplevel::add2), 3, + toplevel, lhs, rhs); + localSet(sp-1, atomToNativeRep(result, out)); + break; + } + + case OP_concat: + { + OP* lhs = localGet(sp-1); + OP* rhs = localGet(sp); + OP* out = callIns(MIR_cmop, COREADDR(AvmCore::concatStrings), 3, + InsConst((int32)core), lhs, rhs); + localSet(sp-1, out); + break; + } + + case OP_equals: + { + AvmAssert(result == BOOLEAN_TYPE); + localSet(sp-1, Ins(MIR_eq, cmpEq(COREADDR(AvmCore::eq), sp-1, sp))); + break; + } + + case OP_strictequals: + { + AvmAssert(result == BOOLEAN_TYPE); + localSet(sp-1, Ins(MIR_eq, cmpEq(COREADDR(AvmCore::stricteq), sp-1, sp))); + break; + } + + case OP_lessthan: + { + AvmAssert(result == BOOLEAN_TYPE); + localSet(sp-1, Ins(MIR_lt, cmpLt(sp-1, sp))); + break; + } + + case OP_lessequals: + { + AvmAssert(result == BOOLEAN_TYPE); + localSet(sp-1, Ins(MIR_le, cmpLe(sp-1, sp))); + break; + } + + case OP_greaterthan: + { + AvmAssert(result == BOOLEAN_TYPE); + localSet(sp-1, Ins(MIR_lt, cmpLt(sp, sp-1))); + break; + } + + case OP_greaterequals: + { + AvmAssert(result == BOOLEAN_TYPE); + localSet(sp-1, Ins(MIR_le, cmpLe(sp, sp-1))); + break; + } + + case OP_instanceof: + { + OP* lhs = loadAtomRep(sp-1); + OP* rhs = loadAtomRep(sp); + OP* toplevel = loadToplevel(ldargIns(_env)); + OP* out = callIns(MIR_cm, TOPLEVELADDR(Toplevel::instanceof), 3, + toplevel, lhs, rhs); + out = atomToNativeRep(result, out); + localSet(sp-1, out); + break; + } + + case OP_in: + { + OP* lhs = loadAtomRep(sp-1); + OP* rhs = loadAtomRep(sp); + OP* out = callIns(MIR_cm, ENVADDR(MethodEnv::in), 3, + ldargIns(_env), lhs, rhs); + out = atomToNativeRep(result, out); + localSet(sp-1, out); + break; + } + + case OP_istype: + { + // expects a CONSTANT_Multiname cpool index + // used when operator "is" RHS is a compile-time type constant + //sp[0] = istype(sp[0], itraits); + OP* obj = loadAtomRep(op2); + OP* itraits = InsConst(op1); + OP* out = callIns(MIR_cm, COREADDR(AvmCore::istypeAtom), 3, + InsConst((int32)core), obj, itraits); + out = atomToNativeRep(result, out); + localSet(op2, out); + break; + } + + case OP_istypelate: + { + //sp[-1] = istype(sp[-1], toClassITraits(sp[0])); + //sp--; + OP* type = loadAtomRep(sp); + + OP* traits = callIns(MIR_cmop, ENVADDR(MethodEnv::toClassITraits), 2, + ldargIns(_env), type); + + OP* obj = loadAtomRep(sp-1); + + OP* i3 = callIns(MIR_cm, COREADDR(AvmCore::istypeAtom), 3, + InsConst((int32)core), obj, traits); + + i3 = atomToNativeRep(result, i3); + localSet(sp-1, i3); + break; + } + + case OP_dxns: + { + OP* uri = InsConst(op1); // uri + OP* ns = callIns(MIR_cm, + COREADDR(AvmCore::newPublicNamespace), + 2, + InsConst((int32)core), + uri); + storeIns(ns, 0, dxns); + break; + } + + case OP_dxnslate: + { + OP* atom = loadAtomRep(op1); + OP* uri = callIns(MIR_cm, COREADDR(AvmCore::intern), 2, + InsConst((int32)core), atom); + OP* ns = callIns(MIR_cm, + COREADDR(AvmCore::newPublicNamespace), + 2, + InsConst((int32)core), + uri); + storeIns(ns, 0, dxns); + break; + } + + /* + * debugger instructions + */ + #ifdef DEBUGGER + case OP_debugfile: + { + // todo refactor api's so we don't have to pass argv/argc + OP* debugger = loadIns(MIR_ldop, offsetof(AvmCore, debugger), + InsConst((int32)core)); + callIns(MIR_cm, DEBUGGERADDR(Debugger::debugFile), 2, + debugger, + InsConst(op1)); + break; + } + + case OP_debugline: + { + // todo refactor api's so we don't have to pass argv/argc + OP* debugger = loadIns(MIR_ldop, offsetof(AvmCore, debugger), + InsConst((int32)core)); + callIns(MIR_cm, DEBUGGERADDR(Debugger::debugLine), 2, + debugger, + InsConst(op1)); + break; + } + #endif // DEBUGGER + + default: + { + AvmAssert(false); // unsupported + } + } + + } // emit() + + void CodegenMIR::emitIf(FrameState *state, AbcOpcode opcode, int target, int a, int b) + { + this->state = state; + + #ifdef AVMPLUS_PROFILE + DynamicProfiler::StackMark mark(OP_codegenop, &core->dprof); + if (core->dprof.dprofile) + { + callIns(MIR_cm, COREADDR(DynamicProfiler::mark), 1, + (int)&core->dprof, InsConst(opcode)); + } + #endif /* AVMPLUS_PROFILE */ + +#ifdef DEBUGGER + if(core->sampling && target < state->pc) + { + emitSampleCheck(); + } +#endif + + // + // compile instructions that cannot throw exceptions before we add exception handling logic + // + + // op1 = abc opcode target + // op2 = what local var contains condition + + // spill all, dont include cond since it gets consumed + // UBER IMPORTANT we need to spill prior to compare since + // mir MD generations needs compare and branch to be adjacent. + OP* cond; + MirOpcode br; + + switch (opcode) + { + case OP_iftrue: + br = MIR_jne; + cond = binaryIns(MIR_icmp, localGet(a), InsConst(0)); + break; + case OP_iffalse: + br = MIR_jeq; + cond = binaryIns(MIR_icmp, localGet(a), InsConst(0)); + break; + case OP_iflt: + br = MIR_jlt; + cond = cmpLt(a, b); + break; + case OP_ifnlt: + br = MIR_jnlt; + cond = cmpLt(a, b); + break; + case OP_ifle: + br = MIR_jle; + cond = cmpLe(a, b); + break; + case OP_ifnle: + br = MIR_jnle; + cond = cmpLe(a, b); + break; + case OP_ifgt: // a>b === bb) === !(b=b === b<=a + br = MIR_jle; + cond = cmpLe(b, a); + break; + case OP_ifnge: // !(a>=b) === !(a<=b) + br = MIR_jnle; + cond = cmpLe(b, a); + break; + case OP_ifeq: + br = MIR_jeq; + cond = cmpEq(COREADDR(AvmCore::eq), a, b); + break; + case OP_ifne: + br = MIR_jne; + cond = cmpEq(COREADDR(AvmCore::eq), a, b); + break; + case OP_ifstricteq: + br = MIR_jeq; + cond = cmpEq(COREADDR(AvmCore::stricteq), a, b); + break; + case OP_ifstrictne: + br = MIR_jne; + cond = cmpEq(COREADDR(AvmCore::stricteq), a, b); + break; + default: + AvmAssert(false); + return; + } + + saveState(); + + OP* p = Ins(br, cond); // will be patched + + mirPatch(p, target); + } // emitIf() + + OP* CodegenMIR::i2dIns(OP* v) + { + #ifdef AVMPLUS_ARM + return callIns(MIR_fcsop, FUNCADDR(CodegenMIR::i2d), 1, v); + #else + return Ins(MIR_i2d, v); + #endif + } + + OP* CodegenMIR::u2dIns(OP* v) + { + #ifdef AVMPLUS_ARM + return callIns(MIR_fcsop, FUNCADDR(CodegenMIR::u2d), 1, v); + #else + return Ins(MIR_u2d, v); + #endif + } + + OP* CodegenMIR::fcmpIns(OP* a1, OP* a2) + { + #ifdef AVMPLUS_ARM + return Ins(MIR_icmp, callIns(MIR_csop, FUNCADDR(CodegenMIR::fcmp), 2, a1, a2), InsConst(0)); + #else + return Ins(MIR_fcmp, a1, a2); + #endif + } + + OP* CodegenMIR::binaryFcmpIns(OP* a1, OP* a2) + { + #ifdef AVMPLUS_ARM + return binaryIns(MIR_icmp, callIns(MIR_csop, FUNCADDR(CodegenMIR::fcmp), 2, a1, a2), InsConst(0)); + #else + return binaryIns(MIR_fcmp, a1, a2); + #endif + } + + // Faster compares for ints, uint, doubles + OP* CodegenMIR::cmpOptimization (int lhsi, int rhsi) + { + Traits* lht = state->value(lhsi).traits; + Traits* rht = state->value(rhsi).traits; + + if (lht == rht && lht == INT_TYPE) + { + OP* lhs = localGet(lhsi); + OP* rhs = localGet(rhsi); + return binaryIns(MIR_icmp, lhs, rhs); + } + else if (lht == rht && lht == UINT_TYPE) + { + OP* lhs = localGet(lhsi); + OP* rhs = localGet(rhsi); + return binaryIns(MIR_ucmp, lhs, rhs); + } + else if (lht && lht->isNumeric && rht && rht->isNumeric) + { + // If we're comparing a uint to an int and the int is a non-negative + // integer constant, don't promote to doubles for the compare + if ((lht == UINT_TYPE) && (rht == INT_TYPE)) + { + OP* lhs = localGet(lhsi); + OP* rhs = localGet(rhsi); + if (rhs->code == MIR_imm && rhs->imm >= 0) + { + return binaryIns(MIR_ucmp, lhs, rhs); + } + } + else if ((lht == INT_TYPE) && (rht == UINT_TYPE)) + { + OP* lhs = localGet(lhsi); + OP* rhs = localGet(rhsi); + if (lhs->code == MIR_imm && lhs->imm >= 0) + { + return binaryIns(MIR_ucmp, lhs, rhs); + } + } + + OP* lhs = promoteNumberIns(lht, lhsi); + OP* rhs = promoteNumberIns(rht, rhsi); + return fcmpIns(lhs, rhs); + } + + return NULL; + } + + // set cc's for < operator + OP* CodegenMIR::cmpLt(int lhsi, int rhsi) + { + OP *result = cmpOptimization (lhsi, rhsi); + if (result) + return result; + + AvmAssert(trueAtom == 13); + AvmAssert(falseAtom == 5); + AvmAssert(undefinedAtom == 4); + OP* lhs = loadAtomRep(lhsi); + OP* rhs = loadAtomRep(rhsi); + OP* atom = callIns(MIR_cm, COREADDR(AvmCore::compare), 3, + InsConst((int32)core), lhs, rhs); + + // caller will use jlt for (avalue(lhsi).traits; + Traits* rht = state->value(rhsi).traits; + + // If we have null and a type that is derived from an Object (but not Object or XML) + // we can optimize our equal comparison down to a simple ptr comparison. This also + // works when both types are derived Object types. + if (((lht == NULL_TYPE) && (rht && !rht->notDerivedObjectOrXML)) || + ((rht == NULL_TYPE) && (lht && !lht->notDerivedObjectOrXML)) || + ((rht && !rht->notDerivedObjectOrXML) && (lht && !lht->notDerivedObjectOrXML))) + { + OP* lhs = localGet(lhsi); + OP* rhs = localGet(rhsi); + return binaryIns(MIR_ucmp, lhs, rhs); + } + else + { + OP* lhs = loadAtomRep(lhsi); + OP* rhs = loadAtomRep(rhsi); + OP* out = callIns(MIR_cm, funcaddr, + 3, InsConst((int32)core), lhs, rhs); + + // assume caller will use MIR_jeq or MIR_jne + return binaryIns(MIR_icmp, out, InsConst(trueAtom)); + } + } + + void CodegenMIR::epilogue(FrameState *state) + { + this->state = state; + + #ifdef AVMPLUS_PROFILE + DynamicProfiler::StackMark mark(OP_codegenop, &core->dprof); + #endif /* AVMPLUS_PROFILE */ + + if (calleeVars) + { + calleeVars[0].lastUse = ip; + calleeVars[1].lastUse = ip; + calleeVars[2].lastUse = ip; + } + + if (info->setsDxns()) { + InsDealloc(dxns); + } + + // exceptions dealloc + if (info->exceptions) + { + InsDealloc(_ef); + InsDealloc(_save_eip); + } + + #ifdef DEBUGGER + InsDealloc(localPtrs); + InsDealloc(localTraits); + InsDealloc(_callStackNode); + #endif + + if (npe_label.nextPatchIns) + { + mirLabel(npe_label, Ins(MIR_bb)); + callIns(MIR_cm, ENVADDR(MethodEnv::npe), 1, ldargIns(_env)); + } + + if (interrupt_label.nextPatchIns) + { + mirLabel(interrupt_label, Ins(MIR_bb)); + callIns(MIR_cm, ENVADDR(MethodEnv::interrupt), 1, ldargIns(_env)); + } + + // ending block + firstCse = ipEnd = ip; + + // bail if no room in the buffer. +#ifndef FEATURE_BUFFER_GUARD + if (checkOverflow()) + return; +#endif /* FEATURE_BUFFER_GUARD */ + + // We do this patching at the end since the verifier needs the unaltered + // exception target just in case we hit a backedge and regen + if (info->exceptions) + { + for (int i=0, n=info->exceptions->exception_count; i < n; i++) + { + ExceptionHandler* h = &info->exceptions->exceptions[i]; + AvmAssertMsg(state->verifier->getFrameState(h->target)->label.bb != NULL, "Exception target address MUST have been resolved"); + mirPatchPtr( &h->targetIns, h->target ); + } + } + + // this is not fatal but its good to know if our epilogue estimation code is off. + #if defined(AVMPLUS_PROFILE) && defined(_DEBUG) + int actual_size = ((int)ip-(int)ipStart); + int actual_epilogue_size = 0;//((int)ip-(int)_epilogue); + sizingStats[SZ_MIR] = actual_size; + sizingStats[SZ_MIRWASTE] = ((double)(mirBuffSize-actual_size)) / mirBuffSize; + sizingStats[SZ_MIREPI] = (double)(actual_epilogue_size-epilogue_size) / epilogue_size; + AvmAssertMsg( epilogue_size >= actual_epilogue_size, "Increase epilogue_size constant\n"); + #endif /* AVMPLUS_PROFILE && _DEBUG */ + + #ifdef AVMPLUS_VERBOSE + if (core->bbgraph) + buildFlowGraph(); + #endif /* AVMPLUS_VERBOSE */ + } + + #ifdef AVMPLUS_VERBOSE + void CodegenMIR::buildFlowGraph() + { + // walk through all the BBs building a flow graph for the mir. + // BBs are labelled by instruction number. + OP* begin = ipStart; + OP* end = ipEnd; + + core->console << "digraph \"" << info->name << "\" {\n"; + core->console << "ratio=fill\n"; + core->console << "ranksep=.1\n"; + core->console << "nodesep=.2\n"; + core->console << "rankdir=LR\n"; + core->console << "edge [arrowsize=.7,labeldistance=1.0,labelangle=-45,labelfontsize=9]\n"; + core->console << "node [fontsize=9,shape=box,width=.2,height=.2]\n"; + + bool blockDone = false; + OP* blockStart = begin; + + SortedIntMap bbNums; + int bbNum = 1; + OP* ins = begin; + + // start and end + bbNums.put(0, (int*)bbNum++); + bbNums.put(end-begin, (int*)bbNum++); + + core->console << "BB0_entry [label=\"BB0_entry\"]\n"; + core->console << "BB0_entry -> BB" << (int)1 << "_" << (int)(0) << " [weight=2] \n"; + //blockDone = true; + while(ins <= end) + { + int opcode = ins->code; + switch(opcode) + { + case MIR_bb: + { + int prev = blockStart-begin; + int bbprev = (int) ( (bbNums.get(prev) > (int*)0) ? bbNums.get(prev) : bbNums.put(prev, (int*)bbNum++) ); + int current = ins-begin; + int bbcurrent = (int) ( (bbNums.get(current) > (int*)0) ? bbNums.get(current) : bbNums.put(current, (int*)bbNum++) ); + + if (!blockDone) + { + // fall through + core->console << "BB" << (int)bbprev << "_" << (int)prev << " -> BB" << (int)bbcurrent << "_" << (int)current << " [weight=2] \n"; + blockDone = true; + } + core->console << "BB" << (int)bbcurrent << "_" << (int)current << "[label=\"BB" << (int)bbcurrent << "_" << (int)current << "\"]\n"; + blockStart = ins; + blockDone = false; + break; + } + + case MIR_ret: + { + int prev = blockStart-begin; + int bbprev = (int) ( (bbNums.get(prev) > (int*)0) ? bbNums.get(prev) : bbNums.put(prev, (int*)bbNum++) ); + int bbexit = (int) bbNums.get(end-begin); + core->console << "BB" << (int)bbprev << "_" << (int)prev << " -> BB" << (int)bbexit<< "_" << (int)(end-begin) << " [weight=2] \n"; + blockDone = true; + break; + } + + case MIR_jmpi: + case MIR_jmpt: + { + // indirect jump *[(disp)+base] + AvmAssert(ins->base != NULL); + //int* location = (int*)(ins->tn.value + insValue[opr2ins(ins->oprnd_1)]); + //ins = ((OP*)*location)-1; // computed location, anticipating ins++ below + //blockDone = true; + break; + } + + case MIR_jmp: + { + // immediate jump + OP* target = ins->target; // target is absolute, -1 anticipates ins++ below + int t = target - begin; + int prev = blockStart-begin; + AvmAssert(target->code == MIR_bb); + int bbprev = (int) ( (bbNums.get(prev) > (int*)0) ? bbNums.get(prev) : bbNums.put(prev, (int*)bbNum++) ); + int bbt = (int) ( (bbNums.get(t) > (int*)0) ? bbNums.get(t) : bbNums.put(t, (int*)bbNum++) ); + + core->console << "BB" << (int)bbprev << "_" << (int)prev << " -> BB" << (int)bbt << "_" << (int)t << " [weight=2] \n"; + blockDone = true; + break; + } + + case MIR_jeq: + case MIR_jne: + case MIR_jlt: + case MIR_jle: + case MIR_jnle: + case MIR_jnlt: + { + OP* target = ins->target; // target is absolute + int t = target - begin; + int prev = blockStart-begin; + int bbprev = (int) ( (bbNums.get(prev) > (int*)0) ? bbNums.get(prev) : bbNums.put(prev, (int*)bbNum++) ); + int bbt = (int) ( (bbNums.get(t) > (int*)0) ? bbNums.get(t) : bbNums.put(t, (int*)bbNum++) ); + int next = ins+1-begin; + int bbnext = (int) ( (bbNums.get(next) > (int*)0) ? bbNums.get(next) : bbNums.put(next, (int*)bbNum++) ); + AvmAssert(target->code == MIR_bb); + + core->console << "BB" << (int)bbprev << "_" << (int)prev << " -> BB" << (int)bbt << "_" << (int)t << " [taillabel=T] \n"; + core->console << "BB" << (int)bbprev << "_" << (int)prev << " -> BB" << (int)bbnext << "_" << (int)next << " [taillabel=F,weight=2] \n"; + + // The verifier works with extended basics so, we don't have a bb start for + // the next instruction + core->console << "BB" << (int)bbnext << "_" << (int)next << "[label=\"BB" << (int)bbnext << "_" << (int)next << "\"]\n"; + blockStart = ins+1; + blockDone = false; + break; + } + + default: + break; + } + ins++; + } + + int prev = blockStart-begin; + int bbprev = (int) ( (bbNums.get(prev) > (int*)0) ? bbNums.get(prev) : bbNums.put(prev, (int*)bbNum++) ); + int current = ins-begin-1; + int bbcurrent = (int) ( (bbNums.get(current) > (int*)0) ? bbNums.get(current) : bbNums.put(current, (int*)bbNum++) ); + if (!blockDone) + { + core->console << "BB" << (int)bbprev << "_" << (int)prev << " -> BB" << (int)bbcurrent << "_" << (int)current << " [weight=2] \n"; + } + core->console << "BB" << (int)bbcurrent << "_" << (int)current << "[label=\"BB" << (int)bbcurrent << "_" << (int)current << "\"]\n"; + core->console << "BB" << (int)bbcurrent << "_" << (int)current << " -> BB" << (int)(bbNum) << "_exit" << " [weight=2] \n"; + core->console << "}\n"; + } + #endif /* AVMPLUS_VERBOSE */ + + OP* CodegenMIR::initMultiname(Multiname* multiname, int& csp, bool isDelete /*=false*/) + { +#ifdef AVMPLUS_VERBOSE + if (verbose()) + core->console << " init multiname\n"; +#endif + OP* _tempname = InsAlloc(sizeof(Multiname)); + + // copy the flags + OP* mFlag = InsConst(multiname->ctFlags()); + storeIns(mFlag, offsetof(Multiname,flags), _tempname); + + OP* nameAtom = NULL; + + if (multiname->isRtname()) + { + nameAtom = loadAtomRep(csp--); + } + else + { + // copy the compile-time name to the temp name + OP* mName = InsConst((int)multiname->name); + storeIns(mName, offsetof(Multiname,name), _tempname); + } + + if (multiname->isRtns()) + { + // intern the runtime namespace and copy to the temp multiname + OP* nsAtom = loadAtomRep(csp--); + OP* internNs = callIns(MIR_cm, ENVADDR(MethodEnv::internRtns), 2, + ldargIns(_env), nsAtom); + + storeIns(internNs, offsetof(Multiname,ns), _tempname); + } + else + { + // copy the compile-time namespace to the temp multiname + OP* mSpace = InsConst((int32)multiname->ns); + storeIns(mSpace, offsetof(Multiname, ns), _tempname); + } + + // Call initMultinameLate as the last step, since if a runtime + // namespace is present, initMultinameLate may clobber it if a + // QName is provided as index. + if (nameAtom) + { + if (isDelete) + { + callIns(MIR_cm, ENVADDR(MethodEnv::initMultinameLateForDelete), 3, + ldargIns(_env), + leaIns(0, _tempname), + nameAtom); + } + else + { + callIns(MIR_cm, COREADDR(AvmCore::initMultinameLate), 3, + InsConst((int32)core), + leaIns(0, _tempname), + nameAtom); + } + } + + return _tempname; + } + + OP* CodegenMIR::loadToplevel(OP* env) + { + OP* vtable = loadIns(MIR_ldop, offsetof(MethodEnv, vtable), env); + return loadIns(MIR_ldop, offsetof(VTable, toplevel), vtable); + } + + OP* CodegenMIR::loadVTable(int i) + { + AvmAssert(state->value(i).notNull); + Traits* t = state->value(i).traits; + + if (t && !t->isMachineType && t != STRING_TYPE && t != NAMESPACE_TYPE && t != NULL_TYPE) + { + // must be a pointer to a scriptobject, and we've done the n + // all other types are ScriptObject, and we've done the null check + return loadIns(MIR_ldop, offsetof(ScriptObject, vtable), localGet(i)); + } + + OP* toplevel = loadToplevel(ldargIns(_env)); + + int offset; + if (t == NAMESPACE_TYPE) offset = offsetof(Toplevel, namespaceClass); + else if (t == STRING_TYPE) offset = offsetof(Toplevel, stringClass); + else if (t == BOOLEAN_TYPE) offset = offsetof(Toplevel, booleanClass); + else if (t == NUMBER_TYPE) offset = offsetof(Toplevel, numberClass); + else if (t == INT_TYPE) offset = offsetof(Toplevel, intClass); + else if (t == UINT_TYPE) offset = offsetof(Toplevel, uintClass); + else + { + // *, Object or Void + OP* obj = loadAtomRep(i); + return callIns(MIR_cmop, TOPLEVELADDR(Toplevel::toVTable), 2, + toplevel, obj); + } + + // now offset != -1 and we are returning a primitive vtable + + OP* cc = loadIns(MIR_ldop, offset, toplevel); + OP* cvtable = loadIns(MIR_ldop, offsetof(ClassClosure, vtable), cc); + return loadIns(MIR_ldop, offsetof(VTable, ivtable), cvtable); + } + + OP* CodegenMIR::promoteNumberIns(Traits* t, int i) + { + if (t == NUMBER_TYPE) + { + return localGet(i); + } + if (t == INT_TYPE || t == BOOLEAN_TYPE) + { + return i2dIns(localGet(i)); + } + if (t == UINT_TYPE) + { + return u2dIns(localGet(i)); + } + AvmAssert(false); + return NULL; + } + +#ifdef AVMPLUS_VERBOSE + + void CodegenMIR::formatInsOperand(PrintWriter& buffer, OP* opr, OP* ipStart) + { + if (opr) + buffer.format("@%d", opr-ipStart); + else + buffer << "0"; + } + + void CodegenMIR::formatOperand(PrintWriter& buffer, OP* opr, OP* ipStart) + { + if (!opr) + { + buffer.format("?"); + } + else + { + formatInsOperand(buffer, opr, ipStart); + } + } + + void CodegenMIR::formatOpcode(PrintWriter& buffer, OP* ipStart, OP* op, PoolObject* /*pool*/, GCHashtable* names) + { + + switch (op->code) + { + case MIR_cm: + case MIR_cs: + case MIR_fcm: + case MIR_fcs: + case MIR_cmop: + case MIR_csop: + case MIR_fcmop: + case MIR_fcsop: + { +#ifndef AVMPLUS_SYMBIAN + buffer << mirNames[op->code] << " "; +#endif + const char *name; + if (names != NULL && ((int)(name = (const char *)names->get(op->addr)) != undefinedAtom) && name ) + { + buffer << name; + } + else + { + //AvmAssert(false); + buffer.writeHexDWord(op->addr); + } + uint32 argc = op->argc; + buffer << " ("; + + // now dump the params + for(uint32 i=1; i<=argc; i++) + { + formatInsOperand(buffer, op->args[i], ipStart); + if (i+1 <= argc) + buffer << ", "; + } + buffer << ")"; + break; + } + + case MIR_fci: + case MIR_ci: + { +#ifndef AVMPLUS_SYMBIAN + buffer << mirNames[op->code] << " "; +#endif + formatInsOperand(buffer, op->target, ipStart); + uint32 argc = op->argc; + buffer << " ("; + + // now dump the params + for(uint32 i=1; i<=argc; i++) + { + formatInsOperand(buffer, op->args[i], ipStart); + if (i+1 <= argc) + buffer << ", "; + } + + buffer << ")"; + break; + } + + case MIR_ld: + case MIR_ldop: + case MIR_fld: + case MIR_fldop: + case MIR_lea: + { +#ifndef AVMPLUS_SYMBIAN + buffer << mirNames[op->code] << " "; +#endif + buffer << op->disp << "("; + formatInsOperand(buffer, op->oprnd1, ipStart); + buffer << ")"; + break; + } + + case MIR_st: + { +#ifndef AVMPLUS_SYMBIAN + buffer << mirNames[op->code] << " "; +#endif + buffer << op->disp << "("; + formatInsOperand(buffer, op->oprnd1, ipStart); + buffer << ")"; + buffer << " <- "; + formatInsOperand(buffer, op->value, ipStart); + break; + } + + case MIR_imm: + case MIR_alloc: +#ifndef AVMPLUS_SYMBIAN + buffer << mirNames[op->code] << " " << (int)op->imm; +#endif + break; + + case MIR_arg: +#ifndef AVMPLUS_SYMBIAN + buffer << mirNames[op->code] << " "; +#endif + #ifdef AVMPLUS_ARM + if (op->reg != Unknown) + buffer << regNames[op->reg]; + else + buffer << (int)op->pos; + #else + if (op->reg != Unknown) + buffer << gpregNames[op->reg]; + else + buffer << (int)op->pos; + #endif + break; + + case MIR_def: + case MIR_fdef: +#ifndef AVMPLUS_SYMBIAN + buffer << mirNames[op->code] << " "; +#endif + formatInsOperand(buffer, op->oprnd1, ipStart); + if (op->join) { + buffer << " joined to " ; + formatInsOperand(buffer, op->join, ipStart); + } + break; + + case MIR_use: + case MIR_fuse: +#ifndef AVMPLUS_SYMBIAN + buffer << mirNames[op->code] << " "; +#endif + formatInsOperand(buffer, op->oprnd1, ipStart); + buffer << " [" << op->disp << "]"; + break; + + case MIR_jmpt: { +#ifndef AVMPLUS_SYMBIAN + buffer << mirNames[op->code] << " ("; +#endif + formatInsOperand(buffer, op->base, ipStart); + buffer << ") ["; + for (int i=1; i <= op->size; i++) { + formatInsOperand(buffer, op->args[i], ipStart); + if (i+1 <= op->size) + buffer << ", "; + } + buffer << "]"; + break; + } + + case MIR_jmpi: +#ifndef AVMPLUS_SYMBIAN + buffer << mirNames[op->code] << " -> " << op->disp << "("; +#endif + formatInsOperand(buffer, op->base, ipStart); + buffer << ")"; + break; + + case MIR_jmp: +#ifndef AVMPLUS_SYMBIAN + buffer << mirNames[op->code] << " -> "; +#endif + formatInsOperand(buffer, op->target, ipStart); + break; + + case MIR_jeq: + case MIR_jne: + case MIR_jlt: + case MIR_jle: + case MIR_jnle: + case MIR_jnlt: +#ifndef AVMPLUS_SYMBIAN + buffer << mirNames[op->code] << " "; +#endif + formatInsOperand(buffer, op->oprnd1, ipStart); + buffer << " -> "; + formatInsOperand(buffer, op->target, ipStart); + break; + + case MIR_bb: +#ifndef AVMPLUS_SYMBIAN + buffer << mirNames[op->code]; +#endif + break; + + default: +#ifndef AVMPLUS_SYMBIAN + buffer << mirNames[op->code] << " "; +#endif + if (op->oprnd1 == 0) + { + buffer << " 0x" << hexDWord(op->imm); + } + else + { + OP* opr = op->oprnd1; + formatInsOperand(buffer, opr, ipStart); + + opr = op->oprnd2; + if (opr == 0) + { + break; + } + else + { + buffer << " "; + formatInsOperand(buffer, opr, ipStart); + } + // no other instruction should use operand3 + //opr = op->value; + } + break; + } + if (op->liveAcrossCall) + buffer << " spans call"; + } + #endif /* AVMPLUS_VERBOSE */ + + + void CodegenMIR::generatePrologue() + { + // empty the activation record, ready for code gen + activation.size = 0; + activation.temps.clear(); + activation.highwatermark = 0; + + #ifdef AVMPLUS_PROFILE + fullyUsedCount = 0; + longestSpan= 0; + spills = 0; + steals = 0; + remats = 0; + mInstructionCount = 0; + #endif /* AVMPLUS_PROFILE */ + + // point to the start of MIR code that we will be converting + ip = ipStart; + + // get a pointer to a machine code buffer + code = getMDBuffer(pool); + + // place the case table at the beginning of the md buffer + casePtr = (uint32*)&code[0]; + + mipStart = mip = (MDInstruction*) (casePtr+case_count); + +#ifndef FEATURE_BUFFER_GUARD + // make sure we have enough space for our prologue + // technically should be from casePtr but we ask for a bit more room + if (!ensureMDBufferCapacity(pool, md_prologue_size + (byte*)mipStart-&code[0] )) + return; +#endif /* FEATURE_BUFFER_GUARD */ + + // clear the registers + gpregs.clear(); + fpregs.clear(); + + #ifdef AVMPLUS_PPC + // add scratch registers to our free list for the allocator + gpregs.calleeSaved = rmask(R13) | rmask(R14) | rmask(R15) | rmask(R16) + | rmask(R17) | rmask(R18) | rmask(R19) | rmask(R20) + | rmask(R21) | rmask(R22) | rmask(R23) | rmask(R24) + | rmask(R25) | rmask(R26) | rmask(R27) | rmask(R28) + | rmask(R29) | rmask(R30) | rmask(R31); + + fpregs.calleeSaved = rmask(F14) | rmask(F15) | rmask(F16) + | rmask(F17) | rmask(F18) | rmask(F19) | rmask(F20) + | rmask(F21) | rmask(F22) | rmask(F23) | rmask(F24) + | rmask(F25) | rmask(F26) | rmask(F27) | rmask(F28) + | rmask(F29) | rmask(F30) | rmask(F31); + + // avoid R0, since it isn't totally general purpose. + // avoid R1, since it's the stack pointer. + // avoid R2, since it's the TOC pointer. + gpregs.free = gpregs.calleeSaved + | rmask(R3) | rmask(R4) | rmask(R5) | rmask(R6) + | rmask(R7) | rmask(R8) | rmask(R9) | rmask(R10) + | rmask(R11) | rmask(R12); + + // avoid F0, it's a scratch temp used by MD generator + fpregs.free = fpregs.calleeSaved + | rmask(F1) | rmask(F2) | rmask(F3) | rmask(F4) + | rmask(F5) | rmask(F6) | rmask(F7) | rmask(F8) + | rmask(F9) | rmask(F10) | rmask(F11) | rmask(F12) + | rmask(F13); + + #endif /* AVMPLUS_PPC */ + + #ifdef AVMPLUS_ARM + // add scratch registers to our free list for the allocator + + // R4-R10 are callee-saved, but R4-R5 form our one FP "pseudo-register" + gpregs.calleeSaved = rmask(R6) | rmask(R7) | rmask(R8) | rmask(R9) | rmask(R10); + fpregs.calleeSaved = 0; + + // Avoid IP, since we'll use it for our own temporary purposes + // Avoid FP since it's the frame pointer + // Avoid LR since it's the link register + // Avoid SP since it's the stack pointer + // Avoid PC since it's the program counter + gpregs.free = gpregs.calleeSaved | rmask(R0) | rmask(R1) | rmask(R2) | rmask(R3); + fpregs.free = fpregs.calleeSaved | rmask(F0); + #endif /* AVMPLUS_ARM */ + + #ifdef AVMPLUS_IA32 + // add scratch registers to our free list for the allocator + gpregs.calleeSaved = rmask(EBX) | rmask(ESI) | rmask(EDI); + + fpregs.calleeSaved = 0; // all fp regs are caller-saved + + gpregs.free = gpregs.calleeSaved + | rmask(EAX) | rmask(ECX) | rmask(EDX); + + if (core->sse2) + { + fpregs.free = fpregs.calleeSaved + | rmask(XMM0) | rmask(XMM1) | rmask(XMM2) | rmask(XMM3) + | rmask(XMM4) | rmask(XMM5) | rmask(XMM6) | rmask(XMM7); + } + else + { + fpregs.free = fpregs.calleeSaved | rmask(FST0); + } + + #endif + + #ifdef _DEBUG + // keep a tally of the registers to check that our allocator works correctly + gpregs.count = gpregs.countFree(); + fpregs.count = fpregs.countFree(); + gpregs.checkCount(); + fpregs.checkCount(); + #endif /* _DEBUG */ + + #ifdef AVMPLUS_PPC + MFLR (R0); + STW(R0, 8, SP); + + if (core->minstack) + { + LI32(R11, (int)&core->minstack); + LWZ(R12, 0, R11); + stackCheck.patchStackSize = mip; + NOP(); + NOP(); + CMPL(CR7, SP, R12); + BLT(CR7, 0); + NOP(); + + mdPatchPrevious(&stackCheck.overflowLabel); + mdLabel(&stackCheck.resumeLabel, mip); + } + + // This is where a stmw instruction will go, if needed + patch_stmw = mip; + NOP (); + + // This NOP instruction will be turned into a BLA to + // store the nonvolatile FPU registers, if needed. + NOP (); + + // This is where a stwu or li32+stwux instruction will go + patch_stwu = mip; + NOP(); + NOP(); + NOP(); + #endif /* AVMPLUS_PPC */ + + #ifdef AVMPLUS_ARM + // Reserve 4 bytes to store the stack frame size + patch_frame_size = mip++; + + // If stack overflow check is used, reserve 4 bytes for + // minimum stack value. + if (core->minstack) + { + stackCheck.patchStackSize = mip; + mip++; + } + + // Adjust mipStart to be after these constants. + mipStart = mip; + + if (core->minstack) + { + LDR (IP, -12, PC); + CMP (SP, IP); + SET_CONDITION_CODE(LT); + B(0); + SET_CONDITION_CODE(AL); + mdPatchPrevious(&stackCheck.overflowLabel); + mdLabel(&stackCheck.resumeLabel, mip); + } + + // prologue + MOV (IP, SP); + + // save callee-saved registers + patch_stmfd = mip; + STMFD_bang (SP, FP_mask | IP_mask | LR_mask | PC_mask); + SUB_imm8 (FP, IP, 4); + + // the frame size will be updated later + LDR (IP, (int)patch_frame_size-(int)mip-8, PC); + SUB (SP, SP, IP); + #endif + + #ifdef AVMPLUS_IA32 + if (core->minstack) + { + // Check the stack + CMP(ESP, 0x7FFFFFFF); + stackCheck.patchStackSize = (uint32*)PREV_MD_INS(mip); + JB(0x7FFFFFFF); + mdPatchPrevious(&stackCheck.overflowLabel); + mdLabel(&stackCheck.resumeLabel, mip); + } + + PUSH (EBP); + MOV(EBP,ESP); // copy of ESP before adjust + SUB(ESP, 0x7FFFFFFF); // force 32bit operand for instruction + activation.adjustmentIns = PREV_MD_INS(mip); // patch location + for (int i=0; i < 3; i++) + methodArgs[i].pos -= 4; + framep = EBP; + + #ifdef AVMPLUS_VERBOSE + x87Top = 0; + #endif + + x87Dirty = false; + + #endif /* AVMPLUS_PPC */ + + #ifdef _DEBUG + // not terminal but good to know if our prologue estimation is off + int actual = (int)mip - (int)mipStart; + AvmAssertMsg( actual <= md_prologue_size, "Increase md_prologue_size estimate\n"); + #endif /* _DEBUG */ + } + +#ifdef AVMPLUS_ARM + + /* Returns the number of bits set in val. + * For a derivation of this algorithm, see + * "Algorithms and data structures with applications to + * graphics and geometry", by Jurg Nievergelt and Klaus Hinrichs, + * Prentice Hall, 1993. + */ + int CodegenMIR::countBits(uint32 value) + { + value -= (value & 0xaaaaaaaaL) >> 1; + value = (value & 0x33333333L) + ((value >> 2) & 0x33333333L); + value = (value + (value >> 4)) & 0x0f0f0f0fL; + value += value >> 8; + value += value >> 16; + return (int)value & 0xff; + } +#endif + + void CodegenMIR::generateEpilogue() + { +#ifndef FEATURE_BUFFER_GUARD + if (overflow) + return; + + // make sure we have committed the memory we are going to use for the epilogue + if (!ensureMDBufferCapacity(pool, md_epilogue_size)) + return; +#endif /* FEATURE_BUFFER_GUARD */ + +#ifdef AVMPLUS_VERBOSE + if (verbose()) + core->console << "epilogue:\n"; +#endif + + // mark location of epilogue start, we need it for patching return opcodes + + MDInstruction* mipEpilog = mip; + (void)mipEpilog; + + if (patch_end.nextPatch) + mdLabel(&patch_end, mip); + + #ifdef AVMPLUS_PPC + int stackSize = activation.highwatermark; + int nonVolatileAreaSize = 0; + if (gpregs.LowerBound != Unknown) { + nonVolatileAreaSize += 4*(R31-gpregs.LowerBound+1); + } + if (fpregs.LowerBound != Unknown) { + nonVolatileAreaSize += 8*(F31-fpregs.LowerBound+1); + + // Make sure it's aligned on quadword boundary + nonVolatileAreaSize = BIT_ROUND_UP(nonVolatileAreaSize,8); + } + + uint32 *save_mip = mip; + if (gpregs.LowerBound != Unknown) { + mip = patch_stmw; + STMW((Register)gpregs.LowerBound, -(R31-gpregs.LowerBound+1)*4, SP); + mip = save_mip; + } + + int frameSize = stackSize+calleeAreaSize()+kLinkageAreaSize+nonVolatileAreaSize; + + // The PowerPC stack pointer must always be quadword (16-byte) + // aligned. + frameSize = BIT_ROUND_UP(frameSize, 16); + mip = patch_stwu; + if (IsSmallDisplacement(frameSize)) + { + STWU(SP, -frameSize, SP); + } + else + { + LI32(R0, -frameSize); + STWUX(SP, SP, R0); + } + mip = save_mip; + + // epilogue + LWZ (SP, 0, SP); + LWZ (R0, 8, SP); + MTLR (R0); + if (fpregs.LowerBound != Unknown) { + int offset = -nonVolatileAreaSize; + for (int i = fpregs.LowerBound; i<=F31; i++) { + LFD ((Register)i, offset, SP); + offset += 8; + } + } + if (gpregs.LowerBound != Unknown) { + LMW ((Register)gpregs.LowerBound, -(32-gpregs.LowerBound)*4, SP); + } + BLR (); + + // At this point, we generate the code to store + // the nonvolatile floating point registers if needed, + // and patch the prologue to jump here. + if (fpregs.LowerBound != Unknown) { + uint32 *stfd_addr = mip; + int offset = -nonVolatileAreaSize; + for (int i = fpregs.LowerBound; i<=F31; i++) { + STFD ((Register)i, offset, SP); + offset += 8; + } + BLR(); + + // Add jump to store instructions + int disp = (int)stfd_addr - (int)(patch_stmw+1); + AvmAssert(disp < 0x2000000); + patch_stmw[1] = 0x48000001 | disp; + } + + if (core->minstack) + { + // Patch the stack oveflow check's frame size + uint32 *savedMip = mip; + mip = stackCheck.patchStackSize; + ADDI32(R12, R12, activation.highwatermark); + mip = savedMip; + + // Patch the jump to jump to here, and generate + // the call to the exception handler. + mdLabel(&stackCheck.overflowLabel, mip); + + // We haven't set up the real stack frame yet, + // so we need a temporary one so we can call + // stackOverflow. + const int kTempFrameSize = 24+4*3; // linkage + 1 callee param + 2 saved args + STWU(SP, -kTempFrameSize, SP); + + STW(R3, 24, SP); // set callee area + STW(R4, 28, SP); // save args + STW(R5, 32, SP); + thincall(FUNCADDR(CodegenMIR::stackOverflow)); + LWZ(R3, 24, SP); // restore parameters + LWZ(R4, 28, SP); + LWZ(R5, 32, SP); + + // Tear down temporary stack frame + LWZ(SP, 0, SP); + + B(0); + mdPatchPrevious(&stackCheck.resumeLabel); + } + #endif + + #ifdef AVMPLUS_ARM + int stackSize = activation.highwatermark; + + int frameSize = stackSize+calleeAreaSize(); + + // Patch the frame size + *patch_frame_size = frameSize; + + // Patch the STMFD instruction + *patch_stmfd |= gpregs.nonVolatileMask; + + // epilogue + int nonVolatileCount = countBits(gpregs.nonVolatileMask); + SUB_imm8 (SP, FP, 12 + nonVolatileCount * 4); + LDMFD (SP, gpregs.nonVolatileMask | FP_mask | SP_mask | PC_mask); + + // Patch stack overflow check + if (core->minstack) + { + // Patch the stack overflow check's frame size + *(stackCheck.patchStackSize) = core->minstack + activation.highwatermark; + +#ifdef AVMPLUS_VERBOSE + if (verbose()) + core->console << "stackOverflow:\n"; +#endif + if (!pool->stackOverflowHandler) + { + pool->stackOverflowHandler = (int)mip; + + // Save the parameters to the method + STMFD_bang (SP, R0_mask | R1_mask | R2_mask | LR_mask); + + MOV(R1, R0); // env + MOV_imm32(R0, (int)core); + thincall(COREADDR(AvmCore::_stackOverflow)); + + // If we got here, we're already in a stack overflow + // and the VM wants us to ignore that fact so + // we can construct the error object. + + // Restore the parameters to the method, and return. + LDMFD_bang (SP, R0_mask | R1_mask | R2_mask | PC_mask); + } + // Patch the jump to jump to here, and generate + // the call to the exception handler + + mdLabel(&stackCheck.overflowLabel, mip); + + // Save LR + STMFD_bang (SP, LR_mask); + + thincall(pool->stackOverflowHandler); + + // Restore LR + LDMFD_bang (SP, LR_mask); + + B(0); + mdPatchPrevious(&stackCheck.resumeLabel); + } + #endif + + #ifdef AVMPLUS_IA32 + MdLabel patch_probe_stack, patch_probe_return; + uint32 arSize = 0; + if (framep == EBP) + { + // adjust esp by our activation record size + arSize = BIT_ROUND_UP(activation.highwatermark, 16); + + #ifdef _MAC + // On Mac, the stack size must be 16-byte aligned. + // - We start off with 4 bytes of callee area, for the + // caller's return address. + // - We then PUSH EBP, for 8 bytes of callee area. + // - The amount we then subtract from ESP needs to leave + // ESP 16-byte aligned + // - We just aligned arSize to 16, so add 8 to get the + // whole shebang aligned to 16 + arSize += 8; + #endif + + // now patch the SUB(ESP, size) instruction in + // the prologue. + // + // if stack > 1 page then we need to touch each page + // since windows expects stack to grow page by page. + // + MDInstruction* current = mip; + if (arSize > mirBuffer->pageSize()) + { + // clobber the entire SUB(ESP, size) with a jmp to code that does + // adjusts the stack and tickles each page in order + mip = activation.adjustmentIns - 2; // -2 to step on the sub instruction, which is 6B long + JMP(0x7FFFFFFF); // jmp takes 5 bytes + mdPatchPrevious(&patch_probe_stack); // mark the location for patching + NOP(); // 1 byte converted to nop + mdLabel(&patch_probe_return, mip); // mark where we want to return to + } + else + { + // only need to adjust the SUB(ESP, ) instruction + mip = activation.adjustmentIns; + IMM32(arSize); + } + mip = current; + + for (int i=0; i < 3; i++) { + OP* v = &calleeVars[i]; + if (v->reg == Unknown && v->pos != InvalidPos) { + v->reg = (Register) v->imm; + rematerialize(v); + } + } + + //ADD(ESP, arSize); + //POP (EBP); + ALU(0xc9); // leave: esp = ebp, pop ebp + } + RET (); + + // Patch stack overflow check + if (core->minstack) + { + // Patch the stack overflow check's frame size + *(stackCheck.patchStackSize) = core->minstack + activation.highwatermark; + +#ifdef AVMPLUS_VERBOSE + if (verbose()) + core->console << "stackOverflow:\n"; +#endif + if (!pool->stackOverflowHandler) + { + pool->stackOverflowHandler = (int)mip; + + #ifdef _MAC + // Stack must be aligned at 16-byte boundary for MacOS X ABI. + // The method did a CALL to stackOverflowHandler, so we're already + // 4 bytes pushed from the original 16-byte stack alignment. + PUSH(8, ESP); // env + PUSH((int)core); + // _stackOverflow is needed because gcc can't take address + // of a virtual method + thincall(COREADDR(AvmCore::_stackOverflow)); + ADD(ESP, 8); + + #elif defined(AVMPLUS_CDECL) + // gcc version (Linux) + PUSH(8, ESP); // env + PUSH((int)core); + // _stackOverflow is needed because gcc can't take address + // of a virtual method + thincall(COREADDR(AvmCore::_stackOverflow)); + ADD(ESP, 8); + + #else + // Windows version + PUSH(8, ESP); // env + MOV(ECX, (int)core); + thincall(COREADDR(AvmCore::stackOverflow)); + #endif + + RET(); + } + // Patch the jump to jump to here, and generate + // the call to the exception handler + mdLabel(&stackCheck.overflowLabel, mip); + thincall(pool->stackOverflowHandler); + JMP(0x7FFFFFFF); + mdPatchPrevious(&stackCheck.resumeLabel); + } + + // > 1 page stack growth + if (patch_probe_stack.nextPatch) + { + // patch the jmp _probe expression to the current + // location where we emit the probe code + mdLabel(&patch_probe_stack, mip); + emitAllocaProbe(arSize, &patch_probe_return); + } + + #endif /* AVMPLUS_IA32 */ + + #ifdef AVMPLUS_PROFILE + if (core->sprof.sprofile) + { + int asByteCount = abcEnd-abcStart; + int mirBytes = (int)ipEnd-(int)ipStart; + int mdBytes = (int)mip - (int)&code[0]; + Stringp name = info->name; + if (!name) name = core->kEmptyString; + core->console + << "size profile " + #if defined(AVMPLUS_VERBOSE) || defined(DEBUGGER) + << name + #endif + << "\n " + << "abc " << asByteCount + << " mir " << mirBytes + //<< "/" << 100*(mirBytes-asByteCount)/asByteCount << "% " + << " md " << mdBytes + //<< "/"<<100*(mdBytes-asByteCount)/asByteCount << "%" + << "\n"; + } + #endif /* AVMPLUS_PROFILE */ + + // fix case tables. Each entry contains the absolute bytecode + // offset, we replace with absolute machine address + // now that the code buffer is at a known starting address. + uint32* mdCasePtr = (uint32*) &code[0]; + for(int i=0, n=case_count; icode == MIR_bb && ins->pos != 0, "Case target MUST have been resolved by this point"); + *mdCasePtr = ins->pos; + } + + // patch up the exception table + if (info->exceptions) + { + // update exception tables for this method + for (int i=0, n=info->exceptions->exception_count; i < n; i++) + { + ExceptionHandler* h = &info->exceptions->exceptions[i]; + OP* label = (OP*) h->target; + AvmAssertMsg(label->code == MIR_bb && label->pos != 0, "Exception target MUST have been resolved by this point"); + h->target = label->pos; + } + } + + #ifdef AVMPLUS_INTERP + // mark method as been JIT'd + info->flags |= AbstractFunction::TURBO; + #endif /* AVMPLUS_INTERP */ + + int mipEnd = (int) mip; + (void)mipEnd; + + bindMethod(info); + +#ifndef AVMPLUS_JIT_READONLY + #ifdef AVMPLUS_PPC + // Tell the OS that this buffer contains executable code. + // This is required since machines like the G4 have dual + // cache designs. + MakeDataExecutable(mipStart, mipEnd-(int)mipStart); + #endif /* AVMPLUS_PPC */ +#endif /* AVMPLUS_JIT_READONLY */ + + #ifdef _DEBUG + // not terminal but good to know if our epilogue estimation is off + int actual_epilogue_size = ( (int)mipEnd - (int)mipEpilog ); + AvmAssertMsg( actual_epilogue_size <= md_epilogue_size , "Increase md_epilogue_size estimate\n"); + if ((byte*)mipEnd >= pool->codeBuffer->end()) + AvmAssert(false); + #endif /* DEBUG */ + + #ifdef AVMPLUS_PROFILE + if (core->sprof.sprofile) + { + uint64 endTime = GC::GetPerformanceCounter(); + uint64 freq = GC::GetPerformanceFrequency(); + double mddiff = endTime-mdStartTime; + double alldiff = endTime - verifyStartTime; + double mirdiff = alldiff - mddiff; + mddiff = 1000*mddiff/freq; + alldiff = 1000*alldiff/freq; + mirdiff = 1000*mirdiff/freq; + double mdrate = mInstructionCount / mddiff; // K instructions per second (diff in ms) + double mirrate = (ipEnd-ipStart) / mirdiff; // K OP's per sec + double mdperc = mddiff/alldiff*100; + int size = mipEnd - (int)mipStart; + + // perf + core->console << " " << (int)mirrate << "K mir/s " + << (int)(mdrate) << "K md/s " + << (int)(mdperc) << "% in compile during " + << (int)(1000*alldiff) << " micros\n"; + + // sizing + core->console << " " << (size) << " bytes from " + << InsNbr(ip) << " MIR instructions " + << (mInstructionCount) << " MD. max span " + << longestSpan + << " cse " << cseHits + << " dead " << dceHits + << "\n"; + + // stack / registers + core->console << " " << + activation.highwatermark << " bytes of stack with " + << spills << " spills " + << steals << " steals " + << remats << " remats using " + << fullyUsedCount << " times" << "\n"; + } + + //#define SZ_TUNING + #if defined(SZ_TUNING) && defined(DEBUGGER) && defined(_DEBUG) + // output is raw numbers so that we can import into excel easily + sizingStats[SZ_MD] = mipEnd - (int)mipStart; + core->console << info->name << ", " + << sizingStats[SZ_ABC] << ", " // bytes of abc + << sizingStats[SZ_MIREXP] << ", " // expansion factor abc -> mir + << sizingStats[SZ_MIR] << ", " // bytes of mir + << sizingStats[SZ_MIRWASTE] << ", " // % mir buffer wasted + << sizingStats[SZ_MIRPRO] << ", " // deviation from mir prologue estimate + << sizingStats[SZ_MIREPI] << ", " // deviation from mir epilogue estimate + << sizingStats[SZ_MD] << " " // bytes of machine dependent code + << "\n"; + #endif /* _DEBUG */ + #endif /* AVMPLUS_PROFILE */ + + } + + /** + * Generic register allocation routine. + * + * Pick a register for allocation and attempt to keep it + * live for as long as the instructions' lastUse field dictates. + * Optionally one can specify a particular register to be allocated. + * + * IMPORTANT + * + * The caller is responsible for updating the reg field of the + * instruction. For example, ins->reg = registerAlloc(ins); + * And then calling either regs.addActive(ins) which adds the + * register to the active list or calling addFree() which + * places the register back on the freelist . Failure to do so + * will cause registers to leak from the allocators' view. + * + * This function will always provide a register and may spill + * in order to get one. + * + * @param ins - instruction for which the register is to be used + * @param r - particular register to obtain. + */ + + CodegenMIR::Register CodegenMIR::registerAllocSpecific(RegInfo& regs, Register r) + { + AvmAssert(r != Unknown); + if (regs.isFree(r)) + { + // found the requested register on the free list + //removeRegCount++; + regs.removeFree(r); + } + else + { + // remove from active list, and spill it + //removeRegCount++; + OP* vic = regs.active[r]; + AvmAssert(vic != NULL); + AvmAssert(vic->reg == r); + + #ifdef AVMPLUS_VERBOSE + if (verbose() && vic->isDirty()) + core->console << "STEAL specific @" << InsNbr(vic) << "\n"; + #endif + + spill(vic); + vic->reg = Unknown; + regs.removeActive(r); + + #ifdef AVMPLUS_PROFILE + steals++; + #endif + } + + #ifdef AVMPLUS_ARM + // If the register allocated is nonvolatile, add it + // to the mask. + if (®s == &gpregs) + { + regs.nonVolatileMask |= (rmask(r) & regs.calleeSaved); + } + else + { + gpregs.nonVolatileMask |= R4_mask | R5_mask; + } + #endif + + #ifdef AVMPLUS_PPC + // Remember what was the lowest nonvolatile register + // for stmw/lmw + if ((rmask(r) & regs.calleeSaved) && r < regs.LowerBound) + regs.LowerBound = r; + #endif + + return r; + } + + CodegenMIR::Register CodegenMIR::InsPrepResult(RegInfo& regs, OP* ins, int exclude) + { + Register r = ins->reg; + int set = regs.free & ~exclude; + + if (r == Unknown) + { + r = registerAllocAny(regs, ins); + } + else if (!(regs.free & rmask(r)) && set) + { + // someone's using the one we want but there are other free regs. + OP* vic = regs.active[r]; + vic->reg = registerAllocFromSet(regs, set); + regs.addActive(vic); + regs.removeActive(r); + moveR2R(vic, r, vic->reg); + // now r is free + } + else + { + registerAllocSpecific(regs, r); + } + setResultReg(regs, ins, r); + return r; + } + + CodegenMIR::Register CodegenMIR::registerAllocAny(RegInfo& regs, OP* ins) + { + Register r = Unknown; + + int set = ins->liveAcrossCall ? regs.calleeSaved : ~regs.calleeSaved; + if (set == 0) set = -1; + + if (!regs.free) + { + // nothing free, steal one from from desired set + // LSRA says pick the one with the furthest use + OP* vic = regs.findLastActive(set); + + if (!vic) + { + set = -1; + vic = regs.findLastActive(set); + AvmAssert(vic != NULL); + } + + #ifdef AVMPLUS_VERBOSE + if (verbose() && vic->isDirty()) + core->console << "STEAL any @" << InsNbr(vic) <<"\n"; + #endif + + spill(vic); + regs.retire(vic); + + #ifdef AVMPLUS_PROFILE + steals++; + #endif + } + + // ok we have at least 1 free register so let's try to pick + // the best one given the profile of the instruction + + if (!(set &= regs.free)) + { + // desired register class is not free so pick first of any class + set = regs.free; + } + + AvmAssert(set != 0); + + r = registerAllocFromSet(regs, set); + + return r; + } + + CodegenMIR::Register CodegenMIR::registerAllocFromSet(RegInfo& regs, int set) + { + #ifdef AVMPLUS_PPC + + // On PowerPC, prefer higher registers, to minimize + // size of nonvolatile area that must be saved. + register int i; + #ifdef DARWIN + asm ("cntlzw %0,%1" : "=r" (i) : "r" (set)); + #else + // Soothe Codewarrior's upset soul + register uint32 in = set; + asm + { + cntlzw i,in; + } + #endif + i = 31-i; + regs.free &= ~rmask(i); + + // Remember what was the lowest nonvolatile register + // for stmw/lmw + if ((rmask(i) & regs.calleeSaved) && i < regs.LowerBound) + regs.LowerBound = i; + + return (Register) i; + + #elif defined(AVMPLUS_WIN32) + + // TODO: translate to AT&T notation for Macintel + Register r; + _asm + { + mov ecx, regs + bsf eax, set // i = first bit set + btr RegInfo::free[ecx], eax // free &= ~rmask(i) + mov r, eax + } + return r; + #elif defined(_MAC) && TARGET_CPU_X86 + Register r; + asm( + "bsf %1, %%eax\n\t" + "btr %%eax, %2\n\t" + "movl %%eax, %0\n\t" + : "=m"(r) : "m"(set), "m"(regs.free) : "%eax", "memory" ); + return r; + #elif defined AVMPLUS_ARM + +#ifdef UNDER_CE + // need to implement faster way + int i=0; + while (!(set & rmask(i))) + i ++; + regs.free &= ~rmask(i); + return (Register) i; + +#else + // Note: The clz instruction only works on armv5 and up. + register int i; + asm("clz %0,%1" : "=r" (i) : "r" (set)); + i = 31-i; + regs.free &= ~rmask(i); +#endif + + // If the register allocated is nonvolatile, add it + // to the mask. + if (®s == &gpregs) + { + regs.nonVolatileMask |= (rmask(i) & regs.calleeSaved); + } + else + { + gpregs.nonVolatileMask |= R4_mask | R5_mask; + } + + return (Register) i; + + #else // generic algorithm + + int i=0; + while (!(set & rmask(i))) + i ++; + regs.free &= ~rmask(i); + + return (Register) i; + + #endif + } + + + /** + * Prep an instruction for issuance. + * + * Here's where we perform the guts of deciding which registers should + * be bound to which operands for a given instruction. The restrictions + * are defined by registers called reqdA/B, which contain register requirements + * for each A/B instruction. 'Unknown' is used to denote that there are + * no register requirements for the instruction. + * + * Once this call returns all provided operand instructions are + * guaranteeed to be available in registers. The reqd variables will be + * filled with the registers to be used for the MD instruction. + * + * @param insA/B - operands that are required for MD instruction + * @param reqdA/B - IN: specific MD register reservations that must occur for the instruction + * OUT:the actual register assigned for the instruction + */ + + + // preperation for a single operand and a result + void CodegenMIR::InsRegisterPrepA(OP* insRes, RegInfo& regsA, OP* insA, Register& reqdA) + { + AvmAssert(insRes != 0); + AvmAssert(insA != 0); + + if (insA->lastUse <= insRes) + insA->liveAcrossCall = 0; + + // a single instruction? + Register rA = insA->reg; + if (rA == Unknown) + { + // curr |= (_OUT) + AvmAssert(rA == Unknown); + insA->reg = registerAlloc(regsA, insA, reqdA); + + AvmAssert(insA->reg != Unknown); + regsA.addActive(insA); + rematerialize(insA); + } + else + { + if (reqdA == Unknown) + { + //curr |= (IN_ANY); + AvmAssert(rA != Unknown); + } + else if (reqdA == rA) + { + //curr |= (IN_REQ); + } + else + { + AvmAssert(reqdA != Unknown); + //curr |= (IN_WRONG); + + // free A and realloc + regsA.retire(rA); + insA->reg = registerAllocSpecific(regsA, reqdA); + AvmAssert(insA->reg != rA); + moveR2R(insA, rA, insA->reg); + regsA.addActive(insA); + } + } + reqdA = insA->reg; + + // now we've done the input registers let pick one for the result + // but first we need to update the state of the allocator + // to reflect the fact that the instruction is complete + + regsA.expire(insA, insRes); + } + + // preperation for two operands A and B and a result + void CodegenMIR::InsRegisterPrepAB(OP* insRes, RegInfo& regsA, OP* insA, Register& reqdA, RegInfo& regsB, OP* insB, Register& reqdB) + { + /** + * Each input may be in 1 of 4 possible states. IN_REQ, IN_WRONG, IN_ANY, OUT + * + * In the main switch we concern ourselves with only 2 inputs; A and B. This + * is because we only need to deal with a maximum of 2 input instructions at a time + * That is insA and insB. + * + * We really have 5 possible states, since we also have OUT_REQ and OUT_ANY. + * But 2 inputs by 5 states gives a total of 25 states, which is a little too painful + * to enumerate, so we combine the OUT states together, giving a 4x4 matrix. + * We take advantage of the fact that its symmetrical so we don't need to + * complete all cells within it; only 8 are needed (belch!). We can + * swap A, B and proceed accordingly; that's what all the ugly #defines are for. + */ + AvmAssert(insRes != 0); + AvmAssert(insA != 0); + AvmAssert(insB != 0); + + /* + * Handle the special case where insA and insB are the same. + * This happens when things like 2+2 are encountered. + */ + if (insA == insB && reqdB == Unknown) + { + InsRegisterPrepA(insRes, regsA, insA, reqdA); + reqdB = reqdA; + return; + } + + if (®sA != ®sB) + { + // allocating from different sets of regs is easy + InsRegisterPrepA(insRes, regsA, insA, reqdA); + InsRegisterPrepA(insRes, regsB, insB, reqdB); + return; + } + + if (insA->lastUse <= insRes) insA->liveAcrossCall = 0; + if (insB->lastUse <= insRes) insB->liveAcrossCall = 0; + + RegInfo& regs = regsA; // same as regsB + + // classify A first + if (insA->reg == Unknown) + { + // curr |= (_OUT) + if (insB->reg == Unknown) + { + //curr |= (_OUT); + InsPrep_A_OUT_B_OUT(regs, insA, reqdA, insB, reqdB); + } + else + { + // IN + if (reqdB == Unknown) + { + //curr |= (IN_ANY); + #define InsPrep_A_OUT_B_IN_ANY(regs, iA, rA, iB, rB) InsPrep_A_IN_ANY_B_OUT(regs, iB, rB, iA, rA) + InsPrep_A_OUT_B_IN_ANY(regs, insA, reqdA, insB, reqdB); + } + else if (reqdB == insB->reg) + { + //curr |= (IN_REQ); + #define InsPrep_A_OUT_ANY_B_IN_REQ(regs, iA, rA, iB, rB) InsPrep_A_IN_REQ_B_OUT_ANY(regs, iB, rB, iA, rA) + #define InsPrep_A_OUT_REQ_B_IN_REQ(regs, iA, rA, iB, rB) InsPrep_A_IN_REQ_B_OUT_REQ(regs, iB, rB, iA, rA) + if (reqdA == Unknown) + InsPrep_A_OUT_ANY_B_IN_REQ(regs, insA, reqdA, insB, reqdB); + else + InsPrep_A_OUT_REQ_B_IN_REQ(regs, insA, reqdA, insB, reqdB); + } + else + { + //curr |= (IN_WRONG); + #define InsPrep_A_OUT_B_IN_WRONG(regs, iA, rA, iB, rB) InsPrep_A_IN_WRONG_B_OUT(regs, iB, rB, iA, rA) + InsPrep_A_OUT_B_IN_WRONG(regs, insA, reqdA, insB, reqdB); + } + } + } + else + { + if (reqdA == Unknown) + { + //curr |= (IN_ANY); + if (insB->reg == Unknown) + { + // curr |= (_OUT) + InsPrep_A_IN_ANY_B_OUT(regs, insA, reqdA, insB, reqdB); + } + else + { + // IN + if (reqdB == Unknown) + { + //curr |= (IN_ANY); + reqdA = insA->reg; + reqdB = insB->reg; + } + else if (reqdB == insB->reg) + { + //curr |= (IN_REQ); + reqdA = insA->reg; + } + else + { + //curr |= (IN_WRONG); + #define InsPrep_A_IN_ANY_B_IN_WRONG(regs, iA, rA, iB, rB) InsPrep_A_IN_WRONG_B_IN_ANY(regs, iB, rB, iA, rA) + InsPrep_A_IN_ANY_B_IN_WRONG(regs, insA, reqdA, insB, reqdB); + } + } + } + else if (reqdA == insA->reg) + { + //curr |= (IN_REQ); + if (insB->reg == Unknown) + { + // curr |= (_OUT) + if (reqdA == Unknown) + InsPrep_A_IN_REQ_B_OUT_ANY(regs, insA, reqdA, insB, reqdB); + else + InsPrep_A_IN_REQ_B_OUT_REQ(regs, insA, reqdA, insB, reqdB); + } + else + { + // IN + if (reqdB == Unknown) + { + //curr |= (IN_ANY); + reqdB = insB->reg; + } + else if (reqdB == insB->reg) + { + //curr |= (IN_REQ); + // nothing to do + } + else + { + //curr |= (IN_WRONG); + InsPrep_A_IN_REQ_B_IN_WRONG(regs, insA, reqdA, insB, reqdB); + } + } + } + else + { + //curr |= (IN_WRONG); + if (insB->reg == Unknown) + { + // curr |= (_OUT) + InsPrep_A_IN_WRONG_B_OUT(regs, insA, reqdA, insB, reqdB); + } + else + { + // IN + if (reqdB == Unknown) + { + //curr |= (IN_ANY); + InsPrep_A_IN_WRONG_B_IN_ANY(regs, insA, reqdA, insB, reqdB); + } + else if (reqdB == insB->reg) + { + //curr |= (IN_REQ); + #define InsPrep_A_IN_WRONG_B_IN_REQ(regs, iA, rA, iB, rB) InsPrep_A_IN_REQ_B_IN_WRONG(regs, iB, rB, iA, rA) + InsPrep_A_IN_WRONG_B_IN_REQ(regs, insA, reqdA, insB, reqdB); + } + else + { + //curr |= (IN_WRONG); + AvmAssert(false); // this case is not needed, since no current MD instruction + // requests specific registers for both A and B +#if 0 + InsPrep_A_IN_WRONG_B_IN_WRONG(regs, insA, reqdA, insB, reqdB); +#endif + } + } + } + } + + // now we've done the input registers + // we need to update the state of the allocator + // to reflect the fact that the instruction is complete + regsA.expire(insA, insRes); + regsB.expire(insB, insRes); + } + + void CodegenMIR::InsPrep_A_IN_REQ_B_IN_WRONG(RegInfo& regs, OP* insA, Register& reqdA, OP* insB, Register& reqdB) + { + AvmAssert(insA->reg == reqdA); + AvmAssert(insB->reg != reqdB); + AvmAssert(reqdA != Unknown); + AvmAssert(reqdB != Unknown); + AvmAssert(reqdA != reqdB); // not supported! + (void)insA; + (void)reqdA; + + // free B and realloc + Register rB = insB->reg; + regs.retire(rB); + insB->reg = registerAllocSpecific(regs, reqdB); + AvmAssert(insB->reg != insA->reg); + moveR2R(insB, rB, insB->reg); + + regs.addActive(insB); + AvmAssert(reqdA == insA->reg); + AvmAssert(reqdB == insB->reg); + } + + void CodegenMIR::InsPrep_A_IN_REQ_B_OUT_REQ(RegInfo& regs, OP* insA, Register& reqdA, OP* insB, Register& reqdB) + { + AvmAssert(insA->reg == reqdA); + AvmAssert(insB->reg == Unknown); + AvmAssert(reqdA != Unknown); + AvmAssert(reqdB != Unknown); + AvmAssert(reqdA != reqdB); // can't have A and B both be the same register + (void)insA; + (void)reqdA; + + insB->reg = registerAllocSpecific(regs, reqdB); + + AvmAssert(insB->reg != insA->reg); + + regs.addActive(insB); + rematerialize(insB); + + AvmAssert(insA->reg == reqdA); + AvmAssert(insA->reg == reqdB); + } + + void CodegenMIR::InsPrep_A_IN_REQ_B_OUT_ANY(RegInfo& regs, OP* insA, Register& reqdA, OP* insB, Register& reqdB) + { + AvmAssert(insA->reg == reqdA); + AvmAssert(insB->reg == Unknown); + AvmAssert(reqdA != Unknown); + AvmAssert(reqdB == Unknown); + (void)reqdA; + + // insA has the required register, and we need one for B. + Register rA = insA->reg; + + // if there are free regs, we know rA wont be chosen. Otherwise, + // when all regs are in use, allocating B could spill rA. we dont want that + // so we take A out of the active list so its ignored by stealLastActive(). + + AvmAssert(regs.active[rA] == insA); + regs.active[rA] = NULL; // force allocator to choose something other than rA + insB->reg = registerAllocAny(regs, insB); + regs.active[rA] = insA; + + AvmAssert(insA->reg == rA); // make sure insA wasn't spilled + AvmAssert(insB->reg != Unknown && insB->reg != rA); // make sure insB got a different register + + regs.addActive(insB); + rematerialize(insB); + reqdB = insB->reg; + } + +#if 0 + void CodegenMIR::InsPrep_A_IN_WRONG_B_IN_WRONG(RegInfo& regs, OP* insA, Register& reqdA, OP* insB, Register& reqdB) + { + AvmAssert(insA->reg != reqdA); + AvmAssert(insB->reg != reqdB); + AvmAssert(reqdA != Unknown); + AvmAssert(reqdB != Unknown); + AvmAssert(reqdA != reqdB); // not supported! + + Register rA = insA->reg; + Register rB = insB->reg; + regs.retire(rA); + regs.retire(rB); + + //@todo not quite correct as allocator may wish + // to spill A for B, meaning we'd A should be in a temp + insA->reg = registerAllocSpecific(regs, reqdA); + insB->reg = registerAllocSpecific(regs, reqdB); + AvmAssert(insA->reg != insB->reg); + if (rA == insB->reg && rB == insA->reg) + { + // swap A and B + AvmAssert(false); // not supported! + } + else if (rA == insB->reg) + { + // A current register is going to be + // used by insB, so we need to clear + // it out before clobbering it. + moveR2R(insA, rA, insA->reg); + moveR2R(insB, rB, insB->reg); + } + else + { + // we know that the above doesn't apply so + // it safe to clobber insB's register. + moveR2R(insB, rB, insB->reg); + moveR2R(insA, rA, insA->reg); + } + regs.addActive(insA); + regs.addActive(insB); + reqdA = insA->reg; + reqdB = insB->reg; + } +#endif + + void CodegenMIR::InsPrep_A_IN_WRONG_B_IN_ANY(RegInfo& regs, OP* insA, Register& reqdA, OP* insB, Register& reqdB) + { + Register rA = insA->reg; + Register rB = insB->reg; + + AvmAssert(rA != Unknown); + AvmAssert(rA != reqdA); + AvmAssert(rB != Unknown); + AvmAssert(reqdA != Unknown); + AvmAssert(reqdB == Unknown); + + + regs.retire(rA); // take A off active list and return to free list + insA->reg = registerAllocSpecific(regs, reqdA); + + if (reqdA == rB) + { + // All we need to do is swap A and B + registerAllocSpecific(regs, rA); + #ifdef AVMPLUS_PPC + moveR2R(insA, rA, R0); + moveR2R(insA, rB, rA); + moveR2R(insA, R0, rB); + #endif /* AVMPLUS_PPC */ + + #ifdef AVMPLUS_ARM + moveR2R(insA, rA, R0); + moveR2R(insA, rB, rA); + moveR2R(insA, R0, rB); + #endif /* AVMPLUS_ARM */ + + #ifdef AVMPLUS_IA32 + XCHG(rA, rB); + #endif /* AVMPLUS_IA32 */ + + rB = rA; + regs.addFree(rA); + } + else + { + // kicked out B? + if (rB == insA->reg) + { + // allocator spilled rB and gave it to A, so we need a temp register for B + Register t = registerAllocAny(regs, insB); + moveR2R(insB, rB, t); + insB->reg = rB = t; + regs.addActive(insB); + } + moveR2R(insA, rA, insA->reg); + } + + regs.addActive(insA); + AvmAssert(insA->reg == reqdA);//reqdA = insA->reg; + reqdB = rB; + } + + void CodegenMIR::InsPrep_A_IN_WRONG_B_OUT(RegInfo& regs, + OP* insA, Register& reqdA, + OP* insB, Register& reqdB + ) + { + AvmAssert(insA->reg != reqdA); + AvmAssert(insB->reg == Unknown); + AvmAssert(reqdA != Unknown); + + // get A now either use rA for B or alloc it + Register rA = insA->reg; + + regs.removeActive(rA); + insA->reg = registerAllocSpecific(regs, reqdA); + + if (reqdB == Unknown) + { + insB->reg = rA; + } + else + { + AvmAssert(reqdB != Unknown); + regs.addFree(rA); // back to the freelist + insB->reg = registerAllocSpecific(regs, reqdB); + } + + moveR2R(insA, rA, insA->reg); + + regs.addActive(insA); + regs.addActive(insB); + rematerialize(insB); + + AvmAssert(reqdA == insA->reg); + reqdB = insB->reg; + } + + // A_IN_ANY + /* + case A_IN_ANY_B_IN_REQ: + swapAB(A_IN_REQ_B_IN_ANY); + break; + + case A_IN_ANY_B_IN_WRONG: + swapAB(A_IN_WRONG_B_IN_ANY); + break; + */ + + void CodegenMIR::InsPrep_A_IN_ANY_B_OUT(RegInfo& regs, OP* insA, Register& reqdA, OP* insB, Register& reqdB) + { + AvmAssert(insA->reg != Unknown); + AvmAssert(insB->reg == Unknown); + AvmAssert(reqdA == Unknown); + + Register rA = insA->reg; + insB->reg = registerAlloc(regs, insB, reqdB); + + // A/B conflict? + if (rA == insB->reg && insA->isDouble() == insB->isDouble()) + { + // allocator spilled rA and gave it to B, so we need a temp register for A + Register t = registerAllocAny(regs, insA); + moveR2R(insA, rA, t); + insA->reg = rA = t; + regs.addActive(insA); + } + + regs.addActive(insB); + rematerialize(insB); + reqdA = rA; + reqdB = insB->reg; + } + + // A_OUT + /* + case A_OUT_B_IN_REQ: + swapAB(A_IN_REQ_B_OUT); + break; + + case A_OUT_B_IN_WRONG: + swapAB(A_IN_WRONG_B_OUT); + break; + + case A_OUT_B_IN_ANY: + swapAB(A_IN_ANY_B_OUT); + break; + */ + + void CodegenMIR::InsPrep_A_OUT_B_OUT(RegInfo& regs, OP* insA, Register& reqdA, OP* insB, Register& reqdB) + { + AvmAssert(insA->reg == Unknown); + AvmAssert(insB->reg == Unknown); + + // if there are requirements order it + // @todo not quite correct since A alloc may spill + // B and visa versa, should use a temp. + if (reqdA != Unknown) + { + insA->reg = registerAllocSpecific(regs, reqdA); + insB->reg = registerAlloc(regs, insB, reqdB); + } + else + { + insB->reg = registerAlloc(regs, insB, reqdB); + reqdA = insA->reg = registerAllocAny(regs, insA); + } + regs.addActive(insA); + regs.addActive(insB); + + AvmAssert(insA->isDouble() != insB->isDouble() || insA->reg != insB->reg); + rematerialize(insA); + rematerialize(insB); + reqdB = insB->reg; + } + + // instruction type specific machine regiser to register move + void CodegenMIR::moveR2R(OP* ins, Register src, Register dst) + { + #ifdef AVMPLUS_PPC + if (ins->isDouble()) + FMR(dst, src); + else + MR(dst, src); + #endif /* AVMPLUS_PPC */ + + #ifdef AVMPLUS_ARM + // There is only one FP register in ARM, so this should never + // be entered. + AvmAssert(!ins->isDouble()); + MOV(dst, src); + #endif /* AVMPLUS_ARM */ + + #ifdef AVMPLUS_IA32 + AvmAssert(src != Unknown && dst != Unknown && src != dst); + AvmAssert(!ins->isDouble() || core->sse2); + if (ins->isDouble()) + MOVAPD(dst, src); + else + MOV(dst, src); + #endif /* AVMPLUS_IA32 */ + } + + /** + * A register has already been picked to spill and now we do the deed + * This is the final act which will most likely generate MD instructions + * and will update stack information for the instruction unless it + * does not require stack storage. + * + * WARNING: It is up to the caller to clear the register information. + * For example ins->reg = Unknown; + */ + void CodegenMIR::spill(OP* ins) + { + AvmAssert(ins->reg != Unknown); + + // first we want to make sure we don't spill easily + // rematerializable values including ones already on the stack + if (ins->isDirty()) + { + reserveStackSpace(ins); + copyToStack(ins, ins->reg); + #ifdef AVMPLUS_PROFILE + spills++; + #endif + } + } + + /** + * Place the value contained in a register on to the stack. + */ + void CodegenMIR::copyToStack(OP* ins, Register r) + { + int disp = stackPos(ins); + #ifdef AVMPLUS_PPC + if (ins->isDouble()) + STFD32( r, disp, SP ); // r => d(SP) + else + STW32( r, disp, SP ); // r => d(SP) + #endif /* AVMPLUS_PPC */ + + #ifdef AVMPLUS_ARM + if (ins->isDouble()) + { + // The one FP "register" on ARM is R4-R5 + STR(R4, disp, SP); + STR(R5, disp+4, SP); + } + else + { + STR(r, disp, SP); + } + #endif /* AVMPLUS_ARM */ + + #ifdef AVMPLUS_IA32 + if (!ins->isDouble()) { + MOV(disp, framep, r);// r => d(EBP) + } else if (core->sse2) { + MOVSD(disp, framep, r); // r => d(EBP) + } else { + FSTQ(disp, framep); + } + #endif /* AVMPLUS_IA32 */ + } + + /** + * This method proceeds to place the value generated by the given + * instruction into the register specified in the reg field of ins + * + * This is the final act which will most likely generate MD instructions + * + * WARNING: It is up to the caller to have previously allocated a register + * for this instruction and to have updated the register + * information. For example op->reg = EAX; + */ + void CodegenMIR::rematerialize(OP* ins) + { + // in order to rematerializable values we need a + // stack position and a register number + AvmAssert(ins->reg != Unknown); + + // It is believed that alloca is never rematerialized + // into a register; special handling would be needed. + AvmAssert(ins->code != MIR_alloc); + + if (ins->code == MIR_imm) + { + uint32 v = ins->imm; + Register r = ins->reg; + #ifdef AVMPLUS_PPC + // todo add faster case for v=0? okay but make sure not to set cc's + LI32(r, v); + #endif + + #ifdef AVMPLUS_ARM + MOV_imm32(r, v); + #endif + + #ifdef AVMPLUS_IA32 + MOV(r, v); // mov imm => r + // [ed 12/4/05] when v==0, don't use XOR(r,r) because that sets cc's which + // can screw up a later branch + #endif /* AVMPLUS_PPC */ + } + else + { + // Must have already spilled it or located it on the stack + AvmAssert(ins->pos != InvalidPos); + int disp = stackPos(ins); + + // now generate the MD code for the stack move + #ifdef AVMPLUS_PPC + if ( ins->isDouble() ) + LFD32(ins->reg, disp, SP); // argN(SP) => r + else + LWZ32(ins->reg, disp, SP); // argN(SP) => r + #endif + + #ifdef AVMPLUS_ARM + if (ins->isDouble()) + { + // We currently support one FP pseudo-register on ARM + AvmAssert(ins->reg == F0); + + LDR(R4, disp, SP); + LDR(R5, disp+4, SP); + } + else + { + LDR(ins->reg, disp, SP); + } + #endif + + #ifdef AVMPLUS_IA32 + if ( ins->isDouble() ) + { + Register r = ins->reg; + (void)r; + if (core->sse2) + { + MOVSD(ins->reg, disp, framep); // argN(ESP) => r + } + else + { + AvmAssert(r == FST0); + FFREE(FST7); + FLDQ(disp, framep); + } + } + else + { + MOV(ins->reg, disp, framep); // argN(ESP) => r + } + #endif + #ifdef AVMPLUS_PROFILE + remats++; + #endif + } + } + +#ifdef _DEBUG + void CodegenMIR::RegInfo::checkActives(OP* current) + { + for (int i=0; i < MAX_REGISTERS; i++) + { + OP* ins = active[i]; + AvmAssert(!ins || ins->lastUse > current); + } + } +#endif + + uint32 CodegenMIR::spillCallerRegisters(OP* current, RegInfo& regs, uint32 live) + { + AvmAssert(live); + AvmAssert((live®s.calleeSaved) == 0); // we're only spill scratch regs + uint32 flush = 0; + int saved = regs.calleeSaved; + + for (int i=0; i < MAX_REGISTERS; i++) + { + OP* ins; + if ((rmask(i) & live) && (ins = regs.active[i]) != 0 && ins->lastUse > current) + { + int freesaved = saved & regs.free; + if (freesaved) + { + // use a free calleeSaved reg + Register r = registerAllocFromSet(regs, freesaved); + moveR2R(ins, ins->reg, r); + regs.retire(ins); + ins->reg = r; + regs.addActive(ins); + continue; + } + + if (saved && ins->isDirty()) + { + // steal a saved reg + OP* vic = regs.findLastActive(saved); + if (ins->lastUse < vic->lastUse) + { + spill(vic); + Register r = vic->reg; + regs.removeActive(r); + vic->reg = Unknown; + moveR2R(ins, ins->reg, r); + regs.retire(ins); + ins->reg = r; + regs.addActive(ins); + continue; + } + } + + #ifdef AVMPLUS_VERBOSE + if (verbose() && ins->isDirty()) + core->console << "SAVE scratch @" << InsNbr(ins) << "\n"; + #endif + spill(ins); + flush |= rmask(i); + } + } + return flush; + } + + /** + * Remove any caller save registers from the active list + * and remove any register settings on them. + */ + void CodegenMIR::RegInfo::flushCallerActives(uint32 flush) + { + AvmAssert(flush); + for (int i=0; i < MAX_REGISTERS; i++) + if (rmask(i) & flush) + retire(active[i]); + } + + int CodegenMIR::prepCallArgsOntoStack(OP* call, OP* postCall) + { + // postCall >= call && postCall < next + int argc = call->argc; + + // spill any registers live after the call (args are placed after the call) + // This call will not free the registers so that we're able to put + // the args on the stack without rematerializing them. + + uint32 livegp; + if ((livegp = ~gpregs.calleeSaved & ~gpregs.free) != 0) + livegp = spillCallerRegisters(postCall, gpregs, livegp); + + uint32 livefp; + if ((livefp = ~fpregs.calleeSaved & ~fpregs.free) != 0) + livefp = spillCallerRegisters(postCall, fpregs, livefp); + + #ifdef AVMPLUS_PPC + + int GPRIndex = R3; + int FPRIndex = F1; + int offset = kLinkageAreaSize; + for(int i=1; i<=argc; i++) + { + OP* argVal = call->args[i]; + bool isDouble = argVal->isDouble(); + RegInfo *argRegs; + + Register r; + if (isDouble) + { + r = (FPRIndex >= F14) ? F0 : registerAllocSpecific(fpregs, (Register)FPRIndex); + FPRIndex++; + GPRIndex += 2; + offset += 8; + argRegs = &fpregs; + livefp &= ~rmask(r); + } + else + { + // Note: R11 is used as the temp for a stack-based argument, + // since R0 is needed for large-displacement stack offsets + r = registerAllocSpecific(gpregs, (GPRIndex >= R11) ? R11 : (Register)GPRIndex); + GPRIndex++; + offset += 4; + argRegs = &gpregs; + livegp &= ~rmask(r); + } + + if (argVal->reg == Unknown) + { + argVal->reg = r; + rematerialize(argVal); + argVal->reg = Unknown; + } + else + { + // wrong spot + moveR2R(argVal, argVal->reg, r); + } + + if (isDouble) { + STFD32(r, offset-8, SP); + + // We might be calling a varargs function. + // So, make sure the GPR's are also loaded with + // the value, or the stack contains it. + if (GPRIndex-2 <= R10) { + LWZ32((Register)(GPRIndex-2), offset-8, SP); + } + if (GPRIndex-1 <= R10) { + LWZ32((Register)(GPRIndex-1), offset-4, SP); + } + } else { + // For non-FP values, store on the stack only + // if we've exhausted GPR's. + if (r == R11) { + STW32(r, offset-4, SP); + } + } + + if (r != F0) { + argRegs->addFree(r); + } + } + int at = 0; + #endif + + #ifdef AVMPLUS_ARM + int GPRIndex = R0; + int offset = -16; // Don't store into stack until R0-R3 exhausted + for(int i=1; i<=argc; i++) + { + OP* argVal = call->args[i]; + bool isDouble = (argVal->isDouble()? true : false); + RegInfo *argRegs; + + Register r; + if (isDouble) + { + r = registerAllocSpecific(fpregs, F0); + GPRIndex += 2; + offset += 8; + argRegs = &fpregs; + livefp &= ~rmask(r); + } + else + { + // Note: IP is used as the temp for a stack-based argument + r = registerAllocSpecific(gpregs, (GPRIndex > R3) ? R10 : (Register)GPRIndex); + GPRIndex++; + offset += 4; + argRegs = &gpregs; + livegp &= ~rmask(r); + } + + if (argVal->reg == Unknown) + { + argVal->reg = r; + rematerialize(argVal); + argVal->reg = Unknown; + } + else + { + // wrong spot + moveR2R(argVal, argVal->reg, r); + } + + if (isDouble) { + // Store F0's lower half into stack or register + if (GPRIndex-2 > R3) + { + STR(R4, offset-8, SP); + } + else + { + MOV((Register)(GPRIndex-2), R4); + } + + // Store F0's upper half into stack or register + if (GPRIndex-1 > R3) + { + STR(R5, offset-4, SP); + } + else + { + MOV((Register)(GPRIndex-1), R5); + } + } else { + // For non-FP values, store on the stack only + // if we've exhausted GPR's. + if (r == R10) { + STR(r, offset-4, SP); + } + } + + argRegs->addFree(r); + } + int at = 0; + #endif + + #ifdef AVMPLUS_IA32 + + #ifdef _DEBUG + for (uint32 k=0; k < activation.temps.size(); k++) + { + OP* ins = activation.temps[k]; + if (stackPos(ins) > 0 || stackPos(ins)==0 && ins->spillSize()>0) + { + #ifdef AVMPLUS_VERBOSE + displayStackTable(); + #endif + AvmAssert(false); + } + } + #endif + + // anything that needs spilling has been spilled. now we can just + // push things onto the stack in reverse order, and stuff the last + // arg into ECX if it's a method call. + + int adj = 0; + int stop = (call->code & ~MIR_float & ~MIR_oper) == MIR_cm ? 2 : 1; + for(int i=argc; i >= stop; i--) + { + OP* p = call->args[i]; + Register r = p->reg; + + #ifdef AVMPLUS_VERBOSE + if (verbose()) + core->console << " arg @" << InsNbr(p) << "\n"; + #endif + + if (p->code == MIR_imm) + { + PUSH (p->imm); + adj += 4; + } + else if (r != Unknown) + { + if (p->isDouble()) + { + if (core->sse2) + { + MOVSD (-8, ESP, r); + SUB (ESP, 8); + adj += 8; + } + else + { + AvmAssert(r == FST0); + FSTQ (-8, ESP); + SUB (ESP,8); + adj += 8; + } + } + else + { + // push gp reg + PUSH (r); + adj += 4; + } + } + else + { + AvmAssert(p->pos != InvalidPos); + int disp = stackPos(p); + if (framep == ESP) disp += adj; + if (p->isDouble()) + { + // push double from stack frame + PUSH(disp+4, framep); + if (disp == ESP) disp += 4; + PUSH(disp, framep); + adj += 8; + } + else + { + // push 32bits from memory to stack + PUSH(disp, framep); + adj += 4; + } + } + } + + if (stop == 2) + { + // put last arg in ECX + AvmAssert(argc >= 1); + OP* p = call->args[1]; + AvmAssert(!p->isDouble()); + +#ifdef AVMPLUS_VERBOSE + if (verbose()) + { + core->console << " arg @" << InsNbr(p) << "\n"; + } +#endif + + OP* ecx = gpregs.active[ECX]; + if (ecx != p) + { + if (ecx) + { + // will have been spilled already if needed. + gpregs.retire(ecx); + livegp &= ~rmask(ECX); + } + + // now ECX is free + + if (p->reg == Unknown) + { + // need to load into ECX + if (p->code == MIR_imm) + MOV (ECX, p->imm); + else { + int disp = stackPos(p); + if (framep == ESP) disp += adj; + MOV(ECX, disp, framep); + } + } + else + { + // need to move from another register to ECX + moveR2R(p, p->reg, ECX); + } + } + } + + int at = -adj; + + #endif + + // remove caller saved registers, since we have already spilled + // and emited them as args. + if (livegp) + gpregs.flushCallerActives(livegp); + if (livefp) + fpregs.flushCallerActives(livefp); + + // note our final stack position + return at; + } + + // converts an instructions 'pos' field to a stack pointer relative displacement + int CodegenMIR::stackPos(OP* ins) + { + #ifdef AVMPLUS_PPC + return ins->pos + kLinkageAreaSize + calleeAreaSize(); + #endif + + #ifdef AVMPLUS_ARM + return ins->pos + calleeAreaSize(); + #endif + + #ifdef AVMPLUS_IA32 + return -ins->pos - ins->spillSize(); + #endif + } + + /** + * Find a location on the stack in which the result + * of the given instruction can be safely put. + */ + void CodegenMIR::reserveStackSpace(OP* forIns) + { + // search the stack for a spot which is + // free and is large enough + int at = InvalidPos; + int bytes = forIns->spillSize(); + int n=activation.temps.size(); + + if (n == 0) + { + #ifdef AVMPLUS_IA32 + + #ifdef _MAC + if (patch_esp_padding) + { + SUB(ESP,0); + patch_esp_padding = mip-1; + } + #endif /* _MAC */ + #endif /* AVMPLUS_IA32 */ + } + else + { + for(int i=0; i < n; i++) + { + OP* ins = activation.temps.get(i); + + // if space is vacant see if its a good match + if (ins->lastUse < ip && bytes == ins->spillSize()) + { + at = ins->pos; + // can't do this b/c the value may be extracted later like for npe code + //ins->pos = InvalidPos; // record that we stole the stack slot + activation.temps.set(i, forIns); // replacement entry + break; + } + } + } + + // if no hits then 'alloc' a new spot making sure 8B quantities are correctly addressed + if (at == InvalidPos) + { + // record stack position before growth + at = activation.size; + + // new entry grows the table / stack + activation.size += bytes; + activation.temps.add(forIns); + + // ensure our watermark is updated + int lastPos = at + bytes; + if ( lastPos > activation.highwatermark) + activation.highwatermark = lastPos; + } + + // update its location on the stack + AvmAssert(at >= 0); + forIns->pos = at; + AvmAssert(at == forIns->pos); // check for sign extension bugs + + #ifdef AVMPLUS_VERBOSE + if (verbose()) + { + core->console << " alloca " << bytes << " at " << at + << " for @" << (int)(forIns-ipStart) + << " activation.size " << activation.size << "\n"; + displayStackTable(); + } + #endif //DEBUGGER + } + + /** + * This code ensures any live temp at target are copied to a spill + * location before an upcoming block beginning or block end. The register + * is still allocated and available for use after the call. + */ + void CodegenMIR::spillTmps(OP* target) + { + if (target < ip) + { + // code already emitted for target, no point to spill + return; + } + + for (int i=0; i < MAX_REGISTERS; i++) + { + OP* ins; + if ((ins = gpregs.active[i]) != 0 && ins->lastUse > target) { + #ifdef AVMPLUS_VERBOSE + if (verbose() && ins->isDirty()) + core->console << "SAVE temp @" << InsNbr(ins) << "\n"; + #endif + spill(ins); + } + } + for (int i=0; i < MAX_REGISTERS; i++) + { + OP* ins; + if ((ins = fpregs.active[i]) != 0 && ins->lastUse > target) { + #ifdef AVMPLUS_VERBOSE + if (verbose() && ins->isDirty()) + core->console << "SAVE temp @" << InsNbr(ins) << "\n"; + #endif + spill(ins); + } + } + } + + void CodegenMIR::emitMD() + { + #ifdef AVMPLUS_VERBOSE + if (verbose()) + { + core->console << "generate " << info << "\n"; + } + #endif + + #ifdef AVMPLUS_PROFILE + // time MIR -> MD compilation + mdStartTime = GC::GetPerformanceCounter(); + #endif /* AVMPLUS_PROFILE */ + + /* + * Use access exceptions to manage our buffer growth. We + * reserve a large region of memory and write to it freely + * without concern and when we hit a page that hasn't been + * commited we fault, our handler commits the page and we + * continue on. + * Rather slick, no? Well, its just a slither of + * brilliance from mastermind garyg's noggin. + */ +#ifdef FEATURE_BUFFER_GUARD + // put a guard against buffer growth + GrowthGuard guard(pool->codeBuffer); +#endif /* FEATURE_BUFFER_GUARD */ + + generatePrologue(); + generate(); + generateEpilogue(); + + // get rid of pages for any part of the buffer that was not used. + pool->codeBuffer->decommitUnused(); + +#ifdef DEBUGGER + info->codeSize = (mip - mipStart) * sizeof(MDInstruction); +#endif + } + +#ifndef FEATURE_BUFFER_GUARD + bool CodegenMIR::ensureMDBufferCapacity(PoolObject* pool, size_t s) + { + byte* until = (byte*)mip + s; + byte* uncommitted = pool->codeBuffer->uncommitted(); + while (until >= uncommitted) + { + // committed last page and still want more! + if (uncommitted == pool->codeBuffer->end()) + { + //@todo detach the buffer so that we can do another run + overflow = true; + return false; + } + uncommitted = pool->codeBuffer->grow(); + } + return true; + } +#else + bool CodegenMIR::ensureMDBufferCapacity(PoolObject* /*pool*/, size_t /*s*/) { return true; } +#endif /* FEATURE_BUFFER_GUARD */ + + byte* CodegenMIR::getMDBuffer(PoolObject* pool) + { + if (pool->codeBuffer->size() == 0) + { + // compute amount of space we should reserve. + int size = estimateMDBufferReservation(pool); + pool->codeBuffer->reserve(size); + } +#ifdef AVMPLUS_JIT_READONLY + else + { + // make the first page read/write but not executable. + // do not clobber a guard page, if present. + if (pool->codeBuffer->getPos() != pool->codeBuffer->uncommitted()) + { + MMgc::GCHeap* heap = core->GetGC()->GetGCHeap(); + heap->SetExecuteBit(pool->codeBuffer->getPos(), 1, false); + } + } +#endif /* AVMPLUS_JIT_READONLY */ + + return pool->codeBuffer->getPos(); + } + + /** + * compute an estimate for MD reservation + */ + /*static*/ size_t CodegenMIR::estimateMDBufferReservation(PoolObject* pool) + { + // compute the size of the buffer based on # methods and expansion. + + // Having a large expansion factor here doesn't negatively impact us + // as we will be reserving virtual address space based on this + // number but not commiting the pages until we need them. + // So any unused virutal address space will be returned to the OS + // for later use. + // + // What is important is that we place a large enough estimate + // in here that we NEVER overflow the buffer. Overflowing + // means we redo the generation which is a massive performance hit. + const int expansionFactor = 40; // abc->md expansion + + int size = 0; + for(uint32 i=0, n=pool->methodCount; i < n; i++) + { + AbstractFunction* fnc = pool->getMethodInfo(i); + if (fnc->hasMethodBody()) + { + MethodInfo* mi = (MethodInfo*)fnc; + const byte *pos = mi->body_pos; + + if (pos) + { + AvmCore::readU30(pos); // max_stack + AvmCore::readU30(pos); // local_count + AvmCore::readU30(pos); // init_scope_depth + AvmCore::readU30(pos); // max_scope_depth + + int bytecodeSize = AvmCore::readU30(pos); + + if(!pool->isCodePointer(pos)) + { + // sanity check + unsigned int imm30 = 0, imm30b = 0; + int imm24 = 0, imm8 = 0; + const byte *end = pos + bytecodeSize; + while(pos < end) + { + if (*pos == OP_abs_jump) + { + pos++; // skip the 0xEE OP_abs_jump opcode + AvmCore::readU30(pos); // read the pc value (see abs_jump() in abcgen.h) + // real code size + size += expansionFactor * AvmCore::readU30(pos); + break; + } + AvmCore::readOperands(pos, imm30, imm24, imm30b, imm8); + } + } + + size += expansionFactor * bytecodeSize ; + size += md_prologue_size + md_epilogue_size; + //size += caseCount*sizeof(int); @todo we don't have access to case counts!!! + } + } + else + { + // reserve size for native thunk + size += md_native_thunk_size; + } + } + return size; + } + +#if defined(_MAC) && !TARGET_RT_MAC_MACHO + static uint32 get_rtoc() + { + asm { mr r3, r2; } + } +#endif + + void CodegenMIR::bindMethod(AbstractFunction* f) + { + #ifdef AVMPLUS_ARM + flushDataCache(&code[0], (int)mip - (int)&code[0]); + #endif + + // save code pointers on MethodInfo + ReadOnlyScriptBufferImpl* buff = new (core->GetGC()) ReadOnlyScriptBufferImpl(code, (int)mip - (int)&code[0]); + ScriptBuffer sc(buff); + +#if defined(_MAC) && !TARGET_RT_MAC_MACHO + // Write the code pointer for the ABI's benefit + mip = (MDInstruction*) ((size_t)mip+7 & ~7); // align on 8 + *mip++ = (uint32)mipStart; + *mip++ = get_rtoc(); +#endif + +#if defined(_MAC) && !TARGET_RT_MAC_MACHO + f->impl32 = (int (*)(MethodEnv*, int, va_list)) (mip-2); +#else + f->impl32 = (int (*)(MethodEnv*, int, va_list)) mipStart; +#endif + // lock in the next available location in the buffer (16B aligned) + PoolObject* pool = f->pool; + byte* nextMethodStart = (byte*) BIT_ROUND_UP((size_t)mip, 16); + pool->codeBuffer->setPos( nextMethodStart ); + +#ifdef AVMPLUS_JIT_READONLY + makeCodeExecutable(); +#endif /* AVMPLUS_JIT_READONLY */ + } + +#ifdef AVMPLUS_JIT_READONLY + void CodegenMIR::makeCodeExecutable() + { + #ifdef AVMPLUS_PPC + // Tell the OS that this buffer contains executable code. + // This is required since machines like the G4 have dual + // cache designs. + MakeDataExecutable(mipStart, (int)mip - (int)mipStart); + #endif /* AVMPLUS_PPC */ + + // make the code executable + MMgc::GCHeap* heap = core->GetGC()->GetGCHeap(); + heap->SetExecuteBit(mipStart, (int)mip - (int)mipStart, true); + } +#endif /* AVMPLUS_JIT_READONLY */ + + // + // The md versions of patching place the relative offset of the next into the patch location + // as opposed to placing the address itself. This is done mainly to conserve bits since we + // can only use the lower 26 bits of the PPC instruction for patch information. + // (Same applies to ARM, but on ARM 28 bits are available.) + // +#ifdef AVMPLUS_PPC + #define MD_PATCH_LOCATION_SET(w,o) AvmAssertMsg(BIT_VALUE_FITS(o,26), "Branch offset exceeds 26 bits; illegal for PPC"); *w = BIT_INSERT(*w,25,0,o) + #define MD_PATCH_LOCATION_GET(w) BIT_EXTRACT(*w,25,0) +#elif defined AVMPLUS_ARM + #define MD_PATCH_LOCATION_SET(w,o) AvmAssertMsg(BIT_VALUE_FITS(o,28), "Branch offset exceeds 28 bits; illegal for PPC"); *w = BIT_INSERT(*w,27,0,o) + #define MD_PATCH_LOCATION_GET(w) BIT_EXTRACT(*w,27,0) +#else + #define MD_PATCH_LOCATION_SET(w,o) *w = o; + #define MD_PATCH_LOCATION_GET(w) *w; +#endif + + + void CodegenMIR::generate() + { + SAMPLE_FRAME("[generate]", core); + + // stuff used to track which page in the buffer we are on. + const static int maxBytesPerMIRIns = 16*8; // maximum # of bytes needed by the buffer per MIR instruction (16 machine instructions x 8B) + +#ifndef FEATURE_BUFFER_GUARD + if (overflow) + return; + + int threshold = (int)pool->codeBuffer->uncommitted() - maxBytesPerMIRIns; +#else + (void)maxBytesPerMIRIns; +#endif /* FEATURE_BUFFER_GUARD */ + + #ifdef _DEBUG + // used to track the maximum number of bytes generated per MIR instruction + MDInstruction* lastMip = mip; + #endif /*_DEBUG */ + + // linked list of instructions that need to be spilled prior to a branch. + AvmAssert(ip == ipStart); + while(ip < ipEnd) + { + SAMPLE_CHECK(); + MirOpcode mircode = ip->code; + + #ifdef AVMPLUS_VERBOSE + if (verbose() && mircode != MIR_bb) + { + core->console << "\n@" << InsNbr(ip) << " "; + formatOpcode(core->console, ipStart, ip, pool, core->codegenMethodNames); + core->console << "\n"; + } + #endif // AVMPLUS_VERBOSE + + #ifdef _DEBUG + // if this assert fires increase 'maxBytesPerMIRIns' to at least (mip - lastMip) + if ( (mip - lastMip) > maxBytesPerMIRIns) + AvmAssert(false); + lastMip = mip; + #endif /* _DEBUG */ + +#ifndef FEATURE_BUFFER_GUARD + // now check to see if we are about to overflow our buffer, if so + // bring in the next page and update the threshold + if ( (int)mip > threshold) + { + pool->codeBuffer->grow(); + threshold = (int)pool->codeBuffer->uncommitted() - maxBytesPerMIRIns; + + // check for buffer overrun + if (overflow) + { + // so we've pretty much hit the end of our reseved + // virtual memory region. This means that our estimate + // for code space is off and we need to retune. + // PLEASE DO SO NOW!!! THIS SHOULD NOT HAPPEN. + return; + } + } +#endif /* FEATURE_BUFFER_GUARD */ + + switch(mircode) + { + case MIR_bb: + { + // spill tmps, if any + spillTmps(ip); + + // now retire any active registers since MIR-bb is + // typically where control flows merge + + for(int i=0; iconsole << "\n@" << InsNbr(ip) << " "; + formatOpcode(core->console, ipStart, ip, pool, core->codegenMethodNames); + core->console << "\n"; + } + #endif // AVMPLUS_VERBOSE + + mdLabel(ip, mip); + break; + } + case MIR_alloc: + { + // note the alloc, actual act is delayed; see above + reserveStackSpace(ip); + break; + } + + case MIR_def: + case MIR_fdef: + { + OP* join = ip->join; + AvmAssert(join == 0 || join < ip); + AvmAssert(join == 0 || ip->lastUse == 0); + + OP* value = ip->oprnd1; + RegInfo& regs = mircode==MIR_fdef ? fpregs : gpregs; + + // walk back to earliest def + while (join && join->join) + join = join->join; + + // now, join is the original definition of + // the variable, and we want to overwrite it with + // the new variable's value. + + if (join) + { + // ip is not the first def, so use join + if (join->lastUse >= ip) + { + // save expr in joined def's storage, not ours. + Register r = Unknown; + InsRegisterPrepA(ip, regs, value, r); + if (join->reg != Unknown) { + moveR2R(ip, r, join->reg); + } + if (join->pos != InvalidPos) { + copyToStack(join, r); + } + } + else + { + regs.expire(value,ip); + } + } + else + { + // this is the first def. just make a copy of the expr. + if (ip->lastUse > ip) + { + Register r = Unknown; + InsRegisterPrepA(ip, regs, value, r); + if (value->lastUse == ip) { + registerAllocSpecific(regs, r); + } else { + Register r2 = registerAllocAny(regs, ip); + if (r2 != r) + moveR2R(ip, r, r2); + r = r2; + } + setResultReg(regs, ip, r); + spill(ip); + } + else + { + regs.expire(value, ip); + } + } + break; + } + + case MIR_use: + case MIR_fuse: + { + OP* def = ip->oprnd1; + + RegInfo& regs = mircode==MIR_fuse ? fpregs : gpregs; + + if (ip->lastUse) + { + OP* d = def; + while (d->join) + d = d->join; + + Register r = Unknown; + InsRegisterPrepA(ip, regs, d, r); + registerAllocSpecific(regs, r); + setResultReg(regs, ip, r); + } + + regs.expire(def, ip); + while ( (def = def->join ) != 0 ) + regs.expire(def, ip); + + break; + } + + case MIR_arg: + { + if (!ip->lastUse) + { + ip->reg = Unknown; // if arg was preassigned a reg, cancel that. + break; + } + + if (ip->reg != Unknown) + { + // allocate the register we preassigned + registerAllocSpecific(gpregs, ip->reg); + // toast pos so that spill will push it to the stack in some fixed location + setResultReg(gpregs, ip, ip->reg); + } + + break; + } + case MIR_imm: + { + ip->reg = Unknown; + ip->pos = InvalidPos; + // if anyone uses imm in reg, it will prep it on demand + break; + } + case MIR_lea: + { + if (!ip->lastUse) + { + break; + } + + OP* base = ip->base; + int disp = ip->disp; + + if (base->code == MIR_alloc) + { + Register r = InsPrepResult(gpregs, ip); + + // pos field of alloca contains stack pos + disp += stackPos(base); + #ifdef AVMPLUS_PPC + ADDI32(r, framep, disp); + #endif + + #ifdef AVMPLUS_ARM + if (!(disp&0xFFFF0000)) + { + ADD_imm16(r, SP, disp); + } + else + { + MOV_imm32(IP, disp); + ADD(r, IP, SP); + } + #endif + + #ifdef AVMPLUS_IA32 + LEA(r, disp, framep); + #endif + } + else + { + // adding an offset to a real pointer. + Register rBase = Unknown; + InsRegisterPrepA(ip, gpregs, base, rBase); + AvmAssert(rBase != Unknown); + Register r = InsPrepResult(gpregs, ip, rmask(rBase)); + + #ifdef AVMPLUS_PPC + ADDI32(r, rBase, disp); + #endif + + #ifdef AVMPLUS_ARM + if (!(disp&0xFFFF0000)) + { + ADD_imm16(r, rBase, disp); + } + else + { + MOV_imm32(IP, disp); + ADD(r, IP, rBase); + } + #endif + + #ifdef AVMPLUS_IA32 + LEA(r, disp, rBase); + #endif + } + break; + } + + case MIR_ld: + case MIR_ldop: + case MIR_fld: + case MIR_fldop: + { + OP* addr = ip->oprnd1; + + // don't generate it if its not used + if (!ip->lastUse) + { + if (addr) + gpregs.expire(addr, ip); + break; + } + + // address + offset + int disp = ip->disp; + + RegInfo& regs = ip->isDouble() ? fpregs : gpregs; + + // load up our requirements and send off to + // the smart-ass allocator. If its a stack + // based access then we can ignore the addr operand. + Register r; + Register rSrc = Unknown; + + if (!addr) + { + // disp = absolute immediate address + r = InsPrepResult(regs, ip); + // rSrc = Unknown + } + else if (addr->code == MIR_alloc) + { + r = InsPrepResult(regs, ip); + + // stack based access get position from alloca instruction, which obtains + // its offset from being in the stackEntry list. The instruction may also + // contain an optional offset which we need to add. + + disp += stackPos(addr); + + rSrc = framep; + } + else + { + InsRegisterPrepA(ip, gpregs, addr, rSrc); + r = InsPrepResult(regs, ip, rmask(rSrc)); + } + + #ifdef AVMPLUS_PPC + if (ip->isDouble()) { + LFD32(r, disp, rSrc); + } else { + LWZ32(r, disp, rSrc); + } + #endif + + #ifdef AVMPLUS_ARM + if (rSrc == Unknown) + { + rSrc = IP; + MOV_imm32(IP, disp); + disp = 0; + } + + if (ip->isDouble()) + { + // There is one FP pseudo-register on ARM + LDR(R4, disp, rSrc); + LDR(R5, disp+4, rSrc); + } + else + { + LDR(r, disp, rSrc); + } + #endif + + #ifdef AVMPLUS_IA32 + if (ip->isDouble()) + { + if (core->sse2) + { + MOVSD(r, disp, rSrc); + } + else + { + AvmAssert(r == FST0); + FFREE(FST7); + FLDQ(disp, rSrc); + } + } + else + { + MOV(r, disp, rSrc); + } + #endif + break; + } + + // get address of def + case MIR_usea: + { + // address + offset + OP* def = ip->oprnd1; + + AvmAssert((def->code & ~MIR_float) == MIR_def); + while (def->join) + def = def->join; + + // make sure def is on stack + if (def->reg != Unknown) { + #ifdef AVMPLUS_VERBOSE + if (verbose() && def->isDirty()) + core->console << "SAVE def @" << InsNbr(def) << "\n"; + #endif + spill(def); + } + RegInfo &defregs = def->isDouble() ? fpregs : gpregs; + defregs.expire(def, ip); + + Register r = InsPrepResult(gpregs, ip); + + #ifdef AVMPLUS_PPC + ADDI32(r, framep, stackPos(def)); + #endif + + #ifdef AVMPLUS_ARM + int disp = stackPos(def); + if (!(disp&0xFFFF0000)) + { + ADD_imm16(r, framep, disp); + } + else + { + MOV_imm32(IP, disp); + ADD(r, IP, framep); + } + #endif + + #ifdef AVMPLUS_IA32 + LEA (r, stackPos(def), framep); + #endif + break; + } + + case MIR_st: + { + // address + offset + OP* value = ip->value; // value + OP* addr = ip->base; + int disp = ip->disp; + + // load up our requirements and send off to + // the smart-ass allocator. If its a stack + // based access we can ignore the addr operand. + Register rValue = Unknown; + Register rDst = Unknown; + + RegInfo& regsValue = value->isDouble() ? fpregs : gpregs; + + #ifdef AVMPLUS_PPC + + if (!addr) + { + // disp = absolute immediate address + InsRegisterPrepA(ip, regsValue, value, rValue); + // rDst = Unknown + } + else if (addr->code == MIR_alloc) + { + InsRegisterPrepA(ip, regsValue, value, rValue); + rDst = SP; + disp += stackPos(addr); + } + else + { + InsRegisterPrepAB(ip, regsValue, value, rValue, gpregs, addr, rDst); + } + + if (value->isDouble()) + { + STFD32(rValue, disp, rDst); + } + else + { + STW32(rValue, disp, rDst); + } + + #endif + + #ifdef AVMPLUS_ARM + if (!addr) + { + // disp = absolute immediate address + InsRegisterPrepA(ip, regsValue, value, rValue); + + rDst = IP; + MOV_imm32(IP, disp); + disp = 0; + } + else if (addr->code == MIR_alloc) + { + InsRegisterPrepA(ip, regsValue, value, rValue); + rDst = SP; + disp += stackPos(addr); + } + else + { + InsRegisterPrepAB(ip, regsValue, value, rValue, gpregs, addr, rDst); + } + + if (value->isDouble()) + { + AvmAssert(rValue == F0); + STR(R4, disp, rDst); + STR(R5, disp+4, rDst); + } + else + { + STR(rValue, disp, rDst); + } + #endif + + #ifdef AVMPLUS_IA32 + + if (!addr) + { + // disp = absolute immediate address + InsRegisterPrepA(ip, regsValue, value, rValue); + // rDst = Unknown + } + else if (addr->code == MIR_alloc) + { + if (!canImmFold(ip, value)) //value->code != MIR_imm) + InsRegisterPrepA(ip, regsValue, value, rValue); + + rDst = framep; + disp += stackPos(addr); + } + else + { + if (!canImmFold(ip,value)) //value->code != MIR_imm) + InsRegisterPrepAB(ip, regsValue, value, rValue, gpregs, addr, rDst); + else + InsRegisterPrepA(ip, gpregs, addr, rDst); + } + + if (value->isDouble()) + { + if (core->sse2) { + MOVSD(disp, rDst, rValue); + } else { + AvmAssert(rValue == FST0); + FSTQ(disp, rDst); + } + } + else + { + if (canImmFold(ip, value)) //value->code == MIR_imm) + { + // can fold immediate value + if (value->reg != Unknown) { + MOV(disp, rDst, value->reg); // imm value in reg + } else { + MOV(disp, rDst, value->imm); // imm value + } + } + else + { + // computed value in reg + MOV(disp, rDst, rValue); + } + } + + #endif // AVMPLUS_IA32 + break; + } + case MIR_lsh: + case MIR_rsh: + case MIR_ush: + { + OP* lhs = ip->oprnd1; // lhs + OP* rhs = ip->oprnd2; // rhs + + if (!ip->lastUse) + { + gpregs.expire(lhs, ip); + gpregs.expire(rhs, ip); + break; + } + + // rhs could be imm or reg + + #ifdef AVMPLUS_PPC + + if (canImmFold(ip, rhs)) + { + Register rLhs = Unknown; + InsRegisterPrepA(ip, gpregs, lhs, rLhs); + AvmAssert(rLhs != Unknown); + Register r = InsPrepResult(gpregs, ip); + + int shift = rhs->imm&0x1F; + if (shift) + { + if (mircode == MIR_lsh) + SLWI(r, rLhs, rhs->imm&0x1F); + else if (mircode == MIR_rsh) + SRAWI(r, rLhs, rhs->imm&0x1F); + else // MIR_ush + SRWI(r, rLhs, rhs->imm&0x1F); + } + else + { + MR(r, rLhs); + } + } + else + { + Register rLhs = Unknown; + Register rRhs = Unknown; + InsRegisterPrepAB(ip, gpregs, lhs, rLhs, gpregs, rhs, rRhs); + Register r = registerAllocAny(gpregs, ip); + setResultReg(gpregs, ip, r); + + ANDI_dot(rRhs, rRhs, 0x1F); + if (mircode==MIR_lsh) + SLW(r, rLhs, rRhs); + else if (mircode==MIR_rsh) + SRAW(r, rLhs, rRhs); + else // MIR_ush + SRW(r, rLhs, rRhs); + } + + #endif + + #ifdef AVMPLUS_ARM + Register r = Unknown; + if (canImmFold(ip, rhs)) + { + Register rLhs = Unknown; + InsRegisterPrepA(ip, gpregs, lhs, rLhs); + AvmAssert(rLhs != Unknown); + r = registerAllocAny(gpregs, ip); + setResultReg(gpregs, ip, r); + + if (mircode==MIR_lsh) + LSL_i(r, rLhs, rhs->imm&0x1F); + else if (mircode==MIR_rsh) + LSR_i(r, rLhs, rhs->imm&0x1F); + else // MIR_ush + ASR_i(r, rLhs, rhs->imm&0x1F); + } + else + { + Register rLhs = Unknown; + Register rRhs = Unknown; + InsRegisterPrepAB(ip, gpregs, lhs, rLhs, gpregs, rhs, rRhs); + r = registerAllocAny(gpregs, ip); + setResultReg(gpregs, ip, r); + + AND_imm8(rRhs, rRhs, 0x1F); + if (mircode==MIR_lsh) + LSL(r, rLhs, rRhs); + else if (mircode==MIR_rsh) + ASR(r, rLhs, rRhs); + else // MIR_ush + LSR(r, rLhs, rRhs); + } + #endif + + #ifdef AVMPLUS_IA32 + + Register r = Unknown; + if (canImmFold(ip, rhs)) + { + InsRegisterPrepA(ip, gpregs, lhs, r); + AvmAssert(r != Unknown); + registerAllocSpecific(gpregs, r); + setResultReg(gpregs, ip, r); + + if (mircode==MIR_lsh) + SHL(r, rhs->imm); + else if (mircode==MIR_rsh) + SAR(r, rhs->imm); + else // MIR_ush + SHR(r, rhs->imm); + } + else + { + Register rRhs = ECX; + InsRegisterPrepAB(ip, gpregs, lhs, r, gpregs, rhs, rRhs); + AvmAssert(r != Unknown); + registerAllocSpecific(gpregs, r); + setResultReg(gpregs, ip, r); + + AvmAssert(rRhs == ECX); + if (mircode==MIR_lsh) + SHL(r, rRhs); + else if (mircode==MIR_rsh) + SAR(r, rRhs); + else // MIR_ush + SHR(r, rRhs); + } + #endif + break; + } + + case MIR_fneg: + { + OP* lhs = ip->oprnd1; // lhs + + if (!ip->lastUse) + { + fpregs.expire(lhs, ip); + break; + } + + #ifdef AVMPLUS_PPC + + Register rLhs = Unknown; + InsRegisterPrepA(ip, fpregs, lhs, rLhs); + Register r = registerAllocAny(fpregs, ip); + + FNEG(r,rLhs); + + #endif + + #ifdef AVMPLUS_ARM + Register r = Unknown; + InsRegisterPrepA(ip, fpregs, lhs, r); + AvmAssert(r == F0); + registerAllocSpecific(fpregs, r); + MOV_imm32(IP, 0x80000000); + EOR(R4, R4, IP); + #endif + + #ifdef AVMPLUS_IA32 + + Register r = Unknown; + InsRegisterPrepA(ip, fpregs, lhs, r); + AvmAssert(r != Unknown); + registerAllocSpecific(fpregs, r); + + if (core->sse2) + { + #ifdef AVMPLUS_WIN32 + static __declspec(align(16)) uint32 negateMask[] = {0,0x80000000,0,0}; + #else + static uint32 __attribute__ ((aligned (16))) negateMask[] = {0,0x80000000,0,0}; + #endif + XORPD(r,(int)negateMask); + } + else + { + AvmAssert(r == FST0); + AvmAssert(x87Dirty); + FCHS(); + } + #endif + + setResultReg(fpregs, ip, r); + + break; + } + + case MIR_neg: + { + OP* lhs = ip->oprnd1; // lhs + + if (!ip->lastUse) + { + gpregs.expire(lhs, ip); + break; + } + + #ifdef AVMPLUS_PPC + + Register rLhs = Unknown; + InsRegisterPrepA(ip, gpregs, lhs, rLhs); + Register r = registerAllocAny(gpregs, ip); + + NEG(r,rLhs); + + #endif + + #ifdef AVMPLUS_ARM + Register rLhs = Unknown; + InsRegisterPrepA(ip, gpregs, lhs, rLhs); + //InsRegisterPrepRes(gpregs, ip, r, rLhs, NO_RESTRICTIONS); + Register r = registerAllocAny(gpregs, ip); + RSB_imm8(r,rLhs,0); + #endif + + #ifdef AVMPLUS_IA32 + + Register r = Unknown; + InsRegisterPrepA(ip, gpregs, lhs, r); + registerAllocSpecific(gpregs, r); + + NEG(r); + + #endif + + setResultReg(gpregs, ip, r); + break; + } + + case MIR_and: + case MIR_or: + case MIR_xor: + case MIR_add: + case MIR_sub: + case MIR_imul: + { + OP* lhs = ip->oprnd1; // lhs + OP* rhs = ip->oprnd2; // rhs + + if (!ip->lastUse) + { + gpregs.expire(lhs, ip); + gpregs.expire(rhs, ip); + break; + } + + // rhs could be imm or reg + + #ifdef AVMPLUS_PPC + + Register rD = Unknown; + if (canImmFold(ip, rhs)) + { + Register rLhs = Unknown; + InsRegisterPrepA(ip, gpregs, lhs, rLhs); + rD = registerAllocAny(gpregs, ip); + + AvmAssert(rLhs != Unknown); + + if (mircode == MIR_and) + ANDI_dot(rD, rLhs, rhs->imm); + else if (mircode == MIR_or) { + Register rSrc = rLhs; + if (!rhs->imm || rhs->imm & 0xFFFF) { + ORI(rD, rSrc, rhs->imm&0xFFFF); + rSrc = rD; + } + if (rhs->imm & 0xFFFF0000) { + ORIS(rD, rSrc, (rhs->imm>>16)&0xFFFF); + } + } else if (mircode == MIR_xor) { + Register rSrc = rLhs; + if (!rhs->imm || rhs->imm & 0xFFFF) { + XORI(rD, rSrc, rhs->imm&0xFFFF); + rSrc = rD; + } + if (rhs->imm & 0xFFFF0000) { + XORIS(rD, rSrc, (rhs->imm>>16)&0xFFFF); + } + } else if (mircode == MIR_add) + ADDI(rD, rLhs, rhs->imm); + else if (mircode == MIR_sub) + ADDI(rD, rLhs, -rhs->imm); + } + else + { + Register rLhs = Unknown; + Register rRhs = Unknown; + InsRegisterPrepAB(ip, gpregs, lhs, rLhs, gpregs, rhs, rRhs); + rD = registerAllocAny(gpregs, ip); + + AvmAssert(rLhs != Unknown); + AvmAssert(rRhs != Unknown); + if (mircode == MIR_and) + AND(rD, rLhs, rRhs); + else if (mircode == MIR_or) + OR (rD, rLhs, rRhs); + else if (mircode == MIR_xor) + XOR(rD, rLhs, rRhs); + else if (mircode == MIR_add) + ADD(rD, rLhs, rRhs); + else if (mircode == MIR_sub) + SUB(rD, rLhs, rRhs); + else if (mircode == MIR_imul) + MULLW(rD, rLhs, rRhs); + } + + #endif + + #ifdef AVMPLUS_ARM + Register rD = Unknown; + if (canImmFold(ip, rhs)) + { + Register rLhs = Unknown; + InsRegisterPrepA(ip, gpregs, lhs, rLhs); + rD = registerAllocAny(gpregs, ip); + + AvmAssert(rLhs != Unknown); + + if (mircode == MIR_and) + AND_imm8(rD, rLhs, rhs->imm); + else if (mircode == MIR_or) + ORR_imm8(rD, rLhs, rhs->imm); + else if (mircode == MIR_xor) + EOR_imm8(rD, rLhs, rhs->imm); + else if (mircode == MIR_add) + ADD_imm16(rD, rLhs, rhs->imm); + else if (mircode == MIR_sub) + SUB_imm8(rD, rLhs, rhs->imm); + } + else + { + Register rLhs = Unknown; + Register rRhs = Unknown; + InsRegisterPrepAB(ip, gpregs, lhs, rLhs, gpregs, rhs, rRhs); + //InsRegisterPrepRes(gpregs, ip, r, rLhs, NO_RESTRICTIONS); + rD = registerAllocAny(gpregs, ip); + + AvmAssert(rLhs != Unknown); + AvmAssert(rRhs != Unknown); + if (mircode == MIR_and) + AND(rD, rLhs, rRhs); + else if (mircode == MIR_or) + ORR(rD, rLhs, rRhs); + else if (mircode == MIR_xor) + EOR(rD, rLhs, rRhs); + else if (mircode == MIR_add) + ADD(rD, rLhs, rRhs); + else if (mircode == MIR_sub) + SUB(rD, rLhs, rRhs); + else if (mircode == MIR_imul) + MUL(rD, rLhs, rRhs); + } + #endif + + #ifdef AVMPLUS_IA32 + + Register rA = Unknown; + Register rD; + if (canImmFold(ip, rhs)) + { + InsRegisterPrepA(ip, gpregs, lhs, rA); + if (gpregs.free & rmask(rA)) { + registerAllocSpecific(gpregs, rD=rA); + } else { + rD = registerAllocAny(gpregs, ip); + if (rD != rA) + moveR2R(ip, rA, rD); + } + + if (mircode == MIR_and) + { + AND(rD, rhs->imm); + } + else if (mircode == MIR_or) + { + OR (rD, rhs->imm); + } + else if (mircode == MIR_xor) + { + XOR(rD, rhs->imm); + } + else if (mircode == MIR_add) + { + ADD(rD, rhs->imm); + } + else if (mircode == MIR_sub) + { + SUB(rD, rhs->imm); + } + else if (mircode == MIR_imul) + { + IMUL(rD, rhs->imm); + } + } + else + { + Register rB = Unknown; + InsRegisterPrepAB(ip, gpregs, lhs, rA, gpregs, rhs, rB); + registerAllocSpecific(gpregs, rD=rA); + + AvmAssert(rA != Unknown); + AvmAssert(rB != Unknown); + if (mircode == MIR_and) + AND(rD, rB); + else if (mircode == MIR_or) + OR (rD, rB); + else if (mircode == MIR_xor) + XOR(rD, rB); + else if (mircode == MIR_add) + ADD(rD, rB); + else if (mircode == MIR_sub) + SUB(rD, rB); + else if (mircode == MIR_imul) + IMUL(rD, rB); + } + + #endif + + setResultReg(gpregs, ip, rD); + break; + } + + case MIR_eq: + case MIR_ne: + case MIR_lt: + case MIR_le: + { + OP* cond = ip->oprnd1; + AvmAssert(cond != NULL); + AvmAssert(cond->code == MIR_icmp || cond->code == MIR_ucmp || cond->code == MIR_fcmp); + (void)cond; + if (!ip->lastUse) + break; + + // WARNING: MIR_ne is not the same as !MIR_eq. if unordered, MIR_ne = false + + // rhs could be imm or reg + + #ifdef AVMPLUS_IA32 + registerAllocSpecific(gpregs, EAX); + if (cond->code != MIR_fcmp) + { + // previous icmp or ucmp set EFLAGS + if (mircode == MIR_eq) { + SETE(EAX); + } else if (mircode == MIR_ne) { + SETNE(EAX); + } else if (mircode == MIR_lt) { + if (cond->code == MIR_icmp) + SETL(EAX); + else + SETB(EAX); + } else { + if (cond->code == MIR_icmp) + SETLE(EAX); + else + SETBE(EAX); + } + } + else + { + if (core->sse2) + { + // previous MIR_fcmp set EFLAGS + // remember, UCOMISD args were reversed so we can test CF=0 + + if (mircode == MIR_lt) { + SETNBE(EAX); + } else if (mircode == MIR_le) { + SETNB(EAX); + } else if (mircode == MIR_ne) { + SETNE(EAX); + } else { // MIR_eq + LAHF(); + TEST_AH(0x44); + SETNP(EAX); + } + } + else + { + // previous MIR_fcmp set FPU status flags + FNSTSW_AX(); + if (mircode == MIR_ne) { + TEST_AH(0x44); + SETE(EAX); + } else { + if (mircode == MIR_lt) + TEST_AH(0x05); + else if (mircode == MIR_le) + TEST_AH(0x41); + else // MIR_eq + TEST_AH(0x44); + SETNP(EAX); + } + } + } + MOVZX_r8(EAX, EAX); // sign extend AL to EAX + setResultReg(gpregs, ip, EAX); + + #endif + + #ifdef AVMPLUS_ARM + Register r = registerAllocAny(gpregs, ip); + bool isUnsigned = (cond->code == MIR_ucmp); + AvmAssert(r != Unknown); + + MOV_imm8 (r, 0); + switch (mircode) { + case MIR_lt: + SET_CONDITION_CODE(isUnsigned ? CC : LT); + break; + case MIR_le: + SET_CONDITION_CODE(isUnsigned ? LS : LE); + break; + case MIR_eq: + SET_CONDITION_CODE(EQ); + break; + case MIR_ne: + SET_CONDITION_CODE(NE); + break; + } + MOV_imm8 (r, 1); + SET_CONDITION_CODE (AL); + + setResultReg(gpregs, ip, r); + #endif + + #ifdef AVMPLUS_PPC + + Register r = registerAllocAny(gpregs, ip); + // ppc has CMP/CMPL/FCMP for int/uint/double, CR bits are same for each + switch (mircode) { + case MIR_ne: + CROR(28,29,28); // true if <0 or >0, false if 0 or NaN + MFCR(r); + RLWINM(r,r,29,31,31); + break; + case MIR_eq: + MFCR(r); + RLWINM(r,r,31,31,31); + break; + case MIR_lt: + MFCR(r); + RLWINM(r,r,29,31,31); + break; + case MIR_le: + CROR(30,28,30); + MFCR(r); + RLWINM(r,r,31,31,31); + break; + default: + AvmAssert(false); + break; + } + setResultReg(gpregs,ip,r); + + #endif // ppc + break; + } + + case MIR_fadd: + case MIR_fsub: + case MIR_fmul: + case MIR_fdiv: + { + OP* lhs = ip->oprnd1; // lhs + OP* rhs = ip->oprnd2; // rhs + + if (!ip->lastUse) + { + fpregs.expire(lhs, ip); + fpregs.expire(rhs, ip); + break; + } + + // rhs could be imm or reg + #ifdef AVMPLUS_PPC + + Register rLhs= Unknown; + Register rRhs = Unknown; + + InsRegisterPrepAB(ip, fpregs, lhs, rLhs, fpregs, rhs, rRhs); + Register r = registerAllocAny(fpregs, ip); + + AvmAssert(rLhs != Unknown); + AvmAssert(rRhs != Unknown); + switch (mircode) { + case MIR_fadd: + FADD(r, rLhs, rRhs); + break; + case MIR_fsub: + FSUB(r, rLhs, rRhs); + break; + case MIR_fmul: + FMUL(r, rLhs, rRhs); + break; + case MIR_fdiv: + FDIV(r, rLhs, rRhs); + break; + default: + break; + } + setResultReg(fpregs,ip,r); + + #endif + + #ifdef AVMPLUS_ARM + // On ARM, these are helper functions and will never be generated + // directly. + AvmAssert(false); + #endif + + #ifdef AVMPLUS_IA32 + + Register r = Unknown; + + if (core->sse2) + { + if (rhs->reg == Unknown && rhs->pos != InvalidPos) + { + // rhs value is in memory, put lhs in reg and do R-M operation + InsRegisterPrepA(ip, fpregs, lhs, r); + registerAllocSpecific(fpregs, r); + + int disp = stackPos(rhs); + switch (mircode) { + case MIR_fadd: + ADDSD(r, disp, framep); + break; + case MIR_fsub: + SUBSD(r, disp, framep); + break; + case MIR_fmul: + MULSD(r, disp, framep); + break; + case MIR_fdiv: + DIVSD(r, disp, framep); + break; + } + } + else + { + // put lhs & rhs in regs, then do R-R operation + Register rRhs = Unknown; + InsRegisterPrepAB(ip, fpregs, lhs, r, fpregs, rhs, rRhs); + + //registerAllocSpecific(fpregs, r); + if (fpregs.free & rmask(r)) { + // L is free, use that + registerAllocSpecific(fpregs, r); + } else if (fpregs.free & ~rmask(rRhs)) { + // use any other free except R + Register rD = registerAllocFromSet(fpregs, fpregs.free & ~rmask(rRhs)); + if (rD != r) { + moveR2R(ip, r, rD); + r = rD; + } + } else { + // steal L for result + registerAllocSpecific(fpregs, r); + } + + AvmAssert(rRhs != Unknown); + switch (mircode) { + case MIR_fadd: + ADDSD(r, rRhs); + break; + case MIR_fsub: + SUBSD(r, rRhs); + break; + case MIR_fmul: + MULSD(r, rRhs); + break; + case MIR_fdiv: + DIVSD(r, rRhs); + break; + } + } + setResultReg(fpregs,ip,r); + } + else + { + // x87 + InsRegisterPrepA(ip, fpregs, lhs, r); + registerAllocSpecific(fpregs, r); + + AvmAssert(r == FST0); + AvmAssert(rhs->reg == Unknown); + if (rhs == lhs) + { + // x = x (op) x, x in st(0) + switch (mircode) { + case MIR_fadd: + FADDQ(r); // stack = [lhs+rhs] + break; + case MIR_fsub: + FSUBQ(r); // stack = [lhs-rhs] + break; + case MIR_fmul: + FMULQ(r); // stack = [lhs*rhs] + break; + case MIR_fdiv: + FDIVQ(r); // stack = [lhs/rhs] + break; + } + } + else + { + // rhs in memory + AvmAssert(rhs->pos != InvalidPos); + int rhs_disp = stackPos(rhs); // stack = [lhs] + switch (mircode) { + case MIR_fadd: + FADDQ(rhs_disp, framep); // stack = [lhs+rhs] + break; + case MIR_fsub: + FSUBQ(rhs_disp, framep); // stack = [lhs-rhs] + break; + case MIR_fmul: + FMULQ(rhs_disp, framep); // stack = [lhs*rhs] + break; + case MIR_fdiv: + FDIVQ(rhs_disp, framep); // stack = [lhs/rhs] + break; + } + } + setResultReg(fpregs,ip,r); + } + #endif + break; + } + + case MIR_icmp: + case MIR_ucmp: + { + // actual results are in condition codes, so make sure next mir op is + // a branch that uses them.. otherwise the condition codes are invalid + OP* lhs = ip->oprnd1; // lhs + OP* rhs = ip->oprnd2; // rhs + + if (!ip->lastUse) + { + gpregs.expire(lhs, ip); + gpregs.expire(rhs, ip); + break; + } + + #ifdef AVMPLUS_PPC + + if (canImmFold(ip, rhs)) + { + // 16-bit immediate values can use cmpi + // instead of cmp + Register rLhs = Unknown; + InsRegisterPrepA(ip, gpregs, lhs, rLhs); + AvmAssert(rLhs != Unknown); + + if (mircode == MIR_icmp) + CMPI(CR7, rLhs, rhs->imm); + else + CMPLI(CR7, rLhs, rhs->imm); + } + else + { + Register rLhs = Unknown; + Register rRhs = Unknown; + InsRegisterPrepAB(ip, gpregs, lhs, rLhs, gpregs, rhs, rRhs); + AvmAssert(rRhs != Unknown); + AvmAssert(rLhs != Unknown); + + if (mircode == MIR_icmp) + CMP(CR7, rLhs, rRhs); + else + CMPL(CR7, rLhs, rRhs); + } + + #endif + + #ifdef AVMPLUS_ARM + Register rLhs = Unknown; + Register rRhs = Unknown; + InsRegisterPrepAB(ip, gpregs, lhs, rLhs, gpregs, rhs, rRhs); + AvmAssert(rRhs != Unknown); + AvmAssert(rLhs != Unknown); + + CMP(rLhs, rRhs); + #endif + + #ifdef AVMPLUS_IA32 + + if (canImmFold(ip, rhs)) + { + Register rLhs = Unknown; + InsRegisterPrepA(ip, gpregs, lhs, rLhs); + AvmAssert(rLhs != Unknown); + if (rhs->imm == 0) + TEST(rLhs,rLhs); + else + CMP(rLhs, rhs->imm); + } + else + { + Register rLhs= Unknown; + Register rRhs = Unknown; + InsRegisterPrepAB(ip, gpregs, lhs, rLhs, gpregs, rhs, rRhs); + AvmAssert(rRhs != Unknown); + AvmAssert(rLhs != Unknown); + + CMP(rLhs, rRhs); + } + + #endif + + ip->reg = Unknown; + ip->pos = Unknown; + break; + } + + case MIR_fcmp: + { + // actual results are in condition codes, so make sure next mir op is + // a branch that uses them.. otherwise the condition codes are invalid + OP* lhs = ip->oprnd1; // lhs + OP* rhs = ip->oprnd2; // rhs + + if (!ip->lastUse) + { + fpregs.expire(lhs, ip); + fpregs.expire(rhs, ip); + break; + } + + #ifdef AVMPLUS_PPC + + Register rLhs = Unknown; + Register rRhs = Unknown; + InsRegisterPrepAB(ip, fpregs, lhs, rLhs, fpregs, rhs, rRhs); + FCMPU(CR7, rLhs, rRhs); + + #endif + + #ifdef AVMPLUS_ARM + // This is implemented by a helper function in ARM and should + // not be generated directly. + AvmAssert(false); + #endif + + #ifdef AVMPLUS_IA32 + + if (core->sse2) + { + Register rLhs = Unknown; + Register rRhs = Unknown; + + // we reverse the args here, so our SSE2 jlt, jle operators + // can use JA/JAE and JBE/JB operators to get the right + // answer for unordered results w/out using LAHF+TEST + InsRegisterPrepAB(ip, fpregs, rhs, rRhs, fpregs, lhs, rLhs); + + AvmAssert(rLhs != Unknown); + AvmAssert(rRhs != Unknown); + + UCOMISD(rRhs, rLhs); + // sets EFLAGS based on float compare + } + else + { + Register rLhs = Unknown; + InsRegisterPrepA(ip, fpregs, lhs, rLhs); + AvmAssert(rLhs == FST0); + AvmAssert(rhs->reg == Unknown); + AvmAssert(rhs->pos != InvalidPos); + + FCOM(stackPos(rhs), framep); + // sets FPU status flags from compare + } + + #endif + + ip->reg = Unknown; + ip->pos = Unknown; + break; + } + + case MIR_jeq: + case MIR_jne: + case MIR_jlt: + case MIR_jle: + case MIR_jnle: + case MIR_jnlt: + { + OP* target = ip->target; + spillTmps(target); + // this is the instruction of the compare. + MirOpcode cc = ip->oprnd1->code; + AvmAssert(cc == MIR_icmp || cc == MIR_ucmp || cc == MIR_fcmp); + + #ifdef AVMPLUS_IA32 + + if (cc != MIR_fcmp) + { + switch (mircode) { + case MIR_jeq: + JE(0x7FFFFFFF); + break; + case MIR_jne: + JNE(0x7FFFFFFF); + break; + case MIR_jlt: + if (cc == MIR_icmp) JL (0x7FFFFFFF); + else JB (0x7FFFFFFF); + break; + case MIR_jle: + if (cc == MIR_icmp) JLE(0x7FFFFFFF); + else JBE(0x7FFFFFFF); + break; + case MIR_jnle: + if (cc == MIR_icmp) JNLE(0x7FFFFFFF); + else JNBE(0x7FFFFFFF); + break; + case MIR_jnlt: + if (cc == MIR_icmp) JNL(0x7FFFFFFF); + else JNB(0x7FFFFFFF); + break; + default: + AvmAssert(false); // default case here to shut compiler up + break; + } + } + else + { + if (core->sse2) + { + // previous fcmp set EFLAGS using UCOMISD + // result Z P C + // ? 1 1 1 + // > 0 0 0 + // < 0 0 1 + // = 1 0 0 + + // move flags to AH (bit7 S Z 0 A 0 P 1 C bit0) + switch (mircode) { + case MIR_jne: + case MIR_jeq: + registerAllocSpecific(gpregs, EAX); + LAHF(); + TEST_AH(0x44); + gpregs.addFree(EAX); + if (mircode == MIR_jne) + JP (0x7FFFFFFF); + else + JNP (0x7FFFFFFF); + break; + case MIR_jlt: + JNBE (0x7FFFFFF); + break; + case MIR_jnlt: + JBE (0x7FFFFFF); + break; + case MIR_jle: + JNB (0x7FFFFFF); + break; + case MIR_jnle: + JB (0x7FFFFFF); + break; + } + } + else + { + // previous fcmp set FPU status using FUCOMP + registerAllocSpecific(gpregs, EAX); + FNSTSW_AX(); + switch (mircode) { + case MIR_jeq: + TEST_AH(0x44); + JNP(0x7FFFFFFF); + break; + case MIR_jne: + TEST_AH(0x44); + JP(0x7FFFFFFF); + break; + case MIR_jlt: + TEST_AH(0x05); + JNP(0x7FFFFFF); + break; + case MIR_jnlt: + TEST_AH(0x05); + JP(0x7FFFFFF); + break; + case MIR_jle: + TEST_AH(0x41); + JNP(0x7FFFFFF); + break; + case MIR_jnle: + TEST_AH(0x41); + JP(0x7FFFFFF); + break; + } + gpregs.addFree(EAX); + } + } + #endif + + #ifdef AVMPLUS_ARM + // We need 32 bits of space to store the patch + // offset. + // So, the sense of the branch will be inverted, + // and we'll jump around the real unconditional + // branch instruction. + bool isUnsigned = (cc == MIR_ucmp); + switch (mircode) { + case MIR_jeq: + SET_CONDITION_CODE(EQ); + break; + case MIR_jne: + SET_CONDITION_CODE(NE); + break; + case MIR_jlt: + SET_CONDITION_CODE(isUnsigned ? CC : LT); + break; + case MIR_jle: + SET_CONDITION_CODE(isUnsigned ? LS : LE); + break; + case MIR_jnle: + SET_CONDITION_CODE(isUnsigned ? HI : GT); + break; + case MIR_jnlt: + SET_CONDITION_CODE(isUnsigned ? CS : GE); + break; + default: + AvmAssert(false); // default case here to shut compiler up + break; + } + B(0); + SET_CONDITION_CODE(AL); + + #endif + + #ifdef AVMPLUS_PPC + // Branch prediction: If the y bit in the instruction is 0, + // backwards branch is predicted taken, forwards not taken. + bool hint = false; // predict true for back branch + switch (mircode) { + case MIR_jeq: + BEQ(CR7,0,hint); + NOP(); // space if displacement greater than 16 bits + break; + case MIR_jne: + BNE(CR7,0,hint); + NOP(); // space if displacement greater than 16 bits + break; + case MIR_jlt: + BLT(CR7,0,hint); + NOP(); // space if displacement greater than 16 bits + break; + case MIR_jle: + if (cc == MIR_fcmp) { + CROR(30,28,30); + BEQ(CR7,0,hint); + } else { + BLE(CR7,0,hint); + } + NOP(); // space if displacement greater than 16 bits + break; + case MIR_jnle: + if (cc == MIR_fcmp) { + CROR(30,28,30); // Z = Z|N + BNE(CR7,0,hint); + } else { + BGT(CR7,0,hint); + } + NOP(); // space if displacement greater than 16 bits + break; + case MIR_jnlt: + BGE(CR7,0,hint); + NOP(); // space if displacement greater than 16 bits + break; + default: + AvmAssert(false); // default case here to shut compiler up + break; + } + + #endif + + mdPatchPreviousOp(target); + + gpregs.expireAll(ip); + fpregs.expireAll(ip); + break; + } + + case MIR_ret: + { + OP* value = ip->oprnd1; + + #ifdef AVMPLUS_IA32 + if (!value->isDouble()) + { + if (x87Dirty || !core->sse2) { + EMMS(); + } + // force oprnd1 into EAX + Register rRet = EAX; + InsRegisterPrepA(ip, gpregs, value, rRet); + AvmAssert(rRet == EAX); + } + else + { + // force oprnd1 into ST(0) + if (core->sse2) + { + if (x87Dirty) + EMMS(); + if (value->pos != InvalidPos) { + FLDQ(stackPos(value), framep); + } else { + AvmAssert(value->reg != Unknown); + MOVSD(-8, ESP, value->reg); + FLDQ(-8, ESP); + } + } + else + { + if (value->reg != Unknown) + spill(value); + EMMS(); + FLDQ(stackPos(value), framep); + } + fpregs.expire(value, ip); + } + #endif + + #ifdef AVMPLUS_ARM + // force oprnd1 into R0/F0 + Register rRet; + RegInfo *regs; + if (value->isDouble()) { + rRet = F0; + regs = &fpregs; + } else { + rRet = R0; + regs = &gpregs; + } + InsRegisterPrepA(ip, *regs, value, rRet); + AvmAssert(rRet == (value->isDouble() ? F0 : R0)); + + if (value->isDouble()) + { + #ifdef AVMPLUS_IYONIX + // Move from R4-R5 to FPU register F0 + STMFD_bang(SP, R4_mask | R5_mask); + // LDFD F0, [SP, 0] + IMM32(0xED1D8100); + ADD_imm8(SP, SP, 8); + #else + // Kludge: + // Copy contents of F0 into R0-R1 where + // ARM ABI expects it + MOV (R0, R4); + MOV (R1, R5); + #endif + } + #endif + + #ifdef AVMPLUS_PPC + // force oprnd1 into R3/F1 + Register rRet; + RegInfo *regs; + if (value->isDouble()) { + rRet = F1; + regs = &fpregs; + } else { + rRet = R3; + regs = &gpregs; + } + InsRegisterPrepA(ip, *regs, value, rRet); + #endif + + if (ip+1 < ipEnd) + { + #ifdef AVMPLUS_PPC + B (0); // jump to epilogue + mdPatchPrevious(&patch_end); + #endif + + #ifdef AVMPLUS_ARM + B (8); // jump to epilogue + mdPatchPrevious(&patch_end); + #endif + + #ifdef AVMPLUS_IA32 + JMP (0x7FFFFFFF); // jump to epilogue + mdPatchPrevious(&patch_end); + #endif + } + break; + } + case MIR_jmp: + { + // if we have any outstanding temporaries then spill them now. + OP* target = ip->target; + spillTmps(target); + + if (!(target == ip+1 || target==ip+2 && ip[1].code==MIR_bb)) + { + #ifdef AVMPLUS_PPC + B (0); + mdPatchPreviousOp(target); + #endif + + #ifdef AVMPLUS_ARM + B (8); + mdPatchPreviousOp(ip->target); + #endif + + #ifdef AVMPLUS_IA32 + JMP(0x7FFFFFFF); + mdPatchPreviousOp(target); + #endif + } + + gpregs.expireAll(ip); + fpregs.expireAll(ip); + break; + } + + case MIR_jmpt: + { + // copy MIR case table entries to MD case table + int disp = (int)casePtr; + for (int i=1, n=ip->size; i <= n; i++) { + OP* target = ip->args[i]; + spillTmps(target); + *casePtr++ = (int32)target; + } + + // The pattern for an indirect jump is the following: + // MIR_jmpt [1] size targets[size] + // + // where [1] is the variable offset to be added to the md table address + Register r = Unknown; + InsRegisterPrepA(ip, gpregs, ip->base, r); + AvmAssert(r != Unknown); + + #ifdef AVMPLUS_PPC + LI32 (R0, disp); + // Note: LWZX(rD,rA,rB) rB can be R0 + LWZX (R0, r, R0); + MTCTR (R0); + BCTR (); + #endif + + #ifdef AVMPLUS_ARM + LDR (IP, disp, r); + MOV (PC, IP); + #endif + + #ifdef AVMPLUS_IA32 + JMP (disp, r); + #endif + + gpregs.expireAll(ip); + fpregs.expireAll(ip); + + // skip MIR case table + ip += (ip->size+3)/4; + + break; + } + + case MIR_jmpi: + { + // if we have any outstanding temporaries then spill them now. + spillTmps(ip); + + // The pattern for an indirect jump is the following: + // MIR_jmpi [1] imm32 + // + // where [1] is the variable offset to be added to the base imm32 value + // so we need to modify the imm32 to be relative to our buffer. + Register rTbl = Unknown; + InsRegisterPrepA(ip, gpregs, ip->base, rTbl); + AvmAssert(rTbl != Unknown); + + // jump table is absolute addr, not in MIR code + #ifdef AVMPLUS_PPC + LI32 (R0, ip->disp); + // Note: LWZX(rD,rA,rB) rB can be R0 + LWZX (R0, rTbl, R0); + MTCTR (R0); + BCTR (); + #endif + + #ifdef AVMPLUS_ARM + LDR (IP, ip->disp, rTbl); + MOV (PC, IP); + #endif + + #ifdef AVMPLUS_IA32 + JMP (ip->disp, rTbl); + #endif + + gpregs.expireAll(ip); + fpregs.expireAll(ip); + break; + } + + case MIR_i2d: + { + OP* v = ip->oprnd1; // int to convert + + if (!ip->lastUse) + { + gpregs.expire(v, ip); + break; + } + + Register r = Unknown; + + #ifdef AVMPLUS_PPC + Register vReg = Unknown; + InsRegisterPrepA(ip, gpregs, v, vReg); + r = registerAllocAny(fpregs, ip); + + ADDIS (R0, R0, 0x4330); + STW (R0, 12, SP); + ADDIS (R0, R0, 0x8000); + STW (R0, 16, SP); + LFD (F0, 12, SP); + XORIS (R0, vReg, 0x8000); + STW (R0, 16, SP); + LFD (r, 12, SP); + FSUB (r, r, F0); + + setResultReg(fpregs, ip, r); + #endif + + #ifdef AVMPLUS_ARM + // On ARM, MIR_i2d is never generated directly + AvmAssert(false); + #endif + + #ifdef AVMPLUS_IA32 + if (core->sse2) + { + // see if we can convert right off stack + if (v->reg == Unknown && v->pos != InvalidPos) + { + // only reserve the output don't put input into a register + gpregs.expire(v, ip); + r = registerAllocAny(fpregs, ip); + CVTSI2SD(r, stackPos(v), framep); + } + else + { + // input already in a register + Register vReg = Unknown; + InsRegisterPrepA(ip, gpregs, v, vReg); + r = registerAllocAny(fpregs, ip); + + CVTSI2SD(r, vReg); + } + setResultReg(fpregs, ip, r); + } + else + { + // FILD only works off the stack, so we must get + // the value on the stack if it isn't already there. + if (canImmFold(ip, v)) + { + // Use temporay space on stack for immediate. + // make sure esp is uptodate + + r = registerAllocAny(fpregs, ip); + + AvmAssert(r==FST0); + + if (v->reg == Unknown) + MOV (-4, ESP, v->imm); + else + MOV (-4, ESP, v->reg); + FFREE(FST7); + FILD (-4, ESP); + + gpregs.expire(v, ip); + setResultReg(fpregs,ip,r); + break; + } + else if (v->reg != Unknown) + { + // Value is in register; spill onto stack. + spill(v); + gpregs.expire(v, ip); + r = registerAllocAny(fpregs, ip); + } + else + { + // value on stack + AvmAssert(v->pos != InvalidPos); + + // get a fp reg for result. + gpregs.expire(v, ip); + r = registerAllocAny(fpregs, ip); + } + + // Now load it into fpu, doing int->double conversion + AvmAssert(r == FST0); + FFREE(FST7); + FILD(stackPos(v), framep); + setResultReg(fpregs, ip, r); + } + #endif /* AVMPLUS_PPC */ + break; + } + + case MIR_u2d: + { + OP* v = ip->oprnd1; // int to convert + + if (!ip->lastUse) + { + gpregs.expire(v, ip); + break; + } + + Register r = Unknown; + + #ifdef AVMPLUS_PPC + Register vReg = Unknown; + InsRegisterPrepA(ip, gpregs, v, vReg); + r = registerAllocAny(fpregs, ip); + + ADDIS (R0, R0, 0x4330); + STW (R0, 12, SP); + STW (vReg, 16, SP); + LFD (r, 12, SP); + LI (R0, 0); + STW (R0, 16, SP); + LFD (F0, 12, SP); + FSUB (r, r, F0); + + setResultReg(fpregs, ip, r); + #endif + + #ifdef AVMPLUS_ARM + // On ARM, MIR_i2d is never generated directly + AvmAssert(false); + #endif + + #ifdef AVMPLUS_IA32 + Register vReg = Unknown; + InsRegisterPrepA(ip, gpregs, v, vReg); + r = registerAllocAny(fpregs, ip); + + int disp = -8; + MOV (disp+4, ESP, 0); // high 32 bits = 0 + MOV (disp, ESP, vReg); // low 32 bits = unsigned value + + if (core->sse2) + { + // use x87 FPU as helper to turn long into double. + // leaves fpu unchanged unless all fpu regs are full + x87Dirty = true; + FILDQ(disp, ESP); // load 64bit int (won't lose precision) + FSTPQ(disp, ESP); // store + pop as 64bit double + MOVSD(r, disp, ESP); // load double into XMM + } + else + { + AvmAssert(r == FST0); + FFREE(FST7); + FILDQ(disp, ESP); + } + + setResultReg(fpregs,ip,r); + #endif + break; + } + + case MIR_cmop: + case MIR_csop: + case MIR_fcmop: + case MIR_fcsop: + + if (!ip->lastUse) + { + // if it's a pure operator call and it's not used, skip it + int argc = ip->argc; + OP* postCall = ip + (argc+3)/4; + for (int i=1; i <= argc; i++) + { + OP* argval = ip->args[i]; + RegInfo& regs = argval->isDouble() ? fpregs : gpregs; + regs.expire(argval, postCall); + } + ip = postCall; + break; + } + // else fall through and generate the call + + case MIR_ci: + case MIR_fci: + case MIR_cm: + case MIR_cs: + case MIR_fcm: + case MIR_fcs: + { + uint32 argc = ip->argc; + + // point to call instruction + OP* call = ip; + OP* postCall = call+(argc+3)/4; + + // buffer protection + const static int maxBytesPerArg = 16; +#ifndef FEATURE_BUFFER_GUARD + if (!ensureMDBufferCapacity(pool, argc*maxBytesPerArg)) + return; +#else + (void)maxBytesPerArg; +#endif /* FEATURE_BUFFER_GUARD */ + + // dump all the args to the stack + #ifdef _DEBUG + MDInstruction* startingMip = mip; + #endif /*_DEBUG*/ + + #ifdef AVMPLUS_IA32 + Register r = ECX; + Register rHint = EDX; // for interface dispatch + #endif + + #ifdef AVMPLUS_ARM + Register r = R0; + Register rHint = R3; // for interface dispatch + #endif + + #ifdef AVMPLUS_PPC + Register r = R3; + Register rHint = R6; + #endif + int disp = 0; + OP* base = NULL; + if ((mircode & ~MIR_float) == MIR_ci) + { + OP* hint = call->args[argc]; + call->argc--; + if (hint) { + InsRegisterPrepA(call, gpregs, hint, rHint); + } + + if (call->target->code == MIR_lea) + { + // fold the add into an addressing mode + disp = call->target->disp; + base = call->target->base; + } + else + { + base = call->target; + } + + // force base reg into ECX + InsRegisterPrepA(ip-1, gpregs, base, r); + } + + #ifdef AVMPLUS_IA32 + #ifdef _MAC + // MacOS X ABI requires 16-byte stack alignment. + // Add a SUB instruction so we can insert some padding later. + SUB(ESP, 0); + patch_esp_padding = mip-1; + #endif + int at = prepCallArgsOntoStack(call, postCall); + #else + prepCallArgsOntoStack(call, postCall); + #endif + + // make sure we are accurate in our bytes / argument estimate + #ifdef _DEBUG + lastMip = mip; // ignore the args + if ((startingMip - mip) > (int)argc*maxBytesPerArg) + AvmAssert(false); + #endif /*_DEBUG*/ + + // now update the allocator by expiring actives + ip = postCall; + + #ifdef AVMPLUS_PPC + + if ((mircode & ~MIR_float) != MIR_ci) + { + // direct call + thincall(call->addr); + } + else + { + // indirect call + AvmAssert(r != Unknown); + LWZ32(R12, disp, r); + #if !TARGET_RT_MAC_MACHO + LWZ(R0, 0, R12); + MTCTR(R0); + #else + MTCTR(R12); + #endif + BCTRL(); + } + + #endif + + #ifdef AVMPLUS_ARM + if ((mircode & ~MIR_float) != MIR_ci) + { + // direct call + thincall(call->addr); + } + else + { + // indirect call + AvmAssert(r != Unknown); + if (disp > -4096 && disp < 4096) + { + MOV(LR, PC); + LDR(PC, disp, r); + } + else + { + LDR(IP, disp, r); + MOV(LR, PC); + MOV(PC, IP); + } + gpregs.expire(base,ip); + // expire IMT reg + if (gpregs.active[R3]) + gpregs.expire(gpregs.active[R3],ip); + + } + #endif + + #ifdef AVMPLUS_IA32 + + if (x87Dirty || !core->sse2) + EMMS(); + + #ifdef AVMPLUS_CDECL + if ((mircode & ~MIR_float & ~MIR_oper) == MIR_cm) + { + PUSH(ECX); + at -= 4; + } + #endif + + if ((mircode & ~MIR_float) != MIR_ci) + { + // direct call + thincall(call->addr); + } + else + { + // indirect call + AvmAssert(r != Unknown); + CALL(disp, r); + } + + #ifdef _MAC + // See if additional padding is needed. + int calleeAreaSize = -at; + int alignedCalleeAreaSize = (calleeAreaSize+15) & ~15; + int padding = alignedCalleeAreaSize - calleeAreaSize; + if (padding > 0) + { + *patch_esp_padding = (byte)padding; + at -= padding; + } + patch_esp_padding = NULL; + #endif + + #ifdef AVMPLUS_CDECL + if (at != 0) + ADD(ESP, -at); + #else + if ((mircode & ~MIR_float & ~MIR_oper) != MIR_cm) + { + // cdecl calling convention, caller did not restore the stack + if (at != 0) + ADD(ESP, -at); + } + #endif + + if (mircode & MIR_float) + x87Dirty = true; + + #endif + + // expire all regs. technically it should just be ones + // holding args (and base, and imt id), however in DEBUGGER + // builds, MIR_def's may be extended so this is more robust. + gpregs.expireAll(ip); + fpregs.expireAll(ip); + + if (call->lastUse) + { + // result is used, so save it. + + if (!(mircode & MIR_float)) + { + // 32bit result + #ifdef AVMPLUS_PPC + setResultReg(gpregs, call, registerAllocSpecific(gpregs, R3)); + #endif + + #ifdef AVMPLUS_ARM + setResultReg(gpregs, call, registerAllocSpecific(gpregs, R0)); + #endif + + #ifdef AVMPLUS_IA32 + registerAllocSpecific(gpregs, EAX); + setResultReg(gpregs, call, EAX); + #endif + } + else + { + // floating point result + #ifdef AVMPLUS_PPC + setResultReg(fpregs, call, registerAllocSpecific(fpregs, F1)); + #endif + + #ifdef AVMPLUS_ARM + + #ifdef AVMPLUS_IYONIX + // Move from FPU register F0 to R4-R5 + // STFD F0, [SP, -#8]! + IMM32(0xED2D8102); + LDMFD_bang(SP, R4_mask | R5_mask); + #else + // Must move the FP result from R0-R1 to R4-R5 + MOV(R4, R0); + MOV(R5, R1); + #endif + + setResultReg(fpregs, call, registerAllocSpecific(fpregs, F0)); + #endif + + #ifdef AVMPLUS_IA32 + if (core->sse2) + { + // dump it to the stack since we will need it in an XMM reg + reserveStackSpace(call); + int disp = stackPos(call); + FSTPQ(disp, framep);// save st0 on stack, pop. fpu is now "clean" + call->reg = Unknown; + x87Dirty = false; + } + else + { + // leave result on the stack, for future use. + setResultReg(fpregs, call, registerAllocSpecific(fpregs, FST0)); + } + + #endif + } + } + else + { + // result not used, don't allocate anything + + #ifdef AVMPLUS_IA32 + if (mircode & MIR_float) + { + // need to pop the FPU result, or else a sequence of floating point calls + // can cause it to overflow and generate #IND values in callee functions + FSTP (FST0); + x87Dirty = false; + } + #endif + } + break; + } + + default: + AvmAssert(false); + break; + } + + // check we didn't gain or lose registers + #ifdef _DEBUG + gpregs.checkCount(); + fpregs.checkCount(); + gpregs.checkActives(ip); + fpregs.checkActives(ip); + #endif + + #ifdef AVMPLUS_VERBOSE + showRegisterStats(gpregs); + showRegisterStats(fpregs); + #endif // AVMPLUS_VERBOSE + + ip++; + } + } + + #ifdef AVMPLUS_VERBOSE + void CodegenMIR::showRegisterStats(RegInfo& regs) + { + if(!verbose()) + return; + + // track # registers used and use counts + int active_size=0; + for (int i=0; i < MAX_REGISTERS; i++) + if (regs.active[i]) + active_size++; + + // def-use stats + OP* lastUse = ip->lastUse; + int span = lastUse - (ip+1); + +#ifdef AVMPLUS_PROFILE + if (span > longestSpan) + longestSpan = span; + + // Debugger version track statistics and dumps out data along the way + // if wanted. + if (!regs.free) + fullyUsedCount++; +#endif + + // dump out a register map + + // any regs? + if (active_size > 0) + core->console << " active: "; + + #if defined(AVMPLUS_PPC) + const char **regnames = (®s != &fpregs) ? gpregNames : fpregNames; + #elif defined(AVMPLUS_ARM) + const char *const *regnames = regNames; + #elif defined(AVMPLUS_IA32) + const char **regnames = (®s != &fpregs) ? gpregNames : + core->sse2 ? xmmregNames : x87regNames; + #endif + + for(int k=0; k < MAX_REGISTERS; k++) + { + OP* ins = regs.active[k]; + if (ins) + { + int defined = InsNbr(ins); + int lastUsed = InsNbr(ins->lastUse); + core->console << regnames[k] << "(" << defined << "-" << lastUsed << ") "; + } + } + if (!regs.free) + core->console << " *"; // no more registers available + //if (stolen) + // core->console << " +"; // stolen register on this line + if (active_size > 0) + core->console << "\n"; + +#ifdef AVMPLUS_IA32 + if (regnames == x87regNames) + core->console << " top = " << (int)x87Top << "\n"; +#endif + } + + /** + * Dumps the contents of the stack table + */ + void CodegenMIR::displayStackTable() + { + int size = activation.temps.size(); + core->console << " stacksize " << (int)activation.size << " entries " << (int)size << "\n"; + for(int i=0; iconsole << " " << stackPos(ins) + << "("<lastUse >= ip) + { +#ifndef AVMPLUS_SYMBIAN + core->console << "(" << InsNbr(ins) + << "-" << InsNbr(ins->lastUse) + << ") " << mirNames[ins->code]; +#endif + } + core->console << "\n"; + } + } + #endif //AVMPLUS_VERBOSE + + + OP* CodegenMIR::RegInfo::findLastActive(int set) + { + AvmAssert(set != 0); + OP* vic = 0; + for (int i=0; i < MAX_REGISTERS; i++) + { + if (set & rmask(i)) { + OP* ins = active[i]; + if (ins && (!vic || ins->lastUse > vic->lastUse)) + vic = ins; + } + } + return vic; + } + +#endif //AVMPLUS_VERBOSE + + bool CodegenMIR::isCodeContextChanged() const + { + return pool->domain->base != NULL; + } + + /* set position of label (will trigger patching) */ + void CodegenMIR::mirLabel(MirLabel& l, OP* bb) + { + l.bb = bb; + OP** np = l.nextPatchIns; + l.nextPatchIns = NULL; + while(np) + { + OP** targetp = np; + np = (OP**)*targetp; + *targetp = bb; + } + } + + /* patch the location 'where' with the value of the label */ + void CodegenMIR::mirPatchPtr(OP** targetp, int pc) + { + mirPatchPtr(targetp, state->verifier->getFrameState(pc)->label); + } + + void CodegenMIR::mirPatchPtr(OP** targetp, MirLabel& l) + { + // either patch it now if we know the location of label or add it to the chain + if (l.bb) + { + *targetp = l.bb; + } + else + { + *targetp = (OP*)l.nextPatchIns; + l.nextPatchIns = targetp; + } + } + + /* set position of label (will trigger patching) */ + void CodegenMIR::mdLabel(MdLabel* l, void* v) + { + l->value = (uint32)v; + while(l->nextPatch) + { + uint32* ins = l->nextPatch; // next patch is a pointer + uint32 off = MD_PATCH_LOCATION_GET(ins); // offset to next patch location + l->nextPatch = (off == 0) ? 0 : (uint32*)((MDInstruction*)ins - off); // we store offsets of next patch in the patch location + mdApplyPatch(ins, l->value); + } + } + + void CodegenMIR::mdLabel(OP* l, void* v) + { + AvmAssert(l->code == MIR_bb); + l->pos = (uint32)v; + while(l->nextPatch) + { + uint32* ins = l->nextPatch; // next patch is a pointer + uint32 off = MD_PATCH_LOCATION_GET(ins); // offset to next patch location + l->nextPatch = (off == 0) ? 0 : (uint32*)((MDInstruction*)ins - off); // we store offsets of next patch in the patch location + mdApplyPatch(ins, l->pos); + } + } + + void CodegenMIR::mdPatch(void* v, MdLabel* l) + { + // either patch it now if we know the location of label or add it to the chain + uint32* where = (uint32*)v; + if (l->value) + { + mdApplyPatch(where, l->value); + } + else + { + AvmAssertMsg(where > l->nextPatch, "patch points must be increasing addresses"); + uint32 off = (l->nextPatch == 0) ? 0 : (MDInstruction*)where - (MDInstruction*)(l->nextPatch); + MD_PATCH_LOCATION_SET(where, off); + l->nextPatch = where; + } + } + + void CodegenMIR::mdPatch(void* v, OP* l) + { + // either patch it now if we know the location of label or add it to the chain + AvmAssert(l->code == MIR_bb); + uint32* where = (uint32*)v; + if (l->pos) + { + mdApplyPatch(where, l->pos); + } + else + { + AvmAssertMsg(where > l->nextPatch, "patch points must be increasing addresses"); + uint32 off = (l->nextPatch == 0) ? 0 : (MDInstruction*)where - (MDInstruction*)(l->nextPatch); + MD_PATCH_LOCATION_SET(where, off); + l->nextPatch = where; + } + } + + void CodegenMIR::mdApplyPatch(uint32* where, int labelvalue) + { + #ifdef AVMPLUS_PPC + MDInstruction* savedMip = mip; + mip = (MDInstruction* )where; + + // displacement relative to our patch address + int disp = (byte*)labelvalue - (byte*)mip; + + const int B_opcode = 0x48000000; + const int NOP_opcode = 0x60000000; + + // mip is either directly pointing at the instruction + // or its pointing one instruction after the branch. + // In the case of it being the same instruction the upper + // bits will be 18 (B instruction). + if ( (*mip >> 26) == 18 ) + { + int disp = (byte*)labelvalue - (byte*)mip; + + // The biggest branch displacement we can deal with + // is 26 bits. If branches get bigger than that (+/- 3MB), + // need to go to 32-bit jumps via CTR. + AvmAssert(IsBranchDisplacement(disp)); + + // unconditional branch, 26-bit offset + *mip = B_opcode | (disp&0x3FFFFFF); + } + else + { + // If the displacement fits in 16 bits, use the ordinary + // branch instruction. + if (IsSmallDisplacement(disp+4)) + { + // Add 4 from displacement, since now we're branching + // relative to our true instruction + disp += 4; + + mip[-1] |= (disp&0xFFFF); + mip[0] = NOP_opcode; + } + else + { + // Otherwise, invert the conditional branch, and use the NOP + // that we put after the branch to do an unconditional branch, + // which supports a 26-bit displacement. + + // invert conditional and hint, set offset = 8 + const int COND_HINT_MASK = 0x01200000; + mip[-1] = (mip[-1]^COND_HINT_MASK) | 8; + + // The biggest branch displacement we can deal with + // is 26 bits. If branches get bigger than that (+/- 3MB), + // need to go to 32-bit jumps via CTR. + AvmAssert(IsBranchDisplacement(disp)); + + // unconditional branch, 26-bit offset + mip[0] = B_opcode | (disp&0x3FFFFFF); + } + } + mip = savedMip; + #endif + + #ifdef AVMPLUS_IA32 + MDInstruction* savedMip = mip; + mip = (MDInstruction* )where; + IMM32( labelvalue-(uint32)mip-4 ); // relative branch (minus the size of the immediate) + mip = savedMip; + #endif /* AVMPLUS_IA32 */ + + #ifdef AVMPLUS_ARM + MDInstruction* savedMip = mip; + mip = (MDInstruction* )where; + + // displacement relative to our patch address + int disp = (byte*)labelvalue - (byte*)mip; + + // Clobber everything but the condition code + *mip &= 0xF0000000; + + // Write in the branch instruction + *mip |= 0x0A000000 | ((disp-8)>>2)&0xFFFFFF; + + mip = savedMip; + #endif + } + +#ifdef DEBUGGER + void CodegenMIR::emitSampleCheck() + { + /* @todo inlined sample check doesn't work, help! + OP* takeSample = loadIns(MIR_ld, (int)&core->takeSample, NULL); + OP* br = Ins(MIR_jeq, binaryIns(MIR_ucmp, takeSample, InsConst(0))); + callIns(MIR_cm, COREADDR(AvmCore::sample), 1, InsConst((int32)core)); + br->target = Ins(MIR_bb); + */ + callIns(MIR_cm, COREADDR(AvmCore::sampleCheck), 1, InsConst((int32)core)); + } +#endif + +#ifdef AVMPLUS_VERBOSE + bool CodegenMIR::verbose() + { + return state && state->verifier->verbose || pool->verbose; + } +#endif + +} diff --git a/mozilla/js/tamarin/codegen/CodegenMIR.h b/mozilla/js/tamarin/codegen/CodegenMIR.h new file mode 100644 index 00000000000..d95037fd14f --- /dev/null +++ b/mozilla/js/tamarin/codegen/CodegenMIR.h @@ -0,0 +1,1526 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_CodegenMIR__ +#define __avmplus_CodegenMIR__ + + +namespace avmplus +{ + // bit insert and extraction macros. + // usage v - variable, h - high bit number. l - lower bit number, q qunatity to insert + // E.g. pull out bits 6..2 of a variable BIT_EXTRACT(v,6,2).... 0xxx xx00 + // wanring bit insert does not mask off upper bits of q, so you must make sure that + // the value of q is legal given h and l. + // BIT_VALUE_FIT can be used to determine if a value can be represeted by the + // specified number of bits. + #define BIT_INSERT(v,h,l,q) ( ( ( ((unsigned)v)&~(((1L<<((h+1)-(l))) - 1L)<<(l)) ) | ((q)<<(l)) ) ) + #define BIT_EXTRACT(v,h,l) ( ( ((unsigned)v)&(((1L<<((h+1)-(l))) - 1L)<<(l)) ) >>(l) ) + #define BIT_VALUE_FITS(v,n) ( BIT_EXTRACT(v,n-1,0) == (v) ) + + // rounding v up to the given 2^ quantity + #define BIT_ROUND_UP(v,q) ( (((unsigned)v)+(q)-1) & ~((q)-1) ) + + /** + * The CodegenMIR class is a dynamic code generator which translates + * AVM+ bytecodes into an architecture neutral intermediate representation + * suitable for common subexpression elimination, inlining, and register + * allocation. + */ + class CodegenMIR + #ifdef AVMPLUS_ARM + : public ArmAssembler + #endif + { + AvmCore * const core; + PoolObject * const pool; + MethodInfo * const info; + FrameState *state; + + #ifdef AVMPLUS_MAC_CARBON + static int setjmpDummy(jmp_buf buf); + static int setjmpAddress; + static void setjmpInit(); + #endif + + public: + + /** set to true if the no more memory. */ + bool overflow; + + static const int MIR_float = 0x20; // result is double + static const int MIR_oper = 0x40; // eligible for cse + enum MirOpcode + { + MIR_bb = 2, + MIR_jmpt = 3, // offset, size + MIR_cm = 4, // count, imm32 - call method + MIR_cs = 5, // count, imm32 - call static + MIR_ci = 6, // count, ptr - call indirect + MIR_icmp = 7, // ptr, imm32 + MIR_ucmp = 8, // ptr, imm32 + MIR_fcmp = 9, // ptr, imm32 + MIR_jeq = 10, // ptr, imm32 + MIR_jne = 11, // ptr, imm32 + MIR_ret = 12, // ptr + MIR_jmp = 13, // ptr + MIR_jmpi = 14, // ptr, disp + MIR_st = 15, // ptr, disp, ptr + MIR_arg = 16, // pos | reg - defines methods incoming arguments + MIR_def = 17, // + MIR_use = 18, // + MIR_usea = 19, // imm32 + MIR_alloc = 20, + // = 21, + MIR_ld = 22, // non-optimizable load + MIR_jlt = 23, + MIR_jle = 24, + MIR_jnlt = 25, + MIR_jnle = 26, + + MIR_imm = 1 | MIR_oper, // 0,imm32 + MIR_imul = 2 | MIR_oper, + MIR_neg = 3 | MIR_oper, // ptr, ptr + MIR_cmop = 4 | MIR_oper, // MIR_cm|oper, call method w/out side effects + MIR_csop = 5 | MIR_oper, // MIR_cs|oper, call static method w/out side effects + MIR_lsh = 6 | MIR_oper, // << + MIR_rsh = 7 | MIR_oper, // >> + MIR_ush = 8 | MIR_oper, // >>> + MIR_and = 9 | MIR_oper, + MIR_or = 10 | MIR_oper, + MIR_xor = 11 | MIR_oper, + MIR_add = 12 | MIR_oper, + MIR_sub = 13 | MIR_oper, // ptr, ptr + MIR_eq = 14 | MIR_oper, + MIR_le = 15 | MIR_oper, + MIR_lt = 16 | MIR_oper, + MIR_ne = 17 | MIR_oper, + MIR_lea = 18 | MIR_oper, // ptr, disp + + MIR_ldop = 22 | MIR_oper, // ptr, disp (optimizable) + + // After this point are all instructions that return a double-sized + // result. + MIR_fcm = 4 | MIR_float, // count, imm32 - call method, float return + MIR_fcs = 5 | MIR_float, // count, imm32 - call static, float return + MIR_fci = 6 | MIR_float, // count, addr - call indirect, float return + + MIR_fdef = 17 | MIR_float, // defines value of variable as floating point + MIR_fuse = 18 | MIR_float, // + + MIR_fld = 22 | MIR_float, // float load + + MIR_i2d = 1 | MIR_float | MIR_oper, // ptr + MIR_fneg = 2 | MIR_float | MIR_oper, // ptr + MIR_u2d = 3 | MIR_float | MIR_oper, + MIR_fcmop = 4 | MIR_float | MIR_oper, + MIR_fcsop = 5 | MIR_float | MIR_oper, + MIR_fadd = 6 | MIR_float | MIR_oper, // ptr, ptr + MIR_fsub = 7 | MIR_float | MIR_oper, // ptr, ptr + MIR_fmul = 8 | MIR_float | MIR_oper, // ptr, ptr + MIR_fdiv = 9 | MIR_float | MIR_oper, // ptr, ptr + + MIR_fldop = 22 | MIR_float | MIR_oper, // ptr, disp (optimizable load) + + MIR_last = 23 | MIR_float | MIR_oper, // highest ordinal value possible + }; + + enum ArgNumber { + _env = 0, + _argc = 1, + _ap = 2, + }; + // ia32 offset = 4*ArgNumber+4 + + /** + * Constructor. Initializes the generator for building a method + */ + CodegenMIR(MethodInfo* info); + + /** + * Constructor. Initializes the generator for native method thunks only. + */ + CodegenMIR(NativeMethod* m); + + /** + * Constructor for use with emitImtThunk + */ + CodegenMIR(PoolObject* pool); + + ~CodegenMIR(); + + /** + * Generates code for the method info. The bytecode is translated + * into native machine code and the TURBO flag is set + * on the MethodInfo. The original bytecode is retained for debugging. + * @param info method to compile + */ + void epilogue(FrameState* state); + bool prologue(FrameState* state); + void emitCall(FrameState* state, AbcOpcode opcode, int method_id, int argc, Traits* result); + void emit(FrameState* state, AbcOpcode opcode, int op1=0, int op2=0, Traits* result=NULL); + void emitIf(FrameState* state, AbcOpcode opcode, int target, int lhs, int rhs); + void emitSwap(FrameState* state, int i, int j); + void emitCopy(FrameState* state, int src, int dest); + void emitGetscope(FrameState* state, int scope, int dest); + void emitKill(FrameState* state, int i); + void emitBlockStart(FrameState* state); + void emitBlockEnd(FrameState* state); + void emitIntConst(FrameState* state, int index, int c); + void emitDoubleConst(FrameState* state, int index, double* pd); + void emitCoerce(FrameState* state, int index, Traits* type); + void emitCheckNull(FrameState* state, int index); + void emitSetContext(FrameState* state, AbstractFunction* f); + void emitSetDxns(FrameState* state); + void merge(const Value& current, Value& target); + +#ifdef AVMPLUS_VERBOSE + bool verbose(); +#endif + +#ifndef FEATURE_BUFFER_GUARD + bool checkOverflow(); +#endif + + /** + * Generates code for a native method thunk. + */ + void emitNativeThunk(NativeMethod* info); + void* emitImtThunk(ImtBuilder::ImtEntry *e); + + private: + + void emitPrep(AbcOpcode opcode); + + const byte *abcStart; + const byte *abcEnd; + + // + // helpers called by generated code + // + static Atom coerce_o(Atom v); + + #ifdef AVMPLUS_ARM + // + // ARM needs helpers for floating point + // + static double fadd(double x, double y); + static double fsub(double x, double y); + static double fmul(double x, double y); + static double fdiv(double x, double y); + static int fcmp(double x, double y); + static double i2d(int i); + static double u2d(uint32 i); + #endif + + public: + // + // Register allocation stuff follows + // Encoded in 7b quantity + // + + #ifdef AVMPLUS_PPC + + #ifdef AVMPLUS_VERBOSE + static const char *gpregNames[]; + static const char *fpregNames[]; + #endif + + typedef enum { + CR0 = 0, + CR1 = 1, + CR2 = 2, + CR3 = 3, + CR4 = 4, + CR5 = 5, + CR6 = 6, + CR7 = 7, + } ConditionRegister; + + // These are used as register numbers in various parts of the code + static const int MAX_REGISTERS = 32; + enum + { + // general purpose 32bit regs + R0 = 0, // scratch or the value 0 + SP = 1, // stack pointer + RTOC= 2, // toc pointer + R3 = 3, // this, return value + R4 = 4, + R5 = 5, + R6 = 6, + R7 = 7, + R8 = 8, + R9 = 9, + R10 = 10, + R11 = 11, + R12 = 12, + R13 = 13, + R14 = 14, + R15 = 15, + R16 = 16, + R17 = 17, + R18 = 18, + R19 = 19, + R20 = 20, + R21 = 21, + R22 = 22, + R23 = 23, + R24 = 24, + R25 = 25, + R26 = 26, + R27 = 27, + R28 = 28, + R29 = 29, + R30 = 30, + R31 = 31, + + // FP regs + F0 = 0, + F1 = 1, + F2 = 2, + F3 = 3, + F4 = 4, + F5 = 5, + F6 = 6, + F7 = 7, + F8 = 8, + F9 = 9, + F10 = 10, + F11 = 11, + F12 = 12, + F13 = 13, + F14 = 14, + F15 = 15, + F16 = 16, + F17 = 17, + F18 = 18, + F19 = 19, + F20 = 20, + F21 = 21, + F22 = 22, + F23 = 23, + F24 = 24, + F25 = 25, + F26 = 26, + F27 = 27, + F28 = 28, + F29 = 29, + F30 = 30, + F31 = 31, + + // special purpose registers (SPR) + LR = 8, + CTR = 9, + + Unknown = 0x7f + }; + typedef unsigned Register; + #endif + + #ifdef AVMPLUS_ARM + static const int MAX_REGISTERS = 16; + #endif + + #ifdef AVMPLUS_IA32 + + #ifdef AVMPLUS_VERBOSE + static const char *gpregNames[]; + static const char *xmmregNames[]; + static const char *x87regNames[]; + #endif + + #ifdef _MAC + byte *patch_esp_padding; + #endif + + // These are used as register numbers in various parts of the code + static const int MAX_REGISTERS = 8; + + typedef enum + { + // general purpose 32bit regs + EAX = 0, // return value, scratch + ECX = 1, // this, scratch + EDX = 2, // scratch + EBX = 3, + ESP = 4, // stack pointer + EBP = 5, // frame pointer + ESI = 6, + EDI = 7, + + SP = 4, // alias SP to ESP to match PPC name + + // SSE regs + XMM0 = 0, + XMM1 = 1, + XMM2 = 2, + XMM3 = 3, + XMM4 = 4, + XMM5 = 5, + XMM6 = 6, + XMM7 = 7, + + // X87 regs + FST0 = 0, + FST1 = 1, + FST2 = 2, + FST3 = 3, + FST4 = 4, + FST5 = 5, + FST6 = 6, + FST7 = 7, + + Unknown = -1 + } + Register; + #endif + + #define rmask(r) (1 << (r)) + + /** + * MIR instruction + * + * This structure contains the definition of the instruction format. + * Generally instructions take 1 or 2 operands. MIR_st is the + * the ONLY instruction that takes 3 operands. The form + * of the operands (or type) is instruction dependent. Each instruction + * expects the operands to be in a specific form. For example, MIR_add + * expects 2 operands which are pointers to other instructions. Debug + * builds will check operand types for conformance, but Release builds + * will have no type checking; consider yourself warned! + * + * During MIR generation we keep track of various details about the use + * of the instruction. Such as whether its result is needed across a + * function call and which instruction last uses the result of each + * instruction; lastUse. The lastUse field of every instruction + * is updated as instructions are generated. In the case of MIR_st + * no result is generated and thus lastUse can be overlayed with oprnd3. + * + * During machine dependent code generation oprnd2 is clobbered and + * the current register / stack position is maintained within this field. + */ + + class OP + { + public: + + /** opcode */ + MirOpcode code:8; + + /** register assigned to this expr, or Unknown */ + Register reg:7; + + /** flag indicating if result is used after call, so we prefer callee-saved regs */ + uint32 liveAcrossCall:1; + + /** link to a previous expr with the same opcode, for finding CSE's */ + uint32 prevcse:16; + + union + { + OP* oprnd1; // 1st operand of instruction + OP* base; // base ptr for load/store/lea/jmpi + uint32 argc; // arg count, for calls + int pos; // position of spilled value, or position of label + }; + + union + { + OP* oprnd2; // 2nd operand of instruction + int32 addr; // call addr or pc addr + int32 size; // alloca size, table size + int32 imm; // imm value if const + int disp; // immediate signed displacement for load/store/lea/jmpi + OP* target; // branch target + OP* join; // def joined to + uint32 *nextPatch; + }; + + union + { + OP* value; // value to store in MIR_st + OP* lastUse; // OP that uses this expr furthest in the future (end of live range) + OP* args[1]; // arg array, for call ops. arg[1] is the + // first arg, which will run over into the + // space of subsequent ops. + }; + + int isDouble() const { + return code & MIR_float; + } + + int spillSize() const { + return code == MIR_alloc ? size : (code & MIR_float) ? 8 : 4; + } + + int isDirty() const { + return code != MIR_imm && pos == InvalidPos; + } + + }; + + class MirLabel + { + public: + OP* bb; + OP** nextPatchIns; + MirLabel() { + bb = 0; + nextPatchIns = 0; + } + }; + + class MdLabel + { + public: + int value; + uint32* nextPatch; /* linked list of patch locations, where next address is an offset in the instruction */ + MdLabel() { + value = 0; + nextPatch = 0; + } + }; + + #ifdef AVMPLUS_VERBOSE + void buildFlowGraph(); + static void formatOpcode(PrintWriter& buffer, OP *ipStart, OP* op, PoolObject* pool, MMgc::GCHashtable* names); + static void formatInsOperand(PrintWriter& buffer, OP* oprnd, OP* ipStart); + static void formatOperand(PrintWriter& buffer, OP* oprnd, OP* ipStart); + static MMgc::GCHashtable* initMethodNames(AvmCore* core); + #endif //AVMPLUS_VERBOSE + + void emitMD(); + + OP* exAtom; + + private: + #define COREADDR(f) coreAddr((int (AvmCore::*)())(&f)) + #define GCADDR(f) gcAddr((int (MMgc::GC::*)())(&f)) + #define ENVADDR(f) envAddr((int (MethodEnv::*)())(&f)) + #define TOPLEVELADDR(f) toplevelAddr((int (Toplevel::*)())(&f)) + #define CALLSTACKADDR(f) callStackAddr((int (CallStackNode::*)())(&f)) + #define SCRIPTADDR(f) scriptAddr((int (ScriptObject::*)())(&f)) + #define ARRAYADDR(f) arrayAddr((int (ArrayObject::*)())(&f)) + #define EFADDR(f) efAddr((int (ExceptionFrame::*)())(&f)) + #define DEBUGGERADDR(f) debuggerAddr((int (Debugger::*)())(&f)) + + static int coreAddr( int (AvmCore::*f)() ); + static int gcAddr( int (MMgc::GC::*f)() ); + static int envAddr( int (MethodEnv::*f)() ); + static int toplevelAddr( int (Toplevel::*f)() ); + #ifdef DEBUGGER + static int callStackAddr( int (CallStackNode::*f)() ); + static int debuggerAddr( int (Debugger::*f)() ); + #endif + static int efAddr( int (ExceptionFrame::*f)() ); + static int scriptAddr( int (ScriptObject::*f)() ); + static int arrayAddr( int (ArrayObject::*f)() ); + + friend class Verifier; + + // MIR instruction buffer + OP* ip; + OP* ipStart; + OP* ipEnd; + int mirBuffSize; + int expansionFactor; + GrowableBuffer* mirBuffer; + + byte* code; + uint32* casePtr; + int case_count; + + #ifdef AVMPLUS_PPC + typedef uint32 MDInstruction; + #define PREV_MD_INS(m) (m-1) + #endif + + #ifdef AVMPLUS_ARM + #define PREV_MD_INS(m) (m-1) + #endif + + #ifdef AVMPLUS_IA32 + typedef byte MDInstruction; + #define PREV_MD_INS(m) (m-4) + // for intel and our purposes previous instruction is 4 bytes prior to m; used for patching 32bit target addresses + #endif + + // machine specific instruction buffer + #ifndef AVMPLUS_ARM + MDInstruction* mip; + MDInstruction* mipStart; + #endif + + uint32 arg_index; + + void mirLabel(MirLabel& l, OP* bb); + void mirPatchPtr(OP** targetp, int pc); /* patch the location 'where' with the 32b value of the label */ + void mirPatchPtr(OP** targetp, MirLabel& l); + void mirPatch(OP* i, int pc); + + void mdLabel(MdLabel* l, void* v); /* machine specific version of position label (will trigger patching) */ + void mdLabel(OP* l, void* v); /* machine specific version of position label (will trigger patching) */ + void mdPatch(void* where, MdLabel* l); /* machine specific version for patch the location 'where' with the 32b value of the label */ + void mdPatch(void* where, OP* l); /* machine specific version for patch the location 'where' with the 32b value of the label */ + void mdApplyPatch(uint32* where, int labelvalue); /* patch label->value into where */ + + void mdPatchPreviousOp(OP* ins) { + mdPatch( PREV_MD_INS(mip), ins ); + } + + void mdPatchPrevious(MdLabel* l) { + mdPatch( PREV_MD_INS(mip), l ); + } + + class StackCheck + { + public: + uint32 *patchStackSize; + MdLabel resumeLabel; + MdLabel overflowLabel; + + StackCheck() { + patchStackSize = NULL; + } + }; + + StackCheck stackCheck; + + MdLabel patch_end; + + MirLabel npe_label; + MirLabel interrupt_label; + bool interruptable; + + #ifdef AVMPLUS_IA32 + // stack probe for win32 + void emitAllocaProbe(int growthAmt, MdLabel* returnTo); + #endif /* AVMPLUS_IA32 */ + + #ifdef AVMPLUS_ARM + uint32 *patch_stmfd; + uint32 *patch_frame_size; + + /** + * Compute the size of the ARM callee area. Must be done + * after the generation of MIR opcodes. + */ + int calleeAreaSize() const { return 8*maxArgCount; } + + int countBits(uint32); + #endif + + #ifdef AVMPLUS_PPC + uint32 *patch_stmw; + uint32 *patch_stwu; + + /** + * Compute the size of the PPC callee area. Must be done + * after the generation of MIR opcodes. + */ + int calleeAreaSize() const { return 8*maxArgCount; } + + // This helper exists on PPC only to minimize the code size + // of the generated code for stack overflow checks + static void stackOverflow(MethodEnv *env); + #endif + + uint32 maxArgCount; // most number of arguments used in a call + + #ifdef AVMPLUS_PROFILE + // register allocator stats + int fullyUsedCount; // number of times all registers fully used + int longestSpan; // most number of instructions that a register is used + int spills; // number of spills required + int steals; // number of spills due to a register being stolen. + int remats; // number of rematerializations + + // profiler stats + uint64 verifyStartTime; // note the time we started verification + uint64 mdStartTime; // note the time we started MD generation + + #ifndef AVMPLUS_ARM + int mInstructionCount; // number of machine instructions + #define incInstructionCount() mInstructionCount++ + #endif + + #ifdef _DEBUG + // buffer tuning information + enum { SZ_ABC, SZ_MIR, SZ_MD, SZ_MIRWASTE, SZ_MDWASTE, SZ_MIREPI, SZ_MDEPI, SZ_MIRPRO, SZ_MDPRO, SZ_MIREXP, SZ_MDEXP, SZ_LAST }; + double sizingStats[SZ_LAST]; + #endif /* _DEBUG */ + + #else + + #define incInstructionCount() + + #endif /* AVMPLUS_PROFILE */ + + // pointer to list of argument definitions + OP* methodArgs; + OP* calleeVars; + Register framep; + + // stack space reserved by MIR_alloca instruction in prologue for locals, exception frame and Multiname + OP* _save_eip; + OP* _ef; + OP* dxns; + OP* dxnsAddrSave; // methods that set dxns need to save/restore + + #ifdef DEBUGGER + OP* localPtrs; // array of local_count + max_scope (holds locals and scopes) + OP* localTraits; // array of local_count (holds snapshot of Traits* per local) + OP* _callStackNode; + #endif + + // track last function call issued + OP* lastFunctionCall; + + // track last pc value we generated a store for + int lastPcSave; + + // cse table which prevents duplicate instructions in the same bb + OP* cseTable[MIR_last]; + OP* firstCse; +#ifdef AVMPLUS_PROFILE + int cseHits; // measure effectiveness of cse optimizer + #define incCseHits() cseHits++ + int dceHits; // measure effectiveness of dead code eliminator + #define incDceHits() dceHits++ +#else + #define incCseHits() + #define incDceHits() +#endif + +#ifdef DEBUGGER + void extendDefLifetime(OP* current); +#endif + + void saveState(); + + OP* defIns(OP* v); + OP* useIns(OP* def, int i); + + OP* undefConst; + + // frame state helpers + OP* localGet(uint32 i); + void localSet(uint32 i, OP* o); + OP* loadAtomRep(uint32 i); + + OP* InsAt(int nbr) { return ipStart+nbr; } + int InsNbr(OP* ins) { AvmAssert(ins >= ipStart); return (ins-ipStart); } + OP* InsConst(int32 value) { return Ins(MIR_imm, value); } + OP* InsAlloc(size_t s) { return Ins(MIR_alloc, (int32)s); } + void InsDealloc(OP* alloc); + OP* ldargIns(ArgNumber arg) { return &methodArgs[arg]; } + + OP* Ins(MirOpcode code, int32 v=0); + OP* Ins(MirOpcode code, OP* a1, int32 a2); + OP* Ins(MirOpcode code, OP* a1, OP* a2=0); + OP* defineArgInsPos(int spOffset); + OP* defineArgInsReg(Register r); + OP* binaryIns(MirOpcode code, OP* a1, OP* a2); + + OP* loadIns(MirOpcode code, int disp, OP* base) + { + AvmAssert((code & ~MIR_float & ~MIR_oper) == MIR_ld); + return Ins(code, base, (int32)disp); + } + + OP* cmpOptimization (int lhs, int rhs); + + OP* i2dIns(OP* v); + OP* u2dIns(OP* v); + OP* fcmpIns(OP* a1, OP* a2); + OP* binaryFcmpIns(OP* a1, OP* a2); + + OP* cmpLt(int lhs, int rhs); + OP* cmpLe(int lhs, int rhs); + OP* cmpEq(int funcaddr, int lhs, int rhs); + + void storeIns(OP* v, int disp, OP* base); + + OP* leaIns(int disp, OP* base); + OP* callIns(int32 addr, uint32 argCount, MirOpcode code); + OP* callIndirect(MirOpcode code, OP* target, uint32 argCount, ...); + OP* callIns(MirOpcode code, int32 addr, uint32 argCount, ...); + OP* promoteNumberIns(Traits* t, int i); + + OP* loadVTable(int base_index); + OP* loadToplevel(OP* env); + + // simple cse within BBs + OP* cseMatch(MirOpcode code, OP* a1, OP* a2=0); + + // dead code search + void markDead(OP* ins); + bool usedInState(OP* ins); + + void argIns(OP* a); + + OP* storeAtomArgs(int count, int startAt); + OP* storeAtomArgs(OP* receiver, int count, int startAt); + + void updateUse(OP* currentIns, OP* op, Register hint=Unknown); + + void extendLastUse(OP* use, int targetpc); + void extendLastUse(OP* ins, OP* use, OP* target); + + OP* atomToNativeRep(Traits* t, OP* atom); + OP* atomToNativeRep(int i, OP* atom); + bool isPointer(int i); + bool isDouble(int i); + OP* ptrToNativeRep(Traits*, OP* ptr); + + OP* initMultiname(Multiname* multiname, int& csp, bool isDelete = false); + +#ifdef DEBUGGER + void emitSampleCheck(); +#endif + + // + // -- MD Specific stuff + // + void generate(); + void generatePrologue(); + void generateEpilogue(); + void bindMethod(AbstractFunction* f); +#ifdef AVMPLUS_JIT_READONLY + void makeCodeExecutable(); +#endif /* AVMPLUS_JIT_READONLY */ + + bool ensureMDBufferCapacity(PoolObject* pool, size_t s); // only if buffer guard is not used + byte* getMDBuffer(PoolObject* pool); // + size_t estimateMDBufferReservation(PoolObject* pool); // + + /** + * Information about the activation record for the method is built up + * as we generate machine code. As part of the prologue, we issue + * a stack adjustment instruction and then later patch the adjustment + * value. Temporary values can be placed into the AR as method calls + * are issued. Also MIR_alloca instructions will consume space. + */ + class AR + { + public: + AR(MMgc::GC *gc) : temps(gc) {} + List temps; /* list of active temps */ + int size; /* current # of bytes consumed by the temps */ + int highwatermark; /* max size of temps */ + MDInstruction* adjustmentIns; /* AR sizing instruction to patch */ + }; + + AR activation; + + static const int InvalidPos = -1; /* invalid spill position */ + + void reserveStackSpace(OP* ins); + + #ifdef AVMPLUS_VERBOSE + void displayStackTable(); + #endif //AVMPLUS_VERBOSE + + #ifdef AVMPLUS_PPC + static const int kLinkageAreaSize = 24; + #endif + + // converts an instructions 'pos' field to a stack pointer relative displacement + int stackPos(OP* ins); + + // structures for register allocator + class RegInfo + { + public: + uint32 free; + uint32 calleeSaved; // 1 = callee-saved, 0=caller-saved +#ifdef AVMPLUS_PPC + unsigned LowerBound; +#endif +#ifdef AVMPLUS_ARM + unsigned nonVolatileMask; +#endif + OP* active[MAX_REGISTERS]; // active[r] = OP that defines r + + OP* findLastActive(int set); + void flushCallerActives(uint32 flushmask); + + RegInfo() + { + clear(); + } + + void clear() + { + free = 0; + memset(active, 0, MAX_REGISTERS * sizeof(OP*)); + } + + uint32 isFree(Register r) + { + return free & rmask(r); + } + + /** + * Add a register to the free list for the allocator. + * + * IMPORTANT + * + * This is a necessary call when freeing a register. + */ + void addFree(Register r) + { + AvmAssert(!isFree(r)); + free |= rmask(r); + } + + void removeFree(Register r) + { + AvmAssert(isFree(r)); + free &= ~rmask(r); + } + + // if an instruction is no longer in use retire it + void expire(OP* ins, OP* currentIns) + { + if (ins->reg != Unknown && ins->lastUse <= currentIns) + retire(ins); + } + + void expireAll(OP* currentIns) + { + for(int i=0; ilastUse <= currentIns) + retire(ins); + } + } + + // instruction gives up the register it is currently bound to, adding it back to the free list, + // removing it from the active list + void retire(OP* ins) + { + AvmAssert(active[ins->reg] == ins); + retire(ins->reg); + ins->reg = Unknown; + } + + void retire(Register r) + { + AvmAssert(r != Unknown); + AvmAssert(active[r] != NULL); + active[r] = NULL; + free |= rmask(r); + } + /** + * add the register provided in v->reg to the active list + * IMPORTANT: this is a necesary call when allocating a register + */ + void addActive(OP* v) + { + //addActiveCount++; + AvmAssert(active[v->reg] == NULL); + active[v->reg] = v; + } + + /** + * Remove a register from the active list without + * spilling its contents. + * + * The caller MUST eventually call addFree() + * or regs.addActive() in order to add the register + * back to the freelist or back onto the active list. + * + * It is the responsibility of the caller to update + * the reg field of the instruction. + * + * @param r - register to remove from free list + * @param forAlloctor - DO NOT USE, for allocator only + * + * @return the instruction for which the register + * was retaining a value. + */ + void removeActive(Register r) + { + //registerReleaseCount++; + AvmAssert(r != Unknown); + AvmAssert(active[r] != NULL); + + // remove the given register from the active list + active[r] = NULL; + } + + #ifdef _DEBUG + int count; + int countFree() + { + int count = 0; + for(int i=0;ireg = reg; + ins->pos = InvalidPos; + regs.addActive(ins); + } + + // MD instruction generators for spill/remat + void spill(OP* ins); + void rematerialize(OP* ins); + void copyToStack(OP* ins, Register r); + + // spill and argument code for MD calls + int prepCallArgsOntoStack(OP* ip, OP* postCall); + + void InsRegisterPrepA(OP* insRes, RegInfo& regsA, OP* insA, Register& reqdA); + void InsRegisterPrepAB(OP* insRes, RegInfo& regsA, OP* insA, Register& reqdA, RegInfo& regsB, OP* insB, Register& reqdB); + + // prepare the registers in the best possible fashion for issuing the given instruction + inline void InsPrep_A_IN_REQ_B_IN_WRONG(RegInfo& regs, OP* insA, Register& reqdA, OP* insB, Register& reqdB); + inline void InsPrep_A_IN_REQ_B_OUT_REQ(RegInfo& regs, OP* insA, Register& reqdA, OP* insB, Register& reqdB); + inline void InsPrep_A_IN_REQ_B_OUT_ANY(RegInfo& regs, OP* insA, Register& reqdA, OP* insB, Register& reqdB); +#if 0 + inline void InsPrep_A_IN_WRONG_B_IN_WRONG(RegInfo& regs, OP* insA, Register& reqdA, OP* insB, Register& reqdB); +#endif + inline void InsPrep_A_IN_WRONG_B_IN_ANY(RegInfo& regs, OP* insA, Register& reqdA, OP* insB, Register& reqdB); + inline void InsPrep_A_IN_WRONG_B_OUT(RegInfo& regs, OP* insA, Register& reqdA, OP* insB, Register& reqdB); + inline void InsPrep_A_IN_ANY_B_OUT(RegInfo& regs, OP* insA, Register& reqdA, OP* insB, Register& reqdB); + inline void InsPrep_A_OUT_B_OUT(RegInfo& regs, OP* insA, Register& reqdA, OP* insB, Register& reqdB); + + void moveR2R(OP* ins, Register src, Register dst); + + // Returns true if immediate folding can be used + bool canImmFold(OP *ins, OP *imm) const; + + #ifdef AVMPLUS_PPC + // + // PowerPC code generation + // + + void GpBinary(int op, Register dst, Register src1, Register src2); + void ADD(Register dst, Register src1, Register src2) { GpBinary(0x214, dst, src1, src2); } + void MULLW(Register dst, Register src1, Register src2) { GpBinary(0x1D6, dst, src1, src2); } + void AND(Register dst, Register src1, Register src2) { GpBinary(0x038, src1, dst, src2); } + void SUB(Register dst, Register src1, Register src2) { GpBinary(0x050, dst, src2, src1); } // z = x - y is encoded as subf z,y,x + void SLW(Register dst, Register src, Register shift) { GpBinary(0x030, src, dst, shift); } + + void FpUnary(int op, Register dst, Register src); + void FMR(Register dst, Register src) { FpUnary(0x90, dst, src); } + void FNEG(Register dst, Register src) { FpUnary(0x50, dst, src); } + + void MR(Register dst, Register src, bool dot=false); + void MR_dot(Register dst, Register src) { MR(dst,src,true); } + + void NEG(Register dst, Register src); + void LWZ(Register dst, int disp, Register base); + void LWZX(Register dst, Register rA, Register rB); + void LFD(Register dst, int disp, Register base); + void LFDX(Register dst, Register rA, Register rB); + void STFD(Register src, int disp, Register dst); + void STFDX(Register src, Register rA, Register rB); + void LMW(Register dst, int disp, Register base); + void STW(Register src, int disp, Register base); + void STWX(Register src, Register rA, Register rB); + void RLWINM(Register dst, Register src, int shift, int begin, int end); + void SLWI(Register dst, Register src, int shift); + void SRW(Register dst, Register src, Register shift); + void SRWI(Register dst, Register src, int shift); + void SRAW(Register dst, Register src, Register shift); + void SRAWI(Register dst, Register src, int shift); + void ADDI(Register dst, Register src, int imm16); + void ADDIS(Register dst, Register src, int imm16); + void SI(Register dst, Register src, int imm16); + void CMP(ConditionRegister CR, Register regA, Register regB); + void CMPI(ConditionRegister CR, Register src, int imm16); + void LI(Register reg, int imm16); + void LIS(Register reg, int imm16); + void ORI(Register dst, Register src, int imm16); + void ORIS(Register dst, Register src, int imm16); + void ANDI_dot(Register dst, Register src, int imm16); + void CMPL(ConditionRegister CR, Register regA, Register regB); + void CMPLI(ConditionRegister CR, Register src, int imm16); + void FCMPU(ConditionRegister CR, Register regA, Register regB); + void MFCR(Register dst); + void CROR(int crbD, int crbA, int crbB); + void CRNOT(int crbD, int crbA); + void XORI(Register dst, Register src, int imm16); + void XORIS(Register dst, Register src, int imm16); + void XOR(Register dst, Register src1, Register src2); + void FADD(Register dst, Register src1, Register src2); + void FSUB(Register dst, Register src1, Register src2); + void FMUL(Register dst, Register src1, Register src2); + void FDIV(Register dst, Register src1, Register src2); + void OR(Register dst, Register src1, Register src2); + void STMW(Register start, int disp, Register base); + void STWU(Register dst, int disp, Register base); + void STWUX(Register rS, Register rA, Register rB); + + void Movspr(int op, Register r, Register spr); + void MTCTR(Register reg) { Movspr(0x7C0003A6, reg, CTR); } + void MTLR(Register reg) { Movspr(0x7C0003A6, reg, LR); } + void MFLR(Register reg) { Movspr(0x7C0002A6, reg, LR); } + + void BR(int op, int addr); + void B(int offset) { BR(0, offset); } + void BL(int offset) { BR(1, offset); } + void BA(int addr) { BR(2, addr); } + void BLA(int addr) { BR(3, addr); } + + void Bcc(int op, ConditionRegister cr, int offset, bool hint=false); + void BEQ(ConditionRegister cr, int offset, bool hint=false) { Bcc(0x4182, cr, offset, hint); } + void BNE(ConditionRegister cr, int offset, bool hint=false) { Bcc(0x4082, cr, offset, hint); } + void BLE(ConditionRegister cr, int offset, bool hint=false) { Bcc(0x4081, cr, offset, hint); } + void BGT(ConditionRegister cr, int offset, bool hint=false) { Bcc(0x4181, cr, offset, hint); } + void BLT(ConditionRegister cr, int offset, bool hint=false) { Bcc(0x4180, cr, offset, hint); } + void BGE(ConditionRegister cr, int offset, bool hint=false) { Bcc(0x4080, cr, offset, hint); } + void BDNZ(ConditionRegister cr, int offset, bool hint=false){ Bcc(0x4200, cr, offset, hint); } + + void Simple(int op); + void BLR() { Simple(0x4E800020); } + void BCTR() { Simple(0x4E800420); } + void BCTRL() { Simple(0x4E800421); } + void NOP() { Simple(0x60000000); } + + void patchRelativeBranch(uint32 *patch_ip, uint32 *target_ip) + { + int offset = (target_ip-patch_ip)*4; + *patch_ip &= ~0xFFFC; + *patch_ip |= offset; + } + + // Load and store macros that take 32-bit offsets. + // R0 will be used for the offset if needed. + inline bool IsSmallDisplacement(int disp) const + { + return (uint32)(disp+0x8000) < 0x10000; + } + + // Returns whether displacement fits in 26-bit + // branch displacement (B, BL, BLA instructions) + inline bool IsBranchDisplacement(int disp) const + { + return (uint32)(disp+0x2000000) < 0x4000000; + } + + // Returns true if imm will fit in the SIMM field of + // a PowerPC instruction (16-bit signed immediate) + inline bool isSIMM(int imm) const + { + return !((imm + 0x8000) & 0xFFFF0000); + } + + // Returns true if imm will fit in the UIMM field of + // a PowerPC instruction (16-bit unsigned immediate) + inline bool isUIMM(int imm) const + { + return !(imm & 0xFFFF0000); + } + + void LWZ32(Register dst, int disp, Register base) + { + if (IsSmallDisplacement(disp)) + { + LWZ(dst, disp, base); + } + else + { + LI32(R0, disp); + LWZX(dst, base, R0); + } + } + + void STW32(Register src, int disp, Register dst) + { + if (IsSmallDisplacement(disp)) + { + STW(src, disp, dst); + } + else + { + LI32(R0, disp); + STWX(src, dst, R0); + } + } + + void LFD32(Register dst, int disp, Register base) + { + if (IsSmallDisplacement(disp)) + { + LFD(dst, disp, base); + } + else + { + LI32(R0, disp); + LFDX(dst, base, R0); + } + } + + void STFD32(Register src, int disp, Register dst) + { + if (IsSmallDisplacement(disp)) + { + STFD(src, disp, dst); + } + else + { + LI32(R0, disp); + STFDX(src, dst, R0); + } + } + + void ADDI32(Register dst, Register src, int imm32) + { + if (IsSmallDisplacement(imm32)) + { + ADDI(dst, src, imm32); + } + else + { + LI32(R0, imm32); + ADD(dst, src, R0); + } + } + + int HIWORD(int value) { return (value>>16)&0xFFFF; } + int LOWORD(int value) { return value&0xFFFF; } + + // Macro to emit the right sequence for + // loading an immediate 32-bit value + void LI32(Register reg, int imm32) + { + if (imm32 & 0xFFFF0000) { + LIS(reg, HIWORD(imm32)); + ORI(reg, reg, LOWORD(imm32)); + } else { + if (imm32 & 0x8000) { + // todo + LI(reg, 0); + ORI(reg, reg, imm32); + } else { + LI(reg, imm32); + } + } + } + + // + // End PowerPC code generation + // + #elif defined AVMPLUS_IA32 + // --------------------------------------------------- + // + // IA32 specific stuff follows + // + // --------------------------------------------------- + + bool x87Dirty; + + #ifdef AVMPLUS_VERBOSE + unsigned x87Top:3; + #endif + + bool is8bit(int i) + { + return ((signed char)i) == i; + } + + void IMM32(int imm32) + { + *(int*)mip = imm32; + mip += 4; + } + + void MODRM(Register reg, int disp, Register base, int lshift, Register index); + void MODRM(Register reg, int disp, Register base); + void MODRM(Register reg, Register operand); + + void ALU(int op); + void RET() { ALU(0xc3); } + void NOP() { ALU(0x90); } + void PUSH(Register r) { ALU(0x50|r); } + void POP(Register r) { ALU(0x58|r); } + void LAHF() { ALU(0x9F); } + + void PUSH(int imm); + + void MOV (Register dest, int imm32); + void MOV (int disp, Register base, int imm); + + // sse data transfer + + // sse math + void SSE(int op, Register dest, Register src); + void ADDSD(Register dest, Register src) { SSE(0xf20f58, dest, src); } + void SUBSD(Register dest, Register src) { SSE(0xf20f5c, dest, src); } + void MULSD(Register dest, Register src) { SSE(0xf20f59, dest, src); } + void DIVSD(Register dest, Register src) { SSE(0xf20f5e, dest, src); } + void CVTSI2SD(Register dest, Register src) { SSE(0xf20f2a, dest, src); } + void UCOMISD(Register xmm1, Register xmm2) { SSE(0x660f2e, xmm1, xmm2); } + void MOVAPD(Register dest, Register src) { SSE(0x660f28, dest, src); } + + void XORPD(Register dest, int src); + + void SSE(int op, Register r, int disp, Register base); + void ADDSD(Register r, int disp, Register base) { SSE(0xf20f58, r, disp, base); } + void SUBSD(Register r, int disp, Register base) { SSE(0xf20f5C, r, disp, base); } + void MULSD(Register r, int disp, Register base) { SSE(0xf20f59, r, disp, base); } + void DIVSD(Register r, int disp, Register base) { SSE(0xf20f5E, r, disp, base); } + void MOVSD(Register r, int disp, Register base) { SSE(0xf20f10, r, disp, base); } + void MOVSD(int disp, Register base, Register r) { SSE(0xf20f11, r, disp, base); } + void CVTSI2SD(Register r, int disp, Register base) { SSE(0xf20f2a, r, disp, base); } + + void ALU (byte op, Register reg, int imm); + void ADD(Register reg, int imm) { ALU(0x05, reg, imm); } + void SUB(Register reg, int imm) { ALU(0x2d, reg, imm); } + void AND(Register reg, int imm) { ALU(0x25, reg, imm); } + void XOR(Register reg, int imm) { ALU(0x35, reg, imm); } + void OR (Register reg, int imm) { ALU(0x0d, reg, imm); } + void CMP(Register reg, int imm) { ALU(0x3d, reg, imm); } + void IMUL(Register dst, int imm); + + void ALU (int op, Register lhs_dest, Register rhs); + void OR (Register lhs, Register rhs) { ALU(0x0b, lhs, rhs); } + void AND(Register lhs, Register rhs) { ALU(0x23, lhs, rhs); } + void XOR(Register lhs, Register rhs) { ALU(0x33, lhs, rhs); } + void ADD(Register lhs, Register rhs) { ALU(0x03, lhs, rhs); } + void CMP(Register lhs, Register rhs) { ALU(0x3b, lhs, rhs); } + void SUB(Register lhs, Register rhs) { ALU(0x2b, lhs, rhs); } + void TEST(Register lhs, Register rhs) { ALU(0x85, lhs, rhs); } + void NEG(Register reg) { ALU(0xf7, (Register)3, reg); } + void SHR(Register reg, Register /*amt*/) { ALU(0xd3, (Register)5, reg); } // unsigned >> ecx + void SAR(Register reg, Register /*amt*/) { ALU(0xd3, (Register)7, reg); } // signed >> ecx + void SHL(Register reg, Register /*amt*/) { ALU(0xd3, (Register)4, reg); } // unsigned << ecx + void XCHG(Register rA, Register rB) { ALU(0x87, rA, rB); } + void MOV (Register dest, Register src) { ALU(0x8b, dest, src); } + + void ALU2(int op, Register lhs_dest, Register rhs); + void IMUL(Register lhs, Register rhs) { ALU2(0x0faf, lhs, rhs); } + + void SETB (Register reg) { ALU2(0x0f92, reg, reg); } + void SETNB (Register reg) { ALU2(0x0f93, reg, reg); } + void SETE (Register reg) { ALU2(0x0f94, reg, reg); } + void SETNE (Register reg) { ALU2(0x0f95, reg, reg); } + void SETBE (Register reg) { ALU2(0x0f96, reg, reg); } + void SETNBE(Register reg) { ALU2(0x0f97, reg, reg); } + void SETNP (Register reg) { ALU2(0x0f9b, reg, reg); } + void SETP (Register reg) { ALU2(0x0f9a, reg, reg); } + void SETL (Register reg) { ALU2(0x0f9C, reg, reg); } + void SETLE (Register reg) { ALU2(0x0f9E, reg, reg); } + void MOVZX_r8 (Register dest, Register src) { ALU2(0x0fb6, dest, src); } + + void ALU(int op, Register r, int disp, Register base); + void TEST(int disp, Register base, Register r) { ALU(0x85, r, disp, base); } + void LEA(Register r, int disp, Register base) { ALU(0x8d, r, disp, base); } + void CALL(int disp, Register base) { ALU(0xff, (Register)2, disp, base); } + void JMP(int disp, Register base) { ALU(0xff, (Register)4, disp, base); } + void PUSH(int disp, Register base) { ALU(0xff, (Register)6, disp, base); } + void MOV (int disp, Register base, Register r) { ALU(0x89, r, disp, base); } + void MOV (Register r, int disp, Register base) { ALU(0x8b, r, disp, base); } + + void SHIFT(int op, Register reg, int imm8); + void SAR(Register reg, int imm8) { SHIFT(7, reg, imm8); } // signed >> imm + void SHR(Register reg, int imm8) { SHIFT(5, reg, imm8); } // unsigned >> imm + void SHL(Register reg, int imm8) { SHIFT(4, reg, imm8); } // unsigned << imm + void TEST_AH(uint8 imm8); + + void JCC (byte op, int offset); + void JB (int offset) { JCC(0x02, offset); } + void JNB (int offset) { JCC(0x03, offset); } + void JE (int offset) { JCC(0x04, offset); } + void JNE (int offset) { JCC(0x05, offset); } + void JBE (int offset) { JCC(0x06, offset); } + void JNBE(int offset) { JCC(0x07, offset); } + void JP (int offset) { JCC(0x0A, offset); } + void JNP (int offset) { JCC(0x0B, offset); } + void JL (int offset) { JCC(0x0C, offset); } + void JNL (int offset) { JCC(0x0D, offset); } + void JLE (int offset) { JCC(0x0E, offset); } + void JNLE(int offset) { JCC(0x0F, offset); } + void JMP (int offset); + void CALL(int offset); + + void FPU(int op, int disp, Register base); + void FSTQ(int disp, Register base) { FPU(0xdd02, disp, base); } + void FSTPQ(int disp, Register base) { FPU(0xdd03, disp, base); } + void FCOM(int disp, Register base) { FPU(0xdc02, disp, base); } + void FLDQ(int disp, Register base) { x87Dirty=true; FPU(0xdd00, disp, base); } + void FILDQ(int disp, Register base) { x87Dirty=true; FPU(0xdf05, disp, base); } + void FILD(int disp, Register base) { x87Dirty=true; FPU(0xdb00, disp, base); } + void FADDQ(int disp, Register base) { FPU(0xdc00, disp, base); } + void FSUBQ(int disp, Register base) { FPU(0xdc04, disp, base); } + void FMULQ(int disp, Register base) { FPU(0xdc01, disp, base); } + void FDIVQ(int disp, Register base) { FPU(0xdc06, disp, base); } + + void FPU(int op, Register r); + void FFREE(Register r) { FPU(0xddc0, r); } + void FSTP(Register r) { FPU(0xddd8, r); } + void FADDQ(Register r) { FPU(0xd8c0, r); } + void FSUBQ(Register r) { FPU(0xd8e0, r); } + void FMULQ(Register r) { FPU(0xd8c8, r); } + void FDIVQ(Register r) { FPU(0xd8f0, r); } + + void FPU(int op); + void FUCOMP() { FPU(0xdde9); } + void FCHS() { FPU(0xd9e0); } + void FNSTSW_AX() { FPU(0xdfe0); } + void EMMS() { FPU(0x0f77); x87Dirty=false; } + #endif + + // macros + + // windows ia32 calling conventions + // - args pushed right-to-left + // - EAX, ECX, EDX are scratch registers + // - result in EAX (32bit) or EAX:EDX (64bit) + + // cdecl calling conventions: + // - caller pops args + + // thiscall calling conventions: + // - this in ECX + // - callee pops args + + // stdcall calling conventions + // - callee pops args + + // fastcall calling conventions + // - first 2 args in ECX, EDX + // - callee pops args + + /** call a method using a relative offset */ + void thincall(int addr) + { + #ifdef AVMPLUS_PPC + int disp = addr - (int)mip; + if (IsBranchDisplacement(disp)) { + // Use relative branch if possible + BL(disp); + } else if (IsBranchDisplacement(addr)) { + // Use absolute branch if possible + // Note: address will be sign-extended. + BLA (addr); + } else { + // Otherwise, use register-based branched + LI32(R12, addr); + MTCTR(R12); + BCTRL(); + } + #endif + + #ifdef AVMPLUS_ARM + int disp = (MDInstruction*)addr - mip - 2; + if (!(disp & 0xFF000000)) + { + // Branch displacement fits in 24-bits, use BL instruction. + BL(addr - (int)mip); + } + else + { + // Branch displacement doesn't fit + MOV_imm32(IP, addr); + MOV(LR, PC); + MOV(PC, IP); + } + #endif + + #ifdef AVMPLUS_IA32 + CALL (addr - (5+(int)mip)); + #endif + } + + bool isCodeContextChanged() const; + }; + + // machine dependent buffer sizing information try to use 4B aligned values + #ifdef AVMPLUS_PPC + static const int md_prologue_size = 96; + static const int md_epilogue_size = 280; + static const int md_native_thunk_size = 1024; + #endif + + #ifdef AVMPLUS_ARM + static const int md_prologue_size = 256; + static const int md_epilogue_size = 128; + static const int md_native_thunk_size = 1024; + #endif /* AVMPLUS_ARM */ + + #ifdef AVMPLUS_IA32 + static const int md_prologue_size = 32; + static const int md_epilogue_size = 128; + static const int md_native_thunk_size = 256; + #endif /* AVMPLUS_PPC */ +} +#endif /* __avmplus_CodegenMIR__ */ diff --git a/mozilla/js/tamarin/codegen/Ia32Assembler.cpp b/mozilla/js/tamarin/codegen/Ia32Assembler.cpp new file mode 100644 index 00000000000..4d12093446f --- /dev/null +++ b/mozilla/js/tamarin/codegen/Ia32Assembler.cpp @@ -0,0 +1,1135 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmplus.h" + +namespace avmplus +{ + using namespace MMgc; + +#ifdef AVMPLUS_IA32 +#ifdef AVMPLUS_VERBOSE + + const char *CodegenMIR::gpregNames[] = { + "eax", + "ecx", + "edx", + "ebx", + "esp", + "ebp", + "esi", + "edi" + }; + + const char *CodegenMIR::xmmregNames[] = { + "xmm0", + "xmm1", + "xmm2", + "xmm3", + "xmm4", + "xmm5", + "xmm6", + "xmm7" + }; + + const char *CodegenMIR::x87regNames[] = { + "fst0", + "fst1", + "fst2", + "fst3", + "fst4", + "fst5", + "fst6", + "fst7", + }; + +#endif // AVMPLUS_VERBOSE +#endif // AVMPLUS_IA32 + +#ifdef AVMPLUS_IA32 + void CodegenMIR::MODRM(Register reg, Register operand) + { + *mip++ = 3<<6 | reg<<3 | operand; + } + + void CodegenMIR::MODRM(Register reg, int disp, Register base, int lshift, Register index) + { + // reg <-> disp[base+index<= 0 && lshift <= 3); + if (disp == 0 && base != EBP) { + mip[0] = 0<<6 | reg<<3 | 4; // ModR/M + mip[1] = lshift<<6 | index<<3 | base; // SIB + mip += 2; + } else if (is8bit(disp)) { + mip[0] = 1<<6 | reg<<3 | 4; // ModR/M + mip[1] = lshift<<6 | index<<3 | base; // SIB + mip[2] = disp; + mip += 3; + } else { + *(mip++) = 2<<6 | reg<<3 | 4; // ModR/M + *(mip++) = lshift<<6 | index<<3 | base; // SIB + IMM32(disp); + } + } + + void CodegenMIR::MODRM(Register reg, int disp, Register base) + { + // dest <-> disp[base] + if (base == Unknown) { + // disp = absolute addr + *(mip++) = 0<<6 | reg<<3 | 5; + IMM32(disp); + } + else if (base == ESP) { + MODRM(reg, disp, base, 0, (Register)4); // index==4 means ignore index + } + else if (disp == 0 && base != EBP) { + *(mip++) = 0<<6 | reg<<3 | base; // mod r/m + } else if (is8bit(disp)) { + *(mip++) = 1<<6 | reg<<3 | base; // mod r/m + *(mip++) = disp; + } else { + *(mip++) = 2<<6 | reg<<3 | base; // mod r/m + IMM32(disp); + } + } + + void CodegenMIR::PUSH(int imm) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (verbose()) + core->console.format(" %A push %d\n", mip, imm); + #endif /* AVMPLUS_VERBOSE */ + + if (is8bit(imm)) { + // push imm8 (sign extended) + mip[0] = 0x6a; + mip[1] = imm; + mip += 2; + } else { + // push imm32 + *mip++ = 0x68; + IMM32(imm); + } + } + + void CodegenMIR::MOV(Register dest, int imm32) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (verbose()) + core->console.format(" %A mov %R, %d\n", mip, dest, imm32); + #endif /* AVMPLUS_VERBOSE */ + + // mov reg, imm32 + *mip++ = 0xb8 | dest; + IMM32(imm32); + } + + void CodegenMIR::MOV(int disp, Register base, int imm) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (verbose()) + core->console.format(" %A mov %d(%R), %d\n", mip, disp, base, imm); + #endif /* AVMPLUS_VERBOSE */ + + // mov disp[base], imm32 + *mip++ = 0xc7; + MODRM((Register)0, disp, base); + IMM32(imm); + } + + void CodegenMIR::ALU (byte op, Register reg, int imm) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (verbose()) + { + char *opstr="?"; + switch(op) { + case 0x2d: opstr = "sub "; break; + case 0x05: opstr = "add "; break; + case 0x25: opstr = "and "; break; + case 0x35: opstr = "xor "; break; + case 0x0d: opstr = "or "; break; + case 0x3d: opstr = "cmp "; break; + } + core->console.format(" %A %s %R, %d\n", mip, opstr, reg, imm); + } + #endif + + if (is8bit(imm)) { + // reg, imm8 + mip[0] = 0x83; + mip[1] = 3<<6 | op&~7 | reg; + mip[2] = imm; + mip+=3; + } else { + if (reg == EAX) { + // eax, imm32 + *mip++ = op; + } else { + // reg, imm32 + mip[0] = 0x81; + mip[1] = 3<<6 | op&~7 | reg; + mip+=2; + } + IMM32(imm); + } + } + + void CodegenMIR::ALU(int op, Register r, Register rhs) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (verbose()) + { + switch(op) { + case 0x2b: core->console.format(" %A sub %R, %R\n", mip, r, rhs); break; + case 0x03: core->console.format(" %A add %R, %R\n", mip, r, rhs); break; + case 0x23: core->console.format(" %A and %R, %R\n", mip, r, rhs); break; + case 0x33: core->console.format(" %A xor %R, %R\n", mip, r, rhs); break; + case 0x0b: core->console.format(" %A or %R, %R\n", mip, r, rhs); break; + case 0x3b: core->console.format(" %A cmp %R, %R\n", mip, r, rhs); break; + case 0xaf: core->console.format(" %A imul %R, %R\n", mip, r, rhs); break; + case 0x85: core->console.format(" %A test %R, %R\n", mip, r, rhs); break; + case 0xf7: core->console.format(" %A neg %R\n", mip, rhs); break; + case 0x87: core->console.format(" %A xchg %R, %R\n", mip, r, rhs); break; + case 0x8b: core->console.format(" %A mov %R, %R\n", mip, r, rhs); break; + } + } + #endif /* AVMPLUS_VERBOSE */ + + *mip++ = op; + MODRM(r, rhs); + } + + void CodegenMIR::ALU2(int op, Register r, Register rhs) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (verbose()) + { + switch(op) { + case 0x0faf: core->console.format(" %A imul %R, %R\n", mip, r, rhs); break; + case 0x0f92: core->console.format(" %A setb %R\n", mip, r); break; + case 0x0f93: core->console.format(" %A setnb %R\n", mip, r); break; + case 0x0f94: core->console.format(" %A sete %R\n", mip, r); break; + case 0x0f95: core->console.format(" %A setne %R\n", mip, r); break; + case 0x0f96: core->console.format(" %A setbe %R\n", mip, r); break; + case 0x0f97: core->console.format(" %A setnbe %R\n", mip, r); break; + case 0x0f9a: core->console.format(" %A setp %R\n", mip, r); break; + case 0x0f9b: core->console.format(" %A setnp %R\n", mip, r); break; + case 0x0f9C: core->console.format(" %A setl %R\n", mip, r); break; + case 0x0f9E: core->console.format(" %A setle %R\n", mip, r); break; + case 0x0fb6: core->console.format(" %A movzx_r8 %R, %R\n", mip, r, rhs); + } + } + #endif /* AVMPLUS_VERBOSE */ + + mip[0] = op>>8; + mip[1] = op; + mip += 2; + MODRM(r, rhs); + } + + void CodegenMIR::SSE(int op, Register dest, Register src) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (verbose()) + { + switch(op) { + case 0xf20f58: core->console.format(" %A addsd %F, %F\n", mip, dest, src); break; + case 0xf20f5c: core->console.format(" %A subsd %F, %F\n", mip, dest, src); break; + case 0xf20f59: core->console.format(" %A mulsd %F, %F\n", mip, dest, src); break; + case 0xf20f5e: core->console.format(" %A divsd %F, %F\n", mip, dest, src); break; + case 0xf20f2a: core->console.format(" %A cvtsi2sd %F, %R\n", mip, dest, src); break; + case 0x660f28: core->console.format(" %A movapd %F, %F\n", mip, dest, src); break; + case 0x660f2e: core->console.format(" %A ucomisd %F, %F\n", mip, dest, src); break; + } + } + #endif /* AVMPLUS_VERBOSE */ + + mip[0] = op>>16; + mip[1] = op>>8; + mip[2] = op; + mip += 3; + MODRM(dest, src); + } + + void CodegenMIR::SSE(int op, Register r, int disp, Register base) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (verbose()) + { + switch(op) { + case 0xf20f58: core->console.format(" %A addsd %F, %d(%R)\n", mip, r, disp, base); break; + case 0xf20f5c: core->console.format(" %A subsd %F, %d(%R)\n", mip, r, disp, base); break; + case 0xf20f59: core->console.format(" %A mulsd %F, %d(%R)\n", mip, r, disp, base); break; + case 0xf20f5e: core->console.format(" %A divsd %F, %d(%R)\n", mip, r, disp, base); break; + case 0xf20f10: core->console.format(" %A movsd %F, %d(%R)\n", mip, r, disp, base); break; + case 0xf20f11: core->console.format(" %A movsd %d(%R), %F\n", mip, disp, base, r); break; + case 0xf20f2a: core->console.format(" %A cvtsi2sd %F, %d(%R)\n", mip, r, disp, base); break; + } + } + #endif /* AVMPLUS_VERBOSE */ + + mip[0] = op>>16; + mip[1] = op>>8; + mip[2] = op; + mip += 3; + MODRM(r, disp, base); + } + + void CodegenMIR::XORPD(Register dest, int addr) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (verbose()) + core->console.format(" %A xorpd %F, %A\n", mip, dest, addr); + #endif /* AVMPLUS_VERBOSE */ + + // xorpd dest, m128 + mip[0] = 0x66; + mip[1] = 0x0f; + mip[2] = 0x57; + mip[3] = (dest<<3) | 5; + mip += 4; + IMM32(addr); + } + + void CodegenMIR::IMUL(Register dst, int imm) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (verbose()) + core->console.format(" %A imul %R, %d\n", mip, dst, imm); + #endif /* AVMPLUS_VERBOSE */ + + if (is8bit(imm)) + { + *mip++ = 0x6b; + MODRM(dst,dst); + *mip++ = imm; + } + else + { + *mip++ = 0x69; + MODRM(dst, dst); + IMM32(imm); + } + } + + void CodegenMIR::ALU(int op) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (verbose()) + { + switch(op) { + case 0xc9: core->console.format(" %A leave\n", mip); break; + case 0xc3: core->console.format(" %A ret\n", mip); break; + case 0x90: core->console.format(" %A nop\n", mip); break; + case 0x9f: core->console.format(" %A lahf\n", mip); break; + case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: + core->console.format(" %A push %R\n", mip, op&7); + break; + case 0x58: case 0x59: case 0x5A: case 0x5B: case 0x5C: case 0x5D: case 0x5E: case 0x5F: + core->console.format(" %A pop %R\n", mip, op&7); + break; + } + } + #endif /* AVMPLUS_VERBOSE */ + *mip++ = op; + } + + void CodegenMIR::SHIFT(int op, Register r, int imm8) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (verbose()) + { + char *opstr = "?"; + switch (op) { + case 7: opstr = "sar "; break; + case 5: opstr = "shr "; break; + case 4: opstr = "shl "; break; + } + core->console.format(" %A %s %R, %d\n", mip, opstr, r, imm8); + } + #endif /* AVMPLUS_VERBOSE */ + + *mip++ = 0xc1; + MODRM((Register)op, r); + *mip++ = imm8; + } + + void CodegenMIR::ALU(int op, Register r, int disp, Register base) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (verbose()) + { + switch (op) + { + case 0x85: core->console.format(" %A test %d(%R), %R\n", mip, disp, base, r); break; + case 0x8d: core->console.format(" %A lea %R, %d(%R)\n", mip, r, disp, base); break; + case 0x89: core->console.format(" %A mov %d(%R), %R\n", mip, disp, base, r); break; + case 0x8b: core->console.format(" %A mov %R, %d(%R)\n", mip, r, disp, base); break; + case 0xff: + switch(r) { + case 2: core->console.format(" %A call %d(%R)\n", mip, disp, base); break; + case 4: core->console.format(" %A jmp %d(%R)\n", mip, disp, base); break; + case 6: core->console.format(" %A push %d(%R)\n", mip, disp, base); break; + } + } + } + #endif /* AVMPLUS_VERBOSE */ + + *mip++ = op; + MODRM(r, disp, base); + } + + void CodegenMIR::JCC(byte op, int offset) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (verbose()) + { + char *opstr="?"; + switch(op) { + case 0x02: opstr = "jb "; break; + case 0x03: opstr = "jnb "; break; + case 0x04: opstr = "je "; break; + case 0x05: opstr = "jne "; break; + case 0x06: opstr = "jbe "; break; + case 0x07: opstr = "jnbe "; break; + case 0x0a: opstr = "jp "; break; + case 0x0b: opstr = "jnp "; break; + case 0x0c: opstr = "jl "; break; + case 0x0d: opstr = "jnl "; break; + case 0x0e: opstr = "jle "; break; + case 0x0f: opstr = "jnle "; break; + } + core->console.format(" %A %s %d\n", mip, opstr, offset); + } + #endif /* AVMPLUS_VERBOSE */ + + // j off32 + if (is8bit(offset)) { + mip[0] = 0x70 | op; + mip[1] = offset; + mip += 2; + } else { + mip[0] = 0x0f; + mip[1] = 0x80 | op; + mip+=2; + IMM32(offset); + } + } + + void CodegenMIR::JMP(int offset) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (verbose()) + core->console.format(" %A jmp %d\n", mip, offset); + #endif /* AVMPLUS_VERBOSE */ + + if (is8bit(offset)) { + mip[0] = 0xeb; + mip[1] = offset; + mip += 2; + } else { + *mip++ = 0xe9; + IMM32(offset); + } + } + + void CodegenMIR::CALL(int offset) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (verbose()) + core->console.format(" %A call %A\n", mip, offset+(int)(mip+5)); + #endif /* AVMPLUS_VERBOSE */ + + *mip++ = 0xE8; + IMM32(offset); + } + + void CodegenMIR::FPU(int op, Register r) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (verbose()) + { + char *opstr="?"; + switch(op) { + case 0xddd8: opstr = "fstp "; x87Top++; break; + case 0xddc0: opstr = "ffree"; x87Top++; break; + case 0xd8c0: opstr = "faddq"; x87Top++; break; + case 0xd8e0: opstr = "fsubq"; x87Top++; break; + case 0xd8c8: opstr = "fmulq"; x87Top++; break; + case 0xd8f0: opstr = "fdivq"; x87Top++; break; + } + core->console.format(" %A %s %X\n", mip, opstr, r); + } + #endif /* AVMPLUS_VERBOSE */ + + *mip++ = op>>8; + *mip++ = op&255 | r; + } + + void CodegenMIR::FPU(int op, int disp, Register base) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (verbose()) + { + char *opstr="?"; + switch(op) { + case 0xdc02: opstr = "fcom "; break; + case 0xdd03: opstr = "fstpq"; x87Top++; break; + case 0xdd02: opstr = "fstq "; break; + case 0xdd00: opstr = "fldq "; x87Top++; break; + case 0xdf05: opstr = "fildq"; x87Top--; break; + case 0xdc00: opstr = "faddq"; break; + case 0xdc04: opstr = "fsubq"; break; + case 0xdc01: opstr = "fmulq"; break; + case 0xdc06: opstr = "fdivq"; break; + case 0xdb00: opstr = "fild "; x87Top--; break; + } + core->console.format(" %A %s %d(%R)\n", mip, opstr, disp, base); + } + #endif /* AVMPLUS_VERBOSE */ + + AvmAssert(x87Dirty); + *mip++ = op>>8; + MODRM((Register)(op&0xff), disp, base); + } + + void CodegenMIR::FPU(int op) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (verbose()) + { + char *opstr="?"; + switch(op) { + case 0xdde9: opstr = "fucomp"; x87Top++; break; + case 0xd9e0: opstr = "fchs "; break; + case 0xdfe0: opstr = "fnstsw ax"; break; + case 0x0f77: opstr = "emms "; x87Top=0; break; + } + core->console.format(" %A %s\n", mip, opstr); + } + #endif /* AVMPLUS_VERBOSE */ + + mip[0] = op>>8; + mip[1] = op&255; + mip += 2; + } + + void CodegenMIR::TEST_AH(uint8 imm8) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (verbose()) + core->console.format(" %A test ah, %d\n", mip, imm8); + #endif // AVMPLUS_VERBOSE + + mip[0] = 0xf6; + mip[1] = 0xc4; + mip[2] = imm8; + mip += 3; + } + + bool CodegenMIR::canImmFold(OP *ins, OP *imm) const + { + bool can = false; + if (imm->code == MIR_imm) + { + switch (ins->code) + { + case MIR_lsh: + case MIR_rsh: + case MIR_ush: + case MIR_and: + case MIR_or: + case MIR_xor: + case MIR_add: + case MIR_sub: + case MIR_imul: + case MIR_icmp: + case MIR_ucmp: + case MIR_i2d: + case MIR_st: + // can be any 32-bit immediate + can = true; + break; + } + } + return can; + } + + /** + * For stacks that are bigger than one page we need to touch each page + * since windows expects that the stack grows at most one page at time + * This code was *transcribed* from chkstk.asm + */ + void CodegenMIR::emitAllocaProbe(int growthAmt, MdLabel* returnTo) + { + #define _PAGESIZE_ 4096 + + MDInstruction* label_loop; + + MOV(EAX, growthAmt); + MOV(ECX, ESP); // ; current stack pointer in ecx + + label_loop = mip; + SUB(ECX,_PAGESIZE_); // ; move down a page + SUB(EAX,_PAGESIZE_); // ; adjust request and... + + TEST(0, ECX, EAX); // ; ...probe it + + CMP(EAX,_PAGESIZE_); // ; more than one page requested? + JNB(1); // ; no + mip[-1] = label_loop-mip; + + SUB(ECX,EAX); // ; move stack down by eax + MOV(EAX,ESP); // ; save current tos and do a... + TEST(0, ECX, EAX); // ; ...probe in case a page was crossed + MOV(ESP,ECX); // ; set the new stack pointer + JMP(0x7FFFFFFF); // ; jmp back into mainline code + mdPatchPrevious(returnTo); + + #undef _PAGESIZE_ + } + + /** + * emitNativeThunk generates code for a native method + * thunk. A native method thunk converts VM types like + * Atoms to native data types, pushes them on the stack + * in C calling convention, and calls the native method. + * By generating code for these, we avoid unnecessary + * looping. + * + * kScratchBufferSize: + * To keep our memory footprint small, we want an exact + * fit for our native thunk buffers. We also don't + * want to add a lot of code to the VM, and we don't want + * two code paths that have to be maintained in + * delicate concert. So, we run the emit algorithm + * twice, first to figure out how big the buffer is, + * and second to write it out. + * + * This scratch buffer is used when calculating the + * size. All native methods are baked into the Player, + * so the hardcoded buffer size should be OK. + * If the assert at the end ever fires, you must enlarge + * this buffer. + */ + void CodegenMIR::emitNativeThunk(NativeMethod *info) + { + code = mip = mipStart = getMDBuffer(pool); + if (!code) + { + overflow = true; + return; + } + +#ifdef FEATURE_BUFFER_GUARD + GrowthGuard guard(pool->codeBuffer); +#else + if (!ensureMDBufferCapacity(pool, md_native_thunk_size)) + return; +#endif /* FEATURE_BUFFER_GUARD */ + + bool need_rest = ((info->flags & AbstractFunction::NEED_REST) != 0); + + // the generated thunk does not call any helper methods, so we are + // free to use eax, ecx, edx as scratch regs. + // eax = scratch + // ecx = argc + // edx = ap + + // prologue + // save args in regs +#ifdef DEBUGGER + const int stack_adjust = BIT_ROUND_UP(sizeof(CallStackNode), 16); +#else + const int stack_adjust = 0; +#endif /* DEBUGGER */ + + const int _ap = 12 + stack_adjust; + const int _argc = 8 + stack_adjust; + const int _env = 4 + stack_adjust; + + (void)_env; // stop compiler warning in some builds + +#ifdef AVMPLUS_VERBOSE + if (verbose()) + { + core->console << "native thunk for " << info << "\n"; + } +#endif + +#ifdef DEBUGGER + SUB(ESP, stack_adjust); + + // Note: This call is already 16-byte aligned for MacOS X ABI + MOV (ECX, _env, ESP); + PUSH (0); // eip + PUSH (0); // framep + LEA(EDX, 8, ESP); + PUSH (EDX); + PUSH (0); // localCount + PUSH (0); // frameTraits + PUSH (_ap+20, ESP); // va_list ap + PUSH (_argc+24, ESP); // int argc + #ifdef AVMPLUS_CDECL + PUSH (ECX); + #endif + thincall(ENVADDR(MethodEnv::debugEnter)); + #ifdef AVMPLUS_CDECL + ADD (ESP, 32); + #endif +#endif /* DEBUGGER */ + + #ifdef AVMPLUS_CDECL + int pushCount = 0; + #define INC_PUSHCOUNT() pushCount++ + #else + #define INC_PUSHCOUNT() + #endif + + #ifdef _MAC + byte *patch_esp_padding = NULL; + #endif + + // ap will be used heavily, store it in EDX + MOV (EDX, _ap, ESP); + + if (need_rest) { + INC_PUSHCOUNT(); + INC_PUSHCOUNT(); + + // If the method signature ends with "...", + // deliver any arguments after the explicitly + // specified ones as (Atom *argv, int argc) + + // get argc in a register + MOV (ECX, _argc, ESP); + + #ifdef _MAC + // System V ABI requires 16-byte stack alignment. + // This SUB will be patched with any needed padding. + SUB (ESP, 0); + patch_esp_padding = mip-1; + #endif + + // rest_count = argc-param_count + CMP (ECX, info->param_count); + + // rest_count could be <0 if optionals omitted + JNB (1); + byte* patch_ip = mip; + + // rest_count<0, push argc=0, argv=NULL + PUSH (0); + PUSH (0); + JMP (1); + + patch_ip[-1] = mip-patch_ip; + patch_ip = mip; + + // rest_count>=0 + // push rest_count + // push rest_argv = ap+restOffset + SUB (ECX, info->param_count); + PUSH (ECX); + MOV (EAX, EDX); + ADD (EAX, info->restOffset); + PUSH (EAX); + if (info->optional_count) { + MOV (ECX, info->param_count); // ECX will contain new argc + } + + patch_ip[-1] = mip-patch_ip; + } + else if (info->optional_count) + { + // get argc in a register + MOV (ECX, _argc, ESP); + + #ifdef _MAC + // System V ABI requires 16-byte stack alignment. + // This SUB will be patched with any needed padding. + SUB (ESP, 0); + patch_esp_padding = mip-1; + #endif + } + #ifdef _MAC + else + { + // System V ABI requires 16-byte stack alignment. + // This SUB will be patched with any needed padding. + SUB (ESP, 0); + patch_esp_padding = mip-1; + } + #endif + + // push args right-to-left + int first_optional = 1+info->param_count-info->optional_count; + int arg_offset = info->restOffset; + for (int i=info->param_count; i > 0; i--) + { + // param 0 is receiver, real params start at 1 + Traits* type = info->paramTraits(i); + AvmAssert(type != VOID_TYPE); + + // the arguments have already been coerced to the right type + // by the caller. We do not do type conversions here. + byte* patch_jmp = NULL; + + if (i >= first_optional) { + // emit code to check whether argument + // was specified + CMP (ECX, i); + JNB (1); + byte* patch_jae = mip; + + // emit code to push the default value + Atom arg = info->getDefaultValue(i-first_optional); + + // the arguments have already been coerced to the right type + // by the caller. We do not do type conversions here. + + if (!type || type == OBJECT_TYPE) + { + // push Atom + PUSH (arg); + } + else if (type == BOOLEAN_TYPE) + { + // push bool + int b = arg>>3; + PUSH (b); + } + else if (type == INT_TYPE) + { + int v = AvmCore::integer_i(arg); + PUSH (v); + } + else if (type == UINT_TYPE) + { + uint32 v = AvmCore::integer_u(arg); + PUSH (v); + } + else if (type == NUMBER_TYPE) + { + // push double + // TODO make this faster, we probably have memory stalls + // IA32 calling conventions don't require double's to be 8-aligned, + // but performance is better if they are. + double d = AvmCore::number_d(arg); + int *dp = (int*)&d; + PUSH (dp[1]); //msb + PUSH (dp[0]); //lsb + } + else + { + // push pointer type + // this case includes kStringType, kObjectType, and kNamespaceType + // default could be null, but won't be undefined + AvmAssert(arg != undefinedAtom); + int p = arg & ~7; + PUSH (p); + } + + // Insert a JMP instruction here to skip to + // the next argument + JMP (1); + patch_jmp = mip; + + // Patch the JAE instruction to jump here, + // which is where the non-optional code will + // go. + patch_jae[-1] = mip-patch_jae; + } + + // Generate the code for the non-optional case. + // these args will already be converted to native form by the caller + + if (type == NUMBER_TYPE) + { + // push double + // TODO make this faster, we probably have memory stalls + // TODO stack alignment? + arg_offset -= 8; + PUSH (arg_offset+4, EDX); + PUSH (arg_offset, EDX); + INC_PUSHCOUNT(); + INC_PUSHCOUNT(); + } + else + { + // push general type + // this case includes everything except Number/double + arg_offset -= 4; + PUSH (arg_offset, EDX); + INC_PUSHCOUNT(); + } + + // Patch the JMP instruction, if applicable, + // to jump to here. + if (patch_jmp) { + patch_jmp[-1] = mip-patch_jmp; + } + } + + if (info->flags & AbstractFunction::NATIVE_COOKIE) + { + PUSH (info->m_cookie); + INC_PUSHCOUNT(); + } + + // now handle the receiver object + + // all args have been pushed, now call function using thiscall calling conventions + Traits* type = info->returnTraits(); + + MOV (ECX, 0, EDX); // this is ap[0] + + if (info->flags & AbstractFunction::UNBOX_THIS) + { + // void AND(Register reg, int imm) { ALU(0x25, reg, imm); } + ALU(0x25,ECX,~7); // clear atom tag + } + + +#ifdef NATIVE_GLOBAL_FUNCTION_HACK + // hack - native toplevel functions get invoked with user defined receiver + // but are expecting the global object. this hack is totally unsound + // because it gives users the power to crash the vm. we need to either + // directly support toplevel native functions, or not use them. + AND (ECX, ~7); +#endif + +#ifdef AVMPLUS_CDECL + PUSH (ECX); +#endif + + byte* next_ip = mip+4; // branch rel. to next instr + CALL (info->m_handler_addr - (int)next_ip - 1); // call the method as an instance method + +#ifdef AVMPLUS_CDECL + int popAmount = (pushCount+1)*4; + + #ifdef _MAC + // 4 bytes of our callee area is caller's return address + // The rest is the parameters + int calleeAreaSize = popAmount+4; + + // Align the callee area to 16 byte boundary + int alignedCalleeAreaSize = (calleeAreaSize+15) & ~15; + + // The padding needed is the delta + int paddingNeeded = alignedCalleeAreaSize - calleeAreaSize; + if (paddingNeeded > 0) + { + *patch_esp_padding = (byte) paddingNeeded; + popAmount += paddingNeeded; + } + #endif + + ADD(ESP, popAmount); +#endif + +#ifdef DEBUGGER + MOV (ECX, _env, ESP); + + int adjust = 0; + // store the return value on the stack if not a double. + if (type != NUMBER_TYPE) + { + PUSH(EAX); + adjust = 4; + } + +#ifdef _MAC + // Align this call for MacOS X ABI + if (type != NUMBER_TYPE) + { + SUB(ESP, 4); + adjust += 4; + } +#endif + LEA(EDX, adjust, ESP); // callstack node addr + PUSH (EDX); + +#ifdef AVMPLUS_CDECL + PUSH(ECX); +#endif + thincall(ENVADDR(MethodEnv::debugExit)); +#ifdef _MAC + ADD(ESP, (type != NUMBER_TYPE) ? 12 : 8); +#else +#ifdef AVMPLUS_CDECL + ADD(ESP, 8); +#endif +#endif + + if (type != NUMBER_TYPE) + { + POP(EAX); + } +#endif + + if (type != NUMBER_TYPE) + { + // result in EAX + + if (type == BOOLEAN_TYPE) + { + // return value already in EAX + // in VC++ bool is just a byte, so mask it off + MOVZX_r8 (EAX, EAX); + } + else if (type == VOID_TYPE) + { + MOV (EAX, undefinedAtom); + } + } + // else, result in FPU register ST(0) + +#ifdef DEBUGGER + ADD(ESP, stack_adjust); +#endif /*DEBUGGER*/ + + RET (); + + bindMethod(info); + } + + void* CodegenMIR::emitImtThunk(ImtBuilder::ImtEntry *e) + { + mip = mipStart = getMDBuffer(pool); + +#ifdef FEATURE_BUFFER_GUARD + GrowthGuard guard(pool->codeBuffer); +#else + if (!ensureMDBufferCapacity(pool, md_native_thunk_size)) + return NULL; +#endif /* FEATURE_BUFFER_GUARD */ + + // the generated thunk does not call any helper methods, so we are + // free to use eax, ecx, edx as scratch regs without touchning the + // stack. + + // in: EDX = iid + // 4(ESP) = MethodEnv + // 8(ESP) = argc + // 12(ESP) = ap + // 0(ap) = ScriptObject (concrete instance of class) + + // local register allocation: + // eax = iid parameter + // ecx = vtable of receiver obj + + const int _ap = 12; + const int _env = 4; + +#ifdef AVMPLUS_VERBOSE + if (verbose()) + { + core->console << "imt thunk\n"; + } +#endif + + MOV (ECX, _ap, ESP); // ap + MOV (ECX, 0, ECX); // obj + MOV (ECX, offsetof(ScriptObject, vtable), ECX); // vtable + + AvmAssert(e->next != NULL); // must have 2 or more entries + + while (e->next) + { + ImtBuilder::ImtEntry *next = e->next; + + #ifdef AVMPLUS_VERBOSE + if (verbose()) + { + core->console << " disp_id="<< e->disp_id << " " << e->virt << "\n"; + } + #endif + CMP (EDX, e->virt->iid()); + JNE (1); + byte* patchip = mip; + MOV (EAX, offsetof(VTable,methods)+4*e->disp_id, ECX); // load concrete env + MOV (_env, ESP, EAX); // replace env before call + JMP (offsetof(MethodEnv, impl32), EAX); // invoke real method indirectly + patchip[-1] = mip-patchip; + + pool->core->GetGC()->Free(e); + e = next; + } + + // last one is unconditional + #ifdef AVMPLUS_VERBOSE + if (verbose()) + { + core->console << " disp_id="<< e->disp_id << " " << e->virt << "\n"; + } + #endif + MOV (EAX, offsetof(VTable,methods)+4*e->disp_id, ECX); // load concrete env + MOV (_env, ESP, EAX); // replace env before call + JMP (offsetof(MethodEnv, impl32), EAX); // invoke real method indirectly + +#ifdef AVMPLUS_JIT_READONLY + makeCodeExecutable(); +#endif /* AVMPLUS_JIT_READONLY */ + + // lock in the next available location in the buffer (16B aligned) + pool->codeBuffer->setPos((byte*) ( (size_t)mip+15 & ~15 )); + + return mipStart; + } + +#endif /* AVMPLUS_IA32 */ + +} diff --git a/mozilla/js/tamarin/codegen/PpcAssembler.cpp b/mozilla/js/tamarin/codegen/PpcAssembler.cpp new file mode 100644 index 00000000000..7f0215c3414 --- /dev/null +++ b/mozilla/js/tamarin/codegen/PpcAssembler.cpp @@ -0,0 +1,1298 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmplus.h" + +#ifdef DARWIN +#include +#endif + +namespace avmplus +{ + using namespace MMgc; + +#ifdef AVMPLUS_PPC +#ifdef AVMPLUS_VERBOSE + + const char *CodegenMIR::gpregNames[] = { + "r0", + "sp", + "rtoc", + "r3", + "r4", + "r5", + "r6", + "r7", + "r8", + "r9", + "r10", + "r11", + "r12", + "r13", + "r14", + "r15", + "r16", + "r17", + "r18", + "r19", + "r20", + "r21", + "r22", + "r23", + "r24", + "r25", + "r26", + "r27", + "r28", + "r29", + "r30", + "r31" + }; + + const char *CodegenMIR::fpregNames[] = { + "f0", + "f1", + "f2", + "f3", + "f4", + "f5", + "f6", + "f7", + "f8", + "f9", + "f10", + "f11", + "f12", + "f13", + "f14", + "f15", + "f16", + "f17", + "f18", + "f19", + "f20", + "f21", + "f22", + "f23", + "f24", + "f25", + "f26", + "f27", + "f28", + "f29", + "f30", + "f31" + }; + + +#endif + + void CodegenMIR::MR(Register dst, Register src, bool dot) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (pool->verbose) { + if (dot) core->console.format(" %A mr. %R, %R\n", mip, dst, src); + else core->console.format(" %A mr %R, %R\n", mip, dst, src); + } + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0x7C000378 | (src<<21) | (dst<<16) | (src<<11) | (int)dot; + } + + void CodegenMIR::FpUnary(int op, Register dst, Register src) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (pool->verbose) { + switch (op) { + case 0x90: core->console.format(" %A fmr %F, %F\n", mip, dst, src); break; + case 0x50: core->console.format(" %A fneg %F, %F\n", mip, dst, src); break; + } + } + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0xFC000000 | (dst<<21) | (src<<11) | op; + } + + void CodegenMIR::NEG(Register dst, Register src) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (pool->verbose) + core->console.format(" %A neg %R, %R\n", mip, dst, src); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0x7C0000D0 | (dst<<21) | (src<<16); + } + + void CodegenMIR::BR(int op, int addr) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (pool->verbose) { + switch (op) { + case 0: core->console.format(" %A b %A\n", mip, (uint32)mip+addr); break; + case 1: core->console.format(" %A bl %A\n", mip, (uint32)mip+addr); break; + case 2: core->console.format(" %A ba %A\n", mip, addr); + case 3: core->console.format(" %A bla %A\n", mip, addr); + } + } + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0x48000000 | op | (addr&0x3FFFFFC); + } + + void CodegenMIR::GpBinary(int op, Register dst, Register src1, Register src2) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (pool->verbose) { + switch (op) { + case 0x214: core->console.format(" %A add %R, %R, %R\n", mip, dst, src1, src2); break; + case 0x1D6: core->console.format(" %A mullw %R, %R, %R\n", mip, dst, src1, src2); break; + case 0x038: core->console.format(" %A and %R, %R, %R\n", mip, src1, dst, src2); break; + case 0x050: core->console.format(" %A sub %R, %R, %R\n", mip, dst, src2, src1); break; // z = x - y is encoded as subf z,y,x + case 0x030: core->console.format(" %A slw %R, %R, %R\n", mip, src1, dst, src2); break; + } + } + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0x7C000000 | (dst<<21) | (src1<<16) | (src2<<11) | op; + } + + void CodegenMIR::CMP(ConditionRegister CR, Register regA, Register regB) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (pool->verbose) + core->console.format(" %A cmp cr%d, %R, %R\n", mip, CR, regA, regB); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0x7C000000 | (CR<<23) | (regA<<16) | (regB<<11); + } + + void CodegenMIR::CMPI(ConditionRegister CR, Register regA, int imm16) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (pool->verbose) + core->console.format(" %A cmpi cr%d, %R, %d\n", mip, CR, regA, imm16); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0x2C000000 | (CR<<23) | (regA<<16) | (imm16&0xFFFF); + } + + void CodegenMIR::CMPLI(ConditionRegister CR, Register regA, int imm16) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (pool->verbose) + core->console.format(" %A cmpli cr%d, %R, %d\n", mip, CR, regA, imm16); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0x28000000 | (CR<<23) | (regA<<16) | (imm16&0xFFFF); + } + + void CodegenMIR::CMPL(ConditionRegister CR, Register regA, Register regB) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (pool->verbose) + core->console.format(" %A cmpl cr%d, %R, %R\n", mip, CR, regA, regB); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0x7C000040 | (CR<<23) | (regA<<16) | (regB<<11); + } + + void CodegenMIR::FCMPU(ConditionRegister CR, Register regA, Register regB) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (pool->verbose) + core->console.format(" %A fcmpu cr%d, %F, %F\n", mip, CR, regA, regB); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0xFC000000 | (CR<<23) | (regA<<16) | (regB<<11); + } + + void CodegenMIR::RLWINM(Register dst, Register src, int shift, int begin, int end) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (pool->verbose) + core->console.format(" %A rlwinm %R, %R, %d, %d, %d\n", mip, dst, src, shift, begin, end); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0x54000000 | (src<<21) | (dst<<16) | (shift<<11) | (begin<<6) | (end<<1); + } + + void CodegenMIR::SLWI(Register dst, Register src, int shift) + { + AvmAssert(shift > 0 && shift < 32); + RLWINM(dst, src, shift, 0, 31-shift); + } + + void CodegenMIR::SRWI(Register dst, Register src, int shift) + { + AvmAssert(shift > 0 && shift < 32); + RLWINM(dst, src, 32-shift, shift, 31); + } + + void CodegenMIR::SRW(Register dst, Register src, Register shift) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (pool->verbose) + core->console.format(" %A srw %R, %R, %R\n", mip, dst, src, shift); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0x7C000430 | (src<<21) | (dst<<16) | (shift<<11); + } + + void CodegenMIR::SRAW(Register dst, Register src, Register shift) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (pool->verbose) + core->console.format(" %A sraw %R, %R, %R\n", mip, dst, src, shift); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0x7C000630 | (src<<21) | (dst<<16) | (shift<<11); + } + + void CodegenMIR::SRAWI(Register dst, Register src, int shift) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (pool->verbose) + core->console.format(" %A srawi %R, %R, %d\n", mip, dst, src, shift); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0x7C000670 | (src<<21) | (dst<<16) | (shift<<11); + } + + void CodegenMIR::LI(Register dst, int imm16) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (pool->verbose) + core->console.format(" %A li %R, %d\n", mip, dst, imm16); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0x38000000 | (dst<<21) | (0<<16) | (imm16&0xFFFF); + } + + void CodegenMIR::LIS(Register dst, int imm16) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (pool->verbose) + core->console.format(" %A lis %R, %d\n", mip, dst, imm16); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0x3C000000 | (dst<<21) | (0<<16) | (imm16&0xFFFF); + } + + void CodegenMIR::ADDI(Register dst, Register src, int imm16) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (pool->verbose) + core->console.format(" %A addi %R, %R, %d\n", mip, dst, src, imm16); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0x38000000 | (dst<<21) | (src<<16) | (imm16&0xFFFF); + } + + void CodegenMIR::ADDIS(Register dst, Register src, int imm16) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (pool->verbose) + core->console.format(" %A addis %R, %R, %d\n", mip, dst, src, imm16); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0x3C000000 | (dst<<21) | (src<<16) | (imm16&0xFFFF); + } + + void CodegenMIR::ORI(Register dst, Register src, int imm16) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (pool->verbose) + core->console.format(" %A ori %R, %R, %d\n", mip, dst, src, imm16); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0x60000000 | (src<<21) | (dst<<16) | (imm16&0xFFFF); + } + + void CodegenMIR::ORIS(Register dst, Register src, int imm16) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (pool->verbose) + core->console.format(" %A oris %R, %R, %d\n", mip, dst, src, imm16); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0x64000000 | (src<<21) | (dst<<16) | (imm16&0xFFFF); + } + + void CodegenMIR::ANDI_dot(Register dst, Register src, int imm16) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (pool->verbose) + core->console.format(" %A andi. %R, %R, %d\n", mip, dst, src, imm16); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0x70000000 | (src<<21) | (dst<<16) | (imm16&0xFFFF); + } + + void CodegenMIR::XORI(Register dst, Register src, int imm16) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (pool->verbose) + core->console.format(" %A xori %R, %R, %d\n", mip, dst, src, imm16); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0x68000000 | (src<<21) | (dst<<16) | (imm16&0xFFFF); + } + + void CodegenMIR::XORIS(Register dst, Register src, int imm16) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (pool->verbose) + core->console.format(" %A xoris %R, %R, %d\n", mip, dst, src, imm16); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0x6C000000 | (src<<21) | (dst<<16) | (imm16&0xFFFF); + } + + void CodegenMIR::OR(Register dst, Register src1, Register src2) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (pool->verbose) + core->console.format(" %A or %R, %R, %R\n", mip, dst, src1, src2); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0x7C000378 | (src1<<21) | (dst<<16) | (src2<<11); + } + + void CodegenMIR::FADD(Register dst, Register src1, Register src2) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (pool->verbose) + core->console.format(" %A fadd %F, %F, %F\n", mip, dst, src1, src2); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0xFC00002A | (dst<<21) | (src1<<16) | (src2<<11); + } + + void CodegenMIR::FSUB(Register dst, Register src1, Register src2) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (pool->verbose) + core->console.format(" %A fsub %F, %F, %F\n", mip, dst, src1, src2); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0xFC000028 | (dst<<21) | (src1<<16) | (src2<<11); + } + + void CodegenMIR::FMUL(Register dst, Register src1, Register src2) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (pool->verbose) + core->console.format(" %A fmul %F, %F, %F\n", mip, dst, src1, src2); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0xFC000032 | (dst<<21) | (src1<<16) | (src2<<6); + } + + void CodegenMIR::FDIV(Register dst, Register src1, Register src2) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (pool->verbose) + core->console.format(" %A fdiv %F, %F, %F\n", mip, dst, src1, src2); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0xFC000024 | (dst<<21) | (src1<<16) | (src2<<11); + } + + void CodegenMIR::XOR(Register dst, Register src1, Register src2) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (pool->verbose) + core->console.format(" %A xor %R, %R, %R\n", mip, dst, src1, src2); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0x7C000278 | (src1<<21) | (dst<<16) | (src2<<11); + } + + void CodegenMIR::SI(Register dst, Register src, int imm16) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (pool->verbose) + core->console.format(" %A si %R, %R, %d\n", mip, dst, src, imm16); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0x30000000 | (dst<<21) | (src<<16) | (-imm16&0xFFFF); + } + + void CodegenMIR::LWZ(Register dst, int disp, Register base) + { + if (base == Unknown) + { + base = R0; + } + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (pool->verbose) + core->console.format(" %A lwz %R, %d(%R)\n", mip, dst, disp, base); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0x80000000 | (dst<<21) | (base<<16) | (disp&0xFFFF); + } + + void CodegenMIR::LWZX(Register dst, Register rA, Register rB) + { + if (rA == Unknown) + { + rA = R0; + } + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (pool->verbose) + core->console.format(" %A lwzx %R, %R(%R)\n", mip, dst, rA, rB); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0x7C00002E | (dst<<21) | (rA<<16) | (rB<<11); + } + + void CodegenMIR::STW(Register src, int disp, Register base) + { + if (base == Unknown) + { + base = R0; + } + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (pool->verbose) + core->console.format(" %A stw %R, %d(%R)\n", mip, src, disp, base); + #endif /* AVMPLUS_VERBOSE */ + if (base == Unknown) + base = R0; + *mip++ = 0x90000000 | (src<<21) | (base<<16) | (disp&0xFFFF); + } + + void CodegenMIR::STWX(Register src, Register rA, Register rB) + { + if (rA == Unknown) + { + rA = R0; + } + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (pool->verbose) + core->console.format(" %A stwx %R, %R(%R)\n", mip, src, rA, rB); + #endif /* AVMPLUS_VERBOSE */ + if (rA == Unknown) + rA = R0; + *mip++ = 0x7C00012E | (src<<21) | (rA<<16) | (rB<<11); + } + + void CodegenMIR::STMW(Register start, int disp, Register base) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (pool->verbose) + core->console.format(" %A stmw %R, %d(%R)\n", mip, start, disp, base); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0xBC000000 | (start<<21) | (base<<16) | (disp&0xFFFF); + } + + void CodegenMIR::LFD(Register dst, int disp, Register base) + { + if (base == Unknown) + { + base = R0; + } + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (pool->verbose) + core->console.format(" %A lfd %F, %d(%R)\n", mip, dst, disp, base); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0xC8000000 | (dst<<21) | (base<<16) | (disp&0xFFFF); + } + + void CodegenMIR::LFDX(Register dst, Register rA, Register rB) + { + if (rA == Unknown) + { + rA = R0; + } + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (pool->verbose) + core->console.format(" %A lfdx %F, %R, %R\n", mip, dst, rA, rB); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0x7C0004AE | (dst<<21) | (rA<<16) | (rB<<11); + } + + void CodegenMIR::STFD(Register src, int disp, Register base) + { + if (base == Unknown) + { + base = R0; + } + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (pool->verbose) + core->console.format(" %A stfd %F, %d(%R)\n", mip, src, disp, base); + #endif /* AVMPLUS_VERBOSE */ + if (base == Unknown) base = R0; + *mip++ = 0xD8000000 | (src<<21) | (base<<16) | (disp&0xFFFF); + } + + void CodegenMIR::STFDX(Register src, Register rA, Register rB) + { + if (rA == Unknown) + { + rA = R0; + } + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (pool->verbose) + core->console.format(" %A stfdx %F, %R, %R\n", mip, src, rA, rB); + #endif /* AVMPLUS_VERBOSE */ + if (rA == Unknown) rA = R0; + *mip++ = 0x7C0005AE | (src<<21) | (rA<<16) | (rB<<11); + } + + void CodegenMIR::LMW(Register dst, int disp, Register base) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (pool->verbose) + core->console.format(" %A lmw %R, %d(%R)\n", mip, dst, disp, base); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0xB8000000 | (dst<<21) | (base<<16) | (disp&0xFFFF); + } + + void CodegenMIR::STWU(Register dst, int disp, Register base) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (pool->verbose) + core->console.format(" %A stwu %R, %d(%R)\n", mip, dst, disp, base); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0x94000000 | (base<<21) | (dst<<16) | (disp&0xFFFF); + } + + void CodegenMIR::STWUX(Register rS, Register rA, Register rB) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (pool->verbose) + core->console.format(" %A stwux %R, %R, %R\n", mip, rS, rA, rB); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0x7C00016E | (rS<<21) | (rA<<16) | (rB<<11); + } + + void CodegenMIR::MFCR(Register dst) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (pool->verbose) + core->console.format(" %A mfcr %R\n", mip, dst); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0x7C000026 | (dst<<21); + } + + void CodegenMIR::CROR(int crbD, int crbA, int crbB) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (pool->verbose) + core->console.format(" %A cror %d, %d, %d\n", mip, crbD, crbA, crbB); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0x4C000382 | (crbD<<21) | (crbA<<16) | (crbB<<11); + } + + void CodegenMIR::CRNOT(int crbD, int crbA) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (pool->verbose) + core->console.format(" %A crnot %d, %d\n", mip, crbD, crbA); + #endif /* AVMPLUS_VERBOSE */ + *mip++ = 0x4C000042 | (crbD<<21) | (crbA<<16) | (crbA<<11); + } + + void CodegenMIR::Movspr(int op, Register r, Register spr) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (pool->verbose) { + switch (op|spr<<16) { + case 0x7C0003A6|CTR<<16: core->console.format(" %A mtctr %R\n", mip, r); break; + case 0x7C0003A6|LR <<16: core->console.format(" %A mtlr %R\n", mip, r); break; + case 0x7C0002A6|LR <<16: core->console.format(" %A mflr %R\n", mip, r); break; + } + } + #endif /* AVMPLUS_VERBOSE */ + + *mip++ = op | (r<<21) | (spr<<16); + } + + void CodegenMIR::Bcc(int op, ConditionRegister cr, int offset, bool hint) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (pool->verbose) { + switch (op) { + case 0x4182: core->console.format(" %A beq %A\n", mip, (uint32)mip+offset); break; + case 0x4082: core->console.format(" %A bne %A\n", mip, (uint32)mip+offset); break; + case 0x4081: core->console.format(" %A ble %A\n", mip, (uint32)mip+offset); break; + case 0x4181: core->console.format(" %A bgt %A\n", mip, (uint32)mip+offset); break; + case 0x4180: core->console.format(" %A blt %A\n", mip, (uint32)mip+offset); break; + case 0x4080: core->console.format(" %A bge %A\n", mip, (uint32)mip+offset); break; + case 0x4200: core->console.format(" %A bdnz %A\n", mip, (uint32)mip+offset); break; + } + } + #endif /* AVMPLUS_VERBOSE */ + *mip++ = op<<16 | (offset&0xFFFF) | (hint<<21) | (cr<<18); + } + + void CodegenMIR::Simple(int op) + { + incInstructionCount(); + #ifdef AVMPLUS_VERBOSE + if (pool->verbose) { + switch(op) { + case 0x4E800020: core->console.format(" %A blr\n", mip); break; + case 0x4E800420: core->console.format(" %A bctr\n", mip); break; + case 0x4E800421: core->console.format(" %A bctrl\n", mip); break; + case 0x60000000: core->console.format(" %A nop\n", mip); break; + } + } + #endif // AVMPLUS_VERBOSE + *mip++ = op; + } + + bool CodegenMIR::canImmFold(OP *ins, OP *imm) const + { + if (imm->code != MIR_imm) + return false; + switch (ins->code) + { + case MIR_lsh: + case MIR_rsh: + case MIR_ush: + case MIR_or: + case MIR_xor: + // can be any 32-bit immediate + return true; + case MIR_and: + case MIR_ucmp: + // must be 16-bit unsigned immediate + return isUIMM(imm->imm); + case MIR_icmp: + case MIR_add: + case MIR_sub: + // must be 16-bit signed immediate + return isSIMM(imm->imm); + default: + return false; + } + } + +#ifndef MAX +#define MAX(x,y) ( (x)>(y)?(x):(y) ) +#endif /* MAX */ + +#if !TARGET_RT_MAC_MACHO + int nativeHandlerAddr(NativeMethod::Handler handler) + { + int result; + asm("lwz %0,0(r5)" : "=r" (result)); + return result; + } +#endif + + void CodegenMIR::emitNativeThunk(NativeMethod *info) + { + /** + * PowerPC stack frame layout + * saved GPR registers + * PPC callee args + * 0(r1) PPC linkage area + * + * The # of callee arguments can be calculated from the number + * of AS arguments. It's 4 bytes for most AS types, but + * 8 bytes for double. + * + * The generated code will write directly to the PPC callee + * parameters area. Once it starts doing this, it is + * vital that no functions be called that might modify + * the parameter area. The ftoul and ftol routines should + * be simple enough that they don't do this. + * + */ + const int kLinkageAreaSize = 24; +#ifdef DEBUGGER + const int kGPRSaveCount = 3; + const int kLocalVarSize = sizeof(CallStackNode); + const int kMinCalledParamCount = 8; +#else + const int kGPRSaveCount = 2; + const int kLocalVarSize = 0; + const int kMinCalledParamCount = 0; +#endif + const int kArgumentOffset = kLinkageAreaSize; + const Register AP = R31; + const Register ARGC = R30; +#ifdef DEBUGGER + const Register ENV = R29; +#endif + + if (!pool) + core->console << "no pool " << info << "\n"; + + code = getMDBuffer(pool); + mip = (MDInstruction*)code; + if (!code) + { + overflow = true; + return; + } + +#ifdef FEATURE_BUFFER_GUARD + GrowthGuard guard(pool->codeBuffer); +#else + if (!ensureMDBufferCapacity(pool, md_native_thunk_size)) + return; +#endif /* FEATURE_BUFFER_GUARD */ + + int in_arg_offset = 0; + + const int kMaxGPRIndex = 8; + const int kMaxFPRIndex = 12; + + // scan for double optional arguments; these will + // be constants stored up front + uint32 *double_ip = mip; + int first_optional = 1+info->param_count-info->optional_count; + for (int i=first_optional; i <= info->param_count; i++) + { + Traits* type = info->paramTraits(i); + if (type == NUMBER_TYPE) { + Atom arg = info->getDefaultValue(i-first_optional); + double d = AvmCore::number_d(arg); + int *dp = (int*)&d; + *mip++ = dp[0]; + *mip++ = dp[1]; + } + } + + mipStart = mip; + + // prologue + MFLR(R0); + + // save callee-saved registers + STMW((Register)(32-kGPRSaveCount), -kGPRSaveCount*4, SP); + + // preserve link register + STW(R0, 8, SP); + + // set up other registers + MR(AP, R5); + MR(ARGC, R4); +#ifdef DEBUGGER + MR(ENV, R3); +#endif + + // The frame size will be updated later + uint32 *patch_stwu = mip; + STWU(SP, 0, SP); + + int GPRIndex = 1; + int FPRIndex = 0; + +#ifdef DEBUGGER + //MR (R3, ENV); + //MR (R4, ARGC); + //MR (R5, AP); + LI(R6, 0); // frameTraits + LI(R7, 0); // localCount + uint32 *patch_addi = mip; + ADDI(R8, SP, 0); // CallStackNode + LI(R9, 0); // framep + LI(R10, 0); // eip + thincall(ENVADDR(MethodEnv::debugEnter)); +#endif + + // Push receiver object as first argument +#ifdef NATIVE_GLOBAL_FUNCTION_HACK + // hack - native toplevel functions get invoked with user defined receiver + // but are expecting the global object. this hack is totally unsound + // because it gives users the power to crash the vm. we need to either + // directly support toplevel native functions, or not use them. + LWZ (R0, 0, AP); // this is ap[0] + RLWINM (R3, R0, 0, 0, 28); +#else + LWZ (R3, 0, AP); // this is ap[0] +#endif + in_arg_offset += 4; + + bool need_rest = ((info->flags & AbstractFunction::NEED_REST) != 0); + + if (info->flags & AbstractFunction::UNBOX_THIS) + { + RLWINM (R3, R3, 0, 0, 28); + } + + if (info->flags & AbstractFunction::NATIVE_COOKIE) + { + LI32 (R4, info->m_cookie); + GPRIndex++; + } + + // push args left to right + for (int i=1; i <= info->param_count; i++) + { + // param 0 is receiver, real params start at 1 + Traits* type = info->paramTraits(i); + AvmAssert(type != VOID_TYPE); + + // the arguments have already been coerced to the right type + // by the caller. We do not do type conversions here. + uint32* patch_b = NULL; + + if (i >= first_optional) { + // emit code to check whether argument + // was specified + CMPI (CR7, ARGC, i); + uint32* patch_bge = mip; + BGE (CR7, 0, false); + + // emit code to push the default value + Atom arg = info->getDefaultValue(i-first_optional); + + // the arguments have already been coerced to the right type + // by the caller. We do not do type conversions here. + + if (!type || type == OBJECT_TYPE) + { + // push Atom + if (GPRIndex < kMaxGPRIndex) { + LI32 ((Register)(R3+GPRIndex), arg); + } else { + LI32 (R0, arg); + STW (R0, kArgumentOffset+GPRIndex*4, SP); + } + } + else if (type == BOOLEAN_TYPE) + { + // push bool + int b = arg>>3; + if (GPRIndex < kMaxGPRIndex) { + LI ((Register)(R3+GPRIndex), b); + } else { + LI (R0, b); + STW (R0, kArgumentOffset+GPRIndex*4, SP); + } + } + else if (type == INT_TYPE) + { + int i = AvmCore::integer_i(arg); + if (GPRIndex < kMaxGPRIndex) { + LI32 ((Register)(R3+GPRIndex), i); + } else { + LI32 (R0, i); + STW (R0, kArgumentOffset+GPRIndex*4, SP); + } + } + else if (type == UINT_TYPE) + { + uint32 i = AvmCore::integer_u(arg); + if (GPRIndex < kMaxGPRIndex) { + LI32 ((Register)(R3+GPRIndex), i); + } else { + LI32 (R0, i); + STW (R0, kArgumentOffset+GPRIndex*4, SP); + } + } + else if (type == NUMBER_TYPE) + { + if (FPRIndex < kMaxFPRIndex) { + LI32(R11, (int)double_ip); + LFD((Register)(F1+FPRIndex), 0, R11); + } else { + LI32(R11, (int)double_ip); + LFD(F0, 0, R11); + STFD(F0, kArgumentOffset+GPRIndex*4, SP); + } + double_ip += 2; + } + else + { + // push pointer type + // this case includes kStringType, kObjectType, and kNamespaceType + int p = AvmCore::isNullOrUndefined(arg) ? 0 : arg & ~7; + if (GPRIndex < kMaxGPRIndex) { + LI32 ((Register)(R3+GPRIndex), p); + } else { + LI32 (R0, p); + STW (R0, kArgumentOffset+GPRIndex*4, SP); + } + } + + // Insert a B instruction here to skip to + // the next argument + patch_b = mip; + B (0); + + // Patch the BGE instruction to jump here, + // which is where the non-optional code will + // go. + patchRelativeBranch(patch_bge, mip); + } + + // Generate the code for the non-optional case. + // these args will already be converted to native form by the caller + + if (type == NUMBER_TYPE) + { + // push Atom + if (FPRIndex < kMaxFPRIndex) { + LFD((Register)(F1+FPRIndex), in_arg_offset, AP); + FPRIndex++; + } else { + LFD(F0, in_arg_offset, AP); + STFD(F0, kArgumentOffset+GPRIndex*4, SP); + } + in_arg_offset += 8; + GPRIndex += 2; + } + else + { + // push general type + // this case includes everything except Number/double + if (GPRIndex < kMaxGPRIndex) { + LWZ((Register)(R3+GPRIndex), in_arg_offset, AP); + } else { + LWZ(R0, in_arg_offset, AP); + STW(R0, kArgumentOffset+4*GPRIndex, SP); + } + in_arg_offset += 4; + GPRIndex++; + } + + // Patch the JMP instruction, if applicable, + // to jump to here. + if (patch_b) { + patchRelativeBranch(patch_b, mip); + } + } + + if (need_rest) { + // If the method signature ends with "...", + // deliver any arguments after the explicitly + // specified ones as (Atom *argv, int argc) + + // rest_count = argc-param_count + CMPI (CR7, ARGC, info->param_count); + + // rest_count could be <0 if optionals omitted + uint32 *patch_bge = mip; + BGE (CR7, 0, true); + + // rest_count<0, push argc=0, argv=NULL + + // push argc + if (GPRIndex < kMaxGPRIndex) { + LI((Register)(R3+GPRIndex), 0); + } else { + LI(R0, 0); + STW(R0, kArgumentOffset+4*GPRIndex, SP); + } + + // push argv + if (GPRIndex < kMaxGPRIndex) { + LI((Register)(R3+GPRIndex+1), 0); + } else { + LI(R0, 0); + STW(R0, kArgumentOffset+4*(GPRIndex+1), SP); + } + + uint32* patch_b = mip; + B (0); + patchRelativeBranch(patch_bge, mip); + + // rest_count>=0 + // push rest_count + // push rest_argv = argv+param_count + + // push argv + if (GPRIndex < kMaxGPRIndex) { + ADDI((Register)(R3+GPRIndex), AP, info->restOffset); + } else { + ADDI(R0, AP, info->restOffset); + STW(R0, kArgumentOffset+4*GPRIndex, SP); + } + GPRIndex++; + + // push argc + if (GPRIndex < kMaxGPRIndex) { + SI((Register)(R3+GPRIndex), ARGC, info->param_count); + } else { + SI(R0, ARGC, info->param_count); + STW(R0, kArgumentOffset+4*GPRIndex, SP); + } + GPRIndex++; + + patchRelativeBranch(patch_b, mip); + } + + // all args have been pushed, now call function using thiscall calling conventions + Traits* type = info->returnTraits(); + +#if !TARGET_RT_MAC_MACHO + int handler_addr = nativeHandlerAddr(info->m_handler); +#else + union { + int handler_addr; + NativeMethod::Handler handler; + }; + handler = info->m_handler; +#endif + + thincall(handler_addr); + +#ifdef DEBUGGER + // ARGC uses R30, but we don't use ARGC after this + // point of the code, so reuse R30 for SAVE_RETURN. + const Register SAVE_RETURN = R30; + + if (type == NUMBER_TYPE) + { + // result is in F1. Store it away on the stack. + STFD(F1,12,SP); + } + else + { + // result is in R3. Store it in SAVE_RETURN. + MR(SAVE_RETURN, R3); + } + + int nodePos = kLinkageAreaSize + 4* MAX(GPRIndex, kMinCalledParamCount); // GPRIndex MUST not change beyond this line + + MR(R3, ENV); + ADDI(R4, SP, nodePos); // CallStackNode + thincall(ENVADDR(MethodEnv::debugExit)); + + if (type == NUMBER_TYPE) + { + LFD(F1,12,SP); + } + else + { + // move return value back to R3. + MR(R3, SAVE_RETURN); + } +#endif + + if (type != NUMBER_TYPE) + { + // result in R3 + if (type == BOOLEAN_TYPE) + { + // return value already in R3 + // bool is just a byte, so mask it off + ANDI_dot (R3, R3, 0xFF); + } + else if (type == VOID_TYPE) + { + LI (R3, undefinedAtom); + } + } + // else, result in FPU register F1 + + // epilogue + LWZ (SP, 0, SP); + LWZ (R0, 8, SP); + MTLR (R0); + LMW ((Register)(32-kGPRSaveCount), -kGPRSaveCount*4, SP); + BLR (); + + // Patch up the frame size. + // For each arg, we need 4 bytes in the called parameter + // area. We also leave a little cushion in the called + // parameter area, since there are a few other function + // calls the thunk makes (intToAtom, doubleToAtom) + int frameSize = (kLinkageAreaSize+ + kGPRSaveCount*4+ + kLocalVarSize+ + 4 * MAX( kMinCalledParamCount, GPRIndex ) + ); + + // The PowerPC stack pointer must always be quadword (16-byte) + // aligned. + frameSize = BIT_ROUND_UP(frameSize, 16); + + *patch_stwu |= (-frameSize & 0xFFFF); + +#ifdef DEBUGGER + *patch_addi |= nodePos; +#endif /* DEBUGGER */ + + bindMethod(info); + +#ifndef AVMPLUS_JIT_READONLY + // Tell the OS that this buffer contains executable code. + // This is required since machines like the G4 have dual + // cache designs. + MakeDataExecutable(mipStart, (int)mip-(int)mipStart); +#endif /* AVMPLUS_JIT_READONLY */ + } + +#if defined(_MAC) && !TARGET_RT_MAC_MACHO + static uint32 get_rtoc() + { + asm { mr r3, r2; } + } +#endif + + void* CodegenMIR::emitImtThunk(ImtBuilder::ImtEntry *e) + { + mip = mipStart = (MDInstruction*)getMDBuffer(pool); + +#ifdef FEATURE_BUFFER_GUARD + GrowthGuard guard(pool->codeBuffer); +#else + if (!ensureMDBufferCapacity(pool, md_native_thunk_size)) + return NULL; +#endif /* FEATURE_BUFFER_GUARD */ + + // the generated thunk does not call any helper methods, so we are + // free to use eax, ecx, edx as scratch regs without touchning the + // stack. + + // in: R6 = iid + // R3 = MethodEnv + // R4 = argc + // R5 = ap + // 0(ap) = ScriptObject (concrete instance of class) + + // local register allocation: + // R7 = iid parameter + // R8 = vtable of receiver obj + // R9 = temp + +#ifdef AVMPLUS_VERBOSE + if (pool->verbose) + { + core->console << "imt thunk\n"; + } +#endif + + LWZ (R9, 0, R5); // obj + LWZ (R8, offsetof(ScriptObject, vtable), R9); // vtable + + AvmAssert(e->next != NULL); // must have 2 or more entries + + while (e->next) + { + ImtBuilder::ImtEntry *next = e->next; + + #ifdef AVMPLUS_VERBOSE + if (pool->verbose) + { + core->console << " disp_id="<< e->disp_id << " " << e->virt << "\n"; + } + #endif + int iid = e->virt->iid(); + if (isUIMM(iid)) + { + CMPI (CR0, R6, iid); + } + else + { + LI32(R0, iid); + CMP (CR0, R6, R0); + } + + MDInstruction* patchip = mip; + BNE (CR0, 0); + LWZ (R3, offsetof(VTable,methods)+4*e->disp_id, R8); // load concrete env + LWZ (R12, offsetof(MethodEnv, impl32), R3); // invoke real method indirectly + #if !TARGET_RT_MAC_MACHO + LWZ (R0, 0, R12); + MTCTR (R0); + #else + MTCTR (R12); + #endif + BCTR (); + patchRelativeBranch(patchip, mip); + + pool->core->GetGC()->Free(e); + e = next; + } + + // last one is unconditional + #ifdef AVMPLUS_VERBOSE + if (pool->verbose) + { + core->console << " disp_id="<< e->disp_id << " " << e->virt << "\n"; + } + #endif + LWZ (R3, offsetof(VTable,methods)+4*e->disp_id, R8); // load concrete env + LWZ (R12, offsetof(MethodEnv, impl32), R3); // invoke real method indirectly + #if !TARGET_RT_MAC_MACHO + LWZ (R0, 0, R12); + MTCTR (R0); + #else + MTCTR (R12); + #endif + BCTR (); + + MDInstruction *retval; + +#if !TARGET_RT_MAC_MACHO + // Write the code pointer for the ABI's benefit + mip = (MDInstruction*) ((size_t)mip+7 & ~7); // align on 8 + *mip++ = (uint32)mipStart; + *mip++ = get_rtoc(); + + retval = mip-2; +#else + retval = mipStart; +#endif + +#ifndef AVMPLUS_JIT_READONLY + // Tell the OS that this buffer contains executable code. + // This is required since machines like the G4 have dual + // cache designs. + MakeDataExecutable(mipStart, (int)mip-(int)mipStart); +#endif /* AVMPLUS_JIT_READONLY */ + +#ifdef AVMPLUS_JIT_READONLY + makeCodeExecutable(); +#endif /* AVMPLUS_JIT_READONLY */ + + // lock in the next available location in the buffer (16B aligned) + pool->codeBuffer->setPos((byte*) ( (size_t)mip+15 & ~15 )); + + return retval; + } + +#endif // AVMPLUS_PPC +} diff --git a/mozilla/js/tamarin/core/AbcData.cpp b/mozilla/js/tamarin/core/AbcData.cpp new file mode 100644 index 00000000000..945aea325ff --- /dev/null +++ b/mozilla/js/tamarin/core/AbcData.cpp @@ -0,0 +1,38 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#include "avmplus.h" +namespace avmplus +{ + namespace NativeID { + #include "builtin.cpp" + } +} diff --git a/mozilla/js/tamarin/core/AbcEnv.cpp b/mozilla/js/tamarin/core/AbcEnv.cpp new file mode 100644 index 00000000000..58b4ac6855f --- /dev/null +++ b/mozilla/js/tamarin/core/AbcEnv.cpp @@ -0,0 +1,58 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#include "avmplus.h" + +namespace avmplus +{ + ScriptEnv* AbcEnv::getScriptEnv(Stringp name, Namespacep ns) + { + if(ns->isPrivate()) + { + return (ScriptEnv*)privateScriptEnvs.get(name, ns); + } + else + { + return (ScriptEnv*)domainEnv->getScriptInit(ns, name); + } + } + + ScriptEnv* AbcEnv::getScriptEnv(Multiname *multiname) + { + ScriptEnv *se = (ScriptEnv*)domainEnv->getScriptInit(multiname); + if(!se) + { + // check privates + se = (ScriptEnv*)privateScriptEnvs.getMulti(multiname); + } + return se; + } +} diff --git a/mozilla/js/tamarin/core/AbcEnv.h b/mozilla/js/tamarin/core/AbcEnv.h new file mode 100644 index 00000000000..9ba7913d07e --- /dev/null +++ b/mozilla/js/tamarin/core/AbcEnv.h @@ -0,0 +1,77 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_AbcEnv__ +#define __avmplus_AbcEnv__ + + +namespace avmplus +{ + + // runtime info associated with a pool + class AbcEnv : public MMgc::GCObject + { + public: + PoolObject* const pool; + DomainEnv* const domainEnv; + CodeContext* const codeContext; + MultinameHashtable privateScriptEnvs; + MethodEnv* methods[1]; // actual size will hold pool->methodCount methods + + AbcEnv(PoolObject* pool, + DomainEnv* domainEnv, + CodeContext *codeContext) + : pool(pool), + domainEnv(domainEnv), + codeContext(codeContext) + { + } + + void setMethod(int i, MethodEnv* env) + { + WB(pool->core->GetGC(), this, &methods[i], env); + } + + static size_t calcExtra(PoolObject* pool) + { + if (pool->methodCount <= 1) + return 0; + else + return sizeof(MethodEnv*)*(pool->methodCount-1); + } + + ScriptEnv* getScriptEnv(Stringp name, Namespacep ns); + ScriptEnv* getScriptEnv(Multiname *m); + }; + +} + +#endif // __avmplus_AbcEnv__ diff --git a/mozilla/js/tamarin/core/AbcGen.cpp b/mozilla/js/tamarin/core/AbcGen.cpp new file mode 100644 index 00000000000..b5a0df40fc3 --- /dev/null +++ b/mozilla/js/tamarin/core/AbcGen.cpp @@ -0,0 +1,84 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmplus.h" + +namespace avmplus +{ + void AbcGen::writeInt(unsigned int v) + { + if( v < 128 ) + { + bytes.add((byte)v); + } + else if ( v < 16384 ) + { + byte first = (byte)((v & 0x7F) | 0x80); + byte second = (byte)(v>>7); + bytes.add(first); + bytes.add(second); + } + else if ( v < 2097152 ) + { + byte first = (byte)((v & 0x7F) | 0x80); + byte second = (byte)(v>>7 | 0x80); + byte third = (byte)(v>>14); + bytes.add(first); + bytes.add(second); + bytes.add(third); + } + else if ( v < 268435456 ) + { + byte first = (byte)((v & 0x7F) | 0x80); + byte second = (byte)(v>>7 | 0x80); + byte third = (byte)(v>>14 | 0x80); + byte fourth = (byte) ( v >>21 ); + bytes.add(first); + bytes.add(second); + bytes.add(third); + bytes.add(fourth); + } + else + { + byte first = (byte)((v & 0x7F) | 0x80); + byte second = (byte)(v>>7 | 0x80); + byte third = (byte)(v>>14 | 0x80); + byte fourth = (byte) (v >>21 | 0x80); + byte fifth = (byte) (v >> 28); + bytes.add(first); + bytes.add(second); + bytes.add(third); + bytes.add(fourth); + bytes.add(fifth); + } + } +} diff --git a/mozilla/js/tamarin/core/AbcGen.h b/mozilla/js/tamarin/core/AbcGen.h new file mode 100644 index 00000000000..14e45f4afcf --- /dev/null +++ b/mozilla/js/tamarin/core/AbcGen.h @@ -0,0 +1,73 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_AbcGen__ +#define __avmplus_AbcGen__ + + +namespace avmplus +{ + class AbcGen + { + public: + /** + * construct an abc code gen buffer with the given initial capacity + */ + AbcGen(MMgc::GC *gc, int initCapacity=128) : bytes(gc, initCapacity) {} + + List& getBytes() { return bytes; } + void construct_super() { bytes.add(OP_constructsuper); } + void pushnan() { bytes.add(OP_pushnan); } + void pushundefined() { bytes.add(OP_pushundefined); } + void pushnull() { bytes.add(OP_pushnull); } + void pushtrue() { bytes.add(OP_pushtrue); } + void pushconstant(CPoolKind kind, int index) + { + // AbcParser should already ensure kind is legal value. + AvmAssert(kind >=0 && kind <= CONSTANT_StaticProtectedNs && kindToPushOp[kind] != 0); + int op = kindToPushOp[kind]; + bytes.add((byte)op); + if(opOperandCount[op] > 0) + writeInt(index); + } + void getlocalN(int N) { bytes.add((byte)(OP_getlocal0+N)); } + void setslot(int slot) { bytes.add(OP_setslot); writeInt(slot+1); } + void abs_jump(const byte *pc, int code_length) { bytes.add(OP_abs_jump); writeInt((unsigned int)pc); writeInt(code_length); } + void returnvoid() { bytes.add(OP_returnvoid); } + void writeBytes(List& b) { bytes.add(b); } + void writeInt(unsigned int n); + size_t size() { return bytes.size(); } + private: + List bytes; + }; +} + +#endif // __avmplus_MethodEnv__ diff --git a/mozilla/js/tamarin/core/AbcParser.cpp b/mozilla/js/tamarin/core/AbcParser.cpp new file mode 100644 index 00000000000..d0b0428f0ca --- /dev/null +++ b/mozilla/js/tamarin/core/AbcParser.cpp @@ -0,0 +1,1986 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 1993-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmplus.h" + +namespace avmplus +{ + /** + * parse a .abc file completely + * @param code + * @return + */ + PoolObject* AbcParser::decodeAbc(AvmCore* core, ScriptBuffer code, + Toplevel* toplevel, + Domain* domain, + AbstractFunction *nativeMethods[], + NativeClassInfo *nativeClasses[], + NativeScriptInfo *nativeScripts[]) + { + if (code.getSize() < 4) + toplevel->throwVerifyError(kCorruptABCError); + + int version = AvmCore::readU16(&code[0]) | AvmCore::readU16(&code[2])<<16; + + #ifdef AVMPLUS_PROFILE + DynamicProfiler::StackMark mark(OP_decode, &core->dprof); + #endif + + #ifdef AVMPLUS_VERBOSE + if (core->verbose) + core->console << "major=" << (version&0xFFFF) << " minor=" << (version>>16) << "\n"; + #endif + + switch (version) + { + case (46<<16|16): + { + AbcParser parser(core, code, toplevel, domain, nativeMethods, nativeClasses, nativeScripts); + PoolObject *pObject = parser.parse(); + if ( !pObject ) + toplevel->throwVerifyError( kCorruptABCError ); + else + return pObject; + } + default: + toplevel->throwVerifyError(kInvalidMagicError, core->toErrorString(version>>16), core->toErrorString(version&0xFFFF)); + return NULL; + } + } + + AbcParser::AbcParser(AvmCore* core, ScriptBuffer code, + Toplevel* toplevel, + Domain* domain, + AbstractFunction *nativeMethods[], + NativeClassInfo *nativeClasses[], + NativeScriptInfo *nativeScripts[]) + : toplevel(toplevel), + domain(domain), + instances(core->GetGC(), 0) + { + this->core = core; + this->code = code; + this->pool = NULL; + this->version = AvmCore::readU16(&code[0]) | AvmCore::readU16(&code[2])<<16; + this->pos = &code[4]; + this->nativeMethods = nativeMethods; + this->nativeClasses = nativeClasses; + this->nativeScripts = nativeScripts; + + abcStart = &code[0]; + abcEnd = &code[(int)code.getSize()]; + + classCount = 0; + metaNames = NULL; + } + + AbcParser::~AbcParser() + { + if (metaNames) + core->GetGC()->Free(metaNames); + } + + int AbcParser::computeInstanceSize(int class_id, + Traits* base) const + { + // If this is a native class, return the stated instance size + NativeClassInfo* nativeEntry; + if (nativeClasses && (nativeEntry = nativeClasses[class_id]) != 0) + { + return nativeEntry->sizeofInstance; + } + + // Search the inheritance chain for any native classes. + while (base) + { + if (base->sizeofInstance > sizeof(ScriptObject)) + { + // non-Object base class uses a subclass of ScriptObject, so use that size. + return base->sizeofInstance; + } + base = base->base; + } + + // no derived native classes found + return sizeof(ScriptObject); + } + + Namespace* AbcParser::parseNsRef(const byte* &pc) const + { + uint32 index = readU30(pc); + if (index == 0) + { + return NULL; // AnyNamespace + } + + if (index >= pool->constantNsCount) + toplevel->throwVerifyError(kCpoolIndexRangeError, core->toErrorString(index), core->toErrorString(pool->constantNsCount)); + return pool->cpool_ns[index]; + } + + #ifdef AVMPLUS_VERBOSE + void AbcParser::parseTypeName(const byte* &pc, Multiname& m) const + { + // only save the type name for now. verifier will resolve to traits + uint32 index = readU30(pc); + if (index == 0) + { + // type is * + m.setNamespace(core->publicNamespace); + m.setName(core->kAsterisk); + return; + } + + if (index >= pool->constantMnCount) + toplevel->throwVerifyError(kCpoolIndexRangeError, core->toErrorString(index), core->toErrorString(pool->constantMnCount)); + + pool->parseMultiname(m, index); + } + #endif + + Atom AbcParser::resolveQName(const byte* &p, Multiname &m) const + { + uint32 index = readU30(p); + if (index == 0 || index >= pool->constantMnCount) + toplevel->throwVerifyError(kCpoolIndexRangeError, core->toErrorString(index), core->toErrorString(pool->constantCount)); + + Atom a = pool->cpool_mn[index]; + + pool->parseMultiname(a, m); + if (!m.isQName()) + toplevel->throwVerifyError(kCpoolEntryWrongTypeError, core->toErrorString(index)); + + return a; + } + + AbstractFunction *AbcParser::resolveMethodInfo(uint32 index) const + { + if (index >= pool->methodCount) + toplevel->throwVerifyError(kMethodInfoExceedsCountError, core->toErrorString(index), core->toErrorString(pool->methodCount)); + + AbstractFunction *f = pool->getMethodInfo(index); + if (!f) + toplevel->throwVerifyError(kMethodInfoOrderError, core->toErrorString(index)); + + return f; + } + + Stringp AbcParser::resolveUtf8(uint32 index) const + { + if (index > 0 && index < pool->constantStringCount ) + { + return pool->cpool_string[index]; + } + toplevel->throwVerifyError(kCpoolIndexRangeError, core->toErrorString(index), core->toErrorString(pool->constantStringCount)); + return NULL; + } + + Stringp AbcParser::parseName(const byte* &pc) const + { + uint32 index = readU30(pc); + if (index == 0) + return NULL; + return resolveUtf8(index); + } + + PoolObject* AbcParser::parse() + { +#ifdef FEATURE_BUFFER_GUARD // no Carbon + TRY(this->core, kCatchAction_Rethrow) + { + // catches any access violation exceptions and sends control to + // the CATCH block below. + BufferGuard guard(_ef.jmpbuf); + this->guard = &guard; + +#endif // FEATURE_BUFFER_GUARD + + // constant pool + parseCpool(); + + // parse all methodInfos in one pass. Nested functions must come before outer functions + parseMethodInfos(); + + // parse all metadataInfos - AVM+ doesn't care about this, so we are really just skipping them + parseMetadataInfos(); + + // parse classes. base classes must come first. + if (!parseInstanceInfos()) return NULL; + + bool first = false; + if (CLASS_TYPE == NULL) + { + // if we haven't got types from the builtin file yet, do it now. + first = true; + core->traits.initInstanceTypes(pool); + + // register "void" + addNamedTraits(core->publicNamespace, VOID_TYPE->name, VOID_TYPE); + + // temporary: register "Void" + addNamedTraits(core->publicNamespace, core->constantString("Void"), VOID_TYPE); + } + + // type information about class objects + parseClassInfos(); + + if (first) + { + core->traits.initClassTypes(pool); + } + + // scripts + if( !parseScriptInfos() ) return NULL; + + // method bodies: code, exception info, and activation traits + parseMethodBodies(); +#ifdef FEATURE_BUFFER_GUARD // no buffer guard in Carbon builds + } + CATCH(Exception *exception) + { + guard->disable(); + guard = NULL; + if( exception->isValid()) + // Re-throw if exception exists + core->throwException(exception); + else + // create new exception + toplevel->throwVerifyError(kCorruptABCError); + } + END_CATCH + END_TRY +#endif // FEATURE_BUFFER_GUARD + + return pool; + } + + /** + * setting up a traits that extends another one. Two parser passes are required, + * one for sizing the traits object and the other for allocating it and filling + * it in. + */ + Traits* AbcParser::parseTraits(Traits* base, Namespace* ns, Stringp name, AbstractFunction* script, int interfaceDelta, Namespace* protectedNamespace /*=NULL*/) + { + const byte* traits_pos = pos; + int nameCount = readU30(pos); + + #ifdef AVMPLUS_VERBOSE + if (pool->verbose) + core->console << " trait_count=" << nameCount << "\n"; + #endif + + Traits* traits = core->newTraits(base, nameCount, interfaceDelta, sizeof(ScriptObject)); + + traits->setTraitsPos(traits_pos); + traits->ns = ns; + traits->name = name; + traits->pool = pool; + traits->protectedNamespace = protectedNamespace; + + // Copy protected traits from base class into new protected namespace + if (base && base->protectedNamespace && protectedNamespace) + { + for (int i=0; (i = base->next(i)) != 0; ) + { + if (base->nsAt(i) == base->protectedNamespace) + { + traits->add(base->keyAt(i), protectedNamespace, base->valueAt(i)); + } + } + } + + uint32 slotCount, methodCount; + if (base) + { + slotCount = base->slotCount; + methodCount = base->methodCount; + } + else + { + slotCount = 0; + methodCount = 0; + } + + bool earlySlotBinding; + + pool->allowEarlyBinding(base, earlySlotBinding); + + for (int i=0; i < nameCount; i++) + { + Multiname qn; + resolveQName(pos, qn); + Namespace* ns = qn.getNamespace(); + // TODO name can come out null and fire all kinds of asserts from a broken compiler + // and crash a release build, not sure if null is valid in any cases but there's definitely + // a missing verify error here somewhere + Stringp name = qn.getName(); +#ifdef SAFE_PARSE + // check to see if we are trying to read past the file end or the beginning. + if (pos < abcStart || pos >= abcEnd ) + toplevel->throwVerifyError(kCorruptABCError); +#endif //SAFE_PARSE + int tag = *pos++; + TraitKind kind = (TraitKind) (tag & 0x0f); + + AbstractFunction *f = NULL; + switch (kind) + { + case TRAIT_Slot: + case TRAIT_Const: + case TRAIT_Class: + case TRAIT_Function: + { + uint32 slot_id = readU30(pos); + if (!earlySlotBinding) slot_id = 0; + if (!slot_id) + { + // vm assigns slot + slot_id = slotCount++; + } + else + { + // compiler assigned slot + if (slot_id > slotCount) + slotCount = slot_id; + slot_id--; + } + + if (base && slot_id < base->slotCount) + { + // slots are final. + toplevel->throwVerifyError(kIllegalOverrideError, core->toErrorString(&qn), core->toErrorString(base)); + } + + // a slot cannot override anything else. + if (traits->get(name, ns) != BIND_NONE) + toplevel->throwVerifyError(kCorruptABCError); + + if (script) + addNamedScript(ns, name, script); + + if( kind == TRAIT_Slot || kind == TRAIT_Const) + { + #ifdef AVMPLUS_VERBOSE + // type name + Multiname typeName; + parseTypeName(pos, typeName); + + // default value index + int value_index = readU30(pos); + CPoolKind value_kind; + if( value_index ) + { +#ifdef SAFE_PARSE + // check to see if we are trying to read past the file end or the beginning. + if (pos < abcStart || pos >= abcEnd ) + toplevel->throwVerifyError(kCorruptABCError); +#endif //SAFE_PARSE + value_kind = (CPoolKind)*(pos++); + } + if (pool->verbose) + { + core->console << " " << traitNames[kind] + << " name=" << Multiname::format(core,ns,name) + << " slot_id=" << slot_id + << " value_index=" << value_index + << " type=" << &typeName + << "\n"; + } + #else + readU30(pos); // type + int value_index = readU30(pos); // default value + if( value_index ) + { + pos++; // byte for the value kind + } + #endif + + // create a binding + // only touches hashtable + traits->defineSlot(name, ns, + slot_id, kind==TRAIT_Slot ? BIND_VAR : BIND_CONST); + + } + else if (kind == TRAIT_Class) + { + // get the class type + int class_info = readU30(pos); + if (class_info >= classCount) + toplevel->throwVerifyError(kClassInfoExceedsCountError, core->toErrorString(class_info), core->toErrorString(classCount)); + + AbstractFunction* cinit = pool->cinits[class_info]; + if (!cinit) + toplevel->throwVerifyError(kClassInfoOrderError, core->toErrorString(class_info)); + + Traits* ctraits = cinit->declaringTraits; + + #ifdef AVMPLUS_VERBOSE + if (pool->verbose) + { + core->console << " " << traitNames[kind] + << " name=" << Multiname::format(core, ns, name) + << " slot_id=" << slot_id + << " type=" << ctraits + << "\n"; + } + #endif + + if (script) + { + // promote instance type to the vm-wide type table. + Traits* itraits = ctraits->itraits; + + // map type name to traits + addNamedTraits(ns, name, itraits); + + if ( tag & ATTR_metadata ) + { + itraits->setMetadataPos(pos); + } + } + else + { + if ( tag & ATTR_metadata ) + { + ctraits->setMetadataPos(pos); + } + } + + // create a binding + // only touches hashtable + traits->defineSlot(name, ns, slot_id, BIND_CONST); + + } + else + { + AvmAssert(kind == TRAIT_Function); + uint32 method_info = readU30(pos); // method_info + + #ifdef AVMPLUS_VERBOSE + if (pool->verbose) + { + core->console << " " << traitNames[kind] + << " name=" << Multiname::format(core, ns, name) + << " slot_id=" << slot_id + << " method_info=" << method_info + << "\n"; + } + #endif + + AbstractFunction* f = resolveMethodInfo(method_info); + f->makeIntoPrototypeFunction(toplevel); + + // create binding + traits->defineSlot(name, ns, slot_id, BIND_VAR); + } + break; + } + case TRAIT_Getter: + case TRAIT_Setter: + case TRAIT_Method: + { + int earlyDispId = readU30( pos ); + (void)earlyDispId; + uint32 method_info = readU30(pos); + + #ifdef AVMPLUS_VERBOSE + if (pool->verbose) + { + core->console << " " << traitNames[kind] + << " name=" << Multiname::format(core, ns, name) + << " disp_id=" << earlyDispId << " (ignored)" + << " method_info=" << method_info + << " attr=" << ((tag&ATTR_final)?"final":"virtual"); + if (tag&ATTR_override) + core->console << "|override"; + core->console << "\n"; + } + #endif + + f = resolveMethodInfo(method_info); + + #ifdef AVMPLUS_VERBOSE + Stringp s1 = traits->format(core); + Stringp s2 = core->newString(kind == TRAIT_Method ? "/" : (kind == TRAIT_Getter ? "/get " : "/set ")); + Stringp s3 = Multiname::format(core,ns,name); + Stringp s4 = core->concatStrings(s2,s3); + f->name = core->concatStrings(s1, s4); + //delete s1 - can't delete, it may bet the traits name string; + delete s2; + //delete s3 - can't delete, it may be the qname name string; + delete s4; + #endif + + // since this function is ref'ed here, we know the receiver type. + if (!f->makeMethodOf(traits)) + { + toplevel->throwVerifyError(kCorruptABCError); + } + + if (tag & ATTR_final) + f->flags |= AbstractFunction::FINAL; + + if (tag & ATTR_override) + f->flags |= AbstractFunction::OVERRIDE; + + Binding baseBinding = traits->getOverride(ns, name, tag, toplevel); + + // issue can you ever import a getter/setter? + // is it okay to call this more than once on the same + // name/script pair? + + // only export one name for an accessor + if (script && !domain->getNamedScript(name,ns)) + addNamedScript(ns, name, script); + + if (kind == TRAIT_Method) + { + if (baseBinding == BIND_NONE) + { + traits->defineSlot(name, ns, methodCount, BIND_METHOD); + // accessors require 2 vtable slots, methods only need 1. + methodCount ++; + } + else if (AvmCore::isMethodBinding(baseBinding)) + { + // something got overridden, need new name entry for this subclass + // but keep the existing disp_id + int disp_id = AvmCore::bindingToMethodId(baseBinding); + traits->defineSlot(name, ns, disp_id, BIND_METHOD); + } + else + { + toplevel->throwVerifyError(kCorruptABCError); + } + } + else if (kind == TRAIT_Getter) + { + // if nothing in base class, look for existing binding on this class, + // in case setter has already been defined. + if (baseBinding == BIND_NONE) + baseBinding = traits->get(name, ns); + + if (baseBinding == BIND_NONE) + { + traits->defineSlot(name, ns, methodCount, BIND_GET); + // accessors require 2 vtable slots, methods only need 1. + methodCount += 2; + } + else if (AvmCore::isAccessorBinding(baseBinding)) + { + // something maybe got overridden, need new name entry for this subclass + // but keep the existing disp_id + int disp_id = urshift(baseBinding,3); + int bkind = baseBinding & 7; + if (bkind == BIND_SET) + bkind = BIND_GETSET; + traits->defineSlot(name, ns, disp_id, bkind); + } + else + { + toplevel->throwVerifyError(kCorruptABCError); + } + } + else // TRAIT_Setter + { + // if nothing in base class, look for existing binding on this class, + // in case getter has already been defined. + if (baseBinding == BIND_NONE) + baseBinding = traits->get(name, ns); + + if (baseBinding == BIND_NONE) + { + traits->defineSlot(name, ns, methodCount, BIND_SET); + // accessors require 2 vtable slots, methods only need 1. + methodCount += 2; + } + else if (AvmCore::isAccessorBinding(baseBinding)) + { + // something maybe got overridden, need new name entry for this subclass + // but keep the existing disp_id + // both get & set bindings use the get id. set_id = get_id + 1. + int disp_id = urshift(baseBinding,3); + int bkind = baseBinding & 7; + if (bkind == BIND_GET) + bkind = BIND_GETSET; + traits->defineSlot(name, ns, disp_id, bkind); + } + else + { + toplevel->throwVerifyError(kCorruptABCError); + } + } + break; + } + + default: + // unsupported traits type + toplevel->throwVerifyError(kUnsupportedTraitsKindError, core->toErrorString(kind)); + } + + if ( tag & ATTR_metadata ) + { + int metadataCount = readU30(pos); + for( int metadata = 0; metadata < metadataCount; ++metadata) + { + int index = readU30(pos); + Stringp name = metaNames[index]; + if (name == core->kNeedsDxns && f != NULL) + f->flags |= AbstractFunction::NEEDS_DXNS; +#ifdef AVMPLUS_VERBOSE + if (name == kVerboseVerify && f != NULL) + f->flags |= AbstractFunction::VERBOSE_VERIFY; + if (pool->verbose) + core->console << " [" << metaNames[index] << "]\n"; +#endif + } + } + } + + traits->slotCount = slotCount; + traits->methodCount = methodCount; + return traits; + } + + void AbcParser::parseMethodInfos() + { + int methodCount = readU30(pos); + +#ifdef AVMPLUS_VERBOSE + if (pool->verbose) + core->console << "method_count=" << methodCount << "\n"; +#endif + + int size = methodCount == 0 ? 1 : methodCount; + + if (size > (abcEnd - pos)) + toplevel->throwVerifyError(kCorruptABCError); + + MMGC_MEM_TYPE(pool); + pool->methods.ensureCapacity(size); + pool->methodCount = methodCount; + +#if defined(AVMPLUS_PROFILE) || defined(AVMPLUS_VERBOSE) || defined(DEBUGGER) + const byte* startpos = pos; +#endif + + for (int i=0; i < methodCount; i++) + { +#ifdef AVMPLUS_VERBOSE + int offset = pos-startpos; +#endif + // MethodInfo + int param_count = readU30(pos); + + const byte* info_pos = pos; + + #ifdef AVMPLUS_VERBOSE + Multiname returnTypeName; + parseTypeName(pos, returnTypeName); + if (pool->verbose) + { + core->console << " " << offset << ":method["<verbose) + core->console << " paramType["<= abcEnd ) + toplevel->throwVerifyError(kCorruptABCError); +#endif //SAFE_PARSE + int flags = *pos++; + +#ifdef AVMPLUS_VERBOSE + if (pool->verbose) + { + core->console << " name_index=" << name_index; + if (name_index > 0 && name_index < pool->constantStringCount) + core->console << " \"" << pool->cpool_string[name_index] << "\""; + core->console << "\n flags=" << flags << "\n"; + } +#endif + + AbstractFunction *info; + if (!(flags & AbstractFunction::NATIVE)) + { + MethodInfo *methodInfo = new (core->GetGC()) MethodInfo(); + + #ifdef AVMPLUS_VERBOSE + if (name_index != 0) + methodInfo->name = resolveUtf8(name_index); + else + methodInfo->name = core->concatStrings(core->newString("MethodInfo-"), core->intToString(i)); + #endif + info = methodInfo; + } + else + { + if (!nativeMethods) + { + toplevel->throwVerifyError(kIllegalNativeMethodError); + } + info = nativeMethods[i]; + + // If this assert hits, you're missing a native method. Method "i" + // corresponds to the function of the same number in + // source\avmglue\avmglue.h if you're running the Flash player. + AvmAssertMsg(info != 0, "missing native method decl"); + + // todo assert that the .abc signature matches the C++ code? + info->flags |= AbstractFunction::ABSTRACT_METHOD; + } + + info->info_pos = info_pos; + info->pool = pool; + info->method_id = i; + info->param_count = param_count; + info->initParamTypes(param_count+1); + info->flags |= flags; + + if (flags & AbstractFunction::HAS_OPTIONAL) + { + int optional_count = readU30(pos); + + info->optional_count = optional_count; + for( int j = 0; j < optional_count; ++j) + { + readU30(pos); + ++pos; // Kind bytes for each default value + } + + if (optional_count > param_count) + { + // cannot have more optional params than total params + toplevel->throwVerifyError(kCorruptABCError); + } + } + + if( flags & AbstractFunction::HAS_PARAM_NAMES) + { + // AVMPlus doesn't care about the param names, just skip past them + for( int j = 0; j < info->param_count; ++j ) + { + readU30(pos); + } + } + + // save method info pointer. we will verify code later. + pool->methods.set(i, info); + } + #ifdef AVMPLUS_PROFILE + core->sprof.methodsSize += (pos-startpos); + #endif + } + + + void AbcParser::parseMetadataInfos() + { + int metadataCount = readU30(pos); + +#ifdef AVMPLUS_VERBOSE + if (pool->verbose) + core->console << "metadata_count=" << metadataCount << "\n"; +#endif + + if (metadataCount > (abcEnd - pos)) + toplevel->throwVerifyError(kCorruptABCError); + + pool->metadata_infos.ensureCapacity(metadataCount); + pool->metadataCount = metadataCount; + + if (metadataCount > 0) + { + metaNames = (Stringp*) core->GetGC()->Calloc(metadataCount, sizeof(Stringp), MMgc::GC::kContainsPointers); + +#ifdef AVMPLUS_VERBOSE + kVerboseVerify = core->constantString("VerboseVerify"); +#endif + + for (int i=0; i < metadataCount; i++) + { + pool->metadata_infos.set(i, pos); + // MetadataInfo + uint32 index = readU30(pos); + Stringp name = resolveUtf8(index); + // constant pool names are stuck and always reachable via PoolObject, DRC or WB + metaNames[i] = name; + +#ifdef AVMPLUS_VERBOSE + if (pool->verbose) + core->console << " " << name; + int values_count = readU30(pos); + if (values_count > 0) + { + if (pool->verbose) + core->console << "("; + for(int q = 0; q < values_count; ++q) + { + int a = readU30(pos); + int b = readU30(pos); + if (pool->verbose) + { + core->console << a << "," << b; + if (q+1 < values_count) + core->console << " "; + } + } + if (pool->verbose) + core->console << ")"; + } + if (pool->verbose) + core->console << "\n"; + +#else // AVMPLUS_VERBOSE + + // MetadataInfo + int values_count = readU30(pos); + for(int q = 0; q < values_count; ++q) + { + readU30(pos); + readU30(pos); + } + +#endif // AVMPLUS_VERBOSE + } + } + +#ifdef AVMPLUS_VERBOSE +//StaticProfiler::methodsSize += (pos-startpos); +#endif + } + + void AbcParser::parseMethodBodies() + { + int bodyCount = readU30(pos); + +#ifdef AVMPLUS_VERBOSE + if (pool->verbose) + core->console << "bodies_count=" << bodyCount << "\n"; +#endif + +#if defined(AVMPLUS_PROFILE) || defined(AVMPLUS_VERBOSE) || defined(DEBUGGER) + const byte* startpos = pos; +#endif + + for (int i=0; i < bodyCount; i++) + { +#ifdef AVMPLUS_VERBOSE + int offset = pos-startpos; +#endif + + uint32 method_info = readU30(pos); + AbstractFunction* info = resolveMethodInfo(method_info); + + const byte *body_pos = pos; + + int max_stack = readU30(pos); + (void)max_stack; + + int local_count = readU30(pos); + + if (local_count < info->param_count+1) + { + // must have enough locals to hold all parameters including this + toplevel->throwVerifyError(kCorruptABCError); + } + + // TODO change file format, just want local max_scope + int init_scope_depth = readU30(pos); + (void)init_scope_depth; + + int max_scope_depth = readU30(pos); + (void)max_scope_depth; + + int code_length = readU30(pos); + + + if (code_length <= 0) + { + toplevel->throwVerifyError(kInvalidCodeLengthError, core->toErrorString(code_length)); + } + + // check to see if we are trying to jump past the file end or the beginning. + if ( pos < abcStart || pos+code_length >= abcEnd ) + toplevel->throwVerifyError(kCorruptABCError); + pos += code_length; + + int exception_count = readU30(pos); + + #ifdef AVMPLUS_VERBOSE + if (pool->verbose) + { + core->console << " " << offset << ":method["<flags |= AbstractFunction::HAS_EXCEPTIONS; + for (int i=0; i= pool->constantMnCount) + toplevel->throwVerifyError(kCpoolIndexRangeError, core->toErrorString(name_index), core->toErrorString(pool->constantCount)); + pool->parseMultiname(qn, name_index); + } + + if (pool->verbose) + { + core->console << " exception["<console << "\n"; + } + #else + readU30(pos); // from + readU30(pos); // to + readU30(pos); // target + readU30(pos); // type name + if (version != (46<<16|15)) + { + readU30(pos); // variable name + } + #endif + } + } + + if (info->hasMethodBody()) + { + MethodInfo *methodInfo = (MethodInfo*) info; + + // Interface methods should not have bodies + if (info->declaringTraits && info->declaringTraits->isInterface) + { + toplevel->throwVerifyError(kIllegalInterfaceMethodBodyError, core->toErrorString(info)); + } + +#ifdef DEBUGGER + methodInfo->local_count = local_count; + methodInfo->codeSize = code_length; + methodInfo->max_scopes = max_scope_depth - init_scope_depth; +#endif + + // if non-zero, we have a duplicate method body - throw a verify error + if (methodInfo->body_pos) + { + toplevel->throwVerifyError(kDuplicateMethodBodyError, core->toErrorString(info)); + } + + methodInfo->body_pos = body_pos; + + // there will be a traits_count here, even if NEED_ACTIVATION is not + // set. So we parse the same way all the time. We could reduce file size and + // memory by ommitting the count + traits comletely. + + const byte* traits_pos = pos; + int nameCount = readU30(pos); + if ((methodInfo->flags & AbstractFunction::NEED_ACTIVATION) || nameCount > 0) + { + pos = traits_pos; + // activation traits are raw types, not subclasses of object. this is + // okay because they aren't accessable to the programming model. + #ifdef AVMPLUS_VERBOSE + methodInfo->activationTraits = parseTraits(NULL, + core->publicNamespace, + core->internString(methodInfo->name), + 0, 0); + #else + methodInfo->activationTraits = parseTraits(NULL, NULL, NULL, false, 0); + #endif + methodInfo->activationTraits->final = true; + } + else + { + // TODO remove this assert once abc format is adjusted + AvmAssert(nameCount == 0); + } + } + else + { + // native methods should not have bodies! + toplevel->throwVerifyError(kIllegalNativeMethodBodyError, core->toErrorString(info)); + } + } + + #ifdef AVMPLUS_PROFILE + core->sprof.bodiesSize += (pos-startpos); + #endif + } + + void AbcParser::parseCpool() + { + pool = new (core->GetGC()) PoolObject(core, code, pos); + pool->domain = domain; + pool->isBuiltin = (nativeMethods != NULL); + + uint32 int_count = readU30(pos); + // sanity check to prevent huge allocations + if (int_count > (uint32)(abcEnd - pos)) + toplevel->throwVerifyError(kCorruptABCError); + + List& cpool_int = pool->cpool_int; + cpool_int.ensureCapacity(int_count); + pool->constantIntCount = int_count; + +#ifdef AVMPLUS_VERBOSE + pool->verbose = core->verbose; +#endif + +#if defined(AVMPLUS_PROFILE) || defined(AVMPLUS_VERBOSE) || defined(DEBUGGER) + const byte* startpos = pos; +#endif + + for(uint32 i = 1; i < int_count; ++i) + { +#ifdef AVMPLUS_VERBOSE + int offset = pos-startpos; +#endif + // S32 value + cpool_int.set(i, readS32(pos)); +#ifdef AVMPLUS_VERBOSE + if (pool->verbose) + { + core->console << " " << offset << ":" << "cpool_int["<console << cpool_int[i] << "\n"; + } +#endif + + } + #ifdef AVMPLUS_PROFILE + core->sprof.cpoolIntSize = (pos-startpos); + #endif + + uint32 uint_count = readU30(pos); + if (uint_count > (uint32)(abcEnd - pos)) + toplevel->throwVerifyError(kCorruptABCError); + + List& cpool_uint = pool->cpool_uint; + cpool_uint.ensureCapacity(uint_count); + pool->constantUIntCount = uint_count; + +#if defined(AVMPLUS_PROFILE) || defined(AVMPLUS_VERBOSE) || defined(DEBUGGER) + startpos = pos; +#endif + + for(uint32 i = 1; i < uint_count; ++i) + { +#ifdef AVMPLUS_VERBOSE + int offset = pos-startpos; +#endif + // U32 value + cpool_uint.set(i, (unsigned)readS32(pos)); + +#ifdef AVMPLUS_VERBOSE + if (pool->verbose) + { + core->console << " " << offset << ":" << "cpool_uint["<console << (double)cpool_uint[i]; + core->console << "\n"; + } +#endif + + } + #ifdef AVMPLUS_PROFILE + core->sprof.cpoolUIntSize = (pos-startpos); + #endif + + uint32 double_count = readU30(pos); + if (double_count > (uint32)(abcEnd - pos)) + toplevel->throwVerifyError(kCorruptABCError); + + List& cpool_double = pool->cpool_double; + cpool_double.ensureCapacity(double_count); + pool->constantDoubleCount = double_count; + +#if defined(AVMPLUS_VERBOSE) || defined(DEBUGGER) + startpos = pos; +#endif + + for(uint32 i = 1; i < double_count; ++i) + { +#ifdef AVMPLUS_VERBOSE + int offset = pos-startpos; +#endif + // double value + union { + double value; + sint64 bits; + #ifdef AVMPLUS_ARM + uint32 words[2]; + #endif + } u; + u.bits = readS64(pos); + #ifdef AVMPLUS_ARM + uint32 t = u.words[0]; + u.words[0] = u.words[1]; + u.words[1] = t; + #endif + cpool_double.set(i, (double*)(core->allocDouble(u.value)&~7)); +#ifdef AVMPLUS_VERBOSE + if (pool->verbose) + { + core->console << " " << offset << ":" << "cpool_double["<console << *cpool_double[i]; + core->console << "\n"; + } +#endif + + } + + #ifdef AVMPLUS_PROFILE + core->sprof.cpoolDoubleSize = (pos-startpos); + #endif + + uint32 string_count = readU30(pos); + if (string_count > (uint32)(abcEnd - pos)) + toplevel->throwVerifyError(kCorruptABCError); + + List &cpool_string = pool->cpool_string; + MMGC_MEM_TYPE(pool); + cpool_string.ensureCapacity(string_count); + pool->constantStringCount = string_count; + +#if defined(AVMPLUS_VERBOSE) || defined(DEBUGGER) + startpos = pos; +#endif + + for(uint32 i = 1; i < string_count; ++i) + { +#ifdef AVMPLUS_VERBOSE + int offset = pos-startpos; +#endif + + // number of characters + // todo - is compiler emitting no. of chars or no. of bytes? + int len = readU30(pos); + + // check to see if we are trying to read past the file end or the beginning. + if (pos < abcStart || pos+len >= abcEnd ) + toplevel->throwVerifyError(kCorruptABCError); + // don't need to create an atom for this now, because + // each caller will take care of it. + Stringp s = core->internAllocUtf8(pos, len); +#ifdef MMGC_DRC + // MIR skips WB on string constants so make them sticky + s->Stick(); +#endif + cpool_string.set(i, s); + pos += len; + +#ifdef AVMPLUS_VERBOSE + if (pool->verbose) + { + core->console << " " << offset << ":" << "cpool_string["<console << core->format(cpool_string[i]->atom()); + core->console << "\n"; + } +#endif + + } + #ifdef AVMPLUS_PROFILE + core->sprof.cpoolStrSize = (pos-startpos); + #endif + + uint32 ns_count = readU30(pos); + if (ns_count > (uint32)(abcEnd - pos)) + toplevel->throwVerifyError(kCorruptABCError); + + List &cpool_ns = pool->cpool_ns; + + MMGC_MEM_TYPE(pool); + cpool_ns.ensureCapacity(ns_count); + pool->constantNsCount = ns_count; + +#if defined(AVMPLUS_VERBOSE) || defined(DEBUGGER) + startpos = pos; +#endif + for( uint32 i = 1; i < ns_count; ++i ) + { +#ifdef AVMPLUS_VERBOSE + int offset = pos-startpos; +#endif +#ifdef SAFE_PARSE + // check to see if we are trying to read past the file end or the beginning. + if ( pos < abcStart || pos >= abcEnd ) + toplevel->throwVerifyError(kCorruptABCError); +#endif // SAFE_PARSE + CPoolKind kind = (CPoolKind) *(pos++); + switch(kind) + { + case CONSTANT_Namespace: + case CONSTANT_PackageNamespace: + case CONSTANT_PackageInternalNs: + case CONSTANT_ProtectedNamespace: + case CONSTANT_ExplicitNamespace: + case CONSTANT_StaticProtectedNs: + { + uint32 index = readU30(pos); + Namespace::NamespaceType type = Namespace::NS_Public; + switch(kind) + { + case CONSTANT_PackageInternalNs: + type = Namespace::NS_PackageInternal; + break; + case CONSTANT_ProtectedNamespace: + type = Namespace::NS_Protected; + break; + case CONSTANT_ExplicitNamespace: + type = Namespace::NS_Explicit; + break; + case CONSTANT_StaticProtectedNs: + type = Namespace::NS_StaticProtected; + break; + } + + if (index) + { + Stringp uri = resolveUtf8(index); + cpool_ns.set(i, core->internNamespace(core->newNamespace(uri, type))); + } + else + { + // issue this looks wrong. should uri be ""? + Atom uri = undefinedAtom; + cpool_ns.set(i, core->internNamespace(core->newNamespace(uri, type))); + } + break; + } + + case CONSTANT_PrivateNs: + { + uint32 index = readU30(pos); + Stringp uri = index ? resolveUtf8(index) : (Stringp)core->kEmptyString; + Namespace* ns = new (core->GetGC()) Namespace(nullStringAtom, uri, Namespace::NS_Private); + cpool_ns.set(i, ns); + break; + } + default: + { + toplevel->throwVerifyError(kCpoolEntryWrongTypeError, core->toErrorString(i)); + } + } +#ifdef AVMPLUS_VERBOSE + if (pool->verbose) + { + core->console << " " << offset << ":" << "cpool_ns["<console << core->format(cpool_ns[i]->atom()); + core->console << "\n"; + } +#endif + } + #ifdef AVMPLUS_PROFILE + core->sprof.cpoolNsSize = (pos-startpos); + #endif + + + uint32 ns_set_count = readU30(pos); + if (ns_set_count > (uint32)(abcEnd - pos)) + toplevel->throwVerifyError(kCorruptABCError); + + List& cpool_ns_set = pool->cpool_ns_set; + cpool_ns_set.ensureCapacity(ns_set_count); + pool->constantNsSetCount = ns_set_count; + +#if defined(AVMPLUS_VERBOSE) || defined(DEBUGGER) + startpos = pos; +#endif + + for( uint32 i = 1; i < ns_set_count; ++i) + { +#ifdef AVMPLUS_VERBOSE + int offset = pos-startpos; +#endif + uint32 ns_count = readU30(pos); + + if (ns_count > (uint32)(abcEnd - pos)) + toplevel->throwVerifyError(kCorruptABCError); + NamespaceSet* namespace_set = core->newNamespaceSet(ns_count); + + Namespace** nss = namespace_set->namespaces; + for(uint32 j=0; j < ns_count; ++j) + { + Namespace* ns = parseNsRef(pos); + if (!ns) + toplevel->throwVerifyError(kIllegalNamespaceError); + //namespace_set->namespaces[j] = ns; + WBRC(core->GetGC(), namespace_set, &nss[j], ns); + } + cpool_ns_set.set(i, namespace_set); + +#ifdef AVMPLUS_VERBOSE + if (pool->verbose) + { + core->console << " " << offset << ":" << "cpool_ns_set["<console << cpool_ns_set[i]->format(core); + core->console << "\n"; + } +#endif + } + #ifdef AVMPLUS_PROFILE + core->sprof.cpoolNsSetSize = (pos-startpos); + #endif + + uint32 mn_count = readU30(pos); + if (mn_count > (uint32)(abcEnd - pos)) + toplevel->throwVerifyError(kCorruptABCError); + + // TODO: why Atom? its actually a list of positions + List& cpool_mn = pool->cpool_mn; + MMGC_MEM_TYPE(pool); + cpool_mn.ensureCapacity(mn_count); + pool->constantMnCount = mn_count; + +#if defined(AVMPLUS_VERBOSE) || defined(DEBUGGER) + startpos = pos; +#endif + for(uint32 i = 1; i < mn_count; ++i ) + { +#ifdef AVMPLUS_VERBOSE + int offset = pos-startpos; +#endif +#ifdef SAFE_PARSE + // check to see if we are trying to read past the file end or the beginning. + if ( pos < abcStart || pos >= abcEnd ) + toplevel->throwVerifyError(kCorruptABCError); +#endif // SAFE_PARSE + CPoolKind kind = (CPoolKind) *(pos++); + switch(kind) + { + case CONSTANT_Qname: + case CONSTANT_QnameA: + { + // U16 namespace_index + // U16 name_index + // parse a multiname with one namespace (aka qname) + cpool_mn.set(i, pool->posToAtom(pos-1)); + parseNsRef(pos); + parseName(pos); + break; + } + + case CONSTANT_RTQname: + case CONSTANT_RTQnameA: + { + // U16 name_index + // parse a multiname with just a name; ns fetched at runtime + cpool_mn.set(i, pool->posToAtom(pos-1)); + parseName(pos); + break; + } + case CONSTANT_RTQnameL: + case CONSTANT_RTQnameLA: + { + cpool_mn.set(i, pool->posToAtom(pos-1)); + break; + } + + case CONSTANT_Multiname: + case CONSTANT_MultinameA: + { + cpool_mn.set(i, pool->posToAtom(pos-1)); + + parseName(pos); + + uint32 index = readU30(pos); + + if (!index || index >= pool->constantNsSetCount) + toplevel->throwVerifyError(kCpoolIndexRangeError, core->toErrorString(index), core->toErrorString(pool->constantNsSetCount)); + + // If it is in the range of Namespace Sets then it must be a namespace set/ + break; + } + + case CONSTANT_MultinameL: + case CONSTANT_MultinameLA: + { + cpool_mn.set(i, pool->posToAtom(pos-1)); + + uint32 index = readU30(pos); + + if (!index || index >= pool->constantNsSetCount) + toplevel->throwVerifyError(kCpoolIndexRangeError, core->toErrorString(index), core->toErrorString(pool->constantNsSetCount)); + + // If it is in the range of Namespace Sets then it must be a namespace set. + + break; + } + + default: + toplevel->throwVerifyError(kCpoolEntryWrongTypeError, core->toErrorString(i)); + } +#ifdef AVMPLUS_VERBOSE + if (pool->verbose) + { + core->console << " " << offset << ":" << "cpool_mn["<parseMultiname(name, i); + core->console << &name; + core->console << "\n"; + } +#endif + } + #ifdef AVMPLUS_PROFILE + core->sprof.cpoolMnSize = (pos-startpos); + #endif + + } + + void AbcParser::addNamedTraits(Namespace* ns, Stringp name, Traits* itraits) + { + if (!ns->isPrivate() && !domain->namedTraits->get(name, ns)) + { + domain->namedTraits->add(name, ns, (Atom)itraits); + } + else + { + // duplicate class + //Multiname qname(ns,name); + //toplevel->definitionErrorClass()->throwError(kRedefinedError, core->toErrorString(&qname)); + } + } + + void AbcParser::addNamedScript(Namespace* ns, Stringp name, AbstractFunction* script) + { + AbstractFunction* s = (AbstractFunction*) domain->namedScripts->get(name, ns); + if (!s) + { + if(ns->isPrivate()) + { + pool->addPrivateNamedScript(name, ns, script); + } + else + { + domain->namedScripts->add(name, ns, (Atom)script); + } + } + else + { + // duplicate definition + //Multiname qname(ns, name); + //toplevel->definitionErrorClass()->throwError(kRedefinedError, core->toErrorString(&qname)); + } + } + + bool AbcParser::parseScriptInfos() + { + /* + U16 script_count + ScriptInfo[script_count] + { + U16 init_index // method_info index of init function + Traits script_traits // traits for the global object of this package + } + */ + + uint32 count = readU30(pos); + +#ifdef AVMPLUS_VERBOSE + if (pool->verbose) + { + core->console << "script_count=" << count << "\n"; + } +#endif + +#if defined(AVMPLUS_PROFILE) || defined(AVMPLUS_VERBOSE) || defined(DEBUGGER) + const byte* startpos = pos; +#endif + + if (count == 0) + { + return true; + } + + if (count > (uint32)(abcEnd - pos)) + toplevel->throwVerifyError(kCorruptABCError); + + pool->scripts.ensureCapacity(count); + pool->scriptCount = count; + + // make global objects subclasses of Object + + for (uint32 i=0; i < count; i++) + { +#ifdef AVMPLUS_VERBOSE + const byte* script_pos = pos; +#endif + + int init_index = readU30(pos); + +#ifdef AVMPLUS_VERBOSE + if (pool->verbose) + { + core->console << " " << (int)(script_pos-startpos) << ":script[" << i << "]" + << " init_index=" << init_index + << "\n"; + } +#endif + AbstractFunction* script = resolveMethodInfo(init_index); + AvmAssert(script->declaringTraits == NULL); + + if (script->declaringTraits != NULL) + { + // method has already been bound to a different type. Can't bind it twice because + // it can only have one environment, for its scope chain and super references. + toplevel->throwVerifyError(kAlreadyBoundError, core->toErrorString(script), core->toErrorString((Traits*)script->declaringTraits)); + } + + Traits* traits = parseTraits(OBJECT_TYPE, + core->publicNamespace, core->kglobal, + script, 0); + + if( !traits ) return false; // parseTraits failed + + traits->final = true; + + // global object, make it dynamic + NativeScriptInfo* nativeEntry; + if (nativeScripts && (nativeEntry=nativeScripts[i]) != 0) + { + traits->sizeofInstance = nativeEntry->sizeofInstance; + traits->setNativeScriptInfo(nativeEntry); + AvmAssert(traits->sizeofInstance >= sizeof(ScriptObject)); + } + else + { + traits->sizeofInstance = sizeof(ScriptObject); + } + traits->needsHashtable = true; + + script->makeMethodOf(traits); + traits->init = script; + + #ifdef AVMPLUS_VERBOSE + script->name = core->concatStrings(traits->format(core), core->newString("$init")); + #endif + + #if defined(AVMPLUS_INTERP) && defined(AVMPLUS_MIR) + if (!core->forcemir) + { + // suggest that we don't jit the $init methods + script->flags |= AbstractFunction::SUGGEST_INTERP; + } + #endif /* AVMPLUS_INTERP */ + + pool->scripts.set(i, script); + + // initial scope chain is [] + traits->scope = ScopeTypeChain::create(core->GetGC(),NULL,0); + } + #ifdef AVMPLUS_PROFILE + core->sprof.scriptsSize = (pos-startpos); + #endif + + return true; + } + + // helper for interface flattening + void AbcParser::addTraits(Hashtable *ht, Traits *traits, Traits *baseTraits) + { + if(!baseTraits || !baseTraits->containsInterface(traits)) + { + ht->add((Atom)traits, traits); + Traitsp *interfaces = traits->getInterfaces(); + for (int i=0, n=traits->interfaceCapacity; i < n; i++) { + Traits* t = interfaces[i]; + if (t != NULL && t->isInterface) { + addTraits(ht, t, baseTraits); + } + } + } + } + + bool AbcParser::parseInstanceInfos() + { + classCount = readU30(pos); + +#ifdef AVMPLUS_VERBOSE + if (pool->verbose) + core->console << "class_count=" << classCount <<"\n"; +#endif + +#if defined(AVMPLUS_PROFILE) || defined(AVMPLUS_VERBOSE) || defined(DEBUGGER) + const byte* startpos = pos; +#endif + + if (classCount == 0) + { + return true; + } + + if (classCount > (abcEnd - pos)) + toplevel->throwVerifyError(kCorruptABCError); + + // allocate room for class infos early, to handle nested classes + pool->cinits.ensureCapacity(classCount); + pool->classCount = classCount; + + instances.ensureCapacity(classCount); + + for (int i=0; i < classCount; i++) + { + #ifdef AVMPLUS_VERBOSE + const byte* classpos = pos; + #endif // AVMPLUS_VERBOSE + + // CONSTANT_QName name of this class + Namespace* ns; + Stringp name; + + Multiname qname; + resolveQName(pos, qname); + ns = qname.getNamespace(); + name = qname.getName(); + + // resolving base class type means class heirarchy must be a Tree + Traits* baseTraits = pool->resolveTypeName(pos, toplevel); + + if (baseTraits && baseTraits->final || + CLASS_TYPE != NULL && baseTraits == CLASS_TYPE || + FUNCTION_TYPE != NULL && baseTraits == FUNCTION_TYPE) + { + // error - attempt to extend final class + #ifdef AVMPLUS_VERBOSE + if (pool->verbose) + core->console << &qname << " can't extend final class " << baseTraits << "\n"; + #endif + toplevel->throwVerifyError(kCannotExtendFinalClass, core->toErrorString(&qname)); + } + + if (baseTraits && baseTraits->isInterface) + { + // error, can't extend interface + toplevel->throwVerifyError(kCannotExtendError, core->toErrorString(&qname), core->toErrorString(baseTraits)); + } + + // read flags: bit 0: sealed + // bit 1: final + // bit 2: interface + // bit 3: protected +#ifdef SAFE_PARSE + // check to see if we are trying to read past the file end or the beginning. + if ( pos < abcStart || pos >= abcEnd ) + toplevel->throwVerifyError(kCorruptABCError); +#endif // SAFE_PARSE + int flags = *pos++; + + // read protected namespace + Namespace *protectedNamespace = NULL; + if (flags & 8) + { + protectedNamespace = parseNsRef(pos); + } + + int interfaceCount = readU30(pos); + int interfaceDelta = 0; + const byte* interfacePos = pos; + + if(interfaceCount) + { + Hashtable *ht = new (core->GetGC()) Hashtable(core->GetGC(), interfaceCount*2); + for( int x = 0; x < interfaceCount; ++ x ) + { + Traits *t = pool->resolveTypeName(pos, toplevel); + + if (!t || !t->isInterface) + { + // error, can't extend interface + toplevel->throwVerifyError(kCannotImplementError, core->toErrorString(&qname), core->toErrorString(t)); + } + + addTraits(ht, t, baseTraits); + } + interfaceDelta = ht->getSize(); + delete ht; + } + + // TODO make sure the inheritance is legal. + // - can't override final members + // - overrides agree with base class signature + + uint32 iinit_index = readU30(pos); + AbstractFunction *iinit = resolveMethodInfo(iinit_index); + +#ifdef AVMPLUS_VERBOSE + if (pool->verbose) + { + // TODO: fixup this math here, since the 2's are all wrong + core->console + << " " << (int)(classpos-startpos) << ":instance[" << i << "]" + << " " << &qname; + + if (baseTraits) + core->console << " extends " << baseTraits; + + core->console + << " interface_count=" << interfaceCount + << " iinit_index=" << iinit_index + << "\n"; + } +#endif + + #ifdef AVMPLUS_VERBOSE + iinit->name = core->concatStrings(Multiname::format(core,ns,name), core->newString("$iinit")); + #endif + + Traits* itraits = parseTraits(baseTraits, ns, name, 0, interfaceDelta, protectedNamespace); + if( !itraits ) return false; + if (!baseTraits && core->traits.object_itraits == NULL) + { + // save object traits + core->traits.object_itraits = itraits; + itraits->isObjectType = true; + } + + // AS3 language decision: dynamic is not inherited. + itraits->needsHashtable = (flags&1) == 0; + itraits->final = (flags&2) != 0; + itraits->sizeofInstance = computeInstanceSize(i, baseTraits); + + if (flags & 4) + { + itraits->isInterface = true; + + if (itraits->slotCount != 0) + { + toplevel->throwVerifyError(kIllegalSlotError, core->toErrorString(itraits)); + } + + // interface base must be * + if (baseTraits) + { + // error, can't extend this type + toplevel->throwVerifyError(kCannotExtendError, core->toErrorString(&qname), core->toErrorString(baseTraits)); + } + } + + if (iinit->declaringTraits != NULL) + { + // method has already been bound to a different type. Can't bind it twice because + // it can only have one environment, for its scope chain and super references. + toplevel->throwVerifyError(kAlreadyBoundError, core->toErrorString(iinit), core->toErrorString((Traits*)iinit->declaringTraits)); + } + + iinit->makeMethodOf(itraits); + itraits->init = iinit; + + // parse the interfaces. resolving type refs here means interface heirarchy must be a DAG. + for (int j=0, n=interfaceCount; j < n; j++) + { + Traits *interfaceTraits = pool->resolveTypeName(interfacePos, toplevel); + + itraits->addInterface(interfaceTraits); + #ifdef AVMPLUS_VERBOSE + if (pool->verbose) + core->console << " interface["<interfaceSlop() == 0); + + instances.set(i, itraits); + + if (pool->getTraits(name, ns, false) == NULL) + { + pool->addNamedTraits(name, ns, itraits); + } + else + { + // error, can't redefine a class or interface + //toplevel->definitionErrorClass()->throwError(kRedefinedError, core->toErrorString(&qname)); + } + } + + #ifdef AVMPLUS_PROFILE + core->sprof.instancesSize = (pos-startpos); + #endif + + return true; + } + + void AbcParser::parseClassInfos() + { + if (classCount == 0) + { + return; + } + +#if defined(AVMPLUS_PROFILE) || defined(AVMPLUS_VERBOSE) || defined(DEBUGGER) + const byte* startpos = pos; +#endif + + for (int i=0; i < classCount; i++) + { + // CONSTANT_Multiname name of this class + Traits* itraits = instances[i]; + Namespace* ns = itraits->ns; + Stringp name = itraits->name; + +#ifdef AVMPLUS_VERBOSE + const byte* class_pos = pos; +#endif + + uint32 cinit_index = readU30(pos); + AbstractFunction *cinit = resolveMethodInfo(cinit_index); + +#ifdef AVMPLUS_VERBOSE + if (pool->verbose) + { + core->console + << " " << (int)(class_pos-startpos) << ":class[" << i << "]" + << " " << ns << "::" << name; + + core->console + << " cinit_index=" << cinit_index + << "\n"; + } +#endif + + #ifdef AVMPLUS_VERBOSE + Stringp cinitName = core->concatStrings(name, core->newString("$cinit")); + cinit->name = Multiname::format(core,ns,cinitName); + #endif + + Traits* ctraits = parseTraits(CLASS_TYPE, + ns, core->internString(core->concatStrings(name, core->newString("$"))), 0, 0, itraits->protectedNamespace); + + NativeClassInfo *nativeEntry; + if (nativeClasses && (nativeEntry=nativeClasses[i]) != 0) + { + ctraits->sizeofInstance = nativeEntry->sizeofClass; + ctraits->setNativeClassInfo(nativeEntry); + } + else + { + ctraits->sizeofInstance = sizeof(ClassClosure); + } + + AvmAssert(cinit->declaringTraits == NULL); + + if (cinit->declaringTraits != NULL) + { + // method has already been bound to a different type. Can't bind it twice because + // it can only have one environment, for its scope chain and super references. + toplevel->throwVerifyError(kAlreadyBoundError, core->toErrorString(cinit), core->toErrorString((Traits*)cinit->declaringTraits)); + } + + cinit->makeMethodOf(ctraits); + ctraits->init = cinit; + ctraits->itraits = itraits; + ctraits->final = true; + ctraits->needsHashtable = true; + + #if defined(AVMPLUS_INTERP) && defined(AVMPLUS_MIR) + if (!core->forcemir) + { + // suggest that we don't jit the class initializer + cinit->flags |= AbstractFunction::SUGGEST_INTERP; + } + #endif /* AVMPLUS_INTERP */ + + pool->cinits.set(i, cinit); + } + + #ifdef AVMPLUS_PROFILE + core->sprof.classesSize = (pos-startpos); + #endif + } + + unsigned int AbcParser::readU30(const byte *&p) const + { +#ifdef SAFE_PARSE + // We have added kBufferPadding bytes to the end of the main swf buffer. + // Why? Here we can read from 1 to 5 bytes. If we were to + // put the required safety checks at each byte read, we would slow + // parsing of the file down. With this buffer, only one check at the + // top of this function is necessary. (we will read on into our own memory) + if ( p >= abcEnd || p < abcStart ) + toplevel->throwVerifyError(kCorruptABCError); +#endif //SAFE_PARSE + return toplevel->readU30(p); + } + +} diff --git a/mozilla/js/tamarin/core/AbcParser.h b/mozilla/js/tamarin/core/AbcParser.h new file mode 100644 index 00000000000..9a0510f5fb4 --- /dev/null +++ b/mozilla/js/tamarin/core/AbcParser.h @@ -0,0 +1,208 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_AbcParser__ +#define __avmplus_AbcParser__ + + +namespace avmplus +{ + /** + * Parser for reading .abc (Actionscript Byte Code) files. + */ + class AbcParser + { + public: + AbcParser(AvmCore* core, ScriptBuffer code, + Toplevel* toplevel, + Domain* domain, + AbstractFunction *nativeMethods[], + NativeClassInfo *nativeClasses[], + NativeScriptInfo *nativeScripts[]); + + ~AbcParser(); + + /** + * parse an .abc file + * @param code + * @return + */ + static PoolObject* decodeAbc(AvmCore* core, ScriptBuffer code, + Toplevel* toplevel, + Domain* domain, + AbstractFunction *nativeMethods[], + NativeClassInfo *nativeClasses[], + NativeScriptInfo *nativeScripts[]); + + protected: + PoolObject* parse(); + AbstractFunction* resolveMethodInfo(uint32 index) const; + + #ifdef AVMPLUS_VERBOSE + void parseTypeName(const byte* &p, Multiname& m) const; + #endif + + Namespace* parseNsRef(const byte* &pc) const; + Stringp resolveUtf8(uint32 index) const; + Stringp parseName(const byte* &pc) const; + Atom resolveQName(const byte* &pc, Multiname &m) const; + int computeInstanceSize(int class_id, Traits* base) const; + void parseMethodInfos(); + void parseMetadataInfos(); + bool parseInstanceInfos(); + void parseClassInfos(); + bool parseScriptInfos(); + void parseMethodBodies(); + void parseCpool(); + Traits* parseTraits(Traits* base, Namespace* ns, Stringp name, AbstractFunction* script, int interfaceDelta, Namespace* protectedNamespace = NULL); + + /** + * add script to VM-wide table + */ + void addNamedScript(Namespace* ns, Stringp name, AbstractFunction* script); + + /** + * Adds traits to the VM-wide traits table, for types + * that can be accessed from multiple abc's. + * @param name The name of the class + * @param ns The namespace of the class + * @param itraits The instance traits of the class + */ + void addNamedTraits(Namespace* ns, Stringp name, Traits* itraits); + + sint64 readS64(const byte* &p) const + { +#ifdef SAFE_PARSE + // check to see if we are trying to read past the file end. + if (p < abcStart || p+7 >= abcEnd ) + toplevel->throwVerifyError(kCorruptABCError); +#endif //SAFE_PARSE + unsigned first = p[0] | p[1]<<8 | p[2]<<16 | p[3]<<24; + unsigned second = p[4] | p[5]<<8 | p[6]<<16 | p[7]<<24; + p += 8; + return first | ((sint64)second)<<32; + } + + /** + * Reads in 2 bytes and turns them into a 16 bit number. Always reads in 2 bytes. Currently + * only used for version number of the ABC file and for version 11 support. + */ + int readU16(const byte* p) const + { +#ifdef SAFE_PARSE + if (p < abcStart || p+1 >= abcEnd) + toplevel->throwVerifyError(kCorruptABCError); +#endif //SAFE_PARSE + return p[0] | p[1]<<8; + } + + /** + * Read in a 32 bit number that is encoded with a variable number of bytes. The value can + * take up 1-5 bytes depending on its value. 0-127 takes 1 byte, 128-16383 takes 2 bytes, etc. + * The scheme is that if the current byte has the high bit set, then the following byte is also + * part of the value. + * + * Returns the value, and the 2nd argument is set to the number of bytes that were read to get that + * value. + */ + int readS32(const byte *&p) const + { +#ifdef SAFE_PARSE + // We have added kBufferPadding bytes to the end of the main swf buffer. + // Why? Here we can read from 1 to 5 bytes. If we were to + // put the required safety checks at each byte read, we would slow + // parsing of the file down. With this buffer, only one check at the + // top of this function is necessary. (we will read on into our own memory) + if ( p < abcStart || p >= abcEnd ) + toplevel->throwVerifyError(kCorruptABCError); +#endif //SAFE_PARSE + + int result = p[0]; + if (!(result & 0x00000080)) + { + p++; + return result; + } + result = (result & 0x0000007f) | p[1]<<7; + if (!(result & 0x00004000)) + { + p += 2; + return result; + } + result = (result & 0x00003fff) | p[2]<<14; + if (!(result & 0x00200000)) + { + p += 3; + return result; + } + result = (result & 0x001fffff) | p[3]<<21; + if (!(result & 0x10000000)) + { + p += 4; + return result; + } + result = (result & 0x0fffffff) | p[4]<<28; + p += 5; + return result; + } + + unsigned int readU30(const byte *&p) const; + + private: + Toplevel* const toplevel; + Domain* const domain; + AvmCore* core; + ScriptBuffer code; + int version; + PoolObject* pool; + const byte* pos; + AbstractFunction **nativeMethods; + NativeClassInfo **nativeClasses; + NativeScriptInfo **nativeScripts; + int classCount; + List instances; + byte* abcStart; + byte* abcEnd; // one past the end, actually + Stringp* metaNames; + Stringp kNeedsDxns; +#ifdef AVMPLUS_VERBOSE + Stringp kVerboseVerify; +#endif +#ifdef FEATURE_BUFFER_GUARD // no Carbon + BufferGuard *guard; +#endif + void addTraits(Hashtable *ht, Traits *traits, Traits *baseTraits); + + }; + +} + +#endif // __avmplus_AbcParser__ diff --git a/mozilla/js/tamarin/core/AbstractFunction.cpp b/mozilla/js/tamarin/core/AbstractFunction.cpp new file mode 100644 index 00000000000..4218db746f1 --- /dev/null +++ b/mozilla/js/tamarin/core/AbstractFunction.cpp @@ -0,0 +1,433 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmplus.h" + +namespace avmplus +{ + using namespace MMgc; + + AbstractFunction::AbstractFunction() + { + this->flags = 0; + this->method_id = -1; + } + + void AbstractFunction::initParamTypes(int count) + { + MMGC_MEM_TYPE(this); + m_types = (Traits**)core()->GetGC()->Calloc(count, sizeof(Traits*), GC::kContainsPointers|GC::kZero); + } + + void AbstractFunction::initDefaultValues(int count) + { + MMGC_MEM_TYPE(this); + m_values = (Atom*)core()->GetGC()->Calloc(count, sizeof(Atom), GC::kContainsPointers|GC::kZero); + } + + void AbstractFunction::setParamType(int index, Traits* t) + { + AvmAssert(index >= 0 && index <= param_count); + WB(core()->GetGC(), m_types, &m_types[index], t); + } + + void AbstractFunction::setDefaultValue(int index, Atom value) + { + AvmAssert(index > (param_count-optional_count) && index <= param_count); + int i = index-(param_count-optional_count)-1; + AvmAssert(i >= 0 && i < optional_count); + WBATOM(core()->GetGC(), m_values, &m_values[i], value); + } + + #ifdef AVMPLUS_VERBOSE + Stringp AbstractFunction::format(const AvmCore* core) const + { + return core->concatStrings(name ? (Stringp)name : core->newString("?"), + core->newString("()")); + } + #endif //AVMPLUS_VERBOSE + + bool AbstractFunction::makeMethodOf(Traits* traits) + { + if (!m_types[0]) + { + declaringTraits = traits; + setParamType(0, traits); + flags |= NEED_CLOSURE; + + if (traits->final) + { + // all methods of a final class are final + flags |= FINAL; + } + + return true; + } + else + { + #ifdef AVMPLUS_VERBOSE + if (pool->verbose) + core()->console << "WARNING: method " << this << " was already bound to " << declaringTraits << "\n"; + #endif + + return false; + } + } + + void AbstractFunction::makeIntoPrototypeFunction(const Toplevel* toplevel) + { + if (declaringTraits == NULL) + { + // make sure param & return types are fully resolved. + // this does not set the verified flag, so real verification will + // still happen before the function runs the first time. + resolveSignature(toplevel); + + // ftraits = new traits, extends function + // this->declaringTraits = ftraits + // ftraits->call = this + // ftraits->construct = create object, call this(), return obj or result + + AvmCore* core = this->core(); + int functionSlotCount = core->traits.function_itraits->slotCount; + int functionMethodCount = core->traits.function_itraits->methodCount; + + // type of F is synthetic subclass of Function, with a unique + // [[call]] property and a unique scope + + Traits* ftraits = core->newTraits(core->traits.function_itraits, 1, 1, + sizeof(ClassClosure)); + ftraits->slotCount = functionSlotCount; + ftraits->methodCount = functionMethodCount; + ftraits->pool = pool; + ftraits->final = true; + ftraits->needsHashtable = true; + ftraits->itraits = core->traits.object_itraits; + this->declaringTraits = ftraits; + + ftraits->ns = core->publicNamespace; +#ifdef AVMPLUS_VERBOSE + ftraits->name = core->internString( + core->concatStrings(core->newString("Function-"), core->intToString(method_id)) + ); +#endif + + ftraits->hashTableOffset = ftraits->sizeofInstance; + ftraits->setTotalSize(ftraits->hashTableOffset + sizeof(Hashtable)); + + ftraits->initTables(); + + AvmAssert(core->traits.function_itraits->linked); + ftraits->linked = true; + + +#ifdef AVMPLUS_UNCHECKED_HACK + // HACK - compiler should do this, and only to toplevel functions + // that meet the E4 criteria for being an "unchecked function" + // the tests below are too loose + + // if all params and return types are Object then make all params optional=undefined + if (param_count == 0) + flags |= IGNORE_REST; + if (!(flags & HAS_OPTIONAL) && param_count > 0) + { + if (m_returnType == NULL) + { + for (int i=1; i <= param_count; i++) + { + if (m_types[i] != NULL) + return; + } + + // make this an unchecked function + flags |= HAS_OPTIONAL | IGNORE_REST; + optional_count = param_count; + initDefaultValues(optional_count); + for (int i=1; i <= optional_count; i++) + { + // since the type is object the default value is undefined. + setDefaultValue(i, undefinedAtom); + } + } + } +#endif + } + } + + /** + * convert native args to atoms. argc is the number of + * args, not counting the instance which is arg[0]. the + * layout is [instance][arg1..argN] + */ + void AbstractFunction::boxArgs(int argc, va_list ap, Atom* out) + { + // box the typed args, up to param_count + AvmCore* core = this->core(); + for (int i=0; i <= argc; i++) + { + if (i <= param_count) + { + Traits* t = paramTraits(i); + AvmAssert(t != VOID_TYPE); + + if (t == NUMBER_TYPE) + { + out[i] = core->doubleToAtom(va_arg(ap, double)); + } + else if (t == INT_TYPE) + { + out[i] = core->intToAtom(va_arg(ap, int)); + } + else if (t == UINT_TYPE) + { + out[i] = core->uintToAtom(va_arg(ap, uint32)); + } + else if (t == BOOLEAN_TYPE) + { + out[i] = va_arg(ap, int) ? trueAtom : falseAtom; + } + else if (!t || t == OBJECT_TYPE) + { + out[i] = va_arg(ap, Atom); + } + else + { + // it's a pointer type, possibly null + + void* p = va_arg(ap, void*); // unknown pointer + if (t == STRING_TYPE) + { + out[i] = ((Stringp)p)->atom(); + } + else if (t == NAMESPACE_TYPE) + { + out[i] = ((Namespace*)p)->atom(); + } + else + { + out[i] = ((ScriptObject*)p)->atom(); + } + } + } + else + { + out[i] = va_arg(ap, Atom); + } + } + } + + void AbstractFunction::resolveSignature(const Toplevel* toplevel) + { + if (!(flags & LINKED)) + { + AvmCore* core = this->core(); + AvmAssert(info_pos != NULL); + + const byte* pos = info_pos; + + Traits* t = pool->resolveTypeName(pos, toplevel, /*allowVoid=*/true); + + m_returnType = t; + + // use va_arg macro to compute the size of the typed argument list. + // va_arg adds padding according to platform calling conventions. + va_list apstart = 0; + va_list ap = apstart; + + // param 0 is contextual + t = m_types[0]; + if (!t) + { + setParamType(0, OBJECT_TYPE); + va_arg(ap, Atom); + } + else + { + if (t == NUMBER_TYPE) + va_arg(ap, double); + else + va_arg(ap, int); + if (t->isInterface) + flags |= ABSTRACT_METHOD; + } + + // param types 1..N come from abc stream + for (int i=1, n=param_count; i <= n; i++) + { + t = pool->resolveTypeName(pos, toplevel); + setParamType(i, t); + if (t == NUMBER_TYPE) + va_arg(ap, double); + else + va_arg(ap, int); + } + restOffset = ((int)ap)-((int)apstart); + + AvmCore::readU30(pos); // name_index; + pos++; // skip flags + + if (flags & HAS_OPTIONAL) + { + AvmCore::readU30(pos); // optional_count + + initDefaultValues(optional_count); + + for (int j=0,n=optional_count; j < n; j++) + { + int param = param_count-optional_count+1+j; + int index = AvmCore::readU30(pos); + CPoolKind kind = (CPoolKind)*(pos++); + + // check that the default value is legal for the param type + Traits* t = this->paramTraits(param); + AvmAssert(t != VOID_TYPE); + + Atom value; + if (t == NULL) + { + value = !index ? undefinedAtom : pool->getDefaultValue(toplevel, index, kind, t); + } + else if (t == OBJECT_TYPE) + { + value = !index ? nullObjectAtom : pool->getDefaultValue(toplevel, index, kind, t); + if (value == undefinedAtom) + { + Multiname qname(t->ns, t->name); + toplevel->throwVerifyError(kIllegalDefaultValue, core->toErrorString(&qname)); + } + } + else if (t == NUMBER_TYPE) + { + value = !index ? core->kNaN : pool->getDefaultValue(toplevel, index, kind, t); + if (!(AvmCore::isInteger(value)||AvmCore::isDouble(value))) + { + Multiname qname(t->ns, t->name); + toplevel->throwVerifyError(kIllegalDefaultValue, core->toErrorString(&qname)); + } + } + else if (t == BOOLEAN_TYPE) + { + value = !index ? falseAtom : pool->getDefaultValue(toplevel, index, kind, t); + if (!AvmCore::isBoolean(value)) + { + Multiname qname(t->ns, t->name); + toplevel->throwVerifyError(kIllegalDefaultValue, core->toErrorString(&qname)); + } + } + else if (t == UINT_TYPE) + { + value = !index ? 0|kIntegerType : pool->getDefaultValue(toplevel, index, kind, t); + if (!AvmCore::isInteger(value) && !AvmCore::isDouble(value)) + { + Multiname qname(t->ns, t->name); + toplevel->throwVerifyError(kIllegalDefaultValue, core->toErrorString(&qname)); + } + double d = AvmCore::number_d(value); + if (d != (uint32)d) + { + Multiname qname(t->ns, t->name); + toplevel->throwVerifyError(kIllegalDefaultValue, core->toErrorString(&qname)); + } + } + else if (t == INT_TYPE) + { + value = !index ? 0|kIntegerType : pool->getDefaultValue(toplevel, index, kind, t); + if (!AvmCore::isInteger(value) && !AvmCore::isDouble(value)) + { + Multiname qname(t->ns, t->name); + toplevel->throwVerifyError(kIllegalDefaultValue, core->toErrorString(&qname)); + } + double d = AvmCore::number_d(value); + if (d != (int)d) + { + Multiname qname(t->ns, t->name); + toplevel->throwVerifyError(kIllegalDefaultValue, core->toErrorString(&qname)); + } + } + else if (t == STRING_TYPE) + { + value = !index ? nullStringAtom : pool->getDefaultValue(toplevel, index, kind, t); + if (!(AvmCore::isNull(value) || AvmCore::isString(value))) + { + Multiname qname(t->ns, t->name); + toplevel->throwVerifyError(kIllegalDefaultValue, core->toErrorString(&qname)); + } + } + else if (t == NAMESPACE_TYPE) + { + value = !index ? nullNsAtom : pool->getDefaultValue(toplevel, index, kind, t); + if (!(AvmCore::isNull(value) || AvmCore::isNamespace(value))) + { + Multiname qname(t->ns, t->name); + toplevel->throwVerifyError(kIllegalDefaultValue, core->toErrorString(&qname)); + } + } + else + { + // any other type: only allow null default value + value = !index ? nullObjectAtom : pool->getDefaultValue(toplevel, index, kind, t); + if (!AvmCore::isNull(value)) + { + Multiname qname(t->ns, t->name); + toplevel->throwVerifyError(kIllegalDefaultValue, core->toErrorString(&qname)); + } + } + + setDefaultValue(param, value); + } + } + + /* + // Don't need this for anything yet, so no point in wasting time parsing it. Here just so we don't + // forget about it if we add any sections after this one, and need to skip past it. + if( flags & AbstractFunction::HAS_PARAM_NAMES) + { + // AVMPlus doesn't care about the param names, just skip past them + for( int j = 0; j < param_count; ++j ) + { + readU30(pos); + } + } + */ + flags |= LINKED; + } + } + +#ifdef DEBUGGER + uint32 AbstractFunction::size() const + { + uint32 size = sizeof(AbstractFunction); + size += param_count * 2 * sizeof(Atom); + return size; + } +#endif +} diff --git a/mozilla/js/tamarin/core/AbstractFunction.h b/mozilla/js/tamarin/core/AbstractFunction.h new file mode 100644 index 00000000000..b8e632107f3 --- /dev/null +++ b/mozilla/js/tamarin/core/AbstractFunction.h @@ -0,0 +1,296 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_AbstractFunction__ +#define __avmplus_AbstractFunction__ + + +#ifdef verify +#undef verify +#endif + +namespace avmplus +{ + /** + * AbstractFunction is the base class for all functions that + * can be executed by the VM: Actionscript functions, + * native functions, etc. + */ + class AbstractFunction : public MMgc::GCObject + { + public: + /** @name flags from .abc - limited to a BYTE */ + /*@{*/ + /** need arguments[0..argc] */ + static const int NEED_ARGUMENTS = 0x00000001; + + /** need activation object */ + static const int NEED_ACTIVATION = 0x00000002; + + /** need arguments[param_count+1..argc] */ + static const int NEED_REST = 0x00000004; + + /** has optional parameters */ + static const int HAS_OPTIONAL = 0x00000008; + + /** allow extra args, but dont capture them */ + static const int IGNORE_REST = 0x00000010; + + /** method is native */ + static const int NATIVE = 0x00000020; + + /** method sets default namespace */ + static const int SETS_DXNS = 0x00000040; + + /** method has table for parameter names */ + static const int HAS_PARAM_NAMES = 0x00000080; + + /*@}*/ + + /** @name internal flags - upper 3 BYTES available */ + /*@{*/ + static const int OVERRIDE = 0x00010000; + + static const int NON_INTERRUPTABLE = 0x00020000; + + static const int UNBOX_THIS = 0x00040000; + + static const int NEEDS_CODECONTEXT = 0x00080000; + + static const int HAS_EXCEPTIONS = 0x00100000; + +#ifdef AVMPLUS_VERBOSE + static const int VERBOSE_VERIFY = 0x00200000; +#endif + + static const int NEEDS_DXNS = 0x00400000; + + static const int VERIFIED = 0x00800000; +#ifdef AVMPLUS_VERIFYALL + static const int VERIFY_PENDING = 0x01000000; +#endif + + /** indicates method is final, no overrides allowed */ + static const int FINAL = 0x02000000; + + /** indicates the function is a method, that pushes the + receiver object onto the scope chain at method entry */ + static const int NEED_CLOSURE = 0x04000000; + + /** set to indicate that a function has no bytecode body. */ + static const int ABSTRACT_METHOD = 0x08000000; + + #ifdef AVMPLUS_INTERP + /** + * set to indicate that a function has been compiled + * to native code. In release mode we always compile + * so we don't need the flag. + */ + static const int TURBO = 0x80000000; + + /** + * set to indictate that a function has been + * recommended to be interpreted. + */ + static const int SUGGEST_INTERP = 0x40000000; + #endif /* AVMPLUS_INTERP */ + + /** + * set once the signature types have been resolved and + * override signatures have been checked. + */ + static const int LINKED = 0x20000000; + + /*@}*/ + + /** + * @name NativeMethod flags + * These are used in the NativeMethod subclass + */ + /*@{*/ + /** cookie int passed into C++ code */ + static const int NATIVE_COOKIE = 0x10000000; + /*@}*/ + + DWB(Traits*) declaringTraits; + DWB(Traits*) activationTraits; + DWB(PoolObject*) pool; + + AvmCore* core() const + { + return pool->core; + } + + int iid() const + { + return ((unsigned)this)>>3; + } + + bool usesCallerContext() const + { + return pool->isBuiltin && (!(flags & NATIVE) || (flags & NEEDS_CODECONTEXT)); + } + + // Builtin + non-native functions always need the dxns code emitted + // Builtin + native functions have flags to specify if they need the dxns code + bool usesDefaultXmlNamespace() const + { + return pool->isBuiltin && (!(flags & NATIVE) || (flags & NEEDS_DXNS)); + } + + /** number of declared parameters including optionals */ + int param_count; + + /** last optional_count params are optional */ + int optional_count; + + // offset to first rest arg in native va_list, + // including the instance parameter. + // this is sum(sizeof(paramType(0..N))) + int restOffset; + + /** see bitmask defs above */ + int flags; + int method_id; + + /** pointer to abc MethodInfo record */ + const byte* info_pos; + + void initParamTypes(int count); + void initDefaultValues(int count); + + void resolveSignature(const Toplevel* toplevel); + + bool argcOk(int argc) + { + return argc >= param_count-optional_count && + (argc <= param_count || allowExtraArgs()); + } + + /** + * invoke this method. args are already coerced. argc + * is the number of arguments AFTER the instance, which + * is arg 0. ap will always have at least the instance. + */ + union { + int (*impl32)(MethodEnv*, int, va_list); + double (*implN)(MethodEnv*, int, va_list); + }; + + protected: + AbstractFunction(); + + public: + + void setParamType(int index, Traits* t); + void setDefaultValue(int index, Atom defaultValue); + void makeIntoPrototypeFunction(const Toplevel* toplevel); + + Traits* paramTraits(int index) const { + AvmAssert(index >= 0 && index <= param_count); + return m_types[index]; + } + + const Atom* getDefaultValues() const { + return m_values; + } + + Atom getDefaultValue(int i) const { + return m_values[i]; + } + + void setReturnType(Traits* t) { + m_returnType = t; + } + + Traits* returnTraits() const { + return m_returnType; + } + + int requiredParamCount() const { + return param_count-optional_count; + } + + int allowExtraArgs() const { + return isFlagSet(NEED_REST|NEED_ARGUMENTS|IGNORE_REST); + } + + int hasMethodBody() const { + return !isFlagSet(ABSTRACT_METHOD); + } + + int isFlagSet(int f) const { + return (flags & f); + } + + int hasExceptions() const { + return flags & HAS_EXCEPTIONS; + } + + int setsDxns() const { + return flags & SETS_DXNS; + } + + bool makeMethodOf(Traits* type); + +#ifdef AVMPLUS_VERIFYALL + int isVerified() const { + return flags & VERIFIED; + } + virtual void verify(Toplevel* toplevel) = 0; +#endif + + void boxArgs(int argc, va_list ap, Atom* out); + + protected: + DWB(Traits*) m_returnType; + DWB(Traits**) m_types; // actual length will be 1+param_count + DWB(Atom*) m_values; // default values for any optional params. size = optional_count + +#ifdef AVMPLUS_VERBOSE + + /** Dummy destructor to avoid warnings */ + virtual ~AbstractFunction() {} + public: + virtual Stringp format(const AvmCore* core) const; +#endif + +#if defined(AVMPLUS_VERBOSE) || defined(DEBUGGER) + public: + DRCWB(Stringp) name; +#endif +#ifdef DEBUGGER + virtual uint32 size() const; +#endif + }; +} + +#endif /* __avmplus_AbstractFunction__ */ diff --git a/mozilla/js/tamarin/core/ActionBlockConstants.cpp b/mozilla/js/tamarin/core/ActionBlockConstants.cpp new file mode 100644 index 00000000000..3b6a2a05d44 --- /dev/null +++ b/mozilla/js/tamarin/core/ActionBlockConstants.cpp @@ -0,0 +1,116 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmplus.h" + +namespace avmplus +{ + namespace ActionBlockConstants + { + const unsigned char kindToPushOp[] = { + 0, + OP_pushstring, // CONSTANT_Utf8=1 + 0, + OP_pushint, // CONSTANT_Int=3 + OP_pushint, // CONSTANT_UInt=4 + OP_pushnamespace, // CONSTANT_PrivateNs=5 + OP_pushdouble, // CONSTANT_Double=6 + 0, + OP_pushnamespace, // CONSTANT_Namespace=8 + 0, + OP_pushfalse, // CONSTANT_False=10 + OP_pushtrue, // CONSTANT_True=11 + OP_pushnull, // CONSTANT_Null=12 + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + OP_pushnamespace, //CONSTANT_PackageNamespace=22 + OP_pushnamespace, //CONSTANT_PackageInternalNs=23 + OP_pushnamespace, //CONSTANT_ProtectedNamespace=24 + OP_pushnamespace, //CONSTANT_ExplicitNamespace=25 + OP_pushnamespace, //CONSTANT_StaticProtectedNs=26 + }; + + +#ifdef AVMPLUS_VERBOSE + const char *constantNames[] = { + "const-0", + "utf8",//const int CONSTANT_Utf8 = 0x01; + "const-2", + "int",//const int CONSTANT_Int = 0x03; + "uint",//const int CONSTANT_UInt = 0x04; + "private",//const int CONSTANT_PrivateNS = 0x05; + "double",//const int CONSTANT_Double = 0x06; + "qname",//const int CONSTANT_Qname = 0x07; + "namespace",//const int CONSTANT_Namespace = 0x08; + "multiname",//const int CONSTANT_Multiname = 0x09; + "false",//const inst CONSTANT_False = 0x0A; + "true",//const int CONSTANT_True = 0x0B; + "null",//const int CONSTANT_Null = 0x0C; + "@qname",//const int CONSTANT_QnameAttr = 0x0D; + "@multiname",//const int CONSTANT_MultinameAttr= 0x0E; + "rtqname",//const int CONSTANT_RTQname = 0x0F; // ns::name, var qname, const name + "@rtqname",//const int CONSTANT_RTQnameA = 0x10; // @ns::name, var qname, const name + "rtqnamelate",//const int CONSTANT_RTQnameL = 0x11; // ns::[], var qname + "@rtqnamelate",//const int CONSTANT_RTQnameLA = 0x12; // @ns::[], var qname + "", //const int CONSTANT_NameL = 0x13, // o.[], ns=public implied, rt name + "", //CONSTANT_NameLA = 0x14, // o.@[], ns=public implied, rt attr-name + "namespaceset", //CONSTANT_NamespaceSet = 0x15 + "namespace", //PackageNamespace and Namespace are the same as far as the VM is concerned + "internal",//const int CONSTANT_PackageInternalNS = 0x17 + "protected",//const int CONSTANT_ProtectedNamespace = 0x18 + "explicit",//const int CONSTANT_ExplicitNamespace = 0x19 + "staticprotected",//const int CONSTANT_StaticProtectedNs = 0x1A, + "multinamelate", //const int CONSTANT_MultinameL = 0x1B, // o.[], ns, rt name + "@multinamelate" //CONSTANT_MultinameLA = 0x1C, // o.@[], ns, rt attr-name + }; + + const char *traitNames[] = { + "slot",//const int TRAIT_Slot = 0x00; + "method",//const int TRAIT_Method = 0x01; + "getter",//const int TRAIT_Getter = 0x02; + "setter",//const int TRAIT_Setter = 0x03; + "class",//const int TRAIT_Class = 0x04; + "function",//const int TRAIT_Function = 0x05; + "const",//const int TRAIT_Const = 0x06; + }; +#endif // AVMPLUS_VERBOSE + + #include "opcodes.cpp" + } +} diff --git a/mozilla/js/tamarin/core/ActionBlockConstants.h b/mozilla/js/tamarin/core/ActionBlockConstants.h new file mode 100644 index 00000000000..e10e98d65e7 --- /dev/null +++ b/mozilla/js/tamarin/core/ActionBlockConstants.h @@ -0,0 +1,131 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_ActionBlockConstants__ +#define __avmplus_ActionBlockConstants__ + + +namespace avmplus +{ + /** + * Constants for all of the opcodes in the AVM+ instruction set. + */ + namespace ActionBlockConstants + { + /** @name cpool tags */ + /*@{*/ + enum CPoolKind { + CONSTANT_Utf8 = 0x01, + CONSTANT_Int = 0x03, + CONSTANT_UInt = 0x04, + CONSTANT_PrivateNs = 0x05, // non-shared namespace + CONSTANT_Double = 0x06, + CONSTANT_Qname = 0x07, // o.ns::name, ct ns, ct name + CONSTANT_Namespace = 0x08, + CONSTANT_Multiname = 0x09, // o.name, ct nsset, ct name + CONSTANT_False = 0x0A, + CONSTANT_True = 0x0B, + CONSTANT_Null = 0x0C, + CONSTANT_QnameA = 0x0D, // o.@ns::name, ct ns, ct attr-name + CONSTANT_MultinameA = 0x0E, // o.@name, ct attr-name + CONSTANT_RTQname = 0x0F, // o.ns::name, rt ns, ct name + CONSTANT_RTQnameA = 0x10, // o.@ns::name, rt ns, ct attr-name + CONSTANT_RTQnameL = 0x11, // o.ns::[name], rt ns, rt name + CONSTANT_RTQnameLA = 0x12, // o.@ns::[name], rt ns, rt attr-name + CONSTANT_NamespaceSet = 0x15, + CONSTANT_PackageNamespace = 0x16, + CONSTANT_PackageInternalNs = 0x17, + CONSTANT_ProtectedNamespace = 0x18, + CONSTANT_ExplicitNamespace = 0x19, + CONSTANT_StaticProtectedNs = 0x1A, + CONSTANT_MultinameL = 0x1B, + CONSTANT_MultinameLA = 0x1C, + }; + /*@}*/ + + /** @name traits kinds */ + /*@{*/ + + enum TraitKind { + TRAIT_Slot = 0x00, + TRAIT_Method = 0x01, + TRAIT_Getter = 0x02, + TRAIT_Setter = 0x03, + TRAIT_Class = 0x04, + TRAIT_Function = 0x05, + TRAIT_Const = 0x06, + TRAIT_mask = 15, + }; + /*@}*/ + + /** @name attributes */ + /*@{*/ + const int ATTR_final = 0x10; // 1=final, 0=virtual + const int ATTR_override = 0x20; // 1=override, 0=new + const int ATTR_metadata = 0x40; // 1=has metadata, 0=no metadata + /*@}*/ + + /** @name opcodes */ + /*@{*/ + #include "opcodes.h" + /*@}*/ + + /** + * The opOperandCount array specifies the number of operands in + * each opcode. It is used by the VM to advance through + * bytecode streams. -1 means invalid opcode. + */ + extern signed char opOperandCount[]; + + /** + * The opCanThrow array specifies whether an opcode can throw + * exceptions or not. + */ + extern unsigned char opCanThrow[]; + +#if defined(AVMPLUS_PROFILE) || defined(AVMPLUS_VERBOSE) || defined(DEBUGGER) + extern const char *opNames[]; +#endif + + extern const unsigned char kindToPushOp[]; + +#ifdef AVMPLUS_VERBOSE + /** @name debugger string names */ + /*@{*/ + extern const char *constantNames[]; + extern const char *traitNames[]; + /*@}*/ +#endif + + } +} + +#endif /* __avmplus_ActionBlockConstants__ */ diff --git a/mozilla/js/tamarin/core/Array.as b/mozilla/js/tamarin/core/Array.as new file mode 100644 index 00000000000..f26f1477281 --- /dev/null +++ b/mozilla/js/tamarin/core/Array.as @@ -0,0 +1,428 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +package +{ + public dynamic class Array extends Object + { + // option flags for sort and sortOn + public static const CASEINSENSITIVE:uint = 1; + public static const DESCENDING:uint = 2; + public static const UNIQUESORT:uint = 4; + public static const RETURNINDEXEDARRAY:uint = 8; + public static const NUMERIC:uint = 16; + + // E262 {DontEnum, DontDelete} + public native function get length():uint + public native function set length(newLength:uint) + + // Array.length = 1 per ES3 + public static const length:int = 1 + + // ECMA 15.4.2.2 + public function Array(...args) + { + var n:uint = args.length + if (n == 1 && (args[0] is Number)) + { + var dlen:Number = args[0]; + var ulen:uint = dlen + if (ulen != dlen) + Error.throwError( RangeError, 1005 /*kArrayIndexNotIntegerError*/, dlen ); + length = ulen; + } + else + { + // FIXME why not just return args? + length = n + for (var i:uint=0; i < n; i++) + this[i] = args[i] + } + } + + /** + 15.4.4.5 Array.prototype.join (separator) + The elements of the array are converted to strings, and these strings are then concatenated, separated by + occurrences of the separator. If no separator is provided, a single comma is used as the separator. + The join method takes one argument, separator, and performs the following steps: + 1. Call the [[Get]] method of this object with argument "length". + 2. Call ToUint32(Result(1)). + 3. If separator is undefined, let separator be the single-character string ",". + 4. Call ToString(separator). + 5. If Result(2) is zero, return the empty string. + 6. Call the [[Get]] method of this object with argument "0". + 7. If Result(6) is undefined or null, use the empty string; otherwise, call ToString(Result(6)). + 8. Let R be Result(7). + 9. Let k be 1. + 10. If k equals Result(2), return R. + 11. Let S be a string value produced by concatenating R and Result(4). + 12. Call the [[Get]] method of this object with argument ToString(k). + 13. If Result(12) is undefined or null, use the empty string; otherwise, call ToString(Result(12)). + 14. Let R be a string value produced by concatenating S and Result(13). + 15. Increase k by 1. + 16. Go to step 10. + */ + + private static function _join(o, sep):String + { + var s:String = (sep === undefined) ? "," : String(sep) + var out:String = "" + for (var i:uint = 0, n:uint=uint(o.length); i < n; i++) + { + var x = o[i] + if (x != null) + out += x + if (i+1 < n) + out += s + } + return out + } + AS3 function join(sep=void 0):String + { + return _join(this, sep) + } + prototype.join = function(sep=void 0):String + { + return _join(this, sep) + } + + private static native function _pop(o) + AS3 native function pop() + prototype.pop = function() + { + return _pop(this) + } + + /** + 15.4.4.2 Array.prototype.toString ( ) + The result of calling this function is the same as if the built-in join method were invoked for this object with no + argument. + The toString function is not generic; it throws a TypeError exception if its this value is not an Array object. + Therefore, it cannot be transferred to other kinds of objects for use as a method. + */ + + prototype.toString = function():String + { + var a:Array = this // TypeError if not compatible + return _join(a, ","); + } + + /** + 15.4.4.3 Array.prototype.toLocaleString ( ) + The elements of the array are converted to strings using their toLocaleString methods, and these strings are + then concatenated, separated by occurrences of a separator string that has been derived in an implementationdefined + locale-specific way. The result of calling this function is intended to be analogous to the result of + toString, except that the result of this function is intended to be locale-specific. + The result is calculated as follows: + 1. Call the [[Get]] method of this object with argument "length". + 2. Call ToUint32(Result(1)). + 3. Let separator be the list-separator string appropriate for the host environment’s current locale (this is derived in + an implementation-defined way). + 4. Call ToString(separator). + 5. If Result(2) is zero, return the empty string. + 6. Call the [[Get]] method of this object with argument "0". + 7. If Result(6) is undefined or null, use the empty string; otherwise, call ToObject(Result(6)).toLocaleString(). + 8. Let R be Result(7). + 9. Let k be 1. + 10. If k equals Result(2), return R. + 11. Let S be a string value produced by concatenating R and Result(4). + 12. Call the [[Get]] method of this object with argument ToString(k). + 13. If Result(12) is undefined or null, use the empty string; otherwise, call ToObject(Result(12)).toLocaleString(). + 14. Let R be a string value produced by concatenating S and Result(13). + 15. Increase k by 1. + 16. Go to step 10. + The toLocaleString function is not generic; it throws a TypeError exception if its this value is not an Array + object. Therefore, it cannot be transferred to other kinds of objects for use as a method. + */ + + prototype.toLocaleString = function():String + { + var a:Array = this // TypeError if not compatible + + var out:String = "" + for (var i:uint = 0, n:uint=a.length; i < n; i++) + { + var x = a[i] + if (x != null) + out += x.toLocaleString() + if (i+1 < n) + out += "," + } + return out + } + + /** + When the push method is called with zero or more arguments item1, item2, etc., the following steps are taken: + 1. Call the [[Get]] method of this object with argument "length". + 2. Let n be the result of calling ToUint32(Result(1)). + 3. Get the next argument in the argument list; if there are no more arguments, go to step 7. + 4. Call the [[Put]] method of this object with arguments ToString(n) and Result(3). + 5. Increase n by 1. + 6. Go to step 3. + 7. Call the [[Put]] method of this object with arguments "length" and n. + 8. Return n. + The length property of the push method is 1. + NOTE The push function is intentionally generic; it does not require that its this value be an Array object. Therefore it can be + transferred to other kinds of objects for use as a method. Whether the push function can be applied successfully to a host object + is implementation-dependent. + */ + AS3 native function push(...args):uint + prototype.push = function(...args):uint + { + var n:uint = uint(this.length) + for (var i:uint=0, argc:uint=args.length; i < argc; i++) + this[n++] = args[i] + this.length = n + return n + } + + private static native function _reverse(o) + AS3 function reverse():Array + { + return _reverse(this) // return will cast to Array + } + prototype.reverse = function() + { + return _reverse(this) + } + + private static native function _concat(o, args:Array):Array + AS3 function concat(...args):Array + { + return _concat(this, args) + } + prototype.concat = function(...args):Array + { + return _concat(this, args) + } + + private static native function _shift(o) + AS3 function shift() + { + return _shift(this) + } + prototype.shift = function() + { + return _shift(this) + } + + private static native function _slice(o, A:Number, B:Number):Array + AS3 function slice(A=0, B=0xffffffff):Array + { + return _slice(this, Number(A), Number(B)) + } + prototype.slice = function(A=0, B=0xffffffff):Array + { + return _slice(this, Number(A), Number(B)) + } + + /** + 15.4.4.13 Array.prototype.unshift ( [ item1 [ , item2 [ , … ] ] ] ) + The arguments are prepended to the start of the array, such that their order within the array is the same as the + order in which they appear in the argument list. + When the unshift method is called with zero or more arguments item1, item2, etc., the following steps are taken: + 1. Call the [[Get]] method of this object with argument "length". + 2. Call ToUint32(Result(1)). + 3. Compute the number of arguments. + 4. Let k be Result(2). + 5. If k is zero, go to step 15. + 6. Call ToString(k–1). + 7. Call ToString(k+Result(3)–1). + 8. If this object has a property named by Result(6), go to step 9; but if this object has no property named by + Result(6), then go to step 12. + 9. Call the [[Get]] method of this object with argument Result(6). + 10. Call the [[Put]] method of this object with arguments Result(7) and Result(9). + 11. Go to step 13. + 12. Call the [[Delete]] method of this object with argument Result(7). + 13. Decrease k by 1. + 14. Go to step 5. + 15. Let k be 0. + 16. Get the next argument in the part of the argument list that starts with item1; if there are no more arguments, go + to step 21. + 17. Call ToString(k). + 18. Call the [[Put]] method of this object with arguments Result(17) and Result(16). + 19. Increase k by 1. + 20. Go to step 16. + 21. Call the [[Put]] method of this object with arguments "length" and (Result(2)+Result(3)). + 22. Return (Result(2)+Result(3)). + The length property of the unshift method is 1. + NOTE The unshift function is intentionally generic; it does not require that its this value be an Array object. Therefore it can + be transferred to other kinds of objects for use as a method. Whether the unshift function can be applied successfully to a + host object is implementation-dependent. + */ + native AS3 function unshift(...args):uint + prototype.unshift = function(...args):uint + { + var len:uint = uint(this.length) + var argc:uint = args.length + var k:uint + for (k=len; k > 0; ) + { + k-- + var d:uint = k+argc + if (k in this) + this[d] = this[k] + else + delete this[d] + } + + for (var i:uint = 0; i < argc; i++) + this[k++] = args[i] + + len += argc + this.length = len + return len + } + + private static native function _splice(o, args:Array):Array + + // splice with zero args returns undefined. All other cases return Array. + AS3 function splice(...args) + { + if (!args.length) + return undefined; + + return _splice(this, args) + } + prototype.splice = function(...args) + { + if (!args.length) + return undefined; + + return _splice(this, args) + } + + // sort can return an Array or a Number (unique sort option) + private static native function _sort(o, args:Array) + AS3 function sort(...args) + { + return _sort (this, args); + } + prototype.sort = function(...args) + { + return _sort (this, args); + } + + private static native function _sortOn(o, names, options) + AS3 function sortOn(names, options=0, ...ignored) + { + // this is our own addition so we don't have to make names be optional + return _sortOn(this, names, options); + } + prototype.sortOn = function(names, options=0, ...ignored) + { + return _sortOn(this, names, options) + } + + // Array extensions that are in Mozilla... + // http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Array + // + // These all work on generic objects (array like objects) as well as arrays + + private static native function _indexOf (o, searchElement, fromIndex:int):int; + AS3 function indexOf(searchElement, fromIndex=0):int + { + return _indexOf (this, searchElement, int(fromIndex)); + } + prototype.indexOf = function(searchElement, fromIndex=0):int + { + return _indexOf (this, searchElement, int(fromIndex)); + } + + private static native function _lastIndexOf (o, searchElement, fromIndex:int=0):int; + AS3 function lastIndexOf(searchElement, fromIndex=0x7fffffff):int + { + return _lastIndexOf (this, searchElement, int(fromIndex)); + } + prototype.lastIndexOf = function(searchElement, fromIndex=0x7fffffff):int + { + return _lastIndexOf (this, searchElement, int(fromIndex)); + } + + // Returns true if every element in this array satisfies the provided testing function. + private static native function _every(o, callback:Function, thisObject):Boolean; + AS3 function every(callback:Function, thisObject=null):Boolean + { + return _every (this, callback, thisObject); + } + prototype.every = function(callback:Function, thisObject=null):Boolean + { + return _every (this, callback, thisObject); + } + + // Creates a new array with all elements that pass the test implemented by the provided function. + private static native function _filter(o, callback:Function, thisObject):Array; + AS3 function filter(callback:Function, thisObject=null):Array + { + return _filter (this, callback, thisObject); + } + prototype.filter = function(callback:Function, thisObject=null):Array + { + return _filter (this, callback, thisObject); + } + + // Calls a function for each element in the array. + private static native function _forEach(o, callback:Function, thisObject):void; + AS3 function forEach(callback:Function, thisObject=null):void + { + _forEach (this, callback, thisObject); + } + prototype.forEach = function(callback:Function, thisObject=null):void + { + _forEach (this, callback, thisObject); + } + + // Creates a new array with the results of calling a provided function on every element in this array. + private native static function _map(o, callback:Function, thisObject):Array; + AS3 function map(callback:Function, thisObject=null):Array + { + return _map (this, callback, thisObject); + } + prototype.map = function(callback:Function, thisObject=null):Array + { + return _map (this, callback, thisObject); + } + + // Returns true if at least one element in this array satisfies the provided testing function. + private static native function _some(o, callback:Function, thisObject):Boolean; + AS3 function some(callback:Function, thisObject=null):Boolean + { + return _some (this, callback, thisObject); + } + prototype.some = function(callback:Function, thisObject=null):Boolean + { + return _some (this, callback, thisObject); + } + + _dontEnumPrototype(prototype); + } +} diff --git a/mozilla/js/tamarin/core/ArrayClass.cpp b/mozilla/js/tamarin/core/ArrayClass.cpp new file mode 100644 index 00000000000..2a77f4adbd5 --- /dev/null +++ b/mozilla/js/tamarin/core/ArrayClass.cpp @@ -0,0 +1,1613 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmplus.h" + +#ifdef _MAC +// inline_max_total_size() defaults to 10000. +// This module includes so many inline functions that we +// exceed this limit and we start getting compile warnings, +// so bump up the limit for this file. +#pragma inline_max_total_size(100000) +#endif + +using namespace MMgc; + +namespace avmplus +{ + BEGIN_NATIVE_MAP(ArrayClass) + NATIVE_METHOD_FLAGS(Array_length_get, ArrayObject::getLength, 0) + NATIVE_METHOD_FLAGS(Array_length_set, ArrayObject::setLength, 0) + NATIVE_METHOD_FLAGS(Array_AS3_pop, ArrayObject::pop, 0) + NATIVE_METHOD_FLAGS(Array_AS3_push, ArrayObject::push, 0) + NATIVE_METHOD_FLAGS(Array_AS3_unshift, ArrayObject::unshift, 0) + + NATIVE_METHOD(Array_private__pop, ArrayClass::pop) + NATIVE_METHOD(Array_private__reverse, ArrayClass::reverse) + NATIVE_METHOD(Array_private__concat, ArrayClass::concat) + NATIVE_METHOD(Array_private__shift, ArrayClass::shift) + NATIVE_METHOD(Array_private__slice, ArrayClass::slice) + NATIVE_METHOD(Array_private__splice, ArrayClass::splice) + NATIVE_METHOD(Array_private__sort, ArrayClass::sort) + NATIVE_METHOD(Array_private__sortOn, ArrayClass::sortOn) + + // Array extensions that are in Mozilla... + // http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Array + // + // These all work on generic objects (array like objects) as well as arrays + NATIVE_METHOD(Array_private__indexOf, ArrayClass::indexOf) + NATIVE_METHOD(Array_private__lastIndexOf, ArrayClass::lastIndexOf) + NATIVE_METHOD(Array_private__every, ArrayClass::every) + NATIVE_METHOD(Array_private__filter, ArrayClass::filter) + NATIVE_METHOD(Array_private__forEach, ArrayClass::forEach) + NATIVE_METHOD(Array_private__map, ArrayClass::map) + NATIVE_METHOD(Array_private__some, ArrayClass::some) + + END_NATIVE_MAP() + + // todo while close, the implementations here do not exactly match the + // ECMA spec, and probably in ways that the SpiderMonkey test suite won't + // catch... for instance, it will go haywire with array indices over + // 2^32 because we're not applying the ToInteger algorithm correctly. + // Indices have to handled as doubles until the last minute, then... + // the full 2^32 range is needed but there is behavior involving + // negative numbers too. + + ArrayClass::ArrayClass(VTable* cvtable) + : ClassClosure(cvtable), + kComma(core()->constantString(",")) + { + AvmCore* core = this->core(); + Toplevel* toplevel = this->toplevel(); + + toplevel->arrayClass = this; + AvmAssert(traits()->sizeofInstance == sizeof(ArrayClass)); + + VTable* ivtable = this->ivtable(); + ScriptObject* objectPrototype = toplevel->objectClass->prototype; + prototype = new (core->GetGC(), ivtable->getExtraSize()) ArrayObject(ivtable, objectPrototype, 0); + + // According to ECMAscript spec (ECMA-262.pdf) + // generic support: concat, join, pop, push, reverse, shift, slice, sort, splice, unshift + // NOT generic: toString, toLocaleString + // unknown: sortOn (our own extension) + +#if defined(MMGC_DRC) && defined(_DEBUG) + + // AtomArray DRC unit tests, put here b/c this always runs once, has a GC * and + // this class has to do with arrays. this is more convienent that trying to test + // through actionscript + + // create an atom + Stringp s = core->newString("foo"); + Atom a = s->atom(); + AvmAssert(s->RefCount()==0); + AtomArray *ar = new (gc()) AtomArray(); + + // test push/pop + ar->push(a); AvmAssert(s->RefCount()==1); + ar->push(a); AvmAssert(s->RefCount()==2); + ar->pop(); AvmAssert(s->RefCount()==1); + + // reverse + ar->push(a); AvmAssert(s->RefCount()==2); + ar->reverse(); AvmAssert(s->RefCount()==2); + + // shift + ar->shift(); AvmAssert(s->RefCount()==1); + + // splice + AtomArray *ar2 = new (gc()) AtomArray(); + ar->push(a); + ar2->push(ar); AvmAssert(s->RefCount()==4); + ar->splice(1, 2, 1, ar2, 0); // [a,a,a] + AvmAssert(s->RefCount()==5); + + // unshift + Atom as[4] = {a,a,a,a}; + ar->unshift(as, 4); + AvmAssert(s->RefCount()==9); + + // removeAt + ar->removeAt(1); AvmAssert(s->RefCount()==8); + + // setAt + ar->setAt(2, a); AvmAssert(s->RefCount()==8); + + // insert + ar->insert(2, a); AvmAssert(s->RefCount()==9); + + // clear + ar->clear(); AvmAssert(s->RefCount() == 2); + ar2->clear(); AvmAssert(s->RefCount() == 0); + + gc()->Free(ar); + gc()->Free(ar2); +#endif + } + + /** + 15.4.4.4 Array.prototype.concat ( [ item1 [ , item2 [ , + ] ] ] ) + When the concat method is called with zero or more arguments item1, item2, etc., it returns an array containing + the array elements of the object followed by the array elements of each argument in order. + The following steps are taken: + 1. Let A be a new array created as if by the expression new Array(). + 2. Let n be 0. + 3. Let E be this object. + 4. If E is not an Array object, go to step 16. + 5. Let k be 0. + 6. Call the [[Get]] method of E with argument "length". + 7. If k equals Result(6) go to step 19. + 8. Call ToString(k). + 9. If E has a property named by Result(8), go to step 10, + but if E has no property named by Result(8), go to step 13. + 10. Call ToString(n). + 11. Call the [[Get]] method of E with argument Result(8). + 12. Call the [[Put]] method of A with arguments Result(10) and Result(11). + 13. Increase n by 1. + 14. Increase k by 1. + 15. Go to step 7. + 16. Call ToString(n). + 17. Call the [[Put]] method of A with arguments Result(16) and E. + 18. Increase n by 1. + 19. Get the next argument in the argument list; if there are no more arguments, go to step 22. + 20. Let E be Result(19). + 21. Go to step 4. + 22. Call the [[Put]] method of A with arguments "length" and n. + 23. Return A. + The length property of the concat method is 1. + NOTE The concat function is intentionally generic; it does not require that its this value be an Array object. Therefore it can be + transferred to other kinds of objects for use as a method. Whether the concat function can be applied successfully to a host + object is implementation-dependent. + */ + ArrayObject* ArrayClass::concat(Atom thisAtom, ArrayObject* args) + { + AvmCore* core = this->core(); + ScriptObject *d = AvmCore::isObject(thisAtom) ? AvmCore::atomToScriptObject(thisAtom) : 0; + + uint32 len = 0; + if (d) + { + len = getLengthHelper (d); + } + + ArrayObject *a = isArray(thisAtom); + uint32 i; + + uint32 argc = args->getLength(); + + int newLength = len; + for (i = 0; i< argc; i++) + { + Atom atom = args->getUintProperty(i); + if (core->istype(atom, ARRAY_TYPE)) + { + ArrayObject *b = (ArrayObject*) AvmCore::atomToScriptObject(atom); + newLength += b->getLength(); + } + else + { + newLength++; + } + } + + ArrayObject *out = newArray(newLength); + int denseLength = 0; + // Only copy over elements for Arrays, not objects according to spec + // 4. If E is not an Array object, go to step 16. + if (a && newLength) + { + denseLength = a->getDenseLength(); + + // copy over our dense part + out->m_denseArr.push (&a->m_denseArr); + out->m_length += denseLength; + + // copy over any non-dense values (or all values if this isn't an array object) + for (i = denseLength; i < len; i++) { + out->setUintProperty(i, d->getUintProperty(i)); + } + } + + for (i = 0; i< (uint32)argc; i++) + { + Atom atom = args->getUintProperty(i); + if (core->istype(atom, ARRAY_TYPE)) + { + ArrayObject *b = (ArrayObject*) AvmCore::atomToScriptObject(atom); + // copy over dense parts + out->m_denseArr.push (&b->m_denseArr); + out->m_length += b->getDenseLength(); + + // copy over any non-dense values + uint32 len = b->getLength(); + for (uint32 j=b->getDenseLength(); jm_denseArr.push (b->getUintProperty(j)); + out->m_length++; + } + } + else + { + out->m_denseArr.push (atom); + out->m_length++; + } + } + + return out; + } + + /** + * Array.prototype.pop() + * TRANSFERABLE: Needs to support generic objects as well as Array objects + */ + Atom ArrayClass::pop(Atom thisAtom) + { + ArrayObject *a = isArray(thisAtom); + + if (a) + return a->pop(); + + if (!AvmCore::isObject(thisAtom)) + return undefinedAtom; + + // Different than Rhino (because of delete) but matches 262.pdf + ScriptObject *d = AvmCore::atomToScriptObject(thisAtom); + uint32 len = getLengthHelper (d); + if (!len) + { + setLengthHelper (d, 0); + return undefinedAtom; + } + else + { + Atom outAtom = d->getUintProperty (len-1); + d->delUintProperty (len - 1); + setLengthHelper (d, len - 1); + return outAtom; + } + } + + /** + * Array.prototype.reverse() + * TRANSFERABLE: Needs to support generic objects as well as Array objects + */ + Atom ArrayClass::reverse(Atom thisAtom) + { + ArrayObject *a = isArray(thisAtom); + + if (a && (a->isSimpleDense())) + { + a->m_denseArr.reverse(); + return thisAtom; + } + + // generic object version + if (!AvmCore::isObject(thisAtom)) + return thisAtom; + + ScriptObject *d = AvmCore::atomToScriptObject(thisAtom); + uint32 j = getLengthHelper (d); + + uint32 i = 0; + if (j) + j--; + + while (i < j) { + Atom frontAtom = d->getUintProperty(i); + Atom backAtom = d->getUintProperty(j); + + d->setUintProperty(i++, backAtom); + d->setUintProperty(j--, frontAtom); + } + + return thisAtom; + } + + /** + * Array.prototype.shift() + * TRANSFERABLE: Needs to support generic objects as well as Array objects + */ + Atom ArrayClass::shift(Atom thisAtom) + { + ArrayObject *a = isArray(thisAtom); + + if (a && a->isSimpleDense()) + { + if (!a->m_length) + return undefinedAtom; + + a->m_length--; + return (a->m_denseArr.shift()); + } + + if (!AvmCore::isObject(thisAtom)) + return undefinedAtom; + + Atom outAtom; + ScriptObject *d = AvmCore::atomToScriptObject(thisAtom); + uint32 len = getLengthHelper (d); + + if (len == 0) + { + // set len to 0 (ecmascript spec) + setLengthHelper (d, 0); + outAtom = undefinedAtom; + } + else + { + // Get the 0th element to return + outAtom = d->getUintProperty(0); + + // Move all of the elements down + for (uint32 i=0; isetUintProperty(i, d->getUintProperty(i+1)); + } + + d->delUintProperty (len - 1); + setLengthHelper (d, len - 1); + } + + return outAtom; + } + + /** + * Array.prototype.slice() + * TRANSFERABLE: Needs to support generic objects as well as Array objects + */ + ArrayObject* ArrayClass::slice(Atom thisAtom, double A, double B) + { + if (!AvmCore::isObject(thisAtom)) + return 0; + + ScriptObject *d = AvmCore::atomToScriptObject(thisAtom); + uint32 len = getLengthHelper (d); + + // if a param is passed then the first one is A + // if no params are passed then A = 0 + uint32 a = NativeObjectHelpers::ClampIndex(A, len); + uint32 b = NativeObjectHelpers::ClampIndex(B, len); + if (b < a) + b = a; + + ArrayObject *out = newArray(b-a); + + uint32 outIndex=0; + for (uint32 i=a; isetUintProperty (outIndex++, d->getUintProperty (i)); + } + + return out; + } + + static inline bool defined(Atom atom) { return (atom != undefinedAtom); } + static inline bool isInteger(Atom atom) { return ((atom&7) == kIntegerType); } + + /** + * ArraySort implements actionscript Array.sort(). + * It's also the base class SortWithParameters, which handles all other permutations of Array + */ + class ArraySort + { + public: + /************************************************************* + * Forward declarations required by public methods + *************************************************************/ + + /** Options from script */ + enum { + kCaseInsensitive = 1 + ,kDescending = 2 + ,kUniqueSort = 4 + ,kReturnIndexedArray = 8 + ,kNumeric = 16 + }; + + /** Array.sortOn() will pass an array of field names */ + struct FieldName + { + DRCWB(Stringp) name; + int options; + }; + + typedef int (*CompareFuncPtr) (const ArraySort *s, uint32 i, uint32 j); + + static int StringCompareFunc(const ArraySort *s, uint32 j, uint32 k) { return s->StringCompare(j, k); } + static int CaseInsensitiveStringCompareFunc(const ArraySort *s, uint32 j, uint32 k) { return s->CaseInsensitiveStringCompare(j, k); } + static int ScriptCompareFunc(const ArraySort *s, uint32 j, uint32 k) { return s->ScriptCompare(j, k); } + static int NumericCompareFunc(const ArraySort *s, uint32 j, uint32 k) { return s->NumericCompare(j, k); } + static int DescendingCompareFunc(const ArraySort *s, uint32 j, uint32 k) { return s->altCmpFunc(s, k, j); } + static int FieldCompareFunc(const ArraySort *s, uint32 j, uint32 k) { return s->FieldCompare(j, k); } + + public: + /************************************************************* + * Public Functions + *************************************************************/ + + ArraySort(Atom &result, ArrayClass *f, ScriptObject *d, int options, CompareFuncPtr cmpFunc, + CompareFuncPtr altCmpFunc, Atom cmpActionScript, uint32 numFields = 0, FieldName *fields = NULL); + + ~ArraySort(); + + // do the sort + Atom sort(); + + private: + /************************************************************* + * Private Functions + *************************************************************/ + + // non-recursive quicksort implementation + void qsort(uint32 lo, uint32 hi); + + // qsort() is abstracted from the array by swap() and compare() + // compare(), in turn, is abstracted from the array via get() + // + // cmpFunc is conditional, for instance : + // cmpFunc = DefaultCompareFunc; // Array.sort() + // cmpFunc = ScriptCompareFunc; // Array.sort(compareFunction) + int compare(uint32 lhs, uint32 rhs) const { return cmpFunc(this, lhs, rhs); } + Atom get(uint32 i) const { return atoms->getAt(index[i]); } + void swap(uint32 j, uint32 k) + { + uint32 temp = index[j]; + index[j] = index[k]; + index[k] = temp; + } + + inline int StringCompare(uint32 j, uint32 k) const; + inline int CaseInsensitiveStringCompare(uint32 j, uint32 k) const; + inline int ScriptCompare(uint32 j, uint32 k) const; + inline int NumericCompare(uint32 j, uint32 k) const; + inline int FieldCompare(uint32 j, uint32 k) const; + + /** + * null check + pointer cast. only used in contexts where we know we + * have a ScriptObject* already (verified, etc) + */ + ScriptObject* toFieldObject(Atom atom) const; + + private: + /************************************************************* + * Private Member Variables + *************************************************************/ + + ScriptObject *d; + AvmCore* core; + Toplevel* toplevel; + int options; + + CompareFuncPtr cmpFunc; + CompareFuncPtr altCmpFunc; + Atom cmpActionScript; + + uint32 *index; + AtomArray *atoms; + + uint32 numFields; + FieldName *fields; + AtomArray *fieldatoms; + }; + + ArraySort::ArraySort( + Atom &result, + ArrayClass *f, + ScriptObject *d, + int options, + CompareFuncPtr cmpFunc, + CompareFuncPtr altCmpFunc, + Atom cmpActionScript, + uint32 numFields, + FieldName *fields + ) : + d(d), + core(f->core()), + toplevel(f->toplevel()), + options(options), + cmpFunc(cmpFunc), + altCmpFunc(altCmpFunc), + cmpActionScript(cmpActionScript), + index(NULL), + atoms(NULL), + numFields(numFields), + fields(fields), + fieldatoms(NULL) + { + uint32 len = f->getLengthHelper (d); + uint32 iFirstUndefined = len; + uint32 iFirstAbsent = len; + + // new class[n] compiles into code which tries to allocate n * sizeof(class). + // unfortunately, the generated assembly does not protect against this product overflowing int. + // So I limit the length -- for larger values, I expect new will fail anyways. + if ((len > 0) && (len < (0x10000000))) + { + + index = new uint32[len]; + atoms = new (core->GetGC()) AtomArray(len); + atoms->setLength(len); + } + + if (!index || !atoms) + { + // return the unsorted array. + + // todo : grandma : Should I be raising an exception? Sort too big? + // could also fallback to an unindexed sort, but with that many elements, it won't finish for hours + result = d->atom(); + return; + } + + uint32 i, j; + uint32 newlen = len; + + // One field value - pre-get our field values so we can just do a regular sort + if (cmpFunc == ArraySort::FieldCompareFunc && numFields == 1) + { + fieldatoms = new (core->GetGC()) AtomArray(len); + fieldatoms->setLength(len); + + // note, loop needs to go until i = -1, but i is unsigned. 0xffffffff is a valid index, so check (i+1) != 0. + for (i = (len - 1), j = len; (i+1) != 0; i--) + { + index[i] = i; + Atom a = d->getUintProperty(i); + fieldatoms->setAt(i, a); + + if (AvmCore::isObject (a)) + { + ScriptObject* obj = AvmCore::atomToScriptObject (a); + + Stringp name = fields[0].name; + Multiname mname(core->publicNamespace, name); + + // An undefined prop just becomes undefined in our sort + Atom x = toplevel->getproperty(obj->atom(), &mname, obj->vtable); + atoms->setAt(i, x); + } + else + { + j--; + + uint32 temp = index[i]; + index[i] = index[j]; + + if (!d->hasUintProperty(i)) { + newlen--; + index[j] = index[newlen]; + index[newlen] = temp; + } else { + index[j] = temp; + } + } + } + + int opt = fields[0].options; + + if (opt & ArraySort::kNumeric) { + this->cmpFunc = ArraySort::NumericCompareFunc; + } else if (opt & ArraySort::kCaseInsensitive) { + this->cmpFunc = ArraySort::CaseInsensitiveStringCompareFunc; + } else { + this->cmpFunc = ArraySort::StringCompareFunc; + } + + if (opt & ArraySort::kDescending) { + this->altCmpFunc = this->cmpFunc; + this->cmpFunc = ArraySort::DescendingCompareFunc; + } + } + else + { + bool isNumericCompare = (cmpFunc == ArraySort::NumericCompareFunc) || (altCmpFunc == ArraySort::NumericCompareFunc); + // note, loop needs to go until i = -1, but i is unsigned. 0xffffffff is a valid index, so check (i+1) != 0. + for (i = (len - 1), j = len; (i+1) != 0; i--) + { + index[i] = i; + atoms->setAt(i, d->getUintProperty(i)); + + // We want to throw if this is an Array.NUMERIC sort and any items are not numbers, + // and not strings that can be converted into numbers + if(isNumericCompare && !core->isNumber(atoms->getAt(i))) + { + double val = core->number(atoms->getAt(i)); + if(MathUtils::isNaN(val)) + // throw exception (not a Number) + toplevel->throwTypeError(kCheckTypeFailedError, core->atomToErrorString(atoms->getAt(i)), core->toErrorString(core->traits.number_itraits)); + + } + + // getProperty() returns undefined when that's the value of the property. + // It also returns undefined when the object does not have the property. + // + // SortCompare() from ECMA 262 distinguishes these two cases. The end + // result is undefined comes after everything else, and missing properties + // come after that. + // + // To simplify our compare, partitition the array into { defined | undefined | missing } + // Note that every missing element shrinks the length -- we'll set this new + // length at the end of this routine when we are done. + + if (!defined(atoms->getAt(i))) { + j--; + + uint32 temp = index[i]; + index[i] = index[j]; + + if (!d->hasUintProperty(i)) { + newlen--; + index[j] = index[newlen]; + index[newlen] = temp; + } else { + index[j] = temp; + } + } + } + } + + iFirstAbsent = newlen; + iFirstUndefined = j; + + // The portion of the array containing defined values is now [0, iFirstUndefined). + // The portion of the array containing values undefined is now [iFirstUndefined, iFirstAbsent). + // The portion of the array containing absent values is now [iFirstAbsent, len). + + // now sort the remaining defined() elements + qsort(0, j-1); + + if (options & kUniqueSort) + { + // todo : kUniqueSort could throw an exception. + // todo : kUniqueSort could abort the sort once equal members are found + for (uint32 i = 0; i < (len - 1); i++) + { + if (compare(i, (i+1)) == 0) + { + result = core->uintToAtom(0); + return; + } + } + } + + if (options & kReturnIndexedArray) + { + // return the index array without modifying the original array + ArrayObject *obj = d->toplevel()->arrayClass->newArray(len); + + for (uint32 i = 0; i < len; i++) + { + obj->setUintProperty(i, core->uintToAtom(index[i])); + } + + result = obj->atom(); + } + else + { + // If we need to use our fieldatoms as results, temporarily swap them with + // our atoms array so the below code works on the right data. Fieldatoms contain + // our original objects while atoms contain our objects[field] values for faster + // sorting. + AtomArray *temp = atoms; + if (fieldatoms) + { + atoms = fieldatoms; + } + + for (i = 0; i < iFirstAbsent; i++) { + d->setUintProperty(i, get(i)); + } + + for (i = iFirstAbsent; i < len; i++) { + d->delUintProperty(i); + } + + //a->setLength(len); ES3: don't shrink array on sort. Seems silly + result = d->atom(); + atoms = temp; + + } + + return; + } + + ArraySort::~ArraySort() + { + delete [] index; + if(atoms) { + atoms->clear(); + core->GetGC()->Free(atoms); + atoms = NULL; + } + if(fieldatoms) { + fieldatoms->clear(); + core->GetGC()->Free(fieldatoms); + fieldatoms = NULL; + } + if(fields) { + int numFields = GC::Size(fields)/sizeof(FieldName); + for(int i=0; iGetGC()->Free(fields); + fields = NULL; + } + } + + /* + * QuickSort a portion of the ArrayObject. + */ + void ArraySort::qsort(uint32 lo, uint32 hi) + { + // This is an iterative implementation of the recursive quick sort. + // Recursive implementations are basically storing nested (lo,hi) pairs + // in the stack frame, so we can avoid the recursion by storing them + // in an array. + // + // Once partitioned, we sub-partition the smaller half first. This means + // the greatest stack depth happens with equal partitions, all the way down, + // which would be 1 + log2(size), which could never exceed 33. + + uint32 size; + struct StackFrame { uint32 lo, hi; }; + StackFrame stk[33]; + int stkptr = 0; + + // leave without doing anything if the array is empty (lo > hi) or only one element (lo == hi) + if (lo >= hi) + return; + + // code below branches to this label instead of recursively calling qsort() + recurse: + + size = (hi - lo) + 1; // number of elements in the partition + + if (size < 4) { + + // It is standard to use another sort for smaller partitions, + // for instance c library source uses insertion sort for 8 or less. + // + // However, as our swap() is essentially free, the relative cost of + // compare() is high, and with profiling, I found quicksort()-ing + // down to four had better performance. + // + // Although verbose, handling the remaining cases explicitly is faster, + // so I do so here. + + if (size == 3) { + if (compare(lo, lo + 1) > 0) { + swap(lo, lo + 1); + if (compare(lo + 1, lo + 2) > 0) { + swap(lo + 1, lo + 2); + if (compare(lo, lo + 1) > 0) { + swap(lo, lo + 1); + } + } + } else { + if (compare(lo + 1, lo + 2) > 0) { + swap(lo + 1, lo + 2); + if (compare(lo, lo + 1) > 0) { + swap(lo, lo + 1); + } + } + } + } else if (size == 2) { + if (compare(lo, lo + 1) > 0) + swap(lo, lo + 1); + } else { + // size is one, zero or negative, so there isn't any sorting to be done + } + } else { + // qsort()-ing a near or already sorted list goes much better if + // you use the midpoint as the pivot, but the algorithm is simpler + // if the pivot is at the start of the list, so move the middle + // element to the front! + uint32 pivot = lo + (size / 2); + swap(pivot, lo); + + + uint32 left = lo; + uint32 right = hi + 1; + + for (;;) { + // Move the left right until it's at an element greater than the pivot. + // Move the right left until it's at an element less than the pivot. + // If left and right cross, we can terminate, otherwise swap and continue. + // + // As each pass of the outer loop increments left at least once, + // and decrements right at least once, this loop has to terminate. + + do { + left++; + } while ((left <= hi) && (compare(left, lo) <= 0)); + + do { + right--; + } while ((right > lo) && (compare(right, lo) >= 0)); + + if (right < left) + break; + + swap(left, right); + } + + // move the pivot after the lower partition + swap(lo, right); + + // The array is now in three partions: + // 1. left partition : i in [lo, right), elements less than or equal to pivot + // 2. center partition : i in [right, left], elements equal to pivot + // 3. right partition : i in (left, hi], elements greater than pivot + // NOTE : [ means the range includes the lower bounds, ( means it excludes it, with the same for ] and ). + + // Many quick sorts recurse into the left partition, and then the right. + // The worst case of this can lead to a stack depth of size -- for instance, + // the left is empty, the center is just the pivot, and the right is everything else. + // + // If you recurse into the smaller partition first, then the worst case is an + // equal partitioning, which leads to a depth of log2(size). + if ((right - 1 - lo) >= (hi - left)) + { + if ((lo + 1) < right) + { + stk[stkptr].lo = lo; + stk[stkptr].hi = right - 1; + ++stkptr; + } + + if (left < hi) + { + lo = left; + goto recurse; + } + } + else + { + if (left < hi) + { + stk[stkptr].lo = left; + stk[stkptr].hi = hi; + ++stkptr; + } + + if ((lo + 1) < right) + { + hi = right - 1; + goto recurse; /* do small recursion */ + } + } + } + + // we reached the bottom of the well, pop the nested stack frame + if (--stkptr >= 0) + { + lo = stk[stkptr].lo; + hi = stk[stkptr].hi; + goto recurse; + } + + // we've returned to the top, so we are done! + return; + } + + /* + * compare(j, k) as string's + */ + int ArraySort::StringCompare(uint32 j, uint32 k) const + { + Atom x = get(j); + Atom y = get(k); + + Stringp str_lhs = core->string(x); + Stringp str_rhs = core->string(y); + + return str_rhs->Compare(*str_lhs); + } + + /* + * compare(j, k) as case insensitive string's + */ + int ArraySort::CaseInsensitiveStringCompare(uint32 j, uint32 k) const + { + Atom x = get(j); + Atom y = get(k); + + Stringp str_lhs = core->string(x)->toLowerCase(); + Stringp str_rhs = core->string(y)->toLowerCase(); + + return str_rhs->Compare(*str_lhs); + } + + /* + * compare(j, k) using an actionscript function + */ + int ArraySort::ScriptCompare(uint32 j, uint32 k) const + { + // todo must figure out the kosher way to invoke + // callbacks like the sort comparator. + + // todo what is thisAtom supposed to be for the + // comparator? Passing in the array for now. + + ScriptObject *o = (ScriptObject*) AvmCore::atomToScriptObject(cmpActionScript); + + Atom args[3] = { d->atom(), get(j), get(k) }; + double result = core->toInteger(o->call(2, args)); + // cn: don't use core->integer on result of call. The returned + // value could be bigger than 2^32 and toInt32 will return the + // ((value % 2^32) - 2^31), which could change the intended sign of the number. + // + //return core->integer(o->call(a->atom(), args, 2)); + return (result > 0 ? 1 : (result < 0 ? -1 : 0)); + } + + /* + * compare(j, k) as numbers + */ + int ArraySort::NumericCompare(uint32 j, uint32 k) const + { + Atom atmj = get(j); + Atom atmk = get(k); + // Integer checks makes an int array sort about 3x faster. + // A double array sort is 5% slower because of this overhead + if (((atmj & 7) == kIntegerType) && ((atmk & 7) == kIntegerType)) + { + return ((int)atmj - (int)atmk); + } + + double x = core->number(atmj); + double y = core->number(atmk); + double diff = x - y; + + if (diff == diff) { // same as !isNaN + return (diff < 0) ? -1 : ((diff > 0) ? 1 : 0); + } else if (!MathUtils::isNaN(y)) { + return 1; + } else if (!MathUtils::isNaN(x)) { + return -1; + } else { + return 0; + } + } + + ScriptObject* ArraySort::toFieldObject(Atom atom) const + { + if ((atom&7) != kObjectType) + { + #if 0 + /* cn: ifdefed out, not sure what the intent was here, but calling code in FieldCompare + * does null checking, apparently expecting this function to return null when the item + * isn't an object (and thus can't have custom properties added to it). */ + // TypeError in ECMA + toplevel->throwTypeError( + (atom == undefinedAtom) ? kConvertUndefinedToObjectError : + kConvertNullToObjectError); + #endif + return NULL; + } + return AvmCore::atomToScriptObject(atom); + } + + /* + * FieldCompare is for Array.sortOn() + */ + inline int ArraySort::FieldCompare(uint32 lhs, uint32 rhs) const + { + Atom j, k; + int opt = options; + int result = 0; + + j = get(lhs); + k = get(rhs); + + ScriptObject* obj_j = toFieldObject(j); + ScriptObject* obj_k = toFieldObject(k); + + if (!(obj_j && obj_k)) + { + if (obj_k) { + result = 1; + } else if (obj_j) { + result = -1; + } else { + result = 0; + } + return (opt & kDescending) ? -result : result; + } + + for (uint32 i = 0; i < numFields; i++) + { + Stringp name = fields[i].name; + Multiname mname(core->publicNamespace, name); + + opt = fields[i].options; // override the group defaults with the current field + + Atom x = toplevel->getproperty(obj_j->atom(), &mname, obj_j->vtable); + Atom y = toplevel->getproperty(obj_k->atom(), &mname, obj_k->vtable); + + bool def_x = defined(x); + bool def_y = defined(y); + + if (!(def_x && def_y)) + { + // ECMA 262 : Section 15.4.4.11 lists the rules. + // There is a difference between the object has a property + // with value undefined, and it does not have the property, + // for which getProperty() returns undefined. + + // def_x implies has_x + // def_y implies has_y + + if (def_y) { + result = 1; + } else if (def_x) { + result = -1; + } else { + bool has_x = (toplevel->getBinding(obj_j->vtable->traits, &mname) != BIND_NONE) || obj_j->hasProperty(name); + bool has_y = (toplevel->getBinding(obj_k->vtable->traits, &mname) != BIND_NONE) || obj_k->hasProperty(name); + + if (!has_x && has_y) { + result = 1; + } else if (has_x && !has_y) { + result = -1; + } else { + result = 0; + } + } + } else if (opt & kNumeric) { + double lhs = core->number(x); + double rhs = core->number(y); + double diff = lhs - rhs; + + if (diff == diff) { // same as !isNaN + result = (diff < 0) ? -1 : ((diff > 0) ? 1 : 0); + } else if (!MathUtils::isNaN(rhs)) { + result = 1; + } else if (!MathUtils::isNaN(lhs)) { + result = -1; + } else { + result = 0; + } + } + else + { + Stringp str_lhs = core->string(x); + Stringp str_rhs = core->string(y); + + if (opt & kCaseInsensitive) + { + str_lhs = str_lhs->toLowerCase(); + str_rhs = str_rhs->toLowerCase(); + } + + result = str_rhs->Compare(*str_lhs); + } + + if (result != 0) + break; + } + + if (opt & kDescending) + return -result; + else + return result; + } + + /** + * Array.prototype.sort() + * TRANSFERABLE: Needs to support generic objects as well as Array objects + */ + + // thisAtom is object to process + // 1st arg of args is a function or a number + // 2nd arg of args is a number + // + // valid AS3 syntax: + // sort() + // sort(function object) + // sort(number flags) + // sort(function object, number flags) + + // This takes a args object because there is no way to distinguigh between sort() + // and sort(undefined, 0) if we take default parameters. + Atom ArrayClass::sort(Atom thisAtom, ArrayObject *args) + { + AvmCore* core = this->core(); + if (!AvmCore::isObject(thisAtom)) + return undefinedAtom; + + ScriptObject *d = AvmCore::atomToScriptObject(thisAtom); + ArraySort::CompareFuncPtr compare = NULL; + ArraySort::CompareFuncPtr altCompare = NULL; + + Atom cmp = undefinedAtom; + int opt = 0; + if (args->getLength() >= 1) + { + // function ptr + Atom arg0 = args->getUintProperty(0); + if (AvmCore::isObject (arg0)) + { + // make sure the sort function is callable + cmp = arg0; + toplevel()->coerce(cmp, core->traits.function_itraits); + compare = ArraySort::ScriptCompareFunc; + if (args->getLength() >= 2) + { + Atom arg1 = args->getUintProperty(1); + if (core->isNumber(arg1)) + { + opt = core->integer (arg1); + } + else + { + // throw exception (not a Number) + toplevel()->throwTypeError(kCheckTypeFailedError, core->atomToErrorString(arg1), core->toErrorString(core->traits.number_itraits)); + } + } + } + else if (core->isNumber(arg0)) + { + opt = core->integer (arg0); + } + else + { + // throw exception (not a function) + toplevel()->throwTypeError(kCheckTypeFailedError, core->atomToErrorString(arg0), core->toErrorString(core->traits.function_itraits)); + } + } + + if (cmp == undefinedAtom) + { + if (opt & ArraySort::kNumeric) { + compare = ArraySort::NumericCompareFunc; + } else if (opt & ArraySort::kCaseInsensitive) { + compare = ArraySort::CaseInsensitiveStringCompareFunc; + } else { + compare = ArraySort::StringCompareFunc; + } + } + + if (opt & ArraySort::kDescending) { + altCompare = compare; + compare = ArraySort::DescendingCompareFunc; + } + + Atom result; + ArraySort sort(result, this, d, opt, compare, altCompare, cmp); + + return result; + } + + + /** + * Array.prototype.sortOn() + * TRANSFERABLE: Needs to support generic objects as well as Array objects + */ + Atom ArrayClass::sortOn(Atom thisAtom, Atom namesAtom, Atom optionsAtom) + { + AvmCore* core = this->core(); + if (!AvmCore::isObject(thisAtom)) + return undefinedAtom; + ScriptObject *d = AvmCore::atomToScriptObject(thisAtom); + + // Possible combinations: + // Array.sortOn(String) + // Array.sortOn(String, options) + // Array.sortOn(Array of String) + // Array.sortOn(Array of String, options) + // Array.sortOn(Array of String, Array of options) + + // What about options which must be global, such as kReturnIndexedArray? + // Perhaps it is the union of all field's options? + + ArraySort::FieldName *fn = NULL; + uint32 nFields = 0; + int options = 0; + + if (core->istype(namesAtom, STRING_TYPE)) + { + nFields = 1; + + options = core->integer(optionsAtom); + + fn = (ArraySort::FieldName*) core->GetGC()->Alloc(sizeof(ArraySort::FieldName), GC::kZero|GC::kContainsPointers); + fn[0].name = core->internString(namesAtom); + fn[0].options = options; + } + else if (core->istype(namesAtom, ivtable()->traits /* array itraits */)) + { + ArrayObject *obj = (ArrayObject *)AvmCore::atomToScriptObject(namesAtom); + + nFields = obj->getLength(); + fn = (ArraySort::FieldName*) core->GetGC()->Calloc(nFields, sizeof(ArraySort::FieldName), GC::kZero|GC::kContainsPointers); + + for (uint32 i = 0; i < nFields; i++) + { + fn[i].name = core->internString(obj->getUintProperty(i)); + fn[i].options = 0; + } + + if (core->istype(optionsAtom, ivtable()->traits /* array itraits */)) + { + ArrayObject *obj = (ArrayObject *)AvmCore::atomToScriptObject(optionsAtom); + uint32 nOptions = obj->getLength(); + if (nOptions == nFields) + { + // The first options are used for uniqueSort and returnIndexedArray option + options = core->integer(obj->getUintProperty(0)); + for (uint32 i = 0; i < nFields; i++) + { + fn[i].options = core->integer(obj->getUintProperty (i)); + } + } + } + else + { + options = core->integer(optionsAtom); + for (uint32 i = 0; i < nFields; i++) + { + fn[i].options = options; + } + } + } + + // ~ArraySort() will "delete [] fn;" + Atom result; + ArraySort sort(result, this, d, options, ArraySort::FieldCompareFunc, NULL, undefinedAtom, nFields, fn); + return result; + } + + /** + * Array.prototype.splice() + * TRANSFERABLE: Needs to support generic objects as well as Array objects + */ + + // Spidermonkey behavior that we are mimicking... + // splice() - no arguments - return undefined + // splice(org arg) coerce the input to a number (otherwise it's zero) normal behavior + // splice (two args) - coerce both args to numbers (otherwise they are zero) + ArrayObject* ArrayClass::splice(Atom thisAtom, + ArrayObject* args) + { + // This will return null but this case should never get hit (see Array.as) + if (!args->getLength()) + return 0; + + AvmCore* core = this->core(); + if (!AvmCore::isObject(thisAtom)) + return 0; + ScriptObject *d = AvmCore::atomToScriptObject(thisAtom); + + uint32 len = getLengthHelper (d); + + uint32 start = NativeObjectHelpers::ClampIndex(core->toInteger(args->getUintProperty(0)),len); + + double d_deleteCount = args->getLength() > 1 ? core->toInteger(args->getUintProperty(1)) : (len - start); + uint32 deleteCount = (d_deleteCount < 0) ? 0 : core->integer_d(d_deleteCount); + if (deleteCount > (len - start)) { + deleteCount = len - start; + } + uint32 end = start + deleteCount; + + // Copy out the elements we are going to remove + ArrayObject *out = newArray(deleteCount); + uint32 i; + + // !!@ add faster version when both arrays are simpleDense + for (i=0; i< deleteCount; i++) { + out->setUintProperty(i, d->getUintProperty(i+start)); + } + + uint32 insertCount = (args->getLength() > 2) ? (args->getLength() - 2) : 0; + long l_shiftAmount = (long)insertCount - (long) deleteCount; // long because result could be negative + uint32 shiftAmount; + + ArrayObject *a = isArray(thisAtom); + if (a && a->isSimpleDense() && args->isSimpleDense()) + { + a->m_denseArr.splice (start, insertCount, deleteCount, &args->m_denseArr, 2); + a->m_length += l_shiftAmount; + return out; + } + + // delete items by shifting elements past end (of delete) by l_shiftAmount + if (l_shiftAmount < 0) { + // Shift the remaining elements down + shiftAmount = (uint32)(-l_shiftAmount); + + for (i=end; isetUintProperty(i-shiftAmount, d->getUintProperty(i)); + } + + // delete top elements here to match ECMAscript spec (generic object support) + for (i=len-shiftAmount; idelUintProperty (i); + } + } else { + // Shift the remaining elements up. + shiftAmount = (uint32)l_shiftAmount; + + for (i=len; i > end; ) { // Note: i is unsigned, can't check if --i >=0. + --i; + d->setUintProperty(i+shiftAmount, d->getUintProperty(i)); + } + } + + // Add the items to insert + for (i=0; isetUintProperty(start+i, args->getUintProperty(i + 2)); + } + + // shrink array if shiftAmount is negative + setLengthHelper (d, len+l_shiftAmount); + + return out; + } + + ArrayObject* ArrayClass::newarray(Atom* argv, int argc) + { + ArrayObject *inst = newArray(argc); + + for (uint32 i=0; isetUintProperty(i, argv[i]); + } + + return inst; + } + + ArrayObject* ArrayClass::newArray(uint32 capacity) + { + VTable* ivtable = this->ivtable(); + ArrayObject *a = new (core()->GetGC(), ivtable->getExtraSize()) + ArrayObject(ivtable, prototype, capacity); +#ifdef DEBUGGER + if( core()->allocationTracking ) + { + toplevel()->arrayClass->addInstance(a->atom()); + } +#endif + return a; + } + + + ArrayObject* ArrayClass::createInstance(VTable *ivtable, ScriptObject* prototype) + { + return new (core()->GetGC(), ivtable->getExtraSize()) ArrayObject(ivtable, prototype, 0); + } + + int ArrayClass::indexOf (Atom thisAtom, Atom searchElement, int startIndex) + { + AvmCore* core = this->core(); + if (!AvmCore::isObject(thisAtom)) + return -1; + + ScriptObject *d = AvmCore::atomToScriptObject(thisAtom); + uint32 len = getLengthHelper (d); + + uint32 start = NativeObjectHelpers::ClampIndexInt(startIndex, len); + + for (uint32 i = start; i < len; i++) + { + Atom atom = d->getUintProperty(i); + if (core->stricteq (atom, searchElement) == trueAtom) + return i; + } + + return -1; + } + + int ArrayClass::lastIndexOf (Atom thisAtom, Atom searchElement, int startIndex) + { + AvmCore* core = this->core(); + if (!AvmCore::isObject(thisAtom)) + return -1; + + ScriptObject *d = AvmCore::atomToScriptObject(thisAtom); + uint32 len = getLengthHelper (d); + + int start = NativeObjectHelpers::ClampIndexInt(startIndex, len); + if (start == int(len)) + start--; + + for (int i = start; i >= 0; i--) + { + Atom atom = d->getUintProperty(i); + if (core->stricteq (atom, searchElement) == trueAtom) + return i; + } + + return -1; + } + + bool ArrayClass::every (Atom thisAtom, ScriptObject *callback, Atom thisObject) + { + AvmCore* core = this->core(); + if (!AvmCore::isObject(thisAtom) || !callback) + return true; + + if (callback->isMethodClosure() && !AvmCore::isNull(thisObject)) + { + toplevel()->throwTypeError(kArrayFilterNonNullObjectError); + } + + ScriptObject *d = AvmCore::atomToScriptObject(thisAtom); + uint32 len = getLengthHelper (d); + + // If thisObject is null, the call function will substitute the global object + Atom args[4] = { thisObject, nullObjectAtom, nullObjectAtom, thisAtom }; + + for (uint32 i = 0; i < len; i++) + { + args[1] = d->getUintProperty (i); // element + args[2] = core->uintToAtom (i); // index + + Atom result = callback->call(3, args); + if (result != trueAtom) + return false; + } + + return true; + } + + ArrayObject *ArrayClass::filter (Atom thisAtom, ScriptObject *callback, Atom thisObject) + { + AvmCore* core = this->core(); + ArrayObject *r = newArray(); + + if (!AvmCore::isObject(thisAtom) || !callback) + return r; + + if (callback->isMethodClosure() && !AvmCore::isNull(thisObject)) + { + toplevel()->throwTypeError(kArrayFilterNonNullObjectError); + } + + ScriptObject *d = AvmCore::atomToScriptObject(thisAtom); + uint32 len = getLengthHelper (d); + + // If thisObject is null, the call function will substitute the global object + Atom args[4] = { thisObject, nullObjectAtom, nullObjectAtom, thisAtom }; + + for (uint32 i = 0; i < len; i++) + { + args[1] = d->getUintProperty (i); // element + args[2] = core->uintToAtom (i); // index + + Atom result = callback->call(3, args); + if (result == trueAtom) + { + r->push (args + 1, 1); + } + } + + return r; + } + + void ArrayClass::forEach (Atom thisAtom, ScriptObject *callback, Atom thisObject) + { + AvmCore* core = this->core(); + if (!AvmCore::isObject(thisAtom) || !callback) + return; + + if (callback->isMethodClosure() && !AvmCore::isNull(thisObject)) + { + toplevel()->throwTypeError(kArrayFilterNonNullObjectError); + } + + ScriptObject *d = AvmCore::atomToScriptObject(thisAtom); + uint32 len = getLengthHelper (d); + + // If thisObject is null, the call function will substitute the global object + Atom args[4] = { thisObject, nullObjectAtom, nullObjectAtom, thisAtom }; + + for (uint32 i = 0; i < len; i++) + { + args[1] = d->getUintProperty (i); // element + args[2] = core->uintToAtom (i); // index + + callback->call(3, args); + } + } + + bool ArrayClass::some (Atom thisAtom, ScriptObject *callback, Atom thisObject) + { + AvmCore* core = this->core(); + if (!AvmCore::isObject(thisAtom) || !callback) + return false; + + if (callback->isMethodClosure() && !AvmCore::isNull(thisObject)) + { + toplevel()->throwTypeError(kArrayFilterNonNullObjectError); + } + + ScriptObject *d = AvmCore::atomToScriptObject(thisAtom); + uint32 len = getLengthHelper (d); + + // If thisObject is null, the call function will substitute the global object + Atom args[4] = { thisObject, nullObjectAtom, nullObjectAtom, thisAtom }; + + for (uint32 i = 0; i < len; i++) + { + args[1] = d->getUintProperty (i); // element + args[2] = core->uintToAtom (i); // index + + Atom result = callback->call(3, args); + if (result == trueAtom) + return true; + } + + return false; + } + + ArrayObject *ArrayClass::map (Atom thisAtom, ScriptObject *callback, Atom thisObject) + { + AvmCore* core = this->core(); + ArrayObject *r = newArray(); + + if (!AvmCore::isObject(thisAtom) || !callback) + return r; + + ScriptObject *d = AvmCore::atomToScriptObject(thisAtom); + uint32 len = getLengthHelper (d); + + // If thisObject is null, the call function will substitute the global object + Atom args[4] = { thisObject, nullObjectAtom, nullObjectAtom, thisAtom }; + + for (uint32 i = 0; i < len; i++) + { + args[1] = d->getUintProperty (i); // element + args[2] = core->uintToAtom (i); // index + + Atom result = callback->call(3, args); + + r->push (&result, 1); + } + + return r; + } + + uint32 ArrayClass::getLengthHelper (ScriptObject *d) + { + AvmCore* core = this->core(); + Multiname mname(core->publicNamespace, core->klength); + Atom lenAtm = toplevel()->getproperty (d->atom(), &mname, d->vtable); + return core->toUInt32 (lenAtm); + } + + void ArrayClass::setLengthHelper (ScriptObject *d, uint32 newLen) + { + AvmCore* core = this->core(); + Multiname mname(core->publicNamespace, core->klength); + Atom lenAtm = core->uintToAtom(newLen); + toplevel()->setproperty (d->atom(), &mname, lenAtm, d->vtable); + } +} diff --git a/mozilla/js/tamarin/core/ArrayClass.h b/mozilla/js/tamarin/core/ArrayClass.h new file mode 100644 index 00000000000..a87948af1a0 --- /dev/null +++ b/mozilla/js/tamarin/core/ArrayClass.h @@ -0,0 +1,97 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_ArrayClass__ +#define __avmplus_ArrayClass__ + + +namespace avmplus +{ + /** + * class Array + */ + class ArrayClass : public ClassClosure + { + public: + ArrayClass(VTable* cvtable); + + // this = argv[0] + // arg1 = argv[1] + // argN = argv[argc] + Atom call(int argc, Atom* argv) + { + return construct(argc, argv); + } + + // create a new array, even when argc=1 + ArrayObject* newarray(Atom* argv, int argc); + + ArrayObject* newArray(uint32 capacity=0); + + // override ScriptObject::createInstance + ArrayObject* createInstance(VTable *ivtable, ScriptObject* prototype); + + ArrayObject* concat(Atom thisAtom, ArrayObject* args); + Atom pop(Atom thisAtom); + Atom reverse(Atom thisAtom); + Atom shift(Atom thisAtom); + ArrayObject* slice(Atom thisAtom, double A, double B); + Atom sort(Atom thisAtom, ArrayObject *args); + Atom sortOn(Atom thisAtom, Atom namesAtom, Atom optionsAtom); + ArrayObject* splice(Atom thisAtom, ArrayObject* args); + + int indexOf (Atom thisAtom, Atom searchElement, int startIndex); + int lastIndexOf (Atom thisAtom, Atom searchElement, int startIndex); + bool every (Atom thisAtom, ScriptObject *callback, Atom thisObject); + ArrayObject *filter (Atom thisAtom, ScriptObject *callback, Atom thisObject); + void forEach (Atom thisAtom, ScriptObject *callback, Atom thisObject); + bool some (Atom thisAtom, ScriptObject *callback, Atom thisObject); + ArrayObject *map (Atom thisAtom, ScriptObject *callback, Atom thisObject); + + DECLARE_NATIVE_MAP(ArrayClass) + + uint32 getLengthHelper (ScriptObject *d); + + private: + void setLengthHelper (ScriptObject *d, uint32 newLen); + + ArrayObject* isArray(Atom instance) + { + if (core()->istype(instance, ivtable()->traits)) + return (ArrayObject*)AvmCore::atomToScriptObject(instance); + return NULL; + } + + const DRCWB(Stringp) kComma; + }; +} + +#endif /* __avmplus_ArrayClass__ */ diff --git a/mozilla/js/tamarin/core/ArrayObject.cpp b/mozilla/js/tamarin/core/ArrayObject.cpp new file mode 100644 index 00000000000..f581214ae88 --- /dev/null +++ b/mozilla/js/tamarin/core/ArrayObject.cpp @@ -0,0 +1,515 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmplus.h" + +namespace avmplus +{ + ArrayObject::ArrayObject(VTable *vtable, ScriptObject* proto, uint32 capacity) + : ScriptObject(vtable, proto, 0), + m_denseArr(capacity) + { + AvmAssert(traits()->sizeofInstance >= sizeof(ArrayObject)); + m_length = 0; + m_lowHTentry = NO_LOW_HTENTRY; + } + +#if 0 // Test code to determine if our array is a pure dense array + bool ArrayObject::getDense() + { + // If are dense part equals are length and we have no + // atoms in our HT, we are a pure dense array. We can't + // call getTable()->GetSize() since we might have deleted + // atoms in our HT and size would be non-zero. + return (isSimpleDense() && !ScriptObject::nextNameIndex(0)); + } +#endif + + // This routine checks to see if our dense portion is directly next + // to any entries in our HT. If so, the HT entries are deleted and added + // to the dense portion. If the HT is completely emptied, it is cleared. + void ArrayObject::checkForSparseToDenseConversion() + { + // check for lowHTentry being consumed + if (m_lowHTentry == NO_LOW_HTENTRY) + return; + + if (getDenseLength() != m_lowHTentry) + return; + + AvmCore *core = this->core(); + while (getDenseLength() == m_lowHTentry) + { + AvmAssert (ScriptObject::hasUintProperty (m_lowHTentry)); + + // Move prop from HT to dense Array. No need to update m_length + Atom lowHT = ScriptObject::getUintProperty (m_lowHTentry); + this->m_denseArr.push (lowHT); + + // Delete prop from HT + ScriptObject::delUintProperty (m_lowHTentry); + + // If our low entry happened to match our length, we're out of HT entries + // and we can just quit. + if ((m_lowHTentry + 1) == m_length) + { + m_lowHTentry = NO_LOW_HTENTRY; + } + else + { + // Find the next integer HT prop and update m_lowHTentry + // This is tricky. Our HT section could be huge but very sparse + // Do we want to linearly walk from index+1 to m_length or do + // we want to walk the entire HT looking for a low integer value? + + if (ScriptObject::hasUintProperty (m_lowHTentry + 1)) + { + m_lowHTentry++; + } + else + { + // assume we don't find an entry + m_lowHTentry = NO_LOW_HTENTRY; + int index = ScriptObject::nextNameIndex(0); + while (index) + { + Atom name = ScriptObject::nextName (index); + uint32 nameIndex; + if (core->getIndexFromAtom (name, &nameIndex)) + { + if ((m_lowHTentry == NO_LOW_HTENTRY) || (nameIndex < m_lowHTentry)) + { + m_lowHTentry = nameIndex; + } + } + + index = ScriptObject::nextNameIndex(index); + } + } + } + } + + // We're done moving our sparse entries over to our dense part of our array. + // This may have left a large HT that is now completely empty. If ScriptObject::nextNameIndex(0) + // returns 0, we know we have no atoms in our HT and we can clear it. + if (ScriptObject::nextNameIndex (0) == 0) + getTable()->reset(); + } + + void ArrayObject::setProperty(Atom name, Atom value) + { + if (traits()->needsHashtable) + { + AvmCore *core = this->core(); + // Update the array length. + uint32 index; + if (core->getIndexFromAtom (name, &index)) + { + return setUintProperty (index, value); + } + + if (name == core->klength->atom()) + return setLength(core->toUInt32(value)); + } + + ScriptObject::setProperty(name, value); + } + + void ArrayObject::setUintProperty(uint32 index, Atom value) + { + if (traits()->needsHashtable) + { + if (hasDense()) + { + if (index == getDenseLength()) + { + this->m_denseArr.push (value); + if (m_length < getDenseLength()) + m_length = getDenseLength(); + + checkForSparseToDenseConversion (); + return; + } + else if (index < getDenseLength()) + { + this->m_denseArr.setAt (index, value); + return; + } + else + { + // fall through and put the new property into our HT + } + } + // If we're NOT dense yet and setting first element, we can create a dense array + else if (index == 0) + { + m_denseArr.push (value); + if (!m_length) + m_length = 1; + else + checkForSparseToDenseConversion (); + return; + } + + if (m_length <= index) { + m_length = index+1; + } + + if ((m_lowHTentry == NO_LOW_HTENTRY) || (index < m_lowHTentry)) + m_lowHTentry = index; + } + // end if (dynamic) + + // If our index value is going to overflow our int atom storage and be + // converted to a string, do that here instead of calling the + // SciptObject::setUintProperty which will call ArrayObject::setProperty + // which will call back into this routine in an infinite loop. + if (index & ScriptObject::MAX_INTEGER_MASK) + ScriptObject::setProperty (core()->internUint32(index)->atom(), value); + else + ScriptObject::setUintProperty(index, value); + } + + Atom ArrayObject::getProperty(Atom name) const + { + if (traits()->needsHashtable) + { + AvmCore *core = this->core(); + if (hasDense()) + { + uint32 index; + if (core->getIndexFromAtom (name, &index)) + { + // if we get here, we have a valid integer index. + if ((index < getDenseLength())) + return m_denseArr.getAtFast(index); + } + } + + if (name == core->klength->atom()) + return core->intToAtom (getLength()); + } + + return ScriptObject::getProperty (name); + } + + Atom ArrayObject::getUintProperty(uint32 index) const + { + if (traits()->needsHashtable) + { + if (hasDense()) + { + if ((index < getDenseLength())) + return m_denseArr.getAtFast(index); + } + } + + return ScriptObject::getUintProperty (index); + } + + Atom ArrayObject::getIntProperty(int index) const + { + if (index >= 0) + return getUintProperty(index); + else // integer is negative - we must intern it + return getProperty(core()->internInt(index)); + } + + void ArrayObject::setIntProperty(int index, Atom value) + { + if (index >= 0) + setUintProperty(index, value); + else // integer is negative - we must intern it + setProperty(core()->internInt(index), value); + } + + // This does NOT affect the length of the array + bool ArrayObject::deleteProperty(Atom name) + { + if (traits()->needsHashtable) + { + if (hasDense()) + { + uint32 index; + if (core()->getIndexFromAtom (name, &index)) + { + return delUintProperty(index); + } + } + } + + return ScriptObject::deleteProperty (name); + } + + bool ArrayObject::delUintProperty(uint32 index) + { + // if we get here, we have a valid integer index. + if (traits()->needsHashtable) + { + if ((index < getDenseLength())) + { + if (index == (getDenseLength() - 1)) + { + m_denseArr.pop(); + } + // We're deleting an element in the middle of our array. The lower + // part can be left in the dense array but the upper part needs to + // get moved to the HT. + else + { + for (uint32 i = index + 1; i < getDenseLength(); i++) + { + ScriptObject::setUintProperty (i, m_denseArr.getAtFast(i)); + } + m_denseArr.splice (index, 0, (getDenseLength() - index), 0); + } + + return true; + } + } + return ScriptObject::delUintProperty(index); + } + + bool ArrayObject::propertyIsEnumerable(Atom name) const + { + if (traits()->needsHashtable) + { + if (hasDense()) + { + uint32 index; + if (core()->getIndexFromAtom(name, &index)) + { + // {DontEnum} is not supported on the dense portion + // of an array. Those properties are always enumerable. + if (index < getDenseLength()) + return true; + } + } + } + + return ScriptObject::propertyIsEnumerable(name); + } + + bool ArrayObject::hasProperty(Atom name) const + { + if (traits()->needsHashtable) + { + if (hasDense()) + { + uint32 index; + if (core()->getIndexFromAtom (name, &index)) + { + if (index < getDenseLength()) + return true; + } + } + } + + return ScriptObject::hasProperty (name); + } + + bool ArrayObject::hasUintProperty(uint32 index) const + { + if (traits()->needsHashtable) + { + if (hasDense()) + { + if (index < getDenseLength()) + return true; + } + } + + return ScriptObject::hasUintProperty (index); + } + + // Iterator support - for in, for each + Atom ArrayObject::nextName(int index) + { + AvmAssert(index > 0); + + int denseLength = (int)getDenseLength(); + if (index <= denseLength) + { + AvmCore *core = this->core(); + return core->intToAtom(index-1); + } + else + { + return ScriptObject::nextName (index - denseLength); + } + } + + Atom ArrayObject::nextValue(int index) + { + AvmAssert(index > 0); + + int denseLength = (int) getDenseLength(); + if (index <= denseLength) + { + return m_denseArr.getAtFast (index-1); + } + else + { + return ScriptObject::nextValue (index - denseLength); + } + } + + int ArrayObject::nextNameIndex(int index) + { + int denseLength = (int) getDenseLength(); + if (index < denseLength) + { + return index + 1; + } + else + { + index = ScriptObject::nextNameIndex (index - denseLength); + if (!index) + return index; + return denseLength + index; + } + } + +#ifdef AVMPLUS_VERBOSE + Stringp ArrayObject::format(AvmCore* core) const + { + Stringp prefix = core->newString("[]@"); + return core->concatStrings(prefix, core->formatAtomPtr(atom())); + } +#endif + + void ArrayObject::setLength(uint32 newLength) + { + if (traits()->needsHashtable) + { + // Delete all items between size and newLength + uint32 oldLength = getLength(); + if (newLength < oldLength) + { + uint32 deleteStart = newLength; + uint32 denseLength = getDenseLength(); + if (newLength < denseLength) + { + this->m_denseArr.splice (deleteStart, 0, (denseLength - deleteStart), 0); + deleteStart = denseLength; + } + + for (uint32 i = deleteStart; i < oldLength; i++) { + delUintProperty(i); + } + } + m_length = newLength; + } + // else, if !dynamic ignore set. + } + + // public native function pop(...rest):Object + Atom ArrayObject::pop() + { + if (isSimpleDense()) + { + if (!m_length) + return undefinedAtom; + + m_length--; + return m_denseArr.pop (); + } + + if (getLength() != 0) + { + Atom outAtom = getUintProperty(getLength()-1); + setLength(getLength()-1); + return outAtom; + } + else + { + return undefinedAtom; + } + } + + uint32 ArrayObject::push(Atom* argv, int argc) + { + if (isSimpleDense()) + { + m_denseArr.push (argv, argc); + m_length += argc; + } + else + { + for (int i=0; i < argc; i++) { + setUintProperty(getLength(), argv[i]); + } + } + return m_length; + } + + uint32 ArrayObject::unshift(Atom* argv, int argc) + { + if (argc != 0) + { + if (isSimpleDense()) + { + m_denseArr.unshift (argv, argc); + m_length += argc; + } + else + { + uint32 i; + // First, move all the elements up + uint32 len = getLength(); + for (i=len; i > 0; ) { // note: i is unsigned, can't check if --i >=0. + i--; + setUintProperty(i+argc, getUintProperty(i)); + } + + for (i=0; i < ((uint32)argc); i++) { + setUintProperty(i, argv[i]); + } + + setLength(len+argc); + } + } + + return getLength(); + } + +#ifdef DEBUGGER + uint32 ArrayObject::size() const + { + if(isSimpleDense()) + { + return ScriptObject::size() + getLength()*sizeof(Atom); + } + return ScriptObject::size(); + } +#endif +} diff --git a/mozilla/js/tamarin/core/ArrayObject.h b/mozilla/js/tamarin/core/ArrayObject.h new file mode 100644 index 00000000000..818ec8ec2fb --- /dev/null +++ b/mozilla/js/tamarin/core/ArrayObject.h @@ -0,0 +1,136 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_ArrayObject__ +#define __avmplus_ArrayObject__ + + +namespace avmplus +{ + /** + * an instance of class Array. constructed with "new Array" or + * an array literal [...]. We need this class to support Array's + * special "get" and "put" semantics and to maintain the virtual + * "length" property. + */ + class ArrayObject : public ScriptObject + { + private: + friend class ArrayClass; + AtomArray m_denseArr; + + // We can NOT use 0xFFFFFFFF for this since x[0xFFFFFFFE] is a valid prop + // which would make our length 0xFFFFFFFF + static const uint32 NO_LOW_HTENTRY = 0; + uint32 m_lowHTentry; // lowest numeric entry in our hash table + uint32 m_length; + public: + + ArrayObject(VTable* ivtable, ScriptObject *delegate, uint32 capacity); + ~ArrayObject() + { + m_lowHTentry = 0; + m_length = 0; + } + + bool hasDense() const { return (m_denseArr.getLength() != 0); }; + bool isSimpleDense() const { return (m_denseArr.getLength() == m_length); }; + uint32 getDenseLength() const { return m_denseArr.getLength(); } + + uint32 getLength() const { return (m_length); } + void setLength(uint32 newLength); + + Atom getProperty(Stringp name) const { return getProperty(name->atom()); } + void setProperty(Stringp name, Atom value) { setProperty(name->atom(), value); } + bool deleteProperty(Stringp name) { return deleteProperty(name->atom()); } + bool hasProperty(Stringp name) const { return hasProperty(name->atom()); } + + Atom getProperty(Atom name) const; + void setProperty(Atom name, Atom value); + bool deleteProperty(Atom name); + bool hasProperty(Atom name) const; + + // Faster versions that takes direct indices + Atom getUintProperty(uint32 index) const; + void setUintProperty(uint32 index, Atom value); + bool delUintProperty(uint32 index); + bool hasUintProperty(uint32 i) const; + + Atom getIntProperty(int index) const; + void setIntProperty(int index, Atom value); + + bool propertyIsEnumerable(Atom name) const; + + #ifdef AVMPLUS_MAC + // Hack for Mac; can't take addr of virtual function + Atom _getUintProperty(uint32 index) const + { + return getUintProperty(index); + } + void _setUintProperty(uint32 index, Atom value) + { + setUintProperty(index, value); + } + Atom _getIntProperty(int index) const + { + return getIntProperty(index); + } + void _setIntProperty(int index, Atom value) + { + setIntProperty(index, value); + } + #endif + + // Iterator support - for in, for each + Atom nextName(int index); + Atom nextValue(int index); + int nextNameIndex(int index); + + // native methods + Atom pop(); // pop(...rest) + uint32 push(Atom *args, int argc); // push(...args):uint + uint32 unshift(Atom *args, int argc); // unshift(...args): + + void checkForSparseToDenseConversion(); + +#ifdef DEBUGGER + uint32 size() const; +#endif + +#ifdef AVMPLUS_VERBOSE + public: + Stringp format(AvmCore* core) const; +#endif + + }; +} + +#endif /* __avmplus_ArrayObject__ */ diff --git a/mozilla/js/tamarin/core/AtomArray.cpp b/mozilla/js/tamarin/core/AtomArray.cpp new file mode 100644 index 00000000000..182ee235036 --- /dev/null +++ b/mozilla/js/tamarin/core/AtomArray.cpp @@ -0,0 +1,304 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +///////////////////////////////////////////////////////// +// AtomArray object +///////////////////////////////////////////////////////// +#include "avmplus.h" + +namespace avmplus +{ + using namespace MMgc; + + AtomArray::AtomArray (int initialCapacity) + { + m_length = 0; + if (!initialCapacity) + { + m_atoms = 0; + } + else + { + if (initialCapacity < kMinCapacity) + initialCapacity = kMinCapacity; + GC *gc = GC::GetGC(this); + setAtoms(gc, (Atom*) gc->Calloc(initialCapacity, sizeof(Atom), GC::kContainsPointers|GC::kZero)); + } + } + + AtomArray::~AtomArray() + { + clear(); + } + + ///////////////////////////////////////////////////// + // Array AS API + ///////////////////////////////////////////////////// + + // Pop last element off the end of the array and shrink length + Atom AtomArray::pop() + { + if (!m_length) + return undefinedAtom; + + Atom retAtom = m_atoms[m_length - 1]; + setAtInternal(m_length - 1, 0); // so GC collects this item + m_length--; + return retAtom; + } + + using namespace MMgc; + + // n arguments are pushed on the array + uint32 AtomArray::push(Atom *args, int argc) + { + checkCapacity (m_length + argc); + + // slow path to trigger write barrier + for(int i=0; i < argc; i++) { + push(args[i]); + } + + return argc; + } + + // Reverse array elements + void AtomArray::reverse() + { + if (m_length > 1) + { + for (uint32 k = 0; k < (m_length >> 1); k++) + { + Atom temp = m_atoms[k]; + m_atoms[k] = m_atoms[m_length - k - 1]; + m_atoms[m_length - k - 1] = temp; + } + } + } + + // return 0th element, shift rest down + Atom AtomArray::shift() + { + if (!m_length) + return undefinedAtom; + + Atom *arr = m_atoms; + Atom retAtom = arr[0]; + setAtInternal(0, 0); + memmove (arr, arr + 1, (m_length - 1) * sizeof(Atom)); + arr[m_length - 1] = 0; // clear item so GC can collect it. + m_length--; + + return retAtom; + } + + // insertPoint arg - place to insert + // insertCount arg - number to insert + // deleteCount - number to delete + // args - #insertCount args to insert + void AtomArray::splice(uint32 insertPoint, uint32 insertCount, uint32 deleteCount, AtomArray *args, int offset) + { + long l_shiftAmount = (long)insertCount - (long) deleteCount; // long because result could be negative + + // Must be BEFORE arr = m_atoms since m_atoms might change + checkCapacity (m_length + l_shiftAmount); + + Atom *arr = m_atoms; + Atom *argsArr = args ? args->m_atoms : 0; + + if (l_shiftAmount < 0) + { + int numberBeingDeleted = -l_shiftAmount; + + // whack deleted items so they're ref count goes down + AvmCore::decrementAtomRegion(arr + insertPoint + insertCount, numberBeingDeleted); + + // shift elements down + int toMove = m_length - insertPoint - deleteCount; + memmove (arr + insertPoint + insertCount, arr + insertPoint + deleteCount, toMove * sizeof(Atom)); + + // clear top part for RC purposes + memset (arr + m_length - numberBeingDeleted, 0, numberBeingDeleted * sizeof(Atom)); + } + else if (l_shiftAmount > 0) + { + memmove (arr + insertPoint + l_shiftAmount, arr + insertPoint, (m_length - insertPoint) * sizeof(Atom)); + // clear for RC purposes + memset (arr + insertPoint, 0, l_shiftAmount * sizeof(Atom)); + } + + // Add the items to insert + if (insertCount) + { + AvmAssert(args != 0); + for (uint32 i=0; i= 0); + // !!@ handle case where capacity shrinks by 50% (resize buffer smaller) + + if (!m_atoms || newLength > int(capacity())) + { + // We oversize our buffer by 50% (is that the best algorithm?) + int capacity = newLength + (newLength >> 2); + if (capacity < kMinCapacity) capacity = kMinCapacity; + GC* gc = GC::GetGC(this); + Atom* newAtoms = (Atom*) gc->Calloc(capacity, sizeof(Atom), GC::kContainsPointers|GC::kZero); + Atom* oldAtoms = m_atoms; + setAtoms(gc, newAtoms); + if(oldAtoms) { + // use a memcpy to skip ref counting + memcpy(m_atoms, oldAtoms, m_length*sizeof(Atom)); + memset(oldAtoms, 0, m_length*sizeof(Atom)); + gc->Free(oldAtoms); + } + } + } + + void AtomArray::push (Atom a) + { + checkCapacity (m_length + 1); + setAtInternal(m_length++, a); + } + + void AtomArray::push (const AtomArray *a) + { + if (!a) + return; + + push (a->m_atoms, a->getLength()); + } + + void AtomArray::removeAt (uint32 index) + { + AvmAssert (m_length > 0); + AvmAssert (index >= 0); + AvmAssert (index < uint32(m_length)); + if (!m_length) + return; + + checkCapacity (m_length - 1); + + m_length--; + // use setAt instead of direct access for proper ref count maintenance + setAtInternal(index, 0); + Atom *arr = m_atoms; + if (m_length) + { + // shift down entries + memmove (arr + index, arr + index + 1, (this->m_length - index) * sizeof(Atom)); + } + arr[m_length] = 0; // clear our entry so GC can collect it + } + + void AtomArray::insert (uint32 index, Atom a) + { + AvmAssert(index <= m_length); + + checkCapacity (m_length + 1); + m_length++; + + Atom *arr = m_atoms; + // shift entries up by one to make room + memmove (arr + index + 1, arr + index, (m_length - index - 1) * sizeof(Atom)); + // this element is still in the array so don't let setAtInternal decrement its count + m_atoms[index] = 0; + setAtInternal(index, a); + } + + void AtomArray::setAt (uint32 index, Atom a) + { + if (index > m_length) + { + AvmAssert(0); + return; + } + + setAtInternal(index, a); + } + + Atom AtomArray::getAt (uint32 index) const + { + if (index > m_length) + { + AvmAssert(0); + return nullObjectAtom; + } + + return m_atoms[index]; + } + + void AtomArray::clear() + { +#ifdef MMGC_DRC + AvmCore::decrementAtomRegion(m_atoms, m_length); +#endif + m_length = 0; + if(m_atoms) { + GC::GetGC(m_atoms)->Free(m_atoms); + m_atoms = 0; + } + } +} diff --git a/mozilla/js/tamarin/core/AtomArray.h b/mozilla/js/tamarin/core/AtomArray.h new file mode 100644 index 00000000000..aacfa877906 --- /dev/null +++ b/mozilla/js/tamarin/core/AtomArray.h @@ -0,0 +1,127 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 1993-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#ifndef __avmplus_AtomArray__ +#define __avmplus_AtomArray__ + +namespace avmplus +{ + class AtomArray + { + public: + AtomArray(int initialCapacity = 0); + ~AtomArray(); + + ///////////////////////////////////////////////////// + // Array AS API support + ///////////////////////////////////////////////////// + + // Pop last element off the end of the array and shrink length + Atom pop(); + + // n arguments are pushed on the array (argc is returned) + uint32 push(Atom *args, int argc); + + // Reverse array elements + void reverse(); + + // return 0th element, shift rest down + Atom shift(); + + // insertPoint arg - place to insert + // insertCount arg - number to insert + // deleteCount - number to delete + // args - #insertCount args to insert + // offset - offset in args to start the insertion from. + void splice(uint32 insertPoint, uint32 insertCount, uint32 deleteCount, AtomArray *args, int offset=0); + + // insert array of arguments at front of array + Atom unshift(Atom *args, int argc); + + ///////////////////////////////////////////////////// + + uint32 getLength() const { return m_length; }; + void setLength(uint32 len) { m_length = len; } + uint32 capacity() const + { + return MMgc::GC::Size(m_atoms)/sizeof(Atom); + } + + void push (Atom a); + void push (const AtomArray *a); + void removeAt (uint32 index); + + void insert (uint32 index, Atom a); + void setAt (uint32 index, Atom a); + + void clear(); + + Atom operator[](uint32 index) const { return getAt(index); }; + Atom getAt(uint32 index) const; + + // ONLY USE THIS IF YOU PRE-CHECK THE LENGTH + Atom getAtFast(uint32 index) const + { + AvmAssert(index < m_length); + return m_atoms[index]; + }; + + /** + * Compacts the AtomArray so it is exactly large enough + * to hold the contents of the array. + * + * This is useful for conserving memory. + */ + void pack(); + + void checkCapacity (int newLength); + + private: + uint32 m_length; + Atom* m_atoms; + + const static uint32 kMinCapacity = 4; + + void setAtInternal(uint32 index, Atom a) + { + // m_arr[index] = a; + WBATOM( MMgc::GC::GetGC(m_atoms), m_atoms, m_atoms + index, a); + } + + void setAtoms(MMgc::GC *gc, Atom *atoms) + { + WB(gc, gc->FindBeginning(this), &m_atoms, atoms); + } + }; +} + +#endif /* __avmplus_AtomArray__ */ diff --git a/mozilla/js/tamarin/core/AtomConstants.cpp b/mozilla/js/tamarin/core/AtomConstants.cpp new file mode 100644 index 00000000000..c3635bb4ebc --- /dev/null +++ b/mozilla/js/tamarin/core/AtomConstants.cpp @@ -0,0 +1,38 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmplus.h" + +namespace avmplus +{ +} + diff --git a/mozilla/js/tamarin/core/AtomConstants.h b/mozilla/js/tamarin/core/AtomConstants.h new file mode 100644 index 00000000000..c5f67d2af11 --- /dev/null +++ b/mozilla/js/tamarin/core/AtomConstants.h @@ -0,0 +1,143 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_AtomConstants__ +#define __avmplus_AtomConstants__ + + +namespace avmplus +{ + /** + * The AtomConstants namespace defines constants for + * manipulating atoms. + * + * The atom is a primitive value in ActionScript. Since + * ActionScript is a dynamically typed language, an atom can + * belong to one of several types: null, undefined, number, + * integer, string, boolean, object reference. + * + * Atoms are encoded with care to take up the minimum + * possible space. An atom is represented by a 32-bit + * integer, with the bottom 3 bits indicating the type. + * + * 32 bit atom + * + * 31 16 15 8 7 3 210 + * dddddddd dddddddd dddddddd ddddd TTT + * + * TTT + * 000 - untagged + * 001 object + * 010 string + * 011 namespace + * 100 undefined + * 101 boolean + * 110 integer + * 111 double + * + * - using last 3 bits means allocations must be 8-byte aligned. + * - related types are 1 bit apart, e.g. int/double + * + * kInteger atoms are used to represent integer values from -2^28..2^28-1, + * regardless of whether the context implies int, uint, or Number. + * If a number doesn't fit into that range it is stored as a kDoubleType + * + */ + namespace AtomConstants + { + /** + * @name Atom types + * These are the type values that appear in the bottom + * 3 bits of an atom. + */ + /*@{*/ + // cannot use 0 as tag, breaks atomWriteBarrier + const Atom kObjectType = 1; // null=1 + const Atom kStringType = 2; // null=2 + const Atom kNamespaceType = 3; // null=3 + const Atom kSpecialType = 4; // undefined=4 + const Atom kBooleanType = 5; // false=5 true=13 + const Atom kIntegerType = 6; + const Atom kDoubleType = 7; + /*@}*/ + + #define ISNULL(a) (((unsigned)a) < kSpecialType) + + /* + other things you can do with math on atoms + + isNull (unsigned)a < 4 + isUndefined a == undefinedAtom + isSpecial (unsigned)a <= 4 + isNumber a & 6 == 6 + + ^8 jlt(a<8) ^2 jle(a<=4) + true 1110 0110 t 1100 f + false 0110 1110 f 0100 t + undefined 0100 1100 f 0110 f + */ + + /** + * @name Special atom values + * These are the atoms for undefined, null, true + * and false. + */ + /*@{*/ + // there is no single null atom. use isNull() to test, or + // one of the following typed null atoms. if you must, use NULL (0). + const Atom nullObjectAtom = kObjectType|0; + const Atom nullStringAtom = kStringType|0; + const Atom nullNsAtom = kNamespaceType|0; + const Atom undefinedAtom = kSpecialType|0; // 0x03 + const Atom trueAtom = kBooleanType|0x08; // 0x0D + const Atom falseAtom = kBooleanType|0x00; // 0x05 + /*@}*/ + + /** + * @name BIND constants + * These BIND constants are used similarly to atom kinds. Since we + * have a conservative collector, the codes aren't important. + */ + /*@{*/ + const Binding BIND_NONE = 0; // no such binding + const Binding BIND_AMBIGUOUS = -1; + const Binding BIND_METHOD = 1; // int disp_id local method number + const Binding BIND_VAR = 2; // int local slot number (r/w var) + const Binding BIND_CONST = 3; // int local slot number (r/o const) + const Binding BIND_ITRAMP = 4; // interface trampoline in imt table + const Binding BIND_GET = 5; // get-only property 101 + const Binding BIND_SET = 6; // set-only property 110 + const Binding BIND_GETSET = 7; // readwrite property 111 + /*@}*/ + } +} + +#endif /* __avmplus_AtomConstants__ */ diff --git a/mozilla/js/tamarin/core/AtomWriteBarrier.h b/mozilla/js/tamarin/core/AtomWriteBarrier.h new file mode 100644 index 00000000000..4e53c579e5e --- /dev/null +++ b/mozilla/js/tamarin/core/AtomWriteBarrier.h @@ -0,0 +1,88 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_AtomWriteBarrier__ +#define __avmplus_AtomWriteBarrier__ + + +namespace avmplus +{ +#ifndef WRITE_BARRIERS +#define ATOM_WB Atom +#define WBATOM(gc, c, a, v) *(a) = v +#else + // Optimized Atom write barrier + class AtomWB + { + public: + AtomWB() {} + AtomWB(Atom t) + { + set(t); + } + AtomWB(const AtomWB& toCopy) + { + set(toCopy.atom); + } + + ~AtomWB() { set(0); } + + const Atom& operator=(const AtomWB& wb) + { + return set(wb.atom); + } + + const Atom& operator=(const Atom& tNew) + { + return set(tNew); + } + + operator const Atom&() const { return atom; } + + private: + + Atom& set(const Atom& atomNew) + { + if(atom == atomNew) + return atom; + MMgc::GC *gc = MMgc::GC::GetGC(this); + AvmCore::atomWriteBarrier(gc, gc->FindBeginning(this), (Atom*)this, atomNew); + return atom; + } + Atom atom; + }; +#define ATOM_WB AtomWB +#define WBATOM(gc, c, a, v) AvmCore::atomWriteBarrier(gc, c, a, v) +#endif // WRITE_BARRIERS + +} + +#endif /* __avmplus_AtomWriteBarrier__ */ diff --git a/mozilla/js/tamarin/core/AvmCore.cpp b/mozilla/js/tamarin/core/AvmCore.cpp new file mode 100644 index 00000000000..c8eb813877a --- /dev/null +++ b/mozilla/js/tamarin/core/AvmCore.cpp @@ -0,0 +1,3877 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 1993-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmplus.h" + +namespace avmplus +{ + using namespace MMgc; + +#ifdef DEBUGGER + bool AvmCore::sampling = false; + bool AvmCore::autoStartSampling = false; +#endif + + BEGIN_NATIVE_CLASSES(AvmCore) + NATIVE_CLASS(abcclass_Object, ObjectClass, ScriptObject) + NATIVE_CLASS(abcclass_Class, ClassClass, ClassClosure) + NATIVE_CLASS(abcclass_Namespace, NamespaceClass, Namespace) + NATIVE_CLASS(abcclass_Function, FunctionClass, ClassClosure) + NATIVE_CLASS(abcclass_builtin_as_0_MethodClosure, MethodClosureClass, MethodClosure) + + NATIVE_CLASS(abcclass_Error, ErrorClass, ErrorObject) + + // The Error subclasses are included in the NATIVE_CLASS map + // so that their [[Call]] action is mapped to [[Construct]] + NATIVE_CLASS(abcclass_DefinitionError, NativeErrorClass, ErrorObject) + NATIVE_CLASS(abcclass_EvalError, NativeErrorClass, ErrorObject) + NATIVE_CLASS(abcclass_RangeError, NativeErrorClass, ErrorObject) + NATIVE_CLASS(abcclass_ReferenceError, NativeErrorClass, ErrorObject) + NATIVE_CLASS(abcclass_SecurityError, NativeErrorClass, ErrorObject) + NATIVE_CLASS(abcclass_SyntaxError, NativeErrorClass, ErrorObject) + NATIVE_CLASS(abcclass_TypeError, NativeErrorClass, ErrorObject) + NATIVE_CLASS(abcclass_URIError, NativeErrorClass, ErrorObject) + NATIVE_CLASS(abcclass_VerifyError, NativeErrorClass, ErrorObject) + NATIVE_CLASS(abcclass_UninitializedError, NativeErrorClass, ErrorObject) + NATIVE_CLASS(abcclass_ArgumentError, NativeErrorClass, ErrorObject) + + NATIVE_CLASS(abcclass_String, StringClass, String) + NATIVE_CLASS(abcclass_Boolean, BooleanClass, bool) + NATIVE_CLASS(abcclass_Number, NumberClass, double) + NATIVE_CLASS(abcclass_int, IntClass, int) + NATIVE_CLASS(abcclass_uint, UIntClass, uint32) + NATIVE_CLASS(abcclass_Math, MathClass, double) + NATIVE_CLASS(abcclass_Array, ArrayClass, ArrayObject) + NATIVE_CLASS(abcclass_RegExp, RegExpClass, RegExpObject) + NATIVE_CLASS(abcclass_Date, DateClass, DateObject) + + // E4X + NATIVE_CLASS(abcclass_XML, XMLClass, XMLObject) + NATIVE_CLASS(abcclass_XMLList, XMLListClass, XMLListObject) + NATIVE_CLASS(abcclass_QName, QNameClass, QNameObject) + END_NATIVE_CLASSES() + + // don't need toplevel here because we create it manually + BEGIN_NATIVE_SCRIPTS(AvmCore) + NATIVE_SCRIPT(0, Toplevel) + END_NATIVE_SCRIPTS() + + AvmCore::AvmCore(GC *g) : GCRoot(g), console(NULL), mirBuffers(g, 4), gcInterface(g) + { + // set default mode flags + #ifdef AVMPLUS_VERBOSE + verbose = false; + #endif + + #ifdef AVMPLUS_INTERP + // turbo flag only available if interpreter is there + turbo = true; + #endif + + #ifdef AVMPLUS_VERIFYALL + verifyall = false; + #endif + + #ifdef AVMPLUS_MIR + + #ifdef AVMPLUS_INTERP + // forcemir flag forces use of MIR instead of interpreter + forcemir = false; + #endif + + cseopt = true; + dceopt = true; + + #ifdef AVMPLUS_IA32 + sse2 = true; + #endif + + #ifdef AVMPLUS_VERBOSE + bbgraph = false; + #endif + + #endif // AVMPLUS_MIR + + #ifdef DEBUGGER + allocationTracking = false; + #endif + + interrupts = false; + + gcInterface.SetCore(this); + resources = NULL; + xmlEntities = NULL; + exceptionFrame = NULL; + builtinPool = NULL; + builtinDomain = NULL; + + GetGC()->SetGCContextVariable (MMgc::GC::GCV_AVMCORE, this); + + minstack = 0; + + #ifdef DEBUGGER + langID = -1; + debugger = NULL; + profiler = NULL; + callStack = NULL; + stackTraces = NULL; + numTraces = NULL; + samples = NULL; + takeSample = false; + samplingNow = false; + numSamples = 0; + fakeMethodInfos = 0; + #endif /* DEBUGGER */ + + interrupted = false; + + codeContextAtom = CONTEXT_NONE; + dxnsAddr = NULL; + + strings = NULL; + numStrings = 0; + namespaces = NULL; + numNamespaces = 0; + stringCount = 0; + deletedCount = 0; + nsCount = 0; + + numStrings = 1024; // power of 2 + strings = new DRC(Stringp)[numStrings]; + memset(strings, 0, numStrings*sizeof(Stringp)); + + numNamespaces = 1024; // power of 2 + namespaces = new DRC(Namespacep)[numNamespaces]; + memset(namespaces, 0, numNamespaces*sizeof(Namespace*)); + + console.setCore(this); + + kEmptyString = constantString(""); + kconstructor = constantString("constructor"); + kundefined = constantString("undefined"); + knull = constantString("null"); + ktrue = constantString("true"); + kfalse = constantString("false"); + ktoString = constantString("toString"); + ktoLocaleString = constantString("toLocaleString"); + kvalueOf = constantString("valueOf"); + klength = constantString("length"); + + kobject = constantString("object"); + kboolean = constantString("boolean"); + knumber = constantString("number"); + kstring = constantString("string"); + kxml = constantString("xml"); + kfunction = constantString("function"); + kglobal = constantString("global"); + kcallee = constantString("callee"); + + kuri = constantString("uri"); + kprefix = constantString("prefix"); + kNaN = doubleToAtom(MathUtils::nan()); + kNeedsDxns = constantString("NeedsDxns"); + kAsterisk = constantString("*"); + + for (int i = 0; i < 128; i++) + { + char singleChar = i; + // call newString() with an explicit length of 1; required + // when singleChar==0, because in that case we need a string + // which is a single character with value 0 + cachedChars[i] = internString(newString(&singleChar, 1)); + } + + booleanStrings[0] = kfalse; + booleanStrings[1] = ktrue; + + // create public namespace + publicNamespace = internNamespace(newNamespace(kEmptyString)); + + #if defined(AVMPLUS_MIR) && defined(AVMPLUS_VERBOSE) + codegenMethodNames = CodegenMIR::initMethodNames(this); + #endif + + #ifdef FEATURE_JNI + java = NULL; + #endif + } + + AvmCore::~AvmCore() + { +#ifdef DEBUGGER + stopSampling(); +#endif + + // Free the numbers and strings tables + delete [] strings; + if (GetGC()) + { + GetGC()->SetGCContextVariable(GC::GCV_AVMCORE, NULL); + } + + #if defined(AVMPLUS_MIR) && defined(AVMPLUS_VERBOSE) + delete codegenMethodNames; + #endif + + strings = NULL; + + delete [] namespaces; + namespaces = NULL; + + // free all the mir buffers + while(mirBuffers.size() > 0) + mirBuffers.removeFirst()->free(); + } + + void AvmCore::initBuiltinPool() + { + using namespace NativeID; + + // stack allocated array of pointers + AbstractFunction* nativeMethods[builtin_abc_method_count]; + NativeClassInfo* nativeClasses[builtin_abc_class_count]; + NativeScriptInfo* nativeScripts[builtin_abc_script_count]; + + memset(nativeMethods, 0, sizeof(AbstractFunction*)*builtin_abc_method_count); + memset(nativeClasses, 0, sizeof(NativeClassInfo*)*builtin_abc_class_count); + memset(nativeScripts, 0, sizeof(NativeScriptInfo*)*builtin_abc_script_count); + + initNativeTables(classEntries, scriptEntries, + nativeMethods, nativeClasses, nativeScripts); + + ScriptBuffer code = ScriptBuffer(new (GetGC()) ReadOnlyScriptBufferImpl (builtin_abc_data, builtin_abc_length)); + + builtinDomain = new (GetGC()) Domain(this, NULL); + + builtinPool = parseActionBlock(code, 0, NULL, + builtinDomain, + nativeMethods, + nativeClasses, + nativeScripts); + + // whack the the non-interruptable bit on all builtin functions + for(int i=0, size=builtinPool->methods.size(); imethods[i]->flags |= AbstractFunction::NON_INTERRUPTABLE; + + for(int i=0, size=builtinPool->cinits.size(); icinits[i]->flags |= AbstractFunction::NON_INTERRUPTABLE; + + for(int i=0, size=builtinPool->scripts.size(); iscripts[i]->flags |= AbstractFunction::NON_INTERRUPTABLE; + +#ifdef DEBUGGER + // sampling can begin now, requires builtinPool + initSampling(); +#endif + } + + Toplevel* AvmCore::initTopLevel() + { + Toplevel* toplevel = NULL; + handleActionPool(builtinPool, NULL, toplevel, NULL); + return toplevel; + } + + ScriptEnv* AvmCore::prepareActionPool(PoolObject* pool, + DomainEnv* domainEnv, + Toplevel*& toplevel, + CodeContext* codeContext) + { + AvmAssert(pool != NULL); + + // get the main entry point and its global traits + if (pool->scriptCount == 0) + { + toplevel->verifyErrorClass()->throwError(kMissingEntryPointError); + } + + if (domainEnv == NULL) + { + // create a new DomainEnv based on the builtinDomain + domainEnv = new (GetGC()) DomainEnv(this, builtinDomain, NULL); + } + + AbcEnv* abcEnv = new (GetGC(), AbcEnv::calcExtra(pool)) AbcEnv(pool, domainEnv, codeContext); + + // entry point is the last script in the file + Traits* mainTraits = pool->scripts[pool->scriptCount-1]->declaringTraits; + + // ISSUE can we just make this the public namespace? + ScopeChain* emptyScope = ScopeChain::create(GetGC(), mainTraits->scope, NULL, newNamespace(kEmptyString)); + + VTable* object_vtable; + if (toplevel == NULL) + { + // create a temp object vtable to use, since the real one isn't created yet + // later, in OP_newclass, we'll replace with the real Object vtable, so methods + // of Object and Class have the right scope. + + object_vtable = newVTable(traits.object_itraits, NULL, emptyScope, abcEnv, NULL); + object_vtable->resolveSignatures(); + mainTraits->sizeofInstance = getToplevelSize(); + } + else + { + object_vtable = toplevel->object_vtable; + } + + // global objects are subclasses of Object + VTable* mainVTable = newVTable(mainTraits, object_vtable, emptyScope, abcEnv, toplevel); + ScriptEnv* main = new (GetGC()) ScriptEnv(mainTraits->init, mainVTable); + mainVTable->init = main; + + if (toplevel == NULL) + { + mainVTable->resolveSignatures(); + main->global = toplevel = createToplevel(mainVTable); + + // save toplevel since it was initially null + mainVTable->toplevel = toplevel; + object_vtable->toplevel = toplevel; + domainEnv->setToplevel(toplevel); + + // create temporary vtable for Class, so we have something for OP_newclass + // to use when it creates Object$ and Class$. once that happens, we replace + // with the real Class$ vtable. + toplevel->class_vtable = newVTable(traits.class_itraits, + object_vtable, emptyScope, abcEnv, toplevel); + toplevel->class_vtable->resolveSignatures(); + + traits.function_itraits->resolveSignatures(toplevel); + } + + exportDefs(mainTraits, main); + + // prepare the remaining scriptEnv's + for (int i=0, n=pool->scriptCount-1; i < n; i++) + { + AbstractFunction* script = pool->scripts[i]; + + Traits* scriptTraits = script->declaringTraits; + // [ed] 3/24/06 why do we really care if a script is dynamic or not? + //AvmAssert(scriptTraits->needsHashtable); + + VTable* scriptVTable = newVTable(scriptTraits, object_vtable, emptyScope, abcEnv, toplevel); + ScriptEnv* scriptEnv = new (GetGC()) ScriptEnv(scriptTraits->init, scriptVTable); + scriptVTable->init = scriptEnv; + exportDefs(scriptTraits, scriptEnv); + } + + return main; + } + + Atom AvmCore::handleActionPool(PoolObject* pool, + DomainEnv* domainEnv, + Toplevel* &toplevel, + CodeContext* codeContext) + { + bool createdToplevel = (toplevel == NULL); + + ScriptEnv* main = prepareActionPool(pool, domainEnv, toplevel, codeContext); + + if (!createdToplevel) + { + main->initGlobal(); + } + + Atom argv[1] = { main->global->atom() }; + Atom result = 0; // init to zero to make GCC happy + #ifndef DEBUGGER + result = main->coerceEnter(0, argv); + #else + TRY(this, kCatchAction_Rethrow) + { + result = main->coerceEnter(0, argv); + #ifdef AVMPLUS_PROFILE + if (dprof.dprofile) + dprof.mark((AbcOpcode)0); + #endif + } + CATCH(Exception *exception) + { + #ifdef AVMPLUS_PROFILE + if (dprof.dprofile) + dprof.mark((AbcOpcode)0); + #endif + // Re-throw exception + throwException(exception); + } + END_CATCH + END_TRY + #endif + + return result; + } + + void AvmCore::exportDefs(Traits* scriptTraits, ScriptEnv* scriptEnv) + { + DomainEnv* domainEnv = scriptEnv->domainEnv(); + AbcEnv* abcEnv = scriptEnv->abcEnv(); + + // iterate thru each of the definitions exported by this script + int i=0; + while((i=scriptTraits->next(i)) != 0) + { + // don't need to check for DELETED because we never remove trait bindings + AvmAssert(scriptTraits->keyAt(i) != NULL); + Stringp name = scriptTraits->keyAt(i); + Namespace* ns = scriptTraits->nsAt(i); + + // not already in the table then export it + // otherwise we keep the first one that was encountered. + if (!ns->isPrivate()) + { + if (!domainEnv->namedScripts->get(name, ns)) + { + // add ns/name to global table + // ISSUE should we filter out Object traits and/or private members? + #ifdef AVMPLUS_VERBOSE + if (scriptTraits->pool->verbose) + console << "exporting " << ns << "::" << name << "\n"; + #endif + domainEnv->namedScripts->add(name, ns, (Binding)scriptEnv); + } + } + else + { + if (!abcEnv->privateScriptEnvs.get(name, ns)) + { + abcEnv->privateScriptEnvs.add(name, ns, (Binding) scriptEnv); + } + } + } + } + + PoolObject* AvmCore::parseActionBlock(ScriptBuffer code, + int /*start*/, + Toplevel* toplevel, + Domain* domain, + AbstractFunction *nativeMethods[], + NativeClassInfo *nativeClasses[], + NativeScriptInfo *nativeScripts[]) + { + // parse constants and attributes. + PoolObject* pool = AbcParser::decodeAbc(this, + code, + toplevel, + domain, + nativeMethods, + nativeClasses, + nativeScripts); + + #ifdef DEBUGGER + if (debugger) { + debugger->processAbc(pool, code); + } + #endif /* DEBUGGER */ + + return pool; + } + + Atom AvmCore::handleActionBlock(ScriptBuffer code, + int start, + DomainEnv* domainEnv, + Toplevel* &toplevel, + AbstractFunction *nativeMethods[], + NativeClassInfo *nativeClasses[], + NativeScriptInfo *nativeScripts[], + CodeContext *codeContext) + { + resources = new (GetGC()) Hashtable(GetGC()); + + // have we parsed this before? + PoolObject* pool; + Atom resourceAtom = resources->get(start+1); + if (resourceAtom != undefinedAtom) + { + pool = (PoolObject*) resourceAtom; + } + else + { + Domain* domain = domainEnv ? domainEnv->getDomain() : builtinDomain; + + // parse constants and attributes. + pool = parseActionBlock(code, + start, + toplevel, + domain, + nativeMethods, + nativeClasses, + nativeScripts); + if (pool != NULL) + { + resources->put(start+1, pool); + } + } + + return handleActionPool(pool, domainEnv, toplevel, codeContext); + } + +/* +11.9.3 The Abstract Equality Comparison Algorithm +The comparison x == y, where x and y are values, produces true or false. Such a comparison is performed as +follows: +E4X - 0a. if x is XMLList, call [[Equals]] method of x with argument y and return +E4X - 0b. if y is XMLList, call [[Equals]] method of y with argument x and return +1. If Type(x) is different from Type(y), go to step 14. +E4X - 1a. If x is XML and y is XML + if x.class = text/attribute && y.class == text/attribute, do string compare + else to x.[[Equals]](y) +E4X - 1b If x and y are QName + return uri=uri and localname==localName +E4X - 1c if x and y are Namespaces + return uri == uri +2. If Type(x) is Undefined, return true. +3. If Type(x) is Null, return true. +4. If Type(x) is not Number, go to step 11. +5. If x is NaN, return false. +6. If y is NaN, return false. +7. If x is the same number value as y, return true. +8. If x is +0 and y is -0, return true. +9. If x is -0 and y is +0, return true. +10. Return false. +11. If Type(x) is String, then return true if x and y are exactly the same sequence of characters (same length and +same characters in corresponding positions). Otherwise, return false. +12. If Type(x) is Boolean, return true if x and y are both true or both false. Otherwise, return false. +13. Return true if x and y refer to the same object or if they refer to objects joined to each other (section 13.1.2). +Otherwise, return false. + +// Different types below here +E4X 14a. if (x is xml) and x.hasSimpleContent = true or (y is xml) and y.hasSimlpeContent = true + return the results of tostring(x) and tostring(y) + +14. If x is null and y is undefined, return true. +15. If x is undefined and y is null, return true. +16. If Type(x) is Number and Type(y) is String, +return the result of the comparison x == ToNumber(y). +17. If Type(x) is String and Type(y) is Number, +return the result of the comparison ToNumber(x) == y. +18. If Type(x) is Boolean, return the result of the comparison ToNumber(x) == y. +19. If Type(y) is Boolean, return the result of the comparison x == ToNumber(y). +20. If Type(x) is either String or Number and Type(y) is Object, +return the result of the comparison x == ToPrimitive(y). +21. If Type(x) is Object and Type(y) is either String or Number, +return the result of the comparison ToPrimitive(x) == y. +22. Return false. + */ + + Atom AvmCore::eq(Atom lhs, Atom rhs) + { + if (isNull(lhs)) lhs = 0; + if (isNull(rhs)) rhs = 0; + + int ltype = lhs & 7; + int rtype = rhs & 7; + + // See E4X 11.5.1, pg 53. + if ((ltype == kObjectType) && (isXMLList(lhs))) + return atomToXMLList (lhs)->_equals (rhs); + else if ((rtype == kObjectType) && (isXMLList(rhs))) + return atomToXMLList (rhs)->_equals (lhs); + + if (ltype == rtype) + { + // same type + switch (ltype) + { + case 0: + case kSpecialType: + return trueAtom; + case kStringType: + if (lhs == rhs) return trueAtom; + return (*atomToString(lhs) == *atomToString(rhs)) ? trueAtom : falseAtom; + case kBooleanType: + case kIntegerType: + return lhs == rhs ? trueAtom : falseAtom; + case kNamespaceType: + // E4X 11.5.1, pg 53 + return atomToNamespace(lhs)->equalTo(atomToNamespace(rhs))? trueAtom : falseAtom; + case kObjectType: + { + // E4X 11.5.1, pg 53 + if (lhs == rhs) + return trueAtom; + if (isXML(lhs) && isXML(rhs)) + { + XMLObject *x = atomToXMLObject (lhs); + XMLObject *y = atomToXMLObject (rhs); + if ((((x->getClass() & (E4XNode::kText | E4XNode::kCDATA | E4XNode::kAttribute))) && y->hasSimpleContent()) || + (((y->getClass() & (E4XNode::kText | E4XNode::kCDATA | E4XNode::kAttribute))) && x->hasSimpleContent())) + { + return ((*string(lhs) == *string(rhs)) ? trueAtom : falseAtom); + } + else + { + return x->getNode()->_equals (this, y->getNode()); + } + } + else if (isQName(lhs) && isQName(rhs)) + { + QNameObject *qn1 = atomToQName (lhs); + QNameObject *qn2 = atomToQName (rhs); + return (((qn1->getURI() == qn2->getURI()) && (qn1->getLocalName() == qn2->getLocalName()))? trueAtom : falseAtom); + } + else + { + return falseAtom; + } + } + case kDoubleType: + // C++ portability note -- if either arg is NaN, java == returns false, which matches ECMA. + return atomToDouble(lhs) == atomToDouble(rhs) ? trueAtom : falseAtom; + } + } + else + { + if (isNullOrUndefined(lhs) && isNullOrUndefined(rhs)) + return trueAtom; + if (ltype == kIntegerType && rtype == kDoubleType) + return ((double)(lhs>>3)) == atomToDouble(rhs) ? trueAtom : falseAtom; + if (ltype == kDoubleType && rtype == kIntegerType) + return atomToDouble(lhs) == ((double)(rhs>>3)) ? trueAtom : falseAtom; + + // 16. If Type(x) is Number and Type(y) is String, + // return the result of the comparison x == ToNumber(y). + if (isNumber(lhs) && isString(rhs)) + return eq(lhs, doubleToAtom(number(rhs))); + + // 17. If Type(x) is String and Type(y) is Number, + // return the result of the comparison ToNumber(x) == y. + if (isString(lhs) && isNumber(rhs)) + return eq(doubleToAtom(number(lhs)), rhs); + + // E4X 11.5.1, step 4. Placed slightly lower then in the spec + // to handle quicker cases earlier. No cases above should be comparing + // an object to a non-object + if (((ltype == kObjectType) && isXML(lhs) && atomToXMLObject(lhs)->hasSimpleContent()) || + ((rtype == kObjectType) && isXML(rhs) && atomToXMLObject(rhs)->hasSimpleContent())) + { + return ((*string(lhs) == *string(rhs)) ? trueAtom : falseAtom); + } + + // 18. If Type(x) is Boolean, return the result of the comparison ToNumber(x) == y. + if (ltype == kBooleanType) + return eq(lhs&~7|kIntegerType, rhs); // equal(toInteger(lhs), rhs) + + // 19. If Type(y) is Boolean, return the result of the comparison x == ToNumber(y). + if (rtype == kBooleanType) + return eq(lhs, rhs&~7|kIntegerType); // equal(lhs, toInteger(rhs)) + + // 20. If Type(x) is either String or Number and Type(y) is Object, + // return the result of the comparison x == ToPrimitive(y). + + if ((isString(lhs) || isNumber(lhs)) && rtype == kObjectType) + return eq(lhs, atomToScriptObject(rhs)->defaultValue()); + + // 21. If Type(x) is Object and Type(y) is either String or Number, + // return the result of the comparison ToPrimitive(x) == y. + if ((isString(rhs) || isNumber(rhs)) && ltype == kObjectType) + return eq(atomToScriptObject(lhs)->defaultValue(), rhs); + } + return falseAtom; + } + + /** + * this is the abstract relational comparison algorithm according to ECMA 262 11.8.5 + * @param lhs + * @param rhs + * @return trueAtom, falseAtom, or undefinedAtom + */ + Atom AvmCore::compare(Atom lhs, Atom rhs) + { + // fixme - toprimitive must take number hint, so "7" becomes 7 + if ((lhs&7)==kIntegerType && (rhs&7)==kIntegerType) + { + // fast path for integers + return lhs < rhs ? trueAtom : falseAtom; + } + + lhs = primitive(lhs); + rhs = primitive(rhs); + + if (isString(lhs) && isString(rhs)) + { + // string compare. todo optimize! + return *string(lhs) < *string(rhs) ? trueAtom : falseAtom; + } + + // numeric compare + double dx = number(lhs); + double dy = number(rhs); + if (MathUtils::isNaN(dx)) return undefinedAtom; + if (MathUtils::isNaN(dy)) return undefinedAtom; + return dx < dy ? trueAtom : falseAtom; + } + + Atom AvmCore::stricteq(Atom lhs, Atom rhs) + { + if (isNull(lhs)) return isNull(rhs) ? trueAtom : falseAtom; + if (isNull(rhs)) return isNull(lhs) ? trueAtom : falseAtom; + + int ltype = lhs & 7; + int rtype = rhs & 7; + if (ltype == rtype) + { + // same type + switch (ltype) + { + case kSpecialType: + return trueAtom; // undefined is the only kSpecialType atom + case kStringType: + return (lhs==rhs || *string(lhs) == *string(rhs)) ? trueAtom : falseAtom; + case kBooleanType: + case kIntegerType: + case kNamespaceType: + return lhs == rhs ? trueAtom : falseAtom; + case kObjectType: + { + if (lhs == rhs) + return trueAtom; + if (isXML(lhs) && isXML(rhs)) + { + E4XNode *lhn = atomToXML (lhs); + E4XNode *rhn = atomToXML (rhs); + return ((lhn == rhn) ? trueAtom : falseAtom); + } + return falseAtom; + } + case kDoubleType: + // C++ portability note -- if either arg is NaN, java == returns false, which matches ECMA. + return atomToDouble(lhs) == atomToDouble(rhs) ? trueAtom : falseAtom; + } + } + return falseAtom; + } + + /** + * throwException will throw an exception. This function + * never returns. The exception to be thrown is specified + * by exception. + */ + void AvmCore::throwException(Exception *exception) + { + #ifdef DEBUGGER + if (debugger && !(exception->flags & Exception::SEEN_BY_DEBUGGER)) + { + // I'm going to set the SEEN_BY_DEBUGGER flag now, before calling + // filterException(), just to avoid reentrancy problems (we don't + // want to end up back here with the same Exception object and get + // stuck in an infinite loop). + exception->flags |= Exception::SEEN_BY_DEBUGGER; + + if (!willExceptionBeCaught(exception)) + { + // filterException() returns 'true' if it somehow let the user know + // about the exception, 'false' if it ignored the exception. + if (debugger->filterException(exception)) + exception->flags |= Exception::SEEN_BY_DEBUGGER; + else + exception->flags &= ~Exception::SEEN_BY_DEBUGGER; + } + else + { + exception->flags &= ~Exception::SEEN_BY_DEBUGGER; + } + } + #endif + + // exceptionFrame should not be NULL; if it is, + // you are missing a TRY/CATCH block around + // a call to an AVM+ method that throws an + // exception. + AvmAssert(exceptionFrame != NULL); + exceptionFrame->throwException(exception); + } + + /** + * throwAtom will throw an exception. This function + * never returns. The exception to be thrown is specified + * by atom. + */ + void AvmCore::throwAtom(Atom atom) + { + throwException(new (GetGC()) Exception(atom +#ifdef DEBUGGER + , this +#endif + )); + } + +#ifdef DEBUGGER + bool AvmCore::willExceptionBeCaught(Exception* exception) + { + ExceptionFrame* ef; + + for (ef = exceptionFrame; ef != NULL; ef = ef->prevFrame) + { + switch (ef->catchAction) + { + // The CATCH block will consume any exception that occurs, and will not treat it as + // an error, so exceptions should not be reported to the debugger. + case kCatchAction_Ignore: + return true; + + // The CATCH block will rethrow any exception that occurs; so, we will 'continue', + // which will take us back to the 'for' loop to keep going up the exception stack, + // until we find a frame with some other value. + case kCatchAction_Rethrow: + continue; // return to the 'for' loop + + // The CATCH block will treat any exception that occurs as an error -- probably by + // calling uncaughtException, but possibly by some other means. So, exceptions + // should be reported to the debugger. + case kCatchAction_ReportAsError: + return false; + + // This is the unfortunate, but rare, case where we can't tell in advance how the + // CATCH block will handle exceptions. In this case, we wil not report the + // exception to the debugger. + case kCatchAction_Unknown: + return true; + + // The CATCH block will walk up the exception frames that were defined in + // ActionScript code -- e.g. "try { } catch (e:Error) { }" -- looking for one + // which catch this exception. So, we will do the same thing, and only report + // the error to the debugger if there is no catch block for it. + case kCatchAction_SearchForActionScriptExceptionHandler: + { + CallStackNode* callStackNode; + + // Walk all the way up the stack, one frame at a time, looking for + // one which will catch this exception. + for (callStackNode = callStack; callStackNode; callStackNode = callStackNode->next) + { + MethodInfo* info = (MethodInfo*) callStackNode->info; + if (info->exceptions != NULL && callStackNode->eip && *callStackNode->eip) + { + // Check if this particular frame of the callstack + // is going to catch the exception. + if (findExceptionHandlerNoRethrow(info, *callStackNode->eip, exception) != NULL) + return true; + } + } + + // No ActionScript handler was found, so the exception is going to be + // re-thrown; so, 'continue' will get us back to the 'for' loop + continue; + } + + default: + AvmAssert(false); + break; + } + } + + return false; + } + + /** + * Returns LANG_xx enum + */ + int AvmCore::determineLanguage() + { + if (langID < 0) + { + // @todo system probe to determine language, then return one of our known enums + langID = LANG_en; + } + return langID; + } + + String* AvmCore::findErrorMessage(int errorID, + int* mapTable, /* 2 ints per entry i, i+1 */ + const char** errorTable, + int numErrors) + { + // Above that, we must binary search. + int lo = 0; + int hi = numErrors-1; + + while (lo <= hi) { + int pivot = (lo+hi)>>1; + int testID = mapTable[2*pivot]; + if (testID == errorID) { + lo = pivot; + break; + } else if (errorID < testID) { + hi = pivot-1; + } else { + lo = pivot+1; + } + } + + int index = mapTable[2*lo+1]; + int id = mapTable[2*lo]; + + if (id == errorID) { + return newString(errorTable[index]); + } else { + return NULL; + } + } +#endif + + String* AvmCore::getErrorMessage(int errorID) + { + Stringp buffer = newString("Error #"); + buffer = concatStrings(buffer, internInt(errorID)); + + #ifdef DEBUGGER + Stringp out = findErrorMessage(errorID, + errorMappingTable, + errorConstants[determineLanguage()], + kNumErrorConstants); + if (out) + { + buffer = concatStrings(buffer, newString(": ")); + buffer = concatStrings(buffer, out); + } + else + { + AvmAssertMsg(0, "errorID not found in the message table; check ErrorConstants.cpp you may need to regenerate it"); + } + #endif + + return buffer; + } + + String* AvmCore::atomToErrorString(Atom a) + { + String* out = NULL; + #ifdef DEBUGGER + out = this->format(a); + #else + (void)a; + out = kEmptyString; + #endif /* DEBUGGER */ + return out; + } + + String* AvmCore::toErrorString(int d) + { + String* s = NULL; + #ifdef DEBUGGER + wchar buffer[256]; + buffer[255] = '\0'; + int len; + if (MathUtils::convertIntegerToString(d, buffer, len)) + s = this->newString(buffer); + else + s = kEmptyString; + #else + s = kEmptyString; + (void)d; + #endif /* DEBUGGER */ + return s; + } + + String* AvmCore::toErrorString(const char* s) + { + String* out = NULL; + #ifdef DEBUGGER + if (s) + out = this->newString(s); + else + out = kEmptyString; + #else + out = kEmptyString; + (void)s; + #endif /* DEBUGGER */ + return out; + } + + String* AvmCore::toErrorString(const wchar* s) + { + String* out = NULL; + #ifdef DEBUGGER + if (s) + out = this->newString(s); + else + out = kEmptyString; + #else + out = kEmptyString; + (void)s; + #endif /* DEBUGGER */ + return out; + } + + String* AvmCore::toErrorString(AbstractFunction* m) + { + String* s = NULL; + #ifdef DEBUGGER + if (m) + s = m->format(this); + else + s = kEmptyString; + #else + s = kEmptyString; + (void)m; + #endif /* DEBUGGER */ + return s; + } + + String* AvmCore::toErrorString(Multiname* n) + { + String* s = NULL; + #ifdef DEBUGGER + if (n) + s = n->format(this, Multiname::MULTI_FORMAT_NAME_ONLY); + else + s = kEmptyString; + #else + s = kEmptyString; + (void)n; + #endif /* DEBUGGER */ + return s; + } + + String* AvmCore::toErrorString(Namespace* ns) + { + String* s = NULL; + #ifdef DEBUGGER + if (ns) + s = ns->format(this); + else + s = kEmptyString; + #else + s = kEmptyString; + (void)ns; + #endif /* DEBUGGER */ + return s; + } + + String* AvmCore::toErrorString(Traits* t) + { + #ifndef DEBUGGER + (void)t; + return kEmptyString; + #else + if (!t) + { + return newString("*"); + } + + String* s = NULL; + if (t->base == traits.class_itraits) + { + t = t->itraits; + s = newString("class "); + } + else + { + s = kEmptyString; + } + + if (t->ns != NULL && t->ns != publicNamespace) + s = concatStrings(s, concatStrings(toErrorString(t->ns), newString("."))); + + if (t->name) + s = concatStrings(s, t->name); + else + s = concatStrings(s, newString("(null)")); + return s; + #endif /* DEBUGGER */ + } + + String* AvmCore::formatErrorMessageV( int errorID, Stringp arg1, Stringp arg2, Stringp arg3) + { + Stringp out = NULL; + + Stringp errorMessage = getErrorMessage(errorID); + if (errorMessage) + { + #ifdef DEBUGGER + UTF8String *errorUTF8 = errorMessage->toUTF8String(); + const char *format = errorUTF8->c_str(); + + // This block is enclosed in {} to force + // StringBuffer destructor to unwind. + { + StringBuffer buffer(this); + buffer.formatP( format, arg1, arg2, arg3); + out = newString(buffer.c_str()); + } + #else + /** + * We can skip all the above processing since getErrorMessage() only + * returns the error code. Likewise the toErrorString() methods return kEmptyString + */ + (void)arg1; + (void)arg2; + (void)arg3; + out = errorMessage; + #endif /* DEBUGGER*/ + } + else + { + AvmAssertMsg(errorMessage != NULL, "contract with getErrorMessage() broken, we should always get a string!"); + out = kEmptyString; + } + return out; + } + + void AvmCore::throwErrorV(ClassClosure *type, int errorID, Stringp arg1, Stringp arg2, Stringp arg3) + { + Stringp out = formatErrorMessageV( errorID, arg1, arg2, arg3); + + #ifdef DEBUGGER + if (type == NULL) + { + // print the error message, because we're still bootstrapping + // and the exception type is not yet defined + console << out << "\n"; + } + #endif + + Atom args[3] = { nullObjectAtom, out->atom(), intToAtom(errorID) }; + throwAtom(type->construct(2, args)); + } + + Atom AvmCore::booleanAtom(Atom atom) + { + if (!AvmCore::isNullOrUndefined(atom)) + { + switch (atom&7) + { + case kIntegerType: + { + int i = atom>>3; + return urshift(i|-i,28)&~7 | kBooleanType; + } + case kBooleanType: + return atom; + case kObjectType: + case kNamespaceType: + return isNull(atom) ? falseAtom : trueAtom; + case kStringType: + if (isNull(atom)) return falseAtom; + return (atomToString(atom)->length() > 0) ? trueAtom : falseAtom; + default: + { + double d = atomToDouble(atom); + return !MathUtils::isNaN(d) && d != 0.0 ? trueAtom : falseAtom; + } + } + } + else + { + return falseAtom; + } + } + + int AvmCore::boolean(Atom atom) + { + if (!AvmCore::isNullOrUndefined(atom)) + { + switch (atom&7) + { + case kIntegerType: + case kBooleanType: + return (atom & ~7) != 0; + case kObjectType: + case kNamespaceType: + return !isNull(atom); + case kStringType: + return !isNull(atom) && atomToString(atom)->length() > 0; + default: + { + double d = atomToDouble(atom); + return !MathUtils::isNaN(d) && d != 0.0; + } + } + } + else + { + return false; + } + } + + /* + ToPrimitive: + + Return a default value for the Object. The default value of an object is + retrieved by calling the internal [[DefaultValue]] method of the object, + passing the optional hint PreferredType. The behaviour of the + [[DefaultValue]] method is defined by this specification for all native + ECMAScript objects (section 8.6.2.6). + */ + Atom AvmCore::primitive(Atom atom) + { + return isObject(atom) ? atomToScriptObject(atom)->defaultValue() : atom; + } + + Atom AvmCore::numberAtom(Atom atom) + { + if (!isNull(atom)) + { + double value; + switch (atom&7) + { + case kSpecialType: + return kNaN; + case kStringType: + value = atomToString(atom)->toNumber(); + break; + default: + AvmAssert(false); + case kBooleanType: + return (atom&~7) | kIntegerType; + case kDoubleType: + case kIntegerType: + return atom; + case kNamespaceType: + // return ToNumber(namespace->uri) + value = number(atomToNamespace(atom)->getURI()->atom()); + break; + case kObjectType: + value = number(atomToScriptObject(atom)->defaultValue()); + break; + } + return doubleToAtom(value); + } + else + { + return 0 | kIntegerType; + } + } + + double AvmCore::number(Atom atom) const + { + int kind = atom&7; + + if (kind == kIntegerType) + return (double) ((sint32)atom>>3); + if (kind == kDoubleType) + return atomToDouble(atom); + + if (!isNull(atom)) + { + switch (kind) + { + case kStringType: + return atomToString(atom)->toNumber(); + case kSpecialType: + return atomToDouble(kNaN); + case kBooleanType: + return (double) ((sint32)atom>>3); + case kNamespaceType: + return number(atomToNamespace(atom)->getURI()->atom()); + default: // number + case kObjectType: + return number(atomToScriptObject(atom)->defaultValue()); + } + } + else + { + // ES3 9.3, toNumber(null) == 0 + return 0; + } + } + + Stringp AvmCore::intern(Atom atom) + { + if (!isNull(atom)) + { + switch (atom&7) + { + case kBooleanType: + return booleanStrings[atom>>3]; + case kStringType: + return internString(atom); + case kNamespaceType: + return atomToNamespace(atom)->getURI(); + case kSpecialType: + return kundefined; + case kObjectType: + return intern(atomToScriptObject(atom)->toString()); + case kIntegerType: + return internInt(atom>>3); + case kDoubleType: + default: // number + return internDouble(atomToDouble(atom)); + } + } + else + { + return knull; + } + } + + Namespace* AvmCore::internNamespace(Namespace* ns) + { + if (ns->isPrivate()) + { + // only intern namespaces with interned uri's. this means anonymous + // namespaces with null prefixes are always unique and can't be shared. + return ns; + } + + int i = findNamespace(ns); + if (namespaces[i] == NULL) + { + // first time we've seen this namespace. intern int + nsCount++; + namespaces[i] = ns; + return ns; + } + + // found the namespace, indexing by URI. return the interned copy. + return namespaces[i]; + } + +#ifdef AVMPLUS_VERBOSE + /* static */ + void AvmCore::formatMultiname(PrintWriter& out, uint32 index, PoolObject* pool) + { + if (index > 0 && index <= pool->constantMnCount) + { + Multiname name; + pool->parseMultiname(name, index); + out << &name; + } + else + { + out << "invalid multiname index " << index; + } + } + + void AvmCore::formatOpcode(PrintWriter& buffer, const byte *pc, AbcOpcode opcode, int off, PoolObject* pool) + { + pc++; + switch (opcode) + { + case OP_debugfile: + case OP_pushstring: + { + buffer << opNames[opcode]; + uint32 index = readU30(pc); + if (index < pool->cpool_string.size()) + buffer << " " << pool->cpool_string[index]->atom(); + break; + } + case OP_pushint: + { + buffer << opNames[opcode]; + uint32 index = readU30(pc); + if (index < pool->cpool_int.size()) + buffer << " " << pool->cpool_int[index]; + break; + } + case OP_pushuint: + { + buffer << opNames[opcode]; + uint32 index = readU30(pc); + if (index < pool->cpool_uint.size()) + buffer << " " << (double)pool->cpool_uint[index]; + break; + } + case OP_pushdouble: + { + buffer << opNames[opcode]; + uint32 index = readU30(pc); + if (index < pool->cpool_double.size()) + buffer << " " << *pool->cpool_double[index]; + break; + } + case OP_pushnamespace: + { + buffer << opNames[opcode]; + uint32 index = readU30(pc); + if (index < pool->cpool_ns.size()) + { + buffer << " " << pool->cpool_ns[index]->getURI(); + } + break; + } + case OP_getsuper: + case OP_setsuper: + case OP_getproperty: + case OP_setproperty: + case OP_initproperty: + case OP_findpropstrict: + case OP_findproperty: + case OP_finddef: + case OP_deleteproperty: + case OP_istype: + case OP_coerce: + case OP_astype: + { + buffer << opNames[opcode] << " "; + formatMultiname(buffer, readU30(pc), pool); + break; + } + case OP_callproperty: + case OP_callpropvoid: + case OP_callproplex: + case OP_callsuper: + case OP_callsupervoid: + { + uint32 index = readU30(pc); + int argc = readU30(pc); + buffer << opNames[opcode] << " "; + formatMultiname(buffer, index, pool); + buffer << " " << argc; + break; + } + case OP_callstatic: + case OP_newfunction: + { + int method_id = readU30(pc); + AbstractFunction* f = pool->methods[method_id]; + buffer << opNames[opcode] << " method_id=" << method_id; + if (opcode == OP_callstatic) + { + buffer << " argc=" << (int)readU30(pc); // argc + } + if (f->name) + buffer << " " << f->name; + else + buffer << " null"; + break; + } + + case OP_newclass: + { + AbstractFunction* c = pool->cinits[readU30(pc)]; + buffer << opNames[opcode] << " " << c; + break; + } + case OP_lookupswitch: + { + int target = off + readS24(pc); + pc += 3; + int maxindex = readU30(pc); + buffer << opNames[opcode] << " default:" << target << " maxcase:"<beginCatch(); + ExceptionHandler* handler = findExceptionHandler(info,pc,exception); + ef->beginTry(this); + return handler; + } + + ExceptionHandler* AvmCore::findExceptionHandler(MethodInfo *info, + int pc, + Exception *exception) + { + ExceptionHandler* handler = findExceptionHandlerNoRethrow(info, pc, exception); + if (handler) + return handler; + + // We don't have a matching exception. + throwException(exception); + return NULL;// not reached + } + + ExceptionHandler* AvmCore::findExceptionHandlerNoRethrow(MethodInfo *info, + int pc, + Exception *exception) + { + // If this exception is an EXIT_EXCEPTION, it cannot + // be caught by AS code. Exit immediately. + if (exception->flags & Exception::EXIT_EXCEPTION) + { + return NULL; + } + + // Search the exception table for a catch clause + // such that pc is between "from" and "to" and + // the thrown atom matches the required type. + + // if no handler found, re-throw the exception from here + + //[ed] we only call this from methods with catch blocks, when exceptions != NULL + AvmAssert(info->exceptions != NULL); + + int exception_count = info->exceptions->exception_count; + ExceptionHandler* handler = info->exceptions->exceptions; + int atom = exception->atom; + + while (--exception_count >= 0) + { + if (pc >= handler->from && + pc < handler->to) + { + // verifier makes sure type is valid, resolves to Traits* + if (istype(atom, handler->traits)) + { + #ifdef AVMPLUS_VERBOSE + if (verbose) + { + console << "enter " << info << " catch " << handler->traits << '\n'; + } + #endif // DEBUGGER + + return handler; + } + } + handler++; + } + + // We don't have a matching exception. + return NULL; + } + + void AvmCore::increment_d(Atom *ap, int delta) + { + AvmAssert(isNumber(*ap)); + if (isInteger(*ap)) + *ap = intToAtom(delta+((sint32)*ap>>3)); + else + *ap = doubleToAtom(atomToDouble(*ap)+delta); + } + + void AvmCore::increment_i(Atom *ap, int delta) + { + switch (*ap & 7) + { + case kBooleanType: + case kIntegerType: + *ap = intToAtom(delta+((sint32)*ap>>3)); + return; + case kDoubleType: + *ap = intToAtom((int)((sint32)atomToDouble(*ap)+delta)); + return; + default: + *ap = intToAtom(integer(*ap)+delta); + return; + } + } + + bool AvmCore::istype(Atom atom, Traits* itraits) + { + if (!itraits) + return true; + + if (isNull(atom)) + return itraits == traits.null_itraits; + + Traits* lhs; + + switch (atom&7) + { + case kNamespaceType: + lhs = traits.namespace_itraits; + break; + + case kStringType: + lhs = traits.string_itraits; + break; + + case kBooleanType: + lhs = traits.boolean_itraits; + break; + + case kIntegerType: + // ISSUE need special support for number value ranges + if (itraits == traits.number_itraits) + return true; + + lhs = traits.int_itraits; + if (itraits == traits.uint_itraits) + { + return (atom>>3) >= 0; + } + break; + + case kDoubleType: + lhs = traits.number_itraits; + // ISSUE there must be a better way... + if (itraits == traits.int_itraits) + { + double d = atomToDouble(atom); + int i = MathUtils::real2int(d); + return d == (double)i; + } + if (itraits == traits.uint_itraits) + { + double d = atomToDouble(atom); + // ISSUE use real2int? + unsigned i = (unsigned)d; + return d == (double)i; + } + break; + + case kSpecialType: + return itraits == traits.void_itraits; + + case kObjectType: { + lhs = atomToScriptObject(atom)->traits(); + break; + } + + default: + // unexpected atom type + AvmAssert(false); + return false; + } + + return lhs->containsInterface(itraits)!=0; + } + + Stringp AvmCore::coerce_s(Atom atom) + { + if (isNullOrUndefined(atom)) + return NULL; + return string(atom); + } + + Stringp AvmCore::string(Atom atom) + { + if (!isNull(atom)) + { + switch (atom&7) + { + case kNamespaceType: + return atomToNamespace(atom)->getURI(); + case kObjectType: + return string(atomToScriptObject(atom)->toString()); + case kStringType: + return atomToString(atom); + case kSpecialType: + return kundefined; + case kBooleanType: + return booleanStrings[atom>>3]; + case kIntegerType: + return intToString (int(atom>>3)); + case kDoubleType: + default: // number + return doubleToString(atomToDouble(atom)); + } + } + else + { + return knull; + } + } + +#ifdef AVMPLUS_PROFILE + void AvmCore::dump() + { + sprof.dump(console); + dprof.dump(console); + } +#endif + + + void AvmCore::setConsoleStream(OutputStream *stream) + { + console.setOutputStream(stream); + } + + void AvmCore::registerNatives(NativeTableEntry *nativeMap, AbstractFunction *nativeMethods[]) + { + while (nativeMap->method_id != -1) + { + AbstractFunction *f = NULL; + + switch (nativeMap->type) + { + case NativeTableEntry::kNativeMethod: + f = new (GetGC()) NativeMethod(nativeMap->flags, (NativeMethod::Handler)nativeMap->handler); + break; + case NativeTableEntry::kNativeMethod1: + f = new (GetGC()) NativeMethod(nativeMap->flags, (NativeMethod::Handler)nativeMap->handler, nativeMap->cookie); + break; + case NativeTableEntry::kNativeMethodV: + f = new (GetGC()) NativeMethodV((NativeMethodV::Handler32)nativeMap->handler, nativeMap->flags); + break; + case NativeTableEntry::kNativeMethodV1: + f = new (GetGC()) NativeMethodV((NativeMethodV::Handler32)nativeMap->handler, nativeMap->cookie, nativeMap->flags); + break; + default: + AvmAssert(false); + } + + // if we overwrite a native method mapping, something is hosed + AvmAssert(nativeMethods[nativeMap->method_id]==NULL); + nativeMethods[nativeMap->method_id] = f; + nativeMap++; + } + } + + void AvmCore::initNativeTables(NativeClassInfo* classEntry, + NativeScriptInfo* scriptEntry, + AbstractFunction *nativeMethods[], + NativeClassInfo *nativeClasses[], + NativeScriptInfo *nativeScripts[]) + { + while (classEntry->class_id != -1) + { + nativeClasses[classEntry->class_id] = classEntry; + registerNatives(classEntry->nativeMap, nativeMethods); + classEntry++; + } + + while (scriptEntry->script_id != -1) + { + nativeScripts[scriptEntry->script_id] = scriptEntry; + registerNatives(scriptEntry->nativeMap, nativeMethods); + scriptEntry++; + } + } + + bool AvmCore::isXML (Atom atm) + { + if (!isObject(atm)) + return false; + + AvmAssert (!traits.xml_itraits || traits.xml_itraits->final); + Traits *lhs = atomToScriptObject(atm)->traits(); + return (lhs == traits.xml_itraits); + } + + bool AvmCore::isDate(Atom atm) + { + if (!isObject(atm)) + return false; + + AvmAssert (!traits.date_itraits || traits.date_itraits->final); + Traits *lhs = atomToScriptObject(atm)->traits(); + return (lhs == traits.date_itraits); + } + + bool AvmCore::isXMLList (Atom atm) + { + if (!isObject(atm)) + return false; + + AvmAssert (!traits.xmlList_itraits || traits.xmlList_itraits->final); + Traits *lhs = atomToScriptObject(atm)->traits(); + return (lhs == traits.xmlList_itraits); + } + + bool AvmCore::isQName (Atom atm) + { + if (!isObject(atm)) + return false; + + AvmAssert (!traits.qName_itraits || traits.qName_itraits->final); + Traits *lhs = atomToScriptObject(atm)->traits(); + return (lhs == traits.qName_itraits); + } + + bool AvmCore::isDictionary (Atom atm) + { + return isObject(atm) && atomToScriptObject(atm)->vtable->traits->isDictionary; + } + + // Tables are from http://www.w3.org/TR/2004/REC-xml-20040204/#NT-NameChar + // E4X 13.1.2.1, pg 63 + /* BaseChar = */ + wchar letterTable[] = { + 0x0041, 0x005A, + 0x0061, 0x007A, + 0x00C0, 0x00D6, + 0x00D8, 0x00F6, + 0x00F8, 0x00FF, + 0x0100, 0x0131, + 0x0134, 0x013E, + 0x0141, 0x0148, + 0x014A, 0x017E, + 0x0180, 0x01C3, + 0x01CD, 0x01F0, + 0x01F4, 0x01F5, + 0x01FA, 0x0217, + 0x0250, 0x02A8, + 0x02BB, 0x02C1, + 0x0386, 0x0386, // single + 0x0388, 0x038A, + 0x038C, 0x038C, // single + 0x038E, 0x03A1, + 0x03A3, 0x03CE, + 0x03D0, 0x03D6, + 0x03DA, 0x03DA, // single + 0x03DC, 0x03DC, // single + 0x03DE, 0x03DE, // single + 0x03E0, 0x03E0, // single + 0x03E2, 0x03F3, + 0x0401, 0x040C, + 0x040E, 0x044F, + 0x0451, 0x045C, + 0x045E, 0x0481, + 0x0490, 0x04C4, + 0x04C7, 0x04C8, + 0x04CB, 0x04CC, + 0x04D0, 0x04EB, + 0x04EE, 0x04F5, + 0x04F8, 0x04F9, + 0x0531, 0x0556, + 0x0559, 0x0559, // single + 0x0561, 0x0586, + 0x05D0, 0x05EA, + 0x05F0, 0x05F2, + 0x0621, 0x063A, + 0x0641, 0x064A, + 0x0671, 0x06B7, + 0x06BA, 0x06BE, + 0x06C0, 0x06CE, + 0x06D0, 0x06D3, + 0x06D5, 0x06D5, // single + 0x06E5, 0x06E6, + 0x0905, 0x0939, + 0x093D, 0x093D, // single + 0x0958, 0x0961, + 0x0985, 0x098C, + 0x098F, 0x0990, + 0x0993, 0x09A8, + 0x09AA, 0x09B0, + 0x09B2, 0x09B2, // single + 0x09B6, 0x09B9, + 0x09DC, 0x09DD, + 0x09DF, 0x09E1, + 0x09F0, 0x09F1, + 0x0A05, 0x0A0A, + 0x0A0F, 0x0A10, + 0x0A13, 0x0A28, + 0x0A2A, 0x0A30, + 0x0A32, 0x0A33, + 0x0A35, 0x0A36, + 0x0A38, 0x0A39, + 0x0A59, 0x0A5C, + 0x0A5E, 0x0A5E, // single + 0x0A72, 0x0A74, + 0x0A85, 0x0A8B, + 0x0A8D, 0x0A8D, // single + 0x0A8F, 0x0A91, + 0x0A93, 0x0AA8, + 0x0AAA, 0x0AB0, + 0x0AB2, 0x0AB3, + 0x0AB5, 0x0AB9, + 0x0ABD, 0x0ABD, // single + 0x0AE0, 0x0AE0, // single + 0x0B05, 0x0B0C, + 0x0B0F, 0x0B10, + 0x0B13, 0x0B28, + 0x0B2A, 0x0B30, + 0x0B32, 0x0B33, + 0x0B36, 0x0B39, + 0x0B3D, 0x0B3D, // single + 0x0B5C, 0x0B5D, + 0x0B5F, 0x0B61, + 0x0B85, 0x0B8A, + 0x0B8E, 0x0B90, + 0x0B92, 0x0B95, + 0x0B99, 0x0B9A, + 0x0B9C, 0x0B9C, // single + 0x0B9E, 0x0B9F, + 0x0BA3, 0x0BA4, + 0x0BA8, 0x0BAA, + 0x0BAE, 0x0BB5, + 0x0BB7, 0x0BB9, + 0x0C05, 0x0C0C, + 0x0C0E, 0x0C10, + 0x0C12, 0x0C28, + 0x0C2A, 0x0C33, + 0x0C35, 0x0C39, + 0x0C60, 0x0C61, + 0x0C85, 0x0C8C, + 0x0C8E, 0x0C90, + 0x0C92, 0x0CA8, + 0x0CAA, 0x0CB3, + 0x0CB5, 0x0CB9, + 0x0CDE, 0x0CDE, // single + 0x0CE0, 0x0CE1, + 0x0D05, 0x0D0C, + 0x0D0E, 0x0D10, + 0x0D12, 0x0D28, + 0x0D2A, 0x0D39, + 0x0D60, 0x0D61, + 0x0E01, 0x0E2E, + 0x0E30, 0x0E30, //single + 0x0E32, 0x0E33, + 0x0E40, 0x0E45, + 0x0E81, 0x0E82, + 0x0E84, 0x0E84, // single + 0x0E87, 0x0E88, + 0x0E8A, 0x0E8A, // single + 0x0E8D, 0x0E8D, // single + 0x0E94, 0x0E97, + 0x0E99, 0x0E9F, + 0x0EA1, 0x0EA3, + 0x0EA5, 0x0EA5, // single + 0x0EA7, 0x0EA7, // single + 0x0EAA, 0x0EAB, + 0x0EAD, 0x0EAE, + 0x0EB0, 0x0EB0, // single + 0x0EB2, 0x0EB3, + 0x0EBD, 0x0EBD, // single + 0x0EC0, 0x0EC4, + 0x0F40, 0x0F47, + 0x0F49, 0x0F69, + 0x10A0, 0x10C5, + 0x10D0, 0x10F6, + 0x1100, 0x1100, // single + 0x1102, 0x1103, + 0x1105, 0x1107, + 0x1109, 0x1109, // single + 0x110B, 0x110C, + 0x110E, 0x1112, + 0x113C, 0x113C, // single + 0x113E, 0x113E, // single + 0x1140, 0x1140, // single + 0x114C, 0x114C, // single + 0x114E, 0x114E, // single + 0x1150, 0x1150, // single + 0x1154, 0x1155, + 0x1159, 0x1159, // single + 0x115F, 0x1161, + 0x1163, 0x1163, // single + 0x1165, 0x1165, // single + 0x1167, 0x1167, // single + 0x1169, 0x1169, // single + 0x116D, 0x116E, + 0x1172, 0x1173, + 0x1175, 0x1175, // single + 0x119E, 0x119E, // single + 0x11A8, 0x11A8, // single + 0x11AB, 0x11AB, // single + 0x11AE, 0x11AF, + 0x11B7, 0x11B8, + 0x11BA, 0x11BA, // single + 0x11BC, 0x11C2, + 0x11EB, 0x11EB, // single + 0x11F0, 0x11F0, // single + 0x11F9, 0x11F9, // single + 0x1E00, 0x1E9B, + 0x1EA0, 0x1EF9, + 0x1F00, 0x1F15, + 0x1F18, 0x1F1D, + 0x1F20, 0x1F45, + 0x1F48, 0x1F4D, + 0x1F50, 0x1F57, + 0x1F59, 0x1F59, // single + 0x1F5B, 0x1F5B, // single + 0x1F5D, 0x1F5D, // single + 0x1F5F, 0x1F7D, + 0x1F80, 0x1FB4, + 0x1FB6, 0x1FBC, + 0x1FBE, 0x1FBE, // single + 0x1FC2, 0x1FC4, + 0x1FC6, 0x1FCC, + 0x1FD0, 0x1FD3, + 0x1FD6, 0x1FDB, + 0x1FE0, 0x1FEC, + 0x1FF2, 0x1FF4, + 0x1FF6, 0x1FFC, + 0x2126, 0x2126, // single + 0x212A, 0x212B, + 0x212E, 0x212E, // single + 0x2180, 0x2182, + 0x3041, 0x3094, + 0x30A1, 0x30FA, + 0x3105, 0x312C, + 0xAC00, 0xD7A3, + //[86] Ideographic ::= + 0x4E00, 0x9FA5, + 0x3007, 0x3007, // single + 0x3021, 0x3029 + }; + + bool AvmCore::isLetter (wchar c) + { + int x = sizeof(letterTable) / (sizeof(wchar)); + for (int i = 0; i < x; i += 2) + { + if (c >= letterTable[i] && c <= letterTable[i+1]) + return true; + } + return false; + } + +//[87] CombiningChar ::= + wchar combiningCharTable[] = { + 0x0300, 0x0345, + 0x0360, 0x0361, + 0x0483, 0x0486, + 0x0591, 0x05A1, + 0x05A3, 0x05B9, + 0x05BB, 0x05BD, + 0x05BF, 0x05BF, // single + 0x05C1, 0x05C2, + 0x05C4, 0x05C4, // single + 0x064B, 0x0652, + 0x0670, 0x0670, // single + 0x06D6, 0x06DC, + 0x06DD, 0x06DF, + 0x06E0, 0x06E4, + 0x06E7, 0x06E8, + 0x06EA, 0x06ED, + 0x0901, 0x0903, + 0x093C, 0x093C, // single + 0x093E, 0x094C, + 0x094D, 0x094D, // single + 0x0951, 0x0954, + 0x0962, 0x0963, + 0x0981, 0x0983, + 0x09BC, 0x09BC, // single + 0x09BE, 0x09BE, // single + 0x09BF, 0x09BF, // single + 0x09C0, 0x09C4, + 0x09C7, 0x09C8, + 0x09CB, 0x09CD, + 0x09D7, 0x09D7, // single + 0x09E2, 0x09E3, + 0x0A02, 0x0A02, // single + 0x0A3C, 0x0A3C, // single + 0x0A3E, 0x0A3E, // single + 0x0A3F, 0x0A3F, // single + 0x0A40, 0x0A42, + 0x0A47, 0x0A48, + 0x0A4B, 0x0A4D, + 0x0A70, 0x0A71, + 0x0A81, 0x0A83, + 0x0ABC, 0x0ABC, // single + 0x0ABE, 0x0AC5, + 0x0AC7, 0x0AC9, + 0x0ACB, 0x0ACD, + 0x0B01, 0x0B03, + 0x0B3C, 0x0B3C, // single + 0x0B3E, 0x0B43, + 0x0B47, 0x0B48, + 0x0B4B, 0x0B4D, + 0x0B56, 0x0B57, + 0x0B82, 0x0B83, + 0x0BBE, 0x0BC2, + 0x0BC6, 0x0BC8, + 0x0BCA, 0x0BCD, + 0x0BD7, 0x0BD7, // single + 0x0C01, 0x0C03, + 0x0C3E, 0x0C44, + 0x0C46, 0x0C48, + 0x0C4A, 0x0C4D, + 0x0C55, 0x0C56, + 0x0C82, 0x0C83, + 0x0CBE, 0x0CC4, + 0x0CC6, 0x0CC8, + 0x0CCA, 0x0CCD, + 0x0CD5, 0x0CD6, + 0x0D02, 0x0D03, + 0x0D3E, 0x0D43, + 0x0D46, 0x0D48, + 0x0D4A, 0x0D4D, + 0x0D57, 0x0D57, // single + 0x0E31, 0x0E31, // single + 0x0E34, 0x0E3A, + 0x0E47, 0x0E4E, + 0x0EB1, 0x0EB1, // single + 0x0EB4, 0x0EB9, + 0x0EBB, 0x0EBC, + 0x0EC8, 0x0ECD, + 0x0F18, 0x0F19, + 0x0F35, 0x0F35, // single + 0x0F37, 0x0F37, // single + 0x0F39, 0x0F39, // single + 0x0F3E, 0x0F3E, // single + 0x0F3F, 0x0F3F, // single + 0x0F71, 0x0F84, + 0x0F86, 0x0F8B, + 0x0F90, 0x0F95, + 0x0F97, 0x0F97, // single + 0x0F99, 0x0FAD, + 0x0FB1, 0x0FB7, + 0x0FB9, 0x0FB9, // single + 0x20D0, 0x20DC, + 0x20E1, 0x20E1, // single + 0x302A, 0x302F, + 0x3099, 0x3099, // single + 0x309A, 0x309A // single + }; + bool AvmCore::isCombiningChar (wchar c) + { + int x = sizeof(combiningCharTable) / (sizeof(wchar)); + for (int i = 0; i < x; i += 2) + { + if (c >= combiningCharTable[i] && c <= combiningCharTable[i+1]) + return true; + } + return false; + } + +//[88] Digit ::= + wchar digitTable[] = { + 0x0030, 0x0039, + 0x0660, 0x0669, + 0x06F0, 0x06F9, + 0x0966, 0x096F, + 0x09E6, 0x09EF, + 0x0A66, 0x0A6F, + 0x0AE6, 0x0AEF, + 0x0B66, 0x0B6F, + 0x0BE7, 0x0BEF, + 0x0C66, 0x0C6F, + 0x0CE6, 0x0CEF, + 0x0D66, 0x0D6F, + 0x0E50, 0x0E59, + 0x0ED0, 0x0ED9, + 0x0F20, 0x0F29}; + + bool AvmCore::isDigit (wchar c) + { + int x = sizeof(digitTable) / (sizeof(wchar)); + for (int i = 0; i < x; i += 2) + { + if (c >= digitTable[i] && c <= digitTable[i+1]) + return true; + } + return false; + } + + wchar extenderTable[] = { + 0x00B7, 0x00B7, // single + 0x02D0, 0x02D0, // single + 0x02D1, 0x02D1, // single + 0x0387, 0x0387, // single + 0x0640, 0x0640, // single + 0x0E46, 0x0E46, // single + 0x0EC6, 0x0EC6, // single + 0x3005, 0x3005, // single + 0x3031, 0x3035, + 0x309D, 0x309E, + 0x30FC, 0x30FE}; + bool AvmCore::isExtender (wchar c) + { + int x = sizeof(extenderTable) / (sizeof(wchar)); + for (int i = 0; i < x; i += 2) + { + if (c >= extenderTable[i] && c <= extenderTable[i+1]) + return true; + } + return false; + } + + bool AvmCore::isXMLName(Atom arg) + { + if (isNullOrUndefined(arg)) + return false; + + Stringp p = string(arg); + + // http://www.w3.org/TR/2004/REC-xml-20040204/#NT-NameChar + + // Name is (Letter | _ or :) followed by arbitrary number of NameChar + + if (!p->length()) + return false; + + // According to the Mozilla testcase... + // e4x excludes ':' + + wchar c = (*p)[0]; + if (!isLetter (c) && c != '_' /*&& c != ':'*/) + return false; + + for (int i = 1; i < p->length(); i++) + { + wchar c = (*p)[i]; + + if (isDigit(c) || isLetter(c) || (c == '.') || (c == '-') || (c == '_') || /*(c != ':') ||*/ + isCombiningChar (c) || isExtender(c)) + continue; + + return false; + } + + return true; + } + + Stringp AvmCore::ToXMLString (Atom a) + { + if (!isNull(a)) + { + switch (a&7) + { + case kStringType: + return EscapeElementValue (string(a), true); + case kObjectType: + case kNamespaceType: + if (isXML(a)) + { + XMLObject *x = atomToXMLObject (a); + return x->toXMLString(); + } + else if (isXMLList(a)) + { + XMLListObject *x = atomToXMLList (a); + return x->toXMLString(); + } + else + { + // !!@ to primitive (hint string first) + // !!@ namespace case falls into this as well + return EscapeElementValue (string(a), true); + } + break; + case kSpecialType: + return kundefined; + case kIntegerType: + case kBooleanType: + case kDoubleType: + default: + return string(a); + } + } + else + { + return knull; + } + } + + Stringp AvmCore::EscapeElementValue (const Stringp s, bool removeLeadingTrailingWhitespace) + { + StringBuffer output(this); + + int i = 0; + int last = s->length() - 1; + if (removeLeadingTrailingWhitespace) + { + // finding trailing whitespace + while (last >= 0) + { + if (!String::isSpace ((*s)[last])) + break; + + last--; + } + + if (last < 0) + return kEmptyString; + + // skip leading whitespace + for (i = 0; i <= last; i++) + { + if (!String::isSpace ((*s)[i])) + break; + } + } + + while (i <= last) + { + switch ((*s)[i]) + { + case '<': + output << "<"; + break; + case '>': + output << ">"; + break; + case '&': + output << "&"; + break; + default: + output << ((*s)[i]); + } + + i++; + } + + return newString (output.c_str()); + } + + Stringp AvmCore::EscapeAttributeValue (Atom v) + { + StringBuffer output(this); + + Stringp s = string (v); + + for (int i = 0; i < s->length(); i++) + { + switch ((*s)[i]) + { + case '"': + output << """; + break; + case '<': + output << "<"; + break; + case '&': + output << "&"; + break; + case 0x000a: + output << " "; + break; + case 0x000d: + output << " "; + break; + case 0x0009: + output << " "; + break; + default: + output << ((*s)[i]); + } + } + + return newString (output.c_str()); + } + + XMLObject *AvmCore::atomToXMLObject (Atom atm) + { + if (!isXML (atm)) + return 0; + + return (XMLObject*)(atomToScriptObject(atm)); + } + + E4XNode *AvmCore::atomToXML (Atom atm) + { + if (!isXML (atm)) + return 0; + + return ((XMLObject*)(atomToScriptObject(atm)))->getNode(); + } + + XMLListObject *AvmCore::atomToXMLList (Atom atm) + { + if (!isXMLList (atm)) + return 0; + + return (XMLListObject*)(atomToScriptObject(atm)); + } + + QNameObject *AvmCore::atomToQName (Atom atm) + { + if (!isQName (atm)) + return 0; + + return (QNameObject*)(atomToScriptObject(atm)); + } + + Stringp AvmCore::_typeof (Atom arg) + { + if (!isNull(arg)) + { + switch (arg&7) + { + default: + case kObjectType: + if (isXML (arg) || isXMLList(arg)) + { + return kxml; + } + else if (isFunction(arg)) + { + return kfunction; // No special type code for functions, but we need to + // special case to return 'function' here. + } + else + { + return kobject; + } + + case kBooleanType: + return kboolean; + + case kIntegerType: + case kDoubleType: + return knumber; + + case kSpecialType: + return kundefined; + + case kStringType: + return kstring; + + case kNamespaceType: + return kobject; + } + } + else + { + // typeof(null) = "object" + return kobject; + } + } + + size_t AvmCore::getToplevelSize() const + { + return sizeof(Toplevel); + } + + Toplevel* AvmCore::createToplevel(VTable *vtable) + { + return new (GetGC(), vtable->getExtraSize()) Toplevel(vtable, NULL); + } + + void AvmCore::presweep() + { + // clear out the string table + { + for (int i=0, n=numStrings; i < n; i++) + { + if (strings[i] > AVMPLUS_STRING_DELETED && !GetGC()->GetMark(strings[i])) + { + strings[i] = AVMPLUS_STRING_DELETED; + deletedCount++; + stringCount--; + } + } + } + + + // do the same for the namespaces + { + bool rehashFlag = false; + for (int i=0, n=numNamespaces; i < n; i++) + { + if (namespaces[i] != NULL && !GetGC()->GetMark(namespaces[i])) + { + rehashFlag = true; + namespaces[i] = NULL; + } + } + + // if any interned strings were freed, rehash the intern table + // todo - make this less aggressive + if (rehashFlag) + rehashNamespaces(numNamespaces); + } + +#ifdef DEBUGGER + if(stackTraces) + { + uint32 n = GetGC()->Size(stackTraces)/sizeof(StackTrace*); + n = 1<GetMark(stackTraces[i])) + { + rehash = true; + stackTraces[i] = NULL; + } + } + if(rehash) + rehashTraces(n); + } +#endif + } + + bool wcharEquals(const wchar *s1, const wchar *s2) + { + while (*s1) { + if (*s1 != *s2) { + return false; + } + s1++; + s2++; + } + return true; + } + + int hashString(const wchar *ptr, int len) + { + int hashCode = 0; + while (len--) { + hashCode = (hashCode >> 28) ^ (hashCode << 4) ^ *ptr++; + } + return hashCode; + } + + int AvmCore::findString(const wchar *s, int len) + { + int m = numStrings; + // 80% load factor + if (5*(stringCount+deletedCount+1) > 4*m) { + if (2*stringCount > m) // 50% + rehashStrings(m = m << 1); + else + rehashStrings(m); + } + + // compute the hash function + int hashCode = hashString(s, len); + + int bitMask = m - 1; + + // find the slot to use + int i = (hashCode&0x7FFFFFFF) & bitMask; + int n = 7; + Stringp k; + if (!deletedCount) + { + while ((k=strings[i]) != NULL && !k->FastEquals(s,len)) { + i = (i + (n++)) & bitMask; // quadratic probe + } + } + else + { + int iFirstDeletedSlot = -1; + while ((k=strings[i]) != NULL) + { + if (k == AVMPLUS_STRING_DELETED) + { + if (iFirstDeletedSlot == -1) + { + iFirstDeletedSlot = i; + } + } + else if (k->FastEquals (s, len)) + { + return i; + } + i = (i + (n++)) & bitMask; // quadratic probe + } + + if ((k == NULL) && (iFirstDeletedSlot != -1)) + return iFirstDeletedSlot; + + } + return i; + } + + /** + * namespace hash search. interned namespaces are as unique as their + * uri. We assume uri's are already interned, so interning a namespace + * is quick because uri's can be compared quickly. + */ + int AvmCore::findNamespace(const Namespace* ns) + { + int m = numNamespaces; + // 80% load factor + if (nsCount*5 >= 4*m) { + rehashNamespaces(m = m << 1); + } + + // compute the hash function + int hashCode = ((int)ns->getURI())>>3; + + int bitMask = m - 1; + + // find the slot to use + int i = (hashCode&0x7FFFFFFF) & bitMask; + int n = 7; + Namespace* k; + while ((k=namespaces[i]) != NULL && k->m_uri != ns->m_uri ) { + i = (i + (n++)) & bitMask; // quadratic probe + } + return i; + } + + /** + * intern the given string atom which has already been allocated + * @param atom + * @return + */ + Stringp AvmCore::internString(Stringp o) + { + if (o->isInterned()) + return o; + + int i = findString(o->c_str(), o->length()); + Stringp other; + if ((other=strings[i]) <= AVMPLUS_STRING_DELETED) + { + if (other == AVMPLUS_STRING_DELETED) + { + deletedCount--; + AvmAssert(deletedCount >= 0); + } + stringCount++; + strings[i] = o; + o->setInterned(this); + return o; + } + else + { + return other; + } + } + + Stringp AvmCore::internString(Atom atom) + { + AvmAssert(isString(atom)); + Stringp s = atomToString(atom); + return s->isInterned() ? s : internString(s); + } + + Stringp AvmCore::internInt(int value) + { + wchar buffer[40]; + int len; + MathUtils::convertIntegerToString(value, buffer, len); + return internAlloc(buffer, len); + + // This optimized routine below works fine and is faster than calling + // convertIntegerToString but with our support of integer keys in our + // HashTables, this routine is no longer on a critical path. Save some + // code by leaving it disabled unless we can show a performance gain by + // using it. +#if 0 + // optimized case of MathUtils;:convertIntegerToString + + if ((uint32)value == 0x80000000) // MathUtils::convertIntegerToString doesn't deal with this number because you can't negate it. + { + UnicodeUtils::Utf8ToUtf16((uint8*)"-2147483648", 12, buffer, 24); + return internAlloc(buffer, 11); + } + + wchar *src = &buffer[39]; + *src-- = '\0'; + + if (value == 0) + { + *src-- = '0'; + } + else + { + uint32 uVal; + bool negative = (value < 0); + if (negative) + value = -value; + + uVal = (uint32)value; + + while (uVal != 0) + { + uint32 j = uVal; + uVal = uVal / 10; + j -= (uVal * 10); + + *src-- = (j + '0'); + } + + if (negative) + *src-- = '-'; + } + + return internAlloc(src + 1, &buffer[39] - src - 1); +#endif + } + Stringp AvmCore::internUint32 (uint32 ui) + { + if (ui & 0x80000000) + return internDouble(ui); + else + return internInt((int)ui); + } + + Stringp AvmCore::internDouble(double d) + { + wchar buffer[256]; + int len; + MathUtils::convertDoubleToString(d, buffer, len); + return internAlloc(buffer, len); + } + + Stringp AvmCore::internAllocUtf8(const byte *cs, int len8) + { + int len16 = UnicodeUtils::Utf8Count((const uint8*)cs, len8); + Stringp s = new (GetGC()) String((const char *)cs, len8, len16); + + int i = findString(s->c_str(), len16); + Stringp other; + if ((other=strings[i]) <= AVMPLUS_STRING_DELETED) + { + if (other == AVMPLUS_STRING_DELETED) + { + deletedCount--; + AvmAssert(deletedCount >= 0); + } + + stringCount++; + strings[i] = s; + s->setInterned(this); + return s; + } + else + { + // we know the internal buf has not yet been aliased, so it's safe to explicitly free here. + delete s; + return other; + } + } + + + Stringp AvmCore::internAllocAscii(const char *cs) + { + int len = strlen(cs); + wchar buffer[256]; + + AvmAssert(len < 256); + + for(int j=0; j= 0); + } + s = new (GetGC()) String(buffer, len); + stringCount++; + strings[i] = s; + s->setInterned(this); + } + return s; + } + + + Stringp AvmCore::internAlloc(const wchar *s, int len) + { + int i = findString(s, len); + Stringp other; + if ((other=strings[i]) <= AVMPLUS_STRING_DELETED) + { + if (other == AVMPLUS_STRING_DELETED) + { + deletedCount--; + AvmAssert(deletedCount >= 0); + } + +#ifdef DEBUGGER + DRC(Stringp) *oldStrings = strings; +#endif + + other = new (GetGC()) String(s,len); + +#ifdef DEBUGGER + // re-find if String ctor caused rehash + if(strings != oldStrings) + i = findString(s, len); +#endif + strings[i] = other; + stringCount++; + other->setInterned(this); + } + return other; + } + + void AvmCore::rehashStrings(int newlen) + { + // rehash + + DRC(Stringp) *oldStrings = strings; + int oldStringCount = numStrings; + + strings = new DRC(Stringp)[newlen]; + memset(strings, 0, newlen*sizeof(Stringp)); + numStrings = newlen; + +#ifdef _DEBUG // debug sanity checks + int oldDeletedCount = deletedCount; + int computedDeleteCount = 0; + int computedStringCount = 0; +#endif + + deletedCount = 0; + + // Inlined and optimized our findString routine. We know that there + // are no duplicated strings in our intern string table so we don't + // need to call Equals. All we need to do is find the first blank + // spot available. + int m = numStrings; + int bitMask = m - 1; + + for (int i=0; i < oldStringCount; i++) + { + Stringp o = oldStrings[i]; + if (o > AVMPLUS_STRING_DELETED) + { + // compute the hash function + int hashCode = hashString(o->c_str(), o->length()); + + // find the slot to use + int j = (hashCode&0x7FFFFFFF) & bitMask; + int n = 7; + while (strings[j] != NULL) { + j = (j + (n++)) & bitMask; // quadratic probe + } + + strings[j] = o; +#ifdef _DEBUG + computedStringCount++; +#endif + } +#ifdef _DEBUG + else if (o == AVMPLUS_STRING_DELETED) + { + computedDeleteCount++; + } +#endif + } + +#ifdef _DEBUG + AvmAssert(computedStringCount == stringCount); + AvmAssert(oldDeletedCount == computedDeleteCount); +#endif + + // Clear oldStrings so it can be collected. + delete [] oldStrings; + } + + void AvmCore::rehashNamespaces(int newlen) + { + // rehash + + DRC(Namespacep) *old = namespaces; + int oldCount = numNamespaces; + + namespaces = new DRC(Namespacep)[newlen]; + memset(namespaces, 0, newlen*sizeof(Namespace*)); + numNamespaces = newlen; + + for (int i=0; i < oldCount; i++) + { + Namespace* o = old[i]; + if (o != NULL) + namespaces[findNamespace(o)] = o; + } + + // Clear old namespaces table so it can be collected. + delete [] old; + } + + ScriptBufferImpl* AvmCore::newScriptBuffer(size_t size) + { + return new (GetGC(), size) BasicScriptBufferImpl(size); + } + + VTable* AvmCore::newVTable(Traits* traits, VTable* base, ScopeChain* scope, + AbcEnv* abcEnv, Toplevel* toplevel) + { + size_t extraSize = sizeof(MethodEnv*)*(traits->methodCount > 0 ? traits->methodCount-1 : 0); + return new (GetGC(), extraSize) VTable(traits, base, scope, abcEnv, toplevel); + } + + RegExpObject* AvmCore::newRegExp(RegExpClass* regexpClass, + Stringp pattern, + Stringp options) + { + return new (GetGC(), regexpClass->ivtable()->getExtraSize()) RegExpObject(regexpClass, + pattern, options); + } + + ScriptObject* AvmCore::newObject(VTable *vtable, ScriptObject *delegate) + { + return new (GetGC(), vtable->getExtraSize()) ScriptObject(vtable, delegate); + } + + ScriptObject* AvmCore::newActivation(VTable *vtable, ScriptObject *delegate) + { + ScriptObject* obj = new (GetGC(), vtable->getExtraSize()) ScriptObject(vtable, delegate); + if(vtable->init) + { + Atom argv[1]; + argv[0] = obj->atom(); // new object is receiver + MethodEnv* init = vtable->init; + init->coerceEnter(0, argv); + } + return obj; + } + + Namespace* AvmCore::newNamespace(Atom prefix, Atom uri, Namespace::NamespaceType type) + { + // E4X - this is 13.2.3, step 3 - prefix IS specified + + Atom p; + Stringp u; + if (isQName (uri) && !isNull(atomToQName (uri)->getURI())) + { + u = atomToString(atomToQName (uri)->getURI()); + } + else + { + u = internString (string (uri)); + } + if (u == kEmptyString) + { + if (prefix == undefinedAtom) + p = kEmptyString->atom(); + else if (!string (prefix)->length()) + p = kEmptyString->atom(); + else + { + // !!@ throw correct type error + //typeErrorClass()->throwError(kConvertUndefinedToObjectError); + return NULL; + } + } + else if (prefix == undefinedAtom) + { + p = undefinedAtom; + } + else if (prefix != kEmptyString->atom() && !isXMLName (prefix)) + { + p = undefinedAtom; + } + else + { + p = internString (string (prefix))->atom(); + } + + return new (GetGC()) Namespace(p, u, type); + } + + Namespace* AvmCore::newNamespace(Atom uri, Namespace::NamespaceType type) + { + // prefix and uri must be interned! + // E4X - this is 13.2.2, step 3 - "prefix not specified" + + if (isNamespace (uri)) + { + Namespace *ns = atomToNamespace (uri); + return new (GetGC()) Namespace (ns->getPrefix(), ns->getURI(), type); + } + else if (isObject(uri) && isQName (uri) && !isNull(atomToQName (uri)->getURI())) + { + return new (GetGC()) Namespace (undefinedAtom, atomToString(atomToQName (uri)->getURI()), type); + } + else + { + Stringp u = internString (string (uri)); + Atom prefix = (u == kEmptyString) ? kEmptyString->atom() : undefinedAtom; + return new (GetGC()) Namespace (prefix, u, type); + } + } + + Namespace* AvmCore::newNamespace(Stringp uri, Namespace::NamespaceType type) + { + uri = internString(uri); + Atom prefix = (uri == kEmptyString) ? kEmptyString->atom() : undefinedAtom; + return new (GetGC()) Namespace(prefix, uri, type); + } + + NamespaceSet* AvmCore::newNamespaceSet(int nsCount) + { + size_t extra = (nsCount >= 1 ? nsCount-1 : 0)*sizeof(Atom); + return new (GetGC(), extra) NamespaceSet(nsCount); + } + + Atom AvmCore::uintToAtom(uint32 n) + { + // As kIntegerType is signed, we can only represent a 28-bit uint in it + if (!(n&0xF0000000)) { + return (n<<3) | kIntegerType; + } else { + return allocDouble(n); + } + } + + Atom AvmCore::intToAtom(int n) + { + // handle integer values w/out allocation + int i29 = n << 3; + if ((i29>>3) == n) + { + return i29 | kIntegerType; + } + else + { + return allocDouble(n); + } + } + +#ifdef AVMPLUS_IA32 + // ignore warning that inline asm disables global optimization in this function + #pragma warning(disable: 4740) + Atom AvmCore::doubleToAtom_sse2(double n) + { + #ifdef AVMPLUS_PROFILE + if (dprof.dprofile) + DynamicProfiler::StackMark mark(OP_doubletoatom, &dprof); + #endif + + // handle integer values w/out allocation + // this logic rounds in the wrong direction for E3, but + // we never use a rounded value, only cleanly converted values. + #ifdef WIN32 // LINUX_TODO: need linux port + int id3; + _asm { + movsd xmm0,n + cvttsd2si ecx,xmm0 + shl ecx,3 // id<<3 + mov eax,ecx + sar ecx,3 // id>>3 + cvtsi2sd xmm1,ecx + ucomisd xmm0,xmm1 + jne d2a_alloc // < or > + jp d2a_alloc // unordered + mov id3,eax + } + + + if (id3 != 0 || !MathUtils::isNegZero(n)) + { + return id3 | kIntegerType; + } + else + { + _asm d2a_alloc: + return allocDouble(n); + } + #elif defined(_MAC) && TARGET_CPU_X86 + int id = _mm_cvttsd_si32(_mm_set_sd(n)); + // MacTel is luckily always using SSE2, there + // are no intrinsics to check for unordered + // mode here using any of the _mm_ucominXXX + // instructions + if (((id<<3)>>3) == n) { + // make sure its not -0 + if (id == 0 && MathUtils::isNegZero(n)) { + return allocDouble(n); + } else { + return (id<<3) | kIntegerType; + } + } + return allocDouble(n); + #endif + } +#endif + + Atom AvmCore::doubleToAtom(double n) + { + #ifdef AVMPLUS_PROFILE + if (dprof.dprofile) + DynamicProfiler::StackMark mark(OP_doubletoatom, &dprof); + #endif + + // There is no need for special logic for NaN or +/-Inf since we don't + // ever test for those values in coreplayer. As far as we're concerned + // they are regular numeric values. + + // handle integer values w/out allocation + #ifdef WIN32 + // this logic rounds in the wrong direction for E3, but + // we never use a rounded value, only cleanly converted values. + int id; + _asm { + fld [n]; + fistp [id]; + } + #elif defined(_MAC) && TARGET_CPU_X86 + int id = _mm_cvttsd_si32(_mm_set_sd(n)); + #else + int id = MathUtils::real2int(n); + #endif + + // make sure n is integer value that fits in 29 bits + if (((id<<3)>>3) == n) + { + // make sure its not -0 + if (id == 0 && MathUtils::isNegZero(n)) + return allocDouble(n); + else + return (id<<3) | kIntegerType; + } + else + { + return allocDouble(n); + } + } + +#ifdef AVMPLUS_VERBOSE + /** + * format the value of an atom for debugging. This is here so that we can + * more eazily take care of pointer swizzling when called from ScriptObject.format(). + * @param atom + * @return + */ + Stringp AvmCore::format(Atom atom) + { + if (!isNull(atom)) + { + switch (atom&7) + { + default: + case kNamespaceType: + return atomToNamespace(atom)->format(this); + case kObjectType: + return atomToScriptObject(atom)->format(this); + case kStringType: + { + Stringp quotes = newString("\""); + return concatStrings(quotes, + concatStrings(atomToString((atom&~7)==0 ? kEmptyString->atom() : atom), + quotes)); + } + case kSpecialType: + return kundefined; + case kBooleanType: + return booleanStrings[atom>>3]; + case kIntegerType: + return intToString((int)(atom>>3)); + case kDoubleType: + AvmAssert(atom != kDoubleType); // this would be a null pointer to double + return doubleToString(atomToDouble(atom)); + } + } + else + { + return knull; + } + } + + Stringp AvmCore::formatAtomPtr(Atom atom) + { + wchar buffer[256]; + int len; + MathUtils::convertIntegerToString((int)atom, buffer, len, 16); + return new (GetGC()) String(buffer, len); + } +#endif + +#ifdef DEBUGGER + int AvmCore::sizeInternedTables() + { + int size = 0; + + //add size of strings array + size += numStrings * sizeof(Stringp); + for (int i = 0; i < numStrings; i++) + { + if (strings[i] > AVMPLUS_STRING_DELETED) + { + size += profiler->computeStringSize(strings[i]); + } + } + + // add size of namespaces array + size += numNamespaces * sizeof(Namespace*); + for (int i=0; i < numNamespaces; i++) + { + if (namespaces[i] != NULL) + { + if (namespaces[i]->m_prefix != undefinedAtom) + { + size += profiler->computeStringSize(atomToString(namespaces[i]->m_prefix)); + } + size += profiler->computeStringSize(namespaces[i]->getURI()); + } + } + + return size; + } + + void AvmCore::sample() + { + if(!AvmCore::sampling) return; + if(!callStack) + { + return; + } + + uint64 time = GC::GetPerformanceCounter(); + + size_t sampleSize = sizeof(uint64) + sizeof(uint32) + + callStack->depth * (sizeof(void*) + sizeof(void*) + sizeof(int)); + + if(currentSample + sampleSize > samples->uncommitted()) + { + samples->grow(); + if(currentSample + sampleSize > samples->uncommitted()) + { + // exhausted buffer + return; + } + } + + CallStackNode *csn = callStack; + byte *p = currentSample; + *(uint64*)p = time; + p += sizeof(uint64); + *(uint32*)p = callStack->depth; + p += sizeof(uint32); + while(csn) + { + // FIXME: this is essentially a 12 byte copy, faster way? + *(AbstractFunction**)p = csn->info; + p += sizeof(AbstractFunction*); + *(Stringp*)p = csn->filename; + p += sizeof(Stringp); + *(int*)p = csn->linenum; + p += sizeof(int); + csn = csn->next; + } + currentSample = p; + numSamples++; + takeSample = 0; + } + + void AvmCore::clearSamples() + { + currentSample = samples->start(); + numSamples = 0; + } + + void AvmCore::startSampling() + { + if(!AvmCore::sampling) return; + if(samplingNow) + return; + numSamples = 0; + samplingNow = true; + if(!samples->start()) + currentSample = samples->reserve(512 * 1024 * 1024); + timerHandle = OSDep::startIntWriteTimer(1, &takeSample); + } + + void AvmCore::stopSampling() + { + if(!AvmCore::sampling) return; + if(!samplingNow) + return; + OSDep::stopTimer(timerHandle); + currentSample = samples->start(); + samplingNow = false; + } + + void AvmCore::initSampling() + { + if(AvmCore::sampling) + { + samples = new (GetGC()) GrowableBuffer(GetGC()->GetGCHeap()); + fakeMethodInfos = new (GetGC()) Hashtable(GetGC()); + } + if(AvmCore::sampling || allocationTracking) + { + stackTraces = (StackTrace**)GetGC()->Alloc(sizeof(StackTrace*) * 1024, GC::kZero); + } + + if(AvmCore::sampling && autoStartSampling) + { + startSampling(); + } + } + +#endif + + /** + * traits with base traits. These should only be used + * for Object instance traits, and activation objects (e.g. global scope) + * that are not normally accessable to users. + */ + Traits* AvmCore::newTraits(Traits *base, + int nameCount, + int interfaceDelta, + size_t objectSize) + { + int interfaceCount = interfaceDelta; + if (base) + interfaceCount += base->interfaceCount+1; // +1 b/c base is added + int interfaceCapacity = MathUtils::nextPowerOfTwo((5*interfaceCount >> 2) + 1); + size_t extra = interfaceCapacity*sizeof(Traits*); + Traits* traits = new (GetGC(), extra) Traits(this, base, + nameCount, + interfaceCount, + interfaceCapacity, + objectSize); + return traits; + } + + Stringp AvmCore::newString(const char *s) const + { + int len = String::Length(s); + int utf16len = UnicodeUtils::Utf8ToUtf16((const uint8*)s, len, NULL, 0); + return new (GetGC()) String(s, len, utf16len); + } + + Stringp AvmCore::newString(const char *s, int len) const + { + int utf16len = UnicodeUtils::Utf8ToUtf16((const uint8*)s, len, NULL, 0); + return new (GetGC()) String(s, len, utf16len); + } + + Stringp AvmCore::newString(const wchar *s) const + { + int len = String::Length(s); + return new (GetGC()) String(s, len); + } + + Stringp AvmCore::concatStrings(Stringp s1, Stringp s2) const + { + if (!s1) s1 = knull; + if (!s2) s2 = knull; + if (s1->length() == 0) { + return s2; + } else if (s2->length() == 0) { + return s1; + } + return new (GetGC()) String(s1, s2); + } + + Stringp AvmCore::intToString(int value) + { + wchar buffer[40]; + int len; + MathUtils::convertIntegerToString(value, buffer, len); + return new (GetGC()) String(buffer, len); + } + + Stringp AvmCore::uintToString(uint32 value) + { + wchar buffer[40]; + int len; + if (value <= 0x7FFFFFFF) + MathUtils::convertIntegerToString(value, buffer, len); + else + MathUtils::convertDoubleToString(value, buffer, len); + return new (GetGC()) String(buffer, len); + } + + Stringp AvmCore::doubleToString(double d) + { + wchar buffer[256]; + int len; + MathUtils::convertDoubleToString(d, buffer, len, MathUtils::DTOSTR_NORMAL,15); + return new (GetGC()) String(buffer, len); + } + + #ifdef DEBUGGER + StackTrace* AvmCore::newStackTrace() + { + int depth = callStack ? callStack->depth : 0; + int extra = depth > 0 ? sizeof(StackTrace::Element) * (depth-1) : 0; + StackTrace* stackTrace = new (GetGC(), extra) StackTrace(); + if (stackTrace) + { + stackTrace->depth = depth; + CallStackNode *curr = callStack; + StackTrace::Element *element = stackTrace->elements; + while (curr) { + element->info = curr->info; + element->filename = curr->filename; + element->linenum = curr->linenum; + element++; + curr = curr->next; + } + } + return stackTrace; + } + + void AvmCore::rehashTraces(int newSize) + { + uint32 oldNumTraces = numTraces; + numTraces = 0; + StackTrace **oldStackTraces = stackTraces; + stackTraces = (StackTrace**)GetGC()->Calloc(newSize, sizeof(StackTrace*), GC::kZero); + + uint32 bitMask = newSize-1; + + for(uint32 i=0, n=oldNumTraces; ielements, t->depth)&0x7FFFFFFF) & bitMask; + uint32 n = 7; + while (stackTraces[j] != NULL) { + j = (j + (n++)) & bitMask; // quadratic probe + } + stackTraces[j] = t; + } + } + numTraces = oldNumTraces; + } + + int AvmCore::findTrace(void /*StackTrace::Element*/ *ve, int depth) + { + StackTrace::Element *e = (StackTrace::Element*)ve; + uint32 sizeTraces = GetGC()->Size(stackTraces)/sizeof(StackTrace*); + uint32 shift = FindOneBit(sizeTraces); + uint32 bitMask = (1< bitMask*3) + { + rehashTraces((bitMask+1)*2); + sizeTraces = GetGC()->Size(stackTraces)/sizeof(StackTrace*); + shift = FindOneBit(sizeTraces); + bitMask = (1<equals(e,depth)) { + j = (j + (n++)) & bitMask; // quadratic probe + } + return j; + } + + + StackTrace* AvmCore::getStackTrace(void /*StackTrace::Element*/ *ve, int depth) + { + StackTrace::Element *e = (StackTrace::Element*)ve; + int i = findTrace(e, depth); + StackTrace *t = stackTraces[i]; + if(t) + return t; + + int extra = depth > 0 ? sizeof(StackTrace::Element) * (depth-1) : 0; + t = new (GetGC(), extra) StackTrace(); + t->depth = depth; + memcpy(t->elements, e, extra + sizeof(StackTrace::Element)); + stackTraces[i] = t; + numTraces++; + return t; + } + + StackTrace* AvmCore::getStackTrace() + { + if(callStack) + { + StackTrace::Element *elements = (StackTrace::Element*)alloca(callStack->depth * sizeof(StackTrace::Element)); + StackTrace::Element *e = elements; + CallStackNode *curr = callStack; + while (curr) { + e->info = curr->info; + e->filename = curr->filename; + e->linenum = curr->linenum; + e++; + curr = curr->next; + } + + int i = findTrace(elements, callStack->depth); + StackTrace *t = stackTraces[i]; + if(t) + return t; + StackTrace *st = newStackTrace(); + stackTraces[i] = st; + numTraces++; + return st; + } + return NULL; + } + + #ifdef _DEBUG + void AvmCore::dumpStackTrace() + { + StringBuffer buffer(this); + buffer << "Stack Trace:\n" << newStackTrace()->format(this) << '\n'; + AvmDebugMsg(false, buffer.c_str()); + } + #endif + + /*static*/ + void AvmCore::chargeAllocation(Atom a) + { + GC *gc = GC::GetGC((const void*)a); + AvmCore *core = (AvmCore*)gc->GetGCContextVariable(GC::GCV_AVMCORE); + if(!core->callStack || !core->callStack->env) + return; + + Toplevel *toplevel = core->callStack->env->toplevel(); + ClassClosure *clazz = NULL; + switch(a&7) + { + case kStringType: + clazz = toplevel->stringClass; + break; + case kNamespaceType: + clazz = toplevel->namespaceClass; + break; + } + if(clazz) + { + clazz->addInstance(a); + } + } + #endif /* DEBUGGER */ + + int AvmCore::integer(Atom atom) const + { + if ((atom & 7) == kIntegerType || (atom&7) == kBooleanType) { + return atom >> 3; + } else { + // TODO optimize the code below. + double d = number(atom); + return integer_d(d); + } + } + + // static + + int AvmCore::integer_d(double d) + { + // Try a simple case first to see if we have a in-range float value + +#ifdef WIN32 // should be any intel build + // WIN32's real2int returns 0x80000000 if d is not in a valid integer range + int id = MathUtils::real2int (d); + if (id != 0x80000000) + return id; +#endif + + return doubleToInt32(d); + } + +#ifdef AVMPLUS_IA32 + int AvmCore::integer_d_sse2(double d) + { + int id; + #ifdef WIN32 // LINUX_TODO: need linux and ppc port + _asm { + cvttsd2si eax,d + mov id,eax + } + if (id != 0x80000000) + return id; + #elif defined(_MAC) && TARGET_CPU_X86 + id = _mm_cvttsd_si32(_mm_set_sd(d)); + if (id != 0x80000000) + return id; + #endif + + return doubleToInt32(d); + } +#endif // AVMPLUS_IA32 + + int AvmCore::doubleToInt32(double d) + { + // From the ES3 spec, 9.5 + // 2. If Result(1) is NaN, +0, -0, +Inf, or -Inf, return +0. + // 3. Compute sign(Result(1)) * floor(abs(Result(1))). + // 4. Compute Result(3) modulo 2^32; that is, a finite integer value k of Number + // type with positive sign and less than 2^32 in magnitude such the mathematical + // difference of Result(3) and k is mathematically an integer multiple of 2^32. + // 5. If Result(4) is greater than or equal to 2^31, return Result(4)- 2^32, + // otherwise return Result(4). + + // step 2 + if (MathUtils::isNaN(d) || MathUtils::isInfinite(d) || d == 0) { + return 0; + } + + // step 3 (round towards 0) + double ad = d < 0.0 ? MathUtils::floor(-d) : MathUtils::floor(d); + + // step 4 + if (ad > 4294967295.0) + ad = MathUtils::mod(ad,4294967296.0); // ad %= 0x10000000 + + // step 5 + if (ad >= (double)2147483648.0) + { + // This case is a large negative number that overflows back to a positive + // number. This code has been tweaked to work on both Mac and Windows. Mac + // is particularly sensitive to edge numbers such as 0x80000000 when converting + // doubles to ints). + if (d < 0.0) + { + int intVal = MathUtils::real2int (ad - 2147483648.0); + return 0x80000000 - intVal; + } + // This case is a large positive number overflowing to negative. + else + { + int intVal = MathUtils::real2int (ad - 2147483648.0); + return 0x80000000 + intVal; + } + } + else + { + return MathUtils::real2int(d < 0.0 ? -ad : ad); + } + } + + // This routine is a very specific parser to generate a positive integer from a string. + // The following are supported: + // "0" - one single digit for zero - NOT "00" or any other form of zero + // [1-9]+[0-9]* up to 2^32-2 (4294967294) + // 2^32-1 (4294967295) is not supported (see ECMA quote below). + // The ECMA that we're supporting with this routine is... + // cn: the ES3 test for a valid array index is + // "A property name P (in the form of a string value) is an array index if and + // only if ToString(ToUint32(P)) is equal to P and ToUint32(P) is not equal to 2^32-1." + bool AvmCore::getIndexFromString (Stringp s, uint32 *result) + { + int len = s->length(); + if (!len) + return false; + + // Don't support 000000 as 0. + // We don't support 0x1234 as 1234 in hex since string(1234) doesn't equal '0x1234') + // No leading zeros are supported + + // Single 0 is ok + const wchar *c = s->c_str(); + if (*c == '0') + { + if (len == 1) + { + *result = 0; + return true; + } + else + { + return false; + } + } + else if ((*c < '0') || (*c > '9')) + { + return false; + } + + // A string that is more than 10 digits (and does not start with 0) + // will always be greater than 2^32-1 (4294967295) or not a numeric string + if (len > 10) + { + return false; + } + + uint32 res = 0; + int i = 0; + while (i < len) + { + wchar ch = c[i]; + if (ch < '0' || ch > '9') + return false; + + res = res * 10 + (ch - '0'); + i++; + } + + *result = res; + // Our input string length is less then 10 digits so we now + // our output is in the valid range up to 999,999,999. + if (len < 10) + { + return true; + } + + // At this point we know our string is 10 characters long and is all numeric + // characters. We need to check it to see if it overflows 2^32 and whether it equals + // 2^32-1. This string comparison works as a numeric comparison since we know our input + // string is also ten numeric digits. + + int comp = String::Compare (c, "4294967295", 10); + return (comp > 0); + } + + CodeContext* AvmCore::codeContext() const + { + if (codeContextAtom == CONTEXT_NONE) { + return NULL; + } else if ((codeContextAtom&7) == CONTEXT_ENV) { + MethodEnv *env = (MethodEnv*)(codeContextAtom&~7); + return env->vtable->abcEnv->codeContext; + } else { + return (CodeContext*)(codeContextAtom&~7); + } + } + + /** + * MIR needs a large intermediate buffer for codegen. + * These routines allow reuse of this buffer(s) + */ + // @todo make this static and work with gc + //List AvmCore::mirBuffers(0); // mir buffer pool + //GCSpinLock AvmCore::mirBufferLock; // lock for pool + + GrowableBuffer* AvmCore::requestMirBuffer() + { + //GCAcquireSpinlock spinlock(mirBufferLock); + GrowableBuffer* buffer = 0; + if (mirBuffers.size() > 0) + buffer = mirBuffers.removeFirst(); + else + buffer = requestNewMirBuffer(); + return buffer; + } + + GrowableBuffer* AvmCore::requestNewMirBuffer() + { + return new (GetGC()) GrowableBuffer(GetGC()->GetGCHeap()); + } + + void AvmCore::releaseMirBuffer(GrowableBuffer* buffer) + { + //GCAcquireSpinlock spinlock(mirBufferLock); + mirBuffers.add(buffer); + } + +#ifdef MMGC_DRC + /*static*/ + void AvmCore::decrementAtomRegion(Atom *arr, int length) + { + for(int i=0; i < length; i++) + { + Atom a = arr[i]; + RCObject *obj = (RCObject*)(a&~7); + if(obj) { + switch(a&7) { + case kStringType: + case kObjectType: + case kNamespaceType: + ((RCObject*)(a&~7))->DecrementRef(); + break; + } + } + arr[i] = 0; + } + } +#endif + + /*static*/ + void AvmCore::atomWriteBarrier(MMgc::GC *gc, const void *container, Atom *address, Atom atomNew) + { +#ifdef MMGC_DRC + Atom atom = *address; + if(!isNull(atom)) { + switch(atom&7) + { + case kStringType: + case kObjectType: + case kNamespaceType: + MMgc::RCObject *obj = (MMgc::RCObject*)(atom&~7); + obj->DecrementRef(); + break; + } + } +#endif + + switch(atomNew&7) + { + case kStringType: + case kObjectType: + case kNamespaceType: +#ifdef MMGC_DRC + if(!isNull(atomNew)) + ((MMgc::RCObject*)(atomNew&~7))->IncrementRef(); + // fall through +#endif + case kDoubleType: + { + gc->WriteBarrierNoSubstitute(container, (const void*)atomNew); + } + break; + + } + *address = atomNew; + } + + Atom AvmCore::gcObjectToAtom(const void* obj) + { +#ifdef _DEBUG + // We get a null obj here through ElementE4XNode::_insert + if (obj) + { + GC* gc = GC::GetGC(obj); + AvmAssert(!gc->IsRCObject(obj)); + } +#endif + // return a non-RC atom, makes atomWriteBarrier do the right thing + return (Atom)obj|kDoubleType; + } + +#ifdef AVMPLUS_MIR + + void AvmCore::initMultinameLate(Multiname& name, Atom index) + { + if (isObject(index)) + { + ScriptObject* i = atomToScriptObject(index); + if (i->traits() == traits.qName_itraits) + { + QNameObject* qname = (QNameObject*) i; + bool attr = name.isAttr(); + qname->getMultiname(name); + name.setAttr(attr); + return; + } + } + + name.setName(intern(index)); + } +#endif +} diff --git a/mozilla/js/tamarin/core/AvmCore.h b/mozilla/js/tamarin/core/AvmCore.h new file mode 100644 index 00000000000..2219d83f608 --- /dev/null +++ b/mozilla/js/tamarin/core/AvmCore.h @@ -0,0 +1,1389 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_AvmCore__ +#define __avmplus_AvmCore__ + +namespace avmplus +{ + +#define DECLARE_NATIVE_SCRIPTS() static NativeScriptInfo scriptEntries[]; + +#define BEGIN_NATIVE_SCRIPTS(_Class) NativeScriptInfo _Class::scriptEntries[] = { + +#define NATIVE_SCRIPT(script_id, _Script) { script_id, (NativeScriptInfo::Handler)_Script::createGlobalObject, _Script::natives, sizeof(_Script) }, + +#define END_NATIVE_SCRIPTS() { -1, NULL, NULL, 0 } }; + +#define DECLARE_NATIVE_CLASSES() static NativeClassInfo classEntries[]; + +#define BEGIN_NATIVE_CLASSES(_Class) NativeClassInfo _Class::classEntries[] = { + +#define NATIVE_CLASS(class_id, _Class, _Instance) { avmplus::NativeID::class_id, (NativeClassInfo::Handler)_Class::createClassClosure, _Class::natives, sizeof(_Class), sizeof(_Instance) }, + +#define END_NATIVE_CLASSES() { -1, NULL, NULL, 0, 0 } }; + +#define OBJECT_TYPE (core->traits.object_itraits) +#define CLASS_TYPE (core->traits.class_itraits) +#define FUNCTION_TYPE (core->traits.function_itraits) +#define ARRAY_TYPE (core->traits.array_itraits) +#define STRING_TYPE (core->traits.string_itraits) +#define NUMBER_TYPE (core->traits.number_itraits) +#define INT_TYPE (core->traits.int_itraits) +#define UINT_TYPE (core->traits.uint_itraits) +#define BOOLEAN_TYPE (core->traits.boolean_itraits) +#define VOID_TYPE (core->traits.void_itraits) +#define NULL_TYPE (core->traits.null_itraits) +#define NAMESPACE_TYPE (core->traits.namespace_itraits) + +const int kBufferPadding = 16; + + /** + * The main class of the AVM+ virtual machine. This is the + * main entry point to the VM for running ActionScript code. + */ + class AvmCore : public MMgc::GCRoot + { + public: + /** + * The console object. Text to be displayed to the developer + * or end-user can be directed to console, much like the cout + * object in C++ iostreams. + * + * The console object is a wrapper around the console output + * stream specified by the setConsoleStream method. + * Programs embedding AVM+ will typically implement + * the OutputStream interface and pass it in via + * setConsoleStream. + */ + PrintWriter console; + + #ifdef DEBUGGER + /** + * For debugger versions of the VM, this is a pointer to + * the Debugger object. + */ + Debugger *debugger; + Profiler *profiler; + bool allocationTracking; + static bool sampling; + // call startSampling in AvmCore ctor + static bool autoStartSampling; + + bool samplingNow; + int takeSample; + uint32 numSamples; + GrowableBuffer *samples; + byte *currentSample; + void sample(); + void sampleCheck() { if(takeSample) sample(); } + void startSampling(); + void stopSampling(); + void clearSamples(); + + intptr timerHandle; + Hashtable *fakeMethodInfos; + void initSampling(); + #endif + + void branchCheck(MethodEnv *env, bool interruptable, int go) + { + if(go < 0) + { +#ifdef DEBUGGER + sampleCheck(); +#endif + if (interruptable && interrupted) + interrupt(env); + } + } + + #ifdef AVMPLUS_MIR + // MIR intermediate buffer pool + List mirBuffers; // mir buffer pool + GrowableBuffer* requestNewMirBuffer(); // create a new buffer + GrowableBuffer* requestMirBuffer(); // get next buffer in list or a create a new one + void releaseMirBuffer(GrowableBuffer* buffer); + //GCSpinLock mirBufferLock; + + #ifdef AVMPLUS_VERBOSE + MMgc::GCHashtable* codegenMethodNames; + #endif /* AVMPLUS_VERBOSE */ + + void initMultinameLate(Multiname& name, Atom index); + + #endif /* MIR */ + +#ifdef AVMPLUS_PROFILE + StaticProfiler sprof; + DynamicProfiler dprof; +#endif + + /** + * Redirects the standard output of the VM to the specified + * output stream. Output from print() statements and + * error messages will be sent here. + * @param stream output stream to use for console output + */ + void setConsoleStream(OutputStream *stream); + + /** + * GCCallback functions + */ + virtual void presweep(); + virtual void postsweep() {} + + #ifdef AVMPLUS_VERBOSE + /** + * The verbose flag may be set to display each bytecode + * instruction as it is executed, along with a snapshot of + * the state of the stack and scope chain. + * Caution! This shoots out a ton of output! + */ + bool verbose; + #endif /* AVMPLUS_VERBOSE */ + + #ifdef AVMPLUS_INTERP + /** + * The turbo switch determines how bytecode is executed. + * When turbo is true, bytecode is translated to native code. + * When turbo is false, the gallop() interpreter loop is used. + * turbo defaults to true except on platforms where it is + * not supported, and except when debugging is in progress. + * + * Turbo is a debugger-only option. release builds always + * have it turned on. This means we can only build release + * builds on supported platforms. + */ + bool turbo; + #endif /* AVMPLUS_INTERP */ + + #ifdef AVMPLUS_MIR + + #ifdef AVMPLUS_INTERP + /** + * To speed up initialization, we don't use MIR on + * $init methods; we use interp instead. For testing + * purposes, one may want to force the MIR to be used + * for all code including $init methods. The + * forcemir switch forces all code to run through MIR + * instead of interp. + */ + bool forcemir; + #endif + + bool cseopt; + bool dceopt; + + #ifdef AVMPLUS_IA32 + bool sse2; + #endif + + /** + * If this switch is set, executing code will check the + * "interrupted" flag to see whether an interrupt needs + * to be handled. + */ + bool interrupts; + + /** + * If this is set to a nonzero value, executing code + * will check the stack pointer to make sure it + * doesn't go below this value. + */ + uint32 minstack; + + /** + * This method will be invoked when the first exception + * frame is set up. This will be a good point to set + * minstack. + */ + virtual void setStackBase() {} + + /** + * Genearate a graph for the basic blocks. Can be used by + * 'dot' utility to generate a jpg. + */ + #ifdef AVMPLUS_VERBOSE + bool bbgraph; + #endif //AVMPLUS_VERBOSE + + #endif // AVMPLUS_MIR + +#ifdef AVMPLUS_VERIFYALL + bool verifyall; +#endif + + /** Internal table of strings for boolean type ("true", "false") */ + DRC(Stringp) booleanStrings[2]; + + /** Container object for traits of built-in classes */ + BuiltinTraits traits; + + /** PoolObject for built-in classes */ + PoolObject* builtinPool; + + /** Domain for built-in classes */ + Domain* builtinDomain; + + /** The location of the currently active defaultNamespace */ + Namespace *const*dxnsAddr; + + /** + * If this flag is set, an interrupt is in progress. + * This must be type int, not bool, since it will + * be checked by generated code. + */ + int interrupted; + + /** + * The default namespace, "public", that all identifiers + * belong to + */ + DRC(Namespace*) publicNamespace; + VTable* namespaceVTable; + + #ifdef FEATURE_JNI + Java* java; /* java vm control */ + #endif + + /** + * Execute an ABC file that has been parsed into a + * PoolObject. + * @param pool PoolObject containing the ABC file to + * execute + * @param domainEnv The DomainEnv object to execute + * against, or NULL if a new DomainEnv + * should be created + * @param toplevel the Toplevel object to execute against, + * or NULL if a Toplevel should be + * created. + * @throws Exception If an error occurs, an Exception object will + * be thrown using the AVM+ exceptions mechanism. + * Calls to handleActionBlock should be bracketed + * in TRY/CATCH. + */ + Atom handleActionPool(PoolObject* pool, + DomainEnv* domainEnv, + Toplevel* &toplevel, + CodeContext *codeContext); + + ScriptEnv* prepareActionPool(PoolObject* pool, + DomainEnv* domainEnv, + Toplevel*& toplevel, + CodeContext *codeContext); + + void exportDefs(Traits* traits, ScriptEnv* scriptEnv); + + /** + * Parse the ABC block starting at offset start in code. + * @param code buffer holding the ABC block to parse + * @param start zero-indexed offset, in bytes, into the + * buffer where the code begins + * @param toplevel the Toplevel object to execute against, + * or NULL if a Toplevel should be + * created. + * @param nativeMethods the NATIVE_METHOD table + * @param nativeClasses the NATIVE_CLASS table + * @param nativeScriptss the NATIVE_SCRIPT table + * @throws Exception If an error occurs, an Exception object will + * be thrown using the AVM+ exceptions mechanism. + * Calls to handleActionBlock should be bracketed + * in TRY/CATCH. + */ + PoolObject* parseActionBlock(ScriptBuffer code, + int start, + Toplevel* toplevel, + Domain* domain, + AbstractFunction *nativeMethods[], + NativeClassInfo *nativeClasses[], + NativeScriptInfo *nativeScripts[]); + + /** + * Execute the ABC block starting at offset start in code. + * @param code buffer holding the ABC block to execute + * @param start zero-indexed offset, in bytes, into the + * buffer where the code begins + * @param toplevel the Toplevel object to execute against, + * or NULL if a Toplevel should be + * created. + * @param nativeMethods the NATIVE_METHOD table + * @param nativeClasses the NATIVE_CLASS table + * @param nativeScripts the NATIVE_SCRIPT table + * @throws Exception If an error occurs, an Exception object will + * be thrown using the AVM+ exceptions mechanism. + * Calls to handleActionBlock should be bracketed + * in TRY/CATCH. + */ + Atom handleActionBlock(ScriptBuffer code, + int start, + DomainEnv* domainEnv, + Toplevel* &toplevel, + AbstractFunction *nativeMethods[], + NativeClassInfo *nativeClasses[], + NativeScriptInfo *nativeScripts[], + CodeContext *codeContext); + + + /** + * Initializes the native table with the specified + * class/script entries. + */ + void initNativeTables(NativeClassInfo *classEntries, + NativeScriptInfo *scriptEntries, + AbstractFunction *nativeMethods[], + NativeClassInfo* nativeClasses[], + NativeScriptInfo* nativeScripts[]); + + /** Implementation of OP_equals */ + Atom eq(Atom lhs, Atom rhs); + + /** + * this is the abstract relational comparison algorithm according to ECMA 262 11.8.5 + * @param lhs + * @param rhs + * @return trueAtom, falseAtom, or undefinedAtom + */ + Atom compare(Atom lhs, Atom rhs); + + /** Implementation of OP_strictequals */ + Atom stricteq(Atom lhs, Atom rhs); + + /** + * Helper method; returns true if the atom is a tagged ScriptObject + * pointer. The actual type of the object is indicated by + * ScriptObject->vtable->traits. + */ + static bool isObject(Atom atom) + { + return (atom&7) == kObjectType && !isNull(atom); + } + + static bool isPointer(Atom atom) + { + return (atom&7) < kSpecialType || (atom&7) == kDoubleType; + } + + static bool isTraits(Atom type) + { + return type != 0 && (type&7) == 0; + } + + static bool isNamespace(Atom atom) + { + return (atom&7) == kNamespaceType && !isNull(atom); + } + + static bool isMethodBinding(Binding b) + { + return (b&7) == BIND_METHOD; + } + + static bool isAccessorBinding(Binding b) + { + return (b&7) >= BIND_GET; + } + + static bool hasSetterBinding(Binding b) + { + return (b&6) == BIND_SET; + } + + static bool hasGetterBinding(Binding b) + { + return (b&5) == BIND_GET; + } + + static int bindingToGetterId(Binding b) + { + AvmAssert(hasGetterBinding(b)); + return urshift(b,3); + } + + static int bindingToSetterId(Binding b) + { + AvmAssert(hasSetterBinding(b)); + return 1+urshift(b,3); + } + + static int bindingToMethodId(Binding b) + { + AvmAssert(isMethodBinding(b)); + return urshift(b,3); + } + + static int bindingToSlotId(Binding b) + { + AvmAssert(isSlotBinding(b)); + return urshift(b,3); + } + + /** true if b is a var or a const */ + static int isSlotBinding(Binding b) + { + AvmAssert((BIND_CONST&6)==BIND_VAR); + return (b&6)==BIND_VAR; + } + + /** true only if b is a var */ + static int isVarBinding(Binding b) + { + return (b&7)==BIND_VAR; + } + /** true only if b is a const */ + static int isConstBinding(Binding b) + { + return (b&7)==BIND_CONST; + } + + /** Helper method; returns true if atom is an Function */ + bool isFunction(Atom atom) + { + return istype(atom, traits.function_itraits); + } + + /** Helper method; returns true if atom's type is double */ + static bool isDouble(Atom atom) + { + return (atom&7) == kDoubleType; + } + + /** Helper method; returns true if atom's type is int */ + static bool isInteger(Atom atom) + { + return (atom&7) == kIntegerType; + } + + /** Helper method; returns true if atom's type is Number */ + static bool isNumber(Atom atom) + { + // accept kIntegerType(6) or kDoubleType(7) + return (atom&6) == kIntegerType; + } + + /** Helper method; returns true if atom's type is boolean */ + static bool isBoolean(Atom atom) + { + return (atom&7) == kBooleanType; + } + + /** Helper method; returns true if atom's type is null */ + static bool isNull(Atom atom) + { + return ISNULL(atom); + } + + /** Helper method; returns true if atom's type is undefined */ + static bool isUndefined(Atom atom) + { + return (atom == undefinedAtom); + } + + static bool isNullOrUndefined(Atom atom) + { + return ((unsigned)atom) <= kSpecialType; + } + +#ifdef AVMPLUS_VERBOSE + /** Disassembles an opcode and places the text in str. */ + static void formatOpcode(PrintWriter& out, const byte *pc, AbcOpcode opcode, int off, PoolObject* pool); + static void formatMultiname(PrintWriter& out, uint32 index, PoolObject* pool); +#endif + + /** + * The resources table tracks what ABC's have been + * decoded, and avoids decoding the same one multiple + * times. + */ + Hashtable *resources; + + /** + * @name interned constants + * Constants used frequently in the VM; these are typically + * identifiers that are part of the core language semantics + * like "prototype" and "constructor". These are interned + * up front and held in AvmCore for easy reference. + */ + /*@{*/ + + DRC(Stringp) kconstructor; + DRC(Stringp) kEmptyString; + DRC(Stringp) ktrue; + DRC(Stringp) kfalse; + DRC(Stringp) kundefined; + DRC(Stringp) knull; + DRC(Stringp) ktoString; + DRC(Stringp) ktoLocaleString; + DRC(Stringp) kvalueOf; + DRC(Stringp) klength; + DRC(Stringp) kobject; + DRC(Stringp) kfunction; + DRC(Stringp) kxml; + DRC(Stringp) kboolean; + DRC(Stringp) knumber; + DRC(Stringp) kstring; + DRC(Stringp) kuri; + DRC(Stringp) kprefix; + DRC(Stringp) kglobal; + DRC(Stringp) kcallee; + DRC(Stringp) kNeedsDxns; + DRC(Stringp) kAsterisk; + Atom kNaN; + + DRC(Stringp) cachedChars[128]; + /*@}*/ + + /** Constructor */ + AvmCore(MMgc::GC *gc); + + /** Destructor */ + ~AvmCore(); + + /** + * Parses builtin.abc into a PoolObject, to be executed + * later for each new Toplevel + */ + void initBuiltinPool(); + + /** + * Initializes the specified Toplevel object by running + * builtin.abc + */ + Toplevel* initTopLevel(); + + virtual size_t getToplevelSize() const; + virtual Toplevel* createToplevel(VTable *vtable); + + public: + /** + * toUInt32 is the ToUInt32 algorithm from + * ECMA-262 section 9.6, used in many of the + * native core objects + */ + uint32 toUInt32(Atom atom) const + { + return (uint32)integer(atom); + } + + /** + * toInteger is the ToInteger algorithm from + * ECMA-262 section 9.4, used in many of the + * native core objects + */ + double toInteger(Atom atom) const + { + if ((atom & 7) == kIntegerType) { + return (double) (atom>>3); + } else { + return MathUtils::toInt(number(atom)); + } + } + + /** + * Converts the passed atom to a 32-bit signed integer. + * If the atom is already an integer, it is simply + * decoded. Otherwise, it is coerced to the int type + * and returned. This is ToInt32() from E3 section 9.5 + */ + int integer(Atom atom) const; + + // convert atom to integer when we know it is already a legal signed-32 bit int value + static int integer_i(Atom a) + { + if ((a&7) == kIntegerType) + return a>>3; + else + // TODO since we know value is legal int, use faster d->i + return MathUtils::real2int(atomToDouble(a)); + } + + // convert atom to integer when we know it is already a legal unsigned-32 bit int value + static uint32 integer_u(Atom a) + { + if ((a&7) == kIntegerType) + { + return a>>3; + } + else + { + // TODO figure out real2int for unsigned + return (uint32) atomToDouble(a); + } + } + + static int integer_d(double d); + +#ifdef AVMPLUS_IA32 + static int integer_d_sse2(double d); + Atom doubleToAtom_sse2(double n); +#endif + + private: + static int doubleToInt32(double d); + + public: + static double number_d(Atom a) + { + AvmAssert(isNumber(a)); + + if ((a&7) == kIntegerType) + return a>>3; + else + return atomToDouble(a); + } + + /** + * intAtom is similar to the integer method, but returns + * an atom instead of a C++ int. + */ + Atom intAtom(Atom atom) + { + return intToAtom(integer(atom)); + } + + Atom uintAtom(Atom atom) + { + return uintToAtom(toUInt32(atom)); + } + + /** + * Converts the passed atom to a C++ bool. + * If the atom is already an E4 boolean, it is simply + * decoded. Otherwise, it is coerced to the boolean type + * and returned. + * [ed] 12/28/04 use int because bool is sometimes byte-wide. + */ + int boolean(Atom atom); + + /** + * Returns the passed atom's string representation. + * If the passed atom is not a string, it is coerced + * to type string using the ECMAScript coercion rules. + */ + Stringp string(Atom atom); + + Stringp coerce_s(Atom atom); + + /** + * Returns true if the passed atom is of string type. + */ + static bool isString(Atom atom) + { + return (atom&0x7) == kStringType && !isNull(atom); + } + + static bool isName(Atom atom) + { + return isString(atom) && atomToString(atom)->isInterned(); + } + + /** + * an interned atom is canonicalized in this way: + * boolean -> "true" or "false" + * number -> intern'ed string value + * string -> intern'ed string value + * object -> intern'ed result of toString() + * + * this way, interned atoms are suitable to be used as map keys and can + * be compared using ==. + * @param atom + * @return + */ + Stringp intern(Atom atom); + + Namespace* internNamespace(Namespace* ns); + + /** Helper function; reads a signed 24-bit integer from pc */ + static int readS24(const byte *pc) + { + #ifdef WIN32 + // unaligned short access still faster than 2 byte accesses + return ((unsigned short*)pc)[0] | ((signed char*)pc)[2]<<16; + #else + return pc[0] | pc[1]<<8 | ((signed char*)pc)[2]<<16; + #endif + } + + /** + * Returns the size of the instruction + all it's operands. For OP_lookupswitch the size will not include + * the size for the case targets. + */ + static int calculateInstructionWidth(const byte* p) + { + int a, b; + unsigned int c, d; + const byte* p2 = p; + readOperands(p2, c, a, d, b); + return p2-p; + } + + /** + * Read in some operands for the instruction located at *pc. + * Returns the size of the instruction, but will not read in all the case targets for + * an OP_lookupswitch, since there will be a variable number of them. + */ + static void readOperands(const byte* &pc, unsigned int& imm32, int& imm24, unsigned int& imm32b, int& imm8 ) + { + AbcOpcode opcode = (AbcOpcode)*pc++; + int op_count = opOperandCount[opcode]; + + imm8 = pc[0]; + if( opcode == OP_pushbyte || opcode == OP_debug ) + { + // these two operands have a byte as their first operand, which is not encoded + // with the variable length encoding scheme for bigger numbers, because it will + // never be larger than a byte. + --op_count; + pc++; + } + + if( op_count > 0 ) + { + if( opcode >= OP_ifnlt && opcode <= OP_lookupswitch ) + { + imm24 = AvmCore::readS24(pc); + pc += 3; + } + else + { + imm32 = AvmCore::readU30(pc); + } + + if( opcode == OP_debug ) + { + --op_count; //OP_debug has a third operand of a byte + pc++; + } + if( op_count > 1 ) + { + imm32b = AvmCore::readU30(pc); + } + } + } + /** + * Helper function; reads an unsigned 32-bit integer from pc + * See AbcParser::readS32 for more explanation of the variable length + * encoding scheme. + * + * 2nd argument is set to the actual size, in bytes, of the number read in, + * and third argument is the version of the ABC + */ + static uint32 readU30(const byte *&p) + { + unsigned int result = p[0]; + if (!(result & 0x00000080)) + { + p++; + return result; + } + result = (result & 0x0000007f) | p[1]<<7; + if (!(result & 0x00004000)) + { + p += 2; + return result; + } + result = (result & 0x00003fff) | p[2]<<14; + if (!(result & 0x00200000)) + { + p += 3; + return result; + } + result = (result & 0x001fffff) | p[3]<<21; + if (!(result & 0x10000000)) + { + p += 4; + return result; + } + result = (result & 0x0fffffff) | p[4]<<28; + p += 5; + return result; + } + + /** Helper function; reads an unsigned 16-bit integer from pc */ + static int readU16(const byte *pc) + { + #ifdef WIN32 + // unaligned short access still faster than 2 byte accesses + return *((unsigned short*)pc); + #else + return pc[0] | pc[1]<<8; + #endif + } + + /** + * this is the implementation of the actionscript "is" operator. similar to java's + * instanceof. returns true/false according to AS rules. in particular, it will return + * false if value==null. + */ + bool istype(Atom atom, Traits* itraits); + + /** + * this is the implementation of the actionscript "is" operator. similar to java's + * instanceof. returns true/false according to AS rules. in particular, it will return + * false if value==null. + */ + Atom istypeAtom(Atom atom, Traits* itraits) { + return istype(atom, itraits) ? trueAtom : falseAtom; + } + + /** + * implementation of OP_increg, decreg, increment, decrement which correspond to + * ++ and -- operators in AS. + */ + void increment_d(Atom *atom, int delta); + + /** + * implementation of OP_increg, decreg, increment, decrement which correspond to + * ++ and -- operators in AS. + */ + void increment_i(Atom *atom, int delta); + + /** + * ES3's internal ToPrimitive() function + */ + Atom primitive(Atom atom); + + /** OP_toboolean; ES3 ToBoolean() */ + Atom booleanAtom(Atom atom); + + /** OP_tonumber; ES3 ToNumber */ + Atom numberAtom(Atom atom); + + /** + * ES3's internal ToNumber() function for internal use + */ + double number(Atom atom) const; + +#ifdef AVMPLUS_PROFILE + /** + * dump profiler stats + */ + void dump(); +#endif + + /** + * produce an atom from a string. used only for string constants. + * @param s + * @return + */ + Atom constant(const char *s) + { + return constantString(s)->atom(); + } + + Stringp constantString(const char *s) + { + return internString(newString(s)); + } + + /** + * The interrupt method is called from executing code + * when the interrupted flag is set. + */ + virtual void interrupt(MethodEnv *env) = 0; + + /** + * This is called when the stack overflows + * (when the machine stack pointer is about to go below + * minstack) + */ + virtual void stackOverflow(MethodEnv *env) = 0; + + void _stackOverflow(MethodEnv *env) { stackOverflow(env); } + + /** + * Throws an exception. Constructs an Exception object + * and calls throwException. + */ + void throwAtom(Atom atom); + + /** + * The AVM+ equivalent of the C++ "throw" statement. + * Throws an exception, transferring control to the + * nearest CATCH block. + */ + void throwException(Exception *exception); + + /** + * throwErrorV is a convenience function for throwing + * an exception with a formatted error message, + */ + void throwErrorV(ClassClosure *type, int errorID, Stringp arg1=0, Stringp arg2=0, Stringp arg3=0); + + /** + * formatErrorMessageV is a convenience function for + * assembling an error message with varags. + */ + String* formatErrorMessageV( int errorID, Stringp arg1=0, Stringp arg2=0, Stringp arg3=0); + + /** + * Convenience methods for converting various objects into value + * strings used for error message output. + */ + String* toErrorString(int d); + String* toErrorString(AbstractFunction* m); + String* toErrorString(Multiname* n); + String* toErrorString(Namespace* ns); + String* toErrorString(Traits* t); + String* toErrorString(const char* s); + String* toErrorString(const wchar* s); + String* atomToErrorString(Atom a); + + /** + * getErrorMessage returns the format string for an + * errorID. Override to provide format strings for + * additional implementation-dependent error strings. + */ + virtual String* getErrorMessage(int errorID); + + #ifdef DEBUGGER + /** + * willExceptionBeCaught walks all the way up the + * ActionScript stack to see if there is any "catch" + * statement which is going to catch the specified + * exception. + */ + bool willExceptionBeCaught(Exception* exception); + + /** + * findErrorMessage searches an error messages table. + * Only available in debugger builds. + */ + String* findErrorMessage(int errorID, + int* mapTable, + const char** errorTable, + int numErrors); + + /** + * Determines the language id of the given platform + */ + virtual int determineLanguage(); + int langID; + + /** The call stack of currently executing code. */ + CallStackNode *callStack; + + /** + * Creates a StackTrace from the current executing call stack + */ + StackTrace* newStackTrace(); + + StackTrace *getStackTrace(); + StackTrace *getStackTrace(void/*StackTrace::Element*/ *e, int depth); + void rehashTraces(int newSize); + int findTrace(void/*StackTrace::Element*/ *e, int depth); + StackTrace **stackTraces; + uint32 numTraces; + + /* used to charge primitive allocations (String and Namespace) */ + static void chargeAllocation(Atom a); + + #ifdef _DEBUG + void dumpStackTrace(); + #endif +#endif /* DEBUGGER */ + + CodeContextAtom codeContextAtom; + + CodeContext* codeContext() const; + + /** env of the highest catch handler on the call stack, or NULL */ + ExceptionFrame *exceptionFrame; + + /** + * Searches the exception handler table of info for + * a try/catch block that contains the instruction at pc + * and matches the type of exception. + * @param info the method to search the exception handler + * table of + * @param pc the program counter at the point where + * the exception occurred; either a pointer into + * bytecode or into native compiled code + * @param exception the exception object that was thrown; + * used to match the type. + * @return ExceptionHandler object for the exception + * handler that matches, or re-throws the passed-in + * exception if no handler is found. + */ + ExceptionHandler* findExceptionHandler(MethodInfo *info, + int pc, + Exception *exception); + + ExceptionHandler* beginCatch(ExceptionFrame *ef, + MethodInfo *info, int pc, Exception *exception); + + /** + * Just like findExceptionHandler(), except that this function + * returns NULL if it can't find an exception handler, whereas + * findExceptionHandler() re-throws the passed-in exception if + * it can't find a handler. + */ + ExceptionHandler* findExceptionHandlerNoRethrow(MethodInfo *info, + int pc, + Exception *exception); + + /** + * Returns true if the passed atom is an XML object, + * as defined in the E4X Specification. + */ + bool isXML (Atom atm); + + /* Returns tru if the atom is a Date object */ + bool isDate(Atom atm); + + // From http://www.w3.org/TR/2004/REC-xml-20040204/#NT-Name + bool isLetter (wchar c); + bool isDigit (wchar c); + bool isCombiningChar (wchar c); + bool isExtender (wchar c); + + Stringp ToXMLString (Atom a); + Stringp EscapeElementValue (const Stringp s, bool removeLeadingTrailingWhitespace); + Stringp EscapeAttributeValue (Atom v); + + /** + * Converts an Atom to a E4XNode if its traits match. + * Otherwise, null is returned. (An exception is NOT thrown) + */ + E4XNode *atomToXML (Atom atm); + + /** + * Converts an Atom to a XMLObject if its traits match. + * Otherwise, null is returned. (An exception is NOT thrown) + */ + XMLObject *atomToXMLObject (Atom atm); + + /** + * Returns true if the passed atom is a XMLList object, + * as defined in the E4X Specification. + */ + bool isXMLList (Atom atm); + + /** + * Converts an Atom to a XMLListObject if its traits match. + * Otherwise, null is returned. (An exception is NOT thrown) + */ + XMLListObject *atomToXMLList (Atom atm); + + /** + * Returns true if the passed atom is a QName object, + * as defined in the E4X Specification. + */ + bool isQName (Atom atm); + + /** + * Returns true if the passed atom is a Dictionary object, + * as defined in the E4X Specification. + */ + bool isDictionary (Atom atm); + + bool isDictionaryLookup(Atom key, Atom obj) + { + return isObject(key) && isDictionary(obj); + } + + /** + * Returns true if the passed atom is a valid XML name, + * as defined in the E4X Specification. + */ + bool isXMLName(Atom arg); + + /** + * Converts an Atom to a QNameObject if its traits match. + * Otherwise, null is returned. (An exception is NOT thrown) + */ + QNameObject *atomToQName (Atom atm); + + /** Implementation of OP_typeof */ + Stringp _typeof (Atom arg); + + /** The XML entities table, used by E4X */ + Hashtable *xmlEntities; + + private: + DECLARE_NATIVE_CLASSES() + DECLARE_NATIVE_SCRIPTS() + + void registerNatives(NativeTableEntry *nativeMap, AbstractFunction *nativeMethods[]); + + // + // this used to be Heap + // + + /** size of interned String table */ + int stringCount; + + /** number of deleted entries in our String table */ + int deletedCount; + #define AVMPLUS_STRING_DELETED ((Stringp)(1)) + + /** size of interned Namespace table */ + int nsCount; + + int numStrings; + int numNamespaces; + + public: + + static Namespace *atomToNamespace(Atom atom) + { + AvmAssert((atom&7)==kNamespaceType); + return (Namespace*)(atom&~7); + } + + static double atomToDouble(Atom atom) + { + AvmAssert((atom&7)==kDoubleType); + + double* obj = (double*)(atom&~7); + return *obj; + } + + /** + * Convert an Atom of kStringType to a Stringp + * @param atom atom to convert. Note that the Atom + * must be of kStringType + */ + static Stringp atomToString(Atom atom) + { + AvmAssert((atom&7)==kStringType); + return (Stringp)(atom&~7); + } + + // Avoid adding validation checks here and returning NULL. If this + // is returning a bad value, the higher level function should be fixed + // or AbcParser/Verifier should be enhanced to catch this case. + static ScriptObject* atomToScriptObject(const Atom atom) + { + AvmAssert((atom&7)==kObjectType); + return (ScriptObject*)(atom&~7); + } + + // helper function, allows generic objects to work with Hashtable + // and AtomArray, uses double type which is the only non-RC + // GCObject type + static Atom gcObjectToAtom(const void* obj); + static const void* atomToGCObject(Atom a) { return (const void*)(a&~7); } + static bool isGCObject(Atom a) { return (a&7)==kDoubleType; } + + private: + /** search the string intern table */ + int findString(const wchar *s, int len); + + /** search the namespace intern table */ + int findNamespace(const Namespace *ns); + +#ifdef DEBUGGER +#if defined(MMGC_IA32) + static inline uint32 FindOneBit(uint32 value) + { +#ifndef __GNUC__ + _asm + { + bsr eax,[value]; + } +#else + // DBC - This gets rid of a compiler warning and matchs PPC results where value = 0 + register int result = ~0; + + if (value) + { + asm ( + "bsr %1, %0" + : "=r" (result) + : "m"(value) + ); + } + return result; +#endif + } + + #elif defined(MMGC_PPC) + + static inline int FindOneBit(uint32 value) + { + register int index; + #ifdef DARWIN + asm ("cntlzw %0,%1" : "=r" (index) : "r" (value)); + #else + register uint32 in = value; + asm { cntlzw index, in; } + #endif + return 31-index; + } + + #else // generic platform + + static int FindOneBit(uint32 value) + { + for (int i=0; i < 32; i++) + if (value & (1<> 3; + return true; + } + else + { + AvmAssert (AvmCore::isString(a)); + return AvmCore::getIndexFromString (atomToString (a), result); + } + } + + static bool getIndexFromString(Stringp s, uint32 *result); + + ScriptBufferImpl* newScriptBuffer(size_t size); + VTable* newVTable(Traits* traits, VTable* base, ScopeChain* scope, AbcEnv* abcEnv, Toplevel* toplevel); + + RegExpObject* newRegExp(RegExpClass* regExpClass, + Stringp pattern, + Stringp options); + + ScriptObject* newObject(VTable* ivtable, ScriptObject *delegate); + + // like newObject but runs init if there is one + ScriptObject* newActivation(VTable *vtable, ScriptObject *delegate); + + /** + * traits with base traits (inheritance) + */ + Traits* newTraits(Traits *base, + int nameCount, + int interfaceCount, + size_t sizeofInstance); + + FrameState* newFrameState(int frameSize, int scopeBase, int stackBase); + Namespace* newNamespace(Atom prefix, Atom uri, Namespace::NamespaceType type = Namespace::NS_Public); + Namespace* newNamespace(Atom uri, Namespace::NamespaceType type = Namespace::NS_Public); + Namespace* newNamespace(Stringp uri, Namespace::NamespaceType type = Namespace::NS_Public); + Namespace* newPublicNamespace(Stringp uri) { return newNamespace(uri); } + NamespaceSet* newNamespaceSet(int nsCount); + + // String creation + Stringp newString(const char *str) const; + Stringp newString(const wchar *str) const; + Stringp newString(const char *str, int len) const; + + Stringp uintToString(uint32 i); + Stringp intToString(int i); + Stringp doubleToString(double d); + Stringp concatStrings(Stringp s1, Stringp s2) const; + + Atom doubleToAtom(double n); + Atom uintToAtom(uint32 n); + Atom intToAtom(int n); + + Atom allocDouble(double n) + { + double *ptr = (double*)GetGC()->Alloc(sizeof(double), 0); + *ptr = n; + return kDoubleType | (uint32)ptr; + } + + void rehashStrings(int newlen); + void rehashNamespaces(int newlen); + + // static version for smart pointers + static void atomWriteBarrier(MMgc::GC *gc, const void *container, Atom *address, Atom atomNew); +#ifdef MMGC_DRC + static void decrementAtomRegion(Atom *ar, int length); +#endif + +#ifdef AVMPLUS_VERBOSE + public: + Stringp format(Atom atom); + Stringp formatAtomPtr(Atom atom); +#endif + +#ifdef DEBUGGER + public: + int sizeInternedTables(); +#endif + + // NOT MARKED. These fields are at the end of core and are explicitly + // excluded from being traced in AvmCore::trace + private: + // hash set containing intern'ed strings + DRC(Stringp) * strings; + // hash set containing namespaces + DRC(Namespacep) * namespaces; + + // avoid multiple inheritance issues + class GCInterface : MMgc::GCCallback + { + public: + GCInterface(MMgc::GC *gc) : MMgc::GCCallback(gc) {} + void SetCore(AvmCore*core) { this->core = core; } + void presweep() { core->presweep(); } + void postsweep() { core->postsweep(); } + void log(const char *str) { core->console << str; } + private: + AvmCore *core; + }; + GCInterface gcInterface; + }; +} + +#endif /* __avmplus_AvmCore__ */ diff --git a/mozilla/js/tamarin/core/AvmDebug.h b/mozilla/js/tamarin/core/AvmDebug.h new file mode 100644 index 00000000000..ded6f623462 --- /dev/null +++ b/mozilla/js/tamarin/core/AvmDebug.h @@ -0,0 +1,108 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 1993-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#ifndef __AvmDebug__ +#define __AvmDebug__ + +#include "avmplusTypes.h" + +#ifdef WIN32 +#include +#endif + +#ifdef _MAC +#if !TARGET_RT_MAC_MACHO +typedef const unsigned char* ConstStr255Param; +extern "C" +{ +#ifdef powerc + extern pascal void DebugStr(ConstStr255Param aStr); +#else + // extern pascal void DebugStr(ConstStr255Param aStr) = 0xABFF; + extern pascal void SysBreakStr(ConstStr255Param aStr) = {0x303C, 0xFE15, 0xA9C9}; +#endif +} +#endif +#endif + +namespace avmplus +{ + void AvmDebugMsg(bool debuggerBreak, const char* format, ...); + void AvmDebugMsg(const char* msg, bool debuggerBreak); + void AvmDebugMsg(const wchar* msg, bool debuggerBreak); + + #ifdef _DEBUG + inline void _AvmAssertMsg(int32 assertion, const char* msg) + { + if (assertion == 0) + AvmDebugMsg(msg, true); + } + + #define AvmAssertMsg(x,y) do { _AvmAssertMsg((x), (y)); } while (0) /* no semi */ + + #define AvmAssert(x) _AvmAssert((x), __LINE__,__FILE__) + #define _AvmAssert(x, line_, file_) __AvmAssert((x), line_, file_) + #define __AvmAssert(x, line_, file_) do { AvmAssertMsg((x), "Assertion failed: \"" #x "\" (" #file_ ":" #line_ ")"); } while (0) /* no semi */ + + #else + #define AvmAssertMsg(x,y) do { } while (0) /* no semi */ + #define AvmAssert(x) do { } while (0) /* no semi */ + #endif + + /*************************************************************************/ + /******************************* Debugging *******************************/ + /*************************************************************************/ + + /* This mess serves to define the DebugMsg function on each platform. + * DebugMsg is only defined when the Debug flag is turned on; it halts + * program execution and drops into the debugger with the given message. + * We define it as in inline so that when you fall into the debugger, + * you're in the function that issued the call and not in a "DebugMsg" + * subroutine. + */ + #if defined(_MAC) && !defined(DARWIN) + // WARNING: this function is NOT THREAD SAFE + /*plugin_export*/ ConstStr255Param MakePascalMsg(const char* theString); + + #if SOFT_ASSERTS + inline void DebugMsg_(const char* msg) { } + #else + #ifdef powerc + inline void DebugMsg_(const char* msg) { DebugStr(MakePascalMsg(msg)); } + #else + inline void DebugMsg_(const char* msg) { SysBreakStr(MakePascalMsg(msg)); } + #endif + #endif // SOFT_ASSERTS + #endif +} + +#endif /* __AvmDebug__ */ diff --git a/mozilla/js/tamarin/core/AvmDebugWin.cpp b/mozilla/js/tamarin/core/AvmDebugWin.cpp new file mode 100644 index 00000000000..8bf511551b4 --- /dev/null +++ b/mozilla/js/tamarin/core/AvmDebugWin.cpp @@ -0,0 +1,98 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmplus.h" + +#include +#include +#include + +#ifdef _DEBUG +#include +#include +#include +#endif + +/*************************************************************************/ +/******************************* Debugging *******************************/ +/*************************************************************************/ + +#ifndef MB_SERVICE_NOTIFICATION +#define MB_SERVICE_NOTIFICATION 0x00200000L +#endif + +namespace avmplus +{ + const static bool logToStdErr=true; + + void AvmDebugMsg(bool debuggerBreak, const char *format, ...) + { + // [ggrossman 09.24.04] + // Changed this to _DEBUG only because we don't link to + // CRT in Release builds, so vsprintf is unavailable!! +#ifdef _DEBUG + va_list argptr; + va_start(argptr, format); + int bufferSize = _vscprintf(format, argptr); + + char *buffer = (char*)alloca(bufferSize+1); + if (buffer) { + StringCbVPrintf(buffer, bufferSize, format, argptr); + AvmDebugMsg(buffer, debuggerBreak); + } +#else + (void)format; + (void)debuggerBreak; +#endif + } + + void AvmDebugMsg(const char* msg, bool debugBreak) + { + OutputDebugString(msg); + if(logToStdErr) { + fprintf( stderr, "%s", msg ); + } + + if (debugBreak) { + DebugBreak(); + } + } + + void AvmDebugMsg(const wchar* msg, bool debugBreak) + { + OutputDebugStringW((LPCWSTR)msg); + + if (debugBreak) { + DebugBreak(); + } + } +} diff --git a/mozilla/js/tamarin/core/AvmError.h b/mozilla/js/tamarin/core/AvmError.h new file mode 100644 index 00000000000..87295c5407b --- /dev/null +++ b/mozilla/js/tamarin/core/AvmError.h @@ -0,0 +1,43 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_AvmError__ +#define __avmplus_AvmError__ + +#ifdef DEBUGGER +struct AvmError +{ + int id; + const char *message; +}; +#endif + +#endif /* __avmplus_AvmError__ */ diff --git a/mozilla/js/tamarin/core/AvmPlusScriptableObject.cpp b/mozilla/js/tamarin/core/AvmPlusScriptableObject.cpp new file mode 100644 index 00000000000..4181f71b01e --- /dev/null +++ b/mozilla/js/tamarin/core/AvmPlusScriptableObject.cpp @@ -0,0 +1,73 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 1993-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmplus.h" + +using namespace MMgc; + +namespace avmplus +{ +#ifdef DEBUGGER + AvmPlusScriptableObject::AvmPlusScriptableObject() + { + + AvmCore *core = this->core(); + if(core->allocationTracking && core->callStack) + { + StackTrace *st = core->getStackTrace(); + // turn off allocation tracking while we're creating these strings + core->allocationTracking = false; + WB(GC::GetGC(this), this, &allocationStackTrace, st); + core->allocationTracking = true; + creationTimestamp = GC::GetPerformanceCounter(); + } + } + + AvmPlusScriptableObject::~AvmPlusScriptableObject() + { + Atom me = Atom(this) | (allocationStackTrace&7); + if(creator) + creator->removeInstance(me); + creator = NULL; + WB(GC::GetGC(this), this, &allocationStackTrace, NULL); + creationTimestamp = 0; + } + + Stringp AvmPlusScriptableObject::getAllocationTrace() const + { + StackTrace *st = (StackTrace*) (allocationStackTrace&~7); + if(st) + return st->format(core()); + return NULL; + } +#endif +} diff --git a/mozilla/js/tamarin/core/AvmPlusScriptableObject.h b/mozilla/js/tamarin/core/AvmPlusScriptableObject.h new file mode 100644 index 00000000000..5b1c3b9fd11 --- /dev/null +++ b/mozilla/js/tamarin/core/AvmPlusScriptableObject.h @@ -0,0 +1,70 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_AvmPlusScriptableObject__ +#define __avmplus_AvmPlusScriptableObject__ + + +namespace avmplus +{ + class AvmPlusScriptableObject : public MMgc::RCFinalizedObject + { + public: +#ifdef DEBUGGER + AvmPlusScriptableObject(); + ~AvmPlusScriptableObject(); + virtual uint32 size() const = 0; +#endif + + // used by WeakValueHashtable to correctly atom'ize a pointer to one of these + virtual Atom toAtom() const = 0; + +#ifdef DEBUGGER + + AvmCore *core() const + { + MMgc::GC *gc = MMgc::GC::GetGC(this); + AvmCore *core = (AvmCore*)gc->GetGCContextVariable(MMgc::GC::GCV_AVMCORE); + return core; + } + Stringp getAllocationTrace() const; + void setType(unsigned int type) { allocationStackTrace |= type; } + void setCreator(ScriptObject *c) { creator = c; } + uint64 getAllocationTime() const { return creationTimestamp; } + private: + DRCWB(ScriptObject*) creator; + unsigned int allocationStackTrace; + uint64 creationTimestamp; +#endif + }; +} + +#endif //__avmplus_AvmPlusScriptableObject__ diff --git a/mozilla/js/tamarin/core/BigInteger.cpp b/mozilla/js/tamarin/core/BigInteger.cpp new file mode 100644 index 00000000000..3a361d6bcf1 --- /dev/null +++ b/mozilla/js/tamarin/core/BigInteger.cpp @@ -0,0 +1,636 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 1993-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + + +#include + +#include "avmplus.h" +#include "BigInteger.h" + +#define X86_MATH +namespace avmplus +{ + + +void BigInteger::setFromDouble(double value) +{ + int e; + uint64 mantissa = MathUtils::frexp(value,&e); // value = mantissa*2^e, mantissa and e are integers. + numWords = (2 + ((e > 0 ? e : -e) /32)); + + AvmAssert(numWords <= kMaxBigIntegerBufferSize); + wordBuffer[1] = (uint32)(mantissa >> 32); + wordBuffer[0] = (uint32)(mantissa & 0xffffffff); + numWords = (wordBuffer[1] == 0 ? 1 : 2); + + if(e < 0) + rshiftBy(-e); + else + lshiftBy(e); +} + +void BigInteger::setFromBigInteger(const BigInteger* from, int32 offset, int32 amount) +{ + numWords = amount; + AvmAssert(numWords <= kMaxBigIntegerBufferSize); + memcpy( (byte*)wordBuffer, + (byte*)&(from->wordBuffer[offset]), + amount*sizeof(uint32)); +} + +double BigInteger::doubleValueOf() const +{ + // todo: there's got to be a quicker/smaller code alg for this. + if (numWords == 1) + return (double)wordBuffer[0]; + + // determine how many of bits are used by the top word + int bitsInTopWord=1; + for(uint32 topWord = wordBuffer[numWords-1]; topWord > 1; topWord >>= 1) + bitsInTopWord++; + + // start result with top word. We will accumulate the most significant 53 bits of data into it. + int nextWord = numWords-1; + + // used for rounding: + bool bit53 = false; + bool bit54 = false; + bool rest = false; + + const uint64 ONEL = 1UL; + uint64 resultMantissa = 0; + uint64 w = 0; + int pos = 53; + int bits = bitsInTopWord; + int wshift = 0; + while(pos > 0) + { + // extract word and | it in + w = wordBuffer[nextWord--]; + resultMantissa |= (w >> wshift); + pos -= bits; + + if (pos > 0) + { + if (nextWord > -1) + { + // ready for next word + bits = (pos > 31) ? 32 : pos; + wshift = (pos > 31) ? 0 : 32-bits; + resultMantissa <<= bits; + } + else + { + break; // not enough data for full 53 bits + } + } + } + + // rounding + if (pos > 0) + { + ; // insufficient data for rounding + } + else + { + bit53 = ( resultMantissa & 0x1 ) ? true : false; + if (bits == 32) + { + // last extract was exactly 32 bits, so rest of bits are in next word if there is one + if (nextWord > -1) + { + w = wordBuffer[nextWord--]; + bit54 = ( w & (ONEL<<31) ) ? true : false; + rest = ( w & ((ONEL<<31)-1) ) ? true : false; + } + } + else + { + // we know bit54 is in this word but the rest of the data may be in the next + AvmAssert(bits < 32 && wshift > 0); + bit54 = ( w & (ONEL<<(wshift-1)) ) ? true : false; + + if (wshift > 1) + rest = ( w & ((ONEL<<(wshift-1))-1) ) ? true : false; + + // pick up any residual bits + if (nextWord > -1) + rest = rest || (wordBuffer[nextWord--] != 0); + } + } + + /** + * ieee rounding is to nearest even value (bit54 is 2^-1) + * x...1 1.. -> round up since odd (but53 set) + * x...0 1...1.. -> round up since value > 1/2 + */ + if (bit54 && (bit53 || rest)) + resultMantissa += 1; + + double result=0; + int32 expBase2 = lg2() + 1 - 53; // if negative, then we've already captured all the data in the mantissaResult and we can ignore. + result = (double)resultMantissa; + if (expBase2 > 0) + { + if (expBase2 < 64) + { + uint64 uint64_1 = 1; + result *= (double)(uint64_1 << expBase2); + } + else + { + result *= MathUtils::pow(2,expBase2); + } + } + + return result; +} + +// Compare this vs other, return -1 if this < other, 0 if this == other, or 1 if this > other. +// (todo: optimization for D2A would be to check if comparison was larger than an argument value +// currently, we add the argument to this and compare the result with other). +int32 BigInteger::compare(const BigInteger *other) const +{ + // if a is bigger than other, subtract has to be positive (assuming unsigned value) + int result = 0; + if (numWords > other->numWords) + result = 1; + else if (numWords < other->numWords) + result = -1; + else + { + // otherwise, they are they same number of uint32 words. need to check numWords by numWords + for(int x = numWords-1; x > -1 ; x--) + { + if (wordBuffer[x] != other->wordBuffer[x]) + { + result = (wordBuffer[x] < other->wordBuffer[x]) ? -1 : 1; + break; + } + } + } + return result; +} + +// Multiply by an integer factor and add an integer increment. The addition is essentially free, +// use this with a zero second argument for basic multiplication. +void BigInteger::multAndIncrementBy(int32 factor, int32 addition) +{ + uint64 opResult; + + // perform mult op, moving carry forward. + uint64 carry = addition; // init cary with first addition + int x; + for(x=0; x < numWords; x++) + { + opResult = (uint64)wordBuffer[x] * (uint64)factor + carry; + carry = opResult >> 32; + wordBuffer[x] = (uint32)(opResult & 0xffffffff); + } + + // if carry goes over the existing top, may need to expand wordBuffer + if (carry) + { + setNumWords(numWords+1); + wordBuffer[x] = (uint32)carry; + } + +} + +// Multiply by another BigInteger. If optional arg result is not null, reuse it for +// result, else allocate a new result. +// (note, despite the name "smallerNum", argument does not need to be smaller than this). +BigInteger* BigInteger::mult(const BigInteger* smallerNum, BigInteger* result) const +{ + // Need to know which is the bigger number in terms of number of words. + const BigInteger *biggerNum = this; + if (biggerNum->numWords < smallerNum->numWords) + { + const BigInteger *temp = biggerNum; + biggerNum = smallerNum; + smallerNum = temp; + } + + // Make sure result is big enough, initialize with zeros + int maxNewNumWords = biggerNum->numWords + smallerNum->numWords; + result->setNumWords(maxNewNumWords); // we'll trim the excess at the end. + + // wipe entire buffer (initToZero flag in setNumWords only sets new elements to zero) + for(int x = 0; x < maxNewNumWords; x++) + result->wordBuffer[x] = 0; + + // do the math like gradeschool. To optimize, use an FFT (http://numbers.computation.free.fr/Constants/Algorithms/fft.html) + for(int x = 0; x < smallerNum->numWords; x++) + { + uint64 factor = (uint64) smallerNum->wordBuffer[x]; + if (factor) // if 0, nothing to do. + { + uint32* pResult = result->wordBuffer+x; // each pass we rewrite elements of result offset by the pass iteration + uint64 product; + uint64 carry = 0; + + for(int y = 0; y < biggerNum->numWords; y++) + { + product = (biggerNum->wordBuffer[y] * factor) + *pResult + carry; + carry = product >> 32; + *pResult++ = (uint32)(product & 0xffffffff); + } + *pResult = (uint32)carry; + } + } + + // remove leading zeros + result->trimLeadingZeros(); + + return result; +} + +// Divide this by divisor, put the remainder (i.e. this % divisor) into residual. If optional third argument result +// is not null, use it to store the result of the div, else allocate a new BigInteger for the result. +// Note: this has been hard to get right. If bugs do show up, use divideByReciprocalMethod instead +// Note2: this is optimized for the types of numerator/denominators generated by D2A. It will not work when +// the result would be a value bigger than 9. For general purpose BigInteger division, use divideByReciprocalMethod. +BigInteger* BigInteger::quickDivMod(const BigInteger* divisor, BigInteger* residual, BigInteger* result) +{ + // handle easy cases where divisor is >= this + int compareTo = this->compare(divisor); + if (compareTo == -1) + { + residual->copyFrom(this); + result->setValue(0); + return result; + } + else if (compareTo == 0) + { + residual->setValue(0); + result->setValue(1); + return result; + } + + int dWords = divisor->numWords; + /* this section only necessary for true division instead of special case division needed by D2A. We are + assuming the result is a single digit value < 10 and > -1 + int next = this->numWords - dWords; + residual->copyFrom(this, next, dWords); // residual holds a divisor->numWords sized chunk of this. + */ + residual->copyFrom(this,0,numWords); + BigInteger decrement; + decrement.setFromInteger(0); + result->setNumWords(divisor->numWords, true); + uint64 factor; + + //do // need to loop over dword chunks of residual to make this handle division of any arbitrary bigIntegers + { + // guess largest factor that * divisor will fit into residual + factor = (uint64)(residual->wordBuffer[residual->numWords-1]) / divisor->wordBuffer[dWords-1]; + if ( ((factor <= 0) || (factor > 10)) // over estimate of 9 could be 10 + && residual->numWords > 1 && dWords > 1) + { + uint64 bigR = ( ((uint64)residual->wordBuffer[residual->numWords-1]) << 32) + + (residual->wordBuffer[residual->numWords-2]); + factor = bigR / divisor->wordBuffer[dWords-1]; + if (factor > 9) + { // Note: This only works because of the relative size of the two operands + // which the D2A class produces. todo: try generating a numerator out of the + // the top 32 significant bits of residual (may have to get bits from two seperate words) + // and a denominator out of the top 24 significant bits of divisor and use them for + // the factor guess. Same principal as above applied to 8 bit units. + factor = 9; + /* + BigInteger::free(decrement); + return divideByReciprocalMethod(divisor, residual, result); + */ + } + } + if (factor) + { + decrement.copyFrom(divisor); + decrement.multAndIncrementBy( (uint32)factor,0); + // check for overestimate + // fix bug 121952: must check for larger overestimate, which + // can occur despite the checks above in some rare cases. + // To see this case, use: + // this=4398046146304000200000000 + // divisor=439804651110400000000000 + while (decrement.compare(residual) == 1 && factor > 0) + { + decrement.decrementBy(divisor); + factor--; + } + + // reduce dividend (aka residual) by factor*divisor, leave remainder in residual + residual->decrementBy(&decrement); + } + + // check for factor 0 underestimate + int comparedTo = residual->compare(divisor); + if (comparedTo == 1) // correct guess if its an off by one estimate + { + residual->decrementBy(divisor); + factor++; + } + + result->wordBuffer[0] = (uint32)factor; + + /* The above works for the division requirements of D2A, where divisor is always around 10 larger + than the dividend and the result is always a digit 1-9. + To make this routine work for general division, the following would need to be fleshed out /debugged. + residual->trimLeadingZeros(); + + // While we have more words to divide by and the residual has less words than the + // divisor, + if (--next >= 0) + { + do + { + result->lshiftBy(32); // shift current result over by a word + residual->lshiftBy(32);// shift remainder over by a word + residual->wordBuffer[0] = this->wordBuffer[next]; // drop next word of "this" into bottom word of remainder + } + while(residual->numWords < dWords); + } + + } while(next >= 0); + */ + } + + // trim zeros off top of residual + result->trimLeadingZeros(); + return result; +} + +/* Was hoping dividing via a Newton's approximation of the reciprocal would be faster, but + its not (makes D2A about twice as slow!). Its not the 32bit divide above that's slow, + its how many times you have to iterate over entire BigIntegers. Below uses a shift, + and three multiplies: +*/ +BigInteger* BigInteger::divideByReciprocalMethod(const BigInteger* divisor, BigInteger* residual, BigInteger* result) +{ + // handle easy cases where divisor is >= this + int compareTo = this->compare(divisor); + if (compareTo == -1) + { + residual->copyFrom(this); + result->setValue(0); + return result; + } + else if (compareTo == 0) + { + residual->setValue(0); + result->setValue(1); + return result; + } + + uint32 d2Prec = divisor->lg2(); + uint32 e = 1 + d2Prec; + uint32 ag = 1; + uint32 ar = 31 + this->lg2() - d2Prec; + BigInteger u; + u.setFromInteger(1); + + BigInteger ush; + ush.setFromInteger(1); + + BigInteger usq; + usq.setFromInteger(0); + + while (1) + { + u.lshift(e + 1,&ush); + divisor->mult(&u,&usq); // usq = divisor*u^2 + usq.multBy(&u); + ush.subtract(&usq, &u); // u = ush - usq; + + int32 ush2 = u.lg2(); // ilg2(u); + e *= 2; + ag *= 2; + int32 usq2 = 4 + ag; + ush2 -= usq2; // BigInteger* diff = ush->subtract(usq); // ush -= usq; ush > 0 + if (ush2 > 0) // (ush->compare(usq) == 1) + { + u.rshiftBy(ush2); // u >>= ush; + e -= ush2; + } + if (ag > ar) + break; + } + result = this->mult(&u,result); // mult by reciprocal (scaled by e) + result->rshiftBy(e); // remove scaling + + BigInteger temp; + temp.setFromInteger(0); + divisor->mult(result, &temp); // compute residual as this - divisor*result + this->subtract(&temp,residual); // todo: should be a more optimal way of doing this + + // ... doesn't work, e is the wrong scale for this (too large).... + // residual = this->lshift(e,residual); // residual = (this*2^e - result) / 2^e + // residual->decrementBy(result); + // residual->rshiftBy(e); // remove scaling + return(result); +} + +// q = this->divBy(divisor) is equilvalent to: q = this->quickDivMod(divisor,remainderResult); this = remainderResult; +BigInteger* BigInteger::divBy(const BigInteger* divisor, BigInteger* divResult) +{ + BigInteger tempInt; + tempInt.setFromInteger(0); + + quickDivMod(divisor, &tempInt, divResult); // this has been hard to get right. If bugs do show up, + //divResult = divideByReciprocalMethod(divisor,tempInt,divResult); // try this version instead Its slower, but less likely to be buggy + this->copyFrom(&tempInt); + return divResult; +} + +uint32 BigInteger::lg2() const +{ + uint32 powersOf2 = (numWords-1)*32; + for(uint32 topWord = wordBuffer[numWords-1]; topWord > 1; topWord >>= 1) + powersOf2++; + return powersOf2; +} + + +// Shift a BigInteger by bits to left. If +// result is not NULL, write result into it, else allocate a new BigInteger. +BigInteger* BigInteger::lshift(uint32 shiftBy, BigInteger* result) const +{ + // calculate how much larger the result will be + int numNewWords = shiftBy >> 5; // i.e. div by 32 + int totalWords = numNewWords + numWords + 1; // overallocate by 1, trim if necessary at end. + result->setNumWords(totalWords,true); + + + // make sure we don't create more words for 0 + if ( numWords == 1 && wordBuffer[0] == 0 ) + { + result->setValue(0); // 0 << num is still 0 + return result; + } + const uint32* pSourceBuff = wordBuffer; + uint32* pResultBuff = result->wordBuffer; + for(int x = 0; x < numNewWords; x++) + *pResultBuff++ = 0; + // move bits from wordBuffer into result's wordBuffer shifted by (shiftBy % 32) + shiftBy &= 0x1f; + if (shiftBy) { + uint32 carry = 0; + int shiftCarry = 32 - shiftBy; + for(int x=0; x < numWords; x++) + { + *pResultBuff++ = *pSourceBuff << shiftBy | carry; + carry = *pSourceBuff++ >> shiftCarry; + } + *pResultBuff = carry; // final carry may add a word + if (*pResultBuff) + ++totalWords; // prevent trim of overallocated extra word + } + else for(int x=0; x < numWords; x++) // shift was by a clean multiple of 32, just move words + { + *pResultBuff++ = *pSourceBuff++; + } + result->numWords = totalWords - 1; // trim over allocated extra word + return result; +} + +// Shift a BigInteger by bits to right. If +// result is not NULL, write result into it, else allocate a new BigInteger. +// (todo: might be possible to combine rshift and lshift into a single function +// with argument specifying which direction to shift, but result might be messy/harder to get right) +BigInteger* BigInteger::rshift(uint32 shiftBy, BigInteger* result) const +{ + int numRemovedWords = shiftBy >> 5; // i.e. div by 32 + + // calculate how much larger the result will be + int totalWords = numWords - numRemovedWords; + result->setNumWords(totalWords,true); + + // check for underflow + if (numRemovedWords > numWords) + { + result->setValue(0); + return result; + } + + // move bits from wordBuffer into result's wordBuffer shifted by (shiftBy % 32) + uint32* pResultBuff = &(result->wordBuffer[totalWords-1]); + const uint32* pSourceBuff = &(wordBuffer[numWords-1]); + shiftBy &= 0x1f; + if (shiftBy) + { + int shiftCarry = 32 - shiftBy; + uint32 carry = 0; + + for(int x=totalWords-1; x > -1; x--) + { + *pResultBuff-- = *pSourceBuff >> shiftBy | carry; + carry = *pSourceBuff-- << shiftCarry; + } + } + else for(int x=totalWords-1; x > -1; x--) // shift was by a clean multiple of 32, just move words + { + *pResultBuff-- = *pSourceBuff--; + } + result->numWords = totalWords; + result->trimLeadingZeros(); // shrink numWords down to correct value + return result; +} + +// Add or subtract two BigIntegers. If subtract, we assume the argument is smaller than this since we +// don't support negative numbers. If optional third argument result is not null, reuse it for result +// else allocate a new BigInteger for the result. +BigInteger *BigInteger::addOrSubtract(const BigInteger* smallerNum, bool isAdd, BigInteger* result) const +{ + // figure out which operand is the biggest in terms of number of words. + int comparedTo = compare(smallerNum); + const BigInteger* biggerNum = this; + if (comparedTo < 0) + { + const BigInteger* temp = biggerNum; + biggerNum = smallerNum; + smallerNum = temp; + AvmAssert(isAdd || comparedTo >= 0); // the d2a/a2d code should never subtract a larger from a smaller. + // all of the BigInteger code assumes positive numbers. Proper + // handling would be to create a negative result here (and check for + // negative results everywhere). + } + + result->setNumWords(biggerNum->numWords+1, true); + + if (!isAdd && !comparedTo) // i.e. this - smallerNum == 0 + { + result->setValue(0); + return result; + } + + // do the math: loop over common words of both numbers, performing - or + and carrying the + // overflow/borrow forward to next word. + uint64 borrow = 0; + uint64 x; + int index; + for( index = 0; index < smallerNum->numWords; index++) + { + if (isAdd) + x = ((uint64)biggerNum->wordBuffer[index]) + smallerNum->wordBuffer[index] + borrow; + else + x = ((uint64)biggerNum->wordBuffer[index]) - smallerNum->wordBuffer[index] - borrow; // note x is unsigned. Ok even if result would be negative however + borrow = x >> 32 & (uint32)1; + result->wordBuffer[index] = (uint32)(x & 0xffffffff); + } + + // loop over remaining words of the larger number, carying borrow/overflow forward + for( ; index < biggerNum->numWords; index++) + { + if (isAdd) + x = ((uint64)biggerNum->wordBuffer[index]) + borrow; + else + x = ((uint64)biggerNum->wordBuffer[index]) - borrow; + borrow = x >> 32 & (uint32)1; + result->wordBuffer[index] = (uint32)(x & 0xffffffff); + } + + // handle final overflow if this is add + if (isAdd && borrow) + { + result->wordBuffer[index] = (uint32)(borrow & 0xffffffff); + index++; + } + // loop backwards over result, removing leading zeros from our numWords count + while( !(result->wordBuffer[--index]) ) + { + } + result->numWords = index+1; + + return result; + +} + +} diff --git a/mozilla/js/tamarin/core/BigInteger.h b/mozilla/js/tamarin/core/BigInteger.h new file mode 100644 index 00000000000..2f54db6bd0a --- /dev/null +++ b/mozilla/js/tamarin/core/BigInteger.h @@ -0,0 +1,255 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 1993-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#ifndef __avmplus_BigInteger__ +#define __avmplus_BigInteger__ + +// +// BigInteger is an implementation of arbitrary precision integers. This class is used by the +// D2A class in mathutils.h to print doubles to greater than 15 digits of precision. It has +// been implemented with that use in mind, so if you want to use it for some other purpose +// be aware that certain basic features have not been implemented: divide() assumes the result +// is a single digit, there is no support for negative values, and subtract() assumes that the +// term being subtracted from is larger than the operand. +// +// By far, memory allocation is the gating speed factor. D2A never uses more than 8 or so values +// during a given run, so a simple memoryCache is used to keep 8 temporaries around for quick reuse. +// This would likely have to be adjusted for more general use. +namespace avmplus +{ + class BigInteger + { + public: + + // Memory management + // -------------------------------------------------------- + BigInteger() + { + numWords = 0; + } + + ~BigInteger() + { + } + + inline void setFromInteger(int32 initVal) + { + wordBuffer[0] = initVal; + numWords = 1; + } + void setFromDouble(double value); + void setFromBigInteger(const BigInteger* from, int32 offset, int32 amount); + + double doubleValueOf() const; // returns double approximation of this integer + + + // operations + // -------------------------------------------------------- + + // Compare (sum = this+offset) vs other. if sum > other, return 1. if sum < other, + // return -1, else return 0. Note that all terms are assumed to be positive. + int32 compare(const BigInteger *other) const; + + // same as above, but compare this+offset with other. + int32 compareOffset(const BigInteger *other, const BigInteger *offset) + { + BigInteger tempInt; + tempInt.setFromInteger(0); + add(offset,&tempInt); + return tempInt.compare(other); + } + + + // Add or subtract one BigInteger from another. isAdd determines if + or - is performed. + // If result is specified, write result into it (allows for reuse of temporaries), else + // allocate a new BigInteger for the result. + BigInteger* addOrSubtract(const BigInteger* other, bool isAdd, BigInteger* result) const; + + // syntactic sugar for simple case of adding two BigIntegers + inline BigInteger* add(const BigInteger* other, BigInteger* result) const + { + return addOrSubtract(other, true, result); + } + // syntactic sugar for simple case of subtracting two BigIntegers + inline BigInteger* subtract(const BigInteger* other, BigInteger* result) const + { + return addOrSubtract(other, false, result); + } + + // Increment this by other. other is assumed to be positive + inline void incrementBy(const BigInteger* other) + { + BigInteger tempInt; + tempInt.setFromInteger(0); + addOrSubtract(other,true,&tempInt); + copyFrom(&tempInt); + } + + // Decrement this by other. other is assumed to be positive and smaller than this. + inline void decrementBy(const BigInteger* other) + { + BigInteger tempInt; + tempInt.setFromInteger(0); + addOrSubtract(other,false,&tempInt); + copyFrom(&tempInt); + } + + // Shift a BigInteger by bits to right or left. If + // result is not NULL, write result into it, else allocate a new BigInteger. + BigInteger* rshift(uint32 shiftBy, BigInteger* result) const; + BigInteger* lshift(uint32 shiftBy, BigInteger* result) const; + + // Same as above but store result back into "this" + void lshiftBy(uint32 shiftBy) + { + BigInteger tempInt; + tempInt.setFromInteger(0); + lshift(shiftBy,&tempInt); + copyFrom(&tempInt); + } + + void rshiftBy(uint32 shiftBy) + { + BigInteger tempInt; + tempInt.setFromInteger(0); + rshift(shiftBy,&tempInt); + copyFrom(&tempInt); + } + + // Multiply this by an integer factor and add an integer increment. Store result back in this. + // Note, the addition is essentially free + void multAndIncrementBy( int32 factor, int32 addition); + inline void multBy( int32 factor) + { + multAndIncrementBy(factor,0); + } + + // Shorthand for multiplying this by a double valued factor (and storing result back in this). + inline void multBy(double factor) + { + BigInteger bigFactor; + bigFactor.setFromDouble(factor); + multBy(&bigFactor); + } + + // Multiply by another BigInteger. If optional arg result is not null, reuse it for + // result, else allocate a new result. + // (note, despite the name "smallerNum", argument does not need to be smaller than this). + BigInteger* mult(const BigInteger* other, BigInteger* result) const; + void multBy(const BigInteger *other) + { + BigInteger tempInt; + tempInt.setFromInteger(0); + mult(other,&tempInt); + copyFrom(&tempInt); + } + + // divide this by divisor, put the remainder (i.e. this % divisor) into residual. If optional third argument result + // is not null, use it to store the result of the div, else allocate a new BigInteger for the result. + // Note: this has been hard to get right. If bugs do show up, use divideByReciprocalMethod instead + // Note2: this is optimized for the types of numerator/denominators generated by D2A. It will not work when + // the result would be a value bigger than 9. For general purpose BigInteger division, use divideByReciprocalMethod. + BigInteger* quickDivMod(const BigInteger* divisor, BigInteger* modResult, BigInteger* divResult); + + /* Thought this would be faster than the above, but its not */ + BigInteger* divideByReciprocalMethod(const BigInteger* divisor, BigInteger* modResult, BigInteger* divResult); + uint32 lg2() const; + + + + // q = this->divBy(divisor) is equilvalent to: q = this->divMod(divisor,remainderResult); this = remainderResult; + BigInteger* divBy(const BigInteger* divisor, BigInteger* divResult); + + // copy words from another BigInteger. By default, copy all words into this. If copyOffsetWords + // is not -1, then copy numCopyWords starting at word copyOffsetWords. + void copyFrom(const BigInteger *other, int32 copyOffsetWords=-1, int32 numCopyWords=-1) + { + int32 numCopy = (numCopyWords == -1) ? other->numWords : numCopyWords; + int32 copyOffset = (copyOffsetWords == -1) ? 0 : copyOffsetWords; + + copyBuffer(other->wordBuffer+copyOffset, numCopy); + } + + // Data members + // -------------------------------------------------------- + static const int kMaxBigIntegerBufferSize=128; + uint32 wordBuffer[kMaxBigIntegerBufferSize]; + int32 numWords; + + private: + // sign; Simplifications are made assuming all numbers are positive + + // Utility methods + // -------------------------------------------------------- + + // set value to a simple integer + inline void setValue(uint32 val) + { + this->numWords = 1; + this->wordBuffer[0] = val; + } + + + // copy wordBuffer from another BigInteger + inline void copyBuffer(const uint32 *newBuff, int32 size) + { + numWords = size; + AvmAssert(newBuff != wordBuffer); + AvmAssert(numWords <= kMaxBigIntegerBufferSize); + memcpy(wordBuffer, newBuff, numWords*sizeof(uint32)); + } + + inline void setNumWords( int32 newNumWords,bool initToZero=false) + { + int32 oldNumWords = numWords; + numWords = newNumWords; + AvmAssert(numWords <= kMaxBigIntegerBufferSize); + if (initToZero && oldNumWords < numWords) + { + for( int32 x = oldNumWords-1; x < numWords; x++) + wordBuffer[x] = 0; + } + } + + // remove leading zero words from number. + inline void trimLeadingZeros() + { + int32 x; + for( x = numWords-1; x >= 0 && wordBuffer[x] == 0; x--) + ; + this->numWords = (x == -1) ? 1 : x+1; // make sure a zero value has numWords = 1 + } + }; + +} +#endif // __avmplus_BigInteger__ + diff --git a/mozilla/js/tamarin/core/BitSet.h b/mozilla/js/tamarin/core/BitSet.h new file mode 100644 index 00000000000..863b05c614f --- /dev/null +++ b/mozilla/js/tamarin/core/BitSet.h @@ -0,0 +1,156 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_BitSet__ +#define __avmplus_BitSet__ + + +namespace avmplus +{ + /** + * Bit vectors are an efficent method of keeping True/False information + * on a set of items or conditions. Class BitSet provides functions + * to manipulate individual bits in the vector. + * + * Since most vectors are rather small an array of longs is used by + * default to house the value of the bits. If more bits are needed + * then an array is allocated dynamically outside of this object. + * + * This object is not optimized for a fixed sized bit vector + * it instead allows for dynamically growing the bit vector. + */ + class BitSet: public MMgc::GCFinalizedObject + { + public: + + enum { kUnit = 8*sizeof(long), + kDefaultCapacity = 4 }; + + BitSet() + { + capacity = kDefaultCapacity; + for(int i=0; i kDefaultCapacity) + delete [] bits.ptr; + capacity = 0; + } + + void set(int bitNbr) + { + int index = bitNbr / kUnit; + int bit = bitNbr % kUnit; + if (index >= capacity) + grow(index+1); + + if (capacity > kDefaultCapacity) + bits.ptr[index] |= (1< kDefaultCapacity) + bits.ptr[index] &= ~(1< kDefaultCapacity) + value = ( bits.ptr[index] & (1< kDefaultCapacity) + newBits[i] = bits.ptr[i]; + else + newBits[i] = bits.ar[i]; + } + + // clear out the rest + for(int i=capacity; i kDefaultCapacity) + delete [] bits.ptr; + + bits.ptr = newBits; + capacity = newCapacity; + } + + // by default we use the array, but if the vector + // size grows beyond kDefaultCapacity we allocate + // space dynamically. + int capacity; + union + { + long ar[kDefaultCapacity]; + long* ptr; + } + bits; + }; +} + +#endif /* __avmplus_BitSet__ */ diff --git a/mozilla/js/tamarin/core/Boolean.as b/mozilla/js/tamarin/core/Boolean.as new file mode 100644 index 00000000000..7417cec9d4f --- /dev/null +++ b/mozilla/js/tamarin/core/Boolean.as @@ -0,0 +1,82 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +package +{ + public final class Boolean extends Object + { + // Boolean.length = 1 per ES3 + // E262 {ReadOnly, DontDelete, DontEnum } + public static const length:int = 1 + + AS3 function toString():String { + return this ? "true" : "false" + } + + AS3 function valueOf():Boolean { return this } + + prototype.toString = function():String + { + if (this === prototype) + return "false" + + if (!(this is Boolean)) { + // cause TypeError if this is not a Boolean value + // kInvokeOnIncompatibleObjectError + Error.throwError( TypeError, 1004, "Boolean.prototype.toString" ); + } + + return this ? "true" : "false" + } + + prototype.valueOf = function() + { + if (this === prototype) + return false + + if (!(this is Boolean)) { + // cause TypeError if this is not a Boolean value + // kInvokeOnIncompatibleObjectError + Error.throwError( TypeError, 1004, "Boolean.prototype.valueOf" ); + } + + return this; + } + + // Dummy constructor function - This is neccessary so the compiler can do arg # checking for the ctor in strict mode + // The code for the actual ctor is in BooleanClass::construct in the avmplus + public function Boolean(value = void 0) + {} + + _dontEnumPrototype(prototype); + } +} diff --git a/mozilla/js/tamarin/core/BooleanClass.cpp b/mozilla/js/tamarin/core/BooleanClass.cpp new file mode 100644 index 00000000000..00b5895626f --- /dev/null +++ b/mozilla/js/tamarin/core/BooleanClass.cpp @@ -0,0 +1,55 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#include "avmplus.h" + + +namespace avmplus +{ + BEGIN_NATIVE_MAP(BooleanClass) + END_NATIVE_MAP() + + BooleanClass::BooleanClass(VTable* cvtable) + : ClassClosure(cvtable) + { + toplevel()->booleanClass = this; + createVanillaPrototype(); + } + + Atom BooleanClass::construct(int argc, Atom* argv) + { + // TODO throw arg error if argc > 1 + if (argc == 0) + return falseAtom; + else + return core()->booleanAtom(argv[1]); + } +} diff --git a/mozilla/js/tamarin/core/BooleanClass.h b/mozilla/js/tamarin/core/BooleanClass.h new file mode 100644 index 00000000000..5971fe68dd0 --- /dev/null +++ b/mozilla/js/tamarin/core/BooleanClass.h @@ -0,0 +1,63 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_BooleanClass__ +#define __avmplus_BooleanClass__ + + +namespace avmplus +{ + /** + * class Boolean + */ + class BooleanClass : public ClassClosure + { + public: + BooleanClass(VTable* vtable); + + // this = argv[0] (ignored) + // arg1 = argv[1] + // argN = argv[argc] + Atom construct(int argc, Atom* argv); + + // this = argv[0] + // arg1 = argv[1] + // argN = argv[argc] + Atom call(int argc, Atom* argv) + { + return construct(argc, argv); + } + + DECLARE_NATIVE_MAP(BooleanClass) + }; +} + +#endif /* __avmplus_BooleanClass__ */ diff --git a/mozilla/js/tamarin/core/BuiltinTraits.cpp b/mozilla/js/tamarin/core/BuiltinTraits.cpp new file mode 100644 index 00000000000..cf050649797 --- /dev/null +++ b/mozilla/js/tamarin/core/BuiltinTraits.cpp @@ -0,0 +1,150 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 1993-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmplus.h" + +namespace avmplus +{ + BuiltinTraits::BuiltinTraits() + { + memset(this, 0, sizeof(BuiltinTraits)); + } + + // this is called after core types are defined. we don't want to do + // it earlier because we need Void and int + void BuiltinTraits::initInstanceTypes(PoolObject* pool) + { + AvmCore* core = pool->core; + + class_itraits = pool->getBuiltinTraits(core->constantString("Class")); + namespace_itraits = pool->getBuiltinTraits(core->constantString("Namespace")); + function_itraits = pool->getBuiltinTraits(core->constantString("Function")); + boolean_itraits = pool->getBuiltinTraits(core->constantString("Boolean")); + number_itraits = pool->getBuiltinTraits(core->constantString("Number")); + int_itraits = pool->getBuiltinTraits(core->constantString("int")); + uint_itraits = pool->getBuiltinTraits(core->constantString("uint")); + string_itraits = pool->getBuiltinTraits(core->constantString("String")); + array_itraits = pool->getBuiltinTraits(core->constantString("Array")); + regexp_itraits = pool->getBuiltinTraits(core->constantString("RegExp")); + date_itraits = pool->getBuiltinTraits(core->constantString("Date")); + error_itraits = pool->getBuiltinTraits(core->constantString("Error")); + qName_itraits = pool->getBuiltinTraits(core->constantString("QName")); + xml_itraits = pool->getBuiltinTraits(core->constantString("XML")); + xmlList_itraits = pool->getBuiltinTraits(core->constantString("XMLList")); + + null_itraits = core->newTraits(NULL, 0, 0, 0); + null_itraits->pool = pool; + null_itraits->ns = core->publicNamespace; + null_itraits->name = core->constantString("null"); + null_itraits->final = true; + null_itraits->linked = true; + + void_itraits = core->newTraits(NULL, 0, 0, 0); + void_itraits->pool = pool; + void_itraits->ns = core->publicNamespace; + void_itraits->name = core->constantString("void"); + void_itraits->final = true; + void_itraits->linked = true; + + // we have fast equality checks in the core that only work + // because these two classes are final. If they become non-final + // then these checks need to be updated to account for possible + // subclassing. + AvmAssert(xml_itraits->final); + AvmAssert(xmlList_itraits->final); + + object_itraits->isMachineType = true; + void_itraits->isMachineType = true; + int_itraits->isMachineType = true; + uint_itraits->isMachineType = true; + boolean_itraits->isMachineType = true; + number_itraits->isMachineType = true; + + int_itraits->isNumeric = true; + uint_itraits->isNumeric = true; + number_itraits->isNumeric = true; + + // XML and XMLList are dynamic but do not need the + // standard dynamic hash table + xml_itraits->needsHashtable = false; + xmlList_itraits->needsHashtable = false; + + // All these types including XML, XMLList and QName + // are marked as not derived objects. + //array_itraits->notDerivedObjectOrXML = true; + boolean_itraits->notDerivedObjectOrXML = true; + class_itraits->notDerivedObjectOrXML = true; + //date_itraits->notDerivedObjectOrXML = true; + function_itraits->notDerivedObjectOrXML = true; + namespace_itraits->notDerivedObjectOrXML= true; + null_itraits->notDerivedObjectOrXML = true; + number_itraits->notDerivedObjectOrXML = true; + int_itraits->notDerivedObjectOrXML = true; + uint_itraits->notDerivedObjectOrXML = true; + object_itraits->notDerivedObjectOrXML = true; + //regexp_itraits->notDerivedObjectOrXML = true; + string_itraits->notDerivedObjectOrXML = true; + //toplevel_itraits->notDerivedObjectOrXML = true; + void_itraits->notDerivedObjectOrXML = true; + xml_itraits->notDerivedObjectOrXML = true; + xmlList_itraits->notDerivedObjectOrXML = true; + qName_itraits->notDerivedObjectOrXML = true; + + Traits* methodClosure_itraits; + methodClosure_itraits = pool->getBuiltinTraits(core->constantString("MethodClosure")); + methodClosure_itraits->notDerivedObjectOrXML = true; + } + + void BuiltinTraits::initClassTypes(PoolObject* pool) + { + math_ctraits = findCTraits("Math$", pool); + number_ctraits = findCTraits("Number$", pool); + int_ctraits = findCTraits("int$", pool); + uint_ctraits = findCTraits("uint$", pool); + boolean_ctraits = findCTraits("Boolean$", pool); + string_ctraits = findCTraits("String$", pool); + } + + Traits* BuiltinTraits::findCTraits(const char* cname, PoolObject* pool) + { + Stringp name = pool->core->constantString(cname); + for (int i=0, n=pool->cinits.capacity(); i < n; i++) + { + AbstractFunction* cinit = pool->cinits[i]; + if (cinit && cinit->declaringTraits->name == name) + { + return cinit->declaringTraits; + } + } + return NULL; + } +} diff --git a/mozilla/js/tamarin/core/BuiltinTraits.h b/mozilla/js/tamarin/core/BuiltinTraits.h new file mode 100644 index 00000000000..4d04532f99a --- /dev/null +++ b/mozilla/js/tamarin/core/BuiltinTraits.h @@ -0,0 +1,92 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 1993-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#ifndef __avmplus_BuiltinTraits__ +#define __avmplus_BuiltinTraits__ + +namespace avmplus +{ + /** + * BuiltinTraits is a container for the traits of all of + * the built-in objects. + * + * There may be multiple Toplevel objects, each with their + * own closures for the core objects. Multiple Toplevels are + * used in the Flash Player for security reasons. Thus, there + * may be multiple closures for the same core class. + * There will only be one set of traits, however, and traits + * are immutable. So, BuiltinTraits is global to the entire + * VM. + */ + class BuiltinTraits + { + public: + BuiltinTraits(); + + void initInstanceTypes(PoolObject* pool); + void initFunctionTypes(); + void initClassTypes(PoolObject* pool); + + // Main built-in class traits + Traits *array_itraits; + Traits *boolean_itraits; + Traits *class_itraits; + Traits *date_itraits; + Traits *error_itraits; + Traits *function_itraits; + Traits *namespace_itraits; + Traits *null_itraits; + Traits *number_itraits; + Traits *int_itraits; + Traits *uint_itraits; + Traits *object_itraits; + Traits *regexp_itraits; + Traits *string_itraits; + Traits *toplevel_itraits; + Traits *void_itraits; + Traits *xml_itraits; + Traits *xmlList_itraits; + Traits *qName_itraits; + + Traits* math_ctraits; + Traits* int_ctraits; + Traits* uint_ctraits; + Traits* number_ctraits; + Traits* string_ctraits; + Traits* boolean_ctraits; + + private: + Traits* findCTraits(const char* name, PoolObject* pool); + }; +} + +#endif /* __avmplus_BuiltinTraits__ */ diff --git a/mozilla/js/tamarin/core/Class.as b/mozilla/js/tamarin/core/Class.as new file mode 100644 index 00000000000..c5419d3169b --- /dev/null +++ b/mozilla/js/tamarin/core/Class.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +package +{ + //pseudo-final - no user class can extend Class + public dynamic class Class + { + // {DontEnum,DontDelete,ReadOnly} + public native final function get prototype() + + // Class.length = 1 per ES3 + // E262 {ReadOnly, DontDelete, DontEnum } + public static const length:int = 1; + } +} diff --git a/mozilla/js/tamarin/core/ClassClass.cpp b/mozilla/js/tamarin/core/ClassClass.cpp new file mode 100644 index 00000000000..88e89f21a93 --- /dev/null +++ b/mozilla/js/tamarin/core/ClassClass.cpp @@ -0,0 +1,69 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmplus.h" + +namespace avmplus +{ + BEGIN_NATIVE_MAP(ClassClass) + NATIVE_METHOD2(Class_prototype_get, + (NativeMethod::GetHandler)&ClassClosure::get_prototype) + END_NATIVE_MAP() + + ClassClass::ClassClass(VTable* cvtable) + : ClassClosure(cvtable) + { + toplevel()->classClass = this; + + // patch Class's instance vtable scope, since we created it earlier for + // bootstrapping + ivtable()->scope = cvtable->scope; + + AvmAssert(traits()->sizeofInstance == sizeof(ClassClass)); + + createVanillaPrototype(); +#ifdef DEBUGGER + if(core()->allocationTracking) + { + // add ObjectClass and which predate me + addInstance(toplevel()->objectClass->atom()); + } +#endif + } + + Atom ClassClass::construct(int /*argc*/, Atom* /*argv*/) + { + Multiname multiname(core()->publicNamespace, core()->constantString("Class$")); + toplevel()->throwTypeError(kNotConstructorError, core()->toErrorString(&multiname)); + return nullObjectAtom; + } +} diff --git a/mozilla/js/tamarin/core/ClassClass.h b/mozilla/js/tamarin/core/ClassClass.h new file mode 100644 index 00000000000..0e44dca3b26 --- /dev/null +++ b/mozilla/js/tamarin/core/ClassClass.h @@ -0,0 +1,55 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_ClassClass__ +#define __avmplus_ClassClass__ + + +namespace avmplus +{ + /** + * class Class - the builtin Class that defines the type of each user defined class + * and all other builtin classes. (not to be confused with a superclass). + */ + class ClassClass : public ClassClosure + { + public: + DECLARE_NATIVE_MAP(ClassClass) + ClassClass(VTable* cvtable); + + // this = argv[0] (ignored) + // arg1 = argv[1] + // argN = argv[argc] + Atom construct(int argc, Atom* argv); + }; +} + +#endif /* __avmplus_ClassClass__ */ diff --git a/mozilla/js/tamarin/core/ClassClosure.cpp b/mozilla/js/tamarin/core/ClassClosure.cpp new file mode 100644 index 00000000000..d8a62133fbd --- /dev/null +++ b/mozilla/js/tamarin/core/ClassClosure.cpp @@ -0,0 +1,193 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#include "avmplus.h" + + +namespace avmplus +{ + ClassClosure::ClassClosure(VTable *cvtable) + : ScriptObject(cvtable, NULL) + { + AvmAssert(traits()->sizeofInstance >= sizeof(ClassClosure)); + + // prototype will be set by caller + AvmAssert(cvtable->traits->itraits != NULL); + AvmAssert(ivtable() != NULL); + } + + void ClassClosure::createVanillaPrototype() + { + prototype = toplevel()->objectClass->construct(); + } + + Atom ClassClosure::get_prototype() + { + // Illegal to apply this getter to anything but instances of Class + // (verifier should ensure this) + return prototype ? prototype->atom() : undefinedAtom; + } + + void ClassClosure::set_prototype(Atom value) + { + // ISSUE can value be null/undefined? + + if (AvmCore::isNullOrUndefined(value)) + { + this->prototype = NULL; + } + else + { + if (!AvmCore::isObject(value)) + { + toplevel()->throwTypeError(kPrototypeTypeError); + } + + // allow any prototype object. if the object has methods or slots, so be it + this->prototype = AvmCore::atomToScriptObject(value); + } + } + + VTable* ClassClosure::ivtable() const + { + return vtable->ivtable; + } + + // this = argv[0] (ignored) + // arg1 = argv[1] + // argN = argv[argc] + Atom ClassClosure::construct(int argc, Atom* argv) + { + VTable* ivtable = this->ivtable(); + AvmAssert(ivtable != NULL); + AvmAssert(argv != NULL); // need at least one arg spot passed in + if (prototype == NULL) // ES3 spec, 13.2.2 (we've already ensured prototype is either an Object or null) + prototype = AvmCore::atomToScriptObject(toplevel()->objectClass->get_prototype()); + + ScriptObject *obj = createInstance(ivtable, prototype); + + if (vtable->call != NULL) + { + // this is a function + argv[0] = obj->atom(); // new object is receiver + MethodEnv* call = vtable->call; + Atom result = call->coerceEnter(argc, argv); + + // for E3 13.2.2 compliance, check result and return it if (Type(result) is Object) + + /* ISSUE does this apply to class constructors too? + + answer: no. from E4: A constructor may invoke a return statement as long as that + statement does not supply a value; a constructor cannot return a value. The newly + created object is returned automatically. A constructorÂ’s return type must be omitted. + A constructor always returns a new instance. */ + + return AvmCore::isNull(result) || AvmCore::isObject(result) ? result : obj->atom(); + } + else + { + // this is a class + Atom a = obj->atom(); + argv[0] = a; // new object is receiver + ivtable->init->coerceEnter(argc, argv); + // this is a class. always return new instance. + return a; + } + } + + // this = argv[0] + // arg1 = argv[1] + // argN = argv[argc] + Atom ClassClosure::call(int argc, Atom* argv) + { + MethodEnv* call = vtable->call; + Toplevel* toplevel = this->toplevel(); + if (call) + { + // invoke function body + // TODO if we kept track of a type's call signature we could do this at verify time + if (AvmCore::isNullOrUndefined(argv[0])) + { + // use callee's global object as this. + // see E3 15.3.4.4 + AvmAssert(call->vtable->scope->getSize() > 0); + argv[0] = call->vtable->scope->getScope(0); + } + + // make sure receiver is legal for callee + argv[0] = toplevel->coerce(argv[0], call->method->paramTraits(0)); + + return call->coerceEnter(argc, argv); + } + else + { + // explicit coercion of a class object. + if (argc != 1) + { + toplevel->throwArgumentError(kCoerceArgumentCountError, toplevel->core()->toErrorString(argc)); + } + return toplevel->coerce(argv[1], (Traits*)ivtable()->traits); + } + } + + int ClassClosure::get_length() + { + MethodEnv* call = vtable->call; + if (call) + return call->method->param_count; + else + return vtable->init->method->param_count; + } + +#ifdef DEBUGGER + uint32 ClassClosure::size() const + { + uint32 size = ScriptObject::size(); + size += vtable->size(); + return size; + } +#endif + +#ifdef AVMPLUS_VERBOSE + Stringp ClassClosure::format(AvmCore* core) const + { + if (traits()->name) + { + return traits()->format(core); + } + else + { + Stringp prefix = core->newString("CC{}@"); + return core->concatStrings(prefix, core->formatAtomPtr(atom())); + } + } +#endif +} diff --git a/mozilla/js/tamarin/core/ClassClosure.h b/mozilla/js/tamarin/core/ClassClosure.h new file mode 100644 index 00000000000..f53b1a26949 --- /dev/null +++ b/mozilla/js/tamarin/core/ClassClosure.h @@ -0,0 +1,83 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_ClassClosure__ +#define __avmplus_ClassClosure__ + + +namespace avmplus +{ + /** + * a user defined class, ie class MyClass + */ + class ClassClosure : public ScriptObject + { + public: + DRCWB(ScriptObject*) prototype; + + ClassClosure(VTable *cvtable); + + Atom get_prototype(); + void set_prototype(Atom p); + + void createVanillaPrototype(); + + /** + * called as constructor, as in new C(). for user classes this + * invokes the implicit constructor followed by the user's constructor + * if any. + */ + virtual Atom construct(int argc, Atom* argv); + + /** + * called as function, as in C(). For user classes, this is the + * the explicit coersion function. For user functions, we + * invoke m_call. + */ + virtual Atom call(int argc, Atom* argv); + + // Accessors for Function.length + int get_length(); + + VTable* ivtable() const; + +#ifdef DEBUGGER + uint32 size() const; +#endif + +#ifdef AVMPLUS_VERBOSE + public: + Stringp format(AvmCore* core) const; +#endif + }; +} + +#endif /* __avmplus_ClassClosure__ */ diff --git a/mozilla/js/tamarin/core/CodeContext.h b/mozilla/js/tamarin/core/CodeContext.h new file mode 100644 index 00000000000..439c4e41d5a --- /dev/null +++ b/mozilla/js/tamarin/core/CodeContext.h @@ -0,0 +1,82 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_CodeContext__ +#define __avmplus_CodeContext__ + +namespace avmplus +{ + const CodeContextAtom CONTEXT_NONE = 0; // No CodeContext present + const CodeContextAtom CONTEXT_ENV = 0; // MethodEnv* pointer + const CodeContextAtom CONTEXT_OBJECT = 1; // CodeContext* object + + // CodeContext is used to track which security context we are in. + // When an AS3 method is called, the AS3 method will set core->codeContext to its code context. + class CodeContext : public MMgc::GCFinalizedObject + { + public: +#ifdef DEBUGGER + virtual Toplevel *toplevel() const = 0; +#endif + }; + + class EnterCodeContext + { + public: + EnterCodeContext(AvmCore *core, MethodEnv *env) + { + initialize(core, (CodeContextAtom)env | CONTEXT_ENV); + } + EnterCodeContext(AvmCore *core, CodeContext *codeContext) + { + initialize(core, (CodeContextAtom)codeContext | CONTEXT_OBJECT); + } + ~EnterCodeContext() + { + finish(); + } + void finish() + { + core->codeContextAtom = savedCodeContextAtom; + } + private: + void initialize(AvmCore *core, CodeContextAtom atom) + { + this->core = core; + savedCodeContextAtom = core->codeContextAtom; + core->codeContextAtom = atom; + } + CodeContextAtom savedCodeContextAtom; + AvmCore *core; + }; +} + +#endif /* __avmplus_CodeContext__ */ diff --git a/mozilla/js/tamarin/core/Date.as b/mozilla/js/tamarin/core/Date.as new file mode 100644 index 00000000000..14e47d4ec5a --- /dev/null +++ b/mozilla/js/tamarin/core/Date.as @@ -0,0 +1,395 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +package +{ + public final dynamic class Date + { + // Date.length = 7 per ES3 + // E262 {ReadOnly, DontDelete, DontEnum } + public static const length:int = 7 + + public native static function parse(s):Number + public native static function UTC(year, month, date=1, hours=0, minutes=0, seconds=0, ms=0, ... rest):Number + + AS3 native function valueOf():Number + private native function _toString(index:int):String + private native function _setTime(value:Number):Number + private native function _get(index:int):Number + + AS3 function setTime(t=void 0):Number + { + return _setTime(t) + } + + prototype.setTime = function(t=void 0):Number + { + var d:Date = this + return d._setTime(t) + } + + prototype.valueOf = function() + { + var d:Date = this + return d.AS3::valueOf() + } + + AS3 function toString():String { return _toString(0) } + AS3 function toDateString():String { return _toString(1) } + AS3 function toTimeString():String { return _toString(2) } + AS3 function toLocaleString():String { return _toString(3) } + AS3 function toLocaleDateString():String { return _toString(4) } + AS3 function toLocaleTimeString():String { return _toString(5) } + AS3 function toUTCString():String { return _toString(6) } + + AS3 native function getUTCFullYear():Number + AS3 native function getUTCMonth():Number + AS3 native function getUTCDate():Number + AS3 native function getUTCDay():Number + AS3 native function getUTCHours():Number + AS3 native function getUTCMinutes():Number + AS3 native function getUTCSeconds():Number + AS3 native function getUTCMilliseconds():Number + AS3 native function getFullYear():Number + AS3 native function getMonth():Number + AS3 native function getDate():Number + AS3 native function getDay():Number + AS3 native function getHours():Number + AS3 native function getMinutes():Number + AS3 native function getSeconds():Number + AS3 native function getMilliseconds():Number + AS3 native function getTimezoneOffset():Number + AS3 native function getTime():Number + + AS3 native function setFullYear(year=void 0, month=void 0, date=void 0):Number + AS3 native function setMonth(month=void 0, date=void 0):Number + AS3 native function setDate(date=void 0):Number + AS3 native function setHours(hour=void 0, min=void 0, sec=void 0, ms=void 0):Number + AS3 native function setMinutes(min=void 0, sec=void 0, ms=void 0):Number + AS3 native function setSeconds(sec=void 0, ms=void 0):Number + AS3 native function setMilliseconds(ms=void 0):Number + + AS3 native function setUTCFullYear(year=void 0, month=void 0, date=void 0):Number + AS3 native function setUTCMonth(month=void 0, date=void 0):Number + AS3 native function setUTCDate(date=void 0):Number + AS3 native function setUTCHours(hour=void 0, min=void 0, sec=void 0, ms=void 0):Number + AS3 native function setUTCMinutes(min=void 0, sec=void 0, ms=void 0):Number + AS3 native function setUTCSeconds(sec=void 0, ms=void 0):Number + AS3 native function setUTCMilliseconds(ms=void 0):Number + + prototype.toString = function():String + { + var d:Date = this + return d._toString(0) + } + prototype.toDateString = function():String + { + var d:Date = this + return d.AS3::toDateString() + } + prototype.toTimeString = function():String + { + var d:Date = this + return d.AS3::toTimeString() + } + prototype.toLocaleString = function():String + { + var d:Date = this + return d.AS3::toLocaleString() + } + prototype.toLocaleDateString = function():String + { + var d:Date = this + return d.AS3::toLocaleDateString() + } + prototype.toLocaleTimeString = function():String + { + var d:Date = this + return d.AS3::toLocaleTimeString() + } + prototype.toUTCString = function():String + { + var d:Date = this + return d.AS3::toUTCString() + } + + prototype.getUTCFullYear = function():Number + { + var d:Date = this + return d.AS3::getUTCFullYear() + } + + prototype.getUTCMonth = function():Number + { + var d:Date = this + return d.AS3::getUTCMonth() + } + + prototype.getUTCDate = function():Number + { + var d:Date = this + return d.AS3::getUTCDate() + } + + prototype.getUTCDay = function():Number + { + var d:Date = this + return d.AS3::getUTCDay() + } + + prototype.getUTCHours = function():Number + { + var d:Date = this + return d.AS3::getUTCHours() + } + + prototype.getUTCMinutes = function():Number + { + var d:Date = this + return d.AS3::getUTCMinutes() + } + + prototype.getUTCSeconds = function():Number + { + var d:Date = this + return d.AS3::getUTCSeconds() + } + + prototype.getUTCMilliseconds = function():Number + { + var d:Date = this + return d.AS3::getUTCMilliseconds() + } + + prototype.getFullYear = function():Number + { + var d:Date = this + return d.AS3::getFullYear() + } + + prototype.getMonth = function():Number + { + var d:Date = this + return d.AS3::getMonth() + } + + prototype.getDate = function():Number + { + var d:Date = this + return d.AS3::getDate() + } + + prototype.getDay = function():Number + { + var d:Date = this + return d.AS3::getDay() + } + + prototype.getHours = function():Number + { + var d:Date = this + return d.AS3::getHours() + } + + prototype.getMinutes = function():Number + { + var d:Date = this + return d.AS3::getMinutes() + } + + prototype.getSeconds = function():Number + { + var d:Date = this + return d.AS3::getSeconds() + } + + prototype.getMilliseconds = function():Number + { + var d:Date = this + return d.AS3::getMilliseconds() + } + + prototype.getTimezoneOffset = function():Number + { + var d:Date = this + return d.AS3::getTimezoneOffset() + } + + prototype.getTime = function():Number + { + var d:Date = this + return d.AS3::getTime() + } + + prototype.setFullYear = function(year=void 0, month=void 0, date=void 0):Number + { + var d:Date = this + return d.AS3::setFullYear.apply(d, arguments); + } + prototype.setMonth = function(month=void 0, date=void 0):Number + { + var d:Date = this + return d.AS3::setMonth.apply(d, arguments); + } + prototype.setDate = function(date=void 0):Number + { + var d:Date = this + return d.AS3::setDate.apply(d, arguments); + } + prototype.setHours = function(hour=void 0, min=void 0, sec=void 0, ms=void 0):Number + { + var d:Date = this + return d.AS3::setHours.apply(d, arguments); + } + prototype.setMinutes = function(min=void 0, sec=void 0, ms=void 0):Number + { + var d:Date = this + return d.AS3::setMinutes.apply(d, arguments); + } + prototype.setSeconds = function(sec=void 0, ms=void 0):Number + { + var d:Date = this + return d.AS3::setSeconds.apply(d, arguments); + } + prototype.setMilliseconds = function(ms=void 0):Number + { + var d:Date = this + return d.AS3::setMilliseconds.apply(d, arguments); + } + + prototype.setUTCFullYear = function(year=void 0, month=void 0, date=void 0):Number + { + var d:Date = this + return d.AS3::setUTCFullYear.apply(d, arguments); + } + prototype.setUTCMonth = function(month=void 0, date=void 0):Number + { + var d:Date = this + return d.AS3::setUTCMonth.apply(d, arguments); + } + prototype.setUTCDate = function(date=void 0):Number + { + var d:Date = this + return d.AS3::setUTCDate.apply(d, arguments); + } + prototype.setUTCHours = function(hour=void 0, min=void 0, sec=void 0, ms=void 0):Number + { + var d:Date = this + return d.AS3::setUTCHours.apply(d, arguments); + } + prototype.setUTCMinutes = function(min=void 0, sec=void 0, ms=void 0):Number + { + var d:Date = this + return d.AS3::setUTCMinutes.apply(d, arguments); + } + prototype.setUTCSeconds = function(sec=void 0, ms=void 0):Number + { + var d:Date = this + return d.AS3::setUTCSeconds.apply(d, arguments); + } + prototype.setUTCMilliseconds = function(ms=void 0):Number + { + var d:Date = this + return d.AS3::setUTCMilliseconds.apply(d, arguments); + } + + public function get fullYear():Number { return AS3::getFullYear(); } + public function set fullYear(value:Number) { AS3::setFullYear(value); } + + public function get month():Number { return AS3::getMonth(); } + public function set month(value:Number) { AS3::setMonth(value); } + + public function get date():Number { return AS3::getDate(); } + public function set date(value:Number) { AS3::setDate(value); } + + public function get hours():Number { return AS3::getHours(); } + public function set hours(value:Number) { AS3::setHours(value); } + + public function get minutes():Number { return AS3::getMinutes(); } + public function set minutes(value:Number) { AS3::setMinutes(value); } + + public function get seconds():Number { return AS3::getSeconds(); } + public function set seconds(value:Number) { AS3::setSeconds(value); } + + public function get milliseconds():Number { return AS3::getMilliseconds(); } + public function set milliseconds(value:Number) { AS3::setMilliseconds(value); } + + public function get fullYearUTC():Number { return AS3::getUTCFullYear(); } + public function set fullYearUTC(value:Number) { AS3::setUTCFullYear(value); } + + public function get monthUTC():Number { return AS3::getUTCMonth(); } + public function set monthUTC(value:Number) { AS3::setUTCMonth(value); } + + public function get dateUTC():Number { return AS3::getUTCDate(); } + public function set dateUTC(value:Number) { AS3::setUTCDate(value); } + + public function get hoursUTC():Number { return AS3::getUTCHours(); } + public function set hoursUTC(value:Number) { AS3::setUTCHours(value); } + + public function get minutesUTC():Number { return AS3::getUTCMinutes(); } + public function set minutesUTC(value:Number) { AS3::setUTCMinutes(value); } + + public function get secondsUTC():Number { return AS3::getUTCSeconds(); } + public function set secondsUTC(value:Number) { AS3::setUTCSeconds(value); } + + public function get millisecondsUTC():Number { return AS3::getUTCMilliseconds(); } + public function set millisecondsUTC(value:Number) { AS3::setUTCMilliseconds(value); } + + public function get time():Number { return AS3::getTime(); } + public function set time(value:Number) { AS3::setTime(value); } + + public function get timezoneOffset():Number { return AS3::getTimezoneOffset(); } + public function get day():Number { return AS3::getDay(); } + public function get dayUTC():Number { return AS3::getUTCDay(); } + + + // Dummy constructor function - This is neccessary so the compiler can do arg # checking for the ctor in strict mode + // The code for the actual ctor is in DateClass::construct in the avmplus + public function Date(year = void 0, month = void 0, date = void 0, hours = void 0, minutes = void 0, seconds = void 0, ms = void 0) + {} + + + // These are not part of ECMA-262, and thus we will not be exposing + // them via the new-style get/set functions (this is provided here + // just to let you know we didn't overlook them) + //public function get year():Number { return getYear(); } + //public function get yearUTC():Number { return getUTCYear(); } + + // The following older ECMA and/or AS2 functions are not supported since + // they are not Y2K compliant (only get/set 2 digits) + // getYear + // setYear + // getUTCYear + // setUTCYear + + _dontEnumPrototype(prototype); + } +} diff --git a/mozilla/js/tamarin/core/Date.cpp b/mozilla/js/tamarin/core/Date.cpp new file mode 100644 index 00000000000..4504fd4735c --- /dev/null +++ b/mozilla/js/tamarin/core/Date.cpp @@ -0,0 +1,712 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include + +#include "avmplus.h" + +namespace avmplus +{ +#ifdef FIX_RECIPROCAL_BUG + // + // Visual C++ 6.0 optimizes division by turning it into multiplication + // by the reciprocal. This loses precision and results in inaccuracies + // in date calculations. Avoid this "optimization" by putting the + // numbers in static variables. + // + static double kMsecPerDay = 86400000; + static double kMsecPerHour = 3600000; + static double kMsecPerSecond = 1000; + static double kMsecPerMinute = 60000; +#else + // + // OK, we have a compiler that doesn't want to optimize our divisions. + // +#define kMsecPerDay 86400000 +#define kMsecPerHour 3600000 +#define kMsecPerSecond 1000 +#define kMsecPerMinute 60000 +#endif + + // + // We don't ever divide by these, so they should be fine. + // +#define kSecondsPerMinute 60 +#define kMinutesPerHour 60 +#define kHoursPerDay 24 +#define kMsecPerSecondInt 1000 + + + static double Day(double t) + { + return MathUtils::floor(t / (double)kMsecPerDay); + } + + static double DayFromYear(double year) + { + return (365 * (year - 1970) + + MathUtils::floor((year - 1969) / 4) - + MathUtils::floor((year - 1901)/100) + + MathUtils::floor((year - 1601) / 400)); + } + + static inline double TimeFromYear(int year) + { + return (double)kMsecPerDay * DayFromYear(year); + } + + static int DaysInYear(int year) + { + if (year % 4) { + return 365; + } + if (year % 100) { + return 366; + } + if (year % 400) { + return 365; + } + return 366; + } + + static inline double TimeWithinDay(double t) + { + double result = MathUtils::mod(t, kMsecPerDay); + if (result < 0) + result += kMsecPerDay; + return result; + } + + // NOTE: this is used by the Player core code. Changing this will change legacy behavior. + int YearFromTime(double t) + { + double day = Day(t); + int lo, hi; + lo = (int) MathUtils::floor((t < 0) ? (day / 365) : (day / 366)) + 1970; + hi = (int) MathUtils::ceil((t < 0) ? (day / 366) : (day / 365)) + 1970; + while (lo < hi) { + + // 13may04 grandma : + // This was pivot = (lo + hi) / 2, but bug 89715 inadvertantly calls this with + // t = -6.5438017398347670e+019, which produces lo = -2075023950 and hi = -2069354479, + // and (lo + hi) overflows. The below expression won't overflow + //int pivot = (lo / 2) + (hi / 2) + (lo & hi & 1); + + // 8/17/04 edsmith: + // the above expression does overflow, with other large numbers. + // this one below uses double math to avoid overflow. + int pivot = (int) ((((double)lo) + ((double)hi)) / 2); + + double pivotTime = TimeFromYear(pivot); + if (pivotTime <= t) { + if (TimeFromYear(pivot + 1) > t) { // R41 + return pivot; + } else { + lo = pivot + 1; + } + } else if (pivotTime > t) { + hi = pivot - 1; + } + } + return lo; + } + + static inline bool IsLeapYear(int year) + { + return DaysInYear(year) == 366; + } + + static inline bool TimeInLeapYear(double t) + { + return IsLeapYear(YearFromTime(t)); + } + + static inline int DayWithinYear(double t) + { + return (int) (Day(t) - DayFromYear((int) YearFromTime(t))); + } + + static const uint16 kMonthOffset[2][13] = { + // Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec Total + { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 }, + { 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 } + }; + + static int MonthFromTime(double t) + { + int day = DayWithinYear(t); + int leap = (int) TimeInLeapYear(t); + int i; + + for (i=0; i<11; i++) { + if (day < kMonthOffset[leap][i+1]) { + break; + } + } + return i; + } + + static int DateFromTime(double t) + { + int month = MonthFromTime(t); + return DayWithinYear(t) - kMonthOffset[(int) TimeInLeapYear(t)][month] + 1; + } + + //mds: gcc has problems when this is inlined. + int WeekDay(double t) + { + int result = (int) MathUtils::mod(Day(t) + 4, 7); + if (result < 0) { + result = 7 + result; + } + return result; + } + + /* This needs to be publicly available, for Mac edge code. (srj) */ + double UTC(double t) + { + return (t - OSDep::localTZA(t) - OSDep::daylightSavingTA(t - OSDep::localTZA(t))); + } + + static double LocalTime(double t) + { + return (t + OSDep::localTZA(t) + OSDep::daylightSavingTA(t)); + } + + // this needs to be publicly available, for data paraser + double GetTimezoneOffset(double t) + { + return (t - LocalTime(t)) / kMsecPerMinute; + } + + static int HourFromTime(double t) + { + int result = (int) MathUtils::mod(MathUtils::floor((t + 0.5) / kMsecPerHour), kHoursPerDay); + if (result < 0) { + result += kHoursPerDay; + } + return result; + } + + static double DayFromMonth(double year, double month) + { + int iMonth = (int) MathUtils::floor(month); + if (iMonth < 0 || iMonth >= 12) { + return MathUtils::nan(); + } + return DayFromYear((int)year) + kMonthOffset[(int)IsLeapYear((int)year)][iMonth]; + } + + static int MinFromTime(double time) + { + int result = (int) MathUtils::mod(MathUtils::floor(time / kMsecPerMinute), kMinutesPerHour); + if (result < 0) { + result += kMinutesPerHour; + } + return result; + } + + static int SecFromTime(double time) + { + int result = (int) MathUtils::mod(MathUtils::floor(time / kMsecPerSecond), kSecondsPerMinute); + if (result < 0) { + result += kSecondsPerMinute; + } + return result; + } + + static int MsecFromTime(double time) + { + int result = (int) MathUtils::mod(time, kMsecPerSecond); + if (result < 0) { + result += kMsecPerSecondInt; + } + return result; + } + + double MakeDate(double day, double time) + { + // if any value is not finite, return NaN + if (MathUtils::isInfinite(day) || MathUtils::isInfinite(time) || + day != day || time != time) + return MathUtils::nan(); + + day = MathUtils::toInt(day); + time = MathUtils::toInt(time); + + return day * kMsecPerDay + time; + } + + double MakeTime(double hour, double min, double sec, double ms) + { + // if any value is not finite, return NaN + if (MathUtils::isInfinite(hour) || MathUtils::isInfinite(min) || MathUtils::isInfinite(sec) || MathUtils::isInfinite(ms) || + hour != hour || min != min || sec != sec || ms != ms) + return MathUtils::nan(); + + hour = MathUtils::toInt(hour); + min = MathUtils::toInt(min); + sec = MathUtils::toInt(sec); + ms = MathUtils::toInt(ms); + + return hour * (double)kMsecPerHour + min * (double)kMsecPerMinute + sec * (double)kMsecPerSecond + ms; + } + + double MakeDay(double year, double month, double date) + { + // if any value is not finite, return NaN + if (MathUtils::isInfinite(year) || MathUtils::isInfinite(month) || MathUtils::isInfinite(date) || + year != year || month != month || date != date) + return MathUtils::nan(); + + year = MathUtils::toInt(year); + month = MathUtils::toInt(month); + date = MathUtils::toInt(date); + + year += MathUtils::floor(month / 12); + month = MathUtils::mod(month, 12); + if (month < 0) { + month += 12; + } + return DayFromMonth(year, month) + (date - 1); + } + + Date::Date() + { + m_time = OSDep::getDate(); + } + + Date::Date(double year, + double month, + double date, + double hours, + double min, + double sec, + double msec, + bool utcFlag) + { + if (year < 100) { + year += 1900; + } + m_time = MakeDate(MakeDay(year, month, date), + MakeTime(hours, min, sec, msec)); + if (!utcFlag) { + m_time = UTC(m_time); + } + } + + void Date::format(wchar *buffer, + const char *format, + ...) const + { + va_list ap; + + va_start(ap, format); + while (*format) { + if (*format == '%') { + switch (*++format) { + case 's': + { + char *str = va_arg(ap, char *); + while (*str) { + *buffer++ = *str++; + } + } + break; + case '2': + { + int value = va_arg(ap, int); + *buffer++ = (value/10) + '0'; + *buffer++ = (value%10) + '0'; + } + break; + case '3': + { + char *str = va_arg(ap, char *); + *buffer++ = *str++; + *buffer++ = *str++; + *buffer++ = *str++; + } + break; + case 'c': + { + // gcc complains if you put va_arg(ap, char) + char value = va_arg(ap, int); + *buffer++ = value; + } + break; + case 'd': + { + int value = va_arg(ap, int); + wchar intbuf[256]; + int len; + MathUtils::convertIntegerToString(value, intbuf, len); + wchar *intptr = intbuf; + while (*intptr) { + *buffer++ = *intptr++; + } + } + break; + } + } else { + *buffer++ = *format; + } + format++; + } + *buffer = 0; + va_end(ap); + } + + bool Date::toString(wchar *buffer, + int formatIndex, int &len) const + { + // todo we could try to do a much better job on + // localized date stuff + + static const char kMonths[] = "JanFebMarAprMayJunJulAugSepOctNovDec"; + static const char kDaysOfWeek[] = "SunMonTueWedThuFriSat"; + + if (MathUtils::isNaN(m_time)) { + UnicodeUtils::Utf8ToUtf16( (const uint8 *)"Invalid Date", + 12, + buffer, + 12 ); + buffer[len=12] = 0; + return true; + } + + double time = m_time; + + if (formatIndex != kToUTCString) { + time = LocalTime(m_time); + } + + int year = YearFromTime(time); + int month = MonthFromTime(time); + int day = WeekDay(time); + if (month < 0 || month >= 12 || day < 0 || day >= 7) { + return false; + } + + int delta = (int) ((time - m_time) / kMsecPerMinute); + char signChar = '+'; + if (delta < 0) { + delta = -delta; + signChar = '-'; + } + int deltaH = (delta / 60); + int deltaM = (delta % 60); + + int date = (int)DateFromTime(time); + + int hour24 = (int)HourFromTime(time); + int hour12 = hour24 % 12; + if (hour12 == 0) { + hour12 = 12; + } + char ampm = (hour24 >= 12) ? 'P' : 'A'; + + int min = (int)MinFromTime(time); + int seconds = (int)SecFromTime(time); + + const char *dayOfWeekStr = kDaysOfWeek + day * 3; + const char *monthStr = kMonths + month * 3; + + switch (formatIndex) { + /* CN: ecma3 leaves the string format implementation dependant, as long + / as it contains all the info below. As a result, IE and Mozilla + / had different formats for date. In 2002, Mozilla changed their date + / format to make it easier to write code which parses dates in string format + / regardless of the implementation which produced it. + / http://bugzilla.mozilla.org/show_bug.cgi?id=118266 + / We are not required by the standard to follow suit, but the one of the goals + / of compliance is easy porting of code / techniques from ecmascript. This change + / should be done in a AS2/AS3 conditional manner, however: + + // CN: 1/8/05 well, maybe this does break some existing user code (like the ATS). Since + // we aren't required to match Spidermonkey by the ES3 spec, lets decide to break + // existing ECMAscript code over existing Actionscript code. + + //AS2.0 format: + + */ + case kToString: + format(buffer, + "%3 %3 %d %2:%2:%2 GMT%c%2%2 %d", + dayOfWeekStr, + monthStr, + date, + hour24, + min, + seconds, + signChar, + deltaH, + deltaM, + year); + break; + case kToLocaleString: + format(buffer, + "%3 %3 %d %d %2:%2:%2 %cM", + dayOfWeekStr, + monthStr, + date, + year, + hour12, + min, + seconds, + ampm); + break; + case kToUTCString: + format(buffer, + "%3 %3 %d %2:%2:%2 %d UTC", + dayOfWeekStr, + monthStr, + date, + hour24, + min, + seconds, + year); + break; + + /* This would be the SpiderMonkey / IE format (well, logically at least in that + / toString() == toDateString() + toTimeString(). See long comment above... + + case kToString: + format(buffer, + "%3 %3 %d %d %2:%2:%2 GMT%c%2%2", + dayOfWeekStr, + monthStr, + date, + year, + hour24, + min, + seconds, + signChar, + deltaH, + deltaM); + break; + case kToLocaleString: + format(buffer, + "%3 %3 %d %d %2:%2:%2 %cM", + dayOfWeekStr, + monthStr, + date, + year, + hour12, + min, + seconds, + ampm); + break; + case kToUTCString: + format(buffer, + "%3 %3 %d %d %2:%2:%2 UTC", + dayOfWeekStr, + monthStr, + date, + year, + hour24, + min, + seconds); + break; + */ + + case kToDateString: + case kToLocaleDateString: + format(buffer, + "%3 %3 %d %d", + dayOfWeekStr, + monthStr, + (int)DateFromTime(time), + (int)YearFromTime(time)); + break; + case kToTimeString: + format(buffer, + "%2:%2:%2 GMT%c%2%2", + hour24, + min, + seconds, + signChar, + deltaH, + deltaM); + break; + case kToLocaleTimeString: + format(buffer, + "%2:%2:%2 %cM", + hour12, + min, + seconds, + ampm); + break; + default: + return false; + } + len = String::Length(buffer); + return true; + } + + double Date::getProperty(int index) + { + double t = m_time; + + // Short-circuit and return NaN if the date + // is NaN + if (MathUtils::isNaN(t)) { + return MathUtils::nan(); + } + + switch (index) { + case kUTCFullYear: + return YearFromTime(t); + case kUTCMonth: + return MonthFromTime(t); + case kUTCDate: + return DateFromTime(t); + case kUTCDay: + return WeekDay(t); + case kUTCHours: + return HourFromTime(t); + case kUTCMinutes: + return MinFromTime(t); + case kUTCSeconds: + return SecFromTime(t); + case kUTCMilliseconds: + return MsecFromTime(t); + case kFullYear: + return YearFromTime(LocalTime(t)); + case kMonth: + return MonthFromTime(LocalTime(t)); + case kDate: + return DateFromTime(LocalTime(t)); + case kDay: + return WeekDay(LocalTime(t)); + case kHours: + return HourFromTime(LocalTime(t)); + case kMinutes: + return MinFromTime(LocalTime(t)); + case kSeconds: + return SecFromTime(LocalTime(t)); + case kMilliseconds: + return MsecFromTime(LocalTime(t)); + case kTimezoneOffset: + return (t - LocalTime(t)) / kMsecPerMinute; + case kTime: + return t; + } + + AvmAssert(false); + return 0; + } + + void Date::setTime(double value) + { + m_time = TimeClip(value); + } + + // To not change a particular value, pass NaN. + void Date::setTime(double hours, + double min, + double sec, + double msec, + bool utcFlag) + { + double t = utcFlag ? m_time : LocalTime(m_time); + + if (MathUtils::isNaN(hours)) { + hours = HourFromTime(t); + } + if (MathUtils::isNaN(min)) { + min = MinFromTime(t); + } + if (MathUtils::isNaN(sec)) { + sec = SecFromTime(t); + } + if (MathUtils::isNaN(msec)) { + msec = MsecFromTime(t); + } + t = MakeDate(Day(t), + MakeTime(hours, + min, + sec, + msec)); + + m_time = TimeClip(utcFlag ? t : UTC(t)); + } + + void Date::setDate(double year, + double month, + double date, + bool utcFlag) + { + double t = utcFlag ? m_time : LocalTime(m_time); + + // date may already be NaN. It stays as NaN unless we are setting the year + if (MathUtils::isNaN(m_time)) + { + if (MathUtils::isNaN(year)) + return; + else + t = 0; // treat time as zero. + } + + if (MathUtils::isNaN(year)) { + year = YearFromTime(t); + } + if (MathUtils::isNaN(month)) { + month = MonthFromTime(t); + } + if (MathUtils::isNaN(date)) { + date = DateFromTime(t); + } + + // cn 2/14/06 Not sure whent this was added, but its not ECMAScript compatible. + // Yes, we will unexpectedly roll over into the next month and that's what + // the spec says to do. Disabling this "correction" + /* + // If we are setting the month on the 31st to a month that has 30 days, + // this will have the unexpected effect of rolling the date over into + // the next month. Correct for that here. + int iMonth = (int)month; + int iDate = (int)date; + int leap = IsLeapYear((int)year); + if (iMonth >= 0 && iMonth <= 11 && iDate >= 1 && iDate <= 31 ) { + if (iDate >= DaysInMonth(leap, iMonth)) { + iDate = DaysInMonth(leap, iMonth); + date = (double)iDate; + } + } + */ + + t = MakeDate(MakeDay(year, month, date), TimeWithinDay(t)); + m_time = TimeClip(utcFlag ? t : UTC(t)); + } +} + diff --git a/mozilla/js/tamarin/core/Date.h b/mozilla/js/tamarin/core/Date.h new file mode 100644 index 00000000000..da10787b872 --- /dev/null +++ b/mozilla/js/tamarin/core/Date.h @@ -0,0 +1,128 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_Date__ +#define __avmplus_Date__ + +namespace avmplus +{ + int YearFromTime(double t); + + /** + * Date is used to provide the underpinnings for the Date class. + * It is a layer over OS-specific date/time functionality. + */ + class Date + { + public: + enum { + kUTCFullYear, + kUTCMonth, + kUTCDate, + kUTCDay, + kUTCHours, + kUTCMinutes, + kUTCSeconds, + kUTCMilliseconds, + kFullYear, + kMonth, + kDate, + kDay, + kHours, + kMinutes, + kSeconds, + kMilliseconds, + kTimezoneOffset, + kTime + }; + + enum { + kToString, + kToDateString, + kToTimeString, + kToLocaleString, + kToLocaleDateString, + kToLocaleTimeString, + kToUTCString + }; + +#define kHalfTimeDomain 8.64e15 + + static inline double TimeClip(double t) + { + if (MathUtils::isInfinite(t) || MathUtils::isNaN(t) || ((t < 0 ? -t : t) > kHalfTimeDomain)) { + return MathUtils::nan(); + } + return MathUtils::toInt(t) + (+0.); + } + + + Date(); + Date(const Date& toCopy) { + m_time = toCopy.m_time; + } + Date& operator= (const Date& toCopy) { + m_time = toCopy.m_time; + return *this; + } + Date(double time) { m_time = TimeClip(time); } + Date(double year, + double month, + double date, + double hours, + double min, + double sec, + double msec, + bool utcFlag); + ~Date() { m_time = 0; } + double getProperty(int index); + double getTime() const { return m_time; } + void setDate(double year, + double month, + double date, + bool utcFlag); + void setTime(double hours, + double min, + double sec, + double msec, + bool utcFlag); + void setTime(double value); + bool toString(wchar *buffer, int formatIndex, int &len) const; + + private: + double m_time; + void format(wchar *buffer, + const char *format, ...) const; + }; + double GetTimezoneOffset(double t); +} + +#endif /* __avmplus_Date__ */ diff --git a/mozilla/js/tamarin/core/DateClass.cpp b/mozilla/js/tamarin/core/DateClass.cpp new file mode 100644 index 00000000000..1497b033f5d --- /dev/null +++ b/mozilla/js/tamarin/core/DateClass.cpp @@ -0,0 +1,449 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmplus.h" + +namespace avmplus +{ + BEGIN_NATIVE_MAP(DateClass) + NATIVE_METHOD(Date_parse, DateClass::parse) + NATIVE_METHOD(Date_UTC, DateClass::UTC) + NATIVE_METHOD(Date_private__toString, DateObject::toString) + NATIVE_METHOD(Date_AS3_valueOf, DateObject::valueOf) + NATIVE_METHOD(Date_private__setTime, DateObject::setTime) + NATIVE_METHOD(Date_private__get, DateObject::get) + + NATIVE_METHOD1(Date_AS3_getUTCFullYear, DateObject::get, Date::kUTCFullYear) + NATIVE_METHOD1(Date_AS3_getUTCMonth, DateObject::get, Date::kUTCMonth) + NATIVE_METHOD1(Date_AS3_getUTCDate, DateObject::get, Date::kUTCDate) + NATIVE_METHOD1(Date_AS3_getUTCDay, DateObject::get, Date::kUTCDay) + NATIVE_METHOD1(Date_AS3_getUTCHours, DateObject::get, Date::kUTCHours) + NATIVE_METHOD1(Date_AS3_getUTCMinutes, DateObject::get, Date::kUTCMinutes) + NATIVE_METHOD1(Date_AS3_getUTCSeconds, DateObject::get, Date::kUTCSeconds) + NATIVE_METHOD1(Date_AS3_getUTCMilliseconds, DateObject::get, Date::kUTCMilliseconds) + NATIVE_METHOD1(Date_AS3_getFullYear, DateObject::get, Date::kFullYear) + NATIVE_METHOD1(Date_AS3_getMonth, DateObject::get, Date::kMonth) + NATIVE_METHOD1(Date_AS3_getDate, DateObject::get, Date::kDate) + NATIVE_METHOD1(Date_AS3_getDay, DateObject::get, Date::kDay) + NATIVE_METHOD1(Date_AS3_getHours, DateObject::get, Date::kHours) + NATIVE_METHOD1(Date_AS3_getMinutes, DateObject::get, Date::kMinutes) + NATIVE_METHOD1(Date_AS3_getSeconds, DateObject::get, Date::kSeconds) + NATIVE_METHOD1(Date_AS3_getMilliseconds, DateObject::get, Date::kMilliseconds) + NATIVE_METHOD1(Date_AS3_getTimezoneOffset, DateObject::get, Date::kTimezoneOffset) + NATIVE_METHOD1(Date_AS3_getTime, DateObject::get, Date::kTime) + + NATIVE_METHODV1(Date_AS3_setFullYear, DateObject::set, 1) + NATIVE_METHODV1(Date_AS3_setMonth, DateObject::set, 2) + NATIVE_METHODV1(Date_AS3_setDate, DateObject::set, 3) + NATIVE_METHODV1(Date_AS3_setHours, DateObject::set, 4) + NATIVE_METHODV1(Date_AS3_setMinutes, DateObject::set, 5) + NATIVE_METHODV1(Date_AS3_setSeconds, DateObject::set, 6) + NATIVE_METHODV1(Date_AS3_setMilliseconds, DateObject::set, 7) + + NATIVE_METHODV1(Date_AS3_setUTCFullYear, DateObject::set, -1) + NATIVE_METHODV1(Date_AS3_setUTCMonth, DateObject::set, -2) + NATIVE_METHODV1(Date_AS3_setUTCDate, DateObject::set, -3) + NATIVE_METHODV1(Date_AS3_setUTCHours, DateObject::set, -4) + NATIVE_METHODV1(Date_AS3_setUTCMinutes, DateObject::set, -5) + NATIVE_METHODV1(Date_AS3_setUTCSeconds, DateObject::set, -6) + NATIVE_METHODV1(Date_AS3_setUTCMilliseconds, DateObject::set, -7) + + END_NATIVE_MAP() + + DateClass::DateClass(VTable* cvtable) + : ClassClosure(cvtable) + { + ScriptObject* object_prototype = toplevel()->objectClass->prototype; + prototype = new (core()->GetGC(), ivtable()->getExtraSize()) DateObject(this, object_prototype); + } + + // this = argv[0] (ignored) + // arg1 = argv[1] + // argN = argv[argc] + Atom DateClass::construct(int argc, Atom* argv) + { + AvmCore* core = this->core(); + if (argc == 1) { + double dateAsDouble = ( core->isString(argv[1]) ? + stringToDateDouble( *(core->string(argv[1])) ) : + core->number(argv[1]) ); + + Date date(dateAsDouble); + return (new (core->GetGC(), ivtable()->getExtraSize()) DateObject(this, date))->atom(); + } + else if (argc != 0) { + double num[7] = { 0, 0, 1, 0, 0, 0, 0 }; // defaults + int i; + if (argc > 7) + argc = 7; + for (i=0; inumber(argv[i+1]); + } + Date date(num[0], + num[1], + num[2], + num[3], + num[4], + num[5], + num[6], + false); + + return (new (core->GetGC(), ivtable()->getExtraSize()) DateObject(this, date))->atom(); + } else { + Date date; + return (new (core->GetGC(), ivtable()->getExtraSize()) DateObject(this, date))->atom(); + } + } + + // this = argv[0] + // arg1 = argv[1] + // argN = argv[argc] + Atom DateClass::call(int /*argc*/, Atom* /*argv*/) + { + // Date called as a top-level function. Return the date + // as a string. + + // ISSUE is it correct to ignore args here? + + Date date; + wchar buffer[256]; + int len; + date.toString(buffer, Date::kToString, len); + return (new (gc()) String(buffer, len))->atom(); + } + + // static function UTC(year, month, date, hours, minutes, seconds, ms, ... rest) + double DateClass::UTC(Atom year, Atom month, Atom date, + Atom hours, Atom minutes, Atom seconds, Atom ms, + Atom* /*argv*/, int /*argc*/) // rest + { + AvmCore* core = this->core(); + Date d(core->number(year), + core->number(month), + core->number(date), + core->number(hours), + core->number(minutes), + core->number(seconds), + core->number(ms), + true); + return d.getTime(); + } + + double DateClass::parse(Atom input) + { + AvmCore* core = this->core(); + Stringp s = core->string(input); + return stringToDateDouble( *s ); + } + + + /* + * DateClass::parse() / stringToDateDouble() support code + * + */ + + + // Identify keyword within substring of and modify hour, month, + // or timeZoneOffset appropriately. Return false if keyword is + // invalid. Assumes that is the start of a word in and + // + marks the end of that word. + inline bool parseDateKeyword(String &s, int offset, int count, int& hour, + int& month, double& timeZoneOffset) + { + static const char kDayAndMonthKeywords[] = "JanFebMarAprMayJunJulAugSepOctNovDecSunMonTueWedThuFriSatGMTUTC"; + static const int kKeyWordLength = 3; + static const int kUtcKewordPos = 12+7+1; + bool validKeyWord = false; + + if (count > kKeyWordLength) + return false; + + // string case must match. Case insensitivity is not necessary for compliance. + wchar subString16[kKeyWordLength+1]; + char subString[kKeyWordLength*2+1]; + + memcpy(subString16, s.c_str()+offset, count*sizeof(wchar)); + subString16[count] = 0; + int subStringLength = UnicodeUtils::Utf16ToUtf8( subString16, + count, + (uint8 *)subString, + kKeyWordLength*2 ); + if (subStringLength != count) + return false; // there are no double byte characters in any of the keywords we accept. + + subString16[count] = 0; + if (count == 3) + { + for(int x=0; x < 7+12+2; x++) + { + const char *key = kDayAndMonthKeywords+(kKeyWordLength*x); + if ( (key[0] == subString[0]) && (key[1] == subString[1]) && (key[2] == subString[2]) ) + { + validKeyWord = true; + if (x < 12) // its a month + month = x; + else if (x == kUtcKewordPos) // UTC + timeZoneOffset = 0; + // else its a day or 'GMT'. Ignore it: GMT is always followed by + or -, and we identify + // it from there. day must always be specified numerically, name of day is optional. + + break; + } + } + } + else if (count == 2) + { + if (subString[0] == 'A' && subString[1] == 'M') + { + validKeyWord = (hour <= 12 && hour >=0); + if (hour == 12) + hour = 0; + } + else if (subString[0] == 'P' && subString[1] == 'M') + { + validKeyWord = (hour <= 12 && hour >=0); + if (hour != 12) + hour += 12; + } + } + + return validKeyWord; + } + + // Parses a number out of the string and updates year/month/day/hour/min/timeZoneOffset as + // appropriate (based on whatever has already been parsed). Assumes that s[i] is an integer + // character. (broken out into a seperate function from stringToDateDouble() for readability) + static inline bool parseDateNumber(String &s, int sLength, int &i, wchar &c, wchar prevc, + double &timeZoneOffset, int &year, int &month, int &day, + int &hour, int &min, int &sec) + { + bool numberIsValid = true; + + // first get number value + int numVal = c - ((wchar)'0'); + while (i < sLength && (c=s[i]) >= ((wchar)'0') && c <= ((wchar)'9')) + { + numVal = numVal * 10 + c - ((wchar)'0'); + i++; + } + + // Supported examples: "Mon Jan 1 00:00:00 GMT-0800 1900", '1/1/1999 13:30 PM' + // "Mon Jan 1 00:00:00 UTC-0800 1900" + + // Check for timezone numeric info, which is the only place + or - can occur. + // ala: 'Sun Sept 12 11:11:11 GMT-0900 2004' + if ((prevc == ((wchar)'+') || prevc == ((wchar)'-'))) + { + if (numVal < 24) + numVal = numVal * 60; //GMT-9 + else + numVal = numVal % 100 + numVal / 100 * 60; // GMT-0900 + + if (prevc == ((wchar)'+')) // plus is east of GMT + numVal = 0-numVal; + + if (timeZoneOffset == 0 || timeZoneOffset == -1) + timeZoneOffset = numVal; + else + numberIsValid = false; + // note: do not support ':' in timzone value ala GMT-9:00 + } + + // else check for year value + else if (numVal >= 70 || + (prevc == ((wchar)'/') && month >= 0 && day >= 0 && year < 0)) + { + if (year >= 0) + numberIsValid = false; + else if (c <= ((wchar)' ') || c == ((wchar)',') || c == ((wchar)'/') || i >= sLength) + year = numVal < 100 ? numVal + 1900 : numVal; + else + numberIsValid = false; + } + + // else check for month or day + else if (c == ((wchar)'/')) + { + if (month < 0) + month = numVal-1; + else if (day < 0) + day = numVal; + else + numberIsValid = false; + } + + // else check for time unit + else if (c == ((wchar)':')) + { + if (hour < 0) + hour = numVal; + else if (min < 0) + min = numVal; + else + numberIsValid = false; + } + + // ensure next char is valid before allowing the final cases + else if (i < sLength && c != ((wchar)',') && c > ((wchar)' ') && c != ((wchar)'-')) + { + numberIsValid = false; + } + + // check for end of time hh:mm:sec + else if (hour >= 0 && min < 0) + { + min = numVal; + } + else if (min >= 0 && sec < 0) + { + sec = numVal; + } + + // check for end of mm/dd/yy + else if (day < 0) + { + day = numVal; + } + else + { + numberIsValid = false; + } + return numberIsValid; + } + + // used by both Date::parse() and the Date(String) constructor + double DateClass::stringToDateDouble(String &s) + { + int year = -1; + int month = -1; + int day = -1; + int hour = -1; + int min = -1; + int sec = -1; + double timeZoneOffset = -1; + + // Note: compliance with ECMAScript 3 only requires that we can parse what our toString() + // method produces. We do support some other simple formats just to pass Spidermonkey test + // suite, however (for instance "1/1/1999 13:30 PM"), but we don't handle timezone keywords + // or instance. + + int sLength = s.length(); + wchar c, prevc = 0; + int i = 0; + while (i < sLength) + { + c = s[i]; + i++; + + // skip whitespace and delimiters (and possibly garbage chars) + if (c <= ((wchar)' ') || c == ((wchar)',') || c == ((wchar)'-')) { + if (i < sLength) { + wchar nextc = s[i]; + // if number follows '-' save c in prevc for use in parseDateNumber for detecting GMT offset + if ( c == ((wchar)'-') && ((wchar)'0') <= nextc && nextc <= ((wchar)'9') ) { + prevc = c; + } + } + } + + // remember date and time seperators and/or numeric +- modifiers. + else if (c == ((wchar)'/') || c == ((wchar)':') || c == ((wchar)'+') || c == ((wchar)'-')) + { + prevc = c; + } + + // parse numeric value. + else if (((wchar)'0') <= c && c <= ((wchar)'9')) + { + if (parseDateNumber(s,sLength,i,c,prevc,timeZoneOffset,year,month,day,hour, + min,sec) == false) + return MathUtils::nan(); + prevc = 0; + } + + // parse keyword + else + { + // walk forward to end of word + int st = i - 1; + while (i < sLength) { + c = s[i]; + if (!(( ((wchar)'A') <= c && c <= ((wchar)'Z') ) || ( ((wchar)'a') <= c && c <= ((wchar)'z') ))) + break; + i++; + } + if (i <= st + 1) + return MathUtils::nan(); + + // check keyword substring against known keywords, modify hour/month/timeZoneOffset as appropriate + if (parseDateKeyword(s, st, i-st, hour, month, timeZoneOffset) == false) + return MathUtils::nan(); + prevc = 0; + } + } + if (year < 0 || month < 0 || day < 0) + return MathUtils::nan(); + if (sec < 0) + sec = 0; + if (min < 0) + min = 0; + if (hour < 0) + hour = 0; + if (timeZoneOffset == -1) { /* no time zone specified, have to use local */ + Date date(year, + month, + day, + hour, + min, + sec, + 0, + false); + + return date.getTime(); + } + else + { + Date date(year, + month, + day, + hour, + min, + sec, + 0, + true); + return date.getTime() + (timeZoneOffset * 60000); // millesecondsPerMinute = 60000 + } + } + + + +} diff --git a/mozilla/js/tamarin/core/DateClass.h b/mozilla/js/tamarin/core/DateClass.h new file mode 100644 index 00000000000..cad5ead85f1 --- /dev/null +++ b/mozilla/js/tamarin/core/DateClass.h @@ -0,0 +1,77 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_DateClass__ +#define __avmplus_DateClass__ + + +namespace avmplus +{ + /** + * class DateClass + */ + class DateClass : public ClassClosure + { + public: + DateClass(VTable* cvtable); + + // this = argv[0] + // arg1 = argv[1] + // argN = argv[argc] + Atom call(int argc, Atom* argv); + + // this = argv[0] (ignored) + // arg1 = argv[1] + // argN = argv[argc] + Atom construct(int argc, Atom* argv); + + /** @name instance methods */ + /*@{*/ + Atom get(Atom thisAtom, Atom *args, int argc, int index); + Atom set(Atom thisAtom, Atom *args, int argc, int index); + /*@}*/ + + /** @name static methods */ + /*@{*/ + double parse(Atom input); + double UTC(Atom year, Atom month, Atom date, + Atom hours, Atom minutes, Atom seconds, Atom ms, + Atom *args, int argc); + /*@}*/ + + DECLARE_NATIVE_MAP(DateClass) + + private: + double stringToDateDouble(String &s); + }; +} + +#endif /* __avmplus_DateClass__ */ diff --git a/mozilla/js/tamarin/core/DateObject.cpp b/mozilla/js/tamarin/core/DateObject.cpp new file mode 100644 index 00000000000..cbb3873b5da --- /dev/null +++ b/mozilla/js/tamarin/core/DateObject.cpp @@ -0,0 +1,121 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmplus.h" + +namespace avmplus +{ + + Stringp DateObject::toString(int index) + { + wchar buffer[256]; + int len; + date.toString(buffer, index, len); + return new (gc()) String(buffer,len); + } + + double DateObject::valueOf() + { + return date.getTime(); + } + + double DateObject::setTime(double value) + { + date.setTime(value); + return date.getTime(); + } + + double DateObject::get(int index) + { + return date.getProperty(index); + } + + double DateObject::set(int index, Atom *argv, int argc) + { + AvmCore* core = this->core(); + + double num[7]; + int i; + + for (i=0; i<7; i++) { + num[i] = MathUtils::nan(); + } + bool utcFlag = (index < 0); + index = (int)MathUtils::abs(index); + int j = index-1; + + for (i=0; i= 7) { + break; + } + num[j++] = core->number(argv[i]); + if (MathUtils::isNaN(num[j-1])) // actually specifying NaN results in a NaN date. Don't pass Nan, however, because we use + { // that value to denote that an optional arg was not supplied. + date.setTime(MathUtils::nan()); + return date.getTime(); + } + } + + const int minTimeSetterIndex = 4; // any setNames index >= 4 should call setTime() instead of setDate() + // setFullYear/setUTCFullYear/setMonth/setUTCMonth/setDay/setUTCDay are all in indices < 3 + if (index < minTimeSetterIndex) + { + date.setDate(num[0], + num[1], + num[2], + utcFlag); + } + else + { + date.setTime(num[3], + num[4], + num[5], + num[6], + utcFlag); + } + return date.getTime(); + } + +#ifdef AVMPLUS_VERBOSE + Stringp DateObject::format(AvmCore* core) const + { + wchar buffer[256]; + int len; + date.toString(buffer, Date::kToString, len); + Stringp result = core->newString("<"); + result = core->concatStrings(result, new (core->GetGC()) String(buffer,len)); + result = core->concatStrings(result, core->newString(">@")); + result = core->concatStrings(result, core->formatAtomPtr(atom())); + return result; + } +#endif +} diff --git a/mozilla/js/tamarin/core/DateObject.h b/mozilla/js/tamarin/core/DateObject.h new file mode 100644 index 00000000000..edb386f13f1 --- /dev/null +++ b/mozilla/js/tamarin/core/DateObject.h @@ -0,0 +1,81 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_DateObject__ +#define __avmplus_DateObject__ + + +namespace avmplus +{ + /** + * The DateObject class is the C++ implementation of instances + * of the Date class in the ECMA-262 Specification. + */ + class DateObject : public ScriptObject + { + public: + Date date; + + /** + * This variant is only used for creating the prototype + */ + DateObject(DateClass *type, ScriptObject *objectPrototype) + : ScriptObject(type->ivtable(), objectPrototype) + { + AvmAssert(traits()->sizeofInstance == sizeof(DateObject)); + date.setTime(MathUtils::nan()); // Date.prototype should be the "Invalid Date" + } + + /** + * This variant is used for creating all dates other + * than Date.prototype + */ + DateObject(DateClass *type, const Date& date) + : ScriptObject(type->ivtable(), type->prototype) + { + AvmAssert(traits()->sizeofInstance == sizeof(DateObject)); + this->date = date; + } + + Stringp toString(int index); + double valueOf(); + double setTime(double value); + double get(int index); + double set(int index, Atom *argv, int argc); + +#ifdef AVMPLUS_VERBOSE + public: + Stringp format(AvmCore* core) const; +#endif + }; +} + +#endif /* __avmplus_DateObject__ */ diff --git a/mozilla/js/tamarin/core/Domain.cpp b/mozilla/js/tamarin/core/Domain.cpp new file mode 100644 index 00000000000..18031edec04 --- /dev/null +++ b/mozilla/js/tamarin/core/Domain.cpp @@ -0,0 +1,92 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 1993-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmplus.h" + +namespace avmplus +{ + Domain::Domain(AvmCore *core, Domain* base) : base(base) + { + namedTraits = new (core->GetGC()) MultinameHashtable(); + namedScripts = new (core->GetGC()) MultinameHashtable(); + } + + Traits* Domain::getNamedTraits(Stringp name, Namespace* ns, bool recursive/*=true*/) const + { + Traits *traits = NULL; + if (recursive && base) { + traits = base->getNamedTraits(name, ns, true); + } + if (!traits) { + traits = (Traits*) namedTraits->get(name, ns); + } + return traits; + } + + Traits* Domain::getNamedTraits(Multiname *multiname, bool recursive/*=true*/) const + { + Traits *traits = NULL; + if (recursive && base) { + traits = base->getNamedTraits(multiname, true); + } + if (!traits) { + traits = (Traits*) namedTraits->getMulti(multiname); + } + return traits; + } + + AbstractFunction* Domain::getNamedScript(Stringp name, Namespace* ns) const + { + AbstractFunction *f = NULL; + if (base) { + f = base->getNamedScript(name, ns); + } + if (!f) { + f = (AbstractFunction*) namedScripts->get(name, ns); + } + return f; + } + + AbstractFunction* Domain::getNamedScript(Multiname *multiname) const + { + AbstractFunction *f = NULL; + if (base) { + f = base->getNamedScript(multiname); + } + if (!f) { + f = (AbstractFunction*) namedScripts->getMulti(multiname); + } + return f; + } +} + + diff --git a/mozilla/js/tamarin/core/Domain.h b/mozilla/js/tamarin/core/Domain.h new file mode 100644 index 00000000000..8216b0f9a32 --- /dev/null +++ b/mozilla/js/tamarin/core/Domain.h @@ -0,0 +1,58 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_Domain__ +#define __avmplus_Domain__ + +namespace avmplus +{ + class Domain : public MMgc::GCObject + { + public: + /** The domain-wide traits table (type name => instance Traits) */ + DWB(MultinameHashtable*) namedTraits; + + /** domain-wide type table of scripts, indexed by definition name */ + DWB(MultinameHashtable*) namedScripts; + + /** Parent domain */ + Domain* const base; + + Domain(AvmCore *core, Domain* base); + + Traits* getNamedTraits(Stringp name, Namespace* ns, bool recursive/*=true*/) const; + Traits* getNamedTraits(Multiname* multiname, bool recursive/*=true*/) const; + AbstractFunction* getNamedScript(Stringp name, Namespace* ns) const; + AbstractFunction* getNamedScript(Multiname* multiname) const; + }; +} + +#endif /* __avmplus_Domain__ */ diff --git a/mozilla/js/tamarin/core/DomainEnv.cpp b/mozilla/js/tamarin/core/DomainEnv.cpp new file mode 100644 index 00000000000..408e5a3b373 --- /dev/null +++ b/mozilla/js/tamarin/core/DomainEnv.cpp @@ -0,0 +1,95 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 1993-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmplus.h" + +namespace avmplus +{ + DomainEnv::DomainEnv(AvmCore *core, Domain* domain, DomainEnv* base) + : domain(domain), + base(base) + { + namedScripts = new (core->GetGC()) MultinameHashtable(); + } + + MethodEnv* DomainEnv::getScriptInit(Namespace* ns, Stringp name) const + { + MethodEnv *env = NULL; + if (base) { + env = base->getScriptInit(ns, name); + } + if (!env) { + env = (MethodEnv*) namedScripts->get(name, ns); + } + return env; + } + + MethodEnv* DomainEnv::getScriptInit(Multiname* multiname) const + { + MethodEnv *env = NULL; + if (base) { + env = base->getScriptInit(multiname); + } + if (!env) { + env = (MethodEnv*) namedScripts->getMulti(multiname); + } + return env; + } + + int DomainEnv::scriptNext(int index) const + { + int v = namedScripts->next(index); + return v; + } + + Stringp DomainEnv::scriptNameAt(int index) const + { + Stringp s = namedScripts->keyAt(index); + return s; + } + + Namespace* DomainEnv::scriptNsAt(int index) const + { + Namespace* ns = namedScripts->nsAt(index); + return ns; + } + + Toplevel* DomainEnv::toplevel() const + { + if(m_toplevel) return m_toplevel; + if(base) return base->toplevel(); + AvmAssert(NULL); + return NULL; + } +} + + diff --git a/mozilla/js/tamarin/core/DomainEnv.h b/mozilla/js/tamarin/core/DomainEnv.h new file mode 100644 index 00000000000..00391dff611 --- /dev/null +++ b/mozilla/js/tamarin/core/DomainEnv.h @@ -0,0 +1,73 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 1993-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#ifndef __avmplus_DomainEnv__ +#define __avmplus_DomainEnv__ + +namespace avmplus +{ + class DomainEnv : public MMgc::GCObject + { + public: + DomainEnv(AvmCore *core, Domain *domain, DomainEnv* base); + + /** Domain associated with this DomainEnv */ + Domain* const domain; + + /** Parent DomainEnv */ + DomainEnv* const base; + + MethodEnv* getScriptInit(Namespace* ns, Stringp name) const; + MethodEnv* getScriptInit(Multiname* multiname) const; + + Domain* getDomain() const { return domain; } + + /** + * Allow caller to enumerate the named entries in the table. + */ + int scriptNext(int index) const; + Stringp scriptNameAt(int index) const; + Namespace* scriptNsAt(int index) const; + + /** + * table of named program init functions. (ns,name => MethodEnv) + */ + DWB(MultinameHashtable*) namedScripts; + + Toplevel* toplevel() const; + void setToplevel(Toplevel *t) { m_toplevel = t; } + private: + DRCWB(Toplevel*) m_toplevel; + }; +} + +#endif /* __avmplus_DomainEnv__ */ diff --git a/mozilla/js/tamarin/core/DynamicProfiler.cpp b/mozilla/js/tamarin/core/DynamicProfiler.cpp new file mode 100644 index 00000000000..1b6114c6220 --- /dev/null +++ b/mozilla/js/tamarin/core/DynamicProfiler.cpp @@ -0,0 +1,138 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#include "avmplus.h" + + +#ifdef AVMPLUS_PROFILE +namespace avmplus +{ + DynamicProfiler::DynamicProfiler() + { + dprofile = false; + sprofile = false; + memset(counts2, 0, 256*sizeof(int)); + memset(times, 0, 256*sizeof(uint64)); + totalCount = 0; + lastOp = (AbcOpcode)0; + lastTime = 0; + } + + void DynamicProfiler::dump(PrintWriter& console) + { + if (dprofile) + { + uint64 totalTime = 0; + for (int i=1; i < 256; i++) { + totalTime += times[i]; + } + console << "total count=" << totalCount << " cycles=" << (double)totalTime; + if (totalCount != 0) + console << " avg CPI=" << (int)(totalTime/totalCount); + console << '\n'; + + uint64 gcoverhead = times[OP_sweep] + times[OP_mark] + times[OP_alloc] + times[OP_wb]; + uint64 overhead = gcoverhead + times[OP_decode] + times[OP_verifypass] + times[OP_codegenop]; + console << "user " << percent(100.0*(totalTime-overhead)/totalTime) << "%\n"; + console << "gc " << percent(100.0*gcoverhead/totalTime) << "%\n"; + console << "decoder " << percent(100.0*times[OP_decode]/totalTime) << "%\n"; + console << "verifier " << percent(100.0*times[OP_verifyop]/totalTime) << "%\n"; + if (times[OP_codegenop] != 0) + console << "codegen " << percent(100.0*times[OP_codegenop]/totalTime) << "%\n"; + + console << "count" + << tabstop(11) + << "cycles" + << tabstop(25) + << "%count" + << tabstop(35) + << "%time" + << tabstop(45) + << "CPI" + << tabstop(55) + << "opcode\n"; + console << "-----" + << tabstop(11) + << "--------" + << tabstop(25) + << "-------" + << tabstop(35) + << "-------" + << tabstop(45) + << "---" + << tabstop(55) + << "------\n"; + + for (int i=1; i < 256; i++) + { + uint64 max = 0; + int k = 0; + // find highest time + for (int j=1; j < 256; j++) + if (times[j] > max) + max = times[k=j]; + if (max != 0) + { + // print highest time then clear it + uint64 ticks = times[k];//(int)(times[i]*1000000/frequency); + console << counts2[k] + << tabstop(11) + << (double)ticks + << tabstop(25) + << percent(100.0*counts2[k]/totalCount) + << tabstop(35) + << percent(100.0*times[k]/totalTime) + << tabstop(45) + << (int)(ticks/counts2[k]) + << tabstop(55) + << opNames[k] + << '\n'; + times[k] = 0; + counts2[k] = 0; + } + } + + // TODO include MD instruction counts, and compute ratios +// console << "Register Allocator Ops Count\n"; +// console << "-------------------------- -----\n"; +// console << "add active O(1) " << CodegenMIR::addActiveCount << "\n"; +// console << "register release O(1) " << CodegenMIR::registerReleaseCount << "\n"; +// console << "expire O(1) " << CodegenMIR::expireCount << "\n"; +// console << "remove free reg O(1) " << CodegenMIR::removeRegCount << "\n"; +// console << "remove first free O(N) " << CodegenMIR::removeFreeCount << "\n"; +// console << "remove last active O(N) " << CodegenMIR::removeLastActiveCount << "\n"; +// console << "spill caller regs O(N) " << CodegenMIR::spillCallerRegistersCount << "\n"; +// console << "flush caller actives O(N) " << CodegenMIR::flushCallerActivesCount << "\n"; + } + + } +} +#endif diff --git a/mozilla/js/tamarin/core/DynamicProfiler.h b/mozilla/js/tamarin/core/DynamicProfiler.h new file mode 100644 index 00000000000..d52a46bbc6a --- /dev/null +++ b/mozilla/js/tamarin/core/DynamicProfiler.h @@ -0,0 +1,148 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_DynamicProfiler__ +#define __avmplus_DynamicProfiler__ + + +#ifdef AVMPLUS_PROFILE +namespace avmplus +{ + class StackMark; + /** + * Provides dynamic profiling support for the AVM+. + */ + class DynamicProfiler + { + #ifdef WIN32 + inline static int rdtsc() { + // read the cpu cycle counter. 1 tick = 1 cycle on IA32 + _asm rdtsc; + } + #endif + + int counts2[256]; + int totalCount; + AbcOpcode lastOp; + uint64 times[256]; + int lastTime; + + /** + * 1. set markOverhead=0 + * 2. run a test with -Ddprofile + * 3. set markOverhead slightly lower than the fastest opcode + * on Pentium-M, 65 is about right. cpu speed should not + * matter but it will vary between processor families. + * 4. rerun tests. overhead will be subtracted. + */ + static const int markOverhead = 61; + + public: + DynamicProfiler(); + + /** + * When dprofile is set to true, the VM performs dynamic + * profiling. Every instruction is timed and the VM + * prints a report on exit detailing how many CPU cycles + * were spent in each instruction type. This shows + * the "instruction mix" of the executing code, and + * the performance characteristics of different + * bytecode instructions. + */ + bool dprofile; + + /** + * When sprofile is set to true, the VM performs static + * profiling. The entire program's bytecode is scanned + * to determine how many instructions of each type + * are used in the program. + */ + bool sprofile; + + /** + * Dumps the static and dynamic profiling reports to + * the specified console output stream. + */ + void dump(PrintWriter& console); + + void endmark() { mark((AbcOpcode)0); } + + void mark(AbcOpcode op) + { + #ifdef WIN32 + int now = rdtsc(); + #else + uint64 now = MMgc::GC::GetPerformanceCounter(); + #endif + counts2[op]++; + totalCount++; + times[lastOp] += now-lastTime-markOverhead; + lastTime = now; + lastOp = op; + } + + class StackMark; + friend class DynamicProfiler::StackMark; + + class StackMark + { + AbcOpcode savedOp; + DynamicProfiler* dprof; + + public: + StackMark(AbcOpcode op, DynamicProfiler* dprof) : savedOp(OP_nop) // init to make GCC happy + { + if (dprof->dprofile) + { + savedOp = dprof->lastOp; + dprof->mark(op); + this->dprof = dprof; + } + else + { + this->dprof = NULL; + } + } + ~StackMark() + { + if(dprof) + { + dprof->mark(savedOp); + dprof->totalCount--; + dprof->counts2[savedOp]--; + } + } + }; + }; +} +#endif + +#endif /* __avmplus_DynamicProfiler__ */ diff --git a/mozilla/js/tamarin/core/E4XNode.cpp b/mozilla/js/tamarin/core/E4XNode.cpp new file mode 100644 index 00000000000..f4c98065eba --- /dev/null +++ b/mozilla/js/tamarin/core/E4XNode.cpp @@ -0,0 +1,988 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmplus.h" + +namespace avmplus +{ + extern wchar *stripPrefix (const wchar *str, const char *pre); + + E4XNodeAux::E4XNodeAux (Stringp s, Namespace *ns, ScriptObject* notify) + { + m_name = s; + m_ns = ns; + m_notification = notify; + } + + AttributeE4XNode::AttributeE4XNode (E4XNode *parent, String *value) : E4XNode(parent) + { + m_value = value; + } + + CDATAE4XNode::CDATAE4XNode (E4XNode *parent, String *value) : E4XNode(parent) + { + m_value = value; + } + + CommentE4XNode::CommentE4XNode (E4XNode *parent, String *value) : E4XNode(parent) + { + m_value = value; + } + + PIE4XNode::PIE4XNode (E4XNode *parent, String *value) : E4XNode(parent) + { + m_value = value; + } + + TextE4XNode::TextE4XNode (E4XNode *parent, String *value) : E4XNode(parent) + { + m_value = value; + } + + ElementE4XNode::ElementE4XNode (E4XNode *parent) : E4XNode(parent) + { + } + + // Fast append with no checks for type, etc. + void ElementE4XNode::_append (E4XNode *childNode) + { + childNode->setParent (this); + if (!m_children) + { + m_children = int(childNode) | SINGLECHILDBIT; + return; + } + + if (m_children & SINGLECHILDBIT) + { + convertToAtomArray(); + } + + AtomArray *aa = ((AtomArray *)(int)m_children); + aa->push (AvmCore::gcObjectToAtom(childNode)); + } + + uint32 ElementE4XNode::numChildren() const + { + if (!m_children) + return 0; + + if (m_children & SINGLECHILDBIT) + return 1; + else + { + AtomArray *aa = ((AtomArray *)(int)m_children); + return aa->getLength(); + } + } + + void ElementE4XNode::clearChildren() + { + if (m_children & ~SINGLECHILDBIT) + { + // !!@ delete our AtomArray + } + + m_children = 0; + } + + void ElementE4XNode::convertToAtomArray () + { + if (m_children & SINGLECHILDBIT) + { + E4XNode *firstChild = (E4XNode *) (m_children & ~SINGLECHILDBIT); + AtomArray *aa = new (gc()) AtomArray(2); + aa->push (AvmCore::gcObjectToAtom(firstChild)); + m_children = int(aa); + } + else if (!m_children) + { + m_children = int(new (gc()) AtomArray (1)); + } + } + + void ElementE4XNode::insertChild (uint32 i, E4XNode *x) + { + // m_children->insert (i, a) + convertToAtomArray(); + AtomArray *aa = ((AtomArray *)(int)m_children); + aa->insert (i, AvmCore::gcObjectToAtom(x)); + } + + void ElementE4XNode::removeChild (uint32 i) + { + // m_children->removeAt (i) + convertToAtomArray(); + AtomArray *aa = ((AtomArray *)(int)m_children); + aa->removeAt (i); + } + + void ElementE4XNode::setChildAt (uint32 i, E4XNode *x) + { + if ((i == 0) && (m_children & SINGLECHILDBIT)) + { + m_children = int(x) | SINGLECHILDBIT; + } + else + { + convertToAtomArray(); + AtomArray *aa = ((AtomArray *)(int)m_children); + aa->setAt (i, AvmCore::gcObjectToAtom(x)); + } + } + + E4XNode *ElementE4XNode::_getAt(uint32 i) const + { + if (i >= _length()) + return 0; + + if (int(this->m_children) & SINGLECHILDBIT) + { + return (E4XNode *)(this->m_children & ~SINGLECHILDBIT); + } + else + { + AtomArray *aa = (AtomArray *)(int)this->m_children; + E4XNode *x = (E4XNode *) AvmCore::atomToGCObject(aa->getAt(i)); + return x; + } + } + + uint32 ElementE4XNode::childIndex() const + { + // pull the parent + int index = -1; + E4XNode* p = this->getParent(); + if (p) + { + // yea old linear search... + int size = p->numChildren(); + for(int i=0; i_getAt(i) == const_cast(this)) + { + index = i; + break; + } + } + AvmAssert(index < size); // My parent should know about me! + } + return index; + } + + bool E4XNode::getQName(AvmCore *core, Multiname *mn) const + { + if (!m_nameOrAux) + return false; + + int nameOrAux = m_nameOrAux; + if (AUXBIT & nameOrAux) + { + E4XNodeAux *aux = (E4XNodeAux *)(nameOrAux & ~AUXBIT); + // We can have a notification only aux which won't have a real name + if (aux->m_name) + { + mn->setName (aux->m_name); + mn->setNamespace (aux->m_ns); + mn->setQName(); + } + else + { + return false; + } + } + else + { + Stringp str = (String *)(nameOrAux); + mn->setName (str); + mn->setNamespace (core->publicNamespace); + } + + if (getClass() == kAttribute) + mn->setAttr(); + + return true; + } + + void E4XNode::setQName (AvmCore *core, Stringp name, Namespace *ns) + { + // If we already have an aux, use it. (It may have notification atom set) + int nameOrAux = m_nameOrAux; + if (AUXBIT & nameOrAux) + { + E4XNodeAux *aux = (E4XNodeAux *)(nameOrAux & ~AUXBIT); + aux->m_name = name; + aux->m_ns = ns; + return; + } + + if (!name && !ns) + { + m_nameOrAux = 0; + return; + } + + if (!ns || ns == core->publicNamespace || + (ns->getPrefix() == core->kEmptyString->atom() && ns->getURI() == core->kEmptyString)) + { + //m_nameOrAux = int (name); + WBRC(core->GetGC(), this, &m_nameOrAux, int(name)); + return; + } + + E4XNodeAux *aux = new (core->GetGC()) E4XNodeAux (name, ns); + //m_nameOrAux = AUXBIT | int(aux); + WB(core->GetGC(), this, &m_nameOrAux, AUXBIT | int(aux)); + } + + void E4XNode::setQName (AvmCore *core, Multiname *mn) + { + if (!mn) + { + m_nameOrAux = 0; + } + else + { + setQName (core, mn->getName(), mn->getNamespace()); + } + } + + // E4X 9.1.1.3, pg 20 + void E4XNode::_addInScopeNamespace (AvmCore* /*core*/, Namespace* /*ns*/) + { + // do nothing for non-element nodes + } + + void ElementE4XNode::_addInScopeNamespace (AvmCore *core, Namespace *ns) + { +// if (getClass() & (kText | kCDATA | kComment | kProcessingInstruction | kAttribute)) +// return; + + if (ns->getPrefix() == undefinedAtom) + return; + + Multiname m; + getQName (core, &m); + + if ((ns->getPrefix() == core->kEmptyString->atom()) && (!m.isAnyNamespace()) && (m.getNamespace()->getURI() == core->kEmptyString)) + return; + + // step 2b + 2c + int index = -1; + for (uint32 i = 0; i < numNamespaces(); i++) + { + Namespace *ns2 = AvmCore::atomToNamespace (getNamespaces()->getAt(i)); + if (ns2->getPrefix() == ns->getPrefix()) + index = i; + } + + // step 2d + if (index != -1) + { + Namespace *ns2 = AvmCore::atomToNamespace (getNamespaces()->getAt(index)); + if (ns2->getURI() != ns->getURI()) + { + // remove match from inscopenamespaces + m_namespaces->removeAt (index); + } + } + + // step 2e - add namespace to inscopenamespaces + if (!m_namespaces) + m_namespaces = new (core->GetGC()) AtomArray(1); + + m_namespaces->push (ns->atom()); + + // step 2f + // If this nodes prefix == n prefix + // set this nodes prefix to undefined + if (!m.isAnyNamespace() && (m.getNamespace()->getPrefix() == ns->getPrefix())) + { + setQName (core, m.getName(), core->newNamespace (m.getNamespace()->getURI())); + } + + // step 2g + // for all attributes + // if their nodes prefix == n.prefix + // set the node prefix to undefined + for (unsigned int i = 0; i < numAttributes(); i++) + { + E4XNode *curAttr = (E4XNode *) (AvmCore::atomToGCObject(m_attributes->getAt(i))); + Multiname ma; + curAttr->getQName (core, &ma); + if (!ma.isAnyNamespace() && ma.getNamespace()->getPrefix() == ns->getPrefix()) + { + curAttr->setQName (core, ma.getName(), core->newNamespace (ma.getNamespace()->getURI())); + } + } + + return; + } + + int E4XNode::FindMatchingNamespace (AvmCore *core, Namespace *ns) + { + for (uint32 i = 0; i < numNamespaces(); i++) + { + Namespace *ns2 = AvmCore::atomToNamespace (getNamespaces()->getAt(i)); + if (ns2->getURI() == ns->getURI()) + { + if (ns->getPrefix() == undefinedAtom) + return i; + + if (ns2->getPrefix() == core->kEmptyString->atom()) + return -1; + + if (ns2->getPrefix() == ns->getPrefix()) + return i; + } + } + + return -1; + } + + Namespace *E4XNode::FindNamespace (AvmCore *core, Toplevel *toplevel, const wchar *tagName, const wchar **localName, bool bAttribute) + { + const wchar *ptr = tagName; + Stringp prefix = core->kEmptyString; + while (*ptr) + { + // found a separator between namespace prefix and localName + if (*ptr == ':') + { + // handle case of ":name" + if (ptr == tagName) + { + toplevel->throwTypeError(kXMLBadQName, core->toErrorString(tagName)); + } + + *localName = (ptr + 1); + if (!*localName) + { + // throw error - badly formed prefix:localName pair + // where is the localName? + toplevel->throwTypeError(kXMLBadQName, core->toErrorString(tagName)); + } + + prefix = core->internAlloc (tagName, (ptr - tagName)); + break; + } + + ptr++; + } + + // An attribute without a prefix is unqualified and does not inherit a namespace + // from its parent. + if (bAttribute && prefix == core->kEmptyString) + return 0; + + // search all in scope namespaces for a matching prefix. If we find one + // return that prefix, otherwise we need to throw an error. + E4XNode *y = this; + while (y) + { + for (uint32 i = 0; i < y->numNamespaces(); i++) + { + Namespace *ns = AvmCore::atomToNamespace (y->getNamespaces()->getAt(i)); + if (((prefix == core->kEmptyString) && !ns->hasPrefix()) || + (prefix->atom() == ns->getPrefix())) + { + return ns; + } + } + + y = y->m_parent; + } + + if (prefix == toplevel->xmlClass()->kXml) + { + return toplevel->xmlClass()->nsXML; + } + + // throw error because we didn't match this prefix + if (prefix != core->kEmptyString) + { + toplevel->throwTypeError(kXMLPrefixNotBound, prefix, core->toErrorString(tagName)); + } + return 0; + } + + void E4XNode::BuildInScopeNamespaceList (AvmCore* /*core*/, AtomArray *inScopeNS) const + { + const E4XNode *y = this; + while (y) + { + for (uint32 i = 0; i < y->numNamespaces(); i++) + { + Namespace *ns1 = AvmCore::atomToNamespace (y->getNamespaces()->getAt(i)); + uint32 j; + for (j = 0; j < inScopeNS->getLength(); j++) + { + Namespace *ns2 = AvmCore::atomToNamespace (inScopeNS->getAt(j)); + if (ns1->getPrefix() == undefinedAtom) + { + if (ns1->getURI() == ns2->getURI()) + break; + } + else + { + if (ns1->getPrefix() == ns2->getPrefix()) + break; + } + } + + if (j == inScopeNS->getLength()) // no match + { +#ifdef STRING_DEBUG + Stringp u = ns1->getURI(); + Stringp p = core->string(ns1->getPrefix()); +#endif + inScopeNS->push (ns1->atom()); + } + } + + y = y->m_parent; + } + } + + void E4XNode::addAttribute (E4XNode* /*x*/) + { + AvmAssert(0); + } + + void ElementE4XNode::addAttribute (E4XNode *x) + { + if (!m_attributes) + m_attributes = new (gc()) AtomArray (1); + + m_attributes->push (AvmCore::gcObjectToAtom(x)); + } + + void ElementE4XNode::CopyAttributesAndNamespaces(AvmCore *core, Toplevel *toplevel, XMLTag& tag, const wchar *elementName) + { + m_attributes = 0; + m_namespaces = 0; + + uint32 numAttr = 0; + + // We first handle namespaces because the a attribute tag can reference a namespace + // defined farther on in the same node... + // ... + uint32 index = 0; + Stringp attributeName, attributeValue; + while (tag.nextAttribute(index, attributeName, attributeValue)) + { + wchar *xmlns = stripPrefix (attributeName->c_str(), "xmlns"); + if (xmlns) // a namespace xnlns:prefix="URI" or xmlns="URI" + { + wchar *prefix = 0; + if (xmlns[0] == ':') + { + // handle case of ":name" + if (xmlns == attributeName->c_str()) + { + toplevel->throwTypeError(kXMLBadQName, attributeName); + } + + prefix = xmlns + 1; + if (!prefix[0]) + { + // throw exception because of badly formed XML??? + toplevel->throwTypeError(kXMLBadQName, attributeName); + } + } + + Namespace *ns; + if (prefix) + { + Stringp prefixs = core->internAlloc (prefix, String::Length(prefix)); + ns = core->newNamespace (prefixs->atom(), attributeValue->atom()); + } + else + { + ns = core->newNamespace (core->kEmptyString->atom(), attributeValue->atom()); + } + // !!@ Don't intern these namespaces since the intern table ignores + // the prefix value of the namespace. + this->_addInScopeNamespace (core, ns); + } + else + { + numAttr++; + } + } + + if (!numAttr) + return; + + m_attributes = new (core->GetGC()) AtomArray (numAttr); + + // Now we read the attributes + index = 0; + while (tag.nextAttribute(index, attributeName, attributeValue)) + { + wchar *xmlns = stripPrefix (attributeName->c_str(), "xmlns"); + if (!xmlns) // it's an attribute + { + // !!@ intern our attributeValue?? + E4XNode *attrObj = new (core->GetGC()) AttributeE4XNode(this, attributeValue); + + const wchar *localName = attributeName->c_str(); + Namespace *ns = this->FindNamespace (core, toplevel, attributeName->c_str(), &localName, true); + if (!ns) + ns = core->publicNamespace; + Stringp name = core->internAlloc (localName, String::Length(localName)); + + attrObj->setQName(core, name, ns); + + // check for a duplicate attribute here and throw a kXMLDuplicateAttribute if found + + Multiname m2; + attrObj->getQName (core, &m2); + for (unsigned int i = 0; i < numAttributes(); i++) + { + E4XNode *curAttr = (E4XNode *) (AvmCore::atomToGCObject(m_attributes->getAt(i))); + Multiname m; + curAttr->getQName (core, &m); + if (m.matches (&m2)) + { + toplevel->typeErrorClass()->throwError(kXMLDuplicateAttribute, attributeName, core->toErrorString(elementName), core->toErrorString(String::Length(elementName))); + } + } + + m_attributes->push (AvmCore::gcObjectToAtom(attrObj)); + } + } + } + + ////////////////////////////////////////////////////////////////////// + // E4X Section 9.1.1 + ////////////////////////////////////////////////////////////////////// + + // E4X 9.1.1.4, pg 15 + void E4XNode::_deleteByIndex (uint32 i) + { + if ((i >= 0) && (i < numChildren())) + { + E4XNode *x = _getAt(i); + if (x) + { + x->m_parent = NULL; + } + + removeChild (i); + AvmAssert(numChildren() ^ 0x80000000); // check for underflow + } + } + + // E4X 9.1.1.7, page 16 + E4XNode *E4XNode::_deepCopy (AvmCore *core, Toplevel *toplevel) const + { + E4XNode *x = 0; + switch (this->getClass()) + { + case kAttribute: + x = new (core->GetGC()) AttributeE4XNode (0, getValue()); + break; + case kText: + x = new (core->GetGC()) TextE4XNode (0, getValue()); + break; + case kCDATA: + x = new (core->GetGC()) CDATAE4XNode (0, getValue()); + break; + case kComment: + x = new (core->GetGC()) CommentE4XNode (0, getValue()); + break; + case kProcessingInstruction: + x = new (core->GetGC()) PIE4XNode (0, getValue()); + break; + case kElement: + x = new (core->GetGC()) ElementE4XNode (0); + break; + } + + Multiname m; + if (this->getQName (core, &m)) + { + x->setQName (core, &m); + } + + if (x->getClass() == kElement) + { + ElementE4XNode *y = (ElementE4XNode *) x; + + // step 2 - for each ns in inScopeNamespaces + if (numNamespaces()) + { + y->m_namespaces = new (core->GetGC()) AtomArray (numNamespaces()); + uint32 i; + for (i = 0; i < numNamespaces(); i++) + { + y->m_namespaces->push(getNamespaces()->getAt(i)); + } + } + + // step 3 - duplicate attribute nodes + if (numAttributes()) + { + y->m_attributes = new (core->GetGC()) AtomArray (numAttributes()); + uint32 i; + for (i = 0; i < numAttributes(); i++) + { + E4XNode *ax = getAttribute (i); + E4XNode *bx = ax->_deepCopy(core, toplevel); + bx->setParent(y); + y->addAttribute(bx); + } + } + + // step 4 - duplicate children + if (numChildren()) + { + AvmAssert(y->m_children == 0); + y->m_children = int(new (core->GetGC()) AtomArray (numChildren())); + for (uint32 k = 0; k < _length(); k++) + { + E4XNode *child = _getAt(k); + if (((child->getClass() == E4XNode::kComment) && toplevel->xmlClass()->getIgnoreComments()) || + ((child->getClass() == E4XNode::kProcessingInstruction) && toplevel->xmlClass()->getIgnoreProcessingInstructions())) + { + continue; + } + + E4XNode *cx = child->_deepCopy (core, toplevel); + cx->setParent (y); + //y->m_children->push (c); + y->_append (cx); + } + } + } + + return x; + } + +#if 0 + // E4X 9.1.1.8, page 17 + Atom E4XNode::descendants(Atom P) const + { + Multiname m; + toplevel->ToXMLName (P, m); + return getDescendants (&m); + } +#endif + + // E4X 9.1.1.9, page 17 + Atom E4XNode::_equals(AvmCore *core, E4XNode *v) const + { + if (this == v) + return trueAtom; + + if (this->getClass() != v->getClass()) + return falseAtom; + + Multiname m; + Multiname m2; + if (this->getQName(core, &m)) + { + if (v->getQName(core, &m2) == 0) + return falseAtom; + + // QName/AttributeName comparision here + if (!m.matches (&m2)) + return falseAtom; + } + else if (v->getQName(core, &m2) != 0) + { + return falseAtom; + } + +// Not enabled after discussion with JeffD. If the namespaces are important, they're +// used in the node names themselves. +#if 0 + // NOT part of the original spec. Added in later (bug 144429) + if (this->numNamespaces() != v->numNamespaces()) + return falseAtom; + + // Order of namespaces does not matter + AtomArray *ns1 = getNamespaces(); + AtomArray *ns2 = v->getNamespaces(); + for (uint32 n1 = 0; n1 < numNamespaces(); n1++) + { + Namespace *namespace1 = core->atomToNamespace (ns1->getAt (n1)); + for (uint32 n2 = 0; n2 < numNamespaces(); n2++) + { + Namespace *namespace2 = core->atomToNamespace (ns2->getAt (n2)); + if (namespace1->equalTo (namespace2)) + break; + } + + // A match was not found + if (n2 == numNamespaces()) + return falseAtom; + } +#endif + + if (this->numAttributes() != v->numAttributes()) + return falseAtom; + + if (this->numChildren() != v->numChildren()) + return falseAtom; + + if (this->getValue() != v->getValue() && + (this->getValue()==NULL || v->getValue()==NULL || *getValue() != *v->getValue())) + return falseAtom; + + // step 8 + // for each a in x.attributes + // if v does not containing matching attribute, return failure + for (uint32 k1 = 0; k1 < numAttributes(); k1++) + { + E4XNode *x1 = getAttribute(k1); + bool bFoundMatch = false; + for (uint32 k2 = 0; k2 < v->numAttributes(); k2++) + { + if (x1->_equals (core, v->getAttribute(k2)) == trueAtom) + { + bFoundMatch = true; + break; + } + } + + if (!bFoundMatch) + return falseAtom; + } + + // step 9 + for (uint32 i = 0; i < _length(); i++) + { + E4XNode *x1 = _getAt(i); + E4XNode *x2 = v->_getAt(i); + if (x1->_equals (core, x2) == falseAtom) + return falseAtom; + } + + return trueAtom; + } + + // E4X 9.1.1.11, page 18 + void E4XNode::_insert (AvmCore* /*core*/, Toplevel* /*toplevel*/, uint32 /*entry*/, Atom /*value*/) + { + return; + } + + void ElementE4XNode::_insert (AvmCore *core, Toplevel *toplevel, uint32 entry, Atom value) + { +// //step 1 +// if (m_class & (kText | kCDATA | kComment | kProcessingInstruction | kAttribute)) +// return; + + // Spec says to throw a typeError if entry is not a number + // We handle that in callingn functions + + uint32 n = 1; + XMLListObject *xl = core->atomToXMLList (value); + if (xl) + { + n = xl->_length(); + } + else + { + E4XNode *x = core->atomToXML (value); + if (x) + { + E4XNode *n = this; + while (n) + { + if (x == n) + toplevel->throwTypeError(kXMLIllegalCyclicalLoop); + n = n->getParent(); + } + + } + } + + if (n == 0) + return; + + if (!m_children) + { + m_children = int(new (core->GetGC()) AtomArray (n)); + } + + if (xl) + { + // insert each element of our XMLList into our array + for (uint32 j = 0; j < xl->_length(); j++) + { + E4XNode *child = core->atomToXML (xl->_getAt (j)->atom()); + + // !!@ Not in spec but seems like a good idea + E4XNode *n = this; + while (n) + { + if (child == n) + toplevel->throwTypeError(kXMLIllegalCyclicalLoop); + n = n->getParent(); + } + + child->setParent(this); + + insertChild (entry + j, child); + } + } + else + { + insertChild (entry, 0); // make room for our replace + this->_replace (core, toplevel, entry, value); + } + + return; + } + + // E4X 9.1.1.12, page 19 + // Autoconverts V into an XML object + E4XNode* E4XNode::_replace (AvmCore* /*core*/, Toplevel* /*toplevel*/, uint32 /*i*/, Atom /*V*/) + { + return 0; + } + + E4XNode* ElementE4XNode::_replace (AvmCore *core, Toplevel *toplevel, uint32 i, Atom V) + { + //step 1 + //if (getClass() & (kText | kCDATA | kComment | kProcessingInstruction | kAttribute)) + // return; + + // step 2 + 3 + // API throws a typeError if entry is not a number + // This is always handled back in the caller. + + // step 4 + if (i >= _length()) + { + i = _length(); + // add a blank spot for this child + if (!m_children) + m_children = int(new (core->GetGC()) AtomArray (1)); + convertToAtomArray(); + AtomArray *aa = ((AtomArray *)(int)m_children); + aa->push (Atom(0)); + } + + E4XNode *prior = _getAt(i); + + // step 5 + E4XNode *xml = core->atomToXML (V); + if (xml && (xml->getClass() & (kElement | kComment | kProcessingInstruction | kText | kCDATA))) + { + //a. If V.[[Class]] is "element" and (V is x or an ancestor of x) throw an Error exception + if (xml->getClass() == kElement) + { + E4XNode *n = this; + while (n) + { + if (xml == n) + toplevel->throwTypeError(kXMLIllegalCyclicalLoop); + n = n->getParent(); + } + } + + xml->setParent (this); + if ((i >= 0) && (i < this->numChildren())) + { + if (prior) + { + prior->setParent (NULL); + } + } + + this->setChildAt (i, xml); + } + else if (core->atomToXMLList (V)) + { + _deleteByIndex (i); + _insert (core, toplevel, i, V); + } + else + { + Stringp s = core->string(V); + E4XNode *newXML = new (core->GetGC()) TextE4XNode(this, s); + // if this[i] is going away, clear its parent + if (prior) + { + prior->setParent (NULL); + } + + setChildAt (i, newXML); + + if (XMLObject::notifyNeeded(newXML)) + { + Atom detail = prior ? prior->getValue()->atom() : NULL; + XMLObject* target = new (core->GetGC()) XMLObject(toplevel->xmlClass(), newXML); + target->nonChildChanges(toplevel->xmlClass()->kTextSet, newXML->getValue()->atom(), detail); + } + } + + return prior; + } + + void ElementE4XNode::setNotification(AvmCore *core, ScriptObject* f) + { + int nameOrAux = m_nameOrAux; + // We already have an aux structure + if (AUXBIT & nameOrAux) + { + E4XNodeAux *aux = (E4XNodeAux *)(nameOrAux & ~AUXBIT); + aux->m_notification = f; + } + // allocate one to hold our name and notification atom + else + { + Stringp str = (String *)(nameOrAux); + E4XNodeAux *aux = new (core->GetGC()) E4XNodeAux (str, core->publicNamespace, f); + //m_nameOrAux = AUXBIT | int(aux); + WB(core->GetGC(), this, &m_nameOrAux, AUXBIT | int(aux)); + } + } + + ScriptObject* ElementE4XNode::getNotification() const + { + int nameOrAux = m_nameOrAux; + if (AUXBIT & m_nameOrAux) + { + E4XNodeAux *aux = (E4XNodeAux *)(nameOrAux & ~AUXBIT); + return aux->m_notification; + } + + return 0; + } + +} + diff --git a/mozilla/js/tamarin/core/E4XNode.h b/mozilla/js/tamarin/core/E4XNode.h new file mode 100644 index 00000000000..ec1ff05d918 --- /dev/null +++ b/mozilla/js/tamarin/core/E4XNode.h @@ -0,0 +1,356 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_E4XNode__ +#define __avmplus_E4XNode__ + + +// E4X 9.1.1 Internal Properties and Methods +// Name +// Parent +// Attributes +// InScopeNamespaces +// Length +// Delete (overrides Object version) +// Get (overrides Object version) +// HasProperty (overrides Object version) +// Put (overrides Object version) +// DeleteByIndex (PropertyName) +// DeepCopy +// ResolveValue +// Descendants (PropertyName) +// Equals (Value) +// Insert (PropertyName, Value) +// Replace (PropertyName, Value) +// AddInScopeNamespace (Namespace) + +// These are static objects on the XML type +// E4X: The XML constructor has the following properties +// XML.ignoreComments +// XML.ignoreProcessingInstructions +// XML.ignoreWhitespace +// XML.prettyPrinting +// XML.prettyIndent +// XML.settings +// XML.setSettings ([settings]) +// XML.defaultSettings() + +// XML.prototype.constructor ?? +// XML.prototype.addNamespace +// XML.prototype.appendChild +// XML.prototype.attribute +// XML.prototype.attributes +// XML.prototype.child +// XML.prototype.childIndex +// XML.prototype.children +// XML.prototype.comments +// XML.prototype.contains +// XML.prototype.copy +// XML.prototype.descendants +// XML.prototype.elements +// XML.prototype.hasOwnProperty +// XML.prototype.hasComplexContent +// XML.prototype.hasSimpleContent +// XML.prototype.inScopeNamespaces +// XML.prototype.insertChildAfter +// XML.prototype.insertChildBefore +// XML.prototype.length +// XML.prototype.localName +// XML.prototype.name +// XML.prototype.namespace +// XML.prototype.namespaceDeclarations +// XML.prototype.nodeKind +// XML.prototype.normalize +// XML.prototype.parent +// XML.prototype.processingInstructions +// XML.prototype.prependChild +// XML.prototype.propertyIsEnumerable +// XML.prototype.removeNamespace +// XML.prototype.replace +// XML.prototype.setChildren +// XML.prototype.setLocalName +// XML.prototype.setName +// XML.prototype.setNamespace +// XML.prototype.text +// XML.prototype.toString +// XML.prototype.toXMLString +// XML.prototype.valueOf + +namespace avmplus +{ + class E4XNodeAux : public MMgc::GCObject + { + DRCWB(Stringp) m_name; + DRCWB(Namespace*) m_ns; + + /** callback on changes to children, attribute, name or namespace */ + DRCWB(ScriptObject*) m_notification; + + friend class E4XNode; + friend class ElementE4XNode; + + public: + E4XNodeAux (Stringp s, Namespace *ns, ScriptObject* notify=0); + }; + + /////////////////////////////////////////////////// + /////////////////////////////////////////////////// + /** + * E4XNode is the C++ implementation of the XML class + * in the E4X Specification. + */ + // Currently this is 12-bytes in size (4 bytes wasted by GC) + // Element nodes are 24 bytes + // All other nodes are 16 bytes + class E4XNode : public MMgc::GCObject + { + protected: + + /** Either null or an E4XNode, valid for all node types */ + E4XNode * m_parent; + + // If this is a simple name with no namespace or notification function, + // we just have a string pointer. Otherwise, we're a E4XNodeAux value + // containing a name + namespace as well as a notification function. + // E4XNodeAux * + // String * + int m_nameOrAux; + #define AUXBIT 0x1 + + public: + E4XNode (E4XNode *parent) : m_parent(parent), m_nameOrAux(0) { } + // we have virtual functions, so we probably need a virtual dtor + virtual ~E4XNode() {} + + bool getQName (AvmCore *core, Multiname *mn) const; + void setQName (AvmCore *core, Stringp name, Namespace *ns = 0); + void setQName (AvmCore *core, Multiname *mn); + + virtual Stringp getValue() const = 0; + virtual void setValue (String *s) = 0; + + E4XNode *getParent() const { return m_parent; }; + void setParent (E4XNode *n) { WB(MMgc::GC::GetGC(this), this, &m_parent, n); } + + // Not used as bit fields (only one bit at a time can be set) but + // used for fast multi-type compares. + enum NodeTypes + { + kUnknown = 0x0001, + kAttribute = 0x0002, + kText = 0x0004, + kCDATA = 0x0008, // same as text but no string conversion on output + kComment = 0x0010, + kProcessingInstruction = 0x0020, + kElement = 0x0040, + }; + + virtual int getClass() const = 0; + + virtual uint32 numAttributes() const { return 0; }; + virtual AtomArray *getAttributes() const { return 0; }; + virtual E4XNode *getAttribute(uint32 /*index*/) const { return NULL; }; + + virtual uint32 numNamespaces() const { return 0; }; + virtual AtomArray *getNamespaces() const { return 0; }; + + virtual uint32 numChildren() const { return 0; }; + virtual E4XNode *_getAt(uint32 /*i*/) const { return 0; }; + + virtual void clearChildren() {}; + virtual void setChildAt (uint32 /*i*/, E4XNode* /*x*/) {}; + virtual void insertChild (uint32 /*i*/, E4XNode* /*x*/) {}; + virtual void removeChild (uint32 /*i*/) {}; + virtual void convertToAtomArray() {}; + + virtual void addAttribute (E4XNode *x); + + // Should this silently fail or assert? + virtual void setNotification(AvmCore* /*core*/, ScriptObject* /*f*/) { return; } + virtual ScriptObject* getNotification() const { return 0; } + + // used to determine child number in notifications + virtual uint32 childIndex() const { return 0; }; + + // The following routines are E4X support routines + + // Private functions not exposed to AS + // DeleteByIndex (PropertyName) + // DeepCopy + // ResolveValue + // Descendants (PropertyName) + // Equals (Value) + // Insert (PropertyName, Value) + // Replace (PropertyName, Value) + // AddInScopeNamespace (Namespace) + + // Corresponds to [[Length]] in the docs + virtual uint32 _length() const { return 0; }; + + Atom _equals (AvmCore *core, E4XNode *value) const; + + void _deleteByIndex (uint32 entry); + E4XNode *_deepCopy (AvmCore *core, Toplevel *toplevel) const; + virtual void _insert (AvmCore *core, Toplevel *toplevel, uint32 entry, Atom value); + virtual E4XNode* _replace (AvmCore *core, Toplevel *toplevel, uint32 entry, Atom value); + virtual void _addInScopeNamespace (AvmCore *core, Namespace *ns); + virtual void _append (E4XNode* /*childNode*/) { AvmAssert(0); }; + + Namespace *FindNamespace (AvmCore *core, Toplevel *toplevel, const wchar *tagName, const wchar **localName, bool bAttribute); + int FindMatchingNamespace (AvmCore *core, Namespace *ns); + + void BuildInScopeNamespaceList (AvmCore *core, AtomArray *list) const; + + MMgc::GC *gc() const { return MMgc::GC::GetGC(this); } + }; + + class TextE4XNode : public E4XNode + { + DRCWB(Stringp) m_value; + + public: + TextE4XNode (E4XNode *parent, String *value); + + int getClass() const { return kText; }; + Stringp getValue() const { return m_value; }; + void setValue (String *s) { m_value = s; } + }; + + class CommentE4XNode : public E4XNode + { + DRCWB(Stringp) m_value; + + public: + CommentE4XNode (E4XNode *parent, String *value); + + int getClass() const { return kComment; }; + Stringp getValue() const { return m_value; }; + void setValue (String *s) { m_value = s; } + }; + + class AttributeE4XNode : public E4XNode + { + DRCWB(Stringp) m_value; + + public: + AttributeE4XNode (E4XNode *parent, String *value); + + int getClass() const { return kAttribute; }; + Stringp getValue() const { return m_value; }; + void setValue (String *s) { m_value = s; } + }; + + class CDATAE4XNode : public E4XNode + { + DRCWB(Stringp) m_value; + + public: + CDATAE4XNode (E4XNode *parent, String *value); + + int getClass() const { return kCDATA; }; + Stringp getValue() const { return m_value; }; + void setValue (String *s) { m_value = s; } + }; + + class PIE4XNode : public E4XNode + { + /** only when m_class != kElement */ + DRCWB(Stringp) m_value; + + public: + PIE4XNode (E4XNode *parent, String *value); + + int getClass() const { return kProcessingInstruction; }; + Stringp getValue() const { return m_value; }; + void setValue (String *s) { m_value = s; } + }; + + // Currently this is 24-bytes in size + class ElementE4XNode : public E4XNode + { + // This stores E4XNode pointers and NOT Atoms + DWB(AtomArray *) m_attributes; + + // This stores Atoms (atom-ized Namespace pointers) + DWB(AtomArray *) m_namespaces; + + // If the low bit of this integer is set, this value points directly + // to a single child (one E4XNode *). If there are multiple children, + // this points to an AtomArray containing E4XNode pointers (NOT Atoms) + DWB(int) m_children; + #define SINGLECHILDBIT 0x1 + + friend class E4XNode; + + public: + ElementE4XNode (E4XNode *parent); + int getClass() const { return kElement; }; + + uint32 numAttributes() const { return (m_attributes ? m_attributes->getLength() : 0); }; + AtomArray *getAttributes() const { return m_attributes; }; + E4XNode *getAttribute(uint32 index) const { return (E4XNode *)AvmCore::atomToGCObject(m_attributes->getAt(index)); }; + void addAttribute (E4XNode *x); + + uint32 numNamespaces() const { return (m_namespaces ? m_namespaces->getLength() : 0); }; + AtomArray *getNamespaces() const { return m_namespaces; }; + + uint32 numChildren() const;// { return (m_children ? m_children->getLength() : 0); }; + + void clearChildren(); + void setChildAt (uint32 i, E4XNode *x); + #define SINGLECHILDBIT 0x1 + void insertChild (uint32 i, E4XNode *x); + void removeChild (uint32 i); + void convertToAtomArray(); + + Stringp getValue() const { return 0; }; + void setValue (String *s) { (void)s; AvmAssert(s == 0); } + + void setNotification(AvmCore *core, ScriptObject* f); + ScriptObject* getNotification() const; + + // used to determine child number in notifications + uint32 childIndex() const; + + // E4X support routines below + uint32 _length() const { return numChildren(); }; + E4XNode *_getAt(uint32 i) const; + + void _append (E4XNode *childNode); + + void _addInScopeNamespace (AvmCore *core, Namespace *ns); + void _insert (AvmCore *core, Toplevel *toplevel, uint32 entry, Atom value); + E4XNode* _replace (AvmCore *core, Toplevel *toplevel, uint32 entry, Atom value); + + void CopyAttributesAndNamespaces(AvmCore *core, Toplevel *toplevel, XMLTag& tag, const wchar *elementName); + }; +} +#endif /* __avmplus_E4XNode__ */ diff --git a/mozilla/js/tamarin/core/Error.as b/mozilla/js/tamarin/core/Error.as new file mode 100644 index 00000000000..bdb83d72a0e --- /dev/null +++ b/mozilla/js/tamarin/core/Error.as @@ -0,0 +1,262 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +package +{ + public dynamic class Error + { + prototype.name = "Error" + prototype.message = "Error" + + // Error.length = 1 per ES3 + // E262 {ReadOnly, DontDelete, DontEnum } + public static const length:int = 1 + + // TODO mark message as String once compiler super() bug is fixed + // E262 {} + /* enumerable */ public var message; + public var name; + + // JS Error has these props: + // message:String + // fileName:String + // lineNumber:String + // stack:String + // name:String + + function Error(message = "", id = 0) + { + this.message = message; + this._errorID = id; + this.name = prototype.name; + } + + prototype.toString = function():String + { + var e:Error = this + return e.message !== "" ? e.name + ": " + e.message : e.name; + } + _setPropertyIsEnumerable(prototype, "toString", false); + + // avm+ specific, works in debugger builds only + public native function getStackTrace():String; + public native static function getErrorMessage(index:int):String; + + // avm+ specific utility method + public static function throwError(type:Class, index:uint, ... rest) + { + // This implements the same error string formatting as the native + // method PrintWriter::formatP(...) any changes to this method should + // also be made there to keep the two in sync. + var i=0; + var f=function(match, pos, string) + { + var arg_num = -1; + switch(match.charAt(1)) + { + case '1': + arg_num = 0; + break; + case '2': + arg_num = 1; + break; + case '3': + arg_num = 2; + break; + case '4': + arg_num = 3; + break; + case '5': + arg_num = 4; + break; + case '6': + arg_num = 5; + break; + } + if( arg_num > -1 && rest.length > arg_num ) + return rest[arg_num]; + else + return ""; + } + throw new type(Error.getErrorMessage(index).replace(/%[0-9]/g, f)); + } + + private var _errorID : int; + + public function get errorID() : int + { + return this._errorID; + } + } + + public dynamic class DefinitionError extends Error + { + // E262 {ReadOnly, DontDelete, DontEnum } + public static const length:int = 1 + + prototype.name = "DefinitionError" + function DefinitionError(message = "", id = 0) + { + super(message, id); + this.name = prototype.name; + } + } + + public dynamic class EvalError extends Error + { + // E262 {ReadOnly, DontDelete, DontEnum } + public static const length:int = 1 + + prototype.name = "EvalError" + function EvalError(message = "", id = 0) + { + super(message, id); + this.name = prototype.name; + } + } + + public dynamic class RangeError extends Error + { + // E262 {ReadOnly, DontDelete, DontEnum } + public static const length:int = 1 + + prototype.name = "RangeError" + function RangeError(message = "", id = 0) + { + super(message, id); + this.name = prototype.name; + } + } + + public dynamic class ReferenceError extends Error + { + // E262 {ReadOnly, DontDelete, DontEnum } + public static const length:int = 1 + + prototype.name = "ReferenceError" + function ReferenceError(message = "", id = 0) + { + super(message, id); + this.name = prototype.name; + } + } + + public dynamic class SecurityError extends Error + { + // E262 {ReadOnly, DontDelete, DontEnum } + public static const length:int = 1 + + prototype.name = "SecurityError" + function SecurityError(message = "", id = 0) + { + super(message, id); + this.name = prototype.name; + } + } + + public dynamic class SyntaxError extends Error + { + // E262 {ReadOnly, DontDelete, DontEnum } + public static const length:int = 1 + + prototype.name = "SyntaxError" + function SyntaxError(message = "", id = 0) + { + super(message, id); + this.name = prototype.name; + } + } + + public dynamic class TypeError extends Error + { + // E262 {ReadOnly, DontDelete, DontEnum } + public static const length:int = 1 + + prototype.name = "TypeError" + function TypeError(message = "", id = 0) + { + super(message, id); + this.name = prototype.name; + } + } + + public dynamic class URIError extends Error + { + // E262 {ReadOnly, DontDelete, DontEnum } + public static const length:int = 1 + + prototype.name = "URIError" + function URIError(message = "", id = 0) + { + super(message, id); + this.name = prototype.name; + } + } + + public dynamic class VerifyError extends Error + { + // E262 {ReadOnly, DontDelete, DontEnum } + public static const length:int = 1 + + prototype.name = "VerifyError" + function VerifyError(message = "", id = 0) + { + super(message, id); + this.name = prototype.name; + } + } + + public dynamic class UninitializedError extends Error + { + // E262 {ReadOnly, DontDelete, DontEnum } + public static const length:int = 1 + + prototype.name = "UninitializedError" + function UninitializedError(message = "", id = 0) + { + super(message, id); + this.name = prototype.name; + } + } + + public dynamic class ArgumentError extends Error + { + // E262 {ReadOnly, DontDelete, DontEnum } + public static const length:int = 1 + + prototype.name = "ArgumentError" + function ArgumentError(message = "", id = 0) + { + super(message, id); + this.name = prototype.name; + } + } +} diff --git a/mozilla/js/tamarin/core/ErrorClass.cpp b/mozilla/js/tamarin/core/ErrorClass.cpp new file mode 100644 index 00000000000..8196b5e6ef1 --- /dev/null +++ b/mozilla/js/tamarin/core/ErrorClass.cpp @@ -0,0 +1,115 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmplus.h" + +namespace avmplus +{ + BEGIN_NATIVE_MAP(ErrorClass) + NATIVE_METHOD(Error_getStackTrace, ErrorObject::stackTraceToString) + NATIVE_METHOD(Error_getErrorMessage, ErrorClass::getErrorMessage) + END_NATIVE_MAP() + + ErrorClass::ErrorClass(VTable* cvtable) + : ClassClosure(cvtable) + { + AvmAssert(traits()->sizeofInstance == sizeof(ErrorClass)); + + prototype = createInstance(ivtable(), toplevel()->objectClass->prototype); + } + + /** + * ErrorObject + */ + ErrorObject::ErrorObject(VTable* vtable, + ScriptObject *delegate) + : ScriptObject(vtable, delegate) + { + AvmAssert(traits()->sizeofInstance == sizeof(ErrorObject)); + + #ifdef DEBUGGER + AvmCore *core = this->core(); + // Copy the stack trace + stackTrace = core->newStackTrace(); + #endif + } + + void ErrorClass::throwError(int errorID, Stringp arg1, Stringp arg2, Stringp arg3) + { + core()->throwErrorV(this, errorID, arg1, arg2, arg3); + } + + Stringp ErrorObject::stackTraceToString() const + { + #ifdef DEBUGGER + AvmCore* core = this->core(); + + // getStackTrace returns the concatenation of the + // error message and the stack trace + Stringp buffer = core->string(atom()); + buffer = core->concatStrings(buffer, core->newString("\n")); + + if (stackTrace) { + buffer = core->concatStrings(buffer, stackTrace->format(core)); + } + + return buffer; + #else + return NULL; + #endif + } + + Stringp ErrorClass::getErrorMessage(int errorID) const + { + return this->core()->getErrorMessage(errorID); + } + + ScriptObject* ErrorClass::createInstance(VTable *ivtable, + ScriptObject *prototype) + { + return new (ivtable->gc(), ivtable->getExtraSize()) ErrorObject(ivtable, prototype); + } + + /** + * NativeErrorClass + */ + + BEGIN_NATIVE_MAP(NativeErrorClass) + END_NATIVE_MAP() + + NativeErrorClass::NativeErrorClass(VTable* cvtable) + : ClassClosure(cvtable) + { + AvmAssert(traits()->sizeofInstance == sizeof(ErrorClass)); + createVanillaPrototype(); + } +} diff --git a/mozilla/js/tamarin/core/ErrorClass.h b/mozilla/js/tamarin/core/ErrorClass.h new file mode 100644 index 00000000000..0ea469f6f61 --- /dev/null +++ b/mozilla/js/tamarin/core/ErrorClass.h @@ -0,0 +1,120 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_ErrorClass__ +#define __avmplus_ErrorClass__ + + +namespace avmplus +{ + /** + * class Error + */ + class ErrorClass : public ClassClosure + { + public: + DECLARE_NATIVE_MAP(ErrorClass) + ErrorClass(VTable* cvtable); + + Atom call(int argc, Atom* argv) + { + return construct(argc, argv); + } + + ScriptObject *createInstance(VTable *ivtable, ScriptObject *delegate); + + + /** + * throwError is a convenience function for throwing + * an exception with a formatted error message, + * printf-style + */ + void throwError(int errorID, Stringp arg1=0, Stringp arg2=0, Stringp arg3=0); + + /** @name static methods */ + /*@{*/ + Stringp getErrorMessage(int errorID) const; +#ifdef DEBUGGER + Atom getStackTrace(Atom thisAtom, + Atom *argv, + int argc); +#endif /* DEBUGGER */ + }; + + /** + * The ErrorObject class is the C++ implementation of the + * Error class in the ECMA-262 Specification. + * + * The main difference between an ErrorObject and a regular + * ScriptObject is the presence of the stack trace, which + * can be retrieved with the getStackTrace method. + */ + class ErrorObject : public ScriptObject + { + public: + ErrorObject(VTable *vtable, ScriptObject *delegate); + ~ErrorObject() { +#ifdef DEBUGGER + stackTrace = 0; +#endif + } + + Stringp stackTraceToString() const; +#ifdef DEBUGGER + StackTrace *getStackTrace() const { return stackTrace; } + + private: + StackTrace *stackTrace; +#endif /* DEBUGGER */ + }; + + /** + * NativeErrorClass + * + * This class exists primarily to override the [[Call]] entry point + * to the class closure, so that it constructs an error object + * instead of attempting a coercion. + */ + class NativeErrorClass : public ClassClosure + { + public: + DECLARE_NATIVE_MAP(NativeErrorClass) + + NativeErrorClass(VTable* cvtable); + + Atom call(int argc, Atom* argv) + { + return construct(argc, argv); + } + }; +} + +#endif /* __avmplus_ErrorClass__ */ diff --git a/mozilla/js/tamarin/core/ErrorConstants.as b/mozilla/js/tamarin/core/ErrorConstants.as new file mode 100644 index 00000000000..fed7fe94589 --- /dev/null +++ b/mozilla/js/tamarin/core/ErrorConstants.as @@ -0,0 +1,168 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +/** + * Errors defines the ID's of error messages output + * by the Debugger verisons of the Player + */ +class Errors +{ + public static const kOutOfMemoryError = 1000; + public static const kNotImplementedError = 1001; + public static const kInvalidPrecisionError = 1002; + public static const kInvalidRadixError = 1003; + public static const kInvokeOnIncompatibleObjectError = 1004; + public static const kArrayIndexNotIntegerError = 1005; + public static const kCallOfNonFunctionError = 1006; + public static const kConstructOfNonFunctionError = 1007; + public static const kAmbiguousBindingError = 1008; + public static const kConvertNullToObjectError = 1009; + public static const kConvertUndefinedToObjectError = 1010; + public static const kIllegalOpcodeError = 1011; + public static const kLastInstExceedsCodeSizeError = 1012; + public static const kFindVarWithNoScopeError = 1013; + public static const kClassNotFoundError = 1014; + public static const kIllegalSetDxns = 1015; + public static const kDescendentsError = 1016; + public static const kScopeStackOverflowError = 1017; + public static const kScopeStackUnderflowError = 1018; + public static const kGetScopeObjectBoundsError = 1019; + public static const kCannotFallOffMethodError = 1020; + public static const kInvalidBranchTargetError = 1021; + public static const kIllegalVoidError = 1022; + public static const kStackOverflowError = 1023; + public static const kStackUnderflowError = 1024; + public static const kInvalidRegisterError = 1025; + public static const kSlotExceedsCountError = 1026; + public static const kMethodInfoExceedsCountError = 1027; + public static const kDispIdExceedsCountError = 1028; + public static const kDispIdUndefinedError = 1029; + public static const kStackDepthUnbalancedError = 1030; + public static const kScopeDepthUnbalancedError = 1031; + public static const kCpoolIndexRangeError = 1032; + public static const kCpoolEntryWrongTypeError = 1033; + public static const kCheckTypeFailedError = 1034; + public static const kIllegalSuperCallError = 1035; + public static const kCannotAssignToMethodError = 1037; + public static const kRedefinedError = 1038; + public static const kCannotVerifyUntilReferencedError = 1039; + public static const kCantUseInstanceofOnNonObjectError = 1040; + public static const kIsTypeMustBeClassError = 1041; + public static const kInvalidMagicError = 1042; + public static const kInvalidCodeLengthError = 1043; + public static const kInvalidMethodInfoFlagsError = 1044; + public static const kUnsupportedTraitsKindError = 1045; + public static const kMethodInfoOrderError = 1046; + public static const kMissingEntryPointError = 1047; + public static const kPrototypeTypeError = 1049; + public static const kConvertToPrimitiveError = 1050; + public static const kIllegalEarlyBindingError = 1051; + public static const kInvalidURIError = 1052; + public static const kIllegalOverrideError = 1053; + public static const kIllegalExceptionHandlerError = 1054; + public static const kWriteSealedError = 1056; + public static const kIllegalSlotError = 1057; + public static const kIllegalOperandTypeError = 1058; + public static const kClassInfoOrderError = 1059; + public static const kClassInfoExceedsCountError = 1060; + public static const kNumberOutOfRangeError = 1061; + public static const kWrongArgumentCountError = 1063; + public static const kCannotCallMethodAsConstructor = 1064; + public static const kUndefinedVarError = 1065; + public static const kFunctionConstructorError = 1066; + public static const kIllegalNativeMethodBodyError = 1067; + public static const kCannotMergeTypesError = 1068; + public static const kReadSealedError = 1069; + public static const kCallNotFoundError = 1070; + public static const kAlreadyBoundError = 1071; + public static const kZeroDispIdError = 1072; + public static const kDuplicateDispIdError = 1073; + public static const kConstWriteError = 1074; + public static const kMathNotFunctionError = 1075; + public static const kMathNotConstructorError = 1076; + public static const kWriteOnlyError = 1077; + public static const kIllegalOpMultinameError = 1078; + public static const kIllegalNativeMethodError = 1079; + public static const kIllegalNamespaceError = 1080; + public static const kReadSealedErrorNs = 1081; + public static const kNoDefaultNamespaceError = 1082; + public static const kXMLPrefixNotBound = 1083; + public static const kXMLBadQName = 1084; + public static const kXMLUnterminatedElementTag = 1085; + public static const kXMLOnlyWorksWithOneItemLists = 1086; + public static const kXMLAssignmentToIndexedXMLNotAllowed = 1087; + public static const kXMLMarkupMustBeWellFormed = 1088; + public static const kXMLAssigmentOneItemLists = 1089; + public static const kXMLMalformedElement = 1090; + public static const kXMLUnterminatedCData = 1091; + public static const kXMLUnterminatedXMLDecl = 1092; + public static const kXMLUnterminatedDocTypeDecl = 1093; + public static const kXMLUnterminatedComment = 1094; + public static const kXMLUnterminatedAttribute = 1095; + public static const kXMLUnterminatedElement = 1096; + public static const kXMLUnterminatedProcessingInstruction = 1097; + public static const kXMLNamespaceWithPrefixAndNoURI = 1098; + public static const kRegExpFlagsArgumentError = 1100; + public static const kNoScopeError = 1101; + public static const kIllegalDefaultValue = 1102; + public static const kCannotExtendFinalClass = 1103; + public static const kXMLDuplicateAttribute = 1104; + public static const kCorruptABCError = 1107; + public static const kInvalidBaseClassError = 1108; + public static const kDanglingFunctionError = 1109; + public static const kCannotExtendError = 1110; + public static const kCannotImplementError = 1111; + public static const kCoerceArgumentCountError = 1112; + public static const kInvalidNewActivationError = 1113; + public static const kNoGlobalScopeError = 1114; + public static const kNotConstructorError = 1115; + public static const kApplyError = 1116; + public static const kXMLInvalidName = 1117; + public static const kXMLIllegalCyclicalLoop = 1118; + public static const kDeleteTypeError = 1119; + public static const kDeleteSealedError = 1120; + public static const kDuplicateMethodBodyError = 1121; + public static const kIllegalInterfaceMethodBodyError = 1122; + public static const kFilterError = 1123; + public static const kInvalidHasNextError = 1124; + public static const kFileOpenError = 1500; + public static const kFileWriteError = 1501; + public static const kScriptTimeoutError = 1502; + public static const kScriptTerminatedError = 1503; + public static const kEndOfFileError = 1504; + public static const kStringIndexOutOfBoundsError = 1505; + public static const kInvalidRangeError = 1506; + public static const kNullArgumentError = 1507; + public static const kInvalidArgumentError = 1508; + public static const kShellCompressedDataError = 1509; + public static const kArrayFilterNonNullObjectError = 1510; +}; diff --git a/mozilla/js/tamarin/core/ErrorConstants.cpp b/mozilla/js/tamarin/core/ErrorConstants.cpp new file mode 100644 index 00000000000..67b8ebeb25a --- /dev/null +++ b/mozilla/js/tamarin/core/ErrorConstants.cpp @@ -0,0 +1,1381 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmplus.h" + +namespace avmplus +{ + namespace ErrorConstants + { + // Error message strings only in DEBUGGER builds. + #ifdef DEBUGGER + LangName languageNames[kLanguages] = + { + { "en", LANG_en }, + { "de", LANG_de }, + { "es", LANG_es }, + { "fr", LANG_fr }, + { "it", LANG_it }, + { "ja", LANG_ja }, + { "ko", LANG_ko }, + { "zh-CN", LANG_zh_CN }, + { "zh-TW", LANG_zh_TW }, + + }; + + int errorMappingTable[2*kNumErrorConstants] = + { + 1000, 0, + 1001, 1, + 1002, 2, + 1003, 3, + 1004, 4, + 1005, 5, + 1006, 6, + 1007, 7, + 1008, 8, + 1009, 9, + 1010, 10, + 1011, 11, + 1012, 12, + 1013, 13, + 1014, 14, + 1015, 15, + 1016, 16, + 1017, 17, + 1018, 18, + 1019, 19, + 1020, 20, + 1021, 21, + 1022, 22, + 1023, 23, + 1024, 24, + 1025, 25, + 1026, 26, + 1027, 27, + 1028, 28, + 1029, 29, + 1030, 30, + 1031, 31, + 1032, 32, + 1033, 33, + 1034, 34, + 1035, 35, + 1037, 36, + 1038, 37, + 1039, 38, + 1040, 39, + 1041, 40, + 1042, 41, + 1043, 42, + 1044, 43, + 1045, 44, + 1046, 45, + 1047, 46, + 1049, 47, + 1050, 48, + 1051, 49, + 1052, 50, + 1053, 51, + 1054, 52, + 1056, 53, + 1057, 54, + 1058, 55, + 1059, 56, + 1060, 57, + 1061, 58, + 1063, 59, + 1064, 60, + 1065, 61, + 1066, 62, + 1067, 63, + 1068, 64, + 1069, 65, + 1070, 66, + 1071, 67, + 1072, 68, + 1073, 69, + 1074, 70, + 1075, 71, + 1076, 72, + 1077, 73, + 1078, 74, + 1079, 75, + 1080, 76, + 1081, 77, + 1082, 78, + 1083, 79, + 1084, 80, + 1085, 81, + 1086, 82, + 1087, 83, + 1088, 84, + 1089, 85, + 1090, 86, + 1091, 87, + 1092, 88, + 1093, 89, + 1094, 90, + 1095, 91, + 1096, 92, + 1097, 93, + 1098, 94, + 1100, 95, + 1101, 96, + 1102, 97, + 1103, 98, + 1104, 99, + 1107, 100, + 1108, 101, + 1109, 102, + 1110, 103, + 1111, 104, + 1112, 105, + 1113, 106, + 1114, 107, + 1115, 108, + 1116, 109, + 1117, 110, + 1118, 111, + 1119, 112, + 1120, 113, + 1121, 114, + 1122, 115, + 1123, 116, + 1124, 117, + 1500, 118, + 1501, 119, + 1502, 120, + 1503, 121, + 1504, 122, + 1505, 123, + 1506, 124, + 1507, 125, + 1508, 126, + 1509, 127, + 1510, 128 + }; + + const char* errorConstants[kLanguages][kNumErrorConstants] = + { + // en + { + /*1000,0*/ "The system is out of memory.", + /*1001,1*/ "The method %1 is not implemented.", + /*1002,2*/ "The precision argument must be between %2 and %3; %1 is invalid.", + /*1003,3*/ "The radix argument must be between 2 and 36; got %1.", + /*1004,4*/ "Method %1 was invoked on an incompatible object.", + /*1005,5*/ "Array index is not a positive integer (%1).", + /*1006,6*/ "%1 is not a function.", + /*1007,7*/ "Instantiation attempted on a non-constructor.", + /*1008,8*/ "%1 is ambiguous; Found more than one matching binding.", + /*1009,9*/ "Cannot access a property or method of a null object reference.", + /*1010,10*/ "A term is undefined and has no properties.", + /*1011,11*/ "Method %1 contained illegal opcode %2 at offset %3.", + /*1012,12*/ "The last instruction exceeded code size.", + /*1013,13*/ "Cannot call OP_findproperty when scopeDepth is 0.", + /*1014,14*/ "Class %1 could not be found.", + /*1015,15*/ "Method %1 cannot set default xml namespace", + /*1016,16*/ "Descendants operator (..) not supported on type %1.", + /*1017,17*/ "Scope stack overflow occurred.", + /*1018,18*/ "Scope stack underflow occurred.", + /*1019,19*/ "Getscopeobject %1 is out of bounds.", + /*1020,20*/ "Code cannot fall off the end of a method.", + /*1021,21*/ "At least one branch target was not on a valid instruction in the method.", + /*1022,22*/ "Type void may only be used as a function return type.", + /*1023,23*/ "Stack overflow occurred.", + /*1024,24*/ "Stack underflow occurred.", + /*1025,25*/ "An invalid register %1 was accessed.", + /*1026,26*/ "Slot %1 exceeds slotCount=%2 of %3.", + /*1027,27*/ "Method_info %1 exceeds method_count=%2.", + /*1028,28*/ "Disp_id %1 exceeds max_disp_id=%2 of %3.", + /*1029,29*/ "Disp_id %1 is undefined on %2.", + /*1030,30*/ "Stack depth is unbalanced. %1 != %2.", + /*1031,31*/ "Scope depth is unbalanced. %1 != %2.", + /*1032,32*/ "Cpool index %1 is out of range %2.", + /*1033,33*/ "Cpool entry %1 is wrong type.", + /*1034,34*/ "Type Coercion failed: cannot convert %1 to %2.", + /*1035,35*/ "Illegal super expression found in method %1.", + /*1037,36*/ "Cannot assign to a method %1 on %2.", + /*1038,37*/ "%1 is already defined.", + /*1039,38*/ "Cannot verify method until it is referenced.", + /*1040,39*/ "The right-hand side of instanceof must be a class or function.", + /*1041,40*/ "The right-hand side of operator must be a class.", + /*1042,41*/ "Not an ABC file. major_version=%1 minor_version=%2.", + /*1043,42*/ "Invalid code_length=%1.", + /*1044,43*/ "MethodInfo-%1 unsupported flags=%2.", + /*1045,44*/ "Unsupported traits kind=%1.", + /*1046,45*/ "MethodInfo-%1 referenced before definition.", + /*1047,46*/ "No entry point was found.", + /*1049,47*/ "Prototype objects must be vanilla Objects.", + /*1050,48*/ "Cannot convert %1 to primitive.", + /*1051,49*/ "Illegal early binding access to %1.", + /*1052,50*/ "Invalid URI passed to %1 function.", + /*1053,51*/ "Illegal override of %1 in %2.", + /*1054,52*/ "Illegal range or target offsets in exception handler.", + /*1056,53*/ "Cannot create property %1 on %2.", + /*1057,54*/ "%1 can only contain methods.", + /*1058,55*/ "Illegal operand type: %1 must be %2.", + /*1059,56*/ "ClassInfo-%1 is referenced before definition.", + /*1060,57*/ "ClassInfo %1 exceeds class_count=%2.", + /*1061,58*/ "The value %1 cannot be converted to %2 without losing precision.", + /*1063,59*/ "Argument count mismatch on %1. Expected %2, got %3.", + /*1064,60*/ "Cannot call method %1 as constructor.", + /*1065,61*/ "Variable %1 is not defined.", + /*1066,62*/ "The form function('function body') is not supported.", + /*1067,63*/ "Native method %1 has illegal method body.", + /*1068,64*/ "%1 and %2 cannot be reconciled.", + /*1069,65*/ "Property %1 not found on %2 and there is no default value.", + /*1070,66*/ "Method %1 not found on %2", + /*1071,67*/ "Function %1 has already been bound to %2.", + /*1072,68*/ "Disp_id 0 is illegal.", + /*1073,69*/ "Non-override method %1 replaced because of duplicate disp_id %2.", + /*1074,70*/ "Illegal write to read-only property %1 on %2.", + /*1075,71*/ "Math is not a function.", + /*1076,72*/ "Math is not a constructor.", + /*1077,73*/ "Illegal read of write-only property %1 on %2.", + /*1078,74*/ "Illegal opcode/multiname combination: %1<%2>.", + /*1079,75*/ "Native methods are not allowed in loaded code.", + /*1080,76*/ "Illegal value for namespace.", + /*1081,77*/ "Property %1 not found on %2 and there is no default value.", + /*1082,78*/ "No default namespace has been set.", + /*1083,79*/ "The prefix \"%1\" for element \"%2\" is not bound.", + /*1084,80*/ "Element or attribute (\"%1\") does not match QName production: QName::=(NCName':')?NCName.", + /*1085,81*/ "The element type \"%1\" must be terminated by the matching end-tag \"\".", + /*1086,82*/ "The %1 method only works on lists containing one item.", + /*1087,83*/ "Assignment to indexed XML is not allowed.", + /*1088,84*/ "The markup in the document following the root element must be well-formed.", + /*1089,85*/ "Assignment to lists with more than one item is not supported.", + /*1090,86*/ "XML parser failure: element is malformed.", + /*1091,87*/ "XML parser failure: Unterminated CDATA section.", + /*1092,88*/ "XML parser failure: Unterminated XML declaration.", + /*1093,89*/ "XML parser failure: Unterminated DOCTYPE declaration.", + /*1094,90*/ "XML parser failure: Unterminated comment.", + /*1095,91*/ "XML parser failure: Unterminated attribute.", + /*1096,92*/ "XML parser failure: Unterminated element.", + /*1097,93*/ "XML parser failure: Unterminated processing instruction.", + /*1098,94*/ "Illegal prefix %1 for no namespace.", + /*1100,95*/ "Cannot supply flags when constructing one RegExp from another.", + /*1101,96*/ "Cannot verify method %1 with unknown scope.", + /*1102,97*/ "Illegal default value for type %1.", + /*1103,98*/ "Class %1 cannot extend final base class.", + /*1104,99*/ "Attribute \"%1\" was already specified for element \"%2\".", + /*1107,100*/ "The ABC data is corrupt, attempt to read out of bounds.", + /*1108,101*/ "The OP_newclass opcode was used with the incorrect base class.", + /*1109,102*/ "Attempt to directly call unbound function %1 from method %2.", + /*1110,103*/ "%1 cannot extend %2.", + /*1111,104*/ "%1 cannot implement %2.", + /*1112,105*/ "Argument count mismatch on class coercion. Expected 1, got %1.", + /*1113,106*/ "OP_newactivation used in method without NEED_ACTIVATION flag.", + /*1114,107*/ "OP_getglobalslot or OP_setglobalslot used with no global scope.", + /*1115,108*/ "%1 is not a constructor.", + /*1116,109*/ "second argument to Function.prototype.apply must be an array.", + /*1117,110*/ "Invalid XML name: %1.", + /*1118,111*/ "Illegal cyclical loop between nodes.", + /*1119,112*/ "Delete operator is not supported with operand of type %1.", + /*1120,113*/ "Cannot delete property %1 on %2.", + /*1121,114*/ "Method %1 has a duplicate method body.", + /*1122,115*/ "Interface method %1 has illegal method body.", + /*1123,116*/ "Filter operator not supported on type %1.", + /*1124,117*/ "OP_hasnext2 requires object and index to be distinct registers.", + /*1500,118*/ "Error occurred opening file %1.", + /*1501,119*/ "Error occurred writing to file %1.", + /*1502,120*/ "A script has executed for longer than the default timeout period of 15 seconds.", + /*1503,121*/ "A script failed to exit after 30 seconds and was terminated.", + /*1504,122*/ "End of file.", + /*1505,123*/ "The string index %1 is out of bounds; must be in range %2 to %3.", + /*1506,124*/ "The specified range is invalid.", + /*1507,125*/ "Argument %1 cannot be null.", + /*1508,126*/ "The value specified for argument %1 is invalid.", + /*1509,127*/ "There was an error decompressing the data.", + /*1510,128*/ "When the callback argument is a method of a class, the optional this argument must be null." + }, + // de + { + /*1000,0*/ "Nicht genügend Speicher vorhanden.", + /*1001,1*/ "Die Methode %1 wird nicht implementiert.", + /*1002,2*/ "Das Genauigkeitsargument muss zwischen %2 und %3 liegen; %1 ist ungültig.", + /*1003,3*/ "Das Grundzahlargument muss zwischen 2 und 36 liegen; %1 erhalten.", + /*1004,4*/ "Methode %1 wurde für ein nicht kompatibles Objekt aufgerufen.", + /*1005,5*/ "Array-Index ist keine positive Ganzzahl (%1).", + /*1006,6*/ "%1 ist keine Funktion.", + /*1007,7*/ "Versuchte Instanziierung für einen Nicht-Konstruktor.", + /*1008,8*/ "%1 ist nicht eindeutig; es wurden mehrere übereinstimmende Bindungen gefunden.", + /*1009,9*/ "Der Zugriff auf eine Eigenschaft oder eine Methode eines null-Objektverweises ist nicht möglich.", + /*1010,10*/ "Ein Begriff ist nicht definiert und hat keine Eigenschaften.", + /*1011,11*/ "Methode %1 enthielt einen unzulässigen Opcode %2 bei Offset %3.", + /*1012,12*/ "Die letzte Anweisung hat die Codegröße überschritten.", + /*1013,13*/ "OP_findproperty kann nicht aufgerufen werden, wenn scopeDepth 0 ist.", + /*1014,14*/ "Klasse %1 wurde nicht gefunden.", + /*1015,15*/ "Methode %1 kann nicht den Standard-XML-Namespace festlegen.", + /*1016,16*/ "Nachfolger-Operator (..) wird für Typ %1 nicht unterstützt.", + /*1017,17*/ "Gültigkeitsbereich-Stapelüberlauf.", + /*1018,18*/ "Gültigkeitsbereich-Stapelunterlauf.", + /*1019,19*/ "Getscopeobject %1 liegt außerhalb des gültigen Bereichs.", + /*1020,20*/ "Code kann nicht außerhalb eines Methodenendes vorkommen.", + /*1021,21*/ "Mindestens ein Verzweigungsziel war nicht auf einer gültigen Anweisung in der Methode.", + /*1022,22*/ "Typ 'void' kann nur als Rückgabetyp für eine Funktion verwendet werden.", + /*1023,23*/ "Stapelüberlauf.", + /*1024,24*/ "Stapelunterlauf.", + /*1025,25*/ "Zugriff auf ein ungültiges Register %1.", + /*1026,26*/ "Position %1 ist höher als slotCount=%2 von %3.", + /*1027,27*/ "Method_info %1 ist höher als method_count=%2.", + /*1028,28*/ "Disp_id %1 ist größer als max_disp_id=%2 von %3.", + /*1029,29*/ "Disp_id %1 ist nicht definiert in %2.", + /*1030,30*/ "Stapeltiefe ist nicht ausgeglichen. %1 != %2.", + /*1031,31*/ "Gültigkeitsbereichstiefe ist nicht ausgeglichen. %1 != %2.", + /*1032,32*/ "Cpool-Index %1 liegt außerhalb des gültigen Bereichs %2.", + /*1033,33*/ "Cpool-Eintrag %1 hat den falschen Typ.", + /*1034,34*/ "Typumwandlung fehlgeschlagen: %1 kann nicht in %2 umgewandelt werden.", + /*1035,35*/ "Unzulässiger super-Ausdruck in Methode %1 gefunden.", + /*1037,36*/ "Zuweisung zu einer Methode %1 für %2 nicht möglich.", + /*1038,37*/ "%1 ist bereits definiert.", + /*1039,38*/ "Die Methode kann nicht überprüft werden, bevor sie referenziert wird.", + /*1040,39*/ "Auf der rechten Seite von instanceof muss eine Klasse oder Funktion stehen.", + /*1041,40*/ "Auf der rechten Seite des Operators muss eine Klasse stehen.", + /*1042,41*/ "Keine ABC-Datei. major_version=%1 minor_version=%2.", + /*1043,42*/ "Ungültige code_length=%1.", + /*1044,43*/ "MethodInfo-%1 nicht unterstützte Flags=%2.", + /*1045,44*/ "Nicht unterstützter Traittyp=%1.", + /*1046,45*/ "MethodInfo-%1 vor der Definition referenziert.", + /*1047,46*/ "Es wurde kein Zugangspunkt gefunden.", + /*1049,47*/ "Prototypobjekte müssen Vanilla-Objekte sein.", + /*1050,48*/ "%1 kann nicht in Grundtyp umgewandelt werden.", + /*1051,49*/ "Unzulässig früher Bindungszugriff auf %1.", + /*1052,50*/ "Ungültige URI an %1-Funktion übergeben.", + /*1053,51*/ "Unzulässiges Außerkraftsetzen von %1 in %2.", + /*1054,52*/ "Unzulässige Bereich- oder Zieloffsets in Ausnahmeprozedur.", + /*1056,53*/ "Eigenschaft %1 in %2 kann nicht erstellt werden.", + /*1057,54*/ "%1 kann nur Methoden enthalten.", + /*1058,55*/ "Unzulässiger Operandtyp: %1 muss %2 sein.", + /*1059,56*/ "ClassInfo-%1 vor der Definition referenziert.", + /*1060,57*/ "ClassInfo %1 ist größer als class_count=%2.", + /*1061,58*/ "Der Wert %1 kann nicht in %2 umgewandelt werden, ohne dass Genauigkeit verloren geht.", + /*1063,59*/ "Nicht übereinstimmende Argumentzählung für %1. %2 erwartet, %3 erhalten.", + /*1064,60*/ "Methode %1 kann nicht als Konstruktor aufgerufen werden.", + /*1065,61*/ "Variable %1 ist nicht definiert.", + /*1066,62*/ "Die Form function('function body') wird nicht unterstützt.", + /*1067,63*/ "Der Hauptteil der nativen Methode %1 ist unzulässig.", + /*1068,64*/ "%1 und %2 können nicht angeglichen werden.", + /*1069,65*/ "Eigenschaft %1 für %2 nicht gefunden und es ist kein Standardwert vorhanden.", + /*1070,66*/ "Methode %1 nicht in %2 gefunden", + /*1071,67*/ "Funktion %1 wurde bereits an %2 gebunden.", + /*1072,68*/ "Disp_id 0 ist unzulässig.", + /*1073,69*/ "Die nicht außer Kraft zu setzende Methode %1 wurde wegen doppelter disp_id %2 ersetzt.", + /*1074,70*/ "Unzulässiger Schreibvorgang in schreibgeschützte Eigenschaft %1 in %2.", + /*1075,71*/ "Math ist keine Funktion.", + /*1076,72*/ "Math ist kein Konstruktor.", + /*1077,73*/ "Unzulässiger Lesevorgang für Eigenschaft mit Lesezugriff %1 in %2.", + /*1078,74*/ "Unzulässige Opcode/Multiname-Kombination: %1<%2>.", + /*1079,75*/ "Native Methoden sind in geladenem Code nicht zulässig.", + /*1080,76*/ "Unzulässiger Wert für Namespace.", + /*1081,77*/ "Eigenschaft %1 in %2 nicht gefunden und es ist kein Standardwert vorhanden.", + /*1082,78*/ "Es wurde kein Standard-Namespace festgelegt.", + /*1083,79*/ "Das Präfix \"%1\" für Element \"%2\" ist nicht gebunden.", + /*1084,80*/ "Element oder Attribut (\"%1\") stimmt nicht mit QName-Produktion überein: QName::=(NCName':')?NCName.", + /*1085,81*/ "Der Elementtyp \"%1\" muss durch das entsprechende Schluss-Tag \"\" abgeschlossen werden.", + /*1086,82*/ "Die %1-Methode kann nur für Listen mit einem Element verwendet werden.", + /*1087,83*/ "Die Zuweisung zu indizierter XML ist nicht zulässig.", + /*1088,84*/ "Das Markup im Dokument nach dem Stammelement muss logisch aufgebaut sein.", + /*1089,85*/ "Die Zuweisung zu Listen mit mehreren Elementen wird nicht unterstützt.", + /*1090,86*/ "XML-Parserfehler: Element ist fehlerhaft.", + /*1091,87*/ "XML-Parserfehler: Nicht abgeschlossener CDATA-Abschnitt.", + /*1092,88*/ "XML-Parserfehler: Nicht abgeschlossene XML-Deklaration.", + /*1093,89*/ "XML-Parserfehler: Nicht abgeschlossene DOCTYPE-Deklaration.", + /*1094,90*/ "XML-Parserfehler: Nicht abgeschlossener Kommentar.", + /*1095,91*/ "XML-Parserfehler: Nicht abgeschlossenes Attribut.", + /*1096,92*/ "XML-Parserfehler: Nicht abgeschlossenes Element.", + /*1097,93*/ "XML-Parserfehler: Nicht abgeschlossene Verarbeitungsanweisung.", + /*1098,94*/ "Unzulässiges Präfix %1 für Nicht-Namespace.", + /*1100,95*/ "Es können keine Flags angegeben werden, wenn ein RegExp aus einem anderen konstruiert wird.", + /*1101,96*/ "Methode %1 mit unbekannten Gültigkeitsbereich kann nicht überprüft werden.", + /*1102,97*/ "Unzulässiger Standardwert für Typ %1.", + /*1103,98*/ "Klasse %1 kann die letzte Basisklasse nicht erweitern.", + /*1104,99*/ "Attribut \"%1\" wurde bereits für Element \"%2\" spezifiziert.", + /*1107,100*/ "Die ABC-Daten sind beschädigt, versuchtes Lesen außerhalb des gültigen Bereichs.", + /*1108,101*/ "Der Opcode OP_newclass wurde mit der falschen Basisklasse verwendet.", + /*1109,102*/ "Versuchter direkter Aufruf der nicht gebundenen Funktion %1 von Methode %2.", + /*1110,103*/ "%1 kann nicht %2 erweitern.", + /*1111,104*/ "%1 kann nicht %2 implementieren.", + /*1112,105*/ "Nicht übereinstimmende Argumentzählung für Klassenumwandlung. 1 erwartet, %1 erhalten.", + /*1113,106*/ "OP_newactivation wurde ohne Flag NEED_ACTIVATION in Methode verwendet.", + /*1114,107*/ "OP_getglobalslot oder OP_setglobalslot ohne globalen Gültigkeitsbereich verwendet.", + /*1115,108*/ "%1 ist kein Konstruktor.", + /*1116,109*/ "zweites Argument für Function.prototype.apply muss ein Array sein.", + /*1117,110*/ "Ungültiger XML-Name: %1.", + /*1118,111*/ "Unzulässige zyklische Schleife zwischen Knoten.", + /*1119,112*/ "Delete-Operator mit Operand vom Typ %1 wird nicht unterstützt.", + /*1120,113*/ "Eigenschaft %1 in %2 kann nicht gelöscht werden.", + /*1121,114*/ "Methode %1 verfügt über doppelten Hauptteil.", + /*1122,115*/ "Der Hauptteil der Schnittstellenmethode %1 ist unzulässig.", + /*1123,116*/ "Filter-Operator wird für Typ %1 nicht unterstützt.", + /*1124,117*/ "Für OP_hasnext2 müssen object und index verschiedene Register sein.", + /*1500,118*/ "Fehler beim Öffnen von Datei %1.", + /*1501,119*/ "Fehler beim Schreiben in Datei %1.", + /*1502,120*/ "Ein Skript wurde länger als die Standard-Timeout-Zeit von 15 Sekunden ausgeführt.", + /*1503,121*/ "Ein Skript konnte nach 30 Sekunden nicht abgeschlossen werden und wurde beendet.", + /*1504,122*/ "Dateiende.", + /*1505,123*/ "Der String-Index %1 liegt außerhalb des zulässigen Bereichs; muss im Bereich %2 bis %3 liegen.", + /*1506,124*/ "Der angegebene Bereich ist ungültig.", + /*1507,125*/ "Argument %1 kann nicht null sein.", + /*1508,126*/ "Der angegebene Wert für Argument %1 ist ungültig.", + /*1509,127*/ "Fehler beim Dekomprimieren der Daten.", + /*1510,128*/ "Wenn das callback-Argument eine Methode einer Klasse ist, muss das optionale this-Argument null sein." + }, + // es + { + /*1000,0*/ "El sistema no tiene memoria disponible.", + /*1001,1*/ "El método %1 no se ha implementado.", + /*1002,2*/ "El argumento de precisión debe estar entre %2 y %3; %1 no es válido.", + /*1003,3*/ "El argumento de base debe estar entre 2 y 36; se obtuvo %1.", + /*1004,4*/ "Se invocó el método %1 en un objeto no compatible.", + /*1005,5*/ "El índice de matriz no es un entero positivo (%1).", + /*1006,6*/ "%1 no es una función.", + /*1007,7*/ "Se intentó crear una instancia en un tipo no constructor.", + /*1008,8*/ "%1 es ambiguo; se encontró más de una vinculación coincidente.", + /*1009,9*/ "No se puede acceder a una propiedad o a un método de una referencia a un objeto nulo.", + /*1010,10*/ "Un término no está definido y no tiene propiedades.", + /*1011,11*/ "Código de operación %2 no válido en el desplazamiento %3 del método %1.", + /*1012,12*/ "La última instrucción superó el tamaño de código.", + /*1013,13*/ "No se puede llamar a OP_findproperty cuando el valor de scopeDepth es 0.", + /*1014,14*/ "No se encontró la clase %1.", + /*1015,15*/ "El método %1 no puede establecer el espacio de nombres xml predeterminado", + /*1016,16*/ "Operador de descendientes (..) no admitido en el tipo %1.", + /*1017,17*/ "Desbordamiento de la pila en el ámbito.", + /*1018,18*/ "Subdesbordamiento de la pila en el ámbito.", + /*1019,19*/ "Getscopeobject %1 está fuera de los límites.", + /*1020,20*/ "El código no puede sobrepasar el final de un método.", + /*1021,21*/ "Hay al menos un destino de rama en una instrucción no válida del método.", + /*1022,22*/ "El tipo Void sólo se puede utilizar como tipo de devolución de función.", + /*1023,23*/ "Desbordamiento de la pila.", + /*1024,24*/ "Subdesbordamiento de la pila.", + /*1025,25*/ "Se obtuvo acceso a un registro no válido %1.", + /*1026,26*/ "La ranura %1 supera el valor slotCount=%2 de %3.", + /*1027,27*/ "Method_info %1 supera el valor method_count=%2.", + /*1028,28*/ "Disp_id %1 supera el valor max_disp_id=%2 de %3.", + /*1029,29*/ "Disp_id %1 no está definido en %2.", + /*1030,30*/ "Profundidad de pila desequilibrada. %1 != %2.", + /*1031,31*/ "Profundidad de ámbito desequilibrada. %1 != %2.", + /*1032,32*/ "El índice Cpool %1 está fuera del rango %2.", + /*1033,33*/ "El tipo de la entrada Cpool %1 es incorrecto.", + /*1034,34*/ "Error de conversión forzada: no se puede convertir %1 en %2.", + /*1035,35*/ "Expresión super no válida en el método %1.", + /*1037,36*/ "No se puede asignar a un método %1 en %2.", + /*1038,37*/ "%1 ya está definido.", + /*1039,38*/ "No se puede verificar el método hasta que se haga referencia a él.", + /*1040,39*/ "A la derecha de instanceof debe haber una clase o una función.", + /*1041,40*/ "A la derecha del operador debe haber una clase.", + /*1042,41*/ "No es un archivo ABC. major_version=%1 minor_version=%2.", + /*1043,42*/ "code_length=%1 no válido.", + /*1044,43*/ "MethodInfo-%1 no admite flags=%2.", + /*1045,44*/ "traits kind=%1 no admitido.", + /*1046,45*/ "Referencia a MethodInfo-%1 antes de la definición.", + /*1047,46*/ "No se encontró un punto de entrada.", + /*1049,47*/ "Los objetos de prototipo deben ser objetos vanilla.", + /*1050,48*/ "No se puede convertir %1 en primitiva.", + /*1051,49*/ "Acceso de vinculación a %1 en tiempo de compilación no válido.", + /*1052,50*/ "URI no válido pasado a la función %1.", + /*1053,51*/ "Sustitución no válida de %1 en %2.", + /*1054,52*/ "Rango o desplazamientos de destino no válidos en el controlador de excepciones.", + /*1056,53*/ "No se puede crear la propiedad %1 en %2.", + /*1057,54*/ "%1 sólo puede contener métodos.", + /*1058,55*/ "Tipo de operando no válido: %1 debe ser %2.", + /*1059,56*/ "Referencia a ClassInfo-%1 antes de la definición.", + /*1060,57*/ "ClassInfo %1 supera el valor de class_count=%2.", + /*1061,58*/ "No se puede convertir el valor %1 en %2 sin perder precisión.", + /*1063,59*/ "Discordancia del recuento de argumentos en %1. Se esperaba %2 y se obtuvo %3.", + /*1064,60*/ "No se puede llamar al método %1 como constructor.", + /*1065,61*/ "No se ha definido la variable %1.", + /*1066,62*/ "No se admite la forma function('cuerpo de función').", + /*1067,63*/ "El cuerpo del método nativo %1 no es válido.", + /*1068,64*/ "%1 y %2 no pueden igualarse.", + /*1069,65*/ "No se encontró la propiedad %1 en %2 y no hay ningún valor predeterminado.", + /*1070,66*/ "No se encontró el método %1 en %2", + /*1071,67*/ "La función %1 ya se ha vinculado a %2.", + /*1072,68*/ "Disp_id 0 no es válido.", + /*1073,69*/ "Se reemplazó el método %1 de no sustitución por la duplicación de disp_id %2.", + /*1074,70*/ "Lectura no permitida de la propiedad %1 de sólo lectura en %2.", + /*1075,71*/ "Math no es una función.", + /*1076,72*/ "Math no es un constructor.", + /*1077,73*/ "Lectura no permitida de la propiedad %1 de sólo escritura en %2.", + /*1078,74*/ "Combinación no válida de código de operación y nombre múltiple: %1<%2>.", + /*1079,75*/ "No se permiten métodos nativos en el código cargado.", + /*1080,76*/ "Valor de espacio de nombres no válido.", + /*1081,77*/ "No se encuentra la propiedad %1 en %2 y no hay ningún valor predeterminado.", + /*1082,78*/ "No se ha establecido ningún espacio de nombres predeterminado.", + /*1083,79*/ "El prefijo \"%1\" del elemento \"%2\" no está vinculado.", + /*1084,80*/ "El elemento o el atributo (\"%1\") no coincide con la regla de producción de QName: QName::=(NCName':')?NCName.", + /*1085,81*/ "El tipo de elemento \"%1\" debe terminar con la etiqueta final \"\" correspondiente.", + /*1086,82*/ "El método %1 sólo funciona en listas que contienen un elemento.", + /*1087,83*/ "No se permite la asignación a XML indexado.", + /*1088,84*/ "El marcado del documento que sigue al elemento raíz debe estar bien formado.", + /*1089,85*/ "No se admite la asignación a listas con más de un elemento.", + /*1090,86*/ "Error del analizador XML: elemento mal formado.", + /*1091,87*/ "Error del analizador XML: sección CDATA sin terminar.", + /*1092,88*/ "Error del analizador XML: declaración XML sin terminar.", + /*1093,89*/ "Error del analizador XML: declaración DOCTYPE sin terminar.", + /*1094,90*/ "Error del analizador XML: comentario sin terminar.", + /*1095,91*/ "Error del analizador XML: atributo sin terminar.", + /*1096,92*/ "Error del analizador XML: elemento sin terminar.", + /*1097,93*/ "Error del analizador XML: instrucción de procesamiento sin terminar.", + /*1098,94*/ "Prefijo %1 no válido sin un espacio de nombres.", + /*1100,95*/ "No se pueden proporcionar indicadores cuando se genera una expresión regular a partir de otra.", + /*1101,96*/ "No se puede verificar el método %1 con ámbito desconocido.", + /*1102,97*/ "Valor predeterminado no válido para el tipo %1.", + /*1103,98*/ "La clase %1 no puede ampliar la clase base final.", + /*1104,99*/ "El atributo \"%1\" ya se especificó para el elemento \"%2\".", + /*1107,100*/ "Los datos ABC están dañados; intentan leer fuera de los límites.", + /*1108,101*/ "El código de operación OP_newclass se utilizó con la clase base incorrecta.", + /*1109,102*/ "Intento de llamada directa a la función abierta %1 desde el método %2.", + /*1110,103*/ "%1 no puede ampliar %2.", + /*1111,104*/ "%1 no puede implementar %2.", + /*1112,105*/ "Discordancia del recuento de argumentos en coerción de clase. Se esperaba 1; se obtuvo %1.", + /*1113,106*/ "Se utilizó OP_newactivation en el método sin el indicador NEED_ACTIVATION.", + /*1114,107*/ "Se utilizaron OP_getglobalslot u OP_setglobalslot sin ámbito global.", + /*1115,108*/ "%1 no es un constructor.", + /*1116,109*/ "el segundo argumento de Function.prototype.apply debe ser una matriz.", + /*1117,110*/ "Nombre XML no válido: %1.", + /*1118,111*/ "Bucle cíclico no válido entre nodos.", + /*1119,112*/ "El operador de eliminación no se admite con el operando de tipo %1.", + /*1120,113*/ "No se puede eliminar la propiedad %1 en %2.", + /*1121,114*/ "El cuerpo del método %1 está duplicado.", + /*1122,115*/ "El cuerpo del método de interfaz %1 no es válido.", + /*1123,116*/ "Operador de filtro no admitido en el tipo %1.", + /*1124,117*/ "OP_hasnext2 requiere que el objeto y el índice sean registros diferentes.", + /*1500,118*/ "Error al abrir el archivo %1.", + /*1501,119*/ "Error al escribir en el archivo %1.", + /*1502,120*/ "El tiempo de ejecución del script ha superado el tiempo de espera predeterminado de 15 segundos.", + /*1503,121*/ "No se salió del script en 30 segundos y se ha cerrado.", + /*1504,122*/ "Final del archivo.", + /*1505,123*/ "El índice de cadena %1 está fuera de los límites; debe estar en el rango %2-%3.", + /*1506,124*/ "El rango especificado no es válido.", + /*1507,125*/ "El argumento %1 no puede ser null.", + /*1508,126*/ "El valor especificado para el argumento %1 no es válido.", + /*1509,127*/ "Se produjo un error al descomprimir los datos.", + /*1510,128*/ "Si el argumento de la función de repetición de llamada es un método de la clase, el argumento opcional debe ser null." + }, + // fr + { + /*1000,0*/ "La mémoire du système est saturée.", + /*1001,1*/ "La méthode %1 n'est pas mise en oeuvre.", + /*1002,2*/ "L'argument precision doit être compris entre %2 et %3. %1 n'est pas valide.", + /*1003,3*/ "L'argument radix doit être compris entre 2 et 36. %1 détecté.", + /*1004,4*/ "La méthode %1 a été invoquée pour un objet non compatible.", + /*1005,5*/ "L'index du tableau n'est pas un entier positif (%1).", + /*1006,6*/ "%1 n'est pas une fonction.", + /*1007,7*/ "Tentative d'instanciation sur un élément non constructeur.", + /*1008,8*/ "%1 est ambigu. Plusieurs liaisons correspondantes détectées.", + /*1009,9*/ "Il est impossible d'accéder à la propriété ou à la méthode d'une référence d'objet nul.", + /*1010,10*/ "Un terme n'est pas défini et n'a pas de propriété.", + /*1011,11*/ "La méthode %1 contenait un opcode %2 non valide au décalage %3.", + /*1012,12*/ "La dernière instruction dépassait la taille du code.", + /*1013,13*/ "Impossible d'appeler OP_findproperty si scopeDepth correspond à 0.", + /*1014,14*/ "La classe %1 est introuvable.", + /*1015,15*/ "La méthode %1 ne peut pas définir l'espace de nom xml par défaut", + /*1016,16*/ "L'opérateur Descendants (..) n'est pas pris en charge sur le type %1.", + /*1017,17*/ "Il s'est produit un débordement de la pile de domaine.", + /*1018,18*/ "Il s'est produit un débordement négatif de la pile de domaine.", + /*1019,19*/ "Getscopeobject %1 sort des limites.", + /*1020,20*/ "Le code ne doit pas dépasser la fin d'une méthode.", + /*1021,21*/ "Au moins une cible branche ne figurait pas dans une instruction valide de la méthode.", + /*1022,22*/ "Void est réservé aux types de renvoi de fonction.", + /*1023,23*/ "Il s'est produit un débordement de pile.", + /*1024,24*/ "Il s'est produit un débordement négatif de pile.", + /*1025,25*/ "Il s'est produit un accès à un registre %1 non valide.", + /*1026,26*/ "L'emplacement %1 dépasse slotCount=%2 sur %3.", + /*1027,27*/ "Method_info %1 dépasse method_count=%2.", + /*1028,28*/ "Disp_id %1 dépasse max_disp_id=%2 sur %3.", + /*1029,29*/ "Disp_id %1 n'est pas défini sur %2.", + /*1030,30*/ "La profondeur de la pile n'est pas équilibrée. %1 != %2.", + /*1031,31*/ "La profondeur du domaine n'est pas équilibrée. %1 != %2.", + /*1032,32*/ "L'index Cpool %1 est en dehors des limites %2.", + /*1033,33*/ "Le type de l'entrée Cpool %1 est incorrect.", + /*1034,34*/ "Echec de la contrainte de type : conversion de %1 en %2 impossible.", + /*1035,35*/ "Super expression illégale détectée dans la méthode %1.", + /*1037,36*/ "Affectation impossible à une méthode %1 sur %2.", + /*1038,37*/ "%1 est déjà défini.", + /*1039,38*/ "Impossible de vérifier la méthode tant qu'elle n'est pas référencée.", + /*1040,39*/ "L'expression à droite de instanceof doit être une classe ou une fonction.", + /*1041,40*/ "L'expression à droite de l'opérateur doit être une classe.", + /*1042,41*/ "Il ne s'agit pas d'un fichier ABC. major_version=%1 minor_version=%2.", + /*1043,42*/ "code_length non valide=%1.", + /*1044,43*/ "Indicateurs MethodInfo-%1 non pris en charge=%2.", + /*1045,44*/ "Type de trait non pris en charge=%1.", + /*1046,45*/ "MethodInfo-%1 référencé avant la définition.", + /*1047,46*/ "Aucun point d'entrée n'a été détecté.", + /*1049,47*/ "Les objets prototype doivent être des objets vanille.", + /*1050,48*/ "Impossible de convertir %1 en primitive.", + /*1051,49*/ "Accès anticipé illégal de liaison à %1.", + /*1052,50*/ "URI non valide transmis à la fonction %1.", + /*1053,51*/ "Remplacement illégal de %1 dans %2.", + /*1054,52*/ "Plage ou décalages cibles illégaux dans le gestionnaire d'exceptions.", + /*1056,53*/ "Impossible de créer la propriété %1 sur %2.", + /*1057,54*/ "%1 ne peut contenir que des méthodes.", + /*1058,55*/ "Type d'opérande illégal : %1 doit correspondre à %2.", + /*1059,56*/ "ClassInfo-%1 est référencé avant la définition.", + /*1060,57*/ "ClassInfo %1 dépasse class_count=%2.", + /*1061,58*/ "La valeur %1 ne peut pas être convertie en %2 sans perte de précision.", + /*1063,59*/ "Non-correspondance du nombre d'arguments sur %1. %2 prévu(s), %3 détecté(s).", + /*1064,60*/ "Impossible d'appeler la méthode %1 en tant que constructeur.", + /*1065,61*/ "La variable %1 n'est pas définie.", + /*1066,62*/ "La fonction('corps de fonction') form n'est pas prise en charge.", + /*1067,63*/ "La méthode native %1 contient un corps de méthode illégal.", + /*1068,64*/ "Impossible de réconcilier %1 et %2.", + /*1069,65*/ "La propriété %1 est introuvable sur %2 et il n'existe pas de valeur par défaut.", + /*1070,66*/ "La méthode %1 est introuvable sur %2", + /*1071,67*/ "La fonction %1 a déjà été liée à %2.", + /*1072,68*/ "Disp_id 0 est illégal.", + /*1073,69*/ "La méthode de non-remplacement %1 a été supplantée en raison du doublon disp_id %2.", + /*1074,70*/ "Ecriture illégale dans une propriété en lecture seule %1 sur %2.", + /*1075,71*/ "Math n'est pas une fonction.", + /*1076,72*/ "Math n'est pas un constructeur.", + /*1077,73*/ "Lecture illégale d'une propriété en écriture seule %1 sur %2.", + /*1078,74*/ "Combinaison opcode/multiname illégale : %1<%2>.", + /*1079,75*/ "Les méthodes natives ne sont pas autorisées dans le code chargé.", + /*1080,76*/ "La valeur de l'espace de nom est illégale.", + /*1081,77*/ "La propriété %1 est introuvable sur %2 et il n'existe pas de valeur par défaut.", + /*1082,78*/ "Aucun espace de nom par défaut n'a été défini.", + /*1083,79*/ "Le préfixe \"%1\" associé à l'élément \"%2\" n'est pas lié.", + /*1084,80*/ "L'élément ou l'attribut (\"%1\") ne correspond pas à la production QName : QName::=(NCName':')?NCName.", + /*1085,81*/ "Le type d'élément \"%1\" doit se terminer par la balise de fin correspondante \"\".", + /*1086,82*/ "La méthode %1 ne fonctionne qu'avec les listes composées d'un seul élément.", + /*1087,83*/ "L'affectation à un élément XML indexé n'est pas autorisée.", + /*1088,84*/ "Le marquage du document après l'élément root doit être composé correctement.", + /*1089,85*/ "L'affectation à des listes composées de plus d'un élément n'est pas prise en charge.", + /*1090,86*/ "Echec de l'analyse XML : le format de l'élément est incorrect.", + /*1091,87*/ "Echec de l'analyse XML : Section CDATA non terminée.", + /*1092,88*/ "Echec de l'analyse XML : Déclaration XML non terminée.", + /*1093,89*/ "Echec de l'analyse XML : Déclaration DOCTYPE non terminée.", + /*1094,90*/ "Echec de l'analyse XML : Commentaire non terminé.", + /*1095,91*/ "Echec de l'analyse XML : Attribut non terminé.", + /*1096,92*/ "Echec de l'analyse XML : Elément non terminé.", + /*1097,93*/ "Echec de l'analyse XML : Instruction de traitement non terminée.", + /*1098,94*/ "Préfixe %1 illégal sans espace de nom.", + /*1100,95*/ "Impossible de fournir des indicateurs lors de la construction d'un RegExp à partir d'un autre.", + /*1101,96*/ "Impossible de vérifier la méthode %1 si le domaine est inconnu.", + /*1102,97*/ "Valeur par défaut illégale pour le type %1.", + /*1103,98*/ "La classe %1 ne peut pas étendre la classe de base finale.", + /*1104,99*/ "L'attribut \"%1\" a déjà été spécifié pour l'élément \"%2\".", + /*1107,100*/ "Les données ABC sont corrompues, tentative de lecture en dehors des limites.", + /*1108,101*/ "L'élément opcode OP_newclass a été utilisé avec une classe de base incorrecte.", + /*1109,102*/ "Tentative d'appel direct d'une fonction non liée %1 à partir de la méthode %2.", + /*1110,103*/ "%1 ne peut pas étendre %2.", + /*1111,104*/ "%1 ne peut pas mettre en oeuvre %2.", + /*1112,105*/ "Non-concordance du nombre d'arguments pour contrainte de classe. 1 prévu, %1 détecté(s).", + /*1113,106*/ "OP_newactivation utilisé dans la méthode sans indicateur NEED_ACTIVATION.", + /*1114,107*/ "OP_getglobalslot ou OP_setglobalslot utilisé sans domaine global.", + /*1115,108*/ "%1 n'est pas un constructeur.", + /*1116,109*/ "Le deuxième argument transmis à Function.prototype.apply doit être un tableau.", + /*1117,110*/ "Nom XML non valide : %1.", + /*1118,111*/ "Boucle cyclique illégale entre noeuds.", + /*1119,112*/ "L'opérateur delete n'est pas pris en charge avec une opérande de type %1.", + /*1120,113*/ "Impossible de supprimer la propriété %1 sur %2.", + /*1121,114*/ "La méthode %1 contient un corps de méthode dupliqué.", + /*1122,115*/ "La méthode d'interface %1 contient un corps de méthode illégal.", + /*1123,116*/ "L'opérateur Filter n'est pas pris en charge sur le type %1.", + /*1124,117*/ "OP_hasnext2 requiert que l'objet et l'index soient des registres distincts.", + /*1500,118*/ "Une erreur s’est produite lors de l’ouverture du fichier %1.", + /*1501,119*/ "Une erreur s’est produite lors de l’écriture dans le fichier %1.", + /*1502,120*/ "La durée d'exécution d'un script excède le délai par défaut (15 secondes).", + /*1503,121*/ "Un script ne s'est pas terminé après 30 secondes et a été arrêté.", + /*1504,122*/ "Fin du fichier.", + /*1505,123*/ "L'index de chaîne %1 sort des limites. Il doit être compris entre %2 et %3.", + /*1506,124*/ "La plage indiquée n'est pas valide.", + /*1507,125*/ "L’argument %1 ne doit pas être null.", + /*1508,126*/ "La valeur indiquée pour l’argument %1 n’est pas valide.", + /*1509,127*/ "Une erreur s'est produite lors de la décompression des données.", + /*1510,128*/ "Lorsque l’argument du rappel correspond à une méthode de classe, l’argument facultatif 'this' doit être null." + }, + // it + { + /*1000,0*/ "Memoria del sistema esaurita.", + /*1001,1*/ "Il metodo %1 non è implementato.", + /*1002,2*/ "L'argomento precision deve essere compreso tra %2 e %3; %1 non è un valore valido.", + /*1003,3*/ "L'argomento radix deve essere compreso tra 2 e 36; valore ricevuto: %1.", + /*1004,4*/ "È stato richiamato il metodo %1 su un oggetto incompatibile.", + /*1005,5*/ "L'indice della matrice non è un numero intero positivo (%1).", + /*1006,6*/ "%1 non è una funzione.", + /*1007,7*/ "Tentativo di creazione di istanza su un elemento diverso da un costruttore.", + /*1008,8*/ "%1 è ambiguo; trovata più di un'associazione corrispondente.", + /*1009,9*/ "Impossibile accedere a una proprietà o a un metodo di un riferimento oggetto null.", + /*1010,10*/ "Un termine risulta undefined e non ha proprietà.", + /*1011,11*/ "Il metodo %1 conteneva un opcode non valido (%2 ) in corrispondenza dell'offset %3.", + /*1012,12*/ "L'ultima istruzione ha superato la dimensione del codice.", + /*1013,13*/ "Impossibile chiamare OP_findproperty quando scopeDepth è uguale a 0.", + /*1014,14*/ "Impossibile trovare la classe %1.", + /*1015,15*/ "Il metodo %1 non può impostare lo spazio dei nomi xml predefinito", + /*1016,16*/ "Operatore Descendants (..) non supportato nel tipo %1.", + /*1017,17*/ "Si è verificato un overflow dello stack per l'area di validità.", + /*1018,18*/ "Si è verificato un underflow dello stack per l'area di validità.", + /*1019,19*/ "Getscopeobject %1 è fuori dei limiti.", + /*1020,20*/ "Il codice non può superare la fine di un metodo.", + /*1021,21*/ "Almeno una destinazione del ramo non si riferisce a un'istruzione valida nel metodo.", + /*1022,22*/ "Il tipo void può essere utilizzato solo come tipo restituito della funzione.", + /*1023,23*/ "Si è verificato un overflow dello stack.", + /*1024,24*/ "Si è verificato un underflow dello stack.", + /*1025,25*/ "È stato eseguito l'accesso a un registro %1 non valido.", + /*1026,26*/ "Lo slot %1 supera slotCount=%2 di %3.", + /*1027,27*/ "Method_info %1 supera method_count=%2.", + /*1028,28*/ "Disp_id %1 supera max_disp_id=%2 di %3.", + /*1029,29*/ "Disp_id %1 non è definito su %2.", + /*1030,30*/ "Profondità dello stack non bilanciata. %1 != %2.", + /*1031,31*/ "Profondità dell'area di validità non bilanciata. %1 != %2.", + /*1032,32*/ "L'indice Cpool %1 è fuori intervallo %2.", + /*1033,33*/ "La voce Cpool %1 è di tipo errato.", + /*1034,34*/ "Assegnazione di tipo forzata non riuscita: impossibile convertire %1 in %2.", + /*1035,35*/ "Trovata super espressione non valida nel metodo %1.", + /*1037,36*/ "Impossibile assegnare a un metodo %1 su %2.", + /*1038,37*/ "%1 è già definita.", + /*1039,38*/ "Impossibile verificare un metodo finché non viene utilizzato come riferimento.", + /*1040,39*/ "L'espressione a destra di instanceof deve essere una classe o una funzione.", + /*1041,40*/ "L'espressione a destra dell'operatore deve essere una classe.", + /*1042,41*/ "Non è un file ABC. major_version=%1 minor_version=%2.", + /*1043,42*/ "Valore non valido code_length=%1.", + /*1044,43*/ "MethodInfo-%1 non supportato flags=%2.", + /*1045,44*/ "Tipo traits non supportato=%1.", + /*1046,45*/ "MethodInfo-%1 utilizzato come riferimento prima della definizione.", + /*1047,46*/ "Punto di entrata non trovato.", + /*1049,47*/ "Gli oggetti prototype devono essere oggetti vanilla.", + /*1050,48*/ "Impossibile convertire %1 in dato di base.", + /*1051,49*/ "Accesso in associazione a %1 prematuro e non valido.", + /*1052,50*/ "URI non valido passato alla funzione %1.", + /*1053,51*/ "Sostituzione non valida di %1 in %2.", + /*1054,52*/ "Intervallo non valido oppure offset di destinazione nel gestore eccezioni.", + /*1056,53*/ "Impossibile creare la proprietà %1 su %2.", + /*1057,54*/ "%1 può contenere solo metodi.", + /*1058,55*/ "Tipo di operando non valido: %1 deve essere %2.", + /*1059,56*/ "ClassInfo-%1 è utilizzato come riferimento prima della definizione.", + /*1060,57*/ "ClassInfo %1 supera class_count=%2.", + /*1061,58*/ "Impossibile convertire il valore %1 in %2 senza perdere precisione.", + /*1063,59*/ "Incongruenza nel conteggio degli argomenti su %1. Era atteso %2, è stato ricevuto %3.", + /*1064,60*/ "Impossibile chiamare il metodo %1 come funzione di costruzione.", + /*1065,61*/ "La variabile %1 non è definita.", + /*1066,62*/ "La forma funzione('corpo funzione') non è supportata.", + /*1067,63*/ "Corpo del metodo nativo %1 non valido.", + /*1068,64*/ "Impossibile riconciliare %1 e %2.", + /*1069,65*/ "Impossibile trovare la proprietà %1 su %2 e nessun valore predefinito presente.", + /*1070,66*/ "Metodo %1 non trovato su %2", + /*1071,67*/ "La funzione %1 è già stata associata a %2.", + /*1072,68*/ "Disp_id 0 non è valido.", + /*1073,69*/ "Metodo non-override %1 sostituito a causa di disp_id %2 duplicati.", + /*1074,70*/ "Scrittura non valida della proprietà di sola lettura %1 su %2.", + /*1075,71*/ "Math non è una funzione.", + /*1076,72*/ "Math non è una funzione di costruzione.", + /*1077,73*/ "Lettura non valida della proprietà di sola scrittura %1 su %2.", + /*1078,74*/ "Combinazione opcode/multiname non valida: %1<%2>.", + /*1079,75*/ "Metodi nativi non consentiti nel codice caricato.", + /*1080,76*/ "Valore non valido per namespace.", + /*1081,77*/ "Impossibile trovare la proprietà %1 su %2 e nessun valore predefinito presente.", + /*1082,78*/ "Nessuno spazio dei nomi predefinito impostato.", + /*1083,79*/ "Il prefisso \"%1\" per l'elemento \"%2\" non è associato.", + /*1084,80*/ "L'elemento o l'attributo (\"%1\") non corrisponde alla produzione di QName: QName::=(NCName':')?NCName.", + /*1085,81*/ "Il tipo di elemento \"%1\" deve terminare con il tag di fine corrispondente \"\".", + /*1086,82*/ "Il metodo %1 funziona solo sugli elenchi che contengono una sola voce.", + /*1087,83*/ "L'assegnazione all'XML indicizzato non è consentita.", + /*1088,84*/ "Il codice nel documento successivo all'elemento principale deve essere formato correttamente.", + /*1089,85*/ "Non è supportata l'assegnazione agli elenchi con più di una voce.", + /*1090,86*/ "Errore nell'analisi sintattica XML: l'elemento non è formato correttamente.", + /*1091,87*/ "Errore nell'analisi sintattica XML: sezione CDATA non terminata.", + /*1092,88*/ "Errore nell'analisi sintattica XML: dichiarazione XML non terminata.", + /*1093,89*/ "Errore nell'analisi sintattica XML: dichiarazione DOCTYPE non terminata.", + /*1094,90*/ "Errore nell'analisi sintattica XML: commento non terminato.", + /*1095,91*/ "Errore nell'analisi sintattica XML: attributo non terminato.", + /*1096,92*/ "Errore nell'analisi sintattica XML: elemento non terminato.", + /*1097,93*/ "Errore nell'analisi sintattica XML: istruzione di elaborazione non terminata.", + /*1098,94*/ "Prefisso %1 non valido per no namespace.", + /*1100,95*/ "Impossibile fornire i flag quando si costruisce un RegExp da un altro.", + /*1101,96*/ "Impossibile verificare il metodo %1 con ambito di validità sconosciuto.", + /*1102,97*/ "Valore predefinito non valido per il tipo %1.", + /*1103,98*/ "La classe %1 non può estendere la classe base finale.", + /*1104,99*/ "L'attributo \"%1\" è già stato specificato per l'elemento \"%2\".", + /*1107,100*/ "I dati ABC sono danneggiati; tentativo di leggere fuori dei limiti.", + /*1108,101*/ "L'opcode OP_newclass è stato utilizzato con una classe base non corretta.", + /*1109,102*/ "Tentativo di chiamare direttamente la funzione non associata %1 dal metodo %2.", + /*1110,103*/ "%1 non può estendere %2.", + /*1111,104*/ "%1 non può implementare %2.", + /*1112,105*/ "Incongruenza nel conteggio degli argomenti nell'assegnazione forzata della classe. Era atteso 1, è stato ricevuto %1.", + /*1113,106*/ "OP_newactivation utilizzato nel metodo senza flag NEED_ACTIVATION.", + /*1114,107*/ "OP_getglobalslot o OP_setglobalslot utilizzato senza area di validità globale.", + /*1115,108*/ "%1 non è una funzione di costruzione.", + /*1116,109*/ "Il secondo argomento di Function.prototype.apply deve essere un array.", + /*1117,110*/ "Nome XML non valido: %1.", + /*1118,111*/ "Ripetizione ciclica non valida tra i nodi.", + /*1119,112*/ "Operatore Delete non supportato con un operando di tipo %1.", + /*1120,113*/ "Impossibile eliminare la proprietà %1 su %2.", + /*1121,114*/ "Corpo duplicato nel metodo %1.", + /*1122,115*/ "Corpo non valido nel metodo di interfaccia %1.", + /*1123,116*/ "Operatore Filter non supportato nel tipo %1.", + /*1124,117*/ "OP_hasnext2 richiede che oggetto e indice siano registri distinti.", + /*1500,118*/ "Errore durante l'apertura del file %1.", + /*1501,119*/ "Errore durante la scrittura del file %1.", + /*1502,120*/ "Uno script è stato eseguito per più del periodo di timeout predefinito di 15 secondi.", + /*1503,121*/ "Uno script non è uscito dopo 30 secondi ed è stato terminato.", + /*1504,122*/ "Fine del file.", + /*1505,123*/ "L'indice di stringa %1 è fuori dei limiti; deve essere compreso nell'intervallo da %2 a %3.", + /*1506,124*/ "L'intervallo specificato non è valido.", + /*1507,125*/ "L'argomento %1 non può essere null.", + /*1508,126*/ "Il valore specificato per l'argomento %1 non è valido.", + /*1509,127*/ "Si è verificato un errore durante la decompressione dei dati.", + /*1510,128*/ "Quando l'argomento callback è il metodo di una classe, l'argomento opzionale this deve essere null." + }, + // ja + { + /*1000,0*/ "システムã®ãƒ¡ãƒ¢ãƒªä¸è¶³ã§ã™ã€‚", + /*1001,1*/ "メソッド %1 ã¯å®Ÿè£…ã•れã¦ã„ã¾ã›ã‚“。", + /*1002,2*/ "精度ã®å¼•æ•°ã«ã¯ %2 ~ %3 ã®å€¤ã‚’指定ã—ã¦ãã ã•ã„。%1 ã¯ä¸æ­£ãªå€¤ã§ã™ã€‚", + /*1003,3*/ "基数ã®å¼•æ•°ã«ã¯ 2 ~ 36 ã®å€¤ã‚’指定ã—ã¦ãã ã•ã„。%1 ã¯ä¸æ­£ãªå€¤ã§ã™ã€‚", + /*1004,4*/ "メソッド %1 ãŒå¯¾å¿œã—ã¦ã„ãªã„オブジェクトã§å‘¼ã³å‡ºã•れã¾ã—ãŸã€‚", + /*1005,5*/ "é…åˆ—ã‚¤ãƒ³ãƒ‡ãƒƒã‚¯ã‚¹ãŒæ­£ã®æ•´æ•° (%1) ã§ã¯ã‚りã¾ã›ã‚“。", + /*1006,6*/ "%1 ã¯é–¢æ•°ã§ã¯ã‚りã¾ã›ã‚“。", + /*1007,7*/ "コンストラクタ以外ã«ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹åŒ–ãŒè©¦è¡Œã•れã¾ã—ãŸã€‚", + /*1008,8*/ "%1 ãŒã‚ã„ã¾ã„ã§ã™ã€‚一致ã™ã‚‹ãƒã‚¤ãƒ³ãƒ‡ã‚£ãƒ³ã‚°ãŒè¤‡æ•°è¦‹ã¤ã‹ã‚Šã¾ã—ãŸã€‚", + /*1009,9*/ "null ã®ã‚ªãƒ–ジェクトå‚ç…§ã®ãƒ—ロパティã¾ãŸã¯ãƒ¡ã‚½ãƒƒãƒ‰ã«ã‚¢ã‚¯ã‚»ã‚¹ã™ã‚‹ã“ã¨ã¯ã§ãã¾ã›ã‚“。", + /*1010,10*/ "æ¡ä»¶ã¯æœªå®šç¾©ã§ã‚りã€ãƒ—ロパティãŒã‚りã¾ã›ã‚“。", + /*1011,11*/ "メソッド %1 ã«ç„¡åŠ¹ãª opcode %2 (オフセット %3 内) ãŒå«ã¾ã‚Œã¦ã„ã¾ã™ã€‚", + /*1012,12*/ "最後ã®å‘½ä»¤ãŒã‚³ãƒ¼ãƒ‰ã‚µã‚¤ã‚ºã‚’è¶…ãˆã¾ã—ãŸã€‚", + /*1013,13*/ "scopeDepth ㌠0 ã§ã‚ã‚‹å ´åˆã€OP_findproperty を呼ã³å‡ºã™ã“ã¨ã¯ã§ãã¾ã›ã‚“。", + /*1014,14*/ "クラス %1 ãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“。", + /*1015,15*/ "メソッド %1 ã¯ãƒ‡ãƒ•ォルト㮠xml åå‰ç©ºé–“を設定ã§ãã¾ã›ã‚“", + /*1016,16*/ "Descendants æ¼”ç®—å­ (..) ã¯åž‹ %1 ã§ã‚µãƒãƒ¼ãƒˆã•れã¦ã„ã¾ã›ã‚“。", + /*1017,17*/ "スコープã®ã‚¹ã‚¿ãƒƒã‚¯ã‚ªãƒ¼ãƒãƒ¼ãƒ•ローãŒç™ºç”Ÿã—ã¾ã—ãŸã€‚", + /*1018,18*/ "スコープã®ã‚¹ã‚¿ãƒƒã‚¯ã‚¢ãƒ³ãƒ€ãƒ¼ãƒ•ローãŒç™ºç”Ÿã—ã¾ã—ãŸã€‚", + /*1019,19*/ "Getscopeobject %1 ãŒå¢ƒç•Œå¤–ã§ã™ã€‚", + /*1020,20*/ "コードãŒãƒ¡ã‚½ãƒƒãƒ‰ã®æœ«å°¾ã‹ã‚‰ã¯ã¿å‡ºã™ã“ã¨ã¯ã§ãã¾ã›ã‚“。", + /*1021,21*/ "最低 1 ã¤ã®ãƒ–ランãƒã‚¿ãƒ¼ã‚²ãƒƒãƒˆãŒãƒ¡ã‚½ãƒƒãƒ‰ã®æœ‰åйãªå‘½ä»¤ã‚’åæ˜ ã—ã¦ã„ã¾ã›ã‚“。", + /*1022,22*/ "Void åž‹ã¯ã€é–¢æ•°ã®æˆ»ã‚Šåž‹ã¨ã—ã¦ã®ã¿ä½¿ç”¨ã§ãã¾ã™ã€‚", + /*1023,23*/ "スタックオーãƒãƒ¼ãƒ•ローãŒç™ºç”Ÿã—ã¾ã—ãŸã€‚", + /*1024,24*/ "スタックアンダーフローãŒç™ºç”Ÿã—ã¾ã—ãŸã€‚", + /*1025,25*/ "無効ãªãƒ¬ã‚¸ã‚¹ã‚¿ %1 ãŒã‚¢ã‚¯ã‚»ã‚¹ã•れã¾ã—ãŸã€‚", + /*1026,26*/ "スロット %1 ㌠%3 ã® slotCount=%2 ã‚’è¶…ãˆã¦ã„ã¾ã™ã€‚", + /*1027,27*/ "Method_info %1 ㌠method_count=%2 ã‚’è¶…ãˆã¦ã„ã¾ã™ã€‚", + /*1028,28*/ "Disp_id %1 ㌠%3 ã® max_disp_id=%2 ã‚’è¶…ãˆã¦ã„ã¾ã™ã€‚", + /*1029,29*/ "Disp_id %1 ㌠%2 ã«å¯¾ã—ã¦æœªå®šç¾©ã§ã™ã€‚", + /*1030,30*/ "ã‚¹ã‚¿ãƒƒã‚¯ã®æ·±ã•ãŒã‚¢ãƒ³ãƒãƒ©ãƒ³ã‚¹ã§ã™ã€‚%1 != %2。", + /*1031,31*/ "ã‚¹ã‚³ãƒ¼ãƒ—ã®æ·±ã•ãŒã‚¢ãƒ³ãƒãƒ©ãƒ³ã‚¹ã§ã™ã€‚%1 != %2。", + /*1032,32*/ "Cpool ã®ã‚¤ãƒ³ãƒ‡ãƒƒã‚¯ã‚¹ %1 ㌠%2 ã®ç¯„囲外ã§ã™ã€‚", + /*1033,33*/ "Cpool ã®ã‚¨ãƒ³ãƒˆãƒª %1 ã®åž‹ãŒæ­£ã—ãã‚りã¾ã›ã‚“。", + /*1034,34*/ "強制型変æ›ã«å¤±æ•—ã—ã¾ã—ãŸã€‚%1 ã‚’ %2 ã«å¤‰æ›ã§ãã¾ã›ã‚“。", + /*1035,35*/ "メソッド %1 ã§ç„¡åŠ¹ãª super å¼ãŒè¦‹ã¤ã‹ã‚Šã¾ã—ãŸã€‚", + /*1037,36*/ "%2 ã®ãƒ¡ã‚½ãƒƒãƒ‰ %1 ã«ä»£å…¥ã§ãã¾ã›ã‚“。", + /*1038,37*/ "%1 ã¯å®šç¾©æ¸ˆã¿ã§ã™ã€‚", + /*1039,38*/ "メソッドã¯å‚ç…§ã•れるã¾ã§æ¤œè¨¼ã§ãã¾ã›ã‚“。", + /*1040,39*/ "instanceof ã®å³å´ã¯ã‚¯ãƒ©ã‚¹ã¾ãŸã¯é–¢æ•°ã§ãªã‘れã°ãªã‚Šã¾ã›ã‚“。", + /*1041,40*/ "演算å­ã®å³å´ã¯ã‚¯ãƒ©ã‚¹ã§ãªã‘れã°ãªã‚Šã¾ã›ã‚“。", + /*1042,41*/ "ABC ファイルã§ã¯ã‚りã¾ã›ã‚“。major_version=%1 minor_version=%2 ã§ã™ã€‚", + /*1043,42*/ "code_length=%1 ãŒç„¡åйã§ã™ã€‚", + /*1044,43*/ "MethodInfo-%1 サãƒãƒ¼ãƒˆã•れã¦ã„ãªã„フラグ =%2。", + /*1045,44*/ "サãƒãƒ¼ãƒˆã•れã¦ã„ãªã„ç¨®é¡žã®æ©Ÿèƒ½ =%1。", + /*1046,45*/ "MethodInfo-%1 ãŒå®šç¾©ã®å‰ã«å‚ç…§ã•れã¦ã„ã¾ã™ã€‚", + /*1047,46*/ "エントリãƒã‚¤ãƒ³ãƒˆãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“ã§ã—ãŸã€‚", + /*1049,47*/ "プロトタイプオブジェクトã¯ãƒãƒ‹ãƒ©ã‚ªãƒ–ジェクトã§ãªã‘れã°ãªã‚Šã¾ã›ã‚“。", + /*1050,48*/ "%1 をプリミティブã«å¤‰æ›ã§ãã¾ã›ã‚“。", + /*1051,49*/ "%1 ã¸ã®ã‚¢ãƒ¼ãƒªãƒ¼ãƒã‚¤ãƒ³ãƒ‡ã‚£ãƒ³ã‚°ã‚¢ã‚¯ã‚»ã‚¹ãŒç„¡åйã§ã™ã€‚", + /*1052,50*/ "無効㪠URI ㌠%1 é–¢æ•°ã«æ¸¡ã•れã¾ã—ãŸã€‚", + /*1053,51*/ "%2 ã® %1 ã®ã‚ªãƒ¼ãƒãƒ¼ãƒ©ã‚¤ãƒ‰ãŒç„¡åйã§ã™ã€‚", + /*1054,52*/ "例外ãƒãƒ³ãƒ‰ãƒ©ã®ç¯„囲ã¾ãŸã¯ã‚¿ãƒ¼ã‚²ãƒƒãƒˆã‚ªãƒ•セットãŒç„¡åйã§ã™ã€‚", + /*1056,53*/ "%2 ã®ãƒ—ロパティ %1 を作æˆã§ãã¾ã›ã‚“。", + /*1057,54*/ "%1 ã¯ãƒ¡ã‚½ãƒƒãƒ‰ã—ã‹å«ã‚€ã“ã¨ãŒã§ãã¾ã›ã‚“。", + /*1058,55*/ "無効ãªã‚ªãƒšãƒ©ãƒ³ãƒ‰åž‹ :%1 㯠%2 ã§ãªã‘れã°ãªã‚Šã¾ã›ã‚“。", + /*1059,56*/ "ClassInfo-%1 ãŒå®šç¾©ã®å‰ã«å‚ç…§ã•れã¦ã„ã¾ã™ã€‚", + /*1060,57*/ "ClassInfo %1 ㌠class_count=%2 ã‚’è¶…ãˆã¦ã„ã¾ã™ã€‚", + /*1061,58*/ "値 %1 ã‚’ %2 ã«å¤‰æ›ã™ã‚‹ã¨ç²¾åº¦ãŒå¤±ã‚れã¾ã™ã€‚", + /*1063,59*/ "%1 ã®å¼•æ•°ã®æ•°ãŒä¸€è‡´ã—ã¦ã„ã¾ã›ã‚“。%2 ãŒå¿…è¦ã§ã™ãŒã€%3 ãŒæŒ‡å®šã•れã¾ã—ãŸã€‚", + /*1064,60*/ "メソッド %1 をコンストラクタã¨ã—ã¦å‘¼ã³å‡ºã™ã“ã¨ã¯ã§ãã¾ã›ã‚“。", + /*1065,61*/ "変数 %1 ã¯å®šç¾©ã•れã¦ã„ã¾ã›ã‚“。", + /*1066,62*/ "function('function body') ã¨ã„ã†æ›¸å¼ã¯ã‚µãƒãƒ¼ãƒˆã•れã¦ã„ã¾ã›ã‚“。", + /*1067,63*/ "ãƒã‚¤ãƒ†ã‚£ãƒ–メソッド %1 ã®ãƒ¡ã‚½ãƒƒãƒ‰ãƒœãƒ‡ã‚£ãŒç„¡åйã§ã™ã€‚", + /*1068,64*/ "%1 㨠%2 ã¯å…±æœ‰ã§ãã¾ã›ã‚“。", + /*1069,65*/ "%2 ã«ãƒ—ロパティ %1 ãŒè¦‹ã¤ã‹ã‚‰ãšã€ãƒ‡ãƒ•ォルト値もã‚りã¾ã›ã‚“。", + /*1070,66*/ "%2 ã«ãƒ¡ã‚½ãƒƒãƒ‰ %1 ãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“。", + /*1071,67*/ "関数 %1 㯠%2 ã«ãƒã‚¤ãƒ³ãƒ‰æ¸ˆã¿ã§ã™ã€‚", + /*1072,68*/ "Disp_id 0 ãŒç„¡åйã§ã™ã€‚", + /*1073,69*/ "disp_id %2 ãŒé‡è¤‡ã—ã¦ã„ã‚‹ãŸã‚ã«ã€éžã‚ªãƒ¼ãƒãƒ¼ãƒ©ã‚¤ãƒ‰ãƒ¡ã‚½ãƒƒãƒ‰ %1 ãŒç½®æ›ã•れã¾ã—ãŸã€‚", + /*1074,70*/ "%2 ã®èª­ã¿å–り専用プロパティ %1 ã¸ã¯æ›¸ãè¾¼ã¿ã§ãã¾ã›ã‚“。", + /*1075,71*/ "Math ã¯é–¢æ•°ã§ã¯ã‚りã¾ã›ã‚“。", + /*1076,72*/ "Math ã¯ã‚³ãƒ³ã‚¹ãƒˆãƒ©ã‚¯ã‚¿ã§ã¯ã‚りã¾ã›ã‚“。", + /*1077,73*/ "%2 ã®æ›¸ãè¾¼ã¿å°‚用プロパティ %1 ã®èª­ã¿è¾¼ã¿ã¯ç„¡åйã§ã™ã€‚", + /*1078,74*/ "オプコードã¨ãƒžãƒ«ãƒãƒãƒ¼ãƒ ã®çµ„ã¿åˆã‚ã›ãŒç„¡åйã§ã™ :%1<%2>。", + /*1079,75*/ "読ã¿è¾¼ã¾ã‚ŒãŸã‚³ãƒ¼ãƒ‰ã§ã¯ãƒã‚¤ãƒ†ã‚£ãƒ–メソッドを使用ã§ãã¾ã›ã‚“。", + /*1080,76*/ "åå‰ç©ºé–“ã®å€¤ãŒç„¡åйã§ã™ã€‚", + /*1081,77*/ "%2 ã«ãƒ—ロパティ %1 ãŒè¦‹ã¤ã‹ã‚‰ãšã€ãƒ‡ãƒ•ォルト値もã‚りã¾ã›ã‚“。", + /*1082,78*/ "デフォルトã®åå‰ç©ºé–“ãŒè¨­å®šã•れã¦ã„ã¾ã›ã‚“。", + /*1083,79*/ "エレメント \"%2\" ã®æŽ¥é ­è¾ž \"%1\" ãŒãƒã‚¤ãƒ³ãƒ‰ã•れã¦ã„ã¾ã›ã‚“。", + /*1084,80*/ "エレメントã¾ãŸã¯å±žæ€§ (\"%1\") ㌠QName プロダクションã¨ä¸€è‡´ã—ã¾ã›ã‚“ : QName::=(NCName':')?NCName。", + /*1085,81*/ "エレメント型 \"%1\" ã¯å¯¾å¿œã™ã‚‹çµ‚了タグ \"\" ã§çµ‚了ã™ã‚‹å¿…è¦ãŒã‚りã¾ã™ã€‚", + /*1086,82*/ "%1 メソッドã¯ã€å˜ä¸€ã®ã‚¢ã‚¤ãƒ†ãƒ ã‚’å«ã‚€ãƒªã‚¹ãƒˆã«å¯¾ã—ã¦ã®ã¿ä½¿ç”¨ã§ãã¾ã™ã€‚", + /*1087,83*/ "インデックス付ãã® XML ã¸ã®ä»£å…¥ã¯è¨±å¯ã•れã¾ã›ã‚“。", + /*1088,84*/ "ルートエレメントã«ç¶šãドキュメントã®ãƒžãƒ¼ã‚¯ã‚¢ãƒƒãƒ—ã¯æ•´å½¢å¼ã§ãªã‘れã°ãªã‚Šã¾ã›ã‚“。", + /*1089,85*/ "複数ã®ã‚¢ã‚¤ãƒ†ãƒ ã‚’å«ã‚€ãƒªã‚¹ãƒˆã¸ã®ä»£å…¥ã¯ã‚µãƒãƒ¼ãƒˆã•れã¦ã„ã¾ã›ã‚“。", + /*1090,86*/ "XML パーサエラー :エレメントã®å½¢å¼ãŒæ­£ã—ãã‚りã¾ã›ã‚“。", + /*1091,87*/ "XML パーサエラー :CDATA セクションãŒçµ‚了ã—ã¦ã„ã¾ã›ã‚“。", + /*1092,88*/ "XML パーサエラー :XML 宣言ãŒçµ‚了ã—ã¦ã„ã¾ã›ã‚“。", + /*1093,89*/ "XML パーサエラー :DOCTYPE 宣言ãŒçµ‚了ã—ã¦ã„ã¾ã›ã‚“。", + /*1094,90*/ "XML パーサエラー :コメントãŒçµ‚了ã—ã¦ã„ã¾ã›ã‚“。", + /*1095,91*/ "XML パーサエラー :属性ãŒçµ‚了ã—ã¦ã„ã¾ã›ã‚“。", + /*1096,92*/ "XML パーサエラー :エレメントãŒçµ‚了ã—ã¦ã„ã¾ã›ã‚“。", + /*1097,93*/ "XML パーサエラー :処ç†å‘½ä»¤ãŒçµ‚了ã—ã¦ã„ã¾ã›ã‚“。", + /*1098,94*/ "no namespace ã®æŽ¥é ­è¾ž %1 ãŒç„¡åйã§ã™ã€‚", + /*1100,95*/ "RegExp ã‹ã‚‰åˆ¥ã® RegExp を構築ã™ã‚‹éš›ã«ãƒ•ラグを渡ã™ã“ã¨ã¯ã§ãã¾ã›ã‚“。", + /*1101,96*/ "䏿˜Žãªã‚¹ã‚³ãƒ¼ãƒ—ã‚’æŒã¤ãƒ¡ã‚½ãƒƒãƒ‰ %1 を検証ã§ãã¾ã›ã‚“。", + /*1102,97*/ "åž‹ %1 ã®ãƒ‡ãƒ•ォルト値ãŒç„¡åйã§ã™ã€‚", + /*1103,98*/ "クラス %1 ã¯ã€final 基本クラスを拡張ã§ãã¾ã›ã‚“。", + /*1104,99*/ "属性 \"%1\" (エレメント \"%2\") ã¯æ—¢ã«æŒ‡å®šã•れã¦ã„ã¾ã™ã€‚", + /*1107,100*/ "ABC データã¯ç ´æã—ã¦ã„ã‚‹ãŸã‚ã€å¢ƒç•Œå¤–ã®èª­ã¿å–りãŒè©¦è¡Œã•れã¾ã—ãŸã€‚", + /*1108,101*/ "OP_newclass オプコードãŒä¸æ­£ãªåŸºæœ¬ã‚¯ãƒ©ã‚¹ã§ä½¿ç”¨ã•れã¾ã—ãŸã€‚", + /*1109,102*/ "çµåˆã•れã¦ã„ãªã„関数 %1 をメソッド %2 ã‹ã‚‰ç›´æŽ¥å‘¼ã³å‡ºãã†ã¨ã—ã¾ã—ãŸã€‚", + /*1110,103*/ "%1 㯠%2 ã‚’æ‹¡å¼µã§ãã¾ã›ã‚“。", + /*1111,104*/ "%1 㯠%2 を実装ã§ãã¾ã›ã‚“。", + /*1112,105*/ "クラスã®åž‹å¤‰æ›ã«æŒ‡å®šã•れãŸå¼•æ•°ã®æ•°ãŒä¸æ­£ã§ã™ã€‚1 個必è¦ã§ã™ãŒã€%1 個指定ã•れã¾ã—ãŸã€‚", + /*1113,106*/ "OP_newactivation ㌠NEED_ACTIVATION フラグãªã—ã§ãƒ¡ã‚½ãƒƒãƒ‰ã§ä½¿ç”¨ã•れã¾ã—ãŸã€‚", + /*1114,107*/ "グローãƒãƒ«ã‚¹ã‚³ãƒ¼ãƒ—ãªã—ã§ OP_getglobalslot ã¾ãŸã¯ OP_setglobalslot ãŒä½¿ç”¨ã•れã¾ã—ãŸã€‚", + /*1115,108*/ "%1 ã¯ã‚³ãƒ³ã‚¹ãƒˆãƒ©ã‚¯ã‚¿ã§ã¯ã‚りã¾ã›ã‚“。", + /*1116,109*/ "Function.prototype.apply ã® 2 番目ã®å¼•æ•°ã¯é…列ã§ãªã‘れã°ãªã‚Šã¾ã›ã‚“。", + /*1117,110*/ "無効㪠XML å : %1。", + /*1118,111*/ "ノード間ã«ä¸æ­£ãªå‘¨æœŸçš„ãªãƒ«ãƒ¼ãƒ—ãŒã‚りã¾ã™ã€‚", + /*1119,112*/ "Delete 演算å­ã¯ã‚ªãƒšãƒ©ãƒ³ãƒ‰åž‹ %1 ã§ã‚µãƒãƒ¼ãƒˆã•れã¦ã„ã¾ã›ã‚“。", + /*1120,113*/ "%2 ã®ãƒ—ロパティ %1 を削除ã§ãã¾ã›ã‚“。", + /*1121,114*/ "メソッド %1 ã®ãƒ¡ã‚½ãƒƒãƒ‰ãƒœãƒ‡ã‚£ãŒé‡è¤‡ã—ã¦ã„ã¾ã™ã€‚", + /*1122,115*/ "インターフェイスメソッド %1 ã®ãƒ¡ã‚½ãƒƒãƒ‰ãƒœãƒ‡ã‚£ãŒç„¡åйã§ã™ã€‚", + /*1123,116*/ "Filter 演算å­ã¯åž‹ %1 ã§ã‚µãƒãƒ¼ãƒˆã•れã¦ã„ã¾ã›ã‚“。", + /*1124,117*/ "OP_hasnext2 を明示的ã«ç™»éŒ²ã™ã‚‹ã«ã¯ã€ã‚ªãƒ–ジェクトã¨ã‚¤ãƒ³ãƒ‡ãƒƒã‚¯ã‚¹ãŒå¿…è¦ã§ã™ã€‚", + /*1500,118*/ "ファイル %1 ã‚’é–‹ãéš›ã«ã‚¨ãƒ©ãƒ¼ãŒç™ºç”Ÿã—ã¾ã—ãŸã€‚", + /*1501,119*/ "ファイル %1 ã«æ›¸ã込む際ã«ã‚¨ãƒ©ãƒ¼ãŒç™ºç”Ÿã—ã¾ã—ãŸã€‚", + /*1502,120*/ "スクリプトãŒãƒ‡ãƒ•ォルトã®ã‚¿ã‚¤ãƒ ã‚¢ã‚¦ãƒˆæ™‚é–“ã® 15 ç§’ã‚’è¶…ãˆã¦å®Ÿè¡Œã•れã¾ã—ãŸã€‚", + /*1503,121*/ "スクリプト㌠30 秒後ã®çµ‚了ã«å¤±æ•—ã—ãŸãŸã‚ã€å¼·åˆ¶çµ‚了ã—ã¾ã—ãŸã€‚", + /*1504,122*/ "ファイルã®çµ‚端ã§ã™ã€‚", + /*1505,123*/ "文字列インデックス %1 ãŒå¢ƒç•Œå¤–ã§ã™ã€‚%2 ~ %3 ã®ç¯„囲内ã§ã‚ã‚‹å¿…è¦ãŒã‚りã¾ã™ã€‚", + /*1506,124*/ "指定ã—ãŸç¯„囲ã¯ç„¡åйã§ã™ã€‚", + /*1507,125*/ "引数 %1 㯠null ã«ã™ã‚‹ã“ã¨ãŒã§ãã¾ã›ã‚“。", + /*1508,126*/ "引数 %1 ã«æŒ‡å®šã—ãŸå€¤ã¯ç„¡åйã§ã™ã€‚", + /*1509,127*/ "圧縮データã®è§£å‡æ™‚ã«ã‚¨ãƒ©ãƒ¼ãŒç™ºç”Ÿã—ã¾ã—ãŸã€‚", + /*1510,128*/ "コールãƒãƒƒã‚¯å¼•æ•°ãŒã‚¯ãƒ©ã‚¹ã®ãƒ¡ã‚½ãƒƒãƒ‰ã®ã¨ãã€ä»»æ„指定ã®å¼•æ•° 'this' 㯠null ã§ãªã‘れã°ãªã‚Šã¾ã›ã‚“。" + }, + // ko + { + /*1000,0*/ "ì‹œìŠ¤í…œì˜ ë©”ëª¨ë¦¬ê°€ 부족합니다.", + /*1001,1*/ "메서드 %1ì´(ê°€) 구현ë˜ì§€ 않습니다.", + /*1002,2*/ "ì •ë°€ë„ ì¸ìˆ˜ëŠ” %2ê³¼ %3 사ì´ì˜ ê°’ì´ì–´ì•¼ 합니다. %1ì€(는) 유효하지 않습니다.", + /*1003,3*/ "기수 ì¸ìˆ˜ëŠ” 2와 36 사ì´ì˜ ê°’ì´ì–´ì•¼ 하지만 %1입니다.", + /*1004,4*/ "호환ë˜ì§€ 않는 ê°ì²´ì—서 메서드 %1ì„(를) 호출했습니다.", + /*1005,5*/ "ë°°ì—´ ì¸ë±ìŠ¤ê°€ ì–‘ì˜ ì •ìˆ˜(%1)ê°€ 아닙니다.", + /*1006,6*/ "%1ì€(는) 함수가 아닙니다.", + /*1007,7*/ "비ìƒì„±ìžì—서 ì¸ìŠ¤í„´ìŠ¤í™”ë¥¼ 시ë„했습니다.", + /*1008,8*/ "%1ì€(는) 모호합니다. ì¼ì¹˜í•˜ëŠ” ë°”ì¸ë”©ì´ ë‘ ê°œ ì´ìƒ 있습니다.", + /*1009,9*/ "null ê°ì²´ ì°¸ì¡°ì˜ ì†ì„±ì´ë‚˜ ë©”ì„œë“œì— ì•¡ì„¸ìŠ¤í•  수 없습니다.", + /*1010,10*/ "ì •ì˜ë˜ì§€ ì•Šì€ ìš©ì–´ì´ë©° ì†ì„±ì´ 없습니다.", + /*1011,11*/ "메서드 %1ì€(는) ìž˜ëª»ëœ opcode %2ì„(를) í¬í•¨í•˜ê³  있습니다(오프셋 %3ì— ìžˆìŒ).", + /*1012,12*/ "마지막 ëª…ë ¹ì´ ì½”ë“œ í¬ê¸°ë¥¼ 초과했습니다.", + /*1013,13*/ "scopeDepthê°€ 0ì´ë©´ OP_findproperty를 호출할 수 없습니다.", + /*1014,14*/ "í´ëž˜ìФ %1ì„(를) ì°¾ì„ ìˆ˜ 없습니다.", + /*1015,15*/ "메서드 %1ì€(는) 기본 xml 네임스페ì´ìŠ¤ë¥¼ 설정할 수 없습니다.", + /*1016,16*/ "하위 ì—°ì‚°ìž(..)는 %1 유형ì—서 ì§€ì›ë˜ì§€ 않습니다.", + /*1017,17*/ "범위 ìŠ¤íƒ ì˜¤ë²„í”Œë¡œê°€ ë°œìƒí–ˆìŠµë‹ˆë‹¤.", + /*1018,18*/ "범위 ìŠ¤íƒ ì–¸ë”플로가 ë°œìƒí–ˆìŠµë‹ˆë‹¤.", + /*1019,19*/ "Getscopeobject %1ì´(ê°€) 범위를 벗어났습니다.", + /*1020,20*/ "코드는 메서드 ë ë¶€ë¶„ì„ ë²—ì–´ë‚  수 없습니다.", + /*1021,21*/ "ì ì–´ë„ í•˜ë‚˜ì˜ ë¶„ê¸° 대ìƒì´ ë©”ì„œë“œì˜ ìœ íš¨í•œ ëª…ë ¹ì— ìžˆì§€ 않습니다.", + /*1022,22*/ "void 형ì‹ì€ 함수 반환 형ì‹ìœ¼ë¡œë§Œ 사용할 수 있습니다.", + /*1023,23*/ "ìŠ¤íƒ ì˜¤ë²„í”Œë¡œê°€ ë°œìƒí–ˆìŠµë‹ˆë‹¤.", + /*1024,24*/ "ìŠ¤íƒ ì–¸ë”플로가 ë°œìƒí–ˆìŠµë‹ˆë‹¤.", + /*1025,25*/ "유효하지 ì•Šì€ ë ˆì§€ìŠ¤í„° %1ì„(를) 액세스했습니다.", + /*1026,26*/ "슬롯 %1ì´(ê°€) %3ì˜ slotCount=%2ì„(를) 초과했습니다.", + /*1027,27*/ "Method_info %1ì´(ê°€) method_count=%2ì„(를) 초과했습니다.", + /*1028,28*/ "Disp_id %1ì´(ê°€) %3ì˜ max_disp_id=%2ì„(를) 초과했습니다.", + /*1029,29*/ "Disp_id %1ì´(ê°€) %2ì— ì •ì˜ë˜ì–´ 있지 않습니다.", + /*1030,30*/ "ìŠ¤íƒ ê¹Šì´ì˜ ê· í˜•ì´ ë§žì§€ 않습니다. %1 != %2", + /*1031,31*/ "범위 심ë„ì˜ ê· í˜•ì´ ë§žì§€ 않습니다. %1 != %2", + /*1032,32*/ "Cpool ì¸ë±ìФ %1ì´(ê°€) 범위 %2ì„(를) 벗어났습니다.", + /*1033,33*/ "Cpool 항목 %1ì€(는) ìž˜ëª»ëœ ìœ í˜•ìž…ë‹ˆë‹¤.", + /*1034,34*/ "유형 ê°•ì œ ë³€í™˜ì— ì‹¤íŒ¨í–ˆìŠµë‹ˆë‹¤. %1ì„(를) %2(으)로 변환할 수 없습니다.", + /*1035,35*/ "메서드 %1ì— ìž˜ëª»ëœ super 표현ì‹ì´ 있습니다.", + /*1037,36*/ "%2ì˜ ë©”ì„œë“œ %1ì— í• ë‹¹í•  수 없습니다.", + /*1038,37*/ "%1ì´(ê°€) ì´ë¯¸ ì •ì˜ë˜ì–´ 있습니다.", + /*1039,38*/ "참조할 때까지 메서드를 확ì¸í•  수 없습니다.", + /*1040,39*/ "instanceofì˜ ì˜¤ë¥¸ìª½ì€ í´ëž˜ìФ ë˜ëŠ” 함수여야 합니다.", + /*1041,40*/ "ì—°ì‚°ìžì˜ ì˜¤ë¥¸ìª½ì€ í´ëž˜ìŠ¤ì—¬ì•¼ 합니다.", + /*1042,41*/ "ABC 파ì¼ì´ 아닙니다. major_version=%1 minor_version=%2", + /*1043,42*/ "code_length=%1ì´(ê°€) 유효하지 않습니다.", + /*1044,43*/ "flags=%1ì„(를) ì§€ì›í•˜ì§€ 않는 MethodInfo-%2입니다.", + /*1045,44*/ "traits kind=%1ì„(를) ì§€ì›í•˜ì§€ 않습니다.", + /*1046,45*/ "ì •ì˜í•˜ê¸° ì „ì— MethodInfo-%1ì„(를) 참조합니다.", + /*1047,46*/ "ì§„ìž…ì ì„ ì°¾ì„ ìˆ˜ 없습니다.", + /*1049,47*/ "프로토타입 ê°ì²´ëŠ” vanilla ê°ì²´ì—¬ì•¼ 합니다.", + /*1050,48*/ "%1ì„(를) ì›ì‹œ 값으로 변환할 수 없습니다.", + /*1051,49*/ "%1ì— ëŒ€í•œ 초기 ë°”ì¸ë”© 액세스가 잘못ë˜ì—ˆìŠµë‹ˆë‹¤.", + /*1052,50*/ "%1 í•¨ìˆ˜ì— ìœ íš¨í•˜ì§€ ì•Šì€ URIê°€ 전달ë˜ì—ˆìŠµë‹ˆë‹¤.", + /*1053,51*/ "%2ì˜ %1ì— ëŒ€í•œ 재정ì˜ê°€ 잘못ë˜ì—ˆìŠµë‹ˆë‹¤.", + /*1054,52*/ "예외 í•¸ë“¤ëŸ¬ì˜ ë²”ìœ„ ë˜ëŠ” ëŒ€ìƒ ì˜¤í”„ì…‹ì´ ìž˜ëª»ë˜ì—ˆìŠµë‹ˆë‹¤.", + /*1056,53*/ "%2ì— ì†ì„± %1ì„(를) 만들 수 없습니다.", + /*1057,54*/ "%1ì€(는) 메서드만 í¬í•¨í•  수 있습니다.", + /*1058,55*/ "í”¼ì—°ì‚°ìž ìœ í˜•ì´ ìž˜ëª»ë˜ì—ˆìŠµë‹ˆë‹¤. %1ì€(는) %2ì´ì–´ì•¼ 합니다.", + /*1059,56*/ "ì •ì˜í•˜ê¸° ì „ì— ClassInfo-%1ì„(를) 참조합니다.", + /*1060,57*/ "ClassInfo %1ì´(ê°€) class_count=%2ì„(를) 초과했습니다.", + /*1061,58*/ "ì •ë°€ë„ì˜ ì†ìƒ ì—†ì´ëŠ” ê°’ %1ì„(를) %2(으)로 변환할 수 없습니다.", + /*1063,59*/ "%1ì—서 ì¸ìˆ˜ 개수가 ì¼ì¹˜í•˜ì§€ 않습니다. %2개가 필요하지만 %3개가 있습니다.", + /*1064,60*/ "메서드 %1ì„(를) ìƒì„±ìžë¡œ 호출할 수 없습니다.", + /*1065,61*/ "변수 %1ì´(ê°€) ì •ì˜ë˜ì–´ 있지 않습니다.", + /*1066,62*/ "ì–‘ì‹ í•¨ìˆ˜('함수 본문')는 ì§€ì›ë˜ì§€ 않습니다.", + /*1067,63*/ "기본 메서드 %1ì˜ ë©”ì„œë“œ ë³¸ë¬¸ì´ ìž˜ëª»ë˜ì—ˆìŠµë‹ˆë‹¤.", + /*1068,64*/ "%1ê³¼(와) %2ì„(를) ì¡°ì •í•  수 없습니다.", + /*1069,65*/ "%2ì—서 ì†ì„± %1ì„(를) ì°¾ì„ ìˆ˜ 없습니다. ê¸°ë³¸ê°’ì´ ì—†ìŠµë‹ˆë‹¤.", + /*1070,66*/ "%2ì—서 메서드 %1ì„(를) ì°¾ì„ ìˆ˜ 없습니다.", + /*1071,67*/ "함수 %1ì´(ê°€) ì´ë¯¸ %2ì— ë°”ì¸ë”©ë˜ì—ˆìŠµë‹ˆë‹¤.", + /*1072,68*/ "Disp_id 0ì´ ìž˜ëª»ë˜ì—ˆìŠµë‹ˆë‹¤.", + /*1073,69*/ "ë³µì œëœ disp_id %2(으)로 ì¸í•´ 재정ì˜ë˜ì§€ ì•Šì€ ë©”ì„œë“œ %1ì´(ê°€) 대체ë˜ì—ˆìŠµë‹ˆë‹¤.", + /*1074,70*/ "%2ì˜ ì½ê¸° ì „ìš© ì†ì„± %1ì—는 쓸 수 없습니다.", + /*1075,71*/ "Math는 함수가 아닙니다.", + /*1076,72*/ "Math는 ìƒì„±ìžê°€ 아닙니다.", + /*1077,73*/ "%2ì˜ ì“°ê¸° ì „ìš© ì†ì„± %1ì€(는) ì½ì„ 수 없습니다.", + /*1078,74*/ "ìž˜ëª»ëœ opcode/multiname 조합입니다. %1<%2>.", + /*1079,75*/ "ë¡œë“œëœ ì½”ë“œì—는 기본 메서드를 사용할 수 없습니다.", + /*1080,76*/ "네임스페ì´ìŠ¤ì˜ ê°’ì´ ìž˜ëª»ë˜ì—ˆìŠµë‹ˆë‹¤.", + /*1081,77*/ "ì†ì„± %1ì„(를) %2ì—서 ì°¾ì„ ìˆ˜ 없습니다. ê¸°ë³¸ê°’ì´ ì—†ìŠµë‹ˆë‹¤.", + /*1082,78*/ "기본 네임스페ì´ìŠ¤ê°€ 설정ë˜ì§€ 않았습니다.", + /*1083,79*/ "요소 \"%2\"ì— ëŒ€í•œ ì ‘ë‘ì–´ \"%1\"ì´(ê°€) ë°”ì¸ë”©ë˜ì§€ 않았습니다.", + /*1084,80*/ "요소 ë˜ëŠ” ì†ì„±(\"%1\")ì´ QName ìƒì„± 규칙과 ì¼ì¹˜í•˜ì§€ 않습니다. QName::=(NCName':')?NCName", + /*1085,81*/ "요소 유형 \"%1\"ì€(는) ì¼ì¹˜í•˜ëŠ” ë 태그 \"\"(으)로 ë나야 합니다.", + /*1086,82*/ "%1 메서드는 항목 하나를 í¬í•¨í•œ 목ë¡ì—서만 ìž‘ë™í•©ë‹ˆë‹¤.", + /*1087,83*/ "ì¸ë±ì‹±ëœ XMLì— í• ë‹¹í•  수 없습니다.", + /*1088,84*/ "루트 요소 다ìŒì— 나오는 문서 ë‚´ì˜ íƒœê·¸ëŠ” 올바른 형ì‹ì´ì–´ì•¼ 합니다.", + /*1089,85*/ "둘 ì´ìƒì˜ í•­ëª©ì´ ìžˆëŠ” 목ë¡ì— í• ë‹¹ì´ ì§€ì›ë˜ì§€ 않습니다.", + /*1090,86*/ "XML 파서 실패: 요소가 잘못ë˜ì—ˆìŠµë‹ˆë‹¤.", + /*1091,87*/ "XML 파서 실패: CDATA ì„¹ì…˜ì´ ì¢…ê²°ë˜ì§€ 않았습니다.", + /*1092,88*/ "XML 파서 실패: XML ì„ ì–¸ì´ ì¢…ê²°ë˜ì§€ 않았습니다.", + /*1093,89*/ "XML 파서 실패: DOCTYPE ì„ ì–¸ì´ ì¢…ê²°ë˜ì§€ 않았습니다.", + /*1094,90*/ "XML 파서 실패: 주ì„ì´ ì¢…ê²°ë˜ì§€ 않았습니다.", + /*1095,91*/ "XML 파서 실패: ì†ì„±ì´ 종결ë˜ì§€ 않았습니다.", + /*1096,92*/ "XML 파서 실패: 요소가 종결ë˜ì§€ 않았습니다.", + /*1097,93*/ "XML 파서 실패: 처리 ëª…ë ¹ì´ ì¢…ê²°ë˜ì§€ 않았습니다.", + /*1098,94*/ "네임스페ì´ìФ ì—†ìŒì— 대한 ì ‘ë‘ì–´ %1ì´(ê°€) 잘못ë˜ì—ˆìŠµë‹ˆë‹¤.", + /*1100,95*/ "다른 RegExp로부터 í•˜ë‚˜ì˜ RegExp를 만드는 경우 플래그를 제공할 수 없습니다.", + /*1101,96*/ "범위를 알 수 없는 메서드 %1ì€(는) 확ì¸í•  수 없습니다.", + /*1102,97*/ "유형 %1ì˜ ê¸°ë³¸ê°’ì´ ìž˜ëª»ë˜ì—ˆìŠµë‹ˆë‹¤.", + /*1103,98*/ "í´ëž˜ìФ %1ì€(는) 최종 기본 í´ëž˜ìŠ¤ë¥¼ 확장할 수 없습니다.", + /*1104,99*/ "ì†ì„± \"%1\"ì´(ê°€) 요소 \"%2\"ì— ëŒ€í•´ ì´ë¯¸ 지정ë˜ì—ˆìŠµë‹ˆë‹¤.", + /*1107,100*/ "ABC ë°ì´í„°ê°€ ì†ìƒë˜ì—ˆìœ¼ë©° 범위를 벗어나는 ì½ê¸°ë¥¼ 시ë„합니다.", + /*1108,101*/ "OP_newclass opcodeê°€ ìž˜ëª»ëœ ê¸°ë³¸ í´ëž˜ìФì—서 사용ë˜ì—ˆìŠµë‹ˆë‹¤.", + /*1109,102*/ "언바운드 함수 %1ì„(를) 메서드 %2(으)로부터 ì§ì ‘ 호출하려고 시ë„합니다.", + /*1110,103*/ "%1ì€(는) %2ì„(를) 확장할 수 없습니다.", + /*1111,104*/ "%1ì€(는) %2ì„(를) 구현할 수 없습니다.", + /*1112,105*/ "ì¸ìˆ˜ 개수가 í´ëž˜ìФ ê°•ì œ 변환 시 ì¼ì¹˜í•˜ì§€ 않습니다. 1개가 필요하지만 %1개가 있습니다.", + /*1113,106*/ "NEED_ACTIVATION 플래그가 없는 ë©”ì„œë“œì— OP_newactivationì´ ì‚¬ìš©ë˜ì—ˆìŠµë‹ˆë‹¤.", + /*1114,107*/ "ì „ì—­ 범위 ì—†ì´ OP_getglobalslot ë˜ëŠ” OP_setglobalslotì´ ì‚¬ìš©ë˜ì—ˆìŠµë‹ˆë‹¤.", + /*1115,108*/ "%1ì€(는) ìƒì„±ìžê°€ 아닙니다.", + /*1116,109*/ "Function.prototype.applyì˜ ë‘ ë²ˆì§¸ ì¸ìˆ˜ëŠ” ë°°ì—´ì´ì–´ì•¼ 합니다.", + /*1117,110*/ "ìž˜ëª»ëœ XML ì´ë¦„: %1", + /*1118,111*/ "노드 사ì´ì˜ 순환 루프가 잘못ë˜ì—ˆìŠµë‹ˆë‹¤.", + /*1119,112*/ "유형 %1ì˜ í”¼ì—°ì‚°ìžì— 대해서는 Delete ì—°ì‚°ìžê°€ ì§€ì›ë˜ì§€ 않습니다.", + /*1120,113*/ "%2ì˜ ì†ì„± %1ì„(를) 삭제할 수 없습니다.", + /*1121,114*/ "메서드 %1ì— ë³µì œëœ ë©”ì„œë“œ ë³¸ë¬¸ì´ ìžˆìŠµë‹ˆë‹¤.", + /*1122,115*/ "ì¸í„°íŽ˜ì´ìФ 메서드 %1ì— ìž˜ëª»ëœ ë©”ì„œë“œ ë³¸ë¬¸ì´ ìžˆìŠµë‹ˆë‹¤.", + /*1123,116*/ "유형 %1ì—서는 í•„í„° ì—°ì‚°ìžê°€ ì§€ì›ë˜ì§€ 않습니다.", + /*1124,117*/ "OP_hasnext2는 개별 레지스터가 ë˜ë ¤ë©´ ê°ì²´ ë° ì¸ë±ìŠ¤ê°€ 있어야 합니다.", + /*1500,118*/ "íŒŒì¼ %1ì„(를) 여는 ë™ì•ˆ 오류가 ë°œìƒí–ˆìŠµë‹ˆë‹¤.", + /*1501,119*/ "íŒŒì¼ %1ì— ì“°ëŠ” ë™ì•ˆ 오류가 ë°œìƒí–ˆìŠµë‹ˆë‹¤.", + /*1502,120*/ "스í¬ë¦½íЏ 실행 ì‹œê°„ì´ ê¸°ë³¸ 제한 ì‹œê°„ì¸ 15초를 초과했습니다.", + /*1503,121*/ "스í¬ë¦½íŠ¸ê°€ 30ì´ˆ 후ì—ë„ ë나지 않아 종료했습니다.", + /*1504,122*/ "파ì¼ì˜ ë입니다.", + /*1505,123*/ "문ìžì—´ ì¸ë±ìФ %1ì´(ê°€) 범위를 벗어났습니다. %2와 %3 사ì´ì˜ ë²”ìœ„ì— ìžˆì–´ì•¼ 합니다.", + /*1506,124*/ "유효하지 ì•Šì€ ë²”ìœ„ê°€ 지정ë˜ì—ˆìŠµë‹ˆë‹¤.", + /*1507,125*/ "ì¸ìˆ˜ %1ì€(는) nullì¼ ìˆ˜ 없습니다.", + /*1508,126*/ "ì¸ìˆ˜ %1ì— ì§€ì •ëœ ê°’ì´ ìœ íš¨í•˜ì§€ 않습니다.", + /*1509,127*/ "ë°ì´í„°ì˜ ì••ì¶•ì„ í‘¸ëŠ” ë™ì•ˆ 오류가 ë°œìƒí–ˆìŠµë‹ˆë‹¤.", + /*1510,128*/ "콜백 ì¸ìˆ˜ê°€ í´ëž˜ìŠ¤ì˜ ë©”ì„œë“œì¸ ê²½ìš° ì„ íƒì  ì¸ìˆ˜ 'this'는 nullì´ì–´ì•¼ 합니다." + }, + // zh_CN + { + /*1000,0*/ "系统内存ä¸è¶³ã€‚", + /*1001,1*/ "未实现 %1 方法。", + /*1002,2*/ "ç²¾åº¦å‚æ•°å¿…须介于 %2 到 %3 之间;%1 无效。", + /*1003,3*/ "åŸºæ•°å‚æ•°å¿…须介于 2 到 36 之间;当å‰å€¼ä¸º %1。", + /*1004,4*/ "对ä¸å…¼å®¹çš„对象调用了方法 %1。", + /*1005,5*/ "æ•°ç»„ç´¢å¼•ä¸æ˜¯æ­£æ•´æ•° (%1)。", + /*1006,6*/ "%1 䏿˜¯å‡½æ•°ã€‚", + /*1007,7*/ "å°è¯•å®žä¾‹åŒ–çš„å‡½æ•°ä¸æ˜¯æž„造函数。", + /*1008,8*/ "%1 有歧义;找到多个匹é…的绑定。", + /*1009,9*/ "无法访问空对象引用的属性或方法。", + /*1010,10*/ "术语尚未定义,并且无任何属性。", + /*1011,11*/ "方法 %1 包å«éžæ³• opcode %2 (åç§»é‡ä¸º %3)。", + /*1012,12*/ "最åŽä¸€æ¡æŒ‡ä»¤è¶…出代ç å¤§å°ã€‚", + /*1013,13*/ "当 scopeDepth 为 0 时,无法调用 OP_findproperty。", + /*1014,14*/ "无法找到类 %1。", + /*1015,15*/ "方法 %1 无法设置默认 XML 命å空间", + /*1016,16*/ "类型 %1 䏿”¯æŒåŽä»£è¿ç®—符 (..)。", + /*1017,17*/ "å‘生范围堆栈上溢。", + /*1018,18*/ "å‘生范围堆栈下溢。", + /*1019,19*/ "Getscopeobject %1 超出范围。", + /*1020,20*/ "代ç ä¸èƒ½è¶…出方法结尾。", + /*1021,21*/ "è‡³å°‘ä¸€ä¸ªåˆ†æ”¯ç›®æ ‡ä¸æ˜¯æ–¹æ³•中的有效指令。", + /*1022,22*/ "void 类型åªèƒ½ç”¨ä½œå‡½æ•°è¿”回类型。", + /*1023,23*/ "å‘生堆栈上溢。", + /*1024,24*/ "å‘生堆栈下溢。", + /*1025,25*/ "访问了无效的注册 %1。", + /*1026,26*/ "Slot %1 超出 %3 中 slotCount=%2 çš„é™åˆ¶ã€‚", + /*1027,27*/ "Method_info %1 超出 method_count=%2 çš„é™åˆ¶ã€‚", + /*1028,28*/ "Disp_id %1 超出 %3 中 max_disp_id=%2 çš„é™åˆ¶ã€‚", + /*1029,29*/ "Disp_id %1 在 %2 上未定义。", + /*1030,30*/ "堆栈深度ä¸å¯¹ç§°ã€‚%1 != %2。", + /*1031,31*/ "范围深度ä¸å¯¹ç§°ã€‚%1 != %2。", + /*1032,32*/ "Cpool 索引 %1 超出范围 %2。", + /*1033,33*/ "Cpool 项 %1 类型错误。", + /*1034,34*/ "强制转æ¢ç±»åž‹å¤±è´¥:无法将 %1 转æ¢ä¸º %2。", + /*1035,35*/ "å‘现方法 %1 ä¸­å­˜åœ¨éžæ³•çš„ super 表达å¼ã€‚", + /*1037,36*/ "无法在 %2 上为方法 %1 赋值。", + /*1038,37*/ "%1 已定义。", + /*1039,38*/ "åœ¨æ–¹æ³•è¢«å¼•ç”¨ä¹‹å‰æ— æ³•对其进行验è¯ã€‚", + /*1040,39*/ "instanceof çš„å³ä¾§å¿…须是类或函数。", + /*1041,40*/ "è¿ç®—符的å³ä¾§å¿…须是类。", + /*1042,41*/ "䏿˜¯ ABC 文件。major_version=%1 minor_version=%2。", + /*1043,42*/ "code_length=%1 无效。", + /*1044,43*/ "MethodInfo-%1 䏿”¯æŒ flags=%2。", + /*1045,44*/ "䏿”¯æŒ trait kind=%1。", + /*1046,45*/ "MethodInfo-%1 被引用时未定义。", + /*1047,46*/ "未找到入å£ç‚¹ã€‚", + /*1049,47*/ "原型对象必须是 vanilla 对象。", + /*1050,48*/ "无法将 %1 转æ¢ä¸ºåŽŸå§‹ç±»åž‹ã€‚", + /*1051,49*/ "对 %1 çš„æ—©æœŸç»‘å®šè®¿é—®æ˜¯éžæ³•的。", + /*1052,50*/ "传递给 %1 函数的 URI 无效。", + /*1053,51*/ "在 %2 ä¸­éžæ³•覆盖 %1。", + /*1054,52*/ "异常处ç†å‡½æ•°ä¸­å­˜åœ¨éžæ³•的范围或目标åç§»é‡ã€‚", + /*1056,53*/ "无法为 %2 创建属性 %1。", + /*1057,54*/ "%1 åªèƒ½åŒ…嫿–¹æ³•。", + /*1058,55*/ "éžæ³•çš„æ“作数类型: %1 必须是 %2。", + /*1059,56*/ "ClassInfo-%1 被引用时未定义。", + /*1060,57*/ "ClassInfo %1 超出 class_count=%2 çš„é™åˆ¶ã€‚", + /*1061,58*/ "æ— æ³•åœ¨ä¸æŸå¤±ç²¾åº¦çš„æƒ…况下将值 %1 转æ¢ä¸º %2。", + /*1063,59*/ "%1 çš„å‚æ•°æ•°é‡ä¸åŒ¹é…。应该有 %2 个,当å‰ä¸º %3 个。", + /*1064,60*/ "无法将方法 %1 作为构造函数调用。", + /*1065,61*/ "å˜é‡ %1 未定义。", + /*1066,62*/ "䏿”¯æŒ function('function body') å½¢å¼ã€‚", + /*1067,63*/ "内置方法 %1 嫿œ‰éžæ³•的方法正文。", + /*1068,64*/ "%1 å’Œ %2 无法å调一致。", + /*1069,65*/ "在 %2 上找ä¸åˆ°å±žæ€§ %1,且没有默认值。", + /*1070,66*/ "在 %2 上找ä¸åˆ°æ–¹æ³• %1", + /*1071,67*/ "函数 %1 已被绑定到 %2。", + /*1072,68*/ "Disp_id 0 æ˜¯éžæ³•的。", + /*1073,69*/ "由于 disp_id %2 çš„é‡å¤ï¼Œéžè¦†ç›–方法 %1 已被替æ¢ã€‚", + /*1074,70*/ "%2 上存在对åªè¯»å±žæ€§ %1 çš„éžæ³•写入。", + /*1075,71*/ "Math 䏿˜¯å‡½æ•°ã€‚", + /*1076,72*/ "Math 䏿˜¯æž„造函数。", + /*1077,73*/ "%2 上存在对åªå†™å±žæ€§ %1 çš„éžæ³•读å–。", + /*1078,74*/ "éžæ³•çš„ opcode/multiname 组åˆ: %1<%2>。", + /*1079,75*/ "载入代ç ä¸­ä¸å…许使用内置方法。", + /*1080,76*/ "éžæ³•的命å空间值。", + /*1081,77*/ "在 %2 上找ä¸åˆ°å±žæ€§ %1,且没有默认值。", + /*1082,78*/ "未设置默认的命å空间。", + /*1083,79*/ "元素“%2â€çš„å‰ç¼€â€œ%1â€æœªç»‘定。", + /*1084,80*/ "元素或属性 (“%1â€) 与 QName 定义ä¸åŒ¹é…: QName::=(NCName':')?NCName。", + /*1085,81*/ "元素类型“%1â€å¿…须以匹é…çš„ç»“æŸæ ‡è®°â€œâ€ç»“æŸã€‚", + /*1086,82*/ "%1 方法åªèƒ½ç”¨äºŽåŒ…å«å•一项目的列表。", + /*1087,83*/ "ä¸å…许对索引 XML 进行赋值。", + /*1088,84*/ "文档中根元素åŽé¢çš„æ ‡è®°æ ¼å¼å¿…须正确。", + /*1089,85*/ "䏿”¯æŒå¯¹åŒ…å«å¤šä¸ªé¡¹ç›®çš„列表进行赋值。", + /*1090,86*/ "XML 分æžå™¨å¤±è´¥: 元素格å¼ä¸æ­£ç¡®ã€‚", + /*1091,87*/ "XML 分æžå™¨å¤±è´¥: CDATA 部分未结æŸã€‚", + /*1092,88*/ "XML 分æžå™¨å¤±è´¥: XML 声明未结æŸã€‚", + /*1093,89*/ "XML 分æžå™¨å¤±è´¥: DOCTYPE 声明未结æŸã€‚", + /*1094,90*/ "XML 分æžå™¨å¤±è´¥: 注释未结æŸã€‚", + /*1095,91*/ "XML 分æžå™¨å¤±è´¥: 属性未结æŸã€‚", + /*1096,92*/ "XML 分æžå™¨å¤±è´¥: 元素未结æŸã€‚", + /*1097,93*/ "XML 分æžå™¨å¤±è´¥: 正在处ç†çš„æŒ‡ä»¤æœªç»“æŸã€‚", + /*1098,94*/ "no namespace å¸¦æœ‰éžæ³•å‰ç¼€ %1。", + /*1100,95*/ "在由一个 RegExp 构建å¦ä¸€ä¸ªçš„过程中无法æä¾›æ ‡å¿—。", + /*1101,96*/ "无法验è¯å…·æœ‰æœªçŸ¥èŒƒå›´çš„æ–¹æ³• %1。", + /*1102,97*/ "类型 %1 çš„é»˜è®¤å€¼éžæ³•。", + /*1103,98*/ "ç±» %1 ä¸èƒ½æ‰©å±•最终基类。", + /*1104,99*/ "已指定属性“%1â€(针对元素“%2â€)。", + /*1107,100*/ "ABC æ•°æ®å·²æŸå,å°è¯•çš„è¯»å–æ“作超出范围。", + /*1108,101*/ "OP_newclass opcode ä½¿ç”¨çš„åŸºç±»ä¸æ­£ç¡®ã€‚", + /*1109,102*/ "å°è¯•直接调用éžç»‘定函数 %1 (从方法 %2 中调用)。", + /*1110,103*/ "%1 无法扩展 %2。", + /*1111,104*/ "%1 无法实现 %2。", + /*1112,105*/ "类强制转æ¢çš„傿•°æ•°é‡ä¸åŒ¹é…。应为 1 个,当å‰ä¸º %1 个。", + /*1113,106*/ "方法中使用的 OP_newactivation 没有 NEED_ACTIVATION 标志。", + /*1114,107*/ "使用的 OP_getglobalslot 或 OP_setglobalslot ä¸å…·æœ‰å…¨å±€èŒƒå›´ã€‚", + /*1115,108*/ "%1 䏿˜¯æž„造函数。", + /*1116,109*/ "Function.prototype.apply çš„ç¬¬äºŒä¸ªå‚æ•°å¿…须是数组。", + /*1117,110*/ "XML å称无效: %1。", + /*1118,111*/ "èŠ‚ç‚¹é—´å­˜åœ¨éžæ³•循环。", + /*1119,112*/ "类型 %1 çš„æ“ä½œæ•°ä¸æ”¯æŒåˆ é™¤è¿ç®—符。", + /*1120,113*/ "无法为 %2 删除属性 %1。", + /*1121,114*/ "方法 %1 具有é‡å¤çš„æ–¹æ³•正文。", + /*1122,115*/ "æŽ¥å£æ–¹æ³• %1 嫿œ‰éžæ³•的方法正文。", + /*1123,116*/ "类型 %1 䏿”¯æŒè¿‡æ»¤è¿ç®—符。", + /*1124,117*/ "OP_hasnext2 è¦æ±‚对象和索引ä½äºŽä¸åŒçš„寄存器。", + /*1500,118*/ "打开文件 %1 时出错。", + /*1501,119*/ "写入文件 %1 时出错。", + /*1502,120*/ "脚本的执行时间已ç»è¶…过了 15 秒的默认超时设置。", + /*1503,121*/ "脚本未能在 30 ç§’åŽé€€å‡ºè€Œè¢«ç»ˆæ­¢ã€‚", + /*1504,122*/ "文件结尾。", + /*1505,123*/ "字符串索引 %1 超出范围;必须在 %2 到 %3 的范围内。", + /*1506,124*/ "指定的范围无效。", + /*1507,125*/ "傿•° %1 ä¸èƒ½ä¸ºç©ºã€‚", + /*1508,126*/ "ä¸ºå‚æ•° %1 指定的值无效。", + /*1509,127*/ "è§£åŽ‹ç¼©æ•°æ®æ—¶å‡ºé”™ã€‚", + /*1510,128*/ "å¦‚æžœå›žè°ƒå‚æ•°æ˜¯æŸä¸ªç±»çš„æ–¹æ³•,则å¯é€‰å‚数“thisâ€å¿…须为空。" + }, + // zh_TW + { + /*1000,0*/ "系統記憶體ä¸è¶³ã€‚", + /*1001,1*/ "未實作方法 %1。", + /*1002,2*/ "精確度引數必須介於 %2 å’Œ %3 之間;%1 無效。", + /*1003,3*/ "基數引數必須介於 2 å’Œ 36 之間;目å‰å¼•數為 %1。", + /*1004,4*/ "在ä¸ç›¸å®¹çš„物件上呼å«äº† %1 方法。", + /*1005,5*/ "é™£åˆ—ç´¢å¼•ä¸æ˜¯æ­£æ•´æ•¸ (%1)。", + /*1006,6*/ "%1 䏿˜¯å‡½æ•¸ã€‚", + /*1007,7*/ "嘗試個體化éžå»ºæ§‹å‡½å¼ã€‚", + /*1008,8*/ "%1 å‡ºç¾æ¨¡ç¨œå…©å¯çš„æƒ…æ³ï¼›æ‰¾åˆ°ä¸€å€‹ä»¥ä¸Šçš„相符繫çµã€‚", + /*1009,9*/ "ç„¡æ³•å­˜å– Null 物件åƒè€ƒçš„屬性或方法。", + /*1010,10*/ "詞彙未定義且沒有屬性。", + /*1011,11*/ "方法 %1 包å«ä¸åˆæ³•çš„ Opcode %2 (在ä½ç§» %3)。", + /*1012,12*/ "最後的指令超éŽç¨‹å¼ç¢¼å¤§å°ã€‚", + /*1013,13*/ "ç•¶ scopeDepth 是 0 æ™‚ï¼Œç„¡æ³•å‘¼å« OP_findproperty。", + /*1014,14*/ "找ä¸åˆ°é¡žåˆ¥ %1。", + /*1015,15*/ "方法 %1 無法設定é è¨­çš„ xml å稱空間", + /*1016,16*/ "類型 %1 䏿”¯æ´å­ç³»é‹ç®—å­ (..)。", + /*1017,17*/ "發生範åœå †ç–Šæº¢ä½ã€‚", + /*1018,18*/ "發生範åœå †ç–Šå呿º¢ä½ã€‚", + /*1019,19*/ "Getscopeobject %1 超出範åœã€‚", + /*1020,20*/ "程å¼ç¢¼ä¸èƒ½åœ¨æ–¹æ³•çš„çµå°¾ä¹‹å¤–。", + /*1021,21*/ "至少有一個分支目標ä¸åœ¨æ–¹æ³•中的有效指令上。", + /*1022,22*/ "類型 void åªèƒ½ç”¨ä¾†åšç‚ºå‡½æ•¸å‚³å›žé¡žåž‹ã€‚", + /*1023,23*/ "發生堆疊溢ä½ã€‚", + /*1024,24*/ "發生堆疊å呿º¢ä½ã€‚", + /*1025,25*/ "å­˜å–無效的註冊項目 %1。", + /*1026,26*/ "ä½ç½® %1 è¶…éŽ %3 çš„ slotCount= %2。", + /*1027,27*/ "Method_info %1 è¶…éŽ method_count=%2。", + /*1028,28*/ "Disp_id %1 è¶…éŽ %3 çš„ max_disp_id=%2。", + /*1029,29*/ "Disp_id %1 沒有定義於 %2。", + /*1030,30*/ "堆疊深度ä¸å°ç¨±ã€‚%1 != %2。", + /*1031,31*/ "ç¯„åœæ·±åº¦ä¸å°ç¨±ã€‚%1 != %2。", + /*1032,32*/ "Cpool 索引 %1 è¶…å‡ºç¯„åœ %2。", + /*1033,33*/ "Cpool é …ç›® %1 類型錯誤。", + /*1034,34*/ "強制轉型失敗: 無法將 %1 è½‰æ›æˆ %2。", + /*1035,35*/ "方法 %1 中有ä¸åˆæ³•çš„ super 陳述å¼ã€‚", + /*1037,36*/ "無法指定給 %2 上的方法 %1。", + /*1038,37*/ "%1 已定義。", + /*1039,38*/ "方法被åƒè€ƒå¾Œæ‰èƒ½é€²è¡Œé©—證。", + /*1040,39*/ "instanceof çš„å³é‚Šå¿…須是類別或函å¼ã€‚", + /*1041,40*/ "é‹ç®—å­çš„å³é‚Šå¿…須是類別。", + /*1042,41*/ "䏿˜¯ ABC 檔案。major_version=%1 minor_version=%2。", + /*1043,42*/ "無效的 code_length=%1。", + /*1044,43*/ "MethodInfo-%1 䏿”¯æ´çš„æ——標=%2。", + /*1045,44*/ "䏿”¯æ´çš„ traits 類型=%1。", + /*1046,45*/ "MethodInfo-%1 在定義之å‰è¢«åƒè€ƒã€‚", + /*1047,46*/ "找ä¸åˆ°é€²å…¥é»žã€‚", + /*1049,47*/ "原型物件必須是 Vanilla 物件。", + /*1050,48*/ "無法將 %1 è½‰æ›æˆåŸºæœ¬é¡žåž‹ã€‚", + /*1051,49*/ "ä¸åˆæ³•的早期繫çµå­˜å– %1。", + /*1052,50*/ "傳éžçµ¦ %1 函數的 URI 無效。", + /*1053,51*/ "ä¸åˆæ³•覆寫 %2 中的 %1。", + /*1054,52*/ "例外處ç†å¸¸å¼ä¸­å‡ºç¾ä¸åˆæ³•çš„ç¯„åœæˆ–目標ä½ç§»ã€‚", + /*1056,53*/ "無法在 %2 上建立屬性 %1。", + /*1057,54*/ "%1 åªèƒ½åŒ…嫿–¹æ³•。", + /*1058,55*/ "é‹ç®—元類型ä¸åˆæ³•:%1 必須是 %2。", + /*1059,56*/ "ClassInfo-%1 在定義之å‰è¢«åƒè€ƒã€‚", + /*1060,57*/ "ClassInfo %1 è¶…éŽ class_count=%2。", + /*1061,58*/ "值 %1 åœ¨è½‰æ›æˆ %2 後會有誤差。", + /*1063,59*/ "%1 上的引數個數ä¸ç›¸ç¬¦ã€‚éœ€è¦ %2 個,目å‰ç‚º %3 個。", + /*1064,60*/ "無法將方法 %1 當作建構函å¼å‘¼å«ã€‚", + /*1065,61*/ "變數 %1 未定義。", + /*1066,62*/ "䏿”¯æ´è¡¨å–® function('function body')。", + /*1067,63*/ "原生方法 %1 包å«ä¸åˆæ³•的方法主體。", + /*1068,64*/ "%1 å’Œ %2 無法調解。", + /*1069,65*/ "%2 上找ä¸åˆ°å±¬æ€§ %1,而且沒有é è¨­å€¼ã€‚", + /*1070,66*/ "%2 上找ä¸åˆ°æ–¹æ³• %1", + /*1071,67*/ "函數 %1 已繫çµè‡³ %2。", + /*1072,68*/ "Disp_id 0 ä¸åˆæ³•。", + /*1073,69*/ "由於 disp_id %2 é‡è¤‡ï¼Œéž Override 方法 %1 已被代æ›ã€‚", + /*1074,70*/ "ä¸åˆæ³•的寫入 %2 上的唯讀屬性 %1。", + /*1075,71*/ "Math 䏿˜¯å‡½æ•¸ã€‚", + /*1076,72*/ "Math 䏿˜¯å»ºæ§‹å‡½å¼ã€‚", + /*1077,73*/ "ä¸åˆæ³•çš„è®€å– %2 上的唯寫屬性 %1。", + /*1078,74*/ "ä¸åˆæ³•çš„ Opcode/Multiname 組åˆï¼š%1<%2>。", + /*1079,75*/ "載入的程å¼ç¢¼ä¸­ä¸å…許使用原生方法。", + /*1080,76*/ "ä¸åˆæ³•çš„å稱空間值。", + /*1081,77*/ "%2 上找ä¸åˆ°å±¬æ€§ %1,且沒有é è¨­å€¼ã€‚", + /*1082,78*/ "未設定é è¨­çš„å稱空間。", + /*1083,79*/ "未繫çµå…ƒç´  \"%2\" çš„å‰ç½®è©ž \"%1\"。", + /*1084,80*/ "元素或屬性 (\"%1\") 與 QName Production ä¸ç›¸ç¬¦ï¼šQName::=(NCName':')?NCName。", + /*1085,81*/ "元素類型 '%1' å¿…é ˆä»¥ç›¸ç¬¦çš„çµæŸæ¨™ç±¤ '' çµæŸã€‚", + /*1086,82*/ "%1 æ–¹æ³•åªæœ‰åœ¨åŒ…å«ä¸€å€‹é …ç›®çš„æ¸…å–®ä¸Šæ‰æœ‰ä½œç”¨ã€‚", + /*1087,83*/ "ä¸å…許索引 XML 的指定。", + /*1088,84*/ "文件中根元素之後的標記必須使用正確格å¼ã€‚", + /*1089,85*/ "無法指定給包å«å¤šå€‹é …目的清單。", + /*1090,86*/ "XML 剖æžå™¨å¤±æ•—:元素格å¼éŒ¯èª¤ã€‚", + /*1091,87*/ "XML 剖æžå™¨å¤±æ•—ï¼šæœªçµæŸçš„ CDATA 倿®µã€‚", + /*1092,88*/ "XML 剖æžå™¨å¤±æ•—ï¼šæœªçµæŸçš„ XML 宣告。", + /*1093,89*/ "XML 剖æžå™¨å¤±æ•—ï¼šæœªçµæŸçš„ DOCTYPE 宣告。", + /*1094,90*/ "XML 剖æžå™¨å¤±æ•—ï¼šæœªçµæŸçš„註解。", + /*1095,91*/ "XML 剖æžå™¨å¤±æ•—ï¼šæœªçµæŸçš„屬性。", + /*1096,92*/ "XML 剖æžå™¨å¤±æ•—ï¼šæœªçµæŸçš„元素。", + /*1097,93*/ "XML 剖æžå™¨å¤±æ•—ï¼šæœªçµæŸçš„è™•ç†æŒ‡ä»¤ã€‚", + /*1098,94*/ "no namespace çš„å‰ç½®è©ž %1 ä¸åˆæ³•。", + /*1100,95*/ "從å¦ä¸€å€‹ RegExp 建構 RegExp 時無法æä¾›æ——標。", + /*1101,96*/ "ç„¡æ³•ä»¥æœªçŸ¥çš„ç¯„åœæª¢æŸ¥æ–¹æ³• %1。", + /*1102,97*/ "類型 %1 çš„é è¨­å€¼ä¸åˆæ³•。", + /*1103,98*/ "類別 %1 無法擴充最後的基底類別。", + /*1104,99*/ "屬性 \"%1\" 已經指定給元素 \"%2\"。", + /*1107,100*/ "ABC è³‡æ–™å·²ç¶“ææ¯€ï¼Œå˜—試讀å–超出範åœã€‚", + /*1108,101*/ "OP_newclass Opcode ä½¿ç”¨æ–¼ä¸æ­£ç¢ºçš„基底類別。", + /*1109,102*/ "嘗試直接從方法 %1 呼嫿œªç¹«çµçš„å‡½å¼ %2。", + /*1110,103*/ "%1 無法擴充 %2。", + /*1111,104*/ "%1 無法實作 %2。", + /*1112,105*/ "強制類別上的引數個數ä¸ç›¸ç¬¦ã€‚éœ€è¦ 1 個,目å‰ç‚º %1 個。", + /*1113,106*/ "方法中使用 OP_newactivation,未æ­é… NEED_ACTIVATION 指標。", + /*1114,107*/ "在éžå…¨åŸŸç¯„åœä¸‹ä½¿ç”¨ OP_getglobalslot 或 OP_setglobalslot。", + /*1115,108*/ "%1 䏿˜¯å»ºæ§‹å‡½å¼ã€‚", + /*1116,109*/ "Function.prototype.apply 的第二個引數必須是陣列。", + /*1117,110*/ "無效的 XML å稱:%1。", + /*1118,111*/ "節點之間的循環迴圈ä¸åˆæ³•。", + /*1119,112*/ "類型 %1 çš„é‹ç®—å…ƒä¸æ”¯æ´åˆªé™¤é‹ç®—å­ã€‚", + /*1120,113*/ "無法刪除 %2 上的屬性 %1。", + /*1121,114*/ "方法 %1 包å«é‡è¤‡çš„æ–¹æ³•主體。", + /*1122,115*/ "Interface 方法 %1 包å«ä¸åˆæ³•的方法主體。", + /*1123,116*/ "類型 %1 䏿”¯æ´ç¯©é¸é‹ç®—å­ã€‚", + /*1124,117*/ "OP_hasnext2 è¦æ±‚物件åŠç´¢å¼•為å¯è¾¨è­˜çš„登錄。", + /*1500,118*/ "開啟檔案 %1 時發生錯誤。", + /*1501,119*/ "寫入檔案 %1 時發生錯誤。", + /*1502,120*/ "script 已經執行超éŽé è¨­çš„ 15 秒逾時時段。", + /*1503,121*/ "Script 並未在 30 ç§’å¾ŒçµæŸï¼Œå·²ç¶“被終止。", + /*1504,122*/ "檔案çµå°¾ã€‚", + /*1505,123*/ "字串索引 %1 超出範åœï¼›ç¯„åœå¿…須介於 %2 到 %3。", + /*1506,124*/ "指定的範åœç„¡æ•ˆã€‚", + /*1507,125*/ "引數 %1 ä¸èƒ½æ˜¯ null。", + /*1508,126*/ "指定給引數 %1 的值無效。", + /*1509,127*/ "解壓縮資料時發生錯誤。", + /*1510,128*/ "若回呼引數是 Class çš„æ–¹æ³•ï¼Œé¸æ“‡æ€§çš„引數 'this' 必須是 null。" + } + }; + #endif /* DEBUGGER */ + } +} diff --git a/mozilla/js/tamarin/core/ErrorConstants.h b/mozilla/js/tamarin/core/ErrorConstants.h new file mode 100644 index 00000000000..b58284945b2 --- /dev/null +++ b/mozilla/js/tamarin/core/ErrorConstants.h @@ -0,0 +1,205 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#ifndef __avmplus_ErrorConstants__ +#define __avmplus_ErrorConstants__ + +namespace avmplus +{ + namespace ErrorConstants + { + enum LangID + { + LANG_en = 0, + LANG_de = 1, + LANG_es = 2, + LANG_fr = 3, + LANG_it = 4, + LANG_ja = 5, + LANG_ko = 6, + LANG_zh_CN = 7, + LANG_zh_TW = 8, + LANG_count = 9 + }; + + typedef struct _LangName + { + const char* str; + LangID id; + } + LangName; + + enum + { + kOutOfMemoryError = 1000, + kNotImplementedError = 1001, + kInvalidPrecisionError = 1002, + kInvalidRadixError = 1003, + kInvokeOnIncompatibleObjectError = 1004, + kArrayIndexNotIntegerError = 1005, + kCallOfNonFunctionError = 1006, + kConstructOfNonFunctionError = 1007, + kAmbiguousBindingError = 1008, + kConvertNullToObjectError = 1009, + kConvertUndefinedToObjectError = 1010, + kIllegalOpcodeError = 1011, + kLastInstExceedsCodeSizeError = 1012, + kFindVarWithNoScopeError = 1013, + kClassNotFoundError = 1014, + kIllegalSetDxns = 1015, + kDescendentsError = 1016, + kScopeStackOverflowError = 1017, + kScopeStackUnderflowError = 1018, + kGetScopeObjectBoundsError = 1019, + kCannotFallOffMethodError = 1020, + kInvalidBranchTargetError = 1021, + kIllegalVoidError = 1022, + kStackOverflowError = 1023, + kStackUnderflowError = 1024, + kInvalidRegisterError = 1025, + kSlotExceedsCountError = 1026, + kMethodInfoExceedsCountError = 1027, + kDispIdExceedsCountError = 1028, + kDispIdUndefinedError = 1029, + kStackDepthUnbalancedError = 1030, + kScopeDepthUnbalancedError = 1031, + kCpoolIndexRangeError = 1032, + kCpoolEntryWrongTypeError = 1033, + kCheckTypeFailedError = 1034, + kIllegalSuperCallError = 1035, + kCannotAssignToMethodError = 1037, + kRedefinedError = 1038, + kCannotVerifyUntilReferencedError = 1039, + kCantUseInstanceofOnNonObjectError = 1040, + kIsTypeMustBeClassError = 1041, + kInvalidMagicError = 1042, + kInvalidCodeLengthError = 1043, + kInvalidMethodInfoFlagsError = 1044, + kUnsupportedTraitsKindError = 1045, + kMethodInfoOrderError = 1046, + kMissingEntryPointError = 1047, + kPrototypeTypeError = 1049, + kConvertToPrimitiveError = 1050, + kIllegalEarlyBindingError = 1051, + kInvalidURIError = 1052, + kIllegalOverrideError = 1053, + kIllegalExceptionHandlerError = 1054, + kWriteSealedError = 1056, + kIllegalSlotError = 1057, + kIllegalOperandTypeError = 1058, + kClassInfoOrderError = 1059, + kClassInfoExceedsCountError = 1060, + kNumberOutOfRangeError = 1061, + kWrongArgumentCountError = 1063, + kCannotCallMethodAsConstructor = 1064, + kUndefinedVarError = 1065, + kFunctionConstructorError = 1066, + kIllegalNativeMethodBodyError = 1067, + kCannotMergeTypesError = 1068, + kReadSealedError = 1069, + kCallNotFoundError = 1070, + kAlreadyBoundError = 1071, + kZeroDispIdError = 1072, + kDuplicateDispIdError = 1073, + kConstWriteError = 1074, + kMathNotFunctionError = 1075, + kMathNotConstructorError = 1076, + kWriteOnlyError = 1077, + kIllegalOpMultinameError = 1078, + kIllegalNativeMethodError = 1079, + kIllegalNamespaceError = 1080, + kReadSealedErrorNs = 1081, + kNoDefaultNamespaceError = 1082, + kXMLPrefixNotBound = 1083, + kXMLBadQName = 1084, + kXMLUnterminatedElementTag = 1085, + kXMLOnlyWorksWithOneItemLists = 1086, + kXMLAssignmentToIndexedXMLNotAllowed = 1087, + kXMLMarkupMustBeWellFormed = 1088, + kXMLAssigmentOneItemLists = 1089, + kXMLMalformedElement = 1090, + kXMLUnterminatedCData = 1091, + kXMLUnterminatedXMLDecl = 1092, + kXMLUnterminatedDocTypeDecl = 1093, + kXMLUnterminatedComment = 1094, + kXMLUnterminatedAttribute = 1095, + kXMLUnterminatedElement = 1096, + kXMLUnterminatedProcessingInstruction = 1097, + kXMLNamespaceWithPrefixAndNoURI = 1098, + kRegExpFlagsArgumentError = 1100, + kNoScopeError = 1101, + kIllegalDefaultValue = 1102, + kCannotExtendFinalClass = 1103, + kXMLDuplicateAttribute = 1104, + kCorruptABCError = 1107, + kInvalidBaseClassError = 1108, + kDanglingFunctionError = 1109, + kCannotExtendError = 1110, + kCannotImplementError = 1111, + kCoerceArgumentCountError = 1112, + kInvalidNewActivationError = 1113, + kNoGlobalScopeError = 1114, + kNotConstructorError = 1115, + kApplyError = 1116, + kXMLInvalidName = 1117, + kXMLIllegalCyclicalLoop = 1118, + kDeleteTypeError = 1119, + kDeleteSealedError = 1120, + kDuplicateMethodBodyError = 1121, + kIllegalInterfaceMethodBodyError = 1122, + kFilterError = 1123, + kInvalidHasNextError = 1124, + kFileOpenError = 1500, + kFileWriteError = 1501, + kScriptTimeoutError = 1502, + kScriptTerminatedError = 1503, + kEndOfFileError = 1504, + kStringIndexOutOfBoundsError = 1505, + kInvalidRangeError = 1506, + kNullArgumentError = 1507, + kInvalidArgumentError = 1508, + kShellCompressedDataError = 1509, + kArrayFilterNonNullObjectError = 1510 + }; + + // Error message strings only in DEBUGGER builds. + #ifdef DEBUGGER + const int kLanguages = LANG_count; + const int kNumErrorConstants = 129; + extern const char* errorConstants[kLanguages][kNumErrorConstants]; + extern int errorMappingTable[2*kNumErrorConstants]; + extern LangName languageNames[kLanguages]; + #endif + } +} + +#endif /*__avmplus_ErrorConstants__*/ diff --git a/mozilla/js/tamarin/core/Exception.cpp b/mozilla/js/tamarin/core/Exception.cpp new file mode 100644 index 00000000000..75a4f79dacd --- /dev/null +++ b/mozilla/js/tamarin/core/Exception.cpp @@ -0,0 +1,141 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmplus.h" + +namespace avmplus +{ + // + // Exception + // + + Exception::Exception(Atom atom +#ifdef DEBUGGER + , AvmCore* core +#endif /* DEBUGGER */ + ) + { + this->atom = atom; + this->flags = 0; + + #ifdef DEBUGGER + // If the exception atom is an Error object, copy its stack trace. + // Otherwise, generate a new stack trace. + if (core->istype(atom, core->traits.error_itraits)) + { + stackTrace = ((ErrorObject*)AvmCore::atomToScriptObject(atom))->getStackTrace(); + } + else + { + stackTrace = core->newStackTrace(); + } + #endif + } + + bool Exception::isValid() + { + return (atom&7)==kObjectType; + } + + // + // ExceptionHandlerTable + // + + ExceptionHandlerTable::ExceptionHandlerTable(int exception_count) + { + this->exception_count = exception_count; + memset(exceptions, 0, sizeof(ExceptionHandler)*exception_count); + } + + // + // ExceptionFrame + // + void ExceptionFrame::beginTry(AvmCore* core) + { + this->core = core; + + prevFrame = core->exceptionFrame; + + if (!prevFrame) { + // Do special setup for first frame + core->setStackBase(); + } + + core->exceptionFrame = this; + +#ifdef DEBUGGER + callStack = core->callStack; + + // beginTry() is called from both the TRY macro and from JIT'd code. The TRY + // macro will immediately change the value of catchAction right after the + // call to beginTry(); but the JIT'd code does not change catchAction. So, + // we initialize catchAction to the value that it needs when we're called + // from JIT'd code, that is, kCatchAction_SearchForActionScriptExceptionHandler. + catchAction = kCatchAction_SearchForActionScriptExceptionHandler; +#endif /* DEBUGGER */ + + codeContextAtom = core->codeContextAtom; + dxnsAddr = core->dxnsAddr; + } + + void ExceptionFrame::endTry() + { + if (core) { + // ISSUE do we need to check core if it is set in constructor? + core->exceptionFrame = prevFrame; + + // Restore the code context to what it was before the try + core->codeContextAtom = codeContextAtom; + } + } + + void ExceptionFrame::throwException(Exception *exception) + { + longjmp(jmpbuf, (int)exception); + } + + void ExceptionFrame::beginCatch() + { + core->exceptionFrame = prevFrame; + +#ifdef DEBUGGER + //AvmAssert(callStack && callStack->env); + if (core->profiler->profilingDataWanted && callStack && callStack->env) + core->profiler->sendCatch(callStack->env->method); + + core->callStack = callStack; +#endif // DEBUGGER + + core->codeContextAtom = codeContextAtom; + core->dxnsAddr = dxnsAddr; + } +} diff --git a/mozilla/js/tamarin/core/Exception.h b/mozilla/js/tamarin/core/Exception.h new file mode 100644 index 00000000000..b27e02caa86 --- /dev/null +++ b/mozilla/js/tamarin/core/Exception.h @@ -0,0 +1,239 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_Exception__ +#define __avmplus_Exception__ + + +namespace avmplus +{ + /** + * The Exception class is used to throw all exceptions in + * AVM+. To throw an exception, an Exception object is + * instantiated and passed to AvmCore::throwException. + */ + class Exception : public MMgc::GCObject + { + public: + Exception(Atom atom +#ifdef DEBUGGER + , AvmCore* core +#endif /* DEBUGGER */ + ); + + ATOM_WB atom; + int flags; + + bool isValid(); + enum + { + /** + * An EXIT_EXCEPTION cannot be caught. It indicates that + * the VM is shutting down. + */ + EXIT_EXCEPTION = 1, + +#ifdef DEBUGGER + /** + * Indicates that this exception has already been passed to + * the debugger. + */ + SEEN_BY_DEBUGGER = 2, +#endif + }; + +#ifdef DEBUGGER + StackTrace* getStackTrace() const { return stackTrace; } + DWB(StackTrace*) stackTrace; +#endif /* DEBUGGER */ + }; + + /** + * ExceptionHandler is a single entry in the exceptions + * table that accompanies a MethodInfo. It describes: + * + * - the range of instructions that the exception handler + * applies to + * - the location of the first instruction in the + * exception handler. + * - the type of exceptions handled by this exception + * handler + */ + class ExceptionHandler + { + public: + /** Start of code range the exception applies to. Inclusive. */ + int from; + + /** End of code range the exception applies to. Exclusive. */ + int to; + + /** The target location to branch to when the exception occurs. */ + union { + int target; + CodegenMIR::OP* targetIns; + }; + + /** The type of exceptions handled by this exception handler. */ + Traits* traits; + + /** The exception scope traits. */ + Traits* scopeTraits; + }; + + /** + * ExceptionHandlerTable is a table of ExceptionHandler objects. + * The list of exception handlers in a MethodInfo entry in an + * ABC file is parsed into an ExceptionHandlerTable object. + */ + class ExceptionHandlerTable : public MMgc::GCObject + { + public: + ExceptionHandlerTable(int exception_count); + + int exception_count; + ExceptionHandler exceptions[1]; + }; + +#ifdef DEBUGGER + /** + * CatchAction indicates what the CATCH block for a given ExceptionFrame will + * do if it gets invoked (that is, if an exception is raised from inside the + * TRY block). + * + * This information is needed by the debugger, in order to decide whether to + * suspend execution in the debugger, in order to let the user examine + * variables etc., before executing the CATCH block. + */ + enum CatchAction + { + // It is not known what the CATCH block will do. This should almost never be used. + kCatchAction_Unknown, + + // The CATCH block will silently consume any exception that occurs, and will not + // treat it as an error, so exceptions should not be reported to the debugger. + kCatchAction_Ignore, + + // The CATCH block will treat any exception that occurs as an error -- probably by + // calling uncaughtException, but possibly by some other means. So, exceptions + // should be reported to the debugger. + kCatchAction_ReportAsError, + + // The CATCH block will rethrow any exception that occurs; so, we will 'continue', + // which will take us back to the 'for' loop to keep going up the exception stack, + // until we find a frame with some other value. + kCatchAction_Rethrow, + + // The CATCH block will walk up the stack of ActionScript exception frames, looking + // for an ActionScript try/catch block which will catch it. + kCatchAction_SearchForActionScriptExceptionHandler + }; +#endif + + /** + * ExceptionFrame class is used to track stack frames that contain + * exception handlers. + */ + class ExceptionFrame + { + public: + ExceptionFrame() + { + core = NULL; +#ifdef DEBUGGER + this->catchAction = kCatchAction_Unknown; +#endif + } + ~ExceptionFrame() { endTry(); } + void beginTry(AvmCore* core); + void endTry(); + void beginCatch(); + void throwException(Exception *exception); + + AvmCore *core; + ExceptionFrame *prevFrame; + Namespace*const* dxnsAddr; + jmp_buf jmpbuf; + CodeContextAtom codeContextAtom; +#ifdef DEBUGGER + CallStackNode *callStack; + + // Indicates what the CATCH block is going to do if it sees an exception. + // (A CatchAction should only need 3 bits, but I have to give it 4 in + // order to avoid problems with sign-extension.) + CatchAction catchAction:4; +#endif /* DEBUGGER */ + }; + + /** + * TRY, CATCH, and friends are macros for setting up exception try/catch + * blocks. This is similar to the TRY, CATCH, etc. macros in MFC. + * + * AVM+ uses its own exception handling mechanism implemented using + * setjmp/longjmp. Hosts of AVM+ can bridge these exceptions into + * regular C++ exceptions by catching and re-throwing. + * + * TRY_UNLESS is to support the optimization that if there are no exception handlers + * in this frame, we don't need to create the exception frame at all. If expr + * is true, the exception frame is not created. + */ +#ifdef DEBUGGER + #define TRY(core, CATCH_ACTION) { \ + ExceptionFrame _ef; \ + _ef.beginTry(core); \ + _ef.catchAction = (CATCH_ACTION); \ + Exception* _ee; \ + if ((_ee=(Exception*)::setjmp(_ef.jmpbuf)) == NULL) +#else + #define TRY(core, CATCH_ACTION) { \ + ExceptionFrame _ef; \ + _ef.beginTry(core); \ + Exception* _ee; \ + if ((_ee=(Exception*)::setjmp(_ef.jmpbuf)) == NULL) +#endif + +#ifdef DEBUGGER + #define TRY_UNLESS(core,expr,CATCH_ACTION) { \ + ExceptionFrame _ef; \ + Exception* _ee; \ + if ((expr) || (_ef.beginTry(core), _ef.catchAction=(CATCH_ACTION), (_ee=(Exception*)::setjmp(_ef.jmpbuf)) == NULL)) +#else + #define TRY_UNLESS(core,expr,CATCH_ACTION) { \ + ExceptionFrame _ef; \ + Exception* _ee; \ + if ((expr) || (_ef.beginTry(core), (_ee=(Exception*)::setjmp(_ef.jmpbuf)) == NULL)) +#endif + #define CATCH(x) else { _ef.beginCatch(); x = _ee; + #define END_CATCH } + #define END_TRY } +} + +#endif /* __avmplus_Exception__ */ diff --git a/mozilla/js/tamarin/core/FrameState.cpp b/mozilla/js/tamarin/core/FrameState.cpp new file mode 100644 index 00000000000..c3635bb4ebc --- /dev/null +++ b/mozilla/js/tamarin/core/FrameState.cpp @@ -0,0 +1,38 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmplus.h" + +namespace avmplus +{ +} + diff --git a/mozilla/js/tamarin/core/FrameState.h b/mozilla/js/tamarin/core/FrameState.h new file mode 100644 index 00000000000..94b0a3ba1eb --- /dev/null +++ b/mozilla/js/tamarin/core/FrameState.h @@ -0,0 +1,164 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_FrameState__ +#define __avmplus_FrameState__ + + +namespace avmplus +{ + /** + * represents a value in the verifier + */ + class Value + { + public: + Traits* traits; + bool notNull; + bool isWith; + bool killed; + #ifdef AVMPLUS_MIR + bool stored; // set if codegen has already stored the OP + CodegenMIR::OP* ins; // spot for codegen to hang data. + #endif //AVMPLUS_MIR + }; + + /** + * this object holds the stack frame state at any given block entry. + * the frame state consists of the types of each local, each entry on the + * scope chain, and each operand stack slot. + */ + class FrameState: public MMgc::GCObject + { + + public: + int pc; + int scopeDepth; + int stackDepth; + Verifier * const verifier; + int withBase; + bool initialized; + bool targetOfBackwardsBranch; + bool insideTryBlock; + #ifdef AVMPLUS_MIR + CodegenMIR::MirLabel label; + #endif + + private: + Value locals[1]; // actual length is verifier->frameSize. one entry for each + // local, scope-entry, and operand stack entry. + + public: + FrameState(Verifier *v) : verifier(v) + { + this->withBase = -1; + } + + bool init(FrameState* other) + { + if( verifier != other->verifier ){ + AvmAssertMsg(0, "(verifier == other->verifier)"); + return false; + } + scopeDepth = other->scopeDepth; + stackDepth = other->stackDepth; + withBase = other->withBase; + memcpy(locals, other->locals, verifier->frameSize*sizeof(Value)); + return true; + } + + Value& value(int i) + { + return locals[i]; + } + + Value& scopeValue(int i) + { + return locals[verifier->scopeBase+i]; + } + + Value& stackValue(int i) + { + AvmAssert(i >= 0); + return locals[verifier->stackBase+i]; + } + + Value& stackTop() { + return locals[verifier->stackBase+stackDepth-1]; + } + + int sp() const { + return verifier->stackBase+stackDepth-1; + } + + void setType(int i, Traits* t, bool notNull=false, bool isWith=false) + { + //this->traits = t; + WB(verifier->core->GetGC(), this, &locals[i].traits, t); + locals[i].notNull = notNull; + locals[i].isWith = isWith; + } + + void pop(int n=1) + { + stackDepth -= n; + AvmAssert(stackDepth >= 0); + } + + Value& peek(int n=1) + { + AvmAssert(stackDepth-n >= 0); + return locals[verifier->stackBase+stackDepth-n]; + } + + void pop_push(int n, Traits* type, bool notNull=false) + { + int sp = stackDepth - n; + setType(verifier->stackBase+sp, type, notNull); + stackDepth = sp+1; + } + + void push(Value& value) + { + AvmAssert(verifier->stackBase+stackDepth+1 <= verifier->frameSize); + setType(verifier->stackBase+stackDepth++, value.traits, value.notNull); + } + + void push(Traits* traits, bool notNull=false) + { + AvmAssert(verifier->stackBase+stackDepth+1 <= verifier->frameSize); + setType(verifier->stackBase+stackDepth++, traits, notNull); + } + + }; +} + +#endif /* __avmplus_FrameState__ */ diff --git a/mozilla/js/tamarin/core/Function.as b/mozilla/js/tamarin/core/Function.as new file mode 100644 index 00000000000..d4b3ee671f4 --- /dev/null +++ b/mozilla/js/tamarin/core/Function.as @@ -0,0 +1,115 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +package +{ + //pseudo-final - no user class can extend Function + dynamic public class Function + { + // Function.length = 1 per ES3 + // E262 {ReadOnly, DontDelete, DontEnum } + public static const length:int = 1 + + // E262 {DontDelete} + // JS {DontEnum,DontDelete} + public native function get prototype() + public native function set prototype(p) + + // E262 {DontEnum, DontDelete, ReadOnly} + public native function get length():int + + // called by native code to create empty functions used for + // prototype and no-arg constructor. + private static function emptyCtor() + { + return function() {} + } + + /* cn: Spidermonkey returns the actual source text of the function here. The ES3 + // standard only says: + 15.3.4.2 Function.prototype.toString ( ) + An implementation-dependent representation of the function is returned. This + representation has the syntax of a FunctionDeclaration. Note in particular + that the use and placement of white space, line terminators, and semicolons + within the representation string is implementation-dependent. + The toString function is not generic; it throws a TypeError exception if its this value is not a Function object. + Therefore, it cannot be transferred to other kinds of objects for use as a method. + // + // We don't have the source text, so this impl follows the letter if not the intent + // of the spec. + // + // Note: we only honor the compact ES3/4 spec, which means + // we don't support new Function(stringArg) where stringArg is the text of + // the function to be compiled at runtime. Returning the true text of the + // function in toString() seems to be a bookend to this feature to me, and + // thus shouldn't be in the compact specification either. */ + + prototype.toLocaleString = + prototype.toString = function():String + { + var f:Function = this + return "function Function() {}" + } + + AS3 native function call(thisArg=void 0, ...args) + prototype.call = function(thisArg=void 0, ...args) + { + var f:Function = this + return f.AS3::apply(thisArg, args) + } + + AS3 native function apply(thisArg=void 0, argArray=void 0) + prototype.apply = function(thisArg=void 0, argArray=void 0) + { + var f:Function = this + return f.AS3::apply(thisArg, argArray) + } + + _dontEnumPrototype(prototype); + } +} + +// not dynamic +final class MethodClosure extends Function +{ + override public function get prototype() + { + return null + } + + override public function set prototype(p) + { + Error.throwError( ReferenceError, 1074 /*kConstWriteError*/, "prototype", "MethodClosure" ); + } + + public override native function get length():int +} diff --git a/mozilla/js/tamarin/core/FunctionClass.cpp b/mozilla/js/tamarin/core/FunctionClass.cpp new file mode 100644 index 00000000000..3a65fbe7c91 --- /dev/null +++ b/mozilla/js/tamarin/core/FunctionClass.cpp @@ -0,0 +1,102 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmplus.h" + +namespace avmplus +{ + BEGIN_NATIVE_MAP(FunctionClass) + NATIVE_METHOD2(Function_prototype_get, + (NativeMethod::GetHandler)&ClassClosure::get_prototype) + NATIVE_METHOD2(Function_prototype_set, + (NativeMethod::SetHandler)&ClassClosure::set_prototype) + NATIVE_METHOD2(Function_AS3_call, &ScriptObject::function_call) + NATIVE_METHOD2(Function_AS3_apply, &ScriptObject::function_apply) + NATIVE_METHOD2(Function_length_get, &ClassClosure::get_length) + END_NATIVE_MAP() + + FunctionClass::FunctionClass(VTable* cvtable) + : ClassClosure(cvtable) + { + Toplevel* toplevel = this->toplevel(); + + toplevel->functionClass = this; + AvmAssert(traits()->sizeofInstance == sizeof(FunctionClass)); + + prototype = createEmptyFunction(); + prototype->setDelegate(toplevel->objectClass->prototype); + + // + // now that Object, Class, and Function are initialized, we + // can set up Object.prototype. other classes will init normally. + // + + // init Object prototype + toplevel->objectClass->initPrototype(); + } + + // Function called as constructor ... not supported from user code + // this = argv[0] (ignored) + // arg1 = argv[1] + // argN = argv[argc] + Atom FunctionClass::construct(int argc, Atom* /*argv*/) + { + // ISSUE do we need an exception here? + // cn: if argc is 0, this is harmless and we have to return an anonymous + // function that itself if its > 0, then we can't support it + + /* + from ECMA 327 5.1 Runtime Compilation + An implementation that does not support global eval() or calling Function as a function or constructor + SHALL throw an EvalError exception whenever global eval() (ES3 section 15.1.2.1), Function(p1, + p2, ..., pn, body) (ES3 section 15.3.1.1), or new Function(p1, p2, ..., pn, body) (ES3 section 15.3.2.1) is + called. + */ + + if (argc != 0) + { + toplevel()->evalErrorClass()->throwError(kFunctionConstructorError); + } + + return createEmptyFunction()->atom(); + } + + ClassClosure* FunctionClass::createEmptyFunction() + { + // invoke AS3 private static function emptyCtor, which returns an empty function. + Binding b = traits()->getName(core()->constantString("emptyCtor")); + MethodEnv *f = vtable->methods[AvmCore::bindingToMethodId(b)]; + Atom args[1] = { this->atom() }; + return (ClassClosure*)AvmCore::atomToScriptObject(f->coerceEnter(0,args)); + } + +} diff --git a/mozilla/js/tamarin/core/FunctionClass.h b/mozilla/js/tamarin/core/FunctionClass.h new file mode 100644 index 00000000000..ed972898a17 --- /dev/null +++ b/mozilla/js/tamarin/core/FunctionClass.h @@ -0,0 +1,63 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_FunctionClass__ +#define __avmplus_FunctionClass__ + + +namespace avmplus +{ + /** + * class Function + */ + class FunctionClass : public ClassClosure + { + public: + DECLARE_NATIVE_MAP(FunctionClass) + + FunctionClass(VTable* cvtable); + + ClassClosure *createEmptyFunction(); + + // Function called as constructor ... not supported from user code + // this = argv[0] (ignored) + // arg1 = argv[1] + // argN = argv[argc] + Atom construct(int argc, Atom* argv); + + Atom call(int argc, Atom* argv) + { + return construct(argc,argv); + } + }; +} + +#endif /* __avmplus_FunctionClass__ */ diff --git a/mozilla/js/tamarin/core/GrowableBuffer.cpp b/mozilla/js/tamarin/core/GrowableBuffer.cpp new file mode 100644 index 00000000000..a8e39eb0957 --- /dev/null +++ b/mozilla/js/tamarin/core/GrowableBuffer.cpp @@ -0,0 +1,967 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmplus.h" + +#ifdef DARWIN +#include +#endif + +#ifdef AVMPLUS_ROSETTA +// Include sysctlbyname and getpid +#include +#include +#include +#endif + +/* number of pages commited each time grow() is called */ +#define PAGES_PER_GROW 4 + +#ifdef AVMPLUS_MACH_EXCEPTIONS +extern "C" +{ + extern boolean_t exc_server(mach_msg_header_t *, + mach_msg_header_t *); + + extern kern_return_t exception_raise(mach_port_t, + mach_port_t, + mach_port_t, + exception_type_t, + exception_data_t, + mach_msg_type_number_t); + + extern kern_return_t exception_raise_state(mach_port_t, + mach_port_t, + mach_port_t, + exception_type_t, + exception_data_t, + mach_msg_type_number_t, + thread_state_flavor_t*, + thread_state_t, + mach_msg_type_number_t, + thread_state_t, + mach_msg_type_number_t*); + + extern kern_return_t exception_raise_state_identity(mach_port_t, + mach_port_t, + mach_port_t, + exception_type_t, + exception_data_t, + mach_msg_type_number_t, + thread_state_flavor_t*, + thread_state_t, + mach_msg_type_number_t, + thread_state_t, + mach_msg_type_number_t*); + + #ifdef USE_EXC_SERVER + kern_return_t catch_exception_raise(mach_port_t exception_port, + mach_port_t thread, + mach_port_t task, + exception_type_t exception, + exception_data_t code, + mach_msg_type_number_t code_count) + { + return avmplus::GenericGuard::catch_exception_raise(exception_port, + thread, + task, + exception, + code, + code_count); + } + #endif +} +#endif + +namespace avmplus +{ + GrowableBuffer::GrowableBuffer(MMgc::GCHeap *gcheap) + : heap(gcheap) + { + init(); + AvmAssert( (size_t)MathUtils::nextPowerOfTwo(pageSize()-1) == pageSize() ); + } + + GrowableBuffer::~GrowableBuffer() + { + free(); + } + + void GrowableBuffer::init() + { + first = 0; + last = 0; + uncommit = 0; + current = 0; + } + + byte* GrowableBuffer::reserve(size_t amt) + { + // attempt to reserve space + amt = (size_t)pageAfter((byte*)amt); // align to page + first = (byte*)heap->ReserveCodeMemory(0, amt); + last = first + amt; + uncommit = first; + current = first; + + // commit the first page and make it a guard page + if (first) + heap->SetGuardPage(first); + + return first; + } + + byte* GrowableBuffer::decommitUnused() + { + // have we committed too much beyond the current location? + if (current + pageSize() < uncommit) + { + // get rid of pages + byte* after = pageAfter(current); +#ifdef MEMORY_INFO + MMgc::ChangeSizeForObject(this, -1 * (uncommit-after)); +#endif + heap->DecommitCodeMemory((void*)after, uncommit-after); + uncommit = after; + + heap->SetGuardPage(uncommit); + } + return uncommit; + } + + byte* GrowableBuffer::grow() + { + return growBy(pageSize()*PAGES_PER_GROW); + } + + byte* GrowableBuffer::growBy(size_t amt) + { + AvmAssertMsg(amt % pageSize() == 0, "amt must be multiple of pageSize"); + size_t grow = ( (uncommit + amt) < last) ? amt : last - uncommit; +#ifdef MEMORY_INFO + MMgc::ChangeSizeForObject(this, grow); +#endif + void* res = heap->CommitCodeMemory((void*)uncommit, grow); + AvmAssert(res != 0); + (void)res; + uncommit += grow; + + // commit the first page and make it a guard page + heap->SetGuardPage(uncommit); + + return uncommit; + } + + byte* GrowableBuffer::shrinkTo(size_t amt) + { + AvmAssertMsg(amt % pageSize() == 0, "amt must be multiple of pageSize"); + byte* shrinkTo = start() + amt; + size_t size = (shrinkTo < uncommit) ? uncommit - shrinkTo : 0; + if (size > 0) + { +#ifdef MEMORY_INFO + MMgc::ChangeSizeForObject(this, -1 * size); +#endif + void* res = heap->DecommitCodeMemory((void*)shrinkTo, size); + AvmAssert(res != 0); + (void)res; + uncommit = shrinkTo; + + // commit the first page and make it a guard page + heap->SetGuardPage(uncommit); + } + return uncommit; + } + + void GrowableBuffer::free() + { + // get rid of the whole shebang + if (first != 0) + { +#ifdef MEMORY_INFO + MMgc::ChangeSizeForObject(this, -1 * (uncommit-first)); + heap->DecommitCodeMemory(first, uncommit-first); +#endif + heap->ReleaseCodeMemory(first, size()); + init(); + } + } + +#ifdef FEATURE_BUFFER_GUARD + + // + // GenericGuard + // + + #ifdef AVMPLUS_WIN32 + + #pragma warning(disable: 4733) // make sure you build with linker option /SAFESEH:NO !!!! + + void GenericGuard::init() + { + record.prev = 0; + record.handler = 0; + record.instance = 0; + record.terminator = 0; + } + + void GenericGuard::registerHandler() + { + if (record.instance == 0) + { + record.handler = (DWORD)guardRoutine; + record.instance = (GenericGuard*)this; + record.terminator = 0xffffffff; + /* swap in our handler record */ + __asm + { + mov ecx, [this] + mov eax, fs:[0]; + mov [ecx].record.prev, eax; + lea eax, [ecx].record; + mov fs:[0], eax; + } + } + } + + void GenericGuard::unregisterHandler() + { + if (record.instance != 0) + { + /* swap out our handler record */ + __asm + { + mov ecx, [this] + mov eax, [ecx].record.prev; + mov fs:[0], eax; + } + } + record.instance = 0; + } + + /*static*/int __cdecl GenericGuard::guardRoutine(struct _EXCEPTION_RECORD *exceptionRecord, + void *establisherFrame, + struct _CONTEXT *contextRecord, + void *dispatcherContext) + { + if (exceptionRecord->ExceptionCode == EXCEPTION_ACCESS_VIOLATION || exceptionRecord->ExceptionCode == EXCEPTION_GUARD_PAGE) + { + GenericGuard* guard = (GenericGuard*)((ExceptionRegistrationRecord*)establisherFrame)->instance; + + return guard->handleException(exceptionRecord, + establisherFrame, + contextRecord, + dispatcherContext); + } + return ExceptionContinueSearch; + } + + #pragma warning(default: 4733) // make sure you build with linker option /SAFESEH:NO !!!! + + #endif /* AVMPLUS_WIN32 */ + + #ifdef AVMPLUS_MACH_EXCEPTIONS + mach_port_t GenericGuard::exceptionPort = (mach_port_t)NULL; + pthread_t GenericGuard::exceptionThread; + pthread_mutex_t GenericGuard::mutex; + volatile GenericGuard* GenericGuard::guardList = NULL; + + void* GenericGuard::threadMain(void* /*arg*/) + { + struct + { + mach_msg_header_t head; + NDR_record_t NDR; + kern_return_t RetCode; + } + reply; + + struct + { + mach_msg_header_t head; + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t thread; + mach_msg_port_descriptor_t task; + NDR_record_t NDR; + exception_type_t exception; + mach_msg_type_number_t codeCnt; + integer_t code[2]; + mach_msg_trailer_t trailer; + } + msg; + + for (;;) + { + if (mach_msg(&msg.head, + MACH_RCV_MSG | MACH_RCV_LARGE, + 0, + sizeof(msg), + exceptionPort, + MACH_MSG_TIMEOUT_NONE, + MACH_PORT_NULL) != MACH_MSG_SUCCESS) + { + AvmAssertMsg(false, "mach_msg failed"); + return NULL; + } + + if (msg.head.msgh_id == kThreadExitMsg) + { + break; + } + + #ifdef USE_EXC_SERVER + // Handle the message (calls catch_exception_raise) + if (!exc_server(&msg.head, &reply.head)) + { + AvmAssertMsg(false, "exc_server failed"); + } + #else + reply.RetCode = catch_exception_raise(msg.head.msgh_remote_port, + msg.thread.name, + msg.task.name, + msg.exception, + msg.code, + msg.codeCnt); + reply.head.msgh_bits = MACH_MSGH_BITS(MACH_MSGH_BITS_REMOTE(msg.head.msgh_bits), 0); + reply.head.msgh_remote_port = msg.head.msgh_remote_port; + reply.head.msgh_size = (mach_msg_size_t)sizeof(reply); + reply.head.msgh_local_port = MACH_PORT_NULL; + reply.head.msgh_id = msg.head.msgh_id + 100; + #endif + + // Send the reply + if (mach_msg(&reply.head, + MACH_SEND_MSG, + reply.head.msgh_size, + 0, + MACH_PORT_NULL, + MACH_MSG_TIMEOUT_NONE, + MACH_PORT_NULL) != MACH_MSG_SUCCESS) + { + AvmAssertMsg(false, "mach_msg failed while sending reply"); + } + } + + pthread_exit(NULL); + return NULL; + } + + #ifdef AVMPLUS_ROSETTA + bool GenericGuard::rosetta = false; + + /** + * The following two functions, sysctlbyname_with_pid and is_pid_native, + * are taken from Apple's Universal Binary Programming Guide. + * http://developer.apple.com/documentation/MacOSX/Conceptual/universal_binary/ + * universal_binary_exec_a/chapter_7_section_7.html + */ + static int sysctlbyname_with_pid(const char *name, pid_t pid, + void *oldp, size_t *oldlenp, + void *newp, size_t newlen) + { + if (pid == 0) { + if (sysctlbyname(name, oldp, oldlenp, newp, newlen) == -1) { + AvmAssertMsg(false, "sysctlbyname_with_pid(0): sysctlbyname failed"); + return -1; + } + } else { + int mib[CTL_MAXNAME]; + size_t len = CTL_MAXNAME; + if (sysctlnametomib(name, mib, &len) == -1) { + AvmAssertMsg(false, "sysctlbyname_with_pid(0): sysctlnametomib failed"); + return -1; + } + mib[len] = pid; + len++; + if (sysctl(mib, len, oldp, oldlenp, newp, newlen) == -1) { + AvmAssertMsg(false, "sysctlbyname_with_pid(0): sysctl failed"); + return -1; + } + } + return 0; + } + + static int is_pid_native(pid_t pid) + { + int ret = 0; + size_t sz = sizeof(ret); + + if (sysctlbyname_with_pid("sysctl.proc_native", pid, + &ret, &sz, NULL, 0) == -1) { + if (errno == ENOENT) { + // sysctl doesn't exist, which means that this version of Mac OS + // pre-dates Rosetta, so the application must be native. + return 1; + } + AvmAssertMsg(false, "is_pid_native: sysctlbyname_with_pid failed"); + return -1; + } + + return ret; + } + #endif /* AVMPLUS_ROSETTA */ + + void GenericGuard::staticInit() + { + #ifdef AVMPLUS_ROSETTA + // Detect whether we are running under Rosetta + rosetta = !is_pid_native(getpid()); + #endif + + guardList = NULL; + + pthread_mutexattr_t mutexattr; + pthread_mutexattr_init(&mutexattr); + pthread_mutex_init(&mutex, &mutexattr); + pthread_mutexattr_destroy(&mutexattr); + + // Allocate the port + mach_port_t task = mach_task_self(); + + kern_return_t r; + r = mach_port_allocate(task, + MACH_PORT_RIGHT_RECEIVE, + &exceptionPort); + if (r != KERN_SUCCESS) + { + AvmAssertMsg(false, "mach_port_allocate failed"); + return; + } + + r = mach_port_insert_right(task, + exceptionPort, + exceptionPort, + MACH_MSG_TYPE_MAKE_SEND); + if (r != KERN_SUCCESS) + { + AvmAssertMsg(false, "mach_port_insert_right failed"); + return; + } + + // Start the thread + pthread_attr_t attr; + if (pthread_attr_init(&attr) != 0) + { + AvmAssertMsg(false, "pthread_attr_init failed"); + return; + } + + if (pthread_create(&exceptionThread, &attr, threadMain, NULL) != 0) + { + AvmAssertMsg(false, "pthread_create failed"); + return; + } + + pthread_attr_destroy(&attr); + } + + void GenericGuard::staticDestroy() + { + // Send the thread the exit notification + mach_msg_header_t msg; + msg.msgh_bits = MACH_MSGH_BITS(MACH_MSG_TYPE_MAKE_SEND, 0); + msg.msgh_size = sizeof(mach_msg_header_t); + msg.msgh_remote_port = exceptionPort; + msg.msgh_local_port = MACH_PORT_NULL; + msg.msgh_id = kThreadExitMsg; + + mach_msg_return_t r; + r = mach_msg(&msg, + MACH_SEND_MSG, + sizeof(msg), + 0, + MACH_PORT_NULL, + MACH_MSG_TIMEOUT_NONE, + MACH_PORT_NULL); + if (r != MACH_MSG_SUCCESS) + { + AvmAssertMsg(false, "mach_msg failed"); + } + + // Join the thread + void *status; + pthread_join(exceptionThread, &status); + + // Destroy the mutex + pthread_mutex_destroy(&mutex); + } + + void GenericGuard::init() + { + } + + kern_return_t GenericGuard::forward_exception(mach_port_t thread, + mach_port_t task, + exception_type_t exception, + exception_data_t data, + mach_msg_type_number_t data_count, + SavedExceptionPorts *savedExceptionPorts) + { + unsigned int i; + kern_return_t r; + mach_port_t port; + exception_behavior_t behavior; + thread_state_flavor_t flavor; + + #ifdef AVMPLUS_IA32 + i386_thread_state_t thread_state; + #else + ppc_thread_state_t thread_state; + #endif + + mach_msg_type_number_t thread_state_count = THREAD_STATE_MAX; + + for (i=0; icount; i++) + { + if (savedExceptionPorts->masks[i] & (1 << exception)) + { + break; + } + } + if (i == savedExceptionPorts->count) + { + AvmAssertMsg(false, "No handler for exception!"); + } + + port = savedExceptionPorts->ports[i]; + behavior = savedExceptionPorts->behaviors[i]; + flavor = savedExceptionPorts->flavors[i]; + + if(behavior != EXCEPTION_DEFAULT) + { + r = thread_get_state(thread, flavor, (natural_t*)&thread_state, &thread_state_count); + if(r != KERN_SUCCESS) + { + AvmAssertMsg(false, "thread_get_state failed in forward_exception"); + } + } + + switch(behavior) + { + case EXCEPTION_DEFAULT: + r = exception_raise(port, thread, task, exception, data, data_count); + break; + case EXCEPTION_STATE: + r = exception_raise_state(port, thread, task, exception, data, + data_count, &flavor, (natural_t*)&thread_state, thread_state_count, + (natural_t*)&thread_state, &thread_state_count); + break; + case EXCEPTION_STATE_IDENTITY: + r = exception_raise_state_identity(port, thread, task, exception, data, + data_count, &flavor, (natural_t*)&thread_state, thread_state_count, + (natural_t*)&thread_state, &thread_state_count); + break; + default: + r = KERN_FAILURE; + AvmAssertMsg(false, "forward_exception: unknown behavior"); + break; + } + + if (behavior != EXCEPTION_DEFAULT) + { + r = thread_set_state(thread, flavor, (natural_t*)&thread_state, thread_state_count); + if (r != KERN_SUCCESS) + { + AvmAssertMsg(false, "thread_set_state failed in forward_exception"); + } + } + + return r; + } + + void GenericGuard::registerHandler() + { + registered = true; + + // Add self to exception thread's list + int retCode = pthread_mutex_lock(&mutex); + (void)retCode; + AvmAssert(!retCode); + + thread = mach_thread_self(); + + next = guardList; + guardList = this; + + retCode = pthread_mutex_unlock(&mutex); + AvmAssert(!retCode); + + + exception_mask_t mask = EXC_MASK_BAD_ACCESS; + + // Save exception ports + memset(&savedExceptionPorts, 0, sizeof(SavedExceptionPorts)); + + kern_return_t r; + r = thread_get_exception_ports(thread, + mask, + savedExceptionPorts.masks, + &savedExceptionPorts.count, + savedExceptionPorts.ports, + savedExceptionPorts.behaviors, + savedExceptionPorts.flavors); + if (r != KERN_SUCCESS) + { + AvmAssertMsg(false, "thread_get_exception_ports failed"); + return; + } + + // Install exception ports + r = thread_set_exception_ports(thread, + mask, + exceptionPort, + EXCEPTION_DEFAULT, + MACHINE_THREAD_STATE); + + if (r != KERN_SUCCESS) + { + AvmAssertMsg(false, "thread_set_exception_ports failed"); + } + } + + void GenericGuard::unregisterHandler() + { + if (!registered) + { + return; + } + + // Remove self from the exception thread's list + pthread_mutex_lock(&mutex); + + volatile GenericGuard* volatile *prev = &guardList; + while (*prev != this) + { + prev = &((**prev).next); + } + *prev = next; + + pthread_mutex_unlock(&mutex); + + // Restore thread exception ports + for (unsigned int i=0; i>8) & 0xFF) << 16) | + (((x>>16) & 0xFF) << 8) | + (((x>>24) & 0xFF))); + } + #endif + + kern_return_t GenericGuard::catch_exception_raise(mach_port_t /*exception_port*/, + mach_port_t thread, + mach_port_t task, + exception_type_t exception, + exception_data_t code, + mach_msg_type_number_t code_count) + { + // Find the GenericGuard associated with thread + int retCode = pthread_mutex_lock(&mutex); + (void)retCode; + AvmAssert(!retCode); + + GenericGuard *guard = (GenericGuard*) guardList; + while (guard) + { + if (guard->thread == thread) + { + break; + } + guard = (GenericGuard*) guard->next; + } + + // If we couldn't find it, must be a different thread + if (!guard) + { + // reset guard to get saved exception ports + guard = (GenericGuard*) guardList; + retCode = pthread_mutex_unlock(&mutex); + AvmAssert(!retCode); + goto forward; + } + + retCode = pthread_mutex_unlock(&mutex); + AvmAssert(!retCode); + + // If an access violation occurred, let the GenericGuard a shot + // at handling the exception. + bool isAccessViolation = (exception == EXC_BAD_ACCESS && code[0] == KERN_PROTECTION_FAILURE); + + #ifdef AVMPLUS_ROSETTA + // Under Rosetta on 10.4.6 i386, exception and code[0] come through in + // little-endian instead of big-endian. Apple might fix that at some point, + // so we'll permit either endian to match. + if (rosetta) + { + isAccessViolation = isAccessViolation || (exception == SWAP32(EXC_BAD_ACCESS) && + code[0] == SWAP32(KERN_PROTECTION_FAILURE)); + } + #endif + + if (isAccessViolation) + { + kern_return_t returnCode; + if (guard->handleException(returnCode)) + { + // Our handler handled the exception. + return returnCode; + } + } + + forward: + + // We didn't handle the exception, so pass it to the regular handler. + SavedExceptionPorts *ports = (SavedExceptionPorts*)&guard->savedExceptionPorts; + return forward_exception(thread, task, exception, code, code_count, + ports); + } + + bool GrowthGuard::handleException(kern_return_t& returnCode) + { + #ifdef AVMPLUS_ROSETTA + // Under Rosetta, thread_get_state does not appear to work. + // So, we will simply assume that this exception is intended for us + // and grow the buffer. + if (rosetta) + { + GrowableBuffer* g = buffer; + g->grow(); + returnCode = KERN_SUCCESS; + return true; + } + #endif + + #ifdef AVMPLUS_IA32 + i386_exception_state_t exc_state; + mach_msg_type_number_t exc_state_count = i386_EXCEPTION_STATE_COUNT; + thread_state_flavor_t flavor = i386_EXCEPTION_STATE; + #else + ppc_exception_state_t exc_state; + mach_msg_type_number_t exc_state_count = PPC_EXCEPTION_STATE_COUNT; + thread_state_flavor_t flavor = PPC_EXCEPTION_STATE; + #endif + + thread_get_state(thread, + flavor, + (natural_t*)&exc_state, + &exc_state_count); + + #ifdef AVMPLUS_IA32 + byte *AccessViolationAddress = (byte*) exc_state.faultvaddr; + #else + byte *AccessViolationAddress = (byte*) exc_state.dar; + #endif + + GrowableBuffer* g = buffer; + byte* nextPage = g->uncommitted(); + byte* nextPageAfterGrow = NULL; + + if (AccessViolationAddress == nextPage) + { + // sequential write access to buffer + nextPageAfterGrow = g->grow(); + } + + if (AccessViolationAddress > nextPage && AccessViolationAddress < g->end()) + { + // random access into buffer (commit next page after the hit) + byte* page = g->pageAfter(AccessViolationAddress); + nextPageAfterGrow = g->growBy(page - nextPage); + } + + if(nextPage != nextPageAfterGrow) + { + returnCode = KERN_SUCCESS; + return true; + } + + return false; + } +#endif // AVMPLUS_MACH_EXCEPTIONS + + // BufferGuard + BufferGuard::BufferGuard(int *jmpBuf) + { + this->jmpBuf = jmpBuf; + init(); + if (jmpBuf) + registerHandler(); + } + + BufferGuard::~BufferGuard() + { + if (jmpBuf) + unregisterHandler(); + } + + // Platform specific code follows +#ifdef AVMPLUS_WIN32 + int BufferGuard::handleException(struct _EXCEPTION_RECORD* /*exceptionRecord*/, + void* /*establisherFrame*/, + struct _CONTEXT *contextRecord, + void* /*dispatcherContext*/) + { + // Set registers in contextRecord to point to the catch location when + // we return. We will *really* handle the exception there. All exceptions + // caught by this handler must be wrapped by TRY/CATCH blocks. See win32setjmp.cpp + contextRecord->Ebp = jmpBuf[0]; + contextRecord->Ebx = jmpBuf[1]; + contextRecord->Edi = jmpBuf[2]; + contextRecord->Esi = jmpBuf[3]; + contextRecord->Esp = jmpBuf[4]; + contextRecord->Eip = jmpBuf[5]; + + return ExceptionContinueExecution; + } +#endif // AVMPLUS_WIN32 + +#ifdef AVMPLUS_MACH_EXCEPTIONS + + bool BufferGuard::handleException(kern_return_t& returnCode) + { + #ifdef AVMPLUS_IA32 + i386_thread_state_t thread_state; + mach_msg_type_number_t thread_state_count = i386_THREAD_STATE_COUNT; + thread_state_flavor_t flavor = i386_THREAD_STATE; + #else + ppc_thread_state_t thread_state; + mach_msg_type_number_t thread_state_count = PPC_THREAD_STATE_COUNT; + thread_state_flavor_t flavor = PPC_THREAD_STATE; + #endif + + kern_return_t retVal; + + retVal = thread_suspend(thread); + + retVal = thread_get_state(thread, + flavor, + (natural_t*)&thread_state, + &thread_state_count); + + // set the registers to point back to the CATCH block + #ifdef AVMPLUS_PPC + thread_state.srr0 = jmpBuf[21]; + thread_state.r1 = jmpBuf[0]; + #endif + + #ifdef AVMPLUS_IA32 + thread_state.ebx = jmpBuf[0]; + thread_state.esi = jmpBuf[1]; + thread_state.edi = jmpBuf[2]; + thread_state.ebp = jmpBuf[3]; + thread_state.esp = jmpBuf[4]; + thread_state.eip = jmpBuf[5]; + #endif + + retVal = thread_set_state(thread, + flavor, + (natural_t*)&thread_state, + thread_state_count); + + retVal = thread_resume(thread); + + if(retVal == KERN_INVALID_ARGUMENT) + { + returnCode = KERN_FAILURE; + return true; + } + + // Handle the exception + returnCode = KERN_SUCCESS; + return true; + } + + +#endif /* AVMPLUS_MACH_EXCEPTIONS */ + + // GrowthGuard + GrowthGuard::GrowthGuard(GrowableBuffer* buffer) + { + this->registered = false; + this->buffer = buffer; + init(); + if (buffer) + registerHandler(); + } + + GrowthGuard::~GrowthGuard() + { + if (buffer) + unregisterHandler(); + } + + // Platform specific code follows +#ifdef AVMPLUS_WIN32 + int GrowthGuard::handleException(struct _EXCEPTION_RECORD* exceptionRecord, + void* /*establisherFrame*/, + struct _CONTEXT* /*contextRecord*/, + void* /*dispatcherContext*/) + { + byte* AccessViolationAddress = (byte*) exceptionRecord->ExceptionInformation[1]; + byte* nextPage = buffer->uncommitted(); + if (AccessViolationAddress == nextPage) + { + // sequential write access to buffer + buffer->grow(); + return ExceptionContinueExecution; + } + else if (AccessViolationAddress > nextPage && AccessViolationAddress < buffer->end()) + { + // random access into buffer (commit next page after the hit) + byte* page = buffer->pageAfter(AccessViolationAddress); + buffer->growBy(page - nextPage); + return ExceptionContinueExecution; + } + else + { + // hmm something is pretty bad here + return ExceptionContinueSearch; + } + } + +#endif /* AVMPLUS_WIN32 */ + +#endif /* FEATURE_BUFFER_GUARD */ +} diff --git a/mozilla/js/tamarin/core/GrowableBuffer.h b/mozilla/js/tamarin/core/GrowableBuffer.h new file mode 100644 index 00000000000..766adc0e377 --- /dev/null +++ b/mozilla/js/tamarin/core/GrowableBuffer.h @@ -0,0 +1,227 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 1993-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#ifndef __avmplus_GrowableBuffer_H_ +#define __avmplus_GrowableBuffer_H_ + +#ifdef AVMPLUS_MACH_EXCEPTIONS +#include +#include +#include +#include +#include +#include +#endif /* AVMPLUS_MACH_EXCEPTIONS */ + +namespace avmplus +{ + class GrowableBuffer : public MMgc::GCObject + { + public: + GrowableBuffer(MMgc::GCHeap* heap); + virtual ~GrowableBuffer(); + + byte* reserve(size_t amt); + void free(); + byte* decommitUnused(); + byte* growBy(size_t amt); + byte* grow(); + byte* shrinkTo(size_t amt); + + size_t pageSize() { return heap->kNativePageSize; } + byte* start() { return first; } + byte* end() { return last; } + size_t size() { return last-first; } + byte* uncommitted() { return uncommit; } + byte* getPos() { return current; } + void setPos(byte* c) { current = c; /* AvmAssert(c >= start && c <= end); */ } + + private: + void init(); + byte* pageFor(byte* addr) { return (byte*) ( (size_t)addr & ~(pageSize()-1) ); } + byte* pageAfter(byte* addr) { return (byte*) ( (size_t)(addr+pageSize()) & ~(pageSize()-1) ); } + + MMgc::GCHeap* const heap; + byte* first; // reservation starting address + byte* last; // reservation ending address + byte* uncommit; // next uncommitted page in region + byte* current; // current position in buffer + + friend class GrowthGuard; + }; + +#ifdef FEATURE_BUFFER_GUARD + + // Generic Guard class + class GenericGuard + { + public: + void disable() { registerHandler(); } + void enable() { unregisterHandler(); } + + #ifdef AVMPLUS_MACH_EXCEPTIONS + static void staticInit(); + static void staticDestroy(); + #endif + + protected: + void init(); + void registerHandler(); + void unregisterHandler(); + + #ifdef AVMPLUS_WIN32 + typedef struct _ExceptionRegistrationRecord + { + DWORD prev; + DWORD handler; + void* instance; + DWORD terminator; + } + ExceptionRegistrationRecord; + + ExceptionRegistrationRecord record; + + // Platform specific code follows + static int __cdecl guardRoutine(struct _EXCEPTION_RECORD *exceptionRecord, + void *establisherFrame, + struct _CONTEXT *contextRecord, + void *dispatcherContext); + + virtual int handleException(struct _EXCEPTION_RECORD *exceptionRecord, + void *establisherFrame, + struct _CONTEXT *contextRecord, + void *dispatcherContext) = 0; + #endif /* AVMPLUS_WIN32 */ + + #ifdef AVMPLUS_MACH_EXCEPTIONS + static pthread_mutex_t mutex; + static pthread_t exceptionThread; + static mach_port_t exceptionPort; + static volatile GenericGuard *guardList; + + mach_port_t thread; + volatile GenericGuard *next; + + const static int kMaxExceptionPorts = 16; + + struct SavedExceptionPorts + { + mach_msg_type_number_t count; + exception_mask_t masks[kMaxExceptionPorts]; + exception_handler_t ports[kMaxExceptionPorts]; + exception_behavior_t behaviors[kMaxExceptionPorts]; + thread_state_flavor_t flavors[kMaxExceptionPorts]; + } + savedExceptionPorts; + + virtual bool handleException(kern_return_t& returnCode) = 0; + + // since we have virtual functions, we probably need a virtual dtor + virtual ~GenericGuard() {} + + static kern_return_t catch_exception_raise(mach_port_t exception_port, + mach_port_t thread, + mach_port_t task, + exception_type_t exception, + exception_data_t code, + mach_msg_type_number_t code_count); + + static kern_return_t forward_exception(mach_port_t thread, + mach_port_t task, + exception_type_t exception, + exception_data_t data, + mach_msg_type_number_t data_count, + SavedExceptionPorts *savedExceptionPorts); + + static void* threadMain(void *arg); + + const static int kThreadExitMsg = 1; + + #ifdef AVMPLUS_ROSETTA + static bool rosetta; + #endif + + #endif // AVMPLUS_MACH_EXCEPTIONS + + bool registered; + }; + + // Guards ABC buffer + class BufferGuard : public GenericGuard + { + public: + BufferGuard(int *jmpBuf); + virtual ~BufferGuard(); + + protected: + #ifdef AVMPLUS_WIN32 + virtual int handleException(struct _EXCEPTION_RECORD *exceptionRecord, + void *establisherFrame, + struct _CONTEXT *contextRecord, + void *dispatcherContext); + #endif /* AVMPLUS_WIN32 */ + + #ifdef AVMPLUS_MACH_EXCEPTIONS + virtual bool handleException(kern_return_t& returnCode); + #endif + + private: + int *jmpBuf; + + }; + + // used to expand GrowableBuffer for generated code + class GrowthGuard : public GenericGuard + { + public: + GrowthGuard(GrowableBuffer* buffer); + virtual ~GrowthGuard(); + + protected: + #ifdef AVMPLUS_WIN32 + virtual int handleException(struct _EXCEPTION_RECORD *exceptionRecord, + void *establisherFrame, + struct _CONTEXT *contextRecord, + void *dispatcherContext); + #endif + + #ifdef AVMPLUS_MACH_EXCEPTIONS + virtual bool handleException(kern_return_t& returnCode); + #endif + + private: + // pointer to buffer we are guarding + GrowableBuffer* buffer; + }; +#endif /* FEATURE_BUFFER_GUARD */ +} +#endif /*___avmplus_GrowableBuffer_H_*/ diff --git a/mozilla/js/tamarin/core/IntClass.cpp b/mozilla/js/tamarin/core/IntClass.cpp new file mode 100644 index 00000000000..a4eca2dc2a4 --- /dev/null +++ b/mozilla/js/tamarin/core/IntClass.cpp @@ -0,0 +1,75 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmplus.h" + +namespace avmplus +{ + BEGIN_NATIVE_MAP(IntClass) + END_NATIVE_MAP() + + IntClass::IntClass(VTable* cvtable) : ClassClosure(cvtable) + { + toplevel()->intClass = this; + // prototype objects are always vanilla objects. + createVanillaPrototype(); + } + + Atom IntClass::construct(int argc, Atom* argv) + { + if (argc == 0) + return 0|kIntegerType; // yep this is zero atom + else + return core()->intAtom(argv[1]); + // TODO ArgumentError if argc > 1 + } + + BEGIN_NATIVE_MAP(UIntClass) + END_NATIVE_MAP() + + UIntClass::UIntClass(VTable* cvtable) : ClassClosure(cvtable) + { + toplevel()->uintClass = this; + // prototype objects are always vanilla objects. + createVanillaPrototype(); + } + + Atom UIntClass::construct(int argc, Atom* argv) + { + if (argc == 0) + return 0|kIntegerType; // yep this is zero atom + else + return core()->uintAtom(argv[1]); + // TODO ArgumentError if argc > 1 + } + +} diff --git a/mozilla/js/tamarin/core/IntClass.h b/mozilla/js/tamarin/core/IntClass.h new file mode 100644 index 00000000000..07d11ba93e9 --- /dev/null +++ b/mozilla/js/tamarin/core/IntClass.h @@ -0,0 +1,87 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_IntClass__ +#define __avmplus_IntClass__ + + +namespace avmplus +{ + /** + * class int + */ + class IntClass : public ClassClosure + { + public: + DECLARE_NATIVE_MAP(IntClass) + + IntClass(VTable* cvtable); + + // this = argv[0] (ignored) + // arg1 = argv[1] + // argN = argv[argc] + Atom construct(int argc, Atom* argv); + + // this = argv[0] + // arg1 = argv[1] + // argN = argv[argc] + Atom call(int argc, Atom *argv) + { + return construct(argc, argv); + } + }; + + /** + * class uint + */ + class UIntClass : public ClassClosure + { + public: + DECLARE_NATIVE_MAP(UIntClass) + + UIntClass(VTable* cvtable); + + // this = argv[0] (ignored) + // arg1 = argv[1] + // argN = argv[argc] + Atom construct(int argc, Atom* argv); + + // this = argv[0] + // arg1 = argv[1] + // argN = argv[argc] + Atom call(int argc, Atom* argv) + { + return construct(argc,argv); + } + }; +} + +#endif /* __avmplus_IntClass__ */ diff --git a/mozilla/js/tamarin/core/Interpreter.cpp b/mozilla/js/tamarin/core/Interpreter.cpp new file mode 100644 index 00000000000..f2e955cb05d --- /dev/null +++ b/mozilla/js/tamarin/core/Interpreter.cpp @@ -0,0 +1,1555 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmplus.h" + +#ifdef AVMPLUS_MAC +// inline_max_total_size() defaults to 10000. +// This module includes so many inline functions that we +// exceed this limit and we start getting compile warnings, +// so bump up the limit for this file. +#pragma inline_max_total_size(26576) +#endif + +#ifdef AVMPLUS_INTERP +namespace avmplus +{ + int Interpreter::interp32(MethodEnv* env, int argc, va_list ap) + { + Atom a = interp(env, argc, ap); + Traits* t = env->method->returnTraits(); + AvmCore* core = env->core(); + if (!t || t == OBJECT_TYPE || t == VOID_TYPE) + return a; + if (t == INT_TYPE) + return AvmCore::integer_i(a); + if (t == UINT_TYPE) + return AvmCore::integer_u(a); + if (t == BOOLEAN_TYPE) + return a>>3; + return a & ~7; // possibly null pointer + } + + double Interpreter::interpN(MethodEnv* env, int argc, va_list ap) + { + Atom a = interp(env, argc, ap); + return AvmCore::number_d(a); + } + + /** + * Interpret the AVM+ instruction set. + * @return + */ + Atom Interpreter::interp(MethodEnv *env, int argc, va_list ap) + { + + MethodInfo* info = (MethodInfo*)(AbstractFunction*) env->method; + AvmCore *core = info->core(); + + if (core->minstack) + { + // Take the address of a local variable to get + // stack pointer + uint32 sp = (uint32)&core; + if (sp < core->minstack) + { + env->vtable->traits->core->stackOverflow(env); + } + } + + #ifdef AVMPLUS_VERBOSE + if (info->pool->verbose) + core->console << "interp " << info << '\n'; + #endif + + const byte* pos = info->body_pos; + int max_stack = AvmCore::readU30(pos); + int local_count = AvmCore::readU30(pos); + int init_scope_depth = AvmCore::readU30(pos); + int max_scope_depth = AvmCore::readU30(pos); + int max_scope = MethodInfo::maxScopeDepth(info, max_scope_depth - init_scope_depth); + AvmCore::readU30(pos); // code_length + const byte * volatile code_start = pos; + + // these should have been checked in AbcParser + AvmAssert(local_count+max_scope+max_stack > 0); + Atom* framep = (Atom*)alloca(sizeof(Atom)*(local_count + max_scope + max_stack)); + Atom* scopeBase = framep + local_count; + Atom* withBase = NULL; + + #ifdef DEBUGGER + CallStackNode callStackNode(env, info, framep, 0, argc, ap, 0 /* later changed to 'pc' */); + // don't allow entry into the debugger until we have setup the frame + #endif + + CodeContextAtom savedCodeContext = core->codeContextAtom; + if (info->pool->domain->base != NULL) { + core->codeContextAtom = (CodeContextAtom)env | CONTEXT_ENV; + } + + va_list out = ap; + #if defined(AVMPLUS_MAC) || defined(AVMPLUS_LINUX) || defined(AVMPLUS_ARM) + Atom* atomv = (Atom*)out; + #else + Atom* atomv = &va_arg(out, Atom); + #endif + info->boxArgs(argc, ap, atomv); + + // 1. copy instance and args to local frame + for (int i=0, n = argc < info->param_count ? argc : info->param_count; i <= n; i++) + { + framep[i] = atomv[i]; + } + + // Store original value of argc for createRest and createArguments. + // argc may be changed by the optional parameter check below. + int arguments_argc = argc; + + // set optional param values. these not aliased to arguments[] since arguments[] + // only present with traditional prototype functions (no optional args) + if (info->flags & AbstractFunction::HAS_OPTIONAL) + { + if (argc < info->param_count) + { + // initialize default values + for (int i=argc+1, o=argc + info->optional_count - info->param_count, n=info->param_count; i <= n; i++, o++) + { + framep[i] = info->getDefaultValue(o); + } + argc = info->param_count; + } + } + + // 4. set remaining locals to undefined. Don't have to init scope or stack because + // our conservative GC scan knows how to ignore garbage. + for (Atom *p = framep + 1 + info->param_count; p < scopeBase; p++) + { + *p = undefinedAtom; + } + + Toplevel *const toplevel = env->toplevel(); + + // 2. capture arguments or rest array. + if (info->flags & AbstractFunction::NEED_REST) + { + framep[info->param_count+1] = env->createRest(atomv,arguments_argc)->atom(); + } + else if (info->flags & AbstractFunction::NEED_ARGUMENTS) + { + // create arguments using atomv[1..argc]. + // Even tho E3 says create an Object, E4 says create an Array so thats what we will do. + framep[info->param_count+1] = env->createArguments(atomv, arguments_argc)->atom(); + } + + // 3. create the activation object, if necessary + + // init the scope chain by copying it from the captured scope + ScopeChain* scope = env->vtable->scope; + Namespace *dxns = scope->defaultXmlNamespace; + Namespace **dxnsAddr; + Namespace *const*dxnsAddrSave = NULL; + + if(info->setsDxns()) { + dxnsAddrSave = core->dxnsAddr; + dxnsAddr = &dxns; + } else { + dxnsAddr = scope->getDefaultNamespaceAddr(); + } + + int outer_depth = scope->getSize(); + int scopeDepth = 0; + + // make sure scope chain depth is right before entering. + volatile int initialScopeDepth = scopeDepth; + + Atom tempAtom; + + PoolObject *pool = info->pool; + const List& cpool_string = pool->cpool_string; + const List& cpool_int = pool->cpool_int; + const List& cpool_uint = pool->cpool_uint; + const List& cpool_double = pool->cpool_double; + const List& cpool_ns = pool->cpool_ns; + + Atom *sp = scopeBase + max_scope - 1; + + #ifdef DEBUGGER + Debugger* debugger = core->debugger; + if (core->callStack) + core->callStack->framep = framep; + + // notify the debugger that we are entering a new frame. + env->debugEnter(argc, ap, NULL, local_count, NULL, framep, 0); // call it but make sure that callStackNode is not re-init'd + #endif + + const byte* pc = code_start; + int volatile expc; + + #ifdef DEBUGGER + callStackNode.eip = &expc; + callStackNode.scopeDepth = &scopeDepth; + #endif + + // Mask that can be XOR'd to flip a boolean atom + const int booleanNotMask = trueAtom^falseAtom; + + // whether this sequence is interruptable or not. + bool interruptable = (info->flags & AbstractFunction::NON_INTERRUPTABLE) ? false : true; + + core->branchCheck(env, interruptable, -1); + + MainLoop: + TRY_UNLESS(core, !info->exceptions, kCatchAction_SearchForActionScriptExceptionHandler) { + + + // the verifier ensures we don't fall off the end of a method. so + // we dont have to check the end pointer here. + for (;;) + { + // restore this every time since we might have called out to + // code that changes it + core->dxnsAddr = dxnsAddr; + + expc = pc-code_start; + AbcOpcode opcode = (AbcOpcode) *pc++; + + #ifdef AVMPLUS_VERBOSE + if (pool->verbose) + { + showState(info, opcode, pc - 1 - code_start, framep, sp-framep, + scopeBase+scopeDepth-1-framep, scopeBase-framep, scopeBase+max_scope-framep, + code_start); + } + #endif + + #ifdef AVMPLUS_PROFILE + if (core->dprof.dprofile) + core->dprof.mark(opcode); + #endif + + switch (opcode) + { + case OP_returnvoid: + case OP_returnvalue: + #ifdef DEBUGGER + env->debugExit(&callStackNode); + #endif + core->codeContextAtom = savedCodeContext; + + tempAtom = toplevel->coerce((opcode==OP_returnvoid) ? undefinedAtom : *sp, + info->returnTraits()); + + #ifdef AVMPLUS_VERBOSE + if (info->pool->verbose) + core->console << "exit " << info << '\n'; + #endif + + return tempAtom; + + case OP_nop: + case OP_label: + case OP_timestamp: + continue; + + case OP_bkpt: + #ifdef DEBUGGER + if (debugger) + { + debugger->enterDebugger(); + } + #endif + continue; + + case OP_debugline: + { + #ifdef DEBUGGER + int line = readU30(pc); + if (debugger) + { + debugger->debugLine(line); + } + #else + readU30(pc); + #endif + continue; + } + + case OP_bkptline: + { + #ifdef DEBUGGER + int line = readU30(pc); + if (debugger) + { + debugger->debugLine(line); + debugger->enterDebugger(); + } + #else + readU30(pc); + #endif + continue; + } + + case OP_debug: + // tbd + pc += AvmCore::calculateInstructionWidth(pc-1) - 1; + continue; + + case OP_debugfile: + { + #ifdef DEBUGGER + int index = readU30(pc); + if (debugger) + { + debugger->debugFile(pool->getString(index)); + } + #else + readU30(pc); + #endif + continue; + } + + case OP_jump: + { + int j = readS24(pc); + core->branchCheck(env, interruptable, j); + pc += 3+j; + } + continue; + + case OP_pushnull: + sp++; + sp[0] = nullObjectAtom; + continue; + case OP_pushundefined: + sp++; + sp[0] = undefinedAtom; + continue; + case OP_pushstring: + sp++; + sp[0] = cpool_string[readU30(pc)]->atom(); + continue; + case OP_pushint: + sp++; + sp[0] = core->intToAtom(cpool_int[readU30(pc)]); + continue; + case OP_pushuint: + sp++; + sp[0] = core->uintToAtom(cpool_uint[readU30(pc)]); + continue; + case OP_pushdouble: + sp++; + sp[0] = kDoubleType|(int)cpool_double[readU30(pc)]; + continue; + case OP_pushnamespace: + sp++; + sp[0] = cpool_ns[readU30(pc)]->atom(); + continue; + case OP_getlocal: + sp++; + sp[0] = framep[readU30(pc)]; + continue; + case OP_getlocal0: + case OP_getlocal1: + case OP_getlocal2: + case OP_getlocal3: + sp++; + sp[0] = framep[opcode-OP_getlocal0]; + continue; + case OP_pushtrue: + sp++; + sp[0] = trueAtom; + continue; + case OP_pushfalse: + sp++; + sp[0] = falseAtom; + continue; + case OP_pushnan: + sp++; + sp[0] = core->kNaN; + continue; + + case OP_pop: + sp--; + continue; + + case OP_dup: + sp++; + sp[0] = sp[-1]; + continue; + + case OP_swap: + tempAtom = sp[0]; + sp[0] = sp[-1]; + sp[-1] = tempAtom; + continue; + + case OP_convert_s: + sp[0] = core->string(sp[0])->atom(); + continue; + + case OP_esc_xelem: // ToXMLString will call EscapeElementValue + sp[0] = core->ToXMLString(sp[0])->atom(); + continue; + + case OP_esc_xattr: + sp[0] = core->EscapeAttributeValue(sp[0])->atom(); + continue; + + case OP_coerce_d: + case OP_convert_d: + sp[0] = core->numberAtom(sp[0]); + continue; + + case OP_convert_b: + case OP_coerce_b: + sp[0] = core->booleanAtom(sp[0]); + continue; + + // if sp[0] is null or undefined, throw TypeError. otherwise return same value. + case OP_convert_o: + env->nullcheck(sp[0]); + continue; + + case OP_negate: + sp[0] = core->doubleToAtom(-core->number(sp[0])); + continue; + + case OP_negate_i: + sp[0] = core->intToAtom(-core->integer(sp[0])); + continue; + + case OP_increment: + *sp = core->numberAtom(*sp); + core->increment_d(sp, 1); + continue; + + case OP_increment_i: + core->increment_i(sp, 1); + continue; + + case OP_inclocal: + { + Atom* rp = framep+readU30(pc); + *rp = core->numberAtom(*rp); + core->increment_d(rp, 1); + continue; + } + + case OP_kill: + { + framep[readU30(pc)] = undefinedAtom; + continue; + } + + case OP_inclocal_i: + core->increment_i(framep+readU30(pc), 1); + continue; + + case OP_decrement: + *sp = core->numberAtom(*sp); + core->increment_d(sp, -1); + continue; + + case OP_decrement_i: + core->increment_i(sp, -1); + continue; + + case OP_declocal: + { + Atom* rp = framep+readU30(pc); + *rp = core->numberAtom(*rp); + core->increment_d(rp, -1); + continue; + } + + case OP_declocal_i: + core->increment_i(framep+readU30(pc), -1); + continue; + + case OP_typeof: + *sp = core->_typeof(*sp)->atom(); + continue; + + case OP_not: + *sp = core->booleanAtom(*sp) ^ booleanNotMask; + continue; + + case OP_bitnot: + *sp = core->intToAtom(~core->integer(*sp)); + continue; + + case OP_setlocal: + framep[readU30(pc)] = *(sp--); + continue; + case OP_setlocal0: + case OP_setlocal1: + case OP_setlocal2: + case OP_setlocal3: + framep[opcode-OP_setlocal0] = *(sp--); + continue; + + case OP_add: + sp[-1] = toplevel->add2(sp[-1], sp[0]); + sp--; + continue; + + case OP_add_i: + sp[-1] = core->intToAtom(core->integer(sp[-1]) + core->integer(sp[0])); + sp--; + continue; + + case OP_subtract: + sp[-1] = core->doubleToAtom(core->number(sp[-1]) - core->number(sp[0])); + sp--; + continue; + + case OP_subtract_i: + sp[-1] = core->intToAtom(core->integer(sp[-1]) - core->integer(sp[0])); + sp--; + continue; + + case OP_multiply: + sp[-1] = core->doubleToAtom(core->number(sp[-1]) * core->number(sp[0])); + sp--; + continue; + + case OP_multiply_i: + sp[-1] = core->intToAtom(core->integer(sp[-1]) * core->integer(sp[0])); + sp--; + continue; + + case OP_divide: + sp[-1] = core->doubleToAtom(core->number(sp[-1]) / core->number(sp[0])); + sp--; + continue; + + case OP_modulo: + sp[-1] = core->doubleToAtom(MathUtils::mod(core->number(sp[-1]), core->number(sp[0]))); + sp--; + continue; + + case OP_lshift: + sp[-1] = core->intToAtom( core->integer(sp[-1]) << (core->toUInt32(sp[0])&0x1F) ); + sp--; + continue; + + case OP_rshift: + sp[-1] = core->intToAtom( core->integer(sp[-1]) >> (core->toUInt32(sp[0])&0x1F) ); + sp--; + continue; + + case OP_urshift: + sp[-1] = core->uintToAtom( core->toUInt32(sp[-1]) >> (core->toUInt32(sp[0])&0x1F) ); + sp--; + continue; + + case OP_bitand: + sp[-1] = core->intToAtom(core->integer(sp[-1]) & core->integer(sp[0])); + sp--; + continue; + + case OP_bitor: + sp[-1] = core->intToAtom(core->integer(sp[-1]) | core->integer(sp[0])); + sp--; + continue; + + case OP_bitxor: + sp[-1] = core->intToAtom(core->integer(sp[-1]) ^ core->integer(sp[0])); + sp--; + continue; + + case OP_equals: + sp[-1] = core->eq(sp[-1], sp[0]); + sp--; + continue; + + case OP_strictequals: + sp[-1] = core->stricteq(sp[-1], sp[0]); + sp--; + continue; + + case OP_lookupswitch: + { + const byte* base = pc-1; + // safe to assume int since verifier checks for int + uint32 index = AvmCore::integer_u(*(sp--)); + const byte* switch_pc = pc+3; + uint32 case_count = readU30(switch_pc) + 1; + pc = base+readS24( index < case_count ? (switch_pc + 3*index) : pc ); + + continue; + } + + case OP_iftrue: + if (core->booleanAtom(*(sp--)) & booleanNotMask) + { + int j = readS24(pc); + core->branchCheck(env, interruptable, j); + pc += 3+j; + } + else + pc += 3; + continue; + + case OP_iffalse: + if (!(core->booleanAtom(*(sp--)) & booleanNotMask)) + { + int j = readS24(pc); + core->branchCheck(env, interruptable, j); + pc += 3+j; + } + else + pc += 3; + continue; + + case OP_ifeq: + sp -= 2; + if (core->eq(sp[1], sp[2]) == trueAtom) + { + int j = readS24(pc); + core->branchCheck(env, interruptable, j); + pc += j; + } + pc += 3; + continue; + + case OP_ifne: + sp -= 2; + if (core->eq(sp[1], sp[2]) == falseAtom) + { + int j = readS24(pc); + core->branchCheck(env, interruptable, j); + pc += j; + } + pc += 3; + continue; + + case OP_ifstricteq: + sp -= 2; + if (core->stricteq(sp[1], sp[2]) == trueAtom) + { + int j = readS24(pc); + core->branchCheck(env, interruptable, j); + pc += j; + } + pc += 3; + continue; + + case OP_ifstrictne: + sp -= 2; + if (core->stricteq(sp[1], sp[2]) == falseAtom) + { + int j = readS24(pc); + core->branchCheck(env, interruptable, j); + pc += j; + } + pc += 3; + continue; + + case OP_iflt: + sp -= 2; + if (core->compare(sp[1], sp[2]) == trueAtom) + { + int j = readS24(pc); + core->branchCheck(env, interruptable, j); + pc += j; + } + pc += 3; + continue; + + case OP_ifnlt: + sp -= 2; + if (core->compare(sp[1], sp[2]) != trueAtom) + { + int j = readS24(pc); + core->branchCheck(env, interruptable, j); + pc += j; + } + pc += 3; + continue; + + case OP_ifle: + sp -= 2; + if (core->compare(sp[2], sp[1]) == falseAtom) + { + int j = readS24(pc); + core->branchCheck(env, interruptable, j); + pc += j; + } + pc += 3; + continue; + + case OP_ifnle: + sp -= 2; + if (core->compare(sp[2], sp[1]) != falseAtom) + { + int j = readS24(pc); + core->branchCheck(env, interruptable, j); + pc += j; + } + pc += 3; + continue; + + case OP_ifgt: + sp -= 2; + if (core->compare(sp[2], sp[1]) == trueAtom) + { + int j = readS24(pc); + core->branchCheck(env, interruptable, j); + pc += j; + } + pc += 3; + continue; + + case OP_ifngt: + sp -= 2; + if (core->compare(sp[2], sp[1]) != trueAtom) + { + int j = readS24(pc); + core->branchCheck(env, interruptable, j); + pc += j; + } + pc += 3; + continue; + + case OP_ifge: + sp -= 2; + if (core->compare(sp[1], sp[2]) == falseAtom) + { + int j = readS24(pc); + core->branchCheck(env, interruptable, j); + pc += j; + } + pc += 3; + continue; + + case OP_ifnge: + sp -= 2; + if (core->compare(sp[1], sp[2]) != falseAtom) + { + int j = readS24(pc); + core->branchCheck(env, interruptable, j); + pc += j; + } + pc += 3; + continue; + + case OP_lessthan: + sp--; + sp[0] = core->compare(sp[0],sp[1]) == trueAtom ? trueAtom : falseAtom; + continue; + + case OP_lessequals: + sp--; + sp[0] = core->compare(sp[1],sp[0]) == falseAtom ? trueAtom : falseAtom; + continue; + + case OP_greaterthan: + sp--; + sp[0] = core->compare(sp[1],sp[0]) == trueAtom ? trueAtom : falseAtom; + continue; + + case OP_greaterequals: + sp--; + sp[0] = core->compare(sp[0],sp[1]) == falseAtom ? trueAtom : falseAtom; + continue; + + case OP_newobject: + argc = readU30(pc); + tempAtom = env->op_newobject(sp, argc)->atom(); + *(sp -= 2*argc-1) = tempAtom; + continue; + + case OP_newarray: + argc = readU30(pc); + tempAtom = toplevel->arrayClass->newarray(sp-argc+1, argc)->atom(); + *(sp -= argc-1) = tempAtom; + continue; + + case OP_getlex: + { + // findpropstrict + getproperty + // stack in: - + // stack out: value + Multiname name; + pool->parseMultiname(name, readU30(pc)); + + // only non-runtime names are allowed. but this still includes + // wildcard and attribute names. + Atom obj = env->findproperty(scope, scopeBase, scopeDepth, &name, true, withBase); + *(++sp) = toplevel->getproperty(obj, &name, toplevel->toVTable(obj)); + continue; + } + + // get a property using a multiname ref + case OP_getproperty: + { + Multiname multiname; + pool->parseMultiname(multiname, readU30(pc)); + if (!multiname.isRuntime()) + { + sp[0] = toplevel->getproperty(sp[0], &multiname, toplevel->toVTable(sp[0])); + } + else + { + if(multiname.isRtns() || !core->isDictionaryLookup(*sp, *(sp-1))) { + sp = initMultiname(env, multiname, sp); + *sp = toplevel->getproperty(*sp, &multiname, toplevel->toVTable(*sp)); + } else { + Atom key = *(sp--); + sp[0] = AvmCore::atomToScriptObject(sp[0])->getProperty(key); + } + } + + continue; + } + + // set a property using a multiname ref + case OP_setproperty: + { + Multiname multiname; + pool->parseMultiname(multiname, readU30(pc)); + Atom value = *(sp--); + if (!multiname.isRuntime()) + { + Atom obj = *(sp--); + toplevel->setproperty(obj, &multiname, value, toplevel->toVTable(obj)); + } + else + { + if(multiname.isRtns() || !core->isDictionaryLookup(*sp, *(sp-1))) { + sp = initMultiname(env, multiname, sp); + Atom obj = *(sp--); + toplevel->setproperty(obj, &multiname, value, toplevel->toVTable(obj)); + } else { + Atom key = *(sp--); + Atom obj = *(sp--); + AvmCore::atomToScriptObject(obj)->setProperty(key, value); + } + } + continue; + } + + case OP_initproperty: + { + Multiname multiname; + pool->parseMultiname(multiname, readU30(pc)); + Atom value = *(sp--); + if (!multiname.isRuntime()) + { + Atom obj = *(sp--); + env->initproperty(obj, &multiname, value, toplevel->toVTable(obj)); + } + else + { + sp = initMultiname(env, multiname, sp); + Atom obj = *(sp--); + env->initproperty(obj, &multiname, value, toplevel->toVTable(obj)); + } + continue; + } + + case OP_getdescendants: + { + Multiname name; + pool->parseMultiname(name, readU30(pc)); + if (!name.isRuntime()) + { + sp[0] = env->getdescendants(sp[0], &name); + } + else + { + sp = initMultiname(env, name, sp); + sp[0] = env->getdescendants(sp[0], &name); + } + continue; + } + + case OP_checkfilter: + { + env->checkfilter(sp[0]); + continue; + } + + // search the scope chain for a given property and return the object + // that contains it. the next instruction will usually be getpropname + // or setpropname. + case OP_findpropstrict: + case OP_findproperty: + { + // stack in: [ns [name]] + // stack out: obj + Multiname multiname; + pool->parseMultiname(multiname, readU30(pc)); + if (!multiname.isRuntime()) + { + *(++sp) = env->findproperty(scope, scopeBase, scopeDepth, &multiname, opcode == OP_findpropstrict, withBase); + } + else + { + sp = initMultiname(env, multiname, sp); + *(++sp) = env->findproperty(scope, scopeBase, scopeDepth, &multiname, opcode == OP_findpropstrict, withBase); + } + continue; + } + + case OP_finddef: + { + // stack in: + // stack out: obj + Multiname multiname; + pool->parseMultiname(multiname, readU30(pc)); + *(++sp) = env->finddef(&multiname)->atom(); + continue; + } + + case OP_nextname: + sp--; + // verifier checks for int + sp[0] = env->nextname(sp[0], AvmCore::integer_i(sp[1])); + continue; + + case OP_nextvalue: + sp--; + // verifier checks for int + sp[0] = env->nextvalue(sp[0], AvmCore::integer_i(sp[1])); + continue; + + case OP_hasnext: + sp--; + // verifier checks for int + sp[0] = core->intToAtom(env->hasnext(sp[0], AvmCore::integer_i(sp[1]))); + continue; + + case OP_hasnext2: + { + int objectReg = readU30(pc); + int indexReg = readU30(pc); + Atom objAtom = framep[objectReg]; + int index = core->integer(framep[indexReg]); + *(++sp) = env->hasnext2(objAtom, index) ? trueAtom : falseAtom; + framep[objectReg] = objAtom; + framep[indexReg] = core->intToAtom(index); + } + break; + + // delete property using multiname + case OP_deleteproperty: + { + Multiname multiname; + pool->parseMultiname(multiname, readU30(pc)); + if (!multiname.isRuntime()) + { + sp[0] = env->delproperty(sp[0], &multiname); + } + else + { + if(multiname.isRtns() || !core->isDictionaryLookup(*sp, *(sp-1))) { + sp = initMultiname(env, multiname, sp, true); + sp[0] = env->delproperty(sp[0], &multiname); + } else { + Atom key = *(sp--); + bool res = AvmCore::atomToScriptObject(sp[0])->deleteProperty(key); + sp[0] = res ? trueAtom : falseAtom; + } + } + continue; + } + + case OP_setslot: + { + sp -= 2; + env->nullcheck(sp[1]); + int slot_id = readU30(pc)-1; + ScriptObject* o = AvmCore::atomToScriptObject(sp[1]); + o->setSlotAtom(slot_id, + toplevel->coerce(sp[2], o->traits()->getSlotTraits(slot_id))); + continue; + } + + case OP_getslot: + env->nullcheck(sp[0]); + sp[0] = AvmCore::atomToScriptObject(sp[0])->getSlotAtom(readU30(pc)-1); + continue; + + case OP_setglobalslot: + { + // find the global activation scope (object at depth 0 on scope chain) + ScriptObject *global; + if (outer_depth == 0) + { + global = AvmCore::atomToScriptObject(scopeBase[0]); + } + else + { + global = AvmCore::atomToScriptObject(scope->getScope(0)); + } + + int slot_id = readU30(pc)-1; + sp--; + global->setSlotAtom(slot_id, + toplevel->coerce(sp[1], global->traits()->getSlotTraits(slot_id))); + continue; + } + + case OP_getglobalslot: + { + // find the global activation scope (object at depth 0 on scope chain) + ScriptObject *global; + if (outer_depth == 0) + { + global = AvmCore::atomToScriptObject(scopeBase[0]); + } + else + { + global = AvmCore::atomToScriptObject(scope->getScope(0)); + } + + sp++; + sp[0] = global->getSlotAtom(readU30(pc)-1); + continue; + } + + case OP_call: + { + argc = readU30(pc); + // stack in: function, receiver, arg1, ... argN + // stack out: result + tempAtom = toplevel->op_call(sp[-argc-1]/*function*/, argc, sp-argc); + *(sp = sp-argc-1) = tempAtom; + continue; + } + + case OP_construct: + { + argc = readU30(pc); + // stack in: function, arg1, ..., argN + // stack out: new instance + tempAtom = toplevel->op_construct(sp[-argc]/*function*/, argc, sp-argc); + *(sp = sp-argc) = tempAtom; + continue; + } + + case OP_newfunction: + { + sp++; + AbstractFunction *body = pool->getMethodInfo(readU30(pc)); + sp[0] = env->newfunction(body, scope, scopeBase)->atom(); + continue; + } + + case OP_newclass: + { + int class_index = readU30(pc); + AbstractFunction *cinit = pool->cinits[class_index]; + ClassClosure* base = (ClassClosure*)(~7&toplevel->coerce(sp[0], CLASS_TYPE)); + sp[0] = env->newclass(cinit, base, scope, scopeBase)->atom(); + } + continue; + + case OP_callstatic: + { + // stack in: receiver, arg1..N + // stack out: result + int method_id = readU30(pc); + argc = readU30(pc); + env->nullcheck(sp[-argc]); + // ISSUE if arg types were checked in verifier, this coerces again. + MethodEnv* f = env->vtable->abcEnv->methods[method_id]; + tempAtom = f->coerceEnter(argc, sp-argc); + *(sp -= argc) = tempAtom; + } + continue; + + case OP_callmethod: + { + // stack in: receiver, arg1..N + // stack out: result + uint32 disp_id = readU30(pc)-1; + argc = readU30(pc); + // null check included in env->callmethod + //tempAtom = env->callmethod(disp_id, argc, sp-argc); + Atom* atomv = sp-argc; + + // must be a real class instance for this to be used. primitives that have + // methods will only have final bindings and no dispatch table. + VTable* vtable = toplevel->toVTable(atomv[0]); // includes null check + AvmAssert(disp_id < vtable->traits->methodCount); + MethodEnv *f = vtable->methods[disp_id]; + // ISSUE if arg types were checked in verifier, this coerces again. + tempAtom = f->coerceEnter(argc, atomv); + + *(sp -= argc) = tempAtom; + } + continue; + + case OP_callproperty: + case OP_callpropvoid: + case OP_callproplex: + { + // stack in: obj [ns [name]] arg1..N + // stack out: result + Multiname multiname; + pool->parseMultiname(multiname, readU30(pc)); + argc = readU30(pc); + if (!multiname.isRuntime()) + { + // np check in toVTable + Atom base = sp[-argc]; + if (opcode == OP_callproplex) + sp[-argc] = nullObjectAtom; + tempAtom = toplevel->callproperty(base, &multiname, argc, sp-argc, toplevel->toVTable(base)); + *(sp -= argc) = tempAtom; + } + else + { + Atom* atomv = sp-argc; + sp = initMultiname(env, multiname, sp-argc); + Atom base = *sp; + atomv[0] = opcode == OP_callproplex ? nullObjectAtom : base; + *sp = toplevel->callproperty(base, &multiname, argc, atomv, toplevel->toVTable(base)); + } + if (opcode == OP_callpropvoid) + { + sp--; + } + } + continue; + + case OP_constructprop: + { + // stack in: obj [ns [name]] arg1..N + // stack out: result + Multiname name; + pool->parseMultiname(name, readU30(pc)); + argc = readU30(pc); + if (!name.isRuntime()) + { + // np check in toVTable + tempAtom = toplevel->constructprop(&name, argc, sp-argc, toplevel->toVTable(sp[-argc])); + *(sp -= argc) = tempAtom; + } + else + { + Atom* atomv = sp-argc; + sp = initMultiname(env, name, sp-argc); + atomv[0] = *sp; + *sp = toplevel->constructprop(&name, argc, atomv, toplevel->toVTable(atomv[0])); + } + } + continue; + + case OP_callsuper: + case OP_callsupervoid: + { + // stack in: obj [ns [name]] arg1..N + Multiname name; + pool->parseMultiname(name, readU30(pc)); + argc = readU30(pc); + + if (!name.isRuntime()) + { + env->nullcheck(sp[-argc]); // null check + tempAtom = env->callsuper(&name, argc, sp-argc); + *(sp -= argc) = tempAtom; + } + else + { + Atom* atomv = sp-argc; + sp = initMultiname(env, name, sp-argc); + atomv[0] = *sp; + env->nullcheck(atomv[0]); + *sp = env->callsuper(&name, argc, atomv); + } + if (opcode == OP_callsupervoid) + { + sp--; + } + } + continue; + + case OP_getsuper: + { + Multiname name; + pool->parseMultiname(name, readU30(pc)); + if (!name.isRuntime()) + { + Atom objAtom = *sp; + env->nullcheck(objAtom);//null check + *sp = env->getsuper(objAtom, &name); + } + else + { + sp = initMultiname(env, name, sp); + Atom objAtom = *sp; + env->nullcheck(objAtom);//null check + *sp = env->getsuper(objAtom, &name); + } + continue; + } + + case OP_setsuper: + { + int index = readU30(pc); + Multiname name; + pool->parseMultiname(name, index); + Atom valueAtom = *(sp--); + if (!name.isRuntime()) + { + Atom objAtom = *(sp--); + env->nullcheck(objAtom); + env->setsuper(objAtom, &name, valueAtom); + } + else + { + sp = initMultiname(env, name, sp); + Atom objAtom = *(sp--); + env->nullcheck(objAtom); + env->setsuper(objAtom, &name, valueAtom); + } + continue; + } + + // obj arg1 arg2 + // sp + case OP_constructsuper: + { + // stack in: obj arg1..N + // stack out: + argc = readU30(pc); + env->nullcheck(sp[-argc]); + env->vtable->base->init->coerceEnter(argc, sp-argc); + sp -= argc+1; + continue; + } + + case OP_pushshort: + // this just pushes an integer since we dont have short atoms + *(++sp) = ((signed short)readU30(pc))<<3|kIntegerType; + continue; + + case OP_astype: + { + Multiname multiname; + pool->parseMultiname(multiname, readU30(pc)); + sp[0] = env->astype(sp[0], pool->getTraits(&multiname, toplevel)); + break; + } + + case OP_astypelate: + { + sp--; + sp[0] = env->astype(sp[0], env->toClassITraits(sp[1])); + continue; + } + + case OP_coerce: + { + // expects a CONSTANT_Multiname cpool index + // this is the ES4 implicit coersion + Multiname multiname; + pool->parseMultiname(multiname, readU30(pc)); + sp[0] = toplevel->coerce(sp[0], pool->getTraits(&multiname, toplevel)); + continue; + } + + case OP_coerce_a: + // no-op since interpreter only uses atoms + continue; + + case OP_coerce_o: + if (sp[0] == undefinedAtom) + sp[0] = nullObjectAtom; + continue; + + case OP_coerce_s: + sp[0] = AvmCore::isNullOrUndefined(sp[0]) ? nullStringAtom : core->string(sp[0])->atom(); + continue; + + case OP_istype: + { + // expects a CONSTANT_Multiname cpool index + // used when operator "is" RHS is a compile-time type constant + Multiname multiname; + pool->parseMultiname(multiname, readU30(pc)); + Traits* itraits = pool->getTraits(&multiname, toplevel); + sp[0] = core->istypeAtom(sp[0], itraits); + continue; + } + + case OP_istypelate: + { + sp--; + sp[0] = core->istypeAtom(sp[0], env->toClassITraits(sp[1])); + continue; + } + + case OP_pushbyte: + sp++; + sp[0] = ((sint8)*pc++)<<3|kIntegerType; + continue; + + case OP_getscopeobject: + { + int scope_index = *pc++; + sp++; + sp[0] = scopeBase[scope_index]; + continue; + } + + case OP_getglobalscope: + { + sp++; + if (outer_depth > 0) + { + sp[0] = scope->getScope(0); + } + else + { + sp[0] = scopeBase[0]; + } + continue; + } + + case OP_pushscope: + { + sp--; + Atom s = sp[1]; + env->nullcheck(s); + scopeBase[scopeDepth++] = s; + continue; + } + + case OP_pushwith: + { + sp--; + Atom s = sp[1]; + env->nullcheck(s); + if (!withBase) + { + withBase = scopeBase+scopeDepth; + } + scopeBase[scopeDepth++] = s; + continue; + } + + case OP_newactivation: + { + sp++; + sp[0] = core->newActivation(env->getActivation(), NULL)->atom(); + continue; + } + + case OP_newcatch: + { + int catch_index = readU30(pc); + Traits *t = info->exceptions->exceptions[catch_index].scopeTraits; + sp++; + sp[0] = env->newcatch(t)->atom(); + continue; + } + + case OP_popscope: + scopeDepth--; + if (withBase >= scopeBase+scopeDepth) + { + withBase = NULL; + } + continue; + + case OP_coerce_i: + case OP_convert_i: + sp[0] = core->intAtom(sp[0]); + continue; + + case OP_coerce_u: + case OP_convert_u: + sp[0] = core->uintAtom(sp[0]); + continue; + + case OP_throw: + core->throwAtom(*sp--); + continue; + + case OP_instanceof: + sp--; + sp[0] = toplevel->instanceof(sp[0], sp[1]); + continue; + + case OP_in: + sp--; + sp[0] = env->in(sp[0], sp[1]); + continue; + + case OP_dxns: + dxns = core->newPublicNamespace(cpool_string[readU30(pc)]); + continue; + + case OP_dxnslate: + dxns = core->newPublicNamespace(core->intern(*sp)); + sp--; + break; + + case OP_abs_jump: + if (interruptable && core->interrupted) + env->interrupt(); + code_start = pc = (const byte*) AvmCore::readU30(pc); + break; + + default: + AvmAssert(false); + } + + if(info->setsDxns()) { + core->dxnsAddr = dxnsAddrSave; + } + + } + + + } + + CATCH (Exception *exception) + { + if(info->setsDxns()) { + core->dxnsAddr = dxnsAddrSave; + } + // find handler; rethrow if no handler. + ExceptionHandler *handler = core->findExceptionHandler(info, expc, exception); + // handler found in current method + pc = code_start + handler->target; + scopeDepth = initialScopeDepth; // ISSUE with() { try {} } + sp = scopeBase + max_scope - 1; + *(++sp) = exception->atom; + goto MainLoop; + } + END_CATCH + END_TRY + + // + // we never get here. verifier doesn't allow code to fall off end. + // + } + + Atom* Interpreter::initMultiname(MethodEnv* env, Multiname &name, Atom* sp, bool isDelete/*=false*/) + { + if (name.isRtname()) + { + Atom index = *(sp--); + AvmCore* core = env->core(); + + if (isDelete) + { + if (core->isXMLList(index)) + { + // Error according to E4X spec, section 11.3.1 + env->toplevel()->throwTypeError(kDeleteTypeError, core->toErrorString(env->toplevel()->toTraits(index))); + } + } + + // is it a qname? + if (AvmCore::isObject(index)) + { + ScriptObject* i = AvmCore::atomToScriptObject(index); + if (i->traits() == core->traits.qName_itraits) + { + QNameObject* qname = (QNameObject*) i; + bool attr = name.isAttr(); + qname->getMultiname(name); + if (attr) + name.setAttr(attr); + + // Discard runtime namespace if present + if (name.isRtns()) + sp--; + + return sp; + } + } + + name.setName(core->intern(index)); + } + + if (name.isRtns()) + name.setNamespace(env->internRtns(*(sp--))); + + return sp; + } + +#ifdef AVMPLUS_VERBOSE + /** + * display contents of current stack frame only. + */ + void Interpreter::showState(MethodInfo* info, AbcOpcode opcode, int off, + Atom* framep, int sp, int scopep, int scopeBase, int stackBase, + const byte *code_start) + { + PoolObject* pool = info->pool; + AvmCore* core = pool->core; + const byte* pc = code_start + off; + + // stack + core->console << " stack:"; + for (int i=stackBase; i <= sp; i++) { + core->console << " " << framep[i]; + } + core->console << '\n'; + + // scope chain + core->console << " scope: "; + for (int i=scopeBase; i <= scopep; i++) { + core->console << framep[i] << " "; + } + core->console << '\n'; + + // locals + core->console << " locals: "; + for (int i=0; i < scopeBase; i++) { + core->console << framep[i] << " "; + } + core->console << '\n'; + + // opcode + core->console << " "; +#ifdef DEBUGGER + if (core->debugger && core->callStack && core->callStack->filename) + { + core->console << '[' << core->callStack->filename << ':' << (uint32)core->callStack->linenum << "] "; + } +#endif + core->console << off << ':'; + AvmCore::formatOpcode(core->console, pc, opcode, off, pool); + core->console << '\n'; + } +#endif +} +#endif /* AVMPLUS_INTERP */ diff --git a/mozilla/js/tamarin/core/Interpreter.h b/mozilla/js/tamarin/core/Interpreter.h new file mode 100644 index 00000000000..1c0c6623258 --- /dev/null +++ b/mozilla/js/tamarin/core/Interpreter.h @@ -0,0 +1,85 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_Interpreter__ +#define __avmplus_Interpreter__ + + +#ifdef AVMPLUS_INTERP +namespace avmplus +{ + class Interpreter + { + public: + /** + * interp32/N() is the main loop of the AVM+ interpreter. + * + * The native code compiler CodegenMIR is used by default + * for executing AVM+ bytecode, since it is faster by + * nature, but the AVM+ interpreter is used in some cases: + * + * - It is used to execute AVM+ code when the turbo flag is + * set to false (-Dinterp in command-line shell) + * - It is also used when a debug session is in progress. + * - It is used when the target platform does not support + * the native code compiler. + * + * @param methodEnv The method to execute. + * @param argc number of args + * @param ap arg list + * @return The return value of the method that was executed. + * @throws Exception if the method throws an exception. + */ + static int interp32(MethodEnv* method, int argc, va_list ap); + static double interpN(MethodEnv* method, int argc, va_list ap); + + private: + static Atom interp(MethodEnv* method, int argc, va_list ap); + static Atom* initMultiname(MethodEnv* env, Multiname &name, Atom* sp, bool isDelete=false); + + static int readS24(const byte *pc) { return AvmCore::readS24(pc); } + static int readU16(const byte *pc) { return AvmCore::readU16(pc); } + static int readU30(const byte *&pc) { return AvmCore::readU30(pc); } + +#ifdef AVMPLUS_VERBOSE + + /** + * display contents of current stack frame only. + */ + static void showState(MethodInfo* info, AbcOpcode opcode, int off, + Atom* framep, int sp, int scopep, int scopeBase, int stackBase, + const byte *code_start); +#endif + }; +} +#endif /* AVMPLUS_INTERP */ + +#endif // __avmplus_Interpreter__ diff --git a/mozilla/js/tamarin/core/Math.as b/mozilla/js/tamarin/core/Math.as new file mode 100644 index 00000000000..e4e4376f823 --- /dev/null +++ b/mozilla/js/tamarin/core/Math.as @@ -0,0 +1,78 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +package +{ + + +public final class Math +{ + // the value properties of math are {DontEnum,DontDelete,ReadOnly} + public static const E :Number = 2.718281828459045 + public static const LN10 :Number = 2.302585092994046 + public static const LN2 :Number = 0.6931471805599453 + public static const LOG10E :Number = 0.4342944819032518 + public static const LOG2E :Number = 1.442695040888963387 + public static const PI :Number = 3.141592653589793 + public static const SQRT1_2 :Number = 0.7071067811865476 + public static const SQRT2 :Number = 1.4142135623730951 + + // min and max with 2 args are so common we overload these + native private static function _min (x:Number, y:Number):Number + native private static function _max (x:Number, y:Number):Number + + // wrappers for the above math methods. these do automatic + // conversion of their arguments. + + public native static function abs (x:Number) :Number + public native static function acos (x:Number) :Number + public native static function asin (x:Number) :Number + public native static function atan (x:Number) :Number + public native static function ceil (x:Number) :Number + public native static function cos (x:Number) :Number + public native static function exp (x:Number) :Number + public native static function floor (x:Number) :Number + public native static function log (x:Number) :Number + public native static function round (x:Number) :Number + public native static function sin (x:Number) :Number + public native static function sqrt (x:Number) :Number + public native static function tan (x:Number) :Number + + public native static function atan2 (x:Number, y:Number):Number + public native static function pow (x:Number, y:Number):Number + + public native static function max (x:Number = void 0, y:Number = void 0, ... rest):Number + public native static function min (x:Number = void 0, y:Number = void 0, ... rest):Number + + public native static function random ():Number +} + +} diff --git a/mozilla/js/tamarin/core/MathClass.cpp b/mozilla/js/tamarin/core/MathClass.cpp new file mode 100644 index 00000000000..c6285f93ec9 --- /dev/null +++ b/mozilla/js/tamarin/core/MathClass.cpp @@ -0,0 +1,212 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmplus.h" + +namespace avmplus +{ + BEGIN_NATIVE_MAP(MathClass) + NATIVE_METHOD_FLAGS(Math_abs, MathClass::abs, 0) + NATIVE_METHOD_FLAGS(Math_acos, MathClass::acos, 0) + NATIVE_METHOD_FLAGS(Math_asin, MathClass::asin, 0) + NATIVE_METHOD_FLAGS(Math_atan, MathClass::atan, 0) + NATIVE_METHOD_FLAGS(Math_atan2, MathClass::atan2, 0) + NATIVE_METHOD_FLAGS(Math_ceil, MathClass::ceil, 0) + NATIVE_METHOD_FLAGS(Math_cos, MathClass::cos, 0) + NATIVE_METHOD_FLAGS(Math_exp, MathClass::exp, 0) + NATIVE_METHOD_FLAGS(Math_floor, MathClass::floor, 0) + NATIVE_METHOD_FLAGS(Math_log, MathClass::log, 0) + NATIVE_METHOD_FLAGS(Math_pow, MathClass::pow, 0) + NATIVE_METHOD_FLAGS(Math_round, MathClass::round, 0) + NATIVE_METHOD_FLAGS(Math_sin, MathClass::sin, 0) + NATIVE_METHOD_FLAGS(Math_sqrt, MathClass::sqrt, 0) + NATIVE_METHOD_FLAGS(Math_tan, MathClass::tan, 0) + NATIVE_METHOD_FLAGS(Math_private__min, MathClass::min2, 0) + NATIVE_METHOD_FLAGS(Math_private__max, MathClass::max2, 0) + NATIVE_METHODV(Math_max, MathClass::max) + NATIVE_METHODV(Math_min, MathClass::min) + NATIVE_METHOD_FLAGS(Math_random, MathClass::random, 0) + END_NATIVE_MAP() + + Atom MathClass::construct(int /*argc*/, Atom* /*argv*/) + { + // according to ES3 15.8, Math cannot be used as a function or constructor. + toplevel()->throwTypeError(kMathNotConstructorError); + return 0; + } + + Atom MathClass::call(int /*argc*/, Atom* /*argv*/) + { + // according to ES3 15.8, Math cannot be used as a function or constructor. + toplevel()->throwTypeError(kMathNotFunctionError); + return 0; + } + + MathClass::MathClass(VTable* cvtable) + : ClassClosure(cvtable) + { + AvmAssert(traits()->sizeofInstance == sizeof(MathClass)); + MathUtils::initRandom(&seed); + + // todo does ES4 Math have a prototype object? + } + + // + // ISSUE. ES3 15.8.2 says all these functions call ToNumber on its argument. + // this is more forgiving than declaring the args to be Number. We either + // have to declare these Object and to ToNumber internally, or add some special + // type support so compiler will have ToNumber. + // + // for E3 compatibility all args should be optional=NaN and rest args ignored, + // except for min, max where rest args are processed. + // + + double MathClass::abs(double x) + { + return MathUtils::abs(x); + } + + double MathClass::acos(double x) + { + return MathUtils::acos(x); + } + + double MathClass::asin(double x) + { + return MathUtils::asin(x); + } + + double MathClass::atan(double x) + { + return MathUtils::atan(x); + } + + double MathClass::atan2(double x, double y) + { + return MathUtils::atan2(x, y); + } + + double MathClass::ceil(double x) + { + return MathUtils::ceil(x); + } + + double MathClass::cos(double x) + { + return MathUtils::cos(x); + } + + double MathClass::exp(double x) + { + return MathUtils::exp(x); + } + + double MathClass::floor(double x) + { + return MathUtils::floor(x); + } + + double MathClass::log(double x) + { + return MathUtils::log(x); + } + + double MathClass::min(Atom* argv, int argc) + { + double x = MathUtils::infinity(); + AvmCore* core = this->core(); + for (int i=0; i < argc; i++) + { + double y = core->number(argv[i]); + if (y < x) + x = y; + else if (MathUtils::isNaN(y)) + return y; + } + return x; + } + + double MathClass::max(Atom* argv, int argc) + { + double x = -MathUtils::infinity(); + AvmCore* core = this->core(); + for (int i=0; i < argc; i++) + { + double y = core->number(argv[i]); + if (y > x) + x = y; + else if (MathUtils::isNaN(y)) + return y; + } + return x; + } + + double MathClass::pow(double x, double y) + { + return MathUtils::pow(x, y); + } + + double MathClass::random() + { + return MathUtils::random(&seed); + } + + double MathClass::round(double x) + { + return MathUtils::round(x); + } + + double MathClass::sin(double x) + { + return MathUtils::sin(x); + } + + double MathClass::sqrt(double x) + { + return MathUtils::sqrt(x); + } + + double MathClass::tan(double x) + { + return MathUtils::tan(x); + } + + double MathClass::min2(double x, double y) + { + return (x < y || MathUtils::isNaN(x)) ? x : y; + } + + double MathClass::max2(double x, double y) + { + return (x > y || MathUtils::isNaN(x)) ? x : y; + } +} diff --git a/mozilla/js/tamarin/core/MathClass.h b/mozilla/js/tamarin/core/MathClass.h new file mode 100644 index 00000000000..2f76667dd00 --- /dev/null +++ b/mozilla/js/tamarin/core/MathClass.h @@ -0,0 +1,93 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_MathClass__ +#define __avmplus_MathClass__ + + +namespace avmplus +{ + /** + * class Math + */ + class MathClass : public ClassClosure + { + public: + MathClass(VTable* cvtable); + ~MathClass() + { + seed.uValue = 0; + seed.uXorMask = 0; + seed.uSequenceLength = 0; + } + + // this = argv[0] (ignored) + // arg1 = argv[1] + // argN = argv[argc] + Atom construct(int argc, Atom* argv); + + // this = argv[0] + // arg1 = argv[1] + // argN = argv[argc] + Atom call(int argc, Atom* argv); + + double abs(double x); + double acos(double x); + double asin(double x); + double atan(double x); + double atan2(double x, double y); + double ceil(double x); + double cos(double x); + double exp(double x); + double floor(double x); + double log(double x); + double pow(double x, double y); + double random(); + double round(double x); + double sin(double x); + double sqrt(double x); + double tan(double x); + double min2(double x, double y); + double max2(double x, double y); + + // cn: max/min declared as NATIVE_METHODV so we can implement ES3 spec'd length property of 2 + // and still allow any number of arguments. + double max(Atom* argv, int argc); + double min(Atom* argv, int argc); + + DECLARE_NATIVE_MAP(MathClass) + + private: + TRandomFast seed; + }; +} + +#endif /* __avmplus_MathClass__ */ diff --git a/mozilla/js/tamarin/core/MathUtils.cpp b/mozilla/js/tamarin/core/MathUtils.cpp new file mode 100644 index 00000000000..23a02340057 --- /dev/null +++ b/mozilla/js/tamarin/core/MathUtils.cpp @@ -0,0 +1,1967 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#include + +#include "avmplus.h" +#include "BigInteger.h" +namespace avmplus +{ + const double kLog2_10 = 0.30102999566398119521373889472449; + + // optimize pow(10,x) for commonly sized numbers; + static double kPowersOfTen[23] = { 1, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, + 1e11, 1e12, 1e13, 1e14, 1e15, 1e16, 1e17, 1e18, 1e19, 1e20, + 1e21, 1e22 }; + + static inline double quickPowTen(int exp) + { + if (exp < 23 && exp > 0) { + return kPowersOfTen[exp]; + } else { + return MathUtils::pow(10,exp); + } + } + + + bool MathUtils::equals(double x, double y) + { + // Infiniti-ness must match up + if (isInfinite(x) != isInfinite(y)) { + return false; + } + // Nothing is equal to NaN, not even itself. + if (isNaN(x) || isNaN(y)) { + return false; + } + return x == y; + } + + double MathUtils::infinity() + { + float result; + *((uint32*)&result) = 0x7F800000; + return result; + } + +#if 0 + /* + * MathUtils::isNaN and MathUtils::isInfinite are modified versions of + * s_isNaN.c and s_isInfinite.c, freely usable code by Sun. Copyright follows: + *====================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify and distribute this + * software is freely granted, provided that this notice is preserved. + *====================================================== + */ + + int MathUtils::isInfinite(double x) + { + union { + double value; + struct { +#ifdef AVM10_BIG_ENDIAN + uint32 msw, lsw; +#else + uint32 lsw, msw; +#endif + } parts; + } u; + u.value = x; + + int hx = u.parts.msw; + int lx = u.parts.lsw; + + lx |= (hx & 0x7FFFFFFF) ^ 0x7FF00000; + lx |= -lx; + return ~(lx >> 31) & (hx >> 30); + } + + bool MathUtils::isNaN(double x) + { + // Infinity is NOT considered NaN in + // JavaScript + if (MathUtils::isInfinite(x) != 0) { + return false; + } + + union { + double value; + struct { +#ifdef AVM10_BIG_ENDIAN + uint32 msw, lsw; +#else + uint32 lsw, msw; +#endif + } parts; + } u; + u.value = x; + + int hx = u.parts.msw; + int lx = u.parts.lsw; + + hx &= 0x7FFFFFFF; + hx |= (uint32) (lx | (-lx)) >> 31; + hx = 0x7FF00000 - hx; + return (bool) (((uint32)(hx) >> 31) != 0); + } +#else + + /* + * double precision special value tests: + + inf = 7FF0 0000 0000 0000 + FFF0 0000 0000 0000 + + nan = 7FFx xxxx xxxx xxxx where x != 0 + FFFx xxxx xxxx xxxx + */ + + int MathUtils::isInfinite(double x) + { + uint64 v = *((uint64 *)&x); + if ((v & 0x7fffffffffffffffLL) != 0x7FF0000000000000LL) + return 0; + if (v & 0x8000000000000000LL) + return -1; + else + return 1; + } + + #if 0 + bool MathUtils::isNaN(double x) + { + return x != x; + uint64 v = *((uint64 *)&x); + return ((v & 0x7ff0000000000000LL) == 0x7ff0000000000000LL && // is a special value + (v & 0x000fffffffffffffLL) != 0x0000000000000000LL); // not inf + } + #endif + + bool MathUtils::isNegZero(double x) + { + uint64 v = *((uint64 *)&x); + return (v == 0x8000000000000000LL); + } + +#endif + + double MathUtils::nan() + { +#ifdef AVM10_BIG_ENDIAN + unsigned long nan[2]={0x7fffffff, 0xffffffff}; +#else + unsigned long nan[2]= {0xffffffff, 0x7fffffff}; +#endif + double g = *(double*)nan; + return g; + } + + int MathUtils::nextPowerOfTwo(int n) + { + int i = 2; + while (i < n) + { + i <<= 1; + } + + return (i); + } + + bool MathUtils::isHexNumber(const wchar *str) + { + bool dummy; + str = handleSign(str, dummy); + return (*str == '0' && *(str+1) == 'x') || (*str == '0' && *(str+1) == 'X'); + } + + // parseIntDigit: Helper for ParseInt and ConvertStringToInteger + // + + int MathUtils::parseIntDigit(wchar ch) + { + if (ch >= '0' && ch <= '9') { + return (ch - '0'); + } else if (ch >= 'a' && ch <= 'z') { + return (ch - 'a' + 10); + } else if (ch >= 'A' && ch <= 'Z') { + return (ch - 'A' + 10); + } else { + return -1; + } + } + + // parseInt: Implementation of ECMA-262 parseInt function + double MathUtils::parseInt(const wchar* s, int len, int radix /*=10*/, bool strict /*=false*/ ) + { + bool negate; + bool gotDigits = false; + double result = 0; + + s = skipSpaces(s); // leading and trailing whitespace is valid. + s = handleSign(s,negate); + if (MathUtils::isHexNumber(s) && (radix == 16 || radix == 0) ) { + s += 2; + len -=2; + if (radix == 0) + radix = 16; + } else if (radix == 0) { + // default radix is 10 + radix = 10; + } + + // Make sure radix is valid, and we have digits + if (radix >= 2 && radix <= 36 && *s) { + result = 0; + const wchar* sStart = s; + + // Read the digits, generate result + while (*s) { + int v = parseIntDigit(*s); + if (v == -1 || v >= radix) { + break; + } + result = result * radix + v; + gotDigits = true; + s++; + } + + s = skipSpaces(s); // leading and trailing whitespace is valid. + if (strict && *s) { + return MathUtils::nan(); + } + + if ( result >= 0x20000000000000LL && // i.e. if the result may need at least 54 bits of mantissa + (radix == 2 || radix == 4 || radix == 8 || radix == 16 || radix == 32) ) { + + // CN: we're here because we may have incurred roundoff error with the above. + // Error will creep in once we need more than the available 53 bits + // of precision in the mantissa portion of a double. No way to deduce + // this from the result, so we have to recalculate it more slowly. + result = 0; + + int powOf2 = 1; + for(int x = radix; (x != 1); x >>= 1) + powOf2++; + powOf2--; // each word contains one less than this # of bits. + s = sStart; + int v=0; + + int end,next; + // skip leading zeros + for(end=0; s[end] == '0'; end++) + ; + + for (next=0; next*powOf2 <= 52; next++) { // read first 52 non-zero digits. Once charPosition*log2(radix) is > 53, we can have rounding issues + v = parseIntDigit(s[end++]); + if (v == -1 || v >= radix) { + v = 0; + break; + } + result = result * radix + v; + } + if (next*powOf2 > 52) { // If number contains more than 53 bits of precision, may need to roundUp last digit processed. + bool roundUp = false; + int bit53 = 0; + int bit54 = 0; + + double factor = 1; + + switch(radix) { + case 32: // last word read contained digits 51,52,53,54,55 + bit53 = v & (1 << 2); + bit54 = v & (1 << 1); + roundUp = (v & 1); + break; + case 16: // last word read contained digits 50,51,52,53 + bit53 = v & (1 << 0); + v = parseIntDigit(s[end]); + if (v != -1 && v < radix) { + factor *= radix; + bit54 = v & (1 << 3); + roundUp = (v & 0x3) != 0; // check if any bit after bit54 is set + } else { + roundUp = bit53 != 0; + } + break; + case 8: // last work read contained digits 49,50,51, next word contains 52,53,54 + v = parseIntDigit(s[end]); + if (v == -1 || v >= radix) { + v = 0; + } + factor *= radix; + bit53 = v & (1 << 1); + bit54 = v & (1 << 0); + break; + case 4: // 51,52 - 53,54 + v = parseIntDigit(s[end]); + if (v == -1 || v >= radix) { + v = 0; + } + factor *= radix; + bit53 = v & (1 << 1); + bit54 = v & (1 << 0); + break; + case 2: // 52 - 53 - 54 + /* + v = parseIntDigit(s[end++]); + result = result * radix; // add factor before round-off adjustment for 52 bit + */ + bit53 = v & (1 << 0); + v = parseIntDigit(s[end]); + if (v != -1 && v < radix) { + factor *= radix; + bit54 = (v != -1 ? (v & (1 << 0)) : 0); // Might be there are only 53 digits. + } + + break; + } + + bit53 = !!bit53; + bit54 = !!bit54; + + + while(++end < len) { + v = parseIntDigit(s[end]); + if (v == -1 || v >= radix) { + break; + } + roundUp |= (v != 0); // any trailing positive bit causes us to round up + factor *= radix; + } + roundUp = bit54 && (bit53 || roundUp); + result += (roundUp ? 1.0 : 0.0); + result *= factor; + } + + } + /* + else if (radix == 10 && result >= 0x20000000000000) + // if there are more than 15 digits, roundoff error may affect us. Need to use exact integer rep instead of float + //int numDigits = len - (s - sStart); + */ + if (negate) { + result = -result; + } + } + return gotDigits ? result : MathUtils::nan(); + } + + // used by AvmCore::number() and numberAtom() for converting arbitrary string to a number. + double MathUtils::convertStringToNumber(const wchar* ptr, int strlen) + { + double value; + + if (*ptr == 0) { // toNumber("") should be 0, not NaN + value = 0; + } else if (MathUtils::convertStringToDouble(ptr, strlen, &value, true)) { + // nothing to do, value set by side effect. + } else { + value = MathUtils::parseInt(ptr, strlen, 0,true); // 0 radix means figure it out from the string. + } + return value; + } + + double MathUtils::round(double value) + { + return MathUtils::floor(value + 0.5); + } + + // MathUtils::toInt is the ToInteger algorithm from + // ECMA-262 section 9.4 + double MathUtils::toInt(double value) + { +#ifdef WIN32 + int intValue; + _asm fld [value]; + _asm fistp [intValue]; +#elif defined(_MAC) && TARGET_CPU_X86 + int intValue = _mm_cvttsd_si32(_mm_set_sd(value)); +#else + int intValue = real2int(value); +#endif + if ((value == (double)(intValue)) && ((uint32)intValue != 0x80000000)) + return value; + + if (MathUtils::isNaN(value)) { + return 0; + } + if (MathUtils::isInfinite(value) || value == 0) { + return value; + } + if (value < 0) { + return -MathUtils::floor(-value); + } else { + return MathUtils::floor(value); + } + } + + // skipSpaces: skip whitespace characters + + wchar* MathUtils::skipSpaces(const wchar *s) + { + while (*s == ' ' || *s == '\t' || *s == '\r' || *s == '\n' || *s == '\f' || *s == '\v' || + (*s >= 0x2000 && *s <=0x200b) || *s == 0x2028 || *s == 0x2029 || *s == 0x205f || *s == 0x3000 ) { + s++; + } + return const_cast< wchar* >( s ); // we're constant but not necessarily our caller. + } + + // handleSign: helper function which checks for sign indicator + // + + wchar* MathUtils::handleSign(const wchar *s, bool& negative) + { + negative = false; + if (*s == '+') { + s++; + } else if (*s == '-') { + negative = true; + s++; + } + return const_cast< wchar* >( s ); // we're constant but not necessarily our caller. + } + + // + // powerOfTen(exponent, value) returns the value + // value * 10 ^ exponent + // + + double MathUtils::powerOfTen(int exponent, double value) + { + double base = 10.0; + + if (exponent < 0) { + exponent = -exponent; + while (exponent) { + if (exponent & 1) { + value /= base; + } + exponent >>= 1; + base *= base; + } + } else { + while (exponent) { + if (exponent & 1) { + value *= base; + } + exponent >>= 1; + base *= base; + } + } + return value; + } + + // + // powInt(base, exponent) returns the value + // base ^ exponent + // where exponent is an integer. + // + static double powInt(double base, int exponent) + { + double value = 1.0; + double original_base = base; + int original_exponent = exponent; + + if (exponent < 0) { + exponent = -exponent; + while (exponent) { + if (exponent & 1) { + value /= base; + // cn: max double value is magnitude 1e308 (base 10), but min double value is magnitude 1e-324 + // That means we can't invert the exponent when the base ten value exponent is < 307. + // We could first check if powerOfTwo(base)*exp > 1074, but that would + // slow down all powInts calls. This limits the xtra work to just very small numbers. + if (value == 0 && base != 0) // double check by calling the real thing + return MathUtils::powInternal(original_base,(double)original_exponent); + } + exponent >>= 1; + base *= base; + } + } else { + while (exponent) { + if (exponent & 1) { + value *= base; + } + exponent >>= 1; + base *= base; + } + } + return value; + } + + // x = base, y = exponent + double MathUtils::pow(double x, double y) + { + if (MathUtils::isNaN(y)) { + // x^NaN = NaN + return MathUtils::nan(); + } + + if (y == 0) { + // x^0 is 1 for all x + return 1; + } + + int infy = MathUtils::isInfinite(y); + + if (infy == 0 && y == (int)y) { + // If y is an integer, use multiplication + // algorithm which yields more accurate + // results + return powInt(x, (int)y); + } + + double absx = MathUtils::abs(x); + + if (absx < 1) { + infy = -infy; + } + if (absx == 1 && infy != 0) { + // (+/-)1^(+/-)Infinity = NaN + return MathUtils::nan(); + } + if (infy == 1) { + // x^Infinity = Infinity + return MathUtils::infinity(); + } else if (infy == -1) { + // x^-Infinity = +0 + return +0; + } + + if (MathUtils::isInfinite(x)) + { + if (y < 0) { + // y<0 + // Infinity^y = 0 + // -Infinity^y = 0 + return 0; + } else { + if (y < 1.0) { + return MathUtils::infinity(); + } else { + // y>0 + // Infinity^y = Infinity + // -Infinity^y = Infinity + return x; + } + } + } + + // R41 + // Handle negative x. + if (x < 0.0) { + // If y is non-integer, return NaN. + if (y != MathUtils::floor(y)) { + return MathUtils::nan(); + } + // Switch sign of base + x = -x; + // If exponent is odd, negate result + if (MathUtils::mod(y, 2) != 0) { + return -powInternal(x, y); + } + // Else do the usual thing. + } + // end R41 + + // Bug 33811 - Windows math returns NaN incorrectly when base = 0.0 + if (x == 0.0) + { + if (y < 0.0) + return MathUtils::infinity(); + else + return 0.0; + } + + return powInternal(x, y); + } + + // convertDoubleToString: Converts a double-precision floating-point number + // to its ASCII representation + // + + int MathUtils::nextDigit(double *value) + { + int digit; + #ifdef WIN32 + // WARNING! nextDigit assumes that rounding mode is + // set to truncate. + _asm mov eax,[value]; + _asm fld qword ptr [eax]; + _asm fistp [digit]; + #elif defined(_MAC) && TARGET_CPU_X86 + digit = _mm_cvttsd_si32(_mm_set_sd(*value)); + #else + digit = (int) *value; + #endif + *value -= digit; + *value *= 10; + return digit; + } + + int MathUtils::roundInt(double x) + { + if (x < 0) { + return (int) (x - 0.5); + } else { + return (int) (x + 0.5); + } + } + + bool MathUtils::convertIntegerToString(int value, + wchar *buffer, + int& len, + int radix /*=10*/, + bool valIsUnsigned /*=false*/) + { + // buffer should be at least wchar[40]. largest should be + // radix 2, with sign plus 31 bits. + + // This routines does not work with this integer number since negating + // this value returns the same negative value and screws up our code + // in the while loop below. + if ( (uint32)value == 0x80000000 && valIsUnsigned == false) // MathUtils::convertIntegerToString doesn't deal with this number because you can't negate it. + { + UnicodeUtils::Utf8ToUtf16((uint8*)"-2147483648", 12, buffer, 24); + len = 11; + return true; + } + + if (radix < 2 || radix > 36) + { + AvmAssert( 0 ); + return false; + } + + wchar tmp[40]; + const int size_buffer = sizeof(tmp)/sizeof(wchar); + wchar *src = tmp + size_buffer - 1; + wchar *srcEnd = src; + + *src-- = '\0'; + + if (value == 0) + { + *src-- = '0'; + } + else + { + uint32 uVal; + bool negative=false; + + if (valIsUnsigned) + { + uVal = (uint32)value; + } + else + { + negative = (value < 0); + if (negative) + value = -value; + uVal = (uint32)value; + } + + while (uVal != 0) + { + uint32 j = uVal; + uVal = uVal / radix; + j -= (uVal * radix); + + *src-- = (wchar)((j < 10) ? (j + '0') : (j + ('a' - 10))); + + AvmAssert(src > tmp); + } + + if (negative) + *src-- = '-'; + } + + len = srcEnd-src-1; + memcpy(buffer, src+1, (srcEnd-src)*sizeof(wchar)); + + AvmAssert(len==String::Length(buffer)); + return true; + } + + Stringp MathUtils::convertDoubleToStringRadix(AvmCore *core, + double value, + int radix) + { + if (radix < 2 || radix > 36) + { + AvmAssert( 0 ); + return NULL; + } + + wchar tmp[2048]; + const int size_buffer = sizeof(tmp)/sizeof(wchar); + wchar *src = tmp + size_buffer - 1; + wchar *srcEnd = src; + + *src-- = '\0'; + + bool negative=false; + + negative = (value < 0); + if (negative) + value = -value; + + if (value < 1) + { + *src-- = '0'; + } + else + { + double uVal = MathUtils::floor(value); + + while (uVal != 0) + { + double j = uVal; + uVal = MathUtils::floor(uVal / radix); + j -= (uVal * radix); + + *src-- = (wchar)((j < 10) ? ((int)j + '0') : ((int)j + ('a' - 10))); + + AvmAssert(src > tmp); + } + + if (negative) + *src-- = '-'; + } + + int len = srcEnd-src-1; + return new (core->GetGC()) String(src+1, len); + } + + void MathUtils::convertDoubleToString(double value, + wchar *buffer, + int& len, + int mode, + int precision) + { + switch (isInfinite(value)) { + case -1: + UnicodeUtils::Utf8ToUtf16((uint8*)"-Infinity", 10, buffer, 20); + len = 9; + return; + case 1: + UnicodeUtils::Utf8ToUtf16((uint8*)"Infinity", 9, buffer, 18); + len = 8; + return; + } + if (isNaN(value)) { + UnicodeUtils::Utf8ToUtf16((uint8*)"NaN", 4, buffer, 8); + len = 3; + return; + } + + // If our double is really an integer, call our integer version which + // is much, much faster then our double version. (Skips a ton of _ftol + // which are slow). + if (mode == DTOSTR_NORMAL) { +#ifdef WIN32 + int intValue; + _asm fld [value]; + _asm fistp [intValue]; +#elif defined(_MAC) && TARGET_CPU_X86 + int intValue = _mm_cvttsd_si32(_mm_set_sd(value)); +#else + int intValue = real2int(value); +#endif + if ((value == (double)(intValue)) && ((uint32)intValue != 0x80000000)) + { + convertIntegerToString(intValue, buffer, len); + return; + } + } + + int i; + + wchar *s = buffer; + + // Deal with negative numbers + if (value < 0) { + value = -value; + *s++ = '-'; + } + + // initialize d2a engine + D2A *d2a = new D2A(value, mode, precision); + int exp10 = d2a->expBase10()-1; + + // Sentinel is used for rounding + wchar *sentinel = s; + + enum { + kNormal, + kExponential, + kFraction, + kFixedFraction + }; + int format; + int digit; + + switch (mode) { + case DTOSTR_FIXED: + { + if (exp10 < 0) { + format = kFixedFraction; + } else { + format = kNormal; + precision++; + } + } + break; + case DTOSTR_PRECISION: + { + if (exp10 < 0) { + format = kFraction; + } else if (exp10 >= precision) { + format = kExponential; + } else { + format = kNormal; + } + } + break; + case DTOSTR_EXPONENTIAL: + format = kExponential; + precision++; + break; + default: + if (exp10 < 0 && exp10 > -7) { + // Number is of form 0.###### + if (exp10 < -precision) { + exp10 = -precision-1; + } + format = kFraction; + } else if (exp10 > 20) { // ECMA spec 9.8.1 + format = kExponential; + } else { + format = kNormal; + } + } + + #if 0 // ifdef WIN32 + // On Windows, set the FPU control word to round + // down for the rest of this operation. + volatile uint16 oldcw; + volatile uint16 newcw; + _asm fnstcw [oldcw]; + _asm mov ax,[oldcw]; + _asm or ax,0xc3f; + _asm mov [newcw],ax; + _asm fldcw [newcw]; + #endif + + bool wroteDecimal = false; + switch (format) { + case kNormal: + { + int digits = 0; + sentinel = s; + *s++ = '0'; + digit = d2a->nextDigit(); + if (digit > 0) { + *s++ = (char)(digit + '0'); + } + while (exp10 > 0) { + digit = (d2a->finished) ? 0 : d2a->nextDigit(); + *s++ = (char)(digit + '0'); + exp10--; + digits++; + } + if (mode == DTOSTR_FIXED) { + digits = 0; + } + if (mode == DTOSTR_NORMAL) { + if (!d2a->finished) { + *s++ = '.'; + wroteDecimal = true; + while( !d2a->finished ) { + *s++ = (char)(d2a->nextDigit() + '0'); + } + } + } + else if (digits < precision-1) + { + *s++ = '.'; + wroteDecimal = true; + for (; digits < precision-1; digits++) { + digit = d2a->finished ? 0 : d2a->nextDigit(); + *s++ = (char)(digit + '0'); + } + } + } + break; + case kFixedFraction: + { + *s++ = '0'; // Sentinel + *s++ = '0'; + *s++ = '.'; + wroteDecimal = true; + // Write out leading zeros + int digits = 0; + if (exp10 > 0) { + while (++exp10 < 10 && digits < precision) { + *s++ = '0'; + digits++; + } + } else if (exp10 < 0) { + while ((++exp10 < 0) && (precision-- > 0)) + *s++ = '0'; + } + + // Write out significand + for ( ; digitsfinished) + { + if (mode == DTOSTR_NORMAL) + break; + *s++ = '0'; + } else { + *s++ = (char)(d2a->nextDigit() + '0'); + } + } + exp10 = 0; + } + break; + case kFraction: + { + *s++ = '0'; // Sentinel + *s++ = '0'; + *s++ = '.'; + wroteDecimal = true; + + // Write out leading zeros + if (value) + { + for (i=exp10; i<-1; i++) { + *s++ = '0'; + } + } + + // Write out significand + i=0; + while (!d2a->finished) + { + *s++ = (char)(d2a->nextDigit() + '0'); + if (mode != DTOSTR_NORMAL && ++i >= precision) + break; + } + if (mode == DTOSTR_PRECISION) + { + while(i++ < precision) + *s++ = (char)(d2a->finished ? '0' : d2a->nextDigit() + '0'); + } + exp10 = 0; + } + break; + case kExponential: + { + digit = d2a->finished ? 0 : d2a->nextDigit(); + *s++ = (char)(digit + '0'); + if ( ((mode == DTOSTR_NORMAL) && !d2a->finished) || + ((mode != DTOSTR_NORMAL) && precision > 1) ) { + *s++ = '.'; + wroteDecimal = true; + for (i=0; ifinished) + { + if (mode == DTOSTR_NORMAL) + break; + *s++ = '0'; + } else { + *s++ = (char)(d2a->nextDigit() + '0'); + } + } + } + } + break; + } + + // Rounding (todo: argh, was hoping to get rid of this, but we still need it for fastEstimate mode) + // fix bug 121952: must also do rounding for fixed mode + if (d2a->bFastEstimateOk || mode == DTOSTR_FIXED || mode == DTOSTR_PRECISION) + { + i = d2a->nextDigit(); + if (i > 4) { + wchar *ptr = s-1; + while (ptr >= buffer) { + if (*ptr < '0') { + ptr--; + continue; + } + (*ptr)++; + if (*ptr != 0x3A) { + break; + } + *ptr-- = '0'; + } + } + if (mode == MathUtils::DTOSTR_NORMAL && wroteDecimal) { + // Remove trailing zeros + while (*(s-1) == '0') { + s--; + } + if (*(s-1) == '.') { + s--; + } + } + } + + if (exp10) { + wchar *firstNonZero = buffer; + while (firstNonZero < s && *firstNonZero == '0') { + firstNonZero++; + } + if (s == firstNonZero) { + // Deal with case where all digits were + // rounded away + *s++ = '1'; + exp10++; + } else { + wchar *lastNonZero = s; + while (lastNonZero > firstNonZero) { + if (*--lastNonZero != '0') { + break; + } + } + if (value && (firstNonZero == lastNonZero) ) { + // Watch out for extra zeros like + // 10e+95 + exp10 += (int) (s - firstNonZero - 1); + s = lastNonZero+1; + } + } + *s++ = 'e'; + if (exp10 > 0) { + *s++ = '+'; + } + wchar expstr[40]; + int len; + convertIntegerToString(exp10, expstr, len); + wchar *t = expstr; + while (*t) { *s++ = *t++; } + } + + *s = '\0'; + len = s-buffer; + + if (sentinel && sentinel[0] == '0' && sentinel[1] != '.') { + wchar *s = sentinel; + wchar *t = sentinel+1; + while ((*s++ = *t++) != 0) { + // nothing + } + len = String::Length(buffer); + } + + AvmAssert(len == String::Length(buffer)); + + #if 0 // def WIN32 + // Restore control word + _asm fldcw [oldcw]; + #endif + + delete d2a; + + } + + // convertStringToDouble: Converts an ASCII string in the form + // [+-]######.######e[+-]### + // to a double-precision floating-point number + // + bool MathUtils::convertStringToDouble(const wchar *s, + int len, + double *value, + bool strict /*=false*/ ) + { + bool negate; + int numDigits = 0; + int exp10 = 0; + double result = 0; + + const wchar *sStart = s; + + s = skipSpaces(s); + if (*s == 0) // empty string or string of spaces == 0 + { + *value = 0; + return (strict ? true : false); // odd use of strict, but Number(' ') is 0 and that uses strict == true. parseFloat(' ') is NaN and that uses strict == false + } + + s = handleSign(s, negate); + + // Pass 1: Validate input and determine exponents. + const wchar *ptr = s; + while (*ptr >= '0' && *ptr <= '9') { + numDigits++; + ptr++; + } + + // If decimal point encountered, read past digits + // to right of decimal point. + if (*ptr == '.') { + while (*++ptr >= '0' && *ptr <= '9') { + numDigits++; + } + } + + // Handle exponent + if (*ptr == 'e' || *ptr == 'E') { + int num = 0; + bool negexp; + ptr = handleSign(++ptr, negexp); + if (negexp && *ptr == 0) // fail if string ends in "e-" with no exponent value specified. + return false; + + while (*ptr >= '0' && *ptr <= '9') { + num = num * 10 + (*ptr++ - '0'); + } + if (negexp) { + num = -num; + } + exp10 += num; + } + // ecma3 compliant to allow leading and trailing whitespace + ptr = skipSpaces(ptr); + + // If we got no digits, check for Infinity/-Infinity, else fail + if (numDigits == 0) { + // check for the strings "Infinity" and "-Infinity" + wchar buff[10]; + if ( (len - (ptr-sStart)) > 7 ) { // there may be trailing whitespace + memcpy(buff,ptr,16); + buff[8] = 0; + if (String::Compare(buff,"Infinity",8) == 0) { + *value = (negate ? 0.0 - MathUtils::infinity() : MathUtils::infinity()); + return true; + } + } + return false; + } + + // If we got digits, but we're in strict mode and not at end of string, fail. + if (*ptr && strict) { + return false; + } + + // Pass 2: We've validated the input, now calculate the result. + + // Read all the digits + // cn: multiplyinging by negative powers of ten injects roundoff errors. + /* + while ((*s >= '0' && *s <= '9') || *s == '.') { + if (*s != '.') { + result += powerOfTen(exp10--, *s - '0'); + } + s++; + } + */ + if (numDigits > 15) // after 15 digits, we can run into roundoff error + { + BigInteger exactInt; + exactInt.setFromInteger(0); + int decimalDigits= -1; + while ((*s >= '0' && *s <= '9') || *s == '.') { + if (decimalDigits != -1) { + decimalDigits++; + } + if (*s != '.') { + exactInt.multAndIncrementBy(10, *s - '0'); + } else { + decimalDigits=0; + } + s++; + } + if (decimalDigits > 0) { + exp10 -= decimalDigits; + } + if (exp10 > 0) { + exactInt.multBy(quickPowTen(exp10)); + exp10 = 0; + } + // This is an approximation which is at most off by 1. To gain complete accuracy, we need to implement + // the algorithm commented out below + result = exactInt.doubleValueOf(); + if (exp10 < 0) { + if (exp10 < -307) { // max positive value is e308. min neg value is e-324 Avoid overflow + int diff = exp10 + 307; + result /= quickPowTen(-diff); + exp10 -= diff; + } + result /= quickPowTen(-exp10); // actually more accurate than multiplying by negative power of 10 + } + } + else // we can use double + { + int decimalDigits= -1; + while ((*s >= '0' && *s <= '9') || *s == '.') { + if (decimalDigits != -1) { + decimalDigits++; + } + if (*s != '.') { + result = result*10 + *s - '0'; + } else { + decimalDigits=0; + } + s++; + } + if (decimalDigits > 0) { + exp10 -= decimalDigits; + } + if (exp10 >= 0) { + result *= quickPowTen(exp10); + + } else { + if (exp10 < -307) { // max positive value is e308. min neg value is e-324. Avoid overflow + int diff = exp10 + 307; + result /= quickPowTen(-diff); + exp10 -= diff; + } + result /= quickPowTen(-exp10); // actually more accurate than multiplying by negative power of 10 + } + } + + *value = negate ? -result : result; + return true; + } + + // cn: The following Alg is based on William Clinger's paper "How to Read Floating Point Numbers Accurately" + // + // Using BigIntegers gives us a result which is either the best approximation or the next best approximation. + // The rest of this algorithm should be completed to adjust the result in order to make sure its the best. + // Held off on finishing it as there are bigger fish to fry, the ecmaScript number tests pass with the above + // and perhaps that's good enough. To finish + // 1) BigInteger class needs to be extended to support negative numbers + // 2) The section under findClosestFloat after the comment "Compare" needs to be fleshed out with the + // details from Clinger's paper to figure out if the result, nextFloat(), or previousFloat() should + // be returned. Note that no loop needs to be completed because the BigInteger + // calclulation gaurantees we are at worst one estimate off the true value and the loop will + // only require a single iteration. + // 3) Implement nextFloat() / previousFloat() + /* + // Check if both the mantissa and exponent are guaranteed to accurately fit into a double + // (mantissa is <= 2^53, exponent is <= 10^23) If so, we can get away with double math. + if ( (exactInt->numWords == 1) || + (exactInt->numWords == 2 && wordBuffer[1] < 0x00200000) ) { // i.e. its < 0x0020 0000 0000 0000 == 2^53 + + if (exp10 >= 0 && exp10 < 23) { // log5-of-two^53 = ceil( log(pow(2,53)) / log(5) ) = ceil(22.82585758) = 23 + double f = exactInt->doubleValueOf(); + result = f * quickPowTen(exp10); + } + else if (exp10 < 0 && -exp10 < 23) { + double f = exactInt->doubleValueOf(); + result = f / quickPowTen(exp10); + } + else { // exponent doesn't fit exactly into a double + result = Bellerophon_MultiplyAndTest(exactInt, exp10, 0); + } + } else if (exactInt->numWords == 2) { // i.e. its < 0x0000 0001 0000 0000 0000 0000 == 2^64 + if ( (exp10 >= 0) && (exp10 < 23) { + result = Bellerophon_MultiplyAndTest(exactInt, exp10, 0); + } else { // exp10 < 0 || exp10 > 23) + result = Bellerophon_MultiplyAndTest(exactInt, exp10, 3); + } + } else { + if ( (exp10 >= 0) && (exp10 < 23) { + result = Bellerophon_MultiplyAndTest(exactInt, exp10, 1); + } else { // exp10 < 0 || exp10 > 23) + result = Bellerophon_MultiplyAndTest(exactInt, exp10, 4); + } + } + + *value = negate ? -result : result; + return true; + } + + MathUtils::Bellerophon_MultiplyAndTest(BigInteger* f, int exp10, int slop) + { + double x = f->doubleValueOf(); + double y = quickPowTen(exp10); + double estimate = x*y; + uint64 mantissaEstimate = frexp(estimate,&e); + int64 lowBits = (int64)(mantissaEstimate % 2048); // two^p-n = 2^(64-53) = 2^11 = 2048 + + // check if slop is large enough to make a difference when rounding to 53 bits + int64 diff = lowBits - 1024; + if ( (diff >= 0 && diff <= slop) || + (diff < 0 && -diff <= slop) ) + { + findClosestFloat(f,exp10,estimate); + } + + return estimate; + } + + MathUtils::findClosestFloat(BigInteger* f, int e, double estimate) + { + int k; + uint64 m = frexp(estimate,&k); + BigInteger *m = BigInteger::newFromUint64(m); + BigInteger* compX; + BigInteger* compY; + + if (e >= 0) { + if (k >= 0) { + compX = f->multBy(quickPow2(e)); + compY = m->multBy(pow(beta,k)); + } else { + compX = f->multBy(quickPow2(e))->multBy( pow(beta,-k) ); + compY = m; + } + } else { // e < 0 + if (k >= 0) { + compX = f; + compY = m->multBy(pow(beta,k))->multBy(quickPow2(-e)); + } else { + compX = f->multBy(pow(beta,-k)); + compY = m->multBy(quickPow2(-e)) ); + } + } + // compare + BigInteger* diff = compX->subtract(compY); // need to modify BigInteger to support negative values + // rest of compare would go here + } + + */ + + // + // Random number generator + // + + /*-------------------------------------------------------------------------*/ + /* Coefficients used in the pure random number generator. */ +#define c3 15731L +#define c2 789221L +#define c1 1376312589L + + /* Read-only, XOR masks for random # generation. */ + static const uint32 Random_Xor_Masks[31] = + { + /* First mask is for generating sequences of 3 (2^2 - 1) random numbers, + / Second mask is for generating sequences of 7 (2^3 - 1) random numbers, + / etc. Numbers to the right are number of bits of random number sequence. + / It generates 2^n - 1 numbers. */ + 0x00000003L, 0x00000006L, 0x0000000CL, 0x00000014L, /* 2,3,4,5 */ + 0x00000030L, 0x00000060L, 0x000000B8L, 0x00000110L, /* 6,7,8,9 */ + 0x00000240L, 0x00000500L, 0x00000CA0L, 0x00001B00L, /* 10,11,12,13 */ + 0x00003500L, 0x00006000L, 0x0000B400L, 0x00012000L, /* 14,15,16,17 */ + 0x00020400L, 0x00072000L, 0x00090000L, 0x00140000L, /* 18,19,20,21 */ + 0x00300000L, 0x00400000L, 0x00D80000L, 0x01200000L, /* 22,23,24,25 */ + 0x03880000L, 0x07200000L, 0x09000000L, 0x14000000L, /* 26,27,28,29 */ + 0x32800000L, 0x48000000L, 0xA3000000L /* 30,31,32 */ + + }; /* Randomizer Xor mask values CRK 10-29-90 */ + /*-------------------------------------------------------------------------*/ + + //TRandomFast gRandomFast = { 0, 0, 0}; Initialized in global.cpp + + /*-*------------------------------------------------------------------------- + / Function + / RandomFastInit + / + / Purpose + / This initializes the fast random number generator. + / + / Notes + / The fast random number generator has some unique qualities: + / + / 1) It generates an exact and repeatable sequence of pseudorandom + / integers between 1 and 2^n-1, inclusive. Zero is not generated. + / 2) The same sequence repeats every 2^n-1 generations. + / 3) Each number can be generated extremely rapidly. + / + / This returns the first random number in the sequence. + / + / Entry + / pRandomFast = Pointer to data structure for current state of a fast + / pseudorandom number generator. + / n = A value which sets the number of unique values to generate before + / repeating. This value can range from 2 to 32, inclusive. If an + / invalid value (such as zero) is passed in, 32 is assumed. + /--------------------------------------------*/ + void MathUtils::RandomFastInit(pTRandomFast pRandomFast) + { + sint32 n = 31; // Changed from 32 to 31 per Prince + + /* The sequence always starts with 1. */ + // pRandomFast->uValue = 1L; + pRandomFast->uValue = OSDep::currentTimeMillis(); + + /* Figure out the sequence length (2^n - 1). */ + pRandomFast->uSequenceLength = (1L << n) - 1L; + + /* Gather the XOR mask value. */ + pRandomFast->uXorMask = Random_Xor_Masks[n - 2]; + } + /*-------------------------------------------------------------------------*/ + + /*-*------------------------------------------------------------------------- + / Function + / imRandomFastNext + / + / Purpose + / This generates a new pseudorandom number using the fast random number + / generator. + / + / Notes + / The fast random number generator must be initialized before use. + / + / This is implemented as a macro for the best possible performance. + / + / Entry + / pRandomFast = Pointer to data structure for current state of a fast + / pseudorandom number generator. + / + / Exit + / Returns the next pseudorandom number in the sequence. + /--------------------------------------------*/ +#define RandomFastNext(_pRandomFast) \ +( \ + ((_pRandomFast)->uValue & 1L) \ + ? ((_pRandomFast)->uValue = ((_pRandomFast)->uValue >> 1) ^ (_pRandomFast)->uXorMask) \ + : ((_pRandomFast)->uValue = ((_pRandomFast)->uValue >> 1)) \ +) + /*-------------------------------------------------------------------------*/ + + /*-*------------------------------------------------------------------------- + / Function + / RandomPureHasher + / + / Purpose + / This generates a pseudorandom number from a given seed using the high + / quality random number generator. + / + / Notes + / The caller must pass in a seed value. This value is typically the + / output of the fast random number generator multiplied by a prime + / number, but can be any seed which was not derived from the output of + / this function. + / + / Please note that this random number generator is really as hasher. + / It will not work well if you pass its own output in as the next input. + / + / A given input seed always generates the same pseudorandom output result. + / + / The feature of this hasher is that the value returned from one seed + / to the next is highly uncorrelated to the seed value. High quality + / multidimensional random numbers can be generated by using a sum of + / prime multiples of the seed values. + / + / For example, to generate a vector given three seed values sx, sy and sz, + / use something like the following: + / result = imRandomPureHasher(59*sx + 67*sy + 71*sz); + / + / Entry + / iSeed = Starting seed value. + / + / Exit + / Returns the next pseudorandom value in the sequence. + /--------------------------------------------*/ + sint32 MathUtils::RandomPureHasher(sint32 iSeed) + { + sint32 iResult; + + /* Adapted from "A Recursive Implementation of the Perlin Noise Function," + / by Greg Ward, Graphics Gems II, p. 396. */ + + /* First, hash s as a preventive measure. This helps ensure the first + / few numbers are more random when used in conjunction with the fast + / random number generator, which starts off with the first 10 or so + / numbers all zero in the lowe bits. */ + iSeed = ((iSeed << 13) ^ iSeed) - (iSeed >> 21); + + /* Next, use a third order odd polynomial, better than linear. */ + iResult = (iSeed*(iSeed*iSeed*c3 + c2) + c1) & kRandomPureMax; + + /* DJ14dec94 -- The above wonderful expression always returns odd + / numbers, and this is easy to prove. So we add the seed back to + / the result which again randomizes bit zero. */ + iResult += iSeed; + + /* DJ17nov95 -- The above always returns values that are NEVER divisible + / evenly by four, so do additional hashing. */ + iResult = ((iResult << 13) ^ iResult) - (iResult >> 21); + + return iResult; + } + /* ------------------------------------------------------------------------------ */ + sint32 MathUtils::GenerateRandomNumber(pTRandomFast pRandomFast) + { + /* Fill out gRandomFast if it is uninitialized. + / This means seed hasn't been set. Sequence of numbers will be + / the same every time player is run. */ + if (pRandomFast->uValue == 0) { + /* Initialize 32 bit pure random number generator. */ + RandomFastInit(pRandomFast); + } + + long aNum = RandomFastNext(pRandomFast); + + /* Use the pure random number generator to hash the result. */ + aNum = RandomPureHasher(aNum * 71L); + + return aNum & kRandomPureMax; + } + + sint32 MathUtils::Random(sint32 range, pTRandomFast pRandomFast) + { + if (range > 0) { + return GenerateRandomNumber(pRandomFast) % range; + } else { + return 0; + } + } + + void MathUtils::initRandom(TRandomFast *seed) + { + RandomFastInit(seed); + } + + double MathUtils::random(TRandomFast *seed) + { + return (double)GenerateRandomNumber(seed) / ((double)kRandomPureMax+1.0); + } + + /*-------------------------------------------------------------------------*/ + /* Begining D2A class implemention, used for converting double values to */ + /* strings accurately. */ + + // This algorithm for printing floating point numbers is based on the paper + // "Printing floating-point numbers quickly and accurately" by Robert G Burger + // and R. Kent Dybvig http://www.cs.indiana.edu/~burger/FP-Printing-PLDI96.pdf + // See that paper for details. + // + // The algorithm generates the shortest, correctly rounded output string that + // converts to the same number when read back in. This implementation assumes + // IEEE unbiased rounding, that the input is a 64 bit (base 2) floating point + // number composed of a sign bit, a hidden bit (valued 1) and 52 explict bits of + // mantissa data, and an 11 bit exponent (in base 2). It also assumes the output + // desired is base 10. + + + // ------------------------------------------------------ + // Support functions + + // For results larger than 10^22, error creeps into the double estimate. Use BigIntegers to avoid error + static inline void quickBigPowTen(int exp, BigInteger* result) + { + if (exp < 22 && exp > 0) { + result->setFromDouble(kPowersOfTen[exp]); + } else if (exp > 0) {// double starts to include roundoff error after 1e22, need to compute exactly + result->setFromDouble(kPowersOfTen[21]); + exp -= 21; + while (exp-- > 0) + result->multBy(10); + } else { // we won't get here because we only deal in positive exponents + result->setFromDouble(MathUtils::pow(10,exp)); // but just in case + } + } + + // Use left shifts to compute powers of 2 < 63 + static inline double quickPowTwo(int exp) + { + static uint64 one = 1; // max we can shift is 64bits + if (exp < 64 && exp > 0) + return (double)(one << exp); + else + return MathUtils::pow(2,exp); + } + + // nextDigit() returns the next relevant digit in the number being converted, else -1 if + // there are no more relevant digits. + int D2A::nextDigit() + { + if (finished) + return -1; + + bool withinLowEndRoundRange; + bool withinHighEndRoundRange; + int quotient; + + if ( bFastEstimateOk ) + { + quotient = (int)(dr / ds); + double mod = MathUtils::mod(dr,ds); + dr = mod; + + // check if remaining ratio r/s is within the range of floats which would round to the value we have output + // so far when read in from a string. + withinLowEndRoundRange = (lowOk ? (dr <= dMMinus) : (dr < dMMinus)); + withinHighEndRoundRange = (highOk ? (dr+dMPlus >= ds) : (dr+dMPlus > ds)); + } + else + { + BigInteger bigQuotient; + bigQuotient.setFromInteger(0); + r.divBy(&s, &bigQuotient); // r = r %s, bigQuotient = r / s. + quotient = (int32)(bigQuotient.wordBuffer[0]); // todo: optimize away need for BigInteger result? We know it should always be a single digit + // r <= mMinus : r < rMinus + withinLowEndRoundRange = (lowOk ? (r.compare(&mMinus) != 1) : (r.compare(&mMinus) == -1)); + // r+mPlus >= s : r+mPlus > s + withinHighEndRoundRange = (highOk ? (r.compareOffset(&s,&mPlus) != -1) : (r.compareOffset(&s,&mPlus) == 1)); + } + + + if (quotient < 0 || quotient > 9) + { + AvmAssert(quotient >= 0); + AvmAssert(quotient < 10); + quotient = 0; + } + if (!withinLowEndRoundRange) + { + if (!withinHighEndRoundRange) // if not within either error range, set up to generate the next digit. + { + if ( bFastEstimateOk ) + { + dr *= 10; + dMPlus *= 10; + dMMinus *= 10; + } + else + { + r.multBy(10); + mPlus.multBy(10); + mMinus.multBy(10); + } + } + else + { + quotient++; + finished = true; + } + } + else if (!withinHighEndRoundRange) + { + finished = true; + } + else + { + if ( (bFastEstimateOk && (dr*2 < ds)) || + (!bFastEstimateOk && (r.compareOffset(&s,&r) == -1)) ) // if (r*2 < s) todo: faster to do lshift and compare? + { + finished = true; + } + else + { + quotient++; + finished = true; + } + } + return quotient; + } + + + int D2A::fixup_ExponentEstimate(int exponentEstimate) + { + int correctedEstimate; + if (bFastEstimateOk) + { + if (highOk ? (dr+dMPlus) >= ds : dr+dMPlus > ds) + { + correctedEstimate = exponentEstimate+1; + } + else + { + dr *= 10; + dMPlus *= 10; + dMMinus *= 10; + correctedEstimate = exponentEstimate; + } + } + else + { + if (highOk ? (r.compareOffset(&s,&mPlus) != -1) : (r.compareOffset(&s,&mPlus) == 1)) + { + correctedEstimate = exponentEstimate+1; + } + else + { + r.multBy(10); + mPlus.multBy(10); + mMinus.multBy(10); + correctedEstimate = exponentEstimate; + } + } + return correctedEstimate; + } + + int D2A::scale() + { + // estimate base10 exponent: + int base2Exponent = e + mantissaPrec-1; + int exponentEstimate = (int)MathUtils::ceil( (base2Exponent * kLog2_10) - 0.0000000001); + + + if (bFastEstimateOk) + { + double scale = quickPowTen( (exponentEstimate > 0) ? exponentEstimate : -exponentEstimate); + + if (exponentEstimate >= 0) + { + ds *= scale; + return fixup_ExponentEstimate(exponentEstimate); + } + else + { + dr *= scale; + dMPlus *= scale; + dMMinus *= scale; + return fixup_ExponentEstimate(exponentEstimate); + } + } + else + { + BigInteger scale; + scale.setFromInteger(0); + quickBigPowTen( (exponentEstimate > 0) ? exponentEstimate : -exponentEstimate, &scale); + + if (exponentEstimate >= 0) + { + s.multBy(&scale); + return fixup_ExponentEstimate(exponentEstimate); + } + else + { + r.multBy(&scale); + mPlus.multBy(&scale); + mMinus.multBy(&scale); + + return fixup_ExponentEstimate(exponentEstimate); + } + } + } + + D2A::~D2A() + { + } + + + D2A::D2A(double avalue, int mode, int minDigits) + : value(avalue), finished(false), bFastEstimateOk(false), minPrecision(minDigits) + { + // break double down into integer mantissa (max size unsigned 53 bits) and integer base 2 + // expondent (max size 11 signed bits). + mantissa = MathUtils::frexp(value,&e); // value = mantissa*2^e, mantissa and e are integers. + + if (mode != MathUtils::DTOSTR_NORMAL) + { + lowOk = highOk = true; + } + else + { + bool round = !(mantissa & 0x1); // if mantissa is even, need to round. + lowOk = highOk = round; // IEEE standard unbiased rounding. + } + + // calculate #of bits of precision needed to encode this mantissa (max is 53 bits) + long base2Precision = 53; + mantissaPrec = base2Precision; // double has 53 bits of precision in the mantissa, but first bit is assumed + while ( mantissaPrec != 0 && ((mantissa >> --mantissaPrec & 1) == 0) ) + ; // skip leading zeros + mantissaPrec++; + + int absE = (e > 0 ? e : -e); + if ((absE + mantissaPrec-1) < 50) // we get error prone when there is more than 15 base 10 digits of precision. (15 / kLog2_10) == 49.828921423310435218054791442341) + bFastEstimateOk = true; + + // Represent this double as a ratio of two integers. Use infinitely precise integers if bFastEstimate is false. + // mPlus and mMinus represent the range of doubles around this value which would + // round to this same value when converted from string back to number via atod(). + if (bFastEstimateOk) + { + if (e >= 0) + { + if (mantissa != 0x10000000000000LL) // == 4503599627370496 == pow(2, base2Precision-1)) == 2^52 (i.e. just under becoming +1 to e and rolling over to 0) + { + double be = quickPowTwo(e); // 2^e + + dr = (double)mantissa*be*2; + ds = 2; + dMPlus = be; + dMMinus = be; + } + else + { + double be = quickPowTwo(e);; // 2^e + double be1 = be*2; // 2^(e+1) + + dr = (double)mantissa*be1*2; + ds = 4; // 2*2; + dMPlus = be1; + dMMinus = be; + } + } + else if ( mantissa != MathUtils::pow(2, base2Precision-1) ) + { + dr = (double)mantissa*2.0; + ds = quickPowTwo(1-e); // pow(2,-e)*2; + dMPlus = 1; + dMMinus = 1; + } + else + { + dr = (double)mantissa*4.0; + ds = quickPowTwo(2-e); // pow(2, 1-e)*2; + dMPlus = 2; + dMMinus = 1; + } + + // adjust stopping conditions if a particular number of digits are requested + if (mode != MathUtils::DTOSTR_NORMAL) + { + double fixedPrecisionPowTen = quickPowTen( minPrecision ); + ds *= fixedPrecisionPowTen; + dr *= fixedPrecisionPowTen; + } + } + else + { + if (e >= 0) + { + if (mantissa != 0x10000000000000LL) // == 4503599627370496 == pow(2, base2Precision-1)) == 2^53 (i.e. just under becoming +1 to e and rolling over to 0) + { + BigInteger be; + be.setFromInteger(1); + be.lshiftBy(e); // == pow(2,e); + + r.setFromDouble(value); + r.lshiftBy(1); // r = mantissa*be*2 + + s.setFromInteger(2); + + mPlus.setFromBigInteger(&be,0,be.numWords); // == be; + mMinus.setFromBigInteger(&be,0,be.numWords); // == be; + } + else + { + BigInteger be; + be.setFromInteger(1); + be.lshiftBy(e); // be = pow(2,e); + + BigInteger be1; + be1.setFromInteger(0); + be.lshift(1,&be1); // be1 == be*2; + + r.setFromDouble(value*4.0); // r == mantissa*be1*2; + s.setFromInteger(4); // 2*2 + mPlus.setFromBigInteger(&be1,0,be1.numWords); // == be1; + mMinus.setFromBigInteger(&be,0,be.numWords); // == be; + } + } + else if ( mantissa != MathUtils::pow(2, base2Precision-1) ) + { + r.setFromDouble( (double)(mantissa*2) ); + s.setFromInteger(2); + s.lshiftBy(-e); // s = pow(2,-e)*2; + mPlus.setFromInteger(1); + mMinus.setFromInteger(1); + } + else + { + r.setFromDouble( (double)(mantissa*4) ); + s.setFromInteger(2); + s.lshiftBy(1-e); // s == pow(2, 1-e)*2; + mPlus.setFromInteger(2); + mMinus.setFromInteger(1); + } + + // adjust stopping conditions if a particular number of digits are requested + // Note: this is a cheap approximation of the correct adjustment. It will likely + // lead to occasional off by one errors in the final digit generated for toPrecision() when + // a truncation might be required. This mode is actually less accurate than normal mode anyway. + // Only normal mode is gauranteed to generate a string which will result in the same value when converted back + // from string (base 10) to double (base 2). Extra digits generated by toPrecision will often be junk + // (but will display a value more similar to what you would see in a code debugger, where 0.012 can + // appear as 0.012999999999999999999 or such apparent nonsense) + if (mode != MathUtils::DTOSTR_NORMAL) + { + BigInteger bFixedPrecisionPowTen; + bFixedPrecisionPowTen.setFromInteger(0); + quickBigPowTen( minPrecision, &bFixedPrecisionPowTen ); + s.multBy(&bFixedPrecisionPowTen); + r.multBy(&bFixedPrecisionPowTen); + } + } + base10Exp = scale(); + } + + + /* + A2D::A2D(String source,int radix) + { + bitsPerChar = 0; + while ( (radix >>= 1) != 1 ) + bitsPerChar++; + + source = source; + radix = radix; + next = 0; + end = string.length(); + finished = false; + + // skip leading 0's + while( nextDigit() == 0); + next--; + } + + inline int A2D::parseIntDigit(wchar ch) + { + if (ch >= '0' && ch <= '9') { + return (ch - '0'); + } else if (ch >= 'a' && ch <= 'z') { + return (ch - 'a' + 10); + } else if (ch >= 'A' && ch <= 'Z') { + return (ch - 'A' + 10); + } else { + return -1; + } + } + int A2D::nextDigit() + { + if (finished) + return -1; + + wc = source[next++]; + int result = parseIntDigit(wc); + if (next == end || result == -1) + finished = true; + return result; + } + */ + + +} diff --git a/mozilla/js/tamarin/core/MathUtils.h b/mozilla/js/tamarin/core/MathUtils.h new file mode 100644 index 00000000000..8ba5a073325 --- /dev/null +++ b/mozilla/js/tamarin/core/MathUtils.h @@ -0,0 +1,215 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 1993-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#ifndef __avmplus_MathUtils__ +#define __avmplus_MathUtils__ + +#include "BigInteger.h" + +namespace avmplus +{ +#undef min +#undef max + + /** + * Data structure for state of fast random number generator. + */ + struct TRandomFast + { + /* Random result and seed for next random result. */ + uint32 uValue; + + /* XOR mask for generating the next random value. */ + uint32 uXorMask; + + /* This is the number of values which will be generated in the + / sequence given the initial value of n. */ + uint32 uSequenceLength; + }; + // + // Random number generator + // + typedef struct TRandomFast *pTRandomFast; + + /** + * The pure random number generator returns random numbers between zero + * and this number. This value is useful to know for scaling random + * numbers to a desired range. + */ + #define kRandomPureMax 0x7FFFFFFFL + + /** + * The MathUtils class is a utility class which supports many + * common mathematical operations, particularly those defined in + * ECMAScript's Math class. + */ + class MathUtils + { + public: + static double abs(double value); + static double acos(double value); + static double asin(double value); + static double atan(double value); + static double atan2(double y, double x); + static double ceil(double value); + static double cos(double value); + static bool equals(double x, double y); + static double exp(double value); + static double floor(double value); + static uint64 frexp(double x, int *eptr); + static double infinity(); + static int isInfinite(double value); + static bool isNaN(double value) { return value != value; } + static bool isNegZero(double x); + static bool isHexNumber(const wchar *ptr); + static double log(double value); + static double max(double x, double y) { return (x > y) ? x : y; } + static double min(double x, double y) { return (x < y) ? x : y; } + static double mod(double x, double y); + static double nan(); + static int nextPowerOfTwo(int n); + static double parseInt(const wchar *s, int len, int radix=10, bool strict=true); + static double pow(double x, double y); + static double powInternal(double x, double y); + static void initRandom(TRandomFast *seed); + static double random(TRandomFast *seed); + static double round(double value); + static double sin(double value); + static double sqrt(double value); + static double tan(double value); + static double toInt(double value); + #ifdef WIN32 + // This routine will return 0x80000000 if the double value overflows + // and integer and is not between -2^31 and 2^31-1. + static int32 real2int(double value); + #else + static int32 real2int(double val) { return (int32) val; } + #endif + static bool convertIntegerToString(int value, + wchar *buffer, + int& len, + int radix=10, + bool treatAsUnsigned=false); + static Stringp convertDoubleToStringRadix(AvmCore *core, + double value, + int radix); + enum { + DTOSTR_NORMAL, + DTOSTR_FIXED, + DTOSTR_PRECISION, + DTOSTR_EXPONENTIAL + }; + static void convertDoubleToString(double value, + wchar *buffer, + int &len, + int mode = DTOSTR_NORMAL, + int precision = 15); + static bool convertStringToDouble(const wchar *s, + int len, + double *value, + bool strict=false); + static double convertStringToNumber(const wchar* ptr, int strlen); + static int nextDigit(double *value); + + private: + static double powerOfTen(int exponent, double value); + static wchar *handleSign(const wchar *s, bool& negative); + static wchar *skipSpaces(const wchar *s); + static int parseIntDigit(wchar ch); + static int roundInt(double x); + + static void RandomFastInit(pTRandomFast pRandomFast); + static sint32 RandomPureHasher(sint32 iSeed); + static sint32 GenerateRandomNumber(pTRandomFast pRandomFast); + static sint32 Random(sint32 range, pTRandomFast pRandomFast); + + }; + + /* D2A class implemention, used for converting double values to */ + /* strings accurately. */ + + // This algorithm for printing floating point numbers is based on the paper + // "Printing floating-point numbers quickly and accurately" by Robert G Burger + // and R. Kent Dybvig http://www.cs.indiana.edu/~burger/FP-Printing-PLDI96.pdf + // See that paper for details. + // + // The algorithm generates the shortest, correctly rounded output string that + // converts to the same number when read back in. This implementation assumes + // IEEE unbiased rounding, that the input is a 64 bit (base 2) floating point + // number composed of a sign bit, a hidden bit (valued 1) and 52 explict bits of + // mantissa data, and an 11 bit exponent (in base 2). It also assumes the output + // desired is base 10. + class D2A { + + public: + D2A(double value, int mode, int minPrecision=0); + ~D2A(); + + int nextDigit(); + int expBase10() { return base10Exp; } + + double value; // double value for quick work when e and mantissa are small; + int e; + uint64 mantissa; // on input, value = mantissa*2^e; Only last 53 bits are used + int mantissaPrec; // how many bits of precision are actually used in the mantissa; + int base10Exp; // the (derived) base 10 exponent of value. + bool finished; // set to true when we've output all relevant digits. + bool bFastEstimateOk; // if minPrecision < 16, use double, rather than BigInteger math + + private: + int minPrecision; // precision requested + + bool lowOk; // for IEEE unbiased rounding, this is true when mantissa is even. When true, use >= in mMinus test instead of > + bool highOk; // ditto, but for mPlus test. + + // if !bFastEstimateOk, use these + BigInteger r; // on initialization, input double = r / s. After each nextDigit() call, r = r % s + BigInteger s; + BigInteger mPlus; // when (r+mPlus) > s, we have generated all relevant digits. Just return 0 for remaining nextDigit requests + BigInteger mMinus; // when (r < mMins), we have generated all relevant digits. Just return 0 form remaining nextDigit requests + + // if bFastEstimateOk, use these + double dr; // same as above, but integer value stored in double + double ds; + double dMPlus; + double dMMinus; + + int scale(); // Estimate base 10 exponent of number, scale r,s,mPlus,mMinus appropriately. + // Returns result of fixup_ExponentEstimate(est). + int fixup_ExponentEstimate(int expEst); // Used by scale to adjust for possible off-by-one error + // in the base 10 exponent estimate. Returns exact base10 exponent of number. + + }; + +} + +#endif /* __avmplus__MathUtils__ */ diff --git a/mozilla/js/tamarin/core/MethodClosure.cpp b/mozilla/js/tamarin/core/MethodClosure.cpp new file mode 100644 index 00000000000..badc9ab5869 --- /dev/null +++ b/mozilla/js/tamarin/core/MethodClosure.cpp @@ -0,0 +1,132 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmplus.h" + +using namespace MMgc; + +namespace avmplus +{ + // [ed] why does the E4 semantics MethodClosure have a slot table? + // [jd] The slot table of a method closure is used to hold the value of the ‘length’ + // property for the method. Don’t know how important this is, but there you go. + // [ed] 9/15/04 we're implementing length as a getter instead of a slot. + + MethodClosure::MethodClosure(VTable* ivtable, ScriptObject* prototype, + MethodEnv *env, Atom savedThis) + : ScriptObject(ivtable, prototype) + { + AvmAssert(traits()->sizeofInstance == sizeof(MethodClosure)); + AvmAssert(env != NULL); + AvmAssert(!AvmCore::isNullOrUndefined(savedThis)); + this->env = env; + this->savedThis = savedThis; + } + + // this = argv[0] (ignored, we use savedThis instead) + // arg1 = argv[1] + // argN = argv[argc] + Atom MethodClosure::call(int argc, Atom* argv) + { + argv[0] = savedThis; + return env->coerceEnter(argc, argv); + } + + // this = argv[0] (ignored) + // arg1 = argv[1] + // argN = argv[argc] + Atom MethodClosure::construct(int /*argc*/, Atom* /*argv*/) + { + // can't invoke method closure as constructor: + // m = o.m; + // new m(); // error + toplevel()->throwTypeError(kCannotCallMethodAsConstructor, core()->toErrorString(env->method)); + return undefinedAtom; + } + + int MethodClosure::get_length() const + { + return env->method->param_count; + } + +#ifdef AVMPLUS_VERBOSE + Stringp MethodClosure::format(AvmCore* core) const + { + Stringp prefix = core->newString("MC{"); + prefix = core->concatStrings(prefix, core->format(savedThis)); + prefix = core->concatStrings(prefix, core->newString(" ")); + prefix = core->concatStrings(prefix, env->method->format(core)); + prefix = core->concatStrings(prefix, core->newString("}@")); + return core->concatStrings(prefix, core->formatAtomPtr(atom())); + } +#endif + + BEGIN_NATIVE_MAP(MethodClosureClass) + NATIVE_METHOD2(builtin_as_0_MethodClosure_length_get, &MethodClosure::get_length) + END_NATIVE_MAP() + + MethodClosureClass::MethodClosureClass(VTable* cvtable) + : ClassClosure(cvtable) + { + Toplevel* toplevel = this->toplevel(); + + toplevel->methodClosureClass = this; + AvmAssert(traits()->sizeofInstance == sizeof(MethodClosureClass)); + + prototype = toplevel->functionClass->createEmptyFunction(); + } + + // Function called as constructor ... not supported from user code + // this = argv[0] (ignored) + // arg1 = argv[1] + // argN = argv[argc] + MethodClosure* MethodClosureClass::create(MethodEnv* m, Atom obj) + { + WeakKeyHashtable *mcTable = m->getMethodClosureTable(); + Atom mcWeakAtom = mcTable->get(obj); + GCWeakRef *ref = (GCWeakRef*)AvmCore::atomToGCObject(mcWeakAtom); + MethodClosure *mc; + + if(!ref || !ref->get()) + { + VTable* ivtable = this->ivtable(); + mc = (new (core()->GetGC(), ivtable->getExtraSize()) MethodClosure(ivtable, prototype, m, obj)); + mcWeakAtom = AvmCore::gcObjectToAtom(mc->GetWeakRef()); + mcTable->add(obj, mcWeakAtom); + } + else + { + mc = (MethodClosure*)ref->get(); + } + return mc; + } +} diff --git a/mozilla/js/tamarin/core/MethodClosure.h b/mozilla/js/tamarin/core/MethodClosure.h new file mode 100644 index 00000000000..6fccbdd86e3 --- /dev/null +++ b/mozilla/js/tamarin/core/MethodClosure.h @@ -0,0 +1,102 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_MethodClosure__ +#define __avmplus_MethodClosure__ + + +namespace avmplus +{ + class MethodClosureClass : public ClassClosure + { + public: + DECLARE_NATIVE_MAP(MethodClosureClass) + + MethodClosureClass(VTable* cvtable); + + // Function called as constructor ... not supported from user code + // this = argv[0] (ignored) + // arg1 = argv[1] + // argN = argv[argc] + Atom construct(int /*argc*/, Atom* /*argv*/) + { + AvmAssert(false); + return nullObjectAtom; + } + + Atom call(int argc, Atom* argv) + { + return construct(argc,argv); + } + + MethodClosure* create(MethodEnv* env, Atom savedThis); + }; + + /** + * The MethodClosure class is used to represent method + * closures; that is, a function which is a method of + * a class. + * + * MethodClosure is how AVM+ supports the "method extraction" + * behavior of ECMAScript Edition 4. When a reference to + * a method of a class is retrieved, a MethodClosure is + * created. The MethodClosure also remembers the object + * instance that the method was extracted from. When the + * MethodClosure is invoked, the method is invoked with + * "this" pointing to the remembered instance. + */ + class MethodClosure : public ScriptObject + { + friend class MethodClosureClass; + MethodClosure(VTable* vtable, ScriptObject* prototype, MethodEnv* env, Atom savedThis); + public: + DWB(MethodEnv*) env; + ATOM_WB savedThis; + + + // argc is args only, argv[0] = receiver + Atom call(int argc, Atom* argv); + + // argc is args only, argv[0] = receiver(ignored) + Atom construct(int argc, Atom* argv); + + int get_length() const; + + bool isMethodClosure() { return true; } + +#ifdef AVMPLUS_VERBOSE + public: + Stringp format(AvmCore* core) const; +#endif + }; +} + +#endif /* __avmplus_MethodClosure__ */ diff --git a/mozilla/js/tamarin/core/MethodEnv.cpp b/mozilla/js/tamarin/core/MethodEnv.cpp new file mode 100644 index 00000000000..bc6b2af1318 --- /dev/null +++ b/mozilla/js/tamarin/core/MethodEnv.cpp @@ -0,0 +1,1645 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 1993-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmplus.h" + +namespace avmplus +{ +#undef DEBUG_EARLY_BINDING + Atom MethodEnv::coerceEnter(int argc, Atom* atomv) + { + Toplevel* toplevel = vtable->toplevel; + + if (!method->argcOk(argc)) + { + toplevel->argumentErrorClass()->throwError(kWrongArgumentCountError, core()->toErrorString((AbstractFunction*)method), core()->toErrorString(method->requiredParamCount()), core()->toErrorString(argc)); + } + + AbstractFunction* method = this->method; + + // just do enough to resolve signatures. Don't do a full verify yet. + method->resolveSignature(toplevel); + + // check receiver type first + // caller will coerce instance if necessary, + // so make sure it was done. + AvmAssert(atomv[0] == toplevel->coerce(atomv[0], method->paramTraits(0))); + + // now unbox everything, including instance and rest args + int extra = argc > method->param_count ? argc - method->param_count : 0; + AvmAssert(method->restOffset > 0 && extra >= 0); + va_list ap = (va_list) alloca(method->restOffset + sizeof(Atom)*extra); + + unboxCoerceArgs(argc, atomv, ap); + + // we know we have verified the method, so we can go right into it. + Traits* returnType = method->returnTraits(); + AvmCore* core = this->core(); + if (returnType == NUMBER_TYPE) + { + AvmAssert(method->implN != NULL); + double d = method->implN(this, argc, ap); + return core->doubleToAtom(d); + } + else + { + AvmAssert(method->impl32 != NULL); + int i = method->impl32(this, argc, ap); + if (returnType == INT_TYPE) + return core->intToAtom(i); + else if (returnType == UINT_TYPE) + return core->uintToAtom((uint32)i); + else if (returnType == BOOLEAN_TYPE) + return i ? trueAtom : falseAtom; + else if (!returnType || returnType == OBJECT_TYPE || returnType == VOID_TYPE) + return (Atom)i; + else if (returnType == STRING_TYPE) + return ((Stringp)i)->atom(); + else if (returnType == NAMESPACE_TYPE) + return ((Namespace*)i)->atom(); + else + return ((ScriptObject*)i)->atom(); + } + } + + + /** + * convert atoms to native args. argc is the number of + * args, not counting the instance which is arg[0]. the + * layout is [instance][arg1..argN] + */ + void MethodEnv::unboxCoerceArgs(int argc, Atom* in, va_list ap) + { + AbstractFunction* f = this->method; + AvmCore* core = this->core(); + Toplevel* toplevel = this->toplevel(); + + #if defined(AVMPLUS_MAC) || defined (AVMPLUS_LINUX) || defined(AVMPLUS_ARM) + uint32 *argv = (uint32*) ap; + for (int i=0; i <= argc; i++) + { + if (i <= f->param_count) + { + Traits* t = f->paramTraits(i); + AvmAssert(t != VOID_TYPE); + + if (t == NUMBER_TYPE) + { + union { + double d; + uint32 l[2]; + }; + d = core->number(in[i]); + *argv++ = l[0]; + *argv++ = l[1]; + } + else if (t == INT_TYPE) + { + *argv++ = core->integer(in[i]); + } + else if (t == UINT_TYPE) + { + *argv++ = core->toUInt32(in[i]); + } + else if (t == BOOLEAN_TYPE) + { + *argv++ = core->boolean(in[i]); + } + else if (t == OBJECT_TYPE) + { + *argv++ = in[i] == undefinedAtom ? nullObjectAtom : in[i]; + } + else if (!t) + { + *argv++ = (uint32) in[i]; + } + else + { + // ScriptObject, String, or Namespace, or Null + *argv++ = (uint32) toplevel->coerce(in[i],t) & ~7; + } + } + else + { + *argv++ = (uint32) in[i]; + } + } + #else + int n = argc < f->param_count ? argc : f->param_count; + int i = 0; + for (; i <= n; i++) + { + Traits* t = f->paramTraits(i); + AvmAssert(t != VOID_TYPE); + if (t == NUMBER_TYPE) + { + va_arg(ap, double) = core->number(in[i]); + } + else if (t == INT_TYPE) + { + va_arg(ap, int) = core->integer(in[i]); + } + else if (t == UINT_TYPE) + { + va_arg(ap, uint32) = core->toUInt32(in[i]); + } + else if (t == BOOLEAN_TYPE) + { + va_arg(ap, int) = core->boolean(in[i]); + } + else if (t == OBJECT_TYPE) + { + va_arg(ap, Atom) = in[i] == undefinedAtom ? nullObjectAtom : in[i]; + } + else if (!t) + { + va_arg(ap, Atom) = in[i]; + } + else + { + // ScriptObject, String, or Namespace, or Null + va_arg(ap, int) = (int) toplevel->coerce(in[i],t) & ~7; + } + } + for (; i <= argc; i++) + { + va_arg(ap, Atom) = in[i]; + } + #endif + } + + + int MethodEnv::delegateInvoke(MethodEnv* env, int argc, va_list ap) + { + env->impl32 = env->method->impl32; + return env->impl32(env, argc, ap); + } + + MethodEnv::MethodEnv(void *addr, VTable *vtable) + : vtable(vtable), method(NULL) + { + impl32 = (int (*)(MethodEnv*, int, va_list)) addr; + } + + MethodEnv::MethodEnv(AbstractFunction* method, VTable *vtable) + : vtable(vtable), method(method) + { + // make the first call go to the method impl + impl32 = delegateInvoke; + + AvmCore* core = vtable->traits->core; + #ifdef AVMPLUS_VERBOSE + if (method->declaringTraits != vtable->traits) + { + core->console << "ERROR " << method->name << " " << method->declaringTraits << " " << vtable->traits << "\n"; + } + #endif + if(method->declaringTraits != vtable->traits){ + AvmAssertMsg(0, "(method->declaringTraits != vtable->traits)"); + toplevel()->throwVerifyError(kCorruptABCError); + } + + if (method->flags & AbstractFunction::NEED_ACTIVATION) + { + VTable *activation = core->newVTable(method->activationTraits, NULL, vtable->scope, vtable->abcEnv, toplevel()); + activation->resolveSignatures(); + setActivationOrMCTable(activation, kActivation); + } + + // register this env in the callstatic method table + int method_id = method->method_id; + if (method_id != -1) + { + AbcEnv* abcEnv = vtable->abcEnv; + AvmAssert(abcEnv->pool == (PoolObject *) method->pool); + if (abcEnv->methods[method_id] == NULL) + { + abcEnv->setMethod(method_id, this); + } + #ifdef AVMPLUS_VERBOSE + else if (method->pool->verbose) + { + core->console << "WARNING: tried to re-register global MethodEnv for " << method << "\n"; + } + #endif + } + + } + +#ifdef DEBUGGER + void MethodEnv::debugEnter(int argc, va_list ap, + Traits**frameTraits, int localCount, + CallStackNode* callstack, + Atom* framep, volatile int *eip) + { + AvmCore* core = this->core(); + + // update profiler + sendEnter(argc, ap); + + // dont reset the parameter traits since they are setup in the prologue + int firstLocalAt = method->param_count+1; + AvmAssert(!frameTraits || localCount >= firstLocalAt); + if (frameTraits) memset(&frameTraits[firstLocalAt], 0, (localCount-firstLocalAt)*sizeof(Traits*)); + if (callstack) callstack->initialize(this, method, framep, frameTraits, argc, ap, eip); + core->debugger->_debugMethod(this); + + core->sampleCheck(); + } + + void MethodEnv::debugExit(CallStackNode* callstack) + { + AvmCore* core = this->core(); + + // update profiler + sendExit(); + + core->callStack = callstack->next; + + // trigger a faked "line number changed" since we exited the function and are now back on the old line (well, almost) + if (core->callStack && core->callStack->linenum > 0) + { + int line = core->callStack->linenum; + core->callStack->linenum = -1; + core->debugger->debugLine(line); + } + } + + void MethodEnv::sendEnter(int /*argc*/, va_list /*ap*/) + { + Profiler *profiler = core()->profiler; + if (profiler->profilingDataWanted) + profiler->sendFunctionEnter(method); + } + + void MethodEnv::sendExit() + { + Profiler *profiler = core()->profiler; + if (profiler->profilingDataWanted) + profiler->sendFunctionExit(); + } +#endif + + void MethodEnv::nullcheck(Atom atom) + { + if (!AvmCore::isNullOrUndefined(atom)) + return; + + // TypeError in ECMA + ErrorClass *error = toplevel()->typeErrorClass(); + if( error ){ + error->throwError( + (atom == undefinedAtom) ? kConvertUndefinedToObjectError : + kConvertNullToObjectError); + } else { + toplevel()->throwVerifyError(kCorruptABCError); + } + } + + void MethodEnv::npe() + { + toplevel()->throwTypeError(kConvertNullToObjectError); + } + + void MethodEnv::interrupt() + { + vtable->traits->core->interrupt(this); + } + + Traits* MethodEnv::toClassITraits(Atom atom) + { + switch (atom&7) + { + case kObjectType: + { + if( !AvmCore::isNull(atom) ) + { + Traits* itraits = AvmCore::atomToScriptObject(atom)->traits()->itraits; + if (itraits == NULL) + toplevel()->throwTypeError(kIsTypeMustBeClassError); + return itraits; + } + // else fall through and report an error + } + default: + // TypeError in ECMA + // ISSUE the error message should say "whatever" is not a class + toplevel()->throwTypeError( + (atom == undefinedAtom) ? kConvertUndefinedToObjectError : + kConvertNullToObjectError); + return NULL; + } + } + + ArrayObject* MethodEnv::createRest(Atom* argv, int argc) + { + // create arguments Array using argv[param_count..argc] + Atom* extra = argv + method->param_count + 1; + int extra_count = argc > method->param_count ? argc - method->param_count : 0; + return toplevel()->arrayClass->newarray(extra, extra_count); + } + +#ifdef AVMPLUS_MIR + + Atom MethodEnv::getpropertyHelper(Atom obj, Multiname *multi, VTable *vtable, Atom index) + { + if ((index&7) == kIntegerType) + { + return getpropertylate_i(obj, index>>3); + } + + if ((index&7) == kDoubleType) + { + int i = AvmCore::integer_i(index); + if ((double)i == AvmCore::atomToDouble(index)) + { + return getpropertylate_i(obj, i); + } + } + + if (AvmCore::isObject(index)) + { + ScriptObject* i = AvmCore::atomToScriptObject(index); + if (i->traits() == core()->traits.qName_itraits) + { + QNameObject* qname = (QNameObject*) i; + qname->getMultiname(*multi); + } + else if(!multi->isRtns() && core()->isDictionary(obj)) + { + return AvmCore::atomToScriptObject(obj)->getProperty(index); + } + else + { + multi->setName(core()->intern(index)); + } + } + else + { + multi->setName(core()->intern(index)); + } + + return toplevel()->getproperty(obj, multi, vtable); + } + + void MethodEnv::initpropertyHelper(Atom obj, Multiname *multi, Atom value, VTable *vtable, Atom index) + { + if ((index&7) == kIntegerType) + { + setpropertylate_i(obj, index>>3, value); + return; + } + + if ((index&7) == kDoubleType) + { + int i = core()->integer(index); + uint32 u = (uint32)(i); + if ((double)u == AvmCore::atomToDouble(index)) + { + setpropertylate_u(obj, u, value); + return; + } + else if ((double)i == AvmCore::atomToDouble(index)) + { + setpropertylate_i(obj, i, value); + return; + } + } + + if (AvmCore::isObject(index)) + { + ScriptObject* i = AvmCore::atomToScriptObject(index); + if (i->traits() == core()->traits.qName_itraits) + { + QNameObject* qname = (QNameObject*) i; + qname->getMultiname(*multi); + } + else + { + multi->setName(core()->intern(index)); + } + } + else + { + multi->setName(core()->intern(index)); + } + + initproperty(obj, multi, value, vtable); + } + + void MethodEnv::setpropertyHelper(Atom obj, Multiname *multi, Atom value, VTable *vtable, Atom index) + { + if ((index&7) == kIntegerType) + { + setpropertylate_i(obj, index>>3, value); + return; + } + + if ((index&7) == kDoubleType) + { + int i = core()->integer(index); + uint32 u = (uint32)(i); + if ((double)u == AvmCore::atomToDouble(index)) + { + setpropertylate_u(obj, u, value); + return; + } + else if ((double)i == AvmCore::atomToDouble(index)) + { + setpropertylate_i(obj, i, value); + return; + } + } + + if (AvmCore::isObject(index)) + { + ScriptObject* i = AvmCore::atomToScriptObject(index); + if (i->traits() == core()->traits.qName_itraits) + { + QNameObject* qname = (QNameObject*) i; + qname->getMultiname(*multi); + } + else if(!multi->isRtns() && core()->isDictionary(obj)) + { + AvmCore::atomToScriptObject(obj)->setProperty(index, value); + return; + } + else + { + multi->setName(core()->intern(index)); + } + } + else + { + multi->setName(core()->intern(index)); + } + + toplevel()->setproperty(obj, multi, value, vtable); + } + + Atom MethodEnv::delpropertyHelper(Atom obj, Multiname *multi, Atom index) + { + AvmCore* core = this->core(); + + if (AvmCore::isObject(obj) && AvmCore::isObject(index)) + { + if( core->isXMLList(index) ) + { + // Error according to E4X spec, section 11.3.1 + toplevel()->throwTypeError(kDeleteTypeError, core->toErrorString(toplevel()->toTraits(index))); + } + ScriptObject* i = AvmCore::atomToScriptObject(index); + if (i->traits() == core->traits.qName_itraits) + { + QNameObject* qname = (QNameObject*) i; + qname->getMultiname(*multi); + } + else if(!multi->isRtns() && core->isDictionary(obj)) + { + bool res = AvmCore::atomToScriptObject(obj)->deleteProperty(index); + return res ? trueAtom : falseAtom; + } + else + { + multi->setName(core->intern(index)); + } + } + else + { + multi->setName(core->intern(index)); + } + + return delproperty(obj, multi); + } + + void MethodEnv::initMultinameLateForDelete(Multiname& name, Atom index) + { + AvmCore *core = this->core(); + + if (AvmCore::isObject(index)) + { + if (core->isXMLList(index)) + { + // Error according to E4X spec, section 11.3.1 + toplevel()->throwTypeError(kDeleteTypeError, core->toErrorString(toplevel()->toTraits(index))); + } + + ScriptObject* i = AvmCore::atomToScriptObject(index); + if (i->traits() == core->traits.qName_itraits) + { + QNameObject* qname = (QNameObject*) i; + bool attr = name.isAttr(); + qname->getMultiname(name); + if (attr) + name.setAttr(attr); + return; + } + } + + name.setName(core->intern(index)); + } + + ScriptObject* MethodEnv::newcatch(Traits* traits) + { + AvmCore* core = this->core(); + Toplevel* toplevel = this->toplevel(); + if (traits == core->traits.object_itraits) + { + // don't need temporary vtable. this is a scope for a finally clause + // todo: asc shouldn't even call OP_newcatch in a finally clause + return toplevel->objectClass->construct(); + } + else + { + VTable *vt = core->newVTable(traits, NULL, vtable->scope, vtable->abcEnv, toplevel); + vt->resolveSignatures(); + return core->newObject(vt, NULL); + } + } + + ArrayObject* MethodEnv::createArgumentsHelper(int argc, va_list ap) + { + // create arguments using argv[1..argc]. + // Even tho E3 says create an Object, E4 says create an Array so thats what we will do. + AvmAssert(argc >= 0); + Atom* atomv = (Atom*) alloca((argc+1) * sizeof(Atom)); + method->boxArgs(argc, ap, atomv); + return createArguments(atomv, argc); + } + + ArrayObject* MethodEnv::createRestHelper(int argc, va_list ap) + { + // create rest Array using argv[param_count..argc] + #ifdef AVMPLUS_WIN32 + Atom* extra = (Atom*) (method->restOffset + (char*)&va_arg(ap, int)); + #else + Atom* extra = (Atom*) (method->restOffset + (char*)ap); + #endif /* AVMPLUS_IA32 */ + int extra_count = argc > method->param_count ? argc - method->param_count : 0; + return toplevel()->arrayClass->newarray(extra, extra_count); + } + +#endif // AVMPLUS_MIR + + Atom MethodEnv::getpropertylate_i(Atom obj, int index) const + { + // here we put the case for bind-none, since we know there are no bindings + // with numeric names. + if ((obj&7) == kObjectType) + { + if (index >= 0) + { + // try dynamic lookup on instance. even if the traits are sealed, + // we might need to search the prototype chain + return AvmCore::atomToScriptObject(obj)->getUintProperty(index); + } + else + { + // negative - we must intern the integer + return AvmCore::atomToScriptObject(obj)->getProperty(method->core()->internInt(index)->atom()); + } + } + else + { + // primitive types are not dynamic, so we can go directly + // to their __proto__ object + AvmCore* core = method->core(); + Toplevel *toplevel = this->toplevel(); + ScriptObject *protoObject = toplevel->toPrototype(obj); + return protoObject->ScriptObject::getPropertyFromProtoChain(core->internInt(index), protoObject, toplevel->toTraits(obj)); + } + } + + Atom MethodEnv::getpropertylate_u(Atom obj, uint32 index) const + { + // here we put the case for bind-none, since we know there are no bindings + // with numeric names. + if ((obj&7) == kObjectType) + { + // try dynamic lookup on instance. even if the traits are sealed, + // we might need to search the prototype chain + return AvmCore::atomToScriptObject(obj)->getUintProperty(index); + } + else + { + // primitive types are not dynamic, so we can go directly + // to their __proto__ object + AvmCore* core = method->core(); + Toplevel *toplevel = this->toplevel(); + ScriptObject *protoObject = toplevel->toPrototype(obj); + return protoObject->ScriptObject::getPropertyFromProtoChain(core->internUint32(index), protoObject, toplevel->toTraits(obj)); + } + } + + ScriptObject* MethodEnv::finddef(Multiname* multiname) const + { + Toplevel* toplevel = vtable->toplevel; + + ScriptEnv* script = getScriptEnv(multiname); + if (script == (ScriptEnv*)BIND_AMBIGUOUS) + toplevel->throwReferenceError(kAmbiguousBindingError, multiname); + + if (script == (ScriptEnv*)BIND_NONE) + toplevel->throwReferenceError(kUndefinedVarError, multiname); + + ScriptObject* global = script->global; + if (!global) + { + global = script->initGlobal(); + Atom argv[1] = { global->atom() }; + script->coerceEnter(0, argv); + } + return global; + } + + ScriptEnv* MethodEnv::getScriptEnv(Multiname *multiname) const + { + ScriptEnv *se = (ScriptEnv*)abcEnv()->domainEnv->getScriptInit(multiname); + if(!se) + { + // check privates + se = (ScriptEnv*)abcEnv()->privateScriptEnvs.getMulti(multiname); + } + return se; + } + + ScriptObject* MethodEnv::finddefNsset(NamespaceSet* nsset, Stringp name) const + { + Multiname m(nsset); + m.setName(name); + return finddef(&m); + } + + ScriptObject* MethodEnv::finddefNs(Namespace* ns, Stringp name) const + { + Multiname m(ns, name); + return finddef(&m); + } + + ScriptObject* ScriptEnv::initGlobal() + { + // object not defined yet. define it by running the script that exports it + Traits* traits = vtable->traits; + vtable->resolveSignatures(); + NativeScriptInfo* nativeEntry = traits->getNativeScriptInfo(); + + Toplevel* toplevel = this->toplevel(); + traits->resolveSignatures(toplevel); + ScriptObject* delegate = toplevel->objectClass->prototype; + + if (nativeEntry != NULL) + { + // special script with native impl object + return global = nativeEntry->handler(vtable, delegate); + } + else + { + // ordinary user script + return global = (ScriptObject*) method->core()->newObject(vtable, delegate); + } + } + + ScriptObject* MethodEnv::op_newobject(Atom* sp, int argc) const + { + // pre-size the hashtable since we know how many vars are coming + VTable* object_vtable = toplevel()->object_vtable; + AvmCore* core = method->core(); + + ScriptObject* o = new (core->GetGC(), object_vtable->getExtraSize()) + ScriptObject(object_vtable, toplevel()->objectClass->prototype, + 2*argc+1); + + for (; argc-- > 0; sp -= 2) + { + Atom name = sp[-1]; + //verifier should ensure names are String + //todo have the verifier take care of interning too + AvmAssert(AvmCore::isString(name)); + + o->setProperty(core->internString(name)->atom(), sp[0]); + } +#ifdef DEBUGGER + if( core->allocationTracking ) + { + toplevel()->objectClass->addInstance(o->atom()); + } +#endif + return o; + } + + + + Atom MethodEnv::nextname(Atom objAtom, int index) const + { + if (index <= 0) + return nullStringAtom; + + switch (objAtom&7) + { + case kObjectType: + return AvmCore::atomToScriptObject(objAtom)->nextName(index); + case kNamespaceType: + return AvmCore::atomToNamespace(objAtom)->nextName(method->core(), index); + default: + ScriptObject* proto = toplevel()->toPrototype(objAtom); // cn: types like Number are sealed, but their prototype could have dynamic properties + return proto ? proto->nextName(index) : undefinedAtom; + } + } + + Atom MethodEnv::nextvalue(Atom objAtom, int index) const + { + if (index <= 0) + return undefinedAtom; + + switch (objAtom&7) + { + case kObjectType: + return AvmCore::atomToScriptObject(objAtom)->nextValue(index); + case kNamespaceType: + return AvmCore::atomToNamespace(objAtom)->nextValue(index); + default: + ScriptObject* proto = toplevel()->toPrototype(objAtom); + return (proto ? proto->nextValue(index) : undefinedAtom); + } + } + + int MethodEnv::hasnext(Atom objAtom, int index) const + { + if (index < 0) + return 0; + + if (!AvmCore::isNullOrUndefined(objAtom)) + { + switch (objAtom&7) + { + case kObjectType: + return AvmCore::atomToScriptObject(objAtom)->nextNameIndex(index); + case kNamespaceType: + return AvmCore::atomToNamespace(objAtom)->nextNameIndex(index); + default: + ScriptObject* proto = toplevel()->toPrototype(objAtom); + int nextIndex = ( proto ? proto->nextNameIndex(index) : 0); + return nextIndex; + } + } + else + { + return 0; + } + } + + int MethodEnv::hasnext2(Atom& objAtom, int& index) const + { + if (index < 0) + return 0; + + ScriptObject *delegate = NULL; + + if (!AvmCore::isNullOrUndefined(objAtom)) + { + switch (objAtom&7) + { + case kObjectType: + { + ScriptObject *object = AvmCore::atomToScriptObject(objAtom); + delegate = object->getDelegate(); + index = object->nextNameIndex(index); + } + break; + case kNamespaceType: + { + index = AvmCore::atomToNamespace(objAtom)->nextNameIndex(index); + delegate = toplevel()->namespaceClass->prototype; + } + break; + default: + { + ScriptObject* proto = toplevel()->toPrototype(objAtom); + delegate = proto ? proto->getDelegate() : NULL; + index = ( proto ? proto->nextNameIndex(index) : 0); + } + } + } + else + { + index = 0; + } + + while (index == 0 && delegate != NULL) + { + // Advance to next object on prototype chain + ScriptObject *object = delegate; + objAtom = object->atom(); + delegate = object->getDelegate(); + index = object->nextNameIndex(index); + } + + if (index == 0) + { + // If we're done, set object local to null + objAtom = nullObjectAtom; + } + + return index != 0; + } + + Atom MethodEnv::in(Atom nameatom, Atom obj) const + { + AvmCore* core = method->core(); + Traits *t = toplevel()->toTraits(obj); // includes null check + + if(!core->isDictionaryLookup(nameatom, obj)) + { + Stringp name = core->intern(nameatom); + + // ISSUE should we try this on each object on the proto chain or just the first? + if (t->findBinding(name, core->publicNamespace) != BIND_NONE) + { + return trueAtom; + } + + nameatom = name->atom(); + } + + ScriptObject* o = (obj&7)==kObjectType ? AvmCore::atomToScriptObject(obj) : + toplevel()->toPrototype(obj); + do + { + if (o->hasProperty(nameatom)) + return trueAtom; + } + while ((o = o->getDelegate()) != NULL); + return falseAtom; + } + + // see 13.2 creating function objects + ClassClosure* MethodEnv::newfunction(AbstractFunction *function, + ScopeChain* outer, + Atom* scopes) const + { + AvmCore* core = this->core(); + AbcEnv* abcEnv = vtable->abcEnv; + + // TODO: if we have already created a function and the scope chain + // is the same as last time, re-use the old closure? + + // declaringTraits must have been filled in by verifier. + Traits* ftraits = function->declaringTraits; + AvmAssert(ftraits != NULL); + AvmAssert(ftraits->scope != NULL); + + ScopeChain* scope = ScopeChain::create(core->GetGC(), ftraits->scope, outer, *core->dxnsAddr); + + for (int i=outer->getSize(), n=scope->getSize(); i < n; i++) + { + scope->setScope(i, *scopes++); + } + + FunctionClass* functionClass = toplevel()->functionClass; + + // the vtable for the new function object + VTable* fvtable = core->newVTable(ftraits, functionClass->ivtable(), scope, abcEnv, toplevel()); + fvtable->resolveSignatures(); + FunctionEnv *fenv = new (core->GetGC()) FunctionEnv(function, fvtable); + fvtable->call = fenv; + fvtable->ivtable = toplevel()->object_vtable; + + ClassClosure* c = new (core->GetGC(), fvtable->getExtraSize()) ClassClosure(fvtable); + c->setDelegate( functionClass->prototype ); + + c->createVanillaPrototype(); + c->prototype->setProperty(core->kconstructor, c->atom()); + c->prototype->setPropertyIsEnumerable(core->kconstructor, false); + + fenv->closure = c; + + return c; + } + + /** + * given a classInfo, create a new ClassClosure object and return it on the stack. + */ + + ClassClosure* MethodEnv::newclass(AbstractFunction* cinit, + ClassClosure *base, + ScopeChain* outer, + Atom* scopes) const + { + AvmCore* core = this->core(); + Toplevel* toplevel = this->toplevel(); + + Traits* ctraits = cinit->declaringTraits; + Traits* itraits = ctraits->itraits; + + // finish resolving the base class + if (!base && itraits->base) + { + // class has a base but no base object was provided + ErrorClass *error = toplevel->typeErrorClass(); + if( error ) + error->throwError(kConvertNullToObjectError); + else + toplevel->throwTypeError(kCorruptABCError); + } + + // make sure the traits of the base vtable matches the base traits + if (!(base == NULL && itraits->base == NULL || base != NULL && itraits->base == base->ivtable()->traits)) + { + ErrorClass *error = toplevel->verifyErrorClass(); + if( error ) + error->throwError(kInvalidBaseClassError); + else + toplevel->throwTypeError(kCorruptABCError); + } + + ctraits->resolveSignatures(toplevel); + itraits->resolveSignatures(toplevel); + + // class scopechain = [..., class] + ScopeChain* cscope = ScopeChain::create(core->GetGC(), ctraits->scope, outer, *core->dxnsAddr); + + int staticScopesCount = 0; + + int i = outer->getSize(); + for (int n=cscope->getSize()-staticScopesCount; i < n; i++) + { + cscope->setScope(i, *scopes++); + } + + ScopeChain* iscope = ScopeChain::create(core->GetGC(), itraits->scope, cscope, *core->dxnsAddr); + + AbcEnv *abcEnv = vtable->abcEnv; + VTable* cvtable = core->newVTable(ctraits, toplevel->class_vtable, cscope, abcEnv, toplevel); + cvtable->resolveSignatures(); + VTable* ivtable = core->newVTable(itraits, base ? base->ivtable() : NULL, iscope, abcEnv, toplevel); + ivtable->resolveSignatures(); + cvtable->ivtable = ivtable; + + if (itraits == core->traits.object_itraits) { + // we just defined Object + toplevel->object_vtable = ivtable; + } + else if (itraits == core->traits.class_itraits) { + // we just defined Class + toplevel->class_vtable = ivtable; + cvtable->base = ivtable; + toplevel->objectClass->vtable->base = ivtable; + } + + NativeClassInfo* nativeEntry; + ClassClosure *cc; + if ((nativeEntry = cvtable->traits->getNativeClassInfo()) != NULL) + { + cc = nativeEntry->handler(cvtable); + } + else + { + cc = new (core->GetGC(), cvtable->getExtraSize()) ClassClosure(cvtable); + AvmAssert(cc->prototype == NULL); + cc->createVanillaPrototype(); + } + + if (cc->prototype) + { + // C.prototype.__proto__ = Base.prototype + if (base != NULL) + cc->prototype->setDelegate( base->prototype ); + + // C.prototype.constructor = C {DontEnum} + cc->prototype->setProperty(core->kconstructor, cc->atom()); + cc->prototype->setPropertyIsEnumerable(core->kconstructor, false); + } + + AvmAssert(i == iscope->getSize()-1); + iscope->setScope(i, cc->atom()); + if (toplevel->classClass) + { + cc->setDelegate( toplevel->classClass->prototype ); + } + +#ifdef DEBUGGER + if(toplevel->classClass && core->allocationTracking) + { + toplevel->classClass->addInstance(cc->atom()); + } +#endif + + // Invoke the class init function. + Atom argv[1] = { cc->atom() }; + cvtable->init->coerceEnter(0, argv); + return cc; + } + + void MethodEnv::initproperty(Atom obj, Multiname* multiname, Atom value, VTable* vtable) const + { + Toplevel* toplevel = this->toplevel(); + Binding b = toplevel->getBinding(vtable->traits, multiname); + if ((b&7) == BIND_CONST) + { + if (vtable->init != this) + toplevel->throwReferenceError(kConstWriteError, multiname, vtable->traits); + b = (b & ~7) | BIND_VAR; + } + toplevel->setproperty_b(obj, multiname, value, vtable, b); + } + + void MethodEnv::setpropertylate_i(Atom obj, int index, Atom value) const + { + if (AvmCore::isObject(obj)) + { + ScriptObject* o = AvmCore::atomToScriptObject(obj); + if (index >= 0) + { + o->setUintProperty(index, value); + } + else + { + // negative index - we must intern the integer + o->setProperty(method->core()->internInt(index)->atom(), value); + } + } + else + { + // obj represents a primitive Number, Boolean, int, or String, and primitives + // are sealed and final. Cannot add dynamic vars to them. + + // throw a ReferenceError exception — Property not found and could not be created. + Multiname tempname(core()->publicNamespace, core()->internInt(index)); + toplevel()->throwReferenceError(kWriteSealedError, &tempname, toplevel()->toTraits(obj)); + } + } + + void MethodEnv::setpropertylate_u(Atom obj, uint32 index, Atom value) const + { + if (AvmCore::isObject(obj)) + { + AvmCore::atomToScriptObject(obj)->setUintProperty(index, value); + } + else + { + // obj represents a primitive Number, Boolean, int, or String, and primitives + // are sealed and final. Cannot add dynamic vars to them. + + // throw a ReferenceError exception — Property not found and could not be created. + Multiname tempname(core()->publicNamespace, core()->internUint32(index)); + toplevel()->throwReferenceError(kWriteSealedError, &tempname, toplevel()->toTraits(obj)); + } + } + + Atom MethodEnv::callsuper(Multiname* multiname, int argc, Atom* atomv) const + { + VTable* base = vtable->base; + Toplevel* toplevel = this->toplevel(); + Binding b = toplevel->getBinding(base->traits, multiname); + switch (b&7) + { + default: + toplevel->throwReferenceError(kCallNotFoundError, multiname, base->traits); + + case BIND_METHOD: + { + #ifdef DEBUG_EARLY_BINDING + core()->console << "callsuper method " << base->traits << " " << multiname->name << "\n"; + #endif + MethodEnv* superenv = base->methods[AvmCore::bindingToMethodId(b)]; + return superenv->coerceEnter(argc, atomv); + } + case BIND_VAR: + case BIND_CONST: + { + #ifdef DEBUG_EARLY_BINDING + core()->console << "callsuper slot " << base->traits << " " << multiname->name << "\n"; + #endif + uint32 slot = AvmCore::bindingToSlotId(b); + Atom method = AvmCore::atomToScriptObject(atomv[0])->getSlotAtom(slot); + return toplevel->op_call(method, argc, atomv); + } + case BIND_SET: + { + #ifdef DEBUG_EARLY_BINDING + core()->console << "callsuper setter " << base->traits << " " << multiname->name << "\n"; + #endif + // read on write-only property + toplevel->throwReferenceError(kWriteOnlyError, multiname, base->traits); + } + case BIND_GET: + case BIND_GETSET: + { + #ifdef DEBUG_EARLY_BINDING + core()->console << "callsuper getter " << base->traits << " " << multiname->name << "\n"; + #endif + // Invoke the getter + int m = AvmCore::bindingToGetterId(b); + MethodEnv *f = base->methods[m]; + Atom atomv_out[1] = { atomv[0] }; + Atom method = f->coerceEnter(0, atomv_out); + return toplevel->op_call(method, argc, atomv); + } + } + } + + Atom MethodEnv::delproperty(Atom obj, Multiname* multiname) const + { + Toplevel* toplevel = this->toplevel(); + Traits* traits = toplevel->toTraits(obj); // includes null check + if (AvmCore::isObject(obj)) + { + Binding b = toplevel->getBinding(traits, multiname); + if (b == BIND_NONE) + { + bool b = AvmCore::atomToScriptObject(obj)->deleteProperty(multiname); + return b ? trueAtom : falseAtom; + } + else if (AvmCore::isMethodBinding(b)) + { + if (multiname->contains(core()->publicNamespace) && toplevel->isXmlBase(obj)) + { + // dynamic props should hide declared methods on delete + ScriptObject* so = AvmCore::atomToScriptObject(obj); + bool b = so->deleteProperty(multiname); + return b ? trueAtom : falseAtom; + } + } + } + else + { + toplevel->throwReferenceError(kDeleteSealedError, multiname, traits); + } + + return falseAtom; + } + + Atom MethodEnv::getsuper(Atom obj, Multiname* multiname) const + { + VTable* vtable = this->vtable->base; + Toplevel* toplevel = this->toplevel(); + Binding b = toplevel->getBinding(vtable->traits, multiname); + switch (b&7) + { + default: + toplevel->throwReferenceError(kReadSealedError, multiname, vtable->traits); + + case BIND_METHOD: + { + #ifdef DEBUG_EARLY_BINDING + core->console << "getsuper method " << vtable->traits << " " << multiname->name << "\n"; + #endif + // extracting a virtual method + MethodEnv *m = vtable->methods[AvmCore::bindingToMethodId(b)]; + return toplevel->methodClosureClass->create(m, obj)->atom(); + } + + case BIND_VAR: + case BIND_CONST: + #ifdef DEBUG_EARLY_BINDING + core->console << "getsuper slot " << vtable->traits << " " << multiname->name << "\n"; + #endif + return AvmCore::atomToScriptObject(obj)->getSlotAtom(AvmCore::bindingToSlotId(b)); + + case BIND_SET: + { + #ifdef DEBUG_EARLY_BINDING + core->console << "getsuper setter " << vtable->traits << " " << multiname->name << "\n"; + #endif + // read on write-only property + toplevel->throwReferenceError(kWriteOnlyError, multiname, vtable->traits); + } + case BIND_GET: + case BIND_GETSET: + { + #ifdef DEBUG_EARLY_BINDING + core->console << "getsuper getter " << vtable->traits << " " << multiname->name << "\n"; + #endif + // Invoke the getter + int m = AvmCore::bindingToGetterId(b); + MethodEnv *f = vtable->methods[m]; + Atom atomv_out[1] = { obj }; + return f->coerceEnter(0, atomv_out); + } + } + } + + + void MethodEnv::setsuper(Atom obj, Multiname* multiname, Atom value) const + { + VTable* vtable = this->vtable->base; + Toplevel* toplevel = this->toplevel(); + Binding b = toplevel->getBinding(vtable->traits, multiname); + switch (b&7) + { + default: + toplevel->throwReferenceError(kWriteSealedError, multiname, vtable->traits); + + case BIND_CONST: + toplevel->throwReferenceError(kConstWriteError, multiname, vtable->traits); + + case BIND_METHOD: + toplevel->throwReferenceError(kCannotAssignToMethodError, multiname, vtable->traits); + + case BIND_GET: + #ifdef DEBUG_EARLY_BINDING + core()->console << "setsuper getter " << vtable->traits << " " << multiname->name << "\n"; + #endif + toplevel->throwReferenceError(kConstWriteError, multiname, vtable->traits); + + case BIND_VAR: + #ifdef DEBUG_EARLY_BINDING + core()->console << "setsuper slot " << vtable->traits << " " << multiname->name << "\n"; + #endif + AvmCore::atomToScriptObject(obj)->setSlotAtom(AvmCore::bindingToSlotId(b), value); + return; + + case BIND_SET: + case BIND_GETSET: + { + #ifdef DEBUG_EARLY_BINDING + core()->console << "setsuper setter " << vtable->traits << " " << multiname->name << "\n"; + #endif + // Invoke the setter + uint32 m = AvmCore::bindingToSetterId(b); + AvmAssert(m < vtable->traits->methodCount); + MethodEnv* method = vtable->methods[m]; + Atom atomv_out[2] = { obj, value }; + // coerce value to proper type, then call enter + method->coerceEnter(1, atomv_out); + return; + } + } + } + + Atom MethodEnv::findWithProperty(Atom atom, Multiname* multiname) + { + Toplevel* toplevel = this->toplevel(); + if ((atom&7)==kObjectType) + { + // usually scope objects are ScriptObject's + + ScriptObject* o = AvmCore::atomToScriptObject(atom); + + // search the delegate chain for a value. we must look at + // traits at each step along the way in case we have class + // instances on the scope chain + do + { + // ISSUE it is incorrect to return a reference to an object on the prototype + // chain, we should only return the scopechain object; the next operation + // could be a setproperty, and we don't want to mutate prototype objects this way. + + // look at the traits first, stop if found. + Binding b = toplevel->getBinding(o->traits(), multiname); + if (b != BIND_NONE) + return atom; + if (o->hasProperty(multiname)) + return atom; + } + while ((o = o->getDelegate()) != NULL); + } + else + { + // primitive value on scope chain! + + // first iteration looks at traits only since primitive values don't have + // dynamic variables + + Binding b = toplevel->getBinding(toplevel->toTraits(atom), multiname); + if (b != BIND_NONE) + return atom; + + // then we continue starting at the prototype for this primitive type + ScriptObject* o = toplevel->toPrototype(atom); + do + { + Binding b = toplevel->getBinding(o->traits(), multiname); + if (b != BIND_NONE) + return atom; + if (o->hasProperty(multiname)) + return atom; + } + while ((o = o->getDelegate()) != NULL); + } + + return nullObjectAtom; + } + + /** + * return the object on the scope chain that owns the given property. + * if no object has that property, return scope[0]. we search each + * delegate chain but only return objects that are on the scope chain. + * this way, find+get and find+set are both correct. find+set should + * not mutate a prototype object. + */ + Atom MethodEnv::findproperty(ScopeChain* outer, + Atom* scopes, + int extraScopes, + Multiname* multiname, + bool strict, + Atom* withBase) + { + Toplevel* toplevel = this->toplevel(); + + // look in each with frame in the current stack frame + Atom* scopep = &scopes[extraScopes-1]; + if (withBase) + { + for (; scopep >= withBase; scopep--) + { + Atom result = findWithProperty(*scopep, multiname); + if (!AvmCore::isNull(result)) + { + return result; + } + } + } + + // if we're in global$init (outer_depth==0), don't check "this" scope just yet. + int outer_depth = outer->getSize(); + for (; scopep > scopes; scopep--) + { + Atom a = *scopep; + Traits* t = toplevel->toTraits(a); + Binding b = toplevel->getBinding(t, multiname); + if (b != BIND_NONE) + return a; + } + + ScopeTypeChain* outerTraits = outer->scopeTraits; + + if (outer_depth > 0 && scopep >= scopes) + { + // consider "this" scope now, but constrain it to the declaringTraits of + // the current method (verifier ensures this is safe) + Atom a = *scopep; + Traits *t; + if (outerTraits->fullsize > outerTraits->size) + { + // scope traits has extra constraint for "this" scope, see OP_newclass in verifier + t = outerTraits->scopes[outerTraits->size].traits; + } + else + { + // "this" scope type is the runtime type + t = toplevel->toTraits(a); + } + + Binding b = toplevel->getBinding(t, multiname); + if (b != BIND_NONE) + return a; + } + + // now search outer scopes + for (int i=outer_depth-1; i > 0; i--) + { + if (outerTraits->scopes[i].isWith) + { + Atom result = findWithProperty(outer->getScope(i), multiname); + if (!AvmCore::isNull(result)) + return result; + } + else + { + // only look at the properties on the captured (verify time) type, not the actual type, + // of the outer scope object. + Atom a = outer->getScope(i); + Traits* t = outerTraits->scopes[i].traits; + Binding b = toplevel->getBinding(t, multiname); + if (b != BIND_NONE) + return a; + } + } + + // No imported definitions or global scope can have attributes. (Using filter + // operator with non existent attribute will get here. + if (multiname->isAttr()) + { + if (strict) + toplevel->throwReferenceError(kUndefinedVarError, multiname); + return undefinedAtom; + } + + // now we have searched all the scopes, except global + + // look for imported definition (similar logic to OP_finddef). This will + // find definitions in this script and in other scripts. + ScriptEnv* script = getScriptEnv(multiname); + if (script != (ScriptEnv*)BIND_NONE) + { + if (script == (ScriptEnv*)BIND_AMBIGUOUS) + toplevel->throwReferenceError(kAmbiguousBindingError, multiname); + + ScriptObject* global = script->global; + if (global == NULL) + { + global = script->initGlobal(); + Atom argv[1] = { script->global->atom() }; + script->coerceEnter(0, argv); + } + return global->atom(); + } + + // no imported definition found. look for dynamic props + // on the global object + + ScriptObject* global = AvmCore::atomToScriptObject( + outer_depth > 0 ? outer->getScope(0) : *scopes + ); + + // search the delegate chain for a value. The delegate + // chain for the global object will only contain vanilla + // objects (Object.prototype) so we can skip traits + + ScriptObject* o = global; + do + { + if (o->hasProperty(multiname)) + return global->atom(); + } + while ((o = o->getDelegate()) != NULL); + + // If a variable cannot be found + // throw reference error if strict + + if (strict) + toplevel->throwReferenceError(kUndefinedVarError, multiname); + + return global->atom(); + } + + Namespace* MethodEnv::internRtns(Atom nsAtom) + { + if ((nsAtom&7) != kNamespaceType) + toplevel()->throwTypeError(kIllegalNamespaceError); + return core()->internNamespace(AvmCore::atomToNamespace(nsAtom)); + } + + ArrayObject* MethodEnv::createArguments(Atom *atomv, int argc) + { + Toplevel* toplevel = this->toplevel(); + ArrayObject *arguments = toplevel->arrayClass->newarray(atomv+1,argc); + ScriptObject *closure; + if (method->flags & AbstractFunction::NEED_CLOSURE) + { + closure = toplevel->methodClosureClass->create(this, atomv[0]); + } + else + { + closure = ((FunctionEnv*)this)->closure; + } + arguments->setProperty(core()->kcallee, closure->atom()); + arguments->setPropertyIsEnumerable(core()->kcallee, false); + return arguments; + } + + Atom MethodEnv::getdescendants(Atom obj, Multiname* multiname) + { + if (AvmCore::isObject (obj)) + { + return core()->atomToScriptObject(obj)->getDescendants (multiname); + } + else + { + // Rhino simply returns undefined for other Atom types + // SpiderMonkey throws TypeError. We're doing TypeError. + toplevel()->throwTypeError(kDescendentsError, core()->toErrorString(toplevel()->toTraits(obj))); + return undefinedAtom; // not reached + } + } + + Atom MethodEnv::getdescendantslate(Atom obj, Atom index, bool attr) + { + if (AvmCore::isObject(index)) + { + ScriptObject* i = AvmCore::atomToScriptObject(index); + if (i->traits() == core()->traits.qName_itraits) + { + QNameObject* qname = (QNameObject*) i; + Multiname n2; + qname->getMultiname(n2); + if (attr) + n2.setAttr(attr); + return getdescendants(obj, &n2); + } + } + + // convert index to string + + AvmCore* core = this->core(); + Multiname name(core->publicNamespace, core->intern(index)); + if (attr) + name.setAttr(); + return getdescendants(obj, &name); + } + + void MethodEnv::checkfilter(Atom obj) + { + if ( !toplevel()->isXmlBase(obj) ) + { + toplevel()->throwTypeError(kFilterError, core()->toErrorString(toplevel()->toTraits(obj))); + } + } + + + /** + * implements ECMA implicit coersion. returns the coerced value, + * or throws a TypeError if coersion is not possible. + */ + ScriptObject* MethodEnv::coerceAtom2SO(Atom atom, Traits* expected) const + { + AvmAssert(expected != NULL); + AvmAssert(!expected->isMachineType); + AvmAssert(expected != core()->traits.string_itraits); + AvmAssert(expected != core()->traits.namespace_itraits); + + if (AvmCore::isNullOrUndefined(atom)) + return NULL; + + ScriptObject *so; + if ((atom&7) == kObjectType && + (so=AvmCore::atomToScriptObject(atom))->traits()->containsInterface(expected)) + { + return so; + } + else + { + // failed +#ifdef AVMPLUS_VERBOSE + //core->console << "checktype failed " << expected << " <- " << atom << "\n"; +#endif + toplevel()->throwTypeError(kCheckTypeFailedError, core()->atomToErrorString(atom), core()->toErrorString(expected)); + return NULL; + } + } + + /** + * implements ECMA as operator. Returns the same value, or null. + */ + Atom MethodEnv::astype(Atom atom, Traits* expected) + { + return core()->istype(atom, expected) ? atom : nullObjectAtom; + } + + VTable *MethodEnv::getActivation() + { + int type = getType(); + switch(type) + { + case kActivation: + return (VTable *)(activationOrMCTable&~3); + case kActivationMethodTablePair: + return getPair()->activation; + default: + return NULL; + } + } + + WeakKeyHashtable *MethodEnv::getMethodClosureTable() + { + int type = getType(); + if(!activationOrMCTable) + { + WeakKeyHashtable *wkh = new (core()->GetGC()) WeakKeyHashtable(core()->GetGC()); + setActivationOrMCTable(wkh, kMethodTable); + return wkh; + } + else if(type == kActivation) + { + WeakKeyHashtable *wkh = new (core()->GetGC()) WeakKeyHashtable(core()->GetGC()); + ActivationMethodTablePair *amtp = new (core()->GetGC()) ActivationMethodTablePair(getActivation(), wkh); + setActivationOrMCTable(amtp, kActivationMethodTablePair); + return wkh; + } + else if(type == kActivationMethodTablePair) + { + return getPair()->methodTable; + } + return (WeakKeyHashtable*)(activationOrMCTable&~3); + } +} diff --git a/mozilla/js/tamarin/core/MethodEnv.h b/mozilla/js/tamarin/core/MethodEnv.h new file mode 100644 index 00000000000..fb213f29c91 --- /dev/null +++ b/mozilla/js/tamarin/core/MethodEnv.h @@ -0,0 +1,295 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_MethodEnv__ +#define __avmplus_MethodEnv__ + + +namespace avmplus +{ + class MethodEnv : public MMgc::GCObject + { + static int delegateInvoke(MethodEnv* env, int argc, va_list ap); + + public: + // pointers are write-once so we don't need WB's + + /** the vtable for the scope where this env was declared */ + VTable* const vtable; + + /** runtime independent type info for this method */ + AbstractFunction* const method; + + /** vtable for the activation scope inside this method */ + VTable *getActivation(); + + /** getter lazily creates table which maps SO->MC */ + WeakKeyHashtable *getMethodClosureTable(); + + // pointer to invoke trampoline + union { + int (*impl32)(MethodEnv*, int, va_list); + double (*implN)(MethodEnv*, int, va_list); + }; + + MethodEnv(void* addr, VTable *vtable); + MethodEnv(AbstractFunction* method, VTable *vtable); + + Toplevel* toplevel() const + { + return vtable->toplevel; + } + + AbcEnv* abcEnv() const + { + return vtable->abcEnv; + } + + ScriptEnv* getScriptEnv(Multiname *m) const; + + DomainEnv* domainEnv() const + { + return vtable->abcEnv->domainEnv; + } + + AvmCore* core() const + { + return method->pool->core; + } + + /** + * Coerces an array of actual parameters to the types + * required by a function's formal parameters, then invokes + * the method. Args are provided as an array of atoms, not + * an array of native types. + * + * @param instance The "this" that the function + * is being invoked with; may be + * coerced by this method. + * @param argv The array of arguments to coerce + * @param argc The number of arguments + * @throws Exception May throw an ArgumentError or + * TypeError if an argument cannot be coerced + * to the required type + */ + Atom coerceEnter(int argc, Atom* atomv); + void unboxCoerceArgs(int argc, Atom* in, va_list ap); + + // helper functions used from compiled code + public: + /** null pointer check */ + void nullcheck(Atom atom); + void npe(); + void interrupt(); + + /** returns the instance traits of the factorytype of the passed atom */ + Traits* toClassITraits(Atom atom); + + ArrayObject* createRest(Atom* argv, int argc); + Atom getpropertylate_i(Atom obj, int index) const; + Atom getpropertylate_u(Atom obj, uint32 index) const; + +#ifdef AVMPLUS_MIR + void setpropertyHelper(Atom obj, Multiname *multi, Atom value, VTable *vtable, Atom index); + void initpropertyHelper(Atom obj, Multiname *multi, Atom value, VTable *vtable, Atom index); + Atom getpropertyHelper(Atom obj, Multiname *multi, VTable *vtable, Atom index); + Atom delpropertyHelper(Atom obj, Multiname *multi, Atom index); + + void initMultinameLateForDelete(Multiname& name, Atom index); + ScriptObject* newcatch(Traits *traits); + ArrayObject* createArgumentsHelper(int argc, va_list ap); + ArrayObject* createRestHelper(int argc, va_list ap); +#endif + + /** + * used for defining and resolving imported definitions. + */ + ScriptObject* finddef(Multiname* name) const; + ScriptObject* finddefNsset(NamespaceSet* nsset, Stringp name) const; + ScriptObject* finddefNs(Namespace* ns, Stringp name) const; + + /** + * implementation of object initializers + */ + ScriptObject* op_newobject(Atom* sp, int argc) const; + + /** Implementation of OP_nextname */ + Atom nextname(Atom objAtom, int index) const; + + /** Implementation of OP_nextvalue */ + Atom nextvalue(Atom objAtom, int index) const; + + /** Implementation of OP_hasnext */ + int hasnext(Atom objAtom, int index) const; + + /** Implementation of OP_hasnext2 */ + int hasnext2(Atom& objAtom, int& index) const; + + /** + * operator in from ES3 + */ + Atom in(Atom name, Atom obj) const; + + /** + * OP_newfunction + * see 13.2 creating function objects + */ + ClassClosure* newfunction(AbstractFunction *function, + ScopeChain* outer, + Atom* scopes) const; + + /** + * OP_newclass + */ + + ClassClosure* newclass(AbstractFunction* cinit, + ClassClosure* base, + ScopeChain* outer, + Atom* scopes) const; + + void initproperty(Atom obj, Multiname* multiname, Atom value, VTable* vtable) const; + void setpropertylate_i(Atom obj, int index, Atom value) const; + void setpropertylate_u(Atom obj, uint32 index, Atom value) const; + + /** same as callproperty but only considers the bindings in given vtable */ + Atom callsuper(Multiname* name, int argc, Atom* atomv) const; + + Atom delproperty(Atom obj, Multiname* multiname) const; + + /** + * Reads a property from an object, with the property + * to retrieve specified by its binding. + * The binding was likely retrieved using getBinding. + * @param obj Object to retrieve property from + * @param b The binding of the property + * @param traits The traits of the object + */ + Atom getsuper(Atom obj, Multiname* name) const; + + /** + * Write to a property of an object, with the property + * to modify specified by its binding. + * The binding was likely retrieved using getBinding. + * @param obj Object to modify property of + * @param b The binding of the property + * @param value The new value of the property + */ + void setsuper(Atom obj, Multiname* name, Atom value) const; + + /** Implementation of OP_findproperty */ + Atom findproperty(ScopeChain* outer, + Atom* scopes, + int extraScopes, + Multiname* multiname, + bool strict, + Atom* withBase); + + Namespace* internRtns(Atom ns); + + /** Creates the arguments array */ + ArrayObject* createArguments(Atom *atomv, int argc); + + /** + * E4X descendants operator (..) + */ + Atom getdescendants(Atom obj, Multiname* multiname); + Atom getdescendantslate(Atom obj, Atom name, bool attr); + + /** + * E4X filter operator + */ + void checkfilter(Atom obj); + + ScriptObject* coerceAtom2SO(Atom atom, Traits *expected) const; + + /** + * same as coerce, but returns coerced undefined instead + * of throwing an exception + */ + Atom astype(Atom atom, Traits* expected); + +#ifdef DEBUGGER + void debugEnter(int argc, va_list ap, + Traits**frameTraits, int localCount, + CallStackNode* callstack, + Atom* framep, volatile int *eip); + void debugExit(CallStackNode* callstack); + void sendEnter(int argc, va_list ap); + void sendExit(); +#endif + + private: + Atom findWithProperty(Atom obj, Multiname* multiname); + + class ActivationMethodTablePair + { + public: + ActivationMethodTablePair(VTable *a, WeakKeyHashtable*wkh) : + activation(a), methodTable(wkh) {} + VTable* const activation; + WeakKeyHashtable* const methodTable; + }; + intptr activationOrMCTable; + + // low 2 bits of activationOrMCTable + enum { kActivation=0, kMethodTable, kActivationMethodTablePair }; + + ActivationMethodTablePair *getPair() const { return (ActivationMethodTablePair*)(activationOrMCTable&~3); } + int getType() const { return activationOrMCTable&3; } + void setActivationOrMCTable(void *ptr, int type) + { + WB(core()->GetGC(), this, &activationOrMCTable, (intptr)ptr|type); + } + }; + + class ScriptEnv : public MethodEnv + { + public: + DRCWB(ScriptObject*) global; // initially null, set after initialization + ScriptEnv(AbstractFunction* method, VTable *vtable) + : MethodEnv(method, vtable) + { + } + + ScriptObject* initGlobal(); + + }; + + class FunctionEnv : public MethodEnv + { + public: + FunctionEnv(AbstractFunction* method, VTable *vtable) + : MethodEnv(method, vtable) {} + DRCWB(ClassClosure*) closure; + }; +} + +#endif // __avmplus_MethodEnv__ diff --git a/mozilla/js/tamarin/core/MethodInfo.cpp b/mozilla/js/tamarin/core/MethodInfo.cpp new file mode 100644 index 00000000000..9081b8d9e10 --- /dev/null +++ b/mozilla/js/tamarin/core/MethodInfo.cpp @@ -0,0 +1,330 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmplus.h" + +namespace avmplus +{ + using namespace MMgc; + MethodInfo::MethodInfo() + : AbstractFunction() + { + #ifdef DEBUGGER + this->local_count = 0; + this->max_scopes = 0; + this->localNames = 0; + this->firstSourceLine = 0; + this->lastSourceLine = 0; + this->offsetInAbc = 0; + #endif + this->impl32 = verifyEnter; + } + + int MethodInfo::verifyEnter(MethodEnv* env, int argc, va_list ap) + { + MethodInfo* f = (MethodInfo*) env->method; + + f->verify(env->vtable->toplevel); + + #ifdef AVMPLUS_VERIFYALL + f->flags |= VERIFIED; + if (f->pool->core->verifyall && f->pool) + f->pool->processVerifyQueue(env->toplevel()); + #endif + + env->impl32 = f->impl32; + return f->impl32(env, argc, ap); + } + + void MethodInfo::verify(Toplevel* toplevel) + { + AvmAssert(declaringTraits->linked); + resolveSignature(toplevel); + + #ifdef DEBUGGER + CallStackNode callStackNode(NULL, this, NULL, NULL, 0, NULL, NULL); + #endif /* DEBUGGER */ + + if (!body_pos) + { + // no body was supplied in abc + toplevel->throwVerifyError(kNotImplementedError, toplevel->core()->toErrorString(this)); + } + + #ifdef AVMPLUS_MIR + + Verifier verifier(this, toplevel); + + AvmCore* core = this->core(); + if (core->turbo && !isFlagSet(AbstractFunction::SUGGEST_INTERP)) + { + CodegenMIR mir(this); + verifier.verify(&mir); // pass 2 - data flow + if (!mir.overflow) + mir.emitMD(); // pass 3 - generate code + + // the MD buffer can overflow so we need to re-iterate + // over the whole thing, since we aren't yet robust enough + // to just rebuild the MD code. + + // mark it as interpreted and try to limp along + if (mir.overflow) + { + #ifdef AVMPLUS_INTERP + AvmCore* core = this->core(); + if (returnTraits() == NUMBER_TYPE) + implN = Interpreter::interpN; + else + impl32 = Interpreter::interp32; + #else + toplevel()->throwError(kOutOfMemoryError); + #endif //AVMPLUS_INTERP + } + } + else + { + verifier.verify(NULL); // pass2 dataflow + } + #else + Verifier verifier(this, toplevel); + verifier.verify(NULL); + #endif + + #ifdef DEBUGGER + callStackNode.exit(); + #endif /* DEBUGGER */ + } + + #ifdef DEBUGGER + + // reg names + Stringp MethodInfo::getLocalName(int index) const { return getRegName(index+param_count); } + Stringp MethodInfo::getArgName(int index) const { return getRegName(index); } + + Stringp MethodInfo::getRegName(int slot) const + { + AvmAssert(slot >= 0 && slot < local_count); + Stringp name; + if (localNames) + name = localNames[slot]; + else + name = core()->kundefined; + return name; + } + + void MethodInfo::setRegName(int slot, Stringp name) + { + //AvmAssert(slot >= 0 && slot < local_count); + // @todo fix me. This is a patch for bug #112405 + if (slot >= local_count) + return; + if (!localNames) + initLocalNames(); + + AvmCore* core = this->core(); + + // [mmorearty 5/3/05] temporary workaround for bug 123237: if the register + // already has a name, don't assign a new one + if (getRegName(slot) != core->kundefined) + return; + + //localNames[slot] = core->internString(name); + WBRC(core->GetGC(), localNames, &localNames[slot], core->internString(name)); + } + + void MethodInfo::initLocalNames() + { + AvmCore* core = this->core(); + localNames = (Stringp*) core->GetGC()->Calloc(local_count, sizeof(Stringp), GC::kZero|GC::kContainsPointers); + for(int i=0; ikundefined; + WBRC(core->GetGC(), localNames, &localNames[i], core->kundefined); + } + } + + /** + * convert ap[start]...ap[start+count-1] entries from their native types into + * Atoms. The result is placed into out[to]...out[to+count-1]. + * + * The traitArr is used to determine the type of conversion that should take place. + * traitArr[start]...traitArr[start+count-1] are used. + * + * If the method is interpreted then we just copy the Atom, no conversion is needed. + */ + void MethodInfo::boxLocals(void* src, int srcPos, Traits** traitArr, Atom* dest, int destPos, int length) + { + int size = srcPos+length; + int at = destPos; + + // if we are running mir then the types are native and we + // need to box em. + #ifdef AVMPLUS_INTERP + if (isFlagSet(TURBO)) + #endif //AVMPLUS_INTERP + { + // each entry is a pointer into the function's stack frame + void **in = (void**)src; // WARNING this must match with MIR generator + + // now probe each type and do the atom conversion. + AvmCore* core = this->core(); + for (int i=srcPos; idoubleToAtom( *((double*)p) ); + } + else if (t == INT_TYPE) + { + dest[at] = core->intToAtom( *((int*)p) ); + } + else if (t == UINT_TYPE) + { + dest[at] = core->uintToAtom( *((uint32*)p) ); + } + else if (t == BOOLEAN_TYPE) + { + dest[at] = *((int*)p) ? trueAtom : falseAtom; + } + else if (!t || t == OBJECT_TYPE || t == VOID_TYPE) + { + dest[at] = *((Atom*)p); + } + else + { + // it's a pointer type, either null or some specific atom tag. + void* ptr = *((void**)p); // unknown pointer + if (t == STRING_TYPE) + { + dest[at] = ((Stringp)ptr)->atom(); + } + else if (t == NAMESPACE_TYPE) + { + dest[at] = ((Namespace*)ptr)->atom(); + } + else + { + dest[at] = ((ScriptObject*)ptr)->atom(); + } + } + at++; + } + } + #ifdef AVMPLUS_INTERP + else + { + // no MIR then we know they are Atoms and we just copy them + Atom* in = (Atom*)src; + for(int i=srcPos; icore(); + for (int i=destPos; i>3; + } + else if (!t || t == OBJECT_TYPE || t == VOID_TYPE) + { + *((Atom*)p) = src[at++]; + } + else + { + // ScriptObject, String, Namespace, or Null + *((int*)p) = (src[at++] & ~7); + } + } + } + #ifdef AVMPLUS_INTERP + else + { + // no MIR then we know they are Atoms and we just copy them + Atom* out = (Atom*)dest; + for(int i=destPos; ifile = file; } + + Stringp getLocalName(int index) const; + Stringp getArgName(int index) const; + Stringp getRegName(int index) const; + void setRegName(int index, Stringp name); + + void boxLocals(void* src, int srcPos, Traits** traitArr, Atom* dest, int destPos, int length); + void unboxLocals(Atom* src, int srcPos, Traits** traitArr, void* dest, int destPos, int length); +#endif // DEBUGGER + + const byte *body_pos; + + // we write this once, in Verifier, with an explicit WB. so no DWB. + ExceptionHandlerTable* exceptions; + + MethodInfo(); + + static int verifyEnter(MethodEnv* env, int argc, va_list ap); + + void verify(Toplevel* toplevel); + + static int maxScopeDepth(MethodInfo* /*info*/, int max_scope) + { + return max_scope; + } + +#ifdef DEBUGGER + virtual uint32 size() const; + // abc size pre-jit, native size post jit + uint32 codeSize; + int local_count; + int max_scopes; + protected: + DWB(AbcFile*) file; // the abc file from which this method came + DWB(Stringp*) localNames; // array of names for args and locals in framep order + void initLocalNames(); +#endif // DEBUGGER + }; +} + +#endif /* __avmplus_MethodInfo__ */ diff --git a/mozilla/js/tamarin/core/Multiname.cpp b/mozilla/js/tamarin/core/Multiname.cpp new file mode 100644 index 00000000000..2a1b56e22fc --- /dev/null +++ b/mozilla/js/tamarin/core/Multiname.cpp @@ -0,0 +1,222 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmplus.h" + +namespace avmplus +{ + Multiname::Multiname(NamespaceSet* nsset) + { + this->flags = 0; + setNsset(nsset); + this->name = NULL; + } + + Multiname::Multiname() + { + this->flags = 0; + this->name = NULL; + this->ns = NULL; + } + + Multiname::Multiname(Namespace* ns, Stringp name, bool qualified) + { + this->flags = 0; + setNamespace(ns); + setName(name); + if (qualified) + setQName(); + } + + Namespace* Multiname::getNamespace(int i) const + { + AvmAssert(!isRtns() && !isAnyNamespace()); + if (flags&NSSET) + { + AvmAssert(i >= 0 && i < namespaceCount()); + return nsset ? nsset->namespaces[i] : NULL; + } + else + { + AvmAssert(i == 0); + return ns; + } + } + + bool Multiname::contains(Namespace* ns) const + { + if (flags & NSSET) + { + if( !nsset ) return false; + for (int i=0; i < nsset->size; i++) + if (nsset->namespaces[i] == ns) + return true; + return false; + } + else + { + return this->ns == ns; + } + } + + bool Multiname::matches(const Multiname* qname) const + { + // For attributes (XML::getprop page 12) + //if (((n.[[Name]].localName == "*") || (n.[[Name]].localName == a.[[Name]].localName)) && + // ((n.[[Name]].uri == nulll) || (n.[[Name]].uri == a.[[Name]].uri))) + + // For regular element props (XML::getprop page 12) + // if (n.localName = "*" OR m2 and (m2.localName == n.localName) + // and (!n.uri) or (m2) and (n.uri == m2.uri))) + + //Stringp n1 = core->string(this->name); + + if (qname) + { + //Stringp n2 = core->string(m2->name); + + if (this->isAttr() != qname->isAttr()) + return false; + } + + // An anyName that is not qualified matches all properties + if (this->isAnyName() && !this->isQName()) + return true; + + // Not an anyName, if m2 is valid, verify names are identical + if (!this->isAnyName() && qname && (this->name != qname->getName())) + return false; + + if (!qname) + return false; + + if (this->isAnyNamespace()) + return true; + + // find a matching namespace between m2 and this + // if no match return false + Stringp u2 = qname->getNamespace()->getURI(); + uint8 type2 = qname->getNamespace()->getType(); + //Stringp s2 = core->string(u2); + for (int i = 0; i < this->namespaceCount(); i++) + { + // We'd like to just compare namespace objects but we need + // to check URIs since two namespaces with different prefixes + // are considered a match + Stringp u1 = getNamespace(i)->getURI(); + uint8 type1 = getNamespace(i)->getType(); + //Stringp s1 = core->string(u1); + if (u1 == u2 && type1 == type2) + return true; + } + + return false; + } + + /* static */ + Stringp Multiname::format(AvmCore *core, Namespace* ns, Stringp name, bool attr) + { + if (ns == core->publicNamespace) + { + return name; + } + else + { + if (attr) + { + return core->concatStrings(core->newString("@"), core->concatStrings(ns->getURI(), + core->concatStrings(core->newString("::"), name))); + } + else + { + return core->concatStrings(ns->getURI(), + core->concatStrings(core->newString("::"), name)); + } + } + } + +//#ifdef AVMPLUS_VERBOSE + // Made available in non-AVMPLUS_VERBOSE builds for describeType + Stringp Multiname::format(AvmCore* core , MultiFormat form) const + { + Stringp attr = this->isAttr() ? core->newString("@") : (Stringp)core->kEmptyString; + Stringp name = this->isAnyName() + ? core->newString("*") + : (this->isRtname() + ? core->newString("[]") + : getName()); + + if (isAnyNamespace()) + { + return core->concatStrings(attr, core->concatStrings(core->newString("*::"), name)); + } + else if (isRtns()) + { + return core->concatStrings(attr, core->concatStrings(core->newString("[]::"), name)); + } + else if (namespaceCount() == 1 && isQName()) + { + return format(core, getNamespace(), core->concatStrings(attr,name)); + } + else + { + // various switches + bool showNs = (form == MULTI_FORMAT_FULL) || (form == MULTI_FORMAT_NS_ONLY); + bool showName = (form == MULTI_FORMAT_FULL) || (form == MULTI_FORMAT_NAME_ONLY); + bool showBrackets = (form == MULTI_FORMAT_FULL); + Stringp s = attr; + if (showNs) + { + if (showBrackets) + s = core->concatStrings(s, core->newString("{")); + + for (int i=0,n=namespaceCount(); i < n; i++) + { + if (getNamespace(i)==core->publicNamespace) + s = core->concatStrings(s, core->newString("public")); + else + s = core->concatStrings(s, getNamespace(i)->getURI()); + if (i+1 < n) + s = core->concatStrings(s, core->newString(",")); + } + + if (showBrackets) + s = core->concatStrings(s, core->newString("}::")); + } + + if (showName) + s = core->concatStrings(s, name); + return s; + } + } +//#endif +} diff --git a/mozilla/js/tamarin/core/Multiname.h b/mozilla/js/tamarin/core/Multiname.h new file mode 100644 index 00000000000..12015264590 --- /dev/null +++ b/mozilla/js/tamarin/core/Multiname.h @@ -0,0 +1,357 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_Multiname__ +#define __avmplus_Multiname__ + + +namespace avmplus +{ + /** + * Multiname is a reference to an identifier in 0 or more namespaces. It consists + * of the simple name and a list of namespaces. + * + * Multinames are always stack allocated. Namespace and name values are interened, since + * they are used as hashtable keys. + */ + class Multiname + { + const static int ATTR = 0x01; // attribute name + const static int QNAME = 0x02; // qualified name (size==1, explicit in code) + const static int RTNS = 0x04; // runtime namespace + const static int RTNAME = 0x08; // runtime name + const static int NSSET = 0x10; + const static int PUBLICNS = 0x20; // temporary flag to support 46.15; public implied + #ifdef AVMPLUS_MIR + friend class CodegenMIR; + #endif + #ifdef AVMPLUS_INTERP + friend class Interpreter; + #endif + friend class HeapMultiname; + int flags; + Stringp name; + union + { + Namespace* ns; + NamespaceSet* nsset; + }; + + public: + + Stringp getName() const + { + AvmAssert(!isAnyName() && !isRtname()); + return name; + } + + void setName(Stringp name) + { + AvmAssert(name && name->isInterned()); + this->flags &= ~RTNAME; + this->name = name; + } + + void setName(Multiname* other) + { + // copy name settings from other + flags &= ~RTNAME; + flags |= other->flags & RTNAME; + this->name = other->name; + } + + int namespaceCount() const + { + return (nsset && (flags & NSSET)) ? nsset->size : 1; + } + + Namespace* getNamespace(int i) const; + + Namespace* getNamespace() const + { + return getNamespace(0); + } + + void setNamespace(Namespace* ns) + { + flags &= ~(NSSET|RTNS); + AvmAssert(ns != NULL); + this->ns = ns; + } + + void setNamespace(Multiname* other) + { + // copy namespace settings from other + flags &= ~(NSSET|RTNS); + flags |= other->flags & (NSSET|RTNS); + this->ns = other->ns; + } + + NamespaceSet* getNsset() const + { + AvmAssert(!isRtns() && (flags&NSSET)); + return nsset; + } + + void setNsset(NamespaceSet* nsset) + { + flags &= ~RTNS; + flags |= NSSET; + AvmAssert(nsset != NULL); + this->nsset = nsset; + } + + Multiname(); + + Multiname(NamespaceSet* nsset); + + Multiname(const Multiname &other) + { + *this = other; + } + + + Multiname(Namespace* ns, Stringp name, bool qualified=false); + + ~Multiname() + { + flags = 0; + name = NULL; + nsset = NULL; + } + + bool contains(Namespace* ns) const; + + /** + * return the flags we want to keep when copying a compile-time + * multiname into a runtime temporary multiname + */ + int ctFlags() const { + return flags & ~(RTNS|RTNAME); + } + + /** + * returns true if this multiname could resolve to a binding. Attributes, + * wildcards, and runtime parts mean it can't match any binding. + */ + int isBinding() const { + return !(flags & (ATTR|RTNS|RTNAME)) && name && ns; + } + int isRuntime() const { + return flags & (RTNS|RTNAME); + } + int isRtns() const { + return flags & RTNS; + } + int isRtname() const { + return flags & RTNAME; + } + int isQName() const { + return flags & QNAME; + } + bool isAttr() const { + return (bool) (flags & ATTR); + } + bool isAnyName() const { + return !isRtname() && !name; + } + bool isAnyNamespace() const { + return !isRtns() && !(flags&NSSET) && ns == NULL; + } + int isNsset() const { + return flags & NSSET; + } + + void setAttr(bool b=true) { + if (b) + flags |= ATTR; + else + flags &= ~ATTR; + } + void setPublic(bool b=true) { + if (b) + flags |= PUBLICNS; + else + flags &= ~PUBLICNS; + } + void setQName() { + AvmAssert(namespaceCount()==1 && !(flags&NSSET)); + flags |= QNAME; + } + void setRtns() { + flags |= RTNS; + flags &= ~NSSET; + ns = NULL; + } + void setRtname() { + flags |= RTNAME; + name = NULL; + } + void setAnyName() { + flags &= ~RTNAME; + name = NULL; + } + void setAnyNamespace() { + flags &= ~(NSSET|RTNS); + ns = NULL; + } + + bool matches (const Multiname *mn) const; + +//#ifdef AVMPLUS_VERBOSE + public: + typedef enum _MultiFormat + { + MULTI_FORMAT_FULL = 0, /* default */ + MULTI_FORMAT_NAME_ONLY, /* only name */ + MULTI_FORMAT_NS_ONLY, /* only namespaces */ + } + MultiFormat; + + Stringp format(AvmCore* core, MultiFormat form=MULTI_FORMAT_FULL) const; + static Stringp format(AvmCore* core, Namespace* ns, Stringp name, bool attr=false); +//#endif + }; + + // version of multiname sporting write barriers + class HeapMultiname + { + public: + + HeapMultiname() {} + + HeapMultiname(NamespaceSet* nsset) { name.setNsset(nsset); } + + HeapMultiname(const Multiname &other) + { + setMultiname(other); + } + + HeapMultiname(Namespace* ns, Stringp name, bool qualified=false); + + + operator Multiname* () { return &name; } + + const Multiname& getMultiname() const { return name; } + + void setMultiname(const Multiname &other) + { + WBRC(gc(), this, &name.name, other.name); + if(name.isNsset()) + name.ns = NULL; + else + WBRC(gc(), this, &name.ns, NULL); + + if(other.isNsset()) { + WB(gc(), this, &name.ns, other.ns); + } else { + WBRC(gc(), this, &name.ns, other.ns); + } + name.flags = other.flags; + } + + void setName(Stringp n) { + WBRC(gc(), this, &name.name, n); + name.setName(n); + } + + void setName(Multiname* other) { + WBRC(gc(), this, &name.name, other->name); + name.setName(other); + } + + void setNamespace(Namespace* ns) { + WBRC(gc(), this, &name.ns, ns); + name.setNamespace(ns); + } + + void setNamespace(Multiname* other) { + WBRC(gc(), this, &name.ns, other->ns); + name.setNamespace(other); + } + + void setNsset(NamespaceSet* nsset) { + WB(gc(), this, &name.nsset, nsset); + name.setNsset(nsset); + } + + void setRtns() { + WBRC(gc(), this, &name.name, NULL); + name.setRtns(); + } + void setRtname() + { + WBRC(gc(), this, &name.name, NULL); + name.setRtname(); + } + void setAnyName() { + WBRC(gc(), this, &name.name, NULL); + name.setAnyName(); + } + void setAnyNamespace() { + WBRC(gc(), this, &name.ns, NULL); + name.setAnyNamespace(); + } + + Stringp getName() const { return name.getName(); } + int namespaceCount() const { return name.namespaceCount(); } + Namespace* getNamespace(int i) const { return name.getNamespace(i); } + Namespace* getNamespace() const { return name.getNamespace(); } + NamespaceSet* getNsset() const { return name.getNsset(); } + bool contains(Namespace* ns) const { return name.contains(ns); } + int ctFlags() const { return name.ctFlags(); } + int isBinding() const { return name.isBinding(); } + int isRuntime() const { return name.isRuntime(); } + int isRtns() const { return name.isRtns(); } + int isRtname() const { return name.isRtname(); } + int isQName() const { return name.isQName(); } + bool isAttr() const { return name.isAttr(); } + bool isAnyName() const { return name.isAnyName(); } + bool isAnyNamespace() const { return name.isAnyNamespace(); } + int isNsset() const { return name.isNsset(); } + + void setAttr(bool b=true) { name.setAttr(b); } + void setQName() { name.setQName(); } + + bool matches (const Multiname *mn) const { return name.matches(mn); } + +//#ifdef AVMPLUS_VERBOSE + public: + Stringp format(AvmCore* core, Multiname::MultiFormat form=Multiname::MULTI_FORMAT_FULL) const { return name.format(core, form); } + static Stringp format(AvmCore* core, Namespace* ns, Stringp name, bool attr=false) { return format(core, ns, name, attr); } +//#endif + private: + Multiname name; + MMgc::GC* gc() const { return MMgc::GC::GetGC(this); } + }; +} + +#endif /* __avmplus_Multiname__ */ diff --git a/mozilla/js/tamarin/core/MultinameHashtable.cpp b/mozilla/js/tamarin/core/MultinameHashtable.cpp new file mode 100644 index 00000000000..54133bdb00d --- /dev/null +++ b/mozilla/js/tamarin/core/MultinameHashtable.cpp @@ -0,0 +1,264 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#include "avmplus.h" + +using namespace MMgc; + +namespace avmplus +{ + MultinameHashtable::MultinameHashtable(int capacity) + { + Init(capacity); + } + + void MultinameHashtable::Init(int capacity) + { + if(capacity) + { + numTriplets = MathUtils::nextPowerOfTwo(capacity); + + MMgc::GC* gc = MMgc::GC::GetGC(this); + + AvmAssert(numTriplets > 0); + MMGC_MEM_TYPE(this); + triples = (Triple *) gc->Alloc (sizeof(Triple) * numTriplets, GC::kContainsPointers|GC::kZero); + } + } + + MultinameHashtable::~MultinameHashtable() + { + GC *gc = GC::GetGC(this); + gc->Free (triples); + } + + bool MultinameHashtable::isFull() const + { + // 0.80 load factor + return 5*(size+1) >= numTriplets*4; + } + + int MultinameHashtable::find(Stringp name, Namespace* ns, Triple *t, unsigned m) + { + AvmAssert(name != NULL && ns != NULL); + + // this is a quadratic probe but we only hit every third slot since those hold keys. + int n = 7; + + int bitmask = (m - 1); + + // Note: Mask off MSB to avoid negative indices. Mask off bottom + // 3 bits because it doesn't contribute to hash. Triple it + // because names, namespaces, and values are stored adjacently. + unsigned i = ((0x7FFFFFF8 & (int)name) >> 3) & bitmask; + Stringp k; + while (((k=t[i].name) != name || t[i].ns != ns) && k != NULL) + { + i = (i + (n++)) & bitmask; // quadratic probe + } + return i; + } + + void MultinameHashtable::put(Stringp name, Namespace* ns, Binding value) + { + AvmAssert(!isFull()); + + GC *gc = GC::GetGC(triples); + int i = find(name, ns, triples, numTriplets); + Triple &t = triples[i]; + if (t.name == name) + { + // This pair is already in the table + AvmAssert(t.ns == ns); + } + else + { + // New table entry for this pair + size++; + //triples[i] = name; + WBRC(gc, triples, &t.name, name); + //triples[i+1] = ns; + WBRC(gc, triples, &t.ns, ns); + } + + //triples[i+2] = value; + WB(gc, triples, &t.value, value); + } + + Binding MultinameHashtable::get(Stringp name, Namespace* ns) const + { + Triple* t = triples; + int i = find(name, ns, t, numTriplets); + if (t[i].name == name) + { + AvmAssert(t[i].ns == ns); + return t[i].value; + } + return BIND_NONE; + } + + Binding MultinameHashtable::getName(Stringp name) const + { + Triple* t = triples; + for (int i=0, n=numTriplets; i < n; i++) + { + if (t[i].name == name) + { + return t[i].value; + } + } + return BIND_NONE; + } + + Binding MultinameHashtable::get(Stringp mnameName, NamespaceSet *nsset) const + { + Binding match = BIND_NONE; + int nsCount = nsset->size; + + // this is a quadratic probe but we only hit every third slot since those hold keys. + int n = 7; + int bitMask = numTriplets - 1; + + // Note: Mask off MSB to avoid negative indices. Mask off bottom + // 3 bits because it doesn't contribute to hash. Triple it + // because names, namespaces, and values are stored adjacently. + unsigned i = ((0x7FFFFFF8 & (int)mnameName)>>3) & bitMask; + int j; + Stringp atomName; + + Triple* t = triples; + while ((atomName = t[i].name) != EMPTY) + { + if (atomName == mnameName) + { + Namespace *ns = t[i].ns; + for (j=0; j < nsCount; j++) + { + if (ns == nsset->namespaces[j]) + { + if (match == BIND_NONE) + { + match = t[i].value; + break; + } + else if (match != t[i].value) + { + return BIND_AMBIGUOUS; + } + } + } + } + + i = (i + (n++)) & bitMask; // quadratic probe + } + + return match; + } + + Binding MultinameHashtable::getMulti(Multiname* mname) const + { + // multiname must not be an attr name, have wildcards, or have runtime parts. + AvmAssert(mname->isBinding() && !mname->isAnyName()); + + if (!mname->isNsset()) + return get(mname->getName(), mname->getNamespace()); + else + return get(mname->getName(), mname->getNsset()); + } + + void MultinameHashtable::add(Stringp name, Namespace* ns, Binding value) + { + if (isFull()) + { + grow(); + } + put(name, ns, value); + } + + void MultinameHashtable::rehash(Triple *oldAtoms, int oldTriplet, Triple *newAtoms, int newTriplet) + { + for (int i=0, n=oldTriplet; i < n; i++) + { + Stringp oldName; + if ((oldName=oldAtoms[i].name) != EMPTY) + { + // inlined & simplified version of put() + int j = find(oldName, oldAtoms[i].ns, newAtoms, newTriplet); + newAtoms[j].name = oldName; + newAtoms[j].ns = oldAtoms[i].ns; + newAtoms[j].value = oldAtoms[i].value; + } + } + } + + void MultinameHashtable::grow() + { + // double our table + int capacity = numTriplets*2; + MMgc::GC* gc = MMgc::GC::GetGC(this); + MMGC_MEM_TYPE(this); + Triple *newAtoms = (Triple *) gc->Calloc(capacity, sizeof(Triple), GC::kContainsPointers|GC::kZero); + rehash(triples, numTriplets, newAtoms, capacity); + gc->Free (triples); + triples = newAtoms; + numTriplets = capacity; + } + + Stringp MultinameHashtable::keyAt(int index) + { + AvmAssert(NULL != triples[index-1].name); + return triples[index-1].name; + } + + Namespace* MultinameHashtable::nsAt(int index) + { + return triples[index-1].ns; + } + + Binding MultinameHashtable::valueAt(int index) + { + return triples[index-1].value; + } + + // call this method using the previous value returned + // by this method starting with 0, until 0 is returned. + int MultinameHashtable::next(int index) + { + // Advance to first non-empty slot. + Triple* t = triples; + while (index < numTriplets) { + if (t[index++].name != NULL) { + return index; + } + } + return 0; + } +} diff --git a/mozilla/js/tamarin/core/MultinameHashtable.h b/mozilla/js/tamarin/core/MultinameHashtable.h new file mode 100644 index 00000000000..f8bf907f11f --- /dev/null +++ b/mozilla/js/tamarin/core/MultinameHashtable.h @@ -0,0 +1,132 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_MultinameHashtable__ +#define __avmplus_MultinameHashtable__ + + +namespace avmplus +{ + /** + * Hashtable for mapping pairs to a Binding + */ + class MultinameHashtable : public MMgc::GCObject + { + class Triple + { + public: + Stringp name; + Namespace* ns; + Binding value; + }; + + /** + * Finds the hash bucket corresponding to the key + * in the hash table starting at t, containing tLen + * triples. + */ + static int find(Stringp name, Namespace* ns, Triple *t, unsigned tLen); + void rehash(Triple *oldAtoms, int oldlen, Triple *newAtoms, int newlen); + /** + * Called to grow the Hashtable, particularly by add. + * + * - Calculates the needed size for the new Hashtable + * (typically 2X the current size) + * - Creates a new array of Atoms + * - Rehashes the current table into the new one + * - Deletes the old array of Atoms and sets the Atom + * pointer to our new array of Atoms + * + */ + void grow(); + + /** property hashtable */ + DWB(Triple*) triples; + + public: + /** + * since identifiers are always interned strings, they can't be 0, + * so we can use 0 as the empty value. + */ + const static Atom EMPTY = 0; + + /** kDefaultCapacity must be a power of 2 */ + const static int kDefaultCapacity = 8; + + /** no. of properties */ + int size; + + /** size of hashtable (number of triples - actual capacity is *3) */ + int numTriplets; + + /** + * initialize with a known capacity. i.e. we can fit minSize + * elements in without rehashing. + * @param heap + * @param capacity # of logical slots + */ + MultinameHashtable(int capacity = kDefaultCapacity); + + ~MultinameHashtable(); + + bool isFull() const; + + /** + * @name operations on name/ns/binding triples + */ + /*@{*/ + void put(Stringp name, Namespace* ns, Binding value); + + Binding get(Stringp name, Namespace* ns) const; + Binding get(Stringp name, NamespaceSet* nsset) const; + Binding getMulti(Multiname* name) const; + Binding getName(Stringp name) const; + /*@}*/ + + /** + * Adds a name/value pair to a hash table. Automatically + * grows the hash table if it is full. + */ + void add (Stringp name, Namespace* ns, Binding value); + + /** + * Allow caller to enumerate all entries in the table. + */ + int next(int index); + Stringp keyAt(int index); + Namespace* nsAt(int index); + Binding valueAt(int index); + protected: + void Init(int capacity); + }; +} + +#endif /* __avmplus_MultinameHashtable__ */ diff --git a/mozilla/js/tamarin/core/Namespace.as b/mozilla/js/tamarin/core/Namespace.as new file mode 100644 index 00000000000..794c972d27c --- /dev/null +++ b/mozilla/js/tamarin/core/Namespace.as @@ -0,0 +1,75 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +package +{ + public final class Namespace + { + // E262 {ReadOnly,DontDelete,DontEnum} + // E357 length = 2 + public static const length = 2 + + // E357 {DontDelete, ReadOnly} + public native function get prefix() + + // E357 {DontDelete, ReadOnly} + public native function get uri():String + + AS3 function valueOf():String { return uri } + + prototype.valueOf = function():String + { + if (this === prototype) return "" + var n:Namespace = this + return n.uri; + } + + AS3 function toString():String + { + return uri + } + + prototype.toString = function ():String + { + if (this === prototype) return "" + var n:Namespace = this + return n.uri; + } + + // Dummy constructor function - This is neccessary so the compiler can do arg # checking for the ctor in strict mode + // The code for the actual ctor is in NamespaceClass::construct in the avmplus + public function Namespace(prefix = void 0, uri = void 0 ) + {} + + _dontEnumPrototype(prototype); + } +} diff --git a/mozilla/js/tamarin/core/Namespace.cpp b/mozilla/js/tamarin/core/Namespace.cpp new file mode 100644 index 00000000000..15be00c5ea9 --- /dev/null +++ b/mozilla/js/tamarin/core/Namespace.cpp @@ -0,0 +1,136 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmplus.h" + +using namespace MMgc; + +namespace avmplus +{ + // See E4X 13.2.2, pg 64 + Namespace::Namespace(Atom prefix, Stringp uri, NamespaceType flags) + { + // verify our parameters are interned strings + AvmAssert (uri->isInterned()); + // prefix can be an interned string, undefined, or null + AvmAssert (AvmCore::isName(prefix) || AvmCore::isNullOrUndefined(prefix)); + setPrefix(prefix); + setUri(uri, flags); +#ifdef DEBUGGER + AvmCore *core = (AvmCore *) GC::GetGC(this)->GetGCContextVariable (MMgc::GC::GCV_AVMCORE); + if(core->allocationTracking) + { + AvmCore::chargeAllocation(atom()); + } +#endif + } + + Namespace::~Namespace() + { + WBATOM(MMgc::GC::GetGC(this), this, &m_prefix, 0); + setUri(NULL, NS_Public); + } + + void Namespace::setUri(Stringp uri, NamespaceType flags) + { + WBRC(GC::GetGC(this), this, &m_uri, (sint32)flags | (sint32) uri); + } + + void Namespace::setPrefix (Atom pre) + { + AvmAssert (AvmCore::isName(pre) || AvmCore::isNullOrUndefined(pre)); + // ensure that if the incoming Atom is a string, that it's interned + AvmAssert(AvmCore::isString(pre) ? (AvmCore::atomToString(pre))->isInterned() : 1); + + WBATOM(MMgc::GC::GetGC(this), this, &m_prefix, pre); + } + + bool Namespace::hasPrefix () const + { + return (AvmCore::isName(m_prefix) && AvmCore::atomToString(m_prefix)->length()>0); + } + + bool Namespace::equalTo(const Namespace* other) const + { + if (isPrivate() || other->isPrivate()) + { + // one of these namespaces is private, so compare using object identity + return this == other; + } + else + { + // both are public, so compare using uri's. they are intern'ed so we + // can do a fast pointer compare. + return m_uri == other->m_uri; + } + } + + // Iterator support - for in, for each + Atom Namespace::nextName(const AvmCore *core, int index) + { + // first return "uri" then "prefix" + if (index == 1) + return core->kuri->atom(); + else if (index == 2) + return core->kprefix->atom(); + else { + return nullStringAtom; + } + } + + Atom Namespace::nextValue(int index) + { + // first return uri then prefix + if (index == 1) + return this->getURI()->atom(); + else if (index == 2) + return this->m_prefix; + else + { + return undefinedAtom; + } + } + + int Namespace::nextNameIndex(int index) + { + if (index < 2) + return index + 1; + else + return 0; + } + + Stringp Namespace::format(AvmCore* /*core*/) const + { + return getURI(); + } +} + diff --git a/mozilla/js/tamarin/core/Namespace.h b/mozilla/js/tamarin/core/Namespace.h new file mode 100644 index 00000000000..65804ef564d --- /dev/null +++ b/mozilla/js/tamarin/core/Namespace.h @@ -0,0 +1,107 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_Namespace__ +#define __avmplus_Namespace__ + + +namespace avmplus +{ + /** + * a namespace is a primitive value in the system, similar to String + */ + class Namespace : public AvmPlusScriptableObject + { + private: + friend class AvmCore; + // Should these be Stringp's? + Atom m_prefix; + sint32 m_uri; // Uses 3 bits for flags, but otherwise is really a Stringp + public: + enum NamespaceType + { + NS_Public = 0, + NS_Protected = 1, + NS_PackageInternal = 2, + NS_Private = 3, + NS_Explicit = 4, + NS_StaticProtected = 5, + }; + Namespace(Atom prefix, Stringp uri, NamespaceType type); + ~Namespace(); + + Atom getPrefix() const { return m_prefix; }; + Stringp getURI() const { return (Stringp)(((sint32)m_uri)&~7); }; + + Atom atom() const { return AtomConstants::kNamespaceType | (Atom)this; } + + /** + * virtual version of atom(): + */ + virtual Atom toAtom() const { return atom(); } + + // This is called in ONE place in the XML code. The URI of a namespace + // should never change but its prefix can change in this special case + void setPrefix (Atom pre); + + bool hasPrefix () const; + + bool equalTo(const Namespace* other) const; + + bool isPrivate() const + { + return ISNULL(m_prefix); + } + NamespaceType getType() const + { + return (NamespaceType)(((sint32)m_uri)&7); + } + + // Iterator support - for in, for each + Atom nextName(const AvmCore *core, int index); + Atom nextValue(int index); + int nextNameIndex(int index); + +#ifdef DEBUGGER + uint32 size() const { return sizeof(Namespace) - sizeof(AvmPlusScriptableObject); } +#endif + +//#ifdef AVMPLUS_VERBOSE + public: + Stringp format(AvmCore* core) const; +//#endif + private: + void setUri(Stringp uri, NamespaceType flags); + }; +} + +#endif /* __avmplus_Namespace__ */ + diff --git a/mozilla/js/tamarin/core/NamespaceClass.cpp b/mozilla/js/tamarin/core/NamespaceClass.cpp new file mode 100644 index 00000000000..a5c9a27a031 --- /dev/null +++ b/mozilla/js/tamarin/core/NamespaceClass.cpp @@ -0,0 +1,107 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmplus.h" + +namespace avmplus +{ +// Took workaround code from StringClass.cpp. Same code except for "Namespace::" part +#ifdef __MWERKS__ + typedef void (Namespace::*StringHandler)(); + + NativeTableEntry::Handler stringMethod(StringHandler stringHandler) + { + union + { + StringHandler foo; + NativeTableEntry::Handler bar; + }; + foo = stringHandler; + return bar; + } + + #define STRING_METHOD(handler) stringMethod((StringHandler)handler) +#else + #define STRING_METHOD(x) x +#endif + + BEGIN_NATIVE_MAP(NamespaceClass) + NATIVE_METHOD2(Namespace_prefix_get, STRING_METHOD(&Namespace::getPrefix)) + NATIVE_METHOD2(Namespace_uri_get, STRING_METHOD(&Namespace::getURI)) + END_NATIVE_MAP() + + NamespaceClass::NamespaceClass(VTable* cvtable) + : ClassClosure(cvtable) + { + toplevel()->namespaceClass = this; + AvmAssert(traits()->sizeofInstance == sizeof(NamespaceClass)); + createVanillaPrototype(); + } + + + // this = argv[0] (ignored) + // arg1 = argv[1] + // argN = argv[argc] + Atom NamespaceClass::construct(int argc, Atom* argv) + { + AvmCore* core = this->core(); + + // See E4X 13.2.2, pg 65 + if (argc < 1) + return core->newNamespace(core->kEmptyString)->atom(); + else if (argc == 1) + return core->newNamespace(argv[1])->atom(); + else + { + // Rhino throws an error when prefix is specified and uri is not a valid string + String *p = core->string (argv[1]); + String *u = core->string (argv[2]); + if (p->length() && !u->length()) + { + toplevel()->throwTypeError(kXMLNamespaceWithPrefixAndNoURI, p); + } + + return core->newNamespace(argv[1], argv[2])->atom(); + } + } + + // this = argv[0] (ignored) + // arg1 = argv[1] + // argN = argv[argc] + Atom NamespaceClass::call(int argc, Atom* argv) + { + if ((argc == 1) && (core()->isNamespace(argv[1]))) + return argv[1]; + else + return construct (argc, argv); + } +} diff --git a/mozilla/js/tamarin/core/NamespaceClass.h b/mozilla/js/tamarin/core/NamespaceClass.h new file mode 100644 index 00000000000..e90a3067365 --- /dev/null +++ b/mozilla/js/tamarin/core/NamespaceClass.h @@ -0,0 +1,59 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_NamespaceClass__ +#define __avmplus_NamespaceClass__ + + +namespace avmplus +{ + /** + * class Namespace - the type of namespace objects + */ + class NamespaceClass : public ClassClosure + { + public: + DECLARE_NATIVE_MAP(NamespaceClass) + NamespaceClass(VTable* cvtable); + + // this = argv[0] (ignored) + // arg1 = argv[1] + // argN = argv[argc] + Atom construct(int argc, Atom* argv); + + // this = argv[0] + // arg1 = argv[1] + // argN = argv[argc] + Atom call (int argc, Atom* argv); + }; +} + +#endif /* __avmplus_NamespaceClass__ */ diff --git a/mozilla/js/tamarin/core/NamespaceSet.cpp b/mozilla/js/tamarin/core/NamespaceSet.cpp new file mode 100644 index 00000000000..ce6d1a211bf --- /dev/null +++ b/mozilla/js/tamarin/core/NamespaceSet.cpp @@ -0,0 +1,61 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmplus.h" + +namespace avmplus +{ + NamespaceSet::NamespaceSet(int nsCount) + { + this->size = nsCount; + } + + +//#ifdef AVMPLUS_VERBOSE + // Made available in non-AVMPLUS_VERBOSE builds for describeType + Stringp NamespaceSet::format(AvmCore* core) const + { + Stringp s = core->newString("{"); + for (int i=0,n=size; i < n; i++) + { + if ((Namespace*)namespaces[i]==core->publicNamespace) + s = core->concatStrings(s, core->newString("public")); + else + s = core->concatStrings(s, namespaces[i]->getURI()); + if (i+1 < n) + s = core->concatStrings(s, core->newString(",")); + } + s = core->concatStrings(s, core->newString("}")); + return s; + } +//#endif +} diff --git a/mozilla/js/tamarin/core/NamespaceSet.h b/mozilla/js/tamarin/core/NamespaceSet.h new file mode 100644 index 00000000000..4cf2826c1e7 --- /dev/null +++ b/mozilla/js/tamarin/core/NamespaceSet.h @@ -0,0 +1,79 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_NamespaceSet__ +#define __avmplus_NamespaceSet__ + + +namespace avmplus +{ + /** + * NamespaceSet is a reference to 0 or more namespaces. It consists + * of a list of namespaces. + */ + class NamespaceSet : public MMgc::GCObject + { + friend class Codegen; + #ifdef AVMPLUS_MIR + friend class CodegenMIR; + #endif + #ifdef AVMPLUS_INTERP + friend class Interpreter; + #endif + + public: + int size; + Namespace* namespaces[1/*namespaceCount*/]; + + NamespaceSet(int namespaceCount); + + NamespaceSet(Namespace* ns) + { + this->size = 1; + this->namespaces[0] = ns; + } + + bool contains(Namespace* ns) const + { + for (int i=0,n=size; i < n; i++) + if (namespaces[i] == ns) + return true; + return false; + } + +//#ifdef AVMPLUS_VERBOSE + public: + Stringp format(AvmCore* core) const; +//#endif + }; +} + +#endif /* __avmplus_NamespaceSet__ */ diff --git a/mozilla/js/tamarin/core/NativeFunction.cpp b/mozilla/js/tamarin/core/NativeFunction.cpp new file mode 100644 index 00000000000..d251f758ccc --- /dev/null +++ b/mozilla/js/tamarin/core/NativeFunction.cpp @@ -0,0 +1,175 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 1993-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + + +#include "avmplus.h" + +namespace avmplus +{ + NativeMethod::NativeMethod(int flags, Handler handler) + : AbstractFunction() + { + m_handler = handler; + this->flags |= flags; + this->impl32 = verifyEnter; + } + + /** + * invoke handler as handler(int cookie, ...) with native typed args + */ + NativeMethod::NativeMethod(int flags, Handler handler, int cookie) + : AbstractFunction() + { + m_handler = handler; + m_cookie = cookie; + this->flags |= (flags | NATIVE_COOKIE); + this->impl32 = verifyEnter; + } + + + int NativeMethod::verifyEnter(MethodEnv* env, int argc, va_list ap) + { + NativeMethod* f = (NativeMethod*) env->method; + + f->verify(env->vtable->toplevel); + + #ifdef AVMPLUS_VERIFYALL + f->flags |= VERIFIED; + if (f->pool->core->verifyall && f->pool) + f->pool->processVerifyQueue(env->toplevel()); + #endif + + env->impl32 = f->impl32; + return f->impl32(env, argc, ap); + } + + void NativeMethod::verify(Toplevel *toplevel) + { + AvmAssert(declaringTraits->linked); + resolveSignature(toplevel); + + // generate the native method thunk + CodegenMIR cgen(this); + cgen.emitNativeThunk(this); + if (cgen.overflow) + toplevel->throwError(kOutOfMemoryError); + } + + int NativeMethodV::verifyEnter(MethodEnv* env, int argc, va_list ap) + { + NativeMethodV* f = (NativeMethodV*) env->method; + + f->verify(env->vtable->toplevel); + + #ifdef AVMPLUS_VERIFYALL + f->flags |= VERIFIED; + if (f->pool->core->verifyall && f->pool) + f->pool->processVerifyQueue(env->toplevel()); + #endif + + env->impl32 = f->impl32; + return f->impl32(env, argc, ap); + } + + int NativeMethodV::implv32(MethodEnv* env, + int argc, va_list ap) + { + // get the instance pointer before we unbox everything + va_list ap2=ap; + ScriptObject* instance = va_arg(ap2, ScriptObject*); + +#ifdef NATIVE_GLOBAL_FUNCTION_HACK + // HACK for native toplevel functions + instance = (ScriptObject*)(~7 & (int)instance); +#endif + + // convert the args in place + Atom* atomv = (Atom*) ap; + + NativeMethodV* nmv = (NativeMethodV*) (AbstractFunction*) env->method; + + nmv->boxArgs(argc, ap, atomv); + + // skip the instance atom + atomv++; + +#ifdef DEBUGGER + if (env->core()->debugger != 0) + env->core()->debugger->traceMethod(nmv, true); // tracing for native methods +#endif /* DEBUGGER */ + + if (nmv->m_haveCookie) { + CookieHandler32 cookieHandler = (CookieHandler32)nmv->m_handler; + return (instance->*cookieHandler)(nmv->m_cookie, atomv, argc); + } else { + Handler32 handler = (Handler32) nmv->m_handler; + return (instance->*handler)(atomv, argc); + } + } + + double NativeMethodV::implvN(MethodEnv* env, + int argc, va_list ap) + { + // get the instance pointer before we unbox everything + va_list ap2=ap; + ScriptObject* instance = va_arg(ap2, ScriptObject*); + +#ifdef NATIVE_GLOBAL_FUNCTION_HACK + // HACK for native toplevel functions + instance = (ScriptObject*)(~7 & (int)instance); +#endif + + // convert the args in place + Atom* atomv = (Atom*) ap; + + NativeMethodV* nmv = (NativeMethodV*) (AbstractFunction*) env->method; + + nmv->boxArgs(argc, ap, atomv); + + // skip the instance atom + atomv++; + +#ifdef DEBUGGER + if (env->core()->debugger != 0) + env->core()->debugger->traceMethod(nmv, true); // tracing for native methods +#endif /* DEBUGGER */ + + if (nmv->m_haveCookie) { + CookieHandlerN cookieHandler = (CookieHandlerN)nmv->m_handler; + return (instance->*cookieHandler)(nmv->m_cookie, atomv, argc); + } else { + HandlerN handler = (HandlerN) nmv->m_handler; + return (instance->*handler)(atomv, argc); + } + } + +} diff --git a/mozilla/js/tamarin/core/NativeFunction.h b/mozilla/js/tamarin/core/NativeFunction.h new file mode 100644 index 00000000000..4dab5c2962a --- /dev/null +++ b/mozilla/js/tamarin/core/NativeFunction.h @@ -0,0 +1,239 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 1993-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#ifndef __avmplus_NativeFunction__ +#define __avmplus_NativeFunction__ + +namespace avmplus +{ + + /** + * The NativeMethod class is a wrapper to bind a native C++ function + * to a class method surfaced into the ActionScript world. + * The class method must be defined with the "native" attribute. + * + * NativeMethod uses C++ calling conventions when calling the + * native C++ code. Incoming parameters are coerced to the + * proper type before the call as follows: + * + * AS type C++ type + * ------- -------- + * Void Atom, if parameter, void if return type + * Object Atom + * Boolean bool + * Number double + * String Stringp (String *) + * Class ClassClosure* + * MovieClip MovieClipObject* (similar for any other class) + */ + class NativeMethod : public AbstractFunction + { + public: + typedef void (ScriptObject::*Handler)(); + typedef Atom (ScriptObject::*GetHandler)(); + typedef void (ScriptObject::*SetHandler)(Atom); + + /** + * invoke handler as handler(...) with native typed args + */ + NativeMethod(int flags, Handler handler); + + /** + * invoke handler as handler(int cookie, ...) with native typed args + */ + NativeMethod(int flags, Handler handler, int cookie); + + // we have virtual functions, so we probably need a virtual dtor + virtual ~NativeMethod() {} + + static int verifyEnter(MethodEnv* env, int argc, va_list ap); + + virtual void verify(Toplevel* toplevel); + + int m_cookie; + union { + Handler m_handler; + int m_handler_addr; + }; + + }; + + /** + * NativeMethodV is similar to NativeMethod but does not coerce + * arguments automatically to appropriate C++ types. + * Instead, the C++ code always receives arguments in the + * form: Atom method(Atom *argv, int argc); + * + * NativeMethodV is deprecated and will eventually be removed. + */ + class NativeMethodV : public AbstractFunction + { + public: + typedef int (ScriptObject::*Handler32)(Atom *argv, int argc); + typedef int (ScriptObject::*CookieHandler32)(int cookie, Atom *argv, int argc); + typedef double (ScriptObject::*HandlerN)(Atom *argv, int argc); + typedef double (ScriptObject::*CookieHandlerN)(int cookie, Atom *argv, int argc); + + /** + * invoke handler as handler(...) with native typed args + */ + NativeMethodV(Handler32 handler, int flgs) + : AbstractFunction() + { + m_handler = handler; + this->flags |= (flgs | NEED_REST); + this->impl32 = verifyEnter; + } + + /** + * invoke handler as handler(int cookie, ...) with native typed args + */ + NativeMethodV(Handler32 handler, int cookie, int flgs) + : AbstractFunction() + { + m_handler = handler; + m_cookie = cookie; + m_haveCookie = true; + this->impl32 = verifyEnter; + this->flags = flgs; + } + + void verify(Toplevel* toplevel) + { + AvmAssert(declaringTraits->linked); + resolveSignature(toplevel); + AvmCore* core = this->core(); + if (returnTraits() == NUMBER_TYPE) + impl32 = implv32; + else + implN = implvN; + } + + static int verifyEnter(MethodEnv* env, int argc, va_list ap); + + static int implv32(MethodEnv* env, + int argc, va_list ap); + static double implvN(MethodEnv* env, + int argc, va_list ap); + + private: + bool m_haveCookie; + int m_cookie; + Handler32 m_handler; + }; + + + /** + * NativeTableEntry is an internal structure used for native + * method tables. It is wrapped by the NATIVE_METHOD() macros + * below. + */ + struct NativeTableEntry + { + typedef void (ScriptObject::*Handler)(); + int method_id; + enum { + kNativePrefix, + kNativeMethod, + kNativeMethod1, + kNativeMethodRest, + kNativeMethodV, + kNativeMethodV1, + } type; + Handler handler; + int cookie; + int flags; + }; + + /** + * Macros for declaring native methods + */ +#define BEGIN_NATIVE_MAP(_Class) NativeTableEntry _Class::natives[] = { + +#define DECLARE_NATIVE_MAP(_Class) static ClassClosure* createClassClosure(VTable* cvtable) \ +{ return new (cvtable->gc(), cvtable->getExtraSize()) _Class(cvtable); } \ +static NativeTableEntry natives[]; + +#define DECLARE_NATIVE_SCRIPT(_Script) static ScriptObject* createGlobalObject(VTable* vtable, ScriptObject* delegate) \ +{ return new (vtable->gc(), vtable->getExtraSize()) _Script(vtable, delegate); } \ +static NativeTableEntry natives[]; + +#define NATIVE_METHOD(method_id, handler) { avmplus::NativeID::method_id, NativeTableEntry::kNativeMethod, (NativeTableEntry::Handler)&handler, 0, AbstractFunction::NEEDS_CODECONTEXT | AbstractFunction::NEEDS_DXNS }, +#define NATIVE_METHOD_FLAGS(method_id, handler, fl) { avmplus::NativeID::method_id, NativeTableEntry::kNativeMethod, (NativeTableEntry::Handler)&handler, 0, fl }, + +#define NATIVE_METHOD2(method_id, handler) { avmplus::NativeID::method_id, NativeTableEntry::kNativeMethod, (NativeTableEntry::Handler)(handler), 0, AbstractFunction::NEEDS_CODECONTEXT | AbstractFunction::NEEDS_DXNS }, +#define NATIVE_METHOD2_FLAGS(method_id, handler,fl) { avmplus::NativeID::method_id, NativeTableEntry::kNativeMethod, (NativeTableEntry::Handler)(handler), 0, fl }, + +#define NATIVE_METHOD1(method_id, handler, cookie) { avmplus::NativeID::method_id, NativeTableEntry::kNativeMethod1, (NativeTableEntry::Handler)&handler, cookie, AbstractFunction::NEEDS_CODECONTEXT | AbstractFunction::NEEDS_DXNS }, +#define NATIVE_METHOD1_FLAGS(method_id, handler, cookie, fl) { avmplus::NativeID::method_id, NativeTableEntry::kNativeMethod1, (NativeTableEntry::Handler)&handler, cookie, fl }, + +#define NATIVE_METHODV(method_id, handler) { avmplus::NativeID::method_id, NativeTableEntry::kNativeMethodV, (NativeTableEntry::Handler)&handler, 0, AbstractFunction::NEEDS_CODECONTEXT | AbstractFunction::NEEDS_DXNS }, +#define NATIVE_METHODV_FLAGS(method_id, handler, fl) { avmplus::NativeID::method_id, NativeTableEntry::kNativeMethodV, (NativeTableEntry::Handler)&handler, 0, fl }, + +#define NATIVE_METHODV1(method_id, handler, cookie) { avmplus::NativeID::method_id, NativeTableEntry::kNativeMethodV1, (NativeTableEntry::Handler)&handler, cookie, AbstractFunction::NEEDS_CODECONTEXT | AbstractFunction::NEEDS_DXNS }, +#define NATIVE_METHODV1_FLAGS(method_id, handler, cookie, fl) { avmplus::NativeID::method_id, NativeTableEntry::kNativeMethodV1, (NativeTableEntry::Handler)&handler, cookie, fl }, + + +#define END_NATIVE_MAP() { -1, NativeTableEntry::kNativeMethod, NULL, 0 } }; + + /** + * NativeScriptInfo is an internal structure used for + * native script tables. It is wrapped by the + * NATIVE_SCRIPT() macro. + */ + struct NativeScriptInfo + { + typedef ScriptObject* (*Handler)(VTable*, ScriptObject*); + + int script_id; + Handler handler; + NativeTableEntry *nativeMap; + int sizeofInstance; + }; + + /** + * NativeClassInfo is an internal structure used for native + * method tables. It is wrapped by the NATIVE_CLASS() macro. + */ + struct NativeClassInfo + { + typedef ClassClosure* (*Handler)(VTable*); + + int class_id; + Handler handler; + NativeTableEntry *nativeMap; + int sizeofClass; + int sizeofInstance; + }; +} + +#endif /* __avmplus_NativeFunction__ */ diff --git a/mozilla/js/tamarin/core/NativeObjectHelpers.h b/mozilla/js/tamarin/core/NativeObjectHelpers.h new file mode 100644 index 00000000000..13aecf410fe --- /dev/null +++ b/mozilla/js/tamarin/core/NativeObjectHelpers.h @@ -0,0 +1,163 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 1993-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#ifndef __avmplus_NativeObjectHelpers__ +#define __avmplus_NativeObjectHelpers__ + +namespace avmplus +{ + namespace NativeObjectHelpers + { + // CN: ES3 compliance requires uint32 array and string indicies. The arguments to several + // array methods are integral values held in a double (to allow for negative offsets from + // the array length). To deal with this, ClampIndex replaces ClampA + // i.e. instead of doing this: + + // int start = core->integer(argv[0]); + // int end = core->integer(argv[1]]); + // ClampA(start,end,a->getLength()); + // + // do this: + // uint32 start = ClampArrayIndex( core->toInteger(argv[0]), a->getLength() ); + // uint32 end = ClampArrayIndex( core->toInteger(argv[1]), a->getLength() ); + // if (end < start) + // end == start; + inline uint32 ClampIndex(double intValue, uint32 length) + { + uint32 result; + if (intValue < 0.0) + { + if (intValue + length < 0.0) + result = 0; + else + result = (uint32)(intValue + length); + } + else if (intValue > length) + result = length; + else if (intValue != intValue) // lookout for NaN. It converts to a 0 int value on Win, but as 0xffffffff on Mac + result = 0; + else + result = (uint32)intValue; + + return result; + } + + inline uint32 ClampIndexInt(int intValue, uint32 length) + { + uint32 result; + if (intValue < 0) + { + if (intValue + length < 0) + result = 0; + else + result = (uint32)(intValue + length); + } + else if (intValue > (int)length) + result = length; + else + result = (uint32)intValue; + + return result; + } + + + inline void ClampB(double& start, double& end, int32 length) + { + AvmAssert(length >= 0); + + if (end < 0) + end = 0; + + if (end >= length) + end = length; + + if (start < 0) + start = 0; + + if (start >= length) + start = length; + + if (start > end) + { + double swap = start; + start = end; + end = swap; + } + + // Have the indexes been successfully normalized? + // Postconditions: + AvmAssert(start >= 0 && start <= length); + AvmAssert(end >= 0 && end <= length); + AvmAssert(start <= end); + } + + inline void ClampBInt(int& start, int& end, int32 length) + { + AvmAssert(length >= 0); + + if (end < 0) + end = 0; + + if (end >= length) + end = length; + + if (start < 0) + start = 0; + + if (start >= length) + start = length; + + if (start > end) + { + int swap = start; + start = end; + end = swap; + } + + // Have the indexes been successfully normalized? + // Postconditions: + AvmAssert(start >= 0 && start <= length); + AvmAssert(end >= 0 && end <= length); + AvmAssert(start <= end); + } + + inline void copyNarrowToWide(const char *src, wchar *dst) + { + while (*src) { + *dst++ = *src++; + } + *dst = 0; + } + } +} + +#endif /* __avmplus_NativeObjectHelpers__ */ diff --git a/mozilla/js/tamarin/core/Number.as b/mozilla/js/tamarin/core/Number.as new file mode 100644 index 00000000000..0a3516d514c --- /dev/null +++ b/mozilla/js/tamarin/core/Number.as @@ -0,0 +1,254 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +package +{ + public final class Number + { + // Number.length = 1 per ES3 + // E262 {ReadOnly, DontDelete, DontEnum } + public static const length:int = 1 + + // E262 {DontEnum, DontDelete, ReadOnly} + public static const NaN :Number = 0/0 + public static const NEGATIVE_INFINITY :Number = -1/0 + public static const POSITIVE_INFINITY :Number = 1/0 + public static const MIN_VALUE :Number = 4.9e-324 + public static const MAX_VALUE :Number = 1.7976931348623158e+308 + + // these must match the same constants in MathUtils + private static const DTOSTR_FIXED:int = 1 + private static const DTOSTR_PRECISION:int = 2 + private static const DTOSTR_EXPONENTIAL:int = 3 + + private static native function _toString(n:Number, radix:int):String + private static native function _convert(n:Number, precision:int, mode:int):String + + AS3 function toString(radix=10):String { + return _toString(this,radix) + } + AS3 function valueOf():Number { return this } + + prototype.toLocaleString = + prototype.toString = function (radix=10):String + { + if (this === prototype) return "0" + + if (!(this is Number)) + Error.throwError( TypeError, 1004 /*kInvokeOnIncompatibleObjectError*/, "Number.prototype.toString" ); + + return _toString(this, radix) + } + + prototype.valueOf = function() + { + if (this === prototype) return 0 + if (!(this is Number)) + Error.throwError( TypeError, 1004 /*kInvokeOnIncompatibleObjectError*/, "Number.prototype.valueOf" ); + return this; + } + + AS3 function toExponential(p=0):String + { + return _convert(this, int(p), DTOSTR_EXPONENTIAL) + } + prototype.toExponential = function(p=0):String + { + return _convert(Number(this), int(p), DTOSTR_EXPONENTIAL) + } + + AS3 function toPrecision(p=0):String + { + if (p == undefined) + return this.toString(); + + return _convert(this, int(p), DTOSTR_PRECISION) + } + prototype.toPrecision = function(p=0):String + { + if (p == undefined) + return this.toString(); + + return _convert(Number(this), int(p), DTOSTR_PRECISION) + } + + AS3 function toFixed(p=0):String + { + return _convert(this, int(p), DTOSTR_FIXED) + } + prototype.toFixed = function(p=0):String + { + return _convert(Number(this), int(p), DTOSTR_FIXED) + } + + // Dummy constructor function - This is neccessary so the compiler can do arg # checking for the ctor in strict mode + // The code for the actual ctor is in NumberClass::construct in the avmplus + public function Number(value = 0) + {} + + _dontEnumPrototype(prototype); + } + + public final class int + { + // based on Number: E262 {ReadOnly, DontDelete, DontEnum} + public static const MIN_VALUE:int = -0x80000000; + public static const MAX_VALUE:int = 0x7fffffff; + + // Number.length = 1 per ES3 + // E262 {ReadOnly, DontDelete, DontEnum } + public static const length:int = 1 + + AS3 function toString(radix=10):String { + return Number(this).AS3::toString(radix) + } + AS3 function valueOf():int { return this } + + prototype.toLocaleString = + prototype.toString = function toString(radix=10):String + { + if (this === prototype) return "0" + if (!(this is int)) + Error.throwError( TypeError, 1004 /*kInvokeOnIncompatibleObjectError*/, "int.prototype.toString" ); + return Number(this).toString(radix) + } + + prototype.valueOf = function() + { + if (this === prototype) return 0 + if (!(this is int)) + Error.throwError( TypeError, 1004 /*kInvokeOnIncompatibleObjectError*/, "int.prototype.valueOf" ); + return this + } + + AS3 function toExponential(p=0):String + { + return Number(this).AS3::toExponential(p) + } + prototype.toExponential = function(p=0):String + { + return Number(this).AS3::toExponential(p) + } + + AS3 function toPrecision(p=0):String + { + return Number(this).AS3::toPrecision(p) + } + prototype.toPrecision = function(p=0):String + { + return Number(this).AS3::toPrecision(p) + } + + AS3 function toFixed(p=0):String + { + return Number(this).AS3::toFixed(p) + } + prototype.toFixed = function(p=0):String + { + return Number(this).AS3::toFixed(p) + } + + // Dummy constructor function - This is neccessary so the compiler can do arg # checking for the ctor in strict mode + // The code for the actual ctor is in IntClass::construct in the avmplus + public function int(value = 0) + {} + + _dontEnumPrototype(prototype); + } + + public final class uint + { + // based on Number: E262 {ReadOnly, DontDelete, DontEnum} + public static const MIN_VALUE:uint = 0; + public static const MAX_VALUE:uint = 0xffffffff; + + // Number.length = 1 per ES3 + // E262 {ReadOnly, DontDelete, DontEnum} + public static const length:int = 1 + + AS3 function toString(radix=10):String { + return Number(this).AS3::toString(radix) + } + AS3 function valueOf():uint { return this } + + prototype.toLocaleString = + prototype.toString = function toString(radix=10):String + { + if (this === prototype) return "0" + if (!(this is Number)) + Error.throwError( TypeError, 1004 /*kInvokeOnIncompatibleObjectError*/, "uint.prototype.toString" ); + return Number(this).toString(radix) + } + + prototype.valueOf = function() + { + if (this === prototype) return 0 + if (!(this is uint)) + Error.throwError( TypeError, 1004 /*kInvokeOnIncompatibleObjectError*/, "uint.prototype.valueOf" ); + return this + } + + AS3 function toExponential(p=0):String + { + return Number(this).AS3::toExponential(p) + } + prototype.toExponential = function(p=0):String + { + return Number(this).AS3::toExponential(p) + } + + AS3 function toPrecision(p=0):String + { + return Number(this).AS3::toPrecision(p) + } + prototype.toPrecision = function(p=0):String + { + return Number(this).AS3::toPrecision(p) + } + + AS3 function toFixed(p=0):String + { + return Number(this).AS3::toFixed(p) + } + prototype.toFixed = function(p=0):String + { + return Number(this).AS3::toFixed(p) + } + + // Dummy constructor function - This is neccessary so the compiler can do arg # checking for the ctor in strict mode + // The code for the actual ctor is in UIntClass::construct in the avmplus + public function uint(value = 0) + {} + + _dontEnumPrototype(prototype); + } +} diff --git a/mozilla/js/tamarin/core/NumberClass.cpp b/mozilla/js/tamarin/core/NumberClass.cpp new file mode 100644 index 00000000000..5df95630ce7 --- /dev/null +++ b/mozilla/js/tamarin/core/NumberClass.cpp @@ -0,0 +1,110 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmplus.h" + +namespace avmplus +{ + BEGIN_NATIVE_MAP(NumberClass) + NATIVE_METHOD(Number_private__toString, NumberClass::toString) + NATIVE_METHOD(Number_private__convert, NumberClass::convert) + END_NATIVE_MAP() + + NumberClass::NumberClass(VTable* cvtable) + : ClassClosure(cvtable) + { + toplevel()->numberClass = this; + + // prototype objects are always vanilla objects. + createVanillaPrototype(); + } + + Atom NumberClass::construct(int argc, Atom* argv) + { + // Number called as constructor creates new Number instance + // Note: SpiderMonkey returns 0 for new Number() with no args + if (argc == 0) + return 0|kIntegerType; // yep this is zero atom + else + return core()->numberAtom(argv[1]); + // TODO ArgumentError if argc > 1 + } + + Stringp NumberClass::convert(double n, int precision, int mode) + { + AvmCore* core = this->core(); + + if (mode == MathUtils::DTOSTR_PRECISION) + { + if (precision < 1 || precision > 21) { + toplevel()->throwRangeError(kInvalidPrecisionError, core->toErrorString(precision), core->toErrorString(1), core->toErrorString(21)); + } + } + else + { + if (precision < 0 || precision > 20) { + toplevel()->throwRangeError(kInvalidPrecisionError, core->toErrorString(precision), core->toErrorString(0), core->toErrorString(20)); + } + } + + wchar buffer[256]; + int len; + MathUtils::convertDoubleToString(n, + buffer, + len, + mode, + precision); + + return new (core->GetGC()) String(buffer,len); + } + + Stringp NumberClass::toString(double dVal, int radix) + { + AvmCore* core = this->core(); + + if (radix == 10 || MathUtils::isInfinite(dVal) || MathUtils::isNaN(dVal)) + return core->doubleToString(dVal); + + if (radix < 2 || radix > 36) + toplevel()->throwRangeError(kInvalidRadixError, core->toErrorString(radix)); + + // convertDoubleToStringRadix will convert the integer part of dVal + // to a string in the specified radix, and it will handle large numbers + // beyond the range of int/uint. It will not handle the fractional + // part. To properly handle that, MathUtils::convertDoubleToString + // would have to handle any base. That's a lot of extra code and complexity for + // something the ES3 spec says is implementation dependent + // (i.e. we're not required to do it) + + return MathUtils::convertDoubleToStringRadix(core, dVal, radix); + } +} diff --git a/mozilla/js/tamarin/core/NumberClass.h b/mozilla/js/tamarin/core/NumberClass.h new file mode 100644 index 00000000000..03438d72a03 --- /dev/null +++ b/mozilla/js/tamarin/core/NumberClass.h @@ -0,0 +1,67 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_NumberClass__ +#define __avmplus_NumberClass__ + + +namespace avmplus +{ + /** + * class Number + */ + class NumberClass : public ClassClosure + { + public: + NumberClass(VTable* cvtable); + + // this = argv[0] (ignored) + // arg1 = argv[1] + // argN = argv[argc] + Atom construct(int argc, Atom* argv); + + // this = argv[0] + // arg1 = argv[1] + // argN = argv[argc] + Atom call(int argc, Atom* argv) + { + // Note: SpiderMonkey returns 0 for Number() with no args + return construct(argc,argv); + } + + Stringp convert(double n, int precision, int mode); + Stringp toString(double n, int radix); + + DECLARE_NATIVE_MAP(NumberClass) + }; +} + +#endif /* __avmplus_NumberClass__ */ diff --git a/mozilla/js/tamarin/core/OSDep.h b/mozilla/js/tamarin/core/OSDep.h new file mode 100644 index 00000000000..cd6abf45ffe --- /dev/null +++ b/mozilla/js/tamarin/core/OSDep.h @@ -0,0 +1,57 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_OSDep__ +#define __avmplus_OSDep__ + + +namespace avmplus +{ + /** + * The OSDep class is used to provide an abstraction layer + * over OS-dependent code required by the VM. This is + * typically code that accesses system services, such + * as date/time. + */ + class OSDep + { + public: + static double getDate(); + static double localTZA(double time); + static double daylightSavingTA(double time); + static uint64 currentTimeMillis(); + + static intptr startIntWriteTimer(uint32 millis, int *addr); + static void stopTimer(intptr handle); + }; +} + +#endif /* __avmplus_OSDep__ */ diff --git a/mozilla/js/tamarin/core/Object.as b/mozilla/js/tamarin/core/Object.as new file mode 100644 index 00000000000..9951aea64ce --- /dev/null +++ b/mozilla/js/tamarin/core/Object.as @@ -0,0 +1,118 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +package +{ + + /* + AS3 implementation constraint: + Object cannot have any per-instance properties, because it is extended by Boolean, String, + Number, Namespace, int, and uint, which cannot hold inherited state from Object because + we represent these types more compactly than with ScriptObject. + */ + + public dynamic class Object + { + // Object.length = 1 per ES3 + // E262 {ReadOnly, DontDelete, DontEnum } + public static const length:int = 1 + + private static native function _hasOwnProperty(o, V:String):Boolean + private static native function _propertyIsEnumerable(o, V:String):Boolean + protected static native function _setPropertyIsEnumerable(o, V:String, enumerable:Boolean):void + private static native function _isPrototypeOf(o, V):Boolean + private static native function _toString(o):String + + AS3 function isPrototypeOf(V=void 0):Boolean + { + return _isPrototypeOf(this,V) + } + + AS3 function hasOwnProperty(V=void 0):Boolean + { + return _hasOwnProperty(this,V) + } + + AS3 function propertyIsEnumerable(V=void 0):Boolean + { + return _propertyIsEnumerable(this, V) + } + + protected static function _dontEnumPrototype(proto:Object):void + { + for (var name:String in proto) + { + _setPropertyIsEnumerable(proto, name, false); + } + } + // delay proto functions until class Function is initialized. + static function init() + { + prototype.hasOwnProperty = + function(V=void 0):Boolean + { + return this.AS3::hasOwnProperty(V) + } + + prototype.propertyIsEnumerable = function(V=void 0) + { + return this.AS3::propertyIsEnumerable(V) + } + + prototype.setPropertyIsEnumerable = function(name:String,enumerable:Boolean):void + { + _setPropertyIsEnumerable(this, name, enumerable); + } + + prototype.isPrototypeOf = function(V=void 0):Boolean + { + return this.AS3::isPrototypeOf(V) + } + + prototype.toString = prototype.toLocaleString = + function():String + { + return _toString(this) + } + + prototype.valueOf = function() + { + return this + } + + _dontEnumPrototype(prototype); + } + } + + // dont create proto functions until after class Function is initialized + Object.init() +} diff --git a/mozilla/js/tamarin/core/ObjectClass.cpp b/mozilla/js/tamarin/core/ObjectClass.cpp new file mode 100644 index 00000000000..7af7e37a3d7 --- /dev/null +++ b/mozilla/js/tamarin/core/ObjectClass.cpp @@ -0,0 +1,225 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmplus.h" + +namespace avmplus +{ + BEGIN_NATIVE_MAP(ObjectClass) + NATIVE_METHOD(Object_private__hasOwnProperty, ObjectClass::hasOwnProperty) + NATIVE_METHOD(Object_private__propertyIsEnumerable, ObjectClass::propertyIsEnumerable) + NATIVE_METHOD(Object_protected__setPropertyIsEnumerable, ObjectClass::setPropertyIsEnumerable) + NATIVE_METHOD(Object_private__isPrototypeOf, ObjectClass::isPrototypeOf) + NATIVE_METHOD(Object_private__toString, ObjectClass::toString) + END_NATIVE_MAP() + + ObjectClass::ObjectClass(VTable* cvtable) + : ClassClosure(cvtable) + { + toplevel()->objectClass = this; + + // patch Object's instance vtable scope, since we created it earlier for + // bootstrapping + //ivtable()->scope = cvtable->scope; + + AvmAssert(traits()->sizeofInstance == sizeof(ObjectClass)); + // it is correct call construct() when this.prototype == null + prototype = construct(); + } + + void ObjectClass::initPrototype() + { + // patch global.__proto__ = Object.prototype + Toplevel* toplevel = this->toplevel(); + toplevel->setDelegate( prototype ); // global.__proto__ = Object.prototype + this->setDelegate( toplevel->classClass->prototype ); // Object.__proto__ = Class.prototype + } + + ScriptObject* ObjectClass::construct() + { + return (ScriptObject*) core()->newObject(ivtable(), prototype); + } + + // this = argv[0] + // arg1 = argv[1] + // argN = argv[argc] + Atom ObjectClass::call(int argc, Atom* argv) + { + // see E-262 15.2.1 + if (argc == 0 || AvmCore::isNullOrUndefined(argv[1])) + return construct(argc, argv); + else + return argv[1]; + } + + // this = argv[0] (ignored) + // arg1 = argv[1] + // argN = argv[argc] + Atom ObjectClass::construct(int argc, Atom* argv) + { + switch (argc) + { + default: + // TODO throw exception if argc > 1 (see E4 semantics) + case 1: { + Atom o = argv[1]; + if (!AvmCore::isNullOrUndefined(o)) + return o; + // else fall through + } + case 0: + return construct()->atom(); + } + } + + /** + 15.2.4.5 Object.prototype.hasOwnProperty (V) + When the hasOwnProperty method is called with argument V, the following steps are taken: + 1. Let O be this object. + 2. Call ToString(V). + 3. If O doesn’t have a property with the name given by Result(2), return false. + 4. Return true. + NOTE Unlike [[HasProperty]] (section 8.6.2.4), this method does not consider objects in the prototype chain. + */ + bool ObjectClass::hasOwnProperty(Atom thisAtom, Stringp name) + { + AvmCore* core = this->core(); + name = name ? core->internString(name) : (Stringp)core->knull; + + switch (thisAtom&7) + { + case kObjectType: + { + // ISSUE should this look in traits and dynamic vars, or just dynamic vars. + ScriptObject* obj = AvmCore::atomToScriptObject(thisAtom); + return obj->traits()->findBinding(name, core->publicNamespace) != BIND_NONE || + obj->hasProperty(name); + } + case kNamespaceType: + case kStringType: + case kBooleanType: + case kDoubleType: + case kIntegerType: + return toplevel()->toTraits(thisAtom)->findBinding(name, core->publicNamespace) != BIND_NONE; + default: + return false; + } + } + + bool ObjectClass::propertyIsEnumerable(Atom thisAtom, Stringp name) + { + AvmCore* core = this->core(); + name = name ? core->internString(name) : (Stringp)core->knull; + + if ((thisAtom&7) == kObjectType) + { + ScriptObject* obj = AvmCore::atomToScriptObject(thisAtom); + return obj->propertyIsEnumerable(name); + } + else if ((thisAtom&7) == kNamespaceType) + { + // Special case: + // E4X 13.2.5.1, 13.2.5.2 specifies that prefix and uri + // are not DontEnum. + return name == core->kuri || name == core->kprefix; + } + else + { + return false; + } + } + + void ObjectClass::setPropertyIsEnumerable(Atom thisAtom, Stringp name, bool enumerable) + { + AvmCore* core = this->core(); + name = name ? core->internString(name) : (Stringp)core->knull; + + if ((thisAtom&7) == kObjectType) + { + ScriptObject* obj = AvmCore::atomToScriptObject(thisAtom); + obj->setPropertyIsEnumerable(name, enumerable); + } + else + { + // cannot create properties on a sealed object. + Multiname multiname(core->publicNamespace, name); + toplevel()->throwReferenceError(kWriteSealedError, &multiname, traits()); + } + } + + /** + 15.2.4.6 Object.prototype.isPrototypeOf (V) + When the isPrototypeOf method is called with argument V, the following steps are taken: + 1. Let O be this object. + 2. If V is not an object, return false. + 3. Let V be the value of the [[Prototype]] property of V. + 4. if V is null, return false + 5. If O and V refer to the same object or if they refer to objects joined to each other (section 13.1.2), return true. + 6. Go to step 3. + */ + bool ObjectClass::isPrototypeOf(Atom thisAtom, Atom V) + { + // ECMA-262 Section 15.2.4.6 + if (AvmCore::isNullOrUndefined(V)) + return false; + + ScriptObject* o = toplevel()->toPrototype(V); + for (; o != NULL; o = o->getDelegate()) + { + if (o->atom() == thisAtom) + return true; + } + return false; + } + + /** + * Object.prototype.toString() + */ + Stringp ObjectClass::toString(Atom thisAtom) + { + AvmCore* core = this->core(); + + if (core->istype(thisAtom, CLASS_TYPE)) + { + ClassClosure *cc = (ClassClosure *)AvmCore::atomToScriptObject(thisAtom); + Traits* t = cc->ivtable()->traits; + Stringp s = core->concatStrings(core->newString("[class "), t->name); + return core->concatStrings(s, core->newString("]")); + } + else + { + Traits* t = toplevel()->toTraits(thisAtom); + Stringp s = core->concatStrings(core->newString("[object "), t->name); + return core->concatStrings(s, core->newString("]")); + } + } +} diff --git a/mozilla/js/tamarin/core/ObjectClass.h b/mozilla/js/tamarin/core/ObjectClass.h new file mode 100644 index 00000000000..ceeb6544a4a --- /dev/null +++ b/mozilla/js/tamarin/core/ObjectClass.h @@ -0,0 +1,71 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_ObjectClass__ +#define __avmplus_ObjectClass__ + + +namespace avmplus +{ + /** + * class Object + * base class for all objects in ES4 + */ + class ObjectClass : public ClassClosure + { + public: + DECLARE_NATIVE_MAP(ObjectClass) + ObjectClass(VTable* cvtable); + + void initPrototype(); + + ScriptObject* construct(); + + // this = argv[0] + // arg1 = argv[1] + // argN = argv[argc] + Atom call(int argc, Atom* argv); + + // this = argv[0] (ignored) + // arg1 = argv[1] + // argN = argv[argc] + Atom construct(int argc, Atom* argv); + + // native methods + bool hasOwnProperty(Atom thisAtom, Stringp name); + bool isPrototypeOf(Atom thisAtom, Atom other); + bool propertyIsEnumerable(Atom thisAtom, Stringp name); + void setPropertyIsEnumerable(Atom thisAtom, Stringp name, bool enumerable); + Stringp toString(Atom thisAtom); + }; +} + +#endif /* __avmplus_ObjectClass__ */ diff --git a/mozilla/js/tamarin/core/OutputStream.h b/mozilla/js/tamarin/core/OutputStream.h new file mode 100644 index 00000000000..c994f8f2ee7 --- /dev/null +++ b/mozilla/js/tamarin/core/OutputStream.h @@ -0,0 +1,55 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_OutputStream__ +#define __avmplus_OutputStream__ + + +namespace avmplus +{ + /** + * The OutputStream class is an abstract base class for + * output streams. Subclasses must implement the "write" + * method. + * + * The OutputStream class is typically layered with + * a PrintWriter to facilitate easy output of text. + */ + class OutputStream : public MMgc::GCObject + { + public: + OutputStream() {} + virtual ~OutputStream() {} + virtual int write(const void *buffer, int count) = 0; + }; +} + +#endif /* __avmplus_OutputStream__ */ diff --git a/mozilla/js/tamarin/core/PoolObject.cpp b/mozilla/js/tamarin/core/PoolObject.cpp new file mode 100644 index 00000000000..1188369db7d --- /dev/null +++ b/mozilla/js/tamarin/core/PoolObject.cpp @@ -0,0 +1,889 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmplus.h" + +namespace avmplus +{ + PoolObject::PoolObject(AvmCore* core, ScriptBuffer& sb, const byte* startPos) : + core(core), + cpool_int(0), + cpool_uint(0), + cpool_double(core->GetGC(), 0), + cpool_string(core->GetGC(), 0), + cpool_ns(core->GetGC(), 0), + cpool_ns_set(core->GetGC(), 0), + cpool_mn(0), + methods(core->GetGC(), 0), + metadata_infos(0), + cinits(core->GetGC(), 0), + scripts(core->GetGC(), 0), + abcStart(startPos) +#ifdef AVMPLUS_VERIFYALL + ,verifyQueue(core->GetGC(), 0) +#endif + { + namedTraits = new(core->GetGC()) MultinameHashtable(); + m_code = sb.getImpl(); +#ifdef AVMPLUS_MIR + codeBuffer = new (core->GetGC()) GrowableBuffer(core->GetGC()->GetGCHeap()); +#endif + version = AvmCore::readU16(&code()[0]) | AvmCore::readU16(&code()[2])<<16; + } + + PoolObject::~PoolObject() + { + #ifdef AVMPLUS_MIR + delete codeBuffer; + #endif + } + + AbstractFunction* PoolObject::getMethodInfo(uint32 index) + { + AvmAssert(index < methodCount); + return methods[index]; + } + + const byte* PoolObject::getMetadataInfoPos(uint32 index) + { + AvmAssert (index < metadataCount); + return metadata_infos[index]; + } + + Traits* PoolObject::getBuiltinTraits(Stringp name) const + { + AvmAssert(BIND_NONE == 0); + return (Traits*) namedTraits->getName(name); + } + + Traits* PoolObject::getTraits(Stringp name, Namespace* ns, bool recursive/*=true*/) const + { + // look for class in VM-wide type table + Traits* t = domain->getNamedTraits(name, ns, recursive); + + // look for class in current ABC file + if (t == NULL) + t = (Traits*) namedTraits->get(name, ns); + return t; + } + + Traits* PoolObject::getTraits(Stringp name, bool recursive/*=true*/) const + { + return getTraits(name, core->publicNamespace, recursive); + } + + Traits* PoolObject::getTraits(Multiname* mname, const Toplevel* toplevel, bool recursive/*=true*/) const + { + // do full lookup of multiname, error if more than 1 match + // return Traits if 1 match, NULL if 0 match, throw ambiguity error if >1 match + Traits* match = NULL; + if (mname->isBinding()) + { + // multiname must not be an attr name, have wildcards, or have runtime parts. + for (int i=0, n=mname->namespaceCount(); i < n; i++) + { + Traits* t = getTraits(mname->getName(), mname->getNamespace(i), recursive); + if (t != NULL) + { + if (match == NULL) + { + match = t; + } + else if (match != t) + { + // ambiguity + toplevel->throwReferenceError(kAmbiguousBindingError, mname); + } + } + } + } + return match; + } + + void PoolObject::addNamedTraits(Stringp name, Namespace* ns, Traits* traits) + { + namedTraits->add(name, ns, (Binding)traits); + } + +#ifdef AVMPLUS_VERIFYALL + void PoolObject::enq(AbstractFunction* f) + { + if (!f->isVerified() && !(f->flags & AbstractFunction::VERIFY_PENDING)) + { + f->flags |= AbstractFunction::VERIFY_PENDING; + verifyQueue.add(f); + } + } + + void PoolObject::enq(Traits* t) + { + for (int i=0, n=t->methodCount; i < n; i++) + { + AbstractFunction* f = t->getMethod(i); + if (f) + enq(f); + } + } + + void PoolObject::processVerifyQueue(Toplevel* toplevel) + { + while (!verifyQueue.isEmpty()) + { + AbstractFunction* f = verifyQueue.removeLast(); + AvmAssert(!f->isVerified()); + f->verify(toplevel); + } + } +#endif + + Namespace* PoolObject::getNamespace(int index) const + { + return cpool_ns[index]; + } + + NamespaceSet* PoolObject::getNamespaceSet(int index) const + { + return cpool_ns_set[index]; + } + + Stringp PoolObject::getString(int index) const + { + return cpool_string[index]; + } + + Atom PoolObject::getDefaultValue(const Toplevel* toplevel, uint32 index, CPoolKind kind, Traits* t) const + { + AvmAssert(index != 0); + // Look in the cpool specified by kind + switch(kind) + { + case CONSTANT_Int: + if( index >= constantIntCount ) + toplevel->throwVerifyError(kCpoolIndexRangeError, core->toErrorString(index), core->toErrorString(constantIntCount)); + return core->intToAtom(cpool_int[index]); + + case CONSTANT_UInt: + if( index >= constantUIntCount ) + toplevel->throwVerifyError(kCpoolIndexRangeError, core->toErrorString(index), core->toErrorString(constantUIntCount)); + return core->uintToAtom(cpool_uint[index]); + + case CONSTANT_Double: + if( index >= constantDoubleCount ) + toplevel->throwVerifyError(kCpoolIndexRangeError, core->toErrorString(index), core->toErrorString(constantDoubleCount)); + return kDoubleType|(int)cpool_double[index]; + + case CONSTANT_Utf8: + if( index >= constantStringCount ) + toplevel->throwVerifyError(kCpoolIndexRangeError, core->toErrorString(index), core->toErrorString(constantStringCount)); + return cpool_string[index]->atom(); + + case CONSTANT_True: + return trueAtom; + + case CONSTANT_False: + return falseAtom; + + case CONSTANT_Namespace: + case CONSTANT_PackageNamespace: + case CONSTANT_PackageInternalNs: + case CONSTANT_ProtectedNamespace: + case CONSTANT_ExplicitNamespace: + case CONSTANT_StaticProtectedNs: + case CONSTANT_PrivateNs: + if( index >= constantNsCount ) + toplevel->throwVerifyError(kCpoolIndexRangeError, core->toErrorString(index), core->toErrorString(constantNsCount)); + return cpool_ns[index]->atom(); + + case CONSTANT_Null: + return nullObjectAtom; + + default: + { + // Multinames & NamespaceSets are invalid default values. + if (t) + { + Multiname qname(t->ns, t->name); + toplevel->throwVerifyError(kIllegalDefaultValue, core->toErrorString(&qname)); + } + else + { + toplevel->throwVerifyError(kCorruptABCError); + } + return undefinedAtom; // not reached + } + } + } + + void PoolObject::parseMultiname(const byte *pos, Multiname& m) const + { + // the multiname has already been validated so we don't do + // any checking here, we just fill in the Multiname object + // with the information we have parsed. + + int index; + CPoolKind kind = (CPoolKind) *(pos++); + switch (kind) + { + case CONSTANT_Qname: + case CONSTANT_QnameA: + { + // U16 namespace_index + // U16 name_index + // parse a multiname with one namespace (aka qname) + + index = AvmCore::readU30(pos); + if (!index) + m.setAnyNamespace(); + else + m.setNamespace(getNamespace(index)); + + index = AvmCore::readU30(pos); + if (!index) + m.setAnyName(); + else + m.setName(getString(index)); + + m.setQName(); + m.setAttr(kind==CONSTANT_QnameA); + break; + } + + case CONSTANT_RTQname: + case CONSTANT_RTQnameA: + { + // U16 name_index + // parse a multiname with just a name; ns fetched at runtime + + index = AvmCore::readU30(pos); + if (!index) + m.setAnyName(); + else + m.setName(getString(index)); + + m.setQName(); + m.setRtns(); + m.setAttr(kind==CONSTANT_RTQnameA); + break; + } + + case CONSTANT_RTQnameL: + case CONSTANT_RTQnameLA: + { + m.setQName(); + m.setRtns(); + m.setRtname(); + m.setAttr(kind==CONSTANT_RTQnameLA); + break; + } + + case CONSTANT_Multiname: + case CONSTANT_MultinameA: + { + index = AvmCore::readU30(pos); + if (!index) + m.setAnyName(); + else + m.setName(getString(index)); + + index = AvmCore::readU30(pos); + AvmAssert(index != 0); + m.setNsset(getNamespaceSet(index)); + + m.setAttr(kind==CONSTANT_MultinameA); + break; + } + + case CONSTANT_MultinameL: + case CONSTANT_MultinameLA: + { + m.setRtname(); + + index = AvmCore::readU30(pos); + AvmAssert(index != 0); + m.setNsset(getNamespaceSet(index)); + + m.setAttr(kind==CONSTANT_MultinameLA); + break; + } + + default: + AvmAssert(false); + } + + return; + } + + + Atom PoolObject::resolveQName(const byte* &p, Multiname &m, const Toplevel* toplevel) const + { + uint32 index = AvmCore::readU30(p); + + if (index == 0 || index >= constantMnCount) + toplevel->throwVerifyError(kCpoolIndexRangeError, core->toErrorString(index), core->toErrorString(constantMnCount)); + + Atom a = cpool_mn[index]; + + parseMultiname(a, m); + if (!m.isQName()) + toplevel->throwVerifyError(kCpoolEntryWrongTypeError, core->toErrorString(index)); + + return a; + } + + + Traits* PoolObject::resolveTypeName(const byte* &pc, const Toplevel* toplevel, bool allowVoid/*=false*/) const + { + // only save the type name for now. verifier will resolve to traits + uint32 index = AvmCore::readU30(pc); + if (index == 0) + { + return NULL; + } + + // check contents is a multiname. in the cpool, and type system, kObjectType means multiname. + if (index >= constantMnCount) + toplevel->throwVerifyError(kCpoolIndexRangeError, core->toErrorString(index), core->toErrorString(constantMnCount)); + + Atom a = cpool_mn[index]; + + Multiname m; + parseMultiname(a, m); + + Traits* t = getTraits(&m, toplevel); + if (!t) + { + #ifdef AVMPLUS_VERBOSE + if (!toplevel || !toplevel->verifyErrorClass()) + core->console << "class not found: " << &m << "\n"; + #endif + toplevel->throwVerifyError(kClassNotFoundError, core->toErrorString(&m)); + } + + if (!allowVoid && t == VOID_TYPE) + toplevel->throwVerifyError(kIllegalVoidError); + + return t; + } + + void PoolObject::allowEarlyBinding(Traits* t, bool& slot) const + { + // the compiler can early bind to a type's slots when it's defined + // in the same abc file (ensuring it came from the same compiler) + // or when the base class came from another abc file and has zero slots + // this ensures you cant use the early opcodes to access an external type's + // private members. + slot = true; + while (t != NULL && t->slotCount > 0 && slot) + { + if (t->pool != this) + { + if(t->slotCount > 0) + slot = false; + } + t = t->base; + } + } + + void PoolObject::resolveTraits(Traits *traits, int firstSlot, const Toplevel* toplevel) + { + int offset = traits->sizeofInstance; + int padoffset = -1; + if (traits->base && traits->base->base) + { + AvmAssert(traits->base->getTotalSize() != 0); + offset += traits->base->getTotalSize() - traits->base->sizeofInstance; + } + + const byte* pos = traits->getTraitsPos(); + AvmAssert(pos != NULL); + + int nameCount = AvmCore::readU30(pos); + + int slot_id = firstSlot; + + AbcGen gen(core->GetGC(), traits->slotCount * 7); + + bool earlySlotBinding; + allowEarlyBinding(traits, earlySlotBinding); + + for (int i=0; i < nameCount; i++) + { + Multiname qn; + resolveQName(pos, qn, toplevel); + Stringp name = qn.getName(); + Namespace* ns = qn.getNamespace(); + int tag = (TraitKind)pos[0]; + TraitKind kind = (TraitKind) (tag & 0x0f); //Get rid of the flags + pos += 1; + + switch (kind) + { + case TRAIT_Slot: + case TRAIT_Const: + { + // compute the slot + uint32 useSlotId = AvmCore::readU30(pos); + if(!earlySlotBinding ) useSlotId = 0; + if (!useSlotId) + useSlotId = slot_id++; + else + useSlotId--; + + // compute the type + Traits* slotTraits = resolveTypeName(pos, toplevel); + + // default value + int value_index = AvmCore::readU30(pos); + + CPoolKind value_kind = (CPoolKind)0; + if (value_index) + { + value_kind = (CPoolKind)*(pos++); + } + + // default value for this slot. + int slotOffset; + if (slotTraits == NUMBER_TYPE) + { + // 8-aligned, 8-byte field + if (offset&7) + { + padoffset = offset; + offset += 4; + } + slotOffset = offset; + offset += 8; + } + else + { + // 4-aligned, 4-byte field + if (padoffset != -1) + { + slotOffset = padoffset; + padoffset = -1; + } + else + { + slotOffset = offset; + offset += 4; + } + } + + traits->setSlotInfo(value_index, useSlotId, toplevel, slotTraits, slotOffset, value_kind, gen); + if( tag & ATTR_metadata ) + { + traits->setSlotMetadataPos(useSlotId, pos); + } + break; + } + + case TRAIT_Class: + { + // compute the slot + uint32 useSlotId = AvmCore::readU30(pos); + if( !earlySlotBinding ) useSlotId = 0; + if (!useSlotId) + useSlotId = slot_id++; + else + useSlotId--; + + // get the class type + uint32 class_info = AvmCore::readU30(pos); + if (class_info >= classCount) + toplevel->throwVerifyError(kClassInfoExceedsCountError, core->toErrorString(class_info), core->toErrorString(classCount)); + + AbstractFunction* cinit = cinits[class_info]; + if (!cinit) + toplevel->throwVerifyError(kClassInfoOrderError, core->toErrorString(class_info)); + + int slotOffset; + // 4-aligned, 4-byte field + if (padoffset != -1) + { + slotOffset = padoffset; + padoffset = -1; + } + else + { + slotOffset = offset; + offset += 4; + } + + traits->setSlotInfo(0, useSlotId, toplevel, cinit->declaringTraits, slotOffset, CPoolKind(0), gen); + break; + } + + case TRAIT_Method: + { + int earlyDispId = AvmCore::readU30( pos ); + (void)earlyDispId; + + uint32 method_info = AvmCore::readU30(pos); + + // method_info range already checked in AbcParser + AvmAssert(method_info < methodCount); + AbstractFunction *f = getMethodInfo(method_info); + AvmAssert(f != NULL); + + // disp_id assigned by abcParser, this binding must exist already. + Binding b = traits->get(name, ns); + + AvmAssert(AvmCore::isMethodBinding(b)); + int disp_id = AvmCore::bindingToMethodId(b); + + // !!@ Ed says there may be an earlier place in AbcParser to catch this + if (traits->getMethod(disp_id) && traits->getOverride(ns,name,tag,toplevel) == BIND_NONE) + { + toplevel->throwVerifyError(kDuplicateDispIdError, core->toErrorString(traits->getMethod(disp_id)), core->toErrorString(disp_id)); + } + traits->setMethod(disp_id, f); + if( tag & ATTR_metadata ) + { + traits->setMethodMetadataPos(disp_id, pos); + } + break; + } + + case TRAIT_Getter: + case TRAIT_Setter: + { + int earlyDispId = AvmCore::readU30(pos); + (void)earlyDispId; + + uint32 method_info = AvmCore::readU30(pos); + + // method_info already checked in AbcParser + AvmAssert(method_info < methodCount); + AbstractFunction* f = getMethodInfo(method_info); + AvmAssert(f != NULL); + + Binding b = traits->get(name, ns); + + AvmAssert(b==BIND_NONE || AvmCore::isAccessorBinding(b)); + uint32 disp_id = kind == TRAIT_Getter ? AvmCore::bindingToGetterId(b) : AvmCore::bindingToSetterId(b); + AvmAssert(disp_id < traits->methodCount); + // !!@ Ed says there may be an earlier place in AbcParser to catch this + if (traits->getMethod(disp_id)) + { + Binding baseBinding = traits->getOverride(ns,name,tag,toplevel); + if (kind == TRAIT_Getter && !AvmCore::hasGetterBinding(baseBinding) || + kind == TRAIT_Setter && !AvmCore::hasSetterBinding(baseBinding)) + { + toplevel->throwVerifyError(kDuplicateDispIdError, core->toErrorString(traits->getMethod(disp_id)), core->toErrorString(disp_id)); + } + } + traits->setMethod(disp_id, f); + if( tag & ATTR_metadata ) + { + traits->setMethodMetadataPos(disp_id, pos); + } + + break; + } + + case TRAIT_Function: + { + // compute the slot + int useSlotId = AvmCore::readU30(pos); + if( !earlySlotBinding ) useSlotId = 0; + if (!useSlotId) + useSlotId = slot_id++; + else + useSlotId--; + + // compute the type + uint32 method_info = AvmCore::readU30(pos); + + AbstractFunction *f = getMethodInfo(method_info); + + int slotOffset; + // 4-aligned, 4-byte field + if (padoffset != -1) + { + slotOffset = padoffset; + padoffset = -1; + } + else + { + slotOffset = offset; + offset += 4; + } + + traits->setSlotInfo(0, useSlotId, toplevel, f->declaringTraits, slotOffset, CPoolKind(0), gen); + if( tag & ATTR_metadata ) + { + traits->setMethodMetadataPos(useSlotId, pos); + } + break; + } + } + + // skip metadata + if( tag & ATTR_metadata ) + { + int metaCount = AvmCore::readU30(pos); + for( int metadata = 0; metadata < metaCount; ++metadata ) + { + AvmCore::readU30(pos); + } + } + } + + int *offsets = traits->getOffsets(); + for (uint32 i=0, n=traits->slotCount; i < n; i++) + { + if (offsets[i] == 0) + { + // sparse slot table. make types default to * + #ifdef AVMPLUS_VERBOSE + if (verbose) + { + core->console << "WARNING: slot " << i+1 << " on " << traits << " not defined by compiler. Using *\n"; + } + #endif + + int slotOffset; + // 4-aligned, 4-byte field + if (padoffset != -1) + { + slotOffset = padoffset; + padoffset = -1; + } + else + { + slotOffset = offset; + offset += 4; + } + + traits->setSlotInfo(0, i, toplevel, NULL, slotOffset, CPoolKind(0), gen); + } + } + + // if initialization code gen is required, create a new method body and write it to traits->init->body_pos + if(gen.size() > 0) + { + AbcGen newMethodBody(core->GetGC(), 16+gen.size()); + + // insert body preamble + MethodInfo *init; + + if(traits->init) { + init = (MethodInfo*)(AbstractFunction*)traits->init; + const byte *pos = init->body_pos; + if( !init->body_pos ) toplevel->throwVerifyError(kCorruptABCError); + + int maxStack = AvmCore::readU30(pos); + // the code we're generating needs at least 2 + maxStack = maxStack > 1 ? maxStack : 2; + newMethodBody.writeInt(maxStack); // max_stack + newMethodBody.writeInt(AvmCore::readU30(pos)); //local_count + newMethodBody.writeInt(AvmCore::readU30(pos)); //init_scope_depth + newMethodBody.writeInt(AvmCore::readU30(pos)); //max_scope_depth + + // skip real code length + int code_length = AvmCore::readU30(pos); + + // if first instruction is OP_constructsuper keep it as first instruction + if(*pos == OP_constructsuper) + { + gen.getBytes().insert(0, OP_constructsuper); + // don't invoke it again later + pos++; + code_length--; + } + + gen.abs_jump(pos, code_length); + + } else { + // make one + init = new (core->GetGC()) MethodInfo(); + init->declaringTraits = traits; + init->pool = this; + init->param_count = 0; + init->restOffset = 4; // sizeof(this) + init->initParamTypes(1); + init->setParamType(0, traits); + init->setReturnType(VOID_TYPE); + traits->init = init; + init->flags |= AbstractFunction::LINKED; + + newMethodBody.writeInt(2); // max_stack + newMethodBody.writeInt(1); //local_count + newMethodBody.writeInt(1); //init_scope_depth + newMethodBody.writeInt(1); //max_scope_depth + + gen.returnvoid(); + } + + newMethodBody.writeInt(gen.size()); // code length + newMethodBody.writeBytes(gen.getBytes()); + + // no exceptions, when we jump to the real code, we'll read the exceptions for that code + newMethodBody.writeInt(0); + + // the verifier and interpreter don't read the activation traits so stop here + byte *newBytes = (byte*) core->GetGC()->Alloc(newMethodBody.size()); + memcpy(newBytes, newMethodBody.getBytes().getData(), newMethodBody.size()); + //init->body_pos = newBytes; + WB(core->GetGC(), init, &init->body_pos, newBytes); + } + + if (traits->base && traits->base->base && traits->base->hashTableOffset != -1) + { + traits->hashTableOffset = traits->base->hashTableOffset + traits->sizeofInstance - traits->base->sizeofInstance; + } + else if (traits->needsHashtable) + { + traits->hashTableOffset = offset; + offset += sizeof(Hashtable); + } + + traits->setTotalSize((size_t) offset); + } + + Binding Traits::getOverride(Namespace* ns, Stringp name, int tag, const Toplevel *toplevel) const + { + int kind = tag & 0x0f; + Binding baseBinding = BIND_NONE; + if (base) + { + if (protectedNamespace == ns && base->protectedNamespace) + { + baseBinding = base->findBinding(name, base->protectedNamespace); + } + else + { + baseBinding = base->findBinding(name, ns); + } + } + if (baseBinding == BIND_NONE) + { + if (tag & ATTR_override) + { + // error if override attr set, and nothing is actually overridden + Multiname qname(ns,name); + toplevel->throwVerifyError(kIllegalOverrideError, toplevel->core()->toErrorString(&qname), toplevel->core()->toErrorString((Traits*)this)); + } + return BIND_NONE; + } + + switch (kind) + { + case TRAIT_Method: + { + if (AvmCore::isMethodBinding(baseBinding)) + { + if (!(tag & ATTR_override)) + { + // error if override flag not set, and something is overridden + break; + } + return baseBinding; + } + // error, method can only override a virtual method + break; + } + case TRAIT_Getter: + { + if (AvmCore::hasGetterBinding(baseBinding)) + { + if (!(tag & ATTR_override)) + { + // error if override flag not set, and something is overridden + break; + } + return baseBinding; + } + if ((baseBinding&7) == BIND_SET) + { + if (tag & ATTR_override) + { + // error if override attr set, and nothing is actually overridden + break; + } + return baseBinding; + } + // error, method can only override a virtual method + break; + } + case TRAIT_Setter: + { + if (AvmCore::hasSetterBinding(baseBinding)) + { + if (!(tag & ATTR_override)) + { + // error if override flag not set, and something is overridden + break; + } + return baseBinding; + } + if ((baseBinding&7) == BIND_GET) + { + if (tag & ATTR_override) + { + // error if override attr set, and nothing is actually overridden + break; + } + return baseBinding; + } + // error, method can only override a virtual method + break; + } + default: + // internal error to call getOverride on a non-method trait + AvmAssert(false); + break; + } + Multiname qname(ns,name); +#ifdef AVMPLUS_VERBOSE + if (pool->verbose) + core->console << "illegal override in "<< this << ": " << &qname <<"\n"; +#endif + toplevel->throwVerifyError(kIllegalOverrideError, toplevel->core()->toErrorString(&qname), toplevel->core()->toErrorString((Traits*)this)); + return BIND_NONE; + } + + void PoolObject::addPrivateNamedScript(Stringp name, Namespace* ns, AbstractFunction *script) + { + privateNamedScripts.add(name, ns, (Atom)script); + } + + AbstractFunction* PoolObject::getNamedScript(Multiname* multiname) const + { + AbstractFunction *f = domain->getNamedScript(multiname); + if(!f) + { + f = (AbstractFunction*)privateNamedScripts.getMulti(multiname); + } + return f; + } +} diff --git a/mozilla/js/tamarin/core/PoolObject.h b/mozilla/js/tamarin/core/PoolObject.h new file mode 100644 index 00000000000..d5b5173fa5c --- /dev/null +++ b/mozilla/js/tamarin/core/PoolObject.h @@ -0,0 +1,199 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_PoolObject__ +#define __avmplus_PoolObject__ + + +namespace avmplus +{ + /** + * The PoolObject class is a container for the pool of resources + * decoded from an ABC file: the constant pool, the methods + * defined in the ABC, the classes defined in the ABC, and so on. + */ + class PoolObject : public MMgc::GCFinalizedObject + { + public: + AvmCore *core; + + /** constants */ + List cpool_int; + List cpool_uint; + List cpool_double; + List cpool_string; + List cpool_ns; + List cpool_ns_set; + + // LIST_NonGCObjects b/c these aren't really atoms, they are offsets + List cpool_mn; + + /** all methods */ + List methods; + + /** metadata */ + List metadata_infos; + + /** domain */ + DWB(Domain*) domain; + + /** constructors for class objects, for op_newclass */ + List cinits; // TODO just use methods array, dont need new cinits array + List scripts; + + /** # of elements in methods array */ + uint32 methodCount; + + /** # of elements in metadata array */ + uint32 metadataCount; + + /** # of elements in cpool array */ + uint32 constantCount; + uint32 constantIntCount; + uint32 constantUIntCount; + uint32 constantDoubleCount; + uint32 constantStringCount; + uint32 constantNsCount; + uint32 constantNsSetCount; + uint32 constantMnCount; + + /** # of elements in classes array */ + uint32 classCount; + + /** # of elements in scripts array */ + uint32 scriptCount; + + // true if this pool is baked into the player. used to control + // whether callees will set their context. + bool isBuiltin; + + #ifdef AVMPLUS_MIR + /** buffer containing generated machine code for all methods */ + GrowableBuffer *codeBuffer; + int stackOverflowHandler; // address of stack overflow handler + #endif /*AVMPLUS_MIR */ + + PoolObject(AvmCore* core, ScriptBuffer& sb, const byte* startpos); + ~PoolObject(); + + AbstractFunction* getMethodInfo(uint32 index); + + AbstractFunction* getNamedScript(Multiname* multiname) const; + + const byte* getMetadataInfoPos(uint32 index); + Traits* getTraits(Stringp name, Namespace* ns, bool recursive=true) const; + Traits* getTraits(Multiname* n, const Toplevel* toplevel, bool recursive=true) const; + Traits* getTraits(Stringp name, bool recursive=true) const; + + Traits* getBuiltinTraits(Stringp name) const; + + void addPrivateNamedScript(Stringp name, Namespace* ns, AbstractFunction *a); + void addNamedTraits(Stringp name, Namespace* ns, Traits* traits); + + // + // deferred parsing + // + + void parseMultiname(const byte *pos, Multiname& m) const; + void resolveTraits(Traits *traits, int firstSlot, const Toplevel* toplevel); + Traits* resolveTypeName(const byte* &pc, const Toplevel* toplevel, bool allowVoid=false) const; + Atom resolveQName(const byte* &p, Multiname &m, const Toplevel* toplevel) const; + + + + /** + * we allow early binding to a type if it is defined in + * the same abc file as the reference, or if the type is + * specially marked to allow early binding by making it's + * Traits->pool pointer be null. We only do this for Object + */ + void allowEarlyBinding(Traits* t, bool& slot) const; + + void parseMultiname(Multiname& m, int index) const + { + Atom a = cpool_mn[index]; + parseMultiname(atomToPos(a), m); + } + + void parseMultiname(Atom a, Multiname& m) const + { + parseMultiname(atomToPos(a), m); + } + + Namespace* getNamespace(int index) const; + NamespaceSet* getNamespaceSet(int index) const; + Stringp getString(int index) const; + + Atom getDefaultValue(const Toplevel* toplevel, uint32 index, CPoolKind kind, Traits* t) const; + + Atom posToAtom(const byte* pos) const + { + return (pos - abcStart)<<3 | kObjectType; + } + + const byte* atomToPos(Atom a) const + { + AvmAssert((a&7)==kObjectType); + return abcStart + urshift(a,3); + } + + +#ifdef AVMPLUS_VERIFYALL + List verifyQueue; + void enq(AbstractFunction* f); + void enq(Traits* t); + void processVerifyQueue(Toplevel* toplevel); +#endif + #ifdef AVMPLUS_VERBOSE + bool verbose; + #endif + + int version; + + ScriptBuffer code() + { + return (ScriptBufferImpl*)m_code; + } + + bool isCodePointer(const byte* pos) + { + return pos > &code()[0] && pos < m_code->getBuffer() + code().getSize(); + } + + private: + DWB(MultinameHashtable*) namedTraits; + MultinameHashtable privateNamedScripts; + DWB(ScriptBufferImpl*) m_code; + const byte * const abcStart; + }; +} + +#endif /* __avmplus_PoolObject__ */ diff --git a/mozilla/js/tamarin/core/PrintWriter.cpp b/mozilla/js/tamarin/core/PrintWriter.cpp new file mode 100644 index 00000000000..48f07101ee1 --- /dev/null +++ b/mozilla/js/tamarin/core/PrintWriter.cpp @@ -0,0 +1,464 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmplus.h" + +namespace avmplus +{ + int PrintWriter::write(const void *buffer, int count) + { + if (m_stream) { + int result = m_stream->write(buffer, count); + + const char *ptr = (const char *) buffer; + while (--count >= 0) { + switch (*ptr) { + case '\n': + col = 0; + break; + case '\t': + col = ((col>>3)+1)<<3; + break; + default: + col++; + break; + } + ptr++; + } + + return result; + } else { + return 0; + } + } + + PrintWriter& PrintWriter::operator<< (tabstop tabs) + { + while (col <= tabs.getSpaces()) { + *this << ' '; + } + return *this; + } + + PrintWriter& PrintWriter::operator<< (hexDWord value) + { + writeHexDWord(value.getValue()); + return *this; + } + + PrintWriter& PrintWriter::operator<< (percent value) + { + wchar buffer[256]; + int len; + MathUtils::convertDoubleToString(value.getPercent(), buffer, len); + wchar *ptr = buffer; + while (*ptr) { + if (*ptr == '.' && *(ptr+1)) { + *(ptr+2) = 0; + break; + } + ptr++; + } + if (value.getPercent() < 10) { + *this << ' '; + } + *this << buffer; + return *this; + } + + PrintWriter& PrintWriter::operator<< (const char *str) + { + write(str, String::Length(str)); + return *this; + } + + PrintWriter& PrintWriter::operator<< (bool b) + { + *this << (b ? "true" : "false"); + return *this; + } + + PrintWriter& PrintWriter::operator<< (const wchar *str) + { + while (*str) { + *this << *str++; + } + return *this; + } + + PrintWriter& PrintWriter::operator<< (char value) + { + write(&value, 1); + return *this; + } + + PrintWriter& PrintWriter::operator<< (wchar value) + { + // Encode the character as UTF-8 + if (value < 0x80) { + *this << (char)value; + } else { + uint8 Octets[6]; + int OctetsLen = UnicodeUtils::Ucs4ToUtf8((uint32)value, Octets); + write(Octets, OctetsLen); + } + return *this; + } + + PrintWriter& PrintWriter::operator<< (int value) + { + wchar buffer[256]; + int len; + if (MathUtils::convertIntegerToString(value, buffer, len)) { + *this << buffer; + } + return *this; + } + + PrintWriter& PrintWriter::operator<< (uint32 value) + { + wchar buffer[256]; + int len; + if (MathUtils::convertIntegerToString(value, buffer, len, 10, true)) { + *this << buffer; + } + return *this; + } + + PrintWriter& PrintWriter::operator<< (double value) + { + wchar buffer[256]; + int len; + MathUtils::convertDoubleToString(value, buffer, len); + *this << buffer; + return *this; + } + + PrintWriter& PrintWriter::operator<< (Stringp str) + { + return *this << str->c_str(); + } + + PrintWriter& PrintWriter::operator<< (ScriptObject *obj) + { +#ifdef AVMPLUS_VERBOSE + if (obj) { + return *this << obj->format(m_core); + } else { + return *this << "null"; + } +#else + (void)obj; + AvmAssert(0); // this is only supported in AVMPLUS_VERBOSE builds + return *this; +#endif + } + PrintWriter& PrintWriter::operator<< (const Traits *obj) + { +#ifdef AVMPLUS_VERBOSE + if (obj) { + return *this << obj->format(m_core); + } else { + return *this << "*"; + } +#else + (void)obj; + AvmAssert(0); // this is only supported in AVMPLUS_VERBOSE builds + return *this; +#endif + } + PrintWriter& PrintWriter::operator<< (AbstractFunction *obj) + { +#ifdef AVMPLUS_VERBOSE + if (obj) { + return *this << obj->format(m_core); + } else { + return *this << "null"; + } +#else + (void)obj; + AvmAssert(0); // this is only supported in AVMPLUS_VERBOSE builds + return *this; +#endif + } + + PrintWriter& PrintWriter::operator<< (Multiname *obj) + { + // Made available in non-AVMPLUS_VERBOSE builds for describeType +//#ifdef AVMPLUS_VERBOSE +#if 1 + if (obj) { + return *this << obj->format(m_core); + } else { + return *this << "null"; + } +#else + AvmAssert(0); // this is only supported in AVMPLUS_VERBOSE builds + return *this; +#endif + } + + PrintWriter& PrintWriter::operator<< (Namespace* ns) + { + // Made available in non-AVMPLUS_VERBOSE builds for describeType +//#ifdef AVMPLUS_VERBOSE +#if 1 + if (ns) + return *this << ns->format(m_core); + else + return *this << "null"; +#else + AvmAssert(0); // this is only supported in AVMPLUS_VERBOSE builds + return *this; +#endif + } + + PrintWriter& PrintWriter::operator<< (Atom atom) + { +#ifdef AVMPLUS_VERBOSE + return *this << m_core->format(atom); +#else + (void)atom; + AvmAssert(0); // this is only supported in AVMPLUS_VERBOSE builds + return *this; +#endif + } + + void PrintWriter::writeHexNibble(uint8 value) + { + if (value < 10) { + *this << (char)(value+'0'); + } else { + *this << (char)(value+'A'-10); + } + } + + void PrintWriter::writeHexByte(uint8 value) + { + writeHexNibble(value>>4); + writeHexNibble(value&0x0f); + } + + void PrintWriter::writeHexWord(uint16 value) + { + writeHexByte(value>>8); + writeHexByte(value&0xff); + } + + void PrintWriter::writeHexDWord(uint32 value) + { + writeHexByte(uint8((value>>24) & 0xff)); + writeHexByte(uint8((value>>16) & 0xff)); + writeHexByte(uint8(value>>8)); + writeHexByte(uint8(value&0xff)); + } + + void PrintWriter::formatTypeName(Traits* t) + { + if (!t) + { + *this << "*"; + return; + } + + if (t->base == m_core->traits.class_itraits) + { + t = t->itraits; + *this << "class "; + } + + if (t->ns != NULL && t->ns != m_core->publicNamespace) + *this << t->ns << "."; + + if (t->name) + *this << t->name; + else + *this << "(null)"; + } + +#ifdef AVMPLUS_VERBOSE + void PrintWriter::formatP(const char* format, Stringp arg1, Stringp arg2, Stringp arg3) + { + while (*format) + { + if (*format == '%') + { + switch (*++format) + { + case '1': + AvmAssertMsg(arg1!=0, "Expected argument got null"); + if (arg1) *this << arg1; + break; + + case '2': + AvmAssertMsg(arg2!=0, "Expected argument got null"); + if (arg2) *this << arg2; + break; + + case '3': + AvmAssertMsg(arg3!=0, "Expected argument got null"); + if (arg3) *this << arg3; + break; + + default: + AvmAssertMsg(0, "Invalid specifier; should be between '1' and '3'"); + break; + } + } + else + { + *this << *format; + } + format++; + } + } + + void PrintWriter::format(const char *format, ...) + { + va_list ap; + va_start(ap, format); + formatV(format, ap); + va_end(ap); + } + + void PrintWriter::formatV(const char *format, va_list ap) + { + while (*format) { + if (*format == '%') { + switch (*++format) { + case 's': + *this << va_arg(ap, char*); + break; + case 'w': + *this << va_arg(ap, wchar*); + break; + case 'a': + *this << m_core->format(va_arg(ap, Atom)); + break; + case 'o': + *this << va_arg(ap, ScriptObject*); + break; + case 't': + formatTypeName(va_arg(ap, Traits*)); + break; + case 'm': + *this << va_arg(ap, AbstractFunction*); + break; + case 'n': + *this << va_arg(ap, Multiname*)->format(m_core, Multiname::MULTI_FORMAT_NAME_ONLY); + break; + case 'N': + *this << va_arg(ap, Multiname*)->format(m_core, Multiname::MULTI_FORMAT_NS_ONLY); + break; + #ifdef AVMPLUS_MIR + case 'A': // addr + *this << hexDWord(va_arg(ap,int)); + break; + + #ifdef AVMPLUS_ARM + case 'R': // gp reg + *this << CodegenMIR::regNames[va_arg(ap, int)]; + break; + #endif + + #ifdef AVMPLUS_PPC + case 'R': {// gp reg + int r = va_arg(ap,int); + if (r == CodegenMIR::Unknown) + *this << "0"; + else + *this << CodegenMIR::gpregNames[r]; + break; + } + case 'F': // fp reg + *this << CodegenMIR::fpregNames[va_arg(ap, int)]; + break; + #endif + + #ifdef AVMPLUS_IA32 + case 'R': {// gp reg + int r = va_arg(ap,int); + if (r == CodegenMIR::Unknown) + *this << "0"; + else + *this << CodegenMIR::gpregNames[r]; + break; + } + case 'F': // fp reg + *this << CodegenMIR::xmmregNames[va_arg(ap, int)]; + break; + case 'X': // x87 reg + *this << CodegenMIR::x87regNames[va_arg(ap, int)]; + break; + #endif + #endif + case 'S': + *this << va_arg(ap, Stringp); + break; + case '2': + { + // A 2-digit integer. + int value = va_arg(ap, int); + *this << (char) ((value/10) + '0'); + *this << (char) ((value%10) + '0'); + } + break; + case '3': + { + // A 3-char month, used by Date. + char *str = va_arg(ap, char *); + *this << str[0] << str[1] << str[2]; + } + break; + case 'c': + { + // gcc complains if you put va_arg(ap, char) + char value = va_arg(ap, int); + *this << value; + } + break; + case 'f': + *this << va_arg(ap, double); + break; + case 'd': + *this << va_arg(ap, int); + break; + } + } else { + *this << *format; + } + format++; + } + va_end(ap); + } +#endif /* VERBOSE */ +} diff --git a/mozilla/js/tamarin/core/PrintWriter.h b/mozilla/js/tamarin/core/PrintWriter.h new file mode 100644 index 00000000000..12833d8259f --- /dev/null +++ b/mozilla/js/tamarin/core/PrintWriter.h @@ -0,0 +1,156 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_PrintWriter__ +#define __avmplus_PrintWriter__ + + +namespace avmplus +{ + /** + * hexDWord is an operator that can be used with PrintWriter + * to write out a dword in hex + */ + class hexDWord + { + public: + hexDWord(uint32 value) { this->value = value; } + hexDWord(const hexDWord& toCopy) { value = toCopy.value; } + hexDWord& operator= (const hexDWord& toCopy) { + value = toCopy.value; + return *this; + } + uint32 getValue() const { return value; } + + private: + uint32 value; + }; + + /** + * tabstop is an operator that can be used with PrintWriter + * to advance to the specified tabstop + */ + class tabstop + { + public: + tabstop(int spaces) { this->spaces = spaces; } + tabstop(const tabstop& toCopy) { spaces = toCopy.spaces; } + tabstop& operator= (const tabstop& toCopy) { + spaces = toCopy.spaces; + return *this; + } + int getSpaces() const { return spaces; } + + private: + int spaces; + }; + + /** + * percent is an operator that can be used with PrintWrtier + * to output a number as a percentage + */ + class percent + { + public: + percent(double value) { this->value = value; } + percent(const percent& toCopy) { value = toCopy.value; } + percent& operator= (const percent& toCopy) { + value = toCopy.value; + return *this; + } + double getPercent() const { return value; } + + private: + double value; + }; + + /** + * PrintWriter is a utility class for writing human-readable + * text. It has an interface similar to the C++ iostreams + * library, overloading the "<<" operator to accept most + * standard types used in the VM. + */ + class PrintWriter : public OutputStream + { + public: + PrintWriter(AvmCore* core) { m_core = core; m_stream = NULL; col = 0; } + PrintWriter(AvmCore* core, OutputStream *stream) { m_core = core; m_stream = stream; col = 0; } + ~PrintWriter() {} + + void setOutputStream(OutputStream *stream) { m_stream = stream; } + void setCore(AvmCore* core) { m_core = core; } + + int write(const void *buffer, int count); + + PrintWriter& operator<< (const char *str); + PrintWriter& operator<< (const wchar *str); + PrintWriter& operator<< (char value); + PrintWriter& operator<< (wchar value); + PrintWriter& operator<< (int value); + PrintWriter& operator<< (uint32 value); + PrintWriter& operator<< (double value); + PrintWriter& operator<< (Stringp str); + PrintWriter& operator<< (tabstop tabs); + PrintWriter& operator<< (hexDWord tabs); + PrintWriter& operator<< (percent value); + PrintWriter& operator<< (bool b); + + void formatTypeName(Traits* t); + + void writeHexByte(uint8 value); + void writeHexWord(uint16 value); + void writeHexDWord(uint32 value); + + #ifdef AVMPLUS_VERBOSE + void format(const char *format, ...); + void formatV(const char *format, va_list ap); + void formatP(const char* format, Stringp arg1=0, Stringp arg2=0, Stringp arg3=0); + #endif + + private: + int col; + OutputStream *m_stream; + AvmCore *m_core; + + void writeHexNibble(uint8 value); + + // These are defined for not DEBUGGER builds but fire asserts + public: + PrintWriter& operator<< (ScriptObject* obj); + PrintWriter& operator<< (const Traits* obj); + PrintWriter& operator<< (AbstractFunction* obj); + PrintWriter& operator<< (Multiname* obj); + PrintWriter& operator<< (Atom atom); + PrintWriter& operator<< (Namespace* str); + }; +} + +#endif /* __avmplus_PrintWriter__ */ diff --git a/mozilla/js/tamarin/core/RegExp.as b/mozilla/js/tamarin/core/RegExp.as new file mode 100644 index 00000000000..af539a2caef --- /dev/null +++ b/mozilla/js/tamarin/core/RegExp.as @@ -0,0 +1,97 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +package +{ + public dynamic class RegExp + { + // RegExp.length = 1 per ES3 + + // E262 {ReadOnly, DontDelete, DontEnum } + public static const length:int = 1 + + // {RO,DD,DE} properties of RegExp instances + public native function get source():String + public native function get global():Boolean + public native function get ignoreCase():Boolean + public native function get multiline():Boolean + + // {DD,DE} properties of RegExp instances + public native function get lastIndex():int + public native function set lastIndex(i:int) + + // AS3 specific properties {RO,DD,DE} + public native function get dotall():Boolean + public native function get extended():Boolean + + prototype.toString = function():String + { + var r:RegExp = this // TypeError if not + var out:String = "/" + r.source + "/" + if (r.global) out += "g" + if (r.ignoreCase) out += "i" + if (r.multiline) out += "m" + if (r.dotall) out += "s" + if (r.extended) out += "x" + return out + } + + AS3 native function exec(s:String="") + + prototype.exec = function(s="") + { + // arg not typed String, so that null and undefined convert + // to "null" and "undefined", respectively + var r:RegExp = this // TypeError if not + return r.AS3::exec(String(s)) + } + + AS3 function test(s:String=""):Boolean + { + return AS3::exec(s) != null + } + + prototype.test = function(s=""):Boolean + { + // arg not typed String, so that null and undefined convert + // to "null" and "undefined", respectively + var r:RegExp = this + return r.AS3::test(String(s)) + } + + // Dummy constructor function - This is neccessary so the compiler can do arg # checking for the ctor in strict mode + // The code for the actual ctor is in RegExpClass::construct in the avmplus + public function RegExp(pattern = void 0, options = void 0) + {} + + _dontEnumPrototype(prototype); + } +} diff --git a/mozilla/js/tamarin/core/RegExpClass.cpp b/mozilla/js/tamarin/core/RegExpClass.cpp new file mode 100644 index 00000000000..68c98794f39 --- /dev/null +++ b/mozilla/js/tamarin/core/RegExpClass.cpp @@ -0,0 +1,135 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmplus.h" + +#include "pcre.h" + +namespace avmplus +{ + BEGIN_NATIVE_MAP(RegExpClass) + NATIVE_METHOD(RegExp_source_get, RegExpObject::getSource) + NATIVE_METHOD(RegExp_global_get, RegExpObject::isGlobal) + NATIVE_METHOD(RegExp_lastIndex_get, RegExpObject::getLastIndex) + NATIVE_METHOD(RegExp_lastIndex_set, RegExpObject::setLastIndex) + NATIVE_METHOD1(RegExp_ignoreCase_get, RegExpObject::hasOption, PCRE_CASELESS) + NATIVE_METHOD1(RegExp_multiline_get, RegExpObject::hasOption, PCRE_MULTILINE) + NATIVE_METHOD1(RegExp_dotall_get, RegExpObject::hasOption, PCRE_DOTALL) + NATIVE_METHOD1(RegExp_extended_get, RegExpObject::hasOption, PCRE_EXTENDED) + + NATIVE_METHOD(RegExp_AS3_exec, RegExpObject::execSimple) + END_NATIVE_MAP() + + // make pcre's allocators use Flash's + void *fmalloc(size_t size) + { + return new char[size]; + } + + void ffree(void *data) + { + char *ptr = (char*) data; + delete [] ptr; + } + + RegExpClass::RegExpClass(VTable* cvtable) + : ClassClosure(cvtable) + { + AvmAssert(traits()->sizeofInstance == sizeof(RegExpClass)); + pcre_malloc = &fmalloc; + pcre_free = &ffree; + + AvmCore* core = this->core(); + + ScriptObject* object_prototype = toplevel()->objectClass->prototype; + prototype = new (core->GetGC(), ivtable()->getExtraSize()) RegExpObject(this,object_prototype); + + kindex = core->constant("index"); + kinput = core->constant("input"); + } + + // this = argv[0] (ignored) + // arg1 = argv[1] + // argN = argv[argc] + Atom RegExpClass::call(int argc, Atom* argv) + { + // ECMA-262 15.10.4.1: If pattern is RegExp and flags is undefined, + // return pattern unchanged. + if (argc > 0) { + Atom flagsAtom = (argc>1) ? argv[2] : undefinedAtom; + if (core()->istype(argv[1], traits()->itraits) && flagsAtom == undefinedAtom) { + return argv[1]; + } + } + + // Otherwise, call the RegExp constructor. + return construct(argc, argv); + } + + // this = argv[0] (ignored) + // arg1 = argv[1] + // argN = argv[argc] + Atom RegExpClass::construct(int argc, Atom* argv) + { + AvmCore* core = this->core(); + Stringp pattern; + + Atom patternAtom = (argc>0) ? argv[1] : undefinedAtom; + Atom optionsAtom = (argc>1) ? argv[2] : undefinedAtom; + + if (core->istype(patternAtom, traits()->itraits)) { + // Pattern is a RegExp object + if (optionsAtom != undefinedAtom) { + // ECMA 15.10.4.1 says to throw an error if flags specified + toplevel()->throwTypeError(kRegExpFlagsArgumentError); + } + // Return a clone of the RegExp object + RegExpObject* regExpObject = (RegExpObject*)AvmCore::atomToScriptObject(patternAtom); + return (new (core->GetGC(), ivtable()->getExtraSize()) RegExpObject(regExpObject))->atom(); + } else { + if (patternAtom != undefinedAtom) { + pattern = core->string(argv[1]); + } else { + // cn: disable this, breaking ecma3 tests. was: todo look into this. it's what SpiderMonkey does. + pattern = core->kEmptyString; //core->newString("(?:)"); + } + } + + Stringp options = NULL; + if (optionsAtom != undefinedAtom) { + options = core->string(optionsAtom); + } + + RegExpObject* inst = new (core->GetGC(), ivtable()->getExtraSize()) RegExpObject(this, pattern, options); + return inst->atom(); + } +} diff --git a/mozilla/js/tamarin/core/RegExpClass.h b/mozilla/js/tamarin/core/RegExpClass.h new file mode 100644 index 00000000000..1835125b16d --- /dev/null +++ b/mozilla/js/tamarin/core/RegExpClass.h @@ -0,0 +1,63 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_RegExpClass__ +#define __avmplus_RegExpClass__ + + +namespace avmplus +{ + /** + * class RegExpClass. + */ + class RegExpClass : public ClassClosure + { + public: + RegExpClass(VTable* cvtable); + + // this = argv[0] + // arg1 = argv[1] + // argN = argv[argc] + Atom call(int argc, Atom* argv); + + // this = argv[0] (ignored) + // arg1 = argv[1] + // argN = argv[argc] + Atom construct(int argc, Atom* argv); + + ATOM_WB kindex; + ATOM_WB kinput; + + DECLARE_NATIVE_MAP(RegExpClass) + }; +} + +#endif /* __avmplus_RegExpClass__ */ diff --git a/mozilla/js/tamarin/core/RegExpObject.cpp b/mozilla/js/tamarin/core/RegExpObject.cpp new file mode 100644 index 00000000000..0277a965bd5 --- /dev/null +++ b/mozilla/js/tamarin/core/RegExpObject.cpp @@ -0,0 +1,763 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmplus.h" + +#include "pcre.h" + +// todo figure out what to do about all the new/delete in here +// todo general clean-up + +namespace avmplus +{ + using namespace MMgc; + + // UsesUTF8String is a helper class which converts a Stringp to UTF8String, + // and frees it afterwards to reduce GC pressure. + class UsesUTF8String + { + public: + UsesUTF8String(Stringp subject) + : m_utf8String(subject ? subject->toUTF8String() : NULL) + { + } + ~UsesUTF8String() + { + if (m_utf8String) + { + MMgc::GC* gc = MMgc::GC::GetGC(m_utf8String); + gc->Free(m_utf8String); + } + } + operator UTF8String* const () { return m_utf8String; } + UTF8String* operator->() const + { + return m_utf8String; + } + + private: + UTF8String* const m_utf8String; + }; + +#define OVECTOR_SIZE 99 // 32 matches = (32+1)*3 + + // This variant is only used for creating the prototype + RegExpObject::RegExpObject(RegExpClass *regExpClass, + ScriptObject *objectPrototype) + : ScriptObject(regExpClass->ivtable(), objectPrototype) + { + AvmAssert(traits()->sizeofInstance == sizeof(RegExpObject)); + + GC::SetFinalize(this); + + int errptr; + const char *error; + AvmCore *core = this->core(); + m_optionFlags = PCRE_UTF8; + m_hasNamedGroups = false; + m_source = core->newString("(?:)"); + + UsesUTF8String utf8Pattern(m_source); + m_pcreInst = (void*)pcre_compile(utf8Pattern->c_str(), m_optionFlags, &error, &errptr, NULL ); + } + + RegExpObject::RegExpObject(RegExpObject *toCopy) + : ScriptObject(toCopy->vtable, toCopy->getDelegate()) + { + AvmAssert(traits()->sizeofInstance == sizeof(RegExpObject)); + + GC::SetFinalize(this); + + m_source = toCopy->m_source; + m_global = toCopy->m_global; + m_lastIndex = 0; + m_optionFlags = toCopy->m_optionFlags; + m_hasNamedGroups = toCopy->m_hasNamedGroups; + + UsesUTF8String utf8Pattern(m_source); + int errptr; + const char *error; + m_pcreInst = (void*)pcre_compile(utf8Pattern->c_str(), m_optionFlags, &error, &errptr, NULL ); + } + + RegExpObject::RegExpObject(RegExpClass *type, + Stringp pattern, + Stringp options) + : ScriptObject(type->ivtable(), type->prototype) + { + AvmAssert(traits()->sizeofInstance == sizeof(RegExpObject)); + m_source = pattern; + + GC::SetFinalize(this); + + m_lastIndex = 0; + m_global = false; + int errptr; + const char *error; + + m_optionFlags = PCRE_UTF8; + + UsesUTF8String utf8Pattern(pattern); + + // Check for named groups and embedded options if optionStr is NULL. ( Needed to handle + // new RegExp( existingRegExpValue.toString() ) ) + const char *ptr = utf8Pattern->c_str(); + UsesUTF8String optionUTF8(options); + const char* optionStr = optionUTF8 ? optionUTF8->c_str() : NULL; + + m_hasNamedGroups = false; + int numSlashSeen = 0; + + while (*ptr) { + if (ptr[0] == '(' && + ptr[1] == '?' && + ptr[2] == 'P' && + ptr[3] == '<') + { + m_hasNamedGroups = true; + } + else if (optionStr == NULL && ptr[0] == '/' && (ptr == utf8Pattern->c_str() || ptr[-1] != '\\') && numSlashSeen++ > 0) + { + optionStr = ptr; + } + + ptr++; + } + + // check options + if (optionStr) + { + for(; *optionStr; optionStr++) + { + switch(*optionStr) + { + case 'g': + m_global = true; + break; + case 'i': + m_optionFlags |= PCRE_CASELESS; + break; + case 'm': + m_optionFlags |= PCRE_MULTILINE; + break; + case 's': + m_optionFlags |= PCRE_DOTALL; + break; + case 'x': + m_optionFlags |= PCRE_EXTENDED; + break; + } + } + } + + + m_pcreInst = (void*)pcre_compile(utf8Pattern->c_str(), m_optionFlags, &error, &errptr, NULL ); + // FIXME: make errors available to actionscript + } + + RegExpObject::~RegExpObject() + { + (pcre_free)((pcre*)m_pcreInst); + m_global = false; + m_lastIndex = 0; + m_optionFlags = 0; + m_hasNamedGroups = false; + m_pcreInst = NULL; + } + + // this = argv[0] + // arg1 = argv[1] + // argN = argv[argc] + Atom RegExpObject::call(int argc, Atom *argv) + { + // this call occurs when a regexp object is invoked directly as a function ala "/a|b/('dcab')" + AvmCore *core = this->core(); + Atom inAtom = argc ? core->string(argv[1])->atom() : core->kEmptyString->atom(); + return execSimple(core->atomToString(inAtom)); + } + + /** + * read a string. No resource table stuff here, caller must take care of it. + * @param code + * @return + */ + Atom RegExpObject::stringFromUTF8(const char *buffer, + int len) + { + // don't need to create an atom for this now, because + // each caller will take care of it. + if (len == 0) { + return core()->kEmptyString->atom(); + } else { + return core()->newString(buffer, len)->atom(); + } + } + + int RegExpObject::search(Stringp subject) + { + int matchIndex, matchLen; + UsesUTF8String utf8Subject(subject); + if (!exec(subject, utf8Subject, 0, matchIndex, matchLen)) + { + matchIndex = -1; + } + else + { + matchIndex = Utf8ToUtf16Index(subject, utf8Subject, matchIndex); + } + return matchIndex; + } + + int RegExpObject::Utf8ToUtf16Index(Stringp utf16String, + UTF8String *utf8String, + int utf8Index) + { + int utf16Length = utf16String->length(); + int utf8Length = utf8String->length(); + + // If the UTF-16 and UTF-8 strings contain the same number of + // characters, the string is plain ASCII and no conversion is needed. + if (utf16Length == utf8Length) + { + return utf8Index; + } + + // If the UTF-8 index is out of range, do nothing. + if (utf8Index < 0 || utf8Index > utf8Length) + { + return utf8Index; + } + + return UnicodeUtils::Utf8ToUtf16((const uint8*)utf8String->c_str(), + utf8Index, + NULL, + 0); + } + + int RegExpObject::numBytesInUtf8Character(const uint8 *in) + { + unsigned int c = *in; + switch(c>>4) + { + case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: + default: + // 0xxx xxxx + return 1; + case 12: case 13: + // 110xxxxx 10xxxxxx + return 2; + case 14: + // 1110xxxx 10xxxxxx 10xxxxxx + return 3; + case 15: + // 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx + return 4; + } + } + + + ArrayObject* RegExpObject::split(Stringp subject, uint32 limit) + { + AvmCore *core = this->core(); + ArrayObject *out = toplevel()->arrayClass->newArray(); + UsesUTF8String utf8Subject(subject); + + int startIndex=0; + int matchIndex; + int matchLen; + ArrayObject* matchArray; + unsigned n=0; + bool isEmptyRE = m_source->length() == 0; + while ((matchArray = exec(subject, + utf8Subject, + startIndex, + matchIndex, + matchLen)) != NULL) + { + // [cn 11/22/04] when match is made, but is length 0 we've matched the empty + // position between characters. Although we've "matched", its zero length so just break out. + if (matchLen == 0 ) { + matchLen = 0; + matchIndex = startIndex+numBytesInUtf8Character((uint8*)(utf8Subject->c_str())+startIndex); // +1char will advance startIndex, extract just one char + if( !isEmptyRE ) + { + // don't break if we're processing an empty regex - then we want to split the string into each character + // so we want the loop to continue + break; + } + } + + //[ed 8/10/04] don't go past end of string. not sure why pcre doesn't return null + //for a match starting past the end. + //[cn 12/3/04] because a regular expression which matches an empty position (space between characters) + // will match the empty position just past the last character. This test is correct, though + // it needs to come before we do any setProperties to avoid a bogus xtra result. + if (matchIndex+matchLen > utf8Subject->length()) { + startIndex = matchIndex+matchLen; + break; + } else { + out->setUintProperty(n++, + (core->newString(utf8Subject->c_str()+startIndex, + matchIndex-startIndex))->atom()); + if (n >= limit) + break; + for (uint32 j=1; jgetLength(); j++) { + out->setUintProperty(n++, matchArray->getUintProperty(j)); + if (n >= limit) + break; + } + // Advance past this match + startIndex = matchIndex+matchLen; + } + } + + // If we found no match, or we did find a match and are still under limit, and there is a remainder left, add it + if ((unsigned)n < limit && startIndex <= utf8Subject->length()) { + out->setUintProperty(n++, + (core->newString(utf8Subject->c_str()+startIndex, + utf8Subject->length()-startIndex))->atom()); + } + + return out; + } + + int RegExpObject::Utf16ToUtf8Index(Stringp utf16String, + UTF8String *utf8String, + int utf16Index) + { + int utf16Length = utf16String->length(); + int utf8Length = utf8String->length(); + + // If the UTF-16 and UTF-8 strings contain the same number of + // characters, the string is plain ASCII and no conversion is needed. + if (utf16Length == utf8Length) + { + return utf16Index; + } + + // If the UTF-16 index is out of range, do nothing. + if (utf16Index < 0 || utf16Index > utf16Length) + { + return utf16Index; + } + + return UnicodeUtils::Utf16ToUtf8(utf16String->c_str(), + utf16Index, + NULL, + 0); + } + + Atom RegExpObject::execSimple(Stringp subject) + { + if (!subject) + { + subject = core()->knull; + } + UsesUTF8String utf8Subject(subject); + ArrayObject *result = exec(subject, utf8Subject); + return result ? result->atom() : nullStringAtom; + } + + ArrayObject* RegExpObject::exec(Stringp subject, UTF8String *utf8Subject) + { + AvmAssert(subject != NULL); + AvmAssert(utf8Subject != NULL); + + int matchIndex = 0, matchLen = 0; + int startIndex = (isGlobal() ? Utf16ToUtf8Index(subject, + utf8Subject, + m_lastIndex) : 0); + + ArrayObject* result = exec(subject, + utf8Subject, + startIndex, + matchIndex, + matchLen); + if (isGlobal()) + { + m_lastIndex = Utf8ToUtf16Index(subject, + utf8Subject, + matchIndex+matchLen); + } + + return result; + } + + ArrayObject* RegExpObject::exec(Stringp subject, + UTF8String *utf8Subject, + int startIndex, + int& matchIndex, + int& matchLen) + { + AvmAssert(subject != NULL); + AvmAssert(utf8Subject != NULL); + + int ovector[OVECTOR_SIZE]; + int results; + int subjectLength = utf8Subject->length(); + + if( startIndex < 0 || + startIndex > subjectLength || + (results = pcre_exec((pcre*)m_pcreInst, + NULL, + utf8Subject->c_str(), + subjectLength, + startIndex, + 0, + ovector, + OVECTOR_SIZE)) < 0) + { + matchIndex = 0; + matchLen = 0; + return NULL; + } + + AvmCore *core = this->core(); + ArrayObject *a = toplevel()->arrayClass->newArray(results); + + a->setProperty(toplevel()->regexpClass()->kindex, + core->intToAtom(Utf8ToUtf16Index(subject, utf8Subject, ovector[0]))); + a->setProperty(toplevel()->regexpClass()->kinput, + subject->atom()); + a->setLength(results); + + // set array slots + for (int i=0; i -1) { + int length = ovector[i*2 + 1] - ovector[i*2]; + Atom match = stringFromUTF8(utf8Subject->c_str()+ovector[i*2], length); + a->setUintProperty(i, match); + } else { + a->setUintProperty(i, undefinedAtom); + } + } + + // handle named groups + if (m_hasNamedGroups) + { + int entrySize; + pcre_fullinfo((pcre*)m_pcreInst, NULL, PCRE_INFO_NAMEENTRYSIZE, &entrySize); + + int nameCount; + pcre_fullinfo((pcre*)m_pcreInst, NULL, PCRE_INFO_NAMECOUNT, &nameCount); + + // this space is freed when (pcre*)m_pcreInst is freed + char *nameTable; + pcre_fullinfo((pcre*)m_pcreInst, NULL, PCRE_INFO_NAMETABLE, &nameTable); + + /* nameTable is a series of fixed length entries (entrySize) + the first two bytes are the index into the ovector and the result + is a null terminated string (the subgroup name) */ + for (int i = 0; i < nameCount; i++) + { + int nameIndex, length; + nameIndex = (nameTable[0] << 8) + nameTable[1]; + length = ovector[nameIndex * 2 + 1] - ovector[ nameIndex * 2 ]; + + Atom name = stringFromUTF8((char*)(nameTable+2), strlen(nameTable+2)); + name = core->internString(name)->atom(); + + Atom value = stringFromUTF8(utf8Subject->c_str()+ovector[nameIndex*2], length); + + a->setProperty(name, value); + + nameTable += entrySize; + } + } + + matchIndex = ovector[0]; + matchLen = ovector[1]-ovector[0]; + + return a; + } + + ArrayObject* RegExpObject::match(Stringp subject) + { + UsesUTF8String utf8Subject(subject); + if (!isGlobal()) + { + return exec(subject, utf8Subject); + } + else + { + ArrayObject *a = toplevel()->arrayClass->newArray(); + + int oldLastIndex = m_lastIndex; + m_lastIndex = 0; + + int n = 0; + + ArrayObject* matchArray; + while ((matchArray = exec(subject, utf8Subject)) != NULL) + { + a->setUintProperty(n++, matchArray->getUintProperty(0)); + } + + if (m_lastIndex == oldLastIndex) + { + m_lastIndex++; + } + + return a; + } + } + +#define NUM_MATCHES 100 + + Atom RegExpObject::replace(Stringp subject, + Stringp replacement) + { + UsesUTF8String utf8Subject(subject); + UsesUTF8String utf8Replacement(replacement); + + int ovector[OVECTOR_SIZE]; + int subjectLength = utf8Subject->length(); + int lastIndex=0; + + StringBuffer resultBuffer(core()); + + const char *src = utf8Subject->c_str(); + + // get start/end index of all matches + int matchCount; + while (lastIndex <= subjectLength && + (matchCount = pcre_exec((pcre*)m_pcreInst, NULL, src, + subjectLength, lastIndex, 0, ovector, OVECTOR_SIZE)) > 0) + { + int captureCount = matchCount-1; + + int matchIndex = ovector[0]; + int matchLen = ovector[1]-ovector[0]; + + // copy in stuff leading up to match + resultBuffer.write(src+lastIndex, matchIndex-lastIndex); + + const char *ptr = utf8Replacement->c_str(); + while (*ptr) { + if (*ptr == '$') { + switch (*(ptr+1)) { + case '$': + resultBuffer << '$'; + ptr += 2; + break; + case '&': + resultBuffer.write(src+matchIndex, matchLen); + ptr += 2; + break; + case '`': + resultBuffer.write(src, matchIndex); + ptr += 2; + break; + case '\'': + resultBuffer << src+ovector[1]; + ptr += 2; + break; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + { + int i; + if (*(ptr+2) >= '0' && *(ptr+2) <= '9') { + int j = 10*(ptr[1]-'0')+(ptr[2]-'0'); + if (j > captureCount) { + // Gobbling up two digits would overflow the + // capture count, so just use the one digit. + i = ptr[1]-'0'; + } else { + i = j; + } + } else { + i = ptr[1]-'0'; + } + if (i >= 1 && i <= captureCount) { + resultBuffer.write(src+ovector[i*2], + ovector[i*2+1]-ovector[i*2]); + ptr += (i >= 10) ? 3 : 2; + } else { + resultBuffer << *ptr++; + } + } + break; + default: + resultBuffer << *ptr++; + break; + } + } else { + resultBuffer << *ptr++; + } + } + + int newLastIndex = ovector[0] + (ovector[1] - ovector[0]); + + // prevents infinite looping in certain cases + fixReplaceLastIndex(src, + subjectLength, + lastIndex, + newLastIndex, + resultBuffer); + + lastIndex = newLastIndex; + + if (!isGlobal()) + { + break; + } + } + + // copy in stuff after last match + if (lastIndex < subjectLength) + { + resultBuffer.write(src+lastIndex, subjectLength-lastIndex); + } + + return stringFromUTF8(resultBuffer.c_str(), + resultBuffer.length()); + } + + Atom RegExpObject::replace(Stringp subject, + ScriptObject* replaceFunction) + { + UsesUTF8String utf8Subject(subject); + + int ovector[OVECTOR_SIZE]; + int subjectLength = utf8Subject->length(); + int lastIndex=0; + + StringBuffer resultBuffer(core()); + + const char *src = utf8Subject->c_str(); + + // get start/end index of all matches + int matchCount; + while (lastIndex < subjectLength && + (matchCount = pcre_exec((pcre*)m_pcreInst, NULL, src, + subjectLength, lastIndex, 0, ovector, OVECTOR_SIZE)) > 0) + { + int captureCount = matchCount-1; + + int matchIndex = ovector[0]; + int matchLen = ovector[1]-ovector[0]; + + // copy in stuff leading up to match + resultBuffer.write(src+lastIndex, matchIndex-lastIndex); + + // call the replace function + Atom argv[NUM_MATCHES+4]; + int argc = captureCount+3; + + argv[0] = undefinedAtom; + + // ECMA 15.5.4.11: Argument 1 is the substring that matched. + argv[1] = core()->newString(src+matchIndex, matchLen)->atom(); + + // ECMA 15.5.4.11: The next m arguments are all of the captures in the + // MatchResult + for (int i=1; i<=captureCount; i++) + { + argv[i+1] = core()->newString(src+ovector[i*2], + ovector[i*2+1]-ovector[i*2])->atom(); + } + + // ECMA 15.5.4.11: Argument m+2 is the offset within string + // where the match occurred + argv[captureCount+2] = core()->uintToAtom(matchIndex); + + // ECMA 15.5.4.11: Argument m+3 is string + argv[captureCount+3] = subject->atom(); + + resultBuffer << core()->string(toplevel()->op_call(replaceFunction->atom(), + argc, argv)); + + int newLastIndex = ovector[0] + (ovector[1] - ovector[0]); + + // prevents infinite looping in certain cases + fixReplaceLastIndex(src, + subjectLength, + lastIndex, + newLastIndex, + resultBuffer); + + lastIndex = newLastIndex; + + if (!isGlobal()) + break; + } + + // copy in stuff after last match + if (lastIndex < subjectLength) + { + resultBuffer.write(src+lastIndex, subjectLength-lastIndex); + } + + return stringFromUTF8(resultBuffer.c_str(), + resultBuffer.length()); + } + + void RegExpObject::fixReplaceLastIndex(const char *src, + int subjectLength, + int lastIndex, + int& newLastIndex, + StringBuffer& resultBuffer) + { + if (lastIndex == newLastIndex && isGlobal()) + { + // Advance one character + if (lastIndex < subjectLength) + { + uint32 ch; + int n = UnicodeUtils::Utf8ToUcs4((const uint8*)src+lastIndex, subjectLength-lastIndex, &ch); + if (n <= 0) + { + // Invalid UTF8 sequence, advance one byte + n = 1; + } + resultBuffer.write(src+lastIndex, n); + newLastIndex += n; + } + else + { + newLastIndex++; + } + } + } + + // + // Accessors + // +} diff --git a/mozilla/js/tamarin/core/RegExpObject.h b/mozilla/js/tamarin/core/RegExpObject.h new file mode 100644 index 00000000000..4907c874a37 --- /dev/null +++ b/mozilla/js/tamarin/core/RegExpObject.h @@ -0,0 +1,113 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_RegExpObject__ +#define __avmplus_RegExpObject__ + +namespace avmplus +{ + /** + * The RegExpObject class is the C++ implementation of instances + * of the "RegExp" class, as defined in the ECMAScript standard. + */ + class RegExpObject : public ScriptObject + { + public: + /** This variant is used to create RegExp.prototype */ + RegExpObject(RegExpClass *arrayClass, ScriptObject *delegate); + + RegExpObject(RegExpClass *type, + Stringp pattern, + Stringp options); + + /* Copy constructor */ + RegExpObject(RegExpObject *toCopy); + + ~RegExpObject(); + + // call is implicit exec + // atom[0] = this + // atom[1] = arg1 + // atom[argc] = argN + Atom call(int argc, Atom* argv); + + int search(Stringp subject); + ArrayObject* split(Stringp subject, uint32 limit); + ArrayObject* match(Stringp subject); + + Atom execSimple(Stringp subject); + Atom replace(Stringp subject, Stringp replacement); + Atom replace(Stringp subject, ScriptObject *replaceFunction); + + Stringp getSource() const { return m_source; } + bool isGlobal() const { return m_global; } + int getLastIndex() const { return m_lastIndex; } + void setLastIndex(int newIndex) { m_lastIndex = newIndex; } + bool hasOption(int mask) { return (m_optionFlags&mask) != 0; } + + private: + DRCWB(Stringp) m_source; + bool m_global; + int m_lastIndex; + int m_optionFlags; + bool m_hasNamedGroups; + void* m_pcreInst; + + Atom stringFromUTF8(const char *buffer, int len); + + ArrayObject* exec(Stringp subject, UTF8String *utf8Subject); + + ArrayObject* exec(Stringp subject, + UTF8String *utf8Subject, + int startIndex, + int& matchIndex, + int& matchLen); + + int Utf16ToUtf8Index(Stringp utf16String, + UTF8String *utf8String, + int utf16Index); + + int Utf8ToUtf16Index(Stringp utf16String, + UTF8String *utf8String, + int utf8Index); + + void fixReplaceLastIndex(const char *src, + int subjectLength, + int lastIndex, + int& newLastIndex, + StringBuffer& resultBuffer); + + int numBytesInUtf8Character(const uint8 *in); + + }; +} + +#endif /* __avmplus_RegExpObject__ */ diff --git a/mozilla/js/tamarin/core/ScopeChain.cpp b/mozilla/js/tamarin/core/ScopeChain.cpp new file mode 100644 index 00000000000..c55846b8510 --- /dev/null +++ b/mozilla/js/tamarin/core/ScopeChain.cpp @@ -0,0 +1,37 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmplus.h" + +namespace avmplus +{ +} diff --git a/mozilla/js/tamarin/core/ScopeChain.h b/mozilla/js/tamarin/core/ScopeChain.h new file mode 100644 index 00000000000..80737b45c07 --- /dev/null +++ b/mozilla/js/tamarin/core/ScopeChain.h @@ -0,0 +1,139 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +namespace avmplus +{ + + /** + * type descriptor for a captured scope chain + */ + class ScopeTypeChain : public MMgc::GCObject + { + ScopeTypeChain(ScopeTypeChain* outer, int capture, int extra) + { + if (outer) + { + size = outer->size + capture; + for (int i=0, n=outer->size; i < n; i ++) + scopes[i] = outer->scopes[i]; + } + else + { + size = capture; + } + fullsize = size + extra; + } + + public: + int size; + int fullsize; + struct Entry { + Traits* traits; + bool isWith; + } + scopes[1]; // actual length = fullsize; + + static ScopeTypeChain* create(MMgc::GC* gc, ScopeTypeChain* outer, int capture, int extra=0) + { + int pad = capture+extra; + size_t padSize = sizeof(struct Entry) * + (((pad > 0) ? (pad - 1) : 0) + (outer ? outer->size : 0)); + return new (gc, padSize) ScopeTypeChain(outer, capture, extra); + } + + }; + + /** + * a captured scope chain + */ + class ScopeChain : public MMgc::GCObject + { + public: + ScopeTypeChain* const scopeTraits; + DRCWB(Namespace*) const defaultXmlNamespace; + private: + friend class CodegenMIR; + Atom scopes[1]; // actual length == size + + public: + + /* + dxns is modelled as a variable on an activation object. The activation + object will be in several scope chains, so we can't store dxns in the SC. + When it changes, it's new valuable is visible in all closures in scope. + */ + + ScopeChain(ScopeTypeChain* scopeTraits, ScopeChain* outer, Namespace *dxns) + : scopeTraits(scopeTraits), defaultXmlNamespace(dxns) + { + if (outer) + { + for (int i=0, n=outer->scopeTraits->size;/*outer->getSize();*/ i < n; i ++) + { + setScope(i, outer->scopes[i]); + } + } + } + + Atom getScope(int i) const + { + AvmAssert(i >= 0 && i < scopeTraits->size); + return scopes[i]; + } + + void setScope(int i, Atom value) + { + AvmAssert(i >= 0 && i < scopeTraits->size); + //scopes[i] = value; + WBATOM(MMgc::GC::GetGC(this), this, &scopes[i], value); + } + + int getSize() const { + if ( scopeTraits ) + return scopeTraits->size; + else + return 0; + } + + Namespace** getDefaultNamespaceAddr() const { + return (Namespace**)&defaultXmlNamespace; + } + + static ScopeChain* create(MMgc::GC* gc, ScopeTypeChain *scopeTraits, ScopeChain* outer, Namespace *dxns) + { + int depth = scopeTraits->size; + size_t padSize = depth > 0 ? sizeof(Atom) * (depth-1) : 0; + return new (gc, padSize) ScopeChain(scopeTraits, outer, dxns); + } + }; + +} diff --git a/mozilla/js/tamarin/core/ScriptBuffer.cpp b/mozilla/js/tamarin/core/ScriptBuffer.cpp new file mode 100644 index 00000000000..b73c64363a5 --- /dev/null +++ b/mozilla/js/tamarin/core/ScriptBuffer.cpp @@ -0,0 +1,36 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#include "avmplus.h" + +namespace avmplus +{ +} diff --git a/mozilla/js/tamarin/core/ScriptBuffer.h b/mozilla/js/tamarin/core/ScriptBuffer.h new file mode 100644 index 00000000000..b349922b1d5 --- /dev/null +++ b/mozilla/js/tamarin/core/ScriptBuffer.h @@ -0,0 +1,143 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_ScriptBuffer__ +#define __avmplus_ScriptBuffer__ + + +namespace avmplus +{ + /** + * ScriptBufferImpl is the base class for script buffer + * implementations. + * + * This is a pure base class which must be subclassed to be used. + * Its methods are not virtual for performance reasons. + * For default script buffer behavior, use BasicScriptBufferImpl. + */ + class ScriptBufferImpl + { + public: + operator byte* () const { return buffer; } + size_t getSize() const { return size; } + byte* getBuffer() const { return (byte*)buffer; } + + byte operator[] (int index) const { + return buffer[index]; + } + byte& operator[] (int index) { + return buffer[index]; + } + protected: + byte *buffer; + size_t size; + }; + + /** + * BasicScriptBufferImpl is a ScriptBuffer implementation that + * owns its own buffer and has no external dependencies. + */ + class BasicScriptBufferImpl : public ScriptBufferImpl + { + public: + BasicScriptBufferImpl(size_t size) { + this->size = size; + buffer = (byte*)(this+1); + } + // override to skip memset and prevent marking + static void *operator new(size_t size, MMgc::GC *gc, size_t extra = 0) + { + return gc->Alloc(size + extra, 0, 4); + } + }; + + /** + * ReadOnlyScriptBufferImpl is a ScriptBuffer implementation that + * points to an external buffer that must stay around longer than + * the script buffer itself. + */ + class ReadOnlyScriptBufferImpl : public ScriptBufferImpl + { + public: + ReadOnlyScriptBufferImpl(const byte *buf, size_t size) { + this->size = size; + this->buffer = (byte*) buf;; + } + }; + /** + * ScriptBuffer is a "handle" for ScriptBufferImpl which is more convenient + * to pass around and use than a ScriptBufferImpl pointer. It defines + * operator[] to make a ScriptBuffer look like an array. + */ + class ScriptBuffer + { + public: + ScriptBuffer() { + m_impl = NULL; + } + ScriptBuffer(ScriptBufferImpl* rep) { + m_impl = rep; + } + ScriptBuffer(const ScriptBuffer& toCopy) { + m_impl = toCopy.m_impl; + } + ScriptBuffer& operator= (const ScriptBuffer& toCopy) { + m_impl = toCopy.m_impl; + return *this; + } + ScriptBufferImpl* getImpl() const { + return m_impl; + } + operator ScriptBufferImpl*() const { + return m_impl; + } + operator byte* () const { + return m_impl->getBuffer(); + } + size_t getSize() const { + return m_impl->getSize(); + } + byte* getBuffer() const { + return m_impl->getBuffer(); + } + byte operator[] (int index) const { + return (*m_impl)[index]; + } + byte& operator[] (int index) { + return (*m_impl)[index]; + } + + private: + ScriptBufferImpl* m_impl; + }; +} + +#endif /* __avmplus_ScriptBuffer__ */ diff --git a/mozilla/js/tamarin/core/ScriptObject.cpp b/mozilla/js/tamarin/core/ScriptObject.cpp new file mode 100644 index 00000000000..3b477b26e9f --- /dev/null +++ b/mozilla/js/tamarin/core/ScriptObject.cpp @@ -0,0 +1,874 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 1993-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmplus.h" + +namespace avmplus +{ + #ifdef DEBUGGER + // helper object to store class instances + class GCHashtableScriptObject : public ScriptObject + { + public: + GCHashtableScriptObject(VTable *vtable) : ScriptObject(vtable, vtable->toplevel->objectClass->prototype) {} + + int nextNameIndex(int index) + { + return ht.nextIndex(index); + } + + Atom nextValue(int index) + { + Atom a = (Atom)ht.keyAt(index-1); + return a; + } + + // so we don't count these + ClassClosure* cc() const { return NULL; } + + MMgc::GCHashtable ht; + }; + + class SlotIterator : public ScriptObject + { + public: + SlotIterator(ScriptObject *obj, VTable *vtable) + : obj(obj), + ScriptObject(vtable, vtable->toplevel->objectClass->prototype) {} + + int nextNameIndex(int index) + { + if(index == 0) + currTraits = obj->traits(); + + while (currTraits != NULL) + { + while ((index = currTraits->next(index)) != 0) + { + if (AvmCore::isSlotBinding(currTraits->valueAt(index))) + return index; + } + + currTraits = currTraits->base; + } + + return 0; + } + + Atom nextValue(int index) + { + Multiname mn(currTraits->nsAt(index), currTraits->keyAt(index), true); + QNameObject *qname = new (gc(), toplevel()->qnameClass()->ivtable()->getExtraSize()) + QNameObject(toplevel()->qnameClass(), mn); + + return qname->atom(); + } + + private: + DRCWB(ScriptObject *) obj; + DWB(Traits *) currTraits; + }; + #endif + + ScriptObject::ScriptObject(VTable *vtable, + ScriptObject *delegate, + int capacity /*=Hashtable::kDefaultCapacity*/) + : vtable(vtable) + { + // initialize slots in this object to initial values from traits. + Traits* traits = vtable->traits; + AvmAssert(traits->linked); + + // Ensure that our object is large enough to hold its extra traits data. + AvmAssert(MMgc::GC::Size(this) >= traits->getTotalSize()); + + setDelegate(delegate); + + if (traits->needsHashtable) + { + MMGC_MEM_TYPE(this); + getTable()->initialize(this->gc(), capacity); + getTable()->setDontEnumSupport(true); + } + +#if 0 + if (vtable->toplevel && vtable->toplevel->scriptObjectTable) + { + vtable->toplevel->scriptObjectTable->addScriptObject(this); + } +#endif + } + + ScriptObject::~ScriptObject() + { +#ifdef MMGC_DRC + setDelegate(NULL); + vtable->traits->destroyInstance(this); +#endif + } + + /** + * traverse the delegate chain looking for a value. + * [ed] it's okay to look only at the HT's in the delegate chain because + * delegate values may only be instances of Object. They cannot be objects + * with slots. We don't need to look at traits at each step. + * todo - enforce this rule + * @param name + * @return + */ + Atom ScriptObject::getProperty(Atom name) const + { + if (!traits()->needsHashtable) + { + return getPropertyFromProtoChain(name, delegate, traits()); + } + else + { + Stringp s = core()->atomToString(name); + AvmAssert(s->isInterned()); + Atom ival = s->getIntAtom(); + if (ival) + { + name = ival; + } + + // dynamic lookup on this object + const ScriptObject *o = this; + do + { + Hashtable *table = o->getTable(); + const Atom *atoms = table->getAtoms(); + int i = table->find(name, atoms, table->getNumAtoms()); + if (atoms[i] != Hashtable::EMPTY) + return atoms[i+1]; + } + while ((o = o->delegate) != NULL); + return undefinedAtom; + } + } + + Atom ScriptObject::getPropertyFromProtoChain(Atom name, ScriptObject* o, Traits *origObjTraits) const + { + // todo will delegate always be non-null here? + if (o != NULL) + { + Atom searchname = name; + Stringp s = core()->atomToString(name); + AvmAssert(s->isInterned()); + Atom ival = s->getIntAtom(); + if (ival) + { + searchname = ival; + } + do + { + Atom *atoms = o->getTable()->getAtoms(); + int i = o->getTable()->find(searchname, atoms, o->getTable()->getNumAtoms()); + if (atoms[i] != Hashtable::EMPTY) + return atoms[i+1]; + } + while ((o = o->delegate) != NULL); + } + Multiname multiname(core()->publicNamespace,AvmCore::atomToString(name)); + toplevel()->throwReferenceError(kReadSealedError, &multiname, origObjTraits); + // unreached + return undefinedAtom; + } + + bool ScriptObject::hasProperty(Multiname* multiname) const + { + if (traits()->needsHashtable) + { + if (isValidDynamicName(multiname)) + { + return hasProperty(multiname->getName()->atom()); + } + else + { + return false; + } + } + else + { + // ISSUE should this walk the proto chain? + return false; + } + } + + bool ScriptObject::hasProperty(Atom name) const + { + if (traits()->needsHashtable) + { + Stringp s = core()->atomToString(name); + AvmAssert(s->isInterned()); + Atom ival = s->getIntAtom(); + if (ival) + { + name = ival; + } + + return getTable()->contains(name); + } + else + { + // ISSUE should this walk the proto chain? + return false; + } + } + + void ScriptObject::setProperty(Atom name, Atom value) + { + if (traits()->needsHashtable) + { + Stringp s = core()->atomToString(name); + AvmAssert(s->isInterned()); + Atom ival = s->getIntAtom(); + if (ival) + { + name = ival; + } + + MMGC_MEM_TYPE(this); + getTable()->add (name, value); + MMGC_MEM_TYPE(NULL); + } + else + { + Multiname multiname(core()->publicNamespace, AvmCore::atomToString(name)); + // cannot create properties on a sealed object. + toplevel()->throwReferenceError(kWriteSealedError, &multiname, traits()); + } + } + + void ScriptObject::setProperty(Multiname* name, Atom value) + { + if (traits()->needsHashtable && isValidDynamicName(name)) + { + setProperty(name->getName(), value); + } + else + { + // cannot create properties on a sealed object. + toplevel()->throwReferenceError(kWriteSealedError, name, traits()); + } + } + + bool ScriptObject::propertyIsEnumerable(Atom name) const + { + if (traits()->needsHashtable) + { + Stringp s = core()->atomToString(name); + AvmAssert(s->isInterned()); + Atom ival = s->getIntAtom(); + if (ival) + { + name = ival; + } + + return getTable()->propertyIsEnumerable(name); + } + else + { + // ISSUE should this walk the proto chain? + return false; + } + } + + void ScriptObject::setPropertyIsEnumerable(Atom name, bool enumerable) + { + if (traits()->needsHashtable) + { + Stringp s = core()->atomToString(name); + AvmAssert(s->isInterned()); + Atom ival = s->getIntAtom(); + if (ival) + { + name = ival; + } + + getTable()->setPropertyIsEnumerable(name, enumerable); + } + else + { + // cannot create properties on a sealed object. + Multiname multiname(core()->publicNamespace, AvmCore::atomToString(name)); + toplevel()->throwReferenceError(kWriteSealedError, &multiname, traits()); + } + } + + bool ScriptObject::deleteProperty(Atom name) + { + if (traits()->needsHashtable) + { + Stringp s = core()->atomToString(name); + AvmAssert(s->isInterned()); + Atom ival = s->getIntAtom(); + if (ival) + { + name = ival; + } + + getTable()->remove(name); + return true; + } + else + { + return false; + } + } + + bool ScriptObject::deleteProperty(Multiname* name) + { + if (traits()->needsHashtable && isValidDynamicName(name)) + { + return deleteProperty(name->getName()); + } + else + { + return false; + } + } + + Atom ScriptObject::getUintProperty(uint32 i) const + { + AvmCore* core = this->core(); + + if (!(i&MAX_INTEGER_MASK)) + { + if (!traits()->needsHashtable) + { + Atom name = core->internUint32(i)->atom(); + return getPropertyFromProtoChain(name, delegate, traits()); + } + else + { + // dynamic lookup on this object + Atom name = core->uintToAtom (i); + const ScriptObject *o = this; + do + { + Hashtable *table = o->getTable(); + const Atom *atoms = table->getAtoms(); + int i = table->find(name, atoms, table->getNumAtoms()); + if (atoms[i] != Hashtable::EMPTY) + return atoms[i+1]; + } + while ((o = o->delegate) != NULL); + return undefinedAtom; + } + } + else + { + return getProperty(core->internUint32(i)->atom()); + } + } + + void ScriptObject::setUintProperty(uint32 i, Atom value) + { + AvmCore* core = this->core(); + if (!(i&MAX_INTEGER_MASK)) + { + Atom name = core->uintToAtom (i); + if (traits()->needsHashtable) + { + MMGC_MEM_TYPE(this); + getTable()->add(name, value); + MMGC_MEM_TYPE(NULL); + } + else + { + Multiname multiname(core->publicNamespace, core->internUint32(i)); + // cannot create properties on a sealed object. + toplevel()->throwReferenceError(kWriteSealedError, &multiname, traits()); + } + } + else + { + setProperty(core->internUint32(i)->atom(), value); + } + } + + bool ScriptObject::delUintProperty(uint32 i) + { + AvmCore* core = this->core(); + if (!(i&MAX_INTEGER_MASK)) + { + Atom name = core->uintToAtom (i); + if (traits()->needsHashtable) + { + getTable()->remove(name); + return true; + } + else + { + return false; + } + } + else + { + return deleteProperty(core->internUint32(i)->atom()); + } + } + + bool ScriptObject::hasUintProperty(uint32 i) const + { + AvmCore* core = this->core(); + if (!(i&MAX_INTEGER_MASK)) + { + Atom name = core->uintToAtom (i); + if (traits()->needsHashtable) + { + return getTable()->contains(name); + } + else + { + // ISSUE should this walk the proto chain? + return false; + } + } + else + { + return hasProperty(core->internUint32(i)->atom()); + } + } + + Atom ScriptObject::getProperty(Multiname* multiname) const + { + if (isValidDynamicName(multiname)) + { + return getProperty(multiname->getName()); + } + else + { + Toplevel* toplevel = this->toplevel(); + + if (multiname->isNsset()) + toplevel->throwReferenceError(kReadSealedErrorNs, multiname, traits()); + else + toplevel->throwReferenceError(kReadSealedError, multiname, traits()); + return undefinedAtom; + } + } + + // this = argv[0] (ignored) + // arg1 = argv[1] + // argN = argv[argc] + Atom ScriptObject::callProperty(Multiname* multiname, int argc, Atom* argv) + { + Toplevel* toplevel = this->toplevel(); + Atom method = getProperty(multiname); + if (!AvmCore::isObject(method)) + toplevel->throwTypeError(kCallOfNonFunctionError, core()->toErrorString(multiname)); + argv[0] = atom(); // replace receiver + return toplevel->op_call(method, argc, argv); + } + + Atom ScriptObject::constructProperty(Multiname* multiname, int argc, Atom* argv) + { + Atom ctor = getProperty(multiname); + argv[0] = atom(); // replace receiver + return toplevel()->op_construct(ctor, argc, argv); + } + + Atom ScriptObject::getDescendants(Multiname* /*name*/) const + { + toplevel()->throwTypeError(kDescendentsError, core()->toErrorString(traits())); + return undefinedAtom;// not reached + } + +#ifdef AVMPLUS_VERBOSE + Stringp ScriptObject::format(AvmCore* core) const + { + if (traits()->name != NULL) { + return core->concatStrings(traits()->format(core), + core->concatStrings(core->newString("@"), + core->formatAtomPtr(atom()))); + } else { + return core->concatStrings(core->newString("{}@"), + core->formatAtomPtr(atom())); + } + } +#endif + + Atom ScriptObject::defaultValue() + { + AvmCore *core = this->core(); + Toplevel* toplevel = this->toplevel(); + + Atom atomv_out[1]; + + // call this.valueOf() + Multiname tempname(core->publicNamespace, core->kvalueOf); + atomv_out[0] = atom(); + Atom result = toplevel->callproperty(atom(), &tempname, 0, atomv_out, vtable); + + // if result is primitive, return it + if ((result&7) != kObjectType) + return result; + + // otherwise call this.toString() + tempname.setName(core->ktoString); + atomv_out[0] = atom(); + result = toplevel->callproperty(atom(), &tempname, 0, atomv_out, vtable); + + // if result is primitive, return it + if ((result&7) != kObjectType) + return result; + + // could not convert to primitive. + toplevel->throwTypeError(kConvertToPrimitiveError, core->toErrorString(traits())); + return undefinedAtom; + } + + // Execute the ToString algorithm as described in ECMA-262 Section 9.8. + // This is ToString(ToPrimitive(input argument, hint String)) + // ToPrimitive(input argument, hint String) calls [[DefaultValue]] + // described in ECMA-262 8.6.2.6. The [[DefaultValue]] algorithm + // with hint String is inlined here. + Atom ScriptObject::toString() + { + AvmCore *core = this->core(); + Toplevel* toplevel = this->toplevel(); + + Atom atomv_out[1]; + + // call this.toString() + Multiname tempname(core->publicNamespace, core->ktoString); + atomv_out[0] = atom(); + Atom result = toplevel->callproperty(atom(), &tempname, 0, atomv_out, vtable); + + // if result is primitive, return its ToString + if ((result&7) != kObjectType) + return core->string(result)->atom(); + + // otherwise call this.valueOf() + tempname.setName(core->kvalueOf); + atomv_out[0] = atom(); + result = toplevel->callproperty(atom(), &tempname, 0, atomv_out, vtable); + + // if result is primitive, return it + if ((result&7) != kObjectType) + return core->string(result)->atom(); + + // could not convert to primitive. + toplevel->throwTypeError(kConvertToPrimitiveError, core->toErrorString(traits())); + return undefinedAtom; + } + + // this = argv[0] (ignored) + // arg1 = argv[1] + // argN = argv[argc] + Atom ScriptObject::call(int /*argc*/, Atom* /*argv*/) + { + // TypeError in ECMA to execute a non-function + Multiname name(core()->publicNamespace, core()->constantString("value")); + toplevel()->throwTypeError(kCallOfNonFunctionError, core()->toErrorString(&name)); + return undefinedAtom; + } + + // this = argv[0] (ignored) + // arg1 = argv[1] + // argN = argv[argc] + Atom ScriptObject::construct(int /*argc*/, Atom* /*argv*/) + { + // TypeError in ECMA to execute a non-function + toplevel()->throwTypeError(kConstructOfNonFunctionError); + return undefinedAtom; + } + + Atom ScriptObject::getSlotAtom(int slot) + { + Traits* traits = this->traits(); + AvmCore* core = traits->core; + Traits* t = traits->getSlotTraits(slot); + AvmAssert(t != VOID_TYPE); + void* p = ((char*)this) + traits->getOffsets()[slot]; + if (!t || t == OBJECT_TYPE) + { + return *((Atom*)p); + } + else if (t == NUMBER_TYPE) + { + return core->doubleToAtom(*((double*)p)); + } + else if (t == INT_TYPE) + { + return core->intToAtom(*((int*)p)); + } + else if (t == UINT_TYPE) + { + return core->uintToAtom(*((uint32*)p)); + } + else if (t == BOOLEAN_TYPE) + { + return (*((int*)p)<<3)|kBooleanType; + } + else if (t == STRING_TYPE) + { + Stringp s = *((Stringp*)p); + return s->atom(); // may be null|kStringType, that's ok + } + else if (t == NAMESPACE_TYPE) + { + Namespace* ns = *((Namespace**)p); + return ns->atom(); // may be null|kNamespaceType, no problemo + } + else + { + ScriptObject* o = *((ScriptObject**)p); + return o->atom(); // may be null|kObjectType, copasthetic + } + } + + void ScriptObject::setSlotAtom(int slot, Atom value) + { + Traits* traits = this->traits(); + AvmCore* core = traits->core; + Traits* t = traits->getSlotTraits(slot); + AvmAssert(t != VOID_TYPE); + Atom *p = (Atom*)(((char*)this) + traits->getOffsets()[slot]); + if (!t || t == OBJECT_TYPE) + { + //*((Atom*)p) = value; + WBATOM(core->GetGC(), this, p, value); + } + else if (t == NUMBER_TYPE) + { + *((double*)p) = AvmCore::number_d(value); + } + else if (t == INT_TYPE) + { + *((int*)p) = AvmCore::integer_i(value); + } + else if (t == UINT_TYPE) + { + *((uint32*)p) = AvmCore::integer_u(value); + } + else if (t == BOOLEAN_TYPE) + { + *((int*)p) = urshift(value,3); + } + else + { + //*((int32*)p) = value & ~7; + WBRC(core->GetGC(), this, p, value & ~7); + } + } + + Atom ScriptObject::nextName(int index) + { + AvmAssert(traits()->needsHashtable); + AvmAssert(index > 0); + + Hashtable *ht = getTable(); + if (index-1 >= ht->getNumAtoms()/2) + return nullStringAtom; + Atom m = ht->getAtoms()[(index-1)<<1] & ~ht->dontEnumMask(); + if (AvmCore::isNullOrUndefined(m)) + return nullStringAtom; + return m; + } + + Atom ScriptObject::nextValue(int index) + { + AvmAssert(traits()->needsHashtable); + AvmAssert(index > 0); + + Hashtable *ht = getTable(); + if (index-1 >= ht->getNumAtoms()/2) + return undefinedAtom; + Atom m = ht->getAtoms()[(index-1)<<1] & ~ht->dontEnumMask(); + if (AvmCore::isNullOrUndefined(m)) + return nullStringAtom; + return getTable()->getAtoms()[((index-1)<<1)+1]; + } + + int ScriptObject::nextNameIndex(int index) + { + AvmAssert(index >= 0); + + if (!traits()->needsHashtable) + return 0; + + // todo clean this up. + if (index != 0) { + index = index<<1; + } + // Advance to first non-empty slot. + Hashtable* table = getTable(); + int numAtoms = table->getNumAtoms(); + int dontEnumMask = table->dontEnumMask(); + while (index < numAtoms) { + Atom m = table->getAtoms()[index]; + if (m != 0 && m != undefinedAtom && (m & dontEnumMask) != Hashtable::kDontEnumBit) + return (index>>1)+1; + index += 2; + } + return 0; + } + + /** + * the default implementation calls the delegate (should be the base class objects) + * so that derived classes delegate object allocation to the base class. If you + * are overriding createInstance and your base class is Object, unconditionally allocate + * the instance object using the given vtable and prototype. + */ + ScriptObject* ScriptObject::createInstance(VTable* ivtable, ScriptObject* prototype) + { + if (ivtable->base) + { + ScopeChain *scope = vtable->scope; + if (scope->getSize()) + { + Atom baseAtom = scope->getScope(scope->getSize()-1); + if (!AvmCore::isObject(baseAtom)) + toplevel()->throwVerifyError(kCorruptABCError); + + ScriptObject *base = AvmCore::atomToScriptObject(baseAtom); + // make sure scope object is base type's class object + AvmAssert(base->traits()->itraits == this->traits()->itraits->base); + return base->createInstance(ivtable, prototype); + } + } + + return core()->newObject(ivtable, prototype); + } + + + /** + * Function.prototype.call() + */ + Atom ScriptObject::function_call(Atom thisArg, + Atom *argv, + int argc) + { + if (argc > 0) + { + // argc = # of AS3 arguments + AvmAssert(argc >= 0); + Atom *newargs = (Atom *) alloca(sizeof(Atom)*(argc+1)); + newargs[0] = thisArg; + memcpy(&newargs[1], argv, argc*sizeof(Atom)); + return call(argc, newargs); + } + else + { + // AS3 caller didn't supply any args + Atom newargs[1] = { thisArg }; + return call(0, newargs); + } + } + + /** + * Function.prototype.apply() + */ + Atom ScriptObject::function_apply(Atom thisArg, Atom argArray) + { + // when argArray == undefined or null, same as not being there at all + // see Function/e15_3_4_3_1.as + + if (!AvmCore::isNullOrUndefined(argArray)) + { + AvmCore* core = this->core(); + + if (!core->istype(argArray, ARRAY_TYPE)) + toplevel()->throwTypeError(kApplyError); + + ArrayObject *a = (ArrayObject*)AvmCore::atomToScriptObject(argArray); + + int count = a->getLength(); + Atom* newargs = (Atom*) alloca(sizeof(Atom)*(1+count)); + newargs[0] = thisArg; + for (int i=0; igetUintProperty(i); + } + return call(count, newargs); + } + else + { + Atom newargs[1] = { thisArg }; + return call(0, newargs); + } + } + +#ifdef DEBUGGER + void ScriptObject::addInstance(Atom a) + { + if(!instances) { + if(!toplevel()->objectClass->ivtable()) + return; + VTable *vt = toplevel()->objectClass->ivtable(); + instances = new (gc(), vt->getExtraSize()) GCHashtableScriptObject(vt); + } + if(AvmCore::isPointer(a) && !AvmCore::isNumber(a)) + { + instances->ht.add(a, NULL); + // tell the thing about its atom rep so it can properly remove itself later + AvmPlusScriptableObject *o = (AvmPlusScriptableObject*)(a&~7); + o->setType(a&7); + o->setCreator(this); + } + + } + + void ScriptObject::removeInstance(Atom a) + { + if(instances && instances->ht.count() > 0) + { + instances->ht.remove((const void*)a); + } + } + + ScriptObject* ScriptObject::getInstances() + { + return instances; + } + + ScriptObject* ScriptObject::getSlotIterator() + { + VTable *vt = toplevel()->objectClass->ivtable(); + return new (gc(), vt->getExtraSize()) SlotIterator(this, vt); + } + + uint32 ScriptObject::size() const + { + uint32 size = traits()->getTotalSize(); + if(traits()->needsHashtable) + { + Hashtable *ht = getTable(); + size += ht->getSize() * 2 * sizeof(Atom); + } + size -= sizeof(AvmPlusScriptableObject); + return size; + } +#endif +} diff --git a/mozilla/js/tamarin/core/ScriptObject.h b/mozilla/js/tamarin/core/ScriptObject.h new file mode 100644 index 00000000000..18e0e99b99c --- /dev/null +++ b/mozilla/js/tamarin/core/ScriptObject.h @@ -0,0 +1,210 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_ScriptObject__ +#define __avmplus_ScriptObject__ + + +namespace avmplus +{ +#ifdef DEBUGGER + class GCHashtableScriptObject; +#endif + /** + * one actionscript object. might or might not be a function. + * Base class for all objects visible to script code. + */ + class ScriptObject : public AvmPlusScriptableObject + { + private: + #ifdef AVMPLUS_MIR + friend class CodegenMIR; + #endif + + public: + VTable* const vtable; + + ScriptObject(VTable* vtable, ScriptObject* delegate, + int capacity = Hashtable::kDefaultCapacity); + ~ScriptObject(); + + ScriptObject* getDelegate() const { return delegate; } + void setDelegate(ScriptObject *d) { WBRC(MMgc::GC::GetGC(this), this, &delegate, d); } + + Atom atom() const { + return kObjectType|(int)this; + } + + virtual Atom toAtom() const { + return atom(); + } + + Traits* traits() const { + return vtable->traits; + } + + AvmCore* core() const { + return vtable->traits->core; + } + + MMgc::GC* gc() const { + return core()->GetGC(); + } + + Toplevel* toplevel() const { + return vtable->toplevel; + } + + DomainEnv* domainEnv() const { + return vtable->abcEnv->domainEnv; + } + + virtual Hashtable* getTable() const { + AvmAssert(vtable->traits->hashTableOffset != -1); + return (Hashtable*)((byte*)this+vtable->traits->hashTableOffset); + } + + bool isValidDynamicName(Multiname* m) const { + return m->contains(core()->publicNamespace) && !m->isAnyName() && !m->isAttr(); + } + + Atom getSlotAtom(int slot); + void setSlotAtom(int slot, Atom atom); + + virtual Atom getProperty(Multiname* name) const; + virtual void setProperty(Multiname* name, Atom value); + virtual bool deleteProperty(Multiname* name); + virtual bool hasProperty(Multiname* name) const; + + virtual Atom getDescendants(Multiname* name) const; + + // argv[0] = receiver + virtual Atom callProperty(Multiname* name, int argc, Atom* argv); + virtual Atom constructProperty(Multiname* name, int argc, Atom* argv); + + virtual Atom getProperty(Atom name) const; + virtual Atom getProperty(Stringp name) const { + return getProperty(name->atom()); + } + + virtual bool hasProperty(Atom name) const; + virtual bool hasProperty(Stringp name) const + { + AvmAssert(name != NULL && name->isInterned()); + return hasProperty(name->atom()); + } + + virtual bool propertyIsEnumerable(Atom name) const; + virtual bool propertyIsEnumerable(Stringp name) const + { + AvmAssert(name != NULL && name->isInterned()); + return propertyIsEnumerable(name->atom()); + } + + virtual void setPropertyIsEnumerable(Atom name, bool enumerable); + virtual void setPropertyIsEnumerable(Stringp name, bool enumerable) + { + setPropertyIsEnumerable(name->atom(), enumerable); + } + + virtual bool deleteProperty(Atom name); + virtual bool deleteProperty(Stringp name) { + return deleteProperty(name->atom()); + } + + virtual void setProperty(Atom name, Atom value); + virtual void setProperty(Stringp name, Atom value) { + setProperty(name->atom(), value); + } + + Atom getPropertyFromProtoChain(Atom name, ScriptObject* protochain, Traits *origObjTraits) const; + Atom getPropertyFromProtoChain(Stringp name, ScriptObject* protochain, Traits *origObjTraits) const + { + return getPropertyFromProtoChain(name->atom(), protochain, origObjTraits); + } + + virtual Atom getUintProperty(uint32 i) const; + virtual void setUintProperty(uint32 i, Atom value); + virtual bool delUintProperty(uint32 i); + virtual bool hasUintProperty(uint32 i) const; + + virtual Atom defaultValue(); // ECMA [[DefaultValue]] + virtual Atom toString(); + + // argv[0] = receiver + virtual Atom call(int argc, Atom* argv); + + // argv[0] = receiver(ignored) + virtual Atom construct(int argc, Atom* argv); + + // TODO make this const + virtual Atom nextName(int index); + + // TODO make this const + virtual Atom nextValue(int index); + + // TODO make this const + virtual int nextNameIndex(int index); + + // HACK; we need this so we can compare MethodClosures that + // have the same instance and method. + virtual bool isMethodClosure() { return false; } + + virtual ScriptObject* createInstance(VTable* ivtable, ScriptObject* prototype); + + Atom function_call(Atom thisAtom, Atom *argv, int argc); + Atom function_apply(Atom thisAtom, Atom argArray); + + // The maximum integer key we can use with our ScriptObject + // HashTable must fit within 28 bits. Any integer larger + // than 28 bits will use a string key. + static const int MAX_INTEGER_MASK = 0xF0000000; + +#ifdef AVMPLUS_VERBOSE + public: + virtual Stringp format(AvmCore* core) const; +#endif + private: + ScriptObject* delegate; // __proto__ in AS2, archetype in semantics + +#ifdef DEBUGGER + DRCWB(GCHashtableScriptObject*) instances; + public: + void addInstance(Atom a); + void removeInstance(Atom a); + ScriptObject *getInstances(); + ScriptObject *getSlotIterator(); + uint32 size() const; +#endif + }; +} + +#endif /* __avmplus_ScriptObject__ */ diff --git a/mozilla/js/tamarin/core/SortedIntMap.h b/mozilla/js/tamarin/core/SortedIntMap.h new file mode 100644 index 00000000000..9a3056aeeaf --- /dev/null +++ b/mozilla/js/tamarin/core/SortedIntMap.h @@ -0,0 +1,291 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_SortedIntMap__ +#define __avmplus_SortedIntMap__ + + +namespace avmplus +{ + /** + * The SortedIntMap template implements an object that + * maps integer keys to values. The keys are sorted + * from smallest to largest in the map. Time of operations + * is as follows: + * put() is O(1) if the key is higher than any existing + * key; O(logN) if the key already exists, + * and O(N) otherwise. + * get() is an O(logN) binary search. + * + * no duplicates are allowed. + */ + template + class SortedIntMap : public MMgc::GCObject + { + public: + enum { kInitialCapacity= 64 }; + + SortedIntMap(int capacity=kInitialCapacity) + { + init(0, capacity, false, 0); + } + SortedIntMap(MMgc::GC* gc, uint32 capacity=kInitialCapacity, bool livesInGCContainer=true, int flags=MMgc::GC::kContainsPointers) + { + init(gc, capacity, livesInGCContainer, flags); + } + void init(MMgc::GC* gc, uint32 capacity, bool livesInGCContainer, int flags) + { + len = 0; + max = 0; + keys = NULL; + values = NULL; + this->gc = gc; + this->gcFlags = flags; + this->livesInGCContainer = livesInGCContainer; + ensureCapacity(capacity); + } + ~SortedIntMap() + { + if(gc) + { + gc->Free(keys); + gc->Free(values); + } + else + { + delete [] keys; + delete [] values; + } + max = 0; + len = 0; + } + bool isEmpty() const + { + return len == 0; + } + int size() const + { + return len; + } + int capacity() const + { + return max; + } + void clear() + { + len = 0; + } + T put(int k, T v) + { + if (len == 0 || k > keys[len-1]) + { + if (len == max) + grow(); + set(len, k, v); + len++; + return (T)v; + } + else + { + int i = find(k); + if (i >= 0) + { + T old = values[i]; + set(i, k, v); + return old; + } + else + { + i = -i - 1; // recover the insertion point + if (len == max) + grow(); + arraycopy(keys,i,keys,i+1,len-i); + arraycopy(values,i,values,i+1,len-i); + set(i, k, v); + len++; + return (T)v; + } + } + } + T get(int k) const + { + int i = find(k); + return i >= 0 ? values[i] : 0; + } + bool containsKey(int k) const + { + int i = find(k); + return (i >= 0) ? true : false; + } + T remove(int k) + { + int i = find(k); + return removeAt(i); + } + T removeAt(int i) + { + T old = (T)0; + if (i >= 0) + { + old = values[i]; + arraycopy(keys, i+1, keys, i, len-i-1); + arraycopy(values, i+1, values, i, len-i-1); + len--; + } + return old; + } + + T removeFirst() { return isEmpty() ? (T)0 : removeAt(0); } + T removeLast() { return isEmpty() ? (T)0 : removeAt(len-1); } + T first() const { return isEmpty() ? (T)0 : values[0]; } + T last() const { return isEmpty() ? (T)0 : values[len-1]; } + + int firstKey() const { return isEmpty() ? 0 : keys[0]; } + int lastKey() const { return isEmpty() ? 0 : keys[len-1]; } + + // you need to allocate the space for these + int keyArray(int* arr) { arraycopy(keys, 0, arr, 0, len); return len; } + int valueArray(T* arr) { arraycopy(values, 0, arr, 0, len); return len; } + + // iterator + T at(int i) const { return values[i]; } + int keyAt(int i) const { return keys[i]; } + + protected: + T *values; + int *keys; + int len; + int max; + + MMgc::GC* gc; + int reserved:28; + int gcFlags:3; + int livesInGCContainer:1; + + void set(int index, int k, T v) + { + keys[index] = k; + if (gc) + { + AvmAssert(sizeof(T) <= sizeof(int*)); // WB requries this... + WB(gc, values, &values[index], v); + } + else + { + values[index] = v; + } + } + int find(int k) const + { + int lo = 0; + int hi = len-1; + + while (lo <= hi) + { + int i = (lo + hi)/2; + long m = keys[i]; + if (k > m) + lo = i + 1; + else if (k < m) + hi = i - 1; + else + return i; // key found + } + return -(lo + 1); // key not found, low is the insertion point + } + void grow() + { + ensureCapacity(2*max); + } + void ensureCapacity(int32 cap) + { + if(cap > max) + { + T* newvalues = (gc) ? (T*) gc->Calloc(cap, sizeof(T), gcFlags) : new T[cap]; + int* newkeys = (gc) ? (int*) gc->Calloc(cap, sizeof(int), 0) : new int[cap]; + arraycopy(keys, 0, newkeys, 0 , len); + arraycopy(values, 0, newvalues, 0 , len); + if (gc) + { + gc->Free(keys); + gc->Free(values); + } + else + { + delete [] keys; + delete [] values; + } + + if (gc && livesInGCContainer) + { + WB(gc, gc->FindBeginning(this), &keys, newkeys); + WB(gc, gc->FindBeginning(this), &values, newvalues); + } + else + { + keys = newkeys; + values = newvalues; + } + max = cap; + } + } + void arraycopy(int* src, int srcStart, int* dst, int dstStart, int nbr) + { + // we have 2 cases, either closing a gap or opening it. + if ((src == dst) && (srcStart > dstStart) ) + { + for(int i=0; i=0; i--) + dst[i+dstStart] = src[i+srcStart]; + } + } + void arraycopy(T* src, int srcStart, T* dst, int dstStart, int nbr) + { + // we have 2 cases, either closing a gap or opening it. + if ((src == dst) && (srcStart > dstStart) ) + { + for(int i=0; i=0; i--) + dst[i+dstStart] = src[i+srcStart]; + } + } + }; +} + +#endif /* __avmplus_SortedIntMap__ */ diff --git a/mozilla/js/tamarin/core/StackTrace.cpp b/mozilla/js/tamarin/core/StackTrace.cpp new file mode 100644 index 00000000000..fbf04f17c68 --- /dev/null +++ b/mozilla/js/tamarin/core/StackTrace.cpp @@ -0,0 +1,231 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmplus.h" + +namespace avmplus +{ +#ifdef DEBUGGER + void CallStackNode::initialize(MethodEnv * env, + AbstractFunction * info, + Atom* framep, + Traits** traits, + int argc, + va_list ap, + int volatile * eip) + { + AvmCore *core = info->core(); + this->env = env; + this->info = info; + this->ap = ap; + this->argc = argc; + this->framep = framep; // pointer to top of AS registers + this->traits = traits; // pointer to traits of top of AS registers + this->eip = eip; // ptr to where the current instruction pointer is stored + filename = NULL; + linenum = 0; + + // scopechain stuff + #ifdef AVMPLUS_INTERP + this->scopeDepth = NULL; + #endif + + // link into callstack + next = core->callStack; + core->callStack = this; + + depth = next ? (next->depth+1) : 1; + AvmAssert(info != NULL); + } + + void CallStackNode::exit() + { + info->core()->callStack = next; + next = NULL; + } + + void** CallStackNode::scopeBase() + { + // If we were given a real frame, calculate the scope base; otherwise return NULL + if (framep && info) + return (void**) (framep + ((MethodInfo*)info)->local_count); + else + return NULL; + } + + // Dump a filename. The incoming filename is of the form + // "C:\path\to\package\root;package/package;filename". The path format + // will depend on the platform on which the movie was originally + // compiled, NOT the platform the the player is running in. + // + // We want to replace the semicolons with path separators. We'll take + // a guess at the appropriate path separator of the compilation + // platform by looking for any backslashes in the path. If there are + // any, then we'll assume backslash is the path separator. If not, + // we'll use forward slash. + void StackTrace::dumpFilename(Stringp filename, PrintWriter& out) const + { + wchar semicolonReplacement = '/'; + int length = filename->length(); + wchar ch; + int i; + + // look for backslashes; if there are any, then semicolons will be + // replaced with backslashes, not forward slashes + for (i=0; idepth != depth) + return false; + + Element *me = elements; + while(depth--) + { + if(me->info != e->info || me->filename != e->filename || me->linenum != e->linenum) + return false; + me++; + e++; + } + return true; + } + + /*static*/ + intptr StackTrace::hashCode(StackTrace::Element *e, int depth) + { + intptr hashCode = 0; + while(depth--) + { + hashCode ^= intptr(e->info)>>3; + hashCode ^= intptr(e->filename)>>3; + hashCode ^= (intptr)e->linenum; + e++; + } + return hashCode; + } + + Stringp StackTrace::format(AvmCore* core) + { + if(!stringRep) + { + Stringp s = core->kEmptyString; + int displayDepth = depth; + if (displayDepth > kMaxDisplayDepth) { + displayDepth = kMaxDisplayDepth; + } + const Element *e = elements; + for (int i=0; iconcatStrings(s, core->newString("\n")); + s = core->concatStrings(s, core->newString("\tat ")); + s = core->concatStrings(s, e->info->format(core)); + if(e->filename) + { + StringBuffer out(core); + out << '['; + dumpFilename(e->filename, out); + out << ':' + << (e->linenum) + << ']'; + s = core->concatStrings(s, core->newString(out.c_str())); + } + } + stringRep = s; + } + return stringRep; + } + + + FakeCallStackNode::FakeCallStackNode(AvmCore *core, const char *name) + { + this->core = core; + if(AvmCore::sampling && core && core->fakeMethodInfos && core->builtinPool) + { + this->core = core; + // have to turn sampling off during allocations to avoid recursion + AvmCore::sampling = false; + Stringp s = core->internAllocAscii(name); + Atom a = core->fakeMethodInfos->get(s->atom()); + AbstractFunction *af = (AbstractFunction*)AvmCore::atomToGCObject(a); + if(!af) + { + af = new (core->GetGC()) FakeAbstractFunction(); + a = AvmCore::gcObjectToAtom(af); + core->fakeMethodInfos->add(s->atom(), a); + af->name = s; + af->pool = core->builtinPool; + } + initialize(NULL, af, NULL, NULL, 0, NULL, NULL); + AvmCore::sampling = true; + core->sampleCheck(); + } + else + { + memset(this, 0, sizeof(FakeCallStackNode)); + } + } + + FakeCallStackNode::~FakeCallStackNode() + { + if(core) + { + exit(); + core->sampleCheck(); + } + } +#endif /* DEBUGGER */ +} diff --git a/mozilla/js/tamarin/core/StackTrace.h b/mozilla/js/tamarin/core/StackTrace.h new file mode 100644 index 00000000000..55c73de39e9 --- /dev/null +++ b/mozilla/js/tamarin/core/StackTrace.h @@ -0,0 +1,192 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_CallStackNode__ +#define __avmplus_CallStackNode__ + +namespace avmplus +{ +#ifdef DEBUGGER + class StackTrace : public MMgc::GCObject + { + public: + Stringp format(AvmCore* core); + + /** + * The dump and format methods display a human-readable + * version of the stack trace. To avoid thousands of + * lines of output, such as would happen in an infinite + * recursion, no more than kMaxDisplayDepth levels will + * be displayed. + */ + const static int kMaxDisplayDepth = 64; + + int depth; + DRCWB(Stringp) stringRep; + + struct Element + { + AbstractFunction *info; + Stringp filename; // in the form "C:\path\to\package\root;package/package;filename" + int linenum; + }; + bool equals(StackTrace::Element *e, int depth); + static intptr hashCode(StackTrace::Element *e, int depth); + + Element elements[1]; + private: + void dumpFilename(Stringp filename, PrintWriter& out) const; + }; + + /** + * The CallStackNode class tracks the call stack of executing + * ActionScript code. It is used for debugger stack dumps + * and also to keep track of the security contexts of + * running code. There is a master CallStackNode object on + * AvmCore, which is maintained by MethodInfo::enter as + * methods enter and exit. + * + * A single CallStackNode object represents a level of the + * call stack. It tracks the currently executing method, + * and the source file and line number if debug info + * is available. + * + * CallStackNode objects get strung together into linked + * lists to represent a full call stack. Entering a + * method adds a new element to core->stackTrace's + * linked list; exiting a method removes it. + * + * As OP_debugfile and OP_debugline opcodes are encountered, + * the file and line number information in the current + * CallStackNode object is updated. + * + * CallStackNode objects are "semi-immutable." The file + * and line number information can be updated until someone + * wants to snapshot the CallStackNode. To snapshot, the + * "freeze" method is called. This freezes the entire + * linked list. Once a CallStackNode is frozen, it cannot + * be directly modified... a clone must be made of it, + * and then the clone can be modified. + * + * The "semi-immutable" aspect is to support AVM+ heap + * profiling. Every ScriptObject will point to the + * CallStackNode at time of allocation, so that the developer + * can figure out the call stack where an object was + * created. The semi-immutability makes it possible to + * conserve memory, by having many ScriptObjects point to + * the same CallStackNode chain, or chains containing common + * CallStackNode elements. + */ + class CallStackNode + { + public: + /** + * Constructs a new CallStackNode. The method executing and + * the CallStackNode representing the previous call stack + * must be specified. The source file and line number + * will be unset, initially. + * @param info the currently executing method + * @param next the CallStackNode representing the previous + * call stack + */ + CallStackNode(MethodEnv * env, + AbstractFunction *info, + Atom* framep, + Traits** frameTraits, + int argc, + va_list ap, + int volatile * eip) + { + initialize(env, info, framep, frameTraits, argc, ap, eip); + } + + // WARNING!!!! this method is called by CodegenMIR if you change the signature then change the call there. + void initialize(MethodEnv * env, + AbstractFunction * info, + Atom* framep, + Traits** frameTraits, + int argc, + va_list ap, + int volatile * eip); + + void exit(); + + MethodEnv *env; + AbstractFunction* info; + Stringp filename; // in the form "C:\path\to\package\root;package/package;filename" + int linenum; + CallStackNode *next; + + int depth; + va_list ap; + int argc; + Atom* framep; // pointer to top of AS registers + Traits** traits; // array of traits for AS registers + int volatile * eip; // ptr to where the current pc is stored + + void** scopeBase(); // with MIR, array members are (ScriptObject*); with interpreter, they are (Atom). + #ifdef AVMPLUS_INTERP + int* scopeDepth; // Only used by the interpreter! With MIR, look for NULL entires in the scopeBase array. + #endif + protected: + // allow more flexibility to subclasses + CallStackNode(){} + }; + + + class FakeAbstractFunction : public AbstractFunction + { + public: + void verify(Toplevel *) {} + }; + + class FakeCallStackNode : public CallStackNode + { + public: + FakeCallStackNode(AvmCore *core, const char *name); + ~FakeCallStackNode(); + void sampleCheck() { if(core) core->sampleCheck(); } + private: + AvmCore *core; + }; + +#define SAMPLE_FRAME(_strp, _core) avmplus::FakeCallStackNode __fcsn((avmplus::AvmCore*)_core, _strp) +#define SAMPLE_CHECK() __fcsn.sampleCheck(); + +#else + +#define SAMPLE_FRAME(_x, _s) +#define SAMPLE_CHECK() + +#endif /* DEBUGGER */ +} + +#endif /* __avmplus_CallStackNode__ */ diff --git a/mozilla/js/tamarin/core/StaticProfiler.cpp b/mozilla/js/tamarin/core/StaticProfiler.cpp new file mode 100644 index 00000000000..8b84b6bcc21 --- /dev/null +++ b/mozilla/js/tamarin/core/StaticProfiler.cpp @@ -0,0 +1,130 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmplus.h" + + +#ifdef AVMPLUS_PROFILE +namespace avmplus +{ + StaticProfiler::StaticProfiler() + { + sprofile = false; + memset(counts, 0, 256*sizeof(int)); + memset(sizes, 0, 256*sizeof(int)); + totalCount = 0; + totalSize = 0; + cpoolSize = 0; + cpoolIntSize = 0; + cpoolUIntSize = 0; + cpoolDoubleSize = 0; + cpoolStrSize = 0; + cpoolNsSize = 0; + cpoolNsSetSize = 0; + cpoolMnSize = 0; + bodiesSize = 0; + methodsSize = 0; + instancesSize = 0; + classesSize = 0; + scriptsSize = 0; + } + + void StaticProfiler::dump(PrintWriter& console) + { + if (sprofile) + { + console << "verified instructions " + << totalCount + << '\n'; + console << "verified code size " + << totalSize + << '\n'; + console << "cpool size " + << cpoolSize + << '\n'; + console << "cpool int size " + << cpoolIntSize + << '\n'; + console << "cpool uint size " + << cpoolUIntSize + << '\n'; + console << "cpool double size " + << cpoolDoubleSize + << '\n'; + console << "cpool string size " + << cpoolStrSize + << '\n'; + console << "cpool namespacesize " + << cpoolNsSize + << '\n'; + console << "cpool namespace set size " + << cpoolNsSetSize + << '\n'; + console << "cpool multiname size " + << cpoolMnSize + << '\n'; + console << "methods size " + << methodsSize + << '\n'; + console << "instances size " + << instancesSize + << '\n'; + console << "classes size " + << classesSize + << '\n'; + console << "scripts size " + << scriptsSize + << '\n'; + console << "bodies size " + << bodiesSize + << '\n'; + for (int i=0; i < 256; i++) + { + if (counts[i] != 0) + { + console << counts[i] + << '\t' + << (100*counts[i]/totalCount) + << " %\t" + << sizes[i] + << " B\t" + << (100*sizes[i]/totalSize) + << " %\t " + << opNames[i] + << '\n'; + } + } + } + } + +} +#endif diff --git a/mozilla/js/tamarin/core/StaticProfiler.h b/mozilla/js/tamarin/core/StaticProfiler.h new file mode 100644 index 00000000000..8024d368320 --- /dev/null +++ b/mozilla/js/tamarin/core/StaticProfiler.h @@ -0,0 +1,80 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_StaticProfiler__ +#define __avmplus_StaticProfiler__ + + +#ifdef AVMPLUS_PROFILE +namespace avmplus +{ + /** + * Provides static profiling support for the AVM+. + */ + class StaticProfiler + { + public: + StaticProfiler(); + + bool sprofile; + + int counts[256]; + int sizes[256]; + int totalCount; + int totalSize; + int cpoolSize; + int cpoolIntSize; + int cpoolUIntSize; + int cpoolDoubleSize; + int cpoolStrSize; + int cpoolNsSize; + int cpoolNsSetSize; + int cpoolMnSize; + int methodsSize; + int bodiesSize; + int classesSize; + int instancesSize; + int scriptsSize; + + void dump(PrintWriter& console); + + void tally(AbcOpcode opcode, int size) + { + counts[opcode]++; + totalCount++; + sizes[opcode] += size; + totalSize += size; + } + }; +} +#endif + +#endif /* __avmplus_StaticProfiler__ */ diff --git a/mozilla/js/tamarin/core/String.as b/mozilla/js/tamarin/core/String.as new file mode 100644 index 00000000000..5b6c6c3a8f9 --- /dev/null +++ b/mozilla/js/tamarin/core/String.as @@ -0,0 +1,245 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +package +{ + public final class String extends Object + { + // String.length = 1 per ES3 + // E262 {ReadOnly, DontDelete, DontEnum } + public static const length:int = 1 + + AS3 native static function fromCharCode(... arguments):String + String.fromCharCode = function(... arguments) { + return AS3::fromCharCode.apply(String,arguments) + } + + // E262 {DontEnum, DontDelete, ReadOnly} + public native function get length():int + + // indexOf and other _ functions get early bound by MIR + private native function _indexOf(s:String, i:int=0):int + AS3 native function indexOf(s:String="undefined", i:Number=0):int + prototype.indexOf = function(s:String="undefined", i:Number=0):int + { + return String(this).AS3::indexOf(s, i) + } + + // lastIndexOf + private native function _lastIndexOf(s:String, i:int=0x7fffffff):int + AS3 native function lastIndexOf(s:String="undefined", i:Number=0x7FFFFFFF):int + + prototype.lastIndexOf = function(s:String="undefined", i:Number=0x7fffffff):int + { + return String(this).AS3::lastIndexOf(s, i) + } + + // charAt + private native function _charAt(i:int=0):String + AS3 native function charAt(i:Number=0):String + + prototype.charAt = function(i:Number=0):String + { + return String(this).AS3::charAt(i) + } + + // charCodeAt + private native function _charCodeAt(i:int=0):Number + AS3 native function charCodeAt(i:Number=0):Number + + prototype.charCodeAt = function(i:Number=0):Number + { + return String(this).AS3::charCodeAt(i) + } + + // concat + AS3 function concat(...args):String + { + var s:String = this + for (var i:uint = 0, n:uint = args.length; i < n; i++) + s = s + String(args[i]) + return s + } + + prototype.concat = function(... args):String + { + // todo: use function.apply or array.join? + var s:String = String(this) + for (var i:uint = 0, n:uint = args.length; i < n; i++) + s = s + String(args[i]) + return s + } + + AS3 native function localeCompare(other:String=void 0):int + prototype.localeCompare = function(other:String=void 0):int + { + return String(this).AS3::localeCompare(other) + } + + // match + // P can be a RegEx or is coerced to a string (and then RegEx constructor is called) + private static native function _match(s:String, p):Array + AS3 function match(p=void 0):Array + { + return _match(this, p) + } + prototype.match = function(p=void 0):Array + { + return _match(String(this), p) + } + + // replace + // p is a RegEx or string + // repl is a function or coerced to a string + private static native function _replace(s:String, p, repl):String + AS3 function replace(p=void 0, repl=void 0):String + { + return _replace(this, p, repl) + } + prototype.replace = function(p=void 0, repl=void 0):String + { + return _replace(String(this), p, repl) + } + + // search + // P can be a RegEx or is coerced to a string (and then RegEx constructor is called) + private static native function _search(s:String, p):int + AS3 function search(p=void 0):int + { + return _search(this, p) + } + + prototype.search = function(p=void 0):int + { + return _search(String(this), p) + } + + // slice + private native function _slice(start:int=0, end:int=0x7fffffff):String + AS3 native function slice(start:Number=0, end:Number=0x7fffffff):String + prototype.slice = function(start:Number=0, end:Number=0x7fffffff):String + { + return String(this).AS3::slice(start, end) + } + + // This is a static helper since it depends on AvmCore which String objects + // don't have access to. + // delim can be a RegEx or is coerced to a string (and then RegEx constructor is called) + private static native function _split(s:String, delim, limit:uint):Array + AS3 function split(delim=void 0, limit=0xffffffff):Array + { + // ECMA compatibility - limit can be undefined + if (limit == undefined) + limit = 0xffffffff; + return _split(this, delim, limit) + } + prototype.split = function(delim=void 0, limit=0xffffffff):Array + { + // ECMA compatibility - limit can be undefined + if (limit == undefined) + limit = 0xffffffff; + return _split(String(this), delim, limit) + } + + // substring + private native function _substring(start:int=0, end:int=0x7fffffff):String + AS3 native function substring(start:Number=0, end:Number=0x7fffffff):String + prototype.substring = function(start:Number=0, end:Number=0x7fffffff):String + { + return String(this).AS3::substring(start, end) + } + + // substr + private native function _substr(start:int=0, end:int=0x7fffffff):String + AS3 native function substr(start:Number=0, len:Number=0x7fffffff):String + prototype.substr = function(start:Number=0, len:Number=0x7fffffff):String + { + return String(this).AS3::substr(start, len) + } + + AS3 native function toLowerCase():String + AS3 function toLocaleLowerCase():String + { + return this.AS3::toLowerCase(); + } + + prototype.toLowerCase = prototype.toLocaleLowerCase = + function():String + { + return String(this).AS3::toLowerCase() + } + + AS3 native function toUpperCase():String + AS3 function toLocaleUpperCase():String + { + return this.AS3::toUpperCase(); + } + + prototype.toUpperCase = prototype.toLocaleUpperCase = + function():String + { + return String(this).AS3::toUpperCase() + } + + AS3 function toString():String { return this } + AS3 function valueOf():String { return this } + + prototype.toString = function():String + { + if (this === prototype) + return "" + + if (!(this is String)) + Error.throwError( TypeError, 1004 /*kInvokeOnIncompatibleObjectError*/, "String.prototype.toString" ); + + return this + } + + prototype.valueOf = function() + { + if (this === prototype) + return "" + + if (!(this is String)) + Error.throwError( TypeError, 1004 /*kInvokeOnIncompatibleObjectError*/, "String.prototype.valueOf" ); + + return this + } + + // Dummy constructor function - This is neccessary so the compiler can do arg # checking for the ctor in strict mode + // The code for the actual ctor is in StringClass::construct in the avmplus + public function String(value = "") + {} + + _dontEnumPrototype(prototype); + } +} diff --git a/mozilla/js/tamarin/core/StringBuffer.cpp b/mozilla/js/tamarin/core/StringBuffer.cpp new file mode 100644 index 00000000000..aef18f2e90e --- /dev/null +++ b/mozilla/js/tamarin/core/StringBuffer.cpp @@ -0,0 +1,74 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#include "avmplus.h" + +namespace avmplus +{ + using namespace MMgc; + + StringOutputStream::StringOutputStream(GC *gc) + { + GCAssert(!gc->IsPointerToGCPage(this)); + m_buffer = (char*) gc->Alloc(kInitialCapacity); + m_buffer[0] = 0; + m_length = 0; + } + + StringOutputStream::~StringOutputStream() + { + if (m_buffer) { + GC* gc = MMgc::GC::GetGC(m_buffer); + gc->Free(m_buffer); + } + } + + int StringOutputStream::write(const void *buffer, + int count) + { + if (m_length + count >= (int)GC::Size(m_buffer)) + { + GC* gc = MMgc::GC::GetGC(m_buffer); + int newCapacity = (m_length+count+1)*2; + char *newBuffer = (char*) gc->Alloc(newCapacity); + if (!newBuffer) { + return 0; + } + memcpy(newBuffer, m_buffer, m_length); + gc->Free(m_buffer); + m_buffer = newBuffer; + } + memcpy(m_buffer+m_length, buffer, count); + m_length += count; + m_buffer[m_length] = 0; + return count; + } +} diff --git a/mozilla/js/tamarin/core/StringBuffer.h b/mozilla/js/tamarin/core/StringBuffer.h new file mode 100644 index 00000000000..73f1945e02d --- /dev/null +++ b/mozilla/js/tamarin/core/StringBuffer.h @@ -0,0 +1,94 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 1993-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#ifndef __avmplus_StringBuffer__ +#define __avmplus_StringBuffer__ + +namespace avmplus +{ + /** + * StringOutputStream is an OutputStream subclass, where + * any data written to the stream is accumulated into + * an in-memory buffer. The buffer can later be retrieved + * using the c_str method. + */ + class StringOutputStream : public OutputStream + { + public: + StringOutputStream(MMgc::GC *gc); + ~StringOutputStream(); + + const char *c_str() { return m_buffer; } + int length() const { return m_length; } + void reset() { m_length=0; } + + int write(const void *buffer, int count); + + private: + enum { kInitialCapacity = 256 }; + + char* m_buffer; + int m_length; + + void grow(int newLength); + }; + + /** + * StringBuffer is a PrintWriter subclass which enables + * easy, cout-like output of text to a string buffer + * in memory. + */ + class StringBuffer : public PrintWriter + { + public: + StringBuffer(AvmCore* core) : + PrintWriter(core), m_stream(core->GetGC()) + { + setOutputStream(&m_stream); + } + + StringBuffer(MMgc::GC *gc) : + PrintWriter(NULL), m_stream(gc) + { + setOutputStream(&m_stream); + } + + const char *c_str() { return m_stream.c_str(); } + int length() const { return m_stream.length(); } + void reset() { m_stream.reset(); } + + private: + StringOutputStream m_stream; + }; +} + +#endif /* __avmplus_StringBuffer__ */ diff --git a/mozilla/js/tamarin/core/StringClass.cpp b/mozilla/js/tamarin/core/StringClass.cpp new file mode 100644 index 00000000000..99e877e0582 --- /dev/null +++ b/mozilla/js/tamarin/core/StringClass.cpp @@ -0,0 +1,385 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmplus.h" + +namespace avmplus +{ +#ifdef __MWERKS__ + typedef void (String::*StringHandler)(); + + NativeTableEntry::Handler stringMethod(StringHandler stringHandler) + { + union + { + StringHandler foo; + NativeTableEntry::Handler bar; + }; + foo = stringHandler; + return bar; + } + + #define STRING_METHOD(handler) stringMethod((StringHandler)handler) +#else + #define STRING_METHOD(x) x +#endif + + BEGIN_NATIVE_MAP(StringClass) + // instance methods + NATIVE_METHOD2_FLAGS(String_length_get, STRING_METHOD(&String::length), 0) + NATIVE_METHOD2_FLAGS(String_AS3_localeCompare, STRING_METHOD(&String::localeCompare), AbstractFunction::NEED_REST) + + NATIVE_METHOD2_FLAGS(String_private__indexOf, STRING_METHOD(&String::indexOf), 0) + NATIVE_METHOD2_FLAGS(String_AS3_indexOf, STRING_METHOD(&String::indexOfDouble), 0) + + NATIVE_METHOD2_FLAGS(String_private__lastIndexOf, STRING_METHOD(&String::lastIndexOf), 0) + NATIVE_METHOD2_FLAGS(String_AS3_lastIndexOf, STRING_METHOD(&String::lastIndexOfDouble), 0) + + NATIVE_METHOD2_FLAGS(String_private__charAt, STRING_METHOD(&String::charAt), 0) + NATIVE_METHOD2_FLAGS(String_AS3_charAt, STRING_METHOD(&String::charAtDouble), 0) + + NATIVE_METHOD2_FLAGS(String_private__charCodeAt, STRING_METHOD(&String::charCodeAt), 0) + NATIVE_METHOD2_FLAGS(String_AS3_charCodeAt, STRING_METHOD(&String::charCodeAtDouble), 0) + + NATIVE_METHOD2_FLAGS(String_private__substring, STRING_METHOD(&String::substring), 0) + NATIVE_METHOD2_FLAGS(String_AS3_substring, STRING_METHOD(&String::substringDouble), 0) + + NATIVE_METHOD2_FLAGS(String_private__slice, STRING_METHOD(&String::slice), 0) + NATIVE_METHOD2_FLAGS(String_AS3_slice, STRING_METHOD(&String::sliceDouble), 0) + + NATIVE_METHOD2_FLAGS(String_private__substr, STRING_METHOD(&String::substr), 0) + NATIVE_METHOD2_FLAGS(String_AS3_substr, STRING_METHOD(&String::substrDouble), 0) + + NATIVE_METHOD2_FLAGS(String_AS3_toLowerCase, STRING_METHOD(&String::toLowerCase), 0) + NATIVE_METHOD2_FLAGS(String_AS3_toUpperCase, STRING_METHOD(&String::toUpperCase), 0) + + // static method (language feature - by design) + NATIVE_METHODV(String_AS3_fromCharCode, StringClass::fromCharCode) + + // static methods (require AvmCore *) + NATIVE_METHOD2(String_private__match, &StringClass::match) + NATIVE_METHOD2(String_private__replace, &StringClass::replace) + NATIVE_METHOD2(String_private__search, &StringClass::search) + NATIVE_METHOD2(String_private__split, &StringClass::split) + + END_NATIVE_MAP() + + StringClass::StringClass(VTable* cvtable) + : ClassClosure(cvtable) + { + toplevel()->stringClass = this; + createVanillaPrototype(); + + // Some sanity tests for string/wchar* comparison routines +#if 0 && defined(_DEBUG) + Stringp a = core()->newString ("a", 1); + Stringp b = core()->newString ("b", 1); + Stringp c = core()->newString ("c", 1); + + AvmAssert( (*a == *a)); + AvmAssert(!(*a != *a)); + AvmAssert( (*a >= *a)); + AvmAssert( (*a <= *a)); + AvmAssert(!(*a > *a)); + AvmAssert(!(*a < *a)); + + AvmAssert(!(*a == *b)); + AvmAssert( (*a != *b)); + AvmAssert(!(*a >= *b)); + AvmAssert( (*a <= *b)); + AvmAssert(!(*a > *b)); + AvmAssert( (*a < *b)); + + AvmAssert(!(*c == *b)); + AvmAssert( (*c != *b)); + AvmAssert( (*c >= *b)); + AvmAssert(!(*c <= *b)); + AvmAssert( (*c > *b)); + AvmAssert(!(*c < *b)); + + wchar d[2]; + d[0] = 'a'; + d[1] = 0; + + AvmAssert( (d == *a)); + AvmAssert(!(d != *a)); + AvmAssert( (d >= *a)); + AvmAssert( (d <= *a)); + AvmAssert(!(d > *a)); + AvmAssert(!(d < *a)); + + AvmAssert( (*a == d)); + AvmAssert(!(*a != d)); + AvmAssert( (*a >= d)); + AvmAssert( (*a <= d)); + AvmAssert(!(*a > d)); + AvmAssert(!(*a < d)); + + AvmAssert(!(d == *b)); + AvmAssert( (d != *b)); + AvmAssert(!(d >= *b)); + AvmAssert( (d <= *b)); + AvmAssert(!(d > *b)); + AvmAssert( (d < *b)); + + wchar e[2]; + e[0] = 'b'; + e[1] = 0; + + AvmAssert(!(*c == e)); + AvmAssert( (*c != e)); + AvmAssert( (*c >= e)); + AvmAssert(!(*c <= e)); + AvmAssert( (*c > e)); + AvmAssert(!(*c < e)); +#endif + } + + // this = argv[0] (ignored) + // arg1 = argv[1] + // argN = argv[argc] + Atom StringClass::construct(int argc, Atom* argv) + { + if (argc == 0) { + return core()->kEmptyString->atom(); + } else { + return core()->string(argv[1])->atom(); + } + // TODO ArgumentError if argc > 1 + } + + // this = argv[0] (ignored) + // arg1 = argv[1] + // argN = argv[argc] + Atom StringClass::call(int argc, Atom* argv) + { + return construct(argc, argv); + } + + Stringp StringClass::fromCharCode(Atom *argv, int argc) + { + AvmCore* core = this->core(); + Stringp out = new (core->GetGC()) String(argc); + wchar *ptr = out->lockBuffer(); + + for (int i=0; iinteger(argv[i])); + } + *ptr = 0; + + out->unlockBuffer(); + return out; + } + + ArrayObject *StringClass::match(Stringp in, Atom regexpAtom) + { + AvmCore* core = this->core(); + + if (!core->istype(regexpAtom, core->traits.regexp_itraits)) + { + // ECMA-262 15.5.4.10 + // If the argument is not a RegExp, invoke RegExp(exp) + regexpAtom = core->newRegExp(toplevel()->regexpClass(), + core->string(regexpAtom), + core->kEmptyString)->atom(); + } + + RegExpObject *reObj = (RegExpObject*) AvmCore::atomToScriptObject(regexpAtom); + return reObj->match(in); + } + + Stringp StringClass::replace(Stringp subject, Atom pattern, Atom replacementAtom) + { + AvmCore* core = this->core(); + + ScriptObject *replaceFunction = NULL; + Stringp replacement = NULL; + if (core->istype(replacementAtom, core->traits.function_itraits)) { + replaceFunction = AvmCore::atomToScriptObject(replacementAtom); + } else { + replacement = core->string(replacementAtom); + } + + if (core->istype(pattern, core->traits.regexp_itraits)) { + // RegExp mode + RegExpObject *reObj = (RegExpObject*) core->atomToScriptObject(pattern); + if (replaceFunction) { + return core->string(reObj->replace(subject, replaceFunction)); + } else { + return core->string(reObj->replace(subject, replacement)); + } + + } else { + // String replace mode + Stringp searchString = core->string(pattern); + + int index = subject->indexOf(searchString); + if (index == -1) { + // Search string not found; return input unchanged. + return subject; + } + + if (replaceFunction) { + // Invoke the replacement function to figure out the + // replacement string + Atom argv[4] = { undefinedAtom, + searchString->atom(), + core->uintToAtom(index), + subject->atom() }; + replacement = core->string(toplevel()->op_call(replaceFunction->atom(), + 3, argv)); + } + + int newlen = subject->length() - searchString->length() + replacement->length(); + + Stringp out = new (core->GetGC()) String(newlen); + + wchar *buffer = out->lockBuffer(); + memcpy(buffer, subject->c_str(), index*sizeof(wchar)); + memcpy(buffer+index, replacement->c_str(), replacement->length()*sizeof(wchar)); + memcpy(buffer+index+replacement->length(), + subject->c_str()+index+searchString->length(), + (subject->length()-searchString->length()-index+1)*sizeof(wchar)); + buffer[newlen] = 0; + out->unlockBuffer(); + + return out; + } + } + + int StringClass::search(Stringp in, Atom regexpAtom) + { + AvmCore* core = this->core(); + + if (!core->istype(regexpAtom, core->traits.regexp_itraits)) { + // ECMA-262 15.5.4.10 + // If the argument is not a RegExp, invoke RegExp(exp) + regexpAtom = core->newRegExp(toplevel()->regexpClass(), + core->string(regexpAtom), + core->kEmptyString)->atom(); + } + + RegExpObject *reObj = (RegExpObject*) AvmCore::atomToScriptObject(regexpAtom); + return reObj->search(in); + } + + ArrayObject* StringClass::split(Stringp in, Atom delimAtom, uint32 limit) + { + AvmCore* core = this->core(); + + if (limit == 0) + return toplevel()->arrayClass->newArray(); + + if (in->length() == 0) + { + ArrayObject* out = toplevel()->arrayClass->newArray(); + out->setUintProperty(0,in->atom()); + return out; + } + + // handle RegExp case + if (core->istype(delimAtom, core->traits.regexp_itraits)) + { + RegExpObject *reObj = (RegExpObject*) AvmCore::atomToScriptObject(delimAtom); + return reObj->split(in, limit); + } + + ArrayObject *out = toplevel()->arrayClass->newArray(); + Stringp delim = core->string(delimAtom); + + int ilen = in->length(); + int dlen = delim->length(); + int count = 0; + int start = 0; + int w = 0; + + if (dlen <= 0) + { + // delim is empty string, split on each char + for (int i = 0; i < ilen && (unsigned)i < limit; i++) + { + Stringp sub = new (core->GetGC()) String(in, i, 1); + out->setUintProperty(count++, sub->atom()); + } + return out; + } + + const wchar *delimch = delim->c_str(); + wchar dlast = delimch[dlen-1]; + while (delimch[w] != dlast) + w++; + + //loop1: + unsigned numSeg = 0; + const wchar *inchar = in->c_str(); + for (int i = w; i < ilen; i++) + { + bool continue_loop1 = false; + wchar c = inchar[i]; + if (c == dlast) + { + int k = i-1, j; + for (j=dlen-2; j >= 0; j--, k--) { + if (inchar[k] != delimch[j]) { + continue_loop1 = true; + break; + } + } + if (!continue_loop1) { + numSeg++; + + // if we have found more segments than + // the limit we can stop looking + if( numSeg > limit ) + break; + + int sublen=k+1-start; + Stringp sub = new (core->GetGC()) String(in, start, sublen); + + out->setUintProperty(count++, sub->atom()); + + start = i+1; + i += w; + } + } + } + + // if numSeg is less than limit when we're done, add the rest of + // the string to the last element of the array + if( numSeg < limit ) + { + Stringp sub = new (core->GetGC()) String(in, start, ilen); + out->setUintProperty(count, sub->atom()); + } + return out; + } +} diff --git a/mozilla/js/tamarin/core/StringClass.h b/mozilla/js/tamarin/core/StringClass.h new file mode 100644 index 00000000000..f3d193c9817 --- /dev/null +++ b/mozilla/js/tamarin/core/StringClass.h @@ -0,0 +1,69 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_StringClass__ +#define __avmplus_StringClass__ + + +namespace avmplus +{ + /** + * class StringClass + */ + class StringClass : public ClassClosure + { + public: + StringClass(VTable* cvtable); + + // this = argv[0] + // arg1 = argv[1] + // argN = argv[argc] + Atom call(int argc, Atom* argv); + + // this = argv[0] (ignored) + // arg1 = argv[1] + // argN = argv[argc] + Atom construct(int argc, Atom* argv); + + // native methods. see String.as + ArrayObject *match(Stringp s, Atom pattern); + Stringp replace(Stringp in, Atom pattern, Atom replacementAtom); + int search(Stringp in, Atom regexpAtom); + ArrayObject* split(Stringp in, Atom delimAtom, uint32 limit); + + //cn: defined via NATIVE_METHODV to allow length = 1 and support calling with no args... ES3 spec says length = 1 + Stringp fromCharCode(Atom *argv, int argc); + + DECLARE_NATIVE_MAP(StringClass) + }; +} + +#endif /* __avmplus_StringClass__ */ diff --git a/mozilla/js/tamarin/core/StringObject.cpp b/mozilla/js/tamarin/core/StringObject.cpp new file mode 100644 index 00000000000..c8915d9afa8 --- /dev/null +++ b/mozilla/js/tamarin/core/StringObject.cpp @@ -0,0 +1,1211 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 1993-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmplus.h" + +namespace avmplus +{ + using namespace MMgc; + + int String::Length(const wchar *str) + { + int len = 0; + while (*str) { + len++; + str++; + } + return len; + } + + int String::Length(const char *str) + { + int len = 0; + while (*str) { + len++; + str++; + } + return len; + } + + // create empty string ready to be filled in + String::String(int len) + { + AvmAssert(len >= 0); + MMGC_MEM_TYPE(this); + setBuf(allocBuf(len)); + m_length = len; + } + + // decode utf8 + String::String(const char *str, int utf8len, int utf16len) + { + AvmAssert(utf8len >= 0); + AvmAssert(utf16len >= 0); + + MMGC_MEM_TYPE(this); + setBuf(allocBuf(utf16len)); + m_length = UnicodeUtils::Utf8ToUtf16((const uint8 *)str, utf8len, + getData(), utf16len); + AvmAssert(m_length >= 0); + getData()[m_length] = 0; +#ifdef DEBUGGER + + AvmCore *core = (AvmCore *) GC::GetGC(this)->GetGCContextVariable (MMgc::GC::GCV_AVMCORE); + if(core->allocationTracking) + { + AvmCore::chargeAllocation(atom()); + } +#endif + } + + // convert c-style wstring to String + String::String(const wchar *str, int len) + { + AvmAssert(len >= 0); + m_length = len; + MMGC_MEM_TYPE(this); + setBuf(allocBuf(m_length)); + memcpy (getData(), str, m_length * sizeof(wchar)); + getData()[m_length] = 0; +#ifdef DEBUGGER + AvmCore *core = (AvmCore *) GC::GetGC(this)->GetGCContextVariable (MMgc::GC::GCV_AVMCORE); + if(core->allocationTracking) + { + AvmCore::chargeAllocation(atom()); + } +#endif + } + + // concat + String::String(Stringp s1, Stringp s2) + { + m_length = s1->length() + s2->length(); + AvmAssert(m_length >= 0); + setPrefixOrOffsetOrNumber(int(s1) | PREFIXFLAG); + if (s2->needsNormalization()) s2->normalize(); + setBuf(s2->m_buf); +#ifdef DEBUGGER + AvmCore *core = (AvmCore *) GC::GetGC(this)->GetGCContextVariable (MMgc::GC::GCV_AVMCORE); + if(core->allocationTracking) + { + AvmCore::chargeAllocation(atom()); + } +#endif + } + + // substr + String::String(Stringp s, int pos, int len) + { + // out-of-bounds requests return sensible things + if (pos < 0) { + pos = 0; + } + if (len < 0) { + len = 0; + } + + int s_len = s->length(); + if (pos + len > s_len) { + len = s_len - pos; + } + if (pos > s_len) { + len = 0; + } + + AvmAssert(pos >= 0); + AvmAssert(len == 0 || pos + len <= s_len); + + #if 0 // old way + if (s->hasPrefix()) s->normalize(); + + m_length = len; + GC* gc = GC::GetGC(this); + MMGC_MEM_TYPE(this); + m_buf = (wchar *) gc->Alloc (sizeof(wchar)*(m_length+1), 0); + memcpy (m_buf, s->m_buf+pos, m_length * sizeof(wchar)); + m_buf[m_length] = 0; + m_prefixOrOffsetOrNumber = 0; + #endif + + if (s->hasOffset()) + { + m_length = len; + setBuf(s->m_buf); + m_prefixOrOffsetOrNumber = int(((s->getOffset() + pos) << 2) | OFFSETFLAG); + return; + } + else if (s->hasPrefix()) + { + Stringp news = s; + while (news->getPrefix() && pos < news->getPrefix()->length()) + news = news->getPrefix(); + + int newpos = pos; + int segmentLen = news->length(); + if (news->getPrefix()) + { + int prefixLen = news->getPrefix()->length(); + newpos -= prefixLen; + segmentLen -= prefixLen; + } + + // If our substring is completely contained within our prefix + // string, we can just use that string. Otherwise we need + // to normalize our string and generate an offset from the + // new string. + if ((newpos + len) <= segmentLen) + { + m_length = len; + setBuf(news->m_buf); + int offset = news->getOffset() + newpos; + m_prefixOrOffsetOrNumber = int((offset << 2) | OFFSETFLAG); + return; + } + + s->normalize(); + } + + m_length = len; + setBuf(s->m_buf); + m_prefixOrOffsetOrNumber = int((pos << 2) | OFFSETFLAG); +#ifdef DEBUGGER + AvmCore *core = (AvmCore *) GC::GetGC(this)->GetGCContextVariable (MMgc::GC::GCV_AVMCORE); + if(core->allocationTracking) + { + AvmCore::chargeAllocation(atom()); + } +#endif + } + + // compare (dst,len) to (src,len), including nulls + int String::Compare(const wchar *dst, int dstLen, const wchar *src, int srcLen) + { + int ret = 0; + int count = (dstLen < srcLen) ? dstLen : srcLen; // choose smaller of two + const wchar *dstend = dst + count; + + while(dst < dstend && 0 == (ret = (int)(*src - *dst))) + { + ++src, ++dst; + } + + // catch substring cases (e.g. '1' vs. '104') + if (ret == 0) + { + if (srcLen < dstLen) + ret = -1; + else if (srcLen > dstLen) + ret = 1; + else + ; // really equal + } + return ret; + } + + // compare (dst,len) to (src), src is null-terminated 8bit string + int String::Compare(const wchar *dst, const char *src, int len) + { + int ret = 0; + const wchar *dstend = dst + len; + + while(dst < dstend && *src && 0 == (ret = (int)(((wchar)*src) - *dst)) ) + { + ++src, ++dst; + } + + if (ret == 0) + { + // catch substring cases (e.g. '1' vs. '104') + if (dst < dstend) + { + // more chars in dst than src + AvmAssert(*src == 0); + ret = -1; + } + else if (*src) + { + // more chars in src than dst + AvmAssert(dst == dstend); + ret = 1; + } + else + { + // really equal + AvmAssert(dst == dstend); + AvmAssert(*src == 0); + } + } + + return ret; + } + + bool String::Contains(wchar c) + { + if (hasPrefix()) normalize(); + + const wchar *p = getData() + getOffset(); + + while (*p && (*p != c)) { + p++; + } + + return (*p == c); + } + + + // flatten a composite string + void String::normalize() + { + AvmAssert(needsNormalization() == true); + MMGC_MEM_TYPE(this); + StringBuf *newData = allocBuf(length()); + wchar *new_buf = newData->m_buf; + new_buf[length()] = 0; + + if (hasPrefix()) + { + // copy suffix strings right to left + Stringp p = this; + for (; p->getPrefix() != 0; p = p->getPrefix()) + { + memcpy(new_buf + p->getPrefix()->length(), p->getData(), sizeof(wchar)*(p->length()-p->getPrefix()->length())); + } + + memcpy(new_buf, p->getData() + p->getOffset(), sizeof(wchar) * p->length()); + setBuf(newData); + } + else + { + AvmAssert(hasOffset()); + memcpy(new_buf, getData() + getOffset(), sizeof(wchar) * length()); + setBuf(newData); + } + + // prefix is left for GC to dispose of + setPrefixOrOffsetOrNumber(0); + } + + // encode utf8 + UTF8String* String::toUTF8String() + { + if (hasPrefix()) normalize(); + int utf8len = UnicodeUtils::Utf16ToUtf8(getData() + getOffset(), length(), NULL, 0); + + if( utf8len < 0 ) + { + utf8len = 0; + } + + UTF8String* out = new (GC::GetGC(this), utf8len) UTF8String(utf8len); + + if (out) { + char *dst = out->lockBuffer(); + UnicodeUtils::Utf16ToUtf8(getData() + getOffset(), length(), (uint8*)dst, utf8len); + dst[utf8len] = 0; + out->unlockBuffer(); + } + return out; + } + + // + // uppercase/lowercase conversion + // + + const wchar String::lowerCaseBase[] = + { + 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, + 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, + 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x00B5, 0x00E0, 0x00E1, 0x00E2, + 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7, 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, + 0x00ED, 0x00EE, 0x00EF, 0x00F0, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, + 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x00FF, 0x0101, 0x0103, + 0x0105, 0x0107, 0x0109, 0x010B, 0x010D, 0x010F, 0x0111, 0x0113, 0x0115, 0x0117, + 0x0119, 0x011B, 0x011D, 0x011F, 0x0121, 0x0123, 0x0125, 0x0127, 0x0129, 0x012B, + 0x012D, 0x012F, 0x0131, 0x0133, 0x0135, 0x0137, 0x013A, 0x013C, 0x013E, 0x0140, + 0x0142, 0x0144, 0x0146, 0x0148, 0x014B, 0x014D, 0x014F, 0x0151, 0x0153, 0x0155, + 0x0157, 0x0159, 0x015B, 0x015D, 0x015F, 0x0161, 0x0163, 0x0165, 0x0167, 0x0169, + 0x016B, 0x016D, 0x016F, 0x0171, 0x0173, 0x0175, 0x0177, 0x017A, 0x017C, 0x017E, + 0x017F, 0x0183, 0x0185, 0x0188, 0x018C, 0x0192, 0x0195, 0x0199, 0x01A1, 0x01A3, + 0x01A5, 0x01A8, 0x01AD, 0x01B0, 0x01B4, 0x01B6, 0x01B9, 0x01BD, 0x01BF, 0x01C5, + 0x01C6, 0x01C8, 0x01C9, 0x01CB, 0x01CC, 0x01CE, 0x01D0, 0x01D2, 0x01D4, 0x01D6, + 0x01D8, 0x01DA, 0x01DC, 0x01DD, 0x01DF, 0x01E1, 0x01E3, 0x01E5, 0x01E7, 0x01E9, + 0x01EB, 0x01ED, 0x01EF, 0x01F2, 0x01F3, 0x01F5, 0x01F9, 0x01FB, 0x01FD, 0x01FF, + 0x0201, 0x0203, 0x0205, 0x0207, 0x0209, 0x020B, 0x020D, 0x020F, 0x0211, 0x0213, + 0x0215, 0x0217, 0x0219, 0x021B, 0x021D, 0x021F, 0x0223, 0x0225, 0x0227, 0x0229, + 0x022B, 0x022D, 0x022F, 0x0231, 0x0233, 0x0253, 0x0254, 0x0256, 0x0257, 0x0259, + 0x025B, 0x0260, 0x0263, 0x0268, 0x0269, 0x026F, 0x0272, 0x0275, 0x0280, 0x0283, + 0x0288, 0x028A, 0x028B, 0x0292, 0x0345, 0x03AC, 0x03AD, 0x03AE, 0x03AF, 0x03B1, + 0x03B2, 0x03B3, 0x03B4, 0x03B5, 0x03B6, 0x03B7, 0x03B8, 0x03B9, 0x03BA, 0x03BB, + 0x03BC, 0x03BD, 0x03BE, 0x03BF, 0x03C0, 0x03C1, 0x03C2, 0x03C3, 0x03C4, 0x03C5, + 0x03C6, 0x03C7, 0x03C8, 0x03C9, 0x03CA, 0x03CB, 0x03CC, 0x03CD, 0x03CE, 0x03D0, + 0x03D1, 0x03D5, 0x03D6, 0x03DB, 0x03DD, 0x03DF, 0x03E1, 0x03E3, 0x03E5, 0x03E7, + 0x03E9, 0x03EB, 0x03ED, 0x03EF, 0x03F0, 0x03F1, 0x03F2, 0x03F5, 0x0430, 0x0431, + 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, 0x0438, 0x0439, 0x043A, 0x043B, + 0x043C, 0x043D, 0x043E, 0x043F, 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, + 0x0446, 0x0447, 0x0448, 0x0449, 0x044A, 0x044B, 0x044C, 0x044D, 0x044E, 0x044F, + 0x0450, 0x0451, 0x0452, 0x0453, 0x0454, 0x0455, 0x0456, 0x0457, 0x0458, 0x0459, + 0x045A, 0x045B, 0x045C, 0x045D, 0x045E, 0x045F, 0x0461, 0x0463, 0x0465, 0x0467, + 0x0469, 0x046B, 0x046D, 0x046F, 0x0471, 0x0473, 0x0475, 0x0477, 0x0479, 0x047B, + 0x047D, 0x047F, 0x0481, 0x048D, 0x048F, 0x0491, 0x0493, 0x0495, 0x0497, 0x0499, + 0x049B, 0x049D, 0x049F, 0x04A1, 0x04A3, 0x04A5, 0x04A7, 0x04A9, 0x04AB, 0x04AD, + 0x04AF, 0x04B1, 0x04B3, 0x04B5, 0x04B7, 0x04B9, 0x04BB, 0x04BD, 0x04BF, 0x04C2, + 0x04C4, 0x04C8, 0x04CC, 0x04D1, 0x04D3, 0x04D5, 0x04D7, 0x04D9, 0x04DB, 0x04DD, + 0x04DF, 0x04E1, 0x04E3, 0x04E5, 0x04E7, 0x04E9, 0x04EB, 0x04ED, 0x04EF, 0x04F1, + 0x04F3, 0x04F5, 0x04F9, 0x0561, 0x0562, 0x0563, 0x0564, 0x0565, 0x0566, 0x0567, + 0x0568, 0x0569, 0x056A, 0x056B, 0x056C, 0x056D, 0x056E, 0x056F, 0x0570, 0x0571, + 0x0572, 0x0573, 0x0574, 0x0575, 0x0576, 0x0577, 0x0578, 0x0579, 0x057A, 0x057B, + 0x057C, 0x057D, 0x057E, 0x057F, 0x0580, 0x0581, 0x0582, 0x0583, 0x0584, 0x0585, + 0x0586, 0x1E01, 0x1E03, 0x1E05, 0x1E07, 0x1E09, 0x1E0B, 0x1E0D, 0x1E0F, 0x1E11, + 0x1E13, 0x1E15, 0x1E17, 0x1E19, 0x1E1B, 0x1E1D, 0x1E1F, 0x1E21, 0x1E23, 0x1E25, + 0x1E27, 0x1E29, 0x1E2B, 0x1E2D, 0x1E2F, 0x1E31, 0x1E33, 0x1E35, 0x1E37, 0x1E39, + 0x1E3B, 0x1E3D, 0x1E3F, 0x1E41, 0x1E43, 0x1E45, 0x1E47, 0x1E49, 0x1E4B, 0x1E4D, + 0x1E4F, 0x1E51, 0x1E53, 0x1E55, 0x1E57, 0x1E59, 0x1E5B, 0x1E5D, 0x1E5F, 0x1E61, + 0x1E63, 0x1E65, 0x1E67, 0x1E69, 0x1E6B, 0x1E6D, 0x1E6F, 0x1E71, 0x1E73, 0x1E75, + 0x1E77, 0x1E79, 0x1E7B, 0x1E7D, 0x1E7F, 0x1E81, 0x1E83, 0x1E85, 0x1E87, 0x1E89, + 0x1E8B, 0x1E8D, 0x1E8F, 0x1E91, 0x1E93, 0x1E95, 0x1E9B, 0x1EA1, 0x1EA3, 0x1EA5, + 0x1EA7, 0x1EA9, 0x1EAB, 0x1EAD, 0x1EAF, 0x1EB1, 0x1EB3, 0x1EB5, 0x1EB7, 0x1EB9, + 0x1EBB, 0x1EBD, 0x1EBF, 0x1EC1, 0x1EC3, 0x1EC5, 0x1EC7, 0x1EC9, 0x1ECB, 0x1ECD, + 0x1ECF, 0x1ED1, 0x1ED3, 0x1ED5, 0x1ED7, 0x1ED9, 0x1EDB, 0x1EDD, 0x1EDF, 0x1EE1, + 0x1EE3, 0x1EE5, 0x1EE7, 0x1EE9, 0x1EEB, 0x1EED, 0x1EEF, 0x1EF1, 0x1EF3, 0x1EF5, + 0x1EF7, 0x1EF9, 0x1F00, 0x1F01, 0x1F02, 0x1F03, 0x1F04, 0x1F05, 0x1F06, 0x1F07, + 0x1F10, 0x1F11, 0x1F12, 0x1F13, 0x1F14, 0x1F15, 0x1F20, 0x1F21, 0x1F22, 0x1F23, + 0x1F24, 0x1F25, 0x1F26, 0x1F27, 0x1F30, 0x1F31, 0x1F32, 0x1F33, 0x1F34, 0x1F35, + 0x1F36, 0x1F37, 0x1F40, 0x1F41, 0x1F42, 0x1F43, 0x1F44, 0x1F45, 0x1F51, 0x1F53, + 0x1F55, 0x1F57, 0x1F60, 0x1F61, 0x1F62, 0x1F63, 0x1F64, 0x1F65, 0x1F66, 0x1F67, + 0x1F70, 0x1F71, 0x1F72, 0x1F73, 0x1F74, 0x1F75, 0x1F76, 0x1F77, 0x1F78, 0x1F79, + 0x1F7A, 0x1F7B, 0x1F7C, 0x1F7D, 0x1F80, 0x1F81, 0x1F82, 0x1F83, 0x1F84, 0x1F85, + 0x1F86, 0x1F87, 0x1F90, 0x1F91, 0x1F92, 0x1F93, 0x1F94, 0x1F95, 0x1F96, 0x1F97, + 0x1FA0, 0x1FA1, 0x1FA2, 0x1FA3, 0x1FA4, 0x1FA5, 0x1FA6, 0x1FA7, 0x1FB0, 0x1FB1, + 0x1FB3, 0x1FBE, 0x1FC3, 0x1FD0, 0x1FD1, 0x1FE0, 0x1FE1, 0x1FE5, 0x1FF3, 0x2170, + 0x2171, 0x2172, 0x2173, 0x2174, 0x2175, 0x2176, 0x2177, 0x2178, 0x2179, 0x217A, + 0x217B, 0x217C, 0x217D, 0x217E, 0x217F, 0x24D0, 0x24D1, 0x24D2, 0x24D3, 0x24D4, + 0x24D5, 0x24D6, 0x24D7, 0x24D8, 0x24D9, 0x24DA, 0x24DB, 0x24DC, 0x24DD, 0x24DE, + 0x24DF, 0x24E0, 0x24E1, 0x24E2, 0x24E3, 0x24E4, 0x24E5, 0x24E6, 0x24E7, 0x24E8, + 0x24E9, 0xFF41, 0xFF42, 0xFF43, 0xFF44, 0xFF45, 0xFF46, 0xFF47, 0xFF48, 0xFF49, + 0xFF4A, 0xFF4B, 0xFF4C, 0xFF4D, 0xFF4E, 0xFF4F, 0xFF50, 0xFF51, 0xFF52, 0xFF53, + 0xFF54, 0xFF55, 0xFF56, 0xFF57, 0xFF58, 0xFF59, 0xFF5A + }; + + const wchar String::upperCaseConversion[] = + { + 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, + 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, + 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x039C, 0x00C0, 0x00C1, 0x00C2, + 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7, 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, + 0x00CD, 0x00CE, 0x00CF, 0x00D0, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, + 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x00DE, 0x0178, 0x0100, 0x0102, + 0x0104, 0x0106, 0x0108, 0x010A, 0x010C, 0x010E, 0x0110, 0x0112, 0x0114, 0x0116, + 0x0118, 0x011A, 0x011C, 0x011E, 0x0120, 0x0122, 0x0124, 0x0126, 0x0128, 0x012A, + 0x012C, 0x012E, 0x0049, 0x0132, 0x0134, 0x0136, 0x0139, 0x013B, 0x013D, 0x013F, + 0x0141, 0x0143, 0x0145, 0x0147, 0x014A, 0x014C, 0x014E, 0x0150, 0x0152, 0x0154, + 0x0156, 0x0158, 0x015A, 0x015C, 0x015E, 0x0160, 0x0162, 0x0164, 0x0166, 0x0168, + 0x016A, 0x016C, 0x016E, 0x0170, 0x0172, 0x0174, 0x0176, 0x0179, 0x017B, 0x017D, + 0x0053, 0x0182, 0x0184, 0x0187, 0x018B, 0x0191, 0x01F6, 0x0198, 0x01A0, 0x01A2, + 0x01A4, 0x01A7, 0x01AC, 0x01AF, 0x01B3, 0x01B5, 0x01B8, 0x01BC, 0x01F7, 0x01C4, + 0x01C4, 0x01C7, 0x01C7, 0x01CA, 0x01CA, 0x01CD, 0x01CF, 0x01D1, 0x01D3, 0x01D5, + 0x01D7, 0x01D9, 0x01DB, 0x018E, 0x01DE, 0x01E0, 0x01E2, 0x01E4, 0x01E6, 0x01E8, + 0x01EA, 0x01EC, 0x01EE, 0x01F1, 0x01F1, 0x01F4, 0x01F8, 0x01FA, 0x01FC, 0x01FE, + 0x0200, 0x0202, 0x0204, 0x0206, 0x0208, 0x020A, 0x020C, 0x020E, 0x0210, 0x0212, + 0x0214, 0x0216, 0x0218, 0x021A, 0x021C, 0x021E, 0x0222, 0x0224, 0x0226, 0x0228, + 0x022A, 0x022C, 0x022E, 0x0230, 0x0232, 0x0181, 0x0186, 0x0189, 0x018A, 0x018F, + 0x0190, 0x0193, 0x0194, 0x0197, 0x0196, 0x019C, 0x019D, 0x019F, 0x01A6, 0x01A9, + 0x01AE, 0x01B1, 0x01B2, 0x01B7, 0x0399, 0x0386, 0x0388, 0x0389, 0x038A, 0x0391, + 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397, 0x0398, 0x0399, 0x039A, 0x039B, + 0x039C, 0x039D, 0x039E, 0x039F, 0x03A0, 0x03A1, 0x03A3, 0x03A3, 0x03A4, 0x03A5, + 0x03A6, 0x03A7, 0x03A8, 0x03A9, 0x03AA, 0x03AB, 0x038C, 0x038E, 0x038F, 0x0392, + 0x0398, 0x03A6, 0x03A0, 0x03DA, 0x03DC, 0x03DE, 0x03E0, 0x03E2, 0x03E4, 0x03E6, + 0x03E8, 0x03EA, 0x03EC, 0x03EE, 0x039A, 0x03A1, 0x03A3, 0x0395, 0x0410, 0x0411, + 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417, 0x0418, 0x0419, 0x041A, 0x041B, + 0x041C, 0x041D, 0x041E, 0x041F, 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, + 0x0426, 0x0427, 0x0428, 0x0429, 0x042A, 0x042B, 0x042C, 0x042D, 0x042E, 0x042F, + 0x0400, 0x0401, 0x0402, 0x0403, 0x0404, 0x0405, 0x0406, 0x0407, 0x0408, 0x0409, + 0x040A, 0x040B, 0x040C, 0x040D, 0x040E, 0x040F, 0x0460, 0x0462, 0x0464, 0x0466, + 0x0468, 0x046A, 0x046C, 0x046E, 0x0470, 0x0472, 0x0474, 0x0476, 0x0478, 0x047A, + 0x047C, 0x047E, 0x0480, 0x048C, 0x048E, 0x0490, 0x0492, 0x0494, 0x0496, 0x0498, + 0x049A, 0x049C, 0x049E, 0x04A0, 0x04A2, 0x04A4, 0x04A6, 0x04A8, 0x04AA, 0x04AC, + 0x04AE, 0x04B0, 0x04B2, 0x04B4, 0x04B6, 0x04B8, 0x04BA, 0x04BC, 0x04BE, 0x04C1, + 0x04C3, 0x04C7, 0x04CB, 0x04D0, 0x04D2, 0x04D4, 0x04D6, 0x04D8, 0x04DA, 0x04DC, + 0x04DE, 0x04E0, 0x04E2, 0x04E4, 0x04E6, 0x04E8, 0x04EA, 0x04EC, 0x04EE, 0x04F0, + 0x04F2, 0x04F4, 0x04F8, 0x0531, 0x0532, 0x0533, 0x0534, 0x0535, 0x0536, 0x0537, + 0x0538, 0x0539, 0x053A, 0x053B, 0x053C, 0x053D, 0x053E, 0x053F, 0x0540, 0x0541, + 0x0542, 0x0543, 0x0544, 0x0545, 0x0546, 0x0547, 0x0548, 0x0549, 0x054A, 0x054B, + 0x054C, 0x054D, 0x054E, 0x054F, 0x0550, 0x0551, 0x0552, 0x0553, 0x0554, 0x0555, + 0x0556, 0x1E00, 0x1E02, 0x1E04, 0x1E06, 0x1E08, 0x1E0A, 0x1E0C, 0x1E0E, 0x1E10, + 0x1E12, 0x1E14, 0x1E16, 0x1E18, 0x1E1A, 0x1E1C, 0x1E1E, 0x1E20, 0x1E22, 0x1E24, + 0x1E26, 0x1E28, 0x1E2A, 0x1E2C, 0x1E2E, 0x1E30, 0x1E32, 0x1E34, 0x1E36, 0x1E38, + 0x1E3A, 0x1E3C, 0x1E3E, 0x1E40, 0x1E42, 0x1E44, 0x1E46, 0x1E48, 0x1E4A, 0x1E4C, + 0x1E4E, 0x1E50, 0x1E52, 0x1E54, 0x1E56, 0x1E58, 0x1E5A, 0x1E5C, 0x1E5E, 0x1E60, + 0x1E62, 0x1E64, 0x1E66, 0x1E68, 0x1E6A, 0x1E6C, 0x1E6E, 0x1E70, 0x1E72, 0x1E74, + 0x1E76, 0x1E78, 0x1E7A, 0x1E7C, 0x1E7E, 0x1E80, 0x1E82, 0x1E84, 0x1E86, 0x1E88, + 0x1E8A, 0x1E8C, 0x1E8E, 0x1E90, 0x1E92, 0x1E94, 0x1E60, 0x1EA0, 0x1EA2, 0x1EA4, + 0x1EA6, 0x1EA8, 0x1EAA, 0x1EAC, 0x1EAE, 0x1EB0, 0x1EB2, 0x1EB4, 0x1EB6, 0x1EB8, + 0x1EBA, 0x1EBC, 0x1EBE, 0x1EC0, 0x1EC2, 0x1EC4, 0x1EC6, 0x1EC8, 0x1ECA, 0x1ECC, + 0x1ECE, 0x1ED0, 0x1ED2, 0x1ED4, 0x1ED6, 0x1ED8, 0x1EDA, 0x1EDC, 0x1EDE, 0x1EE0, + 0x1EE2, 0x1EE4, 0x1EE6, 0x1EE8, 0x1EEA, 0x1EEC, 0x1EEE, 0x1EF0, 0x1EF2, 0x1EF4, + 0x1EF6, 0x1EF8, 0x1F08, 0x1F09, 0x1F0A, 0x1F0B, 0x1F0C, 0x1F0D, 0x1F0E, 0x1F0F, + 0x1F18, 0x1F19, 0x1F1A, 0x1F1B, 0x1F1C, 0x1F1D, 0x1F28, 0x1F29, 0x1F2A, 0x1F2B, + 0x1F2C, 0x1F2D, 0x1F2E, 0x1F2F, 0x1F38, 0x1F39, 0x1F3A, 0x1F3B, 0x1F3C, 0x1F3D, + 0x1F3E, 0x1F3F, 0x1F48, 0x1F49, 0x1F4A, 0x1F4B, 0x1F4C, 0x1F4D, 0x1F59, 0x1F5B, + 0x1F5D, 0x1F5F, 0x1F68, 0x1F69, 0x1F6A, 0x1F6B, 0x1F6C, 0x1F6D, 0x1F6E, 0x1F6F, + 0x1FBA, 0x1FBB, 0x1FC8, 0x1FC9, 0x1FCA, 0x1FCB, 0x1FDA, 0x1FDB, 0x1FF8, 0x1FF9, + 0x1FEA, 0x1FEB, 0x1FFA, 0x1FFB, 0x1F88, 0x1F89, 0x1F8A, 0x1F8B, 0x1F8C, 0x1F8D, + 0x1F8E, 0x1F8F, 0x1F98, 0x1F99, 0x1F9A, 0x1F9B, 0x1F9C, 0x1F9D, 0x1F9E, 0x1F9F, + 0x1FA8, 0x1FA9, 0x1FAA, 0x1FAB, 0x1FAC, 0x1FAD, 0x1FAE, 0x1FAF, 0x1FB8, 0x1FB9, + 0x1FBC, 0x0399, 0x1FCC, 0x1FD8, 0x1FD9, 0x1FE8, 0x1FE9, 0x1FEC, 0x1FFC, 0x2160, + 0x2161, 0x2162, 0x2163, 0x2164, 0x2165, 0x2166, 0x2167, 0x2168, 0x2169, 0x216A, + 0x216B, 0x216C, 0x216D, 0x216E, 0x216F, 0x24B6, 0x24B7, 0x24B8, 0x24B9, 0x24BA, + 0x24BB, 0x24BC, 0x24BD, 0x24BE, 0x24BF, 0x24C0, 0x24C1, 0x24C2, 0x24C3, 0x24C4, + 0x24C5, 0x24C6, 0x24C7, 0x24C8, 0x24C9, 0x24CA, 0x24CB, 0x24CC, 0x24CD, 0x24CE, + 0x24CF, 0xFF21, 0xFF22, 0xFF23, 0xFF24, 0xFF25, 0xFF26, 0xFF27, 0xFF28, 0xFF29, + 0xFF2A, 0xFF2B, 0xFF2C, 0xFF2D, 0xFF2E, 0xFF2F, 0xFF30, 0xFF31, 0xFF32, 0xFF33, + 0xFF34, 0xFF35, 0xFF36, 0xFF37, 0xFF38, 0xFF39, 0xFF3A + }; + + // WARNING: This is used by the core flash code. Any change to this utility, or the tables + // it relies on, will break legacy Flash content. + /*static*/ wchar String::wCharToUpper (wchar ch) + { + AvmAssert (sizeof (lowerCaseBase) == sizeof (upperCaseConversion)); + + wchar result = ch; + // Do a binary search in lowerCaseBase for wchar + int lo = 0; + int hi = (sizeof (lowerCaseBase) / sizeof (lowerCaseBase[0])) - 1; + + while (lo <= hi) + { + int pivot = (lo+hi)>>1; + int testChar = lowerCaseBase[pivot]; + + if (ch == testChar) + { + // Use that index into lowerCaseConversion for a return value + result = upperCaseConversion[pivot]; + break; + } + else if (ch < testChar) + { + hi = pivot-1; + } + else + { + lo = pivot+1; + } + } + + return result; + } + + // 12sep02 grandma : table driven inline function is 14x faster than original function, + // Using first 100 movies of ATS, HashKey alone calls CharToUpper() 360,000 times. + + const unsigned char String::tolower_map[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //0-15 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //16-31 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //32-47 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //48-64 + 0x00, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, //65-79 + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, //80-95 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //96-111 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //112-127 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //128-143 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //144-159 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //160-175 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //176-191 + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, //192-207 + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, //208-224 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //225-239 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 //240-255 + }; + + const unsigned char String::toupper_map[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //0-15 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //16-31 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //32-47 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //48-64 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //65-79 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //80-95 + 0x00, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, //96-111 + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, //112-127 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //128-143 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //144-159 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //160-175 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //176-191 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //192-207 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, //208-224 + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, //225-239 + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 //240-255 + }; + + const wchar String::upperCaseBase[] = { + 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, + 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, + 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x00C0, 0x00C1, 0x00C2, 0x00C3, + 0x00C4, 0x00C5, 0x00C6, 0x00C7, 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, + 0x00CE, 0x00CF, 0x00D0, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D8, + 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x00DE, 0x0100, 0x0102, 0x0104, 0x0106, + 0x0108, 0x010A, 0x010C, 0x010E, 0x0110, 0x0112, 0x0114, 0x0116, 0x0118, 0x011A, + 0x011C, 0x011E, 0x0120, 0x0122, 0x0124, 0x0126, 0x0128, 0x012A, 0x012C, 0x012E, + 0x0130, 0x0132, 0x0134, 0x0136, 0x0139, 0x013B, 0x013D, 0x013F, 0x0141, 0x0143, + 0x0145, 0x0147, 0x014A, 0x014C, 0x014E, 0x0150, 0x0152, 0x0154, 0x0156, 0x0158, + 0x015A, 0x015C, 0x015E, 0x0160, 0x0162, 0x0164, 0x0166, 0x0168, 0x016A, 0x016C, + 0x016E, 0x0170, 0x0172, 0x0174, 0x0176, 0x0178, 0x0179, 0x017B, 0x017D, 0x0181, + 0x0182, 0x0184, 0x0186, 0x0187, 0x0189, 0x018A, 0x018B, 0x018E, 0x018F, 0x0190, + 0x0191, 0x0193, 0x0194, 0x0196, 0x0197, 0x0198, 0x019C, 0x019D, 0x019F, 0x01A0, + 0x01A2, 0x01A4, 0x01A6, 0x01A7, 0x01A9, 0x01AC, 0x01AE, 0x01AF, 0x01B1, 0x01B2, + 0x01B3, 0x01B5, 0x01B7, 0x01B8, 0x01BC, 0x01C4, 0x01C5, 0x01C7, 0x01C8, 0x01CA, + 0x01CB, 0x01CD, 0x01CF, 0x01D1, 0x01D3, 0x01D5, 0x01D7, 0x01D9, 0x01DB, 0x01DE, + 0x01E0, 0x01E2, 0x01E4, 0x01E6, 0x01E8, 0x01EA, 0x01EC, 0x01EE, 0x01F1, 0x01F2, + 0x01F4, 0x01F6, 0x01F7, 0x01F8, 0x01FA, 0x01FC, 0x01FE, 0x0200, 0x0202, 0x0204, + 0x0206, 0x0208, 0x020A, 0x020C, 0x020E, 0x0210, 0x0212, 0x0214, 0x0216, 0x0218, + 0x021A, 0x021C, 0x021E, 0x0222, 0x0224, 0x0226, 0x0228, 0x022A, 0x022C, 0x022E, + 0x0230, 0x0232, 0x0386, 0x0388, 0x0389, 0x038A, 0x038C, 0x038E, 0x038F, 0x0391, + 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397, 0x0398, 0x0399, 0x039A, 0x039B, + 0x039C, 0x039D, 0x039E, 0x039F, 0x03A0, 0x03A1, 0x03A3, 0x03A4, 0x03A5, 0x03A6, + 0x03A7, 0x03A8, 0x03A9, 0x03AA, 0x03AB, 0x03DA, 0x03DC, 0x03DE, 0x03E0, 0x03E2, + 0x03E4, 0x03E6, 0x03E8, 0x03EA, 0x03EC, 0x03EE, 0x03F4, 0x0400, 0x0401, 0x0402, + 0x0403, 0x0404, 0x0405, 0x0406, 0x0407, 0x0408, 0x0409, 0x040A, 0x040B, 0x040C, + 0x040D, 0x040E, 0x040F, 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, + 0x0417, 0x0418, 0x0419, 0x041A, 0x041B, 0x041C, 0x041D, 0x041E, 0x041F, 0x0420, + 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427, 0x0428, 0x0429, 0x042A, + 0x042B, 0x042C, 0x042D, 0x042E, 0x042F, 0x0460, 0x0462, 0x0464, 0x0466, 0x0468, + 0x046A, 0x046C, 0x046E, 0x0470, 0x0472, 0x0474, 0x0476, 0x0478, 0x047A, 0x047C, + 0x047E, 0x0480, 0x048C, 0x048E, 0x0490, 0x0492, 0x0494, 0x0496, 0x0498, 0x049A, + 0x049C, 0x049E, 0x04A0, 0x04A2, 0x04A4, 0x04A6, 0x04A8, 0x04AA, 0x04AC, 0x04AE, + 0x04B0, 0x04B2, 0x04B4, 0x04B6, 0x04B8, 0x04BA, 0x04BC, 0x04BE, 0x04C1, 0x04C3, + 0x04C7, 0x04CB, 0x04D0, 0x04D2, 0x04D4, 0x04D6, 0x04D8, 0x04DA, 0x04DC, 0x04DE, + 0x04E0, 0x04E2, 0x04E4, 0x04E6, 0x04E8, 0x04EA, 0x04EC, 0x04EE, 0x04F0, 0x04F2, + 0x04F4, 0x04F8, 0x0531, 0x0532, 0x0533, 0x0534, 0x0535, 0x0536, 0x0537, 0x0538, + 0x0539, 0x053A, 0x053B, 0x053C, 0x053D, 0x053E, 0x053F, 0x0540, 0x0541, 0x0542, + 0x0543, 0x0544, 0x0545, 0x0546, 0x0547, 0x0548, 0x0549, 0x054A, 0x054B, 0x054C, + 0x054D, 0x054E, 0x054F, 0x0550, 0x0551, 0x0552, 0x0553, 0x0554, 0x0555, 0x0556, + // cn: added Georgian. Not in the UnicodeData-3.2.0 spreadsheet, but was added later + 0x10a0, 0x10a1, 0x10a2, 0x10a3, 0x10a4, 0x10a5, 0x10a6, 0x10a7, 0x10a8, 0x10a9, + 0x10aa, 0x10ab, 0x10ac, 0x10ad, 0x10ae, 0x10af, 0x10b0, 0x10b1, 0x10b2, 0x10b3, + 0x10b4, 0x10b5, 0x10b6, 0x10b7, 0x10b8, 0x10b9, 0x10ba, 0x10bb, 0x10bc, 0x10bd, + 0x10be, 0x10bf, 0x10c0, 0x10c1, 0x10c2, 0x10c3, 0x10c4, 0x10c5, + // cn: end Georgian. + 0x1E00, 0x1E02, 0x1E04, 0x1E06, 0x1E08, 0x1E0A, 0x1E0C, 0x1E0E, 0x1E10, 0x1E12, + 0x1E14, 0x1E16, 0x1E18, 0x1E1A, 0x1E1C, 0x1E1E, 0x1E20, 0x1E22, 0x1E24, 0x1E26, + 0x1E28, 0x1E2A, 0x1E2C, 0x1E2E, 0x1E30, 0x1E32, 0x1E34, 0x1E36, 0x1E38, 0x1E3A, + 0x1E3C, 0x1E3E, 0x1E40, 0x1E42, 0x1E44, 0x1E46, 0x1E48, 0x1E4A, 0x1E4C, 0x1E4E, + 0x1E50, 0x1E52, 0x1E54, 0x1E56, 0x1E58, 0x1E5A, 0x1E5C, 0x1E5E, 0x1E60, 0x1E62, + 0x1E64, 0x1E66, 0x1E68, 0x1E6A, 0x1E6C, 0x1E6E, 0x1E70, 0x1E72, 0x1E74, 0x1E76, + 0x1E78, 0x1E7A, 0x1E7C, 0x1E7E, 0x1E80, 0x1E82, 0x1E84, 0x1E86, 0x1E88, 0x1E8A, + 0x1E8C, 0x1E8E, 0x1E90, 0x1E92, 0x1E94, 0x1EA0, 0x1EA2, 0x1EA4, 0x1EA6, 0x1EA8, + 0x1EAA, 0x1EAC, 0x1EAE, 0x1EB0, 0x1EB2, 0x1EB4, 0x1EB6, 0x1EB8, 0x1EBA, 0x1EBC, + 0x1EBE, 0x1EC0, 0x1EC2, 0x1EC4, 0x1EC6, 0x1EC8, 0x1ECA, 0x1ECC, 0x1ECE, 0x1ED0, + 0x1ED2, 0x1ED4, 0x1ED6, 0x1ED8, 0x1EDA, 0x1EDC, 0x1EDE, 0x1EE0, 0x1EE2, 0x1EE4, + 0x1EE6, 0x1EE8, 0x1EEA, 0x1EEC, 0x1EEE, 0x1EF0, 0x1EF2, 0x1EF4, 0x1EF6, 0x1EF8, + 0x1F08, 0x1F09, 0x1F0A, 0x1F0B, 0x1F0C, 0x1F0D, 0x1F0E, 0x1F0F, 0x1F18, 0x1F19, + 0x1F1A, 0x1F1B, 0x1F1C, 0x1F1D, 0x1F28, 0x1F29, 0x1F2A, 0x1F2B, 0x1F2C, 0x1F2D, + 0x1F2E, 0x1F2F, 0x1F38, 0x1F39, 0x1F3A, 0x1F3B, 0x1F3C, 0x1F3D, 0x1F3E, 0x1F3F, + 0x1F48, 0x1F49, 0x1F4A, 0x1F4B, 0x1F4C, 0x1F4D, 0x1F59, 0x1F5B, 0x1F5D, 0x1F5F, + 0x1F68, 0x1F69, 0x1F6A, 0x1F6B, 0x1F6C, 0x1F6D, 0x1F6E, 0x1F6F, 0x1F88, 0x1F89, + 0x1F8A, 0x1F8B, 0x1F8C, 0x1F8D, 0x1F8E, 0x1F8F, 0x1F98, 0x1F99, 0x1F9A, 0x1F9B, + 0x1F9C, 0x1F9D, 0x1F9E, 0x1F9F, 0x1FA8, 0x1FA9, 0x1FAA, 0x1FAB, 0x1FAC, 0x1FAD, + 0x1FAE, 0x1FAF, 0x1FB8, 0x1FB9, 0x1FBA, 0x1FBB, 0x1FBC, 0x1FC8, 0x1FC9, 0x1FCA, + 0x1FCB, 0x1FCC, 0x1FD8, 0x1FD9, 0x1FDA, 0x1FDB, 0x1FE8, 0x1FE9, 0x1FEA, 0x1FEB, + 0x1FEC, 0x1FF8, 0x1FF9, 0x1FFA, 0x1FFB, 0x1FFC, 0x2126, 0x212A, 0x212B, 0x2160, + 0x2161, 0x2162, 0x2163, 0x2164, 0x2165, 0x2166, 0x2167, 0x2168, 0x2169, 0x216A, + 0x216B, 0x216C, 0x216D, 0x216E, 0x216F, 0x24B6, 0x24B7, 0x24B8, 0x24B9, 0x24BA, + 0x24BB, 0x24BC, 0x24BD, 0x24BE, 0x24BF, 0x24C0, 0x24C1, 0x24C2, 0x24C3, 0x24C4, + 0x24C5, 0x24C6, 0x24C7, 0x24C8, 0x24C9, 0x24CA, 0x24CB, 0x24CC, 0x24CD, 0x24CE, + 0x24CF, 0xFF21, 0xFF22, 0xFF23, 0xFF24, 0xFF25, 0xFF26, 0xFF27, 0xFF28, 0xFF29, + 0xFF2A, 0xFF2B, 0xFF2C, 0xFF2D, 0xFF2E, 0xFF2F, 0xFF30, 0xFF31, 0xFF32, 0xFF33, + 0xFF34, 0xFF35, 0xFF36, 0xFF37, 0xFF38, 0xFF39, 0xFF3A + }; + + const wchar String::lowerCaseConversion[] = { + 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, + 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, + 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x00E0, 0x00E1, 0x00E2, 0x00E3, + 0x00E4, 0x00E5, 0x00E6, 0x00E7, 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, + 0x00EE, 0x00EF, 0x00F0, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F8, + 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x0101, 0x0103, 0x0105, 0x0107, + 0x0109, 0x010B, 0x010D, 0x010F, 0x0111, 0x0113, 0x0115, 0x0117, 0x0119, 0x011B, + 0x011D, 0x011F, 0x0121, 0x0123, 0x0125, 0x0127, 0x0129, 0x012B, 0x012D, 0x012F, + 0x0069, 0x0133, 0x0135, 0x0137, 0x013A, 0x013C, 0x013E, 0x0140, 0x0142, 0x0144, + 0x0146, 0x0148, 0x014B, 0x014D, 0x014F, 0x0151, 0x0153, 0x0155, 0x0157, 0x0159, + 0x015B, 0x015D, 0x015F, 0x0161, 0x0163, 0x0165, 0x0167, 0x0169, 0x016B, 0x016D, + 0x016F, 0x0171, 0x0173, 0x0175, 0x0177, 0x00FF, 0x017A, 0x017C, 0x017E, 0x0253, + 0x0183, 0x0185, 0x0254, 0x0188, 0x0256, 0x0257, 0x018C, 0x01DD, 0x0259, 0x025B, + 0x0192, 0x0260, 0x0263, 0x0269, 0x0268, 0x0199, 0x026F, 0x0272, 0x0275, 0x01A1, + 0x01A3, 0x01A5, 0x0280, 0x01A8, 0x0283, 0x01AD, 0x0288, 0x01B0, 0x028A, 0x028B, + 0x01B4, 0x01B6, 0x0292, 0x01B9, 0x01BD, 0x01C6, 0x01C6, 0x01C9, 0x01C9, 0x01CC, + 0x01CC, 0x01CE, 0x01D0, 0x01D2, 0x01D4, 0x01D6, 0x01D8, 0x01DA, 0x01DC, 0x01DF, + 0x01E1, 0x01E3, 0x01E5, 0x01E7, 0x01E9, 0x01EB, 0x01ED, 0x01EF, 0x01F3, 0x01F3, + 0x01F5, 0x0195, 0x01BF, 0x01F9, 0x01FB, 0x01FD, 0x01FF, 0x0201, 0x0203, 0x0205, + 0x0207, 0x0209, 0x020B, 0x020D, 0x020F, 0x0211, 0x0213, 0x0215, 0x0217, 0x0219, + 0x021B, 0x021D, 0x021F, 0x0223, 0x0225, 0x0227, 0x0229, 0x022B, 0x022D, 0x022F, + 0x0231, 0x0233, 0x03AC, 0x03AD, 0x03AE, 0x03AF, 0x03CC, 0x03CD, 0x03CE, 0x03B1, + 0x03B2, 0x03B3, 0x03B4, 0x03B5, 0x03B6, 0x03B7, 0x03B8, 0x03B9, 0x03BA, 0x03BB, + 0x03BC, 0x03BD, 0x03BE, 0x03BF, 0x03C0, 0x03C1, 0x03C3, 0x03C4, 0x03C5, 0x03C6, + 0x03C7, 0x03C8, 0x03C9, 0x03CA, 0x03CB, 0x03DB, 0x03DD, 0x03DF, 0x03E1, 0x03E3, + 0x03E5, 0x03E7, 0x03E9, 0x03EB, 0x03ED, 0x03EF, 0x03B8, 0x0450, 0x0451, 0x0452, + 0x0453, 0x0454, 0x0455, 0x0456, 0x0457, 0x0458, 0x0459, 0x045A, 0x045B, 0x045C, + 0x045D, 0x045E, 0x045F, 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, + 0x0437, 0x0438, 0x0439, 0x043A, 0x043B, 0x043C, 0x043D, 0x043E, 0x043F, 0x0440, + 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, 0x0448, 0x0449, 0x044A, + 0x044B, 0x044C, 0x044D, 0x044E, 0x044F, 0x0461, 0x0463, 0x0465, 0x0467, 0x0469, + 0x046B, 0x046D, 0x046F, 0x0471, 0x0473, 0x0475, 0x0477, 0x0479, 0x047B, 0x047D, + 0x047F, 0x0481, 0x048D, 0x048F, 0x0491, 0x0493, 0x0495, 0x0497, 0x0499, 0x049B, + 0x049D, 0x049F, 0x04A1, 0x04A3, 0x04A5, 0x04A7, 0x04A9, 0x04AB, 0x04AD, 0x04AF, + 0x04B1, 0x04B3, 0x04B5, 0x04B7, 0x04B9, 0x04BB, 0x04BD, 0x04BF, 0x04C2, 0x04C4, + 0x04C8, 0x04CC, 0x04D1, 0x04D3, 0x04D5, 0x04D7, 0x04D9, 0x04DB, 0x04DD, 0x04DF, + 0x04E1, 0x04E3, 0x04E5, 0x04E7, 0x04E9, 0x04EB, 0x04ED, 0x04EF, 0x04F1, 0x04F3, + 0x04F5, 0x04F9, 0x0561, 0x0562, 0x0563, 0x0564, 0x0565, 0x0566, 0x0567, 0x0568, + 0x0569, 0x056A, 0x056B, 0x056C, 0x056D, 0x056E, 0x056F, 0x0570, 0x0571, 0x0572, + 0x0573, 0x0574, 0x0575, 0x0576, 0x0577, 0x0578, 0x0579, 0x057A, 0x057B, 0x057C, + 0x057D, 0x057E, 0x057F, 0x0580, 0x0581, 0x0582, 0x0583, 0x0584, 0x0585, 0x0586, + // cn: added Georgian. Not in the UnicodeData-3.2.0 spreadsheet, but was added later + 0x10d0, 0x10d1, 0x10d2, 0x10d3, 0x10d4, 0x10d5, 0x10d6, 0x10d7, 0x10d8, 0x10d9, + 0x10da, 0x10db, 0x10dc, 0x10dd, 0x10de, 0x10df, 0x10e0, 0x10e1, 0x10e2, 0x10e3, + 0x10e4, 0x10e5, 0x10e6, 0x10e7, 0x10e8, 0x10e9, 0x10ea, 0x10eb, 0x10ec, 0x10ed, + 0x10ee, 0x10ef, 0x10f0, 0x10f1, 0x10f2, 0x10f3, 0x10f4, 0x10f5, + // cn: end Georgian. + 0x1E01, 0x1E03, 0x1E05, 0x1E07, 0x1E09, 0x1E0B, 0x1E0D, 0x1E0F, 0x1E11, 0x1E13, + 0x1E15, 0x1E17, 0x1E19, 0x1E1B, 0x1E1D, 0x1E1F, 0x1E21, 0x1E23, 0x1E25, 0x1E27, + 0x1E29, 0x1E2B, 0x1E2D, 0x1E2F, 0x1E31, 0x1E33, 0x1E35, 0x1E37, 0x1E39, 0x1E3B, + 0x1E3D, 0x1E3F, 0x1E41, 0x1E43, 0x1E45, 0x1E47, 0x1E49, 0x1E4B, 0x1E4D, 0x1E4F, + 0x1E51, 0x1E53, 0x1E55, 0x1E57, 0x1E59, 0x1E5B, 0x1E5D, 0x1E5F, 0x1E61, 0x1E63, + 0x1E65, 0x1E67, 0x1E69, 0x1E6B, 0x1E6D, 0x1E6F, 0x1E71, 0x1E73, 0x1E75, 0x1E77, + 0x1E79, 0x1E7B, 0x1E7D, 0x1E7F, 0x1E81, 0x1E83, 0x1E85, 0x1E87, 0x1E89, 0x1E8B, + 0x1E8D, 0x1E8F, 0x1E91, 0x1E93, 0x1E95, 0x1EA1, 0x1EA3, 0x1EA5, 0x1EA7, 0x1EA9, + 0x1EAB, 0x1EAD, 0x1EAF, 0x1EB1, 0x1EB3, 0x1EB5, 0x1EB7, 0x1EB9, 0x1EBB, 0x1EBD, + 0x1EBF, 0x1EC1, 0x1EC3, 0x1EC5, 0x1EC7, 0x1EC9, 0x1ECB, 0x1ECD, 0x1ECF, 0x1ED1, + 0x1ED3, 0x1ED5, 0x1ED7, 0x1ED9, 0x1EDB, 0x1EDD, 0x1EDF, 0x1EE1, 0x1EE3, 0x1EE5, + 0x1EE7, 0x1EE9, 0x1EEB, 0x1EED, 0x1EEF, 0x1EF1, 0x1EF3, 0x1EF5, 0x1EF7, 0x1EF9, + 0x1F00, 0x1F01, 0x1F02, 0x1F03, 0x1F04, 0x1F05, 0x1F06, 0x1F07, 0x1F10, 0x1F11, + 0x1F12, 0x1F13, 0x1F14, 0x1F15, 0x1F20, 0x1F21, 0x1F22, 0x1F23, 0x1F24, 0x1F25, + 0x1F26, 0x1F27, 0x1F30, 0x1F31, 0x1F32, 0x1F33, 0x1F34, 0x1F35, 0x1F36, 0x1F37, + 0x1F40, 0x1F41, 0x1F42, 0x1F43, 0x1F44, 0x1F45, 0x1F51, 0x1F53, 0x1F55, 0x1F57, + 0x1F60, 0x1F61, 0x1F62, 0x1F63, 0x1F64, 0x1F65, 0x1F66, 0x1F67, 0x1F80, 0x1F81, + 0x1F82, 0x1F83, 0x1F84, 0x1F85, 0x1F86, 0x1F87, 0x1F90, 0x1F91, 0x1F92, 0x1F93, + 0x1F94, 0x1F95, 0x1F96, 0x1F97, 0x1FA0, 0x1FA1, 0x1FA2, 0x1FA3, 0x1FA4, 0x1FA5, + 0x1FA6, 0x1FA7, 0x1FB0, 0x1FB1, 0x1F70, 0x1F71, 0x1FB3, 0x1F72, 0x1F73, 0x1F74, + 0x1F75, 0x1FC3, 0x1FD0, 0x1FD1, 0x1F76, 0x1F77, 0x1FE0, 0x1FE1, 0x1F7A, 0x1F7B, + 0x1FE5, 0x1F78, 0x1F79, 0x1F7C, 0x1F7D, 0x1FF3, 0x03C9, 0x006B, 0x00E5, 0x2170, + 0x2171, 0x2172, 0x2173, 0x2174, 0x2175, 0x2176, 0x2177, 0x2178, 0x2179, 0x217A, + 0x217B, 0x217C, 0x217D, 0x217E, 0x217F, 0x24D0, 0x24D1, 0x24D2, 0x24D3, 0x24D4, + 0x24D5, 0x24D6, 0x24D7, 0x24D8, 0x24D9, 0x24DA, 0x24DB, 0x24DC, 0x24DD, 0x24DE, + 0x24DF, 0x24E0, 0x24E1, 0x24E2, 0x24E3, 0x24E4, 0x24E5, 0x24E6, 0x24E7, 0x24E8, + 0x24E9, 0xFF41, 0xFF42, 0xFF43, 0xFF44, 0xFF45, 0xFF46, 0xFF47, 0xFF48, 0xFF49, + 0xFF4A, 0xFF4B, 0xFF4C, 0xFF4D, 0xFF4E, 0xFF4F, 0xFF50, 0xFF51, 0xFF52, 0xFF53, + 0xFF54, 0xFF55, 0xFF56, 0xFF57, 0xFF58, 0xFF59, 0xFF5A + }; + + // WARNING: This is used by the core flash code. Any change to this utility, or the tables + // it relies on, will break legacy Flash content. + /*static*/ wchar String::wCharToLower(wchar ch) + { + AvmAssert (sizeof (upperCaseBase) == sizeof (lowerCaseConversion)); + + wchar result = ch; + // Do a binary search in upperCaseBase for wchar + int lo = 0; + int hi = (sizeof (upperCaseBase) / sizeof (upperCaseBase[0])) - 1; + + while (lo <= hi) + { + int pivot = (lo+hi)>>1; + int testChar = upperCaseBase[pivot]; + + if (ch == testChar) + { + // Use that index into lowerCaseConversion for a return value + result = lowerCaseConversion[pivot]; + break; + } + else if (ch < testChar) + { + hi = pivot-1; + } + else + { + lo = pivot+1; + } + } + + return result; + } + + Stringp String::toUpperCase() + { + GC* gc = GC::GetGC(this); + int len = length(); + Stringp out = new (gc) String(len); + + // Flag to detect whether any changes were made + bool changed = false; + + // First, try quick conversion for low ASCII characters. + wchar *dst = out->lockBuffer(); + const wchar *src = c_str(); + const wchar *end = src + len; + wchar charIn, charOut; + while (src < end) + { + charIn = *src; + if (charIn >= 0xFF) + break; + + charOut = String::toupper_map[charIn] ^ charIn; + if (charOut != charIn) + changed = true; + + *dst++ = charOut; + src++; + } + + // If that didn't work, resume from where we left off + // with slow full Unicode conversion. + while (src < end) + { + charIn = *src; + charOut = wCharToUpper(charIn); + if (charOut != charIn) + changed = true; + + *dst++ = charOut; + src++; + } + + *dst = 0; + out->unlockBuffer(); + + // Return new string. If nothing changed, return old + // string (the new string will be GC'd) + return changed ? out : this; + } + + Stringp String::toLowerCase() + { + GC* gc = GC::GetGC(this); + int len = length(); + Stringp out = new (gc) String(len); + + // Flag to detect whether any changes were made + bool changed = false; + + // First, try quick conversion for low ASCII characters. + wchar *dst = out->lockBuffer(); + const wchar *src = c_str(); + const wchar *end = src + len; + wchar charIn, charOut; + while (src < end) + { + charIn = *src; + if (charIn >= 0xFF) + break; + + charOut = String::tolower_map[charIn] ^ charIn; + if (charOut != charIn) + changed = true; + + *dst++ = charOut; + src++; + } + + // If that didn't work, resume from where we left off + // with slow full Unicode conversion. + while (src < end) + { + charIn = *src; + charOut = wCharToLower(charIn); + if (charOut != charIn) + changed = true; + + *dst++ = charOut; + src++; + } + + *dst = 0; + out->unlockBuffer(); + + // Return new string. If nothing changed, return old + // string (the new string will be GC'd) + return changed ? out : this; + } + + int String::indexOf(Stringp substr, int iStartPos) + { + if(!substr) + return -1; + + int sublen = substr->length(); + if (iStartPos > this->length()) + iStartPos = this->length(); + + // iRight is the last character in selfString subStr could be found at + // (and further, and there isn't enough of selfString remaining for a match to be possible) + const int iRight = this->length() - sublen; + + // bug 78346: argv[1] might be less than zero. + // We clamp it to zero for two reasons: + // 1. A movie created prior to this fix with a small negative value probably worked, + // so let's fix it without breaking them. + // 2. I am told this is what java does. + // + // if (argv[1] > iRight), then we never enter the loop + if (iStartPos < 0) { + iStartPos = 0; + } + + // our substr to find is only one character + if (sublen == 1) + { + const wchar substrchar = substr->c_str()[0]; + const wchar *selfstr = this->c_str(); + for ( ; iStartPos <= iRight; iStartPos++) + { + if (substrchar == selfstr[iStartPos]) + { + return iStartPos; + } + } + } + else + { + const wchar *substrstr = substr->c_str(); + const wchar *selfstr = this->c_str(); + selfstr += iStartPos; + for ( ; iStartPos <= iRight; iStartPos++) + { + int j; + for (j = 0; j < sublen; j++) + { + if (substrstr[j] != selfstr[j]) + { + break; + } + } + + if (j == sublen) + { + return iStartPos; + } + selfstr++; + } + } + + return -1; + } + + int String::indexOfDouble(Stringp substr, double dStartPos) + { + dStartPos = MathUtils::toInt(dStartPos); + int iStartPos = (dStartPos > (double)this->length() ? this->length() : (int)dStartPos); + return indexOf (substr, iStartPos); + } + + Stringp String::charAt(int iPos) + { + GC *gc = GC::GetGC(this); + AvmCore *core = (AvmCore *) gc->GetGCContextVariable (MMgc::GC::GCV_AVMCORE); + if (iPos >= 0 && iPos < length()) + { + wchar ch = !this->needsNormalization() ? getData()[iPos] : ((*this)[iPos]); + if (ch < 128) + { + return core->cachedChars[ch]; + } + else + { + return new (gc) String(this, iPos, 1); + } + } + else + { + return core->kEmptyString; + } + } + + Stringp String::charAtDouble(double dPos) + { + dPos = MathUtils::toInt(dPos); + int iPos = (dPos > (double)this->length()) ? this->length() : (int)dPos; + return charAt (iPos); + } + + double String::charCodeAt(int iPos) + { + if (iPos >= 0 && iPos < length()) + return (*this)[iPos]; + else + return MathUtils::nan(); + } + + double String::charCodeAtDouble(double dPos) + { + dPos = MathUtils::toInt(dPos); + int iPos = (dPos > (double)this->length()) ? this->length() : (int)dPos; + return charCodeAt (iPos); + } + + wchar String::operator[] (int index) + { + AvmAssert(index >=0 && index < length()); + if (!hasPrefix()) + { + return getData()[index + getOffset()]; + } + else + { + AvmAssert (hasPrefix()); + normalize(); + return getData()[index]; + +#if 0 // This is the code if we want to skip the normalizations + // if this is a composite string, find the prefix containing iPos + Stringp s = this; + while (s->getPrefix() && index < s->getPrefix()->length()) + s = s->getPrefix(); + + if (s->getPrefix()) + index -= s->getPrefix()->length(); + return s->getData()[s->getOffset() + index]; +#endif + } + } + + bool String::isWhitespace() + { + Stringp s = this; + do + { + int base = !s->getPrefix() ? 0 : s->getPrefix()->length(); + for (int i = s->length()-base-1; i >= 0; i--) + if (!isSpace(s->getData()[s->getOffset() + i])) + return false; + } + while ( (s = s->getPrefix()) != 0); + return true; + } + + int String::lastIndexOf(Stringp substr, int iStartPos) + { + int sublen = substr->length(); + iStartPos = (iStartPos > this->length()) ? this->length() : iStartPos; + + // iRight is the last character in selfString subStr could be found at + // (and further, and there isn't enough of selfString remaining for a match to be possible) + const int iRight = this->length() - sublen; + + // bug 78346: argv[1] might be greater than iRight + // (similar reasons to above apply). + if (iStartPos > iRight) { + iStartPos = iRight; + } + const wchar *substrstr = substr->c_str(); + const wchar *selfstr = this->c_str() + iStartPos; + for ( ; iStartPos >= 0 ; iStartPos-- ) + { + int j; + for (j = 0; j < sublen; j++) + { + if (substrstr[j] != selfstr[j]) + { + break; + } + } + + if (j == sublen) + { + return iStartPos; + } + selfstr--; + } + + return -1; + } + + int String::lastIndexOfDouble(Stringp substr, double dStartPos) + { + if (!MathUtils::isNaN(dStartPos)) + dStartPos = MathUtils::toInt(dStartPos); + else + dStartPos = this->length(); + int iStartPos = (dStartPos > this->length() ? this->length() : (int)dStartPos); + return lastIndexOf (substr, iStartPos); + } + + int String::localeCompare(Stringp other, Atom* /*argv*/, int /*argc*/) + { + if ( !other ) + { + GC *gc = GC::GetGC(this); + AvmCore *core = (AvmCore *) gc->GetGCContextVariable (MMgc::GC::GCV_AVMCORE); + other = core->knull; + } + + return other->Compare(*this); + } + + void String::generateIntegerEquivalent (AvmCore* core) + { + AvmAssert(this->isInterned()); + AvmAssert(!this->hasOffset()); + AvmAssert(!this->hasPrefix()); + uint32 index; + (void)core; + if (core->getIndexFromString (this, &index)) + { + if (!(index & ScriptObject::MAX_INTEGER_MASK)) + { + m_prefixOrOffsetOrNumber = index<<3 | NUMBERFLAG; + } + } + } + + String::StringBuf *String::allocBuf(int numChars) + { + GC* gc = GC::GetGC(this); + return new (gc, sizeof(wchar)*(numChars+1)) StringBuf(); + } + + Stringp String::substring(int start, int end) + { + GC *gc = GC::GetGC(this); + NativeObjectHelpers::ClampBInt(start, end, this->length()); + return new (gc) String(this, start, (end-start)); + } + + Stringp String::substringDouble(double d_start, double d_end) + { + GC *gc = GC::GetGC(this); + double start = MathUtils::toInt(d_start); + double end = MathUtils::toInt(d_end); + NativeObjectHelpers::ClampB(start, end, length()); + return new (gc) String(this, (int)start, (int)(end-start)); + } + + Stringp String::slice(int start, int end) + { + GC *gc = GC::GetGC(this); + int len = this->length(); + start = (int)NativeObjectHelpers::ClampIndexInt(start, len); + end = (int)NativeObjectHelpers::ClampIndexInt(end, len); + if (end < start) + end = start; + + return new (gc) String(this, start, end-start); + } + + Stringp String::sliceDouble(double d_start, double d_end) + { + GC *gc = GC::GetGC(this); + int len = this->length(); + int start = (int)NativeObjectHelpers::ClampIndex(MathUtils::toInt(d_start), len); + int end = (int)NativeObjectHelpers::ClampIndex(MathUtils::toInt(d_end), len); + if (end < start) + end = start; + + return new (gc) String(this, start, end-start); + } + + Stringp String::substr(int start, int end) + { + GC *gc = GC::GetGC(this); + int len = this->length(); + start = (int)NativeObjectHelpers::ClampIndexInt(start, len); + // ClampIndex takes a double (not int or uint) for first parm... + // we must cast these to double before addition, otherwise we + // can have numeric overflow with the default arg (end=0x7fffffff) + // and wrap to negative, which would be bad... + + // Do some sanity checks on our ints to see if they will fall within a valid integer range + // !!@what about negative values? + if (end == 0x7ffffff) + { + end = len; + } + else if ((end > 0xffffff) || (start > 0xffffff)) // might overflow - use doubles + { + end = (int)NativeObjectHelpers::ClampIndex(double(end) + double(start), len); + } + else + { + end = (int)NativeObjectHelpers::ClampIndexInt(end + start, len); + } + + if (end < start) + end = start; + + return new (gc) String(this, start, end-start); + } + + Stringp String::substrDouble(double d_start, double d_end) + { + GC *gc = GC::GetGC(this); + int len = this->length(); + int start = (int)NativeObjectHelpers::ClampIndex(MathUtils::toInt(d_start), len); + // ClampIndex takes a double (not int or uint) for first parm... + // we must cast these to double before addition, otherwise we + // can have numeric overflow with the default arg (end=0x7fffffff) + // and wrap to negative, which would be bad... + int end = (int)NativeObjectHelpers::ClampIndex(MathUtils::toInt(d_end) + (double)start, len); + if (end < start) + end = start; + + return new (gc) String(this, start, end-start); + } + + void String::setPrefixOrOffsetOrNumber(int value) + { +#ifdef MMGC_DRC + // first decrement existing prefix + if((m_prefixOrOffsetOrNumber & STRINGFLAGS) == PREFIXFLAG) + getPrefix()->DecrementRef(); +#endif + GC::GetGC(this)->WriteBarrierNoSubstitute(this, (void*)value); + m_prefixOrOffsetOrNumber = value; +#ifdef MMGC_DRC + if((value & STRINGFLAGS) == PREFIXFLAG) + getPrefix()->IncrementRef(); +#endif + } + +#ifdef DEBUGGER + uint32 String::size() const + { + uint32 bufSize = sizeof(StringBuf) + length() * sizeof(wchar); + uint32 size = sizeof(String) - sizeof(AvmPlusScriptableObject) + bufSize / m_buf->RefCount(); + if(getPrefix()) + { + // - sizeof(String) so we don't recursively count it + size += (getPrefix()->size() - sizeof(String)); + } + return size; + } +#endif +} diff --git a/mozilla/js/tamarin/core/StringObject.h b/mozilla/js/tamarin/core/StringObject.h new file mode 100644 index 00000000000..0469ea42b4c --- /dev/null +++ b/mozilla/js/tamarin/core/StringObject.h @@ -0,0 +1,463 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_String__ +#define __avmplus_String__ + + +namespace avmplus +{ + /** + * A string in UTF-8 encoding. + * + * UTF8String's are immutable and garbage collected, which makes + * it easy to pass them around. + */ + class UTF8String : public MMgc::GCObject + { + public: + /** + * Constructs a UTF8String. This should not be called + * directly; use the toUTF8String method of String. + */ + UTF8String(int length) { m_length = length; } + + /** + * Operator overload; returns a pointer to the + * null-terminated string. + */ + operator const char* () const { return m_buffer; } + + /** + * Returns a pointer to the null-terminated string. + */ + const char *c_str() const { return m_buffer; } + + /** + * Returns the length of the string in bytes, + * excluding the null terminator. + */ + int length() const { return m_length; } + + /** + * This is an advanced method which returns a non-const + * pointer to the UTF8String's internal buffer. This + * can be used to mutate a string that is known to not + * have any other references. Use with caution. + */ + char *lockBuffer() { return m_buffer; } + + /** + * Unlocks the buffer previously returned by lockBuffer. + * Currently a no-op, but may change in the future, + * so call after using lockBuffer. + */ + void unlockBuffer() {} + + private: + int m_length; + char m_buffer[1]; + }; + + /** + * A string in UTF-16 encoding. This is the basic string + * class used by AVM+ code. + */ + class String : public AvmPlusScriptableObject + { + public: + String(const wchar *str, int len); // wchar[] -> string + String(const char *str, int utf8len, int utf16len); // utf8->string + String(Stringp s1, Stringp s0); // concat + String(Stringp s, int pos, int len);// substr + String(int len); // preallocated empty + + ~String() + { +#ifdef MMGC_DRC + setBuf(NULL); + setPrefixOrOffsetOrNumber(0); + m_length = 0; +#endif + } + + /** + * Converts this string to a UTF-8 string. Allocates + * a new UTF8 string object containing the result, + * and returns it. + */ + UTF8String* toUTF8String(); + + /** + * Returns the Atom equivalent of this String. This is + * done by or'ing the proper type bits into the pointer. + */ + Atom atom() const { return AtomConstants::kStringType | (Atom)this; } + + /** + * virtual version of atom(): + */ + virtual Atom toAtom() const { return atom(); } + + /** + * Returns the length of the string in characters. + * The null terminator is not included. + */ + int length() const { + return m_length & 0x7FFFFFFF; + } + + /** + * Operator overload; returns a pointer to the + * null-terminated string. + */ + operator const wchar* () + { + // For offset too since our string needs to be null terminated + if (needsNormalization()) normalize(); + return getData(); + } + + /** + * Returns a pointer to the null-terminated string. + */ + const wchar* c_str() + { + // For offset too since our string needs to be null terminated + if (needsNormalization()) normalize(); + return getData(); + } + + /** + * Returns the index'th character of the string. + * @param index zero-based index into the string + */ + wchar operator[] (int index); + + /** + * This is an advanced method which returns a non-const + * pointer to the String's internal buffer. This + * can be used to mutate a string that is known to not + * have any other references. Use with caution. + */ + wchar* lockBuffer() + { + // For offset too since our string needs to be null terminated + if (needsNormalization()) normalize(); + return (wchar*) getData(); + } + + /** + * Unlocks the buffer previously returned by lockBuffer. + * Must call after using lockBuffer to mutate the buffer. + */ + void unlockBuffer(int newLen) + { + AvmAssert(!isInterned()); + m_length = newLen; + } + void unlockBuffer() {} + + /** + * Returns a new string object which is a copy of this + * string object, with all characters in the string + * converted to uppercase. + * + * Unicode character classes for uppercase and lowercase + * are used. The conversion behavior is compliant with + * the String.toUpperCase method. + */ + Stringp toUpperCase(); + + /** + * Returns a new string object which is a copy of this + * string object, with all characters in the string + * converted to lowercase. + * + * Unicode character classes for uppercase and lowercase + * are used. The conversion behavior is compliant with + * the String.toLowerCase method. + */ + Stringp toLowerCase(); + + /*@{*/ + /** + * Compare the String with toCompare. + * @return = 0 if the strings are identical. + * < 0 if this string is less than toCompare + * > 0 if this string is greater than toCompare + */ + int Compare(String& toCompare) + { + if (hasPrefix()) normalize(); + if (toCompare.hasPrefix()) toCompare.normalize(); + + return String::Compare(getData() + getOffset(), length(), toCompare.getData() + toCompare.getOffset(), toCompare.length()); + } + + /*@{*/ + /** + * Does String contain wchar? + * @return = 0 if the strings are identical. + * < 0 if this string is less than toCompare + * > 0 if this string is greater than toCompare + */ + bool Contains(wchar c); + + // compare this string to (other,len) + bool Equals(const wchar *toCompare, int len) + { + AvmAssert(toCompare[len]==0); + int sLen = length(); + if (len != sLen) return false; + if (hasPrefix()) normalize(); + return String::Compare(getData() + getOffset(), sLen, toCompare, len)==0; + } + + // toCompare is not necessarily zero-terminated at toCompare[len] + bool FastEquals(const wchar *toCompare, int len) + { + int sLen = length(); + if (len != sLen) return false; + // This is only for intern strings which are never offset or prefix + AvmAssert(needsNormalization() == false); + const wchar *src = getData(); + + // !! could we compare two WORDS at a time? Our toCompare + // string is not necessarily DWORD aligned. (Offset strings, etc.) + + while (sLen) + { + sLen--; + if (src[sLen] != toCompare[sLen]) + return false; + } + + AvmAssert(sLen == 0); + return true; + } + + // compare this string to null-terminated 8bit string + bool Equals(const char *other8) + { + if (hasPrefix()) normalize(); + return !Compare(getData() + getOffset(), other8, length()); + } + + /*@{*/ + /** + * Compares s1 and s2. + * @return = 0 if the strings are identical. + * < 0 if s1 is less than s2 + * > 0 if s1 is greater than s2 + */ + static int Compare(const wchar *s1, + int len1, + const wchar *s2, + int len2); + static int Compare(const wchar *s1, + const char *s2, + int len); + /*@}*/ + + /*@{*/ + /** + * Returns the length of str, in # of characters. + */ + static int Length(const wchar *str); + static int Length(const char *str); + /*@}*/ + + void setInterned(AvmCore *core) + { + m_length |= 0x80000000; + generateIntegerEquivalent (core); + } + + static bool isSpace(wchar ch) + { + return (ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r'); + } + + bool isWhitespace(); + + int isInterned() const + { + return m_length & 0x80000000; + } + + // handles hex, octal, base 10 integer, float, and "Infinity"/"-Infinity" + double toNumber() + { + // For offset too since convertStringToNumber expects a null terminated string + if (needsNormalization()) normalize(); + return MathUtils::convertStringToNumber(getData() + getOffset(), length()); + } + + // native functions + int indexOf(Stringp s, int i=0); + int indexOfDouble(Stringp s, double i=0); + int lastIndexOf(Stringp s, int i=0x7fffffff); + int lastIndexOfDouble(Stringp s, double i=0x7fffffff); + Stringp charAt(int i=0); + Stringp charAtDouble(double i=0); + double charCodeAt(int i); // returns NaN for out-of-bounds + double charCodeAtDouble(double i); // returns NaN for out-of-bounds + int localeCompare(Stringp other, Atom *argv, int argc); + + Stringp substring(int i_start, int i_end); + Stringp substringDouble(double d_start, double d_end); + + Stringp slice(int dStart, int dEnd); + Stringp sliceDouble(double dStart, double dEnd); + + Stringp substr(int dStart, int dEnd); + Stringp substrDouble(double dStart, double dEnd); + + // Useful utilities used by the core code. + static wchar wCharToUpper (wchar ch); + static wchar wCharToLower (wchar ch); + +#ifdef DEBUGGER + uint32 size() const; +#endif + + private: + int m_length; // { interned: 1, length:31 } + class StringBuf : public MMgc::RCObject + { + public: + wchar m_buf[1]; +#ifdef MMGC_DRC + ~StringBuf() + { + memset(m_buf, 0, MMgc::GC::Size(this)-sizeof(MMgc::RCObject)); + } +#endif + }; + // no WB b/c manual WB is in setBuf, faster that way + StringBuf* m_buf; + + // The low two bits control what type of value is stored in m_prefixOrOffsetOrNumber + // 0x00 nothing is stored (rest of value is 0) + // 0x01 the 29-bit numeric equivalent of this string is stored (same as kIntegerAtom format) + // 0x02 a prefix string is stored + // 0x03 a 30-bit offset is stored + // manual WB when needed + int m_prefixOrOffsetOrNumber; + #define STRINGFLAGS 0x03 + #define NUMBERFLAG 0x01 + #define PREFIXFLAG 0x02 + #define OFFSETFLAG 0x03 + + Stringp getPrefix() const + { + if ((m_prefixOrOffsetOrNumber & STRINGFLAGS) == PREFIXFLAG) + return Stringp(m_prefixOrOffsetOrNumber & ~STRINGFLAGS); + else + return 0; + }; + + uint32 getOffset() const + { + if ((m_prefixOrOffsetOrNumber & STRINGFLAGS) == OFFSETFLAG) + return urshift(m_prefixOrOffsetOrNumber & ~STRINGFLAGS, 2); + else + return 0; + }; + + bool hasPrefix() const { return ((m_prefixOrOffsetOrNumber & STRINGFLAGS) == PREFIXFLAG); }; + bool hasOffset() const { return ((m_prefixOrOffsetOrNumber & STRINGFLAGS) == OFFSETFLAG); }; + + bool needsNormalization() const { return ((m_prefixOrOffsetOrNumber & STRINGFLAGS) >= 0x2); }; + + void normalize(); + + // If our string is a valid positive integer that fits in a kIntegerAtom, this + // will set our m_prefixOrOffsetOrNumber value to the int atom representation or'ed + // with NUMBERTYPE. This is only valid for non-prefix, non-offset interned strings. + void generateIntegerEquivalent(AvmCore *core); + + void setPrefixOrOffsetOrNumber(int value); + + static const wchar lowerCaseBase[]; + static const wchar upperCaseBase[]; + static const wchar lowerCaseConversion[]; + static const wchar upperCaseConversion[]; + static const unsigned char tolower_map[]; + static const unsigned char toupper_map[]; +public: + // This returns a kIntegerAtom Atom + // for use in our ScriptObject HashTable implementation. If we have a valid + // integer equivalent, it will never be zero since kIntegerType tag != 0 + Atom getIntAtom() const + { + if ((m_prefixOrOffsetOrNumber & STRINGFLAGS) == NUMBERFLAG) + return m_prefixOrOffsetOrNumber & ~STRINGFLAGS | kIntegerType; + else + return 0; + }; + + StringBuf* allocBuf(int numChars); + wchar *getData() const { return m_buf->m_buf; } + void setBuf(StringBuf *buf) { WBRC(MMgc::GC::GetGC(this), this, &m_buf, buf); } + + + }; + + // Compare helpers + inline bool operator==(String& s1, String& s2) + { + return s1.length() == s2.length() && s1.Compare(s2) == 0; + } + inline bool operator!=(String& s1, String& s2) + { + return s1.length() != s2.length() || s1.Compare(s2) != 0; + } + inline bool operator<(String& s1, String& s2) + { + return s2.Compare(s1) < 0; + } + inline bool operator>(String& s1, String& s2) + { + return s2.Compare(s1) > 0; + } + inline bool operator<=(String& s1, String& s2) + { + return s2.Compare(s1) <= 0; + } + inline bool operator>=(String& s1, String& s2) + { + return s2.Compare(s1) >= 0; + } +} + +#endif /* __avmplus_String__ */ diff --git a/mozilla/js/tamarin/core/Toplevel.cpp b/mozilla/js/tamarin/core/Toplevel.cpp new file mode 100644 index 00000000000..b13b068e784 --- /dev/null +++ b/mozilla/js/tamarin/core/Toplevel.cpp @@ -0,0 +1,1509 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmplus.h" + +namespace avmplus +{ +#undef DEBUG_EARLY_BINDING + + // + // builtins + // + BEGIN_NATIVE_MAP(Toplevel) + NATIVE_METHOD_FLAGS(escape, Toplevel::escape, 0) + NATIVE_METHOD_FLAGS(unescape, Toplevel::unescape, 0) + NATIVE_METHOD_FLAGS(decodeURI, Toplevel::decodeURI, 0) + NATIVE_METHOD_FLAGS(decodeURIComponent, Toplevel::decodeURIComponent, 0) + NATIVE_METHOD_FLAGS(encodeURI, Toplevel::encodeURI, 0) + NATIVE_METHOD_FLAGS(encodeURIComponent, Toplevel::encodeURIComponent, 0) + NATIVE_METHOD_FLAGS(isNaN, Toplevel::isNaN, 0) + NATIVE_METHOD_FLAGS(isFinite, Toplevel::isFinite, 0) + NATIVE_METHOD_FLAGS(parseInt, Toplevel::parseInt, 0) + NATIVE_METHOD_FLAGS(parseFloat, Toplevel::parseFloat, 0) + NATIVE_METHOD(isXMLName, Toplevel::isXMLName) + END_NATIVE_MAP() + + + Toplevel::Toplevel(VTable* cvtable, ScriptObject* delegate) + : ScriptObject(cvtable, delegate) + { + builtinClasses = (ClassClosure**) core()->GetGC()->Alloc(sizeof(ClassClosure*) * core()->builtinPool->cinits.capacity(), MMgc::GC::kZero | MMgc::GC::kContainsPointers); + } + + Toplevel::~Toplevel() + { +#ifdef DEBUGGER + scriptObjectTable = NULL; +#endif + } + + ClassClosure* Toplevel::resolveBuiltinClass(int class_id) + { + Traits *traits = core()->builtinPool->cinits[class_id]->declaringTraits->itraits; + Multiname qname(traits->ns, traits->name); + ScriptObject *container = vtable->init->finddef(&qname); + + Atom classAtom = getproperty(container->atom(), &qname, container->vtable); + ClassClosure *cc = (ClassClosure*)AvmCore::atomToScriptObject(classAtom); + //builtinClasses[class_id] = cc; + WBRC(core()->GetGC(), builtinClasses, &builtinClasses[class_id], cc); + return cc; + } + + ScriptObject* Toplevel::toPrototype(Atom atom) + { + if (!AvmCore::isNullOrUndefined(atom)) + { + switch (atom&7) + { + default: + + case kNamespaceType: + return namespaceClass->prototype; + + case kStringType: + return stringClass->prototype; + + case kObjectType: + return AvmCore::atomToScriptObject(atom)->getDelegate(); + + case kDoubleType: + case kIntegerType: + // ISSUE what about int? + return numberClass->prototype; + + case kBooleanType: + return booleanClass->prototype; + } + } + else + { + // TypeError in ECMA + throwTypeError( + (atom == undefinedAtom) ? kConvertUndefinedToObjectError : + kConvertNullToObjectError); + return NULL; + } + } + + // equivalent to ToObject, obj->traits. exception if null or undefined. + VTable* Toplevel::toVTable(Atom atom) + { + if (!AvmCore::isNullOrUndefined(atom)) + { + switch (atom&7) + { + case kObjectType: + return AvmCore::atomToScriptObject(atom)->vtable; + case kNamespaceType: + return namespaceClass->ivtable(); + case kStringType: + return stringClass->ivtable(); + case kBooleanType: + return booleanClass->ivtable(); + case kIntegerType: + case kDoubleType: + // ISSUE what about int? + return numberClass->ivtable(); + } + } + else + { + // TypeError in ECMA + throwTypeError( + (atom == undefinedAtom) ? kConvertUndefinedToObjectError : + kConvertNullToObjectError); + } + return NULL; + } + + // equivalent to ToObject, obj->traits. exception if null or undefined. + Traits* Toplevel::toTraits(Atom atom) + { + if (!AvmCore::isNullOrUndefined(atom)) + { + switch (atom&7) + { + case kObjectType: + return AvmCore::atomToScriptObject(atom)->traits(); + case kNamespaceType: + return core()->traits.namespace_itraits; + case kStringType: + return core()->traits.string_itraits; + case kBooleanType: + return core()->traits.boolean_itraits; + case kIntegerType: + case kDoubleType: + // ISSUE what about int? + return core()->traits.number_itraits; + } + } + else + { + // TypeError in ECMA + ErrorClass *error = typeErrorClass(); + if( error ) + error->throwError( + (atom == undefinedAtom) ? kConvertUndefinedToObjectError : + kConvertNullToObjectError); + else + throwVerifyError(kCorruptABCError); + } + return NULL; + } + + /** + * OP_call. + * + * arg0 = argv[0] + * arg1 = argv[1] + * argN = argv[argc] + */ + Atom Toplevel::op_call(Atom method, int argc, Atom* atomv) + { + if (!AvmCore::isObject(method)) + { + Multiname name(core()->publicNamespace, core()->constantString("value")); + throwTypeError(kCallOfNonFunctionError, core()->toErrorString(&name)); + } + return AvmCore::atomToScriptObject(method)->call(argc, atomv); + } + + /** + * OP_construct. Note that arguments are in the opposite order from AVM. + * + * this = argv[0] // ignored + * arg1 = argv[1] + * argN = argv[argc] + */ + Atom Toplevel::op_construct(Atom ctor, int argc, Atom* atomv) + { + if (!AvmCore::isObject(ctor)) + { + throwTypeError(kConstructOfNonFunctionError); + } + + ScriptObject *ct = AvmCore::atomToScriptObject(ctor); + Atom val = ct->construct(argc, atomv); +#ifdef DEBUGGER + if(core()->allocationTracking) + ct->addInstance(val); +#endif + return val; + } + + + // E4X 10.5.1, pg 37 + QNameObject* Toplevel::ToAttributeName(Atom attributeName) + { + if (!AvmCore::isNullOrUndefined(attributeName)) + { + AvmCore* core = this->core(); + switch (attributeName&7) + { + case kNamespaceType: + attributeName = AvmCore::atomToNamespace(attributeName)->getURI()->atom(); + break; + case kObjectType: + // check for XML, XMLList, Object, AttributeName, AnyName + // if XML, toString, then do default string case + // if XMLList, toString, then do default string case + // if AttributeName, return the input argument + // if AnyName, return the result of calling "ToAttributeName(*)" + // if QName, return attributeName + // otherwise, do toString, then to default case + if (core->isQName(attributeName)) + { + QNameObject *q = core->atomToQName (attributeName); + if (q->isAttr()) + return q; + else + return new (core->GetGC(), qnameClass()->ivtable()->getExtraSize()) QNameObject(qnameClass(), attributeName, true); + } + else + { + attributeName = core->string(attributeName)->atom(); + break; + } + break; + case kStringType: + { + break; + } + case kBooleanType: + case kIntegerType: + case kDoubleType: + default: // number + throwTypeError(kConvertUndefinedToObjectError); + } + + return new (core->GetGC(), qnameClass()->ivtable()->getExtraSize()) QNameObject(qnameClass(), attributeName, true); + } + else + { + throwTypeError(kConvertUndefinedToObjectError); + return NULL; + } + } + + // E4X 10.6.1, page 38 + // This returns a Multiname create from a unqualified generic type. + // The multiname returned will have one namespace and will be correctly + // marked as an attribute if input is an attribute + void Toplevel::ToXMLName (const Atom p, Multiname& m) + { + Stringp s = 0; + AvmCore* core = this->core(); + + if (!AvmCore::isNullOrUndefined(p)) + { + switch (p & 7) + { + case kNamespaceType: + s = AvmCore::atomToNamespace(p)->getURI(); + break; + case kObjectType: + { + // check for XML, XMLList, Object, AttributeName, AnyName + // if XML, toString, then do default string case + // if XMLList, toString, then do default string case + // if AttributeName, return the input argument + // if AnyName, return the result of calling "ToAttributeName(*)" + // if QName, return attributeName + if (core->isQName(p)) + { + QNameObject *q = core->atomToQName (p); + + m.setAttr(q->isAttr() ? true : false); + m.setNamespace(core->newNamespace (q->getURI())); + Stringp name = q->getLocalName(); + if (name == core->kAsterisk) + { + m.setAnyName(); // marks it as an anyName + } + else + { + m.setName(name); + } + return; + } + else // XML, XMLList or generic object - convert to string + { + s = core->string(p); + break; + } + } + case kIntegerType: + case kDoubleType: + case kStringType: + case kBooleanType: + { + s = core->string(p); + break; + } + } + } + else + { + throwTypeError(kConvertUndefinedToObjectError); + return; + } + + // At this point p should be a string atom + AvmAssert (s != 0); + + // if s is integer, throw TypeError + // if first character of s is "@", return __toAttributeName (string - @) + // else, return QName (s) + if ((*s)[0] == '@') + { + // __toAttributeName minus the @ + Stringp news = new (core->GetGC()) String(s, 1, s->length() - 1); + m.setName(core->internString(news)); + m.setAttr(); + } + else + { + m.setName(core->internString(s)); + } + + if (m.getName() == core->kAsterisk) + { + m.setAnyName(); // marks it as an anyName + } + + m.setNamespace(core->publicNamespace); + } + + void Toplevel::CoerceE4XMultiname (Multiname *m, Multiname &out) const + { + // This function is used to convert raw string access into correct + // Multiname types: + // x["*"] + // x["@*"] + // Unqualified anyName types are correct handled in Multiname::matches + // so we do not edit their namespaces here. (They should have one + // namespace which is null according to the E4X spec.) + // + // Unqualified regular types have the default XML namespace added to their + // namespace count here. + + AvmAssert(!m->isRuntime()); + + AvmCore *core = this->core(); + + if (m->isQName()) + { + AvmAssert(m->namespaceCount() == 1); + out.setNamespace(m); + out.setQName(); + } + else + { + // If we're any namespace, no work required. + if (m->isAnyNamespace()) + { + out.setAnyNamespace(); + } + else + { + // search for a match in our nsSet for the defaultNamespace + Namespace *defaultNs = toplevel()->getDefaultNamespace(); + bool bMatch = false; + for (int i=0, n=m->namespaceCount(); i < n; i++) + { + Namespace *ns = m->getNamespace(i); + if (ns && ns->getPrefix() == defaultNs->getPrefix() && + ns->getURI() == defaultNs->getURI() && + ns->getType() == defaultNs->getType()) + { + bMatch = true; + break; + } + } + + // For an unqualified reference, we need to add in the default xml namespace + // since we did not find a match for it in our namespace set + if (!bMatch) + { + int newNameCount = m->namespaceCount() + 1; + NamespaceSet *nsset = core->newNamespaceSet(newNameCount); + for (int i=0, n=m->namespaceCount(); i < n; i++) + { + nsset->namespaces[i] = m->getNamespace(i); + } + //Stringp s1 = string(getDefaultNamespace()->getPrefix()); + //Stringp s2 = string(getDefaultNamespace()->getURI()); + nsset->namespaces[newNameCount-1] = toplevel()->getDefaultNamespace(); + out.setNsset(nsset); + } + else + { + if (m->namespaceCount() > 1) + out.setNsset(m->getNsset()); + else + out.setNamespace (m->getNamespace()); + } + } + } + + out.setAttr(m->isAttr() ? true : false); + + if (m->isAnyName()) + { + out.setAnyName(); + } + else + { + Stringp s = m->getName(); + if ((s->length() == 1) && ((*s)[0] == '*')) + { + // Mark is as an "anyName" (name == undefined makes isAnyName true) + out.setAnyName(); + } + else if ((s->length() >= 1) && ((*s)[0] == '@')) + { + // If we're already marked as an attribute, we don't want to modify + // our string in any way. Degenerative cases where you call: + // XML.attribute (new QName("@*")) + if (!out.isAttr()) + { + // check for "@*" + if ((s->length() == 2) && ((*s)[1] == '*')) + out.setAnyName(); + else + out.setName(core->internString (new (core->GetGC()) String(s, 1, s->length()-1))); + out.setAttr(); + } + else + { + if (m->isAnyName()) + out.setAnyName(); + else + out.setName(m->getName()); + } + } + else + { + if (m->isAnyName()) + out.setAnyName(); + else + out.setName(m->getName()); + } + } + } + + Atom Toplevel::callproperty(Atom base, Multiname* multiname, int argc, Atom* atomv, VTable* vtable) + { + Binding b = getBinding(vtable->traits, multiname); + switch (b&7) + { + case BIND_METHOD: + { + #ifdef DEBUG_EARLY_BINDING + core()->console << "callproperty method " << vtable->traits << " " << multiname->getName() << "\n"; + #endif + // force receiver == base. if caller used OP_callproplex then receiver was null. + atomv[0] = base; + MethodEnv* method = vtable->methods[AvmCore::bindingToMethodId(b)]; + AvmAssert(method != NULL); + return method->coerceEnter(argc, atomv); + } + case BIND_VAR: + case BIND_CONST: + { + #ifdef DEBUG_EARLY_BINDING + core()->console << "callproperty slot " << vtable->traits << " " << multiname->getName() << "\n"; + #endif + Atom method = AvmCore::atomToScriptObject(base)->getSlotAtom(AvmCore::bindingToSlotId(b)); + return op_call(method, argc, atomv); + } + case BIND_GET: + case BIND_GETSET: + { + #ifdef DEBUG_EARLY_BINDING + core()->console << "callproperty getter " << vtable->traits << " " << multiname->getName() << "\n"; + #endif + // Invoke the getter on base + int m = AvmCore::bindingToGetterId(b); + MethodEnv *f = vtable->methods[m]; + Atom atomv_out[1] = { base }; + Atom method = f->coerceEnter(0, atomv_out); + return op_call(method, argc, atomv); + } + case BIND_SET: + { + #ifdef DEBUG_EARLY_BINDING + core()->console << "callproperty setter " << vtable->traits << " " << multiname->getName() << "\n"; + #endif + // read on write-only property + throwReferenceError(kWriteOnlyError, multiname, vtable->traits); + } + default: + #ifdef DEBUG_EARLY_BINDING + core()->console << "callproperty dynamic " << vtable->traits << " " << multiname->getName() << "\n"; + #endif + if (AvmCore::isObject(base)) + { + return AvmCore::atomToScriptObject(base)->callProperty(multiname, argc, atomv); + } + else + { + // primitive types are not dynamic, so we can go directly + // to their __proto__ object + ScriptObject* proto = toPrototype(base); + Atom method = proto->getProperty(multiname); + return op_call(method, argc, atomv); + } + } + } + + Atom Toplevel::constructprop(Multiname* multiname, int argc, Atom* atomv, VTable* vtable) + { + Binding b = getBinding(vtable->traits, multiname); + Atom obj = atomv[0]; + AvmCore* core = this->core(); + switch (b&7) + { + case BIND_METHOD: + { + // can't invoke method as constructor + MethodEnv* env = vtable->methods[AvmCore::bindingToMethodId(b)]; + throwTypeError(kCannotCallMethodAsConstructor, core->toErrorString((AbstractFunction*)env->method)); + } + case BIND_VAR: + case BIND_CONST: + { + #ifdef DEBUG_EARLY_BINDING + core->console << "constructprop slot " << vtable->traits << " " << multiname->getName() << "\n"; + #endif + Atom ctor = AvmCore::atomToScriptObject(obj)->getSlotAtom(AvmCore::bindingToSlotId(b)); + if (!core->istype(ctor, CLASS_TYPE) && !core->istype(ctor, FUNCTION_TYPE)) + throwTypeError(kNotConstructorError, core->toErrorString(multiname)); + return op_construct(ctor, argc, atomv); + } + case BIND_GET: + case BIND_GETSET: + { + #ifdef DEBUG_EARLY_BINDING + core()->console << "constructprop getter " << vtable->traits << " " << multiname->getName() << "\n"; + #endif + // Invoke the getter + int m = AvmCore::bindingToGetterId(b); + MethodEnv *f = vtable->methods[m]; + Atom atomv_out[1] = { obj }; + Atom ctor = f->coerceEnter(0, atomv_out); + return op_construct(ctor, argc, atomv); + } + case BIND_SET: + { + #ifdef DEBUG_EARLY_BINDING + core()->console << "constructprop setter " << vtable->traits << " " << multiname->getName() << "\n"; + #endif + // read on write-only property + throwReferenceError(kWriteOnlyError, multiname, vtable->traits); + } + default: + #ifdef DEBUG_EARLY_BINDING + core()->console << "constructprop dynamic " << vtable->traits << " " << multiname->getName() << "\n"; + #endif + if ((obj&7)==kObjectType) + { + return AvmCore::atomToScriptObject(obj)->constructProperty(multiname, argc, atomv); + } + else + { + // primitive types are not dynamic, so we can go directly + // to their __proto__ object + ScriptObject* proto = toPrototype(obj); + Atom ctor = proto->getProperty(multiname); + return op_construct(ctor, argc, atomv); + } + } + } + + Atom Toplevel::instanceof(Atom atom, Atom ctor) + { + AvmCore* core = this->core(); + if ((ctor&7) != kObjectType || + !core->istype(ctor, core->traits.function_itraits) && + !core->istype(ctor, core->traits.class_itraits)) + { + throwTypeError(kCantUseInstanceofOnNonObjectError); + } + // check for null before tryign to call toPrototype(atom), which will throw an error for null. + if (AvmCore::isNull(atom)) + return falseAtom; + + ClassClosure* c = (ClassClosure*)AvmCore::atomToScriptObject(ctor); + + ScriptObject *proto = c->prototype; + ScriptObject *o = toPrototype(atom); + + for (; o != NULL; o = o->getDelegate()) + { + if (o == proto) + return trueAtom; + } + + return falseAtom; + } + + + /** + * implements ECMA implicit coersion. returns the coerced value, + * or throws a TypeError if coersion is not possible. + */ + Atom Toplevel::coerce(Atom atom, Traits* expected) const + { + Traits* actual; + AvmCore* core = this->core(); + + // these types always succeed + if (expected == NULL) + return atom; + if (expected == BOOLEAN_TYPE) + return core->booleanAtom(atom); + if (expected == NUMBER_TYPE) + return core->numberAtom(atom); + if ((expected == STRING_TYPE)) + return AvmCore::isNullOrUndefined(atom) ? 0|kStringType : core->string(atom)->atom(); + if (expected == INT_TYPE) + return core->intAtom(atom); + if (expected == UINT_TYPE) + return core->uintAtom(atom); + if (expected == OBJECT_TYPE) + return atom == undefinedAtom ? nullObjectAtom : atom; + + if (AvmCore::isNullOrUndefined(atom)) + return expected == VOID_TYPE ? undefinedAtom : nullObjectAtom; + + switch (atom&7) + { + case kStringType: + actual = STRING_TYPE; + break; + + case kBooleanType: + actual = BOOLEAN_TYPE; + break; + + case kDoubleType: + actual = NUMBER_TYPE; + break; + + case kIntegerType: + actual = INT_TYPE; + break; + + case kNamespaceType: + actual = NAMESPACE_TYPE; + break; + + case kObjectType: + actual = AvmCore::atomToScriptObject(atom)->traits(); + break; + + default: + // unexpected atom type + AvmAssert(false); + return false; + } + + if (actual->containsInterface(expected)) + { + return atom; + } + else + { + // failed +#ifdef AVMPLUS_VERBOSE + //core->console << "checktype failed " << expected << " <- " << atom << "\n"; +#endif + throwTypeError(kCheckTypeFailedError, core->atomToErrorString(atom), core->toErrorString(expected)); + return atom;//unreachable + } + } + + void Toplevel::coerceobj(ScriptObject* obj, Traits* expected) const + { + if (obj && !obj->traits()->containsInterface(expected)) + { + // failed +#ifdef DEBUGGER + //core->console << "checktype failed " << expected << " <- " << atom << "\n"; +#endif + throwTypeError(kCheckTypeFailedError, core()->atomToErrorString(obj->atom()), core()->toErrorString(expected)); + } + } + + Atom Toplevel::add2(Atom lhs, Atom rhs) + { + AvmCore* core = this->core(); + + // do common cases first/quick: + if (AvmCore::isNumber(lhs) && AvmCore::isNumber(rhs)) + { + // C++ porting note. if either side is undefined, null or NaN then result must be NaN. + // Java's + operator ensures this for double operands. + // cn: null should convert to 0, so I think the above comment is wrong for null. + return core->doubleToAtom(core->number(lhs) + core->number(rhs)); + } + else if (AvmCore::isString(lhs) || AvmCore::isString(rhs) || core->isDate(lhs) || core->isDate(rhs)) + { + return core->concatStrings(core->string(lhs), core->string(rhs))->atom(); + } + + + // then look for the more unlikely cases + + // E4X, section 11.4.1, pg 53 + + if (core->isObject (lhs) && core->isObject (rhs) && + (core->isXML(lhs) || core->isXMLList(lhs)) + && (core->isXML(rhs) || core->isXMLList (rhs))) + { + XMLListObject *l = new (core->GetGC()) XMLListObject(xmlListClass()); + l->_append (lhs); + l->_append (rhs); + return l->atom(); + } + + // to catch oddball cases like: + // function foo() { }; + // foo.prototype.valueOf = function() { return new Object(); } + // foo.prototype.toString = function() { return 2; } + // print( new foo() + 33 ); // should be 35 + // + // we need to follow the E3 spec: + // 1. call ToPrimitive() on lhs and rhs, then + // if L is String || R is String, concat, else add toNumber(lhs) to toNumber(rhs) + + // ToPrimitive() will call [[DefaultValue]], which calls valueOf(). If the result is + // a primitive, return that value else call toString() instead. + + // from E3: + // NOTE No hint is provided in the calls to ToPrimitive in steps 5 and 6. All native ECMAScript objects except Date objects handle + // the absence of a hint as if the hint Number were given; Date objects handle the absence of a hint as if the hint String were given. + // Host objects may handle the absence of a hint in some other manner. + + Atom lhs_asPrimVal = core->primitive(lhs); // Date is handled above with the String argument case, we don't have to check for it here. + Atom rhs_asPrimVal = core->primitive(rhs); + + if (AvmCore::isString(lhs_asPrimVal) || AvmCore::isString(rhs_asPrimVal)) + { + return core->concatStrings(core->string(lhs_asPrimVal), core->string(rhs_asPrimVal))->atom(); + } + else + { + return core->doubleToAtom(core->number(lhs_asPrimVal) + core->number(rhs_asPrimVal)); + } + } + + Atom Toplevel::getproperty(Atom obj, Multiname* multiname, VTable* vtable) + { + Binding b = getBinding(vtable->traits, multiname); + AvmCore* core = this->core(); + switch (b&7) + { + case BIND_METHOD: + { + #ifdef DEBUG_EARLY_BINDING + core->console << "getproperty method " << vtable->traits << " " << multiname->getName() << "\n"; + #endif + if (multiname->contains(core->publicNamespace) && isXmlBase(obj)) + { + // dynamic props should hide declared methods + ScriptObject* so = AvmCore::atomToScriptObject(obj); + return so->getProperty(multiname); + } + // extracting a method + MethodEnv *m = vtable->methods[AvmCore::bindingToMethodId(b)]; + return methodClosureClass->create(m, obj)->atom(); + } + + case BIND_VAR: + case BIND_CONST: + { + #ifdef DEBUG_EARLY_BINDING + core->console << "getproperty slot " << vtable->traits << " " << multiname->getName() << "\n"; + #endif + int slot = AvmCore::bindingToSlotId(b); + return AvmCore::atomToScriptObject(obj)->getSlotAtom(slot); + } + + case BIND_NONE: + #ifdef DEBUG_EARLY_BINDING + core->console << "getproperty dynamic " << vtable->traits << " " << multiname->getName() << "\n"; + #endif + if ((obj&7) == kObjectType) + { + // try dynamic lookup on instance. even if the traits are sealed, + // we might need to search the prototype chain + return AvmCore::atomToScriptObject(obj)->getProperty(multiname); + } + else + { + // primitive types are not dynamic, so we can go directly + // to their __proto__ object. but they are sealed, so fail if + // the property is not found on the proto chain. + + ScriptObject* delegate = toPrototype(obj); + if (delegate->isValidDynamicName(multiname)) + { + return delegate->ScriptObject::getPropertyFromProtoChain(multiname->getName(), delegate, toTraits(obj)); + } + else + { + throwReferenceError(kReadSealedError, multiname, toTraits(obj)); + return undefinedAtom; + } + } + + case BIND_GET: + case BIND_GETSET: + { + #ifdef DEBUG_EARLY_BINDING + core->console << "getproperty getter " << vtable->traits << " " << multiname->getName() << "\n"; + #endif + // Invoke the getter + int m = AvmCore::bindingToGetterId(b); + MethodEnv *f = vtable->methods[m]; + Atom atomv_out[1] = { obj }; + return f->coerceEnter(0, atomv_out); + } + case BIND_SET: + { + #ifdef DEBUG_EARLY_BINDING + core->console << "getproperty setter " << vtable->traits << " " << multiname->getName() << "\n"; + #endif + // read on write-only property + throwReferenceError(kWriteOnlyError, multiname, vtable->traits); + } + + default: + // internal error + AvmAssert(false); + return undefinedAtom; + } + } + + void Toplevel::setproperty(Atom obj, Multiname* multiname, Atom value, VTable* vtable) const + { + Binding b = getBinding(vtable->traits, multiname); + setproperty_b(obj,multiname,value,vtable,b); + } + + void Toplevel::setproperty_b(Atom obj, Multiname* multiname, Atom value, VTable* vtable, Binding b) const + { + switch (b&7) + { + case BIND_METHOD: + { + #ifdef DEBUG_EARLY_BINDING + core()->console << "setproperty method " << vtable->traits << " " << multiname->getName() << "\n"; + #endif + if (multiname->contains(core()->publicNamespace) && isXmlBase(obj)) + { + // dynamic props should hide declared methods + ScriptObject* so = AvmCore::atomToScriptObject(obj); + so->setProperty(multiname, value); + return; + } + // trying to assign to a method. error. + throwReferenceError(kCannotAssignToMethodError, multiname, vtable->traits); + } + + case BIND_CONST: + { + // OP_setproperty can never set a const. initproperty must be used + throwReferenceError(kConstWriteError, multiname, vtable->traits); + return; + } + case BIND_VAR: + { + #ifdef DEBUG_EARLY_BINDING + core()->console << "setproperty slot " << vtable->traits << " " << multiname->getName() << "\n"; + #endif + int slot = AvmCore::bindingToSlotId(b); + AvmCore::atomToScriptObject(obj)->setSlotAtom(slot, + coerce(value, vtable->traits->getSlotTraits(slot))); + return; + } + + case BIND_SET: + case BIND_GETSET: + { + #ifdef DEBUG_EARLY_BINDING + core()->console << "setproperty setter " << vtable->traits << " " << multiname->getName() << "\n"; + #endif + // Invoke the setter + uint32 m = AvmCore::bindingToSetterId(b); + AvmAssert(m < vtable->traits->methodCount); + MethodEnv* method = vtable->methods[m]; + Atom atomv_out[2] = { obj, value }; + method->coerceEnter(1, atomv_out); + return; + } + case BIND_GET: + { + #ifdef DEBUG_EARLY_BINDING + core()->console << "setproperty getter " << vtable->traits << " " << multiname->getName() << "\n"; + #endif + throwReferenceError(kConstWriteError, multiname, vtable->traits); + return; + } + + case BIND_NONE: + { + #ifdef DEBUG_EARLY_BINDING + core()->console << "setproperty dynamic " << vtable->traits << " " << multiname->getName() << "\n"; + #endif + if (AvmCore::isObject(obj)) + { + AvmCore::atomToScriptObject(obj)->setProperty(multiname, value); + } + else + { + // obj represents a primitive Number, Boolean, int, or String, and primitives + // are sealed and final. Cannot add dynamic vars to them. + + // property could not be found and created. + throwReferenceError(kWriteSealedError, multiname, vtable->traits); + } + return; + } + + default: + // internal error if we get here + AvmAssert(false); + } + } + + // E4X 12.1.1, pg 59 + Namespace* Toplevel::getDefaultNamespace() + { + // Walking the scope chain now would require a pointer into the local + // variable space of the currently executing function. Instead we save/ + // restore the defaultNamespace location as we enter/leave methods, so we + // always can get to the current value. + AvmCore* core = this->core(); +#ifdef _DEBUG + AvmAssert(!core->dxnsAddr || (int)(*core->dxnsAddr) != 0xcccccccc); +#endif + if (!core->dxnsAddr || !(*core->dxnsAddr)) + throwTypeError(kNoDefaultNamespaceError); + return *core->dxnsAddr; + } + + /** + * find the binding for a property given a full multiname reference. The lookup + * must produce a single binding, or it's an error. Note that the name could be + * bound to the same binding in multiple namespaces. + */ + Binding Toplevel::getBinding(Traits* traits, Multiname* ref) const + { + Atom b = BIND_NONE; + if (traits && ref->isBinding()) + { + if (!ref->isNsset()) + { + b = traits->findBinding(ref->getName(), ref->getNamespace()); + } + else + { + b = traits->findBinding(ref->getName(), ref->getNsset()); + if (b == BIND_AMBIGUOUS) + { + // ERROR. more than one binding is available. throw exception. + throwTypeError( + kAmbiguousBindingError, core()->toErrorString(ref)); + } + } + } + return b; + } + + Stringp Toplevel::decodeURI(Stringp uri) + { + AvmCore* core = this->core(); + if (!uri) uri = core->knull; + Stringp out = decode(uri, false); + if (!out) { + toplevel()->uriErrorClass()->throwError(kInvalidURIError, core->toErrorString("decodeURI")); + } + return out; + } + + Stringp Toplevel::decodeURIComponent(Stringp uri) + { + AvmCore* core = this->core(); + if (!uri) uri = core->knull; + Stringp out = decode(uri, true); + if (!out) { + toplevel()->uriErrorClass()->throwError(kInvalidURIError, core->toErrorString("decodeURIComponent")); + } + return out; + } + + Stringp Toplevel::encodeURI(Stringp uri) + { + AvmCore* core = this->core(); + if (!uri) uri = core->knull; + Stringp out = encode(uri, false); + if (!out) { + toplevel()->uriErrorClass()->throwError(kInvalidURIError, core->toErrorString("encodeURI")); + } + return out; + } + + Stringp Toplevel::encodeURIComponent(Stringp uri) + { + AvmCore* core = this->core(); + if (!uri) uri = core->knull; + Stringp out = encode(uri, true); + if (!out) { + toplevel()->uriErrorClass()->throwError(kInvalidURIError, core->toErrorString("encodeURIComponent")); + } + return out; + } + + bool Toplevel::isNaN(double n) + { + return MathUtils::isNaN(n); + } + + /** + * isFinite(number) in section 15.1.2.5 of ecma 262 edition 3 + * + * Applies ToNumber to argument then returns false if the result is NaN, Negative + * Infinity, or Positive Infinity, and true otherwise + * + * Special case - if isFinite is called with no args, should return false based on + * section 10.1.3 that states if a function is called with less arguments then + * params, the variables get assigned 'undefined'. ToNumber(undefined) returns NaN + * + * @return true if arg is Finite, false otherwise + */ + bool Toplevel::isFinite(double d) + { + return !(MathUtils::isInfinite(d)||MathUtils::isNaN(d)); + } + + double Toplevel::parseInt(Stringp in, int radix) + { + AvmCore* core = this->core(); + if (!in) in = core->knull; + const wchar *ptr = in->c_str(); + return MathUtils::parseInt(ptr, in->length(), radix, false); + } + + double Toplevel::parseFloat(Stringp in) + { + double result; + + AvmCore* core = this->core(); + if (!in) in = core->knull; + if (!MathUtils::convertStringToDouble(in->c_str(), in->length(), &result, false)) { + result = MathUtils::nan(); + } + + return result; + } + + Stringp Toplevel::escape(Stringp in) + { + AvmCore* core = this->core(); + + if (!in) in = core->knull; + + const wchar *str = in->c_str(); + StringBuffer buffer(core); + + for (int i=0, n=in->length(); inewString(buffer.c_str()); + } + + Stringp Toplevel::escapeBytes(Stringp input) + { + AvmCore* core = this->core(); + + UTF8String* inputUTF8 = input->toUTF8String(); + const uint8* src = (const uint8*) inputUTF8->c_str(); + + StringBuffer buffer(core); + + for (int i=0, n=inputUTF8->length(); inewString(buffer.c_str()); + } + + // Helper function. + int Toplevel::parseHexChar(wchar c) + { + if ('0' <= c && c <= '9') { + return c-'0'; + } + if ('A' <= c && c <= 'F') { + return c-'A'+10; + } + if ('a' <= c && c <= 'f') { + return c-'a'+10; + } + return -1; + } + + wchar Toplevel::extractCharacter(const wchar*& src) + { + if (*src == '%') { + const wchar *ptr = src; + ptr++; + if (*ptr == 0) { + return *src++; + } + wchar value = 0; + int len = 2; + if (*ptr == 'u') { + len = 4; + ptr++; + } + for (int i=0; icore(); + + if (!in) in = core->knull; + + Stringp out = new (core->GetGC()) String(in->length()); + + const wchar *src = in->c_str(); + wchar *outbuf = out->lockBuffer(); + wchar *dst = outbuf; + const wchar *end = src + in->length(); + while (src < end) { + *dst++ = extractCharacter(src); + } + *dst = 0; + out->unlockBuffer(dst-outbuf); + + return out; + } + + Stringp Toplevel::encode(Stringp in, bool encodeURIComponentFlag) + { + StringBuffer out(core()); + + const wchar *src = in->c_str(); + int len = in->length(); + + while (len--) { + wchar ch = *src; + + if (contains(uriUnescaped, ch) || + (!encodeURIComponentFlag && + contains(uriReservedPlusPound, ch))) + { + out << (char)ch; + src++; + } else { + if (ch >= 0xDC00 && ch <= 0xDFFF) { + return NULL; + } + uint32 V; + if (ch >= 0xD800 && ch < 0xDC00) { + if (src[1] < 0xDC00 || src[1] > 0xDFFF) { + return NULL; + } + V = (ch - 0xD800) * 0x400 + (src[1] - 0xDC00) * 0x10000; + src += 2; + } else { + V = ch; + src++; + } + uint8 Octets[6]; + int OctetsLen = UnicodeUtils::Ucs4ToUtf8(V, Octets); + if (!OctetsLen) { + return NULL; + } + for (int i=0; inewString(out.c_str()); + } + + Stringp Toplevel::decode(Stringp in, bool decodeURIComponentFlag) + { + const wchar *chars = in->c_str(); + int length = in->length(); + wchar *out = (wchar*) core()->GetGC()->Alloc(length*2+1); // decoded result is at most length wchar chars long + int outLen = 0; + + for (int k = 0; k < length; k++) { + wchar C = chars[k]; + if (C == '%') { + int start = k; + if ((k + 2) >= length) { + return NULL; + } + int v1 = parseHexChar(chars[k+1]); + if (v1 == -1) { + return NULL; + } + int v2 = parseHexChar(chars[k+2]); + if (v2 == -1) { + return NULL; + } + k += 2; + uint8 B = (v1<<4) | v2; + uint32 V; + if (!(B & 0x80)) { + V = (wchar)B; + } else { + // 13. Let n be the smallest non-negative number + // such that (B << n) & 0x80 is equal to 0. + int n = 1; + while (((B< 4) { + return NULL; + } + uint8 Octets[4]; + Octets[0] = B; + if (k + 3*(n-1) >= length) { + return NULL; + } + for (int j=1; j 0x10FFFF) { + return NULL; + } + // 32. Let L be (((V - 0x10000) & 0x3FF) + 0xDC00). + // 33. Let H be ((((V - 0x10000) >> 10) & 0x3FF) + 0xD800). + uint32 L = (((V - 0x10000) & 0x3FF) + 0xDC00); + uint32 H = ((((V - 0x10000) >> 10) & 0x3FF) + 0xD800); + out[outLen++] = (wchar)H; + out[outLen++] = (wchar)L; + } + } else { + out[outLen++] = C; + } + } + + out[outLen] = 0; + return new (gc()) String(out,outLen); + } + + /* + * uriUnescaped is defined in Section 15.1 of the ECMA-262 specification + */ + const uint32 Toplevel::uriUnescaped[] = { + 0x00000000, + 0x03ff6782, + 0x87fffffe, + 0x47fffffe + }; + + /* + * uriReserved is defined in Section 15.1 of the ECMA-262 specification + * The '#' sign is added in accordance with the definition of + * the encodeURI/decodeURI functions + */ + const uint32 Toplevel::uriReservedPlusPound[] = { + 0x00000000, + 0xac009858, + 0x00000001, + 0x00000000 + }; + + /** + * unescaped is a bitmap representing the set of 69 nonblank + * characters defined in ECMA-262 Section B.2.1 for the + * escape top-level function + */ + const uint32 Toplevel::unescaped[] = { + 0x00000000, + 0x03ffec00, + 0x87ffffff, + 0x07fffffe + }; + + bool Toplevel::isXMLName(Atom v) + { + return core()->isXMLName(v); + } + + unsigned int Toplevel::readU30(const byte *&p) const + { + unsigned int result = AvmCore::readU30(p); + if (result & 0xc0000000) + throwVerifyError(kCorruptABCError); + return result; + } + + void Toplevel::throwVerifyError(int id) const + { + verifyErrorClass()->throwError(id); + } + +#ifdef DEBUGGER + void Toplevel::throwVerifyError(int id, Stringp arg1) const + { + verifyErrorClass()->throwError(id, arg1); + } + + void Toplevel::throwVerifyError(int id, Stringp arg1, Stringp arg2) const + { + verifyErrorClass()->throwError(id, arg1, arg2); + } +#endif + + void Toplevel::throwTypeError(int id) const + { + typeErrorClass()->throwError(id); + } + + void Toplevel::throwTypeError(int id, Stringp arg1) const + { + typeErrorClass()->throwError(id, arg1); + } + + void Toplevel::throwTypeError(int id, Stringp arg1, Stringp arg2) const + { + typeErrorClass()->throwError(id, arg1, arg2); + } + + void Toplevel::throwError(int id) const + { + errorClass()->throwError(id); + } + + void Toplevel::throwError(int id, Stringp arg1) const + { + errorClass()->throwError(id, arg1); + } + + void Toplevel::throwError(int id, Stringp arg1, Stringp arg2) const + { + errorClass()->throwError(id, arg1, arg2); + } + + void Toplevel::throwArgumentError(int id) const + { + argumentErrorClass()->throwError(id); + } + + void Toplevel::throwArgumentError(int id, Stringp arg1) const + { + argumentErrorClass()->throwError(id, arg1); + } + + void Toplevel::throwArgumentError(int id, const char *s) const + { + argumentErrorClass()->throwError(id, core()->toErrorString(s)); + } + + void Toplevel::throwArgumentError(int id, Stringp arg1, Stringp arg2) const + { + argumentErrorClass()->throwError(id, arg1, arg2); + } + + void Toplevel::throwRangeError(int id) const + { + rangeErrorClass()->throwError(id); + } + + void Toplevel::throwRangeError(int id, Stringp arg1) const + { + rangeErrorClass()->throwError(id, arg1); + } + + void Toplevel::throwRangeError(int id, Stringp arg1, Stringp arg2, Stringp arg3) const + { + rangeErrorClass()->throwError(id, arg1, arg2, arg3); + } + + void Toplevel::throwReferenceError(int id, Multiname* multiname, const Traits* traits) const + { + referenceErrorClass()->throwError(id, core()->toErrorString(multiname), core()->toErrorString((Traits*)traits)); + } + + void Toplevel::throwReferenceError(int id, Multiname* multiname) const + { + referenceErrorClass()->throwError(id, core()->toErrorString(multiname)); + } +} diff --git a/mozilla/js/tamarin/core/Toplevel.h b/mozilla/js/tamarin/core/Toplevel.h new file mode 100644 index 00000000000..4dd8e8cb1e8 --- /dev/null +++ b/mozilla/js/tamarin/core/Toplevel.h @@ -0,0 +1,318 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_Toplevel__ +#define __avmplus_Toplevel__ + + +namespace avmplus +{ + /** + * class Toplevel + */ + class Toplevel : public ScriptObject + { + public: + /** + * Constructor + */ + Toplevel(VTable* vtable, ScriptObject* delegate); + ~Toplevel(); + + /** + * @name actionscript.lang Classes + * These are the toplevel class closures. + */ + /*@{*/ + DRCWB(ArrayClass*) arrayClass; + DRCWB(BooleanClass*) booleanClass; + DRCWB(ClassClass*) classClass; + DateClass* dateClass() { return (DateClass*)getBuiltinClass(avmplus::NativeID::abcclass_Date); } + DRCWB(FunctionClass*) functionClass; + DRCWB(MethodClosureClass*) methodClosureClass; + DRCWB(NamespaceClass*) namespaceClass; + DRCWB(NumberClass*) numberClass; + DRCWB(IntClass*) intClass; + DRCWB(UIntClass*) uintClass; + DRCWB(ObjectClass*) objectClass; + RegExpClass* regexpClass() { return (RegExpClass*)getBuiltinClass(avmplus::NativeID::abcclass_RegExp); } + DRCWB(StringClass*) stringClass; + XMLClass* xmlClass() { return (XMLClass*)getBuiltinClass(avmplus::NativeID::abcclass_XML); } + XMLListClass* xmlListClass() { return (XMLListClass*)getBuiltinClass(avmplus::NativeID::abcclass_XMLList); } + QNameClass* qnameClass() { return (QNameClass*)getBuiltinClass(avmplus::NativeID::abcclass_QName); } + /*@}*/ + + /** + * @name Error Subclasses + * These are subclasses of Error used in the VM. + */ + /*@{*/ + ErrorClass *errorClass() const { return getErrorClass(avmplus::NativeID::abcclass_Error); } + ErrorClass *argumentErrorClass() const { return getErrorClass(avmplus::NativeID::abcclass_ArgumentError); } + ErrorClass *evalErrorClass() const { return getErrorClass(avmplus::NativeID::abcclass_EvalError); } + ErrorClass *typeErrorClass() const { return getErrorClass(avmplus::NativeID::abcclass_TypeError); } + ErrorClass *rangeErrorClass() const { return getErrorClass(avmplus::NativeID::abcclass_RangeError); } + ErrorClass *uriErrorClass() const { return getErrorClass(avmplus::NativeID::abcclass_URIError); } + ErrorClass *referenceErrorClass() const { return getErrorClass(avmplus::NativeID::abcclass_ReferenceError); } + ErrorClass *securityErrorClass() const { return getErrorClass(avmplus::NativeID::abcclass_SecurityError); } + ErrorClass *verifyErrorClass() const { return getErrorClass(avmplus::NativeID::abcclass_VerifyError); } + /*@}*/ + + void throwVerifyError(int id) const; + +#ifdef DEBUGGER + void throwVerifyError(int id, Stringp arg1) const; + void throwVerifyError(int id, Stringp arg1, Stringp arg2) const; +#else + void throwVerifyError(int id, Stringp arg1) const { throwVerifyError(id); (void)arg1; } + void throwVerifyError(int id, Stringp arg1, Stringp arg2) const { throwVerifyError(id); (void)arg1;(void)arg2; } +#endif + + void throwTypeError(int id) const; + void throwTypeError(int id, Stringp arg1) const; + void throwTypeError(int id, Stringp arg1, Stringp arg2) const; + + void throwError(int id) const; + void throwError(int id, Stringp arg1) const; + void throwError(int id, Stringp arg1, Stringp arg2) const; + + void throwArgumentError(int id) const; + void throwArgumentError(int id, Stringp arg1) const; + void throwArgumentError(int id, const char *arg1) const; + void throwArgumentError(int id, Stringp arg1, Stringp arg2) const; + + void throwRangeError(int id) const; + void throwRangeError(int id, Stringp arg1) const; + void throwRangeError(int id, Stringp arg1, Stringp arg2, Stringp arg3) const; + + void throwReferenceError(int id, Multiname* multiname, const Traits* traits) const; + void throwReferenceError(int id, Multiname* multiname) const; + + DWB(VTable*) object_vtable; // instance vtable + DWB(VTable*) class_vtable; // instance vtable + + // + // methods that used to be on AvmCore but depend on the caller's environment + // + ScriptObject* toPrototype(Atom atom); + VTable* toVTable(Atom atom); + + /** toObject + get traits */ + Traits* toTraits(Atom atom); + + /** + * OP_call. + * + * this = atomv[0] + * arg1 = atomv[1] + * argN = atomv[argc] + */ + Atom op_call(Atom method, + int argc, + Atom* atomv); + + /** + * OP_construct. + * + * this = atomv[0] (ignored) + * arg1 = atomv[1] + * argN = atomv[argc] + */ + Atom op_construct(Atom ctor, + int argc, + Atom* atomv); + + + /** Implementation of OP_callproperty */ + Atom callproperty(Atom base, Multiname* name, int argc, Atom* atomv, VTable* vtable); + + /** Implementation of OP_constructprop */ + Atom constructprop(Multiname* name, int argc, Atom* atomv, VTable* vtable); + + /** + * Implements the ToAttributeName API as specified in E4X 10.5.1, pg 37 + */ + QNameObject* ToAttributeName (const Atom arg); + QNameObject* ToAttributeName (const Stringp arg) + { + return ToAttributeName(arg->atom()); + } + + /** + * Implements the ToXMLName API as specified in E4X 10.6.1, page 38 + */ + void ToXMLName (const Atom arg, Multiname& m); + + /** + * E4X support for coercing regular Multinames into E4X specific ones + */ + void CoerceE4XMultiname (Multiname *m, Multiname &out) const; + + /** + * operator instanceof from ES3 + */ + Atom instanceof(Atom atom, Atom ctor); + + /** + * This is the implicit coercion operator. It is kind of like a + * Java downcast, but because of how E4 works, there are some cases + * when it returns a different value than what you pass in. + * + * It will happily return null if you pass in null for + * any reference type. And, it will throw an exception if the + * value is not in the type's value set. It does not do type + * conversion. + * + * @param atom The atom containing the value to coerce. + * @param itraits The itraits of the type to coerce to. + * @return The coerced atom. + * @throws Exception if the value is not in the type's value + * set. + */ + Atom coerce(Atom atom, Traits* expected) const; + void coerceobj(ScriptObject* obj, Traits* expected) const; + + /** + * Reads a property from an object, with the property + * to retrieve specified by its binding. + * The binding was likely retrieved using getBinding. + * @param obj Object to retrieve property from + * @param b The binding of the property + * @param traits The traits of the object + */ + Atom getproperty(Atom obj, Multiname* name, VTable* vtable); + + void setproperty(Atom obj, Multiname* multiname, Atom value, VTable* vtable) const; + void setproperty_b(Atom obj, Multiname* multiname, Atom value, VTable* vtable, Binding b) const; + + bool isXmlBase(Atom obj) const + { + AvmCore* core = this->core(); + if (AvmCore::isObject(obj)) + { + ScriptObject* so = AvmCore::atomToScriptObject(obj); + Traits* t = so->traits(); + return t == core->traits.xml_itraits || t == core->traits.xmlList_itraits; + } + return false; + } + /** + * operator + + */ + Atom add2(Atom lhs, Atom rhs); + + /** + * Implements the GetDefaultNamespace API as specified in E4X 12.1.1, pg 59 + * + */ + Namespace *getDefaultNamespace(); + + /** + * Retrieve a binding for a property of a class. + * This differs from the other overload of getBinding + * in that it takes a multiname instead of a name/ns + * pair. + * The returned binding can then be used to read/write + * the property + * @param traits The traits of the class + * @param multiname The multiname of the property + */ + Atom getBinding(Traits* traits, Multiname* multiname) const; + + #ifdef DEBUGGER + ScriptObjectTable *scriptObjectTable; + #endif + + /** + * @name ECMA-262 Appendix B.2 extensions + * Extensions to ECMAScript, in ECMA-262 Appendix B.2 + */ + /*@{*/ + Stringp escape(Stringp in); + Stringp unescape(Stringp in); + /*@}*/ + + /** + * This is a variant of escape() which doesn't encode + * Unicode characters using the %u sequence + */ + Stringp escapeBytes(Stringp in); + + /** + * @name Toplevel Function Properties + * Function properties of the global object (ECMA 15.1.2) + */ + /*@{*/ + Stringp decodeURI(Stringp uri); + Stringp decodeURIComponent(Stringp uri); + Stringp encodeURI(Stringp uri); + Stringp encodeURIComponent(Stringp uri); + bool isNaN(double d); + bool isFinite(double d); + double parseInt(Stringp in, int radix); + double parseFloat(Stringp in); + /*@}*/ + + // For E4X + bool isXMLName(Atom v); + + DECLARE_NATIVE_SCRIPT(Toplevel) + + ClassClosure* getBuiltinClass(int class_id) const + { + return builtinClasses[class_id] ? builtinClasses[class_id] : const_cast(this)->resolveBuiltinClass(class_id); + } + ErrorClass* getErrorClass(int class_id) const { return (ErrorClass*)getBuiltinClass(class_id); } + + unsigned int readU30(const byte *&p) const; + + private: + + int parseHexChar(wchar c); + wchar extractCharacter(const wchar*& src); + Stringp decode(Stringp in, bool decodeURIComponentFlag); + Stringp encode(Stringp in, bool encodeURIComponentFlag); + + static const uint32 unescaped[]; + static const uint32 uriUnescaped[]; + static const uint32 uriReservedPlusPound[]; + + inline static bool contains(const uint32 *uriSet, uint32 ch) + { + return (ch<0x80) && (uriSet[ch>>5]&(1<<(ch&0x1f))) != 0; + } + + ClassClosure* resolveBuiltinClass(int class_id); + DWB(ClassClosure**) builtinClasses; + }; +} + +#endif /* __avmplus_Toplevel__ */ diff --git a/mozilla/js/tamarin/core/Traits.cpp b/mozilla/js/tamarin/core/Traits.cpp new file mode 100644 index 00000000000..6db11130411 --- /dev/null +++ b/mozilla/js/tamarin/core/Traits.cpp @@ -0,0 +1,865 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 1993-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmplus.h" + +namespace avmplus +{ + using namespace MMgc; + + /** + * traits with base traits (inheritance) + */ + Traits::Traits(AvmCore *core, + Traits *base, + int nameCount, + int interfaceCount, + int interfaceCapacity, + size_t sizeofInstance) + : core(core), + MultinameHashtable(0) + { + // delay initialization to when vtable is setup so memory can be reported appropriately + Init(1+5*nameCount/4); + + this->needsHashtable = false; + this->sizeofInstance = sizeofInstance; + this->isInterface = false; + this->hasInterfaces = false; + + this->interfaceCount = interfaceCount; + this->interfaceCapacity = interfaceCapacity; + + this->hashTableOffset = -1; + + this->metadata_pos = NULL; + + this->slot_metadata_pos = NULL; + + // We are being sneaky and storing the slots immediately + // at the end of this object. The methods table follows + // the slots table. + + // replaced with getInterfaces() + //interfaces = (Traitsp*)((char*)this+sizeof(Traits)); + + if (base != NULL) + { + this->base = base; + + // clear and copy interfaces + addInterface(base); + + // don't copy down the symbol table, we'll walk up the tree + // when we need to. This saves a lot of memory for negligable slowdown. + } + } + + Traits::~Traits() + { + } + + void Traits::addInterface(Traits* ifc) + { + AvmAssert(ifc != this && ifc != NULL); + //*(findInterface(ifc)) = ifc; + WB(core->GetGC(), this, findInterface(ifc), ifc); + + if(ifc->isInterface) + hasInterfaces = true; + + for (int i=0, n=ifc->interfaceCapacity; i < n; i++) + { + Traits* t = ifc->getInterface(i); + if (t != NULL) + { + AvmAssert(ifc != this); + if(t->isInterface) + hasInterfaces = true; + //*(findInterface(t)) = t; + WB(core->GetGC(), this, findInterface(t), t); + } + } + } + + Binding Traits::findBinding(Stringp name, Namespace* ns) const + { + const Traits* t = this; + Binding b; + do + { + b = t->get(name, ns); + } + while (b == BIND_NONE && (t=t->base) != NULL); + return b; + } + + Binding Traits::findBinding(Stringp name, NamespaceSet* nsset) const + { + const Traits* t = this; + Binding b; + do + { + b = t->get(name, nsset); + } + while (b == BIND_NONE && (t=t->base) != NULL); + return b; + } + + void Traits::initTables() + { + // copy down info from base class + AvmAssert(!linked); + + MMgc::GC* gc = core->GetGC(); + + if (slotCount > 0 || methodCount > 0 || hasInterfaces) + { + MMGC_MEM_TYPE(this); + + size_t size = slotCount*sizeof(Traits*) + // slotTypes + slotCount*sizeof(int) + // slot offsets + methodCount*sizeof(AbstractFunction*); + + if(hasInterfaces) + size += IMT_SIZE * sizeof(Binding); + + void *idata = gc->Alloc(size, GC::kZero | GC::kContainsPointers); + + WB(gc, this, &instanceData, idata); + } + + AbstractFunction **methods = getMethods(); + int *offsets = getOffsets(); + Traits **slotTypes = getSlotTypes(); + if (base) + { + AvmAssert(base->linked); + + // + // process the slots: types, offsets, default values + // + int firstSlot; + if ((firstSlot=base->slotCount) > 0) + { + // copy base offsets and adjust for sizeofInstance + AvmAssert(sizeofInstance >= base->sizeofInstance); + int delta = sizeofInstance - base->sizeofInstance; + + for (int i=0; i < firstSlot; i++) + { + WB(gc, instanceData, &slotTypes[i], base->getSlotTypes()[i]); + offsets[i] = base->getOffsets()[i] + delta; + } + } + + int firstMethod; + if ((firstMethod = base->methodCount) > 0) + { + // copy base methods + for (int i=0; i < firstMethod; i++) + { + WB(gc, slotTypes, &methods[i], base->getMethods()[i]); + } + } + } + } + + void Traits::initMetadataTable() + { + if( !slot_metadata_pos ) + { + MMgc::GC* gc = core->GetGC(); + // Lots of things won't have any metadata, so only alloc the space if we really need it + MMGC_MEM_TYPE(this); + const byte** idata = (const byte**)gc->Calloc(slotCount+methodCount, sizeof(const byte*), GC::kZero | GC::kContainsPointers); + WB(gc, this, &slot_metadata_pos, idata); + } + } + + void Traits::setIndexedMetadataPos(uint32 i, const byte* pos) + { + AvmAssert(i < (slotCount+methodCount) ); + if (!slot_metadata_pos) + initMetadataTable(); + slot_metadata_pos[i] = pos; + } + + const byte* Traits::getSlotMetadataPos(uint32 i, PoolObject*& residingPool) const + { + AvmAssert( i < slotCount ); + Traits* t = (Traits*)this; + const byte* pos = 0; + while(t && !pos && islotCount) + { + if (t->slot_metadata_pos) + { + pos = t->slot_metadata_pos[i]; + residingPool = t->pool; + } + t = t->base; + } + return pos; + } + + const byte* Traits::getMethodMetadataPos(uint32 i, PoolObject*& residingPool) const + { + AvmAssert( i < methodCount ); + Traits* t = (Traits*)this; + const byte* pos = 0; + while(t && !pos && imethodCount) + { + if (t->slot_metadata_pos) + { + pos = t->slot_metadata_pos[t->slotCount+i]; + residingPool = t->pool; + } + t = t->base; + } + return pos; + } + + /** + * This must be called before any method is verified or any + * instances are created. It is not done eagerly in AbcParser + * because doing so would prevent circular type references between + * slots of cooperating classes. + * + * Resolve the type and position/width of each slot. + */ + void Traits::resolveSignatures(const Toplevel* toplevel) + { + if (!linked) + { + int firstSlot = 0; + int firstMethod = 0; + + Traitsp* interfaces = getInterfaces(); + // make sure base class and all interfaces are resolved + for (int i=0, n=interfaceCapacity; i < n; i++) + { + Traits* ifc = interfaces[i]; + if (ifc && !ifc->linked) + { + ifc->resolveSignatures(toplevel); + } + } + + if (base) + { + firstSlot = base->slotCount; + firstMethod = base->methodCount; + } + + initTables(); + + pool->resolveTraits(this, firstSlot, toplevel); + + // make sure all the methods have resolved types + for (int i=0, n=methodCount; i < n; i++) + { + AbstractFunction *f = getMethod(i); + if (f != NULL) + f->resolveSignature(toplevel); + + // else, sparse method array, why? + } + + bool legal = true; + if (base && base->methodCount > 0) + { + // check concrete overrides + AbstractFunction *virt=NULL; + AbstractFunction *over=NULL; + + for (int i=0, n=base->methodCount; i < n; i++) + { + virt = base->getMethod(i); + over = getMethod(i); + if (virt != NULL && virt != over) + legal &= checkOverride(virt, over); + } + } + + if (hasInterfaces && legal && !this->isInterface) + { + ImtBuilder imtBuilder(core->GetGC()); + + // make sure every interface method is implemented + for (int i=0, n=interfaceCapacity; i < n; i++) + { + Traits* ifc = interfaces[i]; + if (ifc && ifc->isInterface) + { + AbstractFunction *virt=NULL; + AbstractFunction *over=NULL; + + for (int j=ifc->next(0); j != 0; j = ifc->next(j)) + { + Stringp name = ifc->keyAt(j); + Namespace* ns = ifc->nsAt(j); + Binding iBinding = ifc->valueAt(j); + + if (AvmCore::isMethodBinding(iBinding)) + { + virt = ifc->getMethod(AvmCore::bindingToMethodId(iBinding)); + + Binding cBinding = findBinding(name, ns); + + if (!AvmCore::isMethodBinding(cBinding)) + { + // Try again with public namespace + Binding pBinding = findBinding(name, core->publicNamespace); + + // If that worked, add a trait. + if (AvmCore::isMethodBinding(pBinding)) + { + add(name, ns, pBinding); + cBinding = pBinding; + } + } + + if (!AvmCore::isMethodBinding(cBinding)) + { + #ifdef AVMPLUS_VERBOSE + core->console << "\n"; + core->console << "method not implemented " << virt << "\n"; + core->console << " over-binding " << (int)cBinding << " in " << this << "\n"; + #endif + over = NULL; + legal = false; + } + else + { + int disp_id = AvmCore::bindingToMethodId(cBinding); + over = getMethod(disp_id); + if (over != virt) + legal &= checkOverride(virt, over); + imtBuilder.addEntry(virt, disp_id); + } + } + else if (AvmCore::isAccessorBinding(iBinding)) + { + //virtAcc = bindingToAccessor(iBinding) + Binding cBinding = findBinding(name, ns); + + if (!AvmCore::isAccessorBinding(cBinding)) + { + // Try again with public namespace + Binding pBinding = findBinding(name, core->publicNamespace); + + // If that worked, add a trait. + if (AvmCore::isAccessorBinding(pBinding)) + { + add(name, ns, pBinding); + cBinding = pBinding; + } + } + + if (!AvmCore::isAccessorBinding(cBinding)) + { + #ifdef AVMPLUS_VERBOSE + core->console << "\n"; + core->console << "accessor not implemented " << ns << "::" << name << "\n"; + core->console << " over-binding " << (int)cBinding << " in " << this << "\n"; + #endif + over = NULL; + legal = false; + } + else + { + // check getter & setter overrides + if (AvmCore::hasGetterBinding(iBinding)) + { + virt = ifc->getMethod(AvmCore::bindingToGetterId(iBinding)); + if (!AvmCore::hasGetterBinding(cBinding)) + { + // missing getter + #ifdef AVMPLUS_VERBOSE + core->console << "\n"; + core->console << "getter not implemented " << ns << "::" << name << "\n"; + core->console << " over-binding " << (int)cBinding << " in " << this << "\n"; + #endif + over = NULL; + legal = false; + } + else + { + int disp_id = AvmCore::bindingToGetterId(cBinding); + over = getMethod(disp_id); + if (over != virt) + legal &= checkOverride(virt,over); + imtBuilder.addEntry(virt, disp_id); + } + } + + if (AvmCore::hasSetterBinding(iBinding)) + { + virt = ifc->getMethod(AvmCore::bindingToSetterId(iBinding)); + if (!AvmCore::hasSetterBinding(cBinding)) + { + // missing setter + #ifdef AVMPLUS_VERBOSE + core->console << "\n"; + core->console << "setter not implemented " << ns << "::" << name << "\n"; + core->console << " over-binding " << (int)cBinding << " in " << this << "\n"; + #endif + over = NULL; + legal = false; + } + else + { + int disp_id = AvmCore::bindingToSetterId(cBinding); + over = getMethod(disp_id); + if (over != virt) + legal &= checkOverride(virt,over); + imtBuilder.addEntry(virt, disp_id); + } + } + } + } + } + } + } + imtBuilder.finish(getIMT(), pool); + } + if (!legal) + { + Multiname qname(ns, name); + toplevel->throwVerifyError(kIllegalOverrideError, core->toErrorString(&qname), core->toErrorString(this)); + } + linked = true; + } + } + + bool Traits::checkOverride(AbstractFunction* virt, AbstractFunction* over) const + { + Traits* overTraits = over->returnTraits(); + Traits* virtTraits = virt->returnTraits(); + + if (overTraits != virtTraits) + { +#ifdef AVMPLUS_VERBOSE + core->console << "\n"; + core->console << "return types dont match\n"; + core->console << " virt " << virtTraits << " " << virt << "\n"; + core->console << " over " << overTraits << " " << over << "\n"; +#endif + return false; + } + + if (over->param_count != virt->param_count || + over->optional_count != virt->optional_count) + { +#ifdef AVMPLUS_VERBOSE + core->console << "\n"; + core->console << "param count mismatch\n"; + core->console << " virt params=" << virt->param_count << " optional=" << virt->optional_count << " " << virt << "\n"; + core->console << " over params=" << over->param_count << " optional=" << over->optional_count << " " << virt << "\n"; +#endif + return false; + } + + // allow subclass param 0 to implement or extend base param 0 + virtTraits = virt->paramTraits(0); + if (!containsInterface(virtTraits) || + !isMachineCompatible(this,virtTraits)) + { + if (!this->isMachineType && virtTraits == core->traits.object_itraits) + { + over->flags |= AbstractFunction::UNBOX_THIS; + } + else + { + #ifdef AVMPLUS_VERBOSE + core->console << "\n"; + core->console << "param 0 incompatible\n"; + core->console << " virt " << virtTraits << " " << virt << "\n"; + core->console << " over " << this << " " << over << "\n"; + #endif + return false; + } + } + + for (int k=1, p=over->param_count; k <= p; k++) + { + overTraits = over->paramTraits(k); + virtTraits = virt->paramTraits(k); + if (overTraits != virtTraits) + { + #ifdef AVMPLUS_VERBOSE + core->console << "\n"; + core->console << "param " << k << " incompatible\n"; + core->console << " virt " << virtTraits << " " << virt << "\n"; + core->console << " over " << overTraits << " " << over << "\n"; + #endif + return false; + } + } + + if (virt->flags & AbstractFunction::UNBOX_THIS) + { + // the UNBOX_THIS flag is sticky, all the way down the inheritance tree + over->flags |= AbstractFunction::UNBOX_THIS; + } + + return true; + } + + // static + bool Traits::isMachineCompatible(const Traits* a, const Traits* b) + { + return a == b || + // *, Object, and Void are each represented as Atom + (!a || a == a->core->traits.object_itraits || a == a->core->traits.void_itraits) && + (!b || b == b->core->traits.object_itraits || b == b->core->traits.void_itraits) || + // all other non-pointer types have unique representations + (a && b && !a->isMachineType && !b->isMachineType); + } + +#ifdef AVMPLUS_VERBOSE + Stringp Traits::format(AvmCore* core) const + { + if (name != NULL) + return Multiname::format(core, ns, name); + else + return core->concatStrings(core->newString("Traits@"), + core->formatAtomPtr((int)this)); + } +#endif + + // + // implemented traits, organized as a hash-set + // + + Traitsp* Traits::findInterface(Traits* t) const + { + Traitsp* set = this->getInterfaces(); + // this is a quadratic probe + int n = 7; + unsigned bitMask = this->interfaceCapacity - 1; + + // Note: Mask off MSB to avoid negative indices. Mask off bottom + // 3 bits because it doesn't contribute to hash. + + // [ed] math assumes t is 8-aligned! + AvmAssert((((int)t) & 7) == 0); + + unsigned i = (((int)t)>>3) & bitMask; + Traitsp k; + while ((k=set[i]) != t && k != NULL) + { + i = (i + (n++)) & bitMask; // quadratic probe + } + return &set[i]; + } + + void Traits::setSlotInfo(int index, uint32 slot_id, const Toplevel* toplevel, Traits* t, int offset, CPoolKind kind, AbcGen& gen) const + { + AvmAssert(t != VOID_TYPE); + AvmAssert(slot_id < slotCount); + Traits **slotTypes = getSlotTypes(); + int *offsets = getOffsets(); + + // slotTypes[slot_id] = t; + WB(core->GetGC(), instanceData, &slotTypes[slot_id], t); + offsets[slot_id] = offset; + + if (!t) + { + Atom value = !index ? undefinedAtom : pool->getDefaultValue(toplevel, index, kind, t); + + if(value != 0) + { + gen.getlocalN(0); + if(value == undefinedAtom) + gen.pushundefined(); + else if (AvmCore::isNull(value)) + gen.pushnull(); + else + gen.pushconstant(kind, index); + gen.setslot(slot_id); + } + } + else if (t == OBJECT_TYPE) + { + Atom value = !index ? nullObjectAtom : pool->getDefaultValue(toplevel, index, kind, t); + if (value == undefinedAtom) + { + Multiname qname(t->ns, t->name); + toplevel->throwVerifyError(kIllegalDefaultValue, core->toErrorString(&qname)); + } + + if(value != 0) + { + gen.getlocalN(0); + if(AvmCore::isNull(value)) + gen.pushnull(); + else + gen.pushconstant(kind, index); + gen.setslot(slot_id); + } + } + else if (t == NUMBER_TYPE) + { + Atom value = !index ? core->kNaN : pool->getDefaultValue(toplevel, index, kind, t); + if (!(AvmCore::isInteger(value)||AvmCore::isDouble(value))) + { + Multiname qname(t->ns, t->name); + toplevel->throwVerifyError(kIllegalDefaultValue, core->toErrorString(&qname)); + } + + if(AvmCore::number_d(value) != 0) + { + gen.getlocalN(0); + if(value == core->kNaN) + gen.pushnan(); + else + gen.pushconstant(kind, index); + gen.setslot(slot_id); + } + } + else if (t == BOOLEAN_TYPE) + { + Atom value = !index ? falseAtom : pool->getDefaultValue(toplevel, index, kind, t); + if (!AvmCore::isBoolean(value)) + { + Multiname qname(t->ns, t->name); + toplevel->throwVerifyError(kIllegalDefaultValue, core->toErrorString(&qname)); + } + + AvmAssert(urshift(falseAtom,3) == 0); + if(value != falseAtom) + { + gen.getlocalN(0); + gen.pushtrue(); + gen.setslot(slot_id); + } + } + else if (t == UINT_TYPE) + { + Atom value = !index ? (0|kIntegerType) : pool->getDefaultValue(toplevel, index, kind, t); + if (!AvmCore::isInteger(value) && !AvmCore::isDouble(value)) + { + Multiname qname(t->ns, t->name); + toplevel->throwVerifyError(kIllegalDefaultValue, core->toErrorString(&qname)); + } + + double d = AvmCore::number_d(value); + if (d != (uint32)d) + { + Multiname qname(t->ns, t->name); + toplevel->throwVerifyError(kIllegalDefaultValue, core->toErrorString(&qname)); + } + + if(value != (0|kIntegerType)) + { + gen.getlocalN(0); + gen.pushconstant(kind, index); + gen.setslot(slot_id); + } + } + else if (t == INT_TYPE) + { + Atom value = !index ? (0|kIntegerType) : pool->getDefaultValue(toplevel, index, kind, t); + if (!AvmCore::isInteger(value) && !AvmCore::isDouble(value)) + { + Multiname qname(t->ns, t->name); + toplevel->throwVerifyError(kIllegalDefaultValue, core->toErrorString(&qname)); + } + + double d = AvmCore::number_d(value); + if (d != (int)d) + { + Multiname qname(t->ns, t->name); + toplevel->throwVerifyError(kIllegalDefaultValue, core->toErrorString(&qname)); + } + + if(value != (0|kIntegerType)) + { + gen.getlocalN(0); + gen.pushconstant(kind, index); + gen.setslot(slot_id); + } + } + else if (t == STRING_TYPE) + { + Atom value = !index ? nullStringAtom : pool->getDefaultValue(toplevel, index, kind, t); + if (!(AvmCore::isNull(value) || AvmCore::isString(value))) + { + Multiname qname(t->ns, t->name); + toplevel->throwVerifyError(kIllegalDefaultValue, core->toErrorString(&qname)); + } + + if(!AvmCore::isNull(value)) + { + gen.getlocalN(0); + gen.pushconstant(kind, index); + gen.setslot(slot_id); + } + } + else if (t == NAMESPACE_TYPE) + { + Atom value = !index ? nullNsAtom : pool->getDefaultValue(toplevel, index, kind, t); + if (!(AvmCore::isNull(value) || AvmCore::isNamespace(value))) + { + Multiname qname(t->ns, t->name); + toplevel->throwVerifyError(kIllegalDefaultValue, core->toErrorString(&qname)); + } + + if(!AvmCore::isNull(value)) + { + gen.getlocalN(0); + gen.pushconstant(kind, index); + gen.setslot(slot_id); + } + } + else + { + // any other type: only allow null default value + Atom value = !index ? nullObjectAtom : pool->getDefaultValue(toplevel, index, kind, t); + if (!AvmCore::isNull(value)) + { + Multiname qname(t->ns, t->name); + toplevel->throwVerifyError(kIllegalDefaultValue, core->toErrorString(&qname)); + } + } + } + +#ifdef _DEBUG + int Traits::interfaceSlop() + { + Traitsp *interfaces = getInterfaces(); + int count=0; + for(int i=0, n=interfaceCapacity; igetTable(); + } + + // memset native space to zero except baseclasses + memset((char*)obj+sizeof(AvmPlusScriptableObject), 0, sizeofInstance-sizeof(AvmPlusScriptableObject)); + + // NOTE: this code can't use type macros or core b/c it can run + // after AvmCore has been destructed + int *offsets = getOffsets(); + Traitsp *traits = getSlotTypes(); + for(int i=0, n=slotCount; iisObjectType) { // atom + Atom a = *slot; + int type = a&7; + //if(type == kObjectType || type == kStringType || type == kNamespaceType) + AvmAssert(kObjectType == 1 && kStringType == 2 && kNamespaceType == 3); + if(type <= kNamespaceType) + rc = (RCObject*)(a&~7); + } else { // raw pointer + rc = *(RCObject**)slot; + } + if(rc) + rc->DecrementRef(); + *slot = 0; + } else { // machineType + AvmAssert(t->getTotalSize() == 1 || t->getTotalSize() == 4 || t->getTotalSize() == 8); + // The Boolean size is 1 but takes up 4 bytes. (Important on Mac with reverse endian) + *slot = 0; + if (t->getTotalSize() == 8) + *(slot + 1) = 0; + } + } + + // do this last, idea is to zero the object in order + if(ht) { + ht->destroy(); + } + } +#endif + + ImtBuilder::ImtBuilder(MMgc::GC *gc) + { + this->gc = gc; + memset(entries, 0, sizeof(ImtEntry*)*Traits::IMT_SIZE); + } + + void ImtBuilder::addEntry(AbstractFunction* virt, int disp_id) + { + int i = virt->iid() % Traits::IMT_SIZE; +#ifdef AVMPLUS_VERBOSE + if (entries[i] && virt->pool->verbose) + virt->core()->console << "conflict " << virt->iid() << " " << i << "\n"; +#endif + entries[i] = new (gc) ImtEntry(virt, entries[i], disp_id); + } + + void ImtBuilder::finish(Binding imt[], PoolObject* pool) + { + for (int i=0; i < Traits::IMT_SIZE; i++) + { + ImtEntry *e = entries[i]; + if (e == NULL) + { + imt[i] = BIND_NONE; + } + else if (e->next == NULL) + { + // single entry, no conflict + imt[i] = e->disp_id<<3 | BIND_METHOD; + gc->Free(e); + } + else + { + // build conflict stub + CodegenMIR mir(pool); + imt[i] = BIND_ITRAMP | (int)mir.emitImtThunk(e); + AvmAssert((imt[i]&7)==BIND_ITRAMP); // addr must be 8-aligned + } + } + } +} diff --git a/mozilla/js/tamarin/core/Traits.h b/mozilla/js/tamarin/core/Traits.h new file mode 100644 index 00000000000..15fcf154f01 --- /dev/null +++ b/mozilla/js/tamarin/core/Traits.h @@ -0,0 +1,368 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_Traits__ +#define __avmplus_Traits__ + + +namespace avmplus +{ + /** + * Traits objects describe the layout of objects. Traits are + * used to describe a variety of things in the VM, such as + * classes, global objects, and activation objects. + * + * A Traits object contains a hash table with the names of + * all properties and methods. Each name maps to a binding. + * + * There are several types of binding: binding to a slot, + * binding to an accessor, binding to a virtual function, + * binding to a final function. + */ + class Traits : public MultinameHashtable + { + friend class VTable; + public: + AvmCore* const core; + + /** + * Pointer to the base traits; that is, the traits + * of the base class. + */ + DWB(Traits*) base; + + /** The name of the class described by this traits object. */ + DRCWB(Namespace*) ns; + DRCWB(Stringp) name; + + /** + * If true, the class needs a hash table. Typically true for dynamic + * classes, but will be false for XML since they store dynamic props + * differently + */ + bool needsHashtable:1; + + /** set once signature types have been resolved */ + bool linked:1; + + /** set when the class cannot be extended */ + bool final:1; + + /** true for types whose values are not pointers */ + bool isMachineType:1; + + /** true for types that are interfaces */ + bool isInterface:1; + + /** used for Verify::findCommonBase */ + bool commonBase:1; + + /** used in verify/mir, true for int, uint, Number */ + bool isNumeric:1; + + /** used to tell us whether we need to allocate space for the IMT */ + bool hasInterfaces:1; + + /** true if this is NOT a derived object class. */ + /** Also true if this is an XML or XMLList object. */ + bool notDerivedObjectOrXML:1; + + /** for this == OBJECT_TYPE where we can't use OBJECT_TYPE */ + bool isObjectType:1; + + /** how we implement dictionary or strict style lookups */ + bool isDictionary:1; + + /** + * if this type is a factory, itraits is non-null and points + * to the type created by this factory. + */ + Traits* itraits; + + // choose a number that is relatively prime to sizeof(AbstractFunction)/8 + // since we use the AbstractFunction pointer as the interface method id + // smaller = dense table, few large conflict stubs + // larger = sparse table, many small conflict stubs + +#ifdef _DEBUG + static const int IMT_SIZE = 3; // good for testing all code paths +#else + static const int IMT_SIZE = 7; // good for performance +#endif + + const byte* getTraitsPos() const { + AvmAssert(!linked); + return traits_pos; + } + + void setTraitsPos(const byte* pos) { + AvmAssert(!linked); + traits_pos = pos; + } + + size_t getTotalSize() const { + AvmAssert(linked); + return totalSize; + } + + void setTotalSize(size_t size) { + totalSize = size; + } + + void setMetadataPos(const byte* pos) { + metadata_pos = pos; + } + + const byte* getMetadataPos() const { + return metadata_pos; + } + + void setSlotMetadataPos(uint32 i, const byte* pos) + { AvmAssert(i < slotCount); setIndexedMetadataPos(i, pos); } + void setMethodMetadataPos(uint32 i, const byte* pos) + { AvmAssert(i < methodCount); setIndexedMetadataPos(i+slotCount, pos); } + const byte* getSlotMetadataPos(uint32 i, PoolObject*& residingPool) const; + const byte* getMethodMetadataPos(uint32 i, PoolObject*& residingPool) const; + + static bool canContainPointer(Traits *t) { + return !t || !t->isMachineType || t->isObjectType; + } + + // not a call/init union b/c smart pointers and union's don't mix + DWB(AbstractFunction*) init; + + private: + + void initMetadataTable(); + void setIndexedMetadataPos(uint32 i, const byte* pos); + + // in resolveTraits we read traits_pos for the last time and at the end set totalSize + union { + const byte* traits_pos; + /** total size of instance including native size and slots size */ + size_t totalSize; + }; + + + /** chunk of memory allocated after traits resolution holding slotTypes, offsets and methods */ + void *instanceData; + + const byte* metadata_pos; + + const byte** slot_metadata_pos; + + public: + + // table of interface dispatch stubs. + // BIND_NONE = no entry + // BIND_METHOD+disp_id = no conflict, dispatches to concrete method + // BIND_ITRAMP+addr = conflict, dispatch to conflict resolution stub + // IMT table (if we have one, comes after the interfaces) + Binding *getIMT() const { + AvmAssert(hasInterfaces); + return (Binding*) (getMethods() + methodCount); + } + + AbstractFunction **getMethods() const { return instanceData ? (AbstractFunction**) (getOffsets() + slotCount) : NULL; } + Traits **getSlotTypes() const { return (Traits**) instanceData; } + int *getOffsets() const { return instanceData ? (int*) instanceData + slotCount : NULL; } + + /** # of methods in the methods array */ + uint32 methodCount; + + /** # of slots in the slots array */ + uint32 slotCount; + + /** # of traits (interfaces and base classes) in the interfaces array */ + uint32 interfaceCount; + + /** size of interfaces array */ + uint32 interfaceCapacity; + + /** offset of hash table for dynamic objects, -1 if invalid */ + int hashTableOffset; + + /** + * sizeof implementation class, + * e.g. ScriptObject, etc. Not counting extra room for slots + */ + size_t sizeofInstance; + + /** + * The constant pool owning this definition. NULL for internal types. + */ + DWB(PoolObject*) pool; + + /** scope chain types */ + DWB(ScopeTypeChain*) scope; + + /** protected namespace, if any */ + DRCWB(Namespace*) protectedNamespace; + + /** + * Constructor for traits. base != NULL means inheritance. + */ + Traits(AvmCore *core, + Traits *base, + int nameCount, + int interfaceCount, + int interfaceCapacity, + size_t sizeofInstance); + + virtual ~Traits(); + + /** + * Defines a slot on this traits object. + */ + void defineSlot(Stringp name, Namespace* ns, int slot, Binding kind) + { + add(name, ns, slot<<3|kind); + } + + Binding findBinding(Stringp name, Namespace* ns) const; + Binding findBinding(Stringp name, NamespaceSet* ns) const; + Binding getOverride(Namespace* ns, Stringp name, int tag, const Toplevel *toplevel) const; + + void resolveSignatures(const Toplevel* toplevel); + void initTables(); + bool checkOverride(AbstractFunction* virt, AbstractFunction* over) const; + + /** + * Adds the traits object t to the list of interfaces + * implemented by objects described by this traits object. + */ + void addInterface(Traits* t); + + /** + * Returns whether this traits object implements the + * interface described by traits t. + */ + int containsInterface(Traits* t) const + { + return this == t || *(findInterface(t)) != NULL; + } + + /** + * Returns the type of the slot identified by slot. + * @param slot slot to retrieve type of, zero-indexed + */ + Traits* getSlotTraits(uint32 i) const + { + //AvmAssert(linked); + AvmAssert(i < slotCount); + return getSlotTypes()[i]; + } + + + void setSlotInfo(int index, uint32 slot_id, const Toplevel* toplevel, + Traits* slotType, int offset, CPoolKind kind, AbcGen& gen) const; + + + static bool isMachineCompatible(const Traits* a, const Traits* b); + + void setNativeClassInfo(NativeClassInfo* entry) { this->nativeClassInfo = entry; } + void setNativeScriptInfo(NativeScriptInfo* entry) { this->nativeScriptInfo = entry; } + + NativeClassInfo* getNativeClassInfo() const { return nativeClassInfo; } + NativeScriptInfo* getNativeScriptInfo() const { return nativeScriptInfo; } + + AbstractFunction* getMethod(uint32 i) const + { + AvmAssert(i < methodCount); + AbstractFunction **_methods = getMethods(); + return _methods ? _methods[i] : NULL; + } + + void setMethod(uint32 i, AbstractFunction *method) + { + AvmAssert(i < methodCount && getMethods() != NULL); + //methods[i] = method; + WB(core->GetGC(), instanceData, &getMethods()[i], method); + } + + + /** Interfaces supported by objects described by this traits. */ + Traitsp* getInterfaces() const { return (Traitsp*)((char*)this+sizeof(Traits)); } + +#ifdef _DEBUG + int interfaceSlop(); +#endif + +#ifdef MMGC_DRC + void destroyInstance(ScriptObject *obj); +#endif + + private: + union { + NativeClassInfo* nativeClassInfo; + NativeScriptInfo* nativeScriptInfo; + }; + + Traitsp* findInterface(Traits* t) const; + + +#ifdef AVMPLUS_VERBOSE + public: + virtual Stringp format(AvmCore* core) const; +#endif + + Traits* getInterface(uint32 i) const + { + AvmAssert(i < interfaceCapacity); + return getInterfaces()[i]; + } + + }; + + class ImtBuilder + { + public: + class ImtEntry: public MMgc::GCObject + { + public: + ImtEntry(AbstractFunction* v, ImtEntry* n, int d) + : virt(v), next(n), disp_id(d) {} + AbstractFunction * const virt; + ImtEntry * const next; + const int disp_id; + }; + + ImtBuilder(MMgc::GC *gc); + void addEntry(AbstractFunction* virt, int disp_id); + void finish(Binding imt[], PoolObject* pool); + + private: + MMgc::GC *gc; + ImtEntry *entries[Traits::IMT_SIZE]; + }; +} + +#endif /* __avmplus_Traits__ */ diff --git a/mozilla/js/tamarin/core/TraitsIterator.h b/mozilla/js/tamarin/core/TraitsIterator.h new file mode 100644 index 00000000000..6a077c76ae7 --- /dev/null +++ b/mozilla/js/tamarin/core/TraitsIterator.h @@ -0,0 +1,84 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 1993-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#ifndef __avmplus_TraitsIterator__ +#define __avmplus_TraitsIterator__ + +namespace avmplus +{ + class TraitsIterator + { + public: + TraitsIterator(Traits *traits) : + traits(traits), + index(0) + { + } + + bool getNext(Stringp& key, Namespace*& ns, Binding& value) + { + if (index == -1) + { + return false; + } + while ((index = traits->next(index)) == 0) + { + // ascend to base traits + traits = traits->base; + if (!traits) + { + // no more traits, bail out. + index = -1; + return false; + } + // restart iteration on base traits + index = 0; + } + key = traits->keyAt(index); + ns = traits->nsAt(index); + value = traits->valueAt(index); + return true; + } + + Traits* currentTraits() + { + // this value changes as we walk up the traits chain + return traits; + } + + private: + Traits *traits; + int index; + }; +} + +#endif /* __avmplus_TraitsIterator__ */ diff --git a/mozilla/js/tamarin/core/UnicodeUtils.cpp b/mozilla/js/tamarin/core/UnicodeUtils.cpp new file mode 100644 index 00000000000..38fd4e3200c --- /dev/null +++ b/mozilla/js/tamarin/core/UnicodeUtils.cpp @@ -0,0 +1,520 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmplus.h" + +namespace avmplus +{ + /** + * + * Table of Unicode characters that can be represented in ECMAScript + * ECMA-262 Section 15.1.3 + * + * Code Point Value Representation 1st Octet 2nd Octet 3rd Octet 4th Octet + * + * 0x0000 - 0x007F 00000000 0zzzzzzz 0zzzzzzz + * 0x0080 - 0x07FF 00000yyy yyzzzzzz 110yyyyy 10zzzzzz + * 0x0800 - 0xD7FF xxxxyyyy yyzzzzzz 1110xxxx 10yyyyyy 10zzzzzz + * + * 0xD800 - 0xDBFF 110110vv vvwwwwxx 11110uuu 10uuwwww 10xxyyyy 10zzzzzz + * followed by followed by + * 0xDC00 - 0xDFFF 110111yy yyzzzzzz + * + * 0xD800 - 0xDBFF + * not followed by causes URIError + * 0xDC00 - 0xDFFF + * + * 0xDC00 - 0xDFFF causes URIError + * + * 0xE000 - 0xFFFF xxxxyyyy yyzzzzzz 1110xxxx 10yyyyyy 10zzzzzz + * + */ + + int UnicodeUtils::Utf16ToUtf8(const wchar *in, + int inLen, + uint8 *out, + int outMax) + { + int outLen = 0; + if (out) + { + // Output buffer passed in; actually encode data. + while (inLen > 0) + { + wchar ch = *in; + inLen--; + if (ch < 0x80) { + if (--outMax < 0) { + return -1; + } + *out++ = (uint8)ch; + outLen++; + } + else if (ch < 0x800) { + if ((outMax -= 2) < 0) { + return -1; + } + *out++ = (uint8)(0xC0 | (ch>>6)&0x1F); + *out++ = (uint8)(0x80 | (ch&0x3F)); + outLen += 2; + } + else if (ch >= 0xD800 && ch <= 0xDBFF) { + if (--inLen < 0) { + return -1; + } + wchar ch2 = *++in; + if (ch2 < 0xDC00 || ch2 > 0xDFFF) { + // This is an invalid UTF-16 surrogate pair sequence + // Encode the replacement character instead + ch = 0xFFFD; + goto Encode3; + } + + uint32 ucs4 = ((ch-0xD800)<<10) + (ch2-0xDC00) + 0x10000; + if ((outMax -= 4) < 0) { + return -1; + } + *out++ = (uint8)(0xF0 | (ucs4>>18)&0x07); + *out++ = (uint8)(0x80 | (ucs4>>12)&0x3F); + *out++ = (uint8)(0x80 | (ucs4>>6)&0x3F); + *out++ = (uint8)(0x80 | (ucs4&0x3F)); + outLen += 4; + } + else { + if (ch >= 0xDC00 && ch <= 0xDFFF) { + // This is an invalid UTF-16 surrogate pair sequence + // Encode the replacement character instead + ch = 0xFFFD; + } + Encode3: + if ((outMax -= 3) < 0) { + return -1; + } + *out++ = (uint8)(0xE0 | (ch>>12)&0x0F); + *out++ = (uint8)(0x80 | (ch>>6)&0x3F); + *out++ = (uint8)(0x80 | (ch&0x3F)); + outLen += 3; + } + in++; + } + } + else + { + // Count output characters without actually encoding. + while (inLen > 0) + { + wchar ch = *in; + inLen--; + if (ch < 0x80) { + outLen++; + } + else if (ch < 0x800) { + outLen += 2; + } + else if (ch >= 0xD800 && ch <= 0xDBFF) { + if (--inLen < 0) { + return -1; + } + wchar ch2 = *++in; + if (ch2 < 0xDC00 || ch2 > 0xDFFF) { + // Invalid... + // We'll encode 0xFFFD for this + outLen += 3; + } else { + outLen += 4; + } + } + else { + outLen += 3; + } + in++; + } + } + return outLen; + } + + int UnicodeUtils::Utf8ToUtf16(const uint8 *in, + int inLen, + wchar *out, + int outMax) + { + int outLen = 0; + unsigned int outch; + while (inLen > 0) + { + unsigned int c = *in; + + switch (c >> 4) + { + case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: + default: + // 0xxx xxxx + // OR not a valid utf-8 character + // Let the converted == false case handle this. + break; + + case 12: case 13: + // 110xxxxx 10xxxxxx + if (inLen < 2) { + // Invalid + break; + } + if ((in[1]&0xC0) != 0x80) { + // Invalid + break; + } + outch = (c<<6 & 0x7C0 | in[1] & 0x3F); + if (outch < 0x80) { + // Overlong sequence, reject as invalid. + break; + } + in += 2; + inLen -= 2; + if (out) { + if (--outMax < 0) { + return -1; + } + *out++ = outch; + } + outLen++; + continue; + + case 14: + // 1110xxxx 10xxxxxx 10xxxxxx + if (inLen < 3) { + // Invalid + break; + } + if ((in[1]&0xC0) != 0x80 || (in[2]&0xC0) != 0x80) { + // Invalid + break; + } + outch = (c<<12 & 0xF000 | in[1]<<6 & 0xFC0 | in[2] & 0x3F); + if (outch < 0x800) { + // Overlong sequence, reject as invalid. + break; + } + in += 3; + inLen -= 3; + if (out) { + if (--outMax < 0) { + return -1; + } + *out++ = outch; + } + outLen++; + continue; + + case 15: + // 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx + if (inLen < 4) { + // Invalid + break; + } + if ((in[1]&0xC0) != 0x80 || + (in[2]&0xC0) != 0x80 || + (in[3]&0xC0) != 0x80) + { + break; + } + + outch = (c<<18 & 0x1C0000 | + in[1]<<12 & 0x3F000 & + in[2]<<6 & 0xFC0 | + in[3] & 0x3F); + if (outch < 0x10000) { + // Overlong sequence, reject as invalid. + break; + } + + in += 4; + inLen -= 4; + + // Encode as UTF-16 surrogate sequence + if (out) { + if ((outMax -= 2) < 0) { + return -1; + } + *out++ = (wchar) (((outch-0x10000)>>10) & 0x3FF) + 0xD800; + *out++ = (wchar) ((outch-0x10000) & 0x3FF) + 0xDC00; + } + outLen += 2; + continue; + } + + // ! converted + if (out) { + if (--outMax < 0) { + return -1; + } + *out++ = (wchar)c; + } + inLen--; + in++; + outLen++; + } + return outLen; + } + + int UnicodeUtils::Utf8Count(const uint8 *in, + int inLen) + { + int outLen = 0; + unsigned int outch; + while (inLen > 0) + { + unsigned int c = *in; + const uint8 *inbase = in; + + while (c <= 0x7f) + { + if (--inLen == 0) + return outLen+(1+in-inbase); + c = *(++in); + } + outLen += in-inbase; + + switch (c >> 4) + { + default: + case 8: case 9: case 10: case 11: + // 10xxxxxx + // not a valid utf-8 character + // Let the converted == false case handle this. + break; + + case 12: case 13: + // 110xxxxx 10xxxxxx + if (inLen < 2) { + // Invalid + break; + } + if ((in[1]&0xC0) != 0x80) { + // Invalid + break; + } + outch = (c<<6 & 0x7C0 | in[1] & 0x3F); + if (outch < 0x80) { + // Overlong sequence, reject as invalid. + break; + } + in += 2; + inLen -= 2; + outLen++; + continue; + + case 14: + // 1110xxxx 10xxxxxx 10xxxxxx + if (inLen < 3) { + // Invalid + break; + } + if ((in[1]&0xC0) != 0x80 || (in[2]&0xC0) != 0x80) { + // Invalid + break; + } + outch = (c<<12 & 0xF000 | in[1]<<6 & 0xFC0 | in[2] & 0x3F); + if (outch < 0x800) { + // Overlong sequence, reject as invalid. + break; + } + in += 3; + inLen -= 3; + outLen++; + continue; + + case 15: + // 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx + if (inLen < 4) { + // Invalid + break; + } + if ((in[1]&0xC0) != 0x80 || + (in[2]&0xC0) != 0x80 || + (in[3]&0xC0) != 0x80) + { + break; + } + + outch = (c<<18 & 0x1C0000 | + in[1]<<12 & 0x3F000 & + in[2]<<6 & 0xFC0 | + in[3] & 0x3F); + if (outch < 0x10000) { + // Overlong sequence, reject as invalid. + break; + } + + in += 4; + inLen -= 4; + + // Encode as UTF-16 surrogate sequence + outLen += 2; + continue; + } + + // not converted if we get here + inLen--; + in++; + outLen++; + } + return outLen; + } + + int UnicodeUtils::Utf8ToUcs4(const uint8 *chars, + int len, + uint32 *out) + { + // U-00000000 - U-0000007F: 0xxxxxxx + // U-00000080 - U-000007FF: 110xxxxx 10xxxxxx + // U-00000800 - U-0000FFFF: 1110xxxx 10xxxxxx 10xxxxxx + // U-00010000 - U-001FFFFF: 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx + // U-00200000 - U-03FFFFFF: 111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx + // U-04000000 - U-7FFFFFFF: 1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx + + // The minUCS4 table enforces the security rule that an + // overlong UTF-8 sequence is forbidden, if a shorter + // sequence could encode the same character. + static uint32 minUCS4[] = { + 0x00000000, + 0x00000080, + 0x00000800, + 0x00010000, + 0x00200000, + 0x04000000 + }; + int n = 0; + uint32 b; + if (len < 1) { + return 0; + } + switch (chars[0]>>4) { + case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: + n = 1; + b = chars[0]; + break; + case 12: case 13: + n = 2; + b = chars[0]&0x1F; + break; + case 14: + n = 3; + b = chars[0]&0x0F; + break; + case 15: + switch (chars[0]&0x0C) { + case 0x00: + case 0x04: + n = 4; + b = chars[0]&0x07; + break; + case 0x08: + n = 5; + b = chars[0]&0x03; + break; + case 0x0C: + n = 6; + b = chars[0]&0x01; + break; + } + // fall through intentional + + default: // invalid character, should not get here + return 0; + } + if (len < n) { + return 0; + } + for (int i=1; i>6)&0x1F); + chars[1] = (uint8)(0x80 | (value&0x3F)); + return 2; + } + if (value < 0x10000) { + chars[0] = (uint8)(0xE0 | (value>>12)&0x0F); + chars[1] = (uint8)(0x80 | (value>>6)&0x3F); + chars[2] = (uint8)(0x80 | (value&0x3F)); + return 3; + } + if (value < 0x200000) { + chars[0] = (uint8)(0xF0 | (value>>18)&0x07); + chars[1] = (uint8)(0x80 | (value>>12)&0x3F); + chars[2] = (uint8)(0x80 | (value>>6)&0x3F); + chars[3] = (uint8)(0x80 | (value&0x3F)); + return 4; + } + if (value < 0x4000000) { + chars[0] = (uint8)(0xF8 | (value>>24)&0x03); + chars[1] = (uint8)(0x80 | (value>>18)&0x3F); + chars[2] = (uint8)(0x80 | (value>>12)&0x3F); + chars[3] = (uint8)(0x80 | (value>>6)&0x3F); + chars[4] = (uint8)(0x80 | (value&0x3F)); + return 5; + } + if (value < 0x80000000) { + chars[0] = (uint8)(0xFC | (value>>30)&0x01); + chars[1] = (uint8)(0x80 | (value>>24)&0x3F); + chars[2] = (uint8)(0x80 | (value>>18)&0x3F); + chars[3] = (uint8)(0x80 | (value>>12)&0x3F); + chars[4] = (uint8)(0x80 | (value>>6)&0x3F); + chars[5] = (uint8)(0x80 | (value&0x3F)); + return 6; + } + return 0; + } +} diff --git a/mozilla/js/tamarin/core/UnicodeUtils.h b/mozilla/js/tamarin/core/UnicodeUtils.h new file mode 100644 index 00000000000..39dea4dd37a --- /dev/null +++ b/mozilla/js/tamarin/core/UnicodeUtils.h @@ -0,0 +1,135 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_UnicodeUtils__ +#define __avmplus_UnicodeUtils__ + +namespace avmplus +{ + /** + * Utility class for converting between Unicode representations. + */ + class UnicodeUtils + { + public: + /** + * Utf16ToUtf8 converts a UTF-16 sequence to UTF-8. + * + * This encoder will check UTF-16 sequences for validity, + * mainly meaning invalid surrogate sequences + * (0xD800-0xDBFF not preceding 0xDC00-0xDFFF) + * + * Parameters: + * @param in input UTF-16 buffer to encode. The buffer is not + * assumed to be zero-terminated. + * @param inLen length of input buffer, in wchars. + * @param out output UTF-8 buffer. NULL may be passed, in + * which case the UTF-16 sequence is checked for + * validity and the number of output bytes + * is calculated. + * @param outMax size available in output buffer, in # of bytes. + * Ignored if out is NULL. + * + * @return The number of bytes encoded, or -1 if an error occurs. + * + * An error occurs in any of the following conditions: + * - The UTF-16 sequence is invalid (bad surrogates) + * - The output buffer contains insufficient space + * to represent the entire UTF-8 sequence. + */ + static int Utf16ToUtf8(const wchar *in, + int inLen, + uint8 *out, + int outMax); + + /** + * Utf8ToUtf16 converts a UTF-8 sequence to UTF-16. + * + * This decoder will check UTF-8 sequences for validity, + * including checking for overlong sequences (considered a + * security risk). It will decode UCS-4 values from + * 0x010000-0x10FFFF to a UTF-16 surrogate sequence. + * + * @param in input UTF-8 buffer to decode. The buffer is not + * assumed to be zero-terminated. + * @param inLen length of input buffer, in bytes. + * @param out output UTF-16 buffer. NULL may be passed, in + * which case the UTF-8 sequence is checked for + * validity and the number of output characters + * is calculated. + * @param outMax size available in output buffer, in # of wchars. + * Ignored if out is NULL. + * + * @return The number of wchars decoded, or -1 if an error occurs. + * + * An error occurs in any of the following conditions: + * - The UTF-8 sequence is invalid + * - The output buffer contains insufficient space + * to represent the entire UTF-8 sequence. + * - The UTF-8 sequence contains characters that cannot + * be represented in ECMAScript (code point >0x10FFFF) + */ + static int Utf8ToUtf16(const uint8 *in, + int inLen, + wchar *out, + int outMax); + + static int Utf8Count(const uint8 *in, int inLen); + + /** + * Utf8ToUcs4 converts the UTF-8 sequence "chars", which + * is "len" bytes in length, to a single UCS-4 character. + * The input is not assumed to be null-terminated. + * + * The actual number of bytes consumed is returned, or + * 0 is the UTF-8 sequence is malformed. + */ + static int Utf8ToUcs4(const uint8 *chars, + int len, + uint32 *out); + + /** + * Ucs4ToUtf8 takes a single 32-bit UCS-4 character as + * input and encodes it as UTF-8. + * + * The output buffer "out" is assumed to be at least 6 + * bytes in length. The output is not null-terminated. + * + * Ucs4ToUtf8 returns the number of bytes written to + * "out", or 0 if the UCS-4 character cannot be encoded + * to UTF-8 (>0x7fffffff) + */ + static int Ucs4ToUtf8(uint32 value, + uint8* out); + }; +} + +#endif /* __avmplus_UnicodeUtils__ */ diff --git a/mozilla/js/tamarin/core/VTable.cpp b/mozilla/js/tamarin/core/VTable.cpp new file mode 100644 index 00000000000..2efb6a14925 --- /dev/null +++ b/mozilla/js/tamarin/core/VTable.cpp @@ -0,0 +1,186 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 1993-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmplus.h" + +namespace avmplus +{ + + VTable::VTable(Traits* traits, VTable* base, ScopeChain* scope, AbcEnv* abcEnv, Toplevel* toplevel) + { + AvmAssert(traits != NULL); + this->traits = traits; + this->base = base; + this->scope = scope; + this->abcEnv = abcEnv; + this->toplevel = toplevel; + this->linked = false; + this->init = NULL; + } + + void VTable::resolveSignatures() + { + if( this->linked ) + return; + linked = true; + if (!traits->linked) + traits->resolveSignatures(toplevel); + + // make sure the traits of the base vtable matches the base traits + AvmAssert(base == NULL && traits->base == NULL || base != NULL && traits->base == base->traits); + + AvmCore* core = traits->core; + + if (traits->init && !this->init) + { + this->init = new (core->GetGC()) MethodEnv(traits->init, this); + } + + // populate method table + + if (base) + { + // inheriting + int baseMethodCount = base->traits->methodCount; + for (int i=0, n=traits->methodCount; i < n; i++) + { + AbstractFunction* method = traits->getMethod(i); + + if (i < baseMethodCount && method == traits->base->getMethod(i)) + { + // inherited method + //this->methods[i] = base->methods[i]; + WB(core->GetGC(), this, &methods[i], base->methods[i]); + } + else + { + // new definition + if (method != NULL) + { + //this->methods[i] = new (core->GetGC()) MethodEnv(method, this); + WB(core->GetGC(), this, &methods[i], new (core->GetGC()) MethodEnv(method, this)); + } + #ifdef AVMPLUS_VERBOSE + else if (traits->pool->verbose) + { + // why would the compiler assign sparse disp_id's? + traits->core->console << "WARNING: empty disp_id " << i << " on " << traits << "\n"; + } + #endif + } + } + + // this is done here b/c this property of the traits isn't set until the + // Dictionary's ClassClosure is called + traits->isDictionary = base->traits->isDictionary; + } + else + { + // not inheriting + for (int i=0, n=traits->methodCount; i < n; i++) + { + AbstractFunction* method = traits->getMethod(i); + if (method != NULL) + { + MethodEnv *env = new (core->GetGC()) MethodEnv(method, this); + //this->methods[i] = env; + WB(core->GetGC(), this, &methods[i], env); + } + #ifdef AVMPLUS_VERBOSE + else if (traits->pool->verbose) + { + // why would the compiler assign sparse disp_id's? + traits->core->console << "WARNING: empty disp_id " << i << " on " << traits << "\n"; + } + #endif + } + } + + if(traits->hasInterfaces) + { + for (int i=0; i < Traits::IMT_SIZE; i++) + { + Binding b = traits->getIMT()[i]; + if (AvmCore::isMethodBinding(b)) + { + //imt[i] = methods[AvmCore::bindingToMethodId(b)]; + WB(core->GetGC(), this, &imt[i], methods[AvmCore::bindingToMethodId(b)]); + } + else if ((b&7) == BIND_ITRAMP) + { + if (base && traits->base->hasInterfaces && b == traits->base->getIMT()[i]) + { + // copy down imt stub from base class + //imt[i] = base->imt[i]; + WB(core->GetGC(), this, &imt[i], base->imt[i]); + } + else + { + // create new imt stub + //imt[i] = new (core->GetGC()) MethodEnv((void*)(b&~7)); + WB(core->GetGC(), this, &imt[i], new (core->GetGC()) MethodEnv((void*)(b&~7), this)); + } + } + } + } + } + +#ifdef DEBUGGER + uint32 VTable::size() const + { + uint32 size = sizeof(VTable); + + if(ivtable != NULL) + size += ivtable->size(); + + size += traits->numTriplets * 3; + + size += traits->methodCount*sizeof(AbstractFunction*); + + int baseMethodCount = base ? base->traits->methodCount : 0; + for (int i=0, n=traits->methodCount; i < n; i++) + { + AbstractFunction* method = traits->getMethod(i); + + if (i < baseMethodCount && traits->base && method == traits->base->getMethod(i)) + { + continue; + } + else if(method != NULL) + { + size += method->size(); + } + } + return size; + } +#endif +} diff --git a/mozilla/js/tamarin/core/VTable.h b/mozilla/js/tamarin/core/VTable.h new file mode 100644 index 00000000000..0742ac81144 --- /dev/null +++ b/mozilla/js/tamarin/core/VTable.h @@ -0,0 +1,78 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_VTable__ +#define __avmplus_VTable__ + + +namespace avmplus +{ + + class VTable : public MMgc::GCObject + { + void addInterface(AbstractFunction* virt, int disp_id); + + bool linked; + public: + DWB(AbcEnv*) abcEnv; + DRCWB(Toplevel*) toplevel; // not const because native ClassClosure ctors modify it + DWB(MethodEnv*) call; + DWB(MethodEnv*) init; + DWB(ScopeChain*) scope; + DWB(Traits*) traits; + DWB(VTable*) base; + DWB(VTable*) ivtable; + + MethodEnv* imt[Traits::IMT_SIZE]; + MethodEnv* methods[1]; // virtual method table + + VTable(Traits* traits, VTable* base, ScopeChain* scope, AbcEnv* abcEnv, Toplevel* toplevel); + void resolveSignatures(); + + size_t getExtraSize() const { return traits->getTotalSize() - traits->sizeofInstance; } + MMgc::GC *gc() const { return traits->core->GetGC(); } + +#ifdef AVMPLUS_VERBOSE + Stringp format(AvmCore* core) const + { + return traits->format(core); + } +#endif + +#ifdef DEBUGGER + uint32 size() const; +#endif + }; + +} + +#endif // __avmplus_VTable__ + diff --git a/mozilla/js/tamarin/core/Verifier.cpp b/mozilla/js/tamarin/core/Verifier.cpp new file mode 100644 index 00000000000..5bcf0e41bf9 --- /dev/null +++ b/mozilla/js/tamarin/core/Verifier.cpp @@ -0,0 +1,3304 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmplus.h" + +namespace avmplus +{ +#undef DEBUG_EARLY_BINDING + + Verifier::Verifier(MethodInfo* info, Toplevel* toplevel +#ifdef AVMPLUS_VERBOSE + , bool secondTry +#endif + ) + { +#ifdef AVMPLUS_VERBOSE + this->secondTry = secondTry; +#endif + this->info = info; + this->core = info->core(); + this->pool = info->pool; + this->toplevel = toplevel; + + #ifdef FEATURE_BUFFER_GUARD + #ifdef AVMPLUS_MIR + this->growthGuard = 0; + #endif //AVMPLUS_MIR + #endif /* FEATURE_BUFFER_GUARD */ + + #ifdef AVMPLUS_VERBOSE + this->verbose = pool->verbose || (info->flags & AbstractFunction::VERBOSE_VERIFY); + #endif + + #ifdef AVMPLUS_PROFILE + if (core->dprof.dprofile) + core->dprof.mark(OP_verifyop); + #endif + + const byte* pos = info->body_pos; + max_stack = AvmCore::readU30(pos); + local_count = AvmCore::readU30(pos); + int init_scope_depth = AvmCore::readU30(pos); + int max_scope_depth = AvmCore::readU30(pos); + max_scope = MethodInfo::maxScopeDepth(info, max_scope_depth - init_scope_depth); + + stackBase = scopeBase + max_scope; + frameSize = stackBase + max_stack; + + if ((init_scope_depth < 0) || (max_scope_depth < 0) || (max_stack < 0) || + (max_scope < 0) || (local_count < 0) || (frameSize < 0) || (stackBase < 0)) + verifyFailed(kCorruptABCError); + + code_length = AvmCore::readU30(pos); + + code_pos = pos; + + pos += code_length; + + exceptions_pos = pos; + + blockStates = NULL; + state = NULL; + labelCount = 0; + + if (info->declaringTraits == NULL) + { + // scope hasn't been captured yet. + verifyFailed(kCannotVerifyUntilReferencedError); + } + } + + Verifier::~Verifier() + { + if (blockStates) + { + MMgc::GC* gc = core->GetGC(); + for(int i=0, n=blockStates->size(); iat(i); + if (state) + { + gc->Free(state); + } + } + blockStates->clear(); + delete blockStates; + } + } + + /** + * (done) branches stay in code block + * (done) branches end on even instr boundaries + * (done) all local var operands stay inside [0..max_locals-1] + * (done) no illegal opcodes + * (done) cpool refs are inside [1..cpool_size-1] + * (done) converging paths have same stack depth + * (done) operand stack stays inside [0..max_stack-1] + * (done) locals defined before use + * (done) scope stack stays bounded + * (done) getScopeObject never exceeds [0..info->maxScopeDepth()-1] + * (done) global slots limits obeyed [0..var_count-1] + * (done) callstatic method limits obeyed [0..method_count-1] + * (done) cpool refs are correct type + * (done) make sure we don't fall off end of function + * (done) slot based ops are ok (slot must be legal) + * (done) propref ops are ok: usage on actual type compatible with ref type. + * dynamic lookup ops are ok (type must not have that binding & must be dynamic) + * dont access superclass state in ctor until super ctor called. + * @param pool + * @param info + */ + void Verifier::verify(CodegenMIR *mir) + { + SAMPLE_FRAME("[verify]", core); + + #ifdef AVMPLUS_VERBOSE + if (verbose) + core->console << "verify " << info << '\n'; + secondTry = false; + #endif + + this->mir = mir; + if ( (state = newFrameState()) == 0 ){ + verifyFailed(kCorruptABCError); + } + for (int i=0, n=frameSize; i < n; i++) + state->setType(i, NULL); + + if (info->flags & AbstractFunction::NEED_REST) + { + // param_count+1 <= max_reg + checkLocal(info->param_count+1); + + state->setType(info->param_count+1, ARRAY_TYPE, true); + + #ifdef AVMPLUS_VERBOSE + if (verbose && (info->flags & AbstractFunction::NEED_ARGUMENTS)) + { + // warning, NEED_ARGUMENTS wins + core->console << "WARNING, NEED_REST overrides NEED_ARGUMENTS when both are set\n"; + } + #endif + } + else if (info->flags & AbstractFunction::NEED_ARGUMENTS) + { + // param_count+1 <= max_reg + checkLocal(info->param_count+1); + + // E3 style arguments array is an Object, E4 says Array, E4 wins... + state->setType(info->param_count+1, ARRAY_TYPE, true); + } + else + { + // param_count <= max_reg + checkLocal(info->param_count); + } + + // initialize method param types. + // We already verified param_count is a legal register so + // don't checkLocal(i) inside the loop. + // AbstractFunction::verify takes care of resolving param&return type + // names to Traits pointers, and resolving optional param default values. + for (int i=0, n=info->param_count; i <= n; i++) + { + bool notNull = (i==0); // this is not null, but other params could be + state->setType(i, info->paramTraits(i), notNull); + } + + // initial scope chain types + int outer_depth = 0; + + ScopeTypeChain* scope = info->declaringTraits->scope; + if (!scope && info->declaringTraits->init != info) + { + // this can occur when an activation scope inside a class instance method + // contains a nested getter, setter, or method. In that case the scope + // is not captured when the containing function is verified. This isn't a + // bug because such nested functions aren't suppported by AS3. This + // verify error is how we don't let those constructs run. + verifyFailed(kNoScopeError, core->toErrorString(info)); + } + + state->scopeDepth = outer_depth; + + // resolve catch block types + parseExceptionHandlers(); + + // Save initial state + FrameState* initialState = newFrameState(); + if( !initialState->init(state) ) + verifyFailed(kCorruptABCError); + + #ifdef AVMPLUS_PROFILE + if (core->dprof.dprofile) + core->dprof.mark(OP_verifypass); + #endif + + int actualCount = 0; + bool blockEnd = false; // extended basic block ending + + // always load the entry state, no merge on second pass + state->init(initialState); + +#ifdef FEATURE_BUFFER_GUARD + #ifdef AVMPLUS_MIR + // allow the mir buffer to grow dynamically + GrowthGuard guard( mir ? mir->mirBuffer : NULL); + this->growthGuard = &guard; + #endif //AVMPLUS_MIR +#endif /* FEATURE_BUFFER_GUARD */ + + #ifdef AVMPLUS_INTERP + if (mir) + #endif + { + #ifdef AVMPLUS_MIR + if( !mir->prologue(state) ) + { + if (!mir->overflow) + verifyFailed(kCorruptABCError); + + // we're out of code memory so try to carry on with interpreter + mir = 0; + this->mir = 0; + } + #endif //AVMPLUS_MIR + } + + int size; + for (const byte* pc = code_pos, *code_end=code_pos+code_length; pc < code_end; pc += size) + { + SAMPLE_CHECK(); + #ifdef AVMPLUS_PROFILE + if (core->dprof.dprofile) + core->dprof.mark(OP_verifyop); + #endif + + if (mir && mir->overflow) + { + mir = 0; + this->mir = 0; + } + + AbcOpcode opcode = (AbcOpcode) *pc; + if (opOperandCount[opcode] == -1) + verifyFailed(kIllegalOpcodeError, core->toErrorString(info), core->toErrorString(opcode), core->toErrorString(pc-code_pos)); + + if (opcode == OP_label) + { + // insert a label here + getFrameState(pc-code_pos)->targetOfBackwardsBranch = true; + } + + bool unreachable = false; + FrameState* blockState; + if ( blockStates && (blockState = blockStates->get((int)pc)) != 0 ) + { + // send a bbend prior to the merge + if (mir) mir->emitBlockEnd(state); + + if (!blockEnd || !blockState->initialized) + { + checkTarget(pc); + } + + #ifdef AVMPLUS_VERBOSE + if (verbose) + core->console << "B" << actualCount << ":\n"; + #endif + + // now load the merged state + state->init(blockState); + state->targetOfBackwardsBranch = blockState->targetOfBackwardsBranch; + state->pc = pc - code_pos; + + // found the start of a new basic block + if (mir) mir->emitBlockStart(state); + + state->targetOfBackwardsBranch = false; + + actualCount++; + blockEnd = false; + + if (!blockState->targetOfBackwardsBranch) + { + blockStates->remove((int)pc); + core->GetGC()->Free(blockState); + } + } + else + { + if (blockEnd) + { + // the next instruction is not reachable because it comes after + // a jump, throw, or return, and there are no branch targets + // inbetween the branch/jump/return and this instruction. + // So, don't verify it. + unreachable = true; + } + } + + state->pc = pc - code_pos; + int sp = state->sp(); + + if (info->exceptions) + { + bool mirSavedState = false; + for (int i=0, n=info->exceptions->exception_count; i < n; i++) + { + ExceptionHandler* handler = &info->exceptions->exceptions[i]; + if (pc >= code_pos + handler->from && pc <= code_pos + handler->to) + { + // Set the insideTryBlock flag, so the codegen can + // react appropriately. + state->insideTryBlock = true; + + // If this instruction can throw exceptions, add an edge to + // the catch handler. + if (opCanThrow[opcode] || pc == code_pos + handler->from) + { + // TODO check stack is empty because catch handlers assume so. + int saveStackDepth = state->stackDepth; + int saveScopeDepth = state->scopeDepth; + state->stackDepth = 0; + state->scopeDepth = outer_depth; + Value stackEntryZero = state->stackValue(0); + + #ifdef AVMPLUS_MIR + if (mir && !mirSavedState) { + mir->emitBlockEnd(state); + mirSavedState = true; + } + #endif + + // add edge from try statement to catch block + const byte* target = code_pos + handler->target; + // atom received as *, will coerce to correct type in catch handler. + state->push(NULL); + + #ifdef AVMPLUS_MIR + if (mir) + mir->localSet(stackBase, mir->exAtom); + #endif + + checkTarget(target); + state->pop(); + + state->stackDepth = saveStackDepth; + state->scopeDepth = saveScopeDepth; + state->stackValue(0) = stackEntryZero; + + // Search forward for OP_killreg in the try block + // Set these registers to killed in the catch state + if (pc == code_pos + handler->from) + { + FrameState *catchState = blockStates->get((int)target); + AvmAssert(catchState != 0); + + for (const byte *temp = pc; temp <= code_pos + handler->to; ) + { + if( *temp == OP_lookupswitch ) + { + // Variable length instruction + const byte *temp2 = temp+4; + const int case_count = toplevel->readU30(temp2)+1; + temp += AvmCore::calculateInstructionWidth(temp) + 3*case_count; + } + else + { + // If this instruction is OP_killreg, kill the register + // in the catch block state too + if (*temp == OP_kill) + { + const byte* temp2 = temp+1; + int local = toplevel->readU30(temp2); + if (local >= local_count) + verifyFailed(kInvalidRegisterError, core->toErrorString(local)); + Value& v = catchState->value(local); + v.notNull = false; + v.traits = NULL; + v.killed = true; + } + temp += AvmCore::calculateInstructionWidth(temp); + } + } + } + } + } + + if (pc == code_pos + handler->target) + { + emitCoerce(handler->traits, sp); + } + } + } + unsigned int imm30=0, imm30b=0; + int imm8=0, imm24=0; + + const byte* nextpc = pc; + AvmCore::readOperands(nextpc, imm30, imm24, imm30b, imm8); + // make sure U30 operands are within bounds. + if (opcode != OP_pushshort && ((imm30|imm30b) & 0xc0000000)) + { + // don't report error if first operand of abs_jump (pc) is large. + if (opcode != OP_abs_jump || (imm30b & 0xc0000000)) + { + verifyFailed(kCorruptABCError); + } + } + size = nextpc-pc; + if (pc+size > code_end) + verifyFailed(kLastInstExceedsCodeSizeError); + + #ifdef AVMPLUS_PROFILE + if (core->sprof.sprofile) + core->sprof.tally(opcode, size); + #endif + + #ifdef AVMPLUS_VERBOSE + if (verbose) + { + showState(state, pc, unreachable); + } + #endif + + if (unreachable) + { + // Even if unreachable, we have to properly advance + // past the variable-sized OP_lookupswitch + if (opcode == OP_lookupswitch) + size += 3*(imm30b+1); + + continue; + } + + switch (opcode) + { + case OP_iflt: + case OP_ifle: + case OP_ifnlt: + case OP_ifnle: + case OP_ifgt: + case OP_ifge: + case OP_ifngt: + case OP_ifnge: + case OP_ifeq: + case OP_ifstricteq: + case OP_ifne: + case OP_ifstrictne: + { + checkStack(2,0); + int lhs = sp-1; + state->pop(); + state->pop(); + if (mir) + mir->emitIf(state, opcode, state->pc+size+imm24, lhs, lhs+1); + checkTarget(nextpc+imm24); + break; + } + + case OP_iftrue: + case OP_iffalse: + { + checkStack(1,0); + int cond = sp; + emitCoerce(BOOLEAN_TYPE, cond); + state->pop(); + if (mir) + mir->emitIf(state, opcode, state->pc+size+imm24, cond, 0); + checkTarget(nextpc+imm24); + break; + } + + case OP_jump: + { + //checkStack(0,0) + if (mir) mir->emit(state, opcode, state->pc+size+imm24); + checkTarget(nextpc+imm24); // target block; + blockEnd = true; + break; + } + + case OP_lookupswitch: + { + checkStack(1,0); + peekType(INT_TYPE); + const uint32 count = imm30b; + if (mir) mir->emit(state, opcode, state->pc+imm24, count); + + state->pop(); + + checkTarget(pc+imm24); + uint32 case_count = 1 + count; + if (pc + size + 3*case_count > code_end) + verifyFailed(kLastInstExceedsCodeSizeError); + + for (uint32 i=0; i < case_count; i++) { + int off = AvmCore::readS24(pc+size); + checkTarget(pc+off); + size += 3; + } + blockEnd = true; + break; + } + + case OP_throw: + { + checkStack(1,0); + // [ggrossman] it is legal to throw anything at all; don't check + if (mir) mir->emit(state, opcode, sp); + state->pop(); + blockEnd = true; + break; + } + + case OP_returnvalue: + { + checkStack(1,0); + + if (mir) + { + Traits* returnTraits = info->returnTraits(); + emitCoerce(returnTraits, sp); + mir->emit(state, opcode, sp); + } + // make sure stack state is updated, since verifier scans + // straight through to the next block. + state->pop(); + blockEnd = true; + break; + } + + case OP_returnvoid: + { + //checkStack(1,0) + if (mir) mir->emit(state, opcode); + blockEnd = true; + break; + } + + case OP_pushnull: + checkStack(0,1); + if (mir) mir->emitIntConst(state, sp+1, 0); + state->push(NULL_TYPE); + break; + + case OP_pushundefined: + checkStack(0,1); + if (mir) mir->emitIntConst(state, sp+1, undefinedAtom); + state->push(VOID_TYPE); + break; + + case OP_pushtrue: + checkStack(0,1); + if (mir) mir->emitIntConst(state, sp+1, 1); + state->push(BOOLEAN_TYPE, true); + break; + + case OP_pushfalse: + checkStack(0,1); + if (mir) mir->emitIntConst(state, sp+1, 0); + state->push(BOOLEAN_TYPE, true); + break; + + case OP_pushnan: + checkStack(0,1); + if (mir) mir->emitDoubleConst(state, sp+1, (double*)(core->kNaN & ~7)); + state->push(NUMBER_TYPE, true); + break; + + case OP_pushshort: + checkStack(0,1); + if (mir) mir->emitIntConst(state, sp+1, (signed short)imm30); + state->push(INT_TYPE, true); + break; + + case OP_pushbyte: + checkStack(0,1); + if (mir) mir->emitIntConst(state, sp+1, (signed char)imm8); + state->push(INT_TYPE, true); + break; + + case OP_debugfile: + { + //checkStack(0,0) + #ifdef DEBUGGER + Atom filename = checkCpoolOperand(imm30, kStringType); + if (mir) mir->emit(state, opcode, (int)AvmCore::atomToString(filename)); + #endif + break; + } + + case OP_dxns: + { + //checkStack(0,0) + if (!info->isFlagSet(AbstractFunction::SETS_DXNS)) + verifyFailed(kIllegalSetDxns, core->toErrorString(info)); + Atom uri = checkCpoolOperand(imm30, kStringType); + if (mir) mir->emit(state, opcode, (int)AvmCore::atomToString(uri)); + break; + } + + case OP_dxnslate: + { + checkStack(1,0); + if (!info->isFlagSet(AbstractFunction::SETS_DXNS)) + verifyFailed(kIllegalSetDxns, core->toErrorString(info)); + // codgeen will call intern on the input atom. + if (mir) mir->emit(state, opcode, sp); + state->pop(); + break; + } + + case OP_pushstring: + { + checkStack(0,1); + uint32 index = imm30; + if (index > 0 && index < pool->constantStringCount) + { + Stringp value = pool->cpool_string[index]; + if (mir)mir->emitIntConst(state, sp+1, (int)value); + state->push(STRING_TYPE, value != NULL); + } + else + { + verifyFailed(kCpoolIndexRangeError, core->toErrorString(index), core->toErrorString(pool->constantStringCount)); + } + break; + } + + case OP_pushint: + { + checkStack(0,1); + uint32 index = imm30; + if (index > 0 && index < pool->constantIntCount) + { + if (mir) + { + int value = pool->cpool_int[index]; + mir->emitIntConst(state, sp+1, value); + } + state->push(INT_TYPE,true); + } + else + { + verifyFailed(kCpoolIndexRangeError, core->toErrorString(index), core->toErrorString(pool->constantIntCount)); + } + break; + } + case OP_pushuint: + { + checkStack(0,1); + uint32 index = imm30; + if (index > 0 && index < pool->constantUIntCount) + { + if (mir) + { + uint32 value = pool->cpool_uint[index]; + mir->emitIntConst(state, sp+1, value); + } + state->push(UINT_TYPE,true); + } + else + { + verifyFailed(kCpoolIndexRangeError, core->toErrorString(index), core->toErrorString(pool->constantUIntCount)); + } + break; + } + case OP_pushdouble: + { + checkStack(0,1); + uint32 index = imm30; + if (index > 0 && index < pool->constantDoubleCount) + { + if (mir) + { + double* p = pool->cpool_double[index]; + mir->emitDoubleConst(state, sp+1, p); + } + state->push(NUMBER_TYPE, true); + } + else + { + verifyFailed(kCpoolIndexRangeError, core->toErrorString(index), core->toErrorString(pool->constantDoubleCount)); + } + break; + } + + case OP_pushnamespace: + { + checkStack(0,1); + uint32 index = imm30; + if (index > 0 && index < pool->constantNsCount) + { + Namespace* value = pool->cpool_ns[index]; + if (mir)mir->emitIntConst(state, sp+1, (int)value); + state->push(NAMESPACE_TYPE, value != NULL); + } + else + { + verifyFailed(kCpoolIndexRangeError, core->toErrorString(index), core->toErrorString(pool->constantNsCount)); + } + break; + } + + case OP_setlocal: + { + checkStack(1,0); + checkLocal(imm30); + if (mir) mir->emitCopy(state, sp, imm30); + Value &v = state->stackTop(); + state->setType(imm30, v.traits, v.notNull); + state->pop(); + break; + } + + case OP_setlocal0: + case OP_setlocal1: + case OP_setlocal2: + case OP_setlocal3: + { + int localno = opcode-OP_setlocal0; + checkStack(1,0); + checkLocal(localno); + if (mir) mir->emitCopy(state, sp, localno); + Value &v = state->stackTop(); + state->setType(localno, v.traits, v.notNull); + state->pop(); + break; + } + + case OP_getlocal: + { + checkStack(0,1); + Value& v = checkLocal(imm30); + if (mir) mir->emitCopy(state, imm30, sp+1); + state->push(v); + break; + } + + case OP_getlocal0: + case OP_getlocal1: + case OP_getlocal2: + case OP_getlocal3: + { + int localno = opcode-OP_getlocal0; + checkStack(0,1); + Value& v = checkLocal(localno); + if (mir) mir->emitCopy(state, localno, sp+1); + state->push(v); + break; + } + + case OP_kill: + { + //checkStack(0,0) + Value &v = checkLocal(imm30); + if (mir) mir->emitKill(state, imm30); + v.notNull = false; + v.traits = NULL; + break; + } + + case OP_inclocal: + case OP_declocal: + { + //checkStack(0,0); + checkLocal(imm30); + emitCoerce(NUMBER_TYPE, imm30); + if (mir) + { + mir->emit(state, opcode, imm30, opcode==OP_inclocal ? 1 : -1, NUMBER_TYPE); + } + break; + } + + case OP_inclocal_i: + case OP_declocal_i: + { + //checkStack(0,0); + checkLocal(imm30); + emitCoerce(INT_TYPE, imm30); + if (mir) + { + mir->emit(state, opcode, imm30, opcode==OP_inclocal_i ? 1 : -1, INT_TYPE); + } + break; + } + + case OP_newfunction: + { + checkStack(0,1); + AbstractFunction* f = checkMethodInfo(imm30); + + f->setParamType(0, NULL); + f->makeIntoPrototypeFunction(toplevel); + Traits* ftraits = f->declaringTraits; + // make sure the traits of the base vtable matches the base traits + // This is also caught by an assert in VTable.cpp, however that turns + // out to be too late and may cause crashes + if( ftraits->base != toplevel->functionClass->ivtable()->traits ){ + AvmAssertMsg(0, "Verify failed:OP_newfunction"); + if (toplevel->verifyErrorClass() != NULL) + verifyFailed(kInvalidBaseClassError); + } + int extraScopes = state->scopeDepth; + ftraits->scope = ScopeTypeChain::create(core->GetGC(), scope, extraScopes); + for (int i=0,j=scope->size, n=state->scopeDepth; i < n; i++, j++) + { + ftraits->scope->scopes[j].traits = state->scopeValue(i).traits; + ftraits->scope->scopes[j].isWith = state->scopeValue(i).isWith; + } + + if (f->activationTraits) + { + // ISSUE - if nested functions, need to capture scope, not make a copy + f->activationTraits->scope = ftraits->scope; + } + + #ifdef AVMPLUS_VERIFYALL + if (core->verifyall) + pool->enq(f); + #endif + + if (mir) + { + mir->emitSetDxns(state); + mir->emit(state, opcode, imm30, sp+1, ftraits); + } + + state->push(ftraits, true); + break; + } + + case OP_getlex: + { + if (state->scopeDepth + scope->size == 0) + { + verifyFailed(kFindVarWithNoScopeError); + } + Multiname multiname; + checkConstantMultiname(imm30, multiname); + checkStackMulti(0, 1, &multiname); + if (multiname.isRuntime()) + verifyFailed(kIllegalOpMultinameError, core->toErrorString(opcode), core->toErrorString(&multiname)); + emitFindProperty(OP_findpropstrict, multiname); + emitGetProperty(multiname, 1); + break; + } + + case OP_findpropstrict: + case OP_findproperty: + { + if (state->scopeDepth + scope->size == 0) + { + verifyFailed(kFindVarWithNoScopeError); + } + Multiname multiname; + checkConstantMultiname(imm30, multiname); + checkStackMulti(0, 1, &multiname); + emitFindProperty(opcode, multiname); + break; + } + + case OP_newclass: + { + checkStack(1, 1); + // must be a CONSTANT_Multiname + Traits* ctraits = checkClassInfo(imm30); + + // the actual result type will be the static traits of the new class. + + // make sure the traits came from this pool. they have to because + // the class_index operand is resolved from the current pool. + AvmAssert(ctraits->pool == pool); + + Traits *itraits = ctraits->itraits; + + int captureScopes = state->scopeDepth; + + ScopeTypeChain* cscope = ScopeTypeChain::create(core->GetGC(), scope, captureScopes, 1); + int j=scope->size; + for (int i=0, n=state->scopeDepth; i < n; i++, j++) + { + cscope->scopes[j].traits = state->scopeValue(i).traits; + cscope->scopes[j].isWith = state->scopeValue(i).isWith; + } + + // add a type constraint for the "this" scope of static methods + cscope->scopes[state->scopeDepth].traits = ctraits; + + if (state->scopeDepth > 0) + { + // innermost scope must be the base class object or else createInstance() + // will malfunction because it will use the wrong [base] class object to + // construct the instance. See ScriptObject::createInstance() + Traits* baseCTraits = state->scopeValue(state->scopeDepth-1).traits; + if (!baseCTraits || baseCTraits->itraits != itraits->base) + verifyFailed(kCorruptABCError); + } + + ScopeTypeChain* iscope = ScopeTypeChain::create(core->GetGC(), cscope, 1, 1); + iscope->scopes[iscope->size-1].traits = ctraits; + + // add a type constraint for the "this" scope of instance methods + iscope->scopes[iscope->size].traits = itraits; + + ctraits->scope = cscope; + itraits->scope = iscope; + + ctraits->resolveSignatures(toplevel); + itraits->resolveSignatures(toplevel); + + #ifdef AVMPLUS_VERIFYALL + if (core->verifyall) + { + pool->enq(ctraits); + pool->enq(itraits); + } + #endif + + // make sure base class is really a class + if (mir) + { + mir->emitSetDxns(state); + emitCoerce(CLASS_TYPE, state->sp()); + mir->emit(state, opcode, (int)(void*)pool->cinits[imm30], sp, ctraits); + } + state->pop_push(1, ctraits, true); + break; + } + + case OP_finddef: + { + // must be a CONSTANT_Multiname. + Multiname multiname; + checkConstantMultiname(imm30, multiname); + checkStackMulti(0, 1, &multiname); + + if (!multiname.isBinding()) + { + // error, def name must be CT constant, regular name + verifyFailed(kIllegalOpMultinameError, core->toErrorString(opcode), core->toErrorString(&multiname)); + } + + AbstractFunction* script = (AbstractFunction*)pool->getNamedScript(&multiname); + if (script != (AbstractFunction*)BIND_NONE && script != (AbstractFunction*)BIND_AMBIGUOUS) + { + // found a single matching traits + if (mir) mir->emit(state, opcode, (int)&multiname, sp+1, script->declaringTraits); + state->push(script->declaringTraits, true); + } + else + { + // no traits, or ambiguous reference. use Object, anticipating + // a runtime exception + if (mir) mir->emit(state, opcode, (int)&multiname, sp+1, OBJECT_TYPE); + state->push(OBJECT_TYPE, true); + } + break; + } + + case OP_setproperty: + case OP_initproperty: + { + // stack in: object [ns] [name] value + Multiname multiname; + checkConstantMultiname(imm30, multiname); // CONSTANT_Multiname + checkStackMulti(2, 0, &multiname); + + uint32 n=2; + checkPropertyMultiname(n, multiname); + Value& obj = state->peek(n); + + int ptrIndex = sp-(n-1); + if (mir) emitCheckNull(ptrIndex); + + Binding b = toplevel->getBinding(obj.traits, &multiname); + Traits* propTraits = readBinding(obj.traits, b); + if (AvmCore::isSlotBinding(b) && mir && + // it's a var, or a const being set from the init function + (!AvmCore::isConstBinding(b) || + obj.traits->init == info && opcode == OP_initproperty)) + { + emitCoerce(propTraits, state->sp()); + mir->emit(state, OP_setslot, AvmCore::bindingToSlotId(b), ptrIndex, propTraits); + state->pop(n); + break; + } + // else: setting const from illegal context, fall through + + // If it's an accessor that we can early bind, do so. + // Note that this cannot be done on String or Namespace, + // since those are represented by non-ScriptObjects + if (mir && AvmCore::hasSetterBinding(b)) + { + // early bind to the setter + int disp_id = AvmCore::bindingToSetterId(b); + AbstractFunction *f = obj.traits->getMethod(disp_id); + AvmAssert(f != NULL); + emitCoerceArgs(f, 1); + mir->emitSetContext(state, f); + Traits* result = f->returnTraits(); + if (!obj.traits->isInterface) + mir->emitCall(state, OP_callmethod, disp_id, 1, result); + else + mir->emitCall(state, OP_callinterface, f->iid(), 1, result); + state->pop(n); + break; + } + + #ifdef DEBUG_EARLY_BINDING + core->console << "verify setproperty " << obj.traits << " " << &multiname->getName() << " from within " << info << "\n"; + #endif + + // not a var binding or early bindable accessor + if (mir) + { + mir->emitSetContext(state, NULL); + mir->emit(state, opcode, (int)&multiname); + } + state->pop(n); + + break; + } + + case OP_getproperty: + { + // stack in: object [ns [name]] + // stack out: value + Multiname multiname; + checkConstantMultiname(imm30, multiname); // CONSTANT_Multiname + checkStackMulti(1, 1, &multiname); + uint32 n=1; + checkPropertyMultiname(n, multiname); + emitGetProperty(multiname, n); + break; + } + + case OP_getdescendants: + { + // stack in: object [ns] [name] + // stack out: value + Multiname multiname; + checkConstantMultiname(imm30, multiname); + checkStackMulti(1, 1, &multiname); + uint32 n=1; + checkPropertyMultiname(n, multiname); + if (mir) + { + emitCheckNull(sp-(n-1)); + mir->emit(state, opcode, (int)&multiname, 0, NULL); + } + state->pop_push(n, NULL); + break; + } + + case OP_checkfilter: + { + // stack in: object + // stack out: object + checkStack(1, 1); + if (mir) + { + emitCheckNull(state->sp()); + mir->emit(state, opcode, state->sp(), 0, NULL); + } + break; + } + + case OP_deleteproperty: + { + Multiname multiname; + checkConstantMultiname(imm30, multiname); + checkStackMulti(1, 1, &multiname); + uint32 n=1; + checkPropertyMultiname(n, multiname); + if (mir) + { + emitCheckNull(sp-(n-1)); + mir->emit(state, opcode, (int)&multiname, 0, BOOLEAN_TYPE); + } + state->pop_push(n, BOOLEAN_TYPE); + break; + } + + case OP_astype: + { + checkStack(1, 1); + // resolve operand into a traits, and push that type. + Traits *t = checkTypeName(imm30);// CONSTANT_Multiname + int index = sp; + Traits* rhs = state->value(index).traits; + if (!canAssign(t, rhs) || !Traits::isMachineCompatible(t, rhs)) + { + Traits* resultType = t; + // result is typed value or null, so if type can't hold null, + // then result type is Object. + if (t && t->isMachineType) + resultType = OBJECT_TYPE; + if (mir) + mir->emit(state, OP_astype, (int)t, index, resultType); + state->pop_push(1, t); + } + + break; + } + + case OP_astypelate: + { + checkStack(2,1); + Value& classValue = state->peek(1); // rhs - class + Traits* ct = classValue.traits; + Traits* t = NULL; + if (ct && (t=ct->itraits) != 0) + if (t->isMachineType) + t = OBJECT_TYPE; + + if (mir) mir->emit(state, opcode, 0, 0, t); + state->pop_push(2, t); + break; + } + + case OP_coerce: + { + checkStack(1,1); + // resolve operand into a traits, and push that type. + emitCoerce(checkTypeName(imm30), sp); + break; + } + + case OP_convert_b: + case OP_coerce_b: + { + checkStack(1,1); + emitCoerce(BOOLEAN_TYPE, sp); + break; + } + + case OP_coerce_o: + { + checkStack(1,1); + emitCoerce(OBJECT_TYPE, sp); + break; + } + + case OP_coerce_a: + { + checkStack(1,1); + emitCoerce(NULL, sp); + break; + } + + case OP_convert_i: + case OP_coerce_i: + { + checkStack(1,1); + emitCoerce(INT_TYPE, sp); + break; + } + + case OP_convert_u: + case OP_coerce_u: + { + checkStack(1,1); + emitCoerce(UINT_TYPE, sp); + break; + } + + case OP_convert_d: + case OP_coerce_d: + { + checkStack(1,1); + emitCoerce(NUMBER_TYPE, sp); + break; + } + + case OP_coerce_s: + { + checkStack(1,1); + emitCoerce(STRING_TYPE, sp); + break; + } + + case OP_istype: + { + checkStack(1,1); + // resolve operand into a traits, and test if value is that type + Traits* itraits = checkTypeName(imm30); // CONSTANT_Multiname + if (mir) mir->emit(state, opcode, (int)itraits, sp, BOOLEAN_TYPE); + state->pop(); + state->pop(); + state->push(OBJECT_TYPE); + state->push(INT_TYPE); + break; + } + + case OP_istypelate: + { + checkStack(2,1); + if (mir) mir->emit(state, opcode, 0, 0, BOOLEAN_TYPE); + // TODO if the only common base type of lhs,rhs is Object, then result is always false + state->pop_push(2, BOOLEAN_TYPE); + break; + } + + case OP_convert_o: + { + checkStack(1,1); + // ISSUE should result be Object, laundering the type? + // ToObject throws an exception on null and undefined, so after this runs we + // know the value is safe to dereference. + if (mir) + emitCheckNull(sp); + break; + } + + case OP_convert_s: + case OP_esc_xelem: + case OP_esc_xattr: + { + checkStack(1,1); + // this is the ECMA ToString and ToXMLString operators, so the result must not be null + // (ToXMLString is split into two variants - escaping elements and attributes) + emitToString(opcode, sp); + break; + } + + case OP_callstatic: + { + AbstractFunction* m = checkMethodInfo(imm30); + int method_id = m->method_id; + const uint32 argc = imm30b; + + checkStack(argc+1, 1); + + if (!m->paramTraits(0)) + { + verifyFailed(kDanglingFunctionError, core->toErrorString(m), core->toErrorString(info)); + } + + #ifdef AVMPLUS_VERIFYALL + if (core->verifyall) + pool->enq(m); + #endif + + emitCoerceArgs(m, argc); + + Traits* resultType = m->returnTraits(); + if (mir) + { + emitCheckNull(sp-argc); + mir->emitSetContext(state, m); + mir->emitCall(state, OP_callstatic, method_id, argc, resultType); + } + state->pop_push(argc+1, resultType); + break; + } + + case OP_call: + { + const uint32 argc = imm30; + checkStack(argc+2, 1); + // don't need null check, AvmCore::call() uses toFunction() for null check. + + /* + TODO optimizations + - if this is a class closure for a non-native type, call == coerce + - if this is a function closure, try early binding using the traits->call sig + - optimize simple cases of casts to builtin types + */ + if (mir) + { + mir->emitSetContext(state, NULL); + mir->emit(state, opcode, argc, 0, NULL); + } + state->pop_push(argc+2, NULL); + break; + } + + case OP_construct: + { + // in: ctor arg1..N + // out: obj + const uint32 argc = imm30; + checkStack(argc+1, 1); + Traits* ctraits = state->peek(argc+1).traits; + // don't need null check, AvmCore::construct() uses toFunction() for null check. + Traits* itraits = ctraits ? ctraits->itraits : NULL; + if (mir) + { + mir->emitSetContext(state, NULL); + mir->emit(state, opcode, argc, 0, itraits); + } + state->pop_push(argc+1, itraits, true); + break; + } + + case OP_callmethod: + { + const uint32 argc = imm30b; + const int disp_id = imm30-1; + checkStack(argc+1,1); + if (disp_id >= 0) + { + Value& obj = state->peek(argc+1); + if( !obj.traits ) verifyFailed(kCorruptABCError); + checkEarlyMethodBinding(obj.traits); + AbstractFunction* m = checkDispId(obj.traits, disp_id); + Traits *resultType = m->returnTraits(); + if (mir) + { + emitCheckNull(sp-argc); + emitCoerceArgs(m, argc); + mir->emitSetContext(state, m); + if (!obj.traits->isInterface) + mir->emitCall(state, OP_callmethod, disp_id, argc, resultType); + else + mir->emitCall(state, OP_callinterface, m->iid(), argc, resultType); + } + state->pop_push(argc+1, resultType); + } + else + { + verifyFailed(kZeroDispIdError); + } + break; + } + + case OP_callproperty: + case OP_callproplex: + case OP_callpropvoid: + { + // stack in: obj [ns [name]] args + // stack out: result + const uint32 argc = imm30b; + Multiname multiname; + checkConstantMultiname(imm30, multiname); + checkStackMulti(argc+1, 1, &multiname); + + checkCallMultiname(opcode, &multiname); + + uint32 n = argc+1; // index of receiver + checkPropertyMultiname(n, multiname); + + Traits* t = state->peek(n).traits; + + if (mir) emitCheckNull(sp-(n-1)); + + Binding b = toplevel->getBinding(t, &multiname); + if (t) + t->resolveSignatures(toplevel); + + if (AvmCore::isMethodBinding(b)) + { + if (mir) + { + if (t == core->traits.math_ctraits) + { + b = findMathFunction(t, &multiname, b, argc); + } + else if (t == core->traits.string_itraits) + { + b = findStringFunction(t, &multiname, b, argc); + } + } + + int disp_id = AvmCore::bindingToMethodId(b); + AbstractFunction* m = t->getMethod(disp_id); + if (m->argcOk(argc)) + { + Traits* resultType = m->returnTraits(); + if (mir) + { + emitCoerceArgs(m, argc); + mir->emitSetContext(state, m); + if (!t->isInterface) + mir->emitCall(state, OP_callmethod, disp_id, argc, resultType); + else + mir->emitCall(state, OP_callinterface, m->iid(), argc, resultType); + } + state->pop_push(n, resultType); + if (opcode == OP_callpropvoid) + state->pop(); + break; + } + } + else if (mir && AvmCore::isSlotBinding(b) && argc == 1) + { + // is it int, number, or uint? + int slot_id = AvmCore::bindingToSlotId(b); + Traits* slotType = t->getSlotTraits(slot_id); + if (slotType == core->traits.int_ctraits) + { + emitCoerce(INT_TYPE, sp); + Value v = state->stackTop(); + state->pop(); + state->stackTop() = v; + if (opcode == OP_callpropvoid) + state->pop(); + break; + } + else if (slotType == core->traits.uint_ctraits) + { + emitCoerce(UINT_TYPE, sp); + Value v = state->stackTop(); + state->pop(); + state->stackTop() = v; + if (opcode == OP_callpropvoid) + state->pop(); + break; + } + else if (slotType == core->traits.number_ctraits) + { + emitCoerce(NUMBER_TYPE, sp); + Value v = state->stackTop(); + state->pop(); + state->stackTop() = v; + if (opcode == OP_callpropvoid) + state->pop(); + break; + } + else if (slotType == core->traits.boolean_ctraits) + { + emitCoerce(BOOLEAN_TYPE, sp); + Value v = state->stackTop(); + state->pop(); + state->stackTop() = v; + if (opcode == OP_callpropvoid) + state->pop(); + break; + } + else if (slotType == core->traits.string_ctraits) + { + emitToString(OP_convert_s, sp); + Value v = state->stackTop(); + state->pop(); + state->stackTop() = v; + if (opcode == OP_callpropvoid) + state->pop(); + break; + } + + // is this a user defined class? A(1+ args) means coerce to A + if (slotType && slotType->base == CLASS_TYPE && slotType->getNativeClassInfo() == NULL) + { + AvmAssert(slotType->itraits != NULL); + emitCoerce(slotType->itraits, state->sp()); + Value v = state->stackTop(); + state->pop(); + state->stackTop() = v; + if (opcode == OP_callpropvoid) + state->pop(); + break; + } + } + + #ifdef DEBUG_EARLY_BINDING + core->console << "verify callproperty " << t << " " << multiname->getName() << " from within " << info << "\n"; + #endif + + // don't know the binding now, resolve at runtime + if (mir) + { + mir->emitSetContext(state, NULL); + mir->emit(state, opcode, (int)&multiname, argc, NULL); + } + state->pop_push(n, NULL); + if (opcode == OP_callpropvoid) + state->pop(); + break; + } + + case OP_constructprop: + { + // stack in: obj [ns [name]] args + const uint32 argc = imm30b; + Multiname multiname; + checkConstantMultiname(imm30, multiname); + checkStackMulti(argc+1, 1, &multiname); + + checkCallMultiname(opcode, &multiname); + + uint32 n = argc+1; // index of receiver + checkPropertyMultiname(n, multiname); + + Value& obj = state->peek(n); // make sure object is there + if (mir) emitCheckNull(sp-(n-1)); + + #ifdef DEBUG_EARLY_BINDING + //core->console << "verify constructprop " << t << " " << multiname->getName() << " from within " << info << "\n"; + #endif + + Binding b = toplevel->getBinding(obj.traits, &multiname); + + if (AvmCore::isSlotBinding(b)) + { + int slot_id = AvmCore::bindingToSlotId(b); + Traits* ctraits = readBinding(obj.traits, b); + if (mir) mir->emit(state, OP_getslot, slot_id, sp-(n-1), ctraits); + obj.notNull = false; + obj.traits = ctraits; + Traits* itraits = ctraits ? ctraits->itraits : NULL; + if (mir) + { + mir->emitSetContext(state, NULL); + mir->emit(state, OP_construct, argc, 0, itraits); + } + state->pop_push(argc+1, itraits, true); + break; + } + + // don't know the binding now, resolve at runtime + if (mir) + { + mir->emitSetContext(state, NULL); + mir->emit(state, opcode, (int)&multiname, argc, NULL); + } + state->pop_push(n, NULL); + break; + } + + case OP_callsuper: + case OP_callsupervoid: + { + // stack in: obj [ns [name]] args + const uint32 argc = imm30b; + Multiname multiname; + checkConstantMultiname(imm30, multiname); + checkStackMulti(argc+1, 1, &multiname); + + if (multiname.isAttr()) + verifyFailed(kIllegalOpMultinameError, core->toErrorString(&multiname)); + + uint32 n = argc+1; // index of receiver + checkPropertyMultiname(n, multiname); + + if (mir) + emitCheckNull(sp-(n-1)); + Traits* base = emitCoerceSuper(sp-(n-1)); + + Binding b = toplevel->getBinding(base, &multiname); + if (AvmCore::isMethodBinding(b)) + { + int disp_id = AvmCore::bindingToMethodId(b); + AbstractFunction* m = base->getMethod(disp_id); + if( !m ) verifyFailed(kCorruptABCError); + emitCoerceArgs(m, argc); + Traits* resultType = m->returnTraits(); + if (mir) + { + mir->emitSetContext(state, m); + mir->emitCall(state, OP_callsuperid, disp_id, argc, resultType); + } + state->pop_push(n, resultType); + if (opcode == OP_callsupervoid) + state->pop(); + break; + } + + #ifdef DEBUG_EARLY_BINDING + core->console << "verify callsuper " << base << " " << multiname->getName() << " from within " << info << "\n"; + #endif + + // TODO optimize other cases + if (mir) + { + mir->emitSetContext(state, NULL); + mir->emit(state, opcode, (int)&multiname, argc, NULL); + } + state->pop_push(n, NULL); + if (opcode == OP_callsupervoid) + state->pop(); + break; + } + + case OP_getsuper: + { + // stack in: obj [ns [name]] + // stack out: value + Multiname multiname; + checkConstantMultiname(imm30, multiname); + checkStackMulti(1, 1, &multiname); + uint32 n=1; + checkPropertyMultiname(n, multiname); + + if (multiname.isAttr()) + verifyFailed(kIllegalOpMultinameError, core->toErrorString(&multiname)); + + int ptrIndex = sp-(n-1); + Traits* base = emitCoerceSuper(ptrIndex); + + Binding b = toplevel->getBinding(base, &multiname); + Traits* propType = readBinding(base, b); + + if (mir) + { + emitCheckNull(ptrIndex); + + if (AvmCore::isSlotBinding(b)) + { + int slot_id = AvmCore::bindingToSlotId(b); + if (mir) mir->emit(state, OP_getslot, slot_id, ptrIndex, propType); + state->pop_push(n, propType); + break; + } + + if (AvmCore::hasGetterBinding(b)) + { + // Invoke the getter + int disp_id = AvmCore::bindingToGetterId(b); + AbstractFunction *f = base->getMethod(disp_id); + AvmAssert(f != NULL); + emitCoerceArgs(f, 0); + Traits* resultType = f->returnTraits(); + if (mir) + { + mir->emitSetContext(state, f); + mir->emitCall(state, OP_callsuperid, disp_id, 0, resultType); + } + state->pop_push(n, resultType); + break; + } + } + + #ifdef DEBUG_EARLY_BINDING + core->console << "verify getsuper " << base << " " << multiname.getName() << " from within " << info << "\n"; + #endif + + if (mir) + { + mir->emitSetContext(state, NULL); + mir->emit(state, opcode, (int)&multiname, 0, propType); + } + state->pop_push(n, propType); + break; + } + + case OP_setsuper: + { + // stack in: obj [ns [name]] value + Multiname multiname; + checkConstantMultiname(imm30, multiname); + checkStackMulti(2, 0, &multiname); + uint32 n=2; + checkPropertyMultiname(n, multiname); + + if (multiname.isAttr()) + verifyFailed(kIllegalOpMultinameError, core->toErrorString(&multiname)); + + int ptrIndex = sp-(n-1); + Traits* base = emitCoerceSuper(ptrIndex); + + if (mir) + { + emitCheckNull(ptrIndex); + + Binding b = toplevel->getBinding(base, &multiname); + Traits* propType = readBinding(base, b); + + if (AvmCore::isSlotBinding(b)) + { + if (AvmCore::isVarBinding(b)) + { + int slot_id = AvmCore::bindingToSlotId(b); + emitCoerce(propType, sp); + mir->emit(state, OP_setslot, slot_id, ptrIndex); + } + // else, it's a readonly slot so ignore + state->pop(n); + break; + } + + if (AvmCore::isAccessorBinding(b)) + { + if (AvmCore::hasSetterBinding(b)) + { + // Invoke the setter + int disp_id = AvmCore::bindingToSetterId(b); + AbstractFunction *f = base->getMethod(disp_id); + AvmAssert(f != NULL); + emitCoerceArgs(f, 1); + mir->emitSetContext(state, f); + mir->emitCall(state, OP_callsuperid, disp_id, 1, f->returnTraits()); + } + // else, ignore write to readonly accessor + state->pop(n); + break; + } + + #ifdef DEBUG_EARLY_BINDING + core->console << "verify setsuper " << base << " " << multiname.getName() << " from within " << info << "\n"; + #endif + + mir->emitSetContext(state, NULL); + mir->emit(state, opcode, (int)&multiname); + } + + state->pop(n); + break; + } + + case OP_constructsuper: + { + // stack in: obj, args ... + const uint32 argc = imm30; + checkStack(argc+1, 0); + + int ptrIndex = sp-argc; + Traits* baseTraits = emitCoerceSuper(ptrIndex); // check receiver + + AbstractFunction *f = baseTraits->init; + AvmAssert(f != NULL); + + emitCoerceArgs(f, argc); + + if (mir) + { + mir->emitSetContext(state, f); + emitCheckNull(ptrIndex); + mir->emitCall(state, opcode, 0, argc, VOID_TYPE); + } + + state->pop(argc+1); + // this is a true void call, no result to push. + break; + } + + case OP_newobject: + { + uint32 argc = imm30; + checkStack(2*argc, 1); + int n=0; + while (argc-- > 0) + { + n += 2; + peekType(STRING_TYPE, n); // name; will call intern on it + } + if (mir) mir->emit(state, opcode, imm30, 0, OBJECT_TYPE); + state->pop_push(n, OBJECT_TYPE, true); + break; + } + + case OP_newarray: + { + const uint32 argc = imm30; + checkStack(argc, 1); + if (mir) mir->emit(state, opcode, argc, 0, ARRAY_TYPE); + state->pop_push(argc, ARRAY_TYPE, true); + break; + } + + case OP_pushscope: + { + checkStack(1,0); + Traits* scopeTraits = state->peek().traits; + + if (state->scopeDepth+1 <= max_scope) + { + if (scope->fullsize > (scope->size+state->scopeDepth)) + { + // extra constraints on type of pushscope allowed + Traits* requiredType = scope->scopes[scope->size+state->scopeDepth].traits; + if (!scopeTraits || !scopeTraits->containsInterface(requiredType)) + { + verifyFailed(kIllegalOperandTypeError, core->toErrorString(scopeTraits), core->toErrorString(requiredType)); + } + } + if (mir) + { + emitCheckNull(sp); + mir->emitCopy(state, sp, scopeBase+state->scopeDepth); + } + state->pop(); + state->setType(scopeBase+state->scopeDepth, scopeTraits, true, false); + state->scopeDepth++; + } + else + { + verifyFailed(kScopeStackOverflowError); + } + break; + } + + case OP_pushwith: + { + checkStack(1,0); + Traits* scopeTraits = state->peek().traits; + + if (state->scopeDepth+1 <= max_scope) + { + if (mir) + { + emitCheckNull(sp); + mir->emitCopy(state, sp, scopeBase+state->scopeDepth); + } + state->pop(); + state->setType(scopeBase+state->scopeDepth, scopeTraits, true, true); + + if (state->withBase == -1) + { + state->withBase = state->scopeDepth; + } + + state->scopeDepth++; + } + else + { + verifyFailed(kScopeStackOverflowError); + } + break; + } + + case OP_newactivation: + { + if (!(info->flags & AbstractFunction::NEED_ACTIVATION)) + { + verifyFailed(kInvalidNewActivationError); + } + //AvmAssert(!info->activationTraits->dynamic); + // [ed] does the vm really care if an activation object is dynamic or not? + checkStack(0, 1); + if (mir) mir->emit(state, opcode, 0, 0, info->activationTraits); + state->push(info->activationTraits, true); + break; + } + + case OP_newcatch: + { + const int index = imm30; + + /*if (!(info->flags & AbstractFunction::NEED_ACTIVATION)) + { + verifyFailed(kInvalidNewActivationError); + }*/ + + if (index < 0 || !info->exceptions || index >= info->exceptions->exception_count) + { + // todo better error msg + verifyFailed(kInvalidNewActivationError); + } + + ExceptionHandler* handler = &info->exceptions->exceptions[index]; + + checkStack(0, 1); + if (mir) mir->emit(state, opcode, 0, 0, handler->scopeTraits); + state->push(handler->scopeTraits, true); + break; + } + + case OP_popscope: + { + //checkStack(0,0) + // no code to emit + if (state->scopeDepth-- <= outer_depth) + { + verifyFailed(kScopeStackUnderflowError); + } + #ifdef DEBUGGER + if (mir) mir->emitKill(state, scopeBase + state->scopeDepth); + #endif + if (state->withBase >= state->scopeDepth) + { + state->withBase = -1; + } + break; + } + + case OP_getscopeobject: + { + checkStack(0,1); + int scope_index = imm8; + // local scope + if (scope_index < state->scopeDepth) + { + if (mir) mir->emitCopy(state, scopeBase+scope_index, sp+1); + // this will copy type and all attributes too + state->push(state->scopeValue(scope_index)); + } + else + { + verifyFailed(kGetScopeObjectBoundsError, core->toErrorString(imm8)); + } + break; + } + + case OP_getglobalscope: + { + checkStack(0,1); + emitGetGlobalScope(); + break; + } + + case OP_getglobalslot: + { + checkStack(0,1); + emitGetGlobalScope(); + emitGetSlot(imm30-1); + break; + } + + case OP_setglobalslot: + { + if (!state->scopeDepth && !scope->size) + { + verifyFailed(kNoGlobalScopeError); + } + Traits *globalTraits = scope->size > 0 ? scope->scopes[0].traits : state->scopeValue(0).traits; + checkStack(1,0); + checkEarlySlotBinding(globalTraits); + Traits* slotTraits = checkSlot(globalTraits, imm30-1); + if (mir) + { + emitCoerce(slotTraits, state->sp()); + mir->emit(state, opcode, imm30-1, sp, slotTraits); + } + state->pop(); + break; + } + + case OP_getslot: + { + checkStack(1,1); + emitGetSlot(imm30-1); + break; + } + + case OP_setslot: + { + checkStack(2,0); + emitSetSlot(imm30-1); + break; + } + + case OP_pop: + { + checkStack(1,0); + state->pop(); + break; + } + + case OP_dup: + { + checkStack(1, 2); + Value& v = state->peek(); + if (mir) mir->emitCopy(state, sp, sp+1); + state->push(v); + break; + } + + case OP_swap: + { + checkStack(2,2); + emitSwap(); + break; + } + + case OP_lessthan: + case OP_greaterthan: + case OP_lessequals: + case OP_greaterequals: + { + checkStack(2,1); + emitCompare(opcode); + break; + } + + case OP_equals: + case OP_strictequals: + case OP_instanceof: + case OP_in: + { + checkStack(2,1); + if (mir) mir->emit(state, opcode, 0, 0, BOOLEAN_TYPE); + state->pop_push(2, BOOLEAN_TYPE); + break; + } + + case OP_not: + checkStack(1,1); + if (mir) + { + emitCoerce(BOOLEAN_TYPE, sp); + mir->emit(state, opcode, sp); + } + state->pop_push(1, BOOLEAN_TYPE); + break; + + case OP_add: + { + checkStack(2,1); + Value& rhs = state->peek(1); + Value& lhs = state->peek(2); + Traits* lhst = lhs.traits; + Traits* rhst = rhs.traits; + if (lhst == STRING_TYPE && lhs.notNull || rhst == STRING_TYPE && rhs.notNull) + { + if (mir) + { + emitToString(OP_convert_s, sp-1); + emitToString(OP_convert_s, sp); + mir->emit(state, OP_concat, 0, 0, STRING_TYPE); + } + state->pop_push(2, STRING_TYPE, true); + } + else if (lhst && lhst->isNumeric && rhst && rhst->isNumeric) + { + if (mir) + { + emitCoerce(NUMBER_TYPE, sp-1); + emitCoerce(NUMBER_TYPE, sp); + mir->emit(state, OP_add_d, 0, 0, NUMBER_TYPE); + } + state->pop_push(2, NUMBER_TYPE); + } + else + { + if (mir) mir->emit(state, opcode, 0, 0, OBJECT_TYPE); + // dont know if it will return number or string, but neither will be null. + state->pop_push(2,OBJECT_TYPE, true); + } + break; + } + + case OP_modulo: + case OP_subtract: + case OP_divide: + case OP_multiply: + checkStack(2,1); + if (mir) + { + emitCoerce(NUMBER_TYPE, sp-1); // convert LHS to number + emitCoerce(NUMBER_TYPE, sp); // convert RHS to number + mir->emit(state, opcode, 0, 0, NUMBER_TYPE); + } + state->pop_push(2, NUMBER_TYPE); + break; + + case OP_negate: + checkStack(1,1); + emitCoerce(NUMBER_TYPE, sp); + if (mir) mir->emit(state, opcode, sp, 0, NUMBER_TYPE); + break; + + case OP_increment: + case OP_decrement: + checkStack(1,1); + emitCoerce(NUMBER_TYPE, sp); + if (mir) mir->emit(state, opcode, sp, opcode == OP_increment ? 1 : -1, NUMBER_TYPE); + break; + + case OP_increment_i: + case OP_decrement_i: + checkStack(1,1); + emitCoerce(INT_TYPE, sp); + if (mir) mir->emit(state, opcode, state->sp(), opcode == OP_increment_i ? 1 : -1, INT_TYPE); + break; + + case OP_add_i: + case OP_subtract_i: + case OP_multiply_i: + checkStack(2,1); + if (mir) + { + emitCoerce(INT_TYPE, sp-1); + emitCoerce(INT_TYPE, sp); + mir->emit(state, opcode, 0, 0, INT_TYPE); + } + state->pop_push(2, INT_TYPE); + break; + + case OP_negate_i: + checkStack(1,1); + emitCoerce(INT_TYPE, sp); + if (mir) mir->emit(state, opcode, sp, 0, INT_TYPE); + break; + + case OP_bitand: + case OP_bitor: + case OP_bitxor: + checkStack(2,1); + if (mir) + { + emitCoerce(INT_TYPE, sp-1); + emitCoerce(INT_TYPE, sp); + mir->emit(state, opcode, 0, 0, INT_TYPE); + } + state->pop_push(2, INT_TYPE); + break; + + // ISSUE do we care if shift amount is signed or not? we mask + // the result so maybe it doesn't matter. + // CN says see tests e11.7.2, 11.7.3, 9.6 + case OP_lshift: + case OP_rshift: + checkStack(2,1); + if (mir) + { + emitCoerce(INT_TYPE, sp-1); // lhs + emitCoerce(UINT_TYPE, sp); // rhs + mir->emit(state, opcode, 0, 0, INT_TYPE); + } + state->pop_push(2, INT_TYPE); + break; + + case OP_urshift: + checkStack(2,1); + if (mir) + { + emitCoerce(UINT_TYPE, sp-1); // lhs + emitCoerce(UINT_TYPE, sp); // rhs + mir->emit(state, opcode, 0, 0, UINT_TYPE); + } + state->pop_push(2, UINT_TYPE); + break; + + case OP_bitnot: + checkStack(1,1); + emitCoerce(INT_TYPE, sp); // lhs + if (mir) mir->emit(state, opcode, sp, 0, INT_TYPE); + break; + + case OP_typeof: + { + checkStack(1,1); + if (mir) mir->emit(state, opcode, sp, 0, STRING_TYPE); + state->pop_push(1, STRING_TYPE, true); + break; + } + + case OP_bkpt: + case OP_bkptline: + case OP_nop: + case OP_label: + case OP_debug: + break; + + case OP_debugline: + #ifdef DEBUGGER + // we actually do generate code for these, in debugger mode + if (mir) mir->emit(state, opcode, imm30); + #endif + break; + + case OP_nextvalue: + case OP_nextname: + { + checkStack(2,1); + peekType(INT_TYPE,1); + if (mir) mir->emit(state, opcode, 0, 0, NULL); + state->pop_push(2, NULL); + break; + } + + case OP_hasnext: + { + checkStack(2,1); + peekType(INT_TYPE,1); + if (mir) mir->emit(state, opcode, 0, 0, INT_TYPE); + state->pop_push(2, INT_TYPE); + break; + } + + case OP_hasnext2: + { + checkStack(0,1); + checkLocal(imm30); + Value& v = checkLocal(imm30b); + if (imm30 == imm30b) + { + verifyFailed(kInvalidHasNextError); + } + if (v.traits != INT_TYPE) + { + verifyFailed(kIllegalOperandTypeError, core->toErrorString(v.traits), core->toErrorString(INT_TYPE)); + } + if (mir) mir->emit(state, opcode, imm30, imm30b, BOOLEAN_TYPE); + state->setType(imm30, NULL, false); + state->push(BOOLEAN_TYPE); + break; + } + + case OP_abs_jump: + { + // first ensure the executing code isn't user code (only VM generated abc can use this op) + if(pool->isCodePointer(pc)) + { + verifyFailed(kIllegalOpcodeError, core->toErrorString(info), core->toErrorString(OP_abs_jump), core->toErrorString(pc-code_pos)); + } + + const byte* new_pc = (const byte*) imm30; + const byte* new_code_end = new_pc + imm30b; + + // now ensure target points to within pool's script buffer + if(!pool->isCodePointer(new_pc)) + { + verifyFailed(kIllegalOpcodeError, core->toErrorString(info), core->toErrorString(OP_abs_jump), core->toErrorString(pc-code_pos)); + } + + // FIXME: what other verification steps should we do here? + + pc = code_pos = new_pc; + code_end = new_code_end; + size = 0; + + //set mir abcStart/End + if(mir) { + mir->abcStart = pc; + mir->abcEnd = code_end; + //core->GetGC()->Free((void*) info->body_pos); + //info->body_pos = NULL; + } + + exceptions_pos = code_end; + code_length = code_end - pc; + parseExceptionHandlers(); + + break; + } + + default: + // size was nonzero, but no case handled the opcode. someone asleep at the wheel! + AvmAssert(false); + } + } + + if (!blockEnd) + { + verifyFailed(kCannotFallOffMethodError); + } + if (blockStates && actualCount != labelCount) + { + verifyFailed(kInvalidBranchTargetError); + } + + #ifdef AVMPLUS_INTERP + if (!mir || mir->overflow) + { + if (info->returnTraits() == NUMBER_TYPE) + info->implN = Interpreter::interpN; + else + info->impl32 = Interpreter::interp32; + } + else + #endif //AVMPLUS_INTERP + { + mir->epilogue(state); + } + + #ifdef FEATURE_BUFFER_GUARD + #ifdef AVMPLUS_MIR + growthGuard = NULL; + #endif + #endif + } + + void Verifier::checkPropertyMultiname(uint32 &depth, Multiname &multiname) + { + if (multiname.isRtname()) + { + if (multiname.isQName()) + { + // a.ns::@[name] or a.ns::[name] + peekType(STRING_TYPE, depth++); + } + else + { + // a.@[name] or a[name] + depth++; + } + } + + if (multiname.isRtns()) + { + peekType(NAMESPACE_TYPE, depth++); + } + } + + void Verifier::emitCompare(AbcOpcode opcode) + { + // if either the LHS or RHS is a number type, then we know + // it will be a numeric comparison. + + Value& rhs = state->peek(1); + Value& lhs = state->peek(2); + Traits *lhst = lhs.traits; + Traits *rhst = rhs.traits; + if (mir) + { + if (rhst && rhst->isNumeric && lhst && !lhst->isNumeric) + { + // convert lhs to Number + emitCoerce(NUMBER_TYPE, state->sp()-1); + } + else if (lhst && lhst->isNumeric && rhst && !rhst->isNumeric) + { + // promote rhs to Number + emitCoerce(NUMBER_TYPE, state->sp()); + } + mir->emit(state, opcode, 0, 0, BOOLEAN_TYPE); + } + state->pop_push(2, BOOLEAN_TYPE); + } + + void Verifier::emitFindProperty(AbcOpcode opcode, Multiname& multiname) + { + ScopeTypeChain* scope = info->declaringTraits->scope; + bool early = false; + if (multiname.isBinding()) + { + int index = scopeBase + state->scopeDepth - 1; + int base = scopeBase; + if (scope->size == 0) + { + // if scope->size = 0, then global is a local + // scope, and we dont want to early bind to global. + base++; + } + for (; index >= base; index--) + { + Value& v = state->value(index); + Binding b = toplevel->getBinding(v.traits, &multiname); + if (b != BIND_NONE) + { + if (mir) mir->emitCopy(state, index, state->sp()+1); + state->push(v); + early = true; + break; + } + else if (v.isWith) + { + // with scope could have dynamic property + break; + } + } + if (!early && index < base) + { + // look at captured scope types + for (index = scope->size-1; index > 0; index--) + { + Traits* t = scope->scopes[index].traits; + Binding b = toplevel->getBinding(t, &multiname); + if (b != BIND_NONE) + { + if (mir) mir->emitGetscope(state, index, state->sp()+1); + state->push(t, true); + early = true; + break; + } + else if (scope->scopes[index].isWith) + { + // with scope could have dynamic property + break; + } + } + if (!early && index <= 0) + { + // look at import table for a suitable script + AbstractFunction* script = (AbstractFunction*)pool->getNamedScript(&multiname); + if (script != (AbstractFunction*)BIND_NONE && script != (AbstractFunction*)BIND_AMBIGUOUS) + { + if (mir) + { + if (script == info) + { + // ISSUE what if there is an ambiguity at runtime? is VT too early to bind? + // its defined here, use getscopeobject 0 + if (scope->size > 0) + { + mir->emitGetscope(state, 0, state->sp()+1); + } + else + { + mir->emitCopy(state, scopeBase, state->sp()+1); + } + } + else + { + // found a single matching traits + mir->emit(state, OP_finddef, (int)&multiname, state->sp()+1, script->declaringTraits); + } + } + state->push(script->declaringTraits, true); + early = true; + return; + } + } + } + } + + if (!early) + { + uint32 n=1; + checkPropertyMultiname(n, multiname); + if (mir) mir->emit(state, opcode, (int)&multiname, 0, OBJECT_TYPE); + state->pop_push(n-1, OBJECT_TYPE, true); + } + } + + void Verifier::emitGetProperty(Multiname &multiname, int n) + { + Value& obj = state->peek(n); // object + + if (mir) emitCheckNull(state->sp()-(n-1)); + + Binding b = toplevel->getBinding(obj.traits, &multiname); + Traits* propType = readBinding(obj.traits, b); + + if (AvmCore::isSlotBinding(b)) + { + // early bind to slot + if (mir) mir->emit(state, OP_getslot, AvmCore::bindingToSlotId(b), state->sp(), propType); + state->pop_push(n, propType); + return; + } + + // Do early binding to accessors. + if (AvmCore::hasGetterBinding(b)) + { + // Invoke the getter + int disp_id = AvmCore::bindingToGetterId(b); + AbstractFunction *f = obj.traits->getMethod(disp_id); + AvmAssert(f != NULL); + if (mir) + { + emitCoerceArgs(f, 0); + mir->emitSetContext(state, f); + if (!obj.traits->isInterface) + mir->emitCall(state, OP_callmethod, disp_id, 0, propType); + else + mir->emitCall(state, OP_callinterface, f->iid(), 0, propType); + } + AvmAssert(propType == f->returnTraits()); + state->pop_push(n, propType); + return; + } + + #ifdef DEBUG_EARLY_BINDING + core->console << "verify getproperty " << obj.traits << " " << multiname->getName() << " from within " << info << "\n"; + #endif + + // default - do getproperty at runtime + + if (mir) + { + mir->emitSetContext(state, NULL); + mir->emit(state, OP_getproperty, (int)&multiname, 0, propType); + } + state->pop_push(n, propType); + } + + void Verifier::emitGetGlobalScope() + { + ScopeTypeChain* scope = info->declaringTraits->scope; + int captured_depth = scope->size; + if (captured_depth > 0) + { + // enclosing scope + if (mir) mir->emitGetscope(state, 0, state->sp()+1); + state->push(scope->scopes[0].traits, true); + } + else + { + // local scope + if (state->scopeDepth > 0) + { + if (mir) mir->emitCopy(state, scopeBase, state->sp()+1); + // this will copy type and all attributes too + state->push(state->scopeValue(0)); + } + else + { + #ifdef _DEBUG + if (pool->isBuiltin) + core->console << "getglobalscope >= depth (0) "<< state->scopeDepth << "\n"; + #endif + verifyFailed(kGetScopeObjectBoundsError, core->toErrorString(0)); + } + } + } + + void Verifier::emitGetSlot(int slot) + { + Value& obj = state->peek(); + checkEarlySlotBinding(obj.traits); + Traits* slotTraits = checkSlot(obj.traits, slot); + if (mir) + { + emitCheckNull(state->sp()); + mir->emit(state, OP_getslot, slot, state->sp(), slotTraits); + } + state->pop_push(1, slotTraits); + } + + void Verifier::emitSetSlot(int slot) + { + Value& obj = state->peek(2); // object + // if code isn't in pool, its our generated init function which we always + // allow early binding on + if(pool->isCodePointer(info->body_pos)) + checkEarlySlotBinding(obj.traits); + Traits* slotTraits = checkSlot(obj.traits, slot); + if (mir) + { + emitCoerce(slotTraits, state->sp()); + emitCheckNull(state->sp()-1); + mir->emit(state, OP_setslot, slot, state->sp()-1, slotTraits); + } + state->pop(2); + } + + void Verifier::emitSwap() + { + if (mir) mir->emitSwap(state, state->sp(), state->sp()-1); + Value v1 = state->peek(1); + Value v2 = state->peek(2); + state->pop(2); + state->push(v1); + state->push(v2); + } + + FrameState *Verifier::getFrameState(int targetpc) + { + const byte *target = code_pos + targetpc; + FrameState *targetState; + // get state for target address or create a new one if none exists + if (!blockStates) + { + blockStates = new (core->GetGC()) SortedIntMap(core->GetGC(), 128); + } + if ( (targetState = blockStates->get((int)target)) == 0 ) + { + targetState = newFrameState(); + targetState->pc = target - code_pos; + blockStates->put((int)target, targetState); + labelCount++; + } + return targetState; + } + + void Verifier::emitToString(AbcOpcode opcode, int i) + { + Traits *st = STRING_TYPE; + Value& value = state->value(i); + Traits *in = value.traits; + if (in != st || !value.notNull || opcode != OP_convert_s) + { + if (mir) + { + if (opcode == OP_convert_s && in && + (value.notNull || in->isNumeric || in == BOOLEAN_TYPE)) + { + mir->emitCoerce(state, i, st); + } + else + { + mir->emit(state, opcode, i, 0, st); + } + } + value.traits = st; + value.notNull = true; + } + } + + void Verifier::emitCheckNull(int i) + { + Value& value = state->value(i); + if (!value.notNull) + { + mir->emitCheckNull(state, i); + for (int j=0, n = frameSize; j < n; j++) + { + // also mark all copies of value.ins as non-null + Value &v2 = state->value(j); + if (v2.ins == value.ins) + v2.notNull = true; + } + } + } + + void Verifier::checkCallMultiname(AbcOpcode /*opcode*/, Multiname* name) const + { + if (name->isAttr()) + { + verifyFailed(kIllegalOpMultinameError, core->toErrorString(name)); + } + } + + Traits* Verifier::emitCoerceSuper(int index) + { + Traits* base = info->declaringTraits->base; + if (base != NULL) + { + if (mir) + emitCoerce(base, index); + } + else + { + verifyFailed(kIllegalSuperCallError, core->toErrorString(info)); + } + return base; + } + + void Verifier::emitCoerce(Traits* target, int index) + { + Value &v = state->value(index); + Traits* rhs = v.traits; + if (mir && (!canAssign(target, rhs) || !Traits::isMachineCompatible(target,rhs))) + mir->emitCoerce(state, index, target); + state->setType(index, target, v.notNull); + } + + Traits* Verifier::peekType(Traits* requiredType, int n) + { + Traits* t = state->peek(n).traits; + if (t != requiredType) + { + verifyFailed(kIllegalOperandTypeError, core->toErrorString(t), core->toErrorString(requiredType)); + } + return t; + } + + void Verifier::checkEarlySlotBinding(Traits* t) + { + bool slotAllow; + pool->allowEarlyBinding(t, slotAllow); + if (!slotAllow) + { + // illegal disp_id or slot_id access since dispatch table layout and instance layout + // are not known at compile time + verifyFailed(kIllegalEarlyBindingError, core->toErrorString(t)); + } + } + + void Verifier::checkEarlyMethodBinding(Traits* t) + { + bool slotAllow; + pool->allowEarlyBinding(t, slotAllow); + if (true) + { + // illegal disp_id or slot_id access since dispatch table layout and instance layout + // are not known at compile time + verifyFailed(kIllegalEarlyBindingError, core->toErrorString(t)); + } + } + + void Verifier::emitCoerceArgs(AbstractFunction* m, int argc) + { + if (!m->argcOk(argc)) + { + verifyFailed(kWrongArgumentCountError, core->toErrorString(m), core->toErrorString(m->requiredParamCount()), core->toErrorString(argc)); + } + + m->resolveSignature(toplevel); + + // coerce parameter types + int n=1; + while (argc > 0) + { + if (mir) + { + Traits* target = (argc <= m->param_count) ? m->paramTraits(argc) : NULL; + emitCoerce(target, state->sp()-(n-1)); + } + argc--; + n++; + } + + // coerce receiver type + if (mir) + emitCoerce(m->paramTraits(0), state->sp()-(n-1)); + } + + bool Verifier::canAssign(Traits* lhs, Traits* rhs) const + { + if (!Traits::isMachineCompatible(lhs,rhs)) + { + // no machine type is compatible with any other + return false; + } + + if (!lhs) + return true; + + // type on right must be same class or subclass of type on left. + Traits* t = rhs; + while (t != lhs && t != NULL) + t = t->base; + return t != NULL; + } + + void Verifier::checkStack(uint32 pop, uint32 push) + { + if (uint32(state->stackDepth) < pop) + verifyFailed(kStackUnderflowError); + if (state->stackDepth-pop+push > uint32(max_stack)) + verifyFailed(kStackOverflowError); + } + + void Verifier::checkStackMulti(uint32 pop, uint32 push, Multiname* m) + { + if (m->isRtname()) pop++; + if (m->isRtns()) pop++; + checkStack(pop,push); + } + + Value& Verifier::checkLocal(int local) + { + if (local < 0 || local >= local_count) + verifyFailed(kInvalidRegisterError, core->toErrorString(local)); + return state->value(local); + } + + Traits* Verifier::checkSlot(Traits *traits, int imm30) + { + uint32 slot = imm30; + if (!traits || slot >= traits->slotCount) + { + verifyFailed(kSlotExceedsCountError, core->toErrorString(slot+1), core->toErrorString(traits?traits->slotCount:0), core->toErrorString(traits)); + } + traits->resolveSignatures(toplevel); + + return traits->getSlotTraits(slot); + } + + Traits* Verifier::readBinding(Traits* traits, Binding b) + { + if (traits) + traits->resolveSignatures(toplevel); + switch (b&7) + { + default: + AvmAssert(false); // internal error - illegal binding type + case BIND_GET: + case BIND_GETSET: + { + int m = AvmCore::bindingToGetterId(b); + AbstractFunction *f = traits->getMethod(m); + return f->returnTraits(); + } + case BIND_SET: + // TODO lookup type here. get/set must have same type. + case BIND_NONE: + // dont know what this is + // fall through + case BIND_METHOD: + // extracted method or dynamic data, don't know which + return NULL; + case BIND_VAR: + case BIND_CONST: + return traits->getSlotTraits(AvmCore::bindingToSlotId(b)); + } + } + + AbstractFunction* Verifier::checkMethodInfo(uint32 id) + { + if (id >= pool->methodCount) + { + verifyFailed(kMethodInfoExceedsCountError, core->toErrorString(id), core->toErrorString(pool->methodCount)); + return NULL; + } + else + { + return pool->methods[id]; + } + } + + Traits* Verifier::checkClassInfo(uint32 id) + { + if (id >= pool->classCount) + { + verifyFailed(kClassInfoExceedsCountError, core->toErrorString(id), core->toErrorString(pool->classCount)); + return NULL; + } + else + { + return pool->cinits[id]->declaringTraits; + } + } + + Traits* Verifier::checkTypeName(uint32 index) + { + Multiname name; + checkConstantMultiname(index, name); // CONSTANT_Multiname + Traits *t = pool->getTraits(&name, toplevel); + if (t == NULL) + verifyFailed(kClassNotFoundError, core->toErrorString(&name)); + return t; + } + + AbstractFunction* Verifier::checkDispId(Traits* traits, uint32 disp_id) + { + if (disp_id > traits->methodCount) + { + verifyFailed(kDispIdExceedsCountError, core->toErrorString(disp_id), core->toErrorString(traits->methodCount), core->toErrorString(traits)); + return NULL; + } + else + { + if (!traits->getMethod(disp_id)) + { + verifyFailed(kDispIdUndefinedError, core->toErrorString(disp_id), core->toErrorString(traits)); + } + return traits->getMethod(disp_id); + } + } + + void Verifier::verifyFailed(int errorID, Stringp arg1, Stringp arg2, Stringp arg3) const + { +#ifdef FEATURE_BUFFER_GUARD +#ifdef AVMPLUS_MIR + // Make sure the GrowthGuard is unregistered + if (growthGuard) + { + growthGuard->~GrowthGuard(); + } +#endif +#endif + +#ifdef AVMPLUS_VERBOSE + if (!secondTry && !verbose) + { + // capture the verify trace even if verbose is false. + Verifier v2(info, toplevel, true); + v2.verbose = true; + v2.verify(NULL); + } +#endif + core->throwErrorV(toplevel->verifyErrorClass(), errorID, arg1, arg2, arg3); + + // This function throws, and should never return. + AvmAssert(false); + } + + void Verifier::checkTarget(const byte* target) + { + FrameState *targetState = getFrameState(target-code_pos); + AvmAssert(targetState != 0); + if (!targetState->initialized) + { + //if (verbose) + // core->console << "merge first target=" << targetState->pc << "\n"; + // first time visiting target block + targetState->init(state); + targetState->initialized = true; + + // if this label is a loop header then clear the notNull flag for + // any state entry that might become null in the loop body. this + // prevents us from needing to re-verify the loop, at a cost of a + // few more null pointer checks. + if (targetState->targetOfBackwardsBranch) + { + // null check on all locals + for (int i=0, n=local_count; i < n; i++) + targetState->value(i).notNull = false; + + // and all stack entries + for (int i=stackBase, n=i+state->stackDepth; i < n; i++) + targetState->value(i).notNull = false; + + // we don't have to clear notNull on scope stack entries because we + // check for null in op_pushscope/pushwith + } + + //if (verbose) + // showState(targetState, targetState->pc+code_pos, false); + } + else + { + /*if (verbose) + { + core->console << "merge current=" << state->pc << "\n"; + showState(state, code_pos+state->pc, false); + core->console << "merge target=" << targetState->pc << "\n"; + showState(targetState, code_pos+targetState->pc, false); + }*/ + + // check matching stack depth + if (state->stackDepth != targetState->stackDepth) + { + verifyFailed(kStackDepthUnbalancedError, core->toErrorString((int)state->stackDepth), core->toErrorString((int)targetState->stackDepth)); + } + + // check matching scope chain depth + if (state->scopeDepth != targetState->scopeDepth) + { + verifyFailed(kScopeDepthUnbalancedError, core->toErrorString(state->scopeDepth), core->toErrorString(targetState->scopeDepth)); + } + + // merge types of locals, scopes, and operands + // ISSUE merge should preserve common interfaces even when + // common supertype does not: + // class A implements I {} + // class B implements I {} + // var i:I = b ? new A : new B + + const int scopeTop = scopeBase + targetState->scopeDepth; + const int stackTop = stackBase + targetState->stackDepth; + Value* targetValues = &targetState->value(0); + Value* curValues = &state->value(0); + for (int i=0, n=stackTop; i < n; i++) + { + if (i >= scopeTop && i < stackBase) + { + // invalid location, ignore it. + continue; + } + + Value& curValue = curValues[i]; + Value& targetValue = targetValues[i]; + if (curValue.killed || targetValue.killed) + { + // this reg has been killed in one or both states; + // ignore it. + continue; + } + + Traits* t1 = targetValue.traits; + Traits* t2 = curValue.traits; + bool isWith = curValue.isWith; + + if (isWith != targetValue.isWith) + { + // failure: pushwith on one edge, pushscope on other edge, cannot merge. + verifyFailed(kCannotMergeTypesError, core->toErrorString(t1), core->toErrorString(t2)); + } + + Traits* t3 = (t1 == t2) ? t1 : findCommonBase(t1, t2); + + #ifdef AVMPLUS_MIR + if (mir) + mir->merge(curValue, targetValue); + #endif // AVMPLUS_MIR + + bool notNull = targetValue.notNull && curValue.notNull; + if (targetState->pc < state->pc && + (t3 != t1 || t1 && !t1->isNumeric && notNull != targetValue.notNull)) + { + // failure: merge on back-edge + verifyFailed(kCannotMergeTypesError, core->toErrorString(t1), core->toErrorString(t3)); + } + + // if we're targeting a label we can't propagate notNull since we don't yet know + // the state of all the other possible branches. Another possible fix would be to + // enforce a null check at each branch to the target. + if (targetState->targetOfBackwardsBranch) + notNull = false; + + targetState->setType(i, t3, notNull, isWith); + } + + /*if (verbose) { + core->console << "after merge\n"; + showState(targetState, code_pos+targetState->pc, false); + }*/ + } + } + + /** + * find common base class of these two types + */ + Traits* Verifier::findCommonBase(Traits* t1, Traits* t2) + { + AvmAssert(t1 != t2); + + if (t1 == NULL) { + // assume t1 is always non-null + Traits *temp = t1; + t1 = t2; + t2 = temp; + } + + if (!Traits::isMachineCompatible(t1,t2)) + { + // these two types are incompatible machine types that require + // coersions before the join node. + verifyFailed(kCannotMergeTypesError, core->toErrorString(t1), core->toErrorString(t2)); + } + + if (t1 == NULL_TYPE && t2 && !t2->isMachineType) + { + // okay to merge null with pointer type + return t2; + } + if (t2 == NULL_TYPE && t1 && !t1->isMachineType) + { + // okay to merge null with pointer type + return t1; + } + + // all commonBase flags start out false. set the cb bits on + // t1 and its ancestors. + Traits* t = t1; + do t->commonBase = true; + while ((t = t->base) != NULL); + + // now search t2 and its ancestors looking for the first cb=true + t = t2; + while (t != NULL && !t->commonBase) + t = t->base; + + Traits* common = t; + + // finally reset the cb bits to false for next time + t = t1; + do t->commonBase = false; + while ((t = t->base) != NULL); + + // found common base, possibly * + if (!Traits::isMachineCompatible(t1,common) || !Traits::isMachineCompatible(t2,common)) + { + // these two types are incompatible types that require + // coersions before the join node. + verifyFailed(kCannotMergeTypesError, core->toErrorString(t1), core->toErrorString(t2)); + } + return common; + } + + Atom Verifier::checkCpoolOperand(uint32 index, int requiredAtomType) + { + switch( requiredAtomType ) + { + case kStringType: + if( !index || index >= pool->constantStringCount ) + { + verifyFailed(kCpoolIndexRangeError, core->toErrorString(index), core->toErrorString(pool->constantStringCount)); + return undefinedAtom; + } + return pool->cpool_string[index]->atom(); + + case kObjectType: + if( !index || index >= pool->constantMnCount ) + { + verifyFailed(kCpoolIndexRangeError, core->toErrorString(index), core->toErrorString(pool->constantMnCount)); + return undefinedAtom; + } + return pool->cpool_mn[index]; + + default: + verifyFailed(kCpoolEntryWrongTypeError, core->toErrorString(index)); + return undefinedAtom; + } + } + + void Verifier::checkConstantMultiname(uint32 index, Multiname& m) + { + checkCpoolOperand(index, kObjectType); + pool->parseMultiname(m, index); + } + + Binding Verifier::findMathFunction(Traits* math, Multiname* multiname, Binding b, int argc) + { + Stringp newname = core->internString(core->concatStrings(core->constantString("_"), multiname->getName())); + Binding newb = math->getName(newname); + if (AvmCore::isMethodBinding(newb)) + { + int disp_id = AvmCore::bindingToMethodId(newb); + AbstractFunction* newf = math->getMethod(disp_id); + if (argc == newf->param_count) + { + for (int i=state->stackDepth-argc, n=state->stackDepth; i < n; i++) + { + Traits* t = state->stackValue(i).traits; + if (t != NUMBER_TYPE && t != INT_TYPE && t != UINT_TYPE) + return b; + } + b = newb; + } + } + return b; + } + + Binding Verifier::findStringFunction(Traits* str, Multiname* multiname, Binding b, int argc) + { + Stringp newname = core->internString(core->concatStrings(core->constantString("_"), multiname->getName())); + Binding newb = str->getName(newname); + if (AvmCore::isMethodBinding(newb)) + { + int disp_id = AvmCore::bindingToMethodId(newb); + AbstractFunction* newf = str->getMethod(disp_id); + // We have all required parameters but not more than required. + if ((argc >= (newf->param_count - newf->optional_count)) && (argc <= newf->param_count)) + { + for (int i=state->stackDepth-argc, k = 1, n=state->stackDepth; i < n; i++, k++) + { + Traits* t = state->stackValue(i).traits; + if (t != newf->paramTraits(k)) + return b; + } + b = newb; + } + } + return b; + } + + void Verifier::parseExceptionHandlers() + { + const byte* pos = exceptions_pos; + int exception_count = toplevel->readU30(pos); + + if (exception_count != 0) + { + size_t extra = sizeof(ExceptionHandler)*(exception_count-1); + ExceptionHandlerTable* table = new (core->GetGC(), extra) ExceptionHandlerTable(exception_count); + ExceptionHandler *handler = table->exceptions; + for (int i=0; ifrom = toplevel->readU30(pos); + handler->to = toplevel->readU30(pos); + handler->target = toplevel->readU30(pos); + + int type_index = toplevel->readU30(pos); + Traits* t = type_index ? checkTypeName(type_index) : NULL; + + Multiname qn; + int name_index = (pool->version != (46<<16|15)) ? toplevel->readU30(pos) : 0; + if (name_index != 0) + { + pool->parseMultiname(qn, name_index); + } + + #ifdef AVMPLUS_VERBOSE + if (verbose) + { + core->console << " exception["<console << "\n"; + } + #endif + + if (handler->from < 0 || + handler->to < handler->from || + handler->target < handler->to || + handler->target > code_length) + { + // illegal range in handler record + verifyFailed(kIllegalExceptionHandlerError); + } + + // handler->traits = t + WB(core->GetGC(), table, &handler->traits, t); + + Traits* scopeTraits; + + if (name_index == 0) + { + scopeTraits = OBJECT_TYPE; + } + else + { + scopeTraits = core->newTraits(NULL, 1, 0, sizeof(ScriptObject)); + scopeTraits->pool = pool; + scopeTraits->final = true; + scopeTraits->defineSlot(qn.getName(), qn.getNamespace(), 0, BIND_VAR); + scopeTraits->slotCount = 1; + scopeTraits->initTables(); + AbcGen gen(core->GetGC()); + scopeTraits->setSlotInfo(0, 0, toplevel, t, scopeTraits->sizeofInstance, CPoolKind(0), gen); + scopeTraits->setTotalSize(scopeTraits->sizeofInstance + 16); + scopeTraits->linked = true; + } + + // handler->scopeTraits = scopeTraits + WB(core->GetGC(), table, &handler->scopeTraits, scopeTraits); + + + getFrameState(handler->target)->targetOfBackwardsBranch = true; + + handler++; + } + + //info->exceptions = table; + WB(core->GetGC(), info, &info->exceptions, table); + } + else + { + info->exceptions = NULL; + } + } + +#ifdef AVMPLUS_VERBOSE + /** + * display contents of current stack frame only. + */ + void Verifier::showState(FrameState *state, const byte* pc, bool unreachable) + { + // stack + core->console << " stack:"; + for (int i=0, n=state->stackDepth; i < n; i++) { + core->console << " "; + printValue(state->stackValue(i)); + } + core->console << '\n'; + + // scope chain + core->console << " scope: "; + if (info->declaringTraits->scope && info->declaringTraits->scope->size > 0) + { + core->console << "["; + for (int i=0, n=info->declaringTraits->scope->size; i < n; i++) + { + Value v; + v.traits = info->declaringTraits->scope->scopes[i].traits; + v.isWith = info->declaringTraits->scope->scopes[i].isWith; + v.killed = false; + v.notNull = true; + #ifdef AVMPLUS_MIR + v.ins = 0; + v.stored = false; + #endif + printValue(v); + if (i+1 < n) + core->console << " "; + } + core->console << "] "; + } + for (int i=0, n=state->scopeDepth; i < n; i++) + { + printValue(state->scopeValue(i)); + core->console << " "; + } + core->console << '\n'; + + // locals + core->console << " locals: "; + for (int i=0, n=scopeBase; i < n; i++) { + printValue(state->value(i)); + core->console << " "; + } + core->console << '\n'; + + // opcode + if (unreachable) + core->console << "- "; + else + core->console << " "; + core->console << state->pc << ':'; + core->formatOpcode(core->console, pc, (AbcOpcode)*pc, state->pc, pool); + core->console << '\n'; + } + + void Verifier::printValue(Value& v) + { + Traits* t = v.traits; + if (!t) + { + core->console << "*"; + } + else + { + core->console << t->format(core); + if (!t->isNumeric && !v.notNull && t != BOOLEAN_TYPE && t != NULL_TYPE) + core->console << "?"; + } +#ifdef AVMPLUS_MIR + if (mir && v.ins) + mir->formatOperand(core->console, v.ins, mir->ipStart); +#endif + } + +#endif /* AVMPLUS_VERBOSE */ + + FrameState* Verifier::newFrameState() + { + size_t extra = (frameSize-1)*sizeof(Value); + return new (core->GetGC(), extra) FrameState(this); + } +} diff --git a/mozilla/js/tamarin/core/Verifier.h b/mozilla/js/tamarin/core/Verifier.h new file mode 100644 index 00000000000..51af6587273 --- /dev/null +++ b/mozilla/js/tamarin/core/Verifier.h @@ -0,0 +1,158 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_Verifier__ +#define __avmplus_Verifier__ + + +namespace avmplus +{ + /** + * We are simulating the effect that each instruction has on the stack + * frame state. Type information originates from the following sources: + * - formal parameter types of the curent method + * - traits of objects we manipulate + * - types of slots in traits + * - return values of methods we call + * - push (constant) instructions + * - check (cast) instructions + * - results of opcodes that produce known types + * + * When we have branch instructions, we merge the frame state at the end + * of the block with the starting frame state of the target block. + * incompatible frame states cause verify errors. + */ + + class Verifier + { + public: + + #ifdef AVMPLUS_MIR + CodegenMIR *mir; + #endif // AVMPLUS_MIR + + AvmCore *core; + SortedIntMap* blockStates; + FrameState *state; + + int max_scope; + int max_stack; + int stackBase; // same as info->local_count + max_scope + + union { + int scopeBase; + int local_count; + }; + + int frameSize; + int code_length; + const byte* code_pos; + const byte* exceptions_pos; + + MethodInfo *info; + PoolObject *pool; + int labelCount; + + Verifier(MethodInfo *info, Toplevel* toplevel +#ifdef AVMPLUS_VERBOSE + , bool secondTry=false +#endif + ); + ~Verifier(); + + /** + * Verifies the method specified by info. If verification fails, + * an exception will be thrown, of type VerifyError. + * @param info the method to verify + */ + void verify(CodegenMIR *mir); + FrameState* getFrameState(int targetpc); + + private: + Toplevel* toplevel; + #ifdef FEATURE_BUFFER_GUARD + #ifdef AVMPLUS_MIR + GrowthGuard *growthGuard; + #endif + #endif + + FrameState* newFrameState(); + Value& checkLocal(int local); + AbstractFunction* checkDispId(Traits* traits, uint32 disp_id); + AbstractFunction* checkMethodInfo(uint32 method_id); + Traits* checkClassInfo(uint32 class_id); + Traits* checkTypeName(uint32 name_index); + void verifyFailed(int errorID, Stringp a1=0, Stringp a2=0, Stringp a3=0) const; + void checkTarget(const byte* target); + Atom checkCpoolOperand(uint32 index, int requiredAtomType); + void checkConstantMultiname(uint32 index, Multiname &m); + bool canAssign(Traits* lhs, Traits* rhs) const; + Traits* checkSlot(Traits* traits, int slot_id); + Traits* findCommonBase(Traits* t1, Traits* t2); + void emitCoerceArgs(AbstractFunction* m, int argc); + void printValue(Value& v); + Traits* readBinding(Traits* traits, Binding b); + void checkEarlySlotBinding(Traits* traits); + void checkEarlyMethodBinding(Traits* traits); + Traits* peekType(Traits* requiredType, int n=1); + Traits* emitCoerceSuper(int index); + void checkCallMultiname(AbcOpcode opcode, Multiname* multiname) const; + void checkPropertyMultiname(uint32 &depth, Multiname& multiname); + void parseExceptionHandlers(); + void checkStack(uint32 pop, uint32 push); + void checkStackMulti(uint32 pop, uint32 push, Multiname* m); + + void emitCoerce(Traits* target, int i); + void emitToString(AbcOpcode opcode, int index); + void emitCheckNull(int index); + void emitCompare(AbcOpcode opcode); + void emitFindProperty(AbcOpcode opcode, Multiname& multiname); + void emitGetProperty(Multiname &multiname, int n); + void emitGetGlobalScope(); + void emitGetSlot(int slot); + void emitSetSlot(int slot); + void emitSwap(); + + Binding findMathFunction(Traits* math, Multiname* name, Binding b, int argc); + + Binding findStringFunction(Traits* string, Multiname* name, Binding b, int argc); + + #ifdef AVMPLUS_VERBOSE + public: + bool verbose; + bool secondTry; + void showState(FrameState* state, const byte* pc, bool unreachable); + void verifyWarn(int errorId, ...); + #endif + }; +} + +#endif /* __avmplus_Verifier__ */ diff --git a/mozilla/js/tamarin/core/XML.as b/mozilla/js/tamarin/core/XML.as new file mode 100644 index 00000000000..d9fab5e954e --- /dev/null +++ b/mozilla/js/tamarin/core/XML.as @@ -0,0 +1,699 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +package { + +// E4X definitions. based on ECMA-357 + +// {DontEnum} length=1 +public native function isXMLName(str=void 0):Boolean + +public final dynamic class XML extends Object +{ + // { ReadOnly, DontDelete, DontEnum } + public static const length = 1 + + // { DontDelete, DontEnum } + public native static function get ignoreComments():Boolean + public native static function set ignoreComments(newIgnore:Boolean) + + // { DontDelete, DontEnum } + public native static function get ignoreProcessingInstructions():Boolean + public native static function set ignoreProcessingInstructions(newIgnore:Boolean) + + // { DontDelete, DontEnum } + public native static function get ignoreWhitespace():Boolean + public native static function set ignoreWhitespace(newIgnore:Boolean) + + // { DontDelete, DontEnum } + public native static function get prettyPrinting():Boolean + public native static function set prettyPrinting(newPretty:Boolean) + + // { DontDelete, DontEnum } + public native static function get prettyIndent():int + public native static function set prettyIndent(newIndent:int) + + AS3 static function settings ():Object + { + return { + ignoreComments: XML.ignoreComments, + ignoreProcessingInstructions: XML.ignoreProcessingInstructions, + ignoreWhitespace: XML.ignoreWhitespace, + prettyPrinting: XML.prettyPrinting, + prettyIndent: XML.prettyIndent + }; + } + + AS3 static function setSettings(o:Object=null):void + { + if (o == null) // undefined or null + { + XML.ignoreComments = true; + XML.ignoreProcessingInstructions = true; + XML.ignoreWhitespace = true; + XML.prettyPrinting = true; + XML.prettyIndent = 2; + return; + } + + if (("ignoreComments" in o) && (o.ignoreComments is Boolean)) + XML.ignoreComments = o.ignoreComments; + if (("ignoreProcessingInstructions" in o) && (o.ignoreProcessingInstructions is Boolean)) + XML.ignoreProcessingInstructions = o.ignoreProcessingInstructions; + if (("ignoreWhitespace" in o) && (o.ignoreWhitespace is Boolean)) + XML.ignoreWhitespace = o.ignoreWhitespace; + if (("prettyPrinting" in o) && (o.prettyPrinting is Boolean)) + XML.prettyPrinting = o.prettyPrinting; + if (("prettyIndent" in o) && (o.prettyIndent is Number)) + XML.prettyIndent = o.prettyIndent; + } + + AS3 static function defaultSettings():Object + { + return { + ignoreComments: true, + ignoreProcessingInstructions: true, + ignoreWhitespace: true, + prettyPrinting: true, + prettyIndent: 2 + }; + } + + // override (hide) functions from object + // ISSUE why do we override valueOf? it does the same thing as the one in Object + + AS3 native function toString ():String + + // override AS3 methods from Object + override AS3 native function hasOwnProperty (P=void 0):Boolean + override AS3 native function propertyIsEnumerable (P=void 0):Boolean + + // XML functions + AS3 native function addNamespace (ns):XML; + AS3 native function appendChild (child):XML; + AS3 native function attribute (arg):XMLList; + AS3 native function attributes():XMLList; + AS3 native function child (propertyName):XMLList; + AS3 native function childIndex():int; + AS3 native function children ():XMLList; + AS3 native function comments ():XMLList; + AS3 native function contains (value):Boolean; + AS3 native function copy ():XML; + AS3 native function descendants (name="*"):XMLList; // name is optional + AS3 native function elements (name="*"):XMLList; // name is optional + AS3 native function hasComplexContent ():Boolean; + AS3 native function hasSimpleContent ():Boolean; + AS3 native function inScopeNamespaces ():Array; + AS3 native function insertChildAfter (child1, child2):*; // undefined or XML + AS3 native function insertChildBefore (child1, child2):*; // undefined or XML + AS3 function length ():int { return 1; } + AS3 native function localName ():Object; // null or String; + AS3 native function name ():Object; // null or String; + AS3 native function namespace (prefix=null):*; // prefix is optional + AS3 native function namespaceDeclarations ():Array; + AS3 native function nodeKind ():String; + AS3 native function normalize ():XML; + AS3 native function parent ():*; // undefined or String + AS3 native function processingInstructions (name="*"):XMLList; // name is optional + AS3 native function prependChild (value):XML; + AS3 native function removeNamespace (ns):XML; + AS3 native function replace (propertyName, value):XML; + AS3 native function setChildren (value):XML; + AS3 native function setLocalName (name):void; + AS3 native function setName (name):void; + AS3 native function setNamespace (ns):void; + AS3 native function text ():XMLList; + AS3 native function toXMLString ():String; + + // notification extensions + AS3 native function notification():Function; + AS3 native function setNotification(f:Function); + + // Dummy constructor function - This is neccessary so the compiler can do arg # checking for the ctor in strict mode + // The code for the actual ctor is in XMLClass::construct in the avmplus + public function XML(value = void 0) + {} + // + // dynamic, proto-hackable properties from E-357 + // + + XML.settings = function():Object { + return AS3::settings() + } + XML.setSettings = function(o=undefined):void { + AS3::setSettings(o) + } + XML.defaultSettings = function():Object { + return AS3::defaultSettings() + } + + AS3 function valueOf():XML { return this } + + // this is what rhino appears to do + prototype.valueOf = Object.prototype.valueOf + + prototype.hasOwnProperty = function(P=void 0):Boolean { + if (this === prototype) + { + return this.AS3::hasOwnProperty(P); + } + var x:XML = this + return x.AS3::hasOwnProperty(P) + } + + prototype.propertyIsEnumerable = function(P=void 0):Boolean { + if (this === prototype) + { + return this.AS3::propertyIsEnumerable(P); + } + var x:XML = this + return x.AS3::propertyIsEnumerable(P) + } + + prototype.toString = function():String { + if (this === prototype) + { + return ""; + } + var x:XML = this + return x.AS3::toString() + } + + prototype.addNamespace = function(ns):XML { + var x:XML = this + return x.AS3::addNamespace(ns) + } + + prototype.appendChild = function(child):XML { + var x:XML = this + return x.AS3::appendChild(child) + } + + prototype.attribute = function(arg):XMLList { + var x:XML = this + return x.AS3::attribute(arg) + } + + prototype.attributes = function():XMLList { + var x:XML = this + return x.AS3::attributes() + } + + prototype.child = function(propertyName):XMLList { + var x:XML = this + return x.AS3::child(propertyName) + } + + prototype.childIndex = function():int { + var x:XML = this + return x.AS3::childIndex() + } + + prototype.children = function():XMLList { + var x:XML = this + return x.AS3::children() + } + + prototype.comments = function():XMLList { + var x:XML = this + return x.AS3::comments() + } + + prototype.contains = function(value):Boolean { + var x:XML = this + return x.AS3::contains(value) + } + + prototype.copy = function():XML { + var x:XML = this + return x.AS3::copy() + } + + prototype.descendants = function(name="*"):XMLList { + var x:XML = this + return x.AS3::descendants(name) + } + + prototype.elements = function(name="*"):XMLList { + var x:XML = this + return x.AS3::elements(name) + } + + prototype.hasComplexContent = function():Boolean { + var x:XML = this + return x.AS3::hasComplexContent() + } + + prototype.hasSimpleContent = function():Boolean { + var x:XML = this + return x.AS3::hasSimpleContent() + } + + prototype.inScopeNamespaces = function():Array { + var x:XML = this + return x.AS3::inScopeNamespaces() + } + + prototype.insertChildAfter = function(child1, child2):* { + var x:XML = this + return x.AS3::insertChildAfter(child1,child2) + } + + prototype.insertChildBefore = function(child1, child2):* { + var x:XML = this + return x.AS3::insertChildBefore(child1,child2) + } + + prototype.length = function():int { + var x:XML = this + return x.AS3::length() + } + + prototype.localName = function():Object { + var x:XML = this + return x.AS3::localName() + } + + prototype.name = function():Object { + var x:XML = this + return x.AS3::name() + } + + prototype.namespace = function(prefix=null):* { + var x:XML = this + return x.AS3::namespace.apply(x, arguments) + } + + prototype.namespaceDeclarations = function():Array { + var x:XML = this + return x.AS3::namespaceDeclarations() + } + + prototype.nodeKind = function():String { + var x:XML = this + return x.AS3::nodeKind() + } + + prototype.normalize = function():XML { + var x:XML = this + return x.AS3::normalize() + } + + prototype.parent = function():* { + var x:XML = this + return x.AS3::parent() + } + + prototype.processingInstructions = function(name="*"):XMLList { + var x:XML = this + return x.AS3::processingInstructions(name) + } + + prototype.prependChild = function(value):XML { + var x:XML = this + return x.AS3::prependChild(value) + } + + prototype.removeNamespace = function(ns):XML { + var x:XML = this + return x.AS3::removeNamespace(ns) + } + + prototype.replace = function(propertyName, value):XML { + var x:XML = this + return x.AS3::replace(propertyName, value) + } + + prototype.setChildren = function(value):XML { + var x:XML = this + return x.AS3::setChildren(value) + } + + prototype.setLocalName = function(name):void { + var x:XML = this + x.AS3::setLocalName(name) + } + + prototype.setName = function(name):void { + var x:XML = this + x.AS3::setName(name) + } + + prototype.setNamespace = function(ns):void { + var x:XML = this + x.AS3::setNamespace(ns) + } + + prototype.text = function():XMLList { + var x:XML = this + return x.AS3::text() + } + + prototype.toXMLString = function():String { + var x:XML = this + return x.AS3::toXMLString() + } + + + _dontEnumPrototype(prototype); +} + +public final dynamic class XMLList extends Object +{ + // { ReadOnly, DontDelete, DontEnum } + public static const length = 1 + + AS3 native function toString ():String + AS3 function valueOf():XMLList { return this } + + // these Override (hide) the same functions from Object + override AS3 native function hasOwnProperty (P=void 0):Boolean + override AS3 native function propertyIsEnumerable (P=void 0):Boolean + + // XMLList functions + AS3 native function attribute (arg):XMLList; + AS3 native function attributes():XMLList; + AS3 native function child (propertyName):XMLList; + AS3 native function children ():XMLList; + AS3 native function comments ():XMLList; + AS3 native function contains (value):Boolean; + AS3 native function copy ():XMLList; + + // E4X 13.4.4.12, pg 76 + AS3 native function descendants (name="*"):XMLList; // name is optional + + AS3 native function elements (name="*"):XMLList; // name is optional + AS3 native function hasComplexContent ():Boolean; + AS3 native function hasSimpleContent ():Boolean; + AS3 native function length ():int; + AS3 native function name ():Object; // null or a string; + AS3 native function normalize ():XMLList; + AS3 native function parent ():*; // undefined or XML; + AS3 native function processingInstructions (name="*"):XMLList; // name is optional + AS3 native function text ():XMLList; + AS3 native function toXMLString ():String; + + // These are not in the spec but work if the length of the XMLList is one + // (Function just gets propagated to the first and only list element) + AS3 native function addNamespace (ns):XML; + AS3 native function appendChild (child):XML; + AS3 native function childIndex():int; + AS3 native function inScopeNamespaces ():Array; + AS3 native function insertChildAfter (child1, child2):*; // undefined or this + AS3 native function insertChildBefore (child1, child2):*; // undefined or this + AS3 native function nodeKind ():String; + AS3 native function namespace (prefix=null):*; // prefix is optional + AS3 native function localName ():Object; // null or String + AS3 native function namespaceDeclarations ():Array; + AS3 native function prependChild (value):XML; + AS3 native function removeNamespace (ns):XML; + AS3 native function replace (propertyName, value):XML; + AS3 native function setChildren (value):XML; + AS3 native function setLocalName (name):void; + AS3 native function setName (name):void; + AS3 native function setNamespace (ns):void; + + // notification extensions(reserved) + //public native function notification():Function; + //public native function setNotification(f:Function); + + // Dummy constructor function - This is neccessary so the compiler can do arg # checking for the ctor in strict mode + // The code for the actual ctor is in XMLList::construct in the avmplus + public function XMLList(value = void 0) + {} + + + // this is what rhino appears to do, not sure why bother + prototype.valueOf = Object.prototype.valueOf + + prototype.hasOwnProperty = function(P=void 0):Boolean { + if (this === prototype) + { + return this.AS3::hasOwnProperty(P); + } + var x:XMLList = this + return x.AS3::hasOwnProperty(P) + } + + prototype.propertyIsEnumerable = function(P=void 0):Boolean { + if (this === prototype) + { + return this.AS3::propertyIsEnumerable(P); + } + var x:XMLList = this + return x.AS3::propertyIsEnumerable(P) + } + + prototype.toString = function():String { + if (this === prototype) + { + return ""; + } + var x:XMLList = this + return x.AS3::toString() + } + + prototype.addNamespace = function(ns):XML { + var x:XMLList = this + return x.AS3::addNamespace(ns) + } + + prototype.appendChild = function(child):XML { + var x:XMLList = this + return x.AS3::appendChild(child) + } + + prototype.attribute = function(arg):XMLList { + var x:XMLList = this + return x.AS3::attribute(arg) + } + + prototype.attributes = function():XMLList { + var x:XMLList = this + return x.AS3::attributes() + } + + prototype.child = function(propertyName):XMLList { + var x:XMLList = this + return x.AS3::child(propertyName) + } + + prototype.childIndex = function():int { + var x:XMLList = this + return x.AS3::childIndex() + } + + prototype.children = function():XMLList { + var x:XMLList = this + return x.AS3::children() + } + + prototype.comments = function():XMLList { + var x:XMLList = this + return x.AS3::comments() + } + + prototype.contains = function(value):Boolean { + var x:XMLList = this + return x.AS3::contains(value) + } + + prototype.copy = function():XMLList { + var x:XMLList = this + return x.AS3::copy() + } + + prototype.descendants = function(name="*"):XMLList { + var x:XMLList = this + return x.AS3::descendants(name) + } + + prototype.elements = function(name="*"):XMLList { + var x:XMLList = this + return x.AS3::elements(name) + } + + prototype.hasComplexContent = function():Boolean { + var x:XMLList = this + return x.AS3::hasComplexContent() + } + + prototype.hasSimpleContent = function():Boolean { + var x:XMLList = this + return x.AS3::hasSimpleContent() + } + + prototype.inScopeNamespaces = function():Array { + var x:XMLList = this + return x.AS3::inScopeNamespaces() + } + + prototype.insertChildAfter = function(child1, child2):* { + var x:XMLList = this + return x.AS3::insertChildAfter(child1,child2) + } + + prototype.insertChildBefore = function(child1, child2):* { + var x:XMLList = this + return x.AS3::insertChildBefore(child1,child2) + } + + prototype.length = function():int { + var x:XMLList = this + return x.AS3::length() + } + + prototype.localName = function():Object { + var x:XMLList = this + return x.AS3::localName() + } + + prototype.name = function():Object { + var x:XMLList = this + return x.AS3::name() + } + + prototype.namespace = function(prefix=null):* { + var x:XMLList = this + return x.AS3::namespace.apply(x, arguments) + } + + prototype.namespaceDeclarations = function():Array { + var x:XMLList = this + return x.AS3::namespaceDeclarations() + } + + prototype.nodeKind = function():String { + var x:XMLList = this + return x.AS3::nodeKind() + } + + prototype.normalize = function():XMLList { + var x:XMLList = this + return x.AS3::normalize() + } + + prototype.parent = function():* { + var x:XMLList = this + return x.AS3::parent() + } + + prototype.processingInstructions = function(name="*"):XMLList { + var x:XMLList = this + return x.AS3::processingInstructions(name) + } + + prototype.prependChild = function(value):XML { + var x:XMLList = this + return x.AS3::prependChild(value) + } + + prototype.removeNamespace = function(ns):XML { + var x:XMLList = this + return x.AS3::removeNamespace(ns) + } + + prototype.replace = function(propertyName, value):XML { + var x:XMLList = this + return x.AS3::replace(propertyName, value) + } + + prototype.setChildren = function(value):XML { + var x:XMLList = this + return x.AS3::setChildren(value) + } + + prototype.setLocalName = function(name):void { + var x:XMLList = this + x.AS3::setLocalName(name) + } + + prototype.setName = function(name):void { + var x:XMLList = this + x.AS3::setName(name) + } + + prototype.setNamespace = function(ns):void { + var x:XMLList = this + x.AS3::setNamespace(ns) + } + + prototype.text = function():XMLList { + var x:XMLList = this + return x.AS3::text() + } + + prototype.toXMLString = function():String { + var x:XMLList = this + return x.AS3::toXMLString() + } + + _dontEnumPrototype(prototype); + +} + +public final class QName extends Object +{ + // E262 {DontDelete, ReadOnly, DontEnum} + public static const length = 2 + + // E357 {DontDelete, ReadOnly} + public native function get localName():String + + // E357 {DontDelete, ReadOnly} + public native function get uri() + + AS3 function valueOf():QName { return this } + + AS3 function toString():String { + if (uri === "") + return localName + return (uri===null ? "*" : uri) + "::" + localName + } + + prototype.toString = function():String + { + if (this === prototype) return "" + if (!(this is QName)) + Error.throwError( TypeError, 1004 /*kInvokeOnIncompatibleObjectError*/, "QName.prototype.toString" ); + var q:QName = this + return q.AS3::toString() + } + + // Dummy constructor function - This is neccessary so the compiler can do arg # checking for the ctor in strict mode + // The code for the actual ctor is in QName::construct in the avmplus + public function QName(namespace = void 0, name = void 0) + {} + + _dontEnumPrototype(prototype); +} + +} diff --git a/mozilla/js/tamarin/core/XMLClass.cpp b/mozilla/js/tamarin/core/XMLClass.cpp new file mode 100644 index 00000000000..46e88003c50 --- /dev/null +++ b/mozilla/js/tamarin/core/XMLClass.cpp @@ -0,0 +1,421 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmplus.h" + +namespace avmplus +{ + BEGIN_NATIVE_MAP(XMLClass) + NATIVE_METHOD(XML_ignoreComments_get, XMLClass::getIgnoreComments) + NATIVE_METHOD(XML_ignoreComments_set, XMLClass::setIgnoreComments) + NATIVE_METHOD(XML_ignoreProcessingInstructions_get, XMLClass::getIgnoreProcessingInstructions) + NATIVE_METHOD(XML_ignoreProcessingInstructions_set, XMLClass::setIgnoreProcessingInstructions) + NATIVE_METHOD(XML_ignoreWhitespace_get, XMLClass::getIgnoreWhitespace) + NATIVE_METHOD(XML_ignoreWhitespace_set, XMLClass::setIgnoreWhitespace) + NATIVE_METHOD(XML_prettyPrinting_get, XMLClass::getPrettyPrinting) + NATIVE_METHOD(XML_prettyPrinting_set, XMLClass::setPrettyPrinting) + NATIVE_METHOD(XML_prettyIndent_get, XMLClass::getPrettyIndent) + NATIVE_METHOD(XML_prettyIndent_set, XMLClass::setPrettyIndent) + + NATIVE_METHOD(XML_AS3_addNamespace, XMLObject::addNamespace) + NATIVE_METHOD(XML_AS3_appendChild, XMLObject::appendChild) + NATIVE_METHOD(XML_AS3_attribute, XMLObject::attribute) + NATIVE_METHOD(XML_AS3_attributes, XMLObject::attributes) + NATIVE_METHOD(XML_AS3_child, XMLObject::child) + NATIVE_METHOD(XML_AS3_childIndex, XMLObject::childIndex) + NATIVE_METHOD(XML_AS3_children, XMLObject::children) + NATIVE_METHOD(XML_AS3_comments, XMLObject::comments) + NATIVE_METHOD(XML_AS3_contains, XMLObject::contains) + NATIVE_METHOD(XML_AS3_copy, XMLObject::copy) + NATIVE_METHOD(XML_AS3_descendants, XMLObject::descendants) + NATIVE_METHOD(XML_AS3_elements, XMLObject::elements) + NATIVE_METHOD(XML_AS3_hasOwnProperty, XMLObject::hasOwnProperty) + NATIVE_METHOD(XML_AS3_hasComplexContent, XMLObject::hasComplexContent) + NATIVE_METHOD(XML_AS3_hasSimpleContent, XMLObject::hasSimpleContent) + NATIVE_METHOD(XML_AS3_inScopeNamespaces, XMLObject::inScopeNamespaces) + NATIVE_METHOD(XML_AS3_insertChildAfter, XMLObject::insertChildAfter) + NATIVE_METHOD(XML_AS3_insertChildBefore, XMLObject::insertChildBefore) + NATIVE_METHOD(XML_AS3_localName, XMLObject::localName) + NATIVE_METHOD(XML_AS3_name, XMLObject::name) + NATIVE_METHODV(XML_AS3_namespace, XMLObject::getNamespace) + NATIVE_METHOD(XML_AS3_namespaceDeclarations, XMLObject::namespaceDeclarations) + NATIVE_METHOD(XML_AS3_nodeKind, XMLObject::nodeKind) + NATIVE_METHOD(XML_AS3_normalize, XMLObject::normalize) + NATIVE_METHOD(XML_AS3_notification, XMLObject::getNotification) + NATIVE_METHOD(XML_AS3_parent, XMLObject::parent) + NATIVE_METHOD(XML_AS3_processingInstructions, XMLObject::processingInstructions) + NATIVE_METHOD(XML_AS3_prependChild, XMLObject::prependChild) + NATIVE_METHOD(XML_AS3_propertyIsEnumerable, XMLObject::propertyIsEnumerable) + NATIVE_METHOD(XML_AS3_removeNamespace, XMLObject::removeNamespace) + NATIVE_METHOD(XML_AS3_replace, XMLObject::replace) + NATIVE_METHOD(XML_AS3_setChildren, XMLObject::setChildren) + NATIVE_METHOD(XML_AS3_setLocalName, XMLObject::setLocalName) + NATIVE_METHOD(XML_AS3_setName, XMLObject::setName) + NATIVE_METHOD(XML_AS3_setNamespace, XMLObject::setNamespace) + NATIVE_METHOD(XML_AS3_setNotification, XMLObject::setNotification) + NATIVE_METHOD(XML_AS3_text, XMLObject::text) + NATIVE_METHOD(XML_AS3_toString, XMLObject::toStringMethod) + NATIVE_METHOD(XML_AS3_toXMLString, XMLObject::toXMLString) + END_NATIVE_MAP() + + XMLClass::XMLClass(VTable* cvtable) + : ClassClosure(cvtable) + { + AvmAssert(traits()->sizeofInstance == sizeof(XMLClass)); + + AvmCore* core = this->core(); + + createVanillaPrototype(); + + // These are static objects on the XML type + // E4X: The XML constructor has the following properties + // XML.ignoreComments + // XML.ignoreProcessingInstructions + // XML.ignoreWhitespace + // XML.prettyPrinting + // XML.prettyIndent + m_flags = kFlagIgnoreComments | kFlagIgnoreProcessingInstructions | kFlagIgnoreWhitespace | kFlagPrettyPrinting; + m_prettyIndent = 2; + + kAttribute = core->constantString("attribute"); + kComment = core->constantString("comment"); + kProcessingInstruction = core->constantString("processing-instruction"); + kElement = core->constantString("element"); + kText = core->constantString("text"); + + kColon = core->constantString(":"); + kXml = core->constantString("xml"); + nsXML = core->newNamespace (core->kEmptyString->atom(), core->internString (core->newString ("http://www.w3.org/XML/1998/namespace"))->atom()); + + // for notifications + kAttrAdded = core->constant("attributeAdded"); + kAttrRemoved = core->constant("attributeRemoved"); + kAttrChanged = core->constant("attributeChanged"); + kNodeAdded = core->constant("nodeAdded"); + kNodeRemoved = core->constant("nodeRemoved"); + kNodeChanged = core->constant("nodeChanged"); + kNamespaceAdded = core->constant("namespaceAdded"); + kNamespaceRemoved = core->constant("namespaceRemoved"); + kNamespaceSet = core->constant("namespaceSet"); + kNameSet = core->constant("nameSet"); + kTextSet = core->constant("textSet"); + + // XML.settings + // XML.setSettings ([settings]) + // XML.defaultSettings() + } + + XMLClass::~XMLClass() + { + m_prettyIndent = 0; + m_flags = 0; + } + + // E4X 13.4.2, page 70 + // this = argv[0] (ignored) + // arg1 = argv[1] + // argN = argv[argc] + Atom XMLClass::construct(int argc, Atom* argv) + { + // We are no longer supporting this weird Rhino behavior. According to the spec + // and a discussion with the E4X developers, Rhino is buggy and a no argument + // constructor should be equivalent to the empty string constructor. + // !!@ This is different then the spec but runtime behavior of Rhino shows + // that a "new XML()" call creates some sort of special node that can change + // type automatically. + //var x = new XML(); + //print(x); // prints nothing + //print(x.nodeKind()); // prints text + //print(x.children()); // prints nothing + //x.foo = 5; + //print(x); // prints 5 + //print(x.nodeKind()); // prints element - how did it switch? + //print(x.attributes()); // prints nothing + //print(x.children()); // prints 5 + + AvmCore* core = this->core(); + + if (!argc || AvmCore::isNullOrUndefined(argv[1])) + { + return ToXML (core->kEmptyString->atom()); + } + + Atom x = ToXML (argv[1]); + // if args[0] is xml, xmllist or w3c xml, return a deep copy + if (core->isXML(argv[1]) || core->isXMLList(argv[1])) + { + // return deepCopy of x + XMLObject *x2 = core->atomToXMLObject(x); + return x2->_deepCopy()->atom(); + } + + return x; + } + + // E4X 13.4.1, page 70 + // this = argv[0] (ignored) + // arg1 = argv[1] + // argN = argv[argc] + Atom XMLClass::call(int argc, Atom* argv) + { + if ((!argc) || AvmCore::isNullOrUndefined(argv[1])) + { + return ToXML (core()->kEmptyString->atom()); + } + + return ToXML(argv[1]); + } + + // E4X 10.3, page 32 + Atom XMLClass::ToXML(Atom arg) + { + Toplevel* toplevel = this->toplevel(); + AvmCore* core = this->core(); + + if (AvmCore::isNullOrUndefined(arg)) + { + toplevel->throwTypeError( + (arg == undefinedAtom) ? kConvertUndefinedToObjectError : + kConvertNullToObjectError); + return arg; + } + else if (core->isXML(arg)) + { + return arg; + } + else if (core->isXMLList (arg)) + { + XMLListObject *xl = core->atomToXMLList (arg); + if (xl->_length() == 1) + { + return xl->_getAt(0)->atom(); + } + else + { + toplevel->throwTypeError(kXMLMarkupMustBeWellFormed); + return 0;//notreached + } + } + else + { + Namespace *defaultNamespace = toplevel->getDefaultNamespace(); + // parentString = s + //Stringp parentString = core->concatStrings(core->newString("getURI()); + //parentString = core->concatStrings(parentString, core->newString("\">")); + //parentString = core->concatStrings(parentString, core->string(arg)); + //parentString = core->concatStrings(parentString, core->newString("")); + // 2. Parse parentString as a W3C element information info e + // 3. If the parse fails, throw a SyntaxError exception + XMLObject *x = new (core->GetGC()) XMLObject(toplevel->xmlClass(), core->string(arg), defaultNamespace); + + // 4. x = toXML(e); + // 5. if x.length == 0 + // return new xml object + if (!x->getNode()->_length()) + { + x->setNode( new (core->GetGC()) TextE4XNode(0, core->kEmptyString) ); + } + // 6. else if x.length == 1 + // x[0].parent = null + // return x[0] + else if (x->getNode()->_length() == 1) + { + x->setNode( x->getNode()->_getAt (0)); // discard parent node + x->getNode()->setParent (0); + } + // 7. else throw a syntaxError + else + { + // check for multiple nodes where the first n-1 are PI/comment nodes and the + // last one is an element node. Just ignore the PI/comment nodes and return + // the element node. (bug 148526). + E4XNode *node = x->getNode(); + E4XNode *lastNode = node->_getAt (node->_length() - 1); + if (lastNode->getClass() != E4XNode::kElement) + toplevel->throwTypeError(kXMLMarkupMustBeWellFormed); + + for (uint32 i = 0; i < node->_length() - 1; i++) + { + if ((node->_getAt (i)->getClass() != E4XNode::kProcessingInstruction) && + (node->_getAt (i)->getClass() != E4XNode::kComment)) + + toplevel->throwTypeError(kXMLMarkupMustBeWellFormed); + } + + x->setNode( lastNode ); // discard parent node + lastNode->setParent (0); + } + return x->atom(); + } + } + + void XMLClass::setIgnoreComments(uint32 ignoreFlag) + { + if (ignoreFlag) + m_flags |= kFlagIgnoreComments; + else + m_flags &= ~kFlagIgnoreComments; + } + + uint32 XMLClass::getIgnoreComments() + { + return ((m_flags & kFlagIgnoreComments) != 0); + } + + void XMLClass::setIgnoreProcessingInstructions(uint32 ignoreFlag) + { + if (ignoreFlag) + m_flags |= kFlagIgnoreProcessingInstructions; + else + m_flags &= ~kFlagIgnoreProcessingInstructions; + }; + + uint32 XMLClass::getIgnoreProcessingInstructions() + { + return ((m_flags & kFlagIgnoreProcessingInstructions) != 0); + } + + void XMLClass::setIgnoreWhitespace(uint32 ignoreFlag) + { + if (ignoreFlag) + m_flags |= kFlagIgnoreWhitespace; + else + m_flags &= ~kFlagIgnoreWhitespace; + } + + uint32 XMLClass::getIgnoreWhitespace() + { + return ((m_flags & kFlagIgnoreWhitespace) != 0); + } + + void XMLClass::setPrettyPrinting(uint32 prettyFlag) + { + if (prettyFlag) + m_flags |= kFlagPrettyPrinting; + else + m_flags &= ~kFlagPrettyPrinting; + } + + uint32 XMLClass::getPrettyPrinting() + { + return ((m_flags & kFlagPrettyPrinting) != 0); + } + + void XMLClass::setPrettyIndent(int printVal) + { + m_prettyIndent = printVal; + } + + int XMLClass::getPrettyIndent() + { + return m_prettyIndent; + } + + ///////////////////////////////////////////////////////////////// + ///////////////////////////////////////////////////////////////// + ///////////////////////////////////////////////////////////////// + + BEGIN_NATIVE_MAP(QNameClass) + NATIVE_METHOD(QName_localName_get, QNameObject::getLocalName) + NATIVE_METHOD(QName_uri_get, QNameObject::getURI) + END_NATIVE_MAP() + + QNameClass::QNameClass(VTable* cvtable) + : ClassClosure(cvtable) + { + AvmAssert(traits()->sizeofInstance == sizeof(QNameClass)); + + createVanillaPrototype(); + + AvmCore* core = this->core(); + kUri = core->constant("uri"); + kLocalName = core->constant("localName"); + } + + // E4X 13.3.1, page 66 + // this = argv[0] (ignored) + // arg1 = argv[1] + // argN = argv[argc] + Atom QNameClass::call(int argc, Atom* argv) + { + if (argc == 1) + { + AvmCore* core = this->core(); + if (core->isObject(argv[1]) && core->istype(argv[1], core->traits.qName_itraits)) + return argv[1]; + } + + return construct (argc, argv); + } + + // E4X 13.3.2, page 67 + Atom QNameClass::construct(int argc, Atom* argv) + { + AvmCore* core = this->core(); + + if (argc == 0) + return (new (core->GetGC(), ivtable()->getExtraSize()) QNameObject(this, undefinedAtom))->atom(); + + if (argc == 1) + { + if (core->isObject(argv[1]) && core->istype(argv[1], core->traits.qName_itraits)) + return argv[1]; + + return (new (core->GetGC(), ivtable()->getExtraSize()) QNameObject(this, argv[1]))->atom(); + } + else + { + Atom a = argv[1]; + if (a == undefinedAtom) + { + // ns undefined same as unspecified + return (new (core->GetGC(), ivtable()->getExtraSize()) QNameObject(this, argv[2]))->atom(); + } + else + { + Namespace* ns; + if (AvmCore::isNull(a)) + ns = NULL; + // It's important to preserve the incoming namespace because it's type + // may not be public. I.E... + // namespace ns; + // q = new QName(ns, "name"); // ns is a NS_PackageInternal ns + // If we ever use this QName as a multiname, we need to preserve the exact ns + else if (core->isNamespace(a)) + ns = core->atomToNamespace(a); + else + ns = core->newNamespace (a); + return (new (core->GetGC(), ivtable()->getExtraSize()) QNameObject(this, ns, argv[2]))->atom(); + } + } + } +} diff --git a/mozilla/js/tamarin/core/XMLClass.h b/mozilla/js/tamarin/core/XMLClass.h new file mode 100644 index 00000000000..d3fdfae396d --- /dev/null +++ b/mozilla/js/tamarin/core/XMLClass.h @@ -0,0 +1,150 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_XMLClass__ +#define __avmplus_XMLClass__ + + +namespace avmplus +{ + /** + * class XMLClass + */ + class XMLClass : public ClassClosure + { + public: + XMLClass(VTable* cvtable); + ~XMLClass(); + + // this = argv[0] + // arg1 = argv[1] + // argN = argv[argc] + Atom call(int argc, Atom* argv); + + // this = argv[0] (ignored) + // arg1 = argv[1] + // argN = argv[argc] + Atom construct(int argc, Atom* argv); + + Atom ToXML(Atom arg); + + int m_prettyIndent; + uint8 m_flags; + + enum flags + { + kFlagIgnoreComments = 0x01, + kFlagIgnoreProcessingInstructions = 0x02, + kFlagIgnoreWhitespace = 0x04, + kFlagPrettyPrinting = 0x08 + }; + + DRCWB(Stringp) kAttribute; + DRCWB(Stringp) kComment; + DRCWB(Stringp) kProcessingInstruction; + DRCWB(Stringp) kElement; + DRCWB(Stringp) kText; + + DRCWB(Stringp) kColon; + + // Support for built-in "xml" namespace + DRCWB(Stringp) kXml; + DRCWB(Namespace*) nsXML; + + // notification types + ATOM_WB kAttrAdded; + ATOM_WB kAttrRemoved; + ATOM_WB kAttrChanged; + ATOM_WB kNodeAdded; + ATOM_WB kNodeRemoved; + ATOM_WB kNodeChanged; + ATOM_WB kNamespaceAdded; + ATOM_WB kNamespaceRemoved; + ATOM_WB kNamespaceSet; + ATOM_WB kNameSet; + ATOM_WB kTextSet; + + // static props/funcs off the XML object + // XML.ignoreComments + // XML.ignoreProcessingInstructions + // XML.ignoreWhitespace + // XML.prettyPrinting + // XML.prettyIndent + // XML.settings (in AS) + // XML.setSettings ([settings]) (in AS) + // XML.defaultSettings() (in AS) + + void setIgnoreComments(uint32 ignoreFlag); + uint32 getIgnoreComments(); + + void setIgnoreProcessingInstructions(uint32 ignoreFlag); + uint32 getIgnoreProcessingInstructions(); + + void setIgnoreWhitespace(uint32 ignoreFlag); + uint32 getIgnoreWhitespace(); + + void setPrettyPrinting(uint32 prettyPrinting); + uint32 getPrettyPrinting(); + + void setPrettyIndent(int indent); + int getPrettyIndent(); + + bool okToPrettyPrint() { return (getPrettyPrinting() && (m_prettyIndent >= 0)); } + + DECLARE_NATIVE_MAP(XMLClass) + }; + + /** + * class QName + */ + class QNameClass : public ClassClosure + { + public: + QNameClass(VTable* cvtable); + + // this = argv[0] + // arg1 = argv[1] + // argN = argv[argc] + Atom call(int argc, Atom* argv); + + // this = argv[0] (ignored) + // arg1 = argv[1] + // argN = argv[argc] + Atom construct(int argc, Atom* argv); + + DECLARE_NATIVE_MAP(QNameClass) + + ATOM_WB kUri; + ATOM_WB kLocalName; + }; +} + +#endif /* __avmplus_XMLClass__ */ diff --git a/mozilla/js/tamarin/core/XMLListClass.cpp b/mozilla/js/tamarin/core/XMLListClass.cpp new file mode 100644 index 00000000000..1f93128742d --- /dev/null +++ b/mozilla/js/tamarin/core/XMLListClass.cpp @@ -0,0 +1,194 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmplus.h" + +namespace avmplus +{ + BEGIN_NATIVE_MAP(XMLListClass) + NATIVE_METHOD(XMLList_AS3_attribute, XMLListObject::attribute) + NATIVE_METHOD(XMLList_AS3_attributes, XMLListObject::attributes) + NATIVE_METHOD(XMLList_AS3_child, XMLListObject::child) + NATIVE_METHOD(XMLList_AS3_children, XMLListObject::children) + NATIVE_METHOD(XMLList_AS3_comments, XMLListObject::comments) + NATIVE_METHOD(XMLList_AS3_contains, XMLListObject::contains) + NATIVE_METHOD(XMLList_AS3_copy, XMLListObject::copy) + NATIVE_METHOD(XMLList_AS3_descendants, XMLListObject::descendants) + NATIVE_METHOD(XMLList_AS3_elements, XMLListObject::elements) + NATIVE_METHOD(XMLList_AS3_hasOwnProperty, XMLListObject::hasOwnProperty) + NATIVE_METHOD(XMLList_AS3_hasComplexContent, XMLListObject::hasComplexContent) + NATIVE_METHOD(XMLList_AS3_hasSimpleContent, XMLListObject::hasSimpleContent) + NATIVE_METHOD(XMLList_AS3_length, XMLListObject::AS_based_length) + NATIVE_METHOD(XMLList_AS3_name, XMLListObject::name) + NATIVE_METHOD(XMLList_AS3_normalize, XMLListObject::normalize) + NATIVE_METHOD(XMLList_AS3_parent, XMLListObject::parent) + NATIVE_METHOD(XMLList_AS3_processingInstructions, XMLListObject::processingInstructions) + NATIVE_METHOD(XMLList_AS3_propertyIsEnumerable, XMLListObject::propertyIsEnumerable) + NATIVE_METHOD(XMLList_AS3_text, XMLListObject::text) + NATIVE_METHOD(XMLList_AS3_toString, XMLListObject::toStringMethod) + NATIVE_METHOD(XMLList_AS3_toXMLString, XMLListObject::toXMLString) + + // These are not in the spec but work if there's only element in the XMLList + NATIVE_METHOD(XMLList_AS3_addNamespace, XMLListObject::addNamespace) + NATIVE_METHOD(XMLList_AS3_appendChild, XMLListObject::appendChild) + NATIVE_METHOD(XMLList_AS3_childIndex, XMLListObject::childIndex) + NATIVE_METHOD(XMLList_AS3_inScopeNamespaces, XMLListObject::inScopeNamespaces) + NATIVE_METHOD(XMLList_AS3_insertChildAfter, XMLListObject::insertChildAfter) + NATIVE_METHOD(XMLList_AS3_insertChildBefore, XMLListObject::insertChildBefore) + NATIVE_METHODV(XMLList_AS3_namespace, XMLListObject::getNamespace) + NATIVE_METHOD(XMLList_AS3_localName, XMLListObject::localName) + NATIVE_METHOD(XMLList_AS3_namespaceDeclarations, XMLListObject::namespaceDeclarations) + NATIVE_METHOD(XMLList_AS3_nodeKind, XMLListObject::nodeKind) + NATIVE_METHOD(XMLList_AS3_prependChild, XMLListObject::prependChild) + NATIVE_METHOD(XMLList_AS3_removeNamespace, XMLListObject::removeNamespace) + NATIVE_METHOD(XMLList_AS3_replace, XMLListObject::replace) + NATIVE_METHOD(XMLList_AS3_setChildren, XMLListObject::setChildren) + NATIVE_METHOD(XMLList_AS3_setLocalName, XMLListObject::setLocalName) + NATIVE_METHOD(XMLList_AS3_setName, XMLListObject::setName) + NATIVE_METHOD(XMLList_AS3_setNamespace, XMLListObject::setNamespace) + + END_NATIVE_MAP() + + XMLListClass::XMLListClass(VTable* cvtable) + : ClassClosure(cvtable) + { + AvmAssert(traits()->sizeofInstance == sizeof(XMLListClass)); + createVanillaPrototype(); + } + + // E4X 10.4, pg 36 + Atom XMLListClass::ToXMLList(Atom arg) + { + AvmCore* core = this->core(); + + if (AvmCore::isNullOrUndefined(arg)) + { + toplevel()->throwTypeError( + (arg == undefinedAtom) ? kConvertUndefinedToObjectError : + kConvertNullToObjectError); + return arg; + } + + if (core->isXMLList(arg)) + { + return arg; + } + else if (core->isXML (arg)) + { + XMLObject *x = core->atomToXMLObject(arg); + Multiname m; + bool bFound = x->getQName (&m); + XMLListObject *xl = new (core->GetGC()) XMLListObject(toplevel()->xmlListClass(), x->parent(), bFound ? &m : 0); + xl->_append (arg); + return xl->atom(); + } + else + { + Toplevel* toplevel = this->toplevel(); + + Stringp s = core->string(arg); + + Stringp startTag = new (core->GetGC()) String(s, 0, 2); + Stringp endTag = new (core->GetGC()) String(s, s->length() - 3, 3); + + if (startTag->Equals("<>") && endTag->Equals("")) + { + s = new (core->GetGC()) String(s, 2, s->length() - 5); + } + + Namespace *defaultNamespace = toplevel->getDefaultNamespace(); + // We handle this step in the XMLObject constructor to avoid concatenation huge strings together + // parentString = s + // 3. Parse parentString as a W3C element information info e + // 4. If the parse fails, throw a SyntaxError exception + // 5. x = toXML(e); + //StringBuffer parentString (core); + //parentString << "getURI(); + //parentString << "\">"; + //parentString << s; + //parentString << ""; + XMLObject *x = new (core->GetGC()) XMLObject(toplevel->xmlClass(), s, defaultNamespace); + + XMLListObject *xl = new (core->GetGC()) XMLListObject(toplevel->xmlListClass()); + for (uint32 i = 0; i < x->getNode()->_length(); i++) + { + E4XNode *c = x->getNode()->_getAt (i); + c->setParent (NULL); + + // !!@ trying to emulate rhino behavior here + // Add the default namespace to our top element. + Namespace *ns = toplevel->getDefaultNamespace(); + c->_addInScopeNamespace (core, ns); + + xl->_append (c); + } + return xl->atom(); + } + } + + // E4X 13.5.2, pg 87 + // this = argv[0] (ignored) + // arg1 = argv[1] + // argN = argv[argc] + Atom XMLListClass::construct(int argc, Atom* argv) + { + AvmCore* core = this->core(); + if ((!argc) || AvmCore::isNullOrUndefined(argv[1])) + { + return ToXMLList (core->newString("")->atom()); + } + + // if args[0] is xmllist, create new list and call append + if (core->isXMLList(argv[1])) + { + XMLListObject *l = new (core->GetGC()) XMLListObject(toplevel()->xmlListClass()); + l->_append (argv[1]); + return l->atom(); + } + + return ToXMLList(argv[1]); + } + + // this = argv[0] (ignored) + // arg1 = argv[1] + // argN = argv[argc] + Atom XMLListClass::call(int argc, Atom* argv) + { + if ((!argc) || AvmCore::isNullOrUndefined(argv[1])) + { + return ToXMLList (core()->kEmptyString->atom()); + } + + return ToXMLList(argv[1]); + } +} diff --git a/mozilla/js/tamarin/core/XMLListClass.h b/mozilla/js/tamarin/core/XMLListClass.h new file mode 100644 index 00000000000..27354b57f12 --- /dev/null +++ b/mozilla/js/tamarin/core/XMLListClass.h @@ -0,0 +1,62 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_XMLListClass__ +#define __avmplus_XMLListClass__ + + +namespace avmplus +{ + /** + * class XMLListClass + */ + class XMLListClass : public ClassClosure + { + public: + XMLListClass(VTable* cvtable); + + // this = argv[0] + // arg1 = argv[1] + // argN = argv[argc] + Atom call(int argc, Atom* argv); + + // this = argv[0] (ignored) + // arg1 = argv[1] + // argN = argv[argc] + Atom construct(int argc, Atom* argv); + + Atom ToXMLList(Atom arg); + + DECLARE_NATIVE_MAP(XMLListClass) + }; +} + +#endif /* __avmplus_XMLListClass__ */ diff --git a/mozilla/js/tamarin/core/XMLListObject.cpp b/mozilla/js/tamarin/core/XMLListObject.cpp new file mode 100644 index 00000000000..fd9df3c44e5 --- /dev/null +++ b/mozilla/js/tamarin/core/XMLListObject.cpp @@ -0,0 +1,1504 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmplus.h" + +namespace avmplus +{ + XMLListObject::XMLListObject(XMLListClass *type, Atom tObject, const Multiname* tProperty) + : ScriptObject(type->ivtable(), type->prototype), + m_children(0) + { + if (tProperty) + m_targetProperty.setMultiname (*tProperty); + else // should be equivalent to a null m_targetProperty + m_targetProperty.setAnyName(); + setTargetObject(tObject); + } + + XMLListObject::~XMLListObject() + { + setTargetObject(0); + } + + ////////////////////////////////////////////////////////////////////// + // E4X Section 9.2.1 below (internal methods) + ////////////////////////////////////////////////////////////////////// + + // this = argv[0] (ignored) + // arg1 = argv[1] + // argN = argv[argc] + Atom XMLListObject::callProperty(Multiname* multiname, int argc, Atom* argv) + { + AvmCore *core = this->core(); + + // sec 11.2.2.1 CallMethod(r,args) + + Atom f = getDelegate()->getProperty(multiname); + if (f == undefinedAtom) + { + f = getProperty(multiname); + // If our method returned is a 0 element XMLList, it means that we did not + // find a matching property for this method name. In this case, if our XMLList + // has one child, we get the child and callproperty on the child object. + // This allows node elements to be treated as simple strings even if they + // are XML or XMLList objects. See 11.2.2.1 in the E4X spec for CallMethod. + if (core->isXMLList(f) && + !core->atomToXMLList(f)->_length() && + (this->_length() == 1)) + { + XMLObject *x0 = _getAt(0); + return x0->callProperty (multiname, argc, argv); + } + } + argv[0] = atom(); // replace receiver + return toplevel()->op_call(f, argc, argv); + } + + Atom XMLListObject::getProperty(Multiname* m) const + { + AvmCore *core = this->core(); + Toplevel* toplevel = this->toplevel(); + + // step 1 - We have an integer argument - direct child lookup + if (!m->isAnyName() && !m->isAttr()) + { + uint32 index; + if (!m->isAnyName() && AvmCore::getIndexFromString (m->getName(), &index)) + { + return getUintProperty (index); + } + } + + // step 2 + //QNameObject* qname = new (core->GetGC()) QNameObject(toplevel->qnameClass(), *m); + XMLListObject *l = new (core->GetGC()) XMLListObject(toplevel->xmlListClass(), this->atom(), m); + + // step 3 + for (uint32 i = 0; i < _length(); i++) + { + XMLObject *xml = _getAt(i); + if (xml && xml->getClass() == E4XNode::kElement) + { + // step 3ai + Atom gq = xml->getProperty (m); + if (core->atomToXML (gq)) + { + XMLObject *x = core->atomToXMLObject (gq); + if (x && x->_length()) + l->_append (gq); + } + else + { + XMLListObject *xl = core->atomToXMLList (gq); + if (xl && xl->_length()) + { + l->_append (gq); + } + } + } + } + + return l->atom(); + } + + void XMLListObject::setProperty(Multiname* m, Atom V) + { + AvmCore *core = this->core(); + Toplevel *toplevel = this->toplevel(); + + uint32 i; + if (!m->isAnyName() && !m->isAttr() && AvmCore::getIndexFromString (m->getName(), &i)) + { + setUintProperty (i, V); + return; + } + // step 3 + else if (_length() <= 1) + { + //step3a + if (_length() == 0) + { + Atom r = this->_resolveValue(); + if (AvmCore::isNull(r)) + return; + + if (core->isXML (r) && (core->atomToXML (r)->_length() != 1)) + return; + + if (core->isXMLList (r) && (core->atomToXMLList (r)->_length() != 1)) + return; + + this->_append (r); + } + + XMLObject *x = _getAt (0); + x->setProperty (m, V); + } + else if (_length() > 1) + { + toplevel->throwTypeError(kXMLAssigmentOneItemLists); + } + +#ifdef _DEBUG + // The only thing allowed in XMLLists is XML objects + for (uint32 z = 0; z < _length(); z++) + { + AvmAssert(core->isXML(m_children.getAt(z))); + } +#endif + + return; + } + + bool XMLListObject::deleteProperty(Multiname* m) + { + if (!m->isAnyName() && !m->isAttr()) + { + Stringp name = m->getName(); + uint32 index; + if (AvmCore::getIndexFromString (name, &index)) + { + return this->delUintProperty (index); + } + } + + for (uint32 i = 0; i < numChildren(); i++) + { + XMLObject *xm = _getAt(i); + if (xm->getClass() == E4XNode::kElement) + { + xm->deleteProperty (m); + } + } + + return true; + } + + Atom XMLListObject::getDescendants(Multiname* m) const + { + AvmCore *core = this->core(); + + XMLListObject *l = new (core->GetGC()) XMLListObject(toplevel()->xmlListClass()); + for (uint32 i = 0; i < numChildren(); i++) + { + XMLObject *xm = _getAt(i); + if (xm->getClass() == E4XNode::kElement) + { + Atom dq = xm->getDescendants (m); + XMLListObject *dqx = core->atomToXMLList (dq); + if (dqx && dqx->_length()) + { + l->_append (dq); + } + } + } + + return l->atom(); + } + + // E4X 9.2.1.1, page 21 + Atom XMLListObject::getProperty(Atom P) const + { + Multiname m; + toplevel()->ToXMLName (P, m); + return getProperty (&m); + } + + // E4X 9.2.1.2, pg 21 - [[PUT]] + void XMLListObject::setProperty(Atom P, Atom V) + { + Multiname m; + toplevel()->ToXMLName (P, m); + setProperty (&m, V); + } + + Atom XMLListObject::getUintProperty(uint32 index) const + { + if ((index >= 0) && (index < _length())) + { + return _getAt(index)->atom(); + } + else + { + return undefinedAtom; + } + } + + void XMLListObject::setUintProperty(uint32 i, Atom V) + { + AvmCore* core = this->core(); + Toplevel* toplevel = this->toplevel(); + + Atom r = nullStringAtom; + // step 2a + if (!AvmCore::isNull(this->m_targetObject)) + { + if (core->isXML(m_targetObject)) + { + r = core->atomToXMLObject (m_targetObject)->_resolveValue(); + } + else if (core->isXMLList (m_targetObject)) + { + r = core->atomToXMLList (m_targetObject)->_resolveValue(); + } + + if (AvmCore::isNull(r)) + return; + } + + // step 2c + if (i >= _length()) + { + // step 2 c i + if (core->isXMLList (r)) + { + XMLListObject *xl = core->atomToXMLList (r); + if (xl->_length() != 1) + return; + else + r = xl->_getAt(0)->atom(); + + // r should now be an XMLObject atom from this point forward + } + + // step 2cii - newer spec + XMLObject *rx = core->atomToXMLObject (r); + if (rx && rx->getClass() != E4XNode::kElement) + return; + + E4XNode *y = 0; + // step 2 c iii + if (m_targetProperty.isAttr()) + { + Atom attributesExist = rx->getProperty (m_targetProperty); + if (core->isXMLList (attributesExist) && (core->atomToXMLList (attributesExist)->_length() > 0)) + return; + + y = new (core->GetGC()) AttributeE4XNode (core->atomToXML (r), 0); + y->setQName (core, m_targetProperty); + + // warning: it looks like this is sent prior to the attribute being added. + rx->nonChildChanges(xmlClass()->kAttrAdded, this->m_targetProperty.getName()->atom()); + } + // if targetProperty is null or targetProperty.localName = "*" + else if (m_targetProperty.isAnyName() || + // Added because of bug 145184 - appendChild with a text node not working right + (core->isXML(V) && core->atomToXML(V)->getClass() == E4XNode::kText)) + { + y = new (core->GetGC()) TextE4XNode (core->atomToXML(r), 0); + } + else + { + y = new (core->GetGC()) ElementE4XNode (core->atomToXML (r)); + y->setQName (core, this->m_targetProperty); + } + + i = _length(); + // step 2.c.viii + if (y->getClass() != E4XNode::kAttribute) + { + AvmAssert(y->getParent() == (rx ? rx->getNode() : 0)); + if (y->getParent() != NULL) + { + // y->m_parent = r = XMLObject * + E4XNode *parent = y->getParent(); + AvmAssert(parent != 0); + uint32 j = 0; + if (i > 0) + { + // step 2 c vii 1 ii + // spec says "y.[[parent]][j] is not the same object as x[i-1]" and I'm + // assuming that means pointer equality and not "equals" comparison + while ((j < (parent->_length() - 1)) && parent->_getAt (j) != _getAt(i - 1)->getNode()) + { + j++; + } + + j = j + 1; // slightly different than spec but our insert call does not have a + 1 on it + } + else + { + j = parent->_length(); // slightly different than spec but our insert call does not have a + 1 on it + } + // These two lines are equivalent to _insert which takes + // an Atom since we know that y is an XMLObject/E4XNode + y->setParent (parent); + parent->insertChild (j, y); + + } + if (core->isXML(V)) + { + Multiname mV; + if (core->atomToXML (V)->getQName(core, &mV)) + y->setQName (core, &mV); + + } + else if (core->isXMLList (V)) + { + //ERRATA : 9.2.1.2 step 2(c)(vii)(3) what is V.[[PropertyName]]? s.b. [[TargetProperty]] + if (!core->atomToXMLList (V)->m_targetProperty.isAnyName()) + y->setQName (core, core->atomToXMLList (V)->m_targetProperty); + } + } + + this->_append (y); + } + + // step 2d + E4XNode *v = core->atomToXML (V); + if ((!core->atomToXMLList(V) && !v) || (v && (v->getClass() & (E4XNode::kText | E4XNode::kCDATA | E4XNode::kAttribute)))) + { + // This string is converted into a XML object below in step 2(g)(iii) + V = core->string(V)->atom(); + } + + // step 2e + XMLObject *xi = _getAt(i); + if (xi->getClass() == E4XNode::kAttribute) + { + XMLObject *parent = xi->getParent(); + Multiname mxi; + xi->getQName (&mxi); + parent->setProperty (&mxi, V); + Atom attr = parent->getProperty (&mxi); + XMLListObject *attrx = core->atomToXMLList (attr); + // x[i] = attr[0]; + m_children.setAt (i, attrx->_getAt(0) ->atom()); + } + // step 2f + else if (core->isXMLList (V)) + { + // create a shallow copy c of V + XMLListObject *src = core->atomToXMLList (V); + XMLListObject *c = new (core->GetGC()) XMLListObject(toplevel->xmlListClass()); + + //c->m_children = new (core->GetGC()) AtomArray (src->numChildren()); + c->m_children.checkCapacity(src->numChildren()); + for (uint32 i2 = 0; i2 < src->numChildren(); i2++) + c->m_children.push (src->m_children.getAt(i2)); + + E4XNode *parent = _getAt(i)->getNode()->getParent(); + // step 2 f iii + if (parent) + { + uint32 q = 0; + while (q < parent->numChildren()) + { + if (parent->_getAt(q) == _getAt(i)->getNode()) + { + parent->_replace (core, toplevel, q, c->atom()); + for (uint32 j = 0; j < c->_length(); j++) + { + XMLObject *xo = new (core->GetGC()) XMLObject(toplevel->xmlClass(), parent->_getAt(q + j)); + c->m_children.setAt (j, xo->atom()); + } + + break; + } + + q++; + } + } + + // resize our buffer to ([[Length]] + c.[[Length]]) (2 f vi) + + bool notify = (parent && XMLObject::notifyNeeded(parent)); + XMLObject* prior = (notify) ? _getAt(i) : 0; + XMLObject* target = (notify) ? (new (core->GetGC()) XMLObject (toplevel->xmlClass(), parent)) : 0; + + m_children.removeAt (i); + for (uint32 i2 = 0; i2 < src->numChildren(); i2++) + { + m_children.insert (i + i2, c->m_children.getAt(i2)); + + XMLObject* obj = c->_getAt(i2); + if (notify && (parent == obj->getNode()->getParent())) + { + if (i2 == 0) + { + // @todo; is this condition ever true? + if (obj->getNode() != prior->getNode()) + target->childChanges( xmlClass()->kNodeChanged, obj->atom(), prior->getNode()); + } + else + { + target->childChanges( xmlClass()->kNodeAdded, obj->atom()); + } + } + } + } + // step 2g + // !!@ always going into this step supports how Rhino acts with setting XMLList props + //var y = new XMLList("onetwo"); + //y[0] = "five"; + //print(y); + // one which is an element node is converted to a text node with "five" as it's label + // !!@ but in this case, the node's contents are replaced and not the node itself... + // o = ABCD; + // o.i[1] = "BB"; + // print(o); + else if (core->isXML (V) || xi->getClass() & (E4XNode::kText | E4XNode::kCDATA | E4XNode::kComment | E4XNode::kProcessingInstruction)) + { + E4XNode *parent = _getAt(i)->getNode()->getParent(); + if (parent) + { + // search our parent for a match between a child and x[i] + uint32 q = 0; + while (q < parent->numChildren()) + { + if (parent->_getAt(q) == _getAt(i)->getNode()) + { + parent->_replace (core, toplevel, q, V); + XMLObject *xo = new (core->GetGC()) XMLObject (toplevel->xmlClass(), parent->_getAt(q)); + V = xo->atom(); + + if (XMLObject::notifyNeeded(parent)) + { + XMLObject *po = new (core->GetGC()) XMLObject (toplevel->xmlClass(), parent); + po->childChanges(xmlClass()->kNodeAdded, xo->atom()); + } + break; + } + + q++; + } + } + + // From E4X errrata + //9.2.1.2 step 2(g)(iii) erratum: _V_ may not be of type XML, but all index-named + // properties _x[i]_ in an XMLList _x_ must be of type XML, according to + // 9.2.1.1 Overview and other places in the spec. + + // Thanks to 2(d), we know _V_ (*vp here) is either a string or an + // XML/XMLList object. If _V_ is a string, call ToXML on it to satisfy + // the constraint before setting _x[i] = V_. + + if (core->isXML(V)) + m_children.setAt (i, V); + else + m_children.setAt (i, xmlClass()->ToXML (V)); + } + // step 2h + else + { + _getAt(i)->setProperty (core->kAsterisk, V); + } + } + + bool XMLListObject::delUintProperty(uint32 index) + { + if (index >= _length()) + { + return true; + } + else + { + XMLObject *xi = _getAt(index); + XMLObject *px = xi->getParent(); + if (px != NULL) + { + if (xi->getClass() == E4XNode::kAttribute) + { + Multiname mx; + xi->getQName (&mx); + px->deleteProperty (&mx); + } + else + { + // let q be the property of parent, where parent[q] is the same object as x[i]. + int q = xi->childIndex (); + + E4XNode *x = px->getNode()->_getAt(q); + px->getNode()->_deleteByIndex (q); + + if (XMLObject::notifyNeeded(px->getNode()) && x->getClass() == E4XNode::kElement) + { + AvmCore *core = this->core(); + XMLObject *r = new (core->GetGC()) XMLObject (xmlClass(), x); + px->childChanges(xmlClass()->kNodeRemoved, r->atom()); + } + } + } + + // delete index from this list + + m_children.removeAt (index); + return true; + } + } + + // E4X 9.2.1.3, pg 23 + bool XMLListObject::deleteProperty (Atom P) + { + Multiname m; + toplevel()->ToXMLName (P, m); + return deleteProperty (&m); + } + + bool XMLListObject::hasUintProperty(uint32 index) const + { + return (index < _length()); + } + + bool XMLListObject::hasProperty(Multiname* m) const + { + if (!m->isAnyName() && !m->isAttr()) + { + Stringp name = m->getName(); + uint32 index; + if (AvmCore::getIndexFromString (name, &index)) + { + return (index < _length()); + } + } + + for (uint32 i = 0; i < numChildren(); i++) + { + XMLObject *xm = _getAt(i); + if (xm->getClass() == E4XNode::kElement) + { + if (xm->hasProperty (m)) + return true; + } + } + + return false; + } + + // E4X 9.2.1.5, pg 24 + bool XMLListObject::hasProperty (Atom P) const + { + Multiname m; + toplevel()->ToXMLName (P, m); + return hasProperty (&m); + } + + void XMLListObject::_append(E4XNode *v) + { + AvmCore *core = this->core(); + XMLObject *x = new (core->GetGC()) XMLObject (toplevel()->xmlClass(), v); + + if (v->getParent()) + { + XMLObject *p = new (core->GetGC()) XMLObject (toplevel()->xmlClass(), v->getParent()); + setTargetObject(p->atom()); + } + else + setTargetObject(nullObjectAtom); + if (v->getClass() != E4XNode::kProcessingInstruction) + { + Multiname m; + if (v->getQName (core, &m)) + this->m_targetProperty.setMultiname(m); + } + + m_children.push (x->atom()); + } + + // E4X 9.2.1.6, pg 24 + void XMLListObject::_append(Atom V) + { + AvmCore *core = this->core(); + + // !!@ what the docs say + // Atom children = this->get ("*"); + // children->put (children->length(), child) + // return x; + + if (core->isXMLList(V)) + { + XMLListObject *v = core->atomToXMLList(V); + setTargetObject(v->m_targetObject); + this->m_targetProperty = v->m_targetProperty; + + if (v->_length()) + { + m_children.checkCapacity(v->_length()); + for (uint32 j = 0; j < v->_length(); j++) + { + m_children.push (v->_getAt(j)->atom()); + } + } + } + else if (core->isXML(V)) + { + E4XNode *v = core->atomToXML (V); + _append (v); + } + } + + // E4X 9.2.1.7, pg 25 + XMLListObject *XMLListObject::_deepCopy () const + { + AvmCore *core = this->core(); + + XMLListObject *l = new (core->GetGC()) XMLListObject(toplevel()->xmlListClass(), m_targetObject, &m_targetProperty.getMultiname()); + + l->m_children.checkCapacity(numChildren()); + for (uint32 i = 0; i < numChildren(); i++) + { + l->m_children.push (_getAt(i)->_deepCopy()->atom()); + } + + return l; + } + + // E4X 9.2.1.8, pg 25 + XMLListObject *XMLListObject::descendants (Atom P) + { + Multiname m; + toplevel()->ToXMLName (P, m); + return core()->atomToXMLList (getDescendants (&m)); + } + + // E4X 9.2.1.9, pg 26 + Atom XMLListObject::_equals(Atom V) const + { + AvmCore *core = this->core(); + + // null or "" return false + if ((V == undefinedAtom) && (_length() == 0)) + return trueAtom; + + if (core->isXMLList(V)) + { + XMLListObject *v = core->atomToXMLList (V); + if (_length() != v->_length()) + return falseAtom; + + for (uint32 i = 0; i < _length(); i++) + { + if (core->eq (m_children.getAt(i), v->m_children.getAt(i)) == falseAtom) + return falseAtom; + } + + return trueAtom; + } + else if (_length() == 1) + { + return core->eq (m_children.getAt(0), V); + } + + return falseAtom; + } + + // E4X 9.2.1.10, pg 26 + Atom XMLListObject::_resolveValue() + { + if (_length() > 0) + return this->atom(); + + AvmCore *core = this->core(); + + if (AvmCore::isNull(m_targetObject) || + (m_targetProperty.isAttr()) || + (m_targetProperty.isAnyName())) + { + return nullObjectAtom; + } + + Atom base = nullObjectAtom; + XMLObject *x = core->atomToXMLObject (m_targetObject); + if (x) + { + base = x->_resolveValue(); + } + XMLListObject *xl = core->atomToXMLList (m_targetObject); + if (xl) + { + base = xl->_resolveValue (); + } + if (AvmCore::isNull(base)) + return nullObjectAtom; + + XMLListObject *target = 0; + if (core->isXML(base)) + { + target = core->atomToXMLList(core->atomToXMLObject(base)->getProperty (m_targetProperty)); + } + else if (core->isXMLList(base)) + { + target = core->atomToXMLList(core->atomToXMLList(base)->getProperty (m_targetProperty)); + } + else + { + AvmAssert(0);// base should be an XML or XMLList always + } + + if (!target) + return nullObjectAtom; + + if (!target->_length()) + { + if (core->isXMLList (base) && core->atomToXMLList(base)->_length() > 1) + { + toplevel()->throwTypeError(kXMLAssigmentOneItemLists); + return nullObjectAtom; + } + + if (core->isXML(base)) + { + core->atomToXMLObject(base)->setProperty (m_targetProperty, core->kEmptyString->atom()); + return core->atomToXMLObject(base)->getProperty (m_targetProperty); + } + else if (core->isXMLList(base)) + { + core->atomToXMLList(base)->setProperty (m_targetProperty, core->kEmptyString->atom()); + return core->atomToXMLList(base)->getProperty (m_targetProperty); + } + else + { + AvmAssert(0); // b should be one or the other at this point since target is non-null + } + } + + return target->atom(); + } + + XMLObject *XMLListObject::_getAt (uint32 i) const + { + AvmCore *core = this->core(); + + if ((i < 0) || (i >= _length())) + return 0; + + return core->atomToXMLObject (m_children.getAt(i)); + } + + // E4X 12.2, page 59 + // Support for for-in, for-each for XMLListObjects + Atom XMLListObject::nextName(int index) + { + AvmAssert(index > 0); + + if (index <= (int)_length()) + { + AvmCore *core = this->core(); + return core->internInt (index-1)->atom(); + } + else + { + return nullStringAtom; + } + } + + Atom XMLListObject::nextValue(int index) + { + AvmAssert(index > 0); + + if (index <= (int)_length()) + return _getAt (index-1)->atom(); + else + return undefinedAtom; + } + + int XMLListObject::nextNameIndex(int index) + { + AvmAssert(index >= 0); + + // XMLList types return the same number of indexes as children + // We return a 1-N iterator (and then subtract off the one in + // the nextName and nextValue functions). + if (index < (int) _length()) + return index + 1; + else + return 0; + } + + // E4X 13.5.4.21, page 93 which just refers to 10.2, page 31 (XMLList case) + void XMLListObject::__toXMLString(StringBuffer &output, Atom, int /*indentLevel*/) + { + AvmCore *core = this->core(); + + // For i = 0 to x.[[length]-1 + // if (xml.prettyprinting == true and i is not equal to 0) + // s = s + line terminator + // s = s + toxmlstring(x[i], ancestor namespace) + + for (uint32 i = 0; i < _length(); i++) + { + // iterate over entire array. If any prop is an "element" type, return false + XMLObject *xm = _getAt(i); + if (xm) + { + // !!@ This does not seem be affected by the prettyPrinting flag + // but always occurs (comparing to Rhino) + if (/*xmlClass()->getPrettyPrinting() && */i) + output << "\n"; + AtomArray *AncestorNamespaces = new (core->GetGC()) AtomArray(); + xm->__toXMLString(output, AncestorNamespaces, 0); + } + } + + return; + } + + ////////////////////////////////////////////////////////////////////// + // E4X Section 13.5.4 below (AS methods) + ////////////////////////////////////////////////////////////////////// + + // E4X 13.5.4.2, pg 88 + XMLListObject *XMLListObject::attribute (Atom arg) + { + // name= ToAttributeName (attributeName); + // return [[get]](name) + + return core()->atomToXMLList (getProperty (toplevel()->ToAttributeName (arg)->atom())); + } + + // E4X 13.5.4.3, pg 88 + XMLListObject *XMLListObject::attributes () + { + return core()->atomToXMLList (getProperty (toplevel()->ToAttributeName(core()->kAsterisk)->atom())); + } + + // E4X 13.5.4.4, pg 88 + XMLListObject *XMLListObject::child (Atom propertyName) + { + AvmCore *core = this->core(); + + XMLListObject *m = new (core->GetGC()) XMLListObject(toplevel()->xmlListClass(), this->atom()); + + for (uint32 i = 0; i < _length(); i++) + { + XMLObject *x = _getAt(i); + XMLListObject *rxl = x->child (propertyName); + if (rxl && rxl->_length()) + { + m->_append (rxl->atom()); + } + } + + return m; + } + + XMLListObject *XMLListObject::children () + { + return core()->atomToXMLList (getProperty (core()->kAsterisk)); + } + + XMLListObject *XMLListObject::comments () + { + AvmCore *core = this->core(); + + XMLListObject *m = new (core->GetGC()) XMLListObject(toplevel()->xmlListClass(), this->atom()); + + for (uint32 i = 0; i < _length(); i++) + { + XMLObject *x = _getAt(i); + if (x->getClass() == E4XNode::kElement) + { + XMLListObject *rxl = x->comments(); + if (rxl && rxl->_length()) + { + m->_append (rxl->atom()); + } + } + } + + return m; + } + + bool XMLListObject::contains (Atom value) + { + AvmCore *core = this->core();; + for (uint32 i = 0; i < _length(); i++) + { + // Spec says "comparison l[i] == value)" which is different than _equals + if (core->eq (m_children.getAt(i), value) == trueAtom) + return true; + } + + return false; + } + + XMLListObject *XMLListObject::copy () + { + return _deepCopy(); + } + + // E4X 13.5.4.10, pg 90 + XMLListObject *XMLListObject::elements (Atom name) // name defaults to '*' + { + AvmCore *core = this->core(); + Toplevel* toplevel = this->toplevel(); + + Multiname m; + toplevel->ToXMLName (name, m); + + XMLListObject *xl = new (core->GetGC()) XMLListObject(toplevel->xmlListClass(), this->atom(), &m); + + for (uint32 i = 0; i < _length(); i++) + { + XMLObject *x = _getAt(i); + if (x->getClass() == E4XNode::kElement) + { + XMLListObject *rxl = x->elements(name); + if (rxl && rxl->_length()) + { + xl->_append (rxl->atom()); + } + } + } + + return xl; + } + + // E4X 13.5.4.11, pg 90 + bool XMLListObject::hasOwnProperty (Atom P) + { + if (hasProperty (P)) + return true; + + // If x has a property with name ToString(P), return true; + // !!@ (prototype different than regular object?? + + return false; + } + + // E4X 13.5.4.12, pg 90 + bool XMLListObject::hasComplexContent () + { + if (_length() == 0) + return false; + + if (_length() == 1) + { + XMLObject *x = _getAt(0); + return x->hasComplexContent(); + } + + for (uint32 i = 0; i < _length(); i++) + { + XMLObject *x = _getAt(i); + if (x->getClass() == E4XNode::kElement) + { + return true; + } + } + + return false; + } + + // E4X 13.5.4.13, pg 91 + bool XMLListObject::hasSimpleContent () + { + if (!_length()) + { + return true; + } + else if (_length() == 1) + { + XMLObject *xm = _getAt(0); + if (xm) + return xm->hasSimpleContent(); + else + { + AvmAssert(0); + return false; + } + } + else + { + for (uint32 i = 0; i < _length(); i++) + { + XMLObject *xm = _getAt(i); + AvmAssert(xm != 0); + if (xm && xm->getClass() == E4XNode::kElement) + { + return false; + } + } + } + + return true; + } + + uint32 XMLListObject::AS_based_length () const + { + return _length(); + } + + XMLListObject *XMLListObject::normalize () + { + AvmCore *core = this->core(); + + uint32 i = 0; + while (i < _length()) + { + XMLObject *x = _getAt(i); + if (x->getClass() == E4XNode::kElement) + { + x->normalize(); + i++; + } + else if ((x->getClass() & (E4XNode::kText | E4XNode::kCDATA))) + { + while (((i + 1) < _length()) && ((_getAt(i + 1)->getNode()->getClass() & (E4XNode::kText | E4XNode::kCDATA)))) + { + x->setValue (core->concatStrings(x->getNode()->getValue(), _getAt(i + 1)->getNode()->getValue())); + deleteProperty (core->intToAtom (i + 1)); + } + if (x->getValue()->length() == 0) + { + deleteProperty (core->intToAtom (i)); + } + else + { + i++; + } + } + else + { + i++; + } + } + + return this; + } + + Atom XMLListObject::parent () + { + if (!_length()) + return undefinedAtom; + + E4XNode *parent = _getAt(0)->getNode()->getParent(); + for (uint32 i = 1; i < _length(); i++) + { + E4XNode *p = _getAt(i)->getNode()->getParent(); + if (parent != p) + return undefinedAtom; + } + + if (parent) + return _getAt(0)->getParent()->atom(); + else + return undefinedAtom; + } + + XMLListObject *XMLListObject::processingInstructions (Atom name) // name defaults to '*' + { + AvmCore *core = this->core(); + XMLListObject *m = new (core->GetGC()) XMLListObject(toplevel()->xmlListClass(), this->atom()); + + for (uint32 i = 0; i < _length(); i++) + { + XMLObject *x = _getAt(i); + if (x->getClass() == E4XNode::kElement) + { + XMLListObject *rxl = x->processingInstructions(name); + if (rxl && rxl->_length()) + { + m->_append (rxl->atom()); + } + } + } + + return m; + } + + bool XMLListObject::propertyIsEnumerable (Atom P) + { + AvmCore *core = this->core(); + double index = core->number(P); + if ((index >= 0.0) && (index < _length())) + return true; + + return false; + } + + XMLListObject *XMLListObject::text () + { + AvmCore *core = this->core(); + + XMLListObject *m = new (core->GetGC()) XMLListObject(toplevel()->xmlListClass(), this->atom()); + + for (uint32 i = 0; i < _length(); i++) + { + XMLObject *x = _getAt(i); + if (x->getClass() == E4XNode::kElement) + { + XMLListObject *rxl = x->text(); + if (rxl && rxl->_length()) + { + m->_append (rxl->atom()); + } + } + } + + return m; + } + + // E4X 10.1.2, page 28 + Atom XMLListObject::toString() + { + AvmCore *core = this->core(); + if (hasSimpleContent ()) + { + Stringp output = core->kEmptyString; + + // s is the empty string + // for all props in children array + // if (class != comment or processing instruction) + // s = s + toString(prop) + for (uint32 i = 0; i < _length(); i++) + { + XMLObject *xm = _getAt(i); + if (xm && (xm->getClass() != E4XNode::kComment) && (xm->getClass() != E4XNode::kProcessingInstruction)) + { + output = core->concatStrings(output, core->string (xm->toString())); + } + } + + return output->atom(); + } + else + { + StringBuffer output(core); + this->__toXMLString(output, nullStringAtom, 0); + return core->newString(output.c_str())->atom(); + } + } + + Stringp XMLListObject::toStringMethod() + { + // This is a non-virtual version of toString. + // This method is needed because pointer->method in Codewarrior + // is different depending on wheher the method is virtual or not, + // causing problems with NATIVE_METHOD. + return core()->atomToString(toString()); + } + + String *XMLListObject::toXMLString () + { + StringBuffer output(core()); + this->__toXMLString(output, nullStringAtom, 0); + return core()->newString(output.c_str()); + } + + ///////////////////////////////////////////////////////////////////////// + ///////////////////////////////////////////////////////////////////////// + // Routines below are not in the spec but work if XMLList has one element + ///////////////////////////////////////////////////////////////////////// + ///////////////////////////////////////////////////////////////////////// + + XMLObject *XMLListObject::addNamespace (Atom _namespace) + { + if (_length() == 1) + { + return _getAt(0)->addNamespace(_namespace); + } + else + { + // throw type error + toplevel()->throwTypeError(kXMLOnlyWorksWithOneItemLists, core()->toErrorString("addNamespace")); + return 0; + } + } + + XMLObject *XMLListObject::appendChild (Atom child) + { + if (_length() == 1) + { + return _getAt(0)->appendChild (child); + } + else + { + // throw type error + toplevel()->throwTypeError(kXMLOnlyWorksWithOneItemLists, core()->toErrorString("appendChild")); + return 0; + } + } + + int XMLListObject::childIndex () + { + if (_length() == 1) + { + return _getAt(0)->childIndex (); + } + else + { + // throw type error + toplevel()->throwTypeError(kXMLOnlyWorksWithOneItemLists, core()->toErrorString("childIndex")); + return -1; + } + } + + ArrayObject *XMLListObject::inScopeNamespaces () + { + if (_length() == 1) + { + return _getAt(0)->inScopeNamespaces(); + } + else + { + // throw type error + toplevel()->throwTypeError(kXMLOnlyWorksWithOneItemLists, core()->toErrorString("inScopeNamespaces")); + return 0; + } + } + + Atom XMLListObject::insertChildAfter (Atom child1, Atom child2) + { + if (_length() == 1) + { + return _getAt(0)->insertChildAfter (child1, child2); + } + else + { + // throw type error + toplevel()->throwTypeError(kXMLOnlyWorksWithOneItemLists, core()->toErrorString("insertChildAfter")); + return undefinedAtom; + } + } + + Atom XMLListObject::insertChildBefore (Atom child1, Atom child2) + { + if (_length() == 1) + { + return _getAt(0)->insertChildBefore (child1, child2); + } + else + { + // throw type error + toplevel()->throwTypeError(kXMLOnlyWorksWithOneItemLists, core()->toErrorString("insertChildBefore")); + return undefinedAtom; + } + } + + Atom XMLListObject::name() + { + if (_length() == 1) + { + return _getAt(0)->name(); + } + else + { + // throw type error + toplevel()->throwTypeError(kXMLOnlyWorksWithOneItemLists, core()->toErrorString("name")); + return nullStringAtom; + } + } + + + Atom XMLListObject::getNamespace (Atom *argv, int argc) // prefix is optional + { + if (_length() == 1) + { + return _getAt(0)->getNamespace(argv, argc); + } + else + { + // throw type error + toplevel()->throwTypeError(kXMLOnlyWorksWithOneItemLists, core()->toErrorString("namespace")); + return nullStringAtom; + } + } + + Atom XMLListObject::localName () + { + if (_length() == 1) + { + return _getAt(0)->localName(); + } + else + { + // throw type error + toplevel()->throwTypeError(kXMLOnlyWorksWithOneItemLists, core()->toErrorString("localName")); + return nullStringAtom; + } + } + + ArrayObject *XMLListObject::namespaceDeclarations () + { + if (_length() == 1) + { + return _getAt(0)->namespaceDeclarations(); + } + else + { + // throw type error + toplevel()->throwTypeError(kXMLOnlyWorksWithOneItemLists, core()->toErrorString("namespaceDeclarations")); + return 0; + } + } + + String *XMLListObject::nodeKind () + { + // if our list has one element, return the nodeKind of the first element + if (_length() == 1) + { + return _getAt(0)->nodeKind(); + } + else + { + // throw type error + toplevel()->throwTypeError(kXMLOnlyWorksWithOneItemLists, core()->toErrorString("nodeKind")); + return 0; + } + } + + XMLObject *XMLListObject::prependChild (Atom value) + { + if (_length() == 1) + { + return _getAt(0)->prependChild(value); + } + else + { + // throw type error + toplevel()->throwTypeError(kXMLOnlyWorksWithOneItemLists, core()->toErrorString("prependChild")); + return 0; + } + } + + XMLObject *XMLListObject::removeNamespace (Atom _namespace) + { + if (_length() == 1) + { + return _getAt(0)->removeNamespace (_namespace); + } + else + { + // throw type error + toplevel()->throwTypeError(kXMLOnlyWorksWithOneItemLists, core()->toErrorString("removeNamespace")); + return 0; + } + } + + XMLObject *XMLListObject::replace (Atom propertyName, Atom value) + { + if (_length() == 1) + { + return _getAt(0)->replace(propertyName, value); + } + else + { + // throw type error + toplevel()->throwTypeError(kXMLOnlyWorksWithOneItemLists, core()->toErrorString("replace")); + return 0; + } + } + + XMLObject *XMLListObject::setChildren (Atom value) + { + if (_length() == 1) + { + return _getAt(0)->setChildren (value); + } + else + { + // throw type error + toplevel()->throwTypeError(kXMLOnlyWorksWithOneItemLists, core()->toErrorString("setChildren")); + return 0; + } + } + + void XMLListObject::setLocalName (Atom name) + { + if (_length() == 1) + { + _getAt(0)->setLocalName (name); + } + else + { + // throw type error + toplevel()->throwTypeError(kXMLOnlyWorksWithOneItemLists, core()->toErrorString("setLocalName")); + } + } + + void XMLListObject::setName (Atom name) + { + if (_length() == 1) + { + _getAt(0)->setName(name); + } + else + { + // throw type error + toplevel()->throwTypeError(kXMLOnlyWorksWithOneItemLists, core()->toErrorString("setName")); + } + } + + void XMLListObject::setNamespace (Atom ns) + { + if (_length() == 1) + { + _getAt(0)->setNamespace (ns); + } + else + { + // throw type error + toplevel()->throwTypeError(kXMLOnlyWorksWithOneItemLists, core()->toErrorString("setNamespace")); + } + } + +#ifdef XML_FILTER_EXPERIMENT + XMLListObject * XMLListObject::filter (Atom propertyName, Atom value) + { + Multiname m; + toplevel()->ToXMLName(propertyName, m); + + Multiname name; + toplevel()->CoerceE4XMultiname(&m, name); + + // filter opcode experiment + XMLListObject *l = new (core()->gc) XMLListObject(toplevel()->xmlListClass()); + for (uint32 i = 0; i < _length(); i++) + { + XMLObject *xm = _getAt(i); + xm->_filter (l, name, value); + } + + return l; + } +#endif // XML_FILTER_EXPERIMENT + + ///////////////////////////////////////////////////////////////////////// + ///////////////////////////////////////////////////////////////////////// + ///////////////////////////////////////////////////////////////////////// + ///////////////////////////////////////////////////////////////////////// + ///////////////////////////////////////////////////////////////////////// + + // reserved for now + void XMLListObject::setNotification(ScriptObject* /*f*/) + { + // nop + } + + ScriptObject* XMLListObject::getNotification() + { + return 0; + } + +} diff --git a/mozilla/js/tamarin/core/XMLListObject.h b/mozilla/js/tamarin/core/XMLListObject.h new file mode 100644 index 00000000000..b7b78293673 --- /dev/null +++ b/mozilla/js/tamarin/core/XMLListObject.h @@ -0,0 +1,214 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + #ifndef __avmplus_XMLListObject__ +#define __avmplus_XMLListObject__ + + +// E4X 9.1.1 Internal Properties and Methods +// Name +// Parent +// Attributes +// InScopeNamespaces +// Length +// Delete (overrides Object version) +// Get (overrides Object version) +// HasProperty (overrides Object version) +// Put (overrides Object version) +// DeleteByIndex (PropertyName) +// DeepCopy +// ResolveValue +// Descendants (PropertyName) +// Equals (Value) +// Insert (PropertyName, Value) +// Replace (PropertyName, Value) +// AddInScopeNamespace (Namespace) + +// XMLList.prototype.constructor ?? +// XMLList.prototype.attribute +// XMLList.prototype.attributes +// XMLList.prototype.child +// XMLList.prototype.children +// XMLList.prototype.comments +// XMLList.prototype.contains +// XMLList.prototype.copy +// XMLList.prototype.descendants +// XMLList.prototype.elements +// XMLList.prototype.hasOwnProperty +// XMLList.prototype.hasComplexContent +// XMLList.prototype.hasSimpleContent +// XMLList.prototype.length +// XMLList.prototype.normalize +// XMLList.prototype.parent +// XMLList.prototype.processingInstructions +// XMLList.prototype.prependChild +// XMLList.prototype.propertyIsEnumerable +// XMLList.prototype.text +// XMLList.prototype.toString +// XMLList.prototype.toXMLString +// XMLList.prototype.valueOf + + +namespace avmplus +{ + /** + * The XMLListObject class is the C++ implementation of the + * "XMLList" type in the E4X Specification. + */ + class XMLListObject : public ScriptObject + { + XMLClass* xmlClass() const + { + return toplevel()->xmlClass(); + } + + private: + HeapMultiname m_targetProperty; + Atom m_targetObject; + + // An array of XMLObjects (NOT E4XNodes) + AtomArray m_children; + friend class XMLObject; + + void setTargetObject(Atom a) { + WBATOM(MMgc::GC::GetGC(this), this, &m_targetObject, a); + } + + public: + // Functions that override object version + // Delete (deleteProperty) + // Get (getProperty) + // HasProperty + // Put (setProperty) + Atom callProperty(Multiname* name, int argc, Atom* argv); + + Atom getProperty(Atom name) const; // [[Get]] + void setProperty(Atom name, Atom value); // [[Put]] + bool deleteProperty(Atom name); // [[Delete] + + Atom getProperty(Stringp name) const + { + AvmAssert(name != NULL && name->isInterned()); + return getProperty(name->atom()); + } + + Atom getProperty(Multiname* name) const; + void setProperty(Multiname* name, Atom value); + bool deleteProperty(Multiname* name); + + bool hasProperty(Multiname* name) const; + bool hasProperty(Atom name) const; + bool hasUintProperty(uint32 i) const; + + Atom getDescendants(Multiname* name) const; + + Atom getUintProperty(uint32 i) const; + void setUintProperty(uint32 i, Atom value); + bool delUintProperty(uint32 i); + + // private helper functions + void _append (E4XNode *node); // [[Append]] + void _append (Atom child); // [[Append]] + XMLListObject *_deepCopy () const; // [[DeepCopy]] + Atom _equals(Atom V) const; // [[Equals]] + Atom _resolveValue (); // [[ResolveValue] + + uint32 numChildren() const { return m_children.getLength(); }; + uint32 _length() const { return (numChildren()); }; //[[Length]] + + XMLObject *_getAt (uint32 i) const; + + void __toXMLString(StringBuffer &output, Atom AncestorNamespace, int indentLevel = 0); + + // Iterator support - for in, for each + Atom nextName(int index); + Atom nextValue(int index); + int nextNameIndex(int index); + + // Exposed routines to AS (NATIVE_METHODs) + XMLListObject *attribute (Atom arg); + XMLListObject *attributes (); + XMLListObject *child (Atom propertyName); + XMLListObject *children (); + XMLListObject *comments (); + bool contains (Atom value); + XMLListObject *copy (); + XMLListObject *descendants (Atom name); + XMLListObject *elements (Atom name); + bool hasOwnProperty (Atom P); + uint32 AS_based_length () const; + bool hasComplexContent (); + bool hasSimpleContent (); + Atom name(); + XMLListObject *normalize (); + Atom parent (); + XMLListObject *processingInstructions (Atom name); + bool propertyIsEnumerable (Atom P); + XMLListObject *text (); + Atom toString (); + Stringp toStringMethod(); + String *toXMLString (); + + // The following are not in the spec but work if XMLList has one element + XMLObject *addNamespace (Atom _namespace); + XMLObject *appendChild (Atom child); + int childIndex(); + ArrayObject *inScopeNamespaces (); + Atom insertChildAfter (Atom child1, Atom child2); + Atom insertChildBefore (Atom child1, Atom child2); + Atom getNamespace (Atom *argv, int argc); // prefix is optional + Atom localName (); + ArrayObject *namespaceDeclarations (); + String *nodeKind (); + XMLObject *prependChild (Atom value); + XMLObject *removeNamespace (Atom _namespace); + XMLObject *replace (Atom propertyName, Atom value); + XMLObject *setChildren (Atom value); + void setLocalName (Atom name); + void setName (Atom name); + void setNamespace (Atom ns); + + // non-E4X extensions + ScriptObject* getNotification(); + void setNotification(ScriptObject* f); + +#ifdef XML_FILTER_EXPERIMENT + XMLListObject *filter (Atom propertyName, Atom value); +#endif + + public: + + XMLListObject(XMLListClass *type, Atom targetObject = nullObjectAtom, const Multiname* targetProperty = 0); + ~XMLListObject(); + }; +} + +#endif /* __avmplus_XMLListObject__ */ diff --git a/mozilla/js/tamarin/core/XMLObject.cpp b/mozilla/js/tamarin/core/XMLObject.cpp new file mode 100644 index 00000000000..483724b17f7 --- /dev/null +++ b/mozilla/js/tamarin/core/XMLObject.cpp @@ -0,0 +1,3025 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + + +///////////////////////////////////////////////////////// +// Internal properties of the E4XNode classes +// Multiname *m_name; +// Stringp m_value; +// E4XNode *m_parent; // the parent or NULL for top item +// AtomArray *m_attributes; +// AtomArray *m_namespaces; +// AtomArray *m_children; +// +// kAttribute (AttributeE4XNode) +// m_name = Multiname containing namespace:name pair (marked as an attribute) +// m_value = text value of the attribute +// kText/kCDATA (TextE4XNode, CDATAE4XNode) +// m_value - text value of the node +// kComment (CommentE4XNode) +// m_value - text value of the node +// kProcessingInstruction (PIE4XNode) +// m_name = Multiname containing namespace:name pair +// m_value - text value of the node +// kElement (ElementE4XNode) +// m_name = Multiname containing namespace:name pair +// m_attributes : list of attributes (E4XNodes's) +// m_children : array of children nodes (E4XNodes's) or +// m_namespaces: array of namespaces for this node +// +// QName contains a Multiname with only ONE namespace +// null +// "" empty string +// uri +// +// Properties of the XML object can be either qualified (one associated namespace) +// or unqualified. +// +// Property access to the XML object can be a variety of cases: +// qualified: one namespace +// unqualified: one or more namespaces (the public namespace, plus others) +// anyName operator - matches both qualified and unqualified properties +#include "avmplus.h" + +//#define STRING_DEBUG + +namespace avmplus +{ + XMLObject::XMLObject(XMLClass *type, E4XNode *node) + : ScriptObject(type->ivtable(), type->prototype) + { + setNode( node ); + } + + // This is considered the "toXML function" + XMLObject::XMLObject(XMLClass *type, Stringp str, Namespace *defaultNamespace) + : ScriptObject(type->ivtable(), type->prototype) + { + #if 0//def _DEBUG + static bool once = false; + if (!once) + { + once = true; + AvmDebugMsg(false, "sizeof(E4XNode): %d\r\n", sizeof(E4XNode)); + AvmDebugMsg(false, "sizeof(TextE4XNode): %d\r\n", sizeof(TextE4XNode)); + AvmDebugMsg(false, "sizeof(ElementE4XNode): %d\r\n", sizeof(ElementE4XNode)); + AvmDebugMsg(false, "sizeof(E4XNodeAux): %d\r\n", sizeof(E4XNodeAux)); + } + #endif + m_node = 0; + if (!str) + return; + + AvmCore *core = this->core(); + Toplevel* toplevel = this->toplevel(); + MMgc::GC *gc = core->GetGC(); + + AvmAssert(traits()->sizeofInstance == sizeof(XMLObject)); + + // str, ignoreWhite + bool bIgnoreWhite = toplevel->xmlClass()->getIgnoreWhitespace() != 0; + XMLParser parser(core); + parser.parse(str, bIgnoreWhite); + parser.setCondenseWhite(true); + + XMLTag tag(gc); + E4XNode* p = 0; + + // When we're passed in a defaultNamespace, we simulate the following XML code + // string + if (defaultNamespace) + { + setNode( new (gc) ElementE4XNode (0) ); + + // create a namespace for the parent using defaultNamespace->URI() + Namespace *ns = core->internNamespace (core->newNamespace (core->kEmptyString->atom(), defaultNamespace->getURI()->atom())); + + m_node->_addInScopeNamespace (core, ns); + + Stringp name = core->internString (core->newString("parent")); + + m_node->setQName (core, name, ns); + + p = m_node; + } + + int m_status; + + while ((m_status = parser.getNext(tag)) == XMLParser::kNoError) + { + E4XNode* pNewElement = NULL; + + switch (tag.nodeType) + { + case XMLTag::kXMLDeclaration: + { + // !!@ add some checks to ensure this is the first tag + // encountered in our file (deal with stuff from + // XMLObject and XMLListObject parser setup + } + break; + case XMLTag::kDocTypeDeclaration: + break; + case XMLTag::kElementType: + { + // A closing tag + if (tag.text->c_str()[0] == '/') + { + //Stringp thisNodeNameNoSlash = new (gc) String(tag.text, 1, tag.text->length()-1); + const wchar *thisNodeNameNoSlash = tag.text->c_str() + 1; + uint32 noSlashLen = tag.text->length() - 1; + + Multiname m; + p->getQName(core, &m); + Namespace *ns = m.getNamespace(); + + // Get our parents qualified name string here + Stringp parentName = m.getName(); + + Namespace *ns2 = toplevel->getDefaultNamespace(); + if ((!NodeNameEquals (thisNodeNameNoSlash, noSlashLen, parentName, ns)) && + // We're trying to support paired nodes where the first node gets a namespace + // from the default namespace. + (!(m.getName()->Equals (thisNodeNameNoSlash, noSlashLen) && (ns->getURI() == ns2->getURI())))) + { + // If p == m_node, we are at the top of our tree and we're parsing the fake "parent" + // wrapper tags around our actual XML text. Instead of warning about a missing "" + // tag, we instead complain about the XML markup not being well-formed. + // (Emulating Rhino behavior) + if (p == m_node) + { + toplevel->throwTypeError(kXMLMarkupMustBeWellFormed); + } + else + { + #if 0 // After team and 8ball_adv discussion, this will not be enabled + // Try to see if we have a bit of misformed XML tags where a trailing + // tag is missing. We'll walk up a parent node to see if that node + // matches this ending tag. If so, we'll automagically end tag this + // node. Bug 110808 - "

blah blah blah". Some RSS XML + // feeds have badly formed HTML tags + if (p->m_parent) + { + Multiname *m = p->m_parent->getQName(); + Namespace *ns = core->atomToNamespace(m->getNamespace()); + StringBuffer out2 (core); + if (ns && ns->hasPrefix()) + { + out2 << core->string(ns->getPrefix()) << ":"; + } + out2 << m->getName(); + + Stringp parentParentName = core->newString (out2.c_str()); + if (*thisNodeNameNoSlash == *parentParentName) + { + p = p->m_parent->m_parent; + } + else + { + toplevel->throwTypeError(kXMLUnterminatedElementTag, parentName, parentName); + } + } + else + #endif + { + toplevel->throwTypeError(kXMLUnterminatedElementTag, parentName, parentName); + } + } + } + else + { + // Catch the case where our input string ends with a bogus tag + if (defaultNamespace) + { + if (p == m_node) + { + toplevel->throwTypeError(kXMLMarkupMustBeWellFormed); + } + } + + // found matching closing tag so we can pop back up a level now + if (p != m_node) + p = p->getParent(); + } + + } + else // an opening tag + { + ElementE4XNode *e = new (gc) ElementE4XNode(0); + pNewElement = e; + // Our first tag modifies this object itself + if (!m_node) + { + setNode( pNewElement ); + } + else // all other tags create a new element tag + { + p->_append (pNewElement); + } + + if (!tag.empty) // if our tag is not empty, we're now the "parent" tag + { + p = pNewElement; + } + + const wchar *localName = tag.text->c_str(); + + // Needs to happen after setting m_name->name so throw error can use name in routine + e->CopyAttributesAndNamespaces (core, toplevel, tag, localName); + + // Find a namespace that matches this tag in our parent chain. If this name + // is a qualified name (ns:name), we search for a namespace with a matching + // prefix. If is an unqualified name, we find the first empty prefix name. + Namespace *ns = pNewElement->FindNamespace (core, toplevel, tag.text->c_str(), &localName, false); + + // pg 35, map [[name]].uri to "namespace name" of node + + if (!ns) + ns = core->publicNamespace; + + Stringp name; + // If our string ptr did not change, just use our tag.text string instead of creating a new one. + if (localName == tag.text->c_str()) + { + AvmAssert(tag.text->isInterned()); + name = tag.text; + } + else + { + name = core->internAlloc (localName, String::Length(localName)); + } + + pNewElement->setQName (core, name, ns); + } + } + break; + + case XMLTag::kComment: + if (!toplevel->xmlClass()->getIgnoreComments()) + { + pNewElement = new (gc) CommentE4XNode (0, tag.text); + if (!m_node) + setNode( pNewElement ); + } + break; + case XMLTag::kCDataSection: + + pNewElement = new (gc) CDATAE4XNode (0, tag.text); + if (!m_node) + setNode( pNewElement ); + break; + case XMLTag::kTextNodeType: + // For small strings, we intern them in an attempt to save memory + // with large XML files with of lot of repeating text nodes. + if (tag.text->length() < 32) + { + Stringp text = core->internString(tag.text); + // Reduce our GC pressure if we know our tag.text is unused. + if (text != tag.text) + { + AvmAssert(!tag.text->isInterned()); + delete tag.text; + tag.text = 0; + } + pNewElement = new (gc) TextE4XNode(0, text); + } + else + { + pNewElement = new (gc) TextE4XNode(0, tag.text); + } + + if (!m_node) + setNode( pNewElement ); + break; + case XMLTag::kProcessingInstruction: + if (!toplevel->xmlClass()->getIgnoreProcessingInstructions()) + { + + const wchar *nameStart = tag.text->c_str(); + const wchar *nameEnd = nameStart; + while (!String::isSpace(nameEnd[0]) && (nameEnd[0])) + nameEnd++; + + Stringp name = core->internString (new (core->GetGC()) String(nameStart, nameEnd - nameStart)); + + // Skip over any white space between name and rest of PI + while (String::isSpace(nameEnd[0]) && nameEnd[0]) + nameEnd++; + + String *val = new (gc) String(nameEnd, tag.text->length()-(nameEnd-nameStart)); + pNewElement = new (gc) PIE4XNode(0, val); + pNewElement->setQName (core, name, core->publicNamespace); + if (!m_node) + setNode( pNewElement ); + } + break; + + //kNoType = 0, + default: + AvmAssert(0); // unknown tag type?? + } + + if ( pNewElement && (XMLTag::kElementType != tag.nodeType)) + { + if (pNewElement != m_node) + p->_append( pNewElement); + } + + if ( m_status != XMLParser::kNoError ) + { + break; // stop getting tags + } + + } + + if ( m_status == XMLParser::kEndOfDocument ) + { + m_status = XMLParser::kNoError; + } + else + { + switch (m_status) + { + case XMLParser::kMalformedElement: + toplevel->throwTypeError(kXMLMalformedElement); + break; + case XMLParser::kUnterminatedCDataSection: + toplevel->throwTypeError(kXMLUnterminatedCData); + break; + case XMLParser::kUnterminatedXMLDeclaration: + toplevel->throwTypeError(kXMLUnterminatedXMLDecl); + break; + case XMLParser::kUnterminatedDocTypeDeclaration: + toplevel->throwTypeError(kXMLUnterminatedDocTypeDecl); + break; + case XMLParser::kUnterminatedComment: + toplevel->throwTypeError(kXMLUnterminatedComment); + break; + case XMLParser::kUnterminatedAttributeValue: + toplevel->throwTypeError(kXMLUnterminatedAttribute); + break; + case XMLParser::kUnterminatedElement: + toplevel->throwTypeError(kXMLUnterminatedElement); + break; + case XMLParser::kUnterminatedProcessingInstruction: + toplevel->throwTypeError(kXMLUnterminatedProcessingInstruction); + break; + case XMLParser::kOutOfMemory: + case XMLParser::kElementNeverBegun: + AvmAssert(0); + break; + } + } + + if ( p != m_node && ! m_status ) + { + Multiname m; + p->getQName(core, &m); + + // Get our parents qualified name string here + Stringp parentName = m.getName(); + + toplevel->throwTypeError(kXMLUnterminatedElementTag, parentName, parentName); + } + } + + XMLObject::~XMLObject() + { + setNode(NULL); + } + + bool XMLObject::NodeNameEquals (const wchar *nodeName, int len, Stringp parentName, Namespace * parentNs) + { + if (parentNs && parentNs->hasPrefix()) + { + AvmCore *core = this->core(); + Stringp parentNSName = core->string(parentNs->getPrefix()); + int prefixLen = parentNSName->length(); + + // Does nodeName == parentNS:parentName + int totalLen = prefixLen + 1 + parentName->length(); // + 1 for ':' separator + if (totalLen != len) + return false; + + if (String::Compare (nodeName, prefixLen, parentNSName->c_str(), prefixLen)) + return false; + + if (nodeName[prefixLen] != ':') + return false; + + return (parentName->Equals (nodeName + prefixLen + 1, parentName->length())); // +1 for ':' + } + else + { + return parentName->Equals (nodeName, len); + } + } + + ////////////////////////////////////////////////////////////////////// + // E4X Section 9.1.1 + ////////////////////////////////////////////////////////////////////// + + // sec 11.2.2.1 CallMethod + // this = argv[0] (ignored) + // arg1 = argv[1] + // argN = argv[argc] + Atom XMLObject::callProperty(Multiname* multiname, int argc, Atom* argv) + { + AvmCore *core = this->core(); + + Atom f = getDelegate()->getProperty(multiname); + if (f == undefinedAtom) + { + f = getProperty(multiname); + // If our method returned is a 0 element XMLList, it means that we did not + // find a matching property for this method name. In this case, if our XML + // node is simple, we convert it to a string and callproperty on the string. + // This allows node elements to be treated as simple strings even if they + // are XML or XMLList objects. See 11.2.2.1 in the E4X spec for CallMethod. + if (core->isXMLList(f) && + !core->atomToXMLList(f)->_length() && + (hasSimpleContent())) + { + Stringp r0 = core->string (this->atom()); + return toplevel()->callproperty (r0->atom(), multiname, argc, argv, toplevel()->stringClass->vtable); + } + } + argv[0] = atom(); // replace receiver + return toplevel()->op_call(f, argc, argv); + } + + // E4X 9.1.1.1, pg 12 - [[GET]] + Atom XMLObject::getProperty(Atom P) const + { + Multiname m; + toplevel()->ToXMLName(P, m); + return getProperty (&m); + } + + // E4X 9.1.1.1, pg 12 - [[GET]] + Atom XMLObject::getProperty(Multiname* name_in) const + { + AvmCore *core = this->core(); + Toplevel* toplevel = this->toplevel(); + + Multiname name; + toplevel->CoerceE4XMultiname(name_in, name); + +#ifdef STRING_DEBUG + Stringp n1 = name.getName(); +#endif + + if (!name.isAnyName() && !name.isAttr()) + { + // We have an integer argument - direct child lookup + Stringp nameString = name.getName(); + uint32 index; + if (AvmCore::getIndexFromString (nameString, &index)) + { + // //l = ToXMLList (this); + // //return l->get(p); + // ToXMLList on a XMLNode just creates a one item XMLList. The only valid + // property number for the new XMLList is 0 which just returns this node. Handle + // that case here. + if (index == 0) + return this->atom(); + else + return undefinedAtom; + } + } + + XMLListObject *xl = new (core->GetGC()) XMLListObject(toplevel->xmlListClass(), this->atom(), &name); + + if (name.isAttr()) + { + // for each a in x.[[attributes]] + for (uint32 i = 0; i < m_node->numAttributes(); i++) + { + E4XNode *xml = m_node->getAttribute(i); + + AvmAssert(xml && xml->getClass() == E4XNode::kAttribute); + + Multiname m; + AvmAssert(xml->getQName(core, &m) != 0); + + //if (((n.[[Name]].localName == "*") || (n.[[Name]].localName == a.[[Name]].localName)) && + // ((n.[[Name]].uri == nulll) || (n.[[Name]].uri == a.[[Name]].uri))) + // l.append (a); + + xml->getQName (core, &m); + if (name.matches (&m)) + { + xl->_append (xml); + } + } + + return xl->atom(); + } + // step 5 - look through all the children for a match - [[length]] implies length of children + // n isn't an attributeName so it must be a qname?? +// for k = 0 to x.[[length]]-1 +// if (n.localName = "*" and this[k].class == "element" and (this[k].name.localName == n.localName) +// and (!n.uri) or (this[k].class == "element) and (n.uri == this[k].name.uri))) +// xl->_append (x[k]); + + for (uint32 i = 0; i < m_node->numChildren(); i++) + { + E4XNode *child = m_node->_getAt(i); + Multiname m; + Multiname *m2 = 0; + if (child->getClass() == E4XNode::kElement) + { + child->getQName(core, &m); + m2 = &m; + } + + // if (n.localName = "*" OR this[k].class == "element" and (this[k].name.localName == n.localName) + // and (!n.uri) or (this[k].class == "element) and (n.uri == this[k].name.uri))) + // xl->_append (x[k]); + if (name.matches (m2)) + { + xl->_append (child); + } + } + + return xl->atom(); + } + + void XMLObject::setProperty(Multiname* name_in, Atom V) + { + AvmCore *core = this->core(); + Toplevel* toplevel = this->toplevel(); + + Multiname m; + toplevel->CoerceE4XMultiname(name_in, m); + + // step 3 + if (!m.isAnyName() && !m.isAttr()) + { + Stringp name = m.getName(); + uint32 index; + if (AvmCore::getIndexFromString (name, &index)) + { + // Spec says: NOTE: this operation is reserved for future versions of E4X + toplevel->throwTypeError(kXMLAssignmentToIndexedXMLNotAllowed); + } + } + + // step 4 + if (getClass() & (E4XNode::kText | E4XNode::kCDATA | E4XNode::kComment | E4XNode::kProcessingInstruction | E4XNode::kAttribute)) + return; + + Atom c; + if (!core->isXML(V) && !core->isXMLList(V)) + { +#ifdef STRING_DEBUG + String *foo = core->string(V); +#endif // STRING_DEBUG + c = core->string(V)->atom(); + + } + else if (core->isXML(V)) + { + XMLObject *x = core->atomToXMLObject (V); + if (x->getClass() & (E4XNode::kText | E4XNode::kCDATA | E4XNode::kAttribute)) + { + c = core->string(V)->atom(); + } + else + { + c = x->_deepCopy()->atom(); + } + } + else + { + XMLListObject *xl = core->atomToXMLList (V); + c = xl->_deepCopy()->atom(); + } + + // step 5 + //Atom n = core->ToXMLName (P); + // step 6 + //Atom defaultNamespace = core->getDefaultNamespace()->atom(); + + // step 7 + if (m.isAttr()) + { + // step 7b + Stringp sc; + if (core->isXMLList (c)) + { + XMLListObject *xl = core->atomToXMLList (c); + if (!xl->_length()) + { + sc = core->kEmptyString; + } + else + { + StringBuffer output (core); + output << core->string (xl->_getAt (0)->atom()); + for (uint32 i = 1; i < xl->_length(); i++) + { + output << " " << core->string (xl->_getAt (i)->atom()); + } + + sc = core->newString (output.c_str()); + } + } + else // step 7c + { + sc = core->string (c); + } + + // step 7d + int a = -1; // -1 is null in spec + // step 7e + for (uint32 j = 0; j < this->m_node->numAttributes(); j++) + { + E4XNode *x = m_node->getAttribute(j); + Multiname m2; + x->getQName(core, &m2); + if (m.matches (&m2)) + { + if (a == -1) + { + a = j; + } + else + { + this->deleteProperty (&m2); + // notification occurrs in deleteproperty + } + } + } + if (a == -1) // step 7f + { + E4XNode *e = new (core->GetGC()) AttributeE4XNode(this->m_node, sc); + Namespace *ns = 0; + if (m.namespaceCount() == 1) + ns = m.getNamespace(); + e->setQName (core, m.getName(), ns); + + this->m_node->addAttribute (e); + + if (ns) + e->_addInScopeNamespace (core, ns); + + nonChildChanges(xmlClass()->kAttrAdded, m.getName()->atom(), sc->atom()); + } + else // step 7g + { + E4XNode *x = m_node->getAttribute(a); + Stringp prior = x->getValue(); + x->setValue (sc); + + nonChildChanges(xmlClass()->kAttrChanged, m.getName()->atom(), (prior) ? prior->atom() : undefinedAtom); + } + + // step 7h + return; + } + + if (!m.isAnyName()) + { + // step 8 + bool isValidName = core->isXMLName (m.getName()->atom()); + + // step 9 + if (!isValidName) + return; + } + + // step 10 + int32 i = -1; // -1 is undefined in spec + bool primitiveAssign = ((!core->isXML (c) && !core->isXMLList (c)) && + (!m.isAnyName())); + + // step 12 + bool notify = notifyNeeded(getNode()); + for (int k = _length() - 1; k >= 0; k--) + { + E4XNode *x = m_node->_getAt(k); + Multiname mx; + Multiname *m2 = 0; + + if (x->getClass() == E4XNode::kElement) + { + x->getQName (core, &mx); + m2 = &mx; + } + + if (m.matches (m2)) + { + // remove n-1 nodes of n matching + if (i != -1) + { + E4XNode* was = m_node->_getAt(i); + + m_node->_deleteByIndex (i); + + // notify + if (notify && (was->getClass() == E4XNode::kElement)) + { + XMLObject* nd = new (core->GetGC()) XMLObject (toplevel->xmlClass(), was); + childChanges(xmlClass()->kNodeRemoved, nd->atom()); + } + } + + i = k; + } + } + + // step 13 + if (i == -1) + { + i = _length(); + if (primitiveAssign) + { + E4XNode *e = new (core->GetGC()) ElementE4XNode (m_node); + // We use m->namespaceCount here to choose to use the default xml namespace + // name here for an unqualified prop access. For a qualified access, + // there will be only one namespace + Stringp name = m.getName(); + Namespace *ns; + if (m.namespaceCount() == 1) + ns = m.getNamespace(); + else + ns = toplevel->getDefaultNamespace(); + e->setQName (core, name, ns); + + XMLObject *y = new (core->GetGC()) XMLObject (toplevel->xmlClass(), e); + + m_node->_replace (core, toplevel, i, y->atom()); + e->_addInScopeNamespace (core, ns); + } + } + + // step 14 + if (primitiveAssign) + { + E4XNode *xi = m_node->_getAt(i); + + // children are being removed notify parent if necc. + bool notify = notifyNeeded(xi); + XMLObject* target = (notify) ? new (core->GetGC()) XMLObject(xmlClass(), xi) : 0; + + int count = xi->numChildren(); + for(int r=0;notify && (r_getAt(r); + if (ild->getClass() == E4XNode::kElement) + { + XMLObject* nd = new (core->GetGC()) XMLObject (toplevel->xmlClass(), ild); + target->childChanges(xmlClass()->kNodeRemoved, nd->atom()); + } + } + + // remember node if there was one... + Atom prior = undefinedAtom; + if (notify && count > 0) + { + XMLObject* nd = new (core->GetGC()) XMLObject (toplevel->xmlClass(), xi->_getAt(0)); + prior = nd->atom(); + } + + // step 14a - delete all properties of x[i] + xi->clearChildren(); + + Stringp s = core->string (c); + if (s->length()) + { + xi->_replace (core, toplevel, i, c); + } + } + else + { + E4XNode* prior = m_node->_replace (core, toplevel, i, c); + + if (notifyNeeded(getNode())) + { + XMLObject* xml = new (core->GetGC()) XMLObject(xmlClass(), m_node->_getAt(i)); + childChanges( (prior) ? xmlClass()->kNodeChanged : xmlClass()->kNodeAdded, xml->atom(), prior); + } + } + return; + } + + bool XMLObject::deleteProperty(Multiname* name_in) + { + AvmCore *core = this->core(); + + Multiname m; + toplevel()->CoerceE4XMultiname(name_in, m); + + // step 1 + if (!m.isAnyName() && !m.isAttr()) + { + Stringp name = m.getName(); + uint32 index; + if (AvmCore::getIndexFromString (name, &index)) + { + // Spec says: NOTE: this operation is reserved for future versions of E4X + // In Rhino, this silently fails + return true; + } + } + + if (m.isAttr()) + { + uint32 j = 0; + while (j < m_node->numAttributes()) + { + E4XNode *x = m_node->getAttribute(j); + Multiname m2; + x->getQName(core, &m2); + if (m.matches (&m2)) + { + x->setParent(NULL); + + // remove the attribute from m_attributes + m_node->getAttributes()->removeAt (j); + + Multiname previous; + x->getQName(core, &previous); + Stringp name = previous.getName(); + Stringp val = x->getValue(); + nonChildChanges(xmlClass()->kAttrRemoved, (name) ? name->atom() : undefinedAtom, (val) ? val->atom() : undefinedAtom); + } + else + { + j++; + } + } + + return true; + } + + bool notify = notifyNeeded(m_node); + uint32 q = 0; + while (q < _length()) + { + E4XNode *x = m_node->_getAt(q); + Multiname mx; + Multiname *m2 = 0; + bool isElem = x->getClass() == (E4XNode::kElement) ? true : false; + if (isElem) + { + x->getQName (core, &mx); + m2 = &mx; + } + + if (m.matches (m2)) + { + x->setParent (NULL); + m_node->_deleteByIndex (q); + + if (notify && isElem) + { + XMLObject *r = new (core->GetGC()) XMLObject (xmlClass(), x); + childChanges(xmlClass()->kNodeRemoved, r->atom()); + } + } + else + { + q++; + // if (dp > 0) + // rename property (q) to (q-dp) + // this automatically gets taken care of by deleteByIndex + } + } + // x.length = x.length - dp + // this is handled b _deleteByIndex logic + + return true; + } + + Atom XMLObject::getDescendants(Multiname* name_in) const + { + AvmCore *core = this->core(); + Toplevel* toplevel = this->toplevel(); + + Multiname m; + toplevel->CoerceE4XMultiname(name_in, m); + + XMLListObject *l = new (core->GetGC()) XMLListObject(toplevel->xmlListClass()); + + if (m.isAttr()) + { + for (uint32 i = 0; i < m_node->numAttributes(); i++) + { + E4XNode *ax = m_node->getAttribute(i); + Multiname m2; + AvmAssert(ax->getQName(core, &m2)); + ax->getQName(core, &m2); + + if (m.matches (&m2)) + { + // for each atribute, if it's name equals m, + l->_append (ax); + } + } + } + + for (uint32 k = 0; k < _length(); k++) + { + E4XNode *child = m_node->_getAt(k); + + if (!m.isAttr()) + { + Multiname mx; + Multiname *m2 = 0; + if (child->getClass() == E4XNode::kElement) + { + child->getQName (core, &mx); + m2 = &mx; + } + if (m.matches (m2)) + { + l->_append (child); + } + } + + XMLObject *co = new (core->GetGC()) XMLObject(toplevel->xmlClass(), child); + Atom dq = co->getDescendants (&m); + delete co; + XMLListObject *dql = core->atomToXMLList (dq); + if (dql && dql->_length()) + { + l->_append (dq); + } + } + + return l->atom(); + } + + // E4X 9.1.1.2, pg 13 - [[PUT]] + // E4X errata: + // 9.1.1.2 Move steps 3 and 4 to before 1 and 2, to avoid wasted effort in + // ToString or [[DeepCopy]]. + void XMLObject::setProperty(Atom P, Atom V) + { + Multiname m; + toplevel()->ToXMLName(P, m); + setProperty (&m, V); + } + + Atom XMLObject::getUintProperty(uint32 index) const + { + if (index == 0) + return this->atom(); + else + return undefinedAtom; + } + + void XMLObject::setUintProperty(uint32 /*i*/, Atom /*value*/) + { + // Spec says: NOTE: this operation is reserved for future versions of E4X + toplevel()->throwTypeError(kXMLAssignmentToIndexedXMLNotAllowed); + } + + bool XMLObject::delUintProperty(uint32 /*i*/) + { + // Spec says: NOTE: this operation is reserved for future versions of E4X + // In Rhino, this silently fails + return true; + } + + // E4X 9.1.1.3, pg 14 - [[DELETE]] + bool XMLObject::deleteProperty (Atom P) + { + Multiname m; + toplevel()->ToXMLName(P, m); + return deleteProperty (&m); + } + + // E4X 9.1.1.5, ?? + // [[DefaultValue]] ?? + + bool XMLObject::hasUintProperty(uint32 index) const + { + return (index == 0); + } + + bool XMLObject::hasProperty(Multiname* name_in) const + { + AvmCore *core = this->core(); + + Multiname m; + toplevel()->CoerceE4XMultiname(name_in, m); + + if (!m.isAnyName() && !m.isAttr()) + { + Stringp name = m.getName(); + uint32 index; + if (AvmCore::getIndexFromString (name, &index)) + { + return (index == 0); + } + } + + if (m.isAttr()) + { + for (uint32 i = 0; i < m_node->numAttributes(); i++) + { + E4XNode *ax = m_node->getAttribute(i); + Multiname m2; + if (ax->getQName(core, &m2) && (m.matches (&m2))) + { + return true; + } + } + + return false; + } + + // n is a QName + for (uint32 k = 0; k < m_node->_length(); k++) + { + E4XNode *child = m_node->_getAt(k); + Multiname mx; + Multiname *m2 = 0; + if (child->getClass() == E4XNode::kElement) + { + child->getQName (core, &mx); + m2 = &mx; + } + + if (m.matches (m2)) + { + return true; + } + } + + return false; + } + + // E4X 9.1.1.6, 16 + bool XMLObject::hasProperty (Atom P) const + { + Multiname m; + toplevel()->ToXMLName (P, m); + return hasProperty (&m); + } + + // E4X 9.1.1.7, page 16 + XMLObject *XMLObject::_deepCopy () const + { + AvmCore *core = this->core(); + + E4XNode *e = m_node->_deepCopy (core, toplevel()); + + XMLObject *y = new (core->GetGC()) XMLObject(xmlClass(), e); + + return y; + } + + // E4X 9.1.1.8, page 17 + XMLListObject *XMLObject::descendants(Atom P) const + { + Multiname m; + toplevel()->ToXMLName (P, m); + return core()->atomToXMLList (getDescendants (&m)); + } + + // E4X 9.1.1.10, page 18 + Atom XMLObject::_resolveValue () + { + return this->atom(); + } + + Namespace *XMLObject::GenerateUniquePrefix (Namespace *ns, const AtomArray *namespaces) const + { + AvmCore *core = this->core(); + + // should only be called when a namespace doesn't have a prefix + AvmAssert (ns->getPrefix() == undefinedAtom); + + // Try to use the empty string as a first try (ISNS changes) + uint32 i; + for (i = 0; i < namespaces->getLength(); i++) + { + Namespace *ns = AvmCore::atomToNamespace (namespaces->getAt(i)); + if (ns->getPrefix() == core->kEmptyString->atom()) + break; + } + + if (i == namespaces->getLength()) + { + return core->newNamespace (core->kEmptyString->atom(), ns->getURI()->atom()); + } + + // Rhino seems to start searching with whatever follows "://www" or "://" + //String *origURI = core()->string(ns->getURI()); + + wchar s[4]; + s[0] = s[1] = s[2] = 'a'; + s[3] = 0; + + for (wchar x1 = 'a'; x1 <= 'z'; x1++) + { + s[0] = x1; + for (wchar x2 = 'a'; x2 <= 'z'; x2++) + { + s[1] = x2; + for (wchar x3 = 'a'; x3 <= 'z'; x3++) + { + s[2] = x3; + bool bMatch = false; + Atom pre = core->internAlloc(s, 3)->atom(); + for (uint32 i = 0; i < namespaces->getLength(); i++) + { + Namespace *ns = AvmCore::atomToNamespace (namespaces->getAt(i)); + if (pre == ns->getPrefix()) + { + bMatch = true; + break; + } + } + + if (!bMatch) + { + return core->newNamespace (pre, ns->getURI()->atom()); + } + } + } + } + + return 0; + } + + // E4X 10.2, pg 29 + void XMLObject::__toXMLString(StringBuffer &s, AtomArray *AncestorNamespaces, int indentLevel, bool includeChildren) const + { + AvmCore *core = this->core(); + + if (toplevel()->xmlClass()->okToPrettyPrint()) + { + for (int i = 0; i < indentLevel; i++) + { + s << " "; + } + } + if (this->getClass() == E4XNode::kText) // CDATA checked below + { + if (toplevel()->xmlClass()->okToPrettyPrint()) + { + // v = removing leading and trailing whitespace from x.value + // return escapeElementValue (v); + + s << core->EscapeElementValue(m_node->getValue(), true); + return; + } + else + { + s << core->EscapeElementValue(m_node->getValue(), false); + return; + } + } + if (this->getClass() == E4XNode::kCDATA) + { + s << "getValue() << "]]>"; + return; + } + if (this->getClass() == E4XNode::kAttribute) + { + s << core->EscapeAttributeValue (m_node->getValue()->atom()); + return; + } + if (this->getClass() == E4XNode::kComment) + { + s << ""; + return; + } + if (this->getClass() == E4XNode::kProcessingInstruction) // step 7 + { + s << "getQName(core, &m) != 0); + if (m_node->getQName(core, &m)) + { + s << m.getName() << " "; + } + s << m_node->getValue() << "?>"; + return; + } + + // We're a little different than the spec here. Instead of each XMLObject + // keeping track of its entire in-scope namespace list (all the way to the + // topmost parent), the XMLObject only knows about its own declared nodes. + // So when were converting to a string, we need to build the inScopeNamespace + // list here. + + AtomArray *inScopeNS = new (core->GetGC()) AtomArray(); + m_node->BuildInScopeNamespaceList (core, inScopeNS); + uint32 origLength = AncestorNamespaces->getLength(); + + // step 8 - ancestorNamespaces passed in + // step 9/10 - add in our namespaces into ancestorNamespaces if there are no conflicts + for (uint32 i = 0; i < inScopeNS->getLength(); i++) + { + Namespace *ns = AvmCore::atomToNamespace (inScopeNS->getAt(i)); + uint32 j; + for (j = 0; j < AncestorNamespaces->getLength(); j++) + { + Namespace *ns2 = AvmCore::atomToNamespace (AncestorNamespaces->getAt(j)); +#ifdef STRING_DEBUG + Stringp u1 = ns->getURI(); + Stringp p1 = core->string(ns->getPrefix()); + Stringp u2 = ns2->getURI(); + Stringp p2 = core->string(ns2->getPrefix()); +#endif + if ((ns->getURI() == ns2->getURI()) && (ns->getPrefix() == ns2->getPrefix())) + break; + } + + if (j == AncestorNamespaces->getLength()) // a match was not found + { + AncestorNamespaces->push (ns->atom()); + } + } + + // step 11 - new ISNS changes + // If this node's namespace has an undefined prefix, generate a new one + Multiname m; + AvmAssert (getNode()->getQName (core, &m)); + getNode()->getQName (core, &m); + Namespace *thisNodesNamespace = GetNamespace (m, AncestorNamespaces); + AvmAssert(thisNodesNamespace != 0); + if (thisNodesNamespace->getPrefix() == undefinedAtom) + { + // find a prefix and add this namespace to our list + thisNodesNamespace = GenerateUniquePrefix (thisNodesNamespace, AncestorNamespaces); + AncestorNamespaces->push (thisNodesNamespace->atom()); + } + + String *nsPrefix = core->string (thisNodesNamespace->getPrefix()); + + // If any of this node's attribute's namespaces have an undefined prefix, generate a new one + for (uint32 i = 0; i < m_node->numAttributes(); i++) + { + E4XNode *an = m_node->getAttribute(i); + AvmAssert(an != 0); + AvmAssert(an->getClass() == E4XNode::kAttribute); + Multiname nam; + AvmAssert(an->getQName(core, &nam)); + an->getQName(core, &nam); + Namespace *ns = GetNamespace (nam, AncestorNamespaces); + AvmAssert(ns != 0); + if (ns->getPrefix() == undefinedAtom) + { + // find a prefix and add this namespace to our list + ns = GenerateUniquePrefix (ns, AncestorNamespaces); + + AncestorNamespaces->push (ns->atom()); + } + } + // step 12 + s << "<"; + // step13 - insert namespace prefix if we have one + if (nsPrefix != core->kEmptyString) + { + s << nsPrefix << ":"; + } + + // step 14 + AvmAssert (!m.isAnyName()); + s << m.getName(); + + // step 15 - attrAndNamespaces = sum of x.attributes and namespaceDeclarations + + // step 16 + // for each an in attrAndNamespaces + for (uint32 i = 0; i < m_node->numAttributes(); i++) + { + // step 17a + s << " "; + E4XNode *an = m_node->getAttribute(i); + AvmAssert(an != 0); + AvmAssert(an->getClass() == E4XNode::kAttribute); + Multiname nam; + AvmAssert(an->getQName(core, &nam)); + an->getQName(core, &nam); + + // step16b-i - ans = an->getName->getNamespace(AncestorNamespace); + AvmAssert(nam.isAttr()); + Namespace *attr_ns = GetNamespace (nam, AncestorNamespaces); + + //!!@step16b-ii - should never get hit now with revised 10.2.1 step 11. + AvmAssert(attr_ns->getPrefix() != undefinedAtom); + + // step16b-iii + if (attr_ns && attr_ns->hasPrefix ()) + { + s << core->string(attr_ns->getPrefix()) << ":"; + } + //step16b-iv + s << nam.getName(); + + //step16c - namespace case - see below + + //step 16d + s << "=\""; + //step 16e + s << core->EscapeAttributeValue(an->getValue()->atom()); + //step 16f - namespace case + //step 16g + s << "\""; + } + + // This adds any NS that were added to our ancestor namespace list (from origLength on up) + for (uint32 i = origLength; i < AncestorNamespaces->getLength(); i++) + { + Namespace *an = AvmCore::atomToNamespace(AncestorNamespaces->getAt(i)); + if (an->getURI() != core->kEmptyString) + { + s << " xmlns"; + AvmAssert (an->getPrefix() != undefinedAtom); + if (an->getPrefix() != core->kEmptyString->atom()) + { + // 17c iii + s << ":" << core->string(an->getPrefix()); + } + // 17d + s << "=\""; + //step 17f - namespace case + s << an->getURI(); + //step 17g + s << "\""; + } + } + +// if (thisNodesNamespace) +// AncestorNamespaces->push (thisNodesNamespace->atom()); + + // step 18 + if (!m_node->numChildren()) + { + s << "/>"; + return; + } + + // step 19 + s << ">"; + + // Added by mmorearty for the debugger + if (!includeChildren) + { + return; + } + + // step 20 + E4XNode *firstChild = m_node->_getAt(0); + AvmAssert(firstChild != 0); + bool bIndentChildren = ((_length() > 1) || (firstChild->getClass() & ~(E4XNode::kText | E4XNode::kCDATA))); + + // step 21/22 + int nextIndentLevel = 0; + if (toplevel()->xmlClass()->getPrettyPrinting() && bIndentChildren) + { + nextIndentLevel = indentLevel + toplevel()->xmlClass()->getPrettyIndent(); + } + + // We need to prune any namespaces with duplicate prefixes in our AncestorNamespace + // array to prevent shadowing of similar namespaces. Bug 153363. + // var x = + // + // burger + // 3.95 + // + // ; + // + // The namespace for menuName should be output even though the identical namespace + // was output for the top node. (Since the item node is using an incompatible + // namespace with the same prefix.) + AtomArray *newNamespaceArray = new (core->GetGC()) AtomArray(); + uint32 anLen = AncestorNamespaces->getLength(); + for (uint32 i = 0; i < anLen; i++) + { + Namespace *first = AvmCore::atomToNamespace(AncestorNamespaces->getAt(i)); + if (i < origLength) + { + uint32 j; + for (j = origLength; j < anLen; j++) + { + Namespace *second = AvmCore::atomToNamespace(AncestorNamespaces->getAt(j)); + if (second->getPrefix() == first->getPrefix()) + { + break; + } + } + + // No match, push our namespace on the list. + if (j == anLen) + { + newNamespaceArray->push (first->atom()); + } + } + else + { + newNamespaceArray->push (first->atom()); + } + } + uint32 namespaceLength = newNamespaceArray->getLength(); + + // step 23 + for (uint32 i = 0; i < _length(); i++) + { + // step 23b + E4XNode *child = m_node->_getAt(i); + XMLObject *xo = new (core->GetGC()) XMLObject(toplevel()->xmlClass(), child); + if (toplevel()->xmlClass()->okToPrettyPrint() && bIndentChildren) + { + s << "\n"; + } + xo->__toXMLString (s, newNamespaceArray, nextIndentLevel, includeChildren); + + // Our __toXMLString call might have added new namespace onto our list. We don't want to + // save these new namespaces so clear them out here. + newNamespaceArray->setLength (namespaceLength); + } + + // Part of the latest spec + if (toplevel()->xmlClass()->okToPrettyPrint() && bIndentChildren) + { + s << "\n"; + } + + //step 24 + if (toplevel()->xmlClass()->okToPrettyPrint() && bIndentChildren) + { + for (int i = 0; i < indentLevel; i++) + { + s << " "; + } + } + + //step 25 + s << "kEmptyString) + { + s << nsPrefix << ":"; + } + + //step 27 + s << m.getName() << ">"; + + //step 28 + return; + } + + // E4X 12.2, page 59 + // Support for for-in, for-each for XMLObjects + Atom XMLObject::nextName(int index) + { + AvmAssert(index > 0); + + if (index == 1) + { + AvmCore *core = this->core(); + return core->internInt (0)->atom(); + } + else + { + return nullStringAtom; + } + } + + Atom XMLObject::nextValue(int index) + { + AvmAssert(index > 0); + + if (index == 1) + return this->atom(); + else + return undefinedAtom; + } + + int XMLObject::nextNameIndex(int index) + { + AvmAssert(index >= 0); + + // XML types just return one value + if (index == 0) + return 1; + else + return 0; + } + + XMLObject *XMLObject::addNamespace (Atom _namespace) + { + AvmCore *core = this->core(); + if (core->isNamespace (_namespace)) + { + m_node->_addInScopeNamespace (core, AvmCore::atomToNamespace(_namespace)); + } + else + { + Namespace *ns = core->newNamespace (_namespace); + m_node->_addInScopeNamespace (core, ns); + + _namespace = ns->atom(); + } + + nonChildChanges(xmlClass()->kNamespaceAdded, _namespace); + return this; + } + + XMLObject *XMLObject::appendChild (Atom child) + { + AvmCore *core = this->core(); + + if (core->isXML(child)) + { + child = core->atomToXMLObject (child)->atom(); + } + else if (core->isXMLList (child)) + { + child = core->atomToXMLList (child)->atom(); + } + else // all other types go through XML constructor as a string + { + child = xmlClass()->ToXML (core->string(child)->atom()); + } + + Atom children = getProperty (core->kAsterisk); + + XMLListObject *cxl = core->atomToXMLList (children); + int index = _length(); + cxl->setUintProperty (index, child); + return this; + } + + XMLListObject *XMLObject::attribute (Atom arg) + { + // E4X 13.4.4.4 + // name= ToAttributeName (attributeName); + // return [[get]](name) + return core()->atomToXMLList (getProperty (toplevel()->ToAttributeName (arg)->atom())); + } + + XMLListObject *XMLObject::attributes () + { + // E4X 13.4.4.5 + // name= ToAttributeName ("*"); + // return [[get]](name) + + return core()->atomToXMLList (getProperty (toplevel()->ToAttributeName (core()->kAsterisk)->atom())); + } + + XMLListObject *XMLObject::child (Atom P) + { + AvmCore *core = this->core(); + + // We have an integer argument - direct child lookup + uint32 index; + if (AvmCore::getIndexFromString (core->string(P), &index)) + { + XMLListObject *xl = new (core->GetGC()) XMLListObject(toplevel()->xmlListClass()); + if ((index >= 0) && (index < m_node->numChildren())) + { + xl->_append (m_node->_getAt(index)); + } + return xl; + } + + return core->atomToXMLList (getProperty (P)); + } + + int XMLObject::childIndex() + { + if ((m_node->getParent() == NULL) || (getClass() == E4XNode::kAttribute)) + return -1; + + // find this child in parent's children list - return ordinal + + E4XNode *parent = m_node->getParent(); + AvmAssert(parent != 0); + AvmAssert(parent->_length()); // this child's parent does not contain itself??? + + for (uint32 i = 0; i < parent->_length(); i++) + { + E4XNode *x = parent->_getAt(i); + if (x == m_node) + { + return i; + } + } + + // this child's parent does not contain itself??? + AvmAssert(0); + return -1; + } + + XMLListObject *XMLObject::children () + { + return core()->atomToXMLList (getProperty (core()->kAsterisk)); + } + + // E4X 13.4.4.8, pg 75 + XMLListObject *XMLObject::comments () + { + AvmCore *core = this->core(); + + XMLListObject *l = new (core->GetGC()) XMLListObject(toplevel()->xmlListClass(), this->atom()); + + for (uint32 i = 0; i < m_node->_length(); i++) + { + E4XNode *child = m_node->_getAt(i); + + if (child->getClass() == E4XNode::kComment) + { + l->_append (child); + } + } + + return l; + } + + // E4X 13.4.4.10, pg 75 + bool XMLObject::contains (Atom value) + { + AvmCore *core = this->core(); + + // !!@ Rhino returns false for this case... + // var xml = new XML("simple"); + // print ("contains: " + xml.contains ("simple")); + // ...which seems to imply that this routine is calling _equals and not + // does a "comparison x == value" as stated in the spec. We'll mimic + // Rhino for the time being but the correct behavior needs to be determined + if (this->atom() == value) + return true; + + if (!core->isXML (value)) + return false; + + E4XNode *v = core->atomToXML(value); + + return getNode()->_equals (core, v) == trueAtom; // rhino + //SPEC - return (core()->eq (this->atom(), value) == trueAtom); + } + + // E4X 13.4.4.11, pg 76 + XMLObject *XMLObject::copy () + { + return _deepCopy (); + } + + // E4X 13.4.4.13, pg 76 + XMLListObject *XMLObject::elements (Atom name) // name defaults to '*' + { + AvmCore *core = this->core(); + Multiname m; + toplevel()->ToXMLName(name, m); + + XMLListObject *l = new (core->GetGC()) XMLListObject(toplevel()->xmlListClass(), this->atom()); + + for (uint32 i = 0; i < _length(); i++) + { + E4XNode *child = m_node->_getAt(i); + + if (child->getClass() == E4XNode::kElement) + { + Multiname m2; + child->getQName(core, &m2); + + // if name.localName = "*" or name.localName =child->name.localName) + // and (name.uri == null) or (name.uri == child.name.uri)) + if (m.matches (&m2)) + { + // if name.localName = "*" or name.localName =child->name.localName) + // and (name.uri == null) or (name.uri == child.name.uri)) + l->_append (child); + } + } + } + + return l; + } + + // E4X 13.4.4.14, page 77 + bool XMLObject::hasOwnProperty (Atom P) + { + if (hasProperty (P)) + return true; + + // if this has a property with name ToSString(P), return true; + // !!@ spec talks about prototype object being different from regular XML object + + return false; + } + + // E4X 13.4.4.15, page 77 + bool XMLObject::hasComplexContent () + { + if (m_node->getClass() & (E4XNode::kText | E4XNode::kComment | E4XNode::kProcessingInstruction | E4XNode::kAttribute | E4XNode::kCDATA)) + return false; + + for (uint32 i = 0; i < m_node->_length(); i++) + { + E4XNode *child = m_node->_getAt(i); + + if (child->getClass() == E4XNode::kElement) + { + return true; + } + } + + return false; + } + + // E4X 13.4.4.16, page 77 + bool XMLObject::hasSimpleContent () + { + if (m_node->getClass() & (E4XNode::kComment | E4XNode::kProcessingInstruction)) + return false; + + // for each prop in x, if x.class == element, return false + for (uint32 i = 0; i < m_node->_length(); i++) + { + E4XNode *child = m_node->_getAt(i); + + if (child->getClass() == E4XNode::kElement) + { + return false; + } + } + + return true; + } + + // E4X 13.4.4.17, page 78 + ArrayObject *XMLObject::inScopeNamespaces () + { + AvmCore *core = this->core(); + // step 2 + AtomArray *inScopeNS = new (core->GetGC()) AtomArray(); + + // step 3 + m_node->BuildInScopeNamespaceList (core, inScopeNS); + + ArrayObject *a = toplevel()->arrayClass->newArray(inScopeNS->getLength()); + + uint32 i; + for (i = 0; i < inScopeNS->getLength(); i++) + { + a->setUintProperty (i, inScopeNS->getAt(i)); + } + + // !!@ Rhino behavior always seems to return at least one NS + if (!inScopeNS->getLength()) + { + a->setUintProperty (i, core->newNamespace(core->kEmptyString)->atom()); + } + + return a; + } + + // E4X 13.4.4.18, page 78 + Atom XMLObject::insertChildAfter (Atom child1, Atom child2) + { + AvmCore *core = this->core(); + Toplevel *toplevel = this->toplevel(); + + if (getClass() & (E4XNode::kText | E4XNode::kComment | E4XNode::kProcessingInstruction | E4XNode::kAttribute | E4XNode::kCDATA)) + return undefinedAtom; + + if (core->isXML(child2)) + { + child2 = core->atomToXMLObject (child2)->atom(); + } + else if (core->isXMLList (child2)) + { + child2 = core->atomToXMLList (child2)->atom(); + } + else // all other types go through XML constructor as a string + { + child2 = xmlClass()->ToXML (core->string(child2)->atom()); + } + + if (AvmCore::isNull(child1)) + { + m_node->_insert (core, toplevel, 0, child2); + childChanges(xmlClass()->kNodeAdded, child2); + return this->atom(); + } + else + { + E4XNode *c1 = core->atomToXML (child1); + // Errata extension to E4X spec - treat XMLList with length=1 as a XMLNode + if (!c1 && core->isXMLList (child1)) + { + XMLListObject *xl = core->atomToXMLList(child1); + if (xl->_length() == 1) + c1 = xl->_getAt(0)->m_node; + } + if (c1) + { + for (uint32 i = 0; i < _length(); i++) + { + E4XNode *child = m_node->_getAt(i); + + if (child == c1) + { + m_node->_insert (core, toplevel, i + 1, child2); + childChanges(xmlClass()->kNodeAdded, child2); + return this->atom(); + } + } + } + } + + return undefinedAtom; + } + + // E4X 13.4.4.19, page 79 + Atom XMLObject::insertChildBefore (Atom child1, Atom child2) + { + AvmCore *core = this->core(); + Toplevel *toplevel = this->toplevel(); + + if (getClass() & (E4XNode::kText | E4XNode::kComment | E4XNode::kProcessingInstruction | E4XNode::kAttribute | E4XNode::kCDATA)) + return undefinedAtom; + + if (core->isXML(child2)) + { + child2 = core->atomToXMLObject (child2)->atom(); + } + else if (core->isXMLList (child2)) + { + child2 = core->atomToXMLList (child2)->atom(); + } + else // all other types go through XML constructor as a string + { + child2 = xmlClass()->ToXML (core->string(child2)->atom()); + } + + if (AvmCore::isNull(child1)) + { + m_node->_insert (core, toplevel, _length(), child2); + childChanges(xmlClass()->kNodeAdded, child2); + return this->atom(); + } + else + { + E4XNode *c1 = core->atomToXML (child1); + // Errata extension to E4X spec - treat XMLList with length=1 as a XMLNode + if (!c1 && core->isXMLList (child1)) + { + XMLListObject *xl = core->atomToXMLList(child1); + if (xl->_length() == 1) + c1 = xl->_getAt(0)->m_node; + } + if (c1) + { + for (uint32 i = 0; i < _length(); i++) + { + E4XNode *child = m_node->_getAt(i); + + if (child == c1) + { + m_node->_insert (core, toplevel, i, child2); + childChanges(xmlClass()->kNodeAdded, child2); + return this->atom(); + } + } + } + } + + return undefinedAtom; + } + + // E4X 13.4.4.21, page 80 + Atom XMLObject::localName () + { + Multiname m; + if (m_node->getQName(core(), &m) == 0) + { + return nullStringAtom; + } + else + { + return m.getName()->atom(); + } + } + + // E4X 13.4.4.22, page 80 + Atom XMLObject::name () + { + AvmCore *core = this->core(); + Multiname m; + if (!m_node->getQName(core, &m)) + return nullObjectAtom; + + return (new (core->GetGC(), toplevel()->qnameClass()->ivtable()->getExtraSize()) QNameObject(toplevel()->qnameClass(), m))->atom(); + } + + // E4X 13.4.4.23, page 80 + Atom XMLObject::getNamespace (Atom *argv, int argc) // prefix is optional + { + AvmCore *core = this->core(); + + // step 2 + AtomArray *inScopeNS = new (core->GetGC()) AtomArray(); + + // step 3 + m_node->BuildInScopeNamespaceList (core, inScopeNS); + + // step 5 + if (!argc) + { + // step 5a + if (getClass() & (E4XNode::kText | E4XNode::kComment | E4XNode::kCDATA | E4XNode::kProcessingInstruction)) + return nullObjectAtom; + + // step 5b + // Return the result of calling [[GetNamespace]] method of + // x.[[Name]] with argument inScopeNS + Multiname m; + AvmAssert(getQName(&m)); + getQName(&m); + Namespace *ns = GetNamespace (m, inScopeNS); + + return (ns->atom()); + } + else + { + Atom prefix = core->internString (core->string (argv[0]))->atom(); + + for (uint32 i = 0; i < inScopeNS->getLength(); i++) + { + Namespace *ns = AvmCore::atomToNamespace (inScopeNS->getAt(i)); + if (ns->getPrefix() == prefix) + return ns->atom(); + } + + return undefinedAtom; + } + } + + // 13.4.4.24, pg 80-81 + ArrayObject *XMLObject::namespaceDeclarations () + { + AvmCore *core = this->core(); + ArrayObject *a = toplevel()->arrayClass->newArray(); + + if (getClass() & (E4XNode::kText | E4XNode::kComment | E4XNode::kProcessingInstruction | E4XNode::kAttribute | E4XNode::kCDATA)) + return a; + + E4XNode *y = m_node->getParent(); + + // step 4+5 + AtomArray *ancestorNS = new (core->GetGC()) AtomArray(); + if (y) + y->BuildInScopeNamespaceList (core, ancestorNS); + + uint32 arrayIndex = 0; + + // step 7+8+9+10 + for (uint32 i = 0; i < m_node->numNamespaces(); i++) + { + Namespace *ns = AvmCore::atomToNamespace (m_node->getNamespaces()->getAt(i)); + if (!ns->hasPrefix ()) + { + // Emulating Rhino behavior + if (ns->getURI() != core->kEmptyString) + { + bool bMatch = false; + for (uint32 j = 0; j < ancestorNS->getLength(); j++) + { + Namespace *ns2 = AvmCore::atomToNamespace (ancestorNS->getAt(j)); + if (ns->getURI() == ns2->getURI()) + { + bMatch = true; + break; + } + } + + if (!bMatch) + { + a->setUintProperty (arrayIndex++, ns->atom()); + } + } + } + else // ns.prefix is NOT empty + { + bool bMatch = false; + for (uint32 j = 0; j < ancestorNS->getLength(); j++) + { + Namespace *ns2 = AvmCore::atomToNamespace (ancestorNS->getAt(j)); + if (ns->getPrefix() == ns2->getPrefix() && ns->getURI() == ns2->getURI()) + { + bMatch = true; + break; + } + } + + if (!bMatch) + { + a->setUintProperty (arrayIndex++, ns->atom()); + } + } + } + + return a; + } + + String *XMLObject::nodeKind () const + { + switch (m_node->getClass()) + { + case E4XNode::kAttribute: + return toplevel()->xmlClass()->kAttribute; + case E4XNode::kText: + case E4XNode::kCDATA: + return toplevel()->xmlClass()->kText; + case E4XNode::kComment: + return toplevel()->xmlClass()->kComment; + case E4XNode::kProcessingInstruction: + return toplevel()->xmlClass()->kProcessingInstruction; + case E4XNode::kElement: + return toplevel()->xmlClass()->kElement; + case E4XNode::kUnknown: + default: + AvmAssert(0); + return 0; + } + } + + XMLObject *XMLObject::normalize () + { + AvmCore* core = this->core(); + + bool notify = notifyNeeded(getNode()); + uint32 i = 0; + while (i < _length()) + { + E4XNode *x = m_node->_getAt(i); + if (x->getClass() == E4XNode::kElement) + { + XMLObject *xo = new (core->GetGC()) XMLObject(toplevel()->xmlClass(), x); + xo->normalize(); + delete xo; + i++; + } + else if (x->getClass() & (E4XNode::kText | E4XNode::kCDATA)) + { + Stringp prior = x->getValue(); + while (((i + 1) < _length()) && (m_node->_getAt(i + 1)->getClass() & (E4XNode::kText | E4XNode::kCDATA))) + { + E4XNode *x2 = m_node->_getAt(i + 1); + x->setValue (core->concatStrings(x->getValue(), x2->getValue())); + m_node->_deleteByIndex (i + 1); + + if (notify) + { + XMLObject *nd = new (core->GetGC()) XMLObject (xmlClass(), x2); + childChanges(xmlClass()->kNodeRemoved, nd->atom()); + } + } + /// Need to check if string is "empty" - 0 length or filled with whitespace + if (x->getValue()->isWhitespace()) + { + E4XNode* prior = m_node->_getAt(i); + + m_node->_deleteByIndex (i); + + if (notify) + { + XMLObject *nd = new (core->GetGC()) XMLObject (xmlClass(), prior); + childChanges(xmlClass()->kNodeRemoved, nd->atom()); + } + } + else + { + i++; + } + + // notify if the node has changed value + Stringp current = x->getValue(); + if ((current != prior) && notify) + { + XMLObject *xo = new (core->GetGC()) XMLObject (xmlClass(), x); + xo->nonChildChanges(xmlClass()->kTextSet, current->atom(), (prior) ? prior->atom() : undefinedAtom); + } + } + else + { + i++; + } + } + + return this; + } + + Atom XMLObject::parent () + { + if (m_node->getParent()) + return (new (core()->GetGC()) XMLObject (toplevel()->xmlClass(), m_node->getParent()))->atom(); + else + return undefinedAtom; + } + + XMLListObject *XMLObject::processingInstructions (Atom name) // name defaults to '*' + { + AvmCore *core = this->core(); + + Multiname m; + toplevel()->ToXMLName(name, m); + + XMLListObject *xl = new (core->GetGC()) XMLListObject(toplevel()->xmlListClass(), this->atom()); + + if (m.isAttr()) + return xl; + + for (uint32 i = 0; i < m_node->_length(); i++) + { + E4XNode *child = m_node->_getAt(i); + + if (child->getClass() == E4XNode::kProcessingInstruction) + { + Multiname m2; + bool bFound = child->getQName(core, &m2); + + // if name.localName = "*" or name.localName =child->name.localName) + // and (name.uri == null) or (name.uri == child.name.uri)) + if (m.matches (bFound ? &m2 : 0)) + { + xl->_append (child); + } + } + } + + return xl; + } + + XMLObject *XMLObject::prependChild (Atom value) + { + AvmCore *core = this->core(); + Toplevel *toplevel = this->toplevel(); + + if (core->isXML(value)) + { + value = core->atomToXMLObject (value)->atom(); + } + else if (core->isXMLList (value)) + { + value = core->atomToXMLList (value)->atom(); + } + else // all other types go through XML constructor as a string + { + value = xmlClass()->ToXML (core->string(value)->atom()); + } + + m_node->_insert (core, toplevel, 0, value); + + childChanges(xmlClass()->kNodeAdded, value); + return this; + } + + bool XMLObject::propertyIsEnumerable (Atom P) + { + AvmCore *core = this->core(); + if (core->intern(P) == core->internString (core->newString("0"))) + return true; + + return false; + } + + // 13.4.4.31, pg 83 + XMLObject *XMLObject::removeNamespace (Atom nsAtom) + { + AvmCore *core = this->core(); + if (getClass() & (E4XNode::kText | E4XNode::kComment | E4XNode::kProcessingInstruction | E4XNode::kAttribute | E4XNode::kCDATA)) + return this; + + Namespace *ns = core->isNamespace (nsAtom) ? AvmCore::atomToNamespace (nsAtom) : core->newNamespace (nsAtom); + + Multiname m; + AvmAssert(getQName(&m)); + getQName(&m); + Namespace *thisNS = GetNamespace (m, m_node->getNamespaces()); + + // step 4 + if (thisNS == ns) + return this; + + //step 5 + for (uint32 j = 0; j < m_node->numAttributes(); j++) + { + E4XNode *a = m_node->getAttribute(j); + Multiname m; + AvmAssert(a->getQName(core, &m)); + a->getQName(core, &m); + Namespace *anNS = GetNamespace (m, m_node->getNamespaces()); + if (anNS == ns) + return this; + } + + // step 6+7 + int32 i = m_node->FindMatchingNamespace (core, ns); + if (i != -1) + { + m_node->getNamespaces()->removeAt(i); + } + + // step 8 + for (uint32 k = 0; k < _length(); k++) + { + E4XNode *p = m_node->_getAt(k); + if (p->getClass() == E4XNode::kElement) + { + XMLObject *xo = new (core->GetGC()) XMLObject(toplevel()->xmlClass(), p); + xo->removeNamespace (ns->atom()); + delete xo; + } + } + + // step 9 + // Note about namespaces in ancestors and parents, etc. + nonChildChanges(xmlClass()->kNamespaceRemoved, ns->atom()); + return this; + } + + XMLObject *XMLObject::replace (Atom P, Atom value) + { + AvmCore *core = this->core(); + Toplevel *toplevel = this->toplevel(); + + if (getClass() & (E4XNode::kText | E4XNode::kComment | E4XNode::kProcessingInstruction | E4XNode::kAttribute | E4XNode::kCDATA)) + return this; + + Atom c; + if (core->isXML(value)) + { + XMLObject *x = core->atomToXMLObject (value); + c = x->_deepCopy()->atom(); + } + else if (core->isXMLList(value)) + { + XMLListObject *xl = core->atomToXMLList (value); + c = xl->_deepCopy()->atom(); + } + else + { + c = xmlClass()->ToXML (core->string(value)->atom()); + } + + uint32 index; + if (AvmCore::getIndexFromString (core->string(P), &index)) + { + E4XNode* prior = m_node->_replace (core, toplevel, index, c); + childChanges(xmlClass()->kNodeChanged, c, prior); + return this; + } + + QNameObject *qn1 = new (core->GetGC(), toplevel->qnameClass()->ivtable()->getExtraSize()) QNameObject(toplevel->qnameClass(), P); + Multiname m; + qn1->getMultiname(m); + bool notify = notifyNeeded(getNode()); + int i = -1; + for (int k = int(_length()) - 1; k >= 0; k--) + { + E4XNode *x = m_node->_getAt (k); + Multiname *m2 = 0; + + // m3 needs to exist outside this if scope since m2 will point to it + Multiname m3; + if (x->getClass() == E4XNode::kElement) + { + if (x->getQName (core, &m3)) + m2 = &m3; + } + + if (m.matches(m2)) + { + if (i != -1) + { + E4XNode* was = m_node->_getAt(i); + + m_node->_deleteByIndex (i); + + // notify + if (notify && was->getClass() == E4XNode::kElement) + { + XMLObject* nd = new (core->GetGC()) XMLObject (xmlClass(), was); + childChanges(xmlClass()->kNodeRemoved, nd->atom()); + } + } + + i = k; + } + } + delete qn1; + + if (i == -1) + return this; + + E4XNode* prior = m_node->_replace (core, toplevel, i, c); + childChanges( (prior) ? xmlClass()->kNodeChanged : xmlClass()->kNodeAdded, c, prior); + return this; + } + + XMLObject *XMLObject::setChildren (Atom value) + { + setProperty (core()->kAsterisk, value); + return this; + } + + void XMLObject::setLocalName (Atom name) + { + if (m_node->getClass() & (E4XNode::kText | E4XNode::kComment | E4XNode::kCDATA)) + return; + + AvmCore *core = this->core(); + + QNameObject *qn = core->atomToQName (name); + Stringp newname; + if (qn) + { + newname = qn->getLocalName(); + } + else + { + newname = core->intern(name); + } + + if (!core->isXMLName (newname->atom())) + toplevel()->throwTypeError(kXMLInvalidName, newname); + + Multiname m; + if (this->getNode()->getQName(core, &m)) + { + Multiname previous; + getNode()->getQName(core, &previous); + Stringp prior = previous.getName(); + + m.setName (newname); + getNode()->setQName (core, &m); + + nonChildChanges(xmlClass()->kNameSet, m.getName()->atom(), (prior) ? prior->atom() : undefinedAtom ); + } + return; + } + + void XMLObject::setName (Atom name) + { + AvmCore *core = this->core(); + + if (m_node->getClass() & (E4XNode::kText | E4XNode::kComment | E4XNode::kCDATA)) + return; + + if (core->isQName (name)) + { + QNameObject *q = core->atomToQName (name); + if (AvmCore::isNull(q->getURI())) + { + name = q->getLocalName()->atom(); + } + } + + QNameObject *n = new (core->GetGC(), toplevel()->qnameClass()->ivtable()->getExtraSize()) QNameObject(toplevel()->qnameClass(), name); + + Stringp s = n->getLocalName(); + if (!core->isXMLName (s->atom())) + toplevel()->throwTypeError(kXMLInvalidName, s); + + Multiname m; + if (m_node->getQName(core, &m)) + { + if (m_node->getClass() == E4XNode::kProcessingInstruction) + { + m_node->setQName (core, n->getLocalName(), core->publicNamespace); + } + else // only for attribute and element nodes + { + Multiname m2; + n->getMultiname (m2); + m_node->setQName (core, &m2); + + // ISNS changes + if (n->getURI() != core->kEmptyString->atom()) + { + m_node->getQName(core, &m); // get our new multiname + + if (this->getClass() == E4XNode::kAttribute && getNode()->getParent()) + { + getNode()->getParent()->_addInScopeNamespace (core, m.getNamespace()); + } + else if (this->getClass() == E4XNode::kElement) + { + getNode()->_addInScopeNamespace (core, m.getNamespace()); + } + } + } + + nonChildChanges(xmlClass()->kNameSet, name, m.getName()->atom()); + } + return; + } + + void XMLObject::setNamespace (Atom ns) + { + AvmCore *core = this->core(); + + if (m_node->getClass() & (E4XNode::kText | E4XNode::kComment | E4XNode::kProcessingInstruction | E4XNode::kCDATA)) + return; + + Namespace* newns = core->newNamespace (ns); + + Multiname m; + if (m_node->getQName(core, &m)) + { + m_node->setQName (core, m.getName(), newns); + } + + // ISNS changes + if (this->getClass() == E4XNode::kAttribute && getNode()->getParent()) + { + getNode()->getParent()->_addInScopeNamespace (core, newns); + } + else if (this->getClass() == E4XNode::kElement) + { + getNode()->_addInScopeNamespace (core, newns); + } + + nonChildChanges(xmlClass()->kNamespaceSet, newns->atom()); + return; + } + + XMLListObject *XMLObject::text () + { + XMLListObject *l = new (gc()) XMLListObject(toplevel()->xmlListClass(), this->atom()); + + for (uint32 i = 0; i < m_node->_length(); i++) + { + E4XNode *child = m_node->_getAt(i); + if (child->getClass() & (E4XNode::kText | E4XNode::kCDATA)) + { + l->_append (child); + } + } + + return l; + } + + // E4X 10.1, page 28 + Atom XMLObject::toString () + { + AvmCore *core = this->core(); + + if (getClass() & (E4XNode::kText | E4XNode::kCDATA | E4XNode::kAttribute)) + { + return m_node->getValue()->atom(); + } + + if (hasSimpleContent()) + { + Stringp s = core->kEmptyString; + + for (uint32 i = 0; i < _length(); i++) + { + E4XNode *child = m_node->_getAt(i); + if ((child->getClass() != E4XNode::kComment) && (child->getClass() != E4XNode::kProcessingInstruction)) + { + + XMLObject *xo = new (core->GetGC()) XMLObject(toplevel()->xmlClass(), child); + s = core->concatStrings(s, core->string(xo->toString())); + delete xo; + } + } + + return s->atom(); + } + else + { + AtomArray *AncestorNamespaces = new (core->GetGC()) AtomArray(); + StringBuffer s(core); + __toXMLString(s, AncestorNamespaces, 0); + return core->newString(s.c_str())->atom(); + } + } + + Stringp XMLObject::toStringMethod() + { + // This is a non-virtual version of toString. + // This method is needed because pointer->method in Codewarrior + // is different depending on wheher the method is virtual or not, + // causing problems with NATIVE_METHOD. + return core()->atomToString(toString()); + } + + String *XMLObject::toXMLString () + { + AtomArray *AncestorNamespaces = new (MMgc::GC::GetGC(this)) AtomArray(); + StringBuffer s(core()); + __toXMLString(s, AncestorNamespaces, 0); + return core()->newString(s.c_str()); + } + +#ifdef AVMPLUS_VERBOSE + Stringp XMLObject::format(AvmCore* core) const + { + // + // [mmorearty 10/24/05] Flex Builder 2.0 relies on this format in order to + // have a nice display of XML in the Variables view: + // + // "XML@hexaddr nodeKind text_to_display" + // + AtomArray *AncestorNamespaces = new (core->GetGC()) AtomArray(); + StringBuffer openTag(core); + __toXMLString(openTag, AncestorNamespaces, 0, false); + Stringp openingTag = core->newString (openTag.c_str()); + Stringp space = core->newString(" "); + + Stringp result = ScriptObject::format(core); + result = core->concatStrings(result, space); + result = core->concatStrings(result, nodeKind()); + result = core->concatStrings(result, space); + result = core->concatStrings(result, openingTag); + return result; + } +#endif + + int XMLObject::getClass() const + { + return m_node->getClass() ; + } + + uint32 XMLObject::_length() const + { + return m_node->_length(); + } + + XMLObject *XMLObject::getParent() + { + if (m_node->getParent()) + return new (core()->GetGC()) XMLObject (toplevel()->xmlClass(), m_node->getParent()); + else + return 0; + } + + void XMLObject::setValue(Stringp s) + { + m_node->setValue (s); + } + + Stringp XMLObject::getValue() + { + return m_node->getValue(); + } + + bool XMLObject::getQName(Multiname *m) + { + return m_node->getQName(core(), m); + } + + void XMLObject::setNotification(ScriptObject* f) + { + AvmCore* core = this->core(); + + // Notifiers MUST be functions or null + if (f && !core->istype(f->atom(), core->traits.function_itraits)) + toplevel()->throwArgumentError( kInvalidArgumentError, "f"); + else + m_node->setNotification(core, f); + } + + ScriptObject* XMLObject::getNotification() + { + return m_node->getNotification(); + } + + bool XMLObject::notifyNeeded(E4XNode* initialTarget) + { + // do a quick probe to see if we need to issue any notifications + bool hit = false; + E4XNode* node = initialTarget; + while(node) + { + if (node->getNotification()) + { + hit = true; + break; + } + node = node->getParent(); + } + return hit; + } + + /** + * Notification on generic node addition from XML or XMLList + */ + void XMLObject::childChanges(Atom type, Atom value, E4XNode* prior) + { + AvmCore* core = this->core(); + Toplevel* top = this->toplevel(); + E4XNode* initialTarget = m_node; + + if (notifyNeeded(initialTarget)) + { + XMLObject* target = new (core->GetGC()) XMLObject(top->xmlClass(), initialTarget); + Atom detail = undefinedAtom; + if (prior) + { + XMLObject* xml = new (core->GetGC()) XMLObject(xmlClass(), prior); + detail = xml->atom(); + } + + if (core->isXML(value)) + { + issueNotifications(core, top, initialTarget, target->atom(), type, value, detail); + } + else if (core->isXMLList(value)) + { + // if its a list each element in the list is added. + XMLListObject* xl = core->atomToXMLList(value); + if (xl) + { + issueNotifications(core, top, initialTarget, target->atom(), type, xl->atom(), detail); + } + else + { + AvmAssert(false); + } + } + else + { + // non child updates + } + } + } + + void XMLObject::nonChildChanges(Atom type, Atom value, Atom detail) + { + AvmCore* core = this->core(); + Toplevel* top = this->toplevel(); + E4XNode* initialTarget = m_node; + if (notifyNeeded(initialTarget)) + { + XMLObject* target = new (core->GetGC()) XMLObject(top->xmlClass(), initialTarget); + issueNotifications(core, top, initialTarget, target->atom(), type, value, detail); + } + } + + /** + * Perform the callback for each node in which the notification property is set. + */ + void XMLObject::issueNotifications(AvmCore* core, Toplevel* top, E4XNode* initialTarget, Atom target, Atom type, Atom value, Atom detail) + { + // start notification at initialtarget + E4XNode* node = initialTarget; + + while(node) + { + // check if notification param set + ScriptObject* methodObj = node->getNotification(); + if (methodObj) + { + XMLObject* currentTarget = new (core->GetGC()) XMLObject(top->xmlClass(), node); + Atom argv[6] = { top->atom(), currentTarget->atom(), type, target, value, detail }; + int argc = 5; + + //EnterScriptTimeout enterScriptTimeout(core); + TRY(core, kCatchAction_Rethrow) + { + methodObj->call(argc, argv); + } + CATCH(Exception *exception) + { + // you chuck, we chuck + core->throwException(exception); + } + END_CATCH + END_TRY + } + + // bubble up + node = node->getParent(); + } + } + +#ifdef XML_FILTER_EXPERIMENT + XMLListObject * XMLObject::filter (Atom propertyName, Atom value) + { + Multiname m; + toplevel()->ToXMLName(propertyName, m); + + Multiname name; + toplevel()->CoerceE4XMultiname(&m, name); + + // filter opcode experiment + XMLListObject *l = new (core()->gc) XMLListObject(toplevel()->xmlListClass(), nullObjectAtom); + this->_filter (l, name, value); + + return l; + } + + void XMLObject::_filter (XMLListObject *l, const Multiname &name, Atom value) + { + AvmCore *core = this->core(); + + if (!name.isAnyName()) + { + // We have an integer argument - direct child lookup + Stringp nameString = name.getName(); + uint32 index; + if (AvmCore::getIndexFromString (nameString, &index)) + { + if (index == 0) + { + if (core->eq (this->atom(), value)) + { + l->_append (this->getNode()); + } + } + } + } + + if (name.isAttr()) + { + // for each a in x.[[attributes]] + for (uint32 i = 0; i < m_node->numAttributes(); i++) + { + E4XNode *xml = m_node->getAttribute(i); + + AvmAssert(xml && xml->getClass() == E4XNode::kAttribute); + + Multiname m; + AvmAssert(xml->getQName(core, &m) != 0); + + xml->getQName (core, &m); + if (name.matches (&m)) + { + if (core->eq(xml->getValue()->atom(), value) == trueAtom) + l->_append (xml); + } + } + + return; + } + + for (uint32 i = 0; i < m_node->numChildren(); i++) + { + E4XNode *child = m_node->_getAt(i); + Multiname m; + Multiname *m2 = 0; + if (child->getClass() == E4XNode::kElement) + { + child->getQName(core, &m); + m2 = &m; + } + + if (name.matches (m2)) + { + // If we're an element node, we do something more complicated than a string compare + if (child->getClass() == E4XNode::kElement) + { + // Hacky swaping of our XMLObject's node ptr to point to the child + // node so we can call out to AvmCore::eq with an atom. + E4XNode *savedNode = this->m_node; + this->m_node = child; + if (core->eq(this->atom(), value) == trueAtom) + l->_append (child); + this->m_node = savedNode; + } + else + { + // !!@ this needs testing with comments/PI/text/etc. + if (core->eq(child->getValue()->atom(), value) == trueAtom) + l->_append (child); + } + + } + } + } +#endif // XML_FILTER_EXPERIMENT + + ///////////////////////////////////////////////////////////////// + ///////////////////////////////////////////////////////////////// + ///////////////////////////////////////////////////////////////// + + QNameObject::QNameObject (QNameClass *factory, Multiname &name) + : ScriptObject(factory->ivtable(), factory->prototype), m_mn(name) + { + } + + /** + * QNameObject is used to represent the "QName" object in the E4X Specification. + * + * We also use this same object to represent "AttributeName" in the E4X spec. + * An AttributeName is simply a QName wrapper for finding properties that have a leading @ sign. + * It's an internal class to the spec and the only difference between a QName is the @. Instead of + * having the overhead of an AttributeName class that wraps the QName class, we just use a boolean + * inside the QName to differentiate betweent the two types. + */ + QNameObject::QNameObject(QNameClass *factory, Namespace *ns, Atom nameatom, bool bA) + : ScriptObject(factory->ivtable(), factory->prototype), + m_mn() + { + // Set attribute bit in multiname + if (bA) + m_mn.setAttr(); + + AvmCore *core = this->core(); + + Stringp name; + if (core->isQName(nameatom)) + { + QNameObject *q = core->atomToQName(nameatom); + name = q->m_mn.getName(); + } + else if (nameatom == undefinedAtom) + { + name = core->kEmptyString; + } + else + { + name = core->intern(nameatom); + } + + if (name == core->kAsterisk) + { + this->m_mn.setAnyName(); + AvmAssert(this->m_mn.isAnyName()); + } + else + { + this->m_mn.setName(name); + } + + if (ns == NULL) + { + this->m_mn.setAnyNamespace(); + } + else + { + this->m_mn.setNamespace(core->internNamespace(ns)); + this->m_mn.setQName(); + } + } + + /** + * called when no namespace specified. + */ + QNameObject::QNameObject(QNameClass *factory, Atom nameatom, bool bA) + : ScriptObject(factory->ivtable(), factory->prototype), + m_mn() + { + // Set attribute bit in multiname + if (bA) + m_mn.setAttr(); + + AvmCore *core = this->core(); + Toplevel* toplevel = this->toplevel(); + + if (core->isQName(nameatom)) + { + QNameObject *q = core->atomToQName (nameatom); + m_mn = q->m_mn; + if (bA) + m_mn.setAttr(); + return; + } + + Stringp name = core->intern(nameatom); + if (name == core->kAsterisk) + { + this->m_mn.setAnyNamespace(); + this->m_mn.setAnyName(); + AvmAssert(this->m_mn.isAnyName()); + } + else + { + if (nameatom == undefinedAtom) + { + this->m_mn.setName (core->kEmptyString); + } + else + { + this->m_mn.setName(name); + } + + this->m_mn.setNamespace(toplevel->getDefaultNamespace()); + } + } + + Stringp QNameObject::getLocalName() const + { + if (this->m_mn.isAnyName()) + return core()->kAsterisk; + + return m_mn.getName(); + } + + Atom QNameObject::getURI() const + { + if (m_mn.isAnyNamespace()) + { + return nullStringAtom; + } + else if (m_mn.namespaceCount() > 1) + { + return core()->kEmptyString->atom(); + } + else + { + return m_mn.getNamespace()->getURI()->atom(); + } + } + + // E4X 13.3.5.4, pg 69 + Namespace *XMLObject::GetNamespace (const Multiname &mn, const AtomArray *nsArray) const + { + AvmCore *core = this->core(); + + Stringp uri = (mn.isAnyNamespace() ? 0 : mn.getNamespace()->getURI()); + + if (nsArray) + { + for (uint32 i = 0; i < nsArray->getLength(); i++) + { + Namespace *ns = AvmCore::atomToNamespace (nsArray->getAt(i)); + AvmAssert(int(ns)); +#ifdef STRING_DEBUG + Stringp s1 = ns->getURI(); + Stringp s2 = uri; +#endif // STRING_DEBUG + if (ns->getURI() == uri) + { + return ns; + } + } + } + + // not found, return empty namespace based upon this QName's uri. + return core->newNamespace (uri->atom()); + } + + // Iterator support - for in, for each + Atom QNameObject::nextName(int index) + { + AvmAssert(index > 0); + // first return "uri" then "localName" + if (index == 1) + return toplevel()->qnameClass()->kUri; + else if (index == 2) + return toplevel()->qnameClass()->kLocalName; + else + return nullObjectAtom; + } + + Atom QNameObject::nextValue(int index) + { + AvmAssert(index > 0); + // first return uri then localName + if (index == 1) + return this->getLocalName()->atom(); + else if (index == 2) + return this->getURI(); + else + return nullStringAtom; + } + + int QNameObject::nextNameIndex(int index) + { + AvmAssert(index >= 0); + + if (index < 2) + return index + 1; + else + return 0; + } +} diff --git a/mozilla/js/tamarin/core/XMLObject.h b/mozilla/js/tamarin/core/XMLObject.h new file mode 100644 index 00000000000..94a5a9806e5 --- /dev/null +++ b/mozilla/js/tamarin/core/XMLObject.h @@ -0,0 +1,302 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_XMLObject__ +#define __avmplus_XMLObject__ + + +// E4X 9.1.1 Internal Properties and Methods +// Name +// Parent +// Attributes +// InScopeNamespaces +// Length +// Delete (overrides Object version) +// Get (overrides Object version) +// HasProperty (overrides Object version) +// Put (overrides Object version) +// DeleteByIndex (PropertyName) +// DeepCopy +// ResolveValue +// Descendants (PropertyName) +// Equals (Value) +// Insert (PropertyName, Value) +// Replace (PropertyName, Value) +// AddInScopeNamespace (Namespace) + +// These are static objects on the XML type +// E4X: The XML constructor has the following properties +// XML.ignoreComments +// XML.ignoreProcessingInstructions +// XML.ignoreWhitespace +// XML.prettyPrinting +// XML.prettyIndent +// XML.settings +// XML.setSettings ([settings]) +// XML.defaultSettings() + +// XML.prototype.constructor ?? +// XML.prototype.addNamespace +// XML.prototype.appendChild +// XML.prototype.attribute +// XML.prototype.attributes +// XML.prototype.child +// XML.prototype.childIndex +// XML.prototype.children +// XML.prototype.comments +// XML.prototype.contains +// XML.prototype.copy +// XML.prototype.descendants +// XML.prototype.elements +// XML.prototype.hasOwnProperty +// XML.prototype.hasComplexContent +// XML.prototype.hasSimpleContent +// XML.prototype.inScopeNamespaces +// XML.prototype.insertChildAfter +// XML.prototype.insertChildBefore +// XML.prototype.length +// XML.prototype.localName +// XML.prototype.name +// XML.prototype.namespace +// XML.prototype.namespaceDeclarations +// XML.prototype.nodeKind +// XML.prototype.normalize +// XML.prototype.parent +// XML.prototype.processingInstructions +// XML.prototype.prependChild +// XML.prototype.propertyIsEnumerable +// XML.prototype.removeNamespace +// XML.prototype.replace +// XML.prototype.setChildren +// XML.prototype.setLocalName +// XML.prototype.setName +// XML.prototype.setNamespace +// XML.prototype.text +// XML.prototype.toString +// XML.prototype.toXMLString +// XML.prototype.valueOf + + +namespace avmplus +{ + class XMLObject : public ScriptObject + { + XMLClass* xmlClass() const + { + return toplevel()->xmlClass(); + } + + protected: + E4XNode *m_node; + + friend class XMLClass; + + public: + + E4XNode *getNode() const { return m_node; } + void setNode(E4XNode* node) { WB(MMgc::GC::GetGC(this), this, &m_node, node); } + + // Functions that override object version + // Delete (deleteProperty) + // Get (getProperty) + // HasProperty + // Put (setProperty) + Atom callProperty(Multiname* name, int argc, Atom* argv); + + Atom getProperty(Atom name) const; + void setProperty(Atom name, Atom value); + bool deleteProperty(Atom name); + + Atom getProperty(Stringp name) const + { + AvmAssert(name != NULL && name->isInterned()); + return getProperty(name->atom()); + } + void setProperty(Stringp name, Atom value) + { + AvmAssert(name != NULL && name->isInterned()); + setProperty(name->atom(), value); + } + + Atom getProperty(Multiname* name) const; + void setProperty(Multiname* name, Atom value); + bool deleteProperty(Multiname* name); + + bool hasProperty(Multiname* name) const; + bool hasProperty(Atom name) const; + bool hasUintProperty(uint32 i) const; + + Atom getDescendants(Multiname* name) const; + + Atom getUintProperty(uint32 i) const; + void setUintProperty(uint32 i, Atom value); + bool delUintProperty(uint32 i); + + // Iterator support - for in, for each + Atom nextName(int index); + Atom nextValue(int index); + int nextNameIndex(int index); + + Atom _resolveValue (); + + // Exposed routines to AS (NATIVE_METHODs) + XMLObject *addNamespace (Atom _namespace); + XMLObject * appendChild (Atom child); + XMLListObject *attribute (Atom arg); + XMLListObject *attributes (); + XMLListObject *child (Atom propertyName); + int childIndex(); + XMLListObject *children (); + XMLListObject *comments (); + bool contains (Atom value); + XMLObject *copy (); + XMLListObject *descendants (Atom PropertyName) const; + XMLListObject *elements (Atom name); + bool hasOwnProperty (Atom P); + bool hasComplexContent (); + bool hasSimpleContent (); + ArrayObject *inScopeNamespaces (); + Atom insertChildAfter (Atom child1, Atom child2); + Atom insertChildBefore (Atom child1, Atom child2); + + // non-E4X extensions + ScriptObject* getNotification(); + void setNotification(ScriptObject* f); + + Atom localName (); + Atom name (); + Atom getNamespace (Atom *argv, int argc); // prefix is optional (was previously called namespace) + ArrayObject *namespaceDeclarations (); + String *nodeKind () const; + XMLObject *normalize (); + Atom parent (); + XMLListObject *processingInstructions (Atom name); + XMLObject *prependChild (Atom value); + bool propertyIsEnumerable (Atom P); + XMLObject *removeNamespace (Atom _namespace); + XMLObject *replace (Atom propertyName, Atom value); + XMLObject *setChildren (Atom value); + void setLocalName (Atom name); + void setName (Atom name); + void setNamespace (Atom ns); + XMLListObject *text (); + Atom toString (); + Stringp toStringMethod(); + String *toXMLString (); + + // E4X support routines + void __toXMLString(StringBuffer &s, AtomArray *AncestorNamespace, int indentLevel = 0, bool includeChildren = true) const; + XMLObject *_deepCopy () const; + + Namespace *GenerateUniquePrefix (Namespace *ns, const AtomArray *namespaces) const; + + static bool notifyNeeded(E4XNode* target); + void issueNotifications(AvmCore* core, Toplevel* top, E4XNode* initialTarget, Atom target, Atom type, Atom value, Atom detail=undefinedAtom); + + void childChanges(Atom type, Atom value, E4XNode* prior=0); + void nonChildChanges(Atom type, Atom value, Atom detail=undefinedAtom); + + // accessors to node functions + int getClass() const; + uint32 _length() const; + XMLObject *getParent(); + void setValue(Stringp s); + Stringp getValue(); + bool getQName(Multiname *m); + + Namespace *GetNamespace (const Multiname &mn, const AtomArray *nsArray) const; + +#ifdef XML_FILTER_EXPERIMENT + XMLListObject *filter (Atom propertyName, Atom value); + void _filter (XMLListObject *, const Multiname &m, Atom value); +#endif + + public: + XMLObject(XMLClass *type, Stringp s=NULL, Namespace *defaultNamespace=NULL); + XMLObject(XMLClass *type, E4XNode *node); + + ~XMLObject(); + +#ifdef AVMPLUS_VERBOSE + public: + Stringp format(AvmCore* core) const; +#endif + private: + /** + * Conversion routine to verify XML related flags of Multiname + * (strips @ from strings and marks multiname as attribute) + */ + void CoerceE4XMultiname (Multiname *m, Multiname &out) const; + + bool NodeNameEquals (const wchar *NodeName, int len, Stringp parentName, Namespace *ns); + }; + + /** + * QNameObject is used to represent the "QName" object in the E4X Specification + * + * We also use this same object to represent "AttributeName" in the E4X spec. + * An AttributeName is simply a QName wrapper for finding properties that have a leading @ sign. + * It's an internal class to the spec and the only difference between a QName is the @. Instead of + * having the overhead of an AttributeName class that wraps the QName class, we just use a boolean + * inside the QName to differentiate betweent the two types. + */ + class QNameObject : public ScriptObject + { + XMLClass* xmlClass() const + { + return toplevel()->xmlClass(); + } + + HeapMultiname m_mn; + friend class QNameClass; + + public: + QNameObject(QNameClass *type, Multiname &mn); + QNameObject(QNameClass *type, Atom name, bool bAttribute=false); + QNameObject(QNameClass *type, Namespace *nameSpace, Atom name, bool bAttribute=false); + + Stringp getLocalName() const; + Atom getURI() const; + + bool isAttr() const { return m_mn.isAttr(); }; + + // Iterator support - for in, for each + Atom nextName(int index); + Atom nextValue(int index); + int nextNameIndex(int index); + + void getMultiname(Multiname& name) const + { + name = m_mn.getMultiname(); + } + }; +} +#endif /* __avmplus_XMLObject__ */ diff --git a/mozilla/js/tamarin/core/XMLParser16.cpp b/mozilla/js/tamarin/core/XMLParser16.cpp new file mode 100644 index 00000000000..a7d9133ba66 --- /dev/null +++ b/mozilla/js/tamarin/core/XMLParser16.cpp @@ -0,0 +1,504 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 1993-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#include "avmplus.h" + +namespace avmplus +{ + wchar *stripPrefix(const wchar *str, const char *pre) + // If str begins with pre, return the first char after in str + { + if ((!str) || (!pre)) + return 0; + for (;;) { + // Map to uppercase + wchar s = *str; + if ( s >= 'a' && s <= 'z' ) + s -= 'a' - 'A'; + unsigned char p = *pre; + if ( p >= 'a' && p <= 'z' ) + p -= 'a' - 'A'; + + // See if the characters are not equal or we hit the end of the strings + if ( s != p || !s || !p ) + break; + + *pre++; *str++; + } + return *pre == 0 ? const_cast(str) : 0; + } + + // + // XMLParser + // + + // !!@ I'm not sure what this was supposed to do originally but I've rewritten it + // to remove the leading and trailing white space for text elements. + // " 5 4 3 " becomes "5 4 3" + // This is to simulate the E4X XML parser + void XMLParser::condenseWhitespace(Stringp text) + { + AvmAssert (!text->isInterned()); + wchar *str = text->lockBuffer(); + int len = text->length(); + + wchar *dst = str; + wchar *src = str; + bool leadingWhite = true; + wchar *lastChar = 0; + + while (len--) { + if (String::isSpace(*src)) { + if (!leadingWhite) { + *dst++ = *src; + } + src++; + } else { + leadingWhite = false; // first non-space char, no more + lastChar = dst; + *dst++ = *src++; + } + } + + if (lastChar) + lastChar[1] = 0; + + *dst = 0; + + text->unlockBuffer((lastChar ? (lastChar + 1) : dst)-str); + } + + int XMLParser::getNext(XMLTag& tag) + { + tag.reset(); + + // If there's nothing left, exit. + if (!m_ptr || !*m_ptr) { + return XMLParser::kEndOfDocument; + } + + // R41 + // If the ignore whitespace flag is on, don't produce + // all-whitespace text nodes. + if (m_ignoreWhite) { + const wchar *ptr = m_ptr; + while (String::isSpace(*ptr)) { + ptr++; + } + if (*ptr == '<' || !*ptr) { + // If we reached the end of the document, + // or we reached a tag, skip all the + // whitesapce, because it would turn into + // an empty text node. + m_ptr = ptr; + } + // If there's nothing left, exit. + // But only do it for Flash 6 because we want + // to exactly preserve Flash 5 behavior. + if (!*m_ptr) { + return XMLParser::kEndOfDocument; + } + } + // end R41 + + // If it starts with <, it's an XML element. + // If it doesn't, it must be a text element. + if (*m_ptr != '<') { + // Treat it as text. Scan up to the next < or until EOF. + const wchar *start = m_ptr; + while (*m_ptr && *m_ptr != '<') { + m_ptr++; + } + tag.text = unescape(m_source, start, m_ptr-start, false); + + // Condense whitespace if desired + if (m_ignoreWhite && m_condenseWhite) { + condenseWhitespace(tag.text); + } + + tag.nodeType = XMLTag::kTextNodeType; + return XMLParser::kNoError; + } + + // Is this a declaration? + wchar *temp; + if ((temp = stripPrefix(m_ptr, "" + const wchar *start = m_ptr; + m_ptr = temp; + while (*m_ptr) { + if (m_ptr[0] == '?' && m_ptr[1] == '>') + { + // We have the end of the XML declaration + // !!@ changed to not return parts + tag.text = new (core->GetGC()) String(start + 2, m_ptr - start - 2); + m_ptr += 2; + tag.nodeType = XMLTag::kXMLDeclaration; + return XMLParser::kNoError; + } + else + { + m_ptr++; + } + } + return XMLParser::kUnterminatedXMLDeclaration; + } + + // Is this a declaration? + if ((temp = stripPrefix(m_ptr, "'. + const wchar *start = m_ptr; + m_ptr = temp; + int depth = 0; + while (*m_ptr) { + if (*m_ptr == '<') { + depth++; + } + if (*m_ptr == '>') { + if (!depth) { + // We've reached the end of the DOCTYPE. + m_ptr++; + tag.text = new (core->GetGC()) String(start, m_ptr-start); + tag.nodeType = XMLTag::kDocTypeDeclaration; + return XMLParser::kNoError; + } + depth--; + } + m_ptr++; + } + return XMLParser::kUnterminatedDocTypeDeclaration; + } + + // Is this a CDATA section? + wchar *cdata; + if ((cdata = stripPrefix(m_ptr, "" + m_ptr = cdata; + while (*m_ptr) { + if (m_ptr[0] == ']' && m_ptr[1] == ']' && m_ptr[2] == '>') { + // We have the end of the CDATA section. + tag.text = new (core->GetGC()) String(cdata, m_ptr-cdata); + tag.nodeType = XMLTag::kCDataSection; + m_ptr += 3; + return XMLParser::kNoError; + } + m_ptr++; + } + return XMLParser::kUnterminatedCDataSection; + } + + // Is this a processing instruction? + wchar *pi; + if ((pi = stripPrefix(m_ptr, "" + m_ptr = pi; + while (*m_ptr) { + if (m_ptr[0] == '?' && m_ptr[1] == '>') { + // We have the end of the processing instruction. + tag.text = new (core->GetGC()) String(pi, m_ptr - pi); + tag.nodeType = XMLTag::kProcessingInstruction; + m_ptr += 2; + return XMLParser::kNoError; + } + m_ptr++; + } + return XMLParser::kUnterminatedProcessingInstruction; + } + + // Advance past the "<" + m_ptr++; + + // Is this a comment? Return a comment tag-> + const wchar *comment; + if (m_ptr[0] == '!' && m_ptr[1] == '-' && m_ptr[2] == '-') { + // Skip up to '-->'. + m_ptr += 3; + comment = m_ptr; + while (*m_ptr) { + if (m_ptr[0] == '-' && m_ptr[1] == '-' && m_ptr[2] == '>') + { + tag.text = new (core->GetGC()) String(comment, m_ptr-comment); + tag.nodeType = XMLTag::kComment; + m_ptr += 3; + return XMLParser::kNoError; + } + m_ptr++; + } + // Got to the end of the buffer without finding a new tag-> + return XMLParser::kUnterminatedComment; + } + + + // Extract the tag name. Scan up to ">" or whitespace. + const wchar *tagStart = m_ptr; + while (!String::isSpace(*m_ptr) && *m_ptr != '>') { + if (*m_ptr == '/' && *(m_ptr+1) == '>') { + // Found close of an empty element. + // Exit! + break; + } + if (!*m_ptr) { + // Premature end! + return XMLParser::kMalformedElement; + } + m_ptr++; + } + + // Give up if tag name is empty + if (m_ptr == tagStart) { + return XMLParser::kMalformedElement; + } + + tag.text = unescape(m_source, tagStart, m_ptr-tagStart, true); + + tag.nodeType = XMLTag::kElementType; + + // Extract attributes. + for (;;) { + if (!*m_ptr) { + // Premature end! + return XMLParser::kMalformedElement; + } + + // Skip any whitespace. + while (String::isSpace(*m_ptr)) { + m_ptr++; + } + + if (*m_ptr == '>') { + break; + } + + if (*m_ptr == '/' && *(m_ptr+1) == '>') { + // Found close of an empty element. + // Exit! + tag.empty = true; + m_ptr++; + break; + } + + // Extract the attribute name. + const wchar *nameStart = m_ptr; + while (!String::isSpace(*m_ptr) && *m_ptr != '=' && *m_ptr != '>') { + if (!*m_ptr) { + // Premature end! + return XMLParser::kMalformedElement; + } + m_ptr++; + } + if (m_ptr == nameStart) { + // Empty attribute name? + return XMLParser::kMalformedElement; + } + + Stringp attributeName = unescape(m_source, nameStart, m_ptr-nameStart, true); + + while (String::isSpace(*m_ptr)) { + m_ptr++; + } + if (*m_ptr != '=') { + // No '=' sign, no attribute value, error! + return XMLParser::kMalformedElement; + } else { + // Skip over whitespace. + while (String::isSpace(*++m_ptr)) + ; + const wchar *attrStart = m_ptr; + // Extract the attribute value. + if (*m_ptr != '"' && *m_ptr != '\'') { + // Error; no opening quote for attribute value. + return XMLParser::kMalformedElement; + } + wchar delimiter = *m_ptr; + // Extract up to the next quote. + attrStart++; + while (*++m_ptr != delimiter) { + if (*m_ptr == '<') { + // '<' is not permitted in an attribute value + // Changed this from kMalformedElement to kUnterminatedAttributeValue for bug 117058(105422) + return XMLParser::kUnterminatedAttributeValue; + } + if (!*m_ptr) { + // If at end of file, + // we have an unterminated attribute value on our hands. + return XMLParser::kUnterminatedAttributeValue; + } + } + const wchar *attrEnd = m_ptr; + m_ptr++; + + Stringp attributeValue = unescape(m_source, attrStart, attrEnd-attrStart, false); + + AvmAssert (attributeName->isInterned()); + tag.attributes.add(attributeName); + tag.attributes.add(attributeValue); + } + } + + // Advance past the end > of this element. + if (*m_ptr == '>') { + m_ptr++; + } + + return XMLParser::kNoError; + } + + Stringp XMLParser::unescape(Stringp text, const wchar *startChar, int len, bool bIntern) + { + bool bUseSubString = true; + for (int i = 0; i < len; i++) + { + if (startChar[i] == '&') + { + bUseSubString = false; + break; + } + } + + if (bUseSubString) + { + if (bIntern) + { + return core->internAlloc (startChar, len); + } + else + { + MMgc::GC* gc = MMgc::GC::GetGC(text); + int start = startChar - text->c_str(); + AvmAssert (start < text->length()); + return new (gc) String (text, start, len); + } + } + + MMgc::GC* gc = MMgc::GC::GetGC(text); + Stringp news = new (gc) String (startChar, len); + wchar *buffer = news->lockBuffer(); + + // Remove XML &#xx; escape entities, and < > & ' + wchar *dst = buffer; + wchar *src = buffer; + + while (*src) { + if (*src == '&') { + bool success = false; + // Scan forward to the ';' + wchar *endPtr = src; + while (*endPtr && *endPtr != ';') { + endPtr++; + } + if (*endPtr) { + *endPtr = 0; + int len = endPtr-src-1; + + if (*(src+1) == '#') { + // Parse a &#xx; decimal sequence. Or a Ý hex sequence + double value = MathUtils::parseInt(src+2, len-1); + if (MathUtils::isNaN(value)) { + if (len > 2 && src[2] == 'x') { + // Handle xFF hex encoded tags, too + value = MathUtils::parseInt(src+3, len-2, 16); + } + } + if (!MathUtils::isNaN(value)) { + *dst++ = (wchar) (int) value; + success = true; + } + } else if (len <= 4) // Our xmlEntities are only 4 characters or less + { + Atom entityAtom = core->internAlloc(src+1, len)->atom(); + Atom result = core->xmlEntities->get(entityAtom); + if (result != undefinedAtom) { + *dst++ = (wchar)(result>>3); + success = true; + } + } + *endPtr = ';'; + } + if (success) { + // If successful, advance past the sequence + src = endPtr+1; + } else { + // Otherwise copy the sequence literally + *dst++ = *src++; + } + } else { + *dst++ = *src++; + } + } + *dst = 0; + + news->unlockBuffer(dst-buffer); + return (bIntern) ? core->internString (news) : news; + } + + XMLParser::XMLParser(AvmCore *core) + { + this->core = core; + + if (!core->xmlEntities) + { + // Lazy creation of the XML entities table. + core->xmlEntities = new (core->GetGC()) Hashtable(core->GetGC()); + + const char *entities = "&\0\"quot\0'apos\0gt\0\xA0nbsp\0"; + + while (*entities) + { + core->xmlEntities->add(core->constant(entities+1), + (void*)core->intToAtom(*entities)); + while (*entities++) { + // do nothing + } + } + } + } + + void XMLParser::parse(Stringp source, + bool ignoreWhite /*=false*/ ) + { + m_source = source; + m_ptr = m_source->c_str(); + m_ignoreWhite = ignoreWhite; + } + + bool XMLTag::nextAttribute(uint32& index, + Stringp& name, + Stringp& value) + { + if (index >= attributes.size()) { + return false; + } + name = attributes.get(index++); + value = attributes.get(index++); + return true; + } + +} // namespace diff --git a/mozilla/js/tamarin/core/XMLParser16.h b/mozilla/js/tamarin/core/XMLParser16.h new file mode 100644 index 00000000000..488cba636b0 --- /dev/null +++ b/mozilla/js/tamarin/core/XMLParser16.h @@ -0,0 +1,146 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_XMLParser16__ +#define __avmplus_XMLParser16__ + + +namespace avmplus +{ + /** + * XMLTag represents a single XML tag. It is output by the + * XMLParser class, the XML parser. + */ + class XMLTag + { + public: + XMLTag(MMgc::GC *gc) : attributes(gc, 0) + { + reset(); + } + + void reset() + { + text = NULL; + nodeType = kNoType; + empty = false; + attributes.clear(); + } + + enum TagType { + kNoType = 0, + // These match the W3C XML DOM SPEC + // http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html + // (Search for ELEMENT_NODE) + kElementType = 1, + kTextNodeType = 3, + kCDataSection = 4, + kProcessingInstruction = 7, + kComment = 8, + kDocTypeDeclaration = 10, + + // This does not match the W3C XML DOM SPEC + kXMLDeclaration = 13, + }; + + Stringp text; + enum TagType nodeType; + bool empty; + List attributes; + + /** + * nextAttribute is used to iterate over the + * attributes of a XML tag + */ + bool nextAttribute(uint32& index, + Stringp& name, + Stringp& value); + }; + + /** + * XMLParser is a XML parser which takes 16-bit wide characters + * as input. The parser operates in "pull" fashion, returning a + * single tag or text node on each call to the GetNext method. + * + * This XML parser is used to support E4X in AVM+. + */ + class XMLParser + { + public: + XMLParser(AvmCore *core); + ~XMLParser() + { + core = NULL; + m_source = NULL; + m_ptr = NULL; + m_ignoreWhite = false; + m_condenseWhite = false; + } + + void parse(Stringp source, + bool ignoreWhite = false); + + int getNext(XMLTag& tag); + + enum { + kNoError = 0, + kEndOfDocument = -1, + kUnterminatedCDataSection = -2, + kUnterminatedXMLDeclaration = -3, + kUnterminatedDocTypeDeclaration = -4, + kUnterminatedComment = -5, + kMalformedElement = -6, + kOutOfMemory = -7, + kUnterminatedAttributeValue = -8, + kUnterminatedElement = -9, + kElementNeverBegun = -10, + kUnterminatedProcessingInstruction = -11, + }; + + AvmCore* core; + + bool getCondenseWhite() const { return m_condenseWhite; } + void setCondenseWhite(bool flag) { m_condenseWhite = flag; } + + private: + Stringp unescape(Stringp buffer, const wchar *start, int len, bool bIntern); + + Stringp m_source; + const wchar *m_ptr; + + bool m_ignoreWhite; + bool m_condenseWhite; + + void condenseWhitespace(Stringp text); + }; +} + +#endif diff --git a/mozilla/js/tamarin/core/abcFormat.txt b/mozilla/js/tamarin/core/abcFormat.txt new file mode 100644 index 00000000000..ebcb9c7d58b --- /dev/null +++ b/mozilla/js/tamarin/core/abcFormat.txt @@ -0,0 +1,237 @@ +***** BEGIN LICENSE BLOCK ***** +Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ #YEARS# ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + +***** END LICENSE BLOCK ***** */ + +This file stays synchronized with the source code. To view +previous formats that we don't support, sync backwards in +perforce. + + +U30 - This is a 30 bit integer value encoded with a variable number of bytes to save space. +All U30's are encoded as 1-5 bytes depending on the value (larger values need more space). +The encoding method is if the hi bit in the current byte is set, then the next byte is also +part of the value. Each bit in a byte contributes 7 bits to the value, with the hi bit telling +us whether to use the next byte, or if this is the last byte for the value. This enables us to +use 30 bit numbers for everything, but still not take up enormous amounts of space. + +If more than 30 nonzero bits are present for a U30 field, a verify error will occur. + +S32,U32 - same as U30 but 32 bits are allowed instead of being capped at 30. + +The "0" entry of each constant pool is not used. If the count for a given pool says there are +"n" entries in the pool, there are "n-1" entries in the file, corresponding to indices 1..(n-1). + +AbcFile { + U16 minor_version // = 16 + U16 major_version // = 46 + U30 constant_int_pool_count + ConstantInteger[constant_int_pool_count] // Cpool entries for integers + U30 constant_uint_pool_count + ConstantUInteger[constant_uint_pool_count] // Cpool entries for uints + U30 constant_double_pool_count + ConstantDouble[constant_double_pool_count] // Cpool entries for doubles + U30 constant_string_pool_count + ConstantString[constant_string_pool_count] // Cpool entries for strings + U30 constant_namespace_pool_count + ConstantNamespace[constant_namespace_pool_count] // Cpool entries for namespaces + U30 constant_namespace_set_pool_count + ConstantNamespaceSet[constant_namespace_set_pool_count] //Cpool entries for namespace sets + U30 constant_multiname_pool_count + ConstantMultiname[constant_multiname_pool_count] //Cpool entries for Multinames, Qnames, RTQnames, and RTQnamesLate + U30 methods_count + MethodInfo[methods_count] + U30 metadata_count + MetadataInfo[metadata_count] + U30 class_count + InstanceInfo[class_count] + ClassInfo[class_count] + U30 script_count + ScriptInfo[script_count] // ScriptInfo[script_count-1] is main entry point + U30 bodies_count + MethodBody[bodies_count] +} + + +ConstantInteger { + S32 value +} + +ConstantUInteger { + U32 value +} + +ConstantDouble { + U64 doublebits (little endian) +} + +ConstantString { + U30 length + U8[length] // UTF-8 encoded string +} + +ConstantNamespace { + U8 kind + union { + kind=8,5,22,23,24,25,26 { // CONSTANT_Namespace, CONSTANT_PrivateNamespace, CONSTANT_PackageNamespace, CONSTANT_PacakgeInternalNamespace, CONSTANT_ProtectedNamespace, CONSTANT_ExplicitNamespace, CONSTANT_MultinameL + U30 name_index // CONSTANT_Utf8 uri (maybe 0) + } + } +} + +ConstantNamespaceSet { + U30 namespace_count + U30[namespace_count] // CONSTANT_Namespace +} + +ConstantMultiname { + U8 kind + union { + kind=7,13 { // CONSTANT_Qname + CONSTANT_QnameA + U30 namespace_index // CONSTANT_Namespace, 0=AnyNamespace wildcard + U30 name_index // CONSTANT_Utf8, 0=AnyName wildcard + } + kind=9,14 { // CONSTANT_Multiname, CONSTANT_MultinameA + U30 name_index // CONSTANT_Utf8 simple name. 0=AnyName wildcard + U30 namespace_set_index + } + kind=15,16 { // CONSTANT_RTQname + CONSTANT_RTQnameA + U30 name_index // CONSTANT_utf8, 0=AnyName wildcard + } + kind=27 { // CONSTANT_MultinameL + U30 namespace_set_index + kind=17,18 // CONSTANT_RTQnameL + CONSTANT_RTQnameLA + } +} + +Traits { + U30 count + Trait[count] { + U30 name_index // CONSTANT_QName + U8 kind // hi 4 bits are flags, 0x04: (1=has_metadata, 0=no metadata) + union { + kind=0,6 { // slot, const + U30 slot_id // 0=autoassign + U30 type_index // CONSTANT_Multiname, 0=Object + U30 value_index // CONSTANT_ or 0 for undefined - depends on the value of value_kind + U8 value_kind // cpool kind the value is, only present if value_index != 0 + } + kind=1,2,3 { // method, getter, setter + U30 disp_id // 0=autoassign + U30 method_info // method must be parsed already + // attrs are stored in the hi 4 bits of the kind byte + // 0x01: (1=final,0=virtual), 0x02: (1=override,0=new) + } + kind=4 { // class + U30 slot_id // 0=autoassign + U30 class_info // class must have been parsed already + } + kind=5 { // function + U30 slot_index // 0=autoassign + U30 method_info // method_info of function residing in this slot + } + } + if ( (kind >> 4) & 0x04 ) // these are only present when the kind contains the has_metadata flag + { + U30 metadata_count // Number of metadata + U30 metadata[count] // MetadataInfo indices + } + } +} + +MetadataInfo { + U30 name_index // CONSTANT_utf8 + U30 values_count // # of values in this metadata + U30 keys[values_count] // CONSTANT_utf8, 0 = keyless + U30 values[values_count] // CONSTANT_utf8 +} + +InstanceInfo { + U30 name_index // CONSTANT_QName (definition) + U30 super_index // CONSTANT_Multiname (reference) + U8 flags // 1 = sealed, 0 = dynamic + // 2 = final + // 4 = interface + U30 protectedNS if flags & 8 + U30 interfaces_count + U30 interfaces[interfaces_count] // CONSTANT_Multiname (references) + U30 iinit_index // MethodInfo + Traits instance_traits +} + +ClassInfo { + U30 cinit_index // MethodInfo + Traits static_traits +} + +ScriptInfo { + U30 init_index // MethodInfo + Traits traits +} + +// A MethodInfo describes the method signature +MethodInfo { + U30 param_count + U30 ret_type // CONSTANT_Multiname, 0=any type (*) + U30 param_types[param_count] // CONSTANT_Multiname, 0=any type (*) + U30 name_index // 0=no name. + // 1=need_arguments, 2=need_activation, 4=need_rest 8=has_optional 16=ignore_rest, 32=explicit, 64=setsdxns, 128=has_paramnames + U8 flags + U30 optional_count // if has_optional + ValueKind[optional_count] // if has_optional + U30 param_names[param_count] // if has_paramnames +} + +ValueKind { + U30 value_index // the index for the value in the cpool + U8 value_kind // the kind indicating which cpool the value is in +} + +// A MethodBody describes the method implementation. +// not required for native methods or interface methods. +MethodBody { + U30 method_info + U30 max_stack + U30 max_regs + U30 scope_depth + U30 max_scope + U30 code_length + U8 code[code_length] + U30 ex_count + Exception[ex_count] + Traits traits // activation traits +} + +Exception { + U30 start // Offsets of beginning and + U30 end // end of the try block + U30 target // Target PC to transfer control to (catch) + U30 type_index // Type matched by this exception handler + U30 name_index // Name of the exception variable +} diff --git a/mozilla/js/tamarin/core/abcFormat470.txt b/mozilla/js/tamarin/core/abcFormat470.txt new file mode 100644 index 00000000000..0d5894f5fff --- /dev/null +++ b/mozilla/js/tamarin/core/abcFormat470.txt @@ -0,0 +1,180 @@ +// ***** BEGIN LICENSE BLOCK ***** +// Version: MPL 1.1/GPL 2.0/LGPL 2.1 +// +// The contents of this file are subject to the Mozilla Public License Version 1.1 (the +// "License"); you may not use this file except in compliance with the License. You may obtain +// a copy of the License at http://www.mozilla.org/MPL/ +// +// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +// WARRANTY OF ANY KIND, either express or implied. See the License for the specific +// language governing rights and limitations under the License. +// +// The Original Code is [Open Source Virtual Machine.] +// +// The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +// by the Initial Developer are Copyright (C)[ #YEARS# ] Adobe Systems Incorporated. All Rights +// Reserved. +// +// Contributor(s): Adobe AS3 Team +// +// Alternatively, the contents of this file may be used under the terms of either the GNU +// General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +// License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +// LGPL are applicable instead of those above. If you wish to allow use of your version of this +// file only under the terms of either the GPL or the LGPL, and not to allow others to use your +// version of this file under the terms of the MPL, indicate your decision by deleting provisions +// above and replace them with the notice and other provisions required by the GPL or the +// LGPL. If you do not delete the provisions above, a recipient may use your version of this file +// under the terms of any one of the MPL, the GPL or the LGPL. +// +// ***** END LICENSE BLOCK ***** */ + +// type-only: interface +// method-only: simple function +// type+method: method w/ activation object, class, instance, package + +// todo add varargs, optional + +AbcFile { + U16 minor_version // = 0 + U16 major_version // = 47 + + U16 constant_pool_count + Constant[constant_pool_count] { + U8 kind + union { + kind=1 { // CONSTANT_utf8 + U16 length + U8[length] + } + kind=3 { // CONSTANT_Integer + S32 value + } + kind=6 { // CONSTANT_Double + U64 doublebits (little endian) + } + kind=7 { // CONSTANT_Qname + U16 namespace_index + U16 name_index + } + kind=8 { // CONSTANT_Namespace + U16 name_index // CONSTANT_Utf8 uri (maybe 0) + } + kind=9 { // CONSTANT_Multiname // Used by OP_getproperty, OP_setproperty + U16 name_index // CONSTANT_Utf8 simple name + U16 namespaces_count // (256 may seem like enough, but 64K use to seem like a lot of memory) + U16 namespaces[namespaces_count] // CONSTANT_Namespace (0 = public) + } + } + } + + U16 methods_count // last method is main program + MethodInfo[methods_count] { + U16 param_count + U16 scope_depth + U16 max_scope + U16 ret_type // CONSTANT_Multiname, 0=Object + U16 param_types[param_count] // CONSTANT_Multiname, 0=Object + U16 native_name_index // 0 = not native + U8 flags // 1=need_arguments, 2=need_activation, 4=need_rest 8=has_optional 16=ignore_rest + U16 optional_count // if has_optional + U16 value_index[optional_count] // if has_optional + } + + U16 traits_count + Traits[traits_count] { + U16 base // multiname of base traits + U16 count + Trait[count] { + U16 name_index // CONSTANT_Multiname + U8 kind + union { + kind=0 { // slot + U16 slot_id // 0=autoassign + U16 type_index // CONSTANT_Multiname, 0=Object + U16 value_index // CONSTANT or 0 for undefined + } + kind=1,2,3 { // method, getter, setter + U16 disp_id // 0=autoassign + U16 method_info // method must be parsed already + U8 attr; // 0x01: (1=final,0=virtual), 0x02: (1=override,0=new) + // ISSUE can we move the attr bits into the tag byte? + } + kind=4 { // class + U16 slot_id // 0=autoassign + U16 class_info // class must have been parsed already + } + kind=5 { // package + U16 slot_id // 0=autoassign + U16 name_index // utf8_index of package name + } + kind=6 { // function + U16 slot_index // 0=autoassign + U16 method_info // method_info of function residing in this slot + } + } + } + } + + U16 bodies_count // last method is main program + MethodBody[methods_count] { + U16 method_info + U16 max_stack + U16 max_regs + U32 code_length + U8[code_length] + U16 ex_count + Exception[ex_count] { + U32 start // Offsets of beginning and + U32 end // end of the try block + U32 target // Target PC to transfer control to (catch) + U16 type_index // Type matched by this exception handler + } + } +} + +interface: name, traits + types[name] = traits + +function: method, traits, itraits + traits.call = method + traits.base = Function + traits.itraits = itraits + traits.dynamic = true + itraits.base = Object + itraits.init = method + itraits.dynamic = true + +package: name, method, traits + types[name] = traits + traits.init = method + traits.base = Object + +program: method, traits + traits.dynamic = true + traits.base = Object + +class: name, itraits, iinit, ctraits, cinit + types[name] = itraits + itraits.base = + itraits.init = iinit + ctraits.itraits = itraits + ctraits.init = cinit + ctraits.base = Class + ctraits.call = + + +code { + ops[] + targets[] + mname[] + int[] + double[] + string[] + reg[] + slots[] + dispids[] + scopes[] + imm-ints[] + switchcounts[] +} \ No newline at end of file diff --git a/mozilla/js/tamarin/core/actionscript.lang.as b/mozilla/js/tamarin/core/actionscript.lang.as new file mode 100644 index 00000000000..ee454ef53e7 --- /dev/null +++ b/mozilla/js/tamarin/core/actionscript.lang.as @@ -0,0 +1,99 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +package +{ + + public namespace AS3 = "http://adobe.com/AS3/2006/builtin" + + /** + * @name Toplevel Function Properties + * Function properties of the global object (ECMA 15.1.2) + */ + + // {DontEnum} length=1 + public native function decodeURI(uri:String="undefined"):String + + // {DontEnum} length=1 + public native function decodeURIComponent(uri:String="undefined"):String + + // {DontEnum} length=1 + public native function encodeURI(uri:String="undefined"):String + + // {DontEnum} length=1 + public native function encodeURIComponent(uri:String="undefined"):String + + // {DontEnum} length=1 + public native function isNaN(n:Number = void 0):Boolean + + // {DontEnum} length=1 + public native function isFinite(n:Number = void 0):Boolean + + // {DontEnum} length=1 + public native function parseInt(s:String = "NaN", radix:int=0):Number + + // {DontEnum} length=1 + public native function parseFloat(str:String = "NaN"):Number + + + /** + * @name ECMA-262 Appendix B.2 extensions + * Extensions to ECMAScript, in ECMA-262 Appendix B.2 + */ + + // {DontEnum} length=1 + public native function escape(s:String="undefined"):String + + // {DontEnum} length=1 + public native function unescape(s:String="undefined"):String + + // value properties of global object (ECMA 15.1.1) + + // in E262, these are var {DontEnum,DontDelete} but not ReadOnly + // but in E327, these are {ReadOnly, DontEnum, DontDelete} + // we choose to make them const ala E327 + + // The initial value of NaN is NaN (section 8.5). + // E262 { DontEnum, DontDelete} + // E327 { DontEnum, DontDelete, ReadOnly} + public const NaN:Number = 0/0 + + // The initial value of Infinity is +8 (section 8.5). + // E262 { DontEnum, DontDelete} + // E327 { DontEnum, DontDelete, ReadOnly} + public const Infinity:Number = 1/0 + + // The initial value of undefined is undefined (section 8.1). + // E262 { DontEnum, DontDelete} + // E327 { DontEnum, DontDelete, ReadOnly} + public const undefined = void 0 +} diff --git a/mozilla/js/tamarin/core/avmbuild.h b/mozilla/js/tamarin/core/avmbuild.h new file mode 100644 index 00000000000..b81e6ab2a5f --- /dev/null +++ b/mozilla/js/tamarin/core/avmbuild.h @@ -0,0 +1,169 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmbuild__ +#define __avmbuild__ + + +#ifdef _MAC + #ifndef AVMPLUS_MAC + #define AVMPLUS_MAC + #endif +#endif + +#ifdef WIN32 + #ifndef AVMPLUS_WIN32 + #define AVMPLUS_WIN32 + #endif +#endif + +#ifdef AVMPLUS_MAC + // Are we PowerPC or i386 (Macintel)? + #if __i386__ + #ifndef AVMPLUS_IA32 + #define AVMPLUS_IA32 + #endif + #ifndef AVMPLUS_CDECL + #define AVMPLUS_CDECL + #endif + #else + #ifndef AVMPLUS_PPC + #define AVMPLUS_PPC + #endif + #endif +#endif + +#ifdef AVMPLUS_WIN32 + #ifndef AVMPLUS_IA32 + #define AVMPLUS_IA32 + #endif +#endif + +/// START: CRUFT +// +// guard pages are created for buffers rather than explicit overflow checks +// this define exists only for the interm In a few days I'll toast the rest +// of the non-guard logic and we'll see the end of the days of estimatation! +// [rickr-Jun16,05] + +// TODO_LINUX: no buffer guard for linux yet +#ifndef AVMPLUS_LINUX + #define FEATURE_BUFFER_GUARD +#endif + +// FEATURE_BUFFER_GUARD not yet supported on ARM +#ifdef AVMPLUS_ARM + #undef FEATURE_BUFFER_GUARD +#endif + +// FEATURE_BUFFER_GUARD not supported on Mac CFM +#ifdef AVMPLUS_MAC + #if !TARGET_RT_MAC_MACHO + #undef FEATURE_BUFFER_GUARD + #endif +#endif + +#define AVMPLUS_MIR +#define AVMPLUS_INTERP + +// if a function meets the E4 criteria for being unchecked, then make +// all its parameters optional and add a rest arg. asc should do this +// at compile time so we don't have to do it in avmplus. +#define AVMPLUS_UNCHECKED_HACK + +#ifdef DEBUGGER +#define AVMPLUS_VERIFYALL +#endif + +#if defined(DEBUG) || defined(_DEBUG) || defined(DEBUGGER) +#define AVMPLUS_VERBOSE +#define AVMPLUS_PROFILE +#endif + +// #undef verify, a Mac thing +#undef verify + +#ifdef AVMPLUS_MAC +#if !TARGET_RT_MAC_MACHO +#define AVMPLUS_MAC_CARBON +#endif +#endif + +#ifdef AVMPLUS_MAC + #ifdef FEATURE_BUFFER_GUARD + #define AVMPLUS_MACH_EXCEPTIONS + #endif +#endif + +#ifdef AVMPLUS_MACH_EXCEPTIONS + #ifdef AVMPLUS_PPC + // Support for running the PowerPC version under Rosetta + #define AVMPLUS_ROSETTA + #endif +#endif + +/** + * We have avmplus.vcproj compiled with the /W4 warning level + * which is quite picky. Disable warnings we don't care about. + */ +#ifdef _MSC_VER + #pragma warning(disable:4512) //assignment operator could not be generated + #pragma warning(disable:4511) //can't generate copy ctor + #pragma warning(disable:4127) //conditional expression is constant + #pragma warning(disable:4611) //interaction between _setjmp and destruct + #pragma warning(disable:4725) //instruction may be inaccurate on some Pentiums + + #pragma warning(disable:4244) //possible loss of data in conversion (@todo, re-enable this (lots of code fixes needed)) + + // enable some that are off even in /W4 mode, but are still handy + #pragma warning(error:4265) // 'class' : class has virtual functions, but destructor is not virtual + #pragma warning(error:4905) // wide string literal cast to 'LPSTR' + #pragma warning(error:4906) // string literal cast to 'LPWSTR' + + // some that might be useful to turn on someday, but would require too much twiddly code tweaking right now +// #pragma warning(error:4263) // 'function' : member function does not override any base class virtual member function +// #pragma warning(error:4264) // 'virtual_function' : no override available for virtual member function from base 'class'; function is hidden +// #pragma warning(error:4266) // 'function' : no override available for virtual member function from base 'type'; function is hidden +// #pragma warning(error:4242) // 'identifier' : conversion from 'type1' to 'type2', possible loss of data +// #pragma warning(error:4263) // member function does not override any base class virtual member function +// #pragma warning(error:4296) // expression is always true (false) (Generally, an unsigned variable was used in a comparison operation with zero.) + +#endif + +// extra safety checks during parsing +// this will be turned off for desktop players once we get the gaurd pages in +// Mobile players that may not be able to use guard pages(exceptions) so will +//want to turn this on +#define SAFE_PARSE + +// Enable interfacing Java +#define FEATURE_JNI +#endif /* __avmbuild__ */ diff --git a/mozilla/js/tamarin/core/avmplus.cpp b/mozilla/js/tamarin/core/avmplus.cpp new file mode 100644 index 00000000000..0808ee14ca9 --- /dev/null +++ b/mozilla/js/tamarin/core/avmplus.cpp @@ -0,0 +1,54 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +// +// This is the source file for the avmplus project's precompiled header. +// + +#include "avmplus.h" + +// The default precompiled header setting on project avmplus is +// to replace up to #include "avmplus.h" with avmplus.pch, the +// precompiled header. + +// avmplus.cpp has custom precompiled header settings to create +// avmplus.pch by precompiling this file up until the +// #include "avmplus.h". + +// #include "avmplus.h" should be the first non-comment line in +// any CPP in this project, as the default will be to substitute +// the contents of the pch for everything up to the include. + +// If a file cannot #include "avmplus.h", or cannot include it +// first, then it should disable the precompiled header for that file only +// (for instance, pcre.cpp). + diff --git a/mozilla/js/tamarin/core/avmplus.h b/mozilla/js/tamarin/core/avmplus.h new file mode 100644 index 00000000000..89606f83b93 --- /dev/null +++ b/mozilla/js/tamarin/core/avmplus.h @@ -0,0 +1,305 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 1993-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#ifndef __avmplus__ +#define __avmplus__ + +/*! \mainpage AVM+ Documentation + * + * \section intro Introduction + * + * AVM+ is the ActionScript Virtual Machine + * + * AVM+ offers an order of magnitude performance increase over + * the "Classic AVM" in Flash Player 7. Our performance target is 10X. + * + * AVM+ implements ActionScript 3.0, the new version of the ActionScript + * language that is compliant with the ECMAScript Edition 4 standard. + * + * AVM+ is also built for modularity. It will be part of the Flash Player, + * but is a self-contained module which can be incorporated into other + * programs with ease. It may also be submitted to the ECMA standards + * organization as a reference implementation of ECMAScript Edition 4. + * + * \section usage Using This Document + * + * This documentation is a reference manual for C++ developers working + * with AVM+, either in the context of the Flash Player or in another + * application. It can be useful for developers enhancing AVM+ + * itself, or for developer who wish to understand its internals + * in order to better interface with it. + * + * \section begin Where To Begin + * + * The avmplus::AvmCore class is the main entry point of the + * AVM+ virtual machine, and is probably a good place to start + * when trying to comprehend the codebase. + * + * \section contact Who To Contact + * + * For questions about AVM+, please contact: + * + * Gary Grossman (ggrossman@macromedia.com)
+ * Edwin Smith (edsmith@macromedia.com)
+ * Jeff Dyer (jdyer@macromedia.com) + */ + +// Needed for memset, memcpy et al. +#include + +#include "avmbuild.h" + +#if defined(_MAC) || defined(UNIX) +//#include +#include +#endif + +#ifdef WIN32 +#include +#endif + +#include + +#include "avmsetjmp.h" + +#include "avmplusTypes.h" +#include "avmplusVersion.h" +#include "AvmDebug.h" +#include "AtomConstants.h" +#include "ActionBlockConstants.h" +#include "AvmError.h" +#include "ErrorConstants.h" +#include "NativeObjectHelpers.h" + +using namespace avmplus::AtomConstants; +using namespace avmplus::ActionBlockConstants; +using namespace avmplus::ErrorConstants; + +/** + * Incomplete class definitions for everything in AVM+ + */ +namespace avmplus +{ + class AbcGen; + class AbcEnv; + class AbcParser; + class AbstractFunction; + class Accessor; + class ArrayClass; + class ArrayObject; + class Atan2Method; + class AtomArray; + class AvmCore; + class BooleanClass; + class BufferGuard; + class BuiltinTraits; + class CallStackNode; + class ClassClass; + class ClassClosure; + class Closure; + class CodeContext; + class Console; + class Date; + class DateClass; + class DateObject; + class Debugger; + class Domain; + class DomainEnv; + class DynamicProfiler; + class E4XNode; + class ErrorClass; + class ErrorObject; + class Exception; + class ExceptionFrame; + class ExceptionHandler; + class ExceptionHandlerTable; + class FrameState; + class GrowableBuffer; + class Hashtable; + class HeapMultiname; + class Interpreter; + class Java; + class MathClass; + class MathUtils; + class MethodClosure; + class MethodEnv; + class MethodInfo; + class Multiname; + class Namespace; + class NamespaceSet; + class NamespaceClass; + class NativeMethod; + class NativeClassFactory; + class NativeScriptFactory; + class NumberClass; + class IntClass; + class UIntClass; + class OSDep; + class ObjectClass; + class OutputStream; + class PoolObject; + class PrintWriter; + class Profiler; + class RegExpClass; + class RegExpObject; + class ScopeChain; + class ScopeTypeChain; + class ScriptBuffer; + class ScriptEnv; + class ScriptObject; + class StackTrace; + class StaticProfiler; + class StringBuffer; + class StringClass; + class String; + class Toplevel; + class Traits; + class UnicodeUtils; + class Value; + class Verifier; + class VTable; + class VoidClass; + class XMLClass; + class XMLListClass; + class XMLObject; + class XMLListObject; + class QNameClass; + class QNameObject; + class XMLParser; + class XMLTag; + + struct NativeClassInfo; + struct NativeScriptInfo; + struct NativeTableEntry; + + typedef Traits* Traitsp; + typedef String* Stringp; + typedef Namespace* Namespacep; +} + +namespace avmplus +{ + namespace NativeID + { + #include "builtin.h" + } +} + +#include "MMgc.h" + +#include "MathUtils.h" +#include "UnicodeUtils.h" +#include "OSDep.h" +#include "OutputStream.h" +#include "ScriptBuffer.h" +#include "avmplusList.h" +#include "avmplusStack.h" +#include "SortedIntMap.h" +#include "BitSet.h" +#include "AvmPlusScriptableObject.h" +#include "Namespace.h" +#include "StringObject.h" +#include "MultinameHashtable.h" +#include "PrintWriter.h" +#include "BuiltinTraits.h" +#include "NamespaceSet.h" +#include "Multiname.h" +#include "DynamicProfiler.h" +#include "StaticProfiler.h" +#include "AvmCore.h" +#include "AtomWriteBarrier.h" +#include "avmplusHashtable.h" +#include "CodeContext.h" +#include "GrowableBuffer.h" +#include "PoolObject.h" +#include "AbcEnv.h" +#include "AbstractFunction.h" +#include "Traits.h" +#include "TraitsIterator.h" +#include "VTable.h" +#include "MethodEnv.h" +#include "ScopeChain.h" +#include "ScriptObject.h" +#include "avmplusProfiler.h" +#include "StringBuffer.h" + +#ifdef AVMPLUS_ARM +#include "ArmAssembler.h" +#endif + +#ifdef AVMPLUS_MIR +#include "CodegenMIR.h" +#endif + +#include "AtomArray.h" +#include "Verifier.h" +#include "FrameState.h" +#include "NativeFunction.h" +#include "ClassClosure.h" +#include "ClassClass.h" +#include "FunctionClass.h" +#include "MethodClosure.h" +#include "StackTrace.h" +#include "Exception.h" +#include "MethodInfo.h" +#include "NamespaceClass.h" +#include "ArrayObject.h" +#include "MethodClosure.h" +#include "BooleanClass.h" +#include "NumberClass.h" +#include "IntClass.h" +#include "ArrayClass.h" +#include "StringClass.h" +#include "Date.h" +#include "DateClass.h" +#include "DateObject.h" +#include "Domain.h" +#include "DomainEnv.h" +#include "ObjectClass.h" +#include "ErrorClass.h" +#include "MathClass.h" +#include "Toplevel.h" +#include "AbcParser.h" +#include "RegExpObject.h" +#include "RegExpClass.h" +#include "XMLClass.h" +#include "XMLListClass.h" +#include "XMLObject.h" +#include "XMLListObject.h" +#include "XMLParser16.h" +#include "Interpreter.h" +#include "avmplusDebugger.h" +#include "E4XNode.h" +#include "AbcGen.h" +#include "GrowableBuffer.h" + +#endif /* __avmplus__ */ diff --git a/mozilla/js/tamarin/core/avmplusDebugger.cpp b/mozilla/js/tamarin/core/avmplusDebugger.cpp new file mode 100644 index 00000000000..af618123290 --- /dev/null +++ b/mozilla/js/tamarin/core/avmplusDebugger.cpp @@ -0,0 +1,834 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 1993-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmplus.h" + +#ifdef DEBUGGER + +namespace avmplus +{ + using namespace MMgc; + + Debugger::TraceLevel Debugger::astrace = Debugger::TRACE_OFF; + uint64 Debugger::astraceStartTime = OSDep::currentTimeMillis(); + + Debugger::Debugger(AvmCore *core) + : core(core) + , abcList(core->GetGC()) + , pool2abcIndex() + { + } + + void Debugger::stepInto() + { + stepState.flag = true; + stepState.depth = -1; + + // Check that core and core->callStack are non-null before dereferencing + // them, so that it's possible to call stepInto() even before there is + // a stackframe (so execution will stop at the first executed line of code). + stepState.startingDepth = (core && core->callStack) ? core->callStack->depth : 0; + } + + void Debugger::stepOver() + { + stepState.flag = true; + stepState.depth = core->callStack->depth; + stepState.startingDepth = core->callStack->depth; + } + + void Debugger::stepOut() + { + stepState.flag = true; + stepState.depth = core->callStack->depth - 1; + stepState.startingDepth = core->callStack->depth; + } + + void Debugger::stepContinue() + { + // Restore the previous stepping state + stepState = oldStepState; + } + + /** + * Set a breakpoint in a particular source flie + * NOTE: if the 'same' source file appears in + * multiple abc files, it is up to the caller + * to ensure that this call is performed for each + * SourceInfo object. + */ + bool Debugger::breakpointSet(SourceInfo* source, int linenum) + { + return source->setBreakpoint(linenum); + } + + /** + * Clear a breakpoint on a particular source file + */ + bool Debugger::breakpointClear(SourceInfo* source, int linenum) + { + return source->clearBreakpoint(linenum); + } + + void Debugger::debugLine(int linenum) + { + AvmAssert( core->callStack !=0 ); + if (!core->callStack) + return; + + AvmAssert(linenum > 0); + + int prev = core->callStack->linenum; + core->callStack->linenum = linenum; + + int line = linenum; + + // line number has changed + bool changed = (prev == line) ? false : true; + bool exited = (prev == -1) ? true : false; // are we being called as a result of function exit? + if (!changed && !exited) + return; // still on the same line in the same function? + + if (core->profiler->profilingDataWanted && core->profiler->profileSwitch) + { + core->profiler->sendLineTimestamp(line); + } + + // tracing information + traceLine(line); + + // check if we should stop due to breakpoint or step + bool stop = false; + if (stepState.flag) + { + if (stepState.startingDepth != -1 && core->callStack->depth < stepState.startingDepth) + { + // We stepped out of whatever function was executing when the + // stepInto/stepOver/stepOut command was executed. We may be + // in the middle of a line of code, but we still want to stop + // immediately. See bug 126633. + stop = true; + } + else if (!exited && (stepState.depth == -1 || core->callStack->depth <= stepState.depth) ) + { + // We reached the beginning of a new line of code. + stop = true; + } + } + + // we didn't decide to stop due to a step, but check if we hit a breakpoint + if (!stop && !exited) + { + AbstractFunction* f = core->callStack->info; + if ( (f->flags & AbstractFunction::ABSTRACT_METHOD) == 0) + { + MethodInfo* m = (MethodInfo*)f; + AbcFile* abc = m->getFile(); + if (abc) + { + SourceFile* source = abc->sourceNamed( core->callStack->filename ); + if (source && source->hasBreakpoint(line)) + { + stop = true; + } + } + } + } + + // we still haven't decided to stop; check our watchpoints + if (!stop && !exited) + { + if (hitWatchpoint()) + stop = true; + } + + if (stop) + { + // Terminate whatever step operation may have been happening. But first, + // save the state of the step, so that if someone calls stepContinue(), + // then we can restore it. + StepState oldOldStepState = oldStepState; // save oldStepState in case of reentrancy + oldStepState = stepState; // save stepState so that stepContinue() can find it + stepState.clear(); // turn off stepping + + enterDebugger(); + + oldStepState = oldOldStepState; // restore oldStepState + } + } + + void Debugger::debugFile(Stringp filename) + { + AvmAssert( core->callStack != 0 ); + if (!core->callStack) + return; + + AvmAssert(filename != 0); + + Stringp prev = core->callStack->filename; + core->callStack->filename = filename; + + // filename changed + if (prev != filename) + { + if (core->profiler->profilingDataWanted) + { + UTF8String* sourceFile = filename->toUTF8String(); + core->profiler->sendDebugFileUrl(sourceFile); + } + } + } + + void Debugger::debugMethod(MethodEnv* /*env*/) + { + // nop + } + + void Debugger::_debugMethod(MethodEnv* env) + { + traceMethod(env->method); + + // can't debug native methods + if ( !(env->method->flags & MethodInfo::NATIVE) ) + debugMethod(env); + } + + void Debugger::traceMethod(AbstractFunction* fnc, bool ignoreArgs) + { + if (astrace > TRACE_OFF) + { + if (fnc) + { + // disable trace temporarily so associated allocs don't appear + TraceLevel lvl = astrace; + astrace = TRACE_OFF; + + // WARNING: don't change the format of output since outside utils depend on it + uint64 delta = OSDep::currentTimeMillis() - astraceStartTime; + core->console << (uint32)(delta) << " AVMINF: MTHD "; + if (fnc->name && (fnc->name->length() > 0) ) + core->console << fnc->name; + else + core->console << ""; + + core->console << " ("; + if (!ignoreArgs && core->callStack && (lvl == TRACE_METHODS_WITH_ARGS || lvl == TRACE_METHODS_AND_LINES_WITH_ARGS)) + { + DebugStackFrame* frame = (DebugStackFrame*)frameAt(0); + int count; + Atom* arr; + if (frame && frame->arguments(arr, count)) + { + for(int i=0; iconsole << arr[i]; + if (i+1 < count) + core->console << ", "; + } + } + } + core->console << ")"; + if (!fnc->isFlagSet(AbstractFunction::SUGGEST_INTERP)) + { + core->console << " @ 0x"; + core->console.writeHexDWord( (int)fnc->impl32); + } + core->console << "\n"; + astrace = lvl; + } + } + } + + void Debugger::traceLine(int line) + { + if (astrace >= TRACE_METHODS_AND_LINES) + { + Stringp file = core->callStack->filename; + + TraceLevel lvl = astrace; + astrace = TRACE_OFF; + + // WARNING: don't change the format of output since outside utils depend on it + uint64 delta = OSDep::currentTimeMillis() - astraceStartTime; + core->console << (uint32)(delta) << " AVMINF: LINE "; + if (file) + core->console << " " << line << "\t\t " << file << "\n"; + else + core->console << " " << line << "\t\t ??? \n"; + astrace = lvl; + } + } + + /** + * Called when an abc file is first decoded. + * This method builds a list of source files + * and methods, etc from the given abc file. + */ + void Debugger::processAbc(PoolObject* pool, ScriptBuffer code) + { + // first off we build an AbcInfo object + AbcFile* abc = new (core->GetGC()) AbcFile(core, code.getSize()); + + // now let's scan the abc resources pulling out what we need + scanResources(abc, pool); + + // build a bridging table from pools to abcs + int index = abcList.size(); + pool2abcIndex.add(pool, (const void*)index); + + // at this point our abc object has been populated with + // source file objects and should ready to go. + // so we add it to the list and we are done + abcList.add(abc); + } + + /** + * Scans the pool object and pulls out information about the abc file + * placing it in the AbcFile + */ + void Debugger::scanResources(AbcFile* file, PoolObject* pool) + { + // walk all methods + int mCount = pool->methodCount; + for(int i=0; imethods[i]; + if (f->hasMethodBody()) + { + // yes there is code for this method + MethodInfo* m = (MethodInfo*)f; + if (m->body_pos) + { + // if body_pos is null we havent got the body yet or + // this is an interface method + scanCode(file, pool, m); + } + } + } + } + + /** + * Scans the bytecode and adds source level information to + * the abc info object + */ + bool Debugger::scanCode(AbcFile* file, PoolObject* pool, MethodInfo* m) + { + const byte *abc_start = &m->pool->code()[0]; + + const byte *pos = m->body_pos; + + m->setFile(file); + + AvmCore::readU30(pos); // max_stack + AvmCore::readU30(pos); // local_count; + AvmCore::readU30(pos); // init_stack_depth; + AvmCore::readU30(pos); // max_stack_depth; + int code_len = AvmCore::readU30(pos); + + const byte *start = pos; + const byte *end = pos + code_len; + + int size = 0; + int op_count; + SourceFile* active = NULL; // current source file + for (const byte* pc=start; pc < end; pc += size) + { + op_count = opOperandCount[*pc]; + if (op_count == -1 && *pc != OP_lookupswitch) + return false; // ohh very bad, verifier will catch this + + size = AvmCore::calculateInstructionWidth(pc); + + if (pc+size > end) + return false; // also bad, let the verifier will handle it + + switch (*pc) + { + case OP_lookupswitch: + { + // variable length instruction + const byte *pc2 = pc+4; + int case_count = 1 + readU30(pc2); + size += case_count*3; + break; + } + + case OP_debug: + { + // form is 8bit type followed by pool entry + // then 4Byte extra info + int type = (uint8)*(pc+1); + + switch(type) + { + case DI_LOCAL: + { + // in this case last word contains + // register and line number + const byte* pc2 = pc+2; + int index = readU30(pc2); + int slot = (uint8)*(pc2); + //int line = readS24(pc+5); + + + //Atom str = pool->cpool[index]; + Stringp s = pool->getString(index); + m->setRegName(slot, s); + } + } + + break; + } + + case OP_debugline: + { + // this means that we have a new source line for the given offset + const byte* pc2 = pc+1; + int line = readU30(pc2); + if (active == NULL) + AvmAssert(0 == 1); // means OP_debugline appeared before OP_debugfile which is WRONG! Fix compiler + else + active->addLine(core, line, m, pc - abc_start); + break; + } + + case OP_debugfile: + { + // new or existing source file + const byte* pc2 = pc+1; + Stringp name = pool->getString(readU30(pc2)); + active = file->sourceNamed(name); + if (active == NULL) + { + active = new (core->GetGC()) SourceFile(core->GetGC(), name); + file->sourceAdd(active); + } + break; + } + } + } + return true; + } + + /** + * Returns the call stack depth (i.e. number of frames). + */ + int Debugger::frameCount() + { + const int MAX_FRAMES = 500; // we need a max, for perf. reasons (bug 175526) + CallStackNode* trace = core->callStack; + int count = 1; + while( (trace = trace->next) != 0 && count < MAX_FRAMES ) + count++; + return count; + } + + /** + * Set frame to point to the specified frame number + * or null if frame number does not exist. + */ + DebugFrame* Debugger::frameAt(int frameNbr) + { + DebugFrame* frame = NULL; + + if (frameNbr >= 0) + { + CallStackNode* trace = locateTrace(frameNbr); + if (trace) + frame = new (core->GetGC()) DebugStackFrame(frameNbr, trace, this); + } + return frame; + } + + /** + * Stack frames are labelled 0 to stackTrace->depth + * With zero being the topmost or most recent frame. + */ + CallStackNode* Debugger::locateTrace(int frameNbr) + { + int count = 0; + CallStackNode* trace = core->callStack; + while(count++ < frameNbr && trace != NULL) + trace = trace->next; + + return trace; + } + + /** + * # of abc files available + */ + int Debugger::abcCount() const + { + return abcList.size(); + } + + /** + * Get information on each of the abc files that + * have been loaded. + */ + AbcInfo* Debugger::abcAt(int index) const + { + return abcList.get(index); + } + + /** + * Contains all known debug information regarding a single + * abc/swf file + */ + AbcFile::AbcFile(AvmCore* core, int size) + : core(core), + source(core->GetGC()), + byteCount(size) + { + sourcemap = new (core->GetGC()) Hashtable(core->GetGC()); + } + + int AbcFile::sourceCount() const + { + return source.size(); + } + + SourceInfo* AbcFile::sourceAt(int index) const + { + return source.get(index); + } + + int AbcFile::size() const + { + return byteCount; + } + + /** + * Find a source file with the given name + */ + SourceFile* AbcFile::sourceNamed(Stringp name) + { + Atom atom = sourcemap->get(name->atom()); + if (AvmCore::isUndefined(atom)) + return NULL; + uint32 index = AvmCore::integer_u(atom); + return source.get(index); + } + + /** + * Add source file to list; no check for uniqueness + * of name + */ + void AbcFile::sourceAdd(SourceFile* s) + { + uint32 index = source.add(s); + sourcemap->add(s->name()->atom(), core->uintToAtom(index)); + } + + /** + * new source info + */ + SourceFile::SourceFile(MMgc::GC* gc, Stringp name) + : named(name) + , functions(gc) + { + } + + Stringp SourceFile::name() const + { + return named; + } + + /** + * A line - offset pair should be recorded + */ + void SourceFile::addLine(AvmCore* core, int linenum, MethodInfo* func, int offset) + { + // Add the function to our list if it doesn't exist. Use lastIndexOf() instead of + // indexOf(), because this will be faster in the very common case where the function + // already exists at the end of the list. + int index = functions.lastIndexOf(func); + if (index < 0) + index = functions.add(func); + + // line numbers for a given function don't always come in sequential + // order -- for example, I've seen them come out of order if a function + // contains an inner anonymous function -- so, compare the new line + // against firstSourceLine every time we get called + if (func->firstSourceLine == 0 || linenum < func->firstSourceLine) + func->firstSourceLine = linenum; + + if (func->offsetInAbc == 0 || offset < func->offsetInAbc) + func->offsetInAbc = offset; + + if (func->lastSourceLine == 0 || linenum > func->lastSourceLine) + func->lastSourceLine = linenum; + + if (sourceLines == NULL) + sourceLines = new (core->GetGC()) BitSet(); + sourceLines->set(linenum); + } + + int SourceFile::functionCount() const + { + return functions.size(); + } + + MethodInfo* SourceFile::functionAt(int index) const + { + return functions.get(index); + } + + bool SourceFile::setBreakpoint(int linenum) + { + if (sourceLines == NULL || !sourceLines->get(linenum)) + return false; + + if (breakpoints == NULL) + breakpoints = new (GC::GetGC(this)) BitSet(); + breakpoints->set(linenum); + return true; + } + + bool SourceFile::clearBreakpoint(int linenum) + { + if (breakpoints == NULL || !breakpoints->get(linenum)) + return false; + breakpoints->clear(linenum); + return true; + } + + bool SourceFile::hasBreakpoint(int linenum) + { + return (breakpoints != NULL && breakpoints->get(linenum)); + } + + DebugStackFrame::DebugStackFrame(int nbr, CallStackNode* tr, Debugger* debug) + : trace(tr) + , debugger(debug) + , frameNbr(nbr) + { + } + + /** + * Identifies the source file and source line number + * corresponding to this frame + */ + bool DebugStackFrame::sourceLocation(SourceInfo*& source, int& linenum) + { + // use the method info to locate the abcfile / source + AbstractFunction* m = trace->info; + if (trace->filename) + { + int index = (int)debugger->pool2abcIndex.get(Atom((PoolObject*)m->pool)); + + AbcFile* abc = (AbcFile*)debugger->abcAt(index); + source = abc->sourceNamed(trace->filename); + } + linenum = trace->linenum; + + // valid info? + return (source != NULL && linenum > 0); + } + + /** + * This pointer for the frame + */ + bool DebugStackFrame::dhis(Atom& a) + { + bool worked = false; + if (trace->framep) + { + MethodInfo* info = (MethodInfo*)trace->info; + info->boxLocals(trace->framep, 0, trace->traits, &a, 0, 1); // pull framep[0] = [this] + worked = true; + } + else + { + a = undefinedAtom; + } + return worked; + } + + /** + * @return a pointer to an object Atom whose members are + * the arguments passed into a function for this frame + */ + bool DebugStackFrame::arguments(Atom*& ar, int& count) + { + bool worked = true; + if (trace->framep) + { + int firstArgument, pastLastArgument; + argumentBounds(&firstArgument, &pastLastArgument); + count = pastLastArgument - firstArgument; + if (count > 0) + { + // pull the args into an array -- skip [0] which is [this] + ar = (Atom*) debugger->core->GetGC()->Calloc(count, sizeof(Atom), GC::kContainsPointers|GC::kZero); + MethodInfo* info = (MethodInfo*)trace->info; + info->boxLocals(trace->framep, firstArgument, trace->traits, ar, 0, count); + } + } + else + { + worked = false; + count = 0; + } + return worked; + } + + bool DebugStackFrame::setArgument(int which, Atom& val) + { + bool worked = false; + if (trace->framep) + { + int firstArgument, pastLastArgument; + argumentBounds(&firstArgument, &pastLastArgument); + int count = pastLastArgument - firstArgument; + if (count > 0 && which < count) + { + // copy the single arg over + MethodInfo* info = (MethodInfo*)trace->info; + info->unboxLocals(&val, 0, trace->traits, trace->framep, firstArgument+which, 1); + worked = true; + } + } + return worked; + } + + /** + * @return a pointer to an object Atom whose members are + * the active locals for this frame. + */ + bool DebugStackFrame::locals(Atom*& ar, int& count) + { + bool worked = true; + if (trace->framep) + { + int firstLocal, pastLastLocal; + localBounds(&firstLocal, &pastLastLocal); + count = pastLastLocal - firstLocal; + AvmAssert(count >= 0); + if (count > 0) + { + // frame looks like [this][param0...paramN][local0...localN] + ar = (Atom*) debugger->core->GetGC()->Calloc(count, sizeof(Atom), GC::kContainsPointers|GC::kZero); + MethodInfo* info = (MethodInfo*)trace->info; + info->boxLocals(trace->framep, firstLocal, trace->traits, ar, 0, count); + + // If NEED_REST or NEED_ARGUMENTS is set, and the MIR is being used, then the first + // local is actually not an atom at all -- it is an ArrayObject*. So, we need to + // convert it to an atom. (If the interpreter is being used instead of the MIR, then + // it is stored as an atom.) + if (info->flags & (AbstractFunction::NEED_REST | AbstractFunction::NEED_ARGUMENTS)) + { + int atomType = ar[0] & 7; + if (atomType == 0) // 0 is not a legal atom type, so ar[0] is not an atom + { + ScriptObject* obj = (ScriptObject*)ar[0]; + ar[0] = obj->atom(); + } + } + } + } + else + { + worked = false; + count = 0; + } + return worked; + } + + bool DebugStackFrame::setLocal(int which, Atom& val) + { + bool worked = false; + if (trace->framep) + { + int firstLocal, pastLastLocal; + localBounds(&firstLocal, &pastLastLocal); + int count = pastLastLocal - firstLocal; + if (count > 0 && which < count) + { + MethodInfo* info = (MethodInfo*)trace->info; + if (which == 0 && (info->flags & (AbstractFunction::NEED_REST | AbstractFunction::NEED_ARGUMENTS))) + { + // They are trying to modify the first local, but that is actually the special + // array for "...rest" or for "arguments". That is too complicated to allow + // right now. We're just going to fail the request. + } + else + { + // copy the single arg over + info->unboxLocals(&val, 0, trace->traits, trace->framep, firstLocal+which, 1); + worked = true; + } + } + } + return worked; + } + + // Returns the indices of the arguments: [firstArgument, pastLastArgument) + void DebugStackFrame::argumentBounds(int* firstArgument, int* pastLastArgument) + { + *firstArgument = 1; // because [0] is 'this' + *pastLastArgument = indexOfFirstLocal(); + } + + // Returns the indices of the locals: [firstLocal, pastLastLocal) + void DebugStackFrame::localBounds(int* firstLocal, int* pastLastLocal) + { + *firstLocal = indexOfFirstLocal(); + if (trace->framep) + { + MethodInfo* info = (MethodInfo*) trace->info; + *pastLastLocal = info->local_count; + } + else + { + *pastLastLocal = *firstLocal; + } + } + + int DebugStackFrame::indexOfFirstLocal() + { + // 'trace->argc' is the number of arguments that were actually passed in + // to this function, but that is not what we want -- we want + // 'info->param_count', because that is the number of arguments we were + // *expecting* to get. There are two reasons we want 'info->param_count': + // + // (1) if the caller passed in too many args, we want to ignore the + // trailing ones; and + // (2) if the caller passed in too few args to a function that has some + // default parameters, we want to display the args with their default + // values. + return 1 + trace->info->param_count; + } + +} + +#endif /* DEBUGGER */ diff --git a/mozilla/js/tamarin/core/avmplusDebugger.h b/mozilla/js/tamarin/core/avmplusDebugger.h new file mode 100644 index 00000000000..a486b30b986 --- /dev/null +++ b/mozilla/js/tamarin/core/avmplusDebugger.h @@ -0,0 +1,596 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 1993-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#ifndef __avmplus_Debugger__ +#define __avmplus_Debugger__ + +#ifdef DEBUGGER +namespace avmplus +{ + enum DIType + { + DI_BAD = 0, + DI_LOCAL, + }; + + /** + * ---------------------------------------------------------- + * Interfaces supported by the AVM+ Debugger + * + * ---------------------------------------------------------- + */ + + class SourceInfo : public MMgc::GCFinalizedObject + { + public: + /** + * Dummy destructor + */ + virtual ~SourceInfo() {} + + /** + * Name of the source file + */ + virtual Stringp name() const = 0; + + /** + * Number of functions defined in this file. + */ + virtual int functionCount() const = 0; + + /** + * Access to each function. This is + * accomplished via a call to locationFor + * which translates a source line number to a + * function index and an offset within the + * + */ + virtual MethodInfo* functionAt(int index) const = 0; + + /** + * Sets a breakpoint at the specified line. + * @return true for success, false for failure (e.g. because + * there is no source code at that line). + */ + virtual bool setBreakpoint(int linenum) = 0; + + /** + * Removes a breakpoint. + */ + virtual bool clearBreakpoint(int linenum) = 0; + + /** + * Returns whether this source file has a breakpoint at + * the indicated line. + */ + virtual bool hasBreakpoint(int linenum) = 0; + }; + + class AbcInfo : public MMgc::GCFinalizedObject + { + public: + /** + * Dummy destructor + */ + virtual ~AbcInfo() {} + + /** + * Information about the source files encountered within this abc file. + */ + virtual int sourceCount() const = 0; + + /** + * SourceInfo at index in array + */ + virtual SourceInfo* sourceAt(int index) const = 0; + + /** + * Number of bytes in the abc file. + */ + virtual int size() const = 0; + }; + + class DebugFrame + { + public: + // since we have virtual functions, we probably need a virtual dtor + virtual ~DebugFrame() {} + + /** + * Identifies the source file and source line number + * corresponding to this frame + */ + virtual bool sourceLocation(SourceInfo*& source, int& linenum) = 0; + + /** + * @returns a pointer to an array of count Atoms + */ + virtual bool arguments(Atom*& ar, int& count) = 0; + + /** + * @return a pointer to an object Atom whose members are + * the active locals for this frame. + */ + virtual bool locals(Atom*& ar, int& count) = 0; + + /** + * Set the value of a particular argument in the frame + */ + virtual bool setArgument(int which, Atom& val) = 0; + + /** + * Set the value of a particular local variable + * in the frame + */ + virtual bool setLocal(int which, Atom& val) = 0; + + /** + * This pointer for the frame + */ + virtual bool dhis(Atom& a) = 0; + }; + + // forward refs + class AbcFile; + class SourceFile; + class DebugStackFrame; + + /** + * Debugger support for the AVM+ virtual machine. + * + * Debugger is an abstract base class which must be subclassed. + * The Debugger base class will do the needed bookkeeping + * to track current file, line number, and has the logic + * for single-stepping through code and setting breakpoints. + * What it lacks is a user interface. + * + * Programs that embed the AVM+ virtual machine that want + * debugging support must subclass Debugger and override + * methods to actually put a face on the debugger. + * + * The class DebugCLI in the AVM+ command-line shell is an + * example of a Debugger subclass that provides a simple + * gdb-like interface. + */ + class Debugger : public MMgc::GCFinalizedObject + { + public: + /** + * Constructor; must be invoked from subclass to + * initialize the Debugger's internal state. + */ + Debugger(AvmCore *core); + virtual ~Debugger() {} + + /** + * enterDebugger must be overridden. + * It should block and present the actual debugger UI. + */ + virtual void enterDebugger() = 0; + + /** + * filterException must be overridden. + * This gives a debugger an opportunity to look at + * an exception at the instant before it is thrown. + * The debugger may choose to stop execution at this + * point and permit the developer to debug. + * + * @returns true if the debugger showed this exception + * to the developer (either by halting, or by doing a + * stack dump, or any other means); false if the debugger + * ignored the exception, in which case Flash might dump + * it to the console and/or display a message box. + */ + virtual bool filterException(Exception *exception) = 0; + + /** + * Called at the end of the method's prologue + * to notify the debugger that a new method is about to be executed. + */ + virtual void debugMethod(MethodEnv* env); + + /** + * Non-virtual version of debugMethod, for calling + * from generated code + * + * WARNING: + * Do not make this virtual. It is called from generated code. + */ + void _debugMethod(MethodEnv* env); + + /** + * debugLine is called from executing bytecode to + * report the current line number. If linenum == -1, + * that means that the current line number has not changed + * -- in other words, we're currently in the middle of a + * line -- but that the debugger nonetheless needs to be + * given the opportunity to break in. + * + * WARNING: + * Do not make this virtual. It is called from generated code. + */ + void debugLine(int linenum); + + /** + * debugFile is called from executing bytecode to + * report the file name that debugLine is reporting + * line numbers against. + * + * WARNING: + * Do not make this virtual. It is called from generated code. + */ + void debugFile(Stringp file); + + /** + * Called when an abc file is first decoded. + * This method builds a list of source files + * and methods, etc from the given abc file. + */ + virtual void processAbc(PoolObject* pool, ScriptBuffer code); + + /** + * -------------------------------------------------- + * Execution related methods + * -------------------------------------------------- + */ + + /** + * Step to the next executable source line within the + * program, will enter into functions. + * + * This method sets the halt state and returns; + * the debugger must return to actually resume execution. + */ + void stepInto(); + + /** + * Step to the next executable source line within + * the program, will NOT enter into functions. + * + * This method sets the halt state and returns; + * the debugger must return to actually resume execution. + */ + void stepOver(); + + /** + * Step out of the current method/function onto the + * next executable source line. + * + * This method sets the halt state and returns; + * the debugger must return to actually resume execution. + */ + void stepOut(); + + /** + * If this is called, that indicates that enterDebugger() was called, but + * for some reason the debugger on the other end of the socket connection told + * us that it did not want to stop -- it wanted to continue with whatever + * "step" command was already in progress. The main case where this happens + * is when the user steps, and we hit a conditional breakpoint, but it turns + * out that the condition of the breakpoint has not been met. + */ + void stepContinue(); + + /** + * -------------------------------------------------- + * Breakpoints + * -------------------------------------------------- + */ + + /** + * Set a breakpoint in a particular source flie + * NOTE: if the 'same' source file appears in + * multiple abc files, it is up to the caller + * to ensure that this call is performed for each + * SourceInfo object. + * + * Setting the same breakpoint multiple times + * has no further effect + */ + bool breakpointSet(SourceInfo* src, int linenum); + + /** + * Clear a breakpoint on a particular source file + * Clearing a breakpoing that was not previously + * set has no effect and returns false. + */ + bool breakpointClear(SourceInfo* src, int linenum); + + /** + * -------------------------------------------------- + * Watchpoints + * -------------------------------------------------- + */ + + /** + * Set a watchpoint that halts debugger execution when + * a read/write access occurs on the variable named memberName. + * @param context is either the parent variable on which the + * member exists or some other context (such as _global, _level0, + * the locals array, the args array, etc) in which the + * variable is found. + * @param memberName is the name of the member on which the + * watch should be placed. + * @param k is the type of watch; one of read, write, readwrite. + */ + //bool watchpointSet(Atom context, Atom memberName, WatchKind k); + + /** + * Remove a previously set watchpoint from a variable member. + * @param context is either the parent variable on which the + * member exists or some other context (such as _global, _level0, + * the locals array, the args array, etc) in which the + * variable is found. + * @param memberName is the name of the member on which the + * watch should be placed. + * @param k is the type of watch; one of read, write, readwrite. + */ + //bool watchpointClear(Atom context, Atom memberName); + + /** + * Checks whether any variables that are being watched have + * changed. Returns true if at least one has changed, or + * false if none of them have changed. + */ + virtual bool hitWatchpoint() = 0; + + /** + * -------------------------------------------------- + * Call stack (frame) related methods + * -------------------------------------------------- + */ + + /** + * Returns the call stack depth (i.e. number of frames). + */ + int frameCount(); + + /** + * Set frame to point to the specified frame number + * or null if frame number does not exist. + */ + DebugFrame* frameAt(int frameNbr); + + /** + * -------------------------------------------------- + * Abc file information + * -------------------------------------------------- + */ + + /** + * # of abc files available + */ + int abcCount() const; + + /** + * Get information on each of the abc files that + * have been loaded. + */ + AbcInfo* abcAt(int index) const; + + /** + * -------------------------------------------------- + * Trace facility for dumping out method entry + * line number and file name information while executing + * -------------------------------------------------- + */ + + typedef enum _TraceLevel + { + TRACE_OFF = 0, + TRACE_METHODS = 1, // method entry only + TRACE_METHODS_WITH_ARGS = 2, // method entry and arguments + TRACE_METHODS_AND_LINES = 3, // method entry and line numbers + TRACE_METHODS_AND_LINES_WITH_ARGS = 4, // method entry, arguments and line numbers + } TraceLevel; + + static TraceLevel astrace; + static uint64 astraceStartTime; + + void traceMethod(AbstractFunction* fnc, bool ignoreArgs=false); + void traceLine(int linenum); + + protected: + friend class DebugStackFrame; + + AvmCore *core; + + class StepState { + public: + StepState() { clear(); } + void clear() { flag = false; depth = startingDepth = -1; } + + bool flag; + int depth; + int startingDepth; + }; + + StepState stepState; + StepState oldStepState; + + // helper: find a StackTrace object for a given frame number + CallStackNode* locateTrace(int frameNbr); + + // internal helper functions for parsing abcfiles + void scanResources(AbcFile* file, PoolObject* pool); + bool scanCode(AbcFile* file, PoolObject* pool, MethodInfo* m); + + // all abc files + List abcList; + MMgc::GCHashtable pool2abcIndex; + + private: + static int readS24(const byte *pc) { return AvmCore::readS24(pc); } + static int readU16(const byte *pc) { return AvmCore::readU16(pc); } + static int readU30(const byte *&pc) { return AvmCore::readU30(pc); } + + }; + + /** + * ---------------------------------------------------------- + * Implementation classes for the interfaces defined above + * ---------------------------------------------------------- + */ + + class AbcFile : public AbcInfo + { + public: + /** + * Information about the source files encountered within this abc file. + */ + int sourceCount() const; + + /** + * SourceInfo at index in array + */ + SourceInfo* sourceAt(int index) const; + + /** + * Number of bytes in the abc file. + */ + int size() const; + + /** + * Contains all known debug information regarding a single + * abc/swf file + */ + AbcFile(AvmCore* core, int size); + + /** + * Add source file to list; no check for uniqueness + */ + void sourceAdd(SourceFile* s); + + /* + * Find a source file in the list that has the same name + * as that provided + */ + SourceFile* sourceNamed(Stringp name); + + protected: + AvmCore* core; + DWB(Hashtable*) sourcemap; // maps filename to that file's index in "sources" + List source; // all source files used in this abc file + int byteCount; // # bytes of bytecode + }; + + class SourceFile : public SourceInfo + { + public: + SourceFile(MMgc::GC* gc, Stringp name); + + /** + * name of source file + */ + Stringp name() const; + + /** + * Number of functions defined in this file. + */ + int functionCount() const; + + /** + * Access to each function + */ + MethodInfo* functionAt(int index) const; + + /** + * A line - offset pair should be recorded + */ + void addLine(AvmCore* core, int linenum, MethodInfo* function, int offset); + + bool setBreakpoint(int linenum); + bool clearBreakpoint(int linenum); + bool hasBreakpoint(int linenum); + + protected: + Stringp named; + List functions; + DWB(BitSet*) sourceLines; // lines that have source code on them + DWB(BitSet*) breakpoints; + }; + + class DebugStackFrame : public MMgc::GCObject, public DebugFrame + { + public: + /** + * Identifies the source file and source line number + * corresponding to this frame + */ + bool sourceLocation(SourceInfo*& source, int& linenum); + + /** + * @returns a pointer to an array of count Atoms + */ + bool arguments(Atom*& ar, int& count); + + /** + * @return a pointer to an array of Atoms whose + * 'count' members are the active locals for this frame. + */ + bool locals(Atom*& ar, int& count); + + /** + * Set the value of a particular argument in the frame + */ + bool setArgument(int index, Atom& val); + + /** + * Set the value of a particular local variable + * in the frame + */ + bool setLocal(int index, Atom& val); + + /** + * This pointer for the frame. + */ + bool dhis(Atom& a); + + // constructor + DebugStackFrame(int nbr, CallStackNode* trace, Debugger* debug); + + // expose this for all interested + CallStackNode* trace; + + protected: + void argumentBounds(int* firstArgument, int* pastLastArgument); + void localBounds(int* firstLocal, int* pastLastLocal); + int indexOfFirstLocal(); + + Debugger* debugger; + int frameNbr; // top of call stack == 0 + }; + +} +#endif /* DEBUGGER */ + +#endif /* __avmplus_Debugger__ */ diff --git a/mozilla/js/tamarin/core/avmplusHashtable.cpp b/mozilla/js/tamarin/core/avmplusHashtable.cpp new file mode 100644 index 00000000000..2c44690c776 --- /dev/null +++ b/mozilla/js/tamarin/core/avmplusHashtable.cpp @@ -0,0 +1,394 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 1993-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmplus.h" + +using namespace MMgc; + +// WARNING: +// WARNING: +// WARNING: +// Never do "MMgc::GC::GetGC(this)" in the HashTable object. It is dynamically +// placed at the end of a ScriptObject following traits data which can extend +// greater than 4k off the starting pointer. This will cause GetGC(this) to fail. +// WARNING: +// WARNING: +// WARNING: + +namespace avmplus +{ + void Hashtable::initialize(GC *gc, int capacity) + { + capacity = MathUtils::nextPowerOfTwo(capacity); + setNumAtoms(capacity*2); + AvmAssert(getNumAtoms()); + MMGC_MEM_TYPE(this); + setAtoms((Atom *) gc->Alloc (sizeof(Atom) * getNumAtoms(), GC::kContainsPointers|GC::kZero)); + flags = 0; + } + + Hashtable::~Hashtable() + { + destroy(); + } + + void Hashtable::destroy() + { + if(atoms) { + GC *gc = GC::GetGC(atoms); +#ifdef MMGC_DRC + AvmCore::decrementAtomRegion(atoms, getNumAtoms()); +#endif + gc->Free (atoms); + } + atoms = NULL; + setNumAtoms(0); + size = 0; + flags = 0; + } + + void Hashtable::setAtoms(Atom *newAtoms) + { + GC *gc = GC::GetGC(newAtoms); + gc->writeBarrier(gc->FindBeginning(this), &atoms, newAtoms); + } + + void Hashtable::put(Atom name, Atom value) + { + int i = find(name, atoms, getNumAtoms()); + GC *gc = GC::GetGC(atoms); + if ((atoms[i] & ~dontEnumMask()) != name) { + AvmAssert(!isFull()); + //atoms[i] = name; + WBATOM(gc, atoms, &atoms[i], name); + size++; + } + //atoms[i+1] = value; + WBATOM( gc, atoms, &atoms[i+1], value); + } + + Atom Hashtable::get(Atom name) const + { + int i; + return atoms[i = find(name, atoms, getNumAtoms())] == name ? atoms[i+1] : undefinedAtom; + } + + int Hashtable::find(Stringp x, const Atom *t, unsigned tLen) const + { + AvmAssert(x != NULL); + return find(x->atom(), t, tLen); + } + + int Hashtable::find(Atom x, const Atom *t, unsigned m) const + { + int mask = ~dontEnumMask(); + x &= mask; + + #if 0 // debug code to print out the strings we're searching for + static int debug =0; + if (debug && AvmCore::isString(x)) + { + Stringp s = AvmCore::atomToString(x); + AvmDebugMsg (s->c_str(), false); + AvmDebugMsg ("\n", false); + } + #endif + + int bitmask = (m - 1) & ~0x1; + + AvmAssert(x != EMPTY && x != DELETED); + // this is a quadratic probe but we only hit even numbered slots since those hold keys. + int n = 7 << 1; + #ifdef _DEBUG + unsigned loopCount = 0; + #endif + // Note: Mask off MSB to avoid negative indices. Mask off bottom + // 3 bits because it doesn't contribute to hash. Double it + // because names, values stored adjacently. + unsigned i = ((0x7FFFFFF8 & x)>>2) & bitmask; + Atom k; + while ((k=t[i]&mask) != x && k != EMPTY) + { + i = (i + (n += 2)) & bitmask; // quadratic probe + AvmAssert(loopCount++ < m); // don't scan forever + } + AvmAssert(i <= ((m-1)&~0x1)); + return i; + } + + Atom Hashtable::remove(Atom name) + { + int i = find(name, atoms, getNumAtoms()); + Atom val = undefinedAtom; + if ((atoms[i]&~dontEnumMask()) == name) + { + val = atoms[i+1]; + atoms[i] = DELETED; + atoms[i+1] = DELETED; + setHasDeletedItems(true); + } + return val; + } + + int Hashtable::rehash(Atom *oldAtoms, int oldlen, Atom *newAtoms, int newlen) + { + int newSize = 0; + for (int i=0, n=oldlen; i < n; i += 2) + { + Atom oldAtom; + if ((oldAtom=oldAtoms[i]) != EMPTY && oldAtom != DELETED) + { + // inlined & simplified version of put() + int j = find(oldAtom, newAtoms, newlen); + newAtoms[j] = oldAtom; + newAtoms[j+1] = oldAtoms[i+1]; + newSize++; + } + } + + return newSize; + } + + /** + * load factor is 0.75 so we're full if size >= M*0.75 + * where M = atoms.length/2
+ * size >= M*3/4
+ * 4*size >= 3*M
+ * 4*size >= 3*atoms.length/2
+ * 8*size >= 3*atoms.length
+ * size<<3 >= 3*atoms.length + */ + /** + * load factor is 0.9 so we're full if size >= M*0.9 + * where M = atoms.length/2
+ * size >= M*9/10
+ * 10*size >= 9*M
+ * 10*size >= 9*atoms.length/2
+ * 20*size >= 9*atoms.length
+ */ + bool Hashtable::isFull() const + { + // This seems to work very well and the Intel compiler converts both the multiplies + // into shift+add operations. + return (5*(getSize()+1)) >= 2*getNumAtoms(); // 0.80 + #if 0 + //return ((size<<3)+1) >= 3*getNumAtoms(); // 0.75 + //return ((40*size)+1) >= 19*getNumAtoms(); // 0.95 + //return ((40*size)+1) >= 18*getNumAtoms(); // 0.90 + //return ((40*size)+1) >= 17*getNumAtoms(); // 0.85 + //return ((40*size)+1) >= 15*getNumAtoms(); // 0.75 + //Edwins suggestion - if (size > max - max>>N)) grow (N = 5, 4, 3, 2) + //#define SHIFTFACTOR 4 + //NOT CORRECT + //return ( ( size << SHIFTFACTOR ) + size > (getNumAtoms() << (SHIFTFACTOR-1)) ); + #endif + } + + void Hashtable::add(Atom name, Atom value) + { + if (isFull()) + { + grow(); + } + put(name, value); + } + + void Hashtable::grow() + { + // grow the table by 2N+1 + // new = 2*old+1 ; old == o.atoms.length/2 + // = 2*(o.atoms.length/2)+1 + // = o.atoms.length + 1 + // If we have deleted slots, we don't grow our HT because our rehash will clear + // out spots for us. + int capacity = hasDeletedItems() ? getNumAtoms() : MathUtils::nextPowerOfTwo(getNumAtoms()+1); + GC* gc = GC::GetGC(atoms); + MMGC_MEM_TYPE(this); + Atom *newAtoms = (Atom *) gc->Calloc(capacity, sizeof(Atom), GC::kContainsPointers|GC::kZero); + size = rehash(atoms, getNumAtoms(), newAtoms, capacity); + gc->Free (atoms); + setAtoms(newAtoms); + setNumAtoms(capacity); + setHasDeletedItems(false); + return; + } + + Atom Hashtable::keyAt(int index) + { + return atoms[(index-1)<<1]; + } + + Atom Hashtable::valueAt(int index) + { + return atoms[((index-1)<<1)+1]; + } + +/* void Hashtable::removeAt(int index) + { + int i = (index-1)<<1; + atoms[i] = DELETED; + atoms[i+1] = DELETED; + setHasDeletedItems(true); + }*/ + + // call this method using the previous value returned + // by this method starting with 0, until 0 is returned. + int Hashtable::next(int index) + { + if (index != 0) { + index = index<<1; + } + // Advance to first non-empty slot. + int mask = dontEnumMask(); + int numAtoms = getNumAtoms(); + while (index < numAtoms) { + if ((atoms[index]&7) != EMPTY && (atoms[index]&7) != DELETED && (atoms[index]&mask) != kDontEnumBit) { + return (index>>1)+1; + } + index += 2; + } + return 0; + } + + bool Hashtable::propertyIsEnumerable(Atom name) const + { + if (hasDontEnumSupport()) + { + int i = find(name, atoms, getNumAtoms()); + if ((atoms[i]&~kDontEnumBit) == name) + { + return (atoms[i]&kDontEnumBit) == 0; + } + else + { + return false; + } + } + else + { + return contains(name); + } + } + + void Hashtable::setPropertyIsEnumerable(Atom name, bool enumerable) + { + if (hasDontEnumSupport()) + { + int i = find(name, atoms, getNumAtoms()); + if ((atoms[i]&~kDontEnumBit) == name) + { + atoms[i] = (atoms[i]&~kDontEnumBit) | (enumerable ? 0 : kDontEnumBit); + } + } + } + + Atom WeakKeyHashtable::getKey(Atom key) + { + // this gets a weak ref number, ie double keys, okay I guess + if(AvmCore::isPointer(key)) { + GCWeakRef *weakRef = ((GCObject*)(key&~7))->GetWeakRef(); + key = AvmCore::gcObjectToAtom(weakRef); + } + return key; + } + + void WeakKeyHashtable::add(Atom key, Atom value) + { + if(isFull()) { + prune(); + grow(); + } + put(getKey(key), value); + } + + void WeakKeyHashtable::prune() + { + for(int i=0, n=getNumAtoms(); iget() == NULL) { + // inlined delete + atoms[i] = DELETED; + atoms[i+1] = DELETED; + setHasDeletedItems(true); + } + } + } + } + + Atom WeakValueHashtable::getValue(Atom key, Atom value) + { + if(AvmCore::isGCObject(value)) { + GCWeakRef *wr = (GCWeakRef*)(value&~7); + if(wr->get() != NULL) { + // note wr could be a pointer to a double, that's what this is for + if(GC::GetGC(atoms)->IsRCObject(wr->get())) { + value = ((AvmPlusScriptableObject*)wr->get())->toAtom(); + } else { + AvmAssert(false); + } + } else { + remove(key); + value = undefinedAtom; + } + } + return value; + } + + void WeakValueHashtable::add(Atom key, Atom value) + { + if(isFull()) { + prune(); + grow(); + } + if(AvmCore::isPointer(value)) { + GCWeakRef* wf = ((GCObject*)(value&~7))->GetWeakRef(); + value = AvmCore::gcObjectToAtom(wf); + } + put(key, value); + } + + void WeakValueHashtable::prune() + { + for(int i=0, n=getNumAtoms(); iget() == NULL) { + // inlined delete + atoms[i] = DELETED; + atoms[i+1] = DELETED; + setHasDeletedItems(true); + } + } + } + } +} diff --git a/mozilla/js/tamarin/core/avmplusHashtable.h b/mozilla/js/tamarin/core/avmplusHashtable.h new file mode 100644 index 00000000000..936edc4bcb8 --- /dev/null +++ b/mozilla/js/tamarin/core/avmplusHashtable.h @@ -0,0 +1,289 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_Hashtable__ +#define __avmplus_Hashtable__ + + +namespace avmplus +{ + /** + * common base class for hashtable-like objects. + */ + class Hashtable : public MMgc::GCFinalizedObject + { + public: + /** + * since identifiers are always interned strings, they can't be 0, + * so we can use 0 as the empty value. + */ + const static Atom EMPTY = 0; + + /** DELETED is stored as the key for deleted items5 */ + const static Atom DELETED = undefinedAtom; + + /** kDefaultCapacity must be a power of 2 */ + const static int kDefaultCapacity = 8; + + int getSize() const { return size; } + int getNumAtoms() const { return logNumAtoms ? 1<<(logNumAtoms-1) : 0; } + + bool hasDontEnumSupport() const { return flags & kDontEnumSupport; } + void setDontEnumSupport(bool flag) { flags = (short)((flags & ~kDontEnumSupport) | (flag ? kDontEnumSupport : 0)); } + + int dontEnumMask() const { return hasDontEnumSupport() ? kDontEnumBit : 0; } + + bool propertyIsEnumerable(Atom name) const; + void setPropertyIsEnumerable(Atom name, bool enumerable); + + // kDontEnumBit is or'd into atoms to indicate that the property is {DontEnum} + enum + { + kDontEnumBit = 1 + }; + + private: + int size; + short logNumAtoms; + short flags; + + // Flags used in the "flags" variable + enum + { + kDontEnumSupport = 1, + kHasDeletedItems = 2 + }; + + bool hasDeletedItems() const { return (flags & kHasDeletedItems) != 0; } + + void setNumAtoms(int numAtoms) + { + logNumAtoms = numAtoms ? (short)(FindOneBit(numAtoms)+1) : 0; + AvmAssert(getNumAtoms() == numAtoms); + } + +#if defined(AVMPLUS_IA32) + static inline uint32 FindOneBit(uint32 value) + { +#ifndef __GNUC__ + _asm + { + bsr eax,[value]; + } +#else + // DBC - This gets rid of a compiler warning and matchs PPC results where value = 0 + register int result = ~0; + + if (value) + { + asm ( + "bsr %1, %0" + : "=r" (result) + : "m"(value) + ); + } + return result; +#endif + } + #elif defined(AVMPLUS_PPC) + + static inline int FindOneBit(uint32 value) + { + register int index; + #ifdef DARWIN + asm ("cntlzw %0,%1" : "=r" (index) : "r" (value)); + #else + register uint32 in = value; + asm { cntlzw index, in; } + #endif + return 31-index; + } + + #else // generic platform + + static int FindOneBit(uint32 value) + { + for (int i=0; i < 32; i++) + if (value & (1< template implements a simple List, which can + * be templated to support different types. + * + * Elements can be added to the end, modified in the middle, + * but no holes are allowed. That is for set(n, v) to work + * size() > n + * + * Note that [] operators are provided and you can violate the + * set properties using these operators, if you want a real + * list dont use the [] operators, if you want a general purpose + * array use the [] operators. + */ + + enum ListElementType { LIST_NonGCObjects, LIST_GCObjects, LIST_RCObjects }; + + template + class List : public MMgc::GCObject + { + public: + enum { kInitialCapacity = 128 }; + + List(int capacity = kInitialCapacity) + { + init(0, capacity); + } + List(MMgc::GC* gc, uint32 capacity = kInitialCapacity) + { + init(gc, capacity); + } + void init(MMgc::GC* gc, uint32 capacity) + { + len = 0; + max = 0; + data = NULL; + this->gc = gc; + ensureCapacity(capacity); + } + ~List() + { + if(gc) { + if(kElementType == LIST_RCObjects) { + for (unsigned int i=0; iFree(data); + } else + delete [] data; + // list can be a stack object so this can help the gc + data = NULL; + } + uint32 add(T value) + { + if (len >= max) { + grow(); + } + // messy WB, need to ignore write in cases where data isn't gc memory + wb(len++, value); + return len-1; + } + bool isEmpty() const + { + return len == 0; + } + uint32 size() const + { + return len; + } + uint32 capacity() const + { + return max; + } + T get(uint32 index) const + { + return data[index]; + } + void set(uint32 index, T value) + { + wb(index, value); + len = (index+1 > len) ? index+1 : len; + AvmAssert(index < max); + } + void insert(int index, T value) + { + if (len >= max) { + grow(); + } + //move items up + arraycopy(data, index, data, index + 1, len - index); + + // The item formerly at "index" is still in the array (at index+1), + // but arraycopy didn't increment its refcount. + // Null out its former slot, so that set() doesn't decrement its refcount. + if(kElementType == LIST_RCObjects) + data[ index ] = 0; + + set(index, value); + len++; + } + + void add(const List& l) + { + ensureCapacity(len+l.size()); + // FIXME: make RCObject version + AvmAssert(kElementType != LIST_RCObjects); + arraycopy(l.getData(), 0, data, len, l.size()); + len += l.size(); + } + + void clear() + { + if(kElementType == LIST_RCObjects) { + for (unsigned int i=0; i=0; i--) + if (data[i] == value) + return i; + return -1; + } + + T removeAt(uint32 i) + { + T old = (T)0; + if (i >= 0) + { + old = data[i]; + if(kElementType == LIST_RCObjects) + set(i, NULL); + arraycopy(data, i+1, data, i, len-i-1); + len--; + // clear copy at the end so it can be collected if removed + // and isn't decremented on next add + if(kElementType != LIST_NonGCObjects) + data[len] = NULL; + AvmAssert(len >= 0); + } + return old; + } + + T removeFirst() { return isEmpty() ? (T)0 : removeAt(0); } + T removeLast() { return isEmpty() ? (T)0 : removeAt(len-1); } + + T operator[](uint32 index) const + { + return data[index]; + } + + void ensureCapacity(uint32 cap) + { + if(cap > max) { + int gcflags = 0; + if(kElementType == LIST_GCObjects) + gcflags |= MMgc::GC::kContainsPointers; + if(kElementType == LIST_RCObjects) + gcflags |= (MMgc::GC::kContainsPointers|MMgc::GC::kZero); + + T* newData = (gc) ? (T*) gc->Calloc(cap, sizeof(T), gcflags) : new T[cap]; + for (unsigned int i=0; iIsPointerToGCPage(this)) { + // data = newData; + WB(gc, gc->FindBeginning(this), &data, newData); + } else { + data = newData; + } + max = cap; + } + } + + const T *getData() const { return data; } + + private: + T *data; + uint32 len; + uint32 max; + MMgc::GC* gc; + + void grow() + { + // growth is fast at first, then slows at larger list sizes. + int newMax = 0; + if (max == 0) + newMax = kInitialCapacity; + else if(max > 15) + newMax = max * 3/2; + else + newMax = max * 2; + + ensureCapacity(newMax); + } + + void arraycopy(const T* src, int srcStart, T* dst, int dstStart, int nbr) + { + // we have 2 cases, either closing a gap or opening it. + if ((src == dst) && (srcStart > dstStart) ) + { + for(int i=0; i=0; i--) + dst[i+dstStart] = src[i+srcStart]; + } + } + void wb(uint32 index, T value) + { + AvmAssert(index < max); + AvmAssert(data != NULL); + switch(kElementType) + { + case LIST_NonGCObjects: + data[index] = value; + break; + case LIST_GCObjects: + WB(gc, data, &data[index], value); + break; + case LIST_RCObjects: + WBRC(gc, data, &data[index], value); + break; + } + } + }; +} + +#endif /* __avmplus_List__ */ diff --git a/mozilla/js/tamarin/core/avmplusProfiler.cpp b/mozilla/js/tamarin/core/avmplusProfiler.cpp new file mode 100644 index 00000000000..e87ea91969e --- /dev/null +++ b/mozilla/js/tamarin/core/avmplusProfiler.cpp @@ -0,0 +1,74 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmplus.h" + +#ifdef DEBUGGER +namespace avmplus +{ + ScriptObjectTable::ScriptObjectTable(AvmCore *core) + { + this->core = core; + table = new (core->GetGC()) Hashtable(core->GetGC()); + } + + void ScriptObjectTable::addScriptObject(ScriptObject *object) + { + table->add(mask(object), (Atom)core->newStackTrace()); + } + + void ScriptObjectTable::deleteScriptObject(ScriptObject *object) + { + table->remove(mask(object)); + } + + bool ScriptObjectTable::nextObject(int& index, + ScriptObject*& object, + StackTrace*& stackTrace) + { + // Find next non-empty slot. + int numAtoms = table->getNumAtoms(); + while (index < numAtoms) { + Atom atom = table->getAtoms()[index]; + if (atom != Hashtable::EMPTY && atom != Hashtable::DELETED) { + object = unmask(table->getAtoms()[index]); + stackTrace = (StackTrace*) table->getAtoms()[index+1]; + index += 2; + return true; + } + index += 2; + } + + return false; + } +} +#endif diff --git a/mozilla/js/tamarin/core/avmplusProfiler.h b/mozilla/js/tamarin/core/avmplusProfiler.h new file mode 100644 index 00000000000..717ae02631a --- /dev/null +++ b/mozilla/js/tamarin/core/avmplusProfiler.h @@ -0,0 +1,213 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_AvmProfiler__ +#define __avmplus_AvmProfiler__ + + +namespace avmplus +{ +#ifdef DEBUGGER + /** + * The ScriptObjectTable is used to track what objects are + * in the system, for heap dumps. + */ + class ScriptObjectTable : public MMgc::GCObject + { + public: + ScriptObjectTable(AvmCore *core); + + /** + * This will be called when a ScriptObject is constructed. + * The ScriptObject will be added to the scriptObjectTable. + * + * There will be a matching call to deleteScriptObject + * upon ScriptObject destruction. + * + * @param scriptObject the address to the ScriptObject + * being constructed. + */ + void addScriptObject(ScriptObject *object); + + /** + * This will be called when a ScriptObject is destroyed. + * The ScriptObject will be removed from the scriptObjectTable. + * + * There will be a matching call to addScriptObject + * upon ScriptObject construction. + * + * @param scriptObject the address to the ScriptObject + * being destroyed. + */ + void deleteScriptObject(ScriptObject *object); + + /** + * Used to iterate over the contents of the table. + */ + bool nextObject(int& index, + ScriptObject*& object, + StackTrace*& stackTrace); + + /** + * Returns # of objects in table + */ + int size() const { return table->getSize(); } + + private: + AvmCore *core; + DWB(Hashtable*) table; + + static Atom mask(ScriptObject *object) { + return object->atom() ^ 0xFFFFFFF8; + } + + static ScriptObject* unmask(Atom atom) { + return AvmCore::atomToScriptObject(atom ^ 0xFFFFFFF8); + } + }; + + /** + * The Profiler class is a pure virtual base class. It specifies + * an interface which must be implemented by profilers that + * wish to plug in to the AVM+ virtual machine. + * + * A program embedding AVM+ may set AvmCore::profiler to an + * instance of a Profiler subclass. AvmCore::profiler will be + * informed about events of interest to profilers, such as + * function entry and exit and execution of each line of code. + */ + class Profiler : public MMgc::GCCallback + { + public: + Profiler(MMgc::GC *gc) : MMgc :: GCCallback(gc){} + + virtual ~Profiler() {} + + /** + * This will be called to notify the profiler that the + * source file for which line number information is reported + * has changed. + * @param url the URL of the new source file, as encoded + * in the OP_debugfile bytecode + */ + virtual void sendDebugFileUrl(UTF8String *url) = 0; + + /** + * This will be called to notify the profiler that the + * line number has changed. + * @param linenumber the line number of the source file, as encoded + * in the OP_debugline bytecode + */ + virtual void sendLineTimestamp(int linenumber) = 0; + + /** + * This will be called when ActionScript profile(boolean) + * is called. profile(boolean) is used to turn on + * and off profiling, so that certain ActionScript + * can be profiled. + * @param on the setting for profiling. true turns + * profiling on, false turns it off for + * this section of ActionScript. + */ + virtual void setEnabled(bool on) = 0; + + /** + * This will be called to notify the profiler that a + * function has been entered. + * + * There will be a matching call to sendFunctionExit, + * unless an exception is thrown. + * + * @param method the method being entered + */ + virtual void sendFunctionEnter(AbstractFunction* method) = 0; + + /** + * This will be called to notify the profiler that a + * function has been exited. + * + * This is always called to match a previous call to + * sendFunctionEnter. + */ + virtual void sendFunctionExit() = 0; + + /** + * This will be called to notify the profiler that an + * exception was thrown and execution will commence in + * the given method's catch handler + * + * @param method the method being entered + */ + virtual void sendCatch(AbstractFunction* method) = 0; + + /** + * This is called when we want to write out heap profiling data. + * ActionScript function heapdump() triggers this call. + * + * @param heapDumpName enables the user to label this heap dump. + * This string will be sent down to the + * profiling output so that the user can + * refer to it later in the profiling output. + * heapDumpName should be NULL if the + * user calls ActionScript heapdump() + * with no parameter to label the dump. + */ + virtual void sendHeapDump(String *heapDumpName) = 0; + + /** + * This returns the size of the String, including the String type size, + * and the length of the String multiplied by the wchar size. + * + * @param myString the address to the String for which size + * should be computed. + */ + virtual int computeStringSize(String *myString) = 0; + + /** + * Is profiling wanted at all? + */ + bool profilingDataWanted; + + /** + * Is heap profiling wanted? + */ + bool heapProfilingWanted; + + /** + * Is profiling on right now, given the usage of AS profile(boolean)? + * The main code to turn on and off this value is Profiler::SetProfileSwitch(). + */ + bool profileSwitch; + }; +#endif +} + +#endif /* __avmplus_AvmProfiler__ */ diff --git a/mozilla/js/tamarin/core/avmplusStack.h b/mozilla/js/tamarin/core/avmplusStack.h new file mode 100644 index 00000000000..21cb038a0b5 --- /dev/null +++ b/mozilla/js/tamarin/core/avmplusStack.h @@ -0,0 +1,101 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_Stack__ +#define __avmplus_Stack__ + + +namespace avmplus +{ + /** + * The Stack template implements a simple stack, which can + * be templated to support different types. + */ + template + class Stack + { + public: + enum { kInitialCapacity = 128 }; + + Stack() + { + data = new T[kInitialCapacity]; + len = 0; + max = kInitialCapacity; + } + virtual ~Stack() + { + delete [] data; + } + void add(T value) + { + if (len >= max) { + grow(); + } + data[len++] = value; + } + bool isEmpty() + { + return len == 0; + } + T pop() + { + return data[--len]; + } + void reset() + { + len = 0; + } + int size() + { + return len; + } + + private: + T *data; + int len; + int max; + + void grow() + { + int newMax = max * 5 / 4; + T *newData = new T[newMax]; + for (int i=0; i +#endif + +//#define _BigEndian + +namespace avmplus +{ + typedef unsigned char byte; + typedef unsigned char uint8; + typedef unsigned short uint16; + typedef char sint8; + typedef char int8; + typedef short sint16; + typedef short int16; + typedef unsigned int uint32; + typedef signed int sint32; + typedef signed int int32; + typedef unsigned long intptr; + #ifdef _MSC_VER + typedef __int64 int64; + typedef __int64 sint64; + typedef unsigned __int64 uint64; + #elif defined(_MAC) + typedef int64_t int64; + typedef int64_t sint64; + typedef uint64_t uint64; + #else + typedef long long int64; + typedef long long sint64; + typedef unsigned long long uint64; + #endif + + /* wchar is our version of wchar_t, since wchar_t is different sizes + on different platforms, but we want to use UTF-16 uniformly. */ + typedef unsigned short wchar; + + #ifndef NULL + #define NULL 0 + #endif + + typedef signed long Atom; + typedef signed long Binding; + typedef signed long CodeContextAtom; + + inline uint32 urshift(Atom atom, int amount) + { + return ((uint32)atom >> amount); + } +} + +#endif /* __avmplus_types__ */ diff --git a/mozilla/js/tamarin/core/avmplusVersion.h b/mozilla/js/tamarin/core/avmplusVersion.h new file mode 100644 index 00000000000..1d80aedb881 --- /dev/null +++ b/mozilla/js/tamarin/core/avmplusVersion.h @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 1993-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +// build version info + +// build number counts 1-n for development builds, and restarts at 1-n for release builds + +// the visible build code d for development, r for release candidate +#define AVMPLUS_BUILD_CODE "d684" + +#define AVMPLUS_VERSION_USER "1.0" + +// Version codes +// Major version, minor version, build number high order value, build number low order value +#define AVMPLUS_VERSION_NUMBER 1,0,0,684 +#define AVMPLUS_VERSION_STRING "1,0,0,684" +#define AVMPLUS_MAJOR_VERSION 1 +#define AVMPLUS_MINOR_VERSION 0 +#define AVMPLUS_BUILD_NUMBER 0 + +// Define Mac only resource change to 'vers' resource so that player installer will +// replace previous player versions +#define AVMPLUS_MAC_RESOURCE_MINOR_VERSION 0x00 + diff --git a/mozilla/js/tamarin/core/avmsetjmp.h b/mozilla/js/tamarin/core/avmsetjmp.h new file mode 100644 index 00000000000..2f8b8eb54aa --- /dev/null +++ b/mozilla/js/tamarin/core/avmsetjmp.h @@ -0,0 +1,58 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmsetjmp__ +#define __avmsetjmp__ + +#ifdef AVMPLUS_MAC_CARBON + /** + * On Mac Carbon, if you compile with Altivec support, + * setjmp is redirected to __vec_setjmp and longjmp is redirected + * to __vec_longjmp. These routines do not gracefully degrade if + * the CPU does not have Altivec... they just crash. + * + * We don't need Altivec support in the places where exceptions + * are thrown and caught, so this code forces the setjmp/longjmp + * implementation to be the old school, non-Altivec versions. + */ + typedef long *jmp_buf[70]; + extern "C" + { + int __setjmp(jmp_buf jmpbuf); + void longjmp(jmp_buf jmpbuf, int value); + } + + #define setjmp __setjmp +#else + #include +#endif + +#endif /* __avmsetjmp__ */ diff --git a/mozilla/js/tamarin/core/builtin.as b/mozilla/js/tamarin/core/builtin.as new file mode 100644 index 00000000000..7e18bc93b41 --- /dev/null +++ b/mozilla/js/tamarin/core/builtin.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +// each class is in its own file, we include them all here +// so they end up in a single script that initializes all +// at once, in the order of includes below. + +include "Object.as" +include "Class.as" +include "Function.as" +include "Namespace.as" +include "Boolean.as" +include "Number.as" +include "String.as" +include "Array.as" +include "actionscript.lang.as" diff --git a/mozilla/js/tamarin/core/builtin.cpp b/mozilla/js/tamarin/core/builtin.cpp new file mode 100644 index 00000000000..f5d0c239027 --- /dev/null +++ b/mozilla/js/tamarin/core/builtin.cpp @@ -0,0 +1,1675 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +const unsigned char builtin_abc_data[26281] = { +0x10, 0x00, 0x2e, 0x00, 0x0b, 0x00, 0x01, 0x02, 0x0a, 0x03, 0xff, 0xff, 0xff, 0xff, 0x07, 0x10, +0x04, 0x08, 0x07, 0x00, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xef, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0xf0, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0xe0, 0xc1, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xef, 0x41, 0x69, 0x57, 0x14, +0x8b, 0x0a, 0xbf, 0x05, 0x40, 0x16, 0x55, 0xb5, 0xbb, 0xb1, 0x6b, 0x02, 0x40, 0xef, 0x39, 0xfa, +0xfe, 0x42, 0x2e, 0xe6, 0x3f, 0x0e, 0xe5, 0x26, 0x15, 0x7b, 0xcb, 0xdb, 0x3f, 0xfe, 0x82, 0x2b, +0x65, 0x47, 0x15, 0xf7, 0x3f, 0x18, 0x2d, 0x44, 0x54, 0xfb, 0x21, 0x09, 0x40, 0xcd, 0x3b, 0x7f, +0x66, 0x9e, 0xa0, 0xe6, 0x3f, 0xcd, 0x3b, 0x7f, 0x66, 0x9e, 0xa0, 0xf6, 0x3f, 0xca, 0x02, 0x00, +0x06, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x09, 0x75, 0x6e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, +0x64, 0x06, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x03, 0x4e, 0x61, 0x4e, 0x03, 0x69, 0x6e, 0x74, +0x07, 0x42, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x06, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x06, +0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x04, 0x76, 0x6f, 0x69, 0x64, 0x18, 0x5f, 0x73, 0x65, 0x74, +0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x49, 0x73, 0x45, 0x6e, 0x75, 0x6d, 0x65, 0x72, +0x61, 0x62, 0x6c, 0x65, 0x0c, 0x62, 0x75, 0x69, 0x6c, 0x74, 0x69, 0x6e, 0x2e, 0x61, 0x73, 0x24, +0x30, 0x0e, 0x68, 0x61, 0x73, 0x4f, 0x77, 0x6e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, +0x21, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x61, 0x64, 0x6f, 0x62, 0x65, 0x2e, 0x63, 0x6f, +0x6d, 0x2f, 0x41, 0x53, 0x33, 0x2f, 0x32, 0x30, 0x30, 0x36, 0x2f, 0x62, 0x75, 0x69, 0x6c, 0x74, +0x69, 0x6e, 0x14, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x49, 0x73, 0x45, 0x6e, 0x75, +0x6d, 0x65, 0x72, 0x61, 0x62, 0x6c, 0x65, 0x0d, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x74, +0x79, 0x70, 0x65, 0x4f, 0x66, 0x09, 0x5f, 0x74, 0x6f, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x09, +0x70, 0x72, 0x6f, 0x74, 0x6f, 0x74, 0x79, 0x70, 0x65, 0x17, 0x73, 0x65, 0x74, 0x50, 0x72, 0x6f, +0x70, 0x65, 0x72, 0x74, 0x79, 0x49, 0x73, 0x45, 0x6e, 0x75, 0x6d, 0x65, 0x72, 0x61, 0x62, 0x6c, +0x65, 0x0e, 0x74, 0x6f, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, +0x08, 0x74, 0x6f, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x07, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x4f, +0x66, 0x12, 0x5f, 0x64, 0x6f, 0x6e, 0x74, 0x45, 0x6e, 0x75, 0x6d, 0x50, 0x72, 0x6f, 0x74, 0x6f, +0x74, 0x79, 0x70, 0x65, 0x0e, 0x5f, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x74, 0x79, 0x70, +0x65, 0x4f, 0x66, 0x0f, 0x5f, 0x68, 0x61, 0x73, 0x4f, 0x77, 0x6e, 0x50, 0x72, 0x6f, 0x70, 0x65, +0x72, 0x74, 0x79, 0x15, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x49, 0x73, 0x45, +0x6e, 0x75, 0x6d, 0x65, 0x72, 0x61, 0x62, 0x6c, 0x65, 0x04, 0x69, 0x6e, 0x69, 0x74, 0x05, 0x43, +0x6c, 0x61, 0x73, 0x73, 0x08, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x04, 0x63, 0x61, +0x6c, 0x6c, 0x05, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x16, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, +0x6e, 0x20, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x20, 0x7b, 0x7d, 0x09, +0x65, 0x6d, 0x70, 0x74, 0x79, 0x43, 0x74, 0x6f, 0x72, 0x09, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, +0x61, 0x63, 0x65, 0x03, 0x75, 0x72, 0x69, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x05, 0x66, +0x61, 0x6c, 0x73, 0x65, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x09, 0x54, 0x79, 0x70, 0x65, 0x45, +0x72, 0x72, 0x6f, 0x72, 0x1a, 0x42, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x2e, 0x70, 0x72, 0x6f, +0x74, 0x6f, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x74, 0x6f, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x0a, +0x74, 0x68, 0x72, 0x6f, 0x77, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x04, 0x74, 0x72, 0x75, 0x65, 0x19, +0x42, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x74, 0x79, 0x70, +0x65, 0x2e, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x4f, 0x66, 0x11, 0x4e, 0x45, 0x47, 0x41, 0x54, 0x49, +0x56, 0x45, 0x5f, 0x49, 0x4e, 0x46, 0x49, 0x4e, 0x49, 0x54, 0x59, 0x11, 0x50, 0x4f, 0x53, 0x49, +0x54, 0x49, 0x56, 0x45, 0x5f, 0x49, 0x4e, 0x46, 0x49, 0x4e, 0x49, 0x54, 0x59, 0x09, 0x4d, 0x49, +0x4e, 0x5f, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x09, 0x4d, 0x41, 0x58, 0x5f, 0x56, 0x41, 0x4c, 0x55, +0x45, 0x0c, 0x44, 0x54, 0x4f, 0x53, 0x54, 0x52, 0x5f, 0x46, 0x49, 0x58, 0x45, 0x44, 0x10, 0x44, +0x54, 0x4f, 0x53, 0x54, 0x52, 0x5f, 0x50, 0x52, 0x45, 0x43, 0x49, 0x53, 0x49, 0x4f, 0x4e, 0x12, +0x44, 0x54, 0x4f, 0x53, 0x54, 0x52, 0x5f, 0x45, 0x58, 0x50, 0x4f, 0x4e, 0x45, 0x4e, 0x54, 0x49, +0x41, 0x4c, 0x0d, 0x74, 0x6f, 0x45, 0x78, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, +0x0b, 0x74, 0x6f, 0x50, 0x72, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x07, 0x74, 0x6f, 0x46, +0x69, 0x78, 0x65, 0x64, 0x01, 0x30, 0x19, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x2e, 0x70, 0x72, +0x6f, 0x74, 0x6f, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x74, 0x6f, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, +0x18, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x74, 0x79, 0x70, +0x65, 0x2e, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x4f, 0x66, 0x08, 0x5f, 0x63, 0x6f, 0x6e, 0x76, 0x65, +0x72, 0x74, 0x16, 0x69, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x74, 0x79, 0x70, 0x65, +0x2e, 0x74, 0x6f, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x15, 0x69, 0x6e, 0x74, 0x2e, 0x70, 0x72, +0x6f, 0x74, 0x6f, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x4f, 0x66, 0x04, +0x75, 0x69, 0x6e, 0x74, 0x17, 0x75, 0x69, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x74, +0x79, 0x70, 0x65, 0x2e, 0x74, 0x6f, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x16, 0x75, 0x69, 0x6e, +0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x76, 0x61, 0x6c, 0x75, +0x65, 0x4f, 0x66, 0x0c, 0x66, 0x72, 0x6f, 0x6d, 0x43, 0x68, 0x61, 0x72, 0x43, 0x6f, 0x64, 0x65, +0x07, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x4f, 0x66, 0x0b, 0x6c, 0x61, 0x73, 0x74, 0x49, 0x6e, 0x64, +0x65, 0x78, 0x4f, 0x66, 0x06, 0x63, 0x68, 0x61, 0x72, 0x41, 0x74, 0x0a, 0x63, 0x68, 0x61, 0x72, +0x43, 0x6f, 0x64, 0x65, 0x41, 0x74, 0x06, 0x63, 0x6f, 0x6e, 0x63, 0x61, 0x74, 0x0d, 0x6c, 0x6f, +0x63, 0x61, 0x6c, 0x65, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x05, 0x6d, 0x61, 0x74, 0x63, +0x68, 0x07, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x06, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, +0x05, 0x73, 0x6c, 0x69, 0x63, 0x65, 0x05, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x09, 0x73, 0x75, 0x62, +0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x06, 0x73, 0x75, 0x62, 0x73, 0x74, 0x72, 0x11, 0x74, 0x6f, +0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x4c, 0x6f, 0x77, 0x65, 0x72, 0x43, 0x61, 0x73, 0x65, 0x0b, +0x74, 0x6f, 0x4c, 0x6f, 0x77, 0x65, 0x72, 0x43, 0x61, 0x73, 0x65, 0x11, 0x74, 0x6f, 0x4c, 0x6f, +0x63, 0x61, 0x6c, 0x65, 0x55, 0x70, 0x70, 0x65, 0x72, 0x43, 0x61, 0x73, 0x65, 0x0b, 0x74, 0x6f, +0x55, 0x70, 0x70, 0x65, 0x72, 0x43, 0x61, 0x73, 0x65, 0x05, 0x41, 0x72, 0x72, 0x61, 0x79, 0x06, +0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x08, 0x5f, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x07, +0x5f, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x06, 0x5f, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x19, 0x53, +0x74, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x74, 0x79, 0x70, 0x65, 0x2e, +0x74, 0x6f, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x2e, +0x70, 0x72, 0x6f, 0x74, 0x6f, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x4f, +0x66, 0x07, 0x5f, 0x63, 0x68, 0x61, 0x72, 0x41, 0x74, 0x08, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, +0x4f, 0x66, 0x07, 0x5f, 0x73, 0x75, 0x62, 0x73, 0x74, 0x72, 0x0c, 0x5f, 0x6c, 0x61, 0x73, 0x74, +0x49, 0x6e, 0x64, 0x65, 0x78, 0x4f, 0x66, 0x0b, 0x5f, 0x63, 0x68, 0x61, 0x72, 0x43, 0x6f, 0x64, +0x65, 0x41, 0x74, 0x0a, 0x5f, 0x73, 0x75, 0x62, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x06, 0x5f, +0x73, 0x6c, 0x69, 0x63, 0x65, 0x0f, 0x43, 0x41, 0x53, 0x45, 0x49, 0x4e, 0x53, 0x45, 0x4e, 0x53, +0x49, 0x54, 0x49, 0x56, 0x45, 0x0a, 0x44, 0x45, 0x53, 0x43, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, +0x0a, 0x55, 0x4e, 0x49, 0x51, 0x55, 0x45, 0x53, 0x4f, 0x52, 0x54, 0x12, 0x52, 0x45, 0x54, 0x55, +0x52, 0x4e, 0x49, 0x4e, 0x44, 0x45, 0x58, 0x45, 0x44, 0x41, 0x52, 0x52, 0x41, 0x59, 0x07, 0x4e, +0x55, 0x4d, 0x45, 0x52, 0x49, 0x43, 0x04, 0x6a, 0x6f, 0x69, 0x6e, 0x03, 0x70, 0x6f, 0x70, 0x04, +0x70, 0x75, 0x73, 0x68, 0x07, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x05, 0x73, 0x68, 0x69, +0x66, 0x74, 0x07, 0x75, 0x6e, 0x73, 0x68, 0x69, 0x66, 0x74, 0x06, 0x73, 0x70, 0x6c, 0x69, 0x63, +0x65, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x06, 0x73, 0x6f, 0x72, 0x74, 0x4f, 0x6e, 0x05, 0x65, 0x76, +0x65, 0x72, 0x79, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x07, 0x66, 0x6f, 0x72, 0x45, 0x61, +0x63, 0x68, 0x03, 0x6d, 0x61, 0x70, 0x04, 0x73, 0x6f, 0x6d, 0x65, 0x01, 0x2c, 0x05, 0x5f, 0x6a, +0x6f, 0x69, 0x6e, 0x04, 0x5f, 0x70, 0x6f, 0x70, 0x08, 0x5f, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, +0x65, 0x07, 0x5f, 0x63, 0x6f, 0x6e, 0x63, 0x61, 0x74, 0x06, 0x5f, 0x73, 0x68, 0x69, 0x66, 0x74, +0x07, 0x5f, 0x73, 0x70, 0x6c, 0x69, 0x63, 0x65, 0x05, 0x5f, 0x73, 0x6f, 0x72, 0x74, 0x07, 0x5f, +0x73, 0x6f, 0x72, 0x74, 0x4f, 0x6e, 0x06, 0x5f, 0x65, 0x76, 0x65, 0x72, 0x79, 0x07, 0x5f, 0x66, +0x69, 0x6c, 0x74, 0x65, 0x72, 0x08, 0x5f, 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68, 0x04, 0x5f, +0x6d, 0x61, 0x70, 0x05, 0x5f, 0x73, 0x6f, 0x6d, 0x65, 0x0a, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x45, +0x72, 0x72, 0x6f, 0x72, 0x1a, 0x62, 0x75, 0x69, 0x6c, 0x74, 0x69, 0x6e, 0x2e, 0x61, 0x73, 0x24, +0x30, 0x3a, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x43, 0x6c, 0x6f, 0x73, 0x75, 0x72, 0x65, 0x0e, +0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x0d, 0x4d, +0x65, 0x74, 0x68, 0x6f, 0x64, 0x43, 0x6c, 0x6f, 0x73, 0x75, 0x72, 0x65, 0x08, 0x49, 0x6e, 0x66, +0x69, 0x6e, 0x69, 0x74, 0x79, 0x05, 0x69, 0x73, 0x4e, 0x61, 0x4e, 0x03, 0x41, 0x53, 0x33, 0x0a, +0x70, 0x61, 0x72, 0x73, 0x65, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x08, 0x69, 0x73, 0x46, 0x69, 0x6e, +0x69, 0x74, 0x65, 0x08, 0x75, 0x6e, 0x65, 0x73, 0x63, 0x61, 0x70, 0x65, 0x06, 0x65, 0x73, 0x63, +0x61, 0x70, 0x65, 0x09, 0x64, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x55, 0x52, 0x49, 0x12, 0x65, 0x6e, +0x63, 0x6f, 0x64, 0x65, 0x55, 0x52, 0x49, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, +0x08, 0x70, 0x61, 0x72, 0x73, 0x65, 0x49, 0x6e, 0x74, 0x09, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, +0x55, 0x52, 0x49, 0x12, 0x64, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x55, 0x52, 0x49, 0x43, 0x6f, 0x6d, +0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x04, 0x4d, 0x61, 0x74, 0x68, 0x01, 0x45, 0x04, 0x4c, 0x4e, +0x31, 0x30, 0x03, 0x4c, 0x4e, 0x32, 0x06, 0x4c, 0x4f, 0x47, 0x31, 0x30, 0x45, 0x05, 0x4c, 0x4f, +0x47, 0x32, 0x45, 0x02, 0x50, 0x49, 0x07, 0x53, 0x51, 0x52, 0x54, 0x31, 0x5f, 0x32, 0x05, 0x53, +0x51, 0x52, 0x54, 0x32, 0x03, 0x61, 0x62, 0x73, 0x06, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x04, +0x61, 0x63, 0x6f, 0x73, 0x03, 0x63, 0x6f, 0x73, 0x04, 0x63, 0x65, 0x69, 0x6c, 0x05, 0x72, 0x6f, +0x75, 0x6e, 0x64, 0x04, 0x5f, 0x6d, 0x69, 0x6e, 0x04, 0x61, 0x73, 0x69, 0x6e, 0x03, 0x73, 0x69, +0x6e, 0x05, 0x61, 0x74, 0x61, 0x6e, 0x32, 0x05, 0x66, 0x6c, 0x6f, 0x6f, 0x72, 0x03, 0x6c, 0x6f, +0x67, 0x03, 0x65, 0x78, 0x70, 0x03, 0x70, 0x6f, 0x77, 0x04, 0x5f, 0x6d, 0x61, 0x78, 0x04, 0x61, +0x74, 0x61, 0x6e, 0x03, 0x74, 0x61, 0x6e, 0x03, 0x6d, 0x69, 0x6e, 0x03, 0x6d, 0x61, 0x78, 0x04, +0x73, 0x71, 0x72, 0x74, 0x09, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x61, 0x73, 0x24, 0x31, 0x0a, 0x45, +0x72, 0x72, 0x6f, 0x72, 0x2e, 0x61, 0x73, 0x24, 0x32, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x07, 0x6d, +0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x01, 0x31, 0x01, 0x32, 0x01, 0x33, 0x01, 0x34, 0x01, 0x35, +0x01, 0x36, 0x04, 0x72, 0x65, 0x73, 0x74, 0x0f, 0x67, 0x65, 0x74, 0x45, 0x72, 0x72, 0x6f, 0x72, +0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x06, 0x52, 0x65, 0x67, 0x45, 0x78, 0x70, 0x06, 0x25, +0x5b, 0x30, 0x2d, 0x39, 0x5d, 0x01, 0x67, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x01, 0x66, 0x01, +0x69, 0x04, 0x74, 0x79, 0x70, 0x65, 0x02, 0x3a, 0x20, 0x08, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, +0x49, 0x44, 0x07, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x49, 0x44, 0x0d, 0x67, 0x65, 0x74, 0x53, 0x74, +0x61, 0x63, 0x6b, 0x54, 0x72, 0x61, 0x63, 0x65, 0x0f, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, +0x69, 0x6f, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x09, 0x45, 0x76, 0x61, 0x6c, 0x45, 0x72, 0x72, +0x6f, 0x72, 0x0d, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x45, 0x72, 0x72, 0x6f, 0x72, +0x0b, 0x53, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x08, 0x55, 0x52, 0x49, +0x45, 0x72, 0x72, 0x6f, 0x72, 0x0b, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x45, 0x72, 0x72, 0x6f, +0x72, 0x12, 0x55, 0x6e, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x45, +0x72, 0x72, 0x6f, 0x72, 0x0d, 0x41, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x45, 0x72, 0x72, +0x6f, 0x72, 0x0b, 0x52, 0x65, 0x67, 0x45, 0x78, 0x70, 0x2e, 0x61, 0x73, 0x24, 0x33, 0x04, 0x65, +0x78, 0x65, 0x63, 0x04, 0x74, 0x65, 0x73, 0x74, 0x01, 0x2f, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, +0x65, 0x06, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x0a, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x43, +0x61, 0x73, 0x65, 0x09, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x6c, 0x69, 0x6e, 0x65, 0x01, 0x6d, 0x06, +0x64, 0x6f, 0x74, 0x61, 0x6c, 0x6c, 0x01, 0x73, 0x08, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, +0x64, 0x01, 0x78, 0x09, 0x6c, 0x61, 0x73, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x04, 0x44, 0x61, +0x74, 0x65, 0x09, 0x44, 0x61, 0x74, 0x65, 0x2e, 0x61, 0x73, 0x24, 0x34, 0x07, 0x73, 0x65, 0x74, +0x54, 0x69, 0x6d, 0x65, 0x0c, 0x74, 0x6f, 0x44, 0x61, 0x74, 0x65, 0x53, 0x74, 0x72, 0x69, 0x6e, +0x67, 0x0c, 0x74, 0x6f, 0x54, 0x69, 0x6d, 0x65, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x74, +0x6f, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x44, 0x61, 0x74, 0x65, 0x53, 0x74, 0x72, 0x69, 0x6e, +0x67, 0x12, 0x74, 0x6f, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x53, 0x74, +0x72, 0x69, 0x6e, 0x67, 0x0b, 0x74, 0x6f, 0x55, 0x54, 0x43, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, +0x0e, 0x67, 0x65, 0x74, 0x55, 0x54, 0x43, 0x46, 0x75, 0x6c, 0x6c, 0x59, 0x65, 0x61, 0x72, 0x0b, +0x67, 0x65, 0x74, 0x55, 0x54, 0x43, 0x4d, 0x6f, 0x6e, 0x74, 0x68, 0x0a, 0x67, 0x65, 0x74, 0x55, +0x54, 0x43, 0x44, 0x61, 0x74, 0x65, 0x09, 0x67, 0x65, 0x74, 0x55, 0x54, 0x43, 0x44, 0x61, 0x79, +0x0b, 0x67, 0x65, 0x74, 0x55, 0x54, 0x43, 0x48, 0x6f, 0x75, 0x72, 0x73, 0x0d, 0x67, 0x65, 0x74, +0x55, 0x54, 0x43, 0x4d, 0x69, 0x6e, 0x75, 0x74, 0x65, 0x73, 0x0d, 0x67, 0x65, 0x74, 0x55, 0x54, +0x43, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x12, 0x67, 0x65, 0x74, 0x55, 0x54, 0x43, 0x4d, +0x69, 0x6c, 0x6c, 0x69, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x0b, 0x67, 0x65, 0x74, 0x46, +0x75, 0x6c, 0x6c, 0x59, 0x65, 0x61, 0x72, 0x08, 0x67, 0x65, 0x74, 0x4d, 0x6f, 0x6e, 0x74, 0x68, +0x07, 0x67, 0x65, 0x74, 0x44, 0x61, 0x74, 0x65, 0x06, 0x67, 0x65, 0x74, 0x44, 0x61, 0x79, 0x08, +0x67, 0x65, 0x74, 0x48, 0x6f, 0x75, 0x72, 0x73, 0x0a, 0x67, 0x65, 0x74, 0x4d, 0x69, 0x6e, 0x75, +0x74, 0x65, 0x73, 0x0a, 0x67, 0x65, 0x74, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x0f, 0x67, +0x65, 0x74, 0x4d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x11, 0x67, +0x65, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x7a, 0x6f, 0x6e, 0x65, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, +0x07, 0x67, 0x65, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x0b, 0x73, 0x65, 0x74, 0x46, 0x75, 0x6c, 0x6c, +0x59, 0x65, 0x61, 0x72, 0x08, 0x73, 0x65, 0x74, 0x4d, 0x6f, 0x6e, 0x74, 0x68, 0x07, 0x73, 0x65, +0x74, 0x44, 0x61, 0x74, 0x65, 0x08, 0x73, 0x65, 0x74, 0x48, 0x6f, 0x75, 0x72, 0x73, 0x0a, 0x73, +0x65, 0x74, 0x4d, 0x69, 0x6e, 0x75, 0x74, 0x65, 0x73, 0x0a, 0x73, 0x65, 0x74, 0x53, 0x65, 0x63, +0x6f, 0x6e, 0x64, 0x73, 0x0f, 0x73, 0x65, 0x74, 0x4d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x65, 0x63, +0x6f, 0x6e, 0x64, 0x73, 0x0e, 0x73, 0x65, 0x74, 0x55, 0x54, 0x43, 0x46, 0x75, 0x6c, 0x6c, 0x59, +0x65, 0x61, 0x72, 0x0b, 0x73, 0x65, 0x74, 0x55, 0x54, 0x43, 0x4d, 0x6f, 0x6e, 0x74, 0x68, 0x0a, +0x73, 0x65, 0x74, 0x55, 0x54, 0x43, 0x44, 0x61, 0x74, 0x65, 0x0b, 0x73, 0x65, 0x74, 0x55, 0x54, +0x43, 0x48, 0x6f, 0x75, 0x72, 0x73, 0x0d, 0x73, 0x65, 0x74, 0x55, 0x54, 0x43, 0x4d, 0x69, 0x6e, +0x75, 0x74, 0x65, 0x73, 0x0d, 0x73, 0x65, 0x74, 0x55, 0x54, 0x43, 0x53, 0x65, 0x63, 0x6f, 0x6e, +0x64, 0x73, 0x12, 0x73, 0x65, 0x74, 0x55, 0x54, 0x43, 0x4d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x65, +0x63, 0x6f, 0x6e, 0x64, 0x73, 0x08, 0x5f, 0x73, 0x65, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x03, 0x55, +0x54, 0x43, 0x05, 0x70, 0x61, 0x72, 0x73, 0x65, 0x05, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x08, 0x6d, +0x6f, 0x6e, 0x74, 0x68, 0x55, 0x54, 0x43, 0x0a, 0x6d, 0x69, 0x6e, 0x75, 0x74, 0x65, 0x73, 0x55, +0x54, 0x43, 0x0c, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x08, +0x68, 0x6f, 0x75, 0x72, 0x73, 0x55, 0x54, 0x43, 0x05, 0x68, 0x6f, 0x75, 0x72, 0x73, 0x04, 0x5f, +0x67, 0x65, 0x74, 0x03, 0x64, 0x61, 0x79, 0x0b, 0x66, 0x75, 0x6c, 0x6c, 0x59, 0x65, 0x61, 0x72, +0x55, 0x54, 0x43, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x07, 0x64, 0x61, 0x74, 0x65, 0x55, 0x54, 0x43, +0x04, 0x64, 0x61, 0x74, 0x65, 0x0a, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x55, 0x54, 0x43, +0x07, 0x6d, 0x69, 0x6e, 0x75, 0x74, 0x65, 0x73, 0x08, 0x66, 0x75, 0x6c, 0x6c, 0x59, 0x65, 0x61, +0x72, 0x0f, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x55, 0x54, +0x43, 0x06, 0x64, 0x61, 0x79, 0x55, 0x54, 0x43, 0x0e, 0x74, 0x69, 0x6d, 0x65, 0x7a, 0x6f, 0x6e, +0x65, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x07, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x03, +0x58, 0x4d, 0x4c, 0x08, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x08, 0x58, 0x4d, 0x4c, +0x2e, 0x61, 0x73, 0x24, 0x35, 0x0b, 0x73, 0x65, 0x74, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, +0x73, 0x0f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, +0x73, 0x0c, 0x61, 0x64, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x0b, 0x61, +0x70, 0x70, 0x65, 0x6e, 0x64, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x09, 0x61, 0x74, 0x74, 0x72, 0x69, +0x62, 0x75, 0x74, 0x65, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x05, +0x63, 0x68, 0x69, 0x6c, 0x64, 0x0a, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x49, 0x6e, 0x64, 0x65, 0x78, +0x08, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, +0x74, 0x73, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x73, 0x04, 0x63, 0x6f, 0x70, 0x79, +0x0b, 0x64, 0x65, 0x73, 0x63, 0x65, 0x6e, 0x64, 0x61, 0x6e, 0x74, 0x73, 0x08, 0x65, 0x6c, 0x65, +0x6d, 0x65, 0x6e, 0x74, 0x73, 0x11, 0x68, 0x61, 0x73, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x78, +0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x10, 0x68, 0x61, 0x73, 0x53, 0x69, 0x6d, 0x70, 0x6c, +0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x11, 0x69, 0x6e, 0x53, 0x63, 0x6f, 0x70, 0x65, +0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x10, 0x69, 0x6e, 0x73, 0x65, 0x72, +0x74, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x41, 0x66, 0x74, 0x65, 0x72, 0x11, 0x69, 0x6e, 0x73, 0x65, +0x72, 0x74, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x42, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x09, 0x6c, 0x6f, +0x63, 0x61, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, +0x65, 0x15, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x44, 0x65, 0x63, 0x6c, 0x61, +0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x4b, 0x69, 0x6e, 0x64, +0x09, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, +0x74, 0x16, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x73, 0x74, +0x72, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x0c, 0x70, 0x72, 0x65, 0x70, 0x65, 0x6e, 0x64, +0x43, 0x68, 0x69, 0x6c, 0x64, 0x0f, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4e, 0x61, 0x6d, 0x65, +0x73, 0x70, 0x61, 0x63, 0x65, 0x0b, 0x73, 0x65, 0x74, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, +0x6e, 0x0c, 0x73, 0x65, 0x74, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x07, 0x73, +0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x0c, 0x73, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, +0x61, 0x63, 0x65, 0x04, 0x74, 0x65, 0x78, 0x74, 0x0b, 0x74, 0x6f, 0x58, 0x4d, 0x4c, 0x53, 0x74, +0x72, 0x69, 0x6e, 0x67, 0x0e, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x65, +0x6e, 0x74, 0x73, 0x1c, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, +0x73, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, +0x10, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x57, 0x68, 0x69, 0x74, 0x65, 0x73, 0x70, 0x61, 0x63, +0x65, 0x0e, 0x70, 0x72, 0x65, 0x74, 0x74, 0x79, 0x50, 0x72, 0x69, 0x6e, 0x74, 0x69, 0x6e, 0x67, +0x0c, 0x70, 0x72, 0x65, 0x74, 0x74, 0x79, 0x49, 0x6e, 0x64, 0x65, 0x6e, 0x74, 0x07, 0x58, 0x4d, +0x4c, 0x4c, 0x69, 0x73, 0x74, 0x01, 0x2a, 0x0f, 0x73, 0x65, 0x74, 0x4e, 0x6f, 0x74, 0x69, 0x66, +0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x0c, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, +0x74, 0x69, 0x6f, 0x6e, 0x05, 0x51, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x51, 0x4e, 0x61, 0x6d, 0x65, +0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x74, 0x6f, 0x53, 0x74, 0x72, +0x69, 0x6e, 0x67, 0x02, 0x3a, 0x3a, 0x09, 0x69, 0x73, 0x58, 0x4d, 0x4c, 0x4e, 0x61, 0x6d, 0x65, +0x5f, 0x16, 0x01, 0x05, 0x08, 0x05, 0x0c, 0x17, 0x01, 0x18, 0x08, 0x1a, 0x08, 0x08, 0x0e, 0x05, +0x1c, 0x18, 0x1c, 0x05, 0x1d, 0x18, 0x1d, 0x1a, 0x1d, 0x05, 0x22, 0x18, 0x22, 0x1a, 0x22, 0x05, +0x07, 0x18, 0x07, 0x1a, 0x07, 0x05, 0x04, 0x18, 0x04, 0x1a, 0x04, 0x05, 0x06, 0x18, 0x06, 0x1a, +0x06, 0x05, 0x3c, 0x18, 0x3c, 0x1a, 0x3c, 0x05, 0x02, 0x18, 0x02, 0x1a, 0x02, 0x05, 0x51, 0x18, +0x51, 0x1a, 0x51, 0x05, 0x81, 0x01, 0x18, 0x81, 0x01, 0x1a, 0x81, 0x01, 0x05, 0x90, 0x01, 0x18, +0x90, 0x01, 0x05, 0xad, 0x01, 0x05, 0x26, 0x05, 0xae, 0x01, 0x18, 0x26, 0x1a, 0x26, 0x05, 0xc4, +0x01, 0x18, 0xc4, 0x01, 0x1a, 0xc4, 0x01, 0x05, 0xc5, 0x01, 0x18, 0xc5, 0x01, 0x1a, 0xc5, 0x01, +0x05, 0x80, 0x01, 0x18, 0x80, 0x01, 0x1a, 0x80, 0x01, 0x05, 0x82, 0x01, 0x18, 0x82, 0x01, 0x1a, +0x82, 0x01, 0x05, 0xc6, 0x01, 0x18, 0xc6, 0x01, 0x1a, 0xc6, 0x01, 0x05, 0xc7, 0x01, 0x18, 0xc7, +0x01, 0x1a, 0xc7, 0x01, 0x05, 0x27, 0x18, 0x27, 0x1a, 0x27, 0x05, 0xc8, 0x01, 0x18, 0xc8, 0x01, +0x1a, 0xc8, 0x01, 0x05, 0xc9, 0x01, 0x18, 0xc9, 0x01, 0x1a, 0xc9, 0x01, 0x05, 0xca, 0x01, 0x18, +0xca, 0x01, 0x1a, 0xca, 0x01, 0x05, 0xcb, 0x01, 0x18, 0xcb, 0x01, 0x1a, 0xcb, 0x01, 0x05, 0xb9, +0x01, 0x05, 0xcc, 0x01, 0x18, 0xb9, 0x01, 0x1a, 0xb9, 0x01, 0x05, 0xda, 0x01, 0x05, 0xdb, 0x01, +0x18, 0xda, 0x01, 0x1a, 0xda, 0x01, 0x05, 0x98, 0x02, 0x05, 0x9a, 0x02, 0x18, 0x98, 0x02, 0x1a, +0x98, 0x02, 0x05, 0xc2, 0x02, 0x18, 0xc2, 0x02, 0x1a, 0xc2, 0x02, 0x05, 0xc6, 0x02, 0x18, 0xc6, +0x02, 0x1a, 0xc6, 0x02, 0x28, 0x06, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x01, 0x03, 0x04, +0x06, 0x0a, 0x0b, 0x0c, 0x07, 0x01, 0x03, 0x04, 0x06, 0x0d, 0x0e, 0x0f, 0x07, 0x01, 0x03, 0x04, +0x06, 0x10, 0x11, 0x12, 0x07, 0x01, 0x03, 0x04, 0x06, 0x13, 0x14, 0x15, 0x07, 0x01, 0x03, 0x04, +0x06, 0x16, 0x17, 0x18, 0x07, 0x01, 0x03, 0x04, 0x06, 0x19, 0x1a, 0x1b, 0x07, 0x01, 0x03, 0x04, +0x06, 0x1c, 0x1d, 0x1e, 0x06, 0x01, 0x04, 0x06, 0x1c, 0x1d, 0x1e, 0x07, 0x01, 0x03, 0x04, 0x06, +0x1f, 0x20, 0x21, 0x06, 0x01, 0x04, 0x06, 0x1f, 0x20, 0x21, 0x07, 0x01, 0x03, 0x06, 0x0c, 0x22, +0x23, 0x24, 0x01, 0x01, 0x03, 0x01, 0x03, 0x04, 0x01, 0x03, 0x02, 0x01, 0x03, 0x03, 0x01, 0x04, +0x27, 0x07, 0x01, 0x04, 0x06, 0x28, 0x29, 0x2a, 0x2b, 0x06, 0x01, 0x04, 0x06, 0x28, 0x2a, 0x2b, +0x08, 0x01, 0x04, 0x06, 0x29, 0x2b, 0x2c, 0x2d, 0x2e, 0x08, 0x01, 0x04, 0x06, 0x29, 0x2b, 0x2f, +0x30, 0x31, 0x08, 0x01, 0x04, 0x06, 0x29, 0x2b, 0x32, 0x33, 0x34, 0x08, 0x01, 0x04, 0x06, 0x29, +0x2b, 0x35, 0x36, 0x37, 0x08, 0x01, 0x04, 0x06, 0x29, 0x2b, 0x38, 0x39, 0x3a, 0x08, 0x01, 0x04, +0x06, 0x29, 0x2b, 0x3b, 0x3c, 0x3d, 0x08, 0x01, 0x04, 0x06, 0x29, 0x2b, 0x3e, 0x3f, 0x40, 0x08, +0x01, 0x04, 0x06, 0x29, 0x2b, 0x41, 0x42, 0x43, 0x08, 0x01, 0x04, 0x06, 0x29, 0x2b, 0x44, 0x45, +0x46, 0x08, 0x01, 0x04, 0x06, 0x29, 0x2b, 0x47, 0x48, 0x49, 0x08, 0x01, 0x04, 0x06, 0x29, 0x2b, +0x4a, 0x4b, 0x4c, 0x03, 0x01, 0x04, 0x29, 0x07, 0x01, 0x04, 0x06, 0x4d, 0x4e, 0x4f, 0x50, 0x03, +0x01, 0x04, 0x4e, 0x07, 0x01, 0x04, 0x06, 0x51, 0x52, 0x53, 0x54, 0x03, 0x01, 0x04, 0x52, 0x07, +0x01, 0x04, 0x06, 0x55, 0x56, 0x57, 0x58, 0x07, 0x01, 0x04, 0x06, 0x56, 0x59, 0x5a, 0x5b, 0x07, +0x01, 0x04, 0x06, 0x56, 0x5c, 0x5d, 0x5e, 0x03, 0x01, 0x04, 0x56, 0xa6, 0x05, 0x07, 0x01, 0x02, +0x07, 0x01, 0x04, 0x07, 0x01, 0x06, 0x07, 0x01, 0x07, 0x07, 0x01, 0x09, 0x07, 0x01, 0x0a, 0x09, +0x0b, 0x01, 0x07, 0x01, 0x08, 0x07, 0x07, 0x0d, 0x07, 0x07, 0x0f, 0x07, 0x07, 0x10, 0x09, 0x11, +0x01, 0x09, 0x12, 0x01, 0x09, 0x0d, 0x01, 0x09, 0x0f, 0x01, 0x09, 0x13, 0x01, 0x09, 0x10, 0x01, +0x09, 0x14, 0x01, 0x09, 0x15, 0x01, 0x09, 0x16, 0x01, 0x09, 0x17, 0x01, 0x09, 0x18, 0x01, 0x09, +0x19, 0x01, 0x09, 0x1a, 0x01, 0x07, 0x02, 0x19, 0x07, 0x06, 0x17, 0x07, 0x02, 0x1a, 0x07, 0x02, +0x18, 0x07, 0x06, 0x0b, 0x07, 0x02, 0x11, 0x07, 0x04, 0x1b, 0x07, 0x01, 0x12, 0x07, 0x01, 0x1c, +0x09, 0x12, 0x02, 0x09, 0x15, 0x02, 0x09, 0x14, 0x02, 0x09, 0x1e, 0x02, 0x09, 0x1f, 0x02, 0x09, +0x17, 0x02, 0x07, 0x01, 0x1d, 0x07, 0x07, 0x1f, 0x07, 0x0a, 0x21, 0x07, 0x07, 0x1e, 0x09, 0x12, +0x03, 0x09, 0x16, 0x03, 0x09, 0x15, 0x03, 0x09, 0x17, 0x03, 0x07, 0x01, 0x22, 0x09, 0x23, 0x03, +0x07, 0x01, 0x24, 0x07, 0x07, 0x15, 0x07, 0x07, 0x16, 0x07, 0x01, 0x23, 0x09, 0x12, 0x04, 0x09, +0x15, 0x04, 0x09, 0x16, 0x04, 0x09, 0x17, 0x04, 0x09, 0x07, 0x04, 0x09, 0x26, 0x04, 0x09, 0x27, +0x04, 0x09, 0x29, 0x04, 0x07, 0x01, 0x05, 0x07, 0x01, 0x2c, 0x07, 0x01, 0x2d, 0x07, 0x01, 0x2e, +0x07, 0x01, 0x2f, 0x07, 0x13, 0x30, 0x07, 0x13, 0x31, 0x07, 0x13, 0x32, 0x09, 0x12, 0x05, 0x09, +0x15, 0x05, 0x09, 0x14, 0x05, 0x09, 0x16, 0x05, 0x09, 0x33, 0x05, 0x09, 0x34, 0x05, 0x09, 0x35, +0x05, 0x09, 0x17, 0x05, 0x09, 0x04, 0x05, 0x09, 0x26, 0x05, 0x09, 0x27, 0x05, 0x09, 0x29, 0x05, +0x09, 0x11, 0x05, 0x09, 0x39, 0x05, 0x09, 0x06, 0x05, 0x09, 0x32, 0x05, 0x09, 0x03, 0x05, 0x09, +0x31, 0x05, 0x09, 0x30, 0x05, 0x07, 0x13, 0x39, 0x07, 0x13, 0x11, 0x07, 0x07, 0x34, 0x07, 0x07, +0x35, 0x07, 0x07, 0x33, 0x09, 0x12, 0x06, 0x09, 0x15, 0x06, 0x09, 0x14, 0x06, 0x09, 0x16, 0x06, +0x09, 0x33, 0x06, 0x09, 0x34, 0x06, 0x09, 0x35, 0x06, 0x09, 0x17, 0x06, 0x09, 0x06, 0x06, 0x09, +0x26, 0x06, 0x09, 0x27, 0x06, 0x09, 0x29, 0x06, 0x09, 0x04, 0x06, 0x09, 0x12, 0x07, 0x09, 0x15, +0x07, 0x09, 0x14, 0x07, 0x09, 0x16, 0x07, 0x09, 0x33, 0x07, 0x09, 0x34, 0x07, 0x09, 0x35, 0x07, +0x09, 0x17, 0x07, 0x09, 0x04, 0x07, 0x09, 0x26, 0x07, 0x09, 0x27, 0x07, 0x09, 0x29, 0x07, 0x09, +0x3c, 0x07, 0x07, 0x01, 0x3c, 0x09, 0x3f, 0x08, 0x09, 0x12, 0x08, 0x09, 0x40, 0x08, 0x09, 0x41, +0x08, 0x09, 0x42, 0x08, 0x09, 0x43, 0x08, 0x09, 0x44, 0x08, 0x09, 0x45, 0x08, 0x09, 0x46, 0x08, +0x09, 0x47, 0x08, 0x09, 0x48, 0x08, 0x09, 0x49, 0x08, 0x09, 0x4a, 0x08, 0x09, 0x4b, 0x08, 0x09, +0x4c, 0x08, 0x09, 0x4d, 0x08, 0x09, 0x4e, 0x08, 0x09, 0x4f, 0x08, 0x09, 0x50, 0x08, 0x09, 0x15, +0x08, 0x09, 0x16, 0x08, 0x09, 0x17, 0x08, 0x07, 0x01, 0x51, 0x07, 0x07, 0x3f, 0x09, 0x02, 0x08, +0x09, 0x1f, 0x08, 0x07, 0x07, 0x40, 0x07, 0x07, 0x41, 0x07, 0x07, 0x42, 0x07, 0x07, 0x43, 0x09, +0x09, 0x08, 0x1b, 0x09, 0x07, 0x07, 0x45, 0x09, 0x52, 0x08, 0x09, 0x53, 0x08, 0x09, 0x54, 0x08, +0x07, 0x07, 0x49, 0x09, 0x03, 0x08, 0x09, 0x55, 0x08, 0x07, 0x07, 0x4b, 0x07, 0x07, 0x4c, 0x07, +0x07, 0x4e, 0x07, 0x07, 0x50, 0x09, 0x26, 0x08, 0x09, 0x27, 0x08, 0x09, 0x29, 0x08, 0x07, 0x1c, +0x53, 0x07, 0x1c, 0x52, 0x07, 0x1c, 0x54, 0x07, 0x1c, 0x55, 0x07, 0x07, 0x46, 0x07, 0x1c, 0x58, +0x07, 0x1c, 0x59, 0x07, 0x1c, 0x5a, 0x07, 0x1c, 0x5b, 0x07, 0x1c, 0x5c, 0x07, 0x1c, 0x5d, 0x07, +0x1c, 0x5e, 0x07, 0x07, 0x44, 0x07, 0x07, 0x4d, 0x07, 0x07, 0x4a, 0x07, 0x07, 0x48, 0x07, 0x07, +0x47, 0x07, 0x07, 0x4f, 0x07, 0x01, 0x5f, 0x07, 0x01, 0x60, 0x07, 0x01, 0x61, 0x07, 0x01, 0x62, +0x07, 0x01, 0x63, 0x09, 0x12, 0x0a, 0x09, 0x64, 0x0a, 0x09, 0x65, 0x0a, 0x09, 0x15, 0x0a, 0x09, +0x14, 0x0a, 0x09, 0x66, 0x0a, 0x09, 0x67, 0x0a, 0x09, 0x44, 0x0a, 0x09, 0x68, 0x0a, 0x09, 0x49, +0x0a, 0x09, 0x69, 0x0a, 0x09, 0x6a, 0x0a, 0x09, 0x6b, 0x0a, 0x09, 0x6c, 0x0a, 0x09, 0x40, 0x0a, +0x09, 0x41, 0x0a, 0x09, 0x6d, 0x0a, 0x09, 0x6e, 0x0a, 0x09, 0x6f, 0x0a, 0x09, 0x70, 0x0a, 0x09, +0x71, 0x0a, 0x09, 0x17, 0x0a, 0x09, 0x03, 0x0a, 0x09, 0x02, 0x0a, 0x09, 0x3c, 0x0a, 0x09, 0x09, +0x0a, 0x1b, 0x0b, 0x09, 0x73, 0x0a, 0x09, 0x74, 0x0a, 0x09, 0x75, 0x0a, 0x09, 0x76, 0x0a, 0x09, +0x77, 0x0a, 0x09, 0x5e, 0x0a, 0x09, 0x04, 0x0a, 0x09, 0x78, 0x0a, 0x09, 0x79, 0x0a, 0x09, 0x7a, +0x0a, 0x09, 0x59, 0x0a, 0x09, 0x06, 0x0a, 0x09, 0x5b, 0x0a, 0x09, 0x7b, 0x0a, 0x09, 0x7c, 0x0a, +0x09, 0x7d, 0x0a, 0x09, 0x7e, 0x0a, 0x09, 0x7f, 0x0a, 0x09, 0x26, 0x0a, 0x09, 0x80, 0x01, 0x0a, +0x09, 0x29, 0x0a, 0x07, 0x1f, 0x77, 0x07, 0x1f, 0x73, 0x07, 0x1f, 0x59, 0x07, 0x1f, 0x74, 0x07, +0x1f, 0x5e, 0x07, 0x1f, 0x5b, 0x07, 0x1f, 0x7c, 0x07, 0x1f, 0x78, 0x07, 0x1f, 0x7b, 0x07, 0x1f, +0x7e, 0x07, 0x1f, 0x75, 0x07, 0x1f, 0x7d, 0x07, 0x1f, 0x76, 0x07, 0x1f, 0x7f, 0x07, 0x1f, 0x7a, +0x07, 0x1f, 0x79, 0x07, 0x07, 0x67, 0x07, 0x07, 0x70, 0x07, 0x07, 0x68, 0x07, 0x07, 0x64, 0x07, +0x07, 0x69, 0x07, 0x07, 0x65, 0x07, 0x07, 0x71, 0x07, 0x07, 0x6f, 0x07, 0x07, 0x66, 0x07, 0x07, +0x6d, 0x07, 0x07, 0x6a, 0x07, 0x07, 0x6c, 0x07, 0x07, 0x6b, 0x07, 0x07, 0x6e, 0x09, 0x26, 0x0c, +0x09, 0x82, 0x01, 0x0c, 0x09, 0x29, 0x0c, 0x07, 0x03, 0x83, 0x01, 0x09, 0x08, 0x0d, 0x09, 0x1c, +0x0d, 0x09, 0x08, 0x0e, 0x09, 0x1d, 0x0d, 0x09, 0x83, 0x01, 0x0f, 0x09, 0x1d, 0x10, 0x09, 0x22, +0x0d, 0x09, 0x07, 0x0d, 0x09, 0x04, 0x0d, 0x09, 0x06, 0x0d, 0x09, 0x3c, 0x0d, 0x09, 0x02, 0x0d, +0x09, 0x51, 0x0d, 0x09, 0x1b, 0x0e, 0x09, 0x05, 0x0d, 0x09, 0x84, 0x01, 0x0d, 0x07, 0x01, 0x84, +0x01, 0x09, 0x03, 0x0d, 0x07, 0x01, 0x03, 0x07, 0x01, 0x85, 0x01, 0x07, 0x01, 0x86, 0x01, 0x07, +0x01, 0x87, 0x01, 0x07, 0x01, 0x88, 0x01, 0x07, 0x01, 0x89, 0x01, 0x07, 0x01, 0x8a, 0x01, 0x07, +0x01, 0x8b, 0x01, 0x07, 0x01, 0x8c, 0x01, 0x07, 0x01, 0x8d, 0x01, 0x07, 0x01, 0x8e, 0x01, 0x07, +0x01, 0x8f, 0x01, 0x07, 0x01, 0x91, 0x01, 0x07, 0x01, 0x92, 0x01, 0x07, 0x01, 0x93, 0x01, 0x07, +0x01, 0x94, 0x01, 0x07, 0x01, 0x95, 0x01, 0x07, 0x01, 0x96, 0x01, 0x07, 0x01, 0x97, 0x01, 0x07, +0x01, 0x98, 0x01, 0x07, 0x01, 0x99, 0x01, 0x07, 0x01, 0x9a, 0x01, 0x07, 0x01, 0x9b, 0x01, 0x07, +0x01, 0x9c, 0x01, 0x07, 0x01, 0x9d, 0x01, 0x07, 0x01, 0x9e, 0x01, 0x07, 0x25, 0x9f, 0x01, 0x07, +0x01, 0xa0, 0x01, 0x07, 0x01, 0xa1, 0x01, 0x07, 0x01, 0xa2, 0x01, 0x07, 0x01, 0xa3, 0x01, 0x07, +0x01, 0xa4, 0x01, 0x07, 0x01, 0xa5, 0x01, 0x07, 0x01, 0xa6, 0x01, 0x07, 0x25, 0xa7, 0x01, 0x07, +0x01, 0xa8, 0x01, 0x07, 0x01, 0xa9, 0x01, 0x07, 0x01, 0xaa, 0x01, 0x07, 0x01, 0xab, 0x01, 0x07, +0x01, 0xac, 0x01, 0x07, 0x01, 0x90, 0x01, 0x09, 0x08, 0x11, 0x09, 0x12, 0x12, 0x09, 0xaf, 0x01, +0x12, 0x09, 0xb0, 0x01, 0x12, 0x09, 0x15, 0x12, 0x09, 0x0b, 0x12, 0x09, 0x42, 0x12, 0x09, 0xb7, +0x01, 0x12, 0x09, 0x09, 0x12, 0x1b, 0x13, 0x09, 0xb8, 0x01, 0x12, 0x07, 0x01, 0xb9, 0x01, 0x09, +0x47, 0x12, 0x07, 0x04, 0xbc, 0x01, 0x07, 0x01, 0xb7, 0x01, 0x07, 0x04, 0xbd, 0x01, 0x07, 0x04, +0xbe, 0x01, 0x07, 0x04, 0xbf, 0x01, 0x07, 0x01, 0x26, 0x09, 0xc1, 0x01, 0x12, 0x07, 0x01, 0x29, +0x07, 0x01, 0xb8, 0x01, 0x07, 0x01, 0xc2, 0x01, 0x07, 0x28, 0xc1, 0x01, 0x07, 0x01, 0xaf, 0x01, +0x07, 0x01, 0xb0, 0x01, 0x07, 0x01, 0xc3, 0x01, 0x09, 0x12, 0x14, 0x09, 0xaf, 0x01, 0x14, 0x07, +0x01, 0xc4, 0x01, 0x09, 0x12, 0x15, 0x09, 0xaf, 0x01, 0x15, 0x07, 0x01, 0xc5, 0x01, 0x09, 0x12, +0x16, 0x09, 0xaf, 0x01, 0x16, 0x07, 0x01, 0x80, 0x01, 0x09, 0x12, 0x17, 0x09, 0xaf, 0x01, 0x17, +0x07, 0x01, 0x82, 0x01, 0x09, 0x12, 0x18, 0x09, 0xaf, 0x01, 0x18, 0x07, 0x01, 0xc6, 0x01, 0x09, +0x12, 0x19, 0x09, 0xaf, 0x01, 0x19, 0x07, 0x01, 0xc7, 0x01, 0x09, 0x12, 0x1a, 0x09, 0xaf, 0x01, +0x1a, 0x07, 0x01, 0x27, 0x09, 0x12, 0x1b, 0x09, 0xaf, 0x01, 0x1b, 0x07, 0x01, 0xc8, 0x01, 0x09, +0x12, 0x1c, 0x09, 0xaf, 0x01, 0x1c, 0x07, 0x01, 0xc9, 0x01, 0x09, 0x12, 0x1d, 0x09, 0xaf, 0x01, +0x1d, 0x07, 0x01, 0xca, 0x01, 0x09, 0x12, 0x1e, 0x09, 0xaf, 0x01, 0x1e, 0x07, 0x01, 0xcb, 0x01, +0x09, 0x08, 0x1f, 0x09, 0x12, 0x20, 0x09, 0x15, 0x20, 0x09, 0xcd, 0x01, 0x20, 0x09, 0xce, 0x01, +0x20, 0x09, 0x17, 0x20, 0x09, 0xd0, 0x01, 0x20, 0x09, 0xd1, 0x01, 0x20, 0x09, 0xd2, 0x01, 0x20, +0x09, 0xd3, 0x01, 0x20, 0x09, 0xd5, 0x01, 0x20, 0x09, 0xd7, 0x01, 0x20, 0x09, 0x02, 0x20, 0x07, +0x07, 0xcd, 0x01, 0x07, 0x07, 0xce, 0x01, 0x07, 0x01, 0xd2, 0x01, 0x07, 0x01, 0xd1, 0x01, 0x07, +0x01, 0xd3, 0x01, 0x07, 0x01, 0xd5, 0x01, 0x07, 0x01, 0xd7, 0x01, 0x07, 0x01, 0xd0, 0x01, 0x07, +0x01, 0xd9, 0x01, 0x09, 0x08, 0x21, 0x09, 0x12, 0x22, 0x09, 0xdc, 0x01, 0x22, 0x09, 0x16, 0x22, +0x09, 0x15, 0x22, 0x09, 0xdd, 0x01, 0x22, 0x09, 0xde, 0x01, 0x22, 0x09, 0x14, 0x22, 0x09, 0xdf, +0x01, 0x22, 0x09, 0xe0, 0x01, 0x22, 0x09, 0xe1, 0x01, 0x22, 0x09, 0xe2, 0x01, 0x22, 0x09, 0xe3, +0x01, 0x22, 0x09, 0xe4, 0x01, 0x22, 0x09, 0xe5, 0x01, 0x22, 0x09, 0xe6, 0x01, 0x22, 0x09, 0xe7, +0x01, 0x22, 0x09, 0xe8, 0x01, 0x22, 0x09, 0xe9, 0x01, 0x22, 0x09, 0xea, 0x01, 0x22, 0x09, 0xeb, +0x01, 0x22, 0x09, 0xec, 0x01, 0x22, 0x09, 0xed, 0x01, 0x22, 0x09, 0xee, 0x01, 0x22, 0x09, 0xef, +0x01, 0x22, 0x09, 0xf0, 0x01, 0x22, 0x09, 0xf1, 0x01, 0x22, 0x09, 0xf2, 0x01, 0x22, 0x09, 0xf3, +0x01, 0x22, 0x09, 0xf4, 0x01, 0x22, 0x09, 0xf5, 0x01, 0x22, 0x09, 0xf6, 0x01, 0x22, 0x09, 0xf7, +0x01, 0x22, 0x09, 0xf8, 0x01, 0x22, 0x09, 0xf9, 0x01, 0x22, 0x09, 0xfa, 0x01, 0x22, 0x09, 0xfb, +0x01, 0x22, 0x09, 0xfc, 0x01, 0x22, 0x09, 0xfd, 0x01, 0x22, 0x09, 0xfe, 0x01, 0x22, 0x09, 0xff, +0x01, 0x22, 0x09, 0x80, 0x02, 0x22, 0x09, 0x81, 0x02, 0x22, 0x09, 0x17, 0x22, 0x07, 0x01, 0xda, +0x01, 0x09, 0x82, 0x02, 0x22, 0x09, 0x11, 0x22, 0x07, 0x07, 0xdd, 0x01, 0x07, 0x07, 0xde, 0x01, +0x07, 0x07, 0x14, 0x07, 0x07, 0xdf, 0x01, 0x07, 0x07, 0xe0, 0x01, 0x07, 0x07, 0xe1, 0x01, 0x07, +0x07, 0xe2, 0x01, 0x07, 0x07, 0xe3, 0x01, 0x07, 0x07, 0xe4, 0x01, 0x07, 0x07, 0xe5, 0x01, 0x07, +0x07, 0xe6, 0x01, 0x07, 0x07, 0xe7, 0x01, 0x07, 0x07, 0xe8, 0x01, 0x07, 0x07, 0xe9, 0x01, 0x07, +0x07, 0xea, 0x01, 0x07, 0x07, 0xeb, 0x01, 0x07, 0x07, 0xec, 0x01, 0x07, 0x07, 0xed, 0x01, 0x07, +0x07, 0xee, 0x01, 0x07, 0x07, 0xef, 0x01, 0x07, 0x07, 0xf0, 0x01, 0x07, 0x07, 0xf1, 0x01, 0x07, +0x07, 0xf2, 0x01, 0x07, 0x07, 0xf3, 0x01, 0x07, 0x07, 0xf4, 0x01, 0x09, 0x1f, 0x22, 0x07, 0x07, +0xf5, 0x01, 0x07, 0x07, 0xf6, 0x01, 0x07, 0x07, 0xf7, 0x01, 0x07, 0x07, 0xf8, 0x01, 0x07, 0x07, +0xf9, 0x01, 0x07, 0x07, 0xfa, 0x01, 0x07, 0x07, 0xfb, 0x01, 0x07, 0x07, 0xfc, 0x01, 0x07, 0x07, +0xfd, 0x01, 0x07, 0x07, 0xfe, 0x01, 0x07, 0x07, 0xff, 0x01, 0x07, 0x07, 0x80, 0x02, 0x07, 0x07, +0x81, 0x02, 0x07, 0x07, 0xdc, 0x01, 0x07, 0x01, 0x83, 0x02, 0x07, 0x01, 0x84, 0x02, 0x07, 0x01, +0x85, 0x02, 0x07, 0x01, 0x86, 0x02, 0x07, 0x01, 0x87, 0x02, 0x07, 0x51, 0x82, 0x02, 0x07, 0x01, +0x88, 0x02, 0x07, 0x01, 0x89, 0x02, 0x07, 0x01, 0x8a, 0x02, 0x07, 0x51, 0x8b, 0x02, 0x07, 0x01, +0x8c, 0x02, 0x07, 0x01, 0x8d, 0x02, 0x07, 0x01, 0x8e, 0x02, 0x07, 0x01, 0x8f, 0x02, 0x07, 0x01, +0x90, 0x02, 0x07, 0x01, 0x91, 0x02, 0x07, 0x51, 0x11, 0x07, 0x01, 0x92, 0x02, 0x07, 0x01, 0x93, +0x02, 0x07, 0x01, 0x94, 0x02, 0x07, 0x01, 0x95, 0x02, 0x07, 0x01, 0x96, 0x02, 0x07, 0x01, 0x97, +0x02, 0x09, 0x08, 0x23, 0x09, 0x99, 0x02, 0x24, 0x09, 0x9b, 0x02, 0x24, 0x09, 0x9c, 0x02, 0x24, +0x09, 0x12, 0x24, 0x09, 0x08, 0x24, 0x09, 0x16, 0x24, 0x09, 0x0d, 0x24, 0x09, 0x0f, 0x24, 0x09, +0x15, 0x24, 0x09, 0x9d, 0x02, 0x24, 0x09, 0x9e, 0x02, 0x24, 0x09, 0x9f, 0x02, 0x24, 0x09, 0xa0, +0x02, 0x24, 0x09, 0xa1, 0x02, 0x24, 0x09, 0xa2, 0x02, 0x24, 0x09, 0xa3, 0x02, 0x24, 0x09, 0xa4, +0x02, 0x24, 0x09, 0xa5, 0x02, 0x24, 0x09, 0xa6, 0x02, 0x24, 0x09, 0xa7, 0x02, 0x24, 0x09, 0xa8, +0x02, 0x24, 0x09, 0xa9, 0x02, 0x24, 0x09, 0xaa, 0x02, 0x24, 0x09, 0xab, 0x02, 0x24, 0x09, 0xac, +0x02, 0x24, 0x09, 0xad, 0x02, 0x24, 0x09, 0x09, 0x24, 0x09, 0xae, 0x02, 0x24, 0x09, 0xaf, 0x01, +0x24, 0x09, 0xaf, 0x02, 0x24, 0x09, 0xb0, 0x02, 0x24, 0x09, 0xb1, 0x02, 0x24, 0x09, 0xb2, 0x02, +0x24, 0x09, 0xb3, 0x02, 0x24, 0x09, 0xb4, 0x02, 0x24, 0x09, 0xb5, 0x02, 0x24, 0x09, 0xb6, 0x02, +0x24, 0x09, 0x47, 0x24, 0x09, 0xb7, 0x02, 0x24, 0x09, 0xb8, 0x02, 0x24, 0x09, 0xb9, 0x02, 0x24, +0x09, 0xba, 0x02, 0x24, 0x09, 0xbb, 0x02, 0x24, 0x09, 0xbc, 0x02, 0x24, 0x09, 0x17, 0x24, 0x09, +0xbd, 0x02, 0x24, 0x09, 0xbe, 0x02, 0x24, 0x09, 0xbf, 0x02, 0x24, 0x09, 0xc0, 0x02, 0x24, 0x09, +0xc1, 0x02, 0x24, 0x09, 0x07, 0x24, 0x09, 0x04, 0x24, 0x07, 0x07, 0x99, 0x02, 0x07, 0x07, 0x9b, +0x02, 0x07, 0x07, 0x9c, 0x02, 0x07, 0x01, 0x98, 0x02, 0x07, 0x07, 0x9d, 0x02, 0x07, 0x07, 0x9e, +0x02, 0x07, 0x07, 0x9f, 0x02, 0x07, 0x01, 0xc2, 0x02, 0x07, 0x07, 0xa0, 0x02, 0x07, 0x07, 0xa1, +0x02, 0x07, 0x07, 0xa2, 0x02, 0x07, 0x07, 0xa3, 0x02, 0x07, 0x07, 0xa4, 0x02, 0x07, 0x07, 0xa5, +0x02, 0x07, 0x07, 0xa6, 0x02, 0x07, 0x07, 0xa7, 0x02, 0x07, 0x07, 0xa8, 0x02, 0x07, 0x07, 0xa9, +0x02, 0x07, 0x07, 0xaa, 0x02, 0x07, 0x07, 0xab, 0x02, 0x07, 0x07, 0xac, 0x02, 0x07, 0x07, 0xad, +0x02, 0x07, 0x07, 0x09, 0x07, 0x07, 0xae, 0x02, 0x07, 0x07, 0xaf, 0x01, 0x07, 0x07, 0xaf, 0x02, +0x09, 0x1f, 0x24, 0x07, 0x07, 0xb0, 0x02, 0x07, 0x07, 0xb1, 0x02, 0x07, 0x07, 0xb2, 0x02, 0x07, +0x07, 0xb3, 0x02, 0x07, 0x07, 0xb4, 0x02, 0x07, 0x07, 0xb5, 0x02, 0x07, 0x07, 0xb6, 0x02, 0x07, +0x07, 0xb7, 0x02, 0x07, 0x07, 0xb8, 0x02, 0x07, 0x07, 0xb9, 0x02, 0x07, 0x07, 0xba, 0x02, 0x07, +0x07, 0xbb, 0x02, 0x07, 0x07, 0xbc, 0x02, 0x07, 0x01, 0xc1, 0x02, 0x07, 0x01, 0xbd, 0x02, 0x07, +0x01, 0xbe, 0x02, 0x07, 0x01, 0xc0, 0x02, 0x07, 0x01, 0xbf, 0x02, 0x07, 0x07, 0xc4, 0x02, 0x07, +0x07, 0xc5, 0x02, 0x09, 0x12, 0x25, 0x09, 0x08, 0x25, 0x09, 0x16, 0x25, 0x09, 0x0d, 0x25, 0x09, +0x0f, 0x25, 0x09, 0x15, 0x25, 0x09, 0x9d, 0x02, 0x25, 0x09, 0x9e, 0x02, 0x25, 0x09, 0x9f, 0x02, +0x25, 0x09, 0xa0, 0x02, 0x25, 0x09, 0xa1, 0x02, 0x25, 0x09, 0xa2, 0x02, 0x25, 0x09, 0xa3, 0x02, +0x25, 0x09, 0xa4, 0x02, 0x25, 0x09, 0xa5, 0x02, 0x25, 0x09, 0xa6, 0x02, 0x25, 0x09, 0xa7, 0x02, +0x25, 0x09, 0xa8, 0x02, 0x25, 0x09, 0xa9, 0x02, 0x25, 0x09, 0xaa, 0x02, 0x25, 0x09, 0xab, 0x02, +0x25, 0x09, 0xac, 0x02, 0x25, 0x09, 0xad, 0x02, 0x25, 0x09, 0x09, 0x25, 0x09, 0xae, 0x02, 0x25, +0x09, 0xaf, 0x01, 0x25, 0x09, 0xaf, 0x02, 0x25, 0x09, 0xb0, 0x02, 0x25, 0x09, 0xb1, 0x02, 0x25, +0x09, 0xb2, 0x02, 0x25, 0x09, 0xb3, 0x02, 0x25, 0x09, 0xb4, 0x02, 0x25, 0x09, 0xb5, 0x02, 0x25, +0x09, 0xb6, 0x02, 0x25, 0x09, 0x47, 0x25, 0x09, 0xb7, 0x02, 0x25, 0x09, 0xb8, 0x02, 0x25, 0x09, +0xb9, 0x02, 0x25, 0x09, 0xba, 0x02, 0x25, 0x09, 0xbb, 0x02, 0x25, 0x09, 0xbc, 0x02, 0x25, 0x09, +0x17, 0x25, 0x09, 0x1f, 0x25, 0x09, 0x12, 0x26, 0x09, 0x15, 0x26, 0x09, 0x17, 0x26, 0x07, 0x01, +0xc6, 0x02, 0x09, 0x26, 0x26, 0x09, 0x27, 0x26, 0x09, 0x29, 0x26, 0x09, 0x23, 0x26, 0x09, 0xae, +0x02, 0x26, 0x07, 0x01, 0xae, 0x02, 0x09, 0x08, 0x27, 0x07, 0x01, 0xc9, 0x02, 0xcd, 0x04, 0x01, +0x01, 0x01, 0x01, 0x28, 0x01, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0x28, 0x01, 0x03, 0x01, 0x01, +0x02, 0x01, 0x01, 0x28, 0x01, 0x05, 0x01, 0x02, 0x02, 0x01, 0x03, 0x01, 0x28, 0x02, 0x05, 0x01, +0x01, 0x03, 0x01, 0x04, 0x02, 0x01, 0x28, 0x01, 0x00, 0x00, 0x01, 0x04, 0x02, 0x01, 0x28, 0x01, +0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x28, 0x01, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0x28, 0x01, +0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0x28, 0x01, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0x28, 0x01, +0x03, 0x01, 0x00, 0x00, 0x01, 0x00, 0x02, 0x04, 0x00, 0x01, 0x01, 0x20, 0x02, 0x04, 0x00, 0x01, +0x01, 0x20, 0x03, 0x06, 0x00, 0x01, 0x04, 0x01, 0x20, 0x02, 0x04, 0x00, 0x00, 0x01, 0x20, 0x01, +0x01, 0x00, 0x01, 0x20, 0x01, 0x06, 0x08, 0x01, 0x00, 0x01, 0x04, 0x00, 0x01, 0x08, 0x01, 0x00, +0x00, 0x01, 0x00, 0x00, 0x01, 0x08, 0x01, 0x00, 0x00, 0x02, 0x06, 0x01, 0x04, 0x01, 0x00, 0x01, +0x04, 0x00, 0x01, 0x08, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x01, 0x02, 0x01, 0x04, 0x00, 0x01, 0x08, 0x01, 0x00, 0x00, 0x01, 0x04, 0x00, 0x01, 0x08, +0x01, 0x00, 0x00, 0x01, 0x04, 0x00, 0x01, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x20, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x01, 0x0c, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, +0x08, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00, +0x01, 0x20, 0x01, 0x00, 0x00, 0x01, 0x20, 0x00, 0x03, 0x01, 0x20, 0x01, 0x00, 0x00, 0x01, 0x2c, +0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x28, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, +0x01, 0x20, 0x00, 0x01, 0x01, 0x20, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x02, 0x00, +0x00, 0x00, 0x01, 0x08, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x01, +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x04, 0x01, 0x00, 0x01, 0x00, 0x00, +0x01, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x01, 0x00, 0x01, 0x08, 0x01, 0x04, +0x03, 0x00, 0x00, 0x01, 0x00, 0x01, 0x01, 0x00, 0x01, 0x08, 0x01, 0x01, 0x03, 0x01, 0x01, 0x00, +0x01, 0x08, 0x01, 0x01, 0x03, 0x01, 0x01, 0x00, 0x01, 0x08, 0x01, 0x01, 0x03, 0x02, 0x01, 0x02, +0x03, 0x01, 0x20, 0x03, 0x01, 0x02, 0x03, 0x03, 0x01, 0x20, 0x01, 0x01, 0x00, 0x01, 0x08, 0x01, +0x04, 0x03, 0x00, 0x02, 0x01, 0x00, 0x01, 0x01, 0x00, 0x01, 0x08, 0x01, 0x01, 0x03, 0x01, 0x01, +0x00, 0x01, 0x08, 0x01, 0x01, 0x03, 0x01, 0x01, 0x00, 0x01, 0x08, 0x01, 0x01, 0x03, 0x01, 0x00, +0x00, 0x01, 0x08, 0x01, 0x01, 0x03, 0x00, 0x00, 0x01, 0x00, 0x01, 0x01, 0x00, 0x01, 0x08, 0x01, +0x04, 0x03, 0x00, 0x00, 0x01, 0x00, 0x01, 0x01, 0x00, 0x01, 0x08, 0x01, 0x01, 0x03, 0x01, 0x01, +0x00, 0x01, 0x08, 0x01, 0x01, 0x03, 0x01, 0x01, 0x00, 0x01, 0x08, 0x01, 0x01, 0x03, 0x01, 0x01, +0x00, 0x01, 0x08, 0x01, 0x04, 0x03, 0x00, 0x03, 0x01, 0x00, 0x01, 0x01, 0x00, 0x01, 0x08, 0x01, +0x01, 0x03, 0x01, 0x01, 0x00, 0x01, 0x08, 0x01, 0x01, 0x03, 0x01, 0x01, 0x00, 0x01, 0x08, 0x01, +0x01, 0x03, 0x01, 0x00, 0x00, 0x01, 0x08, 0x01, 0x01, 0x03, 0x00, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x01, 0x08, 0x01, 0x04, 0x03, 0x00, 0x00, 0x01, 0x00, 0x01, 0x01, 0x00, 0x01, 0x08, 0x01, +0x01, 0x03, 0x01, 0x01, 0x00, 0x01, 0x08, 0x01, 0x01, 0x03, 0x01, 0x01, 0x00, 0x01, 0x08, 0x01, +0x01, 0x03, 0x01, 0x01, 0x00, 0x01, 0x08, 0x01, 0x04, 0x03, 0x00, 0x78, 0x01, 0x00, 0x01, 0x01, +0x00, 0x01, 0x08, 0x01, 0x01, 0x03, 0x01, 0x01, 0x00, 0x01, 0x08, 0x01, 0x01, 0x03, 0x01, 0x01, +0x00, 0x01, 0x08, 0x01, 0x01, 0x03, 0x01, 0x00, 0x00, 0x01, 0x08, 0x01, 0x01, 0x03, 0x00, 0x00, +0x01, 0x00, 0x00, 0x00, 0x01, 0x04, 0x02, 0x03, 0x01, 0x02, 0x01, 0x08, 0x02, 0x03, 0x01, 0x01, +0x03, 0x02, 0x03, 0x01, 0x02, 0x01, 0x08, 0x02, 0x03, 0x01, 0x06, 0x03, 0x01, 0x01, 0x02, 0x01, +0x08, 0x01, 0x01, 0x03, 0x01, 0x02, 0x02, 0x01, 0x08, 0x01, 0x01, 0x03, 0x00, 0x01, 0x01, 0x04, +0x01, 0x03, 0x01, 0x01, 0x08, 0x01, 0x00, 0x00, 0x01, 0x8f, 0x01, 0x00, 0x01, 0x08, 0x01, 0x00, +0x00, 0x02, 0x01, 0x00, 0x00, 0x01, 0x08, 0x02, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x00, 0x01, +0x08, 0x01, 0x00, 0x00, 0x02, 0x01, 0x02, 0x02, 0x01, 0x08, 0x02, 0x01, 0x03, 0x06, 0x03, 0x02, +0x8f, 0x01, 0x00, 0x00, 0x01, 0x08, 0x02, 0x00, 0x00, 0x07, 0x06, 0x02, 0x01, 0x02, 0x02, 0x01, +0x08, 0x02, 0x01, 0x03, 0x06, 0x03, 0x02, 0x01, 0x02, 0x02, 0x01, 0x08, 0x02, 0x01, 0x03, 0x06, +0x03, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, +0x00, 0x00, 0x01, 0x01, 0x24, 0x02, 0x8f, 0x01, 0x01, 0x00, 0x01, 0x20, 0x03, 0x01, 0x01, 0x00, +0x00, 0x01, 0x20, 0x02, 0x03, 0x01, 0x00, 0x01, 0x20, 0x03, 0x8f, 0x01, 0x01, 0x00, 0x78, 0x01, +0x20, 0x00, 0x03, 0x01, 0x20, 0x02, 0x03, 0x01, 0x03, 0x01, 0x28, 0x01, 0x01, 0x03, 0x02, 0x03, +0x01, 0x02, 0x01, 0x28, 0x02, 0x03, 0x01, 0x01, 0x03, 0x02, 0x03, 0x01, 0x03, 0x01, 0x28, 0x01, +0x06, 0x03, 0x02, 0x03, 0x01, 0x02, 0x01, 0x28, 0x02, 0x03, 0x01, 0x06, 0x03, 0x01, 0x01, 0x03, +0x01, 0x28, 0x01, 0x01, 0x03, 0x01, 0x01, 0x02, 0x01, 0x28, 0x01, 0x01, 0x03, 0x01, 0x02, 0x03, +0x01, 0x28, 0x01, 0x01, 0x03, 0x01, 0x02, 0x02, 0x01, 0x28, 0x01, 0x01, 0x03, 0x00, 0x01, 0x01, +0x04, 0x01, 0x03, 0x01, 0x01, 0x28, 0x01, 0x00, 0x00, 0x01, 0x8f, 0x01, 0x00, 0x01, 0x08, 0x01, +0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x01, 0x08, 0x02, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x00, +0x01, 0x08, 0x01, 0x00, 0x00, 0x02, 0x01, 0x03, 0x03, 0x01, 0x28, 0x02, 0x01, 0x03, 0x06, 0x03, +0x02, 0x01, 0x02, 0x02, 0x01, 0x28, 0x02, 0x01, 0x03, 0x06, 0x03, 0x02, 0x8f, 0x01, 0x00, 0x00, +0x01, 0x08, 0x02, 0x00, 0x00, 0x07, 0x06, 0x02, 0x01, 0x03, 0x03, 0x01, 0x28, 0x02, 0x01, 0x03, +0x06, 0x03, 0x02, 0x01, 0x02, 0x02, 0x01, 0x28, 0x02, 0x01, 0x03, 0x06, 0x03, 0x02, 0x01, 0x03, +0x03, 0x01, 0x28, 0x02, 0x01, 0x03, 0x06, 0x03, 0x02, 0x01, 0x02, 0x02, 0x01, 0x28, 0x02, 0x01, +0x03, 0x06, 0x03, 0x00, 0x01, 0x01, 0x20, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x20, 0x00, +0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x01, 0x08, +0x01, 0x01, 0x01, 0x00, 0x00, 0x01, 0x00, 0x01, 0x01, 0x00, 0x01, 0x08, 0x01, 0x00, 0x00, 0x00, +0x00, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x78, 0x01, 0x04, 0x00, +0x00, 0x01, 0x00, 0x00, 0x8f, 0x01, 0x01, 0x04, 0x00, 0x00, 0x01, 0x00, 0x02, 0x8f, 0x01, 0x00, +0x00, 0x01, 0x08, 0x02, 0x01, 0x03, 0x07, 0x06, 0x00, 0x78, 0x01, 0x04, 0x00, 0x00, 0x01, 0x04, +0x00, 0x00, 0x01, 0x04, 0x02, 0x00, 0x00, 0x00, 0x01, 0x0c, 0x01, 0x01, 0x03, 0x02, 0x03, 0x00, +0x00, 0x01, 0x08, 0x01, 0x01, 0x03, 0x02, 0x03, 0x00, 0x00, 0x01, 0x08, 0x01, 0x06, 0x03, 0x02, +0x04, 0x28, 0x00, 0x01, 0x08, 0x01, 0x0c, 0x0c, 0x02, 0x8f, 0x01, 0x28, 0x00, 0x01, 0x08, 0x01, +0x0c, 0x0c, 0x02, 0x06, 0x28, 0x00, 0x01, 0x08, 0x01, 0x0c, 0x0c, 0x02, 0x8f, 0x01, 0x28, 0x00, +0x01, 0x08, 0x01, 0x0c, 0x0c, 0x02, 0x04, 0x28, 0x00, 0x01, 0x08, 0x01, 0x0c, 0x0c, 0x02, 0x01, +0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x01, 0x20, 0x01, 0x00, 0x00, 0x01, 0x20, 0x02, 0x8f, +0x01, 0x00, 0x8f, 0x01, 0x01, 0x20, 0x01, 0x00, 0x00, 0x01, 0x20, 0x03, 0x8f, 0x01, 0x00, 0x02, +0x02, 0x01, 0x20, 0x02, 0x8f, 0x01, 0x00, 0x8f, 0x01, 0x01, 0x20, 0x02, 0x00, 0x00, 0x8f, 0x01, +0x01, 0x20, 0x03, 0x00, 0x00, 0x00, 0x00, 0x01, 0x20, 0x03, 0x03, 0x00, 0x00, 0x03, 0x01, 0x20, +0x03, 0x03, 0x00, 0x00, 0x03, 0x01, 0x28, 0x01, 0x01, 0x03, 0x03, 0x04, 0x00, 0x28, 0x00, 0x01, +0x20, 0x03, 0x8f, 0x01, 0x00, 0x28, 0x00, 0x01, 0x20, 0x03, 0x06, 0x00, 0x28, 0x00, 0x01, 0x20, +0x03, 0x8f, 0x01, 0x00, 0x28, 0x00, 0x01, 0x20, 0x03, 0x04, 0x00, 0x28, 0x00, 0x01, 0x20, 0x00, +0x78, 0x01, 0x20, 0x01, 0x00, 0x78, 0x01, 0x20, 0x00, 0x00, 0x01, 0x04, 0x01, 0x01, 0x00, 0x01, +0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x20, 0x00, 0x78, 0x01, 0x24, 0x00, 0x8f, 0x01, 0x01, +0x00, 0x00, 0x8f, 0x01, 0x01, 0x04, 0x00, 0x00, 0x01, 0x00, 0x02, 0x8f, 0x01, 0x00, 0x00, 0x01, +0x08, 0x02, 0x01, 0x03, 0x07, 0x06, 0x00, 0x78, 0x01, 0x24, 0x00, 0x00, 0x01, 0x04, 0x00, 0x00, +0x01, 0x04, 0x02, 0x00, 0x00, 0x00, 0x01, 0x0c, 0x01, 0x01, 0x03, 0x02, 0x03, 0x00, 0x00, 0x01, +0x08, 0x01, 0x01, 0x03, 0x02, 0x03, 0x00, 0x00, 0x01, 0x08, 0x01, 0x06, 0x03, 0x02, 0x04, 0x28, +0x00, 0x01, 0x08, 0x01, 0x0c, 0x0c, 0x02, 0x8f, 0x01, 0x28, 0x00, 0x01, 0x08, 0x01, 0x0c, 0x0c, +0x02, 0x06, 0x28, 0x00, 0x01, 0x08, 0x01, 0x0c, 0x0c, 0x02, 0x8f, 0x01, 0x28, 0x00, 0x01, 0x08, +0x01, 0x0c, 0x0c, 0x02, 0x04, 0x28, 0x00, 0x01, 0x08, 0x01, 0x0c, 0x0c, 0x00, 0x00, 0x01, 0x00, +0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x03, 0x01, 0x20, 0x00, 0x00, 0x01, +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x02, 0x02, 0x01, 0x20, 0x02, +0x02, 0x02, 0x02, 0x01, 0x20, 0x01, 0x02, 0x02, 0x01, 0x20, 0x01, 0x02, 0x02, 0x01, 0x20, 0x01, +0x02, 0x02, 0x01, 0x20, 0x01, 0x02, 0x02, 0x01, 0x20, 0x01, 0x02, 0x02, 0x01, 0x20, 0x01, 0x02, +0x02, 0x01, 0x20, 0x01, 0x02, 0x02, 0x01, 0x20, 0x01, 0x02, 0x02, 0x01, 0x20, 0x01, 0x02, 0x02, +0x01, 0x20, 0x01, 0x02, 0x02, 0x01, 0x20, 0x01, 0x02, 0x02, 0x01, 0x20, 0x01, 0x02, 0x02, 0x01, +0x20, 0x01, 0x02, 0x02, 0x01, 0x20, 0x02, 0x02, 0x02, 0x02, 0x01, 0x20, 0x02, 0x02, 0x02, 0x02, +0x01, 0x20, 0x02, 0x02, 0x02, 0x02, 0x01, 0x2c, 0x02, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, +0x02, 0x01, 0x2c, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x01, 0x20, 0x00, 0x00, 0x01, 0x00, +0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x03, 0x01, +0x20, 0x03, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x21, 0x78, 0x01, 0x06, 0x02, 0x00, +0x00, 0x00, 0x01, 0x08, 0x02, 0x01, 0x01, 0x01, 0x03, 0x00, 0x01, 0x01, 0x20, 0x00, 0x03, 0x01, +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x08, 0x02, 0x01, 0x01, 0x01, 0x03, +0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x08, 0x02, 0x01, 0x01, 0x01, 0x03, 0x00, +0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x08, 0x02, 0x01, 0x01, 0x01, 0x03, 0x00, 0x00, +0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x08, 0x02, 0x01, 0x01, 0x01, 0x03, 0x00, 0x00, 0x01, +0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x08, 0x02, 0x01, 0x01, 0x01, 0x03, 0x00, 0x00, 0x01, 0x00, +0x02, 0x00, 0x00, 0x00, 0x01, 0x08, 0x02, 0x01, 0x01, 0x01, 0x03, 0x00, 0x00, 0x01, 0x00, 0x02, +0x00, 0x00, 0x00, 0x01, 0x08, 0x02, 0x01, 0x01, 0x01, 0x03, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, +0x00, 0x00, 0x01, 0x08, 0x02, 0x01, 0x01, 0x01, 0x03, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, +0x00, 0x01, 0x08, 0x02, 0x01, 0x01, 0x01, 0x03, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, +0x01, 0x08, 0x02, 0x01, 0x01, 0x01, 0x03, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, +0x08, 0x02, 0x01, 0x01, 0x01, 0x03, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, +0x01, 0x00, 0x01, 0x00, 0x00, 0x01, 0x08, 0x01, 0x01, 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x01, +0x01, 0x01, 0x00, 0x01, 0x01, 0x20, 0x00, 0x04, 0x01, 0x20, 0x00, 0x04, 0x01, 0x20, 0x00, 0x04, +0x01, 0x20, 0x00, 0x03, 0x01, 0x20, 0x01, 0x00, 0x03, 0x01, 0x20, 0x00, 0x04, 0x01, 0x20, 0x00, +0x04, 0x01, 0x20, 0x01, 0x00, 0x01, 0x01, 0x28, 0x01, 0x01, 0x01, 0x01, 0x04, 0x01, 0x01, 0x08, +0x01, 0x01, 0x01, 0x02, 0x00, 0x00, 0x00, 0x01, 0x08, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x02, 0x00, 0x01, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, +0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, +0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x02, +0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x02, +0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x02, +0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x02, +0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x02, +0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x03, 0x02, 0x00, 0x00, 0x00, 0x01, 0x09, 0x03, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x01, 0x09, 0x02, 0x00, 0x00, 0x00, 0x00, 0x01, +0x02, 0x00, 0x01, 0x09, 0x01, 0x00, 0x00, 0x04, 0x02, 0x00, 0x00, 0x00, 0x00, 0x01, 0x09, 0x04, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x02, 0x00, 0x00, 0x00, 0x01, 0x09, 0x03, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x01, 0x09, 0x02, 0x00, 0x00, 0x00, +0x00, 0x01, 0x02, 0x00, 0x01, 0x09, 0x01, 0x00, 0x00, 0x03, 0x02, 0x00, 0x00, 0x00, 0x01, 0x09, +0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x01, 0x09, 0x02, 0x00, 0x00, +0x00, 0x00, 0x01, 0x02, 0x00, 0x01, 0x09, 0x01, 0x00, 0x00, 0x04, 0x02, 0x00, 0x00, 0x00, 0x00, +0x01, 0x09, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x02, 0x00, 0x00, 0x00, +0x01, 0x09, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x01, 0x09, 0x02, +0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x00, 0x01, 0x09, 0x01, 0x00, 0x00, 0x01, 0x02, 0x00, 0x01, +0x20, 0x07, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x2c, 0x05, 0x02, 0x03, 0x01, +0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x00, 0x02, 0x01, 0x20, 0x01, 0x01, 0x03, 0x01, 0x20, +0x01, 0x02, 0x02, 0x01, 0x20, 0x01, 0x02, 0x03, 0x01, 0x20, 0x01, 0x02, 0x00, 0x01, 0x08, 0x01, +0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, +0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x02, +0x01, 0x20, 0x00, 0x02, 0x01, 0x20, 0x00, 0x02, 0x01, 0x20, 0x00, 0x02, 0x01, 0x20, 0x00, 0x02, +0x01, 0x20, 0x00, 0x02, 0x01, 0x20, 0x00, 0x02, 0x01, 0x20, 0x00, 0x02, 0x01, 0x20, 0x00, 0x02, +0x01, 0x20, 0x00, 0x02, 0x01, 0x20, 0x00, 0x02, 0x01, 0x20, 0x00, 0x02, 0x01, 0x20, 0x00, 0x02, +0x01, 0x20, 0x00, 0x02, 0x01, 0x20, 0x00, 0x02, 0x01, 0x20, 0x00, 0x02, 0x01, 0x20, 0x00, 0x02, +0x01, 0x20, 0x00, 0x02, 0x01, 0x20, 0x03, 0x02, 0x00, 0x00, 0x00, 0x01, 0x28, 0x03, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x01, 0x28, 0x02, 0x00, 0x00, 0x00, 0x00, 0x01, +0x02, 0x00, 0x01, 0x28, 0x01, 0x00, 0x00, 0x04, 0x02, 0x00, 0x00, 0x00, 0x00, 0x01, 0x28, 0x04, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x02, 0x00, 0x00, 0x00, 0x01, 0x28, 0x03, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x01, 0x28, 0x02, 0x00, 0x00, 0x00, +0x00, 0x01, 0x02, 0x00, 0x01, 0x28, 0x01, 0x00, 0x00, 0x03, 0x02, 0x00, 0x00, 0x00, 0x01, 0x28, +0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x01, 0x28, 0x02, 0x00, 0x00, +0x00, 0x00, 0x01, 0x02, 0x00, 0x01, 0x28, 0x01, 0x00, 0x00, 0x04, 0x02, 0x00, 0x00, 0x00, 0x00, +0x01, 0x28, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x02, 0x00, 0x00, 0x00, +0x01, 0x28, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x01, 0x28, 0x02, +0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x00, 0x01, 0x28, 0x01, 0x00, 0x00, 0x00, 0x02, 0x01, 0x00, +0x01, 0x00, 0x02, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x01, 0x00, 0x02, 0x01, 0x00, 0x00, 0x02, +0x01, 0x00, 0x01, 0x00, 0x02, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x01, 0x00, 0x02, 0x01, 0x00, +0x00, 0x02, 0x01, 0x00, 0x01, 0x00, 0x02, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x01, 0x00, 0x02, +0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x01, 0x00, 0x02, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x01, +0x00, 0x02, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x01, 0x00, 0x02, 0x01, 0x00, 0x00, 0x02, 0x01, +0x00, 0x01, 0x00, 0x02, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x01, 0x00, 0x02, 0x01, 0x00, 0x00, +0x02, 0x01, 0x00, 0x01, 0x00, 0x02, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x02, 0x01, 0x00, 0x01, 0x00, 0x02, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x01, 0x00, +0x02, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x07, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x08, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x04, 0x00, +0x01, 0x28, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x08, 0x01, 0x00, 0x01, 0x06, 0x00, +0x01, 0x08, 0x01, 0x00, 0x00, 0x00, 0x08, 0x01, 0x00, 0x01, 0x04, 0x00, 0x01, 0x08, 0x01, 0x00, +0x00, 0x01, 0x04, 0x00, 0x01, 0x08, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0xc3, 0x04, +0x00, 0x01, 0x00, 0x01, 0xc3, 0x04, 0x00, 0x01, 0x00, 0x01, 0xc7, 0x04, 0x00, 0x01, 0x00, 0x00, +0xc7, 0x04, 0x01, 0x00, 0x01, 0xc7, 0x04, 0x00, 0x01, 0x00, 0x00, 0x03, 0x01, 0x00, 0x00, 0xc7, +0x04, 0x01, 0x00, 0x00, 0xc7, 0x04, 0x01, 0x00, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0xc3, 0x04, +0x01, 0x00, 0x01, 0xc7, 0x04, 0x00, 0x01, 0x08, 0x01, 0xc3, 0x02, 0x01, 0x01, 0xc7, 0x04, 0x00, +0x01, 0x08, 0x01, 0xc3, 0x02, 0x01, 0x00, 0x04, 0x01, 0x00, 0x00, 0x04, 0x01, 0x00, 0x00, 0x8f, +0x01, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x03, 0x01, 0x00, 0x00, 0x08, 0x01, 0x00, 0x00, 0x08, 0x01, 0x00, 0x01, 0x00, 0x00, 0x01, 0x09, +0x01, 0x0c, 0x0c, 0x00, 0x8f, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0xc3, 0x04, 0x01, +0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0xc7, 0x04, 0x00, 0x01, 0x08, 0x01, 0xc3, 0x02, 0x01, 0x01, +0xc3, 0x04, 0x00, 0x01, 0x00, 0x01, 0xc3, 0x04, 0x00, 0x01, 0x00, 0x02, 0xc3, 0x04, 0x00, 0x00, +0x01, 0x00, 0x01, 0xc3, 0x04, 0x00, 0x01, 0x00, 0x01, 0x06, 0x00, 0x01, 0x00, 0x01, 0x06, 0x00, +0x01, 0x00, 0x01, 0x06, 0x00, 0x01, 0x00, 0x00, 0xc7, 0x04, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, +0x00, 0x04, 0x01, 0x20, 0x01, 0x00, 0x04, 0x01, 0x20, 0x00, 0x04, 0x01, 0x20, 0x01, 0x00, 0x04, +0x01, 0x20, 0x00, 0x04, 0x01, 0x20, 0x01, 0x00, 0x04, 0x01, 0x20, 0x00, 0x04, 0x01, 0x20, 0x01, +0x00, 0x04, 0x01, 0x20, 0x00, 0x03, 0x01, 0x20, 0x01, 0x00, 0x03, 0x01, 0x20, 0x00, 0x08, 0x01, +0x00, 0x01, 0x06, 0x08, 0x01, 0x08, 0x01, 0x0c, 0x0c, 0x00, 0x08, 0x01, 0x00, 0x00, 0x01, 0x01, +0x20, 0x01, 0x04, 0x00, 0x01, 0x28, 0x01, 0x00, 0x00, 0x01, 0x04, 0x00, 0x01, 0x28, 0x01, 0x00, +0x00, 0x01, 0xc3, 0x04, 0x00, 0x01, 0x20, 0x01, 0xc3, 0x04, 0x00, 0x01, 0x20, 0x01, 0xc7, 0x04, +0x00, 0x01, 0x20, 0x00, 0xc7, 0x04, 0x01, 0x20, 0x01, 0xc7, 0x04, 0x00, 0x01, 0x20, 0x00, 0x03, +0x01, 0x20, 0x00, 0xc7, 0x04, 0x01, 0x20, 0x00, 0xc7, 0x04, 0x01, 0x20, 0x01, 0x04, 0x00, 0x01, +0x20, 0x00, 0xc3, 0x04, 0x01, 0x20, 0x01, 0xc7, 0x04, 0x00, 0x01, 0x28, 0x01, 0xc3, 0x02, 0x01, +0x01, 0xc7, 0x04, 0x00, 0x01, 0x28, 0x01, 0xc3, 0x02, 0x01, 0x00, 0x04, 0x01, 0x20, 0x00, 0x04, +0x01, 0x20, 0x00, 0x8f, 0x01, 0x01, 0x20, 0x02, 0x00, 0x00, 0x00, 0x01, 0x20, 0x02, 0x00, 0x00, +0x00, 0x01, 0x20, 0x00, 0x03, 0x01, 0x00, 0x00, 0x08, 0x01, 0x20, 0x00, 0x08, 0x01, 0x20, 0x01, +0x00, 0x00, 0x01, 0x28, 0x01, 0x0c, 0x0c, 0x00, 0x8f, 0x01, 0x01, 0x20, 0x00, 0x01, 0x01, 0x20, +0x00, 0xc3, 0x04, 0x01, 0x20, 0x00, 0x00, 0x01, 0x20, 0x01, 0xc7, 0x04, 0x00, 0x01, 0x28, 0x01, +0xc3, 0x02, 0x01, 0x01, 0xc3, 0x04, 0x00, 0x01, 0x20, 0x01, 0xc3, 0x04, 0x00, 0x01, 0x20, 0x02, +0xc3, 0x04, 0x00, 0x00, 0x01, 0x20, 0x01, 0xc3, 0x04, 0x00, 0x01, 0x20, 0x01, 0x06, 0x00, 0x01, +0x20, 0x01, 0x06, 0x00, 0x01, 0x20, 0x01, 0x06, 0x00, 0x01, 0x20, 0x00, 0xc7, 0x04, 0x01, 0x20, +0x00, 0x01, 0x01, 0x20, 0x00, 0x28, 0x01, 0x20, 0x01, 0x00, 0x28, 0x01, 0x20, 0x01, 0x00, 0x00, +0x01, 0x08, 0x01, 0x00, 0x00, 0x00, 0xc3, 0x04, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x04, +0x00, 0x01, 0x08, 0x01, 0x00, 0x00, 0x01, 0x04, 0x00, 0x01, 0x08, 0x01, 0x00, 0x00, 0x00, 0x01, +0x01, 0x00, 0x01, 0xc3, 0x04, 0x00, 0x01, 0x00, 0x01, 0xc3, 0x04, 0x00, 0x01, 0x00, 0x01, 0xc7, +0x04, 0x00, 0x01, 0x00, 0x00, 0xc7, 0x04, 0x01, 0x00, 0x01, 0xc7, 0x04, 0x00, 0x01, 0x00, 0x00, +0x03, 0x01, 0x00, 0x00, 0xc7, 0x04, 0x01, 0x00, 0x00, 0xc7, 0x04, 0x01, 0x00, 0x01, 0x04, 0x00, +0x01, 0x00, 0x00, 0xc7, 0x04, 0x01, 0x00, 0x01, 0xc7, 0x04, 0x00, 0x01, 0x08, 0x01, 0xc3, 0x02, +0x01, 0x01, 0xc7, 0x04, 0x00, 0x01, 0x08, 0x01, 0xc3, 0x02, 0x01, 0x00, 0x04, 0x01, 0x00, 0x00, +0x04, 0x01, 0x00, 0x00, 0x8f, 0x01, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, +0x00, 0x00, 0x01, 0x00, 0x00, 0x03, 0x01, 0x00, 0x00, 0x08, 0x01, 0x00, 0x00, 0x08, 0x01, 0x00, +0x01, 0x00, 0x00, 0x01, 0x09, 0x01, 0x0c, 0x0c, 0x00, 0x8f, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, +0x00, 0x00, 0xc7, 0x04, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0xc7, 0x04, 0x00, 0x01, 0x08, +0x01, 0xc3, 0x02, 0x01, 0x01, 0xc3, 0x04, 0x00, 0x01, 0x00, 0x01, 0xc3, 0x04, 0x00, 0x01, 0x00, +0x02, 0xc3, 0x04, 0x00, 0x00, 0x01, 0x00, 0x01, 0xc3, 0x04, 0x00, 0x01, 0x00, 0x01, 0x06, 0x00, +0x01, 0x00, 0x01, 0x06, 0x00, 0x01, 0x00, 0x01, 0x06, 0x00, 0x01, 0x00, 0x00, 0xc7, 0x04, 0x01, +0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x20, 0x00, 0xc7, 0x04, 0x01, 0x00, 0x01, 0x04, +0x00, 0x01, 0x28, 0x01, 0x00, 0x00, 0x01, 0x04, 0x00, 0x01, 0x28, 0x01, 0x00, 0x00, 0x01, 0xc7, +0x04, 0x00, 0x01, 0x20, 0x00, 0xc7, 0x04, 0x01, 0x20, 0x01, 0xc7, 0x04, 0x00, 0x01, 0x20, 0x00, +0xc7, 0x04, 0x01, 0x20, 0x00, 0xc7, 0x04, 0x01, 0x20, 0x01, 0x04, 0x00, 0x01, 0x20, 0x00, 0xc7, +0x04, 0x01, 0x20, 0x01, 0xc7, 0x04, 0x00, 0x01, 0x28, 0x01, 0xc3, 0x02, 0x01, 0x01, 0xc7, 0x04, +0x00, 0x01, 0x28, 0x01, 0xc3, 0x02, 0x01, 0x00, 0x04, 0x01, 0x20, 0x00, 0x04, 0x01, 0x20, 0x00, +0x03, 0x01, 0x20, 0x00, 0x08, 0x01, 0x20, 0x00, 0xc7, 0x04, 0x01, 0x20, 0x00, 0x00, 0x01, 0x20, +0x01, 0xc7, 0x04, 0x00, 0x01, 0x28, 0x01, 0xc3, 0x02, 0x01, 0x00, 0xc7, 0x04, 0x01, 0x20, 0x00, +0x01, 0x01, 0x20, 0x01, 0xc3, 0x04, 0x00, 0x01, 0x20, 0x01, 0xc3, 0x04, 0x00, 0x01, 0x20, 0x00, +0x03, 0x01, 0x20, 0x00, 0x8f, 0x01, 0x01, 0x20, 0x02, 0x00, 0x00, 0x00, 0x01, 0x20, 0x02, 0x00, +0x00, 0x00, 0x01, 0x20, 0x00, 0x01, 0x01, 0x20, 0x01, 0x00, 0x00, 0x01, 0x28, 0x01, 0x0c, 0x0c, +0x00, 0x08, 0x01, 0x20, 0x00, 0x8f, 0x01, 0x01, 0x20, 0x01, 0xc3, 0x04, 0x00, 0x01, 0x20, 0x01, +0xc3, 0x04, 0x00, 0x01, 0x20, 0x02, 0xc3, 0x04, 0x00, 0x00, 0x01, 0x20, 0x01, 0xc3, 0x04, 0x00, +0x01, 0x20, 0x01, 0x06, 0x00, 0x01, 0x20, 0x01, 0x06, 0x00, 0x01, 0x20, 0x01, 0x06, 0x00, 0x01, +0x20, 0x01, 0x00, 0x00, 0x01, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x01, +0x00, 0x00, 0x01, 0x01, 0x20, 0x00, 0x00, 0x01, 0x20, 0x00, 0x9d, 0x05, 0x01, 0x00, 0x00, 0x01, +0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x08, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, +0x00, 0x00, 0x1d, 0x08, 0x00, 0x08, 0x05, 0x00, 0x1b, 0x03, 0x09, 0x01, 0x02, 0x19, 0x0a, 0x01, +0x03, 0x1a, 0x0b, 0x01, 0x01, 0x18, 0x21, 0x08, 0x08, 0x09, 0x00, 0x1e, 0x01, 0x20, 0x12, 0x05, +0x1d, 0x28, 0x08, 0x08, 0x0b, 0x00, 0x2a, 0x05, 0x20, 0x02, 0x05, 0x25, 0x20, 0x03, 0x06, 0x26, +0x29, 0x01, 0x09, 0x29, 0x05, 0x02, 0x07, 0x27, 0x2b, 0x01, 0x08, 0x28, 0x30, 0x08, 0x0b, 0x0e, +0x00, 0x32, 0x04, 0x32, 0x02, 0x05, 0x2e, 0x33, 0x01, 0x08, 0x31, 0x34, 0x01, 0x07, 0x30, 0x35, +0x02, 0x06, 0x2f, 0x04, 0x08, 0x0b, 0x11, 0x00, 0x38, 0x02, 0x34, 0x01, 0x06, 0x37, 0x33, 0x01, +0x05, 0x36, 0x02, 0x08, 0x0b, 0x14, 0x00, 0x46, 0x05, 0x5b, 0x01, 0x08, 0x44, 0x34, 0x01, 0x06, +0x42, 0x5c, 0x01, 0x09, 0x45, 0x5d, 0x01, 0x07, 0x43, 0x33, 0x01, 0x05, 0x41, 0x03, 0x08, 0x0b, +0x17, 0x00, 0x52, 0x05, 0x5b, 0x01, 0x08, 0x50, 0x34, 0x01, 0x06, 0x4e, 0x5c, 0x01, 0x09, 0x51, +0x5d, 0x01, 0x07, 0x4f, 0x33, 0x01, 0x05, 0x4d, 0x78, 0x08, 0x0b, 0x1a, 0x00, 0x5e, 0x05, 0x5b, +0x01, 0x08, 0x5c, 0x34, 0x01, 0x06, 0x5a, 0x5c, 0x01, 0x09, 0x5d, 0x5d, 0x01, 0x07, 0x5b, 0x33, +0x01, 0x05, 0x59, 0x01, 0x08, 0x0b, 0x1d, 0x00, 0x92, 0x01, 0x1b, 0xab, 0x01, 0x01, 0x10, 0x82, +0x01, 0xac, 0x01, 0x01, 0x0a, 0x7c, 0x93, 0x01, 0x01, 0x07, 0x79, 0xad, 0x01, 0x01, 0x06, 0x78, +0xae, 0x01, 0x01, 0x18, 0x8a, 0x01, 0xa0, 0x01, 0x01, 0x17, 0x89, 0x01, 0x9d, 0x01, 0x01, 0x14, +0x86, 0x01, 0x94, 0x01, 0x01, 0x09, 0x7b, 0xaf, 0x01, 0x01, 0x08, 0x7a, 0xb0, 0x01, 0x01, 0x0c, +0x7e, 0xa2, 0x01, 0x01, 0x1a, 0x8c, 0x01, 0xb1, 0x01, 0x01, 0x16, 0x88, 0x01, 0xb2, 0x01, 0x01, +0x13, 0x85, 0x01, 0xb3, 0x01, 0x01, 0x0e, 0x80, 0x01, 0xb4, 0x01, 0x01, 0x1b, 0x8d, 0x01, 0xb5, +0x01, 0x01, 0x15, 0x87, 0x01, 0x05, 0x02, 0x05, 0x77, 0xb6, 0x01, 0x01, 0x12, 0x84, 0x01, 0x95, +0x01, 0x01, 0x0b, 0x7d, 0x99, 0x01, 0x01, 0x0f, 0x81, 0x01, 0x33, 0x01, 0x1e, 0x90, 0x01, 0x34, +0x01, 0x1f, 0x91, 0x01, 0xa1, 0x01, 0x01, 0x19, 0x8b, 0x01, 0xb7, 0x01, 0x01, 0x11, 0x83, 0x01, +0x96, 0x01, 0x01, 0x0d, 0x7f, 0xa3, 0x01, 0x01, 0x1c, 0x8e, 0x01, 0xb8, 0x01, 0x01, 0x1d, 0x8f, +0x01, 0x8f, 0x01, 0x08, 0x08, 0x20, 0x00, 0xba, 0x01, 0x14, 0xfe, 0x01, 0x01, 0x0b, 0xbe, 0x01, +0xff, 0x01, 0x01, 0x18, 0xcb, 0x01, 0x05, 0x02, 0x05, 0xb8, 0x01, 0x80, 0x02, 0x01, 0x0d, 0xc0, +0x01, 0x81, 0x02, 0x01, 0x08, 0xbb, 0x01, 0x94, 0x01, 0x01, 0x14, 0xc7, 0x01, 0x05, 0x03, 0x06, +0xb9, 0x01, 0x82, 0x02, 0x01, 0x0f, 0xc2, 0x01, 0x83, 0x02, 0x01, 0x09, 0xbc, 0x01, 0x9d, 0x01, +0x01, 0x0e, 0xc1, 0x01, 0xb3, 0x01, 0x01, 0x0c, 0xbf, 0x01, 0x84, 0x02, 0x01, 0x19, 0xcc, 0x01, +0x93, 0x01, 0x01, 0x13, 0xc6, 0x01, 0x85, 0x02, 0x01, 0x17, 0xca, 0x01, 0x86, 0x02, 0x01, 0x0a, +0xbd, 0x01, 0x87, 0x02, 0x01, 0x15, 0xc8, 0x01, 0x88, 0x02, 0x01, 0x10, 0xc3, 0x01, 0x89, 0x02, +0x01, 0x12, 0xc5, 0x01, 0x8a, 0x02, 0x01, 0x11, 0xc4, 0x01, 0x8b, 0x02, 0x01, 0x16, 0xc9, 0x01, +0x8f, 0x02, 0x28, 0x0b, 0x23, 0x00, 0xd1, 0x01, 0x03, 0x20, 0x22, 0x05, 0xce, 0x01, 0x20, 0x23, +0x06, 0xcf, 0x01, 0x05, 0x22, 0x07, 0xd0, 0x01, 0xca, 0x02, 0x08, 0x0b, 0x26, 0x00, 0xe8, 0x01, +0x00, 0xdd, 0x02, 0x08, 0x08, 0x2a, 0x00, 0xef, 0x01, 0x05, 0xe1, 0x02, 0x02, 0x07, 0xf1, 0x01, +0xe2, 0x02, 0x00, 0x03, 0x03, 0x00, 0xe3, 0x02, 0x00, 0x02, 0x00, 0x00, 0xe4, 0x02, 0x00, 0x01, +0x00, 0x00, 0xe5, 0x02, 0x01, 0x06, 0xf0, 0x01, 0xe8, 0x02, 0xdd, 0x02, 0x08, 0x2d, 0x00, 0xf3, +0x01, 0x00, 0xeb, 0x02, 0xdd, 0x02, 0x08, 0x30, 0x00, 0xf5, 0x01, 0x00, 0xee, 0x02, 0xdd, 0x02, +0x08, 0x33, 0x00, 0xf7, 0x01, 0x00, 0xf1, 0x02, 0xdd, 0x02, 0x08, 0x36, 0x00, 0xf9, 0x01, 0x00, +0xf4, 0x02, 0xdd, 0x02, 0x08, 0x39, 0x00, 0xfb, 0x01, 0x00, 0xf7, 0x02, 0xdd, 0x02, 0x08, 0x3c, +0x00, 0xfd, 0x01, 0x00, 0xfa, 0x02, 0xdd, 0x02, 0x08, 0x3f, 0x00, 0xff, 0x01, 0x00, 0xfd, 0x02, +0xdd, 0x02, 0x08, 0x42, 0x00, 0x81, 0x02, 0x00, 0x80, 0x03, 0xdd, 0x02, 0x08, 0x45, 0x00, 0x83, +0x02, 0x00, 0x83, 0x03, 0xdd, 0x02, 0x08, 0x48, 0x00, 0x85, 0x02, 0x00, 0x86, 0x03, 0xdd, 0x02, +0x08, 0x4b, 0x00, 0x87, 0x02, 0x00, 0xd6, 0x02, 0x08, 0x08, 0x4f, 0x00, 0x97, 0x02, 0x0a, 0x96, +0x03, 0x02, 0x07, 0x8f, 0x02, 0x97, 0x03, 0x02, 0x06, 0x8e, 0x02, 0x98, 0x03, 0x02, 0x08, 0x90, +0x02, 0x94, 0x03, 0x01, 0x0d, 0x95, 0x02, 0x95, 0x03, 0x01, 0x0e, 0x96, 0x02, 0x99, 0x03, 0x02, +0x0b, 0x93, 0x02, 0x9a, 0x03, 0x02, 0x0c, 0x94, 0x02, 0x9b, 0x03, 0x02, 0x05, 0x8d, 0x02, 0x9c, +0x03, 0x02, 0x09, 0x91, 0x02, 0x9c, 0x03, 0x03, 0x0a, 0x92, 0x02, 0xc9, 0x03, 0x08, 0x0a, 0x53, +0x00, 0x92, 0x03, 0x4d, 0xf6, 0x03, 0x02, 0x33, 0xf3, 0x02, 0xf7, 0x03, 0x02, 0x41, 0x81, 0x03, +0xe1, 0x03, 0x01, 0x20, 0xe0, 0x02, 0xf8, 0x03, 0x03, 0x48, 0x88, 0x03, 0xf9, 0x03, 0x01, 0x07, +0xc7, 0x02, 0xd7, 0x03, 0x01, 0x16, 0xd6, 0x02, 0xfa, 0x03, 0x02, 0x3d, 0xfd, 0x02, 0xeb, 0x03, +0x01, 0x29, 0xe9, 0x02, 0xfb, 0x03, 0x02, 0x45, 0x85, 0x03, 0xfc, 0x03, 0x02, 0x37, 0xf7, 0x02, +0xfd, 0x03, 0x01, 0x08, 0xc8, 0x02, 0xf6, 0x03, 0x03, 0x34, 0xf4, 0x02, 0xcd, 0x03, 0x01, 0x0c, +0xcc, 0x02, 0xd1, 0x03, 0x01, 0x10, 0xd0, 0x02, 0xf2, 0x03, 0x01, 0x30, 0xf0, 0x02, 0xfe, 0x03, +0x02, 0x50, 0x90, 0x03, 0xe9, 0x03, 0x01, 0x27, 0xe7, 0x02, 0xfc, 0x03, 0x03, 0x38, 0xf8, 0x02, +0xff, 0x03, 0x02, 0x3f, 0xff, 0x02, 0xd9, 0x03, 0x01, 0x18, 0xd8, 0x02, 0x80, 0x04, 0x03, 0x4e, +0x8e, 0x03, 0xdc, 0x03, 0x01, 0x1b, 0xdb, 0x02, 0x81, 0x04, 0x02, 0x43, 0x83, 0x03, 0xce, 0x03, +0x01, 0x0d, 0xcd, 0x02, 0x34, 0x01, 0x05, 0xc5, 0x02, 0xdf, 0x03, 0x01, 0x1e, 0xde, 0x02, 0xf7, +0x03, 0x03, 0x42, 0x82, 0x03, 0xfa, 0x03, 0x03, 0x3e, 0xfe, 0x02, 0xf0, 0x03, 0x01, 0x2e, 0xee, +0x02, 0x82, 0x04, 0x02, 0x35, 0xf5, 0x02, 0xe7, 0x03, 0x01, 0x25, 0xe5, 0x02, 0xd8, 0x03, 0x01, +0x17, 0xd7, 0x02, 0xd3, 0x03, 0x01, 0x12, 0xd2, 0x02, 0x81, 0x04, 0x03, 0x44, 0x84, 0x03, 0x83, +0x04, 0x02, 0x49, 0x89, 0x03, 0xee, 0x03, 0x01, 0x2c, 0xec, 0x02, 0xfb, 0x03, 0x03, 0x46, 0x86, +0x03, 0xcc, 0x03, 0x01, 0x0b, 0xcb, 0x02, 0xd4, 0x03, 0x01, 0x13, 0xd3, 0x02, 0xf1, 0x03, 0x01, +0x2f, 0xef, 0x02, 0xed, 0x03, 0x01, 0x2b, 0xeb, 0x02, 0xff, 0x03, 0x03, 0x40, 0x80, 0x03, 0xd6, +0x03, 0x01, 0x15, 0xd5, 0x02, 0xe3, 0x03, 0x01, 0x22, 0xe2, 0x02, 0xea, 0x03, 0x01, 0x28, 0xe8, +0x02, 0xe6, 0x03, 0x01, 0x24, 0xe4, 0x02, 0xe0, 0x03, 0x01, 0x1f, 0xdf, 0x02, 0xdb, 0x03, 0x01, +0x1a, 0xda, 0x02, 0x84, 0x04, 0x01, 0x06, 0xc6, 0x02, 0xf8, 0x03, 0x02, 0x47, 0x87, 0x03, 0xe8, +0x03, 0x01, 0x26, 0xe6, 0x02, 0xd5, 0x03, 0x01, 0x14, 0xd4, 0x02, 0xf3, 0x03, 0x01, 0x09, 0xc9, +0x02, 0x83, 0x04, 0x03, 0x4a, 0x8a, 0x03, 0xd0, 0x03, 0x01, 0x0f, 0xcf, 0x02, 0xef, 0x03, 0x01, +0x2d, 0xed, 0x02, 0x85, 0x04, 0x03, 0x3a, 0xfa, 0x02, 0x86, 0x04, 0x03, 0x32, 0xf2, 0x02, 0xde, +0x03, 0x01, 0x1d, 0xdd, 0x02, 0x82, 0x04, 0x03, 0x36, 0xf6, 0x02, 0x85, 0x04, 0x02, 0x39, 0xf9, +0x02, 0xe2, 0x03, 0x01, 0x21, 0xe1, 0x02, 0x87, 0x04, 0x03, 0x4c, 0x8c, 0x03, 0x80, 0x04, 0x02, +0x4d, 0x8d, 0x03, 0xdd, 0x03, 0x01, 0x1c, 0xdc, 0x02, 0x88, 0x04, 0x02, 0x51, 0x91, 0x03, 0xda, +0x03, 0x01, 0x19, 0xd9, 0x02, 0x87, 0x04, 0x02, 0x4b, 0x8b, 0x03, 0x33, 0x01, 0x0a, 0xca, 0x02, +0xe4, 0x03, 0x01, 0x23, 0xe3, 0x02, 0x86, 0x04, 0x02, 0x31, 0xf1, 0x02, 0xcf, 0x03, 0x01, 0x0e, +0xce, 0x02, 0xec, 0x03, 0x01, 0x2a, 0xea, 0x02, 0xd2, 0x03, 0x01, 0x11, 0xd1, 0x02, 0x89, 0x04, +0x02, 0x4f, 0x8f, 0x03, 0x8a, 0x04, 0x03, 0x3c, 0xfc, 0x02, 0x8a, 0x04, 0x02, 0x3b, 0xfb, 0x02, +0xc3, 0x04, 0x08, 0x0a, 0x57, 0x00, 0xf4, 0x03, 0x29, 0x09, 0x21, 0x02, 0xcd, 0x03, 0xd5, 0x04, +0x01, 0x16, 0xdf, 0x03, 0xb7, 0x01, 0x01, 0x22, 0xeb, 0x03, 0xed, 0x04, 0x01, 0x2a, 0xf3, 0x03, +0xe7, 0x04, 0x01, 0x28, 0xf1, 0x03, 0x0a, 0x21, 0x03, 0xce, 0x03, 0xe2, 0x04, 0x01, 0x23, 0xec, +0x03, 0xd8, 0x04, 0x01, 0x19, 0xe2, 0x03, 0xdd, 0x04, 0x01, 0x1d, 0xe6, 0x03, 0xd3, 0x04, 0x01, +0x14, 0xdd, 0x03, 0xe3, 0x04, 0x01, 0x24, 0xed, 0x03, 0xd7, 0x04, 0x01, 0x18, 0xe1, 0x03, 0xc8, +0x04, 0x01, 0x09, 0xd2, 0x03, 0xdf, 0x04, 0x01, 0x1f, 0xe8, 0x03, 0xe5, 0x04, 0x01, 0x26, 0xef, +0x03, 0xd9, 0x04, 0x01, 0x1a, 0xe3, 0x03, 0xc9, 0x04, 0x01, 0x0a, 0xd3, 0x03, 0xca, 0x04, 0x01, +0x0b, 0xd4, 0x03, 0xcd, 0x04, 0x01, 0x0e, 0xd7, 0x03, 0xc5, 0x04, 0x01, 0x07, 0xd0, 0x03, 0xd1, +0x04, 0x01, 0x12, 0xdb, 0x03, 0xcf, 0x04, 0x01, 0x10, 0xd9, 0x03, 0xd6, 0x04, 0x01, 0x17, 0xe0, +0x03, 0x34, 0x01, 0x2c, 0xf5, 0x03, 0xde, 0x04, 0x01, 0x1e, 0xe7, 0x03, 0xc6, 0x04, 0x01, 0x08, +0xd1, 0x03, 0x33, 0x01, 0x05, 0xcc, 0x03, 0xd2, 0x04, 0x01, 0x13, 0xdc, 0x03, 0xe0, 0x04, 0x01, +0x20, 0xe9, 0x03, 0xe4, 0x04, 0x01, 0x25, 0xee, 0x03, 0xee, 0x04, 0x01, 0x29, 0xf2, 0x03, 0xcc, +0x04, 0x01, 0x0d, 0xd6, 0x03, 0xce, 0x04, 0x01, 0x0f, 0xd8, 0x03, 0xdc, 0x04, 0x01, 0x1c, 0xe5, +0x03, 0xd0, 0x04, 0x01, 0x11, 0xda, 0x03, 0xd4, 0x04, 0x01, 0x15, 0xde, 0x03, 0xc4, 0x04, 0x01, +0x06, 0xcf, 0x03, 0xdb, 0x04, 0x01, 0x1b, 0xe4, 0x03, 0xe6, 0x04, 0x01, 0x27, 0xf0, 0x03, 0xe1, +0x04, 0x01, 0x21, 0xea, 0x03, 0xcb, 0x04, 0x01, 0x0c, 0xd5, 0x03, 0xc7, 0x04, 0x08, 0x0a, 0x5a, +0x00, 0xc4, 0x04, 0x27, 0x09, 0x21, 0x02, 0x9f, 0x04, 0xd5, 0x04, 0x01, 0x1e, 0xb8, 0x04, 0xb7, +0x01, 0x01, 0x25, 0xbf, 0x04, 0x0a, 0x21, 0x03, 0xa0, 0x04, 0xe2, 0x04, 0x01, 0x26, 0xc0, 0x04, +0xd8, 0x04, 0x01, 0x13, 0xad, 0x04, 0xdd, 0x04, 0x01, 0x14, 0xae, 0x04, 0xd3, 0x04, 0x01, 0x1c, +0xb6, 0x04, 0xe7, 0x04, 0x01, 0x18, 0xb2, 0x04, 0xcf, 0x04, 0x01, 0x0e, 0xa8, 0x04, 0xc8, 0x04, +0x01, 0x08, 0xa2, 0x04, 0xdf, 0x04, 0x01, 0x16, 0xb0, 0x04, 0xe5, 0x04, 0x01, 0x29, 0xc3, 0x04, +0xe3, 0x04, 0x01, 0x27, 0xc1, 0x04, 0xd9, 0x04, 0x01, 0x20, 0xba, 0x04, 0xc6, 0x04, 0x01, 0x07, +0xa1, 0x04, 0xca, 0x04, 0x01, 0x1b, 0xb5, 0x04, 0xcd, 0x04, 0x01, 0x0c, 0xa6, 0x04, 0xc5, 0x04, +0x01, 0x1a, 0xb4, 0x04, 0xd1, 0x04, 0x01, 0x10, 0xaa, 0x04, 0xd7, 0x04, 0x01, 0x21, 0xbb, 0x04, +0xd6, 0x04, 0x01, 0x12, 0xac, 0x04, 0x34, 0x01, 0x06, 0x9e, 0x04, 0xde, 0x04, 0x01, 0x15, 0xaf, +0x04, 0xc9, 0x04, 0x01, 0x09, 0xa3, 0x04, 0x33, 0x01, 0x05, 0x9d, 0x04, 0xd2, 0x04, 0x01, 0x11, +0xab, 0x04, 0xe0, 0x04, 0x01, 0x23, 0xbd, 0x04, 0xe4, 0x04, 0x01, 0x28, 0xc2, 0x04, 0xcc, 0x04, +0x01, 0x0b, 0xa5, 0x04, 0xce, 0x04, 0x01, 0x0d, 0xa7, 0x04, 0xdc, 0x04, 0x01, 0x1f, 0xb9, 0x04, +0xd0, 0x04, 0x01, 0x0f, 0xa9, 0x04, 0xd4, 0x04, 0x01, 0x1d, 0xb7, 0x04, 0xc4, 0x04, 0x01, 0x19, +0xb3, 0x04, 0xdb, 0x04, 0x01, 0x22, 0xbc, 0x04, 0xe6, 0x04, 0x01, 0x17, 0xb1, 0x04, 0xe1, 0x04, +0x01, 0x24, 0xbe, 0x04, 0xcb, 0x04, 0x01, 0x0a, 0xa4, 0x04, 0x9d, 0x05, 0x08, 0x0b, 0x5d, 0x00, +0xcb, 0x04, 0x04, 0x33, 0x01, 0x08, 0xca, 0x04, 0xa3, 0x05, 0x02, 0x05, 0xc7, 0x04, 0x34, 0x01, +0x07, 0xc9, 0x04, 0x35, 0x02, 0x06, 0xc8, 0x04, 0x0a, 0x08, 0x19, 0x11, 0x03, 0x0b, 0x1a, 0x11, +0x08, 0x10, 0x1b, 0x11, 0x04, 0x0c, 0x1c, 0x11, 0x06, 0x0e, 0x1d, 0x11, 0x05, 0x0d, 0x1e, 0x11, +0x07, 0x0f, 0x05, 0x06, 0x01, 0x03, 0x02, 0x03, 0x1f, 0x11, 0x09, 0x17, 0x1c, 0x01, 0x05, 0x06, +0x01, 0x03, 0x02, 0x03, 0x1f, 0x02, 0x2a, 0x11, 0x03, 0x24, 0x05, 0x06, 0x01, 0x03, 0x02, 0x03, +0x2b, 0x01, 0x05, 0x06, 0x01, 0x00, 0x03, 0x03, 0x33, 0x01, 0x05, 0x06, 0x01, 0x03, 0x02, 0x03, +0x39, 0x0b, 0x41, 0x06, 0x05, 0x02, 0x01, 0x06, 0x05, 0x06, 0x01, 0x03, 0x02, 0x03, 0x43, 0x06, +0x07, 0x03, 0x02, 0x03, 0x40, 0x06, 0x04, 0x02, 0x03, 0x06, 0x44, 0x06, 0x08, 0x03, 0x03, 0x03, +0x3f, 0x06, 0x03, 0x02, 0x04, 0x06, 0x59, 0x11, 0x04, 0x40, 0x42, 0x06, 0x06, 0x02, 0x02, 0x06, +0x45, 0x06, 0x09, 0x03, 0x05, 0x03, 0x5a, 0x11, 0x03, 0x3f, 0x3e, 0x06, 0x02, 0x02, 0x05, 0x06, +0x47, 0x03, 0x41, 0x06, 0x01, 0x03, 0x06, 0x06, 0x05, 0x06, 0x03, 0x03, 0x02, 0x03, 0x42, 0x06, +0x02, 0x03, 0x06, 0x03, 0x53, 0x03, 0x41, 0x06, 0x01, 0x78, 0x01, 0x03, 0x05, 0x06, 0x03, 0x03, +0x02, 0x03, 0x42, 0x06, 0x02, 0x78, 0x07, 0x06, 0x5f, 0x06, 0xa7, 0x01, 0x11, 0x05, 0x74, 0x05, +0x06, 0x01, 0x03, 0x02, 0x03, 0xa8, 0x01, 0x11, 0x04, 0x73, 0xa9, 0x01, 0x11, 0x06, 0x75, 0xaa, +0x01, 0x11, 0x07, 0x76, 0x90, 0x01, 0x11, 0x03, 0x72, 0x93, 0x01, 0x16, 0xb9, 0x01, 0x06, 0x01, +0x78, 0x02, 0x03, 0xee, 0x01, 0x11, 0x07, 0xac, 0x01, 0xef, 0x01, 0x11, 0x03, 0xa8, 0x01, 0xf0, +0x01, 0x11, 0x0c, 0xb1, 0x01, 0xf1, 0x01, 0x11, 0x04, 0xa9, 0x01, 0xf2, 0x01, 0x11, 0x08, 0xad, +0x01, 0xf3, 0x01, 0x11, 0x0d, 0xb2, 0x01, 0xf4, 0x01, 0x11, 0x0f, 0xb4, 0x01, 0xf5, 0x01, 0x11, +0x09, 0xae, 0x01, 0xf6, 0x01, 0x11, 0x0e, 0xb3, 0x01, 0xf7, 0x01, 0x11, 0x11, 0xb6, 0x01, 0xf8, +0x01, 0x11, 0x05, 0xaa, 0x01, 0x05, 0x06, 0x06, 0x03, 0x02, 0x03, 0xf9, 0x01, 0x11, 0x10, 0xb5, +0x01, 0xbd, 0x01, 0x06, 0x05, 0x78, 0x07, 0x03, 0xbb, 0x01, 0x06, 0x03, 0x78, 0x08, 0x03, 0xfa, +0x01, 0x11, 0x06, 0xab, 0x01, 0xfb, 0x01, 0x11, 0x12, 0xb7, 0x01, 0xbc, 0x01, 0x06, 0x04, 0x78, +0x09, 0x03, 0xfc, 0x01, 0x11, 0x0b, 0xb0, 0x01, 0xfd, 0x01, 0x11, 0x0a, 0xaf, 0x01, 0xba, 0x01, +0x06, 0x02, 0x78, 0x03, 0x03, 0xcd, 0x01, 0x00, 0xd3, 0x01, 0x1c, 0xb6, 0x02, 0x11, 0x05, 0xd6, +0x01, 0xb7, 0x02, 0x11, 0x16, 0xe7, 0x01, 0xae, 0x02, 0x06, 0x01, 0x02, 0x08, 0x06, 0xb8, 0x02, +0x11, 0x06, 0xd7, 0x01, 0xb9, 0x02, 0x11, 0x0a, 0xdb, 0x01, 0xb4, 0x02, 0x06, 0x07, 0x02, 0x0e, +0x06, 0xba, 0x02, 0x11, 0x09, 0xda, 0x01, 0xbb, 0x02, 0x11, 0x0e, 0xdf, 0x01, 0xb5, 0x02, 0x06, +0x08, 0x02, 0x0f, 0x06, 0xbc, 0x02, 0x11, 0x03, 0xd4, 0x01, 0xbd, 0x02, 0x11, 0x07, 0xd8, 0x01, +0xbe, 0x02, 0x11, 0x0f, 0xe0, 0x01, 0xbf, 0x02, 0x11, 0x12, 0xe3, 0x01, 0xc0, 0x02, 0x11, 0x0c, +0xdd, 0x01, 0xc1, 0x02, 0x11, 0x0d, 0xde, 0x01, 0xc2, 0x02, 0x11, 0x0b, 0xdc, 0x01, 0xc3, 0x02, +0x11, 0x13, 0xe4, 0x01, 0xaf, 0x02, 0x06, 0x02, 0x02, 0x09, 0x06, 0xc4, 0x02, 0x11, 0x04, 0xd5, +0x01, 0xc5, 0x02, 0x11, 0x08, 0xd9, 0x01, 0xc6, 0x02, 0x11, 0x11, 0xe2, 0x01, 0xb1, 0x02, 0x06, +0x04, 0x02, 0x0b, 0x06, 0xc7, 0x02, 0x11, 0x15, 0xe6, 0x01, 0xc8, 0x02, 0x11, 0x14, 0xe5, 0x01, +0xc9, 0x02, 0x11, 0x10, 0xe1, 0x01, 0xb0, 0x02, 0x06, 0x03, 0x02, 0x0a, 0x06, 0xb2, 0x02, 0x06, +0x05, 0x02, 0x0c, 0x06, 0xb3, 0x02, 0x06, 0x06, 0x02, 0x0d, 0x06, 0xea, 0x01, 0x03, 0xdf, 0x02, +0x11, 0x04, 0xee, 0x01, 0xe0, 0x02, 0x11, 0x03, 0xec, 0x01, 0x05, 0x06, 0x01, 0x03, 0x02, 0x03, +0xf2, 0x01, 0x01, 0x05, 0x06, 0x01, 0x03, 0x02, 0x03, 0xf4, 0x01, 0x01, 0x05, 0x06, 0x01, 0x03, +0x02, 0x03, 0xf6, 0x01, 0x01, 0x05, 0x06, 0x01, 0x03, 0x02, 0x03, 0xf8, 0x01, 0x01, 0x05, 0x06, +0x01, 0x03, 0x02, 0x03, 0xfa, 0x01, 0x01, 0x05, 0x06, 0x01, 0x03, 0x02, 0x03, 0xfc, 0x01, 0x01, +0x05, 0x06, 0x01, 0x03, 0x02, 0x03, 0xfe, 0x01, 0x01, 0x05, 0x06, 0x01, 0x03, 0x02, 0x03, 0x80, +0x02, 0x01, 0x05, 0x06, 0x01, 0x03, 0x02, 0x03, 0x82, 0x02, 0x01, 0x05, 0x06, 0x01, 0x03, 0x02, +0x03, 0x84, 0x02, 0x01, 0x05, 0x06, 0x01, 0x03, 0x02, 0x03, 0x86, 0x02, 0x01, 0x05, 0x06, 0x01, +0x03, 0x02, 0x03, 0x89, 0x02, 0x01, 0x05, 0x06, 0x01, 0x03, 0x02, 0x03, 0x99, 0x02, 0x03, 0xf4, +0x03, 0x11, 0x04, 0xc4, 0x02, 0xf5, 0x03, 0x11, 0x03, 0xc3, 0x02, 0x05, 0x06, 0x01, 0x03, 0x0a, +0x03, 0x95, 0x03, 0x0e, 0xc0, 0x04, 0x11, 0x0d, 0xc9, 0x03, 0xe8, 0x04, 0x13, 0x0c, 0xc8, 0x03, +0xc1, 0x04, 0x11, 0x0e, 0xca, 0x03, 0xe9, 0x04, 0x12, 0x03, 0xbf, 0x03, 0xe8, 0x04, 0x12, 0x0b, +0xc7, 0x03, 0xea, 0x04, 0x12, 0x05, 0xc1, 0x03, 0xeb, 0x04, 0x12, 0x09, 0xc5, 0x03, 0x05, 0x06, +0x01, 0x00, 0x02, 0x03, 0xec, 0x04, 0x12, 0x07, 0xc3, 0x03, 0xe9, 0x04, 0x13, 0x04, 0xc0, 0x03, +0xea, 0x04, 0x13, 0x06, 0xc2, 0x03, 0xeb, 0x04, 0x13, 0x0a, 0xc6, 0x03, 0xc2, 0x04, 0x11, 0x0f, +0xcb, 0x03, 0xec, 0x04, 0x13, 0x08, 0xc4, 0x03, 0xf6, 0x03, 0x01, 0x05, 0x06, 0x01, 0x00, 0x02, +0x03, 0xc5, 0x04, 0x01, 0x05, 0x06, 0x01, 0x00, 0x03, 0x03, 0x06, 0xe9, 0x01, 0x01, 0xca, 0x02, +0x04, 0x01, 0x0b, 0x88, 0x02, 0x0c, 0xf4, 0x02, 0x04, 0x06, 0x11, 0xfd, 0x02, 0x04, 0x09, 0x14, +0xf1, 0x02, 0x04, 0x05, 0x10, 0x86, 0x03, 0x04, 0x0c, 0x17, 0xeb, 0x02, 0x04, 0x03, 0x0e, 0xf7, +0x02, 0x04, 0x07, 0x12, 0x83, 0x03, 0x04, 0x0b, 0x16, 0xfa, 0x02, 0x04, 0x08, 0x13, 0xe8, 0x02, +0x04, 0x02, 0x0d, 0xdd, 0x02, 0x04, 0x01, 0x0c, 0xee, 0x02, 0x04, 0x04, 0x0f, 0x80, 0x03, 0x04, +0x0a, 0x15, 0x98, 0x02, 0x01, 0xd6, 0x02, 0x04, 0x01, 0x18, 0x93, 0x03, 0x01, 0xc9, 0x03, 0x04, +0x01, 0x19, 0xcc, 0x04, 0x04, 0xc7, 0x04, 0x04, 0x02, 0x1b, 0xc3, 0x04, 0x04, 0x01, 0x1a, 0xa5, +0x05, 0x01, 0x0b, 0x94, 0x03, 0x9d, 0x05, 0x04, 0x03, 0x1c, 0xd2, 0x01, 0x19, 0xa3, 0x02, 0x01, +0x05, 0x05, 0xa4, 0x02, 0x06, 0x00, 0x00, 0x07, 0x08, 0x04, 0x04, 0x00, 0x04, 0x30, 0x04, 0x00, +0x03, 0xa5, 0x02, 0x01, 0x08, 0x02, 0xa0, 0x02, 0x06, 0x00, 0x02, 0x03, 0x06, 0xa6, 0x02, 0x01, +0x06, 0x04, 0x21, 0x04, 0x00, 0x01, 0x78, 0x04, 0x00, 0x07, 0x3e, 0x06, 0x00, 0x02, 0x05, 0x06, +0x08, 0x04, 0x00, 0x00, 0xa7, 0x02, 0x01, 0x0a, 0x00, 0xa8, 0x02, 0x01, 0x09, 0x01, 0xa9, 0x02, +0x01, 0x01, 0x09, 0xaa, 0x02, 0x01, 0x04, 0x06, 0xa2, 0x02, 0x06, 0x00, 0x00, 0x00, 0x02, 0x04, +0x00, 0x05, 0x03, 0x04, 0x00, 0x06, 0x01, 0x04, 0x00, 0x08, 0x28, 0x04, 0x00, 0x02, 0x8f, 0x01, +0x04, 0x00, 0x09, 0x8f, 0x02, 0x04, 0x00, 0x0a, 0xab, 0x02, 0x01, 0x07, 0x03, 0xac, 0x02, 0x01, +0x03, 0x07, 0xad, 0x02, 0x01, 0x02, 0x08, 0xe9, 0x02, 0x0a, 0x02, 0x01, 0x02, 0x03, 0x09, 0xd0, +0x30, 0x5e, 0x05, 0x24, 0x01, 0x68, 0x05, 0x47, 0x00, 0x00, 0x10, 0x04, 0x05, 0x02, 0x03, 0x2c, +0xd0, 0x30, 0x20, 0x85, 0xd6, 0x24, 0x00, 0xd7, 0xd1, 0x82, 0x63, 0x04, 0x10, 0x10, 0x00, 0x00, +0x09, 0x62, 0x04, 0xd3, 0x1e, 0x85, 0xd6, 0x5d, 0x07, 0xd1, 0xd2, 0x27, 0x46, 0x07, 0x03, 0x29, +0x32, 0x04, 0x03, 0x11, 0xe9, 0xff, 0xff, 0x08, 0x04, 0x08, 0x03, 0x47, 0x00, 0x00, 0x11, 0x02, +0x02, 0x03, 0x03, 0x06, 0xd0, 0xd1, 0x46, 0x09, 0x01, 0x48, 0x00, 0x00, 0x12, 0x02, 0x02, 0x03, +0x03, 0x06, 0xd0, 0xd1, 0x46, 0x0a, 0x01, 0x48, 0x00, 0x00, 0x13, 0x04, 0x03, 0x03, 0x03, 0x0a, +0x5d, 0x07, 0xd0, 0xd1, 0xd2, 0x46, 0x07, 0x03, 0x29, 0x47, 0x00, 0x00, 0x14, 0x02, 0x02, 0x03, +0x03, 0x06, 0xd0, 0xd1, 0x46, 0x0b, 0x01, 0x48, 0x00, 0x00, 0x15, 0x02, 0x01, 0x03, 0x03, 0x07, +0x5d, 0x0c, 0xd0, 0x46, 0x0c, 0x01, 0x48, 0x00, 0x00, 0x16, 0x01, 0x01, 0x03, 0x03, 0x02, 0xd0, +0x48, 0x00, 0x00, 0x17, 0x04, 0x03, 0x03, 0x05, 0x4c, 0xd0, 0x30, 0x57, 0x2a, 0xd5, 0x30, 0x5d, +0x0d, 0x66, 0x0d, 0x40, 0x11, 0x61, 0x0e, 0x5d, 0x0d, 0x66, 0x0d, 0x40, 0x12, 0x61, 0x0f, 0x5d, +0x0d, 0x66, 0x0d, 0x40, 0x13, 0x61, 0x10, 0x5d, 0x0d, 0x66, 0x0d, 0x40, 0x14, 0x61, 0x11, 0x5d, +0x0d, 0x66, 0x0d, 0x5d, 0x0d, 0x66, 0x0d, 0x40, 0x15, 0x2a, 0xd6, 0x61, 0x12, 0xd2, 0x08, 0x02, +0x61, 0x13, 0x5d, 0x0d, 0x66, 0x0d, 0x40, 0x16, 0x61, 0x14, 0x5d, 0x15, 0x5d, 0x0d, 0x66, 0x0d, +0x46, 0x15, 0x01, 0x29, 0x47, 0x00, 0x00, 0x18, 0x03, 0x02, 0x03, 0x04, 0x0a, 0xd0, 0x30, 0x5d, +0x16, 0xd0, 0xd1, 0x46, 0x16, 0x02, 0x48, 0x00, 0x00, 0x19, 0x03, 0x02, 0x03, 0x04, 0x0a, 0xd0, +0x30, 0x5d, 0x17, 0xd0, 0xd1, 0x46, 0x17, 0x02, 0x48, 0x00, 0x00, 0x1a, 0x03, 0x02, 0x03, 0x04, +0x0a, 0xd0, 0x30, 0x5d, 0x18, 0xd0, 0xd1, 0x46, 0x18, 0x02, 0x48, 0x00, 0x00, 0x1b, 0x01, 0x01, +0x03, 0x04, 0x03, 0xd0, 0x30, 0x47, 0x00, 0x00, 0x1c, 0x02, 0x01, 0x03, 0x04, 0x09, 0xd0, 0x30, +0x5e, 0x05, 0x24, 0x01, 0x68, 0x05, 0x47, 0x00, 0x00, 0x1e, 0x01, 0x01, 0x04, 0x05, 0x06, 0xd0, +0x30, 0xd0, 0x49, 0x00, 0x47, 0x00, 0x00, 0x1f, 0x04, 0x02, 0x03, 0x04, 0x36, 0xd0, 0x30, 0x5e, +0x05, 0x24, 0x01, 0x68, 0x05, 0x5d, 0x22, 0x66, 0x22, 0x5d, 0x22, 0x66, 0x22, 0x40, 0x20, 0x2a, +0xd5, 0x61, 0x23, 0xd1, 0x08, 0x01, 0x61, 0x24, 0x5d, 0x22, 0x66, 0x22, 0x40, 0x21, 0x61, 0x25, +0x5d, 0x22, 0x66, 0x22, 0x40, 0x22, 0x61, 0x26, 0x5d, 0x27, 0x5d, 0x22, 0x66, 0x22, 0x46, 0x27, +0x01, 0x29, 0x47, 0x00, 0x00, 0x23, 0x00, 0x01, 0x04, 0x04, 0x01, 0x47, 0x00, 0x00, 0x24, 0x02, +0x02, 0x04, 0x06, 0x09, 0xd0, 0x30, 0x57, 0x2a, 0xd5, 0x30, 0x40, 0x23, 0x48, 0x00, 0x00, 0x20, +0x01, 0x02, 0x03, 0x03, 0x09, 0x21, 0x82, 0xd5, 0xd0, 0x82, 0xd5, 0x2c, 0x20, 0x48, 0x00, 0x00, +0x21, 0x03, 0x04, 0x03, 0x03, 0x0f, 0x20, 0x80, 0x28, 0xd7, 0xd0, 0x80, 0x28, 0xd7, 0xd3, 0xd1, +0xd2, 0x46, 0x29, 0x02, 0x48, 0x00, 0x00, 0x22, 0x03, 0x04, 0x03, 0x03, 0x0f, 0x20, 0x80, 0x28, +0xd7, 0xd0, 0x80, 0x28, 0xd7, 0xd3, 0xd1, 0xd2, 0x46, 0x29, 0x02, 0x48, 0x00, 0x00, 0x2a, 0x01, +0x01, 0x04, 0x05, 0x06, 0xd0, 0x30, 0xd0, 0x49, 0x00, 0x47, 0x00, 0x00, 0x2b, 0x02, 0x01, 0x03, +0x04, 0x23, 0xd0, 0x30, 0x5e, 0x05, 0x24, 0x02, 0x68, 0x05, 0x5d, 0x2c, 0x66, 0x2c, 0x40, 0x2c, +0x61, 0x2d, 0x5d, 0x2c, 0x66, 0x2c, 0x40, 0x2d, 0x61, 0x2e, 0x5d, 0x2f, 0x5d, 0x2c, 0x66, 0x2c, +0x46, 0x2f, 0x01, 0x29, 0x47, 0x00, 0x00, 0x2c, 0x02, 0x02, 0x03, 0x03, 0x18, 0x20, 0x80, 0x30, +0xd5, 0xd0, 0x5d, 0x2c, 0x66, 0x2c, 0x1a, 0x03, 0x00, 0x00, 0x2c, 0x01, 0x48, 0xd0, 0x80, 0x30, +0xd5, 0xd1, 0x66, 0x31, 0x48, 0x00, 0x00, 0x2d, 0x02, 0x02, 0x03, 0x03, 0x18, 0x20, 0x80, 0x30, +0xd5, 0xd0, 0x5d, 0x2c, 0x66, 0x2c, 0x1a, 0x03, 0x00, 0x00, 0x2c, 0x01, 0x48, 0xd0, 0x80, 0x30, +0xd5, 0xd1, 0x66, 0x31, 0x48, 0x00, 0x00, 0x30, 0x01, 0x01, 0x04, 0x05, 0x07, 0xd0, 0x30, 0x5d, +0x31, 0x66, 0x31, 0x48, 0x00, 0x00, 0x31, 0x01, 0x01, 0x04, 0x05, 0x07, 0xd0, 0x30, 0x5d, 0x31, +0x66, 0x31, 0x48, 0x00, 0x00, 0x32, 0x01, 0x03, 0x04, 0x05, 0x06, 0xd0, 0x30, 0xd0, 0x49, 0x00, +0x47, 0x00, 0x00, 0x33, 0x02, 0x01, 0x03, 0x04, 0x23, 0xd0, 0x30, 0x5e, 0x05, 0x24, 0x01, 0x68, +0x05, 0x5d, 0x36, 0x66, 0x36, 0x40, 0x34, 0x61, 0x37, 0x5d, 0x36, 0x66, 0x36, 0x40, 0x35, 0x61, +0x38, 0x5d, 0x39, 0x5d, 0x36, 0x66, 0x36, 0x46, 0x39, 0x01, 0x29, 0x47, 0x00, 0x00, 0x34, 0x04, +0x01, 0x03, 0x03, 0x39, 0xd0, 0x5d, 0x36, 0x66, 0x36, 0x1a, 0x03, 0x00, 0x00, 0x2c, 0x25, 0x48, +0xd0, 0x5d, 0x3a, 0x66, 0x3a, 0xb3, 0x96, 0x12, 0x11, 0x00, 0x00, 0x5d, 0x3b, 0x66, 0x3b, 0x5d, +0x3c, 0x66, 0x3c, 0x25, 0xec, 0x07, 0x2c, 0x28, 0x46, 0x3d, 0x03, 0x29, 0xd0, 0x76, 0x12, 0x07, +0x00, 0x00, 0x2c, 0x2a, 0x85, 0x10, 0x03, 0x00, 0x00, 0x2c, 0x25, 0x85, 0x48, 0x00, 0x00, 0x35, +0x04, 0x01, 0x03, 0x03, 0x29, 0xd0, 0x5d, 0x36, 0x66, 0x36, 0x1a, 0x02, 0x00, 0x00, 0x27, 0x48, +0xd0, 0x5d, 0x3a, 0x66, 0x3a, 0xb3, 0x96, 0x12, 0x11, 0x00, 0x00, 0x5d, 0x3b, 0x66, 0x3b, 0x5d, +0x3c, 0x66, 0x3c, 0x25, 0xec, 0x07, 0x2c, 0x2b, 0x46, 0x3d, 0x03, 0x29, 0xd0, 0x48, 0x00, 0x00, +0x36, 0x01, 0x01, 0x04, 0x05, 0x12, 0xd0, 0x30, 0xd0, 0x12, 0x07, 0x00, 0x00, 0x2c, 0x2a, 0x85, +0x10, 0x03, 0x00, 0x00, 0x2c, 0x25, 0x85, 0x48, 0x00, 0x00, 0x37, 0x01, 0x01, 0x04, 0x05, 0x04, +0xd0, 0x30, 0xd0, 0x48, 0x00, 0x00, 0x38, 0x01, 0x02, 0x04, 0x05, 0x06, 0xd0, 0x30, 0xd0, 0x49, +0x00, 0x47, 0x00, 0x00, 0x39, 0x04, 0x02, 0x03, 0x04, 0x7f, 0xd0, 0x30, 0x5e, 0x05, 0x24, 0x01, +0x68, 0x05, 0x5e, 0x3e, 0x24, 0x00, 0x24, 0x00, 0xa3, 0x68, 0x3e, 0x5e, 0x3f, 0x24, 0xff, 0x24, +0x00, 0xa3, 0x68, 0x3f, 0x5e, 0x40, 0x24, 0x01, 0x24, 0x00, 0xa3, 0x68, 0x40, 0x5e, 0x41, 0x2f, +0x01, 0x68, 0x41, 0x5e, 0x42, 0x2f, 0x02, 0x68, 0x42, 0x5e, 0x43, 0x24, 0x01, 0x68, 0x43, 0x5e, +0x44, 0x24, 0x02, 0x68, 0x44, 0x5e, 0x45, 0x24, 0x03, 0x68, 0x45, 0x5d, 0x46, 0x66, 0x46, 0x5d, +0x46, 0x66, 0x46, 0x40, 0x3a, 0x2a, 0xd5, 0x61, 0x47, 0xd1, 0x08, 0x01, 0x61, 0x48, 0x5d, 0x46, +0x66, 0x46, 0x40, 0x3b, 0x61, 0x49, 0x5d, 0x46, 0x66, 0x46, 0x40, 0x3c, 0x61, 0x4a, 0x5d, 0x46, +0x66, 0x46, 0x40, 0x3d, 0x61, 0x4b, 0x5d, 0x46, 0x66, 0x46, 0x40, 0x3e, 0x61, 0x4c, 0x5d, 0x4d, +0x5d, 0x46, 0x66, 0x46, 0x46, 0x4d, 0x01, 0x29, 0x47, 0x00, 0x00, 0x3a, 0x04, 0x02, 0x03, 0x03, +0x30, 0xd0, 0x5d, 0x46, 0x66, 0x46, 0x1a, 0x03, 0x00, 0x00, 0x2c, 0x36, 0x48, 0xd0, 0x5d, 0x4e, +0x66, 0x4e, 0xb3, 0x96, 0x12, 0x11, 0x00, 0x00, 0x5d, 0x4f, 0x66, 0x4f, 0x5d, 0x50, 0x66, 0x50, +0x25, 0xec, 0x07, 0x2c, 0x37, 0x46, 0x51, 0x03, 0x29, 0x5d, 0x52, 0xd0, 0xd1, 0x46, 0x52, 0x02, +0x48, 0x00, 0x00, 0x3b, 0x04, 0x01, 0x03, 0x03, 0x2a, 0xd0, 0x5d, 0x46, 0x66, 0x46, 0x1a, 0x03, +0x00, 0x00, 0x24, 0x00, 0x48, 0xd0, 0x5d, 0x4e, 0x66, 0x4e, 0xb3, 0x96, 0x12, 0x11, 0x00, 0x00, +0x5d, 0x4f, 0x66, 0x4f, 0x5d, 0x50, 0x66, 0x50, 0x25, 0xec, 0x07, 0x2c, 0x38, 0x46, 0x51, 0x03, +0x29, 0xd0, 0x48, 0x00, 0x00, 0x3c, 0x04, 0x02, 0x03, 0x03, 0x16, 0x5d, 0x53, 0x5d, 0x4e, 0xd0, +0x46, 0x4e, 0x01, 0x5d, 0x54, 0xd1, 0x46, 0x54, 0x01, 0x5d, 0x55, 0x66, 0x55, 0x46, 0x53, 0x03, +0x48, 0x00, 0x00, 0x3d, 0x04, 0x02, 0x03, 0x03, 0x24, 0xd1, 0x5d, 0x56, 0x66, 0x56, 0x14, 0x05, +0x00, 0x00, 0xd0, 0x46, 0x47, 0x00, 0x48, 0x5d, 0x53, 0x5d, 0x4e, 0xd0, 0x46, 0x4e, 0x01, 0x5d, +0x54, 0xd1, 0x46, 0x54, 0x01, 0x5d, 0x57, 0x66, 0x57, 0x46, 0x53, 0x03, 0x48, 0x00, 0x00, 0x3e, +0x04, 0x02, 0x03, 0x03, 0x16, 0x5d, 0x53, 0x5d, 0x4e, 0xd0, 0x46, 0x4e, 0x01, 0x5d, 0x54, 0xd1, +0x46, 0x54, 0x01, 0x5d, 0x58, 0x66, 0x58, 0x46, 0x53, 0x03, 0x48, 0x00, 0x00, 0x41, 0x03, 0x02, +0x04, 0x05, 0x0a, 0xd0, 0x30, 0x5d, 0x52, 0xd0, 0xd1, 0x46, 0x52, 0x02, 0x48, 0x00, 0x00, 0x42, +0x01, 0x01, 0x04, 0x05, 0x04, 0xd0, 0x30, 0xd0, 0x48, 0x00, 0x00, 0x43, 0x04, 0x02, 0x04, 0x05, +0x13, 0xd0, 0x30, 0x5d, 0x53, 0xd0, 0x5d, 0x54, 0xd1, 0x46, 0x54, 0x01, 0x5d, 0x55, 0x66, 0x55, +0x46, 0x53, 0x03, 0x48, 0x00, 0x00, 0x44, 0x04, 0x02, 0x04, 0x05, 0x21, 0xd0, 0x30, 0xd1, 0x5d, +0x56, 0x66, 0x56, 0x14, 0x05, 0x00, 0x00, 0xd0, 0x46, 0x47, 0x00, 0x48, 0x5d, 0x53, 0xd0, 0x5d, +0x54, 0xd1, 0x46, 0x54, 0x01, 0x5d, 0x57, 0x66, 0x57, 0x46, 0x53, 0x03, 0x48, 0x00, 0x00, 0x45, +0x04, 0x02, 0x04, 0x05, 0x13, 0xd0, 0x30, 0x5d, 0x53, 0xd0, 0x5d, 0x54, 0xd1, 0x46, 0x54, 0x01, +0x5d, 0x58, 0x66, 0x58, 0x46, 0x53, 0x03, 0x48, 0x00, 0x00, 0x46, 0x01, 0x02, 0x04, 0x05, 0x06, +0xd0, 0x30, 0xd0, 0x49, 0x00, 0x47, 0x00, 0x00, 0x47, 0x04, 0x02, 0x03, 0x04, 0x52, 0xd0, 0x30, +0x5e, 0x41, 0x2f, 0x06, 0x68, 0x41, 0x5e, 0x42, 0x2d, 0x06, 0x68, 0x42, 0x5e, 0x05, 0x24, 0x01, +0x68, 0x05, 0x5d, 0x5e, 0x66, 0x5e, 0x5d, 0x5e, 0x66, 0x5e, 0x40, 0x48, 0x2a, 0xd5, 0x61, 0x5f, +0xd1, 0x08, 0x01, 0x61, 0x60, 0x5d, 0x5e, 0x66, 0x5e, 0x40, 0x49, 0x61, 0x61, 0x5d, 0x5e, 0x66, +0x5e, 0x40, 0x4a, 0x61, 0x62, 0x5d, 0x5e, 0x66, 0x5e, 0x40, 0x4b, 0x61, 0x63, 0x5d, 0x5e, 0x66, +0x5e, 0x40, 0x4c, 0x61, 0x64, 0x5d, 0x65, 0x5d, 0x5e, 0x66, 0x5e, 0x46, 0x65, 0x01, 0x29, 0x47, +0x00, 0x00, 0x48, 0x04, 0x03, 0x03, 0x03, 0x3a, 0x21, 0x82, 0xd6, 0x40, 0x48, 0x82, 0xd6, 0xd0, +0x5d, 0x5e, 0x66, 0x5e, 0x1a, 0x03, 0x00, 0x00, 0x2c, 0x36, 0x48, 0xd0, 0x5d, 0x66, 0x66, 0x66, +0xb3, 0x96, 0x12, 0x11, 0x00, 0x00, 0x5d, 0x67, 0x66, 0x67, 0x5d, 0x68, 0x66, 0x68, 0x25, 0xec, +0x07, 0x2c, 0x3a, 0x46, 0x69, 0x03, 0x29, 0x5d, 0x6a, 0xd0, 0x46, 0x6a, 0x01, 0xd1, 0x46, 0x5f, +0x01, 0x48, 0x00, 0x00, 0x49, 0x04, 0x01, 0x03, 0x03, 0x2a, 0xd0, 0x5d, 0x5e, 0x66, 0x5e, 0x1a, +0x03, 0x00, 0x00, 0x24, 0x00, 0x48, 0xd0, 0x5d, 0x66, 0x66, 0x66, 0xb3, 0x96, 0x12, 0x11, 0x00, +0x00, 0x5d, 0x67, 0x66, 0x67, 0x5d, 0x68, 0x66, 0x68, 0x25, 0xec, 0x07, 0x2c, 0x3b, 0x46, 0x69, +0x03, 0x29, 0xd0, 0x48, 0x00, 0x00, 0x4a, 0x02, 0x02, 0x03, 0x03, 0x0b, 0x5d, 0x6a, 0xd0, 0x46, +0x6a, 0x01, 0xd1, 0x46, 0x5d, 0x01, 0x48, 0x00, 0x00, 0x4b, 0x02, 0x02, 0x03, 0x03, 0x0b, 0x5d, +0x6a, 0xd0, 0x46, 0x6a, 0x01, 0xd1, 0x46, 0x5b, 0x01, 0x48, 0x00, 0x00, 0x4c, 0x02, 0x02, 0x03, +0x03, 0x0b, 0x5d, 0x6a, 0xd0, 0x46, 0x6a, 0x01, 0xd1, 0x46, 0x5c, 0x01, 0x48, 0x00, 0x00, 0x4d, +0x02, 0x02, 0x04, 0x05, 0x0d, 0xd0, 0x30, 0x5d, 0x6a, 0xd0, 0x46, 0x6a, 0x01, 0xd1, 0x46, 0x33, +0x01, 0x48, 0x00, 0x00, 0x4e, 0x01, 0x01, 0x04, 0x05, 0x04, 0xd0, 0x30, 0xd0, 0x48, 0x00, 0x00, +0x4f, 0x02, 0x02, 0x04, 0x05, 0x0d, 0xd0, 0x30, 0x5d, 0x6a, 0xd0, 0x46, 0x6a, 0x01, 0xd1, 0x46, +0x5d, 0x01, 0x48, 0x00, 0x00, 0x50, 0x02, 0x02, 0x04, 0x05, 0x0d, 0xd0, 0x30, 0x5d, 0x6a, 0xd0, +0x46, 0x6a, 0x01, 0xd1, 0x46, 0x5b, 0x01, 0x48, 0x00, 0x00, 0x51, 0x02, 0x02, 0x04, 0x05, 0x0d, +0xd0, 0x30, 0x5d, 0x6a, 0xd0, 0x46, 0x6a, 0x01, 0xd1, 0x46, 0x5c, 0x01, 0x48, 0x00, 0x00, 0x52, +0x01, 0x02, 0x04, 0x05, 0x06, 0xd0, 0x30, 0xd0, 0x49, 0x00, 0x47, 0x00, 0x00, 0x53, 0x04, 0x02, +0x03, 0x04, 0x52, 0xd0, 0x30, 0x5e, 0x41, 0x24, 0x00, 0x68, 0x41, 0x5e, 0x42, 0x2f, 0x07, 0x68, +0x42, 0x5e, 0x05, 0x24, 0x01, 0x68, 0x05, 0x5d, 0x6b, 0x66, 0x6b, 0x5d, 0x6b, 0x66, 0x6b, 0x40, +0x54, 0x2a, 0xd5, 0x61, 0x6c, 0xd1, 0x08, 0x01, 0x61, 0x6d, 0x5d, 0x6b, 0x66, 0x6b, 0x40, 0x55, +0x61, 0x6e, 0x5d, 0x6b, 0x66, 0x6b, 0x40, 0x56, 0x61, 0x6f, 0x5d, 0x6b, 0x66, 0x6b, 0x40, 0x57, +0x61, 0x70, 0x5d, 0x6b, 0x66, 0x6b, 0x40, 0x58, 0x61, 0x71, 0x5d, 0x72, 0x5d, 0x6b, 0x66, 0x6b, +0x46, 0x72, 0x01, 0x29, 0x47, 0x00, 0x00, 0x54, 0x04, 0x03, 0x03, 0x03, 0x3a, 0x21, 0x82, 0xd6, +0x40, 0x54, 0x82, 0xd6, 0xd0, 0x5d, 0x6b, 0x66, 0x6b, 0x1a, 0x03, 0x00, 0x00, 0x2c, 0x36, 0x48, +0xd0, 0x5d, 0x73, 0x66, 0x73, 0xb3, 0x96, 0x12, 0x11, 0x00, 0x00, 0x5d, 0x74, 0x66, 0x74, 0x5d, +0x75, 0x66, 0x75, 0x25, 0xec, 0x07, 0x2c, 0x3d, 0x46, 0x76, 0x03, 0x29, 0x5d, 0x73, 0xd0, 0x46, +0x73, 0x01, 0xd1, 0x46, 0x6c, 0x01, 0x48, 0x00, 0x00, 0x55, 0x04, 0x01, 0x03, 0x03, 0x2a, 0xd0, +0x5d, 0x6b, 0x66, 0x6b, 0x1a, 0x03, 0x00, 0x00, 0x24, 0x00, 0x48, 0xd0, 0x5d, 0x77, 0x66, 0x77, +0xb3, 0x96, 0x12, 0x11, 0x00, 0x00, 0x5d, 0x74, 0x66, 0x74, 0x5d, 0x75, 0x66, 0x75, 0x25, 0xec, +0x07, 0x2c, 0x3e, 0x46, 0x76, 0x03, 0x29, 0xd0, 0x48, 0x00, 0x00, 0x56, 0x02, 0x02, 0x03, 0x03, +0x0b, 0x5d, 0x73, 0xd0, 0x46, 0x73, 0x01, 0xd1, 0x46, 0x5d, 0x01, 0x48, 0x00, 0x00, 0x57, 0x02, +0x02, 0x03, 0x03, 0x0b, 0x5d, 0x73, 0xd0, 0x46, 0x73, 0x01, 0xd1, 0x46, 0x5b, 0x01, 0x48, 0x00, +0x00, 0x58, 0x02, 0x02, 0x03, 0x03, 0x0b, 0x5d, 0x73, 0xd0, 0x46, 0x73, 0x01, 0xd1, 0x46, 0x5c, +0x01, 0x48, 0x00, 0x00, 0x59, 0x02, 0x02, 0x04, 0x05, 0x0d, 0xd0, 0x30, 0x5d, 0x73, 0xd0, 0x46, +0x73, 0x01, 0xd1, 0x46, 0x33, 0x01, 0x48, 0x00, 0x00, 0x5a, 0x01, 0x01, 0x04, 0x05, 0x04, 0xd0, +0x30, 0xd0, 0x48, 0x00, 0x00, 0x5b, 0x02, 0x02, 0x04, 0x05, 0x0d, 0xd0, 0x30, 0x5d, 0x73, 0xd0, +0x46, 0x73, 0x01, 0xd1, 0x46, 0x5d, 0x01, 0x48, 0x00, 0x00, 0x5c, 0x02, 0x02, 0x04, 0x05, 0x0d, +0xd0, 0x30, 0x5d, 0x73, 0xd0, 0x46, 0x73, 0x01, 0xd1, 0x46, 0x5b, 0x01, 0x48, 0x00, 0x00, 0x5d, +0x02, 0x02, 0x04, 0x05, 0x0d, 0xd0, 0x30, 0x5d, 0x73, 0xd0, 0x46, 0x73, 0x01, 0xd1, 0x46, 0x5c, +0x01, 0x48, 0x00, 0x00, 0x5e, 0x01, 0x02, 0x04, 0x05, 0x06, 0xd0, 0x30, 0xd0, 0x49, 0x00, 0x47, +0x00, 0x00, 0x5f, 0x04, 0x02, 0x03, 0x04, 0xc6, 0x01, 0xd0, 0x30, 0x5e, 0x05, 0x24, 0x01, 0x68, +0x05, 0xd0, 0x40, 0x60, 0x61, 0x79, 0x5d, 0x7a, 0x66, 0x7a, 0x40, 0x61, 0x61, 0x7b, 0x5d, 0x7a, +0x66, 0x7a, 0x40, 0x62, 0x61, 0x7c, 0x5d, 0x7a, 0x66, 0x7a, 0x40, 0x63, 0x61, 0x7d, 0x5d, 0x7a, +0x66, 0x7a, 0x40, 0x64, 0x61, 0x7e, 0x5d, 0x7a, 0x66, 0x7a, 0x40, 0x65, 0x61, 0x7f, 0x5d, 0x7a, +0x66, 0x7a, 0x40, 0x66, 0x61, 0x80, 0x01, 0x5d, 0x7a, 0x66, 0x7a, 0x40, 0x67, 0x61, 0x81, 0x01, +0x5d, 0x7a, 0x66, 0x7a, 0x40, 0x68, 0x61, 0x82, 0x01, 0x5d, 0x7a, 0x66, 0x7a, 0x40, 0x69, 0x61, +0x83, 0x01, 0x5d, 0x7a, 0x66, 0x7a, 0x40, 0x6a, 0x61, 0x84, 0x01, 0x5d, 0x7a, 0x66, 0x7a, 0x40, +0x6b, 0x61, 0x85, 0x01, 0x5d, 0x7a, 0x66, 0x7a, 0x40, 0x6c, 0x61, 0x86, 0x01, 0x5d, 0x7a, 0x66, +0x7a, 0x40, 0x6d, 0x61, 0x87, 0x01, 0x5d, 0x7a, 0x66, 0x7a, 0x5d, 0x7a, 0x66, 0x7a, 0x40, 0x6e, +0x2a, 0xd5, 0x61, 0x88, 0x01, 0xd1, 0x08, 0x01, 0x61, 0x89, 0x01, 0x5d, 0x7a, 0x66, 0x7a, 0x5d, +0x7a, 0x66, 0x7a, 0x40, 0x6f, 0x2a, 0xd5, 0x61, 0x8a, 0x01, 0xd1, 0x08, 0x01, 0x61, 0x8b, 0x01, +0x5d, 0x7a, 0x66, 0x7a, 0x40, 0x70, 0x61, 0x8c, 0x01, 0x5d, 0x7a, 0x66, 0x7a, 0x40, 0x71, 0x61, +0x8d, 0x01, 0x5d, 0x8e, 0x01, 0x5d, 0x7a, 0x66, 0x7a, 0x46, 0x8e, 0x01, 0x01, 0x29, 0x47, 0x00, +0x00, 0x60, 0x03, 0x02, 0x03, 0x03, 0x12, 0x5d, 0x90, 0x01, 0x66, 0x90, 0x01, 0x5d, 0x91, 0x01, +0x66, 0x91, 0x01, 0xd1, 0x46, 0x92, 0x01, 0x02, 0x48, 0x00, 0x00, 0x61, 0x03, 0x03, 0x03, 0x03, +0x0f, 0x5d, 0x91, 0x01, 0xd0, 0x46, 0x91, 0x01, 0x01, 0xd1, 0xd2, 0x46, 0x93, 0x01, 0x02, 0x48, +0x00, 0x00, 0x62, 0x03, 0x03, 0x03, 0x03, 0x0f, 0x5d, 0x91, 0x01, 0xd0, 0x46, 0x91, 0x01, 0x01, +0xd1, 0xd2, 0x46, 0x94, 0x01, 0x02, 0x48, 0x00, 0x00, 0x63, 0x02, 0x02, 0x03, 0x03, 0x0e, 0x5d, +0x91, 0x01, 0xd0, 0x46, 0x91, 0x01, 0x01, 0xd1, 0x46, 0x95, 0x01, 0x01, 0x48, 0x00, 0x00, 0x64, +0x02, 0x02, 0x03, 0x03, 0x0e, 0x5d, 0x91, 0x01, 0xd0, 0x46, 0x91, 0x01, 0x01, 0xd1, 0x46, 0x96, +0x01, 0x01, 0x48, 0x00, 0x00, 0x65, 0x04, 0x05, 0x03, 0x03, 0x43, 0x20, 0x85, 0xd6, 0x24, 0x00, +0x74, 0xd7, 0x24, 0x00, 0x74, 0x63, 0x04, 0x5d, 0x91, 0x01, 0xd0, 0x46, 0x91, 0x01, 0x01, 0x85, +0xd6, 0x24, 0x00, 0x74, 0xd7, 0xd1, 0x66, 0x97, 0x01, 0x74, 0x63, 0x04, 0x10, 0x15, 0x00, 0x00, +0x09, 0xd2, 0x5d, 0x91, 0x01, 0xd1, 0xd3, 0x66, 0x98, 0x01, 0x46, 0x91, 0x01, 0x01, 0xa0, 0x85, +0xd6, 0xd3, 0x91, 0x74, 0xd7, 0xd3, 0x62, 0x04, 0x15, 0xe4, 0xff, 0xff, 0xd2, 0x48, 0x00, 0x00, +0x66, 0x02, 0x02, 0x03, 0x03, 0x0e, 0x5d, 0x91, 0x01, 0xd0, 0x46, 0x91, 0x01, 0x01, 0xd1, 0x46, +0x99, 0x01, 0x01, 0x48, 0x00, 0x00, 0x67, 0x03, 0x02, 0x03, 0x03, 0x11, 0x5d, 0x9a, 0x01, 0x5d, +0x91, 0x01, 0xd0, 0x46, 0x91, 0x01, 0x01, 0xd1, 0x46, 0x9a, 0x01, 0x02, 0x48, 0x00, 0x00, 0x68, +0x04, 0x03, 0x03, 0x03, 0x12, 0x5d, 0x9b, 0x01, 0x5d, 0x91, 0x01, 0xd0, 0x46, 0x91, 0x01, 0x01, +0xd1, 0xd2, 0x46, 0x9b, 0x01, 0x03, 0x48, 0x00, 0x00, 0x69, 0x03, 0x02, 0x03, 0x03, 0x11, 0x5d, +0x9c, 0x01, 0x5d, 0x91, 0x01, 0xd0, 0x46, 0x91, 0x01, 0x01, 0xd1, 0x46, 0x9c, 0x01, 0x02, 0x48, +0x00, 0x00, 0x6a, 0x03, 0x03, 0x03, 0x03, 0x0f, 0x5d, 0x91, 0x01, 0xd0, 0x46, 0x91, 0x01, 0x01, +0xd1, 0xd2, 0x46, 0x9d, 0x01, 0x02, 0x48, 0x00, 0x00, 0x6b, 0x04, 0x03, 0x03, 0x03, 0x21, 0xd2, +0x5d, 0x9e, 0x01, 0x66, 0x9e, 0x01, 0x14, 0x04, 0x00, 0x00, 0x2f, 0x07, 0x82, 0xd6, 0x5d, 0x9f, +0x01, 0x5d, 0x91, 0x01, 0xd0, 0x46, 0x91, 0x01, 0x01, 0xd1, 0xd2, 0x46, 0x9f, 0x01, 0x03, 0x48, +0x00, 0x00, 0x6c, 0x03, 0x03, 0x03, 0x03, 0x0f, 0x5d, 0x91, 0x01, 0xd0, 0x46, 0x91, 0x01, 0x01, +0xd1, 0xd2, 0x46, 0xa0, 0x01, 0x02, 0x48, 0x00, 0x00, 0x6d, 0x03, 0x03, 0x03, 0x03, 0x0f, 0x5d, +0x91, 0x01, 0xd0, 0x46, 0x91, 0x01, 0x01, 0xd1, 0xd2, 0x46, 0xa1, 0x01, 0x02, 0x48, 0x00, 0x00, +0x6e, 0x02, 0x01, 0x03, 0x03, 0x0d, 0x5d, 0x91, 0x01, 0xd0, 0x46, 0x91, 0x01, 0x01, 0x46, 0xa2, +0x01, 0x00, 0x48, 0x00, 0x00, 0x6f, 0x02, 0x01, 0x03, 0x03, 0x0d, 0x5d, 0x91, 0x01, 0xd0, 0x46, +0x91, 0x01, 0x01, 0x46, 0xa3, 0x01, 0x00, 0x48, 0x00, 0x00, 0x70, 0x04, 0x01, 0x03, 0x03, 0x31, +0xd0, 0x5d, 0x7a, 0x66, 0x7a, 0x1a, 0x03, 0x00, 0x00, 0x2c, 0x01, 0x48, 0xd0, 0x5d, 0x91, 0x01, +0x66, 0x91, 0x01, 0xb3, 0x96, 0x12, 0x16, 0x00, 0x00, 0x5d, 0xa4, 0x01, 0x66, 0xa4, 0x01, 0x5d, +0xa5, 0x01, 0x66, 0xa5, 0x01, 0x25, 0xec, 0x07, 0x2c, 0x56, 0x46, 0xa6, 0x01, 0x03, 0x29, 0xd0, +0x48, 0x00, 0x00, 0x71, 0x04, 0x01, 0x03, 0x03, 0x31, 0xd0, 0x5d, 0x7a, 0x66, 0x7a, 0x1a, 0x03, +0x00, 0x00, 0x2c, 0x01, 0x48, 0xd0, 0x5d, 0x91, 0x01, 0x66, 0x91, 0x01, 0xb3, 0x96, 0x12, 0x16, +0x00, 0x00, 0x5d, 0xa4, 0x01, 0x66, 0xa4, 0x01, 0x5d, 0xa5, 0x01, 0x66, 0xa5, 0x01, 0x25, 0xec, +0x07, 0x2c, 0x57, 0x46, 0xa6, 0x01, 0x03, 0x29, 0xd0, 0x48, 0x00, 0x00, 0x80, 0x01, 0x04, 0x05, +0x04, 0x05, 0x3e, 0xd0, 0x30, 0x20, 0x85, 0xd6, 0x24, 0x00, 0x74, 0xd7, 0x24, 0x00, 0x74, 0x63, +0x04, 0xd0, 0x85, 0xd6, 0x24, 0x00, 0x74, 0xd7, 0xd1, 0x66, 0x97, 0x01, 0x74, 0x63, 0x04, 0x10, +0x15, 0x00, 0x00, 0x09, 0xd2, 0x5d, 0x91, 0x01, 0xd1, 0xd3, 0x66, 0x98, 0x01, 0x46, 0x91, 0x01, +0x01, 0xa0, 0x85, 0xd6, 0xd3, 0x91, 0x74, 0xd7, 0xd3, 0x62, 0x04, 0x15, 0xe4, 0xff, 0xff, 0xd2, +0x48, 0x00, 0x00, 0x82, 0x01, 0x03, 0x02, 0x04, 0x05, 0x0c, 0xd0, 0x30, 0x5d, 0x9a, 0x01, 0xd0, +0xd1, 0x46, 0x9a, 0x01, 0x02, 0x48, 0x00, 0x00, 0x83, 0x01, 0x04, 0x03, 0x04, 0x05, 0x0d, 0xd0, +0x30, 0x5d, 0x9b, 0x01, 0xd0, 0xd1, 0xd2, 0x46, 0x9b, 0x01, 0x03, 0x48, 0x00, 0x00, 0x84, 0x01, +0x03, 0x02, 0x04, 0x05, 0x0c, 0xd0, 0x30, 0x5d, 0x9c, 0x01, 0xd0, 0xd1, 0x46, 0x9c, 0x01, 0x02, +0x48, 0x00, 0x00, 0x87, 0x01, 0x04, 0x03, 0x04, 0x05, 0x1c, 0xd0, 0x30, 0xd2, 0x5d, 0x9e, 0x01, +0x66, 0x9e, 0x01, 0x14, 0x04, 0x00, 0x00, 0x2f, 0x07, 0x82, 0xd6, 0x5d, 0x9f, 0x01, 0xd0, 0xd1, +0xd2, 0x46, 0x9f, 0x01, 0x03, 0x48, 0x00, 0x00, 0x8d, 0x01, 0x01, 0x01, 0x04, 0x05, 0x08, 0xd0, +0x30, 0xd0, 0x46, 0xa2, 0x01, 0x00, 0x48, 0x00, 0x00, 0x8f, 0x01, 0x01, 0x01, 0x04, 0x05, 0x08, +0xd0, 0x30, 0xd0, 0x46, 0xa3, 0x01, 0x00, 0x48, 0x00, 0x00, 0x90, 0x01, 0x01, 0x01, 0x04, 0x05, +0x04, 0xd0, 0x30, 0xd0, 0x48, 0x00, 0x00, 0x91, 0x01, 0x01, 0x01, 0x04, 0x05, 0x04, 0xd0, 0x30, +0xd0, 0x48, 0x00, 0x00, 0x92, 0x01, 0x01, 0x02, 0x04, 0x05, 0x06, 0xd0, 0x30, 0xd0, 0x49, 0x00, +0x47, 0x00, 0x00, 0x93, 0x01, 0x02, 0x01, 0x03, 0x04, 0xaf, 0x02, 0xd0, 0x30, 0x5e, 0xb9, 0x01, +0x24, 0x01, 0x68, 0xb9, 0x01, 0x5e, 0xba, 0x01, 0x24, 0x02, 0x68, 0xba, 0x01, 0x5e, 0xbb, 0x01, +0x24, 0x04, 0x68, 0xbb, 0x01, 0x5e, 0xbc, 0x01, 0x24, 0x08, 0x68, 0xbc, 0x01, 0x5e, 0xbd, 0x01, +0x24, 0x10, 0x68, 0xbd, 0x01, 0x5e, 0x05, 0x24, 0x01, 0x68, 0x05, 0x5d, 0xbe, 0x01, 0x66, 0xbe, +0x01, 0x40, 0x94, 0x01, 0x61, 0xbf, 0x01, 0x5d, 0xbe, 0x01, 0x66, 0xbe, 0x01, 0x40, 0x95, 0x01, +0x61, 0xc0, 0x01, 0x5d, 0xbe, 0x01, 0x66, 0xbe, 0x01, 0x40, 0x96, 0x01, 0x61, 0xc1, 0x01, 0x5d, +0xbe, 0x01, 0x66, 0xbe, 0x01, 0x40, 0x97, 0x01, 0x61, 0xc2, 0x01, 0x5d, 0xbe, 0x01, 0x66, 0xbe, +0x01, 0x40, 0x98, 0x01, 0x61, 0xc3, 0x01, 0x5d, 0xbe, 0x01, 0x66, 0xbe, 0x01, 0x40, 0x99, 0x01, +0x61, 0xc4, 0x01, 0x5d, 0xbe, 0x01, 0x66, 0xbe, 0x01, 0x40, 0x9a, 0x01, 0x61, 0xc5, 0x01, 0x5d, +0xbe, 0x01, 0x66, 0xbe, 0x01, 0x40, 0x9b, 0x01, 0x61, 0xc6, 0x01, 0x5d, 0xbe, 0x01, 0x66, 0xbe, +0x01, 0x40, 0x9c, 0x01, 0x61, 0xc7, 0x01, 0x5d, 0xbe, 0x01, 0x66, 0xbe, 0x01, 0x40, 0x9d, 0x01, +0x61, 0xc8, 0x01, 0x5d, 0xbe, 0x01, 0x66, 0xbe, 0x01, 0x40, 0x9e, 0x01, 0x61, 0xc9, 0x01, 0x5d, +0xbe, 0x01, 0x66, 0xbe, 0x01, 0x40, 0x9f, 0x01, 0x61, 0xca, 0x01, 0x5d, 0xbe, 0x01, 0x66, 0xbe, +0x01, 0x40, 0xa0, 0x01, 0x61, 0xcb, 0x01, 0x5d, 0xbe, 0x01, 0x66, 0xbe, 0x01, 0x40, 0xa1, 0x01, +0x61, 0xcc, 0x01, 0x5d, 0xbe, 0x01, 0x66, 0xbe, 0x01, 0x40, 0xa2, 0x01, 0x61, 0xcd, 0x01, 0x5d, +0xbe, 0x01, 0x66, 0xbe, 0x01, 0x40, 0xa3, 0x01, 0x61, 0xce, 0x01, 0x5d, 0xbe, 0x01, 0x66, 0xbe, +0x01, 0x40, 0xa4, 0x01, 0x61, 0xcf, 0x01, 0x5d, 0xbe, 0x01, 0x66, 0xbe, 0x01, 0x40, 0xa5, 0x01, +0x61, 0xd0, 0x01, 0x5d, 0xbe, 0x01, 0x66, 0xbe, 0x01, 0x40, 0xa6, 0x01, 0x61, 0xd1, 0x01, 0x5d, +0xbe, 0x01, 0x66, 0xbe, 0x01, 0x40, 0xa7, 0x01, 0x61, 0xd2, 0x01, 0x5d, 0xd3, 0x01, 0x5d, 0xbe, +0x01, 0x66, 0xbe, 0x01, 0x46, 0xd3, 0x01, 0x01, 0x29, 0x47, 0x00, 0x00, 0xa8, 0x01, 0x02, 0x08, +0x03, 0x04, 0x8c, 0x01, 0xd0, 0x30, 0x20, 0x85, 0xd7, 0x20, 0x85, 0x63, 0x04, 0x24, 0x00, 0x74, +0x63, 0x05, 0x24, 0x00, 0x74, 0x63, 0x06, 0x21, 0x82, 0x63, 0x07, 0xd2, 0x5d, 0xd4, 0x01, 0x66, +0xd4, 0x01, 0x1a, 0x07, 0x00, 0x00, 0x2c, 0x72, 0x85, 0x10, 0x09, 0x00, 0x00, 0x5d, 0xd5, 0x01, +0xd2, 0x46, 0xd5, 0x01, 0x01, 0x85, 0x85, 0xd7, 0x2c, 0x01, 0x85, 0x63, 0x04, 0x24, 0x00, 0x74, +0x63, 0x05, 0x5d, 0xd6, 0x01, 0xd1, 0x66, 0xd7, 0x01, 0x46, 0xd6, 0x01, 0x01, 0x74, 0x63, 0x06, +0x10, 0x31, 0x00, 0x00, 0x09, 0xd1, 0x62, 0x05, 0x66, 0xd8, 0x01, 0x82, 0x63, 0x07, 0x62, 0x07, +0x20, 0x13, 0x08, 0x00, 0x00, 0x62, 0x04, 0x62, 0x07, 0xa0, 0x85, 0x63, 0x04, 0x62, 0x05, 0x24, +0x01, 0xa0, 0x62, 0x06, 0x0c, 0x07, 0x00, 0x00, 0x62, 0x04, 0xd3, 0xa0, 0x85, 0x63, 0x04, 0x62, +0x05, 0x91, 0x74, 0x63, 0x05, 0x62, 0x05, 0x62, 0x06, 0x15, 0xc7, 0xff, 0xff, 0x62, 0x04, 0x48, +0x00, 0x00, 0x94, 0x01, 0x03, 0x02, 0x03, 0x03, 0x0a, 0x5d, 0xd9, 0x01, 0xd0, 0xd1, 0x46, 0xd9, +0x01, 0x02, 0x48, 0x00, 0x00, 0x95, 0x01, 0x02, 0x01, 0x03, 0x03, 0x09, 0x5d, 0xda, 0x01, 0xd0, +0x46, 0xda, 0x01, 0x01, 0x48, 0x00, 0x00, 0x96, 0x01, 0x03, 0x02, 0x03, 0x03, 0x15, 0x20, 0x80, +0x8f, 0x01, 0xd5, 0xd0, 0x80, 0x8f, 0x01, 0xd5, 0x5d, 0xd9, 0x01, 0xd1, 0x2c, 0x72, 0x46, 0xd9, +0x01, 0x02, 0x48, 0x00, 0x00, 0x97, 0x01, 0x02, 0x06, 0x03, 0x03, 0x64, 0x20, 0x80, 0x8f, 0x01, +0xd5, 0x20, 0x85, 0xd6, 0x24, 0x00, 0x74, 0xd7, 0x24, 0x00, 0x74, 0x63, 0x04, 0x21, 0x82, 0x63, +0x05, 0xd0, 0x80, 0x8f, 0x01, 0xd5, 0x2c, 0x01, 0x85, 0xd6, 0x24, 0x00, 0x74, 0xd7, 0xd1, 0x66, +0xd7, 0x01, 0x74, 0x63, 0x04, 0x10, 0x2e, 0x00, 0x00, 0x09, 0xd1, 0xd3, 0x66, 0xd8, 0x01, 0x82, +0x63, 0x05, 0x62, 0x05, 0x20, 0x13, 0x0a, 0x00, 0x00, 0xd2, 0x62, 0x05, 0x46, 0xc2, 0x01, 0x00, +0xa0, 0x85, 0xd6, 0xd3, 0x24, 0x01, 0xa0, 0x62, 0x04, 0x0c, 0x06, 0x00, 0x00, 0xd2, 0x2c, 0x72, +0xa0, 0x85, 0xd6, 0xd3, 0x91, 0x74, 0xd7, 0xd3, 0x62, 0x04, 0x15, 0xcb, 0xff, 0xff, 0xd2, 0x48, +0x00, 0x00, 0x98, 0x01, 0x04, 0x06, 0x03, 0x03, 0x51, 0x24, 0x00, 0x74, 0xd6, 0x24, 0x00, 0x74, +0xd7, 0x24, 0x00, 0x74, 0x63, 0x04, 0x5d, 0xd6, 0x01, 0xd0, 0x66, 0xd7, 0x01, 0x46, 0xd6, 0x01, +0x01, 0x74, 0xd6, 0x24, 0x00, 0x74, 0xd7, 0xd1, 0x66, 0xd7, 0x01, 0x74, 0x63, 0x04, 0x10, 0x1a, +0x00, 0x00, 0x09, 0xd0, 0xd2, 0x75, 0x2a, 0x91, 0x74, 0xd6, 0x63, 0x05, 0x62, 0x05, 0xd1, 0xd3, +0x66, 0xd8, 0x01, 0x61, 0xd8, 0x01, 0x08, 0x05, 0xd3, 0x91, 0x74, 0xd7, 0xd3, 0x62, 0x04, 0x15, +0xdf, 0xff, 0xff, 0xd0, 0xd2, 0x61, 0xd7, 0x01, 0xd2, 0x48, 0x00, 0x00, 0x99, 0x01, 0x02, 0x01, +0x03, 0x03, 0x09, 0x5d, 0xdb, 0x01, 0xd0, 0x46, 0xdb, 0x01, 0x01, 0x48, 0x00, 0x00, 0x9a, 0x01, +0x03, 0x02, 0x03, 0x03, 0x0a, 0x5d, 0xdc, 0x01, 0xd0, 0xd1, 0x46, 0xdc, 0x01, 0x02, 0x48, 0x00, +0x00, 0x9b, 0x01, 0x02, 0x01, 0x03, 0x03, 0x09, 0x5d, 0xdd, 0x01, 0xd0, 0x46, 0xdd, 0x01, 0x01, +0x48, 0x00, 0x00, 0x9c, 0x01, 0x05, 0x03, 0x03, 0x03, 0x19, 0x5d, 0xde, 0x01, 0xd0, 0x5d, 0xdf, +0x01, 0xd1, 0x46, 0xdf, 0x01, 0x01, 0x5d, 0xdf, 0x01, 0xd2, 0x46, 0xdf, 0x01, 0x01, 0x46, 0xde, +0x01, 0x03, 0x48, 0x00, 0x00, 0x9d, 0x01, 0x04, 0x08, 0x03, 0x03, 0xa2, 0x01, 0x24, 0x00, 0x74, +0xd6, 0x24, 0x00, 0x74, 0xd7, 0x24, 0x00, 0x74, 0x63, 0x04, 0x24, 0x00, 0x74, 0x63, 0x05, 0x24, +0x00, 0x74, 0x63, 0x06, 0x5d, 0xd6, 0x01, 0xd0, 0x66, 0xd7, 0x01, 0x46, 0xd6, 0x01, 0x01, 0x74, +0xd6, 0xd1, 0x66, 0xd7, 0x01, 0x74, 0xd7, 0xd2, 0x74, 0x63, 0x04, 0x10, 0x2d, 0x00, 0x00, 0x09, +0x62, 0x04, 0x93, 0x74, 0x63, 0x04, 0x62, 0x04, 0xd3, 0xa0, 0x74, 0x63, 0x06, 0x62, 0x04, 0xd0, +0xb4, 0x12, 0x10, 0x00, 0x00, 0xd0, 0x62, 0x06, 0xd0, 0x62, 0x04, 0x66, 0xd8, 0x01, 0x61, 0xd8, +0x01, 0x10, 0x07, 0x00, 0x00, 0xd0, 0x62, 0x06, 0x6a, 0xd8, 0x01, 0x29, 0x62, 0x04, 0x24, 0x00, +0x17, 0xcb, 0xff, 0xff, 0x24, 0x00, 0x74, 0x63, 0x05, 0x10, 0x1f, 0x00, 0x00, 0x09, 0xd0, 0x62, +0x04, 0x75, 0x2a, 0x91, 0x74, 0x63, 0x04, 0x63, 0x07, 0x62, 0x07, 0xd1, 0x62, 0x05, 0x66, 0xd8, +0x01, 0x61, 0xd8, 0x01, 0x08, 0x07, 0x62, 0x05, 0x91, 0x74, 0x63, 0x05, 0x62, 0x05, 0xd3, 0x15, +0xda, 0xff, 0xff, 0xd2, 0xd3, 0xa0, 0x74, 0xd6, 0xd0, 0xd2, 0x61, 0xd7, 0x01, 0xd2, 0x48, 0x00, +0x00, 0x9e, 0x01, 0x03, 0x02, 0x03, 0x03, 0x1a, 0xd1, 0x66, 0xd7, 0x01, 0x96, 0x12, 0x07, 0x00, +0x00, 0x5d, 0xd4, 0x01, 0x66, 0xd4, 0x01, 0x48, 0x5d, 0xe0, 0x01, 0xd0, 0xd1, 0x46, 0xe0, 0x01, +0x02, 0x48, 0x00, 0x00, 0x9f, 0x01, 0x03, 0x02, 0x03, 0x03, 0x0a, 0x5d, 0xe1, 0x01, 0xd0, 0xd1, +0x46, 0xe1, 0x01, 0x02, 0x48, 0x00, 0x00, 0xa0, 0x01, 0x04, 0x04, 0x03, 0x03, 0x0b, 0x5d, 0xe2, +0x01, 0xd0, 0xd1, 0xd2, 0x46, 0xe2, 0x01, 0x03, 0x48, 0x00, 0x00, 0xa1, 0x01, 0x05, 0x03, 0x03, +0x03, 0x12, 0x5d, 0xe3, 0x01, 0xd0, 0xd1, 0x5d, 0xe4, 0x01, 0xd2, 0x46, 0xe4, 0x01, 0x01, 0x46, +0xe3, 0x01, 0x03, 0x48, 0x00, 0x00, 0xa2, 0x01, 0x05, 0x03, 0x03, 0x03, 0x12, 0x5d, 0xe5, 0x01, +0xd0, 0xd1, 0x5d, 0xe4, 0x01, 0xd2, 0x46, 0xe4, 0x01, 0x01, 0x46, 0xe5, 0x01, 0x03, 0x48, 0x00, +0x00, 0xa3, 0x01, 0x04, 0x03, 0x03, 0x03, 0x0b, 0x5d, 0xe6, 0x01, 0xd0, 0xd1, 0xd2, 0x46, 0xe6, +0x01, 0x03, 0x48, 0x00, 0x00, 0xa4, 0x01, 0x04, 0x03, 0x03, 0x03, 0x0b, 0x5d, 0xe7, 0x01, 0xd0, +0xd1, 0xd2, 0x46, 0xe7, 0x01, 0x03, 0x48, 0x00, 0x00, 0xa5, 0x01, 0x04, 0x03, 0x03, 0x03, 0x0c, +0x5d, 0xe8, 0x01, 0xd0, 0xd1, 0xd2, 0x46, 0xe8, 0x01, 0x03, 0x29, 0x47, 0x00, 0x00, 0xa6, 0x01, +0x04, 0x03, 0x03, 0x03, 0x0b, 0x5d, 0xe9, 0x01, 0xd0, 0xd1, 0xd2, 0x46, 0xe9, 0x01, 0x03, 0x48, +0x00, 0x00, 0xa7, 0x01, 0x04, 0x03, 0x03, 0x03, 0x0b, 0x5d, 0xea, 0x01, 0xd0, 0xd1, 0xd2, 0x46, +0xea, 0x01, 0x03, 0x48, 0x00, 0x00, 0xba, 0x01, 0x04, 0x06, 0x04, 0x05, 0x98, 0x01, 0xd0, 0x30, +0x24, 0x00, 0x74, 0xd6, 0x28, 0xd7, 0x24, 0x00, 0x74, 0x63, 0x04, 0x24, 0x00, 0x74, 0x63, 0x05, +0xd0, 0x49, 0x00, 0xd1, 0x66, 0xd7, 0x01, 0x74, 0xd6, 0xd2, 0x24, 0x01, 0xab, 0x76, 0x2a, 0x76, +0x12, 0x0f, 0x00, 0x00, 0x29, 0xd1, 0x24, 0x00, 0x66, 0xd8, 0x01, 0x5d, 0xdf, 0x01, 0x66, 0xdf, +0x01, 0xb3, 0x76, 0x12, 0x34, 0x00, 0x00, 0xd1, 0x24, 0x00, 0x66, 0xd8, 0x01, 0x75, 0xd7, 0xd3, +0x74, 0x63, 0x04, 0x62, 0x04, 0xd3, 0x13, 0x15, 0x00, 0x00, 0x5d, 0xeb, 0x01, 0x66, 0xeb, 0x01, +0x5d, 0xec, 0x01, 0x66, 0xec, 0x01, 0x25, 0xed, 0x07, 0xd3, 0x46, 0xed, 0x01, 0x03, 0x29, 0x5e, +0xd7, 0x01, 0x62, 0x04, 0x68, 0xd7, 0x01, 0x10, 0x2a, 0x00, 0x00, 0x5e, 0xd7, 0x01, 0xd2, 0x68, +0xd7, 0x01, 0x24, 0x00, 0x74, 0x63, 0x05, 0x10, 0x13, 0x00, 0x00, 0x09, 0xd0, 0x62, 0x05, 0xd1, +0x62, 0x05, 0x66, 0xd8, 0x01, 0x68, 0xd8, 0x01, 0x62, 0x05, 0x91, 0x74, 0x63, 0x05, 0x62, 0x05, +0xd2, 0x15, 0xe6, 0xff, 0xff, 0x47, 0x00, 0x00, 0xbb, 0x01, 0x03, 0x02, 0x04, 0x05, 0x0c, 0xd0, +0x30, 0x5d, 0xd9, 0x01, 0xd0, 0xd1, 0x46, 0xd9, 0x01, 0x02, 0x48, 0x00, 0x00, 0xbe, 0x01, 0x02, +0x01, 0x04, 0x05, 0x0b, 0xd0, 0x30, 0x5d, 0xdb, 0x01, 0xd0, 0x46, 0xdb, 0x01, 0x01, 0x48, 0x00, +0x00, 0xbf, 0x01, 0x03, 0x02, 0x04, 0x05, 0x0c, 0xd0, 0x30, 0x5d, 0xdc, 0x01, 0xd0, 0xd1, 0x46, +0xdc, 0x01, 0x02, 0x48, 0x00, 0x00, 0xc0, 0x01, 0x02, 0x01, 0x04, 0x05, 0x0b, 0xd0, 0x30, 0x5d, +0xdd, 0x01, 0xd0, 0x46, 0xdd, 0x01, 0x01, 0x48, 0x00, 0x00, 0xc1, 0x01, 0x05, 0x03, 0x04, 0x05, +0x1b, 0xd0, 0x30, 0x5d, 0xde, 0x01, 0xd0, 0x5d, 0xdf, 0x01, 0xd1, 0x46, 0xdf, 0x01, 0x01, 0x5d, +0xdf, 0x01, 0xd2, 0x46, 0xdf, 0x01, 0x01, 0x46, 0xde, 0x01, 0x03, 0x48, 0x00, 0x00, 0xc3, 0x01, +0x03, 0x02, 0x04, 0x05, 0x1c, 0xd0, 0x30, 0xd1, 0x66, 0xd7, 0x01, 0x96, 0x12, 0x07, 0x00, 0x00, +0x5d, 0xd4, 0x01, 0x66, 0xd4, 0x01, 0x48, 0x5d, 0xe0, 0x01, 0xd0, 0xd1, 0x46, 0xe0, 0x01, 0x02, +0x48, 0x00, 0x00, 0xc4, 0x01, 0x03, 0x02, 0x04, 0x05, 0x0c, 0xd0, 0x30, 0x5d, 0xe1, 0x01, 0xd0, +0xd1, 0x46, 0xe1, 0x01, 0x02, 0x48, 0x00, 0x00, 0xc5, 0x01, 0x04, 0x04, 0x04, 0x05, 0x0d, 0xd0, +0x30, 0x5d, 0xe2, 0x01, 0xd0, 0xd1, 0xd2, 0x46, 0xe2, 0x01, 0x03, 0x48, 0x00, 0x00, 0xc6, 0x01, +0x05, 0x03, 0x04, 0x05, 0x14, 0xd0, 0x30, 0x5d, 0xe3, 0x01, 0xd0, 0xd1, 0x5d, 0xe4, 0x01, 0xd2, +0x46, 0xe4, 0x01, 0x01, 0x46, 0xe3, 0x01, 0x03, 0x48, 0x00, 0x00, 0xc7, 0x01, 0x05, 0x03, 0x04, +0x05, 0x14, 0xd0, 0x30, 0x5d, 0xe5, 0x01, 0xd0, 0xd1, 0x5d, 0xe4, 0x01, 0xd2, 0x46, 0xe4, 0x01, +0x01, 0x46, 0xe5, 0x01, 0x03, 0x48, 0x00, 0x00, 0xc8, 0x01, 0x04, 0x03, 0x04, 0x05, 0x0d, 0xd0, +0x30, 0x5d, 0xe6, 0x01, 0xd0, 0xd1, 0xd2, 0x46, 0xe6, 0x01, 0x03, 0x48, 0x00, 0x00, 0xc9, 0x01, +0x04, 0x03, 0x04, 0x05, 0x0d, 0xd0, 0x30, 0x5d, 0xe7, 0x01, 0xd0, 0xd1, 0xd2, 0x46, 0xe7, 0x01, +0x03, 0x48, 0x00, 0x00, 0xca, 0x01, 0x04, 0x03, 0x04, 0x05, 0x0e, 0xd0, 0x30, 0x5d, 0xe8, 0x01, +0xd0, 0xd1, 0xd2, 0x46, 0xe8, 0x01, 0x03, 0x29, 0x47, 0x00, 0x00, 0xcb, 0x01, 0x04, 0x03, 0x04, +0x05, 0x0d, 0xd0, 0x30, 0x5d, 0xe9, 0x01, 0xd0, 0xd1, 0xd2, 0x46, 0xe9, 0x01, 0x03, 0x48, 0x00, +0x00, 0xcc, 0x01, 0x04, 0x03, 0x04, 0x05, 0x0d, 0xd0, 0x30, 0x5d, 0xea, 0x01, 0xd0, 0xd1, 0xd2, +0x46, 0xea, 0x01, 0x03, 0x48, 0x00, 0x00, 0xcd, 0x01, 0x01, 0x01, 0x04, 0x05, 0x03, 0xd0, 0x30, +0x47, 0x00, 0x00, 0xce, 0x01, 0x01, 0x01, 0x05, 0x06, 0x04, 0xd0, 0x30, 0x20, 0x48, 0x00, 0x00, +0xcf, 0x01, 0x05, 0x02, 0x05, 0x06, 0x1c, 0xd0, 0x30, 0x5d, 0x8c, 0x02, 0x66, 0x8c, 0x02, 0x5d, +0x8d, 0x02, 0x66, 0x8d, 0x02, 0x25, 0xb2, 0x08, 0x2c, 0x12, 0x2c, 0x83, 0x01, 0x46, 0x8e, 0x02, +0x04, 0x29, 0x47, 0x00, 0x00, 0xd1, 0x01, 0x01, 0x01, 0x05, 0x06, 0x06, 0xd0, 0x30, 0xd0, 0x49, +0x00, 0x47, 0x00, 0x00, 0xd2, 0x01, 0x03, 0x02, 0x01, 0x04, 0xfc, 0x01, 0xd0, 0x30, 0x5d, 0x90, +0x02, 0x20, 0x58, 0x00, 0x68, 0x08, 0x5d, 0x91, 0x02, 0x5d, 0x08, 0x66, 0x08, 0x30, 0x5d, 0x92, +0x02, 0x66, 0x92, 0x02, 0x58, 0x01, 0x1d, 0x68, 0x21, 0x5d, 0x93, 0x02, 0x5d, 0x08, 0x66, 0x08, +0x30, 0x5d, 0x92, 0x02, 0x66, 0x92, 0x02, 0x58, 0x02, 0x1d, 0x68, 0x28, 0x5d, 0x94, 0x02, 0x5d, +0x08, 0x66, 0x08, 0x30, 0x5d, 0x28, 0x66, 0x28, 0x30, 0x5d, 0x95, 0x02, 0x66, 0x95, 0x02, 0x58, +0x0a, 0x1d, 0x1d, 0x68, 0x8f, 0x02, 0x5d, 0x96, 0x02, 0x5d, 0x08, 0x66, 0x08, 0x30, 0x5d, 0x92, +0x02, 0x66, 0x92, 0x02, 0x58, 0x03, 0x1d, 0x68, 0x30, 0x5d, 0x97, 0x02, 0x5d, 0x08, 0x66, 0x08, +0x30, 0x5d, 0x92, 0x02, 0x66, 0x92, 0x02, 0x58, 0x04, 0x1d, 0x68, 0x04, 0x5d, 0x98, 0x02, 0x5d, +0x08, 0x66, 0x08, 0x30, 0x5d, 0x92, 0x02, 0x66, 0x92, 0x02, 0x58, 0x05, 0x1d, 0x68, 0x02, 0x5d, +0x99, 0x02, 0x5d, 0x08, 0x66, 0x08, 0x30, 0x5d, 0x92, 0x02, 0x66, 0x92, 0x02, 0x58, 0x06, 0x1d, +0x68, 0x03, 0x5d, 0x9a, 0x02, 0x5d, 0x08, 0x66, 0x08, 0x30, 0x5d, 0x92, 0x02, 0x66, 0x92, 0x02, +0x58, 0x07, 0x1d, 0x68, 0x78, 0x5d, 0x9b, 0x02, 0x5d, 0x08, 0x66, 0x08, 0x30, 0x5d, 0x92, 0x02, +0x66, 0x92, 0x02, 0x58, 0x08, 0x1d, 0x68, 0x01, 0x5d, 0x9c, 0x02, 0x5d, 0x08, 0x66, 0x08, 0x30, +0x5d, 0x92, 0x02, 0x66, 0x92, 0x02, 0x58, 0x09, 0x1d, 0x68, 0x8f, 0x01, 0x5d, 0x92, 0x02, 0x66, +0x92, 0x02, 0x46, 0x9d, 0x02, 0x00, 0x82, 0xd5, 0x5d, 0x9e, 0x02, 0x24, 0x00, 0x24, 0x00, 0xa3, +0x68, 0x3e, 0x5d, 0x9f, 0x02, 0x24, 0x01, 0x24, 0x00, 0xa3, 0x68, 0xa0, 0x02, 0x5d, 0xa1, 0x02, +0x21, 0x68, 0xa2, 0x02, 0xd1, 0x48, 0x08, 0x01, 0x00, 0x00, 0xd3, 0x01, 0x02, 0x01, 0x03, 0x04, +0x43, 0xd0, 0x30, 0x5e, 0xae, 0x02, 0x2f, 0x08, 0x68, 0xae, 0x02, 0x5e, 0xaf, 0x02, 0x2f, 0x09, +0x68, 0xaf, 0x02, 0x5e, 0xb0, 0x02, 0x2f, 0x0a, 0x68, 0xb0, 0x02, 0x5e, 0xb1, 0x02, 0x2f, 0x0b, +0x68, 0xb1, 0x02, 0x5e, 0xb2, 0x02, 0x2f, 0x0c, 0x68, 0xb2, 0x02, 0x5e, 0xb3, 0x02, 0x2f, 0x0d, +0x68, 0xb3, 0x02, 0x5e, 0xb4, 0x02, 0x2f, 0x0e, 0x68, 0xb4, 0x02, 0x5e, 0xb5, 0x02, 0x2f, 0x0f, +0x68, 0xb5, 0x02, 0x47, 0x00, 0x00, 0xe8, 0x01, 0x01, 0x01, 0x04, 0x05, 0x06, 0xd0, 0x30, 0xd0, +0x49, 0x00, 0x47, 0x00, 0x00, 0xe9, 0x01, 0x02, 0x01, 0x01, 0x03, 0x16, 0xd0, 0x30, 0x65, 0x00, +0x5d, 0x08, 0x66, 0x08, 0x30, 0x5d, 0xcb, 0x02, 0x66, 0xcb, 0x02, 0x58, 0x0b, 0x1d, 0x68, 0xca, +0x02, 0x47, 0x00, 0x00, 0xea, 0x01, 0x04, 0x01, 0x03, 0x04, 0x3c, 0xd0, 0x30, 0x5e, 0x05, 0x24, +0x01, 0x68, 0x05, 0x5d, 0xcc, 0x02, 0x66, 0xcc, 0x02, 0x2c, 0x26, 0x61, 0xcd, 0x02, 0x5d, 0xcc, +0x02, 0x66, 0xcc, 0x02, 0x2c, 0x26, 0x61, 0xce, 0x02, 0x5d, 0xcc, 0x02, 0x66, 0xcc, 0x02, 0x40, +0xeb, 0x01, 0x61, 0xcf, 0x02, 0x5d, 0xd0, 0x02, 0x5d, 0xcc, 0x02, 0x66, 0xcc, 0x02, 0x2c, 0x15, +0x27, 0x46, 0xd0, 0x02, 0x03, 0x29, 0x47, 0x00, 0x00, 0xed, 0x01, 0x02, 0x06, 0x04, 0x04, 0x87, +0x02, 0x21, 0x82, 0x63, 0x04, 0x24, 0xff, 0x82, 0x63, 0x04, 0x10, 0x41, 0x00, 0x00, 0x09, 0x24, +0x00, 0x82, 0x63, 0x04, 0x10, 0xc3, 0x00, 0x00, 0x09, 0x24, 0x01, 0x82, 0x63, 0x04, 0x10, 0xb9, +0x00, 0x00, 0x09, 0x24, 0x02, 0x82, 0x63, 0x04, 0x10, 0xaf, 0x00, 0x00, 0x09, 0x24, 0x03, 0x82, +0x63, 0x04, 0x10, 0xa5, 0x00, 0x00, 0x09, 0x24, 0x04, 0x82, 0x63, 0x04, 0x10, 0x9b, 0x00, 0x00, +0x09, 0x24, 0x05, 0x82, 0x63, 0x04, 0x10, 0x91, 0x00, 0x00, 0x09, 0x10, 0x8c, 0x00, 0x00, 0xd1, +0x24, 0x01, 0x46, 0xd1, 0x02, 0x01, 0x63, 0x05, 0x2c, 0xb1, 0x01, 0x62, 0x05, 0x1a, 0x06, 0x00, +0x00, 0x25, 0x00, 0x10, 0x58, 0x00, 0x00, 0x2c, 0xb2, 0x01, 0x62, 0x05, 0x1a, 0x06, 0x00, 0x00, +0x25, 0x01, 0x10, 0x49, 0x00, 0x00, 0x2c, 0xb3, 0x01, 0x62, 0x05, 0x1a, 0x06, 0x00, 0x00, 0x25, +0x02, 0x10, 0x3a, 0x00, 0x00, 0x2c, 0xb4, 0x01, 0x62, 0x05, 0x1a, 0x06, 0x00, 0x00, 0x25, 0x03, +0x10, 0x2b, 0x00, 0x00, 0x2c, 0xb5, 0x01, 0x62, 0x05, 0x1a, 0x06, 0x00, 0x00, 0x25, 0x04, 0x10, +0x1c, 0x00, 0x00, 0x2c, 0xb6, 0x01, 0x62, 0x05, 0x1a, 0x06, 0x00, 0x00, 0x25, 0x05, 0x10, 0x0d, +0x00, 0x00, 0x27, 0x12, 0x06, 0x00, 0x00, 0x25, 0x06, 0x10, 0x02, 0x00, 0x00, 0x25, 0x06, 0x08, +0x05, 0x1b, 0x89, 0xff, 0xff, 0x06, 0x4d, 0xff, 0xff, 0x57, 0xff, 0xff, 0x61, 0xff, 0xff, 0x6b, +0xff, 0xff, 0x75, 0xff, 0xff, 0x7f, 0xff, 0xff, 0x89, 0xff, 0xff, 0x62, 0x04, 0x24, 0xff, 0xaf, +0x76, 0x2a, 0x76, 0x12, 0x0e, 0x00, 0x00, 0x29, 0x5d, 0xd2, 0x02, 0x66, 0xd2, 0x02, 0x66, 0xd3, +0x02, 0x62, 0x04, 0xaf, 0x76, 0x12, 0x0c, 0x00, 0x00, 0x5d, 0xd2, 0x02, 0x66, 0xd2, 0x02, 0x62, +0x04, 0x66, 0xd4, 0x02, 0x48, 0x2c, 0x01, 0x48, 0x00, 0x00, 0xee, 0x01, 0x05, 0x05, 0x04, 0x06, +0x59, 0xd0, 0x30, 0x57, 0x2a, 0x63, 0x04, 0x30, 0x65, 0x01, 0x21, 0x82, 0x6d, 0x04, 0x65, 0x01, +0x21, 0x82, 0x6d, 0x05, 0x65, 0x01, 0xd1, 0x6d, 0x01, 0x65, 0x01, 0xd2, 0x6d, 0x02, 0x65, 0x01, +0xd3, 0x6d, 0x03, 0x65, 0x01, 0x24, 0x00, 0x82, 0x6d, 0x04, 0x65, 0x01, 0x40, 0xed, 0x01, 0x82, +0x6d, 0x05, 0x65, 0x01, 0x6c, 0x01, 0x64, 0x6c, 0x01, 0x65, 0x01, 0x6c, 0x02, 0x46, 0xd5, 0x02, +0x01, 0x5d, 0xd6, 0x02, 0x66, 0xd6, 0x02, 0x2c, 0xba, 0x01, 0x2c, 0xbb, 0x01, 0x42, 0x02, 0x65, +0x01, 0x6c, 0x05, 0x46, 0xd7, 0x02, 0x02, 0x42, 0x01, 0x03, 0x00, 0x05, 0xd8, 0x02, 0x00, 0x02, +0x78, 0x00, 0xd9, 0x02, 0x00, 0x03, 0x8f, 0x01, 0x00, 0xda, 0x02, 0x00, 0x05, 0x00, 0x00, 0xdb, +0x02, 0x00, 0x04, 0x00, 0x00, 0xdc, 0x02, 0x00, 0x01, 0x21, 0x00, 0xeb, 0x01, 0x02, 0x02, 0x03, +0x03, 0x2e, 0x20, 0x80, 0xdd, 0x02, 0xd5, 0xd0, 0x80, 0xdd, 0x02, 0xd5, 0xd1, 0x66, 0xce, 0x02, +0x2c, 0x01, 0xac, 0x96, 0x12, 0x12, 0x00, 0x00, 0xd1, 0x66, 0xcd, 0x02, 0x2c, 0xc0, 0x01, 0xa0, +0xd1, 0x66, 0xce, 0x02, 0xa0, 0x85, 0x10, 0x05, 0x00, 0x00, 0xd1, 0x66, 0xcd, 0x02, 0x85, 0x48, +0x00, 0x00, 0xef, 0x01, 0x02, 0x03, 0x04, 0x05, 0x1d, 0xd0, 0x30, 0xd0, 0x49, 0x00, 0xd0, 0xd1, +0x68, 0xce, 0x02, 0xd0, 0xd2, 0x68, 0xde, 0x02, 0xd0, 0x5d, 0xcc, 0x02, 0x66, 0xcc, 0x02, 0x66, +0xcd, 0x02, 0x68, 0xcd, 0x02, 0x47, 0x00, 0x00, 0xf1, 0x01, 0x01, 0x01, 0x04, 0x05, 0x07, 0xd0, +0x30, 0xd0, 0x66, 0xde, 0x02, 0x48, 0x00, 0x00, 0xf2, 0x01, 0x02, 0x01, 0x04, 0x05, 0x15, 0xd0, +0x30, 0x5e, 0x05, 0x24, 0x01, 0x68, 0x05, 0x5d, 0xe6, 0x02, 0x66, 0xe6, 0x02, 0x2c, 0xc4, 0x01, +0x61, 0xe7, 0x02, 0x47, 0x00, 0x00, 0xf3, 0x01, 0x03, 0x03, 0x05, 0x06, 0x15, 0xd0, 0x30, 0xd0, +0xd1, 0xd2, 0x49, 0x02, 0xd0, 0x5d, 0xe6, 0x02, 0x66, 0xe6, 0x02, 0x66, 0xe7, 0x02, 0x68, 0xe7, +0x02, 0x47, 0x00, 0x00, 0xf4, 0x01, 0x02, 0x01, 0x04, 0x05, 0x15, 0xd0, 0x30, 0x5e, 0x05, 0x24, +0x01, 0x68, 0x05, 0x5d, 0xe9, 0x02, 0x66, 0xe9, 0x02, 0x2c, 0xc5, 0x01, 0x61, 0xea, 0x02, 0x47, +0x00, 0x00, 0xf5, 0x01, 0x03, 0x03, 0x05, 0x06, 0x15, 0xd0, 0x30, 0xd0, 0xd1, 0xd2, 0x49, 0x02, +0xd0, 0x5d, 0xe9, 0x02, 0x66, 0xe9, 0x02, 0x66, 0xea, 0x02, 0x68, 0xea, 0x02, 0x47, 0x00, 0x00, +0xf6, 0x01, 0x02, 0x01, 0x04, 0x05, 0x15, 0xd0, 0x30, 0x5e, 0x05, 0x24, 0x01, 0x68, 0x05, 0x5d, +0xec, 0x02, 0x66, 0xec, 0x02, 0x2c, 0x80, 0x01, 0x61, 0xed, 0x02, 0x47, 0x00, 0x00, 0xf7, 0x01, +0x03, 0x03, 0x05, 0x06, 0x15, 0xd0, 0x30, 0xd0, 0xd1, 0xd2, 0x49, 0x02, 0xd0, 0x5d, 0xec, 0x02, +0x66, 0xec, 0x02, 0x66, 0xed, 0x02, 0x68, 0xed, 0x02, 0x47, 0x00, 0x00, 0xf8, 0x01, 0x02, 0x01, +0x04, 0x05, 0x15, 0xd0, 0x30, 0x5e, 0x05, 0x24, 0x01, 0x68, 0x05, 0x5d, 0xef, 0x02, 0x66, 0xef, +0x02, 0x2c, 0x82, 0x01, 0x61, 0xf0, 0x02, 0x47, 0x00, 0x00, 0xf9, 0x01, 0x03, 0x03, 0x05, 0x06, +0x15, 0xd0, 0x30, 0xd0, 0xd1, 0xd2, 0x49, 0x02, 0xd0, 0x5d, 0xef, 0x02, 0x66, 0xef, 0x02, 0x66, +0xf0, 0x02, 0x68, 0xf0, 0x02, 0x47, 0x00, 0x00, 0xfa, 0x01, 0x02, 0x01, 0x04, 0x05, 0x15, 0xd0, +0x30, 0x5e, 0x05, 0x24, 0x01, 0x68, 0x05, 0x5d, 0xf2, 0x02, 0x66, 0xf2, 0x02, 0x2c, 0xc6, 0x01, +0x61, 0xf3, 0x02, 0x47, 0x00, 0x00, 0xfb, 0x01, 0x03, 0x03, 0x05, 0x06, 0x15, 0xd0, 0x30, 0xd0, +0xd1, 0xd2, 0x49, 0x02, 0xd0, 0x5d, 0xf2, 0x02, 0x66, 0xf2, 0x02, 0x66, 0xf3, 0x02, 0x68, 0xf3, +0x02, 0x47, 0x00, 0x00, 0xfc, 0x01, 0x02, 0x01, 0x04, 0x05, 0x15, 0xd0, 0x30, 0x5e, 0x05, 0x24, +0x01, 0x68, 0x05, 0x5d, 0xf5, 0x02, 0x66, 0xf5, 0x02, 0x2c, 0xc7, 0x01, 0x61, 0xf6, 0x02, 0x47, +0x00, 0x00, 0xfd, 0x01, 0x03, 0x03, 0x05, 0x06, 0x15, 0xd0, 0x30, 0xd0, 0xd1, 0xd2, 0x49, 0x02, +0xd0, 0x5d, 0xf5, 0x02, 0x66, 0xf5, 0x02, 0x66, 0xf6, 0x02, 0x68, 0xf6, 0x02, 0x47, 0x00, 0x00, +0xfe, 0x01, 0x02, 0x01, 0x04, 0x05, 0x14, 0xd0, 0x30, 0x5e, 0x05, 0x24, 0x01, 0x68, 0x05, 0x5d, +0xf8, 0x02, 0x66, 0xf8, 0x02, 0x2c, 0x27, 0x61, 0xf9, 0x02, 0x47, 0x00, 0x00, 0xff, 0x01, 0x03, +0x03, 0x05, 0x06, 0x15, 0xd0, 0x30, 0xd0, 0xd1, 0xd2, 0x49, 0x02, 0xd0, 0x5d, 0xf8, 0x02, 0x66, +0xf8, 0x02, 0x66, 0xf9, 0x02, 0x68, 0xf9, 0x02, 0x47, 0x00, 0x00, 0x80, 0x02, 0x02, 0x01, 0x04, +0x05, 0x15, 0xd0, 0x30, 0x5e, 0x05, 0x24, 0x01, 0x68, 0x05, 0x5d, 0xfb, 0x02, 0x66, 0xfb, 0x02, +0x2c, 0xc8, 0x01, 0x61, 0xfc, 0x02, 0x47, 0x00, 0x00, 0x81, 0x02, 0x03, 0x03, 0x05, 0x06, 0x15, +0xd0, 0x30, 0xd0, 0xd1, 0xd2, 0x49, 0x02, 0xd0, 0x5d, 0xfb, 0x02, 0x66, 0xfb, 0x02, 0x66, 0xfc, +0x02, 0x68, 0xfc, 0x02, 0x47, 0x00, 0x00, 0x82, 0x02, 0x02, 0x01, 0x04, 0x05, 0x15, 0xd0, 0x30, +0x5e, 0x05, 0x24, 0x01, 0x68, 0x05, 0x5d, 0xfe, 0x02, 0x66, 0xfe, 0x02, 0x2c, 0xc9, 0x01, 0x61, +0xff, 0x02, 0x47, 0x00, 0x00, 0x83, 0x02, 0x03, 0x03, 0x05, 0x06, 0x15, 0xd0, 0x30, 0xd0, 0xd1, +0xd2, 0x49, 0x02, 0xd0, 0x5d, 0xfe, 0x02, 0x66, 0xfe, 0x02, 0x66, 0xff, 0x02, 0x68, 0xff, 0x02, +0x47, 0x00, 0x00, 0x84, 0x02, 0x02, 0x01, 0x04, 0x05, 0x15, 0xd0, 0x30, 0x5e, 0x05, 0x24, 0x01, +0x68, 0x05, 0x5d, 0x81, 0x03, 0x66, 0x81, 0x03, 0x2c, 0xca, 0x01, 0x61, 0x82, 0x03, 0x47, 0x00, +0x00, 0x85, 0x02, 0x03, 0x03, 0x05, 0x06, 0x15, 0xd0, 0x30, 0xd0, 0xd1, 0xd2, 0x49, 0x02, 0xd0, +0x5d, 0x81, 0x03, 0x66, 0x81, 0x03, 0x66, 0x82, 0x03, 0x68, 0x82, 0x03, 0x47, 0x00, 0x00, 0x86, +0x02, 0x02, 0x01, 0x04, 0x05, 0x15, 0xd0, 0x30, 0x5e, 0x05, 0x24, 0x01, 0x68, 0x05, 0x5d, 0x84, +0x03, 0x66, 0x84, 0x03, 0x2c, 0xcb, 0x01, 0x61, 0x85, 0x03, 0x47, 0x00, 0x00, 0x87, 0x02, 0x03, +0x03, 0x05, 0x06, 0x15, 0xd0, 0x30, 0xd0, 0xd1, 0xd2, 0x49, 0x02, 0xd0, 0x5d, 0x84, 0x03, 0x66, +0x84, 0x03, 0x66, 0x85, 0x03, 0x68, 0x85, 0x03, 0x47, 0x00, 0x00, 0x88, 0x02, 0x02, 0x01, 0x01, +0x04, 0x9e, 0x02, 0xd0, 0x30, 0x65, 0x00, 0x5d, 0x08, 0x66, 0x08, 0x30, 0x5d, 0x87, 0x03, 0x66, +0x87, 0x03, 0x58, 0x0c, 0x1d, 0x68, 0xdd, 0x02, 0x65, 0x00, 0x5d, 0x08, 0x66, 0x08, 0x30, 0x5d, +0xdd, 0x02, 0x66, 0xdd, 0x02, 0x30, 0x64, 0x6c, 0x01, 0x58, 0x0d, 0x1d, 0x1d, 0x68, 0xe8, 0x02, +0x65, 0x00, 0x5d, 0x08, 0x66, 0x08, 0x30, 0x5d, 0xdd, 0x02, 0x66, 0xdd, 0x02, 0x30, 0x64, 0x6c, +0x01, 0x58, 0x0e, 0x1d, 0x1d, 0x68, 0xeb, 0x02, 0x65, 0x00, 0x5d, 0x08, 0x66, 0x08, 0x30, 0x5d, +0xdd, 0x02, 0x66, 0xdd, 0x02, 0x30, 0x64, 0x6c, 0x01, 0x58, 0x0f, 0x1d, 0x1d, 0x68, 0xee, 0x02, +0x65, 0x00, 0x5d, 0x08, 0x66, 0x08, 0x30, 0x5d, 0xdd, 0x02, 0x66, 0xdd, 0x02, 0x30, 0x64, 0x6c, +0x01, 0x58, 0x10, 0x1d, 0x1d, 0x68, 0xf1, 0x02, 0x65, 0x00, 0x5d, 0x08, 0x66, 0x08, 0x30, 0x5d, +0xdd, 0x02, 0x66, 0xdd, 0x02, 0x30, 0x64, 0x6c, 0x01, 0x58, 0x11, 0x1d, 0x1d, 0x68, 0xf4, 0x02, +0x65, 0x00, 0x5d, 0x08, 0x66, 0x08, 0x30, 0x5d, 0xdd, 0x02, 0x66, 0xdd, 0x02, 0x30, 0x64, 0x6c, +0x01, 0x58, 0x12, 0x1d, 0x1d, 0x68, 0xf7, 0x02, 0x65, 0x00, 0x5d, 0x08, 0x66, 0x08, 0x30, 0x5d, +0xdd, 0x02, 0x66, 0xdd, 0x02, 0x30, 0x64, 0x6c, 0x01, 0x58, 0x13, 0x1d, 0x1d, 0x68, 0xfa, 0x02, +0x65, 0x00, 0x5d, 0x08, 0x66, 0x08, 0x30, 0x5d, 0xdd, 0x02, 0x66, 0xdd, 0x02, 0x30, 0x64, 0x6c, +0x01, 0x58, 0x14, 0x1d, 0x1d, 0x68, 0xfd, 0x02, 0x65, 0x00, 0x5d, 0x08, 0x66, 0x08, 0x30, 0x5d, +0xdd, 0x02, 0x66, 0xdd, 0x02, 0x30, 0x64, 0x6c, 0x01, 0x58, 0x15, 0x1d, 0x1d, 0x68, 0x80, 0x03, +0x65, 0x00, 0x5d, 0x08, 0x66, 0x08, 0x30, 0x5d, 0xdd, 0x02, 0x66, 0xdd, 0x02, 0x30, 0x64, 0x6c, +0x01, 0x58, 0x16, 0x1d, 0x1d, 0x68, 0x83, 0x03, 0x65, 0x00, 0x5d, 0x08, 0x66, 0x08, 0x30, 0x5d, +0xdd, 0x02, 0x66, 0xdd, 0x02, 0x30, 0x64, 0x6c, 0x01, 0x58, 0x17, 0x1d, 0x1d, 0x68, 0x86, 0x03, +0x47, 0x00, 0x00, 0x89, 0x02, 0x02, 0x01, 0x03, 0x04, 0x3b, 0xd0, 0x30, 0x5e, 0x05, 0x24, 0x01, +0x68, 0x05, 0x5d, 0x88, 0x03, 0x66, 0x88, 0x03, 0x40, 0x8a, 0x02, 0x61, 0x89, 0x03, 0x5d, 0x88, +0x03, 0x66, 0x88, 0x03, 0x40, 0x8b, 0x02, 0x61, 0x8a, 0x03, 0x5d, 0x88, 0x03, 0x66, 0x88, 0x03, +0x40, 0x8c, 0x02, 0x61, 0x8b, 0x03, 0x5d, 0x8c, 0x03, 0x5d, 0x88, 0x03, 0x66, 0x88, 0x03, 0x46, +0x8c, 0x03, 0x01, 0x29, 0x47, 0x00, 0x00, 0x8a, 0x02, 0x02, 0x03, 0x03, 0x03, 0x68, 0x20, 0x80, +0xd6, 0x02, 0xd5, 0x20, 0x85, 0xd6, 0xd0, 0x80, 0xd6, 0x02, 0xd5, 0x2c, 0xcf, 0x01, 0xd1, 0x66, +0x8d, 0x03, 0xa0, 0x2c, 0xcf, 0x01, 0xa0, 0x85, 0xd6, 0xd1, 0x66, 0x8e, 0x03, 0x12, 0x07, 0x00, +0x00, 0xd2, 0x2c, 0xbb, 0x01, 0xa0, 0x85, 0xd6, 0xd1, 0x66, 0x8f, 0x03, 0x12, 0x07, 0x00, 0x00, +0xd2, 0x2c, 0xbe, 0x01, 0xa0, 0x85, 0xd6, 0xd1, 0x66, 0x90, 0x03, 0x12, 0x07, 0x00, 0x00, 0xd2, +0x2c, 0xd4, 0x01, 0xa0, 0x85, 0xd6, 0xd1, 0x66, 0x91, 0x03, 0x12, 0x07, 0x00, 0x00, 0xd2, 0x2c, +0xd6, 0x01, 0xa0, 0x85, 0xd6, 0xd1, 0x66, 0x92, 0x03, 0x12, 0x07, 0x00, 0x00, 0xd2, 0x2c, 0xd8, +0x01, 0xa0, 0x85, 0xd6, 0xd2, 0x48, 0x00, 0x00, 0x8b, 0x02, 0x03, 0x03, 0x03, 0x03, 0x18, 0x20, +0x80, 0xd6, 0x02, 0xd6, 0xd0, 0x80, 0xd6, 0x02, 0xd6, 0xd2, 0x5d, 0x93, 0x03, 0xd1, 0x46, 0x93, +0x03, 0x01, 0x46, 0x94, 0x03, 0x01, 0x48, 0x00, 0x00, 0x8c, 0x02, 0x03, 0x03, 0x03, 0x03, 0x18, +0x20, 0x80, 0xd6, 0x02, 0xd6, 0xd0, 0x80, 0xd6, 0x02, 0xd6, 0xd2, 0x5d, 0x93, 0x03, 0xd1, 0x46, +0x93, 0x03, 0x01, 0x46, 0x95, 0x03, 0x01, 0x48, 0x00, 0x00, 0x96, 0x02, 0x02, 0x02, 0x04, 0x05, +0x0e, 0xd0, 0x30, 0x5d, 0x94, 0x03, 0xd1, 0x46, 0x94, 0x03, 0x01, 0x20, 0xab, 0x96, 0x48, 0x00, +0x00, 0x97, 0x02, 0x01, 0x03, 0x04, 0x05, 0x06, 0xd0, 0x30, 0xd0, 0x49, 0x00, 0x47, 0x00, 0x00, +0x98, 0x02, 0x02, 0x01, 0x01, 0x03, 0x16, 0xd0, 0x30, 0x65, 0x00, 0x5d, 0x08, 0x66, 0x08, 0x30, +0x5d, 0x9d, 0x03, 0x66, 0x9d, 0x03, 0x58, 0x18, 0x1d, 0x68, 0xd6, 0x02, 0x47, 0x00, 0x00, 0x99, +0x02, 0x02, 0x01, 0x03, 0x04, 0x83, 0x04, 0xd0, 0x30, 0x5e, 0x05, 0x24, 0x07, 0x68, 0x05, 0x5d, +0x9e, 0x03, 0x66, 0x9e, 0x03, 0x40, 0x9a, 0x02, 0x61, 0x9f, 0x03, 0x5d, 0x9e, 0x03, 0x66, 0x9e, +0x03, 0x40, 0x9b, 0x02, 0x61, 0xa0, 0x03, 0x5d, 0x9e, 0x03, 0x66, 0x9e, 0x03, 0x40, 0x9c, 0x02, +0x61, 0xa1, 0x03, 0x5d, 0x9e, 0x03, 0x66, 0x9e, 0x03, 0x40, 0x9d, 0x02, 0x61, 0xa2, 0x03, 0x5d, +0x9e, 0x03, 0x66, 0x9e, 0x03, 0x40, 0x9e, 0x02, 0x61, 0xa3, 0x03, 0x5d, 0x9e, 0x03, 0x66, 0x9e, +0x03, 0x40, 0x9f, 0x02, 0x61, 0xa4, 0x03, 0x5d, 0x9e, 0x03, 0x66, 0x9e, 0x03, 0x40, 0xa0, 0x02, +0x61, 0xa5, 0x03, 0x5d, 0x9e, 0x03, 0x66, 0x9e, 0x03, 0x40, 0xa1, 0x02, 0x61, 0xa6, 0x03, 0x5d, +0x9e, 0x03, 0x66, 0x9e, 0x03, 0x40, 0xa2, 0x02, 0x61, 0xa7, 0x03, 0x5d, 0x9e, 0x03, 0x66, 0x9e, +0x03, 0x40, 0xa3, 0x02, 0x61, 0xa8, 0x03, 0x5d, 0x9e, 0x03, 0x66, 0x9e, 0x03, 0x40, 0xa4, 0x02, +0x61, 0xa9, 0x03, 0x5d, 0x9e, 0x03, 0x66, 0x9e, 0x03, 0x40, 0xa5, 0x02, 0x61, 0xaa, 0x03, 0x5d, +0x9e, 0x03, 0x66, 0x9e, 0x03, 0x40, 0xa6, 0x02, 0x61, 0xab, 0x03, 0x5d, 0x9e, 0x03, 0x66, 0x9e, +0x03, 0x40, 0xa7, 0x02, 0x61, 0xac, 0x03, 0x5d, 0x9e, 0x03, 0x66, 0x9e, 0x03, 0x40, 0xa8, 0x02, +0x61, 0xad, 0x03, 0x5d, 0x9e, 0x03, 0x66, 0x9e, 0x03, 0x40, 0xa9, 0x02, 0x61, 0xae, 0x03, 0x5d, +0x9e, 0x03, 0x66, 0x9e, 0x03, 0x40, 0xaa, 0x02, 0x61, 0xaf, 0x03, 0x5d, 0x9e, 0x03, 0x66, 0x9e, +0x03, 0x40, 0xab, 0x02, 0x61, 0xb0, 0x03, 0x5d, 0x9e, 0x03, 0x66, 0x9e, 0x03, 0x40, 0xac, 0x02, +0x61, 0xb1, 0x03, 0x5d, 0x9e, 0x03, 0x66, 0x9e, 0x03, 0x40, 0xad, 0x02, 0x61, 0xb2, 0x03, 0x5d, +0x9e, 0x03, 0x66, 0x9e, 0x03, 0x40, 0xae, 0x02, 0x61, 0xb3, 0x03, 0x5d, 0x9e, 0x03, 0x66, 0x9e, +0x03, 0x40, 0xaf, 0x02, 0x61, 0xb4, 0x03, 0x5d, 0x9e, 0x03, 0x66, 0x9e, 0x03, 0x40, 0xb0, 0x02, +0x61, 0xb5, 0x03, 0x5d, 0x9e, 0x03, 0x66, 0x9e, 0x03, 0x40, 0xb1, 0x02, 0x61, 0xb6, 0x03, 0x5d, +0x9e, 0x03, 0x66, 0x9e, 0x03, 0x40, 0xb2, 0x02, 0x61, 0xb7, 0x03, 0x5d, 0x9e, 0x03, 0x66, 0x9e, +0x03, 0x40, 0xb3, 0x02, 0x61, 0xb8, 0x03, 0x5d, 0x9e, 0x03, 0x66, 0x9e, 0x03, 0x40, 0xb4, 0x02, +0x61, 0xb9, 0x03, 0x5d, 0x9e, 0x03, 0x66, 0x9e, 0x03, 0x40, 0xb5, 0x02, 0x61, 0xba, 0x03, 0x5d, +0x9e, 0x03, 0x66, 0x9e, 0x03, 0x40, 0xb6, 0x02, 0x61, 0xbb, 0x03, 0x5d, 0x9e, 0x03, 0x66, 0x9e, +0x03, 0x40, 0xb7, 0x02, 0x61, 0xbc, 0x03, 0x5d, 0x9e, 0x03, 0x66, 0x9e, 0x03, 0x40, 0xb8, 0x02, +0x61, 0xbd, 0x03, 0x5d, 0x9e, 0x03, 0x66, 0x9e, 0x03, 0x40, 0xb9, 0x02, 0x61, 0xbe, 0x03, 0x5d, +0x9e, 0x03, 0x66, 0x9e, 0x03, 0x40, 0xba, 0x02, 0x61, 0xbf, 0x03, 0x5d, 0x9e, 0x03, 0x66, 0x9e, +0x03, 0x40, 0xbb, 0x02, 0x61, 0xc0, 0x03, 0x5d, 0x9e, 0x03, 0x66, 0x9e, 0x03, 0x40, 0xbc, 0x02, +0x61, 0xc1, 0x03, 0x5d, 0x9e, 0x03, 0x66, 0x9e, 0x03, 0x40, 0xbd, 0x02, 0x61, 0xc2, 0x03, 0x5d, +0x9e, 0x03, 0x66, 0x9e, 0x03, 0x40, 0xbe, 0x02, 0x61, 0xc3, 0x03, 0x5d, 0x9e, 0x03, 0x66, 0x9e, +0x03, 0x40, 0xbf, 0x02, 0x61, 0xc4, 0x03, 0x5d, 0x9e, 0x03, 0x66, 0x9e, 0x03, 0x40, 0xc0, 0x02, +0x61, 0xc5, 0x03, 0x5d, 0x9e, 0x03, 0x66, 0x9e, 0x03, 0x40, 0xc1, 0x02, 0x61, 0xc6, 0x03, 0x5d, +0x9e, 0x03, 0x66, 0x9e, 0x03, 0x40, 0xc2, 0x02, 0x61, 0xc7, 0x03, 0x5d, 0xc8, 0x03, 0x5d, 0x9e, +0x03, 0x66, 0x9e, 0x03, 0x46, 0xc8, 0x03, 0x01, 0x29, 0x47, 0x00, 0x00, 0x9a, 0x02, 0x02, 0x03, +0x03, 0x03, 0x11, 0x20, 0x80, 0xc9, 0x03, 0xd6, 0xd0, 0x80, 0xc9, 0x03, 0xd6, 0xd2, 0xd1, 0x46, +0xca, 0x03, 0x01, 0x48, 0x00, 0x00, 0x9b, 0x02, 0x01, 0x02, 0x03, 0x03, 0x0f, 0x20, 0x80, 0xc9, +0x03, 0xd5, 0xd0, 0x80, 0xc9, 0x03, 0xd5, 0xd1, 0x46, 0x34, 0x00, 0x48, 0x00, 0x00, 0x9c, 0x02, +0x02, 0x02, 0x03, 0x03, 0x12, 0x20, 0x80, 0xc9, 0x03, 0xd5, 0xd0, 0x80, 0xc9, 0x03, 0xd5, 0xd1, +0x24, 0x00, 0x46, 0xcb, 0x03, 0x01, 0x48, 0x00, 0x00, 0x9d, 0x02, 0x01, 0x02, 0x03, 0x03, 0x10, +0x20, 0x80, 0xc9, 0x03, 0xd5, 0xd0, 0x80, 0xc9, 0x03, 0xd5, 0xd1, 0x46, 0xcc, 0x03, 0x00, 0x48, +0x00, 0x00, 0x9e, 0x02, 0x01, 0x02, 0x03, 0x03, 0x10, 0x20, 0x80, 0xc9, 0x03, 0xd5, 0xd0, 0x80, +0xc9, 0x03, 0xd5, 0xd1, 0x46, 0xcd, 0x03, 0x00, 0x48, 0x00, 0x00, 0x9f, 0x02, 0x01, 0x02, 0x03, +0x03, 0x10, 0x20, 0x80, 0xc9, 0x03, 0xd5, 0xd0, 0x80, 0xc9, 0x03, 0xd5, 0xd1, 0x46, 0xce, 0x03, +0x00, 0x48, 0x00, 0x00, 0xa0, 0x02, 0x01, 0x02, 0x03, 0x03, 0x10, 0x20, 0x80, 0xc9, 0x03, 0xd5, +0xd0, 0x80, 0xc9, 0x03, 0xd5, 0xd1, 0x46, 0xcf, 0x03, 0x00, 0x48, 0x00, 0x00, 0xa1, 0x02, 0x01, +0x02, 0x03, 0x03, 0x10, 0x20, 0x80, 0xc9, 0x03, 0xd5, 0xd0, 0x80, 0xc9, 0x03, 0xd5, 0xd1, 0x46, +0xd0, 0x03, 0x00, 0x48, 0x00, 0x00, 0xa2, 0x02, 0x01, 0x02, 0x03, 0x03, 0x10, 0x20, 0x80, 0xc9, +0x03, 0xd5, 0xd0, 0x80, 0xc9, 0x03, 0xd5, 0xd1, 0x46, 0xd1, 0x03, 0x00, 0x48, 0x00, 0x00, 0xa3, +0x02, 0x01, 0x02, 0x03, 0x03, 0x10, 0x20, 0x80, 0xc9, 0x03, 0xd5, 0xd0, 0x80, 0xc9, 0x03, 0xd5, +0xd1, 0x46, 0xd2, 0x03, 0x00, 0x48, 0x00, 0x00, 0xa4, 0x02, 0x01, 0x02, 0x03, 0x03, 0x10, 0x20, +0x80, 0xc9, 0x03, 0xd5, 0xd0, 0x80, 0xc9, 0x03, 0xd5, 0xd1, 0x46, 0xd3, 0x03, 0x00, 0x48, 0x00, +0x00, 0xa5, 0x02, 0x01, 0x02, 0x03, 0x03, 0x10, 0x20, 0x80, 0xc9, 0x03, 0xd5, 0xd0, 0x80, 0xc9, +0x03, 0xd5, 0xd1, 0x46, 0xd4, 0x03, 0x00, 0x48, 0x00, 0x00, 0xa6, 0x02, 0x01, 0x02, 0x03, 0x03, +0x10, 0x20, 0x80, 0xc9, 0x03, 0xd5, 0xd0, 0x80, 0xc9, 0x03, 0xd5, 0xd1, 0x46, 0xd5, 0x03, 0x00, +0x48, 0x00, 0x00, 0xa7, 0x02, 0x01, 0x02, 0x03, 0x03, 0x10, 0x20, 0x80, 0xc9, 0x03, 0xd5, 0xd0, +0x80, 0xc9, 0x03, 0xd5, 0xd1, 0x46, 0xd6, 0x03, 0x00, 0x48, 0x00, 0x00, 0xa8, 0x02, 0x01, 0x02, +0x03, 0x03, 0x10, 0x20, 0x80, 0xc9, 0x03, 0xd5, 0xd0, 0x80, 0xc9, 0x03, 0xd5, 0xd1, 0x46, 0xd7, +0x03, 0x00, 0x48, 0x00, 0x00, 0xa9, 0x02, 0x01, 0x02, 0x03, 0x03, 0x10, 0x20, 0x80, 0xc9, 0x03, +0xd5, 0xd0, 0x80, 0xc9, 0x03, 0xd5, 0xd1, 0x46, 0xd8, 0x03, 0x00, 0x48, 0x00, 0x00, 0xaa, 0x02, +0x01, 0x02, 0x03, 0x03, 0x10, 0x20, 0x80, 0xc9, 0x03, 0xd5, 0xd0, 0x80, 0xc9, 0x03, 0xd5, 0xd1, +0x46, 0xd9, 0x03, 0x00, 0x48, 0x00, 0x00, 0xab, 0x02, 0x01, 0x02, 0x03, 0x03, 0x10, 0x20, 0x80, +0xc9, 0x03, 0xd5, 0xd0, 0x80, 0xc9, 0x03, 0xd5, 0xd1, 0x46, 0xda, 0x03, 0x00, 0x48, 0x00, 0x00, +0xac, 0x02, 0x01, 0x02, 0x03, 0x03, 0x10, 0x20, 0x80, 0xc9, 0x03, 0xd5, 0xd0, 0x80, 0xc9, 0x03, +0xd5, 0xd1, 0x46, 0xdb, 0x03, 0x00, 0x48, 0x00, 0x00, 0xad, 0x02, 0x01, 0x02, 0x03, 0x03, 0x10, +0x20, 0x80, 0xc9, 0x03, 0xd5, 0xd0, 0x80, 0xc9, 0x03, 0xd5, 0xd1, 0x46, 0xdc, 0x03, 0x00, 0x48, +0x00, 0x00, 0xae, 0x02, 0x01, 0x02, 0x03, 0x03, 0x10, 0x20, 0x80, 0xc9, 0x03, 0xd5, 0xd0, 0x80, +0xc9, 0x03, 0xd5, 0xd1, 0x46, 0xdd, 0x03, 0x00, 0x48, 0x00, 0x00, 0xaf, 0x02, 0x01, 0x02, 0x03, +0x03, 0x10, 0x20, 0x80, 0xc9, 0x03, 0xd5, 0xd0, 0x80, 0xc9, 0x03, 0xd5, 0xd1, 0x46, 0xde, 0x03, +0x00, 0x48, 0x00, 0x00, 0xb0, 0x02, 0x01, 0x02, 0x03, 0x03, 0x10, 0x20, 0x80, 0xc9, 0x03, 0xd5, +0xd0, 0x80, 0xc9, 0x03, 0xd5, 0xd1, 0x46, 0xdf, 0x03, 0x00, 0x48, 0x00, 0x00, 0xb1, 0x02, 0x01, +0x02, 0x03, 0x03, 0x10, 0x20, 0x80, 0xc9, 0x03, 0xd5, 0xd0, 0x80, 0xc9, 0x03, 0xd5, 0xd1, 0x46, +0xe0, 0x03, 0x00, 0x48, 0x00, 0x00, 0xb2, 0x02, 0x01, 0x02, 0x03, 0x03, 0x10, 0x20, 0x80, 0xc9, +0x03, 0xd5, 0xd0, 0x80, 0xc9, 0x03, 0xd5, 0xd1, 0x46, 0xe1, 0x03, 0x00, 0x48, 0x00, 0x00, 0xb3, +0x02, 0x01, 0x02, 0x03, 0x03, 0x10, 0x20, 0x80, 0xc9, 0x03, 0xd5, 0xd0, 0x80, 0xc9, 0x03, 0xd5, +0xd1, 0x46, 0xe2, 0x03, 0x00, 0x48, 0x00, 0x00, 0xb4, 0x02, 0x01, 0x02, 0x03, 0x03, 0x10, 0x20, +0x80, 0xc9, 0x03, 0xd5, 0xd0, 0x80, 0xc9, 0x03, 0xd5, 0xd1, 0x46, 0xe3, 0x03, 0x00, 0x48, 0x00, +0x00, 0xb5, 0x02, 0x03, 0x06, 0x03, 0x03, 0x1a, 0x20, 0x80, 0xc9, 0x03, 0x63, 0x05, 0xd0, 0x80, +0xc9, 0x03, 0x63, 0x05, 0x62, 0x05, 0x66, 0xe4, 0x03, 0x62, 0x05, 0x62, 0x04, 0x46, 0xe5, 0x03, +0x02, 0x48, 0x00, 0x00, 0xb6, 0x02, 0x03, 0x05, 0x03, 0x03, 0x19, 0x20, 0x80, 0xc9, 0x03, 0x63, +0x04, 0xd0, 0x80, 0xc9, 0x03, 0x63, 0x04, 0x62, 0x04, 0x66, 0xe6, 0x03, 0x62, 0x04, 0xd3, 0x46, +0xe5, 0x03, 0x02, 0x48, 0x00, 0x00, 0xb7, 0x02, 0x03, 0x04, 0x03, 0x03, 0x15, 0x20, 0x80, 0xc9, +0x03, 0xd7, 0xd0, 0x80, 0xc9, 0x03, 0xd7, 0xd3, 0x66, 0xe7, 0x03, 0xd3, 0xd2, 0x46, 0xe5, 0x03, +0x02, 0x48, 0x00, 0x00, 0xb8, 0x02, 0x03, 0x07, 0x03, 0x03, 0x1a, 0x20, 0x80, 0xc9, 0x03, 0x63, +0x06, 0xd0, 0x80, 0xc9, 0x03, 0x63, 0x06, 0x62, 0x06, 0x66, 0xe8, 0x03, 0x62, 0x06, 0x62, 0x05, +0x46, 0xe5, 0x03, 0x02, 0x48, 0x00, 0x00, 0xb9, 0x02, 0x03, 0x06, 0x03, 0x03, 0x1a, 0x20, 0x80, +0xc9, 0x03, 0x63, 0x05, 0xd0, 0x80, 0xc9, 0x03, 0x63, 0x05, 0x62, 0x05, 0x66, 0xe9, 0x03, 0x62, +0x05, 0x62, 0x04, 0x46, 0xe5, 0x03, 0x02, 0x48, 0x00, 0x00, 0xba, 0x02, 0x03, 0x05, 0x03, 0x03, +0x19, 0x20, 0x80, 0xc9, 0x03, 0x63, 0x04, 0xd0, 0x80, 0xc9, 0x03, 0x63, 0x04, 0x62, 0x04, 0x66, +0xea, 0x03, 0x62, 0x04, 0xd3, 0x46, 0xe5, 0x03, 0x02, 0x48, 0x00, 0x00, 0xbb, 0x02, 0x03, 0x04, +0x03, 0x03, 0x15, 0x20, 0x80, 0xc9, 0x03, 0xd7, 0xd0, 0x80, 0xc9, 0x03, 0xd7, 0xd3, 0x66, 0xeb, +0x03, 0xd3, 0xd2, 0x46, 0xe5, 0x03, 0x02, 0x48, 0x00, 0x00, 0xbc, 0x02, 0x03, 0x06, 0x03, 0x03, +0x1a, 0x20, 0x80, 0xc9, 0x03, 0x63, 0x05, 0xd0, 0x80, 0xc9, 0x03, 0x63, 0x05, 0x62, 0x05, 0x66, +0xec, 0x03, 0x62, 0x05, 0x62, 0x04, 0x46, 0xe5, 0x03, 0x02, 0x48, 0x00, 0x00, 0xbd, 0x02, 0x03, +0x05, 0x03, 0x03, 0x19, 0x20, 0x80, 0xc9, 0x03, 0x63, 0x04, 0xd0, 0x80, 0xc9, 0x03, 0x63, 0x04, +0x62, 0x04, 0x66, 0xed, 0x03, 0x62, 0x04, 0xd3, 0x46, 0xe5, 0x03, 0x02, 0x48, 0x00, 0x00, 0xbe, +0x02, 0x03, 0x04, 0x03, 0x03, 0x15, 0x20, 0x80, 0xc9, 0x03, 0xd7, 0xd0, 0x80, 0xc9, 0x03, 0xd7, +0xd3, 0x66, 0xee, 0x03, 0xd3, 0xd2, 0x46, 0xe5, 0x03, 0x02, 0x48, 0x00, 0x00, 0xbf, 0x02, 0x03, +0x07, 0x03, 0x03, 0x1a, 0x20, 0x80, 0xc9, 0x03, 0x63, 0x06, 0xd0, 0x80, 0xc9, 0x03, 0x63, 0x06, +0x62, 0x06, 0x66, 0xef, 0x03, 0x62, 0x06, 0x62, 0x05, 0x46, 0xe5, 0x03, 0x02, 0x48, 0x00, 0x00, +0xc0, 0x02, 0x03, 0x06, 0x03, 0x03, 0x1a, 0x20, 0x80, 0xc9, 0x03, 0x63, 0x05, 0xd0, 0x80, 0xc9, +0x03, 0x63, 0x05, 0x62, 0x05, 0x66, 0xf0, 0x03, 0x62, 0x05, 0x62, 0x04, 0x46, 0xe5, 0x03, 0x02, +0x48, 0x00, 0x00, 0xc1, 0x02, 0x03, 0x05, 0x03, 0x03, 0x19, 0x20, 0x80, 0xc9, 0x03, 0x63, 0x04, +0xd0, 0x80, 0xc9, 0x03, 0x63, 0x04, 0x62, 0x04, 0x66, 0xf1, 0x03, 0x62, 0x04, 0xd3, 0x46, 0xe5, +0x03, 0x02, 0x48, 0x00, 0x00, 0xc2, 0x02, 0x03, 0x04, 0x03, 0x03, 0x15, 0x20, 0x80, 0xc9, 0x03, +0xd7, 0xd0, 0x80, 0xc9, 0x03, 0xd7, 0xd3, 0x66, 0xf2, 0x03, 0xd3, 0xd2, 0x46, 0xe5, 0x03, 0x02, +0x48, 0x00, 0x00, 0xc9, 0x02, 0x02, 0x02, 0x04, 0x05, 0x0b, 0xd0, 0x30, 0x5d, 0xca, 0x03, 0xd1, +0x46, 0xca, 0x03, 0x01, 0x48, 0x00, 0x00, 0xca, 0x02, 0x02, 0x01, 0x04, 0x05, 0x0c, 0xd0, 0x30, +0x5d, 0xcb, 0x03, 0x24, 0x00, 0x46, 0xcb, 0x03, 0x01, 0x48, 0x00, 0x00, 0xcb, 0x02, 0x02, 0x01, +0x04, 0x05, 0x0c, 0xd0, 0x30, 0x5d, 0xcb, 0x03, 0x24, 0x01, 0x46, 0xcb, 0x03, 0x01, 0x48, 0x00, +0x00, 0xcc, 0x02, 0x02, 0x01, 0x04, 0x05, 0x0c, 0xd0, 0x30, 0x5d, 0xcb, 0x03, 0x24, 0x02, 0x46, +0xcb, 0x03, 0x01, 0x48, 0x00, 0x00, 0xcd, 0x02, 0x02, 0x01, 0x04, 0x05, 0x0c, 0xd0, 0x30, 0x5d, +0xcb, 0x03, 0x24, 0x03, 0x46, 0xcb, 0x03, 0x01, 0x48, 0x00, 0x00, 0xce, 0x02, 0x02, 0x01, 0x04, +0x05, 0x0c, 0xd0, 0x30, 0x5d, 0xcb, 0x03, 0x24, 0x04, 0x46, 0xcb, 0x03, 0x01, 0x48, 0x00, 0x00, +0xcf, 0x02, 0x02, 0x01, 0x04, 0x05, 0x0c, 0xd0, 0x30, 0x5d, 0xcb, 0x03, 0x24, 0x05, 0x46, 0xcb, +0x03, 0x01, 0x48, 0x00, 0x00, 0xd0, 0x02, 0x02, 0x01, 0x04, 0x05, 0x0c, 0xd0, 0x30, 0x5d, 0xcb, +0x03, 0x24, 0x06, 0x46, 0xcb, 0x03, 0x01, 0x48, 0x00, 0x00, 0xf1, 0x02, 0x01, 0x01, 0x04, 0x05, +0x0a, 0xd0, 0x30, 0x5d, 0xda, 0x03, 0x46, 0xda, 0x03, 0x00, 0x48, 0x00, 0x00, 0xf2, 0x02, 0x02, +0x02, 0x04, 0x05, 0x0c, 0xd0, 0x30, 0x5d, 0xe4, 0x03, 0xd1, 0x46, 0xe4, 0x03, 0x01, 0x29, 0x47, +0x00, 0x00, 0xf3, 0x02, 0x01, 0x01, 0x04, 0x05, 0x0a, 0xd0, 0x30, 0x5d, 0xdb, 0x03, 0x46, 0xdb, +0x03, 0x00, 0x48, 0x00, 0x00, 0xf4, 0x02, 0x02, 0x02, 0x04, 0x05, 0x0c, 0xd0, 0x30, 0x5d, 0xe6, +0x03, 0xd1, 0x46, 0xe6, 0x03, 0x01, 0x29, 0x47, 0x00, 0x00, 0xf5, 0x02, 0x01, 0x01, 0x04, 0x05, +0x0a, 0xd0, 0x30, 0x5d, 0xdc, 0x03, 0x46, 0xdc, 0x03, 0x00, 0x48, 0x00, 0x00, 0xf6, 0x02, 0x02, +0x02, 0x04, 0x05, 0x0c, 0xd0, 0x30, 0x5d, 0xe7, 0x03, 0xd1, 0x46, 0xe7, 0x03, 0x01, 0x29, 0x47, +0x00, 0x00, 0xf7, 0x02, 0x01, 0x01, 0x04, 0x05, 0x0a, 0xd0, 0x30, 0x5d, 0xde, 0x03, 0x46, 0xde, +0x03, 0x00, 0x48, 0x00, 0x00, 0xf8, 0x02, 0x02, 0x02, 0x04, 0x05, 0x0c, 0xd0, 0x30, 0x5d, 0xe8, +0x03, 0xd1, 0x46, 0xe8, 0x03, 0x01, 0x29, 0x47, 0x00, 0x00, 0xf9, 0x02, 0x01, 0x01, 0x04, 0x05, +0x0a, 0xd0, 0x30, 0x5d, 0xdf, 0x03, 0x46, 0xdf, 0x03, 0x00, 0x48, 0x00, 0x00, 0xfa, 0x02, 0x02, +0x02, 0x04, 0x05, 0x0c, 0xd0, 0x30, 0x5d, 0xe9, 0x03, 0xd1, 0x46, 0xe9, 0x03, 0x01, 0x29, 0x47, +0x00, 0x00, 0xfb, 0x02, 0x01, 0x01, 0x04, 0x05, 0x0a, 0xd0, 0x30, 0x5d, 0xe0, 0x03, 0x46, 0xe0, +0x03, 0x00, 0x48, 0x00, 0x00, 0xfc, 0x02, 0x02, 0x02, 0x04, 0x05, 0x0c, 0xd0, 0x30, 0x5d, 0xea, +0x03, 0xd1, 0x46, 0xea, 0x03, 0x01, 0x29, 0x47, 0x00, 0x00, 0xfd, 0x02, 0x01, 0x01, 0x04, 0x05, +0x0a, 0xd0, 0x30, 0x5d, 0xe1, 0x03, 0x46, 0xe1, 0x03, 0x00, 0x48, 0x00, 0x00, 0xfe, 0x02, 0x02, +0x02, 0x04, 0x05, 0x0c, 0xd0, 0x30, 0x5d, 0xeb, 0x03, 0xd1, 0x46, 0xeb, 0x03, 0x01, 0x29, 0x47, +0x00, 0x00, 0xff, 0x02, 0x01, 0x01, 0x04, 0x05, 0x0a, 0xd0, 0x30, 0x5d, 0xd2, 0x03, 0x46, 0xd2, +0x03, 0x00, 0x48, 0x00, 0x00, 0x80, 0x03, 0x02, 0x02, 0x04, 0x05, 0x0c, 0xd0, 0x30, 0x5d, 0xec, +0x03, 0xd1, 0x46, 0xec, 0x03, 0x01, 0x29, 0x47, 0x00, 0x00, 0x81, 0x03, 0x01, 0x01, 0x04, 0x05, +0x0a, 0xd0, 0x30, 0x5d, 0xd3, 0x03, 0x46, 0xd3, 0x03, 0x00, 0x48, 0x00, 0x00, 0x82, 0x03, 0x02, +0x02, 0x04, 0x05, 0x0c, 0xd0, 0x30, 0x5d, 0xed, 0x03, 0xd1, 0x46, 0xed, 0x03, 0x01, 0x29, 0x47, +0x00, 0x00, 0x83, 0x03, 0x01, 0x01, 0x04, 0x05, 0x0a, 0xd0, 0x30, 0x5d, 0xd4, 0x03, 0x46, 0xd4, +0x03, 0x00, 0x48, 0x00, 0x00, 0x84, 0x03, 0x02, 0x02, 0x04, 0x05, 0x0c, 0xd0, 0x30, 0x5d, 0xee, +0x03, 0xd1, 0x46, 0xee, 0x03, 0x01, 0x29, 0x47, 0x00, 0x00, 0x85, 0x03, 0x01, 0x01, 0x04, 0x05, +0x0a, 0xd0, 0x30, 0x5d, 0xd6, 0x03, 0x46, 0xd6, 0x03, 0x00, 0x48, 0x00, 0x00, 0x86, 0x03, 0x02, +0x02, 0x04, 0x05, 0x0c, 0xd0, 0x30, 0x5d, 0xef, 0x03, 0xd1, 0x46, 0xef, 0x03, 0x01, 0x29, 0x47, +0x00, 0x00, 0x87, 0x03, 0x01, 0x01, 0x04, 0x05, 0x0a, 0xd0, 0x30, 0x5d, 0xd7, 0x03, 0x46, 0xd7, +0x03, 0x00, 0x48, 0x00, 0x00, 0x88, 0x03, 0x02, 0x02, 0x04, 0x05, 0x0c, 0xd0, 0x30, 0x5d, 0xf0, +0x03, 0xd1, 0x46, 0xf0, 0x03, 0x01, 0x29, 0x47, 0x00, 0x00, 0x89, 0x03, 0x01, 0x01, 0x04, 0x05, +0x0a, 0xd0, 0x30, 0x5d, 0xd8, 0x03, 0x46, 0xd8, 0x03, 0x00, 0x48, 0x00, 0x00, 0x8a, 0x03, 0x02, +0x02, 0x04, 0x05, 0x0c, 0xd0, 0x30, 0x5d, 0xf1, 0x03, 0xd1, 0x46, 0xf1, 0x03, 0x01, 0x29, 0x47, +0x00, 0x00, 0x8b, 0x03, 0x01, 0x01, 0x04, 0x05, 0x0a, 0xd0, 0x30, 0x5d, 0xd9, 0x03, 0x46, 0xd9, +0x03, 0x00, 0x48, 0x00, 0x00, 0x8c, 0x03, 0x02, 0x02, 0x04, 0x05, 0x0c, 0xd0, 0x30, 0x5d, 0xf2, +0x03, 0xd1, 0x46, 0xf2, 0x03, 0x01, 0x29, 0x47, 0x00, 0x00, 0x8d, 0x03, 0x01, 0x01, 0x04, 0x05, +0x0a, 0xd0, 0x30, 0x5d, 0xe3, 0x03, 0x46, 0xe3, 0x03, 0x00, 0x48, 0x00, 0x00, 0x8e, 0x03, 0x02, +0x02, 0x04, 0x05, 0x0c, 0xd0, 0x30, 0x5d, 0xf3, 0x03, 0xd1, 0x46, 0xf3, 0x03, 0x01, 0x29, 0x47, +0x00, 0x00, 0x8f, 0x03, 0x01, 0x01, 0x04, 0x05, 0x0a, 0xd0, 0x30, 0x5d, 0xe2, 0x03, 0x46, 0xe2, +0x03, 0x00, 0x48, 0x00, 0x00, 0x90, 0x03, 0x01, 0x01, 0x04, 0x05, 0x0a, 0xd0, 0x30, 0x5d, 0xdd, +0x03, 0x46, 0xdd, 0x03, 0x00, 0x48, 0x00, 0x00, 0x91, 0x03, 0x01, 0x01, 0x04, 0x05, 0x0a, 0xd0, +0x30, 0x5d, 0xd5, 0x03, 0x46, 0xd5, 0x03, 0x00, 0x48, 0x00, 0x00, 0x92, 0x03, 0x01, 0x08, 0x04, +0x05, 0x06, 0xd0, 0x30, 0xd0, 0x49, 0x00, 0x47, 0x00, 0x00, 0x93, 0x03, 0x02, 0x01, 0x01, 0x03, +0x16, 0xd0, 0x30, 0x65, 0x00, 0x5d, 0x08, 0x66, 0x08, 0x30, 0x5d, 0x8b, 0x04, 0x66, 0x8b, 0x04, +0x58, 0x19, 0x1d, 0x68, 0xc9, 0x03, 0x47, 0x00, 0x00, 0x95, 0x03, 0x02, 0x01, 0x03, 0x04, 0x89, +0x04, 0xd0, 0x30, 0x5e, 0x05, 0x24, 0x01, 0x68, 0x05, 0xd0, 0x40, 0x96, 0x03, 0x61, 0x8c, 0x04, +0xd0, 0x40, 0x97, 0x03, 0x61, 0x8d, 0x04, 0xd0, 0x40, 0x98, 0x03, 0x61, 0x8e, 0x04, 0x5d, 0x8f, +0x04, 0x66, 0x8f, 0x04, 0x5d, 0x90, 0x04, 0x66, 0x90, 0x04, 0x66, 0x8f, 0x04, 0x66, 0x91, 0x04, +0x61, 0x91, 0x04, 0x5d, 0x8f, 0x04, 0x66, 0x8f, 0x04, 0x40, 0x99, 0x03, 0x61, 0x92, 0x04, 0x5d, +0x8f, 0x04, 0x66, 0x8f, 0x04, 0x40, 0x9a, 0x03, 0x61, 0x93, 0x04, 0x5d, 0x8f, 0x04, 0x66, 0x8f, +0x04, 0x40, 0x9b, 0x03, 0x61, 0x94, 0x04, 0x5d, 0x8f, 0x04, 0x66, 0x8f, 0x04, 0x40, 0x9c, 0x03, +0x61, 0x95, 0x04, 0x5d, 0x8f, 0x04, 0x66, 0x8f, 0x04, 0x40, 0x9d, 0x03, 0x61, 0x96, 0x04, 0x5d, +0x8f, 0x04, 0x66, 0x8f, 0x04, 0x40, 0x9e, 0x03, 0x61, 0x97, 0x04, 0x5d, 0x8f, 0x04, 0x66, 0x8f, +0x04, 0x40, 0x9f, 0x03, 0x61, 0x98, 0x04, 0x5d, 0x8f, 0x04, 0x66, 0x8f, 0x04, 0x40, 0xa0, 0x03, +0x61, 0x99, 0x04, 0x5d, 0x8f, 0x04, 0x66, 0x8f, 0x04, 0x40, 0xa1, 0x03, 0x61, 0x9a, 0x04, 0x5d, +0x8f, 0x04, 0x66, 0x8f, 0x04, 0x40, 0xa2, 0x03, 0x61, 0x9b, 0x04, 0x5d, 0x8f, 0x04, 0x66, 0x8f, +0x04, 0x40, 0xa3, 0x03, 0x61, 0x9c, 0x04, 0x5d, 0x8f, 0x04, 0x66, 0x8f, 0x04, 0x40, 0xa4, 0x03, +0x61, 0x9d, 0x04, 0x5d, 0x8f, 0x04, 0x66, 0x8f, 0x04, 0x40, 0xa5, 0x03, 0x61, 0x9e, 0x04, 0x5d, +0x8f, 0x04, 0x66, 0x8f, 0x04, 0x40, 0xa6, 0x03, 0x61, 0x9f, 0x04, 0x5d, 0x8f, 0x04, 0x66, 0x8f, +0x04, 0x40, 0xa7, 0x03, 0x61, 0xa0, 0x04, 0x5d, 0x8f, 0x04, 0x66, 0x8f, 0x04, 0x40, 0xa8, 0x03, +0x61, 0xa1, 0x04, 0x5d, 0x8f, 0x04, 0x66, 0x8f, 0x04, 0x40, 0xa9, 0x03, 0x61, 0xa2, 0x04, 0x5d, +0x8f, 0x04, 0x66, 0x8f, 0x04, 0x40, 0xaa, 0x03, 0x61, 0xa3, 0x04, 0x5d, 0x8f, 0x04, 0x66, 0x8f, +0x04, 0x40, 0xab, 0x03, 0x61, 0xa4, 0x04, 0x5d, 0x8f, 0x04, 0x66, 0x8f, 0x04, 0x40, 0xac, 0x03, +0x61, 0xa5, 0x04, 0x5d, 0x8f, 0x04, 0x66, 0x8f, 0x04, 0x40, 0xad, 0x03, 0x61, 0xa6, 0x04, 0x5d, +0x8f, 0x04, 0x66, 0x8f, 0x04, 0x40, 0xae, 0x03, 0x61, 0xa7, 0x04, 0x5d, 0x8f, 0x04, 0x66, 0x8f, +0x04, 0x40, 0xaf, 0x03, 0x61, 0xa8, 0x04, 0x5d, 0x8f, 0x04, 0x66, 0x8f, 0x04, 0x40, 0xb0, 0x03, +0x61, 0xa9, 0x04, 0x5d, 0x8f, 0x04, 0x66, 0x8f, 0x04, 0x40, 0xb1, 0x03, 0x61, 0xaa, 0x04, 0x5d, +0x8f, 0x04, 0x66, 0x8f, 0x04, 0x40, 0xb2, 0x03, 0x61, 0xab, 0x04, 0x5d, 0x8f, 0x04, 0x66, 0x8f, +0x04, 0x40, 0xb3, 0x03, 0x61, 0xac, 0x04, 0x5d, 0x8f, 0x04, 0x66, 0x8f, 0x04, 0x40, 0xb4, 0x03, +0x61, 0xad, 0x04, 0x5d, 0x8f, 0x04, 0x66, 0x8f, 0x04, 0x40, 0xb5, 0x03, 0x61, 0xae, 0x04, 0x5d, +0x8f, 0x04, 0x66, 0x8f, 0x04, 0x40, 0xb6, 0x03, 0x61, 0xaf, 0x04, 0x5d, 0x8f, 0x04, 0x66, 0x8f, +0x04, 0x40, 0xb7, 0x03, 0x61, 0xb0, 0x04, 0x5d, 0x8f, 0x04, 0x66, 0x8f, 0x04, 0x40, 0xb8, 0x03, +0x61, 0xb1, 0x04, 0x5d, 0x8f, 0x04, 0x66, 0x8f, 0x04, 0x40, 0xb9, 0x03, 0x61, 0xb2, 0x04, 0x5d, +0x8f, 0x04, 0x66, 0x8f, 0x04, 0x40, 0xba, 0x03, 0x61, 0xb3, 0x04, 0x5d, 0x8f, 0x04, 0x66, 0x8f, +0x04, 0x40, 0xbb, 0x03, 0x61, 0xb4, 0x04, 0x5d, 0x8f, 0x04, 0x66, 0x8f, 0x04, 0x40, 0xbc, 0x03, +0x61, 0xb5, 0x04, 0x5d, 0x8f, 0x04, 0x66, 0x8f, 0x04, 0x40, 0xbd, 0x03, 0x61, 0xb6, 0x04, 0x5d, +0x8f, 0x04, 0x66, 0x8f, 0x04, 0x40, 0xbe, 0x03, 0x61, 0xb7, 0x04, 0x5d, 0xb8, 0x04, 0x5d, 0x8f, +0x04, 0x66, 0x8f, 0x04, 0x46, 0xb8, 0x04, 0x01, 0x29, 0x47, 0x00, 0x00, 0xc9, 0x03, 0x0a, 0x01, +0x03, 0x04, 0x32, 0xd0, 0x30, 0x2c, 0xbd, 0x02, 0x64, 0x6c, 0x01, 0x66, 0xb9, 0x04, 0x2c, 0xbe, +0x02, 0x64, 0x6c, 0x01, 0x66, 0xba, 0x04, 0x2c, 0xbf, 0x02, 0x64, 0x6c, 0x01, 0x66, 0xbb, 0x04, +0x2c, 0xc0, 0x02, 0x64, 0x6c, 0x01, 0x66, 0xbc, 0x04, 0x2c, 0xc1, 0x02, 0x64, 0x6c, 0x01, 0x66, +0xbd, 0x04, 0x55, 0x05, 0x48, 0x00, 0x00, 0xca, 0x03, 0x02, 0x02, 0x03, 0x04, 0xf1, 0x01, 0xd0, +0x30, 0xd1, 0x20, 0x14, 0x25, 0x00, 0x00, 0x64, 0x6c, 0x01, 0x26, 0x61, 0xb9, 0x04, 0x64, 0x6c, +0x01, 0x26, 0x61, 0xba, 0x04, 0x64, 0x6c, 0x01, 0x26, 0x61, 0xbb, 0x04, 0x64, 0x6c, 0x01, 0x26, +0x61, 0xbc, 0x04, 0x64, 0x6c, 0x01, 0x24, 0x02, 0x61, 0xbd, 0x04, 0x47, 0x2c, 0xbd, 0x02, 0xd1, +0xb4, 0x76, 0x2a, 0x76, 0x12, 0x0d, 0x00, 0x00, 0x29, 0xd1, 0x66, 0xb9, 0x04, 0x5d, 0xbe, 0x04, +0x66, 0xbe, 0x04, 0xb3, 0x76, 0x12, 0x0a, 0x00, 0x00, 0x64, 0x6c, 0x01, 0xd1, 0x66, 0xb9, 0x04, +0x61, 0xb9, 0x04, 0x2c, 0xbe, 0x02, 0xd1, 0xb4, 0x76, 0x2a, 0x76, 0x12, 0x0d, 0x00, 0x00, 0x29, +0xd1, 0x66, 0xba, 0x04, 0x5d, 0xbe, 0x04, 0x66, 0xbe, 0x04, 0xb3, 0x76, 0x12, 0x0a, 0x00, 0x00, +0x64, 0x6c, 0x01, 0xd1, 0x66, 0xba, 0x04, 0x61, 0xba, 0x04, 0x2c, 0xbf, 0x02, 0xd1, 0xb4, 0x76, +0x2a, 0x76, 0x12, 0x0d, 0x00, 0x00, 0x29, 0xd1, 0x66, 0xbb, 0x04, 0x5d, 0xbe, 0x04, 0x66, 0xbe, +0x04, 0xb3, 0x76, 0x12, 0x0a, 0x00, 0x00, 0x64, 0x6c, 0x01, 0xd1, 0x66, 0xbb, 0x04, 0x61, 0xbb, +0x04, 0x2c, 0xc0, 0x02, 0xd1, 0xb4, 0x76, 0x2a, 0x76, 0x12, 0x0d, 0x00, 0x00, 0x29, 0xd1, 0x66, +0xbc, 0x04, 0x5d, 0xbe, 0x04, 0x66, 0xbe, 0x04, 0xb3, 0x76, 0x12, 0x0a, 0x00, 0x00, 0x64, 0x6c, +0x01, 0xd1, 0x66, 0xbc, 0x04, 0x61, 0xbc, 0x04, 0x2c, 0xc1, 0x02, 0xd1, 0xb4, 0x76, 0x2a, 0x76, +0x12, 0x0d, 0x00, 0x00, 0x29, 0xd1, 0x66, 0xbd, 0x04, 0x5d, 0xbf, 0x04, 0x66, 0xbf, 0x04, 0xb3, +0x76, 0x12, 0x0a, 0x00, 0x00, 0x64, 0x6c, 0x01, 0xd1, 0x66, 0xbd, 0x04, 0x61, 0xbd, 0x04, 0x47, +0x00, 0x00, 0xcb, 0x03, 0x0a, 0x01, 0x03, 0x04, 0x1a, 0xd0, 0x30, 0x2c, 0xbd, 0x02, 0x26, 0x2c, +0xbe, 0x02, 0x26, 0x2c, 0xbf, 0x02, 0x26, 0x2c, 0xc0, 0x02, 0x26, 0x2c, 0xc1, 0x02, 0x24, 0x02, +0x55, 0x05, 0x48, 0x00, 0x00, 0x96, 0x03, 0x01, 0x01, 0x03, 0x03, 0x08, 0x5d, 0xc0, 0x04, 0x46, +0xc0, 0x04, 0x00, 0x48, 0x00, 0x00, 0x97, 0x03, 0x02, 0x02, 0x03, 0x03, 0x0a, 0x5d, 0xc1, 0x04, +0xd1, 0x46, 0xc1, 0x04, 0x01, 0x29, 0x47, 0x00, 0x00, 0x98, 0x03, 0x01, 0x01, 0x03, 0x03, 0x08, +0x5d, 0xc2, 0x04, 0x46, 0xc2, 0x04, 0x00, 0x48, 0x00, 0x00, 0x99, 0x03, 0x02, 0x03, 0x03, 0x03, +0x21, 0x20, 0x80, 0xc3, 0x04, 0xd6, 0xd0, 0x5d, 0x8f, 0x04, 0x66, 0x8f, 0x04, 0x1a, 0x06, 0x00, +0x00, 0xd0, 0xd1, 0x46, 0x09, 0x01, 0x48, 0xd0, 0x80, 0xc3, 0x04, 0xd6, 0xd2, 0xd1, 0x46, 0x09, +0x01, 0x48, 0x00, 0x00, 0x9a, 0x03, 0x02, 0x03, 0x03, 0x03, 0x21, 0x20, 0x80, 0xc3, 0x04, 0xd6, +0xd0, 0x5d, 0x8f, 0x04, 0x66, 0x8f, 0x04, 0x1a, 0x06, 0x00, 0x00, 0xd0, 0xd1, 0x46, 0x0a, 0x01, +0x48, 0xd0, 0x80, 0xc3, 0x04, 0xd6, 0xd2, 0xd1, 0x46, 0x0a, 0x01, 0x48, 0x00, 0x00, 0x9b, 0x03, +0x02, 0x02, 0x03, 0x03, 0x1d, 0x20, 0x80, 0xc3, 0x04, 0xd5, 0xd0, 0x5d, 0x8f, 0x04, 0x66, 0x8f, +0x04, 0x1a, 0x03, 0x00, 0x00, 0x2c, 0x01, 0x48, 0xd0, 0x80, 0xc3, 0x04, 0xd5, 0xd1, 0x46, 0x33, +0x00, 0x48, 0x00, 0x00, 0x9c, 0x03, 0x02, 0x03, 0x03, 0x03, 0x11, 0x20, 0x80, 0xc3, 0x04, 0xd6, +0xd0, 0x80, 0xc3, 0x04, 0xd6, 0xd2, 0xd1, 0x46, 0xc4, 0x04, 0x01, 0x48, 0x00, 0x00, 0x9d, 0x03, +0x02, 0x03, 0x03, 0x03, 0x11, 0x20, 0x80, 0xc3, 0x04, 0xd6, 0xd0, 0x80, 0xc3, 0x04, 0xd6, 0xd2, +0xd1, 0x46, 0xc5, 0x04, 0x01, 0x48, 0x00, 0x00, 0x9e, 0x03, 0x02, 0x03, 0x03, 0x03, 0x11, 0x20, +0x80, 0xc3, 0x04, 0xd6, 0xd0, 0x80, 0xc3, 0x04, 0xd6, 0xd2, 0xd1, 0x46, 0xc6, 0x04, 0x01, 0x48, +0x00, 0x00, 0x9f, 0x03, 0x01, 0x02, 0x03, 0x03, 0x10, 0x20, 0x80, 0xc3, 0x04, 0xd5, 0xd0, 0x80, +0xc3, 0x04, 0xd5, 0xd1, 0x46, 0xc8, 0x04, 0x00, 0x48, 0x00, 0x00, 0xa0, 0x03, 0x02, 0x03, 0x03, +0x03, 0x11, 0x20, 0x80, 0xc3, 0x04, 0xd6, 0xd0, 0x80, 0xc3, 0x04, 0xd6, 0xd2, 0xd1, 0x46, 0xc9, +0x04, 0x01, 0x48, 0x00, 0x00, 0xa1, 0x03, 0x01, 0x02, 0x03, 0x03, 0x10, 0x20, 0x80, 0xc3, 0x04, +0xd5, 0xd0, 0x80, 0xc3, 0x04, 0xd5, 0xd1, 0x46, 0xca, 0x04, 0x00, 0x48, 0x00, 0x00, 0xa2, 0x03, +0x01, 0x02, 0x03, 0x03, 0x10, 0x20, 0x80, 0xc3, 0x04, 0xd5, 0xd0, 0x80, 0xc3, 0x04, 0xd5, 0xd1, +0x46, 0xcb, 0x04, 0x00, 0x48, 0x00, 0x00, 0xa3, 0x03, 0x01, 0x02, 0x03, 0x03, 0x10, 0x20, 0x80, +0xc3, 0x04, 0xd5, 0xd0, 0x80, 0xc3, 0x04, 0xd5, 0xd1, 0x46, 0xcc, 0x04, 0x00, 0x48, 0x00, 0x00, +0xa4, 0x03, 0x02, 0x03, 0x03, 0x03, 0x11, 0x20, 0x80, 0xc3, 0x04, 0xd6, 0xd0, 0x80, 0xc3, 0x04, +0xd6, 0xd2, 0xd1, 0x46, 0xcd, 0x04, 0x01, 0x48, 0x00, 0x00, 0xa5, 0x03, 0x01, 0x02, 0x03, 0x03, +0x10, 0x20, 0x80, 0xc3, 0x04, 0xd5, 0xd0, 0x80, 0xc3, 0x04, 0xd5, 0xd1, 0x46, 0xce, 0x04, 0x00, +0x48, 0x00, 0x00, 0xa6, 0x03, 0x02, 0x03, 0x03, 0x03, 0x11, 0x20, 0x80, 0xc3, 0x04, 0xd6, 0xd0, +0x80, 0xc3, 0x04, 0xd6, 0xd2, 0xd1, 0x46, 0xcf, 0x04, 0x01, 0x48, 0x00, 0x00, 0xa7, 0x03, 0x02, +0x03, 0x03, 0x03, 0x11, 0x20, 0x80, 0xc3, 0x04, 0xd6, 0xd0, 0x80, 0xc3, 0x04, 0xd6, 0xd2, 0xd1, +0x46, 0xd0, 0x04, 0x01, 0x48, 0x00, 0x00, 0xa8, 0x03, 0x01, 0x02, 0x03, 0x03, 0x10, 0x20, 0x80, +0xc3, 0x04, 0xd5, 0xd0, 0x80, 0xc3, 0x04, 0xd5, 0xd1, 0x46, 0xd1, 0x04, 0x00, 0x48, 0x00, 0x00, +0xa9, 0x03, 0x01, 0x02, 0x03, 0x03, 0x10, 0x20, 0x80, 0xc3, 0x04, 0xd5, 0xd0, 0x80, 0xc3, 0x04, +0xd5, 0xd1, 0x46, 0xd2, 0x04, 0x00, 0x48, 0x00, 0x00, 0xaa, 0x03, 0x01, 0x02, 0x03, 0x03, 0x10, +0x20, 0x80, 0xc3, 0x04, 0xd5, 0xd0, 0x80, 0xc3, 0x04, 0xd5, 0xd1, 0x46, 0xd3, 0x04, 0x00, 0x48, +0x00, 0x00, 0xab, 0x03, 0x03, 0x04, 0x03, 0x03, 0x12, 0x20, 0x80, 0xc3, 0x04, 0xd7, 0xd0, 0x80, +0xc3, 0x04, 0xd7, 0xd3, 0xd1, 0xd2, 0x46, 0xd4, 0x04, 0x02, 0x48, 0x00, 0x00, 0xac, 0x03, 0x03, +0x04, 0x03, 0x03, 0x12, 0x20, 0x80, 0xc3, 0x04, 0xd7, 0xd0, 0x80, 0xc3, 0x04, 0xd7, 0xd3, 0xd1, +0xd2, 0x46, 0xd5, 0x04, 0x02, 0x48, 0x00, 0x00, 0xad, 0x03, 0x01, 0x02, 0x03, 0x03, 0x10, 0x20, +0x80, 0xc3, 0x04, 0xd5, 0xd0, 0x80, 0xc3, 0x04, 0xd5, 0xd1, 0x46, 0xd6, 0x04, 0x00, 0x48, 0x00, +0x00, 0xae, 0x03, 0x01, 0x02, 0x03, 0x03, 0x10, 0x20, 0x80, 0xc3, 0x04, 0xd5, 0xd0, 0x80, 0xc3, +0x04, 0xd5, 0xd1, 0x46, 0xd7, 0x04, 0x00, 0x48, 0x00, 0x00, 0xaf, 0x03, 0x01, 0x02, 0x03, 0x03, +0x10, 0x20, 0x80, 0xc3, 0x04, 0xd5, 0xd0, 0x80, 0xc3, 0x04, 0xd5, 0xd1, 0x46, 0xd8, 0x04, 0x00, +0x48, 0x00, 0x00, 0xb0, 0x03, 0x03, 0x04, 0x03, 0x03, 0x15, 0x20, 0x80, 0xc3, 0x04, 0xd7, 0xd0, +0x80, 0xc3, 0x04, 0xd7, 0xd3, 0x66, 0xd9, 0x04, 0xd3, 0xd2, 0x46, 0xda, 0x04, 0x02, 0x48, 0x00, +0x00, 0xb1, 0x03, 0x01, 0x02, 0x03, 0x03, 0x10, 0x20, 0x80, 0xc3, 0x04, 0xd5, 0xd0, 0x80, 0xc3, +0x04, 0xd5, 0xd1, 0x46, 0xdb, 0x04, 0x00, 0x48, 0x00, 0x00, 0xb2, 0x03, 0x01, 0x02, 0x03, 0x03, +0x10, 0x20, 0x80, 0xc3, 0x04, 0xd5, 0xd0, 0x80, 0xc3, 0x04, 0xd5, 0xd1, 0x46, 0xdc, 0x04, 0x00, +0x48, 0x00, 0x00, 0xb3, 0x03, 0x01, 0x02, 0x03, 0x03, 0x10, 0x20, 0x80, 0xc3, 0x04, 0xd5, 0xd0, +0x80, 0xc3, 0x04, 0xd5, 0xd1, 0x46, 0xdd, 0x04, 0x00, 0x48, 0x00, 0x00, 0xb4, 0x03, 0x01, 0x02, +0x03, 0x03, 0x10, 0x20, 0x80, 0xc3, 0x04, 0xd5, 0xd0, 0x80, 0xc3, 0x04, 0xd5, 0xd1, 0x46, 0xde, +0x04, 0x00, 0x48, 0x00, 0x00, 0xb5, 0x03, 0x02, 0x03, 0x03, 0x03, 0x11, 0x20, 0x80, 0xc3, 0x04, +0xd6, 0xd0, 0x80, 0xc3, 0x04, 0xd6, 0xd2, 0xd1, 0x46, 0xdf, 0x04, 0x01, 0x48, 0x00, 0x00, 0xb6, +0x03, 0x02, 0x03, 0x03, 0x03, 0x11, 0x20, 0x80, 0xc3, 0x04, 0xd6, 0xd0, 0x80, 0xc3, 0x04, 0xd6, +0xd2, 0xd1, 0x46, 0xe0, 0x04, 0x01, 0x48, 0x00, 0x00, 0xb7, 0x03, 0x02, 0x03, 0x03, 0x03, 0x11, +0x20, 0x80, 0xc3, 0x04, 0xd6, 0xd0, 0x80, 0xc3, 0x04, 0xd6, 0xd2, 0xd1, 0x46, 0xe1, 0x04, 0x01, +0x48, 0x00, 0x00, 0xb8, 0x03, 0x03, 0x04, 0x03, 0x03, 0x12, 0x20, 0x80, 0xc3, 0x04, 0xd7, 0xd0, +0x80, 0xc3, 0x04, 0xd7, 0xd3, 0xd1, 0xd2, 0x46, 0xb7, 0x01, 0x02, 0x48, 0x00, 0x00, 0xb9, 0x03, +0x02, 0x03, 0x03, 0x03, 0x11, 0x20, 0x80, 0xc3, 0x04, 0xd6, 0xd0, 0x80, 0xc3, 0x04, 0xd6, 0xd2, +0xd1, 0x46, 0xe2, 0x04, 0x01, 0x48, 0x00, 0x00, 0xba, 0x03, 0x02, 0x03, 0x03, 0x03, 0x12, 0x20, +0x80, 0xc3, 0x04, 0xd6, 0xd0, 0x80, 0xc3, 0x04, 0xd6, 0xd2, 0xd1, 0x46, 0xe3, 0x04, 0x01, 0x29, +0x47, 0x00, 0x00, 0xbb, 0x03, 0x02, 0x03, 0x03, 0x03, 0x12, 0x20, 0x80, 0xc3, 0x04, 0xd6, 0xd0, +0x80, 0xc3, 0x04, 0xd6, 0xd2, 0xd1, 0x46, 0xe4, 0x04, 0x01, 0x29, 0x47, 0x00, 0x00, 0xbc, 0x03, +0x02, 0x03, 0x03, 0x03, 0x12, 0x20, 0x80, 0xc3, 0x04, 0xd6, 0xd0, 0x80, 0xc3, 0x04, 0xd6, 0xd2, +0xd1, 0x46, 0xe5, 0x04, 0x01, 0x29, 0x47, 0x00, 0x00, 0xbd, 0x03, 0x01, 0x02, 0x03, 0x03, 0x10, +0x20, 0x80, 0xc3, 0x04, 0xd5, 0xd0, 0x80, 0xc3, 0x04, 0xd5, 0xd1, 0x46, 0xe6, 0x04, 0x00, 0x48, +0x00, 0x00, 0xbe, 0x03, 0x01, 0x02, 0x03, 0x03, 0x10, 0x20, 0x80, 0xc3, 0x04, 0xd5, 0xd0, 0x80, +0xc3, 0x04, 0xd5, 0xd1, 0x46, 0xe7, 0x04, 0x00, 0x48, 0x00, 0x00, 0xe0, 0x03, 0x01, 0x01, 0x04, +0x05, 0x05, 0xd0, 0x30, 0x24, 0x01, 0x48, 0x00, 0x00, 0xf4, 0x03, 0x01, 0x02, 0x04, 0x05, 0x06, +0xd0, 0x30, 0xd0, 0x49, 0x00, 0x47, 0x00, 0x00, 0xf5, 0x03, 0x01, 0x01, 0x04, 0x05, 0x04, 0xd0, +0x30, 0xd0, 0x48, 0x00, 0x00, 0xf6, 0x03, 0x02, 0x01, 0x03, 0x04, 0xf4, 0x03, 0xd0, 0x30, 0x5e, +0x05, 0x24, 0x01, 0x68, 0x05, 0x5d, 0xef, 0x04, 0x66, 0xef, 0x04, 0x5d, 0xf0, 0x04, 0x66, 0xf0, +0x04, 0x66, 0xef, 0x04, 0x66, 0xf1, 0x04, 0x61, 0xf1, 0x04, 0x5d, 0xef, 0x04, 0x66, 0xef, 0x04, +0x40, 0xf7, 0x03, 0x61, 0xf2, 0x04, 0x5d, 0xef, 0x04, 0x66, 0xef, 0x04, 0x40, 0xf8, 0x03, 0x61, +0xf3, 0x04, 0x5d, 0xef, 0x04, 0x66, 0xef, 0x04, 0x40, 0xf9, 0x03, 0x61, 0xf4, 0x04, 0x5d, 0xef, +0x04, 0x66, 0xef, 0x04, 0x40, 0xfa, 0x03, 0x61, 0xf5, 0x04, 0x5d, 0xef, 0x04, 0x66, 0xef, 0x04, +0x40, 0xfb, 0x03, 0x61, 0xf6, 0x04, 0x5d, 0xef, 0x04, 0x66, 0xef, 0x04, 0x40, 0xfc, 0x03, 0x61, +0xf7, 0x04, 0x5d, 0xef, 0x04, 0x66, 0xef, 0x04, 0x40, 0xfd, 0x03, 0x61, 0xf8, 0x04, 0x5d, 0xef, +0x04, 0x66, 0xef, 0x04, 0x40, 0xfe, 0x03, 0x61, 0xf9, 0x04, 0x5d, 0xef, 0x04, 0x66, 0xef, 0x04, +0x40, 0xff, 0x03, 0x61, 0xfa, 0x04, 0x5d, 0xef, 0x04, 0x66, 0xef, 0x04, 0x40, 0x80, 0x04, 0x61, +0xfb, 0x04, 0x5d, 0xef, 0x04, 0x66, 0xef, 0x04, 0x40, 0x81, 0x04, 0x61, 0xfc, 0x04, 0x5d, 0xef, +0x04, 0x66, 0xef, 0x04, 0x40, 0x82, 0x04, 0x61, 0xfd, 0x04, 0x5d, 0xef, 0x04, 0x66, 0xef, 0x04, +0x40, 0x83, 0x04, 0x61, 0xfe, 0x04, 0x5d, 0xef, 0x04, 0x66, 0xef, 0x04, 0x40, 0x84, 0x04, 0x61, +0xff, 0x04, 0x5d, 0xef, 0x04, 0x66, 0xef, 0x04, 0x40, 0x85, 0x04, 0x61, 0x80, 0x05, 0x5d, 0xef, +0x04, 0x66, 0xef, 0x04, 0x40, 0x86, 0x04, 0x61, 0x81, 0x05, 0x5d, 0xef, 0x04, 0x66, 0xef, 0x04, +0x40, 0x87, 0x04, 0x61, 0x82, 0x05, 0x5d, 0xef, 0x04, 0x66, 0xef, 0x04, 0x40, 0x88, 0x04, 0x61, +0x83, 0x05, 0x5d, 0xef, 0x04, 0x66, 0xef, 0x04, 0x40, 0x89, 0x04, 0x61, 0x84, 0x05, 0x5d, 0xef, +0x04, 0x66, 0xef, 0x04, 0x40, 0x8a, 0x04, 0x61, 0x85, 0x05, 0x5d, 0xef, 0x04, 0x66, 0xef, 0x04, +0x40, 0x8b, 0x04, 0x61, 0x86, 0x05, 0x5d, 0xef, 0x04, 0x66, 0xef, 0x04, 0x40, 0x8c, 0x04, 0x61, +0x87, 0x05, 0x5d, 0xef, 0x04, 0x66, 0xef, 0x04, 0x40, 0x8d, 0x04, 0x61, 0x88, 0x05, 0x5d, 0xef, +0x04, 0x66, 0xef, 0x04, 0x40, 0x8e, 0x04, 0x61, 0x89, 0x05, 0x5d, 0xef, 0x04, 0x66, 0xef, 0x04, +0x40, 0x8f, 0x04, 0x61, 0x8a, 0x05, 0x5d, 0xef, 0x04, 0x66, 0xef, 0x04, 0x40, 0x90, 0x04, 0x61, +0x8b, 0x05, 0x5d, 0xef, 0x04, 0x66, 0xef, 0x04, 0x40, 0x91, 0x04, 0x61, 0x8c, 0x05, 0x5d, 0xef, +0x04, 0x66, 0xef, 0x04, 0x40, 0x92, 0x04, 0x61, 0x8d, 0x05, 0x5d, 0xef, 0x04, 0x66, 0xef, 0x04, +0x40, 0x93, 0x04, 0x61, 0x8e, 0x05, 0x5d, 0xef, 0x04, 0x66, 0xef, 0x04, 0x40, 0x94, 0x04, 0x61, +0x8f, 0x05, 0x5d, 0xef, 0x04, 0x66, 0xef, 0x04, 0x40, 0x95, 0x04, 0x61, 0x90, 0x05, 0x5d, 0xef, +0x04, 0x66, 0xef, 0x04, 0x40, 0x96, 0x04, 0x61, 0x91, 0x05, 0x5d, 0xef, 0x04, 0x66, 0xef, 0x04, +0x40, 0x97, 0x04, 0x61, 0x92, 0x05, 0x5d, 0xef, 0x04, 0x66, 0xef, 0x04, 0x40, 0x98, 0x04, 0x61, +0x93, 0x05, 0x5d, 0xef, 0x04, 0x66, 0xef, 0x04, 0x40, 0x99, 0x04, 0x61, 0x94, 0x05, 0x5d, 0xef, +0x04, 0x66, 0xef, 0x04, 0x40, 0x9a, 0x04, 0x61, 0x95, 0x05, 0x5d, 0xef, 0x04, 0x66, 0xef, 0x04, +0x40, 0x9b, 0x04, 0x61, 0x96, 0x05, 0x5d, 0xef, 0x04, 0x66, 0xef, 0x04, 0x40, 0x9c, 0x04, 0x61, +0x97, 0x05, 0x5d, 0x98, 0x05, 0x5d, 0xef, 0x04, 0x66, 0xef, 0x04, 0x46, 0x98, 0x05, 0x01, 0x29, +0x47, 0x00, 0x00, 0xf7, 0x03, 0x02, 0x03, 0x03, 0x03, 0x21, 0x20, 0x80, 0xc7, 0x04, 0xd6, 0xd0, +0x5d, 0xef, 0x04, 0x66, 0xef, 0x04, 0x1a, 0x06, 0x00, 0x00, 0xd0, 0xd1, 0x46, 0x09, 0x01, 0x48, +0xd0, 0x80, 0xc7, 0x04, 0xd6, 0xd2, 0xd1, 0x46, 0x09, 0x01, 0x48, 0x00, 0x00, 0xf8, 0x03, 0x02, +0x03, 0x03, 0x03, 0x21, 0x20, 0x80, 0xc7, 0x04, 0xd6, 0xd0, 0x5d, 0xef, 0x04, 0x66, 0xef, 0x04, +0x1a, 0x06, 0x00, 0x00, 0xd0, 0xd1, 0x46, 0x0a, 0x01, 0x48, 0xd0, 0x80, 0xc7, 0x04, 0xd6, 0xd2, +0xd1, 0x46, 0x0a, 0x01, 0x48, 0x00, 0x00, 0xf9, 0x03, 0x02, 0x02, 0x03, 0x03, 0x1d, 0x20, 0x80, +0xc7, 0x04, 0xd5, 0xd0, 0x5d, 0xef, 0x04, 0x66, 0xef, 0x04, 0x1a, 0x03, 0x00, 0x00, 0x2c, 0x01, +0x48, 0xd0, 0x80, 0xc7, 0x04, 0xd5, 0xd1, 0x46, 0x33, 0x00, 0x48, 0x00, 0x00, 0xfa, 0x03, 0x02, +0x03, 0x03, 0x03, 0x11, 0x20, 0x80, 0xc7, 0x04, 0xd6, 0xd0, 0x80, 0xc7, 0x04, 0xd6, 0xd2, 0xd1, +0x46, 0xc4, 0x04, 0x01, 0x48, 0x00, 0x00, 0xfb, 0x03, 0x02, 0x03, 0x03, 0x03, 0x11, 0x20, 0x80, +0xc7, 0x04, 0xd6, 0xd0, 0x80, 0xc7, 0x04, 0xd6, 0xd2, 0xd1, 0x46, 0xc5, 0x04, 0x01, 0x48, 0x00, +0x00, 0xfc, 0x03, 0x02, 0x03, 0x03, 0x03, 0x11, 0x20, 0x80, 0xc7, 0x04, 0xd6, 0xd0, 0x80, 0xc7, +0x04, 0xd6, 0xd2, 0xd1, 0x46, 0xc6, 0x04, 0x01, 0x48, 0x00, 0x00, 0xfd, 0x03, 0x01, 0x02, 0x03, +0x03, 0x10, 0x20, 0x80, 0xc7, 0x04, 0xd5, 0xd0, 0x80, 0xc7, 0x04, 0xd5, 0xd1, 0x46, 0xc8, 0x04, +0x00, 0x48, 0x00, 0x00, 0xfe, 0x03, 0x02, 0x03, 0x03, 0x03, 0x11, 0x20, 0x80, 0xc7, 0x04, 0xd6, +0xd0, 0x80, 0xc7, 0x04, 0xd6, 0xd2, 0xd1, 0x46, 0xc9, 0x04, 0x01, 0x48, 0x00, 0x00, 0xff, 0x03, +0x01, 0x02, 0x03, 0x03, 0x10, 0x20, 0x80, 0xc7, 0x04, 0xd5, 0xd0, 0x80, 0xc7, 0x04, 0xd5, 0xd1, +0x46, 0xca, 0x04, 0x00, 0x48, 0x00, 0x00, 0x80, 0x04, 0x01, 0x02, 0x03, 0x03, 0x10, 0x20, 0x80, +0xc7, 0x04, 0xd5, 0xd0, 0x80, 0xc7, 0x04, 0xd5, 0xd1, 0x46, 0xcb, 0x04, 0x00, 0x48, 0x00, 0x00, +0x81, 0x04, 0x01, 0x02, 0x03, 0x03, 0x10, 0x20, 0x80, 0xc7, 0x04, 0xd5, 0xd0, 0x80, 0xc7, 0x04, +0xd5, 0xd1, 0x46, 0xcc, 0x04, 0x00, 0x48, 0x00, 0x00, 0x82, 0x04, 0x02, 0x03, 0x03, 0x03, 0x11, +0x20, 0x80, 0xc7, 0x04, 0xd6, 0xd0, 0x80, 0xc7, 0x04, 0xd6, 0xd2, 0xd1, 0x46, 0xcd, 0x04, 0x01, +0x48, 0x00, 0x00, 0x83, 0x04, 0x01, 0x02, 0x03, 0x03, 0x10, 0x20, 0x80, 0xc7, 0x04, 0xd5, 0xd0, +0x80, 0xc7, 0x04, 0xd5, 0xd1, 0x46, 0xce, 0x04, 0x00, 0x48, 0x00, 0x00, 0x84, 0x04, 0x02, 0x03, +0x03, 0x03, 0x11, 0x20, 0x80, 0xc7, 0x04, 0xd6, 0xd0, 0x80, 0xc7, 0x04, 0xd6, 0xd2, 0xd1, 0x46, +0xcf, 0x04, 0x01, 0x48, 0x00, 0x00, 0x85, 0x04, 0x02, 0x03, 0x03, 0x03, 0x11, 0x20, 0x80, 0xc7, +0x04, 0xd6, 0xd0, 0x80, 0xc7, 0x04, 0xd6, 0xd2, 0xd1, 0x46, 0xd0, 0x04, 0x01, 0x48, 0x00, 0x00, +0x86, 0x04, 0x01, 0x02, 0x03, 0x03, 0x10, 0x20, 0x80, 0xc7, 0x04, 0xd5, 0xd0, 0x80, 0xc7, 0x04, +0xd5, 0xd1, 0x46, 0xd1, 0x04, 0x00, 0x48, 0x00, 0x00, 0x87, 0x04, 0x01, 0x02, 0x03, 0x03, 0x10, +0x20, 0x80, 0xc7, 0x04, 0xd5, 0xd0, 0x80, 0xc7, 0x04, 0xd5, 0xd1, 0x46, 0xd2, 0x04, 0x00, 0x48, +0x00, 0x00, 0x88, 0x04, 0x01, 0x02, 0x03, 0x03, 0x10, 0x20, 0x80, 0xc7, 0x04, 0xd5, 0xd0, 0x80, +0xc7, 0x04, 0xd5, 0xd1, 0x46, 0xd3, 0x04, 0x00, 0x48, 0x00, 0x00, 0x89, 0x04, 0x03, 0x04, 0x03, +0x03, 0x12, 0x20, 0x80, 0xc7, 0x04, 0xd7, 0xd0, 0x80, 0xc7, 0x04, 0xd7, 0xd3, 0xd1, 0xd2, 0x46, +0xd4, 0x04, 0x02, 0x48, 0x00, 0x00, 0x8a, 0x04, 0x03, 0x04, 0x03, 0x03, 0x12, 0x20, 0x80, 0xc7, +0x04, 0xd7, 0xd0, 0x80, 0xc7, 0x04, 0xd7, 0xd3, 0xd1, 0xd2, 0x46, 0xd5, 0x04, 0x02, 0x48, 0x00, +0x00, 0x8b, 0x04, 0x01, 0x02, 0x03, 0x03, 0x10, 0x20, 0x80, 0xc7, 0x04, 0xd5, 0xd0, 0x80, 0xc7, +0x04, 0xd5, 0xd1, 0x46, 0xd6, 0x04, 0x00, 0x48, 0x00, 0x00, 0x8c, 0x04, 0x01, 0x02, 0x03, 0x03, +0x10, 0x20, 0x80, 0xc7, 0x04, 0xd5, 0xd0, 0x80, 0xc7, 0x04, 0xd5, 0xd1, 0x46, 0xd7, 0x04, 0x00, +0x48, 0x00, 0x00, 0x8d, 0x04, 0x01, 0x02, 0x03, 0x03, 0x10, 0x20, 0x80, 0xc7, 0x04, 0xd5, 0xd0, +0x80, 0xc7, 0x04, 0xd5, 0xd1, 0x46, 0xd8, 0x04, 0x00, 0x48, 0x00, 0x00, 0x8e, 0x04, 0x03, 0x04, +0x03, 0x03, 0x15, 0x20, 0x80, 0xc7, 0x04, 0xd7, 0xd0, 0x80, 0xc7, 0x04, 0xd7, 0xd3, 0x66, 0xd9, +0x04, 0xd3, 0xd2, 0x46, 0x99, 0x05, 0x02, 0x48, 0x00, 0x00, 0x8f, 0x04, 0x01, 0x02, 0x03, 0x03, +0x10, 0x20, 0x80, 0xc7, 0x04, 0xd5, 0xd0, 0x80, 0xc7, 0x04, 0xd5, 0xd1, 0x46, 0xdb, 0x04, 0x00, +0x48, 0x00, 0x00, 0x90, 0x04, 0x01, 0x02, 0x03, 0x03, 0x10, 0x20, 0x80, 0xc7, 0x04, 0xd5, 0xd0, +0x80, 0xc7, 0x04, 0xd5, 0xd1, 0x46, 0xdc, 0x04, 0x00, 0x48, 0x00, 0x00, 0x91, 0x04, 0x01, 0x02, +0x03, 0x03, 0x10, 0x20, 0x80, 0xc7, 0x04, 0xd5, 0xd0, 0x80, 0xc7, 0x04, 0xd5, 0xd1, 0x46, 0xdd, +0x04, 0x00, 0x48, 0x00, 0x00, 0x92, 0x04, 0x01, 0x02, 0x03, 0x03, 0x10, 0x20, 0x80, 0xc7, 0x04, +0xd5, 0xd0, 0x80, 0xc7, 0x04, 0xd5, 0xd1, 0x46, 0xde, 0x04, 0x00, 0x48, 0x00, 0x00, 0x93, 0x04, +0x02, 0x03, 0x03, 0x03, 0x11, 0x20, 0x80, 0xc7, 0x04, 0xd6, 0xd0, 0x80, 0xc7, 0x04, 0xd6, 0xd2, +0xd1, 0x46, 0xdf, 0x04, 0x01, 0x48, 0x00, 0x00, 0x94, 0x04, 0x02, 0x03, 0x03, 0x03, 0x11, 0x20, +0x80, 0xc7, 0x04, 0xd6, 0xd0, 0x80, 0xc7, 0x04, 0xd6, 0xd2, 0xd1, 0x46, 0xe0, 0x04, 0x01, 0x48, +0x00, 0x00, 0x95, 0x04, 0x02, 0x03, 0x03, 0x03, 0x11, 0x20, 0x80, 0xc7, 0x04, 0xd6, 0xd0, 0x80, +0xc7, 0x04, 0xd6, 0xd2, 0xd1, 0x46, 0xe1, 0x04, 0x01, 0x48, 0x00, 0x00, 0x96, 0x04, 0x03, 0x04, +0x03, 0x03, 0x12, 0x20, 0x80, 0xc7, 0x04, 0xd7, 0xd0, 0x80, 0xc7, 0x04, 0xd7, 0xd3, 0xd1, 0xd2, +0x46, 0xb7, 0x01, 0x02, 0x48, 0x00, 0x00, 0x97, 0x04, 0x02, 0x03, 0x03, 0x03, 0x11, 0x20, 0x80, +0xc7, 0x04, 0xd6, 0xd0, 0x80, 0xc7, 0x04, 0xd6, 0xd2, 0xd1, 0x46, 0xe2, 0x04, 0x01, 0x48, 0x00, +0x00, 0x98, 0x04, 0x02, 0x03, 0x03, 0x03, 0x12, 0x20, 0x80, 0xc7, 0x04, 0xd6, 0xd0, 0x80, 0xc7, +0x04, 0xd6, 0xd2, 0xd1, 0x46, 0xe3, 0x04, 0x01, 0x29, 0x47, 0x00, 0x00, 0x99, 0x04, 0x02, 0x03, +0x03, 0x03, 0x12, 0x20, 0x80, 0xc7, 0x04, 0xd6, 0xd0, 0x80, 0xc7, 0x04, 0xd6, 0xd2, 0xd1, 0x46, +0xe4, 0x04, 0x01, 0x29, 0x47, 0x00, 0x00, 0x9a, 0x04, 0x02, 0x03, 0x03, 0x03, 0x12, 0x20, 0x80, +0xc7, 0x04, 0xd6, 0xd0, 0x80, 0xc7, 0x04, 0xd6, 0xd2, 0xd1, 0x46, 0xe5, 0x04, 0x01, 0x29, 0x47, +0x00, 0x00, 0x9b, 0x04, 0x01, 0x02, 0x03, 0x03, 0x10, 0x20, 0x80, 0xc7, 0x04, 0xd5, 0xd0, 0x80, +0xc7, 0x04, 0xd5, 0xd1, 0x46, 0xe6, 0x04, 0x00, 0x48, 0x00, 0x00, 0x9c, 0x04, 0x01, 0x02, 0x03, +0x03, 0x10, 0x20, 0x80, 0xc7, 0x04, 0xd5, 0xd0, 0x80, 0xc7, 0x04, 0xd5, 0xd1, 0x46, 0xe7, 0x04, +0x00, 0x48, 0x00, 0x00, 0x9e, 0x04, 0x01, 0x01, 0x04, 0x05, 0x04, 0xd0, 0x30, 0xd0, 0x48, 0x00, +0x00, 0xc4, 0x04, 0x01, 0x02, 0x04, 0x05, 0x06, 0xd0, 0x30, 0xd0, 0x49, 0x00, 0x47, 0x00, 0x00, +0xc5, 0x04, 0x02, 0x01, 0x03, 0x04, 0x23, 0xd0, 0x30, 0x5e, 0x05, 0x24, 0x02, 0x68, 0x05, 0x5d, +0x9a, 0x05, 0x66, 0x9a, 0x05, 0x40, 0xc6, 0x04, 0x61, 0x9b, 0x05, 0x5d, 0x9c, 0x05, 0x5d, 0x9a, +0x05, 0x66, 0x9a, 0x05, 0x46, 0x9c, 0x05, 0x01, 0x29, 0x47, 0x00, 0x00, 0xc6, 0x04, 0x04, 0x02, +0x03, 0x03, 0x3e, 0x20, 0x80, 0x9d, 0x05, 0xd5, 0xd0, 0x5d, 0x9a, 0x05, 0x66, 0x9a, 0x05, 0x1a, +0x03, 0x00, 0x00, 0x2c, 0x01, 0x48, 0xd0, 0x64, 0x6c, 0x03, 0xb3, 0x96, 0x12, 0x17, 0x00, 0x00, +0x5d, 0x9e, 0x05, 0x66, 0x9e, 0x05, 0x5d, 0x9f, 0x05, 0x66, 0x9f, 0x05, 0x25, 0xec, 0x07, 0x2c, +0xc7, 0x02, 0x46, 0xa0, 0x05, 0x03, 0x29, 0xd0, 0x80, 0x9d, 0x05, 0xd5, 0xd1, 0x46, 0x33, 0x00, +0x48, 0x00, 0x00, 0xc9, 0x04, 0x01, 0x01, 0x04, 0x05, 0x04, 0xd0, 0x30, 0xd0, 0x48, 0x00, 0x00, +0xca, 0x04, 0x02, 0x01, 0x04, 0x05, 0x3c, 0xd0, 0x30, 0x5d, 0xa1, 0x05, 0x66, 0xa1, 0x05, 0x2c, +0x01, 0x1a, 0x07, 0x00, 0x00, 0x5d, 0xa2, 0x05, 0x66, 0xa2, 0x05, 0x48, 0x5d, 0xa1, 0x05, 0x66, +0xa1, 0x05, 0x20, 0xac, 0x12, 0x08, 0x00, 0x00, 0x2c, 0xc3, 0x02, 0x82, 0x10, 0x07, 0x00, 0x00, +0x5d, 0xa1, 0x05, 0x66, 0xa1, 0x05, 0x82, 0x2c, 0xc8, 0x02, 0xa0, 0x5d, 0xa2, 0x05, 0x66, 0xa2, +0x05, 0xa0, 0x48, 0x00, 0x00, 0xcb, 0x04, 0x01, 0x03, 0x04, 0x05, 0x06, 0xd0, 0x30, 0xd0, 0x49, +0x00, 0x47, 0x00, 0x00, 0xcc, 0x04, 0x02, 0x01, 0x01, 0x03, 0x3c, 0xd0, 0x30, 0x65, 0x00, 0x5d, +0x08, 0x66, 0x08, 0x30, 0x5d, 0xa4, 0x05, 0x66, 0xa4, 0x05, 0x58, 0x1a, 0x1d, 0x68, 0xc3, 0x04, +0x65, 0x00, 0x5d, 0x08, 0x66, 0x08, 0x30, 0x5d, 0xa4, 0x05, 0x66, 0xa4, 0x05, 0x58, 0x1b, 0x1d, +0x68, 0xc7, 0x04, 0x65, 0x00, 0x5d, 0x08, 0x66, 0x08, 0x30, 0x5d, 0xa4, 0x05, 0x66, 0xa4, 0x05, +0x58, 0x1c, 0x1d, 0x68, 0x9d, 0x05, 0x47, 0x00, 0x00 }; diff --git a/mozilla/js/tamarin/core/builtin.h b/mozilla/js/tamarin/core/builtin.h new file mode 100644 index 00000000000..0c6560839ce --- /dev/null +++ b/mozilla/js/tamarin/core/builtin.h @@ -0,0 +1,299 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +const int unescape = 0; +const int escape = 1; +const int parseFloat = 2; +const int parseInt = 3; +const int isFinite = 4; +const int isNaN = 5; +const int encodeURIComponent = 6; +const int encodeURI = 7; +const int decodeURIComponent = 8; +const int decodeURI = 9; +const int Object_private__hasOwnProperty = 11; +const int Object_private__propertyIsEnumerable = 12; +const int Object_protected__setPropertyIsEnumerable = 13; +const int Object_private__isPrototypeOf = 14; +const int Object_private__toString = 15; +const int abcclass_Object = 0; +const int Class_prototype_get = 29; +const int abcclass_Class = 1; +const int Function_prototype_get = 37; +const int Function_prototype_set = 38; +const int Function_length_get = 39; +const int Function_AS3_call = 40; +const int Function_AS3_apply = 41; +const int abcclass_Function = 2; +const int Namespace_prefix_get = 46; +const int Namespace_uri_get = 47; +const int abcclass_Namespace = 3; +const int abcclass_Boolean = 4; +const int Number_private__toString = 63; +const int Number_private__convert = 64; +const int abcclass_Number = 5; +const int abcclass_int = 6; +const int abcclass_uint = 7; +const int String_AS3_fromCharCode = 114; +const int String_private__match = 115; +const int String_private__replace = 116; +const int String_private__search = 117; +const int String_private__split = 118; +const int String_length_get = 119; +const int String_private__indexOf = 120; +const int String_AS3_indexOf = 121; +const int String_private__lastIndexOf = 122; +const int String_AS3_lastIndexOf = 123; +const int String_private__charAt = 124; +const int String_AS3_charAt = 125; +const int String_private__charCodeAt = 126; +const int String_AS3_charCodeAt = 127; +const int String_AS3_localeCompare = 129; +const int String_private__slice = 133; +const int String_AS3_slice = 134; +const int String_private__substring = 136; +const int String_AS3_substring = 137; +const int String_private__substr = 138; +const int String_AS3_substr = 139; +const int String_AS3_toLowerCase = 140; +const int String_AS3_toUpperCase = 142; +const int abcclass_String = 8; +const int Array_private__pop = 169; +const int Array_private__reverse = 170; +const int Array_private__concat = 171; +const int Array_private__shift = 172; +const int Array_private__slice = 173; +const int Array_private__splice = 174; +const int Array_private__sort = 175; +const int Array_private__sortOn = 176; +const int Array_private__indexOf = 177; +const int Array_private__lastIndexOf = 178; +const int Array_private__every = 179; +const int Array_private__filter = 180; +const int Array_private__forEach = 181; +const int Array_private__map = 182; +const int Array_private__some = 183; +const int Array_length_get = 184; +const int Array_length_set = 185; +const int Array_AS3_pop = 188; +const int Array_AS3_push = 189; +const int Array_AS3_unshift = 194; +const int abcclass_Array = 9; +const int builtin_as_0_MethodClosure_length_get = 208; +const int abcclass_builtin_as_0_MethodClosure = 10; +const int abcpackage_builtin_as = 0; +const int Math_private__min = 212; +const int Math_private__max = 213; +const int Math_abs = 214; +const int Math_acos = 215; +const int Math_asin = 216; +const int Math_atan = 217; +const int Math_ceil = 218; +const int Math_cos = 219; +const int Math_exp = 220; +const int Math_floor = 221; +const int Math_log = 222; +const int Math_round = 223; +const int Math_sin = 224; +const int Math_sqrt = 225; +const int Math_tan = 226; +const int Math_atan2 = 227; +const int Math_pow = 228; +const int Math_max = 229; +const int Math_min = 230; +const int Math_random = 231; +const int abcclass_Math = 11; +const int abcpackage_Math_as = 1; +const int Error_getErrorMessage = 236; +const int Error_getStackTrace = 240; +const int abcclass_Error = 12; +const int abcclass_DefinitionError = 13; +const int abcclass_EvalError = 14; +const int abcclass_RangeError = 15; +const int abcclass_ReferenceError = 16; +const int abcclass_SecurityError = 17; +const int abcclass_SyntaxError = 18; +const int abcclass_TypeError = 19; +const int abcclass_URIError = 20; +const int abcclass_VerifyError = 21; +const int abcclass_UninitializedError = 22; +const int abcclass_ArgumentError = 23; +const int abcpackage_Error_as = 2; +const int RegExp_source_get = 269; +const int RegExp_global_get = 270; +const int RegExp_ignoreCase_get = 271; +const int RegExp_multiline_get = 272; +const int RegExp_lastIndex_get = 273; +const int RegExp_lastIndex_set = 274; +const int RegExp_dotall_get = 275; +const int RegExp_extended_get = 276; +const int RegExp_AS3_exec = 277; +const int abcclass_RegExp = 24; +const int abcpackage_RegExp_as = 3; +const int Date_parse = 323; +const int Date_UTC = 324; +const int Date_AS3_valueOf = 325; +const int Date_private__toString = 326; +const int Date_private__setTime = 327; +const int Date_private__get = 328; +const int Date_AS3_getUTCFullYear = 337; +const int Date_AS3_getUTCMonth = 338; +const int Date_AS3_getUTCDate = 339; +const int Date_AS3_getUTCDay = 340; +const int Date_AS3_getUTCHours = 341; +const int Date_AS3_getUTCMinutes = 342; +const int Date_AS3_getUTCSeconds = 343; +const int Date_AS3_getUTCMilliseconds = 344; +const int Date_AS3_getFullYear = 345; +const int Date_AS3_getMonth = 346; +const int Date_AS3_getDate = 347; +const int Date_AS3_getDay = 348; +const int Date_AS3_getHours = 349; +const int Date_AS3_getMinutes = 350; +const int Date_AS3_getSeconds = 351; +const int Date_AS3_getMilliseconds = 352; +const int Date_AS3_getTimezoneOffset = 353; +const int Date_AS3_getTime = 354; +const int Date_AS3_setFullYear = 355; +const int Date_AS3_setMonth = 356; +const int Date_AS3_setDate = 357; +const int Date_AS3_setHours = 358; +const int Date_AS3_setMinutes = 359; +const int Date_AS3_setSeconds = 360; +const int Date_AS3_setMilliseconds = 361; +const int Date_AS3_setUTCFullYear = 362; +const int Date_AS3_setUTCMonth = 363; +const int Date_AS3_setUTCDate = 364; +const int Date_AS3_setUTCHours = 365; +const int Date_AS3_setUTCMinutes = 366; +const int Date_AS3_setUTCSeconds = 367; +const int Date_AS3_setUTCMilliseconds = 368; +const int abcclass_Date = 25; +const int abcpackage_Date_as = 4; +const int isXMLName = 404; +const int XML_ignoreComments_get = 447; +const int XML_ignoreComments_set = 448; +const int XML_ignoreProcessingInstructions_get = 449; +const int XML_ignoreProcessingInstructions_set = 450; +const int XML_ignoreWhitespace_get = 451; +const int XML_ignoreWhitespace_set = 452; +const int XML_prettyPrinting_get = 453; +const int XML_prettyPrinting_set = 454; +const int XML_prettyIndent_get = 455; +const int XML_prettyIndent_set = 456; +const int XML_AS3_toString = 460; +const int XML_AS3_hasOwnProperty = 461; +const int XML_AS3_propertyIsEnumerable = 462; +const int XML_AS3_addNamespace = 463; +const int XML_AS3_appendChild = 464; +const int XML_AS3_attribute = 465; +const int XML_AS3_attributes = 466; +const int XML_AS3_child = 467; +const int XML_AS3_childIndex = 468; +const int XML_AS3_children = 469; +const int XML_AS3_comments = 470; +const int XML_AS3_contains = 471; +const int XML_AS3_copy = 472; +const int XML_AS3_descendants = 473; +const int XML_AS3_elements = 474; +const int XML_AS3_hasComplexContent = 475; +const int XML_AS3_hasSimpleContent = 476; +const int XML_AS3_inScopeNamespaces = 477; +const int XML_AS3_insertChildAfter = 478; +const int XML_AS3_insertChildBefore = 479; +const int XML_AS3_localName = 481; +const int XML_AS3_name = 482; +const int XML_AS3_namespace = 483; +const int XML_AS3_namespaceDeclarations = 484; +const int XML_AS3_nodeKind = 485; +const int XML_AS3_normalize = 486; +const int XML_AS3_parent = 487; +const int XML_AS3_processingInstructions = 488; +const int XML_AS3_prependChild = 489; +const int XML_AS3_removeNamespace = 490; +const int XML_AS3_replace = 491; +const int XML_AS3_setChildren = 492; +const int XML_AS3_setLocalName = 493; +const int XML_AS3_setName = 494; +const int XML_AS3_setNamespace = 495; +const int XML_AS3_text = 496; +const int XML_AS3_toXMLString = 497; +const int XML_AS3_notification = 498; +const int XML_AS3_setNotification = 499; +const int abcclass_XML = 26; +const int XMLList_AS3_toString = 541; +const int XMLList_AS3_hasOwnProperty = 543; +const int XMLList_AS3_propertyIsEnumerable = 544; +const int XMLList_AS3_attribute = 545; +const int XMLList_AS3_attributes = 546; +const int XMLList_AS3_child = 547; +const int XMLList_AS3_children = 548; +const int XMLList_AS3_comments = 549; +const int XMLList_AS3_contains = 550; +const int XMLList_AS3_copy = 551; +const int XMLList_AS3_descendants = 552; +const int XMLList_AS3_elements = 553; +const int XMLList_AS3_hasComplexContent = 554; +const int XMLList_AS3_hasSimpleContent = 555; +const int XMLList_AS3_length = 556; +const int XMLList_AS3_name = 557; +const int XMLList_AS3_normalize = 558; +const int XMLList_AS3_parent = 559; +const int XMLList_AS3_processingInstructions = 560; +const int XMLList_AS3_text = 561; +const int XMLList_AS3_toXMLString = 562; +const int XMLList_AS3_addNamespace = 563; +const int XMLList_AS3_appendChild = 564; +const int XMLList_AS3_childIndex = 565; +const int XMLList_AS3_inScopeNamespaces = 566; +const int XMLList_AS3_insertChildAfter = 567; +const int XMLList_AS3_insertChildBefore = 568; +const int XMLList_AS3_nodeKind = 569; +const int XMLList_AS3_namespace = 570; +const int XMLList_AS3_localName = 571; +const int XMLList_AS3_namespaceDeclarations = 572; +const int XMLList_AS3_prependChild = 573; +const int XMLList_AS3_removeNamespace = 574; +const int XMLList_AS3_replace = 575; +const int XMLList_AS3_setChildren = 576; +const int XMLList_AS3_setLocalName = 577; +const int XMLList_AS3_setName = 578; +const int XMLList_AS3_setNamespace = 579; +const int abcclass_XMLList = 27; +const int QName_localName_get = 583; +const int QName_uri_get = 584; +const int abcclass_QName = 28; +const int abcpackage_XML_as = 5; +const int builtin_abc_length = 26281; +const int builtin_abc_method_count = 585; +const int builtin_abc_class_count = 29; +const int builtin_abc_script_count = 6; +extern const unsigned char builtin_abc_data[]; diff --git a/mozilla/js/tamarin/core/opcodes.cpp b/mozilla/js/tamarin/core/opcodes.cpp new file mode 100644 index 00000000000..0817ddefb5a --- /dev/null +++ b/mozilla/js/tamarin/core/opcodes.cpp @@ -0,0 +1,1596 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#if defined(AVMPLUS_PROFILE) || defined(AVMPLUS_VERBOSE) || defined(DEBUGGER) +const char *opNames[] = { + "OP_0x00", + "bkpt", + "nop", + "throw", + "getsuper", + "setsuper", + "dxns", + "dxnslate", + "kill", + "label", + "OP_0x0A", + "OP_0x0B", + "ifnlt", + "ifnle", + "ifngt", + "ifnge", + "jump", + "iftrue", + "iffalse", + "ifeq", + "ifne", + "iflt", + "ifle", + "ifgt", + "ifge", + "ifstricteq", + "ifstrictne", + "lookupswitch", + "pushwith", + "popscope", + "nextname", + "hasnext", + "pushnull", + "pushundefined", + "OP_0x22", + "nextvalue", + "pushbyte", + "pushshort", + "pushtrue", + "pushfalse", + "pushnan", + "pop", + "dup", + "swap", + "pushstring", + "pushint", + "pushuint", + "pushdouble", + "pushscope", + "pushnamespace", + "hasnext2", + "OP_0x33", + "OP_0x34", + "OP_0x35", + "OP_0x36", + "OP_0x37", + "OP_0x38", + "OP_0x39", + "OP_0x3A", + "OP_0x3B", + "OP_0x3C", + "OP_0x3D", + "OP_0x3E", + "OP_0x3F", + "newfunction", + "call", + "construct", + "callmethod", + "callstatic", + "callsuper", + "callproperty", + "returnvoid", + "returnvalue", + "constructsuper", + "constructprop", + "callsuperid", + "callproplex", + "callinterface", + "callsupervoid", + "callpropvoid", + "OP_0x50", + "OP_0x51", + "OP_0x52", + "OP_0x53", + "OP_0x54", + "newobject", + "newarray", + "newactivation", + "newclass", + "getdescendants", + "newcatch", + "OP_0x5B", + "OP_0x5C", + "findpropstrict", + "findproperty", + "finddef", + "getlex", + "setproperty", + "getlocal", + "setlocal", + "getglobalscope", + "getscopeobject", + "getproperty", + "OP_0x67", + "initproperty", + "OP_0x69", + "deleteproperty", + "OP_0x6B", + "getslot", + "setslot", + "getglobalslot", + "setglobalslot", + "convert_s", + "esc_xelem", + "esc_xattr", + "convert_i", + "convert_u", + "convert_d", + "convert_b", + "convert_o", + "checkfilter", + "OP_0x79", + "OP_0x7A", + "OP_0x7B", + "OP_0x7C", + "OP_0x7D", + "OP_0x7E", + "OP_0x7F", + "coerce", + "coerce_b", + "coerce_a", + "coerce_i", + "coerce_d", + "coerce_s", + "astype", + "astypelate", + "coerce_u", + "coerce_o", + "OP_0x8A", + "OP_0x8B", + "OP_0x8C", + "OP_0x8D", + "OP_0x8E", + "OP_0x8F", + "negate", + "increment", + "inclocal", + "decrement", + "declocal", + "typeof", + "not", + "bitnot", + "OP_0x98", + "OP_0x99", + "concat", + "add_d", + "OP_0x9C", + "OP_0x9D", + "OP_0x9E", + "OP_0x9F", + "add", + "subtract", + "multiply", + "divide", + "modulo", + "lshift", + "rshift", + "urshift", + "bitand", + "bitor", + "bitxor", + "equals", + "strictequals", + "lessthan", + "lessequals", + "greaterthan", + "greaterequals", + "instanceof", + "istype", + "istypelate", + "in", + "OP_0xB5", + "OP_0xB6", + "OP_0xB7", + "OP_0xB8", + "OP_0xB9", + "OP_0xBA", + "OP_0xBB", + "OP_0xBC", + "OP_0xBD", + "OP_0xBE", + "OP_0xBF", + "increment_i", + "decrement_i", + "inclocal_i", + "declocal_i", + "negate_i", + "add_i", + "subtract_i", + "multiply_i", + "OP_0xC8", + "OP_0xC9", + "OP_0xCA", + "OP_0xCB", + "OP_0xCC", + "OP_0xCD", + "OP_0xCE", + "OP_0xCF", + "getlocal0", + "getlocal1", + "getlocal2", + "getlocal3", + "setlocal0", + "setlocal1", + "setlocal2", + "setlocal3", + "OP_0xD8", + "OP_0xD9", + "OP_0xDA", + "OP_0xDB", + "OP_0xDC", + "OP_0xDD", + "OP_0xDE", + "OP_0xDF", + "OP_0xE0", + "OP_0xE1", + "OP_0xE2", + "OP_0xE3", + "OP_0xE4", + "OP_0xE5", + "OP_0xE6", + "OP_0xE7", + "OP_0xE8", + "OP_0xE9", + "OP_0xEA", + "OP_0xEB", + "OP_0xEC", + "OP_0xED", + "abs_jump", + "debug", + "debugline", + "debugfile", + "bkptline", + "timestamp", + "OP_0xF4", + "verifypass", + "alloc", + "mark", + "wb", + "prologue", + "sendenter", + "doubletoatom", + "sweep", + "codegenop", + "verifyop", + "decode" +}; +#endif + + + +signed char opOperandCount[] = { + -1, // "OP_0x00" + 0, // "bkpt" + 0, // "nop" + 0, // "throw" + 1, // "getsuper" + 1, // "setsuper" + 1, // "dxns" + 0, // "dxnslate" + 1, // "kill" + 0, // "label" + -1, // "OP_0x0A" + -1, // "OP_0x0B" + 1, // "ifnlt" + 1, // "ifnle" + 1, // "ifngt" + 1, // "ifnge" + 1, // "jump" + 1, // "iftrue" + 1, // "iffalse" + 1, // "ifeq" + 1, // "ifne" + 1, // "iflt" + 1, // "ifle" + 1, // "ifgt" + 1, // "ifge" + 1, // "ifstricteq" + 1, // "ifstrictne" + 2, // "lookupswitch" + 0, // "pushwith" + 0, // "popscope" + 0, // "nextname" + 0, // "hasnext" + 0, // "pushnull" + 0, // "pushundefined" + -1, // "OP_0x22" + 0, // "nextvalue" + 1, // "pushbyte" + 1, // "pushshort" + 0, // "pushtrue" + 0, // "pushfalse" + 0, // "pushnan" + 0, // "pop" + 0, // "dup" + 0, // "swap" + 1, // "pushstring" + 1, // "pushint" + 1, // "pushuint" + 1, // "pushdouble" + 0, // "pushscope" + 1, // "pushnamespace" + 2, // "hasnext2" + -1, // "OP_0x33" + -1, // "OP_0x34" + -1, // "OP_0x35" + -1, // "OP_0x36" + -1, // "OP_0x37" + -1, // "OP_0x38" + -1, // "OP_0x39" + -1, // "OP_0x3A" + -1, // "OP_0x3B" + -1, // "OP_0x3C" + -1, // "OP_0x3D" + -1, // "OP_0x3E" + -1, // "OP_0x3F" + 1, // "newfunction" + 1, // "call" + 1, // "construct" + 2, // "callmethod" + 2, // "callstatic" + 2, // "callsuper" + 2, // "callproperty" + 0, // "returnvoid" + 0, // "returnvalue" + 1, // "constructsuper" + 2, // "constructprop" + -1, // "callsuperid" + 2, // "callproplex" + -1, // "callinterface" + 2, // "callsupervoid" + 2, // "callpropvoid" + -1, // "OP_0x50" + -1, // "OP_0x51" + -1, // "OP_0x52" + -1, // "OP_0x53" + -1, // "OP_0x54" + 1, // "newobject" + 1, // "newarray" + 0, // "newactivation" + 1, // "newclass" + 1, // "getdescendants" + 1, // "newcatch" + -1, // "OP_0x5B" + -1, // "OP_0x5C" + 1, // "findpropstrict" + 1, // "findproperty" + 1, // "finddef" + 1, // "getlex" + 1, // "setproperty" + 1, // "getlocal" + 1, // "setlocal" + 0, // "getglobalscope" + 1, // "getscopeobject" + 1, // "getproperty" + -1, // "OP_0x67" + 1, // "initproperty" + -1, // "OP_0x69" + 1, // "deleteproperty" + -1, // "OP_0x6B" + 1, // "getslot" + 1, // "setslot" + 1, // "getglobalslot" + 1, // "setglobalslot" + 0, // "convert_s" + 0, // "esc_xelem" + 0, // "esc_xattr" + 0, // "convert_i" + 0, // "convert_u" + 0, // "convert_d" + 0, // "convert_b" + 0, // "convert_o" + 0, // "checkfilter" + -1, // "OP_0x79" + -1, // "OP_0x7A" + -1, // "OP_0x7B" + -1, // "OP_0x7C" + -1, // "OP_0x7D" + -1, // "OP_0x7E" + -1, // "OP_0x7F" + 1, // "coerce" + 0, // "coerce_b" + 0, // "coerce_a" + 0, // "coerce_i" + 0, // "coerce_d" + 0, // "coerce_s" + 1, // "astype" + 0, // "astypelate" + 0, // "coerce_u" + 0, // "coerce_o" + -1, // "OP_0x8A" + -1, // "OP_0x8B" + -1, // "OP_0x8C" + -1, // "OP_0x8D" + -1, // "OP_0x8E" + -1, // "OP_0x8F" + 0, // "negate" + 0, // "increment" + 1, // "inclocal" + 0, // "decrement" + 1, // "declocal" + 0, // "typeof" + 0, // "not" + 0, // "bitnot" + -1, // "OP_0x98" + -1, // "OP_0x99" + -1, // "concat" + -1, // "add_d" + -1, // "OP_0x9C" + -1, // "OP_0x9D" + -1, // "OP_0x9E" + -1, // "OP_0x9F" + 0, // "add" + 0, // "subtract" + 0, // "multiply" + 0, // "divide" + 0, // "modulo" + 0, // "lshift" + 0, // "rshift" + 0, // "urshift" + 0, // "bitand" + 0, // "bitor" + 0, // "bitxor" + 0, // "equals" + 0, // "strictequals" + 0, // "lessthan" + 0, // "lessequals" + 0, // "greaterthan" + 0, // "greaterequals" + 0, // "instanceof" + 1, // "istype" + 0, // "istypelate" + 0, // "in" + -1, // "OP_0xB5" + -1, // "OP_0xB6" + -1, // "OP_0xB7" + -1, // "OP_0xB8" + -1, // "OP_0xB9" + -1, // "OP_0xBA" + -1, // "OP_0xBB" + -1, // "OP_0xBC" + -1, // "OP_0xBD" + -1, // "OP_0xBE" + -1, // "OP_0xBF" + 0, // "increment_i" + 0, // "decrement_i" + 1, // "inclocal_i" + 1, // "declocal_i" + 0, // "negate_i" + 0, // "add_i" + 0, // "subtract_i" + 0, // "multiply_i" + -1, // "OP_0xC8" + -1, // "OP_0xC9" + -1, // "OP_0xCA" + -1, // "OP_0xCB" + -1, // "OP_0xCC" + -1, // "OP_0xCD" + -1, // "OP_0xCE" + -1, // "OP_0xCF" + 0, // "getlocal0" + 0, // "getlocal1" + 0, // "getlocal2" + 0, // "getlocal3" + 0, // "setlocal0" + 0, // "setlocal1" + 0, // "setlocal2" + 0, // "setlocal3" + -1, // "OP_0xD8" + -1, // "OP_0xD9" + -1, // "OP_0xDA" + -1, // "OP_0xDB" + -1, // "OP_0xDC" + -1, // "OP_0xDD" + -1, // "OP_0xDE" + -1, // "OP_0xDF" + -1, // "OP_0xE0" + -1, // "OP_0xE1" + -1, // "OP_0xE2" + -1, // "OP_0xE3" + -1, // "OP_0xE4" + -1, // "OP_0xE5" + -1, // "OP_0xE6" + -1, // "OP_0xE7" + -1, // "OP_0xE8" + -1, // "OP_0xE9" + -1, // "OP_0xEA" + -1, // "OP_0xEB" + -1, // "OP_0xEC" + -1, // "OP_0xED" + 2, // "abs_jump" + 4, // "debug" + 1, // "debugline" + 1, // "debugfile" + 1, // "bkptline" + 0, // "timestamp" + -1, // "OP_0xF4" + -1, // "verifypass" + -1, // "alloc" + -1, // "mark" + -1, // "wb" + -1, // "prologue" + -1, // "sendenter" + -1, // "doubletoatom" + -1, // "sweep" + -1, // "codegenop" + -1, // "verifyop" + -1, // "decode" + +}; + +#if 0 && defined(AVMPLUS_MIR) && defined(_DEBUG) + + +// C++ note. the max opSize[] value is 5 (3 bits). We could pack these tighter. +// no. of bytes in the opcode stream. 0 means unsupported opcode. +unsigned char opSizes[] = { + 0, // "OP_0x00" + 1, // "bkpt" + 1, // "nop" + 1, // "throw" + 1+2, // "getsuper" + 1+2, // "setsuper" + 1+2, // "dxns" + 1, // "dxnslate" + 1+2, // "kill" + 1, // "label" + 0, // "OP_0x0A" + 0, // "OP_0x0B" + 1+3, // "ifnlt" + 1+3, // "ifnle" + 1+3, // "ifngt" + 1+3, // "ifnge" + 1+3, // "jump" + 1+3, // "iftrue" + 1+3, // "iffalse" + 1+3, // "ifeq" + 1+3, // "ifne" + 1+3, // "iflt" + 1+3, // "ifle" + 1+3, // "ifgt" + 1+3, // "ifge" + 1+3, // "ifstricteq" + 1+3, // "ifstrictne" + 1+3+2+0, // "lookupswitch" + 1, // "pushwith" + 1, // "popscope" + 1, // "nextname" + 1, // "hasnext" + 1, // "pushnull" + 1, // "pushundefined" + 0, // "OP_0x22" + 1, // "nextvalue" + 1+1, // "pushbyte" + 1+2, // "pushshort" + 1, // "pushtrue" + 1, // "pushfalse" + 1, // "pushnan" + 1, // "pop" + 1, // "dup" + 1, // "swap" + 1+2, // "pushstring" + 1+2, // "pushint" + 1+2, // "pushuint" + 1+2, // "pushdouble" + 1, // "pushscope" + 1+2, // "pushnamespace" + 1, // "hasnext2" + 0, // "OP_0x33" + 0, // "OP_0x34" + 0, // "OP_0x35" + 0, // "OP_0x36" + 0, // "OP_0x37" + 0, // "OP_0x38" + 0, // "OP_0x39" + 0, // "OP_0x3A" + 0, // "OP_0x3B" + 0, // "OP_0x3C" + 0, // "OP_0x3D" + 0, // "OP_0x3E" + 0, // "OP_0x3F" + 1+2, // "newfunction" + 1+2, // "call" + 1+2, // "construct" + 1+2+2, // "callmethod" + 1+2+2, // "callstatic" + 1+2+2, // "callsuper" + 1+2+2, // "callproperty" + 1, // "returnvoid" + 1, // "returnvalue" + 1+2, // "constructsuper" + 1+2+2, // "constructprop" + 0, // "callsuperid" + 1+2+2, // "callproplex" + 0, // "callinterface" + 1+2+2, // "callsupervoid" + 1+2+2, // "callpropvoid" + 0, // "OP_0x50" + 0, // "OP_0x51" + 0, // "OP_0x52" + 0, // "OP_0x53" + 0, // "OP_0x54" + 1+2, // "newobject" + 1+2, // "newarray" + 1, // "newactivation" + 1+2, // "newclass" + 1+2, // "getdescendants" + 1+2, // "newcatch" + 0, // "OP_0x5B" + 0, // "OP_0x5C" + 1+2, // "findpropstrict" + 1+2, // "findproperty" + 1+2, // "finddef" + 1+2, // "getlex" + 1+2, // "setproperty" + 1+2, // "getlocal" + 1+2, // "setlocal" + 1, // "getglobalscope" + 1+1, // "getscopeobject" + 1+2, // "getproperty" + 0, // "OP_0x67" + 1+2, // "initproperty" + 0, // "OP_0x69" + 1+2, // "deleteproperty" + 0, // "OP_0x6B" + 1+2, // "getslot" + 1+2, // "setslot" + 1+2, // "getglobalslot" + 1+2, // "setglobalslot" + 1, // "convert_s" + 1, // "esc_xelem" + 1, // "esc_xattr" + 1, // "convert_i" + 1, // "convert_u" + 1, // "convert_d" + 1, // "convert_b" + 1, // "convert_o" + 1, // "checkfilter" + 0, // "OP_0x79" + 0, // "OP_0x7A" + 0, // "OP_0x7B" + 0, // "OP_0x7C" + 0, // "OP_0x7D" + 0, // "OP_0x7E" + 0, // "OP_0x7F" + 1+2, // "coerce" + 1, // "coerce_b" + 1, // "coerce_a" + 1, // "coerce_i" + 1, // "coerce_d" + 1, // "coerce_s" + 1+2, // "astype" + 1, // "astypelate" + 1, // "coerce_u" + 1, // "coerce_o" + 0, // "OP_0x8A" + 0, // "OP_0x8B" + 0, // "OP_0x8C" + 0, // "OP_0x8D" + 0, // "OP_0x8E" + 0, // "OP_0x8F" + 1, // "negate" + 1, // "increment" + 1+2, // "inclocal" + 1, // "decrement" + 1+2, // "declocal" + 1, // "typeof" + 1, // "not" + 1, // "bitnot" + 0, // "OP_0x98" + 0, // "OP_0x99" + 0, // "concat" + 0, // "add_d" + 0, // "OP_0x9C" + 0, // "OP_0x9D" + 0, // "OP_0x9E" + 0, // "OP_0x9F" + 1, // "add" + 1, // "subtract" + 1, // "multiply" + 1, // "divide" + 1, // "modulo" + 1, // "lshift" + 1, // "rshift" + 1, // "urshift" + 1, // "bitand" + 1, // "bitor" + 1, // "bitxor" + 1, // "equals" + 1, // "strictequals" + 1, // "lessthan" + 1, // "lessequals" + 1, // "greaterthan" + 1, // "greaterequals" + 1, // "instanceof" + 1+2, // "istype" + 1, // "istypelate" + 1, // "in" + 0, // "OP_0xB5" + 0, // "OP_0xB6" + 0, // "OP_0xB7" + 0, // "OP_0xB8" + 0, // "OP_0xB9" + 0, // "OP_0xBA" + 0, // "OP_0xBB" + 0, // "OP_0xBC" + 0, // "OP_0xBD" + 0, // "OP_0xBE" + 0, // "OP_0xBF" + 1, // "increment_i" + 1, // "decrement_i" + 1+2, // "inclocal_i" + 1+2, // "declocal_i" + 1, // "negate_i" + 1, // "add_i" + 1, // "subtract_i" + 1, // "multiply_i" + 0, // "OP_0xC8" + 0, // "OP_0xC9" + 0, // "OP_0xCA" + 0, // "OP_0xCB" + 0, // "OP_0xCC" + 0, // "OP_0xCD" + 0, // "OP_0xCE" + 0, // "OP_0xCF" + 1, // "getlocal0" + 1, // "getlocal1" + 1, // "getlocal2" + 1, // "getlocal3" + 1, // "setlocal0" + 1, // "setlocal1" + 1, // "setlocal2" + 1, // "setlocal3" + 0, // "OP_0xD8" + 0, // "OP_0xD9" + 0, // "OP_0xDA" + 0, // "OP_0xDB" + 0, // "OP_0xDC" + 0, // "OP_0xDD" + 0, // "OP_0xDE" + 0, // "OP_0xDF" + 0, // "OP_0xE0" + 0, // "OP_0xE1" + 0, // "OP_0xE2" + 0, // "OP_0xE3" + 0, // "OP_0xE4" + 0, // "OP_0xE5" + 0, // "OP_0xE6" + 0, // "OP_0xE7" + 0, // "OP_0xE8" + 0, // "OP_0xE9" + 0, // "OP_0xEA" + 0, // "OP_0xEB" + 0, // "OP_0xEC" + 0, // "OP_0xED" + 1+2, // "abs_jump" + 1+1+2+4, // "debug" + 1+3, // "debugline" + 1+2, // "debugfile" + 1+3, // "bkptline" + 1, // "timestamp" + 0, // "OP_0xF4" + 0, // "verifypass" + 0, // "alloc" + 0, // "mark" + 0, // "wb" + 0, // "prologue" + 0, // "sendenter" + 0, // "doubletoatom" + 0, // "sweep" + 0, // "codegenop" + 0, // "verifyop" + 0, // "decode" + +}; +unsigned char opStackPop[] = { + 0, + 0, + 0, + 0, + 1, + 2, + 0, + 1, + 0, + 0, + 0, + 0, + 2, + 2, + 2, + 2, + 0, + 1, + 1, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 1, + 0, + 0, + 2, + 2, + 0, + 0, + 0, + 2, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 2, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + -1, + -1, + -1, + -1, + -1, + -1, + 0, + 1, + -1, + -1, + 0, + -1, + 0, + -1, + -1, + 0, + 0, + 0, + 0, + 0, + -1, + -1, + -1, + 1, + 1, + -1, + 0, + 0, + 0, + 0, + 0, + -1, + -1, + 0, + 1, + 0, + 0, + -1, + 0, + -1, + 0, + -1, + 0, + 1, + 2, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 2, + 1, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 0, + 1, + 0, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 1, + 2, + 2, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 0, + 0, + 1, + 2, + 2, + 2, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 +}; + +unsigned char opStackPush[] = { + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 2, + 2, + 1, + 1, + 1, + 1, + 0, + 1, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 1, + 0, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 0, + 1, + 1, + 1, + 1, + 0, + 1, + 0, + 1, + 1, + 1, + 0, + 0, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 0, + 1, + 0, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 0, + 0, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 +}; +#endif /* AVMPLUS_MIR && _DEBUG */ +unsigned char opCanThrow[] = { + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 0, + 0, + 1, + 0, + 0, + 1, + 1, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 +}; + diff --git a/mozilla/js/tamarin/core/opcodes.h b/mozilla/js/tamarin/core/opcodes.h new file mode 100644 index 00000000000..22119e34d22 --- /dev/null +++ b/mozilla/js/tamarin/core/opcodes.h @@ -0,0 +1,202 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +enum AbcOpcode { +OP_bkpt = 0x01, +OP_nop = 0x02, +OP_throw = 0x03, +OP_getsuper = 0x04, +OP_setsuper = 0x05, +OP_dxns = 0x06, +OP_dxnslate = 0x07, +OP_kill = 0x08, +OP_label = 0x09, +OP_ifnlt = 0x0C, +OP_ifnle = 0x0D, +OP_ifngt = 0x0E, +OP_ifnge = 0x0F, +OP_jump = 0x10, +OP_iftrue = 0x11, +OP_iffalse = 0x12, +OP_ifeq = 0x13, +OP_ifne = 0x14, +OP_iflt = 0x15, +OP_ifle = 0x16, +OP_ifgt = 0x17, +OP_ifge = 0x18, +OP_ifstricteq = 0x19, +OP_ifstrictne = 0x1A, +OP_lookupswitch = 0x1B, +OP_pushwith = 0x1C, +OP_popscope = 0x1D, +OP_nextname = 0x1E, +OP_hasnext = 0x1F, +OP_pushnull = 0x20, +OP_pushundefined = 0x21, +OP_nextvalue = 0x23, +OP_pushbyte = 0x24, +OP_pushshort = 0x25, +OP_pushtrue = 0x26, +OP_pushfalse = 0x27, +OP_pushnan = 0x28, +OP_pop = 0x29, +OP_dup = 0x2A, +OP_swap = 0x2B, +OP_pushstring = 0x2C, +OP_pushint = 0x2D, +OP_pushuint = 0x2E, +OP_pushdouble = 0x2F, +OP_pushscope = 0x30, +OP_pushnamespace = 0x31, +OP_hasnext2 = 0x32, +OP_newfunction = 0x40, +OP_call = 0x41, +OP_construct = 0x42, +OP_callmethod = 0x43, +OP_callstatic = 0x44, +OP_callsuper = 0x45, +OP_callproperty = 0x46, +OP_returnvoid = 0x47, +OP_returnvalue = 0x48, +OP_constructsuper = 0x49, +OP_constructprop = 0x4A, +OP_callsuperid = 0x4B, +OP_callproplex = 0x4C, +OP_callinterface = 0x4D, +OP_callsupervoid = 0x4E, +OP_callpropvoid = 0x4F, +OP_newobject = 0x55, +OP_newarray = 0x56, +OP_newactivation = 0x57, +OP_newclass = 0x58, +OP_getdescendants = 0x59, +OP_newcatch = 0x5A, +OP_findpropstrict = 0x5D, +OP_findproperty = 0x5E, +OP_finddef = 0x5F, +OP_getlex = 0x60, +OP_setproperty = 0x61, +OP_getlocal = 0x62, +OP_setlocal = 0x63, +OP_getglobalscope = 0x64, +OP_getscopeobject = 0x65, +OP_getproperty = 0x66, +OP_initproperty = 0x68, +OP_deleteproperty = 0x6A, +OP_getslot = 0x6C, +OP_setslot = 0x6D, +OP_getglobalslot = 0x6E, +OP_setglobalslot = 0x6F, +OP_convert_s = 0x70, +OP_esc_xelem = 0x71, +OP_esc_xattr = 0x72, +OP_convert_i = 0x73, +OP_convert_u = 0x74, +OP_convert_d = 0x75, +OP_convert_b = 0x76, +OP_convert_o = 0x77, +OP_checkfilter = 0x78, +OP_coerce = 0x80, +OP_coerce_b = 0x81, +OP_coerce_a = 0x82, +OP_coerce_i = 0x83, +OP_coerce_d = 0x84, +OP_coerce_s = 0x85, +OP_astype = 0x86, +OP_astypelate = 0x87, +OP_coerce_u = 0x88, +OP_coerce_o = 0x89, +OP_negate = 0x90, +OP_increment = 0x91, +OP_inclocal = 0x92, +OP_decrement = 0x93, +OP_declocal = 0x94, +OP_typeof = 0x95, +OP_not = 0x96, +OP_bitnot = 0x97, +OP_concat = 0x9A, +OP_add_d = 0x9B, +OP_add = 0xA0, +OP_subtract = 0xA1, +OP_multiply = 0xA2, +OP_divide = 0xA3, +OP_modulo = 0xA4, +OP_lshift = 0xA5, +OP_rshift = 0xA6, +OP_urshift = 0xA7, +OP_bitand = 0xA8, +OP_bitor = 0xA9, +OP_bitxor = 0xAA, +OP_equals = 0xAB, +OP_strictequals = 0xAC, +OP_lessthan = 0xAD, +OP_lessequals = 0xAE, +OP_greaterthan = 0xAF, +OP_greaterequals = 0xB0, +OP_instanceof = 0xB1, +OP_istype = 0xB2, +OP_istypelate = 0xB3, +OP_in = 0xB4, +OP_increment_i = 0xC0, +OP_decrement_i = 0xC1, +OP_inclocal_i = 0xC2, +OP_declocal_i = 0xC3, +OP_negate_i = 0xC4, +OP_add_i = 0xC5, +OP_subtract_i = 0xC6, +OP_multiply_i = 0xC7, +OP_getlocal0 = 0xD0, +OP_getlocal1 = 0xD1, +OP_getlocal2 = 0xD2, +OP_getlocal3 = 0xD3, +OP_setlocal0 = 0xD4, +OP_setlocal1 = 0xD5, +OP_setlocal2 = 0xD6, +OP_setlocal3 = 0xD7, +OP_abs_jump = 0xEE, +OP_debug = 0xEF, +OP_debugline = 0xF0, +OP_debugfile = 0xF1, +OP_bkptline = 0xF2, +OP_timestamp = 0xF3, +OP_verifypass = 0xF5, +OP_alloc = 0xF6, +OP_mark = 0xF7, +OP_wb = 0xF8, +OP_prologue = 0xF9, +OP_sendenter = 0xFA, +OP_doubletoatom = 0xFB, +OP_sweep = 0xFC, +OP_codegenop = 0xFD, +OP_verifyop = 0xFE, +OP_decode = 0xFF, +}; diff --git a/mozilla/js/tamarin/core/opcodes.tbl b/mozilla/js/tamarin/core/opcodes.tbl new file mode 100644 index 00000000000..1e636ba0628 --- /dev/null +++ b/mozilla/js/tamarin/core/opcodes.tbl @@ -0,0 +1,332 @@ +// ***** BEGIN LICENSE BLOCK ***** +// Version: MPL 1.1/GPL 2.0/LGPL 2.1 +// +// The contents of this file are subject to the Mozilla Public License Version 1.1 (the +// "License"); you may not use this file except in compliance with the License. You may obtain +// a copy of the License at http://www.mozilla.org/MPL/ +// +// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +// WARRANTY OF ANY KIND, either express or implied. See the License for the specific +// language governing rights and limitations under the License. +// +// The Original Code is [Open Source Virtual Machine.] +// +// The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +// by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights +// Reserved. +// +// Contributor(s): Adobe AS3 Team +// +// Alternatively, the contents of this file may be used under the terms of either the GNU +// General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +// License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +// LGPL are applicable instead of those above. If you wish to allow use of your version of this +// file only under the terms of either the GPL or the LGPL, and not to allow others to use your +// version of this file under the terms of the MPL, indicate your decision by deleting provisions +// above and replace them with the notice and other provisions required by the GPL or the +// LGPL. If you do not delete the provisions above, a recipient may use your version of this file +// under the terms of any one of the MPL, the GPL or the LGPL. +// +// ***** END LICENSE BLOCK ***** */ + +// +// This table contains all the opcodes for the AVM+ runtime system. +// A pre-processor macro can be used to extract the required +// information from the table in whatever form is required. +// +// The script opcodes.as will generate tables in .h and .cpp +// files from this XML file. +// +// Don't forget if you add a column to the table you need +// to modify the opcodes.as to generate proper .h and .cpp +// files that utilize this table. +// +// Don't forget if you add a column to the table you need +// to modify all the macros that utilize this table. +// +// The table fields are the following: +// const - name used to idenfify the bytecode +// name - string representation good for display +// code - integer value +// ins_width - # of bytes instruction requires +// frm_use - number of frame references made by the instruction +// frm_set - number of frame sets performed by the instruction +// stk_pop - number of stack pops made by the instruction (-1 => variable) +// stk_push - number of stack pushes made by the instruction +// throws - 1 if the instruction might throw an exception, 0 if not +// +// +// const, name, code, ins_width, op_count, frm_use, frm_set, stk_pop, stk_push, throws +// +OP_0x00 "OP_0x00" 0x00 0 -1 0 0 0 0 0 +OP_bkpt "bkpt" 0x01 1 0 0 0 0 0 0 +OP_nop "nop" 0x02 1 0 0 0 0 0 0 +OP_throw "throw" 0x03 1 0 0 0 0 0 1 +OP_getsuper "getsuper" 0x04 1+2 1 0 0 1 1 1 +OP_setsuper "setsuper" 0x05 1+2 1 0 0 2 0 1 +OP_dxns "dxns" 0x06 1+2 1 0 0 0 0 1 +OP_dxnslate "dxnslate" 0x07 1 0 0 0 1 0 1 +OP_kill "kill" 0x08 1+2 1 0 1 0 0 0 +OP_label "label" 0x09 1 0 0 0 0 0 0 +OP_0x0A "OP_0x0A" 0x0A 0 -1 0 0 0 0 0 +OP_0x0B "OP_0x0B" 0x0B 0 -1 0 0 0 0 0 +OP_ifnlt "ifnlt" 0x0C 1+3 1 0 0 2 0 0 +OP_ifnle "ifnle" 0x0D 1+3 1 0 0 2 0 0 +OP_ifngt "ifngt" 0x0E 1+3 1 0 0 2 0 0 +OP_ifnge "ifnge" 0x0F 1+3 1 0 0 2 0 0 +OP_jump "jump" 0x10 1+3 1 0 0 0 0 0 +OP_iftrue "iftrue" 0x11 1+3 1 0 0 1 0 0 +OP_iffalse "iffalse" 0x12 1+3 1 0 0 1 0 0 +OP_ifeq "ifeq" 0x13 1+3 1 0 0 2 0 0 +OP_ifne "ifne" 0x14 1+3 1 0 0 2 0 0 +OP_iflt "iflt" 0x15 1+3 1 0 0 2 0 0 +OP_ifle "ifle" 0x16 1+3 1 0 0 2 0 0 +OP_ifgt "ifgt" 0x17 1+3 1 0 0 2 0 0 +OP_ifge "ifge" 0x18 1+3 1 0 0 2 0 0 +OP_ifstricteq "ifstricteq" 0x19 1+3 1 0 0 2 0 0 +OP_ifstrictne "ifstrictne" 0x1A 1+3 1 0 0 2 0 0 +OP_lookupswitch "lookupswitch" 0x1B 1+3+2+0 2 0 0 1 0 0 +OP_pushwith "pushwith" 0x1C 1 0 0 0 0 0 0 +OP_popscope "popscope" 0x1D 1 0 0 0 0 0 0 +OP_nextname "nextname" 0x1E 1 0 0 0 2 1 1 +OP_hasnext "hasnext" 0x1F 1 0 0 0 2 1 1 +OP_pushnull "pushnull" 0x20 1 0 0 0 0 1 0 +OP_pushundefined "pushundefined" 0x21 1 0 0 0 0 1 0 +OP_0x22 "OP_0x22" 0x22 0 -1 0 0 0 0 0 +OP_nextvalue "nextvalue" 0x23 1 0 0 0 2 1 1 +OP_pushbyte "pushbyte" 0x24 1+1 1 0 0 0 1 0 +OP_pushshort "pushshort" 0x25 1+2 1 0 0 0 1 0 +OP_pushtrue "pushtrue" 0x26 1 0 0 0 0 1 0 +OP_pushfalse "pushfalse" 0x27 1 0 0 0 0 1 0 +OP_pushnan "pushnan" 0x28 1 0 0 0 0 1 0 +OP_pop "pop" 0x29 1 0 0 0 1 0 0 +OP_dup "dup" 0x2A 1 0 0 0 1 2 0 +OP_swap "swap" 0x2B 1 0 0 0 2 2 0 +OP_pushstring "pushstring" 0x2C 1+2 1 0 0 0 1 0 +OP_pushint "pushint" 0x2D 1+2 1 0 0 0 1 0 +OP_pushuint "pushuint" 0x2E 1+2 1 0 0 0 1 0 +OP_pushdouble "pushdouble" 0x2F 1+2 1 0 0 0 1 0 +OP_pushscope "pushscope" 0x30 1 0 0 0 0 0 0 +OP_pushnamespace "pushnamespace" 0x31 1+2 1 0 0 0 1 0 +OP_hasnext2 "hasnext2" 0x32 1 2 0 0 0 1 1 +OP_0x33 "OP_0x33" 0x33 0 -1 0 0 0 0 0 +OP_0x34 "OP_0x34" 0x34 0 -1 0 0 0 0 0 +OP_0x35 "OP_0x35" 0x35 0 -1 0 0 0 0 0 +OP_0x36 "OP_0x36" 0x36 0 -1 0 0 0 0 0 +OP_0x37 "OP_0x37" 0x37 0 -1 0 0 0 0 0 +OP_0x38 "OP_0x38" 0x38 0 -1 0 0 0 0 0 +OP_0x39 "OP_0x39" 0x39 0 -1 0 0 0 0 0 +OP_0x3A "OP_0x3A" 0x3A 0 -1 0 0 0 0 0 +OP_0x3B "OP_0x3B" 0x3B 0 -1 0 0 0 0 0 +OP_0x3C "OP_0x3C" 0x3C 0 -1 0 0 0 0 0 +OP_0x3D "OP_0x3D" 0x3D 0 -1 0 0 0 0 0 +OP_0x3E "OP_0x3E" 0x3E 0 -1 0 0 0 0 0 +OP_0x3F "OP_0x3F" 0x3F 0 -1 0 0 0 0 0 +OP_newfunction "newfunction" 0x40 1+2 1 0 0 0 1 1 +OP_call "call" 0x41 1+2 1 0 0 -1 1 1 // stk in: func obj args... +OP_construct "construct" 0x42 1+2 1 0 0 -1 1 1 // stk in: func args... +OP_callmethod "callmethod" 0x43 1+2+2 2 0 0 -1 1 1 // stk in: obj args... +OP_callstatic "callstatic" 0x44 1+2+2 2 0 0 -1 1 1 // stk in: obj args... +OP_callsuper "callsuper" 0x45 1+2+2 2 0 0 -1 1 1 // stk in: obj [ns] [name] args... +OP_callproperty "callproperty" 0x46 1+2+2 2 0 0 -1 1 1 // stk in: base [ns] [name] args... +OP_returnvoid "returnvoid" 0x47 1 0 0 0 0 0 0 +OP_returnvalue "returnvalue" 0x48 1 0 0 0 1 0 0 +OP_constructsuper "constructsuper" 0x49 1+2 1 0 0 -1 0 1 // stk in: obj args... +OP_constructprop "constructprop" 0x4A 1+2+2 2 0 0 -1 1 1 // stk in: obj args ... +OP_callsuperid "callsuperid" 0x4B 0 -1 0 0 0 0 1 // MIR only +OP_callproplex "callproplex" 0x4C 1+2+2 2 0 0 -1 1 1 // stk in: base [ns] [name] args... +OP_callinterface "callinterface" 0x4D 0 -1 0 0 0 0 1 // MIR only +OP_callsupervoid "callsupervoid" 0x4E 1+2+2 2 0 0 -1 0 1 // stk in: obj [ns] [name] args... +OP_callpropvoid "callpropvoid" 0x4F 1+2+2 2 0 0 -1 0 1 // stk in: base [ns] [name] args... +OP_0x50 "OP_0x50" 0x50 0 -1 0 0 0 0 0 +OP_0x51 "OP_0x51" 0x51 0 -1 0 0 0 0 0 +OP_0x52 "OP_0x52" 0x52 0 -1 0 0 0 0 0 +OP_0x53 "OP_0x53" 0x53 0 -1 0 0 0 0 0 +OP_0x54 "OP_0x54" 0x54 0 -1 0 0 0 0 0 +OP_newobject "newobject" 0x55 1+2 1 0 0 -1 1 1 +OP_newarray "newarray" 0x56 1+2 1 0 0 -1 1 1 +OP_newactivation "newactivation" 0x57 1 0 0 0 -1 1 1 +OP_newclass "newclass" 0x58 1+2 1 0 0 1 1 1 +OP_getdescendants "getdescendants" 0x59 1+2 1 0 0 1 1 1 +OP_newcatch "newcatch" 0x5A 1+2 1 0 0 -1 1 1 +OP_0x5B "OP_0x5B" 0x5B 0 -1 0 0 0 0 0 +OP_0x5C "OP_0x5C" 0x5C 0 -1 0 0 0 0 0 +OP_findpropstrict "findpropstrict" 0x5D 1+2 1 0 0 0 1 1 // stk in: [ns] [name] +OP_findproperty "findproperty" 0x5E 1+2 1 0 0 0 1 1 // stk in: [ns] [name] +OP_finddef "finddef" 0x5F 1+2 1 0 0 0 1 1 +OP_getlex "getlex" 0x60 1+2 1 0 0 -1 1 1 // stk in: obj [ns] [name] +OP_setproperty "setproperty" 0x61 1+2 1 0 0 -1 0 1 // stk in: obj [ns] [name] value +OP_getlocal "getlocal" 0x62 1+2 1 1 0 0 1 0 +OP_setlocal "setlocal" 0x63 1+2 1 0 1 1 0 0 +OP_getglobalscope "getglobalscope" 0x64 1 0 0 0 0 1 0 +OP_getscopeobject "getscopeobject" 0x65 1+1 1 0 0 0 1 0 +OP_getproperty "getproperty" 0x66 1+2 1 0 0 -1 1 1 // stk in: obj [ns] [name] +OP_0x67 "OP_0x67" 0x67 0 -1 0 0 0 0 0 +OP_initproperty "initproperty" 0x68 1+2 1 0 0 -1 0 1 // stk in: obj [ns] [name] value +OP_0x69 "OP_0x69" 0x69 0 -1 0 0 0 0 0 +OP_deleteproperty "deleteproperty" 0x6A 1+2 1 0 0 -1 1 1 // stk in: obj [ns] [name] +OP_0x6B "OP_0x6B" 0x6B 0 -1 0 0 0 0 0 +OP_getslot "getslot" 0x6C 1+2 1 0 0 1 1 0 +OP_setslot "setslot" 0x6D 1+2 1 0 0 2 0 0 + +// deprecated +OP_getglobalslot "getglobalslot" 0x6E 1+2 1 0 0 0 1 0 + +// deprecated +OP_setglobalslot "setglobalslot" 0x6F 1+2 1 0 0 1 0 0 + +OP_convert_s "convert_s" 0x70 1 0 0 0 1 1 1 +OP_esc_xelem "esc_xelem" 0x71 1 0 0 0 1 1 1 +OP_esc_xattr "esc_xattr" 0x72 1 0 0 0 1 1 1 +OP_convert_i "convert_i" 0x73 1 0 0 0 1 1 1 +OP_convert_u "convert_u" 0x74 1 0 0 0 1 1 1 +OP_convert_d "convert_d" 0x75 1 0 0 0 1 1 1 +OP_convert_b "convert_b" 0x76 1 0 0 0 1 1 1 +OP_convert_o "convert_o" 0x77 1 0 0 0 1 1 1 +OP_checkfilter "checkfilter" 0x78 1 0 0 0 0 0 1 +OP_0x79 "OP_0x79" 0x79 0 -1 0 0 0 0 0 +OP_0x7A "OP_0x7A" 0x7A 0 -1 0 0 0 0 0 +OP_0x7B "OP_0x7B" 0x7B 0 -1 0 0 0 0 0 +OP_0x7C "OP_0x7C" 0x7C 0 -1 0 0 0 0 0 +OP_0x7D "OP_0x7D" 0x7D 0 -1 0 0 0 0 0 +OP_0x7E "OP_0x7E" 0x7E 0 -1 0 0 0 0 0 +OP_0x7F "OP_0x7F" 0x7F 0 -1 0 0 0 0 0 +OP_coerce "coerce" 0x80 1+2 1 0 0 1 1 1 + +// deprecated +OP_coerce_b "coerce_b" 0x81 1 0 0 0 1 1 1 + +OP_coerce_a "coerce_a" 0x82 1 0 0 0 1 1 1 + +// deprecated +OP_coerce_i "coerce_i" 0x83 1 0 0 0 1 1 1 + +// deprecated +OP_coerce_d "coerce_d" 0x84 1 0 0 0 1 1 1 + +OP_coerce_s "coerce_s" 0x85 1 0 0 0 1 1 1 +OP_astype "astype" 0x86 1+2 1 0 0 1 1 1 +OP_astypelate "astypelate" 0x87 1 0 0 0 2 1 1 + +// deprecated +OP_coerce_u "coerce_u" 0x88 1 0 0 0 1 1 1 + +OP_coerce_o "coerce_o" 0x89 1 0 0 0 1 1 1 +OP_0x8A "OP_0x8A" 0x8A 0 -1 0 0 0 0 0 +OP_0x8B "OP_0x8B" 0x8B 0 -1 0 0 0 0 0 +OP_0x8C "OP_0x8C" 0x8C 0 -1 0 0 0 0 0 +OP_0x8D "OP_0x8D" 0x8D 0 -1 0 0 0 0 0 +OP_0x8E "OP_0x8E" 0x8E 0 -1 0 0 0 0 0 +OP_0x8F "OP_0x8F" 0x8F 0 -1 0 0 0 0 0 +OP_negate "negate" 0x90 1 0 0 0 1 1 1 +OP_increment "increment" 0x91 1 0 0 0 1 1 1 +OP_inclocal "inclocal" 0x92 1+2 1 1 1 0 0 1 +OP_decrement "decrement" 0x93 1 0 0 0 1 1 1 +OP_declocal "declocal" 0x94 1+2 1 1 1 0 0 1 +OP_typeof "typeof" 0x95 1 0 0 0 1 1 0 +OP_not "not" 0x96 1 0 0 0 1 1 0 +OP_bitnot "bitnot" 0x97 1 0 0 0 1 1 1 +OP_0x98 "OP_0x98" 0x98 0 -1 0 0 0 0 0 +OP_0x99 "OP_0x99" 0x99 0 -1 0 0 0 0 0 +OP_concat "concat" 0x9A 0 -1 0 0 0 0 1 //internal only +OP_add_d "add_d" 0x9B 0 -1 0 0 0 0 1 //internal only +OP_0x9C "OP_0x9C" 0x9C 0 -1 0 0 0 0 0 +OP_0x9D "OP_0x9D" 0x9D 0 -1 0 0 0 0 0 +OP_0x9E "OP_0x9E" 0x9E 0 -1 0 0 0 0 0 +OP_0x9F "OP_0x9F" 0x9F 0 -1 0 0 0 0 0 +OP_add "add" 0xA0 1 0 0 0 2 1 1 +OP_subtract "subtract" 0xA1 1 0 0 0 2 1 1 +OP_multiply "multiply" 0xA2 1 0 0 0 2 1 1 +OP_divide "divide" 0xA3 1 0 0 0 2 1 1 +OP_modulo "modulo" 0xA4 1 0 0 0 2 1 1 +OP_lshift "lshift" 0xA5 1 0 0 0 2 1 1 +OP_rshift "rshift" 0xA6 1 0 0 0 2 1 1 +OP_urshift "urshift" 0xA7 1 0 0 0 2 1 1 +OP_bitand "bitand" 0xA8 1 0 0 0 2 1 1 +OP_bitor "bitor" 0xA9 1 0 0 0 2 1 1 +OP_bitxor "bitxor" 0xAA 1 0 0 0 2 1 1 +OP_equals "equals" 0xAB 1 0 0 0 2 1 1 +OP_strictequals "strictequals" 0xAC 1 0 0 0 2 1 1 +OP_lessthan "lessthan" 0xAD 1 0 0 0 2 1 1 +OP_lessequals "lessequals" 0xAE 1 0 0 0 2 1 1 +OP_greaterthan "greaterthan" 0xAF 1 0 0 0 2 1 1 +OP_greaterequals "greaterequals" 0xB0 1 0 0 0 2 1 1 +OP_instanceof "instanceof" 0xB1 1 0 0 0 2 1 1 +OP_istype "istype" 0xB2 1+2 1 0 0 1 1 1 +OP_istypelate "istypelate" 0xB3 1 0 0 0 2 1 1 +OP_in "in" 0xB4 1 0 0 0 2 1 1 +OP_0xB5 "OP_0xB5" 0xB5 0 -1 0 0 0 0 0 +OP_0xB6 "OP_0xB6" 0xB6 0 -1 0 0 0 0 0 +OP_0xB7 "OP_0xB7" 0xB7 0 -1 0 0 0 0 0 +OP_0xB8 "OP_0xB8" 0xB8 0 -1 0 0 0 0 0 +OP_0xB9 "OP_0xB9" 0xB9 0 -1 0 0 0 0 0 +OP_0xBA "OP_0xBA" 0xBA 0 -1 0 0 0 0 0 +OP_0xBB "OP_0xBB" 0xBB 0 -1 0 0 0 0 0 +OP_0xBC "OP_0xBC" 0xBC 0 -1 0 0 0 0 0 +OP_0xBD "OP_0xBD" 0xBD 0 -1 0 0 0 0 0 +OP_0xBE "OP_0xBE" 0xBE 0 -1 0 0 0 0 0 +OP_0xBF "OP_0xBF" 0xBF 0 -1 0 0 0 0 0 +OP_increment_i "increment_i" 0xC0 1 0 0 0 1 1 1 +OP_decrement_i "decrement_i" 0xC1 1 0 0 0 1 1 1 +OP_inclocal_i "inclocal_i" 0xC2 1+2 1 1 1 0 0 1 +OP_declocal_i "declocal_i" 0xC3 1+2 1 1 1 0 0 1 +OP_negate_i "negate_i" 0xC4 1 0 0 0 1 1 1 +OP_add_i "add_i" 0xC5 1 0 0 0 2 1 1 +OP_subtract_i "subtract_i" 0xC6 1 0 0 0 2 1 1 +OP_multiply_i "multiply_i" 0xC7 1 0 0 0 2 1 1 +OP_0xC8 "OP_0xC8" 0xC8 0 -1 0 0 0 0 0 +OP_0xC9 "OP_0xC9" 0xC9 0 -1 0 0 0 0 0 +OP_0xCA "OP_0xCA" 0xCA 0 -1 0 0 0 0 0 +OP_0xCB "OP_0xCB" 0xCB 0 -1 0 0 0 0 0 +OP_0xCC "OP_0xCC" 0xCC 0 -1 0 0 0 0 0 +OP_0xCD "OP_0xCD" 0xCD 0 -1 0 0 0 0 0 +OP_0xCE "OP_0xCE" 0xCE 0 -1 0 0 0 0 0 +OP_0xCF "OP_0xCF" 0xCF 0 -1 0 0 0 0 0 +OP_getlocal0 "getlocal0" 0xD0 1 0 1 0 0 1 0 +OP_getlocal1 "getlocal1" 0xD1 1 0 1 0 0 1 0 +OP_getlocal2 "getlocal2" 0xD2 1 0 1 0 0 1 0 +OP_getlocal3 "getlocal3" 0xD3 1 0 1 0 0 1 0 +OP_setlocal0 "setlocal0" 0xD4 1 0 0 1 1 0 0 +OP_setlocal1 "setlocal1" 0xD5 1 0 0 1 1 0 0 +OP_setlocal2 "setlocal2" 0xD6 1 0 0 1 1 0 0 +OP_setlocal3 "setlocal3" 0xD7 1 0 0 1 1 0 0 +OP_0xD8 "OP_0xD8" 0xD8 0 -1 0 0 0 0 0 +OP_0xD9 "OP_0xD9" 0xD9 0 -1 0 0 0 0 0 +OP_0xDA "OP_0xDA" 0xDA 0 -1 0 0 0 0 0 +OP_0xDB "OP_0xDB" 0xDB 0 -1 0 0 0 0 0 +OP_0xDC "OP_0xDC" 0xDC 0 -1 0 0 0 0 0 +OP_0xDD "OP_0xDD" 0xDD 0 -1 0 0 0 0 0 +OP_0xDE "OP_0xDE" 0xDE 0 -1 0 0 0 0 0 +OP_0xDF "OP_0xDF" 0xDF 0 -1 0 0 0 0 0 +OP_0xE0 "OP_0xE0" 0xE0 0 -1 0 0 0 0 0 +OP_0xE1 "OP_0xE1" 0xE1 0 -1 0 0 0 0 0 +OP_0xE2 "OP_0xE2" 0xE2 0 -1 0 0 0 0 0 +OP_0xE3 "OP_0xE3" 0xE3 0 -1 0 0 0 0 0 +OP_0xE4 "OP_0xE4" 0xE4 0 -1 0 0 0 0 0 +OP_0xE5 "OP_0xE5" 0xE5 0 -1 0 0 0 0 0 +OP_0xE6 "OP_0xE6" 0xE6 0 -1 0 0 0 0 0 +OP_0xE7 "OP_0xE7" 0xE7 0 -1 0 0 0 0 0 +OP_0xE8 "OP_0xE8" 0xE8 0 -1 0 0 0 0 0 +OP_0xE9 "OP_0xE9" 0xE9 0 -1 0 0 0 0 0 +OP_0xEA "OP_0xEA" 0xEA 0 -1 0 0 0 0 0 +OP_0xEB "OP_0xEB" 0xEB 0 -1 0 0 0 0 0 +OP_0xEC "OP_0xEC" 0xEC 0 -1 0 0 0 0 0 +OP_0xED "OP_0xED" 0xED 0 -1 0 0 0 0 0 +OP_abs_jump "abs_jump" 0xEE 1+2 2 0 0 0 0 0 // vm-use only, not allowed in ABC files. +OP_debug "debug" 0xEF 1+1+2+4 4 0 0 0 0 1 +OP_debugline "debugline" 0xF0 1+3 1 0 0 0 0 1 +OP_debugfile "debugfile" 0xF1 1+2 1 0 0 0 0 1 +OP_bkptline "bkptline" 0xF2 1+3 1 0 0 0 0 0 +OP_timestamp "timestamp" 0xF3 1 0 0 0 0 0 0 +OP_0xF4 "OP_0xF4" 0xF4 0 -1 0 0 0 0 0 +OP_verifypass "verifypass" 0xF5 0 -1 0 0 0 0 0 +OP_alloc "alloc" 0xF6 0 -1 0 0 0 0 0 +OP_mark "mark" 0xF7 0 -1 0 0 0 0 0 +OP_wb "wb" 0xF8 0 -1 0 0 0 0 0 +OP_prologue "prologue" 0xF9 0 -1 0 0 0 0 0 // for dprofile stats only +OP_sendenter "sendenter" 0xFA 0 -1 0 0 0 0 0 // for dprofile stats only +OP_doubletoatom "doubletoatom" 0xFB 0 -1 0 0 0 0 0 // for dprofile stats only +OP_sweep "sweep" 0xFC 0 -1 0 0 0 0 0 // for dprofile stats only +OP_codegenop "codegenop" 0xFD 0 -1 0 0 0 0 0 // for dprofile stats only +OP_verifyop "verifyop" 0xFE 0 -1 0 0 0 0 0 // for dprofile stats only +OP_decode "decode" 0xFF 0 -1 0 0 0 0 0 // for dprofile stats only diff --git a/mozilla/js/tamarin/esc/debugger.as b/mozilla/js/tamarin/esc/debugger.as new file mode 100644 index 00000000000..10b6eab7e68 --- /dev/null +++ b/mozilla/js/tamarin/esc/debugger.as @@ -0,0 +1,137 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +package +{ + public namespace debug + public namespace release + public namespace log + + public class Debug { + + static function dumpArgs(args) + { + var str = "" + for each ( var arg in args ) + if( arg is XML || arg is XMLList ) + { + str += arg.toXMLString() + } + else + { + str += arg + } + return str + } + + static function makeString(val) + { + if( val is XML || val is XMLList ) + { + return val.toXMLString() + } + else + if( val == void 0 ) + { + "undefined" + } + + return val.toString() + } + + debug static function rule(lhs,rhs) + { + rhs = (rhs===null)?"null":(rhs===undefined)?"undefined":rhs + print(lhs+" := "+rhs.toXMLString()) + } + debug static function enter(str,...args) + { + print("-> "+str+" "+dumpArgs(args)) + } + debug static function exit(str,...args) + { + print("<- "+str+" "+dumpArgs(args)) + } + + debug static function log(str:String,log:Array=null) + { + if( log === null ) + { + print(str) + } + else + { + log.push(str) + } + } + + debug static function dump(log:Array) + { + for each( var item in log ) + { + if( item is Array ) + { + debug::dump(item) + } + else + { + print(item) + } + } + } + debug static function trace(...args) + { + print(dumpArgs(args)) + } + + + + release static function rule(lhs,rhs) + { + } + release static function enter(str,...args) + { + } + release static function exit(str,...args) + { + } + release static function dump(log) + { + } + release static function log(str,log=null) + { + } + release static function trace(...args) + { + } + } +} + diff --git a/mozilla/js/tamarin/esc/definer.as b/mozilla/js/tamarin/esc/definer.as new file mode 100644 index 00000000000..7cdcdf99576 --- /dev/null +++ b/mozilla/js/tamarin/esc/definer.as @@ -0,0 +1,991 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + + +package es4 +{ + use namespace release + + // helper functions + + /* + + Resolve a Get node. Only Get early early can be resolved during + the definition phase. + + Get + GetLex early early ; x, p.q.x, q::x where q is known + GetObj early early ; A.x where A is known + + Steps: + 1/match name + 2/match qualifiers + + */ + + function matchOpenNamespaces(node,slots) + { + Debug.enter("matchOpenNamespaces",node.toXMLString(),slots) + + var result = [] + var parent = node + var ident = slots[0].Name.QualifiedIdentifier.Identifier.@name + do + { + var parent = parent.parent() + if( parent.Prologue != void 0 ) + { + var opennss = parent.Prologue.OpenNamespaces.(@ident.toString() == "*") + if( opennss == void 0 ) + { + continue + } + else + { + for each( var ns in opennss.* ) + { + for each( var slot in slots ) + { + if( slot.Name.QualifiedIdentifier.Qualifier.Namespace == ns ) + { + result.push(slot) + } + } + } + } + + if( result.length == 0 ) + { + continue + } + else + if( result.length == 1 ) + { + break + } + else + { + break + } + } + } + while( parent.name() != "Program" ) + + Debug.exit("matchOpenNamespaces",result) + return result + } + + function getOpenNamespaces(node,ident:String) + { + Debug.enter("getOpenNamespaces",node.toXMLString(),ident) + + var result = [] + var parent = node + do + { + var parent = parent.parent() + if( parent.Prologue != void 0 ) + { + var opennss = parent.Prologue.OpenNamespaces.(@ident.toString() == "*" || @ident.toString() == ident) + if( opennss == void 0 ) + { + continue + } + else + { + for each( var ns in opennss.* ) + { + result.push(ns) + } + } + } + } + while( parent.name() != "Program" ) + + Debug.exit("getOpenNamespaces",result) + return result + } + + /* + + Match qualifier to slots and return the set of matches. + + For each slot in slots, + Add slot to matches if the slot name qualifier + matches the given qualifier + Return matches + + */ + + function matchQualifier(qualifier,slots) + { + Debug.enter("matchQualifier",qualifier.toXMLString(),slots) + + var result = [] + for each( var slot in slots ) + { + if( slot.Name.QualifiedIdentifier.Qualifier.Namespace == qualifier ) + { + result.push(slot) + } + } + + Debug.exit("matchQualifier",result) + return result + } + + var ticket_number : uint = 0 + function get ticket () : uint + { + return ticket_number++ + } + + function getUniqueName(str=void 0) + { + if(str != void 0) + { + var name = str+'$'+ticket + } + else + { + var name = "anonymous$"+ticket + } + return name + } + + + + /* + + Construct slot tables for all environment frames: global, function, class, instance, + with, let, and block constructs. + + A slot looks like this: {name}{type}{value} + + Evaluate const, let const, namespace, type, class and interface definitions that + occur at the top level of a program, package or class body (this includes static + const but not instance const) + + */ + + class Definer + { + function Definer() + { + ticket_number = 0 // reset + } + + function addNamespaceToOpenNamespaces(prologue,ident,namespace) + { + Debug.enter("addNamespaceToOpenNamespaces",prologue,ident,namespace) + + var on = prologue.OpenNamespaces.(@ident == ident) + if( on.length() == 0 ) + { + on = + if( prologue.*.length() == 0 ) // e4x: insertChildBefore should do the right thing + // if the first argument is undefined so we don't + // have to check for that special case + { + prologue.* = on + } + else + { + prologue.insertChildBefore(prologue.*[0],on) + } + prologue.*[0].* += namespace + } + else + for each( var opennss in prologue.OpenNamespaces ) + { + if( opennss.@ident == ident ) + { + opennss.* += namespace + } + } + Debug.exit("addNamespaceToOpenNamespaces",prologue) + } + + function defineImport(node) + { + Debug.enter("defineImport",node.toXMLString()) + + var prologue = node.parent() // Prologue + var ident = node.@def + addNamespaceToOpenNamespaces(prologue,ident,) + + Debug.exit("defineImport",node) + return node + } + + function defineUseNamespace(node) + { + Debug.enter("defineUseNamespace",node) + + var block = node.parent() // Block + var prologue = block.parent().Prologue + var ns = defineGet(node.Get) + if( ns == void 0 ) + { + throw "unknown namespace in use namespace pragma" + } +/* + var on = prologue.OpenNamespaces.(@ident.toString()=="*") + if( on.length() == 0 ) + { + on = + if( prologue.*.length() == 0 ) // e4x: insertChildBefore should do the right thing + // if the first argument is undefined so we don't + // have to check for that special case + { + prologue.* = on + } + else + { + prologue.insertChildBefore(prologue.*[0],on) + } + } + + prologue.*[0].* += ns +*/ + addNamespaceToOpenNamespaces(prologue,"*",ns) + + Debug.exit("defineUseNamespace",node) + return node + } + + function defineProgram(node) + { + Debug.enter("defineProgram",node) + + var hoisted = node.Prologue + definePrologue(node.Prologue,null) + defineBlock(node.Block,hoisted) + + Debug.exit("defineProgram",node) + return node + } + + function hasDefaultConstructor(name,slots) + { + var has_ctor = false + for each ( s in slots ) + { + var slot_name = s.Name.QualifiedIdentifier.Identifier.@name + if( name==slot_name ) + { + has_ctor = true + } + } + + return has_ctor + + } + + function defineClass(node) + { + Debug.enter("defineClass",node) + + // Create a slot for the 'construct' method. Use the instance slots from + // the class Prologue as its slots + + var name = node.ClassName.Identifier.@name + + var static_slots = node.Prologue.Static.* + delete node.Prologue.Static + var instance_slots = node.Prologue.Instance.* + delete node.Prologue.Instance + + if( !hasDefaultConstructor(name,instance_slots) ) + { + instance_slots += + + + + + + + + + + + + + + + + + + + } + + instance_slots += + + + + + + + + + + + + + + + + + + + var iinit_slot = + + + + + + + + + + + + + {instance_slots} + + + + + + + + + + + + + node.Prologue.* += iinit_slot + node.Prologue.* += static_slots + definePrologue(node.Prologue,null) + defineBlock(node.Block,node.Prologue) + + var result = node + + Debug.exit("defineClass",result) + return result + } + + function defineInterface(node) + { + Debug.enter("defineInterface",node) + + definePrologue(node.Prologue,null) + var result = node + + Debug.exit("defineInterface",result) + return result + } + + /* + + Function + + */ + + function getSlot(prologue,slot_name) + { + return prologue.*.(Name.QualifiedIdentifier.Identifier.@name == slot_name) + } + + function defineFunction(node) + { + Debug.enter("defineFunction",node) + + definePrologue(node.Prologue,null) + defineBlock(node.Block,node.Prologue) + + var slot = getSlot(node.Prologue,"arguments") + if( slot.@is_param == "true" ) + { + var has_user_arguments = true + } + else + { + var has_user_arguments = false + } + + if( !has_user_arguments ) + { + node.Prologue.* += + + + + + + + + + + + + + + + + + + + + + node.@has_arguments = true + } + + var result = node + + Debug.exit("defineFunction",result) + return result + } + + function definePrologue(node,hoisted) + { + Debug.enter("definePrologue",node) + + for each( var n in node.* ) + { + if( n.name() == "Import" ) + { + defineImport(n) + } + else + if( n.name() == "UseNamespace" ) + { + defineUseNamespace(n) + } + else + if( n.name() == "Slot" ) + { + defineSlot(n,hoisted) + } + else + if( n.name() == "OpenNamespaces" ) + { + // do nothing + } + else + { + throw "invalid node in Prologue: "+n.name() + } + } + + delete node.Import + delete node.UseNamespace + + Debug.exit("definePrologue",node,hoisted) + return node + } + + function defineBlock(node,hoisted) + { + Debug.enter("defineBlock",node,hoisted) + + for each( var n in node.* ) + { + var name = n.name() + + if( name == "BlockStatement" ) + { + defineBlockStatement(n,hoisted) + } + if( name == "LetStatement" ) + { + defineLetStatement(n,hoisted) + } + else + if( name == "ExpressionStatement" ) + { + defineExpressionStatement(n,hoisted) + } + else + if( name == "Return" ) + { + defineReturnStatement(n,hoisted) + } + } + + Debug.exit("defineBlock",node) + return node + } + + function defineBlockStatement(node,hoisted) + { + Debug.enter("defineBlockStatement",node,hoisted) + + definePrologue(node.Prologue,hoisted) + defineBlock(node.Block,hoisted) + + Debug.exit("defineBlockStatement",node) + } + + function defineLetStatement(node,hoisted) + { + Debug.enter("defineLetStatement",node) + + definePrologue(node.Prologue,hoisted) + if( node.BlockStatement != void 0 ) + { + defineBlockStatement(node.BlockStatement,hoisted) + } + else + { + throw "not implemented" + } + + Debug.exit("defineLetStatement",node) + } + + function defineExpressionStatement(node,hoisted) + { + Debug.enter("ExpressionStatement",node) + + var result = defineExpression(node.*) + + Debug.exit("ExpressionStatement",result) + return result + } + + function defineReturnStatement(node,hoisted) + { + Debug.enter("ReturnStatement",node) + + var result = defineExpression(node.*) + + Debug.exit("ReturnStatement",result) + return result + } + + function defineExpression(node) + { + Debug.enter("Expression",node) + + if( node.Function != void 0 ) + { +// defineFunctionExpression(node.Function,hoisted) + } + else + if( node.LetExpression != void 0 ) + { +// defineLetExpression(node.LetExpression,hoisted) + } + else + if( node.name() == "Get" ) + { + defineGet(node) + } + else + if( node.name() == "Set" ) + { + defineSet(node) + } + else + if( node.name() == "Call" ) + { + defineCall(node) + } + else + if( node.name() == "Delete" ) + { + defineGet(node) // define Delete like we do Get + } + else + { + // ignore + } + + Debug.exit("Expression",node) + } + + /* + + Deal with a slot + + This includes evaluating expressions that must have known values during + the definition phase, hoisting slots that belong to the enclosing + variable object (all but let slots), moving function initialisers into + the block associated with the current prologue, checking for duplicate + definitions and deleting compatible ones and throwing an error for + incompatible ones + + */ + + function defineSlot(slot,hoisted) + { + Debug.enter("defineSlot",slot) + + // Resolve namespace attributes + + var qualifier = defineQualifier(slot.Name.QualifiedIdentifier.Qualifier) + if( qualifier == void 0 ) + { + throw "The value of namespace attribute "+slot.Name.QualifiedIdentifier.Qualifier.Get.Identifier.@name+" is unknown" + } + else + if( qualifier.name() == "Namespace" ) + { + slot.Name.QualifiedIdentifier.Qualifier.* = qualifier // replace old qualifier + } + else + { + throw "invalid namespace attribute " + qualifier + } + + // Resolve the type + + if( slot.Type != void 0 ) + { + var type = defineGet(slot.Type) + // defineGet works on any value with an Identifier as a child +print('type',type) + } + + // Resolve the initialiser + + if( slot.Init != void 0 ) + { + if( slot.Init.Class != void 0 ) + { + slot.Value.* = defineClass(slot.Init.Class) + } + else + if( slot.Init.Interface != void 0 ) + { + slot.Value.* = + slot.Value.* += defineInterface(slot.Init.Interface) + } + else + if( slot.Init.Function != void 0 ) + { + slot.Value.* = defineFunction(slot.Init.Function) + } + else + if( slot.@kind == "type" ) + { + slot.Value.* = slot.Init.* + } + else + if( slot.@kind == "var" ) + { + defineExpression(slot.Init.*) + slot.Value.* = slot.Init.* + } + else + if( slot.@kind == "namespace" ) // todo: move into function + { + if( slot.Init.LiteralString != void 0 ) + { + slot.Value.* = + } + else + if( slot.Init.UniqueNamespaceName != void 0 ) + { + slot.Value.* = + } + else + if( slot.Init.Get != void 0 ) + { + var value = defineGet(slot.Init.Get) + if( value != null ) + { + slot.Value.* = value + } + else + { + throw "unknown namespace name in namespace definition" + } + } + else + { + throw "unknown namespace name in namespace definition" + } + } + if( slot.Value != void 0 ) + { + delete slot.Init // if we have a value then we can nuke the initialiser + } + } + + var prologue + + // Hoist, if necessary. If hoisted == null, then we are processing a slot + // in a immediately nested variable object + + if( hoisted != null && slot.@let != "true" ) + { + if( slot.@kind=="function" && slot.@method != "true" ) + { + slot.@kind = "var" // its really a var + var stmt = {slot.Name.*}{slot.Value.*} + var block = hoisted.parent().Block + if( block.*.length() == 0 ) + { + block.* += stmt + } + else + { + block.insertChildBefore(block.*[0],stmt) + } + delete slot.Value + } + hoisted.* += slot // This line orphans 'slot' and its peers if slot.parent() == hoisted + slot.setLocalName("hoisted") + prologue = hoisted + delete slot.parent().hoisted + } + else + { + prologue = slot.parent() + } + + // Check for duplicates + + var ident = slot.Name.QualifiedIdentifier.Identifier.@name + var qualifier = slot.Name.QualifiedIdentifier.Qualifier.Namespace + var type = slot.Type + var slots = prologue.Slot.(Name.QualifiedIdentifier.Identifier.@name == ident) + if( slots != void 0 ) + { + slots = matchQualifier(qualifier,slots) + if( slots.length == 1 ) + { + // no conflict + } + else + { + for each ( s in slots ) + { + if( !matchType(s.Type,type) ) + { + throw "incompatible override of slot " + ident + } + else + if( s !== slots[0] ) // skip the first slot to avoid false positive + { + s.setLocalName("duplicate") + } + } + delete prologue.duplicate + } + } + + Debug.exit("defineSlot",slot) + return slot + } + + function matchType(t1,t2) // todo: needs to be more robust + { + Debug.enter("matchType",t1.toXMLString(),t2.toXMLString()) + + var result = false + if( t1.Identifier != void 0 || t2.Identifier != void 0 ) + { + result = t1.Identifier.@name == t2.Identifier.@name + } + else + if( t1 == t2 ) + { + result = true + } + + Debug.exit("matchType",result) + return result + } + + function defineQualifier(node) + { + Debug.enter("defineQualifier",node) + + if( node != void 0 && node.Get != void 0 ) + { + var result = defineGet(node.Get) + } + else + if( node != void 0 && node.Namespace != void 0 ) + { + var result = node.Namespace + } + else + { + var result = node + } + + Debug.exit("defineQualifier",result) + return result + } + + /* + + Resolve Get expression + + It is an error to for a Get to resolve to zero or more + than one slot. + + */ + + function defineGet(node) + { + Debug.enter("defineGet",node) + + if( node.QualifiedIdentifier != void 0 ) + { + var qualifier = defineQualifier(node.QualifiedIdentifier.Qualifier) + if( qualifier != void 0 && qualifier.name() == "Namespace" ) // convert to a single multiname + { + node.QualifiedIdentifier = node.QualifiedIdentifier.Identifier + node.Identifier.OpenNamespaces.* = qualifier // replace expression with ct const value + } + var ident = node.QualifiedIdentifier.Identifier.@name + } + else + if( node.Identifier != void 0 ) + { + var ident = node.Identifier.@name + var namespaces = getOpenNamespaces(node,ident) // get open namespaces for this identifier + for each ( var ns in namespaces ) + { + node.Identifier.OpenNamespaces.* += ns + } + } + else + { + throw "defineGet not implemented for " + node.toXMLString() + } + + var parent = node + var result + + if( node.@kind.toString() == "dot" ) + { + defineExpression(node.*[0]) // don't worry about the result at this time + } + else + do + { + var parent = parent.parent() + if( parent.Prologue != void 0 ) + { + var slots = parent.Prologue.Slot.(Name.QualifiedIdentifier.Identifier.@name == ident) +//print("prologue",parent.Prologue) +//print("found",parent.name(),ident,slots.length()) + if( slots == void 0 ) + { + continue + } + + if( qualifier != void 0 ) + { + slots = matchQualifier(qualifier,slots) + } + else + { + slots = matchOpenNamespaces(node,slots) + } + + if( slots.length == 0 ) + { + continue + } + else + if( slots.length == 1 ) + { + result = slots[0].Value.* + break + } + else + { + throw "ambiguous reference to " + ident + } + } + } + while( parent.name() != "Program" ) + + Debug.exit("defineGet",result) + return result + } + + function defineSet(node) + { + Debug.enter("defineSet",node.toXMLString()) + + var result = defineGet(node) + defineTo(node.To) + + Debug.exit("defineSet") + return result + } + + function defineCall(node) + { + Debug.enter("defineCall",node.toXMLString()) + + var result = defineGet(node) + defineArgs(node.Args) + + Debug.exit("defineCall") + return result + } + + function defineTo(node) + { + Debug.enter("To",node) + + defineExpression(node.*[0]) + var result = node + + Debug.exit("To") + return result + } + + function defineArgs(node) + { + Debug.enter("Args",node) + + for each( var item in node.To ) + { + defineTo(item) // for now args are to expressions + } + var result = node + + Debug.exit("Args") + return result + } + + } +} diff --git a/mozilla/js/tamarin/esc/emitter.as b/mozilla/js/tamarin/esc/emitter.as new file mode 100644 index 00000000000..c0a9e40a856 --- /dev/null +++ b/mozilla/js/tamarin/esc/emitter.as @@ -0,0 +1,1489 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +package es4 +{ + use namespace release + + /* + + Emit an ABC file + + */ + + import flash.utils.ByteArray + + class ByteCodeFactory + { + function ByteCodeFactory() + { + } + + function makeByte(bytes,val:int) + { + Debug.enter("makeByte",val) + bytes.writeByte(val) + Debug.exit("makeByte") + } + + function makeInt16(bytes,val:int) + { + Debug.enter("makeShort",val) + var first = val & 0xFF + var second = val >> 8 + bytes.writeByte(first) + bytes.writeByte(second) + Debug.exit("makeShort") + } + + function makeInt32(bytes,val:int) + { + Debug.enter("makeInt32",val) + + if( val < 128 ) + { + bytes.writeByte(val&0x7F) + } + else if ( val < 16384 ) + { + var first : int = val&0x7F | 0x80 + var second : int = val >> 7 + bytes.writeByte(first) + bytes.writeByte(second) + } + else if ( val < 2097152 ) + { + var first : int = val&0x7F | 0x80 + var second : int = val >> 7 | 0x80 + var third : int = val >> 14 + bytes.writeByte(first) + bytes.writeByte(second) + bytes.writeByte(third) + } + else if ( val < 268435456 ) + { + var first : int = val&0x7F | 0x80 + var second : int = val >> 7 | 0x80 + var third : int = val >> 14 | 0x80 + var fourth : int = val >> 21 + bytes.writeByte(first) + bytes.writeByte(second) + bytes.writeByte(third) + bytes.writeByte(fourth) + } + else + { + var first : int = val&0x7F | 0x80 + var second : int = val >> 7 | 0x80 + var third : int = val >> 14 | 0x80 + var fourth : int = val >> 21 | 0x80 + var fifth : int = val >> 28 + bytes.writeByte(first) + bytes.writeByte(second) + bytes.writeByte(third) + bytes.writeByte(fourth) + bytes.writeByte(fifth) + } + Debug.exit("makeInt32") + } + + function makeDouble(bytes,val) + { + bytes.writeDouble(val) + } + + function makeBytes(bytes,from) + { + Debug.enter("makeBytes length",from.length) + makeInt32(bytes,from.length) + bytes.writeBytes(from) + Debug.exit("makeBytes") + } + } + + public function testByteCodeFactory() + { + var bytes = new ByteArray + var bcf = new ByteCodeFactory + bcf.makeByte(bytes,10) + bcf.makeInt32(bytes,10) + bcf.makeInt32(bytes,0x0fffabcd) + bytes.position = 0 + while ( bytes.bytesAvailable > 0 ) + { + print(bytes.position+": "+bytes.readByte()) + } + } + + class ABCEmitter extends ByteCodeFactory + { + private const CONSTANT_Utf8 = 0x01 + private const CONSTANT_Integer = 0x03 + private const CONSTANT_UInt = 0x04 + private const CONSTANT_PrivateNamespace = 0x05 + private const CONSTANT_Double = 0x06 + private const CONSTANT_Qname = 0x07 // ns::name, const ns, const name + private const CONSTANT_Namespace = 0x08 + private const CONSTANT_Multiname = 0x09 // [ns...]::name, const [ns...], const name + private const CONSTANT_False = 0x0A + private const CONSTANT_True = 0x0B + private const CONSTANT_Null = 0x0C + private const CONSTANT_QnameA = 0x0D // @ns::name, const ns, const name + private const CONSTANT_MultinameA = 0x0E // @[ns...]::name, const [ns...], const name + private const CONSTANT_RTQname = 0x0F // ns::name, var ns, const name + private const CONSTANT_RTQnameA = 0x10 // @ns::name, var ns, const name + private const CONSTANT_RTQnameL = 0x11 // ns::[name], var ns, var name + private const CONSTANT_RTQnameLA = 0x12 // @ns::[name], var ns, var name + private const CONSTANT_NameL = 0x13 // o[name], var name + private const CONSTANT_NameLA = 0x14 // @[name], var name + private const CONSTANT_NamespaceSet = 0x15 + private const CONSTANT_PackageNamespace = 0x16 // namespace for a package + private const CONSTANT_PackageInternalNS = 0x17 + private const CONSTANT_ProtectedNamespace = 0x18 + private const CONSTANT_ExplicitNamespace = 0x19 + private const CONSTANT_StaticProtectedNS = 0x1A + private const CONSTANT_MultinameL = 0x1B + private const CONSTANT_MultinameLA = 0x1C + + private const SLOT_var = 0 + private const SLOT_method = 1 + private const SLOT_getter = 2 + private const SLOT_setter = 3 + private const SLOT_class = 4 + private const SLOT_function = 6 + + // Method flags + + private const METHOD_Arguments = 0x1; + private const METHOD_Activation = 0x2; + private const METHOD_Needrest = 0x4; + private const METHOD_HasOptional = 0x8; + private const METHOD_IgnoreRest = 0x10; + private const METHOD_Native = 0x20; + private const METHOD_Setsdxns = 0x40; + private const METHOD_HasParamNames = 0x80; + + private const OP_bkpt = 0x01 + private const OP_nop = 0x02 + private const OP_throw = 0x03 + private const OP_getsuper = 0x04 + private const OP_setsuper = 0x05 + private const OP_dxns = 0x06 + private const OP_dxnslate = 0x07 + private const OP_kill = 0x08 + private const OP_label = 0x09 + private const OP_ifnlt = 0x0C + private const OP_ifnle = 0x0D + private const OP_ifngt = 0x0E + private const OP_ifnge = 0x0F + private const OP_jump = 0x10 + private const OP_iftrue = 0x11 + private const OP_iffalse = 0x12 + private const OP_ifeq = 0x13 + private const OP_ifne = 0x14 + private const OP_iflt = 0x15 + private const OP_ifle = 0x16 + private const OP_ifgt = 0x17 + private const OP_ifge = 0x18 + private const OP_ifstricteq = 0x19 + private const OP_ifstrictne = 0x1A + private const OP_lookupswitch = 0x1B + private const OP_pushwith = 0x1C + private const OP_popscope = 0x1D + private const OP_nextname = 0x1E + private const OP_hasnext = 0x1F + private const OP_pushnull = 0x20 + private const OP_pushundefined = 0x21 + private const OP_nextvalue = 0x23 + private const OP_pushbyte = 0x24 + private const OP_pushshort = 0x25 + private const OP_pushtrue = 0x26 + private const OP_pushfalse = 0x27 + private const OP_pushnan = 0x28 + private const OP_pop = 0x29 + private const OP_dup = 0x2A + private const OP_swap = 0x2B + private const OP_pushstring = 0x2C + private const OP_pushint = 0x2D + private const OP_pushuint = 0x2E + private const OP_pushdouble = 0x2F + private const OP_pushscope = 0x30 + private const OP_pushnamespace = 0x31 + private const OP_newfunction = 0x40 + private const OP_call = 0x41 + private const OP_construct = 0x42 + private const OP_callmethod = 0x43 + private const OP_callstatic = 0x44 + private const OP_callsuper = 0x45 + private const OP_callproperty = 0x46 + private const OP_returnvoid = 0x47 + private const OP_returnvalue = 0x48 + private const OP_constructsuper = 0x49 + private const OP_constructproperty = 0x4A + private const OP_callsuperid = 0x4B + private const OP_callproplex = 0x4C + private const OP_callinterface = 0x4D + private const OP_callsupervoid = 0x4E + private const OP_callpropvoid = 0x4F + private const OP_newobject = 0x55 + private const OP_newarray = 0x56 + private const OP_newactivation = 0x57 + private const OP_newclass = 0x58 + private const OP_getdescendants = 0x59 + private const OP_findpropstrict = 0x5D + private const OP_findproperty = 0x5E + private const OP_finddef = 0x5F + private const OP_getlex = 0x60 + private const OP_setproperty = 0x61 + private const OP_getlocal = 0x62 + private const OP_setlocal = 0x63 + private const OP_getglobalscope = 0x64 + private const OP_getscopeobject = 0x65 + private const OP_getproperty = 0x66 + private const OP_getpropertylate = 0x67 + private const OP_initproperty = 0x68 + private const OP_deleteproperty = 0x6A + private const OP_deletepropertylate = 0x6B + private const OP_getslot = 0x6C + private const OP_setslot = 0x6D + private const OP_getglobalslot = 0x6E + private const OP_setglobalslot = 0x6F + private const OP_convert_s = 0x70 + private const OP_esc_xelem = 0x71 + private const OP_esc_xattr = 0x72 + private const OP_convert_i = 0x73 + private const OP_convert_u = 0x74 + private const OP_convert_d = 0x75 + private const OP_convert_b = 0x76 + private const OP_convert_o = 0x77 + private const OP_coerce = 0x80 + private const OP_coerce_b = 0x81 + private const OP_coerce_a = 0x82 + private const OP_coerce_i = 0x83 + private const OP_coerce_d = 0x84 + private const OP_coerce_s = 0x85 + private const OP_astype = 0x86 + private const OP_astypelate = 0x87 + private const OP_coerce_u = 0x88 + private const OP_coerce_o = 0x89 + private const OP_negate = 0x90 + private const OP_increment = 0x91 + private const OP_inclocal = 0x92 + private const OP_decrement = 0x93 + private const OP_declocal = 0x94 + private const OP_typeof = 0x95 + private const OP_not = 0x96 + private const OP_bitnot = 0x97 + private const OP_concat = 0x9A + private const OP_add_d = 0x9B + private const OP_add = 0xA0 + private const OP_subtract = 0xA1 + private const OP_multiply = 0xA2 + private const OP_divide = 0xA3 + private const OP_modulo = 0xA4 + private const OP_lshift = 0xA5 + private const OP_rshift = 0xA6 + private const OP_urshift = 0xA7 + private const OP_bitand = 0xA8 + private const OP_bitor = 0xA9 + private const OP_bitxor = 0xAA + private const OP_equals = 0xAB + private const OP_strictequals = 0xAC + private const OP_lessthan = 0xAD + private const OP_lessequals = 0xAE + private const OP_greaterthan = 0xAF + private const OP_greaterequals = 0xB0 + private const OP_instanceof = 0xB1 + private const OP_istype = 0xB2 + private const OP_istypelate = 0xB3 + private const OP_in = 0xB4 + private const OP_increment_i = 0xC0 + private const OP_decrement_i = 0xC1 + private const OP_inclocal_i = 0xC2 + private const OP_declocal_i = 0xC3 + private const OP_negate_i = 0xC4 + private const OP_add_i = 0xC5 + private const OP_subtract_i = 0xC6 + private const OP_multiply_i = 0xC7 + private const OP_getlocal0 = 0xD0 + private const OP_getlocal1 = 0xD1 + private const OP_getlocal2 = 0xD2 + private const OP_getlocal3 = 0xD3 + private const OP_setlocal0 = 0xD4 + private const OP_setlocal1 = 0xD5 + private const OP_setlocal2 = 0xD6 + private const OP_setlocal3 = 0xD7 + private const OP_abs_jump = 0xEE + private const OP_debug = 0xEF + private const OP_debugline = 0xF0 + private const OP_debugfile = 0xF1 + private const OP_bkptline = 0xF2 + private const OP_timestamp = 0xF3 + private const OP_verifypass = 0xF5 + private const OP_alloc = 0xF6 + private const OP_mark = 0xF7 + private const OP_wb = 0xF8 + private const OP_prologue = 0xF9 + private const OP_sendenter = 0xFA + private const OP_doubletoatom = 0xFB + private const OP_sweep = 0xFC + private const OP_codegenop = 0xFD + private const OP_verifyop = 0xFE + private const OP_decode = 0xFF + + // ABC parts + + private var minor_version = 16 + private var major_version = 46 + private var int_pool = new Array + private var uint_pool = new Array + private var double_pool = new Array + private var utf8_pool = new Array + private var namespace_pool = new Array + private var namespaceset_pool = new Array + private var multiname_pool = new Array + private var method_infos = new Array + private var metadata_infos = new Array + private var instance_infos = new Array + private var class_infos = new Array + private var script_infos = new Array + private var method_bodys = new Array + + function methodCount() + { + return method_infos.length + } + + function ABCEmitter(minor=16,major=46) + { + if( major != 46 ) + { + throw "major version " + major + " not supported!" + } + this.minor_version = minor + this.major_version = major + } + + function compareByteArrays(ba1:ByteArray,ba2:ByteArray) + { + if( ba1.length != ba2.length ) return false + + for( var i = ba1.length; i>=0; i-- ) + { + if( ba1[i] != ba2[i] ) return false + } + return true + } + + function addBytesToPool(bytes,pool) + { + var count = pool.length + for( var i = 0; i "+index,utf8_pool_out) + return index + } + + function ConstantDouble(num:Number) // **design: anno needed to force conversion to string + { + Debug.enter("ConstantDouble",num) + + var bytes = new ByteArray + makeDouble(bytes,num) + var index = addBytesToPool(bytes,double_pool) + + Debug.exit("ConstantDouble",index) + Debug.log_mode::log("ConstantDouble "+num+" -> "+index,double_pool_out) + return index + } + + function ConstantInt(i:int) // **design: anno needed to force conversion to string + { + Debug.enter("ConstantInt",i) + + var bytes = new ByteArray + makeInt32(bytes,i) + var index = addBytesToPool(bytes,int_pool) + + Debug.exit("ConstantInt",index) + Debug.log_mode::log("ConstantInt "+i+" -> "+index,int_pool_out) + return index + } + + function ConstantNamespace(uri_index:uint,kind) + { + var kind_str = kind==CONSTANT_PackageNamespace ? "public" : // package public + kind==CONSTANT_PackageInternalNS ? "internal" : // package internal + kind==CONSTANT_ProtectedNamespace ? "protected" : + kind==CONSTANT_StaticProtectedNS ? "static protected" : + kind==CONSTANT_Namespace ? "user" : + kind==CONSTANT_PrivateNamespace ? "private" : "**error**" + + + Debug.enter("ConstantNamespace",uri_index,kind_str) + var bytes = new ByteArray + makeByte(bytes,kind) + makeInt32(bytes,uri_index) + var index = addBytesToPool(bytes,namespace_pool) + Debug.exit("ConstantNamespace",index) + Debug.log_mode::log("ConstantNamespace "+uri_index+" "+kind_str+" -> "+index,namespace_pool_out) + return index + } + + function ConstantNamespaceSet(namespaces) + { + var bytes = new ByteArray + var count = namespaces.length + + makeInt32(bytes,count) + var nsset_out = " " + for( var i = 0; i < count; i++ ) + { + var name = namespaces[i].@name + var kind = namespaces[i].@kind=="internal"?CONSTANT_PackageInternalNS: + "public"?CONSTANT_PackageNamespace: + CONSTANT_Namespace + var utf8_index = ConstantUtf8(name) + var ns_index = ConstantNamespace(utf8_index,kind) + nsset_out += ns_index + " " + makeInt32(bytes,ns_index) + } + var index = addBytesToPool(bytes,namespaceset_pool) + Debug.log_mode::log("ConstantNamespaceSet ["+nsset_out+"] -> "+index,namespaceset_pool_out) + return index + } + + function ConstantMultiname(name_index,nsset_index,is_attr) + { + var bytes = new ByteArray + makeByte(bytes,is_attr?CONSTANT_MultinameA:CONSTANT_Multiname) + makeInt32(bytes,name_index) + makeInt32(bytes,nsset_index) + var index = addBytesToPool(bytes,multiname_pool) + Debug.log_mode::log("ConstantMultiname "+name_index+" "+nsset_index+" -> "+index,multiname_pool_out) + return index + } + + function ConstantQualifiedName(name_index,ns_index,is_attr) + { + var bytes = new ByteArray + makeByte(bytes,is_attr?CONSTANT_QnameA:CONSTANT_Qname) + makeInt32(bytes,ns_index) + makeInt32(bytes,name_index) + var index = addBytesToPool(bytes,multiname_pool) + Debug.log_mode::log("ConstantQualifiedName "+name_index+" "+ns_index+" "+is_attr+" -> "+index,multiname_pool_out) + return index + } + + /* + + MethodInfo { + U30 param_count + U30 ret_type // CONSTANT_Multiname, 0=Object + U30 param_types[param_count] // CONSTANT_Multiname, 0=Object + U30 name_index // 0=no name. + // 1=need_arguments, 2=need_activation, 4=need_rest 8=has_optional 16=ignore_rest, 32=explicit, 64=setsdxns, 128=has_paramnames + U8 flags + U30 optional_count // if has_optional + ValueKind[optional_count] // if has_optional + U30 param_names[param_count] // if has_paramnames + } + + */ + + function MethodInfo(param_count,type,types,name_index,flags,optional_count,optional_kinds) + { + Debug.enter("MethodInfo",param_count,type,name_index,flags,optional_count,optional_kinds) + + var method_info = method_infos.length //getMethodInfo(name) + var bytes = new ByteArray + + makeInt32(bytes,param_count); + makeInt32(bytes,type); + for (var i=0; i < param_count; i++) + { + makeInt32(bytes,0/*types[i]*/); + } + makeInt32(bytes,name_index); + makeByte(bytes,flags); + if( false /*flags & HAS_OPTIONAL*/ ) + { + makeInt32(bytes,optional_count); + for (var i=0; i < optional_count; i++) + { + makeInt32(bytes,optional_kinds[i]); + } + } +// MethodInfo param_count=1 return_type=0 param_types={ 0 } debug_name_index=2 needs_arguments=false need_rest=false needs_activation=true has_optional=false ignore_rest=false native=false has_param_names =false -> 0 + Debug.log_mode::log("MethodInfo param_count="+param_count+" return_type="+type+" param_types={"+types+"} debug_name="+name_index+" flags="+flags+" "+optional_count+" "+optional_kinds+" -> "+method_info,info_out) + + method_infos.push(bytes) + Debug.exit("MethodInfo") + return method_info + } + + function dumpBytes(bytes) + { + bytes.position = 0 + var str = "" + while( bytes.bytesAvailable ) { str += " "+bytes.readByte() } + print(str) + } + + function MethodBody(info_index,max_stack,max_locals,scope_depth,max_scope,code,exceptions,slot_infos) + { + Debug.enter("MethodBody",info_index,max_stack,max_locals,scope_depth,max_scope) + var bytes = new ByteArray + + makeInt32(bytes,info_index) + makeInt32(bytes,max_stack) + makeInt32(bytes,max_locals) + makeInt32(bytes,scope_depth) + makeInt32(bytes,max_scope) + makeBytes(bytes,code) + makeBytes(bytes,exceptions) + emitInfos(bytes,slot_infos) + + method_bodys.push(bytes) + + Debug.log_mode::log("MethodBody "+info_index+" max_stack="+max_stack+" max_locals="+max_locals+" scope_depth="+scope_depth+" max_scope="+max_scope+" code_length="+code.length+" slot_count="+slot_infos.length+" code_size="+bytes.length,body_out) + Debug.exit("MethodBody") + return method_bodys.length + } + + function ScriptInfo(init_index,slot_infos) + { + Debug.log_mode::log("ScriptInfo init_index="+init_index+" slots="+slot_infos.length,info_out) + var bytes = new ByteArray + + makeInt32(bytes,init_index) + emitInfos(bytes,slot_infos) + + script_infos.push(bytes) + return script_infos.length + } + + // Emitter methods + + function emitVersion(bytes,minor,major) + { + Debug.enter("emitVersion",minor,major) + makeInt16(bytes,minor) + makeInt16(bytes,major) + Debug.exit("emitVersion",bytes.length) + } + + function emitConstantPool(bytes,pool) + { + Debug.enter("emitConstantPool",bytes.length,pool.length) + var count = pool.length + makeInt32(bytes,count==0?0:count+1) + for( var i = 0; i < count; ++i ) + { + bytes.writeBytes(pool[i]) + } + Debug.exit("emitConstantPool",bytes.length) + } + + function emitInfos(bytes,infos) + { + Debug.enter("emitInfos",infos.length) + var count = infos.length + makeInt32(bytes,count) + for( var i = 0; i < count; ++i ) + { + bytes.writeBytes(infos[i]) + } + Debug.exit("emitInfos",bytes.length) + } + + function emitClassInfos(bytes,instance_infos,class_infos) + { + Debug.enter("emitClassInfos") + var count = instance_infos.length + makeInt32(bytes,count) + for( var i = 0; i < count; ++i ) + { + bytes.writeBytes(instance_infos[i]) + } + for( var i = 0; i < count; ++i ) + { + bytes.writeBytes(class_infos[i]) + } + Debug.exit("emitClassInfos",bytes.length) + } + + public function emit() + { + Debug.enter("emit") + + var bytes = new ByteArray + + emitVersion(bytes,minor_version,major_version) + emitConstantPool(bytes,int_pool) + emitConstantPool(bytes,uint_pool) + emitConstantPool(bytes,double_pool) + emitConstantPool(bytes,utf8_pool) + emitConstantPool(bytes,namespace_pool) + emitConstantPool(bytes,namespaceset_pool) + emitConstantPool(bytes,multiname_pool) + emitInfos(bytes,method_infos) + emitInfos(bytes,metadata_infos) + emitClassInfos(bytes,instance_infos,class_infos) + emitInfos(bytes,script_infos) + emitInfos(bytes,method_bodys) + + Debug.log_mode::dump(int_pool_out) + Debug.log_mode::dump(uint_pool_out) + Debug.log_mode::dump(double_pool_out) + Debug.log_mode::dump(utf8_pool_out) + Debug.log_mode::dump(namespace_pool_out) + Debug.log_mode::dump(namespaceset_pool_out) + Debug.log_mode::dump(multiname_pool_out) + Debug.log_mode::dump(info_logs) + Debug.log_mode::dump(body_out) + Debug.log_mode::dump(code_logs) + + Debug.exit("emit",bytes.length) + + return bytes + } + + var code + var code_blocks = [] + var code_logs = ["-------","C O D E","-------"] + var info_logs = ["---------","I N F O S","---------"] + var pending_code_logs = [] + var pending_info_logs = [] + var initial_scope_depth_stack = [] + + function StartMethod(name) + { + Debug.enter("StartMethod") + + this.pending_code_logs.push(code_out) // save current code log + this.code_out = [] // and start a new one + this.pending_info_logs.push(info_out) // save current info log + this.info_out = [] // and start a new one + + Debug.log_mode::log("StartMethod "+name,code_out) + + this.code_blocks.push(code) // save the current code block + this.code = new ByteArray // create a new one + initial_scope_depth_stack.push(scope_depth) + + Debug.exit("StartMethod") + } + + function FinishMethod(name,slot_infos,has_arguments,param_count,max_locals) + { + Debug.enter("FinishMethod",name) + Debug.log_mode::log("FinishMethod "+name,code_out) + + var type_index = 0 + var types = new Array + var name_index = ConstantUtf8(name) + var flags = METHOD_Activation + if( has_arguments ) + { + flags |= METHOD_Arguments + param_count-- + } + var optional_count = 0 + var optional_kinds = new Array + + var info_index = MethodInfo(param_count,type_index,types,name_index,flags,optional_count,optional_kinds) + + var max_stack = 10 // todo: compute these + var exceptions = new ByteArray + var initial_scope_depth = initial_scope_depth_stack.pop() + + MethodBody(info_index,max_stack,max_locals,initial_scope_depth,max_scope_depth,this.code,exceptions,slot_infos) + + this.code = this.code_blocks.pop() // restore the previously active code block + + this.code_logs.push(this.code_out) // save the finish code log + this.code_out = this.pending_code_logs.pop() // resume the outer code log, pushing inner one deeper + this.info_logs.push(this.info_out) + this.info_out = this.pending_info_logs.pop() + + scope_depth = initial_scope_depth + + Debug.exit("FinishMethod",info_index) + return info_index + } + + /* + + Common interning patterns + + */ + + function internTypeName(name,namespace) + { + if( name == null || name == "*" ) + { + return 0 + } + else + { + return internQualifiedName(name,namespace) + } + } + + function internQualifiedName(name,namespace) + { + var identifier_index = ConstantUtf8(name) + var namespace_index = ConstantNamespace(ConstantUtf8(namespace.@name),getNamespaceKind(namespace.@kind)) + var name_index = ConstantQualifiedName(identifier_index,namespace_index,false) // is_attr = false + return name_index + } + + function getNamespaceKind(kind_str : String) + { + var result = + kind_str == "internal" ? CONSTANT_PackageInternalNS : + kind_str == "public" ? CONSTANT_PackageNamespace : + kind_str == "user" ? CONSTANT_Namespace : + kind_str == "private" ? CONSTANT_PrivateNamespace : CONSTANT_Namespace + return result + } + + function SlotInfo(slot_infos,kind,slot_name,type_name,slot_id) + { + Debug.enter("SlotInfo",slot_name.name,kind,slot_name.namespace) + + var info_index = slot_infos.length //getMethodInfo(name) + var bytes = new ByteArray + + var name_index = internQualifiedName(slot_name.name,slot_name.namespace) + //var type_index = internTypeName( + + var kind_str = kind==SLOT_var?"var": + kind==SLOT_function?"function": + "unimplemented slot kind" + Debug.log_mode::log("SlotInfo "+kind_str+" "+slot_name.name+" {"+dumpNamespaces([slot_name.namespace])+"} "+slot_id,info_out) + + + makeInt32(bytes,name_index) + makeByte(bytes,kind) + + switch( kind ) + { + case SLOT_var: + makeInt32(bytes,slot_id) // 0 = autoassign + makeInt32(bytes,0) // type * + makeInt32(bytes,0) // no default value + break + case SLOT_method: + case SLOT_getter: + case SLOT_setter: + case SLOT_class: + case SLOT_function: + throw "slot kind not implemented" + break + } + + slot_infos.push(bytes) + + Debug.exit("SlotInfo") + return info_index + } + + function StartClass() + { + } + + function FinishClass() + { + } + + function StartProgram() + { + this.pending_info_logs.push(info_out) // save current code log + this.info_out = [] // and start a new one + + Debug.log_mode::log("StartProgram",code_out) + } + + function FinishProgram(init_index,slot_infos) + { + Debug.enter("FinishProgram",init_index) + Debug.log_mode::log("FinishProgram",code_out) + + ScriptInfo(init_index,slot_infos) + + this.info_logs.push(this.info_out) + this.info_out = this.pending_info_logs.pop() + + Debug.exit("FinishProgram") + } + + // Abstract machine methods + + public function LoadThis() + { + Debug.log_mode::log(" "+code.length+":LoadThis",code_out) + makeByte(code,OP_getlocal0) + } + + public function Pop() + { + Debug.log_mode::log(" "+code.length+":Pop",code_out) + makeByte(code,OP_pop) + } + + public function PushNull() + { + Debug.log_mode::log(" "+code.length+":PushNull",code_out) + makeByte(code,OP_pushnull) + } + + public function PushUndefined() + { + Debug.log_mode::log(" "+code.length+":PushUndefined",code_out) + makeByte(code,OP_pushundefined) + } + + public function PushString(str) + { + Debug.log_mode::log(" "+code.length+":PushString "+str,code_out) + var index = ConstantUtf8(str) + makeByte(code,OP_pushstring) + makeInt32(code,index) + } + + public function PushNumber(num:Number) + { + Debug.log_mode::log(" "+code.length+":PushNumber "+num,code_out) + var index = ConstantDouble(num) + makeByte(code,OP_pushdouble) + makeInt32(code,index) + } + + public function PushInt(num:int) + { + Debug.log_mode::log(" "+code.length+":PushInt "+num,code_out) + var index = ConstantInt(num) + makeByte(code,OP_pushint) + makeInt32(code,index) + } + + var scope_depth = 1 + var max_scope_depth = 1 + + public function PushScope() + { + Debug.log_mode::log(" "+code.length+":PushScope",code_out) + makeByte(code,OP_pushscope) + scope_depth++ + if( scope_depth > max_scope_depth ) + { + max_scope_depth = scope_depth + } + } + + public function PopScope() + { + Debug.log_mode::log(" "+code.length+":PopScope",code_out) + makeByte(code,OP_popscope) + scope_depth-- + } + + public function Dup() + { + Debug.log_mode::log(" "+code.length+":Dup",code_out) + makeByte(code,OP_dup) + } + + public function dumpNamespaces(nsset) + { + Debug.enter("dumpNamespaces",nsset.length) + + var result = "" + if( nsset != void ) + for each( var ns in nsset ) + { + if( result != "" ) + { + result += "," + } + result += ns.@kind +':"'+ns.@name+'"' + } + + Debug.exit("dumpNamespaces",result) + + return result + } + + public function FindProperty(name,namespaces,is_qualified,is_attr,is_strict) + { + Debug.enter("FindProperty",name,namespaces,is_strict,is_qualified,is_attr) + Debug.log_mode::log(" "+code.length+":FindProperty "+name+" {"+dumpNamespaces(namespaces)+"} is_qualified="+is_qualified+" is_strict="+is_strict,code_out) + + var index,name_index,ns_index + + if( name == "*" ) + { + name_index = 0 + } + else + { + name_index = ConstantUtf8(name) + } + + if( is_qualified && namespaces.length == 1 ) + { + var ns_name = namespaces[0].@name + var ns_kind = namespaces[0].@kind=="internal"?CONSTANT_PackageInternalNS:CONSTANT_Namespace + var ns_utf8_index = ConstantUtf8(ns_name) + var ns_index = ConstantNamespace(ns_utf8_index,ns_kind) + index = ConstantQualifiedName(name_index,ns_index,is_attr) + } + else + { + ns_index = ConstantNamespaceSet(namespaces) + index = ConstantMultiname(name_index,ns_index,is_attr) + } + + if( is_strict ) + { + makeByte(code,OP_findpropstrict); + makeInt32(code,index); + } + else + { + makeByte(code,OP_findproperty); + makeInt32(code,index); + } + Debug.exit("FindProperty") + } + + public function CallProperty(name,namespaces,size,is_qualified,is_super,is_attr,is_lex,is_new) + { + Debug.enter("CallProperty",name,dumpNamespaces(namespaces),size,is_qualified,is_super,is_attr,is_lex,is_new) + Debug.log_mode::log(" "+code.length+":CallProperty "+name+" {"+dumpNamespaces(namespaces)+"} arg_count="+size+" is_new="+is_new,code_out) + + var index,name_index,ns_index + + if( name == "*" ) + { + name_index = null + } + else + { + name_index = ConstantUtf8(name) + } + + if( is_qualified && namespaces.length == 1 ) + { + var ns_name = namespaces[0].@name + var ns_kind = namespaces[0].@kind=="public"?CONSTANT_PackageNamespace:CONSTANT_PackageInternalNS + var ns_utf8_index = ConstantUtf8(ns_name) + var ns_index = ConstantNamespace(ns_utf8_index,ns_kind) + index = ConstantQualifiedName(name_index,ns_index,is_attr) + } + else + { + ns_index = ConstantNamespaceSet(namespaces) + index = ConstantMultiname(name_index,ns_index,is_attr) + } + + if( is_super ) + { + makeByte(code,OP_callsuper); + makeInt32(code,index); + makeInt32(code,size); + } + else + if( is_lex ) + { + makeByte(code,OP_callproplex); + makeInt32(code,index); + makeInt32(code,size); + } + else + if( is_new ) + { + makeByte(code,OP_constructproperty); + makeInt32(code,index); + makeInt32(code,size); + } + else + { + makeByte(code,OP_callproperty); + makeInt32(code,index); + makeInt32(code,size); + } + } + + public function SetProperty(name,namespaces,is_qualified,is_super,is_attr,is_constinit) + { + Debug.enter("SetProperty",name,namespaces,is_qualified,is_super,is_attr,is_constinit) + Debug.log_mode::log(" "+code.length+":SetProperty "+name+" {"+dumpNamespaces(namespaces)+"} is_qualified="+is_qualified,code_out) + + var index,name_index,ns_index + + if( name == "*" ) + { + name_index = 0 + } + else + { + name_index = ConstantUtf8(name) + } + + if( is_qualified && namespaces.length == 1 ) + { + var ns_name = namespaces[0].@name + var ns_kind = namespaces[0].@kind=="public"?CONSTANT_PackageNamespace:CONSTANT_PackageInternalNS + var ns_utf8_index = ConstantUtf8(ns_name) + var ns_index = ConstantNamespace(ns_utf8_index,ns_kind) + index = ConstantQualifiedName(name_index,ns_index,is_attr) + } + else + { + ns_index = ConstantNamespaceSet(namespaces) + index = ConstantMultiname(name_index,ns_index,is_attr) + } + + if( is_super ) + { + makeByte(code,OP_setsuper); + makeInt32(code,index); + } + if( is_constinit ) + { + makeByte(code,OP_initproperty); + makeInt32(code,index); + } + else + { + makeByte(code,OP_setproperty); + makeInt32(code,index); + } + } + + public function GetProperty(name,namespaces,is_qualified,is_super,is_attr) + { + Debug.enter("GetProperty",name,namespaces,is_qualified,is_super,is_attr) + Debug.log_mode::log(" "+code.length+":GetProperty "+name+" {"+dumpNamespaces(namespaces)+"}",code_out) + + var index,name_index,ns_index + + if( name == "*" ) + { + name_index = 0 + } + else + { + name_index = ConstantUtf8(name) + } + + if( is_qualified && namespaces.length == 1 ) + { + var ns_name = namespaces[0].@name + var ns_kind = namespaces[0].@kind=="public"?CONSTANT_PackageNamespace:CONSTANT_PackageInternalNS + var ns_utf8_index = ConstantUtf8(ns_name) + var ns_index = ConstantNamespace(ns_utf8_index,ns_kind) + index = ConstantQualifiedName(name_index,ns_index,is_attr) + } + else + { + ns_index = ConstantNamespaceSet(namespaces) + index = ConstantMultiname(name_index,ns_index,is_attr) + } + + if( is_super ) + { + makeByte(code,OP_getsuper) + makeInt32(code,index) + } + else + { + makeByte(code,OP_getproperty) + makeInt32(code,index) + } + } + + public function DeleteProperty(name,namespaces,is_qualified,is_super,is_attr) + { + Debug.enter("DeleteProperty",name,namespaces,is_qualified,is_super,is_attr) + Debug.log_mode::log(" "+code.length+":DeleteProperty "+name+" {"+dumpNamespaces(namespaces)+"}",code_out) + + var index,name_index,ns_index + + if( name == "*" ) + { + name_index = 0 + } + else + { + name_index = ConstantUtf8(name) + } + + if( is_qualified && namespaces.length == 1 ) + { + var ns_name = namespaces[0].@name + var ns_kind = namespaces[0].@kind=="public"?CONSTANT_PackageNamespace:CONSTANT_PackageInternalNS + var ns_utf8_index = ConstantUtf8(ns_name) + var ns_index = ConstantNamespace(ns_utf8_index,ns_kind) + index = ConstantQualifiedName(name_index,ns_index,is_attr) + } + else + { + ns_index = ConstantNamespaceSet(namespaces) + index = ConstantMultiname(name_index,ns_index,is_attr) + } + + if( is_super ) + { + } + else + { + makeByte(code,OP_deleteproperty) + makeInt32(code,index) + } + } + + public function CheckType(name) + { + Debug.log_mode::log(" "+code.length+":CheckType "+name,code_out) + + var fullname = name.toString(); + if ("*" == fullname) + { + makeByte(code,OP_coerce_a); + } + else + if ("Object" == fullname) + { + makeByte(code,OP_coerce_o); + } + else + if ("String" == fullname) + { + makeByte(code,OP_coerce_s); + } + else + if ("Boolean" == fullname) + { + makeByte(code,OP_coerce_b); + } + else + if ("Number" == fullname) + { + makeByte(code,OP_coerce_d); + } + else + if ("int" == fullname) + { + makeByte(code,OP_coerce_i) + } + else if ("uint" == fullname) + { + makeByte(code,OP_coerce_u) + } + else + { +/* + int type_index = AddClassName(name); + Coerce(*ab->code,class_index); + makeByte(code,OP_coerce) + makeInt32(code,type_index) +*/ + } + + } + + public function GetSlot(n) + { + Debug.log_mode::log(" "+code.length+":GetSlot "+n,code_out) + makeByte(code,OP_getslot) + makeInt32(code,n) + } + + public function SetSlot(n) + { + Debug.log_mode::log(" "+code.length+":SetSlot "+n,code_out) + makeByte(code,OP_setslot) + makeInt32(code,n) + } + + public function GetLocal(n) + { + Debug.log_mode::log(" "+code.length+":GetLocal "+n,code_out) + if( n <= 3 ) + { + makeByte(code,OP_getlocal0+n) + } + else + { + makeByte(code,OP_getlocal) + makeInt32(code,n) + } + } + + public function SetLocal(n) + { + Debug.log_mode::log(" "+code.length+":SetLocal "+n,code_out) + if( n <= 3 ) + { + makeByte(code,OP_setlocal0+n) + } + else + { + makeByte(code,OP_setlocal) + makeInt32(code,n) + } + } + + public function FreeTemp(n) + { + Debug.log_mode::log(" "+code.length+":FreeTemp",code_out) + makeByte(code,OP_kill) + makeInt32(code,n) + } + + public function Return() + { + Debug.log_mode::log(" "+code.length+":Return",code_out) + makeByte(code,OP_returnvalue) + } + + public function NewFunction(method_index) + { + Debug.log_mode::log(" "+code.length+":NewFunction "+method_index,code_out) + makeByte(code,OP_newfunction) + makeInt32(code,method_index) + } + + public function NewActivation() + { + Debug.log_mode::log(" "+code.length+":NewActivation",code_out) + makeByte(code,OP_newactivation) + } + + public function GetGlobalScope() + { + Debug.log_mode::log(" "+code.length+":GetGlobalScope",code_out) + makeByte(code,OP_getglobalscope) + } + + public function GetScopeObject(n) + { + Debug.log_mode::log(" "+code.length+":GetScopeObject "+n,code_out) + makeByte(code,OP_getscopeobject) + makeInt32(code,n) + } + + public function Call(size:uint) + { + Debug.log_mode::log(" "+code.length+":Call",code_out) + makeByte(code,OP_call) + makeInt32(code,size) + } + + function checkBytes(bytes) + { + var bi = 0 + var ci = code.length-bytes.length + for( ; bi < bytes.length; bi++,ci++ ) + { + if( bytes[bi] != 0xff && + bytes[bi] != code[ci] ) + { + return "fail: expecting "+bytes[bi]+" found "+code[ci] + } + else + { + } + } + return "pass" + } + + } + + /* + + Test case for the emitter interface + + */ + + var name = "foo" + var ns_set = [] + + var test_cases = [ + { + name:"GetProperty", + args:[ + [name,ns_set,false,false,false], + [name,ns_set,true,false,false], + [name,ns_set,false,true,false], + [name,ns_set,false,false,true], + ], + bytes:[ + [0x66,0xff], + [0x66,0xff], + [0x04,0xff], + [0x66,0xff], + ] + }, + { + name:"SetProperty", + args:[ + [name,ns_set,false,false,false,false], + [name,ns_set,true,false,false,false], + [name,ns_set,false,true,false,false], + [name,ns_set,false,false,true,false], + [name,ns_set,false,false,false,true], + ], + bytes:[ + [0x61,0xff], + [0x61,0xff], + [0x61,0xff], + [0x61,0xff], + [0x68,0xff], + ] + }, + { + name:"CallProperty", + args:[ + [name,ns_set,0,false,false,false,false,false], + [name,ns_set,0,true,false,false,false,false], + [name,ns_set,0,false,true,false,false,false], + [name,ns_set,0,false,false,true,false,false], + [name,ns_set,0,false,false,false,true,false], + ], + bytes:[ + [0x46,0xff,0x00], + [0x46,0xff,0x00], + [0x45,0xff,0x00], + [0x46,0xff,0x00], + [0x4c,0xff,0x00], + ] + }, + { + name:"Dup", + args:[ + [], + ], + bytes:[ + [0x2a], + ] + }, + { + name:"NewActivation", + args:[ + [], + ], + bytes:[ + [0x57], + ] + }, + ] + + public function testABCEmitter() + { + var emitter = new ABCEmitter() + emitter.StartProgram() + emitter.StartMethod("test") + + for( var i = 0; i < test_cases.length; i++ ) + { + testInstruction(emitter,test_cases[i].name,test_cases[i].args,test_cases[i].bytes) + } + } + + function testInstruction(emitter,name,args_list,bytes_list) + { + Debug.debug::log(name) + for( var i = 0; i < args_list.length; i++ ) + { + var args = args_list[i] + var bytes = bytes_list[i] + switch( args.length ) + { + case 0: + emitter[name].apply(emitter,args) + break + case 5: + emitter[name](args[0],args[1],args[2],args[3],args[4]) + break + case 6: + emitter[name](args[0],args[1],args[2],args[3],args[4],args[5]) + break + case 7: + emitter[name](args[0],args[1],args[2],args[3],args[4],args[5],args[6]) + break + case 8: + emitter[name](args[0],args[1],args[2],args[3],args[4],args[5],args[6],args[7]) + break + default: + print("arg number not implemented " + args.length) + } + print(" "+i+":"+emitter.checkBytes(bytes)) + } + } + +} diff --git a/mozilla/js/tamarin/esc/es4.as b/mozilla/js/tamarin/esc/es4.as new file mode 100644 index 00000000000..4c70f5ee3b9 --- /dev/null +++ b/mozilla/js/tamarin/esc/es4.as @@ -0,0 +1,135 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +package es4 +{ + import avmplus.File + + // shell + + public function evalFile(src_name) + { + var base_name = src_name.split('.')[0] + var abc_name = base_name+".abc" + var src = File.read(src_name) + return evalString(src) + } + + public function evalString(src) + { + var evaluator = new Evaluator + try + { + var result = evaluator.eval(src) + } + catch(x) + { + print("\n**" + x + "**") + var result = + } + return result + } +} + +include "debugger.as" +include "parser.as" +include "definer.as" +include "emitter.as" +include "interpreter.as" +include "evaluator.as" + +{ + import avmplus.System + import avmplus.File + import es4.* + + if( System.argv.length < 1 ) + { + print(File.read("es4_start.txt")) + while( true ) + { + System.write("es4>") + var s = System.readLine() + if( s == ".quit" ) break + else if( s.indexOf(".help") == 0 ) + { + print(File.read("es4_start.txt")) + print(File.read("es4_help.txt")) + } + else if( s.indexOf(".trace") == 0 ) + { + var arg_name = s.substr(7) + if( arg_name == "on" ) + { + es4.log_mode = debug + print("tracing on") + } + else + { + es4.log_mode = release + print("tracing off") + } + } + else if( s.indexOf(".load") == 0 ) + { + var arg_name = s.substr(6) + var result = evalFile(arg_name) + if( result != void 0 ) + { + print(result) + } + } + else if( s.indexOf(".test") == 0 ) + { + var result = testABCEmitter() + if( result != void 0 ) + { + print(result) + } + } + else + { + var result = evalString(s) + if( result != void 0 ) + { + print(result) + } + } + } + } + else + { + print(System.argv[0]) + var result = evalFile(System.argv[0]) + print(result) + } +} + diff --git a/mozilla/js/tamarin/esc/es4_help.txt b/mozilla/js/tamarin/esc/es4_help.txt new file mode 100644 index 00000000000..a72c972726e --- /dev/null +++ b/mozilla/js/tamarin/esc/es4_help.txt @@ -0,0 +1,92 @@ + +GOALS + + The purpose of this prototype is to provide a reusable (as in copiable) + code base for exploring different aspects of the ES4 runtime compiler. + The audience for this software consists of language developers. It is + not likely to be useful as a language engine but it should be useful as + a base for making a useful language engine - at least that's the goal + + Specific goals include: + + 1/Implementing a parser for the full ES4 grammar + 2/Using E4X to explore the abstract syntax of ES4 programs + 3/Implementing the "definition" phase of the compiler + 4/Modelling all block structures (e.g. block statements, + classes, functions) as prologue-block pairs in the abstract + syntax, and emit those pairs uniformly as methods with traits + 5/Implementing packages and namespaces, import and use namespace + 6/Implementing multinames and unqualified name resolution + +NON-GOALS + + Specific non-goals: + + 1/Efficent intermediate representation of programs. A later + experiment will attempt a compiler that avoids the use of + an intermediate a.s.t altogether + 2/Modelling types. There are serious practical issues with + implementing classes and instances as vanilla activation + objects, like I have done here. We will want to use the + existing AVM support for types in any production version + 3/Implementing a useful subset of the language, including + control flow statements and operator expressions + 4/Zero bugs + +AREAS FOR FURTHER INVESTIGATION + + 1/Efficiency - e.g. merging compiler phases to avoid + creation of a.s.t.s + 2/Compatibility with ES3/JS1 + 3/Prototyping ES4 proposals + * Static v. standard modes + * Switch type + * Enumerability + * [done] Block scope (let) + * Local packages + * Iterators & generators + * Date literals + * Destructuring assignment + * [done] Reserved words + * Nullability + * Namespace shadowing + * Reformed ''with'' + * Type parameters + * Self hosting object model + * Structural types + * is, as, to operators + * Numbers (see Decmial) + * Tail calls + * Type definitions + * Catchalls + * Hashcodes + * Intrinsic namespace + * Operator overloading + * Decimal + * typeof + * Regexp update + * Unicode update + * ES3 bug fixes + +ABOUT THE CODE + + * I've used type annotations as sparingly as possible to keep + the coding process as fluid as possible. This lack of types + sometimes leads to hairy debugging sessions, but on the whole + has made the code more malleable than it would be otherwise + * Variable names are all lower case with words separated by '_' + * Method names are Java style except in some cases where + they are part of a major interface and its leading lowercase + verb is dropped. For example, in the Emitter class what would + have been called 'emitGetProperty' is named 'GetProperty' + * I've used dynamic object features such as E4X and Array and + Object extensively and classes sparingly. Again this is to + keep design decisions from getting prematurely encrusted in the + code + * I've used namespaces to switch modes at compile time (mostly). + There are two pairs of opposing namespaces: 'debug' and 'release' + are used to control the printing of trace information; 'avm' and + 'ast' are used as alternative interpreters - ast, the tree walking + interpreter is currently too incomplete to be interesting - avm + is the primary interpreter + diff --git a/mozilla/js/tamarin/esc/es4_start.txt b/mozilla/js/tamarin/esc/es4_start.txt new file mode 100644 index 00000000000..9690289ded1 --- /dev/null +++ b/mozilla/js/tamarin/esc/es4_start.txt @@ -0,0 +1,13 @@ + +ES4 -- an experiment in hosting ES4 on the AVM + +USAGE + + At the prompt enter one of the following sentences: + + - evaluate + .load - load and evaluate the contents of + .trace { on | off } - turn tracing on or off + .test - runs self tests + .help - display information about this interpreter + .quit - quit this shell program diff --git a/mozilla/js/tamarin/esc/evaluator.as b/mozilla/js/tamarin/esc/evaluator.as new file mode 100644 index 00000000000..45c82389b99 --- /dev/null +++ b/mozilla/js/tamarin/esc/evaluator.as @@ -0,0 +1,80 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + + +package es4 +{ + + /* + + Evaluate an ES4 program + + */ + + public var log_mode = release + + class Evaluator + { + function Evaluator() {} + function eval(src) + { + var externs = + + + + + + + + + "class int" + + + + var parser = new Parser(src) + var definer = new Definer() + var interpreter = new Interpreter() + + var node = parser.parseProgram() +node.Prologue.* += externs.Slot + Debug.log_mode::log("parse:"+node.toXMLString()) + var node = definer.defineProgram(node) + Debug.log_mode::log("define:"+node.toXMLString()) + Debug.log_mode::log("interp:") + var node = interpreter.interpretProgram(node) + return node + } + } + +} + + diff --git a/mozilla/js/tamarin/esc/interpreter.as b/mozilla/js/tamarin/esc/interpreter.as new file mode 100644 index 00000000000..03ed9d4fe28 --- /dev/null +++ b/mozilla/js/tamarin/esc/interpreter.as @@ -0,0 +1,1184 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +package es4 +{ + import avmplus.Domain + import flash.utils.ByteArray + + namespace avm // interpret using the avm + namespace ast // interpret ast directly + namespace shared // common interpreter routines + + function countParams(slots) + { + var count = 0 + for each( var slot in slots ) + { + if( slot.@is_param != void 0 ) + { + ++count + } + } + return count + } + + function countLocals(slots) + { + var count = slots.length()+1 // +1 for 'this' + return count + } + + class Interpreter + { + use namespace release + use namespace shared + use namespace avm + //use namespace ast + + avm var emitter : ABCEmitter = new ABCEmitter() + ast var emitter // unused + avm var state // unused + ast var state = {stack:[]} + + // entry point + + function interpretProgram(node) + { + return interpProgram(node) + } + + // INTERPERTER ROUTINES + + shared function interpPrologue(node,slot_infos) + { + Debug.enter("Prologue",node) + + for each ( var slot in node.Slot ) + { + interpSlot(slot_infos,slot) + } + var result = slot_infos + + Debug.exit("Prologue",result,result.length) + return result + } + + shared function getScopeDepth(node) + { + var parent = node + var scope_depth : int = 0 + + do + { + if( node.name() == "Block" ) + { + scope_depth++ + } + parent = parent.parent() + } + while( parent.name() != "Program" ) + return scope_depth + } + + /* + + The qualified name of an unqualified type annotation is known at compile time. + That is, the binding for the reference is known. So at this point, we assume + that the type name has been rewritten as a qualified name. + + */ + + avm function interpSlot(slot_infos,node) + { + Debug.enter("Slot",node) + + var result = slot_infos.length + var name = node.Name.QualifiedIdentifier.Identifier.@name + var namespace = node.Name.QualifiedIdentifier.Qualifier.Namespace + var tname = node.Type.QualifiedIdentifier.Identifier.@name + var tnamespace = node.Type.QualifiedIdentifier.Qualifier.Namespace + + var slot_id = 0 // auto assign + + emitter.SlotInfo(slot_infos,0,{name:name,namespace:namespace},{name:tname,namespace:tnamespace},slot_id) + + if( node.@kind == "class" ) + { + emitter.FindProperty(name,[namespace],false,false,false) + interpClass(node.Value.Class) // class object on stack + emitter.SetProperty(name,[namespace],false,false,false,false) + } + else + if( node.@kind == "function" ) + { + emitter.FindProperty(name,[namespace],false,false,false) + interpFunction(node.Value.Function) + emitter.SetProperty(name,[namespace],false,false,false,false) + } + else + if( node.@kind == "var" ) + { + var scope_depth = getScopeDepth(node) + if( node.Value != undefined ) + { + emitter.FindProperty(name,[namespace],false,false,false) + interpExpression(node.Value.*) + emitter.SetProperty(name,[namespace],false,false,false,false) + } + } + + Debug.exit("Slot",result) + return result + } + + ast function interpSlot(slot_infos,node) + { + Debug.enter("Slot",node) + + var result + + Debug.exit("Slot",result) + return result + } + + shared function interpBlock(node,slot_infos) + { + Debug.enter("Block",node) + + for each( var n in node.* ) + { + var name : String = n.localName() + switch(name) + { + case "BlockStatement": + var result = interpBlockStatement(n) + break + case "ExpressionStatement": + var result = interpExpressionStatement(n) + break + case "Return": + var result = interpReturnStatement(n) + break + default: + throw "Block not implemented for "+node + } + } + + Debug.exit("Block",result) + return result + } + + // SCOPING FEATURES + + /* + + Program + + */ + + avm function interpProgram(node) + { + Debug.enter("Program",node) + + var name = "$init" + emitter.StartProgram() + emitter.StartMethod(name) // push the current body and create a new one on the body stack + emitter.LoadThis() + emitter.PushScope() // push the global object + emitter.PushUndefined() + + var slot_infos = [] + interpPrologue(node.Prologue,slot_infos) + interpBlock(node.Block,slot_infos) + + emitter.Return() + var locals_count = countLocals(node.Prologue.Slot) + var method_index = emitter.FinishMethod(name,[]/*slot_infos*/,false,0,locals_count) // return the index of the created method + + var init_index = emitter.methodCount() - 1 + emitter.FinishProgram(init_index,slot_infos) + + // Emit bytes + + var bytes = emitter.emit() + bytes.writeFile("temp.abc") + Debug.log_mode::trace("temp.abc, "+bytes.length+" bytes written") + + // Execute bytes + + var domain = Domain.currentDomain + var result = {domain.loadBytes(bytes)} + + Debug.exit("Program",result) + return result + } + + ast function interpProgram(node) + { + Debug.enter("Program",node) + + var slot_infos = [] + interpPrologue(node.Prologue,slot_infos) + interpBlock(node.Block,slot_infos) + + if( state.stack.length != 1 ) + { + throw "final stack depth is " + state.stack.length + } + var result = state.stack[0] + + Debug.exit("Program",result) + return result + } + + /* + + Block statement + + */ + + avm function interpBlockStatement(node) + { + Debug.enter("BlockStatement",node) + + var name = node.@kind.toString() == "package" ? node.@name+"$block" : + node.@kind.toString() == "let" ? getUniqueName("let$block"): getUniqueName("block") + + emitter.StartMethod(name) + emitter.NewActivation() + emitter.PushScope() + emitter.PushUndefined() + + var slot_infos = [] + interpPrologue(node.Prologue,slot_infos) + interpBlock(node.Block,slot_infos) + + emitter.Return() + var locals_count = countLocals(node.Prologue.Slot) + var method_index = emitter.FinishMethod(name,slot_infos,false,0,locals_count) // return the index of the created method + + emitter.NewFunction(method_index) + emitter.GetGlobalScope() + emitter.Call(0) + emitter.Pop() // remove the result of call from stack + + Debug.exit("BlockStatement",result) + return result + } + + ast function interpBlockStatement(node) + { + Debug.enter("BlockStatement",node) + + Debug.exit("BlockStatement",result) + return result + } + + /* + + Class + + */ + + avm function interpClass(node) + { + Debug.enter("Class",node) + + var name : String = node.ClassName.Identifier.@name + "$cinit" + emitter.StartMethod(name) // cinit + emitter.NewActivation() + emitter.Dup() // copy of activation object returned by cinit + emitter.PushScope() + + var slot_infos = [] + interpPrologue(node.Prologue,slot_infos) + interpBlock(node.Block,slot_infos) + + emitter.Return() + + var locals_count = countLocals(node.Prologue.Slot) + var method_index = emitter.FinishMethod(name,slot_infos,false,0,locals_count) // return the index of the created method + + // Create new function and invoke it + + emitter.NewFunction(method_index) + emitter.GetGlobalScope() + emitter.Call(0) + + Debug.exit("Class",result) + return result + } + + ast function interpClass(node) + { + Debug.enter("Class",node) + + // TBD + + Debug.exit("Class",result) + return result + } + + /* + + Function + + */ + + avm function interpFunction(node) + { + Debug.enter("Function",node) + + var name : String = node.@name!=void 0?node.@name:getUniqueName("function") + emitter.StartMethod(name) + + emitter.NewActivation() + emitter.PushScope() + + var slot_infos = [] + interpPrologue(node.Prologue,slot_infos) + + var param_count = countParams(node.Prologue.Slot) + var scope_depth = getScopeDepth(node) + var has_arguments = node.@has_arguments=="true" + var implicit_param_count = has_arguments ? 1 : 0 + + for( var i = 1; i < param_count+implicit_param_count; i++ ) // make sure we copy value of 'arguments' too + { + emitter.GetScopeObject(scope_depth) + emitter.GetLocal(i) + emitter.SetSlot(i) + } + + interpBlock(node.Block,slot_infos) + emitter.PopScope() + + // todo: use cfa to determine if this is necessary + emitter.PushUndefined() // return undefined if we run off the end + emitter.Return() // if we run off the end + + var locals_count = countLocals(node.Prologue.Slot) + var method_index = emitter.FinishMethod(name,slot_infos,has_arguments,param_count,locals_count) // return the index of the created method + + emitter.NewFunction(method_index) // leave new function on stack + + Debug.exit("Function",result) + return result + } + + ast function interpFunction(node) + { + Debug.enter("Function",node) + + // TBD + + Debug.exit("Function",result) + return result + } + + + // STATEMENTS + + /* + + Expression statement + + */ + + avm function interpExpressionStatement(node) + { + Debug.enter("ExpressionStatement",node) + + const needs_result = false + var result = interpExpression(node.*,needs_result) + + Debug.exit("ExpressionStatement",result) + return result + } + + ast function interpExpressionStatement(node) + { + Debug.enter("ExpressionStatement",node) + + const needs_result = false + var result = interpExpression(node.*,needs_result) + + Debug.exit("ExpressionStatement",result) + return result + } + + /* + + Return statement + + */ + + avm function interpReturnStatement(node) + { + Debug.enter("ReturnStatement",node) + + const needs_result = true + var result = interpExpression(node.*,needs_result) + emitter.Return() + + Debug.exit("ReturnStatement",result) + return result + } + + ast function interpReturnStatement(node) + { + Debug.enter("ReturnStatement",node) + + // tbd + + Debug.exit("ReturnStatement",result) + return result + } + + // EXPRESSIONS + + shared function makeNamespaceSet(node) + { + var result = [] + for each ( var item in node.Namespace ) + { + result.push(item.@name) + } + return result + } + + shared function interpQualifier(node) + { + Debug.enter("Qualifier",node) + + if( node != void 0 && node.Get != void 0 ) + { + var result = interpGet(node.Get) + } + else + if( node != void 0 && node.Namespace != void 0 ) + { + var result = node.Namespace + } + else + { + throw "invalid Qualifier " + node + } + + Debug.exit("Qualifier",result) + return result + } + + /* + + Resolve Get expression + + */ + + avm function interpGet(node) + { + Debug.enter("Get",node) + + if( node.QualifiedIdentifier != void 0 ) + { + var namespaces = [interpQualifier(node.QualifiedIdentifier.Qualifier)] + var ident = node.QualifiedIdentifier.Identifier.@name + var is_qualified = true + } + else + if( node.Identifier != void 0 ) + { + var namespaces = [] + var opennss = node.Identifier.OpenNamespaces.* // get open namespaces for this identifier + for each( var ns in opennss ) + { + namespaces.push(ns) + } + var ident = node.Identifier.@name + var is_qualified = false + } + else + { + throw "Get not implemented for " + node.toXMLString() + } + const is_strict = true + + // if namespaces has more than one set, then determine + // which set provides the match. + + if( node.@kind == "lexical" ) + { + // For each namespace set in namespaces, search for the + // target property. If it is found, then jump to Get. + + emitter.FindProperty(ident,namespaces,is_qualified,false,is_strict) + } + else + { + interpExpression(node.*[0]) + } + + // For each namespace set in namespaces, search for the + // target property. If it is found, then jump to Get. + + emitter.GetProperty(ident,namespaces,is_qualified,false,false) + + Debug.exit("Get",result) + return result + } + + ast function interpGet(node) + { + Debug.enter("Get",node) + + if( node.QualifiedIdentifier != void 0 ) + { + var qualifier = interpQualifier(node.QualifiedIdentifier.Qualifier) + var ident = node.QualifiedIdentifier.Identifier.@name + } + else + if( node.Identifier != void 0 ) + { + var ident = node.Identifier.@name + } + else + { + throw "Get not implemented for " + node.toXMLString() + } + + var parent = node + var result + do + { + var parent = parent.parent() + if( parent.Prologue != void 0 ) + { + var slots = parent.Prologue.Slot.(Name.QualifiedIdentifier.Identifier.@name == ident) + + if( slots == void 0 ) + { + continue + } + + if( qualifier != void 0 ) + { + var match_slots = matchQualifier(qualifier,slots) + } + else + { + var match_slots = matchOpenNamespaces(node,slots) + } + + if( match_slots.length == 0 ) + { + continue + } + else + if( match_slots.length == 1 ) + { + break + } + else + { + throw "ambiguous reference to " + ident + } + } + } + while( parent.name() != "Program" ) + + if( match_slots.length == 1 ) + { + state.stack.push(match_slots[0].Value.*) + } + else + { + throw "unresolved reference to " + ident + } + + Debug.exit("Get",result) + return result + } + + /* + + Set + + */ + + avm function interpSet(node) + { + Debug.enter("Set",node) + + if( node.QualifiedIdentifier != void 0 ) + { + var namespaces = [interpQualifier(node.QualifiedIdentifier.Qualifier)] + var ident = node.QualifiedIdentifier.Identifier.@name + var is_qualified = true + } + else + if( node.Identifier != void 0 ) + { + var opennss = node.Identifier.OpenNamespaces.* //getOpenNamespaces(node,ident) // get open namespaces for this identifier + var namespaces = [] + for each( var ns in opennss ) + { + namespaces.push(ns) + } + var ident = node.Identifier.@name + var is_qualified = false + } + else + { + throw "Set not implemented for " + node.toXMLString() + } + + if( node.@kind == "lexical" ) + { + emitter.FindProperty(ident,namespaces,is_qualified,false,false) + interpExpression(node.*[1]) // value + } + else + { + interpExpression(node.*[0]) // base object + interpExpression(node.*[2]) // value + } + + emitter.SetProperty(ident,namespaces,is_qualified,false,false,false) + + Debug.exit("Set",result) + return result + } + + ast function interpSet(node) + { + Debug.enter("Set",node) + + if( node.QualifiedIdentifier != void 0 ) + { + var qualifier = interpQualifier(node.QualifiedIdentifier.Qualifier) + var ident = node.QualifiedIdentifier.Identifier.@name + } + else + if( node.Identifier != void 0 ) + { + var ident = node.Identifier.@name + } + else + { + throw "Set not implemented for " + node.toXMLString() + } + + var parent = node + var result + var slot_set = [] + do + { + var parent = parent.parent() + if( parent.Prologue != void 0 ) + { + var slots = parent.Prologue.Slot.(Name.QualifiedIdentifier.Identifier.@name == ident) + + if( slots == void 0 ) + { + continue + } + + if( qualifier != void 0 ) + { + var slot_set = matchQualifier(qualifier,slots) + } + else + { + var slot_set = matchOpenNamespaces(node,slots) + } + + if( slot_set.length == 0 ) + { + continue + } + else + if( slot_set.length == 1 ) + { + break + } + else + { + throw "ambiguous reference to " + ident + } + } + } + while( parent.name() != "Program" ) + + if( slot_set.length == 1 ) + { + interpTo(node.To) + + var temp = state.stack.pop() + slot_set[0].Value.* = temp + } + else + { + throw "unresolved reference to " + ident + } + + Debug.exit("Set",result) + return result + } + + /* + + Call + + */ + + avm function interpCall(node) + { + Debug.enter("Call",node) + + if( node.QualifiedIdentifier != void 0 ) + { + var namespaces = [interpQualifier(node.QualifiedIdentifier.Qualifier)] + var ident = node.QualifiedIdentifier.Identifier.@name + var is_qualified = true + } + else + if( node.Identifier != void 0 ) + { + var namespaces = [] + var opennss = node.Identifier.OpenNamespaces.* + for each( var ns in opennss ) + { + namespaces.push(ns) + } + var ident = node.Identifier.@name + var is_qualified = false + } + else + { + throw "Set not implemented for " + node.toXMLString() + } + + if( node.@kind == "lexical" ) + { + emitter.FindProperty(ident,namespaces,is_qualified,false,true) + } + else + { + interpExpression(node.*[0]) + } + + emitter.Dup() + interpArgs(node.Args) + var count = node.Args.*.length() + + if( node.@is_new == "true" ) + { + emitter.CallProperty(ident,namespaces,count,is_qualified,false,false,false,true) + } + else + { + emitter.CallProperty(ident,namespaces,count,is_qualified,false,false,false,false) + } + + Debug.exit("Call",result) + return result + } + + ast function interpCall(node) + { + Debug.enter("Call",node) + + if( node.QualifiedIdentifier != void 0 ) + { + var qualifier = interpQualifier(node.QualifiedIdentifier.Qualifier) + var ident = node.QualifiedIdentifier.Identifier.@name + } + else + if( node.Identifier != void 0 ) + { + var ident = node.Identifier.@name + } + else + { + throw "Set not implemented for " + node.toXMLString() + } + + var parent = node + var result + var slot_set = [] + do + { + var parent = parent.parent() + if( parent.Prologue != void 0 ) + { + var slots = parent.Prologue.Slot.(Name.QualifiedIdentifier.Identifier.@name == ident) + + if( slots == void 0 ) + { + continue + } + + if( qualifier != void 0 ) + { + var slot_set = matchQualifier(qualifier,slots) + } + else + { + var slot_set = matchOpenNamespaces(node,slots) + } + + if( slot_set.length == 0 ) + { + continue + } + else + if( slot_set.length == 1 ) + { + break + } + else + { + throw "ambiguous reference to " + ident + } + } + } + while( parent.name() != "Program" ) + + if( slot_set.length == 1 ) + { + interpTo(node.To) + + var temp = state.stack.pop() + slot_set[0].Value.* = temp + } + else + { + throw "unresolved reference to " + ident + } + + Debug.exit("Call",result) + return result + } + + /* + + Delete + + */ + + avm function interpDelete(node) + { + Debug.enter("Delete",node) + + if( node.QualifiedIdentifier != void 0 ) + { + var namespaces = [interpQualifier(node.QualifiedIdentifier.Qualifier)] + var ident = node.QualifiedIdentifier.Identifier.@name + var is_qualified = true + } + else + if( node.Identifier != void 0 ) + { + var namespaces = [] + var opennss = node.Identifier.OpenNamespaces.* // get open namespaces for this identifier + for each( var ns in opennss ) + { + namespaces.push(ns) + } + var ident = node.Identifier.@name + var is_qualified = false + } + else + { + throw "Delete not implemented for " + node.toXMLString() + } + const is_strict = true + + if( node.@kind == "lexical" ) + { + emitter.FindProperty(ident,namespaces,is_qualified,false,is_strict) + } + else + { + interpExpression(node.*[0]) + } + + emitter.DeleteProperty(ident,namespaces,is_qualified,false,false) + + Debug.exit("Delete",result) + return result + } + + ast function interpDelete(node) + { + Debug.enter("Delete",node) + + var result + + Debug.exit("Delete",result) + return result + } + + /* + + This + + */ + + avm function interpThis(node) + { + Debug.enter("This",node) + + emitter.LoadThis() + + Debug.exit("This",result) + return result + } + + ast function interpThis(node) + { + Debug.enter("This",node) + + // TBD + + Debug.exit("This",result) + return result + } + + /* + + Number literal + + */ + + avm function interpLiteralNumber(node) + { + Debug.enter("LiteralNumber",node) + + //emitter.PushNumber(node.@value) + emitter.PushInt(node.@value) // todo: implement PushNumber + + Debug.exit("LiteralNumber",result) + return result + } + + ast function interpLiteralNumber(node) + { + Debug.enter("LiteralNumber",node) + + state.stack.push(node) + + Debug.exit("LiteralNumber",result) + return result + } + + /* + + String literal + + */ + + avm function interpLiteralString(node) + { + Debug.enter("LiteralString",node) + + emitter.PushString(node.@value) + var result = node + + Debug.exit("LiteralString",result) + return result + } + + ast function interpLiteralString(node) + { + Debug.enter("LiteralString",node) + + state.stack.push(node) + var result = node + + Debug.exit("LiteralString",result) + return result + } + + /* + + Undefined literal + + */ + + avm function interpLiteralUndefined(node) + { + Debug.enter("LiteralUndefined",node) + + emitter.PushUndefined() + var result = node + + Debug.exit("LiteralUndefined",result) + return result + } + + ast function interpLiteralUndefined(node) + { + Debug.enter("LiteralUndefined",node) + + state.stack.push(node) + var result = node + + Debug.exit("LiteralUndefined",result) + return result + } + + /* + + To + + */ + + shared function interpTo(node) + { + Debug.enter("To",node) + + interpExpression(node.*[0]) + var result = node + + Debug.exit("To",result) + return result + } + + /* + + Args + + */ + + shared function interpArgs(node) + { + Debug.enter("Args",node) + + for each( var item in node.To ) + { + interpTo(item) // for now args are to expressions + } + var result = node + + Debug.exit("Args",result) + return result + } + + /* + + Expression + + */ + + shared function interpExpression(node,needs_result:Boolean=true) + { + Debug.enter("Expression",node) + + var name = node.localName() + var result + switch(name) + { + case "This": + if( needs_result ) result = interpThis(node) + break + case "LiteralNumber": + if( needs_result ) result = interpLiteralNumber(node) + break + case "LiteralString": + if( needs_result ) result = interpLiteralString(node) + break + case "LiteralUndefined": + if( needs_result ) result = interpLiteralUndefined(node) + break + case "Get": + result = interpGet(node) + if( !needs_result ) emitter.Pop() + break + case "Set": + result = interpSet(node) + if( needs_result ) throw "need to put the result on the stack" + break + case "Call": + result = interpCall(node) + if( !needs_result ) emitter.Pop() + break + case "Delete": + result = interpDelete(node) + if( !needs_result ) emitter.Pop() + break + case "To": + result = interpTo(node) + if( !needs_result ) emitter.Pop() + break + case "Function": + result = interpFunction(node) + if( !needs_result ) emitter.Pop() + break + default: + throw "Expression not implemented for " + node.toXMLString() + } + + var result = node + + Debug.exit("Expression",result) + return result + } + + // template + function interp(node) + { + Debug.enter("",node) + + var result + + Debug.exit("",result) + return result + } + + function dumpState(state) + { + print('begin state - - - - - - - -') + + print('begin stack, size='+state.stack.length) + for each( var item in state.stack ) + { + print(' ',item.toXMLString()) + } + print('end stack') + print('end state - - - - - - - - -') + } + + + } +} + diff --git a/mozilla/js/tamarin/esc/parser.as b/mozilla/js/tamarin/esc/parser.as new file mode 100644 index 00000000000..07608dd8b58 --- /dev/null +++ b/mozilla/js/tamarin/esc/parser.as @@ -0,0 +1,6121 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + + +package es4 +{ + use namespace release + + public const first_token = -1 + public const eos_token = first_token-0 + + public const minus_token = first_token - 1 + public const minusminus_token = minus_token - 1 + public const not_token = minusminus_token - 1 + public const notequals_token = not_token - 1 + public const strictnotequals_token = notequals_token - 1 + public const modulus_token = strictnotequals_token - 1 + public const modulusassign_token = modulus_token - 1 + public const bitwiseand_token = modulusassign_token - 1 + public const logicaland_token = bitwiseand_token - 1 + public const logicalandassign_token = logicaland_token - 1 + public const bitwiseandassign_token = logicalandassign_token - 1 + public const leftparen_token = bitwiseandassign_token - 1 + public const rightparen_token = leftparen_token - 1 + public const mult_token = rightparen_token - 1 + public const multassign_token = mult_token - 1 + public const comma_token = multassign_token - 1 + public const dot_token = comma_token - 1 + public const doubledot_token = dot_token - 1 + public const tripledot_token = doubledot_token - 1 + public const leftdotangle_token = tripledot_token - 1 + public const div_token = leftdotangle_token - 1 + public const divassign_token = div_token - 1 + public const colon_token = divassign_token - 1 + public const doublecolon_token = colon_token - 1 + public const semicolon_token = doublecolon_token - 1 + public const questionmark_token = semicolon_token - 1 + public const at_token = questionmark_token - 1 + public const leftbracket_token = at_token - 1 + public const rightbracket_token = leftbracket_token - 1 + public const bitwisexor_token = rightbracket_token - 1 + public const logicalxor_token = bitwisexor_token - 1 + public const logicalxorassign_token = logicalxor_token - 1 + public const bitwisexorassign_token = logicalxorassign_token - 1 + public const leftbrace_token = bitwisexorassign_token - 1 + public const bitwiseor_token = leftbrace_token - 1 + public const logicalor_token = bitwiseor_token - 1 + public const logicalorassign_token = logicalor_token - 1 + public const bitwiseorassign_token = logicalorassign_token - 1 + public const rightbrace_token = bitwiseorassign_token - 1 + public const bitwisenot_token = rightbrace_token - 1 + public const plus_token = bitwisenot_token - 1 + public const plusplus_token = plus_token - 1 + public const plusassign_token = plusplus_token - 1 + public const lessthan_token = plusassign_token - 1 + public const leftshift_token = lessthan_token - 1 + public const leftshiftassign_token = leftshift_token - 1 + public const lessthanorequals_token = leftshiftassign_token - 1 + public const assign_token = lessthanorequals_token - 1 + public const minusassign_token = assign_token - 1 + public const equals_token = minusassign_token - 1 + public const strictequals_token = equals_token - 1 + public const greaterthan_token = strictequals_token - 1 + public const greaterthanorequals_token = greaterthan_token - 1 + public const rightshift_token = greaterthanorequals_token - 1 + public const rightshiftassign_token = rightshift_token - 1 + public const unsignedrightshift_token = rightshiftassign_token - 1 + public const unsignedrightshiftassign_token = unsignedrightshift_token - 1 + public const as_token = unsignedrightshiftassign_token - 1 + public const break_token = as_token - 1 + public const call_token = break_token - 1 + public const case_token = call_token - 1 + public const cast_token = case_token - 1 + public const catch_token = cast_token - 1 + public const class_token = catch_token - 1 + public const const_token = class_token - 1 + public const continue_token = const_token - 1 + public const debugger_token = continue_token - 1 + public const default_token = debugger_token - 1 + public const delete_token = default_token - 1 + public const do_token = delete_token - 1 + public const dynamic_token = do_token - 1 + public const each_token = dynamic_token - 1 + public const else_token = each_token - 1 + public const enum_token = else_token - 1 + public const extends_token = enum_token - 1 + public const false_token = extends_token - 1 + public const final_token = false_token - 1 + public const finally_token = final_token - 1 + public const for_token = finally_token - 1 + public const function_token = for_token - 1 + public const get_token = function_token - 1 + public const goto_token = get_token - 1 + public const if_token = goto_token - 1 + public const implements_token = if_token - 1 + public const import_token = implements_token - 1 + public const in_token = import_token - 1 + public const include_token = in_token - 1 + public const instanceof_token = include_token - 1 + public const interface_token = instanceof_token - 1 + public const internal_token = interface_token - 1 + public const intrinsic_token = internal_token - 1 + public const is_token = intrinsic_token - 1 + public const let_token = is_token - 1 + public const namespace_token = let_token - 1 + public const native_token = namespace_token - 1 + public const new_token = native_token - 1 + public const null_token = new_token - 1 + public const override_token = null_token - 1 + public const package_token = override_token - 1 + public const private_token = package_token - 1 + public const protected_token = private_token - 1 + public const prototype_token = protected_token - 1 + public const public_token = prototype_token - 1 + public const return_token = public_token - 1 + public const set_token = return_token - 1 + public const static_token = set_token - 1 + public const super_token = static_token - 1 + public const switch_token = super_token - 1 + public const this_token = switch_token - 1 + public const throw_token = this_token - 1 + public const to_token = throw_token - 1 + public const true_token = to_token - 1 + public const try_token = true_token - 1 + public const type_token = try_token - 1 + public const typeof_token = type_token - 1 + public const use_token = typeof_token - 1 + public const var_token = use_token - 1 + public const void_token = var_token - 1 + public const while_token = void_token - 1 + public const with_token = while_token - 1 + public const xml_token = with_token - 1 + public const yield_token = xml_token - 1 + public const identifier_token = yield_token - 1 + public const numberliteral_token = identifier_token - 1 + public const regexpliteral_token = numberliteral_token - 1 + public const stringliteral_token = regexpliteral_token - 1 + public const xmlliteral_token = stringliteral_token - 1 + public const xmlpart_token = xmlliteral_token - 1 + public const xmlmarkup_token = xmlpart_token - 1 + public const xmltext_token = xmlmarkup_token - 1 + public const xmltagendend_token = xmltext_token - 1 + public const xmltagstartend_token = xmltagendend_token - 1 + public const attributeidentifier_token = xmltagstartend_token - 1 + public const doccomment_token = attributeidentifier_token - 1 + public const blockcomment_token = doccomment_token - 1 + public const slashslashcomment_token = blockcomment_token - 1 + public const packageidentifier_token = slashslashcomment_token - 1 + + public const eol_token = packageidentifier_token - 1 + public const whitespace_token = eol_token - 1 + + public const empty_token = whitespace_token - 1 + public const error_token = empty_token - 1 + public const last_token = empty_token - 1 + + public const tokenNames = [ + "", + "end of program", + "minus", + "minusminus", + "not", + "notequals", + "strictnotequals", + "modulus", + "modulusassign", + "bitwiseand", + "logicaland", + "logicalandassign", + "bitwiseandassign", + "leftparen", + "rightparen", + "mult", + "multassign", + "comma", + "dot", + "doubledot", + "tripledot", + "leftdotangle", + "div", + "divassign", + "colon", + "doublecolon", + "semicolon", + "questionmark", + "at", + "leftbracket", + "rightbracket", + "bitwisexor", + "logicalxor", + "logicalxorassign", + "bitwisexorassign", + "leftbrace", + "bitwiseor", + "logicalor", + "logicalorassign", + "bitwiseorassign", + "rightbrace", + "bitwisenot", + "plus", + "plusplus", + "plusassign", + "lessthan", + "leftshift", + "leftshiftassign", + "lessthanorequals", + "assign", + "minusassign", + "equals", + "strictequals", + "greaterthan", + "greaterthanorequals", + "rightshift", + "rightshiftassign", + "unsignedrightshift", + "unsignedrightshiftassign", + "as", + "break", + "call", + "case", + "cast", + "catch", + "class", + "const", + "continue", + "debugger", + "default", + "delete", + "do", + "dynamic", + "each", + "else", + "enum", + "extends", + "false", + "final", + "finally", + "for", + "function", + "get", + "goto", + "if", + "implements", + "import", + "in", + "include", + "instanceof", + "interface", + "internal", + "intrinsic", + "is", + "let", + "namespace", + "native", + "new", + "null", + "override", + "package", + "private", + "protected", + "prototype", + "public", + "return", + "set", + "static", + "super", + "switch", + "this", + "throw", + "to", + "true", + "try", + "type", + "typeof", + "use", + "var", + "void", + "while", + "with", + "xml", + "yield", + "identifier", + "numberliteral", + "regexpliteral", + "stringliteral", + "xmlliteral", + "xmlpart", + "xmlmarkup", + "xmltext", + "xmltagendend", + "xmltagstartend", + "attributeidentifier", + "docComment", + "blockComment", + "slashslashcomment", + "packageidentifier", + + "", + "", + "", + "", + "abbrev_mode", + "full_mode" + ] + + class Token + { + var kind + var utf8id + function Token(kind,utf8id) + { + this.kind = kind + this.utf8id = utf8id + } + } + + class Scanner + { + + private const lexemePattern = /<<=|>>=|>>>=|\^=|\^\^=|[|]=|[|][|]=|\/=|-=|\+=|\&\&=|\&=|\%=|\*=|===|\!==|\!=|==|>=|<=|&&|\^\^|\|\||[.][.][.]?|\+\+|--|>>>|<<|>>|::|\.<|[a-zA-Z_][a-zA-Z_0-9]*|-?[0-9]+|'[^']*'|"[^"]*"|\n|./g + private var lexemeSequence + private var index + private const tokenInstances = [null] + private var lastKind + + + const utf8Pool = [] + const qualidPool = [] + + function equals(v1,v2) + { + if( v1 == v2 ) + { + var result = true + } + else + if( v1 is Array && v1.length === v2.length ) + { + var result = true + for( var n = v1.length-1; n>=0; --n ) + { + if( v1[n] != v2[n] ) + { + result = false + } + } + } + else + { + var result = false + } + return result + } + + function poolIndexOf(pool,val) + { + Debug.enter("poolIndexOf",pool,val) + + for( var index:int = pool.length-1; index>=0; --index ) + { + if( equals(pool[index],val) ) + { +//print("found",val) + break + } + } + if( index < 0 ) + { +//print("adding",val) + index = pool.length + pool.push(val) + } + + Debug.exit("poolIndexOf",index) + return index + } + + function utf8IndexOf(val) + { + return poolIndexOf(utf8Pool,val) + } + + function qualidIndexOf(qual,id) + { + Debug.enter("qualidIndexOf",qual,id) + + var qualIndex = poolIndexOf(utf8Pool,qual) // "" means runtime qualified + var idIndex = poolIndexOf(utf8Pool,id) + var index = poolIndexOf(qualidPool,[qualIndex,idIndex]) + + Debug.exit("qualidIndexOf",index) + return index + } + + function printSuffix() + { + print("suffix",lexemeSequence.slice(index)) + } + + + const slash_context = [regexpliteral_token] + + const package_names = { + toString:void 0, + valueOf:void 0, + hasOwnProperty:void 0, + constructor:void 0, + toLocaleString:void 0, + isPrototypeOf:void 0, + propertyIsEnumerable:void 0, + setPropertyIsEnumerable:void 0 + } // zero out inherited prototype names + + function addPackageName(str) + { + package_names[str]=true + } + + private function addToken(kind,text) + { + var result = tokenInstances.length + switch(kind) + { + case stringliteral_token: + text = text.substring(1,text.length-1) + break + default: + break + } + var index = utf8IndexOf(text) + tokenInstances.push(new Token(kind,index)) + return result + } + + function Scanner(src) + { + this.lexemeSequence = src.match(lexemePattern) + //print("lexemes="+lexemeSequence) + this.index = 0 + this.token(true) // prime the token stream + //print("source="+lexemeSequence.join("")) + } + + function isSlashContext(kind) + { + return slash_context[slash_context.length-1] == kind + } + + function count() + { + return this.lexemeSequence.length + } + + function next() + { + do + { + index++ + var kind = token(true) + } + while( kind == whitespace_token || kind == eol_token ) + + return kind + } + + function isPackageNamePrefix(str) + { + if( isSlashContext(regexpliteral_token) ) + for( var name in package_names ) + { + if( name.indexOf(str) === 0 && package_names[name] != void 0 ) // the second condition is to avoid false postives for zeroed names + { + return true + } + } + return false + } + + function isIdentifier(str) + { + return /^[a-zA-Z_][a-zA-Z_0-9]*$/.test(str) + } + + function isPackageName(str) + { + return isSlashContext(regexpliteral_token) && package_names[str] != void 0 + } + + function token(next=false) + { + // if we already have a current token then just return it + + if( !next ) + { + return lastKind + } + + var kind = 0 + + while( lexemeSequence[index] == ' ' || lexemeSequence[index] == '\n' || lexemeSequence[index] == '\t' || + (lexemeSequence[index] == '/' && lexemeSequence[index+1] == '*') || + (lexemeSequence[index] == '/' && lexemeSequence[index+1] == '/') ) + { + + // strip whitespace + while( lexemeSequence[index] == ' ' || lexemeSequence[index] == '\n' || lexemeSequence[index] == '\t' ) index++ + + // strip block comment + if( lexemeSequence[index] == '/' && lexemeSequence[index+1] == '*' ) + { + + while( !(lexemeSequence[index] == '*' && lexemeSequence[index+1] == '/') ) + { + index++ + if( index+1 == lexemeSequence.length ) + { + throw "unterminated block comment" + } + } + index += 2 // move past '*/' + } + + // strip line comment + if( lexemeSequence[index] == '/' && lexemeSequence[index+1] == '/' ) + { + + while( !(lexemeSequence[index] == '\n' || lexemeSequence[index] == void 0) ) + { + index++ + } + } + } + + var lexeme = lexemeSequence[index] + + // first, merge lexemes that need to be merged + + if( isSlashContext(regexpliteral_token) ) + { + switch(lexeme) + { + case '/': + var start_index = index + + while( lexemeSequence[index+1] != '/' ) + { + index++ + lexemeSequence[start_index]+=lexemeSequence[index] + lexemeSequence[index]=' ' + } + index = index + 1 // ** replace with index++ to get verifier error + lexemeSequence[start_index]+=lexemeSequence[index] + lexemeSequence[index]=' ' + + if( lexemeSequence[index+1] != undefined && /^[a-zA-Z][a-zA-Z]*$/.test(lexemeSequence[index+1]) ) // add flags + { + index = index + 1 // ** replace with index++ to get verifier error + lexemeSequence[start_index]+=lexemeSequence[index] + lexemeSequence[index]=' ' + } + lexeme = lexemeSequence[start_index] + break + case '.': + var start_index = index + + // see if we have an integer + if( lexemeSequence[index+1] != null && /-?[0-9]+/.test(lexemeSequence[index+1]) ) + { + index++ + lexemeSequence[start_index]+=lexemeSequence[index] + lexemeSequence[index]=' ' + lexeme = lexemeSequence[start_index] + + // todo: exponents + } + // check for package identifier or number literal + break + case '<': // xml intialiser + break + default: + var start_index = index + + // see if we have an integer possibly followed by a dot possibly followed by another integer + if( lexeme != null && /-?[0-9]+/.test(lexeme) ) + { + if( lexemeSequence[index+1] == '.' ) + { + index++ + lexemeSequence[start_index]+=lexemeSequence[index] + lexemeSequence[index]=' ' + if( lexemeSequence[index+1] != null && /-?[0-9]+/.test(lexemeSequence[index+1]) ) + { + index++ + lexemeSequence[start_index]+=lexemeSequence[index] + lexemeSequence[index]=' ' + } + } + lexeme = lexemeSequence[start_index] + + // todo: exponents + } + else + if( isIdentifier(lexeme) ) // see if it is an identifier that is a prefix of a package name + { + // while lexeme is a prefix of a package name + // and the next two lexemes are dot and identifier + // concat these three lexems to make a temp lexeme + // if temp lexeme is a complete package name, then merge tokens and continue + // + // package p.q {} + // package p.q.r {} + // p.q.r.x + + var start_index = index + var last_index = start_index + while( isPackageNamePrefix(lexeme) && + lexemeSequence[last_index+1] == "." && + isIdentifier(lexemeSequence[last_index+2]) ) + { + lexeme = lexeme+"."+lexemeSequence[last_index+2] + if( isPackageName(lexeme) ) // if its a match, merge + { + lexemeSequence[last_index+2] = lexeme + index = last_index+2 // last match + } + last_index += 2 + } + for( var i = start_index; i': kind = greaterthan_token; break + case '>=': kind = greaterthanorequals_token; break + case '>>': kind = rightshift_token; break + case '>>=': kind = rightshiftassign_token; break + case '>>>': kind = unsignedrightshift_token; break + case '>>>=': kind = unsignedrightshiftassign_token; break + case '^': kind = bitwisexor_token; break + case '^=': kind = bitwisexorassign_token; break + case '^^': kind = logicalxor_token; break + case '^^=': kind = logicalxorassign_token; break + case '|': kind = bitwiseor_token; break + case '|=': kind = bitwiseorassign_token; break + case '||': kind = logicalor_token; break + case '||=': kind = logicalorassign_token; break + case '?': kind = questionmark_token; break + case '(': kind = leftparen_token; break + case ')': kind = rightparen_token; break + case '[': kind = leftbracket_token; break + case ']': kind = rightbracket_token; break + case '{': kind = leftbrace_token; break + case '}': kind = rightbrace_token; break + case '~': kind = bitwisenot_token; break + case '@': kind = at_token; break + case '': kind = xmltagstartend_token; break + + // completely reserved words + + case 'as': kind = as_token; break + case 'break': kind = break_token; break + case 'call': kind = call_token; break + case 'case': kind = case_token; break + case 'cast': kind = cast_token; break + case 'catch': kind = catch_token; break + case 'class': kind = class_token; break + case 'const': kind = const_token; break + case 'continue': kind = continue_token; break + case 'default': kind = default_token; break + case 'delete': kind = delete_token; break + case 'do': kind = do_token; break + case 'else': kind = else_token; break + case 'enum': kind = enum_token; break + case 'extends': kind = extends_token; break + case 'false': kind = false_token; break + case 'finally': kind = finally_token; break + case 'for': kind = for_token; break + case 'function': kind = function_token; break + case 'if': kind = if_token; break + case 'implements': kind = implements_token; break + case 'import': kind = import_token; break + case 'in': kind = in_token; break + case 'instanceof': kind = instanceof_token; break + case 'interface': kind = interface_token; break + case 'internal': kind = internal_token; break + case 'intrinsic': kind = intrinsic_token; break + case 'is': kind = is_token; break + case 'let': kind = let_token; break + case 'native': kind = native_token; break + case 'new': kind = new_token; break + case 'null': kind = null_token; break + case 'package': kind = package_token; break + case 'private': kind = private_token; break + case 'protected': kind = protected_token; break + case 'public': kind = public_token; break + case 'return': kind = return_token; break + case 'super': kind = super_token; break + case 'switch': kind = switch_token; break + case 'this': kind = this_token; break + case 'throw': kind = throw_token; break + case 'to': kind = to_token; break + case 'true': kind = true_token; break + case 'try': kind = try_token; break + case 'typeof': kind = typeof_token; break + case 'use': kind = use_token; break + case 'var': kind = var_token; break + case 'while': kind = while_token; break + case 'with': kind = with_token; break + case 'yield': kind = yield_token; break; + + // contextually reserved words + + case 'debugger': kind = debugger_token; break + case 'dynamic': kind = dynamic_token; break + case 'each': kind = each_token; break + case 'final': kind = final_token; break + case 'get': kind = get_token; break + case 'goto': kind = goto_token; break + case 'include': kind = include_token; break + case 'namespace': kind = namespace_token; break + case 'native': kind = native_token; break + case 'override': kind = override_token; break + case 'prototype': kind = prototype_token; break + case 'set': kind = set_token; break + case 'static': kind = static_token; break + case 'type': kind = type_token; break + case 'xml': kind = xml_token; break + + // identifiers & literals + + default: + var c0 = lexeme.charAt(0) + if(c0=="'" || c0=='"') + { + kind = addToken(stringliteral_token,lexeme) + } + else + if( isPackageName(lexeme) ) + { + kind = addToken(packageidentifier_token,lexeme) + } + else + if( /^[a-zA-Z_][a-zA-Z_0-9]*$/.test(lexeme) ) + { + kind = addToken(identifier_token,lexeme) // interns and returns index + } + else + if( /^\x2f[^\x2f.]*\x2f/.test(lexeme) ) + { + kind = addToken(regexpliteral_token,lexeme) // interns and returns index + } + else + if( /-?[0-9]*\.?[0-9]+/.test(lexeme) ) + { + kind = addToken(numberliteral_token,lexeme) // interns and returns index + } + else + { + throw "unrecognized lexeme: "+lexeme + } + } + lastKind = kind + //print("found "+tokenText(kind)) + return kind + } + + function tokenKind(n) + { + if( +n != n ) + { + throw "bogus token kind" + } + if( +n <= 0 ) + { + return n + } + else + { + return tokenInstances[n].kind + } + } + + function tokenText(n) + { + if( n <= 0 ) + { + return tokenNames[-n] + } + else + { + var utf8id = tokenInstances[n].utf8id + return utf8Pool[utf8id] + } + } + + function followsNewline() + { + var follows = false + for( var i = index-1; i >= 0; --i ) + { + //print("follows",lexemeSequence[i].charCodeAt(0)) + if( lexemeSequence[i] == "\n" ) + { + follows = true + break + } + else + if( lexemeSequence[i] != " " && + lexemeSequence[i] != "\t" ) + { + break + } + } + return follows + } + } + + public class Parser + { + const abbrevIfElse_mode = else_token // lookahead uses this value. don't change. + const abbrevDoWhile_mode = while_token // ditto. + const abbrevFunction_mode = function_token + const abbrev_mode = last_token-1 + const full_mode = abbrev_mode-1 + + const allowIn_mode = full_mode-1 + const noIn_mode = allowIn_mode-1 + + const catch_parameter_error = 1 + const syntax_xml_error = 2 + + const syntax_error = 7 + const expression_syntax_error = 8 + const syntax_eos_error = 9 + + var scan : Scanner + + public function Parser(src) + { + this.scan = new Scanner(src) + } + + function lookahead(kind) + { + return scan.tokenKind(scan.token()) === kind + } + + function lookaheadSemicolon(mode) + { + if( lookahead(semicolon_token) || + lookahead(eos_token) || + lookahead(rightbrace_token) || + scan.followsNewline() || + mode === abbrev_mode ) + { +// print("semicolon found") + var result = true + } + else + { +// print("semicolon not found") + var result = false + } + + return result + } + + function matchSemicolon(mode) + { + Debug.enter("matchSemicolon",mode) + + if( lookahead(semicolon_token) ) + { +//print("semicolon found") + var result = match(semicolon_token) + } + else + if( lookahead(eos_token) || + lookahead(rightbrace_token) || + scan.followsNewline() || + mode == abbrev_mode ) + { +//print("virtual semicolon found") + var result = semicolon_token + } + else + if( (mode == abbrevIfElse_mode || mode == abbrevDoWhile_mode) && + lookahead(mode) ) + { + var result = semicolon_token + } + else + { + match(semicolon_token) + } + + Debug.exit("matchSemicolon",result) + return result + } + + function lookaheadReservedWord() + { + var result = true + switch( scan.token() ) + { + case as_token: + case break_token: + case case_token: + case cast_token: + case class_token: + case const_token: + case continue_token: + case debugger_token: + case default_token: + case delete_token: + case do_token: + case else_token: + case enum_token: + case extends_token: + case false_token: + case finally_token: + case for_token: + case function_token: + case goto_token: + case if_token: + case implements_token: + case import_token: + case in_token: + case instanceof_token: + case interface_token: +// case internal_token: +// case intrinsic_token: + case is_token: + case let_token: + case native_token: + case new_token: + case null_token: + case package_token: +// case private_token: +// case protected_token: +// case public_token: + case return_token: + case super_token: + case switch_token: + case this_token: + case throw_token: + case to_token: + case true_token: + case try_token: + case typeof_token: + case use_token: + case var_token: + case void_token: + case while_token: + case with_token: + case dynamic_token: + case debugger_token: + case each_token: + case final_token: + case get_token: + case goto_token: + case include_token: + case namespace_token: + case native_token: + case override_token: + case prototype_token: + case set_token: + case static_token: + case type_token: + case xml_token: + case yield_token: + break; + default: result = false + } + return result + } + + function matchReservedWord() + { + var result + switch( scan.token() ) + { + case as_token: result = match(as_token); break + case break_token: result = match(break_token); break + case case_token: result = match(case_token); break + case cast_token: result = match(cast_token); break + case class_token: result = match(class_token); break + case const_token: result = match(const_token); break + case continue_token: result = match(continue_token); break + case debugger_token: result = match(debugger_token); break + case default_token: result = match(default_token); break + case delete_token: result = match(delete_token); break + case do_token: result = match(do_token); break + case else_token: result = match(else_token); break + case enum_token: result = match(enum_token); break + case extends_token: result = match(extends_token); break + case false_token: result = match(false_token); break + case finally_token: result = match(finally_token); break + case for_token: result = match(for_token); break + case function_token: result = match(function_token); break + case goto_token: result = match(goto_token); break + case if_token: result = match(if_token); break + case implements_token: result = match(implements_token); break + case import_token: result = match(import_token); break + case in_token: result = match(in_token); break + case instanceof_token: result = match(instanceof_token); break + case interface_token: result = match(interface_token); break + case internal_token: result = match(internal_token); break + case intrinsic_token: result = match(intrinsic_token); break + case is_token: result = match(is_token); break + case let_token: result = match(let_token); break + case native_token: result = match(native_token); break + case new_token: result = match(new_token); break + case null_token: result = match(null_token); break + case package_token: result = match(package_token); break + case private_token: result = match(private_token); break + case protected_token: result = match(protected_token); break + case public_token: result = match(public_token); break + case return_token: result = match(return_token); break + case super_token: result = match(super_token); break + case switch_token: result = match(switch_token); break + case this_token: result = match(this_token); break + case throw_token: result = match(throw_token); break + case to_token: result = match(to_token); break + case true_token: result = match(true_token); break + case try_token: result = match(try_token); break + case typeof_token: result = match(typeof_token); break + case use_token: result = match(use_token); break + case with_token: result = match(with_token); break + case var_token: result = match(var_token); break + case void_token: result = match(void_token); break + case while_token: result = match(while_token); break + case with_token: result = match(with_token); break + case dynamic_token: result = match(dynamic_token); break + case debugger_token: result = match(debugger_token); break + case each_token: result = match(each_token); break + case final_token: result = match(final_token); break + case get_token: result = match(get_token); break + case goto_token: result = match(goto_token); break + case include_token: result = match(include_token); break + case namespace_token: result = match(namespace_token); break + case native_token: result = match(native_token); break + case override_token: result = match(override_token); break + case prototype_token: result = match(prototype_token); break + case set_token: result = match(set_token); break + case static_token: result = match(static_token); break + case type_token: result = match(type_token); break + case xml_token: result = match(xml_token); break + case yield_token: result = match(yield_token); break + default: result = false + } + return result + } + + + function match(kind) + { + var tid = scan.token() + if( kind == scan.tokenKind(tid) ) + { +//print("match =",scan.tokenText(tid)) + //scan.printSuffix() + scan.next() + return tid + } + throw "syntax error: expecting "+scan.tokenText(kind)+", found "+ scan.tokenText(scan.tokenKind(tid)) + } + + function enterSlashContext(goal) + { + scan.slash_context.push(goal); + //print("entering slash context "+scan.slash_context) + } + + function exitSlashContext(goal) + { + if( scan.slash_context[scan.slash_context.length-1] != goal ) throw "slash context out of sync" + scan.slash_context.pop(); + //print("exiting slash context "+scan.slash_context) + } + + // Parse rountines + + /* + + Identifier + Identifier + call + debugger + dynamic + each + final + get + goto + include + namespace + native + override + prototype + set + static + type + xml + + */ + + public function parseIdentifier() + { + Debug.enter("parseIdentifier") + + if( lookahead(call_token) ) var name = scan.tokenText(match(call_token)) + else if( lookahead(debugger_token) ) var name = scan.tokenText(match(debugger_token)) + else if( lookahead(dynamic_token) ) var name = scan.tokenText(match(dynamic_token)) + else if( lookahead(each_token) ) var name = scan.tokenText(match(each_token)) + else if( lookahead(final_token) ) var name = scan.tokenText(match(final_token)) + else if( lookahead(get_token) ) var name = scan.tokenText(match(get_token)) + else if( lookahead(goto_token) ) var name = scan.tokenText(match(goto_token)) + else if( lookahead(include_token) ) var name = scan.tokenText(match(include_token)) + else if( lookahead(namespace_token) ) var name = scan.tokenText(match(namespace_token)) + else if( lookahead(native_token) ) var name = scan.tokenText(match(native_token)) + else if( lookahead(override_token) ) var name = scan.tokenText(match(override_token)) + else if( lookahead(prototype_token) ) var name = scan.tokenText(match(prototype_token)) + else if( lookahead(set_token) ) var name = scan.tokenText(match(set_token)) + else if( lookahead(static_token) ) var name = scan.tokenText(match(static_token)) + else if( lookahead(type_token) ) var name = scan.tokenText(match(type_token)) + else if( lookahead(xml_token) ) var name = scan.tokenText(match(xml_token)) + else var name = scan.tokenText(match(identifier_token)) + + var result = + + Debug.exit("parseIdentifier",result) + return result + } + + /* + PropertyIdentifier + Identifier + * + */ + + function parsePropertyIdentifier() + { + Debug.enter("parsePropertyIdentifier") + var result + if( lookahead( mult_token ) ) + { + match( mult_token ); + result = + } + else + { + result = parseIdentifier() + } + Debug.exit("parsePropertyIdentifier",result.toXMLString()) + return result + } + + /* + Qualifier + ReservedNamespace + PropertyIdentifier + */ + + function parseQualifier() + { + Debug.enter("parseQualifier") + + if( lookahead(internal_token) || lookahead(intrinsic_token) || + lookahead(private_token) || lookahead(protected_token) || + lookahead(public_token) ) + { + var result = parseReservedNamespace() + } + else + { + var result = parsePropertyIdentifier() + } + + Debug.exit("parseQualifier",result) + return result + } + + /* + ReservedNamespace + internal + intrinsic + private + protected + public + */ + + function parseReservedNamespace() + { + Debug.enter("parseReservedNamespace") + + if( lookahead( internal_token ) ) + { + match( internal_token ) + var result = + } + else + if( lookahead( intrinsic_token ) ) + { + match( intrinsic_token ) + var result = + } + else + if( lookahead( private_token ) ) + { + match( private_token ) + var result = + } + else + if( lookahead( protected_token ) ) + { + match( protected_token ) + var result = + } + else + if( lookahead( public_token ) ) + { + match( public_token ) + if( inClassBody() ) + { + var public_namespace_name = "" + } + else + { + var public_namespace_name = current_package + } + var result = + } + + Debug.exit("parseReservedNamespace",result) + return result + } + + /* + SimpleQualifiedIdentifier + PropertyIdentifier + Qualifier :: PropertyIdentifier + Qualifier :: Brackets + */ + + function parseSimpleQualifiedIdentifier() + { + Debug.enter("parseSimpleQualifiedIdentifier") + + var first = parseQualifier() + if( first.name() == "ReservedNamespace" ) + { + match(doublecolon_token); + if( lookahead(leftbracket_token) ) // @ns::[expr] + { + var second = parseBrackets(); + var result = {first}{second} + } + else + { + var second = parsePropertyIdentifier() + var result = {first}{second} + } + } + else + if( lookahead(doublecolon_token) ) + { + match(doublecolon_token); + + first = {first} + + if( lookahead(leftbracket_token) ) // @ns::[expr] + { + var second = parseBrackets(); + var result = {first}{second} + } + else + { + var second = parsePropertyIdentifier() + var result = {first}{second} + } + } + else + { + var result = first; + } + + Debug.exit("parseSimpleQualifiedIdentifier",result) + return result + } + + /* + ExpressionQualifiedIdentifier + ParenListExpression :: PropertyIdentifier + ParenListExpression :: Brackets + */ + + function parseExpressionQualifiedIdentifier() + { + Debug.enter("parseExpressionQualifiedIdentifier") + + var first = parseParenListExpression() + match(doublecolon_token) + if( lookahead(leftbracket_token) ) + { + var second = parseBrackets() + var result = {first}{second} + } + else + { + var second = parsePropertyIdentifier() + var result = {first}{second} + } + + Debug.exit("parseExpressionQualifiedIdentifier",result) + return result + } + + /* + NonAttributeQualifiedIdentifier + SimpleQualifiedIdentifier + ExpressionQualifiedIdentifier + */ + + function parseNonAttributeQualifiedIdentifier() + { + Debug.enter("parseNonAttributeQualifiedIdentifier") + + if( lookahead(leftparen_token) ) + { + var result = parseExpressionQualifiedIdentifier() + } + else + { + var result = parseSimpleQualifiedIdentifier(); + } + + Debug.exit("parseNonAttributeQualifiedIdentifier",result) + return result + } + + /* + AttributeQualifiedIdentifier + @ Brackets + @ NonAttributeQualifiedIdentifier + */ + + function parseAttributeIdentifier() + { + Debug.enter("parseAttributeIdentifier") + + match(at_token) + if( lookahead(leftbracket_token) ) + { + var result = parseBrackets() + } + else + { + var result = parseNonAttributeQualifiedIdentifier() + } + result.@is_attr="true" + + Debug.exit("parseAttributeIdentifier",result) + return result + } + + /* + QualifiedIdentifier + PackageIdentifier . Identifier + NonAttributeQualifiedIdentifier + */ + + function parseQualifiedIdentifier() + { + Debug.enter("parseQualifiedIdentifier") + + var is_attr + if( lookahead(at_token) ) + { + var result = parseAttributeIdentifier() + } + else + if( lookahead(packageidentifier_token) ) + { + var pkg_name = scan.tokenText(match(packageidentifier_token)) + var first = + match(dot_token) + var second = parseIdentifier() + var def_name = second.@name + if( !isImported(pkg_name,def_name) ) + { + throw "package qualified reference to unimported name "+pkg_name+"."+def_name + } + var result = {first}{second} + } + else + { + var result = parseNonAttributeQualifiedIdentifier() + } + + Debug.exit("parseQualifiedIdentifier",result) + return result + } + + /* + + SimpleTypeIdentifier + PackageIdentifier . Identifier + NonAttributeQualifiedIdentifier + + ParameterisedTypeIdentifier + SimpleTypeIdentifier + SimpleTypeIdentifier .< TypeExpressionList > + + TypeIdentifier + ParameterisedTypeIdentifier + ParameterisedTypeIdentifier ! + ParameterisedTypeIdentifier ? + + TypeIdentifer may occur wherever a PrimaryExpression may occur. This includes as a base of + a property reference, in a new expression, in a call expression. TypeIdentifiers shall not + be used as the identifier of an object reference (e.g. o.T) + + */ + + function parseSimpleTypeIdentifier() + { + Debug.enter("parseSimpleTypeIdentifier") + + if( lookahead(packageidentifier_token) ) + { + var pkg_name = scan.tokenText(match(packageidentifier_token)) + var first = + match(dot_token) + var second = parseIdentifier() + var def_name = second.@name + + if( !isImported(pkg_name,def_name) ) + { + throw "package qualified reference to unimported name "+pkg_name+"."+def_name + } + var result = {first}{second} + } + else + { + var result = parseNonAttributeQualifiedIdentifier() + } + + Debug.exit("parseSimpleTypeIdentifier",result) + return result + } + + private var rightanglesseen : int = 0 + private var rightanglesneeded : int = 0 + + function parseTypeIdentifier() + { + Debug.enter("parseTypeIdentifier") + + var first = parseSimpleTypeIdentifier() + if( lookahead(leftdotangle_token) ) + { + match(leftdotangle_token) + rightanglesneeded++ + + var second = parseTypeExpressionList() + + if( lookahead(unsignedrightshift_token) ) + { + match(unsignedrightshift_token) + rightanglesseen += 2 + } + else + if( lookahead(rightshift_token) ) + { + match(rightshift_token) + rightanglesseen += 1 + } + else + if( lookahead(greaterthan_token) ) + { + match(greaterthan_token) + } + else + if( rightanglesseen <= rightanglesneeded ) + { + rightanglesseen-- + } + + rightanglesneeded-- + + if( rightanglesneeded < 0 ) + { + throw "too few right angle braces in type identifier" + } + else + if( rightanglesseen > rightanglesneeded || + (rightanglesneeded == 0 && (lookahead(greaterthan_token) || lookahead(rightshift_token) || lookahead(unsignedrightshift_token))) ) + { + throw "too many right angle braces in type identifier" + } + + var result = {first}{second} + } + else + { + var result = first + } + + Debug.exit("parseTypeIdentifier",result) + return result + } + + function parseXMLLiteral() + { + throw "XMLLiteral not implemented" + } + + function parseXMLElement() + { + } + + function parseXMLName(first) + { + } + + function parseXMLAttributes(first) + { + } + + function parseXMLAttribute(first) + { + } + + function parseXMLElementContent(first) + { + } + + function parseParenExpression() + { + Debug.enter("parseParenExpression") + + enterSlashContext(regexpliteral_token) + match(leftparen_token); + var result = parseAssignmentExpression(allowIn_mode) + exitSlashContext(regexpliteral_token) + match(rightparen_token) + + Debug.exit("parseParenExpression",result) + return result + } + + function parseParenListExpression() + { + Debug.enter("parseParenListExpression") + + enterSlashContext(regexpliteral_token) + match( leftparen_token ); + var result = {parseListExpression(allowIn_mode)} + exitSlashContext(regexpliteral_token) + match( rightparen_token ) + + Debug.exit("parseParenListExpression",result) + return result + } + + /* + ParenListOrExpressionQualifiedIdentifier + ParenListExpression + ParenListExpression :: PropertyIdentifier + ParenListExpression :: Brackets + */ + + function parseParenListOrExpressionQualifiedIdentifier() + { + Debug.enter("parseParenListOrExpressionQualifiedIdentifier") + + var first = parseParenListExpression() + if( lookahead(doublecolon_token) ) + { + match(doublecolon_token) + if( lookahead(leftbracket_token) ) + { + var second = parseBrackets() + var result = {first}{second} + } + else + { + var second = parsePropertyIdentifier() + var result = {first}{second} + } + } + else + { + var result = first + } + + Debug.exit("parseParenListOrExpressionQualifiedIdentifier",result) + return result + } + + + /* + + FunctionCommon + FunctionSignature + FunctionSignature Block + + */ + + function parseFunctionCommon(first) + { + Debug.enter("parseFunctionCommon",first) + + var prologue = + var second = parseFunctionSignature(prologue) + + if( !inInterfaceBody() ) + { + slot_context_stack.push("function") + var third = parseBlockStatement(); + slot_context_stack.pop() + prologue.* += third.Prologue.* + var block = third.Block + } + else + { + var block = <> + } + + var node = {first}{second}{prologue}{block} + + if( !inClassBody() ) + { + node.@factory = "true" + } + + Debug.exit("parseFunctionCommon",node) + return node + } + + /* + + FunctionSignature + TypeParameters ( Parameters ) Result + + */ + + function parseFunctionSignature(prologue) + { + Debug.enter("parseFunctionSignature") + + var first = parseTypeParameters() + match(leftparen_token) + var second = parseParameters(prologue) + match(rightparen_token) + var third = parseResultType() + var result = {first}{second}{third} + + Debug.exit("parseFunctionSignature",result) + return result + } + + /* + + TypeParameters + «empty» + .< TypeParameterList > + + */ + + function parseTypeParameters() + { + if( lookahead(leftdotangle_token) ) + { + match(leftdotangle_token) + var first = parseTypeParameterList() + var result = {first} + match(greaterthan_token) + } + else + { + var result = + } + + return result + } + + /* + + TypeParameterList + Identifier + Identifier , TypeParameterList + + */ + + function parseTypeParameterList() + { + Debug.enter("parseTypeParameterList") + + var list = <> + list += parseIdentifier() + while( lookahead(comma_token) ) + { + match(comma_token) + list += parseIdentifier() + } + var result = list + + Debug.exit("parseTypeParameterList",result) + return result + } + + /* + + */ + + function parseParameters(prologue) + { + Debug.enter("parseParameters") + + if( lookahead(rightparen_token) ) + { + var result = + } + else + { + var result = parseNonemptyParameters(<>,prologue) + } + + Debug.exit("parseParameters",result) + return result + } + + /* + + NonemptyParameters + ParameterInit + ParameterInit , NonemptyParameters + RestParameters + + */ + + function isLet(node) + { + if( node.localName() == "LetExpression" || + node.localName() == "YieldExpression" && node.*.length() > 0 || + node.localName() == "ConditionalExpression" && isLet(node.*[2]) ) + { + return true + } + return false + } + + function parseNonemptyParameters(first,prologue) + { + Debug.enter("parseNonemptyParameters",first) + + if( lookahead(tripledot_token) ) + { + first += parseRestParameter() + var result = first + } + else + { + first += parseParameterInit(prologue) + if( lookahead(comma_token) ) + { + if( isLet(first) ) + { + throw "ambiguous syntax, use parens to associate" + } + match(comma_token) + var result = parseNonemptyParameters(first,prologue) + } + else + { + var result = first + } + } + + Debug.exit("parseNonemptyParameters",result) + return result + } + + /* + + ParameterInit + Parameter + Parameter = NonAssignmentExpressionallowIn + + */ + + function parseParameterInit(prologue) + { + Debug.enter("parseParameterInit") + + if( lookahead(const_token) ) + { + var kind = match(const_token); + } + else + { + var kind = var_token; + } + + var typedid = parseTypedIdentifier(allowIn_mode) + + var result = {typedid} + + if( lookahead(assign_token) ) + { + match(assign_token); + var init = parseNonAssignmentExpression(allowIn_mode); + result.Init = init + } + + var temp = makeBinding(,var_token,typedid,init,prologue) + + Debug.exit("parseParameterInit",result) + return result + } + + /* + + */ + + function parseParameter() + { + Debug.enter("parseParameter") + + Debug.exit("parseParameter",result) + return result + } + + /* + + RestParameter + ... + ... ParameterAttributes Identifier + + */ + + function parseRestParameter() + { + Debug.enter("parseRestParameter") + + match(tripledot_token) + if( lookahead(const_token) ) + { + var first = match(const_token); + } + else + { + var first = var_token; + } + + var second = parseIdentifier() + var result = {second} + + Debug.exit("parseRestParameter",result) + return result + } + + /* + + ResultType + «empty» + : void + : TypeExpression + + */ + + function parseResultType() + { + Debug.enter("parseResultType") + + if( lookahead(colon_token) ) + { + match(colon_token) + if( lookahead(void_token) ) + { + match(void_token) + var first = + } + else + { + var first = parseTypeExpression() + } + var result = {first} + } + else + { + var result = + } + + Debug.exit("parseResultType",result) + return result + } + + /* + + */ + + function parseObjectLiteral() + { + Debug.enter("parseObjectLiteral") + + enterSlashContext(regexpliteral_token) + match(leftbrace_token) + if( lookahead(rightbrace_token) ) + { + var first = null + } + else + { + var first = parseFieldListPrime(<>{parseLiteralField()}) + } + exitSlashContext(regexpliteral_token) + match(rightbrace_token) + var result = {first} + + Debug.exit("parseObjectLiteral",result) + return result + } + + /* + + */ + + function parseFieldListPrime(first) + { + Debug.enter("parseFieldListPrime",first) + + if( lookahead(comma_token) ) + { + if( isLet(first) ) + { + throw "ambiguous syntax, use parens to clarify list association" + } + match(comma_token) + var second = parseLiteralField() + var result = parseFieldListPrime(<>{first}{second}) + } + else + { + var result = first + } + + Debug.exit("parseFieldListPrime",result) + return result + } + + /* + + LiteralField + FieldName : AssignmentExpressionallowIn + + */ + + function parseLiteralField() + { + Debug.enter("parseLiteralField") + + var first = parseFieldName() + match(colon_token) + var second = parseAssignmentExpression(allowIn_mode) + var result = {first}{second} + + Debug.exit("parseLiteralField",result) + return result + } + + /* + + FieldName + NonAttributeQualifiedIdentifier + String + Number + ParenExpression + ReservedIdentifier + ContextuallyReservedIdentifier + + */ + + function parseFieldName() + { + Debug.enter("parseFieldName") + + if( lookahead(stringliteral_token) ) + { + result = + } + else if( lookahead(numberliteral_token) ) + { + result = + } + else if( lookahead(leftparen_token) ) + { + var result = parseParenExpression(); + } + else + if( lookahead( lookaheadReservedWord) ) + { + var result = {scan.tokenText(matchReservedWord())} + } + else + { + var result = parseNonAttributeQualifiedIdentifier(); + } + + Debug.exit("parseFieldName",result) + return result + } + + /* + + ArrayLiteral + [ ElementList ] + + ElementList + «empty» + LiteralElement + , ElementList + LiteralElement , ElementList + + LiteralElement + AssignmentExpressionallowIn + + */ + + function parseArrayLiteral() + { + Debug.enter("parseArrayLiteral") + + enterSlashContext(regexpliteral_token) + match(leftbracket_token) + if( lookahead(rightbracket_token) ) + { + var first = <> + } + else + { + var temp = parseLiteralElement() + var first = parseElementListPrime(<>{temp}) + } + exitSlashContext(regexpliteral_token) + match(rightbracket_token) + var result = {first} + + Debug.exit("parseArrayLiteral",result) + return result + } + + function parseElementListPrime(first) + { + Debug.enter("parseElementListPrime",first) + + while( lookahead(comma_token) ) + { + if( isLet(first) ) + { + throw "ambiguous syntax, use parens to clarify list association" + } + match(comma_token) + var second = parseLiteralElement() + if( second == null ) + { + // do nothing + } + else + { + var first = <>{first}{second} + } + } + var result = first + + Debug.exit("parseElementListPrime",result) + return result + } + + function parseLiteralElement() + { + Debug.enter("parseLiteralElement") + + if( lookahead(comma_token) ) + { + var result = + } + else + if( lookahead(rightbracket_token) ) + { + var result = null + } + else + { + var result = parseAssignmentExpression(allowIn_mode) + } + + Debug.exit("parseLiteralElement",result) + return result + } + + function parseCastExpression() + { + Debug.enter("parseCastExpression") + + if( lookahead(cast_token) ) + { + match(cast_token) + var first = parseTypeExpression() + var second = parseParenListExpression() + var result = {first}{second} + } + else + if( lookahead(to_token) ) + { + match(to_token) + var first = parseTypeExpression() + var second = parseParenListExpression() + var result = {first}{second} + } + + Debug.exit("parseCastExpression",result) + return result + } + + /* + + PrimaryExpression + null + true + false + Number + String + this + RegularExpression + TypeIdentifier + AttributeQualifiedIdentifier + XMLInitialiser + ParenListExpression + ArrayLiteral + ObjectLiteral + FunctionExpression + cast TypeExpression ParenListExpression + + */ + + function parsePrimaryExpression() + { + Debug.enter("parsePrimaryExpression") + + if( lookahead(null_token) ) + { + match(null_token) + var result = + } + else + if( lookahead(true_token) ) + { + match(true_token) + var result = + } + else + if( lookahead(false_token) ) + { + match(false_token) + var result = + } + else + if( lookahead(numberliteral_token) ) + { + var result = + } + else + if( lookahead(stringliteral_token) ) + { + var result = + } + else + if( lookahead(this_token) ) + { + match(this_token) + var result = + } + else + if( lookahead(regexpliteral_token) ) + { + var result = + } + else + if( lookahead(function_token) ) + { + match(function_token); + var first = null + if( lookahead(identifier_token) ) + { + first = parseIdentifier(); + } + var result = parseFunctionCommon(first); + } + else + if( lookahead(leftparen_token) ) + { + var result = parseParenListOrExpressionQualifiedIdentifier() + } + else + if( lookahead(leftbracket_token) ) + { + var result = parseArrayLiteral() + } + else + if( lookahead(leftbrace_token) ) + { + var result = parseObjectLiteral() + } + else + if( lookahead(cast_token) || lookahead(to_token) ) + { + var result = parseCastExpression() + } + else + if( lookahead(at_token) ) + { + var temp = parseAttributeIdentifier() + var result = {temp} + } + else + { + var temp = parseTypeIdentifier() + var result = {temp} + } + + Debug.exit("parsePrimaryExpression",result) + return result + } + + /* + + SuperExpression + super + super Arguments + + */ + + function parseSuperExpression() + { + Debug.enter("parseSuperExpression") + + match(super_token) + var first = + if( lookahead(leftparen_token) ) + { + var result = parseArguments(first) + } + else + { + var result = first + } + + Debug.exit("parseSuperExpression",result) + return result + } + + /* + + MemberExpression + PrimaryExpression + new MemberExpression Arguments + SuperExpression PropertyOperator + MemberExpression PropertyOperator + + Refactored: + + MemberExpression : + PrimaryExpression MemberExpressionPrime + new MemberExpression Arguments MemberExpressionPrime + SuperExpression PropertyOperator MemberExpressionPrime + + MemberExpressionPrime : + [ Expression ] MemberExpressionPrime + . Identifier MemberExpressionPrime + «empty» + + */ + + function parseMemberExpression() + { + Debug.enter("parseMemberExpression") + + if( lookahead(new_token) ) + { + match(new_token) + var first = parseMemberExpression() + if( lookahead(leftparen_token) ) + { + var first = parseArguments(first) + if( first.name() == "Call" ) + { + first.@is_new = true + } + else + { + first.Call.@is_new = true + } + var is_shortnew = false + } + else + { + if( first.name() == "Get" ) + { + first.setLocalName("Call") + first.args = + first.@is_new = true + } + else + { + first = {first} + } + var is_shortnew = true + } + } + else + if( lookahead(super_token) ) + { + var first = parseSuperExpression() + var first = parsePropertyOperator(first) + } + else + { + var first = parsePrimaryExpression() + } + + if( !is_shortnew ) + while( lookahead(leftbracket_token) || + lookahead(dot_token) || + lookahead(doubledot_token) ) + { + var first = parsePropertyOperator(first) + } + + var result = first + + Debug.exit("parseMemberExpression",result) + return result + } + + /* + + NewExpression + MemberExpression + new NewExpression + + */ + + function parseNewExpression() + { + Debug.enter("parseNewExpression") + + var result = parseMemberExpression() + + Debug.exit("parseNewExpression",result) + return result + } + + /* + + CallExpressionPrime : + Arguments CallExpressionPrime + [ Expression ] CallExpressionPrime + . Identifier CallExpressionPrime + «empty» + + */ + + function parseCallExpressionPrime(first) + { + Debug.enter("parseCallExpressionPrime",first) + + if( lookahead(leftparen_token) ) + { + var second = parseArguments(first) + var result = parseCallExpressionPrime(second) + } + else + if( lookahead(leftbracket_token) || + lookahead(dot_token) || + lookahead(doubledot_token) ) + { + var second = parsePropertyOperator(first) + var result = parseCallExpressionPrime(second) + } + else + { + var result = first + } + + Debug.exit("parseCallExpressionPrime",result) + return result + } + + /* + + PropertyOperator + . QualifiedIdentifier + .. QualifiedIdentifier + . ParenListExpression + . ParenListExpression :: PropertyIdentifier + . ParenListExpression :: Brackets + Brackets + + */ + + function parsePropertyOperator(first) + { + Debug.enter("parsePropertyOperator",first) + + if( lookahead(dot_token) ) + { + match(dot_token) + if( lookahead(leftparen_token) ) + { + var second = parseParenListExpression() + if( lookahead(doublecolon_token) ) + { + match(doublecolon_token) + if( lookahead(leftbracket_token) ) + { + var third = parseBrackets() + var result = {first}{second}{third} + } + else + { + var third = parsePropertyIdentifier() + var result = {first}{second}{third} + } + } + else + { + var result = {first}{second} + } + } + else + if( lookaheadReservedWord() ) + { + var second = {scan.tokenText(matchReservedWord())} + var result = {first}{second} + } + else + { + var second = parseQualifiedIdentifier() + var result = {first}{second} + } + } + else + if( lookahead(doubledot_token) ) + { + match(doubledot_token) + var second = parseQualifiedIdentifier() + var result = {first}{second} + } + else + if( lookahead(leftbracket_token) ) + { + var second = parseBrackets() + var result = {first}{second} + } + + Debug.exit("parsePropertyOperator",result) + return result + } + + /* + + Brackets + [ ] + [ ListExpressionallowIn ] + [ ListExpressionallowIn : ] + [ ListExpressionallowIn : ListExpressionallowIn ] + [ : ListExpressionallowIn ] + + */ + + function parseBrackets() + { + Debug.enter("parseBrackets") + + match(leftbracket_token) + if( lookahead(rightbracket_token) ) + { + var first = null + var second = null + } + else + if( lookahead(colon_token) ) + { + match(colon_token) + var first = null + var second = parseListExpression(allowIn_mode) + } + else + { + var first = parseListExpression(allowIn_mode) + if( lookahead(colon_token) ) + { + match(colon_token) + if( lookahead(rightbracket_token) ) + { + var second = null + } + else + { + var second = parseListExpression(allowIn_mode) + } + } + else + { + } + } + match(rightbracket_token); + var result = {first}{second} + + Debug.exit("parseBrackets",result) + return result + } + + /* + + Arguments + ( ) + ( ListExpressionALLOWIN ) + + */ + + function parseArguments(first) + { + Debug.enter("parseArguments",first) + + enterSlashContext(regexpliteral_token) + match(leftparen_token); + + if( lookahead(rightparen_token) ) + { + var second = <> + } + else + { + var second = parseArgumentList() + } + + exitSlashContext(regexpliteral_token) + match(rightparen_token); + if( first.name() == "Get" ) + { + first.setLocalName("Call") + first.args = {second} + } + else + { + first = {first}{second} + } + var result = first + + Debug.exit("parseArguments",result) + return result + } + + /* + + ArgumentList + + */ + + function parseArgumentList() + { + Debug.enter("parseArgumentList") + + var list = <> + var first = parseAssignmentExpression(allowIn_mode) + list += {first} + while( lookahead( comma_token ) ) + { + if( isLet(first) ) + { + throw "ambiguous syntax, use parens to clarify list association" + } + match( comma_token ); + list += {parseAssignmentExpression(allowIn_mode)} + } + var node = list + + Debug.exit("parseArgumentList",node) + return node + } + + + + /* + + LeftHandSideExpression + NewExpression + CallExpression + + Refactored: + + LeftHandSideExpression + MemberExpression LeftHandSideExpressionPrime + new NewExpression + + LeftHandSideExpressionPrime + Arguments CallExpressionPrime + «empty» + + */ + + function parseLeftHandSideExpression() + { + Debug.enter("parseLeftHandSideExpression") + + if( lookahead(new_token) ) + { + var first = parseNewExpression() + } + else + { + var first = parseMemberExpression() + } + + if( lookahead(leftparen_token) ) + { + var first = parseArguments(first) + var result = parseCallExpressionPrime(first) + } + else + { + var result = first + } + + Debug.exit("parseLeftHandSideExpression",result) + return result + } + + /* + + PostfixExpression + LeftHandSideExpression + LeftHandSideExpression [no line break] ++ + LeftHandSideExpression [no line break] -- + + */ + + function parsePostfixExpression() + { + Debug.enter("parsePostfixExpression") + + var first = parseLeftHandSideExpression() + if( lookahead(plusplus_token) ) + { + match(plusplus_token) + var result = {first} + } + else + if( lookahead(minusminus_token) ) + { + match(minusminus_token) + var result = {first} + } + else + { + var result = first + } + + Debug.exit("parsePostfixExpression",result) + return result + } + + /* + + UnaryExpression + PostfixExpression + delete PostfixExpression + void UnaryExpression + typeof UnaryExpression + ++ PostfixExpression + -- PostfixExpression + + UnaryExpression + - UnaryExpression + ~ UnaryExpression + ! UnaryExpression + + */ + + function parseUnaryExpression() + { + Debug.enter("parseUnaryExpression") + + if( lookahead(delete_token) ) + { + enterSlashContext(regexpliteral_token) + match(delete_token) + + var first = parsePostfixExpression() + if( first.name() == "Get" ) + { + first.setLocalName("Delete") + } + else + { + first = {first} + } + + var result = first + + exitSlashContext(regexpliteral_token) + } + else + if( lookahead(void_token) ) + { + enterSlashContext(regexpliteral_token) + match(void_token) + var first = parsePostfixExpression() + exitSlashContext(regexpliteral_token) + var result = {first} + } + else + if( lookahead(typeof_token) ) + { + enterSlashContext(regexpliteral_token) + match(typeof_token) + var first = parsePostfixExpression() + exitSlashContext(regexpliteral_token) + var result = {first} + } + else + if( lookahead(plusplus_token) ) + { + enterSlashContext(regexpliteral_token) + match(plusplus_token) + var first = parsePostfixExpression() + exitSlashContext(regexpliteral_token) + var result = {first} + } + else + if( lookahead(minusminus_token) ) + { + enterSlashContext(regexpliteral_token) + match(minusminus_token) + var first = parsePostfixExpression() + exitSlashContext(regexpliteral_token) + var result = {first} + } + else + if( lookahead(plus_token) ) + { + enterSlashContext(regexpliteral_token) + match(plus_token) + var first = parsePostfixExpression() + exitSlashContext(regexpliteral_token) + var result = {first} + } + else + if( lookahead(minus_token) ) + { + enterSlashContext(regexpliteral_token) + match(minus_token) + var first = parsePostfixExpression() + exitSlashContext(regexpliteral_token) + var result = {first} + } + else + if( lookahead(bitwisenot_token) ) + { + enterSlashContext(regexpliteral_token) + match(bitwisenot_token) + var first = parsePostfixExpression() + exitSlashContext(regexpliteral_token) + var result = {first} + } + else + if( lookahead(not_token) ) + { + enterSlashContext(regexpliteral_token) + match(not_token) + var first = parsePostfixExpression() + exitSlashContext(regexpliteral_token) + var result = {first} + } + else + { + var result = parsePostfixExpression() + } + + Debug.exit("parseUnaryExpression",result) + return result + } + + /* + + YieldExpression + UnaryExpression + yield UnaryExpression + + */ + + function parseYieldExpression() + { + Debug.enter("parseYieldExpression") + + if( lookahead(yield_token) ) + { + enterSlashContext(regexpliteral_token) + + match(yield_token) + if( !(lookaheadSemicolon(full_mode) || lookahead(rightparen_token) || lookahead(rightbrace_token) || lookahead(comma_token)) ) + { + var first = parseUnaryExpression() + var result = {first} + } + else + { + var result = + } + + exitSlashContext(regexpliteral_token) + } + else + { + var result = parseUnaryExpression() + } + + Debug.exit("parseYieldExpression",result) + return result + } + + /* + + MultiplicativeExpression + UnaryExpression + MultiplicativeExpression * UnaryExpression + MultiplicativeExpression / UnaryExpression + MultiplicativeExpression % UnaryExpression + + */ + + function parseMultiplicativeExpression() + { + Debug.enter("parseMultiplicativeExpression") + + enterSlashContext(div_token) + var first = parseYieldExpression() + exitSlashContext(div_token) + while( true ) + { + if( lookahead(mult_token) ) + { + match(mult_token) + enterSlashContext(div_token) + var second = parseYieldExpression() + exitSlashContext(div_token) + var first = {first}{second} + } + else + if( lookahead(div_token) ) + { + match(div_token) + enterSlashContext(div_token) + var second = parseYieldExpression() + exitSlashContext(div_token) + var first = {first}{second} + } + else + if( lookahead(modulus_token) ) + { + match(modulus_token) + enterSlashContext(div_token) + var second = parseYieldExpression() + exitSlashContext(div_token) + var first = {first}{second} + } + else + { + break // okay, none found + } + } + var result = first + + Debug.exit("parseMultiplicativeExpression",result) + return result + } + + /* + + AdditiveExpression + MultiplicativeExpression + AdditiveExpression + MultiplicativeExpression + AdditiveExpression - MultiplicativeExpression + + */ + + function parseAdditiveExpression() + { + Debug.enter("parseAdditiveExpression") + + var first = parseMultiplicativeExpression() + while( true ) + { + if( lookahead(plus_token) ) + { + match(plus_token) + var second = parseMultiplicativeExpression() + var first = {first}{second} + } + else + if( lookahead(minus_token) ) + { + match(minus_token) + var second = parseMultiplicativeExpression() + var first = {first}{second} + } + else + { + break // okay, none found + } + } + + var result = first + + Debug.exit("parseAdditiveExpression",result) + return result + } + + /* + + ShiftExpression + AdditiveExpression + ShiftExpression << AdditiveExpression + ShiftExpression >> AdditiveExpression + ShiftExpression >>> AdditiveExpression + + + */ + + function parseShiftExpression() + { + Debug.enter("parseShiftExpression") + + var first = parseAdditiveExpression() + while( true ) + { + if( lookahead(leftshift_token) ) + { + match(leftshift_token) + var second = parseAdditiveExpression() + var first = {first}{second} + } + else + if( lookahead(rightshift_token) ) + { + match(rightshift_token) + var second = parseAdditiveExpression() + var first = {first}{second} + } + else + if( lookahead(unsignedrightshift_token) ) + { + match(unsignedrightshift_token) + var second = parseAdditiveExpression() + var first = {first}{second} + } + else + { + break // okay, none found + } + } + var result = first + + Debug.exit("parseShiftExpression",result) + return result + } + + /* + + RelationalExpressionallowIn + ShiftExpression + RelationalExpressionallowIn < ShiftExpression + RelationalExpressionallowIn > ShiftExpression + RelationalExpressionallowIn <= ShiftExpression + RelationalExpressionallowIn >= ShiftExpression + RelationalExpressionallowIn in ShiftExpression + RelationalExpressionallowIn instanceof ShiftExpression + RelationalExpressionallowIn is ShiftExpression + RelationalExpressionallowIn to ShiftExpression + RelationalExpressionallowIn cast ShiftExpression + + */ + + function parseRelationalExpression(mode) + { + Debug.enter("parseRelationalExpression") + + var first = parseShiftExpression() + while( true ) + { + if( lookahead(lessthan_token) ) + { + match(lessthan_token) + var second = parseShiftExpression() + var first = {first}{second} + } + else + if( lookahead(greaterthan_token) ) + { + match(greaterthan_token) + var second = parseShiftExpression() + var first = {first}{second} + } + else + if( lookahead(lessthanorequals_token) ) + { + match(lessthanorequals_token) + var second = parseShiftExpression() + var first = {first}{second} + } + else + if( lookahead(greaterthanorequals_token) ) + { + match(greaterthanorequals_token) + var second = parseShiftExpression() + var first = {first}{second} + } + else + if( mode === allowIn_mode && lookahead(in_token) ) + { + match(in_token) + var second = parseShiftExpression() + var first = {first}{second} + } + else + if( lookahead(instanceof_token) ) + { + match(instanceof_token) + var second = parseShiftExpression() + var first = {first}{second} + } + else + if( lookahead(is_token) ) + { + match(is_token) + var second = parseShiftExpression() + var first = {first}{second} + } + else + if( lookahead(to_token) ) + { + match(to_token) + var second = parseShiftExpression() + var first = {first}{second} + } + else + if( lookahead(cast_token) ) + { + match(cast_token) + var second = parseShiftExpression() + var first = {first}{second} + } + else + { + break // okay, none found + } + } + var result = first + + Debug.exit("parseRelationalExpression",result) + return result + } + + /* + + EqualityExpressionb + RelationalExpressionb + EqualityExpressionb == RelationalExpressionb + EqualityExpressionb != RelationalExpressionb + EqualityExpressionb === RelationalExpressionb + EqualityExpressionb !== RelationalExpressionb + + + */ + + function parseEqualityExpression(mode) + { + Debug.enter("parseEqualityExpression") + + var first = parseRelationalExpression(mode) + while( true ) + { + if( lookahead(equals_token) ) + { + match(equals_token) + var second = parseRelationalExpression(mode) + var first = {first}{second} + } + else + if( lookahead(notequals_token) ) + { + match(notequals_token) + var second = parseRelationalExpression(mode) + var first = {first}{second} + } + else + if( lookahead(strictequals_token) ) + { + match(strictequals_token) + var second = parseRelationalExpression(mode) + var first = {first}{second} + } + else + if( lookahead(strictnotequals_token) ) + { + match(strictnotequals_token) + var second = parseRelationalExpression(mode) + var first = {first}{second} + } + else + { + break // okay, none found + } + } + var result = first + + Debug.exit("parseEqualityExpression",result) + return result + } + + /* + + BitwiseAndExpressionb + EqualityExpressionb + BitwiseAndExpressionrb & EqualityExpressionb + + */ + + function parseBitwiseAndExpression(mode) + { + Debug.enter("parseBitwiseAndExpression") + + var first = parseEqualityExpression(mode) + while( lookahead(bitwiseand_token) ) + { + match(bitwiseand_token) + var second = parseEqualityExpression(mode) + var first = {first}{second} + } + var result = first + + Debug.exit("parseBitwiseAndExpression",result) + return result + } + + /* + + BitwiseXorExpressionb + BitwiseAndExpressionb + BitwiseXorExpressionb ^ BitwiseAndExpressionb + + */ + + function parseBitwiseXorExpression(mode) + { + Debug.enter("parseBitwiseXorExpression") + + var first = parseBitwiseAndExpression(mode) + while( lookahead(bitwisexor_token) ) + { + match(bitwisexor_token) + var second = parseBitwiseAndExpression(mode) + var first = {first}{second} + } + var result = first + + Debug.exit("parseBitwiseXorExpression",result) + return result + } + + /* + + BitwiseOrExpressionb + BitwiseXorExpressionb + BitwiseOrExpressionb | BitwiseXorExpressionb + + */ + + function parseBitwiseOrExpression(mode) + { + Debug.enter("parseBitwiseOrExpression") + + var first = parseBitwiseXorExpression(mode) + while( lookahead(bitwiseor_token) ) + { + match(bitwiseor_token) + var second = parseBitwiseXorExpression(mode) + var first = {first}{second} + } + var result = first + + Debug.exit("parseBitwiseOrExpression",result) + return result + } + + /* + + LogicalAndExpressionb + BitwiseOrExpressionb + LogicalAndExpressionb && BitwiseOrExpressionb + + */ + + function parseLogicalAndExpression(mode) + { + Debug.enter("parseLogicalAndExpression") + + var first = parseBitwiseOrExpression(mode) + while( lookahead(logicaland_token) ) + { + match(logicaland_token) + var second = parseBitwiseOrExpression(mode) + var first = {first}{second} + } + var result = first + + Debug.exit("parseLogicalAndExpression",result) + return result + } + + /* + + LogicalXorExpressionb + LogicalAndExpressionb + LogicalXorExpressionb ^^ LogicalAndExpressionb + + */ + + function parseLogicalXorExpression(mode) + { + Debug.enter("parseLogicalXorExpression") + + var first = parseLogicalAndExpression(mode) + while( lookahead(logicalxor_token) ) + { + match(logicalxor_token) + var second = parseLogicalAndExpression(mode) + var first = {first}{second} + } + var result = first + + Debug.exit("parseLogicalXorExpression",result) + return result + } + + /* + + LogicalOrExpressionb + LogicalXorExpressionb + LogicalOrExpressionallowIn || LogicalXorExpressionb + + */ + + function parseLogicalOrExpression(mode) + { + Debug.enter("parseLogicalOrExpression") + + var first = parseLogicalXorExpression(mode) + while( lookahead(logicalor_token) ) + { + match(logicalor_token) + var second = parsePostfixExpression() //parseLogicalXorExpression(mode) + var first = {first}{second} + } + var result = first + + Debug.exit("parseLogicalOrExpression",result) + return result + } + + /* + + + + */ + + function parseConditionalExpression(mode) + { + Debug.enter("parseConditionalExpression",mode) + + var result + var first + + first = parseLogicalOrExpression(mode) + + if( lookahead(questionmark_token) ) + { + match(questionmark_token); + var second; + var third; + second = parseAssignmentExpression(mode); + match(colon_token); + third = parseAssignmentExpression(mode); + result = {first}{second}{third} + } + else + { + result = first + } + + Debug.exit("parseConditionalExpression",result) + return result + } + + /* + + + + */ + + function parseNonAssignmentExpression(mode) + { + Debug.enter("parseNonAssignmentExpression",mode) + + //var first = parseLogicalOrExpression(mode) + var first = parsePostfixExpression() + + if( lookahead(questionmark_token) ) + { + match(questionmark_token); + var second = parseNonAssignmentExpression(mode); + match(colon_token); + var third = parseNonAssignmentExpression(mode); + var result = {first}{second}{third} + } + else + { + var result = first + } + + Debug.exit("parseNonAssignmentExpression",result) + return result + } + + /* + + AssignmentExpressionb + ConditionalExpressionb + LetExpressionb + YieldExpressionb + PostfixExpression = AssignmentExpressionb + PostfixExpression CompoundAssignment AssignmentExpressionb + PostfixExpression LogicalAssignment AssignmentExpressionb + + CompoundAssignment + *= + /= + %= + += + -= + <<= + >>= + >>>= + &= + ^= + |= + + LogicalAssignment + &&= + ^^= + ||= + */ + + function parseAssignmentExpression(mode) + { + Debug.enter("parseAssignmentExpression",mode) + + if( lookahead(let_token) ) + { + var result = parseLetExpression(mode) + } + else + { + var first = parseConditionalExpression(mode) + var found = lookahead(assign_token) ? match(assign_token) : + lookahead(multassign_token) ? match(multassign_token) : + lookahead(divassign_token) ? match(divassign_token) : + lookahead(modulusassign_token) ? match(modulusassign_token) : + lookahead(plusassign_token) ? match(plusassign_token) : + lookahead(minusassign_token) ? match(minusassign_token) : + lookahead(leftshiftassign_token) ? match(leftshiftassign_token) : + lookahead(rightshiftassign_token) ? match(rightshiftassign_token) : + lookahead(unsignedrightshiftassign_token) ? match(unsignedrightshiftassign_token) : + lookahead(bitwiseandassign_token) ? match(bitwiseandassign_token) : + lookahead(bitwisexorassign_token) ? match(bitwisexorassign_token) : + lookahead(bitwiseorassign_token) ? match(bitwiseorassign_token) : + lookahead(logicalandassign_token) ? match(logicalandassign_token) : + lookahead(logicalxorassign_token) ? match(logicalxorassign_token) : + lookahead(logicalorassign_token) ? match(logicalorassign_token) : empty_token; + + if( found != empty_token ) + { + if( first.name() != "Get" && + first.name() != "Call" && + first.name() != "Set" ) + { + throw "invalid expression on left side of assignment" + } + + var second = parseAssignmentExpression(mode) + + if( first.name() == "Get" ) + { + first.setLocalName("Set") + first.value = {second} + } + else + { + first = {first}{second} + } + var result = first + } + else + { + var result = first + } + } + + Debug.exit("parseAssignmentExpression",result) + return result + } + + function parseAssignmentExpressionSuffix(mode, first) + { + } + + /* + + LetExpressionb + let ( LetBindingList ) AssignmentExpressionb + + LetBindingList + «empty» + NonemptyLetBindingList + + NonemptyLetBindingList + VariableBinding + VariableBinding , NonemptyLetBindingList + + */ + + function parseLetExpression(mode) + { + Debug.enter("parseLetExpression") + + var prologue = + match(let_token) + match(leftparen_token) + if( lookahead(rightparen_token) ) + { + var first = <> + } + else + { + var first = <> + first += parseVariableBinding(,var_token,allowIn_mode,prologue) + while( lookahead(comma_token) ) + { + match(comma_token) + first += parseVariableBinding(,var_token,allowIn_mode,prologue) + } + prologue.* += first + } + match(rightparen_token) + var second = parseAssignmentExpression(mode) + var result = {prologue}{second} + + Debug.exit("parseLetExpression",result) + return result + } + + /* + + YieldExpressionb + yield AssignmentExpressionb + + */ + +/* + function parseYieldExpression(mode) + { + Debug.enter("parseYieldExpression") + + Debug.exit("parseYieldExpression",result) + return result + } +*/ + /* + + DestructuringAssignmentExpression + DestructuringPattern = AssignmentExpressionb + + */ + + function parseDestructuringAssignmentExpression(mode) + { + Debug.enter("parseDestructuringAssignmentExpression",mode) + + var first = parseDestructuringPattern() + match(assign_token) + var second = parseAssignmentExpression(mode) + var result = {first}{second} + + Debug.exit("parseDestructuringAssignmentExpression",result) + return result + } + + /* + + DestructuringPattern + DestructuringObjectPattern + DestructuringArrayPattern + + */ + + function parseDestructuringPattern() + { + Debug.enter("parseDestructuringPattern") + + if( lookahead(leftbrace_token) ) + { + var result = parseDestructuringObjectPattern() + } + else + if( lookahead(leftbracket_token ) ) + { + var result = parseDestructuringArrayPattern() + } + else + { + throw "expecting destrcturing pattern" + } + + Debug.exit("parseDestructuringPattern",result) + return result + } + + /* + + DestructuringObjectPattern + { DestructuringFieldList } + + DestructuringFieldList + DestructuringField + DestructuringFieldList , DestructuringField + + */ + + function parseDestructuringObjectPattern() + { + Debug.enter("parseDestructuringObjectPattern") + + enterSlashContext(regexpliteral_token) + match(leftbrace_token) + var first = <> + first += parseDestructuringField() + while( lookahead(comma_token) ) + { + match(comma_token) + first += parseDestructuringField() + } + match(rightbrace_token) + exitSlashContext(regexpliteral_token) + var result = {first} + + Debug.exit("parseDestructuringObjectPattern",result) + return result + } + + /* + + DestructuringField + NonAttributeQualifiedIdentifier : DestructuringPattern + NonAttributeQualifiedIdentifier : PostfixExpression + + */ + + function parseDestructuringField() + { + Debug.enter("parseDestructuringField") + + var first = parseNonAttributeQualifiedIdentifier() + match(colon_token) + if( lookahead(leftbrace_token) || lookahead(leftbracket_token) ) + { + var second = parseDestructuringPattern() + var result = {first}{second} + } + else + { + var second = parsePostfixExpression() + var result = {first}{second} + } + + Debug.exit("parseDestructuringField",result) + return result + } + + /* + + DestructuringArrayPattern + [ DestructuringElementList ] + + DestructuringElementList + «empty» + DestructuringElement + , DestructuringElementList + DestructuringElement , DestructuringElementList + + */ + + function parseDestructuringArrayPattern() + { + Debug.enter("parseDestructuringArrayPattern") + + enterSlashContext(regexpliteral_token) + match(leftbracket_token) + if( lookahead(rightbracket_token) ) + { + var first = <> + } + else + { + var first = <> + first += parseDestructuringElement() + while( lookahead(comma_token) ) + { + match(comma_token) + if( lookahead(rightbracket_token) ) + { + // do nothing, we're done + } + else + { + first += parseDestructuringElement() + } + } + } + match(rightbracket_token) + exitSlashContext(regexpliteral_token) + var result = {first} + + Debug.exit("parseDestructuringArrayPattern",result) + return result + } + + /* + + DestructuringElement + «empty» + DestructuringPattern + PostfixExpression + + */ + + function parseDestructuringElement() + { + Debug.enter("parseDestructuringElement") + + if( lookahead(comma_token) ) + { + var result = + } + else + if( lookahead(leftbrace_token) || lookahead(leftbracket_token) ) + { + var result = parseDestructuringPattern() + } + else + { + var result = parseAssignmentExpression(allowIn_mode) + } + + Debug.exit("parseDestructuringElement",result) + return result + } + + /* + + ListExpression + + */ + + function parseListExpression(mode) + { + Debug.enter("parseListExpression",mode) + + var list = <> + list += parseAssignmentExpression(mode) + while( lookahead( comma_token ) ) + { + match( comma_token ); + list += parseAssignmentExpression(mode) + } + var node = list + + Debug.exit("parseListExpression",node) + return node + } + + function parseListExpressionPrime(first,mode) + { + Debug.enter("parseListExpressionPrime",mode) + + var list = <> + list += first + while( lookahead( comma_token ) ) + { + match( comma_token ); + list += parseAssignmentExpression(mode) + } + var node = list + + Debug.exit("parseListExpressionPrime",node) + return node + } + + // TYPE EXPRESSIONS + + /* + + TypeExpression + TypeIdentifier + function FunctionSignature + ( TypeExpressionList ) + { FieldTypeList } + [ ElementTypeList ] + + */ + + function parseTypeExpression() + { + Debug.enter("parseTypeExpression") + + var prologue = + + if( lookahead(function_token) ) + { + match(function_token) + var result = parseFunctionSignature(prologue) + } + else + if( lookahead(leftparen_token) ) + { + var result = parseUnionType() + } + else + if( lookahead(leftbrace_token) ) + { + var result = parseRecordType() + } + else + if( lookahead(leftbracket_token) ) + { + var result = parseArrayType() + } + else + { + var result = parseTypeIdentifier() + if( lookahead(not_token) ) + { + match(not_token) + result.@nullable="false" + } + else + if( lookahead(questionmark_token) ) + { + match(questionmark_token) + result.@nullable="true" + } + } + + Debug.exit("parseTypeExpression",result.toXMLString()) + return result + } + + /* + + UnionType + ( TypeExpressionList ) + + */ + + function parseUnionType() + { + Debug.enter("parseUnionType") + + match(leftparen_token) + var first = parseTypeExpressionList() + var result = {first} + match(rightparen_token) + + Debug.exit("parseUnionType",result) + return result + } + + /* + + RecordType + { FieldTypeList } + + */ + + function parseRecordType() + { + Debug.enter("parseRecordType") + + match(leftbrace_token) + if( lookahead(rightbrace_token) ) + { + var first = <> + } + else + { + var first = parseFieldTypeListPrime(<>{parseFieldType()}) + } + var result = {first} + match(rightbrace_token) + + Debug.exit("parseRecordType",result) + return result + } + + /* + + NonemptyFieldTypeList + FieldType + FieldType , NonemptyFieldTypeList + + */ + + function parseFieldTypeListPrime(first) + { + Debug.enter("parseNonemptyFieldTypeList",first) + + if( lookahead(comma_token) ) + { + match(comma_token) + var second = parseFieldType() + var result = parseFieldTypeListPrime(<>{first}{second}) + } + else + { + var result = first + } + + Debug.exit("parseFieldListPrime",result) + return result + } + + /* + FieldType + FieldName : TypeExpression + */ + + function parseFieldType() + { + Debug.enter("parseFieldType") + + var first = parseFieldName() + match(colon_token) + var second = parseTypeExpression() + var result = {first}{second} + + Debug.exit("parseFieldType",result) + return result + } + + /* + + ArrayType + [ ElementTypeList ] + + ElementTypeList + «empty» + TypeExpression + , ElementTypeList + TypeExpression , ElementTypeList + + */ + + function parseArrayType() + { + Debug.enter("parseArrayType") + + enterSlashContext(regexpliteral_token) + match(leftbracket_token) + if( lookahead(rightbracket_token) ) + { + var first = <> + } + else + { + var temp = parseElementType() + var first = parseElementTypeListPrime(<>{temp}) + } + + exitSlashContext(regexpliteral_token) + match(rightbracket_token) + var result = {first} + + Debug.exit("parseArrayLiteral",result) + return result + } + + function parseElementTypeListPrime(first) + { + Debug.enter("parseElementTypeListPrime",first) + + while( lookahead(comma_token) ) + { + match(comma_token) + var second = parseElementType() + if( second == null ) + { + // do nothing + } + else + { + var first = <>{first}{second} + } + } + var result = first + + Debug.exit("parseElementTypeListPrime",result) + return result + } + + function parseElementType() + { + Debug.enter("parseElementType") + + if( lookahead(comma_token) ) + { + var result = + } + else + if( lookahead(rightbracket_token) ) + { + var result = null + } + else + { + var result = parseTypeExpression() + } + + Debug.exit("parseElementType",result) + return result + } + + + // STATEMENTS + + /* + + Statement + + */ + + function parseStatement(mode) + { + Debug.enter("parseStatement",mode) + + if( lookahead(super_token) ) + { + var node = parseSuperStatement() + matchSemicolon(mode) + } + else + if( lookahead(leftbrace_token) ) + { + var node = parseBlockStatement() + } + else + if( lookahead(if_token) ) + { + var node = parseIfStatement(mode) + } + else + if( lookahead(switch_token) ) + { + var node = parseSwitchStatement() //includes 'switch type' + } + else + if( lookahead(do_token) ) + { + var node = parseDoStatement() + matchSemicolon(mode) + } + else + if( lookahead(while_token) ) + { + var node = parseWhileStatement(mode) + } + else + if( lookahead(for_token) ) + { + var node = parseForStatement(mode) + } + else + if( lookahead(let_token) ) + { + match(let_token) // because other context do + var node = parseLetStatement(mode) + } + else + if( lookahead(with_token) ) + { + var node = parseWithStatement(mode) + } + else + if( lookahead(continue_token) ) + { + var node = parseContinueStatement() + matchSemicolon(mode) + } + else + if( lookahead(break_token) ) + { + var node = parseBreakStatement() + matchSemicolon(mode) + } + else + if( lookahead(return_token) ) + { + var node = parseReturnStatement() + matchSemicolon(mode) + } + else + if( lookahead(throw_token) ) + { + var node = parseThrowStatement() + matchSemicolon(mode) + } + else + if( lookahead(try_token) ) + { + var node = parseTryStatement() + } + else + if( lookahead(default_token) ) + { + var node = parseDefaultXMLNamespaceStatement() + matchSemicolon(mode) + } + else + { + var node = parseLabeledOrExpressionStatement(mode) + matchSemicolon(mode) + } + + Debug.exit("parseStatement",node) + return node + } + + /* + */ + + function parseSubstatement(mode) + { + Debug.enter("parseSubstatement") + + var node = parseStatement(mode) + + Debug.exit("parseSubstatement",node) + return node + } + + function parseBlockStatement() + { + Debug.enter("parseSubstatement") + + var prologue = + var stmts = parseBlock(prologue) + //var slots = stmts.Slot // hoist let slots + //delete stmts.Slot + var node = {prologue}{stmts} + + Debug.exit("parseBlockStatement",node) + return node + } + + /* + + SuperExpression + super + super Arguments + + */ + + function parseSuperStatement() + { + Debug.enter("parseSuperStatement") + + match(super_token) + var first = + if( lookahead(leftparen_token) ) + { + var result = parseArguments(first) + } + else + { + var result = first + } + + Debug.exit("parseSuperStatement",result) + return result + } + + function parseLabeledOrExpressionStatement(mode) + { + Debug.enter("parseLabeledOrExpressionStatement",mode) + + var first = parseListExpression(allowIn_mode) + if( lookahead(colon_token) ) + { + if( first.length() == 1 || first.Get.identifier != void 0 ) + { + first = first.Get.identifier + } + else + { + throw "invalid label" + } + match(colon_token) + var second = parseSubstatement(mode) + var result = {first}{second} + } + else + { + var result = {first} + // leave matchSemicolon(mode) for caller + } + + Debug.exit("parseLabeledOrExpressionStatement",result) + return result + } + + function parseBlock(prologue) + { + Debug.exit("parseBlock") + + match(leftbrace_token) + var node = parseDirectives(void 0,prologue) + match(rightbrace_token) + + Debug.exit("parseBlock",node) + return node + } + + function parseMetaData() + { + } + + function parseIfStatement(mode) + { + } + + function parseSwitchStatement() + { + } + + function parseCaseStatement(mode) + { + } + + function parseCaseLabel() + { + } + + function parseCaseStatements() + { + } + + function parseCaseStatementsPrefix(first) + { + } + + function parseDoStatement() + { + } + + function parseWhileStatement(mode) + { + } + + function parseForStatement(mode) + { + } + + function parseLetStatement(mode) + { + Debug.enter("parseLetStatement") + + // already ate 'let' + + var prologue = + var block = + match(leftparen_token) + if( lookahead(rightparen_token) ) + { + } + else + { + block.* += parseVariableBinding(,var_token,allowIn_mode,prologue) + while( lookahead(comma_token) ) + { + match(comma_token) + block.* += parseVariableBinding(,var_token,allowIn_mode,prologue) + } + } + match(rightparen_token) + var second = parseSubstatement(mode) + if( second.name() == "BlockStatement" ) + { + prologue.* += second.Prologue.* + block.* += second.Block.* + } + else + { + block.* += second + } + + var node = {prologue}{block} + + Debug.exit("parseLetStatement",node) + return node + } + + function parseWithStatement(mode) + { + throw "WithStatement not implemented" + } + + function parseContinueStatement() + { + throw "ContinueStatement not implemented" + } + + function parseBreakStatement() + { + throw "BreakStatement not implemented" + } + + /* + + ReturnStatement + return + return [no line break] ListExpressionallowIn + + */ + + function parseReturnStatement() + { + Debug.enter("parseReturnStatement") + + match(return_token) + + if( !inFunctionBody(true) ) + { + throw "return statement is not allowed outside of function body" + } + + var node = + + if( !lookaheadSemicolon(full_mode) ) + { + node.* = parseListExpression(allowIn_mode) + } + + Debug.exit("parseReturnStatement",node) + return node + } + + function parseThrowStatement() + { + throw "ThrowStatement not implemented" + } + + function parseTryStatement() + { + throw "TryStatement not implemented" + } + + function parseCatchClauses() + { + throw "CatchClauses not implemented" + } + + function parseCatchClause() + { + throw "CatchClause not implemented" + } + + function parseFinallyClause() + { + throw "FinallyClause not implemented" + } + + function parseDefaultXMLNamespaceStatement() + { + throw "DefaultXMLNamespaceStatement not implemented" + } + + function parseAnnotatedDirective(mode) + { + throw "AnnotatedDirective not implemented" + } + + function parseAnnotatedSubstatementsOrStatement(mode) + { + throw "not implemented" + } + + function parseAnnotatableDirective(attrs,mode,prologue) + { + Debug.enter("parseAnnotatableDirective",attrs,mode) + + if( lookahead(let_token) ) + { + match(let_token) + attrs.* += // the let attribute + if( lookahead(function_token) ) + { + var node = parseFunctionDefinition(attrs,prologue) + } + else + { + var node = parseVariableDefinition(attrs,allowIn_mode,prologue) + matchSemicolon(mode) + } + } + else + if( lookahead(var_token) ) + { + match(var_token) // eat 'var' before calling parseVar... + var node = parseVariableDefinition(attrs,allowIn_mode,prologue) + } + else + if( lookahead(const_token) ) + { + var node = parseVariableDefinition(attrs,allowIn_mode,prologue) + } + else + if( lookahead(function_token) ) + { + var node = parseFunctionDefinition(attrs,prologue) + } + else + if( lookahead(class_token) ) + { + var node = parseClassDefinition(attrs,prologue) + } + else + if( lookahead(interface_token) ) + { + var node = parseInterfaceDefinition(attrs,prologue) + } + else + if( lookahead(namespace_token) ) + { + var node = parseNamespaceDefinition(attrs,prologue) + } + else + if( lookahead(type_token) ) + { + var node = parseTypeDefinition(attrs,prologue) + } + else + { + throw "not implemented yet" + } + + Debug.exit("parseAnnotatableDirective",node) + return node + } + + function parseAnnotatableDirectiveOrLetStatement(attrs,mode,prologue) // actually only need to handle let bindings and let statements + { + Debug.enter("parseAnnotatableDirectiveOrLetStatement",attrs,mode) + + match(let_token) + + if( lookahead(leftparen_token ) ) // Let statement + { + var node = parseLetStatement(mode) + } + else // Let binding + { + attrs.* += // the let attribute + if( lookahead(function_token) ) + { + var node = parseFunctionDefinition(attrs,prologue) + } + else + { + var node = parseVariableDefinition(attrs,allowIn_mode,prologue) + } + } + + Debug.exit("parseAnnotatableDirectiveOrLetStatement",node) + return node + } + + function parseIncludeDirective() + { + } + + function parseVariableDefinition(first,mode,prologue) + { + Debug.enter("parseVariableDefinition",first,mode) + + // already ate 'let' if there was one, so will see 'const' or nothing (which means 'var') + // if there is no 'let' then caller must eat 'var' before calling to avoid 'let var' + + var second = lookahead(const_token) ? match(const_token) : var_token + if( inInterfaceBody() ) + { + throw "variable definition is not allowed in an interface" + } + var first = parseVariableBindingList(first,second,mode,prologue); + var node = first + + Debug.exit("parseVariableDefinition",node) + return node + } + + function parseVariableBindingList(attrs,kind,mode,prologue) + { + Debug.enter("parseVariableBindingList",attrs,kind,mode) + + var node = <> + node += parseVariableBinding(attrs,kind,mode,prologue) + + while( lookahead( comma_token ) ) + { + match( comma_token ); + node += parseVariableBinding(attrs,kind,mode,prologue); + } + + Debug.exit("parseVariableBindingList",node) + return node + } + + /* + + VariableBindingb + TypedIdentifierb VariableInitialisationb + DestructuringPattern VariableInitialisationb + + VariableInitialisationb + «empty» + = VariableInitialiserb + + VariableInitialiserb + AssignmentExpressionb + + */ + + function isNamespaceAttribute(attr) + { + Debug.enter("isNamespaceAttribute",attr.toXMLString()) + + var result = + ( attr.name()=="Get" && + attr.Identifier != undefined ) ? true : + attr.name()=="Namespace" ? true : false + + Debug.exit("isNamespaceAttribute",result) + return result + } + + function inFunctionBody(recurse=false) + { + Debug.enter("inFunctionBody") + + if( recurse ) + { + var result = false + for each( var item in slot_context_stack ) + { + if( item=="function" ) + { + result = true + break + } + } + } + else + { + var context = slot_context_stack[slot_context_stack.length-1] + var result = context=="function" + } + + Debug.exit("inFunctionBody",result) + return result + } + + function inClassBody() + { + Debug.enter("inClassBody") + var context = slot_context_stack[slot_context_stack.length-1] + var result = context=="class" + Debug.exit("inClassBody",result) + return result + } + + function inInterfaceBody() + { + Debug.enter("inInterfaceBody") + var context = slot_context_stack[slot_context_stack.length-1] + var result = context=="interface" + Debug.exit("inInterfaceBody",result) + return result + } + + function inClassOrInterfaceBody() + { + Debug.enter("inClassOrInterfaceBody") + var context = slot_context_stack[slot_context_stack.length-1] + var result = context=="class" || context=="interface" + Debug.exit("inClassOrInterfaceBody",result) + return result + } + + function parseVariableBinding(attrs,kind,mode,prologue) + { + Debug.enter("parseVariableBinding",attrs,kind,mode) + + if( lookahead(leftbrace_token) || lookahead(leftbracket_token) ) + { + var first = parseDestructuringPattern() + match(assign_token) + var second = parseAssignmentExpression(mode) + } + else + { + var first = parseTypedIdentifier(mode) + if( lookahead(assign_token) ) + { + match(assign_token) + var second = parseAssignmentExpression(mode); + } + else + { + var second + } + var node = makeBinding(attrs,kind,first,second,prologue) + } + + Debug.exit("parseVariableBinding",node) + return node + } + + /* + + Make a slot + + For some kinds of bindings we hoist the intialiser to the prologue along with + the slot (instance slots, function slots). The value of a function slot + initialiser is moved by the Definer to derive an ExpressionStatement inserted + at the beginning of the corresponding Block. The Definer also hoists some + slots (var,const,function) to the inner most enclosing variable object + (global,class,function) + + */ + + function makeBinding(attrs,kind,typedid,value,prologue) + { + Debug.enter("makeBinding",attrs,kind,typedid,value) + + // See if there is one namespace attribute + + var ns = null + for each( var attr in attrs.* ) + { + if( isNamespaceAttribute(attr) ) + { + if( ns === null ) + { + ns = attr + } + else + { + throw "only one namespace attribute allowed" + } + } + } + + // Make a qualified identifier + + if( ns != null ) + { + var name = + + {ns} + {typedid.Identifier} + + } + else // use the default namespace + { + var name = + + + {default_namespace} + + {typedid.Identifier} + + } + + // Get the type if it has one + + if( typedid.name() == "TypedIdentifier" ) + { + var type = typedid.Type.* + } + else + if( kind == class_token ) + { + var type = + } + else + { + var type = + } + + + // Make the slot and initialiser + + if( kind == class_token || + kind == interface_token || + kind == function_token || + kind == namespace_token || + kind == type_token || + inClassBody() && attrs.Let == void 0 && attrs.Static == void 0 ) + { + var slot = + + {name} + {type} + {value} + + + if( kind == function_token && inClassOrInterfaceBody() ) + { + slot.@method="true" + } + var init = <> + } + else + { + var slot = + + {name} + {type} + + + if( value != void 0 ) + { + var init = <> + + + {name}{value}{typedid.Type} + + + } + else + { + var init = <> + } + } + + // Apply attributes to the slot + + applyAttributesToSlot(attrs,slot) + + // Return the results + + var node = init + + if( slot.@static == "true" ) + { + prologue.Static.* += slot + } + else + if( inClassBody() && slot.@let != "true" ) + { + prologue.Instance.* += slot + } + else + { + prologue.* += slot + } + + Debug.exit("makeBinding",node,slot,prologue) + return node + } + + var slot_context_stack = ["global"] + + function applyAttributesToSlot(attrs,slot) + { + Debug.enter("applyAttributesToSlot",attrs.toXMLString(),slot) + + var slot_context = slot_context_stack[slot_context_stack.length-1] + var slot_kind = slot.@kind + + if( attrs.Let != void 0 ) + { + slot.@let = true + } + if( attrs.Dynamic != void 0 ) + { + if( slot_kind == "class" ) + { + slot.@dynamic = true + } + else + { + throw "'dynamic' must only be used on class definitions" + } + } + if( attrs.Final != void 0 ) + { + if( slot_kind == "class" || + (slot_context == "class" && slot_kind == "function" && attrs.Static == void 0 ) ) + { + slot.@final = true + } + else + { + throw "'final' must only be used on class and non-static method definitions" + } + } + if( attrs.Native != void 0 ) + { + if( slot_kind == "function" && slot_context != "function" ) + { + slot.@native = true + } + else + { + throw "'native' must only be used on non-nested function definitions" + } + } + if( attrs.Override != void 0 ) + { + if( slot_context == "class" && slot_kind == "function" && attrs.Static == void 0 ) + { + slot.@override = true + } + else + { + throw "'override' must only be used on non-static method definitions" + } + } + if( attrs.Prototype != void 0 ) + { + if( slot_context == "class" && attrs.Static == void 0 ) + { + slot.@prototype = true + } + else + { + throw "'prototype' must only be used on non-static class variable and method definitions" + } + } + if( attrs.Static != void 0 ) + { + if( slot_context == "class" ) + { + slot.@static = true + } + else + { + throw "'static' must only be used on non-static class variable and method definitions" + } + } + if( attrs.get != void 0 ) + { + if( slot.@kind == "function" ) + { + slot.@kind = "function get" + } + else + { + throw "'get' must be used on function bindings only" + } + } + if( attrs.set != void 0 ) + { + if( slot.@kind == "function" ) + { + slot.@kind = "function set" + } + else + { + throw "'set' must be used on function bindings only" + } + } + if( attrs.call != void 0 ) + { + if( slot.@kind == "function" ) + { + slot.@kind = "function call" + } + else + { + throw "'call' must be used on function bindings only" + } + } + if( attrs.to != void 0 ) + { + if( slot.@kind == "function" ) + { + slot.@kind = "function to" + } + else + { + throw "'to' must be used on function bindings only" + } + } + if( attrs.operator != void 0 ) + { + if( slot.@kind == "function" ) + { + slot.@kind = "function operator" + } + else + { + throw "internal error" + } + } + if( attrs.parameter != void 0 ) + { + if( slot.@kind == "var" || slot.@kind == "const" ) + { + slot.@is_param = "true" +print("parameter slot found",slot) + } + else + { + throw "internal error" + } + } + + Debug.exit("applyAttributesToSlot",slot) + return + } + + function parseTypedIdentifier(mode) + { + Debug.enter("parseTypedIdentifier",mode) + + var first = parseIdentifier() + if( lookahead(colon_token) ) + { + match(colon_token) + if( lookahead(mult_token) ) + { + match(mult_token); + var second = // same as no annotation + } + else + if( lookahead(multassign_token) ) + { + var nexttoken=assign_token; // morph into an assign token + var second = // same as no annotation + } + else + { + var second = {parseTypeExpression()} + } + var result = {first}{second} + } + else + { + var result = {first} + } + + Debug.exit("parseTypedIdentifier",result) + return result + } + + function parseSimpleVariableDefinition() + { + } + + function parseUntypedVariableBindingList() + { + } + + function parseUntypedVariableBinding() + { + } + + function parseFunctionDefinition(attrs,prologue) + { + Debug.enter("parseFunctionDefinition",attrs) + + var kind = match(function_token) + var name = parseFunctionName() + var value = parseFunctionCommon(<>) + attrs.* += <{name.@kind}/> // add functionname kind to attrs + var node = makeBinding(attrs,kind,name,value,prologue) + + Debug.exit("parseFunctionDefinition",node) + return node + } + + function parseFunctionName() + { + Debug.enter("parseFunctionName") + + if( lookahead(identifier_token) ) + { + var kind = "empty" + var first = parseIdentifier() + } + else + if( lookahead(to_token) ) + { + var kind = scan.tokenText(match(to_token)) + var first = parseIdentifier() + } + else + if( lookahead(get_token) ) + { + var kind = scan.tokenText(match(get_token)) + var first = parsePropertyIdentifier() + } + else + if( lookahead(set_token) ) + { + var kind = scan.tokenText(match(set_token)) + var first = parsePropertyIdentifier() + } + else + if( lookahead(call_token) ) + { + var kind = scan.tokenText(match(call_token)) + var first = parsePropertyIdentifier() + } + else + { + var found = lookahead(mult_token) ? match(mult_token) : + lookahead(div_token) ? match(div_token) : + lookahead(modulus_token) ? match(modulus_token) : + lookahead(plus_token) ? match(plus_token) : + lookahead(minus_token) ? match(minus_token) : + lookahead(leftshift_token) ? match(leftshift_token) : + lookahead(rightshift_token) ? match(rightshift_token) : + lookahead(unsignedrightshift_token) ? match(unsignedrightshift_token) : + lookahead(bitwiseand_token) ? match(bitwiseand_token) : + lookahead(bitwisexor_token) ? match(bitwisexor_token) : + lookahead(bitwiseor_token) ? match(bitwiseor_token) : + lookahead(strictequals_token) ? match(strictequals_token) : + lookahead(notequals_token) ? match(notequals_token) : + lookahead(strictnotequals_token) ? match(strictnotequals_token) : empty_token + + if( found != empty_token ) + { + var kind = "operator" + var first = + } + } + + var node = {first} + + Debug.exit("parseFunctionName",node) + return node + } + + var current_class = null + + /* + + class A { function A(){} var x = 10; function m() {}; print("hello") } + + class 'A' + prologue + slot 'iinit' function + prologue + slot 'construct' function ... + slot 'x' 10 + slot 'm' function ... + block + block + print("hello") + + bindings: class field initialisers are not hoisted + with their slots but instance var initialisers are + + */ + + function parseClassDefinition(attrs,hoisted) + { + Debug.enter("parseClassDefinition",attrs) + + match(class_token) + var name = parseClassName() + + current_class = name + slot_context_stack.push("class") // use to determine if inits are hoisted + + var inherits = parseInheritance() + var stmt = parseBlockStatement() + + // Move the static and instance slots out of the embedded block statement + var prologue = {stmt.Prologue.Static.*}{stmt.Prologue.Instance.*} + delete stmt.Prologue.Static + delete stmt.Prologue.Instance + + slot_context_stack.pop() + + current_class = null + + var value = {name}{inherits}{prologue}{stmt} + delete value.Block.BlockStatement.Prologue.Static + + var node = makeBinding(attrs,class_token,name,value,hoisted) + + Debug.exit("parseClassDefinition",node) + return node + } + + function parseClassName() + { + + var first = parseIdentifier() + + if( lookahead(leftdotangle_token) ) + { + var second = parseTypeParameters() + } + else + { + var second = <> + } + + if( lookahead(not_token) ) + { + match(not_token) + var node = {first}{second} + } + else + { + var node = {first}{second} + } + + return node + } + + /* + + Inheritance + «empty» + extends TypeName + implements TypeNameList + extends TypeName implements TypeNameList + + */ + + function parseInheritance() + { + Debug.enter("parseInheritance") + + var node = + + if( lookahead(extends_token) ) + { + match(extends_token) + var first = parseTypeName() + node.Extends.* = first + if( lookahead(implements_token) ) + { + match(implements_token) + var second = parseTypeNameList() + node.Implements.* = second + } + } + else + if( lookahead(implements_token) ) + { + match(implements_token) + var second = parseTypeNameList() + node.Implements.* = second + } + + Debug.exit("parseInheritance",node) + return node + } + + function parseTypeName() + { + return parseTypeIdentifier() + } + + function parseTypeNameList() + { + var node = <> + node += parseTypeIdentifier() + while( lookahead(comma_token) ) + { + match(comma_token) + node += parseTypeIdentifier() + } + return node + } + + + function parseInterfaceDefinition(attrs,hoisted) + { + Debug.enter("parseInterfaceDefinition",attrs) + + match(interface_token) + var name = parseClassName() + + current_class = name + slot_context_stack.push("interface") + + var inherits = parseExtendsList() + + var last_default_namespace = default_namespace + default_namespace = + + var stmt = parseBlockStatement() + + default_namespace = last_default_namespace + + slot_context_stack.pop() + + current_class = null + + var value = {name}{inherits}{stmt.Prologue}{stmt.Block} + var node = makeBinding(attrs,interface_token,name,value,hoisted) + + Debug.exit("parseInterfaceDefinition",node) + return node + } + + /* + + ExtendsList + «empty» + extends TypeNameList + + */ + + function parseExtendsList() + { + Debug.enter("parseExtendsList") + + var node = + + if( lookahead(extends_token) ) + { + match(extends_token) + var first = parseTypeNameList() + node.Extends.* = first + } + + Debug.exit("parseExtendsList",node) + return node + } + + + /* + + TypeExpressionList + TypeExpression + TypeExpressionList , TypeExpression + + */ + + function parseTypeExpressionList() + { + Debug.enter("parseTypeExpressionList") + + var list = <> + list += parseTypeExpression() + while( lookahead( comma_token ) ) + { + match( comma_token ); + list += parseTypeExpression() + } + var result = list + + Debug.exit("parseTypeExpressionList",result) + return result + } + + function parseNamespaceDefinition(attrs,prologue) + { + Debug.enter("parseNamespaceDefinition",attrs) + + match(namespace_token) + var first = parseTypedIdentifier(allowIn_mode) + if( lookahead(assign_token) ) + { + match(assign_token) + if( lookahead(stringliteral_token) ) + { + var second = + } + else + { + var second = {parseSimpleTypeIdentifier()} + } + } + else + { + var second = + } + + if( inClassBody() ) + { + attrs.* += + } + + var node = makeBinding(attrs,namespace_token,first,second,prologue) + + Debug.exit("parseNamespaceDefinition",node) + return node + } + + /* + + */ + + function parseTypeDefinition(attrs,hoisted) + { + Debug.enter("parseTypeDefinition",attrs) + + match(type_token) + var first = parseTypedIdentifier(allowIn_mode) + match(assign_token) + var second = parseTypeExpression() + var node = makeBinding(attrs,type_token,first,second,hoisted) + + Debug.exit("parseTypeDefinition",node) + return node + } + + /* + + PackageDefinition + PackageAttributes package PackageNameOpt Block + + PackageAttributes + private + «empty» + + PackageNameOpt + «empty» + PackageName + + PackageName [create a lexical PackageIdentifier with the sequence of characters that make a PackageName] + Identifier + PackageName . Identifier + + */ + + var current_package + + function parsePackageDefinition(attr) + { + Debug.enter("parsePackageDefinition") + + enterSlashContext(div_token) + match(package_token) + var name = parsePackageName() + exitSlashContext(div_token) + + current_package = name + default_namespace = + var stmt = parseBlockStatement() + var block = stmt.Block + var prologue = stmt.Prologue + current_package = null + stmt.@name=name + stmt.@kind="package" + var node = stmt + +// prologue.insertChildBefore(prologue.*[0], + stmt.Prologue.* += + + + + + + + Debug.exit("parsePackageDefinition",node) + return node + } + + function parsePackageName() + { + Debug.enter("parsePackageName") + + var name = "" + if( lookahead(leftbrace_token) ) + { + } + else + { + name += scan.tokenText(match(identifier_token)) + while( lookahead(dot_token) ) + { + match(dot_token) + name += "." + name += scan.tokenText(match(identifier_token)) + } + + scan.addPackageName(name) + } + + Debug.exit("parsePackageName",name) + return name + } + + /* + + Attributes + Attribute + Attribute [no line break] Attributes + + Attribute + SimpleTypeIdentifier + ReservedNamespace + dynamic + final + native + override + prototype + static + [ AssignmentExpressionallowIn ] + + */ + + function parseAttributes(first) + { + Debug.enter("parseAttributes",first) + + while( !lookaheadSemicolon(full_mode) && + ( lookahead(public_token) || + lookahead(private_token) || + lookahead(internal_token) || + lookahead(intrinsic_token) || + lookahead(protected_token) || + lookahead(dynamic_token) || + lookahead(final_token) || + lookahead(native_token) || + lookahead(override_token) || + lookahead(prototype_token) || + lookahead(static_token) || + lookahead(leftbracket_token) || + lookahead(packageidentifier_token) || + lookahead(identifier_token) ) ) + { + first += parseAttribute() + } + + var node = {first} + + // todo: check for duplicates + + Debug.exit("parseAttributes",node) + return node + } + + function parseAttribute() + { + Debug.enter("parseAttribute") + + var found = lookahead(public_token) ? match(public_token) : + lookahead(private_token) ? match(private_token) : + lookahead(internal_token) ? match(internal_token) : + lookahead(intrinsic_token) ? match(intrinsic_token) : + lookahead(protected_token) ? match(protected_token) : + lookahead(dynamic_token) ? match(dynamic_token) : + lookahead(final_token) ? match(final_token) : + lookahead(native_token) ? match(native_token) : + lookahead(override_token) ? match(override_token) : + lookahead(prototype_token) ? match(prototype_token) : + lookahead(static_token) ? match(static_token) : empty_token + + + if( found != empty_token ) + { + if( lookahead(doublecolon_token) ) // todo: look for other tokens that indicate an expression + { + throw "attribute names cannot start a labeled or expression statement" + } + + var slot_context = slot_context_stack[slot_context_stack.length-1] + switch(found) + { + case internal_token: + if( slot_context == "function" ) + { + throw "'internal' shall not be used in local definitions" + } + var node = + break + case intrinsic_token: + throw "'intrinsic' shall only be used by implementations" + var node = + break + case private_token: + if( slot_context != "class" ) + { + throw "'private' must only be used on class variable and method definitions" + } + var node = + break + case protected_token: + if( slot_context != "class" ) + { + throw "'protected' must only be used on class variable and method definitions" + } + var node = + break + case public_token: + if( slot_context == "function" ) + { + throw "'public' shall not be used in local definitions" + } + if( inClassBody() ) + { + var public_namespace_name = "" + } + else + { + var public_namespace_name = current_package + } + var node = + break + case dynamic_token: + var node = + break + case final_token: + var node = + break + case native_token: + var node = + break + case override_token: + var node = + break + case prototype_token: + var node = + break + case static_token: + var node = + break + default: + throw "invalid attribute kind" + } + + } + else + if( lookahead(leftbracket_token) ) + { + var node = parseArrayLiteral() // not quite right but close enough for now + } + else + { + var node = parseSimpleTypeIdentifier() + } + + Debug.exit("parseAttribute",node.toXMLString()) + return node + } + + /* + + Directivew + EmptyStatement + Statementw + AnnotatableDirectivew + Attributes [no line break] AnnotatableDirectivew + IncludeDirective Semicolonw + + AnnotatableDirectivew + VariableDefinitionallowIn Semicolonw + FunctionDefinition + ClassDefinition + InterfaceDefinition + NamespaceDefinition Semicolonw + TypeDefinition Semicolonw + + */ + + public function parseDirective(attr,mode,prologue) + { + Debug.enter("parseDirective",mode) + + if( lookahead(semicolon_token) ) + { + match(semicolon_token) + node = <> + } + else + if( lookahead(include_token) ) + { +// var node = parseIncludeDirective() + } + else + if( lookahead(public_token) || + lookahead(private_token) || + lookahead(internal_token) || + lookahead(intrinsic_token) || + lookahead(protected_token) || + lookahead(dynamic_token) || + lookahead(final_token) || + lookahead(native_token) || + lookahead(override_token) || + lookahead(prototype_token) || + lookahead(static_token) || + lookahead(leftbracket_token) || + attr != null ) + { + if( attr != null ) + { + var first = attr // passed in from parseDirectives + } + else + { + var first = parseAttribute() + } + if( !lookaheadSemicolon(abbrev_mode) ) + { + + var first = parseAttributes(<>{first}) + } + else + { + throw "attributes cannot be used at expression statements" + } + if( lookahead(var_token) || + lookahead(const_token) || + lookahead(let_token) || + lookahead(function_token) || + lookahead(class_token) || + lookahead(interface_token) || + lookahead(namespace_token) || + lookahead(type_token) ) + { + var node = parseAnnotatableDirective(first,mode,prologue) + } + else + { + var node = first + } + } + else + if( lookahead(var_token) || + lookahead(const_token) || + lookahead(function_token) || + lookahead(class_token) || + lookahead(interface_token) || + lookahead(namespace_token) || + lookahead(type_token) ) + { + var first = + var node = parseAnnotatableDirective(first,mode,prologue) + } + else + if( lookahead(let_token) ) + { + var first = + var node = parseAnnotatableDirectiveOrLetStatement(first,mode,prologue) + } + else + if( lookahead(identifier_token) ) // labeled, attribute or expression + { + var first = parseAssignmentExpression(mode) + if( lookaheadSemicolon(abbrev_mode) ) + { + matchSemicolon(abbrev_mode) + var node = {first} + } + else + if( lookahead(colon_token) ) // labeled statement + { + match(colon_token) + if( first.name() != "Get" || + first.Get.Identifier == undefined ) // don't allow qualified identifiers + { + throw "invalid label identifier" + } + else + { + first = first.Get.Identifier.@name + } + var second = parseSubstatement(mode) + var node = + } + else + if( first.name() == "Get" && + ( lookahead(public_token) || + lookahead(private_token) || + lookahead(internal_token) || + lookahead(intrinsic_token) || + lookahead(protected_token) || + lookahead(dynamic_token) || + lookahead(final_token) || + lookahead(native_token) || + lookahead(override_token) || + lookahead(prototype_token) || + lookahead(static_token) || + lookahead(leftbracket_token) || + lookahead(identifier_token) ) ) // attribute list + { + var first = parseAttributes(first) + if( lookahead(var_token) || + lookahead(const_token) || + lookahead(let_token) || + lookahead(function_token) || + lookahead(class_token) || + lookahead(interface_token) || + lookahead(namespace_token) || + lookahead(type_token) ) + { + var node = parseAnnotatableDirective(first,mode,prologue) + } + else + { + throw "looks like an attribute list but there's no definition to go with it" + } + } + else + if( lookahead(var_token) || + lookahead(const_token) || + lookahead(let_token) || + lookahead(function_token) || + lookahead(class_token) || + lookahead(interface_token) || + lookahead(namespace_token) || + lookahead(type_token) ) + { + var first = {first} + var node = parseAnnotatableDirective(first,mode,prologue) + } + else // must be a list expression resume parsing as such + { + var node = {parseListExpressionPrime(first,mode)} + } + } + else + { + var node = parseStatement(mode) + } + + Debug.exit("parseDirective",node) + return node + } + + /* + + Directives + «empty» + DirectivesPrefix Directiveabbrev + + DirectivesPrefix + «empty» + Pragmas + DirectivesPrefix Directivefull + + */ + + public function parseDirectives(attr,prologue) + { + Debug.enter("parseDirectives") + + // look for pragmas + + var node = + + if( !lookahead(eos_token) && + (lookahead(use_token) || lookahead(import_token)) ) + { + prologue.* += parsePragmas() + } + + // look for statements and definitions + + while( !lookahead(eos_token) && !lookahead(rightbrace_token) ) + { + node.* += parseDirective(attr,full_mode,prologue) + } + + Debug.exit("parseDirectives",node) + return node + } + + public function parsePragmas() + { + Debug.enter("parsePragmas") + + var node = <> + + while( !lookahead(eos_token) && + (lookahead(use_token) || lookahead(import_token)) ) + { + node += parsePragma() + } + + Debug.exit("parsePragmas",node) + return node + } + + public function parsePragma() + { + Debug.enter("parsePragma") + + var node = <> + + if( lookahead(use_token) ) + { + node += parseUsePragma() + matchSemicolon(full_mode) + } + else + if( lookahead(import_token) ) + { + node += parseImportPragma() + matchSemicolon(full_mode) + } + + Debug.exit("parsePragma",node) + return node + } + + public function parseImportPragma() + { + Debug.enter("parseImportPragma") + + match(import_token) + + if( lookahead(identifier_token) ) + { + var first = parseIdentifier() + if( lookahead(assign_token) ) + { + match(assign_token) + } + else + { + throw "import name '"+first.@name+"' is not a known package identifier" + } + var second = parseImportName() + if( second.@def == "*" ) + { + throw "wildcard not allowed in aliasing import pragmas" + } + second.@alias=first.@name + var node = second + } + else + if( lookahead(packageidentifier_token) ) + { + var second = parseImportName() + var node = second + } + else + { + throw "invalid import name" + } + + var pkg_name = node.@pkg + var def_name = node.@def + + if( def_name == "*" ) + { + scopes[scopes.length-1].Imports.*+=node + } + else + { + scopes[scopes.length-1].Imports[def_name].*+=node + } + + Debug.exit("parseImportPragma",node.toXMLString()) + return node + } + + var scopes = [] + + function isImported(pkg_name,def_name) + { + var scope = scopes[scopes.length-1] + for each( var def in scope.Imports[def_name] ) + { + if( def.Import.@pkg == pkg_name ) + { + return true + } + } + + for each( var def in scope.Imports.* ) + { + if( def.@pkg == pkg_name ) + { + return true + } + } + return false + } + + function parseImportName() + { + Debug.enter("parseImportName") + + var pkg_part = scan.tokenText(match(packageidentifier_token)) + match(dot_token) + if( lookahead(mult_token) ) + { + match(mult_token) + var def_part = "*" + } + else + if( lookaheadReservedWord() ) + { + var def_part = scan.tokenText(matchReservedWord()) + } + else + { + var def_part = scan.tokenText(match(identifier_token)) + } + + var node = + + Debug.exit("parseImportName",node.toXMLString()) + return node + } + + public function parseUsePragma() + { + Debug.enter("parseUsePragma") + + match(use_token) + var node = <> + node += parsePragmaItem() + while( lookahead(comma_token) ) + { + match(comma_token) + node += parsePragmaItem() + } + + Debug.exit("parseUsePragma",node) + return node + } + + function parsePragmaItem() + { + Debug.enter("parsePragmaItem") + + if( lookaheadReservedWord() || + lookahead(identifier_token) ) + { + if( lookaheadReservedWord() ) + { + var first = matchReservedWord() + } + else + { + var first = match(identifier_token) + } + var ident = scan.tokenText(first) + + switch(ident) + { + case 'decimal': + case 'double': + case 'int': + case 'rounding': + case 'standard': + case 'strict': + case 'uint': + var node = <{ident}/> + break + case 'default': + match(namespace_token) + var node = + node.* = {parseSimpleTypeIdentifier()} + break + case 'namespace': + var node = + node.* = {parseSimpleTypeIdentifier()} + break + default: + throw "invalid pragma identifier:"+ident + break + } + } + + Debug.exit("parsePragmaItem",node) + return node + } + + var default_namespace + + public function parseProgram() + { + Debug.enter("parseProgram") + + var blocks = <> + + while( lookahead(internal_token) || lookahead(package_token) ) + { + if( lookahead(internal_token) ) + { + var attr = parseAttribute() + } + if( lookahead(package_token) ) + { + blocks += parsePackageDefinition(attr) + attr = null // clear it + } + else + { + break + } + } + current_package = "global" + var prologue = + default_namespace = + + var block = parseDirectives(attr,prologue) + var global = {prologue}{block} + + blocks += global + var node = {blocks} + node.Prologue.OpenNamespaces = + + + + + + + Debug.exit("parseProgram",node) + return node + } + } + + function testParser() + { + var programs = + [ + //primary expressions + + "x", + "q::id", + "q::[expr]", + "(expr)::id", + "(expr)::[expr]", + "@a", + "@q::id", + "@q::[expr]", + "@(expr)::id", + "@(expr)::[expr]", + "@[expr]", + "/abcdefg/g", + "/abcdefg/", + "/abcdefg/i", + "/abcdefg/x", + "true", + "false", + "null", + "(a)::x", + "(function(a,b,c){})", + "{x:a,y:b,z:c}", + "[a,b,c]", + "{(x):y}", + "(function(){})", + "(function f(a:A,b:B){})", + "(function f.(a:T,b:U,c:V){})", + + // type expressions + + "T", + "?T", + "T!", + "T~", + "T.", + "T.>", + "T.<{a:A,t:{i:I,s:S}}>", + "T.<{x:[A,B,C]}>", + "T.<{x:(A,B,C)}>", + "T.>>>", + "T.!", + "?T.", + + // Postfix expressions + + "x.y", + "new x", + "new x()", + "x()", + "x.y()", + "x++", + "x--", + "x.y++", + "x.y()++", + "new x.y++", + ] + + var n = 0 + for each ( var p in programs ) + { + n++ + try { + var parser = new Parser(p) + var node = parser.parseProgram() + + print("> "+p) + print(node.toXMLString()) + //print("---") + } + catch(x) + { + print(x) + } + } + } + +// testParser() +} + diff --git a/mozilla/js/tamarin/esc/readme.txt b/mozilla/js/tamarin/esc/readme.txt new file mode 100644 index 00000000000..b668fa65eba --- /dev/null +++ b/mozilla/js/tamarin/esc/readme.txt @@ -0,0 +1,8 @@ +To compile: + + asc -strict -import global.abc -import shell.abc es4.as + +To run: + + avmplus es4.abc + diff --git a/mozilla/js/tamarin/extensions/Dictionary.as b/mozilla/js/tamarin/extensions/Dictionary.as new file mode 100644 index 00000000000..6bb95a92fcb --- /dev/null +++ b/mozilla/js/tamarin/extensions/Dictionary.as @@ -0,0 +1,78 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +package flash.utils +{ +// +// Dictionary +// + +/** + * The Dictionary class lets you create a dynamic collection of properties, which uses strict equality + * (===) for key comparison. When an object is used as a key, the object's + * identity is used to look up the object, and not the value returned from calling toString() on it. + *

The following statements show the relationship between a Dictionary object and a key object:

+ *
+ * var dict = new Dictionary();
+ * var obj = new Object();
+ * var key:Object = new Object();
+ * key.toString = function() { return "key" }
+ *  
+ * dict[key] = "Letters";
+ * obj["key"] = "Letters";
+ *  
+ * dict[key] == "Letters"; // true
+ * obj["key"] == "Letters"; // true 
+ * obj[key] == "Letters"; // true because key == "key" is true b/c key.toString == "key"
+ * dict["key"] == "Letters"; // false because "key" === key is false
+ * delete dict[key]; //removes the key
+ * 
+ * + * @playerversion Flash 8.5 + * @langversion 3.0 + * @see ../../operators.html#strict_equality === (strict equality) + * + */ +dynamic public class Dictionary +{ + /** + * Creates a new Dictionary object. To remove a key from a Dictionary object, use the delete operator. + * + * @param weakKeys Instructs the Dictionary object to use "weak" references on object keys. + * If the only reference to an object is in the specified Dictionary object, the key is eligible for + * garbage collection and is removed from the table when the object is collected. + * + * @playerversion Flash 8.5 + * @langversion 3.0 + */ + public native function Dictionary(weakKeys:Boolean=false); +}; +} diff --git a/mozilla/js/tamarin/extensions/DictionaryGlue.cpp b/mozilla/js/tamarin/extensions/DictionaryGlue.cpp new file mode 100644 index 00000000000..e3f61129f25 --- /dev/null +++ b/mozilla/js/tamarin/extensions/DictionaryGlue.cpp @@ -0,0 +1,193 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#ifdef AVMPLUS_SHELL +#include "avmshell.h" +#else +// player +#include "platformbuild.h" +#include "avmplayer.h" +#endif + +using namespace MMgc; + +namespace avmplus +{ + BEGIN_NATIVE_MAP(DictionaryClass) + NATIVE_METHOD(flash_utils_Dictionary_Dictionary, DictionaryObject::construct) + END_NATIVE_MAP() + + DictionaryClass::DictionaryClass(VTable *vtable) + : ClassClosure(vtable) + { + createVanillaPrototype(); + vtable->traits->itraits->isDictionary = true; + } + + ScriptObject *DictionaryClass::createInstance(VTable *ivtable, ScriptObject* /*delegate*/) + { + GCAssert(ivtable->traits->isDictionary == true); + return new (core()->GetGC(), ivtable->getExtraSize()) DictionaryObject(ivtable, prototype); + } + + DictionaryObject::DictionaryObject(VTable *vtable, ScriptObject *delegate) + : ScriptObject(vtable, delegate) + { + GCAssert(vtable->traits->isDictionary == true); + } + + DictionaryObject::~DictionaryObject() + { + weakKeys = false; + } + + void DictionaryObject::construct(bool weakKeys) + { + GCAssert(vtable->traits->isDictionary == true); + this->weakKeys = weakKeys; + table = weakKeys ? new (gc()) WeakKeyHashtable(gc()) : new (gc()) Hashtable(gc()); + } + + Atom DictionaryObject::getKeyFromObject(Atom key) const + { + AvmAssert(AvmCore::isObject(key)); + ScriptObject *obj = AvmCore::atomToScriptObject(key); + AvmAssert(obj->traits() != core()->traits.qName_itraits); + AvmAssert(GC::Size(obj) > sizeof(ScriptObject)); + (void)obj; + + // FIXME: this doesn't work, need to convert back to an XMLObject + // on the way out or intern XMLObject's somehow + //if(core()->isXML(key)) + // key = AvmCore::gcObjectToAtom(core()->atomToXML(key)); + + return key; + } + + Atom DictionaryObject::getProperty(Atom key) const + { + if(AvmCore::isObject(key)) { + key = getKeyFromObject(key); + if(weakKeys) + return weakTable()->get(key); + else + return table->get(key); + } else + return ScriptObject::getProperty(key); + } + + bool DictionaryObject::hasProperty(Atom key) const + { + if(AvmCore::isObject(key)) { + key = getKeyFromObject(key); + if(weakKeys) + return weakTable()->contains(key); + else + return table->contains(key); + } else + return ScriptObject::hasProperty(key); + } + + bool DictionaryObject::deleteProperty(Atom key) + { + if(AvmCore::isObject(key)) { + key = getKeyFromObject(key); + if(weakKeys) + weakTable()->remove(key); + else + table->remove(key); + return true; + } else { + return ScriptObject::deleteProperty(key); + } + } + + void DictionaryObject::setProperty(Atom key, Atom value) + { + if(AvmCore::isObject(key)) { + key = getKeyFromObject(key); + if(weakKeys) + weakTable()->add(key, value); + else + table->add(key, value); + } else + ScriptObject::setProperty(key, value); + } + + Atom DictionaryObject::nextName(int index) + { + Atom k = ScriptObject::nextName(index); + + if(weakKeys && AvmCore::isGCObject(k)) { + GCWeakRef *ref = (GCWeakRef*) (k&~7); + if(ref->get()) { + ScriptObject *key = ((ScriptObject*)ref->get()); + AvmAssert(key->traits() != NULL); + return key->atom(); + } else + return undefinedAtom; + } + + return k; + } + + int DictionaryObject::nextNameIndex(int index) + { + AvmAssert(index >= 0); + + if (index != 0) { + index = index<<1; + } + + Hashtable *ht = getTable(); + + // Advance to first non-empty slot. + int numAtoms = ht->getNumAtoms(); + while (index < numAtoms) { + Atom a = ht->getAtoms()[index]; + if(weakKeys && AvmCore::isGCObject(a)) { + GCWeakRef *weakRef = (GCWeakRef*)AvmCore::atomToGCObject(a); + if(weakRef->get()) + return (index>>1)+1; + else { + ht->getAtoms()[index] = Hashtable::DELETED; + ht->getAtoms()[index+1] = Hashtable::DELETED; + ht->setHasDeletedItems(true); + } + } else if(a != 0 && a != Hashtable::DELETED) { + return (index>>1)+1; + } + index += 2; + } + return 0; + } +} diff --git a/mozilla/js/tamarin/extensions/DictionaryGlue.h b/mozilla/js/tamarin/extensions/DictionaryGlue.h new file mode 100644 index 00000000000..4377a70db1f --- /dev/null +++ b/mozilla/js/tamarin/extensions/DictionaryGlue.h @@ -0,0 +1,73 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 1993-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#ifndef DICTIONARYGLUE_INCLUDED +#define DICTIONARYGLUE_INCLUDED + +namespace avmplus +{ + class DictionaryObject : public ScriptObject + { + public: + DictionaryObject(VTable *vtable, ScriptObject *delegate); + ~DictionaryObject(); + void construct(bool weakKeys); + + virtual Hashtable* getTable() const { return table; } + + // multiname and Stringp forms fall through to ScriptObject + virtual Atom getProperty(Atom name) const; + virtual bool hasProperty(Atom name) const; + virtual bool deleteProperty(Atom name); + virtual void setProperty(Atom name, Atom value); + + virtual Atom nextName(int index); + virtual int nextNameIndex(int index); + + private: + DWB(Hashtable*) table; + bool weakKeys; + + Atom getKeyFromObject(Atom object) const; + WeakKeyHashtable *weakTable() const { return (WeakKeyHashtable*)(Hashtable*)table; } + }; + + class DictionaryClass : public ClassClosure + { + public: + DictionaryClass(VTable *vtable); + ScriptObject *createInstance(VTable *ivtable, ScriptObject *delegate); + DECLARE_NATIVE_MAP(DictionaryClass) + }; +} + +#endif /* DICTIONARYGLUE_INCLUDED */ diff --git a/mozilla/js/tamarin/extensions/JavaGlue.cpp b/mozilla/js/tamarin/extensions/JavaGlue.cpp new file mode 100644 index 00000000000..c550495729f --- /dev/null +++ b/mozilla/js/tamarin/extensions/JavaGlue.cpp @@ -0,0 +1,1685 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +// @todo +// local ref and global refs not used at all! +// support for arrays +// 128 is a very nice number but its not the best way to pick how much room is needed for signatures etc. +// +#include "avmplus.h" +#include "avmshell.h" +#include "JavaGlue.h" + +#ifdef WIN32 +#include +#endif + +#ifdef AVMPLUS_MAC +#include +#endif + +namespace avmplus +{ + BEGIN_NATIVE_MAP(JObjectClass) + NATIVE_METHOD(avmplus_JObject_toString, JObject::_toString) + NATIVE_METHOD(avmplus_JObject_methodSignature, JObjectClass::methodSignature) + NATIVE_METHOD(avmplus_JObject_fieldSignature, JObjectClass::fieldSignature) + NATIVE_METHOD(avmplus_JObject_constructorSignature, JObjectClass::constructorSignature) + NATIVE_METHOD(avmplus_JObject_create, JObjectClass::create) + NATIVE_METHOD(avmplus_JObject_createArray, JObjectClass::createArray) + NATIVE_METHOD(avmplus_JObject_toArray, JObjectClass::toArray) + END_NATIVE_MAP() + + JObjectClass* JObjectClass::cc = 0; //@todo hack to remove + + JObjectClass::JObjectClass(VTable *cvtable) + : ClassClosure(cvtable) + { + // @hack for now so we know our class closure + cc = this; + } + + ScriptObject* JObjectClass::createInstance(VTable *ivtable, ScriptObject *prototype) + { + return new (core()->GetGC(), ivtable->getExtraSize()) JObject(ivtable, prototype); + } + + String* JObjectClass::constructorSignature(String* name, Atom* argv, int argc) + { + AvmCore* core = this->core(); + String* s = core->kundefined; + + // get the class first + JClass* clazz = forName(name); + if (clazz) + { + // now see what constructor would be fired + // some space for our descriptors + char descriptors[256]; + char *argvDesc = &descriptors[0]; + char *constrDesc = &descriptors[128]; + + // create a description of our args so we can best match which constructor to call + clazz->argsDescriptor(core, argvDesc, argc, argv); + + // get the constructor and call it + jobject constr = clazz->constructorFor(argvDesc, argc, constrDesc); + if (constr) + { + Java* jvm = clazz->jvm(); + jstring str = (jstring) jvm->jni->CallObjectMethod(constr, jvm->java_lang_Object_toString() ); + s = jvm->newString(core, str); + } + } + AvmAssert( jvm()->jni->ExceptionOccurred() == 0); + return s; + } + + String* JObjectClass::methodSignature(JObject* jobj, String* name, Atom* argv, int argc) + { + AvmCore* core = jobj->core(); + String* s = core->kundefined; + + // now see what method would be fired + JClass* clazz = jobj->getClass(); + + // some space for our descriptors + char descriptors[256]; + char *argvDesc = &descriptors[0]; + char *methodDesc = &descriptors[128]; + + // create a description of our args so we can best match which method to call + clazz->argsDescriptor(core, argvDesc, argc, argv); + + // get the method and call it + jobject method = clazz->methodFor(name, argvDesc, argc, methodDesc); + if (method) + { + Java* jvm = clazz->jvm(); + jstring str = (jstring) jvm->jni->CallObjectMethod(method, jvm->java_lang_Object_toString() ); + s = jvm->newString(core, str); + } + AvmAssert( clazz->jvm()->jni->ExceptionOccurred() == 0); + return s; + } + + String* JObjectClass::fieldSignature(JObject* jobj, String* name) + { + AvmCore* core = jobj->core(); + String* s = core->kundefined; + + // now see what field would be accessed + JClass* clazz = jobj->getClass(); + jobject field = clazz->fieldFor(name); + if (field) + { + Java* jvm = clazz->jvm(); + jstring str = (jstring) jvm->jni->CallObjectMethod(field, jvm->java_lang_Object_toString() ); + s = jvm->newString(core, str); + } + AvmAssert( clazz->jvm()->jni->ExceptionOccurred() == 0); + return s; + } + + JClass* JObjectClass::forName(String* name) + { + JClass* c = 0; + Java* j = jvm(); + JNIEnv* jni = j->jni; + UTF8String* str = name->toUTF8String(); + char* nm = str->lockBuffer(); + Java::replace(nm, nm, '.'); + jobject it = jni->FindClass(nm); + str->unlockBuffer(); + jthrowable jthrow = jni->ExceptionOccurred(); + if (jthrow) + throwException(j, toplevel(), kClassNotFoundError, jthrow); + else if (it) + c = (JClass*) new (core()->GetGC()) JClass(j, name, (jclass)it); + return c; + } + + void JObjectClass::throwException(Java* j, Toplevel* top, int errorId, jthrowable jthrow, String* arg1, String* arg2) + { + JNIEnv* jni = j->jni; + jni->ExceptionClear(); + jstring jstr = (jstring) jni->CallObjectMethod(jthrow, j->java_lang_Object_toString()); + String* str = j->newString(top->core(), jstr); + top->errorClass()->throwError(errorId, str, arg1, arg2); + } + + JClass* JObjectClass::forType(jstring type) + { + JClass* c = 0; + Java* j = jvm(); + JNIEnv* jni = j->jni; + + jobject it = jni->CallStaticObjectMethod(j->java_lang_Class(), j->java_lang_Class_forName(), type); + jthrowable jthrow = jni->ExceptionOccurred(); + if (jthrow) + { + throwException(j, toplevel(), kClassNotFoundError, jthrow); + } + else if (it) + { + String* stype = j->newString(core(), type); + c = (JClass*) new (core()->GetGC()) JClass(j, stype, (jclass)it); + } + return c; + } + + JObject* JObjectClass::create(String* name, Atom* argv, int argc) + { + // get the class first + JClass* clazz = forName(name); + if (!clazz) + toplevel()->throwError(kClassNotFoundError, name); + + // wrap it in a JObject + JObject* obj = createJObjectShell(clazz); + + // now construct an instance of this class within the jvm + jobject jobj = clazz->callConstructor(this, argc, argv); + obj->setObject(jobj); + + if (!jobj && argc) + { + // no constructor was called, so if we have no args then this is a purely static object + toplevel()->throwError(kNotConstructorError, name); + } + AvmAssert( jvm()->jni->ExceptionOccurred() == 0); + return obj; + } + + JObject* JObjectClass::createArray(JObject* arrayType, int size, ArrayObject* arr) + { + Java* vm = jvm(); + JNIEnv* jni = vm->jni; + + // arrayType should be a class object of the type of array we wish to create + jobject aobj = arrayType->getObject(); + if (!aobj || jni->IsInstanceOf(aobj, vm->java_lang_Class()) != JNI_TRUE) + toplevel()->throwError(kClassNotFoundError, core()->string(arrayType->toString())); + + // build a JClass for the entry + jstring type = (jstring) jni->CallObjectMethod( aobj, vm->java_lang_Class_getName() ); + JClass* clazz = forType( type ); + if (!clazz) + toplevel()->throwError(kClassNotFoundError, core()->string(arrayType->toString())); + + // now construct an instance of this array + jarray jobj = clazz->createArray(this, size, arr); + jthrowable jthrow = jni->ExceptionOccurred(); + if (jthrow) + throwException(vm, toplevel(), kClassNotFoundError, jthrow); + + // wrap it in a JObject + JObject* obj = createJObjectShell(clazz); + obj->setObject(jobj); + + AvmAssert( jvm()->jni->ExceptionOccurred() == 0); + return obj; + } + + ArrayObject* JObjectClass::toArray(JObject* jobj) + { + return 0; + } + + JObject* JObjectClass::createJObjectShell(JClass* clazz) + { + if (!clazz) + return 0; + + // now let's create an AS object using this class as a template + Atom args[1] = { nullObjectAtom }; + JObject* obj = (JObject*) AvmCore::atomToScriptObject( construct(0,args) ); + obj->setClass(clazz); + AvmAssert( jvm()->jni->ExceptionOccurred() == 0); + return obj; + } + + Java* JObjectClass::jvm() + { + // make sure a VM is available from core + AvmCore* core = this->core(); + Java* vm = core->java; + if (!vm) + { + vm = new (core->GetGC()) Java(); + if (vm->startupJVM(core) == JNI_OK) + core->java = vm; + else + toplevel()->throwError( kFileOpenError, core->newString("Java Virtual Machine - Runtime System") ); + } + return core->java; + } + + // + // JObject + // + JObject::JObject(VTable *vtable, ScriptObject *proto) + : ScriptObject(vtable, proto) + { + } + + JObject::~JObject() {} + + ScriptObject* JObject::createInstance(VTable *ivtable, ScriptObject *prototype) + { + return new (core()->GetGC(), ivtable->getExtraSize()) JObject(ivtable, prototype); + } + +// for property assignment +// void ScriptObject::setProperty(Multiname* name, Atom value) + +// get property + Atom JObject::getProperty(Atom name) const + { + Java* vm = jclass->jvm(); + JNIEnv* jni = vm->jni; + + // is this an array access + Atom a = nullObjectAtom; + AvmCore* core = this->core(); + if ( (jni->CallBooleanMethod(jclass->classRef(), vm->java_lang_Class_isArray()) == JNI_TRUE) ) + { + int index = -1; + if (indexFrom(core, name, &index)) + a = jclass->getArrayElement( (JObject*)this, index ); + else if (core->isString(name)) + { + String* s = core->string(name); + if ( s->Equals(core->klength->c_str(), core->klength->length()) ) + a = core->intToAtom( jni->GetArrayLength((jarray)obj) ); + else + toplevel()->throwError(kReadSealedError, core->atomToString(name), jclass->name() ); + } + else + toplevel()->throwError(kReadSealedError, core->atomToString(name), jclass->name() ); + } + else + { + String* nm = core->atomToString(name); + a = jclass->getField( (JObject*)this, nm); + } + AvmAssert( jclass->jvm()->jni->ExceptionOccurred() == 0); + return a; + } + + bool JObject::indexFrom(AvmCore* core, Atom a, int* index) const + { + bool ok = false; + if (core->isInteger(a)) + { + *index = core->integer(a); + ok = true; + } + else if (core->isString(a)) + { + double d = core->string(a)->toNumber(); + if (!MathUtils::isNaN(d)) + { + *index = (int)d; + ok = true; + } + } + return ok; + } + + // for calls + Atom JObject::callProperty(Multiname* multiname, int argc, Atom* argv) + { + String* nm = multiname->getName(); + Atom a = jclass->callMethod(this, nm, argc, argv); + jthrowable jthrow = jclass->jvm()->jni->ExceptionOccurred(); + if (jthrow) + { + Java* vm = jclass->jvm(); + JNIEnv* jni = vm->jni; + jstring str = (jstring) jni->CallObjectMethod(jthrow, jclass->jvm()->java_lang_Object_toString() ); + String* s = vm->newString(core(), str); + toplevel()->errorClass()->throwError(kIllegalOpcodeError, nm, s, jclass->name()); + } + return a; + } + + bool JObject::hasProperty(Multiname* multi) const + { + String* nm = multi->getName(); + bool has = jclass->hasField( (JObject*)this, nm); + AvmAssert( jclass->jvm()->jni->ExceptionOccurred() == 0); + return has; + } + + void JObject::setProperty(Multiname* multi, Atom value) + { + Java* vm = jclass->jvm(); + JNIEnv* jni = vm->jni; + String* name = multi->getName(); + + // is this an array access + AvmCore* core = this->core(); + int index = -1; + if ( indexFrom(core, name->atom(), &index) && (jni->CallBooleanMethod(jclass->classRef(), vm->java_lang_Class_isArray()) == JNI_TRUE) ) + jclass->setArrayElement(this, index, value ); + else + jclass->setField(this, name, value); + AvmAssert( jclass->jvm()->jni->ExceptionOccurred() == 0); + } + + String* JObject::_toString() const + { + AvmCore* core = this->core(); + String* s = 0; + if (obj) + { + JNIEnv* jni = jclass->jvm()->jni; + #ifdef WRAP_JTOSTRING + s = core->newString("[JObject object='"); + #endif + jstring str = (jstring) jni->CallObjectMethod(obj, jclass->jvm()->java_lang_Object_toString() ); + String* sraw = jclass->jvm()->newString(core, str); + #ifdef WRAP_JTOSTRING + s = core->concatStrings(s, sraw); + s = core->concatStrings(s, core->newString("']")); + #else + s = sraw; + #endif + } + else + { + s = core->newString("[JObject object='"); + } + AvmAssert( jclass->jvm()->jni->ExceptionOccurred() == 0); + return s; + } + + // + // JClass + // + JClass::JClass(Java* j, String* name, jclass cls) + : vm(j) + , nm(name) + , cref(cls) + { + } + + jarray JClass::createArray(JObjectClass* obj, int size, ArrayObject* fillWith) + { + JNIEnv* jni = vm->jni; + + // use the type character to tell us what kind of array this is + jarray arr = 0; + char t = nm->c_str()[1]; + switch( t ) + { + case 'Z': + arr = jni->NewBooleanArray(size); + break; + + case 'B': + arr = jni->NewByteArray(size); + break; + + case 'C': + arr = jni->NewCharArray(size); + break; + + case 'S': + arr = jni->NewShortArray(size); + break; + + case 'I': + arr = jni->NewIntArray(size); + break; + + case 'J': + arr = jni->NewLongArray(size); + break; + + case 'F': + arr = jni->NewFloatArray(size); + break; + + case 'D': + arr = jni->NewDoubleArray(size); + break; + + case 'L': + case 'G': + case '[': + arr = jni->NewObjectArray(size, cref, 0); + break; + + case 'V': + default: + AvmAssertMsg(0, "Wa! what kind of JNI type is this!"); + } + return arr; + } + + jobject JClass::callConstructor(JObjectClass* jobj, int argc, Atom* argv) + { + JNIEnv* jni = vm->jni; + AvmCore* core = jobj->core(); + + // some space for our descriptors + char descriptors[256]; + char *argvDesc = &descriptors[0]; + char *constrDesc = &descriptors[128]; + + // create a description of our args so we can best match which constructor to call + argsDescriptor(core, argvDesc, argc, argv); + + // get the constructor and call it + jobject constr = constructorFor(argvDesc, argc, constrDesc); + if (!constr) + return 0; + + // package up the args + int count = argumentCount(constrDesc); + jvalue* jargs = (jvalue*) alloca( count*sizeof(jvalue) ); + boxArgs(core, jobj->toplevel(), constrDesc, argc, &argv[0], jargs); + for(int i=argc; iFromReflectedMethod(constr); + jobject obj = jni->NewObjectA(cref, mid, jargs); + return obj; + } + + Atom JClass::callMethod(JObject* jobj, String* name, int argc, Atom* argv) + { + JNIEnv* jni = vm->jni; + AvmCore* core = jobj->core(); + + // some space for our descriptors + char descriptors[256]; + char *argvDesc = &descriptors[0]; + char *methodDesc = &descriptors[128]; + + // create a description of our args so we can best match which constructor to call + argsDescriptor(core, argvDesc, argc, &argv[1]); + + // get the method and call it + jobject method = methodFor(name, argvDesc, argc, methodDesc); + if (!method) + { + jobj->toplevel()->throwError(kNotImplementedError, name); + } + + // package up the args + int count = argumentCount(methodDesc); + jvalue* jargs = (jvalue*) alloca( count*sizeof(jvalue) ); + const char* rt = boxArgs(core, jobj->toplevel(), methodDesc, argc, &argv[1], jargs); + for(int i=argc; iCallIntMethod(method, vm->java_lang_reflect_Method_getModifiers() ); + bool is = isStatic(mod); + + // now make the call + jvalue r; + jmethodID mid = jni->FromReflectedMethod(method); + jobject obj = jobj->getObject(); + if (!obj && !is) + jobj->toplevel()->throwError(kNotImplementedError, name); + + switch( *rt ) + { + case 'V': + (is) ? jni->CallStaticVoidMethodA(cref, mid, jargs) : jni->CallVoidMethodA(obj, mid, jargs); + break; + + case 'Z': + r.z = (is) ? jni->CallStaticBooleanMethodA(cref, mid, jargs) : r.z = jni->CallBooleanMethodA(obj, mid, jargs); + break; + + case 'B': + r.b = (is) ? jni->CallStaticByteMethodA(cref, mid, jargs) : r.b = jni->CallByteMethodA(obj, mid, jargs); + break; + + case 'C': + r.c = (is) ? jni->CallStaticCharMethodA(cref, mid, jargs) : r.c = jni->CallCharMethodA(obj, mid, jargs); + break; + + case 'S': + r.s = (is) ? jni->CallStaticShortMethodA(cref, mid, jargs) : r.s = jni->CallShortMethodA(obj, mid, jargs); + break; + + case 'I': + r.i = (is) ? jni->CallStaticIntMethodA(cref, mid, jargs) : r.i = jni->CallIntMethodA(obj, mid, jargs); + break; + + case 'J': + r.j = (is) ? jni->CallStaticLongMethodA(cref, mid, jargs) : r.j = jni->CallLongMethodA(obj, mid, jargs); + break; + + case 'F': + r.f = (is) ? jni->CallStaticFloatMethodA(cref, mid, jargs) : r.f = jni->CallFloatMethodA(obj, mid, jargs); + break; + + case 'D': + r.d = (is) ? jni->CallStaticDoubleMethodA(cref, mid, jargs) : r.d = jni->CallDoubleMethodA(obj, mid, jargs); + break; + + case 'L': + case 'G': + case '[': + r.l = (is) ? jni->CallStaticObjectMethodA(cref, mid, jargs) : r.l = jni->CallObjectMethodA(obj, mid, jargs); + break; + + default: + AvmAssertMsg(0, "Wa! what kind of JNI type is this!"); + } + + // coerce type into an AS representation + Atom a = undefinedAtom; + jvalueToAtom(core, jobj->toplevel(), r, rt, a); + return a; + } + + bool JClass::hasField(JObject* jobj, String* nm) + { + jobject field = fieldFor(nm); + return (field == 0) ? false : true; + } + + Atom JClass::getField(JObject* jobj, String* nm) + { + JNIEnv* jni = vm->jni; + AvmCore* core = jobj->core(); + char fieldDesc[128]; + + jobject field = fieldFor(nm); + if (!field) + { + jobj->toplevel()->throwError(kReadSealedError, nm, name() ); + } + + // get the descriptor for the field + jclass cls = (jclass) jni->CallObjectMethod(field, vm->java_lang_reflect_Field_getType() ); + descriptorVerbose(fieldDesc, cls); + + // now static or no? + jint mod = jni->CallIntMethod(field, vm->java_lang_reflect_Field_getModifiers() ); + bool is = isStatic(mod); + + // now make the call if we can + jvalue r; + jfieldID fid = jni->FromReflectedField(field); + jobject obj = jobj->getObject(); + if (!obj && !is) + jobj->toplevel()->throwError(kReadSealedError, nm, name() ); + + switch( *fieldDesc ) + { + case 'Z': + r.z = (is) ? jni->GetStaticBooleanField(cref, fid) : jni->GetBooleanField(obj, fid); + break; + + case 'B': + r.b = (is) ? jni->GetStaticByteField(cref, fid) : jni->GetByteField(obj, fid); + break; + + case 'C': + r.c = (is) ? jni->GetStaticCharField(cref, fid) : jni->GetCharField(obj, fid); + break; + + case 'S': + r.s = (is) ? jni->GetStaticShortField(cref, fid) : jni->GetShortField(obj, fid); + break; + + case 'I': + r.i = (is) ? jni->GetStaticIntField(cref, fid) : jni->GetIntField(obj, fid); + break; + + case 'J': + r.j = (is) ? jni->GetStaticLongField(cref, fid) : jni->GetLongField(obj, fid); + break; + + case 'F': + r.f = (is) ? jni->GetStaticFloatField(cref, fid) : jni->GetFloatField(obj, fid); + break; + + case 'D': + r.d = (is) ? jni->GetStaticDoubleField(cref, fid) : jni->GetDoubleField(obj, fid); + break; + + case 'L': + case 'G': + case '[': + r.l = (is) ? jni->GetStaticObjectField(cref, fid) : jni->GetObjectField(obj, fid); + break; + + case 'V': + default: + AvmAssertMsg(0, "Wa! what kind of JNI type is this!"); + } + + // coerce type into an AS representation + Atom a = undefinedAtom; + + //@todo rt is only 1 char! make sure this call doesn't do anything with it + jvalueToAtom(core, jobj->toplevel(), r, fieldDesc, a); + return a; + } + + bool JClass::setField(JObject* jobj, String* nm, Atom val) + { + JNIEnv* jni = vm->jni; + AvmCore* core = jobj->core(); + char fieldDesc[128]; + + jobject field = fieldFor(nm); + if (!field) + { + jobj->toplevel()->throwError(kReadSealedError, nm, name()); + } + + // get the descriptor for the field + jclass cls = (jclass) jni->CallObjectMethod(field, vm->java_lang_reflect_Field_getType() ); + descriptorVerbose(fieldDesc, cls); + + // now static or no? + jint mod = jni->CallIntMethod(field, vm->java_lang_reflect_Field_getModifiers() ); + bool is = isStatic(mod); + + // convert the value + jvalue r; + atomTojvalue(core, jobj->toplevel(), val, fieldDesc, r); + + // now make the call + jfieldID fid = jni->FromReflectedField(field); + jobject obj = jobj->getObject(); + if (!obj && !is) + jobj->toplevel()->throwError(kReadSealedError, nm, name() ); + + bool worked = true; + switch( *fieldDesc ) + { + case 'Z': + (is) ? jni->SetStaticBooleanField(cref, fid, r.z) : jni->SetBooleanField(obj, fid, r.z); + break; + + case 'B': + (is) ? jni->SetStaticByteField(cref, fid, r.b) : jni->SetByteField(obj, fid, r.b); + break; + + case 'C': + (is) ? jni->SetStaticCharField(cref, fid, r.c) : jni->SetCharField(obj, fid, r.c); + break; + + case 'S': + (is) ? jni->SetStaticShortField(cref, fid, r.s) : jni->SetShortField(obj, fid, r.s); + break; + + case 'I': + (is) ? jni->SetStaticIntField(cref, fid, r.i) : jni->SetIntField(obj, fid, r.i); + break; + + case 'J': + (is) ? jni->SetStaticLongField(cref, fid, r.j) : jni->SetLongField(obj, fid, r.j); + break; + + case 'F': + (is) ? jni->SetStaticFloatField(cref, fid, r.f) : jni->SetFloatField(obj, fid, r.f); + break; + + case 'D': + (is) ? jni->SetStaticDoubleField(cref, fid, r.d) : jni->SetDoubleField(obj, fid, r.d); + break; + + case 'L': + case 'G': + case '[': + (is) ? jni->SetStaticObjectField(cref, fid, r.l) : jni->SetObjectField(obj, fid, r.l); + break; + + case 'V': + default: + AvmAssertMsg(0, "Wa! what kind of JNI type is this!"); + worked = false; + } + return worked; + } + + bool JClass::isJObject(AvmCore* core, Atom a) + { + bool yes = false; + if ( core->isObject(a) ) + { + ScriptObject* sc = core->atomToScriptObject(a); + yes = (sc->getDelegate()->atom() == JObjectClass::cc->get_prototype() ) ? true : false; //@todo fix this + } + return yes; + } + + bool JClass::isStatic(jint modifiers) + { + return (modifiers & vm->modifier_STATIC) == 0 ? false : true; + } + + Atom JClass::getArrayElement(JObject* jobj, int index) + { + JNIEnv* jni = vm->jni; + AvmCore* core = jobj->core(); + + // now make the call if we can + jobject obj = jobj->getObject(); + if (!obj) + jobj->toplevel()->throwError(kReadSealedError, core->string(core->intToAtom(index)), name() ); + + jvalue r; + char t = nm->c_str()[1]; + switch( t ) + { + case 'Z': + { + jboolean* ptr = jni->GetBooleanArrayElements( (jbooleanArray) obj, 0 ); + r.z = ptr[index]; + jni->ReleaseBooleanArrayElements( (jbooleanArray)obj, ptr, JNI_ABORT); + break; + } + case 'B': + { + jbyte* ptr = jni->GetByteArrayElements( (jbyteArray) obj, 0 ); + r.b = ptr[index]; + jni->ReleaseByteArrayElements( (jbyteArray)obj, ptr, JNI_ABORT); + break; + } + case 'C': + { + jchar* ptr = jni->GetCharArrayElements( (jcharArray) obj, 0 ); + r.c = ptr[index]; + jni->ReleaseCharArrayElements( (jcharArray)obj, ptr, JNI_ABORT); + break; + } + case 'S': + { + jshort* ptr = jni->GetShortArrayElements( (jshortArray) obj, 0 ); + r.s = ptr[index]; + jni->ReleaseShortArrayElements( (jshortArray)obj, ptr, JNI_ABORT); + break; + } + case 'I': + { + jint* ptr = jni->GetIntArrayElements( (jintArray) obj, 0 ); + r.i = ptr[index]; + jni->ReleaseIntArrayElements( (jintArray)obj, ptr, JNI_ABORT); + break; + } + case 'J': + { + jlong* ptr = jni->GetLongArrayElements( (jlongArray) obj, 0 ); + r.j = ptr[index]; + jni->ReleaseLongArrayElements( (jlongArray)obj, ptr, JNI_ABORT); + break; + } + case 'F': + { + jfloat* ptr = jni->GetFloatArrayElements( (jfloatArray) obj, 0 ); + r.f = ptr[index]; + jni->ReleaseFloatArrayElements( (jfloatArray)obj, ptr, JNI_ABORT); + break; + } + case 'D': + { + jdouble* ptr = jni->GetDoubleArrayElements( (jdoubleArray) obj, 0 ); + r.d = ptr[index]; + jni->ReleaseDoubleArrayElements( (jdoubleArray)obj, ptr, JNI_ABORT); + break; + } + case 'L': + case 'G': + case '[': + r.l = jni->GetObjectArrayElement( (jobjectArray) obj, index ); + break; + + case 'V': + default: + AvmAssertMsg(0, "Wa! what kind of JNI type is this!"); + } + + //@todo rt is only 1 char! make sure this call doesn't do anything with it + Atom a = undefinedAtom; + jvalueToAtom(core, jobj->toplevel(), r, &t, a); + return a; + } + + void JClass::setArrayElement(JObject* jobj, int index, Atom val) + { + JNIEnv* jni = vm->jni; + AvmCore* core = jobj->core(); + + // now make the call if we can + jobject obj = jobj->getObject(); + if (!obj) + jobj->toplevel()->throwError(kReadSealedError, core->string(core->intToAtom(index)), name() ); + + // convert the value + char t = nm->c_str()[1]; + jvalue r; + atomTojvalue(core, jobj->toplevel(), val, &t, r); + switch( t ) + { + case 'Z': + { + jboolean* ptr = jni->GetBooleanArrayElements( (jbooleanArray) obj, 0 ); + ptr[index] = r.z; + jni->ReleaseBooleanArrayElements( (jbooleanArray)obj, ptr, 0); + break; + } + case 'B': + { + jbyte* ptr = jni->GetByteArrayElements( (jbyteArray) obj, 0 ); + ptr[index] = r.b; + jni->ReleaseByteArrayElements( (jbyteArray)obj, ptr, 0); + break; + } + case 'C': + { + jchar* ptr = jni->GetCharArrayElements( (jcharArray) obj, 0 ); + ptr[index] = r.c; + jni->ReleaseCharArrayElements( (jcharArray)obj, ptr, 0); + break; + } + case 'S': + { + jshort* ptr = jni->GetShortArrayElements( (jshortArray) obj, 0 ); + ptr[index] = r.s; + jni->ReleaseShortArrayElements( (jshortArray)obj, ptr, 0); + break; + } + case 'I': + { + jint* ptr = jni->GetIntArrayElements( (jintArray) obj, 0 ); + ptr[index] = r.i; + jni->ReleaseIntArrayElements( (jintArray)obj, ptr, 0); + break; + } + case 'J': + { + jlong* ptr = jni->GetLongArrayElements( (jlongArray) obj, 0 ); + ptr[index] = r.j; + jni->ReleaseLongArrayElements( (jlongArray)obj, ptr, 0); + break; + } + case 'F': + { + jfloat* ptr = jni->GetFloatArrayElements( (jfloatArray) obj, 0 ); + ptr[index] = r.f; + jni->ReleaseFloatArrayElements( (jfloatArray)obj, ptr, 0); + break; + } + case 'D': + { + jdouble* ptr = jni->GetDoubleArrayElements( (jdoubleArray) obj, 0 ); + ptr[index] = r.d; + jni->ReleaseDoubleArrayElements( (jdoubleArray)obj, ptr, 0); + break; + } + case 'L': + case 'G': + case '[': + jni->SetObjectArrayElement( (jobjectArray) obj, index, r.l); + break; + + case 'V': + default: + AvmAssertMsg(0, "Wa! what kind of JNI type is this!"); + } + } + + /** + * Given a list of parameters locate a constructor on the object + * which satisfies the signature criteria + * @return a java.lang.reflect.Constructor + * object is returned or 0 if no matching method was found + */ + jobject JClass::constructorFor(const char* argvDesc, int argc, char* constrDesc) + { + JNIEnv* jni = vm->jni; + AvmAssert( jni->IsInstanceOf(cref, vm->java_lang_Class()) == JNI_TRUE ); + jobjectArray arr = (jobjectArray) jni->CallObjectMethod(cref, vm->java_lang_Class_getConstructors()); + + // now we need to iterate over the constructor array looking for a good match + int len = jni->GetArrayLength(arr); + jobject match = 0; + char desc[128]; + for(int i=0; iGetObjectArrayElement(arr, i); + if (constructorDescriptor(desc, m) != argc) + continue; + + if (match) + { + // return the closer argument match between the two constructors + const char* which = compareDescriptors(argvDesc, constrDesc, desc); + if (which == constrDesc) + continue; + } + strcpy(constrDesc, desc); + match = m; + } + return match; + } + + /** + * Given a name and list of parameters locate a method on the object + * which satisfies the signature criteria + * @return a java.lang.reflect.Method + * object is returned or 0 if no matching method was found + */ + jobject JClass::methodFor(String* name, const char* argvDesc, int argc, char* methodDesc) + { + JNIEnv* jni = vm->jni; + AvmAssert( jni->IsInstanceOf(cref, vm->java_lang_Class()) == JNI_TRUE ); + jobjectArray arr = (jobjectArray) jni->CallObjectMethod(cref, vm->java_lang_Class_getMethods()); + + // now we need to iterate over the method array looking for a good match + int len = jni->GetArrayLength(arr); + jobject match = 0; + char desc[128]; + for(int i=0; iGetObjectArrayElement(arr, i); + jstring nm = (jstring) jni->CallObjectMethod(m, vm->java_lang_reflect_Method_getName()); + if ( !stringsEqual(nm, name) ) + continue; + + if (methodDescriptor(desc, m) != argc) + continue; + + if (match) + { + // return the closer argument match between the two constructors + const char* which = compareDescriptors(argvDesc, methodDesc, desc); + if (which == methodDesc) + continue; + } + strcpy(methodDesc, desc); + match = m; + } + return match; + } + + /** + * Given a name find the associated field + * @return a java.lang.reflect.Field + * object is returned or 0 if no matching method was found + */ + jobject JClass::fieldFor(String* name) + { + JNIEnv* jni = vm->jni; + AvmAssert( jni->IsInstanceOf(cref, vm->java_lang_Class()) == JNI_TRUE ); + + jstring jstr = jni->NewString( name->c_str(), name->length() ); + jobject match = jni->CallObjectMethod(cref, vm->java_lang_Class_getField(), jstr); + return match; + } + + bool JClass::stringsEqual(jstring s1, String* s2) + { + JNIEnv* jni = vm->jni; + bool eq = false; + int len = jni->GetStringLength(s1); + if (len == s2->length()) + { + const jchar* ch = jni->GetStringChars(s1, 0); + eq = s2->Equals(ch, len); + jni->ReleaseStringChars(s1, ch); + } + return eq; + } + + int JClass::argumentCount(const char* d) + { + int i = 0; + AvmAssert(*d == '('); + d++; // past the paren + for(; *d != ')' && *d != 'V'; d++, i++) + ; + return i; + } + + const char* JClass::boxArgs(AvmCore* core, Toplevel* toplevel, const char* descriptor, int argc, Atom* argv, jvalue* jargs) + { + AvmAssert(*descriptor == '('); + descriptor++; // past the paren + for(int i=0; ijni; + int argc = 0; + *desc++ = '('; + jobjectArray arr = (jobjectArray) jni->CallObjectMethod(method, vm->java_lang_reflect_Method_getParameterTypes() ); + int max = jni->GetArrayLength(arr); + for(int i=0; iGetObjectArrayElement(arr, i); + char ch = descriptorChar(type); + if (ch != 'V') argc++; + *desc++ = ch; + } + + // now the return type + *desc++ = ')'; + jclass rt = (jclass)jni->CallObjectMethod( method, vm->java_lang_reflect_Method_getReturnType() ); + desc = descriptorVerbose(desc, rt); + *desc = '\0'; + return argc; + } + + // build a jni-like descriptor for the signature of the constructor + int JClass::constructorDescriptor(char* desc, jobject constr) + { + // first the parameters + JNIEnv* jni = vm->jni; + int argc = 0; + *desc++ = '('; + jobjectArray arr = (jobjectArray) jni->CallObjectMethod(constr, vm->java_lang_reflect_Constructor_getParameterTypes() ); + int max = jni->GetArrayLength(arr); + for(int i=0; iGetObjectArrayElement(arr, i); + char ch = descriptorChar(type); + if (ch != 'V') argc++; + *desc++ = ch; + } + + // return type is void + *desc++ = ')'; + *desc++ = 'V'; + *desc = '\0'; + return argc; + } + + /** + * Choose the better fit of 2 descriptors against a baseline + * no check is performed on the number of args + */ + const char* JClass::compareDescriptors(const char* base, const char* desc1, const char* desc2) + { + int m1=0, m2=0; // conversion factors for d1 and d2 + const char* d1 = (*desc1 == '(') ? desc1+1 : desc1; + const char* d2 = (*desc2 == '(') ? desc2+1 : desc2; + while(*base && *base != ')') + { + m1 += conversionCost(base, d1++); + m2 += conversionCost(base, d2++); + base++; + } + return (m2isBoolean(a)) + *desc++ = 'Z'; + else if (core->isInteger(a)) + { + // see if it can be reduced + int val = core->integer(a); + if (val >= -128 && val < 127) + *desc++ = 'B'; + else if (val >= -32768 && val < 32767) + *desc++ = 'S'; + else + *desc++ = 'I'; + } + else if (core->isDouble(a)) + *desc++ = 'D'; + else if (core->isNullOrUndefined(a)) + *desc++ = 'X'; + else if (core->istype(a, ARRAY_TYPE)) + *desc++ = '['; + else if (core->isString(a)) + *desc++ = 'G'; + else + *desc++ = 'L'; // class + } + *desc = '\0'; + return argc; + } + + char* JClass::descriptorVerbose(char* desc, jclass cls) + { + JNIEnv* jni = vm->jni; + *desc++ = descriptorChar(cls); + if (desc[-1] == 'L' || desc[-1] == '[') + { + // append the class/array name in unicode + const jchar *str, *src; + jstring jstr = (jstring)jni->CallObjectMethod(cls, vm->java_lang_Class_getName() ); + src = str = jni->GetStringChars(jstr, 0); + while(src && *src) + *desc++ = (char)*src++; + jni->ReleaseStringChars(jstr, str); + } + *desc = '\0'; + return desc; + } + + char JClass::descriptorChar(jclass cls) + { + JNIEnv* jni = vm->jni; + char ch = '\0'; + if ( jni->CallBooleanMethod(cls, vm->java_lang_Class_isPrimitive()) == JNI_TRUE ) + { + if ( jni->IsSameObject(cls, vm->java_lang_Boolean_class()) ) + ch = 'Z'; + else if ( jni->IsSameObject(cls, vm->java_lang_Byte_class()) ) + ch = 'B'; + else if ( jni->IsSameObject(cls, vm->java_lang_Character_class()) ) + ch = 'C'; + else if ( jni->IsSameObject(cls, vm->java_lang_Short_class()) ) + ch = 'S'; + else if ( jni->IsSameObject(cls, vm->java_lang_Integer_class()) ) + ch = 'I'; + else if ( jni->IsSameObject(cls, vm->java_lang_Long_class()) ) + ch = 'J'; + else if ( jni->IsSameObject(cls, vm->java_lang_Float_class()) ) + ch = 'F'; + else if ( jni->IsSameObject(cls, vm->java_lang_Double_class()) ) + ch = 'D'; + else if ( jni->IsSameObject(cls, vm->java_lang_Void_class()) ) + ch = 'V'; + else + AvmAssert(0); // unknown type?!? + } + else if ( jni->IsSameObject(cls, vm->java_lang_String()) ) + ch = 'G'; + else if ( jni->CallBooleanMethod(cls, vm->java_lang_Class_isArray()) == JNI_TRUE ) + ch = '['; + else + ch = 'L'; + return ch; + } + + /** + * Do a conversion to the given type + */ + const char* JClass::atomTojvalue(AvmCore* core, Toplevel* toplevel, Atom a, const char* type, jvalue& val) + { + switch( *type++ ) + { + case 'Z': + val.z = (jboolean) ( core->booleanAtom(a) == trueAtom) ? JNI_TRUE : JNI_FALSE; + break; + + case 'B': + val.b = (jbyte) ( core->integer(a) ); + break; + + case 'C': + val.c = *( core->string(a) )[0]; + break; + + case 'S': + val.s = (jshort) ( core->integer(a) ); + break; + + case 'I': + val.i = core->integer(a); + break; + + case 'J': + atomTojlong(core, a, val.j); + break; + + case 'F': + val.f = core->number(a); + break; + + case 'D': + val.d = core->number(a); + break; + + case '[': + case 'L': + { + if ( !isJObject(core, a) ) + { + // trying to pass a non-JObject into a jni method, throw exception + toplevel->throwError(kInvalidArgumentError, core->atomToErrorString(a)); + } + JObject* obj = (JObject*)core->atomToScriptObject(a); + val.l = obj->getObject(); + break; + } + case 'G': + { + JNIEnv* jni = vm->jni; + String* str = core->string(a); + jstring jstr = jni->NewString(*str, str->length()); + //@todo need way to dispose of jstr after it last use + val.l = jstr; + break; + } + default: + AvmAssertMsg(0, "Wa! what kind of JNI type is this!"); + val.j = 0; + break; + } + return type; + } + + void JClass::atomTojlong(AvmCore* core, Atom a, jlong& val) + { + if (core->isString(a)) + { + String* str = core->string(a); + if (core->isDigit(*str[0]) || *str[0] == '-') + { + //@todo need to support -9223372036854775808 to 9223372036854775807, inclusive + } + } + + // so a string with digits should be converable + val = (jlong) ( core->integer(a) ); + } + + /** + * Do the conversion from the given type to the most appropriate AS type + */ + const char* JClass::jvalueToAtom(AvmCore* core, Toplevel* toplevel, jvalue& val, const char* type, Atom& a) + { + switch( *type++ ) + { + case 'Z': + a = (val.z == JNI_TRUE) ? trueAtom : falseAtom; + break; + + case 'B': + a = core->intToAtom(val.b); + break; + + case 'C': + { + wchar b[2] = { val.c, 0 }; + String* s = core->newString(b); + a = s->atom(); + break; + } + case 'S': + a = core->intToAtom(val.s); + break; + + case 'I': + a = core->intToAtom(val.i); + break; + + case 'J': + a = core->numberAtom( jlongToString(core, val.j)->atom() ); // rather demented conversion route but good enought for now + break; + + case 'F': + a = core->doubleToAtom( (double)val.f ); + break; + + case 'D': + a = core->doubleToAtom( (double)val.d ); + break; + + case 'G': + { + if (val.l == 0) + a = nullStringAtom; + else + { +#ifdef CONVERT_TO_AS_STRING + JNIEnv* jni = vm->jni; + const jchar* jstr = jni->GetStringChars( (jstring)val.l, 0); + a = core->newString(jstr)->atom(); + jni->ReleaseStringChars( (jstring)val.l, jstr ); +#else + JClass* clazz = (JClass*) JObjectClass::cc->forName( core->newString("java.lang.String") ); //@todo cache this + JObject* obj = (JObject*) JObjectClass::cc->createJObjectShell(clazz); + obj->setObject(val.l); + a = obj->atom(); +#endif + } + break; + } + case 'L': + case '[': + { + if (val.l == 0) + a = nullObjectAtom; + else + { + JClass* clazz = (JClass*) JObjectClass::cc->forName( core->newString(type) ); + JObject* obj = (JObject*) JObjectClass::cc->createJObjectShell(clazz); + obj->setObject(val.l); + a = obj->atom(); + } + break; + } + case 'V': + a = undefinedAtom; + break; + + default: + AvmAssertMsg(0, "Wa! what kind of JNI type is this!"); + } + return type; + } + + String* JClass::jlongToString(AvmCore* core, jlong& val) + { + wchar *b,*start; + String* str = new (core->GetGC()) String(20); // max 20 digits in 64bit int including sign + b = start = str->lockBuffer(); + bool neg = (val<0) ? true : false; + jlong l = (neg) ? -val : val; + do + { + *b-- = '0' + (char)( l % 10 ); + l /= 10; + } + while(l>0); + if (neg) *b-- = '-'; + while(b>=start) *b-- = ' '; + str->unlockBuffer(20); + return str; + } + + /*static*/ char* Java::startup_options = 0; + + Java::Java() + : bound(false) + { + } + + Java::~Java() + { + if (jvm) + jvm->DestroyJavaVM(); + jvm = 0; + jni = 0; + } + + String* Java::newString(AvmCore* core, jstring jstr) + { + int len = jni->GetStringLength(jstr); + const jchar* raw = jni->GetStringChars(jstr, 0); + String* s = new (core->GetGC()) String(raw, len); + jni->ReleaseStringChars(jstr, raw); + return s; + } + + char* Java::replace(char* dst, const char* src, char what, char with) + { + int i=0; + for(; src[i]; i++) + if (src[i] == what) dst[i] = with; else dst[i] = src[i]; + dst[i] = '\0'; + return dst; + } + +#define JAVA_KEY_1_5 "Software\\JavaSoft\\Java Runtime Environment\\1.5" +#define JAVA_KEY_1_4 "Software\\JavaSoft\\Java Runtime Environment\\1.4" +#define JAVA_KEY_1_3 "Software\\JavaSoft\\Java Runtime Environment\\1.3" +#define JAVA_KEY_1_2 "Software\\JavaSoft\\JRE" +#define JRE_KEY "RuntimeLib" + +#define DL_LIB "/System/Library/Frameworks/JavaVM.framework/Libraries/libjvm.dylib" + + bool Java::bindLibrary(AvmCore* core) + { + if (!bound) + { +#ifdef AVMPLUS_WIN32 + HKEY hKey = NULL; + DWORD err; + if ( (err = RegOpenKeyEx(HKEY_LOCAL_MACHINE, JAVA_KEY_1_5, 0, KEY_READ, &hKey)) == ERROR_SUCCESS ) + ; + else if ( (err = RegOpenKeyEx(HKEY_LOCAL_MACHINE, JAVA_KEY_1_4, 0, KEY_READ, &hKey)) == ERROR_SUCCESS ) + ; + else if ( (err = RegOpenKeyEx(HKEY_LOCAL_MACHINE, JAVA_KEY_1_3, 0, KEY_READ, &hKey)) == ERROR_SUCCESS ) + ; + else if ( (err = RegOpenKeyEx(HKEY_LOCAL_MACHINE, JAVA_KEY_1_2, 0, KEY_READ, &hKey)) == ERROR_SUCCESS ) + ; + else + return false; + + TCHAR val[256]; + DWORD length = sizeof(val)*sizeof(TCHAR); + err = RegQueryValueEx(hKey, JRE_KEY, NULL, NULL, (LPBYTE)val, &length); + RegCloseKey(hKey); + + UINT prev = SetErrorMode(SEM_NOOPENFILEERRORBOX); + HMODULE lib = LoadLibrary(val); + #define BIND_FUNC(x,f) f##_ = (_##f)GetProcAddress(x, #f) +#else /* AVMPLUS_WIN32 */ + #define SetErrorMode(x) + #define BIND_FUNC(x,f) f##_ = (_##f)dlsym(lib, #f "_Impl") + void* lib = dlopen(DL_LIB, RTLD_LAZY); +#endif + if (lib) + { + + BIND_FUNC(lib, JNI_GetDefaultJavaVMInitArgs); + BIND_FUNC(lib, JNI_CreateJavaVM); + #undef BIND_FUNC + bound = true; + } + SetErrorMode(prev); + } + return bound; + } + + int Java::startupJVM(AvmCore* core) + { + if (!bindLibrary(core)) + return JNI_NO_LIB; + + union { + JDK1_1InitArgs args_1_1; /* 1.1 args */ + JavaVMInitArgs args; + } vm; + + JavaVMOption options[2]; + vm.args.version = JNI_VERSION_1_2; + vm.args.options = options; + vm.args.ignoreUnrecognized = JNI_FALSE; + options[0].optionString = "-Djava.class.path=."; // default current dir + options[1].optionString = startup_options; + vm.args.nOptions = (startup_options) ? 2 : 1; + + #ifdef AVMPLUS_VERBOSE + if (core->verbose) + core->console << "Creating JavaVM with options " << startup_options; + #endif /* AVMPLUS_VERBOSE */ +#ifdef SUPPORT_JNI_1_1 + // @todo see if we even support this and if so make sure it works + // try to get the args for the vm + if (JNI_GetDefaultJavaVMInitArgs_(&vm) < 0) + { + // how about JDK 1.1 + vm.args.version = JNI_VERSION_1_2; + if (JNI_GetDefaultJavaVMInitArgs_(&vm) < 0) + { + // final attempt! + vm.args_1_1.version = JNI_VERSION_1_1; + vm.args_1_1.classpath = ""; + vm.args_1_1.verbose = true; + if (JNI_GetDefaultJavaVMInitArgs_(&vm) < 0) + return JNI_BAD_VER; + } + } +#endif + /* load and initialize a Java VM, return a JNI interface + * pointer in jni env */ + if (JNI_CreateJavaVM_(&jvm, (void**)&jni, &vm) < 0) + return JNI_VM_FAIL; + + // rev up our engine + char dst[128]; // should be big enough for any class name and descriptor + + INIT_JCLASS(java_lang_Byte); + INIT_JCLASS(java_lang_Boolean); + INIT_JCLASS(java_lang_Class); + INIT_JCLASS(java_lang_Character); + INIT_JCLASS(java_lang_Double); + INIT_JCLASS(java_lang_Float); + INIT_JCLASS(java_lang_Integer); + INIT_JCLASS(java_lang_Long); + INIT_JCLASS(java_lang_Object); + INIT_JCLASS(java_lang_Short); + INIT_JCLASS(java_lang_String); + INIT_JCLASS(java_lang_Void); + INIT_JCLASS(java_lang_reflect_Constructor); + INIT_JCLASS(java_lang_reflect_Field); + INIT_JCLASS(java_lang_reflect_Method); + INIT_JCLASS(java_lang_reflect_Modifier); + + INIT_JMETHODID(java_lang_Object, equals, "(Ljava/lang/Object;)Z"); + INIT_JMETHODID(java_lang_Object, getClass, "()Ljava/lang/Class;"); + INIT_JMETHODID(java_lang_Object, toString, "()Ljava/lang/String;"); + INIT_JMETHODID(java_lang_Class, getName, "()Ljava/lang/String;"); + INIT_JMETHODID(java_lang_Class, getCanonicalName, "()Ljava/lang/String;"); + INIT_JMETHODID(java_lang_Class, getMethods, "()[Ljava/lang/reflect/Method;"); + INIT_JMETHODID(java_lang_Class, getFields, "()[Ljava/lang/reflect/Field;"); + INIT_JMETHODID(java_lang_Class, getField, "(Ljava/lang/String;)Ljava/lang/reflect/Field;"); + INIT_JMETHODID(java_lang_Class, getConstructors, "()[Ljava/lang/reflect/Constructor;"); + INIT_JMETHODID(java_lang_Class, isPrimitive, "()Z"); + INIT_JMETHODID(java_lang_Class, isArray, "()Z"); + INIT_SJMETHODID(java_lang_Class, forName, "(Ljava/lang/String;)Ljava/lang/Class;"); + INIT_JMETHODID(java_lang_reflect_Method, getName, "()Ljava/lang/String;"); + INIT_JMETHODID(java_lang_reflect_Method, getReturnType, "()Ljava/lang/Class;"); + INIT_JMETHODID(java_lang_reflect_Method, getParameterTypes, "()[Ljava/lang/Class;"); + INIT_JMETHODID(java_lang_reflect_Method, getModifiers, "()I"); + INIT_JMETHODID(java_lang_reflect_Field, getName, "()Ljava/lang/String;"); + INIT_JMETHODID(java_lang_reflect_Field, getType, "()Ljava/lang/Class;"); + INIT_JMETHODID(java_lang_reflect_Field, getModifiers, "()I"); + INIT_JMETHODID(java_lang_reflect_Constructor, getParameterTypes, "()[Ljava/lang/Class;"); + + INIT_PRIMITIVE_TYPE(java_lang_Byte); + INIT_PRIMITIVE_TYPE(java_lang_Boolean); + INIT_PRIMITIVE_TYPE(java_lang_Character); + INIT_PRIMITIVE_TYPE(java_lang_Double); + INIT_PRIMITIVE_TYPE(java_lang_Float); + INIT_PRIMITIVE_TYPE(java_lang_Integer); + INIT_PRIMITIVE_TYPE(java_lang_Long); + INIT_PRIMITIVE_TYPE(java_lang_Short); + INIT_PRIMITIVE_TYPE(java_lang_Void); + + modifier_STATIC = jni->GetStaticIntField(java_lang_reflect_Modifier(), jni->GetStaticFieldID(java_lang_reflect_Modifier(), "STATIC", "I")); + modifier_FINAL = jni->GetStaticIntField(java_lang_reflect_Modifier(), jni->GetStaticFieldID(java_lang_reflect_Modifier(), "FINAL", "I")); + + jthrowable exc = jni->ExceptionOccurred(); + if (exc) + { + /** + * If you land in here it means that one of the above class or method ids + * was not found. set a breakpoint on the dst array and single step over + * each. If you see 0 in EAX then you know which one failed. + */ + // @todo something to do here! + AvmAssertMsg(0, "The VM did not start up correctly; we are dead"); + jni->ExceptionClear(); + return JNI_INIT_FAIL; + } + return JNI_OK; + } +} diff --git a/mozilla/js/tamarin/extensions/JavaGlue.h b/mozilla/js/tamarin/extensions/JavaGlue.h new file mode 100644 index 00000000000..9dc277b33bb --- /dev/null +++ b/mozilla/js/tamarin/extensions/JavaGlue.h @@ -0,0 +1,283 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 1993-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#ifndef _JAVA_GLUE_H_ +#define _JAVA_GLUE_H_ + +#define NO_JNI_STDIO +#include + +/** + * Pointers to the routines that we will be calling. We bind + * dynamically since we don't want to get a can't find dll error + * if we failed to have a vm on this machine. + */ +typedef +_JNI_IMPORT_OR_EXPORT_ jint (JNICALL +*_JNI_GetDefaultJavaVMInitArgs) (void *args); + +typedef +_JNI_IMPORT_OR_EXPORT_ jint (JNICALL +*_JNI_CreateJavaVM) (JavaVM **pvm, void **penv, void *args); + +#define JNI_NO_LIB (-8) /* shared library not found */ +#define JNI_BAD_VER (-9) /* vm version is less than what is required */ +#define JNI_VM_FAIL (-10) /* vm creation failure */ +#define JNI_INIT_FAIL (-11) /* our initialization did not occur correctly */ + +namespace avmplus +{ + class JObject; + class JClass; + + class JObjectClass: public ClassClosure + { + public: + static JObjectClass* cc; //@todo hack to remove + + JObjectClass(VTable *cvtable); + ScriptObject* JObjectClass::createInstance(VTable *ivtable, ScriptObject *prototype); + + /** + * Implementations of AS JObject.xxx() methods + */ + JObject* create(String* name, Atom* argv, int argc); + JObject* createArray(JObject* arrayType, int size, ArrayObject* arr); + ArrayObject* toArray(JObject* jobj); + String* constructorSignature(String* name, Atom* argv, int argc); + String* methodSignature(JObject* jobj, String* name, Atom* argv, int argc); + String* fieldSignature(JObject* jobj, String* name); + + // JObject that has a java class tied to it but no java instance object + JObject* createJObjectShell(JClass* clazz); + + // helper method for finding the JClass associated with a particular java class(array) + JClass* forName(String* name); + JClass* forType(jstring type); + + DECLARE_NATIVE_MAP(JObjectClass) + + static void throwException(Java* j, Toplevel* top, int errorId, jthrowable jthrow, String* arg1=0, String* arg2=0); + + private: + Java* jvm(); + }; + + class JObject : public ScriptObject + { + public: + JObject(VTable *vtable, ScriptObject *proto); + ~JObject(); + + ScriptObject* createInstance(VTable *ivtable, ScriptObject *prototype); + + Atom getProperty(Atom name) const; + bool hasProperty(Multiname* multi) const; + Atom callProperty(Multiname* multiname, int argc, Atom* argv); + void setProperty(Multiname* name, Atom value); + + // internal + void setClass(JClass* clazz) { this->jclass = clazz; } + void setObject(jobject obj) { this->obj = obj; } + bool indexFrom(AvmCore* core, Atom a, int* index) const; + + JClass* getClass() { return jclass; } + jobject getObject() { return obj; } + + String* _toString() const; + + // AS exposed functions + + private: + jobject obj; /* underlying java object */ + DWB(JClass*) jclass; /* class of this object */ + }; + + // non-AS exposed wrapper around a jvm Class object + class JClass : public MMgc::GCObject + { + public: + JClass::JClass(Java* vm, String* name, jclass cref); + + jobject callConstructor(JObjectClass* jobj, int argc, Atom* argv); + jarray createArray(JObjectClass* jobj, int size, ArrayObject* arr); + Atom callMethod(JObject* jobj, String* name, int argc, Atom* argv); + Atom getField(JObject* jobj, String* name); + bool setField(JObject* jobj, String* name, Atom val); + bool hasField(JObject* jobj, String* nm); + Atom getArrayElement(JObject* jobj, int index); + void setArrayElement(JObject* jobj, int index, Atom val); + const char* boxArgs(AvmCore* core, Toplevel* toplevel, const char* descriptor, int argc, Atom* argv, jvalue* jargs); + + jobject methodFor(String* name, const char* argvDesc, int argc, char* methodDesc); + jobject constructorFor(const char* argvDesc, int argc, char* constrDesc); + jobject fieldFor(String* name); + int methodDescriptor(char* desc, jobject method); + int constructorDescriptor(char* desc, jobject constr); + int argsDescriptor(AvmCore* core, char* desc, int argc, Atom* argv); + char* descriptorVerbose(char* desc, jclass cls); + char descriptorChar(jclass cls); + bool stringsEqual(jstring s1, String* s2); + bool isStatic(jint modifiers); + + static const char* compareDescriptors(const char* base, const char* desc1, const char* desc2); + static int argumentCount(const char* d); + static int conversionCost(const char* from, const char* to); + + // conversions methods + const char* jvalueToAtom(AvmCore* core, Toplevel* toplevel, jvalue& val, const char* type, Atom& a); + const char* atomTojvalue(AvmCore* core, Toplevel* toplevel, Atom a, const char* type, jvalue& val); + void atomTojlong(AvmCore* core, Atom a, jlong& val); + + static bool isJObject(AvmCore* core, Atom a); + static String* jlongToString(AvmCore* core, jlong& val); + + Java* jvm() { return vm; } + String* name() { return nm; } + jclass classRef() { return cref; } + + private: + DWB(Java*) vm; + DRCWB(String*) nm; /* name used for class lookup */ + jclass cref; /* class */ + }; + +// auto class determination +#define BEGIN_DEFINE_JCLASS() static const int _classRef_0_= __LINE__ + 1; +#define DEFINE_JCLASS(c) static const int _classRef_##c = __LINE__ - _classRef_0_; jclass c() const { return classRefTable[_classRef_##c]; } +#define END_DEFINE_JCLASS() jclass classRefTable[__LINE__-_classRef_0_]; +#define INIT_JCLASS(c) classRefTable[_classRef_##c] = jni->FindClass( replace(dst, #c) ); + +// instances of Class objects +#define BEGIN_DEFINE_PRIMITIVE_TYPE() static const int _primitiveRef_0_= __LINE__ + 1; +#define DEFINE_PRIMITIVE_TYPE(c) static const int _primitiveRef_##c = __LINE__ - _primitiveRef_0_; jclass c##_class() const { return primitiveRefTable[_primitiveRef_##c]; } +#define END_DEFINE_PRIMITIVE_TYPE() jclass primitiveRefTable[__LINE__-_primitiveRef_0_]; +#define INIT_PRIMITIVE_TYPE(c) primitiveRefTable[_primitiveRef_##c] = (jclass)jni->GetStaticObjectField( c(), jni->GetStaticFieldID( c(), "TYPE", "Ljava/lang/Class;") ); + +// auto method id determination +#define BEGIN_DEFINE_JMETHODID() static const int _methodId_0_= __LINE__ + 1; +#define DEFINE_JMETHODID(c, m, s) static const int _methodId_##c##m = __LINE__ - _methodId_0_; jmethodID c##_##m() const { return methodIdTable[_methodId_##c##m]; } +#define END_DEFINE_JMETHODID() jmethodID methodIdTable[__LINE__-_methodId_0_]; +#define INIT_JMETHODID(c, m, s) methodIdTable[_methodId_##c##m] = jni->GetMethodID( c(), #m, s); +#define INIT_SJMETHODID(c, m, s) methodIdTable[_methodId_##c##m] = jni->GetStaticMethodID( c(), #m, s); +#define DEFINE_SJMETHODID DEFINE_JMETHODID + + /** + * The container class for a Java Vm + */ + class Java + { + public: + Java(); + ~Java(); + + String* newString(AvmCore* core, jstring jstr); + + static char* startup_options; /* set by the shell */ + + /* returns jni error code or JNI_OK */ + int startupJVM(AvmCore* core); + + JavaVM* jvm; /* denotes a Java VM */ + JNIEnv* jni; /* pointer to native method interface */ + bool bound; + + _JNI_GetDefaultJavaVMInitArgs JNI_GetDefaultJavaVMInitArgs_; + _JNI_CreateJavaVM JNI_CreateJavaVM_; + + bool bindLibrary(AvmCore* core); + + // java.lang.reflect.Modifier consts + int modifier_STATIC; + int modifier_FINAL; + + BEGIN_DEFINE_JCLASS(); + DEFINE_JCLASS(java_lang_Byte); + DEFINE_JCLASS(java_lang_Boolean); + DEFINE_JCLASS(java_lang_Class); + DEFINE_JCLASS(java_lang_Character); + DEFINE_JCLASS(java_lang_Double); + DEFINE_JCLASS(java_lang_Float); + DEFINE_JCLASS(java_lang_Integer); + DEFINE_JCLASS(java_lang_Long); + DEFINE_JCLASS(java_lang_Object); + DEFINE_JCLASS(java_lang_Short); + DEFINE_JCLASS(java_lang_String); + DEFINE_JCLASS(java_lang_Void); + DEFINE_JCLASS(java_lang_reflect_Constructor); + DEFINE_JCLASS(java_lang_reflect_Field); + DEFINE_JCLASS(java_lang_reflect_Method); + DEFINE_JCLASS(java_lang_reflect_Modifier); + END_DEFINE_JCLASS(); + + BEGIN_DEFINE_JMETHODID(); + DEFINE_JMETHODID(java_lang_Object, equals, "(Ljava/lang/Object;)Z"); + DEFINE_JMETHODID(java_lang_Object, toString, "()Ljava/lang/String;"); + DEFINE_JMETHODID(java_lang_Object, getClass, "()Ljava/lang/Class;"); + DEFINE_JMETHODID(java_lang_Class, getName, "()Ljava/lang/String;"); + DEFINE_JMETHODID(java_lang_Class, getCanonicalName, "()Ljava/lang/String;"); + DEFINE_JMETHODID(java_lang_Class, getMethods, "()[Ljava/lang/reflect/Method;"); + DEFINE_JMETHODID(java_lang_Class, getFields, "()[Ljava/lang/reflect/Field;"); + DEFINE_JMETHODID(java_lang_Class, getField, "(Ljava/lang/String;)Ljava/lang/reflect/Field;"); + DEFINE_JMETHODID(java_lang_Class, getConstructors, "()[Ljava/lang/reflect/Constructors;"); + DEFINE_JMETHODID(java_lang_Class, isPrimitive, "()Z"); + DEFINE_JMETHODID(java_lang_Class, isArray, "()Z"); + DEFINE_SJMETHODID(java_lang_Class, forName, "(Ljava/lang/String;)Ljava/lang/Class;"); + DEFINE_JMETHODID(java_lang_reflect_Method, getName, "()Ljava/lang/String;"); + DEFINE_JMETHODID(java_lang_reflect_Method, getReturnType, "()Ljava/lang/Class;"); + DEFINE_JMETHODID(java_lang_reflect_Method, getParameterTypes, "()[Ljava/lang/Class;"); + DEFINE_JMETHODID(java_lang_reflect_Method, getModifiers, "()I"); + DEFINE_JMETHODID(java_lang_reflect_Field, getName, "()Ljava/lang/String;"); + DEFINE_JMETHODID(java_lang_reflect_Field, getType, "()Ljava/lang/Class;"); + DEFINE_JMETHODID(java_lang_reflect_Field, getModifiers, "()I"); + DEFINE_JMETHODID(java_lang_reflect_Constructor, getParameterTypes, "()[Ljava/lang/Class;"); + END_DEFINE_JMETHODID(); + + BEGIN_DEFINE_PRIMITIVE_TYPE(); + DEFINE_PRIMITIVE_TYPE(java_lang_Byte); + DEFINE_PRIMITIVE_TYPE(java_lang_Boolean); + DEFINE_PRIMITIVE_TYPE(java_lang_Class); + DEFINE_PRIMITIVE_TYPE(java_lang_Character); + DEFINE_PRIMITIVE_TYPE(java_lang_Double); + DEFINE_PRIMITIVE_TYPE(java_lang_Float); + DEFINE_PRIMITIVE_TYPE(java_lang_Integer); + DEFINE_PRIMITIVE_TYPE(java_lang_Long); + DEFINE_PRIMITIVE_TYPE(java_lang_Object); + DEFINE_PRIMITIVE_TYPE(java_lang_Short); + DEFINE_PRIMITIVE_TYPE(java_lang_Void); + END_DEFINE_PRIMITIVE_TYPE(); + + static char* replace(char* dst, const char* src, char what='_', char with='/'); + }; +} + +#endif /* _JAVA_GLUE_H_ */ diff --git a/mozilla/js/tamarin/localization/lang/de/ErrorConstants.xml b/mozilla/js/tamarin/localization/lang/de/ErrorConstants.xml new file mode 100644 index 00000000000..d11f6455efb --- /dev/null +++ b/mozilla/js/tamarin/localization/lang/de/ErrorConstants.xml @@ -0,0 +1,736 @@ + + + + + This table contains all of the error messages generated by core avmplus. This will likely be replaced by a resource table for easy localization. %o = ScriptObject* %t = Traits* %m = AbstractFunction* %n = Multiname (name portion only) %N = Multiname (namespace portion only) %a = Atom %d = int %f = double %S = Stringp %s = char* + + Nicht genügend Speicher vorhanden. + + + Die Methode %1 wird nicht implementiert. + + Das Genauigkeitsargument muss zwischen %2 und %3 liegen; %1 ist ungültig. + + + + Das Grundzahlargument muss zwischen 2 und 36 liegen; %1 erhalten. + + + + Methode %1 wurde für ein nicht kompatibles Objekt aufgerufen. + + + + Array-Index ist keine positive Ganzzahl (%1). + + + + %1 ist keine Funktion. + big instead + of blg): + +
var blg:String = "foo";
+var big:Sprite = new Sprite();
+var error:int = big.length(); 
+ ]]>
+
+ Versuchte Instanziierung für einen Nicht-Konstruktor. + %1 ist nicht eindeutig; es wurden mehrere übereinstimmende Bindungen gefunden. + + Der Zugriff auf eine Eigenschaft oder eine Methode eines null-Objektverweises ist nicht möglich. + addChild() method of a DisplayObjectContainer object), then its stage + property is set to null. Thus, the example generates this error because Sprite object's stage property + cannot have any properties: + +
import flash.display.Sprite;
+var sprite1:Sprite = new Sprite();
+var q:String = sprite1.stage.quality;
+ ]]>
+
+ + Ein Begriff ist nicht definiert und hat keine Eigenschaften. + var obj:Object = new Object(); +obj.a = "foo"; +trace(obj.b.prop); + +

You can also see this error because of a misspelling, for example in the following, where + mc represents a MovieClip object on the display list, and the stage + property is misspelled with a capital S (it should be stage):

+ +
trace(mc.Stage.quality);
+ + + ]]>
+
+ + Methode %1 enthielt einen unzulässigen Opcode %2 bei Offset %3. + note
at the bottom of this table. * + ]]> + + + Die letzte Anweisung hat die Codegröße überschritten. + note at the bottom of this table. * + ]]> + + + OP_findproperty kann nicht aufgerufen werden, wenn scopeDepth 0 ist. + note at the bottom of this table. * + ]]> + + Klasse %1 wurde nicht gefunden. + + Methode %1 kann nicht den Standard-XML-Namespace festlegen. + note at the bottom of this table. * + ]]> + + Nachfolger-Operator (..) wird für Typ %1 nicht unterstützt. + + Gültigkeitsbereich-Stapelüberlauf. + note at the bottom of this table. * + ]]> + + + Gültigkeitsbereich-Stapelunterlauf. + note at the bottom of this table. * + ]]> + + + Getscopeobject %1 liegt außerhalb des gültigen Bereichs. + note at the bottom of this table. * + ]]> + + + Code kann nicht außerhalb eines Methodenendes vorkommen. + note at the bottom of this table. * + ]]> + + + Mindestens ein Verzweigungsziel war nicht auf einer gültigen Anweisung in der Methode. + note at the bottom of this table. * + ]]> + + + Typ 'void' kann nur als Rückgabetyp für eine Funktion verwendet werden. + note at the bottom of this table. * + ]]> + + + Stapelüberlauf. + note at the bottom of this table. * + ]]> + + + Stapelunterlauf. + note at the bottom of this table. * + ]]> + + + Zugriff auf ein ungültiges Register %1. + note at the bottom of this table. * + ]]> + + + Position %1 ist höher als slotCount=%2 von %3. + note at the bottom of this table. * + ]]> + + + Method_info %1 ist höher als method_count=%2. + note at the bottom of this table. * + ]]> + + + Disp_id %1 ist größer als max_disp_id=%2 von %3. + note at the bottom of this table. * + ]]> + + + Disp_id %1 ist nicht definiert in %2. + note at the bottom of this table. * + ]]> + + + Stapeltiefe ist nicht ausgeglichen. %1 != %2. + note at the bottom of this table. * + ]]> + + + Gültigkeitsbereichstiefe ist nicht ausgeglichen. %1 != %2. + note at the bottom of this table. * + ]]> + + + Cpool-Index %1 liegt außerhalb des gültigen Bereichs %2. + note at the bottom of this table. * + ]]> + + Cpool-Eintrag %1 hat den falschen Typ. + Typumwandlung fehlgeschlagen: %1 kann nicht in %2 umgewandelt werden. + + Unzulässiger super-Ausdruck in Methode %1 gefunden. + note at the bottom of this table. * + ]]> + + + Zuweisung zu einer Methode %1 für %2 nicht möglich. + note at the bottom of this table. * + ]]> + + + %1 ist bereits definiert. + for loops + in the same function definition) are considered to be in the same scope. + See the note at the bottom of this table. * + ]]> + + + Die Methode kann nicht überprüft werden, bevor sie referenziert wird. + note at the bottom of this table. * + ]]> + + + Auf der rechten Seite von instanceof muss eine Klasse oder Funktion stehen. + instanceof operator must be a class or function. + ]]> + + + Auf der rechten Seite des Operators muss eine Klasse stehen. + instanceof operator must be a class. + ]]> + + + Keine ABC-Datei. major_version=%1 minor_version=%2. + + + + Ungültige code_length=%1. + note at the bottom of this table. * + ]]> + + + MethodInfo-%1 nicht unterstützte Flags=%2. + note at the bottom of this table. * + ]]> + + + Nicht unterstützter Traittyp=%1. + note at the bottom of this table. * + ]]> + + + MethodInfo-%1 vor der Definition referenziert. + note at the bottom of this table. * + ]]> + + + Es wurde kein Zugangspunkt gefunden. + note at the bottom of this table. * + ]]> + + + Prototypobjekte müssen Vanilla-Objekte sein. + note at the bottom of this table. * + ]]> + + + %1 kann nicht in Grundtyp umgewandelt werden. + note at the bottom of this table. * + ]]> + + + Unzulässig früher Bindungszugriff auf %1. + note at the bottom of this table. * + ]]> + + + Ungültige URI an %1-Funktion übergeben. + note at the bottom of this table. * + ]]> + + + Unzulässiges Außerkraftsetzen von %1 in %2. + note at the bottom of this table. * + ]]> + + + Unzulässige Bereich- oder Zieloffsets in Ausnahmeprozedur. + note at the bottom of this table. * + ]]> + + + Eigenschaft %1 in %2 kann nicht erstellt werden. + + + + %1 kann nur Methoden enthalten. + note at the bottom of this table. * + ]]> + + + Unzulässiger Operandtyp: %1 muss %2 sein. + note at the bottom of this table. * + ]]> + + + ClassInfo-%1 vor der Definition referenziert. + note at the bottom of this table. * + ]]> + + + ClassInfo %1 ist größer als class_count=%2. + note at the bottom of this table. * + ]]> + + + Der Wert %1 kann nicht in %2 umgewandelt werden, ohne dass Genauigkeit verloren geht. + int. + +

This error also appears for out-of-range assignments, such as the following:

+ +
var m0:int = 2147483648; // int.MAX_VALUE == 2147483647
+

You can also see this error when using the bitwise left shift operator (<<). + For example, consider the following code:

+ +
var m0:uint = 0xFF;
+var m1:uint = m0<<24;
+ +

The result of left shift operator (<<) is interpreted as a 32-bit two's complement number + with sign. In the example, the result is a negative value, which causes the error when assigned + to the uint typed property. A workaround is the following:

+ +
var m0:uint = 0xFF;
+var m1:uint = uint(m0<<24);
+ + ]]>
+
+ Nicht übereinstimmende Argumentzählung für %1. %2 erwartet, %3 erhalten. + + Methode %1 kann nicht als Konstruktor aufgerufen werden. + f() in Class A: +
class A {
+	   function f() {}
+	}
+ In the following code, extracting the function causes no error. However, creating + a new instance of the function causes an error. +
var a = new A()
+	var m = a.f // extract f, don't call it
+	m() // same as a.f()
+	new m() // causes this error
+ + ]]>
+
+ + Variable %1 ist nicht definiert. + print(x) generates an error because x is undefined. However, the + statement print(y) doesn't generate an error because y is defined: +
print("hello world")
+	print(x) // x is undefined
+	var y
+	print(y) // No error, y is defined.
+ ]]>
+
+ + Die Form function('function body') wird nicht unterstützt. + eval() and + function(). Thus, calling these as a constructor in ActionScript 3.0 generates this error. + ]]> + + + Der Hauptteil der nativen Methode %1 ist unzulässig. + note at the bottom of this table. * + ]]> + + + %1 und %2 können nicht angeglichen werden. + note at the bottom of this table. * + ]]> + + + Eigenschaft %1 für %2 nicht gefunden und es ist kein Standardwert vorhanden. + x, which is not defined and cannot be created dynamically: +
class A {} // sealed class, not dynamic
+	print(new A().x) // no property x defined on A, and A is not dynamic
+ ]]>
+
+ + Methode %1 nicht in %2 gefunden + super statement to call a function, but the function doesn't exist in the super class. + For example, the following code generates the error:
class A() {}
+class B extends A {
+  function f() { print(super.f()); } // error 1070, there is no f on A
+}
+ ]]>
+
+ Funktion %1 wurde bereits an %2 gebunden. + + Disp_id 0 ist unzulässig. + note at the bottom of this table. * + ]]> + + + Die nicht außer Kraft zu setzende Methode %1 wurde wegen doppelter disp_id %2 ersetzt. + note at the bottom of this table. * + ]]> + + Unzulässiger Schreibvorgang in schreibgeschützte Eigenschaft %1 in %2. + + Math ist keine Funktion. + math() as a function, but math is a class with static methods. + ]]> + + + Math ist kein Konstruktor. + + + Unzulässiger Lesevorgang für Eigenschaft mit Lesezugriff %1 in %2. + + Unzulässige Opcode/Multiname-Kombination: %1<%2>. + note at the bottom of this table. * + ]]> + + + Native Methoden sind in geladenem Code nicht zulässig. + note at the bottom of this table. * + ]]> + + + Unzulässiger Wert für Namespace. + note at the bottom of this table. * + ]]> + + Eigenschaft %1 in %2 nicht gefunden und es ist kein Standardwert vorhanden. + + Es wurde kein Standard-Namespace festgelegt. + note at the bottom of this table. * + ]]> + + + Das Präfix "%1" für Element "%2" ist nicht gebunden. + foo + namespace to match foo:x:
<foo:x xmlns:clowns='http://circuscenter.com'>
+ ]]>
+
+ + Element oder Attribut ("%1") stimmt nicht mit QName-Produktion überein: QName::=(NCName':')?NCName. + foo: or :foo as an element or attribute name, but there is nothing + on the other side of the colon. + ]]> + + Der Elementtyp "%1" muss durch das entsprechende Schluss-Tag "</%2>" abgeschlossen werden. + + Die %1-Methode kann nur für Listen mit einem Element verwendet werden. + addNamespace, appendChild, childIndex, + inScopeNamespaces, insertChildAfter, insertChildBefore, + name, namespace, localName, namespaceDeclarations, + nodeKind, prependChild, removeNamespace, replace, + setChildren, setLocalName, setName, and setNamespace. + + ]]> + + Die Zuweisung zu indizierter XML ist nicht zulässig. + + Das Markup im Dokument nach dem Stammelement muss logisch aufgebaut sein. + +
  • Parsing an XMLList style object such as as XML
  • +
  • Misbalanced strings such as
  • + + ]]>
    +
    + Die Zuweisung zu Listen mit mehreren Elementen wird nicht unterstützt. + + XML-Parserfehler: Element ist fehlerhaft. + >
    is missing: + +
    <a/><b></b
    ]]> + + XML-Parserfehler: Nicht abgeschlossener CDATA-Abschnitt. + XML-Parserfehler: Nicht abgeschlossene XML-Deklaration. + XML-Parserfehler: Nicht abgeschlossene DOCTYPE-Deklaration. + XML-Parserfehler: Nicht abgeschlossener Kommentar. + XML-Parserfehler: Nicht abgeschlossenes Attribut. + XML-Parserfehler: Nicht abgeschlossenes Element. + XML-Parserfehler: Nicht abgeschlossene Verarbeitungsanweisung. + + Unzulässiges Präfix %1 für Nicht-Namespace. + ns = new Namespace ("prefix", ""); + ]]> + + + Es können keine Flags angegeben werden, wenn ein RegExp aus einem anderen konstruiert wird. + new operator and set the flags as desired. For example, this statement + creates a regular expression and specifies flag settings: + var re:RegExp = new RegExp("ali", /s) + Alternatively, this statement creates a regular expression that has the same flags as re: +
    var re2:RegExp = new RegExp(re, ...)
    ]]>
    +
    + + Methode %1 mit unbekannten Gültigkeitsbereich kann nicht überprüft werden. + note at the bottom of this table. * + ]]> + + + Unzulässiger Standardwert für Typ %1. + note at the bottom of this table. * + ]]> + + + Klasse %1 kann die letzte Basisklasse nicht erweitern. + note at the bottom of this table. * + ]]> + + Attribut "%1" wurde bereits für Element "%2" spezifiziert. + + Die ABC-Daten sind beschädigt, versuchtes Lesen außerhalb des gültigen Bereichs. + note at the bottom of this table. * + ]]> + + + Der Opcode OP_newclass wurde mit der falschen Basisklasse verwendet. + note at the bottom of this table. * + ]]> + + + Versuchter direkter Aufruf der nicht gebundenen Funktion %1 von Methode %2. + note at the bottom of this table. * + ]]> + + + %1 kann nicht %2 erweitern. + note at the bottom of this table. * + ]]> + + + %1 kann nicht %2 implementieren. + note at the bottom of this table. * + ]]> + + Nicht übereinstimmende Argumentzählung für Klassenumwandlung. 1 erwartet, %1 erhalten. + + OP_newactivation wurde ohne Flag NEED_ACTIVATION in Methode verwendet. + note at the bottom of this table. * + ]]> + + + OP_getglobalslot oder OP_setglobalslot ohne globalen Gültigkeitsbereich verwendet. + note at the bottom of this table. * + ]]> + + %1 ist kein Konstruktor. + zweites Argument für Function.prototype.apply muss ein Array sein. + Ungültiger XML-Name: %1. + Unzulässige zyklische Schleife zwischen Knoten. + Delete-Operator mit Operand vom Typ %1 wird nicht unterstützt. + Eigenschaft %1 in %2 kann nicht gelöscht werden. + Methode %1 verfügt über doppelten Hauptteil. + Der Hauptteil der Schnittstellenmethode %1 ist unzulässig. + Filter-Operator wird für Typ %1 nicht unterstützt. + Für OP_hasnext2 müssen object und index verschiedene Register sein. + Fehler beim Öffnen von Datei %1. + + Fehler beim Schreiben in Datei %1. + + + + Ein Skript wurde länger als die Standard-Timeout-Zeit von 15 Sekunden ausgeführt. + + + + Ein Skript konnte nach 30 Sekunden nicht abgeschlossen werden und wurde beendet. + + + + Dateiende. + + + Der String-Index %1 liegt außerhalb des zulässigen Bereichs; muss im Bereich %2 bis %3 liegen. + + Der angegebene Bereich ist ungültig. + start parameter is greater than its end parameter. + ]]> + + Argument %1 kann nicht null sein. + + Der angegebene Wert für Argument %1 ist ungültig. + public function doSomething(const:int):void { + } + this ["doSomething"] ("str") + generates an error at runtime because doSomething is cast as an int data type. ]]> + + + Fehler beim Dekomprimieren der Daten. + + + Typumwandlung fehlgeschlagen: %1 kann nicht in %2 umgewandelt werden. + Wenn das callback-Argument eine Methode einer Klasse ist, muss das optionale this-Argument null sein. + diff --git a/mozilla/js/tamarin/localization/lang/de/build.xml b/mozilla/js/tamarin/localization/lang/de/build.xml new file mode 100644 index 00000000000..b1cb18b72f6 --- /dev/null +++ b/mozilla/js/tamarin/localization/lang/de/build.xml @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mozilla/js/tamarin/localization/lang/es/ErrorConstants.xml b/mozilla/js/tamarin/localization/lang/es/ErrorConstants.xml new file mode 100644 index 00000000000..16d8d5d3234 --- /dev/null +++ b/mozilla/js/tamarin/localization/lang/es/ErrorConstants.xml @@ -0,0 +1,736 @@ + + + + + This table contains all of the error messages generated by core avmplus. This will likely be replaced by a resource table for easy localization. %o = ScriptObject* %t = Traits* %m = AbstractFunction* %n = Multiname (name portion only) %N = Multiname (namespace portion only) %a = Atom %d = int %f = double %S = Stringp %s = char* + + El sistema no tiene memoria disponible. + + + El método %1 no se ha implementado. + + El argumento de precisión debe estar entre %2 y %3; %1 no es válido. + + + + El argumento de base debe estar entre 2 y 36; se obtuvo %1. + + + + Se invocó el método %1 en un objeto no compatible. + + + + El índice de matriz no es un entero positivo (%1). + + + + %1 no es una función. + big instead + of blg): + +
    var blg:String = "foo";
    +var big:Sprite = new Sprite();
    +var error:int = big.length(); 
    + ]]>
    +
    + Se intentó crear una instancia en un tipo no constructor. + %1 es ambiguo; se encontró más de una vinculación coincidente. + + No se puede acceder a una propiedad o a un método de una referencia a un objeto nulo. + addChild() method of a DisplayObjectContainer object), then its stage + property is set to null. Thus, the example generates this error because Sprite object's stage property + cannot have any properties: + +
    import flash.display.Sprite;
    +var sprite1:Sprite = new Sprite();
    +var q:String = sprite1.stage.quality;
    + ]]>
    +
    + + Un término no está definido y no tiene propiedades. + var obj:Object = new Object(); +obj.a = "foo"; +trace(obj.b.prop); + +

    You can also see this error because of a misspelling, for example in the following, where + mc represents a MovieClip object on the display list, and the stage + property is misspelled with a capital S (it should be stage):

    + +
    trace(mc.Stage.quality);
    + + + ]]>
    +
    + + Código de operación %2 no válido en el desplazamiento %3 del método %1. + note at the bottom of this table. * + ]]> + + + La última instrucción superó el tamaño de código. + note at the bottom of this table. * + ]]> + + + No se puede llamar a OP_findproperty cuando el valor de scopeDepth es 0. + note at the bottom of this table. * + ]]> + + No se encontró la clase %1. + + El método %1 no puede establecer el espacio de nombres xml predeterminado + note at the bottom of this table. * + ]]> + + Operador de descendientes (..) no admitido en el tipo %1. + + Desbordamiento de la pila en el ámbito. + note at the bottom of this table. * + ]]> + + + Subdesbordamiento de la pila en el ámbito. + note at the bottom of this table. * + ]]> + + + Getscopeobject %1 está fuera de los límites. + note at the bottom of this table. * + ]]> + + + El código no puede sobrepasar el final de un método. + note at the bottom of this table. * + ]]> + + + Hay al menos un destino de rama en una instrucción no válida del método. + note at the bottom of this table. * + ]]> + + + El tipo Void sólo se puede utilizar como tipo de devolución de función. + note at the bottom of this table. * + ]]> + + + Desbordamiento de la pila. + note at the bottom of this table. * + ]]> + + + Subdesbordamiento de la pila. + note at the bottom of this table. * + ]]> + + + Se obtuvo acceso a un registro no válido %1. + note at the bottom of this table. * + ]]> + + + La ranura %1 supera el valor slotCount=%2 de %3. + note at the bottom of this table. * + ]]> + + + Method_info %1 supera el valor method_count=%2. + note at the bottom of this table. * + ]]> + + + Disp_id %1 supera el valor max_disp_id=%2 de %3. + note at the bottom of this table. * + ]]> + + + Disp_id %1 no está definido en %2. + note at the bottom of this table. * + ]]> + + + Profundidad de pila desequilibrada. %1 != %2. + note at the bottom of this table. * + ]]> + + + Profundidad de ámbito desequilibrada. %1 != %2. + note at the bottom of this table. * + ]]> + + + El índice Cpool %1 está fuera del rango %2. + note at the bottom of this table. * + ]]> + + El tipo de la entrada Cpool %1 es incorrecto. + Error de conversión forzada: no se puede convertir %1 en %2. + + Expresión super no válida en el método %1. + note at the bottom of this table. * + ]]> + + + No se puede asignar a un método %1 en %2. + note at the bottom of this table. * + ]]> + + + %1 ya está definido. + for loops + in the same function definition) are considered to be in the same scope. + See the note at the bottom of this table. * + ]]> + + + No se puede verificar el método hasta que se haga referencia a él. + note at the bottom of this table. * + ]]> + + + A la derecha de instanceof debe haber una clase o una función. + instanceof operator must be a class or function. + ]]> + + + A la derecha del operador debe haber una clase. + instanceof operator must be a class. + ]]> + + + No es un archivo ABC. major_version=%1 minor_version=%2. + + + + code_length=%1 no válido. + note at the bottom of this table. * + ]]> + + + MethodInfo-%1 no admite flags=%2. + note at the bottom of this table. * + ]]> + + + traits kind=%1 no admitido. + note at the bottom of this table. * + ]]> + + + Referencia a MethodInfo-%1 antes de la definición. + note at the bottom of this table. * + ]]> + + + No se encontró un punto de entrada. + note at the bottom of this table. * + ]]> + + + Los objetos de prototipo deben ser objetos vanilla. + note at the bottom of this table. * + ]]> + + + No se puede convertir %1 en primitiva. + note at the bottom of this table. * + ]]> + + + Acceso de vinculación a %1 en tiempo de compilación no válido. + note at the bottom of this table. * + ]]> + + + URI no válido pasado a la función %1. + note at the bottom of this table. * + ]]> + + + Sustitución no válida de %1 en %2. + note at the bottom of this table. * + ]]> + + + Rango o desplazamientos de destino no válidos en el controlador de excepciones. + note at the bottom of this table. * + ]]> + + + No se puede crear la propiedad %1 en %2. + + + + %1 sólo puede contener métodos. + note at the bottom of this table. * + ]]> + + + Tipo de operando no válido: %1 debe ser %2. + note at the bottom of this table. * + ]]> + + + Referencia a ClassInfo-%1 antes de la definición. + note at the bottom of this table. * + ]]> + + + ClassInfo %1 supera el valor de class_count=%2. + note at the bottom of this table. * + ]]> + + + No se puede convertir el valor %1 en %2 sin perder precisión. + int. + +

    This error also appears for out-of-range assignments, such as the following:

    + +
    var m0:int = 2147483648; // int.MAX_VALUE == 2147483647
    +

    You can also see this error when using the bitwise left shift operator (<<). + For example, consider the following code:

    + +
    var m0:uint = 0xFF;
    +var m1:uint = m0<<24;
    + +

    The result of left shift operator (<<) is interpreted as a 32-bit two's complement number + with sign. In the example, the result is a negative value, which causes the error when assigned + to the uint typed property. A workaround is the following:

    + +
    var m0:uint = 0xFF;
    +var m1:uint = uint(m0<<24);
    + + ]]>
    +
    + Discordancia del recuento de argumentos en %1. Se esperaba %2 y se obtuvo %3. + + No se puede llamar al método %1 como constructor. + f() in Class A: +
    class A {
    +	   function f() {}
    +	}
    + In the following code, extracting the function causes no error. However, creating + a new instance of the function causes an error. +
    var a = new A()
    +	var m = a.f // extract f, don't call it
    +	m() // same as a.f()
    +	new m() // causes this error
    + + ]]>
    +
    + + No se ha definido la variable %1. + print(x) generates an error because x is undefined. However, the + statement print(y) doesn't generate an error because y is defined: +
    print("hello world")
    +	print(x) // x is undefined
    +	var y
    +	print(y) // No error, y is defined.
    + ]]>
    +
    + + No se admite la forma function('cuerpo de función'). + eval() and + function(). Thus, calling these as a constructor in ActionScript 3.0 generates this error. + ]]> + + + El cuerpo del método nativo %1 no es válido. + note at the bottom of this table. * + ]]> + + + %1 y %2 no pueden igualarse. + note at the bottom of this table. * + ]]> + + + No se encontró la propiedad %1 en %2 y no hay ningún valor predeterminado. + x, which is not defined and cannot be created dynamically: +
    class A {} // sealed class, not dynamic
    +	print(new A().x) // no property x defined on A, and A is not dynamic
    + ]]>
    +
    + + No se encontró el método %1 en %2 + super statement to call a function, but the function doesn't exist in the super class. + For example, the following code generates the error:
    class A() {}
    +class B extends A {
    +  function f() { print(super.f()); } // error 1070, there is no f on A
    +}
    + ]]>
    +
    + La función %1 ya se ha vinculado a %2. + + Disp_id 0 no es válido. + note at the bottom of this table. * + ]]> + + + Se reemplazó el método %1 de no sustitución por la duplicación de disp_id %2. + note at the bottom of this table. * + ]]> + + Lectura no permitida de la propiedad %1 de sólo lectura en %2. + + Math no es una función. + math() as a function, but math is a class with static methods. + ]]> + + + Math no es un constructor. + + + Lectura no permitida de la propiedad %1 de sólo escritura en %2. + + Combinación no válida de código de operación y nombre múltiple: %1<%2>. + note at the bottom of this table. * + ]]> + + + No se permiten métodos nativos en el código cargado. + note at the bottom of this table. * + ]]> + + + Valor de espacio de nombres no válido. + note at the bottom of this table. * + ]]> + + No se encuentra la propiedad %1 en %2 y no hay ningún valor predeterminado. + + No se ha establecido ningún espacio de nombres predeterminado. + note at the bottom of this table. * + ]]> + + + El prefijo "%1" del elemento "%2" no está vinculado. + foo + namespace to match foo:x:
    <foo:x xmlns:clowns='http://circuscenter.com'>
    + ]]>
    +
    + + El elemento o el atributo ("%1") no coincide con la regla de producción de QName: QName::=(NCName':')?NCName. + foo: or :foo as an element or attribute name, but there is nothing + on the other side of the colon. + ]]> + + El tipo de elemento "%1" debe terminar con la etiqueta final "</%2>" correspondiente. + + El método %1 sólo funciona en listas que contienen un elemento. + addNamespace, appendChild, childIndex, + inScopeNamespaces, insertChildAfter, insertChildBefore, + name, namespace, localName, namespaceDeclarations, + nodeKind, prependChild, removeNamespace, replace, + setChildren, setLocalName, setName, and setNamespace. + + ]]> + + No se permite la asignación a XML indexado. + + El marcado del documento que sigue al elemento raíz debe estar bien formado. + +
  • Parsing an XMLList style object such as as XML
  • +
  • Misbalanced strings such as
  • + + ]]>
    +
    + No se admite la asignación a listas con más de un elemento. + + Error del analizador XML: elemento mal formado. + >
    is missing: + +
    <a/><b></b
    ]]> + + Error del analizador XML: sección CDATA sin terminar. + Error del analizador XML: declaración XML sin terminar. + Error del analizador XML: declaración DOCTYPE sin terminar. + Error del analizador XML: comentario sin terminar. + Error del analizador XML: atributo sin terminar. + Error del analizador XML: elemento sin terminar. + Error del analizador XML: instrucción de procesamiento sin terminar. + + Prefijo %1 no válido sin un espacio de nombres. + ns = new Namespace ("prefix", ""); + ]]> + + + No se pueden proporcionar indicadores cuando se genera una expresión regular a partir de otra. + new operator and set the flags as desired. For example, this statement + creates a regular expression and specifies flag settings: + var re:RegExp = new RegExp("ali", /s) + Alternatively, this statement creates a regular expression that has the same flags as re: +
    var re2:RegExp = new RegExp(re, ...)
    ]]>
    +
    + + No se puede verificar el método %1 con ámbito desconocido. + note at the bottom of this table. * + ]]> + + + Valor predeterminado no válido para el tipo %1. + note at the bottom of this table. * + ]]> + + + La clase %1 no puede ampliar la clase base final. + note at the bottom of this table. * + ]]> + + El atributo "%1" ya se especificó para el elemento "%2". + + Los datos ABC están dañados; intentan leer fuera de los límites. + note at the bottom of this table. * + ]]> + + + El código de operación OP_newclass se utilizó con la clase base incorrecta. + note at the bottom of this table. * + ]]> + + + Intento de llamada directa a la función abierta %1 desde el método %2. + note at the bottom of this table. * + ]]> + + + %1 no puede ampliar %2. + note at the bottom of this table. * + ]]> + + + %1 no puede implementar %2. + note at the bottom of this table. * + ]]> + + Discordancia del recuento de argumentos en coerción de clase. Se esperaba 1; se obtuvo %1. + + Se utilizó OP_newactivation en el método sin el indicador NEED_ACTIVATION. + note at the bottom of this table. * + ]]> + + + Se utilizaron OP_getglobalslot u OP_setglobalslot sin ámbito global. + note at the bottom of this table. * + ]]> + + %1 no es un constructor. + el segundo argumento de Function.prototype.apply debe ser una matriz. + Nombre XML no válido: %1. + Bucle cíclico no válido entre nodos. + El operador de eliminación no se admite con el operando de tipo %1. + No se puede eliminar la propiedad %1 en %2. + El cuerpo del método %1 está duplicado. + El cuerpo del método de interfaz %1 no es válido. + Operador de filtro no admitido en el tipo %1. + OP_hasnext2 requiere que el objeto y el índice sean registros diferentes. + Error al abrir el archivo %1. + + Error al escribir en el archivo %1. + + + + El tiempo de ejecución del script ha superado el tiempo de espera predeterminado de 15 segundos. + + + + No se salió del script en 30 segundos y se ha cerrado. + + + + Final del archivo. + + + El índice de cadena %1 está fuera de los límites; debe estar en el rango %2-%3. + + El rango especificado no es válido. + start parameter is greater than its end parameter. + ]]> + + El argumento %1 no puede ser null. + + El valor especificado para el argumento %1 no es válido. + public function doSomething(const:int):void { + } + this ["doSomething"] ("str") + generates an error at runtime because doSomething is cast as an int data type. ]]> + + + Se produjo un error al descomprimir los datos. + + + Error de conversión forzada: no se puede convertir %1 en %2. + Si el argumento de la función de repetición de llamada es un método de la clase, el argumento opcional debe ser null. +
    diff --git a/mozilla/js/tamarin/localization/lang/es/build.xml b/mozilla/js/tamarin/localization/lang/es/build.xml new file mode 100644 index 00000000000..b1cb18b72f6 --- /dev/null +++ b/mozilla/js/tamarin/localization/lang/es/build.xml @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mozilla/js/tamarin/localization/lang/fr/ErrorConstants.xml b/mozilla/js/tamarin/localization/lang/fr/ErrorConstants.xml new file mode 100644 index 00000000000..9229ad3b487 --- /dev/null +++ b/mozilla/js/tamarin/localization/lang/fr/ErrorConstants.xml @@ -0,0 +1,736 @@ + + + + + This table contains all of the error messages generated by core avmplus. This will likely be replaced by a resource table for easy localization. %o = ScriptObject* %t = Traits* %m = AbstractFunction* %n = Multiname (name portion only) %N = Multiname (namespace portion only) %a = Atom %d = int %f = double %S = Stringp %s = char* + + La mémoire du système est saturée. + + + La méthode %1 n'est pas mise en oeuvre. + + L'argument precision doit être compris entre %2 et %3. %1 n'est pas valide. + + + + L'argument radix doit être compris entre 2 et 36. %1 détecté. + + + + La méthode %1 a été invoquée pour un objet non compatible. + + + + L'index du tableau n'est pas un entier positif (%1). + + + + %1 n'est pas une fonction. + big instead + of blg): + +
    var blg:String = "foo";
    +var big:Sprite = new Sprite();
    +var error:int = big.length(); 
    + ]]>
    +
    + Tentative d'instanciation sur un élément non constructeur. + %1 est ambigu. Plusieurs liaisons correspondantes détectées. + + Il est impossible d'accéder à la propriété ou à la méthode d'une référence d'objet nul. + addChild() method of a DisplayObjectContainer object), then its stage + property is set to null. Thus, the example generates this error because Sprite object's stage property + cannot have any properties: + +
    import flash.display.Sprite;
    +var sprite1:Sprite = new Sprite();
    +var q:String = sprite1.stage.quality;
    + ]]>
    +
    + + Un terme n'est pas défini et n'a pas de propriété. + var obj:Object = new Object(); +obj.a = "foo"; +trace(obj.b.prop); + +

    You can also see this error because of a misspelling, for example in the following, where + mc represents a MovieClip object on the display list, and the stage + property is misspelled with a capital S (it should be stage):

    + +
    trace(mc.Stage.quality);
    + + + ]]>
    +
    + + La méthode %1 contenait un opcode %2 non valide au décalage %3. + note at the bottom of this table. * + ]]> + + + La dernière instruction dépassait la taille du code. + note at the bottom of this table. * + ]]> + + + Impossible d'appeler OP_findproperty si scopeDepth correspond à 0. + note at the bottom of this table. * + ]]> + + La classe %1 est introuvable. + + La méthode %1 ne peut pas définir l'espace de nom xml par défaut + note at the bottom of this table. * + ]]> + + L'opérateur Descendants (..) n'est pas pris en charge sur le type %1. + + Il s'est produit un débordement de la pile de domaine. + note at the bottom of this table. * + ]]> + + + Il s'est produit un débordement négatif de la pile de domaine. + note at the bottom of this table. * + ]]> + + + Getscopeobject %1 sort des limites. + note at the bottom of this table. * + ]]> + + + Le code ne doit pas dépasser la fin d'une méthode. + note at the bottom of this table. * + ]]> + + + Au moins une cible branche ne figurait pas dans une instruction valide de la méthode. + note at the bottom of this table. * + ]]> + + + Void est réservé aux types de renvoi de fonction. + note at the bottom of this table. * + ]]> + + + Il s'est produit un débordement de pile. + note at the bottom of this table. * + ]]> + + + Il s'est produit un débordement négatif de pile. + note at the bottom of this table. * + ]]> + + + Il s'est produit un accès à un registre %1 non valide. + note at the bottom of this table. * + ]]> + + + L'emplacement %1 dépasse slotCount=%2 sur %3. + note at the bottom of this table. * + ]]> + + + Method_info %1 dépasse method_count=%2. + note at the bottom of this table. * + ]]> + + + Disp_id %1 dépasse max_disp_id=%2 sur %3. + note at the bottom of this table. * + ]]> + + + Disp_id %1 n'est pas défini sur %2. + note at the bottom of this table. * + ]]> + + + La profondeur de la pile n'est pas équilibrée. %1 != %2. + note at the bottom of this table. * + ]]> + + + La profondeur du domaine n'est pas équilibrée. %1 != %2. + note at the bottom of this table. * + ]]> + + + L'index Cpool %1 est en dehors des limites %2. + note at the bottom of this table. * + ]]> + + Le type de l'entrée Cpool %1 est incorrect. + Echec de la contrainte de type : conversion de %1 en %2 impossible. + + Super expression illégale détectée dans la méthode %1. + note at the bottom of this table. * + ]]> + + + Affectation impossible à une méthode %1 sur %2. + note at the bottom of this table. * + ]]> + + + %1 est déjà défini. + for loops + in the same function definition) are considered to be in the same scope. + See the note at the bottom of this table. * + ]]> + + + Impossible de vérifier la méthode tant qu'elle n'est pas référencée. + note at the bottom of this table. * + ]]> + + + L'expression à droite de instanceof doit être une classe ou une fonction. + instanceof operator must be a class or function. + ]]> + + + L'expression à droite de l'opérateur doit être une classe. + instanceof operator must be a class. + ]]> + + + Il ne s'agit pas d'un fichier ABC. major_version=%1 minor_version=%2. + + + + code_length non valide=%1. + note at the bottom of this table. * + ]]> + + + Indicateurs MethodInfo-%1 non pris en charge=%2. + note at the bottom of this table. * + ]]> + + + Type de trait non pris en charge=%1. + note at the bottom of this table. * + ]]> + + + MethodInfo-%1 référencé avant la définition. + note at the bottom of this table. * + ]]> + + + Aucun point d'entrée n'a été détecté. + note at the bottom of this table. * + ]]> + + + Les objets prototype doivent être des objets vanille. + note at the bottom of this table. * + ]]> + + + Impossible de convertir %1 en primitive. + note at the bottom of this table. * + ]]> + + + Accès anticipé illégal de liaison à %1. + note at the bottom of this table. * + ]]> + + + URI non valide transmis à la fonction %1. + note at the bottom of this table. * + ]]> + + + Remplacement illégal de %1 dans %2. + note at the bottom of this table. * + ]]> + + + Plage ou décalages cibles illégaux dans le gestionnaire d'exceptions. + note at the bottom of this table. * + ]]> + + + Impossible de créer la propriété %1 sur %2. + + + + %1 ne peut contenir que des méthodes. + note at the bottom of this table. * + ]]> + + + Type d'opérande illégal : %1 doit correspondre à %2. + note at the bottom of this table. * + ]]> + + + ClassInfo-%1 est référencé avant la définition. + note at the bottom of this table. * + ]]> + + + ClassInfo %1 dépasse class_count=%2. + note at the bottom of this table. * + ]]> + + + La valeur %1 ne peut pas être convertie en %2 sans perte de précision. + int. + +

    This error also appears for out-of-range assignments, such as the following:

    + +
    var m0:int = 2147483648; // int.MAX_VALUE == 2147483647
    +

    You can also see this error when using the bitwise left shift operator (<<). + For example, consider the following code:

    + +
    var m0:uint = 0xFF;
    +var m1:uint = m0<<24;
    + +

    The result of left shift operator (<<) is interpreted as a 32-bit two's complement number + with sign. In the example, the result is a negative value, which causes the error when assigned + to the uint typed property. A workaround is the following:

    + +
    var m0:uint = 0xFF;
    +var m1:uint = uint(m0<<24);
    + + ]]>
    +
    + Non-correspondance du nombre d'arguments sur %1. %2 prévu(s), %3 détecté(s). + + Impossible d'appeler la méthode %1 en tant que constructeur. + f() in Class A: +
    class A {
    +	   function f() {}
    +	}
    + In the following code, extracting the function causes no error. However, creating + a new instance of the function causes an error. +
    var a = new A()
    +	var m = a.f // extract f, don't call it
    +	m() // same as a.f()
    +	new m() // causes this error
    + + ]]>
    +
    + + La variable %1 n'est pas définie. + print(x) generates an error because x is undefined. However, the + statement print(y) doesn't generate an error because y is defined: +
    print("hello world")
    +	print(x) // x is undefined
    +	var y
    +	print(y) // No error, y is defined.
    + ]]>
    +
    + + La fonction('corps de fonction') form n'est pas prise en charge. + eval() and + function(). Thus, calling these as a constructor in ActionScript 3.0 generates this error. + ]]> + + + La méthode native %1 contient un corps de méthode illégal. + note at the bottom of this table. * + ]]> + + + Impossible de réconcilier %1 et %2. + note at the bottom of this table. * + ]]> + + + La propriété %1 est introuvable sur %2 et il n'existe pas de valeur par défaut. + x, which is not defined and cannot be created dynamically: +
    class A {} // sealed class, not dynamic
    +	print(new A().x) // no property x defined on A, and A is not dynamic
    + ]]>
    +
    + + La méthode %1 est introuvable sur %2 + super statement to call a function, but the function doesn't exist in the super class. + For example, the following code generates the error:
    class A() {}
    +class B extends A {
    +  function f() { print(super.f()); } // error 1070, there is no f on A
    +}
    + ]]>
    +
    + La fonction %1 a déjà été liée à %2. + + Disp_id 0 est illégal. + note at the bottom of this table. * + ]]> + + + La méthode de non-remplacement %1 a été supplantée en raison du doublon disp_id %2. + note at the bottom of this table. * + ]]> + + Ecriture illégale dans une propriété en lecture seule %1 sur %2. + + Math n'est pas une fonction. + math() as a function, but math is a class with static methods. + ]]> + + + Math n'est pas un constructeur. + + + Lecture illégale d'une propriété en écriture seule %1 sur %2. + + Combinaison opcode/multiname illégale : %1<%2>. + note at the bottom of this table. * + ]]> + + + Les méthodes natives ne sont pas autorisées dans le code chargé. + note at the bottom of this table. * + ]]> + + + La valeur de l'espace de nom est illégale. + note at the bottom of this table. * + ]]> + + La propriété %1 est introuvable sur %2 et il n'existe pas de valeur par défaut. + + Aucun espace de nom par défaut n'a été défini. + note at the bottom of this table. * + ]]> + + + Le préfixe "%1" associé à l'élément "%2" n'est pas lié. + foo + namespace to match foo:x:
    <foo:x xmlns:clowns='http://circuscenter.com'>
    + ]]>
    +
    + + L'élément ou l'attribut ("%1") ne correspond pas à la production QName : QName::=(NCName':')?NCName. + foo: or :foo as an element or attribute name, but there is nothing + on the other side of the colon. + ]]> + + Le type d'élément "%1" doit se terminer par la balise de fin correspondante "</%2>". + + La méthode %1 ne fonctionne qu'avec les listes composées d'un seul élément. + addNamespace, appendChild, childIndex, + inScopeNamespaces, insertChildAfter, insertChildBefore, + name, namespace, localName, namespaceDeclarations, + nodeKind, prependChild, removeNamespace, replace, + setChildren, setLocalName, setName, and setNamespace. + + ]]> + + L'affectation à un élément XML indexé n'est pas autorisée. + + Le marquage du document après l'élément root doit être composé correctement. + +
  • Parsing an XMLList style object such as as XML
  • +
  • Misbalanced strings such as
  • + + ]]>
    +
    + L'affectation à des listes composées de plus d'un élément n'est pas prise en charge. + + Echec de l'analyse XML : le format de l'élément est incorrect. + >
    is missing: + +
    <a/><b></b
    ]]> + + Echec de l'analyse XML : Section CDATA non terminée. + Echec de l'analyse XML : Déclaration XML non terminée. + Echec de l'analyse XML : Déclaration DOCTYPE non terminée. + Echec de l'analyse XML : Commentaire non terminé. + Echec de l'analyse XML : Attribut non terminé. + Echec de l'analyse XML : Elément non terminé. + Echec de l'analyse XML : Instruction de traitement non terminée. + + Préfixe %1 illégal sans espace de nom. + ns = new Namespace ("prefix", ""); + ]]> + + + Impossible de fournir des indicateurs lors de la construction d'un RegExp à partir d'un autre. + new operator and set the flags as desired. For example, this statement + creates a regular expression and specifies flag settings: + var re:RegExp = new RegExp("ali", /s) + Alternatively, this statement creates a regular expression that has the same flags as re: +
    var re2:RegExp = new RegExp(re, ...)
    ]]>
    +
    + + Impossible de vérifier la méthode %1 si le domaine est inconnu. + note at the bottom of this table. * + ]]> + + + Valeur par défaut illégale pour le type %1. + note at the bottom of this table. * + ]]> + + + La classe %1 ne peut pas étendre la classe de base finale. + note at the bottom of this table. * + ]]> + + L'attribut "%1" a déjà été spécifié pour l'élément "%2". + + Les données ABC sont corrompues, tentative de lecture en dehors des limites. + note at the bottom of this table. * + ]]> + + + L'élément opcode OP_newclass a été utilisé avec une classe de base incorrecte. + note at the bottom of this table. * + ]]> + + + Tentative d'appel direct d'une fonction non liée %1 à partir de la méthode %2. + note at the bottom of this table. * + ]]> + + + %1 ne peut pas étendre %2. + note at the bottom of this table. * + ]]> + + + %1 ne peut pas mettre en oeuvre %2. + note at the bottom of this table. * + ]]> + + Non-concordance du nombre d'arguments pour contrainte de classe. 1 prévu, %1 détecté(s). + + OP_newactivation utilisé dans la méthode sans indicateur NEED_ACTIVATION. + note at the bottom of this table. * + ]]> + + + OP_getglobalslot ou OP_setglobalslot utilisé sans domaine global. + note at the bottom of this table. * + ]]> + + %1 n'est pas un constructeur. + Le deuxième argument transmis à Function.prototype.apply doit être un tableau. + Nom XML non valide : %1. + Boucle cyclique illégale entre noeuds. + L'opérateur delete n'est pas pris en charge avec une opérande de type %1. + Impossible de supprimer la propriété %1 sur %2. + La méthode %1 contient un corps de méthode dupliqué. + La méthode d'interface %1 contient un corps de méthode illégal. + L'opérateur Filter n'est pas pris en charge sur le type %1. + OP_hasnext2 requiert que l'objet et l'index soient des registres distincts. + Une erreur s’est produite lors de l’ouverture du fichier %1. + + Une erreur s’est produite lors de l’écriture dans le fichier %1. + + + + La durée d'exécution d'un script excède le délai par défaut (15 secondes). + + + + Un script ne s'est pas terminé après 30 secondes et a été arrêté. + + + + Fin du fichier. + + + L'index de chaîne %1 sort des limites. Il doit être compris entre %2 et %3. + + La plage indiquée n'est pas valide. + start parameter is greater than its end parameter. + ]]> + + L’argument %1 ne doit pas être null. + + La valeur indiquée pour l’argument %1 n’est pas valide. + public function doSomething(const:int):void { + } + this ["doSomething"] ("str") + generates an error at runtime because doSomething is cast as an int data type. ]]> + + + Une erreur s'est produite lors de la décompression des données. + + + Echec de la contrainte de type : conversion de %1 en %2 impossible. + Lorsque l’argument du rappel correspond à une méthode de classe, l’argument facultatif 'this' doit être null. +
    diff --git a/mozilla/js/tamarin/localization/lang/fr/build.xml b/mozilla/js/tamarin/localization/lang/fr/build.xml new file mode 100644 index 00000000000..b1cb18b72f6 --- /dev/null +++ b/mozilla/js/tamarin/localization/lang/fr/build.xml @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mozilla/js/tamarin/localization/lang/it/ErrorConstants.xml b/mozilla/js/tamarin/localization/lang/it/ErrorConstants.xml new file mode 100644 index 00000000000..74163481c15 --- /dev/null +++ b/mozilla/js/tamarin/localization/lang/it/ErrorConstants.xml @@ -0,0 +1,736 @@ + + + + + This table contains all of the error messages generated by core avmplus. This will likely be replaced by a resource table for easy localization. %o = ScriptObject* %t = Traits* %m = AbstractFunction* %n = Multiname (name portion only) %N = Multiname (namespace portion only) %a = Atom %d = int %f = double %S = Stringp %s = char* + + Memoria del sistema esaurita. + + + Il metodo %1 non è implementato. + + L'argomento precision deve essere compreso tra %2 e %3; %1 non è un valore valido. + + + + L'argomento radix deve essere compreso tra 2 e 36; valore ricevuto: %1. + + + + È stato richiamato il metodo %1 su un oggetto incompatibile. + + + + L'indice della matrice non è un numero intero positivo (%1). + + + + %1 non è una funzione. + big instead + of blg): + +
    var blg:String = "foo";
    +var big:Sprite = new Sprite();
    +var error:int = big.length(); 
    + ]]>
    +
    + Tentativo di creazione di istanza su un elemento diverso da un costruttore. + %1 è ambiguo; trovata più di un'associazione corrispondente. + + Impossibile accedere a una proprietà o a un metodo di un riferimento oggetto null. + addChild() method of a DisplayObjectContainer object), then its stage + property is set to null. Thus, the example generates this error because Sprite object's stage property + cannot have any properties: + +
    import flash.display.Sprite;
    +var sprite1:Sprite = new Sprite();
    +var q:String = sprite1.stage.quality;
    + ]]>
    +
    + + Un termine risulta undefined e non ha proprietà. + var obj:Object = new Object(); +obj.a = "foo"; +trace(obj.b.prop); + +

    You can also see this error because of a misspelling, for example in the following, where + mc represents a MovieClip object on the display list, and the stage + property is misspelled with a capital S (it should be stage):

    + +
    trace(mc.Stage.quality);
    + + + ]]>
    +
    + + Il metodo %1 conteneva un opcode non valido (%2 ) in corrispondenza dell'offset %3. + note at the bottom of this table. * + ]]> + + + L'ultima istruzione ha superato la dimensione del codice. + note at the bottom of this table. * + ]]> + + + Impossibile chiamare OP_findproperty quando scopeDepth è uguale a 0. + note at the bottom of this table. * + ]]> + + Impossibile trovare la classe %1. + + Il metodo %1 non può impostare lo spazio dei nomi xml predefinito + note at the bottom of this table. * + ]]> + + Operatore Descendants (..) non supportato nel tipo %1. + + Si è verificato un overflow dello stack per l'area di validità. + note at the bottom of this table. * + ]]> + + + Si è verificato un underflow dello stack per l'area di validità. + note at the bottom of this table. * + ]]> + + + Getscopeobject %1 è fuori dei limiti. + note at the bottom of this table. * + ]]> + + + Il codice non può superare la fine di un metodo. + note at the bottom of this table. * + ]]> + + + Almeno una destinazione del ramo non si riferisce a un'istruzione valida nel metodo. + note at the bottom of this table. * + ]]> + + + Il tipo void può essere utilizzato solo come tipo restituito della funzione. + note at the bottom of this table. * + ]]> + + + Si è verificato un overflow dello stack. + note at the bottom of this table. * + ]]> + + + Si è verificato un underflow dello stack. + note at the bottom of this table. * + ]]> + + + È stato eseguito l'accesso a un registro %1 non valido. + note at the bottom of this table. * + ]]> + + + Lo slot %1 supera slotCount=%2 di %3. + note at the bottom of this table. * + ]]> + + + Method_info %1 supera method_count=%2. + note at the bottom of this table. * + ]]> + + + Disp_id %1 supera max_disp_id=%2 di %3. + note at the bottom of this table. * + ]]> + + + Disp_id %1 non è definito su %2. + note at the bottom of this table. * + ]]> + + + Profondità dello stack non bilanciata. %1 != %2. + note at the bottom of this table. * + ]]> + + + Profondità dell'area di validità non bilanciata. %1 != %2. + note at the bottom of this table. * + ]]> + + + L'indice Cpool %1 è fuori intervallo %2. + note at the bottom of this table. * + ]]> + + La voce Cpool %1 è di tipo errato. + Assegnazione di tipo forzata non riuscita: impossibile convertire %1 in %2. + + Trovata super espressione non valida nel metodo %1. + note at the bottom of this table. * + ]]> + + + Impossibile assegnare a un metodo %1 su %2. + note at the bottom of this table. * + ]]> + + + %1 è già definita. + for loops + in the same function definition) are considered to be in the same scope. + See the note at the bottom of this table. * + ]]> + + + Impossibile verificare un metodo finché non viene utilizzato come riferimento. + note at the bottom of this table. * + ]]> + + + L'espressione a destra di instanceof deve essere una classe o una funzione. + instanceof operator must be a class or function. + ]]> + + + L'espressione a destra dell'operatore deve essere una classe. + instanceof operator must be a class. + ]]> + + + Non è un file ABC. major_version=%1 minor_version=%2. + + + + Valore non valido code_length=%1. + note at the bottom of this table. * + ]]> + + + MethodInfo-%1 non supportato flags=%2. + note at the bottom of this table. * + ]]> + + + Tipo traits non supportato=%1. + note at the bottom of this table. * + ]]> + + + MethodInfo-%1 utilizzato come riferimento prima della definizione. + note at the bottom of this table. * + ]]> + + + Punto di entrata non trovato. + note at the bottom of this table. * + ]]> + + + Gli oggetti prototype devono essere oggetti vanilla. + note at the bottom of this table. * + ]]> + + + Impossibile convertire %1 in dato di base. + note at the bottom of this table. * + ]]> + + + Accesso in associazione a %1 prematuro e non valido. + note at the bottom of this table. * + ]]> + + + URI non valido passato alla funzione %1. + note at the bottom of this table. * + ]]> + + + Sostituzione non valida di %1 in %2. + note at the bottom of this table. * + ]]> + + + Intervallo non valido oppure offset di destinazione nel gestore eccezioni. + note at the bottom of this table. * + ]]> + + + Impossibile creare la proprietà %1 su %2. + + + + %1 può contenere solo metodi. + note at the bottom of this table. * + ]]> + + + Tipo di operando non valido: %1 deve essere %2. + note at the bottom of this table. * + ]]> + + + ClassInfo-%1 è utilizzato come riferimento prima della definizione. + note at the bottom of this table. * + ]]> + + + ClassInfo %1 supera class_count=%2. + note at the bottom of this table. * + ]]> + + + Impossibile convertire il valore %1 in %2 senza perdere precisione. + int. + +

    This error also appears for out-of-range assignments, such as the following:

    + +
    var m0:int = 2147483648; // int.MAX_VALUE == 2147483647
    +

    You can also see this error when using the bitwise left shift operator (<<). + For example, consider the following code:

    + +
    var m0:uint = 0xFF;
    +var m1:uint = m0<<24;
    + +

    The result of left shift operator (<<) is interpreted as a 32-bit two's complement number + with sign. In the example, the result is a negative value, which causes the error when assigned + to the uint typed property. A workaround is the following:

    + +
    var m0:uint = 0xFF;
    +var m1:uint = uint(m0<<24);
    + + ]]>
    +
    + Incongruenza nel conteggio degli argomenti su %1. Era atteso %2, è stato ricevuto %3. + + Impossibile chiamare il metodo %1 come funzione di costruzione. + f() in Class A: +
    class A {
    +	   function f() {}
    +	}
    + In the following code, extracting the function causes no error. However, creating + a new instance of the function causes an error. +
    var a = new A()
    +	var m = a.f // extract f, don't call it
    +	m() // same as a.f()
    +	new m() // causes this error
    + + ]]>
    +
    + + La variabile %1 non è definita. + print(x) generates an error because x is undefined. However, the + statement print(y) doesn't generate an error because y is defined: +
    print("hello world")
    +	print(x) // x is undefined
    +	var y
    +	print(y) // No error, y is defined.
    + ]]>
    +
    + + La forma funzione('corpo funzione') non è supportata. + eval() and + function(). Thus, calling these as a constructor in ActionScript 3.0 generates this error. + ]]> + + + Corpo del metodo nativo %1 non valido. + note at the bottom of this table. * + ]]> + + + Impossibile riconciliare %1 e %2. + note at the bottom of this table. * + ]]> + + + Impossibile trovare la proprietà %1 su %2 e nessun valore predefinito presente. + x, which is not defined and cannot be created dynamically: +
    class A {} // sealed class, not dynamic
    +	print(new A().x) // no property x defined on A, and A is not dynamic
    + ]]>
    +
    + + Metodo %1 non trovato su %2 + super statement to call a function, but the function doesn't exist in the super class. + For example, the following code generates the error:
    class A() {}
    +class B extends A {
    +  function f() { print(super.f()); } // error 1070, there is no f on A
    +}
    + ]]>
    +
    + La funzione %1 è già stata associata a %2. + + Disp_id 0 non è valido. + note at the bottom of this table. * + ]]> + + + Metodo non-override %1 sostituito a causa di disp_id %2 duplicati. + note at the bottom of this table. * + ]]> + + Scrittura non valida della proprietà di sola lettura %1 su %2. + + Math non è una funzione. + math() as a function, but math is a class with static methods. + ]]> + + + Math non è una funzione di costruzione. + + + Lettura non valida della proprietà di sola scrittura %1 su %2. + + Combinazione opcode/multiname non valida: %1<%2>. + note at the bottom of this table. * + ]]> + + + Metodi nativi non consentiti nel codice caricato. + note at the bottom of this table. * + ]]> + + + Valore non valido per namespace. + note at the bottom of this table. * + ]]> + + Impossibile trovare la proprietà %1 su %2 e nessun valore predefinito presente. + + Nessuno spazio dei nomi predefinito impostato. + note at the bottom of this table. * + ]]> + + + Il prefisso "%1" per l'elemento "%2" non è associato. + foo + namespace to match foo:x:
    <foo:x xmlns:clowns='http://circuscenter.com'>
    + ]]>
    +
    + + L'elemento o l'attributo ("%1") non corrisponde alla produzione di QName: QName::=(NCName':')?NCName. + foo: or :foo as an element or attribute name, but there is nothing + on the other side of the colon. + ]]> + + Il tipo di elemento "%1" deve terminare con il tag di fine corrispondente "</%2>". + + Il metodo %1 funziona solo sugli elenchi che contengono una sola voce. + addNamespace, appendChild, childIndex, + inScopeNamespaces, insertChildAfter, insertChildBefore, + name, namespace, localName, namespaceDeclarations, + nodeKind, prependChild, removeNamespace, replace, + setChildren, setLocalName, setName, and setNamespace. + + ]]> + + L'assegnazione all'XML indicizzato non è consentita. + + Il codice nel documento successivo all'elemento principale deve essere formato correttamente. + +
  • Parsing an XMLList style object such as as XML
  • +
  • Misbalanced strings such as
  • + + ]]>
    +
    + Non è supportata l'assegnazione agli elenchi con più di una voce. + + Errore nell'analisi sintattica XML: l'elemento non è formato correttamente. + >
    is missing: + +
    <a/><b></b
    ]]> + + Errore nell'analisi sintattica XML: sezione CDATA non terminata. + Errore nell'analisi sintattica XML: dichiarazione XML non terminata. + Errore nell'analisi sintattica XML: dichiarazione DOCTYPE non terminata. + Errore nell'analisi sintattica XML: commento non terminato. + Errore nell'analisi sintattica XML: attributo non terminato. + Errore nell'analisi sintattica XML: elemento non terminato. + Errore nell'analisi sintattica XML: istruzione di elaborazione non terminata. + + Prefisso %1 non valido per no namespace. + ns = new Namespace ("prefix", ""); + ]]> + + + Impossibile fornire i flag quando si costruisce un RegExp da un altro. + new operator and set the flags as desired. For example, this statement + creates a regular expression and specifies flag settings: + var re:RegExp = new RegExp("ali", /s) + Alternatively, this statement creates a regular expression that has the same flags as re: +
    var re2:RegExp = new RegExp(re, ...)
    ]]>
    +
    + + Impossibile verificare il metodo %1 con ambito di validità sconosciuto. + note at the bottom of this table. * + ]]> + + + Valore predefinito non valido per il tipo %1. + note at the bottom of this table. * + ]]> + + + La classe %1 non può estendere la classe base finale. + note at the bottom of this table. * + ]]> + + L'attributo "%1" è già stato specificato per l'elemento "%2". + + I dati ABC sono danneggiati; tentativo di leggere fuori dei limiti. + note at the bottom of this table. * + ]]> + + + L'opcode OP_newclass è stato utilizzato con una classe base non corretta. + note at the bottom of this table. * + ]]> + + + Tentativo di chiamare direttamente la funzione non associata %1 dal metodo %2. + note at the bottom of this table. * + ]]> + + + %1 non può estendere %2. + note at the bottom of this table. * + ]]> + + + %1 non può implementare %2. + note at the bottom of this table. * + ]]> + + Incongruenza nel conteggio degli argomenti nell'assegnazione forzata della classe. Era atteso 1, è stato ricevuto %1. + + OP_newactivation utilizzato nel metodo senza flag NEED_ACTIVATION. + note at the bottom of this table. * + ]]> + + + OP_getglobalslot o OP_setglobalslot utilizzato senza area di validità globale. + note at the bottom of this table. * + ]]> + + %1 non è una funzione di costruzione. + Il secondo argomento di Function.prototype.apply deve essere un array. + Nome XML non valido: %1. + Ripetizione ciclica non valida tra i nodi. + Operatore Delete non supportato con un operando di tipo %1. + Impossibile eliminare la proprietà %1 su %2. + Corpo duplicato nel metodo %1. + Corpo non valido nel metodo di interfaccia %1. + Operatore Filter non supportato nel tipo %1. + OP_hasnext2 richiede che oggetto e indice siano registri distinti. + Errore durante l'apertura del file %1. + + Errore durante la scrittura del file %1. + + + + Uno script è stato eseguito per più del periodo di timeout predefinito di 15 secondi. + + + + Uno script non è uscito dopo 30 secondi ed è stato terminato. + + + + Fine del file. + + + L'indice di stringa %1 è fuori dei limiti; deve essere compreso nell'intervallo da %2 a %3. + + L'intervallo specificato non è valido. + start parameter is greater than its end parameter. + ]]> + + L'argomento %1 non può essere null. + + Il valore specificato per l'argomento %1 non è valido. + public function doSomething(const:int):void { + } + this ["doSomething"] ("str") + generates an error at runtime because doSomething is cast as an int data type. ]]> + + + Si è verificato un errore durante la decompressione dei dati. + + + Assegnazione di tipo forzata non riuscita: impossibile convertire %1 in %2. + Quando l'argomento callback è il metodo di una classe, l'argomento opzionale this deve essere null. +
    diff --git a/mozilla/js/tamarin/localization/lang/it/build.xml b/mozilla/js/tamarin/localization/lang/it/build.xml new file mode 100644 index 00000000000..b1cb18b72f6 --- /dev/null +++ b/mozilla/js/tamarin/localization/lang/it/build.xml @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mozilla/js/tamarin/localization/lang/ja/ErrorConstants.xml b/mozilla/js/tamarin/localization/lang/ja/ErrorConstants.xml new file mode 100644 index 00000000000..da598cf90c1 --- /dev/null +++ b/mozilla/js/tamarin/localization/lang/ja/ErrorConstants.xml @@ -0,0 +1,736 @@ + + + + + ã“ã®è¡¨ã«ã¯ã€ä¸»è¦ãª AVMplus ã«ã‚ˆã‚Šç”Ÿæˆã•れãŸã™ã¹ã¦ã®ã‚¨ãƒ©ãƒ¼ãƒ¡ãƒƒã‚»ãƒ¼ã‚¸ãŒå«ã¾ã‚Œã¦ã„ã¾ã™ã€‚ã“ã®è¡¨ã¯ã€ãƒ­ãƒ¼ã‚«ãƒªã‚¼ãƒ¼ã‚·ãƒ§ãƒ³ã‚’容易ã«ã™ã‚‹ãŸã‚ã«ãƒªã‚½ãƒ¼ã‚¹è¡¨ã¨ç½®ãæ›ãˆã‚‰ã‚Œã‚‹å¯èƒ½æ€§ãŒã‚りã¾ã™ã€‚%o = ScriptObject* %t = Traits* %m = AbstractFunction* %n = Multiname (name portion only) %N = Multiname (namespace portion only) %a = Atom %d = int %f = double %S = Stringp %s = char* + + システムã®ãƒ¡ãƒ¢ãƒªä¸è¶³ã§ã™ã€‚ + + + メソッド %1 ã¯å®Ÿè£…ã•れã¦ã„ã¾ã›ã‚“。 + + 精度ã®å¼•æ•°ã«ã¯ %2 ~ %3 ã®å€¤ã‚’指定ã—ã¦ãã ã•ã„。%1 ã¯ä¸æ­£ãªå€¤ã§ã™ã€‚ + + + + 基数ã®å¼•æ•°ã«ã¯ 2 ~ 36 ã®å€¤ã‚’指定ã—ã¦ãã ã•ã„。%1 ã¯ä¸æ­£ãªå€¤ã§ã™ã€‚ + + + + メソッド %1 ãŒå¯¾å¿œã—ã¦ã„ãªã„オブジェクトã§å‘¼ã³å‡ºã•れã¾ã—ãŸã€‚ + + + + é…åˆ—ã‚¤ãƒ³ãƒ‡ãƒƒã‚¯ã‚¹ãŒæ­£ã®æ•´æ•° (%1) ã§ã¯ã‚りã¾ã›ã‚“。 + + + + %1 ã¯é–¢æ•°ã§ã¯ã‚りã¾ã›ã‚“。 + big instead + of blg): + +
    var blg:String = "foo";
    +var big:Sprite = new Sprite();
    +var error:int = big.length(); 
    + ]]>
    +
    + コンストラクタ以外ã«ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹åŒ–ãŒè©¦è¡Œã•れã¾ã—ãŸã€‚ + %1 ãŒã‚ã„ã¾ã„ã§ã™ã€‚一致ã™ã‚‹ãƒã‚¤ãƒ³ãƒ‡ã‚£ãƒ³ã‚°ãŒè¤‡æ•°è¦‹ã¤ã‹ã‚Šã¾ã—ãŸã€‚ + + null ã®ã‚ªãƒ–ジェクトå‚ç…§ã®ãƒ—ロパティã¾ãŸã¯ãƒ¡ã‚½ãƒƒãƒ‰ã«ã‚¢ã‚¯ã‚»ã‚¹ã™ã‚‹ã“ã¨ã¯ã§ãã¾ã›ã‚“。 + addChild() method of a DisplayObjectContainer object), then its stage + property is set to null. Thus, the example generates this error because Sprite object's stage property + cannot have any properties: + +
    import flash.display.Sprite;
    +var sprite1:Sprite = new Sprite();
    +var q:String = sprite1.stage.quality;
    + ]]>
    +
    + + æ¡ä»¶ã¯æœªå®šç¾©ã§ã‚りã€ãƒ—ロパティãŒã‚りã¾ã›ã‚“。 + var obj:Object = new Object(); +obj.a = "foo"; +trace(obj.b.prop); + +

    You can also see this error because of a misspelling, for example in the following, where + mc represents a MovieClip object on the display list, and the stage + property is misspelled with a capital S (it should be stage):

    + +
    trace(mc.Stage.quality);
    + + + ]]>
    +
    + + メソッド %1 ã«ç„¡åŠ¹ãª opcode %2 (オフセット %3 内) ãŒå«ã¾ã‚Œã¦ã„ã¾ã™ã€‚ + note at the bottom of this table. * + ]]> + + + 最後ã®å‘½ä»¤ãŒã‚³ãƒ¼ãƒ‰ã‚µã‚¤ã‚ºã‚’è¶…ãˆã¾ã—ãŸã€‚ + note at the bottom of this table. * + ]]> + + + scopeDepth ㌠0 ã§ã‚ã‚‹å ´åˆã€OP_findproperty を呼ã³å‡ºã™ã“ã¨ã¯ã§ãã¾ã›ã‚“。 + note at the bottom of this table. * + ]]> + + クラス %1 ãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“。 + + メソッド %1 ã¯ãƒ‡ãƒ•ォルト㮠xml åå‰ç©ºé–“を設定ã§ãã¾ã›ã‚“ + note at the bottom of this table. * + ]]> + + Descendants æ¼”ç®—å­ (..) ã¯åž‹ %1 ã§ã‚µãƒãƒ¼ãƒˆã•れã¦ã„ã¾ã›ã‚“。 + + スコープã®ã‚¹ã‚¿ãƒƒã‚¯ã‚ªãƒ¼ãƒãƒ¼ãƒ•ローãŒç™ºç”Ÿã—ã¾ã—ãŸã€‚ + note at the bottom of this table. * + ]]> + + + スコープã®ã‚¹ã‚¿ãƒƒã‚¯ã‚¢ãƒ³ãƒ€ãƒ¼ãƒ•ローãŒç™ºç”Ÿã—ã¾ã—ãŸã€‚ + note at the bottom of this table. * + ]]> + + + Getscopeobject %1 ãŒå¢ƒç•Œå¤–ã§ã™ã€‚ + note at the bottom of this table. * + ]]> + + + コードãŒãƒ¡ã‚½ãƒƒãƒ‰ã®æœ«å°¾ã‹ã‚‰ã¯ã¿å‡ºã™ã“ã¨ã¯ã§ãã¾ã›ã‚“。 + note at the bottom of this table. * + ]]> + + + 最低 1 ã¤ã®ãƒ–ランãƒã‚¿ãƒ¼ã‚²ãƒƒãƒˆãŒãƒ¡ã‚½ãƒƒãƒ‰ã®æœ‰åйãªå‘½ä»¤ã‚’åæ˜ ã—ã¦ã„ã¾ã›ã‚“。 + note at the bottom of this table. * + ]]> + + + Void åž‹ã¯ã€é–¢æ•°ã®æˆ»ã‚Šåž‹ã¨ã—ã¦ã®ã¿ä½¿ç”¨ã§ãã¾ã™ã€‚ + note at the bottom of this table. * + ]]> + + + スタックオーãƒãƒ¼ãƒ•ローãŒç™ºç”Ÿã—ã¾ã—ãŸã€‚ + note at the bottom of this table. * + ]]> + + + スタックアンダーフローãŒç™ºç”Ÿã—ã¾ã—ãŸã€‚ + note at the bottom of this table. * + ]]> + + + 無効ãªãƒ¬ã‚¸ã‚¹ã‚¿ %1 ãŒã‚¢ã‚¯ã‚»ã‚¹ã•れã¾ã—ãŸã€‚ + note at the bottom of this table. * + ]]> + + + スロット %1 ㌠%3 ã® slotCount=%2 ã‚’è¶…ãˆã¦ã„ã¾ã™ã€‚ + note at the bottom of this table. * + ]]> + + + Method_info %1 ㌠method_count=%2 ã‚’è¶…ãˆã¦ã„ã¾ã™ã€‚ + note at the bottom of this table. * + ]]> + + + Disp_id %1 ㌠%3 ã® max_disp_id=%2 ã‚’è¶…ãˆã¦ã„ã¾ã™ã€‚ + note at the bottom of this table. * + ]]> + + + Disp_id %1 ㌠%2 ã«å¯¾ã—ã¦æœªå®šç¾©ã§ã™ã€‚ + note at the bottom of this table. * + ]]> + + + ã‚¹ã‚¿ãƒƒã‚¯ã®æ·±ã•ãŒã‚¢ãƒ³ãƒãƒ©ãƒ³ã‚¹ã§ã™ã€‚%1 != %2。 + note at the bottom of this table. * + ]]> + + + ã‚¹ã‚³ãƒ¼ãƒ—ã®æ·±ã•ãŒã‚¢ãƒ³ãƒãƒ©ãƒ³ã‚¹ã§ã™ã€‚%1 != %2。 + note at the bottom of this table. * + ]]> + + + Cpool ã®ã‚¤ãƒ³ãƒ‡ãƒƒã‚¯ã‚¹ %1 ㌠%2 ã®ç¯„囲外ã§ã™ã€‚ + note at the bottom of this table. * + ]]> + + Cpool ã®ã‚¨ãƒ³ãƒˆãƒª %1 ã®åž‹ãŒæ­£ã—ãã‚りã¾ã›ã‚“。 + 強制型変æ›ã«å¤±æ•—ã—ã¾ã—ãŸã€‚%1 ã‚’ %2 ã«å¤‰æ›ã§ãã¾ã›ã‚“。 + + メソッド %1 ã§ç„¡åŠ¹ãª super å¼ãŒè¦‹ã¤ã‹ã‚Šã¾ã—ãŸã€‚ + note at the bottom of this table. * + ]]> + + + %2 ã®ãƒ¡ã‚½ãƒƒãƒ‰ %1 ã«ä»£å…¥ã§ãã¾ã›ã‚“。 + note at the bottom of this table. * + ]]> + + + %1 ã¯å®šç¾©æ¸ˆã¿ã§ã™ã€‚ + for loops + in the same function definition) are considered to be in the same scope. + See the note at the bottom of this table. * + ]]> + + + メソッドã¯å‚ç…§ã•れるã¾ã§æ¤œè¨¼ã§ãã¾ã›ã‚“。 + note at the bottom of this table. * + ]]> + + + instanceof ã®å³å´ã¯ã‚¯ãƒ©ã‚¹ã¾ãŸã¯é–¢æ•°ã§ãªã‘れã°ãªã‚Šã¾ã›ã‚“。 + instanceof operator must be a class or function. + ]]> + + + 演算å­ã®å³å´ã¯ã‚¯ãƒ©ã‚¹ã§ãªã‘れã°ãªã‚Šã¾ã›ã‚“。 + instanceof operator must be a class. + ]]> + + + ABC ファイルã§ã¯ã‚りã¾ã›ã‚“。major_version=%1 minor_version=%2 ã§ã™ã€‚ + + + + code_length=%1 ãŒç„¡åйã§ã™ã€‚ + note at the bottom of this table. * + ]]> + + + MethodInfo-%1 サãƒãƒ¼ãƒˆã•れã¦ã„ãªã„フラグ =%2。 + note at the bottom of this table. * + ]]> + + + サãƒãƒ¼ãƒˆã•れã¦ã„ãªã„ç¨®é¡žã®æ©Ÿèƒ½ =%1。 + note at the bottom of this table. * + ]]> + + + MethodInfo-%1 ãŒå®šç¾©ã®å‰ã«å‚ç…§ã•れã¦ã„ã¾ã™ã€‚ + note at the bottom of this table. * + ]]> + + + エントリãƒã‚¤ãƒ³ãƒˆãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“ã§ã—ãŸã€‚ + note at the bottom of this table. * + ]]> + + + プロトタイプオブジェクトã¯ãƒãƒ‹ãƒ©ã‚ªãƒ–ジェクトã§ãªã‘れã°ãªã‚Šã¾ã›ã‚“。 + note at the bottom of this table. * + ]]> + + + %1 をプリミティブã«å¤‰æ›ã§ãã¾ã›ã‚“。 + note at the bottom of this table. * + ]]> + + + %1 ã¸ã®ã‚¢ãƒ¼ãƒªãƒ¼ãƒã‚¤ãƒ³ãƒ‡ã‚£ãƒ³ã‚°ã‚¢ã‚¯ã‚»ã‚¹ãŒç„¡åйã§ã™ã€‚ + note at the bottom of this table. * + ]]> + + + 無効㪠URI ㌠%1 é–¢æ•°ã«æ¸¡ã•れã¾ã—ãŸã€‚ + note at the bottom of this table. * + ]]> + + + %2 ã® %1 ã®ã‚ªãƒ¼ãƒãƒ¼ãƒ©ã‚¤ãƒ‰ãŒç„¡åйã§ã™ã€‚ + note at the bottom of this table. * + ]]> + + + 例外ãƒãƒ³ãƒ‰ãƒ©ã®ç¯„囲ã¾ãŸã¯ã‚¿ãƒ¼ã‚²ãƒƒãƒˆã‚ªãƒ•セットãŒç„¡åйã§ã™ã€‚ + note at the bottom of this table. * + ]]> + + + %2 ã®ãƒ—ロパティ %1 を作æˆã§ãã¾ã›ã‚“。 + + + + %1 ã¯ãƒ¡ã‚½ãƒƒãƒ‰ã—ã‹å«ã‚€ã“ã¨ãŒã§ãã¾ã›ã‚“。 + note at the bottom of this table. * + ]]> + + + 無効ãªã‚ªãƒšãƒ©ãƒ³ãƒ‰åž‹ :%1 㯠%2 ã§ãªã‘れã°ãªã‚Šã¾ã›ã‚“。 + note at the bottom of this table. * + ]]> + + + ClassInfo-%1 ãŒå®šç¾©ã®å‰ã«å‚ç…§ã•れã¦ã„ã¾ã™ã€‚ + note at the bottom of this table. * + ]]> + + + ClassInfo %1 ㌠class_count=%2 ã‚’è¶…ãˆã¦ã„ã¾ã™ã€‚ + note at the bottom of this table. * + ]]> + + + 値 %1 ã‚’ %2 ã«å¤‰æ›ã™ã‚‹ã¨ç²¾åº¦ãŒå¤±ã‚れã¾ã™ã€‚ + int. + +

    This error also appears for out-of-range assignments, such as the following:

    + +
    var m0:int = 2147483648; // int.MAX_VALUE == 2147483647
    +

    You can also see this error when using the bitwise left shift operator (<<). + For example, consider the following code:

    + +
    var m0:uint = 0xFF;
    +var m1:uint = m0<<24;
    + +

    The result of left shift operator (<<) is interpreted as a 32-bit two's complement number + with sign. In the example, the result is a negative value, which causes the error when assigned + to the uint typed property. A workaround is the following:

    + +
    var m0:uint = 0xFF;
    +var m1:uint = uint(m0<<24);
    + + ]]>
    +
    + %1 ã®å¼•æ•°ã®æ•°ãŒä¸€è‡´ã—ã¦ã„ã¾ã›ã‚“。%2 ãŒå¿…è¦ã§ã™ãŒã€%3 ãŒæŒ‡å®šã•れã¾ã—ãŸã€‚ + + メソッド %1 をコンストラクタã¨ã—ã¦å‘¼ã³å‡ºã™ã“ã¨ã¯ã§ãã¾ã›ã‚“。 + f() in Class A: +
    class A {
    +	   function f() {}
    +	}
    + In the following code, extracting the function causes no error. However, creating + a new instance of the function causes an error. +
    var a = new A()
    +	var m = a.f // extract f, don't call it
    +	m() // same as a.f()
    +	new m() // causes this error
    + + ]]>
    +
    + + 変数 %1 ã¯å®šç¾©ã•れã¦ã„ã¾ã›ã‚“。 + print(x) generates an error because x is undefined. However, the + statement print(y) doesn't generate an error because y is defined: +
    print("hello world")
    +	print(x) // x is undefined
    +	var y
    +	print(y) // No error, y is defined.
    + ]]>
    +
    + + function('function body') ã¨ã„ã†æ›¸å¼ã¯ã‚µãƒãƒ¼ãƒˆã•れã¦ã„ã¾ã›ã‚“。 + eval() and + function(). Thus, calling these as a constructor in ActionScript 3.0 generates this error. + ]]> + + + ãƒã‚¤ãƒ†ã‚£ãƒ–メソッド %1 ã®ãƒ¡ã‚½ãƒƒãƒ‰ãƒœãƒ‡ã‚£ãŒç„¡åйã§ã™ã€‚ + note at the bottom of this table. * + ]]> + + + %1 㨠%2 ã¯å…±æœ‰ã§ãã¾ã›ã‚“。 + note at the bottom of this table. * + ]]> + + + %2 ã«ãƒ—ロパティ %1 ãŒè¦‹ã¤ã‹ã‚‰ãšã€ãƒ‡ãƒ•ォルト値もã‚りã¾ã›ã‚“。 + x, which is not defined and cannot be created dynamically: +
    class A {} // sealed class, not dynamic
    +	print(new A().x) // no property x defined on A, and A is not dynamic
    + ]]>
    +
    + + %2 ã«ãƒ¡ã‚½ãƒƒãƒ‰ %1 ãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“。 + super statement to call a function, but the function doesn't exist in the super class. + For example, the following code generates the error:
    class A() {}
    +class B extends A {
    +  function f() { print(super.f()); } // error 1070, there is no f on A
    +}
    + ]]>
    +
    + 関数 %1 㯠%2 ã«ãƒã‚¤ãƒ³ãƒ‰æ¸ˆã¿ã§ã™ã€‚ + + Disp_id 0 ãŒç„¡åйã§ã™ã€‚ + note at the bottom of this table. * + ]]> + + + disp_id %2 ãŒé‡è¤‡ã—ã¦ã„ã‚‹ãŸã‚ã«ã€éžã‚ªãƒ¼ãƒãƒ¼ãƒ©ã‚¤ãƒ‰ãƒ¡ã‚½ãƒƒãƒ‰ %1 ãŒç½®æ›ã•れã¾ã—ãŸã€‚ + note at the bottom of this table. * + ]]> + + %2 ã®èª­ã¿å–り専用プロパティ %1 ã¸ã¯æ›¸ãè¾¼ã¿ã§ãã¾ã›ã‚“。 + + Math ã¯é–¢æ•°ã§ã¯ã‚りã¾ã›ã‚“。 + math() as a function, but math is a class with static methods. + ]]> + + + Math ã¯ã‚³ãƒ³ã‚¹ãƒˆãƒ©ã‚¯ã‚¿ã§ã¯ã‚りã¾ã›ã‚“。 + + + %2 ã®æ›¸ãè¾¼ã¿å°‚用プロパティ %1 ã®èª­ã¿è¾¼ã¿ã¯ç„¡åйã§ã™ã€‚ + + オプコードã¨ãƒžãƒ«ãƒãƒãƒ¼ãƒ ã®çµ„ã¿åˆã‚ã›ãŒç„¡åйã§ã™ :%1<%2>。 + note at the bottom of this table. * + ]]> + + + 読ã¿è¾¼ã¾ã‚ŒãŸã‚³ãƒ¼ãƒ‰ã§ã¯ãƒã‚¤ãƒ†ã‚£ãƒ–メソッドを使用ã§ãã¾ã›ã‚“。 + note at the bottom of this table. * + ]]> + + + åå‰ç©ºé–“ã®å€¤ãŒç„¡åйã§ã™ã€‚ + note at the bottom of this table. * + ]]> + + %2 ã«ãƒ—ロパティ %1 ãŒè¦‹ã¤ã‹ã‚‰ãšã€ãƒ‡ãƒ•ォルト値もã‚りã¾ã›ã‚“。 + + デフォルトã®åå‰ç©ºé–“ãŒè¨­å®šã•れã¦ã„ã¾ã›ã‚“。 + note at the bottom of this table. * + ]]> + + + エレメント "%2" ã®æŽ¥é ­è¾ž "%1" ãŒãƒã‚¤ãƒ³ãƒ‰ã•れã¦ã„ã¾ã›ã‚“。 + foo + namespace to match foo:x:
    <foo:x xmlns:clowns='http://circuscenter.com'>
    + ]]>
    +
    + + エレメントã¾ãŸã¯å±žæ€§ ("%1") ㌠QName プロダクションã¨ä¸€è‡´ã—ã¾ã›ã‚“ : QName::=(NCName':')?NCName。 + foo: or :foo as an element or attribute name, but there is nothing + on the other side of the colon. + ]]> + + エレメント型 "%1" ã¯å¯¾å¿œã™ã‚‹çµ‚了タグ "</%2>" ã§çµ‚了ã™ã‚‹å¿…è¦ãŒã‚りã¾ã™ã€‚ + + %1 メソッドã¯ã€å˜ä¸€ã®ã‚¢ã‚¤ãƒ†ãƒ ã‚’å«ã‚€ãƒªã‚¹ãƒˆã«å¯¾ã—ã¦ã®ã¿ä½¿ç”¨ã§ãã¾ã™ã€‚ + addNamespace, appendChild, childIndex, + inScopeNamespaces, insertChildAfter, insertChildBefore, + name, namespace, localName, namespaceDeclarations, + nodeKind, prependChild, removeNamespace, replace, + setChildren, setLocalName, setName, and setNamespace. + + ]]> + + インデックス付ãã® XML ã¸ã®ä»£å…¥ã¯è¨±å¯ã•れã¾ã›ã‚“。 + + ルートエレメントã«ç¶šãドキュメントã®ãƒžãƒ¼ã‚¯ã‚¢ãƒƒãƒ—ã¯æ•´å½¢å¼ã§ãªã‘れã°ãªã‚Šã¾ã›ã‚“。 + +
  • Parsing an XMLList style object such as as XML
  • +
  • Misbalanced strings such as
  • + + ]]>
    +
    + 複数ã®ã‚¢ã‚¤ãƒ†ãƒ ã‚’å«ã‚€ãƒªã‚¹ãƒˆã¸ã®ä»£å…¥ã¯ã‚µãƒãƒ¼ãƒˆã•れã¦ã„ã¾ã›ã‚“。 + + XML パーサエラー :エレメントã®å½¢å¼ãŒæ­£ã—ãã‚りã¾ã›ã‚“。 + >
    is missing: + +
    <a/><b></b
    ]]> + + XML パーサエラー :CDATA セクションãŒçµ‚了ã—ã¦ã„ã¾ã›ã‚“。 + XML パーサエラー :XML 宣言ãŒçµ‚了ã—ã¦ã„ã¾ã›ã‚“。 + XML パーサエラー :DOCTYPE 宣言ãŒçµ‚了ã—ã¦ã„ã¾ã›ã‚“。 + XML パーサエラー :コメントãŒçµ‚了ã—ã¦ã„ã¾ã›ã‚“。 + XML パーサエラー :属性ãŒçµ‚了ã—ã¦ã„ã¾ã›ã‚“。 + XML パーサエラー :エレメントãŒçµ‚了ã—ã¦ã„ã¾ã›ã‚“。 + XML パーサエラー :処ç†å‘½ä»¤ãŒçµ‚了ã—ã¦ã„ã¾ã›ã‚“。 + + no namespace ã®æŽ¥é ­è¾ž %1 ãŒç„¡åйã§ã™ã€‚ + ns = new Namespace ("prefix", ""); + ]]> + + + RegExp ã‹ã‚‰åˆ¥ã® RegExp を構築ã™ã‚‹éš›ã«ãƒ•ラグを渡ã™ã“ã¨ã¯ã§ãã¾ã›ã‚“。 + new operator and set the flags as desired. For example, this statement + creates a regular expression and specifies flag settings: + var re:RegExp = new RegExp("ali", /s) + Alternatively, this statement creates a regular expression that has the same flags as re: +
    var re2:RegExp = new RegExp(re, ...)
    ]]>
    +
    + + 䏿˜Žãªã‚¹ã‚³ãƒ¼ãƒ—ã‚’æŒã¤ãƒ¡ã‚½ãƒƒãƒ‰ %1 を検証ã§ãã¾ã›ã‚“。 + note at the bottom of this table. * + ]]> + + + åž‹ %1 ã®ãƒ‡ãƒ•ォルト値ãŒç„¡åйã§ã™ã€‚ + note at the bottom of this table. * + ]]> + + + クラス %1 ã¯ã€final 基本クラスを拡張ã§ãã¾ã›ã‚“。 + note at the bottom of this table. * + ]]> + + 属性 "%1" (エレメント "%2") ã¯æ—¢ã«æŒ‡å®šã•れã¦ã„ã¾ã™ã€‚ + + ABC データã¯ç ´æã—ã¦ã„ã‚‹ãŸã‚ã€å¢ƒç•Œå¤–ã®èª­ã¿å–りãŒè©¦è¡Œã•れã¾ã—ãŸã€‚ + note at the bottom of this table. * + ]]> + + + OP_newclass オプコードãŒä¸æ­£ãªåŸºæœ¬ã‚¯ãƒ©ã‚¹ã§ä½¿ç”¨ã•れã¾ã—ãŸã€‚ + note at the bottom of this table. * + ]]> + + + çµåˆã•れã¦ã„ãªã„関数 %1 をメソッド %2 ã‹ã‚‰ç›´æŽ¥å‘¼ã³å‡ºãã†ã¨ã—ã¾ã—ãŸã€‚ + note at the bottom of this table. * + ]]> + + + %1 㯠%2 ã‚’æ‹¡å¼µã§ãã¾ã›ã‚“。 + note at the bottom of this table. * + ]]> + + + %1 㯠%2 を実装ã§ãã¾ã›ã‚“。 + note at the bottom of this table. * + ]]> + + クラスã®åž‹å¤‰æ›ã«æŒ‡å®šã•れãŸå¼•æ•°ã®æ•°ãŒä¸æ­£ã§ã™ã€‚1 個必è¦ã§ã™ãŒã€%1 個指定ã•れã¾ã—ãŸã€‚ + + OP_newactivation ㌠NEED_ACTIVATION フラグãªã—ã§ãƒ¡ã‚½ãƒƒãƒ‰ã§ä½¿ç”¨ã•れã¾ã—ãŸã€‚ + note at the bottom of this table. * + ]]> + + + グローãƒãƒ«ã‚¹ã‚³ãƒ¼ãƒ—ãªã—ã§ OP_getglobalslot ã¾ãŸã¯ OP_setglobalslot ãŒä½¿ç”¨ã•れã¾ã—ãŸã€‚ + note at the bottom of this table. * + ]]> + + %1 ã¯ã‚³ãƒ³ã‚¹ãƒˆãƒ©ã‚¯ã‚¿ã§ã¯ã‚りã¾ã›ã‚“。 + Function.prototype.apply ã® 2 番目ã®å¼•æ•°ã¯é…列ã§ãªã‘れã°ãªã‚Šã¾ã›ã‚“。 + 無効㪠XML å : %1。 + ノード間ã«ä¸æ­£ãªå‘¨æœŸçš„ãªãƒ«ãƒ¼ãƒ—ãŒã‚りã¾ã™ã€‚ + Delete 演算å­ã¯ã‚ªãƒšãƒ©ãƒ³ãƒ‰åž‹ %1 ã§ã‚µãƒãƒ¼ãƒˆã•れã¦ã„ã¾ã›ã‚“。 + %2 ã®ãƒ—ロパティ %1 を削除ã§ãã¾ã›ã‚“。 + メソッド %1 ã®ãƒ¡ã‚½ãƒƒãƒ‰ãƒœãƒ‡ã‚£ãŒé‡è¤‡ã—ã¦ã„ã¾ã™ã€‚ + インターフェイスメソッド %1 ã®ãƒ¡ã‚½ãƒƒãƒ‰ãƒœãƒ‡ã‚£ãŒç„¡åйã§ã™ã€‚ + Filter 演算å­ã¯åž‹ %1 ã§ã‚µãƒãƒ¼ãƒˆã•れã¦ã„ã¾ã›ã‚“。 + OP_hasnext2 を明示的ã«ç™»éŒ²ã™ã‚‹ã«ã¯ã€ã‚ªãƒ–ジェクトã¨ã‚¤ãƒ³ãƒ‡ãƒƒã‚¯ã‚¹ãŒå¿…è¦ã§ã™ã€‚ + ファイル %1 ã‚’é–‹ãéš›ã«ã‚¨ãƒ©ãƒ¼ãŒç™ºç”Ÿã—ã¾ã—ãŸã€‚ + + ファイル %1 ã«æ›¸ã込む際ã«ã‚¨ãƒ©ãƒ¼ãŒç™ºç”Ÿã—ã¾ã—ãŸã€‚ + + + + スクリプトãŒãƒ‡ãƒ•ォルトã®ã‚¿ã‚¤ãƒ ã‚¢ã‚¦ãƒˆæ™‚é–“ã® 15 ç§’ã‚’è¶…ãˆã¦å®Ÿè¡Œã•れã¾ã—ãŸã€‚ + + + + スクリプト㌠30 秒後ã®çµ‚了ã«å¤±æ•—ã—ãŸãŸã‚ã€å¼·åˆ¶çµ‚了ã—ã¾ã—ãŸã€‚ + + + + ファイルã®çµ‚端ã§ã™ã€‚ + + + 文字列インデックス %1 ãŒå¢ƒç•Œå¤–ã§ã™ã€‚%2 ~ %3 ã®ç¯„囲内ã§ã‚ã‚‹å¿…è¦ãŒã‚りã¾ã™ã€‚ + + 指定ã—ãŸç¯„囲ã¯ç„¡åйã§ã™ã€‚ + start parameter is greater than its end parameter. + ]]> + + 引数 %1 㯠null ã«ã™ã‚‹ã“ã¨ãŒã§ãã¾ã›ã‚“。 + + 引数 %1 ã«æŒ‡å®šã—ãŸå€¤ã¯ç„¡åйã§ã™ã€‚ + public function doSomething(const:int):void { + } + this ["doSomething"] ("str") + generates an error at runtime because doSomething is cast as an int data type. ]]> + + + 圧縮データã®è§£å‡æ™‚ã«ã‚¨ãƒ©ãƒ¼ãŒç™ºç”Ÿã—ã¾ã—ãŸã€‚ + + + 強制型変æ›ã«å¤±æ•—ã—ã¾ã—ãŸã€‚%1 ã‚’ %2 ã«å¤‰æ›ã§ãã¾ã›ã‚“。 + コールãƒãƒƒã‚¯å¼•æ•°ãŒã‚¯ãƒ©ã‚¹ã®ãƒ¡ã‚½ãƒƒãƒ‰ã®ã¨ãã€ä»»æ„指定ã®å¼•æ•° 'this' 㯠null ã§ãªã‘れã°ãªã‚Šã¾ã›ã‚“。 +
    diff --git a/mozilla/js/tamarin/localization/lang/ja/build.xml b/mozilla/js/tamarin/localization/lang/ja/build.xml new file mode 100644 index 00000000000..b1cb18b72f6 --- /dev/null +++ b/mozilla/js/tamarin/localization/lang/ja/build.xml @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mozilla/js/tamarin/localization/lang/ko/ErrorConstants.xml b/mozilla/js/tamarin/localization/lang/ko/ErrorConstants.xml new file mode 100644 index 00000000000..ff85f8e206d --- /dev/null +++ b/mozilla/js/tamarin/localization/lang/ko/ErrorConstants.xml @@ -0,0 +1,736 @@ + + + + + This table contains all of the error messages generated by core avmplus. This will likely be replaced by a resource table for easy localization. %o = ScriptObject* %t = Traits* %m = AbstractFunction* %n = Multiname (name portion only) %N = Multiname (namespace portion only) %a = Atom %d = int %f = double %S = Stringp %s = char* + + ì‹œìŠ¤í…œì˜ ë©”ëª¨ë¦¬ê°€ 부족합니다. + + + 메서드 %1ì´(ê°€) 구현ë˜ì§€ 않습니다. + + ì •ë°€ë„ ì¸ìˆ˜ëŠ” %2ê³¼ %3 사ì´ì˜ ê°’ì´ì–´ì•¼ 합니다. %1ì€(는) 유효하지 않습니다. + + + + 기수 ì¸ìˆ˜ëŠ” 2와 36 사ì´ì˜ ê°’ì´ì–´ì•¼ 하지만 %1입니다. + + + + 호환ë˜ì§€ 않는 ê°ì²´ì—서 메서드 %1ì„(를) 호출했습니다. + + + + ë°°ì—´ ì¸ë±ìŠ¤ê°€ ì–‘ì˜ ì •ìˆ˜(%1)ê°€ 아닙니다. + + + + %1ì€(는) 함수가 아닙니다. + big instead + of blg): + +
    var blg:String = "foo";
    +var big:Sprite = new Sprite();
    +var error:int = big.length(); 
    + ]]>
    +
    + 비ìƒì„±ìžì—서 ì¸ìŠ¤í„´ìŠ¤í™”ë¥¼ 시ë„했습니다. + %1ì€(는) 모호합니다. ì¼ì¹˜í•˜ëŠ” ë°”ì¸ë”©ì´ ë‘ ê°œ ì´ìƒ 있습니다. + + null ê°ì²´ ì°¸ì¡°ì˜ ì†ì„±ì´ë‚˜ ë©”ì„œë“œì— ì•¡ì„¸ìŠ¤í•  수 없습니다. + addChild() method of a DisplayObjectContainer object), then its stage + property is set to null. Thus, the example generates this error because Sprite object's stage property + cannot have any properties: + +
    import flash.display.Sprite;
    +var sprite1:Sprite = new Sprite();
    +var q:String = sprite1.stage.quality;
    + ]]>
    +
    + + ì •ì˜ë˜ì§€ ì•Šì€ ìš©ì–´ì´ë©° ì†ì„±ì´ 없습니다. + var obj:Object = new Object(); +obj.a = "foo"; +trace(obj.b.prop); + +

    You can also see this error because of a misspelling, for example in the following, where + mc represents a MovieClip object on the display list, and the stage + property is misspelled with a capital S (it should be stage):

    + +
    trace(mc.Stage.quality);
    + + + ]]>
    +
    + + 메서드 %1ì€(는) ìž˜ëª»ëœ opcode %2ì„(를) í¬í•¨í•˜ê³  있습니다(오프셋 %3ì— ìžˆìŒ). + note at the bottom of this table. * + ]]> + + + 마지막 ëª…ë ¹ì´ ì½”ë“œ í¬ê¸°ë¥¼ 초과했습니다. + note at the bottom of this table. * + ]]> + + + scopeDepthê°€ 0ì´ë©´ OP_findproperty를 호출할 수 없습니다. + note at the bottom of this table. * + ]]> + + í´ëž˜ìФ %1ì„(를) ì°¾ì„ ìˆ˜ 없습니다. + + 메서드 %1ì€(는) 기본 xml 네임스페ì´ìŠ¤ë¥¼ 설정할 수 없습니다. + note at the bottom of this table. * + ]]> + + 하위 ì—°ì‚°ìž(..)는 %1 유형ì—서 ì§€ì›ë˜ì§€ 않습니다. + + 범위 ìŠ¤íƒ ì˜¤ë²„í”Œë¡œê°€ ë°œìƒí–ˆìŠµë‹ˆë‹¤. + note at the bottom of this table. * + ]]> + + + 범위 ìŠ¤íƒ ì–¸ë”플로가 ë°œìƒí–ˆìŠµë‹ˆë‹¤. + note at the bottom of this table. * + ]]> + + + Getscopeobject %1ì´(ê°€) 범위를 벗어났습니다. + note at the bottom of this table. * + ]]> + + + 코드는 메서드 ë ë¶€ë¶„ì„ ë²—ì–´ë‚  수 없습니다. + note at the bottom of this table. * + ]]> + + + ì ì–´ë„ í•˜ë‚˜ì˜ ë¶„ê¸° 대ìƒì´ ë©”ì„œë“œì˜ ìœ íš¨í•œ ëª…ë ¹ì— ìžˆì§€ 않습니다. + note at the bottom of this table. * + ]]> + + + void 형ì‹ì€ 함수 반환 형ì‹ìœ¼ë¡œë§Œ 사용할 수 있습니다. + note at the bottom of this table. * + ]]> + + + ìŠ¤íƒ ì˜¤ë²„í”Œë¡œê°€ ë°œìƒí–ˆìŠµë‹ˆë‹¤. + note at the bottom of this table. * + ]]> + + + ìŠ¤íƒ ì–¸ë”플로가 ë°œìƒí–ˆìŠµë‹ˆë‹¤. + note at the bottom of this table. * + ]]> + + + 유효하지 ì•Šì€ ë ˆì§€ìŠ¤í„° %1ì„(를) 액세스했습니다. + note at the bottom of this table. * + ]]> + + + 슬롯 %1ì´(ê°€) %3ì˜ slotCount=%2ì„(를) 초과했습니다. + note at the bottom of this table. * + ]]> + + + Method_info %1ì´(ê°€) method_count=%2ì„(를) 초과했습니다. + note at the bottom of this table. * + ]]> + + + Disp_id %1ì´(ê°€) %3ì˜ max_disp_id=%2ì„(를) 초과했습니다. + note at the bottom of this table. * + ]]> + + + Disp_id %1ì´(ê°€) %2ì— ì •ì˜ë˜ì–´ 있지 않습니다. + note at the bottom of this table. * + ]]> + + + ìŠ¤íƒ ê¹Šì´ì˜ ê· í˜•ì´ ë§žì§€ 않습니다. %1 != %2 + note at the bottom of this table. * + ]]> + + + 범위 심ë„ì˜ ê· í˜•ì´ ë§žì§€ 않습니다. %1 != %2 + note at the bottom of this table. * + ]]> + + + Cpool ì¸ë±ìФ %1ì´(ê°€) 범위 %2ì„(를) 벗어났습니다. + note at the bottom of this table. * + ]]> + + Cpool 항목 %1ì€(는) ìž˜ëª»ëœ ìœ í˜•ìž…ë‹ˆë‹¤. + 유형 ê°•ì œ ë³€í™˜ì— ì‹¤íŒ¨í–ˆìŠµë‹ˆë‹¤. %1ì„(를) %2(으)로 변환할 수 없습니다. + + 메서드 %1ì— ìž˜ëª»ëœ super 표현ì‹ì´ 있습니다. + note at the bottom of this table. * + ]]> + + + %2ì˜ ë©”ì„œë“œ %1ì— í• ë‹¹í•  수 없습니다. + note at the bottom of this table. * + ]]> + + + %1ì´(ê°€) ì´ë¯¸ ì •ì˜ë˜ì–´ 있습니다. + for loops + in the same function definition) are considered to be in the same scope. + See the note at the bottom of this table. * + ]]> + + + 참조할 때까지 메서드를 확ì¸í•  수 없습니다. + note at the bottom of this table. * + ]]> + + + instanceofì˜ ì˜¤ë¥¸ìª½ì€ í´ëž˜ìФ ë˜ëŠ” 함수여야 합니다. + instanceof operator must be a class or function. + ]]> + + + ì—°ì‚°ìžì˜ ì˜¤ë¥¸ìª½ì€ í´ëž˜ìŠ¤ì—¬ì•¼ 합니다. + instanceof operator must be a class. + ]]> + + + ABC 파ì¼ì´ 아닙니다. major_version=%1 minor_version=%2 + + + + code_length=%1ì´(ê°€) 유효하지 않습니다. + note at the bottom of this table. * + ]]> + + + flags=%1ì„(를) ì§€ì›í•˜ì§€ 않는 MethodInfo-%2입니다. + note at the bottom of this table. * + ]]> + + + traits kind=%1ì„(를) ì§€ì›í•˜ì§€ 않습니다. + note at the bottom of this table. * + ]]> + + + ì •ì˜í•˜ê¸° ì „ì— MethodInfo-%1ì„(를) 참조합니다. + note at the bottom of this table. * + ]]> + + + ì§„ìž…ì ì„ ì°¾ì„ ìˆ˜ 없습니다. + note at the bottom of this table. * + ]]> + + + 프로토타입 ê°ì²´ëŠ” vanilla ê°ì²´ì—¬ì•¼ 합니다. + note at the bottom of this table. * + ]]> + + + %1ì„(를) ì›ì‹œ 값으로 변환할 수 없습니다. + note at the bottom of this table. * + ]]> + + + %1ì— ëŒ€í•œ 초기 ë°”ì¸ë”© 액세스가 잘못ë˜ì—ˆìŠµë‹ˆë‹¤. + note at the bottom of this table. * + ]]> + + + %1 í•¨ìˆ˜ì— ìœ íš¨í•˜ì§€ ì•Šì€ URIê°€ 전달ë˜ì—ˆìŠµë‹ˆë‹¤. + note at the bottom of this table. * + ]]> + + + %2ì˜ %1ì— ëŒ€í•œ 재정ì˜ê°€ 잘못ë˜ì—ˆìŠµë‹ˆë‹¤. + note at the bottom of this table. * + ]]> + + + 예외 í•¸ë“¤ëŸ¬ì˜ ë²”ìœ„ ë˜ëŠ” ëŒ€ìƒ ì˜¤í”„ì…‹ì´ ìž˜ëª»ë˜ì—ˆìŠµë‹ˆë‹¤. + note at the bottom of this table. * + ]]> + + + %2ì— ì†ì„± %1ì„(를) 만들 수 없습니다. + + + + %1ì€(는) 메서드만 í¬í•¨í•  수 있습니다. + note at the bottom of this table. * + ]]> + + + í”¼ì—°ì‚°ìž ìœ í˜•ì´ ìž˜ëª»ë˜ì—ˆìŠµë‹ˆë‹¤. %1ì€(는) %2ì´ì–´ì•¼ 합니다. + note at the bottom of this table. * + ]]> + + + ì •ì˜í•˜ê¸° ì „ì— ClassInfo-%1ì„(를) 참조합니다. + note at the bottom of this table. * + ]]> + + + ClassInfo %1ì´(ê°€) class_count=%2ì„(를) 초과했습니다. + note at the bottom of this table. * + ]]> + + + ì •ë°€ë„ì˜ ì†ìƒ ì—†ì´ëŠ” ê°’ %1ì„(를) %2(으)로 변환할 수 없습니다. + int. + +

    This error also appears for out-of-range assignments, such as the following:

    + +
    var m0:int = 2147483648; // int.MAX_VALUE == 2147483647
    +

    You can also see this error when using the bitwise left shift operator (<<). + For example, consider the following code:

    + +
    var m0:uint = 0xFF;
    +var m1:uint = m0<<24;
    + +

    The result of left shift operator (<<) is interpreted as a 32-bit two's complement number + with sign. In the example, the result is a negative value, which causes the error when assigned + to the uint typed property. A workaround is the following:

    + +
    var m0:uint = 0xFF;
    +var m1:uint = uint(m0<<24);
    + + ]]>
    +
    + %1ì—서 ì¸ìˆ˜ 개수가 ì¼ì¹˜í•˜ì§€ 않습니다. %2개가 필요하지만 %3개가 있습니다. + + 메서드 %1ì„(를) ìƒì„±ìžë¡œ 호출할 수 없습니다. + f() in Class A: +
    class A {
    +	   function f() {}
    +	}
    + In the following code, extracting the function causes no error. However, creating + a new instance of the function causes an error. +
    var a = new A()
    +	var m = a.f // extract f, don't call it
    +	m() // same as a.f()
    +	new m() // causes this error
    + + ]]>
    +
    + + 변수 %1ì´(ê°€) ì •ì˜ë˜ì–´ 있지 않습니다. + print(x) generates an error because x is undefined. However, the + statement print(y) doesn't generate an error because y is defined: +
    print("hello world")
    +	print(x) // x is undefined
    +	var y
    +	print(y) // No error, y is defined.
    + ]]>
    +
    + + ì–‘ì‹ í•¨ìˆ˜('함수 본문')는 ì§€ì›ë˜ì§€ 않습니다. + eval() and + function(). Thus, calling these as a constructor in ActionScript 3.0 generates this error. + ]]> + + + 기본 메서드 %1ì˜ ë©”ì„œë“œ ë³¸ë¬¸ì´ ìž˜ëª»ë˜ì—ˆìŠµë‹ˆë‹¤. + note at the bottom of this table. * + ]]> + + + %1ê³¼(와) %2ì„(를) ì¡°ì •í•  수 없습니다. + note at the bottom of this table. * + ]]> + + + %2ì—서 ì†ì„± %1ì„(를) ì°¾ì„ ìˆ˜ 없습니다. ê¸°ë³¸ê°’ì´ ì—†ìŠµë‹ˆë‹¤. + x, which is not defined and cannot be created dynamically: +
    class A {} // sealed class, not dynamic
    +	print(new A().x) // no property x defined on A, and A is not dynamic
    + ]]>
    +
    + + %2ì—서 메서드 %1ì„(를) ì°¾ì„ ìˆ˜ 없습니다. + super statement to call a function, but the function doesn't exist in the super class. + For example, the following code generates the error:
    class A() {}
    +class B extends A {
    +  function f() { print(super.f()); } // error 1070, there is no f on A
    +}
    + ]]>
    +
    + 함수 %1ì´(ê°€) ì´ë¯¸ %2ì— ë°”ì¸ë”©ë˜ì—ˆìŠµë‹ˆë‹¤. + + Disp_id 0ì´ ìž˜ëª»ë˜ì—ˆìŠµë‹ˆë‹¤. + note at the bottom of this table. * + ]]> + + + ë³µì œëœ disp_id %2(으)로 ì¸í•´ 재정ì˜ë˜ì§€ ì•Šì€ ë©”ì„œë“œ %1ì´(ê°€) 대체ë˜ì—ˆìŠµë‹ˆë‹¤. + note at the bottom of this table. * + ]]> + + %2ì˜ ì½ê¸° ì „ìš© ì†ì„± %1ì—는 쓸 수 없습니다. + + Math는 함수가 아닙니다. + math() as a function, but math is a class with static methods. + ]]> + + + Math는 ìƒì„±ìžê°€ 아닙니다. + + + %2ì˜ ì“°ê¸° ì „ìš© ì†ì„± %1ì€(는) ì½ì„ 수 없습니다. + + ìž˜ëª»ëœ opcode/multiname 조합입니다. %1<%2>. + note at the bottom of this table. * + ]]> + + + ë¡œë“œëœ ì½”ë“œì—는 기본 메서드를 사용할 수 없습니다. + note at the bottom of this table. * + ]]> + + + 네임스페ì´ìŠ¤ì˜ ê°’ì´ ìž˜ëª»ë˜ì—ˆìŠµë‹ˆë‹¤. + note at the bottom of this table. * + ]]> + + ì†ì„± %1ì„(를) %2ì—서 ì°¾ì„ ìˆ˜ 없습니다. ê¸°ë³¸ê°’ì´ ì—†ìŠµë‹ˆë‹¤. + + 기본 네임스페ì´ìŠ¤ê°€ 설정ë˜ì§€ 않았습니다. + note at the bottom of this table. * + ]]> + + + 요소 "%2"ì— ëŒ€í•œ ì ‘ë‘ì–´ "%1"ì´(ê°€) ë°”ì¸ë”©ë˜ì§€ 않았습니다. + foo + namespace to match foo:x:
    <foo:x xmlns:clowns='http://circuscenter.com'>
    + ]]>
    +
    + + 요소 ë˜ëŠ” ì†ì„±("%1")ì´ QName ìƒì„± 규칙과 ì¼ì¹˜í•˜ì§€ 않습니다. QName::=(NCName':')?NCName + foo: or :foo as an element or attribute name, but there is nothing + on the other side of the colon. + ]]> + + 요소 유형 "%1"ì€(는) ì¼ì¹˜í•˜ëŠ” ë 태그 "</%2>"(으)로 ë나야 합니다. + + %1 메서드는 항목 하나를 í¬í•¨í•œ 목ë¡ì—서만 ìž‘ë™í•©ë‹ˆë‹¤. + addNamespace, appendChild, childIndex, + inScopeNamespaces, insertChildAfter, insertChildBefore, + name, namespace, localName, namespaceDeclarations, + nodeKind, prependChild, removeNamespace, replace, + setChildren, setLocalName, setName, and setNamespace. + + ]]> + + ì¸ë±ì‹±ëœ XMLì— í• ë‹¹í•  수 없습니다. + + 루트 요소 다ìŒì— 나오는 문서 ë‚´ì˜ íƒœê·¸ëŠ” 올바른 형ì‹ì´ì–´ì•¼ 합니다. + +
  • Parsing an XMLList style object such as as XML
  • +
  • Misbalanced strings such as
  • + + ]]>
    +
    + 둘 ì´ìƒì˜ í•­ëª©ì´ ìžˆëŠ” 목ë¡ì— í• ë‹¹ì´ ì§€ì›ë˜ì§€ 않습니다. + + XML 파서 실패: 요소가 잘못ë˜ì—ˆìŠµë‹ˆë‹¤. + >
    is missing: + +
    <a/><b></b
    ]]> + + XML 파서 실패: CDATA ì„¹ì…˜ì´ ì¢…ê²°ë˜ì§€ 않았습니다. + XML 파서 실패: XML ì„ ì–¸ì´ ì¢…ê²°ë˜ì§€ 않았습니다. + XML 파서 실패: DOCTYPE ì„ ì–¸ì´ ì¢…ê²°ë˜ì§€ 않았습니다. + XML 파서 실패: 주ì„ì´ ì¢…ê²°ë˜ì§€ 않았습니다. + XML 파서 실패: ì†ì„±ì´ 종결ë˜ì§€ 않았습니다. + XML 파서 실패: 요소가 종결ë˜ì§€ 않았습니다. + XML 파서 실패: 처리 ëª…ë ¹ì´ ì¢…ê²°ë˜ì§€ 않았습니다. + + 네임스페ì´ìФ ì—†ìŒì— 대한 ì ‘ë‘ì–´ %1ì´(ê°€) 잘못ë˜ì—ˆìŠµë‹ˆë‹¤. + ns = new Namespace ("prefix", ""); + ]]> + + + 다른 RegExp로부터 í•˜ë‚˜ì˜ RegExp를 만드는 경우 플래그를 제공할 수 없습니다. + new operator and set the flags as desired. For example, this statement + creates a regular expression and specifies flag settings: + var re:RegExp = new RegExp("ali", /s) + Alternatively, this statement creates a regular expression that has the same flags as re: +
    var re2:RegExp = new RegExp(re, ...)
    ]]>
    +
    + + 범위를 알 수 없는 메서드 %1ì€(는) 확ì¸í•  수 없습니다. + note at the bottom of this table. * + ]]> + + + 유형 %1ì˜ ê¸°ë³¸ê°’ì´ ìž˜ëª»ë˜ì—ˆìŠµë‹ˆë‹¤. + note at the bottom of this table. * + ]]> + + + í´ëž˜ìФ %1ì€(는) 최종 기본 í´ëž˜ìŠ¤ë¥¼ 확장할 수 없습니다. + note at the bottom of this table. * + ]]> + + ì†ì„± "%1"ì´(ê°€) 요소 "%2"ì— ëŒ€í•´ ì´ë¯¸ 지정ë˜ì—ˆìŠµë‹ˆë‹¤. + + ABC ë°ì´í„°ê°€ ì†ìƒë˜ì—ˆìœ¼ë©° 범위를 벗어나는 ì½ê¸°ë¥¼ 시ë„합니다. + note at the bottom of this table. * + ]]> + + + OP_newclass opcodeê°€ ìž˜ëª»ëœ ê¸°ë³¸ í´ëž˜ìФì—서 사용ë˜ì—ˆìŠµë‹ˆë‹¤. + note at the bottom of this table. * + ]]> + + + 언바운드 함수 %1ì„(를) 메서드 %2(으)로부터 ì§ì ‘ 호출하려고 시ë„합니다. + note at the bottom of this table. * + ]]> + + + %1ì€(는) %2ì„(를) 확장할 수 없습니다. + note at the bottom of this table. * + ]]> + + + %1ì€(는) %2ì„(를) 구현할 수 없습니다. + note at the bottom of this table. * + ]]> + + ì¸ìˆ˜ 개수가 í´ëž˜ìФ ê°•ì œ 변환 시 ì¼ì¹˜í•˜ì§€ 않습니다. 1개가 필요하지만 %1개가 있습니다. + + NEED_ACTIVATION 플래그가 없는 ë©”ì„œë“œì— OP_newactivationì´ ì‚¬ìš©ë˜ì—ˆìŠµë‹ˆë‹¤. + note at the bottom of this table. * + ]]> + + + ì „ì—­ 범위 ì—†ì´ OP_getglobalslot ë˜ëŠ” OP_setglobalslotì´ ì‚¬ìš©ë˜ì—ˆìŠµë‹ˆë‹¤. + note at the bottom of this table. * + ]]> + + %1ì€(는) ìƒì„±ìžê°€ 아닙니다. + Function.prototype.applyì˜ ë‘ ë²ˆì§¸ ì¸ìˆ˜ëŠ” ë°°ì—´ì´ì–´ì•¼ 합니다. + ìž˜ëª»ëœ XML ì´ë¦„: %1 + 노드 사ì´ì˜ 순환 루프가 잘못ë˜ì—ˆìŠµë‹ˆë‹¤. + 유형 %1ì˜ í”¼ì—°ì‚°ìžì— 대해서는 Delete ì—°ì‚°ìžê°€ ì§€ì›ë˜ì§€ 않습니다. + %2ì˜ ì†ì„± %1ì„(를) 삭제할 수 없습니다. + 메서드 %1ì— ë³µì œëœ ë©”ì„œë“œ ë³¸ë¬¸ì´ ìžˆìŠµë‹ˆë‹¤. + ì¸í„°íŽ˜ì´ìФ 메서드 %1ì— ìž˜ëª»ëœ ë©”ì„œë“œ ë³¸ë¬¸ì´ ìžˆìŠµë‹ˆë‹¤. + 유형 %1ì—서는 í•„í„° ì—°ì‚°ìžê°€ ì§€ì›ë˜ì§€ 않습니다. + OP_hasnext2는 개별 레지스터가 ë˜ë ¤ë©´ ê°ì²´ ë° ì¸ë±ìŠ¤ê°€ 있어야 합니다. + íŒŒì¼ %1ì„(를) 여는 ë™ì•ˆ 오류가 ë°œìƒí–ˆìŠµë‹ˆë‹¤. + + íŒŒì¼ %1ì— ì“°ëŠ” ë™ì•ˆ 오류가 ë°œìƒí–ˆìŠµë‹ˆë‹¤. + + + + 스í¬ë¦½íЏ 실행 ì‹œê°„ì´ ê¸°ë³¸ 제한 ì‹œê°„ì¸ 15초를 초과했습니다. + + + + 스í¬ë¦½íŠ¸ê°€ 30ì´ˆ 후ì—ë„ ë나지 않아 종료했습니다. + + + + 파ì¼ì˜ ë입니다. + + + 문ìžì—´ ì¸ë±ìФ %1ì´(ê°€) 범위를 벗어났습니다. %2와 %3 사ì´ì˜ ë²”ìœ„ì— ìžˆì–´ì•¼ 합니다. + + 유효하지 ì•Šì€ ë²”ìœ„ê°€ 지정ë˜ì—ˆìŠµë‹ˆë‹¤. + start parameter is greater than its end parameter. + ]]> + + ì¸ìˆ˜ %1ì€(는) nullì¼ ìˆ˜ 없습니다. + + ì¸ìˆ˜ %1ì— ì§€ì •ëœ ê°’ì´ ìœ íš¨í•˜ì§€ 않습니다. + public function doSomething(const:int):void { + } + this ["doSomething"] ("str") + generates an error at runtime because doSomething is cast as an int data type. ]]> + + + ë°ì´í„°ì˜ ì••ì¶•ì„ í‘¸ëŠ” ë™ì•ˆ 오류가 ë°œìƒí–ˆìŠµë‹ˆë‹¤. + + + 유형 ê°•ì œ ë³€í™˜ì— ì‹¤íŒ¨í–ˆìŠµë‹ˆë‹¤. %1ì„(를) %2(으)로 변환할 수 없습니다. + 콜백 ì¸ìˆ˜ê°€ í´ëž˜ìŠ¤ì˜ ë©”ì„œë“œì¸ ê²½ìš° ì„ íƒì  ì¸ìˆ˜ 'this'는 nullì´ì–´ì•¼ 합니다. +
    diff --git a/mozilla/js/tamarin/localization/lang/ko/build.xml b/mozilla/js/tamarin/localization/lang/ko/build.xml new file mode 100644 index 00000000000..b1cb18b72f6 --- /dev/null +++ b/mozilla/js/tamarin/localization/lang/ko/build.xml @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mozilla/js/tamarin/localization/lang/populate b/mozilla/js/tamarin/localization/lang/populate new file mode 100644 index 00000000000..97290a8e515 --- /dev/null +++ b/mozilla/js/tamarin/localization/lang/populate @@ -0,0 +1,48 @@ +#!/usr/bin/bash +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# The contents of this file are subject to the Mozilla Public License Version 1.1 (the +# "License"); you may not use this file except in compliance with the License. You may obtain +# a copy of the License at http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +# WARRANTY OF ANY KIND, either express or implied. See the License for the specific +# language governing rights and limitations under the License. +# +# The Original Code is [Open Source Virtual Machine.] +# +# The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +# by the Initial Developer are Copyright (C)[ #YEARS# ] Adobe Systems Incorporated. All Rights +# Reserved. +# +# Contributor(s): Adobe AS3 Team +# +# Alternatively, the contents of this file may be used under the terms of either the GNU +# General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +# License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +# LGPL are applicable instead of those above. If you wish to allow use of your version of this +# file only under the terms of either the GPL or the LGPL, and not to allow others to use your +# version of this file under the terms of the MPL, indicate your decision by deleting provisions +# above and replace them with the notice and other provisions required by the GPL or the +# LGPL. If you do not delete the provisions above, a recipient may use your version of this file +# under the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** */ +# +# Copy files from server to local directories +# +# For example ./populate http://flashplatform.macromedia.com/dev/projects/zaphod/Program%20Manager/localization/loc_kit1 +# +WHAT=ErrorConstants.xml +WAS=RuntimeErrorConstants.xml +if [ ${#1} -eq 0 ]; then + echo "usage: ./populate http://flashplatform.macromedia.com/dev/projects/zaphod/Program%20Manager/localization/loc_kit1 " + echo " copies the translated versions of $WHAT from the URL into the appropriate localization directories" + exit 1 +fi + +find . -type f -name $WHAT -exec rm {} \; +find . -type d -exec curl -G -s -S -o {}/$WHAT $1/{}/$WAS \; +[ ! -f "$WHAT" ] || rm $WHAT +find . -type f -name $WHAT -exec ls -la {} \; | awk "{ if (\$6 == 4040) printf \"Error: %s not on server, copied rubish\n\", \$10 }" diff --git a/mozilla/js/tamarin/localization/lang/zh_CN/ErrorConstants.xml b/mozilla/js/tamarin/localization/lang/zh_CN/ErrorConstants.xml new file mode 100644 index 00000000000..6fcbcf9b0e8 --- /dev/null +++ b/mozilla/js/tamarin/localization/lang/zh_CN/ErrorConstants.xml @@ -0,0 +1,736 @@ + + + + + 此表中包å«ç”±æ ¸å¿ƒ avmplus 生æˆçš„æ‰€æœ‰é”™è¯¯ä¿¡æ¯ã€‚å¯èƒ½ä¼šç”¨èµ„æºè¡¨æ›¿æ¢æ­¤è¡¨ï¼Œä»¥ä¾¿äºŽè¿›è¡Œæœ¬åœ°åŒ–。%o = ScriptObject* %t = Traits* %m = AbstractFunction* %n = Multiname (仅用于å称部分) %N = Multiname (仅用于命å空间部分) %a = Atom %d = int %f = double %S = Stringp %s = char* + + 系统内存ä¸è¶³ã€‚ + + + 未实现 %1 方法。 + + ç²¾åº¦å‚æ•°å¿…须介于 %2 到 %3 之间;%1 无效。 + + + + åŸºæ•°å‚æ•°å¿…须介于 2 到 36 之间;当å‰å€¼ä¸º %1。 + + + + 对ä¸å…¼å®¹çš„对象调用了方法 %1。 + + + + æ•°ç»„ç´¢å¼•ä¸æ˜¯æ­£æ•´æ•° (%1)。 + + + + %1 䏿˜¯å‡½æ•°ã€‚ + big instead + of blg): + +
    var blg:String = "foo";
    +var big:Sprite = new Sprite();
    +var error:int = big.length(); 
    + ]]>
    +
    + å°è¯•å®žä¾‹åŒ–çš„å‡½æ•°ä¸æ˜¯æž„造函数。 + %1 有歧义;找到多个匹é…的绑定。 + + 无法访问空对象引用的属性或方法。 + addChild() method of a DisplayObjectContainer object), then its stage + property is set to null. Thus, the example generates this error because Sprite object's stage property + cannot have any properties: + +
    import flash.display.Sprite;
    +var sprite1:Sprite = new Sprite();
    +var q:String = sprite1.stage.quality;
    + ]]>
    +
    + + 术语尚未定义,并且无任何属性。 + var obj:Object = new Object(); +obj.a = "foo"; +trace(obj.b.prop); + +

    You can also see this error because of a misspelling, for example in the following, where + mc represents a MovieClip object on the display list, and the stage + property is misspelled with a capital S (it should be stage):

    + +
    trace(mc.Stage.quality);
    + + + ]]>
    +
    + + 方法 %1 包å«éžæ³• opcode %2 (åç§»é‡ä¸º %3)。 + note at the bottom of this table. * + ]]> + + + 最åŽä¸€æ¡æŒ‡ä»¤è¶…出代ç å¤§å°ã€‚ + note at the bottom of this table. * + ]]> + + + 当 scopeDepth 为 0 时,无法调用 OP_findproperty。 + note at the bottom of this table. * + ]]> + + 无法找到类 %1。 + + 方法 %1 无法设置默认 XML 命å空间 + note at the bottom of this table. * + ]]> + + 类型 %1 䏿”¯æŒåŽä»£è¿ç®—符 (..)。 + + å‘生范围堆栈上溢。 + note at the bottom of this table. * + ]]> + + + å‘生范围堆栈下溢。 + note at the bottom of this table. * + ]]> + + + Getscopeobject %1 超出范围。 + note at the bottom of this table. * + ]]> + + + 代ç ä¸èƒ½è¶…出方法结尾。 + note at the bottom of this table. * + ]]> + + + è‡³å°‘ä¸€ä¸ªåˆ†æ”¯ç›®æ ‡ä¸æ˜¯æ–¹æ³•中的有效指令。 + note at the bottom of this table. * + ]]> + + + void 类型åªèƒ½ç”¨ä½œå‡½æ•°è¿”回类型。 + note at the bottom of this table. * + ]]> + + + å‘生堆栈上溢。 + note at the bottom of this table. * + ]]> + + + å‘生堆栈下溢。 + note at the bottom of this table. * + ]]> + + + 访问了无效的注册 %1。 + note at the bottom of this table. * + ]]> + + + Slot %1 超出 %3 中 slotCount=%2 çš„é™åˆ¶ã€‚ + note at the bottom of this table. * + ]]> + + + Method_info %1 超出 method_count=%2 çš„é™åˆ¶ã€‚ + note at the bottom of this table. * + ]]> + + + Disp_id %1 超出 %3 中 max_disp_id=%2 çš„é™åˆ¶ã€‚ + note at the bottom of this table. * + ]]> + + + Disp_id %1 在 %2 上未定义。 + note at the bottom of this table. * + ]]> + + + 堆栈深度ä¸å¯¹ç§°ã€‚%1 != %2。 + note at the bottom of this table. * + ]]> + + + 范围深度ä¸å¯¹ç§°ã€‚%1 != %2。 + note at the bottom of this table. * + ]]> + + + Cpool 索引 %1 超出范围 %2。 + note at the bottom of this table. * + ]]> + + Cpool 项 %1 类型错误。 + 强制转æ¢ç±»åž‹å¤±è´¥:无法将 %1 转æ¢ä¸º %2。 + + å‘现方法 %1 ä¸­å­˜åœ¨éžæ³•çš„ super 表达å¼ã€‚ + note at the bottom of this table. * + ]]> + + + 无法在 %2 上为方法 %1 赋值。 + note at the bottom of this table. * + ]]> + + + %1 已定义。 + for loops + in the same function definition) are considered to be in the same scope. + See the note at the bottom of this table. * + ]]> + + + åœ¨æ–¹æ³•è¢«å¼•ç”¨ä¹‹å‰æ— æ³•对其进行验è¯ã€‚ + note at the bottom of this table. * + ]]> + + + instanceof çš„å³ä¾§å¿…须是类或函数。 + instanceof operator must be a class or function. + ]]> + + + è¿ç®—符的å³ä¾§å¿…须是类。 + instanceof operator must be a class. + ]]> + + + 䏿˜¯ ABC 文件。major_version=%1 minor_version=%2。 + + + + code_length=%1 无效。 + note at the bottom of this table. * + ]]> + + + MethodInfo-%1 䏿”¯æŒ flags=%2。 + note at the bottom of this table. * + ]]> + + + 䏿”¯æŒ trait kind=%1。 + note at the bottom of this table. * + ]]> + + + MethodInfo-%1 被引用时未定义。 + note at the bottom of this table. * + ]]> + + + 未找到入å£ç‚¹ã€‚ + note at the bottom of this table. * + ]]> + + + 原型对象必须是 vanilla 对象。 + note at the bottom of this table. * + ]]> + + + 无法将 %1 转æ¢ä¸ºåŽŸå§‹ç±»åž‹ã€‚ + note at the bottom of this table. * + ]]> + + + 对 %1 çš„æ—©æœŸç»‘å®šè®¿é—®æ˜¯éžæ³•的。 + note at the bottom of this table. * + ]]> + + + 传递给 %1 函数的 URI 无效。 + note at the bottom of this table. * + ]]> + + + 在 %2 ä¸­éžæ³•覆盖 %1。 + note at the bottom of this table. * + ]]> + + + 异常处ç†å‡½æ•°ä¸­å­˜åœ¨éžæ³•的范围或目标åç§»é‡ã€‚ + note at the bottom of this table. * + ]]> + + + 无法为 %2 创建属性 %1。 + + + + %1 åªèƒ½åŒ…嫿–¹æ³•。 + note at the bottom of this table. * + ]]> + + + éžæ³•çš„æ“作数类型: %1 必须是 %2。 + note at the bottom of this table. * + ]]> + + + ClassInfo-%1 被引用时未定义。 + note at the bottom of this table. * + ]]> + + + ClassInfo %1 超出 class_count=%2 çš„é™åˆ¶ã€‚ + note at the bottom of this table. * + ]]> + + + æ— æ³•åœ¨ä¸æŸå¤±ç²¾åº¦çš„æƒ…况下将值 %1 转æ¢ä¸º %2。 + int. + +

    This error also appears for out-of-range assignments, such as the following:

    + +
    var m0:int = 2147483648; // int.MAX_VALUE == 2147483647
    +

    You can also see this error when using the bitwise left shift operator (<<). + For example, consider the following code:

    + +
    var m0:uint = 0xFF;
    +var m1:uint = m0<<24;
    + +

    The result of left shift operator (<<) is interpreted as a 32-bit two's complement number + with sign. In the example, the result is a negative value, which causes the error when assigned + to the uint typed property. A workaround is the following:

    + +
    var m0:uint = 0xFF;
    +var m1:uint = uint(m0<<24);
    + + ]]>
    +
    + %1 çš„å‚æ•°æ•°é‡ä¸åŒ¹é…。应该有 %2 个,当å‰ä¸º %3 个。 + + 无法将方法 %1 作为构造函数调用。 + f() in Class A: +
    class A {
    +	   function f() {}
    +	}
    + In the following code, extracting the function causes no error. However, creating + a new instance of the function causes an error. +
    var a = new A()
    +	var m = a.f // extract f, don't call it
    +	m() // same as a.f()
    +	new m() // causes this error
    + + ]]>
    +
    + + å˜é‡ %1 未定义。 + print(x) generates an error because x is undefined. However, the + statement print(y) doesn't generate an error because y is defined: +
    print("hello world")
    +	print(x) // x is undefined
    +	var y
    +	print(y) // No error, y is defined.
    + ]]>
    +
    + + 䏿”¯æŒ function('function body') å½¢å¼ã€‚ + eval() and + function(). Thus, calling these as a constructor in ActionScript 3.0 generates this error. + ]]> + + + 内置方法 %1 嫿œ‰éžæ³•的方法正文。 + note at the bottom of this table. * + ]]> + + + %1 å’Œ %2 无法å调一致。 + note at the bottom of this table. * + ]]> + + + 在 %2 上找ä¸åˆ°å±žæ€§ %1,且没有默认值。 + x, which is not defined and cannot be created dynamically: +
    class A {} // sealed class, not dynamic
    +	print(new A().x) // no property x defined on A, and A is not dynamic
    + ]]>
    +
    + + 在 %2 上找ä¸åˆ°æ–¹æ³• %1 + super statement to call a function, but the function doesn't exist in the super class. + For example, the following code generates the error:
    class A() {}
    +class B extends A {
    +  function f() { print(super.f()); } // error 1070, there is no f on A
    +}
    + ]]>
    +
    + 函数 %1 已被绑定到 %2。 + + Disp_id 0 æ˜¯éžæ³•的。 + note at the bottom of this table. * + ]]> + + + 由于 disp_id %2 çš„é‡å¤ï¼Œéžè¦†ç›–方法 %1 已被替æ¢ã€‚ + note at the bottom of this table. * + ]]> + + %2 上存在对åªè¯»å±žæ€§ %1 çš„éžæ³•写入。 + + Math 䏿˜¯å‡½æ•°ã€‚ + math() as a function, but math is a class with static methods. + ]]> + + + Math 䏿˜¯æž„造函数。 + + + %2 上存在对åªå†™å±žæ€§ %1 çš„éžæ³•读å–。 + + éžæ³•çš„ opcode/multiname 组åˆ: %1<%2>。 + note at the bottom of this table. * + ]]> + + + 载入代ç ä¸­ä¸å…许使用内置方法。 + note at the bottom of this table. * + ]]> + + + éžæ³•的命å空间值。 + note at the bottom of this table. * + ]]> + + 在 %2 上找ä¸åˆ°å±žæ€§ %1,且没有默认值。 + + 未设置默认的命å空间。 + note at the bottom of this table. * + ]]> + + + 元素“%2â€çš„å‰ç¼€â€œ%1â€æœªç»‘定。 + foo + namespace to match foo:x:
    <foo:x xmlns:clowns='http://circuscenter.com'>
    + ]]>
    +
    + + 元素或属性 (“%1â€) 与 QName 定义ä¸åŒ¹é…: QName::=(NCName':')?NCName。 + foo: or :foo as an element or attribute name, but there is nothing + on the other side of the colon. + ]]> + + 元素类型“%1â€å¿…须以匹é…çš„ç»“æŸæ ‡è®°â€œ</%2>â€ç»“æŸã€‚ + + %1 方法åªèƒ½ç”¨äºŽåŒ…å«å•一项目的列表。 + addNamespace, appendChild, childIndex, + inScopeNamespaces, insertChildAfter, insertChildBefore, + name, namespace, localName, namespaceDeclarations, + nodeKind, prependChild, removeNamespace, replace, + setChildren, setLocalName, setName, and setNamespace. + + ]]> + + ä¸å…许对索引 XML 进行赋值。 + + 文档中根元素åŽé¢çš„æ ‡è®°æ ¼å¼å¿…须正确。 + +
  • Parsing an XMLList style object such as as XML
  • +
  • Misbalanced strings such as
  • + + ]]>
    +
    + 䏿”¯æŒå¯¹åŒ…å«å¤šä¸ªé¡¹ç›®çš„列表进行赋值。 + + XML 分æžå™¨å¤±è´¥: 元素格å¼ä¸æ­£ç¡®ã€‚ + >
    is missing: + +
    <a/><b></b
    ]]> + + XML 分æžå™¨å¤±è´¥: CDATA 部分未结æŸã€‚ + XML 分æžå™¨å¤±è´¥: XML 声明未结æŸã€‚ + XML 分æžå™¨å¤±è´¥: DOCTYPE 声明未结æŸã€‚ + XML 分æžå™¨å¤±è´¥: 注释未结æŸã€‚ + XML 分æžå™¨å¤±è´¥: 属性未结æŸã€‚ + XML 分æžå™¨å¤±è´¥: 元素未结æŸã€‚ + XML 分æžå™¨å¤±è´¥: 正在处ç†çš„æŒ‡ä»¤æœªç»“æŸã€‚ + + no namespace å¸¦æœ‰éžæ³•å‰ç¼€ %1。 + ns = new Namespace ("prefix", ""); + ]]> + + + 在由一个 RegExp 构建å¦ä¸€ä¸ªçš„过程中无法æä¾›æ ‡å¿—。 + new operator and set the flags as desired. For example, this statement + creates a regular expression and specifies flag settings: + var re:RegExp = new RegExp("ali", /s) + Alternatively, this statement creates a regular expression that has the same flags as re: +
    var re2:RegExp = new RegExp(re, ...)
    ]]>
    +
    + + 无法验è¯å…·æœ‰æœªçŸ¥èŒƒå›´çš„æ–¹æ³• %1。 + note at the bottom of this table. * + ]]> + + + 类型 %1 çš„é»˜è®¤å€¼éžæ³•。 + note at the bottom of this table. * + ]]> + + + ç±» %1 ä¸èƒ½æ‰©å±•最终基类。 + note at the bottom of this table. * + ]]> + + 已指定属性“%1â€(针对元素“%2â€)。 + + ABC æ•°æ®å·²æŸå,å°è¯•çš„è¯»å–æ“作超出范围。 + note at the bottom of this table. * + ]]> + + + OP_newclass opcode ä½¿ç”¨çš„åŸºç±»ä¸æ­£ç¡®ã€‚ + note at the bottom of this table. * + ]]> + + + å°è¯•直接调用éžç»‘定函数 %1 (从方法 %2 中调用)。 + note at the bottom of this table. * + ]]> + + + %1 无法扩展 %2。 + note at the bottom of this table. * + ]]> + + + %1 无法实现 %2。 + note at the bottom of this table. * + ]]> + + 类强制转æ¢çš„傿•°æ•°é‡ä¸åŒ¹é…。应为 1 个,当å‰ä¸º %1 个。 + + 方法中使用的 OP_newactivation 没有 NEED_ACTIVATION 标志。 + note at the bottom of this table. * + ]]> + + + 使用的 OP_getglobalslot 或 OP_setglobalslot ä¸å…·æœ‰å…¨å±€èŒƒå›´ã€‚ + note at the bottom of this table. * + ]]> + + %1 䏿˜¯æž„造函数。 + Function.prototype.apply çš„ç¬¬äºŒä¸ªå‚æ•°å¿…须是数组。 + XML å称无效: %1。 + èŠ‚ç‚¹é—´å­˜åœ¨éžæ³•循环。 + 类型 %1 çš„æ“ä½œæ•°ä¸æ”¯æŒåˆ é™¤è¿ç®—符。 + 无法为 %2 删除属性 %1。 + 方法 %1 具有é‡å¤çš„æ–¹æ³•正文。 + æŽ¥å£æ–¹æ³• %1 嫿œ‰éžæ³•的方法正文。 + 类型 %1 䏿”¯æŒè¿‡æ»¤è¿ç®—符。 + OP_hasnext2 è¦æ±‚对象和索引ä½äºŽä¸åŒçš„寄存器。 + 打开文件 %1 时出错。 + + 写入文件 %1 时出错。 + + + + 脚本的执行时间已ç»è¶…过了 15 秒的默认超时设置。 + + + + 脚本未能在 30 ç§’åŽé€€å‡ºè€Œè¢«ç»ˆæ­¢ã€‚ + + + + 文件结尾。 + + + 字符串索引 %1 超出范围;必须在 %2 到 %3 的范围内。 + + 指定的范围无效。 + start parameter is greater than its end parameter. + ]]> + + 傿•° %1 ä¸èƒ½ä¸ºç©ºã€‚ + + ä¸ºå‚æ•° %1 指定的值无效。 + public function doSomething(const:int):void { + } + this ["doSomething"] ("str") + generates an error at runtime because doSomething is cast as an int data type. ]]> + + + è§£åŽ‹ç¼©æ•°æ®æ—¶å‡ºé”™ã€‚ + + + 强制转æ¢ç±»åž‹å¤±è´¥:无法将 %1 转æ¢ä¸º %2。 + å¦‚æžœå›žè°ƒå‚æ•°æ˜¯æŸä¸ªç±»çš„æ–¹æ³•,则å¯é€‰å‚数“thisâ€å¿…须为空。 +
    diff --git a/mozilla/js/tamarin/localization/lang/zh_CN/build.xml b/mozilla/js/tamarin/localization/lang/zh_CN/build.xml new file mode 100644 index 00000000000..b1cb18b72f6 --- /dev/null +++ b/mozilla/js/tamarin/localization/lang/zh_CN/build.xml @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mozilla/js/tamarin/localization/lang/zh_TW/ErrorConstants.xml b/mozilla/js/tamarin/localization/lang/zh_TW/ErrorConstants.xml new file mode 100644 index 00000000000..3d74a63df6b --- /dev/null +++ b/mozilla/js/tamarin/localization/lang/zh_TW/ErrorConstants.xml @@ -0,0 +1,736 @@ + + + + + é€™å€‹è¡¨æ ¼åŒ…å«æ‰€æœ‰ core avmplus 產生的錯誤訊æ¯ã€‚這很å¯èƒ½æœƒç”±è³‡æºæ¸…單代替,以方便中文化。%o = ScriptObject* %t = Traits* %m = AbstractFunction* %n = Multiname (name portion only) %N = Multiname (namespace portion only) %a = Atom %d = int %f = double %S = Stringp %s = char* + + 系統記憶體ä¸è¶³ã€‚ + + + 未實作方法 %1。 + + 精確度引數必須介於 %2 å’Œ %3 之間;%1 無效。 + + + + 基數引數必須介於 2 å’Œ 36 之間;目å‰å¼•數為 %1。 + + + + 在ä¸ç›¸å®¹çš„物件上呼å«äº† %1 方法。 + + + + é™£åˆ—ç´¢å¼•ä¸æ˜¯æ­£æ•´æ•¸ (%1)。 + + + + %1 䏿˜¯å‡½æ•¸ã€‚ + big instead + of blg): + +
    var blg:String = "foo";
    +var big:Sprite = new Sprite();
    +var error:int = big.length(); 
    + ]]>
    +
    + 嘗試個體化éžå»ºæ§‹å‡½å¼ã€‚ + %1 å‡ºç¾æ¨¡ç¨œå…©å¯çš„æƒ…æ³ï¼›æ‰¾åˆ°ä¸€å€‹ä»¥ä¸Šçš„相符繫çµã€‚ + + ç„¡æ³•å­˜å– Null 物件åƒè€ƒçš„屬性或方法。 + addChild() method of a DisplayObjectContainer object), then its stage + property is set to null. Thus, the example generates this error because Sprite object's stage property + cannot have any properties: + +
    import flash.display.Sprite;
    +var sprite1:Sprite = new Sprite();
    +var q:String = sprite1.stage.quality;
    + ]]>
    +
    + + 詞彙未定義且沒有屬性。 + var obj:Object = new Object(); +obj.a = "foo"; +trace(obj.b.prop); + +

    You can also see this error because of a misspelling, for example in the following, where + mc represents a MovieClip object on the display list, and the stage + property is misspelled with a capital S (it should be stage):

    + +
    trace(mc.Stage.quality);
    + + + ]]>
    +
    + + 方法 %1 包å«ä¸åˆæ³•çš„ Opcode %2 (在ä½ç§» %3)。 + note at the bottom of this table. * + ]]> + + + 最後的指令超éŽç¨‹å¼ç¢¼å¤§å°ã€‚ + note at the bottom of this table. * + ]]> + + + ç•¶ scopeDepth 是 0 æ™‚ï¼Œç„¡æ³•å‘¼å« OP_findproperty。 + note at the bottom of this table. * + ]]> + + 找ä¸åˆ°é¡žåˆ¥ %1。 + + 方法 %1 無法設定é è¨­çš„ xml å稱空間 + note at the bottom of this table. * + ]]> + + 類型 %1 䏿”¯æ´å­ç³»é‹ç®—å­ (..)。 + + 發生範åœå †ç–Šæº¢ä½ã€‚ + note at the bottom of this table. * + ]]> + + + 發生範åœå †ç–Šå呿º¢ä½ã€‚ + note at the bottom of this table. * + ]]> + + + Getscopeobject %1 超出範åœã€‚ + note at the bottom of this table. * + ]]> + + + 程å¼ç¢¼ä¸èƒ½åœ¨æ–¹æ³•çš„çµå°¾ä¹‹å¤–。 + note at the bottom of this table. * + ]]> + + + 至少有一個分支目標ä¸åœ¨æ–¹æ³•中的有效指令上。 + note at the bottom of this table. * + ]]> + + + 類型 void åªèƒ½ç”¨ä¾†åšç‚ºå‡½æ•¸å‚³å›žé¡žåž‹ã€‚ + note at the bottom of this table. * + ]]> + + + 發生堆疊溢ä½ã€‚ + note at the bottom of this table. * + ]]> + + + 發生堆疊å呿º¢ä½ã€‚ + note at the bottom of this table. * + ]]> + + + å­˜å–無效的註冊項目 %1。 + note at the bottom of this table. * + ]]> + + + ä½ç½® %1 è¶…éŽ %3 çš„ slotCount= %2。 + note at the bottom of this table. * + ]]> + + + Method_info %1 è¶…éŽ method_count=%2。 + note at the bottom of this table. * + ]]> + + + Disp_id %1 è¶…éŽ %3 çš„ max_disp_id=%2。 + note at the bottom of this table. * + ]]> + + + Disp_id %1 沒有定義於 %2。 + note at the bottom of this table. * + ]]> + + + 堆疊深度ä¸å°ç¨±ã€‚%1 != %2。 + note at the bottom of this table. * + ]]> + + + ç¯„åœæ·±åº¦ä¸å°ç¨±ã€‚%1 != %2。 + note at the bottom of this table. * + ]]> + + + Cpool 索引 %1 è¶…å‡ºç¯„åœ %2。 + note at the bottom of this table. * + ]]> + + Cpool é …ç›® %1 類型錯誤。 + 強制轉型失敗: 無法將 %1 è½‰æ›æˆ %2。 + + 方法 %1 中有ä¸åˆæ³•çš„ super 陳述å¼ã€‚ + note at the bottom of this table. * + ]]> + + + 無法指定給 %2 上的方法 %1。 + note at the bottom of this table. * + ]]> + + + %1 已定義。 + for loops + in the same function definition) are considered to be in the same scope. + See the note at the bottom of this table. * + ]]> + + + 方法被åƒè€ƒå¾Œæ‰èƒ½é€²è¡Œé©—證。 + note at the bottom of this table. * + ]]> + + + instanceof çš„å³é‚Šå¿…須是類別或函å¼ã€‚ + instanceof operator must be a class or function. + ]]> + + + é‹ç®—å­çš„å³é‚Šå¿…須是類別。 + instanceof operator must be a class. + ]]> + + + 䏿˜¯ ABC 檔案。major_version=%1 minor_version=%2。 + + + + 無效的 code_length=%1。 + note at the bottom of this table. * + ]]> + + + MethodInfo-%1 䏿”¯æ´çš„æ——標=%2。 + note at the bottom of this table. * + ]]> + + + 䏿”¯æ´çš„ traits 類型=%1。 + note at the bottom of this table. * + ]]> + + + MethodInfo-%1 在定義之å‰è¢«åƒè€ƒã€‚ + note at the bottom of this table. * + ]]> + + + 找ä¸åˆ°é€²å…¥é»žã€‚ + note at the bottom of this table. * + ]]> + + + 原型物件必須是 Vanilla 物件。 + note at the bottom of this table. * + ]]> + + + 無法將 %1 è½‰æ›æˆåŸºæœ¬é¡žåž‹ã€‚ + note at the bottom of this table. * + ]]> + + + ä¸åˆæ³•的早期繫çµå­˜å– %1。 + note at the bottom of this table. * + ]]> + + + 傳éžçµ¦ %1 函數的 URI 無效。 + note at the bottom of this table. * + ]]> + + + ä¸åˆæ³•覆寫 %2 中的 %1。 + note at the bottom of this table. * + ]]> + + + 例外處ç†å¸¸å¼ä¸­å‡ºç¾ä¸åˆæ³•çš„ç¯„åœæˆ–目標ä½ç§»ã€‚ + note at the bottom of this table. * + ]]> + + + 無法在 %2 上建立屬性 %1。 + + + + %1 åªèƒ½åŒ…嫿–¹æ³•。 + note at the bottom of this table. * + ]]> + + + é‹ç®—元類型ä¸åˆæ³•:%1 必須是 %2。 + note at the bottom of this table. * + ]]> + + + ClassInfo-%1 在定義之å‰è¢«åƒè€ƒã€‚ + note at the bottom of this table. * + ]]> + + + ClassInfo %1 è¶…éŽ class_count=%2。 + note at the bottom of this table. * + ]]> + + + 值 %1 åœ¨è½‰æ›æˆ %2 後會有誤差。 + int. + +

    This error also appears for out-of-range assignments, such as the following:

    + +
    var m0:int = 2147483648; // int.MAX_VALUE == 2147483647
    +

    You can also see this error when using the bitwise left shift operator (<<). + For example, consider the following code:

    + +
    var m0:uint = 0xFF;
    +var m1:uint = m0<<24;
    + +

    The result of left shift operator (<<) is interpreted as a 32-bit two's complement number + with sign. In the example, the result is a negative value, which causes the error when assigned + to the uint typed property. A workaround is the following:

    + +
    var m0:uint = 0xFF;
    +var m1:uint = uint(m0<<24);
    + + ]]>
    +
    + %1 上的引數個數ä¸ç›¸ç¬¦ã€‚éœ€è¦ %2 個,目å‰ç‚º %3 個。 + + 無法將方法 %1 當作建構函å¼å‘¼å«ã€‚ + f() in Class A: +
    class A {
    +	   function f() {}
    +	}
    + In the following code, extracting the function causes no error. However, creating + a new instance of the function causes an error. +
    var a = new A()
    +	var m = a.f // extract f, don't call it
    +	m() // same as a.f()
    +	new m() // causes this error
    + + ]]>
    +
    + + 變數 %1 未定義。 + print(x) generates an error because x is undefined. However, the + statement print(y) doesn't generate an error because y is defined: +
    print("hello world")
    +	print(x) // x is undefined
    +	var y
    +	print(y) // No error, y is defined.
    + ]]>
    +
    + + 䏿”¯æ´è¡¨å–® function('function body')。 + eval() and + function(). Thus, calling these as a constructor in ActionScript 3.0 generates this error. + ]]> + + + 原生方法 %1 包å«ä¸åˆæ³•的方法主體。 + note at the bottom of this table. * + ]]> + + + %1 å’Œ %2 無法調解。 + note at the bottom of this table. * + ]]> + + + %2 上找ä¸åˆ°å±¬æ€§ %1,而且沒有é è¨­å€¼ã€‚ + x, which is not defined and cannot be created dynamically: +
    class A {} // sealed class, not dynamic
    +	print(new A().x) // no property x defined on A, and A is not dynamic
    + ]]>
    +
    + + %2 上找ä¸åˆ°æ–¹æ³• %1 + super statement to call a function, but the function doesn't exist in the super class. + For example, the following code generates the error:
    class A() {}
    +class B extends A {
    +  function f() { print(super.f()); } // error 1070, there is no f on A
    +}
    + ]]>
    +
    + 函數 %1 已繫çµè‡³ %2。 + + Disp_id 0 ä¸åˆæ³•。 + note at the bottom of this table. * + ]]> + + + 由於 disp_id %2 é‡è¤‡ï¼Œéž Override 方法 %1 已被代æ›ã€‚ + note at the bottom of this table. * + ]]> + + ä¸åˆæ³•的寫入 %2 上的唯讀屬性 %1。 + + Math 䏿˜¯å‡½æ•¸ã€‚ + math() as a function, but math is a class with static methods. + ]]> + + + Math 䏿˜¯å»ºæ§‹å‡½å¼ã€‚ + + + ä¸åˆæ³•çš„è®€å– %2 上的唯寫屬性 %1。 + + ä¸åˆæ³•çš„ Opcode/Multiname 組åˆï¼š%1<%2>。 + note at the bottom of this table. * + ]]> + + + 載入的程å¼ç¢¼ä¸­ä¸å…許使用原生方法。 + note at the bottom of this table. * + ]]> + + + ä¸åˆæ³•çš„å稱空間值。 + note at the bottom of this table. * + ]]> + + %2 上找ä¸åˆ°å±¬æ€§ %1,且沒有é è¨­å€¼ã€‚ + + 未設定é è¨­çš„å稱空間。 + note at the bottom of this table. * + ]]> + + + 未繫çµå…ƒç´  "%2" çš„å‰ç½®è©ž "%1"。 + foo + namespace to match foo:x:
    <foo:x xmlns:clowns='http://circuscenter.com'>
    + ]]>
    +
    + + 元素或屬性 ("%1") 與 QName Production ä¸ç›¸ç¬¦ï¼šQName::=(NCName':')?NCName。 + foo: or :foo as an element or attribute name, but there is nothing + on the other side of the colon. + ]]> + + 元素類型 '%1' å¿…é ˆä»¥ç›¸ç¬¦çš„çµæŸæ¨™ç±¤ '</%2>' çµæŸã€‚ + + %1 æ–¹æ³•åªæœ‰åœ¨åŒ…å«ä¸€å€‹é …ç›®çš„æ¸…å–®ä¸Šæ‰æœ‰ä½œç”¨ã€‚ + addNamespace, appendChild, childIndex, + inScopeNamespaces, insertChildAfter, insertChildBefore, + name, namespace, localName, namespaceDeclarations, + nodeKind, prependChild, removeNamespace, replace, + setChildren, setLocalName, setName, and setNamespace. + + ]]> + + ä¸å…許索引 XML 的指定。 + + 文件中根元素之後的標記必須使用正確格å¼ã€‚ + +
  • Parsing an XMLList style object such as as XML
  • +
  • Misbalanced strings such as
  • + + ]]>
    +
    + 無法指定給包å«å¤šå€‹é …目的清單。 + + XML 剖æžå™¨å¤±æ•—:元素格å¼éŒ¯èª¤ã€‚ + >
    is missing: + +
    <a/><b></b
    ]]> + + XML 剖æžå™¨å¤±æ•—ï¼šæœªçµæŸçš„ CDATA 倿®µã€‚ + XML 剖æžå™¨å¤±æ•—ï¼šæœªçµæŸçš„ XML 宣告。 + XML 剖æžå™¨å¤±æ•—ï¼šæœªçµæŸçš„ DOCTYPE 宣告。 + XML 剖æžå™¨å¤±æ•—ï¼šæœªçµæŸçš„註解。 + XML 剖æžå™¨å¤±æ•—ï¼šæœªçµæŸçš„屬性。 + XML 剖æžå™¨å¤±æ•—ï¼šæœªçµæŸçš„元素。 + XML 剖æžå™¨å¤±æ•—ï¼šæœªçµæŸçš„è™•ç†æŒ‡ä»¤ã€‚ + + no namespace çš„å‰ç½®è©ž %1 ä¸åˆæ³•。 + ns = new Namespace ("prefix", ""); + ]]> + + + 從å¦ä¸€å€‹ RegExp 建構 RegExp 時無法æä¾›æ——標。 + new operator and set the flags as desired. For example, this statement + creates a regular expression and specifies flag settings: + var re:RegExp = new RegExp("ali", /s) + Alternatively, this statement creates a regular expression that has the same flags as re: +
    var re2:RegExp = new RegExp(re, ...)
    ]]>
    +
    + + ç„¡æ³•ä»¥æœªçŸ¥çš„ç¯„åœæª¢æŸ¥æ–¹æ³• %1。 + note at the bottom of this table. * + ]]> + + + 類型 %1 çš„é è¨­å€¼ä¸åˆæ³•。 + note at the bottom of this table. * + ]]> + + + 類別 %1 無法擴充最後的基底類別。 + note at the bottom of this table. * + ]]> + + 屬性 "%1" 已經指定給元素 "%2"。 + + ABC è³‡æ–™å·²ç¶“ææ¯€ï¼Œå˜—試讀å–超出範åœã€‚ + note at the bottom of this table. * + ]]> + + + OP_newclass Opcode ä½¿ç”¨æ–¼ä¸æ­£ç¢ºçš„基底類別。 + note at the bottom of this table. * + ]]> + + + 嘗試直接從方法 %1 呼嫿œªç¹«çµçš„å‡½å¼ %2。 + note at the bottom of this table. * + ]]> + + + %1 無法擴充 %2。 + note at the bottom of this table. * + ]]> + + + %1 無法實作 %2。 + note at the bottom of this table. * + ]]> + + 強制類別上的引數個數ä¸ç›¸ç¬¦ã€‚éœ€è¦ 1 個,目å‰ç‚º %1 個。 + + 方法中使用 OP_newactivation,未æ­é… NEED_ACTIVATION 指標。 + note at the bottom of this table. * + ]]> + + + 在éžå…¨åŸŸç¯„åœä¸‹ä½¿ç”¨ OP_getglobalslot 或 OP_setglobalslot。 + note at the bottom of this table. * + ]]> + + %1 䏿˜¯å»ºæ§‹å‡½å¼ã€‚ + Function.prototype.apply 的第二個引數必須是陣列。 + 無效的 XML å稱:%1。 + 節點之間的循環迴圈ä¸åˆæ³•。 + 類型 %1 çš„é‹ç®—å…ƒä¸æ”¯æ´åˆªé™¤é‹ç®—å­ã€‚ + 無法刪除 %2 上的屬性 %1。 + 方法 %1 包å«é‡è¤‡çš„æ–¹æ³•主體。 + Interface 方法 %1 包å«ä¸åˆæ³•的方法主體。 + 類型 %1 䏿”¯æ´ç¯©é¸é‹ç®—å­ã€‚ + OP_hasnext2 è¦æ±‚物件åŠç´¢å¼•為å¯è¾¨è­˜çš„登錄。 + 開啟檔案 %1 時發生錯誤。 + + 寫入檔案 %1 時發生錯誤。 + + + + script 已經執行超éŽé è¨­çš„ 15 秒逾時時段。 + + + + Script 並未在 30 ç§’å¾ŒçµæŸï¼Œå·²ç¶“被終止。 + + + + 檔案çµå°¾ã€‚ + + + 字串索引 %1 超出範åœï¼›ç¯„åœå¿…須介於 %2 到 %3。 + + 指定的範åœç„¡æ•ˆã€‚ + start parameter is greater than its end parameter. + ]]> + + 引數 %1 ä¸èƒ½æ˜¯ null。 + + 指定給引數 %1 的值無效。 + public function doSomething(const:int):void { + } + this ["doSomething"] ("str") + generates an error at runtime because doSomething is cast as an int data type. ]]> + + + 解壓縮資料時發生錯誤。 + + + 強制轉型失敗: 無法將 %1 è½‰æ›æˆ %2。 + 若回呼引數是 Class çš„æ–¹æ³•ï¼Œé¸æ“‡æ€§çš„引數 'this' 必須是 null。 +
    diff --git a/mozilla/js/tamarin/localization/lang/zh_TW/build.xml b/mozilla/js/tamarin/localization/lang/zh_TW/build.xml new file mode 100644 index 00000000000..b1cb18b72f6 --- /dev/null +++ b/mozilla/js/tamarin/localization/lang/zh_TW/build.xml @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mozilla/js/tamarin/pcre/AUTHORS b/mozilla/js/tamarin/pcre/AUTHORS new file mode 100644 index 00000000000..33df90f8df3 --- /dev/null +++ b/mozilla/js/tamarin/pcre/AUTHORS @@ -0,0 +1,23 @@ +THE MAIN PCRE LIBRARY +--------------------- + +Written by: Philip Hazel +Email local part: ph10 +Email domain: cam.ac.uk + +University of Cambridge Computing Service, +Cambridge, England. Phone: +44 1223 334714. + +Copyright (c) 1997-2005 University of Cambridge +All rights reserved + + +THE C++ WRAPPER LIBRARY +----------------------- + +Written by: Google Inc. + +Copyright (c) 2005 Google Inc +All rights reserved + +#### diff --git a/mozilla/js/tamarin/pcre/COPYING b/mozilla/js/tamarin/pcre/COPYING new file mode 100644 index 00000000000..e8eb0d93703 --- /dev/null +++ b/mozilla/js/tamarin/pcre/COPYING @@ -0,0 +1,68 @@ +PCRE LICENCE +------------ + +PCRE is a library of functions to support regular expressions whose syntax +and semantics are as close as possible to those of the Perl 5 language. + +Release 6 of PCRE is distributed under the terms of the "BSD" licence, as +specified below. The documentation for PCRE, supplied in the "doc" +directory, is distributed under the same terms as the software itself. + +The basic library functions are written in C and are freestanding. Also +included in the distribution is a set of C++ wrapper functions. + + +THE BASIC LIBRARY FUNCTIONS +--------------------------- + +Written by: Philip Hazel +Email local part: ph10 +Email domain: cam.ac.uk + +University of Cambridge Computing Service, +Cambridge, England. Phone: +44 1223 334714. + +Copyright (c) 1997-2005 University of Cambridge +All rights reserved. + + +THE C++ WRAPPER FUNCTIONS +------------------------- + +Contributed by: Google Inc. + +Copyright (c) 2005, Google Inc. +All rights reserved. + + +THE "BSD" LICENCE +----------------- + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + * Neither the name of the University of Cambridge nor the name of Google + Inc. nor the names of their contributors may be used to endorse or + promote products derived from this software without specific prior + written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + +End diff --git a/mozilla/js/tamarin/pcre/ChangeLog b/mozilla/js/tamarin/pcre/ChangeLog new file mode 100644 index 00000000000..a04153ae5c8 --- /dev/null +++ b/mozilla/js/tamarin/pcre/ChangeLog @@ -0,0 +1,1881 @@ +ChangeLog for PCRE +------------------ + +Version 6.4 05-Sep-05 +--------------------- + + 1. Change 6.0/10/(l) to pcregrep introduced a bug that caused separator lines + "--" to be printed when multiple files were scanned, even when none of the + -A, -B, or -C options were used. This is not compatible with Gnu grep, so I + consider it to be a bug, and have restored the previous behaviour. + + 2. A couple of code tidies to get rid of compiler warnings. + + 3. The pcretest program used to cheat by referring to symbols in the library + whose names begin with _pcre_. These are internal symbols that are not + really supposed to be visible externally, and in some environments it is + possible to suppress them. The cheating is now confined to including + certain files from the library's source, which is a bit cleaner. + + 4. Renamed pcre.in as pcre.h.in to go with pcrecpp.h.in; it also makes the + file's purpose clearer. + + 5. Reorganized pcre_ucp_findchar(). + + +Version 6.3 15-Aug-05 +--------------------- + + 1. The file libpcre.pc.in did not have general read permission in the tarball. + + 2. There were some problems when building without C++ support: + + (a) If C++ support was not built, "make install" and "make test" still + tried to test it. + + (b) There were problems when the value of CXX was explicitly set. Some + changes have been made to try to fix these, and ... + + (c) --disable-cpp can now be used to explicitly disable C++ support. + + (d) The use of @CPP_OBJ@ directly caused a blank line preceded by a + backslash in a target when C++ was disabled. This confuses some + versions of "make", apparently. Using an intermediate variable solves + this. (Same for CPP_LOBJ.) + + 3. $(LINK_FOR_BUILD) now includes $(CFLAGS_FOR_BUILD) and $(LINK) + (non-Windows) now includes $(CFLAGS) because these flags are sometimes + necessary on certain architectures. + + 4. Added a setting of -export-symbols-regex to the link command to remove + those symbols that are exported in the C sense, but actually are local + within the library, and not documented. Their names all begin with + "_pcre_". This is not a perfect job, because (a) we have to except some + symbols that pcretest ("illegally") uses, and (b) the facility isn't always + available (and never for static libraries). I have made a note to try to + find a way round (a) in the future. + + +Version 6.2 01-Aug-05 +--------------------- + + 1. There was no test for integer overflow of quantifier values. A construction + such as {1111111111111111} would give undefined results. What is worse, if + a minimum quantifier for a parenthesized subpattern overflowed and became + negative, the calculation of the memory size went wrong. This could have + led to memory overwriting. + + 2. Building PCRE using VPATH was broken. Hopefully it is now fixed. + + 3. Added "b" to the 2nd argument of fopen() in dftables.c, for non-Unix-like + operating environments where this matters. + + 4. Applied Giuseppe Maxia's patch to add additional features for controlling + PCRE options from within the C++ wrapper. + + 5. Named capturing subpatterns were not being correctly counted when a pattern + was compiled. This caused two problems: (a) If there were more than 100 + such subpatterns, the calculation of the memory needed for the whole + compiled pattern went wrong, leading to an overflow error. (b) Numerical + back references of the form \12, where the number was greater than 9, were + not recognized as back references, even though there were sufficient + previous subpatterns. + + 6. Two minor patches to pcrecpp.cc in order to allow it to compile on older + versions of gcc, e.g. 2.95.4. + + +Version 6.1 21-Jun-05 +--------------------- + + 1. There was one reference to the variable "posix" in pcretest.c that was not + surrounded by "#if !defined NOPOSIX". + + 2. Make it possible to compile pcretest without DFA support, UTF8 support, or + the cross-check on the old pcre_info() function, for the benefit of the + cut-down version of PCRE that is currently imported into Exim. + + 3. A (silly) pattern starting with (?i)(?-i) caused an internal space + allocation error. I've done the easy fix, which wastes 2 bytes for sensible + patterns that start (?i) but I don't think that matters. The use of (?i) is + just an example; this all applies to the other options as well. + + 4. Since libtool seems to echo the compile commands it is issuing, the output + from "make" can be reduced a bit by putting "@" in front of each libtool + compile command. + + 5. Patch from the folks at Google for configure.in to be a bit more thorough + in checking for a suitable C++ installation before trying to compile the + C++ stuff. This should fix a reported problem when a compiler was present, + but no suitable headers. + + 6. The man pages all had just "PCRE" as their title. I have changed them to + be the relevant file name. I have also arranged that these names are + retained in the file doc/pcre.txt, which is a concatenation in text format + of all the man pages except the little individual ones for each function. + + 7. The NON-UNIX-USE file had not been updated for the different set of source + files that come with release 6. I also added a few comments about the C++ + wrapper. + + +Version 6.0 07-Jun-05 +--------------------- + + 1. Some minor internal re-organization to help with my DFA experiments. + + 2. Some missing #ifdef SUPPORT_UCP conditionals in pcretest and printint that + didn't matter for the library itself when fully configured, but did matter + when compiling without UCP support, or within Exim, where the ucp files are + not imported. + + 3. Refactoring of the library code to split up the various functions into + different source modules. The addition of the new DFA matching code (see + below) to a single monolithic source would have made it really too + unwieldy, quite apart from causing all the code to be include in a + statically linked application, when only some functions are used. This is + relevant even without the DFA addition now that patterns can be compiled in + one application and matched in another. + + The downside of splitting up is that there have to be some external + functions and data tables that are used internally in different modules of + the library but which are not part of the API. These have all had their + names changed to start with "_pcre_" so that they are unlikely to clash + with other external names. + + 4. Added an alternate matching function, pcre_dfa_exec(), which matches using + a different (DFA) algorithm. Although it is slower than the original + function, it does have some advantages for certain types of matching + problem. + + 5. Upgrades to pcretest in order to test the features of pcre_dfa_exec(), + including restarting after a partial match. + + 6. A patch for pcregrep that defines INVALID_FILE_ATTRIBUTES if it is not + defined when compiling for Windows was sent to me. I have put it into the + code, though I have no means of testing or verifying it. + + 7. Added the pcre_refcount() auxiliary function. + + 8. Added the PCRE_FIRSTLINE option. This constrains an unanchored pattern to + match before or at the first newline in the subject string. In pcretest, + the /f option on a pattern can be used to set this. + + 9. A repeated \w when used in UTF-8 mode with characters greater than 256 + would behave wrongly. This has been present in PCRE since release 4.0. + +10. A number of changes to the pcregrep command: + + (a) Refactored how -x works; insert ^(...)$ instead of setting + PCRE_ANCHORED and checking the length, in preparation for adding + something similar for -w. + + (b) Added the -w (match as a word) option. + + (c) Refactored the way lines are read and buffered so as to have more + than one at a time available. + + (d) Implemented a pcregrep test script. + + (e) Added the -M (multiline match) option. This allows patterns to match + over several lines of the subject. The buffering ensures that at least + 8K, or the rest of the document (whichever is the shorter) is available + for matching (and similarly the previous 8K for lookbehind assertions). + + (f) Changed the --help output so that it now says + + -w, --word-regex(p) + + instead of two lines, one with "regex" and the other with "regexp" + because that confused at least one person since the short forms are the + same. (This required a bit of code, as the output is generated + automatically from a table. It wasn't just a text change.) + + (g) -- can be used to terminate pcregrep options if the next thing isn't an + option but starts with a hyphen. Could be a pattern or a path name + starting with a hyphen, for instance. + + (h) "-" can be given as a file name to represent stdin. + + (i) When file names are being printed, "(standard input)" is used for + the standard input, for compatibility with GNU grep. Previously + "" was used. + + (j) The option --label=xxx can be used to supply a name to be used for + stdin when file names are being printed. There is no short form. + + (k) Re-factored the options decoding logic because we are going to add + two more options that take data. Such options can now be given in four + different ways, e.g. "-fname", "-f name", "--file=name", "--file name". + + (l) Added the -A, -B, and -C options for requesting that lines of context + around matches be printed. + + (m) Added the -L option to print the names of files that do not contain + any matching lines, that is, the complement of -l. + + (n) The return code is 2 if any file cannot be opened, but pcregrep does + continue to scan other files. + + (o) The -s option was incorrectly implemented. For compatibility with other + greps, it now suppresses the error message for a non-existent or non- + accessible file (but not the return code). There is a new option called + -q that suppresses the output of matching lines, which was what -s was + previously doing. + + (p) Added --include and --exclude options to specify files for inclusion + and exclusion when recursing. + +11. The Makefile was not using the Autoconf-supported LDFLAGS macro properly. + Hopefully, it now does. + +12. Missing cast in pcre_study(). + +13. Added an "uninstall" target to the makefile. + +14. Replaced "extern" in the function prototypes in Makefile.in with + "PCRE_DATA_SCOPE", which defaults to 'extern' or 'extern "C"' in the Unix + world, but is set differently for Windows. + +15. Added a second compiling function called pcre_compile2(). The only + difference is that it has an extra argument, which is a pointer to an + integer error code. When there is a compile-time failure, this is set + non-zero, in addition to the error test pointer being set to point to an + error message. The new argument may be NULL if no error number is required + (but then you may as well call pcre_compile(), which is now just a + wrapper). This facility is provided because some applications need a + numeric error indication, but it has also enabled me to tidy up the way + compile-time errors are handled in the POSIX wrapper. + +16. Added VPATH=.libs to the makefile; this should help when building with one + prefix path and installing with another. (Or so I'm told by someone who + knows more about this stuff than I do.) + +17. Added a new option, REG_DOTALL, to the POSIX function regcomp(). This + passes PCRE_DOTALL to the pcre_compile() function, making the "." character + match everything, including newlines. This is not POSIX-compatible, but + somebody wanted the feature. From pcretest it can be activated by using + both the P and the s flags. + +18. AC_PROG_LIBTOOL appeared twice in Makefile.in. Removed one. + +19. libpcre.pc was being incorrectly installed as executable. + +20. A couple of places in pcretest check for end-of-line by looking for '\n'; + it now also looks for '\r' so that it will work unmodified on Windows. + +21. Added Google's contributed C++ wrapper to the distribution. + +22. Added some untidy missing memory free() calls in pcretest, to keep + Electric Fence happy when testing. + + + +Version 5.0 13-Sep-04 +--------------------- + + 1. Internal change: literal characters are no longer packed up into items + containing multiple characters in a single byte-string. Each character + is now matched using a separate opcode. However, there may be more than one + byte in the character in UTF-8 mode. + + 2. The pcre_callout_block structure has two new fields: pattern_position and + next_item_length. These contain the offset in the pattern to the next match + item, and its length, respectively. + + 3. The PCRE_AUTO_CALLOUT option for pcre_compile() requests the automatic + insertion of callouts before each pattern item. Added the /C option to + pcretest to make use of this. + + 4. On the advice of a Windows user, the lines + + #if defined(_WIN32) || defined(WIN32) + _setmode( _fileno( stdout ), 0x8000 ); + #endif /* defined(_WIN32) || defined(WIN32) */ + + have been added to the source of pcretest. This apparently does useful + magic in relation to line terminators. + + 5. Changed "r" and "w" in the calls to fopen() in pcretest to "rb" and "wb" + for the benefit of those environments where the "b" makes a difference. + + 6. The icc compiler has the same options as gcc, but "configure" doesn't seem + to know about it. I have put a hack into configure.in that adds in code + to set GCC=yes if CC=icc. This seems to end up at a point in the + generated configure script that is early enough to affect the setting of + compiler options, which is what is needed, but I have no means of testing + whether it really works. (The user who reported this had patched the + generated configure script, which of course I cannot do.) + + LATER: After change 22 below (new libtool files), the configure script + seems to know about icc (and also ecc). Therefore, I have commented out + this hack in configure.in. + + 7. Added support for pkg-config (2 patches were sent in). + + 8. Negated POSIX character classes that used a combination of internal tables + were completely broken. These were [[:^alpha:]], [[:^alnum:]], and + [[:^ascii]]. Typically, they would match almost any characters. The other + POSIX classes were not broken in this way. + + 9. Matching the pattern "\b.*?" against "ab cd", starting at offset 1, failed + to find the match, as PCRE was deluded into thinking that the match had to + start at the start point or following a newline. The same bug applied to + patterns with negative forward assertions or any backward assertions + preceding ".*" at the start, unless the pattern required a fixed first + character. This was a failing pattern: "(?!.bcd).*". The bug is now fixed. + +10. In UTF-8 mode, when moving forwards in the subject after a failed match + starting at the last subject character, bytes beyond the end of the subject + string were read. + +11. Renamed the variable "class" as "classbits" to make life easier for C++ + users. (Previously there was a macro definition, but it apparently wasn't + enough.) + +12. Added the new field "tables" to the extra data so that tables can be passed + in at exec time, or the internal tables can be re-selected. This allows + a compiled regex to be saved and re-used at a later time by a different + program that might have everything at different addresses. + +13. Modified the pcre-config script so that, when run on Solaris, it shows a + -R library as well as a -L library. + +14. The debugging options of pcretest (-d on the command line or D on a + pattern) showed incorrect output for anything following an extended class + that contained multibyte characters and which was followed by a quantifier. + +15. Added optional support for general category Unicode character properties + via the \p, \P, and \X escapes. Unicode property support implies UTF-8 + support. It adds about 90K to the size of the library. The meanings of the + inbuilt class escapes such as \d and \s have NOT been changed. + +16. Updated pcredemo.c to include calls to free() to release the memory for the + compiled pattern. + +17. The generated file chartables.c was being created in the source directory + instead of in the building directory. This caused the build to fail if the + source directory was different from the building directory, and was + read-only. + +18. Added some sample Win commands from Mark Tetrode into the NON-UNIX-USE + file. No doubt somebody will tell me if they don't make sense... Also added + Dan Mooney's comments about building on OpenVMS. + +19. Added support for partial matching via the PCRE_PARTIAL option for + pcre_exec() and the \P data escape in pcretest. + +20. Extended pcretest with 3 new pattern features: + + (i) A pattern option of the form ">rest-of-line" causes pcretest to + write the compiled pattern to the file whose name is "rest-of-line". + This is a straight binary dump of the data, with the saved pointer to + the character tables forced to be NULL. The study data, if any, is + written too. After writing, pcretest reads a new pattern. + + (ii) If, instead of a pattern, ": new target + : new target + : use native compiler + : use native linker + : handle Windows platform correctly + : ditto + : ditto + copy DLL to top builddir before testing + + As part of these changes, -no-undefined was removed again. This was reported + to give trouble on HP-UX 11.0, so getting rid of it seems like a good idea + in any case. + +3. Some tidies to get rid of compiler warnings: + + . In the match_data structure, match_limit was an unsigned long int, whereas + match_call_count was an int. I've made them both unsigned long ints. + + . In pcretest the fact that a const uschar * doesn't automatically cast to + a void * provoked a warning. + + . Turning on some more compiler warnings threw up some "shadow" variables + and a few more missing casts. + +4. If PCRE was complied with UTF-8 support, but called without the PCRE_UTF8 + option, a class that contained a single character with a value between 128 + and 255 (e.g. /[\xFF]/) caused PCRE to crash. + +5. If PCRE was compiled with UTF-8 support, but called without the PCRE_UTF8 + option, a class that contained several characters, but with at least one + whose value was between 128 and 255 caused PCRE to crash. + + +Version 4.1 12-Mar-03 +--------------------- + +1. Compiling with gcc -pedantic found a couple of places where casts were +needed, and a string in dftables.c that was longer than standard compilers are +required to support. + +2. Compiling with Sun's compiler found a few more places where the code could +be tidied up in order to avoid warnings. + +3. The variables for cross-compiling were called HOST_CC and HOST_CFLAGS; the +first of these names is deprecated in the latest Autoconf in favour of the name +CC_FOR_BUILD, because "host" is typically used to mean the system on which the +compiled code will be run. I can't find a reference for HOST_CFLAGS, but by +analogy I have changed it to CFLAGS_FOR_BUILD. + +4. Added -no-undefined to the linking command in the Makefile, because this is +apparently helpful for Windows. To make it work, also added "-L. -lpcre" to the +linking step for the pcreposix library. + +5. PCRE was failing to diagnose the case of two named groups with the same +name. + +6. A problem with one of PCRE's optimizations was discovered. PCRE remembers a +literal character that is needed in the subject for a match, and scans along to +ensure that it is present before embarking on the full matching process. This +saves time in cases of nested unlimited repeats that are never going to match. +Problem: the scan can take a lot of time if the subject is very long (e.g. +megabytes), thus penalizing straightforward matches. It is now done only if the +amount of subject to be scanned is less than 1000 bytes. + +7. A lesser problem with the same optimization is that it was recording the +first character of an anchored pattern as "needed", thus provoking a search +right along the subject, even when the first match of the pattern was going to +fail. The "needed" character is now not set for anchored patterns, unless it +follows something in the pattern that is of non-fixed length. Thus, it still +fulfils its original purpose of finding quick non-matches in cases of nested +unlimited repeats, but isn't used for simple anchored patterns such as /^abc/. + + +Version 4.0 17-Feb-03 +--------------------- + +1. If a comment in an extended regex that started immediately after a meta-item +extended to the end of string, PCRE compiled incorrect data. This could lead to +all kinds of weird effects. Example: /#/ was bad; /()#/ was bad; /a#/ was not. + +2. Moved to autoconf 2.53 and libtool 1.4.2. + +3. Perl 5.8 no longer needs "use utf8" for doing UTF-8 things. Consequently, +the special perltest8 script is no longer needed - all the tests can be run +from a single perltest script. + +4. From 5.004, Perl has not included the VT character (0x0b) in the set defined +by \s. It has now been removed in PCRE. This means it isn't recognized as +whitespace in /x regexes too, which is the same as Perl. Note that the POSIX +class [:space:] *does* include VT, thereby creating a mess. + +5. Added the class [:blank:] (a GNU extension from Perl 5.8) to match only +space and tab. + +6. Perl 5.005 was a long time ago. It's time to amalgamate the tests that use +its new features into the main test script, reducing the number of scripts. + +7. Perl 5.8 has changed the meaning of patterns like /a(?i)b/. Earlier versions +were backward compatible, and made the (?i) apply to the whole pattern, as if +/i were given. Now it behaves more logically, and applies the option setting +only to what follows. PCRE has been changed to follow suit. However, if it +finds options settings right at the start of the pattern, it extracts them into +the global options, as before. Thus, they show up in the info data. + +8. Added support for the \Q...\E escape sequence. Characters in between are +treated as literals. This is slightly different from Perl in that $ and @ are +also handled as literals inside the quotes. In Perl, they will cause variable +interpolation. Note the following examples: + + Pattern PCRE matches Perl matches + + \Qabc$xyz\E abc$xyz abc followed by the contents of $xyz + \Qabc\$xyz\E abc\$xyz abc\$xyz + \Qabc\E\$\Qxyz\E abc$xyz abc$xyz + +For compatibility with Perl, \Q...\E sequences are recognized inside character +classes as well as outside them. + +9. Re-organized 3 code statements in pcretest to avoid "overflow in +floating-point constant arithmetic" warnings from a Microsoft compiler. Added a +(size_t) cast to one statement in pcretest and one in pcreposix to avoid +signed/unsigned warnings. + +10. SunOS4 doesn't have strtoul(). This was used only for unpicking the -o +option for pcretest, so I've replaced it by a simple function that does just +that job. + +11. pcregrep was ending with code 0 instead of 2 for the commands "pcregrep" or +"pcregrep -". + +12. Added "possessive quantifiers" ?+, *+, ++, and {,}+ which come from Sun's +Java package. This provides some syntactic sugar for simple cases of what my +documentation calls "once-only subpatterns". A pattern such as x*+ is the same +as (?>x*). In other words, if what is inside (?>...) is just a single repeated +item, you can use this simplified notation. Note that only makes sense with +greedy quantifiers. Consequently, the use of the possessive quantifier forces +greediness, whatever the setting of the PCRE_UNGREEDY option. + +13. A change of greediness default within a pattern was not taking effect at +the current level for patterns like /(b+(?U)a+)/. It did apply to parenthesized +subpatterns that followed. Patterns like /b+(?U)a+/ worked because the option +was abstracted outside. + +14. PCRE now supports the \G assertion. It is true when the current matching +position is at the start point of the match. This differs from \A when the +starting offset is non-zero. Used with the /g option of pcretest (or similar +code), it works in the same way as it does for Perl's /g option. If all +alternatives of a regex begin with \G, the expression is anchored to the start +match position, and the "anchored" flag is set in the compiled expression. + +15. Some bugs concerning the handling of certain option changes within patterns +have been fixed. These applied to options other than (?ims). For example, +"a(?x: b c )d" did not match "XabcdY" but did match "Xa b c dY". It should have +been the other way round. Some of this was related to change 7 above. + +16. PCRE now gives errors for /[.x.]/ and /[=x=]/ as unsupported POSIX +features, as Perl does. Previously, PCRE gave the warnings only for /[[.x.]]/ +and /[[=x=]]/. PCRE now also gives an error for /[:name:]/ because it supports +POSIX classes only within a class (e.g. /[[:alpha:]]/). + +17. Added support for Perl's \C escape. This matches one byte, even in UTF8 +mode. Unlike ".", it always matches newline, whatever the setting of +PCRE_DOTALL. However, PCRE does not permit \C to appear in lookbehind +assertions. Perl allows it, but it doesn't (in general) work because it can't +calculate the length of the lookbehind. At least, that's the case for Perl +5.8.0 - I've been told they are going to document that it doesn't work in +future. + +18. Added an error diagnosis for escapes that PCRE does not support: these are +\L, \l, \N, \P, \p, \U, \u, and \X. + +19. Although correctly diagnosing a missing ']' in a character class, PCRE was +reading past the end of the pattern in cases such as /[abcd/. + +20. PCRE was getting more memory than necessary for patterns with classes that +contained both POSIX named classes and other characters, e.g. /[[:space:]abc/. + +21. Added some code, conditional on #ifdef VPCOMPAT, to make life easier for +compiling PCRE for use with Virtual Pascal. + +22. Small fix to the Makefile to make it work properly if the build is done +outside the source tree. + +23. Added a new extension: a condition to go with recursion. If a conditional +subpattern starts with (?(R) the "true" branch is used if recursion has +happened, whereas the "false" branch is used only at the top level. + +24. When there was a very long string of literal characters (over 255 bytes +without UTF support, over 250 bytes with UTF support), the computation of how +much memory was required could be incorrect, leading to segfaults or other +strange effects. + +25. PCRE was incorrectly assuming anchoring (either to start of subject or to +start of line for a non-DOTALL pattern) when a pattern started with (.*) and +there was a subsequent back reference to those brackets. This meant that, for +example, /(.*)\d+\1/ failed to match "abc123bc". Unfortunately, it isn't +possible to check for precisely this case. All we can do is abandon the +optimization if .* occurs inside capturing brackets when there are any back +references whatsoever. (See below for a better fix that came later.) + +26. The handling of the optimization for finding the first character of a +non-anchored pattern, and for finding a character that is required later in the +match were failing in some cases. This didn't break the matching; it just +failed to optimize when it could. The way this is done has been re-implemented. + +27. Fixed typo in error message for invalid (?R item (it said "(?p"). + +28. Added a new feature that provides some of the functionality that Perl +provides with (?{...}). The facility is termed a "callout". The way it is done +in PCRE is for the caller to provide an optional function, by setting +pcre_callout to its entry point. Like pcre_malloc and pcre_free, this is a +global variable. By default it is unset, which disables all calling out. To get +the function called, the regex must include (?C) at appropriate points. This +is, in fact, equivalent to (?C0), and any number <= 255 may be given with (?C). +This provides a means of identifying different callout points. When PCRE +reaches such a point in the regex, if pcre_callout has been set, the external +function is called. It is provided with data in a structure called +pcre_callout_block, which is defined in pcre.h. If the function returns 0, +matching continues; if it returns a non-zero value, the match at the current +point fails. However, backtracking will occur if possible. [This was changed +later and other features added - see item 49 below.] + +29. pcretest is upgraded to test the callout functionality. It provides a +callout function that displays information. By default, it shows the start of +the match and the current position in the text. There are some new data escapes +to vary what happens: + + \C+ in addition, show current contents of captured substrings + \C- do not supply a callout function + \C!n return 1 when callout number n is reached + \C!n!m return 1 when callout number n is reached for the mth time + +30. If pcregrep was called with the -l option and just a single file name, it +output "" if a match was found, instead of the file name. + +31. Improve the efficiency of the POSIX API to PCRE. If the number of capturing +slots is less than POSIX_MALLOC_THRESHOLD, use a block on the stack to pass to +pcre_exec(). This saves a malloc/free per call. The default value of +POSIX_MALLOC_THRESHOLD is 10; it can be changed by --with-posix-malloc-threshold +when configuring. + +32. The default maximum size of a compiled pattern is 64K. There have been a +few cases of people hitting this limit. The code now uses macros to handle the +storing of links as offsets within the compiled pattern. It defaults to 2-byte +links, but this can be changed to 3 or 4 bytes by --with-link-size when +configuring. Tests 2 and 5 work only with 2-byte links because they output +debugging information about compiled patterns. + +33. Internal code re-arrangements: + +(a) Moved the debugging function for printing out a compiled regex into + its own source file (printint.c) and used #include to pull it into + pcretest.c and, when DEBUG is defined, into pcre.c, instead of having two + separate copies. + +(b) Defined the list of op-code names for debugging as a macro in + internal.h so that it is next to the definition of the opcodes. + +(c) Defined a table of op-code lengths for simpler skipping along compiled + code. This is again a macro in internal.h so that it is next to the + definition of the opcodes. + +34. Added support for recursive calls to individual subpatterns, along the +lines of Robin Houston's patch (but implemented somewhat differently). + +35. Further mods to the Makefile to help Win32. Also, added code to pcregrep to +allow it to read and process whole directories in Win32. This code was +contributed by Lionel Fourquaux; it has not been tested by me. + +36. Added support for named subpatterns. The Python syntax (?P...) is +used to name a group. Names consist of alphanumerics and underscores, and must +be unique. Back references use the syntax (?P=name) and recursive calls use +(?P>name) which is a PCRE extension to the Python extension. Groups still have +numbers. The function pcre_fullinfo() can be used after compilation to extract +a name/number map. There are three relevant calls: + + PCRE_INFO_NAMEENTRYSIZE yields the size of each entry in the map + PCRE_INFO_NAMECOUNT yields the number of entries + PCRE_INFO_NAMETABLE yields a pointer to the map. + +The map is a vector of fixed-size entries. The size of each entry depends on +the length of the longest name used. The first two bytes of each entry are the +group number, most significant byte first. There follows the corresponding +name, zero terminated. The names are in alphabetical order. + +37. Make the maximum literal string in the compiled code 250 for the non-UTF-8 +case instead of 255. Making it the same both with and without UTF-8 support +means that the same test output works with both. + +38. There was a case of malloc(0) in the POSIX testing code in pcretest. Avoid +calling malloc() with a zero argument. + +39. Change 25 above had to resort to a heavy-handed test for the .* anchoring +optimization. I've improved things by keeping a bitmap of backreferences with +numbers 1-31 so that if .* occurs inside capturing brackets that are not in +fact referenced, the optimization can be applied. It is unlikely that a +relevant occurrence of .* (i.e. one which might indicate anchoring or forcing +the match to follow \n) will appear inside brackets with a number greater than +31, but if it does, any back reference > 31 suppresses the optimization. + +40. Added a new compile-time option PCRE_NO_AUTO_CAPTURE. This has the effect +of disabling numbered capturing parentheses. Any opening parenthesis that is +not followed by ? behaves as if it were followed by ?: but named parentheses +can still be used for capturing (and they will acquire numbers in the usual +way). + +41. Redesigned the return codes from the match() function into yes/no/error so +that errors can be passed back from deep inside the nested calls. A malloc +failure while inside a recursive subpattern call now causes the +PCRE_ERROR_NOMEMORY return instead of quietly going wrong. + +42. It is now possible to set a limit on the number of times the match() +function is called in a call to pcre_exec(). This facility makes it possible to +limit the amount of recursion and backtracking, though not in a directly +obvious way, because the match() function is used in a number of different +circumstances. The count starts from zero for each position in the subject +string (for non-anchored patterns). The default limit is, for compatibility, a +large number, namely 10 000 000. You can change this in two ways: + +(a) When configuring PCRE before making, you can use --with-match-limit=n + to set a default value for the compiled library. + +(b) For each call to pcre_exec(), you can pass a pcre_extra block in which + a different value is set. See 45 below. + +If the limit is exceeded, pcre_exec() returns PCRE_ERROR_MATCHLIMIT. + +43. Added a new function pcre_config(int, void *) to enable run-time extraction +of things that can be changed at compile time. The first argument specifies +what is wanted and the second points to where the information is to be placed. +The current list of available information is: + + PCRE_CONFIG_UTF8 + +The output is an integer that is set to one if UTF-8 support is available; +otherwise it is set to zero. + + PCRE_CONFIG_NEWLINE + +The output is an integer that it set to the value of the code that is used for +newline. It is either LF (10) or CR (13). + + PCRE_CONFIG_LINK_SIZE + +The output is an integer that contains the number of bytes used for internal +linkage in compiled expressions. The value is 2, 3, or 4. See item 32 above. + + PCRE_CONFIG_POSIX_MALLOC_THRESHOLD + +The output is an integer that contains the threshold above which the POSIX +interface uses malloc() for output vectors. See item 31 above. + + PCRE_CONFIG_MATCH_LIMIT + +The output is an unsigned integer that contains the default limit of the number +of match() calls in a pcre_exec() execution. See 42 above. + +44. pcretest has been upgraded by the addition of the -C option. This causes it +to extract all the available output from the new pcre_config() function, and to +output it. The program then exits immediately. + +45. A need has arisen to pass over additional data with calls to pcre_exec() in +order to support additional features. One way would have been to define +pcre_exec2() (for example) with extra arguments, but this would not have been +extensible, and would also have required all calls to the original function to +be mapped to the new one. Instead, I have chosen to extend the mechanism that +is used for passing in "extra" data from pcre_study(). + +The pcre_extra structure is now exposed and defined in pcre.h. It currently +contains the following fields: + + flags a bitmap indicating which of the following fields are set + study_data opaque data from pcre_study() + match_limit a way of specifying a limit on match() calls for a specific + call to pcre_exec() + callout_data data for callouts (see 49 below) + +The flag bits are also defined in pcre.h, and are + + PCRE_EXTRA_STUDY_DATA + PCRE_EXTRA_MATCH_LIMIT + PCRE_EXTRA_CALLOUT_DATA + +The pcre_study() function now returns one of these new pcre_extra blocks, with +the actual study data pointed to by the study_data field, and the +PCRE_EXTRA_STUDY_DATA flag set. This can be passed directly to pcre_exec() as +before. That is, this change is entirely upwards-compatible and requires no +change to existing code. + +If you want to pass in additional data to pcre_exec(), you can either place it +in a pcre_extra block provided by pcre_study(), or create your own pcre_extra +block. + +46. pcretest has been extended to test the PCRE_EXTRA_MATCH_LIMIT feature. If a +data string contains the escape sequence \M, pcretest calls pcre_exec() several +times with different match limits, until it finds the minimum value needed for +pcre_exec() to complete. The value is then output. This can be instructive; for +most simple matches the number is quite small, but for pathological cases it +gets very large very quickly. + +47. There's a new option for pcre_fullinfo() called PCRE_INFO_STUDYSIZE. It +returns the size of the data block pointed to by the study_data field in a +pcre_extra block, that is, the value that was passed as the argument to +pcre_malloc() when PCRE was getting memory in which to place the information +created by pcre_study(). The fourth argument should point to a size_t variable. +pcretest has been extended so that this information is shown after a successful +pcre_study() call when information about the compiled regex is being displayed. + +48. Cosmetic change to Makefile: there's no need to have / after $(DESTDIR) +because what follows is always an absolute path. (Later: it turns out that this +is more than cosmetic for MinGW, because it doesn't like empty path +components.) + +49. Some changes have been made to the callout feature (see 28 above): + +(i) A callout function now has three choices for what it returns: + + 0 => success, carry on matching + > 0 => failure at this point, but backtrack if possible + < 0 => serious error, return this value from pcre_exec() + + Negative values should normally be chosen from the set of PCRE_ERROR_xxx + values. In particular, returning PCRE_ERROR_NOMATCH forces a standard + "match failed" error. The error number PCRE_ERROR_CALLOUT is reserved for + use by callout functions. It will never be used by PCRE itself. + +(ii) The pcre_extra structure (see 45 above) has a void * field called + callout_data, with corresponding flag bit PCRE_EXTRA_CALLOUT_DATA. The + pcre_callout_block structure has a field of the same name. The contents of + the field passed in the pcre_extra structure are passed to the callout + function in the corresponding field in the callout block. This makes it + easier to use the same callout-containing regex from multiple threads. For + testing, the pcretest program has a new data escape + + \C*n pass the number n (may be negative) as callout_data + + If the callout function in pcretest receives a non-zero value as + callout_data, it returns that value. + +50. Makefile wasn't handling CFLAGS properly when compiling dftables. Also, +there were some redundant $(CFLAGS) in commands that are now specified as +$(LINK), which already includes $(CFLAGS). + +51. Extensions to UTF-8 support are listed below. These all apply when (a) PCRE +has been compiled with UTF-8 support *and* pcre_compile() has been compiled +with the PCRE_UTF8 flag. Patterns that are compiled without that flag assume +one-byte characters throughout. Note that case-insensitive matching applies +only to characters whose values are less than 256. PCRE doesn't support the +notion of cases for higher-valued characters. + +(i) A character class whose characters are all within 0-255 is handled as + a bit map, and the map is inverted for negative classes. Previously, a + character > 255 always failed to match such a class; however it should + match if the class was a negative one (e.g. [^ab]). This has been fixed. + +(ii) A negated character class with a single character < 255 is coded as + "not this character" (OP_NOT). This wasn't working properly when the test + character was multibyte, either singly or repeated. + +(iii) Repeats of multibyte characters are now handled correctly in UTF-8 + mode, for example: \x{100}{2,3}. + +(iv) The character escapes \b, \B, \d, \D, \s, \S, \w, and \W (either + singly or repeated) now correctly test multibyte characters. However, + PCRE doesn't recognize any characters with values greater than 255 as + digits, spaces, or word characters. Such characters always match \D, \S, + and \W, and never match \d, \s, or \w. + +(v) Classes may now contain characters and character ranges with values + greater than 255. For example: [ab\x{100}-\x{400}]. + +(vi) pcregrep now has a --utf-8 option (synonym -u) which makes it call + PCRE in UTF-8 mode. + +52. The info request value PCRE_INFO_FIRSTCHAR has been renamed +PCRE_INFO_FIRSTBYTE because it is a byte value. However, the old name is +retained for backwards compatibility. (Note that LASTLITERAL is also a byte +value.) + +53. The single man page has become too large. I have therefore split it up into +a number of separate man pages. These also give rise to individual HTML pages; +these are now put in a separate directory, and there is an index.html page that +lists them all. Some hyperlinking between the pages has been installed. + +54. Added convenience functions for handling named capturing parentheses. + +55. Unknown escapes inside character classes (e.g. [\M]) and escapes that +aren't interpreted therein (e.g. [\C]) are literals in Perl. This is now also +true in PCRE, except when the PCRE_EXTENDED option is set, in which case they +are faulted. + +56. Introduced HOST_CC and HOST_CFLAGS which can be set in the environment when +calling configure. These values are used when compiling the dftables.c program +which is run to generate the source of the default character tables. They +default to the values of CC and CFLAGS. If you are cross-compiling PCRE, +you will need to set these values. + +57. Updated the building process for Windows DLL, as provided by Fred Cox. + + +Version 3.9 02-Jan-02 +--------------------- + +1. A bit of extraneous text had somehow crept into the pcregrep documentation. + +2. If --disable-static was given, the building process failed when trying to +build pcretest and pcregrep. (For some reason it was using libtool to compile +them, which is not right, as they aren't part of the library.) + + +Version 3.8 18-Dec-01 +--------------------- + +1. The experimental UTF-8 code was completely screwed up. It was packing the +bytes in the wrong order. How dumb can you get? + + +Version 3.7 29-Oct-01 +--------------------- + +1. In updating pcretest to check change 1 of version 3.6, I screwed up. +This caused pcretest, when used on the test data, to segfault. Unfortunately, +this didn't happen under Solaris 8, where I normally test things. + +2. The Makefile had to be changed to make it work on BSD systems, where 'make' +doesn't seem to recognize that ./xxx and xxx are the same file. (This entry +isn't in ChangeLog distributed with 3.7 because I forgot when I hastily made +this fix an hour or so after the initial 3.7 release.) + + +Version 3.6 23-Oct-01 +--------------------- + +1. Crashed with /(sens|respons)e and \1ibility/ and "sense and sensibility" if +offsets passed as NULL with zero offset count. + +2. The config.guess and config.sub files had not been updated when I moved to +the latest autoconf. + + +Version 3.5 15-Aug-01 +--------------------- + +1. Added some missing #if !defined NOPOSIX conditionals in pcretest.c that +had been forgotten. + +2. By using declared but undefined structures, we can avoid using "void" +definitions in pcre.h while keeping the internal definitions of the structures +private. + +3. The distribution is now built using autoconf 2.50 and libtool 1.4. From a +user point of view, this means that both static and shared libraries are built +by default, but this can be individually controlled. More of the work of +handling this static/shared cases is now inside libtool instead of PCRE's make +file. + +4. The pcretest utility is now installed along with pcregrep because it is +useful for users (to test regexs) and by doing this, it automatically gets +relinked by libtool. The documentation has been turned into a man page, so +there are now .1, .txt, and .html versions in /doc. + +5. Upgrades to pcregrep: + (i) Added long-form option names like gnu grep. + (ii) Added --help to list all options with an explanatory phrase. + (iii) Added -r, --recursive to recurse into sub-directories. + (iv) Added -f, --file to read patterns from a file. + +6. pcre_exec() was referring to its "code" argument before testing that +argument for NULL (and giving an error if it was NULL). + +7. Upgraded Makefile.in to allow for compiling in a different directory from +the source directory. + +8. Tiny buglet in pcretest: when pcre_fullinfo() was called to retrieve the +options bits, the pointer it was passed was to an int instead of to an unsigned +long int. This mattered only on 64-bit systems. + +9. Fixed typo (3.4/1) in pcre.h again. Sigh. I had changed pcre.h (which is +generated) instead of pcre.in, which it its source. Also made the same change +in several of the .c files. + +10. A new release of gcc defines printf() as a macro, which broke pcretest +because it had an ifdef in the middle of a string argument for printf(). Fixed +by using separate calls to printf(). + +11. Added --enable-newline-is-cr and --enable-newline-is-lf to the configure +script, to force use of CR or LF instead of \n in the source. On non-Unix +systems, the value can be set in config.h. + +12. The limit of 200 on non-capturing parentheses is a _nesting_ limit, not an +absolute limit. Changed the text of the error message to make this clear, and +likewise updated the man page. + +13. The limit of 99 on the number of capturing subpatterns has been removed. +The new limit is 65535, which I hope will not be a "real" limit. + + +Version 3.4 22-Aug-00 +--------------------- + +1. Fixed typo in pcre.h: unsigned const char * changed to const unsigned char *. + +2. Diagnose condition (?(0) as an error instead of crashing on matching. + + +Version 3.3 01-Aug-00 +--------------------- + +1. If an octal character was given, but the value was greater than \377, it +was not getting masked to the least significant bits, as documented. This could +lead to crashes in some systems. + +2. Perl 5.6 (if not earlier versions) accepts classes like [a-\d] and treats +the hyphen as a literal. PCRE used to give an error; it now behaves like Perl. + +3. Added the functions pcre_free_substring() and pcre_free_substring_list(). +These just pass their arguments on to (pcre_free)(), but they are provided +because some uses of PCRE bind it to non-C systems that can call its functions, +but cannot call free() or pcre_free() directly. + +4. Add "make test" as a synonym for "make check". Corrected some comments in +the Makefile. + +5. Add $(DESTDIR)/ in front of all the paths in the "install" target in the +Makefile. + +6. Changed the name of pgrep to pcregrep, because Solaris has introduced a +command called pgrep for grepping around the active processes. + +7. Added the beginnings of support for UTF-8 character strings. + +8. Arranged for the Makefile to pass over the settings of CC, CFLAGS, and +RANLIB to ./ltconfig so that they are used by libtool. I think these are all +the relevant ones. (AR is not passed because ./ltconfig does its own figuring +out for the ar command.) + + +Version 3.2 12-May-00 +--------------------- + +This is purely a bug fixing release. + +1. If the pattern /((Z)+|A)*/ was matched agained ZABCDEFG it matched Z instead +of ZA. This was just one example of several cases that could provoke this bug, +which was introduced by change 9 of version 2.00. The code for breaking +infinite loops after an iteration that matches an empty string was't working +correctly. + +2. The pcretest program was not imitating Perl correctly for the pattern /a*/g +when matched against abbab (for example). After matching an empty string, it +wasn't forcing anchoring when setting PCRE_NOTEMPTY for the next attempt; this +caused it to match further down the string than it should. + +3. The code contained an inclusion of sys/types.h. It isn't clear why this +was there because it doesn't seem to be needed, and it causes trouble on some +systems, as it is not a Standard C header. It has been removed. + +4. Made 4 silly changes to the source to avoid stupid compiler warnings that +were reported on the Macintosh. The changes were from + + while ((c = *(++ptr)) != 0 && c != '\n'); +to + while ((c = *(++ptr)) != 0 && c != '\n') ; + +Totally extraordinary, but if that's what it takes... + +5. PCRE is being used in one environment where neither memmove() nor bcopy() is +available. Added HAVE_BCOPY and an autoconf test for it; if neither +HAVE_MEMMOVE nor HAVE_BCOPY is set, use a built-in emulation function which +assumes the way PCRE uses memmove() (always moving upwards). + +6. PCRE is being used in one environment where strchr() is not available. There +was only one use in pcre.c, and writing it out to avoid strchr() probably gives +faster code anyway. + + +Version 3.1 09-Feb-00 +--------------------- + +The only change in this release is the fixing of some bugs in Makefile.in for +the "install" target: + +(1) It was failing to install pcreposix.h. + +(2) It was overwriting the pcre.3 man page with the pcreposix.3 man page. + + +Version 3.0 01-Feb-00 +--------------------- + +1. Add support for the /+ modifier to perltest (to output $` like it does in +pcretest). + +2. Add support for the /g modifier to perltest. + +3. Fix pcretest so that it behaves even more like Perl for /g when the pattern +matches null strings. + +4. Fix perltest so that it doesn't do unwanted things when fed an empty +pattern. Perl treats empty patterns specially - it reuses the most recent +pattern, which is not what we want. Replace // by /(?#)/ in order to avoid this +effect. + +5. The POSIX interface was broken in that it was just handing over the POSIX +captured string vector to pcre_exec(), but (since release 2.00) PCRE has +required a bigger vector, with some working space on the end. This means that +the POSIX wrapper now has to get and free some memory, and copy the results. + +6. Added some simple autoconf support, placing the test data and the +documentation in separate directories, re-organizing some of the +information files, and making it build pcre-config (a GNU standard). Also added +libtool support for building PCRE as a shared library, which is now the +default. + +7. Got rid of the leading zero in the definition of PCRE_MINOR because 08 and +09 are not valid octal constants. Single digits will be used for minor values +less than 10. + +8. Defined REG_EXTENDED and REG_NOSUB as zero in the POSIX header, so that +existing programs that set these in the POSIX interface can use PCRE without +modification. + +9. Added a new function, pcre_fullinfo() with an extensible interface. It can +return all that pcre_info() returns, plus additional data. The pcre_info() +function is retained for compatibility, but is considered to be obsolete. + +10. Added experimental recursion feature (?R) to handle one common case that +Perl 5.6 will be able to do with (?p{...}). + +11. Added support for POSIX character classes like [:alpha:], which Perl is +adopting. + + +Version 2.08 31-Aug-99 +---------------------- + +1. When startoffset was not zero and the pattern began with ".*", PCRE was not +trying to match at the startoffset position, but instead was moving forward to +the next newline as if a previous match had failed. + +2. pcretest was not making use of PCRE_NOTEMPTY when repeating for /g and /G, +and could get into a loop if a null string was matched other than at the start +of the subject. + +3. Added definitions of PCRE_MAJOR and PCRE_MINOR to pcre.h so the version can +be distinguished at compile time, and for completeness also added PCRE_DATE. + +5. Added Paul Sokolovsky's minor changes to make it easy to compile a Win32 DLL +in GnuWin32 environments. + + +Version 2.07 29-Jul-99 +---------------------- + +1. The documentation is now supplied in plain text form and HTML as well as in +the form of man page sources. + +2. C++ compilers don't like assigning (void *) values to other pointer types. +In particular this affects malloc(). Although there is no problem in Standard +C, I've put in casts to keep C++ compilers happy. + +3. Typo on pcretest.c; a cast of (unsigned char *) in the POSIX regexec() call +should be (const char *). + +4. If NOPOSIX is defined, pcretest.c compiles without POSIX support. This may +be useful for non-Unix systems who don't want to bother with the POSIX stuff. +However, I haven't made this a standard facility. The documentation doesn't +mention it, and the Makefile doesn't support it. + +5. The Makefile now contains an "install" target, with editable destinations at +the top of the file. The pcretest program is not installed. + +6. pgrep -V now gives the PCRE version number and date. + +7. Fixed bug: a zero repetition after a literal string (e.g. /abcde{0}/) was +causing the entire string to be ignored, instead of just the last character. + +8. If a pattern like /"([^\\"]+|\\.)*"/ is applied in the normal way to a +non-matching string, it can take a very, very long time, even for strings of +quite modest length, because of the nested recursion. PCRE now does better in +some of these cases. It does this by remembering the last required literal +character in the pattern, and pre-searching the subject to ensure it is present +before running the real match. In other words, it applies a heuristic to detect +some types of certain failure quickly, and in the above example, if presented +with a string that has no trailing " it gives "no match" very quickly. + +9. A new runtime option PCRE_NOTEMPTY causes null string matches to be ignored; +other alternatives are tried instead. + + +Version 2.06 09-Jun-99 +---------------------- + +1. Change pcretest's output for amount of store used to show just the code +space, because the remainder (the data block) varies in size between 32-bit and +64-bit systems. + +2. Added an extra argument to pcre_exec() to supply an offset in the subject to +start matching at. This allows lookbehinds to work when searching for multiple +occurrences in a string. + +3. Added additional options to pcretest for testing multiple occurrences: + + /+ outputs the rest of the string that follows a match + /g loops for multiple occurrences, using the new startoffset argument + /G loops for multiple occurrences by passing an incremented pointer + +4. PCRE wasn't doing the "first character" optimization for patterns starting +with \b or \B, though it was doing it for other lookbehind assertions. That is, +it wasn't noticing that a match for a pattern such as /\bxyz/ has to start with +the letter 'x'. On long subject strings, this gives a significant speed-up. + + +Version 2.05 21-Apr-99 +---------------------- + +1. Changed the type of magic_number from int to long int so that it works +properly on 16-bit systems. + +2. Fixed a bug which caused patterns starting with .* not to work correctly +when the subject string contained newline characters. PCRE was assuming +anchoring for such patterns in all cases, which is not correct because .* will +not pass a newline unless PCRE_DOTALL is set. It now assumes anchoring only if +DOTALL is set at top level; otherwise it knows that patterns starting with .* +must be retried after every newline in the subject. + + +Version 2.04 18-Feb-99 +---------------------- + +1. For parenthesized subpatterns with repeats whose minimum was zero, the +computation of the store needed to hold the pattern was incorrect (too large). +If such patterns were nested a few deep, this could multiply and become a real +problem. + +2. Added /M option to pcretest to show the memory requirement of a specific +pattern. Made -m a synonym of -s (which does this globally) for compatibility. + +3. Subpatterns of the form (regex){n,m} (i.e. limited maximum) were being +compiled in such a way that the backtracking after subsequent failure was +pessimal. Something like (a){0,3} was compiled as (a)?(a)?(a)? instead of +((a)((a)(a)?)?)? with disastrous performance if the maximum was of any size. + + +Version 2.03 02-Feb-99 +---------------------- + +1. Fixed typo and small mistake in man page. + +2. Added 4th condition (GPL supersedes if conflict) and created separate +LICENCE file containing the conditions. + +3. Updated pcretest so that patterns such as /abc\/def/ work like they do in +Perl, that is the internal \ allows the delimiter to be included in the +pattern. Locked out the use of \ as a delimiter. If \ immediately follows +the final delimiter, add \ to the end of the pattern (to test the error). + +4. Added the convenience functions for extracting substrings after a successful +match. Updated pcretest to make it able to test these functions. + + +Version 2.02 14-Jan-99 +---------------------- + +1. Initialized the working variables associated with each extraction so that +their saving and restoring doesn't refer to uninitialized store. + +2. Put dummy code into study.c in order to trick the optimizer of the IBM C +compiler for OS/2 into generating correct code. Apparently IBM isn't going to +fix the problem. + +3. Pcretest: the timing code wasn't using LOOPREPEAT for timing execution +calls, and wasn't printing the correct value for compiling calls. Increased the +default value of LOOPREPEAT, and the number of significant figures in the +times. + +4. Changed "/bin/rm" in the Makefile to "-rm" so it works on Windows NT. + +5. Renamed "deftables" as "dftables" to get it down to 8 characters, to avoid +a building problem on Windows NT with a FAT file system. + + +Version 2.01 21-Oct-98 +---------------------- + +1. Changed the API for pcre_compile() to allow for the provision of a pointer +to character tables built by pcre_maketables() in the current locale. If NULL +is passed, the default tables are used. + + +Version 2.00 24-Sep-98 +---------------------- + +1. Since the (>?) facility is in Perl 5.005, don't require PCRE_EXTRA to enable +it any more. + +2. Allow quantification of (?>) groups, and make it work correctly. + +3. The first character computation wasn't working for (?>) groups. + +4. Correct the implementation of \Z (it is permitted to match on the \n at the +end of the subject) and add 5.005's \z, which really does match only at the +very end of the subject. + +5. Remove the \X "cut" facility; Perl doesn't have it, and (?> is neater. + +6. Remove the ability to specify CASELESS, MULTILINE, DOTALL, and +DOLLAR_END_ONLY at runtime, to make it possible to implement the Perl 5.005 +localized options. All options to pcre_study() were also removed. + +7. Add other new features from 5.005: + + $(?<= positive lookbehind + $(?a*))*/ (a PCRE_EXTRA facility). + + +Version 1.00 18-Nov-97 +---------------------- + +1. Added compile-time macros to support systems such as SunOS4 which don't have +memmove() or strerror() but have other things that can be used instead. + +2. Arranged that "make clean" removes the executables. + + +Version 0.99 27-Oct-97 +---------------------- + +1. Fixed bug in code for optimizing classes with only one character. It was +initializing a 32-byte map regardless, which could cause it to run off the end +of the memory it had got. + +2. Added, conditional on PCRE_EXTRA, the proposed (?>REGEX) construction. + + +Version 0.98 22-Oct-97 +---------------------- + +1. Fixed bug in code for handling temporary memory usage when there are more +back references than supplied space in the ovector. This could cause segfaults. + + +Version 0.97 21-Oct-97 +---------------------- + +1. Added the \X "cut" facility, conditional on PCRE_EXTRA. + +2. Optimized negated single characters not to use a bit map. + +3. Brought error texts together as macro definitions; clarified some of them; +fixed one that was wrong - it said "range out of order" when it meant "invalid +escape sequence". + +4. Changed some char * arguments to const char *. + +5. Added PCRE_NOTBOL and PCRE_NOTEOL (from POSIX). + +6. Added the POSIX-style API wrapper in pcreposix.a and testing facilities in +pcretest. + + +Version 0.96 16-Oct-97 +---------------------- + +1. Added a simple "pgrep" utility to the distribution. + +2. Fixed an incompatibility with Perl: "{" is now treated as a normal character +unless it appears in one of the precise forms "{ddd}", "{ddd,}", or "{ddd,ddd}" +where "ddd" means "one or more decimal digits". + +3. Fixed serious bug. If a pattern had a back reference, but the call to +pcre_exec() didn't supply a large enough ovector to record the related +identifying subpattern, the match always failed. PCRE now remembers the number +of the largest back reference, and gets some temporary memory in which to save +the offsets during matching if necessary, in order to ensure that +backreferences always work. + +4. Increased the compatibility with Perl in a number of ways: + + (a) . no longer matches \n by default; an option PCRE_DOTALL is provided + to request this handling. The option can be set at compile or exec time. + + (b) $ matches before a terminating newline by default; an option + PCRE_DOLLAR_ENDONLY is provided to override this (but not in multiline + mode). The option can be set at compile or exec time. + + (c) The handling of \ followed by a digit other than 0 is now supposed to be + the same as Perl's. If the decimal number it represents is less than 10 + or there aren't that many previous left capturing parentheses, an octal + escape is read. Inside a character class, it's always an octal escape, + even if it is a single digit. + + (d) An escaped but undefined alphabetic character is taken as a literal, + unless PCRE_EXTRA is set. Currently this just reserves the remaining + escapes. + + (e) {0} is now permitted. (The previous item is removed from the compiled + pattern). + +5. Changed all the names of code files so that the basic parts are no longer +than 10 characters, and abolished the teeny "globals.c" file. + +6. Changed the handling of character classes; they are now done with a 32-byte +bit map always. + +7. Added the -d and /D options to pcretest to make it possible to look at the +internals of compilation without having to recompile pcre. + + +Version 0.95 23-Sep-97 +---------------------- + +1. Fixed bug in pre-pass concerning escaped "normal" characters such as \x5c or +\x20 at the start of a run of normal characters. These were being treated as +real characters, instead of the source characters being re-checked. + + +Version 0.94 18-Sep-97 +---------------------- + +1. The functions are now thread-safe, with the caveat that the global variables +containing pointers to malloc() and free() or alternative functions are the +same for all threads. + +2. Get pcre_study() to generate a bitmap of initial characters for non- +anchored patterns when this is possible, and use it if passed to pcre_exec(). + + +Version 0.93 15-Sep-97 +---------------------- + +1. /(b)|(:+)/ was computing an incorrect first character. + +2. Add pcre_study() to the API and the passing of pcre_extra to pcre_exec(), +but not actually doing anything yet. + +3. Treat "-" characters in classes that cannot be part of ranges as literals, +as Perl does (e.g. [-az] or [az-]). + +4. Set the anchored flag if a branch starts with .* or .*? because that tests +all possible positions. + +5. Split up into different modules to avoid including unneeded functions in a +compiled binary. However, compile and exec are still in one module. The "study" +function is split off. + +6. The character tables are now in a separate module whose source is generated +by an auxiliary program - but can then be edited by hand if required. There are +now no calls to isalnum(), isspace(), isdigit(), isxdigit(), tolower() or +toupper() in the code. + +7. Turn the malloc/free funtions variables into pcre_malloc and pcre_free and +make them global. Abolish the function for setting them, as the caller can now +set them directly. + + +Version 0.92 11-Sep-97 +---------------------- + +1. A repeat with a fixed maximum and a minimum of 1 for an ordinary character +(e.g. /a{1,3}/) was broken (I mis-optimized it). + +2. Caseless matching was not working in character classes if the characters in +the pattern were in upper case. + +3. Make ranges like [W-c] work in the same way as Perl for caseless matching. + +4. Make PCRE_ANCHORED public and accept as a compile option. + +5. Add an options word to pcre_exec() and accept PCRE_ANCHORED and +PCRE_CASELESS at run time. Add escapes \A and \I to pcretest to cause it to +pass them. + +6. Give an error if bad option bits passed at compile or run time. + +7. Add PCRE_MULTILINE at compile and exec time, and (?m) as well. Add \M to +pcretest to cause it to pass that flag. + +8. Add pcre_info(), to get the number of identifying subpatterns, the stored +options, and the first character, if set. + +9. Recognize C+ or C{n,m} where n >= 1 as providing a fixed starting character. + + +Version 0.91 10-Sep-97 +---------------------- + +1. PCRE was failing to diagnose unlimited repeats of subpatterns that could +match the empty string as in /(a*)*/. It was looping and ultimately crashing. + +2. PCRE was looping on encountering an indefinitely repeated back reference to +a subpattern that had matched an empty string, e.g. /(a|)\1*/. It now does what +Perl does - treats the match as successful. + +**** diff --git a/mozilla/js/tamarin/pcre/INSTALL b/mozilla/js/tamarin/pcre/INSTALL new file mode 100644 index 00000000000..08802812deb --- /dev/null +++ b/mozilla/js/tamarin/pcre/INSTALL @@ -0,0 +1,185 @@ +Basic Installation +================== + + These are generic installation instructions that apply to systems that +can run the `configure' shell script - Unix systems and any that imitate +it. They are not specific to PCRE. There are PCRE-specific instructions +for non-Unix systems in the file NON-UNIX-USE. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, a file +`config.cache' that saves the results of its tests to speed up +reconfiguring, and a file `config.log' containing compiler output +(useful mainly for debugging `configure'). + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If at some point `config.cache' +contains results you don't want to keep, you may remove or edit it. + + The file `configure.in' is used to create `configure' by a program +called `autoconf'. You only need `configure.in' if you want to change +it or regenerate `configure' using a newer version of `autoconf'. + +The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. If you're + using `csh' on an old version of System V, you might need to type + `sh ./configure' instead to prevent `csh' from trying to execute + `configure' itself. + + Running `configure' takes awhile. While running, it prints some + messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package. + + 4. Type `make install' to install the programs and any data files and + documentation. + + 5. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. You can give `configure' +initial values for variables by setting them in the environment. Using +a Bourne-compatible shell, you can do that on the command line like +this: + CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure + +Or on systems that have the `env' program, you can do it like this: + env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you must use a version of `make' that +supports the `VPATH' variable, such as GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. + + If you have to use a `make' that does not supports the `VPATH' +variable, you have to compile the package for one architecture at a time +in the source code directory. After you have installed the package for +one architecture, use `make distclean' before reconfiguring for another +architecture. + +Installation Names +================== + + By default, `make install' will install the package's files in +`/usr/local/bin', `/usr/local/man', etc. You can specify an +installation prefix other than `/usr/local' by giving `configure' the +option `--prefix=PATH'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +give `configure' the option `--exec-prefix=PATH', the package will use +PATH as the prefix for installing programs and libraries. +Documentation and other data files will still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=PATH' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + +Optional Features +================= + + Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + +Specifying the System Type +========================== + + There may be some features `configure' can not figure out +automatically, but needs to determine by the type of host the package +will run on. Usually `configure' can figure that out, but if it prints +a message saying it can not guess the host type, give it the +`--host=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name with three fields: + CPU-COMPANY-SYSTEM + +See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the host type. + + If you are building compiler tools for cross-compiling, you can also +use the `--target=TYPE' option to select the type of system they will +produce code for and the `--build=TYPE' option to select the type of +system on which you are compiling the package. + +Sharing Defaults +================ + + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Operation Controls +================== + + `configure' recognizes the following options to control how it +operates. + +`--cache-file=FILE' + Use and save the results of the tests in FILE instead of + `./config.cache'. Set FILE to `/dev/null' to disable caching, for + debugging `configure'. + +`--help' + Print a summary of the options to `configure', and exit. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`--version' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`configure' also accepts some other, not widely useful, options. diff --git a/mozilla/js/tamarin/pcre/LICENCE b/mozilla/js/tamarin/pcre/LICENCE new file mode 100644 index 00000000000..e8eb0d93703 --- /dev/null +++ b/mozilla/js/tamarin/pcre/LICENCE @@ -0,0 +1,68 @@ +PCRE LICENCE +------------ + +PCRE is a library of functions to support regular expressions whose syntax +and semantics are as close as possible to those of the Perl 5 language. + +Release 6 of PCRE is distributed under the terms of the "BSD" licence, as +specified below. The documentation for PCRE, supplied in the "doc" +directory, is distributed under the same terms as the software itself. + +The basic library functions are written in C and are freestanding. Also +included in the distribution is a set of C++ wrapper functions. + + +THE BASIC LIBRARY FUNCTIONS +--------------------------- + +Written by: Philip Hazel +Email local part: ph10 +Email domain: cam.ac.uk + +University of Cambridge Computing Service, +Cambridge, England. Phone: +44 1223 334714. + +Copyright (c) 1997-2005 University of Cambridge +All rights reserved. + + +THE C++ WRAPPER FUNCTIONS +------------------------- + +Contributed by: Google Inc. + +Copyright (c) 2005, Google Inc. +All rights reserved. + + +THE "BSD" LICENCE +----------------- + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + * Neither the name of the University of Cambridge nor the name of Google + Inc. nor the names of their contributors may be used to endorse or + promote products derived from this software without specific prior + written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + +End diff --git a/mozilla/js/tamarin/pcre/Makefile.in b/mozilla/js/tamarin/pcre/Makefile.in new file mode 100644 index 00000000000..fbb3199f11c --- /dev/null +++ b/mozilla/js/tamarin/pcre/Makefile.in @@ -0,0 +1,568 @@ + +# Makefile.in for PCRE (Perl-Compatible Regular Expression) library. + + +############################################################################# + +# PCRE is developed on a Unix system. I do not use Windows or Macs, and know +# nothing about building software on them. Although the code of PCRE should +# be very portable, the building system in this Makefile is designed for Unix +# systems. However, there are features that have been supplied to me by various +# people that should make it work on MinGW and Cygwin systems. + +# This setting enables Unix-style directory scanning in pcregrep, triggered +# by the -f option. Maybe one day someone will add code for other systems. + +PCREGREP_OSTYPE=-DIS_UNIX + +############################################################################# + + +# Libtool places .o files in the .libs directory; this can mean that "make" +# thinks is it not up-to-date when in fact it is. This setting helps when +# GNU "make" is being used. It presumably does no harm in other cases. + +VPATH=.libs + + +#---------------------------------------------------------------------------# +# The following lines are modified by "configure" to insert data that it is # +# given in its arguments, or which it finds out for itself. # +#---------------------------------------------------------------------------# + +SHELL = @SHELL@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ +top_srcdir = @top_srcdir@ + +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs + +# NB: top_builddir is not referred to directly below, but it is used in the +# setting of $(LIBTOOL), so don't remove it! + +top_builddir = . + +# BINDIR is the directory in which the pcregrep, pcretest, and pcre-config +# commands are installed. +# INCDIR is the directory in which the public header files pcre.h and +# pcreposix.h are installed. +# LIBDIR is the directory in which the libraries are installed. +# MANDIR is the directory in which the man pages are installed. + +BINDIR = @bindir@ +LIBDIR = @libdir@ +INCDIR = @includedir@ +MANDIR = @mandir@ + +# EXEEXT is set by configure to the extention of an executable file +# OBJEXT is set by configure to the extention of an object file +# The BUILD_* equivalents are the same but for the host we're building on + +EXEEXT = @EXEEXT@ +OBJEXT = @OBJEXT@ +# Note that these are just here to have a convenient place to look at the +# outcome. +BUILD_EXEEXT = @BUILD_EXEEXT@ +BUILD_OBJEXT = @BUILD_OBJEXT@ + +# POSIX_OBJ and POSIX_LOBJ are either set empty, or to the names of the +# POSIX object files. + +POSIX_OBJ = @POSIX_OBJ@ +POSIX_LOBJ = @POSIX_LOBJ@ + +# The compiler, C flags, preprocessor flags, etc + +CC = @CC@ +CXX = @CXX@ +CFLAGS = @CFLAGS@ +CXXFLAGS = @CXXFLAGS@ +LDFLAGS = @LDFLAGS@ + +CC_FOR_BUILD = @CC_FOR_BUILD@ +CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ +CXX_FOR_BUILD = @CXX_FOR_BUILD@ +CXXFLAGS_FOR_BUILD = @CXXFLAGS_FOR_BUILD@ +LDFLAGS_FOR_BUILD = $(LDFLAGS) + +UCP = @UCP@ +UTF8 = @UTF8@ +NEWLINE = @NEWLINE@ +POSIX_MALLOC_THRESHOLD = @POSIX_MALLOC_THRESHOLD@ +LINK_SIZE = @LINK_SIZE@ +MATCH_LIMIT = @MATCH_LIMIT@ +NO_RECURSE = @NO_RECURSE@ +EBCDIC = @EBCDIC@ + +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ + +# LIBTOOL enables the building of shared and static libraries. It is set up +# to do one or the other or both by ./configure. + +LIBTOOL = @LIBTOOL@ +LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) -c $(CFLAGS) -I. -I$(top_srcdir) $(NEWLINE) $(LINK_SIZE) $(MATCH_LIMIT) $(NO_RECURSE) $(EBCDIC) +LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) -c $(CXXFLAGS) -I. -I$(top_srcdir) $(NEWLINE) $(LINK_SIZE) $(MATCH_LIMIT) $(NO_RECURSE) $(EBCDIC) +@ON_WINDOWS@LINK = $(CC) $(LDFLAGS) -I. -I$(top_srcdir) -L.libs +@NOT_ON_WINDOWS@LINK = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -I. -I$(top_srcdir) +LINKLIB = $(LIBTOOL) --mode=link $(CC) -export-symbols-regex '^[^_]' $(LDFLAGS) -I. -I$(top_srcdir) +LINK_FOR_BUILD = $(LIBTOOL) --mode=link $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -I. -I$(top_srcdir) +@ON_WINDOWS@CXXLINK = $(CXX) $(LDFLAGS) -I. -I$(top_srcdir) -L.libs +@NOT_ON_WINDOWS@CXXLINK = $(LIBTOOL) --mode=link $(CXX) $(LDFLAGS) -I. -I$(top_srcdir) +CXXLINKLIB = $(LIBTOOL) --mode=link $(CXX) $(LDFLAGS) -I. -I$(top_srcdir) + +# These are the version numbers for the shared libraries + +PCRELIBVERSION = @PCRE_LIB_VERSION@ +PCREPOSIXLIBVERSION = @PCRE_POSIXLIB_VERSION@ +PCRECPPLIBVERSION = @PCRE_CPPLIB_VERSION@ + +############################################################################## + + +OBJ = pcre_chartables.@OBJEXT@ \ + pcre_compile.@OBJEXT@ \ + pcre_config.@OBJEXT@ \ + pcre_dfa_exec.@OBJEXT@ \ + pcre_exec.@OBJEXT@ \ + pcre_fullinfo.@OBJEXT@ \ + pcre_get.@OBJEXT@ \ + pcre_globals.@OBJEXT@ \ + pcre_info.@OBJEXT@ \ + pcre_maketables.@OBJEXT@ \ + pcre_ord2utf8.@OBJEXT@ \ + pcre_refcount.@OBJEXT@ \ + pcre_study.@OBJEXT@ \ + pcre_tables.@OBJEXT@ \ + pcre_try_flipped.@OBJEXT@ \ + pcre_ucp_findchar.@OBJEXT@ \ + pcre_valid_utf8.@OBJEXT@ \ + pcre_version.@OBJEXT@ \ + pcre_xclass.@OBJEXT@ \ + $(POSIX_OBJ) + +LOBJ = pcre_chartables.lo \ + pcre_compile.lo \ + pcre_config.lo \ + pcre_dfa_exec.lo \ + pcre_exec.lo \ + pcre_fullinfo.lo \ + pcre_get.lo \ + pcre_globals.lo \ + pcre_info.lo \ + pcre_maketables.lo \ + pcre_ord2utf8.lo \ + pcre_refcount.lo \ + pcre_study.lo \ + pcre_tables.lo \ + pcre_try_flipped.lo \ + pcre_ucp_findchar.lo \ + pcre_valid_utf8.lo \ + pcre_version.lo \ + pcre_xclass.lo \ + $(POSIX_LOBJ) + +CPPOBJ = pcrecpp.@OBJEXT@ \ + pcre_scanner.@OBJEXT@ \ + pcre_stringpiece.@OBJEXT@ + +CPPLOBJ = pcrecpp.lo \ + pcre_scanner.lo \ + pcre_stringpiece.lo + +CPP_TARGETS = libpcrecpp.la \ + pcrecpp_unittest@EXEEXT@ \ + pcre_scanner_unittest@EXEEXT@ \ + pcre_stringpiece_unittest@EXEEXT@ + +all: libpcre.la @POSIX_LIB@ pcretest@EXEEXT@ pcregrep@EXEEXT@ @MAYBE_CPP_TARGETS@ @ON_WINDOWS@ winshared + +pcregrep@EXEEXT@: libpcre.la pcregrep.@OBJEXT@ @ON_WINDOWS@ winshared + $(LINK) -o pcregrep@EXEEXT@ pcregrep.@OBJEXT@ libpcre.la + +pcretest@EXEEXT@: libpcre.la @POSIX_LIB@ pcretest.@OBJEXT@ @ON_WINDOWS@ winshared + $(LINK) $(PURIFY) $(EFENCE) -o pcretest@EXEEXT@ pcretest.@OBJEXT@ \ + libpcre.la @POSIX_LIB@ + +pcrecpp_unittest@EXEEXT@: libpcrecpp.la pcrecpp_unittest.@OBJEXT@ @ON_WINDOWS@ winshared + $(CXXLINK) $(PURIFY) $(EFENCE) -o pcrecpp_unittest@EXEEXT@ pcrecpp_unittest.@OBJEXT@ \ + libpcrecpp.la @POSIX_LIB@ + +pcre_scanner_unittest@EXEEXT@: libpcrecpp.la pcre_scanner_unittest.@OBJEXT@ @ON_WINDOWS@ winshared + $(CXXLINK) $(PURIFY) $(EFENCE) -o pcre_scanner_unittest@EXEEXT@ pcre_scanner_unittest.@OBJEXT@ \ + libpcrecpp.la @POSIX_LIB@ + +pcre_stringpiece_unittest@EXEEXT@: libpcrecpp.la pcre_stringpiece_unittest.@OBJEXT@ @ON_WINDOWS@ winshared + $(CXXLINK) $(PURIFY) $(EFENCE) -o pcre_stringpiece_unittest@EXEEXT@ pcre_stringpiece_unittest.@OBJEXT@ \ + libpcrecpp.la @POSIX_LIB@ + +libpcre.la: $(OBJ) + -rm -f libpcre.la + $(LINKLIB) -rpath $(LIBDIR) -version-info \ + '$(PCRELIBVERSION)' -o libpcre.la $(LOBJ) + +libpcreposix.la: libpcre.la pcreposix.@OBJEXT@ + -rm -f libpcreposix.la + $(LINKLIB) -rpath $(LIBDIR) libpcre.la -version-info \ + '$(PCREPOSIXLIBVERSION)' -o libpcreposix.la pcreposix.lo + +libpcrecpp.la: libpcre.la $(CPPOBJ) + -rm -f libpcrecpp.la + $(CXXLINKLIB) -rpath $(LIBDIR) libpcre.la -version-info \ + '$(PCRECPPLIBVERSION)' -o libpcrecpp.la $(CPPLOBJ) + +# Note that files generated by ./configure and by dftables are in the current +# directory, not the source directory. + +pcre_chartables.@OBJEXT@: pcre_chartables.c + @$(LTCOMPILE) pcre_chartables.c + +pcre_compile.@OBJEXT@: Makefile config.h pcre.h \ + $(top_srcdir)/pcre_internal.h $(top_srcdir)/pcre_compile.c + @$(LTCOMPILE) $(UTF8) $(UCP) $(POSIX_MALLOC_THRESHOLD) \ + $(top_srcdir)/pcre_compile.c + +pcre_config.@OBJEXT@: Makefile config.h pcre.h \ + $(top_srcdir)/pcre_internal.h $(top_srcdir)/pcre_config.c + @$(LTCOMPILE) $(UTF8) $(UCP) $(POSIX_MALLOC_THRESHOLD) \ + $(top_srcdir)/pcre_config.c + +pcre_dfa_exec.@OBJEXT@: Makefile config.h pcre.h \ + $(top_srcdir)/pcre_internal.h $(top_srcdir)/pcre_dfa_exec.c + @$(LTCOMPILE) $(UTF8) $(UCP) $(POSIX_MALLOC_THRESHOLD) \ + $(top_srcdir)/pcre_dfa_exec.c + +pcre_exec.@OBJEXT@: Makefile config.h pcre.h \ + $(top_srcdir)/pcre_internal.h $(top_srcdir)/pcre_exec.c + @$(LTCOMPILE) $(UTF8) $(UCP) $(POSIX_MALLOC_THRESHOLD) \ + $(top_srcdir)/pcre_exec.c + +pcre_fullinfo.@OBJEXT@: Makefile config.h pcre.h \ + $(top_srcdir)/pcre_internal.h $(top_srcdir)/pcre_fullinfo.c + @$(LTCOMPILE) $(UTF8) $(UCP) $(POSIX_MALLOC_THRESHOLD) \ + $(top_srcdir)/pcre_fullinfo.c + +pcre_get.@OBJEXT@: Makefile config.h pcre.h \ + $(top_srcdir)/pcre_internal.h $(top_srcdir)/pcre_get.c + @$(LTCOMPILE) $(UTF8) $(UCP) $(POSIX_MALLOC_THRESHOLD) \ + $(top_srcdir)/pcre_get.c + +pcre_globals.@OBJEXT@: Makefile config.h pcre.h \ + $(top_srcdir)/pcre_internal.h $(top_srcdir)/pcre_globals.c + @$(LTCOMPILE) $(UTF8) $(UCP) $(POSIX_MALLOC_THRESHOLD) \ + $(top_srcdir)/pcre_globals.c + +pcre_info.@OBJEXT@: Makefile config.h pcre.h \ + $(top_srcdir)/pcre_internal.h $(top_srcdir)/pcre_info.c + @$(LTCOMPILE) $(UTF8) $(UCP) $(POSIX_MALLOC_THRESHOLD) \ + $(top_srcdir)/pcre_info.c + +pcre_maketables.@OBJEXT@: Makefile config.h pcre.h \ + $(top_srcdir)/pcre_internal.h $(top_srcdir)/pcre_maketables.c + @$(LTCOMPILE) $(UTF8) $(UCP) $(POSIX_MALLOC_THRESHOLD) \ + $(top_srcdir)/pcre_maketables.c + +pcre_ord2utf8.@OBJEXT@: Makefile config.h pcre.h \ + $(top_srcdir)/pcre_internal.h $(top_srcdir)/pcre_ord2utf8.c + @$(LTCOMPILE) $(UTF8) $(UCP) $(POSIX_MALLOC_THRESHOLD) \ + $(top_srcdir)/pcre_ord2utf8.c + +pcre_refcount.@OBJEXT@: Makefile config.h pcre.h \ + $(top_srcdir)/pcre_internal.h $(top_srcdir)/pcre_refcount.c + @$(LTCOMPILE) $(UTF8) $(UCP) $(POSIX_MALLOC_THRESHOLD) \ + $(top_srcdir)/pcre_refcount.c + +pcre_study.@OBJEXT@: Makefile config.h pcre.h \ + $(top_srcdir)/pcre_internal.h $(top_srcdir)/pcre_study.c + @$(LTCOMPILE) $(UTF8) $(UCP) $(POSIX_MALLOC_THRESHOLD) \ + $(top_srcdir)/pcre_study.c + +pcre_tables.@OBJEXT@: Makefile config.h pcre.h \ + $(top_srcdir)/pcre_internal.h $(top_srcdir)/pcre_tables.c + @$(LTCOMPILE) $(UTF8) $(UCP) $(POSIX_MALLOC_THRESHOLD) \ + $(top_srcdir)/pcre_tables.c + +pcre_try_flipped.@OBJEXT@: Makefile config.h pcre.h \ + $(top_srcdir)/pcre_internal.h $(top_srcdir)/pcre_try_flipped.c + @$(LTCOMPILE) $(UTF8) $(UCP) $(POSIX_MALLOC_THRESHOLD) \ + $(top_srcdir)/pcre_try_flipped.c + +pcre_ucp_findchar.@OBJEXT@: Makefile config.h pcre.h \ + $(top_srcdir)/pcre_internal.h $(top_srcdir)/pcre_ucp_findchar.c + @$(LTCOMPILE) $(UTF8) $(UCP) $(POSIX_MALLOC_THRESHOLD) \ + $(top_srcdir)/pcre_ucp_findchar.c + +pcre_valid_utf8.@OBJEXT@: Makefile config.h pcre.h \ + $(top_srcdir)/pcre_internal.h $(top_srcdir)/pcre_valid_utf8.c + @$(LTCOMPILE) $(UTF8) $(UCP) $(POSIX_MALLOC_THRESHOLD) \ + $(top_srcdir)/pcre_valid_utf8.c + +pcre_version.@OBJEXT@: Makefile config.h pcre.h \ + $(top_srcdir)/pcre_internal.h $(top_srcdir)/pcre_version.c + @$(LTCOMPILE) $(UTF8) $(UCP) $(POSIX_MALLOC_THRESHOLD) \ + $(top_srcdir)/pcre_version.c + +pcre_xclass.@OBJEXT@: Makefile config.h pcre.h \ + $(top_srcdir)/pcre_internal.h $(top_srcdir)/pcre_xclass.c + @$(LTCOMPILE) $(UTF8) $(UCP) $(POSIX_MALLOC_THRESHOLD) \ + $(top_srcdir)/pcre_xclass.c + +pcreposix.@OBJEXT@: $(top_srcdir)/pcreposix.c $(top_srcdir)/pcreposix.h \ + $(top_srcdir)/pcre_internal.h pcre.h config.h Makefile + @$(LTCOMPILE) $(POSIX_MALLOC_THRESHOLD) $(top_srcdir)/pcreposix.c + +pcrecpp.@OBJEXT@: $(top_srcdir)/pcrecpp.cc pcrecpp.h \ + pcre_stringpiece.h pcre.h config.h Makefile + @$(LTCXXCOMPILE) $(UTF8) $(UCP) $(POSIX_MALLOC_THRESHOLD) \ + $(top_srcdir)/pcrecpp.cc + +pcre_scanner.@OBJEXT@: $(top_srcdir)/pcre_scanner.cc $(top_srcdir)/pcre_scanner.h \ + pcrecpp.h pcre_stringpiece.h pcre.h config.h Makefile + @$(LTCXXCOMPILE) $(UTF8) $(UCP) $(POSIX_MALLOC_THRESHOLD) \ + $(top_srcdir)/pcre_scanner.cc + +pcre_stringpiece.@OBJEXT@: $(top_srcdir)/pcre_stringpiece.cc pcre_stringpiece.h \ + config.h Makefile + @$(LTCXXCOMPILE) $(UTF8) $(UCP) $(POSIX_MALLOC_THRESHOLD) \ + $(top_srcdir)/pcre_stringpiece.cc + +pcretest.@OBJEXT@: $(top_srcdir)/pcretest.c $(top_srcdir)/pcre_internal.h \ + pcre.h config.h Makefile + $(CC) -c $(CFLAGS) -I. -I$(top_srcdir) $(UTF8) $(UCP) $(LINK_SIZE) $(top_srcdir)/pcretest.c + +pcrecpp_unittest.@OBJEXT@: $(top_srcdir)/pcrecpp_unittest.cc pcrecpp.h \ + pcre_stringpiece.h pcre.h config.h Makefile + $(CXX) -c $(CXXFLAGS) -I. -I$(top_srcdir) $(UTF8) $(UCP) $(LINK_SIZE) $(top_srcdir)/pcrecpp_unittest.cc + +pcre_stringpiece_unittest.@OBJEXT@: $(top_srcdir)/pcre_stringpiece_unittest.cc \ + pcre_stringpiece.h config.h Makefile + $(CXX) -c $(CXXFLAGS) -I. -I$(top_srcdir) $(UTF8) $(UCP) $(LINK_SIZE) $(top_srcdir)/pcre_stringpiece_unittest.cc + +pcre_scanner_unittest.@OBJEXT@: $(top_srcdir)/pcre_scanner_unittest.cc \ + $(top_srcdir)/pcre_scanner.h pcrecpp.h pcre_stringpiece.h \ + pcre.h config.h Makefile + $(CXX) -c $(CXXFLAGS) -I. -I$(top_srcdir) $(UTF8) $(UCP) $(LINK_SIZE) $(top_srcdir)/pcre_scanner_unittest.cc + +pcregrep.@OBJEXT@: $(top_srcdir)/pcregrep.c pcre.h Makefile config.h + $(CC) -c $(CFLAGS) -I. -I$(top_srcdir) $(UTF8) $(UCP) $(PCREGREP_OSTYPE) $(top_srcdir)/pcregrep.c + +# Some Windows-specific targets for MinGW. Do not use for Cygwin. + +winshared : .libs/@WIN_PREFIX@pcre.dll .libs/@WIN_PREFIX@pcreposix.dll \ + .libs/@WIN_PREFIX@pcrecpp.dll + +.libs/@WIN_PREFIX@pcre.dll : libpcre.la + $(CC) $(CFLAGS) -shared -o $@ \ + -Wl,--whole-archive .libs/libpcre.a \ + -Wl,--out-implib,.libs/libpcre.dll.a \ + -Wl,--output-def,.libs/@WIN_PREFIX@pcre.dll-def \ + -Wl,--export-all-symbols \ + -Wl,--no-whole-archive + sed -e "s#dlname=''#dlname='../bin/@WIN_PREFIX@pcre.dll'#" \ + -e "s#library_names=''#library_names='libpcre.dll.a'#" \ + < .libs/libpcre.lai > .libs/libpcre.lai.tmp && \ + mv -f .libs/libpcre.lai.tmp .libs/libpcre.lai + sed -e "s#dlname=''#dlname='../bin/@WIN_PREFIX@pcre.dll'#" \ + -e "s#library_names=''#library_names='libpcre.dll.a'#" \ + < libpcre.la > libpcre.la.tmp && \ + mv -f libpcre.la.tmp libpcre.la + + +.libs/@WIN_PREFIX@pcreposix.dll: libpcreposix.la libpcre.la + $(CC) $(CFLAGS) -shared -o $@ \ + -Wl,--whole-archive .libs/libpcreposix.a \ + -Wl,--out-implib,.libs/@WIN_PREFIX@pcreposix.dll.a \ + -Wl,--output-def,.libs/@WIN_PREFIX@libpcreposix.dll-def \ + -Wl,--export-all-symbols \ + -Wl,--no-whole-archive .libs/libpcre.a + sed -e "s#dlname=''#dlname='../bin/@WIN_PREFIX@pcreposix.dll'#" \ + -e "s#library_names=''#library_names='libpcreposix.dll.a'#"\ + < .libs/libpcreposix.lai > .libs/libpcreposix.lai.tmp && \ + mv -f .libs/libpcreposix.lai.tmp .libs/libpcreposix.lai + sed -e "s#dlname=''#dlname='../bin/@WIN_PREFIX@pcreposix.dll'#" \ + -e "s#library_names=''#library_names='libpcreposix.dll.a'#"\ + < libpcreposix.la > libpcreposix.la.tmp && \ + mv -f libpcreposix.la.tmp libpcreposix.la + +.libs/@WIN_PREFIX@pcrecpp.dll: libpcrecpp.la libpcre.la + $(CXX) $(CXXFLAGS) -shared -o $@ \ + -Wl,--whole-archive .libs/libpcrecpp.a \ + -Wl,--out-implib,.libs/@WIN_PREFIX@pcrecpp.dll.a \ + -Wl,--output-def,.libs/@WIN_PREFIX@libpcrecpp.dll-def \ + -Wl,--export-all-symbols \ + -Wl,--no-whole-archive .libs/libpcre.a + sed -e "s#dlname=''#dlname='../bin/@WIN_PREFIX@pcrecpp.dll'#" \ + -e "s#library_names=''#library_names='libpcrecpp.dll.a'#"\ + < .libs/libpcrecpp.lai > .libs/libpcrecpp.lai.tmp && \ + mv -f .libs/libpcrecpp.lai.tmp .libs/libpcrecpp.lai + sed -e "s#dlname=''#dlname='../bin/@WIN_PREFIX@pcrecpp.dll'#" \ + -e "s#library_names=''#library_names='libpcrecpp.dll.a'#"\ + < libpcrecpp.la > libpcrecpp.la.tmp && \ + mv -f libpcrecpp.la.tmp libpcrecpp.la + + +wininstall : winshared + $(mkinstalldirs) $(DESTDIR)$(LIBDIR) + $(mkinstalldirs) $(DESTDIR)$(BINDIR) + $(INSTALL) .libs/@WIN_PREFIX@pcre.dll $(DESTDIR)$(BINDIR)/@WIN_PREFIX@pcre.dll + $(INSTALL) .libs/@WIN_PREFIX@pcreposix.dll $(DESTDIR)$(BINDIR)/@WIN_PREFIX@pcreposix.dll + $(INSTALL) .libs/@WIN_PREFIX@libpcreposix.dll.a $(DESTDIR)$(LIBDIR)/@WIN_PREFIX@libpcreposix.dll.a + $(INSTALL) .libs/@WIN_PREFIX@libpcre.dll.a $(DESTDIR)$(LIBDIR)/@WIN_PREFIX@libpcre.dll.a +@HAVE_CPP@ $(INSTALL) .libs/@WIN_PREFIX@pcrecpp.dll $(DESTDIR)$(BINDIR)/@WIN_PREFIX@pcrecpp.dll +@HAVE_CPP@ $(INSTALL) .libs/@WIN_PREFIX@libpcrecpp.dll.a $(DESTDIR)$(LIBDIR)/@WIN_PREFIX@libpcrecpp.dll.a + -strip -g $(DESTDIR)$(BINDIR)/@WIN_PREFIX@pcre.dll + -strip -g $(DESTDIR)$(BINDIR)/@WIN_PREFIX@pcreposix.dll +@HAVE_CPP@ -strip -g $(DESTDIR)$(BINDIR)/@WIN_PREFIX@pcrecpp.dll + -strip $(DESTDIR)$(BINDIR)/pcregrep@EXEEXT@ + -strip $(DESTDIR)$(BINDIR)/pcretest@EXEEXT@ + +# An auxiliary program makes the default character table source. This is put +# in the current directory, NOT the $top_srcdir directory. + +pcre_chartables.c: dftables@BUILD_EXEEXT@ + ./dftables@BUILD_EXEEXT@ pcre_chartables.c + +dftables.@BUILD_OBJEXT@: $(top_srcdir)/dftables.c \ + $(top_srcdir)/pcre_maketables.c $(top_srcdir)/pcre_internal.h \ + pcre.h config.h Makefile + $(CC_FOR_BUILD) -c $(CFLAGS_FOR_BUILD) -I. $(top_srcdir)/dftables.c + +dftables@BUILD_EXEEXT@: dftables.@BUILD_OBJEXT@ + $(LINK_FOR_BUILD) -o dftables@BUILD_EXEEXT@ dftables.@OBJEXT@ + +install: all @ON_WINDOWS@ wininstall +@NOT_ON_WINDOWS@ $(mkinstalldirs) $(DESTDIR)$(LIBDIR) +@NOT_ON_WINDOWS@ echo "$(LIBTOOL) --mode=install $(INSTALL) libpcre.la $(DESTDIR)$(LIBDIR)/libpcre.la" +@NOT_ON_WINDOWS@ $(LIBTOOL) --mode=install $(INSTALL) libpcre.la $(DESTDIR)$(LIBDIR)/libpcre.la +@NOT_ON_WINDOWS@ echo "$(LIBTOOL) --mode=install $(INSTALL) libpcreposix.la $(DESTDIR)$(LIBDIR)/libpcreposix.la" +@NOT_ON_WINDOWS@ $(LIBTOOL) --mode=install $(INSTALL) libpcreposix.la $(DESTDIR)$(LIBDIR)/libpcreposix.la +@NOT_ON_WINDOWS@@HAVE_CPP@ echo "$(LIBTOOL) --mode=install $(INSTALL) libpcrecpp.la $(DESTDIR)$(LIBDIR)/libpcrecpp.la" +@NOT_ON_WINDOWS@@HAVE_CPP@ $(LIBTOOL) --mode=install $(INSTALL) libpcrecpp.la $(DESTDIR)$(LIBDIR)/libpcrecpp.la +@NOT_ON_WINDOWS@ $(LIBTOOL) --finish $(DESTDIR)$(LIBDIR) + $(mkinstalldirs) $(DESTDIR)$(INCDIR) + $(INSTALL_DATA) pcre.h $(DESTDIR)$(INCDIR)/pcre.h + $(INSTALL_DATA) $(top_srcdir)/pcreposix.h $(DESTDIR)$(INCDIR)/pcreposix.h +@HAVE_CPP@ $(INSTALL_DATA) pcrecpp.h $(DESTDIR)$(INCDIR)/pcrecpp.h +@HAVE_CPP@ $(INSTALL_DATA) pcre_stringpiece.h $(DESTDIR)$(INCDIR)/pcre_stringpiece.h +@HAVE_CPP@ $(INSTALL_DATA) $(top_srcdir)/pcre_scanner.h $(DESTDIR)$(INCDIR)/pcre_scanner.h + $(mkinstalldirs) $(DESTDIR)$(MANDIR)/man3 + $(INSTALL_DATA) $(top_srcdir)/doc/pcre.3 $(DESTDIR)$(MANDIR)/man3/pcre.3 + $(INSTALL_DATA) $(top_srcdir)/doc/pcreapi.3 $(DESTDIR)$(MANDIR)/man3/pcreapi.3 + $(INSTALL_DATA) $(top_srcdir)/doc/pcrebuild.3 $(DESTDIR)$(MANDIR)/man3/pcrebuild.3 + $(INSTALL_DATA) $(top_srcdir)/doc/pcrecallout.3 $(DESTDIR)$(MANDIR)/man3/pcrecallout.3 + $(INSTALL_DATA) $(top_srcdir)/doc/pcrecompat.3 $(DESTDIR)$(MANDIR)/man3/pcrecompat.3 +@HAVE_CPP@ $(INSTALL_DATA) $(top_srcdir)/doc/pcrecpp.3 $(DESTDIR)$(MANDIR)/man3/pcrecpp.3 + $(INSTALL_DATA) $(top_srcdir)/doc/pcrematching.3 $(DESTDIR)$(MANDIR)/man3/pcrematching.3 + $(INSTALL_DATA) $(top_srcdir)/doc/pcrepattern.3 $(DESTDIR)$(MANDIR)/man3/pcrepattern.3 + $(INSTALL_DATA) $(top_srcdir)/doc/pcreperform.3 $(DESTDIR)$(MANDIR)/man3/pcreperform.3 + $(INSTALL_DATA) $(top_srcdir)/doc/pcreposix.3 $(DESTDIR)$(MANDIR)/man3/pcreposix.3 + $(INSTALL_DATA) $(top_srcdir)/doc/pcresample.3 $(DESTDIR)$(MANDIR)/man3/pcresample.3 + $(INSTALL_DATA) $(top_srcdir)/doc/pcre_compile.3 $(DESTDIR)$(MANDIR)/man3/pcre_compile.3 + $(INSTALL_DATA) $(top_srcdir)/doc/pcre_config.3 $(DESTDIR)$(MANDIR)/man3/pcre_config.3 + $(INSTALL_DATA) $(top_srcdir)/doc/pcre_copy_named_substring.3 $(DESTDIR)$(MANDIR)/man3/pcre_copy_named_substring.3 + $(INSTALL_DATA) $(top_srcdir)/doc/pcre_copy_substring.3 $(DESTDIR)$(MANDIR)/man3/pcre_copy_substring.3 + $(INSTALL_DATA) $(top_srcdir)/doc/pcre_dfa_exec.3 $(DESTDIR)$(MANDIR)/man3/pcre_dfa_exec.3 + $(INSTALL_DATA) $(top_srcdir)/doc/pcre_exec.3 $(DESTDIR)$(MANDIR)/man3/pcre_exec.3 + $(INSTALL_DATA) $(top_srcdir)/doc/pcre_free_substring.3 $(DESTDIR)$(MANDIR)/man3/pcre_free_substring.3 + $(INSTALL_DATA) $(top_srcdir)/doc/pcre_free_substring_list.3 $(DESTDIR)$(MANDIR)/man3/pcre_free_substring_list.3 + $(INSTALL_DATA) $(top_srcdir)/doc/pcre_fullinfo.3 $(DESTDIR)$(MANDIR)/man3/pcre_fullinfo.3 + $(INSTALL_DATA) $(top_srcdir)/doc/pcre_get_named_substring.3 $(DESTDIR)$(MANDIR)/man3/pcre_get_named_substring.3 + $(INSTALL_DATA) $(top_srcdir)/doc/pcre_get_stringnumber.3 $(DESTDIR)$(MANDIR)/man3/pcre_get_stringnumber.3 + $(INSTALL_DATA) $(top_srcdir)/doc/pcre_get_substring.3 $(DESTDIR)$(MANDIR)/man3/pcre_get_substring.3 + $(INSTALL_DATA) $(top_srcdir)/doc/pcre_get_substring_list.3 $(DESTDIR)$(MANDIR)/man3/pcre_get_substring_list.3 + $(INSTALL_DATA) $(top_srcdir)/doc/pcre_info.3 $(DESTDIR)$(MANDIR)/man3/pcre_info.3 + $(INSTALL_DATA) $(top_srcdir)/doc/pcre_maketables.3 $(DESTDIR)$(MANDIR)/man3/pcre_maketables.3 + $(INSTALL_DATA) $(top_srcdir)/doc/pcre_refcount.3 $(DESTDIR)$(MANDIR)/man3/pcre_refcount.3 + $(INSTALL_DATA) $(top_srcdir)/doc/pcre_study.3 $(DESTDIR)$(MANDIR)/man3/pcre_study.3 + $(INSTALL_DATA) $(top_srcdir)/doc/pcre_version.3 $(DESTDIR)$(MANDIR)/man3/pcre_version.3 + $(mkinstalldirs) $(DESTDIR)$(MANDIR)/man1 + $(INSTALL_DATA) $(top_srcdir)/doc/pcregrep.1 $(DESTDIR)$(MANDIR)/man1/pcregrep.1 + $(INSTALL_DATA) $(top_srcdir)/doc/pcretest.1 $(DESTDIR)$(MANDIR)/man1/pcretest.1 + $(mkinstalldirs) $(DESTDIR)$(BINDIR) + $(LIBTOOL) --mode=install $(INSTALL) pcregrep@EXEEXT@ $(DESTDIR)$(BINDIR)/pcregrep@EXEEXT@ + $(LIBTOOL) --mode=install $(INSTALL) pcretest@EXEEXT@ $(DESTDIR)$(BINDIR)/pcretest@EXEEXT@ + $(INSTALL) pcre-config $(DESTDIR)$(BINDIR)/pcre-config + $(mkinstalldirs) $(DESTDIR)$(LIBDIR)/pkgconfig + $(INSTALL_DATA) libpcre.pc $(DESTDIR)$(LIBDIR)/pkgconfig/libpcre.pc + +# The uninstall target removes all the files that were installed. + +uninstall:; -rm -rf \ + $(DESTDIR)$(LIBDIR)/libpcre.* \ + $(DESTDIR)$(LIBDIR)/libpcreposix.* \ + $(DESTDIR)$(LIBDIR)/libpcrecpp.* \ + $(DESTDIR)$(INCDIR)/pcre.h \ + $(DESTDIR)$(INCDIR)/pcreposix.h \ + $(DESTDIR)$(INCDIR)/pcrecpp.h \ + $(DESTDIR)$(INCDIR)/pcre_scanner.h \ + $(DESTDIR)$(INCDIR)/pcre_stringpiece.h \ + $(DESTDIR)$(MANDIR)/man3/pcre.3 \ + $(DESTDIR)$(MANDIR)/man3/pcreapi.3 \ + $(DESTDIR)$(MANDIR)/man3/pcrebuild.3 \ + $(DESTDIR)$(MANDIR)/man3/pcrecallout.3 \ + $(DESTDIR)$(MANDIR)/man3/pcrecompat.3 \ + $(DESTDIR)$(MANDIR)/man3/pcrecpp.3 \ + $(DESTDIR)$(MANDIR)/man3/pcrematching.3 \ + $(DESTDIR)$(MANDIR)/man3/pcrepattern.3 \ + $(DESTDIR)$(MANDIR)/man3/pcreperform.3 \ + $(DESTDIR)$(MANDIR)/man3/pcreposix.3 \ + $(DESTDIR)$(MANDIR)/man3/pcresample.3 \ + $(DESTDIR)$(MANDIR)/man3/pcre_compile.3 \ + $(DESTDIR)$(MANDIR)/man3/pcre_config.3 \ + $(DESTDIR)$(MANDIR)/man3/pcre_copy_named_substring.3 \ + $(DESTDIR)$(MANDIR)/man3/pcre_copy_substring.3 \ + $(DESTDIR)$(MANDIR)/man3/pcre_dfa_exec.3 \ + $(DESTDIR)$(MANDIR)/man3/pcre_exec.3 \ + $(DESTDIR)$(MANDIR)/man3/pcre_free_substring.3 \ + $(DESTDIR)$(MANDIR)/man3/pcre_free_substring_list.3 \ + $(DESTDIR)$(MANDIR)/man3/pcre_fullinfo.3 \ + $(DESTDIR)$(MANDIR)/man3/pcre_get_named_substring.3 \ + $(DESTDIR)$(MANDIR)/man3/pcre_get_stringnumber.3 \ + $(DESTDIR)$(MANDIR)/man3/pcre_get_substring.3 \ + $(DESTDIR)$(MANDIR)/man3/pcre_get_substring_list.3 \ + $(DESTDIR)$(MANDIR)/man3/pcre_info.3 \ + $(DESTDIR)$(MANDIR)/man3/pcre_maketables.3 \ + $(DESTDIR)$(MANDIR)/man3/pcre_refcount.3 \ + $(DESTDIR)$(MANDIR)/man3/pcre_study.3 \ + $(DESTDIR)$(MANDIR)/man3/pcre_version.3 \ + $(DESTDIR)$(MANDIR)/man1/pcregrep.1 \ + $(DESTDIR)$(MANDIR)/man1/pcretest.1 \ + $(DESTDIR)$(BINDIR)/pcregrep@EXEEXT@ \ + $(DESTDIR)$(BINDIR)/pcretest@EXEEXT@ \ + $(DESTDIR)$(BINDIR)/pcre-config \ + $(DESTDIR)$(LIBDIR)/pkgconfig/libpcre.pc + +# We deliberately omit dftables and pcre_chartables.c from 'make clean'; once +# made pcre_chartables.c shouldn't change, and if people have edited the tables +# by hand, you don't want to throw them away. + +clean:; -rm -rf *.@OBJEXT@ *.lo *.a *.la .libs pcretest@EXEEXT@ pcre_stringpiece_unittest@EXEEXT@ pcrecpp_unittest@EXEEXT@ pcre_scanner_unittest@EXEEXT@ pcregrep@EXEEXT@ testtry + +# But "make distclean" should get back to a virgin distribution + +distclean: clean + -rm -f pcre_chartables.c libtool pcre-config libpcre.pc \ + pcre.h pcre_stringpiece.h pcrecpp.h \ + dftables@EXEEXT@ RunGrepTest RunTest \ + Makefile config.h config.status config.log config.cache + +check: runtest + +@WIN_PREFIX@pcre.dll : winshared + cp .libs/@WIN_PREFIX@pcre.dll . + +test: runtest + +runtest: all @ON_WINDOWS@ @WIN_PREFIX@pcre.dll + @./RunTest + @./RunGrepTest +@HAVE_CPP@ @echo "" +@HAVE_CPP@ @echo "Testing C++ wrapper" +@HAVE_CPP@ @echo ""; echo "Test 1++: stringpiece" +@HAVE_CPP@ @./pcre_stringpiece_unittest@EXEEXT@ +@HAVE_CPP@ @echo ""; echo "Test 2++: RE class" +@HAVE_CPP@ @./pcrecpp_unittest@EXEEXT@ +@HAVE_CPP@ @echo ""; echo "Test 3++: Scanner class" +@HAVE_CPP@ @./pcre_scanner_unittest@EXEEXT@ + +# End diff --git a/mozilla/js/tamarin/pcre/NEWS b/mozilla/js/tamarin/pcre/NEWS new file mode 100644 index 00000000000..a6113e08996 --- /dev/null +++ b/mozilla/js/tamarin/pcre/NEWS @@ -0,0 +1,233 @@ +News about PCRE releases +------------------------ + +Release 6.0 07-Jun-05 +--------------------- + +The release number has been increased to 6.0 because of the addition of several +major new pieces of functionality. + +A new function, pcre_dfa_exec(), which implements pattern matching using a DFA +algorithm, has been added. This has a number of advantages for certain cases, +though it does run more slowly, and lacks the ability to capture substrings. On +the other hand, it does find all matches, not just the first, and it works +better for partial matching. The pcrematching man page discusses the +differences. + +The pcretest program has been enhanced so that it can make use of the new +pcre_dfa_exec() matching function and the extra features it provides. + +The distribution now includes a C++ wrapper library. This is built +automatically if a C++ compiler is found. The pcrecpp man page discusses this +interface. + +The code itself has been re-organized into many more files, one for each +function, so it no longer requires everything to be linked in when static +linkage is used. As a consequence, some internal functions have had to have +their names exposed. These functions all have names starting with _pcre_. They +are undocumented, and are not intended for use by outside callers. + +The pcregrep program has been enhanced with new functionality such as +multiline-matching and options for output more matching context. See the +ChangeLog for a complete list of changes to the library and the utility +programs. + + +Release 5.0 13-Sep-04 +--------------------- + +The licence under which PCRE is released has been changed to the more +conventional "BSD" licence. + +In the code, some bugs have been fixed, and there are also some major changes +in this release (which is why I've increased the number to 5.0). Some changes +are internal rearrangements, and some provide a number of new facilities. The +new features are: + +1. There's an "automatic callout" feature that inserts callouts before every + item in the regex, and there's a new callout field that gives the position + in the pattern - useful for debugging and tracing. + +2. The extra_data structure can now be used to pass in a set of character + tables at exec time. This is useful if compiled regex are saved and re-used + at a later time when the tables may not be at the same address. If the + default internal tables are used, the pointer saved with the compiled + pattern is now set to NULL, which means that you don't need to do anything + special unless you are using custom tables. + +3. It is possible, with some restrictions on the content of the regex, to + request "partial" matching. A special return code is given if all of the + subject string matched part of the regex. This could be useful for testing + an input field as it is being typed. + +4. There is now some optional support for Unicode character properties, which + means that the patterns items such as \p{Lu} and \X can now be used. Only + the general category properties are supported. If PCRE is compiled with this + support, an additional 90K data structure is include, which increases the + size of the library dramatically. + +5. There is support for saving compiled patterns and re-using them later. + +6. There is support for running regular expressions that were compiled on a + different host with the opposite endianness. + +7. The pcretest program has been extended to accommodate the new features. + +The main internal rearrangement is that sequences of literal characters are no +longer handled as strings. Instead, each character is handled on its own. This +makes some UTF-8 handling easier, and makes the support of partial matching +possible. Compiled patterns containing long literal strings will be larger as a +result of this change; I hope that performance will not be much affected. + + +Release 4.5 01-Dec-03 +--------------------- + +Again mainly a bug-fix and tidying release, with only a couple of new features: + +1. It's possible now to compile PCRE so that it does not use recursive +function calls when matching. Instead it gets memory from the heap. This slows +things down, but may be necessary on systems with limited stacks. + +2. UTF-8 string checking has been tightened to reject overlong sequences and to +check that a starting offset points to the start of a character. Failure of the +latter returns a new error code: PCRE_ERROR_BADUTF8_OFFSET. + +3. PCRE can now be compiled for systems that use EBCDIC code. + + +Release 4.4 21-Aug-03 +--------------------- + +This is mainly a bug-fix and tidying release. The only new feature is that PCRE +checks UTF-8 strings for validity by default. There is an option to suppress +this, just in case anybody wants that teeny extra bit of performance. + + +Releases 4.1 - 4.3 +------------------ + +Sorry, I forgot about updating the NEWS file for these releases. Please take a +look at ChangeLog. + + +Release 4.0 17-Feb-03 +--------------------- + +There have been a lot of changes for the 4.0 release, adding additional +functionality and mending bugs. Below is a list of the highlights of the new +functionality. For full details of these features, please consult the +documentation. For a complete list of changes, see the ChangeLog file. + +1. Support for Perl's \Q...\E escapes. + +2. "Possessive quantifiers" ?+, *+, ++, and {,}+ which come from Sun's Java +package. They provide some syntactic sugar for simple cases of "atomic +grouping". + +3. Support for the \G assertion. It is true when the current matching position +is at the start point of the match. + +4. A new feature that provides some of the functionality that Perl provides +with (?{...}). The facility is termed a "callout". The way it is done in PCRE +is for the caller to provide an optional function, by setting pcre_callout to +its entry point. To get the function called, the regex must include (?C) at +appropriate points. + +5. Support for recursive calls to individual subpatterns. This makes it really +easy to get totally confused. + +6. Support for named subpatterns. The Python syntax (?P...) is used to +name a group. + +7. Several extensions to UTF-8 support; it is now fairly complete. There is an +option for pcregrep to make it operate in UTF-8 mode. + +8. The single man page has been split into a number of separate man pages. +These also give rise to individual HTML pages which are put in a separate +directory. There is an index.html page that lists them all. Some hyperlinking +between the pages has been installed. + + +Release 3.5 15-Aug-01 +--------------------- + +1. The configuring system has been upgraded to use later versions of autoconf +and libtool. By default it builds both a shared and a static library if the OS +supports it. You can use --disable-shared or --disable-static on the configure +command if you want only one of them. + +2. The pcretest utility is now installed along with pcregrep because it is +useful for users (to test regexs) and by doing this, it automatically gets +relinked by libtool. The documentation has been turned into a man page, so +there are now .1, .txt, and .html versions in /doc. + +3. Upgrades to pcregrep: + (i) Added long-form option names like gnu grep. + (ii) Added --help to list all options with an explanatory phrase. + (iii) Added -r, --recursive to recurse into sub-directories. + (iv) Added -f, --file to read patterns from a file. + +4. Added --enable-newline-is-cr and --enable-newline-is-lf to the configure +script, to force use of CR or LF instead of \n in the source. On non-Unix +systems, the value can be set in config.h. + +5. The limit of 200 on non-capturing parentheses is a _nesting_ limit, not an +absolute limit. Changed the text of the error message to make this clear, and +likewise updated the man page. + +6. The limit of 99 on the number of capturing subpatterns has been removed. +The new limit is 65535, which I hope will not be a "real" limit. + + +Release 3.3 01-Aug-00 +--------------------- + +There is some support for UTF-8 character strings. This is incomplete and +experimental. The documentation describes what is and what is not implemented. +Otherwise, this is just a bug-fixing release. + + +Release 3.0 01-Feb-00 +--------------------- + +1. A "configure" script is now used to configure PCRE for Unix systems. It +builds a Makefile, a config.h file, and the pcre-config script. + +2. PCRE is built as a shared library by default. + +3. There is support for POSIX classes such as [:alpha:]. + +5. There is an experimental recursion feature. + +---------------------------------------------------------------------------- + IMPORTANT FOR THOSE UPGRADING FROM VERSIONS BEFORE 2.00 + +Please note that there has been a change in the API such that a larger +ovector is required at matching time, to provide some additional workspace. +The new man page has details. This change was necessary in order to support +some of the new functionality in Perl 5.005. + + IMPORTANT FOR THOSE UPGRADING FROM VERSION 2.00 + +Another (I hope this is the last!) change has been made to the API for the +pcre_compile() function. An additional argument has been added to make it +possible to pass over a pointer to character tables built in the current +locale by pcre_maketables(). To use the default tables, this new arguement +should be passed as NULL. + + IMPORTANT FOR THOSE UPGRADING FROM VERSION 2.05 + +Yet another (and again I hope this really is the last) change has been made +to the API for the pcre_exec() function. An additional argument has been +added to make it possible to start the match other than at the start of the +subject string. This is important if there are lookbehinds. The new man +page has the details, but you just want to convert existing programs, all +you need to do is to stick in a new fifth argument to pcre_exec(), with a +value of zero. For example, change + + pcre_exec(pattern, extra, subject, length, options, ovec, ovecsize) +to + pcre_exec(pattern, extra, subject, length, 0, options, ovec, ovecsize) + +**** diff --git a/mozilla/js/tamarin/pcre/NON-UNIX-USE b/mozilla/js/tamarin/pcre/NON-UNIX-USE new file mode 100644 index 00000000000..fc02ba1547e --- /dev/null +++ b/mozilla/js/tamarin/pcre/NON-UNIX-USE @@ -0,0 +1,277 @@ +Compiling PCRE on non-Unix systems +---------------------------------- + +See below for comments on Cygwin or MinGW and OpenVMS usage. I (Philip Hazel) +have no knowledge of Windows or VMS sytems and how their libraries work. The +items in the PCRE Makefile that relate to anything other than Unix-like systems +have been contributed by PCRE users. There are some other comments and files in +the Contrib directory on the ftp site that you may find useful. See + + ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/Contrib + +If you want to compile PCRE for a non-Unix system (or perhaps, more strictly, +for a system that does not support "configure" and "make" files), note that +PCRE consists entirely of code written in Standard C, and so should compile +successfully on any system that has a Standard C compiler and library. + + +GENERIC INSTRUCTIONS FOR THE C LIBRARY + +The following are generic comments about building PCRE. The interspersed +indented commands are suggestions from Mark Tetrode as to which commands you +might use on a Windows system to build a static library. + +(1) Copy or rename the file config.in as config.h, and change the macros that +define HAVE_STRERROR and HAVE_MEMMOVE to define them as 1 rather than 0. +Unfortunately, because of the way Unix autoconf works, the default setting has +to be 0. You may also want to make changes to other macros in config.h. In +particular, if you want to force a specific value for newline, you can define +the NEWLINE macro. The default is to use '\n', thereby using whatever value +your compiler gives to '\n'. + + rem Mark Tetrode's commands + copy config.in config.h + rem Use write, because notepad cannot handle UNIX files. Change values. + write config.h + +(2) Copy or rename the file pcre.in as pcre.h, and change the macro definitions +for PCRE_MAJOR, PCRE_MINOR, and PCRE_DATE near its start to the values set in +configure.in. + + rem Mark Tetrode's commands + copy pcre.in pcre.h + rem Read values from configure.in + write configure.in + rem Change values + write pcre.h + +(3) Compile dftables.c as a stand-alone program, and then run it with +the single argument "pcre_chartables.c". This generates a set of standard +character tables and writes them to that file. + + rem Mark Tetrode's commands + rem Compile & run + cl -DSUPPORT_UTF8 -DSUPPORT_UCP dftables.c + dftables.exe chartables.c + +(4) Compile the following source files: + + pcre_chartables.c + pcre_compile.c + pcre_config.c + pcre_dfa_exec.c + pcre_exec.c + pcre_fullinfo.c + pcre_get.c + pcre_globals.c + pcre_info.c + pcre_maketables.c + pcre_ord2utf8.c + pcre_printint.c + pcre_refcount.c + pcre_study.c + pcre_tables.c + pcre_try_flipped.c + pcre_ucp_findchar.c + pcre_valid_utf8.c + pcre_version.c + pcre_xclass.c + +and link them all together into an object library in whichever form your system +keeps such libraries. This is the pcre C library. If your system has static and +shared libraries, you may have to do this once for each type. + + rem These comments are out-of-date, referring to a previous release which + rem had fewer source files. Replace with the file names from above. + rem Mark Tetrode's commands, for a static library + rem Compile & lib + cl -DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10 /c maketables.c get.c study.c pcre.c + lib /OUT:pcre.lib maketables.obj get.obj study.obj pcre.obj + +(5) Similarly, compile pcreposix.c and link it (on its own) as the pcreposix +library. + + rem Mark Tetrode's commands, for a static library + rem Compile & lib + cl -DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10 /c pcreposix.c + lib /OUT:pcreposix.lib pcreposix.obj + +(6) Compile the test program pcretest.c. This needs the functions in the +pcre and pcreposix libraries when linking. + + rem Mark Tetrode's commands + rem compile & link + cl /F0x400000 pcretest.c pcre.lib pcreposix.lib + +(7) Run pcretest on the testinput files in the testdata directory, and check +that the output matches the corresponding testoutput files. You must use the +-i option when checking testinput2. Note that the supplied files are in Unix +format, with just LF characters as line terminators. You may need to edit them +to change this if your system uses a different convention. + + rem Mark Tetrode's commands + pcretest testdata\testinput1 testdata\myoutput1 + windiff testdata\testoutput1 testdata\myoutput1 + pcretest -i testdata\testinput2 testdata\myoutput2 + windiff testdata\testoutput2 testdata\myoutput2 + pcretest testdata\testinput3 testdata\myoutput3 + windiff testdata\testoutput3 testdata\myoutput3 + pcretest testdata\testinput4 testdata\myoutput4 + windiff testdata\testoutput4 testdata\myoutput4 + pcretest testdata\testinput5 testdata\myoutput5 + windiff testdata\testoutput5 testdata\myoutput5 + pcretest testdata\testinput6 testdata\myoutput6 + windiff testdata\testoutput6 testdata\myoutput6 + +Note that there are now three more tests (7, 8, 9) that did not exist when Mark +wrote those comments. The test the new pcre_dfa_exec() function. + + +THE C++ WRAPPER FUNCTIONS + +The PCRE distribution now contains some C++ wrapper functions and tests, +contributed by Google Inc. On a system that can use "configure" and "make", +the functions are automatically built into a library called pcrecpp. It should +be straightforward to compile the .cc files manually on other systems. The +files called xxx_unittest.cc are test programs for each of the corresponding +xxx.cc files. + + +FURTHER REMARKS + +If you have a system without "configure" but where you can use a Makefile, edit +Makefile.in to create Makefile, substituting suitable values for the variables +at the head of the file. + +Some help in building a Win32 DLL of PCRE in GnuWin32 environments was +contributed by Paul Sokolovsky. These environments are Mingw32 +(http://www.xraylith.wisc.edu/~khan/software/gnu-win32/) and CygWin +(http://sourceware.cygnus.com/cygwin/). Paul comments: + + For CygWin, set CFLAGS=-mno-cygwin, and do 'make dll'. You'll get + pcre.dll (containing pcreposix also), libpcre.dll.a, and dynamically + linked pgrep and pcretest. If you have /bin/sh, run RunTest (three + main test go ok, locale not supported). + +Changes to do MinGW with autoconf 2.50 were supplied by Fred Cox +, who comments as follows: + + If you are using the PCRE DLL, the normal Unix style configure && make && + make check && make install should just work[*]. If you want to statically + link against the .a file, you must define PCRE_STATIC before including + pcre.h, otherwise the pcre_malloc and pcre_free exported functions will be + declared __declspec(dllimport), with hilarious results. See the configure.in + and pcretest.c for how it is done for the static test. + + Also, there will only be a libpcre.la, not a libpcreposix.la, as you + would expect from the Unix version. The single DLL includes the pcreposix + interface. + +[*] But note that the supplied test files are in Unix format, with just LF +characters as line terminators. You will have to edit them to change to CR LF +terminators. + +A script for building PCRE using Borland's C++ compiler for use with VPASCAL +was contributed by Alexander Tokarev. It is called makevp.bat. + +These are some further comments about Win32 builds from Mark Evans. They +were contributed before Fred Cox's changes were made, so it is possible that +they may no longer be relevant. + +"The documentation for Win32 builds is a bit shy. Under MSVC6 I +followed their instructions to the letter, but there were still +some things missing. + +(1) Must #define STATIC for entire project if linking statically. + (I see no reason to use DLLs for code this compact.) This of + course is a project setting in MSVC under Preprocessor. + +(2) Missing some #ifdefs relating to the function pointers + pcre_malloc and pcre_free. See my solution below. (The stubs + may not be mandatory but they made me feel better.)" + +========================= +#ifdef _WIN32 +#include + +void* malloc_stub(size_t N) +{ return malloc(N); } +void free_stub(void* p) +{ free(p); } +void *(*pcre_malloc)(size_t) = &malloc_stub; +void (*pcre_free)(void *) = &free_stub; + +#else + +void *(*pcre_malloc)(size_t) = malloc; +void (*pcre_free)(void *) = free; + +#endif +========================= + + +BUILDING PCRE ON OPENVMS + +Dan Mooney sent the following comments about building PCRE on OpenVMS. They +relate to an older version of PCRE that used fewer source files, so the exact +commands will need changing. See the current list of source files above. + +"It was quite easy to compile and link the library. I don't have a formal +make file but the attached file [reproduced below] contains the OpenVMS DCL +commands I used to build the library. I had to add #define +POSIX_MALLOC_THRESHOLD 10 to pcre.h since it was not defined anywhere. + +The library was built on: +O/S: HP OpenVMS v7.3-1 +Compiler: Compaq C v6.5-001-48BCD +Linker: vA13-01 + +The test results did not match 100% due to the issues you mention in your +documentation regarding isprint(), iscntrl(), isgraph() and ispunct(). I +modified some of the character tables temporarily and was able to get the +results to match. Tests using the fr locale did not match since I don't have +that locale loaded. The study size was always reported to be 3 less than the +value in the standard test output files." + +========================= +$! This DCL procedure builds PCRE on OpenVMS +$! +$! I followed the instructions in the non-unix-use file in the distribution. +$! +$ COMPILE == "CC/LIST/NOMEMBER_ALIGNMENT/PREFIX_LIBRARY_ENTRIES=ALL_ENTRIES +$ COMPILE DFTABLES.C +$ LINK/EXE=DFTABLES.EXE DFTABLES.OBJ +$ RUN DFTABLES.EXE/OUTPUT=CHARTABLES.C +$ COMPILE MAKETABLES.C +$ COMPILE GET.C +$ COMPILE STUDY.C +$! I had to set POSIX_MALLOC_THRESHOLD to 10 in PCRE.H since the symbol +$! did not seem to be defined anywhere. +$! I edited pcre.h and added #DEFINE SUPPORT_UTF8 to enable UTF8 support. +$ COMPILE PCRE.C +$ LIB/CREATE PCRE MAKETABLES.OBJ, GET.OBJ, STUDY.OBJ, PCRE.OBJ +$! I had to set POSIX_MALLOC_THRESHOLD to 10 in PCRE.H since the symbol +$! did not seem to be defined anywhere. +$ COMPILE PCREPOSIX.C +$ LIB/CREATE PCREPOSIX PCREPOSIX.OBJ +$ COMPILE PCRETEST.C +$ LINK/EXE=PCRETEST.EXE PCRETEST.OBJ, PCRE/LIB, PCREPOSIX/LIB +$! C programs that want access to command line arguments must be +$! defined as a symbol +$ PCRETEST :== "$ SYS$ROADSUSERS:[DMOONEY.REGEXP]PCRETEST.EXE" +$! Arguments must be enclosed in quotes. +$ PCRETEST "-C" +$! Test results: +$! +$! The test results did not match 100%. The functions isprint(), iscntrl(), +$! isgraph() and ispunct() on OpenVMS must not produce the same results +$! as the system that built the test output files provided with the +$! distribution. +$! +$! The study size did not match and was always 3 less on OpenVMS. +$! +$! Locale could not be set to fr +$! +========================= + +**** diff --git a/mozilla/js/tamarin/pcre/README b/mozilla/js/tamarin/pcre/README new file mode 100644 index 00000000000..2ede6fc2e18 --- /dev/null +++ b/mozilla/js/tamarin/pcre/README @@ -0,0 +1,494 @@ +README file for PCRE (Perl-compatible regular expression library) +----------------------------------------------------------------- + +The latest release of PCRE is always available from + + ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-xxx.tar.gz + +Please read the NEWS file if you are upgrading from a previous release. + + +The PCRE APIs +------------- + +PCRE is written in C, and it has its own API. The distribution now includes a +set of C++ wrapper functions, courtesy of Google Inc. (see the pcrecpp man page +for details). + +Also included are a set of C wrapper functions that are based on the POSIX +API. These end up in the library called libpcreposix. Note that this just +provides a POSIX calling interface to PCRE: the regular expressions themselves +still follow Perl syntax and semantics. The header file for the POSIX-style +functions is called pcreposix.h. The official POSIX name is regex.h, but I +didn't want to risk possible problems with existing files of that name by +distributing it that way. To use it with an existing program that uses the +POSIX API, it will have to be renamed or pointed at by a link. + +If you are using the POSIX interface to PCRE and there is already a POSIX regex +library installed on your system, you must take care when linking programs to +ensure that they link with PCRE's libpcreposix library. Otherwise they may pick +up the "real" POSIX functions of the same name. + + +Documentation for PCRE +---------------------- + +If you install PCRE in the normal way, you will end up with an installed set of +man pages whose names all start with "pcre". The one that is called "pcre" +lists all the others. In addition to these man pages, the PCRE documentation is +supplied in two other forms; however, as there is no standard place to install +them, they are left in the doc directory of the unpacked source distribution. +These forms are: + + 1. Files called doc/pcre.txt, doc/pcregrep.txt, and doc/pcretest.txt. The + first of these is a concatenation of the text forms of all the section 3 + man pages except those that summarize individual functions. The other two + are the text forms of the section 1 man pages for the pcregrep and + pcretest commands. Text forms are provided for ease of scanning with text + editors or similar tools. + + 2. A subdirectory called doc/html contains all the documentation in HTML + form, hyperlinked in various ways, and rooted in a file called + doc/index.html. + + +Contributions by users of PCRE +------------------------------ + +You can find contributions from PCRE users in the directory + + ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/Contrib + +where there is also a README file giving brief descriptions of what they are. +Several of them provide support for compiling PCRE on various flavours of +Windows systems (I myself do not use Windows). Some are complete in themselves; +others are pointers to URLs containing relevant files. + + +Building PCRE on a Unix-like system +----------------------------------- + +To build PCRE on a Unix-like system, first run the "configure" command from the +PCRE distribution directory, with your current directory set to the directory +where you want the files to be created. This command is a standard GNU +"autoconf" configuration script, for which generic instructions are supplied in +INSTALL. + +Most commonly, people build PCRE within its own distribution directory, and in +this case, on many systems, just running "./configure" is sufficient, but the +usual methods of changing standard defaults are available. For example: + +CFLAGS='-O2 -Wall' ./configure --prefix=/opt/local + +specifies that the C compiler should be run with the flags '-O2 -Wall' instead +of the default, and that "make install" should install PCRE under /opt/local +instead of the default /usr/local. + +If you want to build in a different directory, just run "configure" with that +directory as current. For example, suppose you have unpacked the PCRE source +into /source/pcre/pcre-xxx, but you want to build it in /build/pcre/pcre-xxx: + +cd /build/pcre/pcre-xxx +/source/pcre/pcre-xxx/configure + +There are some optional features that can be included or omitted from the PCRE +library. You can read more about them in the pcrebuild man page. + +. If you want to suppress the building of the C++ wrapper library, you can add + --disable-cpp to the "configure" command. Otherwise, when "configure" is run, + will try to find a C++ compiler and C++ header files, and if it succeeds, it + will try to build the C++ wrapper. + +. If you want to make use of the support for UTF-8 character strings in PCRE, + you must add --enable-utf8 to the "configure" command. Without it, the code + for handling UTF-8 is not included in the library. (Even when included, it + still has to be enabled by an option at run time.) + +. If, in addition to support for UTF-8 character strings, you want to include + support for the \P, \p, and \X sequences that recognize Unicode character + properties, you must add --enable-unicode-properties to the "configure" + command. This adds about 90K to the size of the library (in the form of a + property table); only the basic two-letter properties such as Lu are + supported. + +. You can build PCRE to recognized CR or NL as the newline character, instead + of whatever your compiler uses for "\n", by adding --newline-is-cr or + --newline-is-nl to the "configure" command, respectively. Only do this if you + really understand what you are doing. On traditional Unix-like systems, the + newline character is NL. + +. When called via the POSIX interface, PCRE uses malloc() to get additional + storage for processing capturing parentheses if there are more than 10 of + them. You can increase this threshold by setting, for example, + + --with-posix-malloc-threshold=20 + + on the "configure" command. + +. PCRE has a counter that can be set to limit the amount of resources it uses. + If the limit is exceeded during a match, the match fails. The default is ten + million. You can change the default by setting, for example, + + --with-match-limit=500000 + + on the "configure" command. This is just the default; individual calls to + pcre_exec() can supply their own value. There is discussion on the pcreapi + man page. + +. The default maximum compiled pattern size is around 64K. You can increase + this by adding --with-link-size=3 to the "configure" command. You can + increase it even more by setting --with-link-size=4, but this is unlikely + ever to be necessary. If you build PCRE with an increased link size, test 2 + (and 5 if you are using UTF-8) will fail. Part of the output of these tests + is a representation of the compiled pattern, and this changes with the link + size. + +. You can build PCRE so that its internal match() function that is called from + pcre_exec() does not call itself recursively. Instead, it uses blocks of data + from the heap via special functions pcre_stack_malloc() and pcre_stack_free() + to save data that would otherwise be saved on the stack. To build PCRE like + this, use + + --disable-stack-for-recursion + + on the "configure" command. PCRE runs more slowly in this mode, but it may be + necessary in environments with limited stack sizes. This applies only to the + pcre_exec() function; it does not apply to pcre_dfa_exec(), which does not + use deeply nested recursion. + +The "configure" script builds eight files for the basic C library: + +. pcre.h is the header file for C programs that call PCRE +. Makefile is the makefile that builds the library +. config.h contains build-time configuration options for the library +. pcre-config is a script that shows the settings of "configure" options +. libpcre.pc is data for the pkg-config command +. libtool is a script that builds shared and/or static libraries +. RunTest is a script for running tests on the library +. RunGrepTest is a script for running tests on the pcregrep command + +In addition, if a C++ compiler is found, the following are also built: + +. pcrecpp.h is the header file for programs that call PCRE via the C++ wrapper +. pcre_stringpiece.h is the header for the C++ "stringpiece" functions + +The "configure" script also creates config.status, which is an executable +script that can be run to recreate the configuration, and config.log, which +contains compiler output from tests that "configure" runs. + +Once "configure" has run, you can run "make". It builds two libraries, called +libpcre and libpcreposix, a test program called pcretest, and the pcregrep +command. If a C++ compiler was found on your system, it also builds the C++ +wrapper library, which is called libpcrecpp, and some test programs called +pcrecpp_unittest, pcre_scanner_unittest, and pcre_stringpiece_unittest. + +The command "make test" runs all the appropriate tests. Details of the PCRE +tests are given in a separate section of this document, below. + +You can use "make install" to copy the libraries, the public header files +pcre.h, pcreposix.h, pcrecpp.h, and pcre_stringpiece.h (the last two only if +the C++ wrapper was built), and the man pages to appropriate live directories +on your system, in the normal way. + +If you want to remove PCRE from your system, you can run "make uninstall". +This removes all the files that "make install" installed. However, it does not +remove any directories, because these are often shared with other programs. + + +Retrieving configuration information on Unix-like systems +--------------------------------------------------------- + +Running "make install" also installs the command pcre-config, which can be used +to recall information about the PCRE configuration and installation. For +example: + + pcre-config --version + +prints the version number, and + + pcre-config --libs + +outputs information about where the library is installed. This command can be +included in makefiles for programs that use PCRE, saving the programmer from +having to remember too many details. + +The pkg-config command is another system for saving and retrieving information +about installed libraries. Instead of separate commands for each library, a +single command is used. For example: + + pkg-config --cflags pcre + +The data is held in *.pc files that are installed in a directory called +pkgconfig. + + +Shared libraries on Unix-like systems +------------------------------------- + +The default distribution builds PCRE as shared libraries and static libraries, +as long as the operating system supports shared libraries. Shared library +support relies on the "libtool" script which is built as part of the +"configure" process. + +The libtool script is used to compile and link both shared and static +libraries. They are placed in a subdirectory called .libs when they are newly +built. The programs pcretest and pcregrep are built to use these uninstalled +libraries (by means of wrapper scripts in the case of shared libraries). When +you use "make install" to install shared libraries, pcregrep and pcretest are +automatically re-built to use the newly installed shared libraries before being +installed themselves. However, the versions left in the source directory still +use the uninstalled libraries. + +To build PCRE using static libraries only you must use --disable-shared when +configuring it. For example: + +./configure --prefix=/usr/gnu --disable-shared + +Then run "make" in the usual way. Similarly, you can use --disable-static to +build only shared libraries. + + +Cross-compiling on a Unix-like system +------------------------------------- + +You can specify CC and CFLAGS in the normal way to the "configure" command, in +order to cross-compile PCRE for some other host. However, during the building +process, the dftables.c source file is compiled *and run* on the local host, in +order to generate the default character tables (the chartables.c file). It +therefore needs to be compiled with the local compiler, not the cross compiler. +You can do this by specifying CC_FOR_BUILD (and if necessary CFLAGS_FOR_BUILD; +there are also CXX_FOR_BUILD and CXXFLAGS_FOR_BUILD for the C++ wrapper) +when calling the "configure" command. If they are not specified, they default +to the values of CC and CFLAGS. + + +Building on non-Unix systems +---------------------------- + +For a non-Unix system, read the comments in the file NON-UNIX-USE, though if +the system supports the use of "configure" and "make" you may be able to build +PCRE in the same way as for Unix systems. + +PCRE has been compiled on Windows systems and on Macintoshes, but I don't know +the details because I don't use those systems. It should be straightforward to +build PCRE on any system that has a Standard C compiler, because it uses only +Standard C functions. + + +Testing PCRE +------------ + +To test PCRE on a Unix system, run the RunTest script that is created by the +configuring process. There is also a script called RunGrepTest that tests the +options of the pcregrep command. If the C++ wrapper library is build, three +test programs called pcrecpp_unittest, pcre_scanner_unittest, and +pcre_stringpiece_unittest are provided. + +Both the scripts and all the program tests are run if you obey "make runtest", +"make check", or "make test". For other systems, see the instructions in +NON-UNIX-USE. + +The RunTest script runs the pcretest test program (which is documented in its +own man page) on each of the testinput files (in the testdata directory) in +turn, and compares the output with the contents of the corresponding testoutput +file. A file called testtry is used to hold the main output from pcretest +(testsavedregex is also used as a working file). To run pcretest on just one of +the test files, give its number as an argument to RunTest, for example: + + RunTest 2 + +The first file can also be fed directly into the perltest script to check that +Perl gives the same results. The only difference you should see is in the first +few lines, where the Perl version is given instead of the PCRE version. + +The second set of tests check pcre_fullinfo(), pcre_info(), pcre_study(), +pcre_copy_substring(), pcre_get_substring(), pcre_get_substring_list(), error +detection, and run-time flags that are specific to PCRE, as well as the POSIX +wrapper API. It also uses the debugging flag to check some of the internals of +pcre_compile(). + +If you build PCRE with a locale setting that is not the standard C locale, the +character tables may be different (see next paragraph). In some cases, this may +cause failures in the second set of tests. For example, in a locale where the +isprint() function yields TRUE for characters in the range 128-255, the use of +[:isascii:] inside a character class defines a different set of characters, and +this shows up in this test as a difference in the compiled code, which is being +listed for checking. Where the comparison test output contains [\x00-\x7f] the +test will contain [\x00-\xff], and similarly in some other cases. This is not a +bug in PCRE. + +The third set of tests checks pcre_maketables(), the facility for building a +set of character tables for a specific locale and using them instead of the +default tables. The tests make use of the "fr_FR" (French) locale. Before +running the test, the script checks for the presence of this locale by running +the "locale" command. If that command fails, or if it doesn't include "fr_FR" +in the list of available locales, the third test cannot be run, and a comment +is output to say why. If running this test produces instances of the error + + ** Failed to set locale "fr_FR" + +in the comparison output, it means that locale is not available on your system, +despite being listed by "locale". This does not mean that PCRE is broken. + +The fourth test checks the UTF-8 support. It is not run automatically unless +PCRE is built with UTF-8 support. To do this you must set --enable-utf8 when +running "configure". This file can be also fed directly to the perltest script, +provided you are running Perl 5.8 or higher. (For Perl 5.6, a small patch, +commented in the script, can be be used.) + +The fifth test checks error handling with UTF-8 encoding, and internal UTF-8 +features of PCRE that are not relevant to Perl. + +The sixth and test checks the support for Unicode character properties. It it +not run automatically unless PCRE is built with Unicode property support. To to +this you must set --enable-unicode-properties when running "configure". + +The seventh, eighth, and ninth tests check the pcre_dfa_exec() alternative +matching function, in non-UTF-8 mode, UTF-8 mode, and UTF-8 mode with Unicode +property support, respectively. The eighth and ninth tests are not run +automatically unless PCRE is build with the relevant support. + + +Character tables +---------------- + +PCRE uses four tables for manipulating and identifying characters whose values +are less than 256. The final argument of the pcre_compile() function is a +pointer to a block of memory containing the concatenated tables. A call to +pcre_maketables() can be used to generate a set of tables in the current +locale. If the final argument for pcre_compile() is passed as NULL, a set of +default tables that is built into the binary is used. + +The source file called chartables.c contains the default set of tables. This is +not supplied in the distribution, but is built by the program dftables +(compiled from dftables.c), which uses the ANSI C character handling functions +such as isalnum(), isalpha(), isupper(), islower(), etc. to build the table +sources. This means that the default C locale which is set for your system will +control the contents of these default tables. You can change the default tables +by editing chartables.c and then re-building PCRE. If you do this, you should +probably also edit Makefile to ensure that the file doesn't ever get +re-generated. + +The first two 256-byte tables provide lower casing and case flipping functions, +respectively. The next table consists of three 32-byte bit maps which identify +digits, "word" characters, and white space, respectively. These are used when +building 32-byte bit maps that represent character classes. + +The final 256-byte table has bits indicating various character types, as +follows: + + 1 white space character + 2 letter + 4 decimal digit + 8 hexadecimal digit + 16 alphanumeric or '_' + 128 regular expression metacharacter or binary zero + +You should not alter the set of characters that contain the 128 bit, as that +will cause PCRE to malfunction. + + +Manifest +-------- + +The distribution should contain the following files: + +(A) The actual source files of the PCRE library functions and their + headers: + + dftables.c auxiliary program for building chartables.c + + pcreposix.c ) + pcre_compile.c ) + pcre_config.c ) + pcre_dfa_exec.c ) + pcre_exec.c ) + pcre_fullinfo.c ) + pcre_get.c ) sources for the functions in the library, + pcre_globals.c ) and some internal functions that they use + pcre_info.c ) + pcre_maketables.c ) + pcre_ord2utf8.c ) + pcre_printint.c ) + pcre_study.c ) + pcre_tables.c ) + pcre_try_flipped.c ) + pcre_ucp_findchar.c ) + pcre_valid_utf8.c ) + pcre_version.c ) + pcre_xclass.c ) + + ucp_findchar.c ) + ucp.h ) source for the code that is used for + ucpinternal.h ) Unicode property handling + ucptable.c ) + ucptypetable.c ) + + pcre.in "source" for the header for the external API; pcre.h + is built from this by "configure" + pcreposix.h header for the external POSIX wrapper API + pcre_internal.h header for internal use + config.in template for config.h, which is built by configure + + pcrecpp.h.in "source" for the header file for the C++ wrapper + pcrecpp.cc ) + pcre_scanner.cc ) source for the C++ wrapper library + + pcre_stringpiece.h.in "source" for pcre_stringpiece.h, the header for the + C++ stringpiece functions + pcre_stringpiece.cc source for the C++ stringpiece functions + +(B) Auxiliary files: + + AUTHORS information about the author of PCRE + ChangeLog log of changes to the code + INSTALL generic installation instructions + LICENCE conditions for the use of PCRE + COPYING the same, using GNU's standard name + Makefile.in template for Unix Makefile, which is built by configure + NEWS important changes in this release + NON-UNIX-USE notes on building PCRE on non-Unix systems + README this file + RunTest.in template for a Unix shell script for running tests + RunGrepTest.in template for a Unix shell script for pcregrep tests + config.guess ) files used by libtool, + config.sub ) used only when building a shared library + configure a configuring shell script (built by autoconf) + configure.in the autoconf input used to build configure + doc/Tech.Notes notes on the encoding + doc/*.3 man page sources for the PCRE functions + doc/*.1 man page sources for pcregrep and pcretest + doc/html/* HTML documentation + doc/pcre.txt plain text version of the man pages + doc/pcretest.txt plain text documentation of test program + doc/perltest.txt plain text documentation of Perl test program + install-sh a shell script for installing files + libpcre.pc.in "source" for libpcre.pc for pkg-config + ltmain.sh file used to build a libtool script + mkinstalldirs script for making install directories + pcretest.c comprehensive test program + pcredemo.c simple demonstration of coding calls to PCRE + perltest Perl test program + pcregrep.c source of a grep utility that uses PCRE + pcre-config.in source of script which retains PCRE information + pcrecpp_unittest.c ) + pcre_scanner_unittest.c ) test programs for the C++ wrapper + pcre_stringpiece_unittest.c ) + testdata/testinput* test data for main library tests + testdata/testoutput* expected test results + testdata/grep* input and output for pcregrep tests + +(C) Auxiliary files for Win32 DLL + + libpcre.def + libpcreposix.def + pcre.def + +(D) Auxiliary file for VPASCAL + + makevp.bat + +Philip Hazel +Email local part: ph10 +Email domain: cam.ac.uk +August 2005 diff --git a/mozilla/js/tamarin/pcre/RunGrepTest.in b/mozilla/js/tamarin/pcre/RunGrepTest.in new file mode 100644 index 00000000000..109267eea59 --- /dev/null +++ b/mozilla/js/tamarin/pcre/RunGrepTest.in @@ -0,0 +1,140 @@ +#! /bin/sh + +# This file is generated by configure from RunGrepTest.in. Make any changes +# to that file. + +echo "Testing pcregrep" + +# Run pcregrep tests. The assumption is that the PCRE tests check the library +# itself. What we are checking here is the file handling and options that are +# supported by pcregrep. + +cf=diff +if [ ! -d testdata ] ; then + ln -s @top_srcdir@/testdata testdata +fi +testdata=./testdata + +./pcregrep -V 2>testtry + +echo "---------------------------- Test 1 ------------------------------" >>testtry +./pcregrep PATTERN $testdata/grepinput >>testtry + +echo "---------------------------- Test 2 ------------------------------" >>testtry +./pcregrep '^PATTERN' $testdata/grepinput >>testtry + +echo "---------------------------- Test 3 ------------------------------" >>testtry +./pcregrep -in PATTERN $testdata/grepinput >>testtry + +echo "---------------------------- Test 4 ------------------------------" >>testtry +./pcregrep -ic PATTERN $testdata/grepinput >>testtry + +echo "---------------------------- Test 5 ------------------------------" >>testtry +./pcregrep -in PATTERN $testdata/grepinput $testdata/grepinputx >>testtry + +echo "---------------------------- Test 6 ------------------------------" >>testtry +./pcregrep -inh PATTERN $testdata/grepinput $testdata/grepinputx >>testtry + +echo "---------------------------- Test 7 ------------------------------" >>testtry +./pcregrep -il PATTERN $testdata/grepinput $testdata/grepinputx >>testtry + +echo "---------------------------- Test 8 ------------------------------" >>testtry +./pcregrep -l PATTERN $testdata/grepinput $testdata/grepinputx >>testtry + +echo "---------------------------- Test 9 ------------------------------" >>testtry +./pcregrep -q PATTERN $testdata/grepinput $testdata/grepinputx >>testtry +echo "RC=$?" >>testtry + +echo "---------------------------- Test 10 -----------------------------" >>testtry +./pcregrep -q NEVER-PATTERN $testdata/grepinput $testdata/grepinputx >>testtry +echo "RC=$?" >>testtry + +echo "---------------------------- Test 11 -----------------------------" >>testtry +./pcregrep -vn pattern $testdata/grepinputx >>testtry + +echo "---------------------------- Test 12 -----------------------------" >>testtry +./pcregrep -ix pattern $testdata/grepinputx >>testtry + +echo "---------------------------- Test 13 -----------------------------" >>testtry +./pcregrep -f$testdata/greplist $testdata/grepinputx >>testtry + +echo "---------------------------- Test 14 -----------------------------" >>testtry +./pcregrep -w pat $testdata/grepinput $testdata/grepinputx >>testtry + +echo "---------------------------- Test 15 -----------------------------" >>testtry +./pcregrep 'abc^*' $testdata/grepinput 2>>testtry >>testtry + +echo "---------------------------- Test 16 -----------------------------" >>testtry +./pcregrep abc $testdata/grepinput $testdata/nonexistfile 2>>testtry >>testtry + +echo "---------------------------- Test 17 -----------------------------" >>testtry +./pcregrep -M 'the\noutput' $testdata/grepinput >>testtry + +echo "---------------------------- Test 18 -----------------------------" >>testtry +./pcregrep -Mn '(the\noutput|dog\.\n--)' $testdata/grepinput >>testtry + +echo "---------------------------- Test 19 -----------------------------" >>testtry +./pcregrep -Mix 'Pattern' $testdata/grepinputx >>testtry + +echo "---------------------------- Test 20 -----------------------------" >>testtry +./pcregrep -Mixn 'complete pair\nof lines' $testdata/grepinputx >>testtry + +echo "---------------------------- Test 21 -----------------------------" >>testtry +./pcregrep -nA3 'four' $testdata/grepinputx >>testtry + +echo "---------------------------- Test 22 -----------------------------" >>testtry +./pcregrep -nB3 'four' $testdata/grepinputx >>testtry + +echo "---------------------------- Test 23 -----------------------------" >>testtry +./pcregrep -C3 'four' $testdata/grepinputx >>testtry + +echo "---------------------------- Test 24 -----------------------------" >>testtry +./pcregrep -A9 'four' $testdata/grepinputx >>testtry + +echo "---------------------------- Test 25 -----------------------------" >>testtry +./pcregrep -nB9 'four' $testdata/grepinputx >>testtry + +echo "---------------------------- Test 26 -----------------------------" >>testtry +./pcregrep -A9 -B9 'four' $testdata/grepinputx >>testtry + +echo "---------------------------- Test 27 -----------------------------" >>testtry +./pcregrep -A10 'four' $testdata/grepinputx >>testtry + +echo "---------------------------- Test 28 -----------------------------" >>testtry +./pcregrep -nB10 'four' $testdata/grepinputx >>testtry + +echo "---------------------------- Test 29 -----------------------------" >>testtry +./pcregrep -C12 -B10 'four' $testdata/grepinputx >>testtry + +echo "---------------------------- Test 30 -----------------------------" >>testtry +./pcregrep -inB3 'pattern' $testdata/grepinput $testdata/grepinputx >>testtry + +echo "---------------------------- Test 31 -----------------------------" >>testtry +./pcregrep -inA3 'pattern' $testdata/grepinput $testdata/grepinputx >>testtry + +echo "---------------------------- Test 32 -----------------------------" >>testtry +./pcregrep -L 'fox' $testdata/grepinput $testdata/grepinputx >>testtry + +echo "---------------------------- Test 33 -----------------------------" >>testtry +./pcregrep 'fox' $testdata/grepnonexist >>testtry 2>&1 +echo "RC=$?" >>testtry + +echo "---------------------------- Test 34 -----------------------------" >>testtry +./pcregrep -s 'fox' $testdata/grepnonexist >>testtry 2>&1 +echo "RC=$?" >>testtry + +echo "---------------------------- Test 35 -----------------------------" >>testtry +./pcregrep -L -r --include=grepinputx 'fox' $testdata >>testtry +echo "RC=$?" >>testtry + +echo "---------------------------- Test 36 -----------------------------" >>testtry +./pcregrep -L -r --include=grepinput --exclude 'grepinput$' 'fox' $testdata >>testtry +echo "RC=$?" >>testtry + + +# Now compare the results. + +$cf testtry $testdata/grepoutput +if [ $? != 0 ] ; then exit 1; else exit 0; fi + +# End diff --git a/mozilla/js/tamarin/pcre/RunTest.in b/mozilla/js/tamarin/pcre/RunTest.in new file mode 100644 index 00000000000..69f06659f62 --- /dev/null +++ b/mozilla/js/tamarin/pcre/RunTest.in @@ -0,0 +1,255 @@ +#! /bin/sh + +# This file is generated by configure from RunTest.in. Make any changes +# to that file. + +# Run PCRE tests + +cf=diff +if [ ! -d testdata ] ; then + ln -s @top_srcdir@/testdata testdata +fi +testdata=./testdata + +# Select which tests to run; if no selection, run all + +do1=no +do2=no +do3=no +do4=no +do5=no +do6=no +do7=no +do8=no +do9=no + +while [ $# -gt 0 ] ; do + case $1 in + 1) do1=yes;; + 2) do2=yes;; + 3) do3=yes;; + 4) do4=yes;; + 5) do5=yes;; + 6) do6=yes;; + 7) do7=yes;; + 8) do8=yes;; + 9) do9=yes;; + *) echo "Unknown test number $1"; exit 1;; + esac + shift +done + +if [ "@LINK_SIZE@" != "" -a "@LINK_SIZE@" != "-DLINK_SIZE=2" ] ; then + if [ $do2 = yes ] ; then + echo "Can't run test 2 with an internal link size other than 2" + exit 1 + fi + if [ $do5 = yes ] ; then + echo "Can't run test 5 with an internal link size other than 2" + exit 1 + fi + if [ $do6 = yes ] ; then + echo "Can't run test 6 with an internal link size other than 2" + exit 1 + fi +fi + +if [ "@UTF8@" = "" ] ; then + if [ $do4 = yes ] ; then + echo "Can't run test 4 because UTF-8 support is not configured" + exit 1 + fi + if [ $do5 = yes ] ; then + echo "Can't run test 5 because UTF-8 support is not configured" + exit 1 + fi + if [ $do6 = yes ] ; then + echo "Can't run test 6 because UTF-8 support is not configured" + exit 1 + fi + if [ $do8 = yes ] ; then + echo "Can't run test 8 because UTF-8 support is not configured" + exit 1 + fi + if [ $do9 = yes ] ; then + echo "Can't run test 9 because UTF-8 support is not configured" + exit 1 + fi +fi + +if [ "@UCP@" = "" ] ; then + if [ $do6 = yes ] ; then + echo "Can't run test 6 because Unicode property support is not configured" + exit 1 + fi + if [ $do9 = yes ] ; then + echo "Can't run test 9 because Unicode property support is not configured" + exit 1 + fi +fi + +if [ $do1 = no -a $do2 = no -a $do3 = no -a $do4 = no -a \ + $do5 = no -a $do6 = no -a $do7 = no -a $do8 = no -a \ + $do9 = no ] ; then + do1=yes + do2=yes + do3=yes + if [ "@UTF8@" != "" ] ; then do4=yes; fi + if [ "@UTF8@" != "" ] ; then do5=yes; fi + if [ "@UTF8@" != "" -a "@UCP@" != "" ] ; then do6=yes; fi + do7=yes + if [ "@UTF8@" != "" ] ; then do8=yes; fi + if [ "@UTF8@" != "" -a "@UCP@" != "" ] ; then do9=yes; fi +fi + +# Show which release + +./pcretest /dev/null + +# Primary test, Perl-compatible + +if [ $do1 = yes ] ; then + echo "Test 1: main functionality (Perl compatible)" + ./pcretest $testdata/testinput1 testtry + if [ $? = 0 ] ; then + $cf testtry $testdata/testoutput1 + if [ $? != 0 ] ; then exit 1; fi + else exit 1 + fi + echo "OK" + echo " " +fi + +# PCRE tests that are not Perl-compatible - API & error tests, mostly + +if [ $do2 = yes ] ; then + if [ "@LINK_SIZE@" = "" -o "@LINK_SIZE@" = "-DLINK_SIZE=2" ] ; then + echo "Test 2: API and error handling (not Perl compatible)" + ./pcretest -i $testdata/testinput2 testtry + if [ $? = 0 ] ; then + $cf testtry $testdata/testoutput2 + if [ $? != 0 ] ; then exit 1; fi + else exit 1 + fi + echo "OK" + echo " " + else + echo Test 2 skipped for link size other than 2 \(@LINK_SIZE@\) + echo " " + fi +fi + +# Locale-specific tests, provided the "fr_FR" locale is available + +if [ $do3 = yes ] ; then + locale -a | grep '^fr_FR$' >/dev/null + if [ $? -eq 0 ] ; then + echo "Test 3: locale-specific features (using 'fr_FR' locale)" + ./pcretest $testdata/testinput3 testtry + if [ $? = 0 ] ; then + $cf testtry $testdata/testoutput3 + if [ $? != 0 ] ; then + echo " " + echo "Locale test did not run entirely successfully." + echo "This usually means that there is a problem with the locale" + echo "settings rather than a bug in PCRE." + else + echo "OK" + fi + echo " " + else exit 1 + fi + else + echo "Cannot test locale-specific features - 'fr_FR' locale not found," + echo "or the \"locale\" command is not available to check for it." + echo " " + fi +fi + +# Additional tests for UTF8 support + +if [ $do4 = yes ] ; then + echo "Test 4: UTF-8 support (Perl compatible)" + ./pcretest $testdata/testinput4 testtry + if [ $? = 0 ] ; then + $cf testtry $testdata/testoutput4 + if [ $? != 0 ] ; then exit 1; fi + else exit 1 + fi + echo "OK" + echo " " +fi + +if [ $do5 = yes ] ; then + if [ "@LINK_SIZE@" = "" -o "@LINK_SIZE@" = "-DLINK_SIZE=2" ] ; then + echo "Test 5: API and internals for UTF-8 support (not Perl compatible)" + ./pcretest $testdata/testinput5 testtry + if [ $? = 0 ] ; then + $cf testtry $testdata/testoutput5 + if [ $? != 0 ] ; then exit 1; fi + else exit 1 + fi + echo "OK" + echo " " + else + echo Test 5 skipped for link size other than 2 \(@LINK_SIZE@\) + echo " " + fi +fi + +if [ $do6 = yes ] ; then + if [ "@LINK_SIZE@" = "" -o "@LINK_SIZE@" = "-DLINK_SIZE=2" ] ; then + echo "Test 6: Unicode property support" + ./pcretest $testdata/testinput6 testtry + if [ $? = 0 ] ; then + $cf testtry $testdata/testoutput6 + if [ $? != 0 ] ; then exit 1; fi + else exit 1 + fi + echo "OK" + echo " " + else + echo Test 6 skipped for link size other than 2 \(@LINK_SIZE@\) + echo " " + fi +fi + +# Tests for DFA matching support + +if [ $do7 = yes ] ; then + echo "Test 7: DFA matching" + ./pcretest -dfa $testdata/testinput7 testtry + if [ $? = 0 ] ; then + $cf testtry $testdata/testoutput7 + if [ $? != 0 ] ; then exit 1; fi + else exit 1 + fi + echo "OK" + echo " " +fi + +if [ $do8 = yes ] ; then + echo "Test 8: DFA matching with UTF-8" + ./pcretest -dfa $testdata/testinput8 testtry + if [ $? = 0 ] ; then + $cf testtry $testdata/testoutput8 + if [ $? != 0 ] ; then exit 1; fi + else exit 1 + fi + echo "OK" + echo " " +fi + +if [ $do9 = yes ] ; then + echo "Test 9: DFA matching with Unicode properties" + ./pcretest -dfa $testdata/testinput9 testtry + if [ $? = 0 ] ; then + $cf testtry $testdata/testoutput9 + if [ $? != 0 ] ; then exit 1; fi + else exit 1 + fi + echo "OK" + echo " " +fi + +# End diff --git a/mozilla/js/tamarin/pcre/config.guess b/mozilla/js/tamarin/pcre/config.guess new file mode 100644 index 00000000000..82a4ba20b0c --- /dev/null +++ b/mozilla/js/tamarin/pcre/config.guess @@ -0,0 +1,1479 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + +timestamp='2005-03-24' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Per Bothner . +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# The plan is that this can be called by configure scripts if you +# don't specify an explicit build system type. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit 0 ;; + --version | -v ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +if [ "${UNAME_SYSTEM}" = "Linux" ] ; then + eval $set_cc_for_build + cat << EOF > $dummy.c + #include + #ifdef __UCLIBC__ + # ifdef __UCLIBC_CONFIG_VERSION__ + LIBC=uclibc __UCLIBC_CONFIG_VERSION__ + # else + LIBC=uclibc + # endif + #else + LIBC=gnu + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep LIBC= | sed -e 's: ::g'` +fi + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep __ELF__ >/dev/null + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit 0 ;; + amd64:OpenBSD:*:*) + echo x86_64-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + amiga:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + cats:OpenBSD:*:*) + echo arm-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + hp300:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + luna88k:OpenBSD:*:*) + echo m88k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mac68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + macppc:OpenBSD:*:*) + echo powerpc-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme88k:OpenBSD:*:*) + echo m88k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvmeppc:OpenBSD:*:*) + echo powerpc-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sgi:OpenBSD:*:*) + echo mips64-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sun3:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + *:OpenBSD:*:*) + echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit 0 ;; + macppc:MirBSD:*:*) + echo powerppc-unknown-mirbsd${UNAME_RELEASE} + exit 0 ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit 0 ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE="alpha" ;; + "EV4.5 (21064)") + UNAME_MACHINE="alpha" ;; + "LCA4 (21066/21068)") + UNAME_MACHINE="alpha" ;; + "EV5 (21164)") + UNAME_MACHINE="alphaev5" ;; + "EV5.6 (21164A)") + UNAME_MACHINE="alphaev56" ;; + "EV5.6 (21164PC)") + UNAME_MACHINE="alphapca56" ;; + "EV5.7 (21164PC)") + UNAME_MACHINE="alphapca57" ;; + "EV6 (21264)") + UNAME_MACHINE="alphaev6" ;; + "EV6.7 (21264A)") + UNAME_MACHINE="alphaev67" ;; + "EV6.8CB (21264C)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8AL (21264B)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8CX (21264D)") + UNAME_MACHINE="alphaev68" ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE="alphaev69" ;; + "EV7 (21364)") + UNAME_MACHINE="alphaev7" ;; + "EV7.9 (21364A)") + UNAME_MACHINE="alphaev79" ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + exit 0 ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit 0 ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit 0 ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit 0;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit 0 ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit 0 ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit 0 ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit 0 ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit 0 ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit 0;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit 0;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit 0 ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit 0 ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit 0 ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7 && exit 0 ;; + esac ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + i86pc:SunOS:5.*:*) + echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit 0 ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit 0 ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit 0 ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit 0 ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit 0 ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit 0 ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit 0 ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit 0 ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit 0 ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit 0 ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit 0 ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c \ + && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ + && exit 0 + echo mips-mips-riscos${UNAME_RELEASE} + exit 0 ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit 0 ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit 0 ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit 0 ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit 0 ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit 0 ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit 0 ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit 0 ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit 0 ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit 0 ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit 0 ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit 0 ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit 0 ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit 0 ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit 0 ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit 0 ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 + echo rs6000-ibm-aix3.2.5 + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit 0 ;; + *:AIX:*:[45]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit 0 ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit 0 ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit 0 ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit 0 ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit 0 ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit 0 ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit 0 ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit 0 ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ ${HP_ARCH} = "hppa2.0w" ] + then + # avoid double evaluation of $set_cc_for_build + test -n "$CC_FOR_BUILD" || eval $set_cc_for_build + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null + then + HP_ARCH="hppa2.0w" + else + HP_ARCH="hppa64" + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit 0 ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit 0 ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 + echo unknown-hitachi-hiuxwe2 + exit 0 ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit 0 ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit 0 ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit 0 ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit 0 ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit 0 ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit 0 ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit 0 ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit 0 ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit 0 ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit 0 ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit 0 ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit 0 ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit 0 ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit 0 ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + *:FreeBSD:*:*) + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit 0 ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit 0 ;; + i*:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit 0 ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit 0 ;; + x86:Interix*:[34]*) + echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' + exit 0 ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit 0 ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix + exit 0 ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit 0 ;; + amd64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit 0 ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit 0 ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + *:GNU:*:*) + # the GNU system + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit 0 ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + exit 0 ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit 0 ;; + arm*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit 0 ;; + cris:Linux:*:*) + echo cris-axis-linux-${LIBC} + exit 0 ;; + crisv32:Linux:*:*) + echo crisv32-axis-linux-${LIBC} + exit 0 ;; + frv:Linux:*:*) + echo frv-unknown-linux-${LIBC} + exit 0 ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit 0 ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit 0 ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit 0 ;; + mips:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips + #undef mipsel + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mipsel + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` + test x"${CPU}" != x && echo "${CPU}-unknown-linux-${LIBC}" && exit 0 + ;; + mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips64 + #undef mips64el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mips64el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips64 + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` + test x"${CPU}" != x && echo "${CPU}-unknown-linux-${LIBC}" && exit 0 + ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-${LIBC} + exit 0 ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-${LIBC} + exit 0 ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null + if test "$?" = 0 ; then LIBC="gnulibc1" ; fi + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit 0 ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; + PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; + *) echo hppa-unknown-linux-${LIBC} ;; + esac + exit 0 ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-${LIBC} + exit 0 ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit 0 ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit 0 ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit 0 ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit 0 ;; + x86_64:Linux:*:*) + echo x86_64-unknown-linux-${LIBC} + exit 0 ;; + i*86:Linux:*:*) + # The BFD linker knows what the default object file format is, so + # first see if it will tell us. cd to the root directory to prevent + # problems with other programs or directories called `ld' in the path. + # Set LC_ALL=C to ensure ld outputs messages in English. + ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ + | sed -ne '/supported targets:/!d + s/[ ][ ]*/ /g + s/.*supported targets: *// + s/ .*// + p'` + case "$ld_supported_targets" in + elf32-i386) + TENTATIVE="${UNAME_MACHINE}-pc-linux-${LIBC}" + ;; + a.out-i386-linux) + echo "${UNAME_MACHINE}-pc-linux-${LIBC}aout" + exit 0 ;; + coff-i386) + echo "${UNAME_MACHINE}-pc-linux-${LIBC}coff" + exit 0 ;; + "") + # Either a pre-BFD a.out linker (linux-gnuoldld) or + # one that does not give us useful --help. + echo "${UNAME_MACHINE}-pc-linux-${LIBC}oldld" + exit 0 ;; + esac + if [ "`echo $LIBC | sed -e 's:uclibc::'`" != "$LIBC" ] ; then echo "$TENTATIVE" && exit 0 ; fi + # Determine whether the default compiler is a.out or elf + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + #ifdef __ELF__ + # ifdef __GLIBC__ + # if __GLIBC__ >= 2 + LIBC=gnu + # else + LIBC=gnulibc1 + # endif + # else + LIBC=gnulibc1 + # endif + #else + #ifdef __INTEL_COMPILER + LIBC=gnu + #else + LIBC=gnuaout + #endif + #endif + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` + test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 + test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 + ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit 0 ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit 0 ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit 0 ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit 0 ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit 0 ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit 0 ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit 0 ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit 0 ;; + i*86:*:5:[78]*) + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit 0 ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit 0 ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i386. + echo i386-pc-msdosdjgpp + exit 0 ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit 0 ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit 0 ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit 0 ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit 0 ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit 0 ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit 0 ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4.3${OS_REL} && exit 0 + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4 && exit 0 ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit 0 ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit 0 ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit 0 ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit 0 ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit 0 ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit 0 ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit 0 ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit 0 ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit 0 ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit 0 ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit 0 ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit 0 ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit 0 ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit 0 ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit 0 ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit 0 ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + case $UNAME_PROCESSOR in + *86) UNAME_PROCESSOR=i686 ;; + unknown) UNAME_PROCESSOR=powerpc ;; + esac + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit 0 ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit 0 ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit 0 ;; + NSE-?:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit 0 ;; + NSR-?:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit 0 ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit 0 ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit 0 ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit 0 ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit 0 ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit 0 ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit 0 ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit 0 ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit 0 ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit 0 ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit 0 ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + exit 0 ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit 0 ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms && exit 0 ;; + I*) echo ia64-dec-vms && exit 0 ;; + V*) echo vax-dec-vms && exit 0 ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit 0 ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +eval $set_cc_for_build +cat >$dummy.c < +# include +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0 + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit 0 ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + c34*) + echo c34-convex-bsd + exit 0 ;; + c38*) + echo c38-convex-bsd + exit 0 ;; + c4*) + echo c4-convex-bsd + exit 0 ;; + esac +fi + +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/mozilla/js/tamarin/pcre/config.h b/mozilla/js/tamarin/pcre/config.h new file mode 100644 index 00000000000..1f3ce81aa27 --- /dev/null +++ b/mozilla/js/tamarin/pcre/config.h @@ -0,0 +1,132 @@ +/* config.h. Generated by configure. */ + +/* On Unix systems config.in is converted by configure into config.h. PCRE is +written in Standard C, but there are a few non-standard things it can cope +with, allowing it to run on SunOS4 and other "close to standard" systems. + +On a non-Unix system you should just copy this file into config.h, and set up +the macros the way you need them. You should normally change the definitions of +HAVE_STRERROR and HAVE_MEMMOVE to 1. Unfortunately, because of the way autoconf +works, these cannot be made the defaults. If your system has bcopy() and not +memmove(), change the definition of HAVE_BCOPY instead of HAVE_MEMMOVE. If your +system has neither bcopy() nor memmove(), leave them both as 0; an emulation +function will be used. */ + +/* If you are compiling for a system that uses EBCDIC instead of ASCII +character codes, define this macro as 1. On systems that can use "configure", +this can be done via --enable-ebcdic. */ + +#ifndef EBCDIC +#define EBCDIC 0 +#endif + +/* If you are compiling for a system that needs some magic to be inserted +before the definition of an exported function, define this macro to contain the +relevant magic. It apears at the start of every exported function. */ + +#define PCRE_EXPORT + +/* Define to empty if the "const" keyword does not work. */ + +/* #undef const */ + +/* Define to "unsigned" if doesn't define size_t. */ + +/* #undef size_t */ + +/* The following two definitions are mainly for the benefit of SunOS4, which +doesn't have the strerror() or memmove() functions that should be present in +all Standard C libraries. The macros HAVE_STRERROR and HAVE_MEMMOVE should +normally be defined with the value 1 for other systems, but unfortunately we +can't make this the default because "configure" files generated by autoconf +will only change 0 to 1; they won't change 1 to 0 if the functions are not +found. */ + +#define HAVE_STRERROR 1 +#define HAVE_MEMMOVE 1 + +/* There are some non-Unix systems that don't even have bcopy(). If this macro +is false, an emulation is used. If HAVE_MEMMOVE is set to 1, the value of +HAVE_BCOPY is not relevant. */ + +#define HAVE_BCOPY 1 + +/* The value of NEWLINE determines the newline character. The default is to +leave it up to the compiler, but some sites want to force a particular value. +On Unix systems, "configure" can be used to override this default. */ + +#ifndef NEWLINE +#define NEWLINE '\n' +#endif + +/* cn: added constants for carriage return, unicode line seperator, and unicode paragraph seperator, + all of which should match the '$' metacharater. +*/ +#define CARRAIGE_RETURN '\r' // +#define UNICODE_LINE_SEPERATOR 0x2028 // +#define UNICODE_PARAGRAPH_SEPERATOR 0x2029 // + +// cn: also added unicode whitespace characters. +#define UNICODE_NOBREAK_SPACE 0x00A0 // - no-break space +#define UNICODE_ZEROWIDTH_SPACE 0x200B // - zero width space +#define UNICODE_WORDJOINER_SPACE 0x2060 // - word joiner +#define UNICODE_IDEOGRAPHIC_SPACE 0x3000 // - ideographic space +#define UNICODE_ZEROWIDTH_NOBREAK_SPACE 0xFEFF // - zero width no-break space + +inline bool isECMALineTerminator(unsigned short x) { return (((x) == NEWLINE) || ((x) == CARRAIGE_RETURN) || ((x) == UNICODE_LINE_SEPERATOR) || ((x) == UNICODE_PARAGRAPH_SEPERATOR) ); } +inline bool isUnicodeWhiteSpace(unsigned short x) { return (((x) == UNICODE_NOBREAK_SPACE) || ((x) == UNICODE_ZEROWIDTH_SPACE) || ((x) == UNICODE_WORDJOINER_SPACE) || ((x) == UNICODE_IDEOGRAPHIC_SPACE) || ((x) == UNICODE_ZEROWIDTH_NOBREAK_SPACE) ); } + +/* The value of LINK_SIZE determines the number of bytes used to store +links as offsets within the compiled regex. The default is 2, which allows for +compiled patterns up to 64K long. This covers the vast majority of cases. +However, PCRE can also be compiled to use 3 or 4 bytes instead. This allows for +longer patterns in extreme cases. On Unix systems, "configure" can be used to +override this default. */ + +#ifndef LINK_SIZE +#define LINK_SIZE 2 +#endif + +/* The value of MATCH_LIMIT determines the default number of times the match() +function can be called during a single execution of pcre_exec(). (There is a +runtime method of setting a different limit.) The limit exists in order to +catch runaway regular expressions that take for ever to determine that they do +not match. The default is set very large so that it does not accidentally catch +legitimate cases. On Unix systems, "configure" can be used to override this +default default. */ + +#ifndef MATCH_LIMIT +#define MATCH_LIMIT 10000000 +#endif + +/* When calling PCRE via the POSIX interface, additional working storage is +required for holding the pointers to capturing substrings because PCRE requires +three integers per substring, whereas the POSIX interface provides only two. If +the number of expected substrings is small, the wrapper function uses space on +the stack, because this is faster than using malloc() for each call. The +threshold above which the stack is no longer use is defined by POSIX_MALLOC_ +THRESHOLD. On Unix systems, "configure" can be used to override this default. +*/ + +#ifndef POSIX_MALLOC_THRESHOLD +#define POSIX_MALLOC_THRESHOLD 10 +#endif + +/* PCRE uses recursive function calls to handle backtracking while matching. +This can sometimes be a problem on systems that have stacks of limited size. +Define NO_RECURSE to get a version that doesn't use recursion in the match() +function; instead it creates its own stack by steam using pcre_recurse_malloc +to get memory. For more detail, see comments and other stuff just above the +match() function. On Unix systems, "configure" can be used to set this in the +Makefile (use --disable-stack-for-recursion). */ + +// avmplus prefers NO_RECURSE +#define NO_RECURSE + +// AVMPLUS_PCRE is #defined for any code changes avmplus requires +#define AVMPLUS_PCRE + +// avmplus requires UTF-8 support +#define SUPPORT_UTF8 + +/* End */ diff --git a/mozilla/js/tamarin/pcre/config.h.in b/mozilla/js/tamarin/pcre/config.h.in new file mode 100644 index 00000000000..a6d1451db72 --- /dev/null +++ b/mozilla/js/tamarin/pcre/config.h.in @@ -0,0 +1,107 @@ + +/* On Unix systems config.in is converted by configure into config.h. PCRE is +written in Standard C, but there are a few non-standard things it can cope +with, allowing it to run on SunOS4 and other "close to standard" systems. + +On a non-Unix system you should just copy this file into config.h, and set up +the macros the way you need them. You should normally change the definitions of +HAVE_STRERROR and HAVE_MEMMOVE to 1. Unfortunately, because of the way autoconf +works, these cannot be made the defaults. If your system has bcopy() and not +memmove(), change the definition of HAVE_BCOPY instead of HAVE_MEMMOVE. If your +system has neither bcopy() nor memmove(), leave them both as 0; an emulation +function will be used. */ + +/* If you are compiling for a system that uses EBCDIC instead of ASCII +character codes, define this macro as 1. On systems that can use "configure", +this can be done via --enable-ebcdic. */ + +#ifndef EBCDIC +#define EBCDIC 0 +#endif + +/* If you are compiling for a system that needs some magic to be inserted +before the definition of an exported function, define this macro to contain the +relevant magic. It apears at the start of every exported function. */ + +#define PCRE_EXPORT + +/* Define to empty if the "const" keyword does not work. */ + +#undef const + +/* Define to "unsigned" if doesn't define size_t. */ + +#undef size_t + +/* The following two definitions are mainly for the benefit of SunOS4, which +doesn't have the strerror() or memmove() functions that should be present in +all Standard C libraries. The macros HAVE_STRERROR and HAVE_MEMMOVE should +normally be defined with the value 1 for other systems, but unfortunately we +can't make this the default because "configure" files generated by autoconf +will only change 0 to 1; they won't change 1 to 0 if the functions are not +found. */ + +#define HAVE_STRERROR 0 +#define HAVE_MEMMOVE 0 + +/* There are some non-Unix systems that don't even have bcopy(). If this macro +is false, an emulation is used. If HAVE_MEMMOVE is set to 1, the value of +HAVE_BCOPY is not relevant. */ + +#define HAVE_BCOPY 0 + +/* The value of NEWLINE determines the newline character. The default is to +leave it up to the compiler, but some sites want to force a particular value. +On Unix systems, "configure" can be used to override this default. */ + +#ifndef NEWLINE +#define NEWLINE '\n' +#endif + +/* The value of LINK_SIZE determines the number of bytes used to store +links as offsets within the compiled regex. The default is 2, which allows for +compiled patterns up to 64K long. This covers the vast majority of cases. +However, PCRE can also be compiled to use 3 or 4 bytes instead. This allows for +longer patterns in extreme cases. On Unix systems, "configure" can be used to +override this default. */ + +#ifndef LINK_SIZE +#define LINK_SIZE 2 +#endif + +/* The value of MATCH_LIMIT determines the default number of times the match() +function can be called during a single execution of pcre_exec(). (There is a +runtime method of setting a different limit.) The limit exists in order to +catch runaway regular expressions that take for ever to determine that they do +not match. The default is set very large so that it does not accidentally catch +legitimate cases. On Unix systems, "configure" can be used to override this +default default. */ + +#ifndef MATCH_LIMIT +#define MATCH_LIMIT 10000000 +#endif + +/* When calling PCRE via the POSIX interface, additional working storage is +required for holding the pointers to capturing substrings because PCRE requires +three integers per substring, whereas the POSIX interface provides only two. If +the number of expected substrings is small, the wrapper function uses space on +the stack, because this is faster than using malloc() for each call. The +threshold above which the stack is no longer use is defined by POSIX_MALLOC_ +THRESHOLD. On Unix systems, "configure" can be used to override this default. +*/ + +#ifndef POSIX_MALLOC_THRESHOLD +#define POSIX_MALLOC_THRESHOLD 10 +#endif + +/* PCRE uses recursive function calls to handle backtracking while matching. +This can sometimes be a problem on systems that have stacks of limited size. +Define NO_RECURSE to get a version that doesn't use recursion in the match() +function; instead it creates its own stack by steam using pcre_recurse_malloc +to get memory. For more detail, see comments and other stuff just above the +match() function. On Unix systems, "configure" can be used to set this in the +Makefile (use --disable-stack-for-recursion). */ + +/* #define NO_RECURSE */ + +/* End */ diff --git a/mozilla/js/tamarin/pcre/config.sub b/mozilla/js/tamarin/pcre/config.sub new file mode 100644 index 00000000000..b93d3171946 --- /dev/null +++ b/mozilla/js/tamarin/pcre/config.sub @@ -0,0 +1,1586 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + +timestamp='2005-02-10' + +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit 0 ;; + --version | -v ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit 0;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \ + kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray) + os= + basic_machine=$1 + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64vr | mips64vrel \ + | mips64orion | mips64orionel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mips64r5900 | mips64r5900el \ + | mn10200 | mn10300 \ + | msp430 \ + | ns16k | ns32k \ + | openrisc | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \ + | strongarm \ + | tahoe | dvp | thumb | tic4x | tic80 | tron \ + | v850 | v850e \ + | we32k \ + | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \ + | z8k) + basic_machine=$basic_machine-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12) + # Motorola 68HC11/12. + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* \ + | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ + | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ + | mips64r5900-* | mips64r5900el-* \ + | mmix-* \ + | msp430-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | romp-* | rs6000-* \ + | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tron-* \ + | v850-* | v850e-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \ + | xstormy16-* | xtensa-* \ + | ymp-* \ + | z8k-*) + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + abacus) + basic_machine=abacus-unknown + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16c) + basic_machine=cr16c-unknown + os=-elf + ;; + crds | unos) + basic_machine=m68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; +# I'm not sure what "Sysv32" means. Should this be sysv3.2? + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mipsEE* | ee | ps2) + basic_machine=mips64r5900el-scei + case $os in + -linux*) + ;; + *) + os=-elf + ;; + esac + ;; + iop) + basic_machine=mipsel-scei + os=-irx + ;; + dvp) + basic_machine=dvp-scei + os=-elf + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + or32 | or32-*) + basic_machine=or32-unknown + os=-coff + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc) basic_machine=powerpc-unknown + ;; + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; + tic55x | c55x*) + basic_machine=tic55x-unknown + os=-coff + ;; + tic6x | c6x*) + basic_machine=tic6x-unknown + os=-coff + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* | -irx*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -os400*) + os=-os400 + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -tpf*) + os=-tpf + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -kaos*) + os=-kaos + ;; + -zvmoe) + os=-zvmoe + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + m68*-cisco) + os=-aout + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-ibm) + os=-aix + ;; + *-knuth) + os=-mmixware + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -os400*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -tpf*) + vendor=ibm + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/mozilla/js/tamarin/pcre/configure b/mozilla/js/tamarin/pcre/configure new file mode 100644 index 00000000000..e178aa5eed6 --- /dev/null +++ b/mozilla/js/tamarin/pcre/configure @@ -0,0 +1,22187 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.59. +# +# Copyright (C) 2003 Free Software Foundation, Inc. +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi +DUALCASE=1; export DUALCASE # for MKS sh + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + + + +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} + +case X$ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','` + ;; +esac + +echo=${ECHO-echo} +if test "X$1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X$1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then + # Yippee, $echo works! + : +else + # Restart under the correct shell. + exec $SHELL "$0" --no-reexec ${1+"$@"} +fi + +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat </dev/null 2>&1 && unset CDPATH + +if test -z "$ECHO"; then +if test "X${echo_test_string+set}" != Xset; then +# find a string as large as possible, as long as the shell can cope with it + for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do + # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... + if (echo_test_string="`eval $cmd`") 2>/dev/null && + echo_test_string="`eval $cmd`" && + (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null + then + break + fi + done +fi + +if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : +else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$dir/echo" + break + fi + done + IFS="$lt_save_ifs" + + if test "X$echo" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + echo='print -r' + elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} + else + # Try using printf. + echo='printf %s\n' + if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + echo="$CONFIG_SHELL $0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$CONFIG_SHELL $0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do + if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "$0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} + else + # Oops. We lost completely, so just stick with echo. + echo=echo + fi + fi + fi + fi +fi +fi + +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +ECHO=$echo +if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then + ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" +fi + + + + +tagnames=${tagnames+${tagnames},}CXX + +tagnames=${tagnames+${tagnames},}F77 + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +exec 6>&1 + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_config_libobj_dir=. +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Maximum number of lines to put in a shell here document. +# This variable seems obsolete. It should probably be removed, and +# only ac_max_sed_lines should be used. +: ${ac_max_here_lines=38} + +# Identity of this package. +PACKAGE_NAME= +PACKAGE_TARNAME= +PACKAGE_VERSION= +PACKAGE_STRING= +PACKAGE_BUGREPORT= + +ac_unique_file="dftables.c" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_SYS_STAT_H +# include +#endif +#if STDC_HEADERS +# include +# include +#else +# if HAVE_STDLIB_H +# include +# endif +#endif +#if HAVE_STRING_H +# if !STDC_HEADERS && HAVE_MEMORY_H +# include +# endif +# include +#endif +#if HAVE_STRINGS_H +# include +#endif +#if HAVE_INTTYPES_H +# include +#else +# if HAVE_STDINT_H +# include +# endif +#endif +#if HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA build build_cpu build_vendor build_os host host_cpu host_vendor host_os EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP DLLTOOL ac_ct_DLLTOOL AS ac_ct_AS OBJDUMP ac_ct_OBJDUMP CPP CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL pcre_have_bits_type_traits pcre_have_type_traits MAYBE_CPP_TARGETS HAVE_CPP pcre_have_long_long pcre_have_ulong_long BUILD_EXEEXT BUILD_OBJEXT CC_FOR_BUILD CXX_FOR_BUILD CFLAGS_FOR_BUILD CXXFLAGS_FOR_BUILD EBCDIC HAVE_MEMMOVE HAVE_STRERROR LINK_SIZE MATCH_LIMIT NEWLINE NO_RECURSE PCRE_MAJOR PCRE_MINOR PCRE_DATE PCRE_VERSION PCRE_LIB_VERSION PCRE_POSIXLIB_VERSION PCRE_CPPLIB_VERSION POSIX_MALLOC_THRESHOLD UCP UTF8 WIN_PREFIX ON_WINDOWS NOT_ON_WINDOWS POSIX_OBJ POSIX_LOBJ POSIX_LIB LIBOBJS LTLIBOBJS' +ac_subst_files='' + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +ac_prev= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_option in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + eval "enable_$ac_feature=no" ;; + + -enable-* | --enable-*) + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "enable_$ac_feature='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package| sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "with_$ac_package='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/-/_/g'` + eval "with_$ac_package=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) { echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` + eval "$ac_envvar='$ac_optarg'" + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } +fi + +# Be sure to have absolute paths. +for ac_var in exec_prefix prefix +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* | NONE | '' ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# Be sure to have absolute paths. +for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ + localstatedir libdir includedir oldincludedir infodir mandir +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_confdir=`(dirname "$0") 2>/dev/null || +$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$0" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 + { (exit 1); exit 1; }; } + else + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } + fi +fi +(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || + { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 + { (exit 1); exit 1; }; } +srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` +ac_env_build_alias_set=${build_alias+set} +ac_env_build_alias_value=$build_alias +ac_cv_env_build_alias_set=${build_alias+set} +ac_cv_env_build_alias_value=$build_alias +ac_env_host_alias_set=${host_alias+set} +ac_env_host_alias_value=$host_alias +ac_cv_env_host_alias_set=${host_alias+set} +ac_cv_env_host_alias_value=$host_alias +ac_env_target_alias_set=${target_alias+set} +ac_env_target_alias_value=$target_alias +ac_cv_env_target_alias_set=${target_alias+set} +ac_cv_env_target_alias_value=$target_alias +ac_env_CC_set=${CC+set} +ac_env_CC_value=$CC +ac_cv_env_CC_set=${CC+set} +ac_cv_env_CC_value=$CC +ac_env_CFLAGS_set=${CFLAGS+set} +ac_env_CFLAGS_value=$CFLAGS +ac_cv_env_CFLAGS_set=${CFLAGS+set} +ac_cv_env_CFLAGS_value=$CFLAGS +ac_env_LDFLAGS_set=${LDFLAGS+set} +ac_env_LDFLAGS_value=$LDFLAGS +ac_cv_env_LDFLAGS_set=${LDFLAGS+set} +ac_cv_env_LDFLAGS_value=$LDFLAGS +ac_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_env_CPPFLAGS_value=$CPPFLAGS +ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_cv_env_CPPFLAGS_value=$CPPFLAGS +ac_env_CXX_set=${CXX+set} +ac_env_CXX_value=$CXX +ac_cv_env_CXX_set=${CXX+set} +ac_cv_env_CXX_value=$CXX +ac_env_CXXFLAGS_set=${CXXFLAGS+set} +ac_env_CXXFLAGS_value=$CXXFLAGS +ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set} +ac_cv_env_CXXFLAGS_value=$CXXFLAGS +ac_env_CPP_set=${CPP+set} +ac_env_CPP_value=$CPP +ac_cv_env_CPP_set=${CPP+set} +ac_cv_env_CPP_value=$CPP +ac_env_CXXCPP_set=${CXXCPP+set} +ac_env_CXXCPP_value=$CXXCPP +ac_cv_env_CXXCPP_set=${CXXCPP+set} +ac_cv_env_CXXCPP_value=$CXXCPP +ac_env_F77_set=${F77+set} +ac_env_F77_value=$F77 +ac_cv_env_F77_set=${F77+set} +ac_cv_env_F77_value=$F77 +ac_env_FFLAGS_set=${FFLAGS+set} +ac_env_FFLAGS_value=$FFLAGS +ac_cv_env_FFLAGS_set=${FFLAGS+set} +ac_cv_env_FFLAGS_value=$FFLAGS + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures this package to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +_ACEOF + + cat <<_ACEOF +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data [PREFIX/share] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --infodir=DIR info documentation [PREFIX/info] + --mandir=DIR man documentation [PREFIX/man] +_ACEOF + + cat <<\_ACEOF + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] +_ACEOF +fi + +if test -n "$ac_init_help"; then + + cat <<\_ACEOF + +Optional Features: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --disable-cpp disable C++ support + --enable-shared[=PKGS] + build shared libraries [default=yes] + --enable-static[=PKGS] + build static libraries [default=yes] + --enable-fast-install[=PKGS] + optimize for fast installation [default=yes] + --disable-libtool-lock avoid locking (might break parallel builds) + --enable-utf8 enable UTF8 support + --enable-unicode-properties enable Unicode properties support + --enable-newline-is-cr use CR as the newline character + --enable-newline-is-lf use LF as the newline character + --enable-ebcdic assume EBCDIC coding rather than ASCII + --disable-stack-for-recursion disable use of stack recursion when matching + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --with-pic try to use only PIC/non-PIC objects [default=use + both] + --with-tags[=TAGS] + include additional configurations [automatic] + --with-posix-malloc-threshold=5 threshold for POSIX malloc usage + --with-link-size=2 internal link size (2, 3, or 4 allowed) + --with-match-limit=10000000 default limit on internal looping) + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have + headers in a nonstandard directory + CXX C++ compiler command + CXXFLAGS C++ compiler flags + CPP C preprocessor + CXXCPP C++ preprocessor + F77 Fortran 77 compiler command + FFLAGS Fortran 77 compiler flags + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +_ACEOF +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + ac_popdir=`pwd` + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d $ac_dir || continue + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + cd $ac_dir + # Check for guested configure; otherwise get Cygnus style configure. + if test -f $ac_srcdir/configure.gnu; then + echo + $SHELL $ac_srcdir/configure.gnu --help=recursive + elif test -f $ac_srcdir/configure; then + echo + $SHELL $ac_srcdir/configure --help=recursive + elif test -f $ac_srcdir/configure.ac || + test -f $ac_srcdir/configure.in; then + echo + $ac_configure --help + else + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi + cd $ac_popdir + done +fi + +test -n "$ac_init_help" && exit 0 +if $ac_init_version; then + cat <<\_ACEOF + +Copyright (C) 2003 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit 0 +fi +exec 5>config.log +cat >&5 <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by $as_me, which was +generated by GNU Autoconf 2.59. Invocation command line was + + $ $0 $@ + +_ACEOF +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + echo "PATH: $as_dir" +done + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_sep= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 2) + ac_configure_args1="$ac_configure_args1 '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + # Get rid of the leading space. + ac_sep=" " + ;; + esac + done +done +$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } +$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Be sure not to use single quotes in there, as some shells, +# such as our DU 5.0 friend, will then `close' the trap. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + cat <<\_ASBOX +## ---------------- ## +## Cache variables. ## +## ---------------- ## +_ASBOX + echo + # The following way of writing the cache mishandles newlines in values, +{ + (set) 2>&1 | + case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in + *ac_space=\ *) + sed -n \ + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + ;; + *) + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} + echo + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------- ## +## Output files. ## +## ------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + fi + + if test -s confdefs.h; then + cat <<\_ASBOX +## ----------- ## +## confdefs.h. ## +## ----------- ## +_ASBOX + echo + sed "/^$/d" confdefs.h | sort + echo + fi + test "$ac_signal" != 0 && + echo "$as_me: caught signal $ac_signal" + echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core && + rm -rf conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status + ' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo >confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { echo "$as_me:$LINENO: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . $cache_file;; + *) . ./$cache_file;; + esac + fi +else + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in `(set) 2>&1 | + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val="\$ac_cv_env_${ac_var}_value" + eval ac_new_val="\$ac_env_${ac_var}_value" + case $ac_old_set,$ac_new_set in + set,) + { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + + + + + + + + + + + + + + + + + + + ac_config_headers="$ac_config_headers config.h" + + + +PCRE_MAJOR=6 +PCRE_MINOR=4 +PCRE_DATE=05-Sep-2005 +PCRE_VERSION=${PCRE_MAJOR}.${PCRE_MINOR} + + +POSIX_MALLOC_THRESHOLD=-DPOSIX_MALLOC_THRESHOLD=10 + + +PCRE_LIB_VERSION=0:1:0 +PCRE_POSIXLIB_VERSION=0:0:0 +PCRE_CPPLIB_VERSION=0:0:0 + + +# Check whether --enable-cpp or --disable-cpp was given. +if test "${enable_cpp+set}" = set; then + enableval="$enable_cpp" + want_cpp="$enableval" +else + want_cpp=yes +fi; + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CC" && break +done + + CC=$ac_ct_CC +fi + +fi + + +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:$LINENO:" \ + "checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 + (eval $ac_link_default) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Find the output, starting from the most likely. This scheme is +# not robust to junk in `.', hence go to wildcards (a.*) only as a last +# resort. + +# Be careful to initialize this variable, since it used to be cached. +# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. +ac_cv_exeext= +# b.out is created by i960 compilers. +for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) + ;; + conftest.$ac_ext ) + # This is the source file. + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool, + # but it would be cool to find out if it's true. Does anybody + # maintain Libtool? --akim. + export ac_cv_exeext + break;; + * ) + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +echo "$as_me: error: C compiler cannot create executables +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } +fi + +ac_exeext=$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6 + +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 +# If not cross compiling, check that we can run a simple program. +if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { echo "$as_me:$LINENO: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + fi + fi +fi +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +rm -f a.out a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6 + +echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + export ac_cv_exeext + break;; + * ) break;; + esac +done +else + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6 + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 +if test "${ac_cv_objext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6 +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +CFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_cc_g=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 +echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_stdc=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std1 is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std1. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_stdc=$ac_arg +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext +done +rm -f conftest.$ac_ext conftest.$ac_objext +CC=$ac_save_CC + +fi + +case "x$ac_cv_prog_cc_stdc" in + x|xno) + echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6 ;; + *) + echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 + CC="$CC $ac_cv_prog_cc_stdc" ;; +esac + +# Some people use a C++ compiler to compile C. Since we use `exit', +# in C++ we need to declare it. In case someone uses the same compiler +# for both compiling C and C++ we need to have the C++ compiler decide +# the declaration of exit, since it's the most demanding environment. +cat >conftest.$ac_ext <<_ACEOF +#ifndef __cplusplus + choke me +#endif +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ + '' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +#include +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +continue +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + +ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -n "$ac_tool_prefix"; then + for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + echo "$as_me:$LINENO: result: $CXX" >&5 +echo "${ECHO_T}$CXX" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 +echo "${ECHO_T}$ac_ct_CXX" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CXX" && break +done +test -n "$ac_ct_CXX" || ac_ct_CXX="g++" + + CXX=$ac_ct_CXX +fi + + +# Provide some information about the compiler. +echo "$as_me:$LINENO:" \ + "checking for C++ compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6 +if test "${ac_cv_cxx_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 +GXX=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +CXXFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 +echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cxx_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cxx_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_cxx_g=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6 +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi +for ac_declaration in \ + '' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +#include +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +continue +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + +ac_aux_dir= +for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f $ac_dir/shtool; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 +echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} + { (exit 1); exit 1; }; } +fi +ac_config_guess="$SHELL $ac_aux_dir/config.guess" +ac_config_sub="$SHELL $ac_aux_dir/config.sub" +ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + done + done + ;; +esac +done + + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL=$ac_install_sh + fi +fi +echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + + +# Check whether --enable-shared or --disable-shared was given. +if test "${enable_shared+set}" = set; then + enableval="$enable_shared" + p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_shared=yes +fi; + +# Check whether --enable-static or --disable-static was given. +if test "${enable_static+set}" = set; then + enableval="$enable_static" + p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_static=yes +fi; + +# Check whether --enable-fast-install or --disable-fast-install was given. +if test "${enable_fast_install+set}" = set; then + enableval="$enable_fast_install" + p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_fast_install=yes +fi; + +# Make sure we can run config.sub. +$ac_config_sub sun4 >/dev/null 2>&1 || + { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 +echo "$as_me: error: cannot run $ac_config_sub" >&2;} + { (exit 1); exit 1; }; } + +echo "$as_me:$LINENO: checking build system type" >&5 +echo $ECHO_N "checking build system type... $ECHO_C" >&6 +if test "${ac_cv_build+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_build_alias=$build_alias +test -z "$ac_cv_build_alias" && + ac_cv_build_alias=`$ac_config_guess` +test -z "$ac_cv_build_alias" && + { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 +echo "$as_me: error: cannot guess build type; you must specify one" >&2;} + { (exit 1); exit 1; }; } +ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +echo "${ECHO_T}$ac_cv_build" >&6 +build=$ac_cv_build +build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + + +echo "$as_me:$LINENO: checking host system type" >&5 +echo $ECHO_N "checking host system type... $ECHO_C" >&6 +if test "${ac_cv_host+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_host_alias=$host_alias +test -z "$ac_cv_host_alias" && + ac_cv_host_alias=$ac_cv_build_alias +ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +echo "${ECHO_T}$ac_cv_host" >&6 +host=$ac_cv_host +host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + + +echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 +echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6 +if test "${lt_cv_path_SED+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f $lt_ac_sed && continue + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done + +fi + +SED=$lt_cv_path_SED +echo "$as_me:$LINENO: result: $SED" >&5 +echo "${ECHO_T}$SED" >&6 + +echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6 +if test "${ac_cv_prog_egrep+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo a | (grep -E '(a|b)') >/dev/null 2>&1 + then ac_cv_prog_egrep='grep -E' + else ac_cv_prog_egrep='egrep' + fi +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 +echo "${ECHO_T}$ac_cv_prog_egrep" >&6 + EGREP=$ac_cv_prog_egrep + + + +# Check whether --with-gnu-ld or --without-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then + withval="$with_gnu_ld" + test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi; +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + echo "$as_me:$LINENO: checking for ld used by $CC" >&5 +echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6 + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + echo "$as_me:$LINENO: checking for GNU ld" >&5 +echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 +else + echo "$as_me:$LINENO: checking for non-GNU ld" >&5 +echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 +fi +if test "${lt_cv_path_LD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some GNU ld's only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +echo "${ECHO_T}$LD" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi +test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 +echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} + { (exit 1); exit 1; }; } +echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 +if test "${lt_cv_prog_gnu_ld+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # I'd rather use --version here, but apparently some GNU ld's only accept -v. +case `$LD -v 2>&1 &5 +echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 +with_gnu_ld=$lt_cv_prog_gnu_ld + + +echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 +echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6 +if test "${lt_cv_ld_reload_flag+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_ld_reload_flag='-r' +fi +echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 +echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6 +reload_flag=$lt_cv_ld_reload_flag +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' +case $host_os in + darwin*) + if test "$GCC" = yes; then + reload_cmds='$CC -nostdlib ${wl}-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac + +echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 +echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6 +if test "${lt_cv_path_NM+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/${ac_tool_prefix}nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + esac + fi + done + IFS="$lt_save_ifs" + test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm +fi +fi +echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 +echo "${ECHO_T}$lt_cv_path_NM" >&6 +NM="$lt_cv_path_NM" + +echo "$as_me:$LINENO: checking whether ln -s works" >&5 +echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + echo "$as_me:$LINENO: result: no, using $LN_S" >&5 +echo "${ECHO_T}no, using $LN_S" >&6 +fi + +echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5 +echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6 +if test "${lt_cv_deplibs_check_method+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# `unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [[regex]]' -- check by looking for files in library path +# which responds to the $file_magic_cmd with a given extended regex. +# If you have `file' or equivalent on your system and you're not sure +# whether `pass_all' will *always* work, you probably want this one. + +case $host_os in +aix4* | aix5*) + lt_cv_deplibs_check_method=pass_all + ;; + +beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi[45]*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +cygwin*) + # func_win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + ;; + +mingw* | pw32*) + # Base MSYS/MinGW do not provide the 'file' command needed by + # func_win32_libid shell function, so use a weaker test based on 'objdump'. + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | kfreebsd*-gnu | dragonfly*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case "$host_cpu" in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux*) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +nto-qnx*) + lt_cv_deplibs_check_method=unknown + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +sco3.2v5*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; +esac + +fi +echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 +echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6 +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Check whether --enable-libtool-lock or --disable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then + enableval="$enable_libtool_lock" + +fi; +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '#line 3532 "configure"' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case "`/usr/bin/file conftest.o`" in + *32-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-linux*) + # Test if the compiler is 64bit + echo 'int i;' > conftest.$ac_ext + lt_cv_cc_64bit_output=no + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.$ac_objext` in + *"ELF 64"*) + lt_cv_cc_64bit_output=yes + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 +echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6 +if test "${lt_cv_cc_needs_belf+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + lt_cv_cc_needs_belf=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +lt_cv_cc_needs_belf=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 +echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6 + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +*-*-cygwin* | *-*-mingw* | *-*-pw32*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_DLLTOOL+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + echo "$as_me:$LINENO: result: $DLLTOOL" >&5 +echo "${ECHO_T}$DLLTOOL" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_DLLTOOL" && ac_cv_prog_ac_ct_DLLTOOL="false" +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + echo "$as_me:$LINENO: result: $ac_ct_DLLTOOL" >&5 +echo "${ECHO_T}$ac_ct_DLLTOOL" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + DLLTOOL=$ac_ct_DLLTOOL +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AS+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AS="${ac_tool_prefix}as" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +AS=$ac_cv_prog_AS +if test -n "$AS"; then + echo "$as_me:$LINENO: result: $AS" >&5 +echo "${ECHO_T}$AS" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_AS"; then + ac_ct_AS=$AS + # Extract the first word of "as", so it can be a program name with args. +set dummy as; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_AS+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_AS"; then + ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AS="as" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_AS" && ac_cv_prog_ac_ct_AS="false" +fi +fi +ac_ct_AS=$ac_cv_prog_ac_ct_AS +if test -n "$ac_ct_AS"; then + echo "$as_me:$LINENO: result: $ac_ct_AS" >&5 +echo "${ECHO_T}$ac_ct_AS" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + AS=$ac_ct_AS +else + AS="$ac_cv_prog_AS" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_OBJDUMP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + echo "$as_me:$LINENO: result: $OBJDUMP" >&5 +echo "${ECHO_T}$OBJDUMP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_OBJDUMP" && ac_cv_prog_ac_ct_OBJDUMP="false" +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + echo "$as_me:$LINENO: result: $ac_ct_OBJDUMP" >&5 +echo "${ECHO_T}$ac_ct_OBJDUMP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + OBJDUMP=$ac_ct_OBJDUMP +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + + ;; + +esac + +need_locks="$enable_libtool_lock" + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6 +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +if test "${ac_cv_header_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_header_stdc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_stdc=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + exit(2); + exit (0); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6 +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. + + + + + + + + + +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_Header=no" +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + +for ac_header in dlfcn.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + +if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 +echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6 +if test -z "$CXXCPP"; then + if test "${ac_cv_prog_CXXCPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Double quotes because CXXCPP needs to be expanded + for CXXCPP in "$CXX -E" "/lib/cpp" + do + ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break +fi + + done + ac_cv_prog_CXXCPP=$CXXCPP + +fi + CXXCPP=$ac_cv_prog_CXXCPP +else + ac_cv_prog_CXXCPP=$CXXCPP +fi +echo "$as_me:$LINENO: result: $CXXCPP" >&5 +echo "${ECHO_T}$CXXCPP" >&6 +ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +fi + + +ac_ext=f +ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' +ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_f77_compiler_gnu +if test -n "$ac_tool_prefix"; then + for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$F77"; then + ac_cv_prog_F77="$F77" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_F77="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +F77=$ac_cv_prog_F77 +if test -n "$F77"; then + echo "$as_me:$LINENO: result: $F77" >&5 +echo "${ECHO_T}$F77" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$F77" && break + done +fi +if test -z "$F77"; then + ac_ct_F77=$F77 + for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_F77"; then + ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_F77="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_F77=$ac_cv_prog_ac_ct_F77 +if test -n "$ac_ct_F77"; then + echo "$as_me:$LINENO: result: $ac_ct_F77" >&5 +echo "${ECHO_T}$ac_ct_F77" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_F77" && break +done + + F77=$ac_ct_F77 +fi + + +# Provide some information about the compiler. +echo "$as_me:4907:" \ + "checking for Fortran 77 compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +rm -f a.out + +# If we don't use `.F' as extension, the preprocessor is not run on the +# input file. (Note that this only needs to work for GNU compilers.) +ac_save_ext=$ac_ext +ac_ext=F +echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6 +if test "${ac_cv_f77_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF + program main +#ifndef __GNUC__ + choke me +#endif + + end +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_f77_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_f77_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6 +ac_ext=$ac_save_ext +ac_test_FFLAGS=${FFLAGS+set} +ac_save_FFLAGS=$FFLAGS +FFLAGS= +echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5 +echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_f77_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + FFLAGS=-g +cat >conftest.$ac_ext <<_ACEOF + program main + + end +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_f77_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_f77_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_f77_g=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5 +echo "${ECHO_T}$ac_cv_prog_f77_g" >&6 +if test "$ac_test_FFLAGS" = set; then + FFLAGS=$ac_save_FFLAGS +elif test $ac_cv_prog_f77_g = yes; then + if test "x$ac_cv_f77_compiler_gnu" = xyes; then + FFLAGS="-g -O2" + else + FFLAGS="-g" + fi +else + if test "x$ac_cv_f77_compiler_gnu" = xyes; then + FFLAGS="-O2" + else + FFLAGS= + fi +fi + +G77=`test $ac_compiler_gnu = yes && echo yes` +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + +# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! + +# find the maximum length of command line arguments +echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 +echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6 +if test "${lt_cv_sys_max_cmd_len+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for *BSD + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + *) + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \ + = "XX$teststring") >/dev/null 2>&1 && + new_result=`expr "X$teststring" : ".*" 2>&1` && + lt_cv_sys_max_cmd_len=$new_result && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + teststring= + # Add a significant safety factor because C++ compilers can tack on massive + # amounts of additional arguments before passing them to the linker. + # It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + ;; + esac + +fi + +if test -n $lt_cv_sys_max_cmd_len ; then + echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 +echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6 +else + echo "$as_me:$LINENO: result: none" >&5 +echo "${ECHO_T}none" >&6 +fi + + + + +# Check for command to grab the raw symbol name followed by C symbol from nm. +echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 +echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6 +if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[BCDEGRST]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([_A-Za-z][_A-Za-z0-9]*\)' + +# Transform an extracted symbol line into a proper C declaration +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw* | pw32*) + symcode='[ABCDGISTW]' + ;; +hpux*) # Its linker distinguishes data from code symbols + if test "$host_cpu" = ia64; then + symcode='[ABCDEGRST]' + fi + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + ;; +linux*) + if test "$host_cpu" = ia64; then + symcode='[ABCDGIRSTW]' + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + fi + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris* | sysv5*) + symcode='[BDRT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +esac + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[ABCDGIRSTW]' ;; +esac + +# Try without a prefix undercore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Now try to grab the symbols. + nlist=conftest.nm + if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5 + (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if grep ' nm_test_var$' "$nlist" >/dev/null; then + if grep ' nm_test_func$' "$nlist" >/dev/null; then + cat < conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif + +EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' + + cat <> conftest.$ac_ext +#if defined (__STDC__) && __STDC__ +# define lt_ptr_t void * +#else +# define lt_ptr_t char * +# define const +#endif + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + lt_ptr_t address; +} +lt_preloaded_symbols[] = +{ +EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext + cat <<\EOF >> conftest.$ac_ext + {0, (lt_ptr_t) 0} +}; + +#ifdef __cplusplus +} +#endif +EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS="$lt_save_LIBS" + CFLAGS="$lt_save_CFLAGS" + else + echo "cannot find nm_test_func in $nlist" >&5 + fi + else + echo "cannot find nm_test_var in $nlist" >&5 + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 + fi + else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -f conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done + +fi + +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + echo "$as_me:$LINENO: result: failed" >&5 +echo "${ECHO_T}failed" >&6 +else + echo "$as_me:$LINENO: result: ok" >&5 +echo "${ECHO_T}ok" >&6 +fi + +echo "$as_me:$LINENO: checking for objdir" >&5 +echo $ECHO_N "checking for objdir... $ECHO_C" >&6 +if test "${lt_cv_objdir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null +fi +echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 +echo "${ECHO_T}$lt_cv_objdir" >&6 +objdir=$lt_cv_objdir + + + + + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='sed -e 1s/^X//' +sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +# Constants: +rm="rm -f" + +# Global variables: +default_ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except M$VC, +# which needs '.lib'). +libext=a +ltmain="$ac_aux_dir/ltmain.sh" +ofile="$default_ofile" +with_gnu_ld="$lt_cv_prog_gnu_ld" + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + echo "$as_me:$LINENO: result: $AR" >&5 +echo "${ECHO_T}$AR" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="ar" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="false" +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 +echo "${ECHO_T}$ac_ct_AR" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + AR=$ac_ct_AR +else + AR="$ac_cv_prog_AR" +fi + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + RANLIB=$ac_ct_RANLIB +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + STRIP=$ac_ct_STRIP +else + STRIP="$ac_cv_prog_STRIP" +fi + + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru +test -z "$AS" && AS=as +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$DLLTOOL" && DLLTOOL=dlltool +test -z "$LD" && LD=ld +test -z "$LN_S" && LN_S="ln -s" +test -z "$MAGIC_CMD" && MAGIC_CMD=file +test -z "$NM" && NM=nm +test -z "$SED" && SED=sed +test -z "$OBJDUMP" && OBJDUMP=objdump +test -z "$RANLIB" && RANLIB=: +test -z "$STRIP" && STRIP=: +test -z "$ac_objext" && ac_objext=o + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" + ;; + *) + old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + +# Only perform the check for file, if the check method requires it +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 +echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6 +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/${ac_tool_prefix}file; then + lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 +echo "${ECHO_T}$MAGIC_CMD" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + echo "$as_me:$LINENO: checking for file" >&5 +echo $ECHO_N "checking for file... $ECHO_C" >&6 +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/file; then + lt_cv_path_MAGIC_CMD="$ac_dir/file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 +echo "${ECHO_T}$MAGIC_CMD" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + else + MAGIC_CMD=: + fi +fi + + fi + ;; +esac + +enable_dlopen=no +enable_win32_dll=yes + +# Check whether --enable-libtool-lock or --disable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then + enableval="$enable_libtool_lock" + +fi; +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + + +# Check whether --with-pic or --without-pic was given. +if test "${with_pic+set}" = set; then + withval="$with_pic" + pic_mode="$withval" +else + pic_mode=default +fi; +test -z "$pic_mode" && pic_mode=default + +# Check if we have a version mismatch between libtool.m4 and ltmain.sh. +# +# Note: This should be in AC_LIBTOOL_SETUP, _after_ $ltmain have been defined. +# We also should do it _before_ AC_LIBTOOL_LANG_C_CONFIG that actually +# calls AC_LIBTOOL_CONFIG and creates libtool. +# +echo "$as_me:$LINENO: checking for correct ltmain.sh version" >&5 +echo $ECHO_N "checking for correct ltmain.sh version... $ECHO_C" >&6 +if test -z "$ltmain"; then + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + echo + echo "*** Gentoo sanity check failed! ***" + echo "*** \$ltmain is not defined, please check the patch for consistency! ***" + echo + exit 1 +fi +gentoo_lt_version="1.5.18" +gentoo_ltmain_version=`grep '^[:space:]*VERSION=' $ltmain | sed -e 's|^[:space:]*VERSION=||'` +if test "$gentoo_lt_version" != "$gentoo_ltmain_version"; then + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + echo + echo "*** Gentoo sanity check failed! ***" + echo "*** libtool.m4 and ltmain.sh have a version mismatch! ***" + echo "*** (libtool.m4 = $gentoo_lt_version, ltmain.sh = $gentoo_ltmain_version) ***" + echo + echo "Please run:" + echo + echo " libtoolize --copy --force" + echo + echo "if appropriate, please contact the maintainer of this" + echo "package (or your distribution) for help." + echo + exit 1 +else + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +fi + + +# Use C for the default configuration in the libtool script +tagname= +lt_save_CC="$CC" +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +objext=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}\n' + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* + +ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* + + +# +# Check for any special shared library compilation flags. +# +lt_prog_cc_shlib= +if test "$GCC" = no; then + case $host_os in + sco3.2v5*) + lt_prog_cc_shlib='-belf' + ;; + esac +fi +if test -n "$lt_prog_cc_shlib"; then + { echo "$as_me:$LINENO: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&5 +echo "$as_me: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&2;} + if echo "$old_CC $old_CFLAGS " | grep "[ ]$lt_prog_cc_shlib[ ]" >/dev/null; then : + else + { echo "$as_me:$LINENO: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&5 +echo "$as_me: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&2;} + lt_cv_prog_cc_can_build_shared=no + fi +fi + + +# +# Check to make sure the static flag actually works. +# +echo "$as_me:$LINENO: checking if $compiler static flag $lt_prog_compiler_static works" >&5 +echo $ECHO_N "checking if $compiler static flag $lt_prog_compiler_static works... $ECHO_C" >&6 +if test "${lt_prog_compiler_static_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_static_works=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_prog_compiler_static" + printf "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $echo "X$_lt_linker_boilerplate" | $Xsed > conftest.exp + $SED '/^$/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_static_works=yes + fi + else + lt_prog_compiler_static_works=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works" >&6 + +if test x"$lt_prog_compiler_static_works" = xyes; then + : +else + lt_prog_compiler_static= +fi + + + + +lt_prog_compiler_no_builtin_flag= + +if test "$GCC" = yes; then + lt_prog_compiler_no_builtin_flag=' -fno-builtin' + + +echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 +if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:6046: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:6050: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp + $SED '/^$/d' conftest.err >conftest.er2 + if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 + +if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then + lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" +else + : +fi + +fi + +lt_prog_compiler_wl= +lt_prog_compiler_pic= +lt_prog_compiler_static= + +echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 + + if test "$GCC" = yes; then + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_static='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + fi + ;; + + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' + ;; + + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared=no + enable_shared=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi + ;; + + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case "$host_cpu" in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + ;; + + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + else + lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' + fi + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + lt_prog_compiler_pic='-qnocommon' + lt_prog_compiler_wl='-Wl,' + ;; + esac + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case "$host_cpu" in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static='-non_shared' + ;; + + newsos6) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + linux*) + case $cc_basename in + icc* | ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + pgcc* | pgf77* | pgf90*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-static' + ;; + ccc*) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + esac + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + + sco3.2v5*) + lt_prog_compiler_pic='-Kpic' + lt_prog_compiler_static='-dn' + ;; + + solaris*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + lt_prog_compiler_wl='-Qoption ld ';; + *) + lt_prog_compiler_wl='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl='-Qoption ld ' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic='-Kconform_pic' + lt_prog_compiler_static='-Bstatic' + fi + ;; + + unicos*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_can_build_shared=no + ;; + + uts4*) + lt_prog_compiler_pic='-pic' + lt_prog_compiler_static='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared=no + ;; + esac + fi + +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic" >&6 + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + +echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6 +if test "${lt_prog_compiler_pic_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic -DPIC" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:6308: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:6312: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp + $SED '/^$/d' conftest.err >conftest.er2 + if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_pic_works=yes + fi + fi + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6 + +if test x"$lt_prog_compiler_pic_works" = xyes; then + case $lt_prog_compiler_pic in + "" | " "*) ;; + *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; + esac +else + lt_prog_compiler_pic= + lt_prog_compiler_can_build_shared=no +fi + +fi +case "$host_os" in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic= + ;; + *) + lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" + ;; +esac + +echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 +if test "${lt_cv_prog_compiler_c_o+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_c_o=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:6370: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:6374: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $echo "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp + $SED '/^$/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6 + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6 + if test "$hard_links" = no; then + { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + +echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 + + runpath_var= + allow_undefined_flag= + enable_shared_with_static_runtimes=no + archive_cmds= + archive_expsym_cmds= + old_archive_From_new_cmds= + old_archive_from_expsyms_cmds= + export_dynamic_flag_spec= + whole_archive_flag_spec= + thread_safe_flag_spec= + hardcode_libdir_flag_spec= + hardcode_libdir_flag_spec_ld= + hardcode_libdir_separator= + hardcode_direct=no + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported + link_all_deplibs=unknown + hardcode_automatic=no + module_cmds= + module_expsym_cmds= + always_export_symbols=no + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms="_GLOBAL_OFFSET_TABLE_" + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + extract_expsyms_cmds= + # Just being paranoid about ensuring that cc_basename is set. + for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + case $host_os in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + ld_shlibs=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec= + fi + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + cat <&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +EOF + fi + ;; + + amigaos*) + archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can't use + # them. + ld_shlibs=no + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs=no + fi + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + allow_undefined_flag=unsupported + always_export_symbols=no + enable_shared_with_static_runtimes=yes + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + else + ld_shlibs=no + fi + ;; + + linux*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + tmp_addflag= + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec='${wl}--whole-archive,`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* ) # Portland Group f77 and f90 compilers + whole_archive_flag_spec='${wl}--whole-archive,`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + esac + archive_cmds='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test $supports_anon_versioning = yes; then + archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + $echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + else + ld_shlibs=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris* | sysv5*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +EOF + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + + sunos4*) + archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + + if test "$ld_shlibs" = no; then + runpath_var= + hardcode_libdir_flag_spec= + export_dynamic_flag_spec= + whole_archive_flag_spec= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag=unsupported + always_export_symbols=yes + archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$GCC" = yes && test -z "$link_static_flag"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds='' + hardcode_direct=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct=yes + else + # We have old collect2 + hardcode_direct=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag='-berok' + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag="-z nodefs" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag=' ${wl}-bernotok' + allow_undefined_flag=' ${wl}-berok' + # -bexpall does not export symbols beginning with underscore (_) + always_export_symbols=yes + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec=' ' + archive_cmds_need_lc=yes + # This is similar to how AIX traditionally builds it's shared libraries. + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + # see comment about different semantics on the GNU ld section + ld_shlibs=no + ;; + + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; + + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_From_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes=yes + ;; + + darwin* | rhapsody*) + case "$host_os" in + rhapsody* | darwin1.[012]) + allow_undefined_flag='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[012]) + allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + whole_archive_flag_spec='' + link_all_deplibs=yes + if test "$GCC" = yes ; then + output_verbose_link_cmd='echo' + archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's + archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's + archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + ld_shlibs=no + ;; + esac + fi + ;; + + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + freebsd1*) + ld_shlibs=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | kfreebsd*-gnu | dragonfly*) + archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + hpux9*) + if test "$GCC" = yes; then + archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + export_dynamic_flag_spec='${wl}-E' + ;; + + hpux10* | hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case "$host_cpu" in + hppa*64*|ia64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case "$host_cpu" in + hppa*64*|ia64*) + archive_cmds='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' + ;; + *) + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + case "$host_cpu" in + hppa*64*) + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_flag_spec_ld='+b $libdir' + hardcode_libdir_separator=: + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + ia64*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=no + hardcode_shlibpath_var=no + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + *) + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + export_dynamic_flag_spec='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_ld='-rpath $libdir' + fi + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + link_all_deplibs=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + newsos6) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_shlibpath_var=no + ;; + + openbsd*) + hardcode_direct=yes + hardcode_shlibpath_var=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac + fi + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + fi + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + hardcode_libdir_separator=: + ;; + + sco3.2v5*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='${wl}-Bexport' + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ;; + + solaris*) + no_undefined_flag=' -z text' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + wlarc='' + archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_shlibpath_var=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine linker options so we + # cannot just pass the convience library names through + # without $wl, iff we do not link with $LD. + # Luckily, gcc supports the same syntax we need for Sun Studio. + # Supported since Solaris 2.6 (maybe 2.5.1?) + case $wlarc in + '') + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; + *) + whole_archive_flag_spec='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; + esac ;; + esac + link_all_deplibs=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds='$CC -r -o $output$reload_objs' + hardcode_direct=no + ;; + motorola) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + + sysv4.3*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs=yes + fi + ;; + + sysv4.2uw2*) + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=no + hardcode_shlibpath_var=no + hardcode_runpath_var=yes + runpath_var=LD_RUN_PATH + ;; + + sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) + no_undefined_flag='${wl}-z ${wl}text' + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + + sysv5*) + no_undefined_flag=' -z text' + # $CC -shared without GNU ld will not create a library from C++ + # object files and a static libstdc++, better avoid it by now + archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + hardcode_libdir_flag_spec= + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + ;; + + uts4*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + *) + ld_shlibs=no + ;; + esac + fi + +echo "$as_me:$LINENO: result: $ld_shlibs" >&5 +echo "${ECHO_T}$ld_shlibs" >&6 +test "$ld_shlibs" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 + $rm conftest* + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 + (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + archive_cmds_need_lc=no + else + archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 +echo "${ECHO_T}$archive_cmds_need_lc" >&6 + ;; + esac + fi + ;; +esac + +echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + linux*) + if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + if test $supports_anon_versioning = yes; then + archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ +cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ +$echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + else + $archive_expsym_cmds="$archive_cmds" + fi + else + ld_shlibs=no + fi + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +kfreebsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + *) # from 3.2 on + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case "$host_cpu" in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + case $host_cpu:$lt_cv_cc_64bit_output in + powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes) + sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /usr/X11R6/lib64" + sys_lib_search_path_spec="/lib64 /usr/lib64 /usr/local/lib64 /usr/X11R6/lib64" + ;; + esac + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + + # Find out which ABI we are using (multilib Linux x86_64 hack). + libsuff= + case "$host_cpu" in + x86_64*) + echo '#line 7801 "configure"' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.$ac_objext` in + *64-bit*) + libsuff=64 + ;; + esac + fi + rm -rf conftest* + ;; + *) + ;; + esac + sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}" + sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" + ;; + +knetbsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +sco3.2v5*) + version_type=osf + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6 +test "$dynamic_linker" = no && can_build_shared=no + +echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || \ + test -n "$runpath_var" || \ + test "X$hardcode_automatic" = "Xyes" ; then + + # We can hardcode non-existant directories. + if test "$hardcode_direct" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, )" != no && + test "$hardcode_minus_L" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action=unsupported +fi +echo "$as_me:$LINENO: result: $hardcode_action" >&5 +echo "${ECHO_T}$hardcode_action" >&6 + +if test "$hardcode_action" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + +striplib= +old_striplib= +echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 +echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 +if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + ;; + *) + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + ;; + esac +fi + +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dl_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dl_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 +if test $ac_cv_lib_dl_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + +fi + + ;; + + *) + echo "$as_me:$LINENO: checking for shl_load" >&5 +echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 +if test "${ac_cv_func_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define shl_load to an innocuous variant, in case declares shl_load. + For example, HP-UX 11i declares gettimeofday. */ +#define shl_load innocuous_shl_load + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char shl_load (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef shl_load + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char shl_load (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_shl_load) || defined (__stub___shl_load) +choke me +#else +char (*f) () = shl_load; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != shl_load; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_shl_load=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 +echo "${ECHO_T}$ac_cv_func_shl_load" >&6 +if test $ac_cv_func_shl_load = yes; then + lt_cv_dlopen="shl_load" +else + echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 +if test "${ac_cv_lib_dld_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char shl_load (); +int +main () +{ +shl_load (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dld_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dld_shl_load=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 +if test $ac_cv_lib_dld_shl_load = yes; then + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" +else + echo "$as_me:$LINENO: checking for dlopen" >&5 +echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 +if test "${ac_cv_func_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define dlopen to an innocuous variant, in case declares dlopen. + For example, HP-UX 11i declares gettimeofday. */ +#define dlopen innocuous_dlopen + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char dlopen (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef dlopen + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_dlopen) || defined (__stub___dlopen) +choke me +#else +char (*f) () = dlopen; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != dlopen; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 +echo "${ECHO_T}$ac_cv_func_dlopen" >&6 +if test $ac_cv_func_dlopen = yes; then + lt_cv_dlopen="dlopen" +else + echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dl_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dl_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 +if test $ac_cv_lib_dl_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 +echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 +if test "${ac_cv_lib_svld_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_svld_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_svld_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 +if test $ac_cv_lib_svld_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 +echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 +if test "${ac_cv_lib_dld_dld_link+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dld_link (); +int +main () +{ +dld_link (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dld_dld_link=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dld_dld_link=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 +if test $ac_cv_lib_dld_dld_link = yes; then + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" +fi + + +fi + + +fi + + +fi + + +fi + + +fi + + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 +echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 +if test "${lt_cv_dlopen_self+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + + exit (status); +} +EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_unknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self" >&6 + + if test "x$lt_cv_dlopen_self" = xyes; then + LDFLAGS="$LDFLAGS $link_static_flag" + echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 +echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 +if test "${lt_cv_dlopen_self_static+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self_static=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + + exit (status); +} +EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi + + +# Report which librarie types wil actually be built +echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 +echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $can_build_shared" >&5 +echo "${ECHO_T}$can_build_shared" >&6 + +echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 +echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 +test "$can_build_shared" = "no" && enable_shared=no + +# On AIX, shared libraries and static libraries use the same namespace, and +# are all built from PIC. +case "$host_os" in +aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + +aix4* | aix5*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; +esac +echo "$as_me:$LINENO: result: $enable_shared" >&5 +echo "${ECHO_T}$enable_shared" >&6 + +echo "$as_me:$LINENO: checking whether to build static libraries" >&5 +echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 +# Make sure either enable_shared or enable_static is yes. +test "$enable_shared" = yes || enable_static=yes +echo "$as_me:$LINENO: result: $enable_static" >&5 +echo "${ECHO_T}$enable_static" >&6 + +# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler \ + CC \ + LD \ + lt_prog_compiler_wl \ + lt_prog_compiler_pic \ + lt_prog_compiler_static \ + lt_prog_compiler_no_builtin_flag \ + export_dynamic_flag_spec \ + thread_safe_flag_spec \ + whole_archive_flag_spec \ + enable_shared_with_static_runtimes \ + old_archive_cmds \ + old_archive_from_new_cmds \ + predep_objects \ + postdep_objects \ + predeps \ + postdeps \ + compiler_lib_search_path \ + archive_cmds \ + archive_expsym_cmds \ + postinstall_cmds \ + postuninstall_cmds \ + old_archive_from_expsyms_cmds \ + allow_undefined_flag \ + no_undefined_flag \ + export_symbols_cmds \ + hardcode_libdir_flag_spec \ + hardcode_libdir_flag_spec_ld \ + hardcode_libdir_separator \ + hardcode_automatic \ + module_cmds \ + module_expsym_cmds \ + lt_cv_prog_compiler_c_o \ + exclude_expsyms \ + include_expsyms; do + + case $var in + old_archive_cmds | \ + old_archive_from_new_cmds | \ + archive_cmds | \ + archive_expsym_cmds | \ + module_cmds | \ + module_expsym_cmds | \ + old_archive_from_expsyms_cmds | \ + export_symbols_cmds | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + +cfgfile="${ofile}T" + trap "$rm \"$cfgfile\"; exit 1" 1 2 15 + $rm -f "$cfgfile" + { echo "$as_me:$LINENO: creating $ofile" >&5 +echo "$as_me: creating $ofile" >&6;} + + cat <<__EOF__ >> "$cfgfile" +#! $SHELL + +# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# +# This file is part of GNU Libtool: +# Originally by Gordon Matzigkeit , 1996 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# A sed program that does not truncate output. +SED=$lt_SED + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="$SED -e 1s/^X//" + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# The names of the tagged configurations supported by this script. +available_tags= + +# ### BEGIN LIBTOOL CONFIG + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# A language-specific compiler. +CC=$lt_compiler + +# Is the compiler the GNU C compiler? +with_gcc=$GCC + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_LD + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$lt_STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds + +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds +module_expsym_cmds=$lt_module_expsym_cmds + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_predep_objects + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_postdep_objects + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms + +# ### END LIBTOOL CONFIG + +__EOF__ + + + case $host_os in + aix3*) + cat <<\EOF >> "$cfgfile" + +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +EOF + ;; + esac + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || \ + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC="$lt_save_CC" + + +# Check whether --with-tags or --without-tags was given. +if test "${with_tags+set}" = set; then + withval="$with_tags" + tagnames="$withval" +fi; + +if test -f "$ltmain" && test -n "$tagnames"; then + if test ! -f "${ofile}"; then + { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5 +echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;} + fi + + if test -z "$LTCC"; then + eval "`$SHELL ${ofile} --config | grep '^LTCC='`" + if test -z "$LTCC"; then + { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5 +echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;} + else + { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5 +echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;} + fi + fi + + # Extract list of available tagged configurations in $ofile. + # Note that this assumes the entire list is on one line. + available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` + + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for tagname in $tagnames; do + IFS="$lt_save_ifs" + # Check whether tagname contains only valid characters + case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in + "") ;; + *) { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5 +echo "$as_me: error: invalid tag name: $tagname" >&2;} + { (exit 1); exit 1; }; } + ;; + esac + + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null + then + { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5 +echo "$as_me: error: tag name \"$tagname\" already exists" >&2;} + { (exit 1); exit 1; }; } + fi + + # Update the list of available tags. + if test -n "$tagname"; then + echo appending configuration tag \"$tagname\" to $ofile + + case $tagname in + CXX) + if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + + + +archive_cmds_need_lc_CXX=no +allow_undefined_flag_CXX= +always_export_symbols_CXX=no +archive_expsym_cmds_CXX= +export_dynamic_flag_spec_CXX= +hardcode_direct_CXX=no +hardcode_libdir_flag_spec_CXX= +hardcode_libdir_flag_spec_ld_CXX= +hardcode_libdir_separator_CXX= +hardcode_minus_L_CXX=no +hardcode_automatic_CXX=no +module_cmds_CXX= +module_expsym_cmds_CXX= +link_all_deplibs_CXX=unknown +old_archive_cmds_CXX=$old_archive_cmds +no_undefined_flag_CXX= +whole_archive_flag_spec_CXX= +enable_shared_with_static_runtimes_CXX=no + +# Dependencies to place before and after the object being linked: +predep_objects_CXX= +postdep_objects_CXX= +predeps_CXX= +postdeps_CXX= +compiler_lib_search_path_CXX= + +# Source file extension for C++ test sources. +ac_ext=cc + +# Object file extension for compiled C++ test sources. +objext=o +objext_CXX=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(int, char *) { return(0); }\n' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* + +ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* + + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_LD=$LD +lt_save_GCC=$GCC +GCC=$GXX +lt_save_with_gnu_ld=$with_gnu_ld +lt_save_path_LD=$lt_cv_path_LD +if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx +else + unset lt_cv_prog_gnu_ld +fi +if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX +else + unset lt_cv_path_LD +fi +test -z "${LDCXX+set}" || LD=$LDCXX +CC=${CXX-"c++"} +compiler=$CC +compiler_CXX=$CC +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + +# We don't want -fno-exception wen compiling C++ code, so set the +# no_builtin_flag separately +if test "$GXX" = yes; then + lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' +else + lt_prog_compiler_no_builtin_flag_CXX= +fi + +if test "$GXX" = yes; then + # Set up default GNU C++ configuration + + +# Check whether --with-gnu-ld or --without-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then + withval="$with_gnu_ld" + test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi; +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + echo "$as_me:$LINENO: checking for ld used by $CC" >&5 +echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6 + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + echo "$as_me:$LINENO: checking for GNU ld" >&5 +echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 +else + echo "$as_me:$LINENO: checking for non-GNU ld" >&5 +echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 +fi +if test "${lt_cv_path_LD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some GNU ld's only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +echo "${ECHO_T}$LD" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi +test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 +echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} + { (exit 1); exit 1; }; } +echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 +if test "${lt_cv_prog_gnu_ld+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # I'd rather use --version here, but apparently some GNU ld's only accept -v. +case `$LD -v 2>&1 &5 +echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='${wl}' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ + grep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec_CXX= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + +else + GXX=no + with_gnu_ld=no + wlarc= +fi + +# PORTME: fill in a description of your system's C++ link characteristics +echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 +ld_shlibs_CXX=yes +case $host_os in + aix3*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds_CXX='' + hardcode_direct_CXX=yes + hardcode_libdir_separator_CXX=':' + link_all_deplibs_CXX=yes + + if test "$GXX" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct_CXX=yes + else + # We have old collect2 + hardcode_direct_CXX=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L_CXX=yes + hardcode_libdir_flag_spec_CXX='-L$libdir' + hardcode_libdir_separator_CXX= + fi + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols_CXX=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag_CXX='-berok' + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" + + archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag_CXX="-z nodefs" + archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag_CXX=' ${wl}-bernotok' + allow_undefined_flag_CXX=' ${wl}-berok' + # -bexpall does not export symbols beginning with underscore (_) + always_export_symbols_CXX=yes + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_CXX=' ' + archive_cmds_need_lc_CXX=yes + # This is similar to how AIX traditionally builds it's shared libraries. + archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_CXX='-L$libdir' + allow_undefined_flag_CXX=unsupported + always_export_symbols_CXX=no + enable_shared_with_static_runtimes_CXX=yes + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + else + ld_shlibs_CXX=no + fi + ;; + darwin* | rhapsody*) + case "$host_os" in + rhapsody* | darwin1.[012]) + allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[012]) + allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + allow_undefined_flag_CXX='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + archive_cmds_need_lc_CXX=no + hardcode_direct_CXX=no + hardcode_automatic_CXX=yes + hardcode_shlibpath_var_CXX=unsupported + whole_archive_flag_spec_CXX='' + link_all_deplibs_CXX=yes + + if test "$GXX" = yes ; then + lt_int_apple_cc_single_mod=no + output_verbose_link_cmd='echo' + if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then + lt_int_apple_cc_single_mod=yes + fi + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + else + archive_cmds_CXX='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + fi + module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's + archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + ld_shlibs_CXX=no + ;; + esac + fi + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + freebsd[12]*) + # C++ shared libraries reported to be fairly broken before switch to ELF + ld_shlibs_CXX=no + ;; + freebsd-elf*) + archive_cmds_need_lc_CXX=no + ;; + freebsd* | kfreebsd*-gnu | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + ld_shlibs_CXX=yes + ;; + gnu*) + ;; + hpux9*) + hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_CXX=: + export_dynamic_flag_spec_CXX='${wl}-E' + hardcode_direct_CXX=yes + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aCC*) + archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + case "$host_cpu" in + hppa*64*) + hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' + hardcode_libdir_flag_spec_ld_CXX='+b $libdir' + hardcode_libdir_separator_CXX=: + ;; + ia64*) + hardcode_libdir_flag_spec_CXX='-L$libdir' + ;; + *) + hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_CXX=: + export_dynamic_flag_spec_CXX='${wl}-E' + ;; + esac + fi + case "$host_cpu" in + hppa*64*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + ;; + ia64*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + *) + hardcode_direct_CXX=yes + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aCC*) + case "$host_cpu" in + hppa*64*|ia64*) + archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' + ;; + *) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case "$host_cpu" in + ia64*|hppa*64*) + archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' + ;; + *) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' + fi + fi + link_all_deplibs_CXX=yes + ;; + esac + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + ;; + linux*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + + hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc*) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + archive_cmds_need_lc_CXX=no + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + pgCC*) + # Portland Group C++ compiler + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + whole_archive_flag_spec_CXX='${wl}--whole-archive,`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + ;; + cxx*) + # Compaq C++ + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + esac + ;; + lynxos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + m88k*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + openbsd2*) + # C++ shared libraries are fairly broken + ld_shlibs_CXX=no + ;; + openbsd*) + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=no + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + export_dynamic_flag_spec_CXX='${wl}-E' + whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + fi + output_verbose_link_cmd='echo' + ;; + osf3*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + hardcode_libdir_separator_CXX=: + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' + + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + cxx*) + allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + hardcode_libdir_separator_CXX=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + cxx*) + allow_undefined_flag_CXX=' -expect_unresolved \*' + archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ + $rm $lib.exp' + + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + psos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + sco*) + archive_cmds_need_lc_CXX=no + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + no_undefined_flag_CXX=' -zdefs' + archive_cmds_CXX='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_shlibpath_var_CXX=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The C++ compiler is used as linker so we must use $wl + # flag to pass the commands to the underlying system + # linker. We must also pass each convience library through + # to the system linker between allextract/defaultextract. + # The C++ compiler will combine linker options so we + # cannot just pass the convience library names through + # without $wl. + # Supported since Solaris 2.6 (maybe 2.5.1?) + whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' + ;; + esac + link_all_deplibs_CXX=yes + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[LR]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + no_undefined_flag_CXX=' ${wl}-z ${wl}defs' + if $CC --version | grep -v '^2\.7' > /dev/null; then + archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + fi + + hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' + fi + ;; + esac + ;; + sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) + archive_cmds_need_lc_CXX=no + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + vxworks*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; +esac +echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 +echo "${ECHO_T}$ld_shlibs_CXX" >&6 +test "$ld_shlibs_CXX" = no && can_build_shared=no + +GCC_CXX="$GXX" +LD_CXX="$LD" + + +cat > conftest.$ac_ext <&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Parse the compiler output and extract the necessary + # objects, libraries and library flags. + + # Sentinel used to keep track of whether or not we are before + # the conftest object file. + pre_test_object_deps_done=no + + # The `*' in the case matches for architectures that use `case' in + # $output_verbose_cmd can trigger glob expansion during the loop + # eval without this substitution. + output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e \"$no_glob_subst\"`" + + for p in `eval $output_verbose_link_cmd`; do + case $p in + + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. + if test $p = "-L" \ + || test $p = "-R"; then + prev=$p + continue + else + prev= + fi + + if test "$pre_test_object_deps_done" = no; then + case $p in + -L* | -R*) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$compiler_lib_search_path_CXX"; then + compiler_lib_search_path_CXX="${prev}${p}" + else + compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" + fi + ;; + # The "-l" case would never come before the object being + # linked, so don't bother handling this case. + esac + else + if test -z "$postdeps_CXX"; then + postdeps_CXX="${prev}${p}" + else + postdeps_CXX="${postdeps_CXX} ${prev}${p}" + fi + fi + ;; + + *.$objext) + # This assumes that the test object file only shows up + # once in the compiler output. + if test "$p" = "conftest.$objext"; then + pre_test_object_deps_done=yes + continue + fi + + if test "$pre_test_object_deps_done" = no; then + if test -z "$predep_objects_CXX"; then + predep_objects_CXX="$p" + else + predep_objects_CXX="$predep_objects_CXX $p" + fi + else + if test -z "$postdep_objects_CXX"; then + postdep_objects_CXX="$p" + else + postdep_objects_CXX="$postdep_objects_CXX $p" + fi + fi + ;; + + *) ;; # Ignore the rest. + + esac + done + + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling CXX test program" +fi + +$rm -f confest.$objext + +case " $postdeps_CXX " in +*" -lc "*) archive_cmds_need_lc_CXX=no ;; +esac + +lt_prog_compiler_wl_CXX= +lt_prog_compiler_pic_CXX= +lt_prog_compiler_static_CXX= + +echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 + + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + fi + ;; + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' + ;; + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | os2* | pw32*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_CXX='-DDLL_EXPORT' + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic_CXX='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + lt_prog_compiler_pic_CXX= + ;; + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic_CXX=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case "$host_cpu" in + hppa*64*|ia64*) + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac + else + case $host_os in + aix4* | aix5*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + else + lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + lt_prog_compiler_pic_CXX='-qnocommon' + lt_prog_compiler_wl_CXX='-Wl,' + ;; + esac + ;; + dgux*) + case $cc_basename in + ec++*) + lt_prog_compiler_pic_CXX='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | kfreebsd*-gnu | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" + if test "$host_cpu" != ia64; then + lt_prog_compiler_pic_CXX='+Z' + fi + ;; + aCC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" + case "$host_cpu" in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_CXX='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux*) + case $cc_basename in + KCC*) + # KAI C++ Compiler + lt_prog_compiler_wl_CXX='--backend -Wl,' + lt_prog_compiler_pic_CXX='-fPIC' + ;; + icpc* | ecpc*) + # Intel C++ + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-static' + ;; + pgCC*) + # Portland Group C++ compiler. + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-fpic' + lt_prog_compiler_static_CXX='-static' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + *) + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + lt_prog_compiler_pic_CXX='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + lt_prog_compiler_wl_CXX='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + lt_prog_compiler_pic_CXX='-pic' + ;; + cxx*) + # Digital/Compaq C++ + lt_prog_compiler_wl_CXX='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + sco*) + case $cc_basename in + CC*) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + *) + ;; + esac + ;; + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + lt_prog_compiler_wl_CXX='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + lt_prog_compiler_pic_CXX='-pic' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + lcc*) + # Lucid + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + lt_prog_compiler_pic_CXX='-KPIC' + ;; + *) + ;; + esac + ;; + unixware*) + ;; + vxworks*) + ;; + *) + lt_prog_compiler_can_build_shared_CXX=no + ;; + esac + fi + +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6 + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_CXX"; then + +echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6 +if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_pic_works_CXX=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:11011: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:11015: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp + $SED '/^$/d' conftest.err >conftest.er2 + if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_pic_works_CXX=yes + fi + fi + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6 + +if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then + case $lt_prog_compiler_pic_CXX in + "" | " "*) ;; + *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; + esac +else + lt_prog_compiler_pic_CXX= + lt_prog_compiler_can_build_shared_CXX=no +fi + +fi +case "$host_os" in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic_CXX= + ;; + *) + lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" + ;; +esac + +echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 +if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_c_o_CXX=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:11073: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:11077: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $echo "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp + $SED '/^$/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_CXX=yes + fi + fi + chmod u+w . + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6 + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6 + if test "$hard_links" = no; then + { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + +echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 + + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + case $host_os in + aix4* | aix5*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + export_symbols_cmds_CXX="$ltdll_cmds" + ;; + cygwin* | mingw*) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([^ ]*\) [^ ]*/\1 DATA/;/^I /d;/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + ;; + *) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac + +echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 +echo "${ECHO_T}$ld_shlibs_CXX" >&6 +test "$ld_shlibs_CXX" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc_CXX" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc_CXX=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds_CXX in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 + $rm conftest* + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_CXX + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_CXX + allow_undefined_flag_CXX= + if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 + (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + archive_cmds_need_lc_CXX=no + else + archive_cmds_need_lc_CXX=yes + fi + allow_undefined_flag_CXX=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5 +echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6 + ;; + esac + fi + ;; +esac + +echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + linux*) + if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + if test $supports_anon_versioning = yes; then + archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ +cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ +$echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + else + $archive_expsym_cmds="$archive_cmds" + fi + else + ld_shlibs=no + fi + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +kfreebsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + *) # from 3.2 on + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case "$host_cpu" in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + case $host_cpu:$lt_cv_cc_64bit_output in + powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes) + sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /usr/X11R6/lib64" + sys_lib_search_path_spec="/lib64 /usr/lib64 /usr/local/lib64 /usr/X11R6/lib64" + ;; + esac + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + + # Find out which ABI we are using (multilib Linux x86_64 hack). + libsuff= + case "$host_cpu" in + x86_64*) + echo '#line 11633 "configure"' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.$ac_objext` in + *64-bit*) + libsuff=64 + ;; + esac + fi + rm -rf conftest* + ;; + *) + ;; + esac + sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}" + sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" + ;; + +knetbsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +sco3.2v5*) + version_type=osf + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6 +test "$dynamic_linker" = no && can_build_shared=no + +echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 +hardcode_action_CXX= +if test -n "$hardcode_libdir_flag_spec_CXX" || \ + test -n "$runpath_var_CXX" || \ + test "X$hardcode_automatic_CXX" = "Xyes" ; then + + # We can hardcode non-existant directories. + if test "$hardcode_direct_CXX" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no && + test "$hardcode_minus_L_CXX" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action_CXX=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action_CXX=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action_CXX=unsupported +fi +echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5 +echo "${ECHO_T}$hardcode_action_CXX" >&6 + +if test "$hardcode_action_CXX" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + +striplib= +old_striplib= +echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 +echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 +if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + ;; + *) + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + ;; + esac +fi + +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dl_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dl_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 +if test $ac_cv_lib_dl_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + +fi + + ;; + + *) + echo "$as_me:$LINENO: checking for shl_load" >&5 +echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 +if test "${ac_cv_func_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define shl_load to an innocuous variant, in case declares shl_load. + For example, HP-UX 11i declares gettimeofday. */ +#define shl_load innocuous_shl_load + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char shl_load (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef shl_load + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char shl_load (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_shl_load) || defined (__stub___shl_load) +choke me +#else +char (*f) () = shl_load; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != shl_load; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_shl_load=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 +echo "${ECHO_T}$ac_cv_func_shl_load" >&6 +if test $ac_cv_func_shl_load = yes; then + lt_cv_dlopen="shl_load" +else + echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 +if test "${ac_cv_lib_dld_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char shl_load (); +int +main () +{ +shl_load (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dld_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dld_shl_load=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 +if test $ac_cv_lib_dld_shl_load = yes; then + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" +else + echo "$as_me:$LINENO: checking for dlopen" >&5 +echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 +if test "${ac_cv_func_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define dlopen to an innocuous variant, in case declares dlopen. + For example, HP-UX 11i declares gettimeofday. */ +#define dlopen innocuous_dlopen + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char dlopen (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef dlopen + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_dlopen) || defined (__stub___dlopen) +choke me +#else +char (*f) () = dlopen; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != dlopen; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 +echo "${ECHO_T}$ac_cv_func_dlopen" >&6 +if test $ac_cv_func_dlopen = yes; then + lt_cv_dlopen="dlopen" +else + echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dl_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dl_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 +if test $ac_cv_lib_dl_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 +echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 +if test "${ac_cv_lib_svld_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_svld_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_svld_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 +if test $ac_cv_lib_svld_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 +echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 +if test "${ac_cv_lib_dld_dld_link+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dld_link (); +int +main () +{ +dld_link (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dld_dld_link=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dld_dld_link=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 +if test $ac_cv_lib_dld_dld_link = yes; then + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" +fi + + +fi + + +fi + + +fi + + +fi + + +fi + + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 +echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 +if test "${lt_cv_dlopen_self+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + + exit (status); +} +EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_unknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self" >&6 + + if test "x$lt_cv_dlopen_self" = xyes; then + LDFLAGS="$LDFLAGS $link_static_flag" + echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 +echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 +if test "${lt_cv_dlopen_self_static+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self_static=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + + exit (status); +} +EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi + + +# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler_CXX \ + CC_CXX \ + LD_CXX \ + lt_prog_compiler_wl_CXX \ + lt_prog_compiler_pic_CXX \ + lt_prog_compiler_static_CXX \ + lt_prog_compiler_no_builtin_flag_CXX \ + export_dynamic_flag_spec_CXX \ + thread_safe_flag_spec_CXX \ + whole_archive_flag_spec_CXX \ + enable_shared_with_static_runtimes_CXX \ + old_archive_cmds_CXX \ + old_archive_from_new_cmds_CXX \ + predep_objects_CXX \ + postdep_objects_CXX \ + predeps_CXX \ + postdeps_CXX \ + compiler_lib_search_path_CXX \ + archive_cmds_CXX \ + archive_expsym_cmds_CXX \ + postinstall_cmds_CXX \ + postuninstall_cmds_CXX \ + old_archive_from_expsyms_cmds_CXX \ + allow_undefined_flag_CXX \ + no_undefined_flag_CXX \ + export_symbols_cmds_CXX \ + hardcode_libdir_flag_spec_CXX \ + hardcode_libdir_flag_spec_ld_CXX \ + hardcode_libdir_separator_CXX \ + hardcode_automatic_CXX \ + module_cmds_CXX \ + module_expsym_cmds_CXX \ + lt_cv_prog_compiler_c_o_CXX \ + exclude_expsyms_CXX \ + include_expsyms_CXX; do + + case $var in + old_archive_cmds_CXX | \ + old_archive_from_new_cmds_CXX | \ + archive_cmds_CXX | \ + archive_expsym_cmds_CXX | \ + module_cmds_CXX | \ + module_expsym_cmds_CXX | \ + old_archive_from_expsyms_cmds_CXX | \ + export_symbols_cmds_CXX | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + +cfgfile="$ofile" + + cat <<__EOF__ >> "$cfgfile" +# ### BEGIN LIBTOOL TAG CONFIG: $tagname + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_CXX + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# A language-specific compiler. +CC=$lt_compiler_CXX + +# Is the compiler the GNU C compiler? +with_gcc=$GCC_CXX + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_LD_CXX + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$lt_STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_CXX + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_CXX +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_CXX + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds_CXX +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX + +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds_CXX +archive_expsym_cmds=$lt_archive_expsym_cmds_CXX +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds_CXX +module_expsym_cmds=$lt_module_expsym_cmds_CXX + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_predep_objects_CXX + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_postdep_objects_CXX + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps_CXX + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps_CXX + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_CXX + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_CXX + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_CXX + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_CXX + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct_CXX + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L_CXX + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic_CXX + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_CXX + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path_CXX" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols_CXX + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_CXX + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_CXX + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_CXX + +# ### END LIBTOOL TAG CONFIG: $tagname + +__EOF__ + + +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC=$lt_save_CC +LDCXX=$LD +LD=$lt_save_LD +GCC=$lt_save_GCC +with_gnu_ldcxx=$with_gnu_ld +with_gnu_ld=$lt_save_with_gnu_ld +lt_cv_path_LDCXX=$lt_cv_path_LD +lt_cv_path_LD=$lt_save_path_LD +lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld +lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld + + else + tagname="" + fi + ;; + + F77) + if test -n "$F77" && test "X$F77" != "Xno"; then + +ac_ext=f +ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' +ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_f77_compiler_gnu + + +archive_cmds_need_lc_F77=no +allow_undefined_flag_F77= +always_export_symbols_F77=no +archive_expsym_cmds_F77= +export_dynamic_flag_spec_F77= +hardcode_direct_F77=no +hardcode_libdir_flag_spec_F77= +hardcode_libdir_flag_spec_ld_F77= +hardcode_libdir_separator_F77= +hardcode_minus_L_F77=no +hardcode_automatic_F77=no +module_cmds_F77= +module_expsym_cmds_F77= +link_all_deplibs_F77=unknown +old_archive_cmds_F77=$old_archive_cmds +no_undefined_flag_F77= +whole_archive_flag_spec_F77= +enable_shared_with_static_runtimes_F77=no + +# Source file extension for f77 test sources. +ac_ext=f + +# Object file extension for compiled f77 test sources. +objext=o +objext_F77=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code=" subroutine t\n return\n end\n" + +# Code to be used in simple link tests +lt_simple_link_test_code=" program t\n end\n" + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* + +ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* + + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +CC=${F77-"f77"} +compiler=$CC +compiler_F77=$CC +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + +echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 +echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $can_build_shared" >&5 +echo "${ECHO_T}$can_build_shared" >&6 + +echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 +echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 +test "$can_build_shared" = "no" && enable_shared=no + +# On AIX, shared libraries and static libraries use the same namespace, and +# are all built from PIC. +case "$host_os" in +aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; +aix4* | aix5*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; +esac +echo "$as_me:$LINENO: result: $enable_shared" >&5 +echo "${ECHO_T}$enable_shared" >&6 + +echo "$as_me:$LINENO: checking whether to build static libraries" >&5 +echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 +# Make sure either enable_shared or enable_static is yes. +test "$enable_shared" = yes || enable_static=yes +echo "$as_me:$LINENO: result: $enable_static" >&5 +echo "${ECHO_T}$enable_static" >&6 + +test "$ld_shlibs_F77" = no && can_build_shared=no + +GCC_F77="$G77" +LD_F77="$LD" + +lt_prog_compiler_wl_F77= +lt_prog_compiler_pic_F77= +lt_prog_compiler_static_F77= + +echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 + + if test "$GCC" = yes; then + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_static_F77='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_F77='-Bstatic' + fi + ;; + + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4' + ;; + + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_F77='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic_F77='-fno-common' + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared_F77=no + enable_shared=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic_F77=-Kconform_pic + fi + ;; + + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case "$host_cpu" in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_F77='-fPIC' + ;; + esac + ;; + + *) + lt_prog_compiler_pic_F77='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl_F77='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_F77='-Bstatic' + else + lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp' + fi + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + lt_prog_compiler_pic_F77='-qnocommon' + lt_prog_compiler_wl_F77='-Wl,' + ;; + esac + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_F77='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl_F77='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case "$host_cpu" in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_F77='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static_F77='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl_F77='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static_F77='-non_shared' + ;; + + newsos6) + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + linux*) + case $cc_basename in + icc* | ecc*) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-static' + ;; + pgcc* | pgf77* | pgf90*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_pic_F77='-fpic' + lt_prog_compiler_static_F77='-static' + ;; + ccc*) + lt_prog_compiler_wl_F77='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static_F77='-non_shared' + ;; + esac + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl_F77='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static_F77='-non_shared' + ;; + + sco3.2v5*) + lt_prog_compiler_pic_F77='-Kpic' + lt_prog_compiler_static_F77='-dn' + ;; + + solaris*) + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + lt_prog_compiler_wl_F77='-Qoption ld ';; + *) + lt_prog_compiler_wl_F77='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl_F77='-Qoption ld ' + lt_prog_compiler_pic_F77='-PIC' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic_F77='-Kconform_pic' + lt_prog_compiler_static_F77='-Bstatic' + fi + ;; + + unicos*) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_can_build_shared_F77=no + ;; + + uts4*) + lt_prog_compiler_pic_F77='-pic' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared_F77=no + ;; + esac + fi + +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6 + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_F77"; then + +echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6 +if test "${lt_prog_compiler_pic_works_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_pic_works_F77=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic_F77" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:13480: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:13484: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp + $SED '/^$/d' conftest.err >conftest.er2 + if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_pic_works_F77=yes + fi + fi + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6 + +if test x"$lt_prog_compiler_pic_works_F77" = xyes; then + case $lt_prog_compiler_pic_F77 in + "" | " "*) ;; + *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;; + esac +else + lt_prog_compiler_pic_F77= + lt_prog_compiler_can_build_shared_F77=no +fi + +fi +case "$host_os" in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic_F77= + ;; + *) + lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77" + ;; +esac + +echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 +if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_c_o_F77=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:13542: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:13546: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $echo "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp + $SED '/^$/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_F77=yes + fi + fi + chmod u+w . + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6 + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6 + if test "$hard_links" = no; then + { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + +echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 + + runpath_var= + allow_undefined_flag_F77= + enable_shared_with_static_runtimes_F77=no + archive_cmds_F77= + archive_expsym_cmds_F77= + old_archive_From_new_cmds_F77= + old_archive_from_expsyms_cmds_F77= + export_dynamic_flag_spec_F77= + whole_archive_flag_spec_F77= + thread_safe_flag_spec_F77= + hardcode_libdir_flag_spec_F77= + hardcode_libdir_flag_spec_ld_F77= + hardcode_libdir_separator_F77= + hardcode_direct_F77=no + hardcode_minus_L_F77=no + hardcode_shlibpath_var_F77=unsupported + link_all_deplibs_F77=unknown + hardcode_automatic_F77=no + module_cmds_F77= + module_expsym_cmds_F77= + always_export_symbols_F77=no + export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms_F77= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms_F77="_GLOBAL_OFFSET_TABLE_" + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + extract_expsyms_cmds= + # Just being paranoid about ensuring that cc_basename is set. + for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + case $host_os in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + ld_shlibs_F77=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_F77='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec_F77= + fi + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs_F77=no + cat <&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +EOF + fi + ;; + + amigaos*) + archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_minus_L_F77=yes + + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can't use + # them. + ld_shlibs_F77=no + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag_F77=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs_F77=no + fi + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_F77='-L$libdir' + allow_undefined_flag_F77=unsupported + always_export_symbols_F77=no + enable_shared_with_static_runtimes_F77=yes + export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + else + ld_shlibs_F77=no + fi + ;; + + linux*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + tmp_addflag= + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec_F77='${wl}--whole-archive,`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* ) # Portland Group f77 and f90 compilers + whole_archive_flag_spec_F77='${wl}--whole-archive,`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + esac + archive_cmds_F77='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test $supports_anon_versioning = yes; then + archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + $echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + else + ld_shlibs_F77=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris* | sysv5*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs_F77=no + cat <&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +EOF + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_F77=no + fi + ;; + + sunos4*) + archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_F77=no + fi + ;; + esac + + if test "$ld_shlibs_F77" = no; then + runpath_var= + hardcode_libdir_flag_spec_F77= + export_dynamic_flag_spec_F77= + whole_archive_flag_spec_F77= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag_F77=unsupported + always_export_symbols_F77=yes + archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L_F77=yes + if test "$GCC" = yes && test -z "$link_static_flag"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct_F77=unsupported + fi + ;; + + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds_F77='' + hardcode_direct_F77=yes + hardcode_libdir_separator_F77=':' + link_all_deplibs_F77=yes + + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct_F77=yes + else + # We have old collect2 + hardcode_direct_F77=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L_F77=yes + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_libdir_separator_F77= + fi + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols_F77=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag_F77='-berok' + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF + program main + + end +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_f77_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag_F77="-z nodefs" + archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF + program main + + end +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_f77_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag_F77=' ${wl}-bernotok' + allow_undefined_flag_F77=' ${wl}-berok' + # -bexpall does not export symbols beginning with underscore (_) + always_export_symbols_F77=yes + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_F77=' ' + archive_cmds_need_lc_F77=yes + # This is similar to how AIX traditionally builds it's shared libraries. + archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_minus_L_F77=yes + # see comment about different semantics on the GNU ld section + ld_shlibs_F77=no + ;; + + bsdi[45]*) + export_dynamic_flag_spec_F77=-rdynamic + ;; + + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec_F77=' ' + allow_undefined_flag_F77=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_From_new_cmds_F77='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path_F77='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes_F77=yes + ;; + + darwin* | rhapsody*) + case "$host_os" in + rhapsody* | darwin1.[012]) + allow_undefined_flag_F77='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[012]) + allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + archive_cmds_need_lc_F77=no + hardcode_direct_F77=no + hardcode_automatic_F77=yes + hardcode_shlibpath_var_F77=unsupported + whole_archive_flag_spec_F77='' + link_all_deplibs_F77=yes + if test "$GCC" = yes ; then + output_verbose_link_cmd='echo' + archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's + archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's + archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + ld_shlibs_F77=no + ;; + esac + fi + ;; + + dgux*) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_shlibpath_var_F77=no + ;; + + freebsd1*) + ld_shlibs_F77=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec_F77='-R$libdir' + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_F77=yes + hardcode_minus_L_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | kfreebsd*-gnu | dragonfly*) + archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_F77='-R$libdir' + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + hpux9*) + if test "$GCC" = yes; then + archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds_F77='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_F77=: + hardcode_direct_F77=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_F77=yes + export_dynamic_flag_spec_F77='${wl}-E' + ;; + + hpux10* | hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case "$host_cpu" in + hppa*64*|ia64*) + archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case "$host_cpu" in + hppa*64*|ia64*) + archive_cmds_F77='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' + ;; + *) + archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + case "$host_cpu" in + hppa*64*) + hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' + hardcode_libdir_flag_spec_ld_F77='+b $libdir' + hardcode_libdir_separator_F77=: + hardcode_direct_F77=no + hardcode_shlibpath_var_F77=no + ;; + ia64*) + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_direct_F77=no + hardcode_shlibpath_var_F77=no + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_F77=yes + ;; + *) + hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_F77=: + hardcode_direct_F77=yes + export_dynamic_flag_spec_F77='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_F77=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_ld_F77='-rpath $libdir' + fi + hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_F77=: + link_all_deplibs_F77=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec_F77='-R$libdir' + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + newsos6) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_F77=yes + hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_F77=: + hardcode_shlibpath_var_F77=no + ;; + + openbsd*) + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' + export_dynamic_flag_spec_F77='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_F77='-R$libdir' + ;; + *) + archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' + ;; + esac + fi + ;; + + os2*) + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_minus_L_F77=yes + allow_undefined_flag_F77=unsupported + archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag_F77=' -expect_unresolved \*' + archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + fi + hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_F77=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag_F77=' -expect_unresolved \*' + archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec_F77='-rpath $libdir' + fi + hardcode_libdir_separator_F77=: + ;; + + sco3.2v5*) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_F77=no + export_dynamic_flag_spec_F77='${wl}-Bexport' + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ;; + + solaris*) + no_undefined_flag_F77=' -z text' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + wlarc='' + archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + fi + hardcode_libdir_flag_spec_F77='-R$libdir' + hardcode_shlibpath_var_F77=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine linker options so we + # cannot just pass the convience library names through + # without $wl, iff we do not link with $LD. + # Luckily, gcc supports the same syntax we need for Sun Studio. + # Supported since Solaris 2.6 (maybe 2.5.1?) + case $wlarc in + '') + whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;; + *) + whole_archive_flag_spec_F77='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; + esac ;; + esac + link_all_deplibs_F77=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_direct_F77=yes + hardcode_minus_L_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_F77=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds_F77='$CC -r -o $output$reload_objs' + hardcode_direct_F77=no + ;; + motorola) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var_F77=no + ;; + + sysv4.3*) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_F77=no + export_dynamic_flag_spec_F77='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_F77=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs_F77=yes + fi + ;; + + sysv4.2uw2*) + archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_F77=yes + hardcode_minus_L_F77=no + hardcode_shlibpath_var_F77=no + hardcode_runpath_var=yes + runpath_var=LD_RUN_PATH + ;; + + sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) + no_undefined_flag_F77='${wl}-z ${wl}text' + if test "$GCC" = yes; then + archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_F77='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var_F77=no + ;; + + sysv5*) + no_undefined_flag_F77=' -z text' + # $CC -shared without GNU ld will not create a library from C++ + # object files and a static libstdc++, better avoid it by now + archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + hardcode_libdir_flag_spec_F77= + hardcode_shlibpath_var_F77=no + runpath_var='LD_RUN_PATH' + ;; + + uts4*) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_shlibpath_var_F77=no + ;; + + *) + ld_shlibs_F77=no + ;; + esac + fi + +echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5 +echo "${ECHO_T}$ld_shlibs_F77" >&6 +test "$ld_shlibs_F77" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc_F77" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc_F77=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds_F77 in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 + $rm conftest* + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_F77 + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_F77 + allow_undefined_flag_F77= + if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 + (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + archive_cmds_need_lc_F77=no + else + archive_cmds_need_lc_F77=yes + fi + allow_undefined_flag_F77=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5 +echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6 + ;; + esac + fi + ;; +esac + +echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + linux*) + if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + if test $supports_anon_versioning = yes; then + archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ +cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ +$echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + else + $archive_expsym_cmds="$archive_cmds" + fi + else + ld_shlibs=no + fi + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +kfreebsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + *) # from 3.2 on + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case "$host_cpu" in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + case $host_cpu:$lt_cv_cc_64bit_output in + powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes) + sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /usr/X11R6/lib64" + sys_lib_search_path_spec="/lib64 /usr/lib64 /usr/local/lib64 /usr/X11R6/lib64" + ;; + esac + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + + # Find out which ABI we are using (multilib Linux x86_64 hack). + libsuff= + case "$host_cpu" in + x86_64*) + echo '#line 14953 "configure"' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.$ac_objext` in + *64-bit*) + libsuff=64 + ;; + esac + fi + rm -rf conftest* + ;; + *) + ;; + esac + sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}" + sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" + ;; + +knetbsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +sco3.2v5*) + version_type=osf + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6 +test "$dynamic_linker" = no && can_build_shared=no + +echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 +hardcode_action_F77= +if test -n "$hardcode_libdir_flag_spec_F77" || \ + test -n "$runpath_var_F77" || \ + test "X$hardcode_automatic_F77" = "Xyes" ; then + + # We can hardcode non-existant directories. + if test "$hardcode_direct_F77" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no && + test "$hardcode_minus_L_F77" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action_F77=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action_F77=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action_F77=unsupported +fi +echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5 +echo "${ECHO_T}$hardcode_action_F77" >&6 + +if test "$hardcode_action_F77" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + +striplib= +old_striplib= +echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 +echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 +if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + ;; + *) + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + ;; + esac +fi + + + +# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler_F77 \ + CC_F77 \ + LD_F77 \ + lt_prog_compiler_wl_F77 \ + lt_prog_compiler_pic_F77 \ + lt_prog_compiler_static_F77 \ + lt_prog_compiler_no_builtin_flag_F77 \ + export_dynamic_flag_spec_F77 \ + thread_safe_flag_spec_F77 \ + whole_archive_flag_spec_F77 \ + enable_shared_with_static_runtimes_F77 \ + old_archive_cmds_F77 \ + old_archive_from_new_cmds_F77 \ + predep_objects_F77 \ + postdep_objects_F77 \ + predeps_F77 \ + postdeps_F77 \ + compiler_lib_search_path_F77 \ + archive_cmds_F77 \ + archive_expsym_cmds_F77 \ + postinstall_cmds_F77 \ + postuninstall_cmds_F77 \ + old_archive_from_expsyms_cmds_F77 \ + allow_undefined_flag_F77 \ + no_undefined_flag_F77 \ + export_symbols_cmds_F77 \ + hardcode_libdir_flag_spec_F77 \ + hardcode_libdir_flag_spec_ld_F77 \ + hardcode_libdir_separator_F77 \ + hardcode_automatic_F77 \ + module_cmds_F77 \ + module_expsym_cmds_F77 \ + lt_cv_prog_compiler_c_o_F77 \ + exclude_expsyms_F77 \ + include_expsyms_F77; do + + case $var in + old_archive_cmds_F77 | \ + old_archive_from_new_cmds_F77 | \ + archive_cmds_F77 | \ + archive_expsym_cmds_F77 | \ + module_cmds_F77 | \ + module_expsym_cmds_F77 | \ + old_archive_from_expsyms_cmds_F77 | \ + export_symbols_cmds_F77 | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + +cfgfile="$ofile" + + cat <<__EOF__ >> "$cfgfile" +# ### BEGIN LIBTOOL TAG CONFIG: $tagname + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_F77 + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77 + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# A language-specific compiler. +CC=$lt_compiler_F77 + +# Is the compiler the GNU C compiler? +with_gcc=$GCC_F77 + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_LD_F77 + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$lt_STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_F77 + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_F77 +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77 + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_F77 + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77 + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77 + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77 + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77 + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds_F77 +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77 + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77 + +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds_F77 +archive_expsym_cmds=$lt_archive_expsym_cmds_F77 +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds_F77 +module_expsym_cmds=$lt_module_expsym_cmds_F77 + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_predep_objects_F77 + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_postdep_objects_F77 + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps_F77 + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps_F77 + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_F77 + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_F77 + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_F77 + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_F77 + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77 + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77 + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77 + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct_F77 + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L_F77 + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_F77 + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic_F77 + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_F77 + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path_F77" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols_F77 + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_F77 + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_F77 + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_F77 + +# ### END LIBTOOL TAG CONFIG: $tagname + +__EOF__ + + +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC="$lt_save_CC" + + else + tagname="" + fi + ;; + + GCJ) + if test -n "$GCJ" && test "X$GCJ" != "Xno"; then + + + +# Source file extension for Java test sources. +ac_ext=java + +# Object file extension for compiled Java test sources. +objext=o +objext_GCJ=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="class foo {}\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* + +ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* + + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +CC=${GCJ-"gcj"} +compiler=$CC +compiler_GCJ=$CC +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + +# GCJ did not exist at the time GCC didn't implicitly link libc in. +archive_cmds_need_lc_GCJ=no + +old_archive_cmds_GCJ=$old_archive_cmds + + +lt_prog_compiler_no_builtin_flag_GCJ= + +if test "$GCC" = yes; then + lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin' + + +echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 +if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:15719: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:15723: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp + $SED '/^$/d' conftest.err >conftest.er2 + if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 + +if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then + lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions" +else + : +fi + +fi + +lt_prog_compiler_wl_GCJ= +lt_prog_compiler_pic_GCJ= +lt_prog_compiler_static_GCJ= + +echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 + + if test "$GCC" = yes; then + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_static_GCJ='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_GCJ='-Bstatic' + fi + ;; + + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4' + ;; + + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic_GCJ='-fno-common' + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared_GCJ=no + enable_shared=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic_GCJ=-Kconform_pic + fi + ;; + + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case "$host_cpu" in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_GCJ='-fPIC' + ;; + esac + ;; + + *) + lt_prog_compiler_pic_GCJ='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl_GCJ='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_GCJ='-Bstatic' + else + lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp' + fi + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + lt_prog_compiler_pic_GCJ='-qnocommon' + lt_prog_compiler_wl_GCJ='-Wl,' + ;; + esac + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl_GCJ='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case "$host_cpu" in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_GCJ='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl_GCJ='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static_GCJ='-non_shared' + ;; + + newsos6) + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + linux*) + case $cc_basename in + icc* | ecc*) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-static' + ;; + pgcc* | pgf77* | pgf90*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_pic_GCJ='-fpic' + lt_prog_compiler_static_GCJ='-static' + ;; + ccc*) + lt_prog_compiler_wl_GCJ='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static_GCJ='-non_shared' + ;; + esac + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl_GCJ='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static_GCJ='-non_shared' + ;; + + sco3.2v5*) + lt_prog_compiler_pic_GCJ='-Kpic' + lt_prog_compiler_static_GCJ='-dn' + ;; + + solaris*) + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + lt_prog_compiler_wl_GCJ='-Qoption ld ';; + *) + lt_prog_compiler_wl_GCJ='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl_GCJ='-Qoption ld ' + lt_prog_compiler_pic_GCJ='-PIC' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic_GCJ='-Kconform_pic' + lt_prog_compiler_static_GCJ='-Bstatic' + fi + ;; + + unicos*) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_can_build_shared_GCJ=no + ;; + + uts4*) + lt_prog_compiler_pic_GCJ='-pic' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared_GCJ=no + ;; + esac + fi + +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6 + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_GCJ"; then + +echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6 +if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_pic_works_GCJ=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic_GCJ" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:15981: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:15985: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp + $SED '/^$/d' conftest.err >conftest.er2 + if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_pic_works_GCJ=yes + fi + fi + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6 + +if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then + case $lt_prog_compiler_pic_GCJ in + "" | " "*) ;; + *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;; + esac +else + lt_prog_compiler_pic_GCJ= + lt_prog_compiler_can_build_shared_GCJ=no +fi + +fi +case "$host_os" in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic_GCJ= + ;; + *) + lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ" + ;; +esac + +echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 +if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_c_o_GCJ=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:16043: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:16047: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $echo "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp + $SED '/^$/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_GCJ=yes + fi + fi + chmod u+w . + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6 + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6 + if test "$hard_links" = no; then + { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + +echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 + + runpath_var= + allow_undefined_flag_GCJ= + enable_shared_with_static_runtimes_GCJ=no + archive_cmds_GCJ= + archive_expsym_cmds_GCJ= + old_archive_From_new_cmds_GCJ= + old_archive_from_expsyms_cmds_GCJ= + export_dynamic_flag_spec_GCJ= + whole_archive_flag_spec_GCJ= + thread_safe_flag_spec_GCJ= + hardcode_libdir_flag_spec_GCJ= + hardcode_libdir_flag_spec_ld_GCJ= + hardcode_libdir_separator_GCJ= + hardcode_direct_GCJ=no + hardcode_minus_L_GCJ=no + hardcode_shlibpath_var_GCJ=unsupported + link_all_deplibs_GCJ=unknown + hardcode_automatic_GCJ=no + module_cmds_GCJ= + module_expsym_cmds_GCJ= + always_export_symbols_GCJ=no + export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms_GCJ= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms_GCJ="_GLOBAL_OFFSET_TABLE_" + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + extract_expsyms_cmds= + # Just being paranoid about ensuring that cc_basename is set. + for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + case $host_os in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + ld_shlibs_GCJ=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_GCJ='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec_GCJ= + fi + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs_GCJ=no + cat <&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +EOF + fi + ;; + + amigaos*) + archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_minus_L_GCJ=yes + + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can't use + # them. + ld_shlibs_GCJ=no + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag_GCJ=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs_GCJ=no + fi + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_GCJ='-L$libdir' + allow_undefined_flag_GCJ=unsupported + always_export_symbols_GCJ=no + enable_shared_with_static_runtimes_GCJ=yes + export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + else + ld_shlibs_GCJ=no + fi + ;; + + linux*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + tmp_addflag= + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec_GCJ='${wl}--whole-archive,`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* ) # Portland Group f77 and f90 compilers + whole_archive_flag_spec_GCJ='${wl}--whole-archive,`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + esac + archive_cmds_GCJ='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test $supports_anon_versioning = yes; then + archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + $echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + else + ld_shlibs_GCJ=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris* | sysv5*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs_GCJ=no + cat <&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +EOF + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_GCJ=no + fi + ;; + + sunos4*) + archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_GCJ=no + fi + ;; + esac + + if test "$ld_shlibs_GCJ" = no; then + runpath_var= + hardcode_libdir_flag_spec_GCJ= + export_dynamic_flag_spec_GCJ= + whole_archive_flag_spec_GCJ= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag_GCJ=unsupported + always_export_symbols_GCJ=yes + archive_expsym_cmds_GCJ='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L_GCJ=yes + if test "$GCC" = yes && test -z "$link_static_flag"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct_GCJ=unsupported + fi + ;; + + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_GCJ='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds_GCJ='' + hardcode_direct_GCJ=yes + hardcode_libdir_separator_GCJ=':' + link_all_deplibs_GCJ=yes + + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct_GCJ=yes + else + # We have old collect2 + hardcode_direct_GCJ=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L_GCJ=yes + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_libdir_separator_GCJ= + fi + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols_GCJ=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag_GCJ='-berok' + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag_GCJ="-z nodefs" + archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag_GCJ=' ${wl}-bernotok' + allow_undefined_flag_GCJ=' ${wl}-berok' + # -bexpall does not export symbols beginning with underscore (_) + always_export_symbols_GCJ=yes + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_GCJ=' ' + archive_cmds_need_lc_GCJ=yes + # This is similar to how AIX traditionally builds it's shared libraries. + archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_minus_L_GCJ=yes + # see comment about different semantics on the GNU ld section + ld_shlibs_GCJ=no + ;; + + bsdi[45]*) + export_dynamic_flag_spec_GCJ=-rdynamic + ;; + + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec_GCJ=' ' + allow_undefined_flag_GCJ=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_From_new_cmds_GCJ='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes_GCJ=yes + ;; + + darwin* | rhapsody*) + case "$host_os" in + rhapsody* | darwin1.[012]) + allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[012]) + allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + allow_undefined_flag_GCJ='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + archive_cmds_need_lc_GCJ=no + hardcode_direct_GCJ=no + hardcode_automatic_GCJ=yes + hardcode_shlibpath_var_GCJ=unsupported + whole_archive_flag_spec_GCJ='' + link_all_deplibs_GCJ=yes + if test "$GCC" = yes ; then + output_verbose_link_cmd='echo' + archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's + archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's + archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + ld_shlibs_GCJ=no + ;; + esac + fi + ;; + + dgux*) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_shlibpath_var_GCJ=no + ;; + + freebsd1*) + ld_shlibs_GCJ=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec_GCJ='-R$libdir' + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_GCJ=yes + hardcode_minus_L_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | kfreebsd*-gnu | dragonfly*) + archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_GCJ='-R$libdir' + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + hpux9*) + if test "$GCC" = yes; then + archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds_GCJ='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + hardcode_direct_GCJ=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_GCJ=yes + export_dynamic_flag_spec_GCJ='${wl}-E' + ;; + + hpux10* | hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case "$host_cpu" in + hppa*64*|ia64*) + archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case "$host_cpu" in + hppa*64*|ia64*) + archive_cmds_GCJ='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' + ;; + *) + archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + case "$host_cpu" in + hppa*64*) + hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' + hardcode_libdir_flag_spec_ld_GCJ='+b $libdir' + hardcode_libdir_separator_GCJ=: + hardcode_direct_GCJ=no + hardcode_shlibpath_var_GCJ=no + ;; + ia64*) + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_direct_GCJ=no + hardcode_shlibpath_var_GCJ=no + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_GCJ=yes + ;; + *) + hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + hardcode_direct_GCJ=yes + export_dynamic_flag_spec_GCJ='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_GCJ=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir' + fi + hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + link_all_deplibs_GCJ=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec_GCJ='-R$libdir' + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + newsos6) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_GCJ=yes + hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + hardcode_shlibpath_var_GCJ=no + ;; + + openbsd*) + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' + export_dynamic_flag_spec_GCJ='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_GCJ='-R$libdir' + ;; + *) + archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' + ;; + esac + fi + ;; + + os2*) + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_minus_L_GCJ=yes + allow_undefined_flag_GCJ=unsupported + archive_cmds_GCJ='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag_GCJ=' -expect_unresolved \*' + archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + fi + hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag_GCJ=' -expect_unresolved \*' + archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec_GCJ='-rpath $libdir' + fi + hardcode_libdir_separator_GCJ=: + ;; + + sco3.2v5*) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_GCJ=no + export_dynamic_flag_spec_GCJ='${wl}-Bexport' + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ;; + + solaris*) + no_undefined_flag_GCJ=' -z text' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + wlarc='' + archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + fi + hardcode_libdir_flag_spec_GCJ='-R$libdir' + hardcode_shlibpath_var_GCJ=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine linker options so we + # cannot just pass the convience library names through + # without $wl, iff we do not link with $LD. + # Luckily, gcc supports the same syntax we need for Sun Studio. + # Supported since Solaris 2.6 (maybe 2.5.1?) + case $wlarc in + '') + whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;; + *) + whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; + esac ;; + esac + link_all_deplibs_GCJ=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_direct_GCJ=yes + hardcode_minus_L_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_GCJ=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds_GCJ='$CC -r -o $output$reload_objs' + hardcode_direct_GCJ=no + ;; + motorola) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var_GCJ=no + ;; + + sysv4.3*) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_GCJ=no + export_dynamic_flag_spec_GCJ='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_GCJ=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs_GCJ=yes + fi + ;; + + sysv4.2uw2*) + archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_GCJ=yes + hardcode_minus_L_GCJ=no + hardcode_shlibpath_var_GCJ=no + hardcode_runpath_var=yes + runpath_var=LD_RUN_PATH + ;; + + sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) + no_undefined_flag_GCJ='${wl}-z ${wl}text' + if test "$GCC" = yes; then + archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_GCJ='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var_GCJ=no + ;; + + sysv5*) + no_undefined_flag_GCJ=' -z text' + # $CC -shared without GNU ld will not create a library from C++ + # object files and a static libstdc++, better avoid it by now + archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + hardcode_libdir_flag_spec_GCJ= + hardcode_shlibpath_var_GCJ=no + runpath_var='LD_RUN_PATH' + ;; + + uts4*) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_shlibpath_var_GCJ=no + ;; + + *) + ld_shlibs_GCJ=no + ;; + esac + fi + +echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5 +echo "${ECHO_T}$ld_shlibs_GCJ" >&6 +test "$ld_shlibs_GCJ" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc_GCJ" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc_GCJ=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds_GCJ in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 + $rm conftest* + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_GCJ + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ + allow_undefined_flag_GCJ= + if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 + (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + archive_cmds_need_lc_GCJ=no + else + archive_cmds_need_lc_GCJ=yes + fi + allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5 +echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6 + ;; + esac + fi + ;; +esac + +echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + linux*) + if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + if test $supports_anon_versioning = yes; then + archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ +cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ +$echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + else + $archive_expsym_cmds="$archive_cmds" + fi + else + ld_shlibs=no + fi + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +kfreebsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + *) # from 3.2 on + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case "$host_cpu" in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + case $host_cpu:$lt_cv_cc_64bit_output in + powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes) + sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /usr/X11R6/lib64" + sys_lib_search_path_spec="/lib64 /usr/lib64 /usr/local/lib64 /usr/X11R6/lib64" + ;; + esac + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + + # Find out which ABI we are using (multilib Linux x86_64 hack). + libsuff= + case "$host_cpu" in + x86_64*) + echo '#line 17474 "configure"' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.$ac_objext` in + *64-bit*) + libsuff=64 + ;; + esac + fi + rm -rf conftest* + ;; + *) + ;; + esac + sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}" + sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" + ;; + +knetbsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +sco3.2v5*) + version_type=osf + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6 +test "$dynamic_linker" = no && can_build_shared=no + +echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 +hardcode_action_GCJ= +if test -n "$hardcode_libdir_flag_spec_GCJ" || \ + test -n "$runpath_var_GCJ" || \ + test "X$hardcode_automatic_GCJ" = "Xyes" ; then + + # We can hardcode non-existant directories. + if test "$hardcode_direct_GCJ" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no && + test "$hardcode_minus_L_GCJ" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action_GCJ=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action_GCJ=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action_GCJ=unsupported +fi +echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5 +echo "${ECHO_T}$hardcode_action_GCJ" >&6 + +if test "$hardcode_action_GCJ" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + +striplib= +old_striplib= +echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 +echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 +if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + ;; + *) + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + ;; + esac +fi + +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dl_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dl_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 +if test $ac_cv_lib_dl_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + +fi + + ;; + + *) + echo "$as_me:$LINENO: checking for shl_load" >&5 +echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 +if test "${ac_cv_func_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define shl_load to an innocuous variant, in case declares shl_load. + For example, HP-UX 11i declares gettimeofday. */ +#define shl_load innocuous_shl_load + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char shl_load (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef shl_load + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char shl_load (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_shl_load) || defined (__stub___shl_load) +choke me +#else +char (*f) () = shl_load; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != shl_load; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_shl_load=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 +echo "${ECHO_T}$ac_cv_func_shl_load" >&6 +if test $ac_cv_func_shl_load = yes; then + lt_cv_dlopen="shl_load" +else + echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 +if test "${ac_cv_lib_dld_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char shl_load (); +int +main () +{ +shl_load (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dld_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dld_shl_load=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 +if test $ac_cv_lib_dld_shl_load = yes; then + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" +else + echo "$as_me:$LINENO: checking for dlopen" >&5 +echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 +if test "${ac_cv_func_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define dlopen to an innocuous variant, in case declares dlopen. + For example, HP-UX 11i declares gettimeofday. */ +#define dlopen innocuous_dlopen + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char dlopen (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef dlopen + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_dlopen) || defined (__stub___dlopen) +choke me +#else +char (*f) () = dlopen; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != dlopen; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 +echo "${ECHO_T}$ac_cv_func_dlopen" >&6 +if test $ac_cv_func_dlopen = yes; then + lt_cv_dlopen="dlopen" +else + echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dl_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dl_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 +if test $ac_cv_lib_dl_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 +echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 +if test "${ac_cv_lib_svld_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_svld_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_svld_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 +if test $ac_cv_lib_svld_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 +echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 +if test "${ac_cv_lib_dld_dld_link+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dld_link (); +int +main () +{ +dld_link (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dld_dld_link=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dld_dld_link=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 +if test $ac_cv_lib_dld_dld_link = yes; then + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" +fi + + +fi + + +fi + + +fi + + +fi + + +fi + + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 +echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 +if test "${lt_cv_dlopen_self+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + + exit (status); +} +EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_unknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self" >&6 + + if test "x$lt_cv_dlopen_self" = xyes; then + LDFLAGS="$LDFLAGS $link_static_flag" + echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 +echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 +if test "${lt_cv_dlopen_self_static+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self_static=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + + exit (status); +} +EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi + + +# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler_GCJ \ + CC_GCJ \ + LD_GCJ \ + lt_prog_compiler_wl_GCJ \ + lt_prog_compiler_pic_GCJ \ + lt_prog_compiler_static_GCJ \ + lt_prog_compiler_no_builtin_flag_GCJ \ + export_dynamic_flag_spec_GCJ \ + thread_safe_flag_spec_GCJ \ + whole_archive_flag_spec_GCJ \ + enable_shared_with_static_runtimes_GCJ \ + old_archive_cmds_GCJ \ + old_archive_from_new_cmds_GCJ \ + predep_objects_GCJ \ + postdep_objects_GCJ \ + predeps_GCJ \ + postdeps_GCJ \ + compiler_lib_search_path_GCJ \ + archive_cmds_GCJ \ + archive_expsym_cmds_GCJ \ + postinstall_cmds_GCJ \ + postuninstall_cmds_GCJ \ + old_archive_from_expsyms_cmds_GCJ \ + allow_undefined_flag_GCJ \ + no_undefined_flag_GCJ \ + export_symbols_cmds_GCJ \ + hardcode_libdir_flag_spec_GCJ \ + hardcode_libdir_flag_spec_ld_GCJ \ + hardcode_libdir_separator_GCJ \ + hardcode_automatic_GCJ \ + module_cmds_GCJ \ + module_expsym_cmds_GCJ \ + lt_cv_prog_compiler_c_o_GCJ \ + exclude_expsyms_GCJ \ + include_expsyms_GCJ; do + + case $var in + old_archive_cmds_GCJ | \ + old_archive_from_new_cmds_GCJ | \ + archive_cmds_GCJ | \ + archive_expsym_cmds_GCJ | \ + module_cmds_GCJ | \ + module_expsym_cmds_GCJ | \ + old_archive_from_expsyms_cmds_GCJ | \ + export_symbols_cmds_GCJ | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + +cfgfile="$ofile" + + cat <<__EOF__ >> "$cfgfile" +# ### BEGIN LIBTOOL TAG CONFIG: $tagname + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_GCJ + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# A language-specific compiler. +CC=$lt_compiler_GCJ + +# Is the compiler the GNU C compiler? +with_gcc=$GCC_GCJ + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_LD_GCJ + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$lt_STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_GCJ + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_GCJ +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_GCJ + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds_GCJ +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ + +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds_GCJ +archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds_GCJ +module_expsym_cmds=$lt_module_expsym_cmds_GCJ + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_predep_objects_GCJ + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_postdep_objects_GCJ + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps_GCJ + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps_GCJ + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_GCJ + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_GCJ + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_GCJ + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_GCJ + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct_GCJ + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L_GCJ + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic_GCJ + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_GCJ + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path_GCJ" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols_GCJ + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_GCJ + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_GCJ + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_GCJ + +# ### END LIBTOOL TAG CONFIG: $tagname + +__EOF__ + + +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC="$lt_save_CC" + + else + tagname="" + fi + ;; + + RC) + + + +# Source file extension for RC test sources. +ac_ext=rc + +# Object file extension for compiled RC test sources. +objext=o +objext_RC=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n' + +# Code to be used in simple link tests +lt_simple_link_test_code="$lt_simple_compile_test_code" + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* + +ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* + + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +CC=${RC-"windres"} +compiler=$CC +compiler_RC=$CC +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + +lt_cv_prog_compiler_c_o_RC=yes + +# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler_RC \ + CC_RC \ + LD_RC \ + lt_prog_compiler_wl_RC \ + lt_prog_compiler_pic_RC \ + lt_prog_compiler_static_RC \ + lt_prog_compiler_no_builtin_flag_RC \ + export_dynamic_flag_spec_RC \ + thread_safe_flag_spec_RC \ + whole_archive_flag_spec_RC \ + enable_shared_with_static_runtimes_RC \ + old_archive_cmds_RC \ + old_archive_from_new_cmds_RC \ + predep_objects_RC \ + postdep_objects_RC \ + predeps_RC \ + postdeps_RC \ + compiler_lib_search_path_RC \ + archive_cmds_RC \ + archive_expsym_cmds_RC \ + postinstall_cmds_RC \ + postuninstall_cmds_RC \ + old_archive_from_expsyms_cmds_RC \ + allow_undefined_flag_RC \ + no_undefined_flag_RC \ + export_symbols_cmds_RC \ + hardcode_libdir_flag_spec_RC \ + hardcode_libdir_flag_spec_ld_RC \ + hardcode_libdir_separator_RC \ + hardcode_automatic_RC \ + module_cmds_RC \ + module_expsym_cmds_RC \ + lt_cv_prog_compiler_c_o_RC \ + exclude_expsyms_RC \ + include_expsyms_RC; do + + case $var in + old_archive_cmds_RC | \ + old_archive_from_new_cmds_RC | \ + archive_cmds_RC | \ + archive_expsym_cmds_RC | \ + module_cmds_RC | \ + module_expsym_cmds_RC | \ + old_archive_from_expsyms_cmds_RC | \ + export_symbols_cmds_RC | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + +cfgfile="$ofile" + + cat <<__EOF__ >> "$cfgfile" +# ### BEGIN LIBTOOL TAG CONFIG: $tagname + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_RC + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# A language-specific compiler. +CC=$lt_compiler_RC + +# Is the compiler the GNU C compiler? +with_gcc=$GCC_RC + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_LD_RC + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$lt_STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_RC + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_RC +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_RC + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds_RC +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC + +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds_RC +archive_expsym_cmds=$lt_archive_expsym_cmds_RC +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds_RC +module_expsym_cmds=$lt_module_expsym_cmds_RC + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_predep_objects_RC + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_postdep_objects_RC + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps_RC + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps_RC + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_RC + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_RC + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_RC + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_RC + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct_RC + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L_RC + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_RC + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic_RC + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_RC + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path_RC" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols_RC + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_RC + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_RC + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_RC + +# ### END LIBTOOL TAG CONFIG: $tagname + +__EOF__ + + +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC="$lt_save_CC" + + ;; + + *) + { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5 +echo "$as_me: error: Unsupported tag name: $tagname" >&2;} + { (exit 1); exit 1; }; } + ;; + esac + + # Append the new tag name to the list of available tags. + if test -n "$tagname" ; then + available_tags="$available_tags $tagname" + fi + fi + done + IFS="$lt_save_ifs" + + # Now substitute the updated list of available tags. + if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then + mv "${ofile}T" "$ofile" + chmod +x "$ofile" + else + rm -f "${ofile}T" + { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5 +echo "$as_me: error: unable to update list of available tagged configurations." >&2;} + { (exit 1); exit 1; }; } + fi +fi + + + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' + +# Prevent multiple expansion + + + + + + + + + + + + + + + + + + + + + + +CC_FOR_BUILD=${CC_FOR_BUILD:-'$(CC)'} +CXX_FOR_BUILD=${CXX_FOR_BUILD:-'$(CXX)'} +CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD:-'$(CFLAGS)'} +CPPFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD:-'$(CPPFLAGS)'} +CXXFLAGS_FOR_BUILD=${CXXFLAGS_FOR_BUILD:-'$(CXXFLAGS)'} +BUILD_EXEEXT=${BUILD_EXEEXT:-'$(EXEEXT)'} +BUILD_OBJEXT=${BUILD_OBJEXT:-'$(OBJEXT)'} + + +echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +if test "${ac_cv_header_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_header_stdc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_stdc=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + exit(2); + exit (0); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6 +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF + +fi + + +for ac_header in limits.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + +if test "x$want_cpp" = "xyes" -a -n "$CXX" +then + + +ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + + + +for ac_header in string +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + pcre_have_cpp_headers="1" +else + pcre_have_cpp_headers="0" +fi + +done + + +for ac_header in bits/type_traits.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + pcre_have_bits_type_traits="1" +else + pcre_have_bits_type_traits="0" +fi + +done + + +for ac_header in type_traits.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + pcre_have_type_traits="1" +else + pcre_have_type_traits="0" +fi + +done + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +fi + +if test "x$want_cpp" = "xyes" -a -n "$CXX" -a "$pcre_have_cpp_headers" = 1; then + MAYBE_CPP_TARGETS='$(CPP_TARGETS)' + HAVE_CPP= +else + MAYBE_CPP_TARGETS= + HAVE_CPP="#" +fi + + + + +echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 +echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 +if test "${ac_cv_c_const+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +/* FIXME: Include the comments suggested by Paul. */ +#ifndef __cplusplus + /* Ultrix mips cc rejects this. */ + typedef int charset[2]; + const charset x; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *ccp; + char **p; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + ccp = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++ccp; + p = (char**) ccp; + ccp = (char const *const *) p; + { /* SCO 3.2v4 cc rejects this. */ + char *t; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* AIX XL C 1.02.0.0 rejects this saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; }; + struct s *b; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + } +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_const=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_c_const=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 +echo "${ECHO_T}$ac_cv_c_const" >&6 +if test $ac_cv_c_const = no; then + +cat >>confdefs.h <<\_ACEOF +#define const +_ACEOF + +fi + +echo "$as_me:$LINENO: checking for size_t" >&5 +echo $ECHO_N "checking for size_t... $ECHO_C" >&6 +if test "${ac_cv_type_size_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((size_t *) 0) + return 0; +if (sizeof (size_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_size_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_size_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 +echo "${ECHO_T}$ac_cv_type_size_t" >&6 +if test $ac_cv_type_size_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define size_t unsigned +_ACEOF + +fi + + +echo "$as_me:$LINENO: checking for long long" >&5 +echo $ECHO_N "checking for long long... $ECHO_C" >&6 +if test "${ac_cv_type_long_long+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((long long *) 0) + return 0; +if (sizeof (long long)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_long_long=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_long_long=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5 +echo "${ECHO_T}$ac_cv_type_long_long" >&6 +if test $ac_cv_type_long_long = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_LONG_LONG 1 +_ACEOF + +pcre_have_long_long="1" +else + pcre_have_long_long="0" +fi + +echo "$as_me:$LINENO: checking for unsigned long long" >&5 +echo $ECHO_N "checking for unsigned long long... $ECHO_C" >&6 +if test "${ac_cv_type_unsigned_long_long+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((unsigned long long *) 0) + return 0; +if (sizeof (unsigned long long)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_unsigned_long_long=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_unsigned_long_long=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_long_long" >&5 +echo "${ECHO_T}$ac_cv_type_unsigned_long_long" >&6 +if test $ac_cv_type_unsigned_long_long = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_UNSIGNED_LONG_LONG 1 +_ACEOF + +pcre_have_ulong_long="1" +else + pcre_have_ulong_long="0" +fi + + + + + + + + + + +for ac_func in bcopy memmove strerror strtoq strtoll +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + + +# Check whether --enable-utf8 or --disable-utf8 was given. +if test "${enable_utf8+set}" = set; then + enableval="$enable_utf8" + if test "$enableval" = "yes"; then + UTF8=-DSUPPORT_UTF8 +fi + +fi; + + +# Check whether --enable-unicode-properties or --disable-unicode-properties was given. +if test "${enable_unicode_properties+set}" = set; then + enableval="$enable_unicode_properties" + if test "$enableval" = "yes"; then + UCP=-DSUPPORT_UCP +fi + +fi; + + +# Check whether --enable-newline-is-cr or --disable-newline-is-cr was given. +if test "${enable_newline_is_cr+set}" = set; then + enableval="$enable_newline_is_cr" + if test "$enableval" = "yes"; then + NEWLINE=-DNEWLINE=13 +fi + +fi; + + +# Check whether --enable-newline-is-lf or --disable-newline-is-lf was given. +if test "${enable_newline_is_lf+set}" = set; then + enableval="$enable_newline_is_lf" + if test "$enableval" = "yes"; then + NEWLINE=-DNEWLINE=10 +fi + +fi; + + +# Check whether --enable-ebcdic or --disable-ebcdic was given. +if test "${enable_ebcdic+set}" = set; then + enableval="$enable_ebcdic" + if test "$enableval" == "yes"; then + EBCDIC=-DEBCDIC=1 +fi + +fi; + + +# Check whether --enable-stack-for-recursion or --disable-stack-for-recursion was given. +if test "${enable_stack_for_recursion+set}" = set; then + enableval="$enable_stack_for_recursion" + if test "$enableval" = "no"; then + NO_RECURSE=-DNO_RECURSE +fi + +fi; + + + + +# Check whether --with-posix-malloc-threshold or --without-posix-malloc-threshold was given. +if test "${with_posix_malloc_threshold+set}" = set; then + withval="$with_posix_malloc_threshold" + POSIX_MALLOC_THRESHOLD=-DPOSIX_MALLOC_THRESHOLD=$withval + +fi; + + + +# Check whether --with-link-size or --without-link-size was given. +if test "${with_link_size+set}" = set; then + withval="$with_link_size" + LINK_SIZE=-DLINK_SIZE=$withval + +fi; + + + +# Check whether --with-match-limit or --without-match-limit was given. +if test "${with_match_limit+set}" = set; then + withval="$with_match_limit" + MATCH_LIMIT=-DMATCH_LIMIT=$withval + +fi; + + +if test "$UCP" != "" ; then + UTF8=-DSUPPORT_UTF8 +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + +case $host_os in +mingw* ) + POSIX_OBJ=pcreposix.o + POSIX_LOBJ=pcreposix.lo + POSIX_LIB= + ON_WINDOWS= + NOT_ON_WINDOWS="#" + WIN_PREFIX= + ;; +* ) + ON_WINDOWS="#" + NOT_ON_WINDOWS= + POSIX_OBJ= + POSIX_LOBJ= + POSIX_LIB=libpcreposix.la + WIN_PREFIX= + ;; +esac + + + + + + + +if test "x$enable_shared" = "xno" ; then + +cat >>confdefs.h <<\_ACEOF +#define PCRE_STATIC 1 +_ACEOF + +fi + + ac_config_files="$ac_config_files Makefile pcre.h:pcre.h.in pcre-config:pcre-config.in libpcre.pc:libpcre.pc.in pcrecpp.h:pcrecpp.h.in pcre_stringpiece.h:pcre_stringpiece.h.in RunGrepTest:RunGrepTest.in RunTest:RunTest.in" + ac_config_commands="$ac_config_commands default" +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +{ + (set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} | + sed ' + t clear + : clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + : end' >>confcache +if diff $cache_file confcache >/dev/null 2>&1; then :; else + if test -w $cache_file; then + test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + cat confcache >$cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/; +s/:*\${srcdir}:*/:/; +s/:*@srcdir@:*/:/; +s/^\([^=]*=[ ]*\):*/\1/; +s/:*$//; +s/^[^=]*=[ ]*$//; +}' +fi + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_i=`echo "$ac_i" | + sed 's/\$U\././;s/\.o$//;s/\.obj$//'` + # 2. Add them. + ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + +: ${CONFIG_STATUS=./config.status} +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi +DUALCASE=1; export DUALCASE # for MKS sh + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 +echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 +echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + +exec 6>&1 + +# Open the log real soon, to keep \$[0] and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. Logging --version etc. is OK. +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX +} >&5 +cat >&5 <<_CSEOF + +This file was extended by $as_me, which was +generated by GNU Autoconf 2.59. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +_CSEOF +echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 +echo >&5 +_ACEOF + +# Files that config.status was made for. +if test -n "$ac_config_files"; then + echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_headers"; then + echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_links"; then + echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_commands"; then + echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS +fi + +cat >>$CONFIG_STATUS <<\_ACEOF + +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTIONS] [FILE]... + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +ac_cs_version="\\ +config.status +configured by $0, generated by GNU Autoconf 2.59, + with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" + +Copyright (C) 2003 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." +srcdir=$srcdir +INSTALL="$INSTALL" +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "x$1" : 'x\([^=]*\)='` + ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + ac_shift=: + ;; + -*) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + *) # This is not an option, so the user has probably given explicit + # arguments. + ac_option=$1 + ac_need_defaults=false;; + esac + + case $ac_option in + # Handling of the options. +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --vers* | -V ) + echo "$ac_cs_version"; exit 0 ;; + --he | --h) + # Conflict between --help and --header + { { echo "$as_me:$LINENO: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + CONFIG_FILES="$CONFIG_FILES $ac_optarg" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + ac_need_defaults=false;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +if \$ac_cs_recheck; then + echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion +fi + +_ACEOF + + + + + +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_config_target in $ac_config_targets +do + case "$ac_config_target" in + # Handling of arguments. + "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "pcre.h" ) CONFIG_FILES="$CONFIG_FILES pcre.h:pcre.h.in" ;; + "pcre-config" ) CONFIG_FILES="$CONFIG_FILES pcre-config:pcre-config.in" ;; + "libpcre.pc" ) CONFIG_FILES="$CONFIG_FILES libpcre.pc:libpcre.pc.in" ;; + "pcrecpp.h" ) CONFIG_FILES="$CONFIG_FILES pcrecpp.h:pcrecpp.h.in" ;; + "pcre_stringpiece.h" ) CONFIG_FILES="$CONFIG_FILES pcre_stringpiece.h:pcre_stringpiece.h.in" ;; + "RunGrepTest" ) CONFIG_FILES="$CONFIG_FILES RunGrepTest:RunGrepTest.in" ;; + "RunTest" ) CONFIG_FILES="$CONFIG_FILES RunTest:RunTest.in" ;; + "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; + "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; + esac +done + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason to put it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Create a temporary directory, and hook for its removal unless debugging. +$debug || +{ + trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} + +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./confstat$$-$RANDOM + (umask 077 && mkdir $tmp) +} || +{ + echo "$me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } +} + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF + +# +# CONFIG_FILES section. +# + +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h +if test -n "\$CONFIG_FILES"; then + # Protect against being on the right side of a sed subst in config.status. + sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; + s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF +s,@SHELL@,$SHELL,;t t +s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t +s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t +s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t +s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t +s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t +s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t +s,@exec_prefix@,$exec_prefix,;t t +s,@prefix@,$prefix,;t t +s,@program_transform_name@,$program_transform_name,;t t +s,@bindir@,$bindir,;t t +s,@sbindir@,$sbindir,;t t +s,@libexecdir@,$libexecdir,;t t +s,@datadir@,$datadir,;t t +s,@sysconfdir@,$sysconfdir,;t t +s,@sharedstatedir@,$sharedstatedir,;t t +s,@localstatedir@,$localstatedir,;t t +s,@libdir@,$libdir,;t t +s,@includedir@,$includedir,;t t +s,@oldincludedir@,$oldincludedir,;t t +s,@infodir@,$infodir,;t t +s,@mandir@,$mandir,;t t +s,@build_alias@,$build_alias,;t t +s,@host_alias@,$host_alias,;t t +s,@target_alias@,$target_alias,;t t +s,@DEFS@,$DEFS,;t t +s,@ECHO_C@,$ECHO_C,;t t +s,@ECHO_N@,$ECHO_N,;t t +s,@ECHO_T@,$ECHO_T,;t t +s,@LIBS@,$LIBS,;t t +s,@CC@,$CC,;t t +s,@CFLAGS@,$CFLAGS,;t t +s,@LDFLAGS@,$LDFLAGS,;t t +s,@CPPFLAGS@,$CPPFLAGS,;t t +s,@ac_ct_CC@,$ac_ct_CC,;t t +s,@EXEEXT@,$EXEEXT,;t t +s,@OBJEXT@,$OBJEXT,;t t +s,@CXX@,$CXX,;t t +s,@CXXFLAGS@,$CXXFLAGS,;t t +s,@ac_ct_CXX@,$ac_ct_CXX,;t t +s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t +s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t +s,@INSTALL_DATA@,$INSTALL_DATA,;t t +s,@build@,$build,;t t +s,@build_cpu@,$build_cpu,;t t +s,@build_vendor@,$build_vendor,;t t +s,@build_os@,$build_os,;t t +s,@host@,$host,;t t +s,@host_cpu@,$host_cpu,;t t +s,@host_vendor@,$host_vendor,;t t +s,@host_os@,$host_os,;t t +s,@EGREP@,$EGREP,;t t +s,@LN_S@,$LN_S,;t t +s,@ECHO@,$ECHO,;t t +s,@AR@,$AR,;t t +s,@ac_ct_AR@,$ac_ct_AR,;t t +s,@RANLIB@,$RANLIB,;t t +s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t +s,@STRIP@,$STRIP,;t t +s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t +s,@DLLTOOL@,$DLLTOOL,;t t +s,@ac_ct_DLLTOOL@,$ac_ct_DLLTOOL,;t t +s,@AS@,$AS,;t t +s,@ac_ct_AS@,$ac_ct_AS,;t t +s,@OBJDUMP@,$OBJDUMP,;t t +s,@ac_ct_OBJDUMP@,$ac_ct_OBJDUMP,;t t +s,@CPP@,$CPP,;t t +s,@CXXCPP@,$CXXCPP,;t t +s,@F77@,$F77,;t t +s,@FFLAGS@,$FFLAGS,;t t +s,@ac_ct_F77@,$ac_ct_F77,;t t +s,@LIBTOOL@,$LIBTOOL,;t t +s,@pcre_have_bits_type_traits@,$pcre_have_bits_type_traits,;t t +s,@pcre_have_type_traits@,$pcre_have_type_traits,;t t +s,@MAYBE_CPP_TARGETS@,$MAYBE_CPP_TARGETS,;t t +s,@HAVE_CPP@,$HAVE_CPP,;t t +s,@pcre_have_long_long@,$pcre_have_long_long,;t t +s,@pcre_have_ulong_long@,$pcre_have_ulong_long,;t t +s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t +s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t +s,@CC_FOR_BUILD@,$CC_FOR_BUILD,;t t +s,@CXX_FOR_BUILD@,$CXX_FOR_BUILD,;t t +s,@CFLAGS_FOR_BUILD@,$CFLAGS_FOR_BUILD,;t t +s,@CXXFLAGS_FOR_BUILD@,$CXXFLAGS_FOR_BUILD,;t t +s,@EBCDIC@,$EBCDIC,;t t +s,@HAVE_MEMMOVE@,$HAVE_MEMMOVE,;t t +s,@HAVE_STRERROR@,$HAVE_STRERROR,;t t +s,@LINK_SIZE@,$LINK_SIZE,;t t +s,@MATCH_LIMIT@,$MATCH_LIMIT,;t t +s,@NEWLINE@,$NEWLINE,;t t +s,@NO_RECURSE@,$NO_RECURSE,;t t +s,@PCRE_MAJOR@,$PCRE_MAJOR,;t t +s,@PCRE_MINOR@,$PCRE_MINOR,;t t +s,@PCRE_DATE@,$PCRE_DATE,;t t +s,@PCRE_VERSION@,$PCRE_VERSION,;t t +s,@PCRE_LIB_VERSION@,$PCRE_LIB_VERSION,;t t +s,@PCRE_POSIXLIB_VERSION@,$PCRE_POSIXLIB_VERSION,;t t +s,@PCRE_CPPLIB_VERSION@,$PCRE_CPPLIB_VERSION,;t t +s,@POSIX_MALLOC_THRESHOLD@,$POSIX_MALLOC_THRESHOLD,;t t +s,@UCP@,$UCP,;t t +s,@UTF8@,$UTF8,;t t +s,@WIN_PREFIX@,$WIN_PREFIX,;t t +s,@ON_WINDOWS@,$ON_WINDOWS,;t t +s,@NOT_ON_WINDOWS@,$NOT_ON_WINDOWS,;t t +s,@POSIX_OBJ@,$POSIX_OBJ,;t t +s,@POSIX_LOBJ@,$POSIX_LOBJ,;t t +s,@POSIX_LIB@,$POSIX_LIB,;t t +s,@LIBOBJS@,$LIBOBJS,;t t +s,@LTLIBOBJS@,$LTLIBOBJS,;t t +CEOF + +_ACEOF + + cat >>$CONFIG_STATUS <<\_ACEOF + # Split the substitutions into bite-sized pieces for seds with + # small command number limits, like on Digital OSF/1 and HP-UX. + ac_max_sed_lines=48 + ac_sed_frag=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_lines # Line after last line for current file. + ac_more_lines=: + ac_sed_cmds= + while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + else + sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + fi + if test ! -s $tmp/subs.frag; then + ac_more_lines=false + else + # The purpose of the label and of the branching condition is to + # speed up the sed processing (if there are no `@' at all, there + # is no need to browse any of the substitutions). + # These are the two extra sed commands mentioned above. + (echo ':t + /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + else + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + fi + ac_sed_frag=`expr $ac_sed_frag + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_lines` + fi + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat + fi +fi # test -n "$CONFIG_FILES" + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_builddir$INSTALL ;; + esac + + if test x"$ac_file" != x-; then + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + configure_input= + else + configure_input="$ac_file. " + fi + configure_input=$configure_input"Generated from `echo $ac_file_in | + sed 's,.*/,,'` by configure." + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo "$f";; + *) # Relative + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + sed "$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s,@configure_input@,$configure_input,;t t +s,@srcdir@,$ac_srcdir,;t t +s,@abs_srcdir@,$ac_abs_srcdir,;t t +s,@top_srcdir@,$ac_top_srcdir,;t t +s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t +s,@builddir@,$ac_builddir,;t t +s,@abs_builddir@,$ac_abs_builddir,;t t +s,@top_builddir@,$ac_top_builddir,;t t +s,@abs_top_builddir@,$ac_abs_top_builddir,;t t +s,@INSTALL@,$ac_INSTALL,;t t +" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out + rm -f $tmp/stdin + if test x"$ac_file" != x-; then + mv $tmp/out $ac_file + else + cat $tmp/out + rm -f $tmp/out + fi + +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + +# +# CONFIG_HEADER section. +# + +# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where +# NAME is the cpp macro being defined and VALUE is the value it is being given. +# +# ac_d sets the value in "#define NAME VALUE" lines. +ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' +ac_dB='[ ].*$,\1#\2' +ac_dC=' ' +ac_dD=',;t' +# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_uB='$,\1#\2define\3' +ac_uC=' ' +ac_uD=',;t' + +for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + # Do quote $f, to prevent DOS paths from being IFS'd. + echo "$f";; + *) # Relative + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } + # Remove the trailing spaces. + sed 's/[ ]*$//' $ac_file_inputs >$tmp/in + +_ACEOF + +# Transform confdefs.h into two sed scripts, `conftest.defines' and +# `conftest.undefs', that substitutes the proper values into +# config.h.in to produce config.h. The first handles `#define' +# templates, and the second `#undef' templates. +# And first: Protect against being on the right side of a sed subst in +# config.status. Protect against being in an unquoted here document +# in config.status. +rm -f conftest.defines conftest.undefs +# Using a here document instead of a string reduces the quoting nightmare. +# Putting comments in sed scripts is not portable. +# +# `end' is used to avoid that the second main sed command (meant for +# 0-ary CPP macros) applies to n-ary macro definitions. +# See the Autoconf documentation for `clear'. +cat >confdef2sed.sed <<\_ACEOF +s/[\\&,]/\\&/g +s,[\\$`],\\&,g +t clear +: clear +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp +t end +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp +: end +_ACEOF +# If some macros were called several times there might be several times +# the same #defines, which is useless. Nevertheless, we may not want to +# sort them, since we want the *last* AC-DEFINE to be honored. +uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines +sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs +rm -f confdef2sed.sed + +# This sed command replaces #undef with comments. This is necessary, for +# example, in the case of _POSIX_SOURCE, which is predefined and required +# on some systems where configure will not decide to define it. +cat >>conftest.undefs <<\_ACEOF +s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, +_ACEOF + +# Break up conftest.defines because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS +echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS +echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS +echo ' :' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.defines >/dev/null +do + # Write a limited-size here document to $tmp/defines.sed. + echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#define' lines. + echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/defines.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail + rm -f conftest.defines + mv conftest.tail conftest.defines +done +rm -f conftest.defines +echo ' fi # grep' >>$CONFIG_STATUS +echo >>$CONFIG_STATUS + +# Break up conftest.undefs because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #undef templates' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.undefs >/dev/null +do + # Write a limited-size here document to $tmp/undefs.sed. + echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#undef' + echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/undefs.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail + rm -f conftest.undefs + mv conftest.tail conftest.undefs +done +rm -f conftest.undefs + +cat >>$CONFIG_STATUS <<\_ACEOF + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + echo "/* Generated by configure. */" >$tmp/config.h + else + echo "/* $ac_file. Generated by configure. */" >$tmp/config.h + fi + cat $tmp/in >>$tmp/config.h + rm -f $tmp/in + if test x"$ac_file" != x-; then + if diff $ac_file $tmp/config.h >/dev/null 2>&1; then + { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +echo "$as_me: $ac_file is unchanged" >&6;} + else + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + rm -f $ac_file + mv $tmp/config.h $ac_file + fi + else + cat $tmp/config.h + rm -f $tmp/config.h + fi +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + +# +# CONFIG_COMMANDS section. +# +for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue + ac_dest=`echo "$ac_file" | sed 's,:.*,,'` + ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_dir=`(dirname "$ac_dest") 2>/dev/null || +$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_dest" : 'X\(//\)[^/]' \| \ + X"$ac_dest" : 'X\(//\)$' \| \ + X"$ac_dest" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_dest" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + + { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 +echo "$as_me: executing $ac_dest commands" >&6;} + case $ac_dest in + default ) chmod a+x RunTest RunGrepTest pcre-config ;; + esac +done +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF + +{ (exit 0); exit 0; } +_ACEOF +chmod +x $CONFIG_STATUS +ac_clean_files=$ac_clean_files_save + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || { (exit 1); exit 1; } +fi + diff --git a/mozilla/js/tamarin/pcre/configure.in b/mozilla/js/tamarin/pcre/configure.in new file mode 100644 index 00000000000..e011a8a523f --- /dev/null +++ b/mozilla/js/tamarin/pcre/configure.in @@ -0,0 +1,290 @@ +dnl Process this file with autoconf to produce a configure script. + +dnl This configure.in file has been hacked around quite a lot as a result of +dnl patches that various people have sent to me (PH). Sometimes the information +dnl I get is contradictory. I've tried to put in comments that explain things, +dnl but in some cases the information is second-hand and I have no way of +dnl verifying it. I am not an autoconf or libtool expert! + +dnl This is required at the start; the name is the name of a file +dnl it should be seeing, to verify it is in the same directory. + +AC_INIT(dftables.c) + +dnl A safety precaution + +AC_PREREQ(2.57) + +dnl Arrange to build config.h from config.h.in. Note that pcre.h is +dnl built differently, as it is just a "substitution" file. +dnl Manual says this macro should come right after AC_INIT. +AC_CONFIG_HEADER(config.h) + +dnl Provide the current PCRE version information. Do not use numbers +dnl with leading zeros for the minor version, as they end up in a C +dnl macro, and may be treated as octal constants. Stick to single +dnl digits for minor numbers less than 10. There are unlikely to be +dnl that many releases anyway. + +PCRE_MAJOR=6 +PCRE_MINOR=4 +PCRE_DATE=05-Sep-2005 +PCRE_VERSION=${PCRE_MAJOR}.${PCRE_MINOR} + +dnl Default values for miscellaneous macros + +POSIX_MALLOC_THRESHOLD=-DPOSIX_MALLOC_THRESHOLD=10 + +dnl Provide versioning information for libtool shared libraries that +dnl are built by default on Unix systems. + +PCRE_LIB_VERSION=0:1:0 +PCRE_POSIXLIB_VERSION=0:0:0 +PCRE_CPPLIB_VERSION=0:0:0 + +dnl Handle --disable-cpp + +AC_ARG_ENABLE(cpp, +[ --disable-cpp disable C++ support], +want_cpp="$enableval", want_cpp=yes) + +dnl Checks for programs. + +AC_PROG_CC + +dnl Test for C++ for the C++ wrapper libpcrecpp. It seems, however, that +dnl AC_PROC_CXX will set $CXX to "g++" when no C++ compiler is installed, even +dnl though that is completely bogus. (This may happen only on certain systems +dnl with certain versions of autoconf, of course.) An attempt to include this +dnl test inside a check for want_cpp was criticized by a libtool expert, who +dnl tells me that it isn't allowed. + +AC_PROG_CXX + +dnl The icc compiler has the same options as gcc, so let the rest of the +dnl configure script think it has gcc when setting up dnl options etc. +dnl This is a nasty hack which no longer seems necessary with the update +dnl to the latest libtool files, so I have commented it out. +dnl +dnl if test "$CC" = "icc" ; then GCC=yes ; fi + +AC_PROG_INSTALL +AC_LIBTOOL_WIN32_DLL +AC_PROG_LIBTOOL + +dnl We need to find a compiler for compiling a program to run on the local host +dnl while building. It needs to be different from CC when cross-compiling. +dnl There is a macro called AC_PROG_CC_FOR_BUILD in the GNU archive for +dnl figuring this out automatically. Unfortunately, it does not work with the +dnl latest versions of autoconf. So for the moment, we just default to the +dnl same values as the "main" compiler. People who are cross-compiling will +dnl just have to adjust the Makefile by hand or set these values when they +dnl run "configure". + +CC_FOR_BUILD=${CC_FOR_BUILD:-'$(CC)'} +CXX_FOR_BUILD=${CXX_FOR_BUILD:-'$(CXX)'} +CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD:-'$(CFLAGS)'} +CPPFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD:-'$(CPPFLAGS)'} +CXXFLAGS_FOR_BUILD=${CXXFLAGS_FOR_BUILD:-'$(CXXFLAGS)'} +BUILD_EXEEXT=${BUILD_EXEEXT:-'$(EXEEXT)'} +BUILD_OBJEXT=${BUILD_OBJEXT:-'$(OBJEXT)'} + +dnl Checks for header files. + +AC_HEADER_STDC +AC_CHECK_HEADERS(limits.h) + +dnl The files below are C++ header files. One person told me (PH) that +dnl AC_LANG_CPLUSPLUS unsets CXX if it was explicitly set to something which +dnl doesn't work. However, this doesn't always seem to be the case. + +if test "x$want_cpp" = "xyes" -a -n "$CXX" +then +AC_LANG_SAVE +AC_LANG_CPLUSPLUS + +dnl We could be more clever here, given we're doing AC_SUBST with this +dnl (eg set a var to be the name of the include file we want). But we're not +dnl so it's easy to change back to 'regular' autoconf vars if we needed to. +AC_CHECK_HEADERS(string, [pcre_have_cpp_headers="1"], + [pcre_have_cpp_headers="0"]) +AC_CHECK_HEADERS(bits/type_traits.h, [pcre_have_bits_type_traits="1"], + [pcre_have_bits_type_traits="0"]) +AC_CHECK_HEADERS(type_traits.h, [pcre_have_type_traits="1"], + [pcre_have_type_traits="0"]) +dnl Using AC_SUBST eliminates the need to include config.h in a public .h file +AC_SUBST(pcre_have_bits_type_traits) +AC_SUBST(pcre_have_type_traits) +AC_LANG_RESTORE +fi + +dnl From the above, we now have enough info to know if C++ is fully installed +if test "x$want_cpp" = "xyes" -a -n "$CXX" -a "$pcre_have_cpp_headers" = 1; then + MAYBE_CPP_TARGETS='$(CPP_TARGETS)' + HAVE_CPP= +else + MAYBE_CPP_TARGETS= + HAVE_CPP="#" +fi +AC_SUBST(MAYBE_CPP_TARGETS) +AC_SUBST(HAVE_CPP) + +dnl Checks for typedefs, structures, and compiler characteristics. + +AC_C_CONST +AC_TYPE_SIZE_T + +AC_CHECK_TYPES([long long], [pcre_have_long_long="1"], [pcre_have_long_long="0"]) +AC_CHECK_TYPES([unsigned long long], [pcre_have_ulong_long="1"], [pcre_have_ulong_long="0"]) +AC_SUBST(pcre_have_long_long) +AC_SUBST(pcre_have_ulong_long) + +dnl Checks for library functions. + +AC_CHECK_FUNCS(bcopy memmove strerror strtoq strtoll) + +dnl Handle --enable-utf8 + +AC_ARG_ENABLE(utf8, +[ --enable-utf8 enable UTF8 support], +if test "$enableval" = "yes"; then + UTF8=-DSUPPORT_UTF8 +fi +) + +dnl Handle --enable-unicode-properties + +AC_ARG_ENABLE(unicode-properties, +[ --enable-unicode-properties enable Unicode properties support], +if test "$enableval" = "yes"; then + UCP=-DSUPPORT_UCP +fi +) + +dnl Handle --enable-newline-is-cr + +AC_ARG_ENABLE(newline-is-cr, +[ --enable-newline-is-cr use CR as the newline character], +if test "$enableval" = "yes"; then + NEWLINE=-DNEWLINE=13 +fi +) + +dnl Handle --enable-newline-is-lf + +AC_ARG_ENABLE(newline-is-lf, +[ --enable-newline-is-lf use LF as the newline character], +if test "$enableval" = "yes"; then + NEWLINE=-DNEWLINE=10 +fi +) + +dnl Handle --enable-ebcdic + +AC_ARG_ENABLE(ebcdic, +[ --enable-ebcdic assume EBCDIC coding rather than ASCII], +if test "$enableval" == "yes"; then + EBCDIC=-DEBCDIC=1 +fi +) + +dnl Handle --disable-stack-for-recursion + +AC_ARG_ENABLE(stack-for-recursion, +[ --disable-stack-for-recursion disable use of stack recursion when matching], +if test "$enableval" = "no"; then + NO_RECURSE=-DNO_RECURSE +fi +) + +dnl There doesn't seem to be a straightforward way of having parameters +dnl that set values, other than fudging the --with thing. So that's what +dnl I've done. + +dnl Handle --with-posix-malloc-threshold=n + +AC_ARG_WITH(posix-malloc-threshold, +[ --with-posix-malloc-threshold=5 threshold for POSIX malloc usage], + POSIX_MALLOC_THRESHOLD=-DPOSIX_MALLOC_THRESHOLD=$withval +) + +dnl Handle --with-link-size=n + +AC_ARG_WITH(link-size, +[ --with-link-size=2 internal link size (2, 3, or 4 allowed)], + LINK_SIZE=-DLINK_SIZE=$withval +) + +dnl Handle --with-match_limit=n + +AC_ARG_WITH(match-limit, +[ --with-match-limit=10000000 default limit on internal looping)], + MATCH_LIMIT=-DMATCH_LIMIT=$withval +) + +dnl Unicode character property support implies UTF-8 support + +if test "$UCP" != "" ; then + UTF8=-DSUPPORT_UTF8 +fi + +dnl "Export" these variables + +AC_SUBST(BUILD_EXEEXT) +AC_SUBST(BUILD_OBJEXT) +AC_SUBST(CC_FOR_BUILD) +AC_SUBST(CXX_FOR_BUILD) +AC_SUBST(CFLAGS_FOR_BUILD) +AC_SUBST(CXXFLAGS_FOR_BUILD) +AC_SUBST(EBCDIC) +AC_SUBST(HAVE_MEMMOVE) +AC_SUBST(HAVE_STRERROR) +AC_SUBST(LINK_SIZE) +AC_SUBST(MATCH_LIMIT) +AC_SUBST(NEWLINE) +AC_SUBST(NO_RECURSE) +AC_SUBST(PCRE_MAJOR) +AC_SUBST(PCRE_MINOR) +AC_SUBST(PCRE_DATE) +AC_SUBST(PCRE_VERSION) +AC_SUBST(PCRE_LIB_VERSION) +AC_SUBST(PCRE_POSIXLIB_VERSION) +AC_SUBST(PCRE_CPPLIB_VERSION) +AC_SUBST(POSIX_MALLOC_THRESHOLD) +AC_SUBST(UCP) +AC_SUBST(UTF8) + +dnl Stuff to make MinGW work better. Special treatment is no longer +dnl needed for Cygwin. + +case $host_os in +mingw* ) + POSIX_OBJ=pcreposix.o + POSIX_LOBJ=pcreposix.lo + POSIX_LIB= + ON_WINDOWS= + NOT_ON_WINDOWS="#" + WIN_PREFIX= + ;; +* ) + ON_WINDOWS="#" + NOT_ON_WINDOWS= + POSIX_OBJ= + POSIX_LOBJ= + POSIX_LIB=libpcreposix.la + WIN_PREFIX= + ;; +esac +AC_SUBST(WIN_PREFIX) +AC_SUBST(ON_WINDOWS) +AC_SUBST(NOT_ON_WINDOWS) +AC_SUBST(POSIX_OBJ) +AC_SUBST(POSIX_LOBJ) +AC_SUBST(POSIX_LIB) + +if test "x$enable_shared" = "xno" ; then + AC_DEFINE([PCRE_STATIC],[1],[to link statically]) +fi + +dnl This must be last; it determines what files are written as well as config.h +AC_OUTPUT(Makefile pcre.h:pcre.h.in pcre-config:pcre-config.in libpcre.pc:libpcre.pc.in pcrecpp.h:pcrecpp.h.in pcre_stringpiece.h:pcre_stringpiece.h.in RunGrepTest:RunGrepTest.in RunTest:RunTest.in,[chmod a+x RunTest RunGrepTest pcre-config]) diff --git a/mozilla/js/tamarin/pcre/dftables.cpp b/mozilla/js/tamarin/pcre/dftables.cpp new file mode 100644 index 00000000000..480753887ed --- /dev/null +++ b/mozilla/js/tamarin/pcre/dftables.cpp @@ -0,0 +1,172 @@ +/************************************************* +* Perl-Compatible Regular Expressions * +*************************************************/ + +/* PCRE is a library of functions to support regular expressions whose syntax +and semantics are as close as possible to those of the Perl 5 language. + + Written by Philip Hazel + Copyright (c) 1997-2005 University of Cambridge + +----------------------------------------------------------------------------- +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + * Neither the name of the University of Cambridge nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +----------------------------------------------------------------------------- +*/ + + +/* This is a freestanding support program to generate a file containing default +character tables for PCRE. The tables are built according to the default C +locale. Now that pcre_maketables is a function visible to the outside world, we +make use of its code from here in order to be consistent. */ + +#include +#include +#include + +#include "pcre_internal.h" + +#define DFTABLES /* pcre_maketables.c notices this */ +#include "pcre_maketables.c" + + +int main(int argc, char **argv) +{ +int i; +FILE *f; +const unsigned char *tables = pcre_maketables(); +const unsigned char *base_of_tables = tables; + +if (argc != 2) + { + fprintf(stderr, "dftables: one filename argument is required\n"); + return 1; + } + +f = fopen(argv[1], "wb"); +if (f == NULL) + { + fprintf(stderr, "dftables: failed to open %s for writing\n", argv[1]); + return 1; + } + +/* There are two fprintf() calls here, because gcc in pedantic mode complains +about the very long string otherwise. */ + +fprintf(f, + "/*************************************************\n" + "* Perl-Compatible Regular Expressions *\n" + "*************************************************/\n\n" + "/* This file is automatically written by the dftables auxiliary \n" + "program. If you edit it by hand, you might like to edit the Makefile to \n" + "prevent its ever being regenerated.\n\n"); +fprintf(f, + "This file contains the default tables for characters with codes less than\n" + "128 (ASCII characters). These tables are used when no external tables are\n" + "passed to PCRE. */\n\n" + "const unsigned char _pcre_default_tables[] = {\n\n" + "/* This table is a lower casing table. */\n\n"); + +fprintf(f, " "); +for (i = 0; i < 256; i++) + { + if ((i & 7) == 0 && i != 0) fprintf(f, "\n "); + fprintf(f, "%3d", *tables++); + if (i != 255) fprintf(f, ","); + } +fprintf(f, ",\n\n"); + +fprintf(f, "/* This table is a case flipping table. */\n\n"); + +fprintf(f, " "); +for (i = 0; i < 256; i++) + { + if ((i & 7) == 0 && i != 0) fprintf(f, "\n "); + fprintf(f, "%3d", *tables++); + if (i != 255) fprintf(f, ","); + } +fprintf(f, ",\n\n"); + +fprintf(f, + "/* This table contains bit maps for various character classes.\n" + "Each map is 32 bytes long and the bits run from the least\n" + "significant end of each byte. The classes that have their own\n" + "maps are: space, xdigit, digit, upper, lower, word, graph\n" + "print, punct, and cntrl. Other classes are built from combinations. */\n\n"); + +fprintf(f, " "); +for (i = 0; i < cbit_length; i++) + { + if ((i & 7) == 0 && i != 0) + { + if ((i & 31) == 0) fprintf(f, "\n"); + fprintf(f, "\n "); + } + fprintf(f, "0x%02x", *tables++); + if (i != cbit_length - 1) fprintf(f, ","); + } +fprintf(f, ",\n\n"); + +fprintf(f, + "/* This table identifies various classes of character by individual bits:\n" + " 0x%02x white space character\n" + " 0x%02x letter\n" + " 0x%02x decimal digit\n" + " 0x%02x hexadecimal digit\n" + " 0x%02x alphanumeric or '_'\n" + " 0x%02x regular expression metacharacter or binary zero\n*/\n\n", + ctype_space, ctype_letter, ctype_digit, ctype_xdigit, ctype_word, + ctype_meta); + +fprintf(f, " "); +for (i = 0; i < 256; i++) + { + if ((i & 7) == 0 && i != 0) + { + fprintf(f, " /* "); + if (isprint(i-8)) fprintf(f, " %c -", i-8); + else fprintf(f, "%3d-", i-8); + if (isprint(i-1)) fprintf(f, " %c ", i-1); + else fprintf(f, "%3d", i-1); + fprintf(f, " */\n "); + } + fprintf(f, "0x%02x", *tables++); + if (i != 255) fprintf(f, ","); + } + +fprintf(f, "};/* "); +if (isprint(i-8)) fprintf(f, " %c -", i-8); + else fprintf(f, "%3d-", i-8); +if (isprint(i-1)) fprintf(f, " %c ", i-1); + else fprintf(f, "%3d", i-1); +fprintf(f, " */\n\n/* End of chartables.c */\n"); + +fclose(f); +free((void *)base_of_tables); +return 0; +} + +/* End of dftables.c */ diff --git a/mozilla/js/tamarin/pcre/doc/Tech.Notes b/mozilla/js/tamarin/pcre/doc/Tech.Notes new file mode 100644 index 00000000000..322cc2de131 --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/Tech.Notes @@ -0,0 +1,339 @@ +Technical Notes about PCRE +-------------------------- + +Historical note 1 +----------------- + +Many years ago I implemented some regular expression functions to an algorithm +suggested by Martin Richards. These were not Unix-like in form, and were quite +restricted in what they could do by comparison with Perl. The interesting part +about the algorithm was that the amount of space required to hold the compiled +form of an expression was known in advance. The code to apply an expression did +not operate by backtracking, as the original Henry Spencer code and current +Perl code does, but instead checked all possibilities simultaneously by keeping +a list of current states and checking all of them as it advanced through the +subject string. In the terminology of Jeffrey Friedl's book, it was a "DFA +algorithm". When the pattern was all used up, all remaining states were +possible matches, and the one matching the longest subset of the subject string +was chosen. This did not necessarily maximize the individual wild portions of +the pattern, as is expected in Unix and Perl-style regular expressions. + +Historical note 2 +----------------- + +By contrast, the code originally written by Henry Spencer and subsequently +heavily modified for Perl actually compiles the expression twice: once in a +dummy mode in order to find out how much store will be needed, and then for +real. The execution function operates by backtracking and maximizing (or, +optionally, minimizing in Perl) the amount of the subject that matches +individual wild portions of the pattern. This is an "NFA algorithm" in Friedl's +terminology. + +OK, here's the real stuff +------------------------- + +For the set of functions that form the "basic" PCRE library (which are +unrelated to those mentioned above), I tried at first to invent an algorithm +that used an amount of store bounded by a multiple of the number of characters +in the pattern, to save on compiling time. However, because of the greater +complexity in Perl regular expressions, I couldn't do this. In any case, a +first pass through the pattern is needed, for a number of reasons. PCRE works +by running a very degenerate first pass to calculate a maximum store size, and +then a second pass to do the real compile - which may use a bit less than the +predicted amount of store. The idea is that this is going to turn out faster +because the first pass is degenerate and the second pass can just store stuff +straight into the vector, which it knows is big enough. It does make the +compiling functions bigger, of course, but they have got quite big anyway to +handle all the Perl stuff. + +Traditional matching function +----------------------------- + +The "traditional", and original, matching function is called pcre_exec(), and +it implements an NFA algorithm, similar to the original Henry Spencer algorithm +and the way that Perl works. Not surprising, since it is intended to be as +compatible with Perl as possible. This is the function most users of PCRE will +use most of the time. + +Supplementary matching function +------------------------------- + +From PCRE 6.0, there is also a supplementary matching function called +pcre_dfa_exec(). This implements a DFA matching algorithm that searches +simultaneously for all possible matches that start at one point in the subject +string. (Going back to my roots: see Historical Note 1 above.) This function +intreprets the same compiled pattern data as pcre_exec(); however, not all the +facilities are available, and those that are don't always work in quite the +same way. See the user documentation for details. + +Format of compiled patterns +--------------------------- + +The compiled form of a pattern is a vector of bytes, containing items of +variable length. The first byte in an item is an opcode, and the length of the +item is either implicit in the opcode or contained in the data bytes that +follow it. + +In many cases below "two-byte" data values are specified. This is in fact just +a default. PCRE can be compiled to use 3-byte or 4-byte values (impairing the +performance). This is necessary only when patterns whose compiled length is +greater than 64K are going to be processed. In this description, we assume the +"normal" compilation options. + +A list of all the opcodes follows: + +Opcodes with no following data +------------------------------ + +These items are all just one byte long + + OP_END end of pattern + OP_ANY match any character + OP_ANYBYTE match any single byte, even in UTF-8 mode + OP_SOD match start of data: \A + OP_SOM, start of match (subject + offset): \G + OP_CIRC ^ (start of data, or after \n in multiline) + OP_NOT_WORD_BOUNDARY \W + OP_WORD_BOUNDARY \w + OP_NOT_DIGIT \D + OP_DIGIT \d + OP_NOT_WHITESPACE \S + OP_WHITESPACE \s + OP_NOT_WORDCHAR \W + OP_WORDCHAR \w + OP_EODN match end of data or \n at end: \Z + OP_EOD match end of data: \z + OP_DOLL $ (end of data, or before \n in multiline) + OP_EXTUNI match an extended Unicode character + + +Repeating single characters +--------------------------- + +The common repeats (*, +, ?) when applied to a single character use the +following opcodes: + + OP_STAR + OP_MINSTAR + OP_PLUS + OP_MINPLUS + OP_QUERY + OP_MINQUERY + +In ASCII mode, these are two-byte items; in UTF-8 mode, the length is variable. +Those with "MIN" in their name are the minimizing versions. Each is followed by +the character that is to be repeated. Other repeats make use of + + OP_UPTO + OP_MINUPTO + OP_EXACT + +which are followed by a two-byte count (most significant first) and the +repeated character. OP_UPTO matches from 0 to the given number. A repeat with a +non-zero minimum and a fixed maximum is coded as an OP_EXACT followed by an +OP_UPTO (or OP_MINUPTO). + + +Repeating character types +------------------------- + +Repeats of things like \d are done exactly as for single characters, except +that instead of a character, the opcode for the type is stored in the data +byte. The opcodes are: + + OP_TYPESTAR + OP_TYPEMINSTAR + OP_TYPEPLUS + OP_TYPEMINPLUS + OP_TYPEQUERY + OP_TYPEMINQUERY + OP_TYPEUPTO + OP_TYPEMINUPTO + OP_TYPEEXACT + + +Match by Unicode property +------------------------- + +OP_PROP and OP_NOTPROP are used for positive and negative matches of a +character by testing its Unicode property (the \p and \P escape sequences). +Each is followed by a single byte that encodes the desired property value. + +Repeats of these items use the OP_TYPESTAR etc. set of opcodes, followed by two +bytes: OP_PROP or OP_NOTPROP and then the desired property value. + + +Matching literal characters +--------------------------- + +The OP_CHAR opcode is followed by a single character that is to be matched +casefully. For caseless matching, OP_CHARNC is used. In UTF-8 mode, the +character may be more than one byte long. (Earlier versions of PCRE used +multi-character strings, but this was changed to allow some new features to be +added.) + + +Character classes +----------------- + +If there is only one character, OP_CHAR or OP_CHARNC is used for a positive +class, and OP_NOT for a negative one (that is, for something like [^a]). +However, in UTF-8 mode, the use of OP_NOT applies only to characters with +values < 128, because OP_NOT is confined to single bytes. + +Another set of repeating opcodes (OP_NOTSTAR etc.) are used for a repeated, +negated, single-character class. The normal ones (OP_STAR etc.) are used for a +repeated positive single-character class. + +When there's more than one character in a class and all the characters are less +than 256, OP_CLASS is used for a positive class, and OP_NCLASS for a negative +one. In either case, the opcode is followed by a 32-byte bit map containing a 1 +bit for every character that is acceptable. The bits are counted from the least +significant end of each byte. + +The reason for having both OP_CLASS and OP_NCLASS is so that, in UTF-8 mode, +subject characters with values greater than 256 can be handled correctly. For +OP_CLASS they don't match, whereas for OP_NCLASS they do. + +For classes containing characters with values > 255, OP_XCLASS is used. It +optionally uses a bit map (if any characters lie within it), followed by a list +of pairs and single characters. There is a flag character than indicates +whether it's a positive or a negative class. + + +Back references +--------------- + +OP_REF is followed by two bytes containing the reference number. + + +Repeating character classes and back references +----------------------------------------------- + +Single-character classes are handled specially (see above). This applies to +OP_CLASS and OP_REF. In both cases, the repeat information follows the base +item. The matching code looks at the following opcode to see if it is one of + + OP_CRSTAR + OP_CRMINSTAR + OP_CRPLUS + OP_CRMINPLUS + OP_CRQUERY + OP_CRMINQUERY + OP_CRRANGE + OP_CRMINRANGE + +All but the last two are just single-byte items. The others are followed by +four bytes of data, comprising the minimum and maximum repeat counts. + + +Brackets and alternation +------------------------ + +A pair of non-capturing (round) brackets is wrapped round each expression at +compile time, so alternation always happens in the context of brackets. + +Non-capturing brackets use the opcode OP_BRA, while capturing brackets use +OP_BRA+1, OP_BRA+2, etc. [Note for North Americans: "bracket" to some English +speakers, including myself, can be round, square, curly, or pointy. Hence this +usage.] + +Originally PCRE was limited to 99 capturing brackets (so as not to use up all +the opcodes). From release 3.5, there is no limit. What happens is that the +first ones, up to EXTRACT_BASIC_MAX are handled with separate opcodes, as +above. If there are more, the opcode is set to EXTRACT_BASIC_MAX+1, and the +first operation in the bracket is OP_BRANUMBER, followed by a 2-byte bracket +number. This opcode is ignored while matching, but is fished out when handling +the bracket itself. (They could have all been done like this, but I was making +minimal changes.) + +A bracket opcode is followed by LINK_SIZE bytes which give the offset to the +next alternative OP_ALT or, if there aren't any branches, to the matching +OP_KET opcode. Each OP_ALT is followed by LINK_SIZE bytes giving the offset to +the next one, or to the OP_KET opcode. + +OP_KET is used for subpatterns that do not repeat indefinitely, while +OP_KETRMIN and OP_KETRMAX are used for indefinite repetitions, minimally or +maximally respectively. All three are followed by LINK_SIZE bytes giving (as a +positive number) the offset back to the matching OP_BRA opcode. + +If a subpattern is quantified such that it is permitted to match zero times, it +is preceded by one of OP_BRAZERO or OP_BRAMINZERO. These are single-byte +opcodes which tell the matcher that skipping this subpattern entirely is a +valid branch. + +A subpattern with an indefinite maximum repetition is replicated in the +compiled data its minimum number of times (or once with OP_BRAZERO if the +minimum is zero), with the final copy terminating with OP_KETRMIN or OP_KETRMAX +as appropriate. + +A subpattern with a bounded maximum repetition is replicated in a nested +fashion up to the maximum number of times, with OP_BRAZERO or OP_BRAMINZERO +before each replication after the minimum, so that, for example, (abc){2,5} is +compiled as (abc)(abc)((abc)((abc)(abc)?)?)?. + + +Assertions +---------- + +Forward assertions are just like other subpatterns, but starting with one of +the opcodes OP_ASSERT or OP_ASSERT_NOT. Backward assertions use the opcodes +OP_ASSERTBACK and OP_ASSERTBACK_NOT, and the first opcode inside the assertion +is OP_REVERSE, followed by a two byte count of the number of characters to move +back the pointer in the subject string. When operating in UTF-8 mode, the count +is a character count rather than a byte count. A separate count is present in +each alternative of a lookbehind assertion, allowing them to have different +fixed lengths. + + +Once-only subpatterns +--------------------- + +These are also just like other subpatterns, but they start with the opcode +OP_ONCE. + + +Conditional subpatterns +----------------------- + +These are like other subpatterns, but they start with the opcode OP_COND. If +the condition is a back reference, this is stored at the start of the +subpattern using the opcode OP_CREF followed by two bytes containing the +reference number. If the condition is "in recursion" (coded as "(?(R)"), the +same scheme is used, with a "reference number" of 0xffff. Otherwise, a +conditional subpattern always starts with one of the assertions. + + +Recursion +--------- + +Recursion either matches the current regex, or some subexpression. The opcode +OP_RECURSE is followed by an value which is the offset to the starting bracket +from the start of the whole pattern. + + +Callout +------- + +OP_CALLOUT is followed by one byte of data that holds a callout number in the +range 0 to 254 for manual callouts, or 255 for an automatic callout. In both +cases there follows a two-byte value giving the offset in the pattern to the +start of the following item, and another two-byte item giving the length of the +next item. + + +Changing options +---------------- + +If any of the /i, /m, or /s options are changed within a pattern, an OP_OPT +opcode is compiled, followed by one byte containing the new settings of these +flags. If there are several alternatives, there is an occurrence of OP_OPT at +the start of all those following the first options change, to set appropriate +options for the start of the alternative. Immediately after the end of the +group there is another such item to reset the flags to their previous values. A +change of flag right at the very start of the pattern can be handled entirely +at compile time, and so does not cause anything to be put into the compiled +data. + +Philip Hazel +March 2005 diff --git a/mozilla/js/tamarin/pcre/doc/html/index.html b/mozilla/js/tamarin/pcre/doc/html/index.html new file mode 100644 index 00000000000..32664ffcadc --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/html/index.html @@ -0,0 +1,122 @@ + + +PCRE specification + + +

    Perl-compatible Regular Expressions (PCRE)

    +

    +The HTML documentation for PCRE comprises the following pages: +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    pcre  Introductory page
    pcreapi  PCRE's native API
    pcrebuild  Options for building PCRE
    pcrecallout  The callout facility
    pcrecompat  Compability with Perl
    pcrecpp  The C++ wrapper for the PCRE library
    pcregrep  The pcregrep command
    pcrematching  Discussion of the two matching algorithms
    pcrepartial  Using PCRE for partial matching
    pcrepattern  Specification of the regular expressions supported by PCRE
    pcreperform  Some comments on performance
    pcreposix  The POSIX API to the PCRE library
    pcreprecompile  How to save and re-use compiled patterns
    pcresample  Description of the sample program
    pcretest  The pcretest command for testing PCRE
    + +

    +There are also individual pages that summarize the interface for each function +in the library: +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    pcre_compile  Compile a regular expression
    pcre_compile2  Compile a regular expression (alternate interface)
    pcre_config  Show build-time configuration options
    pcre_copy_named_substring  Extract named substring into given buffer
    pcre_copy_substring  Extract numbered substring into given buffer
    pcre_dfa_exec  Match a compiled pattern to a subject string + (DFA algorithm; not Perl compatible)
    pcre_exec  Match a compiled pattern to a subject string + (Perl compatible)
    pcre_free_substring  Free extracted substring
    pcre_free_substring_list  Free list of extracted substrings
    pcre_fullinfo  Extract information about a pattern
    pcre_get_named_substring  Extract named substring into new memory
    pcre_get_stringnumber  Convert captured string name to number
    pcre_get_substring  Extract numbered substring into new memory
    pcre_get_substring_list  Extract all substrings into new memory
    pcre_info  Obsolete information extraction function
    pcre_maketables  Build character tables in current locale
    pcre_study  Study a compiled pattern
    pcre_version  Return PCRE version and release date
    + + diff --git a/mozilla/js/tamarin/pcre/doc/html/pcre.html b/mozilla/js/tamarin/pcre/doc/html/pcre.html new file mode 100644 index 00000000000..1f3692431e1 --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/html/pcre.html @@ -0,0 +1,241 @@ + + +pcre specification + + +

    pcre man page

    +

    +Return to the PCRE index page. +

    +

    +This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
    +

    +
    INTRODUCTION
    +

    +The PCRE library is a set of functions that implement regular expression +pattern matching using the same syntax and semantics as Perl, with just a few +differences. The current implementation of PCRE (release 6.x) corresponds +approximately with Perl 5.8, including support for UTF-8 encoded strings and +Unicode general category properties. However, this support has to be explicitly +enabled; it is not the default. +

    +

    +In addition to the Perl-compatible matching function, PCRE also contains an +alternative matching function that matches the same compiled patterns in a +different way. In certain circumstances, the alternative function has some +advantages. For a discussion of the two matching algorithms, see the +pcrematching +page. +

    +

    +PCRE is written in C and released as a C library. A number of people have +written wrappers and interfaces of various kinds. In particular, Google Inc. +have provided a comprehensive C++ wrapper. This is now included as part of the +PCRE distribution. The +pcrecpp +page has details of this interface. Other people's contributions can be found +in the Contrib directory at the primary FTP site, which is: +ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre +

    +

    +Details of exactly which Perl regular expression features are and are not +supported by PCRE are given in separate documents. See the +pcrepattern +and +pcrecompat +pages. +

    +

    +Some features of PCRE can be included, excluded, or changed when the library is +built. The +pcre_config() +function makes it possible for a client to discover which features are +available. The features themselves are described in the +pcrebuild +page. Documentation about building PCRE for various operating systems can be +found in the README file in the source distribution. +

    +

    +The library contains a number of undocumented internal functions and data +tables that are used by more than one of the exported external functions, but +which are not intended for use by external callers. Their names all begin with +"_pcre_", which hopefully will not provoke any name clashes. In some +environments, it is possible to control which external symbols are exported +when a shared library is built, and in these cases the undocumented symbols are +not exported. +

    +
    USER DOCUMENTATION
    +

    +The user documentation for PCRE comprises a number of different sections. In +the "man" format, each of these is a separate "man page". In the HTML format, +each is a separate page, linked from the index page. In the plain text format, +all the sections are concatenated, for ease of searching. The sections are as +follows: +

    +  pcre              this document
    +  pcreapi           details of PCRE's native C API
    +  pcrebuild         options for building PCRE
    +  pcrecallout       details of the callout feature
    +  pcrecompat        discussion of Perl compatibility
    +  pcrecpp           details of the C++ wrapper
    +  pcregrep          description of the pcregrep command
    +  pcrematching      discussion of the two matching algorithms
    +  pcrepartial       details of the partial matching facility
    +  pcrepattern       syntax and semantics of supported regular expressions
    +  pcreperform       discussion of performance issues
    +  pcreposix         the POSIX-compatible C API
    +  pcreprecompile    details of saving and re-using precompiled patterns
    +  pcresample        discussion of the sample program
    +  pcretest          description of the pcretest testing command
    +
    +In addition, in the "man" and HTML formats, there is a short page for each +C library function, listing its arguments and results. +

    +
    LIMITATIONS
    +

    +There are some size limitations in PCRE but it is hoped that they will never in +practice be relevant. +

    +

    +The maximum length of a compiled pattern is 65539 (sic) bytes if PCRE is +compiled with the default internal linkage size of 2. If you want to process +regular expressions that are truly enormous, you can compile PCRE with an +internal linkage size of 3 or 4 (see the README file in the source +distribution and the +pcrebuild +documentation for details). In these cases the limit is substantially larger. +However, the speed of execution will be slower. +

    +

    +All values in repeating quantifiers must be less than 65536. +The maximum number of capturing subpatterns is 65535. +

    +

    +There is no limit to the number of non-capturing subpatterns, but the maximum +depth of nesting of all kinds of parenthesized subpattern, including capturing +subpatterns, assertions, and other types of subpattern, is 200. +

    +

    +The maximum length of a subject string is the largest positive number that an +integer variable can hold. However, when using the traditional matching +function, PCRE uses recursion to handle subpatterns and indefinite repetition. +This means that the available stack space may limit the size of a subject +string that can be processed by certain patterns. +

    +
    UTF-8 AND UNICODE PROPERTY SUPPORT
    +

    +From release 3.3, PCRE has had some support for character strings encoded in +the UTF-8 format. For release 4.0 this was greatly extended to cover most +common requirements, and in release 5.0 additional support for Unicode general +category properties was added. +

    +

    +In order process UTF-8 strings, you must build PCRE to include UTF-8 support in +the code, and, in addition, you must call +pcre_compile() +with the PCRE_UTF8 option flag. When you do this, both the pattern and any +subject strings that are matched against it are treated as UTF-8 strings +instead of just strings of bytes. +

    +

    +If you compile PCRE with UTF-8 support, but do not use it at run time, the +library will be a bit bigger, but the additional run time overhead is limited +to testing the PCRE_UTF8 flag in several places, so should not be very large. +

    +

    +If PCRE is built with Unicode character property support (which implies UTF-8 +support), the escape sequences \p{..}, \P{..}, and \X are supported. +The available properties that can be tested are limited to the general +category properties such as Lu for an upper case letter or Nd for a decimal +number. A full list is given in the +pcrepattern +documentation. The PCRE library is increased in size by about 90K when Unicode +property support is included. +

    +

    +The following comments apply when PCRE is running in UTF-8 mode: +

    +

    +1. When you set the PCRE_UTF8 flag, the strings passed as patterns and subjects +are checked for validity on entry to the relevant functions. If an invalid +UTF-8 string is passed, an error return is given. In some situations, you may +already know that your strings are valid, and therefore want to skip these +checks in order to improve performance. If you set the PCRE_NO_UTF8_CHECK flag +at compile time or at run time, PCRE assumes that the pattern or subject it +is given (respectively) contains only valid UTF-8 codes. In this case, it does +not diagnose an invalid UTF-8 string. If you pass an invalid UTF-8 string to +PCRE when PCRE_NO_UTF8_CHECK is set, the results are undefined. Your program +may crash. +

    +

    +2. In a pattern, the escape sequence \x{...}, where the contents of the braces +is a string of hexadecimal digits, is interpreted as a UTF-8 character whose +code number is the given hexadecimal number, for example: \x{1234}. If a +non-hexadecimal digit appears between the braces, the item is not recognized. +This escape sequence can be used either as a literal, or within a character +class. +

    +

    +3. The original hexadecimal escape sequence, \xhh, matches a two-byte UTF-8 +character if the value is greater than 127. +

    +

    +4. Repeat quantifiers apply to complete UTF-8 characters, not to individual +bytes, for example: \x{100}{3}. +

    +

    +5. The dot metacharacter matches one UTF-8 character instead of a single byte. +

    +

    +6. The escape sequence \C can be used to match a single byte in UTF-8 mode, +but its use can lead to some strange effects. This facility is not available in +the alternative matching function, pcre_dfa_exec(). +

    +

    +7. The character escapes \b, \B, \d, \D, \s, \S, \w, and \W correctly +test characters of any code value, but the characters that PCRE recognizes as +digits, spaces, or word characters remain the same set as before, all with +values less than 256. This remains true even when PCRE includes Unicode +property support, because to do otherwise would slow down PCRE in many common +cases. If you really want to test for a wider sense of, say, "digit", you +must use Unicode property tests such as \p{Nd}. +

    +

    +8. Similarly, characters that match the POSIX named character classes are all +low-valued characters. +

    +

    +9. Case-insensitive matching applies only to characters whose values are less +than 128, unless PCRE is built with Unicode property support. Even when Unicode +property support is available, PCRE still uses its own character tables when +checking the case of low-valued characters, so as not to degrade performance. +The Unicode property information is used only for characters with higher +values. +

    +
    AUTHOR
    +

    +Philip Hazel +
    +University Computing Service, +
    +Cambridge CB2 3QG, England. +

    +

    +Putting an actual email address here seems to have been a spam magnet, so I've +taken it away. If you want to email me, use my initial and surname, separated +by a dot, at the domain ucs.cam.ac.uk. +Last updated: 07 March 2005 +
    +Copyright © 1997-2005 University of Cambridge. +

    +Return to the PCRE index page. +

    diff --git a/mozilla/js/tamarin/pcre/doc/html/pcre_compile.html b/mozilla/js/tamarin/pcre/doc/html/pcre_compile.html new file mode 100644 index 00000000000..7ed2c324999 --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/html/pcre_compile.html @@ -0,0 +1,76 @@ + + +pcre_compile specification + + +

    pcre_compile man page

    +

    +Return to the PCRE index page. +

    +

    +This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
    +
    +SYNOPSIS +
    +

    +#include <pcre.h> +

    +

    +pcre *pcre_compile(const char *pattern, int options, +const char **errptr, int *erroffset, +const unsigned char *tableptr); +

    +
    +DESCRIPTION +
    +

    +This function compiles a regular expression into an internal form. Its +arguments are: +

    +  pattern       A zero-terminated string containing the
    +                  regular expression to be compiled
    +  options       Zero or more option bits
    +  errptr        Where to put an error message
    +  erroffset     Offset in pattern where error was found
    +  tableptr      Pointer to character tables, or NULL to
    +                  use the built-in default
    +
    +The option bits are: +
    +  PCRE_ANCHORED         Force pattern anchoring
    +  PCRE_AUTO_CALLOUT     Compile automatic callouts
    +  PCRE_CASELESS         Do caseless matching
    +  PCRE_DOLLAR_ENDONLY   $ not to match newline at end
    +  PCRE_DOTALL           . matches anything including NL
    +  PCRE_EXTENDED         Ignore whitespace and # comments
    +  PCRE_EXTRA            PCRE extra features
    +                          (not much use currently)
    +  PCRE_FIRSTLINE        Force matching to be before newline
    +  PCRE_MULTILINE        ^ and $ match newlines within data
    +  PCRE_NO_AUTO_CAPTURE  Disable numbered capturing paren-
    +                          theses (named ones available)
    +  PCRE_UNGREEDY         Invert greediness of quantifiers
    +  PCRE_UTF8             Run in UTF-8 mode
    +  PCRE_NO_UTF8_CHECK    Do not check the pattern for UTF-8
    +                          validity (only relevant if
    +                          PCRE_UTF8 is set)
    +
    +PCRE must be built with UTF-8 support in order to use PCRE_UTF8 and +PCRE_NO_UTF8_CHECK. +

    +

    +The yield of the function is a pointer to a private data structure that +contains the compiled pattern, or NULL if an error was detected. +

    +

    +There is a complete description of the PCRE native API in the +pcreapi +page and a description of the POSIX API in the +pcreposix +page. +

    +Return to the PCRE index page. +

    diff --git a/mozilla/js/tamarin/pcre/doc/html/pcre_compile2.html b/mozilla/js/tamarin/pcre/doc/html/pcre_compile2.html new file mode 100644 index 00000000000..fc3992966ea --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/html/pcre_compile2.html @@ -0,0 +1,81 @@ + + +pcre_compile2 specification + + +

    pcre_compile2 man page

    +

    +Return to the PCRE index page. +

    +

    +This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
    +
    +SYNOPSIS +
    +

    +#include <pcre.h> +

    +

    +pcre *pcre_compile2(const char *pattern, int options, +int *errorcodeptr, +const char **errptr, int *erroffset, +const unsigned char *tableptr); +

    +
    +DESCRIPTION +
    +

    +This function compiles a regular expression into an internal form. It is the +same as pcre_compile(), except for the addition of the errorcodeptr +argument. The arguments are: +

    +

    +

    +  pattern       A zero-terminated string containing the
    +                  regular expression to be compiled
    +  options       Zero or more option bits
    +  errorcodeptr  Where to put an error code
    +  errptr        Where to put an error message
    +  erroffset     Offset in pattern where error was found
    +  tableptr      Pointer to character tables, or NULL to
    +                  use the built-in default
    +
    +The option bits are: +
    +  PCRE_ANCHORED         Force pattern anchoring
    +  PCRE_AUTO_CALLOUT     Compile automatic callouts
    +  PCRE_CASELESS         Do caseless matching
    +  PCRE_DOLLAR_ENDONLY   $ not to match newline at end
    +  PCRE_DOTALL           . matches anything including NL
    +  PCRE_EXTENDED         Ignore whitespace and # comments
    +  PCRE_EXTRA            PCRE extra features
    +                          (not much use currently)
    +  PCRE_FIRSTLINE        Force matching to be before newline
    +  PCRE_MULTILINE        ^ and $ match newlines within data
    +  PCRE_NO_AUTO_CAPTURE  Disable numbered capturing paren-
    +                          theses (named ones available)
    +  PCRE_UNGREEDY         Invert greediness of quantifiers
    +  PCRE_UTF8             Run in UTF-8 mode
    +  PCRE_NO_UTF8_CHECK    Do not check the pattern for UTF-8
    +                          validity (only relevant if
    +                          PCRE_UTF8 is set)
    +
    +PCRE must be built with UTF-8 support in order to use PCRE_UTF8 and +PCRE_NO_UTF8_CHECK. +

    +

    +The yield of the function is a pointer to a private data structure that +contains the compiled pattern, or NULL if an error was detected. +

    +

    +There is a complete description of the PCRE native API in the +pcreapi +page and a description of the POSIX API in the +pcreposix +page. +

    +Return to the PCRE index page. +

    diff --git a/mozilla/js/tamarin/pcre/doc/html/pcre_config.html b/mozilla/js/tamarin/pcre/doc/html/pcre_config.html new file mode 100644 index 00000000000..8d8cc6073de --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/html/pcre_config.html @@ -0,0 +1,60 @@ + + +pcre_config specification + + +

    pcre_config man page

    +

    +Return to the PCRE index page. +

    +

    +This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
    +
    +SYNOPSIS +
    +

    +#include <pcre.h> +

    +

    +int pcre_config(int what, void *where); +

    +
    +DESCRIPTION +
    +

    +This function makes it possible for a client program to find out which optional +features are available in the version of the PCRE library it is using. Its +arguments are as follows: +

    +  what     A code specifying what information is required
    +  where    Points to where to put the data
    +
    +The available codes are: +
    +  PCRE_CONFIG_LINK_SIZE     Internal link size: 2, 3, or 4
    +  PCRE_CONFIG_MATCH_LIMIT   Internal resource limit
    +  PCRE_CONFIG_NEWLINE       Value of the newline character
    +  PCRE_CONFIG_POSIX_MALLOC_THRESHOLD
    +                            Threshold of return slots, above
    +                              which malloc() is used by
    +                              the POSIX API
    +  PCRE_CONFIG_STACKRECURSE  Recursion implementation (1=stack 0=heap)
    +  PCRE_CONFIG_UTF8          Availability of UTF-8 support (1=yes 0=no)
    +  PCRE_CONFIG_UNICODE_PROPERTIES
    +                            Availability of Unicode property support
    +                              (1=yes 0=no)
    +
    +The function yields 0 on success or PCRE_ERROR_BADOPTION otherwise. +

    +

    +There is a complete description of the PCRE native API in the +pcreapi +page and a description of the POSIX API in the +pcreposix +page. +

    +Return to the PCRE index page. +

    diff --git a/mozilla/js/tamarin/pcre/doc/html/pcre_copy_named_substring.html b/mozilla/js/tamarin/pcre/doc/html/pcre_copy_named_substring.html new file mode 100644 index 00000000000..2185518c8ac --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/html/pcre_copy_named_substring.html @@ -0,0 +1,53 @@ + + +pcre_copy_named_substring specification + + +

    pcre_copy_named_substring man page

    +

    +Return to the PCRE index page. +

    +

    +This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
    +
    +SYNOPSIS +
    +

    +#include <pcre.h> +

    +

    +int pcre_copy_named_substring(const pcre *code, +const char *subject, int *ovector, +int stringcount, const char *stringname, +char *buffer, int buffersize); +

    +
    +DESCRIPTION +
    +

    +This is a convenience function for extracting a captured substring, identified +by name, into a given buffer. The arguments are: +

    +  code          Pattern that was successfully matched
    +  subject       Subject that has been successfully matched
    +  ovector       Offset vector that pcre_exec() used
    +  stringcount   Value returned by pcre_exec()
    +  stringname    Name of the required substring
    +  buffer        Buffer to receive the string
    +  buffersize    Size of buffer
    +
    +The yield is the length of the substring, PCRE_ERROR_NOMEMORY if the buffer was +too small, or PCRE_ERROR_NOSUBSTRING if the string name is invalid. +

    +

    +There is a complete description of the PCRE native API in the +pcreapi +page and a description of the POSIX API in the +pcreposix +page. +

    +Return to the PCRE index page. +

    diff --git a/mozilla/js/tamarin/pcre/doc/html/pcre_copy_substring.html b/mozilla/js/tamarin/pcre/doc/html/pcre_copy_substring.html new file mode 100644 index 00000000000..9aa87c17468 --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/html/pcre_copy_substring.html @@ -0,0 +1,51 @@ + + +pcre_copy_substring specification + + +

    pcre_copy_substring man page

    +

    +Return to the PCRE index page. +

    +

    +This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
    +
    +SYNOPSIS +
    +

    +#include <pcre.h> +

    +

    +int pcre_copy_substring(const char *subject, int *ovector, +int stringcount, int stringnumber, char *buffer, +int buffersize); +

    +
    +DESCRIPTION +
    +

    +This is a convenience function for extracting a captured substring into a given +buffer. The arguments are: +

    +  subject       Subject that has been successfully matched
    +  ovector       Offset vector that pcre_exec() used
    +  stringcount   Value returned by pcre_exec()
    +  stringnumber  Number of the required substring
    +  buffer        Buffer to receive the string
    +  buffersize    Size of buffer
    +
    +The yield is the legnth of the string, PCRE_ERROR_NOMEMORY if the buffer was +too small, or PCRE_ERROR_NOSUBSTRING if the string number is invalid. +

    +

    +There is a complete description of the PCRE native API in the +pcreapi +page and a description of the POSIX API in the +pcreposix +page. +

    +Return to the PCRE index page. +

    diff --git a/mozilla/js/tamarin/pcre/doc/html/pcre_dfa_exec.html b/mozilla/js/tamarin/pcre/doc/html/pcre_dfa_exec.html new file mode 100644 index 00000000000..ceadb8b9027 --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/html/pcre_dfa_exec.html @@ -0,0 +1,88 @@ + + +pcre_dfa_exec specification + + +

    pcre_dfa_exec man page

    +

    +Return to the PCRE index page. +

    +

    +This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
    +
    +SYNOPSIS +
    +

    +#include <pcre.h> +

    +

    +int pcre_dfa_exec(const pcre *code, const pcre_extra *extra, +const char *subject, int length, int startoffset, +int options, int *ovector, int ovecsize, +int *workspace, int wscount); +

    +
    +DESCRIPTION +
    +

    +This function matches a compiled regular expression against a given subject +string, using a DFA matching algorithm (not Perl-compatible). Note that +the main, Perl-compatible, matching function is pcre_exec(). The +arguments for this function are: +

    +  code         Points to the compiled pattern
    +  extra        Points to an associated pcre_extra structure,
    +                 or is NULL
    +  subject      Points to the subject string
    +  length       Length of the subject string, in bytes
    +  startoffset  Offset in bytes in the subject at which to
    +                 start matching
    +  options      Option bits
    +  ovector      Points to a vector of ints for result offsets
    +  ovecsize     Number of elements in the vector
    +  workspace    Points to a vector of ints used as working space
    +  wscount      Number of elements in the vector
    +
    +The options are: +
    +  PCRE_ANCHORED      Match only at the first position
    +  PCRE_NOTBOL        Subject is not the beginning of a line
    +  PCRE_NOTEOL        Subject is not the end of a line
    +  PCRE_NOTEMPTY      An empty string is not a valid match
    +  PCRE_NO_UTF8_CHECK Do not check the subject for UTF-8
    +                       validity (only relevant if PCRE_UTF8
    +                       was set at compile time)
    +  PCRE_PARTIAL       Return PCRE_ERROR_PARTIAL for a partial match
    +  PCRE_DFA_SHORTEST  Return only the shortest match
    +  PCRE_DFA_RESTART   This is a restart after a partial match
    +
    +There are restrictions on what may appear in a pattern when matching using the +DFA algorithm is requested. Details are given in the +pcrematching +documentation. +

    +

    +A pcre_extra structure contains the following fields: +

    +  flags        Bits indicating which fields are set
    +  study_data   Opaque data from pcre_study()
    +  match_limit  Limit on internal recursion
    +  callout_data Opaque data passed back to callouts
    +  tables       Points to character tables or is NULL
    +
    +The flag bits are PCRE_EXTRA_STUDY_DATA, PCRE_EXTRA_MATCH_LIMIT, +PCRE_EXTRA_CALLOUT_DATA, and PCRE_EXTRA_TABLES. For DFA matching, the +match_limit field is not used, and must not be set. +

    +

    +There is a complete description of the PCRE native API in the +pcreapi +page and a description of the POSIX API in the +pcreposix +page. +

    +Return to the PCRE index page. +

    diff --git a/mozilla/js/tamarin/pcre/doc/html/pcre_exec.html b/mozilla/js/tamarin/pcre/doc/html/pcre_exec.html new file mode 100644 index 00000000000..5fae92f0217 --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/html/pcre_exec.html @@ -0,0 +1,79 @@ + + +pcre_exec specification + + +

    pcre_exec man page

    +

    +Return to the PCRE index page. +

    +

    +This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
    +
    +SYNOPSIS +
    +

    +#include <pcre.h> +

    +

    +int pcre_exec(const pcre *code, const pcre_extra *extra, +const char *subject, int length, int startoffset, +int options, int *ovector, int ovecsize); +

    +
    +DESCRIPTION +
    +

    +This function matches a compiled regular expression against a given subject +string, using a matching algorithm that is similar to Perl's. It returns +offsets to captured substrings. Its arguments are: +

    +  code         Points to the compiled pattern
    +  extra        Points to an associated pcre_extra structure,
    +                 or is NULL
    +  subject      Points to the subject string
    +  length       Length of the subject string, in bytes
    +  startoffset  Offset in bytes in the subject at which to
    +                 start matching
    +  options      Option bits
    +  ovector      Points to a vector of ints for result offsets
    +  ovecsize     Number of elements in the vector (a multiple of 3)
    +
    +The options are: +
    +  PCRE_ANCHORED      Match only at the first position
    +  PCRE_NOTBOL        Subject is not the beginning of a line
    +  PCRE_NOTEOL        Subject is not the end of a line
    +  PCRE_NOTEMPTY      An empty string is not a valid match
    +  PCRE_NO_UTF8_CHECK Do not check the subject for UTF-8
    +                       validity (only relevant if PCRE_UTF8
    +                       was set at compile time)
    +  PCRE_PARTIAL       Return PCRE_ERROR_PARTIAL for a partial match
    +
    +There are restrictions on what may appear in a pattern when partial matching is +requested. +

    +

    +A pcre_extra structure contains the following fields: +

    +  flags        Bits indicating which fields are set
    +  study_data   Opaque data from pcre_study()
    +  match_limit  Limit on internal recursion
    +  callout_data Opaque data passed back to callouts
    +  tables       Points to character tables or is NULL
    +
    +The flag bits are PCRE_EXTRA_STUDY_DATA, PCRE_EXTRA_MATCH_LIMIT, +PCRE_EXTRA_CALLOUT_DATA, and PCRE_EXTRA_TABLES. +

    +

    +There is a complete description of the PCRE native API in the +pcreapi +page and a description of the POSIX API in the +pcreposix +page. +

    +Return to the PCRE index page. +

    diff --git a/mozilla/js/tamarin/pcre/doc/html/pcre_free_substring.html b/mozilla/js/tamarin/pcre/doc/html/pcre_free_substring.html new file mode 100644 index 00000000000..fe6261474c0 --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/html/pcre_free_substring.html @@ -0,0 +1,40 @@ + + +pcre_free_substring specification + + +

    pcre_free_substring man page

    +

    +Return to the PCRE index page. +

    +

    +This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
    +
    +SYNOPSIS +
    +

    +#include <pcre.h> +

    +

    +void pcre_free_substring(const char *stringptr); +

    +
    +DESCRIPTION +
    +

    +This is a convenience function for freeing the store obtained by a previous +call to pcre_get_substring() or pcre_get_named_substring(). Its +only argument is a pointer to the string. +

    +

    +There is a complete description of the PCRE native API in the +pcreapi +page and a description of the POSIX API in the +pcreposix +page. +

    +Return to the PCRE index page. +

    diff --git a/mozilla/js/tamarin/pcre/doc/html/pcre_free_substring_list.html b/mozilla/js/tamarin/pcre/doc/html/pcre_free_substring_list.html new file mode 100644 index 00000000000..a92c9603f07 --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/html/pcre_free_substring_list.html @@ -0,0 +1,40 @@ + + +pcre_free_substring_list specification + + +

    pcre_free_substring_list man page

    +

    +Return to the PCRE index page. +

    +

    +This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
    +
    +SYNOPSIS +
    +

    +#include <pcre.h> +

    +

    +void pcre_free_substring_list(const char **stringptr); +

    +
    +DESCRIPTION +
    +

    +This is a convenience function for freeing the store obtained by a previous +call to pcre_get_substring_list(). Its only argument is a pointer to the +list of string pointers. +

    +

    +There is a complete description of the PCRE native API in the +pcreapi +page and a description of the POSIX API in the +pcreposix +page. +

    +Return to the PCRE index page. +

    diff --git a/mozilla/js/tamarin/pcre/doc/html/pcre_fullinfo.html b/mozilla/js/tamarin/pcre/doc/html/pcre_fullinfo.html new file mode 100644 index 00000000000..3488285c2a8 --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/html/pcre_fullinfo.html @@ -0,0 +1,71 @@ + + +pcre_fullinfo specification + + +

    pcre_fullinfo man page

    +

    +Return to the PCRE index page. +

    +

    +This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
    +
    +SYNOPSIS +
    +

    +#include <pcre.h> +

    +

    +int pcre_fullinfo(const pcre *code, const pcre_extra *extra, +int what, void *where); +

    +
    +DESCRIPTION +
    +

    +This function returns information about a compiled pattern. Its arguments are: +

    +  code                      Compiled regular expression
    +  extra                     Result of pcre_study() or NULL
    +  what                      What information is required
    +  where                     Where to put the information
    +
    +The following information is available: +
    +  PCRE_INFO_BACKREFMAX      Number of highest back reference
    +  PCRE_INFO_CAPTURECOUNT    Number of capturing subpatterns
    +  PCRE_INFO_DEFAULT_TABLES  Pointer to default tables
    +  PCRE_INFO_FIRSTBYTE       Fixed first byte for a match, or
    +                              -1 for start of string
    +                                 or after newline, or
    +                              -2 otherwise
    +  PCRE_INFO_FIRSTTABLE      Table of first bytes
    +                              (after studying)
    +  PCRE_INFO_LASTLITERAL     Literal last byte required
    +  PCRE_INFO_NAMECOUNT       Number of named subpatterns
    +  PCRE_INFO_NAMEENTRYSIZE   Size of name table entry
    +  PCRE_INFO_NAMETABLE       Pointer to name table
    +  PCRE_INFO_OPTIONS         Options used for compilation
    +  PCRE_INFO_SIZE            Size of compiled pattern
    +  PCRE_INFO_STUDYSIZE       Size of study data
    +
    +The yield of the function is zero on success or: +
    +  PCRE_ERROR_NULL           the argument code was NULL
    +                            the argument where was NULL
    +  PCRE_ERROR_BADMAGIC       the "magic number" was not found
    +  PCRE_ERROR_BADOPTION      the value of what was invalid
    +
    +

    +

    +There is a complete description of the PCRE native API in the +pcreapi +page and a description of the POSIX API in the +pcreposix +page. +

    +Return to the PCRE index page. +

    diff --git a/mozilla/js/tamarin/pcre/doc/html/pcre_get_named_substring.html b/mozilla/js/tamarin/pcre/doc/html/pcre_get_named_substring.html new file mode 100644 index 00000000000..ff8456bb57f --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/html/pcre_get_named_substring.html @@ -0,0 +1,54 @@ + + +pcre_get_named_substring specification + + +

    pcre_get_named_substring man page

    +

    +Return to the PCRE index page. +

    +

    +This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
    +
    +SYNOPSIS +
    +

    +#include <pcre.h> +

    +

    +int pcre_get_named_substring(const pcre *code, +const char *subject, int *ovector, +int stringcount, const char *stringname, +const char **stringptr); +

    +
    +DESCRIPTION +
    +

    +This is a convenience function for extracting a captured substring by name. The +arguments are: +

    +  code          Compiled pattern
    +  subject       Subject that has been successfully matched
    +  ovector       Offset vector that pcre_exec() used
    +  stringcount   Value returned by pcre_exec()
    +  stringname    Name of the required substring
    +  stringptr     Where to put the string pointer
    +
    +The memory in which the substring is placed is obtained by calling +pcre_malloc(). The yield of the function is the length of the extracted +substring, PCRE_ERROR_NOMEMORY if sufficient memory could not be obtained, or +PCRE_ERROR_NOSUBSTRING if the string name is invalid. +

    +

    +There is a complete description of the PCRE native API in the +pcreapi +page and a description of the POSIX API in the +pcreposix +page. +

    +Return to the PCRE index page. +

    diff --git a/mozilla/js/tamarin/pcre/doc/html/pcre_get_stringnumber.html b/mozilla/js/tamarin/pcre/doc/html/pcre_get_stringnumber.html new file mode 100644 index 00000000000..9c8bea0b4bb --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/html/pcre_get_stringnumber.html @@ -0,0 +1,46 @@ + + +pcre_get_stringnumber specification + + +

    pcre_get_stringnumber man page

    +

    +Return to the PCRE index page. +

    +

    +This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
    +
    +SYNOPSIS +
    +

    +#include <pcre.h> +

    +

    +int pcre_get_stringnumber(const pcre *code, +const char *name); +

    +
    +DESCRIPTION +
    +

    +This convenience function finds the number of a named substring capturing +parenthesis in a compiled pattern. Its arguments are: +

    +  code    Compiled regular expression
    +  name    Name whose number is required
    +
    +The yield of the function is the number of the parenthesis if the name is +found, or PCRE_ERROR_NOSUBSTRING otherwise. +

    +

    +There is a complete description of the PCRE native API in the +pcreapi +page and a description of the POSIX API in the +pcreposix +page. +

    +Return to the PCRE index page. +

    diff --git a/mozilla/js/tamarin/pcre/doc/html/pcre_get_substring.html b/mozilla/js/tamarin/pcre/doc/html/pcre_get_substring.html new file mode 100644 index 00000000000..14a413222aa --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/html/pcre_get_substring.html @@ -0,0 +1,52 @@ + + +pcre_get_substring specification + + +

    pcre_get_substring man page

    +

    +Return to the PCRE index page. +

    +

    +This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
    +
    +SYNOPSIS +
    +

    +#include <pcre.h> +

    +

    +int pcre_get_substring(const char *subject, int *ovector, +int stringcount, int stringnumber, +const char **stringptr); +

    +
    +DESCRIPTION +
    +

    +This is a convenience function for extracting a captured substring. The +arguments are: +

    +  subject       Subject that has been successfully matched
    +  ovector       Offset vector that pcre_exec() used
    +  stringcount   Value returned by pcre_exec()
    +  stringnumber  Number of the required substring
    +  stringptr     Where to put the string pointer
    +
    +The memory in which the substring is placed is obtained by calling +pcre_malloc(). The yield of the function is the length of the substring, +PCRE_ERROR_NOMEMORY if sufficient memory could not be obtained, or +PCRE_ERROR_NOSUBSTRING if the string number is invalid. +

    +

    +There is a complete description of the PCRE native API in the +pcreapi +page and a description of the POSIX API in the +pcreposix +page. +

    +Return to the PCRE index page. +

    diff --git a/mozilla/js/tamarin/pcre/doc/html/pcre_get_substring_list.html b/mozilla/js/tamarin/pcre/doc/html/pcre_get_substring_list.html new file mode 100644 index 00000000000..d278b1793d3 --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/html/pcre_get_substring_list.html @@ -0,0 +1,51 @@ + + +pcre_get_substring_list specification + + +

    pcre_get_substring_list man page

    +

    +Return to the PCRE index page. +

    +

    +This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
    +
    +SYNOPSIS +
    +

    +#include <pcre.h> +

    +

    +int pcre_get_substring_list(const char *subject, +int *ovector, int stringcount, const char ***listptr); +

    +
    +DESCRIPTION +
    +

    +This is a convenience function for extracting a list of all the captured +substrings. The arguments are: +

    +  subject       Subject that has been successfully matched
    +  ovector       Offset vector that pcre_exec used
    +  stringcount   Value returned by pcre_exec
    +  listptr       Where to put a pointer to the list
    +
    +The memory in which the substrings and the list are placed is obtained by +calling pcre_malloc(). A pointer to a list of pointers is put in +the variable whose address is in listptr. The list is terminated by a +NULL pointer. The yield of the function is zero on success or +PCRE_ERROR_NOMEMORY if sufficient memory could not be obtained. +

    +

    +There is a complete description of the PCRE native API in the +pcreapi +page and a description of the POSIX API in the +pcreposix +page. +

    +Return to the PCRE index page. +

    diff --git a/mozilla/js/tamarin/pcre/doc/html/pcre_info.html b/mozilla/js/tamarin/pcre/doc/html/pcre_info.html new file mode 100644 index 00000000000..6693ffee6c1 --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/html/pcre_info.html @@ -0,0 +1,39 @@ + + +pcre_info specification + + +

    pcre_info man page

    +

    +Return to the PCRE index page. +

    +

    +This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
    +
    +SYNOPSIS +
    +

    +#include <pcre.h> +

    +

    +int pcre_info(const pcre *code, int *optptr, int +*firstcharptr); +

    +
    +DESCRIPTION +
    +

    +This function is obsolete. You should be using pcre_fullinfo() instead. +

    +

    +There is a complete description of the PCRE native API in the +pcreapi +page and a description of the POSIX API in the +pcreposix +page. +

    +Return to the PCRE index page. +

    diff --git a/mozilla/js/tamarin/pcre/doc/html/pcre_maketables.html b/mozilla/js/tamarin/pcre/doc/html/pcre_maketables.html new file mode 100644 index 00000000000..cf8d69ecfd2 --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/html/pcre_maketables.html @@ -0,0 +1,42 @@ + + +pcre_maketables specification + + +

    pcre_maketables man page

    +

    +Return to the PCRE index page. +

    +

    +This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
    +
    +SYNOPSIS +
    +

    +#include <pcre.h> +

    +

    +const unsigned char *pcre_maketables(void); +

    +
    +DESCRIPTION +
    +

    +This function builds a set of character tables for character values less than +256. These can be passed to pcre_compile() to override PCRE's internal, +built-in tables (which were made by pcre_maketables() when PCRE was +compiled). You might want to do this if you are using a non-standard locale. +The function yields a pointer to the tables. +

    +

    +There is a complete description of the PCRE native API in the +pcreapi +page and a description of the POSIX API in the +pcreposix +page. +

    +Return to the PCRE index page. +

    diff --git a/mozilla/js/tamarin/pcre/doc/html/pcre_refcount.html b/mozilla/js/tamarin/pcre/doc/html/pcre_refcount.html new file mode 100644 index 00000000000..ba531126bd7 --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/html/pcre_refcount.html @@ -0,0 +1,45 @@ + + +pcre_refcount specification + + +

    pcre_refcount man page

    +

    +Return to the PCRE index page. +

    +

    +This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
    +
    +SYNOPSIS +
    +

    +#include <pcre.h> +

    +

    +int pcre_info(pcre *code, int adjust); +

    +
    +DESCRIPTION +
    +

    +This function is used to maintain a reference count inside a data block that +contains a compiled pattern. Its arguments are: +

    +  code                      Compiled regular expression
    +  adjust                    Adjustment to reference value
    +
    +The yield of the function is the adjusted reference value, which is constrained +to lie between 0 and 65535. +

    +

    +There is a complete description of the PCRE native API in the +pcreapi +page and a description of the POSIX API in the +pcreposix +page. +

    +Return to the PCRE index page. +

    diff --git a/mozilla/js/tamarin/pcre/doc/html/pcre_study.html b/mozilla/js/tamarin/pcre/doc/html/pcre_study.html new file mode 100644 index 00000000000..d290420e54c --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/html/pcre_study.html @@ -0,0 +1,56 @@ + + +pcre_study specification + + +

    pcre_study man page

    +

    +Return to the PCRE index page. +

    +

    +This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
    +
    +SYNOPSIS +
    +

    +#include <pcre.h> +

    +

    +pcre_extra *pcre_study(const pcre *code, int options, +const char **errptr); +

    +
    +DESCRIPTION +
    +

    +This function studies a compiled pattern, to see if additional information can +be extracted that might speed up matching. Its arguments are: +

    +  code       A compiled regular expression
    +  options    Options for pcre_study()
    +  errptr     Where to put an error message
    +
    +If the function succeeds, it returns a value that can be passed to +pcre_exec() via its extra argument. +

    +

    +If the function returns NULL, either it could not find any additional +information, or there was an error. You can tell the difference by looking at +the error value. It is NULL in first case. +

    +

    +There are currently no options defined; the value of the second argument should +always be zero. +

    +

    +There is a complete description of the PCRE native API in the +pcreapi +page and a description of the POSIX API in the +pcreposix +page. +

    +Return to the PCRE index page. +

    diff --git a/mozilla/js/tamarin/pcre/doc/html/pcre_version.html b/mozilla/js/tamarin/pcre/doc/html/pcre_version.html new file mode 100644 index 00000000000..7bc8f8653ed --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/html/pcre_version.html @@ -0,0 +1,39 @@ + + +pcre_version specification + + +

    pcre_version man page

    +

    +Return to the PCRE index page. +

    +

    +This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
    +
    +SYNOPSIS +
    +

    +#include <pcre.h> +

    +

    +char *pcre_version(void); +

    +
    +DESCRIPTION +
    +

    +This function returns a character string that gives the version number of the +PCRE library and the date of its release. +

    +

    +There is a complete description of the PCRE native API in the +pcreapi +page and a description of the POSIX API in the +pcreposix +page. +

    +Return to the PCRE index page. +

    diff --git a/mozilla/js/tamarin/pcre/doc/html/pcreapi.html b/mozilla/js/tamarin/pcre/doc/html/pcreapi.html new file mode 100644 index 00000000000..29492a7d604 --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/html/pcreapi.html @@ -0,0 +1,1618 @@ + + +pcreapi specification + + +

    pcreapi man page

    +

    +Return to the PCRE index page. +

    +

    +This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
    +

    +
    PCRE NATIVE API
    +

    +#include <pcre.h> +

    +

    +pcre *pcre_compile(const char *pattern, int options, +const char **errptr, int *erroffset, +const unsigned char *tableptr); +

    +

    +pcre *pcre_compile2(const char *pattern, int options, +int *errorcodeptr, +const char **errptr, int *erroffset, +const unsigned char *tableptr); +

    +

    +pcre_extra *pcre_study(const pcre *code, int options, +const char **errptr); +

    +

    +int pcre_exec(const pcre *code, const pcre_extra *extra, +const char *subject, int length, int startoffset, +int options, int *ovector, int ovecsize); +

    +

    +int pcre_dfa_exec(const pcre *code, const pcre_extra *extra, +const char *subject, int length, int startoffset, +int options, int *ovector, int ovecsize, +int *workspace, int wscount); +

    +

    +int pcre_copy_named_substring(const pcre *code, +const char *subject, int *ovector, +int stringcount, const char *stringname, +char *buffer, int buffersize); +

    +

    +int pcre_copy_substring(const char *subject, int *ovector, +int stringcount, int stringnumber, char *buffer, +int buffersize); +

    +

    +int pcre_get_named_substring(const pcre *code, +const char *subject, int *ovector, +int stringcount, const char *stringname, +const char **stringptr); +

    +

    +int pcre_get_stringnumber(const pcre *code, +const char *name); +

    +

    +int pcre_get_substring(const char *subject, int *ovector, +int stringcount, int stringnumber, +const char **stringptr); +

    +

    +int pcre_get_substring_list(const char *subject, +int *ovector, int stringcount, const char ***listptr); +

    +

    +void pcre_free_substring(const char *stringptr); +

    +

    +void pcre_free_substring_list(const char **stringptr); +

    +

    +const unsigned char *pcre_maketables(void); +

    +

    +int pcre_fullinfo(const pcre *code, const pcre_extra *extra, +int what, void *where); +

    +

    +int pcre_info(const pcre *code, int *optptr, int +*firstcharptr); +

    +

    +int pcre_refcount(pcre *code, int adjust); +

    +

    +int pcre_config(int what, void *where); +

    +

    +char *pcre_version(void); +

    +

    +void *(*pcre_malloc)(size_t); +

    +

    +void (*pcre_free)(void *); +

    +

    +void *(*pcre_stack_malloc)(size_t); +

    +

    +void (*pcre_stack_free)(void *); +

    +

    +int (*pcre_callout)(pcre_callout_block *); +

    +
    PCRE API OVERVIEW
    +

    +PCRE has its own native API, which is described in this document. There is +also a set of wrapper functions that correspond to the POSIX regular expression +API. These are described in the +pcreposix +documentation. Both of these APIs define a set of C function calls. A C++ +wrapper is distributed with PCRE. It is documented in the +pcrecpp +page. +

    +

    +The native API C function prototypes are defined in the header file +pcre.h, and on Unix systems the library itself is called libpcre. +It can normally be accessed by adding -lpcre to the command for linking +an application that uses PCRE. The header file defines the macros PCRE_MAJOR +and PCRE_MINOR to contain the major and minor release numbers for the library. +Applications can use these to include support for different releases of PCRE. +

    +

    +The functions pcre_compile(), pcre_compile2(), pcre_study(), +and pcre_exec() are used for compiling and matching regular expressions +in a Perl-compatible manner. A sample program that demonstrates the simplest +way of using them is provided in the file called pcredemo.c in the source +distribution. The +pcresample +documentation describes how to run it. +

    +

    +A second matching function, pcre_dfa_exec(), which is not +Perl-compatible, is also provided. This uses a different algorithm for the +matching. This allows it to find all possible matches (at a given point in the +subject), not just one. However, this algorithm does not return captured +substrings. A description of the two matching algorithms and their advantages +and disadvantages is given in the +pcrematching +documentation. +

    +

    +In addition to the main compiling and matching functions, there are convenience +functions for extracting captured substrings from a subject string that is +matched by pcre_exec(). They are: +

    +  pcre_copy_substring()
    +  pcre_copy_named_substring()
    +  pcre_get_substring()
    +  pcre_get_named_substring()
    +  pcre_get_substring_list()
    +  pcre_get_stringnumber()
    +
    +pcre_free_substring() and pcre_free_substring_list() are also +provided, to free the memory used for extracted strings. +

    +

    +The function pcre_maketables() is used to build a set of character tables +in the current locale for passing to pcre_compile(), pcre_exec(), +or pcre_dfa_exec(). This is an optional facility that is provided for +specialist use. Most commonly, no special tables are passed, in which case +internal tables that are generated when PCRE is built are used. +

    +

    +The function pcre_fullinfo() is used to find out information about a +compiled pattern; pcre_info() is an obsolete version that returns only +some of the available information, but is retained for backwards compatibility. +The function pcre_version() returns a pointer to a string containing the +version of PCRE and its date of release. +

    +

    +The function pcre_refcount() maintains a reference count in a data block +containing a compiled pattern. This is provided for the benefit of +object-oriented applications. +

    +

    +The global variables pcre_malloc and pcre_free initially contain +the entry points of the standard malloc() and free() functions, +respectively. PCRE calls the memory management functions via these variables, +so a calling program can replace them if it wishes to intercept the calls. This +should be done before calling any PCRE functions. +

    +

    +The global variables pcre_stack_malloc and pcre_stack_free are also +indirections to memory management functions. These special functions are used +only when PCRE is compiled to use the heap for remembering data, instead of +recursive function calls, when running the pcre_exec() function. This is +a non-standard way of building PCRE, for use in environments that have limited +stacks. Because of the greater use of memory management, it runs more slowly. +Separate functions are provided so that special-purpose external code can be +used for this case. When used, these functions are always called in a +stack-like manner (last obtained, first freed), and always for memory blocks of +the same size. +

    +

    +The global variable pcre_callout initially contains NULL. It can be set +by the caller to a "callout" function, which PCRE will then call at specified +points during a matching operation. Details are given in the +pcrecallout +documentation. +

    +
    MULTITHREADING
    +

    +The PCRE functions can be used in multi-threading applications, with the +proviso that the memory management functions pointed to by pcre_malloc, +pcre_free, pcre_stack_malloc, and pcre_stack_free, and the +callout function pointed to by pcre_callout, are shared by all threads. +

    +

    +The compiled form of a regular expression is not altered during matching, so +the same compiled pattern can safely be used by several threads at once. +

    +
    SAVING PRECOMPILED PATTERNS FOR LATER USE
    +

    +The compiled form of a regular expression can be saved and re-used at a later +time, possibly by a different program, and even on a host other than the one on +which it was compiled. Details are given in the +pcreprecompile +documentation. +

    +
    CHECKING BUILD-TIME OPTIONS
    +

    +int pcre_config(int what, void *where); +

    +

    +The function pcre_config() makes it possible for a PCRE client to +discover which optional features have been compiled into the PCRE library. The +pcrebuild +documentation has more details about these optional features. +

    +

    +The first argument for pcre_config() is an integer, specifying which +information is required; the second argument is a pointer to a variable into +which the information is placed. The following information is available: +

    +  PCRE_CONFIG_UTF8
    +
    +The output is an integer that is set to one if UTF-8 support is available; +otherwise it is set to zero. +
    +  PCRE_CONFIG_UNICODE_PROPERTIES
    +
    +The output is an integer that is set to one if support for Unicode character +properties is available; otherwise it is set to zero. +
    +  PCRE_CONFIG_NEWLINE
    +
    +The output is an integer that is set to the value of the code that is used for +the newline character. It is either linefeed (10) or carriage return (13), and +should normally be the standard character for your operating system. +
    +  PCRE_CONFIG_LINK_SIZE
    +
    +The output is an integer that contains the number of bytes used for internal +linkage in compiled regular expressions. The value is 2, 3, or 4. Larger values +allow larger regular expressions to be compiled, at the expense of slower +matching. The default value of 2 is sufficient for all but the most massive +patterns, since it allows the compiled pattern to be up to 64K in size. +
    +  PCRE_CONFIG_POSIX_MALLOC_THRESHOLD
    +
    +The output is an integer that contains the threshold above which the POSIX +interface uses malloc() for output vectors. Further details are given in +the +pcreposix +documentation. +
    +  PCRE_CONFIG_MATCH_LIMIT
    +
    +The output is an integer that gives the default limit for the number of +internal matching function calls in a pcre_exec() execution. Further +details are given with pcre_exec() below. +
    +  PCRE_CONFIG_STACKRECURSE
    +
    +The output is an integer that is set to one if internal recursion when running +pcre_exec() is implemented by recursive function calls that use the stack +to remember their state. This is the usual way that PCRE is compiled. The +output is zero if PCRE was compiled to use blocks of data on the heap instead +of recursive function calls. In this case, pcre_stack_malloc and +pcre_stack_free are called to manage memory blocks on the heap, thus +avoiding the use of the stack. +

    +
    COMPILING A PATTERN
    +

    +pcre *pcre_compile(const char *pattern, int options, +const char **errptr, int *erroffset, +const unsigned char *tableptr); +pcre *pcre_compile2(const char *pattern, int options, +int *errorcodeptr, +const char **errptr, int *erroffset, +const unsigned char *tableptr); +

    +

    +Either of the functions pcre_compile() or pcre_compile2() can be +called to compile a pattern into an internal form. The only difference between +the two interfaces is that pcre_compile2() has an additional argument, +errorcodeptr, via which a numerical error code can be returned. +

    +

    +The pattern is a C string terminated by a binary zero, and is passed in the +pattern argument. A pointer to a single block of memory that is obtained +via pcre_malloc is returned. This contains the compiled code and related +data. The pcre type is defined for the returned block; this is a typedef +for a structure whose contents are not externally defined. It is up to the +caller to free the memory when it is no longer required. +

    +

    +Although the compiled code of a PCRE regex is relocatable, that is, it does not +depend on memory location, the complete pcre data block is not +fully relocatable, because it may contain a copy of the tableptr +argument, which is an address (see below). +

    +

    +The options argument contains independent bits that affect the +compilation. It should be zero if no options are required. The available +options are described below. Some of them, in particular, those that are +compatible with Perl, can also be set and unset from within the pattern (see +the detailed description in the +pcrepattern +documentation). For these options, the contents of the options argument +specifies their initial settings at the start of compilation and execution. The +PCRE_ANCHORED option can be set at the time of matching as well as at compile +time. +

    +

    +If errptr is NULL, pcre_compile() returns NULL immediately. +Otherwise, if compilation of a pattern fails, pcre_compile() returns +NULL, and sets the variable pointed to by errptr to point to a textual +error message. The offset from the start of the pattern to the character where +the error was discovered is placed in the variable pointed to by +erroffset, which must not be NULL. If it is, an immediate error is given. +

    +

    +If pcre_compile2() is used instead of pcre_compile(), and the +errorcodeptr argument is not NULL, a non-zero error code number is +returned via this argument in the event of an error. This is in addition to the +textual error message. Error codes and messages are listed below. +

    +

    +If the final argument, tableptr, is NULL, PCRE uses a default set of +character tables that are built when PCRE is compiled, using the default C +locale. Otherwise, tableptr must be an address that is the result of a +call to pcre_maketables(). This value is stored with the compiled +pattern, and used again by pcre_exec(), unless another table pointer is +passed to it. For more discussion, see the section on locale support below. +

    +

    +This code fragment shows a typical straightforward call to pcre_compile(): +

    +  pcre *re;
    +  const char *error;
    +  int erroffset;
    +  re = pcre_compile(
    +    "^A.*Z",          /* the pattern */
    +    0,                /* default options */
    +    &error,           /* for error message */
    +    &erroffset,       /* for error offset */
    +    NULL);            /* use default character tables */
    +
    +The following names for option bits are defined in the pcre.h header +file: +
    +  PCRE_ANCHORED
    +
    +If this bit is set, the pattern is forced to be "anchored", that is, it is +constrained to match only at the first matching point in the string that is +being searched (the "subject string"). This effect can also be achieved by +appropriate constructs in the pattern itself, which is the only way to do it in +Perl. +
    +  PCRE_AUTO_CALLOUT
    +
    +If this bit is set, pcre_compile() automatically inserts callout items, +all with number 255, before each pattern item. For discussion of the callout +facility, see the +pcrecallout +documentation. +
    +  PCRE_CASELESS
    +
    +If this bit is set, letters in the pattern match both upper and lower case +letters. It is equivalent to Perl's /i option, and it can be changed within a +pattern by a (?i) option setting. In UTF-8 mode, PCRE always understands the +concept of case for characters whose values are less than 128, so caseless +matching is always possible. For characters with higher values, the concept of +case is supported if PCRE is compiled with Unicode property support, but not +otherwise. If you want to use caseless matching for characters 128 and above, +you must ensure that PCRE is compiled with Unicode property support as well as +with UTF-8 support. +
    +  PCRE_DOLLAR_ENDONLY
    +
    +If this bit is set, a dollar metacharacter in the pattern matches only at the +end of the subject string. Without this option, a dollar also matches +immediately before the final character if it is a newline (but not before any +other newlines). The PCRE_DOLLAR_ENDONLY option is ignored if PCRE_MULTILINE is +set. There is no equivalent to this option in Perl, and no way to set it within +a pattern. +
    +  PCRE_DOTALL
    +
    +If this bit is set, a dot metacharater in the pattern matches all characters, +including newlines. Without it, newlines are excluded. This option is +equivalent to Perl's /s option, and it can be changed within a pattern by a +(?s) option setting. A negative class such as [^a] always matches a newline +character, independent of the setting of this option. +
    +  PCRE_EXTENDED
    +
    +If this bit is set, whitespace data characters in the pattern are totally +ignored except when escaped or inside a character class. Whitespace does not +include the VT character (code 11). In addition, characters between an +unescaped # outside a character class and the next newline character, +inclusive, are also ignored. This is equivalent to Perl's /x option, and it can +be changed within a pattern by a (?x) option setting. +

    +

    +This option makes it possible to include comments inside complicated patterns. +Note, however, that this applies only to data characters. Whitespace characters +may never appear within special character sequences in a pattern, for example +within the sequence (?( which introduces a conditional subpattern. +

    +  PCRE_EXTRA
    +
    +This option was invented in order to turn on additional functionality of PCRE +that is incompatible with Perl, but it is currently of very little use. When +set, any backslash in a pattern that is followed by a letter that has no +special meaning causes an error, thus reserving these combinations for future +expansion. By default, as in Perl, a backslash followed by a letter with no +special meaning is treated as a literal. There are at present no other features +controlled by this option. It can also be set by a (?X) option setting within a +pattern. +
    +  PCRE_FIRSTLINE
    +
    +If this option is set, an unanchored pattern is required to match before or at +the first newline character in the subject string, though the matched text may +continue over the newline. +
    +  PCRE_MULTILINE
    +
    +By default, PCRE treats the subject string as consisting of a single line of +characters (even if it actually contains newlines). The "start of line" +metacharacter (^) matches only at the start of the string, while the "end of +line" metacharacter ($) matches only at the end of the string, or before a +terminating newline (unless PCRE_DOLLAR_ENDONLY is set). This is the same as +Perl. +

    +

    +When PCRE_MULTILINE it is set, the "start of line" and "end of line" constructs +match immediately following or immediately before any newline in the subject +string, respectively, as well as at the very start and end. This is equivalent +to Perl's /m option, and it can be changed within a pattern by a (?m) option +setting. If there are no "\n" characters in a subject string, or no +occurrences of ^ or $ in a pattern, setting PCRE_MULTILINE has no effect. +

    +  PCRE_NO_AUTO_CAPTURE
    +
    +If this option is set, it disables the use of numbered capturing parentheses in +the pattern. Any opening parenthesis that is not followed by ? behaves as if it +were followed by ?: but named parentheses can still be used for capturing (and +they acquire numbers in the usual way). There is no equivalent of this option +in Perl. +
    +  PCRE_UNGREEDY
    +
    +This option inverts the "greediness" of the quantifiers so that they are not +greedy by default, but become greedy if followed by "?". It is not compatible +with Perl. It can also be set by a (?U) option setting within the pattern. +
    +  PCRE_UTF8
    +
    +This option causes PCRE to regard both the pattern and the subject as strings +of UTF-8 characters instead of single-byte character strings. However, it is +available only when PCRE is built to include UTF-8 support. If not, the use +of this option provokes an error. Details of how this option changes the +behaviour of PCRE are given in the +section on UTF-8 support +in the main +pcre +page. +
    +  PCRE_NO_UTF8_CHECK
    +
    +When PCRE_UTF8 is set, the validity of the pattern as a UTF-8 string is +automatically checked. If an invalid UTF-8 sequence of bytes is found, +pcre_compile() returns an error. If you already know that your pattern is +valid, and you want to skip this check for performance reasons, you can set the +PCRE_NO_UTF8_CHECK option. When it is set, the effect of passing an invalid +UTF-8 string as a pattern is undefined. It may cause your program to crash. +Note that this option can also be passed to pcre_exec() and +pcre_dfa_exec(), to suppress the UTF-8 validity checking of subject +strings. +

    +
    COMPILATION ERROR CODES
    +

    +The following table lists the error codes than may be returned by +pcre_compile2(), along with the error messages that may be returned by +both compiling functions. +

    +   0  no error
    +   1  \ at end of pattern
    +   2  \c at end of pattern
    +   3  unrecognized character follows \
    +   4  numbers out of order in {} quantifier
    +   5  number too big in {} quantifier
    +   6  missing terminating ] for character class
    +   7  invalid escape sequence in character class
    +   8  range out of order in character class
    +   9  nothing to repeat
    +  10  operand of unlimited repeat could match the empty string
    +  11  internal error: unexpected repeat
    +  12  unrecognized character after (?
    +  13  POSIX named classes are supported only within a class
    +  14  missing )
    +  15  reference to non-existent subpattern
    +  16  erroffset passed as NULL
    +  17  unknown option bit(s) set
    +  18  missing ) after comment
    +  19  parentheses nested too deeply
    +  20  regular expression too large
    +  21  failed to get memory
    +  22  unmatched parentheses
    +  23  internal error: code overflow
    +  24  unrecognized character after (?<
    +  25  lookbehind assertion is not fixed length
    +  26  malformed number after (?(
    +  27  conditional group contains more than two branches
    +  28  assertion expected after (?(
    +  29  (?R or (?digits must be followed by )
    +  30  unknown POSIX class name
    +  31  POSIX collating elements are not supported
    +  32  this version of PCRE is not compiled with PCRE_UTF8 support
    +  33  spare error
    +  34  character value in \x{...} sequence is too large
    +  35  invalid condition (?(0)
    +  36  \C not allowed in lookbehind assertion
    +  37  PCRE does not support \L, \l, \N, \U, or \u
    +  38  number after (?C is > 255
    +  39  closing ) for (?C expected
    +  40  recursive call could loop indefinitely
    +  41  unrecognized character after (?P
    +  42  syntax error after (?P
    +  43  two named groups have the same name
    +  44  invalid UTF-8 string
    +  45  support for \P, \p, and \X has not been compiled
    +  46  malformed \P or \p sequence
    +  47  unknown property name after \P or \p
    +
    +

    +
    STUDYING A PATTERN
    +

    +pcre_extra *pcre_study(const pcre *code, int options +const char **errptr); +

    +

    +If a compiled pattern is going to be used several times, it is worth spending +more time analyzing it in order to speed up the time taken for matching. The +function pcre_study() takes a pointer to a compiled pattern as its first +argument. If studying the pattern produces additional information that will +help speed up matching, pcre_study() returns a pointer to a +pcre_extra block, in which the study_data field points to the +results of the study. +

    +

    +The returned value from pcre_study() can be passed directly to +pcre_exec(). However, a pcre_extra block also contains other +fields that can be set by the caller before the block is passed; these are +described +below +in the section on matching a pattern. +

    +

    +If studying the pattern does not produce any additional information +pcre_study() returns NULL. In that circumstance, if the calling program +wants to pass any of the other fields to pcre_exec(), it must set up its +own pcre_extra block. +

    +

    +The second argument of pcre_study() contains option bits. At present, no +options are defined, and this argument should always be zero. +

    +

    +The third argument for pcre_study() is a pointer for an error message. If +studying succeeds (even if no data is returned), the variable it points to is +set to NULL. Otherwise it points to a textual error message. You should +therefore test the error pointer for NULL after calling pcre_study(), to +be sure that it has run successfully. +

    +

    +This is a typical call to pcre_study(): +

    +  pcre_extra *pe;
    +  pe = pcre_study(
    +    re,             /* result of pcre_compile() */
    +    0,              /* no options exist */
    +    &error);        /* set to NULL or points to a message */
    +
    +At present, studying a pattern is useful only for non-anchored patterns that do +not have a single fixed starting character. A bitmap of possible starting +bytes is created. +

    +
    LOCALE SUPPORT
    +

    +PCRE handles caseless matching, and determines whether characters are letters +digits, or whatever, by reference to a set of tables, indexed by character +value. When running in UTF-8 mode, this applies only to characters with codes +less than 128. Higher-valued codes never match escapes such as \w or \d, but +can be tested with \p if PCRE is built with Unicode character property +support. +

    +

    +An internal set of tables is created in the default C locale when PCRE is +built. This is used when the final argument of pcre_compile() is NULL, +and is sufficient for many applications. An alternative set of tables can, +however, be supplied. These may be created in a different locale from the +default. As more and more applications change to using Unicode, the need for +this locale support is expected to die away. +

    +

    +External tables are built by calling the pcre_maketables() function, +which has no arguments, in the relevant locale. The result can then be passed +to pcre_compile() or pcre_exec() as often as necessary. For +example, to build and use tables that are appropriate for the French locale +(where accented characters with values greater than 128 are treated as letters), +the following code could be used: +

    +  setlocale(LC_CTYPE, "fr_FR");
    +  tables = pcre_maketables();
    +  re = pcre_compile(..., tables);
    +
    +When pcre_maketables() runs, the tables are built in memory that is +obtained via pcre_malloc. It is the caller's responsibility to ensure +that the memory containing the tables remains available for as long as it is +needed. +

    +

    +The pointer that is passed to pcre_compile() is saved with the compiled +pattern, and the same tables are used via this pointer by pcre_study() +and normally also by pcre_exec(). Thus, by default, for any single +pattern, compilation, studying and matching all happen in the same locale, but +different patterns can be compiled in different locales. +

    +

    +It is possible to pass a table pointer or NULL (indicating the use of the +internal tables) to pcre_exec(). Although not intended for this purpose, +this facility could be used to match a pattern in a different locale from the +one in which it was compiled. Passing table pointers at run time is discussed +below in the section on matching a pattern. +

    +
    INFORMATION ABOUT A PATTERN
    +

    +int pcre_fullinfo(const pcre *code, const pcre_extra *extra, +int what, void *where); +

    +

    +The pcre_fullinfo() function returns information about a compiled +pattern. It replaces the obsolete pcre_info() function, which is +nevertheless retained for backwards compability (and is documented below). +

    +

    +The first argument for pcre_fullinfo() is a pointer to the compiled +pattern. The second argument is the result of pcre_study(), or NULL if +the pattern was not studied. The third argument specifies which piece of +information is required, and the fourth argument is a pointer to a variable +to receive the data. The yield of the function is zero for success, or one of +the following negative numbers: +

    +  PCRE_ERROR_NULL       the argument code was NULL
    +                        the argument where was NULL
    +  PCRE_ERROR_BADMAGIC   the "magic number" was not found
    +  PCRE_ERROR_BADOPTION  the value of what was invalid
    +
    +The "magic number" is placed at the start of each compiled pattern as an simple +check against passing an arbitrary memory pointer. Here is a typical call of +pcre_fullinfo(), to obtain the length of the compiled pattern: +
    +  int rc;
    +  unsigned long int length;
    +  rc = pcre_fullinfo(
    +    re,               /* result of pcre_compile() */
    +    pe,               /* result of pcre_study(), or NULL */
    +    PCRE_INFO_SIZE,   /* what is required */
    +    &length);         /* where to put the data */
    +
    +The possible values for the third argument are defined in pcre.h, and are +as follows: +
    +  PCRE_INFO_BACKREFMAX
    +
    +Return the number of the highest back reference in the pattern. The fourth +argument should point to an int variable. Zero is returned if there are +no back references. +
    +  PCRE_INFO_CAPTURECOUNT
    +
    +Return the number of capturing subpatterns in the pattern. The fourth argument +should point to an int variable. +
    +  PCRE_INFO_DEFAULT_TABLES
    +
    +Return a pointer to the internal default character tables within PCRE. The +fourth argument should point to an unsigned char * variable. This +information call is provided for internal use by the pcre_study() +function. External callers can cause PCRE to use its internal tables by passing +a NULL table pointer. +
    +  PCRE_INFO_FIRSTBYTE
    +
    +Return information about the first byte of any matched string, for a +non-anchored pattern. (This option used to be called PCRE_INFO_FIRSTCHAR; the +old name is still recognized for backwards compatibility.) +

    +

    +If there is a fixed first byte, for example, from a pattern such as +(cat|cow|coyote), it is returned in the integer pointed to by where. +Otherwise, if either +
    +
    +(a) the pattern was compiled with the PCRE_MULTILINE option, and every branch +starts with "^", or +
    +
    +(b) every branch of the pattern starts with ".*" and PCRE_DOTALL is not set +(if it were set, the pattern would be anchored), +
    +
    +-1 is returned, indicating that the pattern matches only at the start of a +subject string or after any newline within the string. Otherwise -2 is +returned. For anchored patterns, -2 is returned. +

    +  PCRE_INFO_FIRSTTABLE
    +
    +If the pattern was studied, and this resulted in the construction of a 256-bit +table indicating a fixed set of bytes for the first byte in any matching +string, a pointer to the table is returned. Otherwise NULL is returned. The +fourth argument should point to an unsigned char * variable. +
    +  PCRE_INFO_LASTLITERAL
    +
    +Return the value of the rightmost literal byte that must exist in any matched +string, other than at its start, if such a byte has been recorded. The fourth +argument should point to an int variable. If there is no such byte, -1 is +returned. For anchored patterns, a last literal byte is recorded only if it +follows something of variable length. For example, for the pattern +/^a\d+z\d+/ the returned value is "z", but for /^a\dz\d/ the returned value +is -1. +
    +  PCRE_INFO_NAMECOUNT
    +  PCRE_INFO_NAMEENTRYSIZE
    +  PCRE_INFO_NAMETABLE
    +
    +PCRE supports the use of named as well as numbered capturing parentheses. The +names are just an additional way of identifying the parentheses, which still +acquire numbers. A convenience function called pcre_get_named_substring() +is provided for extracting an individual captured substring by name. It is also +possible to extract the data directly, by first converting the name to a number +in order to access the correct pointers in the output vector (described with +pcre_exec() below). To do the conversion, you need to use the +name-to-number map, which is described by these three values. +

    +

    +The map consists of a number of fixed-size entries. PCRE_INFO_NAMECOUNT gives +the number of entries, and PCRE_INFO_NAMEENTRYSIZE gives the size of each +entry; both of these return an int value. The entry size depends on the +length of the longest name. PCRE_INFO_NAMETABLE returns a pointer to the first +entry of the table (a pointer to char). The first two bytes of each entry +are the number of the capturing parenthesis, most significant byte first. The +rest of the entry is the corresponding name, zero terminated. The names are in +alphabetical order. For example, consider the following pattern (assume +PCRE_EXTENDED is set, so white space - including newlines - is ignored): +

    +  (?P<date> (?P<year>(\d\d)?\d\d) - (?P<month>\d\d) - (?P<day>\d\d) )
    +
    +There are four named subpatterns, so the table has four entries, and each entry +in the table is eight bytes long. The table is as follows, with non-printing +bytes shows in hexadecimal, and undefined bytes shown as ??: +
    +  00 01 d  a  t  e  00 ??
    +  00 05 d  a  y  00 ?? ??
    +  00 04 m  o  n  t  h  00
    +  00 02 y  e  a  r  00 ??
    +
    +When writing code to extract data from named subpatterns using the +name-to-number map, remember that the length of each entry is likely to be +different for each compiled pattern. +
    +  PCRE_INFO_OPTIONS
    +
    +Return a copy of the options with which the pattern was compiled. The fourth +argument should point to an unsigned long int variable. These option bits +are those specified in the call to pcre_compile(), modified by any +top-level option settings within the pattern itself. +

    +

    +A pattern is automatically anchored by PCRE if all of its top-level +alternatives begin with one of the following: +

    +  ^     unless PCRE_MULTILINE is set
    +  \A    always
    +  \G    always
    +  .*    if PCRE_DOTALL is set and there are no back references to the subpattern in which .* appears
    +
    +For such patterns, the PCRE_ANCHORED bit is set in the options returned by +pcre_fullinfo(). +
    +  PCRE_INFO_SIZE
    +
    +Return the size of the compiled pattern, that is, the value that was passed as +the argument to pcre_malloc() when PCRE was getting memory in which to +place the compiled data. The fourth argument should point to a size_t +variable. +
    +  PCRE_INFO_STUDYSIZE
    +
    +Return the size of the data block pointed to by the study_data field in +a pcre_extra block. That is, it is the value that was passed to +pcre_malloc() when PCRE was getting memory into which to place the data +created by pcre_study(). The fourth argument should point to a +size_t variable. +

    +
    OBSOLETE INFO FUNCTION
    +

    +int pcre_info(const pcre *code, int *optptr, int +*firstcharptr); +

    +

    +The pcre_info() function is now obsolete because its interface is too +restrictive to return all the available data about a compiled pattern. New +programs should use pcre_fullinfo() instead. The yield of +pcre_info() is the number of capturing subpatterns, or one of the +following negative numbers: +

    +  PCRE_ERROR_NULL       the argument code was NULL
    +  PCRE_ERROR_BADMAGIC   the "magic number" was not found
    +
    +If the optptr argument is not NULL, a copy of the options with which the +pattern was compiled is placed in the integer it points to (see +PCRE_INFO_OPTIONS above). +

    +

    +If the pattern is not anchored and the firstcharptr argument is not NULL, +it is used to pass back information about the first character of any matched +string (see PCRE_INFO_FIRSTBYTE above). +

    +
    REFERENCE COUNTS
    +

    +int pcre_refcount(pcre *code, int adjust); +

    +

    +The pcre_refcount() function is used to maintain a reference count in the +data block that contains a compiled pattern. It is provided for the benefit of +applications that operate in an object-oriented manner, where different parts +of the application may be using the same compiled pattern, but you want to free +the block when they are all done. +

    +

    +When a pattern is compiled, the reference count field is initialized to zero. +It is changed only by calling this function, whose action is to add the +adjust value (which may be positive or negative) to it. The yield of the +function is the new value. However, the value of the count is constrained to +lie between 0 and 65535, inclusive. If the new value is outside these limits, +it is forced to the appropriate limit value. +

    +

    +Except when it is zero, the reference count is not correctly preserved if a +pattern is compiled on one host and then transferred to a host whose byte-order +is different. (This seems a highly unlikely scenario.) +

    +
    MATCHING A PATTERN: THE TRADITIONAL FUNCTION
    +

    +int pcre_exec(const pcre *code, const pcre_extra *extra, +const char *subject, int length, int startoffset, +int options, int *ovector, int ovecsize); +

    +

    +The function pcre_exec() is called to match a subject string against a +compiled pattern, which is passed in the code argument. If the +pattern has been studied, the result of the study should be passed in the +extra argument. This function is the main matching facility of the +library, and it operates in a Perl-like manner. For specialist use there is +also an alternative matching function, which is described +below +in the section about the pcre_dfa_exec() function. +

    +

    +In most applications, the pattern will have been compiled (and optionally +studied) in the same process that calls pcre_exec(). However, it is +possible to save compiled patterns and study data, and then use them later +in different processes, possibly even on different hosts. For a discussion +about this, see the +pcreprecompile +documentation. +

    +

    +Here is an example of a simple call to pcre_exec(): +

    +  int rc;
    +  int ovector[30];
    +  rc = pcre_exec(
    +    re,             /* result of pcre_compile() */
    +    NULL,           /* we didn't study the pattern */
    +    "some string",  /* the subject string */
    +    11,             /* the length of the subject string */
    +    0,              /* start at offset 0 in the subject */
    +    0,              /* default options */
    +    ovector,        /* vector of integers for substring information */
    +    30);            /* number of elements (NOT size in bytes) */
    +
    +

    +
    +Extra data for pcre_exec() +
    +

    +If the extra argument is not NULL, it must point to a pcre_extra +data block. The pcre_study() function returns such a block (when it +doesn't return NULL), but you can also create one for yourself, and pass +additional information in it. The fields in a pcre_extra block are as +follows: +

    +  unsigned long int flags;
    +  void *study_data;
    +  unsigned long int match_limit;
    +  void *callout_data;
    +  const unsigned char *tables;
    +
    +The flags field is a bitmap that specifies which of the other fields +are set. The flag bits are: +
    +  PCRE_EXTRA_STUDY_DATA
    +  PCRE_EXTRA_MATCH_LIMIT
    +  PCRE_EXTRA_CALLOUT_DATA
    +  PCRE_EXTRA_TABLES
    +
    +Other flag bits should be set to zero. The study_data field is set in the +pcre_extra block that is returned by pcre_study(), together with +the appropriate flag bit. You should not set this yourself, but you may add to +the block by setting the other fields and their corresponding flag bits. +

    +

    +The match_limit field provides a means of preventing PCRE from using up a +vast amount of resources when running patterns that are not going to match, +but which have a very large number of possibilities in their search trees. The +classic example is the use of nested unlimited repeats. +

    +

    +Internally, PCRE uses a function called match() which it calls repeatedly +(sometimes recursively). The limit is imposed on the number of times this +function is called during a match, which has the effect of limiting the amount +of recursion and backtracking that can take place. For patterns that are not +anchored, the count starts from zero for each position in the subject string. +

    +

    +The default limit for the library can be set when PCRE is built; the default +default is 10 million, which handles all but the most extreme cases. You can +reduce the default by suppling pcre_exec() with a pcre_extra block +in which match_limit is set to a smaller value, and +PCRE_EXTRA_MATCH_LIMIT is set in the flags field. If the limit is +exceeded, pcre_exec() returns PCRE_ERROR_MATCHLIMIT. +

    +

    +The pcre_callout field is used in conjunction with the "callout" feature, +which is described in the +pcrecallout +documentation. +

    +

    +The tables field is used to pass a character tables pointer to +pcre_exec(); this overrides the value that is stored with the compiled +pattern. A non-NULL value is stored with the compiled pattern only if custom +tables were supplied to pcre_compile() via its tableptr argument. +If NULL is passed to pcre_exec() using this mechanism, it forces PCRE's +internal tables to be used. This facility is helpful when re-using patterns +that have been saved after compiling with an external set of tables, because +the external tables might be at a different address when pcre_exec() is +called. See the +pcreprecompile +documentation for a discussion of saving compiled patterns for later use. +

    +
    +Option bits for pcre_exec() +
    +

    +The unused bits of the options argument for pcre_exec() must be +zero. The only bits that may be set are PCRE_ANCHORED, PCRE_NOTBOL, +PCRE_NOTEOL, PCRE_NOTEMPTY, PCRE_NO_UTF8_CHECK and PCRE_PARTIAL. +

    +  PCRE_ANCHORED
    +
    +The PCRE_ANCHORED option limits pcre_exec() to matching at the first +matching position. If a pattern was compiled with PCRE_ANCHORED, or turned out +to be anchored by virtue of its contents, it cannot be made unachored at +matching time. +
    +  PCRE_NOTBOL
    +
    +This option specifies that first character of the subject string is not the +beginning of a line, so the circumflex metacharacter should not match before +it. Setting this without PCRE_MULTILINE (at compile time) causes circumflex +never to match. This option affects only the behaviour of the circumflex +metacharacter. It does not affect \A. +
    +  PCRE_NOTEOL
    +
    +This option specifies that the end of the subject string is not the end of a +line, so the dollar metacharacter should not match it nor (except in multiline +mode) a newline immediately before it. Setting this without PCRE_MULTILINE (at +compile time) causes dollar never to match. This option affects only the +behaviour of the dollar metacharacter. It does not affect \Z or \z. +
    +  PCRE_NOTEMPTY
    +
    +An empty string is not considered to be a valid match if this option is set. If +there are alternatives in the pattern, they are tried. If all the alternatives +match the empty string, the entire match fails. For example, if the pattern +
    +  a?b?
    +
    +is applied to a string not beginning with "a" or "b", it matches the empty +string at the start of the subject. With PCRE_NOTEMPTY set, this match is not +valid, so PCRE searches further into the string for occurrences of "a" or "b". +

    +

    +Perl has no direct equivalent of PCRE_NOTEMPTY, but it does make a special case +of a pattern match of the empty string within its split() function, and +when using the /g modifier. It is possible to emulate Perl's behaviour after +matching a null string by first trying the match again at the same offset with +PCRE_NOTEMPTY and PCRE_ANCHORED, and then if that fails by advancing the +starting offset (see below) and trying an ordinary match again. There is some +code that demonstrates how to do this in the pcredemo.c sample program. +

    +  PCRE_NO_UTF8_CHECK
    +
    +When PCRE_UTF8 is set at compile time, the validity of the subject as a UTF-8 +string is automatically checked when pcre_exec() is subsequently called. +The value of startoffset is also checked to ensure that it points to the +start of a UTF-8 character. If an invalid UTF-8 sequence of bytes is found, +pcre_exec() returns the error PCRE_ERROR_BADUTF8. If startoffset +contains an invalid value, PCRE_ERROR_BADUTF8_OFFSET is returned. +

    +

    +If you already know that your subject is valid, and you want to skip these +checks for performance reasons, you can set the PCRE_NO_UTF8_CHECK option when +calling pcre_exec(). You might want to do this for the second and +subsequent calls to pcre_exec() if you are making repeated calls to find +all the matches in a single subject string. However, you should be sure that +the value of startoffset points to the start of a UTF-8 character. When +PCRE_NO_UTF8_CHECK is set, the effect of passing an invalid UTF-8 string as a +subject, or a value of startoffset that does not point to the start of a +UTF-8 character, is undefined. Your program may crash. +

    +  PCRE_PARTIAL
    +
    +This option turns on the partial matching feature. If the subject string fails +to match the pattern, but at some point during the matching process the end of +the subject was reached (that is, the subject partially matches the pattern and +the failure to match occurred only because there were not enough subject +characters), pcre_exec() returns PCRE_ERROR_PARTIAL instead of +PCRE_ERROR_NOMATCH. When PCRE_PARTIAL is used, there are restrictions on what +may appear in the pattern. These are discussed in the +pcrepartial +documentation. +

    +
    +The string to be matched by pcre_exec() +
    +

    +The subject string is passed to pcre_exec() as a pointer in +subject, a length in length, and a starting byte offset in +startoffset. In UTF-8 mode, the byte offset must point to the start of a +UTF-8 character. Unlike the pattern string, the subject may contain binary zero +bytes. When the starting offset is zero, the search for a match starts at the +beginning of the subject, and this is by far the most common case. +

    +

    +A non-zero starting offset is useful when searching for another match in the +same subject by calling pcre_exec() again after a previous success. +Setting startoffset differs from just passing over a shortened string and +setting PCRE_NOTBOL in the case of a pattern that begins with any kind of +lookbehind. For example, consider the pattern +

    +  \Biss\B
    +
    +which finds occurrences of "iss" in the middle of words. (\B matches only if +the current position in the subject is not a word boundary.) When applied to +the string "Mississipi" the first call to pcre_exec() finds the first +occurrence. If pcre_exec() is called again with just the remainder of the +subject, namely "issipi", it does not match, because \B is always false at the +start of the subject, which is deemed to be a word boundary. However, if +pcre_exec() is passed the entire string again, but with startoffset +set to 4, it finds the second occurrence of "iss" because it is able to look +behind the starting point to discover that it is preceded by a letter. +

    +

    +If a non-zero starting offset is passed when the pattern is anchored, one +attempt to match at the given offset is made. This can only succeed if the +pattern does not require the match to be at the start of the subject. +

    +
    +How pcre_exec() returns captured substrings +
    +

    +In general, a pattern matches a certain portion of the subject, and in +addition, further substrings from the subject may be picked out by parts of the +pattern. Following the usage in Jeffrey Friedl's book, this is called +"capturing" in what follows, and the phrase "capturing subpattern" is used for +a fragment of a pattern that picks out a substring. PCRE supports several other +kinds of parenthesized subpattern that do not cause substrings to be captured. +

    +

    +Captured substrings are returned to the caller via a vector of integer offsets +whose address is passed in ovector. The number of elements in the vector +is passed in ovecsize, which must be a non-negative number. Note: +this argument is NOT the size of ovector in bytes. +

    +

    +The first two-thirds of the vector is used to pass back captured substrings, +each substring using a pair of integers. The remaining third of the vector is +used as workspace by pcre_exec() while matching capturing subpatterns, +and is not available for passing back information. The length passed in +ovecsize should always be a multiple of three. If it is not, it is +rounded down. +

    +

    +When a match is successful, information about captured substrings is returned +in pairs of integers, starting at the beginning of ovector, and +continuing up to two-thirds of its length at the most. The first element of a +pair is set to the offset of the first character in a substring, and the second +is set to the offset of the first character after the end of a substring. The +first pair, ovector[0] and ovector[1], identify the portion of the +subject string matched by the entire pattern. The next pair is used for the +first capturing subpattern, and so on. The value returned by pcre_exec() +is the number of pairs that have been set. If there are no capturing +subpatterns, the return value from a successful match is 1, indicating that +just the first pair of offsets has been set. +

    +

    +Some convenience functions are provided for extracting the captured substrings +as separate strings. These are described in the following section. +

    +

    +It is possible for an capturing subpattern number n+1 to match some +part of the subject when subpattern n has not been used at all. For +example, if the string "abc" is matched against the pattern (a|(z))(bc) +subpatterns 1 and 3 are matched, but 2 is not. When this happens, both offset +values corresponding to the unused subpattern are set to -1. +

    +

    +If a capturing subpattern is matched repeatedly, it is the last portion of the +string that it matched that is returned. +

    +

    +If the vector is too small to hold all the captured substring offsets, it is +used as far as possible (up to two-thirds of its length), and the function +returns a value of zero. In particular, if the substring offsets are not of +interest, pcre_exec() may be called with ovector passed as NULL and +ovecsize as zero. However, if the pattern contains back references and +the ovector is not big enough to remember the related substrings, PCRE +has to get additional memory for use during matching. Thus it is usually +advisable to supply an ovector. +

    +

    +Note that pcre_info() can be used to find out how many capturing +subpatterns there are in a compiled pattern. The smallest size for +ovector that will allow for n captured substrings, in addition to +the offsets of the substring matched by the whole pattern, is (n+1)*3. +

    +
    +Return values from pcre_exec() +
    +

    +If pcre_exec() fails, it returns a negative number. The following are +defined in the header file: +

    +  PCRE_ERROR_NOMATCH        (-1)
    +
    +The subject string did not match the pattern. +
    +  PCRE_ERROR_NULL           (-2)
    +
    +Either code or subject was passed as NULL, or ovector was +NULL and ovecsize was not zero. +
    +  PCRE_ERROR_BADOPTION      (-3)
    +
    +An unrecognized bit was set in the options argument. +
    +  PCRE_ERROR_BADMAGIC       (-4)
    +
    +PCRE stores a 4-byte "magic number" at the start of the compiled code, to catch +the case when it is passed a junk pointer and to detect when a pattern that was +compiled in an environment of one endianness is run in an environment with the +other endianness. This is the error that PCRE gives when the magic number is +not present. +
    +  PCRE_ERROR_UNKNOWN_NODE   (-5)
    +
    +While running the pattern match, an unknown item was encountered in the +compiled pattern. This error could be caused by a bug in PCRE or by overwriting +of the compiled pattern. +
    +  PCRE_ERROR_NOMEMORY       (-6)
    +
    +If a pattern contains back references, but the ovector that is passed to +pcre_exec() is not big enough to remember the referenced substrings, PCRE +gets a block of memory at the start of matching to use for this purpose. If the +call via pcre_malloc() fails, this error is given. The memory is +automatically freed at the end of matching. +
    +  PCRE_ERROR_NOSUBSTRING    (-7)
    +
    +This error is used by the pcre_copy_substring(), +pcre_get_substring(), and pcre_get_substring_list() functions (see +below). It is never returned by pcre_exec(). +
    +  PCRE_ERROR_MATCHLIMIT     (-8)
    +
    +The recursion and backtracking limit, as specified by the match_limit +field in a pcre_extra structure (or defaulted) was reached. See the +description above. +
    +  PCRE_ERROR_CALLOUT        (-9)
    +
    +This error is never generated by pcre_exec() itself. It is provided for +use by callout functions that want to yield a distinctive error code. See the +pcrecallout +documentation for details. +
    +  PCRE_ERROR_BADUTF8        (-10)
    +
    +A string that contains an invalid UTF-8 byte sequence was passed as a subject. +
    +  PCRE_ERROR_BADUTF8_OFFSET (-11)
    +
    +The UTF-8 byte sequence that was passed as a subject was valid, but the value +of startoffset did not point to the beginning of a UTF-8 character. +
    +  PCRE_ERROR_PARTIAL        (-12)
    +
    +The subject string did not match, but it did match partially. See the +pcrepartial +documentation for details of partial matching. +
    +  PCRE_ERROR_BADPARTIAL     (-13)
    +
    +The PCRE_PARTIAL option was used with a compiled pattern containing items that +are not supported for partial matching. See the +pcrepartial +documentation for details of partial matching. +
    +  PCRE_ERROR_INTERNAL       (-14)
    +
    +An unexpected internal error has occurred. This error could be caused by a bug +in PCRE or by overwriting of the compiled pattern. +
    +  PCRE_ERROR_BADCOUNT       (-15)
    +
    +This error is given if the value of the ovecsize argument is negative. +

    +
    EXTRACTING CAPTURED SUBSTRINGS BY NUMBER
    +

    +int pcre_copy_substring(const char *subject, int *ovector, +int stringcount, int stringnumber, char *buffer, +int buffersize); +

    +

    +int pcre_get_substring(const char *subject, int *ovector, +int stringcount, int stringnumber, +const char **stringptr); +

    +

    +int pcre_get_substring_list(const char *subject, +int *ovector, int stringcount, const char ***listptr); +

    +

    +Captured substrings can be accessed directly by using the offsets returned by +pcre_exec() in ovector. For convenience, the functions +pcre_copy_substring(), pcre_get_substring(), and +pcre_get_substring_list() are provided for extracting captured substrings +as new, separate, zero-terminated strings. These functions identify substrings +by number. The next section describes functions for extracting named +substrings. A substring that contains a binary zero is correctly extracted and +has a further zero added on the end, but the result is not, of course, +a C string. +

    +

    +The first three arguments are the same for all three of these functions: +subject is the subject string that has just been successfully matched, +ovector is a pointer to the vector of integer offsets that was passed to +pcre_exec(), and stringcount is the number of substrings that were +captured by the match, including the substring that matched the entire regular +expression. This is the value returned by pcre_exec() if it is greater +than zero. If pcre_exec() returned zero, indicating that it ran out of +space in ovector, the value passed as stringcount should be the +number of elements in the vector divided by three. +

    +

    +The functions pcre_copy_substring() and pcre_get_substring() +extract a single substring, whose number is given as stringnumber. A +value of zero extracts the substring that matched the entire pattern, whereas +higher values extract the captured substrings. For pcre_copy_substring(), +the string is placed in buffer, whose length is given by +buffersize, while for pcre_get_substring() a new block of memory is +obtained via pcre_malloc, and its address is returned via +stringptr. The yield of the function is the length of the string, not +including the terminating zero, or one of +

    +  PCRE_ERROR_NOMEMORY       (-6)
    +
    +The buffer was too small for pcre_copy_substring(), or the attempt to get +memory failed for pcre_get_substring(). +
    +  PCRE_ERROR_NOSUBSTRING    (-7)
    +
    +There is no substring whose number is stringnumber. +

    +

    +The pcre_get_substring_list() function extracts all available substrings +and builds a list of pointers to them. All this is done in a single block of +memory that is obtained via pcre_malloc. The address of the memory block +is returned via listptr, which is also the start of the list of string +pointers. The end of the list is marked by a NULL pointer. The yield of the +function is zero if all went well, or +

    +  PCRE_ERROR_NOMEMORY       (-6)
    +
    +if the attempt to get the memory block failed. +

    +

    +When any of these functions encounter a substring that is unset, which can +happen when capturing subpattern number n+1 matches some part of the +subject, but subpattern n has not been used at all, they return an empty +string. This can be distinguished from a genuine zero-length substring by +inspecting the appropriate offset in ovector, which is negative for unset +substrings. +

    +

    +The two convenience functions pcre_free_substring() and +pcre_free_substring_list() can be used to free the memory returned by +a previous call of pcre_get_substring() or +pcre_get_substring_list(), respectively. They do nothing more than call +the function pointed to by pcre_free, which of course could be called +directly from a C program. However, PCRE is used in some situations where it is +linked via a special interface to another programming language which cannot use +pcre_free directly; it is for these cases that the functions are +provided. +

    +
    EXTRACTING CAPTURED SUBSTRINGS BY NAME
    +

    +int pcre_get_stringnumber(const pcre *code, +const char *name); +

    +

    +int pcre_copy_named_substring(const pcre *code, +const char *subject, int *ovector, +int stringcount, const char *stringname, +char *buffer, int buffersize); +

    +

    +int pcre_get_named_substring(const pcre *code, +const char *subject, int *ovector, +int stringcount, const char *stringname, +const char **stringptr); +

    +

    +To extract a substring by name, you first have to find associated number. +For example, for this pattern +

    +  (a+)b(?P<xxx>\d+)...
    +
    +the number of the subpattern called "xxx" is 2. You can find the number from +the name by calling pcre_get_stringnumber(). The first argument is the +compiled pattern, and the second is the name. The yield of the function is the +subpattern number, or PCRE_ERROR_NOSUBSTRING (-7) if there is no subpattern of +that name. +

    +

    +Given the number, you can extract the substring directly, or use one of the +functions described in the previous section. For convenience, there are also +two functions that do the whole job. +

    +

    +Most of the arguments of pcre_copy_named_substring() and +pcre_get_named_substring() are the same as those for the similarly named +functions that extract by number. As these are described in the previous +section, they are not re-described here. There are just two differences: +

    +

    +First, instead of a substring number, a substring name is given. Second, there +is an extra argument, given at the start, which is a pointer to the compiled +pattern. This is needed in order to gain access to the name-to-number +translation table. +

    +

    +These functions call pcre_get_stringnumber(), and if it succeeds, they +then call pcre_copy_substring() or pcre_get_substring(), as +appropriate. +

    +
    FINDING ALL POSSIBLE MATCHES
    +

    +The traditional matching function uses a similar algorithm to Perl, which stops +when it finds the first match, starting at a given point in the subject. If you +want to find all possible matches, or the longest possible match, consider +using the alternative matching function (see below) instead. If you cannot use +the alternative function, but still need to find all possible matches, you +can kludge it up by making use of the callout facility, which is described in +the +pcrecallout +documentation. +

    +

    +What you have to do is to insert a callout right at the end of the pattern. +When your callout function is called, extract and save the current matched +substring. Then return 1, which forces pcre_exec() to backtrack and try +other alternatives. Ultimately, when it runs out of matches, pcre_exec() +will yield PCRE_ERROR_NOMATCH. +

    +
    MATCHING A PATTERN: THE ALTERNATIVE FUNCTION
    +

    +int pcre_dfa_exec(const pcre *code, const pcre_extra *extra, +const char *subject, int length, int startoffset, +int options, int *ovector, int ovecsize, +int *workspace, int wscount); +

    +

    +The function pcre_dfa_exec() is called to match a subject string against +a compiled pattern, using a "DFA" matching algorithm. This has different +characteristics to the normal algorithm, and is not compatible with Perl. Some +of the features of PCRE patterns are not supported. Nevertheless, there are +times when this kind of matching can be useful. For a discussion of the two +matching algorithms, see the +pcrematching +documentation. +

    +

    +The arguments for the pcre_dfa_exec() function are the same as for +pcre_exec(), plus two extras. The ovector argument is used in a +different way, and this is described below. The other common arguments are used +in the same way as for pcre_exec(), so their description is not repeated +here. +

    +

    +The two additional arguments provide workspace for the function. The workspace +vector should contain at least 20 elements. It is used for keeping track of +multiple paths through the pattern tree. More workspace will be needed for +patterns and subjects where there are a lot of possible matches. +

    +

    +Here is an example of a simple call to pcre_exec(): +

    +  int rc;
    +  int ovector[10];
    +  int wspace[20];
    +  rc = pcre_exec(
    +    re,             /* result of pcre_compile() */
    +    NULL,           /* we didn't study the pattern */
    +    "some string",  /* the subject string */
    +    11,             /* the length of the subject string */
    +    0,              /* start at offset 0 in the subject */
    +    0,              /* default options */
    +    ovector,        /* vector of integers for substring information */
    +    10,             /* number of elements (NOT size in bytes) */
    +    wspace,         /* working space vector */
    +    20);            /* number of elements (NOT size in bytes) */
    +
    +

    +
    +Option bits for pcre_dfa_exec() +
    +

    +The unused bits of the options argument for pcre_dfa_exec() must be +zero. The only bits that may be set are PCRE_ANCHORED, PCRE_NOTBOL, +PCRE_NOTEOL, PCRE_NOTEMPTY, PCRE_NO_UTF8_CHECK, PCRE_PARTIAL, +PCRE_DFA_SHORTEST, and PCRE_DFA_RESTART. All but the last three of these are +the same as for pcre_exec(), so their description is not repeated here. +

    +  PCRE_PARTIAL
    +
    +This has the same general effect as it does for pcre_exec(), but the +details are slightly different. When PCRE_PARTIAL is set for +pcre_dfa_exec(), the return code PCRE_ERROR_NOMATCH is converted into +PCRE_ERROR_PARTIAL if the end of the subject is reached, there have been no +complete matches, but there is still at least one matching possibility. The +portion of the string that provided the partial match is set as the first +matching string. +
    +  PCRE_DFA_SHORTEST
    +
    +Setting the PCRE_DFA_SHORTEST option causes the matching algorithm to stop as +soon as it has found one match. Because of the way the DFA algorithm works, +this is necessarily the shortest possible match at the first possible matching +point in the subject string. +
    +  PCRE_DFA_RESTART
    +
    +When pcre_dfa_exec() is called with the PCRE_PARTIAL option, and returns +a partial match, it is possible to call it again, with additional subject +characters, and have it continue with the same match. The PCRE_DFA_RESTART +option requests this action; when it is set, the workspace and +wscount options must reference the same vector as before because data +about the match so far is left in them after a partial match. There is more +discussion of this facility in the +pcrepartial +documentation. +

    +
    +Successful returns from pcre_dfa_exec() +
    +

    +When pcre_dfa_exec() succeeds, it may have matched more than one +substring in the subject. Note, however, that all the matches from one run of +the function start at the same point in the subject. The shorter matches are +all initial substrings of the longer matches. For example, if the pattern +

    +  <.*>
    +
    +is matched against the string +
    +  This is <something> <something else> <something further> no more
    +
    +the three matched strings are +
    +  <something>
    +  <something> <something else>
    +  <something> <something else> <something further>
    +
    +On success, the yield of the function is a number greater than zero, which is +the number of matched substrings. The substrings themselves are returned in +ovector. Each string uses two elements; the first is the offset to the +start, and the second is the offset to the end. All the strings have the same +start offset. (Space could have been saved by giving this only once, but it was +decided to retain some compatibility with the way pcre_exec() returns +data, even though the meaning of the strings is different.) +

    +

    +The strings are returned in reverse order of length; that is, the longest +matching string is given first. If there were too many matches to fit into +ovector, the yield of the function is zero, and the vector is filled with +the longest matches. +

    +
    +Error returns from pcre_dfa_exec() +
    +

    +The pcre_dfa_exec() function returns a negative number when it fails. +Many of the errors are the same as for pcre_exec(), and these are +described +above. +There are in addition the following errors that are specific to +pcre_dfa_exec(): +

    +  PCRE_ERROR_DFA_UITEM      (-16)
    +
    +This return is given if pcre_dfa_exec() encounters an item in the pattern +that it does not support, for instance, the use of \C or a back reference. +
    +  PCRE_ERROR_DFA_UCOND      (-17)
    +
    +This return is given if pcre_dfa_exec() encounters a condition item in a +pattern that uses a back reference for the condition. This is not supported. +
    +  PCRE_ERROR_DFA_UMLIMIT    (-18)
    +
    +This return is given if pcre_dfa_exec() is called with an extra +block that contains a setting of the match_limit field. This is not +supported (it is meaningless). +
    +  PCRE_ERROR_DFA_WSSIZE     (-19)
    +
    +This return is given if pcre_dfa_exec() runs out of space in the +workspace vector. +
    +  PCRE_ERROR_DFA_RECURSE    (-20)
    +
    +When a recursive subpattern is processed, the matching function calls itself +recursively, using private vectors for ovector and workspace. This +error is given if the output vector is not large enough. This should be +extremely rare, as a vector of size 1000 is used. +

    +

    +Last updated: 16 May 2005 +
    +Copyright © 1997-2005 University of Cambridge. +

    +Return to the PCRE index page. +

    diff --git a/mozilla/js/tamarin/pcre/doc/html/pcrebuild.html b/mozilla/js/tamarin/pcre/doc/html/pcrebuild.html new file mode 100644 index 00000000000..06b1e2eddab --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/html/pcrebuild.html @@ -0,0 +1,201 @@ + + +pcrebuild specification + + +

    pcrebuild man page

    +

    +Return to the PCRE index page. +

    +

    +This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
    +

    +
    PCRE BUILD-TIME OPTIONS
    +

    +This document describes the optional features of PCRE that can be selected when +the library is compiled. They are all selected, or deselected, by providing +options to the configure script that is run before the make +command. The complete list of options for configure (which includes the +standard ones such as the selection of the installation directory) can be +obtained by running +

    +  ./configure --help
    +
    +The following sections describe certain options whose names begin with --enable +or --disable. These settings specify changes to the defaults for the +configure command. Because of the way that configure works, +--enable and --disable always come in pairs, so the complementary option always +exists as well, but as it specifies the default, it is not described. +

    +
    C++ SUPPORT
    +

    +By default, the configure script will search for a C++ compiler and C++ +header files. If it finds them, it automatically builds the C++ wrapper library +for PCRE. You can disable this by adding +

    +  --disable-cpp
    +
    +to the configure command. +

    +
    UTF-8 SUPPORT
    +

    +To build PCRE with support for UTF-8 character strings, add +

    +  --enable-utf8
    +
    +to the configure command. Of itself, this does not make PCRE treat +strings as UTF-8. As well as compiling PCRE with this option, you also have +have to set the PCRE_UTF8 option when you call the pcre_compile() +function. +

    +
    UNICODE CHARACTER PROPERTY SUPPORT
    +

    +UTF-8 support allows PCRE to process character values greater than 255 in the +strings that it handles. On its own, however, it does not provide any +facilities for accessing the properties of such characters. If you want to be +able to use the pattern escapes \P, \p, and \X, which refer to Unicode +character properties, you must add +

    +  --enable-unicode-properties
    +
    +to the configure command. This implies UTF-8 support, even if you have +not explicitly requested it. +

    +

    +Including Unicode property support adds around 90K of tables to the PCRE +library, approximately doubling its size. Only the general category properties +such as Lu and Nd are supported. Details are given in the +pcrepattern +documentation. +

    +
    CODE VALUE OF NEWLINE
    +

    +By default, PCRE treats character 10 (linefeed) as the newline character. This +is the normal newline character on Unix-like systems. You can compile PCRE to +use character 13 (carriage return) instead by adding +

    +  --enable-newline-is-cr
    +
    +to the configure command. For completeness there is also a +--enable-newline-is-lf option, which explicitly specifies linefeed as the +newline character. +

    +
    BUILDING SHARED AND STATIC LIBRARIES
    +

    +The PCRE building process uses libtool to build both shared and static +Unix libraries by default. You can suppress one of these by adding one of +

    +  --disable-shared
    +  --disable-static
    +
    +to the configure command, as required. +

    +
    POSIX MALLOC USAGE
    +

    +When PCRE is called through the POSIX interface (see the +pcreposix +documentation), additional working storage is required for holding the pointers +to capturing substrings, because PCRE requires three integers per substring, +whereas the POSIX interface provides only two. If the number of expected +substrings is small, the wrapper function uses space on the stack, because this +is faster than using malloc() for each call. The default threshold above +which the stack is no longer used is 10; it can be changed by adding a setting +such as +

    +  --with-posix-malloc-threshold=20
    +
    +to the configure command. +

    +
    LIMITING PCRE RESOURCE USAGE
    +

    +Internally, PCRE has a function called match(), which it calls repeatedly +(possibly recursively) when matching a pattern with the pcre_exec() +function. By controlling the maximum number of times this function may be +called during a single matching operation, a limit can be placed on the +resources used by a single call to pcre_exec(). The limit can be changed +at run time, as described in the +pcreapi +documentation. The default is 10 million, but this can be changed by adding a +setting such as +

    +  --with-match-limit=500000
    +
    +to the configure command. This setting has no effect on the +pcre_dfa_exec() matching function. +

    +
    HANDLING VERY LARGE PATTERNS
    +

    +Within a compiled pattern, offset values are used to point from one part to +another (for example, from an opening parenthesis to an alternation +metacharacter). By default, two-byte values are used for these offsets, leading +to a maximum size for a compiled pattern of around 64K. This is sufficient to +handle all but the most gigantic patterns. Nevertheless, some people do want to +process enormous patterns, so it is possible to compile PCRE to use three-byte +or four-byte offsets by adding a setting such as +

    +  --with-link-size=3
    +
    +to the configure command. The value given must be 2, 3, or 4. Using +longer offsets slows down the operation of PCRE because it has to load +additional bytes when handling them. +

    +

    +If you build PCRE with an increased link size, test 2 (and test 5 if you are +using UTF-8) will fail. Part of the output of these tests is a representation +of the compiled pattern, and this changes with the link size. +

    +
    AVOIDING EXCESSIVE STACK USAGE
    +

    +When matching with the pcre_exec() function, PCRE implements backtracking +by making recursive calls to an internal function called match(). In +environments where the size of the stack is limited, this can severely limit +PCRE's operation. (The Unix environment does not usually suffer from this +problem.) An alternative approach that uses memory from the heap to remember +data, instead of using recursive function calls, has been implemented to work +round this problem. If you want to build a version of PCRE that works this way, +add +

    +  --disable-stack-for-recursion
    +
    +to the configure command. With this configuration, PCRE will use the +pcre_stack_malloc and pcre_stack_free variables to call memory +management functions. Separate functions are provided because the usage is very +predictable: the block sizes requested are always the same, and the blocks are +always freed in reverse order. A calling program might be able to implement +optimized functions that perform better than the standard malloc() and +free() functions. PCRE runs noticeably more slowly when built in this +way. This option affects only the pcre_exec() function; it is not +relevant for the the pcre_dfa_exec() function. +

    +
    USING EBCDIC CODE
    +

    +PCRE assumes by default that it will run in an environment where the character +code is ASCII (or Unicode, which is a superset of ASCII). PCRE can, however, be +compiled to run in an EBCDIC environment by adding +

    +  --enable-ebcdic
    +
    +to the configure command. +

    +

    +Last updated: 15 August 2005 +
    +Copyright © 1997-2005 University of Cambridge. +

    +Return to the PCRE index page. +

    diff --git a/mozilla/js/tamarin/pcre/doc/html/pcrecallout.html b/mozilla/js/tamarin/pcre/doc/html/pcrecallout.html new file mode 100644 index 00000000000..5ccfd5c4e37 --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/html/pcrecallout.html @@ -0,0 +1,186 @@ + + +pcrecallout specification + + +

    pcrecallout man page

    +

    +Return to the PCRE index page. +

    +

    +This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
    +

    +
    PCRE CALLOUTS
    +

    +int (*pcre_callout)(pcre_callout_block *); +

    +

    +PCRE provides a feature called "callout", which is a means of temporarily +passing control to the caller of PCRE in the middle of pattern matching. The +caller of PCRE provides an external function by putting its entry point in the +global variable pcre_callout. By default, this variable contains NULL, +which disables all calling out. +

    +

    +Within a regular expression, (?C) indicates the points at which the external +function is to be called. Different callout points can be identified by putting +a number less than 256 after the letter C. The default value is zero. +For example, this pattern has two callout points: +

    +  (?C1)\deabc(?C2)def
    +
    +If the PCRE_AUTO_CALLOUT option bit is set when pcre_compile() is called, +PCRE automatically inserts callouts, all with number 255, before each item in +the pattern. For example, if PCRE_AUTO_CALLOUT is used with the pattern +
    +  A(\d{2}|--)
    +
    +it is processed as if it were +
    +
    +(?C255)A(?C255)((?C255)\d{2}(?C255)|(?C255)-(?C255)-(?C255))(?C255) +
    +
    +Notice that there is a callout before and after each parenthesis and +alternation bar. Automatic callouts can be used for tracking the progress of +pattern matching. The +pcretest +command has an option that sets automatic callouts; when it is used, the output +indicates how the pattern is matched. This is useful information when you are +trying to optimize the performance of a particular pattern. +

    +
    MISSING CALLOUTS
    +

    +You should be aware that, because of optimizations in the way PCRE matches +patterns, callouts sometimes do not happen. For example, if the pattern is +

    +  ab(?C4)cd
    +
    +PCRE knows that any matching string must contain the letter "d". If the subject +string is "abyz", the lack of "d" means that matching doesn't ever start, and +the callout is never reached. However, with "abyd", though the result is still +no match, the callout is obeyed. +

    +
    THE CALLOUT INTERFACE
    +

    +During matching, when PCRE reaches a callout point, the external function +defined by pcre_callout is called (if it is set). This applies to both +the pcre_exec() and the pcre_dfa_exec() matching functions. The +only argument to the callout function is a pointer to a pcre_callout +block. This structure contains the following fields: +

    +  int          version;
    +  int          callout_number;
    +  int         *offset_vector;
    +  const char  *subject;
    +  int          subject_length;
    +  int          start_match;
    +  int          current_position;
    +  int          capture_top;
    +  int          capture_last;
    +  void        *callout_data;
    +  int          pattern_position;
    +  int          next_item_length;
    +
    +The version field is an integer containing the version number of the +block format. The initial version was 0; the current version is 1. The version +number will change again in future if additional fields are added, but the +intention is never to remove any of the existing fields. +

    +

    +The callout_number field contains the number of the callout, as compiled +into the pattern (that is, the number after ?C for manual callouts, and 255 for +automatically generated callouts). +

    +

    +The offset_vector field is a pointer to the vector of offsets that was +passed by the caller to pcre_exec() or pcre_dfa_exec(). When +pcre_exec() is used, the contents can be inspected in order to extract +substrings that have been matched so far, in the same way as for extracting +substrings after a match has completed. For pcre_dfa_exec() this field is +not useful. +

    +

    +The subject and subject_length fields contain copies of the values +that were passed to pcre_exec(). +

    +

    +The start_match field contains the offset within the subject at which the +current match attempt started. If the pattern is not anchored, the callout +function may be called several times from the same point in the pattern for +different starting points in the subject. +

    +

    +The current_position field contains the offset within the subject of the +current match pointer. +

    +

    +When the pcre_exec() function is used, the capture_top field +contains one more than the number of the highest numbered captured substring so +far. If no substrings have been captured, the value of capture_top is +one. This is always the case when pcre_dfa_exec() is used, because it +does not support captured substrings. +

    +

    +The capture_last field contains the number of the most recently captured +substring. If no substrings have been captured, its value is -1. This is always +the case when pcre_dfa_exec() is used. +

    +

    +The callout_data field contains a value that is passed to +pcre_exec() or pcre_dfa_exec() specifically so that it can be +passed back in callouts. It is passed in the pcre_callout field of the +pcre_extra data structure. If no such data was passed, the value of +callout_data in a pcre_callout block is NULL. There is a +description of the pcre_extra structure in the +pcreapi +documentation. +

    +

    +The pattern_position field is present from version 1 of the +pcre_callout structure. It contains the offset to the next item to be +matched in the pattern string. +

    +

    +The next_item_length field is present from version 1 of the +pcre_callout structure. It contains the length of the next item to be +matched in the pattern string. When the callout immediately precedes an +alternation bar, a closing parenthesis, or the end of the pattern, the length +is zero. When the callout precedes an opening parenthesis, the length is that +of the entire subpattern. +

    +

    +The pattern_position and next_item_length fields are intended to +help in distinguishing between different automatic callouts, which all have the +same callout number. However, they are set for all callouts. +

    +
    RETURN VALUES
    +

    +The external callout function returns an integer to PCRE. If the value is zero, +matching proceeds as normal. If the value is greater than zero, matching fails +at the current point, but the testing of other matching possibilities goes +ahead, just as if a lookahead assertion had failed. If the value is less than +zero, the match is abandoned, and pcre_exec() (or pcre_dfa_exec()) +returns the negative value. +

    +

    +Negative values should normally be chosen from the set of PCRE_ERROR_xxx +values. In particular, PCRE_ERROR_NOMATCH forces a standard "no match" failure. +The error number PCRE_ERROR_CALLOUT is reserved for use by callout functions; +it will never be used by PCRE itself. +

    +

    +Last updated: 28 February 2005 +
    +Copyright © 1997-2005 University of Cambridge. +

    +Return to the PCRE index page. +

    diff --git a/mozilla/js/tamarin/pcre/doc/html/pcrecompat.html b/mozilla/js/tamarin/pcre/doc/html/pcrecompat.html new file mode 100644 index 00000000000..d15b3b0aed1 --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/html/pcrecompat.html @@ -0,0 +1,154 @@ + + +pcrecompat specification + + +

    pcrecompat man page

    +

    +Return to the PCRE index page. +

    +

    +This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
    +
    +DIFFERENCES BETWEEN PCRE AND PERL +
    +

    +This document describes the differences in the ways that PCRE and Perl handle +regular expressions. The differences described here are with respect to Perl +5.8. +

    +

    +1. PCRE does not have full UTF-8 support. Details of what it does have are +given in the +section on UTF-8 support +in the main +pcre +page. +

    +

    +2. PCRE does not allow repeat quantifiers on lookahead assertions. Perl permits +them, but they do not mean what you might think. For example, (?!a){3} does +not assert that the next three characters are not "a". It just asserts that the +next character is not "a" three times. +

    +

    +3. Capturing subpatterns that occur inside negative lookahead assertions are +counted, but their entries in the offsets vector are never set. Perl sets its +numerical variables from any such patterns that are matched before the +assertion fails to match something (thereby succeeding), but only if the +negative lookahead assertion contains just one branch. +

    +

    +4. Though binary zero characters are supported in the subject string, they are +not allowed in a pattern string because it is passed as a normal C string, +terminated by zero. The escape sequence \0 can be used in the pattern to +represent a binary zero. +

    +

    +5. The following Perl escape sequences are not supported: \l, \u, \L, +\U, and \N. In fact these are implemented by Perl's general string-handling +and are not part of its pattern matching engine. If any of these are +encountered by PCRE, an error is generated. +

    +

    +6. The Perl escape sequences \p, \P, and \X are supported only if PCRE is +built with Unicode character property support. The properties that can be +tested with \p and \P are limited to the general category properties such as +Lu and Nd. +

    +

    +7. PCRE does support the \Q...\E escape for quoting substrings. Characters in +between are treated as literals. This is slightly different from Perl in that $ +and @ are also handled as literals inside the quotes. In Perl, they cause +variable interpolation (but of course PCRE does not have variables). Note the +following examples: +

    +    Pattern            PCRE matches      Perl matches
    +
    +    \Qabc$xyz\E        abc$xyz           abc followed by the contents of $xyz
    +    \Qabc\$xyz\E       abc\$xyz          abc\$xyz
    +    \Qabc\E\$\Qxyz\E   abc$xyz           abc$xyz
    +
    +The \Q...\E sequence is recognized both inside and outside character classes. +

    +

    +8. Fairly obviously, PCRE does not support the (?{code}) and (?p{code}) +constructions. However, there is support for recursive patterns using the +non-Perl items (?R), (?number), and (?P>name). Also, the PCRE "callout" feature +allows an external function to be called during pattern matching. See the +pcrecallout +documentation for details. +

    +

    +9. There are some differences that are concerned with the settings of captured +strings when part of a pattern is repeated. For example, matching "aba" against +the pattern /^(a(b)?)+$/ in Perl leaves $2 unset, but in PCRE it is set to "b". +

    +

    +10. PCRE provides some extensions to the Perl regular expression facilities: +
    +
    +(a) Although lookbehind assertions must match fixed length strings, each +alternative branch of a lookbehind assertion can match a different length of +string. Perl requires them all to have the same length. +
    +
    +(b) If PCRE_DOLLAR_ENDONLY is set and PCRE_MULTILINE is not set, the $ +meta-character matches only at the very end of the string. +
    +
    +(c) If PCRE_EXTRA is set, a backslash followed by a letter with no special +meaning is faulted. +
    +
    +(d) If PCRE_UNGREEDY is set, the greediness of the repetition quantifiers is +inverted, that is, by default they are not greedy, but if followed by a +question mark they are. +
    +
    +(e) PCRE_ANCHORED can be used at matching time to force a pattern to be tried +only at the first matching position in the subject string. +
    +
    +(f) The PCRE_NOTBOL, PCRE_NOTEOL, PCRE_NOTEMPTY, and PCRE_NO_AUTO_CAPTURE +options for pcre_exec() have no Perl equivalents. +
    +
    +(g) The (?R), (?number), and (?P>name) constructs allows for recursive pattern +matching (Perl can do this using the (?p{code}) construct, which PCRE cannot +support.) +
    +
    +(h) PCRE supports named capturing substrings, using the Python syntax. +
    +
    +(i) PCRE supports the possessive quantifier "++" syntax, taken from Sun's Java +package. +
    +
    +(j) The (R) condition, for testing recursion, is a PCRE extension. +
    +
    +(k) The callout facility is PCRE-specific. +
    +
    +(l) The partial matching facility is PCRE-specific. +
    +
    +(m) Patterns compiled by PCRE can be saved and re-used at a later time, even on +different hosts that have the other endianness. +
    +
    +(n) The alternative matching function (pcre_dfa_exec()) matches in a +different way and is not Perl-compatible. +

    +

    +Last updated: 28 February 2005 +
    +Copyright © 1997-2005 University of Cambridge. +

    +Return to the PCRE index page. +

    diff --git a/mozilla/js/tamarin/pcre/doc/html/pcrecpp.html b/mozilla/js/tamarin/pcre/doc/html/pcrecpp.html new file mode 100644 index 00000000000..1d5acb77d8a --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/html/pcrecpp.html @@ -0,0 +1,333 @@ + + +pcrecpp specification + + +

    pcrecpp man page

    +

    +Return to the PCRE index page. +

    +

    +This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
    +

    +
    SYNOPSIS OF C++ WRAPPER
    +

    +#include <pcrecpp.h> +

    +

    +

    +
    DESCRIPTION
    +

    +The C++ wrapper for PCRE was provided by Google Inc. Some additional +functionality was added by Giuseppe Maxia. This brief man page was constructed +from the notes in the pcrecpp.h file, which should be consulted for +further details. +

    +
    MATCHING INTERFACE
    +

    +The "FullMatch" operation checks that supplied text matches a supplied pattern +exactly. If pointer arguments are supplied, it copies matched sub-strings that +match sub-patterns into them. +

    +  Example: successful match
    +     pcrecpp::RE re("h.*o");
    +     re.FullMatch("hello");
    +
    +  Example: unsuccessful match (requires full match):
    +     pcrecpp::RE re("e");
    +     !re.FullMatch("hello");
    +
    +  Example: creating a temporary RE object:
    +     pcrecpp::RE("h.*o").FullMatch("hello");
    +
    +You can pass in a "const char*" or a "string" for "text". The examples below +tend to use a const char*. You can, as in the different examples above, store +the RE object explicitly in a variable or use a temporary RE object. The +examples below use one mode or the other arbitrarily. Either could correctly be +used for any of these examples. +

    +

    +You must supply extra pointer arguments to extract matched subpieces. +

    +  Example: extracts "ruby" into "s" and 1234 into "i"
    +     int i;
    +     string s;
    +     pcrecpp::RE re("(\\w+):(\\d+)");
    +     re.FullMatch("ruby:1234", &s, &i);
    +
    +  Example: does not try to extract any extra sub-patterns
    +     re.FullMatch("ruby:1234", &s);
    +
    +  Example: does not try to extract into NULL
    +     re.FullMatch("ruby:1234", NULL, &i);
    +
    +  Example: integer overflow causes failure
    +     !re.FullMatch("ruby:1234567891234", NULL, &i);
    +
    +  Example: fails because there aren't enough sub-patterns:
    +     !pcrecpp::RE("\\w+:\\d+").FullMatch("ruby:1234", &s);
    +
    +  Example: fails because string cannot be stored in integer
    +     !pcrecpp::RE("(.*)").FullMatch("ruby", &i);
    +
    +The provided pointer arguments can be pointers to any scalar numeric +type, or one of: +
    +   string        (matched piece is copied to string)
    +   StringPiece   (StringPiece is mutated to point to matched piece)
    +   T             (where "bool T::ParseFrom(const char*, int)" exists)
    +   NULL          (the corresponding matched sub-pattern is not copied)
    +
    +The function returns true iff all of the following conditions are satisfied: +
    +  a. "text" matches "pattern" exactly;
    +
    +  b. The number of matched sub-patterns is >= number of supplied
    +     pointers;
    +
    +  c. The "i"th argument has a suitable type for holding the
    +     string captured as the "i"th sub-pattern. If you pass in
    +     NULL for the "i"th argument, or pass fewer arguments than
    +     number of sub-patterns, "i"th captured sub-pattern is
    +     ignored.
    +
    +The matching interface supports at most 16 arguments per call. +If you need more, consider using the more general interface +pcrecpp::RE::DoMatch. See pcrecpp.h for the signature for +DoMatch. +

    +
    PARTIAL MATCHES
    +

    +You can use the "PartialMatch" operation when you want the pattern +to match any substring of the text. +

    +  Example: simple search for a string:
    +     pcrecpp::RE("ell").PartialMatch("hello");
    +
    +  Example: find first number in a string:
    +     int number;
    +     pcrecpp::RE re("(\\d+)");
    +     re.PartialMatch("x*100 + 20", &number);
    +     assert(number == 100);
    +
    +

    +
    UTF-8 AND THE MATCHING INTERFACE
    +

    +By default, pattern and text are plain text, one byte per character. The UTF8 +flag, passed to the constructor, causes both pattern and string to be treated +as UTF-8 text, still a byte stream but potentially multiple bytes per +character. In practice, the text is likelier to be UTF-8 than the pattern, but +the match returned may depend on the UTF8 flag, so always use it when matching +UTF8 text. For example, "." will match one byte normally but with UTF8 set may +match up to three bytes of a multi-byte character. +

    +  Example:
    +     pcrecpp::RE_Options options;
    +     options.set_utf8();
    +     pcrecpp::RE re(utf8_pattern, options);
    +     re.FullMatch(utf8_string);
    +
    +  Example: using the convenience function UTF8():
    +     pcrecpp::RE re(utf8_pattern, pcrecpp::UTF8());
    +     re.FullMatch(utf8_string);
    +
    +NOTE: The UTF8 flag is ignored if pcre was not configured with the +
    +      --enable-utf8 flag.
    +
    +

    +
    PASSING MODIFIERS TO THE REGULAR EXPRESSION ENGINE
    +

    +PCRE defines some modifiers to change the behavior of the regular expression +engine. The C++ wrapper defines an auxiliary class, RE_Options, as a vehicle to +pass such modifiers to a RE class. Currently, the following modifiers are +supported: +

    +   modifier              description               Perl corresponding
    +
    +   PCRE_CASELESS         case insensitive match      /i
    +   PCRE_MULTILINE        multiple lines match        /m
    +   PCRE_DOTALL           dot matches newlines        /s
    +   PCRE_DOLLAR_ENDONLY   $ matches only at end       N/A
    +   PCRE_EXTRA            strict escape parsing       N/A
    +   PCRE_EXTENDED         ignore whitespaces          /x
    +   PCRE_UTF8             handles UTF8 chars          built-in
    +   PCRE_UNGREEDY         reverses * and *?           N/A
    +   PCRE_NO_AUTO_CAPTURE  disables capturing parens   N/A (*)
    +
    +(*) Both Perl and PCRE allow non capturing parentheses by means of the +"?:" modifier within the pattern itself. e.g. (?:ab|cd) does not +capture, while (ab|cd) does. +

    +

    +For a full account on how each modifier works, please check the +PCRE API reference page. +

    +

    +For each modifier, there are two member functions whose name is made +out of the modifier in lowercase, without the "PCRE_" prefix. For +instance, PCRE_CASELESS is handled by +

    +  bool caseless()
    +
    +which returns true if the modifier is set, and +
    +  RE_Options & set_caseless(bool)
    +
    +which sets or unsets the modifier. Moreover, PCRE_CONFIG_MATCH_LIMIT can be +accessed through the set_match_limit() and match_limit() member +functions. Setting match_limit to a non-zero value will limit the +execution of pcre to keep it from doing bad things like blowing the stack or +taking an eternity to return a result. A value of 5000 is good enough to stop +stack blowup in a 2MB thread stack. Setting match_limit to zero disables +match limiting. +

    +

    +Normally, to pass one or more modifiers to a RE class, you declare +a RE_Options object, set the appropriate options, and pass this +object to a RE constructor. Example: +

    +   RE_options opt;
    +   opt.set_caseless(true);
    +   if (RE("HELLO", opt).PartialMatch("hello world")) ...
    +
    +RE_options has two constructors. The default constructor takes no arguments and +creates a set of flags that are off by default. The optional parameter +option_flags is to facilitate transfer of legacy code from C programs. +This lets you do +
    +   RE(pattern,
    +     RE_Options(PCRE_CASELESS|PCRE_MULTILINE)).PartialMatch(str);
    +
    +However, new code is better off doing +
    +   RE(pattern,
    +     RE_Options().set_caseless(true).set_multiline(true))
    +       .PartialMatch(str);
    +
    +If you are going to pass one of the most used modifiers, there are some +convenience functions that return a RE_Options class with the +appropriate modifier already set: CASELESS(), UTF8(), +MULTILINE(), DOTALL(), and EXTENDED(). +

    +

    +If you need to set several options at once, and you don't want to go through +the pains of declaring a RE_Options object and setting several options, there +is a parallel method that give you such ability on the fly. You can concatenate +several set_xxxxx() member functions, since each of them returns a +reference to its class object. For example, to pass PCRE_CASELESS, +PCRE_EXTENDED, and PCRE_MULTILINE to a RE with one statement, you may write: +

    +   RE(" ^ xyz \\s+ .* blah$",
    +     RE_Options()
    +       .set_caseless(true)
    +       .set_extended(true)
    +       .set_multiline(true)).PartialMatch(sometext);
    +
    +
    +

    +
    SCANNING TEXT INCREMENTALLY
    +

    +The "Consume" operation may be useful if you want to repeatedly +match regular expressions at the front of a string and skip over +them as they match. This requires use of the "StringPiece" type, +which represents a sub-range of a real string. Like RE, StringPiece +is defined in the pcrecpp namespace. +

    +  Example: read lines of the form "var = value" from a string.
    +     string contents = ...;                 // Fill string somehow
    +     pcrecpp::StringPiece input(contents);  // Wrap in a StringPiece
    +
    +

    +

    +

    +     string var;
    +     int value;
    +     pcrecpp::RE re("(\\w+) = (\\d+)\n");
    +     while (re.Consume(&input, &var, &value)) {
    +       ...;
    +     }
    +
    +Each successful call to "Consume" will set "var/value", and also +advance "input" so it points past the matched text. +

    +

    +The "FindAndConsume" operation is similar to "Consume" but does not +anchor your match at the beginning of the string. For example, you +could extract all words from a string by repeatedly calling +

    +  pcrecpp::RE("(\\w+)").FindAndConsume(&input, &word)
    +
    +

    +
    PARSING HEX/OCTAL/C-RADIX NUMBERS
    +

    +By default, if you pass a pointer to a numeric value, the +corresponding text is interpreted as a base-10 number. You can +instead wrap the pointer with a call to one of the operators Hex(), +Octal(), or CRadix() to interpret the text in another base. The +CRadix operator interprets C-style "0" (base-8) and "0x" (base-16) +prefixes, but defaults to base-10. +

    +  Example:
    +    int a, b, c, d;
    +    pcrecpp::RE re("(.*) (.*) (.*) (.*)");
    +    re.FullMatch("100 40 0100 0x40",
    +                 pcrecpp::Octal(&a), pcrecpp::Hex(&b),
    +                 pcrecpp::CRadix(&c), pcrecpp::CRadix(&d));
    +
    +will leave 64 in a, b, c, and d. +

    +
    REPLACING PARTS OF STRINGS
    +

    +You can replace the first match of "pattern" in "str" with "rewrite". +Within "rewrite", backslash-escaped digits (\1 to \9) can be +used to insert text matching corresponding parenthesized group +from the pattern. \0 in "rewrite" refers to the entire matching +text. For example: +

    +  string s = "yabba dabba doo";
    +  pcrecpp::RE("b+").Replace("d", &s);
    +
    +will leave "s" containing "yada dabba doo". The result is true if the pattern +matches and a replacement occurs, false otherwise. +

    +

    +GlobalReplace is like Replace except that it replaces all +occurrences of the pattern in the string with the rewrite. Replacements are +not subject to re-matching. For example: +

    +  string s = "yabba dabba doo";
    +  pcrecpp::RE("b+").GlobalReplace("d", &s);
    +
    +will leave "s" containing "yada dada doo". It returns the number of +replacements made. +

    +

    +Extract is like Replace, except that if the pattern matches, +"rewrite" is copied into "out" (an additional argument) with substitutions. +The non-matching portions of "text" are ignored. Returns true iff a match +occurred and the extraction happened successfully; if no match occurs, the +string is left unaffected. +

    +
    AUTHOR
    +

    +The C++ wrapper was contributed by Google Inc. +
    +Copyright © 2005 Google Inc. +

    +Return to the PCRE index page. +

    diff --git a/mozilla/js/tamarin/pcre/doc/html/pcregrep.html b/mozilla/js/tamarin/pcre/doc/html/pcregrep.html new file mode 100644 index 00000000000..614034dd6ca --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/html/pcregrep.html @@ -0,0 +1,274 @@ + + +pcregrep specification + + +

    pcregrep man page

    +

    +Return to the PCRE index page. +

    +

    +This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
    +

    +
    SYNOPSIS
    +

    +pcregrep [options] [long options] [pattern] [file1 file2 ...] +

    +
    DESCRIPTION
    +

    +pcregrep searches files for character patterns, in the same way as other +grep commands do, but it uses the PCRE regular expression library to support +patterns that are compatible with the regular expressions of Perl 5. See +pcrepattern +for a full description of syntax and semantics of the regular expressions that +PCRE supports. +

    +

    +A pattern must be specified on the command line unless the -f option is +used (see below). +

    +

    +If no files are specified, pcregrep reads the standard input. The +standard input can also be referenced by a name consisting of a single hyphen. +For example: +

    +  pcregrep some-pattern /file1 - /file3
    +
    +By default, each line that matches the pattern is copied to the standard +output, and if there is more than one file, the file name is printed before +each line of output. However, there are options that can change how +pcregrep behaves. In particular, the -M option makes it possible to +search for patterns that span line boundaries. +

    +

    +Patterns are limited to 8K or BUFSIZ characters, whichever is the greater. +BUFSIZ is defined in <stdio.h>. +

    +
    OPTIONS
    +

    +-- +This terminate the list of options. It is useful if the next item on the +command line starts with a hyphen, but is not an option. +

    +

    +-A number +Print number lines of context after each matching line. If file names +and/or line numbers are being printed, a hyphen separator is used instead of a +colon for the context lines. A line containing "--" is printed between each +group of lines, unless they are in fact contiguous in the input file. The value +of number is expected to be relatively small. However, pcregrep +guarantees to have up to 8K of following text available for context printing. +

    +

    +-B number +Print number lines of context before each matching line. If file names +and/or line numbers are being printed, a hyphen separator is used instead of a +colon for the context lines. A line containing "--" is printed between each +group of lines, unless they are in fact contiguous in the input file. The value +of number is expected to be relatively small. However, pcregrep +guarantees to have up to 8K of preceding text available for context printing. +

    +

    +-C number +Print number lines of context both before and after each matching line. +This is equivalent to setting both -A and -B to the same value. +

    +

    +-c +Do not print individual lines; instead just print a count of the number of +lines that would otherwise have been printed. If several files are given, a +count is printed for each of them. +

    +

    +--exclude=pattern +When pcregrep is searching the files in a directory as a consequence of +the -r (recursive search) option, any files whose names match the pattern +are excluded. The pattern is a PCRE regular expression. If a file name matches +both --include and --exclude, it is excluded. There is no short +form for this option. +

    +

    +-ffilename +Read a number of patterns from the file, one per line, and match all of them +against each line of input. A line is output if any of the patterns match it. +When -f is used, no pattern is taken from the command line; all arguments +are treated as file names. There is a maximum of 100 patterns. Trailing white +space is removed, and blank lines are ignored. An empty file contains no +patterns and therefore matches nothing. +

    +

    +-h +Suppress printing of filenames when searching multiple files. +

    +

    +-i +Ignore upper/lower case distinctions during comparisons. +

    +

    +--include=pattern +When pcregrep is searching the files in a directory as a consequence of +the -r (recursive search) option, only files whose names match the +pattern are included. The pattern is a PCRE regular expression. If a file name +matches both --include and --exclude, it is excluded. There is no +short form for this option. +

    +

    +-L +Instead of printing lines from the files, just print the names of the files +that do not contain any lines that would have been printed. Each file name is +printed once, on a separate line. +

    +

    +-l +Instead of printing lines from the files, just print the names of the files +containing lines that would have been printed. Each file name is printed +once, on a separate line. +

    +

    +--label=name +This option supplies a name to be used for the standard input when file names +are being printed. If not supplied, "(standard input)" is used. There is no +short form for this option. +

    +

    +-M +Allow patterns to match more than one line. When this option is given, patterns +may usefully contain literal newline characters and internal occurrences of ^ +and $ characters. The output for any one match may consist of more than one +line. When this option is set, the PCRE library is called in "multiline" mode. +There is a limit to the number of lines that can be matched, imposed by the way +that pcregrep buffers the input file as it scans it. However, +pcregrep ensures that at least 8K characters or the rest of the document +(whichever is the shorter) are available for forward matching, and similarly +the previous 8K characters (or all the previous characters, if fewer than 8K) +are guaranteed to be available for lookbehind assertions. +

    +

    +-n +Precede each line by its line number in the file. +

    +

    +-q +Work quietly, that is, display nothing except error messages. +The exit status indicates whether or not any matches were found. +

    +

    +-r +If any given path is a directory, recursively scan the files it contains, +taking note of any --include and --exclude settings. Without +-r a directory is scanned as a normal file. +

    +

    +-s +Suppress error messages about non-existent or unreadable files. Such files are +quietly skipped. However, the return code is still 2, even if matches were +found in other files. +

    +

    +-u +Operate in UTF-8 mode. This option is available only if PCRE has been compiled +with UTF-8 support. Both the pattern and each subject line must be valid +strings of UTF-8 characters. +

    +

    +-V +Write the version numbers of pcregrep and the PCRE library that is being +used to the standard error stream. +

    +

    +-v +Invert the sense of the match, so that lines which do not match the +pattern are the ones that are found. +

    +

    +-w +Force the pattern to match only whole words. This is equivalent to having \b +at the start and end of the pattern. +

    +

    +-x +Force the pattern to be anchored (it must start matching at the beginning of +the line) and in addition, require it to match the entire line. This is +equivalent to having ^ and $ characters at the start and end of each +alternative branch in the regular expression. +

    +
    LONG OPTIONS
    +

    +Long forms of all the options are available, as in GNU grep. They are shown in +the following table: +

    +  -A   --after-context
    +  -B   --before-context
    +  -C   --context
    +  -c   --count
    +       --exclude (no short form)
    +  -f   --file
    +  -h   --no-filename
    +       --help (no short form)
    +  -i   --ignore-case
    +       --include (no short form)
    +  -L   --files-without-match
    +  -l   --files-with-matches
    +       --label (no short form)
    +  -n   --line-number
    +  -r   --recursive
    +  -q   --quiet
    +  -s   --no-messages
    +  -u   --utf-8
    +  -V   --version
    +  -v   --invert-match
    +  -x   --line-regex
    +  -x   --line-regexp
    +
    +

    +
    OPTIONS WITH DATA
    +

    +There are four different ways in which an option with data can be specified. +If a short form option is used, the data may follow immediately, or in the next +command line item. For example: +

    +  -f/some/file
    +  -f /some/file
    +
    +If a long form option is used, the data may appear in the same command line +item, separated by an = character, or it may appear in the next command line +item. For example: +
    +  --file=/some/file
    +  --file /some/file
    +
    +
    +

    +
    DIAGNOSTICS
    +

    +Exit status is 0 if any matches were found, 1 if no matches were found, and 2 +for syntax errors and non-existent or inacessible files (even if matches were +found in other files). Using the -s option to suppress error messages +about inaccessble files does not affect the return code. +

    +
    AUTHOR
    +

    +Philip Hazel +
    +University Computing Service +
    +Cambridge CB2 3QG, England. +

    +

    +Last updated: 16 May 2005 +
    +Copyright © 1997-2005 University of Cambridge. +

    +Return to the PCRE index page. +

    diff --git a/mozilla/js/tamarin/pcre/doc/html/pcrematching.html b/mozilla/js/tamarin/pcre/doc/html/pcrematching.html new file mode 100644 index 00000000000..eb381b75bcf --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/html/pcrematching.html @@ -0,0 +1,192 @@ + + +pcrematching specification + + +

    pcrematching man page

    +

    +Return to the PCRE index page. +

    +

    +This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
    +

    +
    PCRE MATCHING ALGORITHMS
    +

    +This document describes the two different algorithms that are available in PCRE +for matching a compiled regular expression against a given subject string. The +"standard" algorithm is the one provided by the pcre_exec() function. +This works in the same was as Perl's matching function, and provides a +Perl-compatible matching operation. +

    +

    +An alternative algorithm is provided by the pcre_dfa_exec() function; +this operates in a different way, and is not Perl-compatible. It has advantages +and disadvantages compared with the standard algorithm, and these are described +below. +

    +

    +When there is only one possible way in which a given subject string can match a +pattern, the two algorithms give the same answer. A difference arises, however, +when there are multiple possibilities. For example, if the pattern +

    +  ^<.*>
    +
    +is matched against the string +
    +  <something> <something else> <something further>
    +
    +there are three possible answers. The standard algorithm finds only one of +them, whereas the DFA algorithm finds all three. +

    +
    REGULAR EXPRESSIONS AS TREES
    +

    +The set of strings that are matched by a regular expression can be represented +as a tree structure. An unlimited repetition in the pattern makes the tree of +infinite size, but it is still a tree. Matching the pattern to a given subject +string (from a given starting point) can be thought of as a search of the tree. +There are two standard ways to search a tree: depth-first and breadth-first, +and these correspond to the two matching algorithms provided by PCRE. +

    +
    THE STANDARD MATCHING ALGORITHM
    +

    +In the terminology of Jeffrey Friedl's book \fIMastering Regular +Expressions\fP, the standard algorithm is an "NFA algorithm". It conducts a +depth-first search of the pattern tree. That is, it proceeds along a single +path through the tree, checking that the subject matches what is required. When +there is a mismatch, the algorithm tries any alternatives at the current point, +and if they all fail, it backs up to the previous branch point in the tree, and +tries the next alternative branch at that level. This often involves backing up +(moving to the left) in the subject string as well. The order in which +repetition branches are tried is controlled by the greedy or ungreedy nature of +the quantifier. +

    +

    +If a leaf node is reached, a matching string has been found, and at that point +the algorithm stops. Thus, if there is more than one possible match, this +algorithm returns the first one that it finds. Whether this is the shortest, +the longest, or some intermediate length depends on the way the greedy and +ungreedy repetition quantifiers are specified in the pattern. +

    +

    +Because it ends up with a single path through the tree, it is relatively +straightforward for this algorithm to keep track of the substrings that are +matched by portions of the pattern in parentheses. This provides support for +capturing parentheses and back references. +

    +
    THE DFA MATCHING ALGORITHM
    +

    +DFA stands for "deterministic finite automaton", but you do not need to +understand the origins of that name. This algorithm conducts a breadth-first +search of the tree. Starting from the first matching point in the subject, it +scans the subject string from left to right, once, character by character, and +as it does this, it remembers all the paths through the tree that represent +valid matches. +

    +

    +The scan continues until either the end of the subject is reached, or there are +no more unterminated paths. At this point, terminated paths represent the +different matching possibilities (if there are none, the match has failed). +Thus, if there is more than one possible match, this algorithm finds all of +them, and in particular, it finds the longest. In PCRE, there is an option to +stop the algorithm after the first match (which is necessarily the shortest) +has been found. +

    +

    +Note that all the matches that are found start at the same point in the +subject. If the pattern +

    +  cat(er(pillar)?)
    +
    +is matched against the string "the caterpillar catchment", the result will be +the three strings "cat", "cater", and "caterpillar" that start at the fourth +character of the subject. The algorithm does not automatically move on to find +matches that start at later positions. +

    +

    +There are a number of features of PCRE regular expressions that are not +supported by the DFA matching algorithm. They are as follows: +

    +

    +1. Because the algorithm finds all possible matches, the greedy or ungreedy +nature of repetition quantifiers is not relevant. Greedy and ungreedy +quantifiers are treated in exactly the same way. +

    +

    +2. When dealing with multiple paths through the tree simultaneously, it is not +straightforward to keep track of captured substrings for the different matching +possibilities, and PCRE's implementation of this algorithm does not attempt to +do this. This means that no captured substrings are available. +

    +

    +3. Because no substrings are captured, back references within the pattern are +not supported, and cause errors if encountered. +

    +

    +4. For the same reason, conditional expressions that use a backreference as the +condition are not supported. +

    +

    +5. Callouts are supported, but the value of the capture_top field is +always 1, and the value of the capture_last field is always -1. +

    +

    +6. +The \C escape sequence, which (in the standard algorithm) matches a single +byte, even in UTF-8 mode, is not supported because the DFA algorithm moves +through the subject string one character at a time, for all active paths +through the tree. +

    +
    ADVANTAGES OF THE DFA ALGORITHM
    +

    +Using the DFA matching algorithm provides the following advantages: +

    +

    +1. All possible matches (at a single point in the subject) are automatically +found, and in particular, the longest match is found. To find more than one +match using the standard algorithm, you have to do kludgy things with +callouts. +

    +

    +2. There is much better support for partial matching. The restrictions on the +content of the pattern that apply when using the standard algorithm for partial +matching do not apply to the DFA algorithm. For non-anchored patterns, the +starting position of a partial match is available. +

    +

    +3. Because the DFA algorithm scans the subject string just once, and never +needs to backtrack, it is possible to pass very long subject strings to the +matching function in several pieces, checking for partial matching each time. +

    +
    DISADVANTAGES OF THE DFA ALGORITHM
    +

    +The DFA algorithm suffers from a number of disadvantages: +

    +

    +1. It is substantially slower than the standard algorithm. This is partly +because it has to search for all possible matches, but is also because it is +less susceptible to optimization. +

    +

    +2. Capturing parentheses and back references are not supported. +

    +

    +3. The "atomic group" feature of PCRE regular expressions is supported, but +does not provide the advantage that it does for the standard algorithm. +

    +

    +Last updated: 28 February 2005 +
    +Copyright © 1997-2005 University of Cambridge. +

    +Return to the PCRE index page. +

    diff --git a/mozilla/js/tamarin/pcre/doc/html/pcrepartial.html b/mozilla/js/tamarin/pcre/doc/html/pcrepartial.html new file mode 100644 index 00000000000..0dbfc02ff3a --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/html/pcrepartial.html @@ -0,0 +1,205 @@ + + +pcrepartial specification + + +

    pcrepartial man page

    +

    +Return to the PCRE index page. +

    +

    +This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
    +

    +
    PARTIAL MATCHING IN PCRE
    +

    +In normal use of PCRE, if the subject string that is passed to +pcre_exec() or pcre_dfa_exec() matches as far as it goes, but is +too short to match the entire pattern, PCRE_ERROR_NOMATCH is returned. There +are circumstances where it might be helpful to distinguish this case from other +cases in which there is no match. +

    +

    +Consider, for example, an application where a human is required to type in data +for a field with specific formatting requirements. An example might be a date +in the form ddmmmyy, defined by this pattern: +

    +  ^\d?\d(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d\d$
    +
    +If the application sees the user's keystrokes one by one, and can check that +what has been typed so far is potentially valid, it is able to raise an error +as soon as a mistake is made, possibly beeping and not reflecting the +character that has been typed. This immediate feedback is likely to be a better +user interface than a check that is delayed until the entire string has been +entered. +

    +

    +PCRE supports the concept of partial matching by means of the PCRE_PARTIAL +option, which can be set when calling pcre_exec() or +pcre_dfa_exec(). When this flag is set for pcre_exec(), the return +code PCRE_ERROR_NOMATCH is converted into PCRE_ERROR_PARTIAL if at any time +during the matching process the last part of the subject string matched part of +the pattern. Unfortunately, for non-anchored matching, it is not possible to +obtain the position of the start of the partial match. No captured data is set +when PCRE_ERROR_PARTIAL is returned. +

    +

    +When PCRE_PARTIAL is set for pcre_dfa_exec(), the return code +PCRE_ERROR_NOMATCH is converted into PCRE_ERROR_PARTIAL if the end of the +subject is reached, there have been no complete matches, but there is still at +least one matching possibility. The portion of the string that provided the +partial match is set as the first matching string. +

    +

    +Using PCRE_PARTIAL disables one of PCRE's optimizations. PCRE remembers the +last literal byte in a pattern, and abandons matching immediately if such a +byte is not present in the subject string. This optimization cannot be used +for a subject string that might match only partially. +

    +
    RESTRICTED PATTERNS FOR PCRE_PARTIAL
    +

    +Because of the way certain internal optimizations are implemented in the +pcre_exec() function, the PCRE_PARTIAL option cannot be used with all +patterns. These restrictions do not apply when pcre_dfa_exec() is used. +For pcre_exec(), repeated single characters such as +

    +  a{2,4}
    +
    +and repeated single metasequences such as +
    +  \d+
    +
    +are not permitted if the maximum number of occurrences is greater than one. +Optional items such as \d? (where the maximum is one) are permitted. +Quantifiers with any values are permitted after parentheses, so the invalid +examples above can be coded thus: +
    +  (a){2,4}
    +  (\d)+
    +
    +These constructions run more slowly, but for the kinds of application that are +envisaged for this facility, this is not felt to be a major restriction. +

    +

    +If PCRE_PARTIAL is set for a pattern that does not conform to the restrictions, +pcre_exec() returns the error code PCRE_ERROR_BADPARTIAL (-13). +

    +
    EXAMPLE OF PARTIAL MATCHING USING PCRETEST
    +

    +If the escape sequence \P is present in a pcretest data line, the +PCRE_PARTIAL flag is used for the match. Here is a run of pcretest that +uses the date example quoted above: +

    +    re> /^\d?\d(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d\d$/
    +  data> 25jun04\P
    +   0: 25jun04
    +   1: jun
    +  data> 25dec3\P
    +  Partial match
    +  data> 3ju\P
    +  Partial match
    +  data> 3juj\P
    +  No match
    +  data> j\P
    +  No match
    +
    +The first data string is matched completely, so pcretest shows the +matched substrings. The remaining four strings do not match the complete +pattern, but the first two are partial matches. The same test, using DFA +matching (by means of the \D escape sequence), produces the following output: +
    +    re> /^\d?\d(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d\d$/
    +  data> 25jun04\P\D
    +   0: 25jun04
    +  data> 23dec3\P\D
    +  Partial match: 23dec3
    +  data> 3ju\P\D
    +  Partial match: 3ju
    +  data> 3juj\P\D
    +  No match
    +  data> j\P\D
    +  No match
    +
    +Notice that in this case the portion of the string that was matched is made +available. +

    +
    MULTI-SEGMENT MATCHING WITH pcre_dfa_exec()
    +

    +When a partial match has been found using pcre_dfa_exec(), it is possible +to continue the match by providing additional subject data and calling +pcre_dfa_exec() again with the PCRE_DFA_RESTART option and the same +working space (where details of the previous partial match are stored). Here is +an example using pcretest, where the \R escape sequence sets the +PCRE_DFA_RESTART option and the \D escape sequence requests the use of +pcre_dfa_exec(): +

    +    re> /^\d?\d(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d\d$/
    +  data> 23ja\P\D
    +  Partial match: 23ja
    +  data> n05\R\D
    +   0: n05
    +
    +The first call has "23ja" as the subject, and requests partial matching; the +second call has "n05" as the subject for the continued (restarted) match. +Notice that when the match is complete, only the last part is shown; PCRE does +not retain the previously partially-matched string. It is up to the calling +program to do that if it needs to. +

    +

    +This facility can be used to pass very long subject strings to +pcre_dfa_exec(). However, some care is needed for certain types of +pattern. +

    +

    +1. If the pattern contains tests for the beginning or end of a line, you need +to pass the PCRE_NOTBOL or PCRE_NOTEOL options, as appropriate, when the +subject string for any call does not contain the beginning or end of a line. +

    +

    +2. If the pattern contains backward assertions (including \b or \B), you need +to arrange for some overlap in the subject strings to allow for this. For +example, you could pass the subject in chunks that were 500 bytes long, but in +a buffer of 700 bytes, with the starting offset set to 200 and the previous 200 +bytes at the start of the buffer. +

    +

    +3. Matching a subject string that is split into multiple segments does not +always produce exactly the same result as matching over one single long string. +The difference arises when there are multiple matching possibilities, because a +partial match result is given only when there are no completed matches in a +call to fBpcre_dfa_exec()\fP. This means that as soon as the shortest match has +been found, continuation to a new subject segment is no longer possible. +Consider this pcretest example: +

    +    re> /dog(sbody)?/
    +  data> do\P\D
    +  Partial match: do
    +  data> gsb\R\P\D
    +   0: g
    +  data> dogsbody\D
    +   0: dogsbody
    +   1: dog
    +
    +The pattern matches the words "dog" or "dogsbody". When the subject is +presented in several parts ("do" and "gsb" being the first two) the match stops +when "dog" has been found, and it is not possible to continue. On the other +hand, if "dogsbody" is presented as a single string, both matches are found. +

    +

    +Because of this phenomenon, it does not usually make sense to end a pattern +that is going to be matched in this way with a variable repeat. +

    +

    +Last updated: 28 February 2005 +
    +Copyright © 1997-2005 University of Cambridge. +

    +Return to the PCRE index page. +

    diff --git a/mozilla/js/tamarin/pcre/doc/html/pcrepattern.html b/mozilla/js/tamarin/pcre/doc/html/pcrepattern.html new file mode 100644 index 00000000000..0f77b3200a2 --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/html/pcrepattern.html @@ -0,0 +1,1494 @@ + + +pcrepattern specification + + +

    pcrepattern man page

    +

    +Return to the PCRE index page. +

    +

    +This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
    +

    +
    PCRE REGULAR EXPRESSION DETAILS
    +

    +The syntax and semantics of the regular expressions supported by PCRE are +described below. Regular expressions are also described in the Perl +documentation and in a number of books, some of which have copious examples. +Jeffrey Friedl's "Mastering Regular Expressions", published by O'Reilly, covers +regular expressions in great detail. This description of PCRE's regular +expressions is intended as reference material. +

    +

    +The original operation of PCRE was on strings of one-byte characters. However, +there is now also support for UTF-8 character strings. To use this, you must +build PCRE to include UTF-8 support, and then call pcre_compile() with +the PCRE_UTF8 option. How this affects pattern matching is mentioned in several +places below. There is also a summary of UTF-8 features in the +section on UTF-8 support +in the main +pcre +page. +

    +

    +The remainder of this document discusses the patterns that are supported by +PCRE when its main matching function, pcre_exec(), is used. +From release 6.0, PCRE offers a second matching function, +pcre_dfa_exec(), which matches using a different algorithm that is not +Perl-compatible. The advantages and disadvantages of the alternative function, +and how it differs from the normal function, are discussed in the +pcrematching +page. +

    +

    +A regular expression is a pattern that is matched against a subject string from +left to right. Most characters stand for themselves in a pattern, and match the +corresponding characters in the subject. As a trivial example, the pattern +

    +  The quick brown fox
    +
    +matches a portion of a subject string that is identical to itself. When +caseless matching is specified (the PCRE_CASELESS option), letters are matched +independently of case. In UTF-8 mode, PCRE always understands the concept of +case for characters whose values are less than 128, so caseless matching is +always possible. For characters with higher values, the concept of case is +supported if PCRE is compiled with Unicode property support, but not otherwise. +If you want to use caseless matching for characters 128 and above, you must +ensure that PCRE is compiled with Unicode property support as well as with +UTF-8 support. +

    +

    +The power of regular expressions comes from the ability to include alternatives +and repetitions in the pattern. These are encoded in the pattern by the use of +metacharacters, which do not stand for themselves but instead are +interpreted in some special way. +

    +

    +There are two different sets of metacharacters: those that are recognized +anywhere in the pattern except within square brackets, and those that are +recognized in square brackets. Outside square brackets, the metacharacters are +as follows: +

    +  \      general escape character with several uses
    +  ^      assert start of string (or line, in multiline mode)
    +  $      assert end of string (or line, in multiline mode)
    +  .      match any character except newline (by default)
    +  [      start character class definition
    +  |      start of alternative branch
    +  (      start subpattern
    +  )      end subpattern
    +  ?      extends the meaning of (
    +         also 0 or 1 quantifier
    +         also quantifier minimizer
    +  *      0 or more quantifier
    +  +      1 or more quantifier
    +         also "possessive quantifier"
    +  {      start min/max quantifier
    +
    +Part of a pattern that is in square brackets is called a "character class". In +a character class the only metacharacters are: +
    +  \      general escape character
    +  ^      negate the class, but only if the first character
    +  -      indicates character range
    +  [      POSIX character class (only if followed by POSIX syntax)
    +  ]      terminates the character class
    +
    +The following sections describe the use of each of the metacharacters. +

    +
    BACKSLASH
    +

    +The backslash character has several uses. Firstly, if it is followed by a +non-alphanumeric character, it takes away any special meaning that character may +have. This use of backslash as an escape character applies both inside and +outside character classes. +

    +

    +For example, if you want to match a * character, you write \* in the pattern. +This escaping action applies whether or not the following character would +otherwise be interpreted as a metacharacter, so it is always safe to precede a +non-alphanumeric with backslash to specify that it stands for itself. In +particular, if you want to match a backslash, you write \\. +

    +

    +If a pattern is compiled with the PCRE_EXTENDED option, whitespace in the +pattern (other than in a character class) and characters between a # outside +a character class and the next newline character are ignored. An escaping +backslash can be used to include a whitespace or # character as part of the +pattern. +

    +

    +If you want to remove the special meaning from a sequence of characters, you +can do so by putting them between \Q and \E. This is different from Perl in +that $ and @ are handled as literals in \Q...\E sequences in PCRE, whereas in +Perl, $ and @ cause variable interpolation. Note the following examples: +

    +  Pattern            PCRE matches   Perl matches
    +
    +  \Qabc$xyz\E        abc$xyz        abc followed by the contents of $xyz
    +  \Qabc\$xyz\E       abc\$xyz       abc\$xyz
    +  \Qabc\E\$\Qxyz\E   abc$xyz        abc$xyz
    +
    +The \Q...\E sequence is recognized both inside and outside character classes. +

    +
    +Non-printing characters +
    +

    +A second use of backslash provides a way of encoding non-printing characters +in patterns in a visible manner. There is no restriction on the appearance of +non-printing characters, apart from the binary zero that terminates a pattern, +but when a pattern is being prepared by text editing, it is usually easier to +use one of the following escape sequences than the binary character it +represents: +

    +  \a        alarm, that is, the BEL character (hex 07)
    +  \cx       "control-x", where x is any character
    +  \e        escape (hex 1B)
    +  \f        formfeed (hex 0C)
    +  \n        newline (hex 0A)
    +  \r        carriage return (hex 0D)
    +  \t        tab (hex 09)
    +  \ddd      character with octal code ddd, or backreference
    +  \xhh      character with hex code hh
    +  \x{hhh..} character with hex code hhh... (UTF-8 mode only)
    +
    +The precise effect of \cx is as follows: if x is a lower case letter, it +is converted to upper case. Then bit 6 of the character (hex 40) is inverted. +Thus \cz becomes hex 1A, but \c{ becomes hex 3B, while \c; becomes hex +7B. +

    +

    +After \x, from zero to two hexadecimal digits are read (letters can be in +upper or lower case). In UTF-8 mode, any number of hexadecimal digits may +appear between \x{ and }, but the value of the character code must be less +than 2**31 (that is, the maximum hexadecimal value is 7FFFFFFF). If characters +other than hexadecimal digits appear between \x{ and }, or if there is no +terminating }, this form of escape is not recognized. Instead, the initial +\x will be interpreted as a basic hexadecimal escape, with no following +digits, giving a character whose value is zero. +

    +

    +Characters whose value is less than 256 can be defined by either of the two +syntaxes for \x when PCRE is in UTF-8 mode. There is no difference in the +way they are handled. For example, \xdc is exactly the same as \x{dc}. +

    +

    +After \0 up to two further octal digits are read. In both cases, if there +are fewer than two digits, just those that are present are used. Thus the +sequence \0\x\07 specifies two binary zeros followed by a BEL character +(code value 7). Make sure you supply two digits after the initial zero if the +pattern character that follows is itself an octal digit. +

    +

    +The handling of a backslash followed by a digit other than 0 is complicated. +Outside a character class, PCRE reads it and any following digits as a decimal +number. If the number is less than 10, or if there have been at least that many +previous capturing left parentheses in the expression, the entire sequence is +taken as a back reference. A description of how this works is given +later, +following the discussion of +parenthesized subpatterns. +

    +

    +Inside a character class, or if the decimal number is greater than 9 and there +have not been that many capturing subpatterns, PCRE re-reads up to three octal +digits following the backslash, and generates a single byte from the least +significant 8 bits of the value. Any subsequent digits stand for themselves. +For example: +

    +  \040   is another way of writing a space
    +  \40    is the same, provided there are fewer than 40 previous capturing subpatterns
    +  \7     is always a back reference
    +  \11    might be a back reference, or another way of writing a tab
    +  \011   is always a tab
    +  \0113  is a tab followed by the character "3"
    +  \113   might be a back reference, otherwise the character with octal code 113
    +  \377   might be a back reference, otherwise the byte consisting entirely of 1 bits
    +  \81    is either a back reference, or a binary zero followed by the two characters "8" and "1"
    +
    +Note that octal values of 100 or greater must not be introduced by a leading +zero, because no more than three octal digits are ever read. +

    +

    +All the sequences that define a single byte value or a single UTF-8 character +(in UTF-8 mode) can be used both inside and outside character classes. In +addition, inside a character class, the sequence \b is interpreted as the +backspace character (hex 08), and the sequence \X is interpreted as the +character "X". Outside a character class, these sequences have different +meanings +(see below). +

    +
    +Generic character types +
    +

    +The third use of backslash is for specifying generic character types. The +following are always recognized: +

    +  \d     any decimal digit
    +  \D     any character that is not a decimal digit
    +  \s     any whitespace character
    +  \S     any character that is not a whitespace character
    +  \w     any "word" character
    +  \W     any "non-word" character
    +
    +Each pair of escape sequences partitions the complete set of characters into +two disjoint sets. Any given character matches one, and only one, of each pair. +

    +

    +These character type sequences can appear both inside and outside character +classes. They each match one character of the appropriate type. If the current +matching point is at the end of the subject string, all of them fail, since +there is no character to match. +

    +

    +For compatibility with Perl, \s does not match the VT character (code 11). +This makes it different from the the POSIX "space" class. The \s characters +are HT (9), LF (10), FF (12), CR (13), and space (32). +

    +

    +A "word" character is an underscore or any character less than 256 that is a +letter or digit. The definition of letters and digits is controlled by PCRE's +low-valued character tables, and may vary if locale-specific matching is taking +place (see +"Locale support" +in the +pcreapi +page). For example, in the "fr_FR" (French) locale, some character codes +greater than 128 are used for accented letters, and these are matched by \w. +

    +

    +In UTF-8 mode, characters with values greater than 128 never match \d, \s, or +\w, and always match \D, \S, and \W. This is true even when Unicode +character property support is available. +

    +
    +Unicode character properties +
    +

    +When PCRE is built with Unicode character property support, three additional +escape sequences to match generic character types are available when UTF-8 mode +is selected. They are: +

    + \p{xx}   a character with the xx property
    + \P{xx}   a character without the xx property
    + \X       an extended Unicode sequence
    +
    +The property names represented by xx above are limited to the +Unicode general category properties. Each character has exactly one such +property, specified by a two-letter abbreviation. For compatibility with Perl, +negation can be specified by including a circumflex between the opening brace +and the property name. For example, \p{^Lu} is the same as \P{Lu}. +

    +

    +If only one letter is specified with \p or \P, it includes all the properties +that start with that letter. In this case, in the absence of negation, the +curly brackets in the escape sequence are optional; these two examples have +the same effect: +

    +  \p{L}
    +  \pL
    +
    +The following property codes are supported: +
    +  C     Other
    +  Cc    Control
    +  Cf    Format
    +  Cn    Unassigned
    +  Co    Private use
    +  Cs    Surrogate
    +
    +  L     Letter
    +  Ll    Lower case letter
    +  Lm    Modifier letter
    +  Lo    Other letter
    +  Lt    Title case letter
    +  Lu    Upper case letter
    +
    +  M     Mark
    +  Mc    Spacing mark
    +  Me    Enclosing mark
    +  Mn    Non-spacing mark
    +
    +  N     Number
    +  Nd    Decimal number
    +  Nl    Letter number
    +  No    Other number
    +
    +  P     Punctuation
    +  Pc    Connector punctuation
    +  Pd    Dash punctuation
    +  Pe    Close punctuation
    +  Pf    Final punctuation
    +  Pi    Initial punctuation
    +  Po    Other punctuation
    +  Ps    Open punctuation
    +
    +  S     Symbol
    +  Sc    Currency symbol
    +  Sk    Modifier symbol
    +  Sm    Mathematical symbol
    +  So    Other symbol
    +
    +  Z     Separator
    +  Zl    Line separator
    +  Zp    Paragraph separator
    +  Zs    Space separator
    +
    +Extended properties such as "Greek" or "InMusicalSymbols" are not supported by +PCRE. +

    +

    +Specifying caseless matching does not affect these escape sequences. For +example, \p{Lu} always matches only upper case letters. +

    +

    +The \X escape matches any number of Unicode characters that form an extended +Unicode sequence. \X is equivalent to +

    +  (?>\PM\pM*)
    +
    +That is, it matches a character without the "mark" property, followed by zero +or more characters with the "mark" property, and treats the sequence as an +atomic group +(see below). +Characters with the "mark" property are typically accents that affect the +preceding character. +

    +

    +Matching characters by Unicode property is not fast, because PCRE has to search +a structure that contains data for over fifteen thousand characters. That is +why the traditional escape sequences such as \d and \w do not use Unicode +properties in PCRE. +

    +
    +Simple assertions +
    +

    +The fourth use of backslash is for certain simple assertions. An assertion +specifies a condition that has to be met at a particular point in a match, +without consuming any characters from the subject string. The use of +subpatterns for more complicated assertions is described +below. +The backslashed +assertions are: +

    +  \b     matches at a word boundary
    +  \B     matches when not at a word boundary
    +  \A     matches at start of subject
    +  \Z     matches at end of subject or before newline at end
    +  \z     matches at end of subject
    +  \G     matches at first matching position in subject
    +
    +These assertions may not appear in character classes (but note that \b has a +different meaning, namely the backspace character, inside a character class). +

    +

    +A word boundary is a position in the subject string where the current character +and the previous character do not both match \w or \W (i.e. one matches +\w and the other matches \W), or the start or end of the string if the +first or last character matches \w, respectively. +

    +

    +The \A, \Z, and \z assertions differ from the traditional circumflex and +dollar (described in the next section) in that they only ever match at the very +start and end of the subject string, whatever options are set. Thus, they are +independent of multiline mode. These three assertions are not affected by the +PCRE_NOTBOL or PCRE_NOTEOL options, which affect only the behaviour of the +circumflex and dollar metacharacters. However, if the startoffset +argument of pcre_exec() is non-zero, indicating that matching is to start +at a point other than the beginning of the subject, \A can never match. The +difference between \Z and \z is that \Z matches before a newline that is the +last character of the string as well as at the end of the string, whereas \z +matches only at the end. +

    +

    +The \G assertion is true only when the current matching position is at the +start point of the match, as specified by the startoffset argument of +pcre_exec(). It differs from \A when the value of startoffset is +non-zero. By calling pcre_exec() multiple times with appropriate +arguments, you can mimic Perl's /g option, and it is in this kind of +implementation where \G can be useful. +

    +

    +Note, however, that PCRE's interpretation of \G, as the start of the current +match, is subtly different from Perl's, which defines it as the end of the +previous match. In Perl, these can be different when the previously matched +string was empty. Because PCRE does just one match at a time, it cannot +reproduce this behaviour. +

    +

    +If all the alternatives of a pattern begin with \G, the expression is anchored +to the starting match position, and the "anchored" flag is set in the compiled +regular expression. +

    +
    CIRCUMFLEX AND DOLLAR
    +

    +Outside a character class, in the default matching mode, the circumflex +character is an assertion that is true only if the current matching point is +at the start of the subject string. If the startoffset argument of +pcre_exec() is non-zero, circumflex can never match if the PCRE_MULTILINE +option is unset. Inside a character class, circumflex has an entirely different +meaning +(see below). +

    +

    +Circumflex need not be the first character of the pattern if a number of +alternatives are involved, but it should be the first thing in each alternative +in which it appears if the pattern is ever to match that branch. If all +possible alternatives start with a circumflex, that is, if the pattern is +constrained to match only at the start of the subject, it is said to be an +"anchored" pattern. (There are also other constructs that can cause a pattern +to be anchored.) +

    +

    +A dollar character is an assertion that is true only if the current matching +point is at the end of the subject string, or immediately before a newline +character that is the last character in the string (by default). Dollar need +not be the last character of the pattern if a number of alternatives are +involved, but it should be the last item in any branch in which it appears. +Dollar has no special meaning in a character class. +

    +

    +The meaning of dollar can be changed so that it matches only at the very end of +the string, by setting the PCRE_DOLLAR_ENDONLY option at compile time. This +does not affect the \Z assertion. +

    +

    +The meanings of the circumflex and dollar characters are changed if the +PCRE_MULTILINE option is set. When this is the case, they match immediately +after and immediately before an internal newline character, respectively, in +addition to matching at the start and end of the subject string. For example, +the pattern /^abc$/ matches the subject string "def\nabc" (where \n +represents a newline character) in multiline mode, but not otherwise. +Consequently, patterns that are anchored in single line mode because all +branches start with ^ are not anchored in multiline mode, and a match for +circumflex is possible when the startoffset argument of pcre_exec() +is non-zero. The PCRE_DOLLAR_ENDONLY option is ignored if PCRE_MULTILINE is +set. +

    +

    +Note that the sequences \A, \Z, and \z can be used to match the start and +end of the subject in both modes, and if all branches of a pattern start with +\A it is always anchored, whether PCRE_MULTILINE is set or not. +

    +
    FULL STOP (PERIOD, DOT)
    +

    +Outside a character class, a dot in the pattern matches any one character in +the subject, including a non-printing character, but not (by default) newline. +In UTF-8 mode, a dot matches any UTF-8 character, which might be more than one +byte long, except (by default) newline. If the PCRE_DOTALL option is set, +dots match newlines as well. The handling of dot is entirely independent of the +handling of circumflex and dollar, the only relationship being that they both +involve newline characters. Dot has no special meaning in a character class. +

    +
    MATCHING A SINGLE BYTE
    +

    +Outside a character class, the escape sequence \C matches any one byte, both +in and out of UTF-8 mode. Unlike a dot, it can match a newline. The feature is +provided in Perl in order to match individual bytes in UTF-8 mode. Because it +breaks up UTF-8 characters into individual bytes, what remains in the string +may be a malformed UTF-8 string. For this reason, the \C escape sequence is +best avoided. +

    +

    +PCRE does not allow \C to appear in lookbehind assertions +(described below), +because in UTF-8 mode this would make it impossible to calculate the length of +the lookbehind. +

    +
    SQUARE BRACKETS AND CHARACTER CLASSES
    +

    +An opening square bracket introduces a character class, terminated by a closing +square bracket. A closing square bracket on its own is not special. If a +closing square bracket is required as a member of the class, it should be the +first data character in the class (after an initial circumflex, if present) or +escaped with a backslash. +

    +

    +A character class matches a single character in the subject. In UTF-8 mode, the +character may occupy more than one byte. A matched character must be in the set +of characters defined by the class, unless the first character in the class +definition is a circumflex, in which case the subject character must not be in +the set defined by the class. If a circumflex is actually required as a member +of the class, ensure it is not the first character, or escape it with a +backslash. +

    +

    +For example, the character class [aeiou] matches any lower case vowel, while +[^aeiou] matches any character that is not a lower case vowel. Note that a +circumflex is just a convenient notation for specifying the characters that +are in the class by enumerating those that are not. A class that starts with a +circumflex is not an assertion: it still consumes a character from the subject +string, and therefore it fails if the current pointer is at the end of the +string. +

    +

    +In UTF-8 mode, characters with values greater than 255 can be included in a +class as a literal string of bytes, or by using the \x{ escaping mechanism. +

    +

    +When caseless matching is set, any letters in a class represent both their +upper case and lower case versions, so for example, a caseless [aeiou] matches +"A" as well as "a", and a caseless [^aeiou] does not match "A", whereas a +caseful version would. In UTF-8 mode, PCRE always understands the concept of +case for characters whose values are less than 128, so caseless matching is +always possible. For characters with higher values, the concept of case is +supported if PCRE is compiled with Unicode property support, but not otherwise. +If you want to use caseless matching for characters 128 and above, you must +ensure that PCRE is compiled with Unicode property support as well as with +UTF-8 support. +

    +

    +The newline character is never treated in any special way in character classes, +whatever the setting of the PCRE_DOTALL or PCRE_MULTILINE options is. A class +such as [^a] will always match a newline. +

    +

    +The minus (hyphen) character can be used to specify a range of characters in a +character class. For example, [d-m] matches any letter between d and m, +inclusive. If a minus character is required in a class, it must be escaped with +a backslash or appear in a position where it cannot be interpreted as +indicating a range, typically as the first or last character in the class. +

    +

    +It is not possible to have the literal character "]" as the end character of a +range. A pattern such as [W-]46] is interpreted as a class of two characters +("W" and "-") followed by a literal string "46]", so it would match "W46]" or +"-46]". However, if the "]" is escaped with a backslash it is interpreted as +the end of range, so [W-\]46] is interpreted as a class containing a range +followed by two other characters. The octal or hexadecimal representation of +"]" can also be used to end a range. +

    +

    +Ranges operate in the collating sequence of character values. They can also be +used for characters specified numerically, for example [\000-\037]. In UTF-8 +mode, ranges can include characters whose values are greater than 255, for +example [\x{100}-\x{2ff}]. +

    +

    +If a range that includes letters is used when caseless matching is set, it +matches the letters in either case. For example, [W-c] is equivalent to +[][\\^_`wxyzabc], matched caselessly, and in non-UTF-8 mode, if character +tables for the "fr_FR" locale are in use, [\xc8-\xcb] matches accented E +characters in both cases. In UTF-8 mode, PCRE supports the concept of case for +characters with values greater than 128 only when it is compiled with Unicode +property support. +

    +

    +The character types \d, \D, \p, \P, \s, \S, \w, and \W may also appear +in a character class, and add the characters that they match to the class. For +example, [\dABCDEF] matches any hexadecimal digit. A circumflex can +conveniently be used with the upper case character types to specify a more +restricted set of characters than the matching lower case type. For example, +the class [^\W_] matches any letter or digit, but not underscore. +

    +

    +The only metacharacters that are recognized in character classes are backslash, +hyphen (only where it can be interpreted as specifying a range), circumflex +(only at the start), opening square bracket (only when it can be interpreted as +introducing a POSIX class name - see the next section), and the terminating +closing square bracket. However, escaping other non-alphanumeric characters +does no harm. +

    +
    POSIX CHARACTER CLASSES
    +

    +Perl supports the POSIX notation for character classes. This uses names +enclosed by [: and :] within the enclosing square brackets. PCRE also supports +this notation. For example, +

    +  [01[:alpha:]%]
    +
    +matches "0", "1", any alphabetic character, or "%". The supported class names +are +
    +  alnum    letters and digits
    +  alpha    letters
    +  ascii    character codes 0 - 127
    +  blank    space or tab only
    +  cntrl    control characters
    +  digit    decimal digits (same as \d)
    +  graph    printing characters, excluding space
    +  lower    lower case letters
    +  print    printing characters, including space
    +  punct    printing characters, excluding letters and digits
    +  space    white space (not quite the same as \s)
    +  upper    upper case letters
    +  word     "word" characters (same as \w)
    +  xdigit   hexadecimal digits
    +
    +The "space" characters are HT (9), LF (10), VT (11), FF (12), CR (13), and +space (32). Notice that this list includes the VT character (code 11). This +makes "space" different to \s, which does not include VT (for Perl +compatibility). +

    +

    +The name "word" is a Perl extension, and "blank" is a GNU extension from Perl +5.8. Another Perl extension is negation, which is indicated by a ^ character +after the colon. For example, +

    +  [12[:^digit:]]
    +
    +matches "1", "2", or any non-digit. PCRE (and Perl) also recognize the POSIX +syntax [.ch.] and [=ch=] where "ch" is a "collating element", but these are not +supported, and an error is given if they are encountered. +

    +

    +In UTF-8 mode, characters with values greater than 128 do not match any of +the POSIX character classes. +

    +
    VERTICAL BAR
    +

    +Vertical bar characters are used to separate alternative patterns. For example, +the pattern +

    +  gilbert|sullivan
    +
    +matches either "gilbert" or "sullivan". Any number of alternatives may appear, +and an empty alternative is permitted (matching the empty string). +The matching process tries each alternative in turn, from left to right, +and the first one that succeeds is used. If the alternatives are within a +subpattern +(defined below), +"succeeds" means matching the rest of the main pattern as well as the +alternative in the subpattern. +

    +
    INTERNAL OPTION SETTING
    +

    +The settings of the PCRE_CASELESS, PCRE_MULTILINE, PCRE_DOTALL, and +PCRE_EXTENDED options can be changed from within the pattern by a sequence of +Perl option letters enclosed between "(?" and ")". The option letters are +

    +  i  for PCRE_CASELESS
    +  m  for PCRE_MULTILINE
    +  s  for PCRE_DOTALL
    +  x  for PCRE_EXTENDED
    +
    +For example, (?im) sets caseless, multiline matching. It is also possible to +unset these options by preceding the letter with a hyphen, and a combined +setting and unsetting such as (?im-sx), which sets PCRE_CASELESS and +PCRE_MULTILINE while unsetting PCRE_DOTALL and PCRE_EXTENDED, is also +permitted. If a letter appears both before and after the hyphen, the option is +unset. +

    +

    +When an option change occurs at top level (that is, not inside subpattern +parentheses), the change applies to the remainder of the pattern that follows. +If the change is placed right at the start of a pattern, PCRE extracts it into +the global options (and it will therefore show up in data extracted by the +pcre_fullinfo() function). +

    +

    +An option change within a subpattern affects only that part of the current +pattern that follows it, so +

    +  (a(?i)b)c
    +
    +matches abc and aBc and no other strings (assuming PCRE_CASELESS is not used). +By this means, options can be made to have different settings in different +parts of the pattern. Any changes made in one alternative do carry on +into subsequent branches within the same subpattern. For example, +
    +  (a(?i)b|c)
    +
    +matches "ab", "aB", "c", and "C", even though when matching "C" the first +branch is abandoned before the option setting. This is because the effects of +option settings happen at compile time. There would be some very weird +behaviour otherwise. +

    +

    +The PCRE-specific options PCRE_UNGREEDY and PCRE_EXTRA can be changed in the +same way as the Perl-compatible options by using the characters U and X +respectively. The (?X) flag setting is special in that it must always occur +earlier in the pattern than any of the additional features it turns on, even +when it is at top level. It is best to put it at the start. +

    +
    SUBPATTERNS
    +

    +Subpatterns are delimited by parentheses (round brackets), which can be nested. +Turning part of a pattern into a subpattern does two things: +
    +
    +1. It localizes a set of alternatives. For example, the pattern +

    +  cat(aract|erpillar|)
    +
    +matches one of the words "cat", "cataract", or "caterpillar". Without the +parentheses, it would match "cataract", "erpillar" or the empty string. +
    +
    +2. It sets up the subpattern as a capturing subpattern. This means that, when +the whole pattern matches, that portion of the subject string that matched the +subpattern is passed back to the caller via the ovector argument of +pcre_exec(). Opening parentheses are counted from left to right (starting +from 1) to obtain numbers for the capturing subpatterns. +

    +

    +For example, if the string "the red king" is matched against the pattern +

    +  the ((red|white) (king|queen))
    +
    +the captured substrings are "red king", "red", and "king", and are numbered 1, +2, and 3, respectively. +

    +

    +The fact that plain parentheses fulfil two functions is not always helpful. +There are often times when a grouping subpattern is required without a +capturing requirement. If an opening parenthesis is followed by a question mark +and a colon, the subpattern does not do any capturing, and is not counted when +computing the number of any subsequent capturing subpatterns. For example, if +the string "the white queen" is matched against the pattern +

    +  the ((?:red|white) (king|queen))
    +
    +the captured substrings are "white queen" and "queen", and are numbered 1 and +2. The maximum number of capturing subpatterns is 65535, and the maximum depth +of nesting of all subpatterns, both capturing and non-capturing, is 200. +

    +

    +As a convenient shorthand, if any option settings are required at the start of +a non-capturing subpattern, the option letters may appear between the "?" and +the ":". Thus the two patterns +

    +  (?i:saturday|sunday)
    +  (?:(?i)saturday|sunday)
    +
    +match exactly the same set of strings. Because alternative branches are tried +from left to right, and options are not reset until the end of the subpattern +is reached, an option setting in one branch does affect subsequent branches, so +the above patterns match "SUNDAY" as well as "Saturday". +

    +
    NAMED SUBPATTERNS
    +

    +Identifying capturing parentheses by number is simple, but it can be very hard +to keep track of the numbers in complicated regular expressions. Furthermore, +if an expression is modified, the numbers may change. To help with this +difficulty, PCRE supports the naming of subpatterns, something that Perl does +not provide. The Python syntax (?P<name>...) is used. Names consist of +alphanumeric characters and underscores, and must be unique within a pattern. +

    +

    +Named capturing parentheses are still allocated numbers as well as names. The +PCRE API provides function calls for extracting the name-to-number translation +table from a compiled pattern. There is also a convenience function for +extracting a captured substring by name. For further details see the +pcreapi +documentation. +

    +
    REPETITION
    +

    +Repetition is specified by quantifiers, which can follow any of the following +items: +

    +  a literal data character
    +  the . metacharacter
    +  the \C escape sequence
    +  the \X escape sequence (in UTF-8 mode with Unicode properties)
    +  an escape such as \d that matches a single character
    +  a character class
    +  a back reference (see next section)
    +  a parenthesized subpattern (unless it is an assertion)
    +
    +The general repetition quantifier specifies a minimum and maximum number of +permitted matches, by giving the two numbers in curly brackets (braces), +separated by a comma. The numbers must be less than 65536, and the first must +be less than or equal to the second. For example: +
    +  z{2,4}
    +
    +matches "zz", "zzz", or "zzzz". A closing brace on its own is not a special +character. If the second number is omitted, but the comma is present, there is +no upper limit; if the second number and the comma are both omitted, the +quantifier specifies an exact number of required matches. Thus +
    +  [aeiou]{3,}
    +
    +matches at least 3 successive vowels, but may match many more, while +
    +  \d{8}
    +
    +matches exactly 8 digits. An opening curly bracket that appears in a position +where a quantifier is not allowed, or one that does not match the syntax of a +quantifier, is taken as a literal character. For example, {,6} is not a +quantifier, but a literal string of four characters. +

    +

    +In UTF-8 mode, quantifiers apply to UTF-8 characters rather than to individual +bytes. Thus, for example, \x{100}{2} matches two UTF-8 characters, each of +which is represented by a two-byte sequence. Similarly, when Unicode property +support is available, \X{3} matches three Unicode extended sequences, each of +which may be several bytes long (and they may be of different lengths). +

    +

    +The quantifier {0} is permitted, causing the expression to behave as if the +previous item and the quantifier were not present. +

    +

    +For convenience (and historical compatibility) the three most common +quantifiers have single-character abbreviations: +

    +  *    is equivalent to {0,}
    +  +    is equivalent to {1,}
    +  ?    is equivalent to {0,1}
    +
    +It is possible to construct infinite loops by following a subpattern that can +match no characters with a quantifier that has no upper limit, for example: +
    +  (a?)*
    +
    +Earlier versions of Perl and PCRE used to give an error at compile time for +such patterns. However, because there are cases where this can be useful, such +patterns are now accepted, but if any repetition of the subpattern does in fact +match no characters, the loop is forcibly broken. +

    +

    +By default, the quantifiers are "greedy", that is, they match as much as +possible (up to the maximum number of permitted times), without causing the +rest of the pattern to fail. The classic example of where this gives problems +is in trying to match comments in C programs. These appear between /* and */ +and within the comment, individual * and / characters may appear. An attempt to +match C comments by applying the pattern +

    +  /\*.*\*/
    +
    +to the string +
    +  /* first comment */  not comment  /* second comment */
    +
    +fails, because it matches the entire string owing to the greediness of the .* +item. +

    +

    +However, if a quantifier is followed by a question mark, it ceases to be +greedy, and instead matches the minimum number of times possible, so the +pattern +

    +  /\*.*?\*/
    +
    +does the right thing with the C comments. The meaning of the various +quantifiers is not otherwise changed, just the preferred number of matches. +Do not confuse this use of question mark with its use as a quantifier in its +own right. Because it has two uses, it can sometimes appear doubled, as in +
    +  \d??\d
    +
    +which matches one digit by preference, but can match two if that is the only +way the rest of the pattern matches. +

    +

    +If the PCRE_UNGREEDY option is set (an option which is not available in Perl), +the quantifiers are not greedy by default, but individual ones can be made +greedy by following them with a question mark. In other words, it inverts the +default behaviour. +

    +

    +When a parenthesized subpattern is quantified with a minimum repeat count that +is greater than 1 or with a limited maximum, more memory is required for the +compiled pattern, in proportion to the size of the minimum or maximum. +

    +

    +If a pattern starts with .* or .{0,} and the PCRE_DOTALL option (equivalent +to Perl's /s) is set, thus allowing the . to match newlines, the pattern is +implicitly anchored, because whatever follows will be tried against every +character position in the subject string, so there is no point in retrying the +overall match at any position after the first. PCRE normally treats such a +pattern as though it were preceded by \A. +

    +

    +In cases where it is known that the subject string contains no newlines, it is +worth setting PCRE_DOTALL in order to obtain this optimization, or +alternatively using ^ to indicate anchoring explicitly. +

    +

    +However, there is one situation where the optimization cannot be used. When .* +is inside capturing parentheses that are the subject of a backreference +elsewhere in the pattern, a match at the start may fail, and a later one +succeed. Consider, for example: +

    +  (.*)abc\1
    +
    +If the subject is "xyz123abc123" the match point is the fourth character. For +this reason, such a pattern is not implicitly anchored. +

    +

    +When a capturing subpattern is repeated, the value captured is the substring +that matched the final iteration. For example, after +

    +  (tweedle[dume]{3}\s*)+
    +
    +has matched "tweedledum tweedledee" the value of the captured substring is +"tweedledee". However, if there are nested capturing subpatterns, the +corresponding captured values may have been set in previous iterations. For +example, after +
    +  /(a|(b))+/
    +
    +matches "aba" the value of the second captured substring is "b". +

    +
    ATOMIC GROUPING AND POSSESSIVE QUANTIFIERS
    +

    +With both maximizing and minimizing repetition, failure of what follows +normally causes the repeated item to be re-evaluated to see if a different +number of repeats allows the rest of the pattern to match. Sometimes it is +useful to prevent this, either to change the nature of the match, or to cause +it fail earlier than it otherwise might, when the author of the pattern knows +there is no point in carrying on. +

    +

    +Consider, for example, the pattern \d+foo when applied to the subject line +

    +  123456bar
    +
    +After matching all 6 digits and then failing to match "foo", the normal +action of the matcher is to try again with only 5 digits matching the \d+ +item, and then with 4, and so on, before ultimately failing. "Atomic grouping" +(a term taken from Jeffrey Friedl's book) provides the means for specifying +that once a subpattern has matched, it is not to be re-evaluated in this way. +

    +

    +If we use atomic grouping for the previous example, the matcher would give up +immediately on failing to match "foo" the first time. The notation is a kind of +special parenthesis, starting with (?> as in this example: +

    +  (?>\d+)foo
    +
    +This kind of parenthesis "locks up" the part of the pattern it contains once +it has matched, and a failure further into the pattern is prevented from +backtracking into it. Backtracking past it to previous items, however, works as +normal. +

    +

    +An alternative description is that a subpattern of this type matches the string +of characters that an identical standalone pattern would match, if anchored at +the current point in the subject string. +

    +

    +Atomic grouping subpatterns are not capturing subpatterns. Simple cases such as +the above example can be thought of as a maximizing repeat that must swallow +everything it can. So, while both \d+ and \d+? are prepared to adjust the +number of digits they match in order to make the rest of the pattern match, +(?>\d+) can only match an entire sequence of digits. +

    +

    +Atomic groups in general can of course contain arbitrarily complicated +subpatterns, and can be nested. However, when the subpattern for an atomic +group is just a single repeated item, as in the example above, a simpler +notation, called a "possessive quantifier" can be used. This consists of an +additional + character following a quantifier. Using this notation, the +previous example can be rewritten as +

    +  \d++foo
    +
    +Possessive quantifiers are always greedy; the setting of the PCRE_UNGREEDY +option is ignored. They are a convenient notation for the simpler forms of +atomic group. However, there is no difference in the meaning or processing of a +possessive quantifier and the equivalent atomic group. +

    +

    +The possessive quantifier syntax is an extension to the Perl syntax. It +originates in Sun's Java package. +

    +

    +When a pattern contains an unlimited repeat inside a subpattern that can itself +be repeated an unlimited number of times, the use of an atomic group is the +only way to avoid some failing matches taking a very long time indeed. The +pattern +

    +  (\D+|<\d+>)*[!?]
    +
    +matches an unlimited number of substrings that either consist of non-digits, or +digits enclosed in <>, followed by either ! or ?. When it matches, it runs +quickly. However, if it is applied to +
    +  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    +
    +it takes a long time before reporting failure. This is because the string can +be divided between the internal \D+ repeat and the external * repeat in a +large number of ways, and all have to be tried. (The example uses [!?] rather +than a single character at the end, because both PCRE and Perl have an +optimization that allows for fast failure when a single character is used. They +remember the last single character that is required for a match, and fail early +if it is not present in the string.) If the pattern is changed so that it uses +an atomic group, like this: +
    +  ((?>\D+)|<\d+>)*[!?]
    +
    +sequences of non-digits cannot be broken, and failure happens quickly. +

    +
    BACK REFERENCES
    +

    +Outside a character class, a backslash followed by a digit greater than 0 (and +possibly further digits) is a back reference to a capturing subpattern earlier +(that is, to its left) in the pattern, provided there have been that many +previous capturing left parentheses. +

    +

    +However, if the decimal number following the backslash is less than 10, it is +always taken as a back reference, and causes an error only if there are not +that many capturing left parentheses in the entire pattern. In other words, the +parentheses that are referenced need not be to the left of the reference for +numbers less than 10. See the subsection entitled "Non-printing characters" +above +for further details of the handling of digits following a backslash. +

    +

    +A back reference matches whatever actually matched the capturing subpattern in +the current subject string, rather than anything matching the subpattern +itself (see +"Subpatterns as subroutines" +below for a way of doing that). So the pattern +

    +  (sens|respons)e and \1ibility
    +
    +matches "sense and sensibility" and "response and responsibility", but not +"sense and responsibility". If caseful matching is in force at the time of the +back reference, the case of letters is relevant. For example, +
    +  ((?i)rah)\s+\1
    +
    +matches "rah rah" and "RAH RAH", but not "RAH rah", even though the original +capturing subpattern is matched caselessly. +

    +

    +Back references to named subpatterns use the Python syntax (?P=name). We could +rewrite the above example as follows: +

    +  (?<p1>(?i)rah)\s+(?P=p1)
    +
    +There may be more than one back reference to the same subpattern. If a +subpattern has not actually been used in a particular match, any back +references to it always fail. For example, the pattern +
    +  (a|(bc))\2
    +
    +always fails if it starts to match "a" rather than "bc". Because there may be +many capturing parentheses in a pattern, all digits following the backslash are +taken as part of a potential back reference number. If the pattern continues +with a digit character, some delimiter must be used to terminate the back +reference. If the PCRE_EXTENDED option is set, this can be whitespace. +Otherwise an empty comment (see +"Comments" +below) can be used. +

    +

    +A back reference that occurs inside the parentheses to which it refers fails +when the subpattern is first used, so, for example, (a\1) never matches. +However, such references can be useful inside repeated subpatterns. For +example, the pattern +

    +  (a|b\1)+
    +
    +matches any number of "a"s and also "aba", "ababbaa" etc. At each iteration of +the subpattern, the back reference matches the character string corresponding +to the previous iteration. In order for this to work, the pattern must be such +that the first iteration does not need to match the back reference. This can be +done using alternation, as in the example above, or by a quantifier with a +minimum of zero. +

    +
    ASSERTIONS
    +

    +An assertion is a test on the characters following or preceding the current +matching point that does not actually consume any characters. The simple +assertions coded as \b, \B, \A, \G, \Z, \z, ^ and $ are described +above. +

    +

    +More complicated assertions are coded as subpatterns. There are two kinds: +those that look ahead of the current position in the subject string, and those +that look behind it. An assertion subpattern is matched in the normal way, +except that it does not cause the current matching position to be changed. +

    +

    +Assertion subpatterns are not capturing subpatterns, and may not be repeated, +because it makes no sense to assert the same thing several times. If any kind +of assertion contains capturing subpatterns within it, these are counted for +the purposes of numbering the capturing subpatterns in the whole pattern. +However, substring capturing is carried out only for positive assertions, +because it does not make sense for negative assertions. +

    +
    +Lookahead assertions +
    +

    +Lookahead assertions start +with (?= for positive assertions and (?! for negative assertions. For example, +

    +  \w+(?=;)
    +
    +matches a word followed by a semicolon, but does not include the semicolon in +the match, and +
    +  foo(?!bar)
    +
    +matches any occurrence of "foo" that is not followed by "bar". Note that the +apparently similar pattern +
    +  (?!foo)bar
    +
    +does not find an occurrence of "bar" that is preceded by something other than +"foo"; it finds any occurrence of "bar" whatsoever, because the assertion +(?!foo) is always true when the next three characters are "bar". A +lookbehind assertion is needed to achieve the other effect. +

    +

    +If you want to force a matching failure at some point in a pattern, the most +convenient way to do it is with (?!) because an empty string always matches, so +an assertion that requires there not to be an empty string must always fail. +

    +
    +Lookbehind assertions +
    +

    +Lookbehind assertions start with (?<= for positive assertions and (?<! for +negative assertions. For example, +

    +  (?<!foo)bar
    +
    +does find an occurrence of "bar" that is not preceded by "foo". The contents of +a lookbehind assertion are restricted such that all the strings it matches must +have a fixed length. However, if there are several alternatives, they do not +all have to have the same fixed length. Thus +
    +  (?<=bullock|donkey)
    +
    +is permitted, but +
    +  (?<!dogs?|cats?)
    +
    +causes an error at compile time. Branches that match different length strings +are permitted only at the top level of a lookbehind assertion. This is an +extension compared with Perl (at least for 5.8), which requires all branches to +match the same length of string. An assertion such as +
    +  (?<=ab(c|de))
    +
    +is not permitted, because its single top-level branch can match two different +lengths, but it is acceptable if rewritten to use two top-level branches: +
    +  (?<=abc|abde)
    +
    +The implementation of lookbehind assertions is, for each alternative, to +temporarily move the current position back by the fixed width and then try to +match. If there are insufficient characters before the current position, the +match is deemed to fail. +

    +

    +PCRE does not allow the \C escape (which matches a single byte in UTF-8 mode) +to appear in lookbehind assertions, because it makes it impossible to calculate +the length of the lookbehind. The \X escape, which can match different numbers +of bytes, is also not permitted. +

    +

    +Atomic groups can be used in conjunction with lookbehind assertions to specify +efficient matching at the end of the subject string. Consider a simple pattern +such as +

    +  abcd$
    +
    +when applied to a long string that does not match. Because matching proceeds +from left to right, PCRE will look for each "a" in the subject and then see if +what follows matches the rest of the pattern. If the pattern is specified as +
    +  ^.*abcd$
    +
    +the initial .* matches the entire string at first, but when this fails (because +there is no following "a"), it backtracks to match all but the last character, +then all but the last two characters, and so on. Once again the search for "a" +covers the entire string, from right to left, so we are no better off. However, +if the pattern is written as +
    +  ^(?>.*)(?<=abcd)
    +
    +or, equivalently, using the possessive quantifier syntax, +
    +  ^.*+(?<=abcd)
    +
    +there can be no backtracking for the .* item; it can match only the entire +string. The subsequent lookbehind assertion does a single test on the last four +characters. If it fails, the match fails immediately. For long strings, this +approach makes a significant difference to the processing time. +

    +
    +Using multiple assertions +
    +

    +Several assertions (of any sort) may occur in succession. For example, +

    +  (?<=\d{3})(?<!999)foo
    +
    +matches "foo" preceded by three digits that are not "999". Notice that each of +the assertions is applied independently at the same point in the subject +string. First there is a check that the previous three characters are all +digits, and then there is a check that the same three characters are not "999". +This pattern does not match "foo" preceded by six characters, the first +of which are digits and the last three of which are not "999". For example, it +doesn't match "123abcfoo". A pattern to do that is +
    +  (?<=\d{3}...)(?<!999)foo
    +
    +This time the first assertion looks at the preceding six characters, checking +that the first three are digits, and then the second assertion checks that the +preceding three characters are not "999". +

    +

    +Assertions can be nested in any combination. For example, +

    +  (?<=(?<!foo)bar)baz
    +
    +matches an occurrence of "baz" that is preceded by "bar" which in turn is not +preceded by "foo", while +
    +  (?<=\d{3}(?!999)...)foo
    +
    +is another pattern that matches "foo" preceded by three digits and any three +characters that are not "999". +

    +
    CONDITIONAL SUBPATTERNS
    +

    +It is possible to cause the matching process to obey a subpattern +conditionally or to choose between two alternative subpatterns, depending on +the result of an assertion, or whether a previous capturing subpattern matched +or not. The two possible forms of conditional subpattern are +

    +  (?(condition)yes-pattern)
    +  (?(condition)yes-pattern|no-pattern)
    +
    +If the condition is satisfied, the yes-pattern is used; otherwise the +no-pattern (if present) is used. If there are more than two alternatives in the +subpattern, a compile-time error occurs. +

    +

    +There are three kinds of condition. If the text between the parentheses +consists of a sequence of digits, the condition is satisfied if the capturing +subpattern of that number has previously matched. The number must be greater +than zero. Consider the following pattern, which contains non-significant white +space to make it more readable (assume the PCRE_EXTENDED option) and to divide +it into three parts for ease of discussion: +

    +  ( \( )?    [^()]+    (?(1) \) )
    +
    +The first part matches an optional opening parenthesis, and if that +character is present, sets it as the first captured substring. The second part +matches one or more characters that are not parentheses. The third part is a +conditional subpattern that tests whether the first set of parentheses matched +or not. If they did, that is, if subject started with an opening parenthesis, +the condition is true, and so the yes-pattern is executed and a closing +parenthesis is required. Otherwise, since no-pattern is not present, the +subpattern matches nothing. In other words, this pattern matches a sequence of +non-parentheses, optionally enclosed in parentheses. +

    +

    +If the condition is the string (R), it is satisfied if a recursive call to the +pattern or subpattern has been made. At "top level", the condition is false. +This is a PCRE extension. Recursive patterns are described in the next section. +

    +

    +If the condition is not a sequence of digits or (R), it must be an assertion. +This may be a positive or negative lookahead or lookbehind assertion. Consider +this pattern, again containing non-significant white space, and with the two +alternatives on the second line: +

    +  (?(?=[^a-z]*[a-z])
    +  \d{2}-[a-z]{3}-\d{2}  |  \d{2}-\d{2}-\d{2} )
    +
    +The condition is a positive lookahead assertion that matches an optional +sequence of non-letters followed by a letter. In other words, it tests for the +presence of at least one letter in the subject. If a letter is found, the +subject is matched against the first alternative; otherwise it is matched +against the second. This pattern matches strings in one of the two forms +dd-aaa-dd or dd-dd-dd, where aaa are letters and dd are digits. +

    +
    COMMENTS
    +

    +The sequence (?# marks the start of a comment that continues up to the next +closing parenthesis. Nested parentheses are not permitted. The characters +that make up a comment play no part in the pattern matching at all. +

    +

    +If the PCRE_EXTENDED option is set, an unescaped # character outside a +character class introduces a comment that continues up to the next newline +character in the pattern. +

    +
    RECURSIVE PATTERNS
    +

    +Consider the problem of matching a string in parentheses, allowing for +unlimited nested parentheses. Without the use of recursion, the best that can +be done is to use a pattern that matches up to some fixed depth of nesting. It +is not possible to handle an arbitrary nesting depth. Perl provides a facility +that allows regular expressions to recurse (amongst other things). It does this +by interpolating Perl code in the expression at run time, and the code can +refer to the expression itself. A Perl pattern to solve the parentheses problem +can be created like this: +

    +  $re = qr{\( (?: (?>[^()]+) | (?p{$re}) )* \)}x;
    +
    +The (?p{...}) item interpolates Perl code at run time, and in this case refers +recursively to the pattern in which it appears. Obviously, PCRE cannot support +the interpolation of Perl code. Instead, it supports some special syntax for +recursion of the entire pattern, and also for individual subpattern recursion. +

    +

    +The special item that consists of (? followed by a number greater than zero and +a closing parenthesis is a recursive call of the subpattern of the given +number, provided that it occurs inside that subpattern. (If not, it is a +"subroutine" call, which is described in the next section.) The special item +(?R) is a recursive call of the entire regular expression. +

    +

    +For example, this PCRE pattern solves the nested parentheses problem (assume +the PCRE_EXTENDED option is set so that white space is ignored): +

    +  \( ( (?>[^()]+) | (?R) )* \)
    +
    +First it matches an opening parenthesis. Then it matches any number of +substrings which can either be a sequence of non-parentheses, or a recursive +match of the pattern itself (that is a correctly parenthesized substring). +Finally there is a closing parenthesis. +

    +

    +If this were part of a larger pattern, you would not want to recurse the entire +pattern, so instead you could use this: +

    +  ( \( ( (?>[^()]+) | (?1) )* \) )
    +
    +We have put the pattern into parentheses, and caused the recursion to refer to +them instead of the whole pattern. In a larger pattern, keeping track of +parenthesis numbers can be tricky. It may be more convenient to use named +parentheses instead. For this, PCRE uses (?P>name), which is an extension to +the Python syntax that PCRE uses for named parentheses (Perl does not provide +named parentheses). We could rewrite the above example as follows: +
    +  (?P<pn> \( ( (?>[^()]+) | (?P>pn) )* \) )
    +
    +This particular example pattern contains nested unlimited repeats, and so the +use of atomic grouping for matching strings of non-parentheses is important +when applying the pattern to strings that do not match. For example, when this +pattern is applied to +
    +  (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()
    +
    +it yields "no match" quickly. However, if atomic grouping is not used, +the match runs for a very long time indeed because there are so many different +ways the + and * repeats can carve up the subject, and all have to be tested +before failure can be reported. +

    +

    +At the end of a match, the values set for any capturing subpatterns are those +from the outermost level of the recursion at which the subpattern value is set. +If you want to obtain intermediate values, a callout function can be used (see +the next section and the +pcrecallout +documentation). If the pattern above is matched against +

    +  (ab(cd)ef)
    +
    +the value for the capturing parentheses is "ef", which is the last value taken +on at the top level. If additional parentheses are added, giving +
    +  \( ( ( (?>[^()]+) | (?R) )* ) \)
    +     ^                        ^
    +     ^                        ^
    +
    +the string they capture is "ab(cd)ef", the contents of the top level +parentheses. If there are more than 15 capturing parentheses in a pattern, PCRE +has to obtain extra memory to store data during a recursion, which it does by +using pcre_malloc, freeing it via pcre_free afterwards. If no +memory can be obtained, the match fails with the PCRE_ERROR_NOMEMORY error. +

    +

    +Do not confuse the (?R) item with the condition (R), which tests for recursion. +Consider this pattern, which matches text in angle brackets, allowing for +arbitrary nesting. Only digits are allowed in nested brackets (that is, when +recursing), whereas any characters are permitted at the outer level. +

    +  < (?: (?(R) \d++  | [^<>]*+) | (?R)) * >
    +
    +In this pattern, (?(R) is the start of a conditional subpattern, with two +different alternatives for the recursive and non-recursive cases. The (?R) item +is the actual recursive call. +

    +
    SUBPATTERNS AS SUBROUTINES
    +

    +If the syntax for a recursive subpattern reference (either by number or by +name) is used outside the parentheses to which it refers, it operates like a +subroutine in a programming language. An earlier example pointed out that the +pattern +

    +  (sens|respons)e and \1ibility
    +
    +matches "sense and sensibility" and "response and responsibility", but not +"sense and responsibility". If instead the pattern +
    +  (sens|respons)e and (?1)ibility
    +
    +is used, it does match "sense and responsibility" as well as the other two +strings. Such references must, however, follow the subpattern to which they +refer. +

    +
    CALLOUTS
    +

    +Perl has a feature whereby using the sequence (?{...}) causes arbitrary Perl +code to be obeyed in the middle of matching a regular expression. This makes it +possible, amongst other things, to extract different substrings that match the +same pair of parentheses when there is a repetition. +

    +

    +PCRE provides a similar feature, but of course it cannot obey arbitrary Perl +code. The feature is called "callout". The caller of PCRE provides an external +function by putting its entry point in the global variable pcre_callout. +By default, this variable contains NULL, which disables all calling out. +

    +

    +Within a regular expression, (?C) indicates the points at which the external +function is to be called. If you want to identify different callout points, you +can put a number less than 256 after the letter C. The default value is zero. +For example, this pattern has two callout points: +

    +  (?C1)\dabc(?C2)def
    +
    +If the PCRE_AUTO_CALLOUT flag is passed to pcre_compile(), callouts are +automatically installed before each item in the pattern. They are all numbered +255. +

    +

    +During matching, when PCRE reaches a callout point (and pcre_callout is +set), the external function is called. It is provided with the number of the +callout, the position in the pattern, and, optionally, one item of data +originally supplied by the caller of pcre_exec(). The callout function +may cause matching to proceed, to backtrack, or to fail altogether. A complete +description of the interface to the callout function is given in the +pcrecallout +documentation. +

    +

    +Last updated: 28 February 2005 +
    +Copyright © 1997-2005 University of Cambridge. +

    +Return to the PCRE index page. +

    diff --git a/mozilla/js/tamarin/pcre/doc/html/pcreperform.html b/mozilla/js/tamarin/pcre/doc/html/pcreperform.html new file mode 100644 index 00000000000..e97e748f1f4 --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/html/pcreperform.html @@ -0,0 +1,97 @@ + + +pcreperform specification + + +

    pcreperform man page

    +

    +Return to the PCRE index page. +

    +

    +This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
    +
    +PCRE PERFORMANCE +
    +

    +Certain items that may appear in regular expression patterns are more efficient +than others. It is more efficient to use a character class like [aeiou] than a +set of alternatives such as (a|e|i|o|u). In general, the simplest construction +that provides the required behaviour is usually the most efficient. Jeffrey +Friedl's book contains a lot of useful general discussion about optimizing +regular expressions for efficient performance. This document contains a few +observations about PCRE. +

    +

    +Using Unicode character properties (the \p, \P, and \X escapes) is slow, +because PCRE has to scan a structure that contains data for over fifteen +thousand characters whenever it needs a character's property. If you can find +an alternative pattern that does not use character properties, it will probably +be faster. +

    +

    +When a pattern begins with .* not in parentheses, or in parentheses that are +not the subject of a backreference, and the PCRE_DOTALL option is set, the +pattern is implicitly anchored by PCRE, since it can match only at the start of +a subject string. However, if PCRE_DOTALL is not set, PCRE cannot make this +optimization, because the . metacharacter does not then match a newline, and if +the subject string contains newlines, the pattern may match from the character +immediately following one of them instead of from the very start. For example, +the pattern +

    +  .*second
    +
    +matches the subject "first\nand second" (where \n stands for a newline +character), with the match starting at the seventh character. In order to do +this, PCRE has to retry the match starting after every newline in the subject. +

    +

    +If you are using such a pattern with subject strings that do not contain +newlines, the best performance is obtained by setting PCRE_DOTALL, or starting +the pattern with ^.* or ^.*? to indicate explicit anchoring. That saves PCRE +from having to scan along the subject looking for a newline to restart at. +

    +

    +Beware of patterns that contain nested indefinite repeats. These can take a +long time to run when applied to a string that does not match. Consider the +pattern fragment +

    +  (a+)*
    +
    +This can match "aaaa" in 33 different ways, and this number increases very +rapidly as the string gets longer. (The * repeat can match 0, 1, 2, 3, or 4 +times, and for each of those cases other than 0, the + repeats can match +different numbers of times.) When the remainder of the pattern is such that the +entire match is going to fail, PCRE has in principle to try every possible +variation, and this can take an extremely long time. +

    +

    +An optimization catches some of the more simple cases such as +

    +  (a+)*b
    +
    +where a literal character follows. Before embarking on the standard matching +procedure, PCRE checks that there is a "b" later in the subject string, and if +there is not, it fails the match immediately. However, when there is no +following literal this optimization cannot be used. You can see the difference +by comparing the behaviour of +
    +  (a+)*\d
    +
    +with the pattern above. The former gives a failure almost instantly when +applied to a whole line of "a" characters, whereas the latter takes an +appreciable time with strings longer than about 20 characters. +

    +

    +In many cases, the solution to this kind of performance issue is to use an +atomic group or a possessive quantifier. +

    +

    +Last updated: 28 February 2005 +
    +Copyright © 1997-2005 University of Cambridge. +

    +Return to the PCRE index page. +

    diff --git a/mozilla/js/tamarin/pcre/doc/html/pcreposix.html b/mozilla/js/tamarin/pcre/doc/html/pcreposix.html new file mode 100644 index 00000000000..53ea2aaf19d --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/html/pcreposix.html @@ -0,0 +1,223 @@ + + +pcreposix specification + + +

    pcreposix man page

    +

    +Return to the PCRE index page. +

    +

    +This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
    +

    +
    SYNOPSIS OF POSIX API
    +

    +#include <pcreposix.h> +

    +

    +int regcomp(regex_t *preg, const char *pattern, +int cflags); +

    +

    +int regexec(regex_t *preg, const char *string, +size_t nmatch, regmatch_t pmatch[], int eflags); +

    +

    +size_t regerror(int errcode, const regex_t *preg, +char *errbuf, size_t errbuf_size); +

    +

    +void regfree(regex_t *preg); +

    +
    DESCRIPTION
    +

    +This set of functions provides a POSIX-style API to the PCRE regular expression +package. See the +pcreapi +documentation for a description of PCRE's native API, which contains much +additional functionality. +

    +

    +The functions described here are just wrapper functions that ultimately call +the PCRE native API. Their prototypes are defined in the pcreposix.h +header file, and on Unix systems the library itself is called +pcreposix.a, so can be accessed by adding -lpcreposix to the +command for linking an application that uses them. Because the POSIX functions +call the native ones, it is also necessary to add -lpcre. +

    +

    +I have implemented only those option bits that can be reasonably mapped to PCRE +native options. In addition, the options REG_EXTENDED and REG_NOSUB are defined +with the value zero. They have no effect, but since programs that are written +to the POSIX interface often use them, this makes it easier to slot in PCRE as +a replacement library. Other POSIX options are not even defined. +

    +

    +When PCRE is called via these functions, it is only the API that is POSIX-like +in style. The syntax and semantics of the regular expressions themselves are +still those of Perl, subject to the setting of various PCRE options, as +described below. "POSIX-like in style" means that the API approximates to the +POSIX definition; it is not fully POSIX-compatible, and in multi-byte encoding +domains it is probably even less compatible. +

    +

    +The header for these functions is supplied as pcreposix.h to avoid any +potential clash with other POSIX libraries. It can, of course, be renamed or +aliased as regex.h, which is the "correct" name. It provides two +structure types, regex_t for compiled internal forms, and +regmatch_t for returning captured substrings. It also defines some +constants whose names start with "REG_"; these are used for setting options and +identifying error codes. +

    +

    +

    +
    COMPILING A PATTERN
    +

    +The function regcomp() is called to compile a pattern into an +internal form. The pattern is a C string terminated by a binary zero, and +is passed in the argument pattern. The preg argument is a pointer +to a regex_t structure that is used as a base for storing information +about the compiled expression. +

    +

    +The argument cflags is either zero, or contains one or more of the bits +defined by the following macros: +

    +  REG_DOTALL
    +
    +The PCRE_DOTALL option is set when the expression is passed for compilation to +the native function. Note that REG_DOTALL is not part of the POSIX standard. +
    +  REG_ICASE
    +
    +The PCRE_CASELESS option is set when the expression is passed for compilation +to the native function. +
    +  REG_NEWLINE
    +
    +The PCRE_MULTILINE option is set when the expression is passed for compilation +to the native function. Note that this does not mimic the defined POSIX +behaviour for REG_NEWLINE (see the following section). +

    +

    +In the absence of these flags, no options are passed to the native function. +This means the the regex is compiled with PCRE default semantics. In +particular, the way it handles newline characters in the subject string is the +Perl way, not the POSIX way. Note that setting PCRE_MULTILINE has only +some of the effects specified for REG_NEWLINE. It does not affect the way +newlines are matched by . (they aren't) or by a negative class such as [^a] +(they are). +

    +

    +The yield of regcomp() is zero on success, and non-zero otherwise. The +preg structure is filled in on success, and one member of the structure +is public: re_nsub contains the number of capturing subpatterns in +the regular expression. Various error codes are defined in the header file. +

    +
    MATCHING NEWLINE CHARACTERS
    +

    +This area is not simple, because POSIX and Perl take different views of things. +It is not possible to get PCRE to obey POSIX semantics, but then PCRE was never +intended to be a POSIX engine. The following table lists the different +possibilities for matching newline characters in PCRE: +

    +                          Default   Change with
    +
    +  . matches newline          no     PCRE_DOTALL
    +  newline matches [^a]       yes    not changeable
    +  $ matches \n at end        yes    PCRE_DOLLARENDONLY
    +  $ matches \n in middle     no     PCRE_MULTILINE
    +  ^ matches \n in middle     no     PCRE_MULTILINE
    +
    +This is the equivalent table for POSIX: +
    +                          Default   Change with
    +
    +  . matches newline          yes    REG_NEWLINE
    +  newline matches [^a]       yes    REG_NEWLINE
    +  $ matches \n at end        no     REG_NEWLINE
    +  $ matches \n in middle     no     REG_NEWLINE
    +  ^ matches \n in middle     no     REG_NEWLINE
    +
    +PCRE's behaviour is the same as Perl's, except that there is no equivalent for +PCRE_DOLLAR_ENDONLY in Perl. In both PCRE and Perl, there is no way to stop +newline from matching [^a]. +

    +

    +The default POSIX newline handling can be obtained by setting PCRE_DOTALL and +PCRE_DOLLAR_ENDONLY, but there is no way to make PCRE behave exactly as for the +REG_NEWLINE action. +

    +
    MATCHING A PATTERN
    +

    +The function regexec() is called to match a compiled pattern preg +against a given string, which is terminated by a zero byte, subject to +the options in eflags. These can be: +

    +  REG_NOTBOL
    +
    +The PCRE_NOTBOL option is set when calling the underlying PCRE matching +function. +
    +  REG_NOTEOL
    +
    +The PCRE_NOTEOL option is set when calling the underlying PCRE matching +function. +

    +

    +The portion of the string that was matched, and also any captured substrings, +are returned via the pmatch argument, which points to an array of +nmatch structures of type regmatch_t, containing the members +rm_so and rm_eo. These contain the offset to the first character of +each substring and the offset to the first character after the end of each +substring, respectively. The 0th element of the vector relates to the entire +portion of string that was matched; subsequent elements relate to the +capturing subpatterns of the regular expression. Unused entries in the array +have both structure members set to -1. +

    +

    +A successful match yields a zero return; various error codes are defined in the +header file, of which REG_NOMATCH is the "expected" failure code. +

    +
    ERROR MESSAGES
    +

    +The regerror() function maps a non-zero errorcode from either +regcomp() or regexec() to a printable message. If preg is not +NULL, the error should have arisen from the use of that structure. A message +terminated by a binary zero is placed in errbuf. The length of the +message, including the zero, is limited to errbuf_size. The yield of the +function is the size of buffer needed to hold the whole message. +

    +
    MEMORY USAGE
    +

    +Compiling a regular expression causes memory to be allocated and associated +with the preg structure. The function regfree() frees all such +memory, after which preg may no longer be used as a compiled expression. +

    +
    AUTHOR
    +

    +Philip Hazel +
    +University Computing Service, +
    +Cambridge CB2 3QG, England. +

    +

    +Last updated: 28 February 2005 +
    +Copyright © 1997-2005 University of Cambridge. +

    +Return to the PCRE index page. +

    diff --git a/mozilla/js/tamarin/pcre/doc/html/pcreprecompile.html b/mozilla/js/tamarin/pcre/doc/html/pcreprecompile.html new file mode 100644 index 00000000000..4cf8add21cd --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/html/pcreprecompile.html @@ -0,0 +1,135 @@ + + +pcreprecompile specification + + +

    pcreprecompile man page

    +

    +Return to the PCRE index page. +

    +

    +This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
    +

    +
    SAVING AND RE-USING PRECOMPILED PCRE PATTERNS
    +

    +If you are running an application that uses a large number of regular +expression patterns, it may be useful to store them in a precompiled form +instead of having to compile them every time the application is run. +If you are not using any private character tables (see the +pcre_maketables() +documentation), this is relatively straightforward. If you are using private +tables, it is a little bit more complicated. +

    +

    +If you save compiled patterns to a file, you can copy them to a different host +and run them there. This works even if the new host has the opposite endianness +to the one on which the patterns were compiled. There may be a small +performance penalty, but it should be insignificant. +

    +
    SAVING A COMPILED PATTERN
    +

    +The value returned by pcre_compile() points to a single block of memory +that holds the compiled pattern and associated data. You can find the length of +this block in bytes by calling pcre_fullinfo() with an argument of +PCRE_INFO_SIZE. You can then save the data in any appropriate manner. Here is +sample code that compiles a pattern and writes it to a file. It assumes that +the variable fd refers to a file that is open for output: +

    +  int erroroffset, rc, size;
    +  char *error;
    +  pcre *re;
    +
    +  re = pcre_compile("my pattern", 0, &error, &erroroffset, NULL);
    +  if (re == NULL) { ... handle errors ... }
    +  rc = pcre_fullinfo(re, NULL, PCRE_INFO_SIZE, &size);
    +  if (rc < 0) { ... handle errors ... }
    +  rc = fwrite(re, 1, size, fd);
    +  if (rc != size) { ... handle errors ... }
    +
    +In this example, the bytes that comprise the compiled pattern are copied +exactly. Note that this is binary data that may contain any of the 256 possible +byte values. On systems that make a distinction between binary and non-binary +data, be sure that the file is opened for binary output. +

    +

    +If you want to write more than one pattern to a file, you will have to devise a +way of separating them. For binary data, preceding each pattern with its length +is probably the most straightforward approach. Another possibility is to write +out the data in hexadecimal instead of binary, one pattern to a line. +

    +

    +Saving compiled patterns in a file is only one possible way of storing them for +later use. They could equally well be saved in a database, or in the memory of +some daemon process that passes them via sockets to the processes that want +them. +

    +

    +If the pattern has been studied, it is also possible to save the study data in +a similar way to the compiled pattern itself. When studying generates +additional information, pcre_study() returns a pointer to a +pcre_extra data block. Its format is defined in the +section on matching a pattern +in the +pcreapi +documentation. The study_data field points to the binary study data, and +this is what you must save (not the pcre_extra block itself). The length +of the study data can be obtained by calling pcre_fullinfo() with an +argument of PCRE_INFO_STUDYSIZE. Remember to check that pcre_study() did +return a non-NULL value before trying to save the study data. +

    +
    RE-USING A PRECOMPILED PATTERN
    +

    +Re-using a precompiled pattern is straightforward. Having reloaded it into main +memory, you pass its pointer to pcre_exec() or pcre_dfa_exec() in +the usual way. This should work even on another host, and even if that host has +the opposite endianness to the one where the pattern was compiled. +

    +

    +However, if you passed a pointer to custom character tables when the pattern +was compiled (the tableptr argument of pcre_compile()), you must +now pass a similar pointer to pcre_exec() or pcre_dfa_exec(), +because the value saved with the compiled pattern will obviously be nonsense. A +field in a pcre_extra() block is used to pass this data, as described in +the +section on matching a pattern +in the +pcreapi +documentation. +

    +

    +If you did not provide custom character tables when the pattern was compiled, +the pointer in the compiled pattern is NULL, which causes pcre_exec() to +use PCRE's internal tables. Thus, you do not need to take any special action at +run time in this case. +

    +

    +If you saved study data with the compiled pattern, you need to create your own +pcre_extra data block and set the study_data field to point to the +reloaded study data. You must also set the PCRE_EXTRA_STUDY_DATA bit in the +flags field to indicate that study data is present. Then pass the +pcre_extra block to pcre_exec() or pcre_dfa_exec() in the +usual way. +

    +
    COMPATIBILITY WITH DIFFERENT PCRE RELEASES
    +

    +The layout of the control block that is at the start of the data that makes up +a compiled pattern was changed for release 5.0. If you have any saved patterns +that were compiled with previous releases (not a facility that was previously +advertised), you will have to recompile them for release 5.0. However, from now +on, it should be possible to make changes in a compatible manner. +

    +

    +Last updated: 28 February 2005 +
    +Copyright © 1997-2005 University of Cambridge. +

    +Return to the PCRE index page. +

    diff --git a/mozilla/js/tamarin/pcre/doc/html/pcresample.html b/mozilla/js/tamarin/pcre/doc/html/pcresample.html new file mode 100644 index 00000000000..91cd41137db --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/html/pcresample.html @@ -0,0 +1,81 @@ + + +pcresample specification + + +

    pcresample man page

    +

    +Return to the PCRE index page. +

    +

    +This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
    +
    +PCRE SAMPLE PROGRAM +
    +

    +A simple, complete demonstration program, to get you started with using PCRE, +is supplied in the file pcredemo.c in the PCRE distribution. +

    +

    +The program compiles the regular expression that is its first argument, and +matches it against the subject string in its second argument. No PCRE options +are set, and default character tables are used. If matching succeeds, the +program outputs the portion of the subject that matched, together with the +contents of any captured substrings. +

    +

    +If the -g option is given on the command line, the program then goes on to +check for further matches of the same regular expression in the same subject +string. The logic is a little bit tricky because of the possibility of matching +an empty string. Comments in the code explain what is going on. +

    +

    +If PCRE is installed in the standard include and library directories for your +system, you should be able to compile the demonstration program using this +command: +

    +  gcc -o pcredemo pcredemo.c -lpcre
    +
    +If PCRE is installed elsewhere, you may need to add additional options to the +command line. For example, on a Unix-like system that has PCRE installed in +/usr/local, you can compile the demonstration program using a command +like this: +
    +  gcc -o pcredemo -I/usr/local/include pcredemo.c -L/usr/local/lib -lpcre
    +
    +Once you have compiled the demonstration program, you can run simple tests like +this: +
    +  ./pcredemo 'cat|dog' 'the cat sat on the mat'
    +  ./pcredemo -g 'cat|dog' 'the dog sat on the cat'
    +
    +Note that there is a much more comprehensive test program, called +pcretest, +which supports many more facilities for testing regular expressions and the +PCRE library. The pcredemo program is provided as a simple coding +example. +

    +

    +On some operating systems (e.g. Solaris), when PCRE is not installed in the +standard library directory, you may get an error like this when you try to run +pcredemo: +

    +  ld.so.1: a.out: fatal: libpcre.so.0: open failed: No such file or directory
    +
    +This is caused by the way shared library support works on those systems. You +need to add +
    +  -R/usr/local/lib
    +
    +(for example) to the compile command to get round this problem. +

    +

    +Last updated: 09 September 2004 +
    +Copyright © 1997-2004 University of Cambridge. +

    +Return to the PCRE index page. +

    diff --git a/mozilla/js/tamarin/pcre/doc/html/pcretest.html b/mozilla/js/tamarin/pcre/doc/html/pcretest.html new file mode 100644 index 00000000000..c43c8cba03c --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/html/pcretest.html @@ -0,0 +1,580 @@ + + +pcretest specification + + +

    pcretest man page

    +

    +Return to the PCRE index page. +

    +

    +This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
    +

    +
    SYNOPSIS
    +

    +pcretest [-C] [-d] [-dfa] [-i] [-m] [-o osize] [-p] [-t] [source] +[destination] +

    +

    +pcretest was written as a test program for the PCRE regular expression +library itself, but it can also be used for experimenting with regular +expressions. This document describes the features of the test program; for +details of the regular expressions themselves, see the +pcrepattern +documentation. For details of the PCRE library function calls and their +options, see the +pcreapi +documentation. +

    +
    OPTIONS
    +

    +-C +Output the version number of the PCRE library, and all available information +about the optional features that are included, and then exit. +

    +

    +-d +Behave as if each regex has the /D (debug) modifier; the internal +form is output after compilation. +

    +

    +-dfa +Behave as if each data line contains the \D escape sequence; this causes the +alternative matching function, pcre_dfa_exec(), to be used instead of the +standard pcre_exec() function (more detail is given below). +

    +

    +-i +Behave as if each regex has the /I modifier; information about the +compiled pattern is given after compilation. +

    +

    +-m +Output the size of each compiled pattern after it has been compiled. This is +equivalent to adding /M to each regular expression. For compatibility +with earlier versions of pcretest, -s is a synonym for -m. +

    +

    +-o osize +Set the number of elements in the output vector that is used when calling +pcre_exec() to be osize. The default value is 45, which is enough +for 14 capturing subexpressions. The vector size can be changed for individual +matching calls by including \O in the data line (see below). +

    +

    +-p +Behave as if each regex has the /P modifier; the POSIX wrapper API is +used to call PCRE. None of the other options has any effect when -p is +set. +

    +

    +-t +Run each compile, study, and match many times with a timer, and output +resulting time per compile or match (in milliseconds). Do not set -m with +-t, because you will then get the size output a zillion times, and the +timing will be distorted. +

    +
    DESCRIPTION
    +

    +If pcretest is given two filename arguments, it reads from the first and +writes to the second. If it is given only one filename argument, it reads from +that file and writes to stdout. Otherwise, it reads from stdin and writes to +stdout, and prompts for each line of input, using "re>" to prompt for regular +expressions, and "data>" to prompt for data lines. +

    +

    +The program handles any number of sets of input on a single input file. Each +set starts with a regular expression, and continues with any number of data +lines to be matched against the pattern. +

    +

    +Each data line is matched separately and independently. If you want to do +multiple-line matches, you have to use the \n escape sequence in a single line +of input to encode the newline characters. The maximum length of data line is +30,000 characters. +

    +

    +An empty line signals the end of the data lines, at which point a new regular +expression is read. The regular expressions are given enclosed in any +non-alphanumeric delimiters other than backslash, for example +

    +  /(a|bc)x+yz/
    +
    +White space before the initial delimiter is ignored. A regular expression may +be continued over several input lines, in which case the newline characters are +included within it. It is possible to include the delimiter within the pattern +by escaping it, for example +
    +  /abc\/def/
    +
    +If you do so, the escape and the delimiter form part of the pattern, but since +delimiters are always non-alphanumeric, this does not affect its interpretation. +If the terminating delimiter is immediately followed by a backslash, for +example, +
    +  /abc/\
    +
    +then a backslash is added to the end of the pattern. This is done to provide a +way of testing the error condition that arises if a pattern finishes with a +backslash, because +
    +  /abc\/
    +
    +is interpreted as the first line of a pattern that starts with "abc/", causing +pcretest to read the next line as a continuation of the regular expression. +

    +
    PATTERN MODIFIERS
    +

    +A pattern may be followed by any number of modifiers, which are mostly single +characters. Following Perl usage, these are referred to below as, for example, +"the /i modifier", even though the delimiter of the pattern need not +always be a slash, and no slash is used when writing modifiers. Whitespace may +appear between the final pattern delimiter and the first modifier, and between +the modifiers themselves. +

    +

    +The /i, /m, /s, and /x modifiers set the PCRE_CASELESS, +PCRE_MULTILINE, PCRE_DOTALL, or PCRE_EXTENDED options, respectively, when +pcre_compile() is called. These four modifier letters have the same +effect as they do in Perl. For example: +

    +  /caseless/i
    +
    +The following table shows additional modifiers for setting PCRE options that do +not correspond to anything in Perl: +
    +  /A    PCRE_ANCHORED
    +  /C    PCRE_AUTO_CALLOUT
    +  /E    PCRE_DOLLAR_ENDONLY
    +  /f    PCRE_FIRSTLINE
    +  /N    PCRE_NO_AUTO_CAPTURE
    +  /U    PCRE_UNGREEDY
    +  /X    PCRE_EXTRA
    +
    +Searching for all possible matches within each subject string can be requested +by the /g or /G modifier. After finding a match, PCRE is called +again to search the remainder of the subject string. The difference between +/g and /G is that the former uses the startoffset argument to +pcre_exec() to start searching at a new point within the entire string +(which is in effect what Perl does), whereas the latter passes over a shortened +substring. This makes a difference to the matching process if the pattern +begins with a lookbehind assertion (including \b or \B). +

    +

    +If any call to pcre_exec() in a /g or /G sequence matches an +empty string, the next call is done with the PCRE_NOTEMPTY and PCRE_ANCHORED +flags set in order to search for another, non-empty, match at the same point. +If this second match fails, the start offset is advanced by one, and the normal +match is retried. This imitates the way Perl handles such cases when using the +/g modifier or the split() function. +

    +

    +There are yet more modifiers for controlling the way pcretest +operates. +

    +

    +The /+ modifier requests that as well as outputting the substring that +matched the entire pattern, pcretest should in addition output the remainder of +the subject string. This is useful for tests where the subject contains +multiple copies of the same substring. +

    +

    +The /L modifier must be followed directly by the name of a locale, for +example, +

    +  /pattern/Lfr_FR
    +
    +For this reason, it must be the last modifier. The given locale is set, +pcre_maketables() is called to build a set of character tables for the +locale, and this is then passed to pcre_compile() when compiling the +regular expression. Without an /L modifier, NULL is passed as the tables +pointer; that is, /L applies only to the expression on which it appears. +

    +

    +The /I modifier requests that pcretest output information about the +compiled pattern (whether it is anchored, has a fixed first character, and +so on). It does this by calling pcre_fullinfo() after compiling a +pattern. If the pattern is studied, the results of that are also output. +

    +

    +The /D modifier is a PCRE debugging feature, which also assumes /I. +It causes the internal form of compiled regular expressions to be output after +compilation. If the pattern was studied, the information returned is also +output. +

    +

    +The /F modifier causes pcretest to flip the byte order of the +fields in the compiled pattern that contain 2-byte and 4-byte numbers. This +facility is for testing the feature in PCRE that allows it to execute patterns +that were compiled on a host with a different endianness. This feature is not +available when the POSIX interface to PCRE is being used, that is, when the +/P pattern modifier is specified. See also the section about saving and +reloading compiled patterns below. +

    +

    +The /S modifier causes pcre_study() to be called after the +expression has been compiled, and the results used when the expression is +matched. +

    +

    +The /M modifier causes the size of memory block used to hold the compiled +pattern to be output. +

    +

    +The /P modifier causes pcretest to call PCRE via the POSIX wrapper +API rather than its native API. When this is done, all other modifiers except +/i, /m, and /+ are ignored. REG_ICASE is set if /i is +present, and REG_NEWLINE is set if /m is present. The wrapper functions +force PCRE_DOLLAR_ENDONLY always, and PCRE_DOTALL unless REG_NEWLINE is set. +

    +

    +The /8 modifier causes pcretest to call PCRE with the PCRE_UTF8 +option set. This turns on support for UTF-8 character handling in PCRE, +provided that it was compiled with this support enabled. This modifier also +causes any non-printing characters in output strings to be printed using the +\x{hh...} notation if they are valid UTF-8 sequences. +

    +

    +If the /? modifier is used with /8, it causes pcretest to +call pcre_compile() with the PCRE_NO_UTF8_CHECK option, to suppress the +checking of the string for UTF-8 validity. +

    +
    DATA LINES
    +

    +Before each data line is passed to pcre_exec(), leading and trailing +whitespace is removed, and it is then scanned for \ escapes. Some of these are +pretty esoteric features, intended for checking out some of the more +complicated features of PCRE. If you are just testing "ordinary" regular +expressions, you probably don't need any of these. The following escapes are +recognized: +

    +  \a         alarm (= BEL)
    +  \b         backspace
    +  \e         escape
    +  \f         formfeed
    +  \n         newline
    +  \r         carriage return
    +  \t         tab
    +  \v         vertical tab
    +  \nnn       octal character (up to 3 octal digits)
    +  \xhh       hexadecimal character (up to 2 hex digits)
    +  \x{hh...}  hexadecimal character, any number of digits in UTF-8 mode
    +  \A         pass the PCRE_ANCHORED option to pcre_exec()
    +  \B         pass the PCRE_NOTBOL option to pcre_exec()
    +  \Cdd       call pcre_copy_substring() for substring dd after a successful match (number less than 32)
    +  \Cname     call pcre_copy_named_substring() for substring "name" after a successful match (name termin-
    +               ated by next non alphanumeric character)
    +  \C+        show the current captured substrings at callout time
    +  \C-        do not supply a callout function
    +  \C!n       return 1 instead of 0 when callout number n is reached
    +  \C!n!m     return 1 instead of 0 when callout number n is reached for the nth time
    +  \C*n       pass the number n (may be negative) as callout data; this is used as the callout return value
    +  \D         use the pcre_dfa_exec() match function
    +  \F         only shortest match for pcre_dfa_exec()
    +  \Gdd       call pcre_get_substring() for substring dd after a successful match (number less than 32)
    +  \Gname     call pcre_get_named_substring() for substring "name" after a successful match (name termin-
    +               ated by next non-alphanumeric character)
    +  \L         call pcre_get_substringlist() after a successful match
    +  \M         discover the minimum MATCH_LIMIT setting
    +  \N         pass the PCRE_NOTEMPTY option to pcre_exec()
    +  \Odd       set the size of the output vector passed to pcre_exec() to dd (any number of digits)
    +  \P         pass the PCRE_PARTIAL option to pcre_exec() or pcre_dfa_exec()
    +  \R         pass the PCRE_DFA_RESTART option to pcre_dfa_exec()
    +  \S         output details of memory get/free calls during matching
    +  \Z         pass the PCRE_NOTEOL option to pcre_exec()
    +  \?         pass the PCRE_NO_UTF8_CHECK option to pcre_exec()
    +  \>dd       start the match at offset dd (any number of digits);
    +               this sets the startoffset argument for pcre_exec()
    +
    +A backslash followed by anything else just escapes the anything else. If the +very last character is a backslash, it is ignored. This gives a way of passing +an empty line as data, since a real empty line terminates the data input. +

    +

    +If \M is present, pcretest calls pcre_exec() several times, with +different values in the match_limit field of the pcre_extra data +structure, until it finds the minimum number that is needed for +pcre_exec() to complete. This number is a measure of the amount of +recursion and backtracking that takes place, and checking it out can be +instructive. For most simple matches, the number is quite small, but for +patterns with very large numbers of matching possibilities, it can become large +very quickly with increasing length of subject string. +

    +

    +When \O is used, the value specified may be higher or lower than the size set +by the -O command line option (or defaulted to 45); \O applies only to +the call of pcre_exec() for the line in which it appears. +

    +

    +If the /P modifier was present on the pattern, causing the POSIX wrapper +API to be used, only \B and \Z have any effect, causing REG_NOTBOL and +REG_NOTEOL to be passed to regexec() respectively. +

    +

    +The use of \x{hh...} to represent UTF-8 characters is not dependent on the use +of the /8 modifier on the pattern. It is recognized always. There may be +any number of hexadecimal digits inside the braces. The result is from one to +six bytes, encoded according to the UTF-8 rules. +

    +
    THE ALTERNATIVE MATCHING FUNCTION
    +

    +By default, pcretest uses the standard PCRE matching function, +pcre_exec() to match each data line. From release 6.0, PCRE supports an +alternative matching function, pcre_dfa_test(), which operates in a +different way, and has some restrictions. The differences between the two +functions are described in the +pcrematching +documentation. +

    +

    +If a data line contains the \D escape sequence, or if the command line +contains the -dfa option, the alternative matching function is called. +This function finds all possible matches at a given point. If, however, the \F +escape sequence is present in the data line, it stops after the first match is +found. This is always the shortest possible match. +

    +
    DEFAULT OUTPUT FROM PCRETEST
    +

    +This section describes the output when the normal matching function, +pcre_exec(), is being used. +

    +

    +When a match succeeds, pcretest outputs the list of captured substrings that +pcre_exec() returns, starting with number 0 for the string that matched +the whole pattern. Otherwise, it outputs "No match" or "Partial match" +when pcre_exec() returns PCRE_ERROR_NOMATCH or PCRE_ERROR_PARTIAL, +respectively, and otherwise the PCRE negative error number. Here is an example +of an interactive pcretest run. +

    +  $ pcretest
    +  PCRE version 5.00 07-Sep-2004
    +
    +    re> /^abc(\d+)/
    +  data> abc123
    +   0: abc123
    +   1: 123
    +  data> xyz
    +  No match
    +
    +If the strings contain any non-printing characters, they are output as \0x +escapes, or as \x{...} escapes if the /8 modifier was present on the +pattern. If the pattern has the /+ modifier, the output for substring 0 +is followed by the the rest of the subject string, identified by "0+" like +this: +
    +    re> /cat/+
    +  data> cataract
    +   0: cat
    +   0+ aract
    +
    +If the pattern has the /g or /G modifier, the results of successive +matching attempts are output in sequence, like this: +
    +    re> /\Bi(\w\w)/g
    +  data> Mississippi
    +   0: iss
    +   1: ss
    +   0: iss
    +   1: ss
    +   0: ipp
    +   1: pp
    +
    +"No match" is output only if the first match attempt fails. +

    +

    +If any of the sequences \C, \G, or \L are present in a +data line that is successfully matched, the substrings extracted by the +convenience functions are output with C, G, or L after the string number +instead of a colon. This is in addition to the normal full list. The string +length (that is, the return from the extraction function) is given in +parentheses after each string for \C and \G. +

    +

    +Note that while patterns can be continued over several lines (a plain ">" +prompt is used for continuations), data lines may not. However newlines can be +included in data by means of the \n escape. +

    +
    OUTPUT FROM THE ALTERNATIVE MATCHING FUNCTION
    +

    +When the alternative matching function, pcre_dfa_exec(), is used (by +means of the \D escape sequence or the -dfa command line option), the +output consists of a list of all the matches that start at the first point in +the subject where there is at least one match. For example: +

    +    re> /(tang|tangerine|tan)/
    +  data> yellow tangerine\D
    +   0: tangerine
    +   1: tang
    +   2: tan
    +
    +(Using the normal matching function on this data finds only "tang".) The +longest matching string is always given first (and numbered zero). +

    +

    +If \fB/g\P is present on the pattern, the search for further matches resumes +at the end of the longest match. For example: +

    +    re> /(tang|tangerine|tan)/g
    +  data> yellow tangerine and tangy sultana\D
    +   0: tangerine
    +   1: tang
    +   2: tan
    +   0: tang
    +   1: tan
    +   0: tan
    +
    +Since the matching function does not support substring capture, the escape +sequences that are concerned with captured substrings are not relevant. +

    +
    RESTARTING AFTER A PARTIAL MATCH
    +

    +When the alternative matching function has given the PCRE_ERROR_PARTIAL return, +indicating that the subject partially matched the pattern, you can restart the +match with additional subject data by means of the \R escape sequence. For +example: +

    +    re> /^\d?\d(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d\d$/
    +  data> 23ja\P\D
    +  Partial match: 23ja
    +  data> n05\R\D
    +   0: n05
    +
    +For further information about partial matching, see the +pcrepartial +documentation. +

    +
    CALLOUTS
    +

    +If the pattern contains any callout requests, pcretest's callout function +is called during matching. This works with both matching functions. By default, +the called function displays the callout number, the start and current +positions in the text at the callout time, and the next pattern item to be +tested. For example, the output +

    +  --->pqrabcdef
    +    0    ^  ^     \d
    +
    +indicates that callout number 0 occurred for a match attempt starting at the +fourth character of the subject string, when the pointer was at the seventh +character of the data, and when the next pattern item was \d. Just one +circumflex is output if the start and current positions are the same. +

    +

    +Callouts numbered 255 are assumed to be automatic callouts, inserted as a +result of the /C pattern modifier. In this case, instead of showing the +callout number, the offset in the pattern, preceded by a plus, is output. For +example: +

    +    re> /\d?[A-E]\*/C
    +  data> E*
    +  --->E*
    +   +0 ^      \d?
    +   +3 ^      [A-E]
    +   +8 ^^     \*
    +  +10 ^ ^
    +   0: E*
    +
    +The callout function in pcretest returns zero (carry on matching) by +default, but you can use a \C item in a data line (as described above) to +change this. +

    +

    +Inserting callouts can be helpful when using pcretest to check +complicated regular expressions. For further information about callouts, see +the +pcrecallout +documentation. +

    +
    SAVING AND RELOADING COMPILED PATTERNS
    +

    +The facilities described in this section are not available when the POSIX +inteface to PCRE is being used, that is, when the /P pattern modifier is +specified. +

    +

    +When the POSIX interface is not in use, you can cause pcretest to write a +compiled pattern to a file, by following the modifiers with > and a file name. +For example: +

    +  /pattern/im >/some/file
    +
    +See the +pcreprecompile +documentation for a discussion about saving and re-using compiled patterns. +

    +

    +The data that is written is binary. The first eight bytes are the length of the +compiled pattern data followed by the length of the optional study data, each +written as four bytes in big-endian order (most significant byte first). If +there is no study data (either the pattern was not studied, or studying did not +return any data), the second length is zero. The lengths are followed by an +exact copy of the compiled pattern. If there is additional study data, this +follows immediately after the compiled pattern. After writing the file, +pcretest expects to read a new pattern. +

    +

    +A saved pattern can be reloaded into pcretest by specifing < and a file +name instead of a pattern. The name of the file must not contain a < character, +as otherwise pcretest will interpret the line as a pattern delimited by < +characters. +For example: +

    +   re> </some/file
    +  Compiled regex loaded from /some/file
    +  No study data
    +
    +When the pattern has been loaded, pcretest proceeds to read data lines in +the usual way. +

    +

    +You can copy a file written by pcretest to a different host and reload it +there, even if the new host has opposite endianness to the one on which the +pattern was compiled. For example, you can compile on an i86 machine and run on +a SPARC machine. +

    +

    +File names for saving and reloading can be absolute or relative, but note that +the shell facility of expanding a file name that starts with a tilde (~) is not +available. +

    +

    +The ability to save and reload files in pcretest is intended for testing +and experimentation. It is not intended for production use because only a +single pattern can be written to a file. Furthermore, there is no facility for +supplying custom character tables for use with a reloaded pattern. If the +original pattern was compiled with custom tables, an attempt to match a subject +string using a reloaded pattern is likely to cause pcretest to crash. +Finally, if you attempt to load a file that is not in the correct format, the +result is undefined. +

    +
    AUTHOR
    +

    +Philip Hazel +
    +University Computing Service, +
    +Cambridge CB2 3QG, England. +

    +

    +Last updated: 28 February 2005 +
    +Copyright © 1997-2005 University of Cambridge. +

    +Return to the PCRE index page. +

    diff --git a/mozilla/js/tamarin/pcre/doc/pcre.3 b/mozilla/js/tamarin/pcre/doc/pcre.3 new file mode 100644 index 00000000000..155e532b162 --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/pcre.3 @@ -0,0 +1,232 @@ +.TH PCRE 3 +.SH NAME +PCRE - Perl-compatible regular expressions +.SH INTRODUCTION +.rs +.sp +The PCRE library is a set of functions that implement regular expression +pattern matching using the same syntax and semantics as Perl, with just a few +differences. The current implementation of PCRE (release 6.x) corresponds +approximately with Perl 5.8, including support for UTF-8 encoded strings and +Unicode general category properties. However, this support has to be explicitly +enabled; it is not the default. +.P +In addition to the Perl-compatible matching function, PCRE also contains an +alternative matching function that matches the same compiled patterns in a +different way. In certain circumstances, the alternative function has some +advantages. For a discussion of the two matching algorithms, see the +.\" HREF +\fBpcrematching\fP +.\" +page. +.P +PCRE is written in C and released as a C library. A number of people have +written wrappers and interfaces of various kinds. In particular, Google Inc. +have provided a comprehensive C++ wrapper. This is now included as part of the +PCRE distribution. The +.\" HREF +\fBpcrecpp\fP +.\" +page has details of this interface. Other people's contributions can be found +in the \fIContrib\fR directory at the primary FTP site, which is: +.sp +.\" HTML +.\" +ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre +.P +Details of exactly which Perl regular expression features are and are not +supported by PCRE are given in separate documents. See the +.\" HREF +\fBpcrepattern\fR +.\" +and +.\" HREF +\fBpcrecompat\fR +.\" +pages. +.P +Some features of PCRE can be included, excluded, or changed when the library is +built. The +.\" HREF +\fBpcre_config()\fR +.\" +function makes it possible for a client to discover which features are +available. The features themselves are described in the +.\" HREF +\fBpcrebuild\fP +.\" +page. Documentation about building PCRE for various operating systems can be +found in the \fBREADME\fP file in the source distribution. +.P +The library contains a number of undocumented internal functions and data +tables that are used by more than one of the exported external functions, but +which are not intended for use by external callers. Their names all begin with +"_pcre_", which hopefully will not provoke any name clashes. In some +environments, it is possible to control which external symbols are exported +when a shared library is built, and in these cases the undocumented symbols are +not exported. +. +. +.SH "USER DOCUMENTATION" +.rs +.sp +The user documentation for PCRE comprises a number of different sections. In +the "man" format, each of these is a separate "man page". In the HTML format, +each is a separate page, linked from the index page. In the plain text format, +all the sections are concatenated, for ease of searching. The sections are as +follows: +.sp + pcre this document + pcreapi details of PCRE's native C API + pcrebuild options for building PCRE + pcrecallout details of the callout feature + pcrecompat discussion of Perl compatibility + pcrecpp details of the C++ wrapper + pcregrep description of the \fBpcregrep\fP command + pcrematching discussion of the two matching algorithms + pcrepartial details of the partial matching facility +.\" JOIN + pcrepattern syntax and semantics of supported + regular expressions + pcreperform discussion of performance issues + pcreposix the POSIX-compatible C API + pcreprecompile details of saving and re-using precompiled patterns + pcresample discussion of the sample program + pcretest description of the \fBpcretest\fP testing command +.sp +In addition, in the "man" and HTML formats, there is a short page for each +C library function, listing its arguments and results. +. +. +.SH LIMITATIONS +.rs +.sp +There are some size limitations in PCRE but it is hoped that they will never in +practice be relevant. +.P +The maximum length of a compiled pattern is 65539 (sic) bytes if PCRE is +compiled with the default internal linkage size of 2. If you want to process +regular expressions that are truly enormous, you can compile PCRE with an +internal linkage size of 3 or 4 (see the \fBREADME\fP file in the source +distribution and the +.\" HREF +\fBpcrebuild\fP +.\" +documentation for details). In these cases the limit is substantially larger. +However, the speed of execution will be slower. +.P +All values in repeating quantifiers must be less than 65536. +The maximum number of capturing subpatterns is 65535. +.P +There is no limit to the number of non-capturing subpatterns, but the maximum +depth of nesting of all kinds of parenthesized subpattern, including capturing +subpatterns, assertions, and other types of subpattern, is 200. +.P +The maximum length of a subject string is the largest positive number that an +integer variable can hold. However, when using the traditional matching +function, PCRE uses recursion to handle subpatterns and indefinite repetition. +This means that the available stack space may limit the size of a subject +string that can be processed by certain patterns. +.sp +.\" HTML +. +. +.SH "UTF-8 AND UNICODE PROPERTY SUPPORT" +.rs +.sp +From release 3.3, PCRE has had some support for character strings encoded in +the UTF-8 format. For release 4.0 this was greatly extended to cover most +common requirements, and in release 5.0 additional support for Unicode general +category properties was added. +.P +In order process UTF-8 strings, you must build PCRE to include UTF-8 support in +the code, and, in addition, you must call +.\" HREF +\fBpcre_compile()\fP +.\" +with the PCRE_UTF8 option flag. When you do this, both the pattern and any +subject strings that are matched against it are treated as UTF-8 strings +instead of just strings of bytes. +.P +If you compile PCRE with UTF-8 support, but do not use it at run time, the +library will be a bit bigger, but the additional run time overhead is limited +to testing the PCRE_UTF8 flag in several places, so should not be very large. +.P +If PCRE is built with Unicode character property support (which implies UTF-8 +support), the escape sequences \ep{..}, \eP{..}, and \eX are supported. +The available properties that can be tested are limited to the general +category properties such as Lu for an upper case letter or Nd for a decimal +number. A full list is given in the +.\" HREF +\fBpcrepattern\fP +.\" +documentation. The PCRE library is increased in size by about 90K when Unicode +property support is included. +.P +The following comments apply when PCRE is running in UTF-8 mode: +.P +1. When you set the PCRE_UTF8 flag, the strings passed as patterns and subjects +are checked for validity on entry to the relevant functions. If an invalid +UTF-8 string is passed, an error return is given. In some situations, you may +already know that your strings are valid, and therefore want to skip these +checks in order to improve performance. If you set the PCRE_NO_UTF8_CHECK flag +at compile time or at run time, PCRE assumes that the pattern or subject it +is given (respectively) contains only valid UTF-8 codes. In this case, it does +not diagnose an invalid UTF-8 string. If you pass an invalid UTF-8 string to +PCRE when PCRE_NO_UTF8_CHECK is set, the results are undefined. Your program +may crash. +.P +2. In a pattern, the escape sequence \ex{...}, where the contents of the braces +is a string of hexadecimal digits, is interpreted as a UTF-8 character whose +code number is the given hexadecimal number, for example: \ex{1234}. If a +non-hexadecimal digit appears between the braces, the item is not recognized. +This escape sequence can be used either as a literal, or within a character +class. +.P +3. The original hexadecimal escape sequence, \exhh, matches a two-byte UTF-8 +character if the value is greater than 127. +.P +4. Repeat quantifiers apply to complete UTF-8 characters, not to individual +bytes, for example: \ex{100}{3}. +.P +5. The dot metacharacter matches one UTF-8 character instead of a single byte. +.P +6. The escape sequence \eC can be used to match a single byte in UTF-8 mode, +but its use can lead to some strange effects. This facility is not available in +the alternative matching function, \fBpcre_dfa_exec()\fP. +.P +7. The character escapes \eb, \eB, \ed, \eD, \es, \eS, \ew, and \eW correctly +test characters of any code value, but the characters that PCRE recognizes as +digits, spaces, or word characters remain the same set as before, all with +values less than 256. This remains true even when PCRE includes Unicode +property support, because to do otherwise would slow down PCRE in many common +cases. If you really want to test for a wider sense of, say, "digit", you +must use Unicode property tests such as \ep{Nd}. +.P +8. Similarly, characters that match the POSIX named character classes are all +low-valued characters. +.P +9. Case-insensitive matching applies only to characters whose values are less +than 128, unless PCRE is built with Unicode property support. Even when Unicode +property support is available, PCRE still uses its own character tables when +checking the case of low-valued characters, so as not to degrade performance. +The Unicode property information is used only for characters with higher +values. +. +.SH AUTHOR +.rs +.sp +Philip Hazel +.br +University Computing Service, +.br +Cambridge CB2 3QG, England. +.P +Putting an actual email address here seems to have been a spam magnet, so I've +taken it away. If you want to email me, use my initial and surname, separated +by a dot, at the domain ucs.cam.ac.uk. +.sp +.in 0 +Last updated: 07 March 2005 +.br +Copyright (c) 1997-2005 University of Cambridge. diff --git a/mozilla/js/tamarin/pcre/doc/pcre.txt b/mozilla/js/tamarin/pcre/doc/pcre.txt new file mode 100644 index 00000000000..ab6708e17f7 --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/pcre.txt @@ -0,0 +1,4723 @@ +----------------------------------------------------------------------------- +This file contains a concatenation of the PCRE man pages, converted to plain +text format for ease of searching with a text editor, or for use on systems +that do not have a man page processor. The small individual files that give +synopses of each function in the library have not been included. There are +separate text files for the pcregrep and pcretest commands. +----------------------------------------------------------------------------- + + +PCRE(3) PCRE(3) + + +NAME + PCRE - Perl-compatible regular expressions + + +INTRODUCTION + + The PCRE library is a set of functions that implement regular expres- + sion pattern matching using the same syntax and semantics as Perl, with + just a few differences. The current implementation of PCRE (release + 6.x) corresponds approximately with Perl 5.8, including support for + UTF-8 encoded strings and Unicode general category properties. However, + this support has to be explicitly enabled; it is not the default. + + In addition to the Perl-compatible matching function, PCRE also con- + tains an alternative matching function that matches the same compiled + patterns in a different way. In certain circumstances, the alternative + function has some advantages. For a discussion of the two matching + algorithms, see the pcrematching page. + + PCRE is written in C and released as a C library. A number of people + have written wrappers and interfaces of various kinds. In particular, + Google Inc. have provided a comprehensive C++ wrapper. This is now + included as part of the PCRE distribution. The pcrecpp page has details + of this interface. Other people's contributions can be found in the + Contrib directory at the primary FTP site, which is: + + ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre + + Details of exactly which Perl regular expression features are and are + not supported by PCRE are given in separate documents. See the pcrepat- + tern and pcrecompat pages. + + Some features of PCRE can be included, excluded, or changed when the + library is built. The pcre_config() function makes it possible for a + client to discover which features are available. The features them- + selves are described in the pcrebuild page. Documentation about build- + ing PCRE for various operating systems can be found in the README file + in the source distribution. + + The library contains a number of undocumented internal functions and + data tables that are used by more than one of the exported external + functions, but which are not intended for use by external callers. + Their names all begin with "_pcre_", which hopefully will not provoke + any name clashes. In some environments, it is possible to control which + external symbols are exported when a shared library is built, and in + these cases the undocumented symbols are not exported. + + +USER DOCUMENTATION + + The user documentation for PCRE comprises a number of different sec- + tions. In the "man" format, each of these is a separate "man page". In + the HTML format, each is a separate page, linked from the index page. + In the plain text format, all the sections are concatenated, for ease + of searching. The sections are as follows: + + pcre this document + pcreapi details of PCRE's native C API + pcrebuild options for building PCRE + pcrecallout details of the callout feature + pcrecompat discussion of Perl compatibility + pcrecpp details of the C++ wrapper + pcregrep description of the pcregrep command + pcrematching discussion of the two matching algorithms + pcrepartial details of the partial matching facility + pcrepattern syntax and semantics of supported + regular expressions + pcreperform discussion of performance issues + pcreposix the POSIX-compatible C API + pcreprecompile details of saving and re-using precompiled patterns + pcresample discussion of the sample program + pcretest description of the pcretest testing command + + In addition, in the "man" and HTML formats, there is a short page for + each C library function, listing its arguments and results. + + +LIMITATIONS + + There are some size limitations in PCRE but it is hoped that they will + never in practice be relevant. + + The maximum length of a compiled pattern is 65539 (sic) bytes if PCRE + is compiled with the default internal linkage size of 2. If you want to + process regular expressions that are truly enormous, you can compile + PCRE with an internal linkage size of 3 or 4 (see the README file in + the source distribution and the pcrebuild documentation for details). + In these cases the limit is substantially larger. However, the speed + of execution will be slower. + + All values in repeating quantifiers must be less than 65536. The maxi- + mum number of capturing subpatterns is 65535. + + There is no limit to the number of non-capturing subpatterns, but the + maximum depth of nesting of all kinds of parenthesized subpattern, + including capturing subpatterns, assertions, and other types of subpat- + tern, is 200. + + The maximum length of a subject string is the largest positive number + that an integer variable can hold. However, when using the traditional + matching function, PCRE uses recursion to handle subpatterns and indef- + inite repetition. This means that the available stack space may limit + the size of a subject string that can be processed by certain patterns. + + +UTF-8 AND UNICODE PROPERTY SUPPORT + + From release 3.3, PCRE has had some support for character strings + encoded in the UTF-8 format. For release 4.0 this was greatly extended + to cover most common requirements, and in release 5.0 additional sup- + port for Unicode general category properties was added. + + In order process UTF-8 strings, you must build PCRE to include UTF-8 + support in the code, and, in addition, you must call pcre_compile() + with the PCRE_UTF8 option flag. When you do this, both the pattern and + any subject strings that are matched against it are treated as UTF-8 + strings instead of just strings of bytes. + + If you compile PCRE with UTF-8 support, but do not use it at run time, + the library will be a bit bigger, but the additional run time overhead + is limited to testing the PCRE_UTF8 flag in several places, so should + not be very large. + + If PCRE is built with Unicode character property support (which implies + UTF-8 support), the escape sequences \p{..}, \P{..}, and \X are sup- + ported. The available properties that can be tested are limited to the + general category properties such as Lu for an upper case letter or Nd + for a decimal number. A full list is given in the pcrepattern documen- + tation. The PCRE library is increased in size by about 90K when Unicode + property support is included. + + The following comments apply when PCRE is running in UTF-8 mode: + + 1. When you set the PCRE_UTF8 flag, the strings passed as patterns and + subjects are checked for validity on entry to the relevant functions. + If an invalid UTF-8 string is passed, an error return is given. In some + situations, you may already know that your strings are valid, and + therefore want to skip these checks in order to improve performance. If + you set the PCRE_NO_UTF8_CHECK flag at compile time or at run time, + PCRE assumes that the pattern or subject it is given (respectively) + contains only valid UTF-8 codes. In this case, it does not diagnose an + invalid UTF-8 string. If you pass an invalid UTF-8 string to PCRE when + PCRE_NO_UTF8_CHECK is set, the results are undefined. Your program may + crash. + + 2. In a pattern, the escape sequence \x{...}, where the contents of the + braces is a string of hexadecimal digits, is interpreted as a UTF-8 + character whose code number is the given hexadecimal number, for exam- + ple: \x{1234}. If a non-hexadecimal digit appears between the braces, + the item is not recognized. This escape sequence can be used either as + a literal, or within a character class. + + 3. The original hexadecimal escape sequence, \xhh, matches a two-byte + UTF-8 character if the value is greater than 127. + + 4. Repeat quantifiers apply to complete UTF-8 characters, not to indi- + vidual bytes, for example: \x{100}{3}. + + 5. The dot metacharacter matches one UTF-8 character instead of a sin- + gle byte. + + 6. The escape sequence \C can be used to match a single byte in UTF-8 + mode, but its use can lead to some strange effects. This facility is + not available in the alternative matching function, pcre_dfa_exec(). + + 7. The character escapes \b, \B, \d, \D, \s, \S, \w, and \W correctly + test characters of any code value, but the characters that PCRE recog- + nizes as digits, spaces, or word characters remain the same set as + before, all with values less than 256. This remains true even when PCRE + includes Unicode property support, because to do otherwise would slow + down PCRE in many common cases. If you really want to test for a wider + sense of, say, "digit", you must use Unicode property tests such as + \p{Nd}. + + 8. Similarly, characters that match the POSIX named character classes + are all low-valued characters. + + 9. Case-insensitive matching applies only to characters whose values + are less than 128, unless PCRE is built with Unicode property support. + Even when Unicode property support is available, PCRE still uses its + own character tables when checking the case of low-valued characters, + so as not to degrade performance. The Unicode property information is + used only for characters with higher values. + + +AUTHOR + + Philip Hazel + University Computing Service, + Cambridge CB2 3QG, England. + + Putting an actual email address here seems to have been a spam magnet, + so I've taken it away. If you want to email me, use my initial and sur- + name, separated by a dot, at the domain ucs.cam.ac.uk. + +Last updated: 07 March 2005 +Copyright (c) 1997-2005 University of Cambridge. +------------------------------------------------------------------------------ + + +PCREBUILD(3) PCREBUILD(3) + + +NAME + PCRE - Perl-compatible regular expressions + + +PCRE BUILD-TIME OPTIONS + + This document describes the optional features of PCRE that can be + selected when the library is compiled. They are all selected, or dese- + lected, by providing options to the configure script that is run before + the make command. The complete list of options for configure (which + includes the standard ones such as the selection of the installation + directory) can be obtained by running + + ./configure --help + + The following sections describe certain options whose names begin with + --enable or --disable. These settings specify changes to the defaults + for the configure command. Because of the way that configure works, + --enable and --disable always come in pairs, so the complementary + option always exists as well, but as it specifies the default, it is + not described. + + +C++ SUPPORT + + By default, the configure script will search for a C++ compiler and C++ + header files. If it finds them, it automatically builds the C++ wrapper + library for PCRE. You can disable this by adding + + --disable-cpp + + to the configure command. + + +UTF-8 SUPPORT + + To build PCRE with support for UTF-8 character strings, add + + --enable-utf8 + + to the configure command. Of itself, this does not make PCRE treat + strings as UTF-8. As well as compiling PCRE with this option, you also + have have to set the PCRE_UTF8 option when you call the pcre_compile() + function. + + +UNICODE CHARACTER PROPERTY SUPPORT + + UTF-8 support allows PCRE to process character values greater than 255 + in the strings that it handles. On its own, however, it does not pro- + vide any facilities for accessing the properties of such characters. If + you want to be able to use the pattern escapes \P, \p, and \X, which + refer to Unicode character properties, you must add + + --enable-unicode-properties + + to the configure command. This implies UTF-8 support, even if you have + not explicitly requested it. + + Including Unicode property support adds around 90K of tables to the + PCRE library, approximately doubling its size. Only the general cate- + gory properties such as Lu and Nd are supported. Details are given in + the pcrepattern documentation. + + +CODE VALUE OF NEWLINE + + By default, PCRE treats character 10 (linefeed) as the newline charac- + ter. This is the normal newline character on Unix-like systems. You can + compile PCRE to use character 13 (carriage return) instead by adding + + --enable-newline-is-cr + + to the configure command. For completeness there is also a --enable- + newline-is-lf option, which explicitly specifies linefeed as the new- + line character. + + +BUILDING SHARED AND STATIC LIBRARIES + + The PCRE building process uses libtool to build both shared and static + Unix libraries by default. You can suppress one of these by adding one + of + + --disable-shared + --disable-static + + to the configure command, as required. + + +POSIX MALLOC USAGE + + When PCRE is called through the POSIX interface (see the pcreposix doc- + umentation), additional working storage is required for holding the + pointers to capturing substrings, because PCRE requires three integers + per substring, whereas the POSIX interface provides only two. If the + number of expected substrings is small, the wrapper function uses space + on the stack, because this is faster than using malloc() for each call. + The default threshold above which the stack is no longer used is 10; it + can be changed by adding a setting such as + + --with-posix-malloc-threshold=20 + + to the configure command. + + +LIMITING PCRE RESOURCE USAGE + + Internally, PCRE has a function called match(), which it calls repeat- + edly (possibly recursively) when matching a pattern with the + pcre_exec() function. By controlling the maximum number of times this + function may be called during a single matching operation, a limit can + be placed on the resources used by a single call to pcre_exec(). The + limit can be changed at run time, as described in the pcreapi documen- + tation. The default is 10 million, but this can be changed by adding a + setting such as + + --with-match-limit=500000 + + to the configure command. This setting has no effect on the + pcre_dfa_exec() matching function. + + +HANDLING VERY LARGE PATTERNS + + Within a compiled pattern, offset values are used to point from one + part to another (for example, from an opening parenthesis to an alter- + nation metacharacter). By default, two-byte values are used for these + offsets, leading to a maximum size for a compiled pattern of around + 64K. This is sufficient to handle all but the most gigantic patterns. + Nevertheless, some people do want to process enormous patterns, so it + is possible to compile PCRE to use three-byte or four-byte offsets by + adding a setting such as + + --with-link-size=3 + + to the configure command. The value given must be 2, 3, or 4. Using + longer offsets slows down the operation of PCRE because it has to load + additional bytes when handling them. + + If you build PCRE with an increased link size, test 2 (and test 5 if + you are using UTF-8) will fail. Part of the output of these tests is a + representation of the compiled pattern, and this changes with the link + size. + + +AVOIDING EXCESSIVE STACK USAGE + + When matching with the pcre_exec() function, PCRE implements backtrack- + ing by making recursive calls to an internal function called match(). + In environments where the size of the stack is limited, this can se- + verely limit PCRE's operation. (The Unix environment does not usually + suffer from this problem.) An alternative approach that uses memory + from the heap to remember data, instead of using recursive function + calls, has been implemented to work round this problem. If you want to + build a version of PCRE that works this way, add + + --disable-stack-for-recursion + + to the configure command. With this configuration, PCRE will use the + pcre_stack_malloc and pcre_stack_free variables to call memory manage- + ment functions. Separate functions are provided because the usage is + very predictable: the block sizes requested are always the same, and + the blocks are always freed in reverse order. A calling program might + be able to implement optimized functions that perform better than the + standard malloc() and free() functions. PCRE runs noticeably more + slowly when built in this way. This option affects only the pcre_exec() + function; it is not relevant for the the pcre_dfa_exec() function. + + +USING EBCDIC CODE + + PCRE assumes by default that it will run in an environment where the + character code is ASCII (or Unicode, which is a superset of ASCII). + PCRE can, however, be compiled to run in an EBCDIC environment by + adding + + --enable-ebcdic + + to the configure command. + +Last updated: 15 August 2005 +Copyright (c) 1997-2005 University of Cambridge. +------------------------------------------------------------------------------ + + +PCREMATCHING(3) PCREMATCHING(3) + + +NAME + PCRE - Perl-compatible regular expressions + + +PCRE MATCHING ALGORITHMS + + This document describes the two different algorithms that are available + in PCRE for matching a compiled regular expression against a given sub- + ject string. The "standard" algorithm is the one provided by the + pcre_exec() function. This works in the same was as Perl's matching + function, and provides a Perl-compatible matching operation. + + An alternative algorithm is provided by the pcre_dfa_exec() function; + this operates in a different way, and is not Perl-compatible. It has + advantages and disadvantages compared with the standard algorithm, and + these are described below. + + When there is only one possible way in which a given subject string can + match a pattern, the two algorithms give the same answer. A difference + arises, however, when there are multiple possibilities. For example, if + the pattern + + ^<.*> + + is matched against the string + + + + there are three possible answers. The standard algorithm finds only one + of them, whereas the DFA algorithm finds all three. + + +REGULAR EXPRESSIONS AS TREES + + The set of strings that are matched by a regular expression can be rep- + resented as a tree structure. An unlimited repetition in the pattern + makes the tree of infinite size, but it is still a tree. Matching the + pattern to a given subject string (from a given starting point) can be + thought of as a search of the tree. There are two standard ways to + search a tree: depth-first and breadth-first, and these correspond to + the two matching algorithms provided by PCRE. + + +THE STANDARD MATCHING ALGORITHM + + In the terminology of Jeffrey Friedl's book Mastering Regular Expres- + sions, the standard algorithm is an "NFA algorithm". It conducts a + depth-first search of the pattern tree. That is, it proceeds along a + single path through the tree, checking that the subject matches what is + required. When there is a mismatch, the algorithm tries any alterna- + tives at the current point, and if they all fail, it backs up to the + previous branch point in the tree, and tries the next alternative + branch at that level. This often involves backing up (moving to the + left) in the subject string as well. The order in which repetition + branches are tried is controlled by the greedy or ungreedy nature of + the quantifier. + + If a leaf node is reached, a matching string has been found, and at + that point the algorithm stops. Thus, if there is more than one possi- + ble match, this algorithm returns the first one that it finds. Whether + this is the shortest, the longest, or some intermediate length depends + on the way the greedy and ungreedy repetition quantifiers are specified + in the pattern. + + Because it ends up with a single path through the tree, it is rela- + tively straightforward for this algorithm to keep track of the sub- + strings that are matched by portions of the pattern in parentheses. + This provides support for capturing parentheses and back references. + + +THE DFA MATCHING ALGORITHM + + DFA stands for "deterministic finite automaton", but you do not need to + understand the origins of that name. This algorithm conducts a breadth- + first search of the tree. Starting from the first matching point in the + subject, it scans the subject string from left to right, once, charac- + ter by character, and as it does this, it remembers all the paths + through the tree that represent valid matches. + + The scan continues until either the end of the subject is reached, or + there are no more unterminated paths. At this point, terminated paths + represent the different matching possibilities (if there are none, the + match has failed). Thus, if there is more than one possible match, + this algorithm finds all of them, and in particular, it finds the long- + est. In PCRE, there is an option to stop the algorithm after the first + match (which is necessarily the shortest) has been found. + + Note that all the matches that are found start at the same point in the + subject. If the pattern + + cat(er(pillar)?) + + is matched against the string "the caterpillar catchment", the result + will be the three strings "cat", "cater", and "caterpillar" that start + at the fourth character of the subject. The algorithm does not automat- + ically move on to find matches that start at later positions. + + There are a number of features of PCRE regular expressions that are not + supported by the DFA matching algorithm. They are as follows: + + 1. Because the algorithm finds all possible matches, the greedy or + ungreedy nature of repetition quantifiers is not relevant. Greedy and + ungreedy quantifiers are treated in exactly the same way. + + 2. When dealing with multiple paths through the tree simultaneously, it + is not straightforward to keep track of captured substrings for the + different matching possibilities, and PCRE's implementation of this + algorithm does not attempt to do this. This means that no captured sub- + strings are available. + + 3. Because no substrings are captured, back references within the pat- + tern are not supported, and cause errors if encountered. + + 4. For the same reason, conditional expressions that use a backrefer- + ence as the condition are not supported. + + 5. Callouts are supported, but the value of the capture_top field is + always 1, and the value of the capture_last field is always -1. + + 6. The \C escape sequence, which (in the standard algorithm) matches a + single byte, even in UTF-8 mode, is not supported because the DFA algo- + rithm moves through the subject string one character at a time, for all + active paths through the tree. + + +ADVANTAGES OF THE DFA ALGORITHM + + Using the DFA matching algorithm provides the following advantages: + + 1. All possible matches (at a single point in the subject) are automat- + ically found, and in particular, the longest match is found. To find + more than one match using the standard algorithm, you have to do kludgy + things with callouts. + + 2. There is much better support for partial matching. The restrictions + on the content of the pattern that apply when using the standard algo- + rithm for partial matching do not apply to the DFA algorithm. For non- + anchored patterns, the starting position of a partial match is avail- + able. + + 3. Because the DFA algorithm scans the subject string just once, and + never needs to backtrack, it is possible to pass very long subject + strings to the matching function in several pieces, checking for par- + tial matching each time. + + +DISADVANTAGES OF THE DFA ALGORITHM + + The DFA algorithm suffers from a number of disadvantages: + + 1. It is substantially slower than the standard algorithm. This is + partly because it has to search for all possible matches, but is also + because it is less susceptible to optimization. + + 2. Capturing parentheses and back references are not supported. + + 3. The "atomic group" feature of PCRE regular expressions is supported, + but does not provide the advantage that it does for the standard algo- + rithm. + +Last updated: 28 February 2005 +Copyright (c) 1997-2005 University of Cambridge. +------------------------------------------------------------------------------ + + +PCREAPI(3) PCREAPI(3) + + +NAME + PCRE - Perl-compatible regular expressions + + +PCRE NATIVE API + + #include + + pcre *pcre_compile(const char *pattern, int options, + const char **errptr, int *erroffset, + const unsigned char *tableptr); + + pcre *pcre_compile2(const char *pattern, int options, + int *errorcodeptr, + const char **errptr, int *erroffset, + const unsigned char *tableptr); + + pcre_extra *pcre_study(const pcre *code, int options, + const char **errptr); + + int pcre_exec(const pcre *code, const pcre_extra *extra, + const char *subject, int length, int startoffset, + int options, int *ovector, int ovecsize); + + int pcre_dfa_exec(const pcre *code, const pcre_extra *extra, + const char *subject, int length, int startoffset, + int options, int *ovector, int ovecsize, + int *workspace, int wscount); + + int pcre_copy_named_substring(const pcre *code, + const char *subject, int *ovector, + int stringcount, const char *stringname, + char *buffer, int buffersize); + + int pcre_copy_substring(const char *subject, int *ovector, + int stringcount, int stringnumber, char *buffer, + int buffersize); + + int pcre_get_named_substring(const pcre *code, + const char *subject, int *ovector, + int stringcount, const char *stringname, + const char **stringptr); + + int pcre_get_stringnumber(const pcre *code, + const char *name); + + int pcre_get_substring(const char *subject, int *ovector, + int stringcount, int stringnumber, + const char **stringptr); + + int pcre_get_substring_list(const char *subject, + int *ovector, int stringcount, const char ***listptr); + + void pcre_free_substring(const char *stringptr); + + void pcre_free_substring_list(const char **stringptr); + + const unsigned char *pcre_maketables(void); + + int pcre_fullinfo(const pcre *code, const pcre_extra *extra, + int what, void *where); + + int pcre_info(const pcre *code, int *optptr, int *firstcharptr); + + int pcre_refcount(pcre *code, int adjust); + + int pcre_config(int what, void *where); + + char *pcre_version(void); + + void *(*pcre_malloc)(size_t); + + void (*pcre_free)(void *); + + void *(*pcre_stack_malloc)(size_t); + + void (*pcre_stack_free)(void *); + + int (*pcre_callout)(pcre_callout_block *); + + +PCRE API OVERVIEW + + PCRE has its own native API, which is described in this document. There + is also a set of wrapper functions that correspond to the POSIX regular + expression API. These are described in the pcreposix documentation. + Both of these APIs define a set of C function calls. A C++ wrapper is + distributed with PCRE. It is documented in the pcrecpp page. + + The native API C function prototypes are defined in the header file + pcre.h, and on Unix systems the library itself is called libpcre. It + can normally be accessed by adding -lpcre to the command for linking an + application that uses PCRE. The header file defines the macros + PCRE_MAJOR and PCRE_MINOR to contain the major and minor release num- + bers for the library. Applications can use these to include support + for different releases of PCRE. + + The functions pcre_compile(), pcre_compile2(), pcre_study(), and + pcre_exec() are used for compiling and matching regular expressions in + a Perl-compatible manner. A sample program that demonstrates the sim- + plest way of using them is provided in the file called pcredemo.c in + the source distribution. The pcresample documentation describes how to + run it. + + A second matching function, pcre_dfa_exec(), which is not Perl-compati- + ble, is also provided. This uses a different algorithm for the match- + ing. This allows it to find all possible matches (at a given point in + the subject), not just one. However, this algorithm does not return + captured substrings. A description of the two matching algorithms and + their advantages and disadvantages is given in the pcrematching docu- + mentation. + + In addition to the main compiling and matching functions, there are + convenience functions for extracting captured substrings from a subject + string that is matched by pcre_exec(). They are: + + pcre_copy_substring() + pcre_copy_named_substring() + pcre_get_substring() + pcre_get_named_substring() + pcre_get_substring_list() + pcre_get_stringnumber() + + pcre_free_substring() and pcre_free_substring_list() are also provided, + to free the memory used for extracted strings. + + The function pcre_maketables() is used to build a set of character + tables in the current locale for passing to pcre_compile(), + pcre_exec(), or pcre_dfa_exec(). This is an optional facility that is + provided for specialist use. Most commonly, no special tables are + passed, in which case internal tables that are generated when PCRE is + built are used. + + The function pcre_fullinfo() is used to find out information about a + compiled pattern; pcre_info() is an obsolete version that returns only + some of the available information, but is retained for backwards com- + patibility. The function pcre_version() returns a pointer to a string + containing the version of PCRE and its date of release. + + The function pcre_refcount() maintains a reference count in a data + block containing a compiled pattern. This is provided for the benefit + of object-oriented applications. + + The global variables pcre_malloc and pcre_free initially contain the + entry points of the standard malloc() and free() functions, respec- + tively. PCRE calls the memory management functions via these variables, + so a calling program can replace them if it wishes to intercept the + calls. This should be done before calling any PCRE functions. + + The global variables pcre_stack_malloc and pcre_stack_free are also + indirections to memory management functions. These special functions + are used only when PCRE is compiled to use the heap for remembering + data, instead of recursive function calls, when running the pcre_exec() + function. This is a non-standard way of building PCRE, for use in envi- + ronments that have limited stacks. Because of the greater use of memory + management, it runs more slowly. Separate functions are provided so + that special-purpose external code can be used for this case. When + used, these functions are always called in a stack-like manner (last + obtained, first freed), and always for memory blocks of the same size. + + The global variable pcre_callout initially contains NULL. It can be set + by the caller to a "callout" function, which PCRE will then call at + specified points during a matching operation. Details are given in the + pcrecallout documentation. + + +MULTITHREADING + + The PCRE functions can be used in multi-threading applications, with + the proviso that the memory management functions pointed to by + pcre_malloc, pcre_free, pcre_stack_malloc, and pcre_stack_free, and the + callout function pointed to by pcre_callout, are shared by all threads. + + The compiled form of a regular expression is not altered during match- + ing, so the same compiled pattern can safely be used by several threads + at once. + + +SAVING PRECOMPILED PATTERNS FOR LATER USE + + The compiled form of a regular expression can be saved and re-used at a + later time, possibly by a different program, and even on a host other + than the one on which it was compiled. Details are given in the + pcreprecompile documentation. + + +CHECKING BUILD-TIME OPTIONS + + int pcre_config(int what, void *where); + + The function pcre_config() makes it possible for a PCRE client to dis- + cover which optional features have been compiled into the PCRE library. + The pcrebuild documentation has more details about these optional fea- + tures. + + The first argument for pcre_config() is an integer, specifying which + information is required; the second argument is a pointer to a variable + into which the information is placed. The following information is + available: + + PCRE_CONFIG_UTF8 + + The output is an integer that is set to one if UTF-8 support is avail- + able; otherwise it is set to zero. + + PCRE_CONFIG_UNICODE_PROPERTIES + + The output is an integer that is set to one if support for Unicode + character properties is available; otherwise it is set to zero. + + PCRE_CONFIG_NEWLINE + + The output is an integer that is set to the value of the code that is + used for the newline character. It is either linefeed (10) or carriage + return (13), and should normally be the standard character for your + operating system. + + PCRE_CONFIG_LINK_SIZE + + The output is an integer that contains the number of bytes used for + internal linkage in compiled regular expressions. The value is 2, 3, or + 4. Larger values allow larger regular expressions to be compiled, at + the expense of slower matching. The default value of 2 is sufficient + for all but the most massive patterns, since it allows the compiled + pattern to be up to 64K in size. + + PCRE_CONFIG_POSIX_MALLOC_THRESHOLD + + The output is an integer that contains the threshold above which the + POSIX interface uses malloc() for output vectors. Further details are + given in the pcreposix documentation. + + PCRE_CONFIG_MATCH_LIMIT + + The output is an integer that gives the default limit for the number of + internal matching function calls in a pcre_exec() execution. Further + details are given with pcre_exec() below. + + PCRE_CONFIG_STACKRECURSE + + The output is an integer that is set to one if internal recursion when + running pcre_exec() is implemented by recursive function calls that use + the stack to remember their state. This is the usual way that PCRE is + compiled. The output is zero if PCRE was compiled to use blocks of data + on the heap instead of recursive function calls. In this case, + pcre_stack_malloc and pcre_stack_free are called to manage memory + blocks on the heap, thus avoiding the use of the stack. + + +COMPILING A PATTERN + + pcre *pcre_compile(const char *pattern, int options, + const char **errptr, int *erroffset, + const unsigned char *tableptr); + + pcre *pcre_compile2(const char *pattern, int options, + int *errorcodeptr, + const char **errptr, int *erroffset, + const unsigned char *tableptr); + + Either of the functions pcre_compile() or pcre_compile2() can be called + to compile a pattern into an internal form. The only difference between + the two interfaces is that pcre_compile2() has an additional argument, + errorcodeptr, via which a numerical error code can be returned. + + The pattern is a C string terminated by a binary zero, and is passed in + the pattern argument. A pointer to a single block of memory that is + obtained via pcre_malloc is returned. This contains the compiled code + and related data. The pcre type is defined for the returned block; this + is a typedef for a structure whose contents are not externally defined. + It is up to the caller to free the memory when it is no longer + required. + + Although the compiled code of a PCRE regex is relocatable, that is, it + does not depend on memory location, the complete pcre data block is not + fully relocatable, because it may contain a copy of the tableptr argu- + ment, which is an address (see below). + + The options argument contains independent bits that affect the compila- + tion. It should be zero if no options are required. The available + options are described below. Some of them, in particular, those that + are compatible with Perl, can also be set and unset from within the + pattern (see the detailed description in the pcrepattern documenta- + tion). For these options, the contents of the options argument speci- + fies their initial settings at the start of compilation and execution. + The PCRE_ANCHORED option can be set at the time of matching as well as + at compile time. + + If errptr is NULL, pcre_compile() returns NULL immediately. Otherwise, + if compilation of a pattern fails, pcre_compile() returns NULL, and + sets the variable pointed to by errptr to point to a textual error mes- + sage. The offset from the start of the pattern to the character where + the error was discovered is placed in the variable pointed to by + erroffset, which must not be NULL. If it is, an immediate error is + given. + + If pcre_compile2() is used instead of pcre_compile(), and the error- + codeptr argument is not NULL, a non-zero error code number is returned + via this argument in the event of an error. This is in addition to the + textual error message. Error codes and messages are listed below. + + If the final argument, tableptr, is NULL, PCRE uses a default set of + character tables that are built when PCRE is compiled, using the + default C locale. Otherwise, tableptr must be an address that is the + result of a call to pcre_maketables(). This value is stored with the + compiled pattern, and used again by pcre_exec(), unless another table + pointer is passed to it. For more discussion, see the section on locale + support below. + + This code fragment shows a typical straightforward call to pcre_com- + pile(): + + pcre *re; + const char *error; + int erroffset; + re = pcre_compile( + "^A.*Z", /* the pattern */ + 0, /* default options */ + &error, /* for error message */ + &erroffset, /* for error offset */ + NULL); /* use default character tables */ + + The following names for option bits are defined in the pcre.h header + file: + + PCRE_ANCHORED + + If this bit is set, the pattern is forced to be "anchored", that is, it + is constrained to match only at the first matching point in the string + that is being searched (the "subject string"). This effect can also be + achieved by appropriate constructs in the pattern itself, which is the + only way to do it in Perl. + + PCRE_AUTO_CALLOUT + + If this bit is set, pcre_compile() automatically inserts callout items, + all with number 255, before each pattern item. For discussion of the + callout facility, see the pcrecallout documentation. + + PCRE_CASELESS + + If this bit is set, letters in the pattern match both upper and lower + case letters. It is equivalent to Perl's /i option, and it can be + changed within a pattern by a (?i) option setting. In UTF-8 mode, PCRE + always understands the concept of case for characters whose values are + less than 128, so caseless matching is always possible. For characters + with higher values, the concept of case is supported if PCRE is com- + piled with Unicode property support, but not otherwise. If you want to + use caseless matching for characters 128 and above, you must ensure + that PCRE is compiled with Unicode property support as well as with + UTF-8 support. + + PCRE_DOLLAR_ENDONLY + + If this bit is set, a dollar metacharacter in the pattern matches only + at the end of the subject string. Without this option, a dollar also + matches immediately before the final character if it is a newline (but + not before any other newlines). The PCRE_DOLLAR_ENDONLY option is + ignored if PCRE_MULTILINE is set. There is no equivalent to this option + in Perl, and no way to set it within a pattern. + + PCRE_DOTALL + + If this bit is set, a dot metacharater in the pattern matches all char- + acters, including newlines. Without it, newlines are excluded. This + option is equivalent to Perl's /s option, and it can be changed within + a pattern by a (?s) option setting. A negative class such as [^a] + always matches a newline character, independent of the setting of this + option. + + PCRE_EXTENDED + + If this bit is set, whitespace data characters in the pattern are + totally ignored except when escaped or inside a character class. White- + space does not include the VT character (code 11). In addition, charac- + ters between an unescaped # outside a character class and the next new- + line character, inclusive, are also ignored. This is equivalent to + Perl's /x option, and it can be changed within a pattern by a (?x) + option setting. + + This option makes it possible to include comments inside complicated + patterns. Note, however, that this applies only to data characters. + Whitespace characters may never appear within special character + sequences in a pattern, for example within the sequence (?( which + introduces a conditional subpattern. + + PCRE_EXTRA + + This option was invented in order to turn on additional functionality + of PCRE that is incompatible with Perl, but it is currently of very + little use. When set, any backslash in a pattern that is followed by a + letter that has no special meaning causes an error, thus reserving + these combinations for future expansion. By default, as in Perl, a + backslash followed by a letter with no special meaning is treated as a + literal. There are at present no other features controlled by this + option. It can also be set by a (?X) option setting within a pattern. + + PCRE_FIRSTLINE + + If this option is set, an unanchored pattern is required to match + before or at the first newline character in the subject string, though + the matched text may continue over the newline. + + PCRE_MULTILINE + + By default, PCRE treats the subject string as consisting of a single + line of characters (even if it actually contains newlines). The "start + of line" metacharacter (^) matches only at the start of the string, + while the "end of line" metacharacter ($) matches only at the end of + the string, or before a terminating newline (unless PCRE_DOLLAR_ENDONLY + is set). This is the same as Perl. + + When PCRE_MULTILINE it is set, the "start of line" and "end of line" + constructs match immediately following or immediately before any new- + line in the subject string, respectively, as well as at the very start + and end. This is equivalent to Perl's /m option, and it can be changed + within a pattern by a (?m) option setting. If there are no "\n" charac- + ters in a subject string, or no occurrences of ^ or $ in a pattern, + setting PCRE_MULTILINE has no effect. + + PCRE_NO_AUTO_CAPTURE + + If this option is set, it disables the use of numbered capturing paren- + theses in the pattern. Any opening parenthesis that is not followed by + ? behaves as if it were followed by ?: but named parentheses can still + be used for capturing (and they acquire numbers in the usual way). + There is no equivalent of this option in Perl. + + PCRE_UNGREEDY + + This option inverts the "greediness" of the quantifiers so that they + are not greedy by default, but become greedy if followed by "?". It is + not compatible with Perl. It can also be set by a (?U) option setting + within the pattern. + + PCRE_UTF8 + + This option causes PCRE to regard both the pattern and the subject as + strings of UTF-8 characters instead of single-byte character strings. + However, it is available only when PCRE is built to include UTF-8 sup- + port. If not, the use of this option provokes an error. Details of how + this option changes the behaviour of PCRE are given in the section on + UTF-8 support in the main pcre page. + + PCRE_NO_UTF8_CHECK + + When PCRE_UTF8 is set, the validity of the pattern as a UTF-8 string is + automatically checked. If an invalid UTF-8 sequence of bytes is found, + pcre_compile() returns an error. If you already know that your pattern + is valid, and you want to skip this check for performance reasons, you + can set the PCRE_NO_UTF8_CHECK option. When it is set, the effect of + passing an invalid UTF-8 string as a pattern is undefined. It may cause + your program to crash. Note that this option can also be passed to + pcre_exec() and pcre_dfa_exec(), to suppress the UTF-8 validity check- + ing of subject strings. + + +COMPILATION ERROR CODES + + The following table lists the error codes than may be returned by + pcre_compile2(), along with the error messages that may be returned by + both compiling functions. + + 0 no error + 1 \ at end of pattern + 2 \c at end of pattern + 3 unrecognized character follows \ + 4 numbers out of order in {} quantifier + 5 number too big in {} quantifier + 6 missing terminating ] for character class + 7 invalid escape sequence in character class + 8 range out of order in character class + 9 nothing to repeat + 10 operand of unlimited repeat could match the empty string + 11 internal error: unexpected repeat + 12 unrecognized character after (? + 13 POSIX named classes are supported only within a class + 14 missing ) + 15 reference to non-existent subpattern + 16 erroffset passed as NULL + 17 unknown option bit(s) set + 18 missing ) after comment + 19 parentheses nested too deeply + 20 regular expression too large + 21 failed to get memory + 22 unmatched parentheses + 23 internal error: code overflow + 24 unrecognized character after (?< + 25 lookbehind assertion is not fixed length + 26 malformed number after (?( + 27 conditional group contains more than two branches + 28 assertion expected after (?( + 29 (?R or (?digits must be followed by ) + 30 unknown POSIX class name + 31 POSIX collating elements are not supported + 32 this version of PCRE is not compiled with PCRE_UTF8 support + 33 spare error + 34 character value in \x{...} sequence is too large + 35 invalid condition (?(0) + 36 \C not allowed in lookbehind assertion + 37 PCRE does not support \L, \l, \N, \U, or \u + 38 number after (?C is > 255 + 39 closing ) for (?C expected + 40 recursive call could loop indefinitely + 41 unrecognized character after (?P + 42 syntax error after (?P + 43 two named groups have the same name + 44 invalid UTF-8 string + 45 support for \P, \p, and \X has not been compiled + 46 malformed \P or \p sequence + 47 unknown property name after \P or \p + + +STUDYING A PATTERN + + pcre_extra *pcre_study(const pcre *code, int options + const char **errptr); + + If a compiled pattern is going to be used several times, it is worth + spending more time analyzing it in order to speed up the time taken for + matching. The function pcre_study() takes a pointer to a compiled pat- + tern as its first argument. If studying the pattern produces additional + information that will help speed up matching, pcre_study() returns a + pointer to a pcre_extra block, in which the study_data field points to + the results of the study. + + The returned value from pcre_study() can be passed directly to + pcre_exec(). However, a pcre_extra block also contains other fields + that can be set by the caller before the block is passed; these are + described below in the section on matching a pattern. + + If studying the pattern does not produce any additional information + pcre_study() returns NULL. In that circumstance, if the calling program + wants to pass any of the other fields to pcre_exec(), it must set up + its own pcre_extra block. + + The second argument of pcre_study() contains option bits. At present, + no options are defined, and this argument should always be zero. + + The third argument for pcre_study() is a pointer for an error message. + If studying succeeds (even if no data is returned), the variable it + points to is set to NULL. Otherwise it points to a textual error mes- + sage. You should therefore test the error pointer for NULL after call- + ing pcre_study(), to be sure that it has run successfully. + + This is a typical call to pcre_study(): + + pcre_extra *pe; + pe = pcre_study( + re, /* result of pcre_compile() */ + 0, /* no options exist */ + &error); /* set to NULL or points to a message */ + + At present, studying a pattern is useful only for non-anchored patterns + that do not have a single fixed starting character. A bitmap of possi- + ble starting bytes is created. + + +LOCALE SUPPORT + + PCRE handles caseless matching, and determines whether characters are + letters digits, or whatever, by reference to a set of tables, indexed + by character value. When running in UTF-8 mode, this applies only to + characters with codes less than 128. Higher-valued codes never match + escapes such as \w or \d, but can be tested with \p if PCRE is built + with Unicode character property support. + + An internal set of tables is created in the default C locale when PCRE + is built. This is used when the final argument of pcre_compile() is + NULL, and is sufficient for many applications. An alternative set of + tables can, however, be supplied. These may be created in a different + locale from the default. As more and more applications change to using + Unicode, the need for this locale support is expected to die away. + + External tables are built by calling the pcre_maketables() function, + which has no arguments, in the relevant locale. The result can then be + passed to pcre_compile() or pcre_exec() as often as necessary. For + example, to build and use tables that are appropriate for the French + locale (where accented characters with values greater than 128 are + treated as letters), the following code could be used: + + setlocale(LC_CTYPE, "fr_FR"); + tables = pcre_maketables(); + re = pcre_compile(..., tables); + + When pcre_maketables() runs, the tables are built in memory that is + obtained via pcre_malloc. It is the caller's responsibility to ensure + that the memory containing the tables remains available for as long as + it is needed. + + The pointer that is passed to pcre_compile() is saved with the compiled + pattern, and the same tables are used via this pointer by pcre_study() + and normally also by pcre_exec(). Thus, by default, for any single pat- + tern, compilation, studying and matching all happen in the same locale, + but different patterns can be compiled in different locales. + + It is possible to pass a table pointer or NULL (indicating the use of + the internal tables) to pcre_exec(). Although not intended for this + purpose, this facility could be used to match a pattern in a different + locale from the one in which it was compiled. Passing table pointers at + run time is discussed below in the section on matching a pattern. + + +INFORMATION ABOUT A PATTERN + + int pcre_fullinfo(const pcre *code, const pcre_extra *extra, + int what, void *where); + + The pcre_fullinfo() function returns information about a compiled pat- + tern. It replaces the obsolete pcre_info() function, which is neverthe- + less retained for backwards compability (and is documented below). + + The first argument for pcre_fullinfo() is a pointer to the compiled + pattern. The second argument is the result of pcre_study(), or NULL if + the pattern was not studied. The third argument specifies which piece + of information is required, and the fourth argument is a pointer to a + variable to receive the data. The yield of the function is zero for + success, or one of the following negative numbers: + + PCRE_ERROR_NULL the argument code was NULL + the argument where was NULL + PCRE_ERROR_BADMAGIC the "magic number" was not found + PCRE_ERROR_BADOPTION the value of what was invalid + + The "magic number" is placed at the start of each compiled pattern as + an simple check against passing an arbitrary memory pointer. Here is a + typical call of pcre_fullinfo(), to obtain the length of the compiled + pattern: + + int rc; + unsigned long int length; + rc = pcre_fullinfo( + re, /* result of pcre_compile() */ + pe, /* result of pcre_study(), or NULL */ + PCRE_INFO_SIZE, /* what is required */ + &length); /* where to put the data */ + + The possible values for the third argument are defined in pcre.h, and + are as follows: + + PCRE_INFO_BACKREFMAX + + Return the number of the highest back reference in the pattern. The + fourth argument should point to an int variable. Zero is returned if + there are no back references. + + PCRE_INFO_CAPTURECOUNT + + Return the number of capturing subpatterns in the pattern. The fourth + argument should point to an int variable. + + PCRE_INFO_DEFAULT_TABLES + + Return a pointer to the internal default character tables within PCRE. + The fourth argument should point to an unsigned char * variable. This + information call is provided for internal use by the pcre_study() func- + tion. External callers can cause PCRE to use its internal tables by + passing a NULL table pointer. + + PCRE_INFO_FIRSTBYTE + + Return information about the first byte of any matched string, for a + non-anchored pattern. (This option used to be called + PCRE_INFO_FIRSTCHAR; the old name is still recognized for backwards + compatibility.) + + If there is a fixed first byte, for example, from a pattern such as + (cat|cow|coyote), it is returned in the integer pointed to by where. + Otherwise, if either + + (a) the pattern was compiled with the PCRE_MULTILINE option, and every + branch starts with "^", or + + (b) every branch of the pattern starts with ".*" and PCRE_DOTALL is not + set (if it were set, the pattern would be anchored), + + -1 is returned, indicating that the pattern matches only at the start + of a subject string or after any newline within the string. Otherwise + -2 is returned. For anchored patterns, -2 is returned. + + PCRE_INFO_FIRSTTABLE + + If the pattern was studied, and this resulted in the construction of a + 256-bit table indicating a fixed set of bytes for the first byte in any + matching string, a pointer to the table is returned. Otherwise NULL is + returned. The fourth argument should point to an unsigned char * vari- + able. + + PCRE_INFO_LASTLITERAL + + Return the value of the rightmost literal byte that must exist in any + matched string, other than at its start, if such a byte has been + recorded. The fourth argument should point to an int variable. If there + is no such byte, -1 is returned. For anchored patterns, a last literal + byte is recorded only if it follows something of variable length. For + example, for the pattern /^a\d+z\d+/ the returned value is "z", but for + /^a\dz\d/ the returned value is -1. + + PCRE_INFO_NAMECOUNT + PCRE_INFO_NAMEENTRYSIZE + PCRE_INFO_NAMETABLE + + PCRE supports the use of named as well as numbered capturing parenthe- + ses. The names are just an additional way of identifying the parenthe- + ses, which still acquire numbers. A convenience function called + pcre_get_named_substring() is provided for extracting an individual + captured substring by name. It is also possible to extract the data + directly, by first converting the name to a number in order to access + the correct pointers in the output vector (described with pcre_exec() + below). To do the conversion, you need to use the name-to-number map, + which is described by these three values. + + The map consists of a number of fixed-size entries. PCRE_INFO_NAMECOUNT + gives the number of entries, and PCRE_INFO_NAMEENTRYSIZE gives the size + of each entry; both of these return an int value. The entry size + depends on the length of the longest name. PCRE_INFO_NAMETABLE returns + a pointer to the first entry of the table (a pointer to char). The + first two bytes of each entry are the number of the capturing parenthe- + sis, most significant byte first. The rest of the entry is the corre- + sponding name, zero terminated. The names are in alphabetical order. + For example, consider the following pattern (assume PCRE_EXTENDED is + set, so white space - including newlines - is ignored): + + (?P (?P(\d\d)?\d\d) - + (?P\d\d) - (?P\d\d) ) + + There are four named subpatterns, so the table has four entries, and + each entry in the table is eight bytes long. The table is as follows, + with non-printing bytes shows in hexadecimal, and undefined bytes shown + as ??: + + 00 01 d a t e 00 ?? + 00 05 d a y 00 ?? ?? + 00 04 m o n t h 00 + 00 02 y e a r 00 ?? + + When writing code to extract data from named subpatterns using the + name-to-number map, remember that the length of each entry is likely to + be different for each compiled pattern. + + PCRE_INFO_OPTIONS + + Return a copy of the options with which the pattern was compiled. The + fourth argument should point to an unsigned long int variable. These + option bits are those specified in the call to pcre_compile(), modified + by any top-level option settings within the pattern itself. + + A pattern is automatically anchored by PCRE if all of its top-level + alternatives begin with one of the following: + + ^ unless PCRE_MULTILINE is set + \A always + \G always + .* if PCRE_DOTALL is set and there are no back + references to the subpattern in which .* appears + + For such patterns, the PCRE_ANCHORED bit is set in the options returned + by pcre_fullinfo(). + + PCRE_INFO_SIZE + + Return the size of the compiled pattern, that is, the value that was + passed as the argument to pcre_malloc() when PCRE was getting memory in + which to place the compiled data. The fourth argument should point to a + size_t variable. + + PCRE_INFO_STUDYSIZE + + Return the size of the data block pointed to by the study_data field in + a pcre_extra block. That is, it is the value that was passed to + pcre_malloc() when PCRE was getting memory into which to place the data + created by pcre_study(). The fourth argument should point to a size_t + variable. + + +OBSOLETE INFO FUNCTION + + int pcre_info(const pcre *code, int *optptr, int *firstcharptr); + + The pcre_info() function is now obsolete because its interface is too + restrictive to return all the available data about a compiled pattern. + New programs should use pcre_fullinfo() instead. The yield of + pcre_info() is the number of capturing subpatterns, or one of the fol- + lowing negative numbers: + + PCRE_ERROR_NULL the argument code was NULL + PCRE_ERROR_BADMAGIC the "magic number" was not found + + If the optptr argument is not NULL, a copy of the options with which + the pattern was compiled is placed in the integer it points to (see + PCRE_INFO_OPTIONS above). + + If the pattern is not anchored and the firstcharptr argument is not + NULL, it is used to pass back information about the first character of + any matched string (see PCRE_INFO_FIRSTBYTE above). + + +REFERENCE COUNTS + + int pcre_refcount(pcre *code, int adjust); + + The pcre_refcount() function is used to maintain a reference count in + the data block that contains a compiled pattern. It is provided for the + benefit of applications that operate in an object-oriented manner, + where different parts of the application may be using the same compiled + pattern, but you want to free the block when they are all done. + + When a pattern is compiled, the reference count field is initialized to + zero. It is changed only by calling this function, whose action is to + add the adjust value (which may be positive or negative) to it. The + yield of the function is the new value. However, the value of the count + is constrained to lie between 0 and 65535, inclusive. If the new value + is outside these limits, it is forced to the appropriate limit value. + + Except when it is zero, the reference count is not correctly preserved + if a pattern is compiled on one host and then transferred to a host + whose byte-order is different. (This seems a highly unlikely scenario.) + + +MATCHING A PATTERN: THE TRADITIONAL FUNCTION + + int pcre_exec(const pcre *code, const pcre_extra *extra, + const char *subject, int length, int startoffset, + int options, int *ovector, int ovecsize); + + The function pcre_exec() is called to match a subject string against a + compiled pattern, which is passed in the code argument. If the pattern + has been studied, the result of the study should be passed in the extra + argument. This function is the main matching facility of the library, + and it operates in a Perl-like manner. For specialist use there is also + an alternative matching function, which is described below in the sec- + tion about the pcre_dfa_exec() function. + + In most applications, the pattern will have been compiled (and option- + ally studied) in the same process that calls pcre_exec(). However, it + is possible to save compiled patterns and study data, and then use them + later in different processes, possibly even on different hosts. For a + discussion about this, see the pcreprecompile documentation. + + Here is an example of a simple call to pcre_exec(): + + int rc; + int ovector[30]; + rc = pcre_exec( + re, /* result of pcre_compile() */ + NULL, /* we didn't study the pattern */ + "some string", /* the subject string */ + 11, /* the length of the subject string */ + 0, /* start at offset 0 in the subject */ + 0, /* default options */ + ovector, /* vector of integers for substring information */ + 30); /* number of elements (NOT size in bytes) */ + + Extra data for pcre_exec() + + If the extra argument is not NULL, it must point to a pcre_extra data + block. The pcre_study() function returns such a block (when it doesn't + return NULL), but you can also create one for yourself, and pass addi- + tional information in it. The fields in a pcre_extra block are as fol- + lows: + + unsigned long int flags; + void *study_data; + unsigned long int match_limit; + void *callout_data; + const unsigned char *tables; + + The flags field is a bitmap that specifies which of the other fields + are set. The flag bits are: + + PCRE_EXTRA_STUDY_DATA + PCRE_EXTRA_MATCH_LIMIT + PCRE_EXTRA_CALLOUT_DATA + PCRE_EXTRA_TABLES + + Other flag bits should be set to zero. The study_data field is set in + the pcre_extra block that is returned by pcre_study(), together with + the appropriate flag bit. You should not set this yourself, but you may + add to the block by setting the other fields and their corresponding + flag bits. + + The match_limit field provides a means of preventing PCRE from using up + a vast amount of resources when running patterns that are not going to + match, but which have a very large number of possibilities in their + search trees. The classic example is the use of nested unlimited + repeats. + + Internally, PCRE uses a function called match() which it calls repeat- + edly (sometimes recursively). The limit is imposed on the number of + times this function is called during a match, which has the effect of + limiting the amount of recursion and backtracking that can take place. + For patterns that are not anchored, the count starts from zero for each + position in the subject string. + + The default limit for the library can be set when PCRE is built; the + default default is 10 million, which handles all but the most extreme + cases. You can reduce the default by suppling pcre_exec() with a + pcre_extra block in which match_limit is set to a smaller value, and + PCRE_EXTRA_MATCH_LIMIT is set in the flags field. If the limit is + exceeded, pcre_exec() returns PCRE_ERROR_MATCHLIMIT. + + The pcre_callout field is used in conjunction with the "callout" fea- + ture, which is described in the pcrecallout documentation. + + The tables field is used to pass a character tables pointer to + pcre_exec(); this overrides the value that is stored with the compiled + pattern. A non-NULL value is stored with the compiled pattern only if + custom tables were supplied to pcre_compile() via its tableptr argu- + ment. If NULL is passed to pcre_exec() using this mechanism, it forces + PCRE's internal tables to be used. This facility is helpful when re- + using patterns that have been saved after compiling with an external + set of tables, because the external tables might be at a different + address when pcre_exec() is called. See the pcreprecompile documenta- + tion for a discussion of saving compiled patterns for later use. + + Option bits for pcre_exec() + + The unused bits of the options argument for pcre_exec() must be zero. + The only bits that may be set are PCRE_ANCHORED, PCRE_NOTBOL, + PCRE_NOTEOL, PCRE_NOTEMPTY, PCRE_NO_UTF8_CHECK and PCRE_PARTIAL. + + PCRE_ANCHORED + + The PCRE_ANCHORED option limits pcre_exec() to matching at the first + matching position. If a pattern was compiled with PCRE_ANCHORED, or + turned out to be anchored by virtue of its contents, it cannot be made + unachored at matching time. + + PCRE_NOTBOL + + This option specifies that first character of the subject string is not + the beginning of a line, so the circumflex metacharacter should not + match before it. Setting this without PCRE_MULTILINE (at compile time) + causes circumflex never to match. This option affects only the behav- + iour of the circumflex metacharacter. It does not affect \A. + + PCRE_NOTEOL + + This option specifies that the end of the subject string is not the end + of a line, so the dollar metacharacter should not match it nor (except + in multiline mode) a newline immediately before it. Setting this with- + out PCRE_MULTILINE (at compile time) causes dollar never to match. This + option affects only the behaviour of the dollar metacharacter. It does + not affect \Z or \z. + + PCRE_NOTEMPTY + + An empty string is not considered to be a valid match if this option is + set. If there are alternatives in the pattern, they are tried. If all + the alternatives match the empty string, the entire match fails. For + example, if the pattern + + a?b? + + is applied to a string not beginning with "a" or "b", it matches the + empty string at the start of the subject. With PCRE_NOTEMPTY set, this + match is not valid, so PCRE searches further into the string for occur- + rences of "a" or "b". + + Perl has no direct equivalent of PCRE_NOTEMPTY, but it does make a spe- + cial case of a pattern match of the empty string within its split() + function, and when using the /g modifier. It is possible to emulate + Perl's behaviour after matching a null string by first trying the match + again at the same offset with PCRE_NOTEMPTY and PCRE_ANCHORED, and then + if that fails by advancing the starting offset (see below) and trying + an ordinary match again. There is some code that demonstrates how to do + this in the pcredemo.c sample program. + + PCRE_NO_UTF8_CHECK + + When PCRE_UTF8 is set at compile time, the validity of the subject as a + UTF-8 string is automatically checked when pcre_exec() is subsequently + called. The value of startoffset is also checked to ensure that it + points to the start of a UTF-8 character. If an invalid UTF-8 sequence + of bytes is found, pcre_exec() returns the error PCRE_ERROR_BADUTF8. If + startoffset contains an invalid value, PCRE_ERROR_BADUTF8_OFFSET is + returned. + + If you already know that your subject is valid, and you want to skip + these checks for performance reasons, you can set the + PCRE_NO_UTF8_CHECK option when calling pcre_exec(). You might want to + do this for the second and subsequent calls to pcre_exec() if you are + making repeated calls to find all the matches in a single subject + string. However, you should be sure that the value of startoffset + points to the start of a UTF-8 character. When PCRE_NO_UTF8_CHECK is + set, the effect of passing an invalid UTF-8 string as a subject, or a + value of startoffset that does not point to the start of a UTF-8 char- + acter, is undefined. Your program may crash. + + PCRE_PARTIAL + + This option turns on the partial matching feature. If the subject + string fails to match the pattern, but at some point during the match- + ing process the end of the subject was reached (that is, the subject + partially matches the pattern and the failure to match occurred only + because there were not enough subject characters), pcre_exec() returns + PCRE_ERROR_PARTIAL instead of PCRE_ERROR_NOMATCH. When PCRE_PARTIAL is + used, there are restrictions on what may appear in the pattern. These + are discussed in the pcrepartial documentation. + + The string to be matched by pcre_exec() + + The subject string is passed to pcre_exec() as a pointer in subject, a + length in length, and a starting byte offset in startoffset. In UTF-8 + mode, the byte offset must point to the start of a UTF-8 character. + Unlike the pattern string, the subject may contain binary zero bytes. + When the starting offset is zero, the search for a match starts at the + beginning of the subject, and this is by far the most common case. + + A non-zero starting offset is useful when searching for another match + in the same subject by calling pcre_exec() again after a previous suc- + cess. Setting startoffset differs from just passing over a shortened + string and setting PCRE_NOTBOL in the case of a pattern that begins + with any kind of lookbehind. For example, consider the pattern + + \Biss\B + + which finds occurrences of "iss" in the middle of words. (\B matches + only if the current position in the subject is not a word boundary.) + When applied to the string "Mississipi" the first call to pcre_exec() + finds the first occurrence. If pcre_exec() is called again with just + the remainder of the subject, namely "issipi", it does not match, + because \B is always false at the start of the subject, which is deemed + to be a word boundary. However, if pcre_exec() is passed the entire + string again, but with startoffset set to 4, it finds the second occur- + rence of "iss" because it is able to look behind the starting point to + discover that it is preceded by a letter. + + If a non-zero starting offset is passed when the pattern is anchored, + one attempt to match at the given offset is made. This can only succeed + if the pattern does not require the match to be at the start of the + subject. + + How pcre_exec() returns captured substrings + + In general, a pattern matches a certain portion of the subject, and in + addition, further substrings from the subject may be picked out by + parts of the pattern. Following the usage in Jeffrey Friedl's book, + this is called "capturing" in what follows, and the phrase "capturing + subpattern" is used for a fragment of a pattern that picks out a sub- + string. PCRE supports several other kinds of parenthesized subpattern + that do not cause substrings to be captured. + + Captured substrings are returned to the caller via a vector of integer + offsets whose address is passed in ovector. The number of elements in + the vector is passed in ovecsize, which must be a non-negative number. + Note: this argument is NOT the size of ovector in bytes. + + The first two-thirds of the vector is used to pass back captured sub- + strings, each substring using a pair of integers. The remaining third + of the vector is used as workspace by pcre_exec() while matching cap- + turing subpatterns, and is not available for passing back information. + The length passed in ovecsize should always be a multiple of three. If + it is not, it is rounded down. + + When a match is successful, information about captured substrings is + returned in pairs of integers, starting at the beginning of ovector, + and continuing up to two-thirds of its length at the most. The first + element of a pair is set to the offset of the first character in a sub- + string, and the second is set to the offset of the first character + after the end of a substring. The first pair, ovector[0] and ovec- + tor[1], identify the portion of the subject string matched by the + entire pattern. The next pair is used for the first capturing subpat- + tern, and so on. The value returned by pcre_exec() is the number of + pairs that have been set. If there are no capturing subpatterns, the + return value from a successful match is 1, indicating that just the + first pair of offsets has been set. + + Some convenience functions are provided for extracting the captured + substrings as separate strings. These are described in the following + section. + + It is possible for an capturing subpattern number n+1 to match some + part of the subject when subpattern n has not been used at all. For + example, if the string "abc" is matched against the pattern (a|(z))(bc) + subpatterns 1 and 3 are matched, but 2 is not. When this happens, both + offset values corresponding to the unused subpattern are set to -1. + + If a capturing subpattern is matched repeatedly, it is the last portion + of the string that it matched that is returned. + + If the vector is too small to hold all the captured substring offsets, + it is used as far as possible (up to two-thirds of its length), and the + function returns a value of zero. In particular, if the substring off- + sets are not of interest, pcre_exec() may be called with ovector passed + as NULL and ovecsize as zero. However, if the pattern contains back + references and the ovector is not big enough to remember the related + substrings, PCRE has to get additional memory for use during matching. + Thus it is usually advisable to supply an ovector. + + Note that pcre_info() can be used to find out how many capturing sub- + patterns there are in a compiled pattern. The smallest size for ovector + that will allow for n captured substrings, in addition to the offsets + of the substring matched by the whole pattern, is (n+1)*3. + + Return values from pcre_exec() + + If pcre_exec() fails, it returns a negative number. The following are + defined in the header file: + + PCRE_ERROR_NOMATCH (-1) + + The subject string did not match the pattern. + + PCRE_ERROR_NULL (-2) + + Either code or subject was passed as NULL, or ovector was NULL and + ovecsize was not zero. + + PCRE_ERROR_BADOPTION (-3) + + An unrecognized bit was set in the options argument. + + PCRE_ERROR_BADMAGIC (-4) + + PCRE stores a 4-byte "magic number" at the start of the compiled code, + to catch the case when it is passed a junk pointer and to detect when a + pattern that was compiled in an environment of one endianness is run in + an environment with the other endianness. This is the error that PCRE + gives when the magic number is not present. + + PCRE_ERROR_UNKNOWN_NODE (-5) + + While running the pattern match, an unknown item was encountered in the + compiled pattern. This error could be caused by a bug in PCRE or by + overwriting of the compiled pattern. + + PCRE_ERROR_NOMEMORY (-6) + + If a pattern contains back references, but the ovector that is passed + to pcre_exec() is not big enough to remember the referenced substrings, + PCRE gets a block of memory at the start of matching to use for this + purpose. If the call via pcre_malloc() fails, this error is given. The + memory is automatically freed at the end of matching. + + PCRE_ERROR_NOSUBSTRING (-7) + + This error is used by the pcre_copy_substring(), pcre_get_substring(), + and pcre_get_substring_list() functions (see below). It is never + returned by pcre_exec(). + + PCRE_ERROR_MATCHLIMIT (-8) + + The recursion and backtracking limit, as specified by the match_limit + field in a pcre_extra structure (or defaulted) was reached. See the + description above. + + PCRE_ERROR_CALLOUT (-9) + + This error is never generated by pcre_exec() itself. It is provided for + use by callout functions that want to yield a distinctive error code. + See the pcrecallout documentation for details. + + PCRE_ERROR_BADUTF8 (-10) + + A string that contains an invalid UTF-8 byte sequence was passed as a + subject. + + PCRE_ERROR_BADUTF8_OFFSET (-11) + + The UTF-8 byte sequence that was passed as a subject was valid, but the + value of startoffset did not point to the beginning of a UTF-8 charac- + ter. + + PCRE_ERROR_PARTIAL (-12) + + The subject string did not match, but it did match partially. See the + pcrepartial documentation for details of partial matching. + + PCRE_ERROR_BADPARTIAL (-13) + + The PCRE_PARTIAL option was used with a compiled pattern containing + items that are not supported for partial matching. See the pcrepartial + documentation for details of partial matching. + + PCRE_ERROR_INTERNAL (-14) + + An unexpected internal error has occurred. This error could be caused + by a bug in PCRE or by overwriting of the compiled pattern. + + PCRE_ERROR_BADCOUNT (-15) + + This error is given if the value of the ovecsize argument is negative. + + +EXTRACTING CAPTURED SUBSTRINGS BY NUMBER + + int pcre_copy_substring(const char *subject, int *ovector, + int stringcount, int stringnumber, char *buffer, + int buffersize); + + int pcre_get_substring(const char *subject, int *ovector, + int stringcount, int stringnumber, + const char **stringptr); + + int pcre_get_substring_list(const char *subject, + int *ovector, int stringcount, const char ***listptr); + + Captured substrings can be accessed directly by using the offsets + returned by pcre_exec() in ovector. For convenience, the functions + pcre_copy_substring(), pcre_get_substring(), and pcre_get_sub- + string_list() are provided for extracting captured substrings as new, + separate, zero-terminated strings. These functions identify substrings + by number. The next section describes functions for extracting named + substrings. A substring that contains a binary zero is correctly + extracted and has a further zero added on the end, but the result is + not, of course, a C string. + + The first three arguments are the same for all three of these func- + tions: subject is the subject string that has just been successfully + matched, ovector is a pointer to the vector of integer offsets that was + passed to pcre_exec(), and stringcount is the number of substrings that + were captured by the match, including the substring that matched the + entire regular expression. This is the value returned by pcre_exec() if + it is greater than zero. If pcre_exec() returned zero, indicating that + it ran out of space in ovector, the value passed as stringcount should + be the number of elements in the vector divided by three. + + The functions pcre_copy_substring() and pcre_get_substring() extract a + single substring, whose number is given as stringnumber. A value of + zero extracts the substring that matched the entire pattern, whereas + higher values extract the captured substrings. For pcre_copy_sub- + string(), the string is placed in buffer, whose length is given by + buffersize, while for pcre_get_substring() a new block of memory is + obtained via pcre_malloc, and its address is returned via stringptr. + The yield of the function is the length of the string, not including + the terminating zero, or one of + + PCRE_ERROR_NOMEMORY (-6) + + The buffer was too small for pcre_copy_substring(), or the attempt to + get memory failed for pcre_get_substring(). + + PCRE_ERROR_NOSUBSTRING (-7) + + There is no substring whose number is stringnumber. + + The pcre_get_substring_list() function extracts all available sub- + strings and builds a list of pointers to them. All this is done in a + single block of memory that is obtained via pcre_malloc. The address of + the memory block is returned via listptr, which is also the start of + the list of string pointers. The end of the list is marked by a NULL + pointer. The yield of the function is zero if all went well, or + + PCRE_ERROR_NOMEMORY (-6) + + if the attempt to get the memory block failed. + + When any of these functions encounter a substring that is unset, which + can happen when capturing subpattern number n+1 matches some part of + the subject, but subpattern n has not been used at all, they return an + empty string. This can be distinguished from a genuine zero-length sub- + string by inspecting the appropriate offset in ovector, which is nega- + tive for unset substrings. + + The two convenience functions pcre_free_substring() and pcre_free_sub- + string_list() can be used to free the memory returned by a previous + call of pcre_get_substring() or pcre_get_substring_list(), respec- + tively. They do nothing more than call the function pointed to by + pcre_free, which of course could be called directly from a C program. + However, PCRE is used in some situations where it is linked via a spe- + cial interface to another programming language which cannot use + pcre_free directly; it is for these cases that the functions are pro- + vided. + + +EXTRACTING CAPTURED SUBSTRINGS BY NAME + + int pcre_get_stringnumber(const pcre *code, + const char *name); + + int pcre_copy_named_substring(const pcre *code, + const char *subject, int *ovector, + int stringcount, const char *stringname, + char *buffer, int buffersize); + + int pcre_get_named_substring(const pcre *code, + const char *subject, int *ovector, + int stringcount, const char *stringname, + const char **stringptr); + + To extract a substring by name, you first have to find associated num- + ber. For example, for this pattern + + (a+)b(?P\d+)... + + the number of the subpattern called "xxx" is 2. You can find the number + from the name by calling pcre_get_stringnumber(). The first argument is + the compiled pattern, and the second is the name. The yield of the + function is the subpattern number, or PCRE_ERROR_NOSUBSTRING (-7) if + there is no subpattern of that name. + + Given the number, you can extract the substring directly, or use one of + the functions described in the previous section. For convenience, there + are also two functions that do the whole job. + + Most of the arguments of pcre_copy_named_substring() and + pcre_get_named_substring() are the same as those for the similarly + named functions that extract by number. As these are described in the + previous section, they are not re-described here. There are just two + differences: + + First, instead of a substring number, a substring name is given. Sec- + ond, there is an extra argument, given at the start, which is a pointer + to the compiled pattern. This is needed in order to gain access to the + name-to-number translation table. + + These functions call pcre_get_stringnumber(), and if it succeeds, they + then call pcre_copy_substring() or pcre_get_substring(), as appropri- + ate. + + +FINDING ALL POSSIBLE MATCHES + + The traditional matching function uses a similar algorithm to Perl, + which stops when it finds the first match, starting at a given point in + the subject. If you want to find all possible matches, or the longest + possible match, consider using the alternative matching function (see + below) instead. If you cannot use the alternative function, but still + need to find all possible matches, you can kludge it up by making use + of the callout facility, which is described in the pcrecallout documen- + tation. + + What you have to do is to insert a callout right at the end of the pat- + tern. When your callout function is called, extract and save the cur- + rent matched substring. Then return 1, which forces pcre_exec() to + backtrack and try other alternatives. Ultimately, when it runs out of + matches, pcre_exec() will yield PCRE_ERROR_NOMATCH. + + +MATCHING A PATTERN: THE ALTERNATIVE FUNCTION + + int pcre_dfa_exec(const pcre *code, const pcre_extra *extra, + const char *subject, int length, int startoffset, + int options, int *ovector, int ovecsize, + int *workspace, int wscount); + + The function pcre_dfa_exec() is called to match a subject string + against a compiled pattern, using a "DFA" matching algorithm. This has + different characteristics to the normal algorithm, and is not compati- + ble with Perl. Some of the features of PCRE patterns are not supported. + Nevertheless, there are times when this kind of matching can be useful. + For a discussion of the two matching algorithms, see the pcrematching + documentation. + + The arguments for the pcre_dfa_exec() function are the same as for + pcre_exec(), plus two extras. The ovector argument is used in a differ- + ent way, and this is described below. The other common arguments are + used in the same way as for pcre_exec(), so their description is not + repeated here. + + The two additional arguments provide workspace for the function. The + workspace vector should contain at least 20 elements. It is used for + keeping track of multiple paths through the pattern tree. More + workspace will be needed for patterns and subjects where there are a + lot of possible matches. + + Here is an example of a simple call to pcre_exec(): + + int rc; + int ovector[10]; + int wspace[20]; + rc = pcre_exec( + re, /* result of pcre_compile() */ + NULL, /* we didn't study the pattern */ + "some string", /* the subject string */ + 11, /* the length of the subject string */ + 0, /* start at offset 0 in the subject */ + 0, /* default options */ + ovector, /* vector of integers for substring information */ + 10, /* number of elements (NOT size in bytes) */ + wspace, /* working space vector */ + 20); /* number of elements (NOT size in bytes) */ + + Option bits for pcre_dfa_exec() + + The unused bits of the options argument for pcre_dfa_exec() must be + zero. The only bits that may be set are PCRE_ANCHORED, PCRE_NOTBOL, + PCRE_NOTEOL, PCRE_NOTEMPTY, PCRE_NO_UTF8_CHECK, PCRE_PARTIAL, + PCRE_DFA_SHORTEST, and PCRE_DFA_RESTART. All but the last three of + these are the same as for pcre_exec(), so their description is not + repeated here. + + PCRE_PARTIAL + + This has the same general effect as it does for pcre_exec(), but the + details are slightly different. When PCRE_PARTIAL is set for + pcre_dfa_exec(), the return code PCRE_ERROR_NOMATCH is converted into + PCRE_ERROR_PARTIAL if the end of the subject is reached, there have + been no complete matches, but there is still at least one matching pos- + sibility. The portion of the string that provided the partial match is + set as the first matching string. + + PCRE_DFA_SHORTEST + + Setting the PCRE_DFA_SHORTEST option causes the matching algorithm to + stop as soon as it has found one match. Because of the way the DFA + algorithm works, this is necessarily the shortest possible match at the + first possible matching point in the subject string. + + PCRE_DFA_RESTART + + When pcre_dfa_exec() is called with the PCRE_PARTIAL option, and + returns a partial match, it is possible to call it again, with addi- + tional subject characters, and have it continue with the same match. + The PCRE_DFA_RESTART option requests this action; when it is set, the + workspace and wscount options must reference the same vector as before + because data about the match so far is left in them after a partial + match. There is more discussion of this facility in the pcrepartial + documentation. + + Successful returns from pcre_dfa_exec() + + When pcre_dfa_exec() succeeds, it may have matched more than one sub- + string in the subject. Note, however, that all the matches from one run + of the function start at the same point in the subject. The shorter + matches are all initial substrings of the longer matches. For example, + if the pattern + + <.*> + + is matched against the string + + This is no more + + the three matched strings are + + + + + + On success, the yield of the function is a number greater than zero, + which is the number of matched substrings. The substrings themselves + are returned in ovector. Each string uses two elements; the first is + the offset to the start, and the second is the offset to the end. All + the strings have the same start offset. (Space could have been saved by + giving this only once, but it was decided to retain some compatibility + with the way pcre_exec() returns data, even though the meaning of the + strings is different.) + + The strings are returned in reverse order of length; that is, the long- + est matching string is given first. If there were too many matches to + fit into ovector, the yield of the function is zero, and the vector is + filled with the longest matches. + + Error returns from pcre_dfa_exec() + + The pcre_dfa_exec() function returns a negative number when it fails. + Many of the errors are the same as for pcre_exec(), and these are + described above. There are in addition the following errors that are + specific to pcre_dfa_exec(): + + PCRE_ERROR_DFA_UITEM (-16) + + This return is given if pcre_dfa_exec() encounters an item in the pat- + tern that it does not support, for instance, the use of \C or a back + reference. + + PCRE_ERROR_DFA_UCOND (-17) + + This return is given if pcre_dfa_exec() encounters a condition item in + a pattern that uses a back reference for the condition. This is not + supported. + + PCRE_ERROR_DFA_UMLIMIT (-18) + + This return is given if pcre_dfa_exec() is called with an extra block + that contains a setting of the match_limit field. This is not supported + (it is meaningless). + + PCRE_ERROR_DFA_WSSIZE (-19) + + This return is given if pcre_dfa_exec() runs out of space in the + workspace vector. + + PCRE_ERROR_DFA_RECURSE (-20) + + When a recursive subpattern is processed, the matching function calls + itself recursively, using private vectors for ovector and workspace. + This error is given if the output vector is not large enough. This + should be extremely rare, as a vector of size 1000 is used. + +Last updated: 16 May 2005 +Copyright (c) 1997-2005 University of Cambridge. +------------------------------------------------------------------------------ + + +PCRECALLOUT(3) PCRECALLOUT(3) + + +NAME + PCRE - Perl-compatible regular expressions + + +PCRE CALLOUTS + + int (*pcre_callout)(pcre_callout_block *); + + PCRE provides a feature called "callout", which is a means of temporar- + ily passing control to the caller of PCRE in the middle of pattern + matching. The caller of PCRE provides an external function by putting + its entry point in the global variable pcre_callout. By default, this + variable contains NULL, which disables all calling out. + + Within a regular expression, (?C) indicates the points at which the + external function is to be called. Different callout points can be + identified by putting a number less than 256 after the letter C. The + default value is zero. For example, this pattern has two callout + points: + + (?C1)eabc(?C2)def + + If the PCRE_AUTO_CALLOUT option bit is set when pcre_compile() is + called, PCRE automatically inserts callouts, all with number 255, + before each item in the pattern. For example, if PCRE_AUTO_CALLOUT is + used with the pattern + + A(\d{2}|--) + + it is processed as if it were + + (?C255)A(?C255)((?C255)\d{2}(?C255)|(?C255)-(?C255)-(?C255))(?C255) + + Notice that there is a callout before and after each parenthesis and + alternation bar. Automatic callouts can be used for tracking the + progress of pattern matching. The pcretest command has an option that + sets automatic callouts; when it is used, the output indicates how the + pattern is matched. This is useful information when you are trying to + optimize the performance of a particular pattern. + + +MISSING CALLOUTS + + You should be aware that, because of optimizations in the way PCRE + matches patterns, callouts sometimes do not happen. For example, if the + pattern is + + ab(?C4)cd + + PCRE knows that any matching string must contain the letter "d". If the + subject string is "abyz", the lack of "d" means that matching doesn't + ever start, and the callout is never reached. However, with "abyd", + though the result is still no match, the callout is obeyed. + + +THE CALLOUT INTERFACE + + During matching, when PCRE reaches a callout point, the external func- + tion defined by pcre_callout is called (if it is set). This applies to + both the pcre_exec() and the pcre_dfa_exec() matching functions. The + only argument to the callout function is a pointer to a pcre_callout + block. This structure contains the following fields: + + int version; + int callout_number; + int *offset_vector; + const char *subject; + int subject_length; + int start_match; + int current_position; + int capture_top; + int capture_last; + void *callout_data; + int pattern_position; + int next_item_length; + + The version field is an integer containing the version number of the + block format. The initial version was 0; the current version is 1. The + version number will change again in future if additional fields are + added, but the intention is never to remove any of the existing fields. + + The callout_number field contains the number of the callout, as com- + piled into the pattern (that is, the number after ?C for manual call- + outs, and 255 for automatically generated callouts). + + The offset_vector field is a pointer to the vector of offsets that was + passed by the caller to pcre_exec() or pcre_dfa_exec(). When + pcre_exec() is used, the contents can be inspected in order to extract + substrings that have been matched so far, in the same way as for + extracting substrings after a match has completed. For pcre_dfa_exec() + this field is not useful. + + The subject and subject_length fields contain copies of the values that + were passed to pcre_exec(). + + The start_match field contains the offset within the subject at which + the current match attempt started. If the pattern is not anchored, the + callout function may be called several times from the same point in the + pattern for different starting points in the subject. + + The current_position field contains the offset within the subject of + the current match pointer. + + When the pcre_exec() function is used, the capture_top field contains + one more than the number of the highest numbered captured substring so + far. If no substrings have been captured, the value of capture_top is + one. This is always the case when pcre_dfa_exec() is used, because it + does not support captured substrings. + + The capture_last field contains the number of the most recently cap- + tured substring. If no substrings have been captured, its value is -1. + This is always the case when pcre_dfa_exec() is used. + + The callout_data field contains a value that is passed to pcre_exec() + or pcre_dfa_exec() specifically so that it can be passed back in call- + outs. It is passed in the pcre_callout field of the pcre_extra data + structure. If no such data was passed, the value of callout_data in a + pcre_callout block is NULL. There is a description of the pcre_extra + structure in the pcreapi documentation. + + The pattern_position field is present from version 1 of the pcre_call- + out structure. It contains the offset to the next item to be matched in + the pattern string. + + The next_item_length field is present from version 1 of the pcre_call- + out structure. It contains the length of the next item to be matched in + the pattern string. When the callout immediately precedes an alterna- + tion bar, a closing parenthesis, or the end of the pattern, the length + is zero. When the callout precedes an opening parenthesis, the length + is that of the entire subpattern. + + The pattern_position and next_item_length fields are intended to help + in distinguishing between different automatic callouts, which all have + the same callout number. However, they are set for all callouts. + + +RETURN VALUES + + The external callout function returns an integer to PCRE. If the value + is zero, matching proceeds as normal. If the value is greater than + zero, matching fails at the current point, but the testing of other + matching possibilities goes ahead, just as if a lookahead assertion had + failed. If the value is less than zero, the match is abandoned, and + pcre_exec() (or pcre_dfa_exec()) returns the negative value. + + Negative values should normally be chosen from the set of + PCRE_ERROR_xxx values. In particular, PCRE_ERROR_NOMATCH forces a stan- + dard "no match" failure. The error number PCRE_ERROR_CALLOUT is + reserved for use by callout functions; it will never be used by PCRE + itself. + +Last updated: 28 February 2005 +Copyright (c) 1997-2005 University of Cambridge. +------------------------------------------------------------------------------ + + +PCRECOMPAT(3) PCRECOMPAT(3) + + +NAME + PCRE - Perl-compatible regular expressions + + +DIFFERENCES BETWEEN PCRE AND PERL + + This document describes the differences in the ways that PCRE and Perl + handle regular expressions. The differences described here are with + respect to Perl 5.8. + + 1. PCRE does not have full UTF-8 support. Details of what it does have + are given in the section on UTF-8 support in the main pcre page. + + 2. PCRE does not allow repeat quantifiers on lookahead assertions. Perl + permits them, but they do not mean what you might think. For example, + (?!a){3} does not assert that the next three characters are not "a". It + just asserts that the next character is not "a" three times. + + 3. Capturing subpatterns that occur inside negative lookahead asser- + tions are counted, but their entries in the offsets vector are never + set. Perl sets its numerical variables from any such patterns that are + matched before the assertion fails to match something (thereby succeed- + ing), but only if the negative lookahead assertion contains just one + branch. + + 4. Though binary zero characters are supported in the subject string, + they are not allowed in a pattern string because it is passed as a nor- + mal C string, terminated by zero. The escape sequence \0 can be used in + the pattern to represent a binary zero. + + 5. The following Perl escape sequences are not supported: \l, \u, \L, + \U, and \N. In fact these are implemented by Perl's general string-han- + dling and are not part of its pattern matching engine. If any of these + are encountered by PCRE, an error is generated. + + 6. The Perl escape sequences \p, \P, and \X are supported only if PCRE + is built with Unicode character property support. The properties that + can be tested with \p and \P are limited to the general category prop- + erties such as Lu and Nd. + + 7. PCRE does support the \Q...\E escape for quoting substrings. Charac- + ters in between are treated as literals. This is slightly different + from Perl in that $ and @ are also handled as literals inside the + quotes. In Perl, they cause variable interpolation (but of course PCRE + does not have variables). Note the following examples: + + Pattern PCRE matches Perl matches + + \Qabc$xyz\E abc$xyz abc followed by the + contents of $xyz + \Qabc\$xyz\E abc\$xyz abc\$xyz + \Qabc\E\$\Qxyz\E abc$xyz abc$xyz + + The \Q...\E sequence is recognized both inside and outside character + classes. + + 8. Fairly obviously, PCRE does not support the (?{code}) and (?p{code}) + constructions. However, there is support for recursive patterns using + the non-Perl items (?R), (?number), and (?P>name). Also, the PCRE + "callout" feature allows an external function to be called during pat- + tern matching. See the pcrecallout documentation for details. + + 9. There are some differences that are concerned with the settings of + captured strings when part of a pattern is repeated. For example, + matching "aba" against the pattern /^(a(b)?)+$/ in Perl leaves $2 + unset, but in PCRE it is set to "b". + + 10. PCRE provides some extensions to the Perl regular expression facil- + ities: + + (a) Although lookbehind assertions must match fixed length strings, + each alternative branch of a lookbehind assertion can match a different + length of string. Perl requires them all to have the same length. + + (b) If PCRE_DOLLAR_ENDONLY is set and PCRE_MULTILINE is not set, the $ + meta-character matches only at the very end of the string. + + (c) If PCRE_EXTRA is set, a backslash followed by a letter with no spe- + cial meaning is faulted. + + (d) If PCRE_UNGREEDY is set, the greediness of the repetition quanti- + fiers is inverted, that is, by default they are not greedy, but if fol- + lowed by a question mark they are. + + (e) PCRE_ANCHORED can be used at matching time to force a pattern to be + tried only at the first matching position in the subject string. + + (f) The PCRE_NOTBOL, PCRE_NOTEOL, PCRE_NOTEMPTY, and PCRE_NO_AUTO_CAP- + TURE options for pcre_exec() have no Perl equivalents. + + (g) The (?R), (?number), and (?P>name) constructs allows for recursive + pattern matching (Perl can do this using the (?p{code}) construct, + which PCRE cannot support.) + + (h) PCRE supports named capturing substrings, using the Python syntax. + + (i) PCRE supports the possessive quantifier "++" syntax, taken from + Sun's Java package. + + (j) The (R) condition, for testing recursion, is a PCRE extension. + + (k) The callout facility is PCRE-specific. + + (l) The partial matching facility is PCRE-specific. + + (m) Patterns compiled by PCRE can be saved and re-used at a later time, + even on different hosts that have the other endianness. + + (n) The alternative matching function (pcre_dfa_exec()) matches in a + different way and is not Perl-compatible. + +Last updated: 28 February 2005 +Copyright (c) 1997-2005 University of Cambridge. +------------------------------------------------------------------------------ + + +PCREPATTERN(3) PCREPATTERN(3) + + +NAME + PCRE - Perl-compatible regular expressions + + +PCRE REGULAR EXPRESSION DETAILS + + The syntax and semantics of the regular expressions supported by PCRE + are described below. Regular expressions are also described in the Perl + documentation and in a number of books, some of which have copious + examples. Jeffrey Friedl's "Mastering Regular Expressions", published + by O'Reilly, covers regular expressions in great detail. This descrip- + tion of PCRE's regular expressions is intended as reference material. + + The original operation of PCRE was on strings of one-byte characters. + However, there is now also support for UTF-8 character strings. To use + this, you must build PCRE to include UTF-8 support, and then call + pcre_compile() with the PCRE_UTF8 option. How this affects pattern + matching is mentioned in several places below. There is also a summary + of UTF-8 features in the section on UTF-8 support in the main pcre + page. + + The remainder of this document discusses the patterns that are sup- + ported by PCRE when its main matching function, pcre_exec(), is used. + From release 6.0, PCRE offers a second matching function, + pcre_dfa_exec(), which matches using a different algorithm that is not + Perl-compatible. The advantages and disadvantages of the alternative + function, and how it differs from the normal function, are discussed in + the pcrematching page. + + A regular expression is a pattern that is matched against a subject + string from left to right. Most characters stand for themselves in a + pattern, and match the corresponding characters in the subject. As a + trivial example, the pattern + + The quick brown fox + + matches a portion of a subject string that is identical to itself. When + caseless matching is specified (the PCRE_CASELESS option), letters are + matched independently of case. In UTF-8 mode, PCRE always understands + the concept of case for characters whose values are less than 128, so + caseless matching is always possible. For characters with higher val- + ues, the concept of case is supported if PCRE is compiled with Unicode + property support, but not otherwise. If you want to use caseless + matching for characters 128 and above, you must ensure that PCRE is + compiled with Unicode property support as well as with UTF-8 support. + + The power of regular expressions comes from the ability to include + alternatives and repetitions in the pattern. These are encoded in the + pattern by the use of metacharacters, which do not stand for themselves + but instead are interpreted in some special way. + + There are two different sets of metacharacters: those that are recog- + nized anywhere in the pattern except within square brackets, and those + that are recognized in square brackets. Outside square brackets, the + metacharacters are as follows: + + \ general escape character with several uses + ^ assert start of string (or line, in multiline mode) + $ assert end of string (or line, in multiline mode) + . match any character except newline (by default) + [ start character class definition + | start of alternative branch + ( start subpattern + ) end subpattern + ? extends the meaning of ( + also 0 or 1 quantifier + also quantifier minimizer + * 0 or more quantifier + + 1 or more quantifier + also "possessive quantifier" + { start min/max quantifier + + Part of a pattern that is in square brackets is called a "character + class". In a character class the only metacharacters are: + + \ general escape character + ^ negate the class, but only if the first character + - indicates character range + [ POSIX character class (only if followed by POSIX + syntax) + ] terminates the character class + + The following sections describe the use of each of the metacharacters. + + +BACKSLASH + + The backslash character has several uses. Firstly, if it is followed by + a non-alphanumeric character, it takes away any special meaning that + character may have. This use of backslash as an escape character + applies both inside and outside character classes. + + For example, if you want to match a * character, you write \* in the + pattern. This escaping action applies whether or not the following + character would otherwise be interpreted as a metacharacter, so it is + always safe to precede a non-alphanumeric with backslash to specify + that it stands for itself. In particular, if you want to match a back- + slash, you write \\. + + If a pattern is compiled with the PCRE_EXTENDED option, whitespace in + the pattern (other than in a character class) and characters between a + # outside a character class and the next newline character are ignored. + An escaping backslash can be used to include a whitespace or # charac- + ter as part of the pattern. + + If you want to remove the special meaning from a sequence of charac- + ters, you can do so by putting them between \Q and \E. This is differ- + ent from Perl in that $ and @ are handled as literals in \Q...\E + sequences in PCRE, whereas in Perl, $ and @ cause variable interpola- + tion. Note the following examples: + + Pattern PCRE matches Perl matches + + \Qabc$xyz\E abc$xyz abc followed by the + contents of $xyz + \Qabc\$xyz\E abc\$xyz abc\$xyz + \Qabc\E\$\Qxyz\E abc$xyz abc$xyz + + The \Q...\E sequence is recognized both inside and outside character + classes. + + Non-printing characters + + A second use of backslash provides a way of encoding non-printing char- + acters in patterns in a visible manner. There is no restriction on the + appearance of non-printing characters, apart from the binary zero that + terminates a pattern, but when a pattern is being prepared by text + editing, it is usually easier to use one of the following escape + sequences than the binary character it represents: + + \a alarm, that is, the BEL character (hex 07) + \cx "control-x", where x is any character + \e escape (hex 1B) + \f formfeed (hex 0C) + \n newline (hex 0A) + \r carriage return (hex 0D) + \t tab (hex 09) + \ddd character with octal code ddd, or backreference + \xhh character with hex code hh + \x{hhh..} character with hex code hhh... (UTF-8 mode only) + + The precise effect of \cx is as follows: if x is a lower case letter, + it is converted to upper case. Then bit 6 of the character (hex 40) is + inverted. Thus \cz becomes hex 1A, but \c{ becomes hex 3B, while \c; + becomes hex 7B. + + After \x, from zero to two hexadecimal digits are read (letters can be + in upper or lower case). In UTF-8 mode, any number of hexadecimal dig- + its may appear between \x{ and }, but the value of the character code + must be less than 2**31 (that is, the maximum hexadecimal value is + 7FFFFFFF). If characters other than hexadecimal digits appear between + \x{ and }, or if there is no terminating }, this form of escape is not + recognized. Instead, the initial \x will be interpreted as a basic + hexadecimal escape, with no following digits, giving a character whose + value is zero. + + Characters whose value is less than 256 can be defined by either of the + two syntaxes for \x when PCRE is in UTF-8 mode. There is no difference + in the way they are handled. For example, \xdc is exactly the same as + \x{dc}. + + After \0 up to two further octal digits are read. In both cases, if + there are fewer than two digits, just those that are present are used. + Thus the sequence \0\x\07 specifies two binary zeros followed by a BEL + character (code value 7). Make sure you supply two digits after the + initial zero if the pattern character that follows is itself an octal + digit. + + The handling of a backslash followed by a digit other than 0 is compli- + cated. Outside a character class, PCRE reads it and any following dig- + its as a decimal number. If the number is less than 10, or if there + have been at least that many previous capturing left parentheses in the + expression, the entire sequence is taken as a back reference. A + description of how this works is given later, following the discussion + of parenthesized subpatterns. + + Inside a character class, or if the decimal number is greater than 9 + and there have not been that many capturing subpatterns, PCRE re-reads + up to three octal digits following the backslash, and generates a sin- + gle byte from the least significant 8 bits of the value. Any subsequent + digits stand for themselves. For example: + + \040 is another way of writing a space + \40 is the same, provided there are fewer than 40 + previous capturing subpatterns + \7 is always a back reference + \11 might be a back reference, or another way of + writing a tab + \011 is always a tab + \0113 is a tab followed by the character "3" + \113 might be a back reference, otherwise the + character with octal code 113 + \377 might be a back reference, otherwise + the byte consisting entirely of 1 bits + \81 is either a back reference, or a binary zero + followed by the two characters "8" and "1" + + Note that octal values of 100 or greater must not be introduced by a + leading zero, because no more than three octal digits are ever read. + + All the sequences that define a single byte value or a single UTF-8 + character (in UTF-8 mode) can be used both inside and outside character + classes. In addition, inside a character class, the sequence \b is + interpreted as the backspace character (hex 08), and the sequence \X is + interpreted as the character "X". Outside a character class, these + sequences have different meanings (see below). + + Generic character types + + The third use of backslash is for specifying generic character types. + The following are always recognized: + + \d any decimal digit + \D any character that is not a decimal digit + \s any whitespace character + \S any character that is not a whitespace character + \w any "word" character + \W any "non-word" character + + Each pair of escape sequences partitions the complete set of characters + into two disjoint sets. Any given character matches one, and only one, + of each pair. + + These character type sequences can appear both inside and outside char- + acter classes. They each match one character of the appropriate type. + If the current matching point is at the end of the subject string, all + of them fail, since there is no character to match. + + For compatibility with Perl, \s does not match the VT character (code + 11). This makes it different from the the POSIX "space" class. The \s + characters are HT (9), LF (10), FF (12), CR (13), and space (32). + + A "word" character is an underscore or any character less than 256 that + is a letter or digit. The definition of letters and digits is con- + trolled by PCRE's low-valued character tables, and may vary if locale- + specific matching is taking place (see "Locale support" in the pcreapi + page). For example, in the "fr_FR" (French) locale, some character + codes greater than 128 are used for accented letters, and these are + matched by \w. + + In UTF-8 mode, characters with values greater than 128 never match \d, + \s, or \w, and always match \D, \S, and \W. This is true even when Uni- + code character property support is available. + + Unicode character properties + + When PCRE is built with Unicode character property support, three addi- + tional escape sequences to match generic character types are available + when UTF-8 mode is selected. They are: + + \p{xx} a character with the xx property + \P{xx} a character without the xx property + \X an extended Unicode sequence + + The property names represented by xx above are limited to the Unicode + general category properties. Each character has exactly one such prop- + erty, specified by a two-letter abbreviation. For compatibility with + Perl, negation can be specified by including a circumflex between the + opening brace and the property name. For example, \p{^Lu} is the same + as \P{Lu}. + + If only one letter is specified with \p or \P, it includes all the + properties that start with that letter. In this case, in the absence of + negation, the curly brackets in the escape sequence are optional; these + two examples have the same effect: + + \p{L} + \pL + + The following property codes are supported: + + C Other + Cc Control + Cf Format + Cn Unassigned + Co Private use + Cs Surrogate + + L Letter + Ll Lower case letter + Lm Modifier letter + Lo Other letter + Lt Title case letter + Lu Upper case letter + + M Mark + Mc Spacing mark + Me Enclosing mark + Mn Non-spacing mark + + N Number + Nd Decimal number + Nl Letter number + No Other number + + P Punctuation + Pc Connector punctuation + Pd Dash punctuation + Pe Close punctuation + Pf Final punctuation + Pi Initial punctuation + Po Other punctuation + Ps Open punctuation + + S Symbol + Sc Currency symbol + Sk Modifier symbol + Sm Mathematical symbol + So Other symbol + + Z Separator + Zl Line separator + Zp Paragraph separator + Zs Space separator + + Extended properties such as "Greek" or "InMusicalSymbols" are not sup- + ported by PCRE. + + Specifying caseless matching does not affect these escape sequences. + For example, \p{Lu} always matches only upper case letters. + + The \X escape matches any number of Unicode characters that form an + extended Unicode sequence. \X is equivalent to + + (?>\PM\pM*) + + That is, it matches a character without the "mark" property, followed + by zero or more characters with the "mark" property, and treats the + sequence as an atomic group (see below). Characters with the "mark" + property are typically accents that affect the preceding character. + + Matching characters by Unicode property is not fast, because PCRE has + to search a structure that contains data for over fifteen thousand + characters. That is why the traditional escape sequences such as \d and + \w do not use Unicode properties in PCRE. + + Simple assertions + + The fourth use of backslash is for certain simple assertions. An asser- + tion specifies a condition that has to be met at a particular point in + a match, without consuming any characters from the subject string. The + use of subpatterns for more complicated assertions is described below. + The backslashed assertions are: + + \b matches at a word boundary + \B matches when not at a word boundary + \A matches at start of subject + \Z matches at end of subject or before newline at end + \z matches at end of subject + \G matches at first matching position in subject + + These assertions may not appear in character classes (but note that \b + has a different meaning, namely the backspace character, inside a char- + acter class). + + A word boundary is a position in the subject string where the current + character and the previous character do not both match \w or \W (i.e. + one matches \w and the other matches \W), or the start or end of the + string if the first or last character matches \w, respectively. + + The \A, \Z, and \z assertions differ from the traditional circumflex + and dollar (described in the next section) in that they only ever match + at the very start and end of the subject string, whatever options are + set. Thus, they are independent of multiline mode. These three asser- + tions are not affected by the PCRE_NOTBOL or PCRE_NOTEOL options, which + affect only the behaviour of the circumflex and dollar metacharacters. + However, if the startoffset argument of pcre_exec() is non-zero, indi- + cating that matching is to start at a point other than the beginning of + the subject, \A can never match. The difference between \Z and \z is + that \Z matches before a newline that is the last character of the + string as well as at the end of the string, whereas \z matches only at + the end. + + The \G assertion is true only when the current matching position is at + the start point of the match, as specified by the startoffset argument + of pcre_exec(). It differs from \A when the value of startoffset is + non-zero. By calling pcre_exec() multiple times with appropriate argu- + ments, you can mimic Perl's /g option, and it is in this kind of imple- + mentation where \G can be useful. + + Note, however, that PCRE's interpretation of \G, as the start of the + current match, is subtly different from Perl's, which defines it as the + end of the previous match. In Perl, these can be different when the + previously matched string was empty. Because PCRE does just one match + at a time, it cannot reproduce this behaviour. + + If all the alternatives of a pattern begin with \G, the expression is + anchored to the starting match position, and the "anchored" flag is set + in the compiled regular expression. + + +CIRCUMFLEX AND DOLLAR + + Outside a character class, in the default matching mode, the circumflex + character is an assertion that is true only if the current matching + point is at the start of the subject string. If the startoffset argu- + ment of pcre_exec() is non-zero, circumflex can never match if the + PCRE_MULTILINE option is unset. Inside a character class, circumflex + has an entirely different meaning (see below). + + Circumflex need not be the first character of the pattern if a number + of alternatives are involved, but it should be the first thing in each + alternative in which it appears if the pattern is ever to match that + branch. If all possible alternatives start with a circumflex, that is, + if the pattern is constrained to match only at the start of the sub- + ject, it is said to be an "anchored" pattern. (There are also other + constructs that can cause a pattern to be anchored.) + + A dollar character is an assertion that is true only if the current + matching point is at the end of the subject string, or immediately + before a newline character that is the last character in the string (by + default). Dollar need not be the last character of the pattern if a + number of alternatives are involved, but it should be the last item in + any branch in which it appears. Dollar has no special meaning in a + character class. + + The meaning of dollar can be changed so that it matches only at the + very end of the string, by setting the PCRE_DOLLAR_ENDONLY option at + compile time. This does not affect the \Z assertion. + + The meanings of the circumflex and dollar characters are changed if the + PCRE_MULTILINE option is set. When this is the case, they match immedi- + ately after and immediately before an internal newline character, + respectively, in addition to matching at the start and end of the sub- + ject string. For example, the pattern /^abc$/ matches the subject + string "def\nabc" (where \n represents a newline character) in multi- + line mode, but not otherwise. Consequently, patterns that are anchored + in single line mode because all branches start with ^ are not anchored + in multiline mode, and a match for circumflex is possible when the + startoffset argument of pcre_exec() is non-zero. The PCRE_DOL- + LAR_ENDONLY option is ignored if PCRE_MULTILINE is set. + + Note that the sequences \A, \Z, and \z can be used to match the start + and end of the subject in both modes, and if all branches of a pattern + start with \A it is always anchored, whether PCRE_MULTILINE is set or + not. + + +FULL STOP (PERIOD, DOT) + + Outside a character class, a dot in the pattern matches any one charac- + ter in the subject, including a non-printing character, but not (by + default) newline. In UTF-8 mode, a dot matches any UTF-8 character, + which might be more than one byte long, except (by default) newline. If + the PCRE_DOTALL option is set, dots match newlines as well. The han- + dling of dot is entirely independent of the handling of circumflex and + dollar, the only relationship being that they both involve newline + characters. Dot has no special meaning in a character class. + + +MATCHING A SINGLE BYTE + + Outside a character class, the escape sequence \C matches any one byte, + both in and out of UTF-8 mode. Unlike a dot, it can match a newline. + The feature is provided in Perl in order to match individual bytes in + UTF-8 mode. Because it breaks up UTF-8 characters into individual + bytes, what remains in the string may be a malformed UTF-8 string. For + this reason, the \C escape sequence is best avoided. + + PCRE does not allow \C to appear in lookbehind assertions (described + below), because in UTF-8 mode this would make it impossible to calcu- + late the length of the lookbehind. + + +SQUARE BRACKETS AND CHARACTER CLASSES + + An opening square bracket introduces a character class, terminated by a + closing square bracket. A closing square bracket on its own is not spe- + cial. If a closing square bracket is required as a member of the class, + it should be the first data character in the class (after an initial + circumflex, if present) or escaped with a backslash. + + A character class matches a single character in the subject. In UTF-8 + mode, the character may occupy more than one byte. A matched character + must be in the set of characters defined by the class, unless the first + character in the class definition is a circumflex, in which case the + subject character must not be in the set defined by the class. If a + circumflex is actually required as a member of the class, ensure it is + not the first character, or escape it with a backslash. + + For example, the character class [aeiou] matches any lower case vowel, + while [^aeiou] matches any character that is not a lower case vowel. + Note that a circumflex is just a convenient notation for specifying the + characters that are in the class by enumerating those that are not. A + class that starts with a circumflex is not an assertion: it still con- + sumes a character from the subject string, and therefore it fails if + the current pointer is at the end of the string. + + In UTF-8 mode, characters with values greater than 255 can be included + in a class as a literal string of bytes, or by using the \x{ escaping + mechanism. + + When caseless matching is set, any letters in a class represent both + their upper case and lower case versions, so for example, a caseless + [aeiou] matches "A" as well as "a", and a caseless [^aeiou] does not + match "A", whereas a caseful version would. In UTF-8 mode, PCRE always + understands the concept of case for characters whose values are less + than 128, so caseless matching is always possible. For characters with + higher values, the concept of case is supported if PCRE is compiled + with Unicode property support, but not otherwise. If you want to use + caseless matching for characters 128 and above, you must ensure that + PCRE is compiled with Unicode property support as well as with UTF-8 + support. + + The newline character is never treated in any special way in character + classes, whatever the setting of the PCRE_DOTALL or PCRE_MULTILINE + options is. A class such as [^a] will always match a newline. + + The minus (hyphen) character can be used to specify a range of charac- + ters in a character class. For example, [d-m] matches any letter + between d and m, inclusive. If a minus character is required in a + class, it must be escaped with a backslash or appear in a position + where it cannot be interpreted as indicating a range, typically as the + first or last character in the class. + + It is not possible to have the literal character "]" as the end charac- + ter of a range. A pattern such as [W-]46] is interpreted as a class of + two characters ("W" and "-") followed by a literal string "46]", so it + would match "W46]" or "-46]". However, if the "]" is escaped with a + backslash it is interpreted as the end of range, so [W-\]46] is inter- + preted as a class containing a range followed by two other characters. + The octal or hexadecimal representation of "]" can also be used to end + a range. + + Ranges operate in the collating sequence of character values. They can + also be used for characters specified numerically, for example + [\000-\037]. In UTF-8 mode, ranges can include characters whose values + are greater than 255, for example [\x{100}-\x{2ff}]. + + If a range that includes letters is used when caseless matching is set, + it matches the letters in either case. For example, [W-c] is equivalent + to [][\\^_`wxyzabc], matched caselessly, and in non-UTF-8 mode, if + character tables for the "fr_FR" locale are in use, [\xc8-\xcb] matches + accented E characters in both cases. In UTF-8 mode, PCRE supports the + concept of case for characters with values greater than 128 only when + it is compiled with Unicode property support. + + The character types \d, \D, \p, \P, \s, \S, \w, and \W may also appear + in a character class, and add the characters that they match to the + class. For example, [\dABCDEF] matches any hexadecimal digit. A circum- + flex can conveniently be used with the upper case character types to + specify a more restricted set of characters than the matching lower + case type. For example, the class [^\W_] matches any letter or digit, + but not underscore. + + The only metacharacters that are recognized in character classes are + backslash, hyphen (only where it can be interpreted as specifying a + range), circumflex (only at the start), opening square bracket (only + when it can be interpreted as introducing a POSIX class name - see the + next section), and the terminating closing square bracket. However, + escaping other non-alphanumeric characters does no harm. + + +POSIX CHARACTER CLASSES + + Perl supports the POSIX notation for character classes. This uses names + enclosed by [: and :] within the enclosing square brackets. PCRE also + supports this notation. For example, + + [01[:alpha:]%] + + matches "0", "1", any alphabetic character, or "%". The supported class + names are + + alnum letters and digits + alpha letters + ascii character codes 0 - 127 + blank space or tab only + cntrl control characters + digit decimal digits (same as \d) + graph printing characters, excluding space + lower lower case letters + print printing characters, including space + punct printing characters, excluding letters and digits + space white space (not quite the same as \s) + upper upper case letters + word "word" characters (same as \w) + xdigit hexadecimal digits + + The "space" characters are HT (9), LF (10), VT (11), FF (12), CR (13), + and space (32). Notice that this list includes the VT character (code + 11). This makes "space" different to \s, which does not include VT (for + Perl compatibility). + + The name "word" is a Perl extension, and "blank" is a GNU extension + from Perl 5.8. Another Perl extension is negation, which is indicated + by a ^ character after the colon. For example, + + [12[:^digit:]] + + matches "1", "2", or any non-digit. PCRE (and Perl) also recognize the + POSIX syntax [.ch.] and [=ch=] where "ch" is a "collating element", but + these are not supported, and an error is given if they are encountered. + + In UTF-8 mode, characters with values greater than 128 do not match any + of the POSIX character classes. + + +VERTICAL BAR + + Vertical bar characters are used to separate alternative patterns. For + example, the pattern + + gilbert|sullivan + + matches either "gilbert" or "sullivan". Any number of alternatives may + appear, and an empty alternative is permitted (matching the empty + string). The matching process tries each alternative in turn, from + left to right, and the first one that succeeds is used. If the alterna- + tives are within a subpattern (defined below), "succeeds" means match- + ing the rest of the main pattern as well as the alternative in the sub- + pattern. + + +INTERNAL OPTION SETTING + + The settings of the PCRE_CASELESS, PCRE_MULTILINE, PCRE_DOTALL, and + PCRE_EXTENDED options can be changed from within the pattern by a + sequence of Perl option letters enclosed between "(?" and ")". The + option letters are + + i for PCRE_CASELESS + m for PCRE_MULTILINE + s for PCRE_DOTALL + x for PCRE_EXTENDED + + For example, (?im) sets caseless, multiline matching. It is also possi- + ble to unset these options by preceding the letter with a hyphen, and a + combined setting and unsetting such as (?im-sx), which sets PCRE_CASE- + LESS and PCRE_MULTILINE while unsetting PCRE_DOTALL and PCRE_EXTENDED, + is also permitted. If a letter appears both before and after the + hyphen, the option is unset. + + When an option change occurs at top level (that is, not inside subpat- + tern parentheses), the change applies to the remainder of the pattern + that follows. If the change is placed right at the start of a pattern, + PCRE extracts it into the global options (and it will therefore show up + in data extracted by the pcre_fullinfo() function). + + An option change within a subpattern affects only that part of the cur- + rent pattern that follows it, so + + (a(?i)b)c + + matches abc and aBc and no other strings (assuming PCRE_CASELESS is not + used). By this means, options can be made to have different settings + in different parts of the pattern. Any changes made in one alternative + do carry on into subsequent branches within the same subpattern. For + example, + + (a(?i)b|c) + + matches "ab", "aB", "c", and "C", even though when matching "C" the + first branch is abandoned before the option setting. This is because + the effects of option settings happen at compile time. There would be + some very weird behaviour otherwise. + + The PCRE-specific options PCRE_UNGREEDY and PCRE_EXTRA can be changed + in the same way as the Perl-compatible options by using the characters + U and X respectively. The (?X) flag setting is special in that it must + always occur earlier in the pattern than any of the additional features + it turns on, even when it is at top level. It is best to put it at the + start. + + +SUBPATTERNS + + Subpatterns are delimited by parentheses (round brackets), which can be + nested. Turning part of a pattern into a subpattern does two things: + + 1. It localizes a set of alternatives. For example, the pattern + + cat(aract|erpillar|) + + matches one of the words "cat", "cataract", or "caterpillar". Without + the parentheses, it would match "cataract", "erpillar" or the empty + string. + + 2. It sets up the subpattern as a capturing subpattern. This means + that, when the whole pattern matches, that portion of the subject + string that matched the subpattern is passed back to the caller via the + ovector argument of pcre_exec(). Opening parentheses are counted from + left to right (starting from 1) to obtain numbers for the capturing + subpatterns. + + For example, if the string "the red king" is matched against the pat- + tern + + the ((red|white) (king|queen)) + + the captured substrings are "red king", "red", and "king", and are num- + bered 1, 2, and 3, respectively. + + The fact that plain parentheses fulfil two functions is not always + helpful. There are often times when a grouping subpattern is required + without a capturing requirement. If an opening parenthesis is followed + by a question mark and a colon, the subpattern does not do any captur- + ing, and is not counted when computing the number of any subsequent + capturing subpatterns. For example, if the string "the white queen" is + matched against the pattern + + the ((?:red|white) (king|queen)) + + the captured substrings are "white queen" and "queen", and are numbered + 1 and 2. The maximum number of capturing subpatterns is 65535, and the + maximum depth of nesting of all subpatterns, both capturing and non- + capturing, is 200. + + As a convenient shorthand, if any option settings are required at the + start of a non-capturing subpattern, the option letters may appear + between the "?" and the ":". Thus the two patterns + + (?i:saturday|sunday) + (?:(?i)saturday|sunday) + + match exactly the same set of strings. Because alternative branches are + tried from left to right, and options are not reset until the end of + the subpattern is reached, an option setting in one branch does affect + subsequent branches, so the above patterns match "SUNDAY" as well as + "Saturday". + + +NAMED SUBPATTERNS + + Identifying capturing parentheses by number is simple, but it can be + very hard to keep track of the numbers in complicated regular expres- + sions. Furthermore, if an expression is modified, the numbers may + change. To help with this difficulty, PCRE supports the naming of sub- + patterns, something that Perl does not provide. The Python syntax + (?P...) is used. Names consist of alphanumeric characters and + underscores, and must be unique within a pattern. + + Named capturing parentheses are still allocated numbers as well as + names. The PCRE API provides function calls for extracting the name-to- + number translation table from a compiled pattern. There is also a con- + venience function for extracting a captured substring by name. For fur- + ther details see the pcreapi documentation. + + +REPETITION + + Repetition is specified by quantifiers, which can follow any of the + following items: + + a literal data character + the . metacharacter + the \C escape sequence + the \X escape sequence (in UTF-8 mode with Unicode properties) + an escape such as \d that matches a single character + a character class + a back reference (see next section) + a parenthesized subpattern (unless it is an assertion) + + The general repetition quantifier specifies a minimum and maximum num- + ber of permitted matches, by giving the two numbers in curly brackets + (braces), separated by a comma. The numbers must be less than 65536, + and the first must be less than or equal to the second. For example: + + z{2,4} + + matches "zz", "zzz", or "zzzz". A closing brace on its own is not a + special character. If the second number is omitted, but the comma is + present, there is no upper limit; if the second number and the comma + are both omitted, the quantifier specifies an exact number of required + matches. Thus + + [aeiou]{3,} + + matches at least 3 successive vowels, but may match many more, while + + \d{8} + + matches exactly 8 digits. An opening curly bracket that appears in a + position where a quantifier is not allowed, or one that does not match + the syntax of a quantifier, is taken as a literal character. For exam- + ple, {,6} is not a quantifier, but a literal string of four characters. + + In UTF-8 mode, quantifiers apply to UTF-8 characters rather than to + individual bytes. Thus, for example, \x{100}{2} matches two UTF-8 char- + acters, each of which is represented by a two-byte sequence. Similarly, + when Unicode property support is available, \X{3} matches three Unicode + extended sequences, each of which may be several bytes long (and they + may be of different lengths). + + The quantifier {0} is permitted, causing the expression to behave as if + the previous item and the quantifier were not present. + + For convenience (and historical compatibility) the three most common + quantifiers have single-character abbreviations: + + * is equivalent to {0,} + + is equivalent to {1,} + ? is equivalent to {0,1} + + It is possible to construct infinite loops by following a subpattern + that can match no characters with a quantifier that has no upper limit, + for example: + + (a?)* + + Earlier versions of Perl and PCRE used to give an error at compile time + for such patterns. However, because there are cases where this can be + useful, such patterns are now accepted, but if any repetition of the + subpattern does in fact match no characters, the loop is forcibly bro- + ken. + + By default, the quantifiers are "greedy", that is, they match as much + as possible (up to the maximum number of permitted times), without + causing the rest of the pattern to fail. The classic example of where + this gives problems is in trying to match comments in C programs. These + appear between /* and */ and within the comment, individual * and / + characters may appear. An attempt to match C comments by applying the + pattern + + /\*.*\*/ + + to the string + + /* first comment */ not comment /* second comment */ + + fails, because it matches the entire string owing to the greediness of + the .* item. + + However, if a quantifier is followed by a question mark, it ceases to + be greedy, and instead matches the minimum number of times possible, so + the pattern + + /\*.*?\*/ + + does the right thing with the C comments. The meaning of the various + quantifiers is not otherwise changed, just the preferred number of + matches. Do not confuse this use of question mark with its use as a + quantifier in its own right. Because it has two uses, it can sometimes + appear doubled, as in + + \d??\d + + which matches one digit by preference, but can match two if that is the + only way the rest of the pattern matches. + + If the PCRE_UNGREEDY option is set (an option which is not available in + Perl), the quantifiers are not greedy by default, but individual ones + can be made greedy by following them with a question mark. In other + words, it inverts the default behaviour. + + When a parenthesized subpattern is quantified with a minimum repeat + count that is greater than 1 or with a limited maximum, more memory is + required for the compiled pattern, in proportion to the size of the + minimum or maximum. + + If a pattern starts with .* or .{0,} and the PCRE_DOTALL option (equiv- + alent to Perl's /s) is set, thus allowing the . to match newlines, the + pattern is implicitly anchored, because whatever follows will be tried + against every character position in the subject string, so there is no + point in retrying the overall match at any position after the first. + PCRE normally treats such a pattern as though it were preceded by \A. + + In cases where it is known that the subject string contains no new- + lines, it is worth setting PCRE_DOTALL in order to obtain this opti- + mization, or alternatively using ^ to indicate anchoring explicitly. + + However, there is one situation where the optimization cannot be used. + When .* is inside capturing parentheses that are the subject of a + backreference elsewhere in the pattern, a match at the start may fail, + and a later one succeed. Consider, for example: + + (.*)abc\1 + + If the subject is "xyz123abc123" the match point is the fourth charac- + ter. For this reason, such a pattern is not implicitly anchored. + + When a capturing subpattern is repeated, the value captured is the sub- + string that matched the final iteration. For example, after + + (tweedle[dume]{3}\s*)+ + + has matched "tweedledum tweedledee" the value of the captured substring + is "tweedledee". However, if there are nested capturing subpatterns, + the corresponding captured values may have been set in previous itera- + tions. For example, after + + /(a|(b))+/ + + matches "aba" the value of the second captured substring is "b". + + +ATOMIC GROUPING AND POSSESSIVE QUANTIFIERS + + With both maximizing and minimizing repetition, failure of what follows + normally causes the repeated item to be re-evaluated to see if a dif- + ferent number of repeats allows the rest of the pattern to match. Some- + times it is useful to prevent this, either to change the nature of the + match, or to cause it fail earlier than it otherwise might, when the + author of the pattern knows there is no point in carrying on. + + Consider, for example, the pattern \d+foo when applied to the subject + line + + 123456bar + + After matching all 6 digits and then failing to match "foo", the normal + action of the matcher is to try again with only 5 digits matching the + \d+ item, and then with 4, and so on, before ultimately failing. + "Atomic grouping" (a term taken from Jeffrey Friedl's book) provides + the means for specifying that once a subpattern has matched, it is not + to be re-evaluated in this way. + + If we use atomic grouping for the previous example, the matcher would + give up immediately on failing to match "foo" the first time. The nota- + tion is a kind of special parenthesis, starting with (?> as in this + example: + + (?>\d+)foo + + This kind of parenthesis "locks up" the part of the pattern it con- + tains once it has matched, and a failure further into the pattern is + prevented from backtracking into it. Backtracking past it to previous + items, however, works as normal. + + An alternative description is that a subpattern of this type matches + the string of characters that an identical standalone pattern would + match, if anchored at the current point in the subject string. + + Atomic grouping subpatterns are not capturing subpatterns. Simple cases + such as the above example can be thought of as a maximizing repeat that + must swallow everything it can. So, while both \d+ and \d+? are pre- + pared to adjust the number of digits they match in order to make the + rest of the pattern match, (?>\d+) can only match an entire sequence of + digits. + + Atomic groups in general can of course contain arbitrarily complicated + subpatterns, and can be nested. However, when the subpattern for an + atomic group is just a single repeated item, as in the example above, a + simpler notation, called a "possessive quantifier" can be used. This + consists of an additional + character following a quantifier. Using + this notation, the previous example can be rewritten as + + \d++foo + + Possessive quantifiers are always greedy; the setting of the + PCRE_UNGREEDY option is ignored. They are a convenient notation for the + simpler forms of atomic group. However, there is no difference in the + meaning or processing of a possessive quantifier and the equivalent + atomic group. + + The possessive quantifier syntax is an extension to the Perl syntax. It + originates in Sun's Java package. + + When a pattern contains an unlimited repeat inside a subpattern that + can itself be repeated an unlimited number of times, the use of an + atomic group is the only way to avoid some failing matches taking a + very long time indeed. The pattern + + (\D+|<\d+>)*[!?] + + matches an unlimited number of substrings that either consist of non- + digits, or digits enclosed in <>, followed by either ! or ?. When it + matches, it runs quickly. However, if it is applied to + + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + + it takes a long time before reporting failure. This is because the + string can be divided between the internal \D+ repeat and the external + * repeat in a large number of ways, and all have to be tried. (The + example uses [!?] rather than a single character at the end, because + both PCRE and Perl have an optimization that allows for fast failure + when a single character is used. They remember the last single charac- + ter that is required for a match, and fail early if it is not present + in the string.) If the pattern is changed so that it uses an atomic + group, like this: + + ((?>\D+)|<\d+>)*[!?] + + sequences of non-digits cannot be broken, and failure happens quickly. + + +BACK REFERENCES + + Outside a character class, a backslash followed by a digit greater than + 0 (and possibly further digits) is a back reference to a capturing sub- + pattern earlier (that is, to its left) in the pattern, provided there + have been that many previous capturing left parentheses. + + However, if the decimal number following the backslash is less than 10, + it is always taken as a back reference, and causes an error only if + there are not that many capturing left parentheses in the entire pat- + tern. In other words, the parentheses that are referenced need not be + to the left of the reference for numbers less than 10. See the subsec- + tion entitled "Non-printing characters" above for further details of + the handling of digits following a backslash. + + A back reference matches whatever actually matched the capturing sub- + pattern in the current subject string, rather than anything matching + the subpattern itself (see "Subpatterns as subroutines" below for a way + of doing that). So the pattern + + (sens|respons)e and \1ibility + + matches "sense and sensibility" and "response and responsibility", but + not "sense and responsibility". If caseful matching is in force at the + time of the back reference, the case of letters is relevant. For exam- + ple, + + ((?i)rah)\s+\1 + + matches "rah rah" and "RAH RAH", but not "RAH rah", even though the + original capturing subpattern is matched caselessly. + + Back references to named subpatterns use the Python syntax (?P=name). + We could rewrite the above example as follows: + + (?(?i)rah)\s+(?P=p1) + + There may be more than one back reference to the same subpattern. If a + subpattern has not actually been used in a particular match, any back + references to it always fail. For example, the pattern + + (a|(bc))\2 + + always fails if it starts to match "a" rather than "bc". Because there + may be many capturing parentheses in a pattern, all digits following + the backslash are taken as part of a potential back reference number. + If the pattern continues with a digit character, some delimiter must be + used to terminate the back reference. If the PCRE_EXTENDED option is + set, this can be whitespace. Otherwise an empty comment (see "Com- + ments" below) can be used. + + A back reference that occurs inside the parentheses to which it refers + fails when the subpattern is first used, so, for example, (a\1) never + matches. However, such references can be useful inside repeated sub- + patterns. For example, the pattern + + (a|b\1)+ + + matches any number of "a"s and also "aba", "ababbaa" etc. At each iter- + ation of the subpattern, the back reference matches the character + string corresponding to the previous iteration. In order for this to + work, the pattern must be such that the first iteration does not need + to match the back reference. This can be done using alternation, as in + the example above, or by a quantifier with a minimum of zero. + + +ASSERTIONS + + An assertion is a test on the characters following or preceding the + current matching point that does not actually consume any characters. + The simple assertions coded as \b, \B, \A, \G, \Z, \z, ^ and $ are + described above. + + More complicated assertions are coded as subpatterns. There are two + kinds: those that look ahead of the current position in the subject + string, and those that look behind it. An assertion subpattern is + matched in the normal way, except that it does not cause the current + matching position to be changed. + + Assertion subpatterns are not capturing subpatterns, and may not be + repeated, because it makes no sense to assert the same thing several + times. If any kind of assertion contains capturing subpatterns within + it, these are counted for the purposes of numbering the capturing sub- + patterns in the whole pattern. However, substring capturing is carried + out only for positive assertions, because it does not make sense for + negative assertions. + + Lookahead assertions + + Lookahead assertions start with (?= for positive assertions and (?! for + negative assertions. For example, + + \w+(?=;) + + matches a word followed by a semicolon, but does not include the semi- + colon in the match, and + + foo(?!bar) + + matches any occurrence of "foo" that is not followed by "bar". Note + that the apparently similar pattern + + (?!foo)bar + + does not find an occurrence of "bar" that is preceded by something + other than "foo"; it finds any occurrence of "bar" whatsoever, because + the assertion (?!foo) is always true when the next three characters are + "bar". A lookbehind assertion is needed to achieve the other effect. + + If you want to force a matching failure at some point in a pattern, the + most convenient way to do it is with (?!) because an empty string + always matches, so an assertion that requires there not to be an empty + string must always fail. + + Lookbehind assertions + + Lookbehind assertions start with (?<= for positive assertions and (?.*)(?<=abcd) + + or, equivalently, using the possessive quantifier syntax, + + ^.*+(?<=abcd) + + there can be no backtracking for the .* item; it can match only the + entire string. The subsequent lookbehind assertion does a single test + on the last four characters. If it fails, the match fails immediately. + For long strings, this approach makes a significant difference to the + processing time. + + Using multiple assertions + + Several assertions (of any sort) may occur in succession. For example, + + (?<=\d{3})(?[^()]+) | (?p{$re}) )* \)}x; + + The (?p{...}) item interpolates Perl code at run time, and in this case + refers recursively to the pattern in which it appears. Obviously, PCRE + cannot support the interpolation of Perl code. Instead, it supports + some special syntax for recursion of the entire pattern, and also for + individual subpattern recursion. + + The special item that consists of (? followed by a number greater than + zero and a closing parenthesis is a recursive call of the subpattern of + the given number, provided that it occurs inside that subpattern. (If + not, it is a "subroutine" call, which is described in the next sec- + tion.) The special item (?R) is a recursive call of the entire regular + expression. + + For example, this PCRE pattern solves the nested parentheses problem + (assume the PCRE_EXTENDED option is set so that white space is + ignored): + + \( ( (?>[^()]+) | (?R) )* \) + + First it matches an opening parenthesis. Then it matches any number of + substrings which can either be a sequence of non-parentheses, or a + recursive match of the pattern itself (that is a correctly parenthe- + sized substring). Finally there is a closing parenthesis. + + If this were part of a larger pattern, you would not want to recurse + the entire pattern, so instead you could use this: + + ( \( ( (?>[^()]+) | (?1) )* \) ) + + We have put the pattern into parentheses, and caused the recursion to + refer to them instead of the whole pattern. In a larger pattern, keep- + ing track of parenthesis numbers can be tricky. It may be more conve- + nient to use named parentheses instead. For this, PCRE uses (?P>name), + which is an extension to the Python syntax that PCRE uses for named + parentheses (Perl does not provide named parentheses). We could rewrite + the above example as follows: + + (?P \( ( (?>[^()]+) | (?P>pn) )* \) ) + + This particular example pattern contains nested unlimited repeats, and + so the use of atomic grouping for matching strings of non-parentheses + is important when applying the pattern to strings that do not match. + For example, when this pattern is applied to + + (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa() + + it yields "no match" quickly. However, if atomic grouping is not used, + the match runs for a very long time indeed because there are so many + different ways the + and * repeats can carve up the subject, and all + have to be tested before failure can be reported. + + At the end of a match, the values set for any capturing subpatterns are + those from the outermost level of the recursion at which the subpattern + value is set. If you want to obtain intermediate values, a callout + function can be used (see the next section and the pcrecallout documen- + tation). If the pattern above is matched against + + (ab(cd)ef) + + the value for the capturing parentheses is "ef", which is the last + value taken on at the top level. If additional parentheses are added, + giving + + \( ( ( (?>[^()]+) | (?R) )* ) \) + ^ ^ + ^ ^ + + the string they capture is "ab(cd)ef", the contents of the top level + parentheses. If there are more than 15 capturing parentheses in a pat- + tern, PCRE has to obtain extra memory to store data during a recursion, + which it does by using pcre_malloc, freeing it via pcre_free after- + wards. If no memory can be obtained, the match fails with the + PCRE_ERROR_NOMEMORY error. + + Do not confuse the (?R) item with the condition (R), which tests for + recursion. Consider this pattern, which matches text in angle brack- + ets, allowing for arbitrary nesting. Only digits are allowed in nested + brackets (that is, when recursing), whereas any characters are permit- + ted at the outer level. + + < (?: (?(R) \d++ | [^<>]*+) | (?R)) * > + + In this pattern, (?(R) is the start of a conditional subpattern, with + two different alternatives for the recursive and non-recursive cases. + The (?R) item is the actual recursive call. + + +SUBPATTERNS AS SUBROUTINES + + If the syntax for a recursive subpattern reference (either by number or + by name) is used outside the parentheses to which it refers, it oper- + ates like a subroutine in a programming language. An earlier example + pointed out that the pattern + + (sens|respons)e and \1ibility + + matches "sense and sensibility" and "response and responsibility", but + not "sense and responsibility". If instead the pattern + + (sens|respons)e and (?1)ibility + + is used, it does match "sense and responsibility" as well as the other + two strings. Such references must, however, follow the subpattern to + which they refer. + + +CALLOUTS + + Perl has a feature whereby using the sequence (?{...}) causes arbitrary + Perl code to be obeyed in the middle of matching a regular expression. + This makes it possible, amongst other things, to extract different sub- + strings that match the same pair of parentheses when there is a repeti- + tion. + + PCRE provides a similar feature, but of course it cannot obey arbitrary + Perl code. The feature is called "callout". The caller of PCRE provides + an external function by putting its entry point in the global variable + pcre_callout. By default, this variable contains NULL, which disables + all calling out. + + Within a regular expression, (?C) indicates the points at which the + external function is to be called. If you want to identify different + callout points, you can put a number less than 256 after the letter C. + The default value is zero. For example, this pattern has two callout + points: + + (?C1)abc(?C2)def + + If the PCRE_AUTO_CALLOUT flag is passed to pcre_compile(), callouts are + automatically installed before each item in the pattern. They are all + numbered 255. + + During matching, when PCRE reaches a callout point (and pcre_callout is + set), the external function is called. It is provided with the number + of the callout, the position in the pattern, and, optionally, one item + of data originally supplied by the caller of pcre_exec(). The callout + function may cause matching to proceed, to backtrack, or to fail alto- + gether. A complete description of the interface to the callout function + is given in the pcrecallout documentation. + +Last updated: 28 February 2005 +Copyright (c) 1997-2005 University of Cambridge. +------------------------------------------------------------------------------ + + +PCREPARTIAL(3) PCREPARTIAL(3) + + +NAME + PCRE - Perl-compatible regular expressions + + +PARTIAL MATCHING IN PCRE + + In normal use of PCRE, if the subject string that is passed to + pcre_exec() or pcre_dfa_exec() matches as far as it goes, but is too + short to match the entire pattern, PCRE_ERROR_NOMATCH is returned. + There are circumstances where it might be helpful to distinguish this + case from other cases in which there is no match. + + Consider, for example, an application where a human is required to type + in data for a field with specific formatting requirements. An example + might be a date in the form ddmmmyy, defined by this pattern: + + ^\d?\d(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d\d$ + + If the application sees the user's keystrokes one by one, and can check + that what has been typed so far is potentially valid, it is able to + raise an error as soon as a mistake is made, possibly beeping and not + reflecting the character that has been typed. This immediate feedback + is likely to be a better user interface than a check that is delayed + until the entire string has been entered. + + PCRE supports the concept of partial matching by means of the PCRE_PAR- + TIAL option, which can be set when calling pcre_exec() or + pcre_dfa_exec(). When this flag is set for pcre_exec(), the return code + PCRE_ERROR_NOMATCH is converted into PCRE_ERROR_PARTIAL if at any time + during the matching process the last part of the subject string matched + part of the pattern. Unfortunately, for non-anchored matching, it is + not possible to obtain the position of the start of the partial match. + No captured data is set when PCRE_ERROR_PARTIAL is returned. + + When PCRE_PARTIAL is set for pcre_dfa_exec(), the return code + PCRE_ERROR_NOMATCH is converted into PCRE_ERROR_PARTIAL if the end of + the subject is reached, there have been no complete matches, but there + is still at least one matching possibility. The portion of the string + that provided the partial match is set as the first matching string. + + Using PCRE_PARTIAL disables one of PCRE's optimizations. PCRE remembers + the last literal byte in a pattern, and abandons matching immediately + if such a byte is not present in the subject string. This optimization + cannot be used for a subject string that might match only partially. + + +RESTRICTED PATTERNS FOR PCRE_PARTIAL + + Because of the way certain internal optimizations are implemented in + the pcre_exec() function, the PCRE_PARTIAL option cannot be used with + all patterns. These restrictions do not apply when pcre_dfa_exec() is + used. For pcre_exec(), repeated single characters such as + + a{2,4} + + and repeated single metasequences such as + + \d+ + + are not permitted if the maximum number of occurrences is greater than + one. Optional items such as \d? (where the maximum is one) are permit- + ted. Quantifiers with any values are permitted after parentheses, so + the invalid examples above can be coded thus: + + (a){2,4} + (\d)+ + + These constructions run more slowly, but for the kinds of application + that are envisaged for this facility, this is not felt to be a major + restriction. + + If PCRE_PARTIAL is set for a pattern that does not conform to the + restrictions, pcre_exec() returns the error code PCRE_ERROR_BADPARTIAL + (-13). + + +EXAMPLE OF PARTIAL MATCHING USING PCRETEST + + If the escape sequence \P is present in a pcretest data line, the + PCRE_PARTIAL flag is used for the match. Here is a run of pcretest that + uses the date example quoted above: + + re> /^\d?\d(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d\d$/ + data> 25jun04P + 0: 25jun04 + 1: jun + data> 25dec3P + Partial match + data> 3juP + Partial match + data> 3jujP + No match + data> jP + No match + + The first data string is matched completely, so pcretest shows the + matched substrings. The remaining four strings do not match the com- + plete pattern, but the first two are partial matches. The same test, + using DFA matching (by means of the \D escape sequence), produces the + following output: + + re> /^?(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)$/ + data> 25jun04\P\D + 0: 25jun04 + data> 23dec3\P\D + Partial match: 23dec3 + data> 3ju\P\D + Partial match: 3ju + data> 3juj\P\D + No match + data> j\P\D + No match + + Notice that in this case the portion of the string that was matched is + made available. + + +MULTI-SEGMENT MATCHING WITH pcre_dfa_exec() + + When a partial match has been found using pcre_dfa_exec(), it is possi- + ble to continue the match by providing additional subject data and + calling pcre_dfa_exec() again with the PCRE_DFA_RESTART option and the + same working space (where details of the previous partial match are + stored). Here is an example using pcretest, where the \R escape + sequence sets the PCRE_DFA_RESTART option and the \D escape sequence + requests the use of pcre_dfa_exec(): + + re> /^?(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)$/ + data> 23ja\P\D + Partial match: 23ja + data> n05\R\D + 0: n05 + + The first call has "23ja" as the subject, and requests partial match- + ing; the second call has "n05" as the subject for the continued + (restarted) match. Notice that when the match is complete, only the + last part is shown; PCRE does not retain the previously partially- + matched string. It is up to the calling program to do that if it needs + to. + + This facility can be used to pass very long subject strings to + pcre_dfa_exec(). However, some care is needed for certain types of pat- + tern. + + 1. If the pattern contains tests for the beginning or end of a line, + you need to pass the PCRE_NOTBOL or PCRE_NOTEOL options, as appropri- + ate, when the subject string for any call does not contain the begin- + ning or end of a line. + + 2. If the pattern contains backward assertions (including \b or \B), + you need to arrange for some overlap in the subject strings to allow + for this. For example, you could pass the subject in chunks that were + 500 bytes long, but in a buffer of 700 bytes, with the starting offset + set to 200 and the previous 200 bytes at the start of the buffer. + + 3. Matching a subject string that is split into multiple segments does + not always produce exactly the same result as matching over one single + long string. The difference arises when there are multiple matching + possibilities, because a partial match result is given only when there + are no completed matches in a call to fBpcre_dfa_exec(). This means + that as soon as the shortest match has been found, continuation to a + new subject segment is no longer possible. Consider this pcretest + example: + + re> /dog(sbody)?/ + data> do\P\D + Partial match: do + data> gsb\R\P\D + 0: g + data> dogsbody\D + 0: dogsbody + 1: dog + + The pattern matches the words "dog" or "dogsbody". When the subject is + presented in several parts ("do" and "gsb" being the first two) the + match stops when "dog" has been found, and it is not possible to con- + tinue. On the other hand, if "dogsbody" is presented as a single + string, both matches are found. + + Because of this phenomenon, it does not usually make sense to end a + pattern that is going to be matched in this way with a variable repeat. + +Last updated: 28 February 2005 +Copyright (c) 1997-2005 University of Cambridge. +------------------------------------------------------------------------------ + + +PCREPRECOMPILE(3) PCREPRECOMPILE(3) + + +NAME + PCRE - Perl-compatible regular expressions + + +SAVING AND RE-USING PRECOMPILED PCRE PATTERNS + + If you are running an application that uses a large number of regular + expression patterns, it may be useful to store them in a precompiled + form instead of having to compile them every time the application is + run. If you are not using any private character tables (see the + pcre_maketables() documentation), this is relatively straightforward. + If you are using private tables, it is a little bit more complicated. + + If you save compiled patterns to a file, you can copy them to a differ- + ent host and run them there. This works even if the new host has the + opposite endianness to the one on which the patterns were compiled. + There may be a small performance penalty, but it should be insignifi- + cant. + + +SAVING A COMPILED PATTERN + The value returned by pcre_compile() points to a single block of memory + that holds the compiled pattern and associated data. You can find the + length of this block in bytes by calling pcre_fullinfo() with an argu- + ment of PCRE_INFO_SIZE. You can then save the data in any appropriate + manner. Here is sample code that compiles a pattern and writes it to a + file. It assumes that the variable fd refers to a file that is open for + output: + + int erroroffset, rc, size; + char *error; + pcre *re; + + re = pcre_compile("my pattern", 0, &error, &erroroffset, NULL); + if (re == NULL) { ... handle errors ... } + rc = pcre_fullinfo(re, NULL, PCRE_INFO_SIZE, &size); + if (rc < 0) { ... handle errors ... } + rc = fwrite(re, 1, size, fd); + if (rc != size) { ... handle errors ... } + + In this example, the bytes that comprise the compiled pattern are + copied exactly. Note that this is binary data that may contain any of + the 256 possible byte values. On systems that make a distinction + between binary and non-binary data, be sure that the file is opened for + binary output. + + If you want to write more than one pattern to a file, you will have to + devise a way of separating them. For binary data, preceding each pat- + tern with its length is probably the most straightforward approach. + Another possibility is to write out the data in hexadecimal instead of + binary, one pattern to a line. + + Saving compiled patterns in a file is only one possible way of storing + them for later use. They could equally well be saved in a database, or + in the memory of some daemon process that passes them via sockets to + the processes that want them. + + If the pattern has been studied, it is also possible to save the study + data in a similar way to the compiled pattern itself. When studying + generates additional information, pcre_study() returns a pointer to a + pcre_extra data block. Its format is defined in the section on matching + a pattern in the pcreapi documentation. The study_data field points to + the binary study data, and this is what you must save (not the + pcre_extra block itself). The length of the study data can be obtained + by calling pcre_fullinfo() with an argument of PCRE_INFO_STUDYSIZE. + Remember to check that pcre_study() did return a non-NULL value before + trying to save the study data. + + +RE-USING A PRECOMPILED PATTERN + + Re-using a precompiled pattern is straightforward. Having reloaded it + into main memory, you pass its pointer to pcre_exec() or + pcre_dfa_exec() in the usual way. This should work even on another + host, and even if that host has the opposite endianness to the one + where the pattern was compiled. + + However, if you passed a pointer to custom character tables when the + pattern was compiled (the tableptr argument of pcre_compile()), you + must now pass a similar pointer to pcre_exec() or pcre_dfa_exec(), + because the value saved with the compiled pattern will obviously be + nonsense. A field in a pcre_extra() block is used to pass this data, as + described in the section on matching a pattern in the pcreapi documen- + tation. + + If you did not provide custom character tables when the pattern was + compiled, the pointer in the compiled pattern is NULL, which causes + pcre_exec() to use PCRE's internal tables. Thus, you do not need to + take any special action at run time in this case. + + If you saved study data with the compiled pattern, you need to create + your own pcre_extra data block and set the study_data field to point to + the reloaded study data. You must also set the PCRE_EXTRA_STUDY_DATA + bit in the flags field to indicate that study data is present. Then + pass the pcre_extra block to pcre_exec() or pcre_dfa_exec() in the + usual way. + + +COMPATIBILITY WITH DIFFERENT PCRE RELEASES + + The layout of the control block that is at the start of the data that + makes up a compiled pattern was changed for release 5.0. If you have + any saved patterns that were compiled with previous releases (not a + facility that was previously advertised), you will have to recompile + them for release 5.0. However, from now on, it should be possible to + make changes in a compatible manner. + +Last updated: 28 February 2005 +Copyright (c) 1997-2005 University of Cambridge. +------------------------------------------------------------------------------ + + +PCREPERFORM(3) PCREPERFORM(3) + + +NAME + PCRE - Perl-compatible regular expressions + + +PCRE PERFORMANCE + + Certain items that may appear in regular expression patterns are more + efficient than others. It is more efficient to use a character class + like [aeiou] than a set of alternatives such as (a|e|i|o|u). In gen- + eral, the simplest construction that provides the required behaviour is + usually the most efficient. Jeffrey Friedl's book contains a lot of + useful general discussion about optimizing regular expressions for + efficient performance. This document contains a few observations about + PCRE. + + Using Unicode character properties (the \p, \P, and \X escapes) is + slow, because PCRE has to scan a structure that contains data for over + fifteen thousand characters whenever it needs a character's property. + If you can find an alternative pattern that does not use character + properties, it will probably be faster. + + When a pattern begins with .* not in parentheses, or in parentheses + that are not the subject of a backreference, and the PCRE_DOTALL option + is set, the pattern is implicitly anchored by PCRE, since it can match + only at the start of a subject string. However, if PCRE_DOTALL is not + set, PCRE cannot make this optimization, because the . metacharacter + does not then match a newline, and if the subject string contains new- + lines, the pattern may match from the character immediately following + one of them instead of from the very start. For example, the pattern + + .*second + + matches the subject "first\nand second" (where \n stands for a newline + character), with the match starting at the seventh character. In order + to do this, PCRE has to retry the match starting after every newline in + the subject. + + If you are using such a pattern with subject strings that do not con- + tain newlines, the best performance is obtained by setting PCRE_DOTALL, + or starting the pattern with ^.* or ^.*? to indicate explicit anchor- + ing. That saves PCRE from having to scan along the subject looking for + a newline to restart at. + + Beware of patterns that contain nested indefinite repeats. These can + take a long time to run when applied to a string that does not match. + Consider the pattern fragment + + (a+)* + + This can match "aaaa" in 33 different ways, and this number increases + very rapidly as the string gets longer. (The * repeat can match 0, 1, + 2, 3, or 4 times, and for each of those cases other than 0, the + + repeats can match different numbers of times.) When the remainder of + the pattern is such that the entire match is going to fail, PCRE has in + principle to try every possible variation, and this can take an + extremely long time. + + An optimization catches some of the more simple cases such as + + (a+)*b + + where a literal character follows. Before embarking on the standard + matching procedure, PCRE checks that there is a "b" later in the sub- + ject string, and if there is not, it fails the match immediately. How- + ever, when there is no following literal this optimization cannot be + used. You can see the difference by comparing the behaviour of + + (a+)*\d + + with the pattern above. The former gives a failure almost instantly + when applied to a whole line of "a" characters, whereas the latter + takes an appreciable time with strings longer than about 20 characters. + + In many cases, the solution to this kind of performance issue is to use + an atomic group or a possessive quantifier. + +Last updated: 28 February 2005 +Copyright (c) 1997-2005 University of Cambridge. +------------------------------------------------------------------------------ + + +PCREPOSIX(3) PCREPOSIX(3) + + +NAME + PCRE - Perl-compatible regular expressions. + + +SYNOPSIS OF POSIX API + + #include + + int regcomp(regex_t *preg, const char *pattern, + int cflags); + + int regexec(regex_t *preg, const char *string, + size_t nmatch, regmatch_t pmatch[], int eflags); + + size_t regerror(int errcode, const regex_t *preg, + char *errbuf, size_t errbuf_size); + + void regfree(regex_t *preg); + + +DESCRIPTION + + This set of functions provides a POSIX-style API to the PCRE regular + expression package. See the pcreapi documentation for a description of + PCRE's native API, which contains much additional functionality. + + The functions described here are just wrapper functions that ultimately + call the PCRE native API. Their prototypes are defined in the + pcreposix.h header file, and on Unix systems the library itself is + called pcreposix.a, so can be accessed by adding -lpcreposix to the + command for linking an application that uses them. Because the POSIX + functions call the native ones, it is also necessary to add -lpcre. + + I have implemented only those option bits that can be reasonably mapped + to PCRE native options. In addition, the options REG_EXTENDED and + REG_NOSUB are defined with the value zero. They have no effect, but + since programs that are written to the POSIX interface often use them, + this makes it easier to slot in PCRE as a replacement library. Other + POSIX options are not even defined. + + When PCRE is called via these functions, it is only the API that is + POSIX-like in style. The syntax and semantics of the regular expres- + sions themselves are still those of Perl, subject to the setting of + various PCRE options, as described below. "POSIX-like in style" means + that the API approximates to the POSIX definition; it is not fully + POSIX-compatible, and in multi-byte encoding domains it is probably + even less compatible. + + The header for these functions is supplied as pcreposix.h to avoid any + potential clash with other POSIX libraries. It can, of course, be + renamed or aliased as regex.h, which is the "correct" name. It provides + two structure types, regex_t for compiled internal forms, and reg- + match_t for returning captured substrings. It also defines some con- + stants whose names start with "REG_"; these are used for setting + options and identifying error codes. + + +COMPILING A PATTERN + + The function regcomp() is called to compile a pattern into an internal + form. The pattern is a C string terminated by a binary zero, and is + passed in the argument pattern. The preg argument is a pointer to a + regex_t structure that is used as a base for storing information about + the compiled expression. + + The argument cflags is either zero, or contains one or more of the bits + defined by the following macros: + + REG_DOTALL + + The PCRE_DOTALL option is set when the expression is passed for compi- + lation to the native function. Note that REG_DOTALL is not part of the + POSIX standard. + + REG_ICASE + + The PCRE_CASELESS option is set when the expression is passed for com- + pilation to the native function. + + REG_NEWLINE + + The PCRE_MULTILINE option is set when the expression is passed for com- + pilation to the native function. Note that this does not mimic the + defined POSIX behaviour for REG_NEWLINE (see the following section). + + In the absence of these flags, no options are passed to the native + function. This means the the regex is compiled with PCRE default + semantics. In particular, the way it handles newline characters in the + subject string is the Perl way, not the POSIX way. Note that setting + PCRE_MULTILINE has only some of the effects specified for REG_NEWLINE. + It does not affect the way newlines are matched by . (they aren't) or + by a negative class such as [^a] (they are). + + The yield of regcomp() is zero on success, and non-zero otherwise. The + preg structure is filled in on success, and one member of the structure + is public: re_nsub contains the number of capturing subpatterns in the + regular expression. Various error codes are defined in the header file. + + +MATCHING NEWLINE CHARACTERS + + This area is not simple, because POSIX and Perl take different views of + things. It is not possible to get PCRE to obey POSIX semantics, but + then PCRE was never intended to be a POSIX engine. The following table + lists the different possibilities for matching newline characters in + PCRE: + + Default Change with + + . matches newline no PCRE_DOTALL + newline matches [^a] yes not changeable + $ matches \n at end yes PCRE_DOLLARENDONLY + $ matches \n in middle no PCRE_MULTILINE + ^ matches \n in middle no PCRE_MULTILINE + + This is the equivalent table for POSIX: + + Default Change with + + . matches newline yes REG_NEWLINE + newline matches [^a] yes REG_NEWLINE + $ matches \n at end no REG_NEWLINE + $ matches \n in middle no REG_NEWLINE + ^ matches \n in middle no REG_NEWLINE + + PCRE's behaviour is the same as Perl's, except that there is no equiva- + lent for PCRE_DOLLAR_ENDONLY in Perl. In both PCRE and Perl, there is + no way to stop newline from matching [^a]. + + The default POSIX newline handling can be obtained by setting + PCRE_DOTALL and PCRE_DOLLAR_ENDONLY, but there is no way to make PCRE + behave exactly as for the REG_NEWLINE action. + + +MATCHING A PATTERN + + The function regexec() is called to match a compiled pattern preg + against a given string, which is terminated by a zero byte, subject to + the options in eflags. These can be: + + REG_NOTBOL + + The PCRE_NOTBOL option is set when calling the underlying PCRE matching + function. + + REG_NOTEOL + + The PCRE_NOTEOL option is set when calling the underlying PCRE matching + function. + + The portion of the string that was matched, and also any captured sub- + strings, are returned via the pmatch argument, which points to an array + of nmatch structures of type regmatch_t, containing the members rm_so + and rm_eo. These contain the offset to the first character of each sub- + string and the offset to the first character after the end of each sub- + string, respectively. The 0th element of the vector relates to the + entire portion of string that was matched; subsequent elements relate + to the capturing subpatterns of the regular expression. Unused entries + in the array have both structure members set to -1. + + A successful match yields a zero return; various error codes are + defined in the header file, of which REG_NOMATCH is the "expected" + failure code. + + +ERROR MESSAGES + + The regerror() function maps a non-zero errorcode from either regcomp() + or regexec() to a printable message. If preg is not NULL, the error + should have arisen from the use of that structure. A message terminated + by a binary zero is placed in errbuf. The length of the message, + including the zero, is limited to errbuf_size. The yield of the func- + tion is the size of buffer needed to hold the whole message. + + +MEMORY USAGE + + Compiling a regular expression causes memory to be allocated and asso- + ciated with the preg structure. The function regfree() frees all such + memory, after which preg may no longer be used as a compiled expres- + sion. + + +AUTHOR + + Philip Hazel + University Computing Service, + Cambridge CB2 3QG, England. + +Last updated: 28 February 2005 +Copyright (c) 1997-2005 University of Cambridge. +------------------------------------------------------------------------------ + + +PCRECPP(3) PCRECPP(3) + + +NAME + PCRE - Perl-compatible regular expressions. + + +SYNOPSIS OF C++ WRAPPER + + #include + + +DESCRIPTION + + The C++ wrapper for PCRE was provided by Google Inc. Some additional + functionality was added by Giuseppe Maxia. This brief man page was con- + structed from the notes in the pcrecpp.h file, which should be con- + sulted for further details. + + +MATCHING INTERFACE + + The "FullMatch" operation checks that supplied text matches a supplied + pattern exactly. If pointer arguments are supplied, it copies matched + sub-strings that match sub-patterns into them. + + Example: successful match + pcrecpp::RE re("h.*o"); + re.FullMatch("hello"); + + Example: unsuccessful match (requires full match): + pcrecpp::RE re("e"); + !re.FullMatch("hello"); + + Example: creating a temporary RE object: + pcrecpp::RE("h.*o").FullMatch("hello"); + + You can pass in a "const char*" or a "string" for "text". The examples + below tend to use a const char*. You can, as in the different examples + above, store the RE object explicitly in a variable or use a temporary + RE object. The examples below use one mode or the other arbitrarily. + Either could correctly be used for any of these examples. + + You must supply extra pointer arguments to extract matched subpieces. + + Example: extracts "ruby" into "s" and 1234 into "i" + int i; + string s; + pcrecpp::RE re("(\\w+):(\\d+)"); + re.FullMatch("ruby:1234", &s, &i); + + Example: does not try to extract any extra sub-patterns + re.FullMatch("ruby:1234", &s); + + Example: does not try to extract into NULL + re.FullMatch("ruby:1234", NULL, &i); + + Example: integer overflow causes failure + !re.FullMatch("ruby:1234567891234", NULL, &i); + + Example: fails because there aren't enough sub-patterns: + !pcrecpp::RE("\\w+:\\d+").FullMatch("ruby:1234", &s); + + Example: fails because string cannot be stored in integer + !pcrecpp::RE("(.*)").FullMatch("ruby", &i); + + The provided pointer arguments can be pointers to any scalar numeric + type, or one of: + + string (matched piece is copied to string) + StringPiece (StringPiece is mutated to point to matched piece) + T (where "bool T::ParseFrom(const char*, int)" exists) + NULL (the corresponding matched sub-pattern is not copied) + + The function returns true iff all of the following conditions are sat- + isfied: + + a. "text" matches "pattern" exactly; + + b. The number of matched sub-patterns is >= number of supplied + pointers; + + c. The "i"th argument has a suitable type for holding the + string captured as the "i"th sub-pattern. If you pass in + NULL for the "i"th argument, or pass fewer arguments than + number of sub-patterns, "i"th captured sub-pattern is + ignored. + + The matching interface supports at most 16 arguments per call. If you + need more, consider using the more general interface + pcrecpp::RE::DoMatch. See pcrecpp.h for the signature for DoMatch. + + +PARTIAL MATCHES + + You can use the "PartialMatch" operation when you want the pattern to + match any substring of the text. + + Example: simple search for a string: + pcrecpp::RE("ell").PartialMatch("hello"); + + Example: find first number in a string: + int number; + pcrecpp::RE re("(\\d+)"); + re.PartialMatch("x*100 + 20", &number); + assert(number == 100); + + +UTF-8 AND THE MATCHING INTERFACE + + By default, pattern and text are plain text, one byte per character. + The UTF8 flag, passed to the constructor, causes both pattern and + string to be treated as UTF-8 text, still a byte stream but potentially + multiple bytes per character. In practice, the text is likelier to be + UTF-8 than the pattern, but the match returned may depend on the UTF8 + flag, so always use it when matching UTF8 text. For example, "." will + match one byte normally but with UTF8 set may match up to three bytes + of a multi-byte character. + + Example: + pcrecpp::RE_Options options; + options.set_utf8(); + pcrecpp::RE re(utf8_pattern, options); + re.FullMatch(utf8_string); + + Example: using the convenience function UTF8(): + pcrecpp::RE re(utf8_pattern, pcrecpp::UTF8()); + re.FullMatch(utf8_string); + + NOTE: The UTF8 flag is ignored if pcre was not configured with the + --enable-utf8 flag. + + +PASSING MODIFIERS TO THE REGULAR EXPRESSION ENGINE + + PCRE defines some modifiers to change the behavior of the regular + expression engine. The C++ wrapper defines an auxiliary class, + RE_Options, as a vehicle to pass such modifiers to a RE class. Cur- + rently, the following modifiers are supported: + + modifier description Perl corresponding + + PCRE_CASELESS case insensitive match /i + PCRE_MULTILINE multiple lines match /m + PCRE_DOTALL dot matches newlines /s + PCRE_DOLLAR_ENDONLY $ matches only at end N/A + PCRE_EXTRA strict escape parsing N/A + PCRE_EXTENDED ignore whitespaces /x + PCRE_UTF8 handles UTF8 chars built-in + PCRE_UNGREEDY reverses * and *? N/A + PCRE_NO_AUTO_CAPTURE disables capturing parens N/A (*) + + (*) Both Perl and PCRE allow non capturing parentheses by means of the + "?:" modifier within the pattern itself. e.g. (?:ab|cd) does not cap- + ture, while (ab|cd) does. + + For a full account on how each modifier works, please check the PCRE + API reference page. + + For each modifier, there are two member functions whose name is made + out of the modifier in lowercase, without the "PCRE_" prefix. For + instance, PCRE_CASELESS is handled by + + bool caseless() + + which returns true if the modifier is set, and + + RE_Options & set_caseless(bool) + + which sets or unsets the modifier. Moreover, PCRE_CONFIG_MATCH_LIMIT + can be accessed through the set_match_limit() and match_limit() member + functions. Setting match_limit to a non-zero value will limit the exe- + cution of pcre to keep it from doing bad things like blowing the stack + or taking an eternity to return a result. A value of 5000 is good + enough to stop stack blowup in a 2MB thread stack. Setting match_limit + to zero disables match limiting. + + Normally, to pass one or more modifiers to a RE class, you declare a + RE_Options object, set the appropriate options, and pass this object to + a RE constructor. Example: + + RE_options opt; + opt.set_caseless(true); + if (RE("HELLO", opt).PartialMatch("hello world")) ... + + RE_options has two constructors. The default constructor takes no argu- + ments and creates a set of flags that are off by default. The optional + parameter option_flags is to facilitate transfer of legacy code from C + programs. This lets you do + + RE(pattern, + RE_Options(PCRE_CASELESS|PCRE_MULTILINE)).PartialMatch(str); + + However, new code is better off doing + + RE(pattern, + RE_Options().set_caseless(true).set_multiline(true)) + .PartialMatch(str); + + If you are going to pass one of the most used modifiers, there are some + convenience functions that return a RE_Options class with the appropri- + ate modifier already set: CASELESS(), UTF8(), MULTILINE(), DOTALL(), + and EXTENDED(). + + If you need to set several options at once, and you don't want to go + through the pains of declaring a RE_Options object and setting several + options, there is a parallel method that give you such ability on the + fly. You can concatenate several set_xxxxx() member functions, since + each of them returns a reference to its class object. For example, to + pass PCRE_CASELESS, PCRE_EXTENDED, and PCRE_MULTILINE to a RE with one + statement, you may write: + + RE(" ^ xyz \\s+ .* blah$", + RE_Options() + .set_caseless(true) + .set_extended(true) + .set_multiline(true)).PartialMatch(sometext); + + +SCANNING TEXT INCREMENTALLY + + The "Consume" operation may be useful if you want to repeatedly match + regular expressions at the front of a string and skip over them as they + match. This requires use of the "StringPiece" type, which represents a + sub-range of a real string. Like RE, StringPiece is defined in the + pcrecpp namespace. + + Example: read lines of the form "var = value" from a string. + string contents = ...; // Fill string somehow + pcrecpp::StringPiece input(contents); // Wrap in a StringPiece + + string var; + int value; + pcrecpp::RE re("(\\w+) = (\\d+)\n"); + while (re.Consume(&input, &var, &value)) { + ...; + } + + Each successful call to "Consume" will set "var/value", and also + advance "input" so it points past the matched text. + + The "FindAndConsume" operation is similar to "Consume" but does not + anchor your match at the beginning of the string. For example, you + could extract all words from a string by repeatedly calling + + pcrecpp::RE("(\\w+)").FindAndConsume(&input, &word) + + +PARSING HEX/OCTAL/C-RADIX NUMBERS + + By default, if you pass a pointer to a numeric value, the corresponding + text is interpreted as a base-10 number. You can instead wrap the + pointer with a call to one of the operators Hex(), Octal(), or CRadix() + to interpret the text in another base. The CRadix operator interprets + C-style "0" (base-8) and "0x" (base-16) prefixes, but defaults to + base-10. + + Example: + int a, b, c, d; + pcrecpp::RE re("(.*) (.*) (.*) (.*)"); + re.FullMatch("100 40 0100 0x40", + pcrecpp::Octal(&a), pcrecpp::Hex(&b), + pcrecpp::CRadix(&c), pcrecpp::CRadix(&d)); + + will leave 64 in a, b, c, and d. + + +REPLACING PARTS OF STRINGS + + You can replace the first match of "pattern" in "str" with "rewrite". + Within "rewrite", backslash-escaped digits (\1 to \9) can be used to + insert text matching corresponding parenthesized group from the pat- + tern. \0 in "rewrite" refers to the entire matching text. For example: + + string s = "yabba dabba doo"; + pcrecpp::RE("b+").Replace("d", &s); + + will leave "s" containing "yada dabba doo". The result is true if the + pattern matches and a replacement occurs, false otherwise. + + GlobalReplace is like Replace except that it replaces all occurrences + of the pattern in the string with the rewrite. Replacements are not + subject to re-matching. For example: + + string s = "yabba dabba doo"; + pcrecpp::RE("b+").GlobalReplace("d", &s); + + will leave "s" containing "yada dada doo". It returns the number of + replacements made. + + Extract is like Replace, except that if the pattern matches, "rewrite" + is copied into "out" (an additional argument) with substitutions. The + non-matching portions of "text" are ignored. Returns true iff a match + occurred and the extraction happened successfully; if no match occurs, + the string is left unaffected. + + +AUTHOR + + The C++ wrapper was contributed by Google Inc. + Copyright (c) 2005 Google Inc. +------------------------------------------------------------------------------ + + +PCRESAMPLE(3) PCRESAMPLE(3) + + +NAME + PCRE - Perl-compatible regular expressions + + +PCRE SAMPLE PROGRAM + + A simple, complete demonstration program, to get you started with using + PCRE, is supplied in the file pcredemo.c in the PCRE distribution. + + The program compiles the regular expression that is its first argument, + and matches it against the subject string in its second argument. No + PCRE options are set, and default character tables are used. If match- + ing succeeds, the program outputs the portion of the subject that + matched, together with the contents of any captured substrings. + + If the -g option is given on the command line, the program then goes on + to check for further matches of the same regular expression in the same + subject string. The logic is a little bit tricky because of the possi- + bility of matching an empty string. Comments in the code explain what + is going on. + + If PCRE is installed in the standard include and library directories + for your system, you should be able to compile the demonstration pro- + gram using this command: + + gcc -o pcredemo pcredemo.c -lpcre + + If PCRE is installed elsewhere, you may need to add additional options + to the command line. For example, on a Unix-like system that has PCRE + installed in /usr/local, you can compile the demonstration program + using a command like this: + + gcc -o pcredemo -I/usr/local/include pcredemo.c \ + -L/usr/local/lib -lpcre + + Once you have compiled the demonstration program, you can run simple + tests like this: + + ./pcredemo 'cat|dog' 'the cat sat on the mat' + ./pcredemo -g 'cat|dog' 'the dog sat on the cat' + + Note that there is a much more comprehensive test program, called + pcretest, which supports many more facilities for testing regular + expressions and the PCRE library. The pcredemo program is provided as a + simple coding example. + + On some operating systems (e.g. Solaris), when PCRE is not installed in + the standard library directory, you may get an error like this when you + try to run pcredemo: + + ld.so.1: a.out: fatal: libpcre.so.0: open failed: No such file or + directory + + This is caused by the way shared library support works on those sys- + tems. You need to add + + -R/usr/local/lib + + (for example) to the compile command to get round this problem. + +Last updated: 09 September 2004 +Copyright (c) 1997-2004 University of Cambridge. +------------------------------------------------------------------------------ diff --git a/mozilla/js/tamarin/pcre/doc/pcre_compile.3 b/mozilla/js/tamarin/pcre/doc/pcre_compile.3 new file mode 100644 index 00000000000..42446982acb --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/pcre_compile.3 @@ -0,0 +1,65 @@ +.TH PCRE_COMPILE 3 +.SH NAME +PCRE - Perl-compatible regular expressions +.SH SYNOPSIS +.rs +.sp +.B #include +.PP +.SM +.br +.B pcre *pcre_compile(const char *\fIpattern\fP, int \fIoptions\fP, +.ti +5n +.B const char **\fIerrptr\fP, int *\fIerroffset\fP, +.ti +5n +.B const unsigned char *\fItableptr\fP); +. +.SH DESCRIPTION +.rs +.sp +This function compiles a regular expression into an internal form. Its +arguments are: +.sp + \fIpattern\fR A zero-terminated string containing the + regular expression to be compiled + \fIoptions\fR Zero or more option bits + \fIerrptr\fR Where to put an error message + \fIerroffset\fR Offset in pattern where error was found + \fItableptr\fR Pointer to character tables, or NULL to + use the built-in default +.sp +The option bits are: +.sp + PCRE_ANCHORED Force pattern anchoring + PCRE_AUTO_CALLOUT Compile automatic callouts + PCRE_CASELESS Do caseless matching + PCRE_DOLLAR_ENDONLY $ not to match newline at end + PCRE_DOTALL . matches anything including NL + PCRE_EXTENDED Ignore whitespace and # comments + PCRE_EXTRA PCRE extra features + (not much use currently) + PCRE_FIRSTLINE Force matching to be before newline + PCRE_MULTILINE ^ and $ match newlines within data + PCRE_NO_AUTO_CAPTURE Disable numbered capturing paren- + theses (named ones available) + PCRE_UNGREEDY Invert greediness of quantifiers + PCRE_UTF8 Run in UTF-8 mode + PCRE_NO_UTF8_CHECK Do not check the pattern for UTF-8 + validity (only relevant if + PCRE_UTF8 is set) +.sp +PCRE must be built with UTF-8 support in order to use PCRE_UTF8 and +PCRE_NO_UTF8_CHECK. +.P +The yield of the function is a pointer to a private data structure that +contains the compiled pattern, or NULL if an error was detected. +.P +There is a complete description of the PCRE native API in the +.\" HREF +\fBpcreapi\fR +.\" +page and a description of the POSIX API in the +.\" HREF +\fBpcreposix\fR +.\" +page. diff --git a/mozilla/js/tamarin/pcre/doc/pcre_compile2.3 b/mozilla/js/tamarin/pcre/doc/pcre_compile2.3 new file mode 100644 index 00000000000..d67583c6e0a --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/pcre_compile2.3 @@ -0,0 +1,70 @@ +.TH PCRE_COMPILE2 3 +.SH NAME +PCRE - Perl-compatible regular expressions +.SH SYNOPSIS +.rs +.sp +.B #include +.PP +.SM +.br +.B pcre *pcre_compile2(const char *\fIpattern\fP, int \fIoptions\fP, +.ti +5n +.B int *\fIerrorcodeptr\fP, +.ti +5n +.B const char **\fIerrptr\fP, int *\fIerroffset\fP, +.ti +5n +.B const unsigned char *\fItableptr\fP); +. +.SH DESCRIPTION +.rs +.sp +This function compiles a regular expression into an internal form. It is the +same as \fBpcre_compile()\fP, except for the addition of the \fIerrorcodeptr\fP +argument. The arguments are: + +.sp + \fIpattern\fR A zero-terminated string containing the + regular expression to be compiled + \fIoptions\fR Zero or more option bits + \fIerrorcodeptr\fP Where to put an error code + \fIerrptr\fR Where to put an error message + \fIerroffset\fR Offset in pattern where error was found + \fItableptr\fR Pointer to character tables, or NULL to + use the built-in default +.sp +The option bits are: +.sp + PCRE_ANCHORED Force pattern anchoring + PCRE_AUTO_CALLOUT Compile automatic callouts + PCRE_CASELESS Do caseless matching + PCRE_DOLLAR_ENDONLY $ not to match newline at end + PCRE_DOTALL . matches anything including NL + PCRE_EXTENDED Ignore whitespace and # comments + PCRE_EXTRA PCRE extra features + (not much use currently) + PCRE_FIRSTLINE Force matching to be before newline + PCRE_MULTILINE ^ and $ match newlines within data + PCRE_NO_AUTO_CAPTURE Disable numbered capturing paren- + theses (named ones available) + PCRE_UNGREEDY Invert greediness of quantifiers + PCRE_UTF8 Run in UTF-8 mode + PCRE_NO_UTF8_CHECK Do not check the pattern for UTF-8 + validity (only relevant if + PCRE_UTF8 is set) +.sp +PCRE must be built with UTF-8 support in order to use PCRE_UTF8 and +PCRE_NO_UTF8_CHECK. +.P +The yield of the function is a pointer to a private data structure that +contains the compiled pattern, or NULL if an error was detected. +.P +There is a complete description of the PCRE native API in the +.\" HREF +\fBpcreapi\fR +.\" +page and a description of the POSIX API in the +.\" HREF +\fBpcreposix\fR +.\" +page. diff --git a/mozilla/js/tamarin/pcre/doc/pcre_config.3 b/mozilla/js/tamarin/pcre/doc/pcre_config.3 new file mode 100644 index 00000000000..5f51a4609ba --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/pcre_config.3 @@ -0,0 +1,48 @@ +.TH PCRE_CONFIG 3 +.SH NAME +PCRE - Perl-compatible regular expressions +.SH SYNOPSIS +.rs +.sp +.B #include +.PP +.SM +.br +.B int pcre_config(int \fIwhat\fP, void *\fIwhere\fP); +. +.SH DESCRIPTION +.rs +.sp +This function makes it possible for a client program to find out which optional +features are available in the version of the PCRE library it is using. Its +arguments are as follows: +.sp + \fIwhat\fR A code specifying what information is required + \fIwhere\fR Points to where to put the data +.sp +The available codes are: +.sp + PCRE_CONFIG_LINK_SIZE Internal link size: 2, 3, or 4 + PCRE_CONFIG_MATCH_LIMIT Internal resource limit + PCRE_CONFIG_NEWLINE Value of the newline character + PCRE_CONFIG_POSIX_MALLOC_THRESHOLD + Threshold of return slots, above + which \fBmalloc()\fR is used by + the POSIX API + PCRE_CONFIG_STACKRECURSE Recursion implementation (1=stack 0=heap) + PCRE_CONFIG_UTF8 Availability of UTF-8 support (1=yes 0=no) + PCRE_CONFIG_UNICODE_PROPERTIES + Availability of Unicode property support + (1=yes 0=no) +.sp +The function yields 0 on success or PCRE_ERROR_BADOPTION otherwise. +.P +There is a complete description of the PCRE native API in the +.\" HREF +\fBpcreapi\fR +.\" +page and a description of the POSIX API in the +.\" HREF +\fBpcreposix\fR +.\" +page. diff --git a/mozilla/js/tamarin/pcre/doc/pcre_copy_named_substring.3 b/mozilla/js/tamarin/pcre/doc/pcre_copy_named_substring.3 new file mode 100644 index 00000000000..f6c92330ff6 --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/pcre_copy_named_substring.3 @@ -0,0 +1,44 @@ +.TH PCRE_COPY_NAMED_SUBSTRING 3 +.SH NAME +PCRE - Perl-compatible regular expressions +.SH SYNOPSIS +.rs +.sp +.B #include +.PP +.SM +.br +.B int pcre_copy_named_substring(const pcre *\fIcode\fP, +.ti +5n +.B const char *\fIsubject\fP, int *\fIovector\fP, +.ti +5n +.B int \fIstringcount\fP, const char *\fIstringname\fP, +.ti +5n +.B char *\fIbuffer\fP, int \fIbuffersize\fP); +. +.SH DESCRIPTION +.rs +.sp +This is a convenience function for extracting a captured substring, identified +by name, into a given buffer. The arguments are: +.sp + \fIcode\fP Pattern that was successfully matched + \fIsubject\fP Subject that has been successfully matched + \fIovector\fP Offset vector that \fBpcre_exec()\fP used + \fIstringcount\fP Value returned by \fBpcre_exec()\fP + \fIstringname\fP Name of the required substring + \fIbuffer\fP Buffer to receive the string + \fIbuffersize\fP Size of buffer +.sp +The yield is the length of the substring, PCRE_ERROR_NOMEMORY if the buffer was +too small, or PCRE_ERROR_NOSUBSTRING if the string name is invalid. +.P +There is a complete description of the PCRE native API in the +.\" HREF +\fBpcreapi\fP +.\" +page and a description of the POSIX API in the +.\" HREF +\fBpcreposix\fP +.\" +page. diff --git a/mozilla/js/tamarin/pcre/doc/pcre_copy_substring.3 b/mozilla/js/tamarin/pcre/doc/pcre_copy_substring.3 new file mode 100644 index 00000000000..41c8dc3d47c --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/pcre_copy_substring.3 @@ -0,0 +1,41 @@ +.TH PCRE_COPY_SUBSTRING 3 +.SH NAME +PCRE - Perl-compatible regular expressions +.SH SYNOPSIS +.rs +.sp +.B #include +.PP +.SM +.br +.B int pcre_copy_substring(const char *\fIsubject\fP, int *\fIovector\fP, +.ti +5n +.B int \fIstringcount\fP, int \fIstringnumber\fP, char *\fIbuffer\fP, +.ti +5n +.B int \fIbuffersize\fP); +. +.SH DESCRIPTION +.rs +.sp +This is a convenience function for extracting a captured substring into a given +buffer. The arguments are: +.sp + \fIsubject\fP Subject that has been successfully matched + \fIovector\fP Offset vector that \fBpcre_exec()\fP used + \fIstringcount\fP Value returned by \fBpcre_exec()\fP + \fIstringnumber\fP Number of the required substring + \fIbuffer\fP Buffer to receive the string + \fIbuffersize\fP Size of buffer +.sp +The yield is the legnth of the string, PCRE_ERROR_NOMEMORY if the buffer was +too small, or PCRE_ERROR_NOSUBSTRING if the string number is invalid. +.P +There is a complete description of the PCRE native API in the +.\" HREF +\fBpcreapi\fP +.\" +page and a description of the POSIX API in the +.\" HREF +\fBpcreposix\fP +.\" +page. diff --git a/mozilla/js/tamarin/pcre/doc/pcre_dfa_exec.3 b/mozilla/js/tamarin/pcre/doc/pcre_dfa_exec.3 new file mode 100644 index 00000000000..a661fe21f6f --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/pcre_dfa_exec.3 @@ -0,0 +1,80 @@ +.TH PCRE_DFA_EXEC 3 +.SH NAME +PCRE - Perl-compatible regular expressions +.SH SYNOPSIS +.rs +.sp +.B #include +.PP +.SM +.br +.B int pcre_dfa_exec(const pcre *\fIcode\fP, "const pcre_extra *\fIextra\fP," +.ti +5n +.B "const char *\fIsubject\fP," int \fIlength\fP, int \fIstartoffset\fP, +.ti +5n +.B int \fIoptions\fP, int *\fIovector\fP, int \fIovecsize\fP, +.ti +5n +.B int *\fIworkspace\fP, int \fIwscount\fP); +. +.SH DESCRIPTION +.rs +.sp +This function matches a compiled regular expression against a given subject +string, using a DFA matching algorithm (\fInot\fP Perl-compatible). Note that +the main, Perl-compatible, matching function is \fBpcre_exec()\fP. The +arguments for this function are: +.sp + \fIcode\fP Points to the compiled pattern + \fIextra\fP Points to an associated \fBpcre_extra\fP structure, + or is NULL + \fIsubject\fP Points to the subject string + \fIlength\fP Length of the subject string, in bytes + \fIstartoffset\fP Offset in bytes in the subject at which to + start matching + \fIoptions\fP Option bits + \fIovector\fP Points to a vector of ints for result offsets + \fIovecsize\fP Number of elements in the vector + \fIworkspace\fP Points to a vector of ints used as working space + \fIwscount\fP Number of elements in the vector +.sp +The options are: +.sp + PCRE_ANCHORED Match only at the first position + PCRE_NOTBOL Subject is not the beginning of a line + PCRE_NOTEOL Subject is not the end of a line + PCRE_NOTEMPTY An empty string is not a valid match + PCRE_NO_UTF8_CHECK Do not check the subject for UTF-8 + validity (only relevant if PCRE_UTF8 + was set at compile time) + PCRE_PARTIAL Return PCRE_ERROR_PARTIAL for a partial match + PCRE_DFA_SHORTEST Return only the shortest match + PCRE_DFA_RESTART This is a restart after a partial match +.sp +There are restrictions on what may appear in a pattern when matching using the +DFA algorithm is requested. Details are given in the +.\" HREF +\fBpcrematching\fP +.\" +documentation. +.P +A \fBpcre_extra\fP structure contains the following fields: +.sp + \fIflags\fP Bits indicating which fields are set + \fIstudy_data\fP Opaque data from \fBpcre_study()\fP + \fImatch_limit\fP Limit on internal recursion + \fIcallout_data\fP Opaque data passed back to callouts + \fItables\fP Points to character tables or is NULL +.sp +The flag bits are PCRE_EXTRA_STUDY_DATA, PCRE_EXTRA_MATCH_LIMIT, +PCRE_EXTRA_CALLOUT_DATA, and PCRE_EXTRA_TABLES. For DFA matching, the +\fImatch_limit\fP field is not used, and must not be set. +.P +There is a complete description of the PCRE native API in the +.\" HREF +\fBpcreapi\fP +.\" +page and a description of the POSIX API in the +.\" HREF +\fBpcreposix\fP +.\" +page. diff --git a/mozilla/js/tamarin/pcre/doc/pcre_exec.3 b/mozilla/js/tamarin/pcre/doc/pcre_exec.3 new file mode 100644 index 00000000000..78ce188e680 --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/pcre_exec.3 @@ -0,0 +1,68 @@ +.TH PCRE_EXEC 3 +.SH NAME +PCRE - Perl-compatible regular expressions +.SH SYNOPSIS +.rs +.sp +.B #include +.PP +.SM +.br +.B int pcre_exec(const pcre *\fIcode\fP, "const pcre_extra *\fIextra\fP," +.ti +5n +.B "const char *\fIsubject\fP," int \fIlength\fP, int \fIstartoffset\fP, +.ti +5n +.B int \fIoptions\fP, int *\fIovector\fP, int \fIovecsize\fP); +. +.SH DESCRIPTION +.rs +.sp +This function matches a compiled regular expression against a given subject +string, using a matching algorithm that is similar to Perl's. It returns +offsets to captured substrings. Its arguments are: +.sp + \fIcode\fP Points to the compiled pattern + \fIextra\fP Points to an associated \fBpcre_extra\fP structure, + or is NULL + \fIsubject\fP Points to the subject string + \fIlength\fP Length of the subject string, in bytes + \fIstartoffset\fP Offset in bytes in the subject at which to + start matching + \fIoptions\fP Option bits + \fIovector\fP Points to a vector of ints for result offsets + \fIovecsize\fP Number of elements in the vector (a multiple of 3) +.sp +The options are: +.sp + PCRE_ANCHORED Match only at the first position + PCRE_NOTBOL Subject is not the beginning of a line + PCRE_NOTEOL Subject is not the end of a line + PCRE_NOTEMPTY An empty string is not a valid match + PCRE_NO_UTF8_CHECK Do not check the subject for UTF-8 + validity (only relevant if PCRE_UTF8 + was set at compile time) + PCRE_PARTIAL Return PCRE_ERROR_PARTIAL for a partial match +.sp +There are restrictions on what may appear in a pattern when partial matching is +requested. +.P +A \fBpcre_extra\fP structure contains the following fields: +.sp + \fIflags\fP Bits indicating which fields are set + \fIstudy_data\fP Opaque data from \fBpcre_study()\fP + \fImatch_limit\fP Limit on internal recursion + \fIcallout_data\fP Opaque data passed back to callouts + \fItables\fP Points to character tables or is NULL +.sp +The flag bits are PCRE_EXTRA_STUDY_DATA, PCRE_EXTRA_MATCH_LIMIT, +PCRE_EXTRA_CALLOUT_DATA, and PCRE_EXTRA_TABLES. +.P +There is a complete description of the PCRE native API in the +.\" HREF +\fBpcreapi\fP +.\" +page and a description of the POSIX API in the +.\" HREF +\fBpcreposix\fP +.\" +page. diff --git a/mozilla/js/tamarin/pcre/doc/pcre_free_substring.3 b/mozilla/js/tamarin/pcre/doc/pcre_free_substring.3 new file mode 100644 index 00000000000..3628c263a18 --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/pcre_free_substring.3 @@ -0,0 +1,28 @@ +.TH PCRE_FREE_SUBSTRING 3 +.SH NAME +PCRE - Perl-compatible regular expressions +.SH SYNOPSIS +.rs +.sp +.B #include +.PP +.SM +.br +.B void pcre_free_substring(const char *\fIstringptr\fP); +. +.SH DESCRIPTION +.rs +.sp +This is a convenience function for freeing the store obtained by a previous +call to \fBpcre_get_substring()\fP or \fBpcre_get_named_substring()\fP. Its +only argument is a pointer to the string. +.P +There is a complete description of the PCRE native API in the +.\" HREF +\fBpcreapi\fP +.\" +page and a description of the POSIX API in the +.\" HREF +\fBpcreposix\fP +.\" +page. diff --git a/mozilla/js/tamarin/pcre/doc/pcre_free_substring_list.3 b/mozilla/js/tamarin/pcre/doc/pcre_free_substring_list.3 new file mode 100644 index 00000000000..9365d363f4e --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/pcre_free_substring_list.3 @@ -0,0 +1,28 @@ +.TH PCRE_FREE_SUBSTRING_LIST 3 +.SH NAME +PCRE - Perl-compatible regular expressions +.SH SYNOPSIS +.rs +.sp +.B #include +.PP +.SM +.br +.B void pcre_free_substring_list(const char **\fIstringptr\fP); +. +.SH DESCRIPTION +.rs +.sp +This is a convenience function for freeing the store obtained by a previous +call to \fBpcre_get_substring_list()\fP. Its only argument is a pointer to the +list of string pointers. +.P +There is a complete description of the PCRE native API in the +.\" HREF +\fBpcreapi\fP +.\" +page and a description of the POSIX API in the +.\" HREF +\fBpcreposix\fP +.\" +page. diff --git a/mozilla/js/tamarin/pcre/doc/pcre_fullinfo.3 b/mozilla/js/tamarin/pcre/doc/pcre_fullinfo.3 new file mode 100644 index 00000000000..4b528e27032 --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/pcre_fullinfo.3 @@ -0,0 +1,59 @@ +.TH PCRE_FULLINFO 3 +.SH NAME +PCRE - Perl-compatible regular expressions +.SH SYNOPSIS +.rs +.sp +.B #include +.PP +.SM +.br +.B int pcre_fullinfo(const pcre *\fIcode\fP, "const pcre_extra *\fIextra\fP," +.ti +5n +.B int \fIwhat\fP, void *\fIwhere\fP); +. +.SH DESCRIPTION +.rs +.sp +This function returns information about a compiled pattern. Its arguments are: +.sp + \fIcode\fP Compiled regular expression + \fIextra\fP Result of \fBpcre_study()\fP or NULL + \fIwhat\fP What information is required + \fIwhere\fP Where to put the information +.sp +The following information is available: +.sp + PCRE_INFO_BACKREFMAX Number of highest back reference + PCRE_INFO_CAPTURECOUNT Number of capturing subpatterns + PCRE_INFO_DEFAULT_TABLES Pointer to default tables + PCRE_INFO_FIRSTBYTE Fixed first byte for a match, or + -1 for start of string + or after newline, or + -2 otherwise + PCRE_INFO_FIRSTTABLE Table of first bytes + (after studying) + PCRE_INFO_LASTLITERAL Literal last byte required + PCRE_INFO_NAMECOUNT Number of named subpatterns + PCRE_INFO_NAMEENTRYSIZE Size of name table entry + PCRE_INFO_NAMETABLE Pointer to name table + PCRE_INFO_OPTIONS Options used for compilation + PCRE_INFO_SIZE Size of compiled pattern + PCRE_INFO_STUDYSIZE Size of study data +.sp +The yield of the function is zero on success or: +.sp + PCRE_ERROR_NULL the argument \fIcode\fP was NULL + the argument \fIwhere\fP was NULL + PCRE_ERROR_BADMAGIC the "magic number" was not found + PCRE_ERROR_BADOPTION the value of \fIwhat\fP was invalid +.P +There is a complete description of the PCRE native API in the +.\" HREF +\fBpcreapi\fP +.\" +page and a description of the POSIX API in the +.\" HREF +\fBpcreposix\fP +.\" +page. diff --git a/mozilla/js/tamarin/pcre/doc/pcre_get_named_substring.3 b/mozilla/js/tamarin/pcre/doc/pcre_get_named_substring.3 new file mode 100644 index 00000000000..2a1043d9da2 --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/pcre_get_named_substring.3 @@ -0,0 +1,45 @@ +.TH PCRE_GET_NAMED_SUBSTRING 3 +.SH NAME +PCRE - Perl-compatible regular expressions +.SH SYNOPSIS +.rs +.sp +.B #include +.PP +.SM +.br +.B int pcre_get_named_substring(const pcre *\fIcode\fP, +.ti +5n +.B const char *\fIsubject\fP, int *\fIovector\fP, +.ti +5n +.B int \fIstringcount\fP, const char *\fIstringname\fP, +.ti +5n +.B const char **\fIstringptr\fP); +. +.SH DESCRIPTION +.rs +.sp +This is a convenience function for extracting a captured substring by name. The +arguments are: +.sp + \fIcode\fP Compiled pattern + \fIsubject\fP Subject that has been successfully matched + \fIovector\fP Offset vector that \fBpcre_exec()\fP used + \fIstringcount\fP Value returned by \fBpcre_exec()\fP + \fIstringname\fP Name of the required substring + \fIstringptr\fP Where to put the string pointer +.sp +The memory in which the substring is placed is obtained by calling +\fBpcre_malloc()\fP. The yield of the function is the length of the extracted +substring, PCRE_ERROR_NOMEMORY if sufficient memory could not be obtained, or +PCRE_ERROR_NOSUBSTRING if the string name is invalid. +.P +There is a complete description of the PCRE native API in the +.\" HREF +\fBpcreapi\fP +.\" +page and a description of the POSIX API in the +.\" HREF +\fBpcreposix\fP +.\" +page. diff --git a/mozilla/js/tamarin/pcre/doc/pcre_get_stringnumber.3 b/mozilla/js/tamarin/pcre/doc/pcre_get_stringnumber.3 new file mode 100644 index 00000000000..f6f46de263d --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/pcre_get_stringnumber.3 @@ -0,0 +1,35 @@ +.TH PCRE_GET_STRINGNUMBER 3 +.SH NAME +PCRE - Perl-compatible regular expressions +.SH SYNOPSIS +.rs +.sp +.B #include +.PP +.SM +.br +.B int pcre_get_stringnumber(const pcre *\fIcode\fP, +.ti +5n +.B const char *\fIname\fP); +. +.SH DESCRIPTION +.rs +.sp +This convenience function finds the number of a named substring capturing +parenthesis in a compiled pattern. Its arguments are: +.sp + \fIcode\fP Compiled regular expression + \fIname\fP Name whose number is required +.sp +The yield of the function is the number of the parenthesis if the name is +found, or PCRE_ERROR_NOSUBSTRING otherwise. +.P +There is a complete description of the PCRE native API in the +.\" HREF +\fBpcreapi\fP +.\" +page and a description of the POSIX API in the +.\" HREF +\fBpcreposix\fP +.\" +page. diff --git a/mozilla/js/tamarin/pcre/doc/pcre_get_substring.3 b/mozilla/js/tamarin/pcre/doc/pcre_get_substring.3 new file mode 100644 index 00000000000..cc35e4a8cb8 --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/pcre_get_substring.3 @@ -0,0 +1,42 @@ +.TH PCRE_GET_SUBSTRING 3 +.SH NAME +PCRE - Perl-compatible regular expressions +.SH SYNOPSIS +.rs +.sp +.B #include +.PP +.SM +.br +.B int pcre_get_substring(const char *\fIsubject\fP, int *\fIovector\fP, +.ti +5n +.B int \fIstringcount\fP, int \fIstringnumber\fP, +.ti +5n +.B const char **\fIstringptr\fP); +. +.SH DESCRIPTION +.rs +.sp +This is a convenience function for extracting a captured substring. The +arguments are: +.sp + \fIsubject\fP Subject that has been successfully matched + \fIovector\fP Offset vector that \fBpcre_exec()\fP used + \fIstringcount\fP Value returned by \fBpcre_exec()\fP + \fIstringnumber\fP Number of the required substring + \fIstringptr\fP Where to put the string pointer +.sp +The memory in which the substring is placed is obtained by calling +\fBpcre_malloc()\fP. The yield of the function is the length of the substring, +PCRE_ERROR_NOMEMORY if sufficient memory could not be obtained, or +PCRE_ERROR_NOSUBSTRING if the string number is invalid. +.P +There is a complete description of the PCRE native API in the +.\" HREF +\fBpcreapi\fP +.\" +page and a description of the POSIX API in the +.\" HREF +\fBpcreposix\fP +.\" +page. diff --git a/mozilla/js/tamarin/pcre/doc/pcre_get_substring_list.3 b/mozilla/js/tamarin/pcre/doc/pcre_get_substring_list.3 new file mode 100644 index 00000000000..51d8ba5d097 --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/pcre_get_substring_list.3 @@ -0,0 +1,40 @@ +.TH PCRE_GET_SUBSTRING_LIST 3 +.SH NAME +PCRE - Perl-compatible regular expressions +.SH SYNOPSIS +.rs +.sp +.B #include +.PP +.SM +.br +.B int pcre_get_substring_list(const char *\fIsubject\fP, +.ti +5n +.B int *\fIovector\fP, int \fIstringcount\fP, "const char ***\fIlistptr\fP);" +. +.SH DESCRIPTION +.rs +.sp +This is a convenience function for extracting a list of all the captured +substrings. The arguments are: +.sp + \fIsubject\fP Subject that has been successfully matched + \fIovector\fP Offset vector that \fBpcre_exec\fP used + \fIstringcount\fP Value returned by \fBpcre_exec\fP + \fIlistptr\fP Where to put a pointer to the list +.sp +The memory in which the substrings and the list are placed is obtained by +calling \fBpcre_malloc()\fP. A pointer to a list of pointers is put in +the variable whose address is in \fIlistptr\fP. The list is terminated by a +NULL pointer. The yield of the function is zero on success or +PCRE_ERROR_NOMEMORY if sufficient memory could not be obtained. +.P +There is a complete description of the PCRE native API in the +.\" HREF +\fBpcreapi\fP +.\" +page and a description of the POSIX API in the +.\" HREF +\fBpcreposix\fP +.\" +page. diff --git a/mozilla/js/tamarin/pcre/doc/pcre_info.3 b/mozilla/js/tamarin/pcre/doc/pcre_info.3 new file mode 100644 index 00000000000..5974067533f --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/pcre_info.3 @@ -0,0 +1,27 @@ +.TH PCRE_INFO 3 +.SH NAME +PCRE - Perl-compatible regular expressions +.SH SYNOPSIS +.rs +.sp +.B #include +.PP +.SM +.br +.B int pcre_info(const pcre *\fIcode\fP, int *\fIoptptr\fP, int +.B *\fIfirstcharptr\fP); +. +.SH DESCRIPTION +.rs +.sp +This function is obsolete. You should be using \fBpcre_fullinfo()\fP instead. +.P +There is a complete description of the PCRE native API in the +.\" HREF +\fBpcreapi\fP +.\" +page and a description of the POSIX API in the +.\" HREF +\fBpcreposix\fP +.\" +page. diff --git a/mozilla/js/tamarin/pcre/doc/pcre_maketables.3 b/mozilla/js/tamarin/pcre/doc/pcre_maketables.3 new file mode 100644 index 00000000000..45a9dd9c9ef --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/pcre_maketables.3 @@ -0,0 +1,30 @@ +.TH PCRE_MAKETABLES 3 +.SH NAME +PCRE - Perl-compatible regular expressions +.SH SYNOPSIS +.rs +.sp +.B #include +.PP +.SM +.br +.B const unsigned char *pcre_maketables(void); +. +.SH DESCRIPTION +.rs +.sp +This function builds a set of character tables for character values less than +256. These can be passed to \fBpcre_compile()\fP to override PCRE's internal, +built-in tables (which were made by \fBpcre_maketables()\fP when PCRE was +compiled). You might want to do this if you are using a non-standard locale. +The function yields a pointer to the tables. +.P +There is a complete description of the PCRE native API in the +.\" HREF +\fBpcreapi\fP +.\" +page and a description of the POSIX API in the +.\" HREF +\fBpcreposix\fP +.\" +page. diff --git a/mozilla/js/tamarin/pcre/doc/pcre_refcount.3 b/mozilla/js/tamarin/pcre/doc/pcre_refcount.3 new file mode 100644 index 00000000000..61fe55f47e7 --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/pcre_refcount.3 @@ -0,0 +1,33 @@ +.TH PCRE_REFCOUNT 3 +.SH NAME +PCRE - Perl-compatible regular expressions +.SH SYNOPSIS +.rs +.sp +.B #include +.PP +.SM +.br +.B int pcre_info(pcre *\fIcode\fP, int \fIadjust\fP); +. +.SH DESCRIPTION +.rs +.sp +This function is used to maintain a reference count inside a data block that +contains a compiled pattern. Its arguments are: +.sp + \fIcode\fP Compiled regular expression + \fIadjust\fP Adjustment to reference value +.sp +The yield of the function is the adjusted reference value, which is constrained +to lie between 0 and 65535. +.P +There is a complete description of the PCRE native API in the +.\" HREF +\fBpcreapi\fP +.\" +page and a description of the POSIX API in the +.\" HREF +\fBpcreposix\fP +.\" +page. diff --git a/mozilla/js/tamarin/pcre/doc/pcre_study.3 b/mozilla/js/tamarin/pcre/doc/pcre_study.3 new file mode 100644 index 00000000000..eafc9103709 --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/pcre_study.3 @@ -0,0 +1,43 @@ +.TH PCRE_STUDY 3 +.SH NAME +PCRE - Perl-compatible regular expressions +.SH SYNOPSIS +.rs +.sp +.B #include +.PP +.SM +.br +.B pcre_extra *pcre_study(const pcre *\fIcode\fP, int \fIoptions\fP, +.ti +5n +.B const char **\fIerrptr\fP); +. +.SH DESCRIPTION +.rs +.sp +This function studies a compiled pattern, to see if additional information can +be extracted that might speed up matching. Its arguments are: +.sp + \fIcode\fP A compiled regular expression + \fIoptions\fP Options for \fBpcre_study()\fP + \fIerrptr\fP Where to put an error message +.sp +If the function succeeds, it returns a value that can be passed to +\fBpcre_exec()\fP via its \fIextra\fP argument. +.P +If the function returns NULL, either it could not find any additional +information, or there was an error. You can tell the difference by looking at +the error value. It is NULL in first case. +.P +There are currently no options defined; the value of the second argument should +always be zero. +.P +There is a complete description of the PCRE native API in the +.\" HREF +\fBpcreapi\fP +.\" +page and a description of the POSIX API in the +.\" HREF +\fBpcreposix\fP +.\" +page. diff --git a/mozilla/js/tamarin/pcre/doc/pcre_version.3 b/mozilla/js/tamarin/pcre/doc/pcre_version.3 new file mode 100644 index 00000000000..e48a0e9eb07 --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/pcre_version.3 @@ -0,0 +1,27 @@ +.TH PCRE_VERSION 3 +.SH NAME +PCRE - Perl-compatible regular expressions +.SH SYNOPSIS +.rs +.sp +.B #include +.PP +.SM +.br +.B char *pcre_version(void); +. +.SH DESCRIPTION +.rs +.sp +This function returns a character string that gives the version number of the +PCRE library and the date of its release. +.P +There is a complete description of the PCRE native API in the +.\" HREF +\fBpcreapi\fP +.\" +page and a description of the POSIX API in the +.\" HREF +\fBpcreposix\fP +.\" +page. diff --git a/mozilla/js/tamarin/pcre/doc/pcreapi.3 b/mozilla/js/tamarin/pcre/doc/pcreapi.3 new file mode 100644 index 00000000000..4f8114a005a --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/pcreapi.3 @@ -0,0 +1,1636 @@ +.TH PCREAPI 3 +.SH NAME +PCRE - Perl-compatible regular expressions +.SH "PCRE NATIVE API" +.rs +.sp +.B #include +.PP +.SM +.br +.B pcre *pcre_compile(const char *\fIpattern\fP, int \fIoptions\fP, +.ti +5n +.B const char **\fIerrptr\fP, int *\fIerroffset\fP, +.ti +5n +.B const unsigned char *\fItableptr\fP); +.PP +.br +.B pcre *pcre_compile2(const char *\fIpattern\fP, int \fIoptions\fP, +.ti +5n +.B int *\fIerrorcodeptr\fP, +.ti +5n +.B const char **\fIerrptr\fP, int *\fIerroffset\fP, +.ti +5n +.B const unsigned char *\fItableptr\fP); +.PP +.br +.B pcre_extra *pcre_study(const pcre *\fIcode\fP, int \fIoptions\fP, +.ti +5n +.B const char **\fIerrptr\fP); +.PP +.br +.B int pcre_exec(const pcre *\fIcode\fP, "const pcre_extra *\fIextra\fP," +.ti +5n +.B "const char *\fIsubject\fP," int \fIlength\fP, int \fIstartoffset\fP, +.ti +5n +.B int \fIoptions\fP, int *\fIovector\fP, int \fIovecsize\fP); +.PP +.br +.B int pcre_dfa_exec(const pcre *\fIcode\fP, "const pcre_extra *\fIextra\fP," +.ti +5n +.B "const char *\fIsubject\fP," int \fIlength\fP, int \fIstartoffset\fP, +.ti +5n +.B int \fIoptions\fP, int *\fIovector\fP, int \fIovecsize\fP, +.ti +5n +.B int *\fIworkspace\fP, int \fIwscount\fP); +.PP +.br +.B int pcre_copy_named_substring(const pcre *\fIcode\fP, +.ti +5n +.B const char *\fIsubject\fP, int *\fIovector\fP, +.ti +5n +.B int \fIstringcount\fP, const char *\fIstringname\fP, +.ti +5n +.B char *\fIbuffer\fP, int \fIbuffersize\fP); +.PP +.br +.B int pcre_copy_substring(const char *\fIsubject\fP, int *\fIovector\fP, +.ti +5n +.B int \fIstringcount\fP, int \fIstringnumber\fP, char *\fIbuffer\fP, +.ti +5n +.B int \fIbuffersize\fP); +.PP +.br +.B int pcre_get_named_substring(const pcre *\fIcode\fP, +.ti +5n +.B const char *\fIsubject\fP, int *\fIovector\fP, +.ti +5n +.B int \fIstringcount\fP, const char *\fIstringname\fP, +.ti +5n +.B const char **\fIstringptr\fP); +.PP +.br +.B int pcre_get_stringnumber(const pcre *\fIcode\fP, +.ti +5n +.B const char *\fIname\fP); +.PP +.br +.B int pcre_get_substring(const char *\fIsubject\fP, int *\fIovector\fP, +.ti +5n +.B int \fIstringcount\fP, int \fIstringnumber\fP, +.ti +5n +.B const char **\fIstringptr\fP); +.PP +.br +.B int pcre_get_substring_list(const char *\fIsubject\fP, +.ti +5n +.B int *\fIovector\fP, int \fIstringcount\fP, "const char ***\fIlistptr\fP);" +.PP +.br +.B void pcre_free_substring(const char *\fIstringptr\fP); +.PP +.br +.B void pcre_free_substring_list(const char **\fIstringptr\fP); +.PP +.br +.B const unsigned char *pcre_maketables(void); +.PP +.br +.B int pcre_fullinfo(const pcre *\fIcode\fP, "const pcre_extra *\fIextra\fP," +.ti +5n +.B int \fIwhat\fP, void *\fIwhere\fP); +.PP +.br +.B int pcre_info(const pcre *\fIcode\fP, int *\fIoptptr\fP, int +.B *\fIfirstcharptr\fP); +.PP +.br +.B int pcre_refcount(pcre *\fIcode\fP, int \fIadjust\fP); +.PP +.br +.B int pcre_config(int \fIwhat\fP, void *\fIwhere\fP); +.PP +.br +.B char *pcre_version(void); +.PP +.br +.B void *(*pcre_malloc)(size_t); +.PP +.br +.B void (*pcre_free)(void *); +.PP +.br +.B void *(*pcre_stack_malloc)(size_t); +.PP +.br +.B void (*pcre_stack_free)(void *); +.PP +.br +.B int (*pcre_callout)(pcre_callout_block *); +. +. +.SH "PCRE API OVERVIEW" +.rs +.sp +PCRE has its own native API, which is described in this document. There is +also a set of wrapper functions that correspond to the POSIX regular expression +API. These are described in the +.\" HREF +\fBpcreposix\fP +.\" +documentation. Both of these APIs define a set of C function calls. A C++ +wrapper is distributed with PCRE. It is documented in the +.\" HREF +\fBpcrecpp\fP +.\" +page. +.P +The native API C function prototypes are defined in the header file +\fBpcre.h\fP, and on Unix systems the library itself is called \fBlibpcre\fP. +It can normally be accessed by adding \fB-lpcre\fP to the command for linking +an application that uses PCRE. The header file defines the macros PCRE_MAJOR +and PCRE_MINOR to contain the major and minor release numbers for the library. +Applications can use these to include support for different releases of PCRE. +.P +The functions \fBpcre_compile()\fP, \fBpcre_compile2()\fP, \fBpcre_study()\fP, +and \fBpcre_exec()\fP are used for compiling and matching regular expressions +in a Perl-compatible manner. A sample program that demonstrates the simplest +way of using them is provided in the file called \fIpcredemo.c\fP in the source +distribution. The +.\" HREF +\fBpcresample\fP +.\" +documentation describes how to run it. +.P +A second matching function, \fBpcre_dfa_exec()\fP, which is not +Perl-compatible, is also provided. This uses a different algorithm for the +matching. This allows it to find all possible matches (at a given point in the +subject), not just one. However, this algorithm does not return captured +substrings. A description of the two matching algorithms and their advantages +and disadvantages is given in the +.\" HREF +\fBpcrematching\fP +.\" +documentation. +.P +In addition to the main compiling and matching functions, there are convenience +functions for extracting captured substrings from a subject string that is +matched by \fBpcre_exec()\fP. They are: +.sp + \fBpcre_copy_substring()\fP + \fBpcre_copy_named_substring()\fP + \fBpcre_get_substring()\fP + \fBpcre_get_named_substring()\fP + \fBpcre_get_substring_list()\fP + \fBpcre_get_stringnumber()\fP +.sp +\fBpcre_free_substring()\fP and \fBpcre_free_substring_list()\fP are also +provided, to free the memory used for extracted strings. +.P +The function \fBpcre_maketables()\fP is used to build a set of character tables +in the current locale for passing to \fBpcre_compile()\fP, \fBpcre_exec()\fP, +or \fBpcre_dfa_exec()\fP. This is an optional facility that is provided for +specialist use. Most commonly, no special tables are passed, in which case +internal tables that are generated when PCRE is built are used. +.P +The function \fBpcre_fullinfo()\fP is used to find out information about a +compiled pattern; \fBpcre_info()\fP is an obsolete version that returns only +some of the available information, but is retained for backwards compatibility. +The function \fBpcre_version()\fP returns a pointer to a string containing the +version of PCRE and its date of release. +.P +The function \fBpcre_refcount()\fP maintains a reference count in a data block +containing a compiled pattern. This is provided for the benefit of +object-oriented applications. +.P +The global variables \fBpcre_malloc\fP and \fBpcre_free\fP initially contain +the entry points of the standard \fBmalloc()\fP and \fBfree()\fP functions, +respectively. PCRE calls the memory management functions via these variables, +so a calling program can replace them if it wishes to intercept the calls. This +should be done before calling any PCRE functions. +.P +The global variables \fBpcre_stack_malloc\fP and \fBpcre_stack_free\fP are also +indirections to memory management functions. These special functions are used +only when PCRE is compiled to use the heap for remembering data, instead of +recursive function calls, when running the \fBpcre_exec()\fP function. This is +a non-standard way of building PCRE, for use in environments that have limited +stacks. Because of the greater use of memory management, it runs more slowly. +Separate functions are provided so that special-purpose external code can be +used for this case. When used, these functions are always called in a +stack-like manner (last obtained, first freed), and always for memory blocks of +the same size. +.P +The global variable \fBpcre_callout\fP initially contains NULL. It can be set +by the caller to a "callout" function, which PCRE will then call at specified +points during a matching operation. Details are given in the +.\" HREF +\fBpcrecallout\fP +.\" +documentation. +. +. +.SH MULTITHREADING +.rs +.sp +The PCRE functions can be used in multi-threading applications, with the +proviso that the memory management functions pointed to by \fBpcre_malloc\fP, +\fBpcre_free\fP, \fBpcre_stack_malloc\fP, and \fBpcre_stack_free\fP, and the +callout function pointed to by \fBpcre_callout\fP, are shared by all threads. +.P +The compiled form of a regular expression is not altered during matching, so +the same compiled pattern can safely be used by several threads at once. +. +. +.SH "SAVING PRECOMPILED PATTERNS FOR LATER USE" +.rs +.sp +The compiled form of a regular expression can be saved and re-used at a later +time, possibly by a different program, and even on a host other than the one on +which it was compiled. Details are given in the +.\" HREF +\fBpcreprecompile\fP +.\" +documentation. +. +. +.SH "CHECKING BUILD-TIME OPTIONS" +.rs +.sp +.B int pcre_config(int \fIwhat\fP, void *\fIwhere\fP); +.PP +The function \fBpcre_config()\fP makes it possible for a PCRE client to +discover which optional features have been compiled into the PCRE library. The +.\" HREF +\fBpcrebuild\fP +.\" +documentation has more details about these optional features. +.P +The first argument for \fBpcre_config()\fP is an integer, specifying which +information is required; the second argument is a pointer to a variable into +which the information is placed. The following information is available: +.sp + PCRE_CONFIG_UTF8 +.sp +The output is an integer that is set to one if UTF-8 support is available; +otherwise it is set to zero. +.sp + PCRE_CONFIG_UNICODE_PROPERTIES +.sp +The output is an integer that is set to one if support for Unicode character +properties is available; otherwise it is set to zero. +.sp + PCRE_CONFIG_NEWLINE +.sp +The output is an integer that is set to the value of the code that is used for +the newline character. It is either linefeed (10) or carriage return (13), and +should normally be the standard character for your operating system. +.sp + PCRE_CONFIG_LINK_SIZE +.sp +The output is an integer that contains the number of bytes used for internal +linkage in compiled regular expressions. The value is 2, 3, or 4. Larger values +allow larger regular expressions to be compiled, at the expense of slower +matching. The default value of 2 is sufficient for all but the most massive +patterns, since it allows the compiled pattern to be up to 64K in size. +.sp + PCRE_CONFIG_POSIX_MALLOC_THRESHOLD +.sp +The output is an integer that contains the threshold above which the POSIX +interface uses \fBmalloc()\fP for output vectors. Further details are given in +the +.\" HREF +\fBpcreposix\fP +.\" +documentation. +.sp + PCRE_CONFIG_MATCH_LIMIT +.sp +The output is an integer that gives the default limit for the number of +internal matching function calls in a \fBpcre_exec()\fP execution. Further +details are given with \fBpcre_exec()\fP below. +.sp + PCRE_CONFIG_STACKRECURSE +.sp +The output is an integer that is set to one if internal recursion when running +\fBpcre_exec()\fP is implemented by recursive function calls that use the stack +to remember their state. This is the usual way that PCRE is compiled. The +output is zero if PCRE was compiled to use blocks of data on the heap instead +of recursive function calls. In this case, \fBpcre_stack_malloc\fP and +\fBpcre_stack_free\fP are called to manage memory blocks on the heap, thus +avoiding the use of the stack. +. +. +.SH "COMPILING A PATTERN" +.rs +.sp +.B pcre *pcre_compile(const char *\fIpattern\fP, int \fIoptions\fP, +.ti +5n +.B const char **\fIerrptr\fP, int *\fIerroffset\fP, +.ti +5n +.B const unsigned char *\fItableptr\fP); +.sp +.B pcre *pcre_compile2(const char *\fIpattern\fP, int \fIoptions\fP, +.ti +5n +.B int *\fIerrorcodeptr\fP, +.ti +5n +.B const char **\fIerrptr\fP, int *\fIerroffset\fP, +.ti +5n +.B const unsigned char *\fItableptr\fP); +.P +Either of the functions \fBpcre_compile()\fP or \fBpcre_compile2()\fP can be +called to compile a pattern into an internal form. The only difference between +the two interfaces is that \fBpcre_compile2()\fP has an additional argument, +\fIerrorcodeptr\fP, via which a numerical error code can be returned. +.P +The pattern is a C string terminated by a binary zero, and is passed in the +\fIpattern\fP argument. A pointer to a single block of memory that is obtained +via \fBpcre_malloc\fP is returned. This contains the compiled code and related +data. The \fBpcre\fP type is defined for the returned block; this is a typedef +for a structure whose contents are not externally defined. It is up to the +caller to free the memory when it is no longer required. +.P +Although the compiled code of a PCRE regex is relocatable, that is, it does not +depend on memory location, the complete \fBpcre\fP data block is not +fully relocatable, because it may contain a copy of the \fItableptr\fP +argument, which is an address (see below). +.P +The \fIoptions\fP argument contains independent bits that affect the +compilation. It should be zero if no options are required. The available +options are described below. Some of them, in particular, those that are +compatible with Perl, can also be set and unset from within the pattern (see +the detailed description in the +.\" HREF +\fBpcrepattern\fP +.\" +documentation). For these options, the contents of the \fIoptions\fP argument +specifies their initial settings at the start of compilation and execution. The +PCRE_ANCHORED option can be set at the time of matching as well as at compile +time. +.P +If \fIerrptr\fP is NULL, \fBpcre_compile()\fP returns NULL immediately. +Otherwise, if compilation of a pattern fails, \fBpcre_compile()\fP returns +NULL, and sets the variable pointed to by \fIerrptr\fP to point to a textual +error message. The offset from the start of the pattern to the character where +the error was discovered is placed in the variable pointed to by +\fIerroffset\fP, which must not be NULL. If it is, an immediate error is given. +.P +If \fBpcre_compile2()\fP is used instead of \fBpcre_compile()\fP, and the +\fIerrorcodeptr\fP argument is not NULL, a non-zero error code number is +returned via this argument in the event of an error. This is in addition to the +textual error message. Error codes and messages are listed below. +.P +If the final argument, \fItableptr\fP, is NULL, PCRE uses a default set of +character tables that are built when PCRE is compiled, using the default C +locale. Otherwise, \fItableptr\fP must be an address that is the result of a +call to \fBpcre_maketables()\fP. This value is stored with the compiled +pattern, and used again by \fBpcre_exec()\fP, unless another table pointer is +passed to it. For more discussion, see the section on locale support below. +.P +This code fragment shows a typical straightforward call to \fBpcre_compile()\fP: +.sp + pcre *re; + const char *error; + int erroffset; + re = pcre_compile( + "^A.*Z", /* the pattern */ + 0, /* default options */ + &error, /* for error message */ + &erroffset, /* for error offset */ + NULL); /* use default character tables */ +.sp +The following names for option bits are defined in the \fBpcre.h\fP header +file: +.sp + PCRE_ANCHORED +.sp +If this bit is set, the pattern is forced to be "anchored", that is, it is +constrained to match only at the first matching point in the string that is +being searched (the "subject string"). This effect can also be achieved by +appropriate constructs in the pattern itself, which is the only way to do it in +Perl. +.sp + PCRE_AUTO_CALLOUT +.sp +If this bit is set, \fBpcre_compile()\fP automatically inserts callout items, +all with number 255, before each pattern item. For discussion of the callout +facility, see the +.\" HREF +\fBpcrecallout\fP +.\" +documentation. +.sp + PCRE_CASELESS +.sp +If this bit is set, letters in the pattern match both upper and lower case +letters. It is equivalent to Perl's /i option, and it can be changed within a +pattern by a (?i) option setting. In UTF-8 mode, PCRE always understands the +concept of case for characters whose values are less than 128, so caseless +matching is always possible. For characters with higher values, the concept of +case is supported if PCRE is compiled with Unicode property support, but not +otherwise. If you want to use caseless matching for characters 128 and above, +you must ensure that PCRE is compiled with Unicode property support as well as +with UTF-8 support. +.sp + PCRE_DOLLAR_ENDONLY +.sp +If this bit is set, a dollar metacharacter in the pattern matches only at the +end of the subject string. Without this option, a dollar also matches +immediately before the final character if it is a newline (but not before any +other newlines). The PCRE_DOLLAR_ENDONLY option is ignored if PCRE_MULTILINE is +set. There is no equivalent to this option in Perl, and no way to set it within +a pattern. +.sp + PCRE_DOTALL +.sp +If this bit is set, a dot metacharater in the pattern matches all characters, +including newlines. Without it, newlines are excluded. This option is +equivalent to Perl's /s option, and it can be changed within a pattern by a +(?s) option setting. A negative class such as [^a] always matches a newline +character, independent of the setting of this option. +.sp + PCRE_EXTENDED +.sp +If this bit is set, whitespace data characters in the pattern are totally +ignored except when escaped or inside a character class. Whitespace does not +include the VT character (code 11). In addition, characters between an +unescaped # outside a character class and the next newline character, +inclusive, are also ignored. This is equivalent to Perl's /x option, and it can +be changed within a pattern by a (?x) option setting. +.P +This option makes it possible to include comments inside complicated patterns. +Note, however, that this applies only to data characters. Whitespace characters +may never appear within special character sequences in a pattern, for example +within the sequence (?( which introduces a conditional subpattern. +.sp + PCRE_EXTRA +.sp +This option was invented in order to turn on additional functionality of PCRE +that is incompatible with Perl, but it is currently of very little use. When +set, any backslash in a pattern that is followed by a letter that has no +special meaning causes an error, thus reserving these combinations for future +expansion. By default, as in Perl, a backslash followed by a letter with no +special meaning is treated as a literal. There are at present no other features +controlled by this option. It can also be set by a (?X) option setting within a +pattern. +.sp + PCRE_FIRSTLINE +.sp +If this option is set, an unanchored pattern is required to match before or at +the first newline character in the subject string, though the matched text may +continue over the newline. +.sp + PCRE_MULTILINE +.sp +By default, PCRE treats the subject string as consisting of a single line of +characters (even if it actually contains newlines). The "start of line" +metacharacter (^) matches only at the start of the string, while the "end of +line" metacharacter ($) matches only at the end of the string, or before a +terminating newline (unless PCRE_DOLLAR_ENDONLY is set). This is the same as +Perl. +.P +When PCRE_MULTILINE it is set, the "start of line" and "end of line" constructs +match immediately following or immediately before any newline in the subject +string, respectively, as well as at the very start and end. This is equivalent +to Perl's /m option, and it can be changed within a pattern by a (?m) option +setting. If there are no "\en" characters in a subject string, or no +occurrences of ^ or $ in a pattern, setting PCRE_MULTILINE has no effect. +.sp + PCRE_NO_AUTO_CAPTURE +.sp +If this option is set, it disables the use of numbered capturing parentheses in +the pattern. Any opening parenthesis that is not followed by ? behaves as if it +were followed by ?: but named parentheses can still be used for capturing (and +they acquire numbers in the usual way). There is no equivalent of this option +in Perl. +.sp + PCRE_UNGREEDY +.sp +This option inverts the "greediness" of the quantifiers so that they are not +greedy by default, but become greedy if followed by "?". It is not compatible +with Perl. It can also be set by a (?U) option setting within the pattern. +.sp + PCRE_UTF8 +.sp +This option causes PCRE to regard both the pattern and the subject as strings +of UTF-8 characters instead of single-byte character strings. However, it is +available only when PCRE is built to include UTF-8 support. If not, the use +of this option provokes an error. Details of how this option changes the +behaviour of PCRE are given in the +.\" HTML +.\" +section on UTF-8 support +.\" +in the main +.\" HREF +\fBpcre\fP +.\" +page. +.sp + PCRE_NO_UTF8_CHECK +.sp +When PCRE_UTF8 is set, the validity of the pattern as a UTF-8 string is +automatically checked. If an invalid UTF-8 sequence of bytes is found, +\fBpcre_compile()\fP returns an error. If you already know that your pattern is +valid, and you want to skip this check for performance reasons, you can set the +PCRE_NO_UTF8_CHECK option. When it is set, the effect of passing an invalid +UTF-8 string as a pattern is undefined. It may cause your program to crash. +Note that this option can also be passed to \fBpcre_exec()\fP and +\fBpcre_dfa_exec()\fP, to suppress the UTF-8 validity checking of subject +strings. +. +. +.SH "COMPILATION ERROR CODES" +.rs +.sp +The following table lists the error codes than may be returned by +\fBpcre_compile2()\fP, along with the error messages that may be returned by +both compiling functions. +.sp + 0 no error + 1 \e at end of pattern + 2 \ec at end of pattern + 3 unrecognized character follows \e + 4 numbers out of order in {} quantifier + 5 number too big in {} quantifier + 6 missing terminating ] for character class + 7 invalid escape sequence in character class + 8 range out of order in character class + 9 nothing to repeat + 10 operand of unlimited repeat could match the empty string + 11 internal error: unexpected repeat + 12 unrecognized character after (? + 13 POSIX named classes are supported only within a class + 14 missing ) + 15 reference to non-existent subpattern + 16 erroffset passed as NULL + 17 unknown option bit(s) set + 18 missing ) after comment + 19 parentheses nested too deeply + 20 regular expression too large + 21 failed to get memory + 22 unmatched parentheses + 23 internal error: code overflow + 24 unrecognized character after (?< + 25 lookbehind assertion is not fixed length + 26 malformed number after (?( + 27 conditional group contains more than two branches + 28 assertion expected after (?( + 29 (?R or (?digits must be followed by ) + 30 unknown POSIX class name + 31 POSIX collating elements are not supported + 32 this version of PCRE is not compiled with PCRE_UTF8 support + 33 spare error + 34 character value in \ex{...} sequence is too large + 35 invalid condition (?(0) + 36 \eC not allowed in lookbehind assertion + 37 PCRE does not support \eL, \el, \eN, \eU, or \eu + 38 number after (?C is > 255 + 39 closing ) for (?C expected + 40 recursive call could loop indefinitely + 41 unrecognized character after (?P + 42 syntax error after (?P + 43 two named groups have the same name + 44 invalid UTF-8 string + 45 support for \eP, \ep, and \eX has not been compiled + 46 malformed \eP or \ep sequence + 47 unknown property name after \eP or \ep +. +. +.SH "STUDYING A PATTERN" +.rs +.sp +.B pcre_extra *pcre_study(const pcre *\fIcode\fP, int \fIoptions\fP +.ti +5n +.B const char **\fIerrptr\fP); +.PP +If a compiled pattern is going to be used several times, it is worth spending +more time analyzing it in order to speed up the time taken for matching. The +function \fBpcre_study()\fP takes a pointer to a compiled pattern as its first +argument. If studying the pattern produces additional information that will +help speed up matching, \fBpcre_study()\fP returns a pointer to a +\fBpcre_extra\fP block, in which the \fIstudy_data\fP field points to the +results of the study. +.P +The returned value from \fBpcre_study()\fP can be passed directly to +\fBpcre_exec()\fP. However, a \fBpcre_extra\fP block also contains other +fields that can be set by the caller before the block is passed; these are +described +.\" HTML +.\" +below +.\" +in the section on matching a pattern. +.P +If studying the pattern does not produce any additional information +\fBpcre_study()\fP returns NULL. In that circumstance, if the calling program +wants to pass any of the other fields to \fBpcre_exec()\fP, it must set up its +own \fBpcre_extra\fP block. +.P +The second argument of \fBpcre_study()\fP contains option bits. At present, no +options are defined, and this argument should always be zero. +.P +The third argument for \fBpcre_study()\fP is a pointer for an error message. If +studying succeeds (even if no data is returned), the variable it points to is +set to NULL. Otherwise it points to a textual error message. You should +therefore test the error pointer for NULL after calling \fBpcre_study()\fP, to +be sure that it has run successfully. +.P +This is a typical call to \fBpcre_study\fP(): +.sp + pcre_extra *pe; + pe = pcre_study( + re, /* result of pcre_compile() */ + 0, /* no options exist */ + &error); /* set to NULL or points to a message */ +.sp +At present, studying a pattern is useful only for non-anchored patterns that do +not have a single fixed starting character. A bitmap of possible starting +bytes is created. +. +. +.\" HTML +.SH "LOCALE SUPPORT" +.rs +.sp +PCRE handles caseless matching, and determines whether characters are letters +digits, or whatever, by reference to a set of tables, indexed by character +value. When running in UTF-8 mode, this applies only to characters with codes +less than 128. Higher-valued codes never match escapes such as \ew or \ed, but +can be tested with \ep if PCRE is built with Unicode character property +support. +.P +An internal set of tables is created in the default C locale when PCRE is +built. This is used when the final argument of \fBpcre_compile()\fP is NULL, +and is sufficient for many applications. An alternative set of tables can, +however, be supplied. These may be created in a different locale from the +default. As more and more applications change to using Unicode, the need for +this locale support is expected to die away. +.P +External tables are built by calling the \fBpcre_maketables()\fP function, +which has no arguments, in the relevant locale. The result can then be passed +to \fBpcre_compile()\fP or \fBpcre_exec()\fP as often as necessary. For +example, to build and use tables that are appropriate for the French locale +(where accented characters with values greater than 128 are treated as letters), +the following code could be used: +.sp + setlocale(LC_CTYPE, "fr_FR"); + tables = pcre_maketables(); + re = pcre_compile(..., tables); +.sp +When \fBpcre_maketables()\fP runs, the tables are built in memory that is +obtained via \fBpcre_malloc\fP. It is the caller's responsibility to ensure +that the memory containing the tables remains available for as long as it is +needed. +.P +The pointer that is passed to \fBpcre_compile()\fP is saved with the compiled +pattern, and the same tables are used via this pointer by \fBpcre_study()\fP +and normally also by \fBpcre_exec()\fP. Thus, by default, for any single +pattern, compilation, studying and matching all happen in the same locale, but +different patterns can be compiled in different locales. +.P +It is possible to pass a table pointer or NULL (indicating the use of the +internal tables) to \fBpcre_exec()\fP. Although not intended for this purpose, +this facility could be used to match a pattern in a different locale from the +one in which it was compiled. Passing table pointers at run time is discussed +below in the section on matching a pattern. +. +. +.SH "INFORMATION ABOUT A PATTERN" +.rs +.sp +.B int pcre_fullinfo(const pcre *\fIcode\fP, "const pcre_extra *\fIextra\fP," +.ti +5n +.B int \fIwhat\fP, void *\fIwhere\fP); +.PP +The \fBpcre_fullinfo()\fP function returns information about a compiled +pattern. It replaces the obsolete \fBpcre_info()\fP function, which is +nevertheless retained for backwards compability (and is documented below). +.P +The first argument for \fBpcre_fullinfo()\fP is a pointer to the compiled +pattern. The second argument is the result of \fBpcre_study()\fP, or NULL if +the pattern was not studied. The third argument specifies which piece of +information is required, and the fourth argument is a pointer to a variable +to receive the data. The yield of the function is zero for success, or one of +the following negative numbers: +.sp + PCRE_ERROR_NULL the argument \fIcode\fP was NULL + the argument \fIwhere\fP was NULL + PCRE_ERROR_BADMAGIC the "magic number" was not found + PCRE_ERROR_BADOPTION the value of \fIwhat\fP was invalid +.sp +The "magic number" is placed at the start of each compiled pattern as an simple +check against passing an arbitrary memory pointer. Here is a typical call of +\fBpcre_fullinfo()\fP, to obtain the length of the compiled pattern: +.sp + int rc; + unsigned long int length; + rc = pcre_fullinfo( + re, /* result of pcre_compile() */ + pe, /* result of pcre_study(), or NULL */ + PCRE_INFO_SIZE, /* what is required */ + &length); /* where to put the data */ +.sp +The possible values for the third argument are defined in \fBpcre.h\fP, and are +as follows: +.sp + PCRE_INFO_BACKREFMAX +.sp +Return the number of the highest back reference in the pattern. The fourth +argument should point to an \fBint\fP variable. Zero is returned if there are +no back references. +.sp + PCRE_INFO_CAPTURECOUNT +.sp +Return the number of capturing subpatterns in the pattern. The fourth argument +should point to an \fBint\fP variable. +.sp + PCRE_INFO_DEFAULT_TABLES +.sp +Return a pointer to the internal default character tables within PCRE. The +fourth argument should point to an \fBunsigned char *\fP variable. This +information call is provided for internal use by the \fBpcre_study()\fP +function. External callers can cause PCRE to use its internal tables by passing +a NULL table pointer. +.sp + PCRE_INFO_FIRSTBYTE +.sp +Return information about the first byte of any matched string, for a +non-anchored pattern. (This option used to be called PCRE_INFO_FIRSTCHAR; the +old name is still recognized for backwards compatibility.) +.P +If there is a fixed first byte, for example, from a pattern such as +(cat|cow|coyote), it is returned in the integer pointed to by \fIwhere\fP. +Otherwise, if either +.sp +(a) the pattern was compiled with the PCRE_MULTILINE option, and every branch +starts with "^", or +.sp +(b) every branch of the pattern starts with ".*" and PCRE_DOTALL is not set +(if it were set, the pattern would be anchored), +.sp +-1 is returned, indicating that the pattern matches only at the start of a +subject string or after any newline within the string. Otherwise -2 is +returned. For anchored patterns, -2 is returned. +.sp + PCRE_INFO_FIRSTTABLE +.sp +If the pattern was studied, and this resulted in the construction of a 256-bit +table indicating a fixed set of bytes for the first byte in any matching +string, a pointer to the table is returned. Otherwise NULL is returned. The +fourth argument should point to an \fBunsigned char *\fP variable. +.sp + PCRE_INFO_LASTLITERAL +.sp +Return the value of the rightmost literal byte that must exist in any matched +string, other than at its start, if such a byte has been recorded. The fourth +argument should point to an \fBint\fP variable. If there is no such byte, -1 is +returned. For anchored patterns, a last literal byte is recorded only if it +follows something of variable length. For example, for the pattern +/^a\ed+z\ed+/ the returned value is "z", but for /^a\edz\ed/ the returned value +is -1. +.sp + PCRE_INFO_NAMECOUNT + PCRE_INFO_NAMEENTRYSIZE + PCRE_INFO_NAMETABLE +.sp +PCRE supports the use of named as well as numbered capturing parentheses. The +names are just an additional way of identifying the parentheses, which still +acquire numbers. A convenience function called \fBpcre_get_named_substring()\fP +is provided for extracting an individual captured substring by name. It is also +possible to extract the data directly, by first converting the name to a number +in order to access the correct pointers in the output vector (described with +\fBpcre_exec()\fP below). To do the conversion, you need to use the +name-to-number map, which is described by these three values. +.P +The map consists of a number of fixed-size entries. PCRE_INFO_NAMECOUNT gives +the number of entries, and PCRE_INFO_NAMEENTRYSIZE gives the size of each +entry; both of these return an \fBint\fP value. The entry size depends on the +length of the longest name. PCRE_INFO_NAMETABLE returns a pointer to the first +entry of the table (a pointer to \fBchar\fP). The first two bytes of each entry +are the number of the capturing parenthesis, most significant byte first. The +rest of the entry is the corresponding name, zero terminated. The names are in +alphabetical order. For example, consider the following pattern (assume +PCRE_EXTENDED is set, so white space - including newlines - is ignored): +.sp +.\" JOIN + (?P (?P(\ed\ed)?\ed\ed) - + (?P\ed\ed) - (?P\ed\ed) ) +.sp +There are four named subpatterns, so the table has four entries, and each entry +in the table is eight bytes long. The table is as follows, with non-printing +bytes shows in hexadecimal, and undefined bytes shown as ??: +.sp + 00 01 d a t e 00 ?? + 00 05 d a y 00 ?? ?? + 00 04 m o n t h 00 + 00 02 y e a r 00 ?? +.sp +When writing code to extract data from named subpatterns using the +name-to-number map, remember that the length of each entry is likely to be +different for each compiled pattern. +.sp + PCRE_INFO_OPTIONS +.sp +Return a copy of the options with which the pattern was compiled. The fourth +argument should point to an \fBunsigned long int\fP variable. These option bits +are those specified in the call to \fBpcre_compile()\fP, modified by any +top-level option settings within the pattern itself. +.P +A pattern is automatically anchored by PCRE if all of its top-level +alternatives begin with one of the following: +.sp + ^ unless PCRE_MULTILINE is set + \eA always + \eG always +.\" JOIN + .* if PCRE_DOTALL is set and there are no back + references to the subpattern in which .* appears +.sp +For such patterns, the PCRE_ANCHORED bit is set in the options returned by +\fBpcre_fullinfo()\fP. +.sp + PCRE_INFO_SIZE +.sp +Return the size of the compiled pattern, that is, the value that was passed as +the argument to \fBpcre_malloc()\fP when PCRE was getting memory in which to +place the compiled data. The fourth argument should point to a \fBsize_t\fP +variable. +.sp + PCRE_INFO_STUDYSIZE +.sp +Return the size of the data block pointed to by the \fIstudy_data\fP field in +a \fBpcre_extra\fP block. That is, it is the value that was passed to +\fBpcre_malloc()\fP when PCRE was getting memory into which to place the data +created by \fBpcre_study()\fP. The fourth argument should point to a +\fBsize_t\fP variable. +. +. +.SH "OBSOLETE INFO FUNCTION" +.rs +.sp +.B int pcre_info(const pcre *\fIcode\fP, int *\fIoptptr\fP, int +.B *\fIfirstcharptr\fP); +.PP +The \fBpcre_info()\fP function is now obsolete because its interface is too +restrictive to return all the available data about a compiled pattern. New +programs should use \fBpcre_fullinfo()\fP instead. The yield of +\fBpcre_info()\fP is the number of capturing subpatterns, or one of the +following negative numbers: +.sp + PCRE_ERROR_NULL the argument \fIcode\fP was NULL + PCRE_ERROR_BADMAGIC the "magic number" was not found +.sp +If the \fIoptptr\fP argument is not NULL, a copy of the options with which the +pattern was compiled is placed in the integer it points to (see +PCRE_INFO_OPTIONS above). +.P +If the pattern is not anchored and the \fIfirstcharptr\fP argument is not NULL, +it is used to pass back information about the first character of any matched +string (see PCRE_INFO_FIRSTBYTE above). +. +. +.SH "REFERENCE COUNTS" +.rs +.sp +.B int pcre_refcount(pcre *\fIcode\fP, int \fIadjust\fP); +.PP +The \fBpcre_refcount()\fP function is used to maintain a reference count in the +data block that contains a compiled pattern. It is provided for the benefit of +applications that operate in an object-oriented manner, where different parts +of the application may be using the same compiled pattern, but you want to free +the block when they are all done. +.P +When a pattern is compiled, the reference count field is initialized to zero. +It is changed only by calling this function, whose action is to add the +\fIadjust\fP value (which may be positive or negative) to it. The yield of the +function is the new value. However, the value of the count is constrained to +lie between 0 and 65535, inclusive. If the new value is outside these limits, +it is forced to the appropriate limit value. +.P +Except when it is zero, the reference count is not correctly preserved if a +pattern is compiled on one host and then transferred to a host whose byte-order +is different. (This seems a highly unlikely scenario.) +. +. +.SH "MATCHING A PATTERN: THE TRADITIONAL FUNCTION" +.rs +.sp +.B int pcre_exec(const pcre *\fIcode\fP, "const pcre_extra *\fIextra\fP," +.ti +5n +.B "const char *\fIsubject\fP," int \fIlength\fP, int \fIstartoffset\fP, +.ti +5n +.B int \fIoptions\fP, int *\fIovector\fP, int \fIovecsize\fP); +.P +The function \fBpcre_exec()\fP is called to match a subject string against a +compiled pattern, which is passed in the \fIcode\fP argument. If the +pattern has been studied, the result of the study should be passed in the +\fIextra\fP argument. This function is the main matching facility of the +library, and it operates in a Perl-like manner. For specialist use there is +also an alternative matching function, which is described +.\" HTML +.\" +below +.\" +in the section about the \fBpcre_dfa_exec()\fP function. +.P +In most applications, the pattern will have been compiled (and optionally +studied) in the same process that calls \fBpcre_exec()\fP. However, it is +possible to save compiled patterns and study data, and then use them later +in different processes, possibly even on different hosts. For a discussion +about this, see the +.\" HREF +\fBpcreprecompile\fP +.\" +documentation. +.P +Here is an example of a simple call to \fBpcre_exec()\fP: +.sp + int rc; + int ovector[30]; + rc = pcre_exec( + re, /* result of pcre_compile() */ + NULL, /* we didn't study the pattern */ + "some string", /* the subject string */ + 11, /* the length of the subject string */ + 0, /* start at offset 0 in the subject */ + 0, /* default options */ + ovector, /* vector of integers for substring information */ + 30); /* number of elements (NOT size in bytes) */ +. +.\" HTML +.SS "Extra data for \fBpcre_exec()\fR" +.rs +.sp +If the \fIextra\fP argument is not NULL, it must point to a \fBpcre_extra\fP +data block. The \fBpcre_study()\fP function returns such a block (when it +doesn't return NULL), but you can also create one for yourself, and pass +additional information in it. The fields in a \fBpcre_extra\fP block are as +follows: +.sp + unsigned long int \fIflags\fP; + void *\fIstudy_data\fP; + unsigned long int \fImatch_limit\fP; + void *\fIcallout_data\fP; + const unsigned char *\fItables\fP; +.sp +The \fIflags\fP field is a bitmap that specifies which of the other fields +are set. The flag bits are: +.sp + PCRE_EXTRA_STUDY_DATA + PCRE_EXTRA_MATCH_LIMIT + PCRE_EXTRA_CALLOUT_DATA + PCRE_EXTRA_TABLES +.sp +Other flag bits should be set to zero. The \fIstudy_data\fP field is set in the +\fBpcre_extra\fP block that is returned by \fBpcre_study()\fP, together with +the appropriate flag bit. You should not set this yourself, but you may add to +the block by setting the other fields and their corresponding flag bits. +.P +The \fImatch_limit\fP field provides a means of preventing PCRE from using up a +vast amount of resources when running patterns that are not going to match, +but which have a very large number of possibilities in their search trees. The +classic example is the use of nested unlimited repeats. +.P +Internally, PCRE uses a function called \fBmatch()\fP which it calls repeatedly +(sometimes recursively). The limit is imposed on the number of times this +function is called during a match, which has the effect of limiting the amount +of recursion and backtracking that can take place. For patterns that are not +anchored, the count starts from zero for each position in the subject string. +.P +The default limit for the library can be set when PCRE is built; the default +default is 10 million, which handles all but the most extreme cases. You can +reduce the default by suppling \fBpcre_exec()\fP with a \fBpcre_extra\fP block +in which \fImatch_limit\fP is set to a smaller value, and +PCRE_EXTRA_MATCH_LIMIT is set in the \fIflags\fP field. If the limit is +exceeded, \fBpcre_exec()\fP returns PCRE_ERROR_MATCHLIMIT. +.P +The \fIpcre_callout\fP field is used in conjunction with the "callout" feature, +which is described in the +.\" HREF +\fBpcrecallout\fP +.\" +documentation. +.P +The \fItables\fP field is used to pass a character tables pointer to +\fBpcre_exec()\fP; this overrides the value that is stored with the compiled +pattern. A non-NULL value is stored with the compiled pattern only if custom +tables were supplied to \fBpcre_compile()\fP via its \fItableptr\fP argument. +If NULL is passed to \fBpcre_exec()\fP using this mechanism, it forces PCRE's +internal tables to be used. This facility is helpful when re-using patterns +that have been saved after compiling with an external set of tables, because +the external tables might be at a different address when \fBpcre_exec()\fP is +called. See the +.\" HREF +\fBpcreprecompile\fP +.\" +documentation for a discussion of saving compiled patterns for later use. +. +.SS "Option bits for \fBpcre_exec()\fP" +.rs +.sp +The unused bits of the \fIoptions\fP argument for \fBpcre_exec()\fP must be +zero. The only bits that may be set are PCRE_ANCHORED, PCRE_NOTBOL, +PCRE_NOTEOL, PCRE_NOTEMPTY, PCRE_NO_UTF8_CHECK and PCRE_PARTIAL. +.sp + PCRE_ANCHORED +.sp +The PCRE_ANCHORED option limits \fBpcre_exec()\fP to matching at the first +matching position. If a pattern was compiled with PCRE_ANCHORED, or turned out +to be anchored by virtue of its contents, it cannot be made unachored at +matching time. +.sp + PCRE_NOTBOL +.sp +This option specifies that first character of the subject string is not the +beginning of a line, so the circumflex metacharacter should not match before +it. Setting this without PCRE_MULTILINE (at compile time) causes circumflex +never to match. This option affects only the behaviour of the circumflex +metacharacter. It does not affect \eA. +.sp + PCRE_NOTEOL +.sp +This option specifies that the end of the subject string is not the end of a +line, so the dollar metacharacter should not match it nor (except in multiline +mode) a newline immediately before it. Setting this without PCRE_MULTILINE (at +compile time) causes dollar never to match. This option affects only the +behaviour of the dollar metacharacter. It does not affect \eZ or \ez. +.sp + PCRE_NOTEMPTY +.sp +An empty string is not considered to be a valid match if this option is set. If +there are alternatives in the pattern, they are tried. If all the alternatives +match the empty string, the entire match fails. For example, if the pattern +.sp + a?b? +.sp +is applied to a string not beginning with "a" or "b", it matches the empty +string at the start of the subject. With PCRE_NOTEMPTY set, this match is not +valid, so PCRE searches further into the string for occurrences of "a" or "b". +.P +Perl has no direct equivalent of PCRE_NOTEMPTY, but it does make a special case +of a pattern match of the empty string within its \fBsplit()\fP function, and +when using the /g modifier. It is possible to emulate Perl's behaviour after +matching a null string by first trying the match again at the same offset with +PCRE_NOTEMPTY and PCRE_ANCHORED, and then if that fails by advancing the +starting offset (see below) and trying an ordinary match again. There is some +code that demonstrates how to do this in the \fIpcredemo.c\fP sample program. +.sp + PCRE_NO_UTF8_CHECK +.sp +When PCRE_UTF8 is set at compile time, the validity of the subject as a UTF-8 +string is automatically checked when \fBpcre_exec()\fP is subsequently called. +The value of \fIstartoffset\fP is also checked to ensure that it points to the +start of a UTF-8 character. If an invalid UTF-8 sequence of bytes is found, +\fBpcre_exec()\fP returns the error PCRE_ERROR_BADUTF8. If \fIstartoffset\fP +contains an invalid value, PCRE_ERROR_BADUTF8_OFFSET is returned. +.P +If you already know that your subject is valid, and you want to skip these +checks for performance reasons, you can set the PCRE_NO_UTF8_CHECK option when +calling \fBpcre_exec()\fP. You might want to do this for the second and +subsequent calls to \fBpcre_exec()\fP if you are making repeated calls to find +all the matches in a single subject string. However, you should be sure that +the value of \fIstartoffset\fP points to the start of a UTF-8 character. When +PCRE_NO_UTF8_CHECK is set, the effect of passing an invalid UTF-8 string as a +subject, or a value of \fIstartoffset\fP that does not point to the start of a +UTF-8 character, is undefined. Your program may crash. +.sp + PCRE_PARTIAL +.sp +This option turns on the partial matching feature. If the subject string fails +to match the pattern, but at some point during the matching process the end of +the subject was reached (that is, the subject partially matches the pattern and +the failure to match occurred only because there were not enough subject +characters), \fBpcre_exec()\fP returns PCRE_ERROR_PARTIAL instead of +PCRE_ERROR_NOMATCH. When PCRE_PARTIAL is used, there are restrictions on what +may appear in the pattern. These are discussed in the +.\" HREF +\fBpcrepartial\fP +.\" +documentation. +. +.SS "The string to be matched by \fBpcre_exec()\fP" +.rs +.sp +The subject string is passed to \fBpcre_exec()\fP as a pointer in +\fIsubject\fP, a length in \fIlength\fP, and a starting byte offset in +\fIstartoffset\fP. In UTF-8 mode, the byte offset must point to the start of a +UTF-8 character. Unlike the pattern string, the subject may contain binary zero +bytes. When the starting offset is zero, the search for a match starts at the +beginning of the subject, and this is by far the most common case. +.P +A non-zero starting offset is useful when searching for another match in the +same subject by calling \fBpcre_exec()\fP again after a previous success. +Setting \fIstartoffset\fP differs from just passing over a shortened string and +setting PCRE_NOTBOL in the case of a pattern that begins with any kind of +lookbehind. For example, consider the pattern +.sp + \eBiss\eB +.sp +which finds occurrences of "iss" in the middle of words. (\eB matches only if +the current position in the subject is not a word boundary.) When applied to +the string "Mississipi" the first call to \fBpcre_exec()\fP finds the first +occurrence. If \fBpcre_exec()\fP is called again with just the remainder of the +subject, namely "issipi", it does not match, because \eB is always false at the +start of the subject, which is deemed to be a word boundary. However, if +\fBpcre_exec()\fP is passed the entire string again, but with \fIstartoffset\fP +set to 4, it finds the second occurrence of "iss" because it is able to look +behind the starting point to discover that it is preceded by a letter. +.P +If a non-zero starting offset is passed when the pattern is anchored, one +attempt to match at the given offset is made. This can only succeed if the +pattern does not require the match to be at the start of the subject. +. +.SS "How \fBpcre_exec()\fP returns captured substrings" +.rs +.sp +In general, a pattern matches a certain portion of the subject, and in +addition, further substrings from the subject may be picked out by parts of the +pattern. Following the usage in Jeffrey Friedl's book, this is called +"capturing" in what follows, and the phrase "capturing subpattern" is used for +a fragment of a pattern that picks out a substring. PCRE supports several other +kinds of parenthesized subpattern that do not cause substrings to be captured. +.P +Captured substrings are returned to the caller via a vector of integer offsets +whose address is passed in \fIovector\fP. The number of elements in the vector +is passed in \fIovecsize\fP, which must be a non-negative number. \fBNote\fP: +this argument is NOT the size of \fIovector\fP in bytes. +.P +The first two-thirds of the vector is used to pass back captured substrings, +each substring using a pair of integers. The remaining third of the vector is +used as workspace by \fBpcre_exec()\fP while matching capturing subpatterns, +and is not available for passing back information. The length passed in +\fIovecsize\fP should always be a multiple of three. If it is not, it is +rounded down. +.P +When a match is successful, information about captured substrings is returned +in pairs of integers, starting at the beginning of \fIovector\fP, and +continuing up to two-thirds of its length at the most. The first element of a +pair is set to the offset of the first character in a substring, and the second +is set to the offset of the first character after the end of a substring. The +first pair, \fIovector[0]\fP and \fIovector[1]\fP, identify the portion of the +subject string matched by the entire pattern. The next pair is used for the +first capturing subpattern, and so on. The value returned by \fBpcre_exec()\fP +is the number of pairs that have been set. If there are no capturing +subpatterns, the return value from a successful match is 1, indicating that +just the first pair of offsets has been set. +.P +Some convenience functions are provided for extracting the captured substrings +as separate strings. These are described in the following section. +.P +It is possible for an capturing subpattern number \fIn+1\fP to match some +part of the subject when subpattern \fIn\fP has not been used at all. For +example, if the string "abc" is matched against the pattern (a|(z))(bc) +subpatterns 1 and 3 are matched, but 2 is not. When this happens, both offset +values corresponding to the unused subpattern are set to -1. +.P +If a capturing subpattern is matched repeatedly, it is the last portion of the +string that it matched that is returned. +.P +If the vector is too small to hold all the captured substring offsets, it is +used as far as possible (up to two-thirds of its length), and the function +returns a value of zero. In particular, if the substring offsets are not of +interest, \fBpcre_exec()\fP may be called with \fIovector\fP passed as NULL and +\fIovecsize\fP as zero. However, if the pattern contains back references and +the \fIovector\fP is not big enough to remember the related substrings, PCRE +has to get additional memory for use during matching. Thus it is usually +advisable to supply an \fIovector\fP. +.P +Note that \fBpcre_info()\fP can be used to find out how many capturing +subpatterns there are in a compiled pattern. The smallest size for +\fIovector\fP that will allow for \fIn\fP captured substrings, in addition to +the offsets of the substring matched by the whole pattern, is (\fIn\fP+1)*3. +. +.\" HTML +.SS "Return values from \fBpcre_exec()\fP" +.rs +.sp +If \fBpcre_exec()\fP fails, it returns a negative number. The following are +defined in the header file: +.sp + PCRE_ERROR_NOMATCH (-1) +.sp +The subject string did not match the pattern. +.sp + PCRE_ERROR_NULL (-2) +.sp +Either \fIcode\fP or \fIsubject\fP was passed as NULL, or \fIovector\fP was +NULL and \fIovecsize\fP was not zero. +.sp + PCRE_ERROR_BADOPTION (-3) +.sp +An unrecognized bit was set in the \fIoptions\fP argument. +.sp + PCRE_ERROR_BADMAGIC (-4) +.sp +PCRE stores a 4-byte "magic number" at the start of the compiled code, to catch +the case when it is passed a junk pointer and to detect when a pattern that was +compiled in an environment of one endianness is run in an environment with the +other endianness. This is the error that PCRE gives when the magic number is +not present. +.sp + PCRE_ERROR_UNKNOWN_NODE (-5) +.sp +While running the pattern match, an unknown item was encountered in the +compiled pattern. This error could be caused by a bug in PCRE or by overwriting +of the compiled pattern. +.sp + PCRE_ERROR_NOMEMORY (-6) +.sp +If a pattern contains back references, but the \fIovector\fP that is passed to +\fBpcre_exec()\fP is not big enough to remember the referenced substrings, PCRE +gets a block of memory at the start of matching to use for this purpose. If the +call via \fBpcre_malloc()\fP fails, this error is given. The memory is +automatically freed at the end of matching. +.sp + PCRE_ERROR_NOSUBSTRING (-7) +.sp +This error is used by the \fBpcre_copy_substring()\fP, +\fBpcre_get_substring()\fP, and \fBpcre_get_substring_list()\fP functions (see +below). It is never returned by \fBpcre_exec()\fP. +.sp + PCRE_ERROR_MATCHLIMIT (-8) +.sp +The recursion and backtracking limit, as specified by the \fImatch_limit\fP +field in a \fBpcre_extra\fP structure (or defaulted) was reached. See the +description above. +.sp + PCRE_ERROR_CALLOUT (-9) +.sp +This error is never generated by \fBpcre_exec()\fP itself. It is provided for +use by callout functions that want to yield a distinctive error code. See the +.\" HREF +\fBpcrecallout\fP +.\" +documentation for details. +.sp + PCRE_ERROR_BADUTF8 (-10) +.sp +A string that contains an invalid UTF-8 byte sequence was passed as a subject. +.sp + PCRE_ERROR_BADUTF8_OFFSET (-11) +.sp +The UTF-8 byte sequence that was passed as a subject was valid, but the value +of \fIstartoffset\fP did not point to the beginning of a UTF-8 character. +.sp + PCRE_ERROR_PARTIAL (-12) +.sp +The subject string did not match, but it did match partially. See the +.\" HREF +\fBpcrepartial\fP +.\" +documentation for details of partial matching. +.sp + PCRE_ERROR_BADPARTIAL (-13) +.sp +The PCRE_PARTIAL option was used with a compiled pattern containing items that +are not supported for partial matching. See the +.\" HREF +\fBpcrepartial\fP +.\" +documentation for details of partial matching. +.sp + PCRE_ERROR_INTERNAL (-14) +.sp +An unexpected internal error has occurred. This error could be caused by a bug +in PCRE or by overwriting of the compiled pattern. +.sp + PCRE_ERROR_BADCOUNT (-15) +.sp +This error is given if the value of the \fIovecsize\fP argument is negative. +. +. +.SH "EXTRACTING CAPTURED SUBSTRINGS BY NUMBER" +.rs +.sp +.B int pcre_copy_substring(const char *\fIsubject\fP, int *\fIovector\fP, +.ti +5n +.B int \fIstringcount\fP, int \fIstringnumber\fP, char *\fIbuffer\fP, +.ti +5n +.B int \fIbuffersize\fP); +.PP +.br +.B int pcre_get_substring(const char *\fIsubject\fP, int *\fIovector\fP, +.ti +5n +.B int \fIstringcount\fP, int \fIstringnumber\fP, +.ti +5n +.B const char **\fIstringptr\fP); +.PP +.br +.B int pcre_get_substring_list(const char *\fIsubject\fP, +.ti +5n +.B int *\fIovector\fP, int \fIstringcount\fP, "const char ***\fIlistptr\fP);" +.PP +Captured substrings can be accessed directly by using the offsets returned by +\fBpcre_exec()\fP in \fIovector\fP. For convenience, the functions +\fBpcre_copy_substring()\fP, \fBpcre_get_substring()\fP, and +\fBpcre_get_substring_list()\fP are provided for extracting captured substrings +as new, separate, zero-terminated strings. These functions identify substrings +by number. The next section describes functions for extracting named +substrings. A substring that contains a binary zero is correctly extracted and +has a further zero added on the end, but the result is not, of course, +a C string. +.P +The first three arguments are the same for all three of these functions: +\fIsubject\fP is the subject string that has just been successfully matched, +\fIovector\fP is a pointer to the vector of integer offsets that was passed to +\fBpcre_exec()\fP, and \fIstringcount\fP is the number of substrings that were +captured by the match, including the substring that matched the entire regular +expression. This is the value returned by \fBpcre_exec()\fP if it is greater +than zero. If \fBpcre_exec()\fP returned zero, indicating that it ran out of +space in \fIovector\fP, the value passed as \fIstringcount\fP should be the +number of elements in the vector divided by three. +.P +The functions \fBpcre_copy_substring()\fP and \fBpcre_get_substring()\fP +extract a single substring, whose number is given as \fIstringnumber\fP. A +value of zero extracts the substring that matched the entire pattern, whereas +higher values extract the captured substrings. For \fBpcre_copy_substring()\fP, +the string is placed in \fIbuffer\fP, whose length is given by +\fIbuffersize\fP, while for \fBpcre_get_substring()\fP a new block of memory is +obtained via \fBpcre_malloc\fP, and its address is returned via +\fIstringptr\fP. The yield of the function is the length of the string, not +including the terminating zero, or one of +.sp + PCRE_ERROR_NOMEMORY (-6) +.sp +The buffer was too small for \fBpcre_copy_substring()\fP, or the attempt to get +memory failed for \fBpcre_get_substring()\fP. +.sp + PCRE_ERROR_NOSUBSTRING (-7) +.sp +There is no substring whose number is \fIstringnumber\fP. +.P +The \fBpcre_get_substring_list()\fP function extracts all available substrings +and builds a list of pointers to them. All this is done in a single block of +memory that is obtained via \fBpcre_malloc\fP. The address of the memory block +is returned via \fIlistptr\fP, which is also the start of the list of string +pointers. The end of the list is marked by a NULL pointer. The yield of the +function is zero if all went well, or +.sp + PCRE_ERROR_NOMEMORY (-6) +.sp +if the attempt to get the memory block failed. +.P +When any of these functions encounter a substring that is unset, which can +happen when capturing subpattern number \fIn+1\fP matches some part of the +subject, but subpattern \fIn\fP has not been used at all, they return an empty +string. This can be distinguished from a genuine zero-length substring by +inspecting the appropriate offset in \fIovector\fP, which is negative for unset +substrings. +.P +The two convenience functions \fBpcre_free_substring()\fP and +\fBpcre_free_substring_list()\fP can be used to free the memory returned by +a previous call of \fBpcre_get_substring()\fP or +\fBpcre_get_substring_list()\fP, respectively. They do nothing more than call +the function pointed to by \fBpcre_free\fP, which of course could be called +directly from a C program. However, PCRE is used in some situations where it is +linked via a special interface to another programming language which cannot use +\fBpcre_free\fP directly; it is for these cases that the functions are +provided. +. +. +.SH "EXTRACTING CAPTURED SUBSTRINGS BY NAME" +.rs +.sp +.B int pcre_get_stringnumber(const pcre *\fIcode\fP, +.ti +5n +.B const char *\fIname\fP); +.PP +.br +.B int pcre_copy_named_substring(const pcre *\fIcode\fP, +.ti +5n +.B const char *\fIsubject\fP, int *\fIovector\fP, +.ti +5n +.B int \fIstringcount\fP, const char *\fIstringname\fP, +.ti +5n +.B char *\fIbuffer\fP, int \fIbuffersize\fP); +.PP +.br +.B int pcre_get_named_substring(const pcre *\fIcode\fP, +.ti +5n +.B const char *\fIsubject\fP, int *\fIovector\fP, +.ti +5n +.B int \fIstringcount\fP, const char *\fIstringname\fP, +.ti +5n +.B const char **\fIstringptr\fP); +.PP +To extract a substring by name, you first have to find associated number. +For example, for this pattern +.sp + (a+)b(?P\ed+)... +.sp +the number of the subpattern called "xxx" is 2. You can find the number from +the name by calling \fBpcre_get_stringnumber()\fP. The first argument is the +compiled pattern, and the second is the name. The yield of the function is the +subpattern number, or PCRE_ERROR_NOSUBSTRING (-7) if there is no subpattern of +that name. +.P +Given the number, you can extract the substring directly, or use one of the +functions described in the previous section. For convenience, there are also +two functions that do the whole job. +.P +Most of the arguments of \fIpcre_copy_named_substring()\fP and +\fIpcre_get_named_substring()\fP are the same as those for the similarly named +functions that extract by number. As these are described in the previous +section, they are not re-described here. There are just two differences: +.P +First, instead of a substring number, a substring name is given. Second, there +is an extra argument, given at the start, which is a pointer to the compiled +pattern. This is needed in order to gain access to the name-to-number +translation table. +.P +These functions call \fBpcre_get_stringnumber()\fP, and if it succeeds, they +then call \fIpcre_copy_substring()\fP or \fIpcre_get_substring()\fP, as +appropriate. +. +. +.SH "FINDING ALL POSSIBLE MATCHES" +.rs +.sp +The traditional matching function uses a similar algorithm to Perl, which stops +when it finds the first match, starting at a given point in the subject. If you +want to find all possible matches, or the longest possible match, consider +using the alternative matching function (see below) instead. If you cannot use +the alternative function, but still need to find all possible matches, you +can kludge it up by making use of the callout facility, which is described in +the +.\" HREF +\fBpcrecallout\fP +.\" +documentation. +.P +What you have to do is to insert a callout right at the end of the pattern. +When your callout function is called, extract and save the current matched +substring. Then return 1, which forces \fBpcre_exec()\fP to backtrack and try +other alternatives. Ultimately, when it runs out of matches, \fBpcre_exec()\fP +will yield PCRE_ERROR_NOMATCH. +. +. +.\" HTML +.SH "MATCHING A PATTERN: THE ALTERNATIVE FUNCTION" +.rs +.sp +.B int pcre_dfa_exec(const pcre *\fIcode\fP, "const pcre_extra *\fIextra\fP," +.ti +5n +.B "const char *\fIsubject\fP," int \fIlength\fP, int \fIstartoffset\fP, +.ti +5n +.B int \fIoptions\fP, int *\fIovector\fP, int \fIovecsize\fP, +.ti +5n +.B int *\fIworkspace\fP, int \fIwscount\fP); +.P +The function \fBpcre_dfa_exec()\fP is called to match a subject string against +a compiled pattern, using a "DFA" matching algorithm. This has different +characteristics to the normal algorithm, and is not compatible with Perl. Some +of the features of PCRE patterns are not supported. Nevertheless, there are +times when this kind of matching can be useful. For a discussion of the two +matching algorithms, see the +.\" HREF +\fBpcrematching\fP +.\" +documentation. +.P +The arguments for the \fBpcre_dfa_exec()\fP function are the same as for +\fBpcre_exec()\fP, plus two extras. The \fIovector\fP argument is used in a +different way, and this is described below. The other common arguments are used +in the same way as for \fBpcre_exec()\fP, so their description is not repeated +here. +.P +The two additional arguments provide workspace for the function. The workspace +vector should contain at least 20 elements. It is used for keeping track of +multiple paths through the pattern tree. More workspace will be needed for +patterns and subjects where there are a lot of possible matches. +.P +Here is an example of a simple call to \fBpcre_exec()\fP: +.sp + int rc; + int ovector[10]; + int wspace[20]; + rc = pcre_exec( + re, /* result of pcre_compile() */ + NULL, /* we didn't study the pattern */ + "some string", /* the subject string */ + 11, /* the length of the subject string */ + 0, /* start at offset 0 in the subject */ + 0, /* default options */ + ovector, /* vector of integers for substring information */ + 10, /* number of elements (NOT size in bytes) */ + wspace, /* working space vector */ + 20); /* number of elements (NOT size in bytes) */ +. +.SS "Option bits for \fBpcre_dfa_exec()\fP" +.rs +.sp +The unused bits of the \fIoptions\fP argument for \fBpcre_dfa_exec()\fP must be +zero. The only bits that may be set are PCRE_ANCHORED, PCRE_NOTBOL, +PCRE_NOTEOL, PCRE_NOTEMPTY, PCRE_NO_UTF8_CHECK, PCRE_PARTIAL, +PCRE_DFA_SHORTEST, and PCRE_DFA_RESTART. All but the last three of these are +the same as for \fBpcre_exec()\fP, so their description is not repeated here. +.sp + PCRE_PARTIAL +.sp +This has the same general effect as it does for \fBpcre_exec()\fP, but the +details are slightly different. When PCRE_PARTIAL is set for +\fBpcre_dfa_exec()\fP, the return code PCRE_ERROR_NOMATCH is converted into +PCRE_ERROR_PARTIAL if the end of the subject is reached, there have been no +complete matches, but there is still at least one matching possibility. The +portion of the string that provided the partial match is set as the first +matching string. +.sp + PCRE_DFA_SHORTEST +.sp +Setting the PCRE_DFA_SHORTEST option causes the matching algorithm to stop as +soon as it has found one match. Because of the way the DFA algorithm works, +this is necessarily the shortest possible match at the first possible matching +point in the subject string. +.sp + PCRE_DFA_RESTART +.sp +When \fBpcre_dfa_exec()\fP is called with the PCRE_PARTIAL option, and returns +a partial match, it is possible to call it again, with additional subject +characters, and have it continue with the same match. The PCRE_DFA_RESTART +option requests this action; when it is set, the \fIworkspace\fP and +\fIwscount\fP options must reference the same vector as before because data +about the match so far is left in them after a partial match. There is more +discussion of this facility in the +.\" HREF +\fBpcrepartial\fP +.\" +documentation. +. +.SS "Successful returns from \fBpcre_dfa_exec()\fP" +.rs +.sp +When \fBpcre_dfa_exec()\fP succeeds, it may have matched more than one +substring in the subject. Note, however, that all the matches from one run of +the function start at the same point in the subject. The shorter matches are +all initial substrings of the longer matches. For example, if the pattern +.sp + <.*> +.sp +is matched against the string +.sp + This is no more +.sp +the three matched strings are +.sp + + + +.sp +On success, the yield of the function is a number greater than zero, which is +the number of matched substrings. The substrings themselves are returned in +\fIovector\fP. Each string uses two elements; the first is the offset to the +start, and the second is the offset to the end. All the strings have the same +start offset. (Space could have been saved by giving this only once, but it was +decided to retain some compatibility with the way \fBpcre_exec()\fP returns +data, even though the meaning of the strings is different.) +.P +The strings are returned in reverse order of length; that is, the longest +matching string is given first. If there were too many matches to fit into +\fIovector\fP, the yield of the function is zero, and the vector is filled with +the longest matches. +. +.SS "Error returns from \fBpcre_dfa_exec()\fP" +.rs +.sp +The \fBpcre_dfa_exec()\fP function returns a negative number when it fails. +Many of the errors are the same as for \fBpcre_exec()\fP, and these are +described +.\" HTML +.\" +above. +.\" +There are in addition the following errors that are specific to +\fBpcre_dfa_exec()\fP: +.sp + PCRE_ERROR_DFA_UITEM (-16) +.sp +This return is given if \fBpcre_dfa_exec()\fP encounters an item in the pattern +that it does not support, for instance, the use of \eC or a back reference. +.sp + PCRE_ERROR_DFA_UCOND (-17) +.sp +This return is given if \fBpcre_dfa_exec()\fP encounters a condition item in a +pattern that uses a back reference for the condition. This is not supported. +.sp + PCRE_ERROR_DFA_UMLIMIT (-18) +.sp +This return is given if \fBpcre_dfa_exec()\fP is called with an \fIextra\fP +block that contains a setting of the \fImatch_limit\fP field. This is not +supported (it is meaningless). +.sp + PCRE_ERROR_DFA_WSSIZE (-19) +.sp +This return is given if \fBpcre_dfa_exec()\fP runs out of space in the +\fIworkspace\fP vector. +.sp + PCRE_ERROR_DFA_RECURSE (-20) +.sp +When a recursive subpattern is processed, the matching function calls itself +recursively, using private vectors for \fIovector\fP and \fIworkspace\fP. This +error is given if the output vector is not large enough. This should be +extremely rare, as a vector of size 1000 is used. +.P +.in 0 +Last updated: 16 May 2005 +.br +Copyright (c) 1997-2005 University of Cambridge. diff --git a/mozilla/js/tamarin/pcre/doc/pcrebuild.3 b/mozilla/js/tamarin/pcre/doc/pcrebuild.3 new file mode 100644 index 00000000000..b6659af6106 --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/pcrebuild.3 @@ -0,0 +1,189 @@ +.TH PCREBUILD 3 +.SH NAME +PCRE - Perl-compatible regular expressions +.SH "PCRE BUILD-TIME OPTIONS" +.rs +.sp +This document describes the optional features of PCRE that can be selected when +the library is compiled. They are all selected, or deselected, by providing +options to the \fBconfigure\fP script that is run before the \fBmake\fP +command. The complete list of options for \fBconfigure\fP (which includes the +standard ones such as the selection of the installation directory) can be +obtained by running +.sp + ./configure --help +.sp +The following sections describe certain options whose names begin with --enable +or --disable. These settings specify changes to the defaults for the +\fBconfigure\fP command. Because of the way that \fBconfigure\fP works, +--enable and --disable always come in pairs, so the complementary option always +exists as well, but as it specifies the default, it is not described. +. +.SH "C++ SUPPORT" +.rs +.sp +By default, the \fBconfigure\fP script will search for a C++ compiler and C++ +header files. If it finds them, it automatically builds the C++ wrapper library +for PCRE. You can disable this by adding +.sp + --disable-cpp +.sp +to the \fBconfigure\fP command. +. +.SH "UTF-8 SUPPORT" +.rs +.sp +To build PCRE with support for UTF-8 character strings, add +.sp + --enable-utf8 +.sp +to the \fBconfigure\fP command. Of itself, this does not make PCRE treat +strings as UTF-8. As well as compiling PCRE with this option, you also have +have to set the PCRE_UTF8 option when you call the \fBpcre_compile()\fP +function. +. +.SH "UNICODE CHARACTER PROPERTY SUPPORT" +.rs +.sp +UTF-8 support allows PCRE to process character values greater than 255 in the +strings that it handles. On its own, however, it does not provide any +facilities for accessing the properties of such characters. If you want to be +able to use the pattern escapes \eP, \ep, and \eX, which refer to Unicode +character properties, you must add +.sp + --enable-unicode-properties +.sp +to the \fBconfigure\fP command. This implies UTF-8 support, even if you have +not explicitly requested it. +.P +Including Unicode property support adds around 90K of tables to the PCRE +library, approximately doubling its size. Only the general category properties +such as \fILu\fP and \fINd\fP are supported. Details are given in the +.\" HREF +\fBpcrepattern\fP +.\" +documentation. +. +.SH "CODE VALUE OF NEWLINE" +.rs +.sp +By default, PCRE treats character 10 (linefeed) as the newline character. This +is the normal newline character on Unix-like systems. You can compile PCRE to +use character 13 (carriage return) instead by adding +.sp + --enable-newline-is-cr +.sp +to the \fBconfigure\fP command. For completeness there is also a +--enable-newline-is-lf option, which explicitly specifies linefeed as the +newline character. +. +.SH "BUILDING SHARED AND STATIC LIBRARIES" +.rs +.sp +The PCRE building process uses \fBlibtool\fP to build both shared and static +Unix libraries by default. You can suppress one of these by adding one of +.sp + --disable-shared + --disable-static +.sp +to the \fBconfigure\fP command, as required. +. +.SH "POSIX MALLOC USAGE" +.rs +.sp +When PCRE is called through the POSIX interface (see the +.\" HREF +\fBpcreposix\fP +.\" +documentation), additional working storage is required for holding the pointers +to capturing substrings, because PCRE requires three integers per substring, +whereas the POSIX interface provides only two. If the number of expected +substrings is small, the wrapper function uses space on the stack, because this +is faster than using \fBmalloc()\fP for each call. The default threshold above +which the stack is no longer used is 10; it can be changed by adding a setting +such as +.sp + --with-posix-malloc-threshold=20 +.sp +to the \fBconfigure\fP command. +. +.SH "LIMITING PCRE RESOURCE USAGE" +.rs +.sp +Internally, PCRE has a function called \fBmatch()\fP, which it calls repeatedly +(possibly recursively) when matching a pattern with the \fBpcre_exec()\fP +function. By controlling the maximum number of times this function may be +called during a single matching operation, a limit can be placed on the +resources used by a single call to \fBpcre_exec()\fP. The limit can be changed +at run time, as described in the +.\" HREF +\fBpcreapi\fP +.\" +documentation. The default is 10 million, but this can be changed by adding a +setting such as +.sp + --with-match-limit=500000 +.sp +to the \fBconfigure\fP command. This setting has no effect on the +\fBpcre_dfa_exec()\fP matching function. +. +.SH "HANDLING VERY LARGE PATTERNS" +.rs +.sp +Within a compiled pattern, offset values are used to point from one part to +another (for example, from an opening parenthesis to an alternation +metacharacter). By default, two-byte values are used for these offsets, leading +to a maximum size for a compiled pattern of around 64K. This is sufficient to +handle all but the most gigantic patterns. Nevertheless, some people do want to +process enormous patterns, so it is possible to compile PCRE to use three-byte +or four-byte offsets by adding a setting such as +.sp + --with-link-size=3 +.sp +to the \fBconfigure\fP command. The value given must be 2, 3, or 4. Using +longer offsets slows down the operation of PCRE because it has to load +additional bytes when handling them. +.P +If you build PCRE with an increased link size, test 2 (and test 5 if you are +using UTF-8) will fail. Part of the output of these tests is a representation +of the compiled pattern, and this changes with the link size. +. +.SH "AVOIDING EXCESSIVE STACK USAGE" +.rs +.sp +When matching with the \fBpcre_exec()\fP function, PCRE implements backtracking +by making recursive calls to an internal function called \fBmatch()\fP. In +environments where the size of the stack is limited, this can severely limit +PCRE's operation. (The Unix environment does not usually suffer from this +problem.) An alternative approach that uses memory from the heap to remember +data, instead of using recursive function calls, has been implemented to work +round this problem. If you want to build a version of PCRE that works this way, +add +.sp + --disable-stack-for-recursion +.sp +to the \fBconfigure\fP command. With this configuration, PCRE will use the +\fBpcre_stack_malloc\fP and \fBpcre_stack_free\fP variables to call memory +management functions. Separate functions are provided because the usage is very +predictable: the block sizes requested are always the same, and the blocks are +always freed in reverse order. A calling program might be able to implement +optimized functions that perform better than the standard \fBmalloc()\fP and +\fBfree()\fP functions. PCRE runs noticeably more slowly when built in this +way. This option affects only the \fBpcre_exec()\fP function; it is not +relevant for the the \fBpcre_dfa_exec()\fP function. +. +.SH "USING EBCDIC CODE" +.rs +.sp +PCRE assumes by default that it will run in an environment where the character +code is ASCII (or Unicode, which is a superset of ASCII). PCRE can, however, be +compiled to run in an EBCDIC environment by adding +.sp + --enable-ebcdic +.sp +to the \fBconfigure\fP command. +.P +.in 0 +Last updated: 15 August 2005 +.br +Copyright (c) 1997-2005 University of Cambridge. diff --git a/mozilla/js/tamarin/pcre/doc/pcrecallout.3 b/mozilla/js/tamarin/pcre/doc/pcrecallout.3 new file mode 100644 index 00000000000..e7fec005b53 --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/pcrecallout.3 @@ -0,0 +1,161 @@ +.TH PCRECALLOUT 3 +.SH NAME +PCRE - Perl-compatible regular expressions +.SH "PCRE CALLOUTS" +.rs +.sp +.B int (*pcre_callout)(pcre_callout_block *); +.PP +PCRE provides a feature called "callout", which is a means of temporarily +passing control to the caller of PCRE in the middle of pattern matching. The +caller of PCRE provides an external function by putting its entry point in the +global variable \fIpcre_callout\fP. By default, this variable contains NULL, +which disables all calling out. +.P +Within a regular expression, (?C) indicates the points at which the external +function is to be called. Different callout points can be identified by putting +a number less than 256 after the letter C. The default value is zero. +For example, this pattern has two callout points: +.sp + (?C1)\deabc(?C2)def +.sp +If the PCRE_AUTO_CALLOUT option bit is set when \fBpcre_compile()\fP is called, +PCRE automatically inserts callouts, all with number 255, before each item in +the pattern. For example, if PCRE_AUTO_CALLOUT is used with the pattern +.sp + A(\ed{2}|--) +.sp +it is processed as if it were +.sp +(?C255)A(?C255)((?C255)\ed{2}(?C255)|(?C255)-(?C255)-(?C255))(?C255) +.sp +Notice that there is a callout before and after each parenthesis and +alternation bar. Automatic callouts can be used for tracking the progress of +pattern matching. The +.\" HREF +\fBpcretest\fP +.\" +command has an option that sets automatic callouts; when it is used, the output +indicates how the pattern is matched. This is useful information when you are +trying to optimize the performance of a particular pattern. +. +. +.SH "MISSING CALLOUTS" +.rs +.sp +You should be aware that, because of optimizations in the way PCRE matches +patterns, callouts sometimes do not happen. For example, if the pattern is +.sp + ab(?C4)cd +.sp +PCRE knows that any matching string must contain the letter "d". If the subject +string is "abyz", the lack of "d" means that matching doesn't ever start, and +the callout is never reached. However, with "abyd", though the result is still +no match, the callout is obeyed. +. +. +.SH "THE CALLOUT INTERFACE" +.rs +.sp +During matching, when PCRE reaches a callout point, the external function +defined by \fIpcre_callout\fP is called (if it is set). This applies to both +the \fBpcre_exec()\fP and the \fBpcre_dfa_exec()\fP matching functions. The +only argument to the callout function is a pointer to a \fBpcre_callout\fP +block. This structure contains the following fields: +.sp + int \fIversion\fP; + int \fIcallout_number\fP; + int *\fIoffset_vector\fP; + const char *\fIsubject\fP; + int \fIsubject_length\fP; + int \fIstart_match\fP; + int \fIcurrent_position\fP; + int \fIcapture_top\fP; + int \fIcapture_last\fP; + void *\fIcallout_data\fP; + int \fIpattern_position\fP; + int \fInext_item_length\fP; +.sp +The \fIversion\fP field is an integer containing the version number of the +block format. The initial version was 0; the current version is 1. The version +number will change again in future if additional fields are added, but the +intention is never to remove any of the existing fields. +.P +The \fIcallout_number\fP field contains the number of the callout, as compiled +into the pattern (that is, the number after ?C for manual callouts, and 255 for +automatically generated callouts). +.P +The \fIoffset_vector\fP field is a pointer to the vector of offsets that was +passed by the caller to \fBpcre_exec()\fP or \fBpcre_dfa_exec()\fP. When +\fBpcre_exec()\fP is used, the contents can be inspected in order to extract +substrings that have been matched so far, in the same way as for extracting +substrings after a match has completed. For \fBpcre_dfa_exec()\fP this field is +not useful. +.P +The \fIsubject\fP and \fIsubject_length\fP fields contain copies of the values +that were passed to \fBpcre_exec()\fP. +.P +The \fIstart_match\fP field contains the offset within the subject at which the +current match attempt started. If the pattern is not anchored, the callout +function may be called several times from the same point in the pattern for +different starting points in the subject. +.P +The \fIcurrent_position\fP field contains the offset within the subject of the +current match pointer. +.P +When the \fBpcre_exec()\fP function is used, the \fIcapture_top\fP field +contains one more than the number of the highest numbered captured substring so +far. If no substrings have been captured, the value of \fIcapture_top\fP is +one. This is always the case when \fBpcre_dfa_exec()\fP is used, because it +does not support captured substrings. +.P +The \fIcapture_last\fP field contains the number of the most recently captured +substring. If no substrings have been captured, its value is -1. This is always +the case when \fBpcre_dfa_exec()\fP is used. +.P +The \fIcallout_data\fP field contains a value that is passed to +\fBpcre_exec()\fP or \fBpcre_dfa_exec()\fP specifically so that it can be +passed back in callouts. It is passed in the \fIpcre_callout\fP field of the +\fBpcre_extra\fP data structure. If no such data was passed, the value of +\fIcallout_data\fP in a \fBpcre_callout\fP block is NULL. There is a +description of the \fBpcre_extra\fP structure in the +.\" HREF +\fBpcreapi\fP +.\" +documentation. +.P +The \fIpattern_position\fP field is present from version 1 of the +\fIpcre_callout\fP structure. It contains the offset to the next item to be +matched in the pattern string. +.P +The \fInext_item_length\fP field is present from version 1 of the +\fIpcre_callout\fP structure. It contains the length of the next item to be +matched in the pattern string. When the callout immediately precedes an +alternation bar, a closing parenthesis, or the end of the pattern, the length +is zero. When the callout precedes an opening parenthesis, the length is that +of the entire subpattern. +.P +The \fIpattern_position\fP and \fInext_item_length\fP fields are intended to +help in distinguishing between different automatic callouts, which all have the +same callout number. However, they are set for all callouts. +. +. +.SH "RETURN VALUES" +.rs +.sp +The external callout function returns an integer to PCRE. If the value is zero, +matching proceeds as normal. If the value is greater than zero, matching fails +at the current point, but the testing of other matching possibilities goes +ahead, just as if a lookahead assertion had failed. If the value is less than +zero, the match is abandoned, and \fBpcre_exec()\fP (or \fBpcre_dfa_exec()\fP) +returns the negative value. +.P +Negative values should normally be chosen from the set of PCRE_ERROR_xxx +values. In particular, PCRE_ERROR_NOMATCH forces a standard "no match" failure. +The error number PCRE_ERROR_CALLOUT is reserved for use by callout functions; +it will never be used by PCRE itself. +.P +.in 0 +Last updated: 28 February 2005 +.br +Copyright (c) 1997-2005 University of Cambridge. diff --git a/mozilla/js/tamarin/pcre/doc/pcrecompat.3 b/mozilla/js/tamarin/pcre/doc/pcrecompat.3 new file mode 100644 index 00000000000..9594fa9a290 --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/pcrecompat.3 @@ -0,0 +1,124 @@ +.TH PCRECOMPAT 3 +.SH NAME +PCRE - Perl-compatible regular expressions +.SH "DIFFERENCES BETWEEN PCRE AND PERL" +.rs +.sp +This document describes the differences in the ways that PCRE and Perl handle +regular expressions. The differences described here are with respect to Perl +5.8. +.P +1. PCRE does not have full UTF-8 support. Details of what it does have are +given in the +.\" HTML +.\" +section on UTF-8 support +.\" +in the main +.\" HREF +\fBpcre\fP +.\" +page. +.P +2. PCRE does not allow repeat quantifiers on lookahead assertions. Perl permits +them, but they do not mean what you might think. For example, (?!a){3} does +not assert that the next three characters are not "a". It just asserts that the +next character is not "a" three times. +.P +3. Capturing subpatterns that occur inside negative lookahead assertions are +counted, but their entries in the offsets vector are never set. Perl sets its +numerical variables from any such patterns that are matched before the +assertion fails to match something (thereby succeeding), but only if the +negative lookahead assertion contains just one branch. +.P +4. Though binary zero characters are supported in the subject string, they are +not allowed in a pattern string because it is passed as a normal C string, +terminated by zero. The escape sequence \e0 can be used in the pattern to +represent a binary zero. +.P +5. The following Perl escape sequences are not supported: \el, \eu, \eL, +\eU, and \eN. In fact these are implemented by Perl's general string-handling +and are not part of its pattern matching engine. If any of these are +encountered by PCRE, an error is generated. +.P +6. The Perl escape sequences \ep, \eP, and \eX are supported only if PCRE is +built with Unicode character property support. The properties that can be +tested with \ep and \eP are limited to the general category properties such as +Lu and Nd. +.P +7. PCRE does support the \eQ...\eE escape for quoting substrings. Characters in +between are treated as literals. This is slightly different from Perl in that $ +and @ are also handled as literals inside the quotes. In Perl, they cause +variable interpolation (but of course PCRE does not have variables). Note the +following examples: +.sp + Pattern PCRE matches Perl matches +.sp +.\" JOIN + \eQabc$xyz\eE abc$xyz abc followed by the + contents of $xyz + \eQabc\e$xyz\eE abc\e$xyz abc\e$xyz + \eQabc\eE\e$\eQxyz\eE abc$xyz abc$xyz +.sp +The \eQ...\eE sequence is recognized both inside and outside character classes. +.P +8. Fairly obviously, PCRE does not support the (?{code}) and (?p{code}) +constructions. However, there is support for recursive patterns using the +non-Perl items (?R), (?number), and (?P>name). Also, the PCRE "callout" feature +allows an external function to be called during pattern matching. See the +.\" HREF +\fBpcrecallout\fP +.\" +documentation for details. +.P +9. There are some differences that are concerned with the settings of captured +strings when part of a pattern is repeated. For example, matching "aba" against +the pattern /^(a(b)?)+$/ in Perl leaves $2 unset, but in PCRE it is set to "b". +.P +10. PCRE provides some extensions to the Perl regular expression facilities: +.sp +(a) Although lookbehind assertions must match fixed length strings, each +alternative branch of a lookbehind assertion can match a different length of +string. Perl requires them all to have the same length. +.sp +(b) If PCRE_DOLLAR_ENDONLY is set and PCRE_MULTILINE is not set, the $ +meta-character matches only at the very end of the string. +.sp +(c) If PCRE_EXTRA is set, a backslash followed by a letter with no special +meaning is faulted. +.sp +(d) If PCRE_UNGREEDY is set, the greediness of the repetition quantifiers is +inverted, that is, by default they are not greedy, but if followed by a +question mark they are. +.sp +(e) PCRE_ANCHORED can be used at matching time to force a pattern to be tried +only at the first matching position in the subject string. +.sp +(f) The PCRE_NOTBOL, PCRE_NOTEOL, PCRE_NOTEMPTY, and PCRE_NO_AUTO_CAPTURE +options for \fBpcre_exec()\fP have no Perl equivalents. +.sp +(g) The (?R), (?number), and (?P>name) constructs allows for recursive pattern +matching (Perl can do this using the (?p{code}) construct, which PCRE cannot +support.) +.sp +(h) PCRE supports named capturing substrings, using the Python syntax. +.sp +(i) PCRE supports the possessive quantifier "++" syntax, taken from Sun's Java +package. +.sp +(j) The (R) condition, for testing recursion, is a PCRE extension. +.sp +(k) The callout facility is PCRE-specific. +.sp +(l) The partial matching facility is PCRE-specific. +.sp +(m) Patterns compiled by PCRE can be saved and re-used at a later time, even on +different hosts that have the other endianness. +.sp +(n) The alternative matching function (\fBpcre_dfa_exec()\fP) matches in a +different way and is not Perl-compatible. +.P +.in 0 +Last updated: 28 February 2005 +.br +Copyright (c) 1997-2005 University of Cambridge. diff --git a/mozilla/js/tamarin/pcre/doc/pcrecpp.3 b/mozilla/js/tamarin/pcre/doc/pcrecpp.3 new file mode 100644 index 00000000000..78ac56402ac --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/pcrecpp.3 @@ -0,0 +1,308 @@ +.TH PCRECPP 3 +.SH NAME +PCRE - Perl-compatible regular expressions. +.SH "SYNOPSIS OF C++ WRAPPER" +.rs +.sp +.B #include +.PP +.SM +.br +.SH DESCRIPTION +.rs +.sp +The C++ wrapper for PCRE was provided by Google Inc. Some additional +functionality was added by Giuseppe Maxia. This brief man page was constructed +from the notes in the \fIpcrecpp.h\fP file, which should be consulted for +further details. +. +. +.SH "MATCHING INTERFACE" +.rs +.sp +The "FullMatch" operation checks that supplied text matches a supplied pattern +exactly. If pointer arguments are supplied, it copies matched sub-strings that +match sub-patterns into them. +.sp + Example: successful match + pcrecpp::RE re("h.*o"); + re.FullMatch("hello"); +.sp + Example: unsuccessful match (requires full match): + pcrecpp::RE re("e"); + !re.FullMatch("hello"); +.sp + Example: creating a temporary RE object: + pcrecpp::RE("h.*o").FullMatch("hello"); +.sp +You can pass in a "const char*" or a "string" for "text". The examples below +tend to use a const char*. You can, as in the different examples above, store +the RE object explicitly in a variable or use a temporary RE object. The +examples below use one mode or the other arbitrarily. Either could correctly be +used for any of these examples. +.P +You must supply extra pointer arguments to extract matched subpieces. +.sp + Example: extracts "ruby" into "s" and 1234 into "i" + int i; + string s; + pcrecpp::RE re("(\e\ew+):(\e\ed+)"); + re.FullMatch("ruby:1234", &s, &i); +.sp + Example: does not try to extract any extra sub-patterns + re.FullMatch("ruby:1234", &s); +.sp + Example: does not try to extract into NULL + re.FullMatch("ruby:1234", NULL, &i); +.sp + Example: integer overflow causes failure + !re.FullMatch("ruby:1234567891234", NULL, &i); +.sp + Example: fails because there aren't enough sub-patterns: + !pcrecpp::RE("\e\ew+:\e\ed+").FullMatch("ruby:1234", &s); +.sp + Example: fails because string cannot be stored in integer + !pcrecpp::RE("(.*)").FullMatch("ruby", &i); +.sp +The provided pointer arguments can be pointers to any scalar numeric +type, or one of: +.sp + string (matched piece is copied to string) + StringPiece (StringPiece is mutated to point to matched piece) + T (where "bool T::ParseFrom(const char*, int)" exists) + NULL (the corresponding matched sub-pattern is not copied) +.sp +The function returns true iff all of the following conditions are satisfied: +.sp + a. "text" matches "pattern" exactly; +.sp + b. The number of matched sub-patterns is >= number of supplied + pointers; +.sp + c. The "i"th argument has a suitable type for holding the + string captured as the "i"th sub-pattern. If you pass in + NULL for the "i"th argument, or pass fewer arguments than + number of sub-patterns, "i"th captured sub-pattern is + ignored. +.sp +The matching interface supports at most 16 arguments per call. +If you need more, consider using the more general interface +\fBpcrecpp::RE::DoMatch\fP. See \fBpcrecpp.h\fP for the signature for +\fBDoMatch\fP. +. +.SH "PARTIAL MATCHES" +.rs +.sp +You can use the "PartialMatch" operation when you want the pattern +to match any substring of the text. +.sp + Example: simple search for a string: + pcrecpp::RE("ell").PartialMatch("hello"); +.sp + Example: find first number in a string: + int number; + pcrecpp::RE re("(\e\ed+)"); + re.PartialMatch("x*100 + 20", &number); + assert(number == 100); +. +. +.SH "UTF-8 AND THE MATCHING INTERFACE" +.rs +.sp +By default, pattern and text are plain text, one byte per character. The UTF8 +flag, passed to the constructor, causes both pattern and string to be treated +as UTF-8 text, still a byte stream but potentially multiple bytes per +character. In practice, the text is likelier to be UTF-8 than the pattern, but +the match returned may depend on the UTF8 flag, so always use it when matching +UTF8 text. For example, "." will match one byte normally but with UTF8 set may +match up to three bytes of a multi-byte character. +.sp + Example: + pcrecpp::RE_Options options; + options.set_utf8(); + pcrecpp::RE re(utf8_pattern, options); + re.FullMatch(utf8_string); +.sp + Example: using the convenience function UTF8(): + pcrecpp::RE re(utf8_pattern, pcrecpp::UTF8()); + re.FullMatch(utf8_string); +.sp +NOTE: The UTF8 flag is ignored if pcre was not configured with the + --enable-utf8 flag. +. +. +.SH "PASSING MODIFIERS TO THE REGULAR EXPRESSION ENGINE" +.rs +.sp +PCRE defines some modifiers to change the behavior of the regular expression +engine. The C++ wrapper defines an auxiliary class, RE_Options, as a vehicle to +pass such modifiers to a RE class. Currently, the following modifiers are +supported: +.sp + modifier description Perl corresponding +.sp + PCRE_CASELESS case insensitive match /i + PCRE_MULTILINE multiple lines match /m + PCRE_DOTALL dot matches newlines /s + PCRE_DOLLAR_ENDONLY $ matches only at end N/A + PCRE_EXTRA strict escape parsing N/A + PCRE_EXTENDED ignore whitespaces /x + PCRE_UTF8 handles UTF8 chars built-in + PCRE_UNGREEDY reverses * and *? N/A + PCRE_NO_AUTO_CAPTURE disables capturing parens N/A (*) +.sp +(*) Both Perl and PCRE allow non capturing parentheses by means of the +"?:" modifier within the pattern itself. e.g. (?:ab|cd) does not +capture, while (ab|cd) does. +.P +For a full account on how each modifier works, please check the +PCRE API reference page. +.P +For each modifier, there are two member functions whose name is made +out of the modifier in lowercase, without the "PCRE_" prefix. For +instance, PCRE_CASELESS is handled by +.sp + bool caseless() +.sp +which returns true if the modifier is set, and +.sp + RE_Options & set_caseless(bool) +.sp +which sets or unsets the modifier. Moreover, PCRE_CONFIG_MATCH_LIMIT can be +accessed through the \fBset_match_limit()\fR and \fBmatch_limit()\fR member +functions. Setting \fImatch_limit\fR to a non-zero value will limit the +execution of pcre to keep it from doing bad things like blowing the stack or +taking an eternity to return a result. A value of 5000 is good enough to stop +stack blowup in a 2MB thread stack. Setting \fImatch_limit\fR to zero disables +match limiting. +.P +Normally, to pass one or more modifiers to a RE class, you declare +a \fIRE_Options\fR object, set the appropriate options, and pass this +object to a RE constructor. Example: +.sp + RE_options opt; + opt.set_caseless(true); + if (RE("HELLO", opt).PartialMatch("hello world")) ... +.sp +RE_options has two constructors. The default constructor takes no arguments and +creates a set of flags that are off by default. The optional parameter +\fIoption_flags\fR is to facilitate transfer of legacy code from C programs. +This lets you do +.sp + RE(pattern, + RE_Options(PCRE_CASELESS|PCRE_MULTILINE)).PartialMatch(str); +.sp +However, new code is better off doing +.sp + RE(pattern, + RE_Options().set_caseless(true).set_multiline(true)) + .PartialMatch(str); +.sp +If you are going to pass one of the most used modifiers, there are some +convenience functions that return a RE_Options class with the +appropriate modifier already set: \fBCASELESS()\fR, \fBUTF8()\fR, +\fBMULTILINE()\fR, \fBDOTALL\fR(), and \fBEXTENDED()\fR. +.P +If you need to set several options at once, and you don't want to go through +the pains of declaring a RE_Options object and setting several options, there +is a parallel method that give you such ability on the fly. You can concatenate +several \fBset_xxxxx()\fR member functions, since each of them returns a +reference to its class object. For example, to pass PCRE_CASELESS, +PCRE_EXTENDED, and PCRE_MULTILINE to a RE with one statement, you may write: +.sp + RE(" ^ xyz \e\es+ .* blah$", + RE_Options() + .set_caseless(true) + .set_extended(true) + .set_multiline(true)).PartialMatch(sometext); +.sp +. +. +.SH "SCANNING TEXT INCREMENTALLY" +.rs +.sp +The "Consume" operation may be useful if you want to repeatedly +match regular expressions at the front of a string and skip over +them as they match. This requires use of the "StringPiece" type, +which represents a sub-range of a real string. Like RE, StringPiece +is defined in the pcrecpp namespace. +.sp + Example: read lines of the form "var = value" from a string. + string contents = ...; // Fill string somehow + pcrecpp::StringPiece input(contents); // Wrap in a StringPiece + + string var; + int value; + pcrecpp::RE re("(\e\ew+) = (\e\ed+)\en"); + while (re.Consume(&input, &var, &value)) { + ...; + } +.sp +Each successful call to "Consume" will set "var/value", and also +advance "input" so it points past the matched text. +.P +The "FindAndConsume" operation is similar to "Consume" but does not +anchor your match at the beginning of the string. For example, you +could extract all words from a string by repeatedly calling +.sp + pcrecpp::RE("(\e\ew+)").FindAndConsume(&input, &word) +. +. +.SH "PARSING HEX/OCTAL/C-RADIX NUMBERS" +.rs +.sp +By default, if you pass a pointer to a numeric value, the +corresponding text is interpreted as a base-10 number. You can +instead wrap the pointer with a call to one of the operators Hex(), +Octal(), or CRadix() to interpret the text in another base. The +CRadix operator interprets C-style "0" (base-8) and "0x" (base-16) +prefixes, but defaults to base-10. +.sp + Example: + int a, b, c, d; + pcrecpp::RE re("(.*) (.*) (.*) (.*)"); + re.FullMatch("100 40 0100 0x40", + pcrecpp::Octal(&a), pcrecpp::Hex(&b), + pcrecpp::CRadix(&c), pcrecpp::CRadix(&d)); +.sp +will leave 64 in a, b, c, and d. +. +. +.SH "REPLACING PARTS OF STRINGS" +.rs +.sp +You can replace the first match of "pattern" in "str" with "rewrite". +Within "rewrite", backslash-escaped digits (\e1 to \e9) can be +used to insert text matching corresponding parenthesized group +from the pattern. \e0 in "rewrite" refers to the entire matching +text. For example: +.sp + string s = "yabba dabba doo"; + pcrecpp::RE("b+").Replace("d", &s); +.sp +will leave "s" containing "yada dabba doo". The result is true if the pattern +matches and a replacement occurs, false otherwise. +.P +\fBGlobalReplace\fP is like \fBReplace\fP except that it replaces all +occurrences of the pattern in the string with the rewrite. Replacements are +not subject to re-matching. For example: +.sp + string s = "yabba dabba doo"; + pcrecpp::RE("b+").GlobalReplace("d", &s); +.sp +will leave "s" containing "yada dada doo". It returns the number of +replacements made. +.P +\fBExtract\fP is like \fBReplace\fP, except that if the pattern matches, +"rewrite" is copied into "out" (an additional argument) with substitutions. +The non-matching portions of "text" are ignored. Returns true iff a match +occurred and the extraction happened successfully; if no match occurs, the +string is left unaffected. +. +. +.SH AUTHOR +.rs +.sp +The C++ wrapper was contributed by Google Inc. +.br +Copyright (c) 2005 Google Inc. diff --git a/mozilla/js/tamarin/pcre/doc/pcregrep.txt b/mozilla/js/tamarin/pcre/doc/pcregrep.txt new file mode 100644 index 00000000000..e8083a1eabb --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/pcregrep.txt @@ -0,0 +1,225 @@ +PCREGREP(1) PCREGREP(1) + + +NAME + pcregrep - a grep with Perl-compatible regular expressions. + + +SYNOPSIS + pcregrep [options] [long options] [pattern] [file1 file2 ...] + + +DESCRIPTION + + pcregrep searches files for character patterns, in the same way as + other grep commands do, but it uses the PCRE regular expression library + to support patterns that are compatible with the regular expressions of + Perl 5. See pcrepattern for a full description of syntax and semantics + of the regular expressions that PCRE supports. + + A pattern must be specified on the command line unless the -f option is + used (see below). + + If no files are specified, pcregrep reads the standard input. The stan- + dard input can also be referenced by a name consisting of a single + hyphen. For example: + + pcregrep some-pattern /file1 - /file3 + + By default, each line that matches the pattern is copied to the stan- + dard output, and if there is more than one file, the file name is + printed before each line of output. However, there are options that can + change how pcregrep behaves. In particular, the -M option makes it pos- + sible to search for patterns that span line boundaries. + + Patterns are limited to 8K or BUFSIZ characters, whichever is the + greater. BUFSIZ is defined in . + + +OPTIONS + + -- This terminate the list of options. It is useful if the next + item on the command line starts with a hyphen, but is not an + option. + + -A number Print number lines of context after each matching line. If + file names and/or line numbers are being printed, a hyphen + separator is used instead of a colon for the context lines. A + line containing "--" is printed between each group of lines, + unless they are in fact contiguous in the input file. The + value of number is expected to be relatively small. However, + pcregrep guarantees to have up to 8K of following text avail- + able for context printing. + + -B number Print number lines of context before each matching line. If + file names and/or line numbers are being printed, a hyphen + separator is used instead of a colon for the context lines. A + line containing "--" is printed between each group of lines, + unless they are in fact contiguous in the input file. The + value of number is expected to be relatively small. However, + pcregrep guarantees to have up to 8K of preceding text avail- + able for context printing. + + -C number Print number lines of context both before and after each + matching line. This is equivalent to setting both -A and -B + to the same value. + + -c Do not print individual lines; instead just print a count of + the number of lines that would otherwise have been printed. + If several files are given, a count is printed for each of + them. + + --exclude=pattern + When pcregrep is searching the files in a directory as a con- + sequence of the -r (recursive search) option, any files whose + names match the pattern are excluded. The pattern is a PCRE + regular expression. If a file name matches both --include and + --exclude, it is excluded. There is no short form for this + option. + + -ffilename + Read a number of patterns from the file, one per line, and + match all of them against each line of input. A line is out- + put if any of the patterns match it. When -f is used, no + pattern is taken from the command line; all arguments are + treated as file names. There is a maximum of 100 patterns. + Trailing white space is removed, and blank lines are ignored. + An empty file contains no patterns and therefore matches + nothing. + + -h Suppress printing of filenames when searching multiple files. + + -i Ignore upper/lower case distinctions during comparisons. + + --include=pattern + When pcregrep is searching the files in a directory as a con- + sequence of the -r (recursive search) option, only files + whose names match the pattern are included. The pattern is a + PCRE regular expression. If a file name matches both + --include and --exclude, it is excluded. There is no short + form for this option. + + -L Instead of printing lines from the files, just print the + names of the files that do not contain any lines that would + have been printed. Each file name is printed once, on a sepa- + rate line. + + -l Instead of printing lines from the files, just print the + names of the files containing lines that would have been + printed. Each file name is printed once, on a separate line. + + --label=name + This option supplies a name to be used for the standard input + when file names are being printed. If not supplied, "(stan- + dard input)" is used. There is no short form for this option. + + -M Allow patterns to match more than one line. When this option + is given, patterns may usefully contain literal newline char- + acters and internal occurrences of ^ and $ characters. The + output for any one match may consist of more than one line. + When this option is set, the PCRE library is called in "mul- + tiline" mode. There is a limit to the number of lines that + can be matched, imposed by the way that pcregrep buffers the + input file as it scans it. However, pcregrep ensures that at + least 8K characters or the rest of the document (whichever is + the shorter) are available for forward matching, and simi- + larly the previous 8K characters (or all the previous charac- + ters, if fewer than 8K) are guaranteed to be available for + lookbehind assertions. + + -n Precede each line by its line number in the file. + + -q Work quietly, that is, display nothing except error messages. + The exit status indicates whether or not any matches were + found. + + -r If any given path is a directory, recursively scan the files + it contains, taking note of any --include and --exclude set- + tings. Without -r a directory is scanned as a normal file. + + -s Suppress error messages about non-existent or unreadable + files. Such files are quietly skipped. However, the return + code is still 2, even if matches were found in other files. + + -u Operate in UTF-8 mode. This option is available only if PCRE + has been compiled with UTF-8 support. Both the pattern and + each subject line must be valid strings of UTF-8 characters. + + -V Write the version numbers of pcregrep and the PCRE library + that is being used to the standard error stream. + + -v Invert the sense of the match, so that lines which do not + match the pattern are the ones that are found. + + -w Force the pattern to match only whole words. This is equiva- + lent to having \b at the start and end of the pattern. + + -x Force the pattern to be anchored (it must start matching at + the beginning of the line) and in addition, require it to + match the entire line. This is equivalent to having ^ and $ + characters at the start and end of each alternative branch in + the regular expression. + + +LONG OPTIONS + + Long forms of all the options are available, as in GNU grep. They are + shown in the following table: + + -A --after-context + -B --before-context + -C --context + -c --count + --exclude (no short form) + -f --file + -h --no-filename + --help (no short form) + -i --ignore-case + --include (no short form) + -L --files-without-match + -l --files-with-matches + --label (no short form) + -n --line-number + -r --recursive + -q --quiet + -s --no-messages + -u --utf-8 + -V --version + -v --invert-match + -x --line-regex + -x --line-regexp + + +OPTIONS WITH DATA + + There are four different ways in which an option with data can be spec- + ified. If a short form option is used, the data may follow immedi- + ately, or in the next command line item. For example: + + -f/some/file + -f /some/file + + If a long form option is used, the data may appear in the same command + line item, separated by an = character, or it may appear in the next + command line item. For example: + + --file=/some/file + --file /some/file + + +DIAGNOSTICS + + Exit status is 0 if any matches were found, 1 if no matches were found, + and 2 for syntax errors and non-existent or inacessible files (even if + matches were found in other files). Using the -s option to suppress + error messages about inaccessble files does not affect the return code. + + +AUTHOR + + Philip Hazel + University Computing Service + Cambridge CB2 3QG, England. + +Last updated: 16 May 2005 +Copyright (c) 1997-2005 University of Cambridge. diff --git a/mozilla/js/tamarin/pcre/doc/pcrematching.3 b/mozilla/js/tamarin/pcre/doc/pcrematching.3 new file mode 100644 index 00000000000..931fdd685b5 --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/pcrematching.3 @@ -0,0 +1,157 @@ +.TH PCREMATCHING 3 +.SH NAME +PCRE - Perl-compatible regular expressions +.SH "PCRE MATCHING ALGORITHMS" +.rs +.sp +This document describes the two different algorithms that are available in PCRE +for matching a compiled regular expression against a given subject string. The +"standard" algorithm is the one provided by the \fBpcre_exec()\fP function. +This works in the same was as Perl's matching function, and provides a +Perl-compatible matching operation. +.P +An alternative algorithm is provided by the \fBpcre_dfa_exec()\fP function; +this operates in a different way, and is not Perl-compatible. It has advantages +and disadvantages compared with the standard algorithm, and these are described +below. +.P +When there is only one possible way in which a given subject string can match a +pattern, the two algorithms give the same answer. A difference arises, however, +when there are multiple possibilities. For example, if the pattern +.sp + ^<.*> +.sp +is matched against the string +.sp + +.sp +there are three possible answers. The standard algorithm finds only one of +them, whereas the DFA algorithm finds all three. +. +.SH "REGULAR EXPRESSIONS AS TREES" +.rs +.sp +The set of strings that are matched by a regular expression can be represented +as a tree structure. An unlimited repetition in the pattern makes the tree of +infinite size, but it is still a tree. Matching the pattern to a given subject +string (from a given starting point) can be thought of as a search of the tree. +There are two standard ways to search a tree: depth-first and breadth-first, +and these correspond to the two matching algorithms provided by PCRE. +. +.SH "THE STANDARD MATCHING ALGORITHM" +.rs +.sp +In the terminology of Jeffrey Friedl's book \fIMastering Regular +Expressions\fP, the standard algorithm is an "NFA algorithm". It conducts a +depth-first search of the pattern tree. That is, it proceeds along a single +path through the tree, checking that the subject matches what is required. When +there is a mismatch, the algorithm tries any alternatives at the current point, +and if they all fail, it backs up to the previous branch point in the tree, and +tries the next alternative branch at that level. This often involves backing up +(moving to the left) in the subject string as well. The order in which +repetition branches are tried is controlled by the greedy or ungreedy nature of +the quantifier. +.P +If a leaf node is reached, a matching string has been found, and at that point +the algorithm stops. Thus, if there is more than one possible match, this +algorithm returns the first one that it finds. Whether this is the shortest, +the longest, or some intermediate length depends on the way the greedy and +ungreedy repetition quantifiers are specified in the pattern. +.P +Because it ends up with a single path through the tree, it is relatively +straightforward for this algorithm to keep track of the substrings that are +matched by portions of the pattern in parentheses. This provides support for +capturing parentheses and back references. +. +.SH "THE DFA MATCHING ALGORITHM" +.rs +.sp +DFA stands for "deterministic finite automaton", but you do not need to +understand the origins of that name. This algorithm conducts a breadth-first +search of the tree. Starting from the first matching point in the subject, it +scans the subject string from left to right, once, character by character, and +as it does this, it remembers all the paths through the tree that represent +valid matches. +.P +The scan continues until either the end of the subject is reached, or there are +no more unterminated paths. At this point, terminated paths represent the +different matching possibilities (if there are none, the match has failed). +Thus, if there is more than one possible match, this algorithm finds all of +them, and in particular, it finds the longest. In PCRE, there is an option to +stop the algorithm after the first match (which is necessarily the shortest) +has been found. +.P +Note that all the matches that are found start at the same point in the +subject. If the pattern +.sp + cat(er(pillar)?) +.sp +is matched against the string "the caterpillar catchment", the result will be +the three strings "cat", "cater", and "caterpillar" that start at the fourth +character of the subject. The algorithm does not automatically move on to find +matches that start at later positions. +.P +There are a number of features of PCRE regular expressions that are not +supported by the DFA matching algorithm. They are as follows: +.P +1. Because the algorithm finds all possible matches, the greedy or ungreedy +nature of repetition quantifiers is not relevant. Greedy and ungreedy +quantifiers are treated in exactly the same way. +.P +2. When dealing with multiple paths through the tree simultaneously, it is not +straightforward to keep track of captured substrings for the different matching +possibilities, and PCRE's implementation of this algorithm does not attempt to +do this. This means that no captured substrings are available. +.P +3. Because no substrings are captured, back references within the pattern are +not supported, and cause errors if encountered. +.P +4. For the same reason, conditional expressions that use a backreference as the +condition are not supported. +.P +5. Callouts are supported, but the value of the \fIcapture_top\fP field is +always 1, and the value of the \fIcapture_last\fP field is always -1. +.P +6. +The \eC escape sequence, which (in the standard algorithm) matches a single +byte, even in UTF-8 mode, is not supported because the DFA algorithm moves +through the subject string one character at a time, for all active paths +through the tree. +. +.SH "ADVANTAGES OF THE DFA ALGORITHM" +.rs +.sp +Using the DFA matching algorithm provides the following advantages: +.P +1. All possible matches (at a single point in the subject) are automatically +found, and in particular, the longest match is found. To find more than one +match using the standard algorithm, you have to do kludgy things with +callouts. +.P +2. There is much better support for partial matching. The restrictions on the +content of the pattern that apply when using the standard algorithm for partial +matching do not apply to the DFA algorithm. For non-anchored patterns, the +starting position of a partial match is available. +.P +3. Because the DFA algorithm scans the subject string just once, and never +needs to backtrack, it is possible to pass very long subject strings to the +matching function in several pieces, checking for partial matching each time. +. +.SH "DISADVANTAGES OF THE DFA ALGORITHM" +.rs +.sp +The DFA algorithm suffers from a number of disadvantages: +.P +1. It is substantially slower than the standard algorithm. This is partly +because it has to search for all possible matches, but is also because it is +less susceptible to optimization. +.P +2. Capturing parentheses and back references are not supported. +.P +3. The "atomic group" feature of PCRE regular expressions is supported, but +does not provide the advantage that it does for the standard algorithm. +.P +.in 0 +Last updated: 28 February 2005 +.br +Copyright (c) 1997-2005 University of Cambridge. diff --git a/mozilla/js/tamarin/pcre/doc/pcrepartial.3 b/mozilla/js/tamarin/pcre/doc/pcrepartial.3 new file mode 100644 index 00000000000..66fd18d6290 --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/pcrepartial.3 @@ -0,0 +1,184 @@ +.TH PCREPARTIAL 3 +.SH NAME +PCRE - Perl-compatible regular expressions +.SH "PARTIAL MATCHING IN PCRE" +.rs +.sp +In normal use of PCRE, if the subject string that is passed to +\fBpcre_exec()\fP or \fBpcre_dfa_exec()\fP matches as far as it goes, but is +too short to match the entire pattern, PCRE_ERROR_NOMATCH is returned. There +are circumstances where it might be helpful to distinguish this case from other +cases in which there is no match. +.P +Consider, for example, an application where a human is required to type in data +for a field with specific formatting requirements. An example might be a date +in the form \fIddmmmyy\fP, defined by this pattern: +.sp + ^\ed?\ed(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\ed\ed$ +.sp +If the application sees the user's keystrokes one by one, and can check that +what has been typed so far is potentially valid, it is able to raise an error +as soon as a mistake is made, possibly beeping and not reflecting the +character that has been typed. This immediate feedback is likely to be a better +user interface than a check that is delayed until the entire string has been +entered. +.P +PCRE supports the concept of partial matching by means of the PCRE_PARTIAL +option, which can be set when calling \fBpcre_exec()\fP or +\fBpcre_dfa_exec()\fP. When this flag is set for \fBpcre_exec()\fP, the return +code PCRE_ERROR_NOMATCH is converted into PCRE_ERROR_PARTIAL if at any time +during the matching process the last part of the subject string matched part of +the pattern. Unfortunately, for non-anchored matching, it is not possible to +obtain the position of the start of the partial match. No captured data is set +when PCRE_ERROR_PARTIAL is returned. +.P +When PCRE_PARTIAL is set for \fBpcre_dfa_exec()\fP, the return code +PCRE_ERROR_NOMATCH is converted into PCRE_ERROR_PARTIAL if the end of the +subject is reached, there have been no complete matches, but there is still at +least one matching possibility. The portion of the string that provided the +partial match is set as the first matching string. +.P +Using PCRE_PARTIAL disables one of PCRE's optimizations. PCRE remembers the +last literal byte in a pattern, and abandons matching immediately if such a +byte is not present in the subject string. This optimization cannot be used +for a subject string that might match only partially. +. +. +.SH "RESTRICTED PATTERNS FOR PCRE_PARTIAL" +.rs +.sp +Because of the way certain internal optimizations are implemented in the +\fBpcre_exec()\fP function, the PCRE_PARTIAL option cannot be used with all +patterns. These restrictions do not apply when \fBpcre_dfa_exec()\fP is used. +For \fBpcre_exec()\fP, repeated single characters such as +.sp + a{2,4} +.sp +and repeated single metasequences such as +.sp + \ed+ +.sp +are not permitted if the maximum number of occurrences is greater than one. +Optional items such as \ed? (where the maximum is one) are permitted. +Quantifiers with any values are permitted after parentheses, so the invalid +examples above can be coded thus: +.sp + (a){2,4} + (\ed)+ +.sp +These constructions run more slowly, but for the kinds of application that are +envisaged for this facility, this is not felt to be a major restriction. +.P +If PCRE_PARTIAL is set for a pattern that does not conform to the restrictions, +\fBpcre_exec()\fP returns the error code PCRE_ERROR_BADPARTIAL (-13). +. +. +.SH "EXAMPLE OF PARTIAL MATCHING USING PCRETEST" +.rs +.sp +If the escape sequence \eP is present in a \fBpcretest\fP data line, the +PCRE_PARTIAL flag is used for the match. Here is a run of \fBpcretest\fP that +uses the date example quoted above: +.sp + re> /^\ed?\ed(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\ed\ed$/ + data> 25jun04\P + 0: 25jun04 + 1: jun + data> 25dec3\P + Partial match + data> 3ju\P + Partial match + data> 3juj\P + No match + data> j\P + No match +.sp +The first data string is matched completely, so \fBpcretest\fP shows the +matched substrings. The remaining four strings do not match the complete +pattern, but the first two are partial matches. The same test, using DFA +matching (by means of the \eD escape sequence), produces the following output: +.sp + re> /^\d?\d(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d\d$/ + data> 25jun04\eP\eD + 0: 25jun04 + data> 23dec3\eP\eD + Partial match: 23dec3 + data> 3ju\eP\eD + Partial match: 3ju + data> 3juj\eP\eD + No match + data> j\eP\eD + No match +.sp +Notice that in this case the portion of the string that was matched is made +available. +. +. +.SH "MULTI-SEGMENT MATCHING WITH pcre_dfa_exec()" +.rs +.sp +When a partial match has been found using \fBpcre_dfa_exec()\fP, it is possible +to continue the match by providing additional subject data and calling +\fBpcre_dfa_exec()\fP again with the PCRE_DFA_RESTART option and the same +working space (where details of the previous partial match are stored). Here is +an example using \fBpcretest\fP, where the \eR escape sequence sets the +PCRE_DFA_RESTART option and the \eD escape sequence requests the use of +\fBpcre_dfa_exec()\fP: +.sp + re> /^\d?\d(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d\d$/ + data> 23ja\eP\eD + Partial match: 23ja + data> n05\eR\eD + 0: n05 +.sp +The first call has "23ja" as the subject, and requests partial matching; the +second call has "n05" as the subject for the continued (restarted) match. +Notice that when the match is complete, only the last part is shown; PCRE does +not retain the previously partially-matched string. It is up to the calling +program to do that if it needs to. +.P +This facility can be used to pass very long subject strings to +\fBpcre_dfa_exec()\fP. However, some care is needed for certain types of +pattern. +.P +1. If the pattern contains tests for the beginning or end of a line, you need +to pass the PCRE_NOTBOL or PCRE_NOTEOL options, as appropriate, when the +subject string for any call does not contain the beginning or end of a line. +.P +2. If the pattern contains backward assertions (including \eb or \eB), you need +to arrange for some overlap in the subject strings to allow for this. For +example, you could pass the subject in chunks that were 500 bytes long, but in +a buffer of 700 bytes, with the starting offset set to 200 and the previous 200 +bytes at the start of the buffer. +.P +3. Matching a subject string that is split into multiple segments does not +always produce exactly the same result as matching over one single long string. +The difference arises when there are multiple matching possibilities, because a +partial match result is given only when there are no completed matches in a +call to fBpcre_dfa_exec()\fP. This means that as soon as the shortest match has +been found, continuation to a new subject segment is no longer possible. +Consider this \fBpcretest\fP example: +.sp + re> /dog(sbody)?/ + data> do\eP\eD + Partial match: do + data> gsb\eR\eP\eD + 0: g + data> dogsbody\eD + 0: dogsbody + 1: dog +.sp +The pattern matches the words "dog" or "dogsbody". When the subject is +presented in several parts ("do" and "gsb" being the first two) the match stops +when "dog" has been found, and it is not possible to continue. On the other +hand, if "dogsbody" is presented as a single string, both matches are found. +.P +Because of this phenomenon, it does not usually make sense to end a pattern +that is going to be matched in this way with a variable repeat. +. +. +.P +.in 0 +Last updated: 28 February 2005 +.br +Copyright (c) 1997-2005 University of Cambridge. diff --git a/mozilla/js/tamarin/pcre/doc/pcrepattern.3 b/mozilla/js/tamarin/pcre/doc/pcrepattern.3 new file mode 100644 index 00000000000..84c2ee5ca05 --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/pcrepattern.3 @@ -0,0 +1,1480 @@ +.TH PCREPATTERN 3 +.SH NAME +PCRE - Perl-compatible regular expressions +.SH "PCRE REGULAR EXPRESSION DETAILS" +.rs +.sp +The syntax and semantics of the regular expressions supported by PCRE are +described below. Regular expressions are also described in the Perl +documentation and in a number of books, some of which have copious examples. +Jeffrey Friedl's "Mastering Regular Expressions", published by O'Reilly, covers +regular expressions in great detail. This description of PCRE's regular +expressions is intended as reference material. +.P +The original operation of PCRE was on strings of one-byte characters. However, +there is now also support for UTF-8 character strings. To use this, you must +build PCRE to include UTF-8 support, and then call \fBpcre_compile()\fP with +the PCRE_UTF8 option. How this affects pattern matching is mentioned in several +places below. There is also a summary of UTF-8 features in the +.\" HTML +.\" +section on UTF-8 support +.\" +in the main +.\" HREF +\fBpcre\fP +.\" +page. +.P +The remainder of this document discusses the patterns that are supported by +PCRE when its main matching function, \fBpcre_exec()\fP, is used. +From release 6.0, PCRE offers a second matching function, +\fBpcre_dfa_exec()\fP, which matches using a different algorithm that is not +Perl-compatible. The advantages and disadvantages of the alternative function, +and how it differs from the normal function, are discussed in the +.\" HREF +\fBpcrematching\fP +.\" +page. +.P +A regular expression is a pattern that is matched against a subject string from +left to right. Most characters stand for themselves in a pattern, and match the +corresponding characters in the subject. As a trivial example, the pattern +.sp + The quick brown fox +.sp +matches a portion of a subject string that is identical to itself. When +caseless matching is specified (the PCRE_CASELESS option), letters are matched +independently of case. In UTF-8 mode, PCRE always understands the concept of +case for characters whose values are less than 128, so caseless matching is +always possible. For characters with higher values, the concept of case is +supported if PCRE is compiled with Unicode property support, but not otherwise. +If you want to use caseless matching for characters 128 and above, you must +ensure that PCRE is compiled with Unicode property support as well as with +UTF-8 support. +.P +The power of regular expressions comes from the ability to include alternatives +and repetitions in the pattern. These are encoded in the pattern by the use of +\fImetacharacters\fP, which do not stand for themselves but instead are +interpreted in some special way. +.P +There are two different sets of metacharacters: those that are recognized +anywhere in the pattern except within square brackets, and those that are +recognized in square brackets. Outside square brackets, the metacharacters are +as follows: +.sp + \e general escape character with several uses + ^ assert start of string (or line, in multiline mode) + $ assert end of string (or line, in multiline mode) + . match any character except newline (by default) + [ start character class definition + | start of alternative branch + ( start subpattern + ) end subpattern + ? extends the meaning of ( + also 0 or 1 quantifier + also quantifier minimizer + * 0 or more quantifier + + 1 or more quantifier + also "possessive quantifier" + { start min/max quantifier +.sp +Part of a pattern that is in square brackets is called a "character class". In +a character class the only metacharacters are: +.sp + \e general escape character + ^ negate the class, but only if the first character + - indicates character range +.\" JOIN + [ POSIX character class (only if followed by POSIX + syntax) + ] terminates the character class +.sp +The following sections describe the use of each of the metacharacters. +. +.SH BACKSLASH +.rs +.sp +The backslash character has several uses. Firstly, if it is followed by a +non-alphanumeric character, it takes away any special meaning that character may +have. This use of backslash as an escape character applies both inside and +outside character classes. +.P +For example, if you want to match a * character, you write \e* in the pattern. +This escaping action applies whether or not the following character would +otherwise be interpreted as a metacharacter, so it is always safe to precede a +non-alphanumeric with backslash to specify that it stands for itself. In +particular, if you want to match a backslash, you write \e\e. +.P +If a pattern is compiled with the PCRE_EXTENDED option, whitespace in the +pattern (other than in a character class) and characters between a # outside +a character class and the next newline character are ignored. An escaping +backslash can be used to include a whitespace or # character as part of the +pattern. +.P +If you want to remove the special meaning from a sequence of characters, you +can do so by putting them between \eQ and \eE. This is different from Perl in +that $ and @ are handled as literals in \eQ...\eE sequences in PCRE, whereas in +Perl, $ and @ cause variable interpolation. Note the following examples: +.sp + Pattern PCRE matches Perl matches +.sp +.\" JOIN + \eQabc$xyz\eE abc$xyz abc followed by the + contents of $xyz + \eQabc\e$xyz\eE abc\e$xyz abc\e$xyz + \eQabc\eE\e$\eQxyz\eE abc$xyz abc$xyz +.sp +The \eQ...\eE sequence is recognized both inside and outside character classes. +. +. +.\" HTML +.SS "Non-printing characters" +.rs +.sp +A second use of backslash provides a way of encoding non-printing characters +in patterns in a visible manner. There is no restriction on the appearance of +non-printing characters, apart from the binary zero that terminates a pattern, +but when a pattern is being prepared by text editing, it is usually easier to +use one of the following escape sequences than the binary character it +represents: +.sp + \ea alarm, that is, the BEL character (hex 07) + \ecx "control-x", where x is any character + \ee escape (hex 1B) + \ef formfeed (hex 0C) + \en newline (hex 0A) + \er carriage return (hex 0D) + \et tab (hex 09) + \eddd character with octal code ddd, or backreference + \exhh character with hex code hh + \ex{hhh..} character with hex code hhh... (UTF-8 mode only) +.sp +The precise effect of \ecx is as follows: if x is a lower case letter, it +is converted to upper case. Then bit 6 of the character (hex 40) is inverted. +Thus \ecz becomes hex 1A, but \ec{ becomes hex 3B, while \ec; becomes hex +7B. +.P +After \ex, from zero to two hexadecimal digits are read (letters can be in +upper or lower case). In UTF-8 mode, any number of hexadecimal digits may +appear between \ex{ and }, but the value of the character code must be less +than 2**31 (that is, the maximum hexadecimal value is 7FFFFFFF). If characters +other than hexadecimal digits appear between \ex{ and }, or if there is no +terminating }, this form of escape is not recognized. Instead, the initial +\ex will be interpreted as a basic hexadecimal escape, with no following +digits, giving a character whose value is zero. +.P +Characters whose value is less than 256 can be defined by either of the two +syntaxes for \ex when PCRE is in UTF-8 mode. There is no difference in the +way they are handled. For example, \exdc is exactly the same as \ex{dc}. +.P +After \e0 up to two further octal digits are read. In both cases, if there +are fewer than two digits, just those that are present are used. Thus the +sequence \e0\ex\e07 specifies two binary zeros followed by a BEL character +(code value 7). Make sure you supply two digits after the initial zero if the +pattern character that follows is itself an octal digit. +.P +The handling of a backslash followed by a digit other than 0 is complicated. +Outside a character class, PCRE reads it and any following digits as a decimal +number. If the number is less than 10, or if there have been at least that many +previous capturing left parentheses in the expression, the entire sequence is +taken as a \fIback reference\fP. A description of how this works is given +.\" HTML +.\" +later, +.\" +following the discussion of +.\" HTML +.\" +parenthesized subpatterns. +.\" +.P +Inside a character class, or if the decimal number is greater than 9 and there +have not been that many capturing subpatterns, PCRE re-reads up to three octal +digits following the backslash, and generates a single byte from the least +significant 8 bits of the value. Any subsequent digits stand for themselves. +For example: +.sp + \e040 is another way of writing a space +.\" JOIN + \e40 is the same, provided there are fewer than 40 + previous capturing subpatterns + \e7 is always a back reference +.\" JOIN + \e11 might be a back reference, or another way of + writing a tab + \e011 is always a tab + \e0113 is a tab followed by the character "3" +.\" JOIN + \e113 might be a back reference, otherwise the + character with octal code 113 +.\" JOIN + \e377 might be a back reference, otherwise + the byte consisting entirely of 1 bits +.\" JOIN + \e81 is either a back reference, or a binary zero + followed by the two characters "8" and "1" +.sp +Note that octal values of 100 or greater must not be introduced by a leading +zero, because no more than three octal digits are ever read. +.P +All the sequences that define a single byte value or a single UTF-8 character +(in UTF-8 mode) can be used both inside and outside character classes. In +addition, inside a character class, the sequence \eb is interpreted as the +backspace character (hex 08), and the sequence \eX is interpreted as the +character "X". Outside a character class, these sequences have different +meanings +.\" HTML +.\" +(see below). +.\" +. +. +.SS "Generic character types" +.rs +.sp +The third use of backslash is for specifying generic character types. The +following are always recognized: +.sp + \ed any decimal digit + \eD any character that is not a decimal digit + \es any whitespace character + \eS any character that is not a whitespace character + \ew any "word" character + \eW any "non-word" character +.sp +Each pair of escape sequences partitions the complete set of characters into +two disjoint sets. Any given character matches one, and only one, of each pair. +.P +These character type sequences can appear both inside and outside character +classes. They each match one character of the appropriate type. If the current +matching point is at the end of the subject string, all of them fail, since +there is no character to match. +.P +For compatibility with Perl, \es does not match the VT character (code 11). +This makes it different from the the POSIX "space" class. The \es characters +are HT (9), LF (10), FF (12), CR (13), and space (32). +.P +A "word" character is an underscore or any character less than 256 that is a +letter or digit. The definition of letters and digits is controlled by PCRE's +low-valued character tables, and may vary if locale-specific matching is taking +place (see +.\" HTML +.\" +"Locale support" +.\" +in the +.\" HREF +\fBpcreapi\fP +.\" +page). For example, in the "fr_FR" (French) locale, some character codes +greater than 128 are used for accented letters, and these are matched by \ew. +.P +In UTF-8 mode, characters with values greater than 128 never match \ed, \es, or +\ew, and always match \eD, \eS, and \eW. This is true even when Unicode +character property support is available. +. +. +.\" HTML +.SS Unicode character properties +.rs +.sp +When PCRE is built with Unicode character property support, three additional +escape sequences to match generic character types are available when UTF-8 mode +is selected. They are: +.sp + \ep{\fIxx\fP} a character with the \fIxx\fP property + \eP{\fIxx\fP} a character without the \fIxx\fP property + \eX an extended Unicode sequence +.sp +The property names represented by \fIxx\fP above are limited to the +Unicode general category properties. Each character has exactly one such +property, specified by a two-letter abbreviation. For compatibility with Perl, +negation can be specified by including a circumflex between the opening brace +and the property name. For example, \ep{^Lu} is the same as \eP{Lu}. +.P +If only one letter is specified with \ep or \eP, it includes all the properties +that start with that letter. In this case, in the absence of negation, the +curly brackets in the escape sequence are optional; these two examples have +the same effect: +.sp + \ep{L} + \epL +.sp +The following property codes are supported: +.sp + C Other + Cc Control + Cf Format + Cn Unassigned + Co Private use + Cs Surrogate +.sp + L Letter + Ll Lower case letter + Lm Modifier letter + Lo Other letter + Lt Title case letter + Lu Upper case letter +.sp + M Mark + Mc Spacing mark + Me Enclosing mark + Mn Non-spacing mark +.sp + N Number + Nd Decimal number + Nl Letter number + No Other number +.sp + P Punctuation + Pc Connector punctuation + Pd Dash punctuation + Pe Close punctuation + Pf Final punctuation + Pi Initial punctuation + Po Other punctuation + Ps Open punctuation +.sp + S Symbol + Sc Currency symbol + Sk Modifier symbol + Sm Mathematical symbol + So Other symbol +.sp + Z Separator + Zl Line separator + Zp Paragraph separator + Zs Space separator +.sp +Extended properties such as "Greek" or "InMusicalSymbols" are not supported by +PCRE. +.P +Specifying caseless matching does not affect these escape sequences. For +example, \ep{Lu} always matches only upper case letters. +.P +The \eX escape matches any number of Unicode characters that form an extended +Unicode sequence. \eX is equivalent to +.sp + (?>\ePM\epM*) +.sp +That is, it matches a character without the "mark" property, followed by zero +or more characters with the "mark" property, and treats the sequence as an +atomic group +.\" HTML +.\" +(see below). +.\" +Characters with the "mark" property are typically accents that affect the +preceding character. +.P +Matching characters by Unicode property is not fast, because PCRE has to search +a structure that contains data for over fifteen thousand characters. That is +why the traditional escape sequences such as \ed and \ew do not use Unicode +properties in PCRE. +. +. +.\" HTML +.SS "Simple assertions" +.rs +.sp +The fourth use of backslash is for certain simple assertions. An assertion +specifies a condition that has to be met at a particular point in a match, +without consuming any characters from the subject string. The use of +subpatterns for more complicated assertions is described +.\" HTML +.\" +below. +.\" +The backslashed +assertions are: +.sp + \eb matches at a word boundary + \eB matches when not at a word boundary + \eA matches at start of subject + \eZ matches at end of subject or before newline at end + \ez matches at end of subject + \eG matches at first matching position in subject +.sp +These assertions may not appear in character classes (but note that \eb has a +different meaning, namely the backspace character, inside a character class). +.P +A word boundary is a position in the subject string where the current character +and the previous character do not both match \ew or \eW (i.e. one matches +\ew and the other matches \eW), or the start or end of the string if the +first or last character matches \ew, respectively. +.P +The \eA, \eZ, and \ez assertions differ from the traditional circumflex and +dollar (described in the next section) in that they only ever match at the very +start and end of the subject string, whatever options are set. Thus, they are +independent of multiline mode. These three assertions are not affected by the +PCRE_NOTBOL or PCRE_NOTEOL options, which affect only the behaviour of the +circumflex and dollar metacharacters. However, if the \fIstartoffset\fP +argument of \fBpcre_exec()\fP is non-zero, indicating that matching is to start +at a point other than the beginning of the subject, \eA can never match. The +difference between \eZ and \ez is that \eZ matches before a newline that is the +last character of the string as well as at the end of the string, whereas \ez +matches only at the end. +.P +The \eG assertion is true only when the current matching position is at the +start point of the match, as specified by the \fIstartoffset\fP argument of +\fBpcre_exec()\fP. It differs from \eA when the value of \fIstartoffset\fP is +non-zero. By calling \fBpcre_exec()\fP multiple times with appropriate +arguments, you can mimic Perl's /g option, and it is in this kind of +implementation where \eG can be useful. +.P +Note, however, that PCRE's interpretation of \eG, as the start of the current +match, is subtly different from Perl's, which defines it as the end of the +previous match. In Perl, these can be different when the previously matched +string was empty. Because PCRE does just one match at a time, it cannot +reproduce this behaviour. +.P +If all the alternatives of a pattern begin with \eG, the expression is anchored +to the starting match position, and the "anchored" flag is set in the compiled +regular expression. +. +. +.SH "CIRCUMFLEX AND DOLLAR" +.rs +.sp +Outside a character class, in the default matching mode, the circumflex +character is an assertion that is true only if the current matching point is +at the start of the subject string. If the \fIstartoffset\fP argument of +\fBpcre_exec()\fP is non-zero, circumflex can never match if the PCRE_MULTILINE +option is unset. Inside a character class, circumflex has an entirely different +meaning +.\" HTML +.\" +(see below). +.\" +.P +Circumflex need not be the first character of the pattern if a number of +alternatives are involved, but it should be the first thing in each alternative +in which it appears if the pattern is ever to match that branch. If all +possible alternatives start with a circumflex, that is, if the pattern is +constrained to match only at the start of the subject, it is said to be an +"anchored" pattern. (There are also other constructs that can cause a pattern +to be anchored.) +.P +A dollar character is an assertion that is true only if the current matching +point is at the end of the subject string, or immediately before a newline +character that is the last character in the string (by default). Dollar need +not be the last character of the pattern if a number of alternatives are +involved, but it should be the last item in any branch in which it appears. +Dollar has no special meaning in a character class. +.P +The meaning of dollar can be changed so that it matches only at the very end of +the string, by setting the PCRE_DOLLAR_ENDONLY option at compile time. This +does not affect the \eZ assertion. +.P +The meanings of the circumflex and dollar characters are changed if the +PCRE_MULTILINE option is set. When this is the case, they match immediately +after and immediately before an internal newline character, respectively, in +addition to matching at the start and end of the subject string. For example, +the pattern /^abc$/ matches the subject string "def\enabc" (where \en +represents a newline character) in multiline mode, but not otherwise. +Consequently, patterns that are anchored in single line mode because all +branches start with ^ are not anchored in multiline mode, and a match for +circumflex is possible when the \fIstartoffset\fP argument of \fBpcre_exec()\fP +is non-zero. The PCRE_DOLLAR_ENDONLY option is ignored if PCRE_MULTILINE is +set. +.P +Note that the sequences \eA, \eZ, and \ez can be used to match the start and +end of the subject in both modes, and if all branches of a pattern start with +\eA it is always anchored, whether PCRE_MULTILINE is set or not. +. +. +.SH "FULL STOP (PERIOD, DOT)" +.rs +.sp +Outside a character class, a dot in the pattern matches any one character in +the subject, including a non-printing character, but not (by default) newline. +In UTF-8 mode, a dot matches any UTF-8 character, which might be more than one +byte long, except (by default) newline. If the PCRE_DOTALL option is set, +dots match newlines as well. The handling of dot is entirely independent of the +handling of circumflex and dollar, the only relationship being that they both +involve newline characters. Dot has no special meaning in a character class. +. +. +.SH "MATCHING A SINGLE BYTE" +.rs +.sp +Outside a character class, the escape sequence \eC matches any one byte, both +in and out of UTF-8 mode. Unlike a dot, it can match a newline. The feature is +provided in Perl in order to match individual bytes in UTF-8 mode. Because it +breaks up UTF-8 characters into individual bytes, what remains in the string +may be a malformed UTF-8 string. For this reason, the \eC escape sequence is +best avoided. +.P +PCRE does not allow \eC to appear in lookbehind assertions +.\" HTML +.\" +(described below), +.\" +because in UTF-8 mode this would make it impossible to calculate the length of +the lookbehind. +. +. +.\" HTML +.SH "SQUARE BRACKETS AND CHARACTER CLASSES" +.rs +.sp +An opening square bracket introduces a character class, terminated by a closing +square bracket. A closing square bracket on its own is not special. If a +closing square bracket is required as a member of the class, it should be the +first data character in the class (after an initial circumflex, if present) or +escaped with a backslash. +.P +A character class matches a single character in the subject. In UTF-8 mode, the +character may occupy more than one byte. A matched character must be in the set +of characters defined by the class, unless the first character in the class +definition is a circumflex, in which case the subject character must not be in +the set defined by the class. If a circumflex is actually required as a member +of the class, ensure it is not the first character, or escape it with a +backslash. +.P +For example, the character class [aeiou] matches any lower case vowel, while +[^aeiou] matches any character that is not a lower case vowel. Note that a +circumflex is just a convenient notation for specifying the characters that +are in the class by enumerating those that are not. A class that starts with a +circumflex is not an assertion: it still consumes a character from the subject +string, and therefore it fails if the current pointer is at the end of the +string. +.P +In UTF-8 mode, characters with values greater than 255 can be included in a +class as a literal string of bytes, or by using the \ex{ escaping mechanism. +.P +When caseless matching is set, any letters in a class represent both their +upper case and lower case versions, so for example, a caseless [aeiou] matches +"A" as well as "a", and a caseless [^aeiou] does not match "A", whereas a +caseful version would. In UTF-8 mode, PCRE always understands the concept of +case for characters whose values are less than 128, so caseless matching is +always possible. For characters with higher values, the concept of case is +supported if PCRE is compiled with Unicode property support, but not otherwise. +If you want to use caseless matching for characters 128 and above, you must +ensure that PCRE is compiled with Unicode property support as well as with +UTF-8 support. +.P +The newline character is never treated in any special way in character classes, +whatever the setting of the PCRE_DOTALL or PCRE_MULTILINE options is. A class +such as [^a] will always match a newline. +.P +The minus (hyphen) character can be used to specify a range of characters in a +character class. For example, [d-m] matches any letter between d and m, +inclusive. If a minus character is required in a class, it must be escaped with +a backslash or appear in a position where it cannot be interpreted as +indicating a range, typically as the first or last character in the class. +.P +It is not possible to have the literal character "]" as the end character of a +range. A pattern such as [W-]46] is interpreted as a class of two characters +("W" and "-") followed by a literal string "46]", so it would match "W46]" or +"-46]". However, if the "]" is escaped with a backslash it is interpreted as +the end of range, so [W-\e]46] is interpreted as a class containing a range +followed by two other characters. The octal or hexadecimal representation of +"]" can also be used to end a range. +.P +Ranges operate in the collating sequence of character values. They can also be +used for characters specified numerically, for example [\e000-\e037]. In UTF-8 +mode, ranges can include characters whose values are greater than 255, for +example [\ex{100}-\ex{2ff}]. +.P +If a range that includes letters is used when caseless matching is set, it +matches the letters in either case. For example, [W-c] is equivalent to +[][\e\e^_`wxyzabc], matched caselessly, and in non-UTF-8 mode, if character +tables for the "fr_FR" locale are in use, [\exc8-\excb] matches accented E +characters in both cases. In UTF-8 mode, PCRE supports the concept of case for +characters with values greater than 128 only when it is compiled with Unicode +property support. +.P +The character types \ed, \eD, \ep, \eP, \es, \eS, \ew, and \eW may also appear +in a character class, and add the characters that they match to the class. For +example, [\edABCDEF] matches any hexadecimal digit. A circumflex can +conveniently be used with the upper case character types to specify a more +restricted set of characters than the matching lower case type. For example, +the class [^\eW_] matches any letter or digit, but not underscore. +.P +The only metacharacters that are recognized in character classes are backslash, +hyphen (only where it can be interpreted as specifying a range), circumflex +(only at the start), opening square bracket (only when it can be interpreted as +introducing a POSIX class name - see the next section), and the terminating +closing square bracket. However, escaping other non-alphanumeric characters +does no harm. +. +. +.SH "POSIX CHARACTER CLASSES" +.rs +.sp +Perl supports the POSIX notation for character classes. This uses names +enclosed by [: and :] within the enclosing square brackets. PCRE also supports +this notation. For example, +.sp + [01[:alpha:]%] +.sp +matches "0", "1", any alphabetic character, or "%". The supported class names +are +.sp + alnum letters and digits + alpha letters + ascii character codes 0 - 127 + blank space or tab only + cntrl control characters + digit decimal digits (same as \ed) + graph printing characters, excluding space + lower lower case letters + print printing characters, including space + punct printing characters, excluding letters and digits + space white space (not quite the same as \es) + upper upper case letters + word "word" characters (same as \ew) + xdigit hexadecimal digits +.sp +The "space" characters are HT (9), LF (10), VT (11), FF (12), CR (13), and +space (32). Notice that this list includes the VT character (code 11). This +makes "space" different to \es, which does not include VT (for Perl +compatibility). +.P +The name "word" is a Perl extension, and "blank" is a GNU extension from Perl +5.8. Another Perl extension is negation, which is indicated by a ^ character +after the colon. For example, +.sp + [12[:^digit:]] +.sp +matches "1", "2", or any non-digit. PCRE (and Perl) also recognize the POSIX +syntax [.ch.] and [=ch=] where "ch" is a "collating element", but these are not +supported, and an error is given if they are encountered. +.P +In UTF-8 mode, characters with values greater than 128 do not match any of +the POSIX character classes. +. +. +.SH "VERTICAL BAR" +.rs +.sp +Vertical bar characters are used to separate alternative patterns. For example, +the pattern +.sp + gilbert|sullivan +.sp +matches either "gilbert" or "sullivan". Any number of alternatives may appear, +and an empty alternative is permitted (matching the empty string). +The matching process tries each alternative in turn, from left to right, +and the first one that succeeds is used. If the alternatives are within a +subpattern +.\" HTML +.\" +(defined below), +.\" +"succeeds" means matching the rest of the main pattern as well as the +alternative in the subpattern. +. +. +.SH "INTERNAL OPTION SETTING" +.rs +.sp +The settings of the PCRE_CASELESS, PCRE_MULTILINE, PCRE_DOTALL, and +PCRE_EXTENDED options can be changed from within the pattern by a sequence of +Perl option letters enclosed between "(?" and ")". The option letters are +.sp + i for PCRE_CASELESS + m for PCRE_MULTILINE + s for PCRE_DOTALL + x for PCRE_EXTENDED +.sp +For example, (?im) sets caseless, multiline matching. It is also possible to +unset these options by preceding the letter with a hyphen, and a combined +setting and unsetting such as (?im-sx), which sets PCRE_CASELESS and +PCRE_MULTILINE while unsetting PCRE_DOTALL and PCRE_EXTENDED, is also +permitted. If a letter appears both before and after the hyphen, the option is +unset. +.P +When an option change occurs at top level (that is, not inside subpattern +parentheses), the change applies to the remainder of the pattern that follows. +If the change is placed right at the start of a pattern, PCRE extracts it into +the global options (and it will therefore show up in data extracted by the +\fBpcre_fullinfo()\fP function). +.P +An option change within a subpattern affects only that part of the current +pattern that follows it, so +.sp + (a(?i)b)c +.sp +matches abc and aBc and no other strings (assuming PCRE_CASELESS is not used). +By this means, options can be made to have different settings in different +parts of the pattern. Any changes made in one alternative do carry on +into subsequent branches within the same subpattern. For example, +.sp + (a(?i)b|c) +.sp +matches "ab", "aB", "c", and "C", even though when matching "C" the first +branch is abandoned before the option setting. This is because the effects of +option settings happen at compile time. There would be some very weird +behaviour otherwise. +.P +The PCRE-specific options PCRE_UNGREEDY and PCRE_EXTRA can be changed in the +same way as the Perl-compatible options by using the characters U and X +respectively. The (?X) flag setting is special in that it must always occur +earlier in the pattern than any of the additional features it turns on, even +when it is at top level. It is best to put it at the start. +. +. +.\" HTML +.SH SUBPATTERNS +.rs +.sp +Subpatterns are delimited by parentheses (round brackets), which can be nested. +Turning part of a pattern into a subpattern does two things: +.sp +1. It localizes a set of alternatives. For example, the pattern +.sp + cat(aract|erpillar|) +.sp +matches one of the words "cat", "cataract", or "caterpillar". Without the +parentheses, it would match "cataract", "erpillar" or the empty string. +.sp +2. It sets up the subpattern as a capturing subpattern. This means that, when +the whole pattern matches, that portion of the subject string that matched the +subpattern is passed back to the caller via the \fIovector\fP argument of +\fBpcre_exec()\fP. Opening parentheses are counted from left to right (starting +from 1) to obtain numbers for the capturing subpatterns. +.P +For example, if the string "the red king" is matched against the pattern +.sp + the ((red|white) (king|queen)) +.sp +the captured substrings are "red king", "red", and "king", and are numbered 1, +2, and 3, respectively. +.P +The fact that plain parentheses fulfil two functions is not always helpful. +There are often times when a grouping subpattern is required without a +capturing requirement. If an opening parenthesis is followed by a question mark +and a colon, the subpattern does not do any capturing, and is not counted when +computing the number of any subsequent capturing subpatterns. For example, if +the string "the white queen" is matched against the pattern +.sp + the ((?:red|white) (king|queen)) +.sp +the captured substrings are "white queen" and "queen", and are numbered 1 and +2. The maximum number of capturing subpatterns is 65535, and the maximum depth +of nesting of all subpatterns, both capturing and non-capturing, is 200. +.P +As a convenient shorthand, if any option settings are required at the start of +a non-capturing subpattern, the option letters may appear between the "?" and +the ":". Thus the two patterns +.sp + (?i:saturday|sunday) + (?:(?i)saturday|sunday) +.sp +match exactly the same set of strings. Because alternative branches are tried +from left to right, and options are not reset until the end of the subpattern +is reached, an option setting in one branch does affect subsequent branches, so +the above patterns match "SUNDAY" as well as "Saturday". +. +. +.SH "NAMED SUBPATTERNS" +.rs +.sp +Identifying capturing parentheses by number is simple, but it can be very hard +to keep track of the numbers in complicated regular expressions. Furthermore, +if an expression is modified, the numbers may change. To help with this +difficulty, PCRE supports the naming of subpatterns, something that Perl does +not provide. The Python syntax (?P...) is used. Names consist of +alphanumeric characters and underscores, and must be unique within a pattern. +.P +Named capturing parentheses are still allocated numbers as well as names. The +PCRE API provides function calls for extracting the name-to-number translation +table from a compiled pattern. There is also a convenience function for +extracting a captured substring by name. For further details see the +.\" HREF +\fBpcreapi\fP +.\" +documentation. +. +. +.SH REPETITION +.rs +.sp +Repetition is specified by quantifiers, which can follow any of the following +items: +.sp + a literal data character + the . metacharacter + the \eC escape sequence + the \eX escape sequence (in UTF-8 mode with Unicode properties) + an escape such as \ed that matches a single character + a character class + a back reference (see next section) + a parenthesized subpattern (unless it is an assertion) +.sp +The general repetition quantifier specifies a minimum and maximum number of +permitted matches, by giving the two numbers in curly brackets (braces), +separated by a comma. The numbers must be less than 65536, and the first must +be less than or equal to the second. For example: +.sp + z{2,4} +.sp +matches "zz", "zzz", or "zzzz". A closing brace on its own is not a special +character. If the second number is omitted, but the comma is present, there is +no upper limit; if the second number and the comma are both omitted, the +quantifier specifies an exact number of required matches. Thus +.sp + [aeiou]{3,} +.sp +matches at least 3 successive vowels, but may match many more, while +.sp + \ed{8} +.sp +matches exactly 8 digits. An opening curly bracket that appears in a position +where a quantifier is not allowed, or one that does not match the syntax of a +quantifier, is taken as a literal character. For example, {,6} is not a +quantifier, but a literal string of four characters. +.P +In UTF-8 mode, quantifiers apply to UTF-8 characters rather than to individual +bytes. Thus, for example, \ex{100}{2} matches two UTF-8 characters, each of +which is represented by a two-byte sequence. Similarly, when Unicode property +support is available, \eX{3} matches three Unicode extended sequences, each of +which may be several bytes long (and they may be of different lengths). +.P +The quantifier {0} is permitted, causing the expression to behave as if the +previous item and the quantifier were not present. +.P +For convenience (and historical compatibility) the three most common +quantifiers have single-character abbreviations: +.sp + * is equivalent to {0,} + + is equivalent to {1,} + ? is equivalent to {0,1} +.sp +It is possible to construct infinite loops by following a subpattern that can +match no characters with a quantifier that has no upper limit, for example: +.sp + (a?)* +.sp +Earlier versions of Perl and PCRE used to give an error at compile time for +such patterns. However, because there are cases where this can be useful, such +patterns are now accepted, but if any repetition of the subpattern does in fact +match no characters, the loop is forcibly broken. +.P +By default, the quantifiers are "greedy", that is, they match as much as +possible (up to the maximum number of permitted times), without causing the +rest of the pattern to fail. The classic example of where this gives problems +is in trying to match comments in C programs. These appear between /* and */ +and within the comment, individual * and / characters may appear. An attempt to +match C comments by applying the pattern +.sp + /\e*.*\e*/ +.sp +to the string +.sp + /* first comment */ not comment /* second comment */ +.sp +fails, because it matches the entire string owing to the greediness of the .* +item. +.P +However, if a quantifier is followed by a question mark, it ceases to be +greedy, and instead matches the minimum number of times possible, so the +pattern +.sp + /\e*.*?\e*/ +.sp +does the right thing with the C comments. The meaning of the various +quantifiers is not otherwise changed, just the preferred number of matches. +Do not confuse this use of question mark with its use as a quantifier in its +own right. Because it has two uses, it can sometimes appear doubled, as in +.sp + \ed??\ed +.sp +which matches one digit by preference, but can match two if that is the only +way the rest of the pattern matches. +.P +If the PCRE_UNGREEDY option is set (an option which is not available in Perl), +the quantifiers are not greedy by default, but individual ones can be made +greedy by following them with a question mark. In other words, it inverts the +default behaviour. +.P +When a parenthesized subpattern is quantified with a minimum repeat count that +is greater than 1 or with a limited maximum, more memory is required for the +compiled pattern, in proportion to the size of the minimum or maximum. +.P +If a pattern starts with .* or .{0,} and the PCRE_DOTALL option (equivalent +to Perl's /s) is set, thus allowing the . to match newlines, the pattern is +implicitly anchored, because whatever follows will be tried against every +character position in the subject string, so there is no point in retrying the +overall match at any position after the first. PCRE normally treats such a +pattern as though it were preceded by \eA. +.P +In cases where it is known that the subject string contains no newlines, it is +worth setting PCRE_DOTALL in order to obtain this optimization, or +alternatively using ^ to indicate anchoring explicitly. +.P +However, there is one situation where the optimization cannot be used. When .* +is inside capturing parentheses that are the subject of a backreference +elsewhere in the pattern, a match at the start may fail, and a later one +succeed. Consider, for example: +.sp + (.*)abc\e1 +.sp +If the subject is "xyz123abc123" the match point is the fourth character. For +this reason, such a pattern is not implicitly anchored. +.P +When a capturing subpattern is repeated, the value captured is the substring +that matched the final iteration. For example, after +.sp + (tweedle[dume]{3}\es*)+ +.sp +has matched "tweedledum tweedledee" the value of the captured substring is +"tweedledee". However, if there are nested capturing subpatterns, the +corresponding captured values may have been set in previous iterations. For +example, after +.sp + /(a|(b))+/ +.sp +matches "aba" the value of the second captured substring is "b". +. +. +.\" HTML +.SH "ATOMIC GROUPING AND POSSESSIVE QUANTIFIERS" +.rs +.sp +With both maximizing and minimizing repetition, failure of what follows +normally causes the repeated item to be re-evaluated to see if a different +number of repeats allows the rest of the pattern to match. Sometimes it is +useful to prevent this, either to change the nature of the match, or to cause +it fail earlier than it otherwise might, when the author of the pattern knows +there is no point in carrying on. +.P +Consider, for example, the pattern \ed+foo when applied to the subject line +.sp + 123456bar +.sp +After matching all 6 digits and then failing to match "foo", the normal +action of the matcher is to try again with only 5 digits matching the \ed+ +item, and then with 4, and so on, before ultimately failing. "Atomic grouping" +(a term taken from Jeffrey Friedl's book) provides the means for specifying +that once a subpattern has matched, it is not to be re-evaluated in this way. +.P +If we use atomic grouping for the previous example, the matcher would give up +immediately on failing to match "foo" the first time. The notation is a kind of +special parenthesis, starting with (?> as in this example: +.sp + (?>\ed+)foo +.sp +This kind of parenthesis "locks up" the part of the pattern it contains once +it has matched, and a failure further into the pattern is prevented from +backtracking into it. Backtracking past it to previous items, however, works as +normal. +.P +An alternative description is that a subpattern of this type matches the string +of characters that an identical standalone pattern would match, if anchored at +the current point in the subject string. +.P +Atomic grouping subpatterns are not capturing subpatterns. Simple cases such as +the above example can be thought of as a maximizing repeat that must swallow +everything it can. So, while both \ed+ and \ed+? are prepared to adjust the +number of digits they match in order to make the rest of the pattern match, +(?>\ed+) can only match an entire sequence of digits. +.P +Atomic groups in general can of course contain arbitrarily complicated +subpatterns, and can be nested. However, when the subpattern for an atomic +group is just a single repeated item, as in the example above, a simpler +notation, called a "possessive quantifier" can be used. This consists of an +additional + character following a quantifier. Using this notation, the +previous example can be rewritten as +.sp + \ed++foo +.sp +Possessive quantifiers are always greedy; the setting of the PCRE_UNGREEDY +option is ignored. They are a convenient notation for the simpler forms of +atomic group. However, there is no difference in the meaning or processing of a +possessive quantifier and the equivalent atomic group. +.P +The possessive quantifier syntax is an extension to the Perl syntax. It +originates in Sun's Java package. +.P +When a pattern contains an unlimited repeat inside a subpattern that can itself +be repeated an unlimited number of times, the use of an atomic group is the +only way to avoid some failing matches taking a very long time indeed. The +pattern +.sp + (\eD+|<\ed+>)*[!?] +.sp +matches an unlimited number of substrings that either consist of non-digits, or +digits enclosed in <>, followed by either ! or ?. When it matches, it runs +quickly. However, if it is applied to +.sp + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +.sp +it takes a long time before reporting failure. This is because the string can +be divided between the internal \eD+ repeat and the external * repeat in a +large number of ways, and all have to be tried. (The example uses [!?] rather +than a single character at the end, because both PCRE and Perl have an +optimization that allows for fast failure when a single character is used. They +remember the last single character that is required for a match, and fail early +if it is not present in the string.) If the pattern is changed so that it uses +an atomic group, like this: +.sp + ((?>\eD+)|<\ed+>)*[!?] +.sp +sequences of non-digits cannot be broken, and failure happens quickly. +. +. +.\" HTML +.SH "BACK REFERENCES" +.rs +.sp +Outside a character class, a backslash followed by a digit greater than 0 (and +possibly further digits) is a back reference to a capturing subpattern earlier +(that is, to its left) in the pattern, provided there have been that many +previous capturing left parentheses. +.P +However, if the decimal number following the backslash is less than 10, it is +always taken as a back reference, and causes an error only if there are not +that many capturing left parentheses in the entire pattern. In other words, the +parentheses that are referenced need not be to the left of the reference for +numbers less than 10. See the subsection entitled "Non-printing characters" +.\" HTML +.\" +above +.\" +for further details of the handling of digits following a backslash. +.P +A back reference matches whatever actually matched the capturing subpattern in +the current subject string, rather than anything matching the subpattern +itself (see +.\" HTML +.\" +"Subpatterns as subroutines" +.\" +below for a way of doing that). So the pattern +.sp + (sens|respons)e and \e1ibility +.sp +matches "sense and sensibility" and "response and responsibility", but not +"sense and responsibility". If caseful matching is in force at the time of the +back reference, the case of letters is relevant. For example, +.sp + ((?i)rah)\es+\e1 +.sp +matches "rah rah" and "RAH RAH", but not "RAH rah", even though the original +capturing subpattern is matched caselessly. +.P +Back references to named subpatterns use the Python syntax (?P=name). We could +rewrite the above example as follows: +.sp + (?(?i)rah)\es+(?P=p1) +.sp +There may be more than one back reference to the same subpattern. If a +subpattern has not actually been used in a particular match, any back +references to it always fail. For example, the pattern +.sp + (a|(bc))\e2 +.sp +always fails if it starts to match "a" rather than "bc". Because there may be +many capturing parentheses in a pattern, all digits following the backslash are +taken as part of a potential back reference number. If the pattern continues +with a digit character, some delimiter must be used to terminate the back +reference. If the PCRE_EXTENDED option is set, this can be whitespace. +Otherwise an empty comment (see +.\" HTML +.\" +"Comments" +.\" +below) can be used. +.P +A back reference that occurs inside the parentheses to which it refers fails +when the subpattern is first used, so, for example, (a\e1) never matches. +However, such references can be useful inside repeated subpatterns. For +example, the pattern +.sp + (a|b\e1)+ +.sp +matches any number of "a"s and also "aba", "ababbaa" etc. At each iteration of +the subpattern, the back reference matches the character string corresponding +to the previous iteration. In order for this to work, the pattern must be such +that the first iteration does not need to match the back reference. This can be +done using alternation, as in the example above, or by a quantifier with a +minimum of zero. +. +. +.\" HTML +.SH ASSERTIONS +.rs +.sp +An assertion is a test on the characters following or preceding the current +matching point that does not actually consume any characters. The simple +assertions coded as \eb, \eB, \eA, \eG, \eZ, \ez, ^ and $ are described +.\" HTML +.\" +above. +.\" +.P +More complicated assertions are coded as subpatterns. There are two kinds: +those that look ahead of the current position in the subject string, and those +that look behind it. An assertion subpattern is matched in the normal way, +except that it does not cause the current matching position to be changed. +.P +Assertion subpatterns are not capturing subpatterns, and may not be repeated, +because it makes no sense to assert the same thing several times. If any kind +of assertion contains capturing subpatterns within it, these are counted for +the purposes of numbering the capturing subpatterns in the whole pattern. +However, substring capturing is carried out only for positive assertions, +because it does not make sense for negative assertions. +. +. +.SS "Lookahead assertions" +.rs +.sp +Lookahead assertions start +with (?= for positive assertions and (?! for negative assertions. For example, +.sp + \ew+(?=;) +.sp +matches a word followed by a semicolon, but does not include the semicolon in +the match, and +.sp + foo(?!bar) +.sp +matches any occurrence of "foo" that is not followed by "bar". Note that the +apparently similar pattern +.sp + (?!foo)bar +.sp +does not find an occurrence of "bar" that is preceded by something other than +"foo"; it finds any occurrence of "bar" whatsoever, because the assertion +(?!foo) is always true when the next three characters are "bar". A +lookbehind assertion is needed to achieve the other effect. +.P +If you want to force a matching failure at some point in a pattern, the most +convenient way to do it is with (?!) because an empty string always matches, so +an assertion that requires there not to be an empty string must always fail. +. +. +.\" HTML +.SS "Lookbehind assertions" +.rs +.sp +Lookbehind assertions start with (?<= for positive assertions and (?.*)(?<=abcd) +.sp +or, equivalently, using the possessive quantifier syntax, +.sp + ^.*+(?<=abcd) +.sp +there can be no backtracking for the .* item; it can match only the entire +string. The subsequent lookbehind assertion does a single test on the last four +characters. If it fails, the match fails immediately. For long strings, this +approach makes a significant difference to the processing time. +. +. +.SS "Using multiple assertions" +.rs +.sp +Several assertions (of any sort) may occur in succession. For example, +.sp + (?<=\ed{3})(? +.SH COMMENTS +.rs +.sp +The sequence (?# marks the start of a comment that continues up to the next +closing parenthesis. Nested parentheses are not permitted. The characters +that make up a comment play no part in the pattern matching at all. +.P +If the PCRE_EXTENDED option is set, an unescaped # character outside a +character class introduces a comment that continues up to the next newline +character in the pattern. +. +. +.SH "RECURSIVE PATTERNS" +.rs +.sp +Consider the problem of matching a string in parentheses, allowing for +unlimited nested parentheses. Without the use of recursion, the best that can +be done is to use a pattern that matches up to some fixed depth of nesting. It +is not possible to handle an arbitrary nesting depth. Perl provides a facility +that allows regular expressions to recurse (amongst other things). It does this +by interpolating Perl code in the expression at run time, and the code can +refer to the expression itself. A Perl pattern to solve the parentheses problem +can be created like this: +.sp + $re = qr{\e( (?: (?>[^()]+) | (?p{$re}) )* \e)}x; +.sp +The (?p{...}) item interpolates Perl code at run time, and in this case refers +recursively to the pattern in which it appears. Obviously, PCRE cannot support +the interpolation of Perl code. Instead, it supports some special syntax for +recursion of the entire pattern, and also for individual subpattern recursion. +.P +The special item that consists of (? followed by a number greater than zero and +a closing parenthesis is a recursive call of the subpattern of the given +number, provided that it occurs inside that subpattern. (If not, it is a +"subroutine" call, which is described in the next section.) The special item +(?R) is a recursive call of the entire regular expression. +.P +For example, this PCRE pattern solves the nested parentheses problem (assume +the PCRE_EXTENDED option is set so that white space is ignored): +.sp + \e( ( (?>[^()]+) | (?R) )* \e) +.sp +First it matches an opening parenthesis. Then it matches any number of +substrings which can either be a sequence of non-parentheses, or a recursive +match of the pattern itself (that is a correctly parenthesized substring). +Finally there is a closing parenthesis. +.P +If this were part of a larger pattern, you would not want to recurse the entire +pattern, so instead you could use this: +.sp + ( \e( ( (?>[^()]+) | (?1) )* \e) ) +.sp +We have put the pattern into parentheses, and caused the recursion to refer to +them instead of the whole pattern. In a larger pattern, keeping track of +parenthesis numbers can be tricky. It may be more convenient to use named +parentheses instead. For this, PCRE uses (?P>name), which is an extension to +the Python syntax that PCRE uses for named parentheses (Perl does not provide +named parentheses). We could rewrite the above example as follows: +.sp + (?P \e( ( (?>[^()]+) | (?P>pn) )* \e) ) +.sp +This particular example pattern contains nested unlimited repeats, and so the +use of atomic grouping for matching strings of non-parentheses is important +when applying the pattern to strings that do not match. For example, when this +pattern is applied to +.sp + (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa() +.sp +it yields "no match" quickly. However, if atomic grouping is not used, +the match runs for a very long time indeed because there are so many different +ways the + and * repeats can carve up the subject, and all have to be tested +before failure can be reported. +.P +At the end of a match, the values set for any capturing subpatterns are those +from the outermost level of the recursion at which the subpattern value is set. +If you want to obtain intermediate values, a callout function can be used (see +the next section and the +.\" HREF +\fBpcrecallout\fP +.\" +documentation). If the pattern above is matched against +.sp + (ab(cd)ef) +.sp +the value for the capturing parentheses is "ef", which is the last value taken +on at the top level. If additional parentheses are added, giving +.sp + \e( ( ( (?>[^()]+) | (?R) )* ) \e) + ^ ^ + ^ ^ +.sp +the string they capture is "ab(cd)ef", the contents of the top level +parentheses. If there are more than 15 capturing parentheses in a pattern, PCRE +has to obtain extra memory to store data during a recursion, which it does by +using \fBpcre_malloc\fP, freeing it via \fBpcre_free\fP afterwards. If no +memory can be obtained, the match fails with the PCRE_ERROR_NOMEMORY error. +.P +Do not confuse the (?R) item with the condition (R), which tests for recursion. +Consider this pattern, which matches text in angle brackets, allowing for +arbitrary nesting. Only digits are allowed in nested brackets (that is, when +recursing), whereas any characters are permitted at the outer level. +.sp + < (?: (?(R) \ed++ | [^<>]*+) | (?R)) * > +.sp +In this pattern, (?(R) is the start of a conditional subpattern, with two +different alternatives for the recursive and non-recursive cases. The (?R) item +is the actual recursive call. +. +. +.\" HTML +.SH "SUBPATTERNS AS SUBROUTINES" +.rs +.sp +If the syntax for a recursive subpattern reference (either by number or by +name) is used outside the parentheses to which it refers, it operates like a +subroutine in a programming language. An earlier example pointed out that the +pattern +.sp + (sens|respons)e and \e1ibility +.sp +matches "sense and sensibility" and "response and responsibility", but not +"sense and responsibility". If instead the pattern +.sp + (sens|respons)e and (?1)ibility +.sp +is used, it does match "sense and responsibility" as well as the other two +strings. Such references must, however, follow the subpattern to which they +refer. +. +. +.SH CALLOUTS +.rs +.sp +Perl has a feature whereby using the sequence (?{...}) causes arbitrary Perl +code to be obeyed in the middle of matching a regular expression. This makes it +possible, amongst other things, to extract different substrings that match the +same pair of parentheses when there is a repetition. +.P +PCRE provides a similar feature, but of course it cannot obey arbitrary Perl +code. The feature is called "callout". The caller of PCRE provides an external +function by putting its entry point in the global variable \fIpcre_callout\fP. +By default, this variable contains NULL, which disables all calling out. +.P +Within a regular expression, (?C) indicates the points at which the external +function is to be called. If you want to identify different callout points, you +can put a number less than 256 after the letter C. The default value is zero. +For example, this pattern has two callout points: +.sp + (?C1)\dabc(?C2)def +.sp +If the PCRE_AUTO_CALLOUT flag is passed to \fBpcre_compile()\fP, callouts are +automatically installed before each item in the pattern. They are all numbered +255. +.P +During matching, when PCRE reaches a callout point (and \fIpcre_callout\fP is +set), the external function is called. It is provided with the number of the +callout, the position in the pattern, and, optionally, one item of data +originally supplied by the caller of \fBpcre_exec()\fP. The callout function +may cause matching to proceed, to backtrack, or to fail altogether. A complete +description of the interface to the callout function is given in the +.\" HREF +\fBpcrecallout\fP +.\" +documentation. +.P +.in 0 +Last updated: 28 February 2005 +.br +Copyright (c) 1997-2005 University of Cambridge. diff --git a/mozilla/js/tamarin/pcre/doc/pcreperform.3 b/mozilla/js/tamarin/pcre/doc/pcreperform.3 new file mode 100644 index 00000000000..75e8a1661dc --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/pcreperform.3 @@ -0,0 +1,76 @@ +.TH PCREPERFORM 3 +.SH NAME +PCRE - Perl-compatible regular expressions +.SH "PCRE PERFORMANCE" +.rs +.sp +Certain items that may appear in regular expression patterns are more efficient +than others. It is more efficient to use a character class like [aeiou] than a +set of alternatives such as (a|e|i|o|u). In general, the simplest construction +that provides the required behaviour is usually the most efficient. Jeffrey +Friedl's book contains a lot of useful general discussion about optimizing +regular expressions for efficient performance. This document contains a few +observations about PCRE. +.P +Using Unicode character properties (the \ep, \eP, and \eX escapes) is slow, +because PCRE has to scan a structure that contains data for over fifteen +thousand characters whenever it needs a character's property. If you can find +an alternative pattern that does not use character properties, it will probably +be faster. +.P +When a pattern begins with .* not in parentheses, or in parentheses that are +not the subject of a backreference, and the PCRE_DOTALL option is set, the +pattern is implicitly anchored by PCRE, since it can match only at the start of +a subject string. However, if PCRE_DOTALL is not set, PCRE cannot make this +optimization, because the . metacharacter does not then match a newline, and if +the subject string contains newlines, the pattern may match from the character +immediately following one of them instead of from the very start. For example, +the pattern +.sp + .*second +.sp +matches the subject "first\enand second" (where \en stands for a newline +character), with the match starting at the seventh character. In order to do +this, PCRE has to retry the match starting after every newline in the subject. +.P +If you are using such a pattern with subject strings that do not contain +newlines, the best performance is obtained by setting PCRE_DOTALL, or starting +the pattern with ^.* or ^.*? to indicate explicit anchoring. That saves PCRE +from having to scan along the subject looking for a newline to restart at. +.P +Beware of patterns that contain nested indefinite repeats. These can take a +long time to run when applied to a string that does not match. Consider the +pattern fragment +.sp + (a+)* +.sp +This can match "aaaa" in 33 different ways, and this number increases very +rapidly as the string gets longer. (The * repeat can match 0, 1, 2, 3, or 4 +times, and for each of those cases other than 0, the + repeats can match +different numbers of times.) When the remainder of the pattern is such that the +entire match is going to fail, PCRE has in principle to try every possible +variation, and this can take an extremely long time. +.P +An optimization catches some of the more simple cases such as +.sp + (a+)*b +.sp +where a literal character follows. Before embarking on the standard matching +procedure, PCRE checks that there is a "b" later in the subject string, and if +there is not, it fails the match immediately. However, when there is no +following literal this optimization cannot be used. You can see the difference +by comparing the behaviour of +.sp + (a+)*\ed +.sp +with the pattern above. The former gives a failure almost instantly when +applied to a whole line of "a" characters, whereas the latter takes an +appreciable time with strings longer than about 20 characters. +.P +In many cases, the solution to this kind of performance issue is to use an +atomic group or a possessive quantifier. +.P +.in 0 +Last updated: 28 February 2005 +.br +Copyright (c) 1997-2005 University of Cambridge. diff --git a/mozilla/js/tamarin/pcre/doc/pcreposix.3 b/mozilla/js/tamarin/pcre/doc/pcreposix.3 new file mode 100644 index 00000000000..173ef03902d --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/pcreposix.3 @@ -0,0 +1,206 @@ +.TH PCREPOSIX 3 +.SH NAME +PCRE - Perl-compatible regular expressions. +.SH "SYNOPSIS OF POSIX API" +.rs +.sp +.B #include +.PP +.SM +.br +.B int regcomp(regex_t *\fIpreg\fP, const char *\fIpattern\fP, +.ti +5n +.B int \fIcflags\fP); +.PP +.br +.B int regexec(regex_t *\fIpreg\fP, const char *\fIstring\fP, +.ti +5n +.B size_t \fInmatch\fP, regmatch_t \fIpmatch\fP[], int \fIeflags\fP); +.PP +.br +.B size_t regerror(int \fIerrcode\fP, const regex_t *\fIpreg\fP, +.ti +5n +.B char *\fIerrbuf\fP, size_t \fIerrbuf_size\fP); +.PP +.br +.B void regfree(regex_t *\fIpreg\fP); +. +.SH DESCRIPTION +.rs +.sp +This set of functions provides a POSIX-style API to the PCRE regular expression +package. See the +.\" HREF +\fBpcreapi\fP +.\" +documentation for a description of PCRE's native API, which contains much +additional functionality. +.P +The functions described here are just wrapper functions that ultimately call +the PCRE native API. Their prototypes are defined in the \fBpcreposix.h\fP +header file, and on Unix systems the library itself is called +\fBpcreposix.a\fP, so can be accessed by adding \fB-lpcreposix\fP to the +command for linking an application that uses them. Because the POSIX functions +call the native ones, it is also necessary to add \fB-lpcre\fP. +.P +I have implemented only those option bits that can be reasonably mapped to PCRE +native options. In addition, the options REG_EXTENDED and REG_NOSUB are defined +with the value zero. They have no effect, but since programs that are written +to the POSIX interface often use them, this makes it easier to slot in PCRE as +a replacement library. Other POSIX options are not even defined. +.P +When PCRE is called via these functions, it is only the API that is POSIX-like +in style. The syntax and semantics of the regular expressions themselves are +still those of Perl, subject to the setting of various PCRE options, as +described below. "POSIX-like in style" means that the API approximates to the +POSIX definition; it is not fully POSIX-compatible, and in multi-byte encoding +domains it is probably even less compatible. +.P +The header for these functions is supplied as \fBpcreposix.h\fP to avoid any +potential clash with other POSIX libraries. It can, of course, be renamed or +aliased as \fBregex.h\fP, which is the "correct" name. It provides two +structure types, \fIregex_t\fP for compiled internal forms, and +\fIregmatch_t\fP for returning captured substrings. It also defines some +constants whose names start with "REG_"; these are used for setting options and +identifying error codes. +.P +.SH "COMPILING A PATTERN" +.rs +.sp +The function \fBregcomp()\fP is called to compile a pattern into an +internal form. The pattern is a C string terminated by a binary zero, and +is passed in the argument \fIpattern\fP. The \fIpreg\fP argument is a pointer +to a \fBregex_t\fP structure that is used as a base for storing information +about the compiled expression. +.P +The argument \fIcflags\fP is either zero, or contains one or more of the bits +defined by the following macros: +.sp + REG_DOTALL +.sp +The PCRE_DOTALL option is set when the expression is passed for compilation to +the native function. Note that REG_DOTALL is not part of the POSIX standard. +.sp + REG_ICASE +.sp +The PCRE_CASELESS option is set when the expression is passed for compilation +to the native function. +.sp + REG_NEWLINE +.sp +The PCRE_MULTILINE option is set when the expression is passed for compilation +to the native function. Note that this does \fInot\fP mimic the defined POSIX +behaviour for REG_NEWLINE (see the following section). +.P +In the absence of these flags, no options are passed to the native function. +This means the the regex is compiled with PCRE default semantics. In +particular, the way it handles newline characters in the subject string is the +Perl way, not the POSIX way. Note that setting PCRE_MULTILINE has only +\fIsome\fP of the effects specified for REG_NEWLINE. It does not affect the way +newlines are matched by . (they aren't) or by a negative class such as [^a] +(they are). +.P +The yield of \fBregcomp()\fP is zero on success, and non-zero otherwise. The +\fIpreg\fP structure is filled in on success, and one member of the structure +is public: \fIre_nsub\fP contains the number of capturing subpatterns in +the regular expression. Various error codes are defined in the header file. +. +. +.SH "MATCHING NEWLINE CHARACTERS" +.rs +.sp +This area is not simple, because POSIX and Perl take different views of things. +It is not possible to get PCRE to obey POSIX semantics, but then PCRE was never +intended to be a POSIX engine. The following table lists the different +possibilities for matching newline characters in PCRE: +.sp + Default Change with +.sp + . matches newline no PCRE_DOTALL + newline matches [^a] yes not changeable + $ matches \en at end yes PCRE_DOLLARENDONLY + $ matches \en in middle no PCRE_MULTILINE + ^ matches \en in middle no PCRE_MULTILINE +.sp +This is the equivalent table for POSIX: +.sp + Default Change with +.sp + . matches newline yes REG_NEWLINE + newline matches [^a] yes REG_NEWLINE + $ matches \en at end no REG_NEWLINE + $ matches \en in middle no REG_NEWLINE + ^ matches \en in middle no REG_NEWLINE +.sp +PCRE's behaviour is the same as Perl's, except that there is no equivalent for +PCRE_DOLLAR_ENDONLY in Perl. In both PCRE and Perl, there is no way to stop +newline from matching [^a]. +.P +The default POSIX newline handling can be obtained by setting PCRE_DOTALL and +PCRE_DOLLAR_ENDONLY, but there is no way to make PCRE behave exactly as for the +REG_NEWLINE action. +. +. +.SH "MATCHING A PATTERN" +.rs +.sp +The function \fBregexec()\fP is called to match a compiled pattern \fIpreg\fP +against a given \fIstring\fP, which is terminated by a zero byte, subject to +the options in \fIeflags\fP. These can be: +.sp + REG_NOTBOL +.sp +The PCRE_NOTBOL option is set when calling the underlying PCRE matching +function. +.sp + REG_NOTEOL +.sp +The PCRE_NOTEOL option is set when calling the underlying PCRE matching +function. +.P +The portion of the string that was matched, and also any captured substrings, +are returned via the \fIpmatch\fP argument, which points to an array of +\fInmatch\fP structures of type \fIregmatch_t\fP, containing the members +\fIrm_so\fP and \fIrm_eo\fP. These contain the offset to the first character of +each substring and the offset to the first character after the end of each +substring, respectively. The 0th element of the vector relates to the entire +portion of \fIstring\fP that was matched; subsequent elements relate to the +capturing subpatterns of the regular expression. Unused entries in the array +have both structure members set to -1. +.P +A successful match yields a zero return; various error codes are defined in the +header file, of which REG_NOMATCH is the "expected" failure code. +. +. +.SH "ERROR MESSAGES" +.rs +.sp +The \fBregerror()\fP function maps a non-zero errorcode from either +\fBregcomp()\fP or \fBregexec()\fP to a printable message. If \fIpreg\fP is not +NULL, the error should have arisen from the use of that structure. A message +terminated by a binary zero is placed in \fIerrbuf\fP. The length of the +message, including the zero, is limited to \fIerrbuf_size\fP. The yield of the +function is the size of buffer needed to hold the whole message. +. +. +.SH MEMORY USAGE +.rs +.sp +Compiling a regular expression causes memory to be allocated and associated +with the \fIpreg\fP structure. The function \fBregfree()\fP frees all such +memory, after which \fIpreg\fP may no longer be used as a compiled expression. +. +. +.SH AUTHOR +.rs +.sp +Philip Hazel +.br +University Computing Service, +.br +Cambridge CB2 3QG, England. +.P +.in 0 +Last updated: 28 February 2005 +.br +Copyright (c) 1997-2005 University of Cambridge. diff --git a/mozilla/js/tamarin/pcre/doc/pcreprecompile.3 b/mozilla/js/tamarin/pcre/doc/pcreprecompile.3 new file mode 100644 index 00000000000..7cf89de4a2b --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/pcreprecompile.3 @@ -0,0 +1,127 @@ +.TH PCREPRECOMPILE 3 +.SH NAME +PCRE - Perl-compatible regular expressions +.SH "SAVING AND RE-USING PRECOMPILED PCRE PATTERNS" +.rs +.sp +If you are running an application that uses a large number of regular +expression patterns, it may be useful to store them in a precompiled form +instead of having to compile them every time the application is run. +If you are not using any private character tables (see the +.\" HREF +\fBpcre_maketables()\fP +.\" +documentation), this is relatively straightforward. If you are using private +tables, it is a little bit more complicated. +.P +If you save compiled patterns to a file, you can copy them to a different host +and run them there. This works even if the new host has the opposite endianness +to the one on which the patterns were compiled. There may be a small +performance penalty, but it should be insignificant. +. +. +.SH "SAVING A COMPILED PATTERN" +.rs +.sh +The value returned by \fBpcre_compile()\fP points to a single block of memory +that holds the compiled pattern and associated data. You can find the length of +this block in bytes by calling \fBpcre_fullinfo()\fP with an argument of +PCRE_INFO_SIZE. You can then save the data in any appropriate manner. Here is +sample code that compiles a pattern and writes it to a file. It assumes that +the variable \fIfd\fP refers to a file that is open for output: +.sp + int erroroffset, rc, size; + char *error; + pcre *re; +.sp + re = pcre_compile("my pattern", 0, &error, &erroroffset, NULL); + if (re == NULL) { ... handle errors ... } + rc = pcre_fullinfo(re, NULL, PCRE_INFO_SIZE, &size); + if (rc < 0) { ... handle errors ... } + rc = fwrite(re, 1, size, fd); + if (rc != size) { ... handle errors ... } +.sp +In this example, the bytes that comprise the compiled pattern are copied +exactly. Note that this is binary data that may contain any of the 256 possible +byte values. On systems that make a distinction between binary and non-binary +data, be sure that the file is opened for binary output. +.P +If you want to write more than one pattern to a file, you will have to devise a +way of separating them. For binary data, preceding each pattern with its length +is probably the most straightforward approach. Another possibility is to write +out the data in hexadecimal instead of binary, one pattern to a line. +.P +Saving compiled patterns in a file is only one possible way of storing them for +later use. They could equally well be saved in a database, or in the memory of +some daemon process that passes them via sockets to the processes that want +them. +.P +If the pattern has been studied, it is also possible to save the study data in +a similar way to the compiled pattern itself. When studying generates +additional information, \fBpcre_study()\fP returns a pointer to a +\fBpcre_extra\fP data block. Its format is defined in the +.\" HTML +.\" +section on matching a pattern +.\" +in the +.\" HREF +\fBpcreapi\fP +.\" +documentation. The \fIstudy_data\fP field points to the binary study data, and +this is what you must save (not the \fBpcre_extra\fP block itself). The length +of the study data can be obtained by calling \fBpcre_fullinfo()\fP with an +argument of PCRE_INFO_STUDYSIZE. Remember to check that \fBpcre_study()\fP did +return a non-NULL value before trying to save the study data. +. +. +.SH "RE-USING A PRECOMPILED PATTERN" +.rs +.sp +Re-using a precompiled pattern is straightforward. Having reloaded it into main +memory, you pass its pointer to \fBpcre_exec()\fP or \fBpcre_dfa_exec()\fP in +the usual way. This should work even on another host, and even if that host has +the opposite endianness to the one where the pattern was compiled. +.P +However, if you passed a pointer to custom character tables when the pattern +was compiled (the \fItableptr\fP argument of \fBpcre_compile()\fP), you must +now pass a similar pointer to \fBpcre_exec()\fP or \fBpcre_dfa_exec()\fP, +because the value saved with the compiled pattern will obviously be nonsense. A +field in a \fBpcre_extra()\fP block is used to pass this data, as described in +the +.\" HTML +.\" +section on matching a pattern +.\" +in the +.\" HREF +\fBpcreapi\fP +.\" +documentation. +.P +If you did not provide custom character tables when the pattern was compiled, +the pointer in the compiled pattern is NULL, which causes \fBpcre_exec()\fP to +use PCRE's internal tables. Thus, you do not need to take any special action at +run time in this case. +.P +If you saved study data with the compiled pattern, you need to create your own +\fBpcre_extra\fP data block and set the \fIstudy_data\fP field to point to the +reloaded study data. You must also set the PCRE_EXTRA_STUDY_DATA bit in the +\fIflags\fP field to indicate that study data is present. Then pass the +\fBpcre_extra\fP block to \fBpcre_exec()\fP or \fBpcre_dfa_exec()\fP in the +usual way. +. +. +.SH "COMPATIBILITY WITH DIFFERENT PCRE RELEASES" +.rs +.sp +The layout of the control block that is at the start of the data that makes up +a compiled pattern was changed for release 5.0. If you have any saved patterns +that were compiled with previous releases (not a facility that was previously +advertised), you will have to recompile them for release 5.0. However, from now +on, it should be possible to make changes in a compatible manner. +.P +.in 0 +Last updated: 28 February 2005 +.br +Copyright (c) 1997-2005 University of Cambridge. diff --git a/mozilla/js/tamarin/pcre/doc/pcresample.3 b/mozilla/js/tamarin/pcre/doc/pcresample.3 new file mode 100644 index 00000000000..7f82979697e --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/pcresample.3 @@ -0,0 +1,66 @@ +.TH PCRESAMPLE 3 +.SH NAME +PCRE - Perl-compatible regular expressions +.SH "PCRE SAMPLE PROGRAM" +.rs +.sp +A simple, complete demonstration program, to get you started with using PCRE, +is supplied in the file \fIpcredemo.c\fP in the PCRE distribution. +.P +The program compiles the regular expression that is its first argument, and +matches it against the subject string in its second argument. No PCRE options +are set, and default character tables are used. If matching succeeds, the +program outputs the portion of the subject that matched, together with the +contents of any captured substrings. +.P +If the -g option is given on the command line, the program then goes on to +check for further matches of the same regular expression in the same subject +string. The logic is a little bit tricky because of the possibility of matching +an empty string. Comments in the code explain what is going on. +.P +If PCRE is installed in the standard include and library directories for your +system, you should be able to compile the demonstration program using this +command: +.sp + gcc -o pcredemo pcredemo.c -lpcre +.sp +If PCRE is installed elsewhere, you may need to add additional options to the +command line. For example, on a Unix-like system that has PCRE installed in +\fI/usr/local\fP, you can compile the demonstration program using a command +like this: +.sp +.\" JOINSH + gcc -o pcredemo -I/usr/local/include pcredemo.c \e + -L/usr/local/lib -lpcre +.sp +Once you have compiled the demonstration program, you can run simple tests like +this: +.sp + ./pcredemo 'cat|dog' 'the cat sat on the mat' + ./pcredemo -g 'cat|dog' 'the dog sat on the cat' +.sp +Note that there is a much more comprehensive test program, called +.\" HREF +\fBpcretest\fP, +.\" +which supports many more facilities for testing regular expressions and the +PCRE library. The \fBpcredemo\fP program is provided as a simple coding +example. +.P +On some operating systems (e.g. Solaris), when PCRE is not installed in the +standard library directory, you may get an error like this when you try to run +\fBpcredemo\fP: +.sp + ld.so.1: a.out: fatal: libpcre.so.0: open failed: No such file or directory +.sp +This is caused by the way shared library support works on those systems. You +need to add +.sp + -R/usr/local/lib +.sp +(for example) to the compile command to get round this problem. +.P +.in 0 +Last updated: 09 September 2004 +.br +Copyright (c) 1997-2004 University of Cambridge. diff --git a/mozilla/js/tamarin/pcre/doc/pcretest.txt b/mozilla/js/tamarin/pcre/doc/pcretest.txt new file mode 100644 index 00000000000..2af49e7f8c3 --- /dev/null +++ b/mozilla/js/tamarin/pcre/doc/pcretest.txt @@ -0,0 +1,529 @@ +PCRETEST(1) PCRETEST(1) + + +NAME + pcretest - a program for testing Perl-compatible regular expressions. + + +SYNOPSIS + + pcretest [-C] [-d] [-dfa] [-i] [-m] [-o osize] [-p] [-t] [source] + [destination] + + pcretest was written as a test program for the PCRE regular expression + library itself, but it can also be used for experimenting with regular + expressions. This document describes the features of the test program; + for details of the regular expressions themselves, see the pcrepattern + documentation. For details of the PCRE library function calls and their + options, see the pcreapi documentation. + + +OPTIONS + + -C Output the version number of the PCRE library, and all avail- + able information about the optional features that are + included, and then exit. + + -d Behave as if each regex has the /D (debug) modifier; the + internal form is output after compilation. + + -dfa Behave as if each data line contains the \D escape sequence; + this causes the alternative matching function, + pcre_dfa_exec(), to be used instead of the standard + pcre_exec() function (more detail is given below). + + -i Behave as if each regex has the /I modifier; information + about the compiled pattern is given after compilation. + + -m Output the size of each compiled pattern after it has been + compiled. This is equivalent to adding /M to each regular + expression. For compatibility with earlier versions of + pcretest, -s is a synonym for -m. + + -o osize Set the number of elements in the output vector that is used + when calling pcre_exec() to be osize. The default value is + 45, which is enough for 14 capturing subexpressions. The vec- + tor size can be changed for individual matching calls by + including \O in the data line (see below). + + -p Behave as if each regex has the /P modifier; the POSIX wrap- + per API is used to call PCRE. None of the other options has + any effect when -p is set. + + -t Run each compile, study, and match many times with a timer, + and output resulting time per compile or match (in millisec- + onds). Do not set -m with -t, because you will then get the + size output a zillion times, and the timing will be dis- + torted. + + +DESCRIPTION + + If pcretest is given two filename arguments, it reads from the first + and writes to the second. If it is given only one filename argument, it + reads from that file and writes to stdout. Otherwise, it reads from + stdin and writes to stdout, and prompts for each line of input, using + "re>" to prompt for regular expressions, and "data>" to prompt for data + lines. + + The program handles any number of sets of input on a single input file. + Each set starts with a regular expression, and continues with any num- + ber of data lines to be matched against the pattern. + + Each data line is matched separately and independently. If you want to + do multiple-line matches, you have to use the \n escape sequence in a + single line of input to encode the newline characters. The maximum + length of data line is 30,000 characters. + + An empty line signals the end of the data lines, at which point a new + regular expression is read. The regular expressions are given enclosed + in any non-alphanumeric delimiters other than backslash, for example + + /(a|bc)x+yz/ + + White space before the initial delimiter is ignored. A regular expres- + sion may be continued over several input lines, in which case the new- + line characters are included within it. It is possible to include the + delimiter within the pattern by escaping it, for example + + /abc\/def/ + + If you do so, the escape and the delimiter form part of the pattern, + but since delimiters are always non-alphanumeric, this does not affect + its interpretation. If the terminating delimiter is immediately fol- + lowed by a backslash, for example, + + /abc/\ + + then a backslash is added to the end of the pattern. This is done to + provide a way of testing the error condition that arises if a pattern + finishes with a backslash, because + + /abc\/ + + is interpreted as the first line of a pattern that starts with "abc/", + causing pcretest to read the next line as a continuation of the regular + expression. + + +PATTERN MODIFIERS + + A pattern may be followed by any number of modifiers, which are mostly + single characters. Following Perl usage, these are referred to below + as, for example, "the /i modifier", even though the delimiter of the + pattern need not always be a slash, and no slash is used when writing + modifiers. Whitespace may appear between the final pattern delimiter + and the first modifier, and between the modifiers themselves. + + The /i, /m, /s, and /x modifiers set the PCRE_CASELESS, PCRE_MULTILINE, + PCRE_DOTALL, or PCRE_EXTENDED options, respectively, when pcre_com- + pile() is called. These four modifier letters have the same effect as + they do in Perl. For example: + + /caseless/i + + The following table shows additional modifiers for setting PCRE options + that do not correspond to anything in Perl: + + /A PCRE_ANCHORED + /C PCRE_AUTO_CALLOUT + /E PCRE_DOLLAR_ENDONLY + /f PCRE_FIRSTLINE + /N PCRE_NO_AUTO_CAPTURE + /U PCRE_UNGREEDY + /X PCRE_EXTRA + + Searching for all possible matches within each subject string can be + requested by the /g or /G modifier. After finding a match, PCRE is + called again to search the remainder of the subject string. The differ- + ence between /g and /G is that the former uses the startoffset argument + to pcre_exec() to start searching at a new point within the entire + string (which is in effect what Perl does), whereas the latter passes + over a shortened substring. This makes a difference to the matching + process if the pattern begins with a lookbehind assertion (including \b + or \B). + + If any call to pcre_exec() in a /g or /G sequence matches an empty + string, the next call is done with the PCRE_NOTEMPTY and PCRE_ANCHORED + flags set in order to search for another, non-empty, match at the same + point. If this second match fails, the start offset is advanced by + one, and the normal match is retried. This imitates the way Perl han- + dles such cases when using the /g modifier or the split() function. + + There are yet more modifiers for controlling the way pcretest operates. + + The /+ modifier requests that as well as outputting the substring that + matched the entire pattern, pcretest should in addition output the + remainder of the subject string. This is useful for tests where the + subject contains multiple copies of the same substring. + + The /L modifier must be followed directly by the name of a locale, for + example, + + /pattern/Lfr_FR + + For this reason, it must be the last modifier. The given locale is set, + pcre_maketables() is called to build a set of character tables for the + locale, and this is then passed to pcre_compile() when compiling the + regular expression. Without an /L modifier, NULL is passed as the + tables pointer; that is, /L applies only to the expression on which it + appears. + + The /I modifier requests that pcretest output information about the + compiled pattern (whether it is anchored, has a fixed first character, + and so on). It does this by calling pcre_fullinfo() after compiling a + pattern. If the pattern is studied, the results of that are also out- + put. + + The /D modifier is a PCRE debugging feature, which also assumes /I. It + causes the internal form of compiled regular expressions to be output + after compilation. If the pattern was studied, the information returned + is also output. + + The /F modifier causes pcretest to flip the byte order of the fields in + the compiled pattern that contain 2-byte and 4-byte numbers. This + facility is for testing the feature in PCRE that allows it to execute + patterns that were compiled on a host with a different endianness. This + feature is not available when the POSIX interface to PCRE is being + used, that is, when the /P pattern modifier is specified. See also the + section about saving and reloading compiled patterns below. + + The /S modifier causes pcre_study() to be called after the expression + has been compiled, and the results used when the expression is matched. + + The /M modifier causes the size of memory block used to hold the com- + piled pattern to be output. + + The /P modifier causes pcretest to call PCRE via the POSIX wrapper API + rather than its native API. When this is done, all other modifiers + except /i, /m, and /+ are ignored. REG_ICASE is set if /i is present, + and REG_NEWLINE is set if /m is present. The wrapper functions force + PCRE_DOLLAR_ENDONLY always, and PCRE_DOTALL unless REG_NEWLINE is set. + + The /8 modifier causes pcretest to call PCRE with the PCRE_UTF8 option + set. This turns on support for UTF-8 character handling in PCRE, pro- + vided that it was compiled with this support enabled. This modifier + also causes any non-printing characters in output strings to be printed + using the \x{hh...} notation if they are valid UTF-8 sequences. + + If the /? modifier is used with /8, it causes pcretest to call + pcre_compile() with the PCRE_NO_UTF8_CHECK option, to suppress the + checking of the string for UTF-8 validity. + + +DATA LINES + + Before each data line is passed to pcre_exec(), leading and trailing + whitespace is removed, and it is then scanned for \ escapes. Some of + these are pretty esoteric features, intended for checking out some of + the more complicated features of PCRE. If you are just testing "ordi- + nary" regular expressions, you probably don't need any of these. The + following escapes are recognized: + + \a alarm (= BEL) + \b backspace + \e escape + \f formfeed + \n newline + \r carriage return + \t tab + \v vertical tab + \nnn octal character (up to 3 octal digits) + \xhh hexadecimal character (up to 2 hex digits) + \x{hh...} hexadecimal character, any number of digits + in UTF-8 mode + \A pass the PCRE_ANCHORED option to pcre_exec() + \B pass the PCRE_NOTBOL option to pcre_exec() + \Cdd call pcre_copy_substring() for substring dd + after a successful match (number less than 32) + \Cname call pcre_copy_named_substring() for substring + "name" after a successful match (name termin- + ated by next non alphanumeric character) + \C+ show the current captured substrings at callout + time + \C- do not supply a callout function + \C!n return 1 instead of 0 when callout number n is + reached + \C!n!m return 1 instead of 0 when callout number n is + reached for the nth time + \C*n pass the number n (may be negative) as callout + data; this is used as the callout return value + \D use the pcre_dfa_exec() match function + \F only shortest match for pcre_dfa_exec() + \Gdd call pcre_get_substring() for substring dd + after a successful match (number less than 32) + \Gname call pcre_get_named_substring() for substring + "name" after a successful match (name termin- + ated by next non-alphanumeric character) + \L call pcre_get_substringlist() after a + successful match + \M discover the minimum MATCH_LIMIT setting + \N pass the PCRE_NOTEMPTY option to pcre_exec() + \Odd set the size of the output vector passed to + pcre_exec() to dd (any number of digits) + \P pass the PCRE_PARTIAL option to pcre_exec() + or pcre_dfa_exec() + \R pass the PCRE_DFA_RESTART option to pcre_dfa_exec() + \S output details of memory get/free calls during matching + \Z pass the PCRE_NOTEOL option to pcre_exec() + \? pass the PCRE_NO_UTF8_CHECK option to + pcre_exec() + \>dd start the match at offset dd (any number of digits); + this sets the startoffset argument for pcre_exec() + + A backslash followed by anything else just escapes the anything else. + If the very last character is a backslash, it is ignored. This gives a + way of passing an empty line as data, since a real empty line termi- + nates the data input. + + If \M is present, pcretest calls pcre_exec() several times, with dif- + ferent values in the match_limit field of the pcre_extra data struc- + ture, until it finds the minimum number that is needed for pcre_exec() + to complete. This number is a measure of the amount of recursion and + backtracking that takes place, and checking it out can be instructive. + For most simple matches, the number is quite small, but for patterns + with very large numbers of matching possibilities, it can become large + very quickly with increasing length of subject string. + + When \O is used, the value specified may be higher or lower than the + size set by the -O command line option (or defaulted to 45); \O applies + only to the call of pcre_exec() for the line in which it appears. + + If the /P modifier was present on the pattern, causing the POSIX wrap- + per API to be used, only \B and \Z have any effect, causing REG_NOTBOL + and REG_NOTEOL to be passed to regexec() respectively. + + The use of \x{hh...} to represent UTF-8 characters is not dependent on + the use of the /8 modifier on the pattern. It is recognized always. + There may be any number of hexadecimal digits inside the braces. The + result is from one to six bytes, encoded according to the UTF-8 rules. + + +THE ALTERNATIVE MATCHING FUNCTION + + By default, pcretest uses the standard PCRE matching function, + pcre_exec() to match each data line. From release 6.0, PCRE supports an + alternative matching function, pcre_dfa_test(), which operates in a + different way, and has some restrictions. The differences between the + two functions are described in the pcrematching documentation. + + If a data line contains the \D escape sequence, or if the command line + contains the -dfa option, the alternative matching function is called. + This function finds all possible matches at a given point. If, however, + the \F escape sequence is present in the data line, it stops after the + first match is found. This is always the shortest possible match. + + +DEFAULT OUTPUT FROM PCRETEST + + This section describes the output when the normal matching function, + pcre_exec(), is being used. + + When a match succeeds, pcretest outputs the list of captured substrings + that pcre_exec() returns, starting with number 0 for the string that + matched the whole pattern. Otherwise, it outputs "No match" or "Partial + match" when pcre_exec() returns PCRE_ERROR_NOMATCH or PCRE_ERROR_PAR- + TIAL, respectively, and otherwise the PCRE negative error number. Here + is an example of an interactive pcretest run. + + $ pcretest + PCRE version 5.00 07-Sep-2004 + + re> /^abc(\d+)/ + data> abc123 + 0: abc123 + 1: 123 + data> xyz + No match + + If the strings contain any non-printing characters, they are output as + \0x escapes, or as \x{...} escapes if the /8 modifier was present on + the pattern. If the pattern has the /+ modifier, the output for sub- + string 0 is followed by the the rest of the subject string, identified + by "0+" like this: + + re> /cat/+ + data> cataract + 0: cat + 0+ aract + + If the pattern has the /g or /G modifier, the results of successive + matching attempts are output in sequence, like this: + + re> /\Bi(\w\w)/g + data> Mississippi + 0: iss + 1: ss + 0: iss + 1: ss + 0: ipp + 1: pp + + "No match" is output only if the first match attempt fails. + + If any of the sequences \C, \G, or \L are present in a data line that + is successfully matched, the substrings extracted by the convenience + functions are output with C, G, or L after the string number instead of + a colon. This is in addition to the normal full list. The string length + (that is, the return from the extraction function) is given in paren- + theses after each string for \C and \G. + + Note that while patterns can be continued over several lines (a plain + ">" prompt is used for continuations), data lines may not. However new- + lines can be included in data by means of the \n escape. + + +OUTPUT FROM THE ALTERNATIVE MATCHING FUNCTION + + When the alternative matching function, pcre_dfa_exec(), is used (by + means of the \D escape sequence or the -dfa command line option), the + output consists of a list of all the matches that start at the first + point in the subject where there is at least one match. For example: + + re> /(tang|tangerine|tan)/ + data> yellow tangerine\D + 0: tangerine + 1: tang + 2: tan + + (Using the normal matching function on this data finds only "tang".) + The longest matching string is always given first (and numbered zero). + + If /gP is present on the pattern, the search for further matches + resumes at the end of the longest match. For example: + + re> /(tang|tangerine|tan)/g + data> yellow tangerine and tangy sultana\D + 0: tangerine + 1: tang + 2: tan + 0: tang + 1: tan + 0: tan + + Since the matching function does not support substring capture, the + escape sequences that are concerned with captured substrings are not + relevant. + + +RESTARTING AFTER A PARTIAL MATCH + + When the alternative matching function has given the PCRE_ERROR_PARTIAL + return, indicating that the subject partially matched the pattern, you + can restart the match with additional subject data by means of the \R + escape sequence. For example: + + re> /^?(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)$/ + data> 23ja\P\D + Partial match: 23ja + data> n05\R\D + 0: n05 + + For further information about partial matching, see the pcrepartial + documentation. + + +CALLOUTS + + If the pattern contains any callout requests, pcretest's callout func- + tion is called during matching. This works with both matching func- + tions. By default, the called function displays the callout number, the + start and current positions in the text at the callout time, and the + next pattern item to be tested. For example, the output + + --->pqrabcdef + 0 ^ ^ \d + + indicates that callout number 0 occurred for a match attempt starting + at the fourth character of the subject string, when the pointer was at + the seventh character of the data, and when the next pattern item was + \d. Just one circumflex is output if the start and current positions + are the same. + + Callouts numbered 255 are assumed to be automatic callouts, inserted as + a result of the /C pattern modifier. In this case, instead of showing + the callout number, the offset in the pattern, preceded by a plus, is + output. For example: + + re> /\d?[A-E]\*/C + data> E* + --->E* + +0 ^ \d? + +3 ^ [A-E] + +8 ^^ \* + +10 ^ ^ + 0: E* + + The callout function in pcretest returns zero (carry on matching) by + default, but you can use a \C item in a data line (as described above) + to change this. + + Inserting callouts can be helpful when using pcretest to check compli- + cated regular expressions. For further information about callouts, see + the pcrecallout documentation. + + +SAVING AND RELOADING COMPILED PATTERNS + + The facilities described in this section are not available when the + POSIX inteface to PCRE is being used, that is, when the /P pattern mod- + ifier is specified. + + When the POSIX interface is not in use, you can cause pcretest to write + a compiled pattern to a file, by following the modifiers with > and a + file name. For example: + + /pattern/im >/some/file + + See the pcreprecompile documentation for a discussion about saving and + re-using compiled patterns. + + The data that is written is binary. The first eight bytes are the + length of the compiled pattern data followed by the length of the + optional study data, each written as four bytes in big-endian order + (most significant byte first). If there is no study data (either the + pattern was not studied, or studying did not return any data), the sec- + ond length is zero. The lengths are followed by an exact copy of the + compiled pattern. If there is additional study data, this follows imme- + diately after the compiled pattern. After writing the file, pcretest + expects to read a new pattern. + + A saved pattern can be reloaded into pcretest by specifing < and a file + name instead of a pattern. The name of the file must not contain a < + character, as otherwise pcretest will interpret the line as a pattern + delimited by < characters. For example: + + re> , 1996 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +basename="s,^.*/,,g" + +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh +# is ksh but when the shell is invoked as "sh" and the current value of +# the _XPG environment variable is not equal to 1 (one), the special +# positional parameter $0, within a function call, is the name of the +# function. +progpath="$0" + +# define SED for historic ltconfig's generated by Libtool 1.3 +test -z "$SED" && SED=sed + +# The name of this program: +progname=`echo "$progpath" | $SED $basename` +modename="$progname" + +# Global variables: +EXIT_SUCCESS=0 +EXIT_FAILURE=1 + +PROGRAM=ltmain.sh +PACKAGE=libtool +VERSION=1.5.18 +TIMESTAMP=" (1.1220.2.246 2005/05/16 10:00:18)" + +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes. +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi +# Same for EGREP, and just to be sure, do LTCC as well +if test "X$EGREP" = X ; then + EGREP=egrep +fi +if test "X$LTCC" = X ; then + LTCC=${CC-gcc} +fi + +# Check that we have a working $echo. +if test "X$1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X$1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then + # Yippee, $echo works! + : +else + # Restart under the correct shell, and then maybe $echo will work. + exec $SHELL "$progpath" --no-reexec ${1+"$@"} +fi + +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat <&2 + $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 + exit $EXIT_FAILURE +fi + +# Global variables. +mode=$default_mode +nonopt= +prev= +prevopt= +run= +show="$echo" +show_help= +execute_dlfiles= +lo2o="s/\\.lo\$/.${objext}/" +o2lo="s/\\.${objext}\$/.lo/" +quote_scanset='[[~#^*{};<>?'"'"' ]' + +if test -z "$max_cmd_len"; then + i=0 + testring="ABCD" + new_result= + + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while (test "X"`$SHELL $0 --fallback-echo "X$testring" 2>/dev/null` \ + = "XX$testring") >/dev/null 2>&1 && + new_result=`expr "X$testring" : ".*" 2>&1` && + max_cmd_len="$new_result" && + test "$i" != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + testring="$testring$testring" + done + testring= + # Add a significant safety factor because C++ compilers can tack on massive + # amounts of additional arguments before passing them to the linker. + # It appears as though 1/2 is a usable value. + max_cmd_len=`expr $max_cmd_len \/ 2` +fi + +##################################### +# Shell function definitions: +# This seems to be the best place for them + +# func_win32_libid arg +# return the library type of file 'arg' +# +# Need a lot of goo to handle *both* DLLs and import libs +# Has to be a shell function in order to 'eat' the argument +# that is supplied when $file_magic_command is called. +func_win32_libid () +{ + win32_libid_type="unknown" + win32_fileres=`file -L $1 2>/dev/null` + case $win32_fileres in + *ar\ archive\ import\ library*) # definitely import + win32_libid_type="x86 archive import" + ;; + *ar\ archive*) # could be an import, or static + if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ + $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then + win32_nmres=`eval $NM -f posix -A $1 | \ + sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'` + if test "X$win32_nmres" = "Ximport" ; then + win32_libid_type="x86 archive import" + else + win32_libid_type="x86 archive static" + fi + fi + ;; + *DLL*) + win32_libid_type="x86 DLL" + ;; + *executable*) # but shell scripts are "executable" too... + case $win32_fileres in + *MS\ Windows\ PE\ Intel*) + win32_libid_type="x86 DLL" + ;; + esac + ;; + esac + $echo $win32_libid_type +} + + +# func_infer_tag arg +# Infer tagged configuration to use if any are available and +# if one wasn't chosen via the "--tag" command line option. +# Only attempt this if the compiler in the base compile +# command doesn't match the default compiler. +# arg is usually of the form 'gcc ...' +func_infer_tag () +{ + if test -n "$available_tags" && test -z "$tagname"; then + CC_quoted= + for arg in $CC; do + case $arg in + *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") + arg="\"$arg\"" + ;; + esac + CC_quoted="$CC_quoted $arg" + done + case $@ in + # Blanks in the command may have been stripped by the calling shell, + # but not from the CC environment variable when configure was run. + " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;; + # Blanks at the start of $base_compile will cause this to fail + # if we don't check for them as well. + *) + for z in $available_tags; do + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then + # Evaluate the configuration. + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" + CC_quoted= + for arg in $CC; do + # Double-quote args containing other shell metacharacters. + case $arg in + *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") + arg="\"$arg\"" + ;; + esac + CC_quoted="$CC_quoted $arg" + done + # user sometimes does CC=-gcc so we need to match that to 'gcc' + trimedcc=`echo ${CC} | $SED -e "s/${host}-//g"` + # and sometimes libtool has CC=-gcc but user does CC=gcc + extendcc=${host}-${CC} + case "$@ " in + "cc "* | " cc "* | "${host}-cc "* | " ${host}-cc "*|\ + "gcc "* | " gcc "* | "${host}-gcc "* | " ${host}-gcc "*) + tagname=CC + break ;; + "$trimedcc "* | " $trimedcc "* | "`$echo $trimedcc` "* | " `$echo $trimedcc` "*|\ + "$extendcc "* | " $extendcc "* | "`$echo $extendcc` "* | " `$echo $extendcc` "*|\ + " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) + # The compiler in the base compile command matches + # the one in the tagged configuration. + # Assume this is the tagged configuration we want. + tagname=$z + break + ;; + esac + fi + done + # If $tagname still isn't set, then no tagged configuration + # was found and let the user know that the "--tag" command + # line option must be used. + if test -z "$tagname"; then + $echo "$modename: unable to infer tagged configuration" + $echo "$modename: specify a tag with \`--tag'" 1>&2 + exit $EXIT_FAILURE +# else +# $echo "$modename: using $tagname tagged configuration" + fi + ;; + esac + fi +} + + +# func_extract_an_archive dir oldlib +func_extract_an_archive () +{ + f_ex_an_ar_dir="$1"; shift + f_ex_an_ar_oldlib="$1" + + $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)" + $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $? + if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then + : + else + $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2 + exit $EXIT_FAILURE + fi +} + +# func_extract_archives gentop oldlib ... +func_extract_archives () +{ + my_gentop="$1"; shift + my_oldlibs=${1+"$@"} + my_oldobjs="" + my_xlib="" + my_xabs="" + my_xdir="" + my_status="" + + $show "${rm}r $my_gentop" + $run ${rm}r "$my_gentop" + $show "$mkdir $my_gentop" + $run $mkdir "$my_gentop" + my_status=$? + if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then + exit $my_status + fi + + for my_xlib in $my_oldlibs; do + # Extract the objects. + case $my_xlib in + [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; + *) my_xabs=`pwd`"/$my_xlib" ;; + esac + my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'` + my_xdir="$my_gentop/$my_xlib" + + $show "${rm}r $my_xdir" + $run ${rm}r "$my_xdir" + $show "$mkdir $my_xdir" + $run $mkdir "$my_xdir" + status=$? + if test "$status" -ne 0 && test ! -d "$my_xdir"; then + exit $status + fi + case $host in + *-darwin*) + $show "Extracting $my_xabs" + # Do not bother doing anything if just a dry run + if test -z "$run"; then + darwin_orig_dir=`pwd` + cd $my_xdir || exit $? + darwin_archive=$my_xabs + darwin_curdir=`pwd` + darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'` + darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null` + if test -n "$darwin_arches"; then + darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'` + darwin_arch= + $show "$darwin_base_archive has multiple architectures $darwin_arches" + for darwin_arch in $darwin_arches ; do + mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}" + lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" + cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" + func_extract_an_archive "`pwd`" "${darwin_base_archive}" + cd "$darwin_curdir" + $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" + done # $darwin_arches + ## Okay now we have a bunch of thin objects, gotta fatten them up :) + darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP` + darwin_file= + darwin_files= + for darwin_file in $darwin_filelist; do + darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` + lipo -create -output "$darwin_file" $darwin_files + done # $darwin_filelist + ${rm}r unfat-$$ + cd "$darwin_orig_dir" + else + cd "$darwin_orig_dir" + func_extract_an_archive "$my_xdir" "$my_xabs" + fi # $darwin_arches + fi # $run + ;; + *) + func_extract_an_archive "$my_xdir" "$my_xabs" + ;; + esac + my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` + done + func_extract_archives_result="$my_oldobjs" +} +# End of Shell function definitions +##################################### + +# Darwin sucks +eval std_shrext=\"$shrext_cmds\" + +# Parse our command line options once, thoroughly. +while test "$#" -gt 0 +do + arg="$1" + shift + + case $arg in + -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; + *) optarg= ;; + esac + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + execute_dlfiles) + execute_dlfiles="$execute_dlfiles $arg" + ;; + tag) + tagname="$arg" + preserve_args="${preserve_args}=$arg" + + # Check whether tagname contains only valid characters + case $tagname in + *[!-_A-Za-z0-9,/]*) + $echo "$progname: invalid tag name: $tagname" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + case $tagname in + CC) + # Don't test for the "default" C tag, as we know, it's there, but + # not specially marked. + ;; + *) + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then + taglist="$taglist $tagname" + # Evaluate the configuration. + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`" + else + $echo "$progname: ignoring unknown tag $tagname" 1>&2 + fi + ;; + esac + ;; + *) + eval "$prev=\$arg" + ;; + esac + + prev= + prevopt= + continue + fi + + # Have we seen a non-optional argument yet? + case $arg in + --help) + show_help=yes + ;; + + --version) + $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" + $echo + $echo "Copyright (C) 2005 Free Software Foundation, Inc." + $echo "This is free software; see the source for copying conditions. There is NO" + $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + exit $? + ;; + + --config) + ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath + # Now print the configurations for the tags. + for tagname in $taglist; do + ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" + done + exit $? + ;; + + --debug) + $echo "$progname: enabling shell trace mode" + set -x + preserve_args="$preserve_args $arg" + ;; + + --dry-run | -n) + run=: + ;; + + --features) + $echo "host: $host" + if test "$build_libtool_libs" = yes; then + $echo "enable shared libraries" + else + $echo "disable shared libraries" + fi + if test "$build_old_libs" = yes; then + $echo "enable static libraries" + else + $echo "disable static libraries" + fi + exit $? + ;; + + --finish) mode="finish" ;; + + --mode) prevopt="--mode" prev=mode ;; + --mode=*) mode="$optarg" ;; + + --preserve-dup-deps) duplicate_deps="yes" ;; + + --quiet | --silent) + show=: + preserve_args="$preserve_args $arg" + ;; + + --tag) prevopt="--tag" prev=tag ;; + --tag=*) + set tag "$optarg" ${1+"$@"} + shift + prev=tag + preserve_args="$preserve_args --tag" + ;; + + -dlopen) + prevopt="-dlopen" + prev=execute_dlfiles + ;; + + -*) + $echo "$modename: unrecognized option \`$arg'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + ;; + + *) + nonopt="$arg" + break + ;; + esac +done + +if test -n "$prevopt"; then + $echo "$modename: option \`$prevopt' requires an argument" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE +fi + +# If this variable is set in any of the actions, the command in it +# will be execed at the end. This prevents here-documents from being +# left over by shells. +exec_cmd= + +if test -z "$show_help"; then + + # Infer the operation mode. + if test -z "$mode"; then + $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 + $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2 + case $nonopt in + *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) + mode=link + for arg + do + case $arg in + -c) + mode=compile + break + ;; + esac + done + ;; + *db | *dbx | *strace | *truss) + mode=execute + ;; + *install*|cp|mv) + mode=install + ;; + *rm) + mode=uninstall + ;; + *) + # If we have no mode, but dlfiles were specified, then do execute mode. + test -n "$execute_dlfiles" && mode=execute + + # Just use the default operation mode. + if test -z "$mode"; then + if test -n "$nonopt"; then + $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 + else + $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 + fi + fi + ;; + esac + fi + + # Only execute mode is allowed to have -dlopen flags. + if test -n "$execute_dlfiles" && test "$mode" != execute; then + $echo "$modename: unrecognized option \`-dlopen'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Change the help message to a mode-specific one. + generic_help="$help" + help="Try \`$modename --help --mode=$mode' for more information." + + # These modes are in order of execution frequency so that they run quickly. + case $mode in + # libtool compile mode + compile) + modename="$modename: compile" + # Get the compilation command and the source file. + base_compile= + srcfile="$nonopt" # always keep a non-empty value in "srcfile" + suppress_opt=yes + suppress_output= + arg_mode=normal + libobj= + later= + + for arg + do + case "$arg_mode" in + arg ) + # do not "continue". Instead, add this to base_compile + lastarg="$arg" + arg_mode=normal + ;; + + target ) + libobj="$arg" + arg_mode=normal + continue + ;; + + normal ) + # Accept any command-line options. + case $arg in + -o) + if test -n "$libobj" ; then + $echo "$modename: you cannot specify \`-o' more than once" 1>&2 + exit $EXIT_FAILURE + fi + arg_mode=target + continue + ;; + + -static | -prefer-pic | -prefer-non-pic) + later="$later $arg" + continue + ;; + + -no-suppress) + suppress_opt=no + continue + ;; + + -Xcompiler) + arg_mode=arg # the next one goes into the "base_compile" arg list + continue # The current "srcfile" will either be retained or + ;; # replaced later. I would guess that would be a bug. + + -Wc,*) + args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` + lastarg= + save_ifs="$IFS"; IFS=',' + for arg in $args; do + IFS="$save_ifs" + + # Double-quote args containing other shell metacharacters. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + case $arg in + *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") + arg="\"$arg\"" + ;; + esac + lastarg="$lastarg $arg" + done + IFS="$save_ifs" + lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` + + # Add the arguments to base_compile. + base_compile="$base_compile $lastarg" + continue + ;; + + * ) + # Accept the current argument as the source file. + # The previous "srcfile" becomes the current argument. + # + lastarg="$srcfile" + srcfile="$arg" + ;; + esac # case $arg + ;; + esac # case $arg_mode + + # Aesthetically quote the previous argument. + lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` + + case $lastarg in + # Double-quote args containing other shell metacharacters. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, and some SunOS ksh mistreat backslash-escaping + # in scan sets (worked around with variable expansion), + # and furthermore cannot handle '|' '&' '(' ')' in scan sets + # at all, so we specify them separately. + *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") + lastarg="\"$lastarg\"" + ;; + esac + + base_compile="$base_compile $lastarg" + done # for arg + + case $arg_mode in + arg) + $echo "$modename: you must specify an argument for -Xcompile" + exit $EXIT_FAILURE + ;; + target) + $echo "$modename: you must specify a target with \`-o'" 1>&2 + exit $EXIT_FAILURE + ;; + *) + # Get the name of the library object. + [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` + ;; + esac + + # Recognize several different file suffixes. + # If the user specifies -o file.o, it is replaced with file.lo + xform='[cCFSifmso]' + case $libobj in + *.ada) xform=ada ;; + *.adb) xform=adb ;; + *.ads) xform=ads ;; + *.asm) xform=asm ;; + *.c++) xform=c++ ;; + *.cc) xform=cc ;; + *.ii) xform=ii ;; + *.class) xform=class ;; + *.cpp) xform=cpp ;; + *.cxx) xform=cxx ;; + *.f90) xform=f90 ;; + *.for) xform=for ;; + *.java) xform=java ;; + esac + + libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` + + case $libobj in + *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; + *) + $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + func_infer_tag $base_compile + + for arg in $later; do + case $arg in + -static) + build_old_libs=yes + continue + ;; + + -prefer-pic) + pic_mode=yes + continue + ;; + + -prefer-non-pic) + pic_mode=no + continue + ;; + esac + done + + qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"` + case $qlibobj in + *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") + qlibobj="\"$qlibobj\"" ;; + esac + if test "X$libobj" != "X$qlibobj"; then + $echo "$modename: libobj name \`$libobj' may not contain shell special characters." + exit $EXIT_FAILURE + fi + objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` + xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$obj"; then + xdir= + else + xdir=$xdir/ + fi + lobj=${xdir}$objdir/$objname + + if test -z "$base_compile"; then + $echo "$modename: you must specify a compilation command" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Delete any leftover library objects. + if test "$build_old_libs" = yes; then + removelist="$obj $lobj $libobj ${libobj}T" + else + removelist="$lobj $libobj ${libobj}T" + fi + + $run $rm $removelist + trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 + + # On Cygwin there's no "real" PIC flag so we must build both object types + case $host_os in + cygwin* | mingw* | pw32* | os2*) + pic_mode=default + ;; + esac + if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then + # non-PIC code in shared libraries is not supported + pic_mode=default + fi + + # Calculate the filename of the output object if compiler does + # not support -o with -c + if test "$compiler_c_o" = no; then + output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} + lockfile="$output_obj.lock" + removelist="$removelist $output_obj $lockfile" + trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 + else + output_obj= + need_locks=no + lockfile= + fi + + # Lock this critical section if it is needed + # We use this script file to make the link, it avoids creating a new file + if test "$need_locks" = yes; then + until $run ln "$srcfile" "$lockfile" 2>/dev/null; do + $show "Waiting for $lockfile to be removed" + sleep 2 + done + elif test "$need_locks" = warn; then + if test -f "$lockfile"; then + $echo "\ +*** ERROR, $lockfile exists and contains: +`cat $lockfile 2>/dev/null` + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $run $rm $removelist + exit $EXIT_FAILURE + fi + $echo "$srcfile" > "$lockfile" + fi + + if test -n "$fix_srcfile_path"; then + eval srcfile=\"$fix_srcfile_path\" + fi + qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"` + case $qsrcfile in + *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") + qsrcfile="\"$qsrcfile\"" ;; + esac + + $run $rm "$libobj" "${libobj}T" + + # Create a libtool object file (analogous to a ".la" file), + # but don't create it if we're doing a dry run. + test -z "$run" && cat > ${libobj}T </dev/null`" != "X$srcfile"; then + $echo "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $run $rm $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed, then go on to compile the next one + if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then + $show "$mv $output_obj $lobj" + if $run $mv $output_obj $lobj; then : + else + error=$? + $run $rm $removelist + exit $error + fi + fi + + # Append the name of the PIC object to the libtool object file. + test -z "$run" && cat >> ${libobj}T <> ${libobj}T </dev/null`" != "X$srcfile"; then + $echo "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $run $rm $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed + if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then + $show "$mv $output_obj $obj" + if $run $mv $output_obj $obj; then : + else + error=$? + $run $rm $removelist + exit $error + fi + fi + + # Append the name of the non-PIC object the libtool object file. + # Only append if the libtool object file exists. + test -z "$run" && cat >> ${libobj}T <> ${libobj}T <&2 + fi + if test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + else + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + fi + build_libtool_libs=no + build_old_libs=yes + prefer_static_libs=yes + break + ;; + esac + done + + # See if our shared archives depend on static archives. + test -n "$old_archive_from_new_cmds" && build_old_libs=yes + + # Go through the arguments, transforming them on the way. + while test "$#" -gt 0; do + arg="$1" + shift + case $arg in + *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") + qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test + ;; + *) qarg=$arg ;; + esac + libtool_args="$libtool_args $qarg" + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + output) + compile_command="$compile_command @OUTPUT@" + finalize_command="$finalize_command @OUTPUT@" + ;; + esac + + case $prev in + dlfiles|dlprefiles) + if test "$preload" = no; then + # Add the symbol object into the linking commands. + compile_command="$compile_command @SYMFILE@" + finalize_command="$finalize_command @SYMFILE@" + preload=yes + fi + case $arg in + *.la | *.lo) ;; # We handle these cases below. + force) + if test "$dlself" = no; then + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + self) + if test "$prev" = dlprefiles; then + dlself=yes + elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then + dlself=yes + else + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + *) + if test "$prev" = dlfiles; then + dlfiles="$dlfiles $arg" + else + dlprefiles="$dlprefiles $arg" + fi + prev= + continue + ;; + esac + ;; + expsyms) + export_symbols="$arg" + if test ! -f "$arg"; then + $echo "$modename: symbol file \`$arg' does not exist" + exit $EXIT_FAILURE + fi + prev= + continue + ;; + expsyms_regex) + export_symbols_regex="$arg" + prev= + continue + ;; + inst_prefix) + inst_prefix_dir="$arg" + prev= + continue + ;; + precious_regex) + precious_files_regex="$arg" + prev= + continue + ;; + release) + release="-$arg" + prev= + continue + ;; + objectlist) + if test -f "$arg"; then + save_arg=$arg + moreargs= + for fil in `cat $save_arg` + do +# moreargs="$moreargs $fil" + arg=$fil + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + pic_object= + non_pic_object= + + # Read the .lo file + # If there is no directory component, then add one. + case $arg in + */* | *\\*) . $arg ;; + *) . ./$arg ;; + esac + + if test -z "$pic_object" || \ + test -z "$non_pic_object" || + test "$pic_object" = none && \ + test "$non_pic_object" = none; then + $echo "$modename: cannot find name of object for \`$arg'" 1>&2 + exit $EXIT_FAILURE + fi + + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi + + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + dlfiles="$dlfiles $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + dlprefiles="$dlprefiles $pic_object" + prev= + fi + + # A PIC object. + libobjs="$libobjs $pic_object" + arg="$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" + + # A standard non-PIC object + non_pic_objects="$non_pic_objects $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + fi + else + # Only an error if not doing a dry-run. + if test -z "$run"; then + $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 + exit $EXIT_FAILURE + else + # Dry-run case. + + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi + + pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` + non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` + libobjs="$libobjs $pic_object" + non_pic_objects="$non_pic_objects $non_pic_object" + fi + fi + done + else + $echo "$modename: link input file \`$save_arg' does not exist" + exit $EXIT_FAILURE + fi + arg=$save_arg + prev= + continue + ;; + rpath | xrpath) + # We need an absolute path. + case $arg in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + $echo "$modename: only absolute run-paths are allowed" 1>&2 + exit $EXIT_FAILURE + ;; + esac + if test "$prev" = rpath; then + case "$rpath " in + *" $arg "*) ;; + *) rpath="$rpath $arg" ;; + esac + else + case "$xrpath " in + *" $arg "*) ;; + *) xrpath="$xrpath $arg" ;; + esac + fi + prev= + continue + ;; + xcompiler) + compiler_flags="$compiler_flags $qarg" + prev= + compile_command="$compile_command $qarg" + finalize_command="$finalize_command $qarg" + continue + ;; + xlinker) + linker_flags="$linker_flags $qarg" + compiler_flags="$compiler_flags $wl$qarg" + prev= + compile_command="$compile_command $wl$qarg" + finalize_command="$finalize_command $wl$qarg" + continue + ;; + xcclinker) + linker_flags="$linker_flags $qarg" + compiler_flags="$compiler_flags $qarg" + prev= + compile_command="$compile_command $qarg" + finalize_command="$finalize_command $qarg" + continue + ;; + shrext) + shrext_cmds="$arg" + prev= + continue + ;; + darwin_framework) + compiler_flags="$compiler_flags $arg" + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + prev= + continue + ;; + *) + eval "$prev=\"\$arg\"" + prev= + continue + ;; + esac + fi # test -n "$prev" + + prevarg="$arg" + + case $arg in + -all-static) + if test -n "$link_static_flag"; then + compile_command="$compile_command $link_static_flag" + finalize_command="$finalize_command $link_static_flag" + fi + continue + ;; + + -allow-undefined) + # FIXME: remove this flag sometime in the future. + $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 + continue + ;; + + -avoid-version) + avoid_version=yes + continue + ;; + + -dlopen) + prev=dlfiles + continue + ;; + + -dlpreopen) + prev=dlprefiles + continue + ;; + + -export-dynamic) + export_dynamic=yes + continue + ;; + + -export-symbols | -export-symbols-regex) + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then + $echo "$modename: more than one -exported-symbols argument is not allowed" + exit $EXIT_FAILURE + fi + if test "X$arg" = "X-export-symbols"; then + prev=expsyms + else + prev=expsyms_regex + fi + continue + ;; + + -framework) + prev=darwin_framework + compiler_flags="$compiler_flags $arg" + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + continue + ;; + + -inst-prefix-dir) + prev=inst_prefix + continue + ;; + + # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* + # so, if we see these flags be careful not to treat them like -L + -L[A-Z][A-Z]*:*) + case $with_gcc/$host in + no/*-*-irix* | /*-*-irix*) + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + ;; + esac + continue + ;; + + -L*) + dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 + exit $EXIT_FAILURE + fi + dir="$absdir" + ;; + esac + case "$deplibs " in + *" -L$dir "*) ;; + *) + deplibs="$deplibs -L$dir" + lib_search_path="$lib_search_path $dir" + ;; + esac + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) + case :$dllsearchpath: in + *":$dir:"*) ;; + *) dllsearchpath="$dllsearchpath:$dir";; + esac + ;; + esac + continue + ;; + + -l*) + if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then + case $host in + *-*-cygwin* | *-*-pw32* | *-*-beos*) + # These systems don't actually have a C or math library (as such) + continue + ;; + *-*-mingw* | *-*-os2*) + # These systems don't actually have a C library (as such) + test "X$arg" = "X-lc" && continue + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + test "X$arg" = "X-lc" && continue + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C and math libraries are in the System framework + deplibs="$deplibs -framework System" + continue + esac + elif test "X$arg" = "X-lc_r"; then + case $host in + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc_r directly, use -pthread flag. + continue + ;; + esac + fi + deplibs="$deplibs $arg" + continue + ;; + + # Tru64 UNIX uses -model [arg] to determine the layout of C++ + # classes, name mangling, and exception handling. + -model) + compile_command="$compile_command $arg" + compiler_flags="$compiler_flags $arg" + finalize_command="$finalize_command $arg" + prev=xcompiler + continue + ;; + + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) + compiler_flags="$compiler_flags $arg" + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + continue + ;; + + -module) + module=yes + continue + ;; + + # -64, -mips[0-9] enable 64-bit mode on the SGI compiler + # -r[0-9][0-9]* specifies the processor on the SGI compiler + # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler + # +DA*, +DD* enable 64-bit mode on the HP compiler + # -q* pass through compiler args for the IBM compiler + # -m* pass through architecture-specific compiler args for GCC + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*) + + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") + arg="\"$arg\"" + ;; + esac + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + if test "$with_gcc" = "yes" ; then + compiler_flags="$compiler_flags $arg" + fi + continue + ;; + + -shrext) + prev=shrext + continue + ;; + + -no-fast-install) + fast_install=no + continue + ;; + + -no-install) + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) + # The PATH hackery in wrapper scripts is required on Windows + # in order for the loader to find any dlls it needs. + $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 + $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 + fast_install=no + ;; + *) no_install=yes ;; + esac + continue + ;; + + -no-undefined) + allow_undefined=no + continue + ;; + + -objectlist) + prev=objectlist + continue + ;; + + -o) prev=output ;; + + -precious-files-regex) + prev=precious_regex + continue + ;; + + -release) + prev=release + continue + ;; + + -rpath) + prev=rpath + continue + ;; + + -R) + prev=xrpath + continue + ;; + + -R*) + dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + $echo "$modename: only absolute run-paths are allowed" 1>&2 + exit $EXIT_FAILURE + ;; + esac + case "$xrpath " in + *" $dir "*) ;; + *) xrpath="$xrpath $dir" ;; + esac + continue + ;; + + -static) + # The effects of -static are defined in a previous loop. + # We used to do the same as -all-static on platforms that + # didn't have a PIC flag, but the assumption that the effects + # would be equivalent was wrong. It would break on at least + # Digital Unix and AIX. + continue + ;; + + -thread-safe) + thread_safe=yes + continue + ;; + + -version-info) + prev=vinfo + continue + ;; + -version-number) + prev=vinfo + vinfo_number=yes + continue + ;; + + -Wc,*) + args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + case $flag in + *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") + flag="\"$flag\"" + ;; + esac + arg="$arg $wl$flag" + compiler_flags="$compiler_flags $flag" + done + IFS="$save_ifs" + arg=`$echo "X$arg" | $Xsed -e "s/^ //"` + ;; + + -Wl,*) + args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + case $flag in + *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") + flag="\"$flag\"" + ;; + esac + arg="$arg $wl$flag" + compiler_flags="$compiler_flags $wl$flag" + linker_flags="$linker_flags $flag" + done + IFS="$save_ifs" + arg=`$echo "X$arg" | $Xsed -e "s/^ //"` + ;; + + -Xcompiler) + prev=xcompiler + continue + ;; + + -Xlinker) + prev=xlinker + continue + ;; + + -XCClinker) + prev=xcclinker + continue + ;; + + -Kthread | -mthreads | -mt | -pthread | -pthreads | -threads | -qthreaded | -kthread ) + compiler_flags="$compiler_flags $arg" + continue + ;; + + # Some other compiler flag. + -* | +*) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") + arg="\"$arg\"" + ;; + esac + ;; + + *.$objext) + # A standard object. + objs="$objs $arg" + ;; + + *.lo) + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + pic_object= + non_pic_object= + + # Read the .lo file + # If there is no directory component, then add one. + case $arg in + */* | *\\*) . $arg ;; + *) . ./$arg ;; + esac + + if test -z "$pic_object" || \ + test -z "$non_pic_object" || + test "$pic_object" = none && \ + test "$non_pic_object" = none; then + $echo "$modename: cannot find name of object for \`$arg'" 1>&2 + exit $EXIT_FAILURE + fi + + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi + + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + dlfiles="$dlfiles $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + dlprefiles="$dlprefiles $pic_object" + prev= + fi + + # A PIC object. + libobjs="$libobjs $pic_object" + arg="$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" + + # A standard non-PIC object + non_pic_objects="$non_pic_objects $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + fi + else + # Only an error if not doing a dry-run. + if test -z "$run"; then + $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 + exit $EXIT_FAILURE + else + # Dry-run case. + + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi + + pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` + non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` + libobjs="$libobjs $pic_object" + non_pic_objects="$non_pic_objects $non_pic_object" + fi + fi + ;; + + *.$libext) + # An archive. + deplibs="$deplibs $arg" + old_deplibs="$old_deplibs $arg" + continue + ;; + + *.la) + # A libtool-controlled library. + + if test "$prev" = dlfiles; then + # This library was specified with -dlopen. + dlfiles="$dlfiles $arg" + prev= + elif test "$prev" = dlprefiles; then + # The library was specified with -dlpreopen. + dlprefiles="$dlprefiles $arg" + prev= + else + deplibs="$deplibs $arg" + fi + continue + ;; + + # Some other compiler argument. + *) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") + arg="\"$arg\"" + ;; + esac + ;; + esac # arg + + # Now actually substitute the argument into the commands. + if test -n "$arg"; then + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + fi + done # argument parsing loop + + if test -n "$prev"; then + $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then + eval arg=\"$export_dynamic_flag_spec\" + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + fi + + oldlibs= + # calculate the name of the file, without its directory + outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` + libobjs_save="$libobjs" + + if test -n "$shlibpath_var"; then + # get the directories listed in $shlibpath_var + eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` + else + shlib_search_path= + fi + eval sys_lib_search_path=\"$sys_lib_search_path_spec\" + eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" + + output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` + if test "X$output_objdir" = "X$output"; then + output_objdir="$objdir" + else + output_objdir="$output_objdir/$objdir" + fi + # Create the object directory. + if test ! -d "$output_objdir"; then + $show "$mkdir $output_objdir" + $run $mkdir $output_objdir + status=$? + if test "$status" -ne 0 && test ! -d "$output_objdir"; then + exit $status + fi + fi + + # Determine the type of output + case $output in + "") + $echo "$modename: you must specify an output file" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + ;; + *.$libext) linkmode=oldlib ;; + *.lo | *.$objext) linkmode=obj ;; + *.la) linkmode=lib ;; + *) linkmode=prog ;; # Anything else should be a program. + esac + + case $host in + *cygwin* | *mingw* | *pw32*) + # don't eliminate duplications in $postdeps and $predeps + duplicate_compiler_generated_deps=yes + ;; + *) + duplicate_compiler_generated_deps=$duplicate_deps + ;; + esac + specialdeplibs= + + libs= + # Find all interdependent deplibs by searching for libraries + # that are linked more than once (e.g. -la -lb -la) + for deplib in $deplibs; do + if test "X$duplicate_deps" = "Xyes" ; then + case "$libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + libs="$libs $deplib" + done + + if test "$linkmode" = lib; then + libs="$predeps $libs $compiler_lib_search_path $postdeps" + + # Compute libraries that are listed more than once in $predeps + # $postdeps and mark them as special (i.e., whose duplicates are + # not to be eliminated). + pre_post_deps= + if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then + for pre_post_dep in $predeps $postdeps; do + case "$pre_post_deps " in + *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; + esac + pre_post_deps="$pre_post_deps $pre_post_dep" + done + fi + pre_post_deps= + fi + + deplibs= + newdependency_libs= + newlib_search_path= + need_relink=no # whether we're linking any uninstalled libtool libraries + notinst_deplibs= # not-installed libtool libraries + notinst_path= # paths that contain not-installed libtool libraries + case $linkmode in + lib) + passes="conv link" + for file in $dlfiles $dlprefiles; do + case $file in + *.la) ;; + *) + $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 + exit $EXIT_FAILURE + ;; + esac + done + ;; + prog) + compile_deplibs= + finalize_deplibs= + alldeplibs=no + newdlfiles= + newdlprefiles= + passes="conv scan dlopen dlpreopen link" + ;; + *) passes="conv" + ;; + esac + for pass in $passes; do + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan"; then + libs="$deplibs" + deplibs= + fi + if test "$linkmode" = prog; then + case $pass in + dlopen) libs="$dlfiles" ;; + dlpreopen) libs="$dlprefiles" ;; + link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; + esac + fi + if test "$pass" = dlopen; then + # Collect dlpreopened libraries + save_deplibs="$deplibs" + deplibs= + fi + for deplib in $libs; do + lib= + found=no + case $deplib in + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + compiler_flags="$compiler_flags $deplib" + fi + continue + ;; + -l*) + if test "$linkmode" != lib && test "$linkmode" != prog; then + $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 + continue + fi + name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` + for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do + for search_ext in .la $std_shrext .so .a; do + # Search the libtool library + lib="$searchdir/lib${name}${search_ext}" + if test -f "$lib"; then + if test "$search_ext" = ".la"; then + found=yes + else + found=no + fi + break 2 + fi + done + done + if test "$found" != yes; then + # deplib doesn't seem to be a libtool library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + else # deplib is a libtool library + # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, + # We need to do some special things here, and not later. + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $deplib "*) + if (${SED} -e '2q' $lib | + grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + library_names= + old_library= + case $lib in + */* | *\\*) . $lib ;; + *) . ./$lib ;; + esac + for l in $old_library $library_names; do + ll="$l" + done + if test "X$ll" = "X$old_library" ; then # only static version available + found=no + ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` + test "X$ladir" = "X$lib" && ladir="." + lib=$ladir/$old_library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + fi + fi + ;; + *) ;; + esac + fi + fi + ;; # -l + -L*) + case $linkmode in + lib) + deplibs="$deplib $deplibs" + test "$pass" = conv && continue + newdependency_libs="$deplib $newdependency_libs" + newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` + ;; + prog) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + if test "$pass" = scan; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` + ;; + *) + $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 + ;; + esac # linkmode + continue + ;; # -L + -R*) + if test "$pass" = link; then + dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` + # Make sure the xrpath contains only unique directories. + case "$xrpath " in + *" $dir "*) ;; + *) xrpath="$xrpath $dir" ;; + esac + fi + deplibs="$deplib $deplibs" + continue + ;; + *.la) lib="$deplib" ;; + *.$libext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + case $linkmode in + lib) + valid_a_lib=no + case $deplibs_check_method in + match_pattern*) + set dummy $deplibs_check_method + match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` + if eval $echo \"$deplib\" 2>/dev/null \ + | $SED 10q \ + | $EGREP "$match_pattern_regex" > /dev/null; then + valid_a_lib=yes + fi + ;; + pass_all) + valid_a_lib=yes + ;; + esac + if test "$valid_a_lib" != yes; then + $echo + $echo "*** Warning: Trying to link with static lib archive $deplib." + $echo "*** I have the capability to make that library automatically link in when" + $echo "*** you link to this library. But I can only do this if you have a" + $echo "*** shared version of the library, which you do not appear to have" + $echo "*** because the file extensions .$libext of this argument makes me believe" + $echo "*** that it is just a static archive that I should not used here." + else + $echo + $echo "*** Warning: Linking the shared library $output against the" + $echo "*** static library $deplib is not portable!" + deplibs="$deplib $deplibs" + fi + continue + ;; + prog) + if test "$pass" != link; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + continue + ;; + esac # linkmode + ;; # *.$libext + *.lo | *.$objext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + elif test "$linkmode" = prog; then + if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then + # If there is no dlopen support or we're linking statically, + # we need to preload. + newdlprefiles="$newdlprefiles $deplib" + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + newdlfiles="$newdlfiles $deplib" + fi + fi + continue + ;; + %DEPLIBS%) + alldeplibs=yes + continue + ;; + esac # case $deplib + if test "$found" = yes || test -f "$lib"; then : + else + $echo "$modename: cannot find the library \`$lib'" 1>&2 + exit $EXIT_FAILURE + fi + + # Check to see that this really is a libtool archive. + if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + else + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + exit $EXIT_FAILURE + fi + + ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` + test "X$ladir" = "X$lib" && ladir="." + + dlname= + dlopen= + dlpreopen= + libdir= + library_names= + old_library= + # If the library was installed with an old release of libtool, + # it will not redefine variables installed, or shouldnotlink + installed=yes + shouldnotlink=no + avoidtemprpath= + + + # Read the .la file + case $lib in + */* | *\\*) . $lib ;; + *) . ./$lib ;; + esac + + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan" || + { test "$linkmode" != prog && test "$linkmode" != lib; }; then + test -n "$dlopen" && dlfiles="$dlfiles $dlopen" + test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" + fi + + if test "$pass" = conv; then + # Only check for convenience libraries + deplibs="$lib $deplibs" + if test -z "$libdir"; then + if test -z "$old_library"; then + $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 + exit $EXIT_FAILURE + fi + # It is a libtool convenience library, so add in its objects. + convenience="$convenience $ladir/$objdir/$old_library" + old_convenience="$old_convenience $ladir/$objdir/$old_library" + tmp_libs= + for deplib in $dependency_libs; do + deplibs="$deplib $deplibs" + if test "X$duplicate_deps" = "Xyes" ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$tmp_libs $deplib" + done + elif test "$linkmode" != prog && test "$linkmode" != lib; then + $echo "$modename: \`$lib' is not a convenience library" 1>&2 + exit $EXIT_FAILURE + fi + continue + fi # $pass = conv + + + # Get the name of the library we link against. + linklib= + for l in $old_library $library_names; do + linklib="$l" + done + if test -z "$linklib"; then + $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 + exit $EXIT_FAILURE + fi + + # This library was specified with -dlopen. + if test "$pass" = dlopen; then + if test -z "$libdir"; then + $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 + exit $EXIT_FAILURE + fi + if test -z "$dlname" || + test "$dlopen_support" != yes || + test "$build_libtool_libs" = no; then + # If there is no dlname, no dlopen support or we're linking + # statically, we need to preload. We also need to preload any + # dependent libraries so libltdl's deplib preloader doesn't + # bomb out in the load deplibs phase. + dlprefiles="$dlprefiles $lib $dependency_libs" + else + newdlfiles="$newdlfiles $lib" + fi + continue + fi # $pass = dlopen + + # We need an absolute path. + case $ladir in + [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; + *) + abs_ladir=`cd "$ladir" && pwd` + if test -z "$abs_ladir"; then + $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 + $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 + abs_ladir="$ladir" + fi + ;; + esac + laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` + + # Find the relevant object directory and library name. + if test "X$installed" = Xyes; then + if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then + $echo "$modename: warning: library \`$lib' was moved." 1>&2 + dir="$ladir" + absdir="$abs_ladir" + libdir="$abs_ladir" + else + dir="$libdir" + absdir="$libdir" + fi + test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes + else + if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then + dir="$ladir" + absdir="$abs_ladir" + # Remove this search path later + notinst_path="$notinst_path $abs_ladir" + else + dir="$ladir/$objdir" + absdir="$abs_ladir/$objdir" + # Remove this search path later + notinst_path="$notinst_path $abs_ladir" + fi + fi # $installed = yes + name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` + + # This library was specified with -dlpreopen. + if test "$pass" = dlpreopen; then + if test -z "$libdir"; then + $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 + exit $EXIT_FAILURE + fi + # Prefer using a static library (so that no silly _DYNAMIC symbols + # are required to link). + if test -n "$old_library"; then + newdlprefiles="$newdlprefiles $dir/$old_library" + # Otherwise, use the dlname, so that lt_dlopen finds it. + elif test -n "$dlname"; then + newdlprefiles="$newdlprefiles $dir/$dlname" + else + newdlprefiles="$newdlprefiles $dir/$linklib" + fi + fi # $pass = dlpreopen + + if test -z "$libdir"; then + # Link the convenience library + if test "$linkmode" = lib; then + deplibs="$dir/$old_library $deplibs" + elif test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$dir/$old_library $compile_deplibs" + finalize_deplibs="$dir/$old_library $finalize_deplibs" + else + deplibs="$lib $deplibs" # used for prog,scan pass + fi + continue + fi + + + if test "$linkmode" = prog && test "$pass" != link; then + newlib_search_path="$newlib_search_path $ladir" + deplibs="$lib $deplibs" + + linkalldeplibs=no + if test "$link_all_deplibs" != no || test -z "$library_names" || + test "$build_libtool_libs" = no; then + linkalldeplibs=yes + fi + + tmp_libs= + for deplib in $dependency_libs; do + case $deplib in + -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test + esac + # Need to link against all dependency_libs? + if test "$linkalldeplibs" = yes; then + deplibs="$deplib $deplibs" + else + # Need to hardcode shared library paths + # or/and link against static libraries + newdependency_libs="$deplib $newdependency_libs" + fi + if test "X$duplicate_deps" = "Xyes" ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$tmp_libs $deplib" + done # for deplib + continue + fi # $linkmode = prog... + + if test "$linkmode,$pass" = "prog,link"; then + if test -n "$library_names" && + { test "$prefer_static_libs" = no || test -z "$old_library"; }; then + # We need to hardcode the library path + if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then + # Make sure the rpath contains only unique directories. + case "$temp_rpath " in + *" $dir "*) ;; + *" $absdir "*) ;; + *) temp_rpath="$temp_rpath $dir" ;; + esac + fi + + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) compile_rpath="$compile_rpath $absdir" + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" + esac + ;; + esac + fi # $linkmode,$pass = prog,link... + + if test "$alldeplibs" = yes && + { test "$deplibs_check_method" = pass_all || + { test "$build_libtool_libs" = yes && + test -n "$library_names"; }; }; then + # We only need to search for static libraries + continue + fi + fi + + link_static=no # Whether the deplib will be linked statically + if test -n "$library_names" && + { test "$prefer_static_libs" = no || test -z "$old_library"; }; then + if test "$installed" = no; then + notinst_deplibs="$notinst_deplibs $lib" + need_relink=yes + fi + # This is a shared library + + # Warn about portability, can't link against -module's on + # some systems (darwin) + if test "$shouldnotlink" = yes && test "$pass" = link ; then + $echo + if test "$linkmode" = prog; then + $echo "*** Warning: Linking the executable $output against the loadable module" + else + $echo "*** Warning: Linking the shared library $output against the loadable module" + fi + $echo "*** $linklib is not portable!" + fi + if test "$linkmode" = lib && + test "$hardcode_into_libs" = yes; then + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) compile_rpath="$compile_rpath $absdir" + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" + esac + ;; + esac + fi + + if test -n "$old_archive_from_expsyms_cmds"; then + # figure out the soname + set dummy $library_names + realname="$2" + shift; shift + libname=`eval \\$echo \"$libname_spec\"` + # use dlname if we got it. it's perfectly good, no? + if test -n "$dlname"; then + soname="$dlname" + elif test -n "$soname_spec"; then + # bleh windows + case $host in + *cygwin* | mingw*) + major=`expr $current - $age` + versuffix="-$major" + ;; + esac + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + + # Make a new name for the extract_expsyms_cmds to use + soroot="$soname" + soname=`$echo $soroot | ${SED} -e 's/^.*\///'` + newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" + + # If the library has no export list, then create one now + if test -f "$output_objdir/$soname-def"; then : + else + $show "extracting exported symbol list from \`$soname'" + save_ifs="$IFS"; IFS='~' + cmds=$extract_expsyms_cmds + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + fi + + # Create $newlib + if test -f "$output_objdir/$newlib"; then :; else + $show "generating import library for \`$soname'" + save_ifs="$IFS"; IFS='~' + cmds=$old_archive_from_expsyms_cmds + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + fi + # make sure the library variables are pointing to the new library + dir=$output_objdir + linklib=$newlib + fi # test -n "$old_archive_from_expsyms_cmds" + + if test "$linkmode" = prog || test "$mode" != relink; then + add_shlibpath= + add_dir= + add= + lib_linked=yes + case $hardcode_action in + immediate | unsupported) + if test "$hardcode_direct" = no; then + add="$dir/$linklib" + case $host in + *-*-sco3.2v5* ) add_dir="-L$dir" ;; + *-*-darwin* ) + # if the lib is a module then we can not link against + # it, someone is ignoring the new warnings I added + if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then + $echo "** Warning, lib $linklib is a module, not a shared library" + if test -z "$old_library" ; then + $echo + $echo "** And there doesn't seem to be a static archive available" + $echo "** The link will probably fail, sorry" + else + add="$dir/$old_library" + fi + fi + esac + elif test "$hardcode_minus_L" = no; then + case $host in + *-*-sunos*) add_shlibpath="$dir" ;; + esac + add_dir="-L$dir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = no; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + relink) + if test "$hardcode_direct" = yes; then + add="$dir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$dir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case "$libdir" in + [\\/]*) + add_dir="$add_dir -L$inst_prefix_dir$libdir" + ;; + esac + fi + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + *) lib_linked=no ;; + esac + + if test "$lib_linked" != yes; then + $echo "$modename: configuration error: unsupported hardcode properties" + exit $EXIT_FAILURE + fi + + if test -n "$add_shlibpath"; then + case :$compile_shlibpath: in + *":$add_shlibpath:"*) ;; + *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; + esac + fi + if test "$linkmode" = prog; then + test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" + test -n "$add" && compile_deplibs="$add $compile_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + if test "$hardcode_direct" != yes && \ + test "$hardcode_minus_L" != yes && \ + test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; + esac + fi + fi + fi + + if test "$linkmode" = prog || test "$mode" = relink; then + add_shlibpath= + add_dir= + add= + # Finalize command for both is simple: just hardcode it. + if test "$hardcode_direct" = yes; then + add="$libdir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$libdir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; + esac + add="-l$name" + elif test "$hardcode_automatic" = yes; then + if test -n "$inst_prefix_dir" && + test -f "$inst_prefix_dir$libdir/$linklib" ; then + add="$inst_prefix_dir$libdir/$linklib" + else + add="$libdir/$linklib" + fi + else + # We cannot seem to hardcode it, guess we'll fake it. + add_dir="-L$libdir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case "$libdir" in + [\\/]*) + add_dir="$add_dir -L$inst_prefix_dir$libdir" + ;; + esac + fi + add="-l$name" + fi + + if test "$linkmode" = prog; then + test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" + test -n "$add" && finalize_deplibs="$add $finalize_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + fi + fi + elif test "$linkmode" = prog; then + # Here we assume that one of hardcode_direct or hardcode_minus_L + # is not unsupported. This is valid on all known static and + # shared platforms. + if test "$hardcode_direct" != unsupported; then + test -n "$old_library" && linklib="$old_library" + compile_deplibs="$dir/$linklib $compile_deplibs" + finalize_deplibs="$dir/$linklib $finalize_deplibs" + else + compile_deplibs="-l$name -L$dir $compile_deplibs" + finalize_deplibs="-l$name -L$dir $finalize_deplibs" + fi + elif test "$build_libtool_libs" = yes; then + # Not a shared library + if test "$deplibs_check_method" != pass_all; then + # We're trying link a shared library against a static one + # but the system doesn't support it. + + # Just print a warning and add the library to dependency_libs so + # that the program can be linked against the static library. + $echo + $echo "*** Warning: This system can not link to static lib archive $lib." + $echo "*** I have the capability to make that library automatically link in when" + $echo "*** you link to this library. But I can only do this if you have a" + $echo "*** shared version of the library, which you do not appear to have." + if test "$module" = yes; then + $echo "*** But as you try to build a module library, libtool will still create " + $echo "*** a static module, that should work as long as the dlopening application" + $echo "*** is linked with the -dlopen flag to resolve symbols at runtime." + if test -z "$global_symbol_pipe"; then + $echo + $echo "*** However, this would only work if libtool was able to extract symbol" + $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + $echo "*** not find such a program. So, this module is probably useless." + $echo "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + else + convenience="$convenience $dir/$old_library" + old_convenience="$old_convenience $dir/$old_library" + deplibs="$dir/$old_library $deplibs" + link_static=yes + fi + fi # link shared/static library? + + if test "$linkmode" = lib; then + if test -n "$dependency_libs" && + { test "$hardcode_into_libs" != yes || + test "$build_old_libs" = yes || + test "$link_static" = yes; }; then + # Extract -R from dependency_libs + temp_deplibs= + for libdir in $dependency_libs; do + case $libdir in + -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` + case " $xrpath " in + *" $temp_xrpath "*) ;; + *) xrpath="$xrpath $temp_xrpath";; + esac;; + *) temp_deplibs="$temp_deplibs $libdir";; + esac + done + dependency_libs="$temp_deplibs" + fi + + newlib_search_path="$newlib_search_path $absdir" + # Link against this library + test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" + # ... and its dependency_libs + tmp_libs= + for deplib in $dependency_libs; do + newdependency_libs="$deplib $newdependency_libs" + if test "X$duplicate_deps" = "Xyes" ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$tmp_libs $deplib" + done + + if test "$link_all_deplibs" != no; then + # Add the search paths of all dependency libraries + for deplib in $dependency_libs; do + case $deplib in + -L*) path="$deplib" ;; + *.la) + dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` + test "X$dir" = "X$deplib" && dir="." + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 + absdir="$dir" + fi + ;; + esac + if grep "^installed=no" $deplib > /dev/null; then + path="$absdir/$objdir" + else + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + if test -z "$libdir"; then + $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 + exit $EXIT_FAILURE + fi + if test "$absdir" != "$libdir"; then + $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 + fi + path="$absdir" + fi + depdepl= + case $host in + *-*-darwin*) + # we do not want to link against static libs, + # but need to link against shared + eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` + if test -n "$deplibrary_names" ; then + for tmp in $deplibrary_names ; do + depdepl=$tmp + done + if test -f "$path/$depdepl" ; then + depdepl="$path/$depdepl" + fi + # do not add paths which are already there + case " $newlib_search_path " in + *" $path "*) ;; + *) newlib_search_path="$newlib_search_path $path";; + esac + fi + path="" + ;; + *) + path="-L$path" + ;; + esac + ;; + -l*) + case $host in + *-*-darwin*) + # Again, we only want to link against shared libraries + eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` + for tmp in $newlib_search_path ; do + if test -f "$tmp/lib$tmp_libs.dylib" ; then + eval depdepl="$tmp/lib$tmp_libs.dylib" + break + fi + done + path="" + ;; + *) continue ;; + esac + ;; + *) continue ;; + esac + case " $deplibs " in + *" $path "*) ;; + *) deplibs="$path $deplibs" ;; + esac + case " $deplibs " in + *" $depdepl "*) ;; + *) deplibs="$depdepl $deplibs" ;; + esac + done + fi # link_all_deplibs != no + fi # linkmode = lib + done # for deplib in $libs + dependency_libs="$newdependency_libs" + if test "$pass" = dlpreopen; then + # Link the dlpreopened libraries before other libraries + for deplib in $save_deplibs; do + deplibs="$deplib $deplibs" + done + fi + if test "$pass" != dlopen; then + if test "$pass" != conv; then + # Make sure lib_search_path contains only unique directories. + lib_search_path= + for dir in $newlib_search_path; do + case "$lib_search_path " in + *" $dir "*) ;; + *) lib_search_path="$lib_search_path $dir" ;; + esac + done + newlib_search_path= + fi + + if test "$linkmode,$pass" != "prog,link"; then + vars="deplibs" + else + vars="compile_deplibs finalize_deplibs" + fi + for var in $vars dependency_libs; do + # Add libraries to $var in reverse order + eval tmp_libs=\"\$$var\" + new_libs= + for deplib in $tmp_libs; do + # FIXME: Pedantically, this is the right thing to do, so + # that some nasty dependency loop isn't accidentally + # broken: + #new_libs="$deplib $new_libs" + # Pragmatically, this seems to cause very few problems in + # practice: + case $deplib in + -L*) new_libs="$deplib $new_libs" ;; + -R*) ;; + *) + # And here is the reason: when a library appears more + # than once as an explicit dependence of a library, or + # is implicitly linked in more than once by the + # compiler, it is considered special, and multiple + # occurrences thereof are not removed. Compare this + # with having the same library being listed as a + # dependency of multiple other libraries: in this case, + # we know (pedantically, we assume) the library does not + # need to be listed more than once, so we keep only the + # last copy. This is not always right, but it is rare + # enough that we require users that really mean to play + # such unportable linking tricks to link the library + # using -Wl,-lname, so that libtool does not consider it + # for duplicate removal. + case " $specialdeplibs " in + *" $deplib "*) new_libs="$deplib $new_libs" ;; + *) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$deplib $new_libs" ;; + esac + ;; + esac + ;; + esac + done + tmp_libs= + for deplib in $new_libs; do + case $deplib in + -L*) + case " $tmp_libs " in + *" $deplib "*) ;; + *) tmp_libs="$tmp_libs $deplib" ;; + esac + ;; + *) tmp_libs="$tmp_libs $deplib" ;; + esac + done + eval $var=\"$tmp_libs\" + done # for var + fi + # Last step: remove runtime libs from dependency_libs + # (they stay in deplibs) + tmp_libs= + for i in $dependency_libs ; do + case " $predeps $postdeps $compiler_lib_search_path " in + *" $i "*) + i="" + ;; + esac + if test -n "$i" ; then + tmp_libs="$tmp_libs $i" + fi + done + dependency_libs=$tmp_libs + done # for pass + if test "$linkmode" = prog; then + dlfiles="$newdlfiles" + dlprefiles="$newdlprefiles" + fi + + case $linkmode in + oldlib) + if test -n "$deplibs"; then + $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 + fi + + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 + fi + + if test -n "$rpath"; then + $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 + fi + + if test -n "$xrpath"; then + $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 + fi + + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 + fi + + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then + $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 + fi + + # Now set the variables for building old libraries. + build_libtool_libs=no + oldlibs="$output" + objs="$objs$old_deplibs" + ;; + + lib) + # Make sure we only generate libraries of the form `libNAME.la'. + case $outputname in + lib*) + name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + ;; + *) + if test "$module" = no; then + $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + if test "$need_lib_prefix" != no; then + # Add the "lib" prefix for modules if required + name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + else + libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` + fi + ;; + esac + + if test -n "$objs"; then + if test "$deplibs_check_method" != pass_all; then + $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 + exit $EXIT_FAILURE + else + $echo + $echo "*** Warning: Linking the shared library $output against the non-libtool" + $echo "*** objects $objs is not portable!" + libobjs="$libobjs $objs" + fi + fi + + if test "$dlself" != no; then + $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 + fi + + set dummy $rpath + if test "$#" -gt 2; then + $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 + fi + install_libdir="$2" + + oldlibs= + if test -z "$rpath"; then + if test "$build_libtool_libs" = yes; then + # Building a libtool convenience library. + # Some compilers have problems with a `.al' extension so + # convenience libraries should have the same extension an + # archive normally would. + oldlibs="$output_objdir/$libname.$libext $oldlibs" + build_libtool_libs=convenience + build_old_libs=yes + fi + + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 + fi + else + + # Parse the version information argument. + save_ifs="$IFS"; IFS=':' + set dummy $vinfo 0 0 0 + IFS="$save_ifs" + + if test -n "$8"; then + $echo "$modename: too many parameters to \`-version-info'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # convert absolute version numbers to libtool ages + # this retains compatibility with .la files and attempts + # to make the code below a bit more comprehensible + + case $vinfo_number in + yes) + number_major="$2" + number_minor="$3" + number_revision="$4" + # + # There are really only two kinds -- those that + # use the current revision as the major version + # and those that subtract age and use age as + # a minor version. But, then there is irix + # which has an extra 1 added just for fun + # + case $version_type in + darwin|linux|osf|windows) + current=`expr $number_major + $number_minor` + age="$number_minor" + revision="$number_revision" + ;; + freebsd-aout|freebsd-elf|sunos) + current="$number_major" + revision="$number_minor" + age="0" + ;; + irix|nonstopux) + current=`expr $number_major + $number_minor - 1` + age="$number_minor" + revision="$number_minor" + ;; + esac + ;; + no) + current="$2" + revision="$3" + age="$4" + ;; + esac + + # Check that each of the things are valid numbers. + case $current in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + case $revision in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + case $age in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + if test "$age" -gt "$current"; then + $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit $EXIT_FAILURE + fi + + # Calculate the version variables. + major= + versuffix= + verstring= + case $version_type in + none) ;; + + darwin) + # Like Linux, but with the current version available in + # verstring for coding it into the library header + major=.`expr $current - $age` + versuffix="$major.$age.$revision" + # Darwin ld doesn't like 0 for these options... + minor_current=`expr $current + 1` + verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" + ;; + + freebsd-aout) + major=".$current" + versuffix=".$current.$revision"; + ;; + + freebsd-elf) + major=".$current" + versuffix=".$current"; + ;; + + irix | nonstopux) + major=`expr $current - $age + 1` + + case $version_type in + nonstopux) verstring_prefix=nonstopux ;; + *) verstring_prefix=sgi ;; + esac + verstring="$verstring_prefix$major.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$revision + while test "$loop" -ne 0; do + iface=`expr $revision - $loop` + loop=`expr $loop - 1` + verstring="$verstring_prefix$major.$iface:$verstring" + done + + # Before this point, $major must not contain `.'. + major=.$major + versuffix="$major.$revision" + ;; + + linux) + major=.`expr $current - $age` + versuffix="$major.$age.$revision" + ;; + + osf) + major=.`expr $current - $age` + versuffix=".$current.$age.$revision" + verstring="$current.$age.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$age + while test "$loop" -ne 0; do + iface=`expr $current - $loop` + loop=`expr $loop - 1` + verstring="$verstring:${iface}.0" + done + + # Make executables depend on our current version. + verstring="$verstring:${current}.0" + ;; + + sunos) + major=".$current" + versuffix=".$current.$revision" + ;; + + windows) + # Use '-' rather than '.', since we only want one + # extension on DOS 8.3 filesystems. + major=`expr $current - $age` + versuffix="-$major" + ;; + + *) + $echo "$modename: unknown library version type \`$version_type'" 1>&2 + $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 + exit $EXIT_FAILURE + ;; + esac + + # Clear the version info if we defaulted, and they specified a release. + if test -z "$vinfo" && test -n "$release"; then + major= + case $version_type in + darwin) + # we can't check for "0.0" in archive_cmds due to quoting + # problems, so we reset it completely + verstring= + ;; + *) + verstring="0.0" + ;; + esac + if test "$need_version" = no; then + versuffix= + else + versuffix=".0.0" + fi + fi + + # Remove version info from name if versioning should be avoided + if test "$avoid_version" = yes && test "$need_version" = no; then + major= + versuffix= + verstring="" + fi + + # Check to see if the archive will have undefined symbols. + if test "$allow_undefined" = yes; then + if test "$allow_undefined_flag" = unsupported; then + $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 + build_libtool_libs=no + build_old_libs=yes + fi + else + # Don't allow undefined symbols. + allow_undefined_flag="$no_undefined_flag" + fi + fi + + if test "$mode" != relink; then + # Remove our outputs, but don't remove object files since they + # may have been created when compiling PIC objects. + removelist= + tempremovelist=`$echo "$output_objdir/*"` + for p in $tempremovelist; do + case $p in + *.$objext) + ;; + $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) + if test "X$precious_files_regex" != "X"; then + if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 + then + continue + fi + fi + removelist="$removelist $p" + ;; + *) ;; + esac + done + if test -n "$removelist"; then + $show "${rm}r $removelist" + $run ${rm}r $removelist + fi + fi + + # Now set the variables for building old libraries. + if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then + oldlibs="$oldlibs $output_objdir/$libname.$libext" + + # Transform .lo files to .o files. + oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` + fi + + # Eliminate all temporary directories. + for path in $notinst_path; do + lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'` + deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'` + dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'` + done + + if test -n "$xrpath"; then + # If the user specified any rpath flags, then add them. + temp_xrpath= + for libdir in $xrpath; do + temp_xrpath="$temp_xrpath -R$libdir" + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" ;; + esac + done + if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then + dependency_libs="$temp_xrpath $dependency_libs" + fi + fi + + # Make sure dlfiles contains only unique files that won't be dlpreopened + old_dlfiles="$dlfiles" + dlfiles= + for lib in $old_dlfiles; do + case " $dlprefiles $dlfiles " in + *" $lib "*) ;; + *) dlfiles="$dlfiles $lib" ;; + esac + done + + # Make sure dlprefiles contains only unique files + old_dlprefiles="$dlprefiles" + dlprefiles= + for lib in $old_dlprefiles; do + case "$dlprefiles " in + *" $lib "*) ;; + *) dlprefiles="$dlprefiles $lib" ;; + esac + done + + if test "$build_libtool_libs" = yes; then + if test -n "$rpath"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) + # these systems don't actually have a c library (as such)! + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C library is in the System framework + deplibs="$deplibs -framework System" + ;; + *-*-netbsd*) + # Don't link with libc until the a.out ld.so is fixed. + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + test "X$arg" = "X-lc" && continue + ;; + *) + # Add libc to deplibs on all other systems if necessary. + if test "$build_libtool_need_lc" = "yes"; then + deplibs="$deplibs -lc" + fi + ;; + esac + fi + + # Transform deplibs into only deplibs that can be linked in shared. + name_save=$name + libname_save=$libname + release_save=$release + versuffix_save=$versuffix + major_save=$major + # I'm not sure if I'm treating the release correctly. I think + # release should show up in the -l (ie -lgmp5) so we don't want to + # add it in twice. Is that correct? + release="" + versuffix="" + major="" + newdeplibs= + droppeddeps=no + case $deplibs_check_method in + pass_all) + # Don't check for shared/static. Everything works. + # This might be a little naive. We might want to check + # whether the library exists or not. But this is on + # osf3 & osf4 and I'm not really sure... Just + # implementing what was already the behavior. + newdeplibs=$deplibs + ;; + test_compile) + # This code stresses the "libraries are programs" paradigm to its + # limits. Maybe even breaks it. We compile a program, linking it + # against the deplibs as a proxy for the library. Then we can check + # whether they linked in statically or dynamically with ldd. + $rm conftest.c + cat > conftest.c </dev/null` + for potent_lib in $potential_libs; do + # Follow soft links. + if ls -lLd "$potent_lib" 2>/dev/null \ + | grep " -> " >/dev/null; then + continue + fi + # The statement above tries to avoid entering an + # endless loop below, in case of cyclic links. + # We might still enter an endless loop, since a link + # loop can be closed while we follow links, + # but so what? + potlib="$potent_lib" + while test -h "$potlib" 2>/dev/null; do + potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` + case $potliblink in + [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; + *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; + esac + done + # It is ok to link against an archive when + # building a shared library. + if $AR -t $potlib > /dev/null 2>&1; then + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + break 2 + fi + if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ + | ${SED} 10q \ + | $EGREP "$file_magic_regex" > /dev/null; then + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + break 2 + fi + done + done + fi + if test -n "$a_deplib" ; then + droppeddeps=yes + $echo + $echo "*** Warning: linker path does not have real file for library $a_deplib." + $echo "*** I have the capability to make that library automatically link in when" + $echo "*** you link to this library. But I can only do this if you have a" + $echo "*** shared version of the library, which you do not appear to have" + $echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib" ; then + $echo "*** with $libname but no candidates were found. (...for file magic test)" + else + $echo "*** with $libname and none of the candidates passed a file format test" + $echo "*** using a file magic. Last file checked: $potlib" + fi + fi + else + # Add a -L argument. + newdeplibs="$newdeplibs $a_deplib" + fi + done # Gone through all deplibs. + ;; + match_pattern*) + set dummy $deplibs_check_method + match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` + for a_deplib in $deplibs; do + name="`expr $a_deplib : '-l\(.*\)'`" + # If $name is empty we are operating on a -L argument. + if test -n "$name" && test "$name" != "0"; then + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $a_deplib "*) + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + ;; + esac + fi + if test -n "$a_deplib" ; then + libname=`eval \\$echo \"$libname_spec\"` + for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do + potential_libs=`ls $i/$libname[.-]* 2>/dev/null` + for potent_lib in $potential_libs; do + potlib="$potent_lib" # see symlink-check above in file_magic test + if eval $echo \"$potent_lib\" 2>/dev/null \ + | ${SED} 10q \ + | $EGREP "$match_pattern_regex" > /dev/null; then + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + break 2 + fi + done + done + fi + if test -n "$a_deplib" ; then + droppeddeps=yes + $echo + $echo "*** Warning: linker path does not have real file for library $a_deplib." + $echo "*** I have the capability to make that library automatically link in when" + $echo "*** you link to this library. But I can only do this if you have a" + $echo "*** shared version of the library, which you do not appear to have" + $echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib" ; then + $echo "*** with $libname but no candidates were found. (...for regex pattern test)" + else + $echo "*** with $libname and none of the candidates passed a file format test" + $echo "*** using a regex pattern. Last file checked: $potlib" + fi + fi + else + # Add a -L argument. + newdeplibs="$newdeplibs $a_deplib" + fi + done # Gone through all deplibs. + ;; + none | unknown | *) + newdeplibs="" + tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ + -e 's/ -[LR][^ ]*//g'` + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + for i in $predeps $postdeps ; do + # can't use Xsed below, because $i might contain '/' + tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` + done + fi + if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ + | grep . >/dev/null; then + $echo + if test "X$deplibs_check_method" = "Xnone"; then + $echo "*** Warning: inter-library dependencies are not supported in this platform." + else + $echo "*** Warning: inter-library dependencies are not known to be supported." + fi + $echo "*** All declared inter-library dependencies are being dropped." + droppeddeps=yes + fi + ;; + esac + versuffix=$versuffix_save + major=$major_save + release=$release_save + libname=$libname_save + name=$name_save + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library is the System framework + newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` + ;; + esac + + if test "$droppeddeps" = yes; then + if test "$module" = yes; then + $echo + $echo "*** Warning: libtool could not satisfy all declared inter-library" + $echo "*** dependencies of module $libname. Therefore, libtool will create" + $echo "*** a static module, that should work as long as the dlopening" + $echo "*** application is linked with the -dlopen flag." + if test -z "$global_symbol_pipe"; then + $echo + $echo "*** However, this would only work if libtool was able to extract symbol" + $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + $echo "*** not find such a program. So, this module is probably useless." + $echo "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + else + $echo "*** The inter-library dependencies that have been dropped here will be" + $echo "*** automatically added whenever a program is linked with this library" + $echo "*** or is declared to -dlopen it." + + if test "$allow_undefined" = no; then + $echo + $echo "*** Since this library must not contain undefined symbols," + $echo "*** because either the platform does not support them or" + $echo "*** it was explicitly requested with -no-undefined," + $echo "*** libtool will only create a static version of it." + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + fi + fi + # Done checking deplibs! + deplibs=$newdeplibs + fi + + # All the library-specific variables (install_libdir is set above). + library_names= + old_library= + dlname= + + # Test again, we may have decided not to build it any more + if test "$build_libtool_libs" = yes; then + if test "$hardcode_into_libs" = yes; then + # Hardcode the library paths + hardcode_libdirs= + dep_rpath= + rpath="$finalize_rpath" + test "$mode" != relink && rpath="$compile_rpath$rpath" + for libdir in $rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + dep_rpath="$dep_rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) perm_rpath="$perm_rpath $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + if test -n "$hardcode_libdir_flag_spec_ld"; then + eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" + else + eval dep_rpath=\"$hardcode_libdir_flag_spec\" + fi + fi + if test -n "$runpath_var" && test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + rpath="$rpath$dir:" + done + eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" + fi + test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" + fi + + shlibpath="$finalize_shlibpath" + test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" + if test -n "$shlibpath"; then + eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" + fi + + # Get the real and link names of the library. + eval shared_ext=\"$shrext_cmds\" + eval library_names=\"$library_names_spec\" + set dummy $library_names + realname="$2" + shift; shift + + if test -n "$soname_spec"; then + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + if test -z "$dlname"; then + dlname=$soname + fi + + lib="$output_objdir/$realname" + for link + do + linknames="$linknames $link" + done + + # Use standard objects if they are pic + test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then + $show "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $run $rm $export_symbols + cmds=$export_symbols_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + if len=`expr "X$cmd" : ".*"` && + test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then + $show "$cmd" + $run eval "$cmd" || exit $? + skipped_export=false + else + # The command line is too long to execute in one step. + $show "using reloadable object file for export list..." + skipped_export=: + fi + done + IFS="$save_ifs" + if test -n "$export_symbols_regex"; then + $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" + $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + $show "$mv \"${export_symbols}T\" \"$export_symbols\"" + $run eval '$mv "${export_symbols}T" "$export_symbols"' + fi + fi + fi + + if test -n "$export_symbols" && test -n "$include_expsyms"; then + $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' + fi + + tmp_deplibs= + for test_deplib in $deplibs; do + case " $convenience " in + *" $test_deplib "*) ;; + *) + tmp_deplibs="$tmp_deplibs $test_deplib" + ;; + esac + done + deplibs="$tmp_deplibs" + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + else + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + func_extract_archives $gentop $convenience + libobjs="$libobjs $func_extract_archives_result" + fi + fi + + if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then + eval flag=\"$thread_safe_flag_spec\" + linker_flags="$linker_flags $flag" + fi + + # Make a backup of the uninstalled library when relinking + if test "$mode" = relink; then + $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? + fi + + # Do each of the archive commands. + if test "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + eval test_cmds=\"$module_expsym_cmds\" + cmds=$module_expsym_cmds + else + eval test_cmds=\"$module_cmds\" + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + eval test_cmds=\"$archive_expsym_cmds\" + cmds=$archive_expsym_cmds + else + eval test_cmds=\"$archive_cmds\" + cmds=$archive_cmds + fi + fi + + if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` && + test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then + : + else + # The command line is too long to link in one step, link piecewise. + $echo "creating reloadable object files..." + + # Save the value of $output and $libobjs because we want to + # use them later. If we have whole_archive_flag_spec, we + # want to use save_libobjs as it was before + # whole_archive_flag_spec was expanded, because we can't + # assume the linker understands whole_archive_flag_spec. + # This may have to be revisited, in case too many + # convenience libraries get linked in and end up exceeding + # the spec. + if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + fi + save_output=$output + output_la=`$echo "X$output" | $Xsed -e "$basename"` + + # Clear the reloadable object creation command queue and + # initialize k to one. + test_cmds= + concat_cmds= + objlist= + delfiles= + last_robj= + k=1 + output=$output_objdir/$output_la-${k}.$objext + # Loop over the list of objects to be linked. + for obj in $save_libobjs + do + eval test_cmds=\"$reload_cmds $objlist $last_robj\" + if test "X$objlist" = X || + { len=`expr "X$test_cmds" : ".*"` && + test "$len" -le "$max_cmd_len"; }; then + objlist="$objlist $obj" + else + # The command $test_cmds is almost too long, add a + # command to the queue. + if test "$k" -eq 1 ; then + # The first file doesn't have a previous command to add. + eval concat_cmds=\"$reload_cmds $objlist $last_robj\" + else + # All subsequent reloadable object files will link in + # the last one created. + eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" + fi + last_robj=$output_objdir/$output_la-${k}.$objext + k=`expr $k + 1` + output=$output_objdir/$output_la-${k}.$objext + objlist=$obj + len=1 + fi + done + # Handle the remaining objects by creating one last + # reloadable object file. All subsequent reloadable object + # files will link in the last one created. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" + + if ${skipped_export-false}; then + $show "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $run $rm $export_symbols + libobjs=$output + # Append the command to create the export file. + eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" + fi + + # Set up a command to remove the reloadable object files + # after they are used. + i=0 + while test "$i" -lt "$k" + do + i=`expr $i + 1` + delfiles="$delfiles $output_objdir/$output_la-${i}.$objext" + done + + $echo "creating a temporary reloadable object file: $output" + + # Loop through the commands generated above and execute them. + save_ifs="$IFS"; IFS='~' + for cmd in $concat_cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + + libobjs=$output + # Restore the value of output. + output=$save_output + + if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + fi + # Expand the library linking commands again to reset the + # value of $libobjs for piecewise linking. + + # Do each of the archive commands. + if test "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + cmds=$module_expsym_cmds + else + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + cmds=$archive_expsym_cmds + else + cmds=$archive_cmds + fi + fi + + # Append the command to remove the reloadable object files + # to the just-reset $cmds. + eval cmds=\"\$cmds~\$rm $delfiles\" + fi + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + + # Restore the uninstalled library and exit + if test "$mode" = relink; then + $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? + exit $EXIT_SUCCESS + fi + + # Create links to the real library. + for linkname in $linknames; do + if test "$realname" != "$linkname"; then + $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" + $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? + fi + done + + # If -module or -export-dynamic was specified, set the dlname. + if test "$module" = yes || test "$export_dynamic" = yes; then + # On all known operating systems, these are identical. + dlname="$soname" + fi + fi + ;; + + obj) + if test -n "$deplibs"; then + $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 + fi + + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 + fi + + if test -n "$rpath"; then + $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 + fi + + if test -n "$xrpath"; then + $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 + fi + + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 + fi + + case $output in + *.lo) + if test -n "$objs$old_deplibs"; then + $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 + exit $EXIT_FAILURE + fi + libobj="$output" + obj=`$echo "X$output" | $Xsed -e "$lo2o"` + ;; + *) + libobj= + obj="$output" + ;; + esac + + # Delete the old objects. + $run $rm $obj $libobj + + # Objects from convenience libraries. This assumes + # single-version convenience libraries. Whenever we create + # different ones for PIC/non-PIC, this we'll have to duplicate + # the extraction. + reload_conv_objs= + gentop= + # reload_cmds runs $LD directly, so let us get rid of + # -Wl from whole_archive_flag_spec + wl= + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" + else + gentop="$output_objdir/${obj}x" + generated="$generated $gentop" + + func_extract_archives $gentop $convenience + reload_conv_objs="$reload_objs $func_extract_archives_result" + fi + fi + + # Create the old-style object. + reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test + + output="$obj" + cmds=$reload_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + + # Exit if we aren't doing a library object file. + if test -z "$libobj"; then + if test -n "$gentop"; then + $show "${rm}r $gentop" + $run ${rm}r $gentop + fi + + exit $EXIT_SUCCESS + fi + + if test "$build_libtool_libs" != yes; then + if test -n "$gentop"; then + $show "${rm}r $gentop" + $run ${rm}r $gentop + fi + + # Create an invalid libtool object if no PIC, so that we don't + # accidentally link it into a program. + # $show "echo timestamp > $libobj" + # $run eval "echo timestamp > $libobj" || exit $? + exit $EXIT_SUCCESS + fi + + if test -n "$pic_flag" || test "$pic_mode" != default; then + # Only do commands if we really have different PIC objects. + reload_objs="$libobjs $reload_conv_objs" + output="$libobj" + cmds=$reload_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + fi + + if test -n "$gentop"; then + $show "${rm}r $gentop" + $run ${rm}r $gentop + fi + + exit $EXIT_SUCCESS + ;; + + prog) + case $host in + *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; + esac + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 + fi + + if test "$preload" = yes; then + if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && + test "$dlopen_self_static" = unknown; then + $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." + fi + fi + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library is the System framework + compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` + finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` + ;; + esac + + case $host in + *darwin*) + # Don't allow lazy linking, it breaks C++ global constructors + if test "$tagname" = CXX ; then + compile_command="$compile_command ${wl}-bind_at_load" + finalize_command="$finalize_command ${wl}-bind_at_load" + fi + ;; + esac + + compile_command="$compile_command $compile_deplibs" + finalize_command="$finalize_command $finalize_deplibs" + + if test -n "$rpath$xrpath"; then + # If the user specified any rpath flags, then add them. + for libdir in $rpath $xrpath; do + # This is the magic to use -rpath. + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" ;; + esac + done + fi + + # Now hardcode the library paths + rpath= + hardcode_libdirs= + for libdir in $compile_rpath $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + rpath="$rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) perm_rpath="$perm_rpath $libdir" ;; + esac + fi + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) + case :$dllsearchpath: in + *":$libdir:"*) ;; + *) dllsearchpath="$dllsearchpath:$libdir";; + esac + ;; + esac + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + compile_rpath="$rpath" + + rpath= + hardcode_libdirs= + for libdir in $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + rpath="$rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$finalize_perm_rpath " in + *" $libdir "*) ;; + *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + finalize_rpath="$rpath" + + if test -n "$libobjs" && test "$build_old_libs" = yes; then + # Transform all the library objects into standard objects. + compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + fi + + dlsyms= + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + if test -n "$NM" && test -n "$global_symbol_pipe"; then + dlsyms="${outputname}S.c" + else + $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 + fi + fi + + if test -n "$dlsyms"; then + case $dlsyms in + "") ;; + *.c) + # Discover the nlist of each of the dlfiles. + nlist="$output_objdir/${outputname}.nm" + + $show "$rm $nlist ${nlist}S ${nlist}T" + $run $rm "$nlist" "${nlist}S" "${nlist}T" + + # Parse the name list into a source file. + $show "creating $output_objdir/$dlsyms" + + test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ +/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ +/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ + +#ifdef __cplusplus +extern \"C\" { +#endif + +/* Prevent the only kind of declaration conflicts we can make. */ +#define lt_preloaded_symbols some_other_symbol + +/* External symbol declarations for the compiler. */\ +" + + if test "$dlself" = yes; then + $show "generating symbol list for \`$output'" + + test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" + + # Add our own program objects to the symbol list. + progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + for arg in $progfiles; do + $show "extracting global C symbols from \`$arg'" + $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" + done + + if test -n "$exclude_expsyms"; then + $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' + $run eval '$mv "$nlist"T "$nlist"' + fi + + if test -n "$export_symbols_regex"; then + $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' + $run eval '$mv "$nlist"T "$nlist"' + fi + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + export_symbols="$output_objdir/$outputname.exp" + $run $rm $export_symbols + $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' + else + $run eval "${SED} -e 's/\([ ][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' + $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' + $run eval 'mv "$nlist"T "$nlist"' + fi + fi + + for arg in $dlprefiles; do + $show "extracting global C symbols from \`$arg'" + name=`$echo "$arg" | ${SED} -e 's%^.*/%%'` + $run eval '$echo ": $name " >> "$nlist"' + $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" + done + + if test -z "$run"; then + # Make sure we have at least an empty file. + test -f "$nlist" || : > "$nlist" + + if test -n "$exclude_expsyms"; then + $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T + $mv "$nlist"T "$nlist" + fi + + # Try sorting and uniquifying the output. + if grep -v "^: " < "$nlist" | + if sort -k 3 /dev/null 2>&1; then + sort -k 3 + else + sort +2 + fi | + uniq > "$nlist"S; then + : + else + grep -v "^: " < "$nlist" > "$nlist"S + fi + + if test -f "$nlist"S; then + eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' + else + $echo '/* NONE */' >> "$output_objdir/$dlsyms" + fi + + $echo >> "$output_objdir/$dlsyms" "\ + +#undef lt_preloaded_symbols + +#if defined (__STDC__) && __STDC__ +# define lt_ptr void * +#else +# define lt_ptr char * +# define const +#endif + +/* The mapping between symbol names and symbols. */ +" + + case $host in + *cygwin* | *mingw* ) + $echo >> "$output_objdir/$dlsyms" "\ +/* DATA imports from DLLs on WIN32 can't be const, because + runtime relocations are performed -- see ld's documentation + on pseudo-relocs */ +struct { +" + ;; + * ) + $echo >> "$output_objdir/$dlsyms" "\ +const struct { +" + ;; + esac + + + $echo >> "$output_objdir/$dlsyms" "\ + const char *name; + lt_ptr address; +} +lt_preloaded_symbols[] = +{\ +" + + eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" + + $echo >> "$output_objdir/$dlsyms" "\ + {0, (lt_ptr) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif\ +" + fi + + pic_flag_for_symtable= + case $host in + # compiling the symbol table file with pic_flag works around + # a FreeBSD bug that causes programs to crash when -lm is + # linked before any other PIC object. But we must not use + # pic_flag when linking with -static. The problem exists in + # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. + *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) + case "$compile_command " in + *" -static "*) ;; + *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; + esac;; + *-*-hpux*) + case "$compile_command " in + *" -static "*) ;; + *) pic_flag_for_symtable=" $pic_flag";; + esac + esac + + # Now compile the dynamic symbol file. + $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" + $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? + + # Clean up the generated files. + $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" + $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" + + # Transform the symbol file into the correct name. + compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` + finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` + ;; + *) + $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 + exit $EXIT_FAILURE + ;; + esac + else + # We keep going just in case the user didn't refer to + # lt_preloaded_symbols. The linker will fail if global_symbol_pipe + # really was required. + + # Nullify the symbol file. + compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` + finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` + fi + + if test "$need_relink" = no || test "$build_libtool_libs" != yes; then + # Replace the output file specification. + compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` + link_command="$compile_command$compile_rpath" + + # We have no uninstalled library dependencies, so finalize right now. + $show "$link_command" + $run eval "$link_command" + status=$? + + # Delete the generated files. + if test -n "$dlsyms"; then + $show "$rm $output_objdir/${outputname}S.${objext}" + $run $rm "$output_objdir/${outputname}S.${objext}" + fi + + exit $status + fi + + if test -n "$shlibpath_var"; then + # We should set the shlibpath_var + rpath= + for dir in $temp_rpath; do + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) + # Absolute path. + rpath="$rpath$dir:" + ;; + *) + # Relative path: add a thisdir entry. + rpath="$rpath\$thisdir/$dir:" + ;; + esac + done + temp_rpath="$rpath" + fi + + if test -n "$compile_shlibpath$finalize_shlibpath"; then + compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" + fi + if test -n "$finalize_shlibpath"; then + finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" + fi + + compile_var= + finalize_var= + if test -n "$runpath_var"; then + if test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + rpath="$rpath$dir:" + done + compile_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + if test -n "$finalize_perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $finalize_perm_rpath; do + rpath="$rpath$dir:" + done + finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + fi + + if test "$no_install" = yes; then + # We don't need to create a wrapper script. + link_command="$compile_var$compile_command$compile_rpath" + # Replace the output file specification. + link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` + # Delete the old output file. + $run $rm $output + # Link the executable and exit + $show "$link_command" + $run eval "$link_command" || exit $? + exit $EXIT_SUCCESS + fi + + if test "$hardcode_action" = relink; then + # Fast installation is not supported + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + + $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 + $echo "$modename: \`$output' will be relinked during installation" 1>&2 + else + if test "$fast_install" != no; then + link_command="$finalize_var$compile_command$finalize_rpath" + if test "$fast_install" = yes; then + relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` + else + # fast_install is set to needless + relink_command= + fi + else + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + fi + fi + + # Replace the output file specification. + link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` + + # Delete the old output files. + $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname + + $show "$link_command" + $run eval "$link_command" || exit $? + + # Now create the wrapper script. + $show "creating $output" + + # Quote the relink command for shipping. + if test -n "$relink_command"; then + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` + relink_command="$var=\"$var_value\"; export $var; $relink_command" + fi + done + relink_command="(cd `pwd`; $relink_command)" + relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` + fi + + # Quote $echo for shipping. + if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then + case $progpath in + [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; + *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; + esac + qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` + else + qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` + fi + + # Only actually do things if our run command is non-null. + if test -z "$run"; then + # win32 will think the script is a binary if it has + # a .exe suffix, so we strip it off here. + case $output in + *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;; + esac + # test for cygwin because mv fails w/o .exe extensions + case $host in + *cygwin*) + exeext=.exe + outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; + *) exeext= ;; + esac + case $host in + *cygwin* | *mingw* ) + cwrappersource=`$echo ${objdir}/lt-${outputname}.c` + cwrapper=`$echo ${output}.exe` + $rm $cwrappersource $cwrapper + trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 + + cat > $cwrappersource <> $cwrappersource<<"EOF" +#include +#include +#include +#include +#include +#include + +#if defined(PATH_MAX) +# define LT_PATHMAX PATH_MAX +#elif defined(MAXPATHLEN) +# define LT_PATHMAX MAXPATHLEN +#else +# define LT_PATHMAX 1024 +#endif + +#ifndef DIR_SEPARATOR +#define DIR_SEPARATOR '/' +#endif + +#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ + defined (__OS2__) +#define HAVE_DOS_BASED_FILE_SYSTEM +#ifndef DIR_SEPARATOR_2 +#define DIR_SEPARATOR_2 '\\' +#endif +#endif + +#ifndef DIR_SEPARATOR_2 +# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) +#else /* DIR_SEPARATOR_2 */ +# define IS_DIR_SEPARATOR(ch) \ + (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) +#endif /* DIR_SEPARATOR_2 */ + +#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) +#define XFREE(stale) do { \ + if (stale) { free ((void *) stale); stale = 0; } \ +} while (0) + +const char *program_name = NULL; + +void * xmalloc (size_t num); +char * xstrdup (const char *string); +char * basename (const char *name); +char * fnqualify(const char *path); +char * strendzap(char *str, const char *pat); +void lt_fatal (const char *message, ...); + +int +main (int argc, char *argv[]) +{ + char **newargz; + int i; + + program_name = (char *) xstrdup ((char *) basename (argv[0])); + newargz = XMALLOC(char *, argc+2); +EOF + + cat >> $cwrappersource <> $cwrappersource <<"EOF" + newargz[1] = fnqualify(argv[0]); + /* we know the script has the same name, without the .exe */ + /* so make sure newargz[1] doesn't end in .exe */ + strendzap(newargz[1],".exe"); + for (i = 1; i < argc; i++) + newargz[i+1] = xstrdup(argv[i]); + newargz[argc+1] = NULL; +EOF + + cat >> $cwrappersource <> $cwrappersource <<"EOF" +} + +void * +xmalloc (size_t num) +{ + void * p = (void *) malloc (num); + if (!p) + lt_fatal ("Memory exhausted"); + + return p; +} + +char * +xstrdup (const char *string) +{ + return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL +; +} + +char * +basename (const char *name) +{ + const char *base; + +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + /* Skip over the disk name in MSDOS pathnames. */ + if (isalpha (name[0]) && name[1] == ':') + name += 2; +#endif + + for (base = name; *name; name++) + if (IS_DIR_SEPARATOR (*name)) + base = name + 1; + return (char *) base; +} + +char * +fnqualify(const char *path) +{ + size_t size; + char *p; + char tmp[LT_PATHMAX + 1]; + + assert(path != NULL); + + /* Is it qualified already? */ +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + if (isalpha (path[0]) && path[1] == ':') + return xstrdup (path); +#endif + if (IS_DIR_SEPARATOR (path[0])) + return xstrdup (path); + + /* prepend the current directory */ + /* doesn't handle '~' */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal ("getcwd failed"); + size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */ + p = XMALLOC(char, size); + sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path); + return p; +} + +char * +strendzap(char *str, const char *pat) +{ + size_t len, patlen; + + assert(str != NULL); + assert(pat != NULL); + + len = strlen(str); + patlen = strlen(pat); + + if (patlen <= len) + { + str += len - patlen; + if (strcmp(str, pat) == 0) + *str = '\0'; + } + return str; +} + +static void +lt_error_core (int exit_status, const char * mode, + const char * message, va_list ap) +{ + fprintf (stderr, "%s: %s: ", program_name, mode); + vfprintf (stderr, message, ap); + fprintf (stderr, ".\n"); + + if (exit_status >= 0) + exit (exit_status); +} + +void +lt_fatal (const char *message, ...) +{ + va_list ap; + va_start (ap, message); + lt_error_core (EXIT_FAILURE, "FATAL", message, ap); + va_end (ap); +} +EOF + # we should really use a build-platform specific compiler + # here, but OTOH, the wrappers (shell script and this C one) + # are only useful if you want to execute the "real" binary. + # Since the "real" binary is built for $host, then this + # wrapper might as well be built for $host, too. + $run $LTCC -s -o $cwrapper $cwrappersource + ;; + esac + $rm $output + trap "$rm $output; exit $EXIT_FAILURE" 1 2 15 + + $echo > $output "\ +#! $SHELL + +# $output - temporary wrapper script for $objdir/$outputname +# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP +# +# The $output program cannot be directly executed until all the libtool +# libraries that it depends on are installed. +# +# This wrapper script should never be moved out of the build directory. +# If it is, it will not operate correctly. + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='${SED} -e 1s/^X//' +sed_quote_subst='$sed_quote_subst' + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +relink_command=\"$relink_command\" + +# This environment variable determines our operation mode. +if test \"\$libtool_install_magic\" = \"$magic\"; then + # install mode needs the following variable: + notinst_deplibs='$notinst_deplibs' +else + # When we are sourced in execute mode, \$file and \$echo are already set. + if test \"\$libtool_execute_magic\" != \"$magic\"; then + echo=\"$qecho\" + file=\"\$0\" + # Make sure echo works. + if test \"X\$1\" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift + elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then + # Yippee, \$echo works! + : + else + # Restart under the correct shell, and then maybe \$echo will work. + exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} + fi + fi\ +" + $echo >> $output "\ + + # Find the directory that this script lives in. + thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` + test \"x\$thisdir\" = \"x\$file\" && thisdir=. + + # Follow symbolic links until we get to the real thisdir. + file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` + while test -n \"\$file\"; do + destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` + + # If there was a directory component, then change thisdir. + if test \"x\$destdir\" != \"x\$file\"; then + case \"\$destdir\" in + [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; + *) thisdir=\"\$thisdir/\$destdir\" ;; + esac + fi + + file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` + file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` + done + + # Try to get the absolute directory name. + absdir=\`cd \"\$thisdir\" && pwd\` + test -n \"\$absdir\" && thisdir=\"\$absdir\" +" + + if test "$fast_install" = yes; then + $echo >> $output "\ + program=lt-'$outputname'$exeext + progdir=\"\$thisdir/$objdir\" + + if test ! -f \"\$progdir/\$program\" || \\ + { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ + test \"X\$file\" != \"X\$progdir/\$program\"; }; then + + file=\"\$\$-\$program\" + + if test ! -d \"\$progdir\"; then + $mkdir \"\$progdir\" + else + $rm \"\$progdir/\$file\" + fi" + + $echo >> $output "\ + + # relink executable if necessary + if test -n \"\$relink_command\"; then + if relink_command_output=\`eval \$relink_command 2>&1\`; then : + else + $echo \"\$relink_command_output\" >&2 + $rm \"\$progdir/\$file\" + exit $EXIT_FAILURE + fi + fi + + $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || + { $rm \"\$progdir/\$program\"; + $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } + $rm \"\$progdir/\$file\" + fi" + else + $echo >> $output "\ + program='$outputname' + progdir=\"\$thisdir/$objdir\" +" + fi + + $echo >> $output "\ + + if test -f \"\$progdir/\$program\"; then" + + # Export our shlibpath_var if we have one. + if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + $echo >> $output "\ + # Add our own library path to $shlibpath_var + $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" + + # Some systems cannot cope with colon-terminated $shlibpath_var + # The second colon is a workaround for a bug in BeOS R4 sed + $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` + + export $shlibpath_var +" + fi + + # fixup the dll searchpath if we need to. + if test -n "$dllsearchpath"; then + $echo >> $output "\ + # Add the dll search path components to the executable PATH + PATH=$dllsearchpath:\$PATH +" + fi + + $echo >> $output "\ + if test \"\$libtool_execute_magic\" != \"$magic\"; then + # Run the actual program with our arguments. +" + case $host in + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2*) + $echo >> $output "\ + exec \$progdir\\\\\$program \${1+\"\$@\"} +" + ;; + + *) + $echo >> $output "\ + exec \$progdir/\$program \${1+\"\$@\"} +" + ;; + esac + $echo >> $output "\ + \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" + exit $EXIT_FAILURE + fi + else + # The program doesn't exist. + \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2 + \$echo \"This script is just a wrapper for \$program.\" 1>&2 + $echo \"See the $PACKAGE documentation for more information.\" 1>&2 + exit $EXIT_FAILURE + fi +fi\ +" + chmod +x $output + fi + exit $EXIT_SUCCESS + ;; + esac + + # See if we need to build an old-fashioned archive. + for oldlib in $oldlibs; do + + if test "$build_libtool_libs" = convenience; then + oldobjs="$libobjs_save" + addlibs="$convenience" + build_libtool_libs=no + else + if test "$build_libtool_libs" = module; then + oldobjs="$libobjs_save" + build_libtool_libs=no + else + oldobjs="$old_deplibs $non_pic_objects" + fi + addlibs="$old_convenience" + fi + + if test -n "$addlibs"; then + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + func_extract_archives $gentop $addlibs + oldobjs="$oldobjs $func_extract_archives_result" + fi + + # Do each command in the archive commands. + if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then + cmds=$old_archive_from_new_cmds + else + # POSIX demands no paths to be encoded in archives. We have + # to avoid creating archives with duplicate basenames if we + # might have to extract them afterwards, e.g., when creating a + # static archive out of a convenience library, or when linking + # the entirety of a libtool archive into another (currently + # not supported by libtool). + if (for obj in $oldobjs + do + $echo "X$obj" | $Xsed -e 's%^.*/%%' + done | sort | sort -uc >/dev/null 2>&1); then + : + else + $echo "copying selected object files to avoid basename conflicts..." + + if test -z "$gentop"; then + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + $show "${rm}r $gentop" + $run ${rm}r "$gentop" + $show "$mkdir $gentop" + $run $mkdir "$gentop" + status=$? + if test "$status" -ne 0 && test ! -d "$gentop"; then + exit $status + fi + fi + + save_oldobjs=$oldobjs + oldobjs= + counter=1 + for obj in $save_oldobjs + do + objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` + case " $oldobjs " in + " ") oldobjs=$obj ;; + *[\ /]"$objbase "*) + while :; do + # Make sure we don't pick an alternate name that also + # overlaps. + newobj=lt$counter-$objbase + counter=`expr $counter + 1` + case " $oldobjs " in + *[\ /]"$newobj "*) ;; + *) if test ! -f "$gentop/$newobj"; then break; fi ;; + esac + done + $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" + $run ln "$obj" "$gentop/$newobj" || + $run cp "$obj" "$gentop/$newobj" + oldobjs="$oldobjs $gentop/$newobj" + ;; + *) oldobjs="$oldobjs $obj" ;; + esac + done + fi + + eval cmds=\"$old_archive_cmds\" + + if len=`expr "X$cmds" : ".*"` && + test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then + cmds=$old_archive_cmds + else + # the command line is too long to link in one step, link in parts + $echo "using piecewise archive linking..." + save_RANLIB=$RANLIB + RANLIB=: + objlist= + concat_cmds= + save_oldobjs=$oldobjs + + # Is there a better way of finding the last object in the list? + for obj in $save_oldobjs + do + last_oldobj=$obj + done + for obj in $save_oldobjs + do + oldobjs="$objlist $obj" + objlist="$objlist $obj" + eval test_cmds=\"$old_archive_cmds\" + if len=`expr "X$test_cmds" : ".*"` && + test "$len" -le "$max_cmd_len"; then + : + else + # the above command should be used before it gets too long + oldobjs=$objlist + if test "$obj" = "$last_oldobj" ; then + RANLIB=$save_RANLIB + fi + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" + objlist= + fi + done + RANLIB=$save_RANLIB + oldobjs=$objlist + if test "X$oldobjs" = "X" ; then + eval cmds=\"\$concat_cmds\" + else + eval cmds=\"\$concat_cmds~\$old_archive_cmds\" + fi + fi + fi + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + eval cmd=\"$cmd\" + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + done + + if test -n "$generated"; then + $show "${rm}r$generated" + $run ${rm}r$generated + fi + + # Now create the libtool archive. + case $output in + *.la) + old_library= + test "$build_old_libs" = yes && old_library="$libname.$libext" + $show "creating $output" + + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` + relink_command="$var=\"$var_value\"; export $var; $relink_command" + fi + done + # Quote the link command for shipping. + relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" + relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` + if test "$hardcode_automatic" = yes ; then + relink_command= + fi + + + # Only create the output if not a dry run. + if test -z "$run"; then + for installed in no yes; do + if test "$installed" = yes; then + if test -z "$install_libdir"; then + break + fi + output="$output_objdir/$outputname"i + # Replace all uninstalled libtool libraries with the installed ones + newdependency_libs= + for deplib in $dependency_libs; do + case $deplib in + *.la) + name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + if test -z "$libdir"; then + $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 + exit $EXIT_FAILURE + fi + if test "X$EGREP" = X ; then + EGREP=egrep + fi + # We do not want portage's install root ($D) present. Check only for + # this if the .la is being installed. + if test "$installed" = yes && test "$D"; then + eval mynewdependency_lib=`echo "$libdir/$name" |sed -e "s:$D:/:g" -e 's:/\+:/:g'` + else + mynewdependency_lib="$libdir/$name" + fi + # Do not add duplicates + if test "$mynewdependency_lib"; then + my_little_ninja_foo_1=`echo $newdependency_libs |$EGREP -e "$mynewdependency_lib"` + if test -z "$my_little_ninja_foo_1"; then + newdependency_libs="$newdependency_libs $mynewdependency_lib" + fi + fi + ;; + *) + if test "$installed" = yes; then + # Rather use S=WORKDIR if our version of portage supports it. + # This is because some ebuild (gcc) do not use $S as buildroot. + if test "$PWORKDIR"; then + S="$PWORKDIR" + fi + # We do not want portage's build root ($S) present. + my_little_ninja_foo_2=`echo $deplib |$EGREP -e "$S"` + if test -n "$my_little_ninja_foo_2" && test "$S"; then + mynewdependency_lib="" + # We do not want portage's install root ($D) present. + my_little_ninja_foo_3=`echo $deplib |$EGREP -e "$D"` + elif test -n "$my_little_ninja_foo_3" && test "$D"; then + eval mynewdependency_lib=`echo "$deplib" |sed -e "s:$D:/:g" -e 's:/\+:/:g'` + else + mynewdependency_lib="$deplib" + fi + else + mynewdependency_lib="$deplib" + fi + # Do not add duplicates + if test "$mynewdependency_lib"; then + my_little_ninja_foo_4=`echo $newdependency_libs |$EGREP -e "$mynewdependency_lib"` + if test -z "$my_little_ninja_foo_4"; then + newdependency_libs="$newdependency_libs $mynewdependency_lib" + fi + fi + ;; + esac + done + dependency_libs="$newdependency_libs" + newdlfiles= + for lib in $dlfiles; do + name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + if test -z "$libdir"; then + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + exit $EXIT_FAILURE + fi + newdlfiles="$newdlfiles $libdir/$name" + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + if test -z "$libdir"; then + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + exit $EXIT_FAILURE + fi + newdlprefiles="$newdlprefiles $libdir/$name" + done + dlprefiles="$newdlprefiles" + else + newdlfiles= + for lib in $dlfiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + newdlfiles="$newdlfiles $abs" + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + newdlprefiles="$newdlprefiles $abs" + done + dlprefiles="$newdlprefiles" + fi + $rm $output + # place dlname in correct position for cygwin + tdlname=$dlname + case $host,$output,$installed,$module,$dlname in + *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; + esac + # Do not add duplicates + if test "$installed" = yes && test "$D"; then + install_libdir=`echo "$install_libdir" |sed -e "s:$D:/:g" -e 's:/\+:/:g'` + fi + $echo > $output "\ +# $outputname - a libtool library file +# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='$tdlname' + +# Names of this library. +library_names='$library_names' + +# The name of the static archive. +old_library='$old_library' + +# Libraries that this one depends upon. +dependency_libs='$dependency_libs' + +# Version information for $libname. +current=$current +age=$age +revision=$revision + +# Is this an already installed library? +installed=$installed + +# Should we warn about portability when linking against -modules? +shouldnotlink=$module + +# Files to dlopen/dlpreopen +dlopen='$dlfiles' +dlpreopen='$dlprefiles' + +# Directory that this library needs to be installed in: +libdir='$install_libdir'" + if test "$installed" = no && test "$need_relink" = yes; then + $echo >> $output "\ +relink_command=\"$relink_command\"" + fi + done + fi + + # Do a symbolic link so that the libtool archive can be found in + # LD_LIBRARY_PATH before the program is installed. + $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" + $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? + ;; + esac + exit $EXIT_SUCCESS + ;; + + # libtool install mode + install) + modename="$modename: install" + + # There may be an optional sh(1) argument at the beginning of + # install_prog (especially on Windows NT). + if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || + # Allow the use of GNU shtool's install command. + $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then + # Aesthetically quote it. + arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` + case $arg in + *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") + arg="\"$arg\"" + ;; + esac + install_prog="$arg " + arg="$1" + shift + else + install_prog= + arg="$nonopt" + fi + + # The real first argument should be the name of the installation program. + # Aesthetically quote it. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") + arg="\"$arg\"" + ;; + esac + install_prog="$install_prog$arg" + + # We need to accept at least all the BSD install flags. + dest= + files= + opts= + prev= + install_type= + isdir=no + stripme= + for arg + do + if test -n "$dest"; then + files="$files $dest" + dest="$arg" + continue + fi + + case $arg in + -d) isdir=yes ;; + -f) prev="-f" ;; + -g) prev="-g" ;; + -m) prev="-m" ;; + -o) prev="-o" ;; + -s) + stripme=" -s" + continue + ;; + -*) ;; + + *) + # If the previous option needed an argument, then skip it. + if test -n "$prev"; then + prev= + else + dest="$arg" + continue + fi + ;; + esac + + # Aesthetically quote the argument. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") + arg="\"$arg\"" + ;; + esac + install_prog="$install_prog $arg" + done + + if test -z "$install_prog"; then + $echo "$modename: you must specify an install program" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + if test -n "$prev"; then + $echo "$modename: the \`$prev' option requires an argument" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + if test -z "$files"; then + if test -z "$dest"; then + $echo "$modename: no file or destination specified" 1>&2 + else + $echo "$modename: you must specify a destination" 1>&2 + fi + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Strip any trailing slash from the destination. + dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` + + # Check to see that the destination is a directory. + test -d "$dest" && isdir=yes + if test "$isdir" = yes; then + destdir="$dest" + destname= + else + destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` + test "X$destdir" = "X$dest" && destdir=. + destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` + + # Not a directory, so check to see that there is only one file specified. + set dummy $files + if test "$#" -gt 2; then + $echo "$modename: \`$dest' is not a directory" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + fi + case $destdir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + for file in $files; do + case $file in + *.lo) ;; + *) + $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + ;; + esac + done + ;; + esac + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + staticlibs= + future_libdirs= + current_libdirs= + for file in $files; do + + # Do each installation. + case $file in + *.$libext) + # Do the static libraries later. + staticlibs="$staticlibs $file" + ;; + + *.la) + # Check to see that this really is a libtool archive. + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + else + $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + library_names= + old_library= + relink_command= + # If there is no directory component, then add one. + case $file in + */* | *\\*) . $file ;; + *) . ./$file ;; + esac + + # Add the libdir to current_libdirs if it is the destination. + if test "X$destdir" = "X$libdir"; then + case "$current_libdirs " in + *" $libdir "*) ;; + *) current_libdirs="$current_libdirs $libdir" ;; + esac + else + # Note the libdir as a future libdir. + case "$future_libdirs " in + *" $libdir "*) ;; + *) future_libdirs="$future_libdirs $libdir" ;; + esac + fi + + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ + test "X$dir" = "X$file/" && dir= + dir="$dir$objdir" + + if test -n "$relink_command"; then + # Determine the prefix the user has applied to our future dir. + inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"` + + # Don't allow the user to place us outside of our expected + # location b/c this prevents finding dependent libraries that + # are installed to the same prefix. + # At present, this check doesn't affect windows .dll's that + # are installed into $libdir/../bin (currently, that works fine) + # but it's something to keep an eye on. + if test "$inst_prefix_dir" = "$destdir"; then + $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 + exit $EXIT_FAILURE + fi + + if test -n "$inst_prefix_dir"; then + # Stick the inst_prefix_dir data into the link command. + relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` + else + relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"` + fi + + $echo "$modename: warning: relinking \`$file'" 1>&2 + $show "$relink_command" + if $run eval "$relink_command"; then : + else + $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 + exit $EXIT_FAILURE + fi + fi + + # See the names of the shared library. + set dummy $library_names + if test -n "$2"; then + realname="$2" + shift + shift + + srcname="$realname" + test -n "$relink_command" && srcname="$realname"T + + # Install the shared library and build the symlinks. + $show "$install_prog $dir/$srcname $destdir/$realname" + $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? + if test -n "$stripme" && test -n "$striplib"; then + $show "$striplib $destdir/$realname" + $run eval "$striplib $destdir/$realname" || exit $? + fi + + if test "$#" -gt 0; then + # Delete the old symlinks, and create new ones. + for linkname + do + if test "$linkname" != "$realname"; then + $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" + $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" + fi + done + fi + + # Do each command in the postinstall commands. + lib="$destdir/$realname" + cmds=$postinstall_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + fi + + # Install the pseudo-library for information purposes. + name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + instname="$dir/$name"i + $show "$install_prog $instname $destdir/$name" + $run eval "$install_prog $instname $destdir/$name" || exit $? + + # Maybe install the static library, too. + test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" + ;; + + *.lo) + # Install (i.e. copy) a libtool object. + + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" + else + destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + destfile="$destdir/$destfile" + fi + + # Deduce the name of the destination old-style object file. + case $destfile in + *.lo) + staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` + ;; + *.$objext) + staticdest="$destfile" + destfile= + ;; + *) + $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + # Install the libtool object if requested. + if test -n "$destfile"; then + $show "$install_prog $file $destfile" + $run eval "$install_prog $file $destfile" || exit $? + fi + + # Install the old object if enabled. + if test "$build_old_libs" = yes; then + # Deduce the name of the old-style object file. + staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` + + $show "$install_prog $staticobj $staticdest" + $run eval "$install_prog \$staticobj \$staticdest" || exit $? + fi + exit $EXIT_SUCCESS + ;; + + *) + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" + else + destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + destfile="$destdir/$destfile" + fi + + # If the file is missing, and there is a .exe on the end, strip it + # because it is most likely a libtool script we actually want to + # install + stripped_ext="" + case $file in + *.exe) + if test ! -f "$file"; then + file=`$echo $file|${SED} 's,.exe$,,'` + stripped_ext=".exe" + fi + ;; + esac + + # Do a test to see if this is really a libtool program. + case $host in + *cygwin*|*mingw*) + wrapper=`$echo $file | ${SED} -e 's,.exe$,,'` + ;; + *) + wrapper=$file + ;; + esac + if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then + notinst_deplibs= + relink_command= + + # To insure that "foo" is sourced, and not "foo.exe", + # finese the cygwin/MSYS system by explicitly sourcing "foo." + # which disallows the automatic-append-.exe behavior. + case $build in + *cygwin* | *mingw*) wrapperdot=${wrapper}. ;; + *) wrapperdot=${wrapper} ;; + esac + # If there is no directory component, then add one. + case $file in + */* | *\\*) . ${wrapperdot} ;; + *) . ./${wrapperdot} ;; + esac + + # Check the variables that should have been set. + if test -z "$notinst_deplibs"; then + $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 + exit $EXIT_FAILURE + fi + + finalize=yes + for lib in $notinst_deplibs; do + # Check to see that each library is installed. + libdir= + if test -f "$lib"; then + # If there is no directory component, then add one. + case $lib in + */* | *\\*) . $lib ;; + *) . ./$lib ;; + esac + fi + libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test + if test -n "$libdir" && test ! -f "$libfile"; then + $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 + finalize=no + fi + done + + relink_command= + # To insure that "foo" is sourced, and not "foo.exe", + # finese the cygwin/MSYS system by explicitly sourcing "foo." + # which disallows the automatic-append-.exe behavior. + case $build in + *cygwin* | *mingw*) wrapperdot=${wrapper}. ;; + *) wrapperdot=${wrapper} ;; + esac + # If there is no directory component, then add one. + case $file in + */* | *\\*) . ${wrapperdot} ;; + *) . ./${wrapperdot} ;; + esac + + outputname= + if test "$fast_install" = no && test -n "$relink_command"; then + if test "$finalize" = yes && test -z "$run"; then + tmpdir="/tmp" + test -n "$TMPDIR" && tmpdir="$TMPDIR" + tmpdir="$tmpdir/libtool-$$" + save_umask=`umask` + umask 0077 + if $mkdir "$tmpdir"; then + umask $save_umask + else + umask $save_umask + $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 + continue + fi + file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` + outputname="$tmpdir/$file" + # Replace the output file specification. + relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` + + $show "$relink_command" + if $run eval "$relink_command"; then : + else + $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 + ${rm}r "$tmpdir" + continue + fi + file="$outputname" + else + $echo "$modename: warning: cannot relink \`$file'" 1>&2 + fi + else + # Install the binary that we compiled earlier. + file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` + fi + fi + + # remove .exe since cygwin /usr/bin/install will append another + # one anyways + case $install_prog,$host in + */usr/bin/install*,*cygwin*) + case $file:$destfile in + *.exe:*.exe) + # this is ok + ;; + *.exe:*) + destfile=$destfile.exe + ;; + *:*.exe) + destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'` + ;; + esac + ;; + esac + $show "$install_prog$stripme $file $destfile" + $run eval "$install_prog\$stripme \$file \$destfile" || exit $? + test -n "$outputname" && ${rm}r "$tmpdir" + ;; + esac + done + + for file in $staticlibs; do + name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + + # Set up the ranlib parameters. + oldlib="$destdir/$name" + + $show "$install_prog $file $oldlib" + $run eval "$install_prog \$file \$oldlib" || exit $? + + if test -n "$stripme" && test -n "$old_striplib"; then + $show "$old_striplib $oldlib" + $run eval "$old_striplib $oldlib" || exit $? + fi + + # Do each command in the postinstall commands. + cmds=$old_postinstall_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + done + + if test -n "$future_libdirs"; then + $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 + fi + + if test -n "$current_libdirs"; then + # Maybe just do a dry run. + test -n "$run" && current_libdirs=" -n$current_libdirs" + exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' + else + exit $EXIT_SUCCESS + fi + ;; + + # libtool finish mode + finish) + modename="$modename: finish" + libdirs="$nonopt" + admincmds= + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + for dir + do + libdirs="$libdirs $dir" + done + + for libdir in $libdirs; do + if test -n "$finish_cmds"; then + # Do each command in the finish commands. + cmds=$finish_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || admincmds="$admincmds + $cmd" + done + IFS="$save_ifs" + fi + if test -n "$finish_eval"; then + # Do the single finish_eval. + eval cmds=\"$finish_eval\" + $run eval "$cmds" || admincmds="$admincmds + $cmds" + fi + done + fi + + # Exit here if they wanted silent mode. + test "$show" = : && exit $EXIT_SUCCESS + + $echo "----------------------------------------------------------------------" + $echo "Libraries have been installed in:" + for libdir in $libdirs; do + $echo " $libdir" + done + $echo + $echo "If you ever happen to want to link against installed libraries" + $echo "in a given directory, LIBDIR, you must either use libtool, and" + $echo "specify the full pathname of the library, or use the \`-LLIBDIR'" + $echo "flag during linking and do at least one of the following:" + if test -n "$shlibpath_var"; then + $echo " - add LIBDIR to the \`$shlibpath_var' environment variable" + $echo " during execution" + fi + if test -n "$runpath_var"; then + $echo " - add LIBDIR to the \`$runpath_var' environment variable" + $echo " during linking" + fi + if test -n "$hardcode_libdir_flag_spec"; then + libdir=LIBDIR + eval flag=\"$hardcode_libdir_flag_spec\" + + $echo " - use the \`$flag' linker flag" + fi + if test -n "$admincmds"; then + $echo " - have your system administrator run these commands:$admincmds" + fi + if test -f /etc/ld.so.conf; then + $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" + fi + $echo + $echo "See any operating system documentation about shared libraries for" + $echo "more information, such as the ld(1) and ld.so(8) manual pages." + $echo "----------------------------------------------------------------------" + exit $EXIT_SUCCESS + ;; + + # libtool execute mode + execute) + modename="$modename: execute" + + # The first argument is the command name. + cmd="$nonopt" + if test -z "$cmd"; then + $echo "$modename: you must specify a COMMAND" 1>&2 + $echo "$help" + exit $EXIT_FAILURE + fi + + # Handle -dlopen flags immediately. + for file in $execute_dlfiles; do + if test ! -f "$file"; then + $echo "$modename: \`$file' is not a file" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + dir= + case $file in + *.la) + # Check to see that this really is a libtool archive. + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + else + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Read the libtool library. + dlname= + library_names= + + # If there is no directory component, then add one. + case $file in + */* | *\\*) . $file ;; + *) . ./$file ;; + esac + + # Skip this library if it cannot be dlopened. + if test -z "$dlname"; then + # Warn if it was a shared library. + test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" + continue + fi + + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` + test "X$dir" = "X$file" && dir=. + + if test -f "$dir/$objdir/$dlname"; then + dir="$dir/$objdir" + else + $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 + exit $EXIT_FAILURE + fi + ;; + + *.lo) + # Just add the directory containing the .lo file. + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` + test "X$dir" = "X$file" && dir=. + ;; + + *) + $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 + continue + ;; + esac + + # Get the absolute pathname. + absdir=`cd "$dir" && pwd` + test -n "$absdir" && dir="$absdir" + + # Now add the directory to shlibpath_var. + if eval "test -z \"\$$shlibpath_var\""; then + eval "$shlibpath_var=\"\$dir\"" + else + eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" + fi + done + + # This variable tells wrapper scripts just to set shlibpath_var + # rather than running their programs. + libtool_execute_magic="$magic" + + # Check if any of the arguments is a wrapper script. + args= + for file + do + case $file in + -*) ;; + *) + # Do a test to see if this is really a libtool program. + if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + # If there is no directory component, then add one. + case $file in + */* | *\\*) . $file ;; + *) . ./$file ;; + esac + + # Transform arg to wrapped name. + file="$progdir/$program" + fi + ;; + esac + # Quote arguments (to preserve shell metacharacters). + file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` + args="$args \"$file\"" + done + + if test -z "$run"; then + if test -n "$shlibpath_var"; then + # Export the shlibpath_var. + eval "export $shlibpath_var" + fi + + # Restore saved environment variables + if test "${save_LC_ALL+set}" = set; then + LC_ALL="$save_LC_ALL"; export LC_ALL + fi + if test "${save_LANG+set}" = set; then + LANG="$save_LANG"; export LANG + fi + + # Now prepare to actually exec the command. + exec_cmd="\$cmd$args" + else + # Display what would be done. + if test -n "$shlibpath_var"; then + eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" + $echo "export $shlibpath_var" + fi + $echo "$cmd$args" + exit $EXIT_SUCCESS + fi + ;; + + # libtool clean and uninstall mode + clean | uninstall) + modename="$modename: $mode" + rm="$nonopt" + files= + rmforce= + exit_status=0 + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + for arg + do + case $arg in + -f) rm="$rm $arg"; rmforce=yes ;; + -*) rm="$rm $arg" ;; + *) files="$files $arg" ;; + esac + done + + if test -z "$rm"; then + $echo "$modename: you must specify an RM program" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + rmdirs= + + origobjdir="$objdir" + for file in $files; do + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` + if test "X$dir" = "X$file"; then + dir=. + objdir="$origobjdir" + else + objdir="$dir/$origobjdir" + fi + name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + test "$mode" = uninstall && objdir="$dir" + + # Remember objdir for removal later, being careful to avoid duplicates + if test "$mode" = clean; then + case " $rmdirs " in + *" $objdir "*) ;; + *) rmdirs="$rmdirs $objdir" ;; + esac + fi + + # Don't error if the file doesn't exist and rm -f was used. + if (test -L "$file") >/dev/null 2>&1 \ + || (test -h "$file") >/dev/null 2>&1 \ + || test -f "$file"; then + : + elif test -d "$file"; then + exit_status=1 + continue + elif test "$rmforce" = yes; then + continue + fi + + rmfiles="$file" + + case $name in + *.la) + # Possibly a libtool archive, so verify it. + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + . $dir/$name + + # Delete the libtool libraries and symlinks. + for n in $library_names; do + rmfiles="$rmfiles $objdir/$n" + done + test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" + test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" + + if test "$mode" = uninstall; then + if test -n "$library_names"; then + # Do each command in the postuninstall commands. + cmds=$postuninstall_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" + if test "$?" -ne 0 && test "$rmforce" != yes; then + exit_status=1 + fi + done + IFS="$save_ifs" + fi + + if test -n "$old_library"; then + # Do each command in the old_postuninstall commands. + cmds=$old_postuninstall_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" + if test "$?" -ne 0 && test "$rmforce" != yes; then + exit_status=1 + fi + done + IFS="$save_ifs" + fi + # FIXME: should reinstall the best remaining shared library. + fi + fi + ;; + + *.lo) + # Possibly a libtool object, so verify it. + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + + # Read the .lo file + . $dir/$name + + # Add PIC object to the list of files to remove. + if test -n "$pic_object" \ + && test "$pic_object" != none; then + rmfiles="$rmfiles $dir/$pic_object" + fi + + # Add non-PIC object to the list of files to remove. + if test -n "$non_pic_object" \ + && test "$non_pic_object" != none; then + rmfiles="$rmfiles $dir/$non_pic_object" + fi + fi + ;; + + *) + if test "$mode" = clean ; then + noexename=$name + case $file in + *.exe) + file=`$echo $file|${SED} 's,.exe$,,'` + noexename=`$echo $name|${SED} 's,.exe$,,'` + # $file with .exe has already been added to rmfiles, + # add $file without .exe + rmfiles="$rmfiles $file" + ;; + esac + # Do a test to see if this is a libtool program. + if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + relink_command= + . $dir/$noexename + + # note $name still contains .exe if it was in $file originally + # as does the version of $file that was added into $rmfiles + rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" + if test "$fast_install" = yes && test -n "$relink_command"; then + rmfiles="$rmfiles $objdir/lt-$name" + fi + if test "X$noexename" != "X$name" ; then + rmfiles="$rmfiles $objdir/lt-${noexename}.c" + fi + fi + fi + ;; + esac + $show "$rm $rmfiles" + $run $rm $rmfiles || exit_status=1 + done + objdir="$origobjdir" + + # Try to remove the ${objdir}s in the directories where we deleted files + for dir in $rmdirs; do + if test -d "$dir"; then + $show "rmdir $dir" + $run rmdir $dir >/dev/null 2>&1 + fi + done + + exit $exit_status + ;; + + "") + $echo "$modename: you must specify a MODE" 1>&2 + $echo "$generic_help" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + if test -z "$exec_cmd"; then + $echo "$modename: invalid operation mode \`$mode'" 1>&2 + $echo "$generic_help" 1>&2 + exit $EXIT_FAILURE + fi +fi # test -z "$show_help" + +if test -n "$exec_cmd"; then + eval exec $exec_cmd + exit $EXIT_FAILURE +fi + +# We need to display help for each of the modes. +case $mode in +"") $echo \ +"Usage: $modename [OPTION]... [MODE-ARG]... + +Provide generalized library-building support services. + + --config show all configuration variables + --debug enable verbose shell tracing +-n, --dry-run display commands without modifying any files + --features display basic configuration information and exit + --finish same as \`--mode=finish' + --help display this help message and exit + --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] + --quiet same as \`--silent' + --silent don't print informational messages + --tag=TAG use configuration variables from tag TAG + --version print version information + +MODE must be one of the following: + + clean remove files from the build directory + compile compile a source file into a libtool object + execute automatically set library path, then run a program + finish complete the installation of libtool libraries + install install libraries or executables + link create a library or an executable + uninstall remove libraries from an installed directory + +MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for +a more detailed description of MODE. + +Report bugs to ." + exit $EXIT_SUCCESS + ;; + +clean) + $echo \ +"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... + +Remove files from the build directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, object or program, all the files associated +with it are deleted. Otherwise, only FILE itself is deleted using RM." + ;; + +compile) + $echo \ +"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE + +Compile a source file into a libtool library object. + +This mode accepts the following additional options: + + -o OUTPUT-FILE set the output file name to OUTPUT-FILE + -prefer-pic try to building PIC objects only + -prefer-non-pic try to building non-PIC objects only + -static always build a \`.o' file suitable for static linking + +COMPILE-COMMAND is a command to be used in creating a \`standard' object file +from the given SOURCEFILE. + +The output file name is determined by removing the directory component from +SOURCEFILE, then substituting the C source code suffix \`.c' with the +library object suffix, \`.lo'." + ;; + +execute) + $echo \ +"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... + +Automatically set library path, then run a program. + +This mode accepts the following additional options: + + -dlopen FILE add the directory containing FILE to the library path + +This mode sets the library path environment variable according to \`-dlopen' +flags. + +If any of the ARGS are libtool executable wrappers, then they are translated +into their corresponding uninstalled binary, and any of their required library +directories are added to the library path. + +Then, COMMAND is executed, with ARGS as arguments." + ;; + +finish) + $echo \ +"Usage: $modename [OPTION]... --mode=finish [LIBDIR]... + +Complete the installation of libtool libraries. + +Each LIBDIR is a directory that contains libtool libraries. + +The commands that this mode executes may require superuser privileges. Use +the \`--dry-run' option if you just want to see what would be executed." + ;; + +install) + $echo \ +"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... + +Install executables or libraries. + +INSTALL-COMMAND is the installation command. The first component should be +either the \`install' or \`cp' program. + +The rest of the components are interpreted as arguments to that command (only +BSD-compatible install options are recognized)." + ;; + +link) + $echo \ +"Usage: $modename [OPTION]... --mode=link LINK-COMMAND... + +Link object files or libraries together to form another library, or to +create an executable program. + +LINK-COMMAND is a command using the C compiler that you would use to create +a program from several object files. + +The following components of LINK-COMMAND are treated specially: + + -all-static do not do any dynamic linking at all + -avoid-version do not add a version suffix if possible + -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime + -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols + -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) + -export-symbols SYMFILE + try to export only the symbols listed in SYMFILE + -export-symbols-regex REGEX + try to export only the symbols matching REGEX + -LLIBDIR search LIBDIR for required installed libraries + -lNAME OUTPUT-FILE requires the installed library libNAME + -module build a library that can dlopened + -no-fast-install disable the fast-install mode + -no-install link a not-installable executable + -no-undefined declare that a library does not refer to external symbols + -o OUTPUT-FILE create OUTPUT-FILE from the specified objects + -objectlist FILE Use a list of object files found in FILE to specify objects + -precious-files-regex REGEX + don't remove output files matching REGEX + -release RELEASE specify package release information + -rpath LIBDIR the created library will eventually be installed in LIBDIR + -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries + -static do not do any dynamic linking of libtool libraries + -version-info CURRENT[:REVISION[:AGE]] + specify library version info [each variable defaults to 0] + +All other options (arguments beginning with \`-') are ignored. + +Every other argument is treated as a filename. Files ending in \`.la' are +treated as uninstalled libtool libraries, other files are standard or library +object files. + +If the OUTPUT-FILE ends in \`.la', then a libtool library is created, +only library objects (\`.lo' files) may be specified, and \`-rpath' is +required, except when creating a convenience library. + +If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created +using \`ar' and \`ranlib', or on Windows using \`lib'. + +If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file +is created, otherwise an executable program is created." + ;; + +uninstall) + $echo \ +"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... + +Remove libraries from an installation directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, all the files associated with it are deleted. +Otherwise, only FILE itself is deleted using RM." + ;; + +*) + $echo "$modename: invalid operation mode \`$mode'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + ;; +esac + +$echo +$echo "Try \`$modename --help' for more information about other modes." + +exit $? + +# The TAGs below are defined such that we never get into a situation +# in which we disable both kinds of libraries. Given conflicting +# choices, we go for a static library, that is the most portable, +# since we can't tell whether shared libraries were disabled because +# the user asked for that or because the platform doesn't support +# them. This is particularly important on AIX, because we don't +# support having both static and shared libraries enabled at the same +# time on that platform, so we default to a shared-only configuration. +# If a disable-shared tag is given, we'll fallback to a static-only +# configuration. But we'll never go from static-only to shared-only. + +# ### BEGIN LIBTOOL TAG CONFIG: disable-shared +build_libtool_libs=no +build_old_libs=yes +# ### END LIBTOOL TAG CONFIG: disable-shared + +# ### BEGIN LIBTOOL TAG CONFIG: disable-static +build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac` +# ### END LIBTOOL TAG CONFIG: disable-static + +# Local Variables: +# mode:shell-script +# sh-indentation:2 +# End: diff --git a/mozilla/js/tamarin/pcre/makevp.txt b/mozilla/js/tamarin/pcre/makevp.txt new file mode 100644 index 00000000000..89c59a51183 --- /dev/null +++ b/mozilla/js/tamarin/pcre/makevp.txt @@ -0,0 +1,5 @@ +FILE QUARANTINED +---------------- + +Antigen for Exchange removed avmplus-tar-gz->Unknown->avmplus/pcre/makevp.bat since it +was found to match the FILE FILTER= unnamed: *.bat file filter. diff --git a/mozilla/js/tamarin/pcre/mkinstalldirs b/mozilla/js/tamarin/pcre/mkinstalldirs new file mode 100644 index 00000000000..a939919e8e8 --- /dev/null +++ b/mozilla/js/tamarin/pcre/mkinstalldirs @@ -0,0 +1,40 @@ +#! /bin/sh +# mkinstalldirs --- make directory hierarchy +# Author: Noah Friedman +# Created: 1993-05-16 +# Public domain + +# $Id: mkinstalldirs,v 1.1 2006-11-07 05:34:03 brendan%mozilla.org Exp $ + +errstatus=0 + +for file +do + set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` + shift + + pathcomp= + for d + do + pathcomp="$pathcomp$d" + case "$pathcomp" in + -* ) pathcomp=./$pathcomp ;; + esac + + if test ! -d "$pathcomp"; then + echo "mkdir $pathcomp" + + mkdir "$pathcomp" || lasterr=$? + + if test ! -d "$pathcomp"; then + errstatus=$lasterr + fi + fi + + pathcomp="$pathcomp/" + done +done + +exit $errstatus + +# mkinstalldirs ends here diff --git a/mozilla/js/tamarin/pcre/pcre-config.in b/mozilla/js/tamarin/pcre/pcre-config.in new file mode 100644 index 00000000000..30d66ced361 --- /dev/null +++ b/mozilla/js/tamarin/pcre/pcre-config.in @@ -0,0 +1,66 @@ +#!/bin/sh + +prefix=@prefix@ +exec_prefix=@exec_prefix@ +exec_prefix_set=no + +usage="\ +Usage: pcre-config [--prefix] [--exec-prefix] [--version] [--libs] [--libs-posix] [--cflags] [--cflags-posix]" + +if test $# -eq 0; then + echo "${usage}" 1>&2 + exit 1 +fi + +libR= +case `uname -s` in + *SunOS*) + libR=" -R@libdir@" + ;; +esac + +while test $# -gt 0; do + case "$1" in + -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) optarg= ;; + esac + + case $1 in + --prefix=*) + prefix=$optarg + if test $exec_prefix_set = no ; then + exec_prefix=$optarg + fi + ;; + --prefix) + echo $prefix + ;; + --exec-prefix=*) + exec_prefix=$optarg + exec_prefix_set=yes + ;; + --exec-prefix) + echo $exec_prefix + ;; + --version) + echo @PCRE_VERSION@ + ;; + --cflags | --cflags-posix) + if test @includedir@ != /usr/include ; then + includes=-I@includedir@ + fi + echo $includes + ;; + --libs-posix) + echo -L@libdir@$libR -lpcreposix -lpcre + ;; + --libs) + echo -L@libdir@$libR -lpcre + ;; + *) + echo "${usage}" 1>&2 + exit 1 + ;; + esac + shift +done diff --git a/mozilla/js/tamarin/pcre/pcre.def b/mozilla/js/tamarin/pcre/pcre.def new file mode 100644 index 00000000000..adb53160d30 --- /dev/null +++ b/mozilla/js/tamarin/pcre/pcre.def @@ -0,0 +1,23 @@ +EXPORTS + +pcre_malloc DATA +pcre_free DATA + +pcre_compile +pcre_copy_substring +pcre_dfa_exec +pcre_exec +pcre_get_substring +pcre_get_substring_list +pcre_free_substring +pcre_free_substring_list +pcre_info +pcre_fullinfo +pcre_maketables +pcre_study +pcre_version + +regcomp +regexec +regerror +regfree diff --git a/mozilla/js/tamarin/pcre/pcre.h b/mozilla/js/tamarin/pcre/pcre.h new file mode 100644 index 00000000000..76d3a712884 --- /dev/null +++ b/mozilla/js/tamarin/pcre/pcre.h @@ -0,0 +1,262 @@ +/************************************************* +* Perl-Compatible Regular Expressions * +*************************************************/ + +/* In its original form, this is the .in file that is transformed by +"configure" into pcre.h. + + Copyright (c) 1997-2005 University of Cambridge + +----------------------------------------------------------------------------- +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + * Neither the name of the University of Cambridge nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +----------------------------------------------------------------------------- +*/ + +#ifndef _PCRE_H +#define _PCRE_H + +/* The file pcre.h is build by "configure". Do not edit it; instead +make changes to pcre.in. */ + +#define PCRE_MAJOR 6 +#define PCRE_MINOR 4 +#define PCRE_DATE 05-Sep-2005 + +/* Win32 uses DLL by default; it needs special stuff for exported functions. */ + +#if 0 +#ifdef _WIN32 +# ifdef PCRE_DEFINITION +# ifdef DLL_EXPORT +# define PCRE_DATA_SCOPE __declspec(dllexport) +# endif +# else +# ifndef PCRE_STATIC +# define PCRE_DATA_SCOPE extern __declspec(dllimport) +# endif +# endif +#endif +#endif + +/* For other operating systems, we use the standard "extern". */ + +#ifndef PCRE_DATA_SCOPE +# ifdef __cplusplus +# define PCRE_DATA_SCOPE extern "C" +# else +# define PCRE_DATA_SCOPE extern +# endif +#endif + +#define EXPORT + +/* Have to include stdlib.h in order to ensure that size_t is defined; +it is needed here for malloc. */ + +#include + +/* Allow for C++ users */ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Options */ + +#define PCRE_CASELESS 0x00000001 +#define PCRE_MULTILINE 0x00000002 +#define PCRE_DOTALL 0x00000004 +#define PCRE_EXTENDED 0x00000008 +#define PCRE_ANCHORED 0x00000010 +#define PCRE_DOLLAR_ENDONLY 0x00000020 +#define PCRE_EXTRA 0x00000040 +#define PCRE_NOTBOL 0x00000080 +#define PCRE_NOTEOL 0x00000100 +#define PCRE_UNGREEDY 0x00000200 +#define PCRE_NOTEMPTY 0x00000400 +#define PCRE_UTF8 0x00000800 +#define PCRE_NO_AUTO_CAPTURE 0x00001000 +#define PCRE_NO_UTF8_CHECK 0x00002000 +#define PCRE_AUTO_CALLOUT 0x00004000 +#define PCRE_PARTIAL 0x00008000 +#define PCRE_DFA_SHORTEST 0x00010000 +#define PCRE_DFA_RESTART 0x00020000 +#define PCRE_FIRSTLINE 0x00040000 + +/* Exec-time and get/set-time error codes */ + +#define PCRE_ERROR_NOMATCH (-1) +#define PCRE_ERROR_NULL (-2) +#define PCRE_ERROR_BADOPTION (-3) +#define PCRE_ERROR_BADMAGIC (-4) +#define PCRE_ERROR_UNKNOWN_NODE (-5) +#define PCRE_ERROR_NOMEMORY (-6) +#define PCRE_ERROR_NOSUBSTRING (-7) +#define PCRE_ERROR_MATCHLIMIT (-8) +#define PCRE_ERROR_CALLOUT (-9) /* Never used by PCRE itself */ +#define PCRE_ERROR_BADUTF8 (-10) +#define PCRE_ERROR_BADUTF8_OFFSET (-11) +#define PCRE_ERROR_PARTIAL (-12) +#define PCRE_ERROR_BADPARTIAL (-13) +#define PCRE_ERROR_INTERNAL (-14) +#define PCRE_ERROR_BADCOUNT (-15) +#define PCRE_ERROR_DFA_UITEM (-16) +#define PCRE_ERROR_DFA_UCOND (-17) +#define PCRE_ERROR_DFA_UMLIMIT (-18) +#define PCRE_ERROR_DFA_WSSIZE (-19) +#define PCRE_ERROR_DFA_RECURSE (-20) + +/* Request types for pcre_fullinfo() */ + +#define PCRE_INFO_OPTIONS 0 +#define PCRE_INFO_SIZE 1 +#define PCRE_INFO_CAPTURECOUNT 2 +#define PCRE_INFO_BACKREFMAX 3 +#define PCRE_INFO_FIRSTBYTE 4 +#define PCRE_INFO_FIRSTCHAR 4 /* For backwards compatibility */ +#define PCRE_INFO_FIRSTTABLE 5 +#define PCRE_INFO_LASTLITERAL 6 +#define PCRE_INFO_NAMEENTRYSIZE 7 +#define PCRE_INFO_NAMECOUNT 8 +#define PCRE_INFO_NAMETABLE 9 +#define PCRE_INFO_STUDYSIZE 10 +#define PCRE_INFO_DEFAULT_TABLES 11 + +/* Request types for pcre_config() */ + +#define PCRE_CONFIG_UTF8 0 +#define PCRE_CONFIG_NEWLINE 1 +#define PCRE_CONFIG_LINK_SIZE 2 +#define PCRE_CONFIG_POSIX_MALLOC_THRESHOLD 3 +#define PCRE_CONFIG_MATCH_LIMIT 4 +#define PCRE_CONFIG_STACKRECURSE 5 +#define PCRE_CONFIG_UNICODE_PROPERTIES 6 + +/* Bit flags for the pcre_extra structure */ + +#define PCRE_EXTRA_STUDY_DATA 0x0001 +#define PCRE_EXTRA_MATCH_LIMIT 0x0002 +#define PCRE_EXTRA_CALLOUT_DATA 0x0004 +#define PCRE_EXTRA_TABLES 0x0008 + +/* Types */ + +struct real_pcre; /* declaration; the definition is private */ +typedef struct real_pcre pcre; + +/* The structure for passing additional data to pcre_exec(). This is defined in +such as way as to be extensible. Always add new fields at the end, in order to +remain compatible. */ + +typedef struct pcre_extra { + unsigned long int flags; /* Bits for which fields are set */ + void *study_data; /* Opaque data from pcre_study() */ + unsigned long int match_limit; /* Maximum number of calls to match() */ + void *callout_data; /* Data passed back in callouts */ + const unsigned char *tables; /* Pointer to character tables */ +} pcre_extra; + +/* The structure for passing out data via the pcre_callout_function. We use a +structure so that new fields can be added on the end in future versions, +without changing the API of the function, thereby allowing old clients to work +without modification. */ + +typedef struct pcre_callout_block { + int version; /* Identifies version of block */ + /* ------------------------ Version 0 ------------------------------- */ + int callout_number; /* Number compiled into pattern */ + int *offset_vector; /* The offset vector */ + const char *subject; /* The subject being matched */ + int subject_length; /* The length of the subject */ + int start_match; /* Offset to start of this match attempt */ + int current_position; /* Where we currently are in the subject */ + int capture_top; /* Max current capture */ + int capture_last; /* Most recently closed capture */ + void *callout_data; /* Data passed in with the call */ + /* ------------------- Added for Version 1 -------------------------- */ + int pattern_position; /* Offset to next item in the pattern */ + int next_item_length; /* Length of next item in the pattern */ + /* ------------------------------------------------------------------ */ +} pcre_callout_block; + +/* Indirection for store get and free functions. These can be set to +alternative malloc/free functions if required. Special ones are used in the +non-recursive case for "frames". There is also an optional callout function +that is triggered by the (?) regex item. For Virtual Pascal, these definitions +have to take another form. */ + +#ifndef VPCOMPAT +PCRE_DATA_SCOPE void *(*pcre_malloc)(size_t); +PCRE_DATA_SCOPE void (*pcre_free)(void *); +PCRE_DATA_SCOPE void *(*pcre_stack_malloc)(size_t); +PCRE_DATA_SCOPE void (*pcre_stack_free)(void *); +PCRE_DATA_SCOPE int (*pcre_callout)(pcre_callout_block *); +#else /* VPCOMPAT */ +PCRE_DATA_SCOPE void *pcre_malloc(size_t); +PCRE_DATA_SCOPE void pcre_free(void *); +PCRE_DATA_SCOPE void *pcre_stack_malloc(size_t); +PCRE_DATA_SCOPE void pcre_stack_free(void *); +PCRE_DATA_SCOPE int pcre_callout(pcre_callout_block *); +#endif /* VPCOMPAT */ + +/* Exported PCRE functions */ + +PCRE_DATA_SCOPE pcre *pcre_compile(const char *, int, const char **, int *, + const unsigned char *); +PCRE_DATA_SCOPE pcre *pcre_compile2(const char *, int, int *, const char **, + int *, const unsigned char *); +PCRE_DATA_SCOPE int pcre_config(int, void *); +PCRE_DATA_SCOPE int pcre_copy_named_substring(const pcre *, const char *, + int *, int, const char *, char *, int); +PCRE_DATA_SCOPE int pcre_copy_substring(const char *, int *, int, int, char *, + int); +PCRE_DATA_SCOPE int pcre_dfa_exec(const pcre *, const pcre_extra *, + const char *, int, int, int, int *, int , int *, int); +PCRE_DATA_SCOPE int pcre_exec(const pcre *, const pcre_extra *, const char *, + int, int, int, int *, int); +PCRE_DATA_SCOPE void pcre_free_substring(const char *); +PCRE_DATA_SCOPE void pcre_free_substring_list(const char **); +PCRE_DATA_SCOPE int pcre_fullinfo(const pcre *, const pcre_extra *, int, + void *); +PCRE_DATA_SCOPE int pcre_get_named_substring(const pcre *, const char *, + int *, int, const char *, const char **); +PCRE_DATA_SCOPE int pcre_get_stringnumber(const pcre *, const char *); +PCRE_DATA_SCOPE int pcre_get_substring(const char *, int *, int, int, + const char **); +PCRE_DATA_SCOPE int pcre_get_substring_list(const char *, int *, int, + const char ***); +PCRE_DATA_SCOPE int pcre_info(const pcre *, int *, int *); +PCRE_DATA_SCOPE const unsigned char *pcre_maketables(void); +PCRE_DATA_SCOPE int pcre_refcount(pcre *, int); +PCRE_DATA_SCOPE pcre_extra *pcre_study(const pcre *, int, const char **); +PCRE_DATA_SCOPE const char *pcre_version(void); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* End of pcre.h */ diff --git a/mozilla/js/tamarin/pcre/pcre.h.in b/mozilla/js/tamarin/pcre/pcre.h.in new file mode 100644 index 00000000000..be1546c4e19 --- /dev/null +++ b/mozilla/js/tamarin/pcre/pcre.h.in @@ -0,0 +1,258 @@ +/************************************************* +* Perl-Compatible Regular Expressions * +*************************************************/ + +/* In its original form, this is the .in file that is transformed by +"configure" into pcre.h. + + Copyright (c) 1997-2005 University of Cambridge + +----------------------------------------------------------------------------- +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + * Neither the name of the University of Cambridge nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +----------------------------------------------------------------------------- +*/ + +#ifndef _PCRE_H +#define _PCRE_H + +/* The file pcre.h is build by "configure". Do not edit it; instead +make changes to pcre.in. */ + +#define PCRE_MAJOR @PCRE_MAJOR@ +#define PCRE_MINOR @PCRE_MINOR@ +#define PCRE_DATE @PCRE_DATE@ + +/* Win32 uses DLL by default; it needs special stuff for exported functions. */ + +#ifdef _WIN32 +# ifdef PCRE_DEFINITION +# ifdef DLL_EXPORT +# define PCRE_DATA_SCOPE __declspec(dllexport) +# endif +# else +# ifndef PCRE_STATIC +# define PCRE_DATA_SCOPE extern __declspec(dllimport) +# endif +# endif +#endif + +/* For other operating systems, we use the standard "extern". */ + +#ifndef PCRE_DATA_SCOPE +# ifdef __cplusplus +# define PCRE_DATA_SCOPE extern "C" +# else +# define PCRE_DATA_SCOPE extern +# endif +#endif + +/* Have to include stdlib.h in order to ensure that size_t is defined; +it is needed here for malloc. */ + +#include + +/* Allow for C++ users */ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Options */ + +#define PCRE_CASELESS 0x00000001 +#define PCRE_MULTILINE 0x00000002 +#define PCRE_DOTALL 0x00000004 +#define PCRE_EXTENDED 0x00000008 +#define PCRE_ANCHORED 0x00000010 +#define PCRE_DOLLAR_ENDONLY 0x00000020 +#define PCRE_EXTRA 0x00000040 +#define PCRE_NOTBOL 0x00000080 +#define PCRE_NOTEOL 0x00000100 +#define PCRE_UNGREEDY 0x00000200 +#define PCRE_NOTEMPTY 0x00000400 +#define PCRE_UTF8 0x00000800 +#define PCRE_NO_AUTO_CAPTURE 0x00001000 +#define PCRE_NO_UTF8_CHECK 0x00002000 +#define PCRE_AUTO_CALLOUT 0x00004000 +#define PCRE_PARTIAL 0x00008000 +#define PCRE_DFA_SHORTEST 0x00010000 +#define PCRE_DFA_RESTART 0x00020000 +#define PCRE_FIRSTLINE 0x00040000 + +/* Exec-time and get/set-time error codes */ + +#define PCRE_ERROR_NOMATCH (-1) +#define PCRE_ERROR_NULL (-2) +#define PCRE_ERROR_BADOPTION (-3) +#define PCRE_ERROR_BADMAGIC (-4) +#define PCRE_ERROR_UNKNOWN_NODE (-5) +#define PCRE_ERROR_NOMEMORY (-6) +#define PCRE_ERROR_NOSUBSTRING (-7) +#define PCRE_ERROR_MATCHLIMIT (-8) +#define PCRE_ERROR_CALLOUT (-9) /* Never used by PCRE itself */ +#define PCRE_ERROR_BADUTF8 (-10) +#define PCRE_ERROR_BADUTF8_OFFSET (-11) +#define PCRE_ERROR_PARTIAL (-12) +#define PCRE_ERROR_BADPARTIAL (-13) +#define PCRE_ERROR_INTERNAL (-14) +#define PCRE_ERROR_BADCOUNT (-15) +#define PCRE_ERROR_DFA_UITEM (-16) +#define PCRE_ERROR_DFA_UCOND (-17) +#define PCRE_ERROR_DFA_UMLIMIT (-18) +#define PCRE_ERROR_DFA_WSSIZE (-19) +#define PCRE_ERROR_DFA_RECURSE (-20) + +/* Request types for pcre_fullinfo() */ + +#define PCRE_INFO_OPTIONS 0 +#define PCRE_INFO_SIZE 1 +#define PCRE_INFO_CAPTURECOUNT 2 +#define PCRE_INFO_BACKREFMAX 3 +#define PCRE_INFO_FIRSTBYTE 4 +#define PCRE_INFO_FIRSTCHAR 4 /* For backwards compatibility */ +#define PCRE_INFO_FIRSTTABLE 5 +#define PCRE_INFO_LASTLITERAL 6 +#define PCRE_INFO_NAMEENTRYSIZE 7 +#define PCRE_INFO_NAMECOUNT 8 +#define PCRE_INFO_NAMETABLE 9 +#define PCRE_INFO_STUDYSIZE 10 +#define PCRE_INFO_DEFAULT_TABLES 11 + +/* Request types for pcre_config() */ + +#define PCRE_CONFIG_UTF8 0 +#define PCRE_CONFIG_NEWLINE 1 +#define PCRE_CONFIG_LINK_SIZE 2 +#define PCRE_CONFIG_POSIX_MALLOC_THRESHOLD 3 +#define PCRE_CONFIG_MATCH_LIMIT 4 +#define PCRE_CONFIG_STACKRECURSE 5 +#define PCRE_CONFIG_UNICODE_PROPERTIES 6 + +/* Bit flags for the pcre_extra structure */ + +#define PCRE_EXTRA_STUDY_DATA 0x0001 +#define PCRE_EXTRA_MATCH_LIMIT 0x0002 +#define PCRE_EXTRA_CALLOUT_DATA 0x0004 +#define PCRE_EXTRA_TABLES 0x0008 + +/* Types */ + +struct real_pcre; /* declaration; the definition is private */ +typedef struct real_pcre pcre; + +/* The structure for passing additional data to pcre_exec(). This is defined in +such as way as to be extensible. Always add new fields at the end, in order to +remain compatible. */ + +typedef struct pcre_extra { + unsigned long int flags; /* Bits for which fields are set */ + void *study_data; /* Opaque data from pcre_study() */ + unsigned long int match_limit; /* Maximum number of calls to match() */ + void *callout_data; /* Data passed back in callouts */ + const unsigned char *tables; /* Pointer to character tables */ +} pcre_extra; + +/* The structure for passing out data via the pcre_callout_function. We use a +structure so that new fields can be added on the end in future versions, +without changing the API of the function, thereby allowing old clients to work +without modification. */ + +typedef struct pcre_callout_block { + int version; /* Identifies version of block */ + /* ------------------------ Version 0 ------------------------------- */ + int callout_number; /* Number compiled into pattern */ + int *offset_vector; /* The offset vector */ + const char *subject; /* The subject being matched */ + int subject_length; /* The length of the subject */ + int start_match; /* Offset to start of this match attempt */ + int current_position; /* Where we currently are in the subject */ + int capture_top; /* Max current capture */ + int capture_last; /* Most recently closed capture */ + void *callout_data; /* Data passed in with the call */ + /* ------------------- Added for Version 1 -------------------------- */ + int pattern_position; /* Offset to next item in the pattern */ + int next_item_length; /* Length of next item in the pattern */ + /* ------------------------------------------------------------------ */ +} pcre_callout_block; + +/* Indirection for store get and free functions. These can be set to +alternative malloc/free functions if required. Special ones are used in the +non-recursive case for "frames". There is also an optional callout function +that is triggered by the (?) regex item. For Virtual Pascal, these definitions +have to take another form. */ + +#ifndef VPCOMPAT +PCRE_DATA_SCOPE void *(*pcre_malloc)(size_t); +PCRE_DATA_SCOPE void (*pcre_free)(void *); +PCRE_DATA_SCOPE void *(*pcre_stack_malloc)(size_t); +PCRE_DATA_SCOPE void (*pcre_stack_free)(void *); +PCRE_DATA_SCOPE int (*pcre_callout)(pcre_callout_block *); +#else /* VPCOMPAT */ +PCRE_DATA_SCOPE void *pcre_malloc(size_t); +PCRE_DATA_SCOPE void pcre_free(void *); +PCRE_DATA_SCOPE void *pcre_stack_malloc(size_t); +PCRE_DATA_SCOPE void pcre_stack_free(void *); +PCRE_DATA_SCOPE int pcre_callout(pcre_callout_block *); +#endif /* VPCOMPAT */ + +/* Exported PCRE functions */ + +PCRE_DATA_SCOPE pcre *pcre_compile(const char *, int, const char **, int *, + const unsigned char *); +PCRE_DATA_SCOPE pcre *pcre_compile2(const char *, int, int *, const char **, + int *, const unsigned char *); +PCRE_DATA_SCOPE int pcre_config(int, void *); +PCRE_DATA_SCOPE int pcre_copy_named_substring(const pcre *, const char *, + int *, int, const char *, char *, int); +PCRE_DATA_SCOPE int pcre_copy_substring(const char *, int *, int, int, char *, + int); +PCRE_DATA_SCOPE int pcre_dfa_exec(const pcre *, const pcre_extra *, + const char *, int, int, int, int *, int , int *, int); +PCRE_DATA_SCOPE int pcre_exec(const pcre *, const pcre_extra *, const char *, + int, int, int, int *, int); +PCRE_DATA_SCOPE void pcre_free_substring(const char *); +PCRE_DATA_SCOPE void pcre_free_substring_list(const char **); +PCRE_DATA_SCOPE int pcre_fullinfo(const pcre *, const pcre_extra *, int, + void *); +PCRE_DATA_SCOPE int pcre_get_named_substring(const pcre *, const char *, + int *, int, const char *, const char **); +PCRE_DATA_SCOPE int pcre_get_stringnumber(const pcre *, const char *); +PCRE_DATA_SCOPE int pcre_get_substring(const char *, int *, int, int, + const char **); +PCRE_DATA_SCOPE int pcre_get_substring_list(const char *, int *, int, + const char ***); +PCRE_DATA_SCOPE int pcre_info(const pcre *, int *, int *); +PCRE_DATA_SCOPE const unsigned char *pcre_maketables(void); +PCRE_DATA_SCOPE int pcre_refcount(pcre *, int); +PCRE_DATA_SCOPE pcre_extra *pcre_study(const pcre *, int, const char **); +PCRE_DATA_SCOPE const char *pcre_version(void); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* End of pcre.h */ diff --git a/mozilla/js/tamarin/pcre/pcre_chartables.cpp b/mozilla/js/tamarin/pcre/pcre_chartables.cpp new file mode 100644 index 00000000000..75fb2b518e1 --- /dev/null +++ b/mozilla/js/tamarin/pcre/pcre_chartables.cpp @@ -0,0 +1,186 @@ +#include "avmplus.h" +#include "pcre_internal.h" + +/************************************************* +* Perl-Compatible Regular Expressions * +*************************************************/ + +/* This file is automatically written by the dftables auxiliary +program. If you edit it by hand, you might like to edit the Makefile to +prevent its ever being regenerated. + +This file contains the default tables for characters with codes less than +128 (ASCII characters). These tables are used when no external tables are +passed to PCRE. */ + +const uschar _pcre_default_tables[] = { + +/* This table is a lower casing table. */ + + 0, 1, 2, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, + 64, 97, 98, 99,100,101,102,103, + 104,105,106,107,108,109,110,111, + 112,113,114,115,116,117,118,119, + 120,121,122, 91, 92, 93, 94, 95, + 96, 97, 98, 99,100,101,102,103, + 104,105,106,107,108,109,110,111, + 112,113,114,115,116,117,118,119, + 120,121,122,123,124,125,126,127, + 128,129,130,131,132,133,134,135, + 136,137,138,139,140,141,142,143, + 144,145,146,147,148,149,150,151, + 152,153,154,155,156,157,158,159, + 160,161,162,163,164,165,166,167, + 168,169,170,171,172,173,174,175, + 176,177,178,179,180,181,182,183, + 184,185,186,187,188,189,190,191, + 192,193,194,195,196,197,198,199, + 200,201,202,203,204,205,206,207, + 208,209,210,211,212,213,214,215, + 216,217,218,219,220,221,222,223, + 224,225,226,227,228,229,230,231, + 232,233,234,235,236,237,238,239, + 240,241,242,243,244,245,246,247, + 248,249,250,251,252,253,254,255, + +/* This table is a case flipping table. */ + + 0, 1, 2, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, + 64, 97, 98, 99,100,101,102,103, + 104,105,106,107,108,109,110,111, + 112,113,114,115,116,117,118,119, + 120,121,122, 91, 92, 93, 94, 95, + 96, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90,123,124,125,126,127, + 128,129,130,131,132,133,134,135, + 136,137,138,139,140,141,142,143, + 144,145,146,147,148,149,150,151, + 152,153,154,155,156,157,158,159, + 160,161,162,163,164,165,166,167, + 168,169,170,171,172,173,174,175, + 176,177,178,179,180,181,182,183, + 184,185,186,187,188,189,190,191, + 192,193,194,195,196,197,198,199, + 200,201,202,203,204,205,206,207, + 208,209,210,211,212,213,214,215, + 216,217,218,219,220,221,222,223, + 224,225,226,227,228,229,230,231, + 232,233,234,235,236,237,238,239, + 240,241,242,243,244,245,246,247, + 248,249,250,251,252,253,254,255, + +/* This table contains bit maps for various character classes. +Each map is 32 bytes long and the bits run from the least +significant end of each byte. The classes that have their own +maps are: space, xdigit, digit, upper, lower, word, graph +print, punct, and cntrl. Other classes are built from combinations. */ + + 0x00,0x3e,0x00,0x00,0x01,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + + 0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x03, + 0x7e,0x00,0x00,0x00,0x7e,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + + 0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x03, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xfe,0xff,0xff,0x07,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0x07, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + + 0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x03, + 0xfe,0xff,0xff,0x87,0xfe,0xff,0xff,0x07, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + + 0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + + 0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + + 0x00,0x00,0x00,0x00,0xfe,0xff,0x00,0xfc, + 0x01,0x00,0x00,0xf8,0x01,0x00,0x00,0x78, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + + 0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + +/* This table identifies various classes of character by individual bits: + 0x01 white space character + 0x02 letter + 0x04 decimal digit + 0x08 hexadecimal digit + 0x10 alphanumeric or '_' + 0x80 regular expression metacharacter or binary zero +*/ + + 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 0- 7 */ + 0x00,0x01,0x01,0x00,0x01,0x01,0x00,0x00, /* 8- 15 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 16- 23 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 24- 31 */ + 0x01,0x00,0x00,0x00,0x80,0x00,0x00,0x00, /* - ' */ + 0x80,0x80,0x80,0x80,0x00,0x00,0x80,0x00, /* ( - / */ + 0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c, /* 0 - 7 */ + 0x1c,0x1c,0x00,0x00,0x00,0x00,0x00,0x80, /* 8 - ? */ + 0x00,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x12, /* @ - G */ + 0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /* H - O */ + 0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /* P - W */ + 0x12,0x12,0x12,0x80,0x00,0x00,0x80,0x10, /* X - _ */ + 0x00,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x12, /* ` - g */ + 0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /* h - o */ + 0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /* p - w */ + 0x12,0x12,0x12,0x80,0x80,0x00,0x00,0x00, /* x -127 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 128-135 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 136-143 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 144-151 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 152-159 */ + 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 160-167 */ // cn: unicode/ecma support: 160 is UNICODE_NOBREAK_SPACE + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 168-175 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 176-183 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 184-191 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 192-199 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 200-207 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 208-215 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 216-223 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 224-231 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 232-239 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 240-247 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};/* 248-255 */ + +/* End of chartables.c */ diff --git a/mozilla/js/tamarin/pcre/pcre_compile.cpp b/mozilla/js/tamarin/pcre/pcre_compile.cpp new file mode 100644 index 00000000000..db1ee725524 --- /dev/null +++ b/mozilla/js/tamarin/pcre/pcre_compile.cpp @@ -0,0 +1,5131 @@ +#include "avmplus.h" + +/************************************************* +* Perl-Compatible Regular Expressions * +*************************************************/ + +/* PCRE is a library of functions to support regular expressions whose syntax +and semantics are as close as possible to those of the Perl 5 language. + + Written by Philip Hazel + Copyright (c) 1997-2005 University of Cambridge + +----------------------------------------------------------------------------- +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + * Neither the name of the University of Cambridge nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +----------------------------------------------------------------------------- +*/ + + +/* This module contains the external function pcre_compile(), along with +supporting internal functions that are not used by other modules. */ + + +#include "pcre_internal.h" + + +/* When DEBUG is defined, we need the pcre_printint() function, which is also +used by pcretest. DEBUG is not defined when building a production library. */ + +#ifdef DEBUG +#include "pcre_printint.src" +#endif + + + +/************************************************* +* Code parameters and static tables * +*************************************************/ + +/* Maximum number of items on the nested bracket stacks at compile time. This +applies to the nesting of all kinds of parentheses. It does not limit +un-nested, non-capturing parentheses. This number can be made bigger if +necessary - it is used to dimension one int and one unsigned char vector at +compile time. */ + +#define BRASTACK_SIZE 200 + + +/* Table for handling escaped characters in the range '0'-'z'. Positive returns +are simple data values; negative values are for special things like \d and so +on. Zero means further processing is needed (for things like \x), or the escape +is invalid. */ + +#if !EBCDIC /* This is the "normal" table for ASCII systems */ +static const short int escapes[] = { + 0, 0, 0, 0, 0, 0, 0, 0, /* 0 - 7 */ + 0, 0, ':', ';', '<', '=', '>', '?', /* 8 - ? */ + '@', -ESC_A, -ESC_B, -ESC_C, -ESC_D, -ESC_E, 0, -ESC_G, /* @ - G */ + 0, 0, 0, 0, 0, 0, 0, 0, /* H - O */ +-ESC_P, -ESC_Q, 0, -ESC_S, 0, 0, 0, -ESC_W, /* P - W */ +-ESC_X, 0, -ESC_Z, '[', '\\', ']', '^', '_', /* X - _ */ + '`', 7, -ESC_b, 0, -ESC_d, ESC_e, ESC_f, 0, /* ` - g */ + 0, 0, 0, 0, 0, 0, ESC_n, 0, /* h - o */ +-ESC_p, 0, ESC_r, -ESC_s, ESC_tee, 0, 0, -ESC_w, /* p - w */ + 0, 0, -ESC_z /* x - z */ +}; + +#else /* This is the "abnormal" table for EBCDIC systems */ +static const short int escapes[] = { +/* 48 */ 0, 0, 0, '.', '<', '(', '+', '|', +/* 50 */ '&', 0, 0, 0, 0, 0, 0, 0, +/* 58 */ 0, 0, '!', '$', '*', ')', ';', '~', +/* 60 */ '-', '/', 0, 0, 0, 0, 0, 0, +/* 68 */ 0, 0, '|', ',', '%', '_', '>', '?', +/* 70 */ 0, 0, 0, 0, 0, 0, 0, 0, +/* 78 */ 0, '`', ':', '#', '@', '\'', '=', '"', +/* 80 */ 0, 7, -ESC_b, 0, -ESC_d, ESC_e, ESC_f, 0, +/* 88 */ 0, 0, 0, '{', 0, 0, 0, 0, +/* 90 */ 0, 0, 0, 'l', 0, ESC_n, 0, -ESC_p, +/* 98 */ 0, ESC_r, 0, '}', 0, 0, 0, 0, +/* A0 */ 0, '~', -ESC_s, ESC_tee, 0, 0, -ESC_w, 0, +/* A8 */ 0,-ESC_z, 0, 0, 0, '[', 0, 0, +/* B0 */ 0, 0, 0, 0, 0, 0, 0, 0, +/* B8 */ 0, 0, 0, 0, 0, ']', '=', '-', +/* C0 */ '{',-ESC_A, -ESC_B, -ESC_C, -ESC_D,-ESC_E, 0, -ESC_G, +/* C8 */ 0, 0, 0, 0, 0, 0, 0, 0, +/* D0 */ '}', 0, 0, 0, 0, 0, 0, -ESC_P, +/* D8 */-ESC_Q, 0, 0, 0, 0, 0, 0, 0, +/* E0 */ '\\', 0, -ESC_S, 0, 0, 0, -ESC_W, -ESC_X, +/* E8 */ 0,-ESC_Z, 0, 0, 0, 0, 0, 0, +/* F0 */ 0, 0, 0, 0, 0, 0, 0, 0, +/* F8 */ 0, 0, 0, 0, 0, 0, 0, 0 +}; +#endif + + +/* Tables of names of POSIX character classes and their lengths. The list is +terminated by a zero length entry. The first three must be alpha, upper, lower, +as this is assumed for handling case independence. */ + +static const char *const posix_names[] = { + "alpha", "lower", "upper", + "alnum", "ascii", "blank", "cntrl", "digit", "graph", + "print", "punct", "space", "word", "xdigit" }; + +static const uschar posix_name_lengths[] = { + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 4, 6, 0 }; + +/* Table of class bit maps for each POSIX class; up to three may be combined +to form the class. The table for [:blank:] is dynamically modified to remove +the vertical space characters. */ + +static const int posix_class_maps[] = { + cbit_lower, cbit_upper, -1, /* alpha */ + cbit_lower, -1, -1, /* lower */ + cbit_upper, -1, -1, /* upper */ + cbit_digit, cbit_lower, cbit_upper, /* alnum */ + cbit_print, cbit_cntrl, -1, /* ascii */ + cbit_space, -1, -1, /* blank - a GNU extension */ + cbit_cntrl, -1, -1, /* cntrl */ + cbit_digit, -1, -1, /* digit */ + cbit_graph, -1, -1, /* graph */ + cbit_print, -1, -1, /* print */ + cbit_punct, -1, -1, /* punct */ + cbit_space, -1, -1, /* space */ + cbit_word, -1, -1, /* word - a Perl extension */ + cbit_xdigit,-1, -1 /* xdigit */ +}; + + +/* The texts of compile-time error messages. These are "char *" because they +are passed to the outside world. */ + +static const char *error_texts[] = { + "no error", + "\\ at end of pattern", + "\\c at end of pattern", + "unrecognized character follows \\", + "numbers out of order in {} quantifier", + /* 5 */ + "number too big in {} quantifier", + "missing terminating ] for character class", + "invalid escape sequence in character class", + "range out of order in character class", + "nothing to repeat", + /* 10 */ + "operand of unlimited repeat could match the empty string", + "internal error: unexpected repeat", + "unrecognized character after (?", + "POSIX named classes are supported only within a class", + "missing )", + /* 15 */ + "reference to non-existent subpattern", + "erroffset passed as NULL", + "unknown option bit(s) set", + "missing ) after comment", + "parentheses nested too deeply", + /* 20 */ + "regular expression too large", + "failed to get memory", + "unmatched parentheses", + "internal error: code overflow", + "unrecognized character after (?<", + /* 25 */ + "lookbehind assertion is not fixed length", + "malformed number after (?(", + "conditional group contains more than two branches", + "assertion expected after (?(", + "(?R or (?digits must be followed by )", + /* 30 */ + "unknown POSIX class name", + "POSIX collating elements are not supported", + "this version of PCRE is not compiled with PCRE_UTF8 support", + "spare error", + "character value in \\x{...} sequence is too large", + /* 35 */ + "invalid condition (?(0)", + "\\C not allowed in lookbehind assertion", + "PCRE does not support \\L, \\l, \\N, \\U, or \\u", + "number after (?C is > 255", + "closing ) for (?C expected", + /* 40 */ + "recursive call could loop indefinitely", + "unrecognized character after (?P", + "syntax error after (?P", + "two named groups have the same name", + "invalid UTF-8 string", + /* 45 */ + "support for \\P, \\p, and \\X has not been compiled", + "malformed \\P or \\p sequence", + "unknown property name after \\P or \\p" +}; + + +/* Table to identify digits and hex digits. This is used when compiling +patterns. Note that the tables in chartables are dependent on the locale, and +may mark arbitrary characters as digits - but the PCRE compiling code expects +to handle only 0-9, a-z, and A-Z as digits when compiling. That is why we have +a private table here. It costs 256 bytes, but it is a lot faster than doing +character value tests (at least in some simple cases I timed), and in some +applications one wants PCRE to compile efficiently as well as match +efficiently. + +For convenience, we use the same bit definitions as in chartables: + + 0x04 decimal digit + 0x08 hexadecimal digit + +Then we can use ctype_digit and ctype_xdigit in the code. */ + +#if !EBCDIC /* This is the "normal" case, for ASCII systems */ +static const unsigned char digitab[] = + { + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 0- 7 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 8- 15 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 16- 23 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 24- 31 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* - ' */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* ( - / */ + 0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c, /* 0 - 7 */ + 0x0c,0x0c,0x00,0x00,0x00,0x00,0x00,0x00, /* 8 - ? */ + 0x00,0x08,0x08,0x08,0x08,0x08,0x08,0x00, /* @ - G */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* H - O */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* P - W */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* X - _ */ + 0x00,0x08,0x08,0x08,0x08,0x08,0x08,0x00, /* ` - g */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* h - o */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* p - w */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* x -127 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 128-135 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 136-143 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 144-151 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 152-159 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 160-167 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 168-175 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 176-183 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 184-191 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 192-199 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 200-207 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 208-215 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 216-223 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 224-231 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 232-239 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 240-247 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};/* 248-255 */ + +#else /* This is the "abnormal" case, for EBCDIC systems */ +static const unsigned char digitab[] = + { + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 0- 7 0 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 8- 15 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 16- 23 10 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 24- 31 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 32- 39 20 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 40- 47 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 48- 55 30 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 56- 63 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* - 71 40 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 72- | */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* & - 87 50 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 88- ¬ */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* - -103 60 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 104- ? */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 112-119 70 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 120- " */ + 0x00,0x08,0x08,0x08,0x08,0x08,0x08,0x00, /* 128- g 80 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* h -143 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 144- p 90 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* q -159 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 160- x A0 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* y -175 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* ^ -183 B0 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 184-191 */ + 0x00,0x08,0x08,0x08,0x08,0x08,0x08,0x00, /* { - G C0 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* H -207 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* } - P D0 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* Q -223 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* \ - X E0 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* Y -239 */ + 0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c, /* 0 - 7 F0 */ + 0x0c,0x0c,0x00,0x00,0x00,0x00,0x00,0x00};/* 8 -255 */ + +static const unsigned char ebcdic_chartab[] = { /* chartable partial dup */ + 0x80,0x00,0x00,0x00,0x00,0x01,0x00,0x00, /* 0- 7 */ + 0x00,0x00,0x00,0x00,0x01,0x01,0x00,0x00, /* 8- 15 */ + 0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00, /* 16- 23 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 24- 31 */ + 0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00, /* 32- 39 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 40- 47 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 48- 55 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 56- 63 */ + 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* - 71 */ + 0x00,0x00,0x00,0x80,0x00,0x80,0x80,0x80, /* 72- | */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* & - 87 */ + 0x00,0x00,0x00,0x80,0x80,0x80,0x00,0x00, /* 88- ¬ */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* - -103 */ + 0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x80, /* 104- ? */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 112-119 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 120- " */ + 0x00,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x12, /* 128- g */ + 0x12,0x12,0x00,0x00,0x00,0x00,0x00,0x00, /* h -143 */ + 0x00,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /* 144- p */ + 0x12,0x12,0x00,0x00,0x00,0x00,0x00,0x00, /* q -159 */ + 0x00,0x00,0x12,0x12,0x12,0x12,0x12,0x12, /* 160- x */ + 0x12,0x12,0x00,0x00,0x00,0x00,0x00,0x00, /* y -175 */ + 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* ^ -183 */ + 0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00, /* 184-191 */ + 0x80,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x12, /* { - G */ + 0x12,0x12,0x00,0x00,0x00,0x00,0x00,0x00, /* H -207 */ + 0x00,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /* } - P */ + 0x12,0x12,0x00,0x00,0x00,0x00,0x00,0x00, /* Q -223 */ + 0x00,0x00,0x12,0x12,0x12,0x12,0x12,0x12, /* \ - X */ + 0x12,0x12,0x00,0x00,0x00,0x00,0x00,0x00, /* Y -239 */ + 0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c, /* 0 - 7 */ + 0x1c,0x1c,0x00,0x00,0x00,0x00,0x00,0x00};/* 8 -255 */ +#endif + + +/* Definition to allow mutual recursion */ + +static BOOL + compile_regex(int, int, int *, uschar **, const uschar **, int *, BOOL, int, + int *, int *, branch_chain *, compile_data *); + + + +/************************************************* +* Handle escapes * +*************************************************/ + +/* This function is called when a \ has been encountered. It either returns a +positive value for a simple escape such as \n, or a negative value which +encodes one of the more complicated things such as \d. When UTF-8 is enabled, +a positive value greater than 255 may be returned. On entry, ptr is pointing at +the \. On exit, it is on the final character of the escape sequence. + +Arguments: + ptrptr points to the pattern position pointer + errorcodeptr points to the errorcode variable + bracount number of previous extracting brackets + options the options bits + isclass TRUE if inside a character class + +Returns: zero or positive => a data character + negative => a special escape sequence + on error, errorptr is set +*/ + +static int +check_escape(const uschar **ptrptr, int *errorcodeptr, int bracount, + int options, BOOL isclass) +{ +const uschar *ptr = *ptrptr; +int c, i; + +/* If backslash is at the end of the pattern, it's an error. */ + +c = *(++ptr); +if (c == 0) *errorcodeptr = ERR1; + +/* Non-alphamerics are literals. For digits or letters, do an initial lookup in +a table. A non-zero result is something that can be returned immediately. +Otherwise further processing may be required. */ + +#if !EBCDIC /* ASCII coding */ +else if (c < '0' || c > 'z') {} /* Not alphameric */ +else if ((i = escapes[c - '0']) != 0) c = i; + +#else /* EBCDIC coding */ +else if (c < 'a' || (ebcdic_chartab[c] & 0x0E) == 0) {} /* Not alphameric */ +else if ((i = escapes[c - 0x48]) != 0) c = i; +#endif + +/* Escapes that need further processing, or are illegal. */ + +else + { + const uschar *oldptr; + switch (c) + { + /* A number of Perl escapes are not handled by PCRE. We give an explicit + error. */ + + case 'l': + case 'L': + case 'N': + case 'u': + case 'U': + *errorcodeptr = ERR37; + break; + + /* The handling of escape sequences consisting of a string of digits + starting with one that is not zero is not straightforward. By experiment, + the way Perl works seems to be as follows: + + Outside a character class, the digits are read as a decimal number. If the + number is less than 10, or if there are that many previous extracting + left brackets, then it is a back reference. Otherwise, up to three octal + digits are read to form an escaped byte. Thus \123 is likely to be octal + 123 (cf \0123, which is octal 012 followed by the literal 3). If the octal + value is greater than 377, the least significant 8 bits are taken. Inside a + character class, \ followed by a digit is always an octal number. */ + + case '1': case '2': case '3': case '4': case '5': + case '6': case '7': case '8': case '9': + + if (!isclass) + { + oldptr = ptr; + c -= '0'; + while ((digitab[ptr[1]] & ctype_digit) != 0) + c = c * 10 + *(++ptr) - '0'; + if (c < 10 || c <= bracount) + { + c = -(ESC_REF + c); + break; + } + ptr = oldptr; /* Put the pointer back and fall through */ + } + + /* Handle an octal number following \. If the first digit is 8 or 9, Perl + generates a binary zero byte and treats the digit as a following literal. + Thus we have to pull back the pointer by one. */ + + if ((c = *ptr) >= '8') + { + ptr--; + c = 0; + break; + } + + /* \0 always starts an octal number, but we may drop through to here with a + larger first octal digit. */ + + case '0': + c -= '0'; + while(i++ < 2 && ptr[1] >= '0' && ptr[1] <= '7') + c = c * 8 + *(++ptr) - '0'; + c &= 255; /* Take least significant 8 bits */ + break; + + /* \x is complicated when UTF-8 is enabled. \x{ddd} is a character number + which can be greater than 0xff, but only if the ddd are hex digits. */ + + case 'x': +#ifdef SUPPORT_UTF8 + if (ptr[1] == '{' && (options & PCRE_UTF8) != 0) + { + const uschar *pt = ptr + 2; + register int count = 0; + c = 0; + while ((digitab[*pt] & ctype_xdigit) != 0) + { + int cc = *pt++; + count++; +#if !EBCDIC /* ASCII coding */ + if (cc >= 'a') cc -= 32; /* Convert to upper case */ + c = c * 16 + cc - ((cc < 'A')? '0' : ('A' - 10)); +#else /* EBCDIC coding */ + if (cc >= 'a' && cc <= 'z') cc += 64; /* Convert to upper case */ + c = c * 16 + cc - ((cc >= '0')? '0' : ('A' - 10)); +#endif + } + if (*pt == '}') + { + if (c < 0 || count > 8) *errorcodeptr = ERR34; + ptr = pt; + break; + } + /* If the sequence of hex digits does not end with '}', then we don't + recognize this construct; fall through to the normal \x handling. */ + } +#endif + + /* Read just a single hex char */ + + c = 0; + while (i++ < 2 && (digitab[ptr[1]] & ctype_xdigit) != 0) + { + int cc; /* Some compilers don't like ++ */ + cc = *(++ptr); /* in initializers */ +#if !EBCDIC /* ASCII coding */ + if (cc >= 'a') cc -= 32; /* Convert to upper case */ + c = c * 16 + cc - ((cc < 'A')? '0' : ('A' - 10)); +#else /* EBCDIC coding */ + if (cc <= 'z') cc += 64; /* Convert to upper case */ + c = c * 16 + cc - ((cc >= '0')? '0' : ('A' - 10)); +#endif + } + break; + + /* Other special escapes not starting with a digit are straightforward */ + + case 'c': + c = *(++ptr); + if (c == 0) + { + *errorcodeptr = ERR2; + return 0; + } + + /* A letter is upper-cased; then the 0x40 bit is flipped. This coding + is ASCII-specific, but then the whole concept of \cx is ASCII-specific. + (However, an EBCDIC equivalent has now been added.) */ + +#if !EBCDIC /* ASCII coding */ + if (c >= 'a' && c <= 'z') c -= 32; + c ^= 0x40; +#else /* EBCDIC coding */ + if (c >= 'a' && c <= 'z') c += 64; + c ^= 0xC0; +#endif + break; + + /* PCRE_EXTRA enables extensions to Perl in the matter of escapes. Any + other alphameric following \ is an error if PCRE_EXTRA was set; otherwise, + for Perl compatibility, it is a literal. This code looks a bit odd, but + there used to be some cases other than the default, and there may be again + in future, so I haven't "optimized" it. */ + + default: +#ifdef AVMPLUS_PCRE + if ((options & PCRE_EXTRA) != 0) + { + *errorcodeptr = ERR3; + } +#else + if ((options & PCRE_EXTRA) != 0) switch(c) + { + default: + *errorcodeptr = ERR3; + break; + } +#endif + break; + } + } + +*ptrptr = ptr; +return c; +} + + + +#ifdef SUPPORT_UCP +/************************************************* +* Handle \P and \p * +*************************************************/ + +/* This function is called after \P or \p has been encountered, provided that +PCRE is compiled with support for Unicode properties. On entry, ptrptr is +pointing at the P or p. On exit, it is pointing at the final character of the +escape sequence. + +Argument: + ptrptr points to the pattern position pointer + negptr points to a boolean that is set TRUE for negation else FALSE + errorcodeptr points to the error code variable + +Returns: value from ucp_type_table, or -1 for an invalid type +*/ + +static int +get_ucp(const uschar **ptrptr, BOOL *negptr, int *errorcodeptr) +{ +int c, i, bot, top; +const uschar *ptr = *ptrptr; +char name[4]; + +c = *(++ptr); +if (c == 0) goto ERROR_RETURN; + +*negptr = FALSE; + +/* \P or \p can be followed by a one- or two-character name in {}, optionally +preceded by ^ for negation. */ + +if (c == '{') + { + if (ptr[1] == '^') + { + *negptr = TRUE; + ptr++; + } + for (i = 0; i <= 2; i++) + { + c = *(++ptr); + if (c == 0) goto ERROR_RETURN; + if (c == '}') break; + name[i] = c; + } + if (c !='}') /* Try to distinguish error cases */ + { + while (*(++ptr) != 0 && *ptr != '}'); + if (*ptr == '}') goto UNKNOWN_RETURN; else goto ERROR_RETURN; + } + name[i] = 0; + } + +/* Otherwise there is just one following character */ + +else + { + name[0] = c; + name[1] = 0; + } + +*ptrptr = ptr; + +/* Search for a recognized property name using binary chop */ + +bot = 0; +top = _pcre_utt_size; + +while (bot < top) + { + i = (bot + top)/2; + c = strcmp(name, _pcre_utt[i].name); + if (c == 0) return _pcre_utt[i].value; + if (c > 0) bot = i + 1; else top = i; + } + +UNKNOWN_RETURN: +*errorcodeptr = ERR47; +*ptrptr = ptr; +return -1; + +ERROR_RETURN: +*errorcodeptr = ERR46; +*ptrptr = ptr; +return -1; +} +#endif + + + + +/************************************************* +* Check for counted repeat * +*************************************************/ + +/* This function is called when a '{' is encountered in a place where it might +start a quantifier. It looks ahead to see if it really is a quantifier or not. +It is only a quantifier if it is one of the forms {ddd} {ddd,} or {ddd,ddd} +where the ddds are digits. + +Arguments: + p pointer to the first char after '{' + +Returns: TRUE or FALSE +*/ + +static BOOL +is_counted_repeat(const uschar *p) +{ +if ((digitab[*p++] & ctype_digit) == 0) return FALSE; +while ((digitab[*p] & ctype_digit) != 0) p++; +if (*p == '}') return TRUE; + +if (*p++ != ',') return FALSE; +if (*p == '}') return TRUE; + +if ((digitab[*p++] & ctype_digit) == 0) return FALSE; +while ((digitab[*p] & ctype_digit) != 0) p++; + +return (*p == '}'); +} + + + +/************************************************* +* Read repeat counts * +*************************************************/ + +/* Read an item of the form {n,m} and return the values. This is called only +after is_counted_repeat() has confirmed that a repeat-count quantifier exists, +so the syntax is guaranteed to be correct, but we need to check the values. + +Arguments: + p pointer to first char after '{' + minp pointer to int for min + maxp pointer to int for max + returned as -1 if no max + errorcodeptr points to error code variable + +Returns: pointer to '}' on success; + current ptr on error, with errorcodeptr set non-zero +*/ + +static const uschar * +read_repeat_counts(const uschar *p, int *minp, int *maxp, int *errorcodeptr) +{ +int min = 0; +int max = -1; + +/* Read the minimum value and do a paranoid check: a negative value indicates +an integer overflow. */ + +while ((digitab[*p] & ctype_digit) != 0) min = min * 10 + *p++ - '0'; +if (min < 0 || min > 65535) + { + *errorcodeptr = ERR5; + return p; + } + +/* Read the maximum value if there is one, and again do a paranoid on its size. +Also, max must not be less than min. */ + +if (*p == '}') max = min; else + { + if (*(++p) != '}') + { + max = 0; + while((digitab[*p] & ctype_digit) != 0) max = max * 10 + *p++ - '0'; + if (max < 0 || max > 65535) + { + *errorcodeptr = ERR5; + return p; + } + if (max < min) + { + *errorcodeptr = ERR4; + return p; + } + } + } + +/* Fill in the required variables, and pass back the pointer to the terminating +'}'. */ + +*minp = min; +*maxp = max; +return p; +} + + + +/************************************************* +* Find first significant op code * +*************************************************/ + +/* This is called by several functions that scan a compiled expression looking +for a fixed first character, or an anchoring op code etc. It skips over things +that do not influence this. For some calls, a change of option is important. +For some calls, it makes sense to skip negative forward and all backward +assertions, and also the \b assertion; for others it does not. + +Arguments: + code pointer to the start of the group + options pointer to external options + optbit the option bit whose changing is significant, or + zero if none are + skipassert TRUE if certain assertions are to be skipped + +Returns: pointer to the first significant opcode +*/ + +static const uschar* +first_significant_code(const uschar *code, int *options, int optbit, + BOOL skipassert) +{ +for (;;) + { + switch ((int)*code) + { + case OP_OPT: + if (optbit > 0 && ((int)code[1] & optbit) != (*options & optbit)) + *options = (int)code[1]; + code += 2; + break; + + case OP_ASSERT_NOT: + case OP_ASSERTBACK: + case OP_ASSERTBACK_NOT: + if (!skipassert) return code; + do code += GET(code, 1); while (*code == OP_ALT); + code += _pcre_OP_lengths[*code]; + break; + + case OP_WORD_BOUNDARY: + case OP_NOT_WORD_BOUNDARY: + if (!skipassert) return code; + /* Fall through */ + + case OP_CALLOUT: + case OP_CREF: + case OP_BRANUMBER: + code += _pcre_OP_lengths[*code]; + break; + + default: + return code; + } + } +/* Control never reaches here */ +} + + + + +/************************************************* +* Find the fixed length of a pattern * +*************************************************/ + +/* Scan a pattern and compute the fixed length of subject that will match it, +if the length is fixed. This is needed for dealing with backward assertions. +In UTF8 mode, the result is in characters rather than bytes. + +Arguments: + code points to the start of the pattern (the bracket) + options the compiling options + +Returns: the fixed length, or -1 if there is no fixed length, + or -2 if \C was encountered +*/ + +static int +find_fixedlength(uschar *code, int options) +{ +int length = -1; + +register int branchlength = 0; +register uschar *cc = code + 1 + LINK_SIZE; + +/* Scan along the opcodes for this branch. If we get to the end of the +branch, check the length against that of the other branches. */ + +for (;;) + { + int d; + register int op = *cc; + if (op >= OP_BRA) op = OP_BRA; + + switch (op) + { + case OP_BRA: + case OP_ONCE: + case OP_COND: + d = find_fixedlength(cc, options); + if (d < 0) return d; + branchlength += d; + do cc += GET(cc, 1); while (*cc == OP_ALT); + cc += 1 + LINK_SIZE; + break; + + /* Reached end of a branch; if it's a ket it is the end of a nested + call. If it's ALT it is an alternation in a nested call. If it is + END it's the end of the outer call. All can be handled by the same code. */ + + case OP_ALT: + case OP_KET: + case OP_KETRMAX: + case OP_KETRMIN: + case OP_END: + if (length < 0) length = branchlength; + else if (length != branchlength) return -1; + if (*cc != OP_ALT) return length; + cc += 1 + LINK_SIZE; + branchlength = 0; + break; + + /* Skip over assertive subpatterns */ + + case OP_ASSERT: + case OP_ASSERT_NOT: + case OP_ASSERTBACK: + case OP_ASSERTBACK_NOT: + do cc += GET(cc, 1); while (*cc == OP_ALT); + /* Fall through */ + + /* Skip over things that don't match chars */ + + case OP_REVERSE: + case OP_BRANUMBER: + case OP_CREF: + case OP_OPT: + case OP_CALLOUT: + case OP_SOD: + case OP_SOM: + case OP_EOD: + case OP_EODN: + case OP_CIRC: + case OP_DOLL: + case OP_NOT_WORD_BOUNDARY: + case OP_WORD_BOUNDARY: + cc += _pcre_OP_lengths[*cc]; + break; + + /* Handle literal characters */ + + case OP_CHAR: + case OP_CHARNC: + branchlength++; + cc += 2; +#ifdef SUPPORT_UTF8 + if ((options & PCRE_UTF8) != 0) + { + while ((*cc & 0xc0) == 0x80) cc++; + } +#endif + break; + + /* Handle exact repetitions. The count is already in characters, but we + need to skip over a multibyte character in UTF8 mode. */ + + case OP_EXACT: + branchlength += GET2(cc,1); + cc += 4; +#ifdef SUPPORT_UTF8 + if ((options & PCRE_UTF8) != 0) + { + while((*cc & 0x80) == 0x80) cc++; + } +#endif + break; + + case OP_TYPEEXACT: + branchlength += GET2(cc,1); + cc += 4; + break; + + /* Handle single-char matchers */ + + case OP_PROP: + case OP_NOTPROP: + cc++; + /* Fall through */ + + case OP_NOT_DIGIT: + case OP_DIGIT: + case OP_NOT_WHITESPACE: + case OP_WHITESPACE: + case OP_NOT_WORDCHAR: + case OP_WORDCHAR: + case OP_ANY: + branchlength++; + cc++; + break; + + /* The single-byte matcher isn't allowed */ + + case OP_ANYBYTE: + return -2; + + /* Check a class for variable quantification */ + +#ifdef SUPPORT_UTF8 + case OP_XCLASS: + cc += GET(cc, 1) - 33; + /* Fall through */ +#endif + + case OP_CLASS: + case OP_NCLASS: + cc += 33; + + switch (*cc) + { + case OP_CRSTAR: + case OP_CRMINSTAR: + case OP_CRQUERY: + case OP_CRMINQUERY: + return -1; + + case OP_CRRANGE: + case OP_CRMINRANGE: + if (GET2(cc,1) != GET2(cc,3)) return -1; + branchlength += GET2(cc,1); + cc += 5; + break; + + default: + branchlength++; + } + break; + + /* Anything else is variable length */ + + default: + return -1; + } + } +/* Control never gets here */ +} + + + + +/************************************************* +* Scan compiled regex for numbered bracket * +*************************************************/ + +/* This little function scans through a compiled pattern until it finds a +capturing bracket with the given number. + +Arguments: + code points to start of expression + utf8 TRUE in UTF-8 mode + number the required bracket number + +Returns: pointer to the opcode for the bracket, or NULL if not found +*/ + +static const uschar * +find_bracket(const uschar *code, BOOL utf8, int number) +{ +#ifndef SUPPORT_UTF8 +utf8 = utf8; /* Stop pedantic compilers complaining */ +#endif + +for (;;) + { + register int c = *code; + if (c == OP_END) return NULL; + else if (c > OP_BRA) + { + int n = c - OP_BRA; + if (n > EXTRACT_BASIC_MAX) n = GET2(code, 2+LINK_SIZE); + if (n == number) return (uschar *)code; + code += _pcre_OP_lengths[OP_BRA]; + } + else + { + code += _pcre_OP_lengths[c]; + +#ifdef SUPPORT_UTF8 + + /* In UTF-8 mode, opcodes that are followed by a character may be followed + by a multi-byte character. The length in the table is a minimum, so we have + to scan along to skip the extra bytes. All opcodes are less than 128, so we + can use relatively efficient code. */ + + if (utf8) switch(c) + { + case OP_CHAR: + case OP_CHARNC: + case OP_EXACT: + case OP_UPTO: + case OP_MINUPTO: + case OP_STAR: + case OP_MINSTAR: + case OP_PLUS: + case OP_MINPLUS: + case OP_QUERY: + case OP_MINQUERY: + while ((*code & 0xc0) == 0x80) code++; + break; + + /* XCLASS is used for classes that cannot be represented just by a bit + map. This includes negated single high-valued characters. The length in + the table is zero; the actual length is stored in the compiled code. */ + + case OP_XCLASS: + code += GET(code, 1) + 1; + break; + } +#endif + } + } +} + + + +/************************************************* +* Scan compiled regex for recursion reference * +*************************************************/ + +/* This little function scans through a compiled pattern until it finds an +instance of OP_RECURSE. + +Arguments: + code points to start of expression + utf8 TRUE in UTF-8 mode + +Returns: pointer to the opcode for OP_RECURSE, or NULL if not found +*/ + +static const uschar * +find_recurse(const uschar *code, BOOL utf8) +{ +#ifndef SUPPORT_UTF8 +utf8 = utf8; /* Stop pedantic compilers complaining */ +#endif + +for (;;) + { + register int c = *code; + if (c == OP_END) return NULL; + else if (c == OP_RECURSE) return code; + else if (c > OP_BRA) + { + code += _pcre_OP_lengths[OP_BRA]; + } + else + { + code += _pcre_OP_lengths[c]; + +#ifdef SUPPORT_UTF8 + + /* In UTF-8 mode, opcodes that are followed by a character may be followed + by a multi-byte character. The length in the table is a minimum, so we have + to scan along to skip the extra bytes. All opcodes are less than 128, so we + can use relatively efficient code. */ + + if (utf8) switch(c) + { + case OP_CHAR: + case OP_CHARNC: + case OP_EXACT: + case OP_UPTO: + case OP_MINUPTO: + case OP_STAR: + case OP_MINSTAR: + case OP_PLUS: + case OP_MINPLUS: + case OP_QUERY: + case OP_MINQUERY: + while ((*code & 0xc0) == 0x80) code++; + break; + + /* XCLASS is used for classes that cannot be represented just by a bit + map. This includes negated single high-valued characters. The length in + the table is zero; the actual length is stored in the compiled code. */ + + case OP_XCLASS: + code += GET(code, 1) + 1; + break; + } +#endif + } + } +} + + + +/************************************************* +* Scan compiled branch for non-emptiness * +*************************************************/ + +/* This function scans through a branch of a compiled pattern to see whether it +can match the empty string or not. It is called only from could_be_empty() +below. Note that first_significant_code() skips over assertions. If we hit an +unclosed bracket, we return "empty" - this means we've struck an inner bracket +whose current branch will already have been scanned. + +Arguments: + code points to start of search + endcode points to where to stop + utf8 TRUE if in UTF8 mode + +Returns: TRUE if what is matched could be empty +*/ + +static BOOL +could_be_empty_branch(const uschar *code, const uschar *endcode, BOOL utf8) +{ +register int c; +for (code = first_significant_code(code + 1 + LINK_SIZE, NULL, 0, TRUE); + code < endcode; + code = first_significant_code(code + _pcre_OP_lengths[c], NULL, 0, TRUE)) + { + const uschar *ccode; + + c = *code; + + if (c >= OP_BRA) + { + BOOL empty_branch; + if (GET(code, 1) == 0) return TRUE; /* Hit unclosed bracket */ + + /* Scan a closed bracket */ + + empty_branch = FALSE; + do + { + if (!empty_branch && could_be_empty_branch(code, endcode, utf8)) + empty_branch = TRUE; + code += GET(code, 1); + } + while (*code == OP_ALT); + if (!empty_branch) return FALSE; /* All branches are non-empty */ + code += 1 + LINK_SIZE; + c = *code; + } + + else switch (c) + { + /* Check for quantifiers after a class */ + +#ifdef SUPPORT_UTF8 + case OP_XCLASS: + ccode = code + GET(code, 1); + goto CHECK_CLASS_REPEAT; +#endif + + case OP_CLASS: + case OP_NCLASS: + ccode = code + 33; + +#ifdef SUPPORT_UTF8 + CHECK_CLASS_REPEAT: +#endif + + switch (*ccode) + { + case OP_CRSTAR: /* These could be empty; continue */ + case OP_CRMINSTAR: + case OP_CRQUERY: + case OP_CRMINQUERY: + break; + + default: /* Non-repeat => class must match */ + case OP_CRPLUS: /* These repeats aren't empty */ + case OP_CRMINPLUS: + return FALSE; + + case OP_CRRANGE: + case OP_CRMINRANGE: + if (GET2(ccode, 1) > 0) return FALSE; /* Minimum > 0 */ + break; + } + break; + + /* Opcodes that must match a character */ + + case OP_PROP: + case OP_NOTPROP: + case OP_EXTUNI: + case OP_NOT_DIGIT: + case OP_DIGIT: + case OP_NOT_WHITESPACE: + case OP_WHITESPACE: + case OP_NOT_WORDCHAR: + case OP_WORDCHAR: + case OP_ANY: + case OP_ANYBYTE: + case OP_CHAR: + case OP_CHARNC: + case OP_NOT: + case OP_PLUS: + case OP_MINPLUS: + case OP_EXACT: + case OP_NOTPLUS: + case OP_NOTMINPLUS: + case OP_NOTEXACT: + case OP_TYPEPLUS: + case OP_TYPEMINPLUS: + case OP_TYPEEXACT: + return FALSE; + + /* End of branch */ + + case OP_KET: + case OP_KETRMAX: + case OP_KETRMIN: + case OP_ALT: + return TRUE; + + /* In UTF-8 mode, STAR, MINSTAR, QUERY, MINQUERY, UPTO, and MINUPTO may be + followed by a multibyte character */ + +#ifdef SUPPORT_UTF8 + case OP_STAR: + case OP_MINSTAR: + case OP_QUERY: + case OP_MINQUERY: + case OP_UPTO: + case OP_MINUPTO: + if (utf8) while ((code[2] & 0xc0) == 0x80) code++; + break; +#endif + } + } + +return TRUE; +} + + + +/************************************************* +* Scan compiled regex for non-emptiness * +*************************************************/ + +/* This function is called to check for left recursive calls. We want to check +the current branch of the current pattern to see if it could match the empty +string. If it could, we must look outwards for branches at other levels, +stopping when we pass beyond the bracket which is the subject of the recursion. + +Arguments: + code points to start of the recursion + endcode points to where to stop (current RECURSE item) + bcptr points to the chain of current (unclosed) branch starts + utf8 TRUE if in UTF-8 mode + +Returns: TRUE if what is matched could be empty +*/ + +static BOOL +could_be_empty(const uschar *code, const uschar *endcode, branch_chain *bcptr, + BOOL utf8) +{ +while (bcptr != NULL && bcptr->current >= code) + { + if (!could_be_empty_branch(bcptr->current, endcode, utf8)) return FALSE; + bcptr = bcptr->outer; + } +return TRUE; +} + + + +/************************************************* +* Check for POSIX class syntax * +*************************************************/ + +/* This function is called when the sequence "[:" or "[." or "[=" is +encountered in a character class. It checks whether this is followed by an +optional ^ and then a sequence of letters, terminated by a matching ":]" or +".]" or "=]". + +Argument: + ptr pointer to the initial [ + endptr where to return the end pointer + cd pointer to compile data + +Returns: TRUE or FALSE +*/ + +static BOOL +check_posix_syntax(const uschar *ptr, const uschar **endptr, compile_data *cd) +{ +int terminator; /* Don't combine these lines; the Solaris cc */ +terminator = *(++ptr); /* compiler warns about "non-constant" initializer. */ +if (*(++ptr) == '^') ptr++; +while ((cd->ctypes[*ptr] & ctype_letter) != 0) ptr++; +if (*ptr == terminator && ptr[1] == ']') + { + *endptr = ptr; + return TRUE; + } +return FALSE; +} + + + + +/************************************************* +* Check POSIX class name * +*************************************************/ + +/* This function is called to check the name given in a POSIX-style class entry +such as [:alnum:]. + +Arguments: + ptr points to the first letter + len the length of the name + +Returns: a value representing the name, or -1 if unknown +*/ + +static int +check_posix_name(const uschar *ptr, int len) +{ +register int yield = 0; +while (posix_name_lengths[yield] != 0) + { + if (len == posix_name_lengths[yield] && + strncmp((const char *)ptr, posix_names[yield], len) == 0) return yield; + yield++; + } +return -1; +} + + +/************************************************* +* Adjust OP_RECURSE items in repeated group * +*************************************************/ + +/* OP_RECURSE items contain an offset from the start of the regex to the group +that is referenced. This means that groups can be replicated for fixed +repetition simply by copying (because the recursion is allowed to refer to +earlier groups that are outside the current group). However, when a group is +optional (i.e. the minimum quantifier is zero), OP_BRAZERO is inserted before +it, after it has been compiled. This means that any OP_RECURSE items within it +that refer to the group itself or any contained groups have to have their +offsets adjusted. That is the job of this function. Before it is called, the +partially compiled regex must be temporarily terminated with OP_END. + +Arguments: + group points to the start of the group + adjust the amount by which the group is to be moved + utf8 TRUE in UTF-8 mode + cd contains pointers to tables etc. + +Returns: nothing +*/ + +static void +adjust_recurse(uschar *group, int adjust, BOOL utf8, compile_data *cd) +{ +uschar *ptr = group; +while ((ptr = (uschar *)find_recurse(ptr, utf8)) != NULL) + { + int offset = GET(ptr, 1); + if (cd->start_code + offset >= group) PUT(ptr, 1, offset + adjust); + ptr += 1 + LINK_SIZE; + } +} + + + +/************************************************* +* Insert an automatic callout point * +*************************************************/ + +/* This function is called when the PCRE_AUTO_CALLOUT option is set, to insert +callout points before each pattern item. + +Arguments: + code current code pointer + ptr current pattern pointer + cd pointers to tables etc + +Returns: new code pointer +*/ + +static uschar * +auto_callout(uschar *code, const uschar *ptr, compile_data *cd) +{ +*code++ = OP_CALLOUT; +*code++ = 255; +PUT(code, 0, ptr - cd->start_pattern); /* Pattern offset */ +PUT(code, LINK_SIZE, 0); /* Default length */ +return code + 2*LINK_SIZE; +} + + + +/************************************************* +* Complete a callout item * +*************************************************/ + +/* A callout item contains the length of the next item in the pattern, which +we can't fill in till after we have reached the relevant point. This is used +for both automatic and manual callouts. + +Arguments: + previous_callout points to previous callout item + ptr current pattern pointer + cd pointers to tables etc + +Returns: nothing +*/ + +static void +complete_callout(uschar *previous_callout, const uschar *ptr, compile_data *cd) +{ +int length = ptr - cd->start_pattern - GET(previous_callout, 2); +PUT(previous_callout, 2 + LINK_SIZE, length); +} + + + +#ifdef SUPPORT_UCP +/************************************************* +* Get othercase range * +*************************************************/ + +/* This function is passed the start and end of a class range, in UTF-8 mode +with UCP support. It searches up the characters, looking for internal ranges of +characters in the "other" case. Each call returns the next one, updating the +start address. + +Arguments: + cptr points to starting character value; updated + d end value + ocptr where to put start of othercase range + odptr where to put end of othercase range + +Yield: TRUE when range returned; FALSE when no more +*/ + +static BOOL +get_othercase_range(int *cptr, int d, int *ocptr, int *odptr) +{ +int c, chartype, othercase, next; + +for (c = *cptr; c <= d; c++) + { + if (_pcre_ucp_findchar(c, &chartype, &othercase) == ucp_L && othercase != 0) + break; + } + +if (c > d) return FALSE; + +*ocptr = othercase; +next = othercase + 1; + +for (++c; c <= d; c++) + { + if (_pcre_ucp_findchar(c, &chartype, &othercase) != ucp_L || + othercase != next) + break; + next++; + } + +*odptr = next - 1; +*cptr = c; + +return TRUE; +} +#endif /* SUPPORT_UCP */ + + +/************************************************* +* Compile one branch * +*************************************************/ + +/* Scan the pattern, compiling it into the code vector. If the options are +changed during the branch, the pointer is used to change the external options +bits. + +Arguments: + optionsptr pointer to the option bits + brackets points to number of extracting brackets used + codeptr points to the pointer to the current code point + ptrptr points to the current pattern pointer + errorcodeptr points to error code variable + firstbyteptr set to initial literal character, or < 0 (REQ_UNSET, REQ_NONE) + reqbyteptr set to the last literal character required, else < 0 + bcptr points to current branch chain + cd contains pointers to tables etc. + +Returns: TRUE on success + FALSE, with *errorcodeptr set non-zero on error +*/ + +static BOOL +compile_branch(int *optionsptr, int *brackets, uschar **codeptr, + const uschar **ptrptr, int *errorcodeptr, int *firstbyteptr, + int *reqbyteptr, branch_chain *bcptr, compile_data *cd) +{ +int repeat_type, op_type; +int repeat_min = 0, repeat_max = 0; /* To please picky compilers */ +int bravalue = 0; +int greedy_default, greedy_non_default; +int firstbyte, reqbyte; +int zeroreqbyte, zerofirstbyte; +int req_caseopt, reqvary, tempreqvary; +int condcount = 0; +int options = *optionsptr; +int after_manual_callout = 0; +register int c; +register uschar *code = *codeptr; +uschar *tempcode; +BOOL inescq = FALSE; +BOOL groupsetfirstbyte = FALSE; +const uschar *ptr = *ptrptr; +const uschar *tempptr; +uschar *previous = NULL; +uschar *previous_callout = NULL; +uschar classbits[32]; + +#ifdef SUPPORT_UTF8 +BOOL class_utf8; +BOOL utf8 = (options & PCRE_UTF8) != 0; +uschar *class_utf8data; +uschar utf8_char[6]; +#else +BOOL utf8 = FALSE; +#endif + +/* Set up the default and non-default settings for greediness */ + +greedy_default = ((options & PCRE_UNGREEDY) != 0); +greedy_non_default = greedy_default ^ 1; + +/* Initialize no first byte, no required byte. REQ_UNSET means "no char +matching encountered yet". It gets changed to REQ_NONE if we hit something that +matches a non-fixed char first char; reqbyte just remains unset if we never +find one. + +When we hit a repeat whose minimum is zero, we may have to adjust these values +to take the zero repeat into account. This is implemented by setting them to +zerofirstbyte and zeroreqbyte when such a repeat is encountered. The individual +item types that can be repeated set these backoff variables appropriately. */ + +firstbyte = reqbyte = zerofirstbyte = zeroreqbyte = REQ_UNSET; + +/* The variable req_caseopt contains either the REQ_CASELESS value or zero, +according to the current setting of the caseless flag. REQ_CASELESS is a bit +value > 255. It is added into the firstbyte or reqbyte variables to record the +case status of the value. This is used only for ASCII characters. */ + +req_caseopt = ((options & PCRE_CASELESS) != 0)? REQ_CASELESS : 0; + +/* Switch on next character until the end of the branch */ + +for (;; ptr++) + { + BOOL negate_class; + BOOL inverted_class = FALSE; + BOOL possessive_quantifier; + BOOL is_quantifier; + int class_charcount; + int class_lastchar; + int newoptions; + int recno; + int skipbytes; + int subreqbyte; + int subfirstbyte; + int mclength; + uschar mcbuffer[8]; + + /* Next byte in the pattern */ + + c = *ptr; + + /* If in \Q...\E, check for the end; if not, we have a literal */ + + if (inescq && c != 0) + { + if (c == '\\' && ptr[1] == 'E') + { + inescq = FALSE; + ptr++; + continue; + } + else + { + if (previous_callout != NULL) + { + complete_callout(previous_callout, ptr, cd); + previous_callout = NULL; + } + if ((options & PCRE_AUTO_CALLOUT) != 0) + { + previous_callout = code; + code = auto_callout(code, ptr, cd); + } + goto NORMAL_CHAR; + } + } + + /* Fill in length of a previous callout, except when the next thing is + a quantifier. */ + + is_quantifier = c == '*' || c == '+' || c == '?' || + (c == '{' && is_counted_repeat(ptr+1)); + + if (!is_quantifier && previous_callout != NULL && + after_manual_callout-- <= 0) + { + complete_callout(previous_callout, ptr, cd); + previous_callout = NULL; + } + + /* In extended mode, skip white space and comments */ + + if ((options & PCRE_EXTENDED) != 0) + { + if (c < 256) + { + if ((cd->ctypes[c] & ctype_space) != 0) + continue; + } + else if (isUnicodeWhiteSpace(c) == true) + { + continue; + } + if (c == '#') + { + /* The space before the ; is to avoid a warning on a silly compiler + on the Macintosh. */ + while ((c = *(++ptr)) != 0 && !isECMALineTerminator(c)) ; + if (c != 0) continue; /* Else fall through to handle end of string */ + } + } + + /* No auto callout for quantifiers. */ + + if ((options & PCRE_AUTO_CALLOUT) != 0 && !is_quantifier) + { + previous_callout = code; + code = auto_callout(code, ptr, cd); + } + + switch(c) + { + /* The branch terminates at end of string, |, or ). */ + + case 0: + case '|': + case ')': + *firstbyteptr = firstbyte; + *reqbyteptr = reqbyte; + *codeptr = code; + *ptrptr = ptr; + return TRUE; + + /* Handle single-character metacharacters. In multiline mode, ^ disables + the setting of any following char as a first character. */ + + case '^': + if ((options & PCRE_MULTILINE) != 0) + { + if (firstbyte == REQ_UNSET) firstbyte = REQ_NONE; + } + previous = NULL; + *code++ = OP_CIRC; + break; + + case '$': + previous = NULL; + *code++ = OP_DOLL; + break; + + /* There can never be a first char if '.' is first, whatever happens about + repeats. The value of reqbyte doesn't change either. */ + + case '.': + if (firstbyte == REQ_UNSET) firstbyte = REQ_NONE; + zerofirstbyte = firstbyte; + zeroreqbyte = reqbyte; + previous = code; + *code++ = OP_ANY; + break; + + /* Character classes. If the included characters are all < 255 in value, we + build a 32-byte bitmap of the permitted characters, except in the special + case where there is only one such character. For negated classes, we build + the map as usual, then invert it at the end. However, we use a different + opcode so that data characters > 255 can be handled correctly. + + If the class contains characters outside the 0-255 range, a different + opcode is compiled. It may optionally have a bit map for characters < 256, + but those above are are explicitly listed afterwards. A flag byte tells + whether the bitmap is present, and whether this is a negated class or not. + */ + + case '[': + previous = code; + + /* PCRE supports POSIX class stuff inside a class. Perl gives an error if + they are encountered at the top level, so we'll do that too. */ + + if ((ptr[1] == ':' || ptr[1] == '.' || ptr[1] == '=') && + check_posix_syntax(ptr, &tempptr, cd)) + { + *errorcodeptr = (ptr[1] == ':')? ERR13 : ERR31; + goto FAILED; + } + + /* If the first character is '^', set the negation flag and skip it. */ + + if ((c = *(++ptr)) == '^') + { + negate_class = TRUE; + c = *(++ptr); + } + else + { + negate_class = FALSE; + } + + /* Keep a count of chars with values < 256 so that we can optimize the case + of just a single character (as long as it's < 256). For higher valued UTF-8 + characters, we don't yet do any optimization. */ + + class_charcount = 0; + class_lastchar = -1; + +#ifdef SUPPORT_UTF8 + class_utf8 = FALSE; /* No chars >= 256 */ + class_utf8data = code + LINK_SIZE + 34; /* For UTF-8 items */ +#endif + + /* Initialize the 32-char bit map to all zeros. We have to build the + map in a temporary bit of store, in case the class contains only 1 + character (< 256), because in that case the compiled code doesn't use the + bit map. */ + + memset(classbits, 0, 32 * sizeof(uschar)); + + /* Process characters until ] is reached. By writing this as a "do" it + means that an initial ] is taken as a data character. The first pass + through the regex checked the overall syntax, so we don't need to be very + strict here. At the start of the loop, c contains the first byte of the + character. */ + + /* cn: Due to bug http://flashqa.macromedia.com/bugapp/detail.asp?ID=110290 + we need to handle [^] as matching any character (its not not a character...) + The ^ is already stripped off, so we just need to catch a leading ']' + */ + if (c == ']') // [] is still invalid, so we know we must have [^]. [^] means any character other than null + { + class_lastchar = 0; + class_charcount = 1; + } + else + { + /* cn: end of added code (with the exception of the closing brack for this else clause */ + do + { + #ifdef SUPPORT_UTF8 + if (utf8 && c > 127) + { /* Braces are required because the */ + GETCHARLEN(c, ptr, ptr); /* macro generates multiple statements */ + } + #endif + + /* Inside \Q...\E everything is literal except \E */ + + if (inescq) + { + if (c == '\\' && ptr[1] == 'E') + { + inescq = FALSE; + ptr++; + continue; + } + else goto LONE_SINGLE_CHARACTER; + } + + /* Handle POSIX class names. Perl allows a negation extension of the + form [:^name:]. A square bracket that doesn't match the syntax is + treated as a literal. We also recognize the POSIX constructions + [.ch.] and [=ch=] ("collating elements") and fault them, as Perl + 5.6 and 5.8 do. */ + + if (c == '[' && + (ptr[1] == ':' || ptr[1] == '.' || ptr[1] == '=') && + check_posix_syntax(ptr, &tempptr, cd)) + { + BOOL local_negate = FALSE; + int posix_class, i; + register const uschar *cbits = cd->cbits; + + if (ptr[1] != ':') + { + *errorcodeptr = ERR31; + goto FAILED; + } + + ptr += 2; + if (*ptr == '^') + { + local_negate = TRUE; + ptr++; + } + + posix_class = check_posix_name(ptr, tempptr - ptr); + if (posix_class < 0) + { + *errorcodeptr = ERR30; + goto FAILED; + } + + /* If matching is caseless, upper and lower are converted to + alpha. This relies on the fact that the class table starts with + alpha, lower, upper as the first 3 entries. */ + + if ((options & PCRE_CASELESS) != 0 && posix_class <= 2) + posix_class = 0; + + /* Or into the map we are building up to 3 of the static class + tables, or their negations. The [:blank:] class sets up the same + chars as the [:space:] class (all white space). We remove the vertical + white space chars afterwards. */ + + posix_class *= 3; + for (i = 0; i < 3; i++) + { + BOOL blankclass = strncmp((char *)ptr, "blank", 5) == 0; + int taboffset = posix_class_maps[posix_class + i]; + if (taboffset < 0) break; + if (local_negate) + { + if (i == 0) + for (c = 0; c < 32; c++) classbits[c] |= ~cbits[c+taboffset]; + else + for (c = 0; c < 32; c++) classbits[c] &= ~cbits[c+taboffset]; + if (blankclass) classbits[1] |= 0x3c; + } + else + { + for (c = 0; c < 32; c++) classbits[c] |= cbits[c+taboffset]; + if (blankclass) classbits[1] &= ~0x3c; + } + } + + ptr = tempptr + 1; + class_charcount = 10; /* Set > 1; assumes more than 1 per class */ + continue; /* End of POSIX syntax handling */ + } + + /* Backslash may introduce a single character, or it may introduce one + of the specials, which just set a flag. Escaped items are checked for + validity in the pre-compiling pass. The sequence \b is a special case. + Inside a class (and only there) it is treated as backspace. Elsewhere + it marks a word boundary. Other escapes have preset maps ready to + or into the one we are building. We assume they have more than one + character in them, so set class_charcount bigger than one. */ + + if (c == '\\') + { + c = check_escape(&ptr, errorcodeptr, *brackets, options, TRUE); + + if (-c == ESC_b) c = '\b'; /* \b is backslash in a class */ + else if (-c == ESC_X) c = 'X'; /* \X is literal X in a class */ + else if (-c == ESC_Q) /* Handle start of quoted string */ + { + if (ptr[1] == '\\' && ptr[2] == 'E') + { + ptr += 2; /* avoid empty string */ + } + else inescq = TRUE; + continue; + } + + if (c < 0) + { + register const uschar *cbits = cd->cbits; + class_charcount += 2; /* Greater than 1 is what matters */ + switch (-c) + { + case ESC_d: + for (c = 0; c < 32; c++) classbits[c] |= cbits[c+cbit_digit]; + continue; + + case ESC_D: + for (c = 0; c < 32; c++) classbits[c] |= ~cbits[c+cbit_digit]; + inverted_class = TRUE; + continue; + + case ESC_w: + for (c = 0; c < 32; c++) classbits[c] |= cbits[c+cbit_word]; + continue; + + case ESC_W: + for (c = 0; c < 32; c++) classbits[c] |= ~cbits[c+cbit_word]; + inverted_class = TRUE; + continue; + + case ESC_s: + for (c = 0; c < 32; c++) classbits[c] |= cbits[c+cbit_space]; + classbits[1] &= ~0x08; /* Perl 5.004 onwards omits VT from \s */ + continue; + + case ESC_S: + for (c = 0; c < 32; c++) classbits[c] |= ~cbits[c+cbit_space]; + classbits[1] |= 0x08; /* Perl 5.004 onwards omits VT from \s */ + inverted_class = TRUE; + continue; + + #ifdef SUPPORT_UCP + case ESC_p: + case ESC_P: + { + BOOL negated; + int property = get_ucp(&ptr, &negated, errorcodeptr); + if (property < 0) goto FAILED; + class_utf8 = TRUE; + *class_utf8data++ = ((-c == ESC_p) != negated)? + XCL_PROP : XCL_NOTPROP; + *class_utf8data++ = property; + class_charcount -= 2; /* Not a < 256 character */ + } + continue; + #endif + + /* Unrecognized escapes are faulted if PCRE is running in its + strict mode. By default, for compatibility with Perl, they are + treated as literals. */ + + default: + if ((options & PCRE_EXTRA) != 0) + { + *errorcodeptr = ERR7; + goto FAILED; + } + c = *ptr; /* The final character */ + class_charcount -= 2; /* Undo the default count from above */ + } + } + + /* Fall through if we have a single character (c >= 0). This may be + > 256 in UTF-8 mode. */ + + } /* End of backslash handling */ + + /* A single character may be followed by '-' to form a range. However, + Perl does not permit ']' to be the end of the range. A '-' character + here is treated as a literal. */ + + if (ptr[1] == '-' && ptr[2] != ']') + { + int d; + ptr += 2; + + #ifdef SUPPORT_UTF8 + if (utf8) + { /* Braces are required because the */ + GETCHARLEN(d, ptr, ptr); /* macro generates multiple statements */ + } + else + #endif + d = *ptr; /* Not UTF-8 mode */ + + /* The second part of a range can be a single-character escape, but + not any of the other escapes. Perl 5.6 treats a hyphen as a literal + in such circumstances. */ + + if (d == '\\') + { + const uschar *oldptr = ptr; + d = check_escape(&ptr, errorcodeptr, *brackets, options, TRUE); + + /* \b is backslash; \X is literal X; any other special means the '-' + was literal */ + + if (d < 0) + { + if (d == -ESC_b) d = '\b'; + else if (d == -ESC_X) d = 'X'; else + { + ptr = oldptr - 2; + goto LONE_SINGLE_CHARACTER; /* A few lines below */ + } + } + } + + /* The check that the two values are in the correct order happens in + the pre-pass. Optimize one-character ranges */ + + if (d == c) goto LONE_SINGLE_CHARACTER; /* A few lines below */ + + /* In UTF-8 mode, if the upper limit is > 255, or > 127 for caseless + matching, we have to use an XCLASS with extra data items. Caseless + matching for characters > 127 is available only if UCP support is + available. */ + + #ifdef SUPPORT_UTF8 + if (utf8 && (d > 255 || ((options & PCRE_CASELESS) != 0 && d > 127))) + { + class_utf8 = TRUE; + + /* With UCP support, we can find the other case equivalents of + the relevant characters. There may be several ranges. Optimize how + they fit with the basic range. */ + + #ifdef SUPPORT_UCP + if ((options & PCRE_CASELESS) != 0) + { + int occ, ocd; + int cc = c; + int origd = d; + while (get_othercase_range(&cc, origd, &occ, &ocd)) + { + if (occ >= c && ocd <= d) continue; /* Skip embedded ranges */ + + if (occ < c && ocd >= c - 1) /* Extend the basic range */ + { /* if there is overlap, */ + c = occ; /* noting that if occ < c */ + continue; /* we can't have ocd > d */ + } /* because a subrange is */ + if (ocd > d && occ <= d + 1) /* always shorter than */ + { /* the basic range. */ + d = ocd; + continue; + } + + if (occ == ocd) + { + *class_utf8data++ = XCL_SINGLE; + } + else + { + *class_utf8data++ = XCL_RANGE; + class_utf8data += _pcre_ord2utf8(occ, class_utf8data); + } + class_utf8data += _pcre_ord2utf8(ocd, class_utf8data); + } + } + #endif /* SUPPORT_UCP */ + + /* Now record the original range, possibly modified for UCP caseless + overlapping ranges. */ + + *class_utf8data++ = XCL_RANGE; + class_utf8data += _pcre_ord2utf8(c, class_utf8data); + class_utf8data += _pcre_ord2utf8(d, class_utf8data); + + /* With UCP support, we are done. Without UCP support, there is no + caseless matching for UTF-8 characters > 127; we can use the bit map + for the smaller ones. */ + + #ifdef SUPPORT_UCP + continue; /* With next character in the class */ + #else + if ((options & PCRE_CASELESS) == 0 || c > 127) continue; + + /* Adjust upper limit and fall through to set up the map */ + + d = 127; + + #endif /* SUPPORT_UCP */ + } + #endif /* SUPPORT_UTF8 */ + + /* We use the bit map for all cases when not in UTF-8 mode; else + ranges that lie entirely within 0-127 when there is UCP support; else + for partial ranges without UCP support. */ + + for (; c <= d; c++) + { + classbits[c/8] |= (1 << (c&7)); + if ((options & PCRE_CASELESS) != 0) + { + int uc = cd->fcc[c]; /* flip case */ + classbits[uc/8] |= (1 << (uc&7)); + } + class_charcount++; /* in case a one-char range */ + class_lastchar = c; + } + + continue; /* Go get the next char in the class */ + } + + /* Handle a lone single character - we can get here for a normal + non-escape char, or after \ that introduces a single character or for an + apparent range that isn't. */ + + LONE_SINGLE_CHARACTER: + + /* Handle a character that cannot go in the bit map */ + + #ifdef SUPPORT_UTF8 + if (utf8 && (c > 255 || ((options & PCRE_CASELESS) != 0 && c > 127))) + { + class_utf8 = TRUE; + *class_utf8data++ = XCL_SINGLE; + class_utf8data += _pcre_ord2utf8(c, class_utf8data); + + #ifdef SUPPORT_UCP + if ((options & PCRE_CASELESS) != 0) + { + int chartype; + int othercase; + if (_pcre_ucp_findchar(c, &chartype, &othercase) >= 0 && + othercase > 0) + { + *class_utf8data++ = XCL_SINGLE; + class_utf8data += _pcre_ord2utf8(othercase, class_utf8data); + } + } + #endif /* SUPPORT_UCP */ + + } + else + #endif /* SUPPORT_UTF8 */ + + /* Handle a single-byte character */ + { + classbits[c/8] |= (1 << (c&7)); + if ((options & PCRE_CASELESS) != 0) + { + c = cd->fcc[c]; /* flip case */ + classbits[c/8] |= (1 << (c&7)); + } + class_charcount++; + class_lastchar = c; + } + } + + /* Loop until ']' reached; the check for end of string happens inside the + loop. This "while" is the end of the "do" above. */ + + while ((c = *(++ptr)) != ']' || inescq); + } + + /* If class_charcount is 1, we saw precisely one character whose value is + less than 256. In non-UTF-8 mode we can always optimize. In UTF-8 mode, we + can optimize the negative case only if there were no characters >= 128 + because OP_NOT and the related opcodes like OP_NOTSTAR operate on + single-bytes only. This is an historical hangover. Maybe one day we can + tidy these opcodes to handle multi-byte characters. + + The optimization throws away the bit map. We turn the item into a + 1-character OP_CHAR[NC] if it's positive, or OP_NOT if it's negative. Note + that OP_NOT does not support multibyte characters. In the positive case, it + can cause firstbyte to be set. Otherwise, there can be no first char if + this item is first, whatever repeat count may follow. In the case of + reqbyte, save the previous value for reinstating. */ + +#ifdef SUPPORT_UTF8 + if (class_charcount == 1 && + (!utf8 || + (!class_utf8 && (!negate_class || class_lastchar < 128)))) + +#else + if (class_charcount == 1) +#endif + { + zeroreqbyte = reqbyte; + + /* The OP_NOT opcode works on one-byte characters only. */ + + if (negate_class) + { + if (firstbyte == REQ_UNSET) firstbyte = REQ_NONE; + zerofirstbyte = firstbyte; + *code++ = OP_NOT; + *code++ = class_lastchar; + break; + } + + /* For a single, positive character, get the value into mcbuffer, and + then we can handle this with the normal one-character code. */ + +#ifdef SUPPORT_UTF8 + if (utf8 && class_lastchar > 127) + mclength = _pcre_ord2utf8(class_lastchar, mcbuffer); + else +#endif + { + mcbuffer[0] = class_lastchar; + mclength = 1; + } + goto ONE_CHAR; + } /* End of 1-char optimization */ + + /* The general case - not the one-char optimization. If this is the first + thing in the branch, there can be no first char setting, whatever the + repeat count. Any reqbyte setting must remain unchanged after any kind of + repeat. */ + + if (firstbyte == REQ_UNSET) firstbyte = REQ_NONE; + zerofirstbyte = firstbyte; + zeroreqbyte = reqbyte; + + /* If there are characters with values > 255, we have to compile an + extended class, with its own opcode. If there are no characters < 256, + we can omit the bitmap. */ + +#ifdef SUPPORT_UTF8 + if (class_utf8) + { + *class_utf8data++ = XCL_END; /* Marks the end of extra data */ + *code++ = OP_XCLASS; + code += LINK_SIZE; + *code = negate_class? XCL_NOT : 0; + + /* If the map is required, install it, and move on to the end of + the extra data */ + + if (class_charcount > 0) + { + *code++ |= XCL_MAP; + memcpy(code, classbits, 32); + code = class_utf8data; + } + + /* If the map is not required, slide down the extra data. */ + + else + { + int len = class_utf8data - (code + 33); + memmove(code + 1, code + 33, len); + code += len + 1; + } + + /* Now fill in the complete length of the item */ + + PUT(previous, 1, code - previous); + break; /* End of class handling */ + } +#endif + + /* If there are no characters > 255, negate the 32-byte map if necessary, + and copy it into the code vector. If this is the first thing in the branch, + there can be no first char setting, whatever the repeat count. Any reqbyte + setting must remain unchanged after any kind of repeat. */ + + if (negate_class) + { + *code++ = OP_NCLASS; + for (c = 0; c < 32; c++) code[c] = ~classbits[c]; + } + else + { + /* cn: code added here for proper UTF-8 handling of \S (not whitespace char) \D (not a digit char) and \W (not a word char) */ + // The class maps for \S \D \W are the inverted maps for \s \d and \w. The class maps only handle comparisions with + // chars < 255, however, and we need successful matches for chars > 255 when comparing to \S \D and \W. The + // interpreter code for OP_CLASS will fail the match for any character > 255, (which is correct for \s \d \w). + // The interpreter code for OP_NCLASS will succeed for any character > 255 (which is correct of ^\s, ^\d, ^\w). + // Since \S is equivalent to ^\s, we need to use OP_NCLASS for \S \D and \W (inverted_class == true in that case). + // Another option would be to create an OP_XCLASS custom bitmap just to handle all chars > 255 for \S \D and \W. + // though that would execute slower. + + // original code: *code++ = OP_CLASS; + *code++ = (inverted_class ? OP_NCLASS : OP_CLASS); + + /* cn: end modified code */ + memcpy(code, classbits, 32); + } + code += 32; + break; + + /* Various kinds of repeat; '{' is not necessarily a quantifier, but this + has been tested above. */ + + case '{': + if (!is_quantifier) goto NORMAL_CHAR; + ptr = read_repeat_counts(ptr+1, &repeat_min, &repeat_max, errorcodeptr); + if (*errorcodeptr != 0) goto FAILED; + goto REPEAT; + + case '*': + repeat_min = 0; + repeat_max = -1; + goto REPEAT; + + case '+': + repeat_min = 1; + repeat_max = -1; + goto REPEAT; + + case '?': + repeat_min = 0; + repeat_max = 1; + + REPEAT: + if (previous == NULL) + { + *errorcodeptr = ERR9; + goto FAILED; + } + + if (repeat_min == 0) + { + firstbyte = zerofirstbyte; /* Adjust for zero repeat */ + reqbyte = zeroreqbyte; /* Ditto */ + } + + /* Remember whether this is a variable length repeat */ + + reqvary = (repeat_min == repeat_max)? 0 : REQ_VARY; + + op_type = 0; /* Default single-char op codes */ + possessive_quantifier = FALSE; /* Default not possessive quantifier */ + + /* Save start of previous item, in case we have to move it up to make space + for an inserted OP_ONCE for the additional '+' extension. */ + + tempcode = previous; + + /* If the next character is '+', we have a possessive quantifier. This + implies greediness, whatever the setting of the PCRE_UNGREEDY option. + If the next character is '?' this is a minimizing repeat, by default, + but if PCRE_UNGREEDY is set, it works the other way round. We change the + repeat type to the non-default. */ + + if (ptr[1] == '+') + { + repeat_type = 0; /* Force greedy */ + possessive_quantifier = TRUE; + ptr++; + } + else if (ptr[1] == '?') + { + repeat_type = greedy_non_default; + ptr++; + } + else repeat_type = greedy_default; + + /* If previous was a recursion, we need to wrap it inside brackets so that + it can be replicated if necessary. */ + + if (*previous == OP_RECURSE) + { + memmove(previous + 1 + LINK_SIZE, previous, 1 + LINK_SIZE); + code += 1 + LINK_SIZE; + *previous = OP_BRA; + PUT(previous, 1, code - previous); + *code = OP_KET; + PUT(code, 1, code - previous); + code += 1 + LINK_SIZE; + } + + /* If previous was a character match, abolish the item and generate a + repeat item instead. If a char item has a minumum of more than one, ensure + that it is set in reqbyte - it might not be if a sequence such as x{3} is + the first thing in a branch because the x will have gone into firstbyte + instead. */ + + if (*previous == OP_CHAR || *previous == OP_CHARNC) + { + /* Deal with UTF-8 characters that take up more than one byte. It's + easier to write this out separately than try to macrify it. Use c to + hold the length of the character in bytes, plus 0x80 to flag that it's a + length rather than a small character. */ + +#ifdef SUPPORT_UTF8 + if (utf8 && (code[-1] & 0x80) != 0) + { + uschar *lastchar = code - 1; + while((*lastchar & 0xc0) == 0x80) lastchar--; + c = code - lastchar; /* Length of UTF-8 character */ + memcpy(utf8_char, lastchar, c); /* Save the char */ + c |= 0x80; /* Flag c as a length */ + } + else +#endif + + /* Handle the case of a single byte - either with no UTF8 support, or + with UTF-8 disabled, or for a UTF-8 character < 128. */ + + { + c = code[-1]; + if (repeat_min > 1) reqbyte = c | req_caseopt | cd->req_varyopt; + } + + goto OUTPUT_SINGLE_REPEAT; /* Code shared with single character types */ + } + + /* If previous was a single negated character ([^a] or similar), we use + one of the special opcodes, replacing it. The code is shared with single- + character repeats by setting opt_type to add a suitable offset into + repeat_type. OP_NOT is currently used only for single-byte chars. */ + + else if (*previous == OP_NOT) + { + op_type = OP_NOTSTAR - OP_STAR; /* Use "not" opcodes */ + c = previous[1]; + goto OUTPUT_SINGLE_REPEAT; + } + + /* If previous was a character type match (\d or similar), abolish it and + create a suitable repeat item. The code is shared with single-character + repeats by setting op_type to add a suitable offset into repeat_type. Note + the the Unicode property types will be present only when SUPPORT_UCP is + defined, but we don't wrap the little bits of code here because it just + makes it horribly messy. */ + + else if (*previous < OP_EODN) + { + uschar *oldcode; + int prop_type; + op_type = OP_TYPESTAR - OP_STAR; /* Use type opcodes */ + c = *previous; + + OUTPUT_SINGLE_REPEAT: + prop_type = (*previous == OP_PROP || *previous == OP_NOTPROP)? + previous[1] : -1; + + oldcode = code; + code = previous; /* Usually overwrite previous item */ + + /* If the maximum is zero then the minimum must also be zero; Perl allows + this case, so we do too - by simply omitting the item altogether. */ + + if (repeat_max == 0) goto END_REPEAT; + + /* All real repeats make it impossible to handle partial matching (maybe + one day we will be able to remove this restriction). */ + + if (repeat_max != 1) cd->nopartial = TRUE; + + /* Combine the op_type with the repeat_type */ + + repeat_type += op_type; + + /* A minimum of zero is handled either as the special case * or ?, or as + an UPTO, with the maximum given. */ + + if (repeat_min == 0) + { + if (repeat_max == -1) *code++ = OP_STAR + repeat_type; + else if (repeat_max == 1) *code++ = OP_QUERY + repeat_type; + else + { + *code++ = OP_UPTO + repeat_type; + PUT2INC(code, 0, repeat_max); + } + } + + /* A repeat minimum of 1 is optimized into some special cases. If the + maximum is unlimited, we use OP_PLUS. Otherwise, the original item it + left in place and, if the maximum is greater than 1, we use OP_UPTO with + one less than the maximum. */ + + else if (repeat_min == 1) + { + if (repeat_max == -1) + *code++ = OP_PLUS + repeat_type; + else + { + code = oldcode; /* leave previous item in place */ + if (repeat_max == 1) goto END_REPEAT; + *code++ = OP_UPTO + repeat_type; + PUT2INC(code, 0, repeat_max - 1); + } + } + + /* The case {n,n} is just an EXACT, while the general case {n,m} is + handled as an EXACT followed by an UPTO. */ + + else + { + *code++ = OP_EXACT + op_type; /* NB EXACT doesn't have repeat_type */ + PUT2INC(code, 0, repeat_min); + + /* If the maximum is unlimited, insert an OP_STAR. Before doing so, + we have to insert the character for the previous code. For a repeated + Unicode property match, there is an extra byte that defines the + required property. In UTF-8 mode, long characters have their length in + c, with the 0x80 bit as a flag. */ + + if (repeat_max < 0) + { +#ifdef SUPPORT_UTF8 + if (utf8 && c >= 128) + { + memcpy(code, utf8_char, c & 7); + code += c & 7; + } + else +#endif + { + *code++ = c; + if (prop_type >= 0) *code++ = prop_type; + } + *code++ = OP_STAR + repeat_type; + } + + /* Else insert an UPTO if the max is greater than the min, again + preceded by the character, for the previously inserted code. */ + + else if (repeat_max != repeat_min) + { +#ifdef SUPPORT_UTF8 + if (utf8 && c >= 128) + { + memcpy(code, utf8_char, c & 7); + code += c & 7; + } + else +#endif + *code++ = c; + if (prop_type >= 0) *code++ = prop_type; + repeat_max -= repeat_min; + *code++ = OP_UPTO + repeat_type; + PUT2INC(code, 0, repeat_max); + } + } + + /* The character or character type itself comes last in all cases. */ + +#ifdef SUPPORT_UTF8 + if (utf8 && c >= 128) + { + memcpy(code, utf8_char, c & 7); + code += c & 7; + } + else +#endif + *code++ = c; + + /* For a repeated Unicode property match, there is an extra byte that + defines the required property. */ + +#ifdef SUPPORT_UCP + if (prop_type >= 0) *code++ = prop_type; +#endif + } + + /* If previous was a character class or a back reference, we put the repeat + stuff after it, but just skip the item if the repeat was {0,0}. */ + + else if (*previous == OP_CLASS || + *previous == OP_NCLASS || +#ifdef SUPPORT_UTF8 + *previous == OP_XCLASS || +#endif + *previous == OP_REF) + { + if (repeat_max == 0) + { + code = previous; + goto END_REPEAT; + } + + /* All real repeats make it impossible to handle partial matching (maybe + one day we will be able to remove this restriction). */ + + if (repeat_max != 1) cd->nopartial = TRUE; + + if (repeat_min == 0 && repeat_max == -1) + *code++ = OP_CRSTAR + repeat_type; + else if (repeat_min == 1 && repeat_max == -1) + *code++ = OP_CRPLUS + repeat_type; + else if (repeat_min == 0 && repeat_max == 1) + *code++ = OP_CRQUERY + repeat_type; + else + { + *code++ = OP_CRRANGE + repeat_type; + PUT2INC(code, 0, repeat_min); + if (repeat_max == -1) repeat_max = 0; /* 2-byte encoding for max */ + PUT2INC(code, 0, repeat_max); + } + } + + /* If previous was a bracket group, we may have to replicate it in certain + cases. */ + + else if (*previous >= OP_BRA || *previous == OP_ONCE || + *previous == OP_COND) + { + register int i; + int ketoffset = 0; + int len = code - previous; + uschar *bralink = NULL; + + /* If the maximum repeat count is unlimited, find the end of the bracket + by scanning through from the start, and compute the offset back to it + from the current code pointer. There may be an OP_OPT setting following + the final KET, so we can't find the end just by going back from the code + pointer. */ + + if (repeat_max == -1) + { + register uschar *ket = previous; + do ket += GET(ket, 1); while (*ket != OP_KET); + ketoffset = code - ket; + } + + /* The case of a zero minimum is special because of the need to stick + OP_BRAZERO in front of it, and because the group appears once in the + data, whereas in other cases it appears the minimum number of times. For + this reason, it is simplest to treat this case separately, as otherwise + the code gets far too messy. There are several special subcases when the + minimum is zero. */ + + if (repeat_min == 0) + { + /* If the maximum is also zero, we just omit the group from the output + altogether. */ + + if (repeat_max == 0) + { + code = previous; + goto END_REPEAT; + } + + /* If the maximum is 1 or unlimited, we just have to stick in the + BRAZERO and do no more at this point. However, we do need to adjust + any OP_RECURSE calls inside the group that refer to the group itself or + any internal group, because the offset is from the start of the whole + regex. Temporarily terminate the pattern while doing this. */ + + if (repeat_max <= 1) + { + *code = OP_END; + adjust_recurse(previous, 1, utf8, cd); + memmove(previous+1, previous, len); + code++; + *previous++ = OP_BRAZERO + repeat_type; + } + + /* If the maximum is greater than 1 and limited, we have to replicate + in a nested fashion, sticking OP_BRAZERO before each set of brackets. + The first one has to be handled carefully because it's the original + copy, which has to be moved up. The remainder can be handled by code + that is common with the non-zero minimum case below. We have to + adjust the value or repeat_max, since one less copy is required. Once + again, we may have to adjust any OP_RECURSE calls inside the group. */ + + else + { + int offset; + *code = OP_END; + adjust_recurse(previous, 2 + LINK_SIZE, utf8, cd); + memmove(previous + 2 + LINK_SIZE, previous, len); + code += 2 + LINK_SIZE; + *previous++ = OP_BRAZERO + repeat_type; + *previous++ = OP_BRA; + + /* We chain together the bracket offset fields that have to be + filled in later when the ends of the brackets are reached. */ + + offset = (bralink == NULL)? 0 : previous - bralink; + bralink = previous; + PUTINC(previous, 0, offset); + } + + repeat_max--; + } + + /* If the minimum is greater than zero, replicate the group as many + times as necessary, and adjust the maximum to the number of subsequent + copies that we need. If we set a first char from the group, and didn't + set a required char, copy the latter from the former. */ + + else + { + if (repeat_min > 1) + { + if (groupsetfirstbyte && reqbyte < 0) reqbyte = firstbyte; + for (i = 1; i < repeat_min; i++) + { + memcpy(code, previous, len); + code += len; + } + } + if (repeat_max > 0) repeat_max -= repeat_min; + } + + /* This code is common to both the zero and non-zero minimum cases. If + the maximum is limited, it replicates the group in a nested fashion, + remembering the bracket starts on a stack. In the case of a zero minimum, + the first one was set up above. In all cases the repeat_max now specifies + the number of additional copies needed. */ + + if (repeat_max >= 0) + { + for (i = repeat_max - 1; i >= 0; i--) + { + *code++ = OP_BRAZERO + repeat_type; + + /* All but the final copy start a new nesting, maintaining the + chain of brackets outstanding. */ + + if (i != 0) + { + int offset; + *code++ = OP_BRA; + offset = (bralink == NULL)? 0 : code - bralink; + bralink = code; + PUTINC(code, 0, offset); + } + + memcpy(code, previous, len); + code += len; + } + + /* Now chain through the pending brackets, and fill in their length + fields (which are holding the chain links pro tem). */ + + while (bralink != NULL) + { + int oldlinkoffset; + int offset = code - bralink + 1; + uschar *bra = code - offset; + oldlinkoffset = GET(bra, 1); + bralink = (oldlinkoffset == 0)? NULL : bralink - oldlinkoffset; + *code++ = OP_KET; + PUTINC(code, 0, offset); + PUT(bra, 1, offset); + } + } + + /* If the maximum is unlimited, set a repeater in the final copy. We + can't just offset backwards from the current code point, because we + don't know if there's been an options resetting after the ket. The + correct offset was computed above. */ + + else code[-ketoffset] = OP_KETRMAX + repeat_type; + } + + /* Else there's some kind of shambles */ + + else + { + *errorcodeptr = ERR11; + goto FAILED; + } + + /* If the character following a repeat is '+', we wrap the entire repeated + item inside OP_ONCE brackets. This is just syntactic sugar, taken from + Sun's Java package. The repeated item starts at tempcode, not at previous, + which might be the first part of a string whose (former) last char we + repeated. However, we don't support '+' after a greediness '?'. */ + + if (possessive_quantifier) + { + int len = code - tempcode; + memmove(tempcode + 1+LINK_SIZE, tempcode, len); + code += 1 + LINK_SIZE; + len += 1 + LINK_SIZE; + tempcode[0] = OP_ONCE; + *code++ = OP_KET; + PUTINC(code, 0, len); + PUT(tempcode, 1, len); + } + + /* In all case we no longer have a previous item. We also set the + "follows varying string" flag for subsequently encountered reqbytes if + it isn't already set and we have just passed a varying length item. */ + + END_REPEAT: + previous = NULL; + cd->req_varyopt |= reqvary; + break; + + + /* Start of nested bracket sub-expression, or comment or lookahead or + lookbehind or option setting or condition. First deal with special things + that can come after a bracket; all are introduced by ?, and the appearance + of any of them means that this is not a referencing group. They were + checked for validity in the first pass over the string, so we don't have to + check for syntax errors here. */ + + case '(': + newoptions = options; + skipbytes = 0; + + if (*(++ptr) == '?') + { + int set, unset; + int *optset; + + switch (*(++ptr)) + { + case '#': /* Comment; skip to ket */ + ptr++; + while (*ptr != ')') ptr++; + continue; + + case ':': /* Non-extracting bracket */ + bravalue = OP_BRA; + ptr++; + break; + + case '(': + bravalue = OP_COND; /* Conditional group */ + + /* Condition to test for recursion */ + + if (ptr[1] == 'R') + { + code[1+LINK_SIZE] = OP_CREF; + PUT2(code, 2+LINK_SIZE, CREF_RECURSE); + skipbytes = 3; + ptr += 3; + } + + /* Condition to test for a numbered subpattern match. We know that + if a digit follows ( then there will just be digits until ) because + the syntax was checked in the first pass. */ + + else if ((digitab[ptr[1]] && ctype_digit) != 0) + { + int condref; /* Don't amalgamate; some compilers */ + condref = *(++ptr) - '0'; /* grumble at autoincrement in declaration */ + while (*(++ptr) != ')') condref = condref*10 + *ptr - '0'; + if (condref == 0) + { + *errorcodeptr = ERR35; + goto FAILED; + } + ptr++; + code[1+LINK_SIZE] = OP_CREF; + PUT2(code, 2+LINK_SIZE, condref); + skipbytes = 3; + } + /* For conditions that are assertions, we just fall through, having + set bravalue above. */ + break; + + case '=': /* Positive lookahead */ + bravalue = OP_ASSERT; + ptr++; + break; + + case '!': /* Negative lookahead */ + bravalue = OP_ASSERT_NOT; + ptr++; + break; + + case '<': /* Lookbehinds */ + switch (*(++ptr)) + { + case '=': /* Positive lookbehind */ + bravalue = OP_ASSERTBACK; + ptr++; + break; + + case '!': /* Negative lookbehind */ + bravalue = OP_ASSERTBACK_NOT; + ptr++; + break; + } + break; + + case '>': /* One-time brackets */ + bravalue = OP_ONCE; + ptr++; + break; + + case 'C': /* Callout - may be followed by digits; */ + previous_callout = code; /* Save for later completion */ + after_manual_callout = 1; /* Skip one item before completing */ + *code++ = OP_CALLOUT; /* Already checked that the terminating */ + { /* closing parenthesis is present. */ + int n = 0; + while ((digitab[*(++ptr)] & ctype_digit) != 0) + n = n * 10 + *ptr - '0'; + if (n > 255) + { + *errorcodeptr = ERR38; + goto FAILED; + } + *code++ = n; + PUT(code, 0, ptr - cd->start_pattern + 1); /* Pattern offset */ + PUT(code, LINK_SIZE, 0); /* Default length */ + code += 2 * LINK_SIZE; + } + previous = NULL; + continue; + + case 'P': /* Named subpattern handling */ + if (*(++ptr) == '<') /* Definition */ + { + int i, namelen; + uschar *slot = cd->name_table; + const uschar *name; /* Don't amalgamate; some compilers */ + name = ++ptr; /* grumble at autoincrement in declaration */ + + while (*ptr++ != '>'){ /*nothing*/ } + namelen = ptr - name - 1; + + for (i = 0; i < cd->names_found; i++) + { + int crc = memcmp(name, slot+2, namelen); + if (crc == 0) + { + if (slot[2+namelen] == 0) + { + *errorcodeptr = ERR43; + goto FAILED; + } + crc = -1; /* Current name is substring */ + } + if (crc < 0) + { + memmove(slot + cd->name_entry_size, slot, + (cd->names_found - i) * cd->name_entry_size); + break; + } + slot += cd->name_entry_size; + } + + PUT2(slot, 0, *brackets + 1); + memcpy(slot + 2, name, namelen); + slot[2+namelen] = 0; + cd->names_found++; + goto NUMBERED_GROUP; + } + + if (*ptr == '=' || *ptr == '>') /* Reference or recursion */ + { + int i, namelen; + int type = *ptr++; + const uschar *name = ptr; + uschar *slot = cd->name_table; + + while (*ptr != ')') ptr++; + namelen = ptr - name; + + for (i = 0; i < cd->names_found; i++) + { + if (strncmp((char *)name, (char *)slot+2, namelen) == 0) break; + slot += cd->name_entry_size; + } + if (i >= cd->names_found) + { + *errorcodeptr = ERR15; + goto FAILED; + } + + recno = GET2(slot, 0); + + if (type == '>') goto HANDLE_RECURSION; /* A few lines below */ + + /* Back reference */ + + previous = code; + *code++ = OP_REF; + PUT2INC(code, 0, recno); + cd->backref_map |= (recno < 32)? (1 << recno) : 1; + if (recno > cd->top_backref) cd->top_backref = recno; + continue; + } + + /* Should never happen */ + break; + + case 'R': /* Pattern recursion */ + ptr++; /* Same as (?0) */ + /* Fall through */ + + /* Recursion or "subroutine" call */ + + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + { + const uschar *called; + recno = 0; + while((digitab[*ptr] & ctype_digit) != 0) + recno = recno * 10 + *ptr++ - '0'; + + /* Come here from code above that handles a named recursion */ + + HANDLE_RECURSION: + + previous = code; + + /* Find the bracket that is being referenced. Temporarily end the + regex in case it doesn't exist. */ + + *code = OP_END; + called = (recno == 0)? + cd->start_code : find_bracket(cd->start_code, utf8, recno); + + if (called == NULL) + { + *errorcodeptr = ERR15; + goto FAILED; + } + + /* If the subpattern is still open, this is a recursive call. We + check to see if this is a left recursion that could loop for ever, + and diagnose that case. */ + + if (GET(called, 1) == 0 && could_be_empty(called, code, bcptr, utf8)) + { + *errorcodeptr = ERR40; + goto FAILED; + } + + /* Insert the recursion/subroutine item */ + + *code = OP_RECURSE; + PUT(code, 1, called - cd->start_code); + code += 1 + LINK_SIZE; + } + continue; + + /* Character after (? not specially recognized */ + + default: /* Option setting */ + set = unset = 0; + optset = &set; + + while (*ptr != ')' && *ptr != ':') + { + switch (*ptr++) + { + case '-': optset = &unset; break; + + case 'i': *optset |= PCRE_CASELESS; break; + case 'm': *optset |= PCRE_MULTILINE; break; + case 's': *optset |= PCRE_DOTALL; break; + case 'x': *optset |= PCRE_EXTENDED; break; + case 'U': *optset |= PCRE_UNGREEDY; break; + case 'X': *optset |= PCRE_EXTRA; break; + } + } + + /* Set up the changed option bits, but don't change anything yet. */ + + newoptions = (options | set) & (~unset); + + /* If the options ended with ')' this is not the start of a nested + group with option changes, so the options change at this level. Compile + code to change the ims options if this setting actually changes any of + them. We also pass the new setting back so that it can be put at the + start of any following branches, and when this group ends (if we are in + a group), a resetting item can be compiled. + + Note that if this item is right at the start of the pattern, the + options will have been abstracted and made global, so there will be no + change to compile. */ + + if (*ptr == ')') + { + if ((options & PCRE_IMS) != (newoptions & PCRE_IMS)) + { + *code++ = OP_OPT; + *code++ = newoptions & PCRE_IMS; + } + + /* Change options at this level, and pass them back for use + in subsequent branches. Reset the greedy defaults and the case + value for firstbyte and reqbyte. */ + + *optionsptr = options = newoptions; + greedy_default = ((newoptions & PCRE_UNGREEDY) != 0); + greedy_non_default = greedy_default ^ 1; + req_caseopt = ((options & PCRE_CASELESS) != 0)? REQ_CASELESS : 0; + + previous = NULL; /* This item can't be repeated */ + continue; /* It is complete */ + } + + /* If the options ended with ':' we are heading into a nested group + with possible change of options. Such groups are non-capturing and are + not assertions of any kind. All we need to do is skip over the ':'; + the newoptions value is handled below. */ + + bravalue = OP_BRA; + ptr++; + } + } + + /* If PCRE_NO_AUTO_CAPTURE is set, all unadorned brackets become + non-capturing and behave like (?:...) brackets */ + + else if ((options & PCRE_NO_AUTO_CAPTURE) != 0) + { + bravalue = OP_BRA; + } + + /* Else we have a referencing group; adjust the opcode. If the bracket + number is greater than EXTRACT_BASIC_MAX, we set the opcode one higher, and + arrange for the true number to follow later, in an OP_BRANUMBER item. */ + + else + { + NUMBERED_GROUP: + if (++(*brackets) > EXTRACT_BASIC_MAX) + { + bravalue = OP_BRA + EXTRACT_BASIC_MAX + 1; + code[1+LINK_SIZE] = OP_BRANUMBER; + PUT2(code, 2+LINK_SIZE, *brackets); + skipbytes = 3; + } + else bravalue = OP_BRA + *brackets; + } + + /* Process nested bracketed re. Assertions may not be repeated, but other + kinds can be. We copy code into a non-register variable in order to be able + to pass its address because some compilers complain otherwise. Pass in a + new setting for the ims options if they have changed. */ + + previous = (bravalue >= OP_ONCE)? code : NULL; + *code = bravalue; + tempcode = code; + tempreqvary = cd->req_varyopt; /* Save value before bracket */ + + if (!compile_regex( + newoptions, /* The complete new option state */ + options & PCRE_IMS, /* The previous ims option state */ + brackets, /* Extracting bracket count */ + &tempcode, /* Where to put code (updated) */ + &ptr, /* Input pointer (updated) */ + errorcodeptr, /* Where to put an error message */ + (bravalue == OP_ASSERTBACK || + bravalue == OP_ASSERTBACK_NOT), /* TRUE if back assert */ + skipbytes, /* Skip over OP_COND/OP_BRANUMBER */ + &subfirstbyte, /* For possible first char */ + &subreqbyte, /* For possible last char */ + bcptr, /* Current branch chain */ + cd)) /* Tables block */ + goto FAILED; + + /* At the end of compiling, code is still pointing to the start of the + group, while tempcode has been updated to point past the end of the group + and any option resetting that may follow it. The pattern pointer (ptr) + is on the bracket. */ + + /* If this is a conditional bracket, check that there are no more than + two branches in the group. */ + + else if (bravalue == OP_COND) + { + uschar *tc = code; + condcount = 0; + + do { + condcount++; + tc += GET(tc,1); + } + while (*tc != OP_KET); + + if (condcount > 2) + { + *errorcodeptr = ERR27; + goto FAILED; + } + + /* If there is just one branch, we must not make use of its firstbyte or + reqbyte, because this is equivalent to an empty second branch. */ + + if (condcount == 1) subfirstbyte = subreqbyte = REQ_NONE; + } + + /* Handle updating of the required and first characters. Update for normal + brackets of all kinds, and conditions with two branches (see code above). + If the bracket is followed by a quantifier with zero repeat, we have to + back off. Hence the definition of zeroreqbyte and zerofirstbyte outside the + main loop so that they can be accessed for the back off. */ + + zeroreqbyte = reqbyte; + zerofirstbyte = firstbyte; + groupsetfirstbyte = FALSE; + + if (bravalue >= OP_BRA || bravalue == OP_ONCE || bravalue == OP_COND) + { + /* If we have not yet set a firstbyte in this branch, take it from the + subpattern, remembering that it was set here so that a repeat of more + than one can replicate it as reqbyte if necessary. If the subpattern has + no firstbyte, set "none" for the whole branch. In both cases, a zero + repeat forces firstbyte to "none". */ + + if (firstbyte == REQ_UNSET) + { + if (subfirstbyte >= 0) + { + firstbyte = subfirstbyte; + groupsetfirstbyte = TRUE; + } + else firstbyte = REQ_NONE; + zerofirstbyte = REQ_NONE; + } + + /* If firstbyte was previously set, convert the subpattern's firstbyte + into reqbyte if there wasn't one, using the vary flag that was in + existence beforehand. */ + + else if (subfirstbyte >= 0 && subreqbyte < 0) + subreqbyte = subfirstbyte | tempreqvary; + + /* If the subpattern set a required byte (or set a first byte that isn't + really the first byte - see above), set it. */ + + if (subreqbyte >= 0) reqbyte = subreqbyte; + } + + /* For a forward assertion, we take the reqbyte, if set. This can be + helpful if the pattern that follows the assertion doesn't set a different + char. For example, it's useful for /(?=abcde).+/. We can't set firstbyte + for an assertion, however because it leads to incorrect effect for patterns + such as /(?=a)a.+/ when the "real" "a" would then become a reqbyte instead + of a firstbyte. This is overcome by a scan at the end if there's no + firstbyte, looking for an asserted first char. */ + + else if (bravalue == OP_ASSERT && subreqbyte >= 0) reqbyte = subreqbyte; + + /* Now update the main code pointer to the end of the group. */ + + code = tempcode; + + /* Error if hit end of pattern */ + + if (*ptr != ')') + { + *errorcodeptr = ERR14; + goto FAILED; + } + break; + + /* Check \ for being a real metacharacter; if not, fall through and handle + it as a data character at the start of a string. Escape items are checked + for validity in the pre-compiling pass. */ + + case '\\': + tempptr = ptr; + c = check_escape(&ptr, errorcodeptr, *brackets, options, FALSE); + + /* Handle metacharacters introduced by \. For ones like \d, the ESC_ values + are arranged to be the negation of the corresponding OP_values. For the + back references, the values are ESC_REF plus the reference number. Only + back references and those types that consume a character may be repeated. + We can test for values between ESC_b and ESC_Z for the latter; this may + have to change if any new ones are ever created. */ + + if (c < 0) + { + if (-c == ESC_Q) /* Handle start of quoted string */ + { + if (ptr[1] == '\\' && ptr[2] == 'E') ptr += 2; /* avoid empty string */ + else inescq = TRUE; + continue; + } + + /* For metasequences that actually match a character, we disable the + setting of a first character if it hasn't already been set. */ + + if (firstbyte == REQ_UNSET && -c > ESC_b && -c < ESC_Z) + firstbyte = REQ_NONE; + + /* Set values to reset to if this is followed by a zero repeat. */ + + zerofirstbyte = firstbyte; + zeroreqbyte = reqbyte; + + /* Back references are handled specially */ + + if (-c >= ESC_REF) + { + int number = -c - ESC_REF; + previous = code; + *code++ = OP_REF; + PUT2INC(code, 0, number); + } + + /* So are Unicode property matches, if supported. We know that get_ucp + won't fail because it was tested in the pre-pass. */ + +#ifdef SUPPORT_UCP + else if (-c == ESC_P || -c == ESC_p) + { + BOOL negated; + int value = get_ucp(&ptr, &negated, errorcodeptr); + previous = code; + *code++ = ((-c == ESC_p) != negated)? OP_PROP : OP_NOTPROP; + *code++ = value; + } +#endif + + /* For the rest, we can obtain the OP value by negating the escape + value */ + + else + { + previous = (-c > ESC_b && -c < ESC_Z)? code : NULL; + *code++ = -c; + } + continue; + } + + /* We have a data character whose value is in c. In UTF-8 mode it may have + a value > 127. We set its representation in the length/buffer, and then + handle it as a data character. */ + +#ifdef SUPPORT_UTF8 + if (utf8 && c > 127) + mclength = _pcre_ord2utf8(c, mcbuffer); + else +#endif + + { + mcbuffer[0] = c; + mclength = 1; + } + + goto ONE_CHAR; + + /* Handle a literal character. It is guaranteed not to be whitespace or # + when the extended flag is set. If we are in UTF-8 mode, it may be a + multi-byte literal character. */ + + default: + NORMAL_CHAR: + mclength = 1; + mcbuffer[0] = c; + +#ifdef SUPPORT_UTF8 + if (utf8 && (c & 0xc0) == 0xc0) + { + while ((ptr[1] & 0xc0) == 0x80) + mcbuffer[mclength++] = *(++ptr); + } +#endif + + /* At this point we have the character's bytes in mcbuffer, and the length + in mclength. When not in UTF-8 mode, the length is always 1. */ + + ONE_CHAR: + previous = code; + *code++ = ((options & PCRE_CASELESS) != 0)? OP_CHARNC : OP_CHAR; + for (c = 0; c < mclength; c++) *code++ = mcbuffer[c]; + + /* Set the first and required bytes appropriately. If no previous first + byte, set it from this character, but revert to none on a zero repeat. + Otherwise, leave the firstbyte value alone, and don't change it on a zero + repeat. */ + + if (firstbyte == REQ_UNSET) + { + zerofirstbyte = REQ_NONE; + zeroreqbyte = reqbyte; + + /* If the character is more than one byte long, we can set firstbyte + only if it is not to be matched caselessly. */ + + if (mclength == 1 || req_caseopt == 0) + { + firstbyte = mcbuffer[0] | req_caseopt; + if (mclength != 1) reqbyte = code[-1] | cd->req_varyopt; + } + else firstbyte = reqbyte = REQ_NONE; + } + + /* firstbyte was previously set; we can set reqbyte only the length is + 1 or the matching is caseful. */ + + else + { + zerofirstbyte = firstbyte; + zeroreqbyte = reqbyte; + if (mclength == 1 || req_caseopt == 0) + reqbyte = code[-1] | req_caseopt | cd->req_varyopt; + } + + break; /* End of literal character handling */ + } + } /* end of big loop */ + +/* Control never reaches here by falling through, only by a goto for all the +error states. Pass back the position in the pattern so that it can be displayed +to the user for diagnosing the error. */ + +FAILED: +*ptrptr = ptr; +return FALSE; +} + + + + +/************************************************* +* Compile sequence of alternatives * +*************************************************/ + +/* On entry, ptr is pointing past the bracket character, but on return +it points to the closing bracket, or vertical bar, or end of string. +The code variable is pointing at the byte into which the BRA operator has been +stored. If the ims options are changed at the start (for a (?ims: group) or +during any branch, we need to insert an OP_OPT item at the start of every +following branch to ensure they get set correctly at run time, and also pass +the new options into every subsequent branch compile. + +Argument: + options option bits, including any changes for this subpattern + oldims previous settings of ims option bits + brackets -> int containing the number of extracting brackets used + codeptr -> the address of the current code pointer + ptrptr -> the address of the current pattern pointer + errorcodeptr -> pointer to error code variable + lookbehind TRUE if this is a lookbehind assertion + skipbytes skip this many bytes at start (for OP_COND, OP_BRANUMBER) + firstbyteptr place to put the first required character, or a negative number + reqbyteptr place to put the last required character, or a negative number + bcptr pointer to the chain of currently open branches + cd points to the data block with tables pointers etc. + +Returns: TRUE on success +*/ + +static BOOL +compile_regex(int options, int oldims, int *brackets, uschar **codeptr, + const uschar **ptrptr, int *errorcodeptr, BOOL lookbehind, int skipbytes, + int *firstbyteptr, int *reqbyteptr, branch_chain *bcptr, compile_data *cd) +{ +const uschar *ptr = *ptrptr; +uschar *code = *codeptr; +uschar *last_branch = code; +uschar *start_bracket = code; +uschar *reverse_count = NULL; +int firstbyte, reqbyte; +int branchfirstbyte, branchreqbyte; +branch_chain bc; + +bc.outer = bcptr; +bc.current = code; + +firstbyte = reqbyte = REQ_UNSET; + +/* Offset is set zero to mark that this bracket is still open */ + +PUT(code, 1, 0); +code += 1 + LINK_SIZE + skipbytes; + +/* Loop for each alternative branch */ + +for (;;) + { + /* Handle a change of ims options at the start of the branch */ + + if ((options & PCRE_IMS) != oldims) + { + *code++ = OP_OPT; + *code++ = options & PCRE_IMS; + } + + /* Set up dummy OP_REVERSE if lookbehind assertion */ + + if (lookbehind) + { + *code++ = OP_REVERSE; + reverse_count = code; + PUTINC(code, 0, 0); + } + + /* Now compile the branch */ + + if (!compile_branch(&options, brackets, &code, &ptr, errorcodeptr, + &branchfirstbyte, &branchreqbyte, &bc, cd)) + { + *ptrptr = ptr; + return FALSE; + } + + /* If this is the first branch, the firstbyte and reqbyte values for the + branch become the values for the regex. */ + + if (*last_branch != OP_ALT) + { + firstbyte = branchfirstbyte; + reqbyte = branchreqbyte; + } + + /* If this is not the first branch, the first char and reqbyte have to + match the values from all the previous branches, except that if the previous + value for reqbyte didn't have REQ_VARY set, it can still match, and we set + REQ_VARY for the regex. */ + + else + { + /* If we previously had a firstbyte, but it doesn't match the new branch, + we have to abandon the firstbyte for the regex, but if there was previously + no reqbyte, it takes on the value of the old firstbyte. */ + + if (firstbyte >= 0 && firstbyte != branchfirstbyte) + { + if (reqbyte < 0) reqbyte = firstbyte; + firstbyte = REQ_NONE; + } + + /* If we (now or from before) have no firstbyte, a firstbyte from the + branch becomes a reqbyte if there isn't a branch reqbyte. */ + + if (firstbyte < 0 && branchfirstbyte >= 0 && branchreqbyte < 0) + branchreqbyte = branchfirstbyte; + + /* Now ensure that the reqbytes match */ + + if ((reqbyte & ~REQ_VARY) != (branchreqbyte & ~REQ_VARY)) + reqbyte = REQ_NONE; + else reqbyte |= branchreqbyte; /* To "or" REQ_VARY */ + } + + /* If lookbehind, check that this branch matches a fixed-length string, + and put the length into the OP_REVERSE item. Temporarily mark the end of + the branch with OP_END. */ + + if (lookbehind) + { + int length; + *code = OP_END; + length = find_fixedlength(last_branch, options); + DPRINTF(("fixed length = %d\n", length)); + if (length < 0) + { + *errorcodeptr = (length == -2)? ERR36 : ERR25; + *ptrptr = ptr; + return FALSE; + } + PUT(reverse_count, 0, length); + } + + /* Reached end of expression, either ')' or end of pattern. Go back through + the alternative branches and reverse the chain of offsets, with the field in + the BRA item now becoming an offset to the first alternative. If there are + no alternatives, it points to the end of the group. The length in the + terminating ket is always the length of the whole bracketed item. If any of + the ims options were changed inside the group, compile a resetting op-code + following, except at the very end of the pattern. Return leaving the pointer + at the terminating char. */ + + if (*ptr != '|') + { + int length = code - last_branch; + do + { + int prev_length = GET(last_branch, 1); + PUT(last_branch, 1, length); + length = prev_length; + last_branch -= length; + } + while (length > 0); + + /* Fill in the ket */ + + *code = OP_KET; + PUT(code, 1, code - start_bracket); + code += 1 + LINK_SIZE; + + /* Resetting option if needed */ + + if ((options & PCRE_IMS) != oldims && *ptr == ')') + { + *code++ = OP_OPT; + *code++ = oldims; + } + + /* Set values to pass back */ + + *codeptr = code; + *ptrptr = ptr; + *firstbyteptr = firstbyte; + *reqbyteptr = reqbyte; + return TRUE; + } + + /* Another branch follows; insert an "or" node. Its length field points back + to the previous branch while the bracket remains open. At the end the chain + is reversed. It's done like this so that the start of the bracket has a + zero offset until it is closed, making it possible to detect recursion. */ + + *code = OP_ALT; + PUT(code, 1, code - last_branch); + bc.current = last_branch = code; + code += 1 + LINK_SIZE; + ptr++; + } +/* Control never reaches here */ +} + + + + +/************************************************* +* Check for anchored expression * +*************************************************/ + +/* Try to find out if this is an anchored regular expression. Consider each +alternative branch. If they all start with OP_SOD or OP_CIRC, or with a bracket +all of whose alternatives start with OP_SOD or OP_CIRC (recurse ad lib), then +it's anchored. However, if this is a multiline pattern, then only OP_SOD +counts, since OP_CIRC can match in the middle. + +We can also consider a regex to be anchored if OP_SOM starts all its branches. +This is the code for \G, which means "match at start of match position, taking +into account the match offset". + +A branch is also implicitly anchored if it starts with .* and DOTALL is set, +because that will try the rest of the pattern at all possible matching points, +so there is no point trying again.... er .... + +.... except when the .* appears inside capturing parentheses, and there is a +subsequent back reference to those parentheses. We haven't enough information +to catch that case precisely. + +At first, the best we could do was to detect when .* was in capturing brackets +and the highest back reference was greater than or equal to that level. +However, by keeping a bitmap of the first 31 back references, we can catch some +of the more common cases more precisely. + +Arguments: + code points to start of expression (the bracket) + options points to the options setting + bracket_map a bitmap of which brackets we are inside while testing; this + handles up to substring 31; after that we just have to take + the less precise approach + backref_map the back reference bitmap + +Returns: TRUE or FALSE +*/ + +static BOOL +is_anchored(register const uschar *code, int *options, unsigned int bracket_map, + unsigned int backref_map) +{ +do { + const uschar *scode = + first_significant_code(code + 1+LINK_SIZE, options, PCRE_MULTILINE, FALSE); + register int op = *scode; + + /* Capturing brackets */ + + if (op > OP_BRA) + { + int new_map; + op -= OP_BRA; + if (op > EXTRACT_BASIC_MAX) op = GET2(scode, 2+LINK_SIZE); + new_map = bracket_map | ((op < 32)? (1 << op) : 1); + if (!is_anchored(scode, options, new_map, backref_map)) return FALSE; + } + + /* Other brackets */ + + else if (op == OP_BRA || op == OP_ASSERT || op == OP_ONCE || op == OP_COND) + { + if (!is_anchored(scode, options, bracket_map, backref_map)) return FALSE; + } + + /* .* is not anchored unless DOTALL is set and it isn't in brackets that + are or may be referenced. */ + + else if ((op == OP_TYPESTAR || op == OP_TYPEMINSTAR) && + (*options & PCRE_DOTALL) != 0) + { + if (scode[1] != OP_ANY || (bracket_map & backref_map) != 0) return FALSE; + } + + /* Check for explicit anchoring */ + + else if (op != OP_SOD && op != OP_SOM && + ((*options & PCRE_MULTILINE) != 0 || op != OP_CIRC)) + return FALSE; + code += GET(code, 1); + } +while (*code == OP_ALT); /* Loop for each alternative */ +return TRUE; +} + + + +/************************************************* +* Check for starting with ^ or .* * +*************************************************/ + +/* This is called to find out if every branch starts with ^ or .* so that +"first char" processing can be done to speed things up in multiline +matching and for non-DOTALL patterns that start with .* (which must start at +the beginning or after \n). As in the case of is_anchored() (see above), we +have to take account of back references to capturing brackets that contain .* +because in that case we can't make the assumption. + +Arguments: + code points to start of expression (the bracket) + bracket_map a bitmap of which brackets we are inside while testing; this + handles up to substring 31; after that we just have to take + the less precise approach + backref_map the back reference bitmap + +Returns: TRUE or FALSE +*/ + +static BOOL +is_startline(const uschar *code, unsigned int bracket_map, + unsigned int backref_map) +{ +do { + const uschar *scode = first_significant_code(code + 1+LINK_SIZE, NULL, 0, + FALSE); + register int op = *scode; + + /* Capturing brackets */ + + if (op > OP_BRA) + { + int new_map; + op -= OP_BRA; + if (op > EXTRACT_BASIC_MAX) op = GET2(scode, 2+LINK_SIZE); + new_map = bracket_map | ((op < 32)? (1 << op) : 1); + if (!is_startline(scode, new_map, backref_map)) return FALSE; + } + + /* Other brackets */ + + else if (op == OP_BRA || op == OP_ASSERT || op == OP_ONCE || op == OP_COND) + { if (!is_startline(scode, bracket_map, backref_map)) return FALSE; } + + /* .* means "start at start or after \n" if it isn't in brackets that + may be referenced. */ + + else if (op == OP_TYPESTAR || op == OP_TYPEMINSTAR) + { + if (scode[1] != OP_ANY || (bracket_map & backref_map) != 0) return FALSE; + } + + /* Check for explicit circumflex */ + + else if (op != OP_CIRC) return FALSE; + + /* Move on to the next alternative */ + + code += GET(code, 1); + } +while (*code == OP_ALT); /* Loop for each alternative */ +return TRUE; +} + + + +/************************************************* +* Check for asserted fixed first char * +*************************************************/ + +/* During compilation, the "first char" settings from forward assertions are +discarded, because they can cause conflicts with actual literals that follow. +However, if we end up without a first char setting for an unanchored pattern, +it is worth scanning the regex to see if there is an initial asserted first +char. If all branches start with the same asserted char, or with a bracket all +of whose alternatives start with the same asserted char (recurse ad lib), then +we return that char, otherwise -1. + +Arguments: + code points to start of expression (the bracket) + options pointer to the options (used to check casing changes) + inassert TRUE if in an assertion + +Returns: -1 or the fixed first char +*/ + +static int +find_firstassertedchar(const uschar *code, int *options, BOOL inassert) +{ +register int c = -1; +do { + int d; + const uschar *scode = + first_significant_code(code + 1+LINK_SIZE, options, PCRE_CASELESS, TRUE); + register int op = *scode; + + if (op >= OP_BRA) op = OP_BRA; + + switch(op) + { + default: + return -1; + + case OP_BRA: + case OP_ASSERT: + case OP_ONCE: + case OP_COND: + if ((d = find_firstassertedchar(scode, options, op == OP_ASSERT)) < 0) + return -1; + if (c < 0) c = d; else if (c != d) return -1; + break; + + case OP_EXACT: /* Fall through */ + scode += 2; + + case OP_CHAR: + case OP_CHARNC: + case OP_PLUS: + case OP_MINPLUS: + if (!inassert) return -1; + if (c < 0) + { + c = scode[1]; + if ((*options & PCRE_CASELESS) != 0) c |= REQ_CASELESS; + } + else if (c != scode[1]) return -1; + break; + } + + code += GET(code, 1); + } +while (*code == OP_ALT); +return c; +} + + + +/************************************************* +* Compile a Regular Expression * +*************************************************/ + +/* This function takes a string and returns a pointer to a block of store +holding a compiled version of the expression. The original API for this +function had no error code return variable; it is retained for backwards +compatibility. The new function is given a new name. + +Arguments: + pattern the regular expression + options various option bits + errorcodeptr pointer to error code variable (pcre_compile2() only) + can be NULL if you don't want a code value + errorptr pointer to pointer to error text + erroroffset ptr offset in pattern where error was detected + tables pointer to character tables or NULL + +Returns: pointer to compiled data block, or NULL on error, + with errorptr and erroroffset set +*/ + +PCRE_EXPORT pcre * +pcre_compile(const char *pattern, int options, const char **errorptr, + int *erroroffset, const unsigned char *tables) +{ +return pcre_compile2(pattern, options, NULL, errorptr, erroroffset, tables); +} + + +PCRE_EXPORT pcre * +pcre_compile2(const char *pattern, int options, int *errorcodeptr, + const char **errorptr, int *erroroffset, const unsigned char *tables) +{ +real_pcre *re; +int length = 1 + LINK_SIZE; /* For initial BRA plus length */ +int c, firstbyte, reqbyte; +int bracount = 0; +int branch_extra = 0; +int branch_newextra; +int item_count = -1; +int name_count = 0; +int max_name_size = 0; +int lastitemlength = 0; +int errorcode = 0; +#ifdef SUPPORT_UTF8 +BOOL utf8; +BOOL class_utf8; +#endif +BOOL inescq = FALSE; +BOOL capturing; +unsigned int brastackptr = 0; +size_t size; +uschar *code; +const uschar *codestart; +const uschar *ptr; +compile_data compile_block; +int brastack[BRASTACK_SIZE]; +uschar bralenstack[BRASTACK_SIZE]; + +/* We can't pass back an error message if errorptr is NULL; I guess the best we +can do is just return NULL, but we can set a code value if there is a code +pointer. */ + +if (errorptr == NULL) + { + if (errorcodeptr != NULL) *errorcodeptr = 99; + return NULL; + } + +*errorptr = NULL; +if (errorcodeptr != NULL) *errorcodeptr = ERR0; + +/* However, we can give a message for this error */ + +if (erroroffset == NULL) + { + errorcode = ERR16; + goto PCRE_EARLY_ERROR_RETURN; + } + +*erroroffset = 0; + +/* Can't support UTF8 unless PCRE has been compiled to include the code. */ + +#ifdef SUPPORT_UTF8 +utf8 = (options & PCRE_UTF8) != 0; +if (utf8 && (options & PCRE_NO_UTF8_CHECK) == 0 && + (*erroroffset = _pcre_valid_utf8((uschar *)pattern, -1)) >= 0) + { + errorcode = ERR44; + goto PCRE_EARLY_ERROR_RETURN; + } +#else +if ((options & PCRE_UTF8) != 0) + { + errorcode = ERR32; + goto PCRE_EARLY_ERROR_RETURN; + } +#endif + +if ((options & ~PUBLIC_OPTIONS) != 0) + { + errorcode = ERR17; + goto PCRE_EARLY_ERROR_RETURN; + } + +/* Set up pointers to the individual character tables */ + +if (tables == NULL) tables = _pcre_default_tables; +compile_block.lcc = tables + lcc_offset; +compile_block.fcc = tables + fcc_offset; +compile_block.cbits = tables + cbits_offset; +compile_block.ctypes = tables + ctypes_offset; + +/* Maximum back reference and backref bitmap. This is updated for numeric +references during the first pass, but for named references during the actual +compile pass. The bitmap records up to 31 back references to help in deciding +whether (.*) can be treated as anchored or not. */ + +compile_block.top_backref = 0; +compile_block.backref_map = 0; + +/* Reflect pattern for debugging output */ + +DPRINTF(("------------------------------------------------------------------\n")); +DPRINTF(("%s\n", pattern)); + +/* The first thing to do is to make a pass over the pattern to compute the +amount of store required to hold the compiled code. This does not have to be +perfect as long as errors are overestimates. At the same time we can detect any +flag settings right at the start, and extract them. Make an attempt to correct +for any counted white space if an "extended" flag setting appears late in the +pattern. We can't be so clever for #-comments. */ + +ptr = (const uschar *)(pattern - 1); +while ((c = *(++ptr)) != 0) + { + int min = 0, max = 0; // init to make GCC happy + int class_optcount; + int bracket_length; + int duplength; + + /* If we are inside a \Q...\E sequence, all chars are literal */ + + if (inescq) + { + if ((options & PCRE_AUTO_CALLOUT) != 0) length += 2 + 2*LINK_SIZE; + goto NORMAL_CHAR; + } + + /* Otherwise, first check for ignored whitespace and comments */ + + if ((options & PCRE_EXTENDED) != 0) + { + if (c < 256) + { + if ((compile_block.ctypes[c] & ctype_space) != 0) + continue; + } + else if (isUnicodeWhiteSpace(c) == true) + { + continue; + } + + if (c == '#') + { + /* The space before the ; is to avoid a warning on a silly compiler + on the Macintosh. */ + while ((c = *(++ptr)) != 0 && !isECMALineTerminator(c)) ; + if (c == 0) break; + continue; + } + } + + item_count++; /* Is zero for the first non-comment item */ + + /* Allow space for auto callout before every item except quantifiers. */ + + if ((options & PCRE_AUTO_CALLOUT) != 0 && + c != '*' && c != '+' && c != '?' && + (c != '{' || !is_counted_repeat(ptr + 1))) + length += 2 + 2*LINK_SIZE; + + switch(c) + { + /* A backslashed item may be an escaped data character or it may be a + character type. */ + + case '\\': + c = check_escape(&ptr, &errorcode, bracount, options, FALSE); + if (errorcode != 0) goto PCRE_ERROR_RETURN; + + lastitemlength = 1; /* Default length of last item for repeats */ + + if (c >= 0) /* Data character */ + { + length += 2; /* For a one-byte character */ + +#ifdef SUPPORT_UTF8 + if (utf8 && c > 127) + { + int i; + for (i = 0; i < _pcre_utf8_table1_size; i++) + if (c <= _pcre_utf8_table1[i]) break; + length += i; + lastitemlength += i; + } +#endif + + continue; + } + + /* If \Q, enter "literal" mode */ + + if (-c == ESC_Q) + { + inescq = TRUE; + continue; + } + + /* \X is supported only if Unicode property support is compiled */ + +#ifndef SUPPORT_UCP + if (-c == ESC_X) + { + errorcode = ERR45; + goto PCRE_ERROR_RETURN; + } +#endif + + /* \P and \p are for Unicode properties, but only when the support has + been compiled. Each item needs 2 bytes. */ + + else if (-c == ESC_P || -c == ESC_p) + { +#ifdef SUPPORT_UCP + BOOL negated; + length += 2; + lastitemlength = 2; + if (get_ucp(&ptr, &negated, &errorcode) < 0) goto PCRE_ERROR_RETURN; + continue; +#else + errorcode = ERR45; + goto PCRE_ERROR_RETURN; +#endif + } + + /* Other escapes need one byte */ + + length++; + + /* A back reference needs an additional 2 bytes, plus either one or 5 + bytes for a repeat. We also need to keep the value of the highest + back reference. */ + + if (c <= -ESC_REF) + { + int refnum = -c - ESC_REF; + compile_block.backref_map |= (refnum < 32)? (1 << refnum) : 1; + if (refnum > compile_block.top_backref) + compile_block.top_backref = refnum; + length += 2; /* For single back reference */ + if (ptr[1] == '{' && is_counted_repeat(ptr+2)) + { + ptr = read_repeat_counts(ptr+2, &min, &max, &errorcode); + if (errorcode != 0) goto PCRE_ERROR_RETURN; + if ((min == 0 && (max == 1 || max == -1)) || + (min == 1 && max == -1)) + length++; + else length += 5; + if (ptr[1] == '?') ptr++; + } + } + continue; + + case '^': /* Single-byte metacharacters */ + case '.': + case '$': + length++; + lastitemlength = 1; + continue; + + case '*': /* These repeats won't be after brackets; */ + case '+': /* those are handled separately */ + case '?': + length++; + goto POSESSIVE; /* A few lines below */ + + /* This covers the cases of braced repeats after a single char, metachar, + class, or back reference. */ + + case '{': + if (!is_counted_repeat(ptr+1)) goto NORMAL_CHAR; + ptr = read_repeat_counts(ptr+1, &min, &max, &errorcode); + if (errorcode != 0) goto PCRE_ERROR_RETURN; + + /* These special cases just insert one extra opcode */ + + if ((min == 0 && (max == 1 || max == -1)) || + (min == 1 && max == -1)) + length++; + + /* These cases might insert additional copies of a preceding character. */ + + else + { + if (min != 1) + { + length -= lastitemlength; /* Uncount the original char or metachar */ + if (min > 0) length += 3 + lastitemlength; + } + length += lastitemlength + ((max > 0)? 3 : 1); + } + + if (ptr[1] == '?') ptr++; /* Needs no extra length */ + + POSESSIVE: /* Test for possessive quantifier */ + if (ptr[1] == '+') + { + ptr++; + length += 2 + 2*LINK_SIZE; /* Allow for atomic brackets */ + } + continue; + + /* An alternation contains an offset to the next branch or ket. If any ims + options changed in the previous branch(es), and/or if we are in a + lookbehind assertion, extra space will be needed at the start of the + branch. This is handled by branch_extra. */ + + case '|': + length += 1 + LINK_SIZE + branch_extra; + continue; + + /* A character class uses 33 characters provided that all the character + values are less than 256. Otherwise, it uses a bit map for low valued + characters, and individual items for others. Don't worry about character + types that aren't allowed in classes - they'll get picked up during the + compile. A character class that contains only one single-byte character + uses 2 or 3 bytes, depending on whether it is negated or not. Notice this + where we can. (In UTF-8 mode we can do this only for chars < 128.) */ + + case '[': + if (*(++ptr) == '^') + { + class_optcount = 10; /* Greater than one */ + ptr++; + } + else class_optcount = 0; + +#ifdef SUPPORT_UTF8 + class_utf8 = FALSE; +#endif + + /* Written as a "do" so that an initial ']' is taken as data */ + /* cn: due to bug http://flashqa.macromedia.com/bugapp/detail.asp?ID=110290 + / we need to treat an initial ] as the end of the expression. fwiw, Spidermonkey + / nor ECMAScript doesn't support []] either. */ + + if (*ptr == ']') + { + class_optcount = 1; // [^] is treated like [^]. where is character value 0. + } // cn: end of added code just past the else + else if (*ptr != 0) do + { + /* Inside \Q...\E everything is literal except \E */ + + if (inescq) + { + if (*ptr != '\\' || ptr[1] != 'E') goto GET_ONE_CHARACTER; + inescq = FALSE; + ptr += 1; + continue; + } + + /* Outside \Q...\E, check for escapes */ + + if (*ptr == '\\') + { + c = check_escape(&ptr, &errorcode, bracount, options, TRUE); + if (errorcode != 0) goto PCRE_ERROR_RETURN; + + /* \b is backspace inside a class; \X is literal */ + + if (-c == ESC_b) c = '\b'; + else if (-c == ESC_X) c = 'X'; + + /* \Q enters quoting mode */ + + else if (-c == ESC_Q) + { + inescq = TRUE; + continue; + } + + /* Handle escapes that turn into characters */ + + if (c >= 0) goto NON_SPECIAL_CHARACTER; + + /* Escapes that are meta-things. The normal ones just affect the + bit map, but Unicode properties require an XCLASS extended item. */ + + else + { + class_optcount = 10; /* \d, \s etc; make sure > 1 */ +#ifdef SUPPORT_UTF8 + if (-c == ESC_p || -c == ESC_P) + { + if (!class_utf8) + { + class_utf8 = TRUE; + length += LINK_SIZE + 2; + } + length += 2; + } +#endif + } + } + + /* Check the syntax for POSIX stuff. The bits we actually handle are + checked during the real compile phase. */ + + else if (*ptr == '[' && check_posix_syntax(ptr, &ptr, &compile_block)) + { + ptr++; + class_optcount = 10; /* Make sure > 1 */ + } + + /* Anything else increments the possible optimization count. We have to + detect ranges here so that we can compute the number of extra ranges for + caseless wide characters when UCP support is available. If there are wide + characters, we are going to have to use an XCLASS, even for single + characters. */ + + else + { + int d; + + GET_ONE_CHARACTER: + +#ifdef SUPPORT_UTF8 + if (utf8) + { + int extra = 0; + GETCHARLEN(c, ptr, extra); + ptr += extra; + } + else c = *ptr; +#else + c = *ptr; +#endif + + /* Come here from handling \ above when it escapes to a char value */ + + NON_SPECIAL_CHARACTER: + class_optcount++; + + d = -1; + if (ptr[1] == '-') + { + uschar const *hyptr = ptr++; + if (ptr[1] == '\\') + { + ptr++; + d = check_escape(&ptr, &errorcode, bracount, options, TRUE); + if (errorcode != 0) goto PCRE_ERROR_RETURN; + if (-d == ESC_b) d = '\b'; /* backspace */ + else if (-d == ESC_X) d = 'X'; /* literal X in a class */ + } + else if (ptr[1] != 0 && ptr[1] != ']') + { + ptr++; +#ifdef SUPPORT_UTF8 + if (utf8) + { + int extra = 0; + GETCHARLEN(d, ptr, extra); + ptr += extra; + } + else +#endif + d = *ptr; + } + if (d < 0) ptr = hyptr; /* go back to hyphen as data */ + } + + /* If d >= 0 we have a range. In UTF-8 mode, if the end is > 255, or > + 127 for caseless matching, we will need to use an XCLASS. */ + + if (d >= 0) + { + class_optcount = 10; /* Ensure > 1 */ + if (d < c) + { + errorcode = ERR8; + goto PCRE_ERROR_RETURN; + } + +#ifdef SUPPORT_UTF8 + if (utf8 && (d > 255 || ((options & PCRE_CASELESS) != 0 && d > 127))) + { + uschar buffer[6]; + if (!class_utf8) /* Allow for XCLASS overhead */ + { + class_utf8 = TRUE; + length += LINK_SIZE + 2; + } + +#ifdef SUPPORT_UCP + /* If we have UCP support, find out how many extra ranges are + needed to map the other case of characters within this range. We + have to mimic the range optimization here, because extending the + range upwards might push d over a boundary that makes is use + another byte in the UTF-8 representation. */ + + if ((options & PCRE_CASELESS) != 0) + { + int occ, ocd; + int cc = c; + int origd = d; + while (get_othercase_range(&cc, origd, &occ, &ocd)) + { + if (occ >= c && ocd <= d) continue; /* Skip embedded */ + + if (occ < c && ocd >= c - 1) /* Extend the basic range */ + { /* if there is overlap, */ + c = occ; /* noting that if occ < c */ + continue; /* we can't have ocd > d */ + } /* because a subrange is */ + if (ocd > d && occ <= d + 1) /* always shorter than */ + { /* the basic range. */ + d = ocd; + continue; + } + + /* An extra item is needed */ + + length += 1 + _pcre_ord2utf8(occ, buffer) + + ((occ == ocd)? 0 : _pcre_ord2utf8(ocd, buffer)); + } + } +#endif /* SUPPORT_UCP */ + + /* The length of the (possibly extended) range */ + + length += 1 + _pcre_ord2utf8(c, buffer) + _pcre_ord2utf8(d, buffer); + } +#endif /* SUPPORT_UTF8 */ + + } + + /* We have a single character. There is nothing to be done unless we + are in UTF-8 mode. If the char is > 255, or 127 when caseless, we must + allow for an XCL_SINGLE item, doubled for caselessness if there is UCP + support. */ + + else + { +#ifdef SUPPORT_UTF8 + if (utf8 && (c > 255 || ((options & PCRE_CASELESS) != 0 && c > 127))) + { + uschar buffer[6]; + class_optcount = 10; /* Ensure > 1 */ + if (!class_utf8) /* Allow for XCLASS overhead */ + { + class_utf8 = TRUE; + length += LINK_SIZE + 2; + } +#ifdef SUPPORT_UCP + length += (((options & PCRE_CASELESS) != 0)? 2 : 1) * + (1 + _pcre_ord2utf8(c, buffer)); +#else /* SUPPORT_UCP */ + length += 1 + _pcre_ord2utf8(c, buffer); +#endif /* SUPPORT_UCP */ + } +#endif /* SUPPORT_UTF8 */ + } + } + } + while (*(++ptr) != 0 && (inescq || *ptr != ']')); /* Concludes "do" above */ + + if (*ptr == 0) /* Missing terminating ']' */ + { + errorcode = ERR6; + goto PCRE_ERROR_RETURN; + } + + /* We can optimize when there was only one optimizable character. Repeats + for positive and negated single one-byte chars are handled by the general + code. Here, we handle repeats for the class opcodes. */ + + if (class_optcount == 1) length += 3; else + { + length += 33; + + /* A repeat needs either 1 or 5 bytes. If it is a possessive quantifier, + we also need extra for wrapping the whole thing in a sub-pattern. */ + + if (*ptr != 0 && ptr[1] == '{' && is_counted_repeat(ptr+2)) + { + ptr = read_repeat_counts(ptr+2, &min, &max, &errorcode); + if (errorcode != 0) goto PCRE_ERROR_RETURN; + if ((min == 0 && (max == 1 || max == -1)) || + (min == 1 && max == -1)) + length++; + else length += 5; + if (ptr[1] == '+') + { + ptr++; + length += 2 + 2*LINK_SIZE; + } + else if (ptr[1] == '?') ptr++; + } + } + continue; + + /* Brackets may be genuine groups or special things */ + + case '(': + branch_newextra = 0; + bracket_length = 1 + LINK_SIZE; + capturing = FALSE; + + /* Handle special forms of bracket, which all start (? */ + + if (ptr[1] == '?') + { + int set, unset; + int *optset; + + switch (c = ptr[2]) + { + /* Skip over comments entirely */ + case '#': + ptr += 3; + while (*ptr != 0 && *ptr != ')') ptr++; + if (*ptr == 0) + { + errorcode = ERR18; + goto PCRE_ERROR_RETURN; + } + continue; + + /* Non-referencing groups and lookaheads just move the pointer on, and + then behave like a non-special bracket, except that they don't increment + the count of extracting brackets. Ditto for the "once only" bracket, + which is in Perl from version 5.005. */ + + case ':': + case '=': + case '!': + case '>': + ptr += 2; + break; + + /* (?R) specifies a recursive call to the regex, which is an extension + to provide the facility which can be obtained by (?p{perl-code}) in + Perl 5.6. In Perl 5.8 this has become (??{perl-code}). + + From PCRE 4.00, items such as (?3) specify subroutine-like "calls" to + the appropriate numbered brackets. This includes both recursive and + non-recursive calls. (?R) is now synonymous with (?0). */ + + case 'R': + ptr++; + + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + ptr += 2; + if (c != 'R') + while ((digitab[*(++ptr)] & ctype_digit) != 0){ /*nothing*/ } + if (*ptr != ')') + { + errorcode = ERR29; + goto PCRE_ERROR_RETURN; + } + length += 1 + LINK_SIZE; + + /* If this item is quantified, it will get wrapped inside brackets so + as to use the code for quantified brackets. We jump down and use the + code that handles this for real brackets. */ + + if (ptr[1] == '+' || ptr[1] == '*' || ptr[1] == '?' || ptr[1] == '{') + { + length += 2 + 2 * LINK_SIZE; /* to make bracketed */ + duplength = 5 + 3 * LINK_SIZE; + goto HANDLE_QUANTIFIED_BRACKETS; + } + continue; + + /* (?C) is an extension which provides "callout" - to provide a bit of + the functionality of the Perl (?{...}) feature. An optional number may + follow (default is zero). */ + + case 'C': + ptr += 2; + while ((digitab[*(++ptr)] & ctype_digit) != 0){ /*nothing*/ } + if (*ptr != ')') + { + errorcode = ERR39; + goto PCRE_ERROR_RETURN; + } + length += 2 + 2*LINK_SIZE; + continue; + + /* Named subpatterns are an extension copied from Python */ + + case 'P': + ptr += 3; + + /* Handle the definition of a named subpattern */ + + if (*ptr == '<') + { + const uschar *p; /* Don't amalgamate; some compilers */ + p = ++ptr; /* grumble at autoincrement in declaration */ + while ((compile_block.ctypes[*ptr] & ctype_word) != 0) ptr++; + if (*ptr != '>') + { + errorcode = ERR42; + goto PCRE_ERROR_RETURN; + } + name_count++; + if (ptr - p > max_name_size) max_name_size = (ptr - p); + capturing = TRUE; /* Named parentheses are always capturing */ + break; + } + + /* Handle back references and recursive calls to named subpatterns */ + + if (*ptr == '=' || *ptr == '>') + { + while ((compile_block.ctypes[*(++ptr)] & ctype_word) != 0){ /*nothing*/ } + if (*ptr != ')') + { + errorcode = ERR42; + goto PCRE_ERROR_RETURN; + } + break; + } + + /* Unknown character after (?P */ + + errorcode = ERR41; + goto PCRE_ERROR_RETURN; + + /* Lookbehinds are in Perl from version 5.005 */ + + case '<': + ptr += 3; + if (*ptr == '=' || *ptr == '!') + { + branch_newextra = 1 + LINK_SIZE; + length += 1 + LINK_SIZE; /* For the first branch */ + break; + } + errorcode = ERR24; + goto PCRE_ERROR_RETURN; + + /* Conditionals are in Perl from version 5.005. The bracket must either + be followed by a number (for bracket reference) or by an assertion + group, or (a PCRE extension) by 'R' for a recursion test. */ + + case '(': + if (ptr[3] == 'R' && ptr[4] == ')') + { + ptr += 4; + length += 3; + } + else if ((digitab[ptr[3]] & ctype_digit) != 0) + { + ptr += 4; + length += 3; + while ((digitab[*ptr] & ctype_digit) != 0) ptr++; + if (*ptr != ')') + { + errorcode = ERR26; + goto PCRE_ERROR_RETURN; + } + } + else /* An assertion must follow */ + { + ptr++; /* Can treat like ':' as far as spacing is concerned */ + if (ptr[2] != '?' || + (ptr[3] != '=' && ptr[3] != '!' && ptr[3] != '<') ) + { + ptr += 2; /* To get right offset in message */ + errorcode = ERR28; + goto PCRE_ERROR_RETURN; + } + } + break; + + /* Else loop checking valid options until ) is met. Anything else is an + error. If we are without any brackets, i.e. at top level, the settings + act as if specified in the options, so massage the options immediately. + This is for backward compatibility with Perl 5.004. */ + + default: + set = unset = 0; + optset = &set; + ptr += 2; + + for (;; ptr++) + { + c = *ptr; + switch (c) + { + case 'i': + *optset |= PCRE_CASELESS; + continue; + + case 'm': + *optset |= PCRE_MULTILINE; + continue; + + case 's': + *optset |= PCRE_DOTALL; + continue; + + case 'x': + *optset |= PCRE_EXTENDED; + continue; + + case 'X': + *optset |= PCRE_EXTRA; + continue; + + case 'U': + *optset |= PCRE_UNGREEDY; + continue; + + case '-': + optset = &unset; + continue; + + /* A termination by ')' indicates an options-setting-only item; if + this is at the very start of the pattern (indicated by item_count + being zero), we use it to set the global options. This is helpful + when analyzing the pattern for first characters, etc. Otherwise + nothing is done here and it is handled during the compiling + process. + + We allow for more than one options setting at the start. If such + settings do not change the existing options, nothing is compiled. + However, we must leave space just in case something is compiled. + This can happen for pathological sequences such as (?i)(?-i) + because the global options will end up with -i set. The space is + small and not significant. (Before I did this there was a reported + bug with (?i)(?-i) in a machine-generated pattern.) + + [Historical note: Up to Perl 5.8, options settings at top level + were always global settings, wherever they appeared in the pattern. + That is, they were equivalent to an external setting. From 5.8 + onwards, they apply only to what follows (which is what you might + expect).] */ + + case ')': + if (item_count == 0) + { + options = (options | set) & (~unset); + set = unset = 0; /* To save length */ + item_count--; /* To allow for several */ + length += 2; + } + + /* Fall through */ + + /* A termination by ':' indicates the start of a nested group with + the given options set. This is again handled at compile time, but + we must allow for compiled space if any of the ims options are + set. We also have to allow for resetting space at the end of + the group, which is why 4 is added to the length and not just 2. + If there are several changes of options within the same group, this + will lead to an over-estimate on the length, but this shouldn't + matter very much. We also have to allow for resetting options at + the start of any alternations, which we do by setting + branch_newextra to 2. Finally, we record whether the case-dependent + flag ever changes within the regex. This is used by the "required + character" code. */ + + case ':': + if (((set|unset) & PCRE_IMS) != 0) + { + length += 4; + branch_newextra = 2; + if (((set|unset) & PCRE_CASELESS) != 0) options |= PCRE_ICHANGED; + } + goto END_OPTIONS; + + /* Unrecognized option character */ + + default: + errorcode = ERR12; + goto PCRE_ERROR_RETURN; + } + } + + /* If we hit a closing bracket, that's it - this is a freestanding + option-setting. We need to ensure that branch_extra is updated if + necessary. The only values branch_newextra can have here are 0 or 2. + If the value is 2, then branch_extra must either be 2 or 5, depending + on whether this is a lookbehind group or not. */ + + END_OPTIONS: + if (c == ')') + { + if (branch_newextra == 2 && + (branch_extra == 0 || branch_extra == 1+LINK_SIZE)) + branch_extra += branch_newextra; + continue; + } + + /* If options were terminated by ':' control comes here. This is a + non-capturing group with an options change. There is nothing more that + needs to be done because "capturing" is already set FALSE by default; + we can just fall through. */ + + } + } + + /* Ordinary parentheses, not followed by '?', are capturing unless + PCRE_NO_AUTO_CAPTURE is set. */ + + else capturing = (options & PCRE_NO_AUTO_CAPTURE) == 0; + + /* Capturing brackets must be counted so we can process escapes in a + Perlish way. If the number exceeds EXTRACT_BASIC_MAX we are going to need + an additional 3 bytes of memory per capturing bracket. */ + + if (capturing) + { + bracount++; + if (bracount > EXTRACT_BASIC_MAX) bracket_length += 3; + } + + /* Save length for computing whole length at end if there's a repeat that + requires duplication of the group. Also save the current value of + branch_extra, and start the new group with the new value. If non-zero, this + will either be 2 for a (?imsx: group, or 3 for a lookbehind assertion. */ + + if (brastackptr >= sizeof(brastack)/sizeof(int)) + { + errorcode = ERR19; + goto PCRE_ERROR_RETURN; + } + + bralenstack[brastackptr] = branch_extra; + branch_extra = branch_newextra; + + brastack[brastackptr++] = length; + length += bracket_length; + continue; + + /* Handle ket. Look for subsequent max/min; for certain sets of values we + have to replicate this bracket up to that many times. If brastackptr is + 0 this is an unmatched bracket which will generate an error, but take care + not to try to access brastack[-1] when computing the length and restoring + the branch_extra value. */ + + case ')': + length += 1 + LINK_SIZE; + if (brastackptr > 0) + { + duplength = length - brastack[--brastackptr]; + branch_extra = bralenstack[brastackptr]; + } + else duplength = 0; + + /* The following code is also used when a recursion such as (?3) is + followed by a quantifier, because in that case, it has to be wrapped inside + brackets so that the quantifier works. The value of duplength must be + set before arrival. */ + + HANDLE_QUANTIFIED_BRACKETS: + + /* Leave ptr at the final char; for read_repeat_counts this happens + automatically; for the others we need an increment. */ + + if ((c = ptr[1]) == '{' && is_counted_repeat(ptr+2)) + { + ptr = read_repeat_counts(ptr+2, &min, &max, &errorcode); + if (errorcode != 0) goto PCRE_ERROR_RETURN; + } + else if (c == '*') { min = 0; max = -1; ptr++; } + else if (c == '+') { min = 1; max = -1; ptr++; } + else if (c == '?') { min = 0; max = 1; ptr++; } + else { min = 1; max = 1; } + + /* If the minimum is zero, we have to allow for an OP_BRAZERO before the + group, and if the maximum is greater than zero, we have to replicate + maxval-1 times; each replication acquires an OP_BRAZERO plus a nesting + bracket set. */ + + if (min == 0) + { + length++; + if (max > 0) length += (max - 1) * (duplength + 3 + 2*LINK_SIZE); + } + + /* When the minimum is greater than zero, we have to replicate up to + minval-1 times, with no additions required in the copies. Then, if there + is a limited maximum we have to replicate up to maxval-1 times allowing + for a BRAZERO item before each optional copy and nesting brackets for all + but one of the optional copies. */ + + else + { + length += (min - 1) * duplength; + if (max > min) /* Need this test as max=-1 means no limit */ + length += (max - min) * (duplength + 3 + 2*LINK_SIZE) + - (2 + 2*LINK_SIZE); + } + + /* Allow space for once brackets for "possessive quantifier" */ + + if (ptr[1] == '+') + { + ptr++; + length += 2 + 2*LINK_SIZE; + } + continue; + + /* Non-special character. It won't be space or # in extended mode, so it is + always a genuine character. If we are in a \Q...\E sequence, check for the + end; if not, we have a literal. */ + + default: + NORMAL_CHAR: + + if (inescq && c == '\\' && ptr[1] == 'E') + { + inescq = FALSE; + ptr++; + continue; + } + + length += 2; /* For a one-byte character */ + lastitemlength = 1; /* Default length of last item for repeats */ + + /* In UTF-8 mode, check for additional bytes. */ + +#ifdef SUPPORT_UTF8 + if (utf8 && (c & 0xc0) == 0xc0) + { + while ((ptr[1] & 0xc0) == 0x80) /* Can't flow over the end */ + { /* because the end is marked */ + lastitemlength++; /* by a zero byte. */ + length++; + ptr++; + } + } +#endif + + continue; + } + } + +length += 2 + LINK_SIZE; /* For final KET and END */ + +if ((options & PCRE_AUTO_CALLOUT) != 0) + length += 2 + 2*LINK_SIZE; /* For final callout */ + +if (length > MAX_PATTERN_SIZE) + { + errorcode = ERR20; + goto PCRE_EARLY_ERROR_RETURN; + } + +/* Compute the size of data block needed and get it, either from malloc or +externally provided function. */ + +size = length + sizeof(real_pcre) + name_count * (max_name_size + 3); +re = (real_pcre *)(pcre_malloc)(size); + +if (re == NULL) + { + errorcode = ERR21; + goto PCRE_EARLY_ERROR_RETURN; + } + +/* Put in the magic number, and save the sizes, options, and character table +pointer. NULL is used for the default character tables. The nullpad field is at +the end; it's there to help in the case when a regex compiled on a system with +4-byte pointers is run on another with 8-byte pointers. */ + +re->magic_number = MAGIC_NUMBER; +re->size = size; +re->options = options; +re->dummy1 = 0; +re->name_table_offset = sizeof(real_pcre); +re->name_entry_size = max_name_size + 3; +re->name_count = name_count; +re->ref_count = 0; +re->tables = (tables == _pcre_default_tables)? NULL : tables; +re->nullpad = NULL; + +/* The starting points of the name/number translation table and of the code are +passed around in the compile data block. */ + +compile_block.names_found = 0; +compile_block.name_entry_size = max_name_size + 3; +compile_block.name_table = (uschar *)re + re->name_table_offset; +codestart = compile_block.name_table + re->name_entry_size * re->name_count; +compile_block.start_code = codestart; +compile_block.start_pattern = (const uschar *)pattern; +compile_block.req_varyopt = 0; +compile_block.nopartial = FALSE; + +/* Set up a starting, non-extracting bracket, then compile the expression. On +error, errorcode will be set non-zero, so we don't need to look at the result +of the function here. */ + +ptr = (const uschar *)pattern; +code = (uschar *)codestart; +*code = OP_BRA; +bracount = 0; +(void)compile_regex(options, options & PCRE_IMS, &bracount, &code, &ptr, + &errorcode, FALSE, 0, &firstbyte, &reqbyte, NULL, &compile_block); +re->top_bracket = bracount; +re->top_backref = compile_block.top_backref; + +if (compile_block.nopartial) re->options |= PCRE_NOPARTIAL; + +/* If not reached end of pattern on success, there's an excess bracket. */ + +if (errorcode == 0 && *ptr != 0) errorcode = ERR22; + +/* Fill in the terminating state and check for disastrous overflow, but +if debugging, leave the test till after things are printed out. */ + +*code++ = OP_END; + +#ifndef DEBUG +if (code - codestart > length) errorcode = ERR23; +#endif + +/* Give an error if there's back reference to a non-existent capturing +subpattern. */ + +if (re->top_backref > re->top_bracket) errorcode = ERR15; + +/* Failed to compile, or error while post-processing */ + +if (errorcode != 0) + { + (pcre_free)(re); + PCRE_ERROR_RETURN: + *erroroffset = ptr - (const uschar *)pattern; + PCRE_EARLY_ERROR_RETURN: + *errorptr = error_texts[errorcode]; + if (errorcodeptr != NULL) *errorcodeptr = errorcode; + return NULL; + } + +/* If the anchored option was not passed, set the flag if we can determine that +the pattern is anchored by virtue of ^ characters or \A or anything else (such +as starting with .* when DOTALL is set). + +Otherwise, if we know what the first character has to be, save it, because that +speeds up unanchored matches no end. If not, see if we can set the +PCRE_STARTLINE flag. This is helpful for multiline matches when all branches +start with ^. and also when all branches start with .* for non-DOTALL matches. +*/ + +if ((options & PCRE_ANCHORED) == 0) + { + int temp_options = options; + if (is_anchored(codestart, &temp_options, 0, compile_block.backref_map)) + re->options |= PCRE_ANCHORED; + else + { + if (firstbyte < 0) + firstbyte = find_firstassertedchar(codestart, &temp_options, FALSE); + if (firstbyte >= 0) /* Remove caseless flag for non-caseable chars */ + { + int ch = firstbyte & 255; + re->first_byte = ((firstbyte & REQ_CASELESS) != 0 && + compile_block.fcc[ch] == ch)? ch : firstbyte; + re->options |= PCRE_FIRSTSET; + } + else if (is_startline(codestart, 0, compile_block.backref_map)) + re->options |= PCRE_STARTLINE; + } + } + +/* For an anchored pattern, we use the "required byte" only if it follows a +variable length item in the regex. Remove the caseless flag for non-caseable +bytes. */ + +if (reqbyte >= 0 && + ((re->options & PCRE_ANCHORED) == 0 || (reqbyte & REQ_VARY) != 0)) + { + int ch = reqbyte & 255; + re->req_byte = ((reqbyte & REQ_CASELESS) != 0 && + compile_block.fcc[ch] == ch)? (reqbyte & ~REQ_CASELESS) : reqbyte; + re->options |= PCRE_REQCHSET; + } + +/* Print out the compiled data if debugging is enabled. This is never the +case when building a production library. */ + +#ifdef DEBUG + +printf("Length = %d top_bracket = %d top_backref = %d\n", + length, re->top_bracket, re->top_backref); + +if (re->options != 0) + { + printf("%s%s%s%s%s%s%s%s%s%s\n", + ((re->options & PCRE_NOPARTIAL) != 0)? "nopartial " : "", + ((re->options & PCRE_ANCHORED) != 0)? "anchored " : "", + ((re->options & PCRE_CASELESS) != 0)? "caseless " : "", + ((re->options & PCRE_ICHANGED) != 0)? "case state changed " : "", + ((re->options & PCRE_EXTENDED) != 0)? "extended " : "", + ((re->options & PCRE_MULTILINE) != 0)? "multiline " : "", + ((re->options & PCRE_DOTALL) != 0)? "dotall " : "", + ((re->options & PCRE_DOLLAR_ENDONLY) != 0)? "endonly " : "", + ((re->options & PCRE_EXTRA) != 0)? "extra " : "", + ((re->options & PCRE_UNGREEDY) != 0)? "ungreedy " : ""); + } + +if ((re->options & PCRE_FIRSTSET) != 0) + { + int ch = re->first_byte & 255; + const char *caseless = ((re->first_byte & REQ_CASELESS) == 0)? "" : " (caseless)"; + if (isprint(ch)) printf("First char = %c%s\n", ch, caseless); + else printf("First char = \\x%02x%s\n", ch, caseless); + } + +if ((re->options & PCRE_REQCHSET) != 0) + { + int ch = re->req_byte & 255; + const char *caseless = ((re->req_byte & REQ_CASELESS) == 0)? "" : " (caseless)"; + if (isprint(ch)) printf("Req char = %c%s\n", ch, caseless); + else printf("Req char = \\x%02x%s\n", ch, caseless); + } + +pcre_printint(re, stdout); + +/* This check is done here in the debugging case so that the code that +was compiled can be seen. */ + +if (code - codestart > length) + { + (pcre_free)(re); + *errorptr = error_texts[ERR23]; + *erroroffset = ptr - (uschar *)pattern; + if (errorcodeptr != NULL) *errorcodeptr = ERR23; + return NULL; + } +#endif + +return (pcre *)re; +} + +/* End of pcre_compile.c */ diff --git a/mozilla/js/tamarin/pcre/pcre_config.cpp b/mozilla/js/tamarin/pcre/pcre_config.cpp new file mode 100644 index 00000000000..792aaf43c8b --- /dev/null +++ b/mozilla/js/tamarin/pcre/pcre_config.cpp @@ -0,0 +1,114 @@ +#include "avmplus.h" + +/************************************************* +* Perl-Compatible Regular Expressions * +*************************************************/ + +/* PCRE is a library of functions to support regular expressions whose syntax +and semantics are as close as possible to those of the Perl 5 language. + + Written by Philip Hazel + Copyright (c) 1997-2005 University of Cambridge + +----------------------------------------------------------------------------- +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + * Neither the name of the University of Cambridge nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +----------------------------------------------------------------------------- +*/ + + +/* This module contains the external function pcre_config(). */ + + +#include "pcre_internal.h" + + +/************************************************* +* Return info about what features are configured * +*************************************************/ + +/* This function has an extensible interface so that additional items can be +added compatibly. + +Arguments: + what what information is required + where where to put the information + +Returns: 0 if data returned, negative on error +*/ + +PCRE_EXPORT int +pcre_config(int what, void *where) +{ +switch (what) + { + case PCRE_CONFIG_UTF8: +#ifdef SUPPORT_UTF8 + *((int *)where) = 1; +#else + *((int *)where) = 0; +#endif + break; + + case PCRE_CONFIG_UNICODE_PROPERTIES: +#ifdef SUPPORT_UCP + *((int *)where) = 1; +#else + *((int *)where) = 0; +#endif + break; + + case PCRE_CONFIG_NEWLINE: + *((int *)where) = NEWLINE; + break; + + case PCRE_CONFIG_LINK_SIZE: + *((int *)where) = LINK_SIZE; + break; + + case PCRE_CONFIG_POSIX_MALLOC_THRESHOLD: + *((int *)where) = POSIX_MALLOC_THRESHOLD; + break; + + case PCRE_CONFIG_MATCH_LIMIT: + *((unsigned int *)where) = MATCH_LIMIT; + break; + + case PCRE_CONFIG_STACKRECURSE: +#ifdef NO_RECURSE + *((int *)where) = 0; +#else + *((int *)where) = 1; +#endif + break; + + default: return PCRE_ERROR_BADOPTION; + } + +return 0; +} + +/* End of pcre_config.c */ diff --git a/mozilla/js/tamarin/pcre/pcre_dfa_exec.cpp b/mozilla/js/tamarin/pcre/pcre_dfa_exec.cpp new file mode 100644 index 00000000000..c68f2329fe0 --- /dev/null +++ b/mozilla/js/tamarin/pcre/pcre_dfa_exec.cpp @@ -0,0 +1,1920 @@ +/************************************************* +* Perl-Compatible Regular Expressions * +*************************************************/ + +/* PCRE is a library of functions to support regular expressions whose syntax +and semantics are as close as possible to those of the Perl 5 language. + + Written by Philip Hazel + Copyright (c) 1997-2005 University of Cambridge + +----------------------------------------------------------------------------- +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + * Neither the name of the University of Cambridge nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +----------------------------------------------------------------------------- +*/ + + +/* This module contains the external function pcre_dfa_exec(), which is an +alternative matching function that uses a DFA algorithm. This is NOT Perl- +compatible, but it has advantages in certain applications. */ + + +#include "pcre_internal.h" + + +/* For use to indent debugging output */ + +#define SP " " + + + +/************************************************* +* Code parameters and static tables * +*************************************************/ + +/* These are offsets that are used to turn the OP_TYPESTAR and friends opcodes +into others, under special conditions. A gap of 10 between the blocks should be +enough. */ + +#define OP_PROP_EXTRA (EXTRACT_BASIC_MAX+1) +#define OP_EXTUNI_EXTRA (EXTRACT_BASIC_MAX+11) + + +/* This table identifies those opcodes that are followed immediately by a +character that is to be tested in some way. This makes is possible to +centralize the loading of these characters. In the case of Type * etc, the +"character" is the opcode for \D, \d, \S, \s, \W, or \w, which will always be a +small value. */ + +static uschar coptable[] = { + 0, /* End */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* \A, \G, \B, \b, \D, \d, \S, \s, \W, \w */ + 0, 0, /* Any, Anybyte */ + 0, 0, 0, /* NOTPROP, PROP, EXTUNI */ + 0, 0, 0, 0, 0, /* \Z, \z, Opt, ^, $ */ + 1, /* Char */ + 1, /* Charnc */ + 1, /* not */ + /* Positive single-char repeats */ + 1, 1, 1, 1, 1, 1, /* *, *?, +, +?, ?, ?? */ + 3, 3, 3, /* upto, minupto, exact */ + /* Negative single-char repeats - only for chars < 256 */ + 1, 1, 1, 1, 1, 1, /* NOT *, *?, +, +?, ?, ?? */ + 3, 3, 3, /* NOT upto, minupto, exact */ + /* Positive type repeats */ + 1, 1, 1, 1, 1, 1, /* Type *, *?, +, +?, ?, ?? */ + 3, 3, 3, /* Type upto, minupto, exact */ + /* Character class & ref repeats */ + 0, 0, 0, 0, 0, 0, /* *, *?, +, +?, ?, ?? */ + 0, 0, /* CRRANGE, CRMINRANGE */ + 0, /* CLASS */ + 0, /* NCLASS */ + 0, /* XCLASS - variable length */ + 0, /* REF */ + 0, /* RECURSE */ + 0, /* CALLOUT */ + 0, /* Alt */ + 0, /* Ket */ + 0, /* KetRmax */ + 0, /* KetRmin */ + 0, /* Assert */ + 0, /* Assert not */ + 0, /* Assert behind */ + 0, /* Assert behind not */ + 0, /* Reverse */ + 0, /* Once */ + 0, /* COND */ + 0, /* CREF */ + 0, 0, /* BRAZERO, BRAMINZERO */ + 0, /* BRANUMBER */ + 0 /* BRA */ +}; + +/* These 2 tables allow for compact code for testing for \D, \d, \S, \s, \W, +and \w */ + +static uschar toptable1[] = { + 0, 0, 0, 0, 0, + ctype_digit, ctype_digit, + ctype_space, ctype_space, + ctype_word, ctype_word, + 0 /* OP_ANY */ +}; + +static uschar toptable2[] = { + 0, 0, 0, 0, 0, + ctype_digit, 0, + ctype_space, 0, + ctype_word, 0, + 1 /* OP_ANY */ +}; + + +/* Structure for holding data about a particular state, which is in effect the +current data for an active path through the match tree. It must consist +entirely of ints because the working vector we are passed, and which we put +these structures in, is a vector of ints. */ + +typedef struct stateblock { + int offset; /* Offset to opcode */ + int count; /* Count for repeats */ + int ims; /* ims flag bits */ + int data; /* Some use extra data */ +} stateblock; + +#define INTS_PER_STATEBLOCK (sizeof(stateblock)/sizeof(int)) + + +#ifdef DEBUG +/************************************************* +* Print character string * +*************************************************/ + +/* Character string printing function for debugging. + +Arguments: + p points to string + length number of bytes + f where to print + +Returns: nothing +*/ + +static void +pchars(unsigned char *p, int length, FILE *f) +{ +int c; +while (length-- > 0) + { + if (isprint(c = *(p++))) + fprintf(f, "%c", c); + else + fprintf(f, "\\x%02x", c); + } +} +#endif + + + +/************************************************* +* Execute a Regular Expression - DFA engine * +*************************************************/ + +/* This internal function applies a compiled pattern to a subject string, +starting at a given point, using a DFA engine. This function is called from the +external one, possibly multiple times if the pattern is not anchored. The +function calls itself recursively for some kinds of subpattern. + +Arguments: + md the match_data block with fixed information + this_start_code the opening bracket of this subexpression's code + current_subject where we currently are in the subject string + start_offset start offset in the subject string + offsets vector to contain the matching string offsets + offsetcount size of same + workspace vector of workspace + wscount size of same + ims the current ims flags + rlevel function call recursion level + recursing regex recursive call level + +Returns: > 0 => + = 0 => + -1 => failed to match + < -1 => some kind of unexpected problem + +The following macros are used for adding states to the two state vectors (one +for the current character, one for the following character). */ + +#define ADD_ACTIVE(x,y) \ + if (active_count++ < wscount) \ + { \ + next_active_state->offset = (x); \ + next_active_state->count = (y); \ + next_active_state->ims = ims; \ + next_active_state++; \ + DPRINTF(("%.*sADD_ACTIVE(%d,%d)\n", rlevel*2-2, SP, (x), (y))); \ + } \ + else return PCRE_ERROR_DFA_WSSIZE + +#define ADD_ACTIVE_DATA(x,y,z) \ + if (active_count++ < wscount) \ + { \ + next_active_state->offset = (x); \ + next_active_state->count = (y); \ + next_active_state->ims = ims; \ + next_active_state->data = (z); \ + next_active_state++; \ + DPRINTF(("%.*sADD_ACTIVE_DATA(%d,%d,%d)\n", rlevel*2-2, SP, (x), (y), (z))); \ + } \ + else return PCRE_ERROR_DFA_WSSIZE + +#define ADD_NEW(x,y) \ + if (new_count++ < wscount) \ + { \ + next_new_state->offset = (x); \ + next_new_state->count = (y); \ + next_new_state->ims = ims; \ + next_new_state++; \ + DPRINTF(("%.*sADD_NEW(%d,%d)\n", rlevel*2-2, SP, (x), (y))); \ + } \ + else return PCRE_ERROR_DFA_WSSIZE + +#define ADD_NEW_DATA(x,y,z) \ + if (new_count++ < wscount) \ + { \ + next_new_state->offset = (x); \ + next_new_state->count = (y); \ + next_new_state->ims = ims; \ + next_new_state->data = (z); \ + next_new_state++; \ + DPRINTF(("%.*sADD_NEW_DATA(%d,%d,%d)\n", rlevel*2-2, SP, (x), (y), (z))); \ + } \ + else return PCRE_ERROR_DFA_WSSIZE + +/* And now, here is the code */ + +static int +internal_dfa_exec( + dfa_match_data *md, + const uschar *this_start_code, + const uschar *current_subject, + int start_offset, + int *offsets, + int offsetcount, + int *workspace, + int wscount, + int ims, + int rlevel, + int recursing) +{ +stateblock *active_states, *new_states, *temp_states; +stateblock *next_active_state, *next_new_state; + +const uschar *ctypes, *lcc, *fcc; +const uschar *ptr; +const uschar *end_code; + +int active_count, new_count, match_count; + +/* Some fields in the md block are frequently referenced, so we load them into +independent variables in the hope that this will perform better. */ + +const uschar *start_subject = md->start_subject; +const uschar *end_subject = md->end_subject; +const uschar *start_code = md->start_code; + +BOOL utf8 = (md->poptions & PCRE_UTF8) != 0; + +rlevel++; +offsetcount &= (-2); + +wscount -= 2; +wscount = (wscount - (wscount % (INTS_PER_STATEBLOCK * 2))) / + (2 * INTS_PER_STATEBLOCK); + +DPRINTF(("\n%.*s---------------------\n" + "%.*sCall to internal_dfa_exec f=%d r=%d\n", + rlevel*2-2, SP, rlevel*2-2, SP, rlevel, recursing)); + +ctypes = md->tables + ctypes_offset; +lcc = md->tables + lcc_offset; +fcc = md->tables + fcc_offset; + +match_count = PCRE_ERROR_NOMATCH; /* A negative number */ + +active_states = (stateblock *)(workspace + 2); +next_new_state = new_states = active_states + wscount; +new_count = 0; + +/* The first thing in any (sub) pattern is a bracket of some sort. Push all +the alternative states onto the list, and find out where the end is. This +makes is possible to use this function recursively, when we want to stop at a +matching internal ket rather than at the end. + +If the first opcode in the first alternative is OP_REVERSE, we are dealing with +a backward assertion. In that case, we have to find out the maximum amount to +move back, and set up each alternative appropriately. */ + +if (this_start_code[1+LINK_SIZE] == OP_REVERSE) + { + int max_back = 0; + int gone_back; + + end_code = this_start_code; + do + { + int back = GET(end_code, 2+LINK_SIZE); + if (back > max_back) max_back = back; + end_code += GET(end_code, 1); + } + while (*end_code == OP_ALT); + + /* If we can't go back the amount required for the longest lookbehind + pattern, go back as far as we can; some alternatives may still be viable. */ + +#ifdef SUPPORT_UTF8 + /* In character mode we have to step back character by character */ + + if (utf8) + { + for (gone_back = 0; gone_back < max_back; gone_back++) + { + if (current_subject <= start_subject) break; + current_subject--; + while (current_subject > start_subject && + (*current_subject & 0xc0) == 0x80) + current_subject--; + } + } + else +#endif + + /* In byte-mode we can do this quickly. */ + + { + gone_back = (current_subject - max_back < start_subject)? + current_subject - start_subject : max_back; + current_subject -= gone_back; + } + + /* Now we can process the individual branches. */ + + end_code = this_start_code; + do + { + int back = GET(end_code, 2+LINK_SIZE); + if (back <= gone_back) + { + int bstate = end_code - start_code + 2 + 2*LINK_SIZE; + ADD_NEW_DATA(-bstate, 0, gone_back - back); + } + end_code += GET(end_code, 1); + } + while (*end_code == OP_ALT); + } + +/* This is the code for a "normal" subpattern (not a backward assertion). The +start of a whole pattern is always one of these. If we are at the top level, +we may be asked to restart matching from the same point that we reached for a +previous partial match. We still have to scan through the top-level branches to +find the end state. */ + +else + { + end_code = this_start_code; + + /* Restarting */ + + if (rlevel == 1 && (md->moptions & PCRE_DFA_RESTART) != 0) + { + do { end_code += GET(end_code, 1); } while (*end_code == OP_ALT); + new_count = workspace[1]; + if (!workspace[0]) + memcpy(new_states, active_states, new_count * sizeof(stateblock)); + } + + /* Not restarting */ + + else + { + do + { + ADD_NEW(end_code - start_code + 1 + LINK_SIZE, 0); + end_code += GET(end_code, 1); + } + while (*end_code == OP_ALT); + } + } + +workspace[0] = 0; /* Bit indicating which vector is current */ + +DPRINTF(("%.*sEnd state = %d\n", rlevel*2-2, SP, end_code - start_code)); + +/* Loop for scanning the subject */ + +ptr = current_subject; +for (;;) + { + int i, j; + int c, d, clen, dlen; + + /* Make the new state list into the active state list and empty the + new state list. */ + + temp_states = active_states; + active_states = new_states; + new_states = temp_states; + active_count = new_count; + new_count = 0; + + workspace[0] ^= 1; /* Remember for the restarting feature */ + workspace[1] = active_count; + +#ifdef DEBUG + printf("%.*sNext character: rest of subject = \"", rlevel*2-2, SP); + pchars((uschar *)ptr, strlen((char *)ptr), stdout); + printf("\"\n"); + + printf("%.*sActive states: ", rlevel*2-2, SP); + for (i = 0; i < active_count; i++) + printf("%d/%d ", active_states[i].offset, active_states[i].count); + printf("\n"); +#endif + + /* Set the pointers for adding new states */ + + next_active_state = active_states + active_count; + next_new_state = new_states; + + /* Load the current character from the subject outside the loop, as many + different states may want to look at it, and we assume that at least one + will. */ + + if (ptr < end_subject) + { + clen = 1; +#ifdef SUPPORT_UTF8 + if (utf8) { GETCHARLEN(c, ptr, clen); } else +#endif /* SUPPORT_UTF8 */ + c = *ptr; + } + else + { + clen = 0; /* At end subject */ + c = -1; + } + + /* Scan up the active states and act on each one. The result of an action + may be to add more states to the currently active list (e.g. on hitting a + parenthesis) or it may be to put states on the new list, for considering + when we move the character pointer on. */ + + for (i = 0; i < active_count; i++) + { + stateblock *current_state = active_states + i; + const uschar *code; + int state_offset = current_state->offset; + int count, codevalue; + int chartype, othercase; + +#ifdef DEBUG + printf ("%.*sProcessing state %d c=", rlevel*2-2, SP, state_offset); + if (c < 0) printf("-1\n"); + else if (c > 32 && c < 127) printf("'%c'\n", c); + else printf("0x%02x\n", c); +#endif + + /* This variable is referred to implicity in the ADD_xxx macros. */ + + ims = current_state->ims; + + /* A negative offset is a special case meaning "hold off going to this + (negated) state until the number of characters in the data field have + been skipped". */ + + if (state_offset < 0) + { + if (current_state->data > 0) + { + DPRINTF(("%.*sSkipping this character\n", rlevel*2-2, SP)); + ADD_NEW_DATA(state_offset, current_state->count, + current_state->data - 1); + continue; + } + else + { + current_state->offset = state_offset = -state_offset; + } + } + + /* Check for a duplicate state with the same count, and skip if found. */ + + for (j = 0; j < i; j++) + { + if (active_states[j].offset == state_offset && + active_states[j].count == current_state->count) + { + DPRINTF(("%.*sDuplicate state: skipped\n", rlevel*2-2, SP)); + goto NEXT_ACTIVE_STATE; + } + } + + /* The state offset is the offset to the opcode */ + + code = start_code + state_offset; + codevalue = *code; + if (codevalue >= OP_BRA) codevalue = OP_BRA; /* All brackets are equal */ + + /* If this opcode is followed by an inline character, load it. It is + tempting to test for the presence of a subject character here, but that + is wrong, because sometimes zero repetitions of the subject are + permitted. + + We also use this mechanism for opcodes such as OP_TYPEPLUS that take an + argument that is not a data character - but is always one byte long. + Unfortunately, we have to take special action to deal with \P, \p, and + \X in this case. To keep the other cases fast, convert these ones to new + opcodes. */ + + if (coptable[codevalue] > 0) + { + dlen = 1; +#ifdef SUPPORT_UTF8 + if (utf8) { GETCHARLEN(d, (code + coptable[codevalue]), dlen); } else +#endif /* SUPPORT_UTF8 */ + d = code[coptable[codevalue]]; + if (codevalue >= OP_TYPESTAR) + { + if (d == OP_ANYBYTE) return PCRE_ERROR_DFA_UITEM; + if (d >= OP_NOTPROP) + codevalue += (d == OP_EXTUNI)? OP_EXTUNI_EXTRA : OP_PROP_EXTRA; + } + } + else + { + dlen = 0; /* Not strictly necessary, but compilers moan */ + d = -1; /* if these variables are not set. */ + } + + + /* Now process the individual opcodes */ + + switch (codevalue) + { + +/* ========================================================================== */ + /* Reached a closing bracket. If not at the end of the pattern, carry + on with the next opcode. Otherwise, unless we have an empty string and + PCRE_NOTEMPTY is set, save the match data, shifting up all previous + matches so we always have the longest first. */ + + case OP_KET: + case OP_KETRMIN: + case OP_KETRMAX: + if (code != end_code) + { + ADD_ACTIVE(state_offset + 1 + LINK_SIZE, 0); + if (codevalue != OP_KET) + { + ADD_ACTIVE(state_offset - GET(code, 1), 0); + } + } + else if (ptr > current_subject || (md->moptions & PCRE_NOTEMPTY) == 0) + { + if (match_count < 0) match_count = (offsetcount >= 2)? 1 : 0; + else if (match_count > 0 && ++match_count * 2 >= offsetcount) + match_count = 0; + count = ((match_count == 0)? offsetcount : match_count * 2) - 2; + if (count > 0) memmove(offsets + 2, offsets, count * sizeof(int)); + if (offsetcount >= 2) + { + offsets[0] = current_subject - start_subject; + offsets[1] = ptr - start_subject; + DPRINTF(("%.*sSet matched string = \"%.*s\"\n", rlevel*2-2, SP, + offsets[1] - offsets[0], current_subject)); + } + if ((md->moptions & PCRE_DFA_SHORTEST) != 0) + { + DPRINTF(("%.*sEnd of internal_dfa_exec %d: returning %d\n" + "%.*s---------------------\n\n", rlevel*2-2, SP, rlevel, + match_count, rlevel*2-2, SP)); + return match_count; + } + } + break; + +/* ========================================================================== */ + /* These opcodes add to the current list of states without looking + at the current character. */ + + /*-----------------------------------------------------------------*/ + case OP_ALT: + do { code += GET(code, 1); } while (*code == OP_ALT); + ADD_ACTIVE(code - start_code, 0); + break; + + /*-----------------------------------------------------------------*/ + case OP_BRA: + do + { + ADD_ACTIVE(code - start_code + 1 + LINK_SIZE, 0); + code += GET(code, 1); + } + while (*code == OP_ALT); + break; + + /*-----------------------------------------------------------------*/ + case OP_BRAZERO: + case OP_BRAMINZERO: + ADD_ACTIVE(state_offset + 1, 0); + code += 1 + GET(code, 2); + while (*code == OP_ALT) code += GET(code, 1); + ADD_ACTIVE(code - start_code + 1 + LINK_SIZE, 0); + break; + + /*-----------------------------------------------------------------*/ + case OP_BRANUMBER: + ADD_ACTIVE(state_offset + 1 + LINK_SIZE, 0); + break; + + /*-----------------------------------------------------------------*/ + case OP_CIRC: + if ((ptr == start_subject && (md->moptions & PCRE_NOTBOL) == 0) || + ((ims & PCRE_MULTILINE) != 0 && ptr[-1] == NEWLINE)) + { ADD_ACTIVE(state_offset + 1, 0); } + break; + + /*-----------------------------------------------------------------*/ + case OP_EOD: + if (ptr >= end_subject) { ADD_ACTIVE(state_offset + 1, 0); } + break; + + /*-----------------------------------------------------------------*/ + case OP_OPT: + ims = code[1]; + ADD_ACTIVE(state_offset + 2, 0); + break; + + /*-----------------------------------------------------------------*/ + case OP_SOD: + if (ptr == start_subject) { ADD_ACTIVE(state_offset + 1, 0); } + break; + + /*-----------------------------------------------------------------*/ + case OP_SOM: + if (ptr == start_subject + start_offset) { ADD_ACTIVE(state_offset + 1, 0); } + break; + + +/* ========================================================================== */ + /* These opcodes inspect the next subject character, and sometimes + the previous one as well, but do not have an argument. The variable + clen contains the length of the current character and is zero if we are + at the end of the subject. */ + + /*-----------------------------------------------------------------*/ + case OP_ANY: + if (clen > 0 && (c != NEWLINE || (ims & PCRE_DOTALL) != 0)) + { ADD_NEW(state_offset + 1, 0); } + break; + + /*-----------------------------------------------------------------*/ + case OP_EODN: + if (clen == 0 || (c == NEWLINE && ptr + 1 == end_subject)) + { ADD_ACTIVE(state_offset + 1, 0); } + break; + + /*-----------------------------------------------------------------*/ + case OP_DOLL: + if ((md->moptions & PCRE_NOTEOL) == 0) + { + if (clen == 0 || (c == NEWLINE && (ptr + 1 == end_subject || + (ims & PCRE_MULTILINE) != 0))) + { ADD_ACTIVE(state_offset + 1, 0); } + } + else if (c == NEWLINE && (ims & PCRE_MULTILINE) != 0) + { ADD_ACTIVE(state_offset + 1, 0); } + break; + + /*-----------------------------------------------------------------*/ + + case OP_DIGIT: + case OP_WHITESPACE: + case OP_WORDCHAR: + if (clen > 0 && c < 256 && + ((ctypes[c] & toptable1[codevalue]) ^ toptable2[codevalue]) != 0) + { ADD_NEW(state_offset + 1, 0); } + break; + + /*-----------------------------------------------------------------*/ + case OP_NOT_DIGIT: + case OP_NOT_WHITESPACE: + case OP_NOT_WORDCHAR: + if (clen > 0 && (c >= 256 || + ((ctypes[c] & toptable1[codevalue]) ^ toptable2[codevalue]) != 0)) + { ADD_NEW(state_offset + 1, 0); } + break; + + /*-----------------------------------------------------------------*/ + case OP_WORD_BOUNDARY: + case OP_NOT_WORD_BOUNDARY: + { + int left_word, right_word; + + if (ptr > start_subject) + { + const uschar *temp = ptr - 1; +#ifdef SUPPORT_UTF8 + if (utf8) BACKCHAR(temp); +#endif + GETCHARTEST(d, temp); + left_word = d < 256 && (ctypes[d] & ctype_word) != 0; + } + else left_word = 0; + + if (clen > 0) right_word = c < 256 && (ctypes[c] & ctype_word) != 0; + else right_word = 0; + + if ((left_word == right_word) == (codevalue == OP_NOT_WORD_BOUNDARY)) + { ADD_ACTIVE(state_offset + 1, 0); } + } + break; + + +#ifdef SUPPORT_UCP + + /*-----------------------------------------------------------------*/ + /* Check the next character by Unicode property. We will get here only + if the support is in the binary; otherwise a compile-time error occurs. + */ + + case OP_PROP: + case OP_NOTPROP: + if (clen > 0) + { + int rqdtype, category; + category = _pcre_ucp_findchar(c, &chartype, &othercase); + rqdtype = code[1]; + if (rqdtype >= 128) + { + if ((rqdtype - 128 == category) == (codevalue == OP_PROP)) + { ADD_NEW(state_offset + 2, 0); } + } + else + { + if ((rqdtype == chartype) == (codevalue == OP_PROP)) + { ADD_NEW(state_offset + 2, 0); } + } + } + break; +#endif + + + +/* ========================================================================== */ + /* These opcodes likewise inspect the subject character, but have an + argument that is not a data character. It is one of these opcodes: + OP_ANY, OP_DIGIT, OP_NOT_DIGIT, OP_WHITESPACE, OP_NOT_SPACE, OP_WORDCHAR, + OP_NOT_WORDCHAR. The value is loaded into d. */ + + case OP_TYPEPLUS: + case OP_TYPEMINPLUS: + count = current_state->count; /* Already matched */ + if (count > 0) { ADD_ACTIVE(state_offset + 2, 0); } + if (clen > 0) + { + if ((c >= 256 && d != OP_DIGIT && d != OP_WHITESPACE && d != OP_WORDCHAR) || + (c < 256 && + (d != OP_ANY || c != '\n' || (ims & PCRE_DOTALL) != 0) && + ((ctypes[c] & toptable1[d]) ^ toptable2[d]) != 0)) + { + count++; + ADD_NEW(state_offset, count); + } + } + break; + + /*-----------------------------------------------------------------*/ + case OP_TYPEQUERY: + case OP_TYPEMINQUERY: + ADD_ACTIVE(state_offset + 2, 0); + if (clen > 0) + { + if ((c >= 256 && d != OP_DIGIT && d != OP_WHITESPACE && d != OP_WORDCHAR) || + (c < 256 && + (d != OP_ANY || c != '\n' || (ims & PCRE_DOTALL) != 0) && + ((ctypes[c] & toptable1[d]) ^ toptable2[d]) != 0)) + { + ADD_NEW(state_offset + 2, 0); + } + } + break; + + /*-----------------------------------------------------------------*/ + case OP_TYPESTAR: + case OP_TYPEMINSTAR: + ADD_ACTIVE(state_offset + 2, 0); + if (clen > 0) + { + if ((c >= 256 && d != OP_DIGIT && d != OP_WHITESPACE && d != OP_WORDCHAR) || + (c < 256 && + (d != OP_ANY || c != '\n' || (ims & PCRE_DOTALL) != 0) && + ((ctypes[c] & toptable1[d]) ^ toptable2[d]) != 0)) + { + ADD_NEW(state_offset, 0); + } + } + break; + + /*-----------------------------------------------------------------*/ + case OP_TYPEEXACT: + case OP_TYPEUPTO: + case OP_TYPEMINUPTO: + if (codevalue != OP_TYPEEXACT) + { ADD_ACTIVE(state_offset + 4, 0); } + count = current_state->count; /* Number already matched */ + if (clen > 0) + { + if ((c >= 256 && d != OP_DIGIT && d != OP_WHITESPACE && d != OP_WORDCHAR) || + (c < 256 && + (d != OP_ANY || c != '\n' || (ims & PCRE_DOTALL) != 0) && + ((ctypes[c] & toptable1[d]) ^ toptable2[d]) != 0)) + { + if (++count >= GET2(code, 1)) + { ADD_NEW(state_offset + 4, 0); } + else + { ADD_NEW(state_offset, count); } + } + } + break; + +/* ========================================================================== */ + /* These are virtual opcodes that are used when something like + OP_TYPEPLUS has OP_PROP, OP_NOTPROP, or OP_EXTUNI as its argument. It + keeps the code above fast for the other cases. The argument is in the + d variable. */ + + case OP_PROP_EXTRA + OP_TYPEPLUS: + case OP_PROP_EXTRA + OP_TYPEMINPLUS: + count = current_state->count; /* Already matched */ + if (count > 0) { ADD_ACTIVE(state_offset + 3, 0); } + if (clen > 0) + { + int category = _pcre_ucp_findchar(c, &chartype, &othercase); + int rqdtype = code[2]; + if ((d == OP_PROP) == + (rqdtype == ((rqdtype >= 128)? (category + 128) : chartype))) + { count++; ADD_NEW(state_offset, count); } + } + break; + + /*-----------------------------------------------------------------*/ + case OP_EXTUNI_EXTRA + OP_TYPEPLUS: + case OP_EXTUNI_EXTRA + OP_TYPEMINPLUS: + count = current_state->count; /* Already matched */ + if (count > 0) { ADD_ACTIVE(state_offset + 2, 0); } + if (clen > 0 && _pcre_ucp_findchar(c, &chartype, &othercase) != ucp_M) + { + const uschar *nptr = ptr + clen; + int ncount = 0; + while (nptr < end_subject) + { + int nd; + int ndlen = 1; + GETCHARLEN(nd, nptr, ndlen); + if (_pcre_ucp_findchar(nd, &chartype, &othercase) != ucp_M) break; + ncount++; + nptr += ndlen; + } + count++; + ADD_NEW_DATA(-state_offset, count, ncount); + } + break; + + /*-----------------------------------------------------------------*/ + case OP_PROP_EXTRA + OP_TYPEQUERY: + case OP_PROP_EXTRA + OP_TYPEMINQUERY: + count = 3; + goto QS1; + + case OP_PROP_EXTRA + OP_TYPESTAR: + case OP_PROP_EXTRA + OP_TYPEMINSTAR: + count = 0; + + QS1: + + ADD_ACTIVE(state_offset + 3, 0); + if (clen > 0) + { + int category = _pcre_ucp_findchar(c, &chartype, &othercase); + int rqdtype = code[2]; + if ((d == OP_PROP) == + (rqdtype == ((rqdtype >= 128)? (category + 128) : chartype))) + { ADD_NEW(state_offset + count, 0); } + } + break; + + /*-----------------------------------------------------------------*/ + case OP_EXTUNI_EXTRA + OP_TYPEQUERY: + case OP_EXTUNI_EXTRA + OP_TYPEMINQUERY: + count = 2; + goto QS2; + + case OP_EXTUNI_EXTRA + OP_TYPESTAR: + case OP_EXTUNI_EXTRA + OP_TYPEMINSTAR: + count = 0; + + QS2: + + ADD_ACTIVE(state_offset + 2, 0); + if (clen > 0 && _pcre_ucp_findchar(c, &chartype, &othercase) != ucp_M) + { + const uschar *nptr = ptr + clen; + int ncount = 0; + while (nptr < end_subject) + { + int nd; + int ndlen = 1; + GETCHARLEN(nd, nptr, ndlen); + if (_pcre_ucp_findchar(nd, &chartype, &othercase) != ucp_M) break; + ncount++; + nptr += ndlen; + } + ADD_NEW_DATA(-(state_offset + count), 0, ncount); + } + break; + + /*-----------------------------------------------------------------*/ + case OP_PROP_EXTRA + OP_TYPEEXACT: + case OP_PROP_EXTRA + OP_TYPEUPTO: + case OP_PROP_EXTRA + OP_TYPEMINUPTO: + if (codevalue != OP_PROP_EXTRA + OP_TYPEEXACT) + { ADD_ACTIVE(state_offset + 5, 0); } + count = current_state->count; /* Number already matched */ + if (clen > 0) + { + int category = _pcre_ucp_findchar(c, &chartype, &othercase); + int rqdtype = code[4]; + if ((d == OP_PROP) == + (rqdtype == ((rqdtype >= 128)? (category + 128) : chartype))) + { + if (++count >= GET2(code, 1)) + { ADD_NEW(state_offset + 5, 0); } + else + { ADD_NEW(state_offset, count); } + } + } + break; + + /*-----------------------------------------------------------------*/ + case OP_EXTUNI_EXTRA + OP_TYPEEXACT: + case OP_EXTUNI_EXTRA + OP_TYPEUPTO: + case OP_EXTUNI_EXTRA + OP_TYPEMINUPTO: + if (codevalue != OP_EXTUNI_EXTRA + OP_TYPEEXACT) + { ADD_ACTIVE(state_offset + 4, 0); } + count = current_state->count; /* Number already matched */ + if (clen > 0 && _pcre_ucp_findchar(c, &chartype, &othercase) != ucp_M) + { + const uschar *nptr = ptr + clen; + int ncount = 0; + while (nptr < end_subject) + { + int nd; + int ndlen = 1; + GETCHARLEN(nd, nptr, ndlen); + if (_pcre_ucp_findchar(nd, &chartype, &othercase) != ucp_M) break; + ncount++; + nptr += ndlen; + } + if (++count >= GET2(code, 1)) + { ADD_NEW_DATA(-(state_offset + 4), 0, ncount); } + else + { ADD_NEW_DATA(-state_offset, count, ncount); } + } + break; + +/* ========================================================================== */ + /* These opcodes are followed by a character that is usually compared + to the current subject character; it is loaded into d. We still get + here even if there is no subject character, because in some cases zero + repetitions are permitted. */ + + /*-----------------------------------------------------------------*/ + case OP_CHAR: + if (clen > 0 && c == d) { ADD_NEW(state_offset + dlen + 1, 0); } + break; + + /*-----------------------------------------------------------------*/ + case OP_CHARNC: + if (clen == 0) break; + +#ifdef SUPPORT_UTF8 + if (utf8) + { + if (c == d) { ADD_NEW(state_offset + dlen + 1, 0); } else + { + if (c < 128) othercase = fcc[c]; else + + /* If we have Unicode property support, we can use it to test the + other case of the character, if there is one. The result of + _pcre_ucp_findchar() is < 0 if the char isn't found, and othercase is + returned as zero if there isn't another case. */ + +#ifdef SUPPORT_UCP + if (_pcre_ucp_findchar(c, &chartype, &othercase) < 0) +#endif + othercase = -1; + + if (d == othercase) { ADD_NEW(state_offset + dlen + 1, 0); } + } + } + else +#endif /* SUPPORT_UTF8 */ + + /* Non-UTF-8 mode */ + { + if (lcc[c] == lcc[d]) { ADD_NEW(state_offset + 2, 0); } + } + break; + + +#ifdef SUPPORT_UCP + /*-----------------------------------------------------------------*/ + /* This is a tricky one because it can match more than one character. + Find out how many characters to skip, and then set up a negative state + to wait for them to pass before continuing. */ + + case OP_EXTUNI: + if (clen > 0 && _pcre_ucp_findchar(c, &chartype, &othercase) != ucp_M) + { + const uschar *nptr = ptr + clen; + int ncount = 0; + while (nptr < end_subject) + { + int nclen = 1; + GETCHARLEN(c, nptr, nclen); + if (_pcre_ucp_findchar(c, &chartype, &othercase) != ucp_M) break; + ncount++; + nptr += nclen; + } + ADD_NEW_DATA(-(state_offset + 1), 0, ncount); + } + break; +#endif + + /*-----------------------------------------------------------------*/ + /* Match a negated single character. This is only used for one-byte + characters, that is, we know that d < 256. The character we are + checking (c) can be multibyte. */ + + case OP_NOT: + if (clen > 0) + { + int otherd = ((ims & PCRE_CASELESS) != 0)? fcc[d] : d; + if (c != d && c != otherd) { ADD_NEW(state_offset + dlen + 1, 0); } + } + break; + + /*-----------------------------------------------------------------*/ + case OP_PLUS: + case OP_MINPLUS: + case OP_NOTPLUS: + case OP_NOTMINPLUS: + count = current_state->count; /* Already matched */ + if (count > 0) { ADD_ACTIVE(state_offset + dlen + 1, 0); } + if (clen > 0) + { + int otherd = -1; + if ((ims & PCRE_CASELESS) != 0) + { +#ifdef SUPPORT_UTF8 + if (utf8 && c >= 128) + { +#ifdef SUPPORT_UCP + if (_pcre_ucp_findchar(d, &chartype, &otherd) < 0) otherd = -1; +#endif /* SUPPORT_UCP */ + } + else +#endif /* SUPPORT_UTF8 */ + otherd = fcc[d]; + } + if ((c == d || c == otherd) == (codevalue < OP_NOTSTAR)) + { count++; ADD_NEW(state_offset, count); } + } + break; + + /*-----------------------------------------------------------------*/ + case OP_QUERY: + case OP_MINQUERY: + case OP_NOTQUERY: + case OP_NOTMINQUERY: + ADD_ACTIVE(state_offset + dlen + 1, 0); + if (clen > 0) + { + int otherd = -1; + if ((ims && PCRE_CASELESS) != 0) + { +#ifdef SUPPORT_UTF8 + if (utf8 && c >= 128) + { +#ifdef SUPPORT_UCP + if (_pcre_ucp_findchar(c, &chartype, &otherd) < 0) otherd = -1; +#endif /* SUPPORT_UCP */ + } + else +#endif /* SUPPORT_UTF8 */ + otherd = fcc[d]; + } + if ((c == d || c == otherd) == (codevalue < OP_NOTSTAR)) + { ADD_NEW(state_offset + dlen + 1, 0); } + } + break; + + /*-----------------------------------------------------------------*/ + case OP_STAR: + case OP_MINSTAR: + case OP_NOTSTAR: + case OP_NOTMINSTAR: + ADD_ACTIVE(state_offset + dlen + 1, 0); + if (clen > 0) + { + int otherd = -1; + if ((ims && PCRE_CASELESS) != 0) + { +#ifdef SUPPORT_UTF8 + if (utf8 && c >= 128) + { +#ifdef SUPPORT_UCP + if (_pcre_ucp_findchar(c, &chartype, &otherd) < 0) otherd = -1; +#endif /* SUPPORT_UCP */ + } + else +#endif /* SUPPORT_UTF8 */ + otherd = fcc[d]; + } + if ((c == d || c == otherd) == (codevalue < OP_NOTSTAR)) + { ADD_NEW(state_offset, 0); } + } + break; + + /*-----------------------------------------------------------------*/ + case OP_EXACT: + case OP_UPTO: + case OP_MINUPTO: + case OP_NOTEXACT: + case OP_NOTUPTO: + case OP_NOTMINUPTO: + if (codevalue != OP_EXACT && codevalue != OP_NOTEXACT) + { ADD_ACTIVE(state_offset + dlen + 3, 0); } + count = current_state->count; /* Number already matched */ + if (clen > 0) + { + int otherd = -1; + if ((ims & PCRE_CASELESS) != 0) + { +#ifdef SUPPORT_UTF8 + if (utf8 && c >= 128) + { +#ifdef SUPPORT_UCP + if (_pcre_ucp_findchar(d, &chartype, &otherd) < 0) otherd = -1; +#endif /* SUPPORT_UCP */ + } + else +#endif /* SUPPORT_UTF8 */ + otherd = fcc[d]; + } + if ((c == d || c == otherd) == (codevalue < OP_NOTSTAR)) + { + if (++count >= GET2(code, 1)) + { ADD_NEW(state_offset + dlen + 3, 0); } + else + { ADD_NEW(state_offset, count); } + } + } + break; + + +/* ========================================================================== */ + /* These are the class-handling opcodes */ + + case OP_CLASS: + case OP_NCLASS: + case OP_XCLASS: + { + BOOL isinclass = FALSE; + int next_state_offset; + const uschar *ecode; + + /* For a simple class, there is always just a 32-byte table, and we + can set isinclass from it. */ + + if (codevalue != OP_XCLASS) + { + ecode = code + 33; + if (clen > 0) + { + isinclass = (c > 255)? (codevalue == OP_NCLASS) : + ((code[1 + c/8] & (1 << (c&7))) != 0); + } + } + + /* An extended class may have a table or a list of single characters, + ranges, or both, and it may be positive or negative. There's a + function that sorts all this out. */ + + else + { + ecode = code + GET(code, 1); + if (clen > 0) isinclass = _pcre_xclass(c, code + 1 + LINK_SIZE); + } + + /* At this point, isinclass is set for all kinds of class, and ecode + points to the byte after the end of the class. If there is a + quantifier, this is where it will be. */ + + next_state_offset = ecode - start_code; + + switch (*ecode) + { + case OP_CRSTAR: + case OP_CRMINSTAR: + ADD_ACTIVE(next_state_offset + 1, 0); + if (isinclass) { ADD_NEW(state_offset, 0); } + break; + + case OP_CRPLUS: + case OP_CRMINPLUS: + count = current_state->count; /* Already matched */ + if (count > 0) { ADD_ACTIVE(next_state_offset + 1, 0); } + if (isinclass) { count++; ADD_NEW(state_offset, count); } + break; + + case OP_CRQUERY: + case OP_CRMINQUERY: + ADD_ACTIVE(next_state_offset + 1, 0); + if (isinclass) { ADD_NEW(next_state_offset + 1, 0); } + break; + + case OP_CRRANGE: + case OP_CRMINRANGE: + count = current_state->count; /* Already matched */ + if (count >= GET2(ecode, 1)) + { ADD_ACTIVE(next_state_offset + 5, 0); } + if (isinclass) + { + if (++count >= GET2(ecode, 3)) + { ADD_NEW(next_state_offset + 5, 0); } + else + { ADD_NEW(state_offset, count); } + } + break; + + default: + if (isinclass) { ADD_NEW(next_state_offset, 0); } + break; + } + } + break; + +/* ========================================================================== */ + /* These are the opcodes for fancy brackets of various kinds. We have + to use recursion in order to handle them. */ + + case OP_ASSERT: + case OP_ASSERT_NOT: + case OP_ASSERTBACK: + case OP_ASSERTBACK_NOT: + { + int rc; + int local_offsets[2]; + int local_workspace[1000]; + const uschar *endasscode = code + GET(code, 1); + + while (*endasscode == OP_ALT) endasscode += GET(endasscode, 1); + + rc = internal_dfa_exec( + md, /* static match data */ + code, /* this subexpression's code */ + ptr, /* where we currently are */ + ptr - start_subject, /* start offset */ + local_offsets, /* offset vector */ + sizeof(local_offsets)/sizeof(int), /* size of same */ + local_workspace, /* workspace vector */ + sizeof(local_workspace)/sizeof(int), /* size of same */ + ims, /* the current ims flags */ + rlevel, /* function recursion level */ + recursing); /* pass on regex recursion */ + + if ((rc >= 0) == (codevalue == OP_ASSERT || codevalue == OP_ASSERTBACK)) + { ADD_ACTIVE(endasscode + LINK_SIZE + 1 - start_code, 0); } + } + break; + + /*-----------------------------------------------------------------*/ + case OP_COND: + { + int local_offsets[1000]; + int local_workspace[1000]; + int condcode = code[LINK_SIZE+1]; + + /* The only supported version of OP_CREF is for the value 0xffff, which + means "test if in a recursion". */ + + if (condcode == OP_CREF) + { + int value = GET2(code, LINK_SIZE+2); + if (value != 0xffff) return PCRE_ERROR_DFA_UCOND; + if (recursing > 0) { ADD_ACTIVE(state_offset + LINK_SIZE + 4, 0); } + else { ADD_ACTIVE(state_offset + GET(code, 1) + LINK_SIZE + 1, 0); } + } + + /* Otherwise, the condition is an assertion */ + + else + { + int rc; + const uschar *asscode = code + LINK_SIZE + 1; + const uschar *endasscode = asscode + GET(asscode, 1); + + while (*endasscode == OP_ALT) endasscode += GET(endasscode, 1); + + rc = internal_dfa_exec( + md, /* fixed match data */ + asscode, /* this subexpression's code */ + ptr, /* where we currently are */ + ptr - start_subject, /* start offset */ + local_offsets, /* offset vector */ + sizeof(local_offsets)/sizeof(int), /* size of same */ + local_workspace, /* workspace vector */ + sizeof(local_workspace)/sizeof(int), /* size of same */ + ims, /* the current ims flags */ + rlevel, /* function recursion level */ + recursing); /* pass on regex recursion */ + + if ((rc >= 0) == + (condcode == OP_ASSERT || condcode == OP_ASSERTBACK)) + { ADD_ACTIVE(endasscode + LINK_SIZE + 1 - start_code, 0); } + else + { ADD_ACTIVE(state_offset + GET(code, 1) + LINK_SIZE + 1, 0); } + } + } + break; + + /*-----------------------------------------------------------------*/ + case OP_RECURSE: + { + int local_offsets[1000]; + int local_workspace[1000]; + int rc; + + DPRINTF(("%.*sStarting regex recursion %d\n", rlevel*2-2, SP, + recursing + 1)); + + rc = internal_dfa_exec( + md, /* fixed match data */ + start_code + GET(code, 1), /* this subexpression's code */ + ptr, /* where we currently are */ + ptr - start_subject, /* start offset */ + local_offsets, /* offset vector */ + sizeof(local_offsets)/sizeof(int), /* size of same */ + local_workspace, /* workspace vector */ + sizeof(local_workspace)/sizeof(int), /* size of same */ + ims, /* the current ims flags */ + rlevel, /* function recursion level */ + recursing + 1); /* regex recurse level */ + + DPRINTF(("%.*sReturn from regex recursion %d: rc=%d\n", rlevel*2-2, SP, + recursing + 1, rc)); + + /* Ran out of internal offsets */ + + if (rc == 0) return PCRE_ERROR_DFA_RECURSE; + + /* For each successful matched substring, set up the next state with a + count of characters to skip before trying it. Note that the count is in + characters, not bytes. */ + + if (rc > 0) + { + for (rc = rc*2 - 2; rc >= 0; rc -= 2) + { + const uschar *p = start_subject + local_offsets[rc]; + const uschar *pp = start_subject + local_offsets[rc+1]; + int charcount = local_offsets[rc+1] - local_offsets[rc]; + while (p < pp) if ((*p++ & 0xc0) == 0x80) charcount--; + if (charcount > 0) + { + ADD_NEW_DATA(-(state_offset + LINK_SIZE + 1), 0, (charcount - 1)); + } + else + { + ADD_ACTIVE(state_offset + LINK_SIZE + 1, 0); + } + } + } + else if (rc != PCRE_ERROR_NOMATCH) return rc; + } + break; + + /*-----------------------------------------------------------------*/ + case OP_ONCE: + { + int local_offsets[2]; + int local_workspace[1000]; + + int rc = internal_dfa_exec( + md, /* fixed match data */ + code, /* this subexpression's code */ + ptr, /* where we currently are */ + ptr - start_subject, /* start offset */ + local_offsets, /* offset vector */ + sizeof(local_offsets)/sizeof(int), /* size of same */ + local_workspace, /* workspace vector */ + sizeof(local_workspace)/sizeof(int), /* size of same */ + ims, /* the current ims flags */ + rlevel, /* function recursion level */ + recursing); /* pass on regex recursion */ + + if (rc >= 0) + { + const uschar *end_subpattern = code; + int charcount = local_offsets[1] - local_offsets[0]; + int next_state_offset, repeat_state_offset; + + do { end_subpattern += GET(end_subpattern, 1); } + while (*end_subpattern == OP_ALT); + next_state_offset = end_subpattern - start_code + LINK_SIZE + 1; + + /* If the end of this subpattern is KETRMAX or KETRMIN, we must + arrange for the repeat state also to be added to the relevant list. + Calculate the offset, or set -1 for no repeat. */ + + repeat_state_offset = (*end_subpattern == OP_KETRMAX || + *end_subpattern == OP_KETRMIN)? + end_subpattern - start_code - GET(end_subpattern, 1) : -1; + + /* If we have matched an empty string, add the next state at the + current character pointer. This is important so that the duplicate + checking kicks in, which is what breaks infinite loops that match an + empty string. */ + + if (charcount == 0) + { + ADD_ACTIVE(next_state_offset, 0); + } + + /* Optimization: if there are no more active states, and there + are no new states yet set up, then skip over the subject string + right here, to save looping. Otherwise, set up the new state to swing + into action when the end of the substring is reached. */ + + else if (i + 1 >= active_count && new_count == 0) + { + ptr += charcount; + clen = 0; + ADD_NEW(next_state_offset, 0); + + /* If we are adding a repeat state at the new character position, + we must fudge things so that it is the only current state. + Otherwise, it might be a duplicate of one we processed before, and + that would cause it to be skipped. */ + + if (repeat_state_offset >= 0) + { + next_active_state = active_states; + active_count = 0; + i = -1; + ADD_ACTIVE(repeat_state_offset, 0); + } + } + else + { + const uschar *p = start_subject + local_offsets[0]; + const uschar *pp = start_subject + local_offsets[1]; + while (p < pp) if ((*p++ & 0xc0) == 0x80) charcount--; + ADD_NEW_DATA(-next_state_offset, 0, (charcount - 1)); + if (repeat_state_offset >= 0) + { ADD_NEW_DATA(-repeat_state_offset, 0, (charcount - 1)); } + } + + } + else if (rc != PCRE_ERROR_NOMATCH) return rc; + } + break; + + +/* ========================================================================== */ + /* Handle callouts */ + + case OP_CALLOUT: + if (pcre_callout != NULL) + { + int rrc; + pcre_callout_block cb; + cb.version = 1; /* Version 1 of the callout block */ + cb.callout_number = code[1]; + cb.offset_vector = offsets; + cb.subject = (char *)start_subject; + cb.subject_length = end_subject - start_subject; + cb.start_match = current_subject - start_subject; + cb.current_position = ptr - start_subject; + cb.pattern_position = GET(code, 2); + cb.next_item_length = GET(code, 2 + LINK_SIZE); + cb.capture_top = 1; + cb.capture_last = -1; + cb.callout_data = md->callout_data; + if ((rrc = (*pcre_callout)(&cb)) < 0) return rrc; /* Abandon */ + if (rrc == 0) { ADD_ACTIVE(state_offset + 2 + 2*LINK_SIZE, 0); } + } + break; + + +/* ========================================================================== */ + default: /* Unsupported opcode */ + return PCRE_ERROR_DFA_UITEM; + } + + NEXT_ACTIVE_STATE: continue; + + } /* End of loop scanning active states */ + + /* We have finished the processing at the current subject character. If no + new states have been set for the next character, we have found all the + matches that we are going to find. If we are at the top level and partial + matching has been requested, check for appropriate conditions. */ + + if (new_count <= 0) + { + if (match_count < 0 && /* No matches found */ + rlevel == 1 && /* Top level match function */ + (md->moptions & PCRE_PARTIAL) != 0 && /* Want partial matching */ + ptr >= end_subject && /* Reached end of subject */ + ptr > current_subject) /* Matched non-empty string */ + { + if (offsetcount >= 2) + { + offsets[0] = current_subject - start_subject; + offsets[1] = end_subject - start_subject; + } + match_count = PCRE_ERROR_PARTIAL; + } + + DPRINTF(("%.*sEnd of internal_dfa_exec %d: returning %d\n" + "%.*s---------------------\n\n", rlevel*2-2, SP, rlevel, match_count, + rlevel*2-2, SP)); + return match_count; + } + + /* One or more states are active for the next character. */ + + ptr += clen; /* Advance to next subject character */ + } /* Loop to move along the subject string */ + +/* Control never gets here, but we must keep the compiler happy. */ + +DPRINTF(("%.*s+++ Unexpected end of internal_dfa_exec %d +++\n" + "%.*s---------------------\n\n", rlevel*2-2, SP, rlevel, rlevel*2-2, SP)); +return PCRE_ERROR_NOMATCH; +} + + + + +/************************************************* +* Execute a Regular Expression - DFA engine * +*************************************************/ + +/* This external function applies a compiled re to a subject string using a DFA +engine. This function calls the internal function multiple times if the pattern +is not anchored. + +Arguments: + argument_re points to the compiled expression + extra_data points to extra data or is NULL (not currently used) + subject points to the subject string + length length of subject string (may contain binary zeros) + start_offset where to start in the subject string + options option bits + offsets vector of match offsets + offsetcount size of same + workspace workspace vector + wscount size of same + +Returns: > 0 => number of match offset pairs placed in offsets + = 0 => offsets overflowed; longest matches are present + -1 => failed to match + < -1 => some kind of unexpected problem +*/ + +PCRE_EXPORT int +pcre_dfa_exec(const pcre *argument_re, const pcre_extra *extra_data, + const char *subject, int length, int start_offset, int options, int *offsets, + int offsetcount, int *workspace, int wscount) +{ +real_pcre *re = (real_pcre *)argument_re; +dfa_match_data match_block; +BOOL utf8, anchored, startline, firstline; +const uschar *current_subject, *end_subject, *lcc; + +pcre_study_data internal_study; +const pcre_study_data *study = NULL; +real_pcre internal_re; + +const uschar *req_byte_ptr; +const uschar *start_bits = NULL; +BOOL first_byte_caseless = FALSE; +BOOL req_byte_caseless = FALSE; +int first_byte = -1; +int req_byte = -1; +int req_byte2 = -1; + +/* Plausibility checks */ + +if ((options & ~PUBLIC_DFA_EXEC_OPTIONS) != 0) return PCRE_ERROR_BADOPTION; +if (re == NULL || subject == NULL || workspace == NULL || + (offsets == NULL && offsetcount > 0)) return PCRE_ERROR_NULL; +if (offsetcount < 0) return PCRE_ERROR_BADCOUNT; +if (wscount < 20) return PCRE_ERROR_DFA_WSSIZE; + +/* We need to find the pointer to any study data before we test for byte +flipping, so we scan the extra_data block first. This may set two fields in the +match block, so we must initialize them beforehand. However, the other fields +in the match block must not be set until after the byte flipping. */ + +match_block.tables = re->tables; +match_block.callout_data = NULL; + +if (extra_data != NULL) + { + unsigned int flags = extra_data->flags; + if ((flags & PCRE_EXTRA_STUDY_DATA) != 0) + study = (const pcre_study_data *)extra_data->study_data; + if ((flags & PCRE_EXTRA_MATCH_LIMIT) != 0) return PCRE_ERROR_DFA_UMLIMIT; + if ((flags & PCRE_EXTRA_CALLOUT_DATA) != 0) + match_block.callout_data = extra_data->callout_data; + if ((flags & PCRE_EXTRA_TABLES) != 0) + match_block.tables = extra_data->tables; + } + +/* Check that the first field in the block is the magic number. If it is not, +test for a regex that was compiled on a host of opposite endianness. If this is +the case, flipped values are put in internal_re and internal_study if there was +study data too. */ + +if (re->magic_number != MAGIC_NUMBER) + { + re = _pcre_try_flipped(re, &internal_re, study, &internal_study); + if (re == NULL) return PCRE_ERROR_BADMAGIC; + if (study != NULL) study = &internal_study; + } + +/* Set some local values */ + +current_subject = (const unsigned char *)subject + start_offset; +end_subject = (const unsigned char *)subject + length; +req_byte_ptr = current_subject - 1; + +utf8 = (re->options & PCRE_UTF8) != 0; +anchored = (options & PCRE_ANCHORED) != 0 || (re->options & PCRE_ANCHORED) != 0; + +/* The remaining fixed data for passing around. */ + +match_block.start_code = (const uschar *)argument_re + + re->name_table_offset + re->name_count * re->name_entry_size; +match_block.start_subject = (const unsigned char *)subject; +match_block.end_subject = end_subject; +match_block.moptions = options; +match_block.poptions = re->options; + +/* Check a UTF-8 string if required. Unfortunately there's no way of passing +back the character offset. */ + +#ifdef SUPPORT_UTF8 +if (utf8 && (options & PCRE_NO_UTF8_CHECK) == 0) + { + if (_pcre_valid_utf8((uschar *)subject, length) >= 0) + return PCRE_ERROR_BADUTF8; + if (start_offset > 0 && start_offset < length) + { + int tb = ((uschar *)subject)[start_offset]; + if (tb > 127) + { + tb &= 0xc0; + if (tb != 0 && tb != 0xc0) return PCRE_ERROR_BADUTF8_OFFSET; + } + } + } +#endif + +/* If the exec call supplied NULL for tables, use the inbuilt ones. This +is a feature that makes it possible to save compiled regex and re-use them +in other programs later. */ + +if (match_block.tables == NULL) match_block.tables = _pcre_default_tables; + +/* The lower casing table and the "must be at the start of a line" flag are +used in a loop when finding where to start. */ + +lcc = match_block.tables + lcc_offset; +startline = (re->options & PCRE_STARTLINE) != 0; +firstline = (re->options & PCRE_FIRSTLINE) != 0; + +/* Set up the first character to match, if available. The first_byte value is +never set for an anchored regular expression, but the anchoring may be forced +at run time, so we have to test for anchoring. The first char may be unset for +an unanchored pattern, of course. If there's no first char and the pattern was +studied, there may be a bitmap of possible first characters. */ + +if (!anchored) + { + if ((re->options & PCRE_FIRSTSET) != 0) + { + first_byte = re->first_byte & 255; + if ((first_byte_caseless = ((re->first_byte & REQ_CASELESS) != 0)) == TRUE) + first_byte = lcc[first_byte]; + } + else + { + if (startline && study != NULL && + (study->options & PCRE_STUDY_MAPPED) != 0) + start_bits = study->start_bits; + } + } + +/* For anchored or unanchored matches, there may be a "last known required +character" set. */ + +if ((re->options & PCRE_REQCHSET) != 0) + { + req_byte = re->req_byte & 255; + req_byte_caseless = (re->req_byte & REQ_CASELESS) != 0; + req_byte2 = (match_block.tables + fcc_offset)[req_byte]; /* case flipped */ + } + +/* Call the main matching function, looping for a non-anchored regex after a +failed match. Unless restarting, optimize by moving to the first match +character if possible, when not anchored. Then unless wanting a partial match, +check for a required later character. */ + +for (;;) + { + int rc; + + if ((options & PCRE_DFA_RESTART) == 0) + { + const uschar *save_end_subject = end_subject; + + /* Advance to a unique first char if possible. If firstline is TRUE, the + start of the match is constrained to the first line of a multiline string. + Implement this by temporarily adjusting end_subject so that we stop scanning + at a newline. If the match fails at the newline, later code breaks this loop. + */ + + if (firstline) + { + const uschar *t = current_subject; + while (t < save_end_subject && *t != '\n') t++; + end_subject = t; + } + + if (first_byte >= 0) + { + if (first_byte_caseless) + while (current_subject < end_subject && + lcc[*current_subject] != first_byte) + current_subject++; + else + while (current_subject < end_subject && *current_subject != first_byte) + current_subject++; + } + + /* Or to just after \n for a multiline match if possible */ + + else if (startline) + { + if (current_subject > match_block.start_subject + start_offset) + { + while (current_subject < end_subject && current_subject[-1] != NEWLINE) + current_subject++; + } + } + + /* Or to a non-unique first char after study */ + + else if (start_bits != NULL) + { + while (current_subject < end_subject) + { + register unsigned int c = *current_subject; + if ((start_bits[c/8] & (1 << (c&7))) == 0) current_subject++; + else break; + } + } + + /* Restore fudged end_subject */ + + end_subject = save_end_subject; + } + + /* If req_byte is set, we know that that character must appear in the subject + for the match to succeed. If the first character is set, req_byte must be + later in the subject; otherwise the test starts at the match point. This + optimization can save a huge amount of work in patterns with nested unlimited + repeats that aren't going to match. Writing separate code for cased/caseless + versions makes it go faster, as does using an autoincrement and backing off + on a match. + + HOWEVER: when the subject string is very, very long, searching to its end can + take a long time, and give bad performance on quite ordinary patterns. This + showed up when somebody was matching /^C/ on a 32-megabyte string... so we + don't do this when the string is sufficiently long. + + ALSO: this processing is disabled when partial matching is requested. + */ + + if (req_byte >= 0 && + end_subject - current_subject < REQ_BYTE_MAX && + (options & PCRE_PARTIAL) == 0) + { + register const uschar *p = current_subject + ((first_byte >= 0)? 1 : 0); + + /* We don't need to repeat the search if we haven't yet reached the + place we found it at last time. */ + + if (p > req_byte_ptr) + { + if (req_byte_caseless) + { + while (p < end_subject) + { + register int pp = *p++; + if (pp == req_byte || pp == req_byte2) { p--; break; } + } + } + else + { + while (p < end_subject) + { + if (*p++ == req_byte) { p--; break; } + } + } + + /* If we can't find the required character, break the matching loop, + which will cause a return or PCRE_ERROR_NOMATCH. */ + + if (p >= end_subject) break; + + /* If we have found the required character, save the point where we + found it, so that we don't search again next time round the loop if + the start hasn't passed this character yet. */ + + req_byte_ptr = p; + } + } + + /* OK, now we can do the business */ + + rc = internal_dfa_exec( + &match_block, /* fixed match data */ + match_block.start_code, /* this subexpression's code */ + current_subject, /* where we currently are */ + start_offset, /* start offset in subject */ + offsets, /* offset vector */ + offsetcount, /* size of same */ + workspace, /* workspace vector */ + wscount, /* size of same */ + re->options & (PCRE_CASELESS|PCRE_MULTILINE|PCRE_DOTALL), /* ims flags */ + 0, /* function recurse level */ + 0); /* regex recurse level */ + + /* Anything other than "no match" means we are done, always; otherwise, carry + on only if not anchored. */ + + if (rc != PCRE_ERROR_NOMATCH || anchored) return rc; + + /* Advance to the next subject character unless we are at the end of a line + and firstline is set. */ + + if (firstline && *current_subject == NEWLINE) break; + current_subject++; + +#ifdef SUPPORT_UTF8 + if (utf8) + { + while (current_subject < end_subject && (*current_subject & 0xc0) == 0x80) + current_subject++; + } +#endif + + if (current_subject > end_subject) break; + } + +return PCRE_ERROR_NOMATCH; +} + +/* End of pcre_dfa_exec.c */ diff --git a/mozilla/js/tamarin/pcre/pcre_exec.cpp b/mozilla/js/tamarin/pcre/pcre_exec.cpp new file mode 100644 index 00000000000..8c82f193df7 --- /dev/null +++ b/mozilla/js/tamarin/pcre/pcre_exec.cpp @@ -0,0 +1,3810 @@ +#include "avmplus.h" + +/************************************************* +* Perl-Compatible Regular Expressions * +*************************************************/ + +/* PCRE is a library of functions to support regular expressions whose syntax +and semantics are as close as possible to those of the Perl 5 language. + + Written by Philip Hazel + Copyright (c) 1997-2005 University of Cambridge + +----------------------------------------------------------------------------- +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + * Neither the name of the University of Cambridge nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +----------------------------------------------------------------------------- +*/ + + +/* This module contains pcre_exec(), the externally visible function that does +pattern matching using an NFA algorithm, trying to mimic Perl as closely as +possible. There are also some static supporting functions. */ + + +#include "pcre_internal.h" + +// CN: Mods to pcre to make it ECMAScript edition 3 compatible are enabled when this global +// is set to true +static const bool ES3_Compatible_Behavior = true; + +/* Structure for building a chain of data that actually lives on the +stack, for holding the values of the subject pointer at the start of each +subpattern, so as to detect when an empty string has been matched by a +subpattern - to break infinite loops. When NO_RECURSE is set, these blocks +are on the heap, not on the stack. */ + +typedef struct eptrblock { + struct eptrblock *epb_prev; + const uschar *epb_saved_eptr; +} eptrblock; + +/* Flag bits for the match() function */ + +#define match_condassert 0x01 /* Called to check a condition assertion */ +#define match_isgroup 0x02 /* Set if start of bracketed group */ + +/* Non-error returns from the match() function. Error returns are externally +defined PCRE_ERROR_xxx codes, which are all negative. */ + +#define MATCH_MATCH 1 +#define MATCH_NOMATCH 0 + +/* Maximum number of ints of offset to save on the stack for recursive calls. +If the offset vector is bigger, malloc is used. This should be a multiple of 3, +because the offset vector is always a multiple of 3 long. */ + +#define REC_STACK_SAVE_MAX 30 + +/* Min and max values for the common repeats; for the maxima, 0 => infinity */ + +static const char rep_min[] = { 0, 0, 1, 1, 0, 0 }; +static const char rep_max[] = { 0, 0, 0, 0, 1, 1 }; + + + +#ifdef DEBUG +/************************************************* +* Debugging function to print chars * +*************************************************/ + +/* Print a sequence of chars in printable format, stopping at the end of the +subject if the requested. + +Arguments: + p points to characters + length number to print + is_subject TRUE if printing from within md->start_subject + md pointer to matching data block, if is_subject is TRUE + +Returns: nothing +*/ + +static void +pchars(const uschar *p, int length, BOOL is_subject, match_data *md) +{ +int c; +if (is_subject && length > md->end_subject - p) length = md->end_subject - p; +while (length-- > 0) + if (isprint(c = *(p++))) printf("%c", c); else printf("\\x%02x", c); +} +#endif + + + +/************************************************* +* Match a back-reference * +*************************************************/ + +/* If a back reference hasn't been set, the length that is passed is greater +than the number of characters left in the string, so the match fails. + +Arguments: + offset index into the offset vector + eptr points into the subject + length length to be matched + md points to match data block + ims the ims flags + +Returns: TRUE if matched +*/ + +static BOOL +match_ref(int offset, register const uschar *eptr, int length, match_data *md, + unsigned long int ims) +{ + +if (ES3_Compatible_Behavior) +{ + if (md->offset_vector[offset] == -1) // for ECMAScript compliance, undefined group references are always true + return true; // though they match 0 characters. +} + +const uschar *p = md->start_subject + md->offset_vector[offset]; + +#ifdef DEBUG +if (eptr >= md->end_subject) + printf("matching subject "); +else + { + printf("matching subject "); + pchars(eptr, length, TRUE, md); + } +printf(" against backref "); +pchars(p, length, FALSE, md); +printf("\n"); +#endif + +/* Always fail if not enough characters left */ + +if (length > md->end_subject - eptr) return FALSE; + +/* Separate the caselesss case for speed */ + +if ((ims & PCRE_CASELESS) != 0) + { + while (length-- > 0) + if (md->lcc[*p++] != md->lcc[*eptr++]) return FALSE; + } +else + { while (length-- > 0) if (*p++ != *eptr++) return FALSE; } + +return TRUE; +} + + + +/*************************************************************************** +**************************************************************************** + RECURSION IN THE match() FUNCTION + +The match() function is highly recursive. Some regular expressions can cause +it to recurse thousands of times. I was writing for Unix, so I just let it +call itself recursively. This uses the stack for saving everything that has +to be saved for a recursive call. On Unix, the stack can be large, and this +works fine. + +It turns out that on non-Unix systems there are problems with programs that +use a lot of stack. (This despite the fact that every last chip has oodles +of memory these days, and techniques for extending the stack have been known +for decades.) So.... + +There is a fudge, triggered by defining NO_RECURSE, which avoids recursive +calls by keeping local variables that need to be preserved in blocks of memory +obtained from malloc instead instead of on the stack. Macros are used to +achieve this so that the actual code doesn't look very different to what it +always used to. +**************************************************************************** +***************************************************************************/ + + +/* These versions of the macros use the stack, as normal */ + +#ifndef NO_RECURSE +#define REGISTER register +#define RMATCH(rx,ra,rb,rc,rd,re,rf,rg) rx = match(ra,rb,rc,rd,re,rf,rg) +#define RRETURN(ra) return ra +#else + + +/* These versions of the macros manage a private stack on the heap. Note +that the rd argument of RMATCH isn't actually used. It's the md argument of +match(), which never changes. */ + +#define REGISTER + +#define RMATCH(rx,ra,rb,rc,rd,re,rf,rg)\ + {\ + heapframe *newframe = (heapframe*) (pcre_stack_malloc)(sizeof(heapframe));\ + if (setjmp(frame->Xwhere) == 0)\ + {\ + newframe->Xeptr = ra;\ + newframe->Xecode = rb;\ + newframe->Xoffset_top = rc;\ + newframe->Xims = re;\ + newframe->Xeptrb = rf;\ + newframe->Xflags = rg;\ + newframe->Xprevframe = frame;\ + frame = newframe;\ + DPRINTF(("restarting from line %d\n", __LINE__));\ + goto HEAP_RECURSE;\ + }\ + else\ + {\ + DPRINTF(("longjumped back to line %d\n", __LINE__));\ + frame = md->thisframe;\ + rx = frame->Xresult;\ + }\ + } + +#define RRETURN(ra)\ + {\ + heapframe *newframe = frame;\ + frame = newframe->Xprevframe;\ + (pcre_stack_free)(newframe);\ + if (frame != NULL)\ + {\ + frame->Xresult = ra;\ + md->thisframe = frame;\ + longjmp(frame->Xwhere, 1);\ + }\ + return ra;\ + } + + +/* Structure for remembering the local variables in a private frame */ + +typedef struct heapframe { + struct heapframe *Xprevframe; + + /* Function arguments that may change */ + + const uschar *Xeptr; + const uschar *Xecode; + int Xoffset_top; + long int Xims; + eptrblock *Xeptrb; + int Xflags; + + /* Function local variables */ + + const uschar *Xcallpat; + const uschar *Xcharptr; + const uschar *Xdata; + const uschar *Xnext; + const uschar *Xpp; + const uschar *Xprev; + const uschar *Xsaved_eptr; + + recursion_info Xnew_recursive; + + BOOL Xcur_is_word; + BOOL Xcondition; + BOOL Xminimize; + BOOL Xprev_is_word; + + unsigned long int Xoriginal_ims; + +#ifdef SUPPORT_UCP + int Xprop_type; + int Xprop_fail_result; + int Xprop_category; + int Xprop_chartype; + int Xprop_othercase; + int Xprop_test_against; + int *Xprop_test_variable; +#endif + + int Xctype; + int Xfc; + int Xfi; + int Xlength; + int Xmax; + int Xmin; + int Xnumber; + int Xoffset; + int Xop; + int Xsave_capture_last; + int Xsave_offset1, Xsave_offset2, Xsave_offset3; + int Xstacksave[REC_STACK_SAVE_MAX]; + int XoffsetStackSave[REC_STACK_SAVE_MAX]; + int XsavedElems; + + eptrblock Xnewptrb; + + /* Place to pass back result, and where to jump back to */ + + int Xresult; + jmp_buf Xwhere; + + +} heapframe; + +#endif + + +/*************************************************************************** +***************************************************************************/ + + + +/************************************************* +* Match from current position * +*************************************************/ + +/* On entry ecode points to the first opcode, and eptr to the first character +in the subject string, while eptrb holds the value of eptr at the start of the +last bracketed group - used for breaking infinite loops matching zero-length +strings. This function is called recursively in many circumstances. Whenever it +returns a negative (error) response, the outer incarnation must also return the +same response. + +Performance note: It might be tempting to extract commonly used fields from the +md structure (e.g. utf8, end_subject) into individual variables to improve +performance. Tests using gcc on a SPARC disproved this; in the first case, it +made performance worse. + +Arguments: + eptr pointer in subject + ecode position in code + offset_top current top pointer + md pointer to "static" info for the match + ims current /i, /m, and /s options + eptrb pointer to chain of blocks containing eptr at start of + brackets - for testing for empty matches + flags can contain + match_condassert - this is an assertion condition + match_isgroup - this is the start of a bracketed group + +Returns: MATCH_MATCH if matched ) these values are >= 0 + MATCH_NOMATCH if failed to match ) + a negative PCRE_ERROR_xxx value if aborted by an error condition + (e.g. stopped by recursion limit) +*/ + +static int +match(REGISTER const uschar *eptr, REGISTER const uschar *ecode, + int offset_top, match_data *md, unsigned long int ims, eptrblock *eptrb, + int flags) +{ +/* These variables do not need to be preserved over recursion in this function, +so they can be ordinary variables in all cases. Mark them with "register" +because they are used a lot in loops. */ + +register int rrc; /* Returns from recursive calls */ +register int i; /* Used for loops not involving calls to RMATCH() */ +register int c; /* Character values not kept over RMATCH() calls */ +register BOOL utf8; /* Local copy of UTF-8 flag for speed */ + +/* When recursion is not being used, all "local" variables that have to be +preserved over calls to RMATCH() are part of a "frame" which is obtained from +heap storage. Set up the top-level frame here; others are obtained from the +heap whenever RMATCH() does a "recursion". See the macro definitions above. */ + +#ifdef NO_RECURSE +heapframe *frame = (heapframe*) (pcre_stack_malloc)(sizeof(heapframe)); +frame->Xprevframe = NULL; /* Marks the top level */ + +/* Copy in the original argument variables */ + +frame->Xeptr = eptr; +frame->Xecode = ecode; +frame->Xoffset_top = offset_top; +frame->Xims = ims; +frame->Xeptrb = eptrb; +frame->Xflags = flags; + +/* This is where control jumps back to to effect "recursion" */ + +HEAP_RECURSE: + +/* Macros make the argument variables come from the current frame */ + +#define eptr frame->Xeptr +#define ecode frame->Xecode +#define offset_top frame->Xoffset_top +#define ims frame->Xims +#define eptrb frame->Xeptrb +#define flags frame->Xflags + +/* Ditto for the local variables */ + +#ifdef SUPPORT_UTF8 +#define charptr frame->Xcharptr +#endif +#define callpat frame->Xcallpat +#define data frame->Xdata +#define next frame->Xnext +#define pp frame->Xpp +#define prev frame->Xprev +#define saved_eptr frame->Xsaved_eptr + +#define new_recursive frame->Xnew_recursive + +#define cur_is_word frame->Xcur_is_word +#define condition frame->Xcondition +#define minimize frame->Xminimize +#define prev_is_word frame->Xprev_is_word + +#define original_ims frame->Xoriginal_ims + +#ifdef SUPPORT_UCP +#define prop_type frame->Xprop_type +#define prop_fail_result frame->Xprop_fail_result +#define prop_category frame->Xprop_category +#define prop_chartype frame->Xprop_chartype +#define prop_othercase frame->Xprop_othercase +#define prop_test_against frame->Xprop_test_against +#define prop_test_variable frame->Xprop_test_variable +#endif + +#define ctype frame->Xctype +#define fc frame->Xfc +#define fi frame->Xfi +#define length frame->Xlength +#define max frame->Xmax +#define min frame->Xmin +#define number frame->Xnumber +#define offset frame->Xoffset +#define op frame->Xop +#define save_capture_last frame->Xsave_capture_last +#define save_offset1 frame->Xsave_offset1 +#define save_offset2 frame->Xsave_offset2 +#define save_offset3 frame->Xsave_offset3 +#define savedElems frame->XsavedElems +#define stacksave frame->Xstacksave +#define offsetStackSave frame->XoffsetStackSave + +#define newptrb frame->Xnewptrb + +/* When recursion is being used, local variables are allocated on the stack and +get preserved during recursion in the normal way. In this environment, fi and +i, and fc and c, can be the same variables. */ + +#else +#define fi i +#define fc c + + +#ifdef SUPPORT_UTF8 /* Many of these variables are used ony */ +const uschar *charptr; /* small blocks of the code. My normal */ +#endif /* style of coding would have declared */ +const uschar *callpat; /* them within each of those blocks. */ +const uschar *data; /* However, in order to accommodate the */ +const uschar *next; /* version of this code that uses an */ +const uschar *pp; /* external "stack" implemented on the */ +const uschar *prev; /* heap, it is easier to declare them */ +const uschar *saved_eptr; /* all here, so the declarations can */ + /* be cut out in a block. The only */ +recursion_info new_recursive; /* declarations within blocks below are */ + /* for variables that do not have to */ +BOOL cur_is_word; /* be preserved over a recursive call */ +BOOL condition; /* to RMATCH(). */ +BOOL minimize; +BOOL prev_is_word; + +unsigned long int original_ims; + +#ifdef SUPPORT_UCP +int prop_type; +int prop_fail_result; +int prop_category; +int prop_chartype; +int prop_othercase; +int prop_test_against; +int *prop_test_variable; +#endif + +int ctype; +int length; +int max; +int min; +int number; +int offset; +int op; +int save_capture_last; +int save_offset1, save_offset2, save_offset3; +int stacksave[REC_STACK_SAVE_MAX]; +int offsetStackSave[REC_STACK_SAVE_MAX]; +int savedElems; + +eptrblock newptrb; +#endif + +/* These statements are here to stop the compiler complaining about unitialized +variables. */ + +#ifdef SUPPORT_UCP +prop_fail_result = 0; +prop_test_against = 0; +prop_test_variable = NULL; +#endif + +/* OK, now we can get on with the real code of the function. Recursion is +specified by the macros RMATCH and RRETURN. When NO_RECURSE is *not* defined, +these just turn into a recursive call to match() and a "return", respectively. +However, RMATCH isn't like a function call because it's quite a complicated +macro. It has to be used in one particular way. This shouldn't, however, impact +performance when true recursion is being used. */ + +if (md->match_call_count++ >= md->match_limit) RRETURN(PCRE_ERROR_MATCHLIMIT); + +original_ims = ims; /* Save for resetting on ')' */ +utf8 = md->utf8; /* Local copy of the flag */ + +/* At the start of a bracketed group, add the current subject pointer to the +stack of such pointers, to be re-instated at the end of the group when we hit +the closing ket. When match() is called in other circumstances, we don't add to +this stack. */ + +if ((flags & match_isgroup) != 0) + { + newptrb.epb_prev = eptrb; + newptrb.epb_saved_eptr = eptr; + eptrb = &newptrb; + } + + +/* Now start processing the operations. */ + +for (;;) + { + op = *ecode; + minimize = FALSE; + + /* For partial matching, remember if we ever hit the end of the subject after + matching at least one subject character. */ + + if (md->partial && + eptr >= md->end_subject && + eptr > md->start_match) + md->hitend = TRUE; + + /* Opening capturing bracket. If there is space in the offset vector, save + the current subject position in the working slot at the top of the vector. We + mustn't change the current values of the data slot, because they may be set + from a previous iteration of this group, and be referred to by a reference + inside the group. + + If the bracket fails to match, we need to restore this value and also the + values of the final offsets, in case they were set by a previous iteration of + the same bracket. + + If there isn't enough space in the offset vector, treat this as if it were a + non-capturing bracket. Don't worry about setting the flag for the error case + here; that is handled in the code for KET. */ + + if (op > OP_BRA) + { + number = op - OP_BRA; + + /* For extended extraction brackets (large number), we have to fish out the + number from a dummy opcode at the start. */ + + if (number > EXTRACT_BASIC_MAX) + number = GET2(ecode, 2+LINK_SIZE); + offset = number << 1; + +#ifdef DEBUG + printf("start bracket %d subject=", number); + pchars(eptr, 16, TRUE, md); + printf("\n"); +#endif + + if (offset < md->offset_max) + { + save_offset3 = md->offset_vector[md->offset_end - number]; + save_capture_last = md->capture_last; + + if (ES3_Compatible_Behavior) // clear all matches for groups > than this one + { // (we only really need to reset all enclosed groups, but covering all groups > this is harmless because + // we interpret from left to right) + savedElems = (offset_top > offset ? offset_top - offset : 2); + memcpy(offsetStackSave, md->offset_vector+offset, (savedElems * sizeof(int))); + for(int resetOffset = offset+2; resetOffset < offset_top; resetOffset++) + md->offset_vector[resetOffset] = -1; + } + else + { + offsetStackSave[1] = md->offset_vector[offset]; + offsetStackSave[2] = md->offset_vector[offset+1]; + savedElems = 0; + } + + DPRINTF(("saving %d %d %d\n", save_offset1, save_offset2, save_offset3)); + md->offset_vector[md->offset_end - number] = eptr - md->start_subject; + + do + { + RMATCH(rrc, eptr, ecode + 1 + LINK_SIZE, offset_top, md, ims, eptrb, + match_isgroup); + if (rrc != MATCH_NOMATCH) RRETURN(rrc); + md->capture_last = save_capture_last; + ecode += GET(ecode, 1); + } + while (*ecode == OP_ALT); + + DPRINTF(("bracket %d failed\n", number)); + if (ES3_Compatible_Behavior) + { + memcpy(md->offset_vector+offset, offsetStackSave, (savedElems * sizeof(int))); + } + else + { + md->offset_vector[offset] = stacksave[1]; + md->offset_vector[offset+1] = stacksave[2]; + } + md->offset_vector[md->offset_end - number] = save_offset3; + + RRETURN(MATCH_NOMATCH); + } + + /* Insufficient room for saving captured contents */ + + else op = OP_BRA; + } + + /* Other types of node can be handled by a switch */ + + switch(op) + { + case OP_BRA: /* Non-capturing bracket: optimized */ + DPRINTF(("start bracket 0\n")); + do + { + RMATCH(rrc, eptr, ecode + 1 + LINK_SIZE, offset_top, md, ims, eptrb, + match_isgroup); + if (rrc != MATCH_NOMATCH) RRETURN(rrc); + ecode += GET(ecode, 1); + } + while (*ecode == OP_ALT); + DPRINTF(("bracket 0 failed\n")); + RRETURN(MATCH_NOMATCH); + + /* Conditional group: compilation checked that there are no more than + two branches. If the condition is false, skipping the first branch takes us + past the end if there is only one branch, but that's OK because that is + exactly what going to the ket would do. */ + + case OP_COND: + if (ecode[LINK_SIZE+1] == OP_CREF) /* Condition extract or recurse test */ + { + offset = GET2(ecode, LINK_SIZE+2) << 1; /* Doubled ref number */ + condition = (offset == CREF_RECURSE * 2)? + (md->recursive != NULL) : + (offset < offset_top && md->offset_vector[offset] >= 0); + RMATCH(rrc, eptr, ecode + (condition? + (LINK_SIZE + 4) : (LINK_SIZE + 1 + GET(ecode, 1))), + offset_top, md, ims, eptrb, match_isgroup); + RRETURN(rrc); + } + + /* The condition is an assertion. Call match() to evaluate it - setting + the final argument TRUE causes it to stop at the end of an assertion. */ + + else + { + RMATCH(rrc, eptr, ecode + 1 + LINK_SIZE, offset_top, md, ims, NULL, + match_condassert | match_isgroup); + if (rrc == MATCH_MATCH) + { + ecode += 1 + LINK_SIZE + GET(ecode, LINK_SIZE+2); + while (*ecode == OP_ALT) ecode += GET(ecode, 1); + } + else if (rrc != MATCH_NOMATCH) + { + RRETURN(rrc); /* Need braces because of following else */ + } + else ecode += GET(ecode, 1); + RMATCH(rrc, eptr, ecode + 1 + LINK_SIZE, offset_top, md, ims, eptrb, + match_isgroup); + RRETURN(rrc); + } + /* Control never reaches here */ + + /* Skip over conditional reference or large extraction number data if + encountered. */ + + case OP_CREF: + case OP_BRANUMBER: + ecode += 3; + break; + + /* End of the pattern. If we are in a recursion, we should restore the + offsets appropriately and continue from after the call. */ + + case OP_END: + if (md->recursive != NULL && md->recursive->group_num == 0) + { + recursion_info *rec = md->recursive; + DPRINTF(("Hit the end in a (?0) recursion\n")); + md->recursive = rec->prevrec; + memmove(md->offset_vector, rec->offset_save, + rec->saved_max * sizeof(int)); + md->start_match = rec->save_start; + ims = original_ims; + ecode = rec->after_call; + break; + } + + /* Otherwise, if PCRE_NOTEMPTY is set, fail if we have matched an empty + string - backtracking will then try other alternatives, if any. */ + + if (md->notempty && eptr == md->start_match) RRETURN(MATCH_NOMATCH); + md->end_match_ptr = eptr; /* Record where we ended */ + if (!ES3_Compatible_Behavior) + md->end_offset_top = offset_top; /* and how many extracts were taken */ + RRETURN(MATCH_MATCH); + + /* Change option settings */ + + case OP_OPT: + ims = ecode[1]; + ecode += 2; + DPRINTF(("ims set to %02lx\n", ims)); + break; + + /* Assertion brackets. Check the alternative branches in turn - the + matching won't pass the KET for an assertion. If any one branch matches, + the assertion is true. Lookbehind assertions have an OP_REVERSE item at the + start of each branch to move the current point backwards, so the code at + this level is identical to the lookahead case. */ + + case OP_ASSERT: + case OP_ASSERTBACK: + + do + { + RMATCH(rrc, eptr, ecode + 1 + LINK_SIZE, offset_top, md, ims, NULL, + match_isgroup); + if (rrc == MATCH_MATCH) break; + if (rrc != MATCH_NOMATCH) RRETURN(rrc); + ecode += GET(ecode, 1); + } + while (*ecode == OP_ALT); + + if (*ecode == OP_KET) RRETURN(MATCH_NOMATCH); + + /* If checking an assertion for a condition, return MATCH_MATCH. */ + + if ((flags & match_condassert) != 0) RRETURN(MATCH_MATCH); + + /* Continue from after the assertion, updating the offsets high water + mark, since extracts may have been taken during the assertion. */ + + do ecode += GET(ecode,1); while (*ecode == OP_ALT); + ecode += 1 + LINK_SIZE; + offset_top = md->end_offset_top; + continue; + + /* Negative assertion: all branches must fail to match */ + + case OP_ASSERT_NOT: + case OP_ASSERTBACK_NOT: + do + { + RMATCH(rrc, eptr, ecode + 1 + LINK_SIZE, offset_top, md, ims, NULL, + match_isgroup); + if (rrc == MATCH_MATCH) RRETURN(MATCH_NOMATCH); + if (rrc != MATCH_NOMATCH) RRETURN(rrc); + ecode += GET(ecode,1); + } + while (*ecode == OP_ALT); + + if ((flags & match_condassert) != 0) RRETURN(MATCH_MATCH); + + ecode += 1 + LINK_SIZE; + continue; + + /* Move the subject pointer back. This occurs only at the start of + each branch of a lookbehind assertion. If we are too close to the start to + move back, this match function fails. When working with UTF-8 we move + back a number of characters, not bytes. */ + + case OP_REVERSE: +#ifdef SUPPORT_UTF8 + if (utf8) + { + c = GET(ecode,1); + for (i = 0; i < c; i++) + { + eptr--; + if (eptr < md->start_subject) RRETURN(MATCH_NOMATCH); + BACKCHAR(eptr) + } + } + else +#endif + + /* No UTF-8 support, or not in UTF-8 mode: count is byte count */ + + { + eptr -= GET(ecode,1); + if (eptr < md->start_subject) RRETURN(MATCH_NOMATCH); + } + + /* Skip to next op code */ + + ecode += 1 + LINK_SIZE; + break; + + /* The callout item calls an external function, if one is provided, passing + details of the match so far. This is mainly for debugging, though the + function is able to force a failure. */ + + case OP_CALLOUT: + if (pcre_callout != NULL) + { + pcre_callout_block cb; + cb.version = 1; /* Version 1 of the callout block */ + cb.callout_number = ecode[1]; + cb.offset_vector = md->offset_vector; + cb.subject = (const char *)md->start_subject; + cb.subject_length = md->end_subject - md->start_subject; + cb.start_match = md->start_match - md->start_subject; + cb.current_position = eptr - md->start_subject; + cb.pattern_position = GET(ecode, 2); + cb.next_item_length = GET(ecode, 2 + LINK_SIZE); + cb.capture_top = offset_top/2; + cb.capture_last = md->capture_last; + cb.callout_data = md->callout_data; + if ((rrc = (*pcre_callout)(&cb)) > 0) RRETURN(MATCH_NOMATCH); + if (rrc < 0) RRETURN(rrc); + } + ecode += 2 + 2*LINK_SIZE; + break; + + /* Recursion either matches the current regex, or some subexpression. The + offset data is the offset to the starting bracket from the start of the + whole pattern. (This is so that it works from duplicated subpatterns.) + + If there are any capturing brackets started but not finished, we have to + save their starting points and reinstate them after the recursion. However, + we don't know how many such there are (offset_top records the completed + total) so we just have to save all the potential data. There may be up to + 65535 such values, which is too large to put on the stack, but using malloc + for small numbers seems expensive. As a compromise, the stack is used when + there are no more than REC_STACK_SAVE_MAX values to store; otherwise malloc + is used. A problem is what to do if the malloc fails ... there is no way of + returning to the top level with an error. Save the top REC_STACK_SAVE_MAX + values on the stack, and accept that the rest may be wrong. + + There are also other values that have to be saved. We use a chained + sequence of blocks that actually live on the stack. Thanks to Robin Houston + for the original version of this logic. */ + + case OP_RECURSE: + { + callpat = md->start_code + GET(ecode, 1); + new_recursive.group_num = *callpat - OP_BRA; + + /* For extended extraction brackets (large number), we have to fish out + the number from a dummy opcode at the start. */ + + if (new_recursive.group_num > EXTRACT_BASIC_MAX) + new_recursive.group_num = GET2(callpat, 2+LINK_SIZE); + + /* Add to "recursing stack" */ + + new_recursive.prevrec = md->recursive; + md->recursive = &new_recursive; + + /* Find where to continue from afterwards */ + + ecode += 1 + LINK_SIZE; + new_recursive.after_call = ecode; + + /* Now save the offset data. */ + + new_recursive.saved_max = md->offset_end; + if (new_recursive.saved_max <= REC_STACK_SAVE_MAX) + new_recursive.offset_save = stacksave; + else + { + new_recursive.offset_save = + (int *)(pcre_malloc)(new_recursive.saved_max * sizeof(int)); + if (new_recursive.offset_save == NULL) RRETURN(PCRE_ERROR_NOMEMORY); + } + + memcpy(new_recursive.offset_save, md->offset_vector, + new_recursive.saved_max * sizeof(int)); + new_recursive.save_start = md->start_match; + md->start_match = eptr; + + /* OK, now we can do the recursion. For each top-level alternative we + restore the offset and recursion data. */ + + DPRINTF(("Recursing into group %d\n", new_recursive.group_num)); + do + { + RMATCH(rrc, eptr, callpat + 1 + LINK_SIZE, offset_top, md, ims, + eptrb, match_isgroup); + if (rrc == MATCH_MATCH) + { + md->recursive = new_recursive.prevrec; + if (new_recursive.offset_save != stacksave) + (pcre_free)(new_recursive.offset_save); + RRETURN(MATCH_MATCH); + } + else if (rrc != MATCH_NOMATCH) RRETURN(rrc); + + md->recursive = &new_recursive; + memcpy(md->offset_vector, new_recursive.offset_save, + new_recursive.saved_max * sizeof(int)); + callpat += GET(callpat, 1); + } + while (*callpat == OP_ALT); + + DPRINTF(("Recursion didn't match\n")); + md->recursive = new_recursive.prevrec; + if (new_recursive.offset_save != stacksave) + (pcre_free)(new_recursive.offset_save); + RRETURN(MATCH_NOMATCH); + } + /* Control never reaches here */ + + /* "Once" brackets are like assertion brackets except that after a match, + the point in the subject string is not moved back. Thus there can never be + a move back into the brackets. Friedl calls these "atomic" subpatterns. + Check the alternative branches in turn - the matching won't pass the KET + for this kind of subpattern. If any one branch matches, we carry on as at + the end of a normal bracket, leaving the subject pointer. */ + + case OP_ONCE: + { + prev = ecode; + saved_eptr = eptr; + + do + { + RMATCH(rrc, eptr, ecode + 1 + LINK_SIZE, offset_top, md, ims, + eptrb, match_isgroup); + if (rrc == MATCH_MATCH) break; + if (rrc != MATCH_NOMATCH) RRETURN(rrc); + ecode += GET(ecode,1); + } + while (*ecode == OP_ALT); + + /* If hit the end of the group (which could be repeated), fail */ + + if (*ecode != OP_ONCE && *ecode != OP_ALT) RRETURN(MATCH_NOMATCH); + + /* Continue as from after the assertion, updating the offsets high water + mark, since extracts may have been taken. */ + + do ecode += GET(ecode,1); while (*ecode == OP_ALT); + + offset_top = md->end_offset_top; + eptr = md->end_match_ptr; + + /* For a non-repeating ket, just continue at this level. This also + happens for a repeating ket if no characters were matched in the group. + This is the forcible breaking of infinite loops as implemented in Perl + 5.005. If there is an options reset, it will get obeyed in the normal + course of events. */ + + if (*ecode == OP_KET || eptr == saved_eptr) + { + ecode += 1+LINK_SIZE; + break; + } + + /* The repeating kets try the rest of the pattern or restart from the + preceding bracket, in the appropriate order. We need to reset any options + that changed within the bracket before re-running it, so check the next + opcode. */ + + if (ecode[1+LINK_SIZE] == OP_OPT) + { + ims = (ims & ~PCRE_IMS) | ecode[4]; + DPRINTF(("ims set to %02lx at group repeat\n", ims)); + } + + if (*ecode == OP_KETRMIN) + { + RMATCH(rrc, eptr, ecode + 1 + LINK_SIZE, offset_top, md, ims, eptrb, 0); + if (rrc != MATCH_NOMATCH) RRETURN(rrc); + RMATCH(rrc, eptr, prev, offset_top, md, ims, eptrb, match_isgroup); + if (rrc != MATCH_NOMATCH) RRETURN(rrc); + } + else /* OP_KETRMAX */ + { + RMATCH(rrc, eptr, prev, offset_top, md, ims, eptrb, match_isgroup); + if (rrc != MATCH_NOMATCH) RRETURN(rrc); + RMATCH(rrc, eptr, ecode + 1+LINK_SIZE, offset_top, md, ims, eptrb, 0); + if (rrc != MATCH_NOMATCH) RRETURN(rrc); + } + } + RRETURN(MATCH_NOMATCH); + + /* An alternation is the end of a branch; scan along to find the end of the + bracketed group and go to there. */ + + case OP_ALT: + do ecode += GET(ecode,1); while (*ecode == OP_ALT); + break; + + /* BRAZERO and BRAMINZERO occur just before a bracket group, indicating + that it may occur zero times. It may repeat infinitely, or not at all - + i.e. it could be ()* or ()? in the pattern. Brackets with fixed upper + repeat limits are compiled as a number of copies, with the optional ones + preceded by BRAZERO or BRAMINZERO. */ + + case OP_BRAZERO: + { + next = ecode+1; + RMATCH(rrc, eptr, next, offset_top, md, ims, eptrb, match_isgroup); + if (rrc != MATCH_NOMATCH) RRETURN(rrc); + do next += GET(next,1); while (*next == OP_ALT); + ecode = next + 1+LINK_SIZE; + } + break; + + case OP_BRAMINZERO: + { + next = ecode+1; + do next += GET(next,1); while (*next == OP_ALT); + RMATCH(rrc, eptr, next + 1+LINK_SIZE, offset_top, md, ims, eptrb, + match_isgroup); + if (rrc != MATCH_NOMATCH) RRETURN(rrc); + ecode++; + } + break; + + /* End of a group, repeated or non-repeating. If we are at the end of + an assertion "group", stop matching and return MATCH_MATCH, but record the + current high water mark for use by positive assertions. Do this also + for the "once" (not-backup up) groups. */ + + case OP_KET: + case OP_KETRMIN: + case OP_KETRMAX: + { + prev = ecode - GET(ecode, 1); + saved_eptr = eptrb->epb_saved_eptr; + + /* Back up the stack of bracket start pointers. */ + + eptrb = eptrb->epb_prev; + + if (*prev == OP_ASSERT || *prev == OP_ASSERT_NOT || + *prev == OP_ASSERTBACK || *prev == OP_ASSERTBACK_NOT || + *prev == OP_ONCE) + { + md->end_match_ptr = eptr; /* For ONCE */ + if (!ES3_Compatible_Behavior) + md->end_offset_top = offset_top; + else if(*prev != OP_ONCE) + { + // clear matches in zero width negative lookaheads, see ECMA section 15.10.2.8 + bool prev_op_was_negative = (*prev == OP_ASSERT_NOT || *prev == OP_ASSERTBACK_NOT); + while(prev < ecode) { + if(*prev >= OP_BRA) { + offset = (*prev-OP_BRA)<< 1; + if (prev_op_was_negative) + { + md->offset_vector[offset] = -1; + md->offset_vector[offset+1] = -1; + } + prev += _pcre_OP_lengths[OP_BRA]; + } else + prev += _pcre_OP_lengths[*prev]; + } + // reset prev + prev = ecode - GET(ecode, 1); + } + RRETURN(MATCH_MATCH); + } + + /* In all other cases except a conditional group we have to check the + group number back at the start and if necessary complete handling an + extraction by setting the offsets and bumping the high water mark. */ + + if (*prev != OP_COND) + { + number = *prev - OP_BRA; + + /* For extended extraction brackets (large number), we have to fish out + the number from a dummy opcode at the start. */ + + if (number > EXTRACT_BASIC_MAX) number = GET2(prev, 2+LINK_SIZE); + offset = number << 1; + +#ifdef DEBUG + printf("end bracket %d", number); + printf("\n"); +#endif + + /* Test for a numbered group. This includes groups called as a result + of recursion. Note that whole-pattern recursion is coded as a recurse + into group 0, so it won't be picked up here. Instead, we catch it when + the OP_END is reached. */ + + if (number > 0) + { + md->capture_last = number; + if (offset >= md->offset_max) md->offset_overflow = TRUE; else + { + md->offset_vector[offset] = + md->offset_vector[md->offset_end - number]; + md->offset_vector[offset+1] = eptr - md->start_subject; + if (offset_top <= offset) offset_top = offset + 2; + + if (ES3_Compatible_Behavior && (offset_top > md->end_offset_top)) + md->end_offset_top = offset_top; + } + + /* Handle a recursively called group. Restore the offsets + appropriately and continue from after the call. */ + + if (md->recursive != NULL && md->recursive->group_num == number) + { + recursion_info *rec = md->recursive; + DPRINTF(("Recursion (%d) succeeded - continuing\n", number)); + md->recursive = rec->prevrec; + md->start_match = rec->save_start; + memcpy(md->offset_vector, rec->offset_save, + rec->saved_max * sizeof(int)); + ecode = rec->after_call; + ims = original_ims; + break; + } + } + } + + /* Reset the value of the ims flags, in case they got changed during + the group. */ + + ims = original_ims; + DPRINTF(("ims reset to %02lx\n", ims)); + + /* For a non-repeating ket, just continue at this level. This also + happens for a repeating ket if no characters were matched in the group. + This is the forcible breaking of infinite loops as implemented in Perl + 5.005. If there is an options reset, it will get obeyed in the normal + course of events. */ + + if (*ecode == OP_KET || eptr == saved_eptr) + { + ecode += 1 + LINK_SIZE; + break; + } + + /* The repeating kets try the rest of the pattern or restart from the + preceding bracket, in the appropriate order. */ + + if (*ecode == OP_KETRMIN) + { + RMATCH(rrc, eptr, ecode + 1+LINK_SIZE, offset_top, md, ims, eptrb, 0); + if (rrc != MATCH_NOMATCH) RRETURN(rrc); + RMATCH(rrc, eptr, prev, offset_top, md, ims, eptrb, match_isgroup); + if (rrc != MATCH_NOMATCH) RRETURN(rrc); + } + else /* OP_KETRMAX */ + { + RMATCH(rrc, eptr, prev, offset_top, md, ims, eptrb, match_isgroup); + if (rrc != MATCH_NOMATCH) RRETURN(rrc); + RMATCH(rrc, eptr, ecode + 1+LINK_SIZE, offset_top, md, ims, eptrb, 0); + if (rrc != MATCH_NOMATCH) RRETURN(rrc); + } + } + + RRETURN(MATCH_NOMATCH); + + /* Start of subject unless notbol, or after internal newline if multiline */ + + case OP_CIRC: + if (md->notbol && eptr == md->start_subject) RRETURN(MATCH_NOMATCH); + if ((ims & PCRE_MULTILINE) != 0) + { + if (eptr != md->start_subject && !isECMALineTerminator(eptr[-1])) + RRETURN(MATCH_NOMATCH); + ecode++; + break; + } + /* ... else fall through */ + + /* Start of subject assertion */ + + case OP_SOD: + if (eptr != md->start_subject) RRETURN(MATCH_NOMATCH); + ecode++; + break; + + /* Start of match assertion */ + + case OP_SOM: + if (eptr != md->start_subject + md->start_offset) RRETURN(MATCH_NOMATCH); + ecode++; + break; + + /* Assert before internal newline if multiline, or before a terminating + newline unless endonly is set, else end of subject unless noteol is set. */ + + case OP_DOLL: + if ((ims & PCRE_MULTILINE) != 0) + { + if (eptr < md->end_subject) + { if (!isECMALineTerminator(*eptr)) RRETURN(MATCH_NOMATCH); } + else + { if (md->noteol) RRETURN(MATCH_NOMATCH); } + ecode++; + break; + } + else + { + if (md->noteol) RRETURN(MATCH_NOMATCH); + if (!md->endonly) + { + if (eptr < md->end_subject - 1 || + (eptr == md->end_subject - 1 && !isECMALineTerminator(*eptr))) + RRETURN(MATCH_NOMATCH); + ecode++; + break; + } + } + /* ... else fall through */ + + /* End of subject assertion (\z) */ + + case OP_EOD: + if (eptr < md->end_subject) RRETURN(MATCH_NOMATCH); + ecode++; + break; + + /* End of subject or ending \n assertion (\Z) */ + + case OP_EODN: + { + if (eptr < md->end_subject - 1 || + (eptr == md->end_subject - 1 && !isECMALineTerminator(*eptr))) RRETURN(MATCH_NOMATCH); + ecode++; + break; + } + + /* Word boundary assertions */ + + case OP_NOT_WORD_BOUNDARY: + case OP_WORD_BOUNDARY: + { + + /* Find out if the previous and current characters are "word" characters. + It takes a bit more work in UTF-8 mode. Characters > 255 are assumed to + be "non-word" characters. */ + +#ifdef SUPPORT_UTF8 + if (utf8) + { + if (eptr == md->start_subject) prev_is_word = FALSE; else + { + const uschar *lastptr = eptr - 1; + while((*lastptr & 0xc0) == 0x80) lastptr--; + GETCHAR(c, lastptr); + prev_is_word = c < 256 && (md->ctypes[c] & ctype_word) != 0; + } + if (eptr >= md->end_subject) cur_is_word = FALSE; else + { + GETCHAR(c, eptr); + cur_is_word = c < 256 && (md->ctypes[c] & ctype_word) != 0; + } + } + else +#endif + + /* More streamlined when not in UTF-8 mode */ + + { + prev_is_word = (eptr != md->start_subject) && + ((md->ctypes[eptr[-1]] & ctype_word) != 0); + cur_is_word = (eptr < md->end_subject) && + ((md->ctypes[*eptr] & ctype_word) != 0); + } + + /* Now see if the situation is what we want */ + + if ((*ecode++ == OP_WORD_BOUNDARY)? + cur_is_word == prev_is_word : cur_is_word != prev_is_word) + RRETURN(MATCH_NOMATCH); + } + break; + + /* Match a single character type; inline for speed */ + + case OP_ANY: + { + + if ((ims & PCRE_DOTALL) == 0 && eptr < md->end_subject && isECMALineTerminator(*eptr)) + RRETURN(MATCH_NOMATCH); + if (eptr++ >= md->end_subject) RRETURN(MATCH_NOMATCH); + #ifdef SUPPORT_UTF8 + if (utf8) + while (eptr < md->end_subject && (*eptr & 0xc0) == 0x80) eptr++; + #endif + ecode++; + break; + } + + /* Match a single byte, even in UTF-8 mode. This opcode really does match + any byte, even newline, independent of the setting of PCRE_DOTALL. */ + + case OP_ANYBYTE: + if (eptr++ >= md->end_subject) RRETURN(MATCH_NOMATCH); + ecode++; + break; + + case OP_NOT_DIGIT: + if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); + GETCHARINCTEST(c, eptr); + if ( +#ifdef SUPPORT_UTF8 + c < 256 && +#endif + (md->ctypes[c] & ctype_digit) != 0 + ) + RRETURN(MATCH_NOMATCH); + ecode++; + break; + + case OP_DIGIT: + if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); + GETCHARINCTEST(c, eptr); + if ( +#ifdef SUPPORT_UTF8 + c >= 256 || +#endif + (md->ctypes[c] & ctype_digit) == 0 + ) + RRETURN(MATCH_NOMATCH); + ecode++; + break; + + case OP_NOT_WHITESPACE: + if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); + GETCHARINCTEST(c, eptr); + if (c < 256) + { + if ((md->ctypes[c] & ctype_space) != 0) + { + RRETURN(MATCH_NOMATCH); + } + } + else if (isUnicodeWhiteSpace(c) == true) + { + RRETURN(MATCH_NOMATCH); + } + ecode++; + break; + + case OP_WHITESPACE: + if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); + GETCHARINCTEST(c, eptr); + if (c < 256) + { + if ((md->ctypes[c] & ctype_space) == 0) + { + RRETURN(MATCH_NOMATCH); + } + } + else if (isUnicodeWhiteSpace(c) == false) + { + RRETURN(MATCH_NOMATCH); + } + + ecode++; + break; + + case OP_NOT_WORDCHAR: + if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); + GETCHARINCTEST(c, eptr); + if ( +#ifdef SUPPORT_UTF8 + c < 256 && +#endif + (md->ctypes[c] & ctype_word) != 0 + ) + RRETURN(MATCH_NOMATCH); + ecode++; + break; + + case OP_WORDCHAR: + if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); + GETCHARINCTEST(c, eptr); + if ( +#ifdef SUPPORT_UTF8 + c >= 256 || +#endif + (md->ctypes[c] & ctype_word) == 0 + ) + RRETURN(MATCH_NOMATCH); + ecode++; + break; + +#ifdef SUPPORT_UCP + /* Check the next character by Unicode property. We will get here only + if the support is in the binary; otherwise a compile-time error occurs. */ + + case OP_PROP: + case OP_NOTPROP: + if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); + GETCHARINCTEST(c, eptr); + { + int chartype, rqdtype; + int othercase; + int category = _pcre_ucp_findchar(c, &chartype, &othercase); + + rqdtype = *(++ecode); + ecode++; + + if (rqdtype >= 128) + { + if ((rqdtype - 128 != category) == (op == OP_PROP)) + RRETURN(MATCH_NOMATCH); + } + else + { + if ((rqdtype != chartype) == (op == OP_PROP)) + RRETURN(MATCH_NOMATCH); + } + } + break; + + /* Match an extended Unicode sequence. We will get here only if the support + is in the binary; otherwise a compile-time error occurs. */ + + case OP_EXTUNI: + if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); + GETCHARINCTEST(c, eptr); + { + int chartype; + int othercase; + int category = _pcre_ucp_findchar(c, &chartype, &othercase); + if (category == ucp_M) RRETURN(MATCH_NOMATCH); + while (eptr < md->end_subject) + { + int len = 1; + if (!utf8) c = *eptr; else + { + GETCHARLEN(c, eptr, len); + } + category = _pcre_ucp_findchar(c, &chartype, &othercase); + if (category != ucp_M) break; + eptr += len; + } + } + ecode++; + break; +#endif + + + /* Match a back reference, possibly repeatedly. Look past the end of the + item to see if there is repeat information following. The code is similar + to that for character classes, but repeated for efficiency. Then obey + similar code to character type repeats - written out again for speed. + However, if the referenced string is the empty string, always treat + it as matched, any number of times (otherwise there could be infinite + loops). */ + + case OP_REF: + { + offset = GET2(ecode, 1) << 1; /* Doubled ref number */ + ecode += 3; /* Advance past item */ + + /* If the reference is unset, set the length to be longer than the amount + of subject left; this ensures that every attempt at a match fails. We + can't just fail here, because of the possibility of quantifiers with zero + minima. */ + + if (ES3_Compatible_Behavior && md->offset_vector[offset] < 0) + length = 0; + else + length = (offset >= offset_top || md->offset_vector[offset] < 0)? + md->end_subject - eptr + 1 : + md->offset_vector[offset+1] - md->offset_vector[offset]; + + /* Set up for repetition, or handle the non-repeated case */ + + switch (*ecode) + { + case OP_CRSTAR: + case OP_CRMINSTAR: + case OP_CRPLUS: + case OP_CRMINPLUS: + case OP_CRQUERY: + case OP_CRMINQUERY: + c = *ecode++ - OP_CRSTAR; + minimize = (c & 1) != 0; + min = rep_min[c]; /* Pick up values from tables; */ + max = rep_max[c]; /* zero for max => infinity */ + if (max == 0) max = INT_MAX; + break; + + case OP_CRRANGE: + case OP_CRMINRANGE: + minimize = (*ecode == OP_CRMINRANGE); + min = GET2(ecode, 1); + max = GET2(ecode, 3); + if (max == 0) max = INT_MAX; + ecode += 5; + break; + + default: /* No repeat follows */ + if (!match_ref(offset, eptr, length, md, ims)) RRETURN(MATCH_NOMATCH); + eptr += length; + continue; /* With the main loop */ + } + + /* If the length of the reference is zero, just continue with the + main loop. */ + + if (length == 0) continue; + + /* First, ensure the minimum number of matches are present. We get back + the length of the reference string explicitly rather than passing the + address of eptr, so that eptr can be a register variable. */ + + for (i = 1; i <= min; i++) + { + if (!match_ref(offset, eptr, length, md, ims)) RRETURN(MATCH_NOMATCH); + eptr += length; + } + + /* If min = max, continue at the same level without recursion. + They are not both allowed to be zero. */ + + if (min == max) continue; + + /* If minimizing, keep trying and advancing the pointer */ + + if (minimize) + { + for (fi = min;; fi++) + { + RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0); + if (rrc != MATCH_NOMATCH) RRETURN(rrc); + if (fi >= max || !match_ref(offset, eptr, length, md, ims)) + RRETURN(MATCH_NOMATCH); + eptr += length; + } + /* Control never gets here */ + } + + /* If maximizing, find the longest string and work backwards */ + + else + { + pp = eptr; + for (i = min; i < max; i++) + { + if (!match_ref(offset, eptr, length, md, ims)) break; + eptr += length; + } + while (eptr >= pp) + { + RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0); + if (rrc != MATCH_NOMATCH) RRETURN(rrc); + eptr -= length; + } + RRETURN(MATCH_NOMATCH); + } + } + /* Control never gets here */ + + + + /* Match a bit-mapped character class, possibly repeatedly. This op code is + used when all the characters in the class have values in the range 0-255, + and either the matching is caseful, or the characters are in the range + 0-127 when UTF-8 processing is enabled. The only difference between + OP_CLASS and OP_NCLASS occurs when a data character outside the range is + encountered. + + First, look past the end of the item to see if there is repeat information + following. Then obey similar code to character type repeats - written out + again for speed. */ + + case OP_NCLASS: + case OP_CLASS: + { + data = ecode + 1; /* Save for matching */ + ecode += 33; /* Advance past the item */ + + switch (*ecode) + { + case OP_CRSTAR: + case OP_CRMINSTAR: + case OP_CRPLUS: + case OP_CRMINPLUS: + case OP_CRQUERY: + case OP_CRMINQUERY: + c = *ecode++ - OP_CRSTAR; + minimize = (c & 1) != 0; + min = rep_min[c]; /* Pick up values from tables; */ + max = rep_max[c]; /* zero for max => infinity */ + if (max == 0) max = INT_MAX; + break; + + case OP_CRRANGE: + case OP_CRMINRANGE: + minimize = (*ecode == OP_CRMINRANGE); + min = GET2(ecode, 1); + max = GET2(ecode, 3); + if (max == 0) max = INT_MAX; + ecode += 5; + break; + + default: /* No repeat follows */ + min = max = 1; + break; + } + + /* First, ensure the minimum number of matches are present. */ + +#ifdef SUPPORT_UTF8 + /* UTF-8 mode */ + if (utf8) + { + for (i = 1; i <= min; i++) + { + if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); + GETCHARINC(c, eptr); + if (c > 255) + { + if (op == OP_CLASS) RRETURN(MATCH_NOMATCH); + } + else + { + if ((data[c/8] & (1 << (c&7))) == 0) RRETURN(MATCH_NOMATCH); + } + } + } + else +#endif + /* Not UTF-8 mode */ + { + for (i = 1; i <= min; i++) + { + if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); + c = *eptr++; + if ((data[c/8] & (1 << (c&7))) == 0) RRETURN(MATCH_NOMATCH); + } + } + + /* If max == min we can continue with the main loop without the + need to recurse. */ + + if (min == max) continue; + + /* If minimizing, keep testing the rest of the expression and advancing + the pointer while it matches the class. */ + + if (minimize) + { +#ifdef SUPPORT_UTF8 + /* UTF-8 mode */ + if (utf8) + { + for (fi = min;; fi++) + { + RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0); + if (rrc != MATCH_NOMATCH) RRETURN(rrc); + if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); + GETCHARINC(c, eptr); + if (c > 255) + { + if (op == OP_CLASS) RRETURN(MATCH_NOMATCH); + } + else + { + if ((data[c/8] & (1 << (c&7))) == 0) RRETURN(MATCH_NOMATCH); + } + } + } + else +#endif + /* Not UTF-8 mode */ + { + for (fi = min;; fi++) + { + RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0); + if (rrc != MATCH_NOMATCH) RRETURN(rrc); + if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); + c = *eptr++; + if ((data[c/8] & (1 << (c&7))) == 0) RRETURN(MATCH_NOMATCH); + } + } + /* Control never gets here */ + } + + /* If maximizing, find the longest possible run, then work backwards. */ + + else + { + pp = eptr; + +#ifdef SUPPORT_UTF8 + /* UTF-8 mode */ + if (utf8) + { + for (i = min; i < max; i++) + { + int len = 1; + if (eptr >= md->end_subject) break; + GETCHARLEN(c, eptr, len); + if (c > 255) + { + if (op == OP_CLASS) break; + } + else + { + if ((data[c/8] & (1 << (c&7))) == 0) break; + } + eptr += len; + } + for (;;) + { + RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0); + if (rrc != MATCH_NOMATCH) RRETURN(rrc); + if (eptr-- == pp) break; /* Stop if tried at original pos */ + BACKCHAR(eptr); + } + } + else +#endif + /* Not UTF-8 mode */ + { + for (i = min; i < max; i++) + { + if (eptr >= md->end_subject) break; + c = *eptr; + if ((data[c/8] & (1 << (c&7))) == 0) break; + eptr++; + } + while (eptr >= pp) + { + RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0); + eptr--; + if (rrc != MATCH_NOMATCH) RRETURN(rrc); + } + } + + RRETURN(MATCH_NOMATCH); + } + } + /* Control never gets here */ + + + /* Match an extended character class. This opcode is encountered only + in UTF-8 mode, because that's the only time it is compiled. */ + +#ifdef SUPPORT_UTF8 + case OP_XCLASS: + { + data = ecode + 1 + LINK_SIZE; /* Save for matching */ + ecode += GET(ecode, 1); /* Advance past the item */ + + switch (*ecode) + { + case OP_CRSTAR: + case OP_CRMINSTAR: + case OP_CRPLUS: + case OP_CRMINPLUS: + case OP_CRQUERY: + case OP_CRMINQUERY: + c = *ecode++ - OP_CRSTAR; + minimize = (c & 1) != 0; + min = rep_min[c]; /* Pick up values from tables; */ + max = rep_max[c]; /* zero for max => infinity */ + if (max == 0) max = INT_MAX; + break; + + case OP_CRRANGE: + case OP_CRMINRANGE: + minimize = (*ecode == OP_CRMINRANGE); + min = GET2(ecode, 1); + max = GET2(ecode, 3); + if (max == 0) max = INT_MAX; + ecode += 5; + break; + + default: /* No repeat follows */ + min = max = 1; + break; + } + + /* First, ensure the minimum number of matches are present. */ + + for (i = 1; i <= min; i++) + { + if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); + GETCHARINC(c, eptr); + if (!_pcre_xclass(c, data)) RRETURN(MATCH_NOMATCH); + } + + /* If max == min we can continue with the main loop without the + need to recurse. */ + + if (min == max) continue; + + /* If minimizing, keep testing the rest of the expression and advancing + the pointer while it matches the class. */ + + if (minimize) + { + for (fi = min;; fi++) + { + RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0); + if (rrc != MATCH_NOMATCH) RRETURN(rrc); + if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); + GETCHARINC(c, eptr); + if (!_pcre_xclass(c, data)) RRETURN(MATCH_NOMATCH); + } + /* Control never gets here */ + } + + /* If maximizing, find the longest possible run, then work backwards. */ + + else + { + pp = eptr; + for (i = min; i < max; i++) + { + int len = 1; + if (eptr >= md->end_subject) break; + GETCHARLEN(c, eptr, len); + if (!_pcre_xclass(c, data)) break; + eptr += len; + } + for(;;) + { + RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0); + if (rrc != MATCH_NOMATCH) RRETURN(rrc); + if (eptr-- == pp) break; /* Stop if tried at original pos */ + BACKCHAR(eptr) + } + RRETURN(MATCH_NOMATCH); + } + + /* Control never gets here */ + } +#endif /* End of XCLASS */ + + /* Match a single character, casefully */ + + case OP_CHAR: +#ifdef SUPPORT_UTF8 + if (utf8) + { + length = 1; + ecode++; + GETCHARLEN(fc, ecode, length); + if (length > md->end_subject - eptr) RRETURN(MATCH_NOMATCH); + while (length-- > 0) if (*ecode++ != *eptr++) RRETURN(MATCH_NOMATCH); + } + else +#endif + + /* Non-UTF-8 mode */ + { + if (md->end_subject - eptr < 1) RRETURN(MATCH_NOMATCH); + if (ecode[1] != *eptr++) RRETURN(MATCH_NOMATCH); + ecode += 2; + } + break; + + /* Match a single character, caselessly */ + + case OP_CHARNC: +#ifdef SUPPORT_UTF8 + if (utf8) + { + length = 1; + ecode++; + GETCHARLEN(fc, ecode, length); + + if (length > md->end_subject - eptr) RRETURN(MATCH_NOMATCH); + + /* If the pattern character's value is < 128, we have only one byte, and + can use the fast lookup table. */ + + if (fc < 128) + { + if (md->lcc[*ecode++] != md->lcc[*eptr++]) RRETURN(MATCH_NOMATCH); + } + + /* Otherwise we must pick up the subject character */ + + else + { + int dc; + GETCHARINC(dc, eptr); + ecode += length; + + /* If we have Unicode property support, we can use it to test the other + case of the character, if there is one. The result of _pcre_ucp_findchar() is + < 0 if the char isn't found, and othercase is returned as zero if there + isn't one. */ + + if (fc != dc) + { +#ifdef SUPPORT_UCP + int chartype; + int othercase; + if (_pcre_ucp_findchar(fc, &chartype, &othercase) < 0 || dc != othercase) +#endif + RRETURN(MATCH_NOMATCH); + } + } + } + else +#endif /* SUPPORT_UTF8 */ + + /* Non-UTF-8 mode */ + { + if (md->end_subject - eptr < 1) RRETURN(MATCH_NOMATCH); + if (md->lcc[ecode[1]] != md->lcc[*eptr++]) RRETURN(MATCH_NOMATCH); + ecode += 2; + } + break; + + /* Match a single character repeatedly; different opcodes share code. */ + + case OP_EXACT: + min = max = GET2(ecode, 1); + ecode += 3; + goto REPEATCHAR; + + case OP_UPTO: + case OP_MINUPTO: + min = 0; + max = GET2(ecode, 1); + minimize = *ecode == OP_MINUPTO; + ecode += 3; + goto REPEATCHAR; + + case OP_STAR: + case OP_MINSTAR: + case OP_PLUS: + case OP_MINPLUS: + case OP_QUERY: + case OP_MINQUERY: + c = *ecode++ - OP_STAR; + minimize = (c & 1) != 0; + min = rep_min[c]; /* Pick up values from tables; */ + max = rep_max[c]; /* zero for max => infinity */ + if (max == 0) max = INT_MAX; + + /* Common code for all repeated single-character matches. We can give + up quickly if there are fewer than the minimum number of characters left in + the subject. */ + + REPEATCHAR: +#ifdef SUPPORT_UTF8 + if (utf8) + { + length = 1; + charptr = ecode; + GETCHARLEN(fc, ecode, length); + if (min * length > md->end_subject - eptr) RRETURN(MATCH_NOMATCH); + ecode += length; + + /* Handle multibyte character matching specially here. There is + support for caseless matching if UCP support is present. */ + + if (length > 1) + { + int oclength = 0; + uschar occhars[8]; + +#ifdef SUPPORT_UCP + int othercase; + int chartype; + if ((ims & PCRE_CASELESS) != 0 && + _pcre_ucp_findchar(fc, &chartype, &othercase) >= 0 && + othercase > 0) + oclength = _pcre_ord2utf8(othercase, occhars); +#endif /* SUPPORT_UCP */ + + for (i = 1; i <= min; i++) + { + if (memcmp(eptr, charptr, length) == 0) eptr += length; + /* Need braces because of following else */ + else if (oclength == 0) { RRETURN(MATCH_NOMATCH); } + else + { + if (memcmp(eptr, occhars, oclength) != 0) RRETURN(MATCH_NOMATCH); + eptr += oclength; + } + } + + if (min == max) continue; + + if (minimize) + { + for (fi = min;; fi++) + { + RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0); + if (rrc != MATCH_NOMATCH) RRETURN(rrc); + if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); + if (memcmp(eptr, charptr, length) == 0) eptr += length; + /* Need braces because of following else */ + else if (oclength == 0) { RRETURN(MATCH_NOMATCH); } + else + { + if (memcmp(eptr, occhars, oclength) != 0) RRETURN(MATCH_NOMATCH); + eptr += oclength; + } + } + /* Control never gets here */ + } + else + { + pp = eptr; + for (i = min; i < max; i++) + { + if (eptr > md->end_subject - length) break; + if (memcmp(eptr, charptr, length) == 0) eptr += length; + else if (oclength == 0) break; + else + { + if (memcmp(eptr, occhars, oclength) != 0) break; + eptr += oclength; + } + } + while (eptr >= pp) + { + RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0); + if (rrc != MATCH_NOMATCH) RRETURN(rrc); + eptr -= length; + } + RRETURN(MATCH_NOMATCH); + } + /* Control never gets here */ + } + + /* If the length of a UTF-8 character is 1, we fall through here, and + obey the code as for non-UTF-8 characters below, though in this case the + value of fc will always be < 128. */ + } + else +#endif /* SUPPORT_UTF8 */ + + /* When not in UTF-8 mode, load a single-byte character. */ + { + if (min > md->end_subject - eptr) RRETURN(MATCH_NOMATCH); + fc = *ecode++; + } + + /* The value of fc at this point is always less than 256, though we may or + may not be in UTF-8 mode. The code is duplicated for the caseless and + caseful cases, for speed, since matching characters is likely to be quite + common. First, ensure the minimum number of matches are present. If min = + max, continue at the same level without recursing. Otherwise, if + minimizing, keep trying the rest of the expression and advancing one + matching character if failing, up to the maximum. Alternatively, if + maximizing, find the maximum number of characters and work backwards. */ + + DPRINTF(("matching %c{%d,%d} against subject %.*s\n", fc, min, max, + max, eptr)); + + if ((ims & PCRE_CASELESS) != 0) + { + fc = md->lcc[fc]; + for (i = 1; i <= min; i++) + if (fc != md->lcc[*eptr++]) RRETURN(MATCH_NOMATCH); + if (min == max) continue; + if (minimize) + { + for (fi = min;; fi++) + { + RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0); + if (rrc != MATCH_NOMATCH) RRETURN(rrc); + if (fi >= max || eptr >= md->end_subject || + fc != md->lcc[*eptr++]) + RRETURN(MATCH_NOMATCH); + } + /* Control never gets here */ + } + else + { + pp = eptr; + for (i = min; i < max; i++) + { + if (eptr >= md->end_subject || fc != md->lcc[*eptr]) break; + eptr++; + } + while (eptr >= pp) + { + RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0); + eptr--; + if (rrc != MATCH_NOMATCH) RRETURN(rrc); + } + RRETURN(MATCH_NOMATCH); + } + /* Control never gets here */ + } + + /* Caseful comparisons (includes all multi-byte characters) */ + + else + { + for (i = 1; i <= min; i++) if (fc != *eptr++) RRETURN(MATCH_NOMATCH); + if (min == max) continue; + if (minimize) + { + for (fi = min;; fi++) + { + RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0); + if (rrc != MATCH_NOMATCH) RRETURN(rrc); + if (fi >= max || eptr >= md->end_subject || fc != *eptr++) + RRETURN(MATCH_NOMATCH); + } + /* Control never gets here */ + } + else + { + pp = eptr; + for (i = min; i < max; i++) + { + if (eptr >= md->end_subject || fc != *eptr) break; + eptr++; + } + while (eptr >= pp) + { + RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0); + eptr--; + if (rrc != MATCH_NOMATCH) RRETURN(rrc); + } + RRETURN(MATCH_NOMATCH); + } + } + /* Control never gets here */ + + /* Match a negated single one-byte character. The character we are + checking can be multibyte. */ + + case OP_NOT: + if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); + ecode++; + GETCHARINCTEST(c, eptr); + if ((ims & PCRE_CASELESS) != 0) + { +#ifdef SUPPORT_UTF8 + if (c < 256) +#endif + c = md->lcc[c]; + if (md->lcc[*ecode++] == c) RRETURN(MATCH_NOMATCH); + } + else + { + if (*ecode++ == c) RRETURN(MATCH_NOMATCH); + } + break; + + /* Match a negated single one-byte character repeatedly. This is almost a + repeat of the code for a repeated single character, but I haven't found a + nice way of commoning these up that doesn't require a test of the + positive/negative option for each character match. Maybe that wouldn't add + very much to the time taken, but character matching *is* what this is all + about... */ + + case OP_NOTEXACT: + min = max = GET2(ecode, 1); + ecode += 3; + goto REPEATNOTCHAR; + + case OP_NOTUPTO: + case OP_NOTMINUPTO: + min = 0; + max = GET2(ecode, 1); + minimize = *ecode == OP_NOTMINUPTO; + ecode += 3; + goto REPEATNOTCHAR; + + case OP_NOTSTAR: + case OP_NOTMINSTAR: + case OP_NOTPLUS: + case OP_NOTMINPLUS: + case OP_NOTQUERY: + case OP_NOTMINQUERY: + c = *ecode++ - OP_NOTSTAR; + minimize = (c & 1) != 0; + min = rep_min[c]; /* Pick up values from tables; */ + max = rep_max[c]; /* zero for max => infinity */ + if (max == 0) max = INT_MAX; + + /* Common code for all repeated single-byte matches. We can give up quickly + if there are fewer than the minimum number of bytes left in the + subject. */ + + REPEATNOTCHAR: + if (min > md->end_subject - eptr) RRETURN(MATCH_NOMATCH); + fc = *ecode++; + + /* The code is duplicated for the caseless and caseful cases, for speed, + since matching characters is likely to be quite common. First, ensure the + minimum number of matches are present. If min = max, continue at the same + level without recursing. Otherwise, if minimizing, keep trying the rest of + the expression and advancing one matching character if failing, up to the + maximum. Alternatively, if maximizing, find the maximum number of + characters and work backwards. */ + + DPRINTF(("negative matching %c{%d,%d} against subject %.*s\n", fc, min, max, + max, eptr)); + + if ((ims & PCRE_CASELESS) != 0) + { + fc = md->lcc[fc]; + +#ifdef SUPPORT_UTF8 + /* UTF-8 mode */ + if (utf8) + { + register int d; + for (i = 1; i <= min; i++) + { + GETCHARINC(d, eptr); + if (d < 256) d = md->lcc[d]; + if (fc == d) RRETURN(MATCH_NOMATCH); + } + } + else +#endif + + /* Not UTF-8 mode */ + { + for (i = 1; i <= min; i++) + if (fc == md->lcc[*eptr++]) RRETURN(MATCH_NOMATCH); + } + + if (min == max) continue; + + if (minimize) + { +#ifdef SUPPORT_UTF8 + /* UTF-8 mode */ + if (utf8) + { + register int d; + for (fi = min;; fi++) + { + RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0); + if (rrc != MATCH_NOMATCH) RRETURN(rrc); + GETCHARINC(d, eptr); + if (d < 256) d = md->lcc[d]; + if (fi >= max || eptr >= md->end_subject || fc == d) + RRETURN(MATCH_NOMATCH); + } + } + else +#endif + /* Not UTF-8 mode */ + { + for (fi = min;; fi++) + { + RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0); + if (rrc != MATCH_NOMATCH) RRETURN(rrc); + if (fi >= max || eptr >= md->end_subject || fc == md->lcc[*eptr++]) + RRETURN(MATCH_NOMATCH); + } + } + /* Control never gets here */ + } + + /* Maximize case */ + + else + { + pp = eptr; + +#ifdef SUPPORT_UTF8 + /* UTF-8 mode */ + if (utf8) + { + register int d; + for (i = min; i < max; i++) + { + int len = 1; + if (eptr >= md->end_subject) break; + GETCHARLEN(d, eptr, len); + if (d < 256) d = md->lcc[d]; + if (fc == d) break; + eptr += len; + } + for(;;) + { + RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0); + if (rrc != MATCH_NOMATCH) RRETURN(rrc); + if (eptr-- == pp) break; /* Stop if tried at original pos */ + BACKCHAR(eptr); + } + } + else +#endif + /* Not UTF-8 mode */ + { + for (i = min; i < max; i++) + { + if (eptr >= md->end_subject || fc == md->lcc[*eptr]) break; + eptr++; + } + while (eptr >= pp) + { + RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0); + if (rrc != MATCH_NOMATCH) RRETURN(rrc); + eptr--; + } + } + + RRETURN(MATCH_NOMATCH); + } + /* Control never gets here */ + } + + /* Caseful comparisons */ + + else + { +#ifdef SUPPORT_UTF8 + /* UTF-8 mode */ + if (utf8) + { + register int d; + for (i = 1; i <= min; i++) + { + GETCHARINC(d, eptr); + if (fc == d) RRETURN(MATCH_NOMATCH); + } + } + else +#endif + /* Not UTF-8 mode */ + { + for (i = 1; i <= min; i++) + if (fc == *eptr++) RRETURN(MATCH_NOMATCH); + } + + if (min == max) continue; + + if (minimize) + { +#ifdef SUPPORT_UTF8 + /* UTF-8 mode */ + if (utf8) + { + register int d; + for (fi = min;; fi++) + { + RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0); + if (rrc != MATCH_NOMATCH) RRETURN(rrc); + GETCHARINC(d, eptr); + if (fi >= max || eptr >= md->end_subject || fc == d) + RRETURN(MATCH_NOMATCH); + } + } + else +#endif + /* Not UTF-8 mode */ + { + for (fi = min;; fi++) + { + RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0); + if (rrc != MATCH_NOMATCH) RRETURN(rrc); + if (fi >= max || eptr >= md->end_subject || fc == *eptr++) + RRETURN(MATCH_NOMATCH); + } + } + /* Control never gets here */ + } + + /* Maximize case */ + + else + { + pp = eptr; + +#ifdef SUPPORT_UTF8 + /* UTF-8 mode */ + if (utf8) + { + register int d; + for (i = min; i < max; i++) + { + int len = 1; + if (eptr >= md->end_subject) break; + GETCHARLEN(d, eptr, len); + if (fc == d) break; + eptr += len; + } + for(;;) + { + RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0); + if (rrc != MATCH_NOMATCH) RRETURN(rrc); + if (eptr-- == pp) break; /* Stop if tried at original pos */ + BACKCHAR(eptr); + } + } + else +#endif + /* Not UTF-8 mode */ + { + for (i = min; i < max; i++) + { + if (eptr >= md->end_subject || fc == *eptr) break; + eptr++; + } + while (eptr >= pp) + { + RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0); + if (rrc != MATCH_NOMATCH) RRETURN(rrc); + eptr--; + } + } + + RRETURN(MATCH_NOMATCH); + } + } + /* Control never gets here */ + + /* Match a single character type repeatedly; several different opcodes + share code. This is very similar to the code for single characters, but we + repeat it in the interests of efficiency. */ + + case OP_TYPEEXACT: + min = max = GET2(ecode, 1); + minimize = TRUE; + ecode += 3; + goto REPEATTYPE; + + case OP_TYPEUPTO: + case OP_TYPEMINUPTO: + min = 0; + max = GET2(ecode, 1); + minimize = *ecode == OP_TYPEMINUPTO; + ecode += 3; + goto REPEATTYPE; + + case OP_TYPESTAR: + case OP_TYPEMINSTAR: + case OP_TYPEPLUS: + case OP_TYPEMINPLUS: + case OP_TYPEQUERY: + case OP_TYPEMINQUERY: + c = *ecode++ - OP_TYPESTAR; + minimize = (c & 1) != 0; + min = rep_min[c]; /* Pick up values from tables; */ + max = rep_max[c]; /* zero for max => infinity */ + if (max == 0) max = INT_MAX; + + /* Common code for all repeated single character type matches. Note that + in UTF-8 mode, '.' matches a character of any length, but for the other + character types, the valid characters are all one-byte long. */ + + REPEATTYPE: + ctype = *ecode++; /* Code for the character type */ + +#ifdef SUPPORT_UCP + if (ctype == OP_PROP || ctype == OP_NOTPROP) + { + prop_fail_result = ctype == OP_NOTPROP; + prop_type = *ecode++; + if (prop_type >= 128) + { + prop_test_against = prop_type - 128; + prop_test_variable = &prop_category; + } + else + { + prop_test_against = prop_type; + prop_test_variable = &prop_chartype; + } + } + else prop_type = -1; +#endif + + /* First, ensure the minimum number of matches are present. Use inline + code for maximizing the speed, and do the type test once at the start + (i.e. keep it out of the loop). Also we can test that there are at least + the minimum number of bytes before we start. This isn't as effective in + UTF-8 mode, but it does no harm. Separate the UTF-8 code completely as that + is tidier. Also separate the UCP code, which can be the same for both UTF-8 + and single-bytes. */ + + if (min > md->end_subject - eptr) RRETURN(MATCH_NOMATCH); + if (min > 0) + { +#ifdef SUPPORT_UCP + if (prop_type > 0) + { + for (i = 1; i <= min; i++) + { + GETCHARINC(c, eptr); + prop_category = _pcre_ucp_findchar(c, &prop_chartype, &prop_othercase); + if ((*prop_test_variable == prop_test_against) == prop_fail_result) + RRETURN(MATCH_NOMATCH); + } + } + + /* Match extended Unicode sequences. We will get here only if the + support is in the binary; otherwise a compile-time error occurs. */ + + else if (ctype == OP_EXTUNI) + { + for (i = 1; i <= min; i++) + { + GETCHARINCTEST(c, eptr); + prop_category = _pcre_ucp_findchar(c, &prop_chartype, &prop_othercase); + if (prop_category == ucp_M) RRETURN(MATCH_NOMATCH); + while (eptr < md->end_subject) + { + int len = 1; + if (!utf8) c = *eptr; else + { + GETCHARLEN(c, eptr, len); + } + prop_category = _pcre_ucp_findchar(c, &prop_chartype, &prop_othercase); + if (prop_category != ucp_M) break; + eptr += len; + } + } + } + + else +#endif /* SUPPORT_UCP */ + +/* Handle all other cases when the coding is UTF-8 */ + +#ifdef SUPPORT_UTF8 + if (utf8) switch(ctype) + { + case OP_ANY: + for (i = 1; i <= min; i++) + { + /* cn start code added for ECMA compliance */ + if (eptr >= md->end_subject) + RRETURN(MATCH_NOMATCH); + + int d; + GETCHARINC(d, eptr); + + if (isECMALineTerminator(d) && (ims & PCRE_DOTALL) == 0) + RRETURN(MATCH_NOMATCH); + /* cn end code added for ECMA compliance */ + // cn: original code + //if (eptr >= md->end_subject || + // (*eptr++ == NEWLINE && (ims & PCRE_DOTALL) == 0)) + // RRETURN(MATCH_NOMATCH); + while (eptr < md->end_subject && (*eptr & 0xc0) == 0x80) eptr++; + } + break; + + case OP_ANYBYTE: + eptr += min; + break; + + case OP_NOT_DIGIT: + for (i = 1; i <= min; i++) + { + if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); + GETCHARINC(c, eptr); + if (c < 128 && (md->ctypes[c] & ctype_digit) != 0) + RRETURN(MATCH_NOMATCH); + } + break; + + case OP_DIGIT: + for (i = 1; i <= min; i++) + { + if (eptr >= md->end_subject || + *eptr >= 128 || (md->ctypes[*eptr++] & ctype_digit) == 0) + RRETURN(MATCH_NOMATCH); + /* No need to skip more bytes - we know it's a 1-byte character */ + } + break; + + case OP_NOT_WHITESPACE: + for (i = 1; i <= min; i++) + { + if (eptr >= md->end_subject) + RRETURN(MATCH_NOMATCH); + if (*eptr < 128) + { + if ((md->ctypes[*eptr++] & ctype_space) != 0) + RRETURN(MATCH_NOMATCH); + } + else + { + int d; + GETCHARINC(d, eptr); + if (isUnicodeWhiteSpace(d) == true) + { + RRETURN(MATCH_NOMATCH); + } + } + while (eptr < md->end_subject && (*eptr & 0xc0) == 0x80) eptr++; + } + break; + + case OP_WHITESPACE: + for (i = 1; i <= min; i++) + { + if (eptr >= md->end_subject) + { + RRETURN(MATCH_NOMATCH); + } + if (*eptr < 128) + { + if ((md->ctypes[*eptr++] & ctype_space) == 0) + RRETURN(MATCH_NOMATCH); + } + else + { + int d; + GETCHARINC(d, eptr); + if (isUnicodeWhiteSpace(d) == false) + { + RRETURN(MATCH_NOMATCH); + } + } + } + break; + + case OP_NOT_WORDCHAR: + for (i = 1; i <= min; i++) + { + if (eptr >= md->end_subject || + (*eptr < 128 && (md->ctypes[*eptr++] & ctype_word) != 0)) + RRETURN(MATCH_NOMATCH); + while (eptr < md->end_subject && (*eptr & 0xc0) == 0x80) eptr++; + } + break; + + case OP_WORDCHAR: + for (i = 1; i <= min; i++) + { + if (eptr >= md->end_subject || + *eptr >= 128 || (md->ctypes[*eptr++] & ctype_word) == 0) + RRETURN(MATCH_NOMATCH); + /* No need to skip more bytes - we know it's a 1-byte character */ + } + break; + + default: + RRETURN(PCRE_ERROR_INTERNAL); + } /* End switch(ctype) */ + + else +#endif /* SUPPORT_UTF8 */ + + /* Code for the non-UTF-8 case for minimum matching of operators other + than OP_PROP and OP_NOTPROP. */ + + switch(ctype) + { + case OP_ANY: + if ((ims & PCRE_DOTALL) == 0) + { + for (i = 1; i <= min; i++) + { + int d; + GETCHARINC(d, eptr); + if (isECMALineTerminator(d)) RRETURN(MATCH_NOMATCH); + //if (*eptr++ == NEWLINE) RRETURN(MATCH_NOMATCH); + } + } + else eptr += min; + break; + + case OP_ANYBYTE: + eptr += min; + break; + + case OP_NOT_DIGIT: + for (i = 1; i <= min; i++) + if ((md->ctypes[*eptr++] & ctype_digit) != 0) RRETURN(MATCH_NOMATCH); + break; + + case OP_DIGIT: + for (i = 1; i <= min; i++) + if ((md->ctypes[*eptr++] & ctype_digit) == 0) RRETURN(MATCH_NOMATCH); + break; + + case OP_NOT_WHITESPACE: // cn: no need for isUnicodeWhiteSpace() checks, this is the non-utf8 #ifdef'd code + for (i = 1; i <= min; i++) + if ((md->ctypes[*eptr++] & ctype_space) != 0) RRETURN(MATCH_NOMATCH); + break; + + case OP_WHITESPACE: // cn: no need for isUnicodeWhiteSpace() checks, this is the non-utf8 #ifdef'd code + for (i = 1; i <= min; i++) + if ((md->ctypes[*eptr++] & ctype_space) == 0) RRETURN(MATCH_NOMATCH); + break; + + case OP_NOT_WORDCHAR: + for (i = 1; i <= min; i++) + if ((md->ctypes[*eptr++] & ctype_word) != 0) + RRETURN(MATCH_NOMATCH); + break; + + case OP_WORDCHAR: + for (i = 1; i <= min; i++) + if ((md->ctypes[*eptr++] & ctype_word) == 0) + RRETURN(MATCH_NOMATCH); + break; + + default: + RRETURN(PCRE_ERROR_INTERNAL); + } + } + + /* If min = max, continue at the same level without recursing */ + + if (min == max) continue; + + /* If minimizing, we have to test the rest of the pattern before each + subsequent match. Again, separate the UTF-8 case for speed, and also + separate the UCP cases. */ + + if (minimize) + { +#ifdef SUPPORT_UCP + if (prop_type > 0) + { + for (fi = min;; fi++) + { + RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0); + if (rrc != MATCH_NOMATCH) RRETURN(rrc); + if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); + GETCHARINC(c, eptr); + prop_category = _pcre_ucp_findchar(c, &prop_chartype, &prop_othercase); + if ((*prop_test_variable == prop_test_against) == prop_fail_result) + RRETURN(MATCH_NOMATCH); + } + } + + /* Match extended Unicode sequences. We will get here only if the + support is in the binary; otherwise a compile-time error occurs. */ + + else if (ctype == OP_EXTUNI) + { + for (fi = min;; fi++) + { + RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0); + if (rrc != MATCH_NOMATCH) RRETURN(rrc); + if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); + GETCHARINCTEST(c, eptr); + prop_category = _pcre_ucp_findchar(c, &prop_chartype, &prop_othercase); + if (prop_category == ucp_M) RRETURN(MATCH_NOMATCH); + while (eptr < md->end_subject) + { + int len = 1; + if (!utf8) c = *eptr; else + { + GETCHARLEN(c, eptr, len); + } + prop_category = _pcre_ucp_findchar(c, &prop_chartype, &prop_othercase); + if (prop_category != ucp_M) break; + eptr += len; + } + } + } + + else +#endif /* SUPPORT_UCP */ + +#ifdef SUPPORT_UTF8 + /* UTF-8 mode */ + if (utf8) + { + for (fi = min;; fi++) + { + RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0); + if (rrc != MATCH_NOMATCH) RRETURN(rrc); + if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); + + GETCHARINC(c, eptr); + switch(ctype) + { + case OP_ANY: + if ((ims & PCRE_DOTALL) == 0 && isECMALineTerminator(c)) RRETURN(MATCH_NOMATCH); + break; + + case OP_ANYBYTE: + break; + + case OP_NOT_DIGIT: + if (c < 256 && (md->ctypes[c] & ctype_digit) != 0) + RRETURN(MATCH_NOMATCH); + break; + + case OP_DIGIT: + if (c >= 256 || (md->ctypes[c] & ctype_digit) == 0) + RRETURN(MATCH_NOMATCH); + break; + + case OP_NOT_WHITESPACE: + if (c < 256) + { + if ((md->ctypes[c] & ctype_space) != 0) + RRETURN(MATCH_NOMATCH); + } + else if (isUnicodeWhiteSpace(c) == true) + { + RRETURN(MATCH_NOMATCH); + } + break; + + case OP_WHITESPACE: + if (c < 256) + { + if ((md->ctypes[c] & ctype_space) == 0) + RRETURN(MATCH_NOMATCH); + } + else if (isUnicodeWhiteSpace(c) == false) + { + RRETURN(MATCH_NOMATCH); + } + break; + + case OP_NOT_WORDCHAR: + if (c < 256 && (md->ctypes[c] & ctype_word) != 0) + RRETURN(MATCH_NOMATCH); + break; + + case OP_WORDCHAR: + if (c >= 256 || (md->ctypes[c] & ctype_word) == 0) + RRETURN(MATCH_NOMATCH); + break; + + default: + RRETURN(PCRE_ERROR_INTERNAL); + } + } + } + else +#endif + /* Not UTF-8 mode */ + { + for (fi = min;; fi++) + { + RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0); + if (rrc != MATCH_NOMATCH) RRETURN(rrc); + if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); + c = *eptr++; + switch(ctype) + { + case OP_ANY: + if ((ims & PCRE_DOTALL) == 0 && isECMALineTerminator(c)) RRETURN(MATCH_NOMATCH); + break; + + case OP_ANYBYTE: + break; + + case OP_NOT_DIGIT: + if ((md->ctypes[c] & ctype_digit) != 0) RRETURN(MATCH_NOMATCH); + break; + + case OP_DIGIT: + if ((md->ctypes[c] & ctype_digit) == 0) RRETURN(MATCH_NOMATCH); + break; + + case OP_NOT_WHITESPACE: + if (c < 256) + { + if ((md->ctypes[c] & ctype_space) != 0) + RRETURN(MATCH_NOMATCH); + } + else if (isUnicodeWhiteSpace(c) == true) + { + RRETURN(MATCH_NOMATCH); + } + break; + + case OP_WHITESPACE: + if (c < 256) + { + if ((md->ctypes[c] & ctype_space) == 0) + RRETURN(MATCH_NOMATCH); + } + else if (isUnicodeWhiteSpace(c) == false) + { + RRETURN(MATCH_NOMATCH); + } + break; + + case OP_NOT_WORDCHAR: + if ((md->ctypes[c] & ctype_word) != 0) RRETURN(MATCH_NOMATCH); + break; + + case OP_WORDCHAR: + if ((md->ctypes[c] & ctype_word) == 0) RRETURN(MATCH_NOMATCH); + break; + + default: + RRETURN(PCRE_ERROR_INTERNAL); + } + } + } + /* Control never gets here */ + } + + /* If maximizing it is worth using inline code for speed, doing the type + test once at the start (i.e. keep it out of the loop). Again, keep the + UTF-8 and UCP stuff separate. */ + + else + { + pp = eptr; /* Remember where we started */ + +#ifdef SUPPORT_UCP + if (prop_type > 0) + { + for (i = min; i < max; i++) + { + int len = 1; + if (eptr >= md->end_subject) break; + GETCHARLEN(c, eptr, len); + prop_category = _pcre_ucp_findchar(c, &prop_chartype, &prop_othercase); + if ((*prop_test_variable == prop_test_against) == prop_fail_result) + break; + eptr+= len; + } + + /* eptr is now past the end of the maximum run */ + + for(;;) + { + RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0); + if (rrc != MATCH_NOMATCH) RRETURN(rrc); + if (eptr-- == pp) break; /* Stop if tried at original pos */ + BACKCHAR(eptr); + } + } + + /* Match extended Unicode sequences. We will get here only if the + support is in the binary; otherwise a compile-time error occurs. */ + + else if (ctype == OP_EXTUNI) + { + for (i = min; i < max; i++) + { + if (eptr >= md->end_subject) break; + GETCHARINCTEST(c, eptr); + prop_category = _pcre_ucp_findchar(c, &prop_chartype, &prop_othercase); + if (prop_category == ucp_M) break; + while (eptr < md->end_subject) + { + int len = 1; + if (!utf8) c = *eptr; else + { + GETCHARLEN(c, eptr, len); + } + prop_category = _pcre_ucp_findchar(c, &prop_chartype, &prop_othercase); + if (prop_category != ucp_M) break; + eptr += len; + } + } + + /* eptr is now past the end of the maximum run */ + + for(;;) + { + RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0); + if (rrc != MATCH_NOMATCH) RRETURN(rrc); + if (eptr-- == pp) break; /* Stop if tried at original pos */ + for (;;) /* Move back over one extended */ + { + int len = 1; + BACKCHAR(eptr); + if (!utf8) c = *eptr; else + { + GETCHARLEN(c, eptr, len); + } + prop_category = _pcre_ucp_findchar(c, &prop_chartype, &prop_othercase); + if (prop_category != ucp_M) break; + eptr--; + } + } + } + + else +#endif /* SUPPORT_UCP */ + +#ifdef SUPPORT_UTF8 + /* UTF-8 mode */ + + if (utf8) + { + switch(ctype) + { + case OP_ANY: + + /* Special code is required for UTF8, but when the maximum is unlimited + we don't need it, so we repeat the non-UTF8 code. This is probably + worth it, because .* is quite a common idiom. */ + + if (max < INT_MAX) + { + if ((ims & PCRE_DOTALL) == 0) + { + for (i = min; i < max; i++) + { + if (eptr >= md->end_subject || isECMALineTerminator(*eptr)) break; + eptr++; + while (eptr < md->end_subject && (*eptr & 0xc0) == 0x80) eptr++; + } + } + else + { + for (i = min; i < max; i++) + { + eptr++; + while (eptr < md->end_subject && (*eptr & 0xc0) == 0x80) eptr++; + } + } + } + + /* Handle unlimited UTF-8 repeat */ + + else + { + if ((ims & PCRE_DOTALL) == 0) + { + for (i = min; i < max; i++) + { + if (eptr >= md->end_subject || isECMALineTerminator(*eptr)) break; + eptr++; + } + break; + } + else + { + c = max - min; + if (c > md->end_subject - eptr) c = md->end_subject - eptr; + eptr += c; + } + } + break; + + /* The byte case is the same as non-UTF8 */ + + case OP_ANYBYTE: + c = max - min; + if (c > md->end_subject - eptr) c = md->end_subject - eptr; + eptr += c; + break; + + case OP_NOT_DIGIT: + for (i = min; i < max; i++) + { + int len = 1; + if (eptr >= md->end_subject) break; + GETCHARLEN(c, eptr, len); + if (c < 256 && (md->ctypes[c] & ctype_digit) != 0) break; + eptr+= len; + } + break; + + case OP_DIGIT: + for (i = min; i < max; i++) + { + int len = 1; + if (eptr >= md->end_subject) break; + GETCHARLEN(c, eptr, len); + if (c >= 256 ||(md->ctypes[c] & ctype_digit) == 0) break; + eptr+= len; + } + break; + + case OP_NOT_WHITESPACE: + for (i = min; i < max; i++) + { + int len = 1; + if (eptr >= md->end_subject) break; + GETCHARLEN(c, eptr, len); + if (c < 256) + { + if ((md->ctypes[c] & ctype_space) != 0) + break; + } + else if (isUnicodeWhiteSpace(c) == true) + { + break; + } + eptr+= len; + } + break; + + case OP_WHITESPACE: + for (i = min; i < max; i++) + { + int len = 1; + if (eptr >= md->end_subject) + break; + GETCHARLEN(c, eptr, len); + if (c < 256) + { + if ((md->ctypes[c] & ctype_space) == 0) + break; + } + else if (isUnicodeWhiteSpace(c) == false) + { + break; + } + eptr+= len; + } + break; + + case OP_NOT_WORDCHAR: + for (i = min; i < max; i++) + { + int len = 1; + if (eptr >= md->end_subject) break; + GETCHARLEN(c, eptr, len); + if (c < 256 && (md->ctypes[c] & ctype_word) != 0) break; + eptr+= len; + } + break; + + case OP_WORDCHAR: + for (i = min; i < max; i++) + { + int len = 1; + if (eptr >= md->end_subject) break; + GETCHARLEN(c, eptr, len); + if (c >= 256 || (md->ctypes[c] & ctype_word) == 0) break; + eptr+= len; + } + break; + + default: + RRETURN(PCRE_ERROR_INTERNAL); + } + + /* eptr is now past the end of the maximum run */ + + for(;;) + { + RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0); + if (rrc != MATCH_NOMATCH) RRETURN(rrc); + if (eptr-- == pp) break; /* Stop if tried at original pos */ + BACKCHAR(eptr); + } + } + else +#endif + + /* Not UTF-8 mode */ + { + switch(ctype) + { + case OP_ANY: + if ((ims & PCRE_DOTALL) == 0) + { + for (i = min; i < max; i++) + { + if (eptr >= md->end_subject || isECMALineTerminator(*eptr)) break; + eptr++; + } + break; + } + /* For DOTALL case, fall through and treat as \C */ + + case OP_ANYBYTE: + c = max - min; + if (c > md->end_subject - eptr) c = md->end_subject - eptr; + eptr += c; + break; + + case OP_NOT_DIGIT: + for (i = min; i < max; i++) + { + if (eptr >= md->end_subject || (md->ctypes[*eptr] & ctype_digit) != 0) + break; + eptr++; + } + break; + + case OP_DIGIT: + for (i = min; i < max; i++) + { + if (eptr >= md->end_subject || (md->ctypes[*eptr] & ctype_digit) == 0) + break; + eptr++; + } + break; + + case OP_NOT_WHITESPACE: + for (i = min; i < max; i++) + { + if (eptr >= md->end_subject || (md->ctypes[*eptr] & ctype_space) != 0) // cn: not in the utf-8 #define, so no need to check isUnicodeWhiteSpace() + break; + eptr++; + } + break; + + case OP_WHITESPACE: + for (i = min; i < max; i++) + { + if (eptr >= md->end_subject || (md->ctypes[*eptr] & ctype_space) == 0) // cn: not in the utf-8 #define, so no need to check isUnicodeWhiteSpace() + break; + eptr++; + } + break; + + case OP_NOT_WORDCHAR: + for (i = min; i < max; i++) + { + if (eptr >= md->end_subject || (md->ctypes[*eptr] & ctype_word) != 0) + break; + eptr++; + } + break; + + case OP_WORDCHAR: + for (i = min; i < max; i++) + { + if (eptr >= md->end_subject || (md->ctypes[*eptr] & ctype_word) == 0) + break; + eptr++; + } + break; + + default: + RRETURN(PCRE_ERROR_INTERNAL); + } + + /* eptr is now past the end of the maximum run */ + + while (eptr >= pp) + { + RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0); + eptr--; + if (rrc != MATCH_NOMATCH) RRETURN(rrc); + } + } + + /* Get here if we can't make it match with any permitted repetitions */ + + RRETURN(MATCH_NOMATCH); + } + /* Control never gets here */ + + /* There's been some horrible disaster. Since all codes > OP_BRA are + for capturing brackets, and there shouldn't be any gaps between 0 and + OP_BRA, arrival here can only mean there is something seriously wrong + in the code above or the OP_xxx definitions. */ + + default: + DPRINTF(("Unknown opcode %d\n", *ecode)); + RRETURN(PCRE_ERROR_UNKNOWN_NODE); + } + + /* Do not stick any code in here without much thought; it is assumed + that "continue" in the code above comes out to here to repeat the main + loop. */ + + } /* End of main loop */ +/* Control never reaches here */ +} + + +/*************************************************************************** +**************************************************************************** + RECURSION IN THE match() FUNCTION + +Undefine all the macros that were defined above to handle this. */ + +#ifdef NO_RECURSE +#undef eptr +#undef ecode +#undef offset_top +#undef ims +#undef eptrb +#undef flags + +#undef callpat +#undef charptr +#undef data +#undef next +#undef pp +#undef prev +#undef saved_eptr + +#undef new_recursive + +#undef cur_is_word +#undef condition +#undef minimize +#undef prev_is_word + +#undef original_ims + +#undef ctype +#undef length +#undef max +#undef min +#undef number +#undef offset +#undef op +#undef save_capture_last +#undef save_offset1 +#undef save_offset2 +#undef save_offset3 +#undef stacksave + +#undef newptrb + +#endif + +/* These two are defined as macros in both cases */ + +#undef fc +#undef fi + +/*************************************************************************** +***************************************************************************/ + + + +/************************************************* +* Execute a Regular Expression * +*************************************************/ + +/* This function applies a compiled re to a subject string and picks out +portions of the string if it matches. Two elements in the vector are set for +each substring: the offsets to the start and end of the substring. + +Arguments: + argument_re points to the compiled expression + extra_data points to extra data or is NULL + subject points to the subject string + length length of subject string (may contain binary zeros) + start_offset where to start in the subject string + options option bits + offsets points to a vector of ints to be filled in with offsets + offsetcount the number of elements in the vector + +Returns: > 0 => success; value is the number of elements filled in + = 0 => success, but offsets is not big enough + -1 => failed to match + < -1 => some kind of unexpected problem +*/ + +PCRE_EXPORT int +pcre_exec(const pcre *argument_re, const pcre_extra *extra_data, + const char *subject, int length, int start_offset, int options, int *offsets, + int offsetcount) +{ +int rc, resetcount, ocount; +int first_byte = -1; +int req_byte = -1; +int req_byte2 = -1; +unsigned long int ims = 0; +BOOL using_temporary_offsets = FALSE; +BOOL anchored; +BOOL startline; +BOOL firstline; +BOOL first_byte_caseless = FALSE; +BOOL req_byte_caseless = FALSE; +match_data match_block; +const uschar *tables; +const uschar *start_bits = NULL; +const uschar *start_match = (const uschar *)subject + start_offset; +const uschar *end_subject; +const uschar *req_byte_ptr = start_match - 1; + +pcre_study_data internal_study; +const pcre_study_data *study; + +real_pcre internal_re; +const real_pcre *external_re = (const real_pcre *)argument_re; +const real_pcre *re = external_re; + +/* Plausibility checks */ + +if ((options & ~PUBLIC_EXEC_OPTIONS) != 0) return PCRE_ERROR_BADOPTION; +if (re == NULL || subject == NULL || + (offsets == NULL && offsetcount > 0)) return PCRE_ERROR_NULL; +if (offsetcount < 0) return PCRE_ERROR_BADCOUNT; + +/* Fish out the optional data from the extra_data structure, first setting +the default values. */ + +study = NULL; +match_block.match_limit = MATCH_LIMIT; +match_block.callout_data = NULL; + +/* The table pointer is always in native byte order. */ + +tables = external_re->tables; + +if (extra_data != NULL) + { + register unsigned int flags = extra_data->flags; + if ((flags & PCRE_EXTRA_STUDY_DATA) != 0) + study = (const pcre_study_data *)extra_data->study_data; + if ((flags & PCRE_EXTRA_MATCH_LIMIT) != 0) + match_block.match_limit = extra_data->match_limit; + if ((flags & PCRE_EXTRA_CALLOUT_DATA) != 0) + match_block.callout_data = extra_data->callout_data; + if ((flags & PCRE_EXTRA_TABLES) != 0) tables = extra_data->tables; + } + +/* If the exec call supplied NULL for tables, use the inbuilt ones. This +is a feature that makes it possible to save compiled regex and re-use them +in other programs later. */ + +if (tables == NULL) tables = _pcre_default_tables; + +/* Check that the first field in the block is the magic number. If it is not, +test for a regex that was compiled on a host of opposite endianness. If this is +the case, flipped values are put in internal_re and internal_study if there was +study data too. */ + +if (re->magic_number != MAGIC_NUMBER) + { + re = _pcre_try_flipped(re, &internal_re, study, &internal_study); + if (re == NULL) return PCRE_ERROR_BADMAGIC; + if (study != NULL) study = &internal_study; + } + +/* Set up other data */ + +anchored = ((re->options | options) & PCRE_ANCHORED) != 0; +startline = (re->options & PCRE_STARTLINE) != 0; +firstline = (re->options & PCRE_FIRSTLINE) != 0; + +/* The code starts after the real_pcre block and the capture name table. */ + +match_block.start_code = (const uschar *)external_re + re->name_table_offset + + re->name_count * re->name_entry_size; + +match_block.start_subject = (const uschar *)subject; +match_block.start_offset = start_offset; +match_block.end_subject = match_block.start_subject + length; +end_subject = match_block.end_subject; + +match_block.endonly = (re->options & PCRE_DOLLAR_ENDONLY) != 0; +match_block.utf8 = (re->options & PCRE_UTF8) != 0; + +match_block.notbol = (options & PCRE_NOTBOL) != 0; +match_block.noteol = (options & PCRE_NOTEOL) != 0; +match_block.notempty = (options & PCRE_NOTEMPTY) != 0; +match_block.partial = (options & PCRE_PARTIAL) != 0; +match_block.hitend = FALSE; + +match_block.recursive = NULL; /* No recursion at top level */ + +match_block.lcc = tables + lcc_offset; +match_block.ctypes = tables + ctypes_offset; + +/* Partial matching is supported only for a restricted set of regexes at the +moment. */ + +if (match_block.partial && (re->options & PCRE_NOPARTIAL) != 0) + return PCRE_ERROR_BADPARTIAL; + +/* Check a UTF-8 string if required. Unfortunately there's no way of passing +back the character offset. */ + +#ifdef SUPPORT_UTF8 +if (match_block.utf8 && (options & PCRE_NO_UTF8_CHECK) == 0) + { + if (_pcre_valid_utf8((uschar *)subject, length) >= 0) + return PCRE_ERROR_BADUTF8; + if (start_offset > 0 && start_offset < length) + { + int tb = ((uschar *)subject)[start_offset]; + if (tb > 127) + { + tb &= 0xc0; + if (tb != 0 && tb != 0xc0) return PCRE_ERROR_BADUTF8_OFFSET; + } + } + } +#endif + +/* The ims options can vary during the matching as a result of the presence +of (?ims) items in the pattern. They are kept in a local variable so that +restoring at the exit of a group is easy. */ + +ims = re->options & (PCRE_CASELESS|PCRE_MULTILINE|PCRE_DOTALL); + +/* If the expression has got more back references than the offsets supplied can +hold, we get a temporary chunk of working store to use during the matching. +Otherwise, we can use the vector supplied, rounding down its size to a multiple +of 3. */ + +ocount = offsetcount - (offsetcount % 3); + +if (re->top_backref > 0 && re->top_backref >= ocount/3) + { + ocount = re->top_backref * 3 + 3; + match_block.offset_vector = (int *)(pcre_malloc)(ocount * sizeof(int)); + if (match_block.offset_vector == NULL) return PCRE_ERROR_NOMEMORY; + using_temporary_offsets = TRUE; + DPRINTF(("Got memory to hold back references\n")); + } +else match_block.offset_vector = offsets; + + +match_block.offset_end = ocount; +match_block.offset_max = (2*ocount)/3; +match_block.offset_overflow = FALSE; +match_block.capture_last = -1; + +if (ES3_Compatible_Behavior) + match_block.end_offset_top = 2; + +/* Compute the minimum number of offsets that we need to reset each time. Doing +this makes a huge difference to execution time when there aren't many brackets +in the pattern. */ + +resetcount = 2 + re->top_bracket * 2; +if (resetcount > offsetcount) resetcount = ocount; + +/* Reset the working variable associated with each extraction. These should +never be used unless previously set, but they get saved and restored, and so we +initialize them to avoid reading uninitialized locations. */ + +if (match_block.offset_vector != NULL) + { + register int *iptr = match_block.offset_vector + ocount; + register int *iend = iptr - resetcount/2 + 1; + while (--iptr >= iend) *iptr = -1; + } + +/* Set up the first character to match, if available. The first_byte value is +never set for an anchored regular expression, but the anchoring may be forced +at run time, so we have to test for anchoring. The first char may be unset for +an unanchored pattern, of course. If there's no first char and the pattern was +studied, there may be a bitmap of possible first characters. */ + +if (!anchored) + { + if ((re->options & PCRE_FIRSTSET) != 0) + { + first_byte = re->first_byte & 255; + if ((first_byte_caseless = ((re->first_byte & REQ_CASELESS) != 0)) == TRUE) + first_byte = match_block.lcc[first_byte]; + } + else + if (!startline && study != NULL && + (study->options & PCRE_STUDY_MAPPED) != 0) + start_bits = study->start_bits; + } + +/* For anchored or unanchored matches, there may be a "last known required +character" set. */ + +if ((re->options & PCRE_REQCHSET) != 0) + { + req_byte = re->req_byte & 255; + req_byte_caseless = (re->req_byte & REQ_CASELESS) != 0; + req_byte2 = (tables + fcc_offset)[req_byte]; /* case flipped */ + } + +/* Loop for handling unanchored repeated matching attempts; for anchored regexs +the loop runs just once. */ + +do + { + const uschar *save_end_subject = end_subject; + + /* Reset the maximum number of extractions we might see. */ + + if (match_block.offset_vector != NULL) + { + register int *iptr = match_block.offset_vector; + register int *iend = iptr + resetcount; + while (iptr < iend) *iptr++ = -1; + } + + /* Advance to a unique first char if possible. If firstline is TRUE, the + start of the match is constrained to the first line of a multiline string. + Implement this by temporarily adjusting end_subject so that we stop scanning + at a newline. If the match fails at the newline, later code breaks this loop. + */ + + if (firstline) + { + const uschar *t = start_match; + while (t < save_end_subject && *t != '\n') t++; + end_subject = t; + } + + /* Now test for a unique first byte */ + + if (first_byte >= 0) + { + if (first_byte_caseless) + while (start_match < end_subject && + match_block.lcc[*start_match] != first_byte) + start_match++; + else + while (start_match < end_subject && *start_match != first_byte) + start_match++; + } + + /* Or to just after \n for a multiline match if possible */ + + else if (startline) + { + if (start_match > match_block.start_subject + start_offset) + { + while (start_match < end_subject && !isECMALineTerminator(start_match[-1])) + start_match++; + } + } + + /* Or to a non-unique first char after study */ + + else if (start_bits != NULL) + { + while (start_match < end_subject) + { + register unsigned int c = *start_match; + if ((start_bits[c/8] & (1 << (c&7))) == 0) start_match++; else break; + } + } + + /* Restore fudged end_subject */ + + end_subject = save_end_subject; + +#ifdef DEBUG /* Sigh. Some compilers never learn. */ + printf(">>>> Match against: "); + pchars(start_match, end_subject - start_match, TRUE, &match_block); + printf("\n"); +#endif + + /* If req_byte is set, we know that that character must appear in the subject + for the match to succeed. If the first character is set, req_byte must be + later in the subject; otherwise the test starts at the match point. This + optimization can save a huge amount of backtracking in patterns with nested + unlimited repeats that aren't going to match. Writing separate code for + cased/caseless versions makes it go faster, as does using an autoincrement + and backing off on a match. + + HOWEVER: when the subject string is very, very long, searching to its end can + take a long time, and give bad performance on quite ordinary patterns. This + showed up when somebody was matching /^C/ on a 32-megabyte string... so we + don't do this when the string is sufficiently long. + + ALSO: this processing is disabled when partial matching is requested. + */ + + if (req_byte >= 0 && + end_subject - start_match < REQ_BYTE_MAX && + !match_block.partial) + { + register const uschar *p = start_match + ((first_byte >= 0)? 1 : 0); + + /* We don't need to repeat the search if we haven't yet reached the + place we found it at last time. */ + + if (p > req_byte_ptr) + { + if (req_byte_caseless) + { + while (p < end_subject) + { + register int pp = *p++; + if (pp == req_byte || pp == req_byte2) { p--; break; } + } + } + else + { + while (p < end_subject) + { + if (*p++ == req_byte) { p--; break; } + } + } + + /* If we can't find the required character, break the matching loop */ + + if (p >= end_subject) break; + + /* If we have found the required character, save the point where we + found it, so that we don't search again next time round the loop if + the start hasn't passed this character yet. */ + + req_byte_ptr = p; + } + } + + /* When a match occurs, substrings will be set for all internal extractions; + we just need to set up the whole thing as substring 0 before returning. If + there were too many extractions, set the return code to zero. In the case + where we had to get some local store to hold offsets for backreferences, copy + those back references that we can. In this case there need not be overflow + if certain parts of the pattern were not used. */ + + match_block.start_match = start_match; + match_block.match_call_count = 0; + + rc = match(start_match, match_block.start_code, 2, &match_block, ims, NULL, + match_isgroup); + + /* When the result is no match, if the subject's first character was a + newline and the PCRE_FIRSTLINE option is set, break (which will return + PCRE_ERROR_NOMATCH). The option requests that a match occur before the first + newline in the subject. Otherwise, advance the pointer to the next character + and continue - but the continuation will actually happen only when the + pattern is not anchored. */ + + if (rc == MATCH_NOMATCH) + { + int ac = *start_match; + if (firstline && isECMALineTerminator(ac)) break; + start_match++; +#ifdef SUPPORT_UTF8 + if (match_block.utf8) + while(start_match < end_subject && (*start_match & 0xc0) == 0x80) + start_match++; +#endif + continue; + } + + if (rc != MATCH_MATCH) + { + DPRINTF((">>>> error: returning %d\n", rc)); + return rc; + } + + /* We have a match! Copy the offset information from temporary store if + necessary */ + + if (using_temporary_offsets) + { + if (offsetcount >= 4) + { + memcpy(offsets + 2, match_block.offset_vector + 2, + (offsetcount - 2) * sizeof(int)); + DPRINTF(("Copied offsets from temporary memory\n")); + } + if (match_block.end_offset_top > offsetcount) + match_block.offset_overflow = TRUE; + + DPRINTF(("Freeing temporary memory\n")); + (pcre_free)(match_block.offset_vector); + } + + // ECMAScript compatible behavior means always returning as many elements as there were groups (+1). PERL behavior is to return only as many results as the number of groups actually visited (+1) + rc = match_block.offset_overflow? 0 : (ES3_Compatible_Behavior ? resetcount/2 : match_block.end_offset_top/2); + + if (offsetcount < 2) rc = 0; else + { + offsets[0] = start_match - match_block.start_subject; + offsets[1] = match_block.end_match_ptr - match_block.start_subject; + } + + DPRINTF((">>>> returning %d\n", rc)); + return rc; + } + +/* This "while" is the end of the "do" above */ + +while (!anchored && start_match <= end_subject); + +if (using_temporary_offsets) + { + DPRINTF(("Freeing temporary memory\n")); + (pcre_free)(match_block.offset_vector); + } + +if (match_block.partial && match_block.hitend) + { + DPRINTF((">>>> returning PCRE_ERROR_PARTIAL\n")); + return PCRE_ERROR_PARTIAL; + } +else + { + DPRINTF((">>>> returning PCRE_ERROR_NOMATCH\n")); + return PCRE_ERROR_NOMATCH; + } +} + +/* End of pcre_exec.c */ diff --git a/mozilla/js/tamarin/pcre/pcre_fullinfo.cpp b/mozilla/js/tamarin/pcre/pcre_fullinfo.cpp new file mode 100644 index 00000000000..6a81fbf4d8f --- /dev/null +++ b/mozilla/js/tamarin/pcre/pcre_fullinfo.cpp @@ -0,0 +1,151 @@ +#include "avmplus.h" + +/************************************************* +* Perl-Compatible Regular Expressions * +*************************************************/ + +/*PCRE is a library of functions to support regular expressions whose syntax +and semantics are as close as possible to those of the Perl 5 language. + + Written by Philip Hazel + Copyright (c) 1997-2005 University of Cambridge + +----------------------------------------------------------------------------- +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + * Neither the name of the University of Cambridge nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +----------------------------------------------------------------------------- +*/ + + +/* This module contains the external function pcre_fullinfo(), which returns +information about a compiled pattern. */ + + +#include "pcre_internal.h" + + +/************************************************* +* Return info about compiled pattern * +*************************************************/ + +/* This is a newer "info" function which has an extensible interface so +that additional items can be added compatibly. + +Arguments: + argument_re points to compiled code + extra_data points extra data, or NULL + what what information is required + where where to put the information + +Returns: 0 if data returned, negative on error +*/ + +PCRE_EXPORT int +pcre_fullinfo(const pcre *argument_re, const pcre_extra *extra_data, int what, + void *where) +{ +real_pcre internal_re; +pcre_study_data internal_study; +const real_pcre *re = (const real_pcre *)argument_re; +const pcre_study_data *study = NULL; + +if (re == NULL || where == NULL) return PCRE_ERROR_NULL; + +if (extra_data != NULL && (extra_data->flags & PCRE_EXTRA_STUDY_DATA) != 0) + study = (const pcre_study_data *)extra_data->study_data; + +if (re->magic_number != MAGIC_NUMBER) + { + re = _pcre_try_flipped(re, &internal_re, study, &internal_study); + if (re == NULL) return PCRE_ERROR_BADMAGIC; + if (study != NULL) study = &internal_study; + } + +switch (what) + { + case PCRE_INFO_OPTIONS: + *((unsigned long int *)where) = re->options & PUBLIC_OPTIONS; + break; + + case PCRE_INFO_SIZE: + *((size_t *)where) = re->size; + break; + + case PCRE_INFO_STUDYSIZE: + *((size_t *)where) = (study == NULL)? 0 : study->size; + break; + + case PCRE_INFO_CAPTURECOUNT: + *((int *)where) = re->top_bracket; + break; + + case PCRE_INFO_BACKREFMAX: + *((int *)where) = re->top_backref; + break; + + case PCRE_INFO_FIRSTBYTE: + *((int *)where) = + ((re->options & PCRE_FIRSTSET) != 0)? re->first_byte : + ((re->options & PCRE_STARTLINE) != 0)? -1 : -2; + break; + + /* Make sure we pass back the pointer to the bit vector in the external + block, not the internal copy (with flipped integer fields). */ + + case PCRE_INFO_FIRSTTABLE: + *((const uschar **)where) = + (study != NULL && (study->options & PCRE_STUDY_MAPPED) != 0)? + ((const pcre_study_data *)extra_data->study_data)->start_bits : NULL; + break; + + case PCRE_INFO_LASTLITERAL: + *((int *)where) = + ((re->options & PCRE_REQCHSET) != 0)? re->req_byte : -1; + break; + + case PCRE_INFO_NAMEENTRYSIZE: + *((int *)where) = re->name_entry_size; + break; + + case PCRE_INFO_NAMECOUNT: + *((int *)where) = re->name_count; + break; + + case PCRE_INFO_NAMETABLE: + *((const uschar **)where) = (const uschar *)re + re->name_table_offset; + break; + + case PCRE_INFO_DEFAULT_TABLES: + *((const uschar **)where) = (const uschar *)(_pcre_default_tables); + break; + + default: return PCRE_ERROR_BADOPTION; + } + +return 0; +} + +/* End of pcre_fullinfo.c */ diff --git a/mozilla/js/tamarin/pcre/pcre_get.cpp b/mozilla/js/tamarin/pcre/pcre_get.cpp new file mode 100644 index 00000000000..1716e7d92b3 --- /dev/null +++ b/mozilla/js/tamarin/pcre/pcre_get.cpp @@ -0,0 +1,354 @@ +#include "avmplus.h" + +/************************************************* +* Perl-Compatible Regular Expressions * +*************************************************/ + +/* PCRE is a library of functions to support regular expressions whose syntax +and semantics are as close as possible to those of the Perl 5 language. + + Written by Philip Hazel + Copyright (c) 1997-2005 University of Cambridge + +----------------------------------------------------------------------------- +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + * Neither the name of the University of Cambridge nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +----------------------------------------------------------------------------- +*/ + + +/* This module contains some convenience functions for extracting substrings +from the subject string after a regex match has succeeded. The original idea +for these functions came from Scott Wimer. */ + + +#include "pcre_internal.h" + + +/************************************************* +* Find number for named string * +*************************************************/ + +/* This function is used by the two extraction functions below, as well +as being generally available. + +Arguments: + code the compiled regex + stringname the name whose number is required + +Returns: the number of the named parentheses, or a negative number + (PCRE_ERROR_NOSUBSTRING) if not found +*/ + +int +pcre_get_stringnumber(const pcre *code, const char *stringname) +{ +int rc; +int entrysize; +int top, bot; +uschar *nametable; + +if ((rc = pcre_fullinfo(code, NULL, PCRE_INFO_NAMECOUNT, &top)) != 0) + return rc; +if (top <= 0) return PCRE_ERROR_NOSUBSTRING; + +if ((rc = pcre_fullinfo(code, NULL, PCRE_INFO_NAMEENTRYSIZE, &entrysize)) != 0) + return rc; +if ((rc = pcre_fullinfo(code, NULL, PCRE_INFO_NAMETABLE, &nametable)) != 0) + return rc; + +bot = 0; +while (top > bot) + { + int mid = (top + bot) / 2; + uschar *entry = nametable + entrysize*mid; + int c = strcmp(stringname, (char *)(entry + 2)); + if (c == 0) return (entry[0] << 8) + entry[1]; + if (c > 0) bot = mid + 1; else top = mid; + } + +return PCRE_ERROR_NOSUBSTRING; +} + + + +/************************************************* +* Copy captured string to given buffer * +*************************************************/ + +/* This function copies a single captured substring into a given buffer. +Note that we use memcpy() rather than strncpy() in case there are binary zeros +in the string. + +Arguments: + subject the subject string that was matched + ovector pointer to the offsets table + stringcount the number of substrings that were captured + (i.e. the yield of the pcre_exec call, unless + that was zero, in which case it should be 1/3 + of the offset table size) + stringnumber the number of the required substring + buffer where to put the substring + size the size of the buffer + +Returns: if successful: + the length of the copied string, not including the zero + that is put on the end; can be zero + if not successful: + PCRE_ERROR_NOMEMORY (-6) buffer too small + PCRE_ERROR_NOSUBSTRING (-7) no such captured substring +*/ + +int +pcre_copy_substring(const char *subject, int *ovector, int stringcount, + int stringnumber, char *buffer, int size) +{ +int yield; +if (stringnumber < 0 || stringnumber >= stringcount) + return PCRE_ERROR_NOSUBSTRING; +stringnumber *= 2; +yield = ovector[stringnumber+1] - ovector[stringnumber]; +if (size < yield + 1) return PCRE_ERROR_NOMEMORY; +memcpy(buffer, subject + ovector[stringnumber], yield); +buffer[yield] = 0; +return yield; +} + + + +/************************************************* +* Copy named captured string to given buffer * +*************************************************/ + +/* This function copies a single captured substring into a given buffer, +identifying it by name. + +Arguments: + code the compiled regex + subject the subject string that was matched + ovector pointer to the offsets table + stringcount the number of substrings that were captured + (i.e. the yield of the pcre_exec call, unless + that was zero, in which case it should be 1/3 + of the offset table size) + stringname the name of the required substring + buffer where to put the substring + size the size of the buffer + +Returns: if successful: + the length of the copied string, not including the zero + that is put on the end; can be zero + if not successful: + PCRE_ERROR_NOMEMORY (-6) buffer too small + PCRE_ERROR_NOSUBSTRING (-7) no such captured substring +*/ + +int +pcre_copy_named_substring(const pcre *code, const char *subject, int *ovector, + int stringcount, const char *stringname, char *buffer, int size) +{ +int n = pcre_get_stringnumber(code, stringname); +if (n <= 0) return n; +return pcre_copy_substring(subject, ovector, stringcount, n, buffer, size); +} + + + +/************************************************* +* Copy all captured strings to new store * +*************************************************/ + +/* This function gets one chunk of store and builds a list of pointers and all +of the captured substrings in it. A NULL pointer is put on the end of the list. + +Arguments: + subject the subject string that was matched + ovector pointer to the offsets table + stringcount the number of substrings that were captured + (i.e. the yield of the pcre_exec call, unless + that was zero, in which case it should be 1/3 + of the offset table size) + listptr set to point to the list of pointers + +Returns: if successful: 0 + if not successful: + PCRE_ERROR_NOMEMORY (-6) failed to get store +*/ + +int +pcre_get_substring_list(const char *subject, int *ovector, int stringcount, + const char ***listptr) +{ +int i; +int size = sizeof(char *); +int double_count = stringcount * 2; +char **stringlist; +char *p; + +for (i = 0; i < double_count; i += 2) + size += sizeof(char *) + ovector[i+1] - ovector[i] + 1; + +stringlist = (char **)(pcre_malloc)(size); +if (stringlist == NULL) return PCRE_ERROR_NOMEMORY; + +*listptr = (const char **)stringlist; +p = (char *)(stringlist + stringcount + 1); + +for (i = 0; i < double_count; i += 2) + { + int len = ovector[i+1] - ovector[i]; + memcpy(p, subject + ovector[i], len); + *stringlist++ = p; + p += len; + *p++ = 0; + } + +*stringlist = NULL; +return 0; +} + + + +/************************************************* +* Free store obtained by get_substring_list * +*************************************************/ + +/* This function exists for the benefit of people calling PCRE from non-C +programs that can call its functions, but not free() or (pcre_free)() directly. + +Argument: the result of a previous pcre_get_substring_list() +Returns: nothing +*/ + +void +pcre_free_substring_list(const char **pointer) +{ +(pcre_free)((void *)pointer); +} + + + +/************************************************* +* Copy captured string to new store * +*************************************************/ + +/* This function copies a single captured substring into a piece of new +store + +Arguments: + subject the subject string that was matched + ovector pointer to the offsets table + stringcount the number of substrings that were captured + (i.e. the yield of the pcre_exec call, unless + that was zero, in which case it should be 1/3 + of the offset table size) + stringnumber the number of the required substring + stringptr where to put a pointer to the substring + +Returns: if successful: + the length of the string, not including the zero that + is put on the end; can be zero + if not successful: + PCRE_ERROR_NOMEMORY (-6) failed to get store + PCRE_ERROR_NOSUBSTRING (-7) substring not present +*/ + +int +pcre_get_substring(const char *subject, int *ovector, int stringcount, + int stringnumber, const char **stringptr) +{ +int yield; +char *substring; +if (stringnumber < 0 || stringnumber >= stringcount) + return PCRE_ERROR_NOSUBSTRING; +stringnumber *= 2; +yield = ovector[stringnumber+1] - ovector[stringnumber]; +substring = (char *)(pcre_malloc)(yield + 1); +if (substring == NULL) return PCRE_ERROR_NOMEMORY; +memcpy(substring, subject + ovector[stringnumber], yield); +substring[yield] = 0; +*stringptr = substring; +return yield; +} + + + +/************************************************* +* Copy named captured string to new store * +*************************************************/ + +/* This function copies a single captured substring, identified by name, into +new store. + +Arguments: + code the compiled regex + subject the subject string that was matched + ovector pointer to the offsets table + stringcount the number of substrings that were captured + (i.e. the yield of the pcre_exec call, unless + that was zero, in which case it should be 1/3 + of the offset table size) + stringname the name of the required substring + stringptr where to put the pointer + +Returns: if successful: + the length of the copied string, not including the zero + that is put on the end; can be zero + if not successful: + PCRE_ERROR_NOMEMORY (-6) couldn't get memory + PCRE_ERROR_NOSUBSTRING (-7) no such captured substring +*/ + +int +pcre_get_named_substring(const pcre *code, const char *subject, int *ovector, + int stringcount, const char *stringname, const char **stringptr) +{ +int n = pcre_get_stringnumber(code, stringname); +if (n <= 0) return n; +return pcre_get_substring(subject, ovector, stringcount, n, stringptr); +} + + + + +/************************************************* +* Free store obtained by get_substring * +*************************************************/ + +/* This function exists for the benefit of people calling PCRE from non-C +programs that can call its functions, but not free() or (pcre_free)() directly. + +Argument: the result of a previous pcre_get_substring() +Returns: nothing +*/ + +void +pcre_free_substring(const char *pointer) +{ +(pcre_free)((void *)pointer); +} + +/* End of pcre_get.c */ diff --git a/mozilla/js/tamarin/pcre/pcre_globals.cpp b/mozilla/js/tamarin/pcre/pcre_globals.cpp new file mode 100644 index 00000000000..812edf0f474 --- /dev/null +++ b/mozilla/js/tamarin/pcre/pcre_globals.cpp @@ -0,0 +1,101 @@ +#include "avmplus.h" + +/************************************************* +* Perl-Compatible Regular Expressions * +*************************************************/ + +/* PCRE is a library of functions to support regular expressions whose syntax +and semantics are as close as possible to those of the Perl 5 language. + + Written by Philip Hazel + Copyright (c) 1997-2005 University of Cambridge + +----------------------------------------------------------------------------- +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + * Neither the name of the University of Cambridge nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +----------------------------------------------------------------------------- +*/ + + +/* This module contains global variables that are exported by the PCRE library. +PCRE is thread-clean and doesn't use any global variables in the normal sense. +However, it calls memory allocation and freeing functions via the four +indirections below, and it can optionally do callouts, using the fifth +indirection. These values can be changed by the caller, but are shared between +all threads. However, when compiling for Virtual Pascal, things are done +differently, and global variables are not used (see pcre.in). */ + + +#include "pcre_internal.h" + +#ifdef AVMPLUS_PCRE + +void *avmplus_pcre_malloc(size_t size) +{ + return new char[size]; +} + +void avmplus_pcre_free(void *ptr) +{ + char *cp = (char *) ptr; + delete [] cp; +} + +// GCC complains if you declare as extern and init in same statement + +extern "C" void *(*pcre_malloc)(size_t); +extern "C" void (*pcre_free)(void *); +extern "C" void *(*pcre_stack_malloc)(size_t); +extern "C" void (*pcre_stack_free)(void *); +extern "C" int (*pcre_callout)(pcre_callout_block *); + +void *(*pcre_malloc)(size_t) = avmplus_pcre_malloc; +void (*pcre_free)(void *) = avmplus_pcre_free; +void *(*pcre_stack_malloc)(size_t) = avmplus_pcre_malloc; +void (*pcre_stack_free)(void *) = avmplus_pcre_free; +int (*pcre_callout)(pcre_callout_block *) = NULL; + +#else + +#ifndef VPCOMPAT +#ifdef __cplusplus +extern "C" void *(*pcre_malloc)(size_t) = malloc; +extern "C" void (*pcre_free)(void *) = free; +extern "C" void *(*pcre_stack_malloc)(size_t) = malloc; +extern "C" void (*pcre_stack_free)(void *) = free; +extern "C" int (*pcre_callout)(pcre_callout_block *) = NULL; +#else +void *(*pcre_malloc)(size_t) = malloc; +void (*pcre_free)(void *) = free; +void *(*pcre_stack_malloc)(size_t) = malloc; +void (*pcre_stack_free)(void *) = free; +int (*pcre_callout)(pcre_callout_block *) = NULL; +#endif +#endif + +#endif /* AVMPLUS_PCRE */ + +/* End of pcre_globals.c */ diff --git a/mozilla/js/tamarin/pcre/pcre_info.cpp b/mozilla/js/tamarin/pcre/pcre_info.cpp new file mode 100644 index 00000000000..4d3a7a1887f --- /dev/null +++ b/mozilla/js/tamarin/pcre/pcre_info.cpp @@ -0,0 +1,91 @@ +#include "avmplus.h" + +/************************************************* +* Perl-Compatible Regular Expressions * +*************************************************/ + +/* PCRE is a library of functions to support regular expressions whose syntax +and semantics are as close as possible to those of the Perl 5 language. + + Written by Philip Hazel + Copyright (c) 1997-2005 University of Cambridge + +----------------------------------------------------------------------------- +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + * Neither the name of the University of Cambridge nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +----------------------------------------------------------------------------- +*/ + + +/* This module contains the external function pcre_info(), which gives some +information about a compiled pattern. However, use of this function is now +deprecated, as it has been superseded by pcre_fullinfo(). */ + + +#include "pcre_internal.h" + + +/************************************************* +* (Obsolete) Return info about compiled pattern * +*************************************************/ + +/* This is the original "info" function. It picks potentially useful data out +of the private structure, but its interface was too rigid. It remains for +backwards compatibility. The public options are passed back in an int - though +the re->options field has been expanded to a long int, all the public options +at the low end of it, and so even on 16-bit systems this will still be OK. +Therefore, I haven't changed the API for pcre_info(). + +Arguments: + argument_re points to compiled code + optptr where to pass back the options + first_byte where to pass back the first character, + or -1 if multiline and all branches start ^, + or -2 otherwise + +Returns: number of capturing subpatterns + or negative values on error +*/ + +PCRE_EXPORT int +pcre_info(const pcre *argument_re, int *optptr, int *first_byte) +{ +real_pcre internal_re; +const real_pcre *re = (const real_pcre *)argument_re; +if (re == NULL) return PCRE_ERROR_NULL; +if (re->magic_number != MAGIC_NUMBER) + { + re = _pcre_try_flipped(re, &internal_re, NULL, NULL); + if (re == NULL) return PCRE_ERROR_BADMAGIC; + } +if (optptr != NULL) *optptr = (int)(re->options & PUBLIC_OPTIONS); +if (first_byte != NULL) + *first_byte = ((re->options & PCRE_FIRSTSET) != 0)? re->first_byte : + ((re->options & PCRE_STARTLINE) != 0)? -1 : -2; +return re->top_bracket; +} + +/* End of pcre_info.c */ diff --git a/mozilla/js/tamarin/pcre/pcre_internal.h b/mozilla/js/tamarin/pcre/pcre_internal.h new file mode 100644 index 00000000000..335cc1b2f26 --- /dev/null +++ b/mozilla/js/tamarin/pcre/pcre_internal.h @@ -0,0 +1,910 @@ +/************************************************* +* Perl-Compatible Regular Expressions * +*************************************************/ + + +/* PCRE is a library of functions to support regular expressions whose syntax +and semantics are as close as possible to those of the Perl 5 language. + + Written by Philip Hazel + Copyright (c) 1997-2005 University of Cambridge + +----------------------------------------------------------------------------- +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + * Neither the name of the University of Cambridge nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +----------------------------------------------------------------------------- +*/ + +/* This header contains definitions that are shared between the different +modules, but which are not relevant to the exported API. This includes some +functions whose names all begin with "_pcre_". */ + +#ifndef PCRE_INTERNAL_H +#define PCRE_INTERNAL_H + +/* Define DEBUG to get debugging output on stdout. */ + +#if 0 +#define DEBUG +#endif + +/* Use a macro for debugging printing, 'cause that eliminates the use of #ifdef +inline, and there are *still* stupid compilers about that don't like indented +pre-processor statements, or at least there were when I first wrote this. After +all, it had only been about 10 years then... */ + +#ifndef __MWERKS__ +#ifdef DEBUG +#define DPRINTF(p) printf p +#else +#define DPRINTF(p) /*nothing*/ +#endif +#endif + + +/* Get the definitions provided by running "configure" */ + +#include "config.h" + +/* Standard C headers plus the external interface definition. The only time +setjmp and stdarg are used is when NO_RECURSE is set. */ + +#include +#include +#ifndef _MAC +#include +#endif +#include +#include +#include +#include +#include + +#ifndef PCRE_SPY +#define PCRE_DEFINITION /* Win32 __declspec(export) trigger for .dll */ +#endif + +/* We need to have types that specify unsigned 16-bit and 32-bit integers. We +cannot determine these outside the compilation (e.g. by running a program as +part of "configure") because PCRE is often cross-compiled for use on other +systems. Instead we make use of the maximum sizes that are available at +preprocessor time in standard C environments. */ + +#if USHRT_MAX == 65535 + typedef unsigned short pcre_uint16; +#elif UINT_MAX == 65535 + typedef unsigned int pcre_uint16; +#else + #error Cannot determine a type for 16-bit unsigned integers +#endif + +#if UINT_MAX == 4294967295 + typedef unsigned int pcre_uint32; +#elif ULONG_MAX == 4294967295 + typedef unsigned long int pcre_uint32; +#else + #error Cannot determine a type for 32-bit unsigned integers +#endif + +/* All character handling must be done as unsigned characters. Otherwise there +are problems with top-bit-set characters and functions such as isspace(). +However, we leave the interface to the outside world as char *, because that +should make things easier for callers. We define a short type for unsigned char +to save lots of typing. I tried "uchar", but it causes problems on Digital +Unix, where it is defined in sys/types, so use "uschar" instead. */ + +typedef unsigned char uschar; + +/* Include the public PCRE header and the definitions of UCP character property +values. */ + +#include "pcre.h" +#include "ucp.h" + +/* When compiling for use with the Virtual Pascal compiler, these functions +need to have their names changed. PCRE must be compiled with the -DVPCOMPAT +option on the command line. */ + +#ifdef VPCOMPAT +#define strncmp(s1,s2,m) _strncmp(s1,s2,m) +#define memcpy(d,s,n) _memcpy(d,s,n) +#define memmove(d,s,n) _memmove(d,s,n) +#define memset(s,c,n) _memset(s,c,n) +#else /* VPCOMPAT */ + +/* To cope with SunOS4 and other systems that lack memmove() but have bcopy(), +define a macro for memmove() if HAVE_MEMMOVE is false, provided that HAVE_BCOPY +is set. Otherwise, include an emulating function for those systems that have +neither (there some non-Unix environments where this is the case). This assumes +that all calls to memmove are moving strings upwards in store, which is the +case in PCRE. */ + +#if ! HAVE_MEMMOVE +#undef memmove /* some systems may have a macro */ +#if HAVE_BCOPY +#define memmove(a, b, c) bcopy(b, a, c) +#else /* HAVE_BCOPY */ +void * +pcre_memmove(unsigned char *dest, const unsigned char *src, size_t n) +{ +int i; +dest += n; +src += n; +for (i = 0; i < n; ++i) *(--dest) = *(--src); +} +#define memmove(a, b, c) pcre_memmove(a, b, c) +#endif /* not HAVE_BCOPY */ +#endif /* not HAVE_MEMMOVE */ +#endif /* not VPCOMPAT */ + + +/* PCRE keeps offsets in its compiled code as 2-byte quantities (always stored +in big-endian order) by default. These are used, for example, to link from the +start of a subpattern to its alternatives and its end. The use of 2 bytes per +offset limits the size of the compiled regex to around 64K, which is big enough +for almost everybody. However, I received a request for an even bigger limit. +For this reason, and also to make the code easier to maintain, the storing and +loading of offsets from the byte string is now handled by the macros that are +defined here. + +The macros are controlled by the value of LINK_SIZE. This defaults to 2 in +the config.h file, but can be overridden by using -D on the command line. This +is automated on Unix systems via the "configure" command. */ + +#if LINK_SIZE == 2 + +#define PUT(a,n,d) \ + (a[n] = (d) >> 8), \ + (a[(n)+1] = (d) & 255) + +#define GET(a,n) \ + (((a)[n] << 8) | (a)[(n)+1]) + +#define MAX_PATTERN_SIZE (1 << 16) + + +#elif LINK_SIZE == 3 + +#define PUT(a,n,d) \ + (a[n] = (d) >> 16), \ + (a[(n)+1] = (d) >> 8), \ + (a[(n)+2] = (d) & 255) + +#define GET(a,n) \ + (((a)[n] << 16) | ((a)[(n)+1] << 8) | (a)[(n)+2]) + +#define MAX_PATTERN_SIZE (1 << 24) + + +#elif LINK_SIZE == 4 + +#define PUT(a,n,d) \ + (a[n] = (d) >> 24), \ + (a[(n)+1] = (d) >> 16), \ + (a[(n)+2] = (d) >> 8), \ + (a[(n)+3] = (d) & 255) + +#define GET(a,n) \ + (((a)[n] << 24) | ((a)[(n)+1] << 16) | ((a)[(n)+2] << 8) | (a)[(n)+3]) + +#define MAX_PATTERN_SIZE (1 << 30) /* Keep it positive */ + + +#else +#error LINK_SIZE must be either 2, 3, or 4 +#endif + + +/* Convenience macro defined in terms of the others */ + +#define PUTINC(a,n,d) PUT(a,n,d), a += LINK_SIZE + + +/* PCRE uses some other 2-byte quantities that do not change when the size of +offsets changes. There are used for repeat counts and for other things such as +capturing parenthesis numbers in back references. */ + +#define PUT2(a,n,d) \ + a[n] = (d) >> 8; \ + a[(n)+1] = (d) & 255 + +#define GET2(a,n) \ + (((a)[n] << 8) | (a)[(n)+1]) + +#define PUT2INC(a,n,d) PUT2(a,n,d), a += 2 + + +/* When UTF-8 encoding is being used, a character is no longer just a single +byte. The macros for character handling generate simple sequences when used in +byte-mode, and more complicated ones for UTF-8 characters. */ + +#ifndef SUPPORT_UTF8 +#define GETCHAR(c, eptr) c = *eptr; +#define GETCHARTEST(c, eptr) c = *eptr; +#define GETCHARINC(c, eptr) c = *eptr++; +#define GETCHARINCTEST(c, eptr) c = *eptr++; +#define GETCHARLEN(c, eptr, len) c = *eptr; +#define BACKCHAR(eptr) + +#else /* SUPPORT_UTF8 */ + +/* Get the next UTF-8 character, not advancing the pointer. This is called when +we know we are in UTF-8 mode. */ + +#define GETCHAR(c, eptr) \ + c = *eptr; \ + if ((c & 0xc0) == 0xc0) \ + { \ + int gcii; \ + int gcaa = _pcre_utf8_table4[c & 0x3f]; /* Number of additional bytes */ \ + int gcss = 6*gcaa; \ + c = (c & _pcre_utf8_table3[gcaa]) << gcss; \ + for (gcii = 1; gcii <= gcaa; gcii++) \ + { \ + gcss -= 6; \ + c |= (eptr[gcii] & 0x3f) << gcss; \ + } \ + } + +/* Get the next UTF-8 character, testing for UTF-8 mode, and not advancing the +pointer. */ + +#define GETCHARTEST(c, eptr) \ + c = *eptr; \ + if (utf8 && (c & 0xc0) == 0xc0) \ + { \ + int gcii; \ + int gcaa = _pcre_utf8_table4[c & 0x3f]; /* Number of additional bytes */ \ + int gcss = 6*gcaa; \ + c = (c & _pcre_utf8_table3[gcaa]) << gcss; \ + for (gcii = 1; gcii <= gcaa; gcii++) \ + { \ + gcss -= 6; \ + c |= (eptr[gcii] & 0x3f) << gcss; \ + } \ + } + +/* Get the next UTF-8 character, advancing the pointer. This is called when we +know we are in UTF-8 mode. */ + +#define GETCHARINC(c, eptr) \ + c = *eptr++; \ + if ((c & 0xc0) == 0xc0) \ + { \ + int gcaa = _pcre_utf8_table4[c & 0x3f]; /* Number of additional bytes */ \ + int gcss = 6*gcaa; \ + c = (c & _pcre_utf8_table3[gcaa]) << gcss; \ + while (gcaa-- > 0) \ + { \ + gcss -= 6; \ + c |= (*eptr++ & 0x3f) << gcss; \ + } \ + } + +/* Get the next character, testing for UTF-8 mode, and advancing the pointer */ + +#define GETCHARINCTEST(c, eptr) \ + c = *eptr++; \ + if (utf8 && (c & 0xc0) == 0xc0) \ + { \ + int gcaa = _pcre_utf8_table4[c & 0x3f]; /* Number of additional bytes */ \ + int gcss = 6*gcaa; \ + c = (c & _pcre_utf8_table3[gcaa]) << gcss; \ + while (gcaa-- > 0) \ + { \ + gcss -= 6; \ + c |= (*eptr++ & 0x3f) << gcss; \ + } \ + } + +/* Get the next UTF-8 character, not advancing the pointer, incrementing length +if there are extra bytes. This is called when we know we are in UTF-8 mode. */ + +#define GETCHARLEN(c, eptr, len) \ + c = *eptr; \ + if ((c & 0xc0) == 0xc0) \ + { \ + int gcii; \ + int gcaa = _pcre_utf8_table4[c & 0x3f]; /* Number of additional bytes */ \ + int gcss = 6*gcaa; \ + c = (c & _pcre_utf8_table3[gcaa]) << gcss; \ + for (gcii = 1; gcii <= gcaa; gcii++) \ + { \ + gcss -= 6; \ + c |= (eptr[gcii] & 0x3f) << gcss; \ + } \ + len += gcaa; \ + } + +/* If the pointer is not at the start of a character, move it back until +it is. Called only in UTF-8 mode. */ + +#define BACKCHAR(eptr) while((*eptr & 0xc0) == 0x80) eptr--; + +#endif + + +/* In case there is no definition of offsetof() provided - though any proper +Standard C system should have one. */ + +#ifndef offsetof +#define offsetof(p_type,field) ((size_t)&(((p_type *)0)->field)) +#endif + + +/* These are the public options that can change during matching. */ + +#define PCRE_IMS (PCRE_CASELESS|PCRE_MULTILINE|PCRE_DOTALL) + +/* Private options flags start at the most significant end of the four bytes, +but skip the top bit so we can use ints for convenience without getting tangled +with negative values. The public options defined in pcre.h start at the least +significant end. Make sure they don't overlap! */ + +#define PCRE_FIRSTSET 0x40000000 /* first_byte is set */ +#define PCRE_REQCHSET 0x20000000 /* req_byte is set */ +#define PCRE_STARTLINE 0x10000000 /* start after \n for multiline */ +#define PCRE_ICHANGED 0x08000000 /* i option changes within regex */ +#define PCRE_NOPARTIAL 0x04000000 /* can't use partial with this regex */ + +/* Options for the "extra" block produced by pcre_study(). */ + +#define PCRE_STUDY_MAPPED 0x01 /* a map of starting chars exists */ + +/* Masks for identifying the public options that are permitted at compile +time, run time, or study time, respectively. */ + +#define PUBLIC_OPTIONS \ + (PCRE_CASELESS|PCRE_EXTENDED|PCRE_ANCHORED|PCRE_MULTILINE| \ + PCRE_DOTALL|PCRE_DOLLAR_ENDONLY|PCRE_EXTRA|PCRE_UNGREEDY|PCRE_UTF8| \ + PCRE_NO_AUTO_CAPTURE|PCRE_NO_UTF8_CHECK|PCRE_AUTO_CALLOUT|PCRE_FIRSTLINE) + +#define PUBLIC_EXEC_OPTIONS \ + (PCRE_ANCHORED|PCRE_NOTBOL|PCRE_NOTEOL|PCRE_NOTEMPTY|PCRE_NO_UTF8_CHECK| \ + PCRE_PARTIAL) + +#define PUBLIC_DFA_EXEC_OPTIONS \ + (PCRE_ANCHORED|PCRE_NOTBOL|PCRE_NOTEOL|PCRE_NOTEMPTY|PCRE_NO_UTF8_CHECK| \ + PCRE_PARTIAL|PCRE_DFA_SHORTEST|PCRE_DFA_RESTART) + +#define PUBLIC_STUDY_OPTIONS 0 /* None defined */ + +/* Magic number to provide a small check against being handed junk. Also used +to detect whether a pattern was compiled on a host of different endianness. */ + +#define MAGIC_NUMBER 0x50435245UL /* 'PCRE' */ + +/* Negative values for the firstchar and reqchar variables */ + +#define REQ_UNSET (-2) +#define REQ_NONE (-1) + +/* The maximum remaining length of subject we are prepared to search for a +req_byte match. */ + +#define REQ_BYTE_MAX 1000 + +/* Flags added to firstbyte or reqbyte; a "non-literal" item is either a +variable-length repeat, or a anything other than literal characters. */ + +#define REQ_CASELESS 0x0100 /* indicates caselessness */ +#define REQ_VARY 0x0200 /* reqbyte followed non-literal item */ + +/* Miscellaneous definitions */ + +typedef int BOOL; + +#ifndef __MWERKS__ +#define FALSE 0 +#define TRUE 1 +#endif + +/* Escape items that are just an encoding of a particular data value. Note that +ESC_n is defined as yet another macro, which is set in config.h to either \n +(the default) or \r (which some people want). */ + +#ifndef ESC_e +#define ESC_e 27 +#endif + +#ifndef ESC_f +#define ESC_f '\f' +#endif + +#ifndef ESC_n +#define ESC_n NEWLINE +#endif + +#ifndef ESC_r +#define ESC_r '\r' +#endif + +/* We can't officially use ESC_t because it is a POSIX reserved identifier +(presumably because of all the others like size_t). */ + +#ifndef ESC_tee +#define ESC_tee '\t' +#endif + +/* These are escaped items that aren't just an encoding of a particular data +value such as \n. They must have non-zero values, as check_escape() returns +their negation. Also, they must appear in the same order as in the opcode +definitions below, up to ESC_z. There's a dummy for OP_ANY because it +corresponds to "." rather than an escape sequence. The final one must be +ESC_REF as subsequent values are used for \1, \2, \3, etc. There is are two +tests in the code for an escape greater than ESC_b and less than ESC_Z to +detect the types that may be repeated. These are the types that consume +characters. If any new escapes are put in between that don't consume a +character, that code will have to change. */ + +enum { ESC_A = 1, ESC_G, ESC_B, ESC_b, ESC_D, ESC_d, ESC_S, ESC_s, ESC_W, + ESC_w, ESC_dum1, ESC_C, ESC_P, ESC_p, ESC_X, ESC_Z, ESC_z, ESC_E, + ESC_Q, ESC_REF }; + +/* Flag bits and data types for the extended class (OP_XCLASS) for classes that +contain UTF-8 characters with values greater than 255. */ + +#define XCL_NOT 0x01 /* Flag: this is a negative class */ +#define XCL_MAP 0x02 /* Flag: a 32-byte map is present */ + +#define XCL_END 0 /* Marks end of individual items */ +#define XCL_SINGLE 1 /* Single item (one multibyte char) follows */ +#define XCL_RANGE 2 /* A range (two multibyte chars) follows */ +#define XCL_PROP 3 /* Unicode property (one property code) follows */ +#define XCL_NOTPROP 4 /* Unicode inverted property (ditto) */ + + +/* Opcode table: OP_BRA must be last, as all values >= it are used for brackets +that extract substrings. Starting from 1 (i.e. after OP_END), the values up to +OP_EOD must correspond in order to the list of escapes immediately above. +Note that whenever this list is updated, the two macro definitions that follow +must also be updated to match. */ + +enum { + OP_END, /* 0 End of pattern */ + + /* Values corresponding to backslashed metacharacters */ + + OP_SOD, /* 1 Start of data: \A */ + OP_SOM, /* 2 Start of match (subject + offset): \G */ + OP_NOT_WORD_BOUNDARY, /* 3 \B */ + OP_WORD_BOUNDARY, /* 4 \b */ + OP_NOT_DIGIT, /* 5 \D */ + OP_DIGIT, /* 6 \d */ + OP_NOT_WHITESPACE, /* 7 \S */ + OP_WHITESPACE, /* 8 \s */ + OP_NOT_WORDCHAR, /* 9 \W */ + OP_WORDCHAR, /* 10 \w */ + OP_ANY, /* 11 Match any character */ + OP_ANYBYTE, /* 12 Match any byte (\C); different to OP_ANY for UTF-8 */ + OP_NOTPROP, /* 13 \P (not Unicode property) */ + OP_PROP, /* 14 \p (Unicode property) */ + OP_EXTUNI, /* 15 \X (extended Unicode sequence */ + OP_EODN, /* 16 End of data or \n at end of data: \Z. */ + OP_EOD, /* 17 End of data: \z */ + + OP_OPT, /* 18 Set runtime options */ + OP_CIRC, /* 19 Start of line - varies with multiline switch */ + OP_DOLL, /* 20 End of line - varies with multiline switch */ + OP_CHAR, /* 21 Match one character, casefully */ + OP_CHARNC, /* 22 Match one character, caselessly */ + OP_NOT, /* 23 Match anything but the following char */ + + OP_STAR, /* 24 The maximizing and minimizing versions of */ + OP_MINSTAR, /* 25 all these opcodes must come in pairs, with */ + OP_PLUS, /* 26 the minimizing one second. */ + OP_MINPLUS, /* 27 This first set applies to single characters */ + OP_QUERY, /* 28 */ + OP_MINQUERY, /* 29 */ + OP_UPTO, /* 30 From 0 to n matches */ + OP_MINUPTO, /* 31 */ + OP_EXACT, /* 32 Exactly n matches */ + + OP_NOTSTAR, /* 33 The maximizing and minimizing versions of */ + OP_NOTMINSTAR, /* 34 all these opcodes must come in pairs, with */ + OP_NOTPLUS, /* 35 the minimizing one second. */ + OP_NOTMINPLUS, /* 36 This set applies to "not" single characters */ + OP_NOTQUERY, /* 37 */ + OP_NOTMINQUERY, /* 38 */ + OP_NOTUPTO, /* 39 From 0 to n matches */ + OP_NOTMINUPTO, /* 40 */ + OP_NOTEXACT, /* 41 Exactly n matches */ + + OP_TYPESTAR, /* 42 The maximizing and minimizing versions of */ + OP_TYPEMINSTAR, /* 43 all these opcodes must come in pairs, with */ + OP_TYPEPLUS, /* 44 the minimizing one second. These codes must */ + OP_TYPEMINPLUS, /* 45 be in exactly the same order as those above. */ + OP_TYPEQUERY, /* 46 This set applies to character types such as \d */ + OP_TYPEMINQUERY, /* 47 */ + OP_TYPEUPTO, /* 48 From 0 to n matches */ + OP_TYPEMINUPTO, /* 49 */ + OP_TYPEEXACT, /* 50 Exactly n matches */ + + OP_CRSTAR, /* 51 The maximizing and minimizing versions of */ + OP_CRMINSTAR, /* 52 all these opcodes must come in pairs, with */ + OP_CRPLUS, /* 53 the minimizing one second. These codes must */ + OP_CRMINPLUS, /* 54 be in exactly the same order as those above. */ + OP_CRQUERY, /* 55 These are for character classes and back refs */ + OP_CRMINQUERY, /* 56 */ + OP_CRRANGE, /* 57 These are different to the three sets above. */ + OP_CRMINRANGE, /* 58 */ + + OP_CLASS, /* 59 Match a character class, chars < 256 only */ + OP_NCLASS, /* 60 Same, but the bitmap was created from a negative + class - the difference is relevant only when a UTF-8 + character > 255 is encountered. */ + + OP_XCLASS, /* 61 Extended class for handling UTF-8 chars within the + class. This does both positive and negative. */ + + OP_REF, /* 62 Match a back reference */ + OP_RECURSE, /* 63 Match a numbered subpattern (possibly recursive) */ + OP_CALLOUT, /* 64 Call out to external function if provided */ + + OP_ALT, /* 65 Start of alternation */ + OP_KET, /* 66 End of group that doesn't have an unbounded repeat */ + OP_KETRMAX, /* 67 These two must remain together and in this */ + OP_KETRMIN, /* 68 order. They are for groups the repeat for ever. */ + + /* The assertions must come before ONCE and COND */ + + OP_ASSERT, /* 69 Positive lookahead */ + OP_ASSERT_NOT, /* 70 Negative lookahead */ + OP_ASSERTBACK, /* 71 Positive lookbehind */ + OP_ASSERTBACK_NOT, /* 72 Negative lookbehind */ + OP_REVERSE, /* 73 Move pointer back - used in lookbehind assertions */ + + /* ONCE and COND must come after the assertions, with ONCE first, as there's + a test for >= ONCE for a subpattern that isn't an assertion. */ + + OP_ONCE, /* 74 Once matched, don't back up into the subpattern */ + OP_COND, /* 75 Conditional group */ + OP_CREF, /* 76 Used to hold an extraction string number (cond ref) */ + + OP_BRAZERO, /* 77 These two must remain together and in this */ + OP_BRAMINZERO, /* 78 order. */ + + OP_BRANUMBER, /* 79 Used for extracting brackets whose number is greater + than can fit into an opcode. */ + + OP_BRA /* 80 This and greater values are used for brackets that + extract substrings up to EXTRACT_BASIC_MAX. After + that, use is made of OP_BRANUMBER. */ +}; + +/* WARNING WARNING WARNING: There is an implicit assumption in pcre.c and +study.c that all opcodes are less than 128 in value. This makes handling UTF-8 +character sequences easier. */ + +/* The highest extraction number before we have to start using additional +bytes. (Originally PCRE didn't have support for extraction counts highter than +this number.) The value is limited by the number of opcodes left after OP_BRA, +i.e. 255 - OP_BRA. We actually set it a bit lower to leave room for additional +opcodes. */ + +#define EXTRACT_BASIC_MAX 100 + + +/* This macro defines textual names for all the opcodes. These are used only +for debugging. The macro is referenced only in pcre_printint.c. */ + +#define OP_NAME_LIST \ + "End", "\\A", "\\G", "\\B", "\\b", "\\D", "\\d", \ + "\\S", "\\s", "\\W", "\\w", "Any", "Anybyte", \ + "notprop", "prop", "extuni", \ + "\\Z", "\\z", \ + "Opt", "^", "$", "char", "charnc", "not", \ + "*", "*?", "+", "+?", "?", "??", "{", "{", "{", \ + "*", "*?", "+", "+?", "?", "??", "{", "{", "{", \ + "*", "*?", "+", "+?", "?", "??", "{", "{", "{", \ + "*", "*?", "+", "+?", "?", "??", "{", "{", \ + "class", "nclass", "xclass", "Ref", "Recurse", "Callout", \ + "Alt", "Ket", "KetRmax", "KetRmin", "Assert", "Assert not", \ + "AssertB", "AssertB not", "Reverse", "Once", "Cond", "Cond ref",\ + "Brazero", "Braminzero", "Branumber", "Bra" + + +/* This macro defines the length of fixed length operations in the compiled +regex. The lengths are used when searching for specific things, and also in the +debugging printing of a compiled regex. We use a macro so that it can be +defined close to the definitions of the opcodes themselves. + +As things have been extended, some of these are no longer fixed lenths, but are +minima instead. For example, the length of a single-character repeat may vary +in UTF-8 mode. The code that uses this table must know about such things. */ + +#define OP_LENGTHS \ + 1, /* End */ \ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* \A, \G, \B, \B, \D, \d, \S, \s, \W, \w */ \ + 1, 1, /* Any, Anybyte */ \ + 2, 2, 1, /* NOTPROP, PROP, EXTUNI */ \ + 1, 1, 2, 1, 1, /* \Z, \z, Opt, ^, $ */ \ + 2, /* Char - the minimum length */ \ + 2, /* Charnc - the minimum length */ \ + 2, /* not */ \ + /* Positive single-char repeats ** These are */ \ + 2, 2, 2, 2, 2, 2, /* *, *?, +, +?, ?, ?? ** minima in */ \ + 4, 4, 4, /* upto, minupto, exact ** UTF-8 mode */ \ + /* Negative single-char repeats - only for chars < 256 */ \ + 2, 2, 2, 2, 2, 2, /* NOT *, *?, +, +?, ?, ?? */ \ + 4, 4, 4, /* NOT upto, minupto, exact */ \ + /* Positive type repeats */ \ + 2, 2, 2, 2, 2, 2, /* Type *, *?, +, +?, ?, ?? */ \ + 4, 4, 4, /* Type upto, minupto, exact */ \ + /* Character class & ref repeats */ \ + 1, 1, 1, 1, 1, 1, /* *, *?, +, +?, ?, ?? */ \ + 5, 5, /* CRRANGE, CRMINRANGE */ \ + 33, /* CLASS */ \ + 33, /* NCLASS */ \ + 0, /* XCLASS - variable length */ \ + 3, /* REF */ \ + 1+LINK_SIZE, /* RECURSE */ \ + 2+2*LINK_SIZE, /* CALLOUT */ \ + 1+LINK_SIZE, /* Alt */ \ + 1+LINK_SIZE, /* Ket */ \ + 1+LINK_SIZE, /* KetRmax */ \ + 1+LINK_SIZE, /* KetRmin */ \ + 1+LINK_SIZE, /* Assert */ \ + 1+LINK_SIZE, /* Assert not */ \ + 1+LINK_SIZE, /* Assert behind */ \ + 1+LINK_SIZE, /* Assert behind not */ \ + 1+LINK_SIZE, /* Reverse */ \ + 1+LINK_SIZE, /* Once */ \ + 1+LINK_SIZE, /* COND */ \ + 3, /* CREF */ \ + 1, 1, /* BRAZERO, BRAMINZERO */ \ + 3, /* BRANUMBER */ \ + 1+LINK_SIZE /* BRA */ \ + + +/* A magic value for OP_CREF to indicate the "in recursion" condition. */ + +#define CREF_RECURSE 0xffff + +/* Error code numbers. They are given names so that they can more easily be +tracked. */ + +enum { ERR0, ERR1, ERR2, ERR3, ERR4, ERR5, ERR6, ERR7, ERR8, ERR9, + ERR10, ERR11, ERR12, ERR13, ERR14, ERR15, ERR16, ERR17, ERR18, ERR19, + ERR20, ERR21, ERR22, ERR23, ERR24, ERR25, ERR26, ERR27, ERR28, ERR29, + ERR30, ERR31, ERR32, ERR33, ERR34, ERR35, ERR36, ERR37, ERR38, ERR39, + ERR40, ERR41, ERR42, ERR43, ERR44, ERR45, ERR46, ERR47 }; + +/* The real format of the start of the pcre block; the index of names and the +code vector run on as long as necessary after the end. We store an explicit +offset to the name table so that if a regex is compiled on one host, saved, and +then run on another where the size of pointers is different, all might still +be well. For the case of compiled-on-4 and run-on-8, we include an extra +pointer that is always NULL. For future-proofing, a few dummy fields were +originally included - even though you can never get this planning right - but +there is only one left now. + +NOTE NOTE NOTE: +Because people can now save and re-use compiled patterns, any additions to this +structure should be made at the end, and something earlier (e.g. a new +flag in the options or one of the dummy fields) should indicate that the new +fields are present. Currently PCRE always sets the dummy fields to zero. +NOTE NOTE NOTE: +*/ + +typedef struct real_pcre { + pcre_uint32 magic_number; + pcre_uint32 size; /* Total that was malloced */ + pcre_uint32 options; + pcre_uint32 dummy1; /* For future use, maybe */ + + pcre_uint16 top_bracket; + pcre_uint16 top_backref; + pcre_uint16 first_byte; + pcre_uint16 req_byte; + pcre_uint16 name_table_offset; /* Offset to name table that follows */ + pcre_uint16 name_entry_size; /* Size of any name items */ + pcre_uint16 name_count; /* Number of name items */ + pcre_uint16 ref_count; /* Reference count */ + + const unsigned char *tables; /* Pointer to tables or NULL for std */ + const unsigned char *nullpad; /* NULL padding */ +} real_pcre; + +/* The format of the block used to store data from pcre_study(). The same +remark (see NOTE above) about extending this structure applies. */ + +typedef struct pcre_study_data { + pcre_uint32 size; /* Total that was malloced */ + pcre_uint32 options; + uschar start_bits[32]; +} pcre_study_data; + +/* Structure for passing "static" information around between the functions +doing the compiling, so that they are thread-safe. */ + +typedef struct compile_data { + const uschar *lcc; /* Points to lower casing table */ + const uschar *fcc; /* Points to case-flipping table */ + const uschar *cbits; /* Points to character type table */ + const uschar *ctypes; /* Points to table of type maps */ + const uschar *start_code; /* The start of the compiled code */ + const uschar *start_pattern; /* The start of the pattern */ + uschar *name_table; /* The name/number table */ + int names_found; /* Number of entries so far */ + int name_entry_size; /* Size of each entry */ + int top_backref; /* Maximum back reference */ + unsigned int backref_map; /* Bitmap of low back refs */ + int req_varyopt; /* "After variable item" flag for reqbyte */ + BOOL nopartial; /* Set TRUE if partial won't work */ +} compile_data; + +/* Structure for maintaining a chain of pointers to the currently incomplete +branches, for testing for left recursion. */ + +typedef struct branch_chain { + struct branch_chain *outer; + uschar *current; +} branch_chain; + +/* Structure for items in a linked list that represents an explicit recursive +call within the pattern. */ + +typedef struct recursion_info { + struct recursion_info *prevrec; /* Previous recursion record (or NULL) */ + int group_num; /* Number of group that was called */ + const uschar *after_call; /* "Return value": points after the call in the expr */ + const uschar *save_start; /* Old value of md->start_match */ + int *offset_save; /* Pointer to start of saved offsets */ + int saved_max; /* Number of saved offsets */ +} recursion_info; + +/* When compiling in a mode that doesn't use recursive calls to match(), +a structure is used to remember local variables on the heap. It is defined in +pcre.c, close to the match() function, so that it is easy to keep it in step +with any changes of local variable. However, the pointer to the current frame +must be saved in some "static" place over a longjmp(). We declare the +structure here so that we can put a pointer in the match_data structure. +NOTE: This isn't used for a "normal" compilation of pcre. */ + +struct heapframe; + +/* Structure for passing "static" information around between the functions +doing traditional NFA matching, so that they are thread-safe. */ + +typedef struct match_data { + unsigned long int match_call_count; /* As it says */ + unsigned long int match_limit;/* As it says */ + int *offset_vector; /* Offset vector */ + int offset_end; /* One past the end */ + int offset_max; /* The maximum usable for return data */ + const uschar *lcc; /* Points to lower casing table */ + const uschar *ctypes; /* Points to table of type maps */ + BOOL offset_overflow; /* Set if too many extractions */ + BOOL notbol; /* NOTBOL flag */ + BOOL noteol; /* NOTEOL flag */ + BOOL utf8; /* UTF8 flag */ + BOOL endonly; /* Dollar not before final \n */ + BOOL notempty; /* Empty string match not wanted */ + BOOL partial; /* PARTIAL flag */ + BOOL hitend; /* Hit the end of the subject at some point */ + const uschar *start_code; /* For use when recursing */ + const uschar *start_subject; /* Start of the subject string */ + const uschar *end_subject; /* End of the subject string */ + const uschar *start_match; /* Start of this match attempt */ + const uschar *end_match_ptr; /* Subject position at end match */ + int end_offset_top; /* Highwater mark at end of match */ + int capture_last; /* Most recent capture number */ + int start_offset; /* The start offset value */ + recursion_info *recursive; /* Linked list of recursion data */ + void *callout_data; /* To pass back to callouts */ + struct heapframe *thisframe; /* Used only when compiling for no recursion */ +} match_data; + +/* A similar structure is used for the same purpose by the DFA matching +functions. */ + +typedef struct dfa_match_data { + const uschar *start_code; /* Start of the compiled pattern */ + const uschar *start_subject; /* Start of the subject string */ + const uschar *end_subject; /* End of subject string */ + const uschar *tables; /* Character tables */ + int moptions; /* Match options */ + int poptions; /* Pattern options */ + void *callout_data; /* To pass back to callouts */ +} dfa_match_data; + +/* Bit definitions for entries in the pcre_ctypes table. */ + +#define ctype_space 0x01 +#define ctype_letter 0x02 +#define ctype_digit 0x04 +#define ctype_xdigit 0x08 +#define ctype_word 0x10 /* alphameric or '_' */ +#define ctype_meta 0x80 /* regexp meta char or zero (end pattern) */ + +/* Offsets for the bitmap tables in pcre_cbits. Each table contains a set +of bits for a class map. Some classes are built by combining these tables. */ + +#define cbit_space 0 /* [:space:] or \s */ +#define cbit_xdigit 32 /* [:xdigit:] */ +#define cbit_digit 64 /* [:digit:] or \d */ +#define cbit_upper 96 /* [:upper:] */ +#define cbit_lower 128 /* [:lower:] */ +#define cbit_word 160 /* [:word:] or \w */ +#define cbit_graph 192 /* [:graph:] */ +#define cbit_print 224 /* [:print:] */ +#define cbit_punct 256 /* [:punct:] */ +#define cbit_cntrl 288 /* [:cntrl:] */ +#define cbit_length 320 /* Length of the cbits table */ + +/* Offsets of the various tables from the base tables pointer, and +total length. */ + +#define lcc_offset 0 +#define fcc_offset 256 +#define cbits_offset 512 +#define ctypes_offset (cbits_offset + cbit_length) +#define tables_length (ctypes_offset + 256) + +/* Layout of the UCP type table that translates property names into codes for +pcre_ucp_findchar(). */ + +typedef struct { + const char *name; + int value; +} ucp_type_table; + + +/* Internal shared data tables. These are tables that are used by more than one +of the exported public functions. They have to be "external" in the C sense, +but are not part of the PCRE public API. The data for these tables is in the +pcre_tables.c module. */ + +extern const int _pcre_utf8_table1[]; +extern const int _pcre_utf8_table2[]; +extern const int _pcre_utf8_table3[]; +extern const uschar _pcre_utf8_table4[]; + +extern const int _pcre_utf8_table1_size; + +extern const ucp_type_table _pcre_utt[]; +extern const int _pcre_utt_size; + +extern const uschar _pcre_default_tables[]; + +extern const uschar _pcre_OP_lengths[]; + + +/* Internal shared functions. These are functions that are used by more than +one of the exported public functions. They have to be "external" in the C +sense, but are not part of the PCRE public API. */ + +extern int _pcre_ord2utf8(int, uschar *); +extern real_pcre * _pcre_try_flipped(const real_pcre *, real_pcre *, + const pcre_study_data *, pcre_study_data *); +extern int _pcre_ucp_findchar(const int, int *, int *); +extern int _pcre_valid_utf8(const uschar *, int); +extern BOOL _pcre_xclass(int, const uschar *); + +#endif + +/* End of pcre_internal.h */ diff --git a/mozilla/js/tamarin/pcre/pcre_maketables.cpp b/mozilla/js/tamarin/pcre/pcre_maketables.cpp new file mode 100644 index 00000000000..5417c00d945 --- /dev/null +++ b/mozilla/js/tamarin/pcre/pcre_maketables.cpp @@ -0,0 +1,147 @@ +#include "avmplus.h" + +/************************************************* +* Perl-Compatible Regular Expressions * +*************************************************/ + +/* PCRE is a library of functions to support regular expressions whose syntax +and semantics are as close as possible to those of the Perl 5 language. + + Written by Philip Hazel + Copyright (c) 1997-2005 University of Cambridge + +----------------------------------------------------------------------------- +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + * Neither the name of the University of Cambridge nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +----------------------------------------------------------------------------- +*/ + + +/* This module contains the external function pcre_maketables(), which builds +character tables for PCRE in the current locale. The file is compiled on its +own as part of the PCRE library. However, it is also included in the +compilation of dftables.c, in which case the macro DFTABLES is defined. */ + + +#ifndef DFTABLES +#include "pcre_internal.h" +#endif + + +/************************************************* +* Create PCRE character tables * +*************************************************/ + +/* This function builds a set of character tables for use by PCRE and returns +a pointer to them. They are build using the ctype functions, and consequently +their contents will depend upon the current locale setting. When compiled as +part of the library, the store is obtained via pcre_malloc(), but when compiled +inside dftables, use malloc(). + +Arguments: none +Returns: pointer to the contiguous block of data +*/ + +const unsigned char * +pcre_maketables(void) +{ +unsigned char *yield, *p; +int i; + +#ifndef DFTABLES +yield = (unsigned char*)(pcre_malloc)(tables_length); +#else +yield = (unsigned char*)malloc(tables_length); +#endif + +if (yield == NULL) return NULL; +p = yield; + +/* First comes the lower casing table */ + +for (i = 0; i < 256; i++) *p++ = tolower(i); + +/* Next the case-flipping table */ + +for (i = 0; i < 256; i++) *p++ = islower(i)? toupper(i) : tolower(i); + +/* Then the character class tables. Don't try to be clever and save effort +on exclusive ones - in some locales things may be different. Note that the +table for "space" includes everything "isspace" gives, including VT in the +default locale. This makes it work for the POSIX class [:space:]. */ + +memset(p, 0, cbit_length); +for (i = 0; i < 256; i++) + { + if (isdigit(i)) + { + p[cbit_digit + i/8] |= 1 << (i&7); + p[cbit_word + i/8] |= 1 << (i&7); + } + if (isupper(i)) + { + p[cbit_upper + i/8] |= 1 << (i&7); + p[cbit_word + i/8] |= 1 << (i&7); + } + if (islower(i)) + { + p[cbit_lower + i/8] |= 1 << (i&7); + p[cbit_word + i/8] |= 1 << (i&7); + } + if (i == '_') p[cbit_word + i/8] |= 1 << (i&7); + if (isspace(i)) p[cbit_space + i/8] |= 1 << (i&7); + if (isxdigit(i))p[cbit_xdigit + i/8] |= 1 << (i&7); + if (isgraph(i)) p[cbit_graph + i/8] |= 1 << (i&7); + if (isprint(i)) p[cbit_print + i/8] |= 1 << (i&7); + if (ispunct(i)) p[cbit_punct + i/8] |= 1 << (i&7); + if (iscntrl(i)) p[cbit_cntrl + i/8] |= 1 << (i&7); + } +p += cbit_length; + +/* Finally, the character type table. In this, we exclude VT from the white +space chars, because Perl doesn't recognize it as such for \s and for comments +within regexes. */ + +for (i = 0; i < 256; i++) + { + int x = 0; + if (i != 0x0b && isspace(i)) x += ctype_space; + if (isalpha(i)) x += ctype_letter; + if (isdigit(i)) x += ctype_digit; + if (isxdigit(i)) x += ctype_xdigit; + if (isalnum(i) || i == '_') x += ctype_word; + + /* Note: strchr includes the terminating zero in the characters it considers. + In this instance, that is ok because we want binary zero to be flagged as a + meta-character, which in this sense is any character that terminates a run + of data characters. */ + + if (strchr("*+?{^.$|()[", i) != 0) x += ctype_meta; *p++ = x; } + +return yield; +} + +/* End of pcre_maketables.c */ diff --git a/mozilla/js/tamarin/pcre/pcre_ord2utf8.cpp b/mozilla/js/tamarin/pcre/pcre_ord2utf8.cpp new file mode 100644 index 00000000000..f15acb204bc --- /dev/null +++ b/mozilla/js/tamarin/pcre/pcre_ord2utf8.cpp @@ -0,0 +1,80 @@ +#include "avmplus.h" + +/************************************************* +* Perl-Compatible Regular Expressions * +*************************************************/ + +/* PCRE is a library of functions to support regular expressions whose syntax +and semantics are as close as possible to those of the Perl 5 language. + + Written by Philip Hazel + Copyright (c) 1997-2005 University of Cambridge + +----------------------------------------------------------------------------- +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + * Neither the name of the University of Cambridge nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +----------------------------------------------------------------------------- +*/ + + +/* This file contains a private PCRE function that converts an ordinal +character value into a UTF8 string. */ + + +#include "pcre_internal.h" + + +/************************************************* +* Convert character value to UTF-8 * +*************************************************/ + +/* This function takes an integer value in the range 0 - 0x7fffffff +and encodes it as a UTF-8 character in 0 to 6 bytes. + +Arguments: + cvalue the character value + buffer pointer to buffer for result - at least 6 bytes long + +Returns: number of characters placed in the buffer +*/ + +PCRE_EXPORT int +_pcre_ord2utf8(int cvalue, uschar *buffer) +{ +register int i, j; +for (i = 0; i < _pcre_utf8_table1_size; i++) + if (cvalue <= _pcre_utf8_table1[i]) break; +buffer += i; +for (j = i; j > 0; j--) + { + *buffer-- = 0x80 | (cvalue & 0x3f); + cvalue >>= 6; + } +*buffer = _pcre_utf8_table2[i] | cvalue; +return i + 1; +} + +/* End of pcre_ord2utf8.c */ diff --git a/mozilla/js/tamarin/pcre/pcre_printint.src b/mozilla/js/tamarin/pcre/pcre_printint.src new file mode 100644 index 00000000000..c0cbcff3689 --- /dev/null +++ b/mozilla/js/tamarin/pcre/pcre_printint.src @@ -0,0 +1,455 @@ +/************************************************* +* Perl-Compatible Regular Expressions * +*************************************************/ + +/* PCRE is a library of functions to support regular expressions whose syntax +and semantics are as close as possible to those of the Perl 5 language. + + Written by Philip Hazel + Copyright (c) 1997-2005 University of Cambridge + +----------------------------------------------------------------------------- +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + * Neither the name of the University of Cambridge nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +----------------------------------------------------------------------------- +*/ + + +/* This module contains a PCRE private debugging function for printing out the +internal form of a compiled regular expression, along with some supporting +local functions. This source file is used in two places: + +(1) It is #included by pcre_compile.c when it is compiled in debugging mode +(DEBUG defined in pcre_internal.h). It is not included in production compiles. + +(2) It is always #included by pcretest.c, which can be asked to print out a +compiled regex for debugging purposes. */ + + +static const char *OP_names[] = { OP_NAME_LIST }; + + +/************************************************* +* Print single- or multi-byte character * +*************************************************/ + +static int +print_char(FILE *f, uschar *ptr, BOOL utf8) +{ +int c = *ptr; + +if (!utf8 || (c & 0xc0) != 0xc0) + { + if (isprint(c)) fprintf(f, "%c", c); else fprintf(f, "\\x%02x", c); + return 0; + } +else + { + int i; + int a = _pcre_utf8_table4[c & 0x3f]; /* Number of additional bytes */ + int s = 6*a; + c = (c & _pcre_utf8_table3[a]) << s; + for (i = 1; i <= a; i++) + { + /* This is a check for malformed UTF-8; it should only occur if the sanity + check has been turned off. Rather than swallow random bytes, just stop if + we hit a bad one. Print it with \X instead of \x as an indication. */ + + if ((ptr[i] & 0xc0) != 0x80) + { + fprintf(f, "\\X{%x}", c); + return i - 1; + } + + /* The byte is OK */ + + s -= 6; + c |= (ptr[i] & 0x3f) << s; + } + if (c < 128) fprintf(f, "\\x%02x", c); else fprintf(f, "\\x{%x}", c); + return a; + } +} + + + +/************************************************* +* Find Unicode property name * +*************************************************/ + +static const char * +get_ucpname(int property) +{ +#ifdef SUPPORT_UCP +int i; +for (i = _pcre_utt_size; i >= 0; i--) + { + if (property == _pcre_utt[i].value) break; + } +return (i >= 0)? _pcre_utt[i].name : "??"; +#else +(void)property; +return "??"; +#endif +} + + + +/************************************************* +* Print compiled regex * +*************************************************/ + +/* Make this function work for a regex with integers either byte order. +However, we assume that what we are passed is a compiled regex. */ + +static void +pcre_printint(pcre *external_re, FILE *f) +{ +real_pcre *re = (real_pcre *)external_re; +uschar *codestart, *code; +BOOL utf8; + +unsigned int options = re->options; +int offset = re->name_table_offset; +int count = re->name_count; +int size = re->name_entry_size; + +if (re->magic_number != MAGIC_NUMBER) + { + offset = ((offset << 8) & 0xff00) | ((offset >> 8) & 0xff); + count = ((count << 8) & 0xff00) | ((count >> 8) & 0xff); + size = ((size << 8) & 0xff00) | ((size >> 8) & 0xff); + options = ((options << 24) & 0xff000000) | + ((options << 8) & 0x00ff0000) | + ((options >> 8) & 0x0000ff00) | + ((options >> 24) & 0x000000ff); + } + +code = codestart = (uschar *)re + offset + count * size; +utf8 = (options & PCRE_UTF8) != 0; + +for(;;) + { + uschar *ccode; + int c; + int extra = 0; + + fprintf(f, "%3d ", (int)(code - codestart)); + + if (*code >= OP_BRA) + { + if (*code - OP_BRA > EXTRACT_BASIC_MAX) + fprintf(f, "%3d Bra extra\n", GET(code, 1)); + else + fprintf(f, "%3d Bra %d\n", GET(code, 1), *code - OP_BRA); + code += _pcre_OP_lengths[OP_BRA]; + continue; + } + + switch(*code) + { + case OP_END: + fprintf(f, " %s\n", OP_names[*code]); + fprintf(f, "------------------------------------------------------------------\n"); + return; + + case OP_OPT: + fprintf(f, " %.2x %s", code[1], OP_names[*code]); + break; + + case OP_CHAR: + { + fprintf(f, " "); + do + { + code++; + code += 1 + print_char(f, code, utf8); + } + while (*code == OP_CHAR); + fprintf(f, "\n"); + continue; + } + break; + + case OP_CHARNC: + { + fprintf(f, " NC "); + do + { + code++; + code += 1 + print_char(f, code, utf8); + } + while (*code == OP_CHARNC); + fprintf(f, "\n"); + continue; + } + break; + + case OP_KETRMAX: + case OP_KETRMIN: + case OP_ALT: + case OP_KET: + case OP_ASSERT: + case OP_ASSERT_NOT: + case OP_ASSERTBACK: + case OP_ASSERTBACK_NOT: + case OP_ONCE: + case OP_COND: + case OP_REVERSE: + fprintf(f, "%3d %s", GET(code, 1), OP_names[*code]); + break; + + case OP_BRANUMBER: + printf("%3d %s", GET2(code, 1), OP_names[*code]); + break; + + case OP_CREF: + if (GET2(code, 1) == CREF_RECURSE) + fprintf(f, " Cond recurse"); + else + fprintf(f, "%3d %s", GET2(code,1), OP_names[*code]); + break; + + case OP_STAR: + case OP_MINSTAR: + case OP_PLUS: + case OP_MINPLUS: + case OP_QUERY: + case OP_MINQUERY: + case OP_TYPESTAR: + case OP_TYPEMINSTAR: + case OP_TYPEPLUS: + case OP_TYPEMINPLUS: + case OP_TYPEQUERY: + case OP_TYPEMINQUERY: + fprintf(f, " "); + if (*code >= OP_TYPESTAR) + { + fprintf(f, "%s", OP_names[code[1]]); + if (code[1] == OP_PROP || code[1] == OP_NOTPROP) + { + fprintf(f, " %s ", get_ucpname(code[2])); + extra = 1; + } + } + else extra = print_char(f, code+1, utf8); + fprintf(f, "%s", OP_names[*code]); + break; + + case OP_EXACT: + case OP_UPTO: + case OP_MINUPTO: + fprintf(f, " "); + extra = print_char(f, code+3, utf8); + fprintf(f, "{"); + if (*code != OP_EXACT) fprintf(f, ","); + fprintf(f, "%d}", GET2(code,1)); + if (*code == OP_MINUPTO) fprintf(f, "?"); + break; + + case OP_TYPEEXACT: + case OP_TYPEUPTO: + case OP_TYPEMINUPTO: + fprintf(f, " %s", OP_names[code[3]]); + if (code[3] == OP_PROP || code[3] == OP_NOTPROP) + { + fprintf(f, " %s ", get_ucpname(code[4])); + extra = 1; + } + fprintf(f, "{"); + if (*code != OP_TYPEEXACT) fprintf(f, "0,"); + fprintf(f, "%d}", GET2(code,1)); + if (*code == OP_TYPEMINUPTO) fprintf(f, "?"); + break; + + case OP_NOT: + if (isprint(c = code[1])) fprintf(f, " [^%c]", c); + else fprintf(f, " [^\\x%02x]", c); + break; + + case OP_NOTSTAR: + case OP_NOTMINSTAR: + case OP_NOTPLUS: + case OP_NOTMINPLUS: + case OP_NOTQUERY: + case OP_NOTMINQUERY: + if (isprint(c = code[1])) fprintf(f, " [^%c]", c); + else fprintf(f, " [^\\x%02x]", c); + fprintf(f, "%s", OP_names[*code]); + break; + + case OP_NOTEXACT: + case OP_NOTUPTO: + case OP_NOTMINUPTO: + if (isprint(c = code[3])) fprintf(f, " [^%c]{", c); + else fprintf(f, " [^\\x%02x]{", c); + if (*code != OP_NOTEXACT) fprintf(f, "0,"); + fprintf(f, "%d}", GET2(code,1)); + if (*code == OP_NOTMINUPTO) fprintf(f, "?"); + break; + + case OP_RECURSE: + fprintf(f, "%3d %s", GET(code, 1), OP_names[*code]); + break; + + case OP_REF: + fprintf(f, " \\%d", GET2(code,1)); + ccode = code + _pcre_OP_lengths[*code]; + goto CLASS_REF_REPEAT; + + case OP_CALLOUT: + fprintf(f, " %s %d %d %d", OP_names[*code], code[1], GET(code,2), + GET(code, 2 + LINK_SIZE)); + break; + + case OP_PROP: + case OP_NOTPROP: + fprintf(f, " %s %s", OP_names[*code], get_ucpname(code[1])); + break; + + /* OP_XCLASS can only occur in UTF-8 mode. However, there's no harm in + having this code always here, and it makes it less messy without all those + #ifdefs. */ + + case OP_CLASS: + case OP_NCLASS: + case OP_XCLASS: + { + int i, min, max; + BOOL printmap; + + fprintf(f, " ["); + + if (*code == OP_XCLASS) + { + extra = GET(code, 1); + ccode = code + LINK_SIZE + 1; + printmap = (*ccode & XCL_MAP) != 0; + if ((*ccode++ & XCL_NOT) != 0) fprintf(f, "^"); + } + else + { + printmap = TRUE; + ccode = code + 1; + } + + /* Print a bit map */ + + if (printmap) + { + for (i = 0; i < 256; i++) + { + if ((ccode[i/8] & (1 << (i&7))) != 0) + { + int j; + for (j = i+1; j < 256; j++) + if ((ccode[j/8] & (1 << (j&7))) == 0) break; + if (i == '-' || i == ']') fprintf(f, "\\"); + if (isprint(i)) fprintf(f, "%c", i); else fprintf(f, "\\x%02x", i); + if (--j > i) + { + if (j != i + 1) fprintf(f, "-"); + if (j == '-' || j == ']') fprintf(f, "\\"); + if (isprint(j)) fprintf(f, "%c", j); else fprintf(f, "\\x%02x", j); + } + i = j; + } + } + ccode += 32; + } + + /* For an XCLASS there is always some additional data */ + + if (*code == OP_XCLASS) + { + int ch; + while ((ch = *ccode++) != XCL_END) + { + if (ch == XCL_PROP) + { + fprintf(f, "\\p{%s}", get_ucpname(*ccode++)); + } + else if (ch == XCL_NOTPROP) + { + fprintf(f, "\\P{%s}", get_ucpname(*ccode++)); + } + else + { + ccode += 1 + print_char(f, ccode, TRUE); + if (ch == XCL_RANGE) + { + fprintf(f, "-"); + ccode += 1 + print_char(f, ccode, TRUE); + } + } + } + } + + /* Indicate a non-UTF8 class which was created by negation */ + + fprintf(f, "]%s", (*code == OP_NCLASS)? " (neg)" : ""); + + /* Handle repeats after a class or a back reference */ + + CLASS_REF_REPEAT: + switch(*ccode) + { + case OP_CRSTAR: + case OP_CRMINSTAR: + case OP_CRPLUS: + case OP_CRMINPLUS: + case OP_CRQUERY: + case OP_CRMINQUERY: + fprintf(f, "%s", OP_names[*ccode]); + extra += _pcre_OP_lengths[*ccode]; + break; + + case OP_CRRANGE: + case OP_CRMINRANGE: + min = GET2(ccode,1); + max = GET2(ccode,3); + if (max == 0) fprintf(f, "{%d,}", min); + else fprintf(f, "{%d,%d}", min, max); + if (*ccode == OP_CRMINRANGE) fprintf(f, "?"); + extra += _pcre_OP_lengths[*ccode]; + break; + } + } + break; + + /* Anything else is just an item with no data*/ + + default: + fprintf(f, " %s", OP_names[*code]); + break; + } + + code += _pcre_OP_lengths[*code] + extra; + fprintf(f, "\n"); + } +} + +/* End of pcre_printint.src */ diff --git a/mozilla/js/tamarin/pcre/pcre_refcount.cpp b/mozilla/js/tamarin/pcre/pcre_refcount.cpp new file mode 100644 index 00000000000..08b9322211e --- /dev/null +++ b/mozilla/js/tamarin/pcre/pcre_refcount.cpp @@ -0,0 +1,79 @@ +#include "avmplus.h" + +/************************************************* +* Perl-Compatible Regular Expressions * +*************************************************/ + +/* PCRE is a library of functions to support regular expressions whose syntax +and semantics are as close as possible to those of the Perl 5 language. + + Written by Philip Hazel + Copyright (c) 1997-2005 University of Cambridge + +----------------------------------------------------------------------------- +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + * Neither the name of the University of Cambridge nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +----------------------------------------------------------------------------- +*/ + + +/* This module contains the external function pcre_refcount(), which is an +auxiliary function that can be used to maintain a reference count in a compiled +pattern data block. This might be helpful in applications where the block is +shared by different users. */ + +#include "pcre_internal.h" + + +/************************************************* +* Maintain reference count * +*************************************************/ + +/* The reference count is a 16-bit field, initialized to zero. It is not +possible to transfer a non-zero count from one host to a different host that +has a different byte order - though I can't see why anyone in their right mind +would ever want to do that! + +Arguments: + argument_re points to compiled code + adjust value to add to the count + +Returns: the (possibly updated) count value (a non-negative number), or + a negative error number +*/ + +PCRE_EXPORT int +pcre_refcount(pcre *argument_re, int adjust) +{ +real_pcre *re = (real_pcre *)argument_re; +if (re == NULL) return PCRE_ERROR_NULL; +re->ref_count = (-adjust > re->ref_count)? 0 : + (adjust + re->ref_count > 65535)? 65535 : + re->ref_count + adjust; +return re->ref_count; +} + +/* End of pcre_refcount.c */ diff --git a/mozilla/js/tamarin/pcre/pcre_scanner.cc b/mozilla/js/tamarin/pcre/pcre_scanner.cc new file mode 100644 index 00000000000..4a66fdf0ba2 --- /dev/null +++ b/mozilla/js/tamarin/pcre/pcre_scanner.cc @@ -0,0 +1,169 @@ +// Copyright (c) 2005, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Author: Sanjay Ghemawat + +#include +#include // for count() +#include +#include "config.h" +#include "pcre_scanner.h" + +using std::vector; + +namespace pcrecpp { + +Scanner::Scanner() + : data_(), + input_(data_), + skip_(NULL), + should_skip_(false), + save_comments_(false), + comments_(NULL), + comments_offset_(0) { +} + +Scanner::Scanner(const string& in) + : data_(in), + input_(data_), + skip_(NULL), + should_skip_(false), + save_comments_(false), + comments_(NULL), + comments_offset_(0) { +} + +Scanner::~Scanner() { + delete skip_; + delete comments_; +} + +void Scanner::Skip(const char* re) { + delete skip_; + if (re != NULL) { + skip_ = new RE(re); + should_skip_ = true; + ConsumeSkip(); + } else { + skip_ = NULL; + should_skip_ = false; + } +} + +void Scanner::DisableSkip() { + assert(skip_ != NULL); + should_skip_ = false; +} + +void Scanner::EnableSkip() { + assert(skip_ != NULL); + should_skip_ = true; + ConsumeSkip(); +} + +int Scanner::LineNumber() const { + // TODO: Make it more efficient by keeping track of the last point + // where we computed line numbers and counting newlines since then. + return 1 + std::count(data_.data(), input_.data(), '\n'); +} + +int Scanner::Offset() const { + return input_.data() - data_.c_str(); +} + +bool Scanner::LookingAt(const RE& re) const { + int consumed; + return re.DoMatch(input_, RE::ANCHOR_START, &consumed, 0, 0); +} + + +bool Scanner::Consume(const RE& re, + const Arg& arg0, + const Arg& arg1, + const Arg& arg2) { + const bool result = re.Consume(&input_, arg0, arg1, arg2); + if (result && should_skip_) ConsumeSkip(); + return result; +} + +// helper function to consume *skip_ and honour save_comments_ +void Scanner::ConsumeSkip() { + if (save_comments_) { + if (NULL == comments_) { + comments_ = new vector; + } + const char *start_data = input_.data(); + skip_->Consume(&input_); + // already pointing one past end, so no need to +1 + int length = input_.data() - start_data; + if (length > 0) { + comments_->push_back(StringPiece(start_data, length)); + } + } else { + skip_->Consume(&input_); + } +} + + +void Scanner::GetComments(int start, int end, vector *ranges) { + // short circuit out if we've not yet initialized comments_ + // (e.g., when save_comments is false) + if (!comments_) { + return; + } + // TODO: if we guarantee that comments_ will contain StringPieces + // that are ordered by their start, then we can do a binary search + // for the first StringPiece at or past start and then scan for the + // ones contained in the range, quit early (use equal_range or + // lower_bound) + for (vector::const_iterator it = comments_->begin(); + it != comments_->end(); ++it) { + if ((it->data() >= data_.c_str() + start && + it->data() + it->size() <= data_.c_str() + end)) { + ranges->push_back(*it); + } + } +} + + +void Scanner::GetNextComments(vector *ranges) { + // short circuit out if we've not yet initialized comments_ + // (e.g., when save_comments is false) + if (!comments_) { + return; + } + for (vector::const_iterator it = + comments_->begin() + comments_offset_; + it != comments_->end(); ++it) { + ranges->push_back(*it); + ++comments_offset_; + } +} + +} // namespace pcrecpp diff --git a/mozilla/js/tamarin/pcre/pcre_scanner.h b/mozilla/js/tamarin/pcre/pcre_scanner.h new file mode 100644 index 00000000000..a73b72fd2d1 --- /dev/null +++ b/mozilla/js/tamarin/pcre/pcre_scanner.h @@ -0,0 +1,163 @@ +// Copyright (c) 2005, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Author: Sanjay Ghemawat +// +// Regular-expression based scanner for parsing an input stream. +// +// Example 1: parse a sequence of "var = number" entries from input: +// +// Scanner scanner(input); +// string var; +// int number; +// scanner.Skip("\\s+"); // Skip any white space we encounter +// while (scanner.Consume("(\\w+) = (\\d+)", &var, &number)) { +// ...; +// } + +#ifndef _PCRE_SCANNER_H +#define _PCRE_SCANNER_H + +#include +#include +#include +#include +#include + +namespace pcrecpp { + +class Scanner { + public: + Scanner(); + explicit Scanner(const std::string& input); + ~Scanner(); + + // Return current line number. The returned line-number is + // one-based. I.e. it returns 1 + the number of consumed newlines. + // + // Note: this method may be slow. It may take time proportional to + // the size of the input. + int LineNumber() const; + + // Return the byte-offset that the scanner is looking in the + // input data; + int Offset() const; + + // Return true iff the start of the remaining input matches "re" + bool LookingAt(const RE& re) const; + + // Return true iff all of the following are true + // a. the start of the remaining input matches "re", + // b. if any arguments are supplied, matched sub-patterns can be + // parsed and stored into the arguments. + // If it returns true, it skips over the matched input and any + // following input that matches the "skip" regular expression. + bool Consume(const RE& re, + const Arg& arg0 = no_arg, + const Arg& arg1 = no_arg, + const Arg& arg2 = no_arg + // TODO: Allow more arguments? + ); + + // Set the "skip" regular expression. If after consuming some data, + // a prefix of the input matches this RE, it is automatically + // skipped. For example, a programming language scanner would use + // a skip RE that matches white space and comments. + // + // scanner.Skip("(\\s|//.*|/[*](.|\n)*?[*]/)*"); + // + // You can pass NULL for "re" if you do not want any data to be skipped. + void Skip(const char* re); + + // Temporarily pause "skip"ing. This + // Skip("Foo"); code ; DisableSkip(); code; EnableSkip() + // is similar to + // Skip("Foo"); code ; Skip(NULL); code ; Skip("Foo"); + // but avoids creating/deleting new RE objects. + void DisableSkip(); + + // Reenable previously paused skipping. Any prefix of the input + // that matches the skip pattern is immediately dropped. + void EnableSkip(); + + /***** Special wrappers around SetSkip() for some common idioms *****/ + + // Arranges to skip whitespace, C comments, C++ comments. + // The overall RE is a repeated disjunction of the following REs: + // \\s whitespace + // //.*\n C++ comment + // /[*](.|\n)*?[*]/ C comment (x*? means minimal repetitions of x) + void SkipCXXComments() { + Skip("((\\s|//.*\n|/[*](.|\n)*?[*]/)*)"); + } + + void set_save_comments(bool comments) { + save_comments_ = comments; + } + + bool save_comments() { + return save_comments_; + } + + // Append to vector ranges the comments found in the + // byte range [start,end] (inclusive) of the input data. + // Only comments that were extracted entirely within that + // range are returned: no range splitting of atomically-extracted + // comments is performed. + void GetComments(int start, int end, std::vector *ranges); + + // Append to vector ranges the comments added + // since the last time this was called. This + // functionality is provided for efficiency when + // interleaving scanning with parsing. + void GetNextComments(std::vector *ranges); + + private: + std::string data_; // All the input data + StringPiece input_; // Unprocessed input + RE* skip_; // If non-NULL, RE for skipping input + bool should_skip_; // If true, use skip_ + bool save_comments_; // If true, aggregate the skip expression + + // the skipped comments + // TODO: later consider requiring that the StringPieces be added + // in order by their start position + std::vector *comments_; + + // the offset into comments_ that has been returned by GetNextComments + int comments_offset_; + + // helper function to consume *skip_ and honour + // save_comments_ + void ConsumeSkip(); +}; + +} // namespace pcrecpp + +#endif /* _PCRE_SCANNER_H */ diff --git a/mozilla/js/tamarin/pcre/pcre_scanner_unittest.cc b/mozilla/js/tamarin/pcre/pcre_scanner_unittest.cc new file mode 100644 index 00000000000..e000a078d59 --- /dev/null +++ b/mozilla/js/tamarin/pcre/pcre_scanner_unittest.cc @@ -0,0 +1,125 @@ +// Copyright (c) 2005, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Author: Greg J. Badros +// +// Unittest for scanner, especially GetNextComments and GetComments() +// functionality. + +#include +#include +#include +#include + +// Dies with a fatal error if the two values are not equal. +#define CHECK_EQ(a, b) do { \ + if ( (a) != (b) ) { \ + fprintf(stderr, "%s:%d: Check failed because %s != %s\n", \ + __FILE__, __LINE__, #a, #b); \ + exit(1); \ + } \ +} while (0) + +using std::vector; +using pcrecpp::StringPiece; +using pcrecpp::Scanner; + +static void TestScanner() { + const char input[] = "\n" + "alpha = 1; // this sets alpha\n" + "bravo = 2; // bravo is set here\n" + "gamma = 33; /* and here is gamma */\n"; + + const char *re = "(\\w+) = (\\d+);"; + + Scanner s(input); + string var; + int number; + s.SkipCXXComments(); + s.set_save_comments(true); + vector comments; + + s.Consume(re, &var, &number); + CHECK_EQ(var, "alpha"); + CHECK_EQ(number, 1); + s.GetNextComments(&comments); + CHECK_EQ(comments.size(), 1); + CHECK_EQ(comments[0].as_string(), " // this sets alpha\n"); + comments.resize(0); + + s.Consume(re, &var, &number); + CHECK_EQ(var, "bravo"); + CHECK_EQ(number, 2); + s.GetNextComments(&comments); + CHECK_EQ(comments.size(), 1); + CHECK_EQ(comments[0].as_string(), " // bravo is set here\n"); + comments.resize(0); + + s.Consume(re, &var, &number); + CHECK_EQ(var, "gamma"); + CHECK_EQ(number, 33); + s.GetNextComments(&comments); + CHECK_EQ(comments.size(), 1); + CHECK_EQ(comments[0].as_string(), " /* and here is gamma */\n"); + comments.resize(0); + + s.GetComments(0, sizeof(input), &comments); + CHECK_EQ(comments.size(), 3); + CHECK_EQ(comments[0].as_string(), " // this sets alpha\n"); + CHECK_EQ(comments[1].as_string(), " // bravo is set here\n"); + CHECK_EQ(comments[2].as_string(), " /* and here is gamma */\n"); + comments.resize(0); + + s.GetComments(0, strchr(input, '/') - input, &comments); + CHECK_EQ(comments.size(), 0); + comments.resize(0); + + s.GetComments(strchr(input, '/') - input - 1, sizeof(input), + &comments); + CHECK_EQ(comments.size(), 3); + CHECK_EQ(comments[0].as_string(), " // this sets alpha\n"); + CHECK_EQ(comments[1].as_string(), " // bravo is set here\n"); + CHECK_EQ(comments[2].as_string(), " /* and here is gamma */\n"); + comments.resize(0); + + s.GetComments(strchr(input, '/') - input - 1, + strchr(input + 1, '\n') - input + 1, &comments); + CHECK_EQ(comments.size(), 1); + CHECK_EQ(comments[0].as_string(), " // this sets alpha\n"); + comments.resize(0); +} + +int main(int argc, char** argv) { + TestScanner(); + + // Done + printf("OK\n"); + + return 0; +} diff --git a/mozilla/js/tamarin/pcre/pcre_stringpiece.cc b/mozilla/js/tamarin/pcre/pcre_stringpiece.cc new file mode 100644 index 00000000000..dbdb509b3b6 --- /dev/null +++ b/mozilla/js/tamarin/pcre/pcre_stringpiece.cc @@ -0,0 +1,39 @@ +// Copyright (c) 2005, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Author: wilsonh@google.com (Wilson Hsieh) +// + +#include +#include "config.h" +#include "pcre_stringpiece.h" + +std::ostream& operator<<(std::ostream& o, const pcrecpp::StringPiece& piece) { + return (o << piece.as_string()); +} diff --git a/mozilla/js/tamarin/pcre/pcre_stringpiece.h.in b/mozilla/js/tamarin/pcre/pcre_stringpiece.h.in new file mode 100644 index 00000000000..7cc074d1372 --- /dev/null +++ b/mozilla/js/tamarin/pcre/pcre_stringpiece.h.in @@ -0,0 +1,172 @@ +// Copyright (c) 2005, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Author: Sanjay Ghemawat +// +// A string like object that points into another piece of memory. +// Useful for providing an interface that allows clients to easily +// pass in either a "const char*" or a "string". +// +// Arghh! I wish C++ literals were automatically of type "string". + +#ifndef _PCRE_STRINGPIECE_H +#define _PCRE_STRINGPIECE_H + +#include +#include +#include // for ostream forward-declaration + +#if @pcre_have_type_traits@ +#define HAVE_TYPE_TRAITS +#include +#elif @pcre_have_bits_type_traits@ +#define HAVE_TYPE_TRAITS +#include +#endif + +using std::string; + +namespace pcrecpp { + +class StringPiece { + private: + const char* ptr_; + int length_; + + public: + // We provide non-explicit singleton constructors so users can pass + // in a "const char*" or a "string" wherever a "StringPiece" is + // expected. + StringPiece() + : ptr_(NULL), length_(0) { } + StringPiece(const char* str) + : ptr_(str), length_(static_cast(strlen(str))) { } + StringPiece(const string& str) + : ptr_(str.data()), length_(static_cast(str.size())) { } + StringPiece(const char* offset, int len) + : ptr_(offset), length_(len) { } + + // data() may return a pointer to a buffer with embedded NULs, and the + // returned buffer may or may not be null terminated. Therefore it is + // typically a mistake to pass data() to a routine that expects a NUL + // terminated string. Use "as_string().c_str()" if you really need to do + // this. Or better yet, change your routine so it does not rely on NUL + // termination. + const char* data() const { return ptr_; } + int size() const { return length_; } + bool empty() const { return length_ == 0; } + + void clear() { ptr_ = NULL; length_ = 0; } + void set(const char* buffer, int len) { ptr_ = buffer; length_ = len; } + void set(const char* str) { + ptr_ = str; + length_ = static_cast(strlen(str)); + } + void set(const void* buffer, int len) { + ptr_ = reinterpret_cast(buffer); + length_ = len; + } + + char operator[](int i) const { return ptr_[i]; } + + void remove_prefix(int n) { + ptr_ += n; + length_ -= n; + } + + void remove_suffix(int n) { + length_ -= n; + } + + bool operator==(const StringPiece& x) const { + return ((length_ == x.length_) && + (memcmp(ptr_, x.ptr_, length_) == 0)); + } + bool operator!=(const StringPiece& x) const { + return !(*this == x); + } + +#define STRINGPIECE_BINARY_PREDICATE(cmp,auxcmp) \ + bool operator cmp (const StringPiece& x) const { \ + int r = memcmp(ptr_, x.ptr_, length_ < x.length_ ? length_ : x.length_); \ + return ((r auxcmp 0) || ((r == 0) && (length_ cmp x.length_))); \ + } + STRINGPIECE_BINARY_PREDICATE(<, <); + STRINGPIECE_BINARY_PREDICATE(<=, <); + STRINGPIECE_BINARY_PREDICATE(>=, >); + STRINGPIECE_BINARY_PREDICATE(>, >); +#undef STRINGPIECE_BINARY_PREDICATE + + int compare(const StringPiece& x) const { + int r = memcmp(ptr_, x.ptr_, length_ < x.length_ ? length_ : x.length_); + if (r == 0) { + if (length_ < x.length_) r = -1; + else if (length_ > x.length_) r = +1; + } + return r; + } + + string as_string() const { + return string(data(), size()); + } + + void CopyToString(string* target) const { + target->assign(ptr_, length_); + } + + // Does "this" start with "x" + bool starts_with(const StringPiece& x) const { + return ((length_ >= x.length_) && (memcmp(ptr_, x.ptr_, x.length_) == 0)); + } +}; + +} // namespace pcrecpp + +// ------------------------------------------------------------------ +// Functions used to create STL containers that use StringPiece +// Remember that a StringPiece's lifetime had better be less than +// that of the underlying string or char*. If it is not, then you +// cannot safely store a StringPiece into an STL container +// ------------------------------------------------------------------ + +#ifdef HAVE_TYPE_TRAITS +// This makes vector really fast for some STL implementations +template<> struct __type_traits { + typedef __true_type has_trivial_default_constructor; + typedef __true_type has_trivial_copy_constructor; + typedef __true_type has_trivial_assignment_operator; + typedef __true_type has_trivial_destructor; + typedef __true_type is_POD_type; +}; +#endif + +// allow StringPiece to be logged +std::ostream& operator<<(std::ostream& o, const pcrecpp::StringPiece& piece); + +#endif /* _PCRE_STRINGPIECE_H */ diff --git a/mozilla/js/tamarin/pcre/pcre_stringpiece_unittest.cc b/mozilla/js/tamarin/pcre/pcre_stringpiece_unittest.cc new file mode 100644 index 00000000000..d6a89e8c7a2 --- /dev/null +++ b/mozilla/js/tamarin/pcre/pcre_stringpiece_unittest.cc @@ -0,0 +1,145 @@ +// Copyright 2003 and onwards Google Inc. +// Author: Sanjay Ghemawat + +#include +#include +#include // for make_pair +#include + +// CHECK dies with a fatal error if condition is not true. It is *not* +// controlled by NDEBUG, so the check will be executed regardless of +// compilation mode. Therefore, it is safe to do things like: +// CHECK(fp->Write(x) == 4) +#define CHECK(condition) do { \ + if (!(condition)) { \ + fprintf(stderr, "%s:%d: Check failed: %s\n", \ + __FILE__, __LINE__, #condition); \ + exit(1); \ + } \ +} while (0) + +using std::map; +using std::make_pair; +using pcrecpp::StringPiece; + +static void CheckSTLComparator() { + string s1("foo"); + string s2("bar"); + string s3("baz"); + + StringPiece p1(s1); + StringPiece p2(s2); + StringPiece p3(s3); + + typedef map TestMap; + TestMap map; + + map.insert(make_pair(p1, 0)); + map.insert(make_pair(p2, 1)); + map.insert(make_pair(p3, 2)); + CHECK(map.size() == 3); + + TestMap::const_iterator iter = map.begin(); + CHECK(iter->second == 1); + ++iter; + CHECK(iter->second == 2); + ++iter; + CHECK(iter->second == 0); + ++iter; + CHECK(iter == map.end()); + + TestMap::iterator new_iter = map.find("zot"); + CHECK(new_iter == map.end()); + + new_iter = map.find("bar"); + CHECK(new_iter != map.end()); + + map.erase(new_iter); + CHECK(map.size() == 2); + + iter = map.begin(); + CHECK(iter->second == 2); + ++iter; + CHECK(iter->second == 0); + ++iter; + CHECK(iter == map.end()); +} + +static void CheckComparisonOperators() { +#define CMP_Y(op, x, y) \ + CHECK( (StringPiece((x)) op StringPiece((y)))); \ + CHECK( (StringPiece((x)).compare(StringPiece((y))) op 0)) + +#define CMP_N(op, x, y) \ + CHECK(!(StringPiece((x)) op StringPiece((y)))); \ + CHECK(!(StringPiece((x)).compare(StringPiece((y))) op 0)) + + CMP_Y(==, "", ""); + CMP_Y(==, "a", "a"); + CMP_Y(==, "aa", "aa"); + CMP_N(==, "a", ""); + CMP_N(==, "", "a"); + CMP_N(==, "a", "b"); + CMP_N(==, "a", "aa"); + CMP_N(==, "aa", "a"); + + CMP_N(!=, "", ""); + CMP_N(!=, "a", "a"); + CMP_N(!=, "aa", "aa"); + CMP_Y(!=, "a", ""); + CMP_Y(!=, "", "a"); + CMP_Y(!=, "a", "b"); + CMP_Y(!=, "a", "aa"); + CMP_Y(!=, "aa", "a"); + + CMP_Y(<, "a", "b"); + CMP_Y(<, "a", "aa"); + CMP_Y(<, "aa", "b"); + CMP_Y(<, "aa", "bb"); + CMP_N(<, "a", "a"); + CMP_N(<, "b", "a"); + CMP_N(<, "aa", "a"); + CMP_N(<, "b", "aa"); + CMP_N(<, "bb", "aa"); + + CMP_Y(<=, "a", "a"); + CMP_Y(<=, "a", "b"); + CMP_Y(<=, "a", "aa"); + CMP_Y(<=, "aa", "b"); + CMP_Y(<=, "aa", "bb"); + CMP_N(<=, "b", "a"); + CMP_N(<=, "aa", "a"); + CMP_N(<=, "b", "aa"); + CMP_N(<=, "bb", "aa"); + + CMP_N(>=, "a", "b"); + CMP_N(>=, "a", "aa"); + CMP_N(>=, "aa", "b"); + CMP_N(>=, "aa", "bb"); + CMP_Y(>=, "a", "a"); + CMP_Y(>=, "b", "a"); + CMP_Y(>=, "aa", "a"); + CMP_Y(>=, "b", "aa"); + CMP_Y(>=, "bb", "aa"); + + CMP_N(>, "a", "a"); + CMP_N(>, "a", "b"); + CMP_N(>, "a", "aa"); + CMP_N(>, "aa", "b"); + CMP_N(>, "aa", "bb"); + CMP_Y(>, "b", "a"); + CMP_Y(>, "aa", "a"); + CMP_Y(>, "b", "aa"); + CMP_Y(>, "bb", "aa"); + +#undef CMP_Y +#undef CMP_N +} + +int main(int argc, char** argv) { + CheckComparisonOperators(); + CheckSTLComparator(); + + printf("OK\n"); + return 0; +} diff --git a/mozilla/js/tamarin/pcre/pcre_study.cpp b/mozilla/js/tamarin/pcre/pcre_study.cpp new file mode 100644 index 00000000000..a2f1275be0d --- /dev/null +++ b/mozilla/js/tamarin/pcre/pcre_study.cpp @@ -0,0 +1,484 @@ +#include "avmplus.h" + +/************************************************* +* Perl-Compatible Regular Expressions * +*************************************************/ + +/* PCRE is a library of functions to support regular expressions whose syntax +and semantics are as close as possible to those of the Perl 5 language. + + Written by Philip Hazel + Copyright (c) 1997-2005 University of Cambridge + +----------------------------------------------------------------------------- +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + * Neither the name of the University of Cambridge nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +----------------------------------------------------------------------------- +*/ + + +/* This module contains the external function pcre_study(), along with local +supporting functions. */ + + +#include "pcre_internal.h" + + +/************************************************* +* Set a bit and maybe its alternate case * +*************************************************/ + +/* Given a character, set its bit in the table, and also the bit for the other +version of a letter if we are caseless. + +Arguments: + start_bits points to the bit map + c is the character + caseless the caseless flag + cd the block with char table pointers + +Returns: nothing +*/ + +static void +set_bit(uschar *start_bits, unsigned int c, BOOL caseless, compile_data *cd) +{ +start_bits[c/8] |= (1 << (c&7)); +if (caseless && (cd->ctypes[c] & ctype_letter) != 0) + start_bits[cd->fcc[c]/8] |= (1 << (cd->fcc[c]&7)); +} + + + +/************************************************* +* Create bitmap of starting chars * +*************************************************/ + +/* This function scans a compiled unanchored expression and attempts to build a +bitmap of the set of initial characters. If it can't, it returns FALSE. As time +goes by, we may be able to get more clever at doing this. + +Arguments: + code points to an expression + start_bits points to a 32-byte table, initialized to 0 + caseless the current state of the caseless flag + utf8 TRUE if in UTF-8 mode + cd the block with char table pointers + +Returns: TRUE if table built, FALSE otherwise +*/ + +static BOOL +set_start_bits(const uschar *code, uschar *start_bits, BOOL caseless, + BOOL utf8, compile_data *cd) +{ +register int c; + +/* This next statement and the later reference to dummy are here in order to +trick the optimizer of the IBM C compiler for OS/2 into generating correct +code. Apparently IBM isn't going to fix the problem, and we would rather not +disable optimization (in this module it actually makes a big difference, and +the pcre module can use all the optimization it can get). */ + +volatile int dummy; + +do + { + const uschar *tcode = code + 1 + LINK_SIZE; + BOOL try_next = TRUE; + + while (try_next) + { + /* If a branch starts with a bracket or a positive lookahead assertion, + recurse to set bits from within them. That's all for this branch. */ + + if ((int)*tcode >= OP_BRA || *tcode == OP_ASSERT) + { + if (!set_start_bits(tcode, start_bits, caseless, utf8, cd)) + return FALSE; + try_next = FALSE; + } + + else switch(*tcode) + { + default: + return FALSE; + + /* Skip over callout */ + + case OP_CALLOUT: + tcode += 2 + 2*LINK_SIZE; + break; + + /* Skip over extended extraction bracket number */ + + case OP_BRANUMBER: + tcode += 3; + break; + + /* Skip over lookbehind and negative lookahead assertions */ + + case OP_ASSERT_NOT: + case OP_ASSERTBACK: + case OP_ASSERTBACK_NOT: + do tcode += GET(tcode, 1); while (*tcode == OP_ALT); + tcode += 1+LINK_SIZE; + break; + + /* Skip over an option setting, changing the caseless flag */ + + case OP_OPT: + caseless = (tcode[1] & PCRE_CASELESS) != 0; + tcode += 2; + break; + + /* BRAZERO does the bracket, but carries on. */ + + case OP_BRAZERO: + case OP_BRAMINZERO: + if (!set_start_bits(++tcode, start_bits, caseless, utf8, cd)) + return FALSE; + dummy = 1; + do tcode += GET(tcode,1); while (*tcode == OP_ALT); + tcode += 1+LINK_SIZE; + break; + + /* Single-char * or ? sets the bit and tries the next item */ + + case OP_STAR: + case OP_MINSTAR: + case OP_QUERY: + case OP_MINQUERY: + set_bit(start_bits, tcode[1], caseless, cd); + tcode += 2; +#ifdef SUPPORT_UTF8 + if (utf8) while ((*tcode & 0xc0) == 0x80) tcode++; +#endif + break; + + /* Single-char upto sets the bit and tries the next */ + + case OP_UPTO: + case OP_MINUPTO: + set_bit(start_bits, tcode[3], caseless, cd); + tcode += 4; +#ifdef SUPPORT_UTF8 + if (utf8) while ((*tcode & 0xc0) == 0x80) tcode++; +#endif + break; + + /* At least one single char sets the bit and stops */ + + case OP_EXACT: /* Fall through */ + tcode += 2; + + case OP_CHAR: + case OP_CHARNC: + case OP_PLUS: + case OP_MINPLUS: + set_bit(start_bits, tcode[1], caseless, cd); + try_next = FALSE; + break; + + /* Single character type sets the bits and stops */ + + case OP_NOT_DIGIT: + for (c = 0; c < 32; c++) + start_bits[c] |= ~cd->cbits[c+cbit_digit]; + try_next = FALSE; + break; + + case OP_DIGIT: + for (c = 0; c < 32; c++) + start_bits[c] |= cd->cbits[c+cbit_digit]; + try_next = FALSE; + break; + + case OP_NOT_WHITESPACE: + for (c = 0; c < 32; c++) + start_bits[c] |= ~cd->cbits[c+cbit_space]; + try_next = FALSE; + break; + + case OP_WHITESPACE: + for (c = 0; c < 32; c++) + start_bits[c] |= cd->cbits[c+cbit_space]; + try_next = FALSE; + break; + + case OP_NOT_WORDCHAR: + for (c = 0; c < 32; c++) + start_bits[c] |= ~cd->cbits[c+cbit_word]; + try_next = FALSE; + break; + + case OP_WORDCHAR: + for (c = 0; c < 32; c++) + start_bits[c] |= cd->cbits[c+cbit_word]; + try_next = FALSE; + break; + + /* One or more character type fudges the pointer and restarts, knowing + it will hit a single character type and stop there. */ + + case OP_TYPEPLUS: + case OP_TYPEMINPLUS: + tcode++; + break; + + case OP_TYPEEXACT: + tcode += 3; + break; + + /* Zero or more repeats of character types set the bits and then + try again. */ + + case OP_TYPEUPTO: + case OP_TYPEMINUPTO: + tcode += 2; /* Fall through */ + + case OP_TYPESTAR: + case OP_TYPEMINSTAR: + case OP_TYPEQUERY: + case OP_TYPEMINQUERY: + switch(tcode[1]) + { + case OP_ANY: + return FALSE; + + case OP_NOT_DIGIT: + for (c = 0; c < 32; c++) + start_bits[c] |= ~cd->cbits[c+cbit_digit]; + break; + + case OP_DIGIT: + for (c = 0; c < 32; c++) + start_bits[c] |= cd->cbits[c+cbit_digit]; + break; + + case OP_NOT_WHITESPACE: + for (c = 0; c < 32; c++) + start_bits[c] |= ~cd->cbits[c+cbit_space]; + break; + + case OP_WHITESPACE: + for (c = 0; c < 32; c++) + start_bits[c] |= cd->cbits[c+cbit_space]; + break; + + case OP_NOT_WORDCHAR: + for (c = 0; c < 32; c++) + start_bits[c] |= ~cd->cbits[c+cbit_word]; + break; + + case OP_WORDCHAR: + for (c = 0; c < 32; c++) + start_bits[c] |= cd->cbits[c+cbit_word]; + break; + } + + tcode += 2; + break; + + /* Character class where all the information is in a bit map: set the + bits and either carry on or not, according to the repeat count. If it was + a negative class, and we are operating with UTF-8 characters, any byte + with a value >= 0xc4 is a potentially valid starter because it starts a + character with a value > 255. */ + + case OP_NCLASS: + if (utf8) + { + start_bits[24] |= 0xf0; /* Bits for 0xc4 - 0xc8 */ + memset(start_bits+25, 0xff, 7); /* Bits for 0xc9 - 0xff */ + } + /* Fall through */ + + case OP_CLASS: + { + tcode++; + + /* In UTF-8 mode, the bits in a bit map correspond to character + values, not to byte values. However, the bit map we are constructing is + for byte values. So we have to do a conversion for characters whose + value is > 127. In fact, there are only two possible starting bytes for + characters in the range 128 - 255. */ + + if (utf8) + { + for (c = 0; c < 16; c++) start_bits[c] |= tcode[c]; + for (c = 128; c < 256; c++) + { + if ((tcode[c/8] && (1 << (c&7))) != 0) + { + int d = (c >> 6) | 0xc0; /* Set bit for this starter */ + start_bits[d/8] |= (1 << (d&7)); /* and then skip on to the */ + c = (c & 0xc0) + 0x40 - 1; /* next relevant character. */ + } + } + } + + /* In non-UTF-8 mode, the two bit maps are completely compatible. */ + + else + { + for (c = 0; c < 32; c++) start_bits[c] |= tcode[c]; + } + + /* Advance past the bit map, and act on what follows */ + + tcode += 32; + switch (*tcode) + { + case OP_CRSTAR: + case OP_CRMINSTAR: + case OP_CRQUERY: + case OP_CRMINQUERY: + tcode++; + break; + + case OP_CRRANGE: + case OP_CRMINRANGE: + if (((tcode[1] << 8) + tcode[2]) == 0) tcode += 5; + else try_next = FALSE; + break; + + default: + try_next = FALSE; + break; + } + } + break; /* End of bitmap class handling */ + + } /* End of switch */ + } /* End of try_next loop */ + + code += GET(code, 1); /* Advance to next branch */ + } +while (*code == OP_ALT); +return TRUE; +} + + + +/************************************************* +* Study a compiled expression * +*************************************************/ + +/* This function is handed a compiled expression that it must study to produce +information that will speed up the matching. It returns a pcre_extra block +which then gets handed back to pcre_exec(). + +Arguments: + re points to the compiled expression + options contains option bits + errorptr points to where to place error messages; + set NULL unless error + +Returns: pointer to a pcre_extra block, with study_data filled in and the + appropriate flag set; + NULL on error or if no optimization possible +*/ + +PCRE_EXPORT pcre_extra * +pcre_study(const pcre *external_re, int options, const char **errorptr) +{ +uschar start_bits[32]; +pcre_extra *extra; +pcre_study_data *study; +const uschar *tables; +const real_pcre *re = (const real_pcre *)external_re; +uschar *code = (uschar *)re + re->name_table_offset + + (re->name_count * re->name_entry_size); +compile_data compile_block; + +*errorptr = NULL; + +if (re == NULL || re->magic_number != MAGIC_NUMBER) + { + *errorptr = "argument is not a compiled regular expression"; + return NULL; + } + +if ((options & ~PUBLIC_STUDY_OPTIONS) != 0) + { + *errorptr = "unknown or incorrect option bit(s) set"; + return NULL; + } + +/* For an anchored pattern, or an unanchored pattern that has a first char, or +a multiline pattern that matches only at "line starts", no further processing +at present. */ + +if ((re->options & (PCRE_ANCHORED|PCRE_FIRSTSET|PCRE_STARTLINE)) != 0) + return NULL; + +/* Set the character tables in the block that is passed around */ + +tables = re->tables; +if (tables == NULL) + (void)pcre_fullinfo(external_re, NULL, PCRE_INFO_DEFAULT_TABLES, + (void *)(&tables)); + +compile_block.lcc = tables + lcc_offset; +compile_block.fcc = tables + fcc_offset; +compile_block.cbits = tables + cbits_offset; +compile_block.ctypes = tables + ctypes_offset; + +/* See if we can find a fixed set of initial characters for the pattern. */ + +memset(start_bits, 0, 32 * sizeof(uschar)); +if (!set_start_bits(code, start_bits, (re->options & PCRE_CASELESS) != 0, + (re->options & PCRE_UTF8) != 0, &compile_block)) return NULL; + +/* Get a pcre_extra block and a pcre_study_data block. The study data is put in +the latter, which is pointed to by the former, which may also get additional +data set later by the calling program. At the moment, the size of +pcre_study_data is fixed. We nevertheless save it in a field for returning via +the pcre_fullinfo() function so that if it becomes variable in the future, we +don't have to change that code. */ + +extra = (pcre_extra *)(pcre_malloc) + (sizeof(pcre_extra) + sizeof(pcre_study_data)); + +if (extra == NULL) + { + *errorptr = "failed to get memory"; + return NULL; + } + +study = (pcre_study_data *)((char *)extra + sizeof(pcre_extra)); +extra->flags = PCRE_EXTRA_STUDY_DATA; +extra->study_data = study; + +study->size = sizeof(pcre_study_data); +study->options = PCRE_STUDY_MAPPED; +memcpy(study->start_bits, start_bits, sizeof(start_bits)); + +return extra; +} + +/* End of pcre_study.c */ diff --git a/mozilla/js/tamarin/pcre/pcre_tables.cpp b/mozilla/js/tamarin/pcre/pcre_tables.cpp new file mode 100644 index 00000000000..154ebd7ae37 --- /dev/null +++ b/mozilla/js/tamarin/pcre/pcre_tables.cpp @@ -0,0 +1,132 @@ +#include "avmplus.h" + +/************************************************* +* Perl-Compatible Regular Expressions * +*************************************************/ + +/* PCRE is a library of functions to support regular expressions whose syntax +and semantics are as close as possible to those of the Perl 5 language. + + Written by Philip Hazel + Copyright (c) 1997-2005 University of Cambridge + +----------------------------------------------------------------------------- +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + * Neither the name of the University of Cambridge nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +----------------------------------------------------------------------------- +*/ + + +/* This module contains some fixed tables that are used by more than one of the +PCRE code modules. The tables are also #included by the pcretest program, which +uses macros to change their names from _pcre_xxx to xxxx, thereby avoiding name +clashes with the library. */ + + +#include "pcre_internal.h" + + +/* Table of sizes for the fixed-length opcodes. It's defined in a macro so that +the definition is next to the definition of the opcodes in internal.h. */ + +const uschar _pcre_OP_lengths[] = { OP_LENGTHS }; + + + +/************************************************* +* Tables for UTF-8 support * +*************************************************/ + +/* These are the breakpoints for different numbers of bytes in a UTF-8 +character. */ + +const int _pcre_utf8_table1[] = + { 0x7f, 0x7ff, 0xffff, 0x1fffff, 0x3ffffff, 0x7fffffff}; + +const int _pcre_utf8_table1_size = sizeof(_pcre_utf8_table1)/sizeof(int); + +/* These are the indicator bits and the mask for the data bits to set in the +first byte of a character, indexed by the number of additional bytes. */ + +const int _pcre_utf8_table2[] = { 0, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc}; +const int _pcre_utf8_table3[] = { 0xff, 0x1f, 0x0f, 0x07, 0x03, 0x01}; + +/* Table of the number of extra characters, indexed by the first character +masked with 0x3f. The highest number for a valid UTF-8 character is in fact +0x3d. */ + +const uschar _pcre_utf8_table4[] = { + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, + 3,3,3,3,3,3,3,3,4,4,4,4,5,5,5,5 }; + +/* This table translates Unicode property names into code values for the +ucp_findchar() function. */ + +const ucp_type_table _pcre_utt[] = { + { "C", 128 + ucp_C }, + { "Cc", ucp_Cc }, + { "Cf", ucp_Cf }, + { "Cn", ucp_Cn }, + { "Co", ucp_Co }, + { "Cs", ucp_Cs }, + { "L", 128 + ucp_L }, + { "Ll", ucp_Ll }, + { "Lm", ucp_Lm }, + { "Lo", ucp_Lo }, + { "Lt", ucp_Lt }, + { "Lu", ucp_Lu }, + { "M", 128 + ucp_M }, + { "Mc", ucp_Mc }, + { "Me", ucp_Me }, + { "Mn", ucp_Mn }, + { "N", 128 + ucp_N }, + { "Nd", ucp_Nd }, + { "Nl", ucp_Nl }, + { "No", ucp_No }, + { "P", 128 + ucp_P }, + { "Pc", ucp_Pc }, + { "Pd", ucp_Pd }, + { "Pe", ucp_Pe }, + { "Pf", ucp_Pf }, + { "Pi", ucp_Pi }, + { "Po", ucp_Po }, + { "Ps", ucp_Ps }, + { "S", 128 + ucp_S }, + { "Sc", ucp_Sc }, + { "Sk", ucp_Sk }, + { "Sm", ucp_Sm }, + { "So", ucp_So }, + { "Z", 128 + ucp_Z }, + { "Zl", ucp_Zl }, + { "Zp", ucp_Zp }, + { "Zs", ucp_Zs } +}; + +const int _pcre_utt_size = sizeof(_pcre_utt)/sizeof(ucp_type_table); + +/* End of pcre_tables.c */ diff --git a/mozilla/js/tamarin/pcre/pcre_try_flipped.cpp b/mozilla/js/tamarin/pcre/pcre_try_flipped.cpp new file mode 100644 index 00000000000..11c82a2208a --- /dev/null +++ b/mozilla/js/tamarin/pcre/pcre_try_flipped.cpp @@ -0,0 +1,134 @@ +#include "avmplus.h" + +/************************************************* +* Perl-Compatible Regular Expressions * +*************************************************/ + +/* PCRE is a library of functions to support regular expressions whose syntax +and semantics are as close as possible to those of the Perl 5 language. + + Written by Philip Hazel + Copyright (c) 1997-2005 University of Cambridge + +----------------------------------------------------------------------------- +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + * Neither the name of the University of Cambridge nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +----------------------------------------------------------------------------- +*/ + + +/* This module contains an internal function that tests a compiled pattern to +see if it was compiled with the opposite endianness. If so, it uses an +auxiliary local function to flip the appropriate bytes. */ + + +#include "pcre_internal.h" + + +/************************************************* +* Flip bytes in an integer * +*************************************************/ + +/* This function is called when the magic number in a regex doesn't match, in +order to flip its bytes to see if we are dealing with a pattern that was +compiled on a host of different endianness. If so, this function is used to +flip other byte values. + +Arguments: + value the number to flip + n the number of bytes to flip (assumed to be 2 or 4) + +Returns: the flipped value +*/ + +static long int +byteflip(long int value, int n) +{ +if (n == 2) return ((value & 0x00ff) << 8) | ((value & 0xff00) >> 8); +return ((value & 0x000000ff) << 24) | + ((value & 0x0000ff00) << 8) | + ((value & 0x00ff0000) >> 8) | + ((value & 0xff000000) >> 24); +} + + + +/************************************************* +* Test for a byte-flipped compiled regex * +*************************************************/ + +/* This function is called from pcre_exec(), pcre_dfa_exec(), and also from +pcre_fullinfo(). Its job is to test whether the regex is byte-flipped - that +is, it was compiled on a system of opposite endianness. The function is called +only when the native MAGIC_NUMBER test fails. If the regex is indeed flipped, +we flip all the relevant values into a different data block, and return it. + +Arguments: + re points to the regex + study points to study data, or NULL + internal_re points to a new regex block + internal_study points to a new study block + +Returns: the new block if is is indeed a byte-flipped regex + NULL if it is not +*/ + +PCRE_EXPORT real_pcre * +_pcre_try_flipped(const real_pcre *re, real_pcre *internal_re, + const pcre_study_data *study, pcre_study_data *internal_study) +{ +if (byteflip(re->magic_number, sizeof(re->magic_number)) != MAGIC_NUMBER) + return NULL; + +*internal_re = *re; /* To copy other fields */ +internal_re->size = byteflip(re->size, sizeof(re->size)); +internal_re->options = byteflip(re->options, sizeof(re->options)); +internal_re->top_bracket = + (pcre_uint16)byteflip(re->top_bracket, sizeof(re->top_bracket)); +internal_re->top_backref = + (pcre_uint16)byteflip(re->top_backref, sizeof(re->top_backref)); +internal_re->first_byte = + (pcre_uint16)byteflip(re->first_byte, sizeof(re->first_byte)); +internal_re->req_byte = + (pcre_uint16)byteflip(re->req_byte, sizeof(re->req_byte)); +internal_re->name_table_offset = + (pcre_uint16)byteflip(re->name_table_offset, sizeof(re->name_table_offset)); +internal_re->name_entry_size = + (pcre_uint16)byteflip(re->name_entry_size, sizeof(re->name_entry_size)); +internal_re->name_count = + (pcre_uint16)byteflip(re->name_count, sizeof(re->name_count)); + +if (study != NULL) + { + *internal_study = *study; /* To copy other fields */ + internal_study->size = byteflip(study->size, sizeof(study->size)); + internal_study->options = byteflip(study->options, sizeof(study->options)); + } + +return internal_re; +} + +/* End of pcre_tryflipped.c */ diff --git a/mozilla/js/tamarin/pcre/pcre_ucp_findchar.cpp b/mozilla/js/tamarin/pcre/pcre_ucp_findchar.cpp new file mode 100644 index 00000000000..b9a4c97c7f1 --- /dev/null +++ b/mozilla/js/tamarin/pcre/pcre_ucp_findchar.cpp @@ -0,0 +1,161 @@ +/************************************************* +* Perl-Compatible Regular Expressions * +*************************************************/ + +/* PCRE is a library of functions to support regular expressions whose syntax +and semantics are as close as possible to those of the Perl 5 language. + + Written by Philip Hazel + Copyright (c) 1997-2005 University of Cambridge + +----------------------------------------------------------------------------- +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + * Neither the name of the University of Cambridge nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +----------------------------------------------------------------------------- +*/ + + +/* This module compiles code for supporting the use of Unicode character +properties. We use the (embryonic at the time of writing) UCP library, by +including some of its files, copies of which have been put in the PCRE +distribution. The actual search function is reproduced here, with its name +changed. */ + + +#include "pcre_internal.h" + +#include "ucp.h" /* Category definitions */ +#include "ucpinternal.h" /* Internal table details */ +#include "ucptable.c" /* The table itself */ + + + +/************************************************* +* Search table and return data * +*************************************************/ + +/* Two values are returned: the category is ucp_C, ucp_L, etc. The detailed +character type is ucp_Lu, ucp_Nd, etc. + +Arguments: + c the character value + type_ptr the detailed character type is returned here + case_ptr for letters, the opposite case is returned here, if there + is one, else zero + +Returns: the character type category or -1 if not found +*/ + +PCRE_EXPORT int +_pcre_ucp_findchar(const int c, int *type_ptr, int *case_ptr) +{ +cnode *node = ucp_table; +register int cc = c; +int case_offset; + +for (;;) + { + register int d = node->f1 | ((node->f0 & f0_chhmask) << 16); + if (cc == d) break; + if (cc < d) + { + if ((node->f0 & f0_leftexists) == 0) return -1; + node ++; + } + else + { + register int roffset = (node->f2 & f2_rightmask) >> f2_rightshift; + if (roffset == 0) return -1; + node += 1 << (roffset - 1); + } + } + +switch ((*type_ptr = ((node->f0 & f0_typemask) >> f0_typeshift))) + { + case ucp_Cc: + case ucp_Cf: + case ucp_Cn: + case ucp_Co: + case ucp_Cs: + return ucp_C; + break; + + case ucp_Ll: + case ucp_Lu: + case_offset = node->f2 & f2_casemask; + if ((case_offset & 0x0100) != 0) case_offset |= 0xfffff000; + *case_ptr = (case_offset == 0)? 0 : cc + case_offset; + return ucp_L; + + case ucp_Lm: + case ucp_Lo: + case ucp_Lt: + *case_ptr = 0; + return ucp_L; + break; + + case ucp_Mc: + case ucp_Me: + case ucp_Mn: + return ucp_M; + break; + + case ucp_Nd: + case ucp_Nl: + case ucp_No: + return ucp_N; + break; + + case ucp_Pc: + case ucp_Pd: + case ucp_Pe: + case ucp_Pf: + case ucp_Pi: + case ucp_Ps: + case ucp_Po: + return ucp_P; + break; + + case ucp_Sc: + case ucp_Sk: + case ucp_Sm: + case ucp_So: + return ucp_S; + break; + + case ucp_Zl: + case ucp_Zp: + case ucp_Zs: + return ucp_Z; + break; + + default: /* "Should never happen" */ + return -1; + break; + } +} + +/* End of pcre_ucp_findchar.c */ diff --git a/mozilla/js/tamarin/pcre/pcre_valid_utf8.cpp b/mozilla/js/tamarin/pcre/pcre_valid_utf8.cpp new file mode 100644 index 00000000000..b88a358285c --- /dev/null +++ b/mozilla/js/tamarin/pcre/pcre_valid_utf8.cpp @@ -0,0 +1,132 @@ +#include "avmplus.h" + +/************************************************* +* Perl-Compatible Regular Expressions * +*************************************************/ + +/* PCRE is a library of functions to support regular expressions whose syntax +and semantics are as close as possible to those of the Perl 5 language. + + Written by Philip Hazel + Copyright (c) 1997-2005 University of Cambridge + +----------------------------------------------------------------------------- +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + * Neither the name of the University of Cambridge nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +----------------------------------------------------------------------------- +*/ + + +/* This module contains an internal function for validating UTF-8 character +strings. */ + + +#include "pcre_internal.h" + + +/************************************************* +* Validate a UTF-8 string * +*************************************************/ + +/* This function is called (optionally) at the start of compile or match, to +validate that a supposed UTF-8 string is actually valid. The early check means +that subsequent code can assume it is dealing with a valid string. The check +can be turned off for maximum performance, but the consequences of supplying +an invalid string are then undefined. + +Arguments: + string points to the string + length length of string, or -1 if the string is zero-terminated + +Returns: < 0 if the string is a valid UTF-8 string + >= 0 otherwise; the value is the offset of the bad byte +*/ + +PCRE_EXPORT int +_pcre_valid_utf8(const uschar *string, int length) +{ +register const uschar *p; + +if (length < 0) + { + for (p = string; *p != 0; p++){ /*nothing*/ } + length = p - string; + } + +for (p = string; length-- > 0; p++) + { + register int ab; + register int c = *p; + if (c < 128) continue; + if ((c & 0xc0) != 0xc0) return p - string; + ab = _pcre_utf8_table4[c & 0x3f]; /* Number of additional bytes */ + if (length < ab) return p - string; + length -= ab; + + /* Check top bits in the second byte */ + if ((*(++p) & 0xc0) != 0x80) return p - string; + + /* Check for overlong sequences for each different length */ + switch (ab) + { + /* Check for xx00 000x */ + case 1: + if ((c & 0x3e) == 0) return p - string; + continue; /* We know there aren't any more bytes to check */ + + /* Check for 1110 0000, xx0x xxxx */ + case 2: + if (c == 0xe0 && (*p & 0x20) == 0) return p - string; + break; + + /* Check for 1111 0000, xx00 xxxx */ + case 3: + if (c == 0xf0 && (*p & 0x30) == 0) return p - string; + break; + + /* Check for 1111 1000, xx00 0xxx */ + case 4: + if (c == 0xf8 && (*p & 0x38) == 0) return p - string; + break; + + /* Check for leading 0xfe or 0xff, and then for 1111 1100, xx00 00xx */ + case 5: + if (c == 0xfe || c == 0xff || + (c == 0xfc && (*p & 0x3c) == 0)) return p - string; + break; + } + + /* Check for valid bytes after the 2nd, if any; all must start 10 */ + while (--ab > 0) + { + if ((*(++p) & 0xc0) != 0x80) return p - string; + } + } + +return -1; +} + +/* End of pcre_valid_utf8.c */ diff --git a/mozilla/js/tamarin/pcre/pcre_version.cpp b/mozilla/js/tamarin/pcre/pcre_version.cpp new file mode 100644 index 00000000000..1c0b7d6f6af --- /dev/null +++ b/mozilla/js/tamarin/pcre/pcre_version.cpp @@ -0,0 +1,63 @@ +#include "avmplus.h" + +/************************************************* +* Perl-Compatible Regular Expressions * +*************************************************/ + +/* PCRE is a library of functions to support regular expressions whose syntax +and semantics are as close as possible to those of the Perl 5 language. + + Written by Philip Hazel + Copyright (c) 1997-2005 University of Cambridge + +----------------------------------------------------------------------------- +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + * Neither the name of the University of Cambridge nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +----------------------------------------------------------------------------- +*/ + + +/* This module contains the external function pcre_version(), which returns a +string that identifies the PCRE version that is in use. */ + + +#include "pcre_internal.h" + + +/************************************************* +* Return version string * +*************************************************/ + +#define STRING(a) # a +#define XSTRING(s) STRING(s) + +PCRE_EXPORT const char * +pcre_version(void) +{ +return XSTRING(PCRE_MAJOR) "." XSTRING(PCRE_MINOR) " " XSTRING(PCRE_DATE); +} + +/* End of pcre_version.c */ diff --git a/mozilla/js/tamarin/pcre/pcre_xclass.cpp b/mozilla/js/tamarin/pcre/pcre_xclass.cpp new file mode 100644 index 00000000000..c761111581e --- /dev/null +++ b/mozilla/js/tamarin/pcre/pcre_xclass.cpp @@ -0,0 +1,123 @@ +#include "avmplus.h" + +/************************************************* +* Perl-Compatible Regular Expressions * +*************************************************/ + +/* PCRE is a library of functions to support regular expressions whose syntax +and semantics are as close as possible to those of the Perl 5 language. + + Written by Philip Hazel + Copyright (c) 1997-2005 University of Cambridge + +----------------------------------------------------------------------------- +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + * Neither the name of the University of Cambridge nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +----------------------------------------------------------------------------- +*/ + + +/* This module contains an internal function that is used to match an extended +class (one that contains characters whose values are > 255). It is used by both +pcre_exec() and pcre_def_exec(). */ + + +#include "pcre_internal.h" + + +/************************************************* +* Match character against an XCLASS * +*************************************************/ + +/* This function is called to match a character against an extended class that +might contain values > 255. + +Arguments: + c the character + data points to the flag byte of the XCLASS data + +Returns: TRUE if character matches, else FALSE +*/ + +PCRE_EXPORT BOOL +_pcre_xclass(int c, const uschar *data) +{ +int t; +BOOL negated = (*data & XCL_NOT) != 0; + +/* Character values < 256 are matched against a bitmap, if one is present. If +not, we still carry on, because there may be ranges that start below 256 in the +additional data. */ + +if (c < 256) + { + if ((*data & XCL_MAP) != 0 && (data[1 + c/8] & (1 << (c&7))) != 0) + return !negated; /* char found */ + } + +/* First skip the bit map if present. Then match against the list of Unicode +properties or large chars or ranges that end with a large char. We won't ever +encounter XCL_PROP or XCL_NOTPROP when UCP support is not compiled. */ + +if ((*data++ & XCL_MAP) != 0) data += 32; + +while ((t = *data++) != XCL_END) + { + int x, y; + if (t == XCL_SINGLE) + { + GETCHARINC(x, data); + if (c == x) return !negated; + } + else if (t == XCL_RANGE) + { + GETCHARINC(x, data); + GETCHARINC(y, data); + if (c >= x && c <= y) return !negated; + } + +#ifdef SUPPORT_UCP + else /* XCL_PROP & XCL_NOTPROP */ + { + int chartype, othercase; + int rqdtype = *data++; + int category = _pcre_ucp_findchar(c, &chartype, &othercase); + if (rqdtype >= 128) + { + if ((rqdtype - 128 == category) == (t == XCL_PROP)) return !negated; + } + else + { + if ((rqdtype == chartype) == (t == XCL_PROP)) return !negated; + } + } +#endif /* SUPPORT_UCP */ + } + +return negated; /* char did not match */ +} + +/* End of pcre_xclass.c */ diff --git a/mozilla/js/tamarin/pcre/pcrecpp.cc b/mozilla/js/tamarin/pcre/pcrecpp.cc new file mode 100644 index 00000000000..0ffd221d233 --- /dev/null +++ b/mozilla/js/tamarin/pcre/pcrecpp.cc @@ -0,0 +1,770 @@ +// Copyright (c) 2005, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Author: Sanjay Ghemawat + +#include +#include +#include +#include /* for SHRT_MIN, USHRT_MAX, etc */ +#include +#include +#include +#include +#include "config.h" +// We need this to compile the proper dll on windows/msys. This is copied +// from pcre_internal.h. It would probably be better just to include that. +#define PCRE_DEFINITION /* Win32 __declspec(export) trigger for .dll */ +#include "pcre.h" +#include "pcre_stringpiece.h" +#include "pcrecpp.h" + + +namespace pcrecpp { + +// Maximum number of args we can set +static const int kMaxArgs = 16; +static const int kVecSize = (1 + kMaxArgs) * 3; // results + PCRE workspace + +// Special object that stands-in for no argument +Arg no_arg((void*)NULL); + +// If a regular expression has no error, its error_ field points here +static const string empty_string; + +// If the user doesn't ask for any options, we just use this one +static RE_Options default_options; + +void RE::Init(const char* pat, const RE_Options* options) { + pattern_ = pat; + if (options == NULL) { + options_ = default_options; + } else { + options_ = *options; + } + error_ = &empty_string; + re_full_ = NULL; + re_partial_ = NULL; + + re_partial_ = Compile(UNANCHORED); + if (re_partial_ != NULL) { + // Check for complicated patterns. The following change is + // conservative in that it may treat some "simple" patterns + // as "complex" (e.g., if the vertical bar is in a character + // class or is escaped). But it seems good enough. + if (strchr(pat, '|') == NULL) { + // Simple pattern: we can use position-based checks to perform + // fully anchored matches + re_full_ = re_partial_; + } else { + // We need a special pattern for anchored matches + re_full_ = Compile(ANCHOR_BOTH); + } + } +} + +RE::~RE() { + if (re_full_ != NULL && re_full_ != re_partial_) (*pcre_free)(re_full_); + if (re_partial_ != NULL) (*pcre_free)(re_partial_); + if (error_ != &empty_string) delete error_; +} + +pcre* RE::Compile(Anchor anchor) { + // First, convert RE_Options into pcre options + int pcre_options = 0; + pcre_options = options_.all_options(); + + // Special treatment for anchoring. This is needed because at + // runtime pcre only provides an option for anchoring at the + // beginning of a string (unless you use offset). + // + // There are three types of anchoring we want: + // UNANCHORED Compile the original pattern, and use + // a pcre unanchored match. + // ANCHOR_START Compile the original pattern, and use + // a pcre anchored match. + // ANCHOR_BOTH Tack a "\z" to the end of the original pattern + // and use a pcre anchored match. + + const char* compile_error; + int eoffset; + pcre* re; + if (anchor != ANCHOR_BOTH) { + re = pcre_compile(pattern_.c_str(), pcre_options, + &compile_error, &eoffset, NULL); + } else { + // Tack a '\z' at the end of RE. Parenthesize it first so that + // the '\z' applies to all top-level alternatives in the regexp. + string wrapped = "(?:"; // A non-counting grouping operator + wrapped += pattern_; + wrapped += ")\\z"; + re = pcre_compile(wrapped.c_str(), pcre_options, + &compile_error, &eoffset, NULL); + } + if (re == NULL) { + if (error_ == &empty_string) error_ = new string(compile_error); + } + return re; +} + +/***** Matching interfaces *****/ + +bool RE::FullMatch(const StringPiece& text, + const Arg& ptr1, + const Arg& ptr2, + const Arg& ptr3, + const Arg& ptr4, + const Arg& ptr5, + const Arg& ptr6, + const Arg& ptr7, + const Arg& ptr8, + const Arg& ptr9, + const Arg& ptr10, + const Arg& ptr11, + const Arg& ptr12, + const Arg& ptr13, + const Arg& ptr14, + const Arg& ptr15, + const Arg& ptr16) const { + const Arg* args[kMaxArgs]; + int n = 0; + if (&ptr1 == &no_arg) goto done; args[n++] = &ptr1; + if (&ptr2 == &no_arg) goto done; args[n++] = &ptr2; + if (&ptr3 == &no_arg) goto done; args[n++] = &ptr3; + if (&ptr4 == &no_arg) goto done; args[n++] = &ptr4; + if (&ptr5 == &no_arg) goto done; args[n++] = &ptr5; + if (&ptr6 == &no_arg) goto done; args[n++] = &ptr6; + if (&ptr7 == &no_arg) goto done; args[n++] = &ptr7; + if (&ptr8 == &no_arg) goto done; args[n++] = &ptr8; + if (&ptr9 == &no_arg) goto done; args[n++] = &ptr9; + if (&ptr10 == &no_arg) goto done; args[n++] = &ptr10; + if (&ptr11 == &no_arg) goto done; args[n++] = &ptr11; + if (&ptr12 == &no_arg) goto done; args[n++] = &ptr12; + if (&ptr13 == &no_arg) goto done; args[n++] = &ptr13; + if (&ptr14 == &no_arg) goto done; args[n++] = &ptr14; + if (&ptr15 == &no_arg) goto done; args[n++] = &ptr15; + if (&ptr16 == &no_arg) goto done; args[n++] = &ptr16; + done: + + int consumed; + int vec[kVecSize]; + return DoMatchImpl(text, ANCHOR_BOTH, &consumed, args, n, vec, kVecSize); +} + +bool RE::PartialMatch(const StringPiece& text, + const Arg& ptr1, + const Arg& ptr2, + const Arg& ptr3, + const Arg& ptr4, + const Arg& ptr5, + const Arg& ptr6, + const Arg& ptr7, + const Arg& ptr8, + const Arg& ptr9, + const Arg& ptr10, + const Arg& ptr11, + const Arg& ptr12, + const Arg& ptr13, + const Arg& ptr14, + const Arg& ptr15, + const Arg& ptr16) const { + const Arg* args[kMaxArgs]; + int n = 0; + if (&ptr1 == &no_arg) goto done; args[n++] = &ptr1; + if (&ptr2 == &no_arg) goto done; args[n++] = &ptr2; + if (&ptr3 == &no_arg) goto done; args[n++] = &ptr3; + if (&ptr4 == &no_arg) goto done; args[n++] = &ptr4; + if (&ptr5 == &no_arg) goto done; args[n++] = &ptr5; + if (&ptr6 == &no_arg) goto done; args[n++] = &ptr6; + if (&ptr7 == &no_arg) goto done; args[n++] = &ptr7; + if (&ptr8 == &no_arg) goto done; args[n++] = &ptr8; + if (&ptr9 == &no_arg) goto done; args[n++] = &ptr9; + if (&ptr10 == &no_arg) goto done; args[n++] = &ptr10; + if (&ptr11 == &no_arg) goto done; args[n++] = &ptr11; + if (&ptr12 == &no_arg) goto done; args[n++] = &ptr12; + if (&ptr13 == &no_arg) goto done; args[n++] = &ptr13; + if (&ptr14 == &no_arg) goto done; args[n++] = &ptr14; + if (&ptr15 == &no_arg) goto done; args[n++] = &ptr15; + if (&ptr16 == &no_arg) goto done; args[n++] = &ptr16; + done: + + int consumed; + int vec[kVecSize]; + return DoMatchImpl(text, UNANCHORED, &consumed, args, n, vec, kVecSize); +} + +bool RE::Consume(StringPiece* input, + const Arg& ptr1, + const Arg& ptr2, + const Arg& ptr3, + const Arg& ptr4, + const Arg& ptr5, + const Arg& ptr6, + const Arg& ptr7, + const Arg& ptr8, + const Arg& ptr9, + const Arg& ptr10, + const Arg& ptr11, + const Arg& ptr12, + const Arg& ptr13, + const Arg& ptr14, + const Arg& ptr15, + const Arg& ptr16) const { + const Arg* args[kMaxArgs]; + int n = 0; + if (&ptr1 == &no_arg) goto done; args[n++] = &ptr1; + if (&ptr2 == &no_arg) goto done; args[n++] = &ptr2; + if (&ptr3 == &no_arg) goto done; args[n++] = &ptr3; + if (&ptr4 == &no_arg) goto done; args[n++] = &ptr4; + if (&ptr5 == &no_arg) goto done; args[n++] = &ptr5; + if (&ptr6 == &no_arg) goto done; args[n++] = &ptr6; + if (&ptr7 == &no_arg) goto done; args[n++] = &ptr7; + if (&ptr8 == &no_arg) goto done; args[n++] = &ptr8; + if (&ptr9 == &no_arg) goto done; args[n++] = &ptr9; + if (&ptr10 == &no_arg) goto done; args[n++] = &ptr10; + if (&ptr11 == &no_arg) goto done; args[n++] = &ptr11; + if (&ptr12 == &no_arg) goto done; args[n++] = &ptr12; + if (&ptr13 == &no_arg) goto done; args[n++] = &ptr13; + if (&ptr14 == &no_arg) goto done; args[n++] = &ptr14; + if (&ptr15 == &no_arg) goto done; args[n++] = &ptr15; + if (&ptr16 == &no_arg) goto done; args[n++] = &ptr16; + done: + + int consumed; + int vec[kVecSize]; + if (DoMatchImpl(*input, ANCHOR_START, &consumed, + args, n, vec, kVecSize)) { + input->remove_prefix(consumed); + return true; + } else { + return false; + } +} + +bool RE::FindAndConsume(StringPiece* input, + const Arg& ptr1, + const Arg& ptr2, + const Arg& ptr3, + const Arg& ptr4, + const Arg& ptr5, + const Arg& ptr6, + const Arg& ptr7, + const Arg& ptr8, + const Arg& ptr9, + const Arg& ptr10, + const Arg& ptr11, + const Arg& ptr12, + const Arg& ptr13, + const Arg& ptr14, + const Arg& ptr15, + const Arg& ptr16) const { + const Arg* args[kMaxArgs]; + int n = 0; + if (&ptr1 == &no_arg) goto done; args[n++] = &ptr1; + if (&ptr2 == &no_arg) goto done; args[n++] = &ptr2; + if (&ptr3 == &no_arg) goto done; args[n++] = &ptr3; + if (&ptr4 == &no_arg) goto done; args[n++] = &ptr4; + if (&ptr5 == &no_arg) goto done; args[n++] = &ptr5; + if (&ptr6 == &no_arg) goto done; args[n++] = &ptr6; + if (&ptr7 == &no_arg) goto done; args[n++] = &ptr7; + if (&ptr8 == &no_arg) goto done; args[n++] = &ptr8; + if (&ptr9 == &no_arg) goto done; args[n++] = &ptr9; + if (&ptr10 == &no_arg) goto done; args[n++] = &ptr10; + if (&ptr11 == &no_arg) goto done; args[n++] = &ptr11; + if (&ptr12 == &no_arg) goto done; args[n++] = &ptr12; + if (&ptr13 == &no_arg) goto done; args[n++] = &ptr13; + if (&ptr14 == &no_arg) goto done; args[n++] = &ptr14; + if (&ptr15 == &no_arg) goto done; args[n++] = &ptr15; + if (&ptr16 == &no_arg) goto done; args[n++] = &ptr16; + done: + + int consumed; + int vec[kVecSize]; + if (DoMatchImpl(*input, UNANCHORED, &consumed, + args, n, vec, kVecSize)) { + input->remove_prefix(consumed); + return true; + } else { + return false; + } +} + +bool RE::Replace(const StringPiece& rewrite, + string *str) const { + int vec[kVecSize]; + int matches = TryMatch(*str, 0, UNANCHORED, vec, kVecSize); + if (matches == 0) + return false; + + string s; + if (!Rewrite(&s, rewrite, *str, vec, matches)) + return false; + + assert(vec[0] >= 0); + assert(vec[1] >= 0); + str->replace(vec[0], vec[1] - vec[0], s); + return true; +} + +int RE::GlobalReplace(const StringPiece& rewrite, + string *str) const { + int count = 0; + int vec[kVecSize]; + string out; + int start = 0; + int lastend = -1; + + for (; start <= static_cast(str->length()); count++) { + int matches = TryMatch(*str, start, UNANCHORED, vec, kVecSize); + if (matches <= 0) + break; + int matchstart = vec[0], matchend = vec[1]; + assert(matchstart >= start); + assert(matchend >= matchstart); + if (matchstart == matchend && matchstart == lastend) { + // advance one character if we matched an empty string at the same + // place as the last match occurred + if (start < static_cast(str->length())) + out.push_back((*str)[start]); + start++; + } else { + out.append(*str, start, matchstart - start); + Rewrite(&out, rewrite, *str, vec, matches); + start = matchend; + lastend = matchend; + count++; + } + } + + if (count == 0) + return 0; + + if (start < static_cast(str->length())) + out.append(*str, start, str->length() - start); + swap(out, *str); + return count; +} + +bool RE::Extract(const StringPiece& rewrite, + const StringPiece& text, + string *out) const { + int vec[kVecSize]; + int matches = TryMatch(text, 0, UNANCHORED, vec, kVecSize); + if (matches == 0) + return false; + out->erase(); + return Rewrite(out, rewrite, text, vec, matches); +} + +/***** Actual matching and rewriting code *****/ + +int RE::TryMatch(const StringPiece& text, + int startpos, + Anchor anchor, + int *vec, + int vecsize) const { + pcre* re = (anchor == ANCHOR_BOTH) ? re_full_ : re_partial_; + if (re == NULL) { + //fprintf(stderr, "Matching against invalid re: %s\n", error_->c_str()); + return 0; + } + + pcre_extra extra = { 0 }; + if (options_.match_limit() > 0) { + extra.flags = PCRE_EXTRA_MATCH_LIMIT; + extra.match_limit = options_.match_limit(); + } + int rc = pcre_exec(re, // The regular expression object + &extra, + text.data(), + text.size(), + startpos, + (anchor == UNANCHORED) ? 0 : PCRE_ANCHORED, + vec, + vecsize); + + // Handle errors + if (rc == PCRE_ERROR_NOMATCH) { + return 0; + } else if (rc < 0) { + //fprintf(stderr, "Unexpected return code: %d when matching '%s'\n", + // re, pattern_.c_str()); + return 0; + } else if (rc == 0) { + // pcre_exec() returns 0 as a special case when the number of + // capturing subpatterns exceeds the size of the vector. + // When this happens, there is a match and the output vector + // is filled, but we miss out on the positions of the extra subpatterns. + rc = vecsize / 2; + } + + if ((anchor == ANCHOR_BOTH) && (re_full_ == re_partial_)) { + // We need an extra check to make sure that the match extended + // to the end of the input string + assert(vec[0] == 0); // PCRE_ANCHORED forces starting match + if (vec[1] != text.size()) return 0; // Did not get ending match + } + + return rc; +} + +bool RE::DoMatchImpl(const StringPiece& text, + Anchor anchor, + int* consumed, + const Arg* const* args, + int n, + int* vec, + int vecsize) const { + assert((1 + n) * 3 <= vecsize); // results + PCRE workspace + int matches = TryMatch(text, 0, anchor, vec, vecsize); + assert(matches >= 0); // TryMatch never returns negatives + if (matches == 0) + return false; + + *consumed = vec[1]; + + if (args == NULL) { + // We are not interested in results + return true; + } + + // If we got here, we must have matched the whole pattern. + // We do not need (can not do) any more checks on the value of 'matches' here + // -- see the comment for TryMatch. + for (int i = 0; i < n; i++) { + const int start = vec[2*(i+1)]; + const int limit = vec[2*(i+1)+1]; + if (!args[i]->Parse(text.data() + start, limit-start)) { + // TODO: Should we indicate what the error was? + return false; + } + } + + return true; +} + +bool RE::DoMatch(const StringPiece& text, + Anchor anchor, + int* consumed, + const Arg* const args[], + int n) const { + assert(n >= 0); + size_t const vecsize = (1 + n) * 3; // results + PCRE workspace + // (as for kVecSize) + int space[21]; // use stack allocation for small vecsize (common case) + int* vec = vecsize <= 21 ? space : new int[vecsize]; + bool retval = DoMatchImpl(text, anchor, consumed, args, n, vec, vecsize); + if (vec != space) delete [] vec; + return retval; +} + +bool RE::Rewrite(string *out, const StringPiece &rewrite, + const StringPiece &text, int *vec, int veclen) const { + for (const char *s = rewrite.data(), *end = s + rewrite.size(); + s < end; s++) { + int c = *s; + if (c == '\\') { + c = *++s; + if (isdigit(c)) { + int n = (c - '0'); + if (n >= veclen) { + //fprintf(stderr, requested group %d in regexp %.*s\n", + // n, rewrite.size(), rewrite.data()); + return false; + } + int start = vec[2 * n]; + if (start >= 0) + out->append(text.data() + start, vec[2 * n + 1] - start); + } else if (c == '\\') { + out->push_back('\\'); + } else { + //fprintf(stderr, "invalid rewrite pattern: %.*s\n", + // rewrite.size(), rewrite.data()); + return false; + } + } else { + out->push_back(c); + } + } + return true; +} + +// Return the number of capturing subpatterns, or -1 if the +// regexp wasn't valid on construction. +int RE::NumberOfCapturingGroups() { + if (re_partial_ == NULL) return -1; + + int result; + int pcre_retval = pcre_fullinfo(re_partial_, // The regular expression object + NULL, // We did not study the pattern + PCRE_INFO_CAPTURECOUNT, + &result); + assert(pcre_retval == 0); + return result; +} + +/***** Parsers for various types *****/ + +bool Arg::parse_null(const char* str, int n, void* dest) { + // We fail if somebody asked us to store into a non-NULL void* pointer + return (dest == NULL); +} + +bool Arg::parse_string(const char* str, int n, void* dest) { + reinterpret_cast(dest)->assign(str, n); + return true; +} + +bool Arg::parse_stringpiece(const char* str, int n, void* dest) { + reinterpret_cast(dest)->set(str, n); + return true; +} + +bool Arg::parse_char(const char* str, int n, void* dest) { + if (n != 1) return false; + *(reinterpret_cast(dest)) = str[0]; + return true; +} + +bool Arg::parse_uchar(const char* str, int n, void* dest) { + if (n != 1) return false; + *(reinterpret_cast(dest)) = str[0]; + return true; +} + +// Largest number spec that we are willing to parse +static const int kMaxNumberLength = 32; + +// REQUIRES "buf" must have length at least kMaxNumberLength+1 +// REQUIRES "n > 0" +// Copies "str" into "buf" and null-terminates if necessary. +// Returns one of: +// a. "str" if no termination is needed +// b. "buf" if the string was copied and null-terminated +// c. "" if the input was invalid and has no hope of being parsed +static const char* TerminateNumber(char* buf, const char* str, int n) { + if ((n > 0) && isspace(*str)) { + // We are less forgiving than the strtoxxx() routines and do not + // allow leading spaces. + return ""; + } + + // See if the character right after the input text may potentially + // look like a digit. + if (isdigit(str[n]) || + ((str[n] >= 'a') && (str[n] <= 'f')) || + ((str[n] >= 'A') && (str[n] <= 'F'))) { + if (n > kMaxNumberLength) return ""; // Input too big to be a valid number + memcpy(buf, str, n); + buf[n] = '\0'; + return buf; + } else { + // We can parse right out of the supplied string, so return it. + return str; + } +} + +bool Arg::parse_long_radix(const char* str, + int n, + void* dest, + int radix) { + if (n == 0) return false; + char buf[kMaxNumberLength+1]; + str = TerminateNumber(buf, str, n); + char* end; + errno = 0; + long r = strtol(str, &end, radix); + if (end != str + n) return false; // Leftover junk + if (errno) return false; + *(reinterpret_cast(dest)) = r; + return true; +} + +bool Arg::parse_ulong_radix(const char* str, + int n, + void* dest, + int radix) { + if (n == 0) return false; + char buf[kMaxNumberLength+1]; + str = TerminateNumber(buf, str, n); + char* end; + errno = 0; + unsigned long r = strtoul(str, &end, radix); + if (end != str + n) return false; // Leftover junk + if (errno) return false; + *(reinterpret_cast(dest)) = r; + return true; +} + +bool Arg::parse_short_radix(const char* str, + int n, + void* dest, + int radix) { + long r; + if (!parse_long_radix(str, n, &r, radix)) return false; // Could not parse + if (r < SHRT_MIN || r > SHRT_MAX) return false; // Out of range + *(reinterpret_cast(dest)) = r; + return true; +} + +bool Arg::parse_ushort_radix(const char* str, + int n, + void* dest, + int radix) { + unsigned long r; + if (!parse_ulong_radix(str, n, &r, radix)) return false; // Could not parse + if (r > USHRT_MAX) return false; // Out of range + *(reinterpret_cast(dest)) = r; + return true; +} + +bool Arg::parse_int_radix(const char* str, + int n, + void* dest, + int radix) { + long r; + if (!parse_long_radix(str, n, &r, radix)) return false; // Could not parse + if (r < INT_MIN || r > INT_MAX) return false; // Out of range + *(reinterpret_cast(dest)) = r; + return true; +} + +bool Arg::parse_uint_radix(const char* str, + int n, + void* dest, + int radix) { + unsigned long r; + if (!parse_ulong_radix(str, n, &r, radix)) return false; // Could not parse + if (r > UINT_MAX) return false; // Out of range + *(reinterpret_cast(dest)) = r; + return true; +} + +bool Arg::parse_longlong_radix(const char* str, + int n, + void* dest, + int radix) { +#ifndef HAVE_LONG_LONG + return false; +#else + if (n == 0) return false; + char buf[kMaxNumberLength+1]; + str = TerminateNumber(buf, str, n); + char* end; + errno = 0; +#if defined HAVE_STRTOQ + long long r = strtoq(str, &end, radix); +#elif defined HAVE_STRTOLL + long long r = strtoll(str, &end, radix); +#else +#error parse_longlong_radix: cannot convert input to a long-long +#endif + if (end != str + n) return false; // Leftover junk + if (errno) return false; + *(reinterpret_cast(dest)) = r; + return true; +#endif /* HAVE_LONG_LONG */ +} + +bool Arg::parse_ulonglong_radix(const char* str, + int n, + void* dest, + int radix) { +#ifndef HAVE_UNSIGNED_LONG_LONG + return false; +#else + if (n == 0) return false; + char buf[kMaxNumberLength+1]; + str = TerminateNumber(buf, str, n); + char* end; + errno = 0; +#if defined HAVE_STRTOQ + unsigned long long r = strtouq(str, &end, radix); +#elif defined HAVE_STRTOLL + unsigned long long r = strtoull(str, &end, radix); +#else +#error parse_ulonglong_radix: cannot convert input to a long-long +#endif + if (end != str + n) return false; // Leftover junk + if (errno) return false; + *(reinterpret_cast(dest)) = r; + return true; +#endif /* HAVE_UNSIGNED_LONG_LONG */ +} + +bool Arg::parse_double(const char* str, int n, void* dest) { + if (n == 0) return false; + static const int kMaxLength = 200; + char buf[kMaxLength]; + if (n >= kMaxLength) return false; + memcpy(buf, str, n); + buf[n] = '\0'; + errno = 0; + char* end; + double r = strtod(buf, &end); + if (end != buf + n) return false; // Leftover junk + if (errno) return false; + *(reinterpret_cast(dest)) = r; + return true; +} + +bool Arg::parse_float(const char* str, int n, void* dest) { + double r; + if (!parse_double(str, n, &r)) return false; + *(reinterpret_cast(dest)) = static_cast(r); + return true; +} + + +#define DEFINE_INTEGER_PARSERS(name) \ + bool Arg::parse_##name(const char* str, int n, void* dest) { \ + return parse_##name##_radix(str, n, dest, 10); \ + } \ + bool Arg::parse_##name##_hex(const char* str, int n, void* dest) { \ + return parse_##name##_radix(str, n, dest, 16); \ + } \ + bool Arg::parse_##name##_octal(const char* str, int n, void* dest) { \ + return parse_##name##_radix(str, n, dest, 8); \ + } \ + bool Arg::parse_##name##_cradix(const char* str, int n, void* dest) { \ + return parse_##name##_radix(str, n, dest, 0); \ + } + +DEFINE_INTEGER_PARSERS(short); +DEFINE_INTEGER_PARSERS(ushort); +DEFINE_INTEGER_PARSERS(int); +DEFINE_INTEGER_PARSERS(uint); +DEFINE_INTEGER_PARSERS(long); +DEFINE_INTEGER_PARSERS(ulong); +DEFINE_INTEGER_PARSERS(longlong); +DEFINE_INTEGER_PARSERS(ulonglong); + +#undef DEFINE_INTEGER_PARSERS + +} // namespace pcrecpp diff --git a/mozilla/js/tamarin/pcre/pcrecpp.h.in b/mozilla/js/tamarin/pcre/pcrecpp.h.in new file mode 100644 index 00000000000..f30d04e1e46 --- /dev/null +++ b/mozilla/js/tamarin/pcre/pcrecpp.h.in @@ -0,0 +1,786 @@ +// Copyright (c) 2005, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Author: Sanjay Ghemawat +// Support for PCRE_XXX modifiers added by Giuseppe Maxia, July 2005 + +#ifndef _PCRE_REGEXP_H +#define _PCRE_REGEXP_H + +// C++ interface to the pcre regular-expression library. RE supports +// Perl-style regular expressions (with extensions like \d, \w, \s, +// ...). +// +// ----------------------------------------------------------------------- +// REGEXP SYNTAX: +// +// This module is part of the pcre library and hence supports its syntax +// for regular expressions. +// +// The syntax is pretty similar to Perl's. For those not familiar +// with Perl's regular expressions, here are some examples of the most +// commonly used extensions: +// +// "hello (\\w+) world" -- \w matches a "word" character +// "version (\\d+)" -- \d matches a digit +// "hello\\s+world" -- \s matches any whitespace character +// "\\b(\\w+)\\b" -- \b matches empty string at a word boundary +// "(?i)hello" -- (?i) turns on case-insensitive matching +// "/\\*(.*?)\\*/" -- .*? matches . minimum no. of times possible +// +// ----------------------------------------------------------------------- +// MATCHING INTERFACE: +// +// The "FullMatch" operation checks that supplied text matches a +// supplied pattern exactly. +// +// Example: successful match +// pcrecpp::RE re("h.*o"); +// re.FullMatch("hello"); +// +// Example: unsuccessful match (requires full match): +// pcrecpp::RE re("e"); +// !re.FullMatch("hello"); +// +// Example: creating a temporary RE object: +// pcrecpp::RE("h.*o").FullMatch("hello"); +// +// You can pass in a "const char*" or a "string" for "text". The +// examples below tend to use a const char*. +// +// You can, as in the different examples above, store the RE object +// explicitly in a variable or use a temporary RE object. The +// examples below use one mode or the other arbitrarily. Either +// could correctly be used for any of these examples. +// +// ----------------------------------------------------------------------- +// MATCHING WITH SUB-STRING EXTRACTION: +// +// You can supply extra pointer arguments to extract matched subpieces. +// +// Example: extracts "ruby" into "s" and 1234 into "i" +// int i; +// string s; +// pcrecpp::RE re("(\\w+):(\\d+)"); +// re.FullMatch("ruby:1234", &s, &i); +// +// Example: does not try to extract any extra sub-patterns +// re.FullMatch("ruby:1234", &s); +// +// Example: does not try to extract into NULL +// re.FullMatch("ruby:1234", NULL, &i); +// +// Example: integer overflow causes failure +// !re.FullMatch("ruby:1234567891234", NULL, &i); +// +// Example: fails because there aren't enough sub-patterns: +// !pcrecpp::RE("\\w+:\\d+").FullMatch("ruby:1234", &s); +// +// Example: fails because string cannot be stored in integer +// !pcrecpp::RE("(.*)").FullMatch("ruby", &i); +// +// The provided pointer arguments can be pointers to any scalar numeric +// type, or one of +// string (matched piece is copied to string) +// StringPiece (StringPiece is mutated to point to matched piece) +// T (where "bool T::ParseFrom(const char*, int)" exists) +// NULL (the corresponding matched sub-pattern is not copied) +// +// ----------------------------------------------------------------------- +// DO_MATCH +// +// The matching interface supports at most 16 arguments per call. +// If you need more, consider using the more general interface +// pcrecpp::RE::DoMatch(). See pcrecpp.h for the signature for DoMatch. +// +// ----------------------------------------------------------------------- +// PARTIAL MATCHES +// +// You can use the "PartialMatch" operation when you want the pattern +// to match any substring of the text. +// +// Example: simple search for a string: +// pcrecpp::RE("ell").PartialMatch("hello"); +// +// Example: find first number in a string: +// int number; +// pcrecpp::RE re("(\\d+)"); +// re.PartialMatch("x*100 + 20", &number); +// assert(number == 100); +// +// ----------------------------------------------------------------------- +// UTF-8 AND THE MATCHING INTERFACE: +// +// By default, pattern and text are plain text, one byte per character. +// The UTF8 flag, passed to the constructor, causes both pattern +// and string to be treated as UTF-8 text, still a byte stream but +// potentially multiple bytes per character. In practice, the text +// is likelier to be UTF-8 than the pattern, but the match returned +// may depend on the UTF8 flag, so always use it when matching +// UTF8 text. E.g., "." will match one byte normally but with UTF8 +// set may match up to three bytes of a multi-byte character. +// +// Example: +// pcrecpp::RE_Options options; +// options.set_utf8(); +// pcrecpp::RE re(utf8_pattern, options); +// re.FullMatch(utf8_string); +// +// Example: using the convenience function UTF8(): +// pcrecpp::RE re(utf8_pattern, pcrecpp::UTF8()); +// re.FullMatch(utf8_string); +// +// NOTE: The UTF8 option is ignored if pcre was not configured with the +// --enable-utf8 flag. +// +// ----------------------------------------------------------------------- +// PASSING MODIFIERS TO THE REGULAR EXPRESSION ENGINE +// +// PCRE defines some modifiers to change the behavior of the regular +// expression engine. +// The C++ wrapper defines an auxiliary class, RE_Options, as a vehicle +// to pass such modifiers to a RE class. +// +// Currently, the following modifiers are supported +// +// modifier description Perl corresponding +// +// PCRE_CASELESS case insensitive match /i +// PCRE_MULTILINE multiple lines match /m +// PCRE_DOTALL dot matches newlines /s +// PCRE_DOLLAR_ENDONLY $ matches only at end N/A +// PCRE_EXTRA strict escape parsing N/A +// PCRE_EXTENDED ignore whitespaces /x +// PCRE_UTF8 handles UTF8 chars built-in +// PCRE_UNGREEDY reverses * and *? N/A +// PCRE_NO_AUTO_CAPTURE disables matching parens N/A (*) +// +// (For a full account on how each modifier works, please check the +// PCRE API reference manual). +// +// (*) Both Perl and PCRE allow non matching parentheses by means of the +// "?:" modifier within the pattern itself. e.g. (?:ab|cd) does not +// capture, while (ab|cd) does. +// +// For each modifier, there are two member functions whose name is made +// out of the modifier in lowercase, without the "PCRE_" prefix. For +// instance, PCRE_CASELESS is handled by +// bool caseless(), +// which returns true if the modifier is set, and +// RE_Options & set_caseless(bool), +// which sets or unsets the modifier. +// +// Moreover, PCRE_CONFIG_MATCH_LIMIT can be accessed through the +// set_match_limit() and match_limit() member functions. +// Setting match_limit to a non-zero value will limit the executation of +// pcre to keep it from doing bad things like blowing the stack or taking +// an eternity to return a result. A value of 5000 is good enough to stop +// stack blowup in a 2MB thread stack. Setting match_limit to zero will +// disable match limiting. +// +// Normally, to pass one or more modifiers to a RE class, you declare +// a RE_Options object, set the appropriate options, and pass this +// object to a RE constructor. Example: +// +// RE_options opt; +// opt.set_caseless(true); +// +// if (RE("HELLO", opt).PartialMatch("hello world")) ... +// +// RE_options has two constructors. The default constructor takes no +// arguments and creates a set of flags that are off by default. +// +// The optional parameter 'option_flags' is to facilitate transfer +// of legacy code from C programs. This lets you do +// RE(pattern, RE_Options(PCRE_CASELESS|PCRE_MULTILINE)).PartialMatch(str); +// +// But new code is better off doing +// RE(pattern, +// RE_Options().set_caseless(true).set_multiline(true)).PartialMatch(str); +// (See below) +// +// If you are going to pass one of the most used modifiers, there are some +// convenience functions that return a RE_Options class with the +// appropriate modifier already set: +// CASELESS(), UTF8(), MULTILINE(), DOTALL(), EXTENDED() +// +// If you need to set several options at once, and you don't want to go +// through the pains of declaring a RE_Options object and setting several +// options, there is a parallel method that give you such ability on the +// fly. You can concatenate several set_xxxxx member functions, since each +// of them returns a reference to its class object. e.g.: to pass +// PCRE_CASELESS, PCRE_EXTENDED, and PCRE_MULTILINE to a RE with one +// statement, you may write +// +// RE(" ^ xyz \\s+ .* blah$", RE_Options() +// .set_caseless(true) +// .set_extended(true) +// .set_multiline(true)).PartialMatch(sometext); +// +// ----------------------------------------------------------------------- +// SCANNING TEXT INCREMENTALLY +// +// The "Consume" operation may be useful if you want to repeatedly +// match regular expressions at the front of a string and skip over +// them as they match. This requires use of the "StringPiece" type, +// which represents a sub-range of a real string. Like RE, StringPiece +// is defined in the pcrecpp namespace. +// +// Example: read lines of the form "var = value" from a string. +// string contents = ...; // Fill string somehow +// pcrecpp::StringPiece input(contents); // Wrap in a StringPiece +// +// string var; +// int value; +// pcrecpp::RE re("(\\w+) = (\\d+)\n"); +// while (re.Consume(&input, &var, &value)) { +// ...; +// } +// +// Each successful call to "Consume" will set "var/value", and also +// advance "input" so it points past the matched text. +// +// The "FindAndConsume" operation is similar to "Consume" but does not +// anchor your match at the beginning of the string. For example, you +// could extract all words from a string by repeatedly calling +// pcrecpp::RE("(\\w+)").FindAndConsume(&input, &word) +// +// ----------------------------------------------------------------------- +// PARSING HEX/OCTAL/C-RADIX NUMBERS +// +// By default, if you pass a pointer to a numeric value, the +// corresponding text is interpreted as a base-10 number. You can +// instead wrap the pointer with a call to one of the operators Hex(), +// Octal(), or CRadix() to interpret the text in another base. The +// CRadix operator interprets C-style "0" (base-8) and "0x" (base-16) +// prefixes, but defaults to base-10. +// +// Example: +// int a, b, c, d; +// pcrecpp::RE re("(.*) (.*) (.*) (.*)"); +// re.FullMatch("100 40 0100 0x40", +// pcrecpp::Octal(&a), pcrecpp::Hex(&b), +// pcrecpp::CRadix(&c), pcrecpp::CRadix(&d)); +// will leave 64 in a, b, c, and d. +// +// ----------------------------------------------------------------------- +// REPLACING PARTS OF STRINGS +// +// You can replace the first match of "pattern" in "str" with +// "rewrite". Within "rewrite", backslash-escaped digits (\1 to \9) +// can be used to insert text matching corresponding parenthesized +// group from the pattern. \0 in "rewrite" refers to the entire +// matching text. E.g., +// +// string s = "yabba dabba doo"; +// pcrecpp::RE("b+").Replace("d", &s); +// +// will leave "s" containing "yada dabba doo". The result is true if +// the pattern matches and a replacement occurs, or false otherwise. +// +// GlobalReplace() is like Replace(), except that it replaces all +// occurrences of the pattern in the string with the rewrite. +// Replacements are not subject to re-matching. E.g., +// +// string s = "yabba dabba doo"; +// pcrecpp::RE("b+").GlobalReplace("d", &s); +// +// will leave "s" containing "yada dada doo". It returns the number +// of replacements made. +// +// Extract() is like Replace(), except that if the pattern matches, +// "rewrite" is copied into "out" (an additional argument) with +// substitutions. The non-matching portions of "text" are ignored. +// Returns true iff a match occurred and the extraction happened +// successfully. If no match occurs, the string is left unaffected. + + +#include +// These aren't technically needed here, but we include them +// anyway so folks who include pcrecpp.h don't have to include +// all these other header files as well. +#include +#include + +namespace pcrecpp { + +#define PCRE_SET_OR_CLEAR(b, o) \ + if (b) all_options_ |= (o); else all_options_ &= ~(o); \ + return *this + +#define PCRE_IS_SET(o) \ + (all_options_ & o) == o + +// We convert user-passed pointers into special Arg objects +class Arg; +extern Arg no_arg; + +/***** Compiling regular expressions: the RE class *****/ + +// RE_Options allow you to set options to be passed along to pcre, +// along with other options we put on top of pcre. +// Only 9 modifiers, plus match_limit are supported now. +class RE_Options { + public: + // constructor + RE_Options() : match_limit_(0), all_options_(0) {} + + // alternative constructor. + // To facilitate transfer of legacy code from C programs + // + // This lets you do + // RE(pattern, RE_Options(PCRE_CASELESS|PCRE_MULTILINE)).PartialMatch(str); + // But new code is better off doing + // RE(pattern, + // RE_Options().set_caseless(true).set_multiline(true)).PartialMatch(str); + RE_Options(int option_flags) : match_limit_(0), all_options_ (option_flags) {} + // we're fine with the default destructor, copy constructor, etc. + + // accessors and mutators + int match_limit() const { return match_limit_; }; + RE_Options &set_match_limit(int limit) { + match_limit_ = limit; + return *this; + } + + bool caseless() const { + return PCRE_IS_SET(PCRE_CASELESS); + } + RE_Options &set_caseless(bool x) { + PCRE_SET_OR_CLEAR(x, PCRE_CASELESS); + } + + bool multiline() const { + return PCRE_IS_SET(PCRE_MULTILINE); + } + RE_Options &set_multiline(bool x) { + PCRE_SET_OR_CLEAR(x, PCRE_MULTILINE); + } + + bool dotall() const { + return PCRE_IS_SET(PCRE_DOTALL); + } + RE_Options &set_dotall(bool x) { + PCRE_SET_OR_CLEAR(x,PCRE_DOTALL); + } + + bool extended() const { + return PCRE_IS_SET(PCRE_EXTENDED); + } + RE_Options &set_extended(bool x) { + PCRE_SET_OR_CLEAR(x,PCRE_EXTENDED); + } + + bool dollar_endonly() const { + return PCRE_IS_SET(PCRE_DOLLAR_ENDONLY); + } + RE_Options &set_dollar_endonly(bool x) { + PCRE_SET_OR_CLEAR(x,PCRE_DOLLAR_ENDONLY); + } + + bool extra() const { + return PCRE_IS_SET( PCRE_EXTRA); + } + RE_Options &set_extra(bool x) { + PCRE_SET_OR_CLEAR(x, PCRE_EXTRA); + } + + bool ungreedy() const { + return PCRE_IS_SET(PCRE_UNGREEDY); + } + RE_Options &set_ungreedy(bool x) { + PCRE_SET_OR_CLEAR(x, PCRE_UNGREEDY); + } + + bool utf8() const { + return PCRE_IS_SET(PCRE_UTF8); + } + RE_Options &set_utf8(bool x) { + PCRE_SET_OR_CLEAR(x, PCRE_UTF8); + } + + bool no_auto_capture() const { + return PCRE_IS_SET(PCRE_NO_AUTO_CAPTURE); + } + RE_Options &set_no_auto_capture(bool x) { + PCRE_SET_OR_CLEAR(x, PCRE_NO_AUTO_CAPTURE); + } + + RE_Options &set_all_options(int opt) { + all_options_ = opt; + return *this; + } + int all_options() const { + return all_options_ ; + } + + // TODO: add other pcre flags + + private: + int match_limit_; + int all_options_; +}; + +// These functions return some common RE_Options +static inline RE_Options UTF8() { + return RE_Options().set_utf8(true); +} + +static inline RE_Options CASELESS() { + return RE_Options().set_caseless(true); +} +static inline RE_Options MULTILINE() { + return RE_Options().set_multiline(true); +} + +static inline RE_Options DOTALL() { + return RE_Options().set_dotall(true); +} + +static inline RE_Options EXTENDED() { + return RE_Options().set_extended(true); +} + +// Interface for regular expression matching. Also corresponds to a +// pre-compiled regular expression. An "RE" object is safe for +// concurrent use by multiple threads. +class RE { + public: + // We provide implicit conversions from strings so that users can + // pass in a string or a "const char*" wherever an "RE" is expected. + RE(const char* pat) { Init(pat, NULL); } + RE(const char *pat, const RE_Options& option) { Init(pat, &option); } + RE(const string& pat) { Init(pat.c_str(), NULL); } + RE(const string& pat, const RE_Options& option) { Init(pat.c_str(), &option); } + + ~RE(); + + // The string specification for this RE. E.g. + // RE re("ab*c?d+"); + // re.pattern(); // "ab*c?d+" + const string& pattern() const { return pattern_; } + + // If RE could not be created properly, returns an error string. + // Else returns the empty string. + const string& error() const { return *error_; } + + /***** The useful part: the matching interface *****/ + + // This is provided so one can do pattern.ReplaceAll() just as + // easily as ReplaceAll(pattern-text, ....) + + bool FullMatch(const StringPiece& text, + const Arg& ptr1 = no_arg, + const Arg& ptr2 = no_arg, + const Arg& ptr3 = no_arg, + const Arg& ptr4 = no_arg, + const Arg& ptr5 = no_arg, + const Arg& ptr6 = no_arg, + const Arg& ptr7 = no_arg, + const Arg& ptr8 = no_arg, + const Arg& ptr9 = no_arg, + const Arg& ptr10 = no_arg, + const Arg& ptr11 = no_arg, + const Arg& ptr12 = no_arg, + const Arg& ptr13 = no_arg, + const Arg& ptr14 = no_arg, + const Arg& ptr15 = no_arg, + const Arg& ptr16 = no_arg) const; + + bool PartialMatch(const StringPiece& text, + const Arg& ptr1 = no_arg, + const Arg& ptr2 = no_arg, + const Arg& ptr3 = no_arg, + const Arg& ptr4 = no_arg, + const Arg& ptr5 = no_arg, + const Arg& ptr6 = no_arg, + const Arg& ptr7 = no_arg, + const Arg& ptr8 = no_arg, + const Arg& ptr9 = no_arg, + const Arg& ptr10 = no_arg, + const Arg& ptr11 = no_arg, + const Arg& ptr12 = no_arg, + const Arg& ptr13 = no_arg, + const Arg& ptr14 = no_arg, + const Arg& ptr15 = no_arg, + const Arg& ptr16 = no_arg) const; + + bool Consume(StringPiece* input, + const Arg& ptr1 = no_arg, + const Arg& ptr2 = no_arg, + const Arg& ptr3 = no_arg, + const Arg& ptr4 = no_arg, + const Arg& ptr5 = no_arg, + const Arg& ptr6 = no_arg, + const Arg& ptr7 = no_arg, + const Arg& ptr8 = no_arg, + const Arg& ptr9 = no_arg, + const Arg& ptr10 = no_arg, + const Arg& ptr11 = no_arg, + const Arg& ptr12 = no_arg, + const Arg& ptr13 = no_arg, + const Arg& ptr14 = no_arg, + const Arg& ptr15 = no_arg, + const Arg& ptr16 = no_arg) const; + + bool FindAndConsume(StringPiece* input, + const Arg& ptr1 = no_arg, + const Arg& ptr2 = no_arg, + const Arg& ptr3 = no_arg, + const Arg& ptr4 = no_arg, + const Arg& ptr5 = no_arg, + const Arg& ptr6 = no_arg, + const Arg& ptr7 = no_arg, + const Arg& ptr8 = no_arg, + const Arg& ptr9 = no_arg, + const Arg& ptr10 = no_arg, + const Arg& ptr11 = no_arg, + const Arg& ptr12 = no_arg, + const Arg& ptr13 = no_arg, + const Arg& ptr14 = no_arg, + const Arg& ptr15 = no_arg, + const Arg& ptr16 = no_arg) const; + + bool Replace(const StringPiece& rewrite, + string *str) const; + + int GlobalReplace(const StringPiece& rewrite, + string *str) const; + + bool Extract(const StringPiece &rewrite, + const StringPiece &text, + string *out) const; + + /***** Generic matching interface *****/ + + // Type of match (TODO: Should be restructured as part of RE_Options) + enum Anchor { + UNANCHORED, // No anchoring + ANCHOR_START, // Anchor at start only + ANCHOR_BOTH // Anchor at start and end + }; + + // General matching routine. Stores the length of the match in + // "*consumed" if successful. + bool DoMatch(const StringPiece& text, + Anchor anchor, + int* consumed, + const Arg* const* args, int n) const; + + // Return the number of capturing subpatterns, or -1 if the + // regexp wasn't valid on construction. + int NumberOfCapturingGroups(); + + private: + + void Init(const char* pattern, const RE_Options* options); + + // Match against "text", filling in "vec" (up to "vecsize" * 2/3) with + // pairs of integers for the beginning and end positions of matched + // text. The first pair corresponds to the entire matched text; + // subsequent pairs correspond, in order, to parentheses-captured + // matches. Returns the number of pairs (one more than the number of + // the last subpattern with a match) if matching was successful + // and zero if the match failed. + // I.e. for RE("(foo)|(bar)|(baz)") it will return 2, 3, and 4 when matching + // against "foo", "bar", and "baz" respectively. + // When matching RE("(foo)|hello") against "hello", it will return 1. + // But the values for all subpattern are filled in into "vec". + int TryMatch(const StringPiece& text, + int startpos, + Anchor anchor, + int *vec, + int vecsize) const; + + // Append the "rewrite" string, with backslash subsitutions from "text" + // and "vec", to string "out". + bool Rewrite(string *out, + const StringPiece& rewrite, + const StringPiece& text, + int *vec, + int veclen) const; + + // internal implementation for DoMatch + bool DoMatchImpl(const StringPiece& text, + Anchor anchor, + int* consumed, + const Arg* const args[], + int n, + int* vec, + int vecsize) const; + + // Compile the regexp for the specified anchoring mode + pcre* Compile(Anchor anchor); + + string pattern_; + RE_Options options_; + pcre* re_full_; // For full matches + pcre* re_partial_; // For partial matches + const string* error_; // Error indicator (or points to empty string) + int match_limit_; // limit on execution resources + + // Don't allow the default copy or assignment constructors -- + // they're expensive and too easy to do by accident. + RE(const RE&); + void operator=(const RE&); +}; + + +/***** Implementation details *****/ + +// Hex/Octal/Binary? + +// Special class for parsing into objects that define a ParseFrom() method +template +class _RE_MatchObject { + public: + static inline bool Parse(const char* str, int n, void* dest) { + T* object = reinterpret_cast(dest); + return object->ParseFrom(str, n); + } +}; + +class Arg { + public: + // Empty constructor so we can declare arrays of Arg + Arg(); + + // Constructor specially designed for NULL arguments + Arg(void*); + + typedef bool (*Parser)(const char* str, int n, void* dest); + +// Type-specific parsers +#define PCRE_MAKE_PARSER(type,name) \ + Arg(type* p) : arg_(p), parser_(name) { } \ + Arg(type* p, Parser parser) : arg_(p), parser_(parser) { } + + + PCRE_MAKE_PARSER(char, parse_char); + PCRE_MAKE_PARSER(unsigned char, parse_uchar); + PCRE_MAKE_PARSER(short, parse_short); + PCRE_MAKE_PARSER(unsigned short, parse_ushort); + PCRE_MAKE_PARSER(int, parse_int); + PCRE_MAKE_PARSER(unsigned int, parse_uint); + PCRE_MAKE_PARSER(long, parse_long); + PCRE_MAKE_PARSER(unsigned long, parse_ulong); +#if @pcre_have_long_long@ + PCRE_MAKE_PARSER(long long, parse_longlong); +#endif +#if @pcre_have_ulong_long@ + PCRE_MAKE_PARSER(unsigned long long, parse_ulonglong); +#endif + PCRE_MAKE_PARSER(float, parse_float); + PCRE_MAKE_PARSER(double, parse_double); + PCRE_MAKE_PARSER(string, parse_string); + PCRE_MAKE_PARSER(StringPiece, parse_stringpiece); + +#undef PCRE_MAKE_PARSER + + // Generic constructor + template Arg(T*, Parser parser); + // Generic constructor template + template Arg(T* p) + : arg_(p), parser_(_RE_MatchObject::Parse) { + } + + // Parse the data + bool Parse(const char* str, int n) const; + + private: + void* arg_; + Parser parser_; + + static bool parse_null (const char* str, int n, void* dest); + static bool parse_char (const char* str, int n, void* dest); + static bool parse_uchar (const char* str, int n, void* dest); + static bool parse_float (const char* str, int n, void* dest); + static bool parse_double (const char* str, int n, void* dest); + static bool parse_string (const char* str, int n, void* dest); + static bool parse_stringpiece (const char* str, int n, void* dest); + +#define PCRE_DECLARE_INTEGER_PARSER(name) \ + private: \ + static bool parse_ ## name(const char* str, int n, void* dest); \ + static bool parse_ ## name ## _radix( \ + const char* str, int n, void* dest, int radix); \ + public: \ + static bool parse_ ## name ## _hex(const char* str, int n, void* dest); \ + static bool parse_ ## name ## _octal(const char* str, int n, void* dest); \ + static bool parse_ ## name ## _cradix(const char* str, int n, void* dest) + + PCRE_DECLARE_INTEGER_PARSER(short); + PCRE_DECLARE_INTEGER_PARSER(ushort); + PCRE_DECLARE_INTEGER_PARSER(int); + PCRE_DECLARE_INTEGER_PARSER(uint); + PCRE_DECLARE_INTEGER_PARSER(long); + PCRE_DECLARE_INTEGER_PARSER(ulong); + PCRE_DECLARE_INTEGER_PARSER(longlong); + PCRE_DECLARE_INTEGER_PARSER(ulonglong); + +#undef PCRE_DECLARE_INTEGER_PARSER +}; + +inline Arg::Arg() : arg_(NULL), parser_(parse_null) { } +inline Arg::Arg(void* p) : arg_(p), parser_(parse_null) { } + +inline bool Arg::Parse(const char* str, int n) const { + return (*parser_)(str, n, arg_); +} + +// This part of the parser, appropriate only for ints, deals with bases +#define MAKE_INTEGER_PARSER(type, name) \ + inline Arg Hex(type* ptr) { \ + return Arg(ptr, Arg::parse_ ## name ## _hex); } \ + inline Arg Octal(type* ptr) { \ + return Arg(ptr, Arg::parse_ ## name ## _octal); } \ + inline Arg CRadix(type* ptr) { \ + return Arg(ptr, Arg::parse_ ## name ## _cradix); } + +MAKE_INTEGER_PARSER(short, short); +MAKE_INTEGER_PARSER(unsigned short, ushort); +MAKE_INTEGER_PARSER(int, int); +MAKE_INTEGER_PARSER(unsigned int, uint); +MAKE_INTEGER_PARSER(long, long); +MAKE_INTEGER_PARSER(unsigned long, ulong); +#if @pcre_have_long_long@ +MAKE_INTEGER_PARSER(long long, longlong); +#endif +#if @pcre_have_ulong_long@ +MAKE_INTEGER_PARSER(unsigned long long, ulonglong); +#endif + +#undef PCRE_IS_SET +#undef PCRE_SET_OR_CLEAR +#undef MAKE_INTEGER_PARSER + +} // namespace pcrecpp + + +#endif /* _PCRE_REGEXP_H */ diff --git a/mozilla/js/tamarin/pcre/pcrecpp_unittest.cc b/mozilla/js/tamarin/pcre/pcrecpp_unittest.cc new file mode 100644 index 00000000000..6a03744a7db --- /dev/null +++ b/mozilla/js/tamarin/pcre/pcrecpp_unittest.cc @@ -0,0 +1,1042 @@ +// Copyright (c) 2005, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Author: Sanjay Ghemawat +// +// TODO: Test extractions for PartialMatch/Consume + +#include +#include +#include "config.h" +#include "pcrecpp.h" + +using pcrecpp::StringPiece; +using pcrecpp::RE; +using pcrecpp::RE_Options; +using pcrecpp::Hex; +using pcrecpp::Octal; +using pcrecpp::CRadix; + +static bool VERBOSE_TEST = false; + +// CHECK dies with a fatal error if condition is not true. It is *not* +// controlled by NDEBUG, so the check will be executed regardless of +// compilation mode. Therefore, it is safe to do things like: +// CHECK_EQ(fp->Write(x), 4) +#define CHECK(condition) do { \ + if (!(condition)) { \ + fprintf(stderr, "%s:%d: Check failed: %s\n", \ + __FILE__, __LINE__, #condition); \ + exit(1); \ + } \ +} while (0) + +#define CHECK_EQ(a, b) CHECK(a == b) + +static void Timing1(int num_iters) { + // Same pattern lots of times + RE pattern("ruby:\\d+"); + StringPiece p("ruby:1234"); + for (int j = num_iters; j > 0; j--) { + CHECK(pattern.FullMatch(p)); + } +} + +static void Timing2(int num_iters) { + // Same pattern lots of times + RE pattern("ruby:(\\d+)"); + int i; + for (int j = num_iters; j > 0; j--) { + CHECK(pattern.FullMatch("ruby:1234", &i)); + CHECK_EQ(i, 1234); + } +} + +static void Timing3(int num_iters) { + string text_string; + for (int j = num_iters; j > 0; j--) { + text_string += "this is another line\n"; + } + + RE line_matcher(".*\n"); + string line; + StringPiece text(text_string); + int counter = 0; + while (line_matcher.Consume(&text)) { + counter++; + } + printf("Matched %d lines\n", counter); +} + +#if 0 // uncomment this if you have a way of defining VirtualProcessSize() + +static void LeakTest() { + // Check for memory leaks + unsigned long long initial_size = 0; + for (int i = 0; i < 100000; i++) { + if (i == 50000) { + initial_size = VirtualProcessSize(); + printf("Size after 50000: %llu\n", initial_size); + } + char buf[100]; + snprintf(buf, sizeof(buf), "pat%09d", i); + RE newre(buf); + } + uint64 final_size = VirtualProcessSize(); + printf("Size after 100000: %llu\n", final_size); + const double growth = double(final_size - initial_size) / final_size; + printf("Growth: %0.2f%%", growth * 100); + CHECK(growth < 0.02); // Allow < 2% growth +} + +#endif + +static void RadixTests() { + printf("Testing hex\n"); + +#define CHECK_HEX(type, value) \ + do { \ + type v; \ + CHECK(RE("([0-9a-fA-F]+)[uUlL]*").FullMatch(#value, Hex(&v))); \ + CHECK_EQ(v, 0x ## value); \ + CHECK(RE("([0-9a-fA-FxX]+)[uUlL]*").FullMatch("0x" #value, CRadix(&v))); \ + CHECK_EQ(v, 0x ## value); \ + } while(0) + + CHECK_HEX(short, 2bad); + CHECK_HEX(unsigned short, 2badU); + CHECK_HEX(int, dead); + CHECK_HEX(unsigned int, deadU); + CHECK_HEX(long, 7eadbeefL); + CHECK_HEX(unsigned long, deadbeefUL); +#ifdef HAVE_LONG_LONG + CHECK_HEX(long long, 12345678deadbeefLL); +#endif +#ifdef HAVE_UNSIGNED_LONG_LONG + CHECK_HEX(unsigned long long, cafebabedeadbeefULL); +#endif + +#undef CHECK_HEX + + printf("Testing octal\n"); + +#define CHECK_OCTAL(type, value) \ + do { \ + type v; \ + CHECK(RE("([0-7]+)[uUlL]*").FullMatch(#value, Octal(&v))); \ + CHECK_EQ(v, 0 ## value); \ + CHECK(RE("([0-9a-fA-FxX]+)[uUlL]*").FullMatch("0" #value, CRadix(&v))); \ + CHECK_EQ(v, 0 ## value); \ + } while(0) + + CHECK_OCTAL(short, 77777); + CHECK_OCTAL(unsigned short, 177777U); + CHECK_OCTAL(int, 17777777777); + CHECK_OCTAL(unsigned int, 37777777777U); + CHECK_OCTAL(long, 17777777777L); + CHECK_OCTAL(unsigned long, 37777777777UL); +#ifdef HAVE_LONG_LONG + CHECK_OCTAL(long long, 777777777777777777777LL); +#endif +#ifdef HAVE_UNSIGNED_LONG_LONG + CHECK_OCTAL(unsigned long long, 1777777777777777777777ULL); +#endif + +#undef CHECK_OCTAL + + printf("Testing decimal\n"); + +#define CHECK_DECIMAL(type, value) \ + do { \ + type v; \ + CHECK(RE("(-?[0-9]+)[uUlL]*").FullMatch(#value, &v)); \ + CHECK_EQ(v, value); \ + CHECK(RE("(-?[0-9a-fA-FxX]+)[uUlL]*").FullMatch(#value, CRadix(&v))); \ + CHECK_EQ(v, value); \ + } while(0) + + CHECK_DECIMAL(short, -1); + CHECK_DECIMAL(unsigned short, 9999); + CHECK_DECIMAL(int, -1000); + CHECK_DECIMAL(unsigned int, 12345U); + CHECK_DECIMAL(long, -10000000L); + CHECK_DECIMAL(unsigned long, 3083324652U); +#ifdef HAVE_LONG_LONG + CHECK_DECIMAL(long long, -100000000000000LL); +#endif +#ifdef HAVE_UNSIGNED_LONG_LONG + CHECK_DECIMAL(unsigned long long, 1234567890987654321ULL); +#endif + +#undef CHECK_DECIMAL + +} + +static void TestReplace() { + printf("Testing Replace\n"); + + struct ReplaceTest { + const char *regexp; + const char *rewrite; + const char *original; + const char *single; + const char *global; + }; + static const ReplaceTest tests[] = { + { "(qu|[b-df-hj-np-tv-z]*)([a-z]+)", + "\\2\\1ay", + "the quick brown fox jumps over the lazy dogs.", + "ethay quick brown fox jumps over the lazy dogs.", + "ethay ickquay ownbray oxfay umpsjay overay ethay azylay ogsday." }, + { "\\w+", + "\\0-NOSPAM", + "paul.haahr@google.com", + "paul-NOSPAM.haahr@google.com", + "paul-NOSPAM.haahr-NOSPAM@google-NOSPAM.com-NOSPAM" }, + { "^", + "(START)", + "foo", + "(START)foo", + "(START)foo" }, + { "^", + "(START)", + "", + "(START)", + "(START)" }, + { "$", + "(END)", + "", + "(END)", + "(END)" }, + { "b", + "bb", + "ababababab", + "abbabababab", + "abbabbabbabbabb" }, + { "b", + "bb", + "bbbbbb", + "bbbbbbb", + "bbbbbbbbbbbb" }, + { "b+", + "bb", + "bbbbbb", + "bb", + "bb" }, + { "b*", + "bb", + "bbbbbb", + "bb", + "bb" }, + { "b*", + "bb", + "aaaaa", + "bbaaaaa", + "bbabbabbabbabbabb" }, + { "", NULL, NULL, NULL, NULL } + }; + + for (const ReplaceTest *t = tests; t->original != NULL; ++t) { + string one(t->original); + CHECK(RE(t->regexp).Replace(t->rewrite, &one)); + CHECK_EQ(one, t->single); + string all(t->original); + CHECK(RE(t->regexp).GlobalReplace(t->rewrite, &all) > 0); + CHECK_EQ(all, t->global); + } +} + +static void TestExtract() { + printf("Testing Extract\n"); + + string s; + + CHECK(RE("(.*)@([^.]*)").Extract("\\2!\\1", "boris@kremvax.ru", &s)); + CHECK_EQ(s, "kremvax!boris"); + + // check the RE interface as well + CHECK(RE(".*").Extract("'\\0'", "foo", &s)); + CHECK_EQ(s, "'foo'"); + CHECK(!RE("bar").Extract("'\\0'", "baz", &s)); + CHECK_EQ(s, "'foo'"); +} + +static void TestConsume() { + printf("Testing Consume\n"); + + string word; + + string s(" aaa b!@#$@#$cccc"); + StringPiece input(s); + + RE r("\\s*(\\w+)"); // matches a word, possibly proceeded by whitespace + CHECK(r.Consume(&input, &word)); + CHECK_EQ(word, "aaa"); + CHECK(r.Consume(&input, &word)); + CHECK_EQ(word, "b"); + CHECK(! r.Consume(&input, &word)); +} + +static void TestFindAndConsume() { + printf("Testing FindAndConsume\n"); + + string word; + + string s(" aaa b!@#$@#$cccc"); + StringPiece input(s); + + RE r("(\\w+)"); // matches a word + CHECK(r.FindAndConsume(&input, &word)); + CHECK_EQ(word, "aaa"); + CHECK(r.FindAndConsume(&input, &word)); + CHECK_EQ(word, "b"); + CHECK(r.FindAndConsume(&input, &word)); + CHECK_EQ(word, "cccc"); + CHECK(! r.FindAndConsume(&input, &word)); +} + +static void TestMatchNumberPeculiarity() { + printf("Testing match-number peculiaraity\n"); + + string word1; + string word2; + string word3; + + RE r("(foo)|(bar)|(baz)"); + CHECK(r.PartialMatch("foo", &word1, &word2, &word3)); + CHECK_EQ(word1, "foo"); + CHECK_EQ(word2, ""); + CHECK_EQ(word3, ""); + CHECK(r.PartialMatch("bar", &word1, &word2, &word3)); + CHECK_EQ(word1, ""); + CHECK_EQ(word2, "bar"); + CHECK_EQ(word3, ""); + CHECK(r.PartialMatch("baz", &word1, &word2, &word3)); + CHECK_EQ(word1, ""); + CHECK_EQ(word2, ""); + CHECK_EQ(word3, "baz"); + CHECK(!r.PartialMatch("f", &word1, &word2, &word3)); + + string a; + CHECK(RE("(foo)|hello").FullMatch("hello", &a)); + CHECK_EQ(a, ""); +} + +static void TestRecursion(int size, const char *pattern, int match_limit) { + printf("Testing recursion\n"); + + // Fill up a string repeating the pattern given + string domain; + domain.resize(size); + int patlen = strlen(pattern); + for (int i = 0; i < size; ++i) { + domain[i] = pattern[i % patlen]; + } + // Just make sure it doesn't crash due to too much recursion. + RE_Options options; + options.set_match_limit(match_limit); + RE re("([a-zA-Z0-9]|-)+(\\.([a-zA-Z0-9]|-)+)*(\\.)?", options); + re.FullMatch(domain); +} + +// +// Options tests contributed by +// Giuseppe Maxia, CTO, Stardata s.r.l. +// July 2005 +// +static void GetOneOptionResult( + const char *option_name, + const char *regex, + const char *str, + RE_Options options, + bool full, + string expected) { + + printf("Testing Option <%s>\n", option_name); + if(VERBOSE_TEST) + printf("/%s/ finds \"%s\" within \"%s\" \n", + regex, + expected.c_str(), + str); + string captured(""); + if (full) + RE(regex,options).FullMatch(str, &captured); + else + RE(regex,options).PartialMatch(str, &captured); + CHECK_EQ(captured, expected); +} + +static void TestOneOption( + const char *option_name, + const char *regex, + const char *str, + RE_Options options, + bool full, + bool assertive = true) { + + printf("Testing Option <%s>\n", option_name); + if (VERBOSE_TEST) + printf("'%s' %s /%s/ \n", + str, + (assertive? "matches" : "doesn't match"), + regex); + if (assertive) { + if (full) + CHECK(RE(regex,options).FullMatch(str)); + else + CHECK(RE(regex,options).PartialMatch(str)); + } else { + if (full) + CHECK(!RE(regex,options).FullMatch(str)); + else + CHECK(!RE(regex,options).PartialMatch(str)); + } +} + +static void Test_CASELESS() { + RE_Options options; + RE_Options options2; + + options.set_caseless(true); + TestOneOption("CASELESS (class)", "HELLO", "hello", options, false); + TestOneOption("CASELESS (class2)", "HELLO", "hello", options2.set_caseless(true), false); + TestOneOption("CASELESS (class)", "^[A-Z]+$", "Hello", options, false); + + TestOneOption("CASELESS (function)", "HELLO", "hello", pcrecpp::CASELESS(), false); + TestOneOption("CASELESS (function)", "^[A-Z]+$", "Hello", pcrecpp::CASELESS(), false); + options.set_caseless(false); + TestOneOption("no CASELESS", "HELLO", "hello", options, false, false); +} + +static void Test_MULTILINE() { + RE_Options options; + RE_Options options2; + const char *str = "HELLO\n" "cruel\n" "world\n"; + + options.set_multiline(true); + TestOneOption("MULTILINE (class)", "^cruel$", str, options, false); + TestOneOption("MULTILINE (class2)", "^cruel$", str, options2.set_multiline(true), false); + TestOneOption("MULTILINE (function)", "^cruel$", str, pcrecpp::MULTILINE(), false); + options.set_multiline(false); + TestOneOption("no MULTILINE", "^cruel$", str, options, false, false); +} + +static void Test_DOTALL() { + RE_Options options; + RE_Options options2; + const char *str = "HELLO\n" "cruel\n" "world"; + + options.set_dotall(true); + TestOneOption("DOTALL (class)", "HELLO.*world", str, options, true); + TestOneOption("DOTALL (class2)", "HELLO.*world", str, options2.set_dotall(true), true); + TestOneOption("DOTALL (function)", "HELLO.*world", str, pcrecpp::DOTALL(), true); + options.set_dotall(false); + TestOneOption("no DOTALL", "HELLO.*world", str, options, true, false); +} + +static void Test_DOLLAR_ENDONLY() { + RE_Options options; + RE_Options options2; + const char *str = "HELLO world\n"; + + TestOneOption("no DOLLAR_ENDONLY", "world$", str, options, false); + options.set_dollar_endonly(true); + TestOneOption("DOLLAR_ENDONLY 1", "world$", str, options, false, false); + TestOneOption("DOLLAR_ENDONLY 2", "world$", str, options2.set_dollar_endonly(true), false, false); +} + +static void Test_EXTRA() { + RE_Options options; + const char *str = "HELLO"; + + options.set_extra(true); + TestOneOption("EXTRA 1", "\\HELL\\O", str, options, true, false ); + TestOneOption("EXTRA 2", "\\HELL\\O", str, RE_Options().set_extra(true), true, false ); + options.set_extra(false); + TestOneOption("no EXTRA", "\\HELL\\O", str, options, true ); +} + +static void Test_EXTENDED() { + RE_Options options; + RE_Options options2; + const char *str = "HELLO world"; + + options.set_extended(true); + TestOneOption("EXTENDED (class)", "HELLO world", str, options, false, false); + TestOneOption("EXTENDED (class2)", "HELLO world", str, options2.set_extended(true), false, false); + TestOneOption("EXTENDED (class)", + "^ HE L{2} O " + "\\s+ " + "\\w+ $ ", + str, + options, + false); + + TestOneOption("EXTENDED (function)", "HELLO world", str, pcrecpp::EXTENDED(), false, false); + TestOneOption("EXTENDED (function)", + "^ HE L{2} O " + "\\s+ " + "\\w+ $ ", + str, + pcrecpp::EXTENDED(), + false); + + options.set_extended(false); + TestOneOption("no EXTENDED", "HELLO world", str, options, false); +} + +static void Test_NO_AUTO_CAPTURE() { + RE_Options options; + const char *str = "HELLO world"; + string captured; + + printf("Testing Option \n"); + if (VERBOSE_TEST) + printf("parentheses capture text\n"); + RE re("(world|universe)$", options); + CHECK(re.Extract("\\1", str , &captured)); + CHECK_EQ(captured, "world"); + options.set_no_auto_capture(true); + printf("testing Option \n"); + if (VERBOSE_TEST) + printf("parentheses do not capture text\n"); + re.Extract("\\1",str, &captured ); + CHECK_EQ(captured, "world"); +} + +static void Test_UNGREEDY() { + RE_Options options; + const char *str = "HELLO, 'this' is the 'world'"; + + options.set_ungreedy(true); + GetOneOptionResult("UNGREEDY 1", "('.*')", str, options, false, "'this'" ); + GetOneOptionResult("UNGREEDY 2", "('.*')", str, RE_Options().set_ungreedy(true), false, "'this'" ); + GetOneOptionResult("UNGREEDY", "('.*?')", str, options, false, "'this' is the 'world'" ); + + options.set_ungreedy(false); + GetOneOptionResult("no UNGREEDY", "('.*')", str, options, false, "'this' is the 'world'" ); + GetOneOptionResult("no UNGREEDY", "('.*?')", str, options, false, "'this'" ); +} + +static void Test_all_options() { + const char *str = "HELLO\n" "cruel\n" "world"; + RE_Options options; + options.set_all_options(PCRE_CASELESS | PCRE_DOTALL); + + TestOneOption("all_options (CASELESS|DOTALL)", "^hello.*WORLD", str , options, false); + options.set_all_options(0); + TestOneOption("all_options (0)", "^hello.*WORLD", str , options, false, false); + options.set_all_options(PCRE_MULTILINE | PCRE_EXTENDED); + + TestOneOption("all_options (MULTILINE|EXTENDED)", " ^ c r u e l $ ", str, options, false); + TestOneOption("all_options (MULTILINE|EXTENDED) with constructor", + " ^ c r u e l $ ", + str, + RE_Options(PCRE_MULTILINE | PCRE_EXTENDED), + false); + + TestOneOption("all_options (MULTILINE|EXTENDED) with concatenation", + " ^ c r u e l $ ", + str, + RE_Options() + .set_multiline(true) + .set_extended(true), + false); + + options.set_all_options(0); + TestOneOption("all_options (0)", "^ c r u e l $", str, options, false, false); + +} + +static void TestOptions() { + printf("Testing Options\n"); + Test_CASELESS(); + Test_MULTILINE(); + Test_DOTALL(); + Test_DOLLAR_ENDONLY(); + Test_EXTENDED(); + Test_NO_AUTO_CAPTURE(); + Test_UNGREEDY(); + Test_EXTRA(); + Test_all_options(); +} + +int main(int argc, char** argv) { + // Treat any flag as --help + if (argc > 1 && argv[1][0] == '-') { + printf("Usage: %s [timing1|timing2|timing3 num-iters]\n" + " If 'timingX ###' is specified, run the given timing test\n" + " with the given number of iterations, rather than running\n" + " the default corectness test.\n", argv[0]); + return 0; + } + + if (argc > 1) { + if ( argc == 2 || atoi(argv[2]) == 0) { + printf("timing mode needs a num-iters argument\n"); + return 1; + } + if (!strcmp(argv[1], "timing1")) + Timing1(atoi(argv[2])); + else if (!strcmp(argv[1], "timing2")) + Timing2(atoi(argv[2])); + else if (!strcmp(argv[1], "timing3")) + Timing3(atoi(argv[2])); + else + printf("Unknown argument '%s'\n", argv[1]); + return 0; + } + + printf("Testing FullMatch\n"); + + int i; + string s; + + /***** FullMatch with no args *****/ + + CHECK(RE("h.*o").FullMatch("hello")); + CHECK(!RE("h.*o").FullMatch("othello")); + CHECK(!RE("h.*o").FullMatch("hello!")); + + /***** FullMatch with args *****/ + + // Zero-arg + CHECK(RE("\\d+").FullMatch("1001")); + + // Single-arg + CHECK(RE("(\\d+)").FullMatch("1001", &i)); + CHECK_EQ(i, 1001); + CHECK(RE("(-?\\d+)").FullMatch("-123", &i)); + CHECK_EQ(i, -123); + CHECK(!RE("()\\d+").FullMatch("10", &i)); + CHECK(!RE("(\\d+)").FullMatch("1234567890123456789012345678901234567890", + &i)); + + // Digits surrounding integer-arg + CHECK(RE("1(\\d*)4").FullMatch("1234", &i)); + CHECK_EQ(i, 23); + CHECK(RE("(\\d)\\d+").FullMatch("1234", &i)); + CHECK_EQ(i, 1); + CHECK(RE("(-\\d)\\d+").FullMatch("-1234", &i)); + CHECK_EQ(i, -1); + CHECK(RE("(\\d)").PartialMatch("1234", &i)); + CHECK_EQ(i, 1); + CHECK(RE("(-\\d)").PartialMatch("-1234", &i)); + CHECK_EQ(i, -1); + + // String-arg + CHECK(RE("h(.*)o").FullMatch("hello", &s)); + CHECK_EQ(s, string("ell")); + + // StringPiece-arg + StringPiece sp; + CHECK(RE("(\\w+):(\\d+)").FullMatch("ruby:1234", &sp, &i)); + CHECK_EQ(sp.size(), 4); + CHECK(memcmp(sp.data(), "ruby", 4) == 0); + CHECK_EQ(i, 1234); + + // Multi-arg + CHECK(RE("(\\w+):(\\d+)").FullMatch("ruby:1234", &s, &i)); + CHECK_EQ(s, string("ruby")); + CHECK_EQ(i, 1234); + + // Ignored arg + CHECK(RE("(\\w+)(:)(\\d+)").FullMatch("ruby:1234", &s, (void*)NULL, &i)); + CHECK_EQ(s, string("ruby")); + CHECK_EQ(i, 1234); + + // Type tests + { + char c; + CHECK(RE("(H)ello").FullMatch("Hello", &c)); + CHECK_EQ(c, 'H'); + } + { + unsigned char c; + CHECK(RE("(H)ello").FullMatch("Hello", &c)); + CHECK_EQ(c, static_cast('H')); + } + { + short v; + CHECK(RE("(-?\\d+)").FullMatch("100", &v)); CHECK_EQ(v, 100); + CHECK(RE("(-?\\d+)").FullMatch("-100", &v)); CHECK_EQ(v, -100); + CHECK(RE("(-?\\d+)").FullMatch("32767", &v)); CHECK_EQ(v, 32767); + CHECK(RE("(-?\\d+)").FullMatch("-32768", &v)); CHECK_EQ(v, -32768); + CHECK(!RE("(-?\\d+)").FullMatch("-32769", &v)); + CHECK(!RE("(-?\\d+)").FullMatch("32768", &v)); + } + { + unsigned short v; + CHECK(RE("(\\d+)").FullMatch("100", &v)); CHECK_EQ(v, 100); + CHECK(RE("(\\d+)").FullMatch("32767", &v)); CHECK_EQ(v, 32767); + CHECK(RE("(\\d+)").FullMatch("65535", &v)); CHECK_EQ(v, 65535); + CHECK(!RE("(\\d+)").FullMatch("65536", &v)); + } + { + int v; + static const int max_value = 0x7fffffff; + static const int min_value = -max_value - 1; + CHECK(RE("(-?\\d+)").FullMatch("100", &v)); CHECK_EQ(v, 100); + CHECK(RE("(-?\\d+)").FullMatch("-100", &v)); CHECK_EQ(v, -100); + CHECK(RE("(-?\\d+)").FullMatch("2147483647", &v)); CHECK_EQ(v, max_value); + CHECK(RE("(-?\\d+)").FullMatch("-2147483648", &v)); CHECK_EQ(v, min_value); + CHECK(!RE("(-?\\d+)").FullMatch("-2147483649", &v)); + CHECK(!RE("(-?\\d+)").FullMatch("2147483648", &v)); + } + { + unsigned int v; + static const unsigned int max_value = 0xfffffffful; + CHECK(RE("(\\d+)").FullMatch("100", &v)); CHECK_EQ(v, 100); + CHECK(RE("(\\d+)").FullMatch("4294967295", &v)); CHECK_EQ(v, max_value); + CHECK(!RE("(\\d+)").FullMatch("4294967296", &v)); + } +#ifdef HAVE_LONG_LONG + { + long long v; + static const long long max_value = 0x7fffffffffffffffLL; + static const long long min_value = -max_value - 1; + char buf[32]; + + CHECK(RE("(-?\\d+)").FullMatch("100", &v)); CHECK_EQ(v, 100); + CHECK(RE("(-?\\d+)").FullMatch("-100",&v)); CHECK_EQ(v, -100); + + snprintf(buf, sizeof(buf), "%lld", max_value); + CHECK(RE("(-?\\d+)").FullMatch(buf,&v)); CHECK_EQ(v, max_value); + + snprintf(buf, sizeof(buf), "%lld", min_value); + CHECK(RE("(-?\\d+)").FullMatch(buf,&v)); CHECK_EQ(v, min_value); + + snprintf(buf, sizeof(buf), "%lld", max_value); + assert(buf[strlen(buf)-1] != '9'); + buf[strlen(buf)-1]++; + CHECK(!RE("(-?\\d+)").FullMatch(buf, &v)); + + snprintf(buf, sizeof(buf), "%lld", min_value); + assert(buf[strlen(buf)-1] != '9'); + buf[strlen(buf)-1]++; + CHECK(!RE("(-?\\d+)").FullMatch(buf, &v)); + } +#endif +#if defined HAVE_UNSIGNED_LONG_LONG && defined HAVE_LONG_LONG + { + unsigned long long v; + long long v2; + static const unsigned long long max_value = 0xffffffffffffffffULL; + char buf[32]; + + CHECK(RE("(-?\\d+)").FullMatch("100",&v)); CHECK_EQ(v, 100); + CHECK(RE("(-?\\d+)").FullMatch("-100",&v2)); CHECK_EQ(v2, -100); + + snprintf(buf, sizeof(buf), "%llu", max_value); + CHECK(RE("(-?\\d+)").FullMatch(buf,&v)); CHECK_EQ(v, max_value); + + assert(buf[strlen(buf)-1] != '9'); + buf[strlen(buf)-1]++; + CHECK(!RE("(-?\\d+)").FullMatch(buf, &v)); + } +#endif + { + float v; + CHECK(RE("(.*)").FullMatch("100", &v)); + CHECK(RE("(.*)").FullMatch("-100.", &v)); + CHECK(RE("(.*)").FullMatch("1e23", &v)); + } + { + double v; + CHECK(RE("(.*)").FullMatch("100", &v)); + CHECK(RE("(.*)").FullMatch("-100.", &v)); + CHECK(RE("(.*)").FullMatch("1e23", &v)); + } + + // Check that matching is fully anchored + CHECK(!RE("(\\d+)").FullMatch("x1001", &i)); + CHECK(!RE("(\\d+)").FullMatch("1001x", &i)); + CHECK(RE("x(\\d+)").FullMatch("x1001", &i)); CHECK_EQ(i, 1001); + CHECK(RE("(\\d+)x").FullMatch("1001x", &i)); CHECK_EQ(i, 1001); + + // Braces + CHECK(RE("[0-9a-f+.-]{5,}").FullMatch("0abcd")); + CHECK(RE("[0-9a-f+.-]{5,}").FullMatch("0abcde")); + CHECK(!RE("[0-9a-f+.-]{5,}").FullMatch("0abc")); + + // Complicated RE + CHECK(RE("foo|bar|[A-Z]").FullMatch("foo")); + CHECK(RE("foo|bar|[A-Z]").FullMatch("bar")); + CHECK(RE("foo|bar|[A-Z]").FullMatch("X")); + CHECK(!RE("foo|bar|[A-Z]").FullMatch("XY")); + + // Check full-match handling (needs '$' tacked on internally) + CHECK(RE("fo|foo").FullMatch("fo")); + CHECK(RE("fo|foo").FullMatch("foo")); + CHECK(RE("fo|foo$").FullMatch("fo")); + CHECK(RE("fo|foo$").FullMatch("foo")); + CHECK(RE("foo$").FullMatch("foo")); + CHECK(!RE("foo\\$").FullMatch("foo$bar")); + CHECK(!RE("fo|bar").FullMatch("fox")); + + // Uncomment the following if we change the handling of '$' to + // prevent it from matching a trailing newline + if (false) { + // Check that we don't get bitten by pcre's special handling of a + // '\n' at the end of the string matching '$' + CHECK(!RE("foo$").PartialMatch("foo\n")); + } + + // Number of args + int a[16]; + CHECK(RE("").FullMatch("")); + + memset(a, 0, sizeof(0)); + CHECK(RE("(\\d){1}").FullMatch("1", + &a[0])); + CHECK_EQ(a[0], 1); + + memset(a, 0, sizeof(0)); + CHECK(RE("(\\d)(\\d)").FullMatch("12", + &a[0], &a[1])); + CHECK_EQ(a[0], 1); + CHECK_EQ(a[1], 2); + + memset(a, 0, sizeof(0)); + CHECK(RE("(\\d)(\\d)(\\d)").FullMatch("123", + &a[0], &a[1], &a[2])); + CHECK_EQ(a[0], 1); + CHECK_EQ(a[1], 2); + CHECK_EQ(a[2], 3); + + memset(a, 0, sizeof(0)); + CHECK(RE("(\\d)(\\d)(\\d)(\\d)").FullMatch("1234", + &a[0], &a[1], &a[2], &a[3])); + CHECK_EQ(a[0], 1); + CHECK_EQ(a[1], 2); + CHECK_EQ(a[2], 3); + CHECK_EQ(a[3], 4); + + memset(a, 0, sizeof(0)); + CHECK(RE("(\\d)(\\d)(\\d)(\\d)(\\d)").FullMatch("12345", + &a[0], &a[1], &a[2], + &a[3], &a[4])); + CHECK_EQ(a[0], 1); + CHECK_EQ(a[1], 2); + CHECK_EQ(a[2], 3); + CHECK_EQ(a[3], 4); + CHECK_EQ(a[4], 5); + + memset(a, 0, sizeof(0)); + CHECK(RE("(\\d)(\\d)(\\d)(\\d)(\\d)(\\d)").FullMatch("123456", + &a[0], &a[1], &a[2], + &a[3], &a[4], &a[5])); + CHECK_EQ(a[0], 1); + CHECK_EQ(a[1], 2); + CHECK_EQ(a[2], 3); + CHECK_EQ(a[3], 4); + CHECK_EQ(a[4], 5); + CHECK_EQ(a[5], 6); + + memset(a, 0, sizeof(0)); + CHECK(RE("(\\d)(\\d)(\\d)(\\d)(\\d)(\\d)(\\d)").FullMatch("1234567", + &a[0], &a[1], &a[2], &a[3], + &a[4], &a[5], &a[6])); + CHECK_EQ(a[0], 1); + CHECK_EQ(a[1], 2); + CHECK_EQ(a[2], 3); + CHECK_EQ(a[3], 4); + CHECK_EQ(a[4], 5); + CHECK_EQ(a[5], 6); + CHECK_EQ(a[6], 7); + + memset(a, 0, sizeof(0)); + CHECK(RE("(\\d)(\\d)(\\d)(\\d)(\\d)(\\d)(\\d)(\\d)" + "(\\d)(\\d)(\\d)(\\d)(\\d)(\\d)(\\d)(\\d)").FullMatch( + "1234567890123456", + &a[0], &a[1], &a[2], &a[3], + &a[4], &a[5], &a[6], &a[7], + &a[8], &a[9], &a[10], &a[11], + &a[12], &a[13], &a[14], &a[15])); + CHECK_EQ(a[0], 1); + CHECK_EQ(a[1], 2); + CHECK_EQ(a[2], 3); + CHECK_EQ(a[3], 4); + CHECK_EQ(a[4], 5); + CHECK_EQ(a[5], 6); + CHECK_EQ(a[6], 7); + CHECK_EQ(a[7], 8); + CHECK_EQ(a[8], 9); + CHECK_EQ(a[9], 0); + CHECK_EQ(a[10], 1); + CHECK_EQ(a[11], 2); + CHECK_EQ(a[12], 3); + CHECK_EQ(a[13], 4); + CHECK_EQ(a[14], 5); + CHECK_EQ(a[15], 6); + + /***** PartialMatch *****/ + + printf("Testing PartialMatch\n"); + + CHECK(RE("h.*o").PartialMatch("hello")); + CHECK(RE("h.*o").PartialMatch("othello")); + CHECK(RE("h.*o").PartialMatch("hello!")); + CHECK(RE("((((((((((((((((((((x))))))))))))))))))))").PartialMatch("x")); + + RadixTests(); + TestReplace(); + TestExtract(); + TestConsume(); + TestFindAndConsume(); + TestMatchNumberPeculiarity(); + + // Check the pattern() accessor + { + const string kPattern = "http://([^/]+)/.*"; + const RE re(kPattern); + CHECK_EQ(kPattern, re.pattern()); + } + + // Check RE error field. + { + RE re("foo"); + CHECK(re.error().empty()); // Must have no error + } + +#ifdef SUPPORT_UTF8 + // Check UTF-8 handling + { + printf("Testing UTF-8 handling\n"); + + // Three Japanese characters (nihongo) + const char utf8_string[] = { + 0xe6, 0x97, 0xa5, // 65e5 + 0xe6, 0x9c, 0xac, // 627c + 0xe8, 0xaa, 0x9e, // 8a9e + 0 + }; + const char utf8_pattern[] = { + '.', + 0xe6, 0x9c, 0xac, // 627c + '.', + 0 + }; + + // Both should match in either mode, bytes or UTF-8 + RE re_test1("........."); + CHECK(re_test1.FullMatch(utf8_string)); + RE re_test2("...", pcrecpp::UTF8()); + CHECK(re_test2.FullMatch(utf8_string)); + + // Check that '.' matches one byte or UTF-8 character + // according to the mode. + string ss; + RE re_test3("(.)"); + CHECK(re_test3.PartialMatch(utf8_string, &ss)); + CHECK_EQ(ss, string("\xe6")); + RE re_test4("(.)", pcrecpp::UTF8()); + CHECK(re_test4.PartialMatch(utf8_string, &ss)); + CHECK_EQ(ss, string("\xe6\x97\xa5")); + + // Check that string matches itself in either mode + RE re_test5(utf8_string); + CHECK(re_test5.FullMatch(utf8_string)); + RE re_test6(utf8_string, pcrecpp::UTF8()); + CHECK(re_test6.FullMatch(utf8_string)); + + // Check that pattern matches string only in UTF8 mode + RE re_test7(utf8_pattern); + CHECK(!re_test7.FullMatch(utf8_string)); + RE re_test8(utf8_pattern, pcrecpp::UTF8()); + CHECK(re_test8.FullMatch(utf8_string)); + } + + // Check that ungreedy, UTF8 regular expressions don't match when they + // oughtn't -- see bug 82246. + { + // This code always worked. + const char* pattern = "\\w+X"; + const string target = "a aX"; + RE match_sentence(pattern); + RE match_sentence_re(pattern, pcrecpp::UTF8()); + + CHECK(!match_sentence.FullMatch(target)); + CHECK(!match_sentence_re.FullMatch(target)); + } + + { + const char* pattern = "(?U)\\w+X"; + const string target = "a aX"; + RE match_sentence(pattern); + RE match_sentence_re(pattern, pcrecpp::UTF8()); + + CHECK(!match_sentence.FullMatch(target)); + CHECK(!match_sentence_re.FullMatch(target)); + } +#endif /* def SUPPORT_UTF8 */ + + printf("Testing error reporting\n"); + + { RE re("a\\1"); CHECK(!re.error().empty()); } + { + RE re("a[x"); + CHECK(!re.error().empty()); + } + { + RE re("a[z-a]"); + CHECK(!re.error().empty()); + } + { + RE re("a[[:foobar:]]"); + CHECK(!re.error().empty()); + } + { + RE re("a(b"); + CHECK(!re.error().empty()); + } + { + RE re("a\\"); + CHECK(!re.error().empty()); + } + + // Test that recursion is stopped: there will be some errors reported + int matchlimit = 5000; + int bytes = 15 * 1024; // enough to crash if there was no match limit + TestRecursion(bytes, ".", matchlimit); + TestRecursion(bytes, "a", matchlimit); + TestRecursion(bytes, "a.", matchlimit); + TestRecursion(bytes, "ab.", matchlimit); + TestRecursion(bytes, "abc.", matchlimit); + + // Test Options + if (getenv("VERBOSE_TEST") != NULL) + VERBOSE_TEST = true; + TestOptions(); + + // Done + printf("OK\n"); + + return 0; +} diff --git a/mozilla/js/tamarin/pcre/pcredemo.cpp b/mozilla/js/tamarin/pcre/pcredemo.cpp new file mode 100644 index 00000000000..3817203b5fd --- /dev/null +++ b/mozilla/js/tamarin/pcre/pcredemo.cpp @@ -0,0 +1,324 @@ +/************************************************* +* PCRE DEMONSTRATION PROGRAM * +*************************************************/ + +/* This is a demonstration program to illustrate the most straightforward ways +of calling the PCRE regular expression library from a C program. See the +pcresample documentation for a short discussion. + +Compile thuswise: + gcc -Wall pcredemo.c -I/usr/local/include -L/usr/local/lib \ + -R/usr/local/lib -lpcre + +Replace "/usr/local/include" and "/usr/local/lib" with wherever the include and +library files for PCRE are installed on your system. Only some operating +systems (e.g. Solaris) use the -R option. +*/ + + +#include +#include +#include + +#define OVECCOUNT 30 /* should be a multiple of 3 */ + + +int main(int argc, char **argv) +{ +pcre *re; +const char *error; +char *pattern; +char *subject; +unsigned char *name_table; +int erroffset; +int find_all; +int namecount; +int name_entry_size; +int ovector[OVECCOUNT]; +int subject_length; +int rc, i; + + +/************************************************************************** +* First, sort out the command line. There is only one possible option at * +* the moment, "-g" to request repeated matching to find all occurrences, * +* like Perl's /g option. We set the variable find_all to a non-zero value * +* if the -g option is present. Apart from that, there must be exactly two * +* arguments. * +**************************************************************************/ + +find_all = 0; +for (i = 1; i < argc; i++) + { + if (strcmp(argv[i], "-g") == 0) find_all = 1; + else break; + } + +/* After the options, we require exactly two arguments, which are the pattern, +and the subject string. */ + +if (argc - i != 2) + { + printf("Two arguments required: a regex and a subject string\n"); + return 1; + } + +pattern = argv[i]; +subject = argv[i+1]; +subject_length = (int)strlen(subject); + + +/************************************************************************* +* Now we are going to compile the regular expression pattern, and handle * +* and errors that are detected. * +*************************************************************************/ + +re = pcre_compile( + pattern, /* the pattern */ + 0, /* default options */ + &error, /* for error message */ + &erroffset, /* for error offset */ + NULL); /* use default character tables */ + +/* Compilation failed: print the error message and exit */ + +if (re == NULL) + { + printf("PCRE compilation failed at offset %d: %s\n", erroffset, error); + return 1; + } + + +/************************************************************************* +* If the compilation succeeded, we call PCRE again, in order to do a * +* pattern match against the subject string. This does just ONE match. If * +* further matching is needed, it will be done below. * +*************************************************************************/ + +rc = pcre_exec( + re, /* the compiled pattern */ + NULL, /* no extra data - we didn't study the pattern */ + subject, /* the subject string */ + subject_length, /* the length of the subject */ + 0, /* start at offset 0 in the subject */ + 0, /* default options */ + ovector, /* output vector for substring information */ + OVECCOUNT); /* number of elements in the output vector */ + +/* Matching failed: handle error cases */ + +if (rc < 0) + { + switch(rc) + { + case PCRE_ERROR_NOMATCH: printf("No match\n"); break; + /* + Handle other special cases if you like + */ + default: printf("Matching error %d\n", rc); break; + } + free(re); /* Release memory used for the compiled pattern */ + return 1; + } + +/* Match succeded */ + +printf("\nMatch succeeded at offset %d\n", ovector[0]); + + +/************************************************************************* +* We have found the first match within the subject string. If the output * +* vector wasn't big enough, set its size to the maximum. Then output any * +* substrings that were captured. * +*************************************************************************/ + +/* The output vector wasn't big enough */ + +if (rc == 0) + { + rc = OVECCOUNT/3; + printf("ovector only has room for %d captured substrings\n", rc - 1); + } + +/* Show substrings stored in the output vector by number. Obviously, in a real +application you might want to do things other than print them. */ + +for (i = 0; i < rc; i++) + { + char *substring_start = subject + ovector[2*i]; + int substring_length = ovector[2*i+1] - ovector[2*i]; + printf("%2d: %.*s\n", i, substring_length, substring_start); + } + + +/************************************************************************** +* That concludes the basic part of this demonstration program. We have * +* compiled a pattern, and performed a single match. The code that follows * +* first shows how to access named substrings, and then how to code for * +* repeated matches on the same subject. * +**************************************************************************/ + +/* See if there are any named substrings, and if so, show them by name. First +we have to extract the count of named parentheses from the pattern. */ + +(void)pcre_fullinfo( + re, /* the compiled pattern */ + NULL, /* no extra data - we didn't study the pattern */ + PCRE_INFO_NAMECOUNT, /* number of named substrings */ + &namecount); /* where to put the answer */ + +if (namecount <= 0) printf("No named substrings\n"); else + { + unsigned char *tabptr; + printf("Named substrings\n"); + + /* Before we can access the substrings, we must extract the table for + translating names to numbers, and the size of each entry in the table. */ + + (void)pcre_fullinfo( + re, /* the compiled pattern */ + NULL, /* no extra data - we didn't study the pattern */ + PCRE_INFO_NAMETABLE, /* address of the table */ + &name_table); /* where to put the answer */ + + (void)pcre_fullinfo( + re, /* the compiled pattern */ + NULL, /* no extra data - we didn't study the pattern */ + PCRE_INFO_NAMEENTRYSIZE, /* size of each entry in the table */ + &name_entry_size); /* where to put the answer */ + + /* Now we can scan the table and, for each entry, print the number, the name, + and the substring itself. */ + + tabptr = name_table; + for (i = 0; i < namecount; i++) + { + int n = (tabptr[0] << 8) | tabptr[1]; + printf("(%d) %*s: %.*s\n", n, name_entry_size - 3, tabptr + 2, + ovector[2*n+1] - ovector[2*n], subject + ovector[2*n]); + tabptr += name_entry_size; + } + } + + +/************************************************************************* +* If the "-g" option was given on the command line, we want to continue * +* to search for additional matches in the subject string, in a similar * +* way to the /g option in Perl. This turns out to be trickier than you * +* might think because of the possibility of matching an empty string. * +* What happens is as follows: * +* * +* If the previous match was NOT for an empty string, we can just start * +* the next match at the end of the previous one. * +* * +* If the previous match WAS for an empty string, we can't do that, as it * +* would lead to an infinite loop. Instead, a special call of pcre_exec() * +* is made with the PCRE_NOTEMPTY and PCRE_ANCHORED flags set. The first * +* of these tells PCRE that an empty string is not a valid match; other * +* possibilities must be tried. The second flag restricts PCRE to one * +* match attempt at the initial string position. If this match succeeds, * +* an alternative to the empty string match has been found, and we can * +* proceed round the loop. * +*************************************************************************/ + +if (!find_all) + { + free(re); /* Release the memory used for the compiled pattern */ + return 0; /* Finish unless -g was given */ + } + +/* Loop for second and subsequent matches */ + +for (;;) + { + int options = 0; /* Normally no options */ + int start_offset = ovector[1]; /* Start at end of previous match */ + + /* If the previous match was for an empty string, we are finished if we are + at the end of the subject. Otherwise, arrange to run another match at the + same point to see if a non-empty match can be found. */ + + if (ovector[0] == ovector[1]) + { + if (ovector[0] == subject_length) break; + options = PCRE_NOTEMPTY | PCRE_ANCHORED; + } + + /* Run the next matching operation */ + + rc = pcre_exec( + re, /* the compiled pattern */ + NULL, /* no extra data - we didn't study the pattern */ + subject, /* the subject string */ + subject_length, /* the length of the subject */ + start_offset, /* starting offset in the subject */ + options, /* options */ + ovector, /* output vector for substring information */ + OVECCOUNT); /* number of elements in the output vector */ + + /* This time, a result of NOMATCH isn't an error. If the value in "options" + is zero, it just means we have found all possible matches, so the loop ends. + Otherwise, it means we have failed to find a non-empty-string match at a + point where there was a previous empty-string match. In this case, we do what + Perl does: advance the matching position by one, and continue. We do this by + setting the "end of previous match" offset, because that is picked up at the + top of the loop as the point at which to start again. */ + + if (rc == PCRE_ERROR_NOMATCH) + { + if (options == 0) break; + ovector[1] = start_offset + 1; + continue; /* Go round the loop again */ + } + + /* Other matching errors are not recoverable. */ + + if (rc < 0) + { + printf("Matching error %d\n", rc); + free(re); /* Release memory used for the compiled pattern */ + return 1; + } + + /* Match succeded */ + + printf("\nMatch succeeded again at offset %d\n", ovector[0]); + + /* The match succeeded, but the output vector wasn't big enough. */ + + if (rc == 0) + { + rc = OVECCOUNT/3; + printf("ovector only has room for %d captured substrings\n", rc - 1); + } + + /* As before, show substrings stored in the output vector by number, and then + also any named substrings. */ + + for (i = 0; i < rc; i++) + { + char *substring_start = subject + ovector[2*i]; + int substring_length = ovector[2*i+1] - ovector[2*i]; + printf("%2d: %.*s\n", i, substring_length, substring_start); + } + + if (namecount <= 0) printf("No named substrings\n"); else + { + unsigned char *tabptr = name_table; + printf("Named substrings\n"); + for (i = 0; i < namecount; i++) + { + int n = (tabptr[0] << 8) | tabptr[1]; + printf("(%d) %*s: %.*s\n", n, name_entry_size - 3, tabptr + 2, + ovector[2*n+1] - ovector[2*n], subject + ovector[2*n]); + tabptr += name_entry_size; + } + } + } /* End of loop to find second and subsequent matches */ + +printf("\n"); +free(re); /* Release memory used for the compiled pattern */ +return 0; +} + +/* End of pcredemo.c */ diff --git a/mozilla/js/tamarin/pcre/pcregrep.cpp b/mozilla/js/tamarin/pcre/pcregrep.cpp new file mode 100644 index 00000000000..d390ae5f7c2 --- /dev/null +++ b/mozilla/js/tamarin/pcre/pcregrep.cpp @@ -0,0 +1,1164 @@ +/************************************************* +* pcregrep program * +*************************************************/ + +/* This is a grep program that uses the PCRE regular expression library to do +its pattern matching. On a Unix or Win32 system it can recurse into +directories. + + Copyright (c) 1997-2005 University of Cambridge + +----------------------------------------------------------------------------- +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + * Neither the name of the University of Cambridge nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +----------------------------------------------------------------------------- +*/ + +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "config.h" +#include "pcre.h" + +#define FALSE 0 +#define TRUE 1 + +typedef int BOOL; + +#define VERSION "4.1 05-Sep-2005" +#define MAX_PATTERN_COUNT 100 + +#if BUFSIZ > 8192 +#define MBUFTHIRD BUFSIZ +#else +#define MBUFTHIRD 8192 +#endif + + + +/************************************************* +* Global variables * +*************************************************/ + +static char *pattern_filename = NULL; +static char *stdin_name = (char *)"(standard input)"; +static int pattern_count = 0; +static pcre **pattern_list; +static pcre_extra **hints_list; + +static char *include_pattern = NULL; +static char *exclude_pattern = NULL; + +static pcre *include_compiled = NULL; +static pcre *exclude_compiled = NULL; + +static int after_context = 0; +static int before_context = 0; +static int both_context = 0; + +static BOOL count_only = FALSE; +static BOOL filenames = TRUE; +static BOOL filenames_only = FALSE; +static BOOL filenames_nomatch_only = FALSE; +static BOOL hyphenpending = FALSE; +static BOOL invert = FALSE; +static BOOL multiline = FALSE; +static BOOL number = FALSE; +static BOOL quiet = FALSE; +static BOOL recurse = FALSE; +static BOOL silent = FALSE; +static BOOL whole_lines = FALSE; +static BOOL word_match = FALSE; + +/* Structure for options and list of them */ + +enum { OP_NODATA, OP_STRING, OP_NUMBER }; + +typedef struct option_item { + int type; + int one_char; + void *dataptr; + const char *long_name; + const char *help_text; +} option_item; + +static option_item optionlist[] = { + { OP_NODATA, -1, NULL, "", " terminate options" }, + { OP_NODATA, -1, NULL, "help", "display this help and exit" }, + { OP_NUMBER, 'A', &after_context, "after-context=number", "set number of following context lines" }, + { OP_NUMBER, 'B', &before_context, "before-context=number", "set number of prior context lines" }, + { OP_NUMBER, 'C', &both_context, "context=number", "set number of context lines, before & after" }, + { OP_NODATA, 'c', NULL, "count", "print only a count of matching lines per FILE" }, + { OP_STRING, 'f', &pattern_filename, "file=path", "read patterns from file" }, + { OP_NODATA, 'h', NULL, "no-filename", "suppress the prefixing filename on output" }, + { OP_NODATA, 'i', NULL, "ignore-case", "ignore case distinctions" }, + { OP_NODATA, 'l', NULL, "files-with-matches", "print only FILE names containing matches" }, + { OP_NODATA, 'L', NULL, "files-without-match","print only FILE names not containing matches" }, + { OP_STRING, -1, &stdin_name, "label=name", "set name for standard input" }, + { OP_NODATA, 'M', NULL, "multiline", "run in multiline mode" }, + { OP_NODATA, 'n', NULL, "line-number", "print line number with output lines" }, + { OP_NODATA, 'q', NULL, "quiet", "suppress output, just set return code" }, + { OP_NODATA, 'r', NULL, "recursive", "recursively scan sub-directories" }, + { OP_STRING, -1, &exclude_pattern, "exclude=pattern","exclude matching files when recursing" }, + { OP_STRING, -1, &include_pattern, "include=pattern","include matching files when recursing" }, + { OP_NODATA, 's', NULL, "no-messages", "suppress error messages" }, + { OP_NODATA, 'u', NULL, "utf-8", "use UTF-8 mode" }, + { OP_NODATA, 'V', NULL, "version", "print version information and exit" }, + { OP_NODATA, 'v', NULL, "invert-match", "select non-matching lines" }, + { OP_NODATA, 'w', NULL, "word-regex(p)", "force PATTERN to match only as a word" }, + { OP_NODATA, 'x', NULL, "line-regex(p)", "force PATTERN to match only whole lines" }, + { OP_NODATA, 0, NULL, NULL, NULL } +}; + + +/************************************************* +* Functions for directory scanning * +*************************************************/ + +/* These functions are defined so that they can be made system specific, +although at present the only ones are for Unix, Win32, and for "no directory +recursion support". */ + + +/************* Directory scanning in Unix ***********/ + +#if IS_UNIX +#include +#include +#include + +typedef DIR directory_type; + +static int +isdirectory(char *filename) +{ +struct stat statbuf; +if (stat(filename, &statbuf) < 0) + return 0; /* In the expectation that opening as a file will fail */ +return ((statbuf.st_mode & S_IFMT) == S_IFDIR)? '/' : 0; +} + +static directory_type * +opendirectory(char *filename) +{ +return opendir(filename); +} + +static char * +readdirectory(directory_type *dir) +{ +for (;;) + { + struct dirent *dent = readdir(dir); + if (dent == NULL) return NULL; + if (strcmp(dent->d_name, ".") != 0 && strcmp(dent->d_name, "..") != 0) + return dent->d_name; + } +return NULL; /* Keep compiler happy; never executed */ +} + +static void +closedirectory(directory_type *dir) +{ +closedir(dir); +} + + +/************* Directory scanning in Win32 ***********/ + +/* I (Philip Hazel) have no means of testing this code. It was contributed by +Lionel Fourquaux. David Burgess added a patch to define INVALID_FILE_ATTRIBUTES +when it did not exist. */ + + +#elif HAVE_WIN32API + +#ifndef STRICT +# define STRICT +#endif +#ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN +#endif +#ifndef INVALID_FILE_ATTRIBUTES +#define INVALID_FILE_ATTRIBUTES 0xFFFFFFFF +#endif + +#include + +typedef struct directory_type +{ +HANDLE handle; +BOOL first; +WIN32_FIND_DATA data; +} directory_type; + +int +isdirectory(char *filename) +{ +DWORD attr = GetFileAttributes(filename); +if (attr == INVALID_FILE_ATTRIBUTES) + return 0; +return ((attr & FILE_ATTRIBUTE_DIRECTORY) != 0) ? '/' : 0; +} + +directory_type * +opendirectory(char *filename) +{ +size_t len; +char *pattern; +directory_type *dir; +DWORD err; +len = strlen(filename); +pattern = (char *) malloc(len + 3); +dir = (directory_type *) malloc(sizeof(*dir)); +if ((pattern == NULL) || (dir == NULL)) + { + fprintf(stderr, "pcregrep: malloc failed\n"); + exit(2); + } +memcpy(pattern, filename, len); +memcpy(&(pattern[len]), "\\*", 3); +dir->handle = FindFirstFile(pattern, &(dir->data)); +if (dir->handle != INVALID_HANDLE_VALUE) + { + free(pattern); + dir->first = TRUE; + return dir; + } +err = GetLastError(); +free(pattern); +free(dir); +errno = (err == ERROR_ACCESS_DENIED) ? EACCES : ENOENT; +return NULL; +} + +char * +readdirectory(directory_type *dir) +{ +for (;;) + { + if (!dir->first) + { + if (!FindNextFile(dir->handle, &(dir->data))) + return NULL; + } + else + { + dir->first = FALSE; + } + if (strcmp(dir->data.cFileName, ".") != 0 && strcmp(dir->data.cFileName, "..") != 0) + return dir->data.cFileName; + } +#ifndef _MSC_VER +return NULL; /* Keep compiler happy; never executed */ +#endif +} + +void +closedirectory(directory_type *dir) +{ +FindClose(dir->handle); +free(dir); +} + + +/************* Directory scanning when we can't do it ***********/ + +/* The type is void, and apart from isdirectory(), the functions do nothing. */ + +#else + +typedef void directory_type; + +int isdirectory(char *filename) { return FALSE; } +directory_type * opendirectory(char *filename) {} +char *readdirectory(directory_type *dir) {} +void closedirectory(directory_type *dir) {} + +#endif + + + +#if ! HAVE_STRERROR +/************************************************* +* Provide strerror() for non-ANSI libraries * +*************************************************/ + +/* Some old-fashioned systems still around (e.g. SunOS4) don't have strerror() +in their libraries, but can provide the same facility by this simple +alternative function. */ + +extern int sys_nerr; +extern char *sys_errlist[]; + +char * +strerror(int n) +{ +if (n < 0 || n >= sys_nerr) return "unknown error number"; +return sys_errlist[n]; +} +#endif /* HAVE_STRERROR */ + + + +/************************************************* +* Print the previous "after" lines * +*************************************************/ + +/* This is called if we are about to lose said lines because of buffer filling, +and at the end of the file. + +Arguments: + lastmatchnumber the number of the last matching line, plus one + lastmatchrestart where we restarted after the last match + endptr end of available data + printname filename for printing + +Returns: nothing +*/ + +static void do_after_lines(int lastmatchnumber, char *lastmatchrestart, + char *endptr, char *printname) +{ +if (after_context > 0 && lastmatchnumber > 0) + { + int count = 0; + while (lastmatchrestart < endptr && count++ < after_context) + { + char *pp = lastmatchrestart; + if (printname != NULL) fprintf(stdout, "%s-", printname); + if (number) fprintf(stdout, "%d-", lastmatchnumber++); + while (*pp != '\n') pp++; + fprintf(stdout, "%.*s", pp - lastmatchrestart + 1, lastmatchrestart); + lastmatchrestart = pp + 1; + } + hyphenpending = TRUE; + } +} + + + +/************************************************* +* Grep an individual file * +*************************************************/ + +/* This is called from grep_or_recurse() below. It uses a buffer that is three +times the value of MBUFTHIRD. The matching point is never allowed to stray into +the top third of the buffer, thus keeping more of the file available for +context printing or for multiline scanning. For large files, the pointer will +be in the middle third most of the time, so the bottom third is available for +"before" context printing. + +Arguments: + in the fopened FILE stream + printname the file name if it is to be printed for each match + or NULL if the file name is not to be printed + it cannot be NULL if filenames[_nomatch]_only is set + +Returns: 0 if there was at least one match + 1 otherwise (no matches) +*/ + +static int +pcregrep(FILE *in, char *printname) +{ +int rc = 1; +int linenumber = 1; +int lastmatchnumber = 0; +int count = 0; +int offsets[99]; +char *lastmatchrestart = NULL; +char buffer[3*MBUFTHIRD]; +char *ptr = buffer; +char *endptr; +size_t bufflength; +BOOL endhyphenpending = FALSE; + +/* Do the first read into the start of the buffer and set up the pointer to +end of what we have. */ + +bufflength = fread(buffer, 1, 3*MBUFTHIRD, in); +endptr = buffer + bufflength; + +/* Loop while the current pointer is not at the end of the file. For large +files, endptr will be at the end of the buffer when we are in the middle of the +file, but ptr will never get there, because as soon as it gets over 2/3 of the +way, the buffer is shifted left and re-filled. */ + +while (ptr < endptr) + { + int i; + BOOL match = FALSE; + char *t = ptr; + size_t length, linelength; + + /* At this point, ptr is at the start of a line. We need to find the length + of the subject string to pass to pcre_exec(). In multiline mode, it is the + length remainder of the data in the buffer. Otherwise, it is the length of + the next line. After matching, we always advance by the length of the next + line. In multiline mode the PCRE_FIRSTLINE option is used for compiling, so + that any match is constrained to be in the first line. */ + + linelength = 0; + while (t < endptr && *t++ != '\n') linelength++; + length = multiline? endptr - ptr : linelength; + + /* Run through all the patterns until one matches. Note that we don't include + the final newline in the subject string. */ + + for (i = 0; !match && i < pattern_count; i++) + { + match = pcre_exec(pattern_list[i], hints_list[i], ptr, length, 0, 0, + offsets, 99) >= 0; + } + + /* If it's a match or a not-match (as required), print what's wanted. */ + + if (match != invert) + { + BOOL hyphenprinted = FALSE; + + if (filenames_nomatch_only) return 1; + + if (count_only) count++; + + else if (filenames_only) + { + fprintf(stdout, "%s\n", printname); + return 0; + } + + else if (quiet) return 0; + + else + { + /* See if there is a requirement to print some "after" lines from a + previous match. We never print any overlaps. */ + + if (after_context > 0 && lastmatchnumber > 0) + { + int linecount = 0; + char *p = lastmatchrestart; + + while (p < ptr && linecount < after_context) + { + while (*p != '\n') p++; + p++; + linecount++; + } + + /* It is important to advance lastmatchrestart during this printing so + that it interacts correctly with any "before" printing below. */ + + while (lastmatchrestart < p) + { + char *pp = lastmatchrestart; + if (printname != NULL) fprintf(stdout, "%s-", printname); + if (number) fprintf(stdout, "%d-", lastmatchnumber++); + while (*pp != '\n') pp++; + fprintf(stdout, "%.*s", pp - lastmatchrestart + 1, lastmatchrestart); + lastmatchrestart = pp + 1; + } + if (lastmatchrestart != ptr) hyphenpending = TRUE; + } + + /* If there were non-contiguous lines printed above, insert hyphens. */ + + if (hyphenpending) + { + fprintf(stdout, "--\n"); + hyphenpending = FALSE; + hyphenprinted = TRUE; + } + + /* See if there is a requirement to print some "before" lines for this + match. Again, don't print overlaps. */ + + if (before_context > 0) + { + int linecount = 0; + char *p = ptr; + + while (p > buffer && (lastmatchnumber == 0 || p > lastmatchrestart) && + linecount++ < before_context) + { + p--; + while (p > buffer && p[-1] != '\n') p--; + } + + if (lastmatchnumber > 0 && p > lastmatchrestart && !hyphenprinted) + fprintf(stdout, "--\n"); + + while (p < ptr) + { + char *pp = p; + if (printname != NULL) fprintf(stdout, "%s-", printname); + if (number) fprintf(stdout, "%d-", linenumber - linecount--); + while (*pp != '\n') pp++; + fprintf(stdout, "%.*s", pp - p + 1, p); + p = pp + 1; + } + } + + /* Now print the matching line(s); ensure we set hyphenpending at the end + of the file if any context lines are being output. */ + + if (after_context > 0 || before_context > 0) + endhyphenpending = TRUE; + + if (printname != NULL) fprintf(stdout, "%s:", printname); + if (number) fprintf(stdout, "%d:", linenumber); + + /* In multiline mode, we want to print to the end of the line in which + the end of the matched string is found, so we adjust linelength and the + line number appropriately. Because the PCRE_FIRSTLINE option is set, the + start of the match will always be before the first \n character. */ + + if (multiline) + { + char *endmatch = ptr + offsets[1]; + t = ptr; + while (t < endmatch) { if (*t++ == '\n') linenumber++; } + while (endmatch < endptr && *endmatch != '\n') endmatch++; + linelength = endmatch - ptr; + } + + fprintf(stdout, "%.*s\n", linelength, ptr); + } + + rc = 0; /* Had some success */ + + /* Remember where the last match happened for after_context. We remember + where we are about to restart, and that line's number. */ + + lastmatchrestart = ptr + linelength + 1; + lastmatchnumber = linenumber + 1; + } + + /* Advance to after the newline and increment the line number. */ + + ptr += linelength + 1; + linenumber++; + + /* If we haven't yet reached the end of the file (the buffer is full), and + the current point is in the top 1/3 of the buffer, slide the buffer down by + 1/3 and refill it. Before we do this, if some unprinted "after" lines are + about to be lost, print them. */ + + if (bufflength >= sizeof(buffer) && ptr > buffer + 2*MBUFTHIRD) + { + if (after_context > 0 && + lastmatchnumber > 0 && + lastmatchrestart < buffer + MBUFTHIRD) + { + do_after_lines(lastmatchnumber, lastmatchrestart, endptr, printname); + lastmatchnumber = 0; + } + + /* Now do the shuffle */ + + memmove(buffer, buffer + MBUFTHIRD, 2*MBUFTHIRD); + ptr -= MBUFTHIRD; + bufflength = 2*MBUFTHIRD + fread(buffer + 2*MBUFTHIRD, 1, MBUFTHIRD, in); + endptr = buffer + bufflength; + + /* Adjust any last match point */ + + if (lastmatchnumber > 0) lastmatchrestart -= MBUFTHIRD; + } + } /* Loop through the whole file */ + +/* End of file; print final "after" lines if wanted; do_after_lines sets +hyphenpending if it prints something. */ + +do_after_lines(lastmatchnumber, lastmatchrestart, endptr, printname); +hyphenpending |= endhyphenpending; + +/* Print the file name if we are looking for those without matches and there +were none. If we found a match, we won't have got this far. */ + +if (filenames_nomatch_only) + { + fprintf(stdout, "%s\n", printname); + return 0; + } + +/* Print the match count if wanted */ + +if (count_only) + { + if (printname != NULL) fprintf(stdout, "%s:", printname); + fprintf(stdout, "%d\n", count); + } + +return rc; +} + + + +/************************************************* +* Grep a file or recurse into a directory * +*************************************************/ + +/* Given a path name, if it's a directory, scan all the files if we are +recursing; if it's a file, grep it. + +Arguments: + pathname the path to investigate + dir_recurse TRUE if recursing is wanted (-r) + show_filenames TRUE if file names are wanted for multiple files, except + for the only file at top level when not filenames_only + only_one_at_top TRUE if the path is the only one at toplevel + +Returns: 0 if there was at least one match + 1 if there were no matches + 2 there was some kind of error + +However, file opening failures are suppressed if "silent" is set. +*/ + +static int +grep_or_recurse(char *pathname, BOOL dir_recurse, BOOL show_filenames, + BOOL only_one_at_top) +{ +int rc = 1; +int sep; +FILE *in; +char *printname; + +/* If the file name is "-" we scan stdin */ + +if (strcmp(pathname, "-") == 0) + { + return pcregrep(stdin, + (filenames_only || filenames_nomatch_only || + (show_filenames && !only_one_at_top))? + stdin_name : NULL); + } + +/* If the file is a directory and we are recursing, scan each file within it, +subject to any include or exclude patterns that were set. The scanning code is +localized so it can be made system-specific. */ + +if ((sep = isdirectory(pathname)) != 0 && dir_recurse) + { + char buffer[1024]; + char *nextfile; + directory_type *dir = opendirectory(pathname); + + if (dir == NULL) + { + if (!silent) + fprintf(stderr, "pcregrep: Failed to open directory %s: %s\n", pathname, + strerror(errno)); + return 2; + } + + while ((nextfile = readdirectory(dir)) != NULL) + { + int frc, blen; + sprintf(buffer, "%.512s%c%.128s", pathname, sep, nextfile); + blen = strlen(buffer); + + if (exclude_compiled != NULL && + pcre_exec(exclude_compiled, NULL, buffer, blen, 0, 0, NULL, 0) >= 0) + continue; + + if (include_compiled != NULL && + pcre_exec(include_compiled, NULL, buffer, blen, 0, 0, NULL, 0) < 0) + continue; + + frc = grep_or_recurse(buffer, dir_recurse, TRUE, FALSE); + if (frc > 1) rc = frc; + else if (frc == 0 && rc == 1) rc = 0; + } + + closedirectory(dir); + return rc; + } + +/* If the file is not a directory, or we are not recursing, scan it. If this is +the first and only argument at top level, we don't show the file name (unless +we are only showing the file name). Otherwise, control is via the +show_filenames variable. */ + +in = fopen(pathname, "r"); +if (in == NULL) + { + if (!silent) + fprintf(stderr, "pcregrep: Failed to open %s: %s\n", pathname, + strerror(errno)); + return 2; + } + +printname = (filenames_only || filenames_nomatch_only || + (show_filenames && !only_one_at_top))? pathname : NULL; + +rc = pcregrep(in, printname); + +fclose(in); +return rc; +} + + + + +/************************************************* +* Usage function * +*************************************************/ + +static int +usage(int rc) +{ +fprintf(stderr, "Usage: pcregrep [-LMVcfhilnqrsvwx] [long-options] [pattern] [file1 file2 ...]\n"); +fprintf(stderr, "Type `pcregrep --help' for more information.\n"); +return rc; +} + + + + +/************************************************* +* Help function * +*************************************************/ + +static void +help(void) +{ +option_item *op; + +printf("Usage: pcregrep [OPTION]... [PATTERN] [FILE1 FILE2 ...]\n"); +printf("Search for PATTERN in each FILE or standard input.\n"); +printf("PATTERN must be present if -f is not used.\n"); +printf("\"-\" can be used as a file name to mean STDIN.\n"); +printf("Example: pcregrep -i 'hello.*world' menu.h main.c\n\n"); + +printf("Options:\n"); + +for (op = optionlist; op->one_char != 0; op++) + { + int n; + char s[4]; + if (op->one_char > 0) sprintf(s, "-%c,", op->one_char); else strcpy(s, " "); + printf(" %s --%s%n", s, op->long_name, &n); + n = 30 - n; + if (n < 1) n = 1; + printf("%.*s%s\n", n, " ", op->help_text); + } + +printf("\nWhen reading patterns from a file instead of using a command line option,\n"); +printf("trailing white space is removed and blank lines are ignored.\n"); +printf("There is a maximum of %d patterns.\n", MAX_PATTERN_COUNT); + +printf("\nWith no FILEs, read standard input. If fewer than two FILEs given, assume -h.\n"); +printf("Exit status is 0 if any matches, 1 if no matches, and 2 if trouble.\n"); +} + + + + +/************************************************* +* Handle a single-letter, no data option * +*************************************************/ + +static int +handle_option(int letter, int options) +{ +switch(letter) + { + case -1: help(); exit(0); + case 'c': count_only = TRUE; break; + case 'h': filenames = FALSE; break; + case 'i': options |= PCRE_CASELESS; break; + case 'l': filenames_only = TRUE; break; + case 'L': filenames_nomatch_only = TRUE; break; + case 'M': multiline = TRUE; options |= PCRE_MULTILINE|PCRE_FIRSTLINE; break; + case 'n': number = TRUE; break; + case 'q': quiet = TRUE; break; + case 'r': recurse = TRUE; break; + case 's': silent = TRUE; break; + case 'u': options |= PCRE_UTF8; break; + case 'v': invert = TRUE; break; + case 'w': word_match = TRUE; break; + case 'x': whole_lines = TRUE; break; + + case 'V': + fprintf(stderr, "pcregrep version %s using ", VERSION); + fprintf(stderr, "PCRE version %s\n", pcre_version()); + exit(0); + break; + + default: + fprintf(stderr, "pcregrep: Unknown option -%c\n", letter); + exit(usage(2)); + } + +return options; +} + + + + +/************************************************* +* Main program * +*************************************************/ + +/* Returns 0 if something matched, 1 if nothing matched, 2 after an error. */ + +int +main(int argc, char **argv) +{ +int i, j; +int rc = 1; +int options = 0; +int errptr; +const char *error; +BOOL only_one_at_top; + +/* Process the options */ + +for (i = 1; i < argc; i++) + { + option_item *op = NULL; + char *option_data = (char *)""; /* default to keep compiler happy */ + BOOL longop; + BOOL longopwasequals = FALSE; + + if (argv[i][0] != '-') break; + + /* If we hit an argument that is just "-", it may be a reference to STDIN, + but only if we have previously had -f to define the patterns. */ + + if (argv[i][1] == 0) + { + if (pattern_filename != NULL) break; + else exit(usage(2)); + } + + /* Handle a long name option, or -- to terminate the options */ + + if (argv[i][1] == '-') + { + char *arg = argv[i] + 2; + char *argequals = strchr(arg, '='); + + if (*arg == 0) /* -- terminates options */ + { + i++; + break; /* out of the options-handling loop */ + } + + longop = TRUE; + + /* Some long options have data that follows after =, for example file=name. + Some options have variations in the long name spelling: specifically, we + allow "regexp" because GNU grep allows it, though I personally go along + with Jeff Friedl in preferring "regex" without the "p". These options are + entered in the table as "regex(p)". No option is in both these categories, + fortunately. */ + + for (op = optionlist; op->one_char != 0; op++) + { + char *opbra = strchr(op->long_name, '('); + char *equals = strchr(op->long_name, '='); + if (opbra == NULL) /* Not a (p) case */ + { + if (equals == NULL) /* Not thing=data case */ + { + if (strcmp(arg, op->long_name) == 0) break; + } + else /* Special case xxx=data */ + { + int oplen = equals - op->long_name; + int arglen = (argequals == NULL)? strlen(arg) : argequals - arg; + if (oplen == arglen && strncmp(arg, op->long_name, oplen) == 0) + { + option_data = arg + arglen; + if (*option_data == '=') + { + option_data++; + longopwasequals = TRUE; + } + break; + } + } + } + else /* Special case xxxx(p) */ + { + char buff1[24]; + char buff2[24]; + int baselen = opbra - op->long_name; + sprintf(buff1, "%.*s", baselen, op->long_name); + sprintf(buff2, "%s%.*s", buff1, strlen(op->long_name) - baselen - 2, + opbra + 1); + if (strcmp(arg, buff1) == 0 || strcmp(arg, buff2) == 0) + break; + } + } + + if (op->one_char == 0) + { + fprintf(stderr, "pcregrep: Unknown option %s\n", argv[i]); + exit(usage(2)); + } + } + + /* One-char options; many that have no data may be in a single argument; we + continue till we hit the last one or one that needs data. */ + + else + { + char *s = argv[i] + 1; + longop = FALSE; + while (*s != 0) + { + for (op = optionlist; op->one_char != 0; op++) + { if (*s == op->one_char) break; } + if (op->one_char == 0) + { + fprintf(stderr, "pcregrep: Unknown option letter '%c' in \"%s\"\n", + *s, argv[i]); + exit(usage(2)); + } + if (op->type != OP_NODATA || s[1] == 0) + { + option_data = s+1; + break; + } + options = handle_option(*s++, options); + } + } + + /* At this point we should have op pointing to a matched option */ + + if (op->type == OP_NODATA) + options = handle_option(op->one_char, options); + else + { + if (*option_data == 0) + { + if (i >= argc - 1 || longopwasequals) + { + fprintf(stderr, "pcregrep: Data missing after %s\n", argv[i]); + exit(usage(2)); + } + option_data = argv[++i]; + } + + if (op->type == OP_STRING) *((char **)op->dataptr) = option_data; else + { + char *endptr; + int n = strtoul(option_data, &endptr, 10); + if (*endptr != 0) + { + if (longop) + fprintf(stderr, "pcregrep: Malformed number \"%s\" after --%s\n", + option_data, op->long_name); + else + fprintf(stderr, "pcregrep: Malformed number \"%s\" after -%c\n", + option_data, op->one_char); + exit(usage(2)); + } + *((int *)op->dataptr) = n; + } + } + } + +/* Options have been decoded. If -C was used, its value is used as a default +for -A and -B. */ + +if (both_context > 0) + { + if (after_context == 0) after_context = both_context; + if (before_context == 0) before_context = both_context; + } + +pattern_list = (pcre **)malloc(MAX_PATTERN_COUNT * sizeof(pcre *)); +hints_list = (pcre_extra **)malloc(MAX_PATTERN_COUNT * sizeof(pcre_extra *)); + +if (pattern_list == NULL || hints_list == NULL) + { + fprintf(stderr, "pcregrep: malloc failed\n"); + return 2; + } + +/* Compile the regular expression(s). */ + +if (pattern_filename != NULL) + { + FILE *f = fopen(pattern_filename, "r"); + char buffer[MBUFTHIRD + 16]; + char *rdstart; + int adjust = 0; + + if (f == NULL) + { + fprintf(stderr, "pcregrep: Failed to open %s: %s\n", pattern_filename, + strerror(errno)); + return 2; + } + + if (whole_lines) + { + strcpy(buffer, "^(?:"); + adjust = 4; + } + else if (word_match) + { + strcpy(buffer, "\\b"); + adjust = 2; + } + + rdstart = buffer + adjust; + while (fgets(rdstart, MBUFTHIRD, f) != NULL) + { + char *s = rdstart + (int)strlen(rdstart); + if (pattern_count >= MAX_PATTERN_COUNT) + { + fprintf(stderr, "pcregrep: Too many patterns in file (max %d)\n", + MAX_PATTERN_COUNT); + return 2; + } + while (s > rdstart && isspace((unsigned char)(s[-1]))) s--; + if (s == rdstart) continue; + if (whole_lines) strcpy(s, ")$"); + else if (word_match)strcpy(s, "\\b"); + else *s = 0; + pattern_list[pattern_count] = pcre_compile(buffer, options, &error, + &errptr, NULL); + if (pattern_list[pattern_count++] == NULL) + { + fprintf(stderr, "pcregrep: Error in regex number %d at offset %d: %s\n", + pattern_count, errptr - adjust, error); + return 2; + } + } + fclose(f); + } + +/* If no file name, a single regex must be given inline. */ + +else + { + char buffer[MBUFTHIRD + 16]; + char *pat; + int adjust = 0; + + if (i >= argc) return usage(2); + + if (whole_lines) + { + sprintf(buffer, "^(?:%.*s)$", MBUFTHIRD, argv[i++]); + pat = buffer; + adjust = 4; + } + else if (word_match) + { + sprintf(buffer, "\\b%.*s\\b", MBUFTHIRD, argv[i++]); + pat = buffer; + adjust = 2; + } + else pat = argv[i++]; + + pattern_list[0] = pcre_compile(pat, options, &error, &errptr, NULL); + + if (pattern_list[0] == NULL) + { + fprintf(stderr, "pcregrep: Error in regex at offset %d: %s\n", + errptr - adjust, error); + return 2; + } + pattern_count++; + } + +/* Study the regular expressions, as we will be running them many times */ + +for (j = 0; j < pattern_count; j++) + { + hints_list[j] = pcre_study(pattern_list[j], 0, &error); + if (error != NULL) + { + char s[16]; + if (pattern_count == 1) s[0] = 0; else sprintf(s, " number %d", j); + fprintf(stderr, "pcregrep: Error while studying regex%s: %s\n", s, error); + return 2; + } + } + +/* If there are include or exclude patterns, compile them. */ + +if (exclude_pattern != NULL) + { + exclude_compiled = pcre_compile(exclude_pattern, 0, &error, &errptr, NULL); + if (exclude_compiled == NULL) + { + fprintf(stderr, "pcregrep: Error in 'exclude' regex at offset %d: %s\n", + errptr, error); + return 2; + } + } + +if (include_pattern != NULL) + { + include_compiled = pcre_compile(include_pattern, 0, &error, &errptr, NULL); + if (include_compiled == NULL) + { + fprintf(stderr, "pcregrep: Error in 'include' regex at offset %d: %s\n", + errptr, error); + return 2; + } + } + +/* If there are no further arguments, do the business on stdin and exit */ + +if (i >= argc) return pcregrep(stdin, + (filenames_only || filenames_nomatch_only)? stdin_name : NULL); + +/* Otherwise, work through the remaining arguments as files or directories. +Pass in the fact that there is only one argument at top level - this suppresses +the file name if the argument is not a directory and filenames_only is not set. +*/ + +only_one_at_top = (i == argc - 1); + +for (; i < argc; i++) + { + int frc = grep_or_recurse(argv[i], recurse, filenames, only_one_at_top); + if (frc > 1) rc = frc; + else if (frc == 0 && rc == 1) rc = 0; + } + +return rc; +} + +/* End of pcregrep */ diff --git a/mozilla/js/tamarin/pcre/pcreposix.cpp b/mozilla/js/tamarin/pcre/pcreposix.cpp new file mode 100644 index 00000000000..c8f25ad3a54 --- /dev/null +++ b/mozilla/js/tamarin/pcre/pcreposix.cpp @@ -0,0 +1,294 @@ +/************************************************* +* Perl-Compatible Regular Expressions * +*************************************************/ + +/* PCRE is a library of functions to support regular expressions whose syntax +and semantics are as close as possible to those of the Perl 5 language. + + Written by Philip Hazel + Copyright (c) 1997-2005 University of Cambridge + +----------------------------------------------------------------------------- +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + * Neither the name of the University of Cambridge nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +----------------------------------------------------------------------------- +*/ + + +/* This module is a wrapper that provides a POSIX API to the underlying PCRE +functions. */ + + +#include "pcre_internal.h" +#include "pcreposix.h" +#include "stdlib.h" + + + +/* Table to translate PCRE compile time error codes into POSIX error codes. */ + +static const int eint[] = { + 0, /* no error */ + REG_EESCAPE, /* \ at end of pattern */ + REG_EESCAPE, /* \c at end of pattern */ + REG_EESCAPE, /* unrecognized character follows \ */ + REG_BADBR, /* numbers out of order in {} quantifier */ + REG_BADBR, /* number too big in {} quantifier */ + REG_EBRACK, /* missing terminating ] for character class */ + REG_ECTYPE, /* invalid escape sequence in character class */ + REG_ERANGE, /* range out of order in character class */ + REG_BADRPT, /* nothing to repeat */ + REG_BADRPT, /* operand of unlimited repeat could match the empty string */ + REG_ASSERT, /* internal error: unexpected repeat */ + REG_BADPAT, /* unrecognized character after (? */ + REG_BADPAT, /* POSIX named classes are supported only within a class */ + REG_EPAREN, /* missing ) */ + REG_ESUBREG, /* reference to non-existent subpattern */ + REG_INVARG, /* erroffset passed as NULL */ + REG_INVARG, /* unknown option bit(s) set */ + REG_EPAREN, /* missing ) after comment */ + REG_ESIZE, /* parentheses nested too deeply */ + REG_ESIZE, /* regular expression too large */ + REG_ESPACE, /* failed to get memory */ + REG_EPAREN, /* unmatched brackets */ + REG_ASSERT, /* internal error: code overflow */ + REG_BADPAT, /* unrecognized character after (?< */ + REG_BADPAT, /* lookbehind assertion is not fixed length */ + REG_BADPAT, /* malformed number after (?( */ + REG_BADPAT, /* conditional group containe more than two branches */ + REG_BADPAT, /* assertion expected after (?( */ + REG_BADPAT, /* (?R or (?digits must be followed by ) */ + REG_ECTYPE, /* unknown POSIX class name */ + REG_BADPAT, /* POSIX collating elements are not supported */ + REG_INVARG, /* this version of PCRE is not compiled with PCRE_UTF8 support */ + REG_BADPAT, /* spare error */ + REG_BADPAT, /* character value in \x{...} sequence is too large */ + REG_BADPAT, /* invalid condition (?(0) */ + REG_BADPAT, /* \C not allowed in lookbehind assertion */ + REG_EESCAPE, /* PCRE does not support \L, \l, \N, \U, or \u */ + REG_BADPAT, /* number after (?C is > 255 */ + REG_BADPAT, /* closing ) for (?C expected */ + REG_BADPAT, /* recursive call could loop indefinitely */ + REG_BADPAT, /* unrecognized character after (?P */ + REG_BADPAT, /* syntax error after (?P */ + REG_BADPAT, /* two named groups have the same name */ + REG_BADPAT, /* invalid UTF-8 string */ + REG_BADPAT, /* support for \P, \p, and \X has not been compiled */ + REG_BADPAT, /* malformed \P or \p sequence */ + REG_BADPAT /* unknown property name after \P or \p */ +}; + +/* Table of texts corresponding to POSIX error codes */ + +static const char *const pstring[] = { + "", /* Dummy for value 0 */ + "internal error", /* REG_ASSERT */ + "invalid repeat counts in {}", /* BADBR */ + "pattern error", /* BADPAT */ + "? * + invalid", /* BADRPT */ + "unbalanced {}", /* EBRACE */ + "unbalanced []", /* EBRACK */ + "collation error - not relevant", /* ECOLLATE */ + "bad class", /* ECTYPE */ + "bad escape sequence", /* EESCAPE */ + "empty expression", /* EMPTY */ + "unbalanced ()", /* EPAREN */ + "bad range inside []", /* ERANGE */ + "expression too big", /* ESIZE */ + "failed to get memory", /* ESPACE */ + "bad back reference", /* ESUBREG */ + "bad argument", /* INVARG */ + "match failed" /* NOMATCH */ +}; + + + + +/************************************************* +* Translate error code to string * +*************************************************/ + +PCRE_EXPORT size_t +regerror(int errcode, const regex_t *preg, char *errbuf, size_t errbuf_size) +{ +const char *message, *addmessage; +size_t length, addlength; + +message = (errcode >= (int)(sizeof(pstring)/sizeof(char *)))? + "unknown error code" : pstring[errcode]; +length = strlen(message) + 1; + +addmessage = " at offset "; +addlength = (preg != NULL && (int)preg->re_erroffset != -1)? + strlen(addmessage) + 6 : 0; + +if (errbuf_size > 0) + { + if (addlength > 0 && errbuf_size >= length + addlength) + sprintf(errbuf, "%s%s%-6d", message, addmessage, (int)preg->re_erroffset); + else + { + strncpy(errbuf, message, errbuf_size - 1); + errbuf[errbuf_size-1] = 0; + } + } + +return length + addlength; +} + + + + +/************************************************* +* Free store held by a regex * +*************************************************/ + +PCRE_EXPORT void +regfree(regex_t *preg) +{ +(pcre_free)(preg->re_pcre); +} + + + + +/************************************************* +* Compile a regular expression * +*************************************************/ + +/* +Arguments: + preg points to a structure for recording the compiled expression + pattern the pattern to compile + cflags compilation flags + +Returns: 0 on success + various non-zero codes on failure +*/ + +PCRE_EXPORT int +regcomp(regex_t *preg, const char *pattern, int cflags) +{ +const char *errorptr; +int erroffset; +int errorcode; +int options = 0; + +if ((cflags & REG_ICASE) != 0) options |= PCRE_CASELESS; +if ((cflags & REG_NEWLINE) != 0) options |= PCRE_MULTILINE; +if ((cflags & REG_DOTALL) != 0) options |= PCRE_DOTALL; + +preg->re_pcre = pcre_compile2(pattern, options, &errorcode, &errorptr, + &erroffset, NULL); +preg->re_erroffset = erroffset; + +if (preg->re_pcre == NULL) return eint[errorcode]; + +preg->re_nsub = pcre_info((const pcre *)preg->re_pcre, NULL, NULL); +return 0; +} + + + + +/************************************************* +* Match a regular expression * +*************************************************/ + +/* Unfortunately, PCRE requires 3 ints of working space for each captured +substring, so we have to get and release working store instead of just using +the POSIX structures as was done in earlier releases when PCRE needed only 2 +ints. However, if the number of possible capturing brackets is small, use a +block of store on the stack, to reduce the use of malloc/free. The threshold is +in a macro that can be changed at configure time. */ + +PCRE_EXPORT int +regexec(const regex_t *preg, const char *string, size_t nmatch, + regmatch_t pmatch[], int eflags) +{ +int rc; +int options = 0; +int *ovector = NULL; +int small_ovector[POSIX_MALLOC_THRESHOLD * 3]; +BOOL allocated_ovector = FALSE; + +if ((eflags & REG_NOTBOL) != 0) options |= PCRE_NOTBOL; +if ((eflags & REG_NOTEOL) != 0) options |= PCRE_NOTEOL; + +((regex_t *)preg)->re_erroffset = (size_t)(-1); /* Only has meaning after compile */ + +if (nmatch > 0) + { + if (nmatch <= POSIX_MALLOC_THRESHOLD) + { + ovector = &(small_ovector[0]); + } + else + { + ovector = (int *)malloc(sizeof(int) * nmatch * 3); + if (ovector == NULL) return REG_ESPACE; + allocated_ovector = TRUE; + } + } + +rc = pcre_exec((const pcre *)preg->re_pcre, NULL, string, (int)strlen(string), + 0, options, ovector, nmatch * 3); + +if (rc == 0) rc = nmatch; /* All captured slots were filled in */ + +if (rc >= 0) + { + size_t i; + for (i = 0; i < (size_t)rc; i++) + { + pmatch[i].rm_so = ovector[i*2]; + pmatch[i].rm_eo = ovector[i*2+1]; + } + if (allocated_ovector) free(ovector); + for (; i < nmatch; i++) pmatch[i].rm_so = pmatch[i].rm_eo = -1; + return 0; + } + +else + { + if (allocated_ovector) free(ovector); + switch(rc) + { + case PCRE_ERROR_NOMATCH: return REG_NOMATCH; + case PCRE_ERROR_NULL: return REG_INVARG; + case PCRE_ERROR_BADOPTION: return REG_INVARG; + case PCRE_ERROR_BADMAGIC: return REG_INVARG; + case PCRE_ERROR_UNKNOWN_NODE: return REG_ASSERT; + case PCRE_ERROR_NOMEMORY: return REG_ESPACE; + case PCRE_ERROR_MATCHLIMIT: return REG_ESPACE; + case PCRE_ERROR_BADUTF8: return REG_INVARG; + case PCRE_ERROR_BADUTF8_OFFSET: return REG_INVARG; + default: return REG_ASSERT; + } + } +} + +/* End of pcreposix.c */ diff --git a/mozilla/js/tamarin/pcre/pcreposix.h b/mozilla/js/tamarin/pcre/pcreposix.h new file mode 100644 index 00000000000..4f1b1abd451 --- /dev/null +++ b/mozilla/js/tamarin/pcre/pcreposix.h @@ -0,0 +1,121 @@ +/************************************************* +* Perl-Compatible Regular Expressions * +*************************************************/ + +#ifndef _PCREPOSIX_H +#define _PCREPOSIX_H + +/* This is the header for the POSIX wrapper interface to the PCRE Perl- +Compatible Regular Expression library. It defines the things POSIX says should +be there. I hope. + + Copyright (c) 1997-2005 University of Cambridge + +----------------------------------------------------------------------------- +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + * Neither the name of the University of Cambridge nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +----------------------------------------------------------------------------- +*/ + +/* Have to include stdlib.h in order to ensure that size_t is defined. */ + +#include + +/* Allow for C++ users */ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Options defined by POSIX. */ + +#define REG_ICASE 0x01 +#define REG_NEWLINE 0x02 +#define REG_NOTBOL 0x04 +#define REG_NOTEOL 0x08 + +/* Additional options, not defined by POSIX, but somebody wanted them. */ + +#define REG_DOTALL 0x10 + +/* These are not used by PCRE, but by defining them we make it easier +to slot PCRE into existing programs that make POSIX calls. */ + +#define REG_EXTENDED 0 +#define REG_NOSUB 0 + +/* Error values. Not all these are relevant or used by the wrapper. */ + +enum { + REG_ASSERT = 1, /* internal error ? */ + REG_BADBR, /* invalid repeat counts in {} */ + REG_BADPAT, /* pattern error */ + REG_BADRPT, /* ? * + invalid */ + REG_EBRACE, /* unbalanced {} */ + REG_EBRACK, /* unbalanced [] */ + REG_ECOLLATE, /* collation error - not relevant */ + REG_ECTYPE, /* bad class */ + REG_EESCAPE, /* bad escape sequence */ + REG_EMPTY, /* empty expression */ + REG_EPAREN, /* unbalanced () */ + REG_ERANGE, /* bad range inside [] */ + REG_ESIZE, /* expression too big */ + REG_ESPACE, /* failed to get memory */ + REG_ESUBREG, /* bad back reference */ + REG_INVARG, /* bad argument */ + REG_NOMATCH /* match failed */ +}; + + +/* The structure representing a compiled regular expression. */ + +typedef struct { + void *re_pcre; + size_t re_nsub; + size_t re_erroffset; +} regex_t; + +/* The structure in which a captured offset is returned. */ + +typedef int regoff_t; + +typedef struct { + regoff_t rm_so; + regoff_t rm_eo; +} regmatch_t; + +/* The functions */ + +extern int regcomp(regex_t *, const char *, int); +extern int regexec(const regex_t *, const char *, size_t, regmatch_t *, int); +extern size_t regerror(int, const regex_t *, char *, size_t); +extern void regfree(regex_t *); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* End of pcreposix.h */ diff --git a/mozilla/js/tamarin/pcre/pcretest.cpp b/mozilla/js/tamarin/pcre/pcretest.cpp new file mode 100644 index 00000000000..4a7c1fd060c --- /dev/null +++ b/mozilla/js/tamarin/pcre/pcretest.cpp @@ -0,0 +1,1898 @@ +/************************************************* +* PCRE testing program * +*************************************************/ + +/* This program was hacked up as a tester for PCRE. I really should have +written it more tidily in the first place. Will I ever learn? It has grown and +been extended and consequently is now rather, er, *very* untidy in places. + +----------------------------------------------------------------------------- +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + * Neither the name of the University of Cambridge nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +----------------------------------------------------------------------------- +*/ + + +#include +#include +#include +#include +#include +#include +#include + +#define PCRE_SPY /* For Win32 build, import data, not export */ + +/* We include pcre_internal.h because we need the internal info for displaying +the results of pcre_study() and we also need to know about the internal +macros, structures, and other internal data values; pcretest has "inside +information" compared to a program that strictly follows the PCRE API. */ + +#include "pcre_internal.h" + +/* We need access to the data tables that PCRE uses. So as not to have to keep +two copies, we include the source file here, changing the names of the external +symbols to prevent clashes. */ + +#define _pcre_utf8_table1 utf8_table1 +#define _pcre_utf8_table1_size utf8_table1_size +#define _pcre_utf8_table2 utf8_table2 +#define _pcre_utf8_table3 utf8_table3 +#define _pcre_utf8_table4 utf8_table4 +#define _pcre_utt utt +#define _pcre_utt_size utt_size +#define _pcre_OP_lengths OP_lengths + +#include "pcre_tables.c" + +/* We also need the pcre_printint() function for printing out compiled +patterns. This function is in a separate file so that it can be included in +pcre_compile.c when that module is compiled with debugging enabled. */ + +#include "pcre_printint.src" + + +/* It is possible to compile this test program without including support for +testing the POSIX interface, though this is not available via the standard +Makefile. */ + +#if !defined NOPOSIX +#include "pcreposix.h" +#endif + +/* It is also possible, for the benefit of the version imported into Exim, to +build pcretest without support for UTF8 (define NOUTF8), without the interface +to the DFA matcher (NODFA), and without the doublecheck of the old "info" +function (define NOINFOCHECK). */ + + +/* Other parameters */ + +#ifndef CLOCKS_PER_SEC +#ifdef CLK_TCK +#define CLOCKS_PER_SEC CLK_TCK +#else +#define CLOCKS_PER_SEC 100 +#endif +#endif + +#define LOOPREPEAT 500000 + +#define BUFFER_SIZE 30000 +#define PBUFFER_SIZE BUFFER_SIZE +#define DBUFFER_SIZE BUFFER_SIZE + + +/* Static variables */ + +static FILE *outfile; +static int log_store = 0; +static int callout_count; +static int callout_extra; +static int callout_fail_count; +static int callout_fail_id; +static int first_callout; +static int show_malloc; +static int use_utf8; +static size_t gotten_store; + +static uschar *pbuffer = NULL; + + + +/************************************************* +* Read number from string * +*************************************************/ + +/* We don't use strtoul() because SunOS4 doesn't have it. Rather than mess +around with conditional compilation, just do the job by hand. It is only used +for unpicking the -o argument, so just keep it simple. + +Arguments: + str string to be converted + endptr where to put the end pointer + +Returns: the unsigned long +*/ + +static int +get_value(unsigned char *str, unsigned char **endptr) +{ +int result = 0; +while(*str != 0 && isspace(*str)) str++; +while (isdigit(*str)) result = result * 10 + (int)(*str++ - '0'); +*endptr = str; +return(result); +} + + + + +/************************************************* +* Convert UTF-8 string to value * +*************************************************/ + +/* This function takes one or more bytes that represents a UTF-8 character, +and returns the value of the character. + +Argument: + buffer a pointer to the byte vector + vptr a pointer to an int to receive the value + +Returns: > 0 => the number of bytes consumed + -6 to 0 => malformed UTF-8 character at offset = (-return) +*/ + +#if !defined NOUTF8 + +static int +utf82ord(unsigned char *buffer, int *vptr) +{ +int c = *buffer++; +int d = c; +int i, j, s; + +for (i = -1; i < 6; i++) /* i is number of additional bytes */ + { + if ((d & 0x80) == 0) break; + d <<= 1; + } + +if (i == -1) { *vptr = c; return 1; } /* ascii character */ +if (i == 0 || i == 6) return 0; /* invalid UTF-8 */ + +/* i now has a value in the range 1-5 */ + +s = 6*i; +d = (c & utf8_table3[i]) << s; + +for (j = 0; j < i; j++) + { + c = *buffer++; + if ((c & 0xc0) != 0x80) return -(j+1); + s -= 6; + d |= (c & 0x3f) << s; + } + +/* Check that encoding was the correct unique one */ + +for (j = 0; j < utf8_table1_size; j++) + if (d <= utf8_table1[j]) break; +if (j != i) return -(i+1); + +/* Valid value */ + +*vptr = d; +return i+1; +} + +#endif + + + +/************************************************* +* Convert character value to UTF-8 * +*************************************************/ + +/* This function takes an integer value in the range 0 - 0x7fffffff +and encodes it as a UTF-8 character in 0 to 6 bytes. + +Arguments: + cvalue the character value + buffer pointer to buffer for result - at least 6 bytes long + +Returns: number of characters placed in the buffer +*/ + +static int +ord2utf8(int cvalue, uschar *buffer) +{ +register int i, j; +for (i = 0; i < utf8_table1_size; i++) + if (cvalue <= utf8_table1[i]) break; +buffer += i; +for (j = i; j > 0; j--) + { + *buffer-- = 0x80 | (cvalue & 0x3f); + cvalue >>= 6; + } +*buffer = utf8_table2[i] | cvalue; +return i + 1; +} + + + +/************************************************* +* Print character string * +*************************************************/ + +/* Character string printing function. Must handle UTF-8 strings in utf8 +mode. Yields number of characters printed. If handed a NULL file, just counts +chars without printing. */ + +static int pchars(unsigned char *p, int length, FILE *f) +{ +int c = 0; +int yield = 0; + +while (length-- > 0) + { +#if !defined NOUTF8 + if (use_utf8) + { + int rc = utf82ord(p, &c); + + if (rc > 0 && rc <= length + 1) /* Mustn't run over the end */ + { + length -= rc - 1; + p += rc; + if (c < 256 && isprint(c)) + { + if (f != NULL) fprintf(f, "%c", c); + yield++; + } + else + { + int n; + if (f != NULL) fprintf(f, "\\x{%02x}%n", c, &n); + yield += n; + } + continue; + } + } +#endif + + /* Not UTF-8, or malformed UTF-8 */ + + if (isprint(c = *(p++))) + { + if (f != NULL) fprintf(f, "%c", c); + yield++; + } + else + { + if (f != NULL) fprintf(f, "\\x%02x", c); + yield += 4; + } + } + +return yield; +} + + + +/************************************************* +* Callout function * +*************************************************/ + +/* Called from PCRE as a result of the (?C) item. We print out where we are in +the match. Yield zero unless more callouts than the fail count, or the callout +data is not zero. */ + +static int callout(pcre_callout_block *cb) +{ +FILE *f = (first_callout | callout_extra)? outfile : NULL; +int i, pre_start, post_start, subject_length; + +if (callout_extra) + { + fprintf(f, "Callout %d: last capture = %d\n", + cb->callout_number, cb->capture_last); + + for (i = 0; i < cb->capture_top * 2; i += 2) + { + if (cb->offset_vector[i] < 0) + fprintf(f, "%2d: \n", i/2); + else + { + fprintf(f, "%2d: ", i/2); + (void)pchars((unsigned char *)cb->subject + cb->offset_vector[i], + cb->offset_vector[i+1] - cb->offset_vector[i], f); + fprintf(f, "\n"); + } + } + } + +/* Re-print the subject in canonical form, the first time or if giving full +datails. On subsequent calls in the same match, we use pchars just to find the +printed lengths of the substrings. */ + +if (f != NULL) fprintf(f, "--->"); + +pre_start = pchars((unsigned char *)cb->subject, cb->start_match, f); +post_start = pchars((unsigned char *)(cb->subject + cb->start_match), + cb->current_position - cb->start_match, f); + +subject_length = pchars((unsigned char *)cb->subject, cb->subject_length, NULL); + +(void)pchars((unsigned char *)(cb->subject + cb->current_position), + cb->subject_length - cb->current_position, f); + +if (f != NULL) fprintf(f, "\n"); + +/* Always print appropriate indicators, with callout number if not already +shown. For automatic callouts, show the pattern offset. */ + +if (cb->callout_number == 255) + { + fprintf(outfile, "%+3d ", cb->pattern_position); + if (cb->pattern_position > 99) fprintf(outfile, "\n "); + } +else + { + if (callout_extra) fprintf(outfile, " "); + else fprintf(outfile, "%3d ", cb->callout_number); + } + +for (i = 0; i < pre_start; i++) fprintf(outfile, " "); +fprintf(outfile, "^"); + +if (post_start > 0) + { + for (i = 0; i < post_start - 1; i++) fprintf(outfile, " "); + fprintf(outfile, "^"); + } + +for (i = 0; i < subject_length - pre_start - post_start + 4; i++) + fprintf(outfile, " "); + +fprintf(outfile, "%.*s", (cb->next_item_length == 0)? 1 : cb->next_item_length, + pbuffer + cb->pattern_position); + +fprintf(outfile, "\n"); +first_callout = 0; + +if (cb->callout_data != NULL) + { + int callout_data = *((int *)(cb->callout_data)); + if (callout_data != 0) + { + fprintf(outfile, "Callout data = %d\n", callout_data); + return callout_data; + } + } + +return (cb->callout_number != callout_fail_id)? 0 : + (++callout_count >= callout_fail_count)? 1 : 0; +} + + +/************************************************* +* Local malloc functions * +*************************************************/ + +/* Alternative malloc function, to test functionality and show the size of the +compiled re. */ + +static void *new_malloc(size_t size) +{ +void *block = malloc(size); +gotten_store = size; +if (show_malloc) + fprintf(outfile, "malloc %3d %p\n", (int)size, block); +return block; +} + +static void new_free(void *block) +{ +if (show_malloc) + fprintf(outfile, "free %p\n", block); +free(block); +} + + +/* For recursion malloc/free, to test stacking calls */ + +static void *stack_malloc(size_t size) +{ +void *block = malloc(size); +if (show_malloc) + fprintf(outfile, "stack_malloc %3d %p\n", (int)size, block); +return block; +} + +static void stack_free(void *block) +{ +if (show_malloc) + fprintf(outfile, "stack_free %p\n", block); +free(block); +} + + +/************************************************* +* Call pcre_fullinfo() * +*************************************************/ + +/* Get one piece of information from the pcre_fullinfo() function */ + +static void new_info(pcre *re, pcre_extra *study, int option, void *ptr) +{ +int rc; +if ((rc = pcre_fullinfo(re, study, option, ptr)) < 0) + fprintf(outfile, "Error %d from pcre_fullinfo(%d)\n", rc, option); +} + + + +/************************************************* +* Byte flipping function * +*************************************************/ + +static long int +byteflip(long int value, int n) +{ +if (n == 2) return ((value & 0x00ff) << 8) | ((value & 0xff00) >> 8); +return ((value & 0x000000ff) << 24) | + ((value & 0x0000ff00) << 8) | + ((value & 0x00ff0000) >> 8) | + ((value & 0xff000000) >> 24); +} + + + + +/************************************************* +* Main Program * +*************************************************/ + +/* Read lines from named file or stdin and write to named file or stdout; lines +consist of a regular expression, in delimiters and optionally followed by +options, followed by a set of test data, terminated by an empty line. */ + +int main(int argc, char **argv) +{ +FILE *infile = stdin; +int options = 0; +int study_options = 0; +int op = 1; +int timeit = 0; +int showinfo = 0; +int showstore = 0; +int size_offsets = 45; +int size_offsets_max; +int *offsets = NULL; +#if !defined NOPOSIX +int posix = 0; +#endif +int debug = 0; +int done = 0; +int all_use_dfa = 0; +int yield = 0; + +unsigned char *buffer; +unsigned char *dbuffer; + +/* Get buffers from malloc() so that Electric Fence will check their misuse +when I am debugging. */ + +buffer = (unsigned char *)malloc(BUFFER_SIZE); +dbuffer = (unsigned char *)malloc(DBUFFER_SIZE); +pbuffer = (unsigned char *)malloc(PBUFFER_SIZE); + +/* The outfile variable is static so that new_malloc can use it. The _setmode() +stuff is some magic that I don't understand, but which apparently does good +things in Windows. It's related to line terminations. */ + +#if defined(_WIN32) || defined(WIN32) +_setmode( _fileno( stdout ), 0x8000 ); +#endif /* defined(_WIN32) || defined(WIN32) */ + +outfile = stdout; + +/* Scan options */ + +while (argc > 1 && argv[op][0] == '-') + { + unsigned char *endptr; + + if (strcmp(argv[op], "-s") == 0 || strcmp(argv[op], "-m") == 0) + showstore = 1; + else if (strcmp(argv[op], "-t") == 0) timeit = 1; + else if (strcmp(argv[op], "-i") == 0) showinfo = 1; + else if (strcmp(argv[op], "-d") == 0) showinfo = debug = 1; +#if !defined NODFA + else if (strcmp(argv[op], "-dfa") == 0) all_use_dfa = 1; +#endif + else if (strcmp(argv[op], "-o") == 0 && argc > 2 && + ((size_offsets = get_value((unsigned char *)argv[op+1], &endptr)), + *endptr == 0)) + { + op++; + argc--; + } +#if !defined NOPOSIX + else if (strcmp(argv[op], "-p") == 0) posix = 1; +#endif + else if (strcmp(argv[op], "-C") == 0) + { + int rc; + printf("PCRE version %s\n", pcre_version()); + printf("Compiled with\n"); + (void)pcre_config(PCRE_CONFIG_UTF8, &rc); + printf(" %sUTF-8 support\n", rc? "" : "No "); + (void)pcre_config(PCRE_CONFIG_UNICODE_PROPERTIES, &rc); + printf(" %sUnicode properties support\n", rc? "" : "No "); + (void)pcre_config(PCRE_CONFIG_NEWLINE, &rc); + printf(" Newline character is %s\n", (rc == '\r')? "CR" : "LF"); + (void)pcre_config(PCRE_CONFIG_LINK_SIZE, &rc); + printf(" Internal link size = %d\n", rc); + (void)pcre_config(PCRE_CONFIG_POSIX_MALLOC_THRESHOLD, &rc); + printf(" POSIX malloc threshold = %d\n", rc); + (void)pcre_config(PCRE_CONFIG_MATCH_LIMIT, &rc); + printf(" Default match limit = %d\n", rc); + (void)pcre_config(PCRE_CONFIG_STACKRECURSE, &rc); + printf(" Match recursion uses %s\n", rc? "stack" : "heap"); + exit(0); + } + else + { + printf("** Unknown or malformed option %s\n", argv[op]); + printf("Usage: pcretest [-d] [-i] [-o ] [-p] [-s] [-t] [ []]\n"); + printf(" -C show PCRE compile-time options and exit\n"); + printf(" -d debug: show compiled code; implies -i\n"); +#if !defined NODFA + printf(" -dfa force DFA matching for all subjects\n"); +#endif + printf(" -i show information about compiled pattern\n" + " -m output memory used information\n" + " -o set size of offsets vector to \n"); +#if !defined NOPOSIX + printf(" -p use POSIX interface\n"); +#endif + printf(" -s output store (memory) used information\n" + " -t time compilation and execution\n"); + yield = 1; + goto EXIT; + } + op++; + argc--; + } + +/* Get the store for the offsets vector, and remember what it was */ + +size_offsets_max = size_offsets; +offsets = (int *)malloc(size_offsets_max * sizeof(int)); +if (offsets == NULL) + { + printf("** Failed to get %d bytes of memory for offsets vector\n", + size_offsets_max * sizeof(int)); + yield = 1; + goto EXIT; + } + +/* Sort out the input and output files */ + +if (argc > 1) + { + infile = fopen(argv[op], "rb"); + if (infile == NULL) + { + printf("** Failed to open %s\n", argv[op]); + yield = 1; + goto EXIT; + } + } + +if (argc > 2) + { + outfile = fopen(argv[op+1], "wb"); + if (outfile == NULL) + { + printf("** Failed to open %s\n", argv[op+1]); + yield = 1; + goto EXIT; + } + } + +/* Set alternative malloc function */ + +pcre_malloc = new_malloc; +pcre_free = new_free; +pcre_stack_malloc = stack_malloc; +pcre_stack_free = stack_free; + +/* Heading line, then prompt for first regex if stdin */ + +fprintf(outfile, "PCRE version %s\n\n", pcre_version()); + +/* Main loop */ + +while (!done) + { + pcre *re = NULL; + pcre_extra *extra = NULL; + +#if !defined NOPOSIX /* There are still compilers that require no indent */ + regex_t preg; + int do_posix = 0; +#endif + + const char *error; + unsigned char *p, *pp, *ppp; + unsigned char *to_file = NULL; + const unsigned char *tables = NULL; + unsigned long int true_size, true_study_size = 0; + size_t size, regex_gotten_store; + int do_study = 0; + int do_debug = debug; + int do_G = 0; + int do_g = 0; + int do_showinfo = showinfo; + int do_showrest = 0; + int do_flip = 0; + int erroroffset, len, delimiter; + + use_utf8 = 0; + + if (infile == stdin) printf(" re> "); + if (fgets((char *)buffer, BUFFER_SIZE, infile) == NULL) break; + if (infile != stdin) fprintf(outfile, "%s", (char *)buffer); + fflush(outfile); + + p = buffer; + while (isspace(*p)) p++; + if (*p == 0) continue; + + /* See if the pattern is to be loaded pre-compiled from a file. */ + + if (*p == '<' && strchr((char *)(p+1), '<') == NULL) + { + unsigned long int magic; + uschar sbuf[8]; + FILE *f; + + p++; + pp = p + (int)strlen((char *)p); + while (isspace(pp[-1])) pp--; + *pp = 0; + + f = fopen((char *)p, "rb"); + if (f == NULL) + { + fprintf(outfile, "Failed to open %s: %s\n", p, strerror(errno)); + continue; + } + + if (fread(sbuf, 1, 8, f) != 8) goto FAIL_READ; + + true_size = + (sbuf[0] << 24) | (sbuf[1] << 16) | (sbuf[2] << 8) | sbuf[3]; + true_study_size = + (sbuf[4] << 24) | (sbuf[5] << 16) | (sbuf[6] << 8) | sbuf[7]; + + re = (real_pcre *)new_malloc(true_size); + regex_gotten_store = gotten_store; + + if (fread(re, 1, true_size, f) != true_size) goto FAIL_READ; + + magic = ((real_pcre *)re)->magic_number; + if (magic != MAGIC_NUMBER) + { + if (byteflip(magic, sizeof(magic)) == MAGIC_NUMBER) + { + do_flip = 1; + } + else + { + fprintf(outfile, "Data in %s is not a compiled PCRE regex\n", p); + fclose(f); + continue; + } + } + + fprintf(outfile, "Compiled regex%s loaded from %s\n", + do_flip? " (byte-inverted)" : "", p); + + /* Need to know if UTF-8 for printing data strings */ + + new_info(re, NULL, PCRE_INFO_OPTIONS, &options); + use_utf8 = (options & PCRE_UTF8) != 0; + + /* Now see if there is any following study data */ + + if (true_study_size != 0) + { + pcre_study_data *psd; + + extra = (pcre_extra *)new_malloc(sizeof(pcre_extra) + true_study_size); + extra->flags = PCRE_EXTRA_STUDY_DATA; + + psd = (pcre_study_data *)(((char *)extra) + sizeof(pcre_extra)); + extra->study_data = psd; + + if (fread(psd, 1, true_study_size, f) != true_study_size) + { + FAIL_READ: + fprintf(outfile, "Failed to read data from %s\n", p); + if (extra != NULL) new_free(extra); + if (re != NULL) new_free(re); + fclose(f); + continue; + } + fprintf(outfile, "Study data loaded from %s\n", p); + do_study = 1; /* To get the data output if requested */ + } + else fprintf(outfile, "No study data\n"); + + fclose(f); + goto SHOW_INFO; + } + + /* In-line pattern (the usual case). Get the delimiter and seek the end of + the pattern; if is isn't complete, read more. */ + + delimiter = *p++; + + if (isalnum(delimiter) || delimiter == '\\') + { + fprintf(outfile, "** Delimiter must not be alphameric or \\\n"); + goto SKIP_DATA; + } + + pp = p; + + for(;;) + { + while (*pp != 0) + { + if (*pp == '\\' && pp[1] != 0) pp++; + else if (*pp == delimiter) break; + pp++; + } + if (*pp != 0) break; + + len = BUFFER_SIZE - (pp - buffer); + if (len < 256) + { + fprintf(outfile, "** Expression too long - missing delimiter?\n"); + goto SKIP_DATA; + } + + if (infile == stdin) printf(" > "); + if (fgets((char *)pp, len, infile) == NULL) + { + fprintf(outfile, "** Unexpected EOF\n"); + done = 1; + goto CONTINUE; + } + if (infile != stdin) fprintf(outfile, "%s", (char *)pp); + } + + /* If the first character after the delimiter is backslash, make + the pattern end with backslash. This is purely to provide a way + of testing for the error message when a pattern ends with backslash. */ + + if (pp[1] == '\\') *pp++ = '\\'; + + /* Terminate the pattern at the delimiter, and save a copy of the pattern + for callouts. */ + + *pp++ = 0; + strcpy((char *)pbuffer, (char *)p); + + /* Look for options after final delimiter */ + + options = 0; + study_options = 0; + log_store = showstore; /* default from command line */ + + while (*pp != 0) + { + switch (*pp++) + { + case 'f': options |= PCRE_FIRSTLINE; break; + case 'g': do_g = 1; break; + case 'i': options |= PCRE_CASELESS; break; + case 'm': options |= PCRE_MULTILINE; break; + case 's': options |= PCRE_DOTALL; break; + case 'x': options |= PCRE_EXTENDED; break; + + case '+': do_showrest = 1; break; + case 'A': options |= PCRE_ANCHORED; break; + case 'C': options |= PCRE_AUTO_CALLOUT; break; + case 'D': do_debug = do_showinfo = 1; break; + case 'E': options |= PCRE_DOLLAR_ENDONLY; break; + case 'F': do_flip = 1; break; + case 'G': do_G = 1; break; + case 'I': do_showinfo = 1; break; + case 'M': log_store = 1; break; + case 'N': options |= PCRE_NO_AUTO_CAPTURE; break; + +#if !defined NOPOSIX + case 'P': do_posix = 1; break; +#endif + + case 'S': do_study = 1; break; + case 'U': options |= PCRE_UNGREEDY; break; + case 'X': options |= PCRE_EXTRA; break; + case '8': options |= PCRE_UTF8; use_utf8 = 1; break; + case '?': options |= PCRE_NO_UTF8_CHECK; break; + + case 'L': + ppp = pp; + /* The '\r' test here is so that it works on Windows */ + while (*ppp != '\n' && *ppp != '\r' && *ppp != ' ') ppp++; + *ppp = 0; + if (setlocale(LC_CTYPE, (const char *)pp) == NULL) + { + fprintf(outfile, "** Failed to set locale \"%s\"\n", pp); + goto SKIP_DATA; + } + tables = pcre_maketables(); + pp = ppp; + break; + + case '>': + to_file = pp; + while (*pp != 0) pp++; + while (isspace(pp[-1])) pp--; + *pp = 0; + break; + + case '\r': /* So that it works in Windows */ + case '\n': + case ' ': + break; + + default: + fprintf(outfile, "** Unknown option '%c'\n", pp[-1]); + goto SKIP_DATA; + } + } + + /* Handle compiling via the POSIX interface, which doesn't support the + timing, showing, or debugging options, nor the ability to pass over + local character tables. */ + +#if !defined NOPOSIX + if (posix || do_posix) + { + int rc; + int cflags = 0; + + if ((options & PCRE_CASELESS) != 0) cflags |= REG_ICASE; + if ((options & PCRE_MULTILINE) != 0) cflags |= REG_NEWLINE; + if ((options & PCRE_DOTALL) != 0) cflags |= REG_DOTALL; + rc = regcomp(&preg, (char *)p, cflags); + + /* Compilation failed; go back for another re, skipping to blank line + if non-interactive. */ + + if (rc != 0) + { + (void)regerror(rc, &preg, (char *)buffer, BUFFER_SIZE); + fprintf(outfile, "Failed: POSIX code %d: %s\n", rc, buffer); + goto SKIP_DATA; + } + } + + /* Handle compiling via the native interface */ + + else +#endif /* !defined NOPOSIX */ + + { + if (timeit) + { + register int i; + clock_t time_taken; + clock_t start_time = clock(); + for (i = 0; i < LOOPREPEAT; i++) + { + re = pcre_compile((char *)p, options, &error, &erroroffset, tables); + if (re != NULL) free(re); + } + time_taken = clock() - start_time; + fprintf(outfile, "Compile time %.3f milliseconds\n", + (((double)time_taken * 1000.0) / (double)LOOPREPEAT) / + (double)CLOCKS_PER_SEC); + } + + re = pcre_compile((char *)p, options, &error, &erroroffset, tables); + + /* Compilation failed; go back for another re, skipping to blank line + if non-interactive. */ + + if (re == NULL) + { + fprintf(outfile, "Failed: %s at offset %d\n", error, erroroffset); + SKIP_DATA: + if (infile != stdin) + { + for (;;) + { + if (fgets((char *)buffer, BUFFER_SIZE, infile) == NULL) + { + done = 1; + goto CONTINUE; + } + len = (int)strlen((char *)buffer); + while (len > 0 && isspace(buffer[len-1])) len--; + if (len == 0) break; + } + fprintf(outfile, "\n"); + } + goto CONTINUE; + } + + /* Compilation succeeded; print data if required. There are now two + info-returning functions. The old one has a limited interface and + returns only limited data. Check that it agrees with the newer one. */ + + if (log_store) + fprintf(outfile, "Memory allocation (code space): %d\n", + (int)(gotten_store - + sizeof(real_pcre) - + ((real_pcre *)re)->name_count * ((real_pcre *)re)->name_entry_size)); + + /* Extract the size for possible writing before possibly flipping it, + and remember the store that was got. */ + + true_size = ((real_pcre *)re)->size; + regex_gotten_store = gotten_store; + + /* If /S was present, study the regexp to generate additional info to + help with the matching. */ + + if (do_study) + { + if (timeit) + { + register int i; + clock_t time_taken; + clock_t start_time = clock(); + for (i = 0; i < LOOPREPEAT; i++) + extra = pcre_study(re, study_options, &error); + time_taken = clock() - start_time; + if (extra != NULL) free(extra); + fprintf(outfile, " Study time %.3f milliseconds\n", + (((double)time_taken * 1000.0) / (double)LOOPREPEAT) / + (double)CLOCKS_PER_SEC); + } + extra = pcre_study(re, study_options, &error); + if (error != NULL) + fprintf(outfile, "Failed to study: %s\n", error); + else if (extra != NULL) + true_study_size = ((pcre_study_data *)(extra->study_data))->size; + } + + /* If the 'F' option was present, we flip the bytes of all the integer + fields in the regex data block and the study block. This is to make it + possible to test PCRE's handling of byte-flipped patterns, e.g. those + compiled on a different architecture. */ + + if (do_flip) + { + real_pcre *rre = (real_pcre *)re; + rre->magic_number = byteflip(rre->magic_number, sizeof(rre->magic_number)); + rre->size = byteflip(rre->size, sizeof(rre->size)); + rre->options = byteflip(rre->options, sizeof(rre->options)); + rre->top_bracket = byteflip(rre->top_bracket, sizeof(rre->top_bracket)); + rre->top_backref = byteflip(rre->top_backref, sizeof(rre->top_backref)); + rre->first_byte = byteflip(rre->first_byte, sizeof(rre->first_byte)); + rre->req_byte = byteflip(rre->req_byte, sizeof(rre->req_byte)); + rre->name_table_offset = byteflip(rre->name_table_offset, + sizeof(rre->name_table_offset)); + rre->name_entry_size = byteflip(rre->name_entry_size, + sizeof(rre->name_entry_size)); + rre->name_count = byteflip(rre->name_count, sizeof(rre->name_count)); + + if (extra != NULL) + { + pcre_study_data *rsd = (pcre_study_data *)(extra->study_data); + rsd->size = byteflip(rsd->size, sizeof(rsd->size)); + rsd->options = byteflip(rsd->options, sizeof(rsd->options)); + } + } + + /* Extract information from the compiled data if required */ + + SHOW_INFO: + + if (do_showinfo) + { + unsigned long int get_options, all_options; +#if !defined NOINFOCHECK + int old_first_char, old_options, old_count; +#endif + int count, backrefmax, first_char, need_char; + int nameentrysize, namecount; + const uschar *nametable; + + if (do_debug) + { + fprintf(outfile, "------------------------------------------------------------------\n"); + pcre_printint(re, outfile); + } + + new_info(re, NULL, PCRE_INFO_OPTIONS, &get_options); + new_info(re, NULL, PCRE_INFO_SIZE, &size); + new_info(re, NULL, PCRE_INFO_CAPTURECOUNT, &count); + new_info(re, NULL, PCRE_INFO_BACKREFMAX, &backrefmax); + new_info(re, NULL, PCRE_INFO_FIRSTBYTE, &first_char); + new_info(re, NULL, PCRE_INFO_LASTLITERAL, &need_char); + new_info(re, NULL, PCRE_INFO_NAMEENTRYSIZE, &nameentrysize); + new_info(re, NULL, PCRE_INFO_NAMECOUNT, &namecount); + new_info(re, NULL, PCRE_INFO_NAMETABLE, (void *)&nametable); + +#if !defined NOINFOCHECK + old_count = pcre_info(re, &old_options, &old_first_char); + if (count < 0) fprintf(outfile, + "Error %d from pcre_info()\n", count); + else + { + if (old_count != count) fprintf(outfile, + "Count disagreement: pcre_fullinfo=%d pcre_info=%d\n", count, + old_count); + + if (old_first_char != first_char) fprintf(outfile, + "First char disagreement: pcre_fullinfo=%d pcre_info=%d\n", + first_char, old_first_char); + + if (old_options != (int)get_options) fprintf(outfile, + "Options disagreement: pcre_fullinfo=%ld pcre_info=%d\n", + get_options, old_options); + } +#endif + + if (size != regex_gotten_store) fprintf(outfile, + "Size disagreement: pcre_fullinfo=%d call to malloc for %d\n", + (int)size, (int)regex_gotten_store); + + fprintf(outfile, "Capturing subpattern count = %d\n", count); + if (backrefmax > 0) + fprintf(outfile, "Max back reference = %d\n", backrefmax); + + if (namecount > 0) + { + fprintf(outfile, "Named capturing subpatterns:\n"); + while (namecount-- > 0) + { + fprintf(outfile, " %s %*s%3d\n", nametable + 2, + nameentrysize - 3 - (int)strlen((char *)nametable + 2), "", + GET2(nametable, 0)); + nametable += nameentrysize; + } + } + + /* The NOPARTIAL bit is a private bit in the options, so we have + to fish it out via out back door */ + + all_options = ((real_pcre *)re)->options; + if (do_flip) + { + all_options = byteflip(all_options, sizeof(all_options)); + } + + if ((all_options & PCRE_NOPARTIAL) != 0) + fprintf(outfile, "Partial matching not supported\n"); + + if (get_options == 0) fprintf(outfile, "No options\n"); + else fprintf(outfile, "Options:%s%s%s%s%s%s%s%s%s%s%s\n", + ((get_options & PCRE_ANCHORED) != 0)? " anchored" : "", + ((get_options & PCRE_CASELESS) != 0)? " caseless" : "", + ((get_options & PCRE_EXTENDED) != 0)? " extended" : "", + ((get_options & PCRE_MULTILINE) != 0)? " multiline" : "", + ((get_options & PCRE_FIRSTLINE) != 0)? " firstline" : "", + ((get_options & PCRE_DOTALL) != 0)? " dotall" : "", + ((get_options & PCRE_DOLLAR_ENDONLY) != 0)? " dollar_endonly" : "", + ((get_options & PCRE_EXTRA) != 0)? " extra" : "", + ((get_options & PCRE_UNGREEDY) != 0)? " ungreedy" : "", + ((get_options & PCRE_UTF8) != 0)? " utf8" : "", + ((get_options & PCRE_NO_UTF8_CHECK) != 0)? " no_utf8_check" : ""); + + if (((((real_pcre *)re)->options) & PCRE_ICHANGED) != 0) + fprintf(outfile, "Case state changes\n"); + + if (first_char == -1) + { + fprintf(outfile, "First char at start or follows \\n\n"); + } + else if (first_char < 0) + { + fprintf(outfile, "No first char\n"); + } + else + { + int ch = first_char & 255; + const char *caseless = ((first_char & REQ_CASELESS) == 0)? + "" : " (caseless)"; + if (isprint(ch)) + fprintf(outfile, "First char = \'%c\'%s\n", ch, caseless); + else + fprintf(outfile, "First char = %d%s\n", ch, caseless); + } + + if (need_char < 0) + { + fprintf(outfile, "No need char\n"); + } + else + { + int ch = need_char & 255; + const char *caseless = ((need_char & REQ_CASELESS) == 0)? + "" : " (caseless)"; + if (isprint(ch)) + fprintf(outfile, "Need char = \'%c\'%s\n", ch, caseless); + else + fprintf(outfile, "Need char = %d%s\n", ch, caseless); + } + + /* Don't output study size; at present it is in any case a fixed + value, but it varies, depending on the computer architecture, and + so messes up the test suite. (And with the /F option, it might be + flipped.) */ + + if (do_study) + { + if (extra == NULL) + fprintf(outfile, "Study returned NULL\n"); + else + { + uschar *start_bits = NULL; + new_info(re, extra, PCRE_INFO_FIRSTTABLE, &start_bits); + + if (start_bits == NULL) + fprintf(outfile, "No starting byte set\n"); + else + { + int i; + int c = 24; + fprintf(outfile, "Starting byte set: "); + for (i = 0; i < 256; i++) + { + if ((start_bits[i/8] & (1<<(i&7))) != 0) + { + if (c > 75) + { + fprintf(outfile, "\n "); + c = 2; + } + if (isprint(i) && i != ' ') + { + fprintf(outfile, "%c ", i); + c += 2; + } + else + { + fprintf(outfile, "\\x%02x ", i); + c += 5; + } + } + } + fprintf(outfile, "\n"); + } + } + } + } + + /* If the '>' option was present, we write out the regex to a file, and + that is all. The first 8 bytes of the file are the regex length and then + the study length, in big-endian order. */ + + if (to_file != NULL) + { + FILE *f = fopen((char *)to_file, "wb"); + if (f == NULL) + { + fprintf(outfile, "Unable to open %s: %s\n", to_file, strerror(errno)); + } + else + { + uschar sbuf[8]; + sbuf[0] = (true_size >> 24) & 255; + sbuf[1] = (true_size >> 16) & 255; + sbuf[2] = (true_size >> 8) & 255; + sbuf[3] = (true_size) & 255; + + sbuf[4] = (true_study_size >> 24) & 255; + sbuf[5] = (true_study_size >> 16) & 255; + sbuf[6] = (true_study_size >> 8) & 255; + sbuf[7] = (true_study_size) & 255; + + if (fwrite(sbuf, 1, 8, f) < 8 || + fwrite(re, 1, true_size, f) < true_size) + { + fprintf(outfile, "Write error on %s: %s\n", to_file, strerror(errno)); + } + else + { + fprintf(outfile, "Compiled regex written to %s\n", to_file); + if (extra != NULL) + { + if (fwrite(extra->study_data, 1, true_study_size, f) < + true_study_size) + { + fprintf(outfile, "Write error on %s: %s\n", to_file, + strerror(errno)); + } + else fprintf(outfile, "Study data written to %s\n", to_file); + } + } + fclose(f); + } + + new_free(re); + if (extra != NULL) new_free(extra); + if (tables != NULL) new_free((void *)tables); + continue; /* With next regex */ + } + } /* End of non-POSIX compile */ + + /* Read data lines and test them */ + + for (;;) + { + unsigned char *q; + unsigned char *bptr = dbuffer; + int *use_offsets = offsets; + int use_size_offsets = size_offsets; + int callout_data = 0; + int callout_data_set = 0; + int count, c; + int copystrings = 0; + int find_match_limit = 0; + int getstrings = 0; + int getlist = 0; + int gmatched = 0; + int start_offset = 0; + int g_notempty = 0; + int use_dfa = 0; + + options = 0; + + pcre_callout = callout; + first_callout = 1; + callout_extra = 0; + callout_count = 0; + callout_fail_count = 999999; + callout_fail_id = -1; + show_malloc = 0; + + if (infile == stdin) printf("data> "); + if (fgets((char *)buffer, BUFFER_SIZE, infile) == NULL) + { + done = 1; + goto CONTINUE; + } + if (infile != stdin) fprintf(outfile, "%s", (char *)buffer); + + len = (int)strlen((char *)buffer); + while (len > 0 && isspace(buffer[len-1])) len--; + buffer[len] = 0; + if (len == 0) break; + + p = buffer; + while (isspace(*p)) p++; + + q = dbuffer; + while ((c = *p++) != 0) + { + int i = 0; + int n = 0; + + if (c == '\\') switch ((c = *p++)) + { + case 'a': c = 7; break; + case 'b': c = '\b'; break; + case 'e': c = 27; break; + case 'f': c = '\f'; break; + case 'n': c = '\n'; break; + case 'r': c = '\r'; break; + case 't': c = '\t'; break; + case 'v': c = '\v'; break; + + case '0': case '1': case '2': case '3': + case '4': case '5': case '6': case '7': + c -= '0'; + while (i++ < 2 && isdigit(*p) && *p != '8' && *p != '9') + c = c * 8 + *p++ - '0'; + break; + + case 'x': + + /* Handle \x{..} specially - new Perl thing for utf8 */ + +#if !defined NOUTF8 + if (*p == '{') + { + unsigned char *pt = p; + c = 0; + while (isxdigit(*(++pt))) + c = c * 16 + tolower(*pt) - ((isdigit(*pt))? '0' : 'W'); + if (*pt == '}') + { + unsigned char buff8[8]; + int ii, utn; + utn = ord2utf8(c, buff8); + for (ii = 0; ii < utn - 1; ii++) *q++ = buff8[ii]; + c = buff8[ii]; /* Last byte */ + p = pt + 1; + break; + } + /* Not correct form; fall through */ + } +#endif + + /* Ordinary \x */ + + c = 0; + while (i++ < 2 && isxdigit(*p)) + { + c = c * 16 + tolower(*p) - ((isdigit(*p))? '0' : 'W'); + p++; + } + break; + + case 0: /* \ followed by EOF allows for an empty line */ + p--; + continue; + + case '>': + while(isdigit(*p)) start_offset = start_offset * 10 + *p++ - '0'; + continue; + + case 'A': /* Option setting */ + options |= PCRE_ANCHORED; + continue; + + case 'B': + options |= PCRE_NOTBOL; + continue; + + case 'C': + if (isdigit(*p)) /* Set copy string */ + { + while(isdigit(*p)) n = n * 10 + *p++ - '0'; + copystrings |= 1 << n; + } + else if (isalnum(*p)) + { + uschar name[256]; + uschar *npp = name; + while (isalnum(*p)) *npp++ = *p++; + *npp = 0; + n = pcre_get_stringnumber(re, (char *)name); + if (n < 0) + fprintf(outfile, "no parentheses with name \"%s\"\n", name); + else copystrings |= 1 << n; + } + else if (*p == '+') + { + callout_extra = 1; + p++; + } + else if (*p == '-') + { + pcre_callout = NULL; + p++; + } + else if (*p == '!') + { + callout_fail_id = 0; + p++; + while(isdigit(*p)) + callout_fail_id = callout_fail_id * 10 + *p++ - '0'; + callout_fail_count = 0; + if (*p == '!') + { + p++; + while(isdigit(*p)) + callout_fail_count = callout_fail_count * 10 + *p++ - '0'; + } + } + else if (*p == '*') + { + int sign = 1; + callout_data = 0; + if (*(++p) == '-') { sign = -1; p++; } + while(isdigit(*p)) + callout_data = callout_data * 10 + *p++ - '0'; + callout_data *= sign; + callout_data_set = 1; + } + continue; + +#if !defined NODFA + case 'D': +#if !defined NOPOSIX + if (posix || do_posix) + printf("** Can't use dfa matching in POSIX mode: \\D ignored\n"); + else +#endif + use_dfa = 1; + continue; + + case 'F': + options |= PCRE_DFA_SHORTEST; + continue; +#endif + + case 'G': + if (isdigit(*p)) + { + while(isdigit(*p)) n = n * 10 + *p++ - '0'; + getstrings |= 1 << n; + } + else if (isalnum(*p)) + { + uschar name[256]; + uschar *npp = name; + while (isalnum(*p)) *npp++ = *p++; + *npp = 0; + n = pcre_get_stringnumber(re, (char *)name); + if (n < 0) + fprintf(outfile, "no parentheses with name \"%s\"\n", name); + else getstrings |= 1 << n; + } + continue; + + case 'L': + getlist = 1; + continue; + + case 'M': + find_match_limit = 1; + continue; + + case 'N': + options |= PCRE_NOTEMPTY; + continue; + + case 'O': + while(isdigit(*p)) n = n * 10 + *p++ - '0'; + if (n > size_offsets_max) + { + size_offsets_max = n; + free(offsets); + use_offsets = offsets = (int *)malloc(size_offsets_max * sizeof(int)); + if (offsets == NULL) + { + printf("** Failed to get %d bytes of memory for offsets vector\n", + size_offsets_max * sizeof(int)); + yield = 1; + goto EXIT; + } + } + use_size_offsets = n; + if (n == 0) use_offsets = NULL; /* Ensures it can't write to it */ + continue; + + case 'P': + options |= PCRE_PARTIAL; + continue; + +#if !defined NODFA + case 'R': + options |= PCRE_DFA_RESTART; + continue; +#endif + + case 'S': + show_malloc = 1; + continue; + + case 'Z': + options |= PCRE_NOTEOL; + continue; + + case '?': + options |= PCRE_NO_UTF8_CHECK; + continue; + } + *q++ = c; + } + *q = 0; + len = q - dbuffer; + + if ((all_use_dfa || use_dfa) && find_match_limit) + { + printf("**Match limit not relevant for DFA matching: ignored\n"); + find_match_limit = 0; + } + + /* Handle matching via the POSIX interface, which does not + support timing or playing with the match limit or callout data. */ + +#if !defined NOPOSIX + if (posix || do_posix) + { + int rc; + int eflags = 0; + regmatch_t *pmatch = NULL; + if (use_size_offsets > 0) + pmatch = (regmatch_t *)malloc(sizeof(regmatch_t) * use_size_offsets); + if ((options & PCRE_NOTBOL) != 0) eflags |= REG_NOTBOL; + if ((options & PCRE_NOTEOL) != 0) eflags |= REG_NOTEOL; + + rc = regexec(&preg, (const char *)bptr, use_size_offsets, pmatch, eflags); + + if (rc != 0) + { + (void)regerror(rc, &preg, (char *)buffer, BUFFER_SIZE); + fprintf(outfile, "No match: POSIX code %d: %s\n", rc, buffer); + } + else + { + size_t i; + for (i = 0; i < (size_t)use_size_offsets; i++) + { + if (pmatch[i].rm_so >= 0) + { + fprintf(outfile, "%2d: ", (int)i); + (void)pchars(dbuffer + pmatch[i].rm_so, + pmatch[i].rm_eo - pmatch[i].rm_so, outfile); + fprintf(outfile, "\n"); + if (i == 0 && do_showrest) + { + fprintf(outfile, " 0+ "); + (void)pchars(dbuffer + pmatch[i].rm_eo, len - pmatch[i].rm_eo, + outfile); + fprintf(outfile, "\n"); + } + } + } + } + free(pmatch); + } + + /* Handle matching via the native interface - repeats for /g and /G */ + + else +#endif /* !defined NOPOSIX */ + + for (;; gmatched++) /* Loop for /g or /G */ + { + if (timeit) + { + register int i; + clock_t time_taken; + clock_t start_time = clock(); + +#if !defined NODFA + if (all_use_dfa || use_dfa) + { + int workspace[1000]; + for (i = 0; i < LOOPREPEAT; i++) + count = pcre_dfa_exec(re, NULL, (char *)bptr, len, start_offset, + options | g_notempty, use_offsets, use_size_offsets, workspace, + sizeof(workspace)/sizeof(int)); + } + else +#endif + + for (i = 0; i < LOOPREPEAT; i++) + count = pcre_exec(re, extra, (char *)bptr, len, + start_offset, options | g_notempty, use_offsets, use_size_offsets); + + time_taken = clock() - start_time; + fprintf(outfile, "Execute time %.3f milliseconds\n", + (((double)time_taken * 1000.0) / (double)LOOPREPEAT) / + (double)CLOCKS_PER_SEC); + } + + /* If find_match_limit is set, we want to do repeated matches with + varying limits in order to find the minimum value. */ + + if (find_match_limit) + { + int min = 0; + int mid = 64; + int max = -1; + + if (extra == NULL) + { + extra = (pcre_extra *)malloc(sizeof(pcre_extra)); + extra->flags = 0; + } + extra->flags |= PCRE_EXTRA_MATCH_LIMIT; + + for (;;) + { + extra->match_limit = mid; + count = pcre_exec(re, extra, (char *)bptr, len, start_offset, + options | g_notempty, use_offsets, use_size_offsets); + if (count == PCRE_ERROR_MATCHLIMIT) + { + /* fprintf(outfile, "Testing match limit = %d\n", mid); */ + min = mid; + mid = (mid == max - 1)? max : (max > 0)? (min + max)/2 : mid*2; + } + else if (count >= 0 || count == PCRE_ERROR_NOMATCH || + count == PCRE_ERROR_PARTIAL) + { + if (mid == min + 1) + { + fprintf(outfile, "Minimum match limit = %d\n", mid); + break; + } + /* fprintf(outfile, "Testing match limit = %d\n", mid); */ + max = mid; + mid = (min + mid)/2; + } + else break; /* Some other error */ + } + + extra->flags &= ~PCRE_EXTRA_MATCH_LIMIT; + } + + /* If callout_data is set, use the interface with additional data */ + + else if (callout_data_set) + { + if (extra == NULL) + { + extra = (pcre_extra *)malloc(sizeof(pcre_extra)); + extra->flags = 0; + } + extra->flags |= PCRE_EXTRA_CALLOUT_DATA; + extra->callout_data = &callout_data; + count = pcre_exec(re, extra, (char *)bptr, len, start_offset, + options | g_notempty, use_offsets, use_size_offsets); + extra->flags &= ~PCRE_EXTRA_CALLOUT_DATA; + } + + /* The normal case is just to do the match once, with the default + value of match_limit. */ + +#if !defined NODFA + else if (all_use_dfa || use_dfa) + { + int workspace[1000]; + count = pcre_dfa_exec(re, NULL, (char *)bptr, len, start_offset, + options | g_notempty, use_offsets, use_size_offsets, workspace, + sizeof(workspace)/sizeof(int)); + if (count == 0) + { + fprintf(outfile, "Matched, but too many subsidiary matches\n"); + count = use_size_offsets/2; + } + } +#endif + + else + { + count = pcre_exec(re, extra, (char *)bptr, len, + start_offset, options | g_notempty, use_offsets, use_size_offsets); + if (count == 0) + { + fprintf(outfile, "Matched, but too many substrings\n"); + count = use_size_offsets/3; + } + } + + /* Matched */ + + if (count >= 0) + { + int i; + for (i = 0; i < count * 2; i += 2) + { + if (use_offsets[i] < 0) + fprintf(outfile, "%2d: \n", i/2); + else + { + fprintf(outfile, "%2d: ", i/2); + (void)pchars(bptr + use_offsets[i], + use_offsets[i+1] - use_offsets[i], outfile); + fprintf(outfile, "\n"); + if (i == 0) + { + if (do_showrest) + { + fprintf(outfile, " 0+ "); + (void)pchars(bptr + use_offsets[i+1], len - use_offsets[i+1], + outfile); + fprintf(outfile, "\n"); + } + } + } + } + + for (i = 0; i < 32; i++) + { + if ((copystrings & (1 << i)) != 0) + { + char copybuffer[16]; + int rc = pcre_copy_substring((char *)bptr, use_offsets, count, + i, copybuffer, sizeof(copybuffer)); + if (rc < 0) + fprintf(outfile, "copy substring %d failed %d\n", i, rc); + else + fprintf(outfile, "%2dC %s (%d)\n", i, copybuffer, rc); + } + } + + for (i = 0; i < 32; i++) + { + if ((getstrings & (1 << i)) != 0) + { + const char *substring; + int rc = pcre_get_substring((char *)bptr, use_offsets, count, + i, &substring); + if (rc < 0) + fprintf(outfile, "get substring %d failed %d\n", i, rc); + else + { + fprintf(outfile, "%2dG %s (%d)\n", i, substring, rc); + /* free((void *)substring); */ + pcre_free_substring(substring); + } + } + } + + if (getlist) + { + const char **stringlist; + int rc = pcre_get_substring_list((char *)bptr, use_offsets, count, + &stringlist); + if (rc < 0) + fprintf(outfile, "get substring list failed %d\n", rc); + else + { + for (i = 0; i < count; i++) + fprintf(outfile, "%2dL %s\n", i, stringlist[i]); + if (stringlist[i] != NULL) + fprintf(outfile, "string list not terminated by NULL\n"); + /* free((void *)stringlist); */ + pcre_free_substring_list(stringlist); + } + } + } + + /* There was a partial match */ + + else if (count == PCRE_ERROR_PARTIAL) + { + fprintf(outfile, "Partial match"); +#if !defined NODFA + if ((all_use_dfa || use_dfa) && use_size_offsets > 2) + fprintf(outfile, ": %.*s", use_offsets[1] - use_offsets[0], + bptr + use_offsets[0]); +#endif + fprintf(outfile, "\n"); + break; /* Out of the /g loop */ + } + + /* Failed to match. If this is a /g or /G loop and we previously set + g_notempty after a null match, this is not necessarily the end. + We want to advance the start offset, and continue. In the case of UTF-8 + matching, the advance must be one character, not one byte. Fudge the + offset values to achieve this. We won't be at the end of the string - + that was checked before setting g_notempty. */ + + else + { + if (g_notempty != 0) + { + int onechar = 1; + use_offsets[0] = start_offset; + if (use_utf8) + { + while (start_offset + onechar < len) + { + int tb = bptr[start_offset+onechar]; + if (tb <= 127) break; + tb &= 0xc0; + if (tb != 0 && tb != 0xc0) onechar++; + } + } + use_offsets[1] = start_offset + onechar; + } + else + { + if (count == PCRE_ERROR_NOMATCH) + { + if (gmatched == 0) fprintf(outfile, "No match\n"); + } + else fprintf(outfile, "Error %d\n", count); + break; /* Out of the /g loop */ + } + } + + /* If not /g or /G we are done */ + + if (!do_g && !do_G) break; + + /* If we have matched an empty string, first check to see if we are at + the end of the subject. If so, the /g loop is over. Otherwise, mimic + what Perl's /g options does. This turns out to be rather cunning. First + we set PCRE_NOTEMPTY and PCRE_ANCHORED and try the match again at the + same point. If this fails (picked up above) we advance to the next + character. */ + + g_notempty = 0; + if (use_offsets[0] == use_offsets[1]) + { + if (use_offsets[0] == len) break; + g_notempty = PCRE_NOTEMPTY | PCRE_ANCHORED; + } + + /* For /g, update the start offset, leaving the rest alone */ + + if (do_g) start_offset = use_offsets[1]; + + /* For /G, update the pointer and length */ + + else + { + bptr += use_offsets[1]; + len -= use_offsets[1]; + } + } /* End of loop for /g and /G */ + } /* End of loop for data lines */ + + CONTINUE: + +#if !defined NOPOSIX + if (posix || do_posix) regfree(&preg); +#endif + + if (re != NULL) new_free(re); + if (extra != NULL) new_free(extra); + if (tables != NULL) + { + new_free((void *)tables); + setlocale(LC_CTYPE, "C"); + } + } + +if (infile == stdin) fprintf(outfile, "\n"); + +EXIT: + +if (infile != NULL && infile != stdin) fclose(infile); +if (outfile != NULL && outfile != stdout) fclose(outfile); + +free(buffer); +free(dbuffer); +free(pbuffer); +free(offsets); + +return yield; +} + +/* End of pcretest.c */ diff --git a/mozilla/js/tamarin/pcre/perltest b/mozilla/js/tamarin/pcre/perltest new file mode 100644 index 00000000000..44afbea63c4 --- /dev/null +++ b/mozilla/js/tamarin/pcre/perltest @@ -0,0 +1,211 @@ +#! /usr/bin/perl + +# Program for testing regular expressions with perl to check that PCRE handles +# them the same. This is the version that supports /8 for UTF-8 testing. As it +# stands, it requires at least Perl 5.8 for UTF-8 support. For Perl 5.6, it +# can be used as is for non-UTF-8 testing, but you have to uncomment the +# "use utf8" lines in order to to UTF-8 stuff (and you mustn't uncomment them +# for non-UTF-8 use). + + +# Function for turning a string into a string of printing chars. There are +# currently problems with UTF-8 strings; this fudges round them. + +sub pchars { +my($t) = ""; + +if ($utf8) + { +# use utf8; <=============== For UTF-8 in Perl 5.6 + @p = unpack('U*', $_[0]); + foreach $c (@p) + { + if ($c >= 32 && $c < 127) { $t .= chr $c; } + else { $t .= sprintf("\\x{%02x}", $c); } + } + } + +else + { + foreach $c (split(//, $_[0])) + { + if (ord $c >= 32 && ord $c < 127) { $t .= $c; } + else { $t .= sprintf("\\x%02x", ord $c); } + } + } + +$t; +} + + + +# Read lines from named file or stdin and write to named file or stdout; lines +# consist of a regular expression, in delimiters and optionally followed by +# options, followed by a set of test data, terminated by an empty line. + +# Sort out the input and output files + +if (@ARGV > 0) + { + open(INFILE, "<$ARGV[0]") || die "Failed to open $ARGV[0]\n"; + $infile = "INFILE"; + } +else { $infile = "STDIN"; } + +if (@ARGV > 1) + { + open(OUTFILE, ">$ARGV[1]") || die "Failed to open $ARGV[1]\n"; + $outfile = "OUTFILE"; + } +else { $outfile = "STDOUT"; } + +printf($outfile "Perl $] Regular Expressions\n\n"); + +# Main loop + +NEXT_RE: +for (;;) + { + printf " re> " if $infile eq "STDIN"; + last if ! ($_ = <$infile>); + printf $outfile "$_" if $infile ne "STDIN"; + next if ($_ eq ""); + + $pattern = $_; + + while ($pattern !~ /^\s*(.).*\1/s) + { + printf " > " if $infile eq "STDIN"; + last if ! ($_ = <$infile>); + printf $outfile "$_" if $infile ne "STDIN"; + $pattern .= $_; + } + + chomp($pattern); + $pattern =~ s/\s+$//; + + # The private /+ modifier means "print $' afterwards". + + $showrest = ($pattern =~ s/\+(?=[a-z]*$)//); + + # The private /8 modifier means "operate in UTF-8". Currently, Perl + # has bugs that we try to work around using this flag. + + $utf8 = ($pattern =~ s/8(?=[a-z]*$)//); + + # Check that the pattern is valid + + if ($utf8) + { +# use utf8; <=============== For UTF-8 in Perl 5.6 + eval "\$_ =~ ${pattern}"; + } + else + { + eval "\$_ =~ ${pattern}"; + } + + if ($@) + { + printf $outfile "Error: $@"; + next NEXT_RE; + } + + # If the /g modifier is present, we want to put a loop round the matching; + # otherwise just a single "if". + + $cmd = ($pattern =~ /g[a-z]*$/)? "while" : "if"; + + # If the pattern is actually the null string, Perl uses the most recently + # executed (and successfully compiled) regex is used instead. This is a + # nasty trap for the unwary! The PCRE test suite does contain null strings + # in places - if they are allowed through here all sorts of weird and + # unexpected effects happen. To avoid this, we replace such patterns with + # a non-null pattern that has the same effect. + + $pattern = "/(?#)/$2" if ($pattern =~ /^(.)\1(.*)$/); + + # Read data lines and test them + + for (;;) + { + printf "data> " if $infile eq "STDIN"; + last NEXT_RE if ! ($_ = <$infile>); + chomp; + printf $outfile "$_\n" if $infile ne "STDIN"; + + s/\s+$//; + s/^\s+//; + + last if ($_ eq ""); + + $x = eval "\"$_\""; # To get escapes processed + + # Empty array for holding results, then do the matching. + + @subs = (); + + $pushes = "push \@subs,\$&;" . + "push \@subs,\$1;" . + "push \@subs,\$2;" . + "push \@subs,\$3;" . + "push \@subs,\$4;" . + "push \@subs,\$5;" . + "push \@subs,\$6;" . + "push \@subs,\$7;" . + "push \@subs,\$8;" . + "push \@subs,\$9;" . + "push \@subs,\$10;" . + "push \@subs,\$11;" . + "push \@subs,\$12;" . + "push \@subs,\$13;" . + "push \@subs,\$14;" . + "push \@subs,\$15;" . + "push \@subs,\$16;" . + "push \@subs,\$'; }"; + + if ($utf8) + { +# use utf8; <=============== For UTF-8 in Perl 5.6 + eval "${cmd} (\$x =~ ${pattern}) {" . $pushes; + } + else + { + eval "${cmd} (\$x =~ ${pattern}) {" . $pushes; + } + + if ($@) + { + printf $outfile "Error: $@\n"; + next NEXT_RE; + } + elsif (scalar(@subs) == 0) + { + printf $outfile "No match\n"; + } + else + { + while (scalar(@subs) != 0) + { + printf $outfile (" 0: %s\n", &pchars($subs[0])); + printf $outfile (" 0+ %s\n", &pchars($subs[17])) if $showrest; + $last_printed = 0; + for ($i = 1; $i <= 16; $i++) + { + if (defined $subs[$i]) + { + while ($last_printed++ < $i-1) + { printf $outfile ("%2d: \n", $last_printed); } + printf $outfile ("%2d: %s\n", $i, &pchars($subs[$i])); + $last_printed = $i; + } + } + splice(@subs, 0, 18); + } + } + } + } + +# printf $outfile "\n"; + +# End diff --git a/mozilla/js/tamarin/pcre/testdata/grepinput b/mozilla/js/tamarin/pcre/testdata/grepinput new file mode 100644 index 00000000000..2a89c2e09dd --- /dev/null +++ b/mozilla/js/tamarin/pcre/testdata/grepinput @@ -0,0 +1,588 @@ +This is a file of miscellaneous text that is used as test data for checking +that the pcregrep command is working correctly. The file must be more than 24K +long so that it needs more than a single read() call to process it. New +features should be added at the end, because some of the tests involve the +output of line numbers, and we don't want these to change. + +PATTERN at the start of a line. +In the middle of a line, PATTERN appears. + +This pattern is in lower case. + +Here follows a whole lot of stuff that makes the file over 24K long. + +------------------------------------------------------------------------------- +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. + +The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the +lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox +jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick +brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. +------------------------------------------------------------------------------- + +Check up on PATTERN near the end. + +This is the last line of this file. diff --git a/mozilla/js/tamarin/pcre/testdata/grepinputx b/mozilla/js/tamarin/pcre/testdata/grepinputx new file mode 100644 index 00000000000..aebba027703 --- /dev/null +++ b/mozilla/js/tamarin/pcre/testdata/grepinputx @@ -0,0 +1,42 @@ +This is a second file of input for the pcregrep tests. + +Here is the pattern again. + +Pattern +That time it was on a line by itself. + +To pat or not to pat, that is the question. + +complete pair +of lines + +That was a complete pair +of lines all by themselves. + +complete pair +of lines + +And there they were again, to check line numbers. + +one +two +three +four +five +six +seven +eight +nine +ten +eleven +twelve +thirteen +fourteen +fifteen +sixteen +seventeen +eighteen +nineteen +twenty + +This is the last line of this file. diff --git a/mozilla/js/tamarin/pcre/testdata/greplist b/mozilla/js/tamarin/pcre/testdata/greplist new file mode 100644 index 00000000000..bb2705e390a --- /dev/null +++ b/mozilla/js/tamarin/pcre/testdata/greplist @@ -0,0 +1,4 @@ +This is a file of patterns for testing the -f option. Don't include any blank +lines because they will match everything! +pattern +line by itself diff --git a/mozilla/js/tamarin/pcre/testdata/grepoutput b/mozilla/js/tamarin/pcre/testdata/grepoutput new file mode 100644 index 00000000000..2ea9a911169 --- /dev/null +++ b/mozilla/js/tamarin/pcre/testdata/grepoutput @@ -0,0 +1,334 @@ +pcregrep version 4.1 05-Sep-2005 using PCRE version 6.4 05-Sep-2005 +---------------------------- Test 1 ------------------------------ +PATTERN at the start of a line. +In the middle of a line, PATTERN appears. +Check up on PATTERN near the end. +---------------------------- Test 2 ------------------------------ +PATTERN at the start of a line. +---------------------------- Test 3 ------------------------------ +7:PATTERN at the start of a line. +8:In the middle of a line, PATTERN appears. +10:This pattern is in lower case. +586:Check up on PATTERN near the end. +---------------------------- Test 4 ------------------------------ +4 +---------------------------- Test 5 ------------------------------ +./testdata/grepinput:7:PATTERN at the start of a line. +./testdata/grepinput:8:In the middle of a line, PATTERN appears. +./testdata/grepinput:10:This pattern is in lower case. +./testdata/grepinput:586:Check up on PATTERN near the end. +./testdata/grepinputx:3:Here is the pattern again. +./testdata/grepinputx:5:Pattern +---------------------------- Test 6 ------------------------------ +7:PATTERN at the start of a line. +8:In the middle of a line, PATTERN appears. +10:This pattern is in lower case. +586:Check up on PATTERN near the end. +3:Here is the pattern again. +5:Pattern +---------------------------- Test 7 ------------------------------ +./testdata/grepinput +./testdata/grepinputx +---------------------------- Test 8 ------------------------------ +./testdata/grepinput +---------------------------- Test 9 ------------------------------ +RC=0 +---------------------------- Test 10 ----------------------------- +RC=1 +---------------------------- Test 11 ----------------------------- +1:This is a second file of input for the pcregrep tests. +2: +4: +5:Pattern +6:That time it was on a line by itself. +7: +8:To pat or not to pat, that is the question. +9: +10:complete pair +11:of lines +12: +13:That was a complete pair +14:of lines all by themselves. +15: +16:complete pair +17:of lines +18: +19:And there they were again, to check line numbers. +20: +21:one +22:two +23:three +24:four +25:five +26:six +27:seven +28:eight +29:nine +30:ten +31:eleven +32:twelve +33:thirteen +34:fourteen +35:fifteen +36:sixteen +37:seventeen +38:eighteen +39:nineteen +40:twenty +41: +42:This is the last line of this file. +---------------------------- Test 12 ----------------------------- +Pattern +---------------------------- Test 13 ----------------------------- +Here is the pattern again. +That time it was on a line by itself. +---------------------------- Test 14 ----------------------------- +./testdata/grepinputx:To pat or not to pat, that is the question. +---------------------------- Test 15 ----------------------------- +pcregrep: Error in regex at offset 4: nothing to repeat +---------------------------- Test 16 ----------------------------- +pcregrep: Failed to open ./testdata/nonexistfile: No such file or directory +---------------------------- Test 17 ----------------------------- +features should be added at the end, because some of the tests involve the +output of line numbers, and we don't want these to change. +---------------------------- Test 18 ----------------------------- +4:features should be added at the end, because some of the tests involve the +output of line numbers, and we don't want these to change. +583:brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. +------------------------------------------------------------------------------- +---------------------------- Test 19 ----------------------------- +Pattern +---------------------------- Test 20 ----------------------------- +10:complete pair +of lines +16:complete pair +of lines +---------------------------- Test 21 ----------------------------- +24:four +25-five +26-six +27-seven +-- +34:fourteen +35-fifteen +36-sixteen +37-seventeen +---------------------------- Test 22 ----------------------------- +20-one +21-two +22-three +24:four +-- +30-eleven +31-twelve +32-thirteen +34:fourteen +---------------------------- Test 23 ----------------------------- +one +two +three +four +five +six +seven +-- +eleven +twelve +thirteen +fourteen +fifteen +sixteen +seventeen +---------------------------- Test 24 ----------------------------- +four +five +six +seven +eight +nine +ten +eleven +twelve +thirteen +fourteen +fifteen +sixteen +seventeen +eighteen +nineteen +twenty + +This is the last line of this file. +---------------------------- Test 25 ----------------------------- +14- +15-complete pair +16-of lines +17- +18-And there they were again, to check line numbers. +19- +20-one +21-two +22-three +24:four +25-five +26-six +27-seven +28-eight +29-nine +30-ten +31-eleven +32-twelve +33-thirteen +34:fourteen +---------------------------- Test 26 ----------------------------- + +complete pair +of lines + +And there they were again, to check line numbers. + +one +two +three +four +five +six +seven +eight +nine +ten +eleven +twelve +thirteen +fourteen +fifteen +sixteen +seventeen +eighteen +nineteen +twenty + +This is the last line of this file. +---------------------------- Test 27 ----------------------------- +four +five +six +seven +eight +nine +ten +eleven +twelve +thirteen +fourteen +fifteen +sixteen +seventeen +eighteen +nineteen +twenty + +This is the last line of this file. +---------------------------- Test 28 ----------------------------- +13-of lines all by themselves. +14- +15-complete pair +16-of lines +17- +18-And there they were again, to check line numbers. +19- +20-one +21-two +22-three +24:four +25-five +26-six +27-seven +28-eight +29-nine +30-ten +31-eleven +32-twelve +33-thirteen +34:fourteen +---------------------------- Test 29 ----------------------------- +of lines all by themselves. + +complete pair +of lines + +And there they were again, to check line numbers. + +one +two +three +four +five +six +seven +eight +nine +ten +eleven +twelve +thirteen +fourteen +fifteen +sixteen +seventeen +eighteen +nineteen +twenty + +This is the last line of this file. +---------------------------- Test 30 ----------------------------- +./testdata/grepinput-3-features should be added at the end, because some of the tests involve the +./testdata/grepinput-4-output of line numbers, and we don't want these to change. +./testdata/grepinput-5- +./testdata/grepinput:7:PATTERN at the start of a line. +./testdata/grepinput:8:In the middle of a line, PATTERN appears. +./testdata/grepinput-9- +./testdata/grepinput:10:This pattern is in lower case. +-- +./testdata/grepinput-582-brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. +./testdata/grepinput-583-------------------------------------------------------------------------------- +./testdata/grepinput-584- +./testdata/grepinput:586:Check up on PATTERN near the end. +-- +./testdata/grepinputx-1-This is a second file of input for the pcregrep tests. +./testdata/grepinputx-2- +./testdata/grepinputx:3:Here is the pattern again. +./testdata/grepinputx-4- +./testdata/grepinputx:5:Pattern +---------------------------- Test 31 ----------------------------- +./testdata/grepinput:7:PATTERN at the start of a line. +./testdata/grepinput:8:In the middle of a line, PATTERN appears. +./testdata/grepinput-9- +./testdata/grepinput:10:This pattern is in lower case. +./testdata/grepinput-11- +./testdata/grepinput-12-Here follows a whole lot of stuff that makes the file over 24K long. +./testdata/grepinput-13- +-- +./testdata/grepinput:586:Check up on PATTERN near the end. +./testdata/grepinput-587- +./testdata/grepinput-588-This is the last line of this file. +-- +./testdata/grepinputx:3:Here is the pattern again. +./testdata/grepinputx-4- +./testdata/grepinputx:5:Pattern +./testdata/grepinputx-6-That time it was on a line by itself. +./testdata/grepinputx-7- +./testdata/grepinputx-8-To pat or not to pat, that is the question. +---------------------------- Test 32 ----------------------------- +./testdata/grepinputx +---------------------------- Test 33 ----------------------------- +pcregrep: Failed to open ./testdata/grepnonexist: No such file or directory +RC=2 +---------------------------- Test 34 ----------------------------- +RC=2 +---------------------------- Test 35 ----------------------------- +./testdata/grepinputx +RC=0 +---------------------------- Test 36 ----------------------------- +./testdata/grepinputx +RC=0 diff --git a/mozilla/js/tamarin/pcre/testdata/testinput1 b/mozilla/js/tamarin/pcre/testdata/testinput1 new file mode 100644 index 00000000000..0222d1ad1a3 --- /dev/null +++ b/mozilla/js/tamarin/pcre/testdata/testinput1 @@ -0,0 +1,3849 @@ +/the quick brown fox/ + the quick brown fox + The quick brown FOX + What do you know about the quick brown fox? + What do you know about THE QUICK BROWN FOX? + +/The quick brown fox/i + the quick brown fox + The quick brown FOX + What do you know about the quick brown fox? + What do you know about THE QUICK BROWN FOX? + +/abcd\t\n\r\f\a\e\071\x3b\$\\\?caxyz/ + abcd\t\n\r\f\a\e9;\$\\?caxyz + +/a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/ + abxyzpqrrrabbxyyyypqAzz + abxyzpqrrrabbxyyyypqAzz + aabxyzpqrrrabbxyyyypqAzz + aaabxyzpqrrrabbxyyyypqAzz + aaaabxyzpqrrrabbxyyyypqAzz + abcxyzpqrrrabbxyyyypqAzz + aabcxyzpqrrrabbxyyyypqAzz + aaabcxyzpqrrrabbxyyyypAzz + aaabcxyzpqrrrabbxyyyypqAzz + aaabcxyzpqrrrabbxyyyypqqAzz + aaabcxyzpqrrrabbxyyyypqqqAzz + aaabcxyzpqrrrabbxyyyypqqqqAzz + aaabcxyzpqrrrabbxyyyypqqqqqAzz + aaabcxyzpqrrrabbxyyyypqqqqqqAzz + aaaabcxyzpqrrrabbxyyyypqAzz + abxyzzpqrrrabbxyyyypqAzz + aabxyzzzpqrrrabbxyyyypqAzz + aaabxyzzzzpqrrrabbxyyyypqAzz + aaaabxyzzzzpqrrrabbxyyyypqAzz + abcxyzzpqrrrabbxyyyypqAzz + aabcxyzzzpqrrrabbxyyyypqAzz + aaabcxyzzzzpqrrrabbxyyyypqAzz + aaaabcxyzzzzpqrrrabbxyyyypqAzz + aaaabcxyzzzzpqrrrabbbxyyyypqAzz + aaaabcxyzzzzpqrrrabbbxyyyyypqAzz + aaabcxyzpqrrrabbxyyyypABzz + aaabcxyzpqrrrabbxyyyypABBzz + >>>aaabxyzpqrrrabbxyyyypqAzz + >aaaabxyzpqrrrabbxyyyypqAzz + >>>>abcxyzpqrrrabbxyyyypqAzz + *** Failers + abxyzpqrrabbxyyyypqAzz + abxyzpqrrrrabbxyyyypqAzz + abxyzpqrrrabxyyyypqAzz + aaaabcxyzzzzpqrrrabbbxyyyyyypqAzz + aaaabcxyzzzzpqrrrabbbxyyypqAzz + aaabcxyzpqrrrabbxyyyypqqqqqqqAzz + +/^(abc){1,2}zz/ + abczz + abcabczz + *** Failers + zz + abcabcabczz + >>abczz + +/^(b+?|a){1,2}?c/ + bc + bbc + bbbc + bac + bbac + aac + abbbbbbbbbbbc + bbbbbbbbbbbac + *** Failers + aaac + abbbbbbbbbbbac + +/^(b+|a){1,2}c/ + bc + bbc + bbbc + bac + bbac + aac + abbbbbbbbbbbc + bbbbbbbbbbbac + *** Failers + aaac + abbbbbbbbbbbac + +/^(b+|a){1,2}?bc/ + bbc + +/^(b*|ba){1,2}?bc/ + babc + bbabc + bababc + *** Failers + bababbc + babababc + +/^(ba|b*){1,2}?bc/ + babc + bbabc + bababc + *** Failers + bababbc + babababc + +/^\ca\cA\c[\c{\c:/ + \x01\x01\e;z + +/^[ab\]cde]/ + athing + bthing + ]thing + cthing + dthing + ething + *** Failers + fthing + [thing + \\thing + +/^[]cde]/ + ]thing + cthing + dthing + ething + *** Failers + athing + fthing + +/^[^ab\]cde]/ + fthing + [thing + \\thing + *** Failers + athing + bthing + ]thing + cthing + dthing + ething + +/^[^]cde]/ + athing + fthing + *** Failers + ]thing + cthing + dthing + ething + +/^\/ + + +/^ÿ/ + ÿ + +/^[0-9]+$/ + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 100 + *** Failers + abc + +/^.*nter/ + enter + inter + uponter + +/^xxx[0-9]+$/ + xxx0 + xxx1234 + *** Failers + xxx + +/^.+[0-9][0-9][0-9]$/ + x123 + xx123 + 123456 + *** Failers + 123 + x1234 + +/^.+?[0-9][0-9][0-9]$/ + x123 + xx123 + 123456 + *** Failers + 123 + x1234 + +/^([^!]+)!(.+)=apquxz\.ixr\.zzz\.ac\.uk$/ + abc!pqr=apquxz.ixr.zzz.ac.uk + *** Failers + !pqr=apquxz.ixr.zzz.ac.uk + abc!=apquxz.ixr.zzz.ac.uk + abc!pqr=apquxz:ixr.zzz.ac.uk + abc!pqr=apquxz.ixr.zzz.ac.ukk + +/:/ + Well, we need a colon: somewhere + *** Fail if we don't + +/([\da-f:]+)$/i + 0abc + abc + fed + E + :: + 5f03:12C0::932e + fed def + Any old stuff + *** Failers + 0zzz + gzzz + fed\x20 + Any old rubbish + +/^.*\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/ + .1.2.3 + A.12.123.0 + *** Failers + .1.2.3333 + 1.2.3 + 1234.2.3 + +/^(\d+)\s+IN\s+SOA\s+(\S+)\s+(\S+)\s*\(\s*$/ + 1 IN SOA non-sp1 non-sp2( + 1 IN SOA non-sp1 non-sp2 ( + *** Failers + 1IN SOA non-sp1 non-sp2( + +/^[a-zA-Z\d][a-zA-Z\d\-]*(\.[a-zA-Z\d][a-zA-z\d\-]*)*\.$/ + a. + Z. + 2. + ab-c.pq-r. + sxk.zzz.ac.uk. + x-.y-. + *** Failers + -abc.peq. + +/^\*\.[a-z]([a-z\-\d]*[a-z\d]+)?(\.[a-z]([a-z\-\d]*[a-z\d]+)?)*$/ + *.a + *.b0-a + *.c3-b.c + *.c-a.b-c + *** Failers + *.0 + *.a- + *.a-b.c- + *.c-a.0-c + +/^(?=ab(de))(abd)(e)/ + abde + +/^(?!(ab)de|x)(abd)(f)/ + abdf + +/^(?=(ab(cd)))(ab)/ + abcd + +/^[\da-f](\.[\da-f])*$/i + a.b.c.d + A.B.C.D + a.b.c.1.2.3.C + +/^\".*\"\s*(;.*)?$/ + \"1234\" + \"abcd\" ; + \"\" ; rhubarb + *** Failers + \"1234\" : things + +/^$/ + \ + *** Failers + +/ ^ a (?# begins with a) b\sc (?# then b c) $ (?# then end)/x + ab c + *** Failers + abc + ab cde + +/(?x) ^ a (?# begins with a) b\sc (?# then b c) $ (?# then end)/ + ab c + *** Failers + abc + ab cde + +/^ a\ b[c ]d $/x + a bcd + a b d + *** Failers + abcd + ab d + +/^(a(b(c)))(d(e(f)))(h(i(j)))(k(l(m)))$/ + abcdefhijklm + +/^(?:a(b(c)))(?:d(e(f)))(?:h(i(j)))(?:k(l(m)))$/ + abcdefhijklm + +/^[\w][\W][\s][\S][\d][\D][\b][\n][\c]][\022]/ + a+ Z0+\x08\n\x1d\x12 + +/^[.^$|()*+?{,}]+/ + .^\$(*+)|{?,?} + +/^a*\w/ + z + az + aaaz + a + aa + aaaa + a+ + aa+ + +/^a*?\w/ + z + az + aaaz + a + aa + aaaa + a+ + aa+ + +/^a+\w/ + az + aaaz + aa + aaaa + aa+ + +/^a+?\w/ + az + aaaz + aa + aaaa + aa+ + +/^\d{8}\w{2,}/ + 1234567890 + 12345678ab + 12345678__ + *** Failers + 1234567 + +/^[aeiou\d]{4,5}$/ + uoie + 1234 + 12345 + aaaaa + *** Failers + 123456 + +/^[aeiou\d]{4,5}?/ + uoie + 1234 + 12345 + aaaaa + 123456 + +/\A(abc|def)=(\1){2,3}\Z/ + abc=abcabc + def=defdefdef + *** Failers + abc=defdef + +/^(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)\11*(\3\4)\1(?#)2$/ + abcdefghijkcda2 + abcdefghijkkkkcda2 + +/(cat(a(ract|tonic)|erpillar)) \1()2(3)/ + cataract cataract23 + catatonic catatonic23 + caterpillar caterpillar23 + + +/^From +([^ ]+) +[a-zA-Z][a-zA-Z][a-zA-Z] +[a-zA-Z][a-zA-Z][a-zA-Z] +[0-9]?[0-9] +[0-9][0-9]:[0-9][0-9]/ + From abcd Mon Sep 01 12:33:02 1997 + +/^From\s+\S+\s+([a-zA-Z]{3}\s+){2}\d{1,2}\s+\d\d:\d\d/ + From abcd Mon Sep 01 12:33:02 1997 + From abcd Mon Sep 1 12:33:02 1997 + *** Failers + From abcd Sep 01 12:33:02 1997 + +/^12.34/s + 12\n34 + 12\r34 + +/\w+(?=\t)/ + the quick brown\t fox + +/foo(?!bar)(.*)/ + foobar is foolish see? + +/(?:(?!foo)...|^.{0,2})bar(.*)/ + foobar crowbar etc + barrel + 2barrel + A barrel + +/^(\D*)(?=\d)(?!123)/ + abc456 + *** Failers + abc123 + +/^1234(?# test newlines + inside)/ + 1234 + +/^1234 #comment in extended re + /x + 1234 + +/#rhubarb + abcd/x + abcd + +/^abcd#rhubarb/x + abcd + +/^(a)\1{2,3}(.)/ + aaab + aaaab + aaaaab + aaaaaab + +/(?!^)abc/ + the abc + *** Failers + abc + +/(?=^)abc/ + abc + *** Failers + the abc + +/^[ab]{1,3}(ab*|b)/ + aabbbbb + +/^[ab]{1,3}?(ab*|b)/ + aabbbbb + +/^[ab]{1,3}?(ab*?|b)/ + aabbbbb + +/^[ab]{1,3}(ab*?|b)/ + aabbbbb + +/ (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* # optional leading comment +(?: (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +" (?: # opening quote... +[^\\\x80-\xff\n\015"] # Anything except backslash and quote +| # or +\\ [^\x80-\xff] # Escaped something (something != CR) +)* " # closing quote +) # initial word +(?: (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* \. (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +" (?: # opening quote... +[^\\\x80-\xff\n\015"] # Anything except backslash and quote +| # or +\\ [^\x80-\xff] # Escaped something (something != CR) +)* " # closing quote +) )* # further okay, if led by a period +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* @ (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| \[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) # initial subdomain +(?: # +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* \. # if led by a period... +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| \[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) # ...further okay +)* +# address +| # or +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +" (?: # opening quote... +[^\\\x80-\xff\n\015"] # Anything except backslash and quote +| # or +\\ [^\x80-\xff] # Escaped something (something != CR) +)* " # closing quote +) # one word, optionally followed by.... +(?: +[^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] | # atom and space parts, or... +\( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) | # comments, or... + +" (?: # opening quote... +[^\\\x80-\xff\n\015"] # Anything except backslash and quote +| # or +\\ [^\x80-\xff] # Escaped something (something != CR) +)* " # closing quote +# quoted strings +)* +< (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* # leading < +(?: @ (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| \[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) # initial subdomain +(?: # +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* \. # if led by a period... +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| \[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) # ...further okay +)* + +(?: (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* , (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* @ (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| \[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) # initial subdomain +(?: # +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* \. # if led by a period... +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| \[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) # ...further okay +)* +)* # further okay, if led by comma +: # closing colon +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* )? # optional route +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +" (?: # opening quote... +[^\\\x80-\xff\n\015"] # Anything except backslash and quote +| # or +\\ [^\x80-\xff] # Escaped something (something != CR) +)* " # closing quote +) # initial word +(?: (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* \. (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +" (?: # opening quote... +[^\\\x80-\xff\n\015"] # Anything except backslash and quote +| # or +\\ [^\x80-\xff] # Escaped something (something != CR) +)* " # closing quote +) )* # further okay, if led by a period +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* @ (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| \[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) # initial subdomain +(?: # +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* \. # if led by a period... +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| \[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) # ...further okay +)* +# address spec +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* > # trailing > +# name and address +) (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* # optional trailing comment +/x + Alan Other + + user\@dom.ain + \"A. Other\" (a comment) + A. Other (a comment) + \"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"\@x400-re.lay + A missing angle @,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +# Atom +| # or +" # " +[^\\\x80-\xff\n\015"] * # normal +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* +" # " +# Quoted string +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +\. +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +# Atom +| # or +" # " +[^\\\x80-\xff\n\015"] * # normal +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* +" # " +# Quoted string +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# additional words +)* +@ +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +\[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# optional trailing comments +(?: +\. +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +\[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# optional trailing comments +)* +# address +| # or +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +# Atom +| # or +" # " +[^\\\x80-\xff\n\015"] * # normal +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* +" # " +# Quoted string +) +# leading word +[^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] * # "normal" atoms and or spaces +(?: +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +| +" # " +[^\\\x80-\xff\n\015"] * # normal +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* +" # " +) # "special" comment or quoted string +[^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] * # more "normal" +)* +< +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# < +(?: +@ +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +\[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# optional trailing comments +(?: +\. +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +\[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# optional trailing comments +)* +(?: , +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +@ +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +\[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# optional trailing comments +(?: +\. +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +\[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# optional trailing comments +)* +)* # additional domains +: +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# optional trailing comments +)? # optional route +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +# Atom +| # or +" # " +[^\\\x80-\xff\n\015"] * # normal +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* +" # " +# Quoted string +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +\. +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +# Atom +| # or +" # " +[^\\\x80-\xff\n\015"] * # normal +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* +" # " +# Quoted string +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# additional words +)* +@ +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +\[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# optional trailing comments +(?: +\. +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +\[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# optional trailing comments +)* +# address spec +> # > +# name and address +) +/x + Alan Other + + user\@dom.ain + \"A. Other\" (a comment) + A. Other (a comment) + \"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"\@x400-re.lay + A missing angle ]{0,})>]{0,})>([\d]{0,}\.)(.*)((
    ([\w\W\s\d][^<>]{0,})|[\s]{0,}))<\/a><\/TD>]{0,})>([\w\W\s\d][^<>]{0,})<\/TD>]{0,})>([\w\W\s\d][^<>]{0,})<\/TD><\/TR>/is + 43.Word Processor
    (N-1286)
    Lega lstaff.comCA - Statewide + +/a[^a]b/ + acb + a\nb + +/a.b/ + acb + *** Failers + a\nb + +/a[^a]b/s + acb + a\nb + +/a.b/s + acb + a\nb + +/^(b+?|a){1,2}?c/ + bac + bbac + bbbac + bbbbac + bbbbbac + +/^(b+|a){1,2}?c/ + bac + bbac + bbbac + bbbbac + bbbbbac + +/(?!\A)x/m + x\nb\n + a\bx\n + +/\x0{ab}/ + \0{ab} + +/(A|B)*?CD/ + CD + +/(A|B)*CD/ + CD + +/(AB)*?\1/ + ABABAB + +/(AB)*\1/ + ABABAB + +/(?.*/)foo" + /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/it/you/see/ + +"(?>.*/)foo" + /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/and/foo + +/(?>(\.\d\d[1-9]?))\d+/ + 1.230003938 + 1.875000282 + *** Failers + 1.235 + +/^((?>\w+)|(?>\s+))*$/ + now is the time for all good men to come to the aid of the party + *** Failers + this is not a line with only words and spaces! + +/(\d+)(\w)/ + 12345a + 12345+ + +/((?>\d+))(\w)/ + 12345a + *** Failers + 12345+ + +/(?>a+)b/ + aaab + +/((?>a+)b)/ + aaab + +/(?>(a+))b/ + aaab + +/(?>b)+/ + aaabbbccc + +/(?>a+|b+|c+)*c/ + aaabbbbccccd + +/((?>[^()]+)|\([^()]*\))+/ + ((abc(ade)ufh()()x + +/\(((?>[^()]+)|\([^()]+\))+\)/ + (abc) + (abc(def)xyz) + *** Failers + ((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + +/a(?-i)b/i + ab + Ab + *** Failers + aB + AB + +/(a (?x)b c)d e/ + a bcd e + *** Failers + a b cd e + abcd e + a bcde + +/(a b(?x)c d (?-x)e f)/ + a bcde f + *** Failers + abcdef + +/(a(?i)b)c/ + abc + aBc + *** Failers + abC + aBC + Abc + ABc + ABC + AbC + +/a(?i:b)c/ + abc + aBc + *** Failers + ABC + abC + aBC + +/a(?i:b)*c/ + aBc + aBBc + *** Failers + aBC + aBBC + +/a(?=b(?i)c)\w\wd/ + abcd + abCd + *** Failers + aBCd + abcD + +/(?s-i:more.*than).*million/i + more than million + more than MILLION + more \n than Million + *** Failers + MORE THAN MILLION + more \n than \n million + +/(?:(?s-i)more.*than).*million/i + more than million + more than MILLION + more \n than Million + *** Failers + MORE THAN MILLION + more \n than \n million + +/(?>a(?i)b+)+c/ + abc + aBbc + aBBc + *** Failers + Abc + abAb + abbC + +/(?=a(?i)b)\w\wc/ + abc + aBc + *** Failers + Ab + abC + aBC + +/(?<=a(?i)b)(\w\w)c/ + abxxc + aBxxc + *** Failers + Abxxc + ABxxc + abxxC + +/(?:(a)|b)(?(1)A|B)/ + aA + bB + *** Failers + aB + bA + +/^(a)?(?(1)a|b)+$/ + aa + b + bb + *** Failers + ab + +/^(?(?=abc)\w{3}:|\d\d)$/ + abc: + 12 + *** Failers + 123 + xyz + +/^(?(?!abc)\d\d|\w{3}:)$/ + abc: + 12 + *** Failers + 123 + xyz + +/(?(?<=foo)bar|cat)/ + foobar + cat + fcat + focat + *** Failers + foocat + +/(?(?a*)*/ + a + aa + aaaa + +/(abc|)+/ + abc + abcabc + abcabcabc + xyz + +/([a]*)*/ + a + aaaaa + +/([ab]*)*/ + a + b + ababab + aaaabcde + bbbb + +/([^a]*)*/ + b + bbbb + aaa + +/([^ab]*)*/ + cccc + abab + +/([a]*?)*/ + a + aaaa + +/([ab]*?)*/ + a + b + abab + baba + +/([^a]*?)*/ + b + bbbb + aaa + +/([^ab]*?)*/ + c + cccc + baba + +/(?>a*)*/ + a + aaabcde + +/((?>a*))*/ + aaaaa + aabbaa + +/((?>a*?))*/ + aaaaa + aabbaa + +/(?(?=[^a-z]+[a-z]) \d{2}-[a-z]{3}-\d{2} | \d{2}-\d{2}-\d{2} ) /x + 12-sep-98 + 12-09-98 + *** Failers + sep-12-98 + +/(?<=(foo))bar\1/ + foobarfoo + foobarfootling + *** Failers + foobar + barfoo + +/(?i:saturday|sunday)/ + saturday + sunday + Saturday + Sunday + SATURDAY + SUNDAY + SunDay + +/(a(?i)bc|BB)x/ + abcx + aBCx + bbx + BBx + *** Failers + abcX + aBCX + bbX + BBX + +/^([ab](?i)[cd]|[ef])/ + ac + aC + bD + elephant + Europe + frog + France + *** Failers + Africa + +/^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)/ + ab + aBd + xy + xY + zebra + Zambesi + *** Failers + aCD + XY + +/(?<=foo\n)^bar/m + foo\nbar + *** Failers + bar + baz\nbar + +/(?<=(?]&/ + <&OUT + +/^(a\1?){4}$/ + aaaaaaaaaa + *** Failers + AB + aaaaaaaaa + aaaaaaaaaaa + +/^(a(?(1)\1)){4}$/ + aaaaaaaaaa + *** Failers + aaaaaaaaa + aaaaaaaaaaa + +/(?:(f)(o)(o)|(b)(a)(r))*/ + foobar + +/(?<=a)b/ + ab + *** Failers + cb + b + +/(?a+)ab/ + +/(?>a+)b/ + aaab + +/([[:]+)/ + a:[b]: + +/([[=]+)/ + a=[b]= + +/([[.]+)/ + a.[b]. + +/((?>a+)b)/ + aaab + +/(?>(a+))b/ + aaab + +/((?>[^()]+)|\([^()]*\))+/ + ((abc(ade)ufh()()x + +/a\Z/ + *** Failers + aaab + a\nb\n + +/b\Z/ + a\nb\n + +/b\z/ + +/b\Z/ + a\nb + +/b\z/ + a\nb + *** Failers + +/^(?>(?(1)\.|())[^\W_](?>[a-z0-9-]*[^\W_])?)+$/ + a + abc + a-b + 0-9 + a.b + 5.6.7 + the.quick.brown.fox + a100.b200.300c + 12-ab.1245 + *** Failers + \ + .a + -a + a- + a. + a_b + a.- + a.. + ab..bc + the.quick.brown.fox- + the.quick.brown.fox. + the.quick.brown.fox_ + the.quick.brown.fox+ + +/(?>.*)(?<=(abcd|wxyz))/ + alphabetabcd + endingwxyz + *** Failers + a rather long string that doesn't end with one of them + +/word (?>(?:(?!otherword)[a-zA-Z0-9]+ ){0,30})otherword/ + word cat dog elephant mussel cow horse canary baboon snake shark otherword + word cat dog elephant mussel cow horse canary baboon snake shark + +/word (?>[a-zA-Z0-9]+ ){0,30}otherword/ + word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope + +/(?<=\d{3}(?!999))foo/ + 999foo + 123999foo + *** Failers + 123abcfoo + +/(?<=(?!...999)\d{3})foo/ + 999foo + 123999foo + *** Failers + 123abcfoo + +/(?<=\d{3}(?!999)...)foo/ + 123abcfoo + 123456foo + *** Failers + 123999foo + +/(?<=\d{3}...)(?\s*)=(?>\s*) # find Z)+|A)*/ + ZABCDEFG + +/((?>)+|A)*/ + ZABCDEFG + +/a*/g + abbab + +/^[a-\d]/ + abcde + -things + 0digit + *** Failers + bcdef + +/^[\d-a]/ + abcde + -things + 0digit + *** Failers + bcdef + +/[[:space:]]+/ + > \x09\x0a\x0c\x0d\x0b< + +/[[:blank:]]+/ + > \x09\x0a\x0c\x0d\x0b< + +/[\s]+/ + > \x09\x0a\x0c\x0d\x0b< + +/\s+/ + > \x09\x0a\x0c\x0d\x0b< + +/a b/x + ab + +/(?!\A)x/m + a\nxb\n + +/(?!^)x/m + a\nxb\n + +/abc\Qabc\Eabc/ + abcabcabc + +/abc\Q(*+|\Eabc/ + abc(*+|abc + +/ abc\Q abc\Eabc/x + abc abcabc + *** Failers + abcabcabc + +/abc#comment + \Q#not comment + literal\E/x + abc#not comment\n literal + +/abc#comment + \Q#not comment + literal/x + abc#not comment\n literal + +/abc#comment + \Q#not comment + literal\E #more comment + /x + abc#not comment\n literal + +/abc#comment + \Q#not comment + literal\E #more comment/x + abc#not comment\n literal + +/\Qabc\$xyz\E/ + abc\\\$xyz + +/\Qabc\E\$\Qxyz\E/ + abc\$xyz + +/\Gabc/ + abc + *** Failers + xyzabc + +/\Gabc./g + abc1abc2xyzabc3 + +/abc./g + abc1abc2xyzabc3 + +/a(?x: b c )d/ + XabcdY + *** Failers + Xa b c d Y + +/((?x)x y z | a b c)/ + XabcY + AxyzB + +/(?i)AB(?-i)C/ + XabCY + *** Failers + XabcY + +/((?i)AB(?-i)C|D)E/ + abCE + DE + *** Failers + abcE + abCe + dE + De + +/(.*)\d+\1/ + abc123abc + abc123bc + +/(.*)\d+\1/s + abc123abc + abc123bc + +/((.*))\d+\1/ + abc123abc + abc123bc + +/-- This tests for an IPv6 address in the form where it can have up to --/ +/-- eight components, one and only one of which is empty. This must be --/ +/-- an internal component. --/ + +/^(?!:) # colon disallowed at start + (?: # start of item + (?: [0-9a-f]{1,4} | # 1-4 hex digits or + (?(1)0 | () ) ) # if null previously matched, fail; else null + : # followed by colon + ){1,7} # end item; 1-7 of them required + [0-9a-f]{1,4} $ # final hex number at end of string + (?(1)|.) # check that there was an empty component + /xi + a123::a123 + a123:b342::abcd + a123:b342::324e:abcd + a123:ddde:b342::324e:abcd + a123:ddde:b342::324e:dcba:abcd + a123:ddde:9999:b342::324e:dcba:abcd + *** Failers + 1:2:3:4:5:6:7:8 + a123:bce:ddde:9999:b342::324e:dcba:abcd + a123::9999:b342::324e:dcba:abcd + abcde:2:3:4:5:6:7:8 + ::1 + abcd:fee0:123:: + :1 + 1: + +/[z\Qa-d]\E]/ + z + a + - + d + ] + *** Failers + b + +/[\z\C]/ + z + C + +/\M/ + M + +/(a+)*b/ + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + +/(?i)reg(?:ul(?:[aä]|ae)r|ex)/ + REGular + regulaer + Regex + regulär + +/Åæåä[à-ÿÀ-ß]+/ + Åæåäà + Åæåäÿ + ÅæåäÀ + Åæåäß + +/(?<=Z)X./ + \x84XAZXB + +/ab cd (?x) de fg/ + ab cd defg + +/ab cd(?x) de fg/ + ab cddefg + ** Failers + abcddefg + +/ End of testinput1 / diff --git a/mozilla/js/tamarin/pcre/testdata/testinput2 b/mozilla/js/tamarin/pcre/testdata/testinput2 new file mode 100644 index 00000000000..befb65a4412 --- /dev/null +++ b/mozilla/js/tamarin/pcre/testdata/testinput2 @@ -0,0 +1,1453 @@ +/(a)b|/ + +/abc/ + abc + defabc + \Aabc + *** Failers + \Adefabc + ABC + +/^abc/ + abc + \Aabc + *** Failers + defabc + \Adefabc + +/a+bc/ + +/a*bc/ + +/a{3}bc/ + +/(abc|a+z)/ + +/^abc$/ + abc + *** Failers + def\nabc + +/ab\gdef/X + +/(?X)ab\gdef/X + +/x{5,4}/ + +/z{65536}/ + +/[abcd/ + +/(?X)[\B]/ + +/[z-a]/ + +/^*/ + +/(abc/ + +/(?# abc/ + +/(?z)abc/ + +/.*b/ + +/.*?b/ + +/cat|dog|elephant/ + this sentence eventually mentions a cat + this sentences rambles on and on for a while and then reaches elephant + +/cat|dog|elephant/S + this sentence eventually mentions a cat + this sentences rambles on and on for a while and then reaches elephant + +/cat|dog|elephant/iS + this sentence eventually mentions a CAT cat + this sentences rambles on and on for a while to elephant ElePhant + +/a|[bcd]/S + +/(a|[^\dZ])/S + +/(a|b)*[\s]/S + +/(ab\2)/ + +/{4,5}abc/ + +/(a)(b)(c)\2/ + abcb + \O0abcb + \O3abcb + \O6abcb + \O9abcb + \O12abcb + +/(a)bc|(a)(b)\2/ + abc + \O0abc + \O3abc + \O6abc + aba + \O0aba + \O3aba + \O6aba + \O9aba + \O12aba + +/abc$/E + abc + *** Failers + abc\n + abc\ndef + +/(a)(b)(c)(d)(e)\6/ + +/the quick brown fox/ + the quick brown fox + this is a line with the quick brown fox + +/the quick brown fox/A + the quick brown fox + *** Failers + this is a line with the quick brown fox + +/ab(?z)cd/ + +/^abc|def/ + abcdef + abcdef\B + +/.*((abc)$|(def))/ + defabc + \Zdefabc + +/abc/P + abc + *** Failers + +/^abc|def/P + abcdef + abcdef\B + +/.*((abc)$|(def))/P + defabc + \Zdefabc + +/the quick brown fox/P + the quick brown fox + *** Failers + The Quick Brown Fox + +/the quick brown fox/Pi + the quick brown fox + The Quick Brown Fox + +/abc.def/P + *** Failers + abc\ndef + +/abc$/P + abc + abc\n + +/(abc)\2/P + +/(abc\1)/P + abc + +/)/ + +/a[]b/ + +/[^aeiou ]{3,}/ + co-processors, and for + +/<.*>/ + abcghinop + +/<.*?>/ + abcghinop + +/<.*>/U + abcghinop + +/(?U)<.*>/ + abcghinop + +/<.*?>/U + abcghinop + +/={3,}/U + abc========def + +/(?U)={3,}?/ + abc========def + +/(?^abc)/m + abc + def\nabc + *** Failers + defabc + +/(?<=ab(c+)d)ef/ + +/(?<=ab(?<=c+)d)ef/ + +/(?<=ab(c|de)f)g/ + +/The next three are in testinput2 because they have variable length branches/ + +/(?<=bullock|donkey)-cart/ + the bullock-cart + a donkey-cart race + *** Failers + cart + horse-and-cart + +/(?<=ab(?i)x|y|z)/ + +/(?>.*)(?<=(abcd)|(xyz))/ + alphabetabcd + endingxyz + +/(?<=ab(?i)x(?-i)y|(?i)z|b)ZZ/ + abxyZZ + abXyZZ + ZZZ + zZZ + bZZ + BZZ + *** Failers + ZZ + abXYZZ + zzz + bzz + +/(?[^()]+) # Either a sequence of non-brackets (no backtracking) + | # Or + (?R) # Recurse - i.e. nested bracketed string + )* # Zero or more contents + \) # Closing ) + /x + (abcd) + (abcd)xyz + xyz(abcd) + (ab(xy)cd)pqr + (ab(xycd)pqr + () abc () + 12(abcde(fsh)xyz(foo(bar))lmno)89 + *** Failers + abcd + abcd) + (abcd + +/\( ( (?>[^()]+) | (?R) )* \) /xg + (ab(xy)cd)pqr + 1(abcd)(x(y)z)pqr + +/\( (?: (?>[^()]+) | (?R) ) \) /x + (abcd) + (ab(xy)cd) + (a(b(c)d)e) + ((ab)) + *** Failers + () + +/\( (?: (?>[^()]+) | (?R) )? \) /x + () + 12(abcde(fsh)xyz(foo(bar))lmno)89 + +/\( ( (?>[^()]+) | (?R) )* \) /x + (ab(xy)cd) + +/\( ( ( (?>[^()]+) | (?R) )* ) \) /x + (ab(xy)cd) + +/\( (123)? ( ( (?>[^()]+) | (?R) )* ) \) /x + (ab(xy)cd) + (123ab(xy)cd) + +/\( ( (123)? ( (?>[^()]+) | (?R) )* ) \) /x + (ab(xy)cd) + (123ab(xy)cd) + +/\( (((((((((( ( (?>[^()]+) | (?R) )* )))))))))) \) /x + (ab(xy)cd) + +/\( ( ( (?>[^()<>]+) | ((?>[^()]+)) | (?R) )* ) \) /x + (abcd(xyz

    qrs)123) + +/\( ( ( (?>[^()]+) | ((?R)) )* ) \) /x + (ab(cd)ef) + (ab(cd(ef)gh)ij) + +/^[[:alnum:]]/D + +/^[[:^alnum:]]/D + +/^[[:alpha:]]/D + +/^[[:^alpha:]]/D + +/^[[:ascii:]]/D + +/^[[:^ascii:]]/D + +/^[[:blank:]]/D + +/^[[:cntrl:]]/D + +/^[[:digit:]]/D + +/^[[:graph:]]/D + +/^[[:lower:]]/D + +/^[[:print:]]/D + +/^[[:punct:]]/D + +/^[[:space:]]/D + +/^[[:upper:]]/D + +/^[[:xdigit:]]/D + +/^[[:word:]]/D + +/^[[:^cntrl:]]/D + +/^[12[:^digit:]]/D + +/^[[:^blank:]]/D + +/[01[:alpha:]%]/D + +/[[.ch.]]/ + +/[[=ch=]]/ + +/[[:rhubarb:]]/ + +/[[:upper:]]/i + A + a + +/[[:lower:]]/i + A + a + +/((?-i)[[:lower:]])[[:lower:]]/i + ab + aB + *** Failers + Ab + AB + +/[\200-\410]/ + +/^(?(0)f|b)oo/ + +/This one's here because of the large output vector needed/ + +/(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\w+)\s+(\270)/ + \O900 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 ABC ABC + +/This one's here because Perl does this differently and PCRE can't at present/ + +/(main(O)?)+/ + mainmain + mainOmain + +/These are all cases where Perl does it differently (nested captures)/ + +/^(a(b)?)+$/ + aba + +/^(aa(bb)?)+$/ + aabbaa + +/^(aa|aa(bb))+$/ + aabbaa + +/^(aa(bb)??)+$/ + aabbaa + +/^(?:aa(bb)?)+$/ + aabbaa + +/^(aa(b(b))?)+$/ + aabbaa + +/^(?:aa(b(b))?)+$/ + aabbaa + +/^(?:aa(b(?:b))?)+$/ + aabbaa + +/^(?:aa(bb(?:b))?)+$/ + aabbbaa + +/^(?:aa(b(?:bb))?)+$/ + aabbbaa + +/^(?:aa(?:b(b))?)+$/ + aabbaa + +/^(?:aa(?:b(bb))?)+$/ + aabbbaa + +/^(aa(b(bb))?)+$/ + aabbbaa + +/^(aa(bb(bb))?)+$/ + aabbbbaa + +/--------------------------------------------------------------------/ + +/#/xMD + +/a#/xMD + +/[\s]/D + +/[\S]/D + +/a(?i)b/D + ab + aB + *** Failers + AB + +/(a(?i)b)/D + ab + aB + *** Failers + AB + +/ (?i)abc/xD + +/#this is a comment + (?i)abc/xD + +/123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890/D + +/\Q123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890/D + +/\Q\E/D + \ + +/\Q\Ex/D + +/ \Q\E/D + +/a\Q\E/D + abc + bca + bac + +/a\Q\Eb/D + abc + +/\Q\Eabc/D + +/x*+\w/D + *** Failers + xxxxx + +/x?+/D + +/x++/D + +/x{1,3}+/D + +/(x)*+/D + +/^(\w++|\s++)*$/ + now is the time for all good men to come to the aid of the party + *** Failers + this is not a line with only words and spaces! + +/(\d++)(\w)/ + 12345a + *** Failers + 12345+ + +/a++b/ + aaab + +/(a++b)/ + aaab + +/(a++)b/ + aaab + +/([^()]++|\([^()]*\))+/ + ((abc(ade)ufh()()x + +/\(([^()]++|\([^()]+\))+\)/ + (abc) + (abc(def)xyz) + *** Failers + ((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + +/(abc){1,3}+/D + +/a+?+/ + +/a{2,3}?+b/ + +/(?U)a+?+/ + +/a{2,3}?+b/U + +/x(?U)a++b/D + xaaaab + +/(?U)xa++b/D + xaaaab + +/^((a+)(?U)([ab]+)(?-U)([bc]+)(\w*))/D + +/^x(?U)a+b/D + +/^x(?U)(a+)b/D + +/[.x.]/ + +/[=x=]/ + +/[:x:]/ + +/\l/ + +/\L/ + +/\N{name}/ + +/\u/ + +/\U/ + +/[/ + +/[a-/ + +/[[:space:]/ + +/[\s]/DM + +/[[:space:]]/DM + +/[[:space:]abcde]/DM + +/< (?: (?(R) \d++ | [^<>]*+) | (?R)) * >/x + <> + + hij> + hij> + def> + + *** Failers + iV\;\?aPhFB\<\*vW\@QW\@sO9\}cfZA\-i\'w\%hKd6gt1UJP\,15_\#QY\$M\^Mss_U\/\]\&LK9\[5vQub\^w\[KDD\qmj\;2\}YWFdYx\.Ap\]hjCPTP\(n28k\+3\;o\&WXqs\/gOXdr\$\:r\'do0\;b4c\(f_Gr\=\"\\4\)\[01T7ajQJvL\$W\~mL_sS\/4h\:x\*\[ZN\=KLs\&L5zX\/\/\>it\,o\:aU\(\;Z\>pW\&T7oP\'2K\^E\:x9\'c\[\%z\-\,64JQ5AeH_G\#KijUKghQw\^\\vea3a\?kka_G\$8\#\`\*kynsxzBLru\'\]k_\[7FrVx\}\^\=\$blx\>s\-N\%j\;D\*aZDnsw\:YKZ\%Q\.Kne9\#hP\?\+b3\(SOvL\,\^\;\&u5\@\?5C5Bhb\=m\-vEh_L15Jl\]U\)0RP6\{q\%L\^_z5E\'Dw6X\b|DM + +|\$\<\.X\+ix\[d1b\!H\#\?vV0vrK\:ZH1\=2M\>iV\;\?aPhFB\<\*vW\@QW\@sO9\}cfZA\-i\'w\%hKd6gt1UJP\,15_\#QY\$M\^Mss_U\/\]\&LK9\[5vQub\^w\[KDD\qmj\;2\}YWFdYx\.Ap\]hjCPTP\(n28k\+3\;o\&WXqs\/gOXdr\$\:r\'do0\;b4c\(f_Gr\=\"\\4\)\[01T7ajQJvL\$W\~mL_sS\/4h\:x\*\[ZN\=KLs\&L5zX\/\/\>it\,o\:aU\(\;Z\>pW\&T7oP\'2K\^E\:x9\'c\[\%z\-\,64JQ5AeH_G\#KijUKghQw\^\\vea3a\?kka_G\$8\#\`\*kynsxzBLru\'\]k_\[7FrVx\}\^\=\$blx\>s\-N\%j\;D\*aZDnsw\:YKZ\%Q\.Kne9\#hP\?\+b3\(SOvL\,\^\;\&u5\@\?5C5Bhb\=m\-vEh_L15Jl\]U\)0RP6\{q\%L\^_z5E\'Dw6X\b|DM + +/(.*)\d+\1/I + +/(.*)\d+/I + +/(.*)\d+\1/Is + +/(.*)\d+/Is + +/(.*(xyz))\d+\2/I + +/((.*))\d+\1/I + abc123bc + +/a[b]/I + +/(?=a).*/I + +/(?=abc).xyz/iI + +/(?=abc)(?i).xyz/I + +/(?=a)(?=b)/I + +/(?=.)a/I + +/((?=abcda)a)/I + +/((?=abcda)ab)/I + +/()a/I + +/(?(1)ab|ac)/I + +/(?(1)abz|acz)/I + +/(?(1)abz)/I + +/(?(1)abz)123/I + +/(a)+/I + +/(a){2,3}/I + +/(a)*/I + +/[a]/I + +/[ab]/I + +/[ab]/IS + +/[^a]/I + +/\d456/I + +/\d456/IS + +/a^b/I + +/^a/mI + abcde + xy\nabc + *** Failers + xyabc + +/c|abc/I + +/(?i)[ab]/IS + +/[ab](?i)cd/IS + +/abc(?C)def/ + abcdef + 1234abcdef + *** Failers + abcxyz + abcxyzf + +/abc(?C)de(?C1)f/ + 123abcdef + +/(?C1)\dabc(?C2)def/ + 1234abcdef + *** Failers + abcdef + +/(?C255)ab/ + +/(?C256)ab/ + +/(?Cab)xx/ + +/(?C12vr)x/ + +/abc(?C)def/ + *** Failers + \x83\x0\x61bcdef + +/(abc)(?C)de(?C1)f/ + 123abcdef + 123abcdef\C+ + 123abcdef\C- + *** Failers + 123abcdef\C!1 + +/(?C0)(abc(?C1))*/ + abcabcabc + abcabc\C!1!3 + *** Failers + abcabcabc\C!1!3 + +/(\d{3}(?C))*/ + 123\C+ + 123456\C+ + 123456789\C+ + +/((xyz)(?C)p|(?C1)xyzabc)/ + xyzabc\C+ + +/(X)((xyz)(?C)p|(?C1)xyzabc)/ + Xxyzabc\C+ + +/(?=(abc))(?C)abcdef/ + abcdef\C+ + +/(?!(abc)(?C1)d)(?C2)abcxyz/ + abcxyz\C+ + +/(?<=(abc)(?C))xyz/ + abcxyz\C+ + +/a(b+)(c*)(?C1)/ + abbbbbccc\C*1 + +/a(b+?)(c*?)(?C1)/ + abbbbbccc\C*1 + +/(?C)abc/ + +/(?C)^abc/ + +/(?C)a|b/S + +/(?R)/ + +/(a|(?R))/ + +/(ab|(bc|(de|(?R))))/ + +/x(ab|(bc|(de|(?R))))/ + xab + xbc + xde + xxab + xxxab + *** Failers + xyab + +/(ab|(bc|(de|(?1))))/ + +/x(ab|(bc|(de|(?1)x)x)x)/ + +/^([^()]|\((?1)*\))*$/ + abc + a(b)c + a(b(c))d + *** Failers) + a(b(c)d + +/^>abc>([^()]|\((?1)*\))*abc>123abc>1(2)3abc>(1(2)3)]*+) | (?2)) * >))/x + <> + + hij> + hij> + def> + + *** Failers + b|c)d(?Pe)/D + abde + acde + +/(?:a(?Pc(?Pd)))(?Pa)/D + +/(?Pa)...(?P=a)bbb(?P>a)d/D + +/^\W*(?:(?P(?P.)\W*(?P>one)\W*(?P=two)|)|(?P(?P.)\W*(?P>three)\W*(?P=four)|\W*.\W*))\W*$/i + 1221 + Satan, oscillate my metallic sonatas! + A man, a plan, a canal: Panama! + Able was I ere I saw Elba. + *** Failers + The quick brown fox + +/((?(R)a|b))\1(?1)?/ + bb + bbaa + +/(.*)a/sI + +/(.*)a\1/sI + +/(.*)a(b)\2/sI + +/((.*)a|(.*)b)z/sI + +/((.*)a|(.*)b)z\1/sI + +/((.*)a|(.*)b)z\2/sI + +/((.*)a|(.*)b)z\3/sI + +/((.*)a|^(.*)b)z\3/sI + +/(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)a/sI + +/(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)a\31/sI + +/(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)a\32/sI + +/(a)(bc)/ND + abc + +/(?Pa)(bc)/ND + abc + +/(a)(?Pbc)/ND + +/(a+)*zz/ + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaazzbbbbbb\M + aaaaaaaaaaaaaz\M + +/(aaa(?C1)bbb|ab)/ + aaabbb + aaabbb\C*0 + aaabbb\C*1 + aaabbb\C*-1 + +/ab(?Pcd)ef(?Pgh)/ + abcdefgh + abcdefgh\C1\Gtwo + abcdefgh\Cone\Ctwo + abcdefgh\Cthree + +/(?P)(?P)/D + +/(?P)(?P)/D + +/(?Pzz)(?Paa)/ + zzaa\CZ + zzaa\CA + +/(?Peks)(?Peccs)/ + +/(?Pabc(?Pdef)(?Pxyz))/ + +"\[((?P\d+)(,(?P>elem))*)\]" + [10,20,30,5,5,4,4,2,43,23,4234] + *** Failers + [] + +"\[((?P\d+)(,(?P>elem))*)?\]" + [10,20,30,5,5,4,4,2,43,23,4234] + [] + +/(a(b(?2)c))?/D + +/(a(b(?2)c))*/D + +/(a(b(?2)c)){0,2}/D + +/[ab]{1}+/D + +/((w\/|-|with)*(free|immediate)*.*?shipping\s*[!.-]*)/i + Baby Bjorn Active Carrier - With free SHIPPING!! + +/((w\/|-|with)*(free|immediate)*.*?shipping\s*[!.-]*)/iS + Baby Bjorn Active Carrier - With free SHIPPING!! + +/a*.*b/SD + +/(a|b)*.?c/SD + +/abc(?C255)de(?C)f/D + +/abcde/CD + abcde + abcdfe + +/a*b/CD + ab + aaaab + aaaacb + +/a+b/CD + ab + aaaab + aaaacb + +/(abc|def)x/CD + abcx + defx + abcdefzx + +/(ab|cd){3,4}/C + ababab + abcdabcd + abcdcdcdcdcd + +/([ab]{,4}c|xy)/CD + Note: that { does NOT introduce a quantifier + +/([ab]{1,4}c|xy){4,5}?123/CD + aacaacaacaacaac123 + +/\b.*/I + ab cd\>1 + +/\b.*/Is + ab cd\>1 + +/(?!.bcd).*/I + Xbcd12345 + +/abcde/ + ab\P + abc\P + abcd\P + abcde\P + the quick brown abc\P + ** Failers\P + the quick brown abxyz fox\P + +"^(0?[1-9]|[12][0-9]|3[01])/(0?[1-9]|1[012])/(20)?\d\d$" + 13/05/04\P + 13/5/2004\P + 02/05/09\P + 1\P + 1/2\P + 1/2/0\P + 1/2/04\P + 0\P + 02/\P + 02/0\P + 02/1\P + ** Failers\P + \P + 123\P + 33/4/04\P + 3/13/04\P + 0/1/2003\P + 0/\P + 02/0/\P + 02/13\P + +/0{0,2}ABC/I + +/\d{3,}ABC/I + +/\d*ABC/I + +/[abc]+DE/I + +/[abc]?123/ + 123\P + a\P + b\P + c\P + c12\P + c123\P + +/^(?:\d){3,5}X/ + 1\P + 123\P + 123X + 1234\P + 1234X + 12345\P + 12345X + *** Failers + 1X + 123456\P + +/abc/>testsavedregex +testsavedregex +testsavedregex +testsavedregex +(.)*~smg + \n\n\nPartner der LCO\nde\nPartner der LINEAS Consulting\nGmbH\nLINEAS Consulting GmbH Hamburg\nPartnerfirmen\n30 days\nindex,follow\n\nja\n3\nPartner\n\n\nLCO\nLINEAS Consulting\n15.10.2003\n\n\n\n\nDie Partnerfirmen der LINEAS Consulting\nGmbH\n\n\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n + +/^a/IF + +/line\nbreak/ + this is a line\nbreak + line one\nthis is a line\nbreak in the second line + +/line\nbreak/f + this is a line\nbreak + ** Failers + line one\nthis is a line\nbreak in the second line + +/line\nbreak/mf + this is a line\nbreak + ** Failers + line one\nthis is a line\nbreak in the second line + +/ab.cd/P + ab-cd + ab=cd + ** Failers + ab\ncd + +/ab.cd/Ps + ab-cd + ab=cd + ab\ncd + +/(?i)(?-i)AbCd/ + AbCd + ** Failers + abcd + +/a{11111111111111111111}/ + +/(){64294967295}/ + +/(){2,4294967295}/ + +"(?i:a)(?i:b)(?i:c)(?i:d)(?i:e)(?i:f)(?i:g)(?i:h)(?i:i)(?i:j)(k)(?i:l)A\1B" + abcdefghijklAkB + +"(?Pa)(?Pb)(?Pc)(?Pd)(?Pe)(?Pf)(?Pg)(?Ph)(?Pi)(?Pj)(?Pk)(?Pl)A\11B" + abcdefghijklAkB + +"(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)A\11B" + abcdefghijklAkB + +"(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)" + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + +"(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)" + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + +/ End of testinput2 / diff --git a/mozilla/js/tamarin/pcre/testdata/testinput3 b/mozilla/js/tamarin/pcre/testdata/testinput3 new file mode 100644 index 00000000000..c2abdbfdb55 --- /dev/null +++ b/mozilla/js/tamarin/pcre/testdata/testinput3 @@ -0,0 +1,65 @@ +/^[\w]+/ + *** Failers + École + +/^[\w]+/Lfr_FR + École + +/^[\w]+/ + *** Failers + École + +/^[\W]+/ + École + +/^[\W]+/Lfr_FR + *** Failers + École + +/[\b]/ + \b + *** Failers + a + +/[\b]/Lfr_FR + \b + *** Failers + a + +/^\w+/ + *** Failers + École + +/^\w+/Lfr_FR + École + +/(.+)\b(.+)/ + École + +/(.+)\b(.+)/Lfr_FR + *** Failers + École + +/École/i + École + *** Failers + école + +/École/iLfr_FR + École + école + +/\w/IS + +/\w/ISLfr_FR + +/^[\xc8-\xc9]/iLfr_FR + École + école + +/^[\xc8-\xc9]/Lfr_FR + École + *** Failers + école + +/ End of testinput3 / diff --git a/mozilla/js/tamarin/pcre/testdata/testinput4 b/mozilla/js/tamarin/pcre/testdata/testinput4 new file mode 100644 index 00000000000..c16e9d9983b --- /dev/null +++ b/mozilla/js/tamarin/pcre/testdata/testinput4 @@ -0,0 +1,513 @@ +/-- Do not use the \x{} construct except with patterns that have the --/ +/-- /8 option set, because PCRE doesn't recognize them as UTF-8 unless --/ +/-- that option is set. However, the latest Perls recognize them always. --/ + +/a.b/8 + acb + a\x7fb + a\x{100}b + *** Failers + a\nb + +/a(.{3})b/8 + a\x{4000}xyb + a\x{4000}\x7fyb + a\x{4000}\x{100}yb + *** Failers + a\x{4000}b + ac\ncb + +/a(.*?)(.)/ + a\xc0\x88b + +/a(.*?)(.)/8 + a\x{100}b + +/a(.*)(.)/ + a\xc0\x88b + +/a(.*)(.)/8 + a\x{100}b + +/a(.)(.)/ + a\xc0\x92bcd + +/a(.)(.)/8 + a\x{240}bcd + +/a(.?)(.)/ + a\xc0\x92bcd + +/a(.?)(.)/8 + a\x{240}bcd + +/a(.??)(.)/ + a\xc0\x92bcd + +/a(.??)(.)/8 + a\x{240}bcd + +/a(.{3})b/8 + a\x{1234}xyb + a\x{1234}\x{4321}yb + a\x{1234}\x{4321}\x{3412}b + *** Failers + a\x{1234}b + ac\ncb + +/a(.{3,})b/8 + a\x{1234}xyb + a\x{1234}\x{4321}yb + a\x{1234}\x{4321}\x{3412}b + axxxxbcdefghijb + a\x{1234}\x{4321}\x{3412}\x{3421}b + *** Failers + a\x{1234}b + +/a(.{3,}?)b/8 + a\x{1234}xyb + a\x{1234}\x{4321}yb + a\x{1234}\x{4321}\x{3412}b + axxxxbcdefghijb + a\x{1234}\x{4321}\x{3412}\x{3421}b + *** Failers + a\x{1234}b + +/a(.{3,5})b/8 + a\x{1234}xyb + a\x{1234}\x{4321}yb + a\x{1234}\x{4321}\x{3412}b + axxxxbcdefghijb + a\x{1234}\x{4321}\x{3412}\x{3421}b + axbxxbcdefghijb + axxxxxbcdefghijb + *** Failers + a\x{1234}b + axxxxxxbcdefghijb + +/a(.{3,5}?)b/8 + a\x{1234}xyb + a\x{1234}\x{4321}yb + a\x{1234}\x{4321}\x{3412}b + axxxxbcdefghijb + a\x{1234}\x{4321}\x{3412}\x{3421}b + axbxxbcdefghijb + axxxxxbcdefghijb + *** Failers + a\x{1234}b + axxxxxxbcdefghijb + +/^[a\x{c0}]/8 + *** Failers + \x{100} + +/(?<=aXb)cd/8 + aXbcd + +/(?<=a\x{100}b)cd/8 + a\x{100}bcd + +/(?<=a\x{100000}b)cd/8 + a\x{100000}bcd + +/(?:\x{100}){3}b/8 + \x{100}\x{100}\x{100}b + *** Failers + \x{100}\x{100}b + +/\x{ab}/8 + \x{ab} + \xc2\xab + *** Failers + \x00{ab} + +/(?<=(.))X/8 + WXYZ + \x{256}XYZ + *** Failers + XYZ + +/X(\C{3})/8 + X\x{1234} + +/X(\C{4})/8 + X\x{1234}YZ + +/X\C*/8 + XYZabcdce + +/X\C*?/8 + XYZabcde + +/X\C{3,5}/8 + Xabcdefg + X\x{1234} + X\x{1234}YZ + X\x{1234}\x{512} + X\x{1234}\x{512}YZ + +/X\C{3,5}?/8 + Xabcdefg + X\x{1234} + X\x{1234}YZ + X\x{1234}\x{512} + +/[^a]+/8g + bcd + \x{100}aY\x{256}Z + +/^[^a]{2}/8 + \x{100}bc + +/^[^a]{2,}/8 + \x{100}bcAa + +/^[^a]{2,}?/8 + \x{100}bca + +/[^a]+/8ig + bcd + \x{100}aY\x{256}Z + +/^[^a]{2}/8i + \x{100}bc + +/^[^a]{2,}/8i + \x{100}bcAa + +/^[^a]{2,}?/8i + \x{100}bca + +/\x{100}{0,0}/8 + abcd + +/\x{100}?/8 + abcd + \x{100}\x{100} + +/\x{100}{0,3}/8 + \x{100}\x{100} + \x{100}\x{100}\x{100}\x{100} + +/\x{100}*/8 + abce + \x{100}\x{100}\x{100}\x{100} + +/\x{100}{1,1}/8 + abcd\x{100}\x{100}\x{100}\x{100} + +/\x{100}{1,3}/8 + abcd\x{100}\x{100}\x{100}\x{100} + +/\x{100}+/8 + abcd\x{100}\x{100}\x{100}\x{100} + +/\x{100}{3}/8 + abcd\x{100}\x{100}\x{100}XX + +/\x{100}{3,5}/8 + abcd\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}XX + +/\x{100}{3,}/8 + abcd\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}XX + +/(?<=a\x{100}{2}b)X/8+ + Xyyya\x{100}\x{100}bXzzz + +/\D*/8 + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + +/\D*/8 + \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100} + +/\D/8 + 1X2 + 1\x{100}2 + +/>\S/8 + > >X Y + > >\x{100} Y + +/\d/8 + \x{100}3 + +/\s/8 + \x{100} X + +/\D+/8 + 12abcd34 + *** Failers + 1234 + +/\D{2,3}/8 + 12abcd34 + 12ab34 + *** Failers + 1234 + 12a34 + +/\D{2,3}?/8 + 12abcd34 + 12ab34 + *** Failers + 1234 + 12a34 + +/\d+/8 + 12abcd34 + *** Failers + +/\d{2,3}/8 + 12abcd34 + 1234abcd + *** Failers + 1.4 + +/\d{2,3}?/8 + 12abcd34 + 1234abcd + *** Failers + 1.4 + +/\S+/8 + 12abcd34 + *** Failers + \ \ + +/\S{2,3}/8 + 12abcd34 + 1234abcd + *** Failers + \ \ + +/\S{2,3}?/8 + 12abcd34 + 1234abcd + *** Failers + \ \ + +/>\s+ <34 + *** Failers + +/>\s{2,3} \s{2,3}? \xff< + +/[\xff]/8 + >\x{ff}< + +/[^\xFF]/ + XYZ + +/[^\xff]/8 + XYZ + \x{123} + +/^[ac]*b/8 + xb + +/^[ac\x{100}]*b/8 + xb + +/^[^x]*b/8i + xb + +/^[^x]*b/8 + xb + +/^\d*b/8 + xb + +/(|a)/g8 + catac + a\x{256}a + +/^\x{85}$/8i + \x{85} + +/ End of testinput4 / diff --git a/mozilla/js/tamarin/pcre/testdata/testinput5 b/mozilla/js/tamarin/pcre/testdata/testinput5 new file mode 100644 index 00000000000..fe6ee3e6565 --- /dev/null +++ b/mozilla/js/tamarin/pcre/testdata/testinput5 @@ -0,0 +1,263 @@ +/\x{100}/8DM + +/\x{1000}/8DM + +/\x{10000}/8DM + +/\x{100000}/8DM + +/\x{1000000}/8DM + +/\x{4000000}/8DM + +/\x{7fffFFFF}/8DM + +/[\x{ff}]/8DM + +/[\x{100}]/8DM + +/\x{ffffffff}/8 + +/\x{100000000}/8 + +/^\x{100}a\x{1234}/8 + \x{100}a\x{1234}bcd + +/\x80/8D + +/\xff/8D + +/\x{0041}\x{2262}\x{0391}\x{002e}/D8 + \x{0041}\x{2262}\x{0391}\x{002e} + +/\x{D55c}\x{ad6d}\x{C5B4}/D8 + \x{D55c}\x{ad6d}\x{C5B4} + +/\x{65e5}\x{672c}\x{8a9e}/D8 + \x{65e5}\x{672c}\x{8a9e} + +/\x{80}/D8 + +/\x{084}/D8 + +/\x{104}/D8 + +/\x{861}/D8 + +/\x{212ab}/D8 + +/.{3,5}X/D8 + \x{212ab}\x{212ab}\x{212ab}\x{861}X + + +/.{3,5}?/D8 + \x{212ab}\x{212ab}\x{212ab}\x{861} + +/-- These tests are here rather than in testinput4 because Perl 5.6 has --/ +/-- some problems with UTF-8 support, in the area of \x{..} where the --/ +/-- value is < 255. It grumbles about invalid UTF-8 strings. --/ + +/^[a\x{c0}]b/8 + \x{c0}b + +/^([a\x{c0}]*?)aa/8 + a\x{c0}aaaa/ + +/^([a\x{c0}]*?)aa/8 + a\x{c0}aaaa/ + a\x{c0}a\x{c0}aaa/ + +/^([a\x{c0}]*)aa/8 + a\x{c0}aaaa/ + a\x{c0}a\x{c0}aaa/ + +/^([a\x{c0}]*)a\x{c0}/8 + a\x{c0}aaaa/ + a\x{c0}a\x{c0}aaa/ + +/-- --/ + +/(?<=\C)X/8 + Should produce an error diagnostic + +/-- This one is here not because it's different to Perl, but because the --/ +/-- way the captured single-byte is displayed. (In Perl it becomes a --/ +/-- character, and you can't tell the difference.) --/ + +/X(\C)(.*)/8 + X\x{1234} + X\nabc + +/^[ab]/8D + bar + *** Failers + c + \x{ff} + \x{100} + +/^[^ab]/8D + c + \x{ff} + \x{100} + *** Failers + aaa + +/[^ab\xC0-\xF0]/8SD + \x{f1} + \x{bf} + \x{100} + \x{1000} + *** Failers + \x{c0} + \x{f0} + +/Ä€{3,4}/8SD + \x{100}\x{100}\x{100}\x{100\x{100} + +/(\x{100}+|x)/8SD + +/(\x{100}*a|x)/8SD + +/(\x{100}{0,2}a|x)/8SD + +/(\x{100}{1,2}a|x)/8SD + +/\x{100}*(\d+|"(?1)")/8 + 1234 + "1234" + \x{100}1234 + "\x{100}1234" + \x{100}\x{100}12ab + \x{100}\x{100}"12" + *** Failers + \x{100}\x{100}abcd + +/\x{100}/8D + +/\x{100}*/8D + +/a\x{100}*/8D + +/ab\x{100}*/8D + +/a\x{100}\x{101}*/8D + +/a\x{100}\x{101}+/8D + +/\x{100}*A/8D + A + +/\x{100}*\d(?R)/8D + +/[^\x{c4}]/D + +/[^\x{c4}]/8D + +/[\x{100}]/8DM + \x{100} + Z\x{100} + \x{100}Z + *** Failers + +/[Z\x{100}]/8DM + Z\x{100} + \x{100} + \x{100}Z + *** Failers + +/[\x{200}-\x{100}]/8 + +/[Ä€-Ä„]/8 + \x{100} + \x{104} + *** Failers + \x{105} + \x{ff} + +/[z-\x{100}]/8D + +/[z\Qa-d]Ä€\E]/8D + \x{100} + Ä€ + +/[\xFF]/D + >\xff< + +/[\xff]/D8 + >\x{ff}< + +/[^\xFF]/D + +/[^\xff]/8D + +/[Ä-Ü]/8 + Ö # Matches without Study + \x{d6} + +/[Ä-Ü]/8S + Ö <-- Same with Study + \x{d6} + +/[\x{c4}-\x{dc}]/8 + Ö # Matches without Study + \x{d6} + +/[\x{c4}-\x{dc}]/8S + Ö <-- Same with Study + \x{d6} + +/[Ã]/8 + +/Ã/8 + +/ÃÃÃxxx/8 + +/ÃÃÃxxx/8?D + +/abc/8 + Ã] + à + ÃÃà + ÃÃÃ\? + +/anything/8 + \xc0\x80 + \xc1\x8f + \xe0\x9f\x80 + \xf0\x8f\x80\x80 + \xf8\x87\x80\x80\x80 + \xfc\x83\x80\x80\x80\x80 + \xfe\x80\x80\x80\x80\x80 + \xff\x80\x80\x80\x80\x80 + \xc3\x8f + \xe0\xaf\x80 + \xe1\x80\x80 + \xf0\x9f\x80\x80 + \xf1\x8f\x80\x80 + \xf8\x88\x80\x80\x80 + \xf9\x87\x80\x80\x80 + \xfc\x84\x80\x80\x80\x80 + \xfd\x83\x80\x80\x80\x80 + +/\x{100}abc(xyz(?1))/8D + +/[^\x{100}]abc(xyz(?1))/8D + +/[ab\x{100}]abc(xyz(?1))/8D + +/(\x{100}(b(?2)c))?/D8 + +/(\x{100}(b(?2)c)){0,2}/D8 + +/(\x{100}(b(?1)c))?/D8 + +/(\x{100}(b(?1)c)){0,2}/D8 + +/\W/8 + A.B + A\x{100}B + +/\w/8 + \x{100}X + +/ End of testinput5 / diff --git a/mozilla/js/tamarin/pcre/testdata/testinput6 b/mozilla/js/tamarin/pcre/testdata/testinput6 new file mode 100644 index 00000000000..01a39477ac4 --- /dev/null +++ b/mozilla/js/tamarin/pcre/testdata/testinput6 @@ -0,0 +1,517 @@ +/^\pC\pL\pM\pN\pP\pS\pZ3 + *** Failers + xyzabc + xyzabc\>2 + +/x\dy\Dz/ + x9yzz + x0y+z + *** Failers + xyz + xxy0z + +/x\sy\Sz/ + x yzz + x y+z + *** Failers + xyz + xxyyz + +/x\wy\Wz/ + xxy+z + *** Failers + xxy0z + x+y+z + +/x.y/ + x+y + x-y + *** Failers + x\ny + +/x.y/s + x+y + x-y + x\ny + +/(a.b(?s)c.d|x.y)p.q/ + a+bc+dp+q + a+bc\ndp+q + x\nyp+q + *** Failers + a\nbc\ndp+q + a+bc\ndp\nq + x\nyp\nq + +/a\d\z/ + ba0 + *** Failers + ba0\n + ba0\ncd + +/a\d\z/m + ba0 + *** Failers + ba0\n + ba0\ncd + +/a\d\Z/ + ba0 + ba0\n + *** Failers + ba0\ncd + +/a\d\Z/m + ba0 + ba0\n + *** Failers + ba0\ncd + +/a\d$/ + ba0 + ba0\n + *** Failers + ba0\ncd + +/a\d$/m + ba0 + ba0\n + ba0\ncd + *** Failers + +/abc/i + abc + aBc + ABC + +/[^a]/ + abcd + +/ab?\w/ + abz + abbz + azz + +/x{0,3}yz/ + ayzq + axyzq + axxyz + axxxyzq + axxxxyzq + *** Failers + ax + axx + +/x{3}yz/ + axxxyzq + axxxxyzq + *** Failers + ax + axx + ayzq + axyzq + axxyz + +/x{2,3}yz/ + axxyz + axxxyzq + axxxxyzq + *** Failers + ax + axx + ayzq + axyzq + +/[^a]+/ + bac + bcdefax + *** Failers + aaaaa + +/[^a]*/ + bac + bcdefax + *** Failers + aaaaa + +/[^a]{3,5}/ + xyz + awxyza + abcdefa + abcdefghijk + *** Failers + axya + axa + aaaaa + +/\d*/ + 1234b567 + xyz + +/\D*/ + a1234b567 + xyz + +/\d+/ + ab1234c56 + *** Failers + xyz + +/\D+/ + ab123c56 + *** Failers + 789 + +/\d?A/ + 045ABC + ABC + *** Failers + XYZ + +/\D?A/ + ABC + BAC + 9ABC + *** Failers + +/a+/ + aaaa + +/^.*xyz/ + xyz + ggggggggxyz + +/^.+xyz/ + abcdxyz + axyz + *** Failers + xyz + +/^.?xyz/ + xyz + cxyz + +/^\d{2,3}X/ + 12X + 123X + *** Failers + X + 1X + 1234X + +/^[abcd]\d/ + a45 + b93 + c99z + d04 + *** Failers + e45 + abcd + abcd1234 + 1234 + +/^[abcd]*\d/ + a45 + b93 + c99z + d04 + abcd1234 + 1234 + *** Failers + e45 + abcd + +/^[abcd]+\d/ + a45 + b93 + c99z + d04 + abcd1234 + *** Failers + 1234 + e45 + abcd + +/^a+X/ + aX + aaX + +/^[abcd]?\d/ + a45 + b93 + c99z + d04 + 1234 + *** Failers + abcd1234 + e45 + +/^[abcd]{2,3}\d/ + ab45 + bcd93 + *** Failers + 1234 + a36 + abcd1234 + ee45 + +/^(abc)*\d/ + abc45 + abcabcabc45 + 42xyz + *** Failers + +/^(abc)+\d/ + abc45 + abcabcabc45 + *** Failers + 42xyz + +/^(abc)?\d/ + abc45 + 42xyz + *** Failers + abcabcabc45 + +/^(abc){2,3}\d/ + abcabc45 + abcabcabc45 + *** Failers + abcabcabcabc45 + abc45 + 42xyz + +/1(abc|xyz)2(?1)3/ + 1abc2abc3456 + 1abc2xyz3456 + +/^(a*\w|ab)=(a*\w|ab)/ + ab=ab + +/^(a*\w|ab)=(?1)/ + ab=ab + +/^([^()]|\((?1)*\))*$/ + abc + a(b)c + a(b(c))d + *** Failers) + a(b(c)d + +/^>abc>([^()]|\((?1)*\))*abc>123abc>1(2)3abc>(1(2)3)a*)\d/ + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa9876 + *** Failers + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + +/< (?: (?(R) \d++ | [^<>]*+) | (?R)) * >/x + <> + + hij> + hij> + def> + + *** Failers + 3 + *** Failers + defabcxyz + +/^abcdef/ + ab\P + abcde\P + abcdef\P + *** Failers + abx\P + +/^a{2,4}\d+z/ + a\P + aa\P + aa2\P + aaa\P + aaa23\P + aaaa12345\P + aa0z\P + aaaa4444444444444z\P + *** Failers + az\P + aaaaa\P + a56\P + +/^abcdef/ + abc\P + def\R + +/(?<=foo)bar/ + xyzfo\P + foob\R\P\>2 + foobar...\R\P\>4 + xyzfo\P + foobar\R\>2 + *** Failers + xyzfo\P + obar\R + +/(ab*(cd|ef))+X/ + adfadadaklhlkalkajhlkjahdfasdfasdfladsfjkj\P\Z + lkjhlkjhlkjhlkjhabbbbbbcdaefabbbbbbbefa\P\B\Z + cdabbbbbbbb\P\R\B\Z + efabbbbbbbbbbbbbbbb\P\R\B\Z + bbbbbbbbbbbbcdXyasdfadf\P\R\B\Z + +/(a|b)/SF>testsavedregex +>>aaabxyzpqrrrabbxyyyypqAzz + >aaaabxyzpqrrrabbxyyyypqAzz + >>>>abcxyzpqrrrabbxyyyypqAzz + *** Failers + abxyzpqrrabbxyyyypqAzz + abxyzpqrrrrabbxyyyypqAzz + abxyzpqrrrabxyyyypqAzz + aaaabcxyzzzzpqrrrabbbxyyyyyypqAzz + aaaabcxyzzzzpqrrrabbbxyyypqAzz + aaabcxyzpqrrrabbxyyyypqqqqqqqAzz + +/^(abc){1,2}zz/ + abczz + abcabczz + *** Failers + zz + abcabcabczz + >>abczz + +/^(b+?|a){1,2}?c/ + bc + bbc + bbbc + bac + bbac + aac + abbbbbbbbbbbc + bbbbbbbbbbbac + *** Failers + aaac + abbbbbbbbbbbac + +/^(b+|a){1,2}c/ + bc + bbc + bbbc + bac + bbac + aac + abbbbbbbbbbbc + bbbbbbbbbbbac + *** Failers + aaac + abbbbbbbbbbbac + +/^(b+|a){1,2}?bc/ + bbc + +/^(b*|ba){1,2}?bc/ + babc + bbabc + bababc + *** Failers + bababbc + babababc + +/^(ba|b*){1,2}?bc/ + babc + bbabc + bababc + *** Failers + bababbc + babababc + +/^\ca\cA\c[\c{\c:/ + \x01\x01\e;z + +/^[ab\]cde]/ + athing + bthing + ]thing + cthing + dthing + ething + *** Failers + fthing + [thing + \\thing + +/^[]cde]/ + ]thing + cthing + dthing + ething + *** Failers + athing + fthing + +/^[^ab\]cde]/ + fthing + [thing + \\thing + *** Failers + athing + bthing + ]thing + cthing + dthing + ething + +/^[^]cde]/ + athing + fthing + *** Failers + ]thing + cthing + dthing + ething + +/^\/ + + +/^ÿ/ + ÿ + +/^[0-9]+$/ + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 100 + *** Failers + abc + +/^.*nter/ + enter + inter + uponter + +/^xxx[0-9]+$/ + xxx0 + xxx1234 + *** Failers + xxx + +/^.+[0-9][0-9][0-9]$/ + x123 + xx123 + 123456 + *** Failers + 123 + x1234 + +/^.+?[0-9][0-9][0-9]$/ + x123 + xx123 + 123456 + *** Failers + 123 + x1234 + +/^([^!]+)!(.+)=apquxz\.ixr\.zzz\.ac\.uk$/ + abc!pqr=apquxz.ixr.zzz.ac.uk + *** Failers + !pqr=apquxz.ixr.zzz.ac.uk + abc!=apquxz.ixr.zzz.ac.uk + abc!pqr=apquxz:ixr.zzz.ac.uk + abc!pqr=apquxz.ixr.zzz.ac.ukk + +/:/ + Well, we need a colon: somewhere + *** Fail if we don't + +/([\da-f:]+)$/i + 0abc + abc + fed + E + :: + 5f03:12C0::932e + fed def + Any old stuff + *** Failers + 0zzz + gzzz + fed\x20 + Any old rubbish + +/^.*\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/ + .1.2.3 + A.12.123.0 + *** Failers + .1.2.3333 + 1.2.3 + 1234.2.3 + +/^(\d+)\s+IN\s+SOA\s+(\S+)\s+(\S+)\s*\(\s*$/ + 1 IN SOA non-sp1 non-sp2( + 1 IN SOA non-sp1 non-sp2 ( + *** Failers + 1IN SOA non-sp1 non-sp2( + +/^[a-zA-Z\d][a-zA-Z\d\-]*(\.[a-zA-Z\d][a-zA-z\d\-]*)*\.$/ + a. + Z. + 2. + ab-c.pq-r. + sxk.zzz.ac.uk. + x-.y-. + *** Failers + -abc.peq. + +/^\*\.[a-z]([a-z\-\d]*[a-z\d]+)?(\.[a-z]([a-z\-\d]*[a-z\d]+)?)*$/ + *.a + *.b0-a + *.c3-b.c + *.c-a.b-c + *** Failers + *.0 + *.a- + *.a-b.c- + *.c-a.0-c + +/^(?=ab(de))(abd)(e)/ + abde + +/^(?!(ab)de|x)(abd)(f)/ + abdf + +/^(?=(ab(cd)))(ab)/ + abcd + +/^[\da-f](\.[\da-f])*$/i + a.b.c.d + A.B.C.D + a.b.c.1.2.3.C + +/^\".*\"\s*(;.*)?$/ + \"1234\" + \"abcd\" ; + \"\" ; rhubarb + *** Failers + \"1234\" : things + +/^$/ + \ + *** Failers + +/ ^ a (?# begins with a) b\sc (?# then b c) $ (?# then end)/x + ab c + *** Failers + abc + ab cde + +/(?x) ^ a (?# begins with a) b\sc (?# then b c) $ (?# then end)/ + ab c + *** Failers + abc + ab cde + +/^ a\ b[c ]d $/x + a bcd + a b d + *** Failers + abcd + ab d + +/^(a(b(c)))(d(e(f)))(h(i(j)))(k(l(m)))$/ + abcdefhijklm + +/^(?:a(b(c)))(?:d(e(f)))(?:h(i(j)))(?:k(l(m)))$/ + abcdefhijklm + +/^[\w][\W][\s][\S][\d][\D][\b][\n][\c]][\022]/ + a+ Z0+\x08\n\x1d\x12 + +/^[.^$|()*+?{,}]+/ + .^\$(*+)|{?,?} + +/^a*\w/ + z + az + aaaz + a + aa + aaaa + a+ + aa+ + +/^a*?\w/ + z + az + aaaz + a + aa + aaaa + a+ + aa+ + +/^a+\w/ + az + aaaz + aa + aaaa + aa+ + +/^a+?\w/ + az + aaaz + aa + aaaa + aa+ + +/^\d{8}\w{2,}/ + 1234567890 + 12345678ab + 12345678__ + *** Failers + 1234567 + +/^[aeiou\d]{4,5}$/ + uoie + 1234 + 12345 + aaaaa + *** Failers + 123456 + +/^[aeiou\d]{4,5}?/ + uoie + 1234 + 12345 + aaaaa + 123456 + +/^From +([^ ]+) +[a-zA-Z][a-zA-Z][a-zA-Z] +[a-zA-Z][a-zA-Z][a-zA-Z] +[0-9]?[0-9] +[0-9][0-9]:[0-9][0-9]/ + From abcd Mon Sep 01 12:33:02 1997 + +/^From\s+\S+\s+([a-zA-Z]{3}\s+){2}\d{1,2}\s+\d\d:\d\d/ + From abcd Mon Sep 01 12:33:02 1997 + From abcd Mon Sep 1 12:33:02 1997 + *** Failers + From abcd Sep 01 12:33:02 1997 + +/^12.34/s + 12\n34 + 12\r34 + +/\w+(?=\t)/ + the quick brown\t fox + +/foo(?!bar)(.*)/ + foobar is foolish see? + +/(?:(?!foo)...|^.{0,2})bar(.*)/ + foobar crowbar etc + barrel + 2barrel + A barrel + +/^(\D*)(?=\d)(?!123)/ + abc456 + *** Failers + abc123 + +/^1234(?# test newlines + inside)/ + 1234 + +/^1234 #comment in extended re + /x + 1234 + +/#rhubarb + abcd/x + abcd + +/^abcd#rhubarb/x + abcd + +/(?!^)abc/ + the abc + *** Failers + abc + +/(?=^)abc/ + abc + *** Failers + the abc + +/^[ab]{1,3}(ab*|b)/ + aabbbbb + +/^[ab]{1,3}?(ab*|b)/ + aabbbbb + +/^[ab]{1,3}?(ab*?|b)/ + aabbbbb + +/^[ab]{1,3}(ab*?|b)/ + aabbbbb + +/ (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* # optional leading comment +(?: (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +" (?: # opening quote... +[^\\\x80-\xff\n\015"] # Anything except backslash and quote +| # or +\\ [^\x80-\xff] # Escaped something (something != CR) +)* " # closing quote +) # initial word +(?: (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* \. (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +" (?: # opening quote... +[^\\\x80-\xff\n\015"] # Anything except backslash and quote +| # or +\\ [^\x80-\xff] # Escaped something (something != CR) +)* " # closing quote +) )* # further okay, if led by a period +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* @ (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| \[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) # initial subdomain +(?: # +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* \. # if led by a period... +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| \[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) # ...further okay +)* +# address +| # or +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +" (?: # opening quote... +[^\\\x80-\xff\n\015"] # Anything except backslash and quote +| # or +\\ [^\x80-\xff] # Escaped something (something != CR) +)* " # closing quote +) # one word, optionally followed by.... +(?: +[^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] | # atom and space parts, or... +\( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) | # comments, or... + +" (?: # opening quote... +[^\\\x80-\xff\n\015"] # Anything except backslash and quote +| # or +\\ [^\x80-\xff] # Escaped something (something != CR) +)* " # closing quote +# quoted strings +)* +< (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* # leading < +(?: @ (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| \[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) # initial subdomain +(?: # +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* \. # if led by a period... +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| \[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) # ...further okay +)* + +(?: (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* , (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* @ (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| \[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) # initial subdomain +(?: # +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* \. # if led by a period... +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| \[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) # ...further okay +)* +)* # further okay, if led by comma +: # closing colon +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* )? # optional route +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +" (?: # opening quote... +[^\\\x80-\xff\n\015"] # Anything except backslash and quote +| # or +\\ [^\x80-\xff] # Escaped something (something != CR) +)* " # closing quote +) # initial word +(?: (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* \. (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +" (?: # opening quote... +[^\\\x80-\xff\n\015"] # Anything except backslash and quote +| # or +\\ [^\x80-\xff] # Escaped something (something != CR) +)* " # closing quote +) )* # further okay, if led by a period +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* @ (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| \[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) # initial subdomain +(?: # +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* \. # if led by a period... +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| \[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) # ...further okay +)* +# address spec +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* > # trailing > +# name and address +) (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* # optional trailing comment +/x + Alan Other + + user\@dom.ain + \"A. Other\" (a comment) + A. Other (a comment) + \"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"\@x400-re.lay + A missing angle @,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +# Atom +| # or +" # " +[^\\\x80-\xff\n\015"] * # normal +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* +" # " +# Quoted string +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +\. +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +# Atom +| # or +" # " +[^\\\x80-\xff\n\015"] * # normal +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* +" # " +# Quoted string +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# additional words +)* +@ +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +\[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# optional trailing comments +(?: +\. +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +\[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# optional trailing comments +)* +# address +| # or +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +# Atom +| # or +" # " +[^\\\x80-\xff\n\015"] * # normal +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* +" # " +# Quoted string +) +# leading word +[^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] * # "normal" atoms and or spaces +(?: +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +| +" # " +[^\\\x80-\xff\n\015"] * # normal +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* +" # " +) # "special" comment or quoted string +[^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] * # more "normal" +)* +< +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# < +(?: +@ +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +\[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# optional trailing comments +(?: +\. +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +\[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# optional trailing comments +)* +(?: , +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +@ +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +\[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# optional trailing comments +(?: +\. +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +\[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# optional trailing comments +)* +)* # additional domains +: +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# optional trailing comments +)? # optional route +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +# Atom +| # or +" # " +[^\\\x80-\xff\n\015"] * # normal +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* +" # " +# Quoted string +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +\. +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +# Atom +| # or +" # " +[^\\\x80-\xff\n\015"] * # normal +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* +" # " +# Quoted string +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# additional words +)* +@ +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +\[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# optional trailing comments +(?: +\. +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +\[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# optional trailing comments +)* +# address spec +> # > +# name and address +) +/x + Alan Other + + user\@dom.ain + \"A. Other\" (a comment) + A. Other (a comment) + \"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"\@x400-re.lay + A missing angle ]{0,})>]{0,})>([\d]{0,}\.)(.*)((
    ([\w\W\s\d][^<>]{0,})|[\s]{0,}))<\/a><\/TD>]{0,})>([\w\W\s\d][^<>]{0,})<\/TD>]{0,})>([\w\W\s\d][^<>]{0,})<\/TD><\/TR>/is + 43.
    Word Processor
    (N-1286)
    Lega lstaff.comCA - Statewide + +/a[^a]b/ + acb + a\nb + +/a.b/ + acb + *** Failers + a\nb + +/a[^a]b/s + acb + a\nb + +/a.b/s + acb + a\nb + +/^(b+?|a){1,2}?c/ + bac + bbac + bbbac + bbbbac + bbbbbac + +/^(b+|a){1,2}?c/ + bac + bbac + bbbac + bbbbac + bbbbbac + +/(?!\A)x/m + x\nb\n + a\bx\n + +/\x0{ab}/ + \0{ab} + +/(A|B)*?CD/ + CD + +/(A|B)*CD/ + CD + +/(?.*/)foo" + /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/it/you/see/ + +"(?>.*/)foo" + /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/and/foo + +/(?>(\.\d\d[1-9]?))\d+/ + 1.230003938 + 1.875000282 + *** Failers + 1.235 + +/^((?>\w+)|(?>\s+))*$/ + now is the time for all good men to come to the aid of the party + *** Failers + this is not a line with only words and spaces! + +/(\d+)(\w)/ + 12345a + 12345+ + +/((?>\d+))(\w)/ + 12345a + *** Failers + 12345+ + +/(?>a+)b/ + aaab + +/((?>a+)b)/ + aaab + +/(?>(a+))b/ + aaab + +/(?>b)+/ + aaabbbccc + +/(?>a+|b+|c+)*c/ + aaabbbbccccd + +/(a+|b+|c+)*c/ + aaabbbbccccd + +/((?>[^()]+)|\([^()]*\))+/ + ((abc(ade)ufh()()x + +/\(((?>[^()]+)|\([^()]+\))+\)/ + (abc) + (abc(def)xyz) + *** Failers + ((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + +/a(?-i)b/i + ab + Ab + *** Failers + aB + AB + +/(a (?x)b c)d e/ + a bcd e + *** Failers + a b cd e + abcd e + a bcde + +/(a b(?x)c d (?-x)e f)/ + a bcde f + *** Failers + abcdef + +/(a(?i)b)c/ + abc + aBc + *** Failers + abC + aBC + Abc + ABc + ABC + AbC + +/a(?i:b)c/ + abc + aBc + *** Failers + ABC + abC + aBC + +/a(?i:b)*c/ + aBc + aBBc + *** Failers + aBC + aBBC + +/a(?=b(?i)c)\w\wd/ + abcd + abCd + *** Failers + aBCd + abcD + +/(?s-i:more.*than).*million/i + more than million + more than MILLION + more \n than Million + *** Failers + MORE THAN MILLION + more \n than \n million + +/(?:(?s-i)more.*than).*million/i + more than million + more than MILLION + more \n than Million + *** Failers + MORE THAN MILLION + more \n than \n million + +/(?>a(?i)b+)+c/ + abc + aBbc + aBBc + *** Failers + Abc + abAb + abbC + +/(?=a(?i)b)\w\wc/ + abc + aBc + *** Failers + Ab + abC + aBC + +/(?<=a(?i)b)(\w\w)c/ + abxxc + aBxxc + *** Failers + Abxxc + ABxxc + abxxC + +/^(?(?=abc)\w{3}:|\d\d)$/ + abc: + 12 + *** Failers + 123 + xyz + +/^(?(?!abc)\d\d|\w{3}:)$/ + abc: + 12 + *** Failers + 123 + xyz + +/(?(?<=foo)bar|cat)/ + foobar + cat + fcat + focat + *** Failers + foocat + +/(?(?a*)*/ + a + aa + aaaa + +/(abc|)+/ + abc + abcabc + abcabcabc + xyz + +/([a]*)*/ + a + aaaaa + +/([ab]*)*/ + a + b + ababab + aaaabcde + bbbb + +/([^a]*)*/ + b + bbbb + aaa + +/([^ab]*)*/ + cccc + abab + +/([a]*?)*/ + a + aaaa + +/([ab]*?)*/ + a + b + abab + baba + +/([^a]*?)*/ + b + bbbb + aaa + +/([^ab]*?)*/ + c + cccc + baba + +/(?>a*)*/ + a + aaabcde + +/((?>a*))*/ + aaaaa + aabbaa + +/((?>a*?))*/ + aaaaa + aabbaa + +/(?(?=[^a-z]+[a-z]) \d{2}-[a-z]{3}-\d{2} | \d{2}-\d{2}-\d{2} ) /x + 12-sep-98 + 12-09-98 + *** Failers + sep-12-98 + +/(?i:saturday|sunday)/ + saturday + sunday + Saturday + Sunday + SATURDAY + SUNDAY + SunDay + +/(a(?i)bc|BB)x/ + abcx + aBCx + bbx + BBx + *** Failers + abcX + aBCX + bbX + BBX + +/^([ab](?i)[cd]|[ef])/ + ac + aC + bD + elephant + Europe + frog + France + *** Failers + Africa + +/^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)/ + ab + aBd + xy + xY + zebra + Zambesi + *** Failers + aCD + XY + +/(?<=foo\n)^bar/m + foo\nbar + *** Failers + bar + baz\nbar + +/(?<=(?]&/ + <&OUT + +/(?:(f)(o)(o)|(b)(a)(r))*/ + foobar + +/(?<=a)b/ + ab + *** Failers + cb + b + +/(?a+)ab/ + +/(?>a+)b/ + aaab + +/([[:]+)/ + a:[b]: + +/([[=]+)/ + a=[b]= + +/([[.]+)/ + a.[b]. + +/((?>a+)b)/ + aaab + +/(?>(a+))b/ + aaab + +/((?>[^()]+)|\([^()]*\))+/ + ((abc(ade)ufh()()x + +/a\Z/ + *** Failers + aaab + a\nb\n + +/b\Z/ + a\nb\n + +/b\z/ + +/b\Z/ + a\nb + +/b\z/ + a\nb + *** Failers + +/(?>.*)(?<=(abcd|wxyz))/ + alphabetabcd + endingwxyz + *** Failers + a rather long string that doesn't end with one of them + +/word (?>(?:(?!otherword)[a-zA-Z0-9]+ ){0,30})otherword/ + word cat dog elephant mussel cow horse canary baboon snake shark otherword + word cat dog elephant mussel cow horse canary baboon snake shark + +/word (?>[a-zA-Z0-9]+ ){0,30}otherword/ + word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope + +/(?<=\d{3}(?!999))foo/ + 999foo + 123999foo + *** Failers + 123abcfoo + +/(?<=(?!...999)\d{3})foo/ + 999foo + 123999foo + *** Failers + 123abcfoo + +/(?<=\d{3}(?!999)...)foo/ + 123abcfoo + 123456foo + *** Failers + 123999foo + +/(?<=\d{3}...)(?Z)+|A)*/ + ZABCDEFG + +/((?>)+|A)*/ + ZABCDEFG + +/a*/g + abbab + +/^[a-\d]/ + abcde + -things + 0digit + *** Failers + bcdef + +/^[\d-a]/ + abcde + -things + 0digit + *** Failers + bcdef + +/[[:space:]]+/ + > \x09\x0a\x0c\x0d\x0b< + +/[[:blank:]]+/ + > \x09\x0a\x0c\x0d\x0b< + +/[\s]+/ + > \x09\x0a\x0c\x0d\x0b< + +/\s+/ + > \x09\x0a\x0c\x0d\x0b< + +/a b/x + ab + +/(?!\A)x/m + a\nxb\n + +/(?!^)x/m + a\nxb\n + +/abc\Qabc\Eabc/ + abcabcabc + +/abc\Q(*+|\Eabc/ + abc(*+|abc + +/ abc\Q abc\Eabc/x + abc abcabc + *** Failers + abcabcabc + +/abc#comment + \Q#not comment + literal\E/x + abc#not comment\n literal + +/abc#comment + \Q#not comment + literal/x + abc#not comment\n literal + +/abc#comment + \Q#not comment + literal\E #more comment + /x + abc#not comment\n literal + +/abc#comment + \Q#not comment + literal\E #more comment/x + abc#not comment\n literal + +/\Qabc\$xyz\E/ + abc\\\$xyz + +/\Qabc\E\$\Qxyz\E/ + abc\$xyz + +/\Gabc/ + abc + *** Failers + xyzabc + +/\Gabc./g + abc1abc2xyzabc3 + +/abc./g + abc1abc2xyzabc3 + +/a(?x: b c )d/ + XabcdY + *** Failers + Xa b c d Y + +/((?x)x y z | a b c)/ + XabcY + AxyzB + +/(?i)AB(?-i)C/ + XabCY + *** Failers + XabcY + +/((?i)AB(?-i)C|D)E/ + abCE + DE + *** Failers + abcE + abCe + dE + De + +/[z\Qa-d]\E]/ + z + a + - + d + ] + *** Failers + b + +/[\z\C]/ + z + C + +/\M/ + M + +/(a+)*b/ + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + +/(?i)reg(?:ul(?:[aä]|ae)r|ex)/ + REGular + regulaer + Regex + regulär + +/Åæåä[à-ÿÀ-ß]+/ + Åæåäà + Åæåäÿ + ÅæåäÀ + Åæåäß + +/(?<=Z)X./ + \x84XAZXB + +/^(?(2)a|(1)(2))+$/ + 123a + +/(?<=a|bbbb)c/ + ac + bbbbc + +/abc/>testsavedregex +testsavedregex +testsavedregex +testsavedregex +\S/8 + > >X Y + > >\x{100} Y + +/\d/8 + \x{100}3 + +/\s/8 + \x{100} X + +/\D+/8 + 12abcd34 + *** Failers + 1234 + +/\D{2,3}/8 + 12abcd34 + 12ab34 + *** Failers + 1234 + 12a34 + +/\D{2,3}?/8 + 12abcd34 + 12ab34 + *** Failers + 1234 + 12a34 + +/\d+/8 + 12abcd34 + *** Failers + +/\d{2,3}/8 + 12abcd34 + 1234abcd + *** Failers + 1.4 + +/\d{2,3}?/8 + 12abcd34 + 1234abcd + *** Failers + 1.4 + +/\S+/8 + 12abcd34 + *** Failers + \ \ + +/\S{2,3}/8 + 12abcd34 + 1234abcd + *** Failers + \ \ + +/\S{2,3}?/8 + 12abcd34 + 1234abcd + *** Failers + \ \ + +/>\s+ <34 + *** Failers + +/>\s{2,3} \s{2,3}? \xff< + +/[\xff]/8 + >\x{ff}< + +/[^\xFF]/ + XYZ + +/[^\xff]/8 + XYZ + \x{123} + +/^[ac]*b/8 + xb + +/^[ac\x{100}]*b/8 + xb + +/^[^x]*b/8i + xb + +/^[^x]*b/8 + xb + +/^\d*b/8 + xb + +/(|a)/g8 + catac + a\x{256}a + +/^\x{85}$/8i + \x{85} + +/ End of testinput 8 / diff --git a/mozilla/js/tamarin/pcre/testdata/testinput9 b/mozilla/js/tamarin/pcre/testdata/testinput9 new file mode 100644 index 00000000000..f18dd12c4a6 --- /dev/null +++ b/mozilla/js/tamarin/pcre/testdata/testinput9 @@ -0,0 +1,599 @@ +/\pL\P{Nd}/8 + AB + *** Failers + A0 + 00 + +/\X./8 + AB + A\x{300}BC + A\x{300}\x{301}\x{302}BC + *** Failers + \x{300} + +/\X\X/8 + ABC + A\x{300}B\x{300}\x{301}C + A\x{300}\x{301}\x{302}BC + *** Failers + \x{300} + +/^\pL+/8 + abcd + a + *** Failers + +/^\PL+/8 + 1234 + = + *** Failers + abcd + +/^\X+/8 + abcdA\x{300}\x{301}\x{302} + A\x{300}\x{301}\x{302} + A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302} + a + *** Failers + \x{300}\x{301}\x{302} + +/\X?abc/8 + abc + A\x{300}abc + A\x{300}\x{301}\x{302}A\x{300}A\x{300}A\x{300}abcxyz + \x{300}abc + *** Failers + +/^\X?abc/8 + abc + A\x{300}abc + *** Failers + A\x{300}\x{301}\x{302}A\x{300}A\x{300}A\x{300}abcxyz + \x{300}abc + +/\X*abc/8 + abc + A\x{300}abc + A\x{300}\x{301}\x{302}A\x{300}A\x{300}A\x{300}abcxyz + \x{300}abc + *** Failers + +/^\X*abc/8 + abc + A\x{300}abc + A\x{300}\x{301}\x{302}A\x{300}A\x{300}A\x{300}abcxyz + *** Failers + \x{300}abc + +/^\pL?=./8 + A=b + =c + *** Failers + 1=2 + AAAA=b + +/^\pL*=./8 + AAAA=b + =c + *** Failers + 1=2 + +/^\X{2,3}X/8 + A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}X + A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}X + *** Failers + X + A\x{300}\x{301}\x{302}X + A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}X + +/^\pC\pL\pM\pN\pP\pS\pZ>>aaabxyzpqrrrabbxyyyypqAzz + 0: aaabxyzpqrrrabbxyyyypqAzz + >aaaabxyzpqrrrabbxyyyypqAzz + 0: aaaabxyzpqrrrabbxyyyypqAzz + >>>>abcxyzpqrrrabbxyyyypqAzz + 0: abcxyzpqrrrabbxyyyypqAzz + *** Failers +No match + abxyzpqrrabbxyyyypqAzz +No match + abxyzpqrrrrabbxyyyypqAzz +No match + abxyzpqrrrabxyyyypqAzz +No match + aaaabcxyzzzzpqrrrabbbxyyyyyypqAzz +No match + aaaabcxyzzzzpqrrrabbbxyyypqAzz +No match + aaabcxyzpqrrrabbxyyyypqqqqqqqAzz +No match + +/^(abc){1,2}zz/ + abczz + 0: abczz + 1: abc + abcabczz + 0: abcabczz + 1: abc + *** Failers +No match + zz +No match + abcabcabczz +No match + >>abczz +No match + +/^(b+?|a){1,2}?c/ + bc + 0: bc + 1: b + bbc + 0: bbc + 1: b + bbbc + 0: bbbc + 1: bb + bac + 0: bac + 1: a + bbac + 0: bbac + 1: a + aac + 0: aac + 1: a + abbbbbbbbbbbc + 0: abbbbbbbbbbbc + 1: bbbbbbbbbbb + bbbbbbbbbbbac + 0: bbbbbbbbbbbac + 1: a + *** Failers +No match + aaac +No match + abbbbbbbbbbbac +No match + +/^(b+|a){1,2}c/ + bc + 0: bc + 1: b + bbc + 0: bbc + 1: bb + bbbc + 0: bbbc + 1: bbb + bac + 0: bac + 1: a + bbac + 0: bbac + 1: a + aac + 0: aac + 1: a + abbbbbbbbbbbc + 0: abbbbbbbbbbbc + 1: bbbbbbbbbbb + bbbbbbbbbbbac + 0: bbbbbbbbbbbac + 1: a + *** Failers +No match + aaac +No match + abbbbbbbbbbbac +No match + +/^(b+|a){1,2}?bc/ + bbc + 0: bbc + 1: b + +/^(b*|ba){1,2}?bc/ + babc + 0: babc + 1: ba + bbabc + 0: bbabc + 1: ba + bababc + 0: bababc + 1: ba + *** Failers +No match + bababbc +No match + babababc +No match + +/^(ba|b*){1,2}?bc/ + babc + 0: babc + 1: ba + bbabc + 0: bbabc + 1: ba + bababc + 0: bababc + 1: ba + *** Failers +No match + bababbc +No match + babababc +No match + +/^\ca\cA\c[\c{\c:/ + \x01\x01\e;z + 0: \x01\x01\x1b;z + +/^[ab\]cde]/ + athing + 0: a + bthing + 0: b + ]thing + 0: ] + cthing + 0: c + dthing + 0: d + ething + 0: e + *** Failers +No match + fthing +No match + [thing +No match + \\thing +No match + +/^[]cde]/ + ]thing + 0: ] + cthing + 0: c + dthing + 0: d + ething + 0: e + *** Failers +No match + athing +No match + fthing +No match + +/^[^ab\]cde]/ + fthing + 0: f + [thing + 0: [ + \\thing + 0: \ + *** Failers + 0: * + athing +No match + bthing +No match + ]thing +No match + cthing +No match + dthing +No match + ething +No match + +/^[^]cde]/ + athing + 0: a + fthing + 0: f + *** Failers + 0: * + ]thing +No match + cthing +No match + dthing +No match + ething +No match + +/^\/ + + 0: \x81 + +/^ÿ/ + ÿ + 0: \xff + +/^[0-9]+$/ + 0 + 0: 0 + 1 + 0: 1 + 2 + 0: 2 + 3 + 0: 3 + 4 + 0: 4 + 5 + 0: 5 + 6 + 0: 6 + 7 + 0: 7 + 8 + 0: 8 + 9 + 0: 9 + 10 + 0: 10 + 100 + 0: 100 + *** Failers +No match + abc +No match + +/^.*nter/ + enter + 0: enter + inter + 0: inter + uponter + 0: uponter + +/^xxx[0-9]+$/ + xxx0 + 0: xxx0 + xxx1234 + 0: xxx1234 + *** Failers +No match + xxx +No match + +/^.+[0-9][0-9][0-9]$/ + x123 + 0: x123 + xx123 + 0: xx123 + 123456 + 0: 123456 + *** Failers +No match + 123 +No match + x1234 + 0: x1234 + +/^.+?[0-9][0-9][0-9]$/ + x123 + 0: x123 + xx123 + 0: xx123 + 123456 + 0: 123456 + *** Failers +No match + 123 +No match + x1234 + 0: x1234 + +/^([^!]+)!(.+)=apquxz\.ixr\.zzz\.ac\.uk$/ + abc!pqr=apquxz.ixr.zzz.ac.uk + 0: abc!pqr=apquxz.ixr.zzz.ac.uk + 1: abc + 2: pqr + *** Failers +No match + !pqr=apquxz.ixr.zzz.ac.uk +No match + abc!=apquxz.ixr.zzz.ac.uk +No match + abc!pqr=apquxz:ixr.zzz.ac.uk +No match + abc!pqr=apquxz.ixr.zzz.ac.ukk +No match + +/:/ + Well, we need a colon: somewhere + 0: : + *** Fail if we don't +No match + +/([\da-f:]+)$/i + 0abc + 0: 0abc + 1: 0abc + abc + 0: abc + 1: abc + fed + 0: fed + 1: fed + E + 0: E + 1: E + :: + 0: :: + 1: :: + 5f03:12C0::932e + 0: 5f03:12C0::932e + 1: 5f03:12C0::932e + fed def + 0: def + 1: def + Any old stuff + 0: ff + 1: ff + *** Failers +No match + 0zzz +No match + gzzz +No match + fed\x20 +No match + Any old rubbish +No match + +/^.*\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/ + .1.2.3 + 0: .1.2.3 + 1: 1 + 2: 2 + 3: 3 + A.12.123.0 + 0: A.12.123.0 + 1: 12 + 2: 123 + 3: 0 + *** Failers +No match + .1.2.3333 +No match + 1.2.3 +No match + 1234.2.3 +No match + +/^(\d+)\s+IN\s+SOA\s+(\S+)\s+(\S+)\s*\(\s*$/ + 1 IN SOA non-sp1 non-sp2( + 0: 1 IN SOA non-sp1 non-sp2( + 1: 1 + 2: non-sp1 + 3: non-sp2 + 1 IN SOA non-sp1 non-sp2 ( + 0: 1 IN SOA non-sp1 non-sp2 ( + 1: 1 + 2: non-sp1 + 3: non-sp2 + *** Failers +No match + 1IN SOA non-sp1 non-sp2( +No match + +/^[a-zA-Z\d][a-zA-Z\d\-]*(\.[a-zA-Z\d][a-zA-z\d\-]*)*\.$/ + a. + 0: a. + Z. + 0: Z. + 2. + 0: 2. + ab-c.pq-r. + 0: ab-c.pq-r. + 1: .pq-r + sxk.zzz.ac.uk. + 0: sxk.zzz.ac.uk. + 1: .uk + x-.y-. + 0: x-.y-. + 1: .y- + *** Failers +No match + -abc.peq. +No match + +/^\*\.[a-z]([a-z\-\d]*[a-z\d]+)?(\.[a-z]([a-z\-\d]*[a-z\d]+)?)*$/ + *.a + 0: *.a + *.b0-a + 0: *.b0-a + 1: 0-a + *.c3-b.c + 0: *.c3-b.c + 1: 3-b + 2: .c + *.c-a.b-c + 0: *.c-a.b-c + 1: -a + 2: .b-c + 3: -c + *** Failers +No match + *.0 +No match + *.a- +No match + *.a-b.c- +No match + *.c-a.0-c +No match + +/^(?=ab(de))(abd)(e)/ + abde + 0: abde + 1: de + 2: abd + 3: e + +/^(?!(ab)de|x)(abd)(f)/ + abdf + 0: abdf + 1: + 2: abd + 3: f + +/^(?=(ab(cd)))(ab)/ + abcd + 0: ab + 1: abcd + 2: cd + 3: ab + +/^[\da-f](\.[\da-f])*$/i + a.b.c.d + 0: a.b.c.d + 1: .d + A.B.C.D + 0: A.B.C.D + 1: .D + a.b.c.1.2.3.C + 0: a.b.c.1.2.3.C + 1: .C + +/^\".*\"\s*(;.*)?$/ + \"1234\" + 0: "1234" + \"abcd\" ; + 0: "abcd" ; + 1: ; + \"\" ; rhubarb + 0: "" ; rhubarb + 1: ; rhubarb + *** Failers +No match + \"1234\" : things +No match + +/^$/ + \ + 0: + *** Failers +No match + +/ ^ a (?# begins with a) b\sc (?# then b c) $ (?# then end)/x + ab c + 0: ab c + *** Failers +No match + abc +No match + ab cde +No match + +/(?x) ^ a (?# begins with a) b\sc (?# then b c) $ (?# then end)/ + ab c + 0: ab c + *** Failers +No match + abc +No match + ab cde +No match + +/^ a\ b[c ]d $/x + a bcd + 0: a bcd + a b d + 0: a b d + *** Failers +No match + abcd +No match + ab d +No match + +/^(a(b(c)))(d(e(f)))(h(i(j)))(k(l(m)))$/ + abcdefhijklm + 0: abcdefhijklm + 1: abc + 2: bc + 3: c + 4: def + 5: ef + 6: f + 7: hij + 8: ij + 9: j +10: klm +11: lm +12: m + +/^(?:a(b(c)))(?:d(e(f)))(?:h(i(j)))(?:k(l(m)))$/ + abcdefhijklm + 0: abcdefhijklm + 1: bc + 2: c + 3: ef + 4: f + 5: ij + 6: j + 7: lm + 8: m + +/^[\w][\W][\s][\S][\d][\D][\b][\n][\c]][\022]/ + a+ Z0+\x08\n\x1d\x12 + 0: a+ Z0+\x08\x0a\x1d\x12 + +/^[.^$|()*+?{,}]+/ + .^\$(*+)|{?,?} + 0: .^$(*+)|{?,?} + +/^a*\w/ + z + 0: z + az + 0: az + aaaz + 0: aaaz + a + 0: a + aa + 0: aa + aaaa + 0: aaaa + a+ + 0: a + aa+ + 0: aa + +/^a*?\w/ + z + 0: z + az + 0: a + aaaz + 0: a + a + 0: a + aa + 0: a + aaaa + 0: a + a+ + 0: a + aa+ + 0: a + +/^a+\w/ + az + 0: az + aaaz + 0: aaaz + aa + 0: aa + aaaa + 0: aaaa + aa+ + 0: aa + +/^a+?\w/ + az + 0: az + aaaz + 0: aa + aa + 0: aa + aaaa + 0: aa + aa+ + 0: aa + +/^\d{8}\w{2,}/ + 1234567890 + 0: 1234567890 + 12345678ab + 0: 12345678ab + 12345678__ + 0: 12345678__ + *** Failers +No match + 1234567 +No match + +/^[aeiou\d]{4,5}$/ + uoie + 0: uoie + 1234 + 0: 1234 + 12345 + 0: 12345 + aaaaa + 0: aaaaa + *** Failers +No match + 123456 +No match + +/^[aeiou\d]{4,5}?/ + uoie + 0: uoie + 1234 + 0: 1234 + 12345 + 0: 1234 + aaaaa + 0: aaaa + 123456 + 0: 1234 + +/\A(abc|def)=(\1){2,3}\Z/ + abc=abcabc + 0: abc=abcabc + 1: abc + 2: abc + def=defdefdef + 0: def=defdefdef + 1: def + 2: def + *** Failers +No match + abc=defdef +No match + +/^(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)\11*(\3\4)\1(?#)2$/ + abcdefghijkcda2 + 0: abcdefghijkcda2 + 1: a + 2: b + 3: c + 4: d + 5: e + 6: f + 7: g + 8: h + 9: i +10: j +11: k +12: cd + abcdefghijkkkkcda2 + 0: abcdefghijkkkkcda2 + 1: a + 2: b + 3: c + 4: d + 5: e + 6: f + 7: g + 8: h + 9: i +10: j +11: k +12: cd + +/(cat(a(ract|tonic)|erpillar)) \1()2(3)/ + cataract cataract23 + 0: cataract cataract23 + 1: cataract + 2: aract + 3: ract + 4: + 5: 3 + catatonic catatonic23 + 0: catatonic catatonic23 + 1: catatonic + 2: atonic + 3: tonic + 4: + 5: 3 + caterpillar caterpillar23 + 0: caterpillar caterpillar23 + 1: caterpillar + 2: erpillar + 3: + 4: + 5: 3 + + +/^From +([^ ]+) +[a-zA-Z][a-zA-Z][a-zA-Z] +[a-zA-Z][a-zA-Z][a-zA-Z] +[0-9]?[0-9] +[0-9][0-9]:[0-9][0-9]/ + From abcd Mon Sep 01 12:33:02 1997 + 0: From abcd Mon Sep 01 12:33 + 1: abcd + +/^From\s+\S+\s+([a-zA-Z]{3}\s+){2}\d{1,2}\s+\d\d:\d\d/ + From abcd Mon Sep 01 12:33:02 1997 + 0: From abcd Mon Sep 01 12:33 + 1: Sep + From abcd Mon Sep 1 12:33:02 1997 + 0: From abcd Mon Sep 1 12:33 + 1: Sep + *** Failers +No match + From abcd Sep 01 12:33:02 1997 +No match + +/^12.34/s + 12\n34 + 0: 12\x0a34 + 12\r34 + 0: 12\x0d34 + +/\w+(?=\t)/ + the quick brown\t fox + 0: brown + +/foo(?!bar)(.*)/ + foobar is foolish see? + 0: foolish see? + 1: lish see? + +/(?:(?!foo)...|^.{0,2})bar(.*)/ + foobar crowbar etc + 0: rowbar etc + 1: etc + barrel + 0: barrel + 1: rel + 2barrel + 0: 2barrel + 1: rel + A barrel + 0: A barrel + 1: rel + +/^(\D*)(?=\d)(?!123)/ + abc456 + 0: abc + 1: abc + *** Failers +No match + abc123 +No match + +/^1234(?# test newlines + inside)/ + 1234 + 0: 1234 + +/^1234 #comment in extended re + /x + 1234 + 0: 1234 + +/#rhubarb + abcd/x + abcd + 0: abcd + +/^abcd#rhubarb/x + abcd + 0: abcd + +/^(a)\1{2,3}(.)/ + aaab + 0: aaab + 1: a + 2: b + aaaab + 0: aaaab + 1: a + 2: b + aaaaab + 0: aaaaa + 1: a + 2: a + aaaaaab + 0: aaaaa + 1: a + 2: a + +/(?!^)abc/ + the abc + 0: abc + *** Failers +No match + abc +No match + +/(?=^)abc/ + abc + 0: abc + *** Failers +No match + the abc +No match + +/^[ab]{1,3}(ab*|b)/ + aabbbbb + 0: aabb + 1: b + +/^[ab]{1,3}?(ab*|b)/ + aabbbbb + 0: aabbbbb + 1: abbbbb + +/^[ab]{1,3}?(ab*?|b)/ + aabbbbb + 0: aa + 1: a + +/^[ab]{1,3}(ab*?|b)/ + aabbbbb + 0: aabb + 1: b + +/ (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* # optional leading comment +(?: (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +" (?: # opening quote... +[^\\\x80-\xff\n\015"] # Anything except backslash and quote +| # or +\\ [^\x80-\xff] # Escaped something (something != CR) +)* " # closing quote +) # initial word +(?: (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* \. (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +" (?: # opening quote... +[^\\\x80-\xff\n\015"] # Anything except backslash and quote +| # or +\\ [^\x80-\xff] # Escaped something (something != CR) +)* " # closing quote +) )* # further okay, if led by a period +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* @ (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| \[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) # initial subdomain +(?: # +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* \. # if led by a period... +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| \[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) # ...further okay +)* +# address +| # or +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +" (?: # opening quote... +[^\\\x80-\xff\n\015"] # Anything except backslash and quote +| # or +\\ [^\x80-\xff] # Escaped something (something != CR) +)* " # closing quote +) # one word, optionally followed by.... +(?: +[^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] | # atom and space parts, or... +\( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) | # comments, or... + +" (?: # opening quote... +[^\\\x80-\xff\n\015"] # Anything except backslash and quote +| # or +\\ [^\x80-\xff] # Escaped something (something != CR) +)* " # closing quote +# quoted strings +)* +< (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* # leading < +(?: @ (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| \[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) # initial subdomain +(?: # +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* \. # if led by a period... +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| \[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) # ...further okay +)* + +(?: (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* , (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* @ (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| \[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) # initial subdomain +(?: # +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* \. # if led by a period... +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| \[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) # ...further okay +)* +)* # further okay, if led by comma +: # closing colon +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* )? # optional route +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +" (?: # opening quote... +[^\\\x80-\xff\n\015"] # Anything except backslash and quote +| # or +\\ [^\x80-\xff] # Escaped something (something != CR) +)* " # closing quote +) # initial word +(?: (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* \. (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +" (?: # opening quote... +[^\\\x80-\xff\n\015"] # Anything except backslash and quote +| # or +\\ [^\x80-\xff] # Escaped something (something != CR) +)* " # closing quote +) )* # further okay, if led by a period +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* @ (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| \[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) # initial subdomain +(?: # +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* \. # if led by a period... +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| \[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) # ...further okay +)* +# address spec +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* > # trailing > +# name and address +) (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* # optional trailing comment +/x + Alan Other + 0: Alan Other + + 0: user@dom.ain + user\@dom.ain + 0: user@dom.ain + \"A. Other\" (a comment) + 0: "A. Other" (a comment) + A. Other (a comment) + 0: Other (a comment) + \"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"\@x400-re.lay + 0: "/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/"@x400-re.lay + A missing angle @,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +# Atom +| # or +" # " +[^\\\x80-\xff\n\015"] * # normal +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* +" # " +# Quoted string +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +\. +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +# Atom +| # or +" # " +[^\\\x80-\xff\n\015"] * # normal +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* +" # " +# Quoted string +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# additional words +)* +@ +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +\[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# optional trailing comments +(?: +\. +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +\[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# optional trailing comments +)* +# address +| # or +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +# Atom +| # or +" # " +[^\\\x80-\xff\n\015"] * # normal +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* +" # " +# Quoted string +) +# leading word +[^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] * # "normal" atoms and or spaces +(?: +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +| +" # " +[^\\\x80-\xff\n\015"] * # normal +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* +" # " +) # "special" comment or quoted string +[^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] * # more "normal" +)* +< +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# < +(?: +@ +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +\[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# optional trailing comments +(?: +\. +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +\[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# optional trailing comments +)* +(?: , +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +@ +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +\[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# optional trailing comments +(?: +\. +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +\[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# optional trailing comments +)* +)* # additional domains +: +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# optional trailing comments +)? # optional route +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +# Atom +| # or +" # " +[^\\\x80-\xff\n\015"] * # normal +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* +" # " +# Quoted string +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +\. +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +# Atom +| # or +" # " +[^\\\x80-\xff\n\015"] * # normal +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* +" # " +# Quoted string +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# additional words +)* +@ +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +\[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# optional trailing comments +(?: +\. +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +\[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# optional trailing comments +)* +# address spec +> # > +# name and address +) +/x + Alan Other + 0: Alan Other + + 0: user@dom.ain + user\@dom.ain + 0: user@dom.ain + \"A. Other\" (a comment) + 0: "A. Other" + A. Other (a comment) + 0: Other + \"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"\@x400-re.lay + 0: "/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/"@x400-re.lay + A missing angle ?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff + +/P[^*]TAIRE[^*]{1,6}?LL/ + xxxxxxxxxxxPSTAIREISLLxxxxxxxxx + 0: PSTAIREISLL + +/P[^*]TAIRE[^*]{1,}?LL/ + xxxxxxxxxxxPSTAIREISLLxxxxxxxxx + 0: PSTAIREISLL + +/(\.\d\d[1-9]?)\d+/ + 1.230003938 + 0: .230003938 + 1: .23 + 1.875000282 + 0: .875000282 + 1: .875 + 1.235 + 0: .235 + 1: .23 + +/(\.\d\d((?=0)|\d(?=\d)))/ + 1.230003938 + 0: .23 + 1: .23 + 2: + 1.875000282 + 0: .875 + 1: .875 + 2: 5 + *** Failers +No match + 1.235 +No match + +/a(?)b/ + ab + 0: ab + +/\b(foo)\s+(\w+)/i + Food is on the foo table + 0: foo table + 1: foo + 2: table + +/foo(.*)bar/ + The food is under the bar in the barn. + 0: food is under the bar in the bar + 1: d is under the bar in the + +/foo(.*?)bar/ + The food is under the bar in the barn. + 0: food is under the bar + 1: d is under the + +/(.*)(\d*)/ + I have 2 numbers: 53147 + 0: I have 2 numbers: 53147 + 1: I have 2 numbers: 53147 + 2: + +/(.*)(\d+)/ + I have 2 numbers: 53147 + 0: I have 2 numbers: 53147 + 1: I have 2 numbers: 5314 + 2: 7 + +/(.*?)(\d*)/ + I have 2 numbers: 53147 + 0: + 1: + 2: + +/(.*?)(\d+)/ + I have 2 numbers: 53147 + 0: I have 2 + 1: I have + 2: 2 + +/(.*)(\d+)$/ + I have 2 numbers: 53147 + 0: I have 2 numbers: 53147 + 1: I have 2 numbers: 5314 + 2: 7 + +/(.*?)(\d+)$/ + I have 2 numbers: 53147 + 0: I have 2 numbers: 53147 + 1: I have 2 numbers: + 2: 53147 + +/(.*)\b(\d+)$/ + I have 2 numbers: 53147 + 0: I have 2 numbers: 53147 + 1: I have 2 numbers: + 2: 53147 + +/(.*\D)(\d+)$/ + I have 2 numbers: 53147 + 0: I have 2 numbers: 53147 + 1: I have 2 numbers: + 2: 53147 + +/^\D*(?!123)/ + ABC123 + 0: AB + +/^(\D*)(?=\d)(?!123)/ + ABC445 + 0: ABC + 1: ABC + *** Failers +No match + ABC123 +No match + +/^[W-]46]/ + W46]789 + 0: W46] + -46]789 + 0: -46] + *** Failers +No match + Wall +No match + Zebra +No match + 42 +No match + [abcd] +No match + ]abcd[ +No match + +/^[W-\]46]/ + W46]789 + 0: W + Wall + 0: W + Zebra + 0: Z + Xylophone + 0: X + 42 + 0: 4 + [abcd] + 0: [ + ]abcd[ + 0: ] + \\backslash + 0: \ + *** Failers +No match + -46]789 +No match + well +No match + +/\d\d\/\d\d\/\d\d\d\d/ + 01/01/2000 + 0: 01/01/2000 + +/word (?:[a-zA-Z0-9]+ ){0,10}otherword/ + word cat dog elephant mussel cow horse canary baboon snake shark otherword + 0: word cat dog elephant mussel cow horse canary baboon snake shark otherword + word cat dog elephant mussel cow horse canary baboon snake shark +No match + +/word (?:[a-zA-Z0-9]+ ){0,300}otherword/ + word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope +No match + +/^(a){0,0}/ + bcd + 0: + abc + 0: + aab + 0: + +/^(a){0,1}/ + bcd + 0: + abc + 0: a + 1: a + aab + 0: a + 1: a + +/^(a){0,2}/ + bcd + 0: + abc + 0: a + 1: a + aab + 0: aa + 1: a + +/^(a){0,3}/ + bcd + 0: + abc + 0: a + 1: a + aab + 0: aa + 1: a + aaa + 0: aaa + 1: a + +/^(a){0,}/ + bcd + 0: + abc + 0: a + 1: a + aab + 0: aa + 1: a + aaa + 0: aaa + 1: a + aaaaaaaa + 0: aaaaaaaa + 1: a + +/^(a){1,1}/ + bcd +No match + abc + 0: a + 1: a + aab + 0: a + 1: a + +/^(a){1,2}/ + bcd +No match + abc + 0: a + 1: a + aab + 0: aa + 1: a + +/^(a){1,3}/ + bcd +No match + abc + 0: a + 1: a + aab + 0: aa + 1: a + aaa + 0: aaa + 1: a + +/^(a){1,}/ + bcd +No match + abc + 0: a + 1: a + aab + 0: aa + 1: a + aaa + 0: aaa + 1: a + aaaaaaaa + 0: aaaaaaaa + 1: a + +/.*\.gif/ + borfle\nbib.gif\nno + 0: bib.gif + +/.{0,}\.gif/ + borfle\nbib.gif\nno + 0: bib.gif + +/.*\.gif/m + borfle\nbib.gif\nno + 0: bib.gif + +/.*\.gif/s + borfle\nbib.gif\nno + 0: borfle\x0abib.gif + +/.*\.gif/ms + borfle\nbib.gif\nno + 0: borfle\x0abib.gif + +/.*$/ + borfle\nbib.gif\nno + 0: no + +/.*$/m + borfle\nbib.gif\nno + 0: borfle + +/.*$/s + borfle\nbib.gif\nno + 0: borfle\x0abib.gif\x0ano + +/.*$/ms + borfle\nbib.gif\nno + 0: borfle\x0abib.gif\x0ano + +/.*$/ + borfle\nbib.gif\nno\n + 0: no + +/.*$/m + borfle\nbib.gif\nno\n + 0: borfle + +/.*$/s + borfle\nbib.gif\nno\n + 0: borfle\x0abib.gif\x0ano\x0a + +/.*$/ms + borfle\nbib.gif\nno\n + 0: borfle\x0abib.gif\x0ano\x0a + +/(.*X|^B)/ + abcde\n1234Xyz + 0: 1234X + 1: 1234X + BarFoo + 0: B + 1: B + *** Failers +No match + abcde\nBar +No match + +/(.*X|^B)/m + abcde\n1234Xyz + 0: 1234X + 1: 1234X + BarFoo + 0: B + 1: B + abcde\nBar + 0: B + 1: B + +/(.*X|^B)/s + abcde\n1234Xyz + 0: abcde\x0a1234X + 1: abcde\x0a1234X + BarFoo + 0: B + 1: B + *** Failers +No match + abcde\nBar +No match + +/(.*X|^B)/ms + abcde\n1234Xyz + 0: abcde\x0a1234X + 1: abcde\x0a1234X + BarFoo + 0: B + 1: B + abcde\nBar + 0: B + 1: B + +/(?s)(.*X|^B)/ + abcde\n1234Xyz + 0: abcde\x0a1234X + 1: abcde\x0a1234X + BarFoo + 0: B + 1: B + *** Failers +No match + abcde\nBar +No match + +/(?s:.*X|^B)/ + abcde\n1234Xyz + 0: abcde\x0a1234X + BarFoo + 0: B + *** Failers +No match + abcde\nBar +No match + +/^.*B/ + **** Failers +No match + abc\nB +No match + +/(?s)^.*B/ + abc\nB + 0: abc\x0aB + +/(?m)^.*B/ + abc\nB + 0: B + +/(?ms)^.*B/ + abc\nB + 0: abc\x0aB + +/(?ms)^B/ + abc\nB + 0: B + +/(?s)B$/ + B\n + 0: B + +/^[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]/ + 123456654321 + 0: 123456654321 + +/^\d\d\d\d\d\d\d\d\d\d\d\d/ + 123456654321 + 0: 123456654321 + +/^[\d][\d][\d][\d][\d][\d][\d][\d][\d][\d][\d][\d]/ + 123456654321 + 0: 123456654321 + +/^[abc]{12}/ + abcabcabcabc + 0: abcabcabcabc + +/^[a-c]{12}/ + abcabcabcabc + 0: abcabcabcabc + +/^(a|b|c){12}/ + abcabcabcabc + 0: abcabcabcabc + 1: c + +/^[abcdefghijklmnopqrstuvwxy0123456789]/ + n + 0: n + *** Failers +No match + z +No match + +/abcde{0,0}/ + abcd + 0: abcd + *** Failers +No match + abce +No match + +/ab[cd]{0,0}e/ + abe + 0: abe + *** Failers +No match + abcde +No match + +/ab(c){0,0}d/ + abd + 0: abd + *** Failers +No match + abcd +No match + +/a(b*)/ + a + 0: a + 1: + ab + 0: ab + 1: b + abbbb + 0: abbbb + 1: bbbb + *** Failers + 0: a + 1: + bbbbb +No match + +/ab\d{0}e/ + abe + 0: abe + *** Failers +No match + ab1e +No match + +/"([^\\"]+|\\.)*"/ + the \"quick\" brown fox + 0: "quick" + 1: quick + \"the \\\"quick\\\" brown fox\" + 0: "the \"quick\" brown fox" + 1: brown fox + +/.*?/g+ + abc + 0: + 0+ abc + 0: a + 0+ bc + 0: + 0+ bc + 0: b + 0+ c + 0: + 0+ c + 0: c + 0+ + 0: + 0+ + +/\b/g+ + abc + 0: + 0+ abc + 0: + 0+ + +/\b/+g + abc + 0: + 0+ abc + 0: + 0+ + +//g + abc + 0: + 0: + 0: + 0: + +/]{0,})>]{0,})>([\d]{0,}\.)(.*)((
    ([\w\W\s\d][^<>]{0,})|[\s]{0,}))<\/a><\/TD>]{0,})>([\w\W\s\d][^<>]{0,})<\/TD>]{0,})>([\w\W\s\d][^<>]{0,})<\/TD><\/TR>/is + 43.Word Processor
    (N-1286)
    Lega lstaff.comCA - Statewide + 0: 43.Word Processor
    (N-1286)
    Lega lstaff.comCA - Statewide + 1: BGCOLOR='#DBE9E9' + 2: align=left valign=top + 3: 43. + 4: Word Processor
    (N-1286) + 5: + 6: + 7: + 8: align=left valign=top + 9: Lega lstaff.com +10: align=left valign=top +11: CA - Statewide + +/a[^a]b/ + acb + 0: acb + a\nb + 0: a\x0ab + +/a.b/ + acb + 0: acb + *** Failers +No match + a\nb +No match + +/a[^a]b/s + acb + 0: acb + a\nb + 0: a\x0ab + +/a.b/s + acb + 0: acb + a\nb + 0: a\x0ab + +/^(b+?|a){1,2}?c/ + bac + 0: bac + 1: a + bbac + 0: bbac + 1: a + bbbac + 0: bbbac + 1: a + bbbbac + 0: bbbbac + 1: a + bbbbbac + 0: bbbbbac + 1: a + +/^(b+|a){1,2}?c/ + bac + 0: bac + 1: a + bbac + 0: bbac + 1: a + bbbac + 0: bbbac + 1: a + bbbbac + 0: bbbbac + 1: a + bbbbbac + 0: bbbbbac + 1: a + +/(?!\A)x/m + x\nb\n +No match + a\bx\n + 0: x + +/\x0{ab}/ + \0{ab} + 0: \x00{ab} + +/(A|B)*?CD/ + CD + 0: CD + +/(A|B)*CD/ + CD + 0: CD + +/(AB)*?\1/ + ABABAB + 0: ABAB + 1: AB + +/(AB)*\1/ + ABABAB + 0: ABABAB + 1: AB + +/(?.*/)foo" + /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/it/you/see/ +No match + +"(?>.*/)foo" + /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/and/foo + 0: /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/and/foo + +/(?>(\.\d\d[1-9]?))\d+/ + 1.230003938 + 0: .230003938 + 1: .23 + 1.875000282 + 0: .875000282 + 1: .875 + *** Failers +No match + 1.235 +No match + +/^((?>\w+)|(?>\s+))*$/ + now is the time for all good men to come to the aid of the party + 0: now is the time for all good men to come to the aid of the party + 1: party + *** Failers +No match + this is not a line with only words and spaces! +No match + +/(\d+)(\w)/ + 12345a + 0: 12345a + 1: 12345 + 2: a + 12345+ + 0: 12345 + 1: 1234 + 2: 5 + +/((?>\d+))(\w)/ + 12345a + 0: 12345a + 1: 12345 + 2: a + *** Failers +No match + 12345+ +No match + +/(?>a+)b/ + aaab + 0: aaab + +/((?>a+)b)/ + aaab + 0: aaab + 1: aaab + +/(?>(a+))b/ + aaab + 0: aaab + 1: aaa + +/(?>b)+/ + aaabbbccc + 0: bbb + +/(?>a+|b+|c+)*c/ + aaabbbbccccd + 0: aaabbbbc + +/((?>[^()]+)|\([^()]*\))+/ + ((abc(ade)ufh()()x + 0: abc(ade)ufh()()x + 1: x + +/\(((?>[^()]+)|\([^()]+\))+\)/ + (abc) + 0: (abc) + 1: abc + (abc(def)xyz) + 0: (abc(def)xyz) + 1: xyz + *** Failers +No match + ((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +No match + +/a(?-i)b/i + ab + 0: ab + Ab + 0: Ab + *** Failers +No match + aB +No match + AB +No match + +/(a (?x)b c)d e/ + a bcd e + 0: a bcd e + 1: a bc + *** Failers +No match + a b cd e +No match + abcd e +No match + a bcde +No match + +/(a b(?x)c d (?-x)e f)/ + a bcde f + 0: a bcde f + 1: a bcde f + *** Failers +No match + abcdef +No match + +/(a(?i)b)c/ + abc + 0: abc + 1: ab + aBc + 0: aBc + 1: aB + *** Failers +No match + abC +No match + aBC +No match + Abc +No match + ABc +No match + ABC +No match + AbC +No match + +/a(?i:b)c/ + abc + 0: abc + aBc + 0: aBc + *** Failers +No match + ABC +No match + abC +No match + aBC +No match + +/a(?i:b)*c/ + aBc + 0: aBc + aBBc + 0: aBBc + *** Failers +No match + aBC +No match + aBBC +No match + +/a(?=b(?i)c)\w\wd/ + abcd + 0: abcd + abCd + 0: abCd + *** Failers +No match + aBCd +No match + abcD +No match + +/(?s-i:more.*than).*million/i + more than million + 0: more than million + more than MILLION + 0: more than MILLION + more \n than Million + 0: more \x0a than Million + *** Failers +No match + MORE THAN MILLION +No match + more \n than \n million +No match + +/(?:(?s-i)more.*than).*million/i + more than million + 0: more than million + more than MILLION + 0: more than MILLION + more \n than Million + 0: more \x0a than Million + *** Failers +No match + MORE THAN MILLION +No match + more \n than \n million +No match + +/(?>a(?i)b+)+c/ + abc + 0: abc + aBbc + 0: aBbc + aBBc + 0: aBBc + *** Failers +No match + Abc +No match + abAb +No match + abbC +No match + +/(?=a(?i)b)\w\wc/ + abc + 0: abc + aBc + 0: aBc + *** Failers +No match + Ab +No match + abC +No match + aBC +No match + +/(?<=a(?i)b)(\w\w)c/ + abxxc + 0: xxc + 1: xx + aBxxc + 0: xxc + 1: xx + *** Failers +No match + Abxxc +No match + ABxxc +No match + abxxC +No match + +/(?:(a)|b)(?(1)A|B)/ + aA + 0: aA + 1: a + bB + 0: bB + *** Failers +No match + aB +No match + bA +No match + +/^(a)?(?(1)a|b)+$/ + aa + 0: aa + 1: a + b + 0: b + bb + 0: bb + *** Failers +No match + ab +No match + +/^(?(?=abc)\w{3}:|\d\d)$/ + abc: + 0: abc: + 12 + 0: 12 + *** Failers +No match + 123 +No match + xyz +No match + +/^(?(?!abc)\d\d|\w{3}:)$/ + abc: + 0: abc: + 12 + 0: 12 + *** Failers +No match + 123 +No match + xyz +No match + +/(?(?<=foo)bar|cat)/ + foobar + 0: bar + cat + 0: cat + fcat + 0: cat + focat + 0: cat + *** Failers +No match + foocat +No match + +/(?(?a*)*/ + a + 0: a + aa + 0: aa + aaaa + 0: aaaa + +/(abc|)+/ + abc + 0: abc + 1: + abcabc + 0: abcabc + 1: + abcabcabc + 0: abcabcabc + 1: + xyz + 0: + 1: + +/([a]*)*/ + a + 0: a + 1: + aaaaa + 0: aaaaa + 1: + +/([ab]*)*/ + a + 0: a + 1: + b + 0: b + 1: + ababab + 0: ababab + 1: + aaaabcde + 0: aaaab + 1: + bbbb + 0: bbbb + 1: + +/([^a]*)*/ + b + 0: b + 1: + bbbb + 0: bbbb + 1: + aaa + 0: + 1: + +/([^ab]*)*/ + cccc + 0: cccc + 1: + abab + 0: + 1: + +/([a]*?)*/ + a + 0: + 1: + aaaa + 0: + 1: + +/([ab]*?)*/ + a + 0: + 1: + b + 0: + 1: + abab + 0: + 1: + baba + 0: + 1: + +/([^a]*?)*/ + b + 0: + 1: + bbbb + 0: + 1: + aaa + 0: + 1: + +/([^ab]*?)*/ + c + 0: + 1: + cccc + 0: + 1: + baba + 0: + 1: + +/(?>a*)*/ + a + 0: a + aaabcde + 0: aaa + +/((?>a*))*/ + aaaaa + 0: aaaaa + 1: + aabbaa + 0: aa + 1: + +/((?>a*?))*/ + aaaaa + 0: + 1: + aabbaa + 0: + 1: + +/(?(?=[^a-z]+[a-z]) \d{2}-[a-z]{3}-\d{2} | \d{2}-\d{2}-\d{2} ) /x + 12-sep-98 + 0: 12-sep-98 + 12-09-98 + 0: 12-09-98 + *** Failers +No match + sep-12-98 +No match + +/(?<=(foo))bar\1/ + foobarfoo + 0: barfoo + 1: foo + foobarfootling + 0: barfoo + 1: foo + *** Failers +No match + foobar +No match + barfoo +No match + +/(?i:saturday|sunday)/ + saturday + 0: saturday + sunday + 0: sunday + Saturday + 0: Saturday + Sunday + 0: Sunday + SATURDAY + 0: SATURDAY + SUNDAY + 0: SUNDAY + SunDay + 0: SunDay + +/(a(?i)bc|BB)x/ + abcx + 0: abcx + 1: abc + aBCx + 0: aBCx + 1: aBC + bbx + 0: bbx + 1: bb + BBx + 0: BBx + 1: BB + *** Failers +No match + abcX +No match + aBCX +No match + bbX +No match + BBX +No match + +/^([ab](?i)[cd]|[ef])/ + ac + 0: ac + 1: ac + aC + 0: aC + 1: aC + bD + 0: bD + 1: bD + elephant + 0: e + 1: e + Europe + 0: E + 1: E + frog + 0: f + 1: f + France + 0: F + 1: F + *** Failers +No match + Africa +No match + +/^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)/ + ab + 0: ab + 1: ab + aBd + 0: aBd + 1: aBd + xy + 0: xy + 1: xy + xY + 0: xY + 1: xY + zebra + 0: z + 1: z + Zambesi + 0: Z + 1: Z + *** Failers +No match + aCD +No match + XY +No match + +/(?<=foo\n)^bar/m + foo\nbar + 0: bar + *** Failers +No match + bar +No match + baz\nbar +No match + +/(?<=(?]&/ + <&OUT + 0: <& + +/^(a\1?){4}$/ + aaaaaaaaaa + 0: aaaaaaaaaa + 1: aaaa + *** Failers +No match + AB +No match + aaaaaaaaa +No match + aaaaaaaaaaa +No match + +/^(a(?(1)\1)){4}$/ + aaaaaaaaaa + 0: aaaaaaaaaa + 1: aaaa + *** Failers +No match + aaaaaaaaa +No match + aaaaaaaaaaa +No match + +/(?:(f)(o)(o)|(b)(a)(r))*/ + foobar + 0: foobar + 1: f + 2: o + 3: o + 4: b + 5: a + 6: r + +/(?<=a)b/ + ab + 0: b + *** Failers +No match + cb +No match + b +No match + +/(? + 2: abcd + xy:z:::abcd + 0: xy:z:::abcd + 1: xy:z::: + 2: abcd + +/^[^bcd]*(c+)/ + aexycd + 0: aexyc + 1: c + +/(a*)b+/ + caab + 0: aab + 1: aa + +/([\w:]+::)?(\w+)$/ + abcd + 0: abcd + 1: + 2: abcd + xy:z:::abcd + 0: xy:z:::abcd + 1: xy:z::: + 2: abcd + *** Failers + 0: Failers + 1: + 2: Failers + abcd: +No match + abcd: +No match + +/^[^bcd]*(c+)/ + aexycd + 0: aexyc + 1: c + +/(>a+)ab/ + +/(?>a+)b/ + aaab + 0: aaab + +/([[:]+)/ + a:[b]: + 0: :[ + 1: :[ + +/([[=]+)/ + a=[b]= + 0: =[ + 1: =[ + +/([[.]+)/ + a.[b]. + 0: .[ + 1: .[ + +/((?>a+)b)/ + aaab + 0: aaab + 1: aaab + +/(?>(a+))b/ + aaab + 0: aaab + 1: aaa + +/((?>[^()]+)|\([^()]*\))+/ + ((abc(ade)ufh()()x + 0: abc(ade)ufh()()x + 1: x + +/a\Z/ + *** Failers +No match + aaab +No match + a\nb\n +No match + +/b\Z/ + a\nb\n + 0: b + +/b\z/ + +/b\Z/ + a\nb + 0: b + +/b\z/ + a\nb + 0: b + *** Failers +No match + +/^(?>(?(1)\.|())[^\W_](?>[a-z0-9-]*[^\W_])?)+$/ + a + 0: a + 1: + abc + 0: abc + 1: + a-b + 0: a-b + 1: + 0-9 + 0: 0-9 + 1: + a.b + 0: a.b + 1: + 5.6.7 + 0: 5.6.7 + 1: + the.quick.brown.fox + 0: the.quick.brown.fox + 1: + a100.b200.300c + 0: a100.b200.300c + 1: + 12-ab.1245 + 0: 12-ab.1245 + 1: + *** Failers +No match + \ +No match + .a +No match + -a +No match + a- +No match + a. +No match + a_b +No match + a.- +No match + a.. +No match + ab..bc +No match + the.quick.brown.fox- +No match + the.quick.brown.fox. +No match + the.quick.brown.fox_ +No match + the.quick.brown.fox+ +No match + +/(?>.*)(?<=(abcd|wxyz))/ + alphabetabcd + 0: alphabetabcd + 1: abcd + endingwxyz + 0: endingwxyz + 1: wxyz + *** Failers +No match + a rather long string that doesn't end with one of them +No match + +/word (?>(?:(?!otherword)[a-zA-Z0-9]+ ){0,30})otherword/ + word cat dog elephant mussel cow horse canary baboon snake shark otherword + 0: word cat dog elephant mussel cow horse canary baboon snake shark otherword + word cat dog elephant mussel cow horse canary baboon snake shark +No match + +/word (?>[a-zA-Z0-9]+ ){0,30}otherword/ + word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope +No match + +/(?<=\d{3}(?!999))foo/ + 999foo + 0: foo + 123999foo + 0: foo + *** Failers +No match + 123abcfoo +No match + +/(?<=(?!...999)\d{3})foo/ + 999foo + 0: foo + 123999foo + 0: foo + *** Failers +No match + 123abcfoo +No match + +/(?<=\d{3}(?!999)...)foo/ + 123abcfoo + 0: foo + 123456foo + 0: foo + *** Failers +No match + 123999foo +No match + +/(?<=\d{3}...)(? + 2: + 3: abcd +
    + 2: + 3: abcd + \s*)=(?>\s*) # find + 2: + 3: abcd + Z)+|A)*/ + ZABCDEFG + 0: ZA + 1: A + +/((?>)+|A)*/ + ZABCDEFG + 0: + 1: + +/a*/g + abbab + 0: a + 0: + 0: + 0: a + 0: + 0: + +/^[a-\d]/ + abcde + 0: a + -things + 0: - + 0digit + 0: 0 + *** Failers +No match + bcdef +No match + +/^[\d-a]/ + abcde + 0: a + -things + 0: - + 0digit + 0: 0 + *** Failers +No match + bcdef +No match + +/[[:space:]]+/ + > \x09\x0a\x0c\x0d\x0b< + 0: \x09\x0a\x0c\x0d\x0b + +/[[:blank:]]+/ + > \x09\x0a\x0c\x0d\x0b< + 0: \x09 + +/[\s]+/ + > \x09\x0a\x0c\x0d\x0b< + 0: \x09\x0a\x0c\x0d + +/\s+/ + > \x09\x0a\x0c\x0d\x0b< + 0: \x09\x0a\x0c\x0d + +/a b/x + ab +No match + +/(?!\A)x/m + a\nxb\n + 0: x + +/(?!^)x/m + a\nxb\n +No match + +/abc\Qabc\Eabc/ + abcabcabc + 0: abcabcabc + +/abc\Q(*+|\Eabc/ + abc(*+|abc + 0: abc(*+|abc + +/ abc\Q abc\Eabc/x + abc abcabc + 0: abc abcabc + *** Failers +No match + abcabcabc +No match + +/abc#comment + \Q#not comment + literal\E/x + abc#not comment\n literal + 0: abc#not comment\x0a literal + +/abc#comment + \Q#not comment + literal/x + abc#not comment\n literal + 0: abc#not comment\x0a literal + +/abc#comment + \Q#not comment + literal\E #more comment + /x + abc#not comment\n literal + 0: abc#not comment\x0a literal + +/abc#comment + \Q#not comment + literal\E #more comment/x + abc#not comment\n literal + 0: abc#not comment\x0a literal + +/\Qabc\$xyz\E/ + abc\\\$xyz + 0: abc\$xyz + +/\Qabc\E\$\Qxyz\E/ + abc\$xyz + 0: abc$xyz + +/\Gabc/ + abc + 0: abc + *** Failers +No match + xyzabc +No match + +/\Gabc./g + abc1abc2xyzabc3 + 0: abc1 + 0: abc2 + +/abc./g + abc1abc2xyzabc3 + 0: abc1 + 0: abc2 + 0: abc3 + +/a(?x: b c )d/ + XabcdY + 0: abcd + *** Failers +No match + Xa b c d Y +No match + +/((?x)x y z | a b c)/ + XabcY + 0: abc + 1: abc + AxyzB + 0: xyz + 1: xyz + +/(?i)AB(?-i)C/ + XabCY + 0: abC + *** Failers +No match + XabcY +No match + +/((?i)AB(?-i)C|D)E/ + abCE + 0: abCE + 1: abC + DE + 0: DE + 1: D + *** Failers +No match + abcE +No match + abCe +No match + dE +No match + De +No match + +/(.*)\d+\1/ + abc123abc + 0: abc123abc + 1: abc + abc123bc + 0: bc123bc + 1: bc + +/(.*)\d+\1/s + abc123abc + 0: abc123abc + 1: abc + abc123bc + 0: bc123bc + 1: bc + +/((.*))\d+\1/ + abc123abc + 0: abc123abc + 1: abc + 2: abc + abc123bc + 0: bc123bc + 1: bc + 2: bc + +/-- This tests for an IPv6 address in the form where it can have up to --/ +/-- eight components, one and only one of which is empty. This must be --/ +No match +/-- an internal component. --/ +No match + +/^(?!:) # colon disallowed at start + (?: # start of item + (?: [0-9a-f]{1,4} | # 1-4 hex digits or + (?(1)0 | () ) ) # if null previously matched, fail; else null + : # followed by colon + ){1,7} # end item; 1-7 of them required + [0-9a-f]{1,4} $ # final hex number at end of string + (?(1)|.) # check that there was an empty component + /xi + a123::a123 + 0: a123::a123 + 1: + a123:b342::abcd + 0: a123:b342::abcd + 1: + a123:b342::324e:abcd + 0: a123:b342::324e:abcd + 1: + a123:ddde:b342::324e:abcd + 0: a123:ddde:b342::324e:abcd + 1: + a123:ddde:b342::324e:dcba:abcd + 0: a123:ddde:b342::324e:dcba:abcd + 1: + a123:ddde:9999:b342::324e:dcba:abcd + 0: a123:ddde:9999:b342::324e:dcba:abcd + 1: + *** Failers +No match + 1:2:3:4:5:6:7:8 +No match + a123:bce:ddde:9999:b342::324e:dcba:abcd +No match + a123::9999:b342::324e:dcba:abcd +No match + abcde:2:3:4:5:6:7:8 +No match + ::1 +No match + abcd:fee0:123:: +No match + :1 +No match + 1: +No match + +/[z\Qa-d]\E]/ + z + 0: z + a + 0: a + - + 0: - + d + 0: d + ] + 0: ] + *** Failers + 0: a + b +No match + +/[\z\C]/ + z + 0: z + C + 0: C + +/\M/ + M + 0: M + +/(a+)*b/ + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +No match + +/(?i)reg(?:ul(?:[aä]|ae)r|ex)/ + REGular + 0: REGular + regulaer + 0: regulaer + Regex + 0: Regex + regulär + 0: regul\xe4r + +/Åæåä[à-ÿÀ-ß]+/ + Åæåäà + 0: \xc5\xe6\xe5\xe4\xe0 + Åæåäÿ + 0: \xc5\xe6\xe5\xe4\xff + ÅæåäÀ + 0: \xc5\xe6\xe5\xe4\xc0 + Åæåäß + 0: \xc5\xe6\xe5\xe4\xdf + +/(?<=Z)X./ + \x84XAZXB + 0: XB + +/ab cd (?x) de fg/ + ab cd defg + 0: ab cd defg + +/ab cd(?x) de fg/ + ab cddefg + 0: ab cddefg + ** Failers +No match + abcddefg +No match + +/ End of testinput1 / diff --git a/mozilla/js/tamarin/pcre/testdata/testoutput2 b/mozilla/js/tamarin/pcre/testdata/testoutput2 new file mode 100644 index 00000000000..29dfa1674cc --- /dev/null +++ b/mozilla/js/tamarin/pcre/testdata/testoutput2 @@ -0,0 +1,5946 @@ +PCRE version 6.4 05-Sep-2005 + +/(a)b|/ +Capturing subpattern count = 1 +No options +No first char +No need char + +/abc/ +Capturing subpattern count = 0 +No options +First char = 'a' +Need char = 'c' + abc + 0: abc + defabc + 0: abc + \Aabc + 0: abc + *** Failers +No match + \Adefabc +No match + ABC +No match + +/^abc/ +Capturing subpattern count = 0 +Options: anchored +No first char +No need char + abc + 0: abc + \Aabc + 0: abc + *** Failers +No match + defabc +No match + \Adefabc +No match + +/a+bc/ +Capturing subpattern count = 0 +Partial matching not supported +No options +First char = 'a' +Need char = 'c' + +/a*bc/ +Capturing subpattern count = 0 +Partial matching not supported +No options +No first char +Need char = 'c' + +/a{3}bc/ +Capturing subpattern count = 0 +Partial matching not supported +No options +First char = 'a' +Need char = 'c' + +/(abc|a+z)/ +Capturing subpattern count = 1 +Partial matching not supported +No options +First char = 'a' +No need char + +/^abc$/ +Capturing subpattern count = 0 +Options: anchored +No first char +No need char + abc + 0: abc + *** Failers +No match + def\nabc +No match + +/ab\gdef/X +Failed: unrecognized character follows \ at offset 3 + +/(?X)ab\gdef/X +Failed: unrecognized character follows \ at offset 7 + +/x{5,4}/ +Failed: numbers out of order in {} quantifier at offset 5 + +/z{65536}/ +Failed: number too big in {} quantifier at offset 7 + +/[abcd/ +Failed: missing terminating ] for character class at offset 5 + +/(?X)[\B]/ +Failed: invalid escape sequence in character class at offset 6 + +/[z-a]/ +Failed: range out of order in character class at offset 3 + +/^*/ +Failed: nothing to repeat at offset 1 + +/(abc/ +Failed: missing ) at offset 4 + +/(?# abc/ +Failed: missing ) after comment at offset 7 + +/(?z)abc/ +Failed: unrecognized character after (? at offset 2 + +/.*b/ +Capturing subpattern count = 0 +Partial matching not supported +No options +First char at start or follows \n +Need char = 'b' + +/.*?b/ +Capturing subpattern count = 0 +Partial matching not supported +No options +First char at start or follows \n +Need char = 'b' + +/cat|dog|elephant/ +Capturing subpattern count = 0 +No options +No first char +No need char + this sentence eventually mentions a cat + 0: cat + this sentences rambles on and on for a while and then reaches elephant + 0: elephant + +/cat|dog|elephant/S +Capturing subpattern count = 0 +No options +No first char +No need char +Starting byte set: c d e + this sentence eventually mentions a cat + 0: cat + this sentences rambles on and on for a while and then reaches elephant + 0: elephant + +/cat|dog|elephant/iS +Capturing subpattern count = 0 +Options: caseless +No first char +No need char +Starting byte set: C D E c d e + this sentence eventually mentions a CAT cat + 0: CAT + this sentences rambles on and on for a while to elephant ElePhant + 0: elephant + +/a|[bcd]/S +Capturing subpattern count = 0 +No options +No first char +No need char +Starting byte set: a b c d + +/(a|[^\dZ])/S +Capturing subpattern count = 1 +No options +No first char +No need char +Starting byte set: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a + \x0b \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19 + \x1a \x1b \x1c \x1d \x1e \x1f \x20 ! " # $ % & ' ( ) * + , - . / : ; < = > + ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y [ \ ] ^ _ ` a b c d + e f g h i j k l m n o p q r s t u v w x y z { | } ~ \x7f \x80 \x81 \x82 \x83 + \x84 \x85 \x86 \x87 \x88 \x89 \x8a \x8b \x8c \x8d \x8e \x8f \x90 \x91 \x92 + \x93 \x94 \x95 \x96 \x97 \x98 \x99 \x9a \x9b \x9c \x9d \x9e \x9f \xa0 \xa1 + \xa2 \xa3 \xa4 \xa5 \xa6 \xa7 \xa8 \xa9 \xaa \xab \xac \xad \xae \xaf \xb0 + \xb1 \xb2 \xb3 \xb4 \xb5 \xb6 \xb7 \xb8 \xb9 \xba \xbb \xbc \xbd \xbe \xbf + \xc0 \xc1 \xc2 \xc3 \xc4 \xc5 \xc6 \xc7 \xc8 \xc9 \xca \xcb \xcc \xcd \xce + \xcf \xd0 \xd1 \xd2 \xd3 \xd4 \xd5 \xd6 \xd7 \xd8 \xd9 \xda \xdb \xdc \xdd + \xde \xdf \xe0 \xe1 \xe2 \xe3 \xe4 \xe5 \xe6 \xe7 \xe8 \xe9 \xea \xeb \xec + \xed \xee \xef \xf0 \xf1 \xf2 \xf3 \xf4 \xf5 \xf6 \xf7 \xf8 \xf9 \xfa \xfb + \xfc \xfd \xfe \xff + +/(a|b)*[\s]/S +Capturing subpattern count = 1 +No options +No first char +No need char +Starting byte set: \x09 \x0a \x0c \x0d \x20 a b + +/(ab\2)/ +Failed: reference to non-existent subpattern at offset 6 + +/{4,5}abc/ +Failed: nothing to repeat at offset 4 + +/(a)(b)(c)\2/ +Capturing subpattern count = 3 +Max back reference = 2 +No options +First char = 'a' +Need char = 'c' + abcb + 0: abcb + 1: a + 2: b + 3: c + \O0abcb +Matched, but too many substrings + \O3abcb +Matched, but too many substrings + 0: abcb + \O6abcb +Matched, but too many substrings + 0: abcb + 1: a + \O9abcb +Matched, but too many substrings + 0: abcb + 1: a + 2: b + \O12abcb + 0: abcb + 1: a + 2: b + 3: c + +/(a)bc|(a)(b)\2/ +Capturing subpattern count = 3 +Max back reference = 2 +No options +First char = 'a' +No need char + abc + 0: abc + 1: a + \O0abc +Matched, but too many substrings + \O3abc +Matched, but too many substrings + 0: abc + \O6abc + 0: abc + 1: a + aba + 0: aba + 1: + 2: a + 3: b + \O0aba +Matched, but too many substrings + \O3aba +Matched, but too many substrings + 0: aba + \O6aba +Matched, but too many substrings + 0: aba + 1: + \O9aba +Matched, but too many substrings + 0: aba + 1: + 2: a + \O12aba + 0: aba + 1: + 2: a + 3: b + +/abc$/E +Capturing subpattern count = 0 +Options: dollar_endonly +First char = 'a' +Need char = 'c' + abc + 0: abc + *** Failers +No match + abc\n +No match + abc\ndef +No match + +/(a)(b)(c)(d)(e)\6/ +Failed: reference to non-existent subpattern at offset 17 + +/the quick brown fox/ +Capturing subpattern count = 0 +No options +First char = 't' +Need char = 'x' + the quick brown fox + 0: the quick brown fox + this is a line with the quick brown fox + 0: the quick brown fox + +/the quick brown fox/A +Capturing subpattern count = 0 +Options: anchored +No first char +No need char + the quick brown fox + 0: the quick brown fox + *** Failers +No match + this is a line with the quick brown fox +No match + +/ab(?z)cd/ +Failed: unrecognized character after (? at offset 4 + +/^abc|def/ +Capturing subpattern count = 0 +No options +No first char +No need char + abcdef + 0: abc + abcdef\B + 0: def + +/.*((abc)$|(def))/ +Capturing subpattern count = 3 +Partial matching not supported +No options +First char at start or follows \n +No need char + defabc + 0: defabc + 1: abc + 2: abc + \Zdefabc + 0: def + 1: def + 2: + 3: def + +/abc/P + abc + 0: abc + *** Failers +No match: POSIX code 17: match failed + +/^abc|def/P + abcdef + 0: abc + abcdef\B + 0: def + +/.*((abc)$|(def))/P + defabc + 0: defabc + 1: abc + 2: abc + \Zdefabc + 0: def + 1: def + 3: def + +/the quick brown fox/P + the quick brown fox + 0: the quick brown fox + *** Failers +No match: POSIX code 17: match failed + The Quick Brown Fox +No match: POSIX code 17: match failed + +/the quick brown fox/Pi + the quick brown fox + 0: the quick brown fox + The Quick Brown Fox + 0: The Quick Brown Fox + +/abc.def/P + *** Failers +No match: POSIX code 17: match failed + abc\ndef +No match: POSIX code 17: match failed + +/abc$/P + abc + 0: abc + abc\n + 0: abc + +/(abc)\2/P +Failed: POSIX code 15: bad back reference at offset 7 + +/(abc\1)/P + abc +No match: POSIX code 17: match failed + +/)/ +Failed: unmatched parentheses at offset 0 + +/a[]b/ +Failed: missing terminating ] for character class at offset 4 + +/[^aeiou ]{3,}/ +Capturing subpattern count = 0 +Partial matching not supported +No options +No first char +No need char + co-processors, and for + 0: -pr + +/<.*>/ +Capturing subpattern count = 0 +Partial matching not supported +No options +First char = '<' +Need char = '>' + abcghinop + 0: ghi + +/<.*?>/ +Capturing subpattern count = 0 +Partial matching not supported +No options +First char = '<' +Need char = '>' + abcghinop + 0: + +/<.*>/U +Capturing subpattern count = 0 +Partial matching not supported +Options: ungreedy +First char = '<' +Need char = '>' + abcghinop + 0: + +/(?U)<.*>/ +Capturing subpattern count = 0 +Partial matching not supported +Options: ungreedy +First char = '<' +Need char = '>' + abcghinop + 0: + +/<.*?>/U +Capturing subpattern count = 0 +Partial matching not supported +Options: ungreedy +First char = '<' +Need char = '>' + abcghinop + 0: ghi + +/={3,}/U +Capturing subpattern count = 0 +Partial matching not supported +Options: ungreedy +First char = '=' +Need char = '=' + abc========def + 0: === + +/(?U)={3,}?/ +Capturing subpattern count = 0 +Partial matching not supported +Options: ungreedy +First char = '=' +Need char = '=' + abc========def + 0: ======== + +/(?^abc)/m +Capturing subpattern count = 0 +Options: multiline +First char at start or follows \n +Need char = 'c' + abc + 0: abc + def\nabc + 0: abc + *** Failers +No match + defabc +No match + +/(?<=ab(c+)d)ef/ +Failed: lookbehind assertion is not fixed length at offset 11 + +/(?<=ab(?<=c+)d)ef/ +Failed: lookbehind assertion is not fixed length at offset 12 + +/(?<=ab(c|de)f)g/ +Failed: lookbehind assertion is not fixed length at offset 13 + +/The next three are in testinput2 because they have variable length branches/ +Capturing subpattern count = 0 +No options +First char = 'T' +Need char = 's' + +/(?<=bullock|donkey)-cart/ +Capturing subpattern count = 0 +No options +First char = '-' +Need char = 't' + the bullock-cart + 0: -cart + a donkey-cart race + 0: -cart + *** Failers +No match + cart +No match + horse-and-cart +No match + +/(?<=ab(?i)x|y|z)/ +Capturing subpattern count = 0 +No options +Case state changes +No first char +No need char + +/(?>.*)(?<=(abcd)|(xyz))/ +Capturing subpattern count = 2 +Partial matching not supported +No options +First char at start or follows \n +No need char + alphabetabcd + 0: alphabetabcd + 1: abcd + endingxyz + 0: endingxyz + 1: + 2: xyz + +/(?<=ab(?i)x(?-i)y|(?i)z|b)ZZ/ +Capturing subpattern count = 0 +No options +Case state changes +First char = 'Z' +Need char = 'Z' + abxyZZ + 0: ZZ + abXyZZ + 0: ZZ + ZZZ + 0: ZZ + zZZ + 0: ZZ + bZZ + 0: ZZ + BZZ + 0: ZZ + *** Failers +No match + ZZ +No match + abXYZZ +No match + zzz +No match + bzz +No match + +/(? + 3: f + 1G a (1) + 2G (0) + 3G f (1) +get substring 4 failed -7 + 0L adef + 1L a + 2L + 3L f + bcdef\G1\G2\G3\G4\L + 0: bcdef + 1: bc + 2: bc + 3: f + 1G bc (2) + 2G bc (2) + 3G f (1) +get substring 4 failed -7 + 0L bcdef + 1L bc + 2L bc + 3L f + adefghijk\C0 + 0: adef + 1: a + 2: + 3: f + 0C adef (4) + +/^abc\00def/ +Capturing subpattern count = 0 +Options: anchored +No first char +No need char + abc\00def\L\C0 + 0: abc\x00def + 0C abc (7) + 0L abc + +/word ((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ +)((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ +)?)?)?)?)?)?)?)?)?otherword/M +Memory allocation (code space): 432 +Capturing subpattern count = 8 +Partial matching not supported +No options +First char = 'w' +Need char = 'd' + +/.*X/D +------------------------------------------------------------------ + 0 7 Bra 0 + 3 Any* + 5 X + 7 7 Ket + 10 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Partial matching not supported +No options +First char at start or follows \n +Need char = 'X' + +/.*X/Ds +------------------------------------------------------------------ + 0 7 Bra 0 + 3 Any* + 5 X + 7 7 Ket + 10 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Partial matching not supported +Options: anchored dotall +No first char +Need char = 'X' + +/(.*X|^B)/D +------------------------------------------------------------------ + 0 19 Bra 0 + 3 7 Bra 1 + 6 Any* + 8 X + 10 6 Alt + 13 ^ + 14 B + 16 13 Ket + 19 19 Ket + 22 End +------------------------------------------------------------------ +Capturing subpattern count = 1 +Partial matching not supported +No options +First char at start or follows \n +No need char + +/(.*X|^B)/Ds +------------------------------------------------------------------ + 0 19 Bra 0 + 3 7 Bra 1 + 6 Any* + 8 X + 10 6 Alt + 13 ^ + 14 B + 16 13 Ket + 19 19 Ket + 22 End +------------------------------------------------------------------ +Capturing subpattern count = 1 +Partial matching not supported +Options: anchored dotall +No first char +No need char + +/(?s)(.*X|^B)/D +------------------------------------------------------------------ + 0 19 Bra 0 + 3 7 Bra 1 + 6 Any* + 8 X + 10 6 Alt + 13 ^ + 14 B + 16 13 Ket + 19 19 Ket + 22 End +------------------------------------------------------------------ +Capturing subpattern count = 1 +Partial matching not supported +Options: anchored dotall +No first char +No need char + +/(?s:.*X|^B)/D +------------------------------------------------------------------ + 0 25 Bra 0 + 3 9 Bra 0 + 6 04 Opt + 8 Any* + 10 X + 12 8 Alt + 15 04 Opt + 17 ^ + 18 B + 20 17 Ket + 23 00 Opt + 25 25 Ket + 28 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Partial matching not supported +No options +First char at start or follows \n +No need char + +/\Biss\B/+ +Capturing subpattern count = 0 +No options +First char = 'i' +Need char = 's' + Mississippi + 0: iss + 0+ issippi + +/\Biss\B/+P + Mississippi + 0: iss + 0+ issippi + +/iss/G+ +Capturing subpattern count = 0 +No options +First char = 'i' +Need char = 's' + Mississippi + 0: iss + 0+ issippi + 0: iss + 0+ ippi + +/\Biss\B/G+ +Capturing subpattern count = 0 +No options +First char = 'i' +Need char = 's' + Mississippi + 0: iss + 0+ issippi + +/\Biss\B/g+ +Capturing subpattern count = 0 +No options +First char = 'i' +Need char = 's' + Mississippi + 0: iss + 0+ issippi + 0: iss + 0+ ippi + *** Failers +No match + Mississippi\A +No match + +/(?<=[Ms])iss/g+ +Capturing subpattern count = 0 +No options +First char = 'i' +Need char = 's' + Mississippi + 0: iss + 0+ issippi + 0: iss + 0+ ippi + +/(?<=[Ms])iss/G+ +Capturing subpattern count = 0 +No options +First char = 'i' +Need char = 's' + Mississippi + 0: iss + 0+ issippi + +/^iss/g+ +Capturing subpattern count = 0 +Options: anchored +No first char +No need char + ississippi + 0: iss + 0+ issippi + +/.*iss/g+ +Capturing subpattern count = 0 +Partial matching not supported +No options +First char at start or follows \n +Need char = 's' + abciss\nxyzisspqr + 0: abciss + 0+ \x0axyzisspqr + 0: xyziss + 0+ pqr + +/.i./+g +Capturing subpattern count = 0 +No options +No first char +Need char = 'i' + Mississippi + 0: Mis + 0+ sissippi + 0: sis + 0+ sippi + 0: sip + 0+ pi + Mississippi\A + 0: Mis + 0+ sissippi + 0: sis + 0+ sippi + 0: sip + 0+ pi + Missouri river + 0: Mis + 0+ souri river + 0: ri + 0+ river + 0: riv + 0+ er + Missouri river\A + 0: Mis + 0+ souri river + +/^.is/+g +Capturing subpattern count = 0 +Options: anchored +No first char +No need char + Mississippi + 0: Mis + 0+ sissippi + +/^ab\n/g+ +Capturing subpattern count = 0 +Options: anchored +No first char +No need char + ab\nab\ncd + 0: ab\x0a + 0+ ab\x0acd + +/^ab\n/mg+ +Capturing subpattern count = 0 +Options: multiline +First char at start or follows \n +Need char = 10 + ab\nab\ncd + 0: ab\x0a + 0+ ab\x0acd + 0: ab\x0a + 0+ cd + +/abc/ +Capturing subpattern count = 0 +No options +First char = 'a' +Need char = 'c' + +/abc|bac/ +Capturing subpattern count = 0 +No options +No first char +Need char = 'c' + +/(abc|bac)/ +Capturing subpattern count = 1 +No options +No first char +Need char = 'c' + +/(abc|(c|dc))/ +Capturing subpattern count = 2 +No options +No first char +Need char = 'c' + +/(abc|(d|de)c)/ +Capturing subpattern count = 2 +No options +No first char +Need char = 'c' + +/a*/ +Capturing subpattern count = 0 +Partial matching not supported +No options +No first char +No need char + +/a+/ +Capturing subpattern count = 0 +Partial matching not supported +No options +First char = 'a' +No need char + +/(baa|a+)/ +Capturing subpattern count = 1 +Partial matching not supported +No options +No first char +Need char = 'a' + +/a{0,3}/ +Capturing subpattern count = 0 +Partial matching not supported +No options +No first char +No need char + +/baa{3,}/ +Capturing subpattern count = 0 +Partial matching not supported +No options +First char = 'b' +Need char = 'a' + +/"([^\\"]+|\\.)*"/ +Capturing subpattern count = 1 +Partial matching not supported +No options +First char = '"' +Need char = '"' + +/(abc|ab[cd])/ +Capturing subpattern count = 1 +No options +First char = 'a' +No need char + +/(a|.)/ +Capturing subpattern count = 1 +No options +No first char +No need char + +/a|ba|\w/ +Capturing subpattern count = 0 +No options +No first char +No need char + +/abc(?=pqr)/ +Capturing subpattern count = 0 +No options +First char = 'a' +Need char = 'r' + +/...(?<=abc)/ +Capturing subpattern count = 0 +No options +No first char +No need char + +/abc(?!pqr)/ +Capturing subpattern count = 0 +No options +First char = 'a' +Need char = 'c' + +/ab./ +Capturing subpattern count = 0 +No options +First char = 'a' +Need char = 'b' + +/ab[xyz]/ +Capturing subpattern count = 0 +No options +First char = 'a' +Need char = 'b' + +/abc*/ +Capturing subpattern count = 0 +Partial matching not supported +No options +First char = 'a' +Need char = 'b' + +/ab.c*/ +Capturing subpattern count = 0 +Partial matching not supported +No options +First char = 'a' +Need char = 'b' + +/a.c*/ +Capturing subpattern count = 0 +Partial matching not supported +No options +First char = 'a' +No need char + +/.c*/ +Capturing subpattern count = 0 +Partial matching not supported +No options +No first char +No need char + +/ac*/ +Capturing subpattern count = 0 +Partial matching not supported +No options +First char = 'a' +No need char + +/(a.c*|b.c*)/ +Capturing subpattern count = 1 +Partial matching not supported +No options +No first char +No need char + +/a.c*|aba/ +Capturing subpattern count = 0 +Partial matching not supported +No options +First char = 'a' +No need char + +/.+a/ +Capturing subpattern count = 0 +Partial matching not supported +No options +No first char +Need char = 'a' + +/(?=abcda)a.*/ +Capturing subpattern count = 0 +Partial matching not supported +No options +First char = 'a' +Need char = 'a' + +/(?=a)a.*/ +Capturing subpattern count = 0 +Partial matching not supported +No options +First char = 'a' +No need char + +/a(b)*/ +Capturing subpattern count = 1 +No options +First char = 'a' +No need char + +/a\d*/ +Capturing subpattern count = 0 +Partial matching not supported +No options +First char = 'a' +No need char + +/ab\d*/ +Capturing subpattern count = 0 +Partial matching not supported +No options +First char = 'a' +Need char = 'b' + +/a(\d)*/ +Capturing subpattern count = 1 +No options +First char = 'a' +No need char + +/abcde{0,0}/ +Capturing subpattern count = 0 +No options +First char = 'a' +Need char = 'd' + +/ab\d+/ +Capturing subpattern count = 0 +Partial matching not supported +No options +First char = 'a' +Need char = 'b' + +/a(?(1)b)/ +Capturing subpattern count = 0 +No options +First char = 'a' +No need char + +/a(?(1)bag|big)/ +Capturing subpattern count = 0 +No options +First char = 'a' +Need char = 'g' + +/a(?(1)bag|big)*/ +Capturing subpattern count = 0 +No options +First char = 'a' +No need char + +/a(?(1)bag|big)+/ +Capturing subpattern count = 0 +No options +First char = 'a' +Need char = 'g' + +/a(?(1)b..|b..)/ +Capturing subpattern count = 0 +No options +First char = 'a' +Need char = 'b' + +/ab\d{0}e/ +Capturing subpattern count = 0 +No options +First char = 'a' +Need char = 'e' + +/a?b?/ +Capturing subpattern count = 0 +No options +No first char +No need char + a + 0: a + b + 0: b + ab + 0: ab + \ + 0: + *** Failers + 0: + \N +No match + +/|-/ +Capturing subpattern count = 0 +No options +No first char +No need char + abcd + 0: + -abc + 0: + \Nab-c + 0: - + *** Failers + 0: + \Nabc +No match + +/a*(b+)(z)(z)/P + aaaabbbbzzzz + 0: aaaabbbbzz + 1: bbbb + 2: z + 3: z + aaaabbbbzzzz\O0 + aaaabbbbzzzz\O1 + 0: aaaabbbbzz + aaaabbbbzzzz\O2 + 0: aaaabbbbzz + 1: bbbb + aaaabbbbzzzz\O3 + 0: aaaabbbbzz + 1: bbbb + 2: z + aaaabbbbzzzz\O4 + 0: aaaabbbbzz + 1: bbbb + 2: z + 3: z + aaaabbbbzzzz\O5 + 0: aaaabbbbzz + 1: bbbb + 2: z + 3: z + +/^.?abcd/S +Capturing subpattern count = 0 +Options: anchored +No first char +Need char = 'd' +Study returned NULL + +/\( # ( at start + (?: # Non-capturing bracket + (?>[^()]+) # Either a sequence of non-brackets (no backtracking) + | # Or + (?R) # Recurse - i.e. nested bracketed string + )* # Zero or more contents + \) # Closing ) + /x +Capturing subpattern count = 0 +Partial matching not supported +Options: extended +First char = '(' +Need char = ')' + (abcd) + 0: (abcd) + (abcd)xyz + 0: (abcd) + xyz(abcd) + 0: (abcd) + (ab(xy)cd)pqr + 0: (ab(xy)cd) + (ab(xycd)pqr + 0: (xycd) + () abc () + 0: () + 12(abcde(fsh)xyz(foo(bar))lmno)89 + 0: (abcde(fsh)xyz(foo(bar))lmno) + *** Failers +No match + abcd +No match + abcd) +No match + (abcd +No match + +/\( ( (?>[^()]+) | (?R) )* \) /xg +Capturing subpattern count = 1 +Partial matching not supported +Options: extended +First char = '(' +Need char = ')' + (ab(xy)cd)pqr + 0: (ab(xy)cd) + 1: cd + 1(abcd)(x(y)z)pqr + 0: (abcd) + 1: abcd + 0: (x(y)z) + 1: z + +/\( (?: (?>[^()]+) | (?R) ) \) /x +Capturing subpattern count = 0 +Partial matching not supported +Options: extended +First char = '(' +Need char = ')' + (abcd) + 0: (abcd) + (ab(xy)cd) + 0: (xy) + (a(b(c)d)e) + 0: (c) + ((ab)) + 0: ((ab)) + *** Failers +No match + () +No match + +/\( (?: (?>[^()]+) | (?R) )? \) /x +Capturing subpattern count = 0 +Partial matching not supported +Options: extended +First char = '(' +Need char = ')' + () + 0: () + 12(abcde(fsh)xyz(foo(bar))lmno)89 + 0: (fsh) + +/\( ( (?>[^()]+) | (?R) )* \) /x +Capturing subpattern count = 1 +Partial matching not supported +Options: extended +First char = '(' +Need char = ')' + (ab(xy)cd) + 0: (ab(xy)cd) + 1: cd + +/\( ( ( (?>[^()]+) | (?R) )* ) \) /x +Capturing subpattern count = 2 +Partial matching not supported +Options: extended +First char = '(' +Need char = ')' + (ab(xy)cd) + 0: (ab(xy)cd) + 1: ab(xy)cd + 2: cd + +/\( (123)? ( ( (?>[^()]+) | (?R) )* ) \) /x +Capturing subpattern count = 3 +Partial matching not supported +Options: extended +First char = '(' +Need char = ')' + (ab(xy)cd) + 0: (ab(xy)cd) + 1: + 2: ab(xy)cd + 3: cd + (123ab(xy)cd) + 0: (123ab(xy)cd) + 1: 123 + 2: ab(xy)cd + 3: cd + +/\( ( (123)? ( (?>[^()]+) | (?R) )* ) \) /x +Capturing subpattern count = 3 +Partial matching not supported +Options: extended +First char = '(' +Need char = ')' + (ab(xy)cd) + 0: (ab(xy)cd) + 1: ab(xy)cd + 2: + 3: cd + (123ab(xy)cd) + 0: (123ab(xy)cd) + 1: 123ab(xy)cd + 2: 123 + 3: cd + +/\( (((((((((( ( (?>[^()]+) | (?R) )* )))))))))) \) /x +Capturing subpattern count = 11 +Partial matching not supported +Options: extended +First char = '(' +Need char = ')' + (ab(xy)cd) + 0: (ab(xy)cd) + 1: ab(xy)cd + 2: ab(xy)cd + 3: ab(xy)cd + 4: ab(xy)cd + 5: ab(xy)cd + 6: ab(xy)cd + 7: ab(xy)cd + 8: ab(xy)cd + 9: ab(xy)cd +10: ab(xy)cd +11: cd + +/\( ( ( (?>[^()<>]+) | ((?>[^()]+)) | (?R) )* ) \) /x +Capturing subpattern count = 3 +Partial matching not supported +Options: extended +First char = '(' +Need char = ')' + (abcd(xyz

    qrs)123) + 0: (abcd(xyz

    qrs)123) + 1: abcd(xyz

    qrs)123 + 2: 123 + 3: + +/\( ( ( (?>[^()]+) | ((?R)) )* ) \) /x +Capturing subpattern count = 3 +Partial matching not supported +Options: extended +First char = '(' +Need char = ')' + (ab(cd)ef) + 0: (ab(cd)ef) + 1: ab(cd)ef + 2: ef + 3: (cd) + (ab(cd(ef)gh)ij) + 0: (ab(cd(ef)gh)ij) + 1: ab(cd(ef)gh)ij + 2: ij + 3: (cd(ef)gh) + +/^[[:alnum:]]/D +------------------------------------------------------------------ + 0 37 Bra 0 + 3 ^ + 4 [0-9A-Za-z] + 37 37 Ket + 40 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: anchored +No first char +No need char + +/^[[:^alnum:]]/D +------------------------------------------------------------------ + 0 37 Bra 0 + 3 ^ + 4 [\x00-/:-@[-`{-\xff] + 37 37 Ket + 40 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: anchored +No first char +No need char + +/^[[:alpha:]]/D +------------------------------------------------------------------ + 0 37 Bra 0 + 3 ^ + 4 [A-Za-z] + 37 37 Ket + 40 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: anchored +No first char +No need char + +/^[[:^alpha:]]/D +------------------------------------------------------------------ + 0 37 Bra 0 + 3 ^ + 4 [\x00-@[-`{-\xff] + 37 37 Ket + 40 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: anchored +No first char +No need char + +/^[[:ascii:]]/D +------------------------------------------------------------------ + 0 37 Bra 0 + 3 ^ + 4 [\x00-\x7f] + 37 37 Ket + 40 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: anchored +No first char +No need char + +/^[[:^ascii:]]/D +------------------------------------------------------------------ + 0 37 Bra 0 + 3 ^ + 4 [\x80-\xff] + 37 37 Ket + 40 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: anchored +No first char +No need char + +/^[[:blank:]]/D +------------------------------------------------------------------ + 0 37 Bra 0 + 3 ^ + 4 [\x09 ] + 37 37 Ket + 40 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: anchored +No first char +No need char + +/^[[:cntrl:]]/D +------------------------------------------------------------------ + 0 37 Bra 0 + 3 ^ + 4 [\x00-\x1f\x7f] + 37 37 Ket + 40 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: anchored +No first char +No need char + +/^[[:digit:]]/D +------------------------------------------------------------------ + 0 37 Bra 0 + 3 ^ + 4 [0-9] + 37 37 Ket + 40 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: anchored +No first char +No need char + +/^[[:graph:]]/D +------------------------------------------------------------------ + 0 37 Bra 0 + 3 ^ + 4 [!-~] + 37 37 Ket + 40 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: anchored +No first char +No need char + +/^[[:lower:]]/D +------------------------------------------------------------------ + 0 37 Bra 0 + 3 ^ + 4 [a-z] + 37 37 Ket + 40 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: anchored +No first char +No need char + +/^[[:print:]]/D +------------------------------------------------------------------ + 0 37 Bra 0 + 3 ^ + 4 [ -~] + 37 37 Ket + 40 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: anchored +No first char +No need char + +/^[[:punct:]]/D +------------------------------------------------------------------ + 0 37 Bra 0 + 3 ^ + 4 [!-/:-@[-`{-~] + 37 37 Ket + 40 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: anchored +No first char +No need char + +/^[[:space:]]/D +------------------------------------------------------------------ + 0 37 Bra 0 + 3 ^ + 4 [\x09-\x0d ] + 37 37 Ket + 40 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: anchored +No first char +No need char + +/^[[:upper:]]/D +------------------------------------------------------------------ + 0 37 Bra 0 + 3 ^ + 4 [A-Z] + 37 37 Ket + 40 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: anchored +No first char +No need char + +/^[[:xdigit:]]/D +------------------------------------------------------------------ + 0 37 Bra 0 + 3 ^ + 4 [0-9A-Fa-f] + 37 37 Ket + 40 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: anchored +No first char +No need char + +/^[[:word:]]/D +------------------------------------------------------------------ + 0 37 Bra 0 + 3 ^ + 4 [0-9A-Z_a-z] + 37 37 Ket + 40 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: anchored +No first char +No need char + +/^[[:^cntrl:]]/D +------------------------------------------------------------------ + 0 37 Bra 0 + 3 ^ + 4 [ -~\x80-\xff] + 37 37 Ket + 40 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: anchored +No first char +No need char + +/^[12[:^digit:]]/D +------------------------------------------------------------------ + 0 37 Bra 0 + 3 ^ + 4 [\x00-/12:-\xff] + 37 37 Ket + 40 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: anchored +No first char +No need char + +/^[[:^blank:]]/D +------------------------------------------------------------------ + 0 37 Bra 0 + 3 ^ + 4 [\x00-\x08\x0a-\x1f!-\xff] + 37 37 Ket + 40 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: anchored +No first char +No need char + +/[01[:alpha:]%]/D +------------------------------------------------------------------ + 0 36 Bra 0 + 3 [%01A-Za-z] + 36 36 Ket + 39 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +No options +No first char +No need char + +/[[.ch.]]/ +Failed: POSIX collating elements are not supported at offset 1 + +/[[=ch=]]/ +Failed: POSIX collating elements are not supported at offset 1 + +/[[:rhubarb:]]/ +Failed: unknown POSIX class name at offset 3 + +/[[:upper:]]/i +Capturing subpattern count = 0 +Options: caseless +No first char +No need char + A + 0: A + a + 0: a + +/[[:lower:]]/i +Capturing subpattern count = 0 +Options: caseless +No first char +No need char + A + 0: A + a + 0: a + +/((?-i)[[:lower:]])[[:lower:]]/i +Capturing subpattern count = 1 +Options: caseless +Case state changes +No first char +No need char + ab + 0: ab + 1: a + aB + 0: aB + 1: a + *** Failers + 0: ai + 1: a + Ab +No match + AB +No match + +/[\200-\410]/ +Failed: range out of order in character class at offset 9 + +/^(?(0)f|b)oo/ +Failed: invalid condition (?(0) at offset 5 + +/This one's here because of the large output vector needed/ +Capturing subpattern count = 0 +No options +First char = 'T' +Need char = 'd' + +/(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\w+)\s+(\270)/ +Capturing subpattern count = 271 +Max back reference = 270 +Partial matching not supported +No options +No first char +No need char + \O900 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 ABC ABC + 0: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 ABC ABC + 1: 1 + 2: 2 + 3: 3 + 4: 4 + 5: 5 + 6: 6 + 7: 7 + 8: 8 + 9: 9 +10: 10 +11: 11 +12: 12 +13: 13 +14: 14 +15: 15 +16: 16 +17: 17 +18: 18 +19: 19 +20: 20 +21: 21 +22: 22 +23: 23 +24: 24 +25: 25 +26: 26 +27: 27 +28: 28 +29: 29 +30: 30 +31: 31 +32: 32 +33: 33 +34: 34 +35: 35 +36: 36 +37: 37 +38: 38 +39: 39 +40: 40 +41: 41 +42: 42 +43: 43 +44: 44 +45: 45 +46: 46 +47: 47 +48: 48 +49: 49 +50: 50 +51: 51 +52: 52 +53: 53 +54: 54 +55: 55 +56: 56 +57: 57 +58: 58 +59: 59 +60: 60 +61: 61 +62: 62 +63: 63 +64: 64 +65: 65 +66: 66 +67: 67 +68: 68 +69: 69 +70: 70 +71: 71 +72: 72 +73: 73 +74: 74 +75: 75 +76: 76 +77: 77 +78: 78 +79: 79 +80: 80 +81: 81 +82: 82 +83: 83 +84: 84 +85: 85 +86: 86 +87: 87 +88: 88 +89: 89 +90: 90 +91: 91 +92: 92 +93: 93 +94: 94 +95: 95 +96: 96 +97: 97 +98: 98 +99: 99 +100: 100 +101: 101 +102: 102 +103: 103 +104: 104 +105: 105 +106: 106 +107: 107 +108: 108 +109: 109 +110: 110 +111: 111 +112: 112 +113: 113 +114: 114 +115: 115 +116: 116 +117: 117 +118: 118 +119: 119 +120: 120 +121: 121 +122: 122 +123: 123 +124: 124 +125: 125 +126: 126 +127: 127 +128: 128 +129: 129 +130: 130 +131: 131 +132: 132 +133: 133 +134: 134 +135: 135 +136: 136 +137: 137 +138: 138 +139: 139 +140: 140 +141: 141 +142: 142 +143: 143 +144: 144 +145: 145 +146: 146 +147: 147 +148: 148 +149: 149 +150: 150 +151: 151 +152: 152 +153: 153 +154: 154 +155: 155 +156: 156 +157: 157 +158: 158 +159: 159 +160: 160 +161: 161 +162: 162 +163: 163 +164: 164 +165: 165 +166: 166 +167: 167 +168: 168 +169: 169 +170: 170 +171: 171 +172: 172 +173: 173 +174: 174 +175: 175 +176: 176 +177: 177 +178: 178 +179: 179 +180: 180 +181: 181 +182: 182 +183: 183 +184: 184 +185: 185 +186: 186 +187: 187 +188: 188 +189: 189 +190: 190 +191: 191 +192: 192 +193: 193 +194: 194 +195: 195 +196: 196 +197: 197 +198: 198 +199: 199 +200: 200 +201: 201 +202: 202 +203: 203 +204: 204 +205: 205 +206: 206 +207: 207 +208: 208 +209: 209 +210: 210 +211: 211 +212: 212 +213: 213 +214: 214 +215: 215 +216: 216 +217: 217 +218: 218 +219: 219 +220: 220 +221: 221 +222: 222 +223: 223 +224: 224 +225: 225 +226: 226 +227: 227 +228: 228 +229: 229 +230: 230 +231: 231 +232: 232 +233: 233 +234: 234 +235: 235 +236: 236 +237: 237 +238: 238 +239: 239 +240: 240 +241: 241 +242: 242 +243: 243 +244: 244 +245: 245 +246: 246 +247: 247 +248: 248 +249: 249 +250: 250 +251: 251 +252: 252 +253: 253 +254: 254 +255: 255 +256: 256 +257: 257 +258: 258 +259: 259 +260: 260 +261: 261 +262: 262 +263: 263 +264: 264 +265: 265 +266: 266 +267: 267 +268: 268 +269: 269 +270: ABC +271: ABC + +/This one's here because Perl does this differently and PCRE can't at present/ +Capturing subpattern count = 0 +No options +First char = 'T' +Need char = 't' + +/(main(O)?)+/ +Capturing subpattern count = 2 +No options +First char = 'm' +Need char = 'n' + mainmain + 0: mainmain + 1: main + mainOmain + 0: mainOmain + 1: main + 2: O + +/These are all cases where Perl does it differently (nested captures)/ +Capturing subpattern count = 1 +No options +First char = 'T' +Need char = 's' + +/^(a(b)?)+$/ +Capturing subpattern count = 2 +Options: anchored +No first char +No need char + aba + 0: aba + 1: a + 2: b + +/^(aa(bb)?)+$/ +Capturing subpattern count = 2 +Options: anchored +No first char +No need char + aabbaa + 0: aabbaa + 1: aa + 2: bb + +/^(aa|aa(bb))+$/ +Capturing subpattern count = 2 +Options: anchored +No first char +No need char + aabbaa + 0: aabbaa + 1: aa + 2: bb + +/^(aa(bb)??)+$/ +Capturing subpattern count = 2 +Options: anchored +No first char +No need char + aabbaa + 0: aabbaa + 1: aa + 2: bb + +/^(?:aa(bb)?)+$/ +Capturing subpattern count = 1 +Options: anchored +No first char +No need char + aabbaa + 0: aabbaa + 1: bb + +/^(aa(b(b))?)+$/ +Capturing subpattern count = 3 +Options: anchored +No first char +No need char + aabbaa + 0: aabbaa + 1: aa + 2: bb + 3: b + +/^(?:aa(b(b))?)+$/ +Capturing subpattern count = 2 +Options: anchored +No first char +No need char + aabbaa + 0: aabbaa + 1: bb + 2: b + +/^(?:aa(b(?:b))?)+$/ +Capturing subpattern count = 1 +Options: anchored +No first char +No need char + aabbaa + 0: aabbaa + 1: bb + +/^(?:aa(bb(?:b))?)+$/ +Capturing subpattern count = 1 +Options: anchored +No first char +No need char + aabbbaa + 0: aabbbaa + 1: bbb + +/^(?:aa(b(?:bb))?)+$/ +Capturing subpattern count = 1 +Options: anchored +No first char +No need char + aabbbaa + 0: aabbbaa + 1: bbb + +/^(?:aa(?:b(b))?)+$/ +Capturing subpattern count = 1 +Options: anchored +No first char +No need char + aabbaa + 0: aabbaa + 1: b + +/^(?:aa(?:b(bb))?)+$/ +Capturing subpattern count = 1 +Options: anchored +No first char +No need char + aabbbaa + 0: aabbbaa + 1: bb + +/^(aa(b(bb))?)+$/ +Capturing subpattern count = 3 +Options: anchored +No first char +No need char + aabbbaa + 0: aabbbaa + 1: aa + 2: bbb + 3: bb + +/^(aa(bb(bb))?)+$/ +Capturing subpattern count = 3 +Options: anchored +No first char +No need char + aabbbbaa + 0: aabbbbaa + 1: aa + 2: bbbb + 3: bb + +/--------------------------------------------------------------------/ +Capturing subpattern count = 0 +No options +First char = '-' +Need char = '-' + +/#/xMD +Memory allocation (code space): 7 +------------------------------------------------------------------ + 0 3 Bra 0 + 3 3 Ket + 6 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: extended +No first char +No need char + +/a#/xMD +Memory allocation (code space): 9 +------------------------------------------------------------------ + 0 5 Bra 0 + 3 a + 5 5 Ket + 8 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: extended +First char = 'a' +No need char + +/[\s]/D +------------------------------------------------------------------ + 0 36 Bra 0 + 3 [\x09\x0a\x0c\x0d ] + 36 36 Ket + 39 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +No options +No first char +No need char + +/[\S]/D +------------------------------------------------------------------ + 0 36 Bra 0 + 3 [\x00-\x08\x0b\x0e-\x1f!-\xff] + 36 36 Ket + 39 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +No options +No first char +No need char + +/a(?i)b/D +------------------------------------------------------------------ + 0 9 Bra 0 + 3 a + 5 01 Opt + 7 NC b + 9 9 Ket + 12 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +No options +Case state changes +First char = 'a' +Need char = 'b' (caseless) + ab + 0: ab + aB + 0: aB + *** Failers +No match + AB +No match + +/(a(?i)b)/D +------------------------------------------------------------------ + 0 17 Bra 0 + 3 9 Bra 1 + 6 a + 8 01 Opt + 10 NC b + 12 9 Ket + 15 00 Opt + 17 17 Ket + 20 End +------------------------------------------------------------------ +Capturing subpattern count = 1 +No options +Case state changes +First char = 'a' +Need char = 'b' (caseless) + ab + 0: ab + 1: ab + aB + 0: aB + 1: aB + *** Failers +No match + AB +No match + +/ (?i)abc/xD +------------------------------------------------------------------ + 0 9 Bra 0 + 3 NC abc + 9 9 Ket + 12 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: caseless extended +First char = 'a' (caseless) +Need char = 'c' (caseless) + +/#this is a comment + (?i)abc/xD +------------------------------------------------------------------ + 0 9 Bra 0 + 3 NC abc + 9 9 Ket + 12 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: caseless extended +First char = 'a' (caseless) +Need char = 'c' (caseless) + +/123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890/D +------------------------------------------------------------------ + 0 603 Bra 0 + 3 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 +603 603 Ket +606 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +No options +First char = '1' +Need char = '0' + +/\Q123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890/D +------------------------------------------------------------------ + 0 603 Bra 0 + 3 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 +603 603 Ket +606 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +No options +First char = '1' +Need char = '0' + +/\Q\E/D +------------------------------------------------------------------ + 0 3 Bra 0 + 3 3 Ket + 6 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +No options +No first char +No need char + \ + 0: + +/\Q\Ex/D +------------------------------------------------------------------ + 0 5 Bra 0 + 3 x + 5 5 Ket + 8 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +No options +First char = 'x' +No need char + +/ \Q\E/D +------------------------------------------------------------------ + 0 5 Bra 0 + 3 + 5 5 Ket + 8 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +No options +First char = ' ' +No need char + +/a\Q\E/D +------------------------------------------------------------------ + 0 5 Bra 0 + 3 a + 5 5 Ket + 8 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +No options +First char = 'a' +No need char + abc + 0: a + bca + 0: a + bac + 0: a + +/a\Q\Eb/D +------------------------------------------------------------------ + 0 7 Bra 0 + 3 ab + 7 7 Ket + 10 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +No options +First char = 'a' +Need char = 'b' + abc + 0: ab + +/\Q\Eabc/D +------------------------------------------------------------------ + 0 9 Bra 0 + 3 abc + 9 9 Ket + 12 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +No options +First char = 'a' +Need char = 'c' + +/x*+\w/D +------------------------------------------------------------------ + 0 12 Bra 0 + 3 5 Once + 6 x* + 8 5 Ket + 11 \w + 12 12 Ket + 15 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Partial matching not supported +No options +No first char +No need char + *** Failers + 0: F + xxxxx +No match + +/x?+/D +------------------------------------------------------------------ + 0 11 Bra 0 + 3 5 Once + 6 x? + 8 5 Ket + 11 11 Ket + 14 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +No options +No first char +No need char + +/x++/D +------------------------------------------------------------------ + 0 11 Bra 0 + 3 5 Once + 6 x+ + 8 5 Ket + 11 11 Ket + 14 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Partial matching not supported +No options +First char = 'x' +No need char + +/x{1,3}+/D +------------------------------------------------------------------ + 0 15 Bra 0 + 3 9 Once + 6 x + 8 x{,2} + 12 9 Ket + 15 15 Ket + 18 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Partial matching not supported +No options +First char = 'x' +No need char + +/(x)*+/D +------------------------------------------------------------------ + 0 18 Bra 0 + 3 12 Once + 6 Brazero + 7 5 Bra 1 + 10 x + 12 5 KetRmax + 15 12 Ket + 18 18 Ket + 21 End +------------------------------------------------------------------ +Capturing subpattern count = 1 +No options +No first char +No need char + +/^(\w++|\s++)*$/ +Capturing subpattern count = 1 +Partial matching not supported +Options: anchored +No first char +No need char + now is the time for all good men to come to the aid of the party + 0: now is the time for all good men to come to the aid of the party + 1: party + *** Failers +No match + this is not a line with only words and spaces! +No match + +/(\d++)(\w)/ +Capturing subpattern count = 2 +Partial matching not supported +No options +No first char +No need char + 12345a + 0: 12345a + 1: 12345 + 2: a + *** Failers +No match + 12345+ +No match + +/a++b/ +Capturing subpattern count = 0 +Partial matching not supported +No options +First char = 'a' +Need char = 'b' + aaab + 0: aaab + +/(a++b)/ +Capturing subpattern count = 1 +Partial matching not supported +No options +First char = 'a' +Need char = 'b' + aaab + 0: aaab + 1: aaab + +/(a++)b/ +Capturing subpattern count = 1 +Partial matching not supported +No options +First char = 'a' +Need char = 'b' + aaab + 0: aaab + 1: aaa + +/([^()]++|\([^()]*\))+/ +Capturing subpattern count = 1 +Partial matching not supported +No options +No first char +No need char + ((abc(ade)ufh()()x + 0: abc(ade)ufh()()x + 1: x + +/\(([^()]++|\([^()]+\))+\)/ +Capturing subpattern count = 1 +Partial matching not supported +No options +First char = '(' +Need char = ')' + (abc) + 0: (abc) + 1: abc + (abc(def)xyz) + 0: (abc(def)xyz) + 1: xyz + *** Failers +No match + ((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +No match + +/(abc){1,3}+/D +------------------------------------------------------------------ + 0 53 Bra 0 + 3 47 Once + 6 9 Bra 1 + 9 abc + 15 9 Ket + 18 Brazero + 19 28 Bra 0 + 22 9 Bra 1 + 25 abc + 31 9 Ket + 34 Brazero + 35 9 Bra 1 + 38 abc + 44 9 Ket + 47 28 Ket + 50 47 Ket + 53 53 Ket + 56 End +------------------------------------------------------------------ +Capturing subpattern count = 1 +No options +First char = 'a' +Need char = 'c' + +/a+?+/ +Failed: nothing to repeat at offset 3 + +/a{2,3}?+b/ +Failed: nothing to repeat at offset 7 + +/(?U)a+?+/ +Failed: nothing to repeat at offset 7 + +/a{2,3}?+b/U +Failed: nothing to repeat at offset 7 + +/x(?U)a++b/D +------------------------------------------------------------------ + 0 15 Bra 0 + 3 x + 5 5 Once + 8 a+ + 10 5 Ket + 13 b + 15 15 Ket + 18 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Partial matching not supported +No options +First char = 'x' +Need char = 'b' + xaaaab + 0: xaaaab + +/(?U)xa++b/D +------------------------------------------------------------------ + 0 15 Bra 0 + 3 x + 5 5 Once + 8 a+ + 10 5 Ket + 13 b + 15 15 Ket + 18 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Partial matching not supported +Options: ungreedy +First char = 'x' +Need char = 'b' + xaaaab + 0: xaaaab + +/^((a+)(?U)([ab]+)(?-U)([bc]+)(\w*))/D +------------------------------------------------------------------ + 0 106 Bra 0 + 3 ^ + 4 99 Bra 1 + 7 5 Bra 2 + 10 a+ + 12 5 Ket + 15 37 Bra 3 + 18 [ab]+? + 52 37 Ket + 55 37 Bra 4 + 58 [bc]+ + 92 37 Ket + 95 5 Bra 5 + 98 \w* +100 5 Ket +103 99 Ket +106 106 Ket +109 End +------------------------------------------------------------------ +Capturing subpattern count = 5 +Partial matching not supported +Options: anchored +No first char +No need char + +/^x(?U)a+b/D +------------------------------------------------------------------ + 0 10 Bra 0 + 3 ^ + 4 x + 6 a+? + 8 b + 10 10 Ket + 13 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Partial matching not supported +Options: anchored +No first char +Need char = 'b' + +/^x(?U)(a+)b/D +------------------------------------------------------------------ + 0 16 Bra 0 + 3 ^ + 4 x + 6 5 Bra 1 + 9 a+? + 11 5 Ket + 14 b + 16 16 Ket + 19 End +------------------------------------------------------------------ +Capturing subpattern count = 1 +Partial matching not supported +Options: anchored +No first char +Need char = 'b' + +/[.x.]/ +Failed: POSIX collating elements are not supported at offset 0 + +/[=x=]/ +Failed: POSIX collating elements are not supported at offset 0 + +/[:x:]/ +Failed: POSIX named classes are supported only within a class at offset 0 + +/\l/ +Failed: PCRE does not support \L, \l, \N, \U, or \u at offset 1 + +/\L/ +Failed: PCRE does not support \L, \l, \N, \U, or \u at offset 1 + +/\N{name}/ +Failed: PCRE does not support \L, \l, \N, \U, or \u at offset 1 + +/\u/ +Failed: PCRE does not support \L, \l, \N, \U, or \u at offset 1 + +/\U/ +Failed: PCRE does not support \L, \l, \N, \U, or \u at offset 1 + +/[/ +Failed: missing terminating ] for character class at offset 1 + +/[a-/ +Failed: missing terminating ] for character class at offset 3 + +/[[:space:]/ +Failed: missing terminating ] for character class at offset 10 + +/[\s]/DM +Memory allocation (code space): 40 +------------------------------------------------------------------ + 0 36 Bra 0 + 3 [\x09\x0a\x0c\x0d ] + 36 36 Ket + 39 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +No options +No first char +No need char + +/[[:space:]]/DM +Memory allocation (code space): 40 +------------------------------------------------------------------ + 0 36 Bra 0 + 3 [\x09-\x0d ] + 36 36 Ket + 39 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +No options +No first char +No need char + +/[[:space:]abcde]/DM +Memory allocation (code space): 40 +------------------------------------------------------------------ + 0 36 Bra 0 + 3 [\x09-\x0d a-e] + 36 36 Ket + 39 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +No options +No first char +No need char + +/< (?: (?(R) \d++ | [^<>]*+) | (?R)) * >/x +Capturing subpattern count = 0 +Partial matching not supported +Options: extended +First char = '<' +Need char = '>' + <> + 0: <> + + 0: + hij> + 0: hij> + hij> + 0: + def> + 0: def> + + 0: <> + *** Failers +No match + iV\;\?aPhFB\<\*vW\@QW\@sO9\}cfZA\-i\'w\%hKd6gt1UJP\,15_\#QY\$M\^Mss_U\/\]\&LK9\[5vQub\^w\[KDD\qmj\;2\}YWFdYx\.Ap\]hjCPTP\(n28k\+3\;o\&WXqs\/gOXdr\$\:r\'do0\;b4c\(f_Gr\=\"\\4\)\[01T7ajQJvL\$W\~mL_sS\/4h\:x\*\[ZN\=KLs\&L5zX\/\/\>it\,o\:aU\(\;Z\>pW\&T7oP\'2K\^E\:x9\'c\[\%z\-\,64JQ5AeH_G\#KijUKghQw\^\\vea3a\?kka_G\$8\#\`\*kynsxzBLru\'\]k_\[7FrVx\}\^\=\$blx\>s\-N\%j\;D\*aZDnsw\:YKZ\%Q\.Kne9\#hP\?\+b3\(SOvL\,\^\;\&u5\@\?5C5Bhb\=m\-vEh_L15Jl\]U\)0RP6\{q\%L\^_z5E\'Dw6X\b|DM +Memory allocation (code space): 826 +------------------------------------------------------------------ + 0 822 Bra 0 + 3 8J$WE<.rX+ix[d1b!H#?vV0vrK:ZH1=2M>iV;?aPhFB<*vW@QW@sO9}cfZA-i'w%hKd6gt1UJP,15_#QY$M^Mss_U/]&LK9[5vQub^w[KDDqmj;2}YWFdYx.Ap]hjCPTP(n28k+3;o&WXqs/gOXdr$:r'do0;b4c(f_Gr="\4)[01T7ajQJvL$W~mL_sS/4h:x*[ZN=KLs&L5zX//>it,o:aU(;Z>pW&T7oP'2K^E:x9'c[%z-,64JQ5AeH_G#KijUKghQw^\vea3a?kka_G$8#`*kynsxzBLru']k_[7FrVx}^=$blx>s-N%j;D*aZDnsw:YKZ%Q.Kne9#hP?+b3(SOvL,^;&u5@?5C5Bhb=m-vEh_L15Jl]U)0RP6{q%L^_z5E'Dw6X +821 \b +822 822 Ket +825 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +No options +First char = '8' +Need char = 'X' + +|\$\<\.X\+ix\[d1b\!H\#\?vV0vrK\:ZH1\=2M\>iV\;\?aPhFB\<\*vW\@QW\@sO9\}cfZA\-i\'w\%hKd6gt1UJP\,15_\#QY\$M\^Mss_U\/\]\&LK9\[5vQub\^w\[KDD\qmj\;2\}YWFdYx\.Ap\]hjCPTP\(n28k\+3\;o\&WXqs\/gOXdr\$\:r\'do0\;b4c\(f_Gr\=\"\\4\)\[01T7ajQJvL\$W\~mL_sS\/4h\:x\*\[ZN\=KLs\&L5zX\/\/\>it\,o\:aU\(\;Z\>pW\&T7oP\'2K\^E\:x9\'c\[\%z\-\,64JQ5AeH_G\#KijUKghQw\^\\vea3a\?kka_G\$8\#\`\*kynsxzBLru\'\]k_\[7FrVx\}\^\=\$blx\>s\-N\%j\;D\*aZDnsw\:YKZ\%Q\.Kne9\#hP\?\+b3\(SOvL\,\^\;\&u5\@\?5C5Bhb\=m\-vEh_L15Jl\]U\)0RP6\{q\%L\^_z5E\'Dw6X\b|DM +Memory allocation (code space): 816 +------------------------------------------------------------------ + 0 812 Bra 0 + 3 $<.X+ix[d1b!H#?vV0vrK:ZH1=2M>iV;?aPhFB<*vW@QW@sO9}cfZA-i'w%hKd6gt1UJP,15_#QY$M^Mss_U/]&LK9[5vQub^w[KDDqmj;2}YWFdYx.Ap]hjCPTP(n28k+3;o&WXqs/gOXdr$:r'do0;b4c(f_Gr="\4)[01T7ajQJvL$W~mL_sS/4h:x*[ZN=KLs&L5zX//>it,o:aU(;Z>pW&T7oP'2K^E:x9'c[%z-,64JQ5AeH_G#KijUKghQw^\vea3a?kka_G$8#`*kynsxzBLru']k_[7FrVx}^=$blx>s-N%j;D*aZDnsw:YKZ%Q.Kne9#hP?+b3(SOvL,^;&u5@?5C5Bhb=m-vEh_L15Jl]U)0RP6{q%L^_z5E'Dw6X +811 \b +812 812 Ket +815 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +No options +First char = '$' +Need char = 'X' + +/(.*)\d+\1/I +Capturing subpattern count = 1 +Max back reference = 1 +Partial matching not supported +No options +No first char +No need char + +/(.*)\d+/I +Capturing subpattern count = 1 +Partial matching not supported +No options +First char at start or follows \n +No need char + +/(.*)\d+\1/Is +Capturing subpattern count = 1 +Max back reference = 1 +Partial matching not supported +Options: dotall +No first char +No need char + +/(.*)\d+/Is +Capturing subpattern count = 1 +Partial matching not supported +Options: anchored dotall +No first char +No need char + +/(.*(xyz))\d+\2/I +Capturing subpattern count = 2 +Max back reference = 2 +Partial matching not supported +No options +First char at start or follows \n +Need char = 'z' + +/((.*))\d+\1/I +Capturing subpattern count = 2 +Max back reference = 1 +Partial matching not supported +No options +No first char +No need char + abc123bc + 0: bc123bc + 1: bc + 2: bc + +/a[b]/I +Capturing subpattern count = 0 +No options +First char = 'a' +Need char = 'b' + +/(?=a).*/I +Capturing subpattern count = 0 +Partial matching not supported +No options +First char = 'a' +No need char + +/(?=abc).xyz/iI +Capturing subpattern count = 0 +Options: caseless +First char = 'a' (caseless) +Need char = 'z' (caseless) + +/(?=abc)(?i).xyz/I +Capturing subpattern count = 0 +No options +Case state changes +First char = 'a' +Need char = 'z' (caseless) + +/(?=a)(?=b)/I +Capturing subpattern count = 0 +No options +First char = 'a' +No need char + +/(?=.)a/I +Capturing subpattern count = 0 +No options +First char = 'a' +No need char + +/((?=abcda)a)/I +Capturing subpattern count = 1 +No options +First char = 'a' +Need char = 'a' + +/((?=abcda)ab)/I +Capturing subpattern count = 1 +No options +First char = 'a' +Need char = 'b' + +/()a/I +Capturing subpattern count = 1 +No options +No first char +Need char = 'a' + +/(?(1)ab|ac)/I +Capturing subpattern count = 0 +No options +First char = 'a' +No need char + +/(?(1)abz|acz)/I +Capturing subpattern count = 0 +No options +First char = 'a' +Need char = 'z' + +/(?(1)abz)/I +Capturing subpattern count = 0 +No options +No first char +No need char + +/(?(1)abz)123/I +Capturing subpattern count = 0 +No options +No first char +Need char = '3' + +/(a)+/I +Capturing subpattern count = 1 +No options +First char = 'a' +No need char + +/(a){2,3}/I +Capturing subpattern count = 1 +No options +First char = 'a' +Need char = 'a' + +/(a)*/I +Capturing subpattern count = 1 +No options +No first char +No need char + +/[a]/I +Capturing subpattern count = 0 +No options +First char = 'a' +No need char + +/[ab]/I +Capturing subpattern count = 0 +No options +No first char +No need char + +/[ab]/IS +Capturing subpattern count = 0 +No options +No first char +No need char +Starting byte set: a b + +/[^a]/I +Capturing subpattern count = 0 +No options +No first char +No need char + +/\d456/I +Capturing subpattern count = 0 +No options +No first char +Need char = '6' + +/\d456/IS +Capturing subpattern count = 0 +No options +No first char +Need char = '6' +Starting byte set: 0 1 2 3 4 5 6 7 8 9 + +/a^b/I +Capturing subpattern count = 0 +No options +First char = 'a' +Need char = 'b' + +/^a/mI +Capturing subpattern count = 0 +Options: multiline +First char at start or follows \n +Need char = 'a' + abcde + 0: a + xy\nabc + 0: a + *** Failers +No match + xyabc +No match + +/c|abc/I +Capturing subpattern count = 0 +No options +No first char +Need char = 'c' + +/(?i)[ab]/IS +Capturing subpattern count = 0 +Options: caseless +No first char +No need char +Starting byte set: A B a b + +/[ab](?i)cd/IS +Capturing subpattern count = 0 +No options +Case state changes +No first char +Need char = 'd' (caseless) +Starting byte set: a b + +/abc(?C)def/ +Capturing subpattern count = 0 +No options +First char = 'a' +Need char = 'f' + abcdef +--->abcdef + 0 ^ ^ d + 0: abcdef + 1234abcdef +--->1234abcdef + 0 ^ ^ d + 0: abcdef + *** Failers +No match + abcxyz +No match + abcxyzf +--->abcxyzf + 0 ^ ^ d +No match + +/abc(?C)de(?C1)f/ +Capturing subpattern count = 0 +No options +First char = 'a' +Need char = 'f' + 123abcdef +--->123abcdef + 0 ^ ^ d + 1 ^ ^ f + 0: abcdef + +/(?C1)\dabc(?C2)def/ +Capturing subpattern count = 0 +No options +No first char +Need char = 'f' + 1234abcdef +--->1234abcdef + 1 ^ \d + 1 ^ \d + 1 ^ \d + 1 ^ \d + 2 ^ ^ d + 0: 4abcdef + *** Failers +No match + abcdef +--->abcdef + 1 ^ \d + 1 ^ \d + 1 ^ \d + 1 ^ \d + 1 ^ \d + 1 ^ \d +No match + +/(?C255)ab/ +Capturing subpattern count = 0 +No options +First char = 'a' +Need char = 'b' + +/(?C256)ab/ +Failed: number after (?C is > 255 at offset 6 + +/(?Cab)xx/ +Failed: closing ) for (?C expected at offset 3 + +/(?C12vr)x/ +Failed: closing ) for (?C expected at offset 5 + +/abc(?C)def/ +Capturing subpattern count = 0 +No options +First char = 'a' +Need char = 'f' + *** Failers +No match + \x83\x0\x61bcdef +--->\x83\x00abcdef + 0 ^ ^ d + 0: abcdef + +/(abc)(?C)de(?C1)f/ +Capturing subpattern count = 1 +No options +First char = 'a' +Need char = 'f' + 123abcdef +--->123abcdef + 0 ^ ^ d + 1 ^ ^ f + 0: abcdef + 1: abc + 123abcdef\C+ +Callout 0: last capture = 1 + 0: + 1: abc +--->123abcdef + ^ ^ d +Callout 1: last capture = 1 + 0: + 1: abc +--->123abcdef + ^ ^ f + 0: abcdef + 1: abc + 123abcdef\C- + 0: abcdef + 1: abc + *** Failers +No match + 123abcdef\C!1 +--->123abcdef + 0 ^ ^ d + 1 ^ ^ f +No match + +/(?C0)(abc(?C1))*/ +Capturing subpattern count = 1 +No options +No first char +No need char + abcabcabc +--->abcabcabc + 0 ^ (abc(?C1))* + 1 ^ ^ ) + 1 ^ ^ ) + 1 ^ ^ ) + 0: abcabcabc + 1: abc + abcabc\C!1!3 +--->abcabc + 0 ^ (abc(?C1))* + 1 ^ ^ ) + 1 ^ ^ ) + 0: abcabc + 1: abc + *** Failers +--->*** Failers + 0 ^ (abc(?C1))* + 0: + abcabcabc\C!1!3 +--->abcabcabc + 0 ^ (abc(?C1))* + 1 ^ ^ ) + 1 ^ ^ ) + 1 ^ ^ ) + 0: abcabc + 1: abc + +/(\d{3}(?C))*/ +Capturing subpattern count = 1 +Partial matching not supported +No options +No first char +No need char + 123\C+ +Callout 0: last capture = -1 + 0: +--->123 + ^ ^ ) + 0: 123 + 1: 123 + 123456\C+ +Callout 0: last capture = -1 + 0: +--->123456 + ^ ^ ) +Callout 0: last capture = 1 + 0: + 1: 123 +--->123456 + ^ ^ ) + 0: 123456 + 1: 456 + 123456789\C+ +Callout 0: last capture = -1 + 0: +--->123456789 + ^ ^ ) +Callout 0: last capture = 1 + 0: + 1: 123 +--->123456789 + ^ ^ ) +Callout 0: last capture = 1 + 0: + 1: 456 +--->123456789 + ^ ^ ) + 0: 123456789 + 1: 789 + +/((xyz)(?C)p|(?C1)xyzabc)/ +Capturing subpattern count = 2 +No options +First char = 'x' +No need char + xyzabc\C+ +Callout 0: last capture = 2 + 0: + 1: + 2: xyz +--->xyzabc + ^ ^ p +Callout 1: last capture = -1 + 0: +--->xyzabc + ^ x + 0: xyzabc + 1: xyzabc + +/(X)((xyz)(?C)p|(?C1)xyzabc)/ +Capturing subpattern count = 3 +No options +First char = 'X' +Need char = 'x' + Xxyzabc\C+ +Callout 0: last capture = 3 + 0: + 1: X + 2: + 3: xyz +--->Xxyzabc + ^ ^ p +Callout 1: last capture = 1 + 0: + 1: X +--->Xxyzabc + ^^ x + 0: Xxyzabc + 1: X + 2: xyzabc + +/(?=(abc))(?C)abcdef/ +Capturing subpattern count = 1 +No options +First char = 'a' +Need char = 'f' + abcdef\C+ +Callout 0: last capture = 1 + 0: + 1: abc +--->abcdef + ^ a + 0: abcdef + 1: abc + +/(?!(abc)(?C1)d)(?C2)abcxyz/ +Capturing subpattern count = 1 +No options +First char = 'a' +Need char = 'z' + abcxyz\C+ +Callout 1: last capture = 1 + 0: + 1: abc +--->abcxyz + ^ ^ d +Callout 2: last capture = -1 + 0: +--->abcxyz + ^ a + 0: abcxyz + +/(?<=(abc)(?C))xyz/ +Capturing subpattern count = 1 +No options +First char = 'x' +Need char = 'z' + abcxyz\C+ +Callout 0: last capture = 1 + 0: + 1: abc +--->abcxyz + ^ ) + 0: xyz + 1: abc + +/a(b+)(c*)(?C1)/ +Capturing subpattern count = 2 +Partial matching not supported +No options +First char = 'a' +Need char = 'b' + abbbbbccc\C*1 +--->abbbbbccc + 1 ^ ^ +Callout data = 1 + 1 ^ ^ +Callout data = 1 + 1 ^ ^ +Callout data = 1 + 1 ^ ^ +Callout data = 1 + 1 ^ ^ +Callout data = 1 + 1 ^ ^ +Callout data = 1 + 1 ^ ^ +Callout data = 1 + 1 ^ ^ +Callout data = 1 +No match + +/a(b+?)(c*?)(?C1)/ +Capturing subpattern count = 2 +Partial matching not supported +No options +First char = 'a' +Need char = 'b' + abbbbbccc\C*1 +--->abbbbbccc + 1 ^ ^ +Callout data = 1 + 1 ^ ^ +Callout data = 1 + 1 ^ ^ +Callout data = 1 + 1 ^ ^ +Callout data = 1 + 1 ^ ^ +Callout data = 1 + 1 ^ ^ +Callout data = 1 + 1 ^ ^ +Callout data = 1 + 1 ^ ^ +Callout data = 1 +No match + +/(?C)abc/ +Capturing subpattern count = 0 +No options +First char = 'a' +Need char = 'c' + +/(?C)^abc/ +Capturing subpattern count = 0 +Options: anchored +No first char +No need char + +/(?C)a|b/S +Capturing subpattern count = 0 +No options +No first char +No need char +Starting byte set: a b + +/(?R)/ +Failed: recursive call could loop indefinitely at offset 3 + +/(a|(?R))/ +Failed: recursive call could loop indefinitely at offset 6 + +/(ab|(bc|(de|(?R))))/ +Failed: recursive call could loop indefinitely at offset 15 + +/x(ab|(bc|(de|(?R))))/ +Capturing subpattern count = 3 +No options +First char = 'x' +No need char + xab + 0: xab + 1: ab + xbc + 0: xbc + 1: bc + 2: bc + xde + 0: xde + 1: de + 2: de + 3: de + xxab + 0: xxab + 1: xab + 2: xab + 3: xab + xxxab + 0: xxxab + 1: xxab + 2: xxab + 3: xxab + *** Failers +No match + xyab +No match + +/(ab|(bc|(de|(?1))))/ +Failed: recursive call could loop indefinitely at offset 15 + +/x(ab|(bc|(de|(?1)x)x)x)/ +Failed: recursive call could loop indefinitely at offset 16 + +/^([^()]|\((?1)*\))*$/ +Capturing subpattern count = 1 +Options: anchored +No first char +No need char + abc + 0: abc + 1: c + a(b)c + 0: a(b)c + 1: c + a(b(c))d + 0: a(b(c))d + 1: d + *** Failers) +No match + a(b(c)d +No match + +/^>abc>([^()]|\((?1)*\))*abc>123abc>123abc>1(2)3abc>1(2)3abc>(1(2)3)abc>(1(2)3) + 2: + 3: Satan, oscillate my metallic sonatas + 4: S + A man, a plan, a canal: Panama! + 0: A man, a plan, a canal: Panama! + 1: + 2: + 3: A man, a plan, a canal: Panama + 4: A + Able was I ere I saw Elba. + 0: Able was I ere I saw Elba. + 1: + 2: + 3: Able was I ere I saw Elba + 4: A + *** Failers +No match + The quick brown fox +No match + +/^(\d+|\((?1)([+*-])(?1)\)|-(?1))$/ +Capturing subpattern count = 2 +Partial matching not supported +Options: anchored +No first char +No need char + 12 + 0: 12 + 1: 12 + (((2+2)*-3)-7) + 0: (((2+2)*-3)-7) + 1: (((2+2)*-3)-7) + 2: - + -12 + 0: -12 + 1: -12 + *** Failers +No match + ((2+2)*-3)-7) +No match + +/^(x(y|(?1){2})z)/ +Capturing subpattern count = 2 +Options: anchored +No first char +No need char + xyz + 0: xyz + 1: xyz + 2: y + xxyzxyzz + 0: xxyzxyzz + 1: xxyzxyzz + 2: xyzxyz + *** Failers +No match + xxyzz +No match + xxyzxyzxyzz +No match + +/((< (?: (?(R) \d++ | [^<>]*+) | (?2)) * >))/x +Capturing subpattern count = 2 +Partial matching not supported +Options: extended +First char = '<' +Need char = '>' + <> + 0: <> + 1: <> + 2: <> + + 0: + 1: + 2: + hij> + 0: hij> + 1: hij> + 2: hij> + hij> + 0: + 1: + 2: + def> + 0: def> + 1: def> + 2: def> + + 0: <> + 1: <> + 2: <> + *** Failers +No match + b|c)d(?Pe)/D +------------------------------------------------------------------ + 0 28 Bra 0 + 3 a + 5 5 Bra 1 + 8 b + 10 5 Alt + 13 c + 15 10 Ket + 18 d + 20 5 Bra 2 + 23 e + 25 5 Ket + 28 28 Ket + 31 End +------------------------------------------------------------------ +Capturing subpattern count = 2 +Named capturing subpatterns: + longername2 2 + name1 1 +No options +First char = 'a' +Need char = 'e' + abde + 0: abde + 1: b + 2: e + acde + 0: acde + 1: c + 2: e + +/(?:a(?Pc(?Pd)))(?Pa)/D +------------------------------------------------------------------ + 0 35 Bra 0 + 3 21 Bra 0 + 6 a + 8 13 Bra 1 + 11 c + 13 5 Bra 2 + 16 d + 18 5 Ket + 21 13 Ket + 24 21 Ket + 27 5 Bra 3 + 30 a + 32 5 Ket + 35 35 Ket + 38 End +------------------------------------------------------------------ +Capturing subpattern count = 3 +Named capturing subpatterns: + a 3 + c 1 + d 2 +No options +First char = 'a' +Need char = 'a' + +/(?Pa)...(?P=a)bbb(?P>a)d/D +------------------------------------------------------------------ + 0 28 Bra 0 + 3 5 Bra 1 + 6 a + 8 5 Ket + 11 Any + 12 Any + 13 Any + 14 \1 + 17 bbb + 23 3 Recurse + 26 d + 28 28 Ket + 31 End +------------------------------------------------------------------ +Capturing subpattern count = 1 +Max back reference = 1 +Named capturing subpatterns: + a 1 +No options +First char = 'a' +Need char = 'd' + +/^\W*(?:(?P(?P.)\W*(?P>one)\W*(?P=two)|)|(?P(?P.)\W*(?P>three)\W*(?P=four)|\W*.\W*))\W*$/i +Capturing subpattern count = 4 +Max back reference = 4 +Named capturing subpatterns: + four 4 + one 1 + three 3 + two 2 +Partial matching not supported +Options: anchored caseless +No first char +No need char + 1221 + 0: 1221 + 1: 1221 + 2: 1 + Satan, oscillate my metallic sonatas! + 0: Satan, oscillate my metallic sonatas! + 1: + 2: + 3: Satan, oscillate my metallic sonatas + 4: S + A man, a plan, a canal: Panama! + 0: A man, a plan, a canal: Panama! + 1: + 2: + 3: A man, a plan, a canal: Panama + 4: A + Able was I ere I saw Elba. + 0: Able was I ere I saw Elba. + 1: + 2: + 3: Able was I ere I saw Elba + 4: A + *** Failers +No match + The quick brown fox +No match + +/((?(R)a|b))\1(?1)?/ +Capturing subpattern count = 1 +Max back reference = 1 +No options +No first char +No need char + bb + 0: bb + 1: b + bbaa + 0: bba + 1: b + +/(.*)a/sI +Capturing subpattern count = 1 +Partial matching not supported +Options: anchored dotall +No first char +Need char = 'a' + +/(.*)a\1/sI +Capturing subpattern count = 1 +Max back reference = 1 +Partial matching not supported +Options: dotall +No first char +Need char = 'a' + +/(.*)a(b)\2/sI +Capturing subpattern count = 2 +Max back reference = 2 +Partial matching not supported +Options: anchored dotall +No first char +Need char = 'b' + +/((.*)a|(.*)b)z/sI +Capturing subpattern count = 3 +Partial matching not supported +Options: anchored dotall +No first char +Need char = 'z' + +/((.*)a|(.*)b)z\1/sI +Capturing subpattern count = 3 +Max back reference = 1 +Partial matching not supported +Options: dotall +No first char +Need char = 'z' + +/((.*)a|(.*)b)z\2/sI +Capturing subpattern count = 3 +Max back reference = 2 +Partial matching not supported +Options: dotall +No first char +Need char = 'z' + +/((.*)a|(.*)b)z\3/sI +Capturing subpattern count = 3 +Max back reference = 3 +Partial matching not supported +Options: dotall +No first char +Need char = 'z' + +/((.*)a|^(.*)b)z\3/sI +Capturing subpattern count = 3 +Max back reference = 3 +Partial matching not supported +Options: anchored dotall +No first char +Need char = 'z' + +/(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)a/sI +Capturing subpattern count = 31 +Partial matching not supported +Options: anchored dotall +No first char +No need char + +/(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)a\31/sI +Capturing subpattern count = 31 +Max back reference = 31 +Partial matching not supported +Options: dotall +No first char +No need char + +/(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)a\32/sI +Capturing subpattern count = 32 +Max back reference = 32 +Partial matching not supported +Options: dotall +No first char +No need char + +/(a)(bc)/ND +------------------------------------------------------------------ + 0 21 Bra 0 + 3 5 Bra 0 + 6 a + 8 5 Ket + 11 7 Bra 0 + 14 bc + 18 7 Ket + 21 21 Ket + 24 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: +First char = 'a' +Need char = 'c' + abc + 0: abc + +/(?Pa)(bc)/ND +------------------------------------------------------------------ + 0 21 Bra 0 + 3 5 Bra 1 + 6 a + 8 5 Ket + 11 7 Bra 0 + 14 bc + 18 7 Ket + 21 21 Ket + 24 End +------------------------------------------------------------------ +Capturing subpattern count = 1 +Named capturing subpatterns: + one 1 +Options: +First char = 'a' +Need char = 'c' + abc + 0: abc + 1: a + +/(a)(?Pbc)/ND +------------------------------------------------------------------ + 0 21 Bra 0 + 3 5 Bra 0 + 6 a + 8 5 Ket + 11 7 Bra 1 + 14 bc + 18 7 Ket + 21 21 Ket + 24 End +------------------------------------------------------------------ +Capturing subpattern count = 1 +Named capturing subpatterns: + named 1 +Options: +First char = 'a' +Need char = 'c' + +/(a+)*zz/ +Capturing subpattern count = 1 +Partial matching not supported +No options +No first char +Need char = 'z' + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaazzbbbbbb\M +Minimum match limit = 8 + 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaazz + 1: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + aaaaaaaaaaaaaz\M +Minimum match limit = 32768 +No match + +/(aaa(?C1)bbb|ab)/ +Capturing subpattern count = 1 +No options +First char = 'a' +Need char = 'b' + aaabbb +--->aaabbb + 1 ^ ^ b + 0: aaabbb + 1: aaabbb + aaabbb\C*0 +--->aaabbb + 1 ^ ^ b + 0: aaabbb + 1: aaabbb + aaabbb\C*1 +--->aaabbb + 1 ^ ^ b +Callout data = 1 + 0: ab + 1: ab + aaabbb\C*-1 +--->aaabbb + 1 ^ ^ b +Callout data = -1 +No match + +/ab(?Pcd)ef(?Pgh)/ +Capturing subpattern count = 2 +Named capturing subpatterns: + one 1 + two 2 +No options +First char = 'a' +Need char = 'h' + abcdefgh + 0: abcdefgh + 1: cd + 2: gh + abcdefgh\C1\Gtwo + 0: abcdefgh + 1: cd + 2: gh + 1C cd (2) + 2G gh (2) + abcdefgh\Cone\Ctwo + 0: abcdefgh + 1: cd + 2: gh + 1C cd (2) + 2C gh (2) + abcdefgh\Cthree +no parentheses with name "three" + 0: abcdefgh + 1: cd + 2: gh + +/(?P)(?P)/D +------------------------------------------------------------------ + 0 15 Bra 0 + 3 3 Bra 1 + 6 3 Ket + 9 3 Bra 2 + 12 3 Ket + 15 15 Ket + 18 End +------------------------------------------------------------------ +Capturing subpattern count = 2 +Named capturing subpatterns: + Tes 1 + Test 2 +No options +No first char +No need char + +/(?P)(?P)/D +------------------------------------------------------------------ + 0 15 Bra 0 + 3 3 Bra 1 + 6 3 Ket + 9 3 Bra 2 + 12 3 Ket + 15 15 Ket + 18 End +------------------------------------------------------------------ +Capturing subpattern count = 2 +Named capturing subpatterns: + Tes 2 + Test 1 +No options +No first char +No need char + +/(?Pzz)(?Paa)/ +Capturing subpattern count = 2 +Named capturing subpatterns: + A 2 + Z 1 +No options +First char = 'z' +Need char = 'a' + zzaa\CZ + 0: zzaa + 1: zz + 2: aa + 1C zz (2) + zzaa\CA + 0: zzaa + 1: zz + 2: aa + 2C aa (2) + +/(?Peks)(?Peccs)/ +Failed: two named groups have the same name at offset 16 + +/(?Pabc(?Pdef)(?Pxyz))/ +Failed: two named groups have the same name at offset 31 + +"\[((?P\d+)(,(?P>elem))*)\]" +Capturing subpattern count = 3 +Named capturing subpatterns: + elem 2 +Partial matching not supported +No options +First char = '[' +Need char = ']' + [10,20,30,5,5,4,4,2,43,23,4234] + 0: [10,20,30,5,5,4,4,2,43,23,4234] + 1: 10,20,30,5,5,4,4,2,43,23,4234 + 2: 10 + 3: ,4234 + *** Failers +No match + [] +No match + +"\[((?P\d+)(,(?P>elem))*)?\]" +Capturing subpattern count = 3 +Named capturing subpatterns: + elem 2 +Partial matching not supported +No options +First char = '[' +Need char = ']' + [10,20,30,5,5,4,4,2,43,23,4234] + 0: [10,20,30,5,5,4,4,2,43,23,4234] + 1: 10,20,30,5,5,4,4,2,43,23,4234 + 2: 10 + 3: ,4234 + [] + 0: [] + +/(a(b(?2)c))?/D +------------------------------------------------------------------ + 0 25 Bra 0 + 3 Brazero + 4 18 Bra 1 + 7 a + 9 10 Bra 2 + 12 b + 14 9 Recurse + 17 c + 19 10 Ket + 22 18 Ket + 25 25 Ket + 28 End +------------------------------------------------------------------ +Capturing subpattern count = 2 +No options +No first char +No need char + +/(a(b(?2)c))*/D +------------------------------------------------------------------ + 0 25 Bra 0 + 3 Brazero + 4 18 Bra 1 + 7 a + 9 10 Bra 2 + 12 b + 14 9 Recurse + 17 c + 19 10 Ket + 22 18 KetRmax + 25 25 Ket + 28 End +------------------------------------------------------------------ +Capturing subpattern count = 2 +No options +No first char +No need char + +/(a(b(?2)c)){0,2}/D +------------------------------------------------------------------ + 0 53 Bra 0 + 3 Brazero + 4 46 Bra 0 + 7 18 Bra 1 + 10 a + 12 10 Bra 2 + 15 b + 17 12 Recurse + 20 c + 22 10 Ket + 25 18 Ket + 28 Brazero + 29 18 Bra 1 + 32 a + 34 10 Bra 2 + 37 b + 39 12 Recurse + 42 c + 44 10 Ket + 47 18 Ket + 50 46 Ket + 53 53 Ket + 56 End +------------------------------------------------------------------ +Capturing subpattern count = 2 +No options +No first char +No need char + +/[ab]{1}+/D +------------------------------------------------------------------ + 0 47 Bra 0 + 3 41 Once + 6 [ab]{1,1} + 44 41 Ket + 47 47 Ket + 50 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +No options +No first char +No need char + +/((w\/|-|with)*(free|immediate)*.*?shipping\s*[!.-]*)/i +Capturing subpattern count = 3 +Partial matching not supported +Options: caseless +No first char +Need char = 'g' (caseless) + Baby Bjorn Active Carrier - With free SHIPPING!! + 0: Baby Bjorn Active Carrier - With free SHIPPING!! + 1: Baby Bjorn Active Carrier - With free SHIPPING!! + +/((w\/|-|with)*(free|immediate)*.*?shipping\s*[!.-]*)/iS +Capturing subpattern count = 3 +Partial matching not supported +Options: caseless +No first char +Need char = 'g' (caseless) +Study returned NULL + Baby Bjorn Active Carrier - With free SHIPPING!! + 0: Baby Bjorn Active Carrier - With free SHIPPING!! + 1: Baby Bjorn Active Carrier - With free SHIPPING!! + +/a*.*b/SD +------------------------------------------------------------------ + 0 9 Bra 0 + 3 a* + 5 Any* + 7 b + 9 9 Ket + 12 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Partial matching not supported +No options +No first char +Need char = 'b' +Study returned NULL + +/(a|b)*.?c/SD +------------------------------------------------------------------ + 0 21 Bra 0 + 3 Brazero + 4 5 Bra 1 + 7 a + 9 5 Alt + 12 b + 14 10 KetRmax + 17 Any? + 19 c + 21 21 Ket + 24 End +------------------------------------------------------------------ +Capturing subpattern count = 1 +No options +No first char +Need char = 'c' +Study returned NULL + +/abc(?C255)de(?C)f/D +------------------------------------------------------------------ + 0 27 Bra 0 + 3 abc + 9 Callout 255 10 1 + 15 de + 19 Callout 0 16 1 + 25 f + 27 27 Ket + 30 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +No options +First char = 'a' +Need char = 'f' + +/abcde/CD +------------------------------------------------------------------ + 0 49 Bra 0 + 3 Callout 255 0 1 + 9 a + 11 Callout 255 1 1 + 17 b + 19 Callout 255 2 1 + 25 c + 27 Callout 255 3 1 + 33 d + 35 Callout 255 4 1 + 41 e + 43 Callout 255 5 0 + 49 49 Ket + 52 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: +First char = 'a' +Need char = 'e' + abcde +--->abcde + +0 ^ a + +1 ^^ b + +2 ^ ^ c + +3 ^ ^ d + +4 ^ ^ e + +5 ^ ^ + 0: abcde + abcdfe +--->abcdfe + +0 ^ a + +1 ^^ b + +2 ^ ^ c + +3 ^ ^ d + +4 ^ ^ e +No match + +/a*b/CD +------------------------------------------------------------------ + 0 25 Bra 0 + 3 Callout 255 0 2 + 9 a* + 11 Callout 255 2 1 + 17 b + 19 Callout 255 3 0 + 25 25 Ket + 28 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Partial matching not supported +Options: +No first char +Need char = 'b' + ab +--->ab + +0 ^ a* + +2 ^^ b + +3 ^ ^ + 0: ab + aaaab +--->aaaab + +0 ^ a* + +2 ^ ^ b + +3 ^ ^ + 0: aaaab + aaaacb +--->aaaacb + +0 ^ a* + +2 ^ ^ b + +2 ^ ^ b + +2 ^ ^ b + +2 ^^ b + +2 ^ b + +0 ^ a* + +2 ^ ^ b + +2 ^ ^ b + +2 ^^ b + +2 ^ b + +0 ^ a* + +2 ^ ^ b + +2 ^^ b + +2 ^ b + +0 ^ a* + +2 ^^ b + +2 ^ b + +0 ^ a* + +2 ^ b + +0 ^ a* + +2 ^ b + +3 ^^ + 0: b + +/a+b/CD +------------------------------------------------------------------ + 0 25 Bra 0 + 3 Callout 255 0 2 + 9 a+ + 11 Callout 255 2 1 + 17 b + 19 Callout 255 3 0 + 25 25 Ket + 28 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Partial matching not supported +Options: +First char = 'a' +Need char = 'b' + ab +--->ab + +0 ^ a+ + +2 ^^ b + +3 ^ ^ + 0: ab + aaaab +--->aaaab + +0 ^ a+ + +2 ^ ^ b + +3 ^ ^ + 0: aaaab + aaaacb +--->aaaacb + +0 ^ a+ + +2 ^ ^ b + +2 ^ ^ b + +2 ^ ^ b + +2 ^^ b + +0 ^ a+ + +2 ^ ^ b + +2 ^ ^ b + +2 ^^ b + +0 ^ a+ + +2 ^ ^ b + +2 ^^ b + +0 ^ a+ + +2 ^^ b +No match + +/(abc|def)x/CD +------------------------------------------------------------------ + 0 92 Bra 0 + 3 Callout 255 0 9 + 9 33 Bra 1 + 12 Callout 255 1 1 + 18 a + 20 Callout 255 2 1 + 26 b + 28 Callout 255 3 1 + 34 c + 36 Callout 255 4 0 + 42 33 Alt + 45 Callout 255 5 1 + 51 d + 53 Callout 255 6 1 + 59 e + 61 Callout 255 7 1 + 67 f + 69 Callout 255 8 0 + 75 66 Ket + 78 Callout 255 9 1 + 84 x + 86 Callout 255 10 0 + 92 92 Ket + 95 End +------------------------------------------------------------------ +Capturing subpattern count = 1 +Options: +No first char +Need char = 'x' + abcx +--->abcx + +0 ^ (abc|def) + +1 ^ a + +2 ^^ b + +3 ^ ^ c + +4 ^ ^ | + +9 ^ ^ x ++10 ^ ^ + 0: abcx + 1: abc + defx +--->defx + +0 ^ (abc|def) + +1 ^ a + +5 ^ d + +6 ^^ e + +7 ^ ^ f + +8 ^ ^ ) + +9 ^ ^ x ++10 ^ ^ + 0: defx + 1: def + abcdefzx +--->abcdefzx + +0 ^ (abc|def) + +1 ^ a + +2 ^^ b + +3 ^ ^ c + +4 ^ ^ | + +9 ^ ^ x + +5 ^ d + +0 ^ (abc|def) + +1 ^ a + +5 ^ d + +0 ^ (abc|def) + +1 ^ a + +5 ^ d + +0 ^ (abc|def) + +1 ^ a + +5 ^ d + +6 ^^ e + +7 ^ ^ f + +8 ^ ^ ) + +9 ^ ^ x + +0 ^ (abc|def) + +1 ^ a + +5 ^ d + +0 ^ (abc|def) + +1 ^ a + +5 ^ d + +0 ^ (abc|def) + +1 ^ a + +5 ^ d + +0 ^ (abc|def) + +1 ^ a + +5 ^ d +No match + +/(ab|cd){3,4}/C +Capturing subpattern count = 1 +Options: +No first char +No need char + ababab +--->ababab + +0 ^ (ab|cd){3,4} + +1 ^ a + +2 ^^ b + +3 ^ ^ | + +1 ^ ^ a + +2 ^ ^ b + +3 ^ ^ | + +1 ^ ^ a + +2 ^ ^ b + +3 ^ ^ | + +1 ^ ^ a + +4 ^ ^ c ++12 ^ ^ + 0: ababab + 1: ab + abcdabcd +--->abcdabcd + +0 ^ (ab|cd){3,4} + +1 ^ a + +2 ^^ b + +3 ^ ^ | + +1 ^ ^ a + +4 ^ ^ c + +5 ^ ^ d + +6 ^ ^ ) + +1 ^ ^ a + +2 ^ ^ b + +3 ^ ^ | + +1 ^ ^ a + +4 ^ ^ c + +5 ^ ^ d + +6 ^ ^ ) ++12 ^ ^ + 0: abcdabcd + 1: cd + abcdcdcdcdcd +--->abcdcdcdcdcd + +0 ^ (ab|cd){3,4} + +1 ^ a + +2 ^^ b + +3 ^ ^ | + +1 ^ ^ a + +4 ^ ^ c + +5 ^ ^ d + +6 ^ ^ ) + +1 ^ ^ a + +4 ^ ^ c + +5 ^ ^ d + +6 ^ ^ ) + +1 ^ ^ a + +4 ^ ^ c + +5 ^ ^ d + +6 ^ ^ ) ++12 ^ ^ + 0: abcdcdcd + 1: cd + +/([ab]{,4}c|xy)/CD +------------------------------------------------------------------ + 0 131 Bra 0 + 3 Callout 255 0 14 + 9 88 Bra 1 + 12 Callout 255 1 4 + 18 [ab] + 51 Callout 255 5 1 + 57 { + 59 Callout 255 6 1 + 65 , + 67 Callout 255 7 1 + 73 4 + 75 Callout 255 8 1 + 81 } + 83 Callout 255 9 1 + 89 c + 91 Callout 255 10 0 + 97 25 Alt +100 Callout 255 11 1 +106 x +108 Callout 255 12 1 +114 y +116 Callout 255 13 0 +122 113 Ket +125 Callout 255 14 0 +131 131 Ket +134 End +------------------------------------------------------------------ +Capturing subpattern count = 1 +Options: +No first char +No need char + Note: that { does NOT introduce a quantifier +--->Note: that { does NOT introduce a quantifier + +0 ^ ([ab]{,4}c|xy) + +1 ^ [ab] ++11 ^ x + +0 ^ ([ab]{,4}c|xy) + +1 ^ [ab] ++11 ^ x + +0 ^ ([ab]{,4}c|xy) + +1 ^ [ab] ++11 ^ x + +0 ^ ([ab]{,4}c|xy) + +1 ^ [ab] ++11 ^ x + +0 ^ ([ab]{,4}c|xy) + +1 ^ [ab] ++11 ^ x + +0 ^ ([ab]{,4}c|xy) + +1 ^ [ab] ++11 ^ x + +0 ^ ([ab]{,4}c|xy) + +1 ^ [ab] ++11 ^ x + +0 ^ ([ab]{,4}c|xy) + +1 ^ [ab] ++11 ^ x + +0 ^ ([ab]{,4}c|xy) + +1 ^ [ab] + +5 ^^ { ++11 ^ x + +0 ^ ([ab]{,4}c|xy) + +1 ^ [ab] ++11 ^ x + +0 ^ ([ab]{,4}c|xy) + +1 ^ [ab] ++11 ^ x + +0 ^ ([ab]{,4}c|xy) + +1 ^ [ab] ++11 ^ x + +0 ^ ([ab]{,4}c|xy) + +1 ^ [ab] ++11 ^ x + +0 ^ ([ab]{,4}c|xy) + +1 ^ [ab] ++11 ^ x + +0 ^ ([ab]{,4}c|xy) + +1 ^ [ab] ++11 ^ x + +0 ^ ([ab]{,4}c|xy) + +1 ^ [ab] ++11 ^ x + +0 ^ ([ab]{,4}c|xy) + +1 ^ [ab] ++11 ^ x + +0 ^ ([ab]{,4}c|xy) + +1 ^ [ab] ++11 ^ x + +0 ^ ([ab]{,4}c|xy) + +1 ^ [ab] ++11 ^ x + +0 ^ ([ab]{,4}c|xy) + +1 ^ [ab] ++11 ^ x + +0 ^ ([ab]{,4}c|xy) + +1 ^ [ab] ++11 ^ x + +0 ^ ([ab]{,4}c|xy) + +1 ^ [ab] ++11 ^ x + +0 ^ ([ab]{,4}c|xy) + +1 ^ [ab] ++11 ^ x + +0 ^ ([ab]{,4}c|xy) + +1 ^ [ab] ++11 ^ x + +0 ^ ([ab]{,4}c|xy) + +1 ^ [ab] ++11 ^ x + +0 ^ ([ab]{,4}c|xy) + +1 ^ [ab] ++11 ^ x + +0 ^ ([ab]{,4}c|xy) + +1 ^ [ab] ++11 ^ x + +0 ^ ([ab]{,4}c|xy) + +1 ^ [ab] ++11 ^ x + +0 ^ ([ab]{,4}c|xy) + +1 ^ [ab] ++11 ^ x + +0 ^ ([ab]{,4}c|xy) + +1 ^ [ab] ++11 ^ x + +0 ^ ([ab]{,4}c|xy) + +1 ^ [ab] ++11 ^ x + +0 ^ ([ab]{,4}c|xy) + +1 ^ [ab] ++11 ^ x + +0 ^ ([ab]{,4}c|xy) + +1 ^ [ab] + +5 ^^ { ++11 ^ x + +0 ^ ([ab]{,4}c|xy) + +1 ^ [ab] ++11 ^ x + +0 ^ ([ab]{,4}c|xy) + +1 ^ [ab] ++11 ^ x + +0 ^ ([ab]{,4}c|xy) + +1 ^ [ab] ++11 ^ x + +0 ^ ([ab]{,4}c|xy) + +1 ^ [ab] + +5 ^^ { ++11 ^ x + +0 ^ ([ab]{,4}c|xy) + +1 ^ [ab] ++11 ^ x + +0 ^ ([ab]{,4}c|xy) + +1 ^ [ab] ++11 ^ x + +0 ^ ([ab]{,4}c|xy) + +1 ^ [ab] ++11 ^ x + +0 ^ ([ab]{,4}c|xy) + +1 ^ [ab] ++11 ^ x + +0 ^ ([ab]{,4}c|xy) + +1 ^ [ab] ++11 ^ x + +0 ^ ([ab]{,4}c|xy) + +1 ^ [ab] ++11 ^ x + +0 ^ ([ab]{,4}c|xy) + +1 ^ [ab] ++11 ^ x + +0 ^ ([ab]{,4}c|xy) + +1 ^ [ab] ++11 ^ x +No match + +/([ab]{1,4}c|xy){4,5}?123/CD +------------------------------------------------------------------ + 0 485 Bra 0 + 3 Callout 255 0 21 + 9 61 Bra 1 + 12 Callout 255 1 9 + 18 [ab]{1,4} + 56 Callout 255 10 1 + 62 c + 64 Callout 255 11 0 + 70 25 Alt + 73 Callout 255 12 1 + 79 x + 81 Callout 255 13 1 + 87 y + 89 Callout 255 14 0 + 95 86 Ket + 98 61 Bra 1 +101 Callout 255 1 9 +107 [ab]{1,4} +145 Callout 255 10 1 +151 c +153 Callout 255 11 0 +159 25 Alt +162 Callout 255 12 1 +168 x +170 Callout 255 13 1 +176 y +178 Callout 255 14 0 +184 86 Ket +187 61 Bra 1 +190 Callout 255 1 9 +196 [ab]{1,4} +234 Callout 255 10 1 +240 c +242 Callout 255 11 0 +248 25 Alt +251 Callout 255 12 1 +257 x +259 Callout 255 13 1 +265 y +267 Callout 255 14 0 +273 86 Ket +276 61 Bra 1 +279 Callout 255 1 9 +285 [ab]{1,4} +323 Callout 255 10 1 +329 c +331 Callout 255 11 0 +337 25 Alt +340 Callout 255 12 1 +346 x +348 Callout 255 13 1 +354 y +356 Callout 255 14 0 +362 86 Ket +365 Braminzero +366 61 Bra 1 +369 Callout 255 1 9 +375 [ab]{1,4} +413 Callout 255 10 1 +419 c +421 Callout 255 11 0 +427 25 Alt +430 Callout 255 12 1 +436 x +438 Callout 255 13 1 +444 y +446 Callout 255 14 0 +452 86 Ket +455 Callout 255 21 1 +461 1 +463 Callout 255 22 1 +469 2 +471 Callout 255 23 1 +477 3 +479 Callout 255 24 0 +485 485 Ket +488 End +------------------------------------------------------------------ +Capturing subpattern count = 1 +Partial matching not supported +Options: +No first char +Need char = '3' + aacaacaacaacaac123 +--->aacaacaacaacaac123 + +0 ^ ([ab]{1,4}c|xy){4,5}? + +1 ^ [ab]{1,4} ++10 ^ ^ c ++11 ^ ^ | + +1 ^ ^ [ab]{1,4} ++10 ^ ^ c ++11 ^ ^ | + +1 ^ ^ [ab]{1,4} ++10 ^ ^ c ++11 ^ ^ | + +1 ^ ^ [ab]{1,4} ++10 ^ ^ c ++11 ^ ^ | ++21 ^ ^ 1 + +1 ^ ^ [ab]{1,4} ++10 ^ ^ c ++11 ^ ^ | ++21 ^ ^ 1 ++22 ^ ^ 2 ++23 ^ ^ 3 ++24 ^ ^ + 0: aacaacaacaacaac123 + 1: aac + +/\b.*/I +Capturing subpattern count = 0 +Partial matching not supported +No options +No first char +No need char + ab cd\>1 + 0: cd + +/\b.*/Is +Capturing subpattern count = 0 +Partial matching not supported +Options: dotall +No first char +No need char + ab cd\>1 + 0: cd + +/(?!.bcd).*/I +Capturing subpattern count = 0 +Partial matching not supported +No options +No first char +No need char + Xbcd12345 + 0: bcd12345 + +/abcde/ +Capturing subpattern count = 0 +No options +First char = 'a' +Need char = 'e' + ab\P +Partial match + abc\P +Partial match + abcd\P +Partial match + abcde\P + 0: abcde + the quick brown abc\P +Partial match + ** Failers\P +No match + the quick brown abxyz fox\P +No match + +"^(0?[1-9]|[12][0-9]|3[01])/(0?[1-9]|1[012])/(20)?\d\d$" +Capturing subpattern count = 3 +Options: anchored +No first char +Need char = '/' + 13/05/04\P + 0: 13/05/04 + 1: 13 + 2: 05 + 13/5/2004\P + 0: 13/5/2004 + 1: 13 + 2: 5 + 3: 20 + 02/05/09\P + 0: 02/05/09 + 1: 02 + 2: 05 + 1\P +Partial match + 1/2\P +Partial match + 1/2/0\P +Partial match + 1/2/04\P + 0: 1/2/04 + 1: 1 + 2: 2 + 0\P +Partial match + 02/\P +Partial match + 02/0\P +Partial match + 02/1\P +Partial match + ** Failers\P +No match + \P +No match + 123\P +No match + 33/4/04\P +No match + 3/13/04\P +No match + 0/1/2003\P +No match + 0/\P +No match + 02/0/\P +No match + 02/13\P +No match + +/0{0,2}ABC/I +Capturing subpattern count = 0 +Partial matching not supported +No options +No first char +Need char = 'C' + +/\d{3,}ABC/I +Capturing subpattern count = 0 +Partial matching not supported +No options +No first char +Need char = 'C' + +/\d*ABC/I +Capturing subpattern count = 0 +Partial matching not supported +No options +No first char +Need char = 'C' + +/[abc]+DE/I +Capturing subpattern count = 0 +Partial matching not supported +No options +No first char +Need char = 'E' + +/[abc]?123/ +Capturing subpattern count = 0 +No options +No first char +Need char = '3' + 123\P + 0: 123 + a\P +Partial match + b\P +Partial match + c\P +Partial match + c12\P +Partial match + c123\P + 0: c123 + +/^(?:\d){3,5}X/ +Capturing subpattern count = 0 +Options: anchored +No first char +Need char = 'X' + 1\P +Partial match + 123\P +Partial match + 123X + 0: 123X + 1234\P +Partial match + 1234X + 0: 1234X + 12345\P +Partial match + 12345X + 0: 12345X + *** Failers +No match + 1X +No match + 123456\P +No match + +/abc/>testsavedregex +Capturing subpattern count = 0 +No options +First char = 'a' +Need char = 'c' +Compiled regex written to testsavedregex +testsavedregex +Capturing subpattern count = 0 +No options +First char = 'a' +Need char = 'c' +Compiled regex written to testsavedregex +testsavedregex +Capturing subpattern count = 1 +No options +No first char +No need char +Starting byte set: a b +Compiled regex written to testsavedregex +Study data written to testsavedregex +testsavedregex +Capturing subpattern count = 1 +No options +No first char +No need char +Starting byte set: a b +Compiled regex written to testsavedregex +Study data written to testsavedregex +(.)*~smg +Capturing subpattern count = 3 +Max back reference = 1 +Partial matching not supported +Options: multiline dotall +First char = '<' +Need char = '>' + \n\n\nPartner der LCO\nde\nPartner der LINEAS Consulting\nGmbH\nLINEAS Consulting GmbH Hamburg\nPartnerfirmen\n30 days\nindex,follow\n\nja\n3\nPartner\n\n\nLCO\nLINEAS Consulting\n15.10.2003\n\n\n\n\nDie Partnerfirmen der LINEAS Consulting\nGmbH\n\n\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n + 0: \x0a\x0aPartner der LCO\x0ade\x0aPartner der LINEAS Consulting\x0aGmbH\x0aLINEAS Consulting GmbH Hamburg\x0aPartnerfirmen\x0a30 days\x0aindex,follow\x0a\x0aja\x0a3\x0aPartner\x0a\x0a\x0aLCO\x0aLINEAS Consulting\x0a15.10.2003\x0a\x0a\x0a\x0a\x0aDie Partnerfirmen der LINEAS Consulting\x0aGmbH\x0a\x0a\x0a \x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a + 1: seite + 2: \x0a + 3: seite + +/^a/IF +Capturing subpattern count = 0 +Options: anchored +No first char +No need char + +/line\nbreak/ +Capturing subpattern count = 0 +No options +First char = 'l' +Need char = 'k' + this is a line\nbreak + 0: line\x0abreak + line one\nthis is a line\nbreak in the second line + 0: line\x0abreak + +/line\nbreak/f +Capturing subpattern count = 0 +Options: firstline +First char = 'l' +Need char = 'k' + this is a line\nbreak + 0: line\x0abreak + ** Failers +No match + line one\nthis is a line\nbreak in the second line +No match + +/line\nbreak/mf +Capturing subpattern count = 0 +Options: multiline firstline +First char = 'l' +Need char = 'k' + this is a line\nbreak + 0: line\x0abreak + ** Failers +No match + line one\nthis is a line\nbreak in the second line +No match + +/ab.cd/P + ab-cd + 0: ab-cd + ab=cd + 0: ab=cd + ** Failers +No match: POSIX code 17: match failed + ab\ncd +No match: POSIX code 17: match failed + +/ab.cd/Ps + ab-cd + 0: ab-cd + ab=cd + 0: ab=cd + ab\ncd + 0: ab\x0acd + +/(?i)(?-i)AbCd/ +Capturing subpattern count = 0 +No options +First char = 'A' +Need char = 'd' + AbCd + 0: AbCd + ** Failers +No match + abcd +No match + +/a{11111111111111111111}/ +Failed: number too big in {} quantifier at offset 22 + +/(){64294967295}/ +Failed: number too big in {} quantifier at offset 14 + +/(){2,4294967295}/ +Failed: number too big in {} quantifier at offset 15 + +"(?i:a)(?i:b)(?i:c)(?i:d)(?i:e)(?i:f)(?i:g)(?i:h)(?i:i)(?i:j)(k)(?i:l)A\1B" +Capturing subpattern count = 1 +Max back reference = 1 +No options +Case state changes +First char = 'a' (caseless) +Need char = 'B' + abcdefghijklAkB + 0: abcdefghijklAkB + 1: k + +"(?Pa)(?Pb)(?Pc)(?Pd)(?Pe)(?Pf)(?Pg)(?Ph)(?Pi)(?Pj)(?Pk)(?Pl)A\11B" +Capturing subpattern count = 12 +Max back reference = 11 +Named capturing subpatterns: + n0 1 + n1 2 + n10 11 + n11 12 + n2 3 + n3 4 + n4 5 + n5 6 + n6 7 + n7 8 + n8 9 + n9 10 +No options +First char = 'a' +Need char = 'B' + abcdefghijklAkB + 0: abcdefghijklAkB + 1: a + 2: b + 3: c + 4: d + 5: e + 6: f + 7: g + 8: h + 9: i +10: j +11: k +12: l + +"(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)A\11B" +Capturing subpattern count = 12 +Max back reference = 11 +No options +First char = 'a' +Need char = 'B' + abcdefghijklAkB + 0: abcdefghijklAkB + 1: a + 2: b + 3: c + 4: d + 5: e + 6: f + 7: g + 8: h + 9: i +10: j +11: k +12: l + +"(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)(?Pa)" +Capturing subpattern count = 101 +Named capturing subpatterns: + name0 1 + name1 2 + name10 11 + name100 101 + name11 12 + name12 13 + name13 14 + name14 15 + name15 16 + name16 17 + name17 18 + name18 19 + name19 20 + name2 3 + name20 21 + name21 22 + name22 23 + name23 24 + name24 25 + name25 26 + name26 27 + name27 28 + name28 29 + name29 30 + name3 4 + name30 31 + name31 32 + name32 33 + name33 34 + name34 35 + name35 36 + name36 37 + name37 38 + name38 39 + name39 40 + name4 5 + name40 41 + name41 42 + name42 43 + name43 44 + name44 45 + name45 46 + name46 47 + name47 48 + name48 49 + name49 50 + name5 6 + name50 51 + name51 52 + name52 53 + name53 54 + name54 55 + name55 56 + name56 57 + name57 58 + name58 59 + name59 60 + name6 7 + name60 61 + name61 62 + name62 63 + name63 64 + name64 65 + name65 66 + name66 67 + name67 68 + name68 69 + name69 70 + name7 8 + name70 71 + name71 72 + name72 73 + name73 74 + name74 75 + name75 76 + name76 77 + name77 78 + name78 79 + name79 80 + name8 9 + name80 81 + name81 82 + name82 83 + name83 84 + name84 85 + name85 86 + name86 87 + name87 88 + name88 89 + name89 90 + name9 10 + name90 91 + name91 92 + name92 93 + name93 94 + name94 95 + name95 96 + name96 97 + name97 98 + name98 99 + name99 100 +No options +First char = 'a' +Need char = 'a' + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +Matched, but too many substrings + 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + 1: a + 2: a + 3: a + 4: a + 5: a + 6: a + 7: a + 8: a + 9: a +10: a +11: a +12: a +13: a +14: a + +"(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)" +Capturing subpattern count = 101 +No options +First char = 'a' +Need char = 'a' + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +Matched, but too many substrings + 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + 1: a + 2: a + 3: a + 4: a + 5: a + 6: a + 7: a + 8: a + 9: a +10: a +11: a +12: a +13: a +14: a + +/ End of testinput2 / +Capturing subpattern count = 0 +No options +First char = ' ' +Need char = ' ' diff --git a/mozilla/js/tamarin/pcre/testdata/testoutput3 b/mozilla/js/tamarin/pcre/testdata/testoutput3 new file mode 100644 index 00000000000..af5ac53a0da --- /dev/null +++ b/mozilla/js/tamarin/pcre/testdata/testoutput3 @@ -0,0 +1,115 @@ +PCRE version 6.4 05-Sep-2005 + +/^[\w]+/ + *** Failers +No match + École +No match + +/^[\w]+/Lfr_FR + École + 0: École + +/^[\w]+/ + *** Failers +No match + École +No match + +/^[\W]+/ + École + 0: \xc9 + +/^[\W]+/Lfr_FR + *** Failers + 0: *** + École +No match + +/[\b]/ + \b + 0: \x08 + *** Failers +No match + a +No match + +/[\b]/Lfr_FR + \b + 0: \x08 + *** Failers +No match + a +No match + +/^\w+/ + *** Failers +No match + École +No match + +/^\w+/Lfr_FR + École + 0: École + +/(.+)\b(.+)/ + École + 0: \xc9cole + 1: \xc9 + 2: cole + +/(.+)\b(.+)/Lfr_FR + *** Failers + 0: *** Failers + 1: *** + 2: Failers + École +No match + +/École/i + École + 0: \xc9cole + *** Failers +No match + école +No match + +/École/iLfr_FR + École + 0: École + école + 0: école + +/\w/IS +Capturing subpattern count = 0 +No options +No first char +No need char +Starting byte set: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P + Q R S T U V W X Y Z _ a b c d e f g h i j k l m n o p q r s t u v w x y z + +/\w/ISLfr_FR +Capturing subpattern count = 0 +No options +No first char +No need char +Starting byte set: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P + Q R S T U V W X Y Z _ a b c d e f g h i j k l m n o p q r s t u v w x y z + µ À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö Ø Ù Ú Û Ü Ý Þ ß à á â ã ä + å æ ç è é ê ë ì í î ï ð ñ ò ó ô õ ö ø ù ú û ü ý þ ÿ + +/^[\xc8-\xc9]/iLfr_FR + École + 0: É + école + 0: é + +/^[\xc8-\xc9]/Lfr_FR + École + 0: É + *** Failers +No match + école +No match + +/ End of testinput3 / diff --git a/mozilla/js/tamarin/pcre/testdata/testoutput4 b/mozilla/js/tamarin/pcre/testdata/testoutput4 new file mode 100644 index 00000000000..41f888ff3e7 --- /dev/null +++ b/mozilla/js/tamarin/pcre/testdata/testoutput4 @@ -0,0 +1,903 @@ +PCRE version 6.4 05-Sep-2005 + +/-- Do not use the \x{} construct except with patterns that have the --/ +/-- /8 option set, because PCRE doesn't recognize them as UTF-8 unless --/ +No match +/-- that option is set. However, the latest Perls recognize them always. --/ +No match + +/a.b/8 + acb + 0: acb + a\x7fb + 0: a\x{7f}b + a\x{100}b + 0: a\x{100}b + *** Failers +No match + a\nb +No match + +/a(.{3})b/8 + a\x{4000}xyb + 0: a\x{4000}xyb + 1: \x{4000}xy + a\x{4000}\x7fyb + 0: a\x{4000}\x{7f}yb + 1: \x{4000}\x{7f}y + a\x{4000}\x{100}yb + 0: a\x{4000}\x{100}yb + 1: \x{4000}\x{100}y + *** Failers +No match + a\x{4000}b +No match + ac\ncb +No match + +/a(.*?)(.)/ + a\xc0\x88b + 0: a\xc0 + 1: + 2: \xc0 + +/a(.*?)(.)/8 + a\x{100}b + 0: a\x{100} + 1: + 2: \x{100} + +/a(.*)(.)/ + a\xc0\x88b + 0: a\xc0\x88b + 1: \xc0\x88 + 2: b + +/a(.*)(.)/8 + a\x{100}b + 0: a\x{100}b + 1: \x{100} + 2: b + +/a(.)(.)/ + a\xc0\x92bcd + 0: a\xc0\x92 + 1: \xc0 + 2: \x92 + +/a(.)(.)/8 + a\x{240}bcd + 0: a\x{240}b + 1: \x{240} + 2: b + +/a(.?)(.)/ + a\xc0\x92bcd + 0: a\xc0\x92 + 1: \xc0 + 2: \x92 + +/a(.?)(.)/8 + a\x{240}bcd + 0: a\x{240}b + 1: \x{240} + 2: b + +/a(.??)(.)/ + a\xc0\x92bcd + 0: a\xc0 + 1: + 2: \xc0 + +/a(.??)(.)/8 + a\x{240}bcd + 0: a\x{240} + 1: + 2: \x{240} + +/a(.{3})b/8 + a\x{1234}xyb + 0: a\x{1234}xyb + 1: \x{1234}xy + a\x{1234}\x{4321}yb + 0: a\x{1234}\x{4321}yb + 1: \x{1234}\x{4321}y + a\x{1234}\x{4321}\x{3412}b + 0: a\x{1234}\x{4321}\x{3412}b + 1: \x{1234}\x{4321}\x{3412} + *** Failers +No match + a\x{1234}b +No match + ac\ncb +No match + +/a(.{3,})b/8 + a\x{1234}xyb + 0: a\x{1234}xyb + 1: \x{1234}xy + a\x{1234}\x{4321}yb + 0: a\x{1234}\x{4321}yb + 1: \x{1234}\x{4321}y + a\x{1234}\x{4321}\x{3412}b + 0: a\x{1234}\x{4321}\x{3412}b + 1: \x{1234}\x{4321}\x{3412} + axxxxbcdefghijb + 0: axxxxbcdefghijb + 1: xxxxbcdefghij + a\x{1234}\x{4321}\x{3412}\x{3421}b + 0: a\x{1234}\x{4321}\x{3412}\x{3421}b + 1: \x{1234}\x{4321}\x{3412}\x{3421} + *** Failers +No match + a\x{1234}b +No match + +/a(.{3,}?)b/8 + a\x{1234}xyb + 0: a\x{1234}xyb + 1: \x{1234}xy + a\x{1234}\x{4321}yb + 0: a\x{1234}\x{4321}yb + 1: \x{1234}\x{4321}y + a\x{1234}\x{4321}\x{3412}b + 0: a\x{1234}\x{4321}\x{3412}b + 1: \x{1234}\x{4321}\x{3412} + axxxxbcdefghijb + 0: axxxxb + 1: xxxx + a\x{1234}\x{4321}\x{3412}\x{3421}b + 0: a\x{1234}\x{4321}\x{3412}\x{3421}b + 1: \x{1234}\x{4321}\x{3412}\x{3421} + *** Failers +No match + a\x{1234}b +No match + +/a(.{3,5})b/8 + a\x{1234}xyb + 0: a\x{1234}xyb + 1: \x{1234}xy + a\x{1234}\x{4321}yb + 0: a\x{1234}\x{4321}yb + 1: \x{1234}\x{4321}y + a\x{1234}\x{4321}\x{3412}b + 0: a\x{1234}\x{4321}\x{3412}b + 1: \x{1234}\x{4321}\x{3412} + axxxxbcdefghijb + 0: axxxxb + 1: xxxx + a\x{1234}\x{4321}\x{3412}\x{3421}b + 0: a\x{1234}\x{4321}\x{3412}\x{3421}b + 1: \x{1234}\x{4321}\x{3412}\x{3421} + axbxxbcdefghijb + 0: axbxxb + 1: xbxx + axxxxxbcdefghijb + 0: axxxxxb + 1: xxxxx + *** Failers +No match + a\x{1234}b +No match + axxxxxxbcdefghijb +No match + +/a(.{3,5}?)b/8 + a\x{1234}xyb + 0: a\x{1234}xyb + 1: \x{1234}xy + a\x{1234}\x{4321}yb + 0: a\x{1234}\x{4321}yb + 1: \x{1234}\x{4321}y + a\x{1234}\x{4321}\x{3412}b + 0: a\x{1234}\x{4321}\x{3412}b + 1: \x{1234}\x{4321}\x{3412} + axxxxbcdefghijb + 0: axxxxb + 1: xxxx + a\x{1234}\x{4321}\x{3412}\x{3421}b + 0: a\x{1234}\x{4321}\x{3412}\x{3421}b + 1: \x{1234}\x{4321}\x{3412}\x{3421} + axbxxbcdefghijb + 0: axbxxb + 1: xbxx + axxxxxbcdefghijb + 0: axxxxxb + 1: xxxxx + *** Failers +No match + a\x{1234}b +No match + axxxxxxbcdefghijb +No match + +/^[a\x{c0}]/8 + *** Failers +No match + \x{100} +No match + +/(?<=aXb)cd/8 + aXbcd + 0: cd + +/(?<=a\x{100}b)cd/8 + a\x{100}bcd + 0: cd + +/(?<=a\x{100000}b)cd/8 + a\x{100000}bcd + 0: cd + +/(?:\x{100}){3}b/8 + \x{100}\x{100}\x{100}b + 0: \x{100}\x{100}\x{100}b + *** Failers +No match + \x{100}\x{100}b +No match + +/\x{ab}/8 + \x{ab} + 0: \x{ab} + \xc2\xab + 0: \x{ab} + *** Failers +No match + \x00{ab} +No match + +/(?<=(.))X/8 + WXYZ + 0: X + 1: W + \x{256}XYZ + 0: X + 1: \x{256} + *** Failers +No match + XYZ +No match + +/X(\C{3})/8 + X\x{1234} + 0: X\x{1234} + 1: \x{1234} + +/X(\C{4})/8 + X\x{1234}YZ + 0: X\x{1234}Y + 1: \x{1234}Y + +/X\C*/8 + XYZabcdce + 0: XYZabcdce + +/X\C*?/8 + XYZabcde + 0: X + +/X\C{3,5}/8 + Xabcdefg + 0: Xabcde + X\x{1234} + 0: X\x{1234} + X\x{1234}YZ + 0: X\x{1234}YZ + X\x{1234}\x{512} + 0: X\x{1234}\x{512} + X\x{1234}\x{512}YZ + 0: X\x{1234}\x{512} + +/X\C{3,5}?/8 + Xabcdefg + 0: Xabc + X\x{1234} + 0: X\x{1234} + X\x{1234}YZ + 0: X\x{1234} + X\x{1234}\x{512} + 0: X\x{1234} + +/[^a]+/8g + bcd + 0: bcd + \x{100}aY\x{256}Z + 0: \x{100} + 0: Y\x{256}Z + +/^[^a]{2}/8 + \x{100}bc + 0: \x{100}b + +/^[^a]{2,}/8 + \x{100}bcAa + 0: \x{100}bcA + +/^[^a]{2,}?/8 + \x{100}bca + 0: \x{100}b + +/[^a]+/8ig + bcd + 0: bcd + \x{100}aY\x{256}Z + 0: \x{100} + 0: Y\x{256}Z + +/^[^a]{2}/8i + \x{100}bc + 0: \x{100}b + +/^[^a]{2,}/8i + \x{100}bcAa + 0: \x{100}bc + +/^[^a]{2,}?/8i + \x{100}bca + 0: \x{100}b + +/\x{100}{0,0}/8 + abcd + 0: + +/\x{100}?/8 + abcd + 0: + \x{100}\x{100} + 0: \x{100} + +/\x{100}{0,3}/8 + \x{100}\x{100} + 0: \x{100}\x{100} + \x{100}\x{100}\x{100}\x{100} + 0: \x{100}\x{100}\x{100} + +/\x{100}*/8 + abce + 0: + \x{100}\x{100}\x{100}\x{100} + 0: \x{100}\x{100}\x{100}\x{100} + +/\x{100}{1,1}/8 + abcd\x{100}\x{100}\x{100}\x{100} + 0: \x{100} + +/\x{100}{1,3}/8 + abcd\x{100}\x{100}\x{100}\x{100} + 0: \x{100}\x{100}\x{100} + +/\x{100}+/8 + abcd\x{100}\x{100}\x{100}\x{100} + 0: \x{100}\x{100}\x{100}\x{100} + +/\x{100}{3}/8 + abcd\x{100}\x{100}\x{100}XX + 0: \x{100}\x{100}\x{100} + +/\x{100}{3,5}/8 + abcd\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}XX + 0: \x{100}\x{100}\x{100}\x{100}\x{100} + +/\x{100}{3,}/8 + abcd\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}XX + 0: \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100} + +/(?<=a\x{100}{2}b)X/8+ + Xyyya\x{100}\x{100}bXzzz + 0: X + 0+ zzz + +/\D*/8 + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + +/\D*/8 + \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100} + 0: \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100} + +/\D/8 + 1X2 + 0: X + 1\x{100}2 + 0: \x{100} + +/>\S/8 + > >X Y + 0: >X + > >\x{100} Y + 0: >\x{100} + +/\d/8 + \x{100}3 + 0: 3 + +/\s/8 + \x{100} X + 0: + +/\D+/8 + 12abcd34 + 0: abcd + *** Failers + 0: *** Failers + 1234 +No match + +/\D{2,3}/8 + 12abcd34 + 0: abc + 12ab34 + 0: ab + *** Failers + 0: *** + 1234 +No match + 12a34 +No match + +/\D{2,3}?/8 + 12abcd34 + 0: ab + 12ab34 + 0: ab + *** Failers + 0: ** + 1234 +No match + 12a34 +No match + +/\d+/8 + 12abcd34 + 0: 12 + *** Failers +No match + +/\d{2,3}/8 + 12abcd34 + 0: 12 + 1234abcd + 0: 123 + *** Failers +No match + 1.4 +No match + +/\d{2,3}?/8 + 12abcd34 + 0: 12 + 1234abcd + 0: 12 + *** Failers +No match + 1.4 +No match + +/\S+/8 + 12abcd34 + 0: 12abcd34 + *** Failers + 0: *** + \ \ +No match + +/\S{2,3}/8 + 12abcd34 + 0: 12a + 1234abcd + 0: 123 + *** Failers + 0: *** + \ \ +No match + +/\S{2,3}?/8 + 12abcd34 + 0: 12 + 1234abcd + 0: 12 + *** Failers + 0: ** + \ \ +No match + +/>\s+ <34 + 0: > < + 0+ 34 + *** Failers +No match + +/>\s{2,3} < + 0+ cd + ab> < + 0+ ce + *** Failers +No match + ab> \s{2,3}? < + 0+ cd + ab> < + 0+ ce + *** Failers +No match + ab> \xff< + 0: \xff + +/[\xff]/8 + >\x{ff}< + 0: \x{ff} + +/[^\xFF]/ + XYZ + 0: X + +/[^\xff]/8 + XYZ + 0: X + \x{123} + 0: \x{123} + +/^[ac]*b/8 + xb +No match + +/^[ac\x{100}]*b/8 + xb +No match + +/^[^x]*b/8i + xb +No match + +/^[^x]*b/8 + xb +No match + +/^\d*b/8 + xb +No match + +/(|a)/g8 + catac + 0: + 1: + 0: + 1: + 0: a + 1: a + 0: + 1: + 0: + 1: + 0: a + 1: a + 0: + 1: + 0: + 1: + a\x{256}a + 0: + 1: + 0: a + 1: a + 0: + 1: + 0: + 1: + 0: a + 1: a + 0: + 1: + +/^\x{85}$/8i + \x{85} + 0: \x{85} + +/ End of testinput4 / diff --git a/mozilla/js/tamarin/pcre/testdata/testoutput5 b/mozilla/js/tamarin/pcre/testdata/testoutput5 new file mode 100644 index 00000000000..da697db64d0 --- /dev/null +++ b/mozilla/js/tamarin/pcre/testdata/testoutput5 @@ -0,0 +1,1075 @@ +PCRE version 6.4 05-Sep-2005 + +/\x{100}/8DM +Memory allocation (code space): 10 +------------------------------------------------------------------ + 0 6 Bra 0 + 3 \x{100} + 6 6 Ket + 9 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: utf8 +First char = 196 +Need char = 128 + +/\x{1000}/8DM +Memory allocation (code space): 11 +------------------------------------------------------------------ + 0 7 Bra 0 + 3 \x{1000} + 7 7 Ket + 10 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: utf8 +First char = 225 +Need char = 128 + +/\x{10000}/8DM +Memory allocation (code space): 12 +------------------------------------------------------------------ + 0 8 Bra 0 + 3 \x{10000} + 8 8 Ket + 11 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: utf8 +First char = 240 +Need char = 128 + +/\x{100000}/8DM +Memory allocation (code space): 12 +------------------------------------------------------------------ + 0 8 Bra 0 + 3 \x{100000} + 8 8 Ket + 11 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: utf8 +First char = 244 +Need char = 128 + +/\x{1000000}/8DM +Memory allocation (code space): 13 +------------------------------------------------------------------ + 0 9 Bra 0 + 3 \x{1000000} + 9 9 Ket + 12 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: utf8 +First char = 249 +Need char = 128 + +/\x{4000000}/8DM +Memory allocation (code space): 14 +------------------------------------------------------------------ + 0 10 Bra 0 + 3 \x{4000000} + 10 10 Ket + 13 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: utf8 +First char = 252 +Need char = 128 + +/\x{7fffFFFF}/8DM +Memory allocation (code space): 14 +------------------------------------------------------------------ + 0 10 Bra 0 + 3 \x{7fffffff} + 10 10 Ket + 13 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: utf8 +First char = 253 +Need char = 191 + +/[\x{ff}]/8DM +Memory allocation (code space): 10 +------------------------------------------------------------------ + 0 6 Bra 0 + 3 \x{ff} + 6 6 Ket + 9 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: utf8 +First char = 195 +Need char = 191 + +/[\x{100}]/8DM +Memory allocation (code space): 47 +------------------------------------------------------------------ + 0 11 Bra 0 + 3 [\x{100}] + 11 11 Ket + 14 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: utf8 +No first char +No need char + +/\x{ffffffff}/8 +Failed: character value in \x{...} sequence is too large at offset 11 + +/\x{100000000}/8 +Failed: character value in \x{...} sequence is too large at offset 12 + +/^\x{100}a\x{1234}/8 + \x{100}a\x{1234}bcd + 0: \x{100}a\x{1234} + +/\x80/8D +------------------------------------------------------------------ + 0 6 Bra 0 + 3 \x{80} + 6 6 Ket + 9 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: utf8 +First char = 194 +Need char = 128 + +/\xff/8D +------------------------------------------------------------------ + 0 6 Bra 0 + 3 \x{ff} + 6 6 Ket + 9 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: utf8 +First char = 195 +Need char = 191 + +/\x{0041}\x{2262}\x{0391}\x{002e}/D8 +------------------------------------------------------------------ + 0 14 Bra 0 + 3 A\x{2262}\x{391}. + 14 14 Ket + 17 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: utf8 +First char = 'A' +Need char = '.' + \x{0041}\x{2262}\x{0391}\x{002e} + 0: A\x{2262}\x{391}. + +/\x{D55c}\x{ad6d}\x{C5B4}/D8 +------------------------------------------------------------------ + 0 15 Bra 0 + 3 \x{d55c}\x{ad6d}\x{c5b4} + 15 15 Ket + 18 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: utf8 +First char = 237 +Need char = 180 + \x{D55c}\x{ad6d}\x{C5B4} + 0: \x{d55c}\x{ad6d}\x{c5b4} + +/\x{65e5}\x{672c}\x{8a9e}/D8 +------------------------------------------------------------------ + 0 15 Bra 0 + 3 \x{65e5}\x{672c}\x{8a9e} + 15 15 Ket + 18 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: utf8 +First char = 230 +Need char = 158 + \x{65e5}\x{672c}\x{8a9e} + 0: \x{65e5}\x{672c}\x{8a9e} + +/\x{80}/D8 +------------------------------------------------------------------ + 0 6 Bra 0 + 3 \x{80} + 6 6 Ket + 9 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: utf8 +First char = 194 +Need char = 128 + +/\x{084}/D8 +------------------------------------------------------------------ + 0 6 Bra 0 + 3 \x{84} + 6 6 Ket + 9 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: utf8 +First char = 194 +Need char = 132 + +/\x{104}/D8 +------------------------------------------------------------------ + 0 6 Bra 0 + 3 \x{104} + 6 6 Ket + 9 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: utf8 +First char = 196 +Need char = 132 + +/\x{861}/D8 +------------------------------------------------------------------ + 0 7 Bra 0 + 3 \x{861} + 7 7 Ket + 10 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: utf8 +First char = 224 +Need char = 161 + +/\x{212ab}/D8 +------------------------------------------------------------------ + 0 8 Bra 0 + 3 \x{212ab} + 8 8 Ket + 11 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: utf8 +First char = 240 +Need char = 171 + +/.{3,5}X/D8 +------------------------------------------------------------------ + 0 13 Bra 0 + 3 Any{3} + 7 Any{0,2} + 11 X + 13 13 Ket + 16 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Partial matching not supported +Options: utf8 +No first char +Need char = 'X' + \x{212ab}\x{212ab}\x{212ab}\x{861}X + 0: \x{212ab}\x{212ab}\x{212ab}\x{861}X + + +/.{3,5}?/D8 +------------------------------------------------------------------ + 0 11 Bra 0 + 3 Any{3} + 7 Any{0,2}? + 11 11 Ket + 14 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Partial matching not supported +Options: utf8 +No first char +No need char + \x{212ab}\x{212ab}\x{212ab}\x{861} + 0: \x{212ab}\x{212ab}\x{212ab} + +/-- These tests are here rather than in testinput4 because Perl 5.6 has --/ +/-- some problems with UTF-8 support, in the area of \x{..} where the --/ +No match +/-- value is < 255. It grumbles about invalid UTF-8 strings. --/ +No match + +/^[a\x{c0}]b/8 + \x{c0}b + 0: \x{c0}b + +/^([a\x{c0}]*?)aa/8 + a\x{c0}aaaa/ + 0: a\x{c0}aa + 1: a\x{c0} + +/^([a\x{c0}]*?)aa/8 + a\x{c0}aaaa/ + 0: a\x{c0}aa + 1: a\x{c0} + a\x{c0}a\x{c0}aaa/ + 0: a\x{c0}a\x{c0}aa + 1: a\x{c0}a\x{c0} + +/^([a\x{c0}]*)aa/8 + a\x{c0}aaaa/ + 0: a\x{c0}aaaa + 1: a\x{c0}aa + a\x{c0}a\x{c0}aaa/ + 0: a\x{c0}a\x{c0}aaa + 1: a\x{c0}a\x{c0}a + +/^([a\x{c0}]*)a\x{c0}/8 + a\x{c0}aaaa/ + 0: a\x{c0} + 1: + a\x{c0}a\x{c0}aaa/ + 0: a\x{c0}a\x{c0} + 1: a\x{c0} + +/-- --/ + +/(?<=\C)X/8 +Failed: \C not allowed in lookbehind assertion at offset 6 + +/-- This one is here not because it's different to Perl, but because the --/ +/-- way the captured single-byte is displayed. (In Perl it becomes a --/ +No match +/-- character, and you can't tell the difference.) --/ +No match + +/X(\C)(.*)/8 + X\x{1234} + 0: X\x{1234} + 1: \xe1 + 2: \x88\xb4 + X\nabc + 0: X\x{0a}abc + 1: \x{0a} + 2: abc + +/^[ab]/8D +------------------------------------------------------------------ + 0 37 Bra 0 + 3 ^ + 4 [ab] + 37 37 Ket + 40 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: anchored utf8 +No first char +No need char + bar + 0: b + *** Failers +No match + c +No match + \x{ff} +No match + \x{100} +No match + +/^[^ab]/8D +------------------------------------------------------------------ + 0 37 Bra 0 + 3 ^ + 4 [\x00-`c-\xff] (neg) + 37 37 Ket + 40 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: anchored utf8 +No first char +No need char + c + 0: c + \x{ff} + 0: \x{ff} + \x{100} + 0: \x{100} + *** Failers + 0: * + aaa +No match + +/[^ab\xC0-\xF0]/8SD +------------------------------------------------------------------ + 0 36 Bra 0 + 3 [\x00-`c-\xbf\xf1-\xff] (neg) + 36 36 Ket + 39 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: utf8 +No first char +No need char +Starting byte set: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a + \x0b \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19 + \x1a \x1b \x1c \x1d \x1e \x1f \x20 ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 + 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y + Z [ \ ] ^ _ ` c d e f g h i j k l m n o p q r s t u v w x y z { | } ~ \x7f + \xc2 \xc3 \xc4 \xc5 \xc6 \xc7 \xc8 \xc9 \xca \xcb \xcc \xcd \xce \xcf \xd0 + \xd1 \xd2 \xd3 \xd4 \xd5 \xd6 \xd7 \xd8 \xd9 \xda \xdb \xdc \xdd \xde \xdf + \xe0 \xe1 \xe2 \xe3 \xe4 \xe5 \xe6 \xe7 \xe8 \xe9 \xea \xeb \xec \xed \xee + \xef \xf0 \xf1 \xf2 \xf3 \xf4 \xf5 \xf6 \xf7 \xf8 \xf9 \xfa \xfb \xfc \xfd + \xfe \xff + \x{f1} + 0: \x{f1} + \x{bf} + 0: \x{bf} + \x{100} + 0: \x{100} + \x{1000} + 0: \x{1000} + *** Failers + 0: * + \x{c0} +No match + \x{f0} +No match + +/Ä€{3,4}/8SD +------------------------------------------------------------------ + 0 13 Bra 0 + 3 \x{100}{3} + 8 \x{100}{,1} + 13 13 Ket + 16 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Partial matching not supported +Options: utf8 +First char = 196 +Need char = 128 +Study returned NULL + \x{100}\x{100}\x{100}\x{100\x{100} + 0: \x{100}\x{100}\x{100} + +/(\x{100}+|x)/8SD +------------------------------------------------------------------ + 0 17 Bra 0 + 3 6 Bra 1 + 6 \x{100}+ + 9 5 Alt + 12 x + 14 11 Ket + 17 17 Ket + 20 End +------------------------------------------------------------------ +Capturing subpattern count = 1 +Partial matching not supported +Options: utf8 +No first char +No need char +Starting byte set: x \xc4 + +/(\x{100}*a|x)/8SD +------------------------------------------------------------------ + 0 19 Bra 0 + 3 8 Bra 1 + 6 \x{100}* + 9 a + 11 5 Alt + 14 x + 16 13 Ket + 19 19 Ket + 22 End +------------------------------------------------------------------ +Capturing subpattern count = 1 +Partial matching not supported +Options: utf8 +No first char +No need char +Starting byte set: a x \xc4 + +/(\x{100}{0,2}a|x)/8SD +------------------------------------------------------------------ + 0 21 Bra 0 + 3 10 Bra 1 + 6 \x{100}{,2} + 11 a + 13 5 Alt + 16 x + 18 15 Ket + 21 21 Ket + 24 End +------------------------------------------------------------------ +Capturing subpattern count = 1 +Partial matching not supported +Options: utf8 +No first char +No need char +Starting byte set: a x \xc4 + +/(\x{100}{1,2}a|x)/8SD +------------------------------------------------------------------ + 0 24 Bra 0 + 3 13 Bra 1 + 6 \x{100} + 9 \x{100}{,1} + 14 a + 16 5 Alt + 19 x + 21 18 Ket + 24 24 Ket + 27 End +------------------------------------------------------------------ +Capturing subpattern count = 1 +Partial matching not supported +Options: utf8 +No first char +No need char +Starting byte set: x \xc4 + +/\x{100}*(\d+|"(?1)")/8 + 1234 + 0: 1234 + 1: 1234 + "1234" + 0: "1234" + 1: "1234" + \x{100}1234 + 0: \x{100}1234 + 1: 1234 + "\x{100}1234" + 0: \x{100}1234 + 1: 1234 + \x{100}\x{100}12ab + 0: \x{100}\x{100}12 + 1: 12 + \x{100}\x{100}"12" + 0: \x{100}\x{100}"12" + 1: "12" + *** Failers +No match + \x{100}\x{100}abcd +No match + +/\x{100}/8D +------------------------------------------------------------------ + 0 6 Bra 0 + 3 \x{100} + 6 6 Ket + 9 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: utf8 +First char = 196 +Need char = 128 + +/\x{100}*/8D +------------------------------------------------------------------ + 0 6 Bra 0 + 3 \x{100}* + 6 6 Ket + 9 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Partial matching not supported +Options: utf8 +No first char +No need char + +/a\x{100}*/8D +------------------------------------------------------------------ + 0 8 Bra 0 + 3 a + 5 \x{100}* + 8 8 Ket + 11 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Partial matching not supported +Options: utf8 +First char = 'a' +No need char + +/ab\x{100}*/8D +------------------------------------------------------------------ + 0 10 Bra 0 + 3 ab + 7 \x{100}* + 10 10 Ket + 13 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Partial matching not supported +Options: utf8 +First char = 'a' +Need char = 'b' + +/a\x{100}\x{101}*/8D +------------------------------------------------------------------ + 0 11 Bra 0 + 3 a\x{100} + 8 \x{101}* + 11 11 Ket + 14 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Partial matching not supported +Options: utf8 +First char = 'a' +Need char = 128 + +/a\x{100}\x{101}+/8D +------------------------------------------------------------------ + 0 11 Bra 0 + 3 a\x{100} + 8 \x{101}+ + 11 11 Ket + 14 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Partial matching not supported +Options: utf8 +First char = 'a' +Need char = 129 + +/\x{100}*A/8D +------------------------------------------------------------------ + 0 8 Bra 0 + 3 \x{100}* + 6 A + 8 8 Ket + 11 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Partial matching not supported +Options: utf8 +No first char +Need char = 'A' + A + 0: A + +/\x{100}*\d(?R)/8D +------------------------------------------------------------------ + 0 10 Bra 0 + 3 \x{100}* + 6 \d + 7 0 Recurse + 10 10 Ket + 13 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Partial matching not supported +Options: utf8 +No first char +No need char + +/[^\x{c4}]/D +------------------------------------------------------------------ + 0 36 Bra 0 + 3 [\x01-35-bd-z|~-\xff] (neg) + 36 36 Ket + 39 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +No options +No first char +No need char + +/[^\x{c4}]/8D +------------------------------------------------------------------ + 0 36 Bra 0 + 3 [\x00-\xc3\xc5-\xff] (neg) + 36 36 Ket + 39 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: utf8 +No first char +No need char + +/[\x{100}]/8DM +Memory allocation (code space): 47 +------------------------------------------------------------------ + 0 11 Bra 0 + 3 [\x{100}] + 11 11 Ket + 14 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: utf8 +No first char +No need char + \x{100} + 0: \x{100} + Z\x{100} + 0: \x{100} + \x{100}Z + 0: \x{100} + *** Failers +No match + +/[Z\x{100}]/8DM +Memory allocation (code space): 47 +------------------------------------------------------------------ + 0 43 Bra 0 + 3 [Z\x{100}] + 43 43 Ket + 46 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: utf8 +No first char +No need char + Z\x{100} + 0: Z + \x{100} + 0: \x{100} + \x{100}Z + 0: \x{100} + *** Failers +No match + +/[\x{200}-\x{100}]/8 +Failed: range out of order in character class at offset 15 + +/[Ä€-Ä„]/8 + \x{100} + 0: \x{100} + \x{104} + 0: \x{104} + *** Failers +No match + \x{105} +No match + \x{ff} +No match + +/[z-\x{100}]/8D +------------------------------------------------------------------ + 0 12 Bra 0 + 3 [z-\x{100}] + 12 12 Ket + 15 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: utf8 +No first char +No need char + +/[z\Qa-d]Ä€\E]/8D +------------------------------------------------------------------ + 0 43 Bra 0 + 3 [\-\]adz\x{100}] + 43 43 Ket + 46 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: utf8 +No first char +No need char + \x{100} + 0: \x{100} + Ä€ + 0: \x{100} + +/[\xFF]/D +------------------------------------------------------------------ + 0 5 Bra 0 + 3 \xff + 5 5 Ket + 8 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +No options +First char = 255 +No need char + >\xff< + 0: \xff + +/[\xff]/D8 +------------------------------------------------------------------ + 0 6 Bra 0 + 3 \x{ff} + 6 6 Ket + 9 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: utf8 +First char = 195 +Need char = 191 + >\x{ff}< + 0: \x{ff} + +/[^\xFF]/D +------------------------------------------------------------------ + 0 5 Bra 0 + 3 [^\xff] + 5 5 Ket + 8 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +No options +No first char +No need char + +/[^\xff]/8D +------------------------------------------------------------------ + 0 36 Bra 0 + 3 [\x00-\xfe] (neg) + 36 36 Ket + 39 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: utf8 +No first char +No need char + +/[Ä-Ü]/8 + Ö # Matches without Study + 0: \x{d6} + \x{d6} + 0: \x{d6} + +/[Ä-Ü]/8S + Ö <-- Same with Study + 0: \x{d6} + \x{d6} + 0: \x{d6} + +/[\x{c4}-\x{dc}]/8 + Ö # Matches without Study + 0: \x{d6} + \x{d6} + 0: \x{d6} + +/[\x{c4}-\x{dc}]/8S + Ö <-- Same with Study + 0: \x{d6} + \x{d6} + 0: \x{d6} + +/[Ã]/8 +Failed: invalid UTF-8 string at offset 2 + +/Ã/8 +Failed: invalid UTF-8 string at offset 0 + +/ÃÃÃxxx/8 +Failed: invalid UTF-8 string at offset 1 + +/ÃÃÃxxx/8?D +------------------------------------------------------------------ + 0 15 Bra 0 + 3 \X{c0}\X{c0}\X{c0}xxx + 15 15 Ket + 18 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: utf8 no_utf8_check +First char = 195 +Need char = 'x' + +/abc/8 + Ã] +Error -10 + à +Error -10 + ÃÃà +Error -10 + ÃÃÃ\? +No match + +/anything/8 + \xc0\x80 +Error -10 + \xc1\x8f +Error -10 + \xe0\x9f\x80 +Error -10 + \xf0\x8f\x80\x80 +Error -10 + \xf8\x87\x80\x80\x80 +Error -10 + \xfc\x83\x80\x80\x80\x80 +Error -10 + \xfe\x80\x80\x80\x80\x80 +Error -10 + \xff\x80\x80\x80\x80\x80 +Error -10 + \xc3\x8f +No match + \xe0\xaf\x80 +No match + \xe1\x80\x80 +No match + \xf0\x9f\x80\x80 +No match + \xf1\x8f\x80\x80 +No match + \xf8\x88\x80\x80\x80 +No match + \xf9\x87\x80\x80\x80 +No match + \xfc\x84\x80\x80\x80\x80 +No match + \xfd\x83\x80\x80\x80\x80 +No match + +/\x{100}abc(xyz(?1))/8D +------------------------------------------------------------------ + 0 27 Bra 0 + 3 \x{100}abc + 12 12 Bra 1 + 15 xyz + 21 12 Recurse + 24 12 Ket + 27 27 Ket + 30 End +------------------------------------------------------------------ +Capturing subpattern count = 1 +Options: utf8 +First char = 196 +Need char = 'z' + +/[^\x{100}]abc(xyz(?1))/8D +------------------------------------------------------------------ + 0 32 Bra 0 + 3 [^\x{100}] + 11 abc + 17 12 Bra 1 + 20 xyz + 26 17 Recurse + 29 12 Ket + 32 32 Ket + 35 End +------------------------------------------------------------------ +Capturing subpattern count = 1 +Options: utf8 +No first char +Need char = 'z' + +/[ab\x{100}]abc(xyz(?1))/8D +------------------------------------------------------------------ + 0 64 Bra 0 + 3 [ab\x{100}] + 43 abc + 49 12 Bra 1 + 52 xyz + 58 49 Recurse + 61 12 Ket + 64 64 Ket + 67 End +------------------------------------------------------------------ +Capturing subpattern count = 1 +Options: utf8 +No first char +Need char = 'z' + +/(\x{100}(b(?2)c))?/D8 +------------------------------------------------------------------ + 0 26 Bra 0 + 3 Brazero + 4 19 Bra 1 + 7 \x{100} + 10 10 Bra 2 + 13 b + 15 10 Recurse + 18 c + 20 10 Ket + 23 19 Ket + 26 26 Ket + 29 End +------------------------------------------------------------------ +Capturing subpattern count = 2 +Options: utf8 +No first char +No need char + +/(\x{100}(b(?2)c)){0,2}/D8 +------------------------------------------------------------------ + 0 55 Bra 0 + 3 Brazero + 4 48 Bra 0 + 7 19 Bra 1 + 10 \x{100} + 13 10 Bra 2 + 16 b + 18 13 Recurse + 21 c + 23 10 Ket + 26 19 Ket + 29 Brazero + 30 19 Bra 1 + 33 \x{100} + 36 10 Bra 2 + 39 b + 41 13 Recurse + 44 c + 46 10 Ket + 49 19 Ket + 52 48 Ket + 55 55 Ket + 58 End +------------------------------------------------------------------ +Capturing subpattern count = 2 +Options: utf8 +No first char +No need char + +/(\x{100}(b(?1)c))?/D8 +------------------------------------------------------------------ + 0 26 Bra 0 + 3 Brazero + 4 19 Bra 1 + 7 \x{100} + 10 10 Bra 2 + 13 b + 15 4 Recurse + 18 c + 20 10 Ket + 23 19 Ket + 26 26 Ket + 29 End +------------------------------------------------------------------ +Capturing subpattern count = 2 +Options: utf8 +No first char +No need char + +/(\x{100}(b(?1)c)){0,2}/D8 +------------------------------------------------------------------ + 0 55 Bra 0 + 3 Brazero + 4 48 Bra 0 + 7 19 Bra 1 + 10 \x{100} + 13 10 Bra 2 + 16 b + 18 7 Recurse + 21 c + 23 10 Ket + 26 19 Ket + 29 Brazero + 30 19 Bra 1 + 33 \x{100} + 36 10 Bra 2 + 39 b + 41 7 Recurse + 44 c + 46 10 Ket + 49 19 Ket + 52 48 Ket + 55 55 Ket + 58 End +------------------------------------------------------------------ +Capturing subpattern count = 2 +Options: utf8 +No first char +No need char + +/\W/8 + A.B + 0: . + A\x{100}B + 0: \x{100} + +/\w/8 + \x{100}X + 0: X + +/ End of testinput5 / diff --git a/mozilla/js/tamarin/pcre/testdata/testoutput6 b/mozilla/js/tamarin/pcre/testdata/testoutput6 new file mode 100644 index 00000000000..1a8d96d51fe --- /dev/null +++ b/mozilla/js/tamarin/pcre/testdata/testoutput6 @@ -0,0 +1,1013 @@ +PCRE version 6.4 05-Sep-2005 + +/^\pC\pL\pM\pN\pP\pS\pZ3 + 0: abc + *** Failers +No match + xyzabc +No match + xyzabc\>2 +No match + +/x\dy\Dz/ + x9yzz + 0: x9yzz + x0y+z + 0: x0y+z + *** Failers +No match + xyz +No match + xxy0z +No match + +/x\sy\Sz/ + x yzz + 0: x yzz + x y+z + 0: x y+z + *** Failers +No match + xyz +No match + xxyyz +No match + +/x\wy\Wz/ + xxy+z + 0: xxy+z + *** Failers +No match + xxy0z +No match + x+y+z +No match + +/x.y/ + x+y + 0: x+y + x-y + 0: x-y + *** Failers +No match + x\ny +No match + +/x.y/s + x+y + 0: x+y + x-y + 0: x-y + x\ny + 0: x\x0ay + +/(a.b(?s)c.d|x.y)p.q/ + a+bc+dp+q + 0: a+bc+dp+q + a+bc\ndp+q + 0: a+bc\x0adp+q + x\nyp+q + 0: x\x0ayp+q + *** Failers +No match + a\nbc\ndp+q +No match + a+bc\ndp\nq +No match + x\nyp\nq +No match + +/a\d\z/ + ba0 + 0: a0 + *** Failers +No match + ba0\n +No match + ba0\ncd +No match + +/a\d\z/m + ba0 + 0: a0 + *** Failers +No match + ba0\n +No match + ba0\ncd +No match + +/a\d\Z/ + ba0 + 0: a0 + ba0\n + 0: a0 + *** Failers +No match + ba0\ncd +No match + +/a\d\Z/m + ba0 + 0: a0 + ba0\n + 0: a0 + *** Failers +No match + ba0\ncd +No match + +/a\d$/ + ba0 + 0: a0 + ba0\n + 0: a0 + *** Failers +No match + ba0\ncd +No match + +/a\d$/m + ba0 + 0: a0 + ba0\n + 0: a0 + ba0\ncd + 0: a0 + *** Failers +No match + +/abc/i + abc + 0: abc + aBc + 0: aBc + ABC + 0: ABC + +/[^a]/ + abcd + 0: b + +/ab?\w/ + abz + 0: abz + 1: ab + abbz + 0: abb + 1: ab + azz + 0: az + +/x{0,3}yz/ + ayzq + 0: yz + axyzq + 0: xyz + axxyz + 0: xxyz + axxxyzq + 0: xxxyz + axxxxyzq + 0: xxxyz + *** Failers +No match + ax +No match + axx +No match + +/x{3}yz/ + axxxyzq + 0: xxxyz + axxxxyzq + 0: xxxyz + *** Failers +No match + ax +No match + axx +No match + ayzq +No match + axyzq +No match + axxyz +No match + +/x{2,3}yz/ + axxyz + 0: xxyz + axxxyzq + 0: xxxyz + axxxxyzq + 0: xxxyz + *** Failers +No match + ax +No match + axx +No match + ayzq +No match + axyzq +No match + +/[^a]+/ + bac + 0: b + bcdefax + 0: bcdef + 1: bcde + 2: bcd + 3: bc + 4: b + *** Failers + 0: *** F + 1: *** + 2: *** + 3: ** + 4: * + aaaaa +No match + +/[^a]*/ + bac + 0: b + 1: + bcdefax + 0: bcdef + 1: bcde + 2: bcd + 3: bc + 4: b + 5: + *** Failers + 0: *** F + 1: *** + 2: *** + 3: ** + 4: * + 5: + aaaaa + 0: + +/[^a]{3,5}/ + xyz + 0: xyz + awxyza + 0: wxyz + 1: wxy + abcdefa + 0: bcdef + 1: bcde + 2: bcd + abcdefghijk + 0: bcdef + 1: bcde + 2: bcd + *** Failers + 0: *** F + 1: *** + 2: *** + axya +No match + axa +No match + aaaaa +No match + +/\d*/ + 1234b567 + 0: 1234 + 1: 123 + 2: 12 + 3: 1 + 4: + xyz + 0: + +/\D*/ + a1234b567 + 0: a + 1: + xyz + 0: xyz + 1: xy + 2: x + 3: + +/\d+/ + ab1234c56 + 0: 1234 + 1: 123 + 2: 12 + 3: 1 + *** Failers +No match + xyz +No match + +/\D+/ + ab123c56 + 0: ab + 1: a + *** Failers + 0: *** Failers + 1: *** Failer + 2: *** Faile + 3: *** Fail + 4: *** Fai + 5: *** Fa + 6: *** F + 7: *** + 8: *** + 9: ** +10: * + 789 +No match + +/\d?A/ + 045ABC + 0: 5A + ABC + 0: A + *** Failers +No match + XYZ +No match + +/\D?A/ + ABC + 0: A + BAC + 0: BA + 9ABC + 0: A + *** Failers +No match + +/a+/ + aaaa + 0: aaaa + 1: aaa + 2: aa + 3: a + +/^.*xyz/ + xyz + 0: xyz + ggggggggxyz + 0: ggggggggxyz + +/^.+xyz/ + abcdxyz + 0: abcdxyz + axyz + 0: axyz + *** Failers +No match + xyz +No match + +/^.?xyz/ + xyz + 0: xyz + cxyz + 0: cxyz + +/^\d{2,3}X/ + 12X + 0: 12X + 123X + 0: 123X + *** Failers +No match + X +No match + 1X +No match + 1234X +No match + +/^[abcd]\d/ + a45 + 0: a4 + b93 + 0: b9 + c99z + 0: c9 + d04 + 0: d0 + *** Failers +No match + e45 +No match + abcd +No match + abcd1234 +No match + 1234 +No match + +/^[abcd]*\d/ + a45 + 0: a4 + b93 + 0: b9 + c99z + 0: c9 + d04 + 0: d0 + abcd1234 + 0: abcd1 + 1234 + 0: 1 + *** Failers +No match + e45 +No match + abcd +No match + +/^[abcd]+\d/ + a45 + 0: a4 + b93 + 0: b9 + c99z + 0: c9 + d04 + 0: d0 + abcd1234 + 0: abcd1 + *** Failers +No match + 1234 +No match + e45 +No match + abcd +No match + +/^a+X/ + aX + 0: aX + aaX + 0: aaX + +/^[abcd]?\d/ + a45 + 0: a4 + b93 + 0: b9 + c99z + 0: c9 + d04 + 0: d0 + 1234 + 0: 1 + *** Failers +No match + abcd1234 +No match + e45 +No match + +/^[abcd]{2,3}\d/ + ab45 + 0: ab4 + bcd93 + 0: bcd9 + *** Failers +No match + 1234 +No match + a36 +No match + abcd1234 +No match + ee45 +No match + +/^(abc)*\d/ + abc45 + 0: abc4 + abcabcabc45 + 0: abcabcabc4 + 42xyz + 0: 4 + *** Failers +No match + +/^(abc)+\d/ + abc45 + 0: abc4 + abcabcabc45 + 0: abcabcabc4 + *** Failers +No match + 42xyz +No match + +/^(abc)?\d/ + abc45 + 0: abc4 + 42xyz + 0: 4 + *** Failers +No match + abcabcabc45 +No match + +/^(abc){2,3}\d/ + abcabc45 + 0: abcabc4 + abcabcabc45 + 0: abcabcabc4 + *** Failers +No match + abcabcabcabc45 +No match + abc45 +No match + 42xyz +No match + +/1(abc|xyz)2(?1)3/ + 1abc2abc3456 + 0: 1abc2abc3 + 1abc2xyz3456 + 0: 1abc2xyz3 + +/^(a*\w|ab)=(a*\w|ab)/ + ab=ab + 0: ab=ab + 1: ab=a + +/^(a*\w|ab)=(?1)/ + ab=ab + 0: ab=ab + 1: ab=a + +/^([^()]|\((?1)*\))*$/ + abc + 0: abc + a(b)c + 0: a(b)c + a(b(c))d + 0: a(b(c))d + *** Failers) +No match + a(b(c)d +No match + +/^>abc>([^()]|\((?1)*\))*abc>123abc>123abc>1(2)3abc>1(2)3abc>(1(2)3)abc>(1(2)3)a*)\d/ + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa9876 + 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa9 + *** Failers +No match + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +No match + +/< (?: (?(R) \d++ | [^<>]*+) | (?R)) * >/x + <> + 0: <> + + 0: + hij> + 0: hij> + hij> + 0: + def> + 0: def> + + 0: <> + *** Failers +No match + abcxyz + 1 ^ ^ x + 0: abcxyz + 123abcxyz999 +--->123abcxyz999 + 1 ^ ^ x + 0: abcxyz + +/(ab|cd){3,4}/C + ababab +--->ababab + +0 ^ (ab|cd){3,4} + +1 ^ a + +4 ^ c + +2 ^^ b + +3 ^ ^ | + +1 ^ ^ a + +4 ^ ^ c + +2 ^ ^ b + +3 ^ ^ | + +1 ^ ^ a + +4 ^ ^ c + +2 ^ ^ b + +3 ^ ^ | ++12 ^ ^ + +1 ^ ^ a + +4 ^ ^ c + 0: ababab + abcdabcd +--->abcdabcd + +0 ^ (ab|cd){3,4} + +1 ^ a + +4 ^ c + +2 ^^ b + +3 ^ ^ | + +1 ^ ^ a + +4 ^ ^ c + +5 ^ ^ d + +6 ^ ^ ) + +1 ^ ^ a + +4 ^ ^ c + +2 ^ ^ b + +3 ^ ^ | ++12 ^ ^ + +1 ^ ^ a + +4 ^ ^ c + +5 ^ ^ d + +6 ^ ^ ) ++12 ^ ^ + 0: abcdabcd + 1: abcdab + abcdcdcdcdcd +--->abcdcdcdcdcd + +0 ^ (ab|cd){3,4} + +1 ^ a + +4 ^ c + +2 ^^ b + +3 ^ ^ | + +1 ^ ^ a + +4 ^ ^ c + +5 ^ ^ d + +6 ^ ^ ) + +1 ^ ^ a + +4 ^ ^ c + +5 ^ ^ d + +6 ^ ^ ) ++12 ^ ^ + +1 ^ ^ a + +4 ^ ^ c + +5 ^ ^ d + +6 ^ ^ ) ++12 ^ ^ + 0: abcdcdcd + 1: abcdcd + +/^abc/ + abcdef + 0: abc + *** Failers +No match + abcdef\B +No match + +/^(a*|xyz)/ + bcd + 0: + aaabcd + 0: aaa + 1: aa + 2: a + 3: + xyz + 0: xyz + 1: + xyz\N + 0: xyz + *** Failers + 0: + bcd\N +No match + +/xyz$/ + xyz + 0: xyz + xyz\n + 0: xyz + *** Failers +No match + xyz\Z +No match + xyz\n\Z +No match + +/xyz$/m + xyz + 0: xyz + xyz\n + 0: xyz + abcxyz\npqr + 0: xyz + abcxyz\npqr\Z + 0: xyz + xyz\n\Z + 0: xyz + *** Failers +No match + xyz\Z +No match + +/\Gabc/ + abcdef + 0: abc + defabcxyz\>3 + 0: abc + *** Failers +No match + defabcxyz +No match + +/^abcdef/ + ab\P +Partial match: ab + abcde\P +Partial match: abcde + abcdef\P + 0: abcdef + *** Failers +No match + abx\P +No match + +/^a{2,4}\d+z/ + a\P +Partial match: a + aa\P +Partial match: aa + aa2\P +Partial match: aa2 + aaa\P +Partial match: aaa + aaa23\P +Partial match: aaa23 + aaaa12345\P +Partial match: aaaa12345 + aa0z\P + 0: aa0z + aaaa4444444444444z\P + 0: aaaa4444444444444z + *** Failers +No match + az\P +No match + aaaaa\P +No match + a56\P +No match + +/^abcdef/ + abc\P +Partial match: abc + def\R + 0: def + +/(?<=foo)bar/ + xyzfo\P +No match + foob\R\P\>2 +Partial match: b + foobar...\R\P\>4 + 0: ar + xyzfo\P +No match + foobar\R\>2 + 0: bar + *** Failers +No match + xyzfo\P +No match + obar\R +No match + +/(ab*(cd|ef))+X/ + adfadadaklhlkalkajhlkjahdfasdfasdfladsfjkj\P\Z +No match + lkjhlkjhlkjhlkjhabbbbbbcdaefabbbbbbbefa\P\B\Z +Partial match: abbbbbbcdaefabbbbbbbefa + cdabbbbbbbb\P\R\B\Z +Partial match: cdabbbbbbbb + efabbbbbbbbbbbbbbbb\P\R\B\Z +Partial match: efabbbbbbbbbbbbbbbb + bbbbbbbbbbbbcdXyasdfadf\P\R\B\Z + 0: bbbbbbbbbbbbcdX + +/(a|b)/SF>testsavedregex +Compiled regex written to testsavedregex +Study data written to testsavedregex +>>aaabxyzpqrrrabbxyyyypqAzz + 0: aaabxyzpqrrrabbxyyyypqAzz + >aaaabxyzpqrrrabbxyyyypqAzz + 0: aaaabxyzpqrrrabbxyyyypqAzz + >>>>abcxyzpqrrrabbxyyyypqAzz + 0: abcxyzpqrrrabbxyyyypqAzz + *** Failers +No match + abxyzpqrrabbxyyyypqAzz +No match + abxyzpqrrrrabbxyyyypqAzz +No match + abxyzpqrrrabxyyyypqAzz +No match + aaaabcxyzzzzpqrrrabbbxyyyyyypqAzz +No match + aaaabcxyzzzzpqrrrabbbxyyypqAzz +No match + aaabcxyzpqrrrabbxyyyypqqqqqqqAzz +No match + +/^(abc){1,2}zz/ + abczz + 0: abczz + abcabczz + 0: abcabczz + *** Failers +No match + zz +No match + abcabcabczz +No match + >>abczz +No match + +/^(b+?|a){1,2}?c/ + bc + 0: bc + bbc + 0: bbc + bbbc + 0: bbbc + bac + 0: bac + bbac + 0: bbac + aac + 0: aac + abbbbbbbbbbbc + 0: abbbbbbbbbbbc + bbbbbbbbbbbac + 0: bbbbbbbbbbbac + *** Failers +No match + aaac +No match + abbbbbbbbbbbac +No match + +/^(b+|a){1,2}c/ + bc + 0: bc + bbc + 0: bbc + bbbc + 0: bbbc + bac + 0: bac + bbac + 0: bbac + aac + 0: aac + abbbbbbbbbbbc + 0: abbbbbbbbbbbc + bbbbbbbbbbbac + 0: bbbbbbbbbbbac + *** Failers +No match + aaac +No match + abbbbbbbbbbbac +No match + +/^(b+|a){1,2}?bc/ + bbc + 0: bbc + +/^(b*|ba){1,2}?bc/ + babc + 0: babc + bbabc + 0: bbabc + bababc + 0: bababc + *** Failers +No match + bababbc +No match + babababc +No match + +/^(ba|b*){1,2}?bc/ + babc + 0: babc + bbabc + 0: bbabc + bababc + 0: bababc + *** Failers +No match + bababbc +No match + babababc +No match + +/^\ca\cA\c[\c{\c:/ + \x01\x01\e;z + 0: \x01\x01\x1b;z + +/^[ab\]cde]/ + athing + 0: a + bthing + 0: b + ]thing + 0: ] + cthing + 0: c + dthing + 0: d + ething + 0: e + *** Failers +No match + fthing +No match + [thing +No match + \\thing +No match + +/^[]cde]/ + ]thing + 0: ] + cthing + 0: c + dthing + 0: d + ething + 0: e + *** Failers +No match + athing +No match + fthing +No match + +/^[^ab\]cde]/ + fthing + 0: f + [thing + 0: [ + \\thing + 0: \ + *** Failers + 0: * + athing +No match + bthing +No match + ]thing +No match + cthing +No match + dthing +No match + ething +No match + +/^[^]cde]/ + athing + 0: a + fthing + 0: f + *** Failers + 0: * + ]thing +No match + cthing +No match + dthing +No match + ething +No match + +/^\/ + + 0: \x81 + +/^ÿ/ + ÿ + 0: \xff + +/^[0-9]+$/ + 0 + 0: 0 + 1 + 0: 1 + 2 + 0: 2 + 3 + 0: 3 + 4 + 0: 4 + 5 + 0: 5 + 6 + 0: 6 + 7 + 0: 7 + 8 + 0: 8 + 9 + 0: 9 + 10 + 0: 10 + 100 + 0: 100 + *** Failers +No match + abc +No match + +/^.*nter/ + enter + 0: enter + inter + 0: inter + uponter + 0: uponter + +/^xxx[0-9]+$/ + xxx0 + 0: xxx0 + xxx1234 + 0: xxx1234 + *** Failers +No match + xxx +No match + +/^.+[0-9][0-9][0-9]$/ + x123 + 0: x123 + xx123 + 0: xx123 + 123456 + 0: 123456 + *** Failers +No match + 123 +No match + x1234 + 0: x1234 + +/^.+?[0-9][0-9][0-9]$/ + x123 + 0: x123 + xx123 + 0: xx123 + 123456 + 0: 123456 + *** Failers +No match + 123 +No match + x1234 + 0: x1234 + +/^([^!]+)!(.+)=apquxz\.ixr\.zzz\.ac\.uk$/ + abc!pqr=apquxz.ixr.zzz.ac.uk + 0: abc!pqr=apquxz.ixr.zzz.ac.uk + *** Failers +No match + !pqr=apquxz.ixr.zzz.ac.uk +No match + abc!=apquxz.ixr.zzz.ac.uk +No match + abc!pqr=apquxz:ixr.zzz.ac.uk +No match + abc!pqr=apquxz.ixr.zzz.ac.ukk +No match + +/:/ + Well, we need a colon: somewhere + 0: : + *** Fail if we don't +No match + +/([\da-f:]+)$/i + 0abc + 0: 0abc + abc + 0: abc + fed + 0: fed + E + 0: E + :: + 0: :: + 5f03:12C0::932e + 0: 5f03:12C0::932e + fed def + 0: def + Any old stuff + 0: ff + *** Failers +No match + 0zzz +No match + gzzz +No match + fed\x20 +No match + Any old rubbish +No match + +/^.*\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/ + .1.2.3 + 0: .1.2.3 + A.12.123.0 + 0: A.12.123.0 + *** Failers +No match + .1.2.3333 +No match + 1.2.3 +No match + 1234.2.3 +No match + +/^(\d+)\s+IN\s+SOA\s+(\S+)\s+(\S+)\s*\(\s*$/ + 1 IN SOA non-sp1 non-sp2( + 0: 1 IN SOA non-sp1 non-sp2( + 1 IN SOA non-sp1 non-sp2 ( + 0: 1 IN SOA non-sp1 non-sp2 ( + *** Failers +No match + 1IN SOA non-sp1 non-sp2( +No match + +/^[a-zA-Z\d][a-zA-Z\d\-]*(\.[a-zA-Z\d][a-zA-z\d\-]*)*\.$/ + a. + 0: a. + Z. + 0: Z. + 2. + 0: 2. + ab-c.pq-r. + 0: ab-c.pq-r. + sxk.zzz.ac.uk. + 0: sxk.zzz.ac.uk. + x-.y-. + 0: x-.y-. + *** Failers +No match + -abc.peq. +No match + +/^\*\.[a-z]([a-z\-\d]*[a-z\d]+)?(\.[a-z]([a-z\-\d]*[a-z\d]+)?)*$/ + *.a + 0: *.a + *.b0-a + 0: *.b0-a + *.c3-b.c + 0: *.c3-b.c + *.c-a.b-c + 0: *.c-a.b-c + *** Failers +No match + *.0 +No match + *.a- +No match + *.a-b.c- +No match + *.c-a.0-c +No match + +/^(?=ab(de))(abd)(e)/ + abde + 0: abde + +/^(?!(ab)de|x)(abd)(f)/ + abdf + 0: abdf + +/^(?=(ab(cd)))(ab)/ + abcd + 0: ab + +/^[\da-f](\.[\da-f])*$/i + a.b.c.d + 0: a.b.c.d + A.B.C.D + 0: A.B.C.D + a.b.c.1.2.3.C + 0: a.b.c.1.2.3.C + +/^\".*\"\s*(;.*)?$/ + \"1234\" + 0: "1234" + \"abcd\" ; + 0: "abcd" ; + \"\" ; rhubarb + 0: "" ; rhubarb + *** Failers +No match + \"1234\" : things +No match + +/^$/ + \ + 0: + *** Failers +No match + +/ ^ a (?# begins with a) b\sc (?# then b c) $ (?# then end)/x + ab c + 0: ab c + *** Failers +No match + abc +No match + ab cde +No match + +/(?x) ^ a (?# begins with a) b\sc (?# then b c) $ (?# then end)/ + ab c + 0: ab c + *** Failers +No match + abc +No match + ab cde +No match + +/^ a\ b[c ]d $/x + a bcd + 0: a bcd + a b d + 0: a b d + *** Failers +No match + abcd +No match + ab d +No match + +/^(a(b(c)))(d(e(f)))(h(i(j)))(k(l(m)))$/ + abcdefhijklm + 0: abcdefhijklm + +/^(?:a(b(c)))(?:d(e(f)))(?:h(i(j)))(?:k(l(m)))$/ + abcdefhijklm + 0: abcdefhijklm + +/^[\w][\W][\s][\S][\d][\D][\b][\n][\c]][\022]/ + a+ Z0+\x08\n\x1d\x12 + 0: a+ Z0+\x08\x0a\x1d\x12 + +/^[.^$|()*+?{,}]+/ + .^\$(*+)|{?,?} + 0: .^$(*+)|{?,?} + 1: .^$(*+)|{?,? + 2: .^$(*+)|{?, + 3: .^$(*+)|{? + 4: .^$(*+)|{ + 5: .^$(*+)| + 6: .^$(*+) + 7: .^$(*+ + 8: .^$(* + 9: .^$( +10: .^$ +11: .^ +12: . + +/^a*\w/ + z + 0: z + az + 0: az + 1: a + aaaz + 0: aaaz + 1: aaa + 2: aa + 3: a + a + 0: a + aa + 0: aa + 1: a + aaaa + 0: aaaa + 1: aaa + 2: aa + 3: a + a+ + 0: a + aa+ + 0: aa + 1: a + +/^a*?\w/ + z + 0: z + az + 0: az + 1: a + aaaz + 0: aaaz + 1: aaa + 2: aa + 3: a + a + 0: a + aa + 0: aa + 1: a + aaaa + 0: aaaa + 1: aaa + 2: aa + 3: a + a+ + 0: a + aa+ + 0: aa + 1: a + +/^a+\w/ + az + 0: az + aaaz + 0: aaaz + 1: aaa + 2: aa + aa + 0: aa + aaaa + 0: aaaa + 1: aaa + 2: aa + aa+ + 0: aa + +/^a+?\w/ + az + 0: az + aaaz + 0: aaaz + 1: aaa + 2: aa + aa + 0: aa + aaaa + 0: aaaa + 1: aaa + 2: aa + aa+ + 0: aa + +/^\d{8}\w{2,}/ + 1234567890 + 0: 1234567890 + 12345678ab + 0: 12345678ab + 12345678__ + 0: 12345678__ + *** Failers +No match + 1234567 +No match + +/^[aeiou\d]{4,5}$/ + uoie + 0: uoie + 1234 + 0: 1234 + 12345 + 0: 12345 + aaaaa + 0: aaaaa + *** Failers +No match + 123456 +No match + +/^[aeiou\d]{4,5}?/ + uoie + 0: uoie + 1234 + 0: 1234 + 12345 + 0: 12345 + 1: 1234 + aaaaa + 0: aaaaa + 1: aaaa + 123456 + 0: 12345 + 1: 1234 + +/^From +([^ ]+) +[a-zA-Z][a-zA-Z][a-zA-Z] +[a-zA-Z][a-zA-Z][a-zA-Z] +[0-9]?[0-9] +[0-9][0-9]:[0-9][0-9]/ + From abcd Mon Sep 01 12:33:02 1997 + 0: From abcd Mon Sep 01 12:33 + +/^From\s+\S+\s+([a-zA-Z]{3}\s+){2}\d{1,2}\s+\d\d:\d\d/ + From abcd Mon Sep 01 12:33:02 1997 + 0: From abcd Mon Sep 01 12:33 + From abcd Mon Sep 1 12:33:02 1997 + 0: From abcd Mon Sep 1 12:33 + *** Failers +No match + From abcd Sep 01 12:33:02 1997 +No match + +/^12.34/s + 12\n34 + 0: 12\x0a34 + 12\r34 + 0: 12\x0d34 + +/\w+(?=\t)/ + the quick brown\t fox + 0: brown + +/foo(?!bar)(.*)/ + foobar is foolish see? + 0: foolish see? + 1: foolish see + 2: foolish se + 3: foolish s + 4: foolish + 5: foolish + 6: foolis + 7: fooli + 8: fool + 9: foo + +/(?:(?!foo)...|^.{0,2})bar(.*)/ + foobar crowbar etc + 0: rowbar etc + 1: rowbar et + 2: rowbar e + 3: rowbar + 4: rowbar + barrel + 0: barrel + 1: barre + 2: barr + 3: bar + 2barrel + 0: 2barrel + 1: 2barre + 2: 2barr + 3: 2bar + A barrel + 0: A barrel + 1: A barre + 2: A barr + 3: A bar + +/^(\D*)(?=\d)(?!123)/ + abc456 + 0: abc + *** Failers +No match + abc123 +No match + +/^1234(?# test newlines + inside)/ + 1234 + 0: 1234 + +/^1234 #comment in extended re + /x + 1234 + 0: 1234 + +/#rhubarb + abcd/x + abcd + 0: abcd + +/^abcd#rhubarb/x + abcd + 0: abcd + +/(?!^)abc/ + the abc + 0: abc + *** Failers +No match + abc +No match + +/(?=^)abc/ + abc + 0: abc + *** Failers +No match + the abc +No match + +/^[ab]{1,3}(ab*|b)/ + aabbbbb + 0: aabbbbb + 1: aabbbb + 2: aabbb + 3: aabb + 4: aab + 5: aa + +/^[ab]{1,3}?(ab*|b)/ + aabbbbb + 0: aabbbbb + 1: aabbbb + 2: aabbb + 3: aabb + 4: aab + 5: aa + +/^[ab]{1,3}?(ab*?|b)/ + aabbbbb + 0: aabbbbb + 1: aabbbb + 2: aabbb + 3: aabb + 4: aab + 5: aa + +/^[ab]{1,3}(ab*?|b)/ + aabbbbb + 0: aabbbbb + 1: aabbbb + 2: aabbb + 3: aabb + 4: aab + 5: aa + +/ (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* # optional leading comment +(?: (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +" (?: # opening quote... +[^\\\x80-\xff\n\015"] # Anything except backslash and quote +| # or +\\ [^\x80-\xff] # Escaped something (something != CR) +)* " # closing quote +) # initial word +(?: (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* \. (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +" (?: # opening quote... +[^\\\x80-\xff\n\015"] # Anything except backslash and quote +| # or +\\ [^\x80-\xff] # Escaped something (something != CR) +)* " # closing quote +) )* # further okay, if led by a period +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* @ (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| \[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) # initial subdomain +(?: # +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* \. # if led by a period... +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| \[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) # ...further okay +)* +# address +| # or +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +" (?: # opening quote... +[^\\\x80-\xff\n\015"] # Anything except backslash and quote +| # or +\\ [^\x80-\xff] # Escaped something (something != CR) +)* " # closing quote +) # one word, optionally followed by.... +(?: +[^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] | # atom and space parts, or... +\( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) | # comments, or... + +" (?: # opening quote... +[^\\\x80-\xff\n\015"] # Anything except backslash and quote +| # or +\\ [^\x80-\xff] # Escaped something (something != CR) +)* " # closing quote +# quoted strings +)* +< (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* # leading < +(?: @ (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| \[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) # initial subdomain +(?: # +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* \. # if led by a period... +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| \[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) # ...further okay +)* + +(?: (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* , (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* @ (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| \[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) # initial subdomain +(?: # +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* \. # if led by a period... +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| \[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) # ...further okay +)* +)* # further okay, if led by comma +: # closing colon +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* )? # optional route +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +" (?: # opening quote... +[^\\\x80-\xff\n\015"] # Anything except backslash and quote +| # or +\\ [^\x80-\xff] # Escaped something (something != CR) +)* " # closing quote +) # initial word +(?: (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* \. (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +" (?: # opening quote... +[^\\\x80-\xff\n\015"] # Anything except backslash and quote +| # or +\\ [^\x80-\xff] # Escaped something (something != CR) +)* " # closing quote +) )* # further okay, if led by a period +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* @ (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| \[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) # initial subdomain +(?: # +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* \. # if led by a period... +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| \[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) # ...further okay +)* +# address spec +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* > # trailing > +# name and address +) (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* # optional trailing comment +/x + Alan Other + 0: Alan Other + + 0: user@dom.ain + 1: user@dom + user\@dom.ain + 0: user@dom.ain + 1: user@dom + \"A. Other\" (a comment) + 0: "A. Other" (a comment) + 1: "A. Other" + 2: "A. Other" + A. Other (a comment) + 0: Other (a comment) + 1: Other + 2: Other + \"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"\@x400-re.lay + 0: "/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/"@x400-re.lay + 1: "/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/"@x400-re + A missing angle @,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +# Atom +| # or +" # " +[^\\\x80-\xff\n\015"] * # normal +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* +" # " +# Quoted string +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +\. +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +# Atom +| # or +" # " +[^\\\x80-\xff\n\015"] * # normal +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* +" # " +# Quoted string +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# additional words +)* +@ +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +\[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# optional trailing comments +(?: +\. +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +\[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# optional trailing comments +)* +# address +| # or +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +# Atom +| # or +" # " +[^\\\x80-\xff\n\015"] * # normal +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* +" # " +# Quoted string +) +# leading word +[^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] * # "normal" atoms and or spaces +(?: +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +| +" # " +[^\\\x80-\xff\n\015"] * # normal +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* +" # " +) # "special" comment or quoted string +[^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] * # more "normal" +)* +< +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# < +(?: +@ +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +\[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# optional trailing comments +(?: +\. +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +\[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# optional trailing comments +)* +(?: , +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +@ +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +\[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# optional trailing comments +(?: +\. +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +\[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# optional trailing comments +)* +)* # additional domains +: +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# optional trailing comments +)? # optional route +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +# Atom +| # or +" # " +[^\\\x80-\xff\n\015"] * # normal +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* +" # " +# Quoted string +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +\. +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +# Atom +| # or +" # " +[^\\\x80-\xff\n\015"] * # normal +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* +" # " +# Quoted string +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# additional words +)* +@ +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +\[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# optional trailing comments +(?: +\. +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +\[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# optional trailing comments +)* +# address spec +> # > +# name and address +) +/x + Alan Other + 0: Alan Other + + 0: user@dom.ain + 1: user@dom + user\@dom.ain + 0: user@dom.ain + 1: user@dom + \"A. Other\" (a comment) + 0: "A. Other" + A. Other (a comment) + 0: Other + \"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"\@x400-re.lay + 0: "/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/"@x400-re.lay + 1: "/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/"@x400-re + A missing angle ?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff + +/P[^*]TAIRE[^*]{1,6}?LL/ + xxxxxxxxxxxPSTAIREISLLxxxxxxxxx + 0: PSTAIREISLL + +/P[^*]TAIRE[^*]{1,}?LL/ + xxxxxxxxxxxPSTAIREISLLxxxxxxxxx + 0: PSTAIREISLL + +/(\.\d\d[1-9]?)\d+/ + 1.230003938 + 0: .230003938 + 1: .23000393 + 2: .2300039 + 3: .230003 + 4: .23000 + 5: .2300 + 6: .230 + 1.875000282 + 0: .875000282 + 1: .87500028 + 2: .8750002 + 3: .875000 + 4: .87500 + 5: .8750 + 6: .875 + 1.235 + 0: .235 + +/(\.\d\d((?=0)|\d(?=\d)))/ + 1.230003938 + 0: .230 + 1: .23 + 1.875000282 + 0: .875 + *** Failers +No match + 1.235 +No match + +/a(?)b/ + ab + 0: ab + +/\b(foo)\s+(\w+)/i + Food is on the foo table + 0: foo table + 1: foo tabl + 2: foo tab + 3: foo ta + 4: foo t + +/foo(.*)bar/ + The food is under the bar in the barn. + 0: food is under the bar in the bar + 1: food is under the bar + +/foo(.*?)bar/ + The food is under the bar in the barn. + 0: food is under the bar in the bar + 1: food is under the bar + +/(.*)(\d*)/ + I have 2 numbers: 53147 +Matched, but too many subsidiary matches + 0: I have 2 numbers: 53147 + 1: I have 2 numbers: 5314 + 2: I have 2 numbers: 531 + 3: I have 2 numbers: 53 + 4: I have 2 numbers: 5 + 5: I have 2 numbers: + 6: I have 2 numbers: + 7: I have 2 numbers + 8: I have 2 number + 9: I have 2 numbe +10: I have 2 numb +11: I have 2 num +12: I have 2 nu +13: I have 2 n +14: I have 2 +15: I have 2 +16: I have +17: I have +18: I hav +19: I ha +20: I h +21: I + +/(.*)(\d+)/ + I have 2 numbers: 53147 + 0: I have 2 numbers: 53147 + 1: I have 2 numbers: 5314 + 2: I have 2 numbers: 531 + 3: I have 2 numbers: 53 + 4: I have 2 numbers: 5 + 5: I have 2 + +/(.*?)(\d*)/ + I have 2 numbers: 53147 +Matched, but too many subsidiary matches + 0: I have 2 numbers: 53147 + 1: I have 2 numbers: 5314 + 2: I have 2 numbers: 531 + 3: I have 2 numbers: 53 + 4: I have 2 numbers: 5 + 5: I have 2 numbers: + 6: I have 2 numbers: + 7: I have 2 numbers + 8: I have 2 number + 9: I have 2 numbe +10: I have 2 numb +11: I have 2 num +12: I have 2 nu +13: I have 2 n +14: I have 2 +15: I have 2 +16: I have +17: I have +18: I hav +19: I ha +20: I h +21: I + +/(.*?)(\d+)/ + I have 2 numbers: 53147 + 0: I have 2 numbers: 53147 + 1: I have 2 numbers: 5314 + 2: I have 2 numbers: 531 + 3: I have 2 numbers: 53 + 4: I have 2 numbers: 5 + 5: I have 2 + +/(.*)(\d+)$/ + I have 2 numbers: 53147 + 0: I have 2 numbers: 53147 + +/(.*?)(\d+)$/ + I have 2 numbers: 53147 + 0: I have 2 numbers: 53147 + +/(.*)\b(\d+)$/ + I have 2 numbers: 53147 + 0: I have 2 numbers: 53147 + +/(.*\D)(\d+)$/ + I have 2 numbers: 53147 + 0: I have 2 numbers: 53147 + +/^\D*(?!123)/ + ABC123 + 0: AB + 1: A + 2: + +/^(\D*)(?=\d)(?!123)/ + ABC445 + 0: ABC + *** Failers +No match + ABC123 +No match + +/^[W-]46]/ + W46]789 + 0: W46] + -46]789 + 0: -46] + *** Failers +No match + Wall +No match + Zebra +No match + 42 +No match + [abcd] +No match + ]abcd[ +No match + +/^[W-\]46]/ + W46]789 + 0: W + Wall + 0: W + Zebra + 0: Z + Xylophone + 0: X + 42 + 0: 4 + [abcd] + 0: [ + ]abcd[ + 0: ] + \\backslash + 0: \ + *** Failers +No match + -46]789 +No match + well +No match + +/\d\d\/\d\d\/\d\d\d\d/ + 01/01/2000 + 0: 01/01/2000 + +/word (?:[a-zA-Z0-9]+ ){0,10}otherword/ + word cat dog elephant mussel cow horse canary baboon snake shark otherword + 0: word cat dog elephant mussel cow horse canary baboon snake shark otherword + word cat dog elephant mussel cow horse canary baboon snake shark +No match + +/word (?:[a-zA-Z0-9]+ ){0,300}otherword/ + word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope +No match + +/^(a){0,0}/ + bcd + 0: + abc + 0: + aab + 0: + +/^(a){0,1}/ + bcd + 0: + abc + 0: a + 1: + aab + 0: a + 1: + +/^(a){0,2}/ + bcd + 0: + abc + 0: a + 1: + aab + 0: aa + 1: a + 2: + +/^(a){0,3}/ + bcd + 0: + abc + 0: a + 1: + aab + 0: aa + 1: a + 2: + aaa + 0: aaa + 1: aa + 2: a + 3: + +/^(a){0,}/ + bcd + 0: + abc + 0: a + 1: + aab + 0: aa + 1: a + 2: + aaa + 0: aaa + 1: aa + 2: a + 3: + aaaaaaaa + 0: aaaaaaaa + 1: aaaaaaa + 2: aaaaaa + 3: aaaaa + 4: aaaa + 5: aaa + 6: aa + 7: a + 8: + +/^(a){1,1}/ + bcd +No match + abc + 0: a + aab + 0: a + +/^(a){1,2}/ + bcd +No match + abc + 0: a + aab + 0: aa + 1: a + +/^(a){1,3}/ + bcd +No match + abc + 0: a + aab + 0: aa + 1: a + aaa + 0: aaa + 1: aa + 2: a + +/^(a){1,}/ + bcd +No match + abc + 0: a + aab + 0: aa + 1: a + aaa + 0: aaa + 1: aa + 2: a + aaaaaaaa + 0: aaaaaaaa + 1: aaaaaaa + 2: aaaaaa + 3: aaaaa + 4: aaaa + 5: aaa + 6: aa + 7: a + +/.*\.gif/ + borfle\nbib.gif\nno + 0: bib.gif + +/.{0,}\.gif/ + borfle\nbib.gif\nno + 0: bib.gif + +/.*\.gif/m + borfle\nbib.gif\nno + 0: bib.gif + +/.*\.gif/s + borfle\nbib.gif\nno + 0: borfle\x0abib.gif + +/.*\.gif/ms + borfle\nbib.gif\nno + 0: borfle\x0abib.gif + +/.*$/ + borfle\nbib.gif\nno + 0: no + +/.*$/m + borfle\nbib.gif\nno + 0: borfle + +/.*$/s + borfle\nbib.gif\nno + 0: borfle\x0abib.gif\x0ano + +/.*$/ms + borfle\nbib.gif\nno + 0: borfle\x0abib.gif\x0ano + 1: borfle\x0abib.gif + 2: borfle + +/.*$/ + borfle\nbib.gif\nno\n + 0: no + +/.*$/m + borfle\nbib.gif\nno\n + 0: borfle + +/.*$/s + borfle\nbib.gif\nno\n + 0: borfle\x0abib.gif\x0ano\x0a + 1: borfle\x0abib.gif\x0ano + +/.*$/ms + borfle\nbib.gif\nno\n + 0: borfle\x0abib.gif\x0ano\x0a + 1: borfle\x0abib.gif\x0ano + 2: borfle\x0abib.gif + 3: borfle + +/(.*X|^B)/ + abcde\n1234Xyz + 0: 1234X + BarFoo + 0: B + *** Failers +No match + abcde\nBar +No match + +/(.*X|^B)/m + abcde\n1234Xyz + 0: 1234X + BarFoo + 0: B + abcde\nBar + 0: B + +/(.*X|^B)/s + abcde\n1234Xyz + 0: abcde\x0a1234X + BarFoo + 0: B + *** Failers +No match + abcde\nBar +No match + +/(.*X|^B)/ms + abcde\n1234Xyz + 0: abcde\x0a1234X + BarFoo + 0: B + abcde\nBar + 0: B + +/(?s)(.*X|^B)/ + abcde\n1234Xyz + 0: abcde\x0a1234X + BarFoo + 0: B + *** Failers +No match + abcde\nBar +No match + +/(?s:.*X|^B)/ + abcde\n1234Xyz + 0: abcde\x0a1234X + BarFoo + 0: B + *** Failers +No match + abcde\nBar +No match + +/^.*B/ + **** Failers +No match + abc\nB +No match + +/(?s)^.*B/ + abc\nB + 0: abc\x0aB + +/(?m)^.*B/ + abc\nB + 0: B + +/(?ms)^.*B/ + abc\nB + 0: abc\x0aB + +/(?ms)^B/ + abc\nB + 0: B + +/(?s)B$/ + B\n + 0: B + +/^[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]/ + 123456654321 + 0: 123456654321 + +/^\d\d\d\d\d\d\d\d\d\d\d\d/ + 123456654321 + 0: 123456654321 + +/^[\d][\d][\d][\d][\d][\d][\d][\d][\d][\d][\d][\d]/ + 123456654321 + 0: 123456654321 + +/^[abc]{12}/ + abcabcabcabc + 0: abcabcabcabc + +/^[a-c]{12}/ + abcabcabcabc + 0: abcabcabcabc + +/^(a|b|c){12}/ + abcabcabcabc + 0: abcabcabcabc + +/^[abcdefghijklmnopqrstuvwxy0123456789]/ + n + 0: n + *** Failers +No match + z +No match + +/abcde{0,0}/ + abcd + 0: abcd + *** Failers +No match + abce +No match + +/ab[cd]{0,0}e/ + abe + 0: abe + *** Failers +No match + abcde +No match + +/ab(c){0,0}d/ + abd + 0: abd + *** Failers +No match + abcd +No match + +/a(b*)/ + a + 0: a + ab + 0: ab + 1: a + abbbb + 0: abbbb + 1: abbb + 2: abb + 3: ab + 4: a + *** Failers + 0: a + bbbbb +No match + +/ab\d{0}e/ + abe + 0: abe + *** Failers +No match + ab1e +No match + +/"([^\\"]+|\\.)*"/ + the \"quick\" brown fox + 0: "quick" + \"the \\\"quick\\\" brown fox\" + 0: "the \"quick\" brown fox" + +/.*?/g+ + abc + 0: abc + 0+ + 1: ab + 2: a + 3: + 0: + 0+ + +/\b/g+ + abc + 0: + 0+ abc + 0: + 0+ + +/\b/+g + abc + 0: + 0+ abc + 0: + 0+ + +//g + abc + 0: + 0: + 0: + 0: + +/]{0,})>]{0,})>([\d]{0,}\.)(.*)((
    ([\w\W\s\d][^<>]{0,})|[\s]{0,}))<\/a><\/TD>]{0,})>([\w\W\s\d][^<>]{0,})<\/TD>]{0,})>([\w\W\s\d][^<>]{0,})<\/TD><\/TR>/is + 43.
    Word Processor
    (N-1286)
    Lega lstaff.comCA - Statewide + 0: 43.Word Processor
    (N-1286)
    Lega lstaff.comCA - Statewide + +/a[^a]b/ + acb + 0: acb + a\nb + 0: a\x0ab + +/a.b/ + acb + 0: acb + *** Failers +No match + a\nb +No match + +/a[^a]b/s + acb + 0: acb + a\nb + 0: a\x0ab + +/a.b/s + acb + 0: acb + a\nb + 0: a\x0ab + +/^(b+?|a){1,2}?c/ + bac + 0: bac + bbac + 0: bbac + bbbac + 0: bbbac + bbbbac + 0: bbbbac + bbbbbac + 0: bbbbbac + +/^(b+|a){1,2}?c/ + bac + 0: bac + bbac + 0: bbac + bbbac + 0: bbbac + bbbbac + 0: bbbbac + bbbbbac + 0: bbbbbac + +/(?!\A)x/m + x\nb\n +No match + a\bx\n + 0: x + +/\x0{ab}/ + \0{ab} + 0: \x00{ab} + +/(A|B)*?CD/ + CD + 0: CD + +/(A|B)*CD/ + CD + 0: CD + +/(?.*/)foo" + /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/it/you/see/ +No match + +"(?>.*/)foo" + /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/and/foo + 0: /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/and/foo + +/(?>(\.\d\d[1-9]?))\d+/ + 1.230003938 + 0: .230003938 + 1: .23000393 + 2: .2300039 + 3: .230003 + 4: .23000 + 5: .2300 + 6: .230 + 1.875000282 + 0: .875000282 + 1: .87500028 + 2: .8750002 + 3: .875000 + 4: .87500 + 5: .8750 + *** Failers +No match + 1.235 +No match + +/^((?>\w+)|(?>\s+))*$/ + now is the time for all good men to come to the aid of the party + 0: now is the time for all good men to come to the aid of the party + *** Failers +No match + this is not a line with only words and spaces! +No match + +/(\d+)(\w)/ + 12345a + 0: 12345a + 1: 12345 + 2: 1234 + 3: 123 + 4: 12 + 12345+ + 0: 12345 + 1: 1234 + 2: 123 + 3: 12 + +/((?>\d+))(\w)/ + 12345a + 0: 12345a + *** Failers +No match + 12345+ +No match + +/(?>a+)b/ + aaab + 0: aaab + +/((?>a+)b)/ + aaab + 0: aaab + +/(?>(a+))b/ + aaab + 0: aaab + +/(?>b)+/ + aaabbbccc + 0: bbb + 1: bb + 2: b + +/(?>a+|b+|c+)*c/ + aaabbbbccccd + 0: aaabbbbcccc + 1: aaabbbbc + +/(a+|b+|c+)*c/ + aaabbbbccccd + 0: aaabbbbcccc + 1: aaabbbbccc + 2: aaabbbbcc + 3: aaabbbbc + +/((?>[^()]+)|\([^()]*\))+/ + ((abc(ade)ufh()()x + 0: abc(ade)ufh()()x + 1: abc(ade)ufh()() + 2: abc(ade)ufh() + 3: abc(ade)ufh + 4: abc(ade) + 5: abc + +/\(((?>[^()]+)|\([^()]+\))+\)/ + (abc) + 0: (abc) + (abc(def)xyz) + 0: (abc(def)xyz) + *** Failers +No match + ((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +No match + +/a(?-i)b/i + ab + 0: ab + Ab + 0: Ab + *** Failers +No match + aB +No match + AB +No match + +/(a (?x)b c)d e/ + a bcd e + 0: a bcd e + *** Failers +No match + a b cd e +No match + abcd e +No match + a bcde +No match + +/(a b(?x)c d (?-x)e f)/ + a bcde f + 0: a bcde f + *** Failers +No match + abcdef +No match + +/(a(?i)b)c/ + abc + 0: abc + aBc + 0: aBc + *** Failers +No match + abC +No match + aBC +No match + Abc +No match + ABc +No match + ABC +No match + AbC +No match + +/a(?i:b)c/ + abc + 0: abc + aBc + 0: aBc + *** Failers +No match + ABC +No match + abC +No match + aBC +No match + +/a(?i:b)*c/ + aBc + 0: aBc + aBBc + 0: aBBc + *** Failers +No match + aBC +No match + aBBC +No match + +/a(?=b(?i)c)\w\wd/ + abcd + 0: abcd + abCd + 0: abCd + *** Failers +No match + aBCd +No match + abcD +No match + +/(?s-i:more.*than).*million/i + more than million + 0: more than million + more than MILLION + 0: more than MILLION + more \n than Million + 0: more \x0a than Million + *** Failers +No match + MORE THAN MILLION +No match + more \n than \n million +No match + +/(?:(?s-i)more.*than).*million/i + more than million + 0: more than million + more than MILLION + 0: more than MILLION + more \n than Million + 0: more \x0a than Million + *** Failers +No match + MORE THAN MILLION +No match + more \n than \n million +No match + +/(?>a(?i)b+)+c/ + abc + 0: abc + aBbc + 0: aBbc + aBBc + 0: aBBc + *** Failers +No match + Abc +No match + abAb +No match + abbC +No match + +/(?=a(?i)b)\w\wc/ + abc + 0: abc + aBc + 0: aBc + *** Failers +No match + Ab +No match + abC +No match + aBC +No match + +/(?<=a(?i)b)(\w\w)c/ + abxxc + 0: xxc + aBxxc + 0: xxc + *** Failers +No match + Abxxc +No match + ABxxc +No match + abxxC +No match + +/^(?(?=abc)\w{3}:|\d\d)$/ + abc: + 0: abc: + 12 + 0: 12 + *** Failers +No match + 123 +No match + xyz +No match + +/^(?(?!abc)\d\d|\w{3}:)$/ + abc: + 0: abc: + 12 + 0: 12 + *** Failers +No match + 123 +No match + xyz +No match + +/(?(?<=foo)bar|cat)/ + foobar + 0: bar + cat + 0: cat + fcat + 0: cat + focat + 0: cat + *** Failers +No match + foocat +No match + +/(?(?a*)*/ + a + 0: a + 1: + aa + 0: aa + 1: + aaaa + 0: aaaa + 1: + +/(abc|)+/ + abc + 0: abc + 1: + abcabc + 0: abcabc + 1: abc + 2: + abcabcabc + 0: abcabcabc + 1: abcabc + 2: abc + 3: + xyz + 0: + +/([a]*)*/ + a + 0: a + 1: + aaaaa + 0: aaaaa + 1: aaaa + 2: aaa + 3: aa + 4: a + 5: + +/([ab]*)*/ + a + 0: a + 1: + b + 0: b + 1: + ababab + 0: ababab + 1: ababa + 2: abab + 3: aba + 4: ab + 5: a + 6: + aaaabcde + 0: aaaab + 1: aaaa + 2: aaa + 3: aa + 4: a + 5: + bbbb + 0: bbbb + 1: bbb + 2: bb + 3: b + 4: + +/([^a]*)*/ + b + 0: b + 1: + bbbb + 0: bbbb + 1: bbb + 2: bb + 3: b + 4: + aaa + 0: + +/([^ab]*)*/ + cccc + 0: cccc + 1: ccc + 2: cc + 3: c + 4: + abab + 0: + +/([a]*?)*/ + a + 0: a + 1: + aaaa + 0: aaaa + 1: aaa + 2: aa + 3: a + 4: + +/([ab]*?)*/ + a + 0: a + 1: + b + 0: b + 1: + abab + 0: abab + 1: aba + 2: ab + 3: a + 4: + baba + 0: baba + 1: bab + 2: ba + 3: b + 4: + +/([^a]*?)*/ + b + 0: b + 1: + bbbb + 0: bbbb + 1: bbb + 2: bb + 3: b + 4: + aaa + 0: + +/([^ab]*?)*/ + c + 0: c + 1: + cccc + 0: cccc + 1: ccc + 2: cc + 3: c + 4: + baba + 0: + +/(?>a*)*/ + a + 0: a + 1: + aaabcde + 0: aaa + 1: + +/((?>a*))*/ + aaaaa + 0: aaaaa + 1: + aabbaa + 0: aa + 1: + +/((?>a*?))*/ + aaaaa + 0: aaaaa + 1: + aabbaa + 0: aa + 1: + +/(?(?=[^a-z]+[a-z]) \d{2}-[a-z]{3}-\d{2} | \d{2}-\d{2}-\d{2} ) /x + 12-sep-98 + 0: 12-sep-98 + 12-09-98 + 0: 12-09-98 + *** Failers +No match + sep-12-98 +No match + +/(?i:saturday|sunday)/ + saturday + 0: saturday + sunday + 0: sunday + Saturday + 0: Saturday + Sunday + 0: Sunday + SATURDAY + 0: SATURDAY + SUNDAY + 0: SUNDAY + SunDay + 0: SunDay + +/(a(?i)bc|BB)x/ + abcx + 0: abcx + aBCx + 0: aBCx + bbx + 0: bbx + BBx + 0: BBx + *** Failers +No match + abcX +No match + aBCX +No match + bbX +No match + BBX +No match + +/^([ab](?i)[cd]|[ef])/ + ac + 0: ac + aC + 0: aC + bD + 0: bD + elephant + 0: e + Europe + 0: E + frog + 0: f + France + 0: F + *** Failers +No match + Africa +No match + +/^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)/ + ab + 0: ab + aBd + 0: aBd + xy + 0: xy + xY + 0: xY + zebra + 0: z + Zambesi + 0: Z + *** Failers +No match + aCD +No match + XY +No match + +/(?<=foo\n)^bar/m + foo\nbar + 0: bar + *** Failers +No match + bar +No match + baz\nbar +No match + +/(?<=(?]&/ + <&OUT + 0: <& + +/(?:(f)(o)(o)|(b)(a)(r))*/ + foobar + 0: foobar + 1: foo + 2: + +/(?<=a)b/ + ab + 0: b + *** Failers +No match + cb +No match + b +No match + +/(?a+)ab/ + +/(?>a+)b/ + aaab + 0: aaab + +/([[:]+)/ + a:[b]: + 0: :[ + 1: : + +/([[=]+)/ + a=[b]= + 0: =[ + 1: = + +/([[.]+)/ + a.[b]. + 0: .[ + 1: . + +/((?>a+)b)/ + aaab + 0: aaab + +/(?>(a+))b/ + aaab + 0: aaab + +/((?>[^()]+)|\([^()]*\))+/ + ((abc(ade)ufh()()x + 0: abc(ade)ufh()()x + 1: abc(ade)ufh()() + 2: abc(ade)ufh() + 3: abc(ade)ufh + 4: abc(ade) + 5: abc + +/a\Z/ + *** Failers +No match + aaab +No match + a\nb\n +No match + +/b\Z/ + a\nb\n + 0: b + +/b\z/ + +/b\Z/ + a\nb + 0: b + +/b\z/ + a\nb + 0: b + *** Failers +No match + +/(?>.*)(?<=(abcd|wxyz))/ + alphabetabcd + 0: alphabetabcd + endingwxyz + 0: endingwxyz + *** Failers +No match + a rather long string that doesn't end with one of them +No match + +/word (?>(?:(?!otherword)[a-zA-Z0-9]+ ){0,30})otherword/ + word cat dog elephant mussel cow horse canary baboon snake shark otherword + 0: word cat dog elephant mussel cow horse canary baboon snake shark otherword + word cat dog elephant mussel cow horse canary baboon snake shark +No match + +/word (?>[a-zA-Z0-9]+ ){0,30}otherword/ + word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope +No match + +/(?<=\d{3}(?!999))foo/ + 999foo + 0: foo + 123999foo + 0: foo + *** Failers +No match + 123abcfoo +No match + +/(?<=(?!...999)\d{3})foo/ + 999foo + 0: foo + 123999foo + 0: foo + *** Failers +No match + 123abcfoo +No match + +/(?<=\d{3}(?!999)...)foo/ + 123abcfoo + 0: foo + 123456foo + 0: foo + *** Failers +No match + 123999foo +No match + +/(?<=\d{3}...)(?Z)+|A)*/ + ZABCDEFG + 0: ZA + 1: Z + 2: + +/((?>)+|A)*/ + ZABCDEFG + 0: + +/a*/g + abbab + 0: a + 1: + 0: + 0: + 0: a + 1: + 0: + 0: + +/^[a-\d]/ + abcde + 0: a + -things + 0: - + 0digit + 0: 0 + *** Failers +No match + bcdef +No match + +/^[\d-a]/ + abcde + 0: a + -things + 0: - + 0digit + 0: 0 + *** Failers +No match + bcdef +No match + +/[[:space:]]+/ + > \x09\x0a\x0c\x0d\x0b< + 0: \x09\x0a\x0c\x0d\x0b + 1: \x09\x0a\x0c\x0d + 2: \x09\x0a\x0c + 3: \x09\x0a + 4: \x09 + 5: + +/[[:blank:]]+/ + > \x09\x0a\x0c\x0d\x0b< + 0: \x09 + 1: + +/[\s]+/ + > \x09\x0a\x0c\x0d\x0b< + 0: \x09\x0a\x0c\x0d + 1: \x09\x0a\x0c + 2: \x09\x0a + 3: \x09 + 4: + +/\s+/ + > \x09\x0a\x0c\x0d\x0b< + 0: \x09\x0a\x0c\x0d + 1: \x09\x0a\x0c + 2: \x09\x0a + 3: \x09 + 4: + +/a b/x + ab +No match + +/(?!\A)x/m + a\nxb\n + 0: x + +/(?!^)x/m + a\nxb\n +No match + +/abc\Qabc\Eabc/ + abcabcabc + 0: abcabcabc + +/abc\Q(*+|\Eabc/ + abc(*+|abc + 0: abc(*+|abc + +/ abc\Q abc\Eabc/x + abc abcabc + 0: abc abcabc + *** Failers +No match + abcabcabc +No match + +/abc#comment + \Q#not comment + literal\E/x + abc#not comment\n literal + 0: abc#not comment\x0a literal + +/abc#comment + \Q#not comment + literal/x + abc#not comment\n literal + 0: abc#not comment\x0a literal + +/abc#comment + \Q#not comment + literal\E #more comment + /x + abc#not comment\n literal + 0: abc#not comment\x0a literal + +/abc#comment + \Q#not comment + literal\E #more comment/x + abc#not comment\n literal + 0: abc#not comment\x0a literal + +/\Qabc\$xyz\E/ + abc\\\$xyz + 0: abc\$xyz + +/\Qabc\E\$\Qxyz\E/ + abc\$xyz + 0: abc$xyz + +/\Gabc/ + abc + 0: abc + *** Failers +No match + xyzabc +No match + +/\Gabc./g + abc1abc2xyzabc3 + 0: abc1 + 0: abc2 + +/abc./g + abc1abc2xyzabc3 + 0: abc1 + 0: abc2 + 0: abc3 + +/a(?x: b c )d/ + XabcdY + 0: abcd + *** Failers +No match + Xa b c d Y +No match + +/((?x)x y z | a b c)/ + XabcY + 0: abc + AxyzB + 0: xyz + +/(?i)AB(?-i)C/ + XabCY + 0: abC + *** Failers +No match + XabcY +No match + +/((?i)AB(?-i)C|D)E/ + abCE + 0: abCE + DE + 0: DE + *** Failers +No match + abcE +No match + abCe +No match + dE +No match + De +No match + +/[z\Qa-d]\E]/ + z + 0: z + a + 0: a + - + 0: - + d + 0: d + ] + 0: ] + *** Failers + 0: a + b +No match + +/[\z\C]/ + z + 0: z + C + 0: C + +/\M/ + M + 0: M + +/(a+)*b/ + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +No match + +/(?i)reg(?:ul(?:[aä]|ae)r|ex)/ + REGular + 0: REGular + regulaer + 0: regulaer + Regex + 0: Regex + regulär + 0: regul\xe4r + +/Åæåä[à-ÿÀ-ß]+/ + Åæåäà + 0: \xc5\xe6\xe5\xe4\xe0 + Åæåäÿ + 0: \xc5\xe6\xe5\xe4\xff + ÅæåäÀ + 0: \xc5\xe6\xe5\xe4\xc0 + Åæåäß + 0: \xc5\xe6\xe5\xe4\xdf + +/(?<=Z)X./ + \x84XAZXB + 0: XB + +/^(?(2)a|(1)(2))+$/ + 123a +Error -17 + +/(?<=a|bbbb)c/ + ac + 0: c + bbbbc + 0: c + +/abc/>testsavedregex +Compiled regex written to testsavedregex +testsavedregex +Compiled regex written to testsavedregex +testsavedregex +Compiled regex written to testsavedregex +Study data written to testsavedregex +testsavedregex +Compiled regex written to testsavedregex +Study data written to testsavedregex +\S/8 + > >X Y + 0: >X + > >\x{100} Y + 0: >\x{100} + +/\d/8 + \x{100}3 + 0: 3 + +/\s/8 + \x{100} X + 0: + +/\D+/8 + 12abcd34 + 0: abcd + 1: abc + 2: ab + 3: a + *** Failers + 0: *** Failers + 1: *** Failer + 2: *** Faile + 3: *** Fail + 4: *** Fai + 5: *** Fa + 6: *** F + 7: *** + 8: *** + 9: ** +10: * + 1234 +No match + +/\D{2,3}/8 + 12abcd34 + 0: abc + 1: ab + 12ab34 + 0: ab + *** Failers + 0: *** + 1: ** + 1234 +No match + 12a34 +No match + +/\D{2,3}?/8 + 12abcd34 + 0: abc + 1: ab + 12ab34 + 0: ab + *** Failers + 0: *** + 1: ** + 1234 +No match + 12a34 +No match + +/\d+/8 + 12abcd34 + 0: 12 + 1: 1 + *** Failers +No match + +/\d{2,3}/8 + 12abcd34 + 0: 12 + 1234abcd + 0: 123 + 1: 12 + *** Failers +No match + 1.4 +No match + +/\d{2,3}?/8 + 12abcd34 + 0: 12 + 1234abcd + 0: 123 + 1: 12 + *** Failers +No match + 1.4 +No match + +/\S+/8 + 12abcd34 + 0: 12abcd34 + 1: 12abcd3 + 2: 12abcd + 3: 12abc + 4: 12ab + 5: 12a + 6: 12 + 7: 1 + *** Failers + 0: *** + 1: ** + 2: * + \ \ +No match + +/\S{2,3}/8 + 12abcd34 + 0: 12a + 1: 12 + 1234abcd + 0: 123 + 1: 12 + *** Failers + 0: *** + 1: ** + \ \ +No match + +/\S{2,3}?/8 + 12abcd34 + 0: 12a + 1: 12 + 1234abcd + 0: 123 + 1: 12 + *** Failers + 0: *** + 1: ** + \ \ +No match + +/>\s+ <34 + 0: > < + *** Failers +No match + +/>\s{2,3} < + ab> < + *** Failers +No match + ab> \s{2,3}? < + ab> < + *** Failers +No match + ab> \xff< + 0: \xff + +/[\xff]/8 + >\x{ff}< + 0: \x{ff} + +/[^\xFF]/ + XYZ + 0: X + +/[^\xff]/8 + XYZ + 0: X + \x{123} + 0: \x{123} + +/^[ac]*b/8 + xb +No match + +/^[ac\x{100}]*b/8 + xb +No match + +/^[^x]*b/8i + xb +No match + +/^[^x]*b/8 + xb +No match + +/^\d*b/8 + xb +No match + +/(|a)/g8 + catac + 0: + 0: a + 1: + 0: + 0: a + 1: + 0: + 0: + a\x{256}a + 0: a + 1: + 0: + 0: a + 1: + 0: + +/^\x{85}$/8i + \x{85} + 0: \x{85} + +/ End of testinput 8 / diff --git a/mozilla/js/tamarin/pcre/testdata/testoutput9 b/mozilla/js/tamarin/pcre/testdata/testoutput9 new file mode 100644 index 00000000000..2598a745c2f --- /dev/null +++ b/mozilla/js/tamarin/pcre/testdata/testoutput9 @@ -0,0 +1,1234 @@ +PCRE version 6.4 05-Sep-2005 + +/\pL\P{Nd}/8 + AB + 0: AB + *** Failers + 0: Fa + A0 +No match + 00 +No match + +/\X./8 + AB + 0: AB + A\x{300}BC + 0: A\x{300}B + A\x{300}\x{301}\x{302}BC + 0: A\x{300}\x{301}\x{302}B + *** Failers + 0: ** + \x{300} +No match + +/\X\X/8 + ABC + 0: AB + A\x{300}B\x{300}\x{301}C + 0: A\x{300}B\x{300}\x{301} + A\x{300}\x{301}\x{302}BC + 0: A\x{300}\x{301}\x{302}B + *** Failers + 0: ** + \x{300} +No match + +/^\pL+/8 + abcd + 0: abcd + 1: abc + 2: ab + 3: a + a + 0: a + *** Failers +No match + +/^\PL+/8 + 1234 + 0: 1234 + 1: 123 + 2: 12 + 3: 1 + = + 0: = + *** Failers + 0: *** + 1: *** + 2: ** + 3: * + abcd +No match + +/^\X+/8 + abcdA\x{300}\x{301}\x{302} + 0: abcdA\x{300}\x{301}\x{302} + 1: abcd + 2: abc + 3: ab + 4: a + A\x{300}\x{301}\x{302} + 0: A\x{300}\x{301}\x{302} + A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302} + 0: A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302} + 1: A\x{300}\x{301}\x{302} + a + 0: a + *** Failers + 0: *** Failers + 1: *** Failer + 2: *** Faile + 3: *** Fail + 4: *** Fai + 5: *** Fa + 6: *** F + 7: *** + 8: *** + 9: ** +10: * + \x{300}\x{301}\x{302} +No match + +/\X?abc/8 + abc + 0: abc + A\x{300}abc + 0: A\x{300}abc + A\x{300}\x{301}\x{302}A\x{300}A\x{300}A\x{300}abcxyz + 0: A\x{300}abc + \x{300}abc + 0: abc + *** Failers +No match + +/^\X?abc/8 + abc + 0: abc + A\x{300}abc + 0: A\x{300}abc + *** Failers +No match + A\x{300}\x{301}\x{302}A\x{300}A\x{300}A\x{300}abcxyz +No match + \x{300}abc +No match + +/\X*abc/8 + abc + 0: abc + A\x{300}abc + 0: A\x{300}abc + A\x{300}\x{301}\x{302}A\x{300}A\x{300}A\x{300}abcxyz + 0: A\x{300}\x{301}\x{302}A\x{300}A\x{300}A\x{300}abc + \x{300}abc + 0: abc + *** Failers +No match + +/^\X*abc/8 + abc + 0: abc + A\x{300}abc + 0: A\x{300}abc + A\x{300}\x{301}\x{302}A\x{300}A\x{300}A\x{300}abcxyz + 0: A\x{300}\x{301}\x{302}A\x{300}A\x{300}A\x{300}abc + *** Failers +No match + \x{300}abc +No match + +/^\pL?=./8 + A=b + 0: A=b + =c + 0: =c + *** Failers +No match + 1=2 +No match + AAAA=b +No match + +/^\pL*=./8 + AAAA=b + 0: AAAA=b + =c + 0: =c + *** Failers +No match + 1=2 +No match + +/^\X{2,3}X/8 + A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}X + 0: A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}X + A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}X + 0: A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}X + *** Failers +No match + X +No match + A\x{300}\x{301}\x{302}X +No match + A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}X +No match + +/^\pC\pL\pM\pN\pP\pS\pZ spare | + | exponent of right + |-> left child exists child offset + + +The upper/lower casing information is set only for characters that come in +pairs. There are (at present) four non-one-to-one mappings in the Unicode data. +These are ignored. They are: + + 1FBE Greek Prosgegrammeni (lower, with upper -> capital iota) + 2126 Ohm + 212A Kelvin + 212B Angstrom + +Certainly for the last three, having an alternate case would seem to be a +mistake. I don't know any Greek, so cannot comment on the first one. + + +When searching the tree, proceed as follows: + +(1) Start at the first node. + +(2) Extract the character value from f1 and the bottom 8 bits of f0; + +(3) Compare with the character being sought. If equal, we are done. + +(4) If the test character is smaller, inspect the f0_leftexists flag. If it is + not set, the character is not in the tree. If it is set, move to the next + node, and go to (2). + +(5) If the test character is bigger, extract the f2_rightmask bits from f2, and + shift them right by f2_rightshift. If the result is zero, the character is + not in the tree. Otherwise, calculate the number of nodes to skip by + shifting the value 1 left by this number minus one. Go to (2). +*/ + + +/* End of internal.h */ diff --git a/mozilla/js/tamarin/pcre/ucptable.cpp b/mozilla/js/tamarin/pcre/ucptable.cpp new file mode 100644 index 00000000000..7fb3a123432 --- /dev/null +++ b/mozilla/js/tamarin/pcre/ucptable.cpp @@ -0,0 +1,15105 @@ +/* This source module is automatically generated from the Unicode +property table. See internal.h for a description of the layout. */ + +static cnode ucp_table[] = { + { 0x9a00, 0x2f1f, 0xe000 }, + { 0x8700, 0x1558, 0xd000 }, + { 0x8700, 0x0a99, 0xc000 }, + { 0x8500, 0x0435, 0xbfe0 }, + { 0x8500, 0x01ff, 0xafff }, + { 0x8500, 0x00ff, 0x9079 }, + { 0x8000, 0x007f, 0x8000 }, + { 0x9500, 0x003f, 0x7000 }, + { 0x8000, 0x001f, 0x6000 }, + { 0x8000, 0x000f, 0x5000 }, + { 0x8000, 0x0007, 0x4000 }, + { 0x8000, 0x0003, 0x3000 }, + { 0x8000, 0x0001, 0x2000 }, + { 0x0000, 0x0000, 0x0000 }, + { 0x0000, 0x0002, 0x0000 }, + { 0x8000, 0x0005, 0x2000 }, + { 0x0000, 0x0004, 0x0000 }, + { 0x0000, 0x0006, 0x0000 }, + { 0x8000, 0x000b, 0x3000 }, + { 0x8000, 0x0009, 0x2000 }, + { 0x0000, 0x0008, 0x0000 }, + { 0x0000, 0x000a, 0x0000 }, + { 0x8000, 0x000d, 0x2000 }, + { 0x0000, 0x000c, 0x0000 }, + { 0x0000, 0x000e, 0x0000 }, + { 0x8000, 0x0017, 0x4000 }, + { 0x8000, 0x0013, 0x3000 }, + { 0x8000, 0x0011, 0x2000 }, + { 0x0000, 0x0010, 0x0000 }, + { 0x0000, 0x0012, 0x0000 }, + { 0x8000, 0x0015, 0x2000 }, + { 0x0000, 0x0014, 0x0000 }, + { 0x0000, 0x0016, 0x0000 }, + { 0x8000, 0x001b, 0x3000 }, + { 0x8000, 0x0019, 0x2000 }, + { 0x0000, 0x0018, 0x0000 }, + { 0x0000, 0x001a, 0x0000 }, + { 0x8000, 0x001d, 0x2000 }, + { 0x0000, 0x001c, 0x0000 }, + { 0x0000, 0x001e, 0x0000 }, + { 0x9500, 0x002f, 0x5000 }, + { 0x9500, 0x0027, 0x4000 }, + { 0x9500, 0x0023, 0x3000 }, + { 0x9500, 0x0021, 0x2000 }, + { 0x1d00, 0x0020, 0x0000 }, + { 0x1500, 0x0022, 0x0000 }, + { 0x9500, 0x0025, 0x2000 }, + { 0x1700, 0x0024, 0x0000 }, + { 0x1500, 0x0026, 0x0000 }, + { 0x9900, 0x002b, 0x3000 }, + { 0x9200, 0x0029, 0x2000 }, + { 0x1600, 0x0028, 0x0000 }, + { 0x1500, 0x002a, 0x0000 }, + { 0x9100, 0x002d, 0x2000 }, + { 0x1500, 0x002c, 0x0000 }, + { 0x1500, 0x002e, 0x0000 }, + { 0x8d00, 0x0037, 0x4000 }, + { 0x8d00, 0x0033, 0x3000 }, + { 0x8d00, 0x0031, 0x2000 }, + { 0x0d00, 0x0030, 0x0000 }, + { 0x0d00, 0x0032, 0x0000 }, + { 0x8d00, 0x0035, 0x2000 }, + { 0x0d00, 0x0034, 0x0000 }, + { 0x0d00, 0x0036, 0x0000 }, + { 0x9500, 0x003b, 0x3000 }, + { 0x8d00, 0x0039, 0x2000 }, + { 0x0d00, 0x0038, 0x0000 }, + { 0x1500, 0x003a, 0x0000 }, + { 0x9900, 0x003d, 0x2000 }, + { 0x1900, 0x003c, 0x0000 }, + { 0x1900, 0x003e, 0x0000 }, + { 0x9000, 0x005f, 0x6000 }, + { 0x8900, 0x004f, 0x5020 }, + { 0x8900, 0x0047, 0x4020 }, + { 0x8900, 0x0043, 0x3020 }, + { 0x8900, 0x0041, 0x2020 }, + { 0x1500, 0x0040, 0x0000 }, + { 0x0900, 0x0042, 0x0020 }, + { 0x8900, 0x0045, 0x2020 }, + { 0x0900, 0x0044, 0x0020 }, + { 0x0900, 0x0046, 0x0020 }, + { 0x8900, 0x004b, 0x3020 }, + { 0x8900, 0x0049, 0x2020 }, + { 0x0900, 0x0048, 0x0020 }, + { 0x0900, 0x004a, 0x0020 }, + { 0x8900, 0x004d, 0x2020 }, + { 0x0900, 0x004c, 0x0020 }, + { 0x0900, 0x004e, 0x0020 }, + { 0x8900, 0x0057, 0x4020 }, + { 0x8900, 0x0053, 0x3020 }, + { 0x8900, 0x0051, 0x2020 }, + { 0x0900, 0x0050, 0x0020 }, + { 0x0900, 0x0052, 0x0020 }, + { 0x8900, 0x0055, 0x2020 }, + { 0x0900, 0x0054, 0x0020 }, + { 0x0900, 0x0056, 0x0020 }, + { 0x9600, 0x005b, 0x3000 }, + { 0x8900, 0x0059, 0x2020 }, + { 0x0900, 0x0058, 0x0020 }, + { 0x0900, 0x005a, 0x0020 }, + { 0x9200, 0x005d, 0x2000 }, + { 0x1500, 0x005c, 0x0000 }, + { 0x1800, 0x005e, 0x0000 }, + { 0x8500, 0x006f, 0x5fe0 }, + { 0x8500, 0x0067, 0x4fe0 }, + { 0x8500, 0x0063, 0x3fe0 }, + { 0x8500, 0x0061, 0x2fe0 }, + { 0x1800, 0x0060, 0x0000 }, + { 0x0500, 0x0062, 0x0fe0 }, + { 0x8500, 0x0065, 0x2fe0 }, + { 0x0500, 0x0064, 0x0fe0 }, + { 0x0500, 0x0066, 0x0fe0 }, + { 0x8500, 0x006b, 0x3fe0 }, + { 0x8500, 0x0069, 0x2fe0 }, + { 0x0500, 0x0068, 0x0fe0 }, + { 0x0500, 0x006a, 0x0fe0 }, + { 0x8500, 0x006d, 0x2fe0 }, + { 0x0500, 0x006c, 0x0fe0 }, + { 0x0500, 0x006e, 0x0fe0 }, + { 0x8500, 0x0077, 0x4fe0 }, + { 0x8500, 0x0073, 0x3fe0 }, + { 0x8500, 0x0071, 0x2fe0 }, + { 0x0500, 0x0070, 0x0fe0 }, + { 0x0500, 0x0072, 0x0fe0 }, + { 0x8500, 0x0075, 0x2fe0 }, + { 0x0500, 0x0074, 0x0fe0 }, + { 0x0500, 0x0076, 0x0fe0 }, + { 0x9600, 0x007b, 0x3000 }, + { 0x8500, 0x0079, 0x2fe0 }, + { 0x0500, 0x0078, 0x0fe0 }, + { 0x0500, 0x007a, 0x0fe0 }, + { 0x9200, 0x007d, 0x2000 }, + { 0x1900, 0x007c, 0x0000 }, + { 0x1900, 0x007e, 0x0000 }, + { 0x9500, 0x00bf, 0x7000 }, + { 0x8000, 0x009f, 0x6000 }, + { 0x8000, 0x008f, 0x5000 }, + { 0x8000, 0x0087, 0x4000 }, + { 0x8000, 0x0083, 0x3000 }, + { 0x8000, 0x0081, 0x2000 }, + { 0x0000, 0x0080, 0x0000 }, + { 0x0000, 0x0082, 0x0000 }, + { 0x8000, 0x0085, 0x2000 }, + { 0x0000, 0x0084, 0x0000 }, + { 0x0000, 0x0086, 0x0000 }, + { 0x8000, 0x008b, 0x3000 }, + { 0x8000, 0x0089, 0x2000 }, + { 0x0000, 0x0088, 0x0000 }, + { 0x0000, 0x008a, 0x0000 }, + { 0x8000, 0x008d, 0x2000 }, + { 0x0000, 0x008c, 0x0000 }, + { 0x0000, 0x008e, 0x0000 }, + { 0x8000, 0x0097, 0x4000 }, + { 0x8000, 0x0093, 0x3000 }, + { 0x8000, 0x0091, 0x2000 }, + { 0x0000, 0x0090, 0x0000 }, + { 0x0000, 0x0092, 0x0000 }, + { 0x8000, 0x0095, 0x2000 }, + { 0x0000, 0x0094, 0x0000 }, + { 0x0000, 0x0096, 0x0000 }, + { 0x8000, 0x009b, 0x3000 }, + { 0x8000, 0x0099, 0x2000 }, + { 0x0000, 0x0098, 0x0000 }, + { 0x0000, 0x009a, 0x0000 }, + { 0x8000, 0x009d, 0x2000 }, + { 0x0000, 0x009c, 0x0000 }, + { 0x0000, 0x009e, 0x0000 }, + { 0x9800, 0x00af, 0x5000 }, + { 0x9a00, 0x00a7, 0x4000 }, + { 0x9700, 0x00a3, 0x3000 }, + { 0x9500, 0x00a1, 0x2000 }, + { 0x1d00, 0x00a0, 0x0000 }, + { 0x1700, 0x00a2, 0x0000 }, + { 0x9700, 0x00a5, 0x2000 }, + { 0x1700, 0x00a4, 0x0000 }, + { 0x1a00, 0x00a6, 0x0000 }, + { 0x9400, 0x00ab, 0x3000 }, + { 0x9a00, 0x00a9, 0x2000 }, + { 0x1800, 0x00a8, 0x0000 }, + { 0x0500, 0x00aa, 0x0000 }, + { 0x8100, 0x00ad, 0x2000 }, + { 0x1900, 0x00ac, 0x0000 }, + { 0x1a00, 0x00ae, 0x0000 }, + { 0x9500, 0x00b7, 0x4000 }, + { 0x8f00, 0x00b3, 0x3000 }, + { 0x9900, 0x00b1, 0x2000 }, + { 0x1a00, 0x00b0, 0x0000 }, + { 0x0f00, 0x00b2, 0x0000 }, + { 0x8500, 0x00b5, 0x22e7 }, + { 0x1800, 0x00b4, 0x0000 }, + { 0x1a00, 0x00b6, 0x0000 }, + { 0x9300, 0x00bb, 0x3000 }, + { 0x8f00, 0x00b9, 0x2000 }, + { 0x1800, 0x00b8, 0x0000 }, + { 0x0500, 0x00ba, 0x0000 }, + { 0x8f00, 0x00bd, 0x2000 }, + { 0x0f00, 0x00bc, 0x0000 }, + { 0x0f00, 0x00be, 0x0000 }, + { 0x8500, 0x00df, 0x6000 }, + { 0x8900, 0x00cf, 0x5020 }, + { 0x8900, 0x00c7, 0x4020 }, + { 0x8900, 0x00c3, 0x3020 }, + { 0x8900, 0x00c1, 0x2020 }, + { 0x0900, 0x00c0, 0x0020 }, + { 0x0900, 0x00c2, 0x0020 }, + { 0x8900, 0x00c5, 0x2020 }, + { 0x0900, 0x00c4, 0x0020 }, + { 0x0900, 0x00c6, 0x0020 }, + { 0x8900, 0x00cb, 0x3020 }, + { 0x8900, 0x00c9, 0x2020 }, + { 0x0900, 0x00c8, 0x0020 }, + { 0x0900, 0x00ca, 0x0020 }, + { 0x8900, 0x00cd, 0x2020 }, + { 0x0900, 0x00cc, 0x0020 }, + { 0x0900, 0x00ce, 0x0020 }, + { 0x9900, 0x00d7, 0x4000 }, + { 0x8900, 0x00d3, 0x3020 }, + { 0x8900, 0x00d1, 0x2020 }, + { 0x0900, 0x00d0, 0x0020 }, + { 0x0900, 0x00d2, 0x0020 }, + { 0x8900, 0x00d5, 0x2020 }, + { 0x0900, 0x00d4, 0x0020 }, + { 0x0900, 0x00d6, 0x0020 }, + { 0x8900, 0x00db, 0x3020 }, + { 0x8900, 0x00d9, 0x2020 }, + { 0x0900, 0x00d8, 0x0020 }, + { 0x0900, 0x00da, 0x0020 }, + { 0x8900, 0x00dd, 0x2020 }, + { 0x0900, 0x00dc, 0x0020 }, + { 0x0900, 0x00de, 0x0020 }, + { 0x8500, 0x00ef, 0x5fe0 }, + { 0x8500, 0x00e7, 0x4fe0 }, + { 0x8500, 0x00e3, 0x3fe0 }, + { 0x8500, 0x00e1, 0x2fe0 }, + { 0x0500, 0x00e0, 0x0fe0 }, + { 0x0500, 0x00e2, 0x0fe0 }, + { 0x8500, 0x00e5, 0x2fe0 }, + { 0x0500, 0x00e4, 0x0fe0 }, + { 0x0500, 0x00e6, 0x0fe0 }, + { 0x8500, 0x00eb, 0x3fe0 }, + { 0x8500, 0x00e9, 0x2fe0 }, + { 0x0500, 0x00e8, 0x0fe0 }, + { 0x0500, 0x00ea, 0x0fe0 }, + { 0x8500, 0x00ed, 0x2fe0 }, + { 0x0500, 0x00ec, 0x0fe0 }, + { 0x0500, 0x00ee, 0x0fe0 }, + { 0x9900, 0x00f7, 0x4000 }, + { 0x8500, 0x00f3, 0x3fe0 }, + { 0x8500, 0x00f1, 0x2fe0 }, + { 0x0500, 0x00f0, 0x0fe0 }, + { 0x0500, 0x00f2, 0x0fe0 }, + { 0x8500, 0x00f5, 0x2fe0 }, + { 0x0500, 0x00f4, 0x0fe0 }, + { 0x0500, 0x00f6, 0x0fe0 }, + { 0x8500, 0x00fb, 0x3fe0 }, + { 0x8500, 0x00f9, 0x2fe0 }, + { 0x0500, 0x00f8, 0x0fe0 }, + { 0x0500, 0x00fa, 0x0fe0 }, + { 0x8500, 0x00fd, 0x2fe0 }, + { 0x0500, 0x00fc, 0x0fe0 }, + { 0x0500, 0x00fe, 0x0fe0 }, + { 0x8500, 0x017f, 0x8ed4 }, + { 0x8900, 0x013f, 0x7001 }, + { 0x8500, 0x011f, 0x6fff }, + { 0x8500, 0x010f, 0x5fff }, + { 0x8500, 0x0107, 0x4fff }, + { 0x8500, 0x0103, 0x3fff }, + { 0x8500, 0x0101, 0x2fff }, + { 0x0900, 0x0100, 0x0001 }, + { 0x0900, 0x0102, 0x0001 }, + { 0x8500, 0x0105, 0x2fff }, + { 0x0900, 0x0104, 0x0001 }, + { 0x0900, 0x0106, 0x0001 }, + { 0x8500, 0x010b, 0x3fff }, + { 0x8500, 0x0109, 0x2fff }, + { 0x0900, 0x0108, 0x0001 }, + { 0x0900, 0x010a, 0x0001 }, + { 0x8500, 0x010d, 0x2fff }, + { 0x0900, 0x010c, 0x0001 }, + { 0x0900, 0x010e, 0x0001 }, + { 0x8500, 0x0117, 0x4fff }, + { 0x8500, 0x0113, 0x3fff }, + { 0x8500, 0x0111, 0x2fff }, + { 0x0900, 0x0110, 0x0001 }, + { 0x0900, 0x0112, 0x0001 }, + { 0x8500, 0x0115, 0x2fff }, + { 0x0900, 0x0114, 0x0001 }, + { 0x0900, 0x0116, 0x0001 }, + { 0x8500, 0x011b, 0x3fff }, + { 0x8500, 0x0119, 0x2fff }, + { 0x0900, 0x0118, 0x0001 }, + { 0x0900, 0x011a, 0x0001 }, + { 0x8500, 0x011d, 0x2fff }, + { 0x0900, 0x011c, 0x0001 }, + { 0x0900, 0x011e, 0x0001 }, + { 0x8500, 0x012f, 0x5fff }, + { 0x8500, 0x0127, 0x4fff }, + { 0x8500, 0x0123, 0x3fff }, + { 0x8500, 0x0121, 0x2fff }, + { 0x0900, 0x0120, 0x0001 }, + { 0x0900, 0x0122, 0x0001 }, + { 0x8500, 0x0125, 0x2fff }, + { 0x0900, 0x0124, 0x0001 }, + { 0x0900, 0x0126, 0x0001 }, + { 0x8500, 0x012b, 0x3fff }, + { 0x8500, 0x0129, 0x2fff }, + { 0x0900, 0x0128, 0x0001 }, + { 0x0900, 0x012a, 0x0001 }, + { 0x8500, 0x012d, 0x2fff }, + { 0x0900, 0x012c, 0x0001 }, + { 0x0900, 0x012e, 0x0001 }, + { 0x8500, 0x0137, 0x4fff }, + { 0x8500, 0x0133, 0x3fff }, + { 0x8500, 0x0131, 0x2f18 }, + { 0x0900, 0x0130, 0x0f39 }, + { 0x0900, 0x0132, 0x0001 }, + { 0x8500, 0x0135, 0x2fff }, + { 0x0900, 0x0134, 0x0001 }, + { 0x0900, 0x0136, 0x0001 }, + { 0x8900, 0x013b, 0x3001 }, + { 0x8900, 0x0139, 0x2001 }, + { 0x0500, 0x0138, 0x0000 }, + { 0x0500, 0x013a, 0x0fff }, + { 0x8900, 0x013d, 0x2001 }, + { 0x0500, 0x013c, 0x0fff }, + { 0x0500, 0x013e, 0x0fff }, + { 0x8500, 0x015f, 0x6fff }, + { 0x8500, 0x014f, 0x5fff }, + { 0x8900, 0x0147, 0x4001 }, + { 0x8900, 0x0143, 0x3001 }, + { 0x8900, 0x0141, 0x2001 }, + { 0x0500, 0x0140, 0x0fff }, + { 0x0500, 0x0142, 0x0fff }, + { 0x8900, 0x0145, 0x2001 }, + { 0x0500, 0x0144, 0x0fff }, + { 0x0500, 0x0146, 0x0fff }, + { 0x8500, 0x014b, 0x3fff }, + { 0x8500, 0x0149, 0x2000 }, + { 0x0500, 0x0148, 0x0fff }, + { 0x0900, 0x014a, 0x0001 }, + { 0x8500, 0x014d, 0x2fff }, + { 0x0900, 0x014c, 0x0001 }, + { 0x0900, 0x014e, 0x0001 }, + { 0x8500, 0x0157, 0x4fff }, + { 0x8500, 0x0153, 0x3fff }, + { 0x8500, 0x0151, 0x2fff }, + { 0x0900, 0x0150, 0x0001 }, + { 0x0900, 0x0152, 0x0001 }, + { 0x8500, 0x0155, 0x2fff }, + { 0x0900, 0x0154, 0x0001 }, + { 0x0900, 0x0156, 0x0001 }, + { 0x8500, 0x015b, 0x3fff }, + { 0x8500, 0x0159, 0x2fff }, + { 0x0900, 0x0158, 0x0001 }, + { 0x0900, 0x015a, 0x0001 }, + { 0x8500, 0x015d, 0x2fff }, + { 0x0900, 0x015c, 0x0001 }, + { 0x0900, 0x015e, 0x0001 }, + { 0x8500, 0x016f, 0x5fff }, + { 0x8500, 0x0167, 0x4fff }, + { 0x8500, 0x0163, 0x3fff }, + { 0x8500, 0x0161, 0x2fff }, + { 0x0900, 0x0160, 0x0001 }, + { 0x0900, 0x0162, 0x0001 }, + { 0x8500, 0x0165, 0x2fff }, + { 0x0900, 0x0164, 0x0001 }, + { 0x0900, 0x0166, 0x0001 }, + { 0x8500, 0x016b, 0x3fff }, + { 0x8500, 0x0169, 0x2fff }, + { 0x0900, 0x0168, 0x0001 }, + { 0x0900, 0x016a, 0x0001 }, + { 0x8500, 0x016d, 0x2fff }, + { 0x0900, 0x016c, 0x0001 }, + { 0x0900, 0x016e, 0x0001 }, + { 0x8500, 0x0177, 0x4fff }, + { 0x8500, 0x0173, 0x3fff }, + { 0x8500, 0x0171, 0x2fff }, + { 0x0900, 0x0170, 0x0001 }, + { 0x0900, 0x0172, 0x0001 }, + { 0x8500, 0x0175, 0x2fff }, + { 0x0900, 0x0174, 0x0001 }, + { 0x0900, 0x0176, 0x0001 }, + { 0x8900, 0x017b, 0x3001 }, + { 0x8900, 0x0179, 0x2001 }, + { 0x0900, 0x0178, 0x0f87 }, + { 0x0500, 0x017a, 0x0fff }, + { 0x8900, 0x017d, 0x2001 }, + { 0x0500, 0x017c, 0x0fff }, + { 0x0500, 0x017e, 0x0fff }, + { 0x8500, 0x01bf, 0x7038 }, + { 0x8900, 0x019f, 0x60d6 }, + { 0x8900, 0x018f, 0x50ca }, + { 0x8900, 0x0187, 0x4001 }, + { 0x8500, 0x0183, 0x3fff }, + { 0x8900, 0x0181, 0x20d2 }, + { 0x0500, 0x0180, 0x0000 }, + { 0x0900, 0x0182, 0x0001 }, + { 0x8500, 0x0185, 0x2fff }, + { 0x0900, 0x0184, 0x0001 }, + { 0x0900, 0x0186, 0x00ce }, + { 0x8900, 0x018b, 0x3001 }, + { 0x8900, 0x0189, 0x20cd }, + { 0x0500, 0x0188, 0x0fff }, + { 0x0900, 0x018a, 0x00cd }, + { 0x8500, 0x018d, 0x2000 }, + { 0x0500, 0x018c, 0x0fff }, + { 0x0900, 0x018e, 0x004f }, + { 0x8900, 0x0197, 0x40d1 }, + { 0x8900, 0x0193, 0x30cd }, + { 0x8900, 0x0191, 0x2001 }, + { 0x0900, 0x0190, 0x00cb }, + { 0x0500, 0x0192, 0x0fff }, + { 0x8500, 0x0195, 0x2061 }, + { 0x0900, 0x0194, 0x00cf }, + { 0x0900, 0x0196, 0x00d3 }, + { 0x8500, 0x019b, 0x3000 }, + { 0x8500, 0x0199, 0x2fff }, + { 0x0900, 0x0198, 0x0001 }, + { 0x0500, 0x019a, 0x0000 }, + { 0x8900, 0x019d, 0x20d5 }, + { 0x0900, 0x019c, 0x00d3 }, + { 0x0500, 0x019e, 0x0082 }, + { 0x8900, 0x01af, 0x5001 }, + { 0x8900, 0x01a7, 0x4001 }, + { 0x8500, 0x01a3, 0x3fff }, + { 0x8500, 0x01a1, 0x2fff }, + { 0x0900, 0x01a0, 0x0001 }, + { 0x0900, 0x01a2, 0x0001 }, + { 0x8500, 0x01a5, 0x2fff }, + { 0x0900, 0x01a4, 0x0001 }, + { 0x0900, 0x01a6, 0x00da }, + { 0x8500, 0x01ab, 0x3000 }, + { 0x8900, 0x01a9, 0x20da }, + { 0x0500, 0x01a8, 0x0fff }, + { 0x0500, 0x01aa, 0x0000 }, + { 0x8500, 0x01ad, 0x2fff }, + { 0x0900, 0x01ac, 0x0001 }, + { 0x0900, 0x01ae, 0x00da }, + { 0x8900, 0x01b7, 0x40db }, + { 0x8900, 0x01b3, 0x3001 }, + { 0x8900, 0x01b1, 0x20d9 }, + { 0x0500, 0x01b0, 0x0fff }, + { 0x0900, 0x01b2, 0x00d9 }, + { 0x8900, 0x01b5, 0x2001 }, + { 0x0500, 0x01b4, 0x0fff }, + { 0x0500, 0x01b6, 0x0fff }, + { 0x8700, 0x01bb, 0x3000 }, + { 0x8500, 0x01b9, 0x2fff }, + { 0x0900, 0x01b8, 0x0001 }, + { 0x0500, 0x01ba, 0x0000 }, + { 0x8500, 0x01bd, 0x2fff }, + { 0x0900, 0x01bc, 0x0001 }, + { 0x0500, 0x01be, 0x0000 }, + { 0x8500, 0x01df, 0x6fff }, + { 0x8900, 0x01cf, 0x5001 }, + { 0x8900, 0x01c7, 0x4002 }, + { 0x8700, 0x01c3, 0x3000 }, + { 0x8700, 0x01c1, 0x2000 }, + { 0x0700, 0x01c0, 0x0000 }, + { 0x0700, 0x01c2, 0x0000 }, + { 0x8800, 0x01c5, 0x2000 }, + { 0x0900, 0x01c4, 0x0002 }, + { 0x0500, 0x01c6, 0x0ffe }, + { 0x8800, 0x01cb, 0x3000 }, + { 0x8500, 0x01c9, 0x2ffe }, + { 0x0800, 0x01c8, 0x0000 }, + { 0x0900, 0x01ca, 0x0002 }, + { 0x8900, 0x01cd, 0x2001 }, + { 0x0500, 0x01cc, 0x0ffe }, + { 0x0500, 0x01ce, 0x0fff }, + { 0x8900, 0x01d7, 0x4001 }, + { 0x8900, 0x01d3, 0x3001 }, + { 0x8900, 0x01d1, 0x2001 }, + { 0x0500, 0x01d0, 0x0fff }, + { 0x0500, 0x01d2, 0x0fff }, + { 0x8900, 0x01d5, 0x2001 }, + { 0x0500, 0x01d4, 0x0fff }, + { 0x0500, 0x01d6, 0x0fff }, + { 0x8900, 0x01db, 0x3001 }, + { 0x8900, 0x01d9, 0x2001 }, + { 0x0500, 0x01d8, 0x0fff }, + { 0x0500, 0x01da, 0x0fff }, + { 0x8500, 0x01dd, 0x2fb1 }, + { 0x0500, 0x01dc, 0x0fff }, + { 0x0900, 0x01de, 0x0001 }, + { 0x8500, 0x01ef, 0x5fff }, + { 0x8500, 0x01e7, 0x4fff }, + { 0x8500, 0x01e3, 0x3fff }, + { 0x8500, 0x01e1, 0x2fff }, + { 0x0900, 0x01e0, 0x0001 }, + { 0x0900, 0x01e2, 0x0001 }, + { 0x8500, 0x01e5, 0x2fff }, + { 0x0900, 0x01e4, 0x0001 }, + { 0x0900, 0x01e6, 0x0001 }, + { 0x8500, 0x01eb, 0x3fff }, + { 0x8500, 0x01e9, 0x2fff }, + { 0x0900, 0x01e8, 0x0001 }, + { 0x0900, 0x01ea, 0x0001 }, + { 0x8500, 0x01ed, 0x2fff }, + { 0x0900, 0x01ec, 0x0001 }, + { 0x0900, 0x01ee, 0x0001 }, + { 0x8900, 0x01f7, 0x4fc8 }, + { 0x8500, 0x01f3, 0x3ffe }, + { 0x8900, 0x01f1, 0x2002 }, + { 0x0500, 0x01f0, 0x0000 }, + { 0x0800, 0x01f2, 0x0000 }, + { 0x8500, 0x01f5, 0x2fff }, + { 0x0900, 0x01f4, 0x0001 }, + { 0x0900, 0x01f6, 0x0f9f }, + { 0x8500, 0x01fb, 0x3fff }, + { 0x8500, 0x01f9, 0x2fff }, + { 0x0900, 0x01f8, 0x0001 }, + { 0x0900, 0x01fa, 0x0001 }, + { 0x8500, 0x01fd, 0x2fff }, + { 0x0900, 0x01fc, 0x0001 }, + { 0x0900, 0x01fe, 0x0001 }, + { 0x8c00, 0x0318, 0x9000 }, + { 0x8500, 0x0298, 0x8000 }, + { 0x8500, 0x0258, 0x7000 }, + { 0x8500, 0x021f, 0x6fff }, + { 0x8500, 0x020f, 0x5fff }, + { 0x8500, 0x0207, 0x4fff }, + { 0x8500, 0x0203, 0x3fff }, + { 0x8500, 0x0201, 0x2fff }, + { 0x0900, 0x0200, 0x0001 }, + { 0x0900, 0x0202, 0x0001 }, + { 0x8500, 0x0205, 0x2fff }, + { 0x0900, 0x0204, 0x0001 }, + { 0x0900, 0x0206, 0x0001 }, + { 0x8500, 0x020b, 0x3fff }, + { 0x8500, 0x0209, 0x2fff }, + { 0x0900, 0x0208, 0x0001 }, + { 0x0900, 0x020a, 0x0001 }, + { 0x8500, 0x020d, 0x2fff }, + { 0x0900, 0x020c, 0x0001 }, + { 0x0900, 0x020e, 0x0001 }, + { 0x8500, 0x0217, 0x4fff }, + { 0x8500, 0x0213, 0x3fff }, + { 0x8500, 0x0211, 0x2fff }, + { 0x0900, 0x0210, 0x0001 }, + { 0x0900, 0x0212, 0x0001 }, + { 0x8500, 0x0215, 0x2fff }, + { 0x0900, 0x0214, 0x0001 }, + { 0x0900, 0x0216, 0x0001 }, + { 0x8500, 0x021b, 0x3fff }, + { 0x8500, 0x0219, 0x2fff }, + { 0x0900, 0x0218, 0x0001 }, + { 0x0900, 0x021a, 0x0001 }, + { 0x8500, 0x021d, 0x2fff }, + { 0x0900, 0x021c, 0x0001 }, + { 0x0900, 0x021e, 0x0001 }, + { 0x8500, 0x022f, 0x5fff }, + { 0x8500, 0x0227, 0x4fff }, + { 0x8500, 0x0223, 0x3fff }, + { 0x8500, 0x0221, 0x2000 }, + { 0x0900, 0x0220, 0x0f7e }, + { 0x0900, 0x0222, 0x0001 }, + { 0x8500, 0x0225, 0x2fff }, + { 0x0900, 0x0224, 0x0001 }, + { 0x0900, 0x0226, 0x0001 }, + { 0x8500, 0x022b, 0x3fff }, + { 0x8500, 0x0229, 0x2fff }, + { 0x0900, 0x0228, 0x0001 }, + { 0x0900, 0x022a, 0x0001 }, + { 0x8500, 0x022d, 0x2fff }, + { 0x0900, 0x022c, 0x0001 }, + { 0x0900, 0x022e, 0x0001 }, + { 0x8500, 0x0250, 0x4000 }, + { 0x8500, 0x0233, 0x3fff }, + { 0x8500, 0x0231, 0x2fff }, + { 0x0900, 0x0230, 0x0001 }, + { 0x0900, 0x0232, 0x0001 }, + { 0x8500, 0x0235, 0x2000 }, + { 0x0500, 0x0234, 0x0000 }, + { 0x0500, 0x0236, 0x0000 }, + { 0x8500, 0x0254, 0x3f32 }, + { 0x8500, 0x0252, 0x2000 }, + { 0x0500, 0x0251, 0x0000 }, + { 0x0500, 0x0253, 0x0f2e }, + { 0x8500, 0x0256, 0x2f33 }, + { 0x0500, 0x0255, 0x0000 }, + { 0x0500, 0x0257, 0x0f33 }, + { 0x8500, 0x0278, 0x6000 }, + { 0x8500, 0x0268, 0x5f2f }, + { 0x8500, 0x0260, 0x4f33 }, + { 0x8500, 0x025c, 0x3000 }, + { 0x8500, 0x025a, 0x2000 }, + { 0x0500, 0x0259, 0x0f36 }, + { 0x0500, 0x025b, 0x0f35 }, + { 0x8500, 0x025e, 0x2000 }, + { 0x0500, 0x025d, 0x0000 }, + { 0x0500, 0x025f, 0x0000 }, + { 0x8500, 0x0264, 0x3000 }, + { 0x8500, 0x0262, 0x2000 }, + { 0x0500, 0x0261, 0x0000 }, + { 0x0500, 0x0263, 0x0f31 }, + { 0x8500, 0x0266, 0x2000 }, + { 0x0500, 0x0265, 0x0000 }, + { 0x0500, 0x0267, 0x0000 }, + { 0x8500, 0x0270, 0x4000 }, + { 0x8500, 0x026c, 0x3000 }, + { 0x8500, 0x026a, 0x2000 }, + { 0x0500, 0x0269, 0x0f2d }, + { 0x0500, 0x026b, 0x0000 }, + { 0x8500, 0x026e, 0x2000 }, + { 0x0500, 0x026d, 0x0000 }, + { 0x0500, 0x026f, 0x0f2d }, + { 0x8500, 0x0274, 0x3000 }, + { 0x8500, 0x0272, 0x2f2b }, + { 0x0500, 0x0271, 0x0000 }, + { 0x0500, 0x0273, 0x0000 }, + { 0x8500, 0x0276, 0x2000 }, + { 0x0500, 0x0275, 0x0f2a }, + { 0x0500, 0x0277, 0x0000 }, + { 0x8500, 0x0288, 0x5f26 }, + { 0x8500, 0x0280, 0x4f26 }, + { 0x8500, 0x027c, 0x3000 }, + { 0x8500, 0x027a, 0x2000 }, + { 0x0500, 0x0279, 0x0000 }, + { 0x0500, 0x027b, 0x0000 }, + { 0x8500, 0x027e, 0x2000 }, + { 0x0500, 0x027d, 0x0000 }, + { 0x0500, 0x027f, 0x0000 }, + { 0x8500, 0x0284, 0x3000 }, + { 0x8500, 0x0282, 0x2000 }, + { 0x0500, 0x0281, 0x0000 }, + { 0x0500, 0x0283, 0x0f26 }, + { 0x8500, 0x0286, 0x2000 }, + { 0x0500, 0x0285, 0x0000 }, + { 0x0500, 0x0287, 0x0000 }, + { 0x8500, 0x0290, 0x4000 }, + { 0x8500, 0x028c, 0x3000 }, + { 0x8500, 0x028a, 0x2f27 }, + { 0x0500, 0x0289, 0x0000 }, + { 0x0500, 0x028b, 0x0f27 }, + { 0x8500, 0x028e, 0x2000 }, + { 0x0500, 0x028d, 0x0000 }, + { 0x0500, 0x028f, 0x0000 }, + { 0x8500, 0x0294, 0x3000 }, + { 0x8500, 0x0292, 0x2f25 }, + { 0x0500, 0x0291, 0x0000 }, + { 0x0500, 0x0293, 0x0000 }, + { 0x8500, 0x0296, 0x2000 }, + { 0x0500, 0x0295, 0x0000 }, + { 0x0500, 0x0297, 0x0000 }, + { 0x9800, 0x02d8, 0x7000 }, + { 0x8600, 0x02b8, 0x6000 }, + { 0x8500, 0x02a8, 0x5000 }, + { 0x8500, 0x02a0, 0x4000 }, + { 0x8500, 0x029c, 0x3000 }, + { 0x8500, 0x029a, 0x2000 }, + { 0x0500, 0x0299, 0x0000 }, + { 0x0500, 0x029b, 0x0000 }, + { 0x8500, 0x029e, 0x2000 }, + { 0x0500, 0x029d, 0x0000 }, + { 0x0500, 0x029f, 0x0000 }, + { 0x8500, 0x02a4, 0x3000 }, + { 0x8500, 0x02a2, 0x2000 }, + { 0x0500, 0x02a1, 0x0000 }, + { 0x0500, 0x02a3, 0x0000 }, + { 0x8500, 0x02a6, 0x2000 }, + { 0x0500, 0x02a5, 0x0000 }, + { 0x0500, 0x02a7, 0x0000 }, + { 0x8600, 0x02b0, 0x4000 }, + { 0x8500, 0x02ac, 0x3000 }, + { 0x8500, 0x02aa, 0x2000 }, + { 0x0500, 0x02a9, 0x0000 }, + { 0x0500, 0x02ab, 0x0000 }, + { 0x8500, 0x02ae, 0x2000 }, + { 0x0500, 0x02ad, 0x0000 }, + { 0x0500, 0x02af, 0x0000 }, + { 0x8600, 0x02b4, 0x3000 }, + { 0x8600, 0x02b2, 0x2000 }, + { 0x0600, 0x02b1, 0x0000 }, + { 0x0600, 0x02b3, 0x0000 }, + { 0x8600, 0x02b6, 0x2000 }, + { 0x0600, 0x02b5, 0x0000 }, + { 0x0600, 0x02b7, 0x0000 }, + { 0x8600, 0x02c8, 0x5000 }, + { 0x8600, 0x02c0, 0x4000 }, + { 0x8600, 0x02bc, 0x3000 }, + { 0x8600, 0x02ba, 0x2000 }, + { 0x0600, 0x02b9, 0x0000 }, + { 0x0600, 0x02bb, 0x0000 }, + { 0x8600, 0x02be, 0x2000 }, + { 0x0600, 0x02bd, 0x0000 }, + { 0x0600, 0x02bf, 0x0000 }, + { 0x9800, 0x02c4, 0x3000 }, + { 0x9800, 0x02c2, 0x2000 }, + { 0x0600, 0x02c1, 0x0000 }, + { 0x1800, 0x02c3, 0x0000 }, + { 0x8600, 0x02c6, 0x2000 }, + { 0x1800, 0x02c5, 0x0000 }, + { 0x0600, 0x02c7, 0x0000 }, + { 0x8600, 0x02d0, 0x4000 }, + { 0x8600, 0x02cc, 0x3000 }, + { 0x8600, 0x02ca, 0x2000 }, + { 0x0600, 0x02c9, 0x0000 }, + { 0x0600, 0x02cb, 0x0000 }, + { 0x8600, 0x02ce, 0x2000 }, + { 0x0600, 0x02cd, 0x0000 }, + { 0x0600, 0x02cf, 0x0000 }, + { 0x9800, 0x02d4, 0x3000 }, + { 0x9800, 0x02d2, 0x2000 }, + { 0x0600, 0x02d1, 0x0000 }, + { 0x1800, 0x02d3, 0x0000 }, + { 0x9800, 0x02d6, 0x2000 }, + { 0x1800, 0x02d5, 0x0000 }, + { 0x1800, 0x02d7, 0x0000 }, + { 0x9800, 0x02f8, 0x6000 }, + { 0x9800, 0x02e8, 0x5000 }, + { 0x8600, 0x02e0, 0x4000 }, + { 0x9800, 0x02dc, 0x3000 }, + { 0x9800, 0x02da, 0x2000 }, + { 0x1800, 0x02d9, 0x0000 }, + { 0x1800, 0x02db, 0x0000 }, + { 0x9800, 0x02de, 0x2000 }, + { 0x1800, 0x02dd, 0x0000 }, + { 0x1800, 0x02df, 0x0000 }, + { 0x8600, 0x02e4, 0x3000 }, + { 0x8600, 0x02e2, 0x2000 }, + { 0x0600, 0x02e1, 0x0000 }, + { 0x0600, 0x02e3, 0x0000 }, + { 0x9800, 0x02e6, 0x2000 }, + { 0x1800, 0x02e5, 0x0000 }, + { 0x1800, 0x02e7, 0x0000 }, + { 0x9800, 0x02f0, 0x4000 }, + { 0x9800, 0x02ec, 0x3000 }, + { 0x9800, 0x02ea, 0x2000 }, + { 0x1800, 0x02e9, 0x0000 }, + { 0x1800, 0x02eb, 0x0000 }, + { 0x8600, 0x02ee, 0x2000 }, + { 0x1800, 0x02ed, 0x0000 }, + { 0x1800, 0x02ef, 0x0000 }, + { 0x9800, 0x02f4, 0x3000 }, + { 0x9800, 0x02f2, 0x2000 }, + { 0x1800, 0x02f1, 0x0000 }, + { 0x1800, 0x02f3, 0x0000 }, + { 0x9800, 0x02f6, 0x2000 }, + { 0x1800, 0x02f5, 0x0000 }, + { 0x1800, 0x02f7, 0x0000 }, + { 0x8c00, 0x0308, 0x5000 }, + { 0x8c00, 0x0300, 0x4000 }, + { 0x9800, 0x02fc, 0x3000 }, + { 0x9800, 0x02fa, 0x2000 }, + { 0x1800, 0x02f9, 0x0000 }, + { 0x1800, 0x02fb, 0x0000 }, + { 0x9800, 0x02fe, 0x2000 }, + { 0x1800, 0x02fd, 0x0000 }, + { 0x1800, 0x02ff, 0x0000 }, + { 0x8c00, 0x0304, 0x3000 }, + { 0x8c00, 0x0302, 0x2000 }, + { 0x0c00, 0x0301, 0x0000 }, + { 0x0c00, 0x0303, 0x0000 }, + { 0x8c00, 0x0306, 0x2000 }, + { 0x0c00, 0x0305, 0x0000 }, + { 0x0c00, 0x0307, 0x0000 }, + { 0x8c00, 0x0310, 0x4000 }, + { 0x8c00, 0x030c, 0x3000 }, + { 0x8c00, 0x030a, 0x2000 }, + { 0x0c00, 0x0309, 0x0000 }, + { 0x0c00, 0x030b, 0x0000 }, + { 0x8c00, 0x030e, 0x2000 }, + { 0x0c00, 0x030d, 0x0000 }, + { 0x0c00, 0x030f, 0x0000 }, + { 0x8c00, 0x0314, 0x3000 }, + { 0x8c00, 0x0312, 0x2000 }, + { 0x0c00, 0x0311, 0x0000 }, + { 0x0c00, 0x0313, 0x0000 }, + { 0x8c00, 0x0316, 0x2000 }, + { 0x0c00, 0x0315, 0x0000 }, + { 0x0c00, 0x0317, 0x0000 }, + { 0x8500, 0x03b0, 0x8000 }, + { 0x8c00, 0x035d, 0x7000 }, + { 0x8c00, 0x0338, 0x6000 }, + { 0x8c00, 0x0328, 0x5000 }, + { 0x8c00, 0x0320, 0x4000 }, + { 0x8c00, 0x031c, 0x3000 }, + { 0x8c00, 0x031a, 0x2000 }, + { 0x0c00, 0x0319, 0x0000 }, + { 0x0c00, 0x031b, 0x0000 }, + { 0x8c00, 0x031e, 0x2000 }, + { 0x0c00, 0x031d, 0x0000 }, + { 0x0c00, 0x031f, 0x0000 }, + { 0x8c00, 0x0324, 0x3000 }, + { 0x8c00, 0x0322, 0x2000 }, + { 0x0c00, 0x0321, 0x0000 }, + { 0x0c00, 0x0323, 0x0000 }, + { 0x8c00, 0x0326, 0x2000 }, + { 0x0c00, 0x0325, 0x0000 }, + { 0x0c00, 0x0327, 0x0000 }, + { 0x8c00, 0x0330, 0x4000 }, + { 0x8c00, 0x032c, 0x3000 }, + { 0x8c00, 0x032a, 0x2000 }, + { 0x0c00, 0x0329, 0x0000 }, + { 0x0c00, 0x032b, 0x0000 }, + { 0x8c00, 0x032e, 0x2000 }, + { 0x0c00, 0x032d, 0x0000 }, + { 0x0c00, 0x032f, 0x0000 }, + { 0x8c00, 0x0334, 0x3000 }, + { 0x8c00, 0x0332, 0x2000 }, + { 0x0c00, 0x0331, 0x0000 }, + { 0x0c00, 0x0333, 0x0000 }, + { 0x8c00, 0x0336, 0x2000 }, + { 0x0c00, 0x0335, 0x0000 }, + { 0x0c00, 0x0337, 0x0000 }, + { 0x8c00, 0x0348, 0x5000 }, + { 0x8c00, 0x0340, 0x4000 }, + { 0x8c00, 0x033c, 0x3000 }, + { 0x8c00, 0x033a, 0x2000 }, + { 0x0c00, 0x0339, 0x0000 }, + { 0x0c00, 0x033b, 0x0000 }, + { 0x8c00, 0x033e, 0x2000 }, + { 0x0c00, 0x033d, 0x0000 }, + { 0x0c00, 0x033f, 0x0000 }, + { 0x8c00, 0x0344, 0x3000 }, + { 0x8c00, 0x0342, 0x2000 }, + { 0x0c00, 0x0341, 0x0000 }, + { 0x0c00, 0x0343, 0x0000 }, + { 0x8c00, 0x0346, 0x2000 }, + { 0x0c00, 0x0345, 0x0000 }, + { 0x0c00, 0x0347, 0x0000 }, + { 0x8c00, 0x0350, 0x4000 }, + { 0x8c00, 0x034c, 0x3000 }, + { 0x8c00, 0x034a, 0x2000 }, + { 0x0c00, 0x0349, 0x0000 }, + { 0x0c00, 0x034b, 0x0000 }, + { 0x8c00, 0x034e, 0x2000 }, + { 0x0c00, 0x034d, 0x0000 }, + { 0x0c00, 0x034f, 0x0000 }, + { 0x8c00, 0x0354, 0x3000 }, + { 0x8c00, 0x0352, 0x2000 }, + { 0x0c00, 0x0351, 0x0000 }, + { 0x0c00, 0x0353, 0x0000 }, + { 0x8c00, 0x0356, 0x2000 }, + { 0x0c00, 0x0355, 0x0000 }, + { 0x0c00, 0x0357, 0x0000 }, + { 0x8900, 0x038f, 0x603f }, + { 0x8c00, 0x036d, 0x5000 }, + { 0x8c00, 0x0365, 0x4000 }, + { 0x8c00, 0x0361, 0x3000 }, + { 0x8c00, 0x035f, 0x2000 }, + { 0x0c00, 0x035e, 0x0000 }, + { 0x0c00, 0x0360, 0x0000 }, + { 0x8c00, 0x0363, 0x2000 }, + { 0x0c00, 0x0362, 0x0000 }, + { 0x0c00, 0x0364, 0x0000 }, + { 0x8c00, 0x0369, 0x3000 }, + { 0x8c00, 0x0367, 0x2000 }, + { 0x0c00, 0x0366, 0x0000 }, + { 0x0c00, 0x0368, 0x0000 }, + { 0x8c00, 0x036b, 0x2000 }, + { 0x0c00, 0x036a, 0x0000 }, + { 0x0c00, 0x036c, 0x0000 }, + { 0x9800, 0x0385, 0x4000 }, + { 0x9800, 0x0375, 0x3000 }, + { 0x8c00, 0x036f, 0x2000 }, + { 0x0c00, 0x036e, 0x0000 }, + { 0x1800, 0x0374, 0x0000 }, + { 0x9500, 0x037e, 0x2000 }, + { 0x0600, 0x037a, 0x0000 }, + { 0x1800, 0x0384, 0x0000 }, + { 0x8900, 0x0389, 0x3025 }, + { 0x9500, 0x0387, 0x2000 }, + { 0x0900, 0x0386, 0x0026 }, + { 0x0900, 0x0388, 0x0025 }, + { 0x8900, 0x038c, 0x2040 }, + { 0x0900, 0x038a, 0x0025 }, + { 0x0900, 0x038e, 0x003f }, + { 0x8900, 0x039f, 0x5020 }, + { 0x8900, 0x0397, 0x4020 }, + { 0x8900, 0x0393, 0x3020 }, + { 0x8900, 0x0391, 0x2020 }, + { 0x0500, 0x0390, 0x0000 }, + { 0x0900, 0x0392, 0x0020 }, + { 0x8900, 0x0395, 0x2020 }, + { 0x0900, 0x0394, 0x0020 }, + { 0x0900, 0x0396, 0x0020 }, + { 0x8900, 0x039b, 0x3020 }, + { 0x8900, 0x0399, 0x2020 }, + { 0x0900, 0x0398, 0x0020 }, + { 0x0900, 0x039a, 0x0020 }, + { 0x8900, 0x039d, 0x2020 }, + { 0x0900, 0x039c, 0x0020 }, + { 0x0900, 0x039e, 0x0020 }, + { 0x8900, 0x03a8, 0x4020 }, + { 0x8900, 0x03a4, 0x3020 }, + { 0x8900, 0x03a1, 0x2020 }, + { 0x0900, 0x03a0, 0x0020 }, + { 0x0900, 0x03a3, 0x0020 }, + { 0x8900, 0x03a6, 0x2020 }, + { 0x0900, 0x03a5, 0x0020 }, + { 0x0900, 0x03a7, 0x0020 }, + { 0x8500, 0x03ac, 0x3fda }, + { 0x8900, 0x03aa, 0x2020 }, + { 0x0900, 0x03a9, 0x0020 }, + { 0x0900, 0x03ab, 0x0020 }, + { 0x8500, 0x03ae, 0x2fdb }, + { 0x0500, 0x03ad, 0x0fdb }, + { 0x0500, 0x03af, 0x0fdb }, + { 0x8500, 0x03f1, 0x7fb0 }, + { 0x8500, 0x03d1, 0x6fc7 }, + { 0x8500, 0x03c0, 0x5fe0 }, + { 0x8500, 0x03b8, 0x4fe0 }, + { 0x8500, 0x03b4, 0x3fe0 }, + { 0x8500, 0x03b2, 0x2fe0 }, + { 0x0500, 0x03b1, 0x0fe0 }, + { 0x0500, 0x03b3, 0x0fe0 }, + { 0x8500, 0x03b6, 0x2fe0 }, + { 0x0500, 0x03b5, 0x0fe0 }, + { 0x0500, 0x03b7, 0x0fe0 }, + { 0x8500, 0x03bc, 0x3fe0 }, + { 0x8500, 0x03ba, 0x2fe0 }, + { 0x0500, 0x03b9, 0x0fe0 }, + { 0x0500, 0x03bb, 0x0fe0 }, + { 0x8500, 0x03be, 0x2fe0 }, + { 0x0500, 0x03bd, 0x0fe0 }, + { 0x0500, 0x03bf, 0x0fe0 }, + { 0x8500, 0x03c8, 0x4fe0 }, + { 0x8500, 0x03c4, 0x3fe0 }, + { 0x8500, 0x03c2, 0x2fe1 }, + { 0x0500, 0x03c1, 0x0fe0 }, + { 0x0500, 0x03c3, 0x0fe0 }, + { 0x8500, 0x03c6, 0x2fe0 }, + { 0x0500, 0x03c5, 0x0fe0 }, + { 0x0500, 0x03c7, 0x0fe0 }, + { 0x8500, 0x03cc, 0x3fc0 }, + { 0x8500, 0x03ca, 0x2fe0 }, + { 0x0500, 0x03c9, 0x0fe0 }, + { 0x0500, 0x03cb, 0x0fe0 }, + { 0x8500, 0x03ce, 0x2fc1 }, + { 0x0500, 0x03cd, 0x0fc1 }, + { 0x0500, 0x03d0, 0x0fc2 }, + { 0x8500, 0x03e1, 0x5fff }, + { 0x8500, 0x03d9, 0x4fff }, + { 0x8500, 0x03d5, 0x3fd1 }, + { 0x8900, 0x03d3, 0x2000 }, + { 0x0900, 0x03d2, 0x0000 }, + { 0x0900, 0x03d4, 0x0000 }, + { 0x8500, 0x03d7, 0x2000 }, + { 0x0500, 0x03d6, 0x0fca }, + { 0x0900, 0x03d8, 0x0001 }, + { 0x8500, 0x03dd, 0x3fff }, + { 0x8500, 0x03db, 0x2fff }, + { 0x0900, 0x03da, 0x0001 }, + { 0x0900, 0x03dc, 0x0001 }, + { 0x8500, 0x03df, 0x2fff }, + { 0x0900, 0x03de, 0x0001 }, + { 0x0900, 0x03e0, 0x0001 }, + { 0x8500, 0x03e9, 0x4fff }, + { 0x8500, 0x03e5, 0x3fff }, + { 0x8500, 0x03e3, 0x2fff }, + { 0x0900, 0x03e2, 0x0001 }, + { 0x0900, 0x03e4, 0x0001 }, + { 0x8500, 0x03e7, 0x2fff }, + { 0x0900, 0x03e6, 0x0001 }, + { 0x0900, 0x03e8, 0x0001 }, + { 0x8500, 0x03ed, 0x3fff }, + { 0x8500, 0x03eb, 0x2fff }, + { 0x0900, 0x03ea, 0x0001 }, + { 0x0900, 0x03ec, 0x0001 }, + { 0x8500, 0x03ef, 0x2fff }, + { 0x0900, 0x03ee, 0x0001 }, + { 0x0500, 0x03f0, 0x0faa }, + { 0x8900, 0x0415, 0x6020 }, + { 0x8900, 0x0405, 0x5050 }, + { 0x8900, 0x03f9, 0x4ff9 }, + { 0x8500, 0x03f5, 0x3fa0 }, + { 0x8500, 0x03f3, 0x2000 }, + { 0x0500, 0x03f2, 0x0007 }, + { 0x0900, 0x03f4, 0x0fc4 }, + { 0x8900, 0x03f7, 0x2001 }, + { 0x1900, 0x03f6, 0x0000 }, + { 0x0500, 0x03f8, 0x0fff }, + { 0x8900, 0x0401, 0x3050 }, + { 0x8500, 0x03fb, 0x2fff }, + { 0x0900, 0x03fa, 0x0001 }, + { 0x0900, 0x0400, 0x0050 }, + { 0x8900, 0x0403, 0x2050 }, + { 0x0900, 0x0402, 0x0050 }, + { 0x0900, 0x0404, 0x0050 }, + { 0x8900, 0x040d, 0x4050 }, + { 0x8900, 0x0409, 0x3050 }, + { 0x8900, 0x0407, 0x2050 }, + { 0x0900, 0x0406, 0x0050 }, + { 0x0900, 0x0408, 0x0050 }, + { 0x8900, 0x040b, 0x2050 }, + { 0x0900, 0x040a, 0x0050 }, + { 0x0900, 0x040c, 0x0050 }, + { 0x8900, 0x0411, 0x3020 }, + { 0x8900, 0x040f, 0x2050 }, + { 0x0900, 0x040e, 0x0050 }, + { 0x0900, 0x0410, 0x0020 }, + { 0x8900, 0x0413, 0x2020 }, + { 0x0900, 0x0412, 0x0020 }, + { 0x0900, 0x0414, 0x0020 }, + { 0x8900, 0x0425, 0x5020 }, + { 0x8900, 0x041d, 0x4020 }, + { 0x8900, 0x0419, 0x3020 }, + { 0x8900, 0x0417, 0x2020 }, + { 0x0900, 0x0416, 0x0020 }, + { 0x0900, 0x0418, 0x0020 }, + { 0x8900, 0x041b, 0x2020 }, + { 0x0900, 0x041a, 0x0020 }, + { 0x0900, 0x041c, 0x0020 }, + { 0x8900, 0x0421, 0x3020 }, + { 0x8900, 0x041f, 0x2020 }, + { 0x0900, 0x041e, 0x0020 }, + { 0x0900, 0x0420, 0x0020 }, + { 0x8900, 0x0423, 0x2020 }, + { 0x0900, 0x0422, 0x0020 }, + { 0x0900, 0x0424, 0x0020 }, + { 0x8900, 0x042d, 0x4020 }, + { 0x8900, 0x0429, 0x3020 }, + { 0x8900, 0x0427, 0x2020 }, + { 0x0900, 0x0426, 0x0020 }, + { 0x0900, 0x0428, 0x0020 }, + { 0x8900, 0x042b, 0x2020 }, + { 0x0900, 0x042a, 0x0020 }, + { 0x0900, 0x042c, 0x0020 }, + { 0x8500, 0x0431, 0x3fe0 }, + { 0x8900, 0x042f, 0x2020 }, + { 0x0900, 0x042e, 0x0020 }, + { 0x0500, 0x0430, 0x0fe0 }, + { 0x8500, 0x0433, 0x2fe0 }, + { 0x0500, 0x0432, 0x0fe0 }, + { 0x0500, 0x0434, 0x0fe0 }, + { 0x8700, 0x06a4, 0xa000 }, + { 0x8500, 0x0563, 0x9fd0 }, + { 0x8900, 0x04b6, 0x8001 }, + { 0x8500, 0x0475, 0x7fff }, + { 0x8500, 0x0455, 0x6fb0 }, + { 0x8500, 0x0445, 0x5fe0 }, + { 0x8500, 0x043d, 0x4fe0 }, + { 0x8500, 0x0439, 0x3fe0 }, + { 0x8500, 0x0437, 0x2fe0 }, + { 0x0500, 0x0436, 0x0fe0 }, + { 0x0500, 0x0438, 0x0fe0 }, + { 0x8500, 0x043b, 0x2fe0 }, + { 0x0500, 0x043a, 0x0fe0 }, + { 0x0500, 0x043c, 0x0fe0 }, + { 0x8500, 0x0441, 0x3fe0 }, + { 0x8500, 0x043f, 0x2fe0 }, + { 0x0500, 0x043e, 0x0fe0 }, + { 0x0500, 0x0440, 0x0fe0 }, + { 0x8500, 0x0443, 0x2fe0 }, + { 0x0500, 0x0442, 0x0fe0 }, + { 0x0500, 0x0444, 0x0fe0 }, + { 0x8500, 0x044d, 0x4fe0 }, + { 0x8500, 0x0449, 0x3fe0 }, + { 0x8500, 0x0447, 0x2fe0 }, + { 0x0500, 0x0446, 0x0fe0 }, + { 0x0500, 0x0448, 0x0fe0 }, + { 0x8500, 0x044b, 0x2fe0 }, + { 0x0500, 0x044a, 0x0fe0 }, + { 0x0500, 0x044c, 0x0fe0 }, + { 0x8500, 0x0451, 0x3fb0 }, + { 0x8500, 0x044f, 0x2fe0 }, + { 0x0500, 0x044e, 0x0fe0 }, + { 0x0500, 0x0450, 0x0fb0 }, + { 0x8500, 0x0453, 0x2fb0 }, + { 0x0500, 0x0452, 0x0fb0 }, + { 0x0500, 0x0454, 0x0fb0 }, + { 0x8500, 0x0465, 0x5fff }, + { 0x8500, 0x045d, 0x4fb0 }, + { 0x8500, 0x0459, 0x3fb0 }, + { 0x8500, 0x0457, 0x2fb0 }, + { 0x0500, 0x0456, 0x0fb0 }, + { 0x0500, 0x0458, 0x0fb0 }, + { 0x8500, 0x045b, 0x2fb0 }, + { 0x0500, 0x045a, 0x0fb0 }, + { 0x0500, 0x045c, 0x0fb0 }, + { 0x8500, 0x0461, 0x3fff }, + { 0x8500, 0x045f, 0x2fb0 }, + { 0x0500, 0x045e, 0x0fb0 }, + { 0x0900, 0x0460, 0x0001 }, + { 0x8500, 0x0463, 0x2fff }, + { 0x0900, 0x0462, 0x0001 }, + { 0x0900, 0x0464, 0x0001 }, + { 0x8500, 0x046d, 0x4fff }, + { 0x8500, 0x0469, 0x3fff }, + { 0x8500, 0x0467, 0x2fff }, + { 0x0900, 0x0466, 0x0001 }, + { 0x0900, 0x0468, 0x0001 }, + { 0x8500, 0x046b, 0x2fff }, + { 0x0900, 0x046a, 0x0001 }, + { 0x0900, 0x046c, 0x0001 }, + { 0x8500, 0x0471, 0x3fff }, + { 0x8500, 0x046f, 0x2fff }, + { 0x0900, 0x046e, 0x0001 }, + { 0x0900, 0x0470, 0x0001 }, + { 0x8500, 0x0473, 0x2fff }, + { 0x0900, 0x0472, 0x0001 }, + { 0x0900, 0x0474, 0x0001 }, + { 0x8900, 0x0496, 0x6001 }, + { 0x8c00, 0x0485, 0x5000 }, + { 0x8500, 0x047d, 0x4fff }, + { 0x8500, 0x0479, 0x3fff }, + { 0x8500, 0x0477, 0x2fff }, + { 0x0900, 0x0476, 0x0001 }, + { 0x0900, 0x0478, 0x0001 }, + { 0x8500, 0x047b, 0x2fff }, + { 0x0900, 0x047a, 0x0001 }, + { 0x0900, 0x047c, 0x0001 }, + { 0x8500, 0x0481, 0x3fff }, + { 0x8500, 0x047f, 0x2fff }, + { 0x0900, 0x047e, 0x0001 }, + { 0x0900, 0x0480, 0x0001 }, + { 0x8c00, 0x0483, 0x2000 }, + { 0x1a00, 0x0482, 0x0000 }, + { 0x0c00, 0x0484, 0x0000 }, + { 0x8900, 0x048e, 0x4001 }, + { 0x8900, 0x048a, 0x3001 }, + { 0x8b00, 0x0488, 0x2000 }, + { 0x0c00, 0x0486, 0x0000 }, + { 0x0b00, 0x0489, 0x0000 }, + { 0x8900, 0x048c, 0x2001 }, + { 0x0500, 0x048b, 0x0fff }, + { 0x0500, 0x048d, 0x0fff }, + { 0x8900, 0x0492, 0x3001 }, + { 0x8900, 0x0490, 0x2001 }, + { 0x0500, 0x048f, 0x0fff }, + { 0x0500, 0x0491, 0x0fff }, + { 0x8900, 0x0494, 0x2001 }, + { 0x0500, 0x0493, 0x0fff }, + { 0x0500, 0x0495, 0x0fff }, + { 0x8900, 0x04a6, 0x5001 }, + { 0x8900, 0x049e, 0x4001 }, + { 0x8900, 0x049a, 0x3001 }, + { 0x8900, 0x0498, 0x2001 }, + { 0x0500, 0x0497, 0x0fff }, + { 0x0500, 0x0499, 0x0fff }, + { 0x8900, 0x049c, 0x2001 }, + { 0x0500, 0x049b, 0x0fff }, + { 0x0500, 0x049d, 0x0fff }, + { 0x8900, 0x04a2, 0x3001 }, + { 0x8900, 0x04a0, 0x2001 }, + { 0x0500, 0x049f, 0x0fff }, + { 0x0500, 0x04a1, 0x0fff }, + { 0x8900, 0x04a4, 0x2001 }, + { 0x0500, 0x04a3, 0x0fff }, + { 0x0500, 0x04a5, 0x0fff }, + { 0x8900, 0x04ae, 0x4001 }, + { 0x8900, 0x04aa, 0x3001 }, + { 0x8900, 0x04a8, 0x2001 }, + { 0x0500, 0x04a7, 0x0fff }, + { 0x0500, 0x04a9, 0x0fff }, + { 0x8900, 0x04ac, 0x2001 }, + { 0x0500, 0x04ab, 0x0fff }, + { 0x0500, 0x04ad, 0x0fff }, + { 0x8900, 0x04b2, 0x3001 }, + { 0x8900, 0x04b0, 0x2001 }, + { 0x0500, 0x04af, 0x0fff }, + { 0x0500, 0x04b1, 0x0fff }, + { 0x8900, 0x04b4, 0x2001 }, + { 0x0500, 0x04b3, 0x0fff }, + { 0x0500, 0x04b5, 0x0fff }, + { 0x8500, 0x04f9, 0x7fff }, + { 0x8500, 0x04d7, 0x6fff }, + { 0x8500, 0x04c6, 0x5fff }, + { 0x8900, 0x04be, 0x4001 }, + { 0x8900, 0x04ba, 0x3001 }, + { 0x8900, 0x04b8, 0x2001 }, + { 0x0500, 0x04b7, 0x0fff }, + { 0x0500, 0x04b9, 0x0fff }, + { 0x8900, 0x04bc, 0x2001 }, + { 0x0500, 0x04bb, 0x0fff }, + { 0x0500, 0x04bd, 0x0fff }, + { 0x8500, 0x04c2, 0x3fff }, + { 0x8900, 0x04c0, 0x2000 }, + { 0x0500, 0x04bf, 0x0fff }, + { 0x0900, 0x04c1, 0x0001 }, + { 0x8500, 0x04c4, 0x2fff }, + { 0x0900, 0x04c3, 0x0001 }, + { 0x0900, 0x04c5, 0x0001 }, + { 0x8500, 0x04ce, 0x4fff }, + { 0x8500, 0x04ca, 0x3fff }, + { 0x8500, 0x04c8, 0x2fff }, + { 0x0900, 0x04c7, 0x0001 }, + { 0x0900, 0x04c9, 0x0001 }, + { 0x8500, 0x04cc, 0x2fff }, + { 0x0900, 0x04cb, 0x0001 }, + { 0x0900, 0x04cd, 0x0001 }, + { 0x8500, 0x04d3, 0x3fff }, + { 0x8500, 0x04d1, 0x2fff }, + { 0x0900, 0x04d0, 0x0001 }, + { 0x0900, 0x04d2, 0x0001 }, + { 0x8500, 0x04d5, 0x2fff }, + { 0x0900, 0x04d4, 0x0001 }, + { 0x0900, 0x04d6, 0x0001 }, + { 0x8500, 0x04e7, 0x5fff }, + { 0x8500, 0x04df, 0x4fff }, + { 0x8500, 0x04db, 0x3fff }, + { 0x8500, 0x04d9, 0x2fff }, + { 0x0900, 0x04d8, 0x0001 }, + { 0x0900, 0x04da, 0x0001 }, + { 0x8500, 0x04dd, 0x2fff }, + { 0x0900, 0x04dc, 0x0001 }, + { 0x0900, 0x04de, 0x0001 }, + { 0x8500, 0x04e3, 0x3fff }, + { 0x8500, 0x04e1, 0x2fff }, + { 0x0900, 0x04e0, 0x0001 }, + { 0x0900, 0x04e2, 0x0001 }, + { 0x8500, 0x04e5, 0x2fff }, + { 0x0900, 0x04e4, 0x0001 }, + { 0x0900, 0x04e6, 0x0001 }, + { 0x8500, 0x04ef, 0x4fff }, + { 0x8500, 0x04eb, 0x3fff }, + { 0x8500, 0x04e9, 0x2fff }, + { 0x0900, 0x04e8, 0x0001 }, + { 0x0900, 0x04ea, 0x0001 }, + { 0x8500, 0x04ed, 0x2fff }, + { 0x0900, 0x04ec, 0x0001 }, + { 0x0900, 0x04ee, 0x0001 }, + { 0x8500, 0x04f3, 0x3fff }, + { 0x8500, 0x04f1, 0x2fff }, + { 0x0900, 0x04f0, 0x0001 }, + { 0x0900, 0x04f2, 0x0001 }, + { 0x8500, 0x04f5, 0x2fff }, + { 0x0900, 0x04f4, 0x0001 }, + { 0x0900, 0x04f8, 0x0001 }, + { 0x8900, 0x0540, 0x6030 }, + { 0x8500, 0x050f, 0x5fff }, + { 0x8500, 0x0507, 0x4fff }, + { 0x8500, 0x0503, 0x3fff }, + { 0x8500, 0x0501, 0x2fff }, + { 0x0900, 0x0500, 0x0001 }, + { 0x0900, 0x0502, 0x0001 }, + { 0x8500, 0x0505, 0x2fff }, + { 0x0900, 0x0504, 0x0001 }, + { 0x0900, 0x0506, 0x0001 }, + { 0x8500, 0x050b, 0x3fff }, + { 0x8500, 0x0509, 0x2fff }, + { 0x0900, 0x0508, 0x0001 }, + { 0x0900, 0x050a, 0x0001 }, + { 0x8500, 0x050d, 0x2fff }, + { 0x0900, 0x050c, 0x0001 }, + { 0x0900, 0x050e, 0x0001 }, + { 0x8900, 0x0538, 0x4030 }, + { 0x8900, 0x0534, 0x3030 }, + { 0x8900, 0x0532, 0x2030 }, + { 0x0900, 0x0531, 0x0030 }, + { 0x0900, 0x0533, 0x0030 }, + { 0x8900, 0x0536, 0x2030 }, + { 0x0900, 0x0535, 0x0030 }, + { 0x0900, 0x0537, 0x0030 }, + { 0x8900, 0x053c, 0x3030 }, + { 0x8900, 0x053a, 0x2030 }, + { 0x0900, 0x0539, 0x0030 }, + { 0x0900, 0x053b, 0x0030 }, + { 0x8900, 0x053e, 0x2030 }, + { 0x0900, 0x053d, 0x0030 }, + { 0x0900, 0x053f, 0x0030 }, + { 0x8900, 0x0550, 0x5030 }, + { 0x8900, 0x0548, 0x4030 }, + { 0x8900, 0x0544, 0x3030 }, + { 0x8900, 0x0542, 0x2030 }, + { 0x0900, 0x0541, 0x0030 }, + { 0x0900, 0x0543, 0x0030 }, + { 0x8900, 0x0546, 0x2030 }, + { 0x0900, 0x0545, 0x0030 }, + { 0x0900, 0x0547, 0x0030 }, + { 0x8900, 0x054c, 0x3030 }, + { 0x8900, 0x054a, 0x2030 }, + { 0x0900, 0x0549, 0x0030 }, + { 0x0900, 0x054b, 0x0030 }, + { 0x8900, 0x054e, 0x2030 }, + { 0x0900, 0x054d, 0x0030 }, + { 0x0900, 0x054f, 0x0030 }, + { 0x9500, 0x055a, 0x4000 }, + { 0x8900, 0x0554, 0x3030 }, + { 0x8900, 0x0552, 0x2030 }, + { 0x0900, 0x0551, 0x0030 }, + { 0x0900, 0x0553, 0x0030 }, + { 0x8900, 0x0556, 0x2030 }, + { 0x0900, 0x0555, 0x0030 }, + { 0x0600, 0x0559, 0x0000 }, + { 0x9500, 0x055e, 0x3000 }, + { 0x9500, 0x055c, 0x2000 }, + { 0x1500, 0x055b, 0x0000 }, + { 0x1500, 0x055d, 0x0000 }, + { 0x8500, 0x0561, 0x2fd0 }, + { 0x1500, 0x055f, 0x0000 }, + { 0x0500, 0x0562, 0x0fd0 }, + { 0x9a00, 0x060f, 0x8000 }, + { 0x8c00, 0x05ab, 0x7000 }, + { 0x8500, 0x0583, 0x6fd0 }, + { 0x8500, 0x0573, 0x5fd0 }, + { 0x8500, 0x056b, 0x4fd0 }, + { 0x8500, 0x0567, 0x3fd0 }, + { 0x8500, 0x0565, 0x2fd0 }, + { 0x0500, 0x0564, 0x0fd0 }, + { 0x0500, 0x0566, 0x0fd0 }, + { 0x8500, 0x0569, 0x2fd0 }, + { 0x0500, 0x0568, 0x0fd0 }, + { 0x0500, 0x056a, 0x0fd0 }, + { 0x8500, 0x056f, 0x3fd0 }, + { 0x8500, 0x056d, 0x2fd0 }, + { 0x0500, 0x056c, 0x0fd0 }, + { 0x0500, 0x056e, 0x0fd0 }, + { 0x8500, 0x0571, 0x2fd0 }, + { 0x0500, 0x0570, 0x0fd0 }, + { 0x0500, 0x0572, 0x0fd0 }, + { 0x8500, 0x057b, 0x4fd0 }, + { 0x8500, 0x0577, 0x3fd0 }, + { 0x8500, 0x0575, 0x2fd0 }, + { 0x0500, 0x0574, 0x0fd0 }, + { 0x0500, 0x0576, 0x0fd0 }, + { 0x8500, 0x0579, 0x2fd0 }, + { 0x0500, 0x0578, 0x0fd0 }, + { 0x0500, 0x057a, 0x0fd0 }, + { 0x8500, 0x057f, 0x3fd0 }, + { 0x8500, 0x057d, 0x2fd0 }, + { 0x0500, 0x057c, 0x0fd0 }, + { 0x0500, 0x057e, 0x0fd0 }, + { 0x8500, 0x0581, 0x2fd0 }, + { 0x0500, 0x0580, 0x0fd0 }, + { 0x0500, 0x0582, 0x0fd0 }, + { 0x8c00, 0x059a, 0x5000 }, + { 0x8c00, 0x0592, 0x4000 }, + { 0x8500, 0x0587, 0x3000 }, + { 0x8500, 0x0585, 0x2fd0 }, + { 0x0500, 0x0584, 0x0fd0 }, + { 0x0500, 0x0586, 0x0fd0 }, + { 0x9100, 0x058a, 0x2000 }, + { 0x1500, 0x0589, 0x0000 }, + { 0x0c00, 0x0591, 0x0000 }, + { 0x8c00, 0x0596, 0x3000 }, + { 0x8c00, 0x0594, 0x2000 }, + { 0x0c00, 0x0593, 0x0000 }, + { 0x0c00, 0x0595, 0x0000 }, + { 0x8c00, 0x0598, 0x2000 }, + { 0x0c00, 0x0597, 0x0000 }, + { 0x0c00, 0x0599, 0x0000 }, + { 0x8c00, 0x05a3, 0x4000 }, + { 0x8c00, 0x059e, 0x3000 }, + { 0x8c00, 0x059c, 0x2000 }, + { 0x0c00, 0x059b, 0x0000 }, + { 0x0c00, 0x059d, 0x0000 }, + { 0x8c00, 0x05a0, 0x2000 }, + { 0x0c00, 0x059f, 0x0000 }, + { 0x0c00, 0x05a1, 0x0000 }, + { 0x8c00, 0x05a7, 0x3000 }, + { 0x8c00, 0x05a5, 0x2000 }, + { 0x0c00, 0x05a4, 0x0000 }, + { 0x0c00, 0x05a6, 0x0000 }, + { 0x8c00, 0x05a9, 0x2000 }, + { 0x0c00, 0x05a8, 0x0000 }, + { 0x0c00, 0x05aa, 0x0000 }, + { 0x8700, 0x05d7, 0x6000 }, + { 0x8c00, 0x05bc, 0x5000 }, + { 0x8c00, 0x05b3, 0x4000 }, + { 0x8c00, 0x05af, 0x3000 }, + { 0x8c00, 0x05ad, 0x2000 }, + { 0x0c00, 0x05ac, 0x0000 }, + { 0x0c00, 0x05ae, 0x0000 }, + { 0x8c00, 0x05b1, 0x2000 }, + { 0x0c00, 0x05b0, 0x0000 }, + { 0x0c00, 0x05b2, 0x0000 }, + { 0x8c00, 0x05b7, 0x3000 }, + { 0x8c00, 0x05b5, 0x2000 }, + { 0x0c00, 0x05b4, 0x0000 }, + { 0x0c00, 0x05b6, 0x0000 }, + { 0x8c00, 0x05b9, 0x2000 }, + { 0x0c00, 0x05b8, 0x0000 }, + { 0x0c00, 0x05bb, 0x0000 }, + { 0x8c00, 0x05c4, 0x4000 }, + { 0x9500, 0x05c0, 0x3000 }, + { 0x9500, 0x05be, 0x2000 }, + { 0x0c00, 0x05bd, 0x0000 }, + { 0x0c00, 0x05bf, 0x0000 }, + { 0x8c00, 0x05c2, 0x2000 }, + { 0x0c00, 0x05c1, 0x0000 }, + { 0x1500, 0x05c3, 0x0000 }, + { 0x8700, 0x05d3, 0x3000 }, + { 0x8700, 0x05d1, 0x2000 }, + { 0x0700, 0x05d0, 0x0000 }, + { 0x0700, 0x05d2, 0x0000 }, + { 0x8700, 0x05d5, 0x2000 }, + { 0x0700, 0x05d4, 0x0000 }, + { 0x0700, 0x05d6, 0x0000 }, + { 0x8700, 0x05e7, 0x5000 }, + { 0x8700, 0x05df, 0x4000 }, + { 0x8700, 0x05db, 0x3000 }, + { 0x8700, 0x05d9, 0x2000 }, + { 0x0700, 0x05d8, 0x0000 }, + { 0x0700, 0x05da, 0x0000 }, + { 0x8700, 0x05dd, 0x2000 }, + { 0x0700, 0x05dc, 0x0000 }, + { 0x0700, 0x05de, 0x0000 }, + { 0x8700, 0x05e3, 0x3000 }, + { 0x8700, 0x05e1, 0x2000 }, + { 0x0700, 0x05e0, 0x0000 }, + { 0x0700, 0x05e2, 0x0000 }, + { 0x8700, 0x05e5, 0x2000 }, + { 0x0700, 0x05e4, 0x0000 }, + { 0x0700, 0x05e6, 0x0000 }, + { 0x9500, 0x05f4, 0x4000 }, + { 0x8700, 0x05f0, 0x3000 }, + { 0x8700, 0x05e9, 0x2000 }, + { 0x0700, 0x05e8, 0x0000 }, + { 0x0700, 0x05ea, 0x0000 }, + { 0x8700, 0x05f2, 0x2000 }, + { 0x0700, 0x05f1, 0x0000 }, + { 0x1500, 0x05f3, 0x0000 }, + { 0x8100, 0x0603, 0x3000 }, + { 0x8100, 0x0601, 0x2000 }, + { 0x0100, 0x0600, 0x0000 }, + { 0x0100, 0x0602, 0x0000 }, + { 0x9500, 0x060d, 0x2000 }, + { 0x1500, 0x060c, 0x0000 }, + { 0x1a00, 0x060e, 0x0000 }, + { 0x8d00, 0x0664, 0x7000 }, + { 0x8700, 0x0638, 0x6000 }, + { 0x8700, 0x0628, 0x5000 }, + { 0x9500, 0x061f, 0x4000 }, + { 0x8c00, 0x0613, 0x3000 }, + { 0x8c00, 0x0611, 0x2000 }, + { 0x0c00, 0x0610, 0x0000 }, + { 0x0c00, 0x0612, 0x0000 }, + { 0x8c00, 0x0615, 0x2000 }, + { 0x0c00, 0x0614, 0x0000 }, + { 0x1500, 0x061b, 0x0000 }, + { 0x8700, 0x0624, 0x3000 }, + { 0x8700, 0x0622, 0x2000 }, + { 0x0700, 0x0621, 0x0000 }, + { 0x0700, 0x0623, 0x0000 }, + { 0x8700, 0x0626, 0x2000 }, + { 0x0700, 0x0625, 0x0000 }, + { 0x0700, 0x0627, 0x0000 }, + { 0x8700, 0x0630, 0x4000 }, + { 0x8700, 0x062c, 0x3000 }, + { 0x8700, 0x062a, 0x2000 }, + { 0x0700, 0x0629, 0x0000 }, + { 0x0700, 0x062b, 0x0000 }, + { 0x8700, 0x062e, 0x2000 }, + { 0x0700, 0x062d, 0x0000 }, + { 0x0700, 0x062f, 0x0000 }, + { 0x8700, 0x0634, 0x3000 }, + { 0x8700, 0x0632, 0x2000 }, + { 0x0700, 0x0631, 0x0000 }, + { 0x0700, 0x0633, 0x0000 }, + { 0x8700, 0x0636, 0x2000 }, + { 0x0700, 0x0635, 0x0000 }, + { 0x0700, 0x0637, 0x0000 }, + { 0x8c00, 0x064d, 0x5000 }, + { 0x8700, 0x0645, 0x4000 }, + { 0x8700, 0x0641, 0x3000 }, + { 0x8700, 0x063a, 0x2000 }, + { 0x0700, 0x0639, 0x0000 }, + { 0x0600, 0x0640, 0x0000 }, + { 0x8700, 0x0643, 0x2000 }, + { 0x0700, 0x0642, 0x0000 }, + { 0x0700, 0x0644, 0x0000 }, + { 0x8700, 0x0649, 0x3000 }, + { 0x8700, 0x0647, 0x2000 }, + { 0x0700, 0x0646, 0x0000 }, + { 0x0700, 0x0648, 0x0000 }, + { 0x8c00, 0x064b, 0x2000 }, + { 0x0700, 0x064a, 0x0000 }, + { 0x0c00, 0x064c, 0x0000 }, + { 0x8c00, 0x0655, 0x4000 }, + { 0x8c00, 0x0651, 0x3000 }, + { 0x8c00, 0x064f, 0x2000 }, + { 0x0c00, 0x064e, 0x0000 }, + { 0x0c00, 0x0650, 0x0000 }, + { 0x8c00, 0x0653, 0x2000 }, + { 0x0c00, 0x0652, 0x0000 }, + { 0x0c00, 0x0654, 0x0000 }, + { 0x8d00, 0x0660, 0x3000 }, + { 0x8c00, 0x0657, 0x2000 }, + { 0x0c00, 0x0656, 0x0000 }, + { 0x0c00, 0x0658, 0x0000 }, + { 0x8d00, 0x0662, 0x2000 }, + { 0x0d00, 0x0661, 0x0000 }, + { 0x0d00, 0x0663, 0x0000 }, + { 0x8700, 0x0684, 0x6000 }, + { 0x8700, 0x0674, 0x5000 }, + { 0x9500, 0x066c, 0x4000 }, + { 0x8d00, 0x0668, 0x3000 }, + { 0x8d00, 0x0666, 0x2000 }, + { 0x0d00, 0x0665, 0x0000 }, + { 0x0d00, 0x0667, 0x0000 }, + { 0x9500, 0x066a, 0x2000 }, + { 0x0d00, 0x0669, 0x0000 }, + { 0x1500, 0x066b, 0x0000 }, + { 0x8c00, 0x0670, 0x3000 }, + { 0x8700, 0x066e, 0x2000 }, + { 0x1500, 0x066d, 0x0000 }, + { 0x0700, 0x066f, 0x0000 }, + { 0x8700, 0x0672, 0x2000 }, + { 0x0700, 0x0671, 0x0000 }, + { 0x0700, 0x0673, 0x0000 }, + { 0x8700, 0x067c, 0x4000 }, + { 0x8700, 0x0678, 0x3000 }, + { 0x8700, 0x0676, 0x2000 }, + { 0x0700, 0x0675, 0x0000 }, + { 0x0700, 0x0677, 0x0000 }, + { 0x8700, 0x067a, 0x2000 }, + { 0x0700, 0x0679, 0x0000 }, + { 0x0700, 0x067b, 0x0000 }, + { 0x8700, 0x0680, 0x3000 }, + { 0x8700, 0x067e, 0x2000 }, + { 0x0700, 0x067d, 0x0000 }, + { 0x0700, 0x067f, 0x0000 }, + { 0x8700, 0x0682, 0x2000 }, + { 0x0700, 0x0681, 0x0000 }, + { 0x0700, 0x0683, 0x0000 }, + { 0x8700, 0x0694, 0x5000 }, + { 0x8700, 0x068c, 0x4000 }, + { 0x8700, 0x0688, 0x3000 }, + { 0x8700, 0x0686, 0x2000 }, + { 0x0700, 0x0685, 0x0000 }, + { 0x0700, 0x0687, 0x0000 }, + { 0x8700, 0x068a, 0x2000 }, + { 0x0700, 0x0689, 0x0000 }, + { 0x0700, 0x068b, 0x0000 }, + { 0x8700, 0x0690, 0x3000 }, + { 0x8700, 0x068e, 0x2000 }, + { 0x0700, 0x068d, 0x0000 }, + { 0x0700, 0x068f, 0x0000 }, + { 0x8700, 0x0692, 0x2000 }, + { 0x0700, 0x0691, 0x0000 }, + { 0x0700, 0x0693, 0x0000 }, + { 0x8700, 0x069c, 0x4000 }, + { 0x8700, 0x0698, 0x3000 }, + { 0x8700, 0x0696, 0x2000 }, + { 0x0700, 0x0695, 0x0000 }, + { 0x0700, 0x0697, 0x0000 }, + { 0x8700, 0x069a, 0x2000 }, + { 0x0700, 0x0699, 0x0000 }, + { 0x0700, 0x069b, 0x0000 }, + { 0x8700, 0x06a0, 0x3000 }, + { 0x8700, 0x069e, 0x2000 }, + { 0x0700, 0x069d, 0x0000 }, + { 0x0700, 0x069f, 0x0000 }, + { 0x8700, 0x06a2, 0x2000 }, + { 0x0700, 0x06a1, 0x0000 }, + { 0x0700, 0x06a3, 0x0000 }, + { 0x8700, 0x0926, 0x9000 }, + { 0x8700, 0x0725, 0x8000 }, + { 0x8c00, 0x06e4, 0x7000 }, + { 0x8700, 0x06c4, 0x6000 }, + { 0x8700, 0x06b4, 0x5000 }, + { 0x8700, 0x06ac, 0x4000 }, + { 0x8700, 0x06a8, 0x3000 }, + { 0x8700, 0x06a6, 0x2000 }, + { 0x0700, 0x06a5, 0x0000 }, + { 0x0700, 0x06a7, 0x0000 }, + { 0x8700, 0x06aa, 0x2000 }, + { 0x0700, 0x06a9, 0x0000 }, + { 0x0700, 0x06ab, 0x0000 }, + { 0x8700, 0x06b0, 0x3000 }, + { 0x8700, 0x06ae, 0x2000 }, + { 0x0700, 0x06ad, 0x0000 }, + { 0x0700, 0x06af, 0x0000 }, + { 0x8700, 0x06b2, 0x2000 }, + { 0x0700, 0x06b1, 0x0000 }, + { 0x0700, 0x06b3, 0x0000 }, + { 0x8700, 0x06bc, 0x4000 }, + { 0x8700, 0x06b8, 0x3000 }, + { 0x8700, 0x06b6, 0x2000 }, + { 0x0700, 0x06b5, 0x0000 }, + { 0x0700, 0x06b7, 0x0000 }, + { 0x8700, 0x06ba, 0x2000 }, + { 0x0700, 0x06b9, 0x0000 }, + { 0x0700, 0x06bb, 0x0000 }, + { 0x8700, 0x06c0, 0x3000 }, + { 0x8700, 0x06be, 0x2000 }, + { 0x0700, 0x06bd, 0x0000 }, + { 0x0700, 0x06bf, 0x0000 }, + { 0x8700, 0x06c2, 0x2000 }, + { 0x0700, 0x06c1, 0x0000 }, + { 0x0700, 0x06c3, 0x0000 }, + { 0x9500, 0x06d4, 0x5000 }, + { 0x8700, 0x06cc, 0x4000 }, + { 0x8700, 0x06c8, 0x3000 }, + { 0x8700, 0x06c6, 0x2000 }, + { 0x0700, 0x06c5, 0x0000 }, + { 0x0700, 0x06c7, 0x0000 }, + { 0x8700, 0x06ca, 0x2000 }, + { 0x0700, 0x06c9, 0x0000 }, + { 0x0700, 0x06cb, 0x0000 }, + { 0x8700, 0x06d0, 0x3000 }, + { 0x8700, 0x06ce, 0x2000 }, + { 0x0700, 0x06cd, 0x0000 }, + { 0x0700, 0x06cf, 0x0000 }, + { 0x8700, 0x06d2, 0x2000 }, + { 0x0700, 0x06d1, 0x0000 }, + { 0x0700, 0x06d3, 0x0000 }, + { 0x8c00, 0x06dc, 0x4000 }, + { 0x8c00, 0x06d8, 0x3000 }, + { 0x8c00, 0x06d6, 0x2000 }, + { 0x0700, 0x06d5, 0x0000 }, + { 0x0c00, 0x06d7, 0x0000 }, + { 0x8c00, 0x06da, 0x2000 }, + { 0x0c00, 0x06d9, 0x0000 }, + { 0x0c00, 0x06db, 0x0000 }, + { 0x8c00, 0x06e0, 0x3000 }, + { 0x8b00, 0x06de, 0x2000 }, + { 0x0100, 0x06dd, 0x0000 }, + { 0x0c00, 0x06df, 0x0000 }, + { 0x8c00, 0x06e2, 0x2000 }, + { 0x0c00, 0x06e1, 0x0000 }, + { 0x0c00, 0x06e3, 0x0000 }, + { 0x9500, 0x0704, 0x6000 }, + { 0x8d00, 0x06f4, 0x5000 }, + { 0x8c00, 0x06ec, 0x4000 }, + { 0x8c00, 0x06e8, 0x3000 }, + { 0x8600, 0x06e6, 0x2000 }, + { 0x0600, 0x06e5, 0x0000 }, + { 0x0c00, 0x06e7, 0x0000 }, + { 0x8c00, 0x06ea, 0x2000 }, + { 0x1a00, 0x06e9, 0x0000 }, + { 0x0c00, 0x06eb, 0x0000 }, + { 0x8d00, 0x06f0, 0x3000 }, + { 0x8700, 0x06ee, 0x2000 }, + { 0x0c00, 0x06ed, 0x0000 }, + { 0x0700, 0x06ef, 0x0000 }, + { 0x8d00, 0x06f2, 0x2000 }, + { 0x0d00, 0x06f1, 0x0000 }, + { 0x0d00, 0x06f3, 0x0000 }, + { 0x8700, 0x06fc, 0x4000 }, + { 0x8d00, 0x06f8, 0x3000 }, + { 0x8d00, 0x06f6, 0x2000 }, + { 0x0d00, 0x06f5, 0x0000 }, + { 0x0d00, 0x06f7, 0x0000 }, + { 0x8700, 0x06fa, 0x2000 }, + { 0x0d00, 0x06f9, 0x0000 }, + { 0x0700, 0x06fb, 0x0000 }, + { 0x9500, 0x0700, 0x3000 }, + { 0x9a00, 0x06fe, 0x2000 }, + { 0x1a00, 0x06fd, 0x0000 }, + { 0x0700, 0x06ff, 0x0000 }, + { 0x9500, 0x0702, 0x2000 }, + { 0x1500, 0x0701, 0x0000 }, + { 0x1500, 0x0703, 0x0000 }, + { 0x8700, 0x0715, 0x5000 }, + { 0x9500, 0x070c, 0x4000 }, + { 0x9500, 0x0708, 0x3000 }, + { 0x9500, 0x0706, 0x2000 }, + { 0x1500, 0x0705, 0x0000 }, + { 0x1500, 0x0707, 0x0000 }, + { 0x9500, 0x070a, 0x2000 }, + { 0x1500, 0x0709, 0x0000 }, + { 0x1500, 0x070b, 0x0000 }, + { 0x8c00, 0x0711, 0x3000 }, + { 0x8100, 0x070f, 0x2000 }, + { 0x1500, 0x070d, 0x0000 }, + { 0x0700, 0x0710, 0x0000 }, + { 0x8700, 0x0713, 0x2000 }, + { 0x0700, 0x0712, 0x0000 }, + { 0x0700, 0x0714, 0x0000 }, + { 0x8700, 0x071d, 0x4000 }, + { 0x8700, 0x0719, 0x3000 }, + { 0x8700, 0x0717, 0x2000 }, + { 0x0700, 0x0716, 0x0000 }, + { 0x0700, 0x0718, 0x0000 }, + { 0x8700, 0x071b, 0x2000 }, + { 0x0700, 0x071a, 0x0000 }, + { 0x0700, 0x071c, 0x0000 }, + { 0x8700, 0x0721, 0x3000 }, + { 0x8700, 0x071f, 0x2000 }, + { 0x0700, 0x071e, 0x0000 }, + { 0x0700, 0x0720, 0x0000 }, + { 0x8700, 0x0723, 0x2000 }, + { 0x0700, 0x0722, 0x0000 }, + { 0x0700, 0x0724, 0x0000 }, + { 0x8700, 0x0797, 0x7000 }, + { 0x8c00, 0x0745, 0x6000 }, + { 0x8c00, 0x0735, 0x5000 }, + { 0x8700, 0x072d, 0x4000 }, + { 0x8700, 0x0729, 0x3000 }, + { 0x8700, 0x0727, 0x2000 }, + { 0x0700, 0x0726, 0x0000 }, + { 0x0700, 0x0728, 0x0000 }, + { 0x8700, 0x072b, 0x2000 }, + { 0x0700, 0x072a, 0x0000 }, + { 0x0700, 0x072c, 0x0000 }, + { 0x8c00, 0x0731, 0x3000 }, + { 0x8700, 0x072f, 0x2000 }, + { 0x0700, 0x072e, 0x0000 }, + { 0x0c00, 0x0730, 0x0000 }, + { 0x8c00, 0x0733, 0x2000 }, + { 0x0c00, 0x0732, 0x0000 }, + { 0x0c00, 0x0734, 0x0000 }, + { 0x8c00, 0x073d, 0x4000 }, + { 0x8c00, 0x0739, 0x3000 }, + { 0x8c00, 0x0737, 0x2000 }, + { 0x0c00, 0x0736, 0x0000 }, + { 0x0c00, 0x0738, 0x0000 }, + { 0x8c00, 0x073b, 0x2000 }, + { 0x0c00, 0x073a, 0x0000 }, + { 0x0c00, 0x073c, 0x0000 }, + { 0x8c00, 0x0741, 0x3000 }, + { 0x8c00, 0x073f, 0x2000 }, + { 0x0c00, 0x073e, 0x0000 }, + { 0x0c00, 0x0740, 0x0000 }, + { 0x8c00, 0x0743, 0x2000 }, + { 0x0c00, 0x0742, 0x0000 }, + { 0x0c00, 0x0744, 0x0000 }, + { 0x8700, 0x0787, 0x5000 }, + { 0x8700, 0x074f, 0x4000 }, + { 0x8c00, 0x0749, 0x3000 }, + { 0x8c00, 0x0747, 0x2000 }, + { 0x0c00, 0x0746, 0x0000 }, + { 0x0c00, 0x0748, 0x0000 }, + { 0x8700, 0x074d, 0x2000 }, + { 0x0c00, 0x074a, 0x0000 }, + { 0x0700, 0x074e, 0x0000 }, + { 0x8700, 0x0783, 0x3000 }, + { 0x8700, 0x0781, 0x2000 }, + { 0x0700, 0x0780, 0x0000 }, + { 0x0700, 0x0782, 0x0000 }, + { 0x8700, 0x0785, 0x2000 }, + { 0x0700, 0x0784, 0x0000 }, + { 0x0700, 0x0786, 0x0000 }, + { 0x8700, 0x078f, 0x4000 }, + { 0x8700, 0x078b, 0x3000 }, + { 0x8700, 0x0789, 0x2000 }, + { 0x0700, 0x0788, 0x0000 }, + { 0x0700, 0x078a, 0x0000 }, + { 0x8700, 0x078d, 0x2000 }, + { 0x0700, 0x078c, 0x0000 }, + { 0x0700, 0x078e, 0x0000 }, + { 0x8700, 0x0793, 0x3000 }, + { 0x8700, 0x0791, 0x2000 }, + { 0x0700, 0x0790, 0x0000 }, + { 0x0700, 0x0792, 0x0000 }, + { 0x8700, 0x0795, 0x2000 }, + { 0x0700, 0x0794, 0x0000 }, + { 0x0700, 0x0796, 0x0000 }, + { 0x8700, 0x0906, 0x6000 }, + { 0x8c00, 0x07a7, 0x5000 }, + { 0x8700, 0x079f, 0x4000 }, + { 0x8700, 0x079b, 0x3000 }, + { 0x8700, 0x0799, 0x2000 }, + { 0x0700, 0x0798, 0x0000 }, + { 0x0700, 0x079a, 0x0000 }, + { 0x8700, 0x079d, 0x2000 }, + { 0x0700, 0x079c, 0x0000 }, + { 0x0700, 0x079e, 0x0000 }, + { 0x8700, 0x07a3, 0x3000 }, + { 0x8700, 0x07a1, 0x2000 }, + { 0x0700, 0x07a0, 0x0000 }, + { 0x0700, 0x07a2, 0x0000 }, + { 0x8700, 0x07a5, 0x2000 }, + { 0x0700, 0x07a4, 0x0000 }, + { 0x0c00, 0x07a6, 0x0000 }, + { 0x8c00, 0x07af, 0x4000 }, + { 0x8c00, 0x07ab, 0x3000 }, + { 0x8c00, 0x07a9, 0x2000 }, + { 0x0c00, 0x07a8, 0x0000 }, + { 0x0c00, 0x07aa, 0x0000 }, + { 0x8c00, 0x07ad, 0x2000 }, + { 0x0c00, 0x07ac, 0x0000 }, + { 0x0c00, 0x07ae, 0x0000 }, + { 0x8c00, 0x0902, 0x3000 }, + { 0x8700, 0x07b1, 0x2000 }, + { 0x0c00, 0x07b0, 0x0000 }, + { 0x0c00, 0x0901, 0x0000 }, + { 0x8700, 0x0904, 0x2000 }, + { 0x0a00, 0x0903, 0x0000 }, + { 0x0700, 0x0905, 0x0000 }, + { 0x8700, 0x0916, 0x5000 }, + { 0x8700, 0x090e, 0x4000 }, + { 0x8700, 0x090a, 0x3000 }, + { 0x8700, 0x0908, 0x2000 }, + { 0x0700, 0x0907, 0x0000 }, + { 0x0700, 0x0909, 0x0000 }, + { 0x8700, 0x090c, 0x2000 }, + { 0x0700, 0x090b, 0x0000 }, + { 0x0700, 0x090d, 0x0000 }, + { 0x8700, 0x0912, 0x3000 }, + { 0x8700, 0x0910, 0x2000 }, + { 0x0700, 0x090f, 0x0000 }, + { 0x0700, 0x0911, 0x0000 }, + { 0x8700, 0x0914, 0x2000 }, + { 0x0700, 0x0913, 0x0000 }, + { 0x0700, 0x0915, 0x0000 }, + { 0x8700, 0x091e, 0x4000 }, + { 0x8700, 0x091a, 0x3000 }, + { 0x8700, 0x0918, 0x2000 }, + { 0x0700, 0x0917, 0x0000 }, + { 0x0700, 0x0919, 0x0000 }, + { 0x8700, 0x091c, 0x2000 }, + { 0x0700, 0x091b, 0x0000 }, + { 0x0700, 0x091d, 0x0000 }, + { 0x8700, 0x0922, 0x3000 }, + { 0x8700, 0x0920, 0x2000 }, + { 0x0700, 0x091f, 0x0000 }, + { 0x0700, 0x0921, 0x0000 }, + { 0x8700, 0x0924, 0x2000 }, + { 0x0700, 0x0923, 0x0000 }, + { 0x0700, 0x0925, 0x0000 }, + { 0x8c00, 0x09cd, 0x8000 }, + { 0x8d00, 0x096d, 0x7000 }, + { 0x8c00, 0x0948, 0x6000 }, + { 0x8700, 0x0936, 0x5000 }, + { 0x8700, 0x092e, 0x4000 }, + { 0x8700, 0x092a, 0x3000 }, + { 0x8700, 0x0928, 0x2000 }, + { 0x0700, 0x0927, 0x0000 }, + { 0x0700, 0x0929, 0x0000 }, + { 0x8700, 0x092c, 0x2000 }, + { 0x0700, 0x092b, 0x0000 }, + { 0x0700, 0x092d, 0x0000 }, + { 0x8700, 0x0932, 0x3000 }, + { 0x8700, 0x0930, 0x2000 }, + { 0x0700, 0x092f, 0x0000 }, + { 0x0700, 0x0931, 0x0000 }, + { 0x8700, 0x0934, 0x2000 }, + { 0x0700, 0x0933, 0x0000 }, + { 0x0700, 0x0935, 0x0000 }, + { 0x8a00, 0x0940, 0x4000 }, + { 0x8c00, 0x093c, 0x3000 }, + { 0x8700, 0x0938, 0x2000 }, + { 0x0700, 0x0937, 0x0000 }, + { 0x0700, 0x0939, 0x0000 }, + { 0x8a00, 0x093e, 0x2000 }, + { 0x0700, 0x093d, 0x0000 }, + { 0x0a00, 0x093f, 0x0000 }, + { 0x8c00, 0x0944, 0x3000 }, + { 0x8c00, 0x0942, 0x2000 }, + { 0x0c00, 0x0941, 0x0000 }, + { 0x0c00, 0x0943, 0x0000 }, + { 0x8c00, 0x0946, 0x2000 }, + { 0x0c00, 0x0945, 0x0000 }, + { 0x0c00, 0x0947, 0x0000 }, + { 0x8700, 0x095d, 0x5000 }, + { 0x8c00, 0x0952, 0x4000 }, + { 0x8a00, 0x094c, 0x3000 }, + { 0x8a00, 0x094a, 0x2000 }, + { 0x0a00, 0x0949, 0x0000 }, + { 0x0a00, 0x094b, 0x0000 }, + { 0x8700, 0x0950, 0x2000 }, + { 0x0c00, 0x094d, 0x0000 }, + { 0x0c00, 0x0951, 0x0000 }, + { 0x8700, 0x0959, 0x3000 }, + { 0x8c00, 0x0954, 0x2000 }, + { 0x0c00, 0x0953, 0x0000 }, + { 0x0700, 0x0958, 0x0000 }, + { 0x8700, 0x095b, 0x2000 }, + { 0x0700, 0x095a, 0x0000 }, + { 0x0700, 0x095c, 0x0000 }, + { 0x9500, 0x0965, 0x4000 }, + { 0x8700, 0x0961, 0x3000 }, + { 0x8700, 0x095f, 0x2000 }, + { 0x0700, 0x095e, 0x0000 }, + { 0x0700, 0x0960, 0x0000 }, + { 0x8c00, 0x0963, 0x2000 }, + { 0x0c00, 0x0962, 0x0000 }, + { 0x1500, 0x0964, 0x0000 }, + { 0x8d00, 0x0969, 0x3000 }, + { 0x8d00, 0x0967, 0x2000 }, + { 0x0d00, 0x0966, 0x0000 }, + { 0x0d00, 0x0968, 0x0000 }, + { 0x8d00, 0x096b, 0x2000 }, + { 0x0d00, 0x096a, 0x0000 }, + { 0x0d00, 0x096c, 0x0000 }, + { 0x8700, 0x09a2, 0x6000 }, + { 0x8700, 0x0990, 0x5000 }, + { 0x8700, 0x0986, 0x4000 }, + { 0x8c00, 0x0981, 0x3000 }, + { 0x8d00, 0x096f, 0x2000 }, + { 0x0d00, 0x096e, 0x0000 }, + { 0x1500, 0x0970, 0x0000 }, + { 0x8a00, 0x0983, 0x2000 }, + { 0x0a00, 0x0982, 0x0000 }, + { 0x0700, 0x0985, 0x0000 }, + { 0x8700, 0x098a, 0x3000 }, + { 0x8700, 0x0988, 0x2000 }, + { 0x0700, 0x0987, 0x0000 }, + { 0x0700, 0x0989, 0x0000 }, + { 0x8700, 0x098c, 0x2000 }, + { 0x0700, 0x098b, 0x0000 }, + { 0x0700, 0x098f, 0x0000 }, + { 0x8700, 0x099a, 0x4000 }, + { 0x8700, 0x0996, 0x3000 }, + { 0x8700, 0x0994, 0x2000 }, + { 0x0700, 0x0993, 0x0000 }, + { 0x0700, 0x0995, 0x0000 }, + { 0x8700, 0x0998, 0x2000 }, + { 0x0700, 0x0997, 0x0000 }, + { 0x0700, 0x0999, 0x0000 }, + { 0x8700, 0x099e, 0x3000 }, + { 0x8700, 0x099c, 0x2000 }, + { 0x0700, 0x099b, 0x0000 }, + { 0x0700, 0x099d, 0x0000 }, + { 0x8700, 0x09a0, 0x2000 }, + { 0x0700, 0x099f, 0x0000 }, + { 0x0700, 0x09a1, 0x0000 }, + { 0x8700, 0x09b7, 0x5000 }, + { 0x8700, 0x09ab, 0x4000 }, + { 0x8700, 0x09a6, 0x3000 }, + { 0x8700, 0x09a4, 0x2000 }, + { 0x0700, 0x09a3, 0x0000 }, + { 0x0700, 0x09a5, 0x0000 }, + { 0x8700, 0x09a8, 0x2000 }, + { 0x0700, 0x09a7, 0x0000 }, + { 0x0700, 0x09aa, 0x0000 }, + { 0x8700, 0x09af, 0x3000 }, + { 0x8700, 0x09ad, 0x2000 }, + { 0x0700, 0x09ac, 0x0000 }, + { 0x0700, 0x09ae, 0x0000 }, + { 0x8700, 0x09b2, 0x2000 }, + { 0x0700, 0x09b0, 0x0000 }, + { 0x0700, 0x09b6, 0x0000 }, + { 0x8c00, 0x09c1, 0x4000 }, + { 0x8700, 0x09bd, 0x3000 }, + { 0x8700, 0x09b9, 0x2000 }, + { 0x0700, 0x09b8, 0x0000 }, + { 0x0c00, 0x09bc, 0x0000 }, + { 0x8a00, 0x09bf, 0x2000 }, + { 0x0a00, 0x09be, 0x0000 }, + { 0x0a00, 0x09c0, 0x0000 }, + { 0x8a00, 0x09c7, 0x3000 }, + { 0x8c00, 0x09c3, 0x2000 }, + { 0x0c00, 0x09c2, 0x0000 }, + { 0x0c00, 0x09c4, 0x0000 }, + { 0x8a00, 0x09cb, 0x2000 }, + { 0x0a00, 0x09c8, 0x0000 }, + { 0x0a00, 0x09cc, 0x0000 }, + { 0x8700, 0x0a2b, 0x7000 }, + { 0x8a00, 0x0a03, 0x6000 }, + { 0x8d00, 0x09ed, 0x5000 }, + { 0x8c00, 0x09e3, 0x4000 }, + { 0x8700, 0x09df, 0x3000 }, + { 0x8700, 0x09dc, 0x2000 }, + { 0x0a00, 0x09d7, 0x0000 }, + { 0x0700, 0x09dd, 0x0000 }, + { 0x8700, 0x09e1, 0x2000 }, + { 0x0700, 0x09e0, 0x0000 }, + { 0x0c00, 0x09e2, 0x0000 }, + { 0x8d00, 0x09e9, 0x3000 }, + { 0x8d00, 0x09e7, 0x2000 }, + { 0x0d00, 0x09e6, 0x0000 }, + { 0x0d00, 0x09e8, 0x0000 }, + { 0x8d00, 0x09eb, 0x2000 }, + { 0x0d00, 0x09ea, 0x0000 }, + { 0x0d00, 0x09ec, 0x0000 }, + { 0x8f00, 0x09f5, 0x4000 }, + { 0x8700, 0x09f1, 0x3000 }, + { 0x8d00, 0x09ef, 0x2000 }, + { 0x0d00, 0x09ee, 0x0000 }, + { 0x0700, 0x09f0, 0x0000 }, + { 0x9700, 0x09f3, 0x2000 }, + { 0x1700, 0x09f2, 0x0000 }, + { 0x0f00, 0x09f4, 0x0000 }, + { 0x8f00, 0x09f9, 0x3000 }, + { 0x8f00, 0x09f7, 0x2000 }, + { 0x0f00, 0x09f6, 0x0000 }, + { 0x0f00, 0x09f8, 0x0000 }, + { 0x8c00, 0x0a01, 0x2000 }, + { 0x1a00, 0x09fa, 0x0000 }, + { 0x0c00, 0x0a02, 0x0000 }, + { 0x8700, 0x0a1a, 0x5000 }, + { 0x8700, 0x0a10, 0x4000 }, + { 0x8700, 0x0a08, 0x3000 }, + { 0x8700, 0x0a06, 0x2000 }, + { 0x0700, 0x0a05, 0x0000 }, + { 0x0700, 0x0a07, 0x0000 }, + { 0x8700, 0x0a0a, 0x2000 }, + { 0x0700, 0x0a09, 0x0000 }, + { 0x0700, 0x0a0f, 0x0000 }, + { 0x8700, 0x0a16, 0x3000 }, + { 0x8700, 0x0a14, 0x2000 }, + { 0x0700, 0x0a13, 0x0000 }, + { 0x0700, 0x0a15, 0x0000 }, + { 0x8700, 0x0a18, 0x2000 }, + { 0x0700, 0x0a17, 0x0000 }, + { 0x0700, 0x0a19, 0x0000 }, + { 0x8700, 0x0a22, 0x4000 }, + { 0x8700, 0x0a1e, 0x3000 }, + { 0x8700, 0x0a1c, 0x2000 }, + { 0x0700, 0x0a1b, 0x0000 }, + { 0x0700, 0x0a1d, 0x0000 }, + { 0x8700, 0x0a20, 0x2000 }, + { 0x0700, 0x0a1f, 0x0000 }, + { 0x0700, 0x0a21, 0x0000 }, + { 0x8700, 0x0a26, 0x3000 }, + { 0x8700, 0x0a24, 0x2000 }, + { 0x0700, 0x0a23, 0x0000 }, + { 0x0700, 0x0a25, 0x0000 }, + { 0x8700, 0x0a28, 0x2000 }, + { 0x0700, 0x0a27, 0x0000 }, + { 0x0700, 0x0a2a, 0x0000 }, + { 0x8d00, 0x0a6a, 0x6000 }, + { 0x8c00, 0x0a41, 0x5000 }, + { 0x8700, 0x0a35, 0x4000 }, + { 0x8700, 0x0a2f, 0x3000 }, + { 0x8700, 0x0a2d, 0x2000 }, + { 0x0700, 0x0a2c, 0x0000 }, + { 0x0700, 0x0a2e, 0x0000 }, + { 0x8700, 0x0a32, 0x2000 }, + { 0x0700, 0x0a30, 0x0000 }, + { 0x0700, 0x0a33, 0x0000 }, + { 0x8c00, 0x0a3c, 0x3000 }, + { 0x8700, 0x0a38, 0x2000 }, + { 0x0700, 0x0a36, 0x0000 }, + { 0x0700, 0x0a39, 0x0000 }, + { 0x8a00, 0x0a3f, 0x2000 }, + { 0x0a00, 0x0a3e, 0x0000 }, + { 0x0a00, 0x0a40, 0x0000 }, + { 0x8700, 0x0a5a, 0x4000 }, + { 0x8c00, 0x0a4b, 0x3000 }, + { 0x8c00, 0x0a47, 0x2000 }, + { 0x0c00, 0x0a42, 0x0000 }, + { 0x0c00, 0x0a48, 0x0000 }, + { 0x8c00, 0x0a4d, 0x2000 }, + { 0x0c00, 0x0a4c, 0x0000 }, + { 0x0700, 0x0a59, 0x0000 }, + { 0x8d00, 0x0a66, 0x3000 }, + { 0x8700, 0x0a5c, 0x2000 }, + { 0x0700, 0x0a5b, 0x0000 }, + { 0x0700, 0x0a5e, 0x0000 }, + { 0x8d00, 0x0a68, 0x2000 }, + { 0x0d00, 0x0a67, 0x0000 }, + { 0x0d00, 0x0a69, 0x0000 }, + { 0x8700, 0x0a87, 0x5000 }, + { 0x8700, 0x0a72, 0x4000 }, + { 0x8d00, 0x0a6e, 0x3000 }, + { 0x8d00, 0x0a6c, 0x2000 }, + { 0x0d00, 0x0a6b, 0x0000 }, + { 0x0d00, 0x0a6d, 0x0000 }, + { 0x8c00, 0x0a70, 0x2000 }, + { 0x0d00, 0x0a6f, 0x0000 }, + { 0x0c00, 0x0a71, 0x0000 }, + { 0x8c00, 0x0a82, 0x3000 }, + { 0x8700, 0x0a74, 0x2000 }, + { 0x0700, 0x0a73, 0x0000 }, + { 0x0c00, 0x0a81, 0x0000 }, + { 0x8700, 0x0a85, 0x2000 }, + { 0x0a00, 0x0a83, 0x0000 }, + { 0x0700, 0x0a86, 0x0000 }, + { 0x8700, 0x0a90, 0x4000 }, + { 0x8700, 0x0a8b, 0x3000 }, + { 0x8700, 0x0a89, 0x2000 }, + { 0x0700, 0x0a88, 0x0000 }, + { 0x0700, 0x0a8a, 0x0000 }, + { 0x8700, 0x0a8d, 0x2000 }, + { 0x0700, 0x0a8c, 0x0000 }, + { 0x0700, 0x0a8f, 0x0000 }, + { 0x8700, 0x0a95, 0x3000 }, + { 0x8700, 0x0a93, 0x2000 }, + { 0x0700, 0x0a91, 0x0000 }, + { 0x0700, 0x0a94, 0x0000 }, + { 0x8700, 0x0a97, 0x2000 }, + { 0x0700, 0x0a96, 0x0000 }, + { 0x0700, 0x0a98, 0x0000 }, + { 0x8700, 0x10ef, 0xb000 }, + { 0x8700, 0x0dc6, 0xa000 }, + { 0x8700, 0x0c31, 0x9000 }, + { 0x8700, 0x0b5f, 0x8000 }, + { 0x8a00, 0x0b03, 0x7000 }, + { 0x8a00, 0x0abe, 0x6000 }, + { 0x8700, 0x0aaa, 0x5000 }, + { 0x8700, 0x0aa1, 0x4000 }, + { 0x8700, 0x0a9d, 0x3000 }, + { 0x8700, 0x0a9b, 0x2000 }, + { 0x0700, 0x0a9a, 0x0000 }, + { 0x0700, 0x0a9c, 0x0000 }, + { 0x8700, 0x0a9f, 0x2000 }, + { 0x0700, 0x0a9e, 0x0000 }, + { 0x0700, 0x0aa0, 0x0000 }, + { 0x8700, 0x0aa5, 0x3000 }, + { 0x8700, 0x0aa3, 0x2000 }, + { 0x0700, 0x0aa2, 0x0000 }, + { 0x0700, 0x0aa4, 0x0000 }, + { 0x8700, 0x0aa7, 0x2000 }, + { 0x0700, 0x0aa6, 0x0000 }, + { 0x0700, 0x0aa8, 0x0000 }, + { 0x8700, 0x0ab3, 0x4000 }, + { 0x8700, 0x0aae, 0x3000 }, + { 0x8700, 0x0aac, 0x2000 }, + { 0x0700, 0x0aab, 0x0000 }, + { 0x0700, 0x0aad, 0x0000 }, + { 0x8700, 0x0ab0, 0x2000 }, + { 0x0700, 0x0aaf, 0x0000 }, + { 0x0700, 0x0ab2, 0x0000 }, + { 0x8700, 0x0ab8, 0x3000 }, + { 0x8700, 0x0ab6, 0x2000 }, + { 0x0700, 0x0ab5, 0x0000 }, + { 0x0700, 0x0ab7, 0x0000 }, + { 0x8c00, 0x0abc, 0x2000 }, + { 0x0700, 0x0ab9, 0x0000 }, + { 0x0700, 0x0abd, 0x0000 }, + { 0x8700, 0x0ae1, 0x5000 }, + { 0x8c00, 0x0ac7, 0x4000 }, + { 0x8c00, 0x0ac2, 0x3000 }, + { 0x8a00, 0x0ac0, 0x2000 }, + { 0x0a00, 0x0abf, 0x0000 }, + { 0x0c00, 0x0ac1, 0x0000 }, + { 0x8c00, 0x0ac4, 0x2000 }, + { 0x0c00, 0x0ac3, 0x0000 }, + { 0x0c00, 0x0ac5, 0x0000 }, + { 0x8a00, 0x0acc, 0x3000 }, + { 0x8a00, 0x0ac9, 0x2000 }, + { 0x0c00, 0x0ac8, 0x0000 }, + { 0x0a00, 0x0acb, 0x0000 }, + { 0x8700, 0x0ad0, 0x2000 }, + { 0x0c00, 0x0acd, 0x0000 }, + { 0x0700, 0x0ae0, 0x0000 }, + { 0x8d00, 0x0aeb, 0x4000 }, + { 0x8d00, 0x0ae7, 0x3000 }, + { 0x8c00, 0x0ae3, 0x2000 }, + { 0x0c00, 0x0ae2, 0x0000 }, + { 0x0d00, 0x0ae6, 0x0000 }, + { 0x8d00, 0x0ae9, 0x2000 }, + { 0x0d00, 0x0ae8, 0x0000 }, + { 0x0d00, 0x0aea, 0x0000 }, + { 0x8d00, 0x0aef, 0x3000 }, + { 0x8d00, 0x0aed, 0x2000 }, + { 0x0d00, 0x0aec, 0x0000 }, + { 0x0d00, 0x0aee, 0x0000 }, + { 0x8c00, 0x0b01, 0x2000 }, + { 0x1700, 0x0af1, 0x0000 }, + { 0x0a00, 0x0b02, 0x0000 }, + { 0x8700, 0x0b28, 0x6000 }, + { 0x8700, 0x0b18, 0x5000 }, + { 0x8700, 0x0b0c, 0x4000 }, + { 0x8700, 0x0b08, 0x3000 }, + { 0x8700, 0x0b06, 0x2000 }, + { 0x0700, 0x0b05, 0x0000 }, + { 0x0700, 0x0b07, 0x0000 }, + { 0x8700, 0x0b0a, 0x2000 }, + { 0x0700, 0x0b09, 0x0000 }, + { 0x0700, 0x0b0b, 0x0000 }, + { 0x8700, 0x0b14, 0x3000 }, + { 0x8700, 0x0b10, 0x2000 }, + { 0x0700, 0x0b0f, 0x0000 }, + { 0x0700, 0x0b13, 0x0000 }, + { 0x8700, 0x0b16, 0x2000 }, + { 0x0700, 0x0b15, 0x0000 }, + { 0x0700, 0x0b17, 0x0000 }, + { 0x8700, 0x0b20, 0x4000 }, + { 0x8700, 0x0b1c, 0x3000 }, + { 0x8700, 0x0b1a, 0x2000 }, + { 0x0700, 0x0b19, 0x0000 }, + { 0x0700, 0x0b1b, 0x0000 }, + { 0x8700, 0x0b1e, 0x2000 }, + { 0x0700, 0x0b1d, 0x0000 }, + { 0x0700, 0x0b1f, 0x0000 }, + { 0x8700, 0x0b24, 0x3000 }, + { 0x8700, 0x0b22, 0x2000 }, + { 0x0700, 0x0b21, 0x0000 }, + { 0x0700, 0x0b23, 0x0000 }, + { 0x8700, 0x0b26, 0x2000 }, + { 0x0700, 0x0b25, 0x0000 }, + { 0x0700, 0x0b27, 0x0000 }, + { 0x8700, 0x0b3d, 0x5000 }, + { 0x8700, 0x0b32, 0x4000 }, + { 0x8700, 0x0b2d, 0x3000 }, + { 0x8700, 0x0b2b, 0x2000 }, + { 0x0700, 0x0b2a, 0x0000 }, + { 0x0700, 0x0b2c, 0x0000 }, + { 0x8700, 0x0b2f, 0x2000 }, + { 0x0700, 0x0b2e, 0x0000 }, + { 0x0700, 0x0b30, 0x0000 }, + { 0x8700, 0x0b37, 0x3000 }, + { 0x8700, 0x0b35, 0x2000 }, + { 0x0700, 0x0b33, 0x0000 }, + { 0x0700, 0x0b36, 0x0000 }, + { 0x8700, 0x0b39, 0x2000 }, + { 0x0700, 0x0b38, 0x0000 }, + { 0x0c00, 0x0b3c, 0x0000 }, + { 0x8a00, 0x0b48, 0x4000 }, + { 0x8c00, 0x0b41, 0x3000 }, + { 0x8c00, 0x0b3f, 0x2000 }, + { 0x0a00, 0x0b3e, 0x0000 }, + { 0x0a00, 0x0b40, 0x0000 }, + { 0x8c00, 0x0b43, 0x2000 }, + { 0x0c00, 0x0b42, 0x0000 }, + { 0x0a00, 0x0b47, 0x0000 }, + { 0x8c00, 0x0b56, 0x3000 }, + { 0x8a00, 0x0b4c, 0x2000 }, + { 0x0a00, 0x0b4b, 0x0000 }, + { 0x0c00, 0x0b4d, 0x0000 }, + { 0x8700, 0x0b5c, 0x2000 }, + { 0x0a00, 0x0b57, 0x0000 }, + { 0x0700, 0x0b5d, 0x0000 }, + { 0x8d00, 0x0be7, 0x7000 }, + { 0x8700, 0x0b9c, 0x6000 }, + { 0x8700, 0x0b83, 0x5000 }, + { 0x8d00, 0x0b6b, 0x4000 }, + { 0x8d00, 0x0b67, 0x3000 }, + { 0x8700, 0x0b61, 0x2000 }, + { 0x0700, 0x0b60, 0x0000 }, + { 0x0d00, 0x0b66, 0x0000 }, + { 0x8d00, 0x0b69, 0x2000 }, + { 0x0d00, 0x0b68, 0x0000 }, + { 0x0d00, 0x0b6a, 0x0000 }, + { 0x8d00, 0x0b6f, 0x3000 }, + { 0x8d00, 0x0b6d, 0x2000 }, + { 0x0d00, 0x0b6c, 0x0000 }, + { 0x0d00, 0x0b6e, 0x0000 }, + { 0x8700, 0x0b71, 0x2000 }, + { 0x1a00, 0x0b70, 0x0000 }, + { 0x0c00, 0x0b82, 0x0000 }, + { 0x8700, 0x0b8f, 0x4000 }, + { 0x8700, 0x0b88, 0x3000 }, + { 0x8700, 0x0b86, 0x2000 }, + { 0x0700, 0x0b85, 0x0000 }, + { 0x0700, 0x0b87, 0x0000 }, + { 0x8700, 0x0b8a, 0x2000 }, + { 0x0700, 0x0b89, 0x0000 }, + { 0x0700, 0x0b8e, 0x0000 }, + { 0x8700, 0x0b94, 0x3000 }, + { 0x8700, 0x0b92, 0x2000 }, + { 0x0700, 0x0b90, 0x0000 }, + { 0x0700, 0x0b93, 0x0000 }, + { 0x8700, 0x0b99, 0x2000 }, + { 0x0700, 0x0b95, 0x0000 }, + { 0x0700, 0x0b9a, 0x0000 }, + { 0x8700, 0x0bb7, 0x5000 }, + { 0x8700, 0x0bae, 0x4000 }, + { 0x8700, 0x0ba4, 0x3000 }, + { 0x8700, 0x0b9f, 0x2000 }, + { 0x0700, 0x0b9e, 0x0000 }, + { 0x0700, 0x0ba3, 0x0000 }, + { 0x8700, 0x0ba9, 0x2000 }, + { 0x0700, 0x0ba8, 0x0000 }, + { 0x0700, 0x0baa, 0x0000 }, + { 0x8700, 0x0bb2, 0x3000 }, + { 0x8700, 0x0bb0, 0x2000 }, + { 0x0700, 0x0baf, 0x0000 }, + { 0x0700, 0x0bb1, 0x0000 }, + { 0x8700, 0x0bb4, 0x2000 }, + { 0x0700, 0x0bb3, 0x0000 }, + { 0x0700, 0x0bb5, 0x0000 }, + { 0x8a00, 0x0bc6, 0x4000 }, + { 0x8a00, 0x0bbf, 0x3000 }, + { 0x8700, 0x0bb9, 0x2000 }, + { 0x0700, 0x0bb8, 0x0000 }, + { 0x0a00, 0x0bbe, 0x0000 }, + { 0x8a00, 0x0bc1, 0x2000 }, + { 0x0c00, 0x0bc0, 0x0000 }, + { 0x0a00, 0x0bc2, 0x0000 }, + { 0x8a00, 0x0bcb, 0x3000 }, + { 0x8a00, 0x0bc8, 0x2000 }, + { 0x0a00, 0x0bc7, 0x0000 }, + { 0x0a00, 0x0bca, 0x0000 }, + { 0x8c00, 0x0bcd, 0x2000 }, + { 0x0a00, 0x0bcc, 0x0000 }, + { 0x0a00, 0x0bd7, 0x0000 }, + { 0x8700, 0x0c0f, 0x6000 }, + { 0x9a00, 0x0bf7, 0x5000 }, + { 0x8d00, 0x0bef, 0x4000 }, + { 0x8d00, 0x0beb, 0x3000 }, + { 0x8d00, 0x0be9, 0x2000 }, + { 0x0d00, 0x0be8, 0x0000 }, + { 0x0d00, 0x0bea, 0x0000 }, + { 0x8d00, 0x0bed, 0x2000 }, + { 0x0d00, 0x0bec, 0x0000 }, + { 0x0d00, 0x0bee, 0x0000 }, + { 0x9a00, 0x0bf3, 0x3000 }, + { 0x8f00, 0x0bf1, 0x2000 }, + { 0x0f00, 0x0bf0, 0x0000 }, + { 0x0f00, 0x0bf2, 0x0000 }, + { 0x9a00, 0x0bf5, 0x2000 }, + { 0x1a00, 0x0bf4, 0x0000 }, + { 0x1a00, 0x0bf6, 0x0000 }, + { 0x8700, 0x0c06, 0x4000 }, + { 0x8a00, 0x0c01, 0x3000 }, + { 0x9700, 0x0bf9, 0x2000 }, + { 0x1a00, 0x0bf8, 0x0000 }, + { 0x1a00, 0x0bfa, 0x0000 }, + { 0x8a00, 0x0c03, 0x2000 }, + { 0x0a00, 0x0c02, 0x0000 }, + { 0x0700, 0x0c05, 0x0000 }, + { 0x8700, 0x0c0a, 0x3000 }, + { 0x8700, 0x0c08, 0x2000 }, + { 0x0700, 0x0c07, 0x0000 }, + { 0x0700, 0x0c09, 0x0000 }, + { 0x8700, 0x0c0c, 0x2000 }, + { 0x0700, 0x0c0b, 0x0000 }, + { 0x0700, 0x0c0e, 0x0000 }, + { 0x8700, 0x0c20, 0x5000 }, + { 0x8700, 0x0c18, 0x4000 }, + { 0x8700, 0x0c14, 0x3000 }, + { 0x8700, 0x0c12, 0x2000 }, + { 0x0700, 0x0c10, 0x0000 }, + { 0x0700, 0x0c13, 0x0000 }, + { 0x8700, 0x0c16, 0x2000 }, + { 0x0700, 0x0c15, 0x0000 }, + { 0x0700, 0x0c17, 0x0000 }, + { 0x8700, 0x0c1c, 0x3000 }, + { 0x8700, 0x0c1a, 0x2000 }, + { 0x0700, 0x0c19, 0x0000 }, + { 0x0700, 0x0c1b, 0x0000 }, + { 0x8700, 0x0c1e, 0x2000 }, + { 0x0700, 0x0c1d, 0x0000 }, + { 0x0700, 0x0c1f, 0x0000 }, + { 0x8700, 0x0c28, 0x4000 }, + { 0x8700, 0x0c24, 0x3000 }, + { 0x8700, 0x0c22, 0x2000 }, + { 0x0700, 0x0c21, 0x0000 }, + { 0x0700, 0x0c23, 0x0000 }, + { 0x8700, 0x0c26, 0x2000 }, + { 0x0700, 0x0c25, 0x0000 }, + { 0x0700, 0x0c27, 0x0000 }, + { 0x8700, 0x0c2d, 0x3000 }, + { 0x8700, 0x0c2b, 0x2000 }, + { 0x0700, 0x0c2a, 0x0000 }, + { 0x0700, 0x0c2c, 0x0000 }, + { 0x8700, 0x0c2f, 0x2000 }, + { 0x0700, 0x0c2e, 0x0000 }, + { 0x0700, 0x0c30, 0x0000 }, + { 0x8700, 0x0d0e, 0x8000 }, + { 0x8700, 0x0ca1, 0x7000 }, + { 0x8d00, 0x0c6c, 0x6000 }, + { 0x8c00, 0x0c47, 0x5000 }, + { 0x8c00, 0x0c3e, 0x4000 }, + { 0x8700, 0x0c36, 0x3000 }, + { 0x8700, 0x0c33, 0x2000 }, + { 0x0700, 0x0c32, 0x0000 }, + { 0x0700, 0x0c35, 0x0000 }, + { 0x8700, 0x0c38, 0x2000 }, + { 0x0700, 0x0c37, 0x0000 }, + { 0x0700, 0x0c39, 0x0000 }, + { 0x8a00, 0x0c42, 0x3000 }, + { 0x8c00, 0x0c40, 0x2000 }, + { 0x0c00, 0x0c3f, 0x0000 }, + { 0x0a00, 0x0c41, 0x0000 }, + { 0x8a00, 0x0c44, 0x2000 }, + { 0x0a00, 0x0c43, 0x0000 }, + { 0x0c00, 0x0c46, 0x0000 }, + { 0x8700, 0x0c60, 0x4000 }, + { 0x8c00, 0x0c4c, 0x3000 }, + { 0x8c00, 0x0c4a, 0x2000 }, + { 0x0c00, 0x0c48, 0x0000 }, + { 0x0c00, 0x0c4b, 0x0000 }, + { 0x8c00, 0x0c55, 0x2000 }, + { 0x0c00, 0x0c4d, 0x0000 }, + { 0x0c00, 0x0c56, 0x0000 }, + { 0x8d00, 0x0c68, 0x3000 }, + { 0x8d00, 0x0c66, 0x2000 }, + { 0x0700, 0x0c61, 0x0000 }, + { 0x0d00, 0x0c67, 0x0000 }, + { 0x8d00, 0x0c6a, 0x2000 }, + { 0x0d00, 0x0c69, 0x0000 }, + { 0x0d00, 0x0c6b, 0x0000 }, + { 0x8700, 0x0c90, 0x5000 }, + { 0x8700, 0x0c87, 0x4000 }, + { 0x8a00, 0x0c82, 0x3000 }, + { 0x8d00, 0x0c6e, 0x2000 }, + { 0x0d00, 0x0c6d, 0x0000 }, + { 0x0d00, 0x0c6f, 0x0000 }, + { 0x8700, 0x0c85, 0x2000 }, + { 0x0a00, 0x0c83, 0x0000 }, + { 0x0700, 0x0c86, 0x0000 }, + { 0x8700, 0x0c8b, 0x3000 }, + { 0x8700, 0x0c89, 0x2000 }, + { 0x0700, 0x0c88, 0x0000 }, + { 0x0700, 0x0c8a, 0x0000 }, + { 0x8700, 0x0c8e, 0x2000 }, + { 0x0700, 0x0c8c, 0x0000 }, + { 0x0700, 0x0c8f, 0x0000 }, + { 0x8700, 0x0c99, 0x4000 }, + { 0x8700, 0x0c95, 0x3000 }, + { 0x8700, 0x0c93, 0x2000 }, + { 0x0700, 0x0c92, 0x0000 }, + { 0x0700, 0x0c94, 0x0000 }, + { 0x8700, 0x0c97, 0x2000 }, + { 0x0700, 0x0c96, 0x0000 }, + { 0x0700, 0x0c98, 0x0000 }, + { 0x8700, 0x0c9d, 0x3000 }, + { 0x8700, 0x0c9b, 0x2000 }, + { 0x0700, 0x0c9a, 0x0000 }, + { 0x0700, 0x0c9c, 0x0000 }, + { 0x8700, 0x0c9f, 0x2000 }, + { 0x0700, 0x0c9e, 0x0000 }, + { 0x0700, 0x0ca0, 0x0000 }, + { 0x8c00, 0x0cc6, 0x6000 }, + { 0x8700, 0x0cb2, 0x5000 }, + { 0x8700, 0x0caa, 0x4000 }, + { 0x8700, 0x0ca5, 0x3000 }, + { 0x8700, 0x0ca3, 0x2000 }, + { 0x0700, 0x0ca2, 0x0000 }, + { 0x0700, 0x0ca4, 0x0000 }, + { 0x8700, 0x0ca7, 0x2000 }, + { 0x0700, 0x0ca6, 0x0000 }, + { 0x0700, 0x0ca8, 0x0000 }, + { 0x8700, 0x0cae, 0x3000 }, + { 0x8700, 0x0cac, 0x2000 }, + { 0x0700, 0x0cab, 0x0000 }, + { 0x0700, 0x0cad, 0x0000 }, + { 0x8700, 0x0cb0, 0x2000 }, + { 0x0700, 0x0caf, 0x0000 }, + { 0x0700, 0x0cb1, 0x0000 }, + { 0x8700, 0x0cbd, 0x4000 }, + { 0x8700, 0x0cb7, 0x3000 }, + { 0x8700, 0x0cb5, 0x2000 }, + { 0x0700, 0x0cb3, 0x0000 }, + { 0x0700, 0x0cb6, 0x0000 }, + { 0x8700, 0x0cb9, 0x2000 }, + { 0x0700, 0x0cb8, 0x0000 }, + { 0x0c00, 0x0cbc, 0x0000 }, + { 0x8a00, 0x0cc1, 0x3000 }, + { 0x8c00, 0x0cbf, 0x2000 }, + { 0x0a00, 0x0cbe, 0x0000 }, + { 0x0a00, 0x0cc0, 0x0000 }, + { 0x8a00, 0x0cc3, 0x2000 }, + { 0x0a00, 0x0cc2, 0x0000 }, + { 0x0a00, 0x0cc4, 0x0000 }, + { 0x8d00, 0x0cea, 0x5000 }, + { 0x8a00, 0x0cd6, 0x4000 }, + { 0x8a00, 0x0ccb, 0x3000 }, + { 0x8a00, 0x0cc8, 0x2000 }, + { 0x0a00, 0x0cc7, 0x0000 }, + { 0x0a00, 0x0cca, 0x0000 }, + { 0x8c00, 0x0ccd, 0x2000 }, + { 0x0c00, 0x0ccc, 0x0000 }, + { 0x0a00, 0x0cd5, 0x0000 }, + { 0x8d00, 0x0ce6, 0x3000 }, + { 0x8700, 0x0ce0, 0x2000 }, + { 0x0700, 0x0cde, 0x0000 }, + { 0x0700, 0x0ce1, 0x0000 }, + { 0x8d00, 0x0ce8, 0x2000 }, + { 0x0d00, 0x0ce7, 0x0000 }, + { 0x0d00, 0x0ce9, 0x0000 }, + { 0x8700, 0x0d05, 0x4000 }, + { 0x8d00, 0x0cee, 0x3000 }, + { 0x8d00, 0x0cec, 0x2000 }, + { 0x0d00, 0x0ceb, 0x0000 }, + { 0x0d00, 0x0ced, 0x0000 }, + { 0x8a00, 0x0d02, 0x2000 }, + { 0x0d00, 0x0cef, 0x0000 }, + { 0x0a00, 0x0d03, 0x0000 }, + { 0x8700, 0x0d09, 0x3000 }, + { 0x8700, 0x0d07, 0x2000 }, + { 0x0700, 0x0d06, 0x0000 }, + { 0x0700, 0x0d08, 0x0000 }, + { 0x8700, 0x0d0b, 0x2000 }, + { 0x0700, 0x0d0a, 0x0000 }, + { 0x0700, 0x0d0c, 0x0000 }, + { 0x8d00, 0x0d6c, 0x7000 }, + { 0x8700, 0x0d30, 0x6000 }, + { 0x8700, 0x0d1f, 0x5000 }, + { 0x8700, 0x0d17, 0x4000 }, + { 0x8700, 0x0d13, 0x3000 }, + { 0x8700, 0x0d10, 0x2000 }, + { 0x0700, 0x0d0f, 0x0000 }, + { 0x0700, 0x0d12, 0x0000 }, + { 0x8700, 0x0d15, 0x2000 }, + { 0x0700, 0x0d14, 0x0000 }, + { 0x0700, 0x0d16, 0x0000 }, + { 0x8700, 0x0d1b, 0x3000 }, + { 0x8700, 0x0d19, 0x2000 }, + { 0x0700, 0x0d18, 0x0000 }, + { 0x0700, 0x0d1a, 0x0000 }, + { 0x8700, 0x0d1d, 0x2000 }, + { 0x0700, 0x0d1c, 0x0000 }, + { 0x0700, 0x0d1e, 0x0000 }, + { 0x8700, 0x0d27, 0x4000 }, + { 0x8700, 0x0d23, 0x3000 }, + { 0x8700, 0x0d21, 0x2000 }, + { 0x0700, 0x0d20, 0x0000 }, + { 0x0700, 0x0d22, 0x0000 }, + { 0x8700, 0x0d25, 0x2000 }, + { 0x0700, 0x0d24, 0x0000 }, + { 0x0700, 0x0d26, 0x0000 }, + { 0x8700, 0x0d2c, 0x3000 }, + { 0x8700, 0x0d2a, 0x2000 }, + { 0x0700, 0x0d28, 0x0000 }, + { 0x0700, 0x0d2b, 0x0000 }, + { 0x8700, 0x0d2e, 0x2000 }, + { 0x0700, 0x0d2d, 0x0000 }, + { 0x0700, 0x0d2f, 0x0000 }, + { 0x8a00, 0x0d46, 0x5000 }, + { 0x8700, 0x0d38, 0x4000 }, + { 0x8700, 0x0d34, 0x3000 }, + { 0x8700, 0x0d32, 0x2000 }, + { 0x0700, 0x0d31, 0x0000 }, + { 0x0700, 0x0d33, 0x0000 }, + { 0x8700, 0x0d36, 0x2000 }, + { 0x0700, 0x0d35, 0x0000 }, + { 0x0700, 0x0d37, 0x0000 }, + { 0x8a00, 0x0d40, 0x3000 }, + { 0x8a00, 0x0d3e, 0x2000 }, + { 0x0700, 0x0d39, 0x0000 }, + { 0x0a00, 0x0d3f, 0x0000 }, + { 0x8c00, 0x0d42, 0x2000 }, + { 0x0c00, 0x0d41, 0x0000 }, + { 0x0c00, 0x0d43, 0x0000 }, + { 0x8700, 0x0d60, 0x4000 }, + { 0x8a00, 0x0d4b, 0x3000 }, + { 0x8a00, 0x0d48, 0x2000 }, + { 0x0a00, 0x0d47, 0x0000 }, + { 0x0a00, 0x0d4a, 0x0000 }, + { 0x8c00, 0x0d4d, 0x2000 }, + { 0x0a00, 0x0d4c, 0x0000 }, + { 0x0a00, 0x0d57, 0x0000 }, + { 0x8d00, 0x0d68, 0x3000 }, + { 0x8d00, 0x0d66, 0x2000 }, + { 0x0700, 0x0d61, 0x0000 }, + { 0x0d00, 0x0d67, 0x0000 }, + { 0x8d00, 0x0d6a, 0x2000 }, + { 0x0d00, 0x0d69, 0x0000 }, + { 0x0d00, 0x0d6b, 0x0000 }, + { 0x8700, 0x0da2, 0x6000 }, + { 0x8700, 0x0d8f, 0x5000 }, + { 0x8700, 0x0d87, 0x4000 }, + { 0x8a00, 0x0d82, 0x3000 }, + { 0x8d00, 0x0d6e, 0x2000 }, + { 0x0d00, 0x0d6d, 0x0000 }, + { 0x0d00, 0x0d6f, 0x0000 }, + { 0x8700, 0x0d85, 0x2000 }, + { 0x0a00, 0x0d83, 0x0000 }, + { 0x0700, 0x0d86, 0x0000 }, + { 0x8700, 0x0d8b, 0x3000 }, + { 0x8700, 0x0d89, 0x2000 }, + { 0x0700, 0x0d88, 0x0000 }, + { 0x0700, 0x0d8a, 0x0000 }, + { 0x8700, 0x0d8d, 0x2000 }, + { 0x0700, 0x0d8c, 0x0000 }, + { 0x0700, 0x0d8e, 0x0000 }, + { 0x8700, 0x0d9a, 0x4000 }, + { 0x8700, 0x0d93, 0x3000 }, + { 0x8700, 0x0d91, 0x2000 }, + { 0x0700, 0x0d90, 0x0000 }, + { 0x0700, 0x0d92, 0x0000 }, + { 0x8700, 0x0d95, 0x2000 }, + { 0x0700, 0x0d94, 0x0000 }, + { 0x0700, 0x0d96, 0x0000 }, + { 0x8700, 0x0d9e, 0x3000 }, + { 0x8700, 0x0d9c, 0x2000 }, + { 0x0700, 0x0d9b, 0x0000 }, + { 0x0700, 0x0d9d, 0x0000 }, + { 0x8700, 0x0da0, 0x2000 }, + { 0x0700, 0x0d9f, 0x0000 }, + { 0x0700, 0x0da1, 0x0000 }, + { 0x8700, 0x0db3, 0x5000 }, + { 0x8700, 0x0daa, 0x4000 }, + { 0x8700, 0x0da6, 0x3000 }, + { 0x8700, 0x0da4, 0x2000 }, + { 0x0700, 0x0da3, 0x0000 }, + { 0x0700, 0x0da5, 0x0000 }, + { 0x8700, 0x0da8, 0x2000 }, + { 0x0700, 0x0da7, 0x0000 }, + { 0x0700, 0x0da9, 0x0000 }, + { 0x8700, 0x0dae, 0x3000 }, + { 0x8700, 0x0dac, 0x2000 }, + { 0x0700, 0x0dab, 0x0000 }, + { 0x0700, 0x0dad, 0x0000 }, + { 0x8700, 0x0db0, 0x2000 }, + { 0x0700, 0x0daf, 0x0000 }, + { 0x0700, 0x0db1, 0x0000 }, + { 0x8700, 0x0dbb, 0x4000 }, + { 0x8700, 0x0db7, 0x3000 }, + { 0x8700, 0x0db5, 0x2000 }, + { 0x0700, 0x0db4, 0x0000 }, + { 0x0700, 0x0db6, 0x0000 }, + { 0x8700, 0x0db9, 0x2000 }, + { 0x0700, 0x0db8, 0x0000 }, + { 0x0700, 0x0dba, 0x0000 }, + { 0x8700, 0x0dc2, 0x3000 }, + { 0x8700, 0x0dc0, 0x2000 }, + { 0x0700, 0x0dbd, 0x0000 }, + { 0x0700, 0x0dc1, 0x0000 }, + { 0x8700, 0x0dc4, 0x2000 }, + { 0x0700, 0x0dc3, 0x0000 }, + { 0x0700, 0x0dc5, 0x0000 }, + { 0x8700, 0x0f55, 0x9000 }, + { 0x8700, 0x0ea5, 0x8000 }, + { 0x8700, 0x0e2d, 0x7000 }, + { 0x8700, 0x0e0d, 0x6000 }, + { 0x8a00, 0x0ddf, 0x5000 }, + { 0x8c00, 0x0dd6, 0x4000 }, + { 0x8a00, 0x0dd1, 0x3000 }, + { 0x8a00, 0x0dcf, 0x2000 }, + { 0x0c00, 0x0dca, 0x0000 }, + { 0x0a00, 0x0dd0, 0x0000 }, + { 0x8c00, 0x0dd3, 0x2000 }, + { 0x0c00, 0x0dd2, 0x0000 }, + { 0x0c00, 0x0dd4, 0x0000 }, + { 0x8a00, 0x0ddb, 0x3000 }, + { 0x8a00, 0x0dd9, 0x2000 }, + { 0x0a00, 0x0dd8, 0x0000 }, + { 0x0a00, 0x0dda, 0x0000 }, + { 0x8a00, 0x0ddd, 0x2000 }, + { 0x0a00, 0x0ddc, 0x0000 }, + { 0x0a00, 0x0dde, 0x0000 }, + { 0x8700, 0x0e05, 0x4000 }, + { 0x8700, 0x0e01, 0x3000 }, + { 0x8a00, 0x0df3, 0x2000 }, + { 0x0a00, 0x0df2, 0x0000 }, + { 0x1500, 0x0df4, 0x0000 }, + { 0x8700, 0x0e03, 0x2000 }, + { 0x0700, 0x0e02, 0x0000 }, + { 0x0700, 0x0e04, 0x0000 }, + { 0x8700, 0x0e09, 0x3000 }, + { 0x8700, 0x0e07, 0x2000 }, + { 0x0700, 0x0e06, 0x0000 }, + { 0x0700, 0x0e08, 0x0000 }, + { 0x8700, 0x0e0b, 0x2000 }, + { 0x0700, 0x0e0a, 0x0000 }, + { 0x0700, 0x0e0c, 0x0000 }, + { 0x8700, 0x0e1d, 0x5000 }, + { 0x8700, 0x0e15, 0x4000 }, + { 0x8700, 0x0e11, 0x3000 }, + { 0x8700, 0x0e0f, 0x2000 }, + { 0x0700, 0x0e0e, 0x0000 }, + { 0x0700, 0x0e10, 0x0000 }, + { 0x8700, 0x0e13, 0x2000 }, + { 0x0700, 0x0e12, 0x0000 }, + { 0x0700, 0x0e14, 0x0000 }, + { 0x8700, 0x0e19, 0x3000 }, + { 0x8700, 0x0e17, 0x2000 }, + { 0x0700, 0x0e16, 0x0000 }, + { 0x0700, 0x0e18, 0x0000 }, + { 0x8700, 0x0e1b, 0x2000 }, + { 0x0700, 0x0e1a, 0x0000 }, + { 0x0700, 0x0e1c, 0x0000 }, + { 0x8700, 0x0e25, 0x4000 }, + { 0x8700, 0x0e21, 0x3000 }, + { 0x8700, 0x0e1f, 0x2000 }, + { 0x0700, 0x0e1e, 0x0000 }, + { 0x0700, 0x0e20, 0x0000 }, + { 0x8700, 0x0e23, 0x2000 }, + { 0x0700, 0x0e22, 0x0000 }, + { 0x0700, 0x0e24, 0x0000 }, + { 0x8700, 0x0e29, 0x3000 }, + { 0x8700, 0x0e27, 0x2000 }, + { 0x0700, 0x0e26, 0x0000 }, + { 0x0700, 0x0e28, 0x0000 }, + { 0x8700, 0x0e2b, 0x2000 }, + { 0x0700, 0x0e2a, 0x0000 }, + { 0x0700, 0x0e2c, 0x0000 }, + { 0x8d00, 0x0e51, 0x6000 }, + { 0x8700, 0x0e41, 0x5000 }, + { 0x8c00, 0x0e35, 0x4000 }, + { 0x8c00, 0x0e31, 0x3000 }, + { 0x8700, 0x0e2f, 0x2000 }, + { 0x0700, 0x0e2e, 0x0000 }, + { 0x0700, 0x0e30, 0x0000 }, + { 0x8700, 0x0e33, 0x2000 }, + { 0x0700, 0x0e32, 0x0000 }, + { 0x0c00, 0x0e34, 0x0000 }, + { 0x8c00, 0x0e39, 0x3000 }, + { 0x8c00, 0x0e37, 0x2000 }, + { 0x0c00, 0x0e36, 0x0000 }, + { 0x0c00, 0x0e38, 0x0000 }, + { 0x9700, 0x0e3f, 0x2000 }, + { 0x0c00, 0x0e3a, 0x0000 }, + { 0x0700, 0x0e40, 0x0000 }, + { 0x8c00, 0x0e49, 0x4000 }, + { 0x8700, 0x0e45, 0x3000 }, + { 0x8700, 0x0e43, 0x2000 }, + { 0x0700, 0x0e42, 0x0000 }, + { 0x0700, 0x0e44, 0x0000 }, + { 0x8c00, 0x0e47, 0x2000 }, + { 0x0600, 0x0e46, 0x0000 }, + { 0x0c00, 0x0e48, 0x0000 }, + { 0x8c00, 0x0e4d, 0x3000 }, + { 0x8c00, 0x0e4b, 0x2000 }, + { 0x0c00, 0x0e4a, 0x0000 }, + { 0x0c00, 0x0e4c, 0x0000 }, + { 0x9500, 0x0e4f, 0x2000 }, + { 0x0c00, 0x0e4e, 0x0000 }, + { 0x0d00, 0x0e50, 0x0000 }, + { 0x8700, 0x0e8a, 0x5000 }, + { 0x8d00, 0x0e59, 0x4000 }, + { 0x8d00, 0x0e55, 0x3000 }, + { 0x8d00, 0x0e53, 0x2000 }, + { 0x0d00, 0x0e52, 0x0000 }, + { 0x0d00, 0x0e54, 0x0000 }, + { 0x8d00, 0x0e57, 0x2000 }, + { 0x0d00, 0x0e56, 0x0000 }, + { 0x0d00, 0x0e58, 0x0000 }, + { 0x8700, 0x0e82, 0x3000 }, + { 0x9500, 0x0e5b, 0x2000 }, + { 0x1500, 0x0e5a, 0x0000 }, + { 0x0700, 0x0e81, 0x0000 }, + { 0x8700, 0x0e87, 0x2000 }, + { 0x0700, 0x0e84, 0x0000 }, + { 0x0700, 0x0e88, 0x0000 }, + { 0x8700, 0x0e9b, 0x4000 }, + { 0x8700, 0x0e96, 0x3000 }, + { 0x8700, 0x0e94, 0x2000 }, + { 0x0700, 0x0e8d, 0x0000 }, + { 0x0700, 0x0e95, 0x0000 }, + { 0x8700, 0x0e99, 0x2000 }, + { 0x0700, 0x0e97, 0x0000 }, + { 0x0700, 0x0e9a, 0x0000 }, + { 0x8700, 0x0e9f, 0x3000 }, + { 0x8700, 0x0e9d, 0x2000 }, + { 0x0700, 0x0e9c, 0x0000 }, + { 0x0700, 0x0e9e, 0x0000 }, + { 0x8700, 0x0ea2, 0x2000 }, + { 0x0700, 0x0ea1, 0x0000 }, + { 0x0700, 0x0ea3, 0x0000 }, + { 0x9a00, 0x0f14, 0x7000 }, + { 0x8d00, 0x0ed0, 0x6000 }, + { 0x8c00, 0x0eb9, 0x5000 }, + { 0x8c00, 0x0eb1, 0x4000 }, + { 0x8700, 0x0ead, 0x3000 }, + { 0x8700, 0x0eaa, 0x2000 }, + { 0x0700, 0x0ea7, 0x0000 }, + { 0x0700, 0x0eab, 0x0000 }, + { 0x8700, 0x0eaf, 0x2000 }, + { 0x0700, 0x0eae, 0x0000 }, + { 0x0700, 0x0eb0, 0x0000 }, + { 0x8c00, 0x0eb5, 0x3000 }, + { 0x8700, 0x0eb3, 0x2000 }, + { 0x0700, 0x0eb2, 0x0000 }, + { 0x0c00, 0x0eb4, 0x0000 }, + { 0x8c00, 0x0eb7, 0x2000 }, + { 0x0c00, 0x0eb6, 0x0000 }, + { 0x0c00, 0x0eb8, 0x0000 }, + { 0x8700, 0x0ec4, 0x4000 }, + { 0x8700, 0x0ec0, 0x3000 }, + { 0x8c00, 0x0ebc, 0x2000 }, + { 0x0c00, 0x0ebb, 0x0000 }, + { 0x0700, 0x0ebd, 0x0000 }, + { 0x8700, 0x0ec2, 0x2000 }, + { 0x0700, 0x0ec1, 0x0000 }, + { 0x0700, 0x0ec3, 0x0000 }, + { 0x8c00, 0x0eca, 0x3000 }, + { 0x8c00, 0x0ec8, 0x2000 }, + { 0x0600, 0x0ec6, 0x0000 }, + { 0x0c00, 0x0ec9, 0x0000 }, + { 0x8c00, 0x0ecc, 0x2000 }, + { 0x0c00, 0x0ecb, 0x0000 }, + { 0x0c00, 0x0ecd, 0x0000 }, + { 0x9500, 0x0f04, 0x5000 }, + { 0x8d00, 0x0ed8, 0x4000 }, + { 0x8d00, 0x0ed4, 0x3000 }, + { 0x8d00, 0x0ed2, 0x2000 }, + { 0x0d00, 0x0ed1, 0x0000 }, + { 0x0d00, 0x0ed3, 0x0000 }, + { 0x8d00, 0x0ed6, 0x2000 }, + { 0x0d00, 0x0ed5, 0x0000 }, + { 0x0d00, 0x0ed7, 0x0000 }, + { 0x8700, 0x0f00, 0x3000 }, + { 0x8700, 0x0edc, 0x2000 }, + { 0x0d00, 0x0ed9, 0x0000 }, + { 0x0700, 0x0edd, 0x0000 }, + { 0x9a00, 0x0f02, 0x2000 }, + { 0x1a00, 0x0f01, 0x0000 }, + { 0x1a00, 0x0f03, 0x0000 }, + { 0x9500, 0x0f0c, 0x4000 }, + { 0x9500, 0x0f08, 0x3000 }, + { 0x9500, 0x0f06, 0x2000 }, + { 0x1500, 0x0f05, 0x0000 }, + { 0x1500, 0x0f07, 0x0000 }, + { 0x9500, 0x0f0a, 0x2000 }, + { 0x1500, 0x0f09, 0x0000 }, + { 0x1500, 0x0f0b, 0x0000 }, + { 0x9500, 0x0f10, 0x3000 }, + { 0x9500, 0x0f0e, 0x2000 }, + { 0x1500, 0x0f0d, 0x0000 }, + { 0x1500, 0x0f0f, 0x0000 }, + { 0x9500, 0x0f12, 0x2000 }, + { 0x1500, 0x0f11, 0x0000 }, + { 0x1a00, 0x0f13, 0x0000 }, + { 0x9a00, 0x0f34, 0x6000 }, + { 0x8d00, 0x0f24, 0x5000 }, + { 0x9a00, 0x0f1c, 0x4000 }, + { 0x8c00, 0x0f18, 0x3000 }, + { 0x9a00, 0x0f16, 0x2000 }, + { 0x1a00, 0x0f15, 0x0000 }, + { 0x1a00, 0x0f17, 0x0000 }, + { 0x9a00, 0x0f1a, 0x2000 }, + { 0x0c00, 0x0f19, 0x0000 }, + { 0x1a00, 0x0f1b, 0x0000 }, + { 0x8d00, 0x0f20, 0x3000 }, + { 0x9a00, 0x0f1e, 0x2000 }, + { 0x1a00, 0x0f1d, 0x0000 }, + { 0x1a00, 0x0f1f, 0x0000 }, + { 0x8d00, 0x0f22, 0x2000 }, + { 0x0d00, 0x0f21, 0x0000 }, + { 0x0d00, 0x0f23, 0x0000 }, + { 0x8f00, 0x0f2c, 0x4000 }, + { 0x8d00, 0x0f28, 0x3000 }, + { 0x8d00, 0x0f26, 0x2000 }, + { 0x0d00, 0x0f25, 0x0000 }, + { 0x0d00, 0x0f27, 0x0000 }, + { 0x8f00, 0x0f2a, 0x2000 }, + { 0x0d00, 0x0f29, 0x0000 }, + { 0x0f00, 0x0f2b, 0x0000 }, + { 0x8f00, 0x0f30, 0x3000 }, + { 0x8f00, 0x0f2e, 0x2000 }, + { 0x0f00, 0x0f2d, 0x0000 }, + { 0x0f00, 0x0f2f, 0x0000 }, + { 0x8f00, 0x0f32, 0x2000 }, + { 0x0f00, 0x0f31, 0x0000 }, + { 0x0f00, 0x0f33, 0x0000 }, + { 0x8700, 0x0f44, 0x5000 }, + { 0x9600, 0x0f3c, 0x4000 }, + { 0x9a00, 0x0f38, 0x3000 }, + { 0x9a00, 0x0f36, 0x2000 }, + { 0x0c00, 0x0f35, 0x0000 }, + { 0x0c00, 0x0f37, 0x0000 }, + { 0x9600, 0x0f3a, 0x2000 }, + { 0x0c00, 0x0f39, 0x0000 }, + { 0x1200, 0x0f3b, 0x0000 }, + { 0x8700, 0x0f40, 0x3000 }, + { 0x8a00, 0x0f3e, 0x2000 }, + { 0x1200, 0x0f3d, 0x0000 }, + { 0x0a00, 0x0f3f, 0x0000 }, + { 0x8700, 0x0f42, 0x2000 }, + { 0x0700, 0x0f41, 0x0000 }, + { 0x0700, 0x0f43, 0x0000 }, + { 0x8700, 0x0f4d, 0x4000 }, + { 0x8700, 0x0f49, 0x3000 }, + { 0x8700, 0x0f46, 0x2000 }, + { 0x0700, 0x0f45, 0x0000 }, + { 0x0700, 0x0f47, 0x0000 }, + { 0x8700, 0x0f4b, 0x2000 }, + { 0x0700, 0x0f4a, 0x0000 }, + { 0x0700, 0x0f4c, 0x0000 }, + { 0x8700, 0x0f51, 0x3000 }, + { 0x8700, 0x0f4f, 0x2000 }, + { 0x0700, 0x0f4e, 0x0000 }, + { 0x0700, 0x0f50, 0x0000 }, + { 0x8700, 0x0f53, 0x2000 }, + { 0x0700, 0x0f52, 0x0000 }, + { 0x0700, 0x0f54, 0x0000 }, + { 0x8700, 0x1013, 0x8000 }, + { 0x8c00, 0x0fa0, 0x7000 }, + { 0x8c00, 0x0f7b, 0x6000 }, + { 0x8700, 0x0f65, 0x5000 }, + { 0x8700, 0x0f5d, 0x4000 }, + { 0x8700, 0x0f59, 0x3000 }, + { 0x8700, 0x0f57, 0x2000 }, + { 0x0700, 0x0f56, 0x0000 }, + { 0x0700, 0x0f58, 0x0000 }, + { 0x8700, 0x0f5b, 0x2000 }, + { 0x0700, 0x0f5a, 0x0000 }, + { 0x0700, 0x0f5c, 0x0000 }, + { 0x8700, 0x0f61, 0x3000 }, + { 0x8700, 0x0f5f, 0x2000 }, + { 0x0700, 0x0f5e, 0x0000 }, + { 0x0700, 0x0f60, 0x0000 }, + { 0x8700, 0x0f63, 0x2000 }, + { 0x0700, 0x0f62, 0x0000 }, + { 0x0700, 0x0f64, 0x0000 }, + { 0x8c00, 0x0f73, 0x4000 }, + { 0x8700, 0x0f69, 0x3000 }, + { 0x8700, 0x0f67, 0x2000 }, + { 0x0700, 0x0f66, 0x0000 }, + { 0x0700, 0x0f68, 0x0000 }, + { 0x8c00, 0x0f71, 0x2000 }, + { 0x0700, 0x0f6a, 0x0000 }, + { 0x0c00, 0x0f72, 0x0000 }, + { 0x8c00, 0x0f77, 0x3000 }, + { 0x8c00, 0x0f75, 0x2000 }, + { 0x0c00, 0x0f74, 0x0000 }, + { 0x0c00, 0x0f76, 0x0000 }, + { 0x8c00, 0x0f79, 0x2000 }, + { 0x0c00, 0x0f78, 0x0000 }, + { 0x0c00, 0x0f7a, 0x0000 }, + { 0x8700, 0x0f8b, 0x5000 }, + { 0x8c00, 0x0f83, 0x4000 }, + { 0x8a00, 0x0f7f, 0x3000 }, + { 0x8c00, 0x0f7d, 0x2000 }, + { 0x0c00, 0x0f7c, 0x0000 }, + { 0x0c00, 0x0f7e, 0x0000 }, + { 0x8c00, 0x0f81, 0x2000 }, + { 0x0c00, 0x0f80, 0x0000 }, + { 0x0c00, 0x0f82, 0x0000 }, + { 0x8c00, 0x0f87, 0x3000 }, + { 0x9500, 0x0f85, 0x2000 }, + { 0x0c00, 0x0f84, 0x0000 }, + { 0x0c00, 0x0f86, 0x0000 }, + { 0x8700, 0x0f89, 0x2000 }, + { 0x0700, 0x0f88, 0x0000 }, + { 0x0700, 0x0f8a, 0x0000 }, + { 0x8c00, 0x0f97, 0x4000 }, + { 0x8c00, 0x0f93, 0x3000 }, + { 0x8c00, 0x0f91, 0x2000 }, + { 0x0c00, 0x0f90, 0x0000 }, + { 0x0c00, 0x0f92, 0x0000 }, + { 0x8c00, 0x0f95, 0x2000 }, + { 0x0c00, 0x0f94, 0x0000 }, + { 0x0c00, 0x0f96, 0x0000 }, + { 0x8c00, 0x0f9c, 0x3000 }, + { 0x8c00, 0x0f9a, 0x2000 }, + { 0x0c00, 0x0f99, 0x0000 }, + { 0x0c00, 0x0f9b, 0x0000 }, + { 0x8c00, 0x0f9e, 0x2000 }, + { 0x0c00, 0x0f9d, 0x0000 }, + { 0x0c00, 0x0f9f, 0x0000 }, + { 0x9a00, 0x0fc1, 0x6000 }, + { 0x8c00, 0x0fb0, 0x5000 }, + { 0x8c00, 0x0fa8, 0x4000 }, + { 0x8c00, 0x0fa4, 0x3000 }, + { 0x8c00, 0x0fa2, 0x2000 }, + { 0x0c00, 0x0fa1, 0x0000 }, + { 0x0c00, 0x0fa3, 0x0000 }, + { 0x8c00, 0x0fa6, 0x2000 }, + { 0x0c00, 0x0fa5, 0x0000 }, + { 0x0c00, 0x0fa7, 0x0000 }, + { 0x8c00, 0x0fac, 0x3000 }, + { 0x8c00, 0x0faa, 0x2000 }, + { 0x0c00, 0x0fa9, 0x0000 }, + { 0x0c00, 0x0fab, 0x0000 }, + { 0x8c00, 0x0fae, 0x2000 }, + { 0x0c00, 0x0fad, 0x0000 }, + { 0x0c00, 0x0faf, 0x0000 }, + { 0x8c00, 0x0fb8, 0x4000 }, + { 0x8c00, 0x0fb4, 0x3000 }, + { 0x8c00, 0x0fb2, 0x2000 }, + { 0x0c00, 0x0fb1, 0x0000 }, + { 0x0c00, 0x0fb3, 0x0000 }, + { 0x8c00, 0x0fb6, 0x2000 }, + { 0x0c00, 0x0fb5, 0x0000 }, + { 0x0c00, 0x0fb7, 0x0000 }, + { 0x8c00, 0x0fbc, 0x3000 }, + { 0x8c00, 0x0fba, 0x2000 }, + { 0x0c00, 0x0fb9, 0x0000 }, + { 0x0c00, 0x0fbb, 0x0000 }, + { 0x9a00, 0x0fbf, 0x2000 }, + { 0x1a00, 0x0fbe, 0x0000 }, + { 0x1a00, 0x0fc0, 0x0000 }, + { 0x8700, 0x1003, 0x5000 }, + { 0x9a00, 0x0fc9, 0x4000 }, + { 0x9a00, 0x0fc5, 0x3000 }, + { 0x9a00, 0x0fc3, 0x2000 }, + { 0x1a00, 0x0fc2, 0x0000 }, + { 0x1a00, 0x0fc4, 0x0000 }, + { 0x9a00, 0x0fc7, 0x2000 }, + { 0x0c00, 0x0fc6, 0x0000 }, + { 0x1a00, 0x0fc8, 0x0000 }, + { 0x9a00, 0x0fcf, 0x3000 }, + { 0x9a00, 0x0fcb, 0x2000 }, + { 0x1a00, 0x0fca, 0x0000 }, + { 0x1a00, 0x0fcc, 0x0000 }, + { 0x8700, 0x1001, 0x2000 }, + { 0x0700, 0x1000, 0x0000 }, + { 0x0700, 0x1002, 0x0000 }, + { 0x8700, 0x100b, 0x4000 }, + { 0x8700, 0x1007, 0x3000 }, + { 0x8700, 0x1005, 0x2000 }, + { 0x0700, 0x1004, 0x0000 }, + { 0x0700, 0x1006, 0x0000 }, + { 0x8700, 0x1009, 0x2000 }, + { 0x0700, 0x1008, 0x0000 }, + { 0x0700, 0x100a, 0x0000 }, + { 0x8700, 0x100f, 0x3000 }, + { 0x8700, 0x100d, 0x2000 }, + { 0x0700, 0x100c, 0x0000 }, + { 0x0700, 0x100e, 0x0000 }, + { 0x8700, 0x1011, 0x2000 }, + { 0x0700, 0x1010, 0x0000 }, + { 0x0700, 0x1012, 0x0000 }, + { 0x8900, 0x10a5, 0x7000 }, + { 0x8c00, 0x1039, 0x6000 }, + { 0x8700, 0x1024, 0x5000 }, + { 0x8700, 0x101b, 0x4000 }, + { 0x8700, 0x1017, 0x3000 }, + { 0x8700, 0x1015, 0x2000 }, + { 0x0700, 0x1014, 0x0000 }, + { 0x0700, 0x1016, 0x0000 }, + { 0x8700, 0x1019, 0x2000 }, + { 0x0700, 0x1018, 0x0000 }, + { 0x0700, 0x101a, 0x0000 }, + { 0x8700, 0x101f, 0x3000 }, + { 0x8700, 0x101d, 0x2000 }, + { 0x0700, 0x101c, 0x0000 }, + { 0x0700, 0x101e, 0x0000 }, + { 0x8700, 0x1021, 0x2000 }, + { 0x0700, 0x1020, 0x0000 }, + { 0x0700, 0x1023, 0x0000 }, + { 0x8c00, 0x102e, 0x4000 }, + { 0x8700, 0x1029, 0x3000 }, + { 0x8700, 0x1026, 0x2000 }, + { 0x0700, 0x1025, 0x0000 }, + { 0x0700, 0x1027, 0x0000 }, + { 0x8a00, 0x102c, 0x2000 }, + { 0x0700, 0x102a, 0x0000 }, + { 0x0c00, 0x102d, 0x0000 }, + { 0x8c00, 0x1032, 0x3000 }, + { 0x8c00, 0x1030, 0x2000 }, + { 0x0c00, 0x102f, 0x0000 }, + { 0x0a00, 0x1031, 0x0000 }, + { 0x8c00, 0x1037, 0x2000 }, + { 0x0c00, 0x1036, 0x0000 }, + { 0x0a00, 0x1038, 0x0000 }, + { 0x9500, 0x104f, 0x5000 }, + { 0x8d00, 0x1047, 0x4000 }, + { 0x8d00, 0x1043, 0x3000 }, + { 0x8d00, 0x1041, 0x2000 }, + { 0x0d00, 0x1040, 0x0000 }, + { 0x0d00, 0x1042, 0x0000 }, + { 0x8d00, 0x1045, 0x2000 }, + { 0x0d00, 0x1044, 0x0000 }, + { 0x0d00, 0x1046, 0x0000 }, + { 0x9500, 0x104b, 0x3000 }, + { 0x8d00, 0x1049, 0x2000 }, + { 0x0d00, 0x1048, 0x0000 }, + { 0x1500, 0x104a, 0x0000 }, + { 0x9500, 0x104d, 0x2000 }, + { 0x1500, 0x104c, 0x0000 }, + { 0x1500, 0x104e, 0x0000 }, + { 0x8a00, 0x1057, 0x4000 }, + { 0x8700, 0x1053, 0x3000 }, + { 0x8700, 0x1051, 0x2000 }, + { 0x0700, 0x1050, 0x0000 }, + { 0x0700, 0x1052, 0x0000 }, + { 0x8700, 0x1055, 0x2000 }, + { 0x0700, 0x1054, 0x0000 }, + { 0x0a00, 0x1056, 0x0000 }, + { 0x8900, 0x10a1, 0x3000 }, + { 0x8c00, 0x1059, 0x2000 }, + { 0x0c00, 0x1058, 0x0000 }, + { 0x0900, 0x10a0, 0x0000 }, + { 0x8900, 0x10a3, 0x2000 }, + { 0x0900, 0x10a2, 0x0000 }, + { 0x0900, 0x10a4, 0x0000 }, + { 0x8900, 0x10c5, 0x6000 }, + { 0x8900, 0x10b5, 0x5000 }, + { 0x8900, 0x10ad, 0x4000 }, + { 0x8900, 0x10a9, 0x3000 }, + { 0x8900, 0x10a7, 0x2000 }, + { 0x0900, 0x10a6, 0x0000 }, + { 0x0900, 0x10a8, 0x0000 }, + { 0x8900, 0x10ab, 0x2000 }, + { 0x0900, 0x10aa, 0x0000 }, + { 0x0900, 0x10ac, 0x0000 }, + { 0x8900, 0x10b1, 0x3000 }, + { 0x8900, 0x10af, 0x2000 }, + { 0x0900, 0x10ae, 0x0000 }, + { 0x0900, 0x10b0, 0x0000 }, + { 0x8900, 0x10b3, 0x2000 }, + { 0x0900, 0x10b2, 0x0000 }, + { 0x0900, 0x10b4, 0x0000 }, + { 0x8900, 0x10bd, 0x4000 }, + { 0x8900, 0x10b9, 0x3000 }, + { 0x8900, 0x10b7, 0x2000 }, + { 0x0900, 0x10b6, 0x0000 }, + { 0x0900, 0x10b8, 0x0000 }, + { 0x8900, 0x10bb, 0x2000 }, + { 0x0900, 0x10ba, 0x0000 }, + { 0x0900, 0x10bc, 0x0000 }, + { 0x8900, 0x10c1, 0x3000 }, + { 0x8900, 0x10bf, 0x2000 }, + { 0x0900, 0x10be, 0x0000 }, + { 0x0900, 0x10c0, 0x0000 }, + { 0x8900, 0x10c3, 0x2000 }, + { 0x0900, 0x10c2, 0x0000 }, + { 0x0900, 0x10c4, 0x0000 }, + { 0x8700, 0x10df, 0x5000 }, + { 0x8700, 0x10d7, 0x4000 }, + { 0x8700, 0x10d3, 0x3000 }, + { 0x8700, 0x10d1, 0x2000 }, + { 0x0700, 0x10d0, 0x0000 }, + { 0x0700, 0x10d2, 0x0000 }, + { 0x8700, 0x10d5, 0x2000 }, + { 0x0700, 0x10d4, 0x0000 }, + { 0x0700, 0x10d6, 0x0000 }, + { 0x8700, 0x10db, 0x3000 }, + { 0x8700, 0x10d9, 0x2000 }, + { 0x0700, 0x10d8, 0x0000 }, + { 0x0700, 0x10da, 0x0000 }, + { 0x8700, 0x10dd, 0x2000 }, + { 0x0700, 0x10dc, 0x0000 }, + { 0x0700, 0x10de, 0x0000 }, + { 0x8700, 0x10e7, 0x4000 }, + { 0x8700, 0x10e3, 0x3000 }, + { 0x8700, 0x10e1, 0x2000 }, + { 0x0700, 0x10e0, 0x0000 }, + { 0x0700, 0x10e2, 0x0000 }, + { 0x8700, 0x10e5, 0x2000 }, + { 0x0700, 0x10e4, 0x0000 }, + { 0x0700, 0x10e6, 0x0000 }, + { 0x8700, 0x10eb, 0x3000 }, + { 0x8700, 0x10e9, 0x2000 }, + { 0x0700, 0x10e8, 0x0000 }, + { 0x0700, 0x10ea, 0x0000 }, + { 0x8700, 0x10ed, 0x2000 }, + { 0x0700, 0x10ec, 0x0000 }, + { 0x0700, 0x10ee, 0x0000 }, + { 0x8700, 0x1322, 0xa000 }, + { 0x8700, 0x1205, 0x9000 }, + { 0x8700, 0x117a, 0x8000 }, + { 0x8700, 0x1135, 0x7000 }, + { 0x8700, 0x1115, 0x6000 }, + { 0x8700, 0x1105, 0x5000 }, + { 0x8700, 0x10f7, 0x4000 }, + { 0x8700, 0x10f3, 0x3000 }, + { 0x8700, 0x10f1, 0x2000 }, + { 0x0700, 0x10f0, 0x0000 }, + { 0x0700, 0x10f2, 0x0000 }, + { 0x8700, 0x10f5, 0x2000 }, + { 0x0700, 0x10f4, 0x0000 }, + { 0x0700, 0x10f6, 0x0000 }, + { 0x8700, 0x1101, 0x3000 }, + { 0x9500, 0x10fb, 0x2000 }, + { 0x0700, 0x10f8, 0x0000 }, + { 0x0700, 0x1100, 0x0000 }, + { 0x8700, 0x1103, 0x2000 }, + { 0x0700, 0x1102, 0x0000 }, + { 0x0700, 0x1104, 0x0000 }, + { 0x8700, 0x110d, 0x4000 }, + { 0x8700, 0x1109, 0x3000 }, + { 0x8700, 0x1107, 0x2000 }, + { 0x0700, 0x1106, 0x0000 }, + { 0x0700, 0x1108, 0x0000 }, + { 0x8700, 0x110b, 0x2000 }, + { 0x0700, 0x110a, 0x0000 }, + { 0x0700, 0x110c, 0x0000 }, + { 0x8700, 0x1111, 0x3000 }, + { 0x8700, 0x110f, 0x2000 }, + { 0x0700, 0x110e, 0x0000 }, + { 0x0700, 0x1110, 0x0000 }, + { 0x8700, 0x1113, 0x2000 }, + { 0x0700, 0x1112, 0x0000 }, + { 0x0700, 0x1114, 0x0000 }, + { 0x8700, 0x1125, 0x5000 }, + { 0x8700, 0x111d, 0x4000 }, + { 0x8700, 0x1119, 0x3000 }, + { 0x8700, 0x1117, 0x2000 }, + { 0x0700, 0x1116, 0x0000 }, + { 0x0700, 0x1118, 0x0000 }, + { 0x8700, 0x111b, 0x2000 }, + { 0x0700, 0x111a, 0x0000 }, + { 0x0700, 0x111c, 0x0000 }, + { 0x8700, 0x1121, 0x3000 }, + { 0x8700, 0x111f, 0x2000 }, + { 0x0700, 0x111e, 0x0000 }, + { 0x0700, 0x1120, 0x0000 }, + { 0x8700, 0x1123, 0x2000 }, + { 0x0700, 0x1122, 0x0000 }, + { 0x0700, 0x1124, 0x0000 }, + { 0x8700, 0x112d, 0x4000 }, + { 0x8700, 0x1129, 0x3000 }, + { 0x8700, 0x1127, 0x2000 }, + { 0x0700, 0x1126, 0x0000 }, + { 0x0700, 0x1128, 0x0000 }, + { 0x8700, 0x112b, 0x2000 }, + { 0x0700, 0x112a, 0x0000 }, + { 0x0700, 0x112c, 0x0000 }, + { 0x8700, 0x1131, 0x3000 }, + { 0x8700, 0x112f, 0x2000 }, + { 0x0700, 0x112e, 0x0000 }, + { 0x0700, 0x1130, 0x0000 }, + { 0x8700, 0x1133, 0x2000 }, + { 0x0700, 0x1132, 0x0000 }, + { 0x0700, 0x1134, 0x0000 }, + { 0x8700, 0x1155, 0x6000 }, + { 0x8700, 0x1145, 0x5000 }, + { 0x8700, 0x113d, 0x4000 }, + { 0x8700, 0x1139, 0x3000 }, + { 0x8700, 0x1137, 0x2000 }, + { 0x0700, 0x1136, 0x0000 }, + { 0x0700, 0x1138, 0x0000 }, + { 0x8700, 0x113b, 0x2000 }, + { 0x0700, 0x113a, 0x0000 }, + { 0x0700, 0x113c, 0x0000 }, + { 0x8700, 0x1141, 0x3000 }, + { 0x8700, 0x113f, 0x2000 }, + { 0x0700, 0x113e, 0x0000 }, + { 0x0700, 0x1140, 0x0000 }, + { 0x8700, 0x1143, 0x2000 }, + { 0x0700, 0x1142, 0x0000 }, + { 0x0700, 0x1144, 0x0000 }, + { 0x8700, 0x114d, 0x4000 }, + { 0x8700, 0x1149, 0x3000 }, + { 0x8700, 0x1147, 0x2000 }, + { 0x0700, 0x1146, 0x0000 }, + { 0x0700, 0x1148, 0x0000 }, + { 0x8700, 0x114b, 0x2000 }, + { 0x0700, 0x114a, 0x0000 }, + { 0x0700, 0x114c, 0x0000 }, + { 0x8700, 0x1151, 0x3000 }, + { 0x8700, 0x114f, 0x2000 }, + { 0x0700, 0x114e, 0x0000 }, + { 0x0700, 0x1150, 0x0000 }, + { 0x8700, 0x1153, 0x2000 }, + { 0x0700, 0x1152, 0x0000 }, + { 0x0700, 0x1154, 0x0000 }, + { 0x8700, 0x116a, 0x5000 }, + { 0x8700, 0x1162, 0x4000 }, + { 0x8700, 0x1159, 0x3000 }, + { 0x8700, 0x1157, 0x2000 }, + { 0x0700, 0x1156, 0x0000 }, + { 0x0700, 0x1158, 0x0000 }, + { 0x8700, 0x1160, 0x2000 }, + { 0x0700, 0x115f, 0x0000 }, + { 0x0700, 0x1161, 0x0000 }, + { 0x8700, 0x1166, 0x3000 }, + { 0x8700, 0x1164, 0x2000 }, + { 0x0700, 0x1163, 0x0000 }, + { 0x0700, 0x1165, 0x0000 }, + { 0x8700, 0x1168, 0x2000 }, + { 0x0700, 0x1167, 0x0000 }, + { 0x0700, 0x1169, 0x0000 }, + { 0x8700, 0x1172, 0x4000 }, + { 0x8700, 0x116e, 0x3000 }, + { 0x8700, 0x116c, 0x2000 }, + { 0x0700, 0x116b, 0x0000 }, + { 0x0700, 0x116d, 0x0000 }, + { 0x8700, 0x1170, 0x2000 }, + { 0x0700, 0x116f, 0x0000 }, + { 0x0700, 0x1171, 0x0000 }, + { 0x8700, 0x1176, 0x3000 }, + { 0x8700, 0x1174, 0x2000 }, + { 0x0700, 0x1173, 0x0000 }, + { 0x0700, 0x1175, 0x0000 }, + { 0x8700, 0x1178, 0x2000 }, + { 0x0700, 0x1177, 0x0000 }, + { 0x0700, 0x1179, 0x0000 }, + { 0x8700, 0x11bf, 0x7000 }, + { 0x8700, 0x119a, 0x6000 }, + { 0x8700, 0x118a, 0x5000 }, + { 0x8700, 0x1182, 0x4000 }, + { 0x8700, 0x117e, 0x3000 }, + { 0x8700, 0x117c, 0x2000 }, + { 0x0700, 0x117b, 0x0000 }, + { 0x0700, 0x117d, 0x0000 }, + { 0x8700, 0x1180, 0x2000 }, + { 0x0700, 0x117f, 0x0000 }, + { 0x0700, 0x1181, 0x0000 }, + { 0x8700, 0x1186, 0x3000 }, + { 0x8700, 0x1184, 0x2000 }, + { 0x0700, 0x1183, 0x0000 }, + { 0x0700, 0x1185, 0x0000 }, + { 0x8700, 0x1188, 0x2000 }, + { 0x0700, 0x1187, 0x0000 }, + { 0x0700, 0x1189, 0x0000 }, + { 0x8700, 0x1192, 0x4000 }, + { 0x8700, 0x118e, 0x3000 }, + { 0x8700, 0x118c, 0x2000 }, + { 0x0700, 0x118b, 0x0000 }, + { 0x0700, 0x118d, 0x0000 }, + { 0x8700, 0x1190, 0x2000 }, + { 0x0700, 0x118f, 0x0000 }, + { 0x0700, 0x1191, 0x0000 }, + { 0x8700, 0x1196, 0x3000 }, + { 0x8700, 0x1194, 0x2000 }, + { 0x0700, 0x1193, 0x0000 }, + { 0x0700, 0x1195, 0x0000 }, + { 0x8700, 0x1198, 0x2000 }, + { 0x0700, 0x1197, 0x0000 }, + { 0x0700, 0x1199, 0x0000 }, + { 0x8700, 0x11af, 0x5000 }, + { 0x8700, 0x11a2, 0x4000 }, + { 0x8700, 0x119e, 0x3000 }, + { 0x8700, 0x119c, 0x2000 }, + { 0x0700, 0x119b, 0x0000 }, + { 0x0700, 0x119d, 0x0000 }, + { 0x8700, 0x11a0, 0x2000 }, + { 0x0700, 0x119f, 0x0000 }, + { 0x0700, 0x11a1, 0x0000 }, + { 0x8700, 0x11ab, 0x3000 }, + { 0x8700, 0x11a9, 0x2000 }, + { 0x0700, 0x11a8, 0x0000 }, + { 0x0700, 0x11aa, 0x0000 }, + { 0x8700, 0x11ad, 0x2000 }, + { 0x0700, 0x11ac, 0x0000 }, + { 0x0700, 0x11ae, 0x0000 }, + { 0x8700, 0x11b7, 0x4000 }, + { 0x8700, 0x11b3, 0x3000 }, + { 0x8700, 0x11b1, 0x2000 }, + { 0x0700, 0x11b0, 0x0000 }, + { 0x0700, 0x11b2, 0x0000 }, + { 0x8700, 0x11b5, 0x2000 }, + { 0x0700, 0x11b4, 0x0000 }, + { 0x0700, 0x11b6, 0x0000 }, + { 0x8700, 0x11bb, 0x3000 }, + { 0x8700, 0x11b9, 0x2000 }, + { 0x0700, 0x11b8, 0x0000 }, + { 0x0700, 0x11ba, 0x0000 }, + { 0x8700, 0x11bd, 0x2000 }, + { 0x0700, 0x11bc, 0x0000 }, + { 0x0700, 0x11be, 0x0000 }, + { 0x8700, 0x11df, 0x6000 }, + { 0x8700, 0x11cf, 0x5000 }, + { 0x8700, 0x11c7, 0x4000 }, + { 0x8700, 0x11c3, 0x3000 }, + { 0x8700, 0x11c1, 0x2000 }, + { 0x0700, 0x11c0, 0x0000 }, + { 0x0700, 0x11c2, 0x0000 }, + { 0x8700, 0x11c5, 0x2000 }, + { 0x0700, 0x11c4, 0x0000 }, + { 0x0700, 0x11c6, 0x0000 }, + { 0x8700, 0x11cb, 0x3000 }, + { 0x8700, 0x11c9, 0x2000 }, + { 0x0700, 0x11c8, 0x0000 }, + { 0x0700, 0x11ca, 0x0000 }, + { 0x8700, 0x11cd, 0x2000 }, + { 0x0700, 0x11cc, 0x0000 }, + { 0x0700, 0x11ce, 0x0000 }, + { 0x8700, 0x11d7, 0x4000 }, + { 0x8700, 0x11d3, 0x3000 }, + { 0x8700, 0x11d1, 0x2000 }, + { 0x0700, 0x11d0, 0x0000 }, + { 0x0700, 0x11d2, 0x0000 }, + { 0x8700, 0x11d5, 0x2000 }, + { 0x0700, 0x11d4, 0x0000 }, + { 0x0700, 0x11d6, 0x0000 }, + { 0x8700, 0x11db, 0x3000 }, + { 0x8700, 0x11d9, 0x2000 }, + { 0x0700, 0x11d8, 0x0000 }, + { 0x0700, 0x11da, 0x0000 }, + { 0x8700, 0x11dd, 0x2000 }, + { 0x0700, 0x11dc, 0x0000 }, + { 0x0700, 0x11de, 0x0000 }, + { 0x8700, 0x11ef, 0x5000 }, + { 0x8700, 0x11e7, 0x4000 }, + { 0x8700, 0x11e3, 0x3000 }, + { 0x8700, 0x11e1, 0x2000 }, + { 0x0700, 0x11e0, 0x0000 }, + { 0x0700, 0x11e2, 0x0000 }, + { 0x8700, 0x11e5, 0x2000 }, + { 0x0700, 0x11e4, 0x0000 }, + { 0x0700, 0x11e6, 0x0000 }, + { 0x8700, 0x11eb, 0x3000 }, + { 0x8700, 0x11e9, 0x2000 }, + { 0x0700, 0x11e8, 0x0000 }, + { 0x0700, 0x11ea, 0x0000 }, + { 0x8700, 0x11ed, 0x2000 }, + { 0x0700, 0x11ec, 0x0000 }, + { 0x0700, 0x11ee, 0x0000 }, + { 0x8700, 0x11f7, 0x4000 }, + { 0x8700, 0x11f3, 0x3000 }, + { 0x8700, 0x11f1, 0x2000 }, + { 0x0700, 0x11f0, 0x0000 }, + { 0x0700, 0x11f2, 0x0000 }, + { 0x8700, 0x11f5, 0x2000 }, + { 0x0700, 0x11f4, 0x0000 }, + { 0x0700, 0x11f6, 0x0000 }, + { 0x8700, 0x1201, 0x3000 }, + { 0x8700, 0x11f9, 0x2000 }, + { 0x0700, 0x11f8, 0x0000 }, + { 0x0700, 0x1200, 0x0000 }, + { 0x8700, 0x1203, 0x2000 }, + { 0x0700, 0x1202, 0x0000 }, + { 0x0700, 0x1204, 0x0000 }, + { 0x8700, 0x1292, 0x8000 }, + { 0x8700, 0x1246, 0x7000 }, + { 0x8700, 0x1226, 0x6000 }, + { 0x8700, 0x1216, 0x5000 }, + { 0x8700, 0x120e, 0x4000 }, + { 0x8700, 0x120a, 0x3000 }, + { 0x8700, 0x1208, 0x2000 }, + { 0x0700, 0x1206, 0x0000 }, + { 0x0700, 0x1209, 0x0000 }, + { 0x8700, 0x120c, 0x2000 }, + { 0x0700, 0x120b, 0x0000 }, + { 0x0700, 0x120d, 0x0000 }, + { 0x8700, 0x1212, 0x3000 }, + { 0x8700, 0x1210, 0x2000 }, + { 0x0700, 0x120f, 0x0000 }, + { 0x0700, 0x1211, 0x0000 }, + { 0x8700, 0x1214, 0x2000 }, + { 0x0700, 0x1213, 0x0000 }, + { 0x0700, 0x1215, 0x0000 }, + { 0x8700, 0x121e, 0x4000 }, + { 0x8700, 0x121a, 0x3000 }, + { 0x8700, 0x1218, 0x2000 }, + { 0x0700, 0x1217, 0x0000 }, + { 0x0700, 0x1219, 0x0000 }, + { 0x8700, 0x121c, 0x2000 }, + { 0x0700, 0x121b, 0x0000 }, + { 0x0700, 0x121d, 0x0000 }, + { 0x8700, 0x1222, 0x3000 }, + { 0x8700, 0x1220, 0x2000 }, + { 0x0700, 0x121f, 0x0000 }, + { 0x0700, 0x1221, 0x0000 }, + { 0x8700, 0x1224, 0x2000 }, + { 0x0700, 0x1223, 0x0000 }, + { 0x0700, 0x1225, 0x0000 }, + { 0x8700, 0x1236, 0x5000 }, + { 0x8700, 0x122e, 0x4000 }, + { 0x8700, 0x122a, 0x3000 }, + { 0x8700, 0x1228, 0x2000 }, + { 0x0700, 0x1227, 0x0000 }, + { 0x0700, 0x1229, 0x0000 }, + { 0x8700, 0x122c, 0x2000 }, + { 0x0700, 0x122b, 0x0000 }, + { 0x0700, 0x122d, 0x0000 }, + { 0x8700, 0x1232, 0x3000 }, + { 0x8700, 0x1230, 0x2000 }, + { 0x0700, 0x122f, 0x0000 }, + { 0x0700, 0x1231, 0x0000 }, + { 0x8700, 0x1234, 0x2000 }, + { 0x0700, 0x1233, 0x0000 }, + { 0x0700, 0x1235, 0x0000 }, + { 0x8700, 0x123e, 0x4000 }, + { 0x8700, 0x123a, 0x3000 }, + { 0x8700, 0x1238, 0x2000 }, + { 0x0700, 0x1237, 0x0000 }, + { 0x0700, 0x1239, 0x0000 }, + { 0x8700, 0x123c, 0x2000 }, + { 0x0700, 0x123b, 0x0000 }, + { 0x0700, 0x123d, 0x0000 }, + { 0x8700, 0x1242, 0x3000 }, + { 0x8700, 0x1240, 0x2000 }, + { 0x0700, 0x123f, 0x0000 }, + { 0x0700, 0x1241, 0x0000 }, + { 0x8700, 0x1244, 0x2000 }, + { 0x0700, 0x1243, 0x0000 }, + { 0x0700, 0x1245, 0x0000 }, + { 0x8700, 0x126e, 0x6000 }, + { 0x8700, 0x125c, 0x5000 }, + { 0x8700, 0x1252, 0x4000 }, + { 0x8700, 0x124c, 0x3000 }, + { 0x8700, 0x124a, 0x2000 }, + { 0x0700, 0x1248, 0x0000 }, + { 0x0700, 0x124b, 0x0000 }, + { 0x8700, 0x1250, 0x2000 }, + { 0x0700, 0x124d, 0x0000 }, + { 0x0700, 0x1251, 0x0000 }, + { 0x8700, 0x1256, 0x3000 }, + { 0x8700, 0x1254, 0x2000 }, + { 0x0700, 0x1253, 0x0000 }, + { 0x0700, 0x1255, 0x0000 }, + { 0x8700, 0x125a, 0x2000 }, + { 0x0700, 0x1258, 0x0000 }, + { 0x0700, 0x125b, 0x0000 }, + { 0x8700, 0x1266, 0x4000 }, + { 0x8700, 0x1262, 0x3000 }, + { 0x8700, 0x1260, 0x2000 }, + { 0x0700, 0x125d, 0x0000 }, + { 0x0700, 0x1261, 0x0000 }, + { 0x8700, 0x1264, 0x2000 }, + { 0x0700, 0x1263, 0x0000 }, + { 0x0700, 0x1265, 0x0000 }, + { 0x8700, 0x126a, 0x3000 }, + { 0x8700, 0x1268, 0x2000 }, + { 0x0700, 0x1267, 0x0000 }, + { 0x0700, 0x1269, 0x0000 }, + { 0x8700, 0x126c, 0x2000 }, + { 0x0700, 0x126b, 0x0000 }, + { 0x0700, 0x126d, 0x0000 }, + { 0x8700, 0x127e, 0x5000 }, + { 0x8700, 0x1276, 0x4000 }, + { 0x8700, 0x1272, 0x3000 }, + { 0x8700, 0x1270, 0x2000 }, + { 0x0700, 0x126f, 0x0000 }, + { 0x0700, 0x1271, 0x0000 }, + { 0x8700, 0x1274, 0x2000 }, + { 0x0700, 0x1273, 0x0000 }, + { 0x0700, 0x1275, 0x0000 }, + { 0x8700, 0x127a, 0x3000 }, + { 0x8700, 0x1278, 0x2000 }, + { 0x0700, 0x1277, 0x0000 }, + { 0x0700, 0x1279, 0x0000 }, + { 0x8700, 0x127c, 0x2000 }, + { 0x0700, 0x127b, 0x0000 }, + { 0x0700, 0x127d, 0x0000 }, + { 0x8700, 0x1286, 0x4000 }, + { 0x8700, 0x1282, 0x3000 }, + { 0x8700, 0x1280, 0x2000 }, + { 0x0700, 0x127f, 0x0000 }, + { 0x0700, 0x1281, 0x0000 }, + { 0x8700, 0x1284, 0x2000 }, + { 0x0700, 0x1283, 0x0000 }, + { 0x0700, 0x1285, 0x0000 }, + { 0x8700, 0x128c, 0x3000 }, + { 0x8700, 0x128a, 0x2000 }, + { 0x0700, 0x1288, 0x0000 }, + { 0x0700, 0x128b, 0x0000 }, + { 0x8700, 0x1290, 0x2000 }, + { 0x0700, 0x128d, 0x0000 }, + { 0x0700, 0x1291, 0x0000 }, + { 0x8700, 0x12dc, 0x7000 }, + { 0x8700, 0x12b4, 0x6000 }, + { 0x8700, 0x12a2, 0x5000 }, + { 0x8700, 0x129a, 0x4000 }, + { 0x8700, 0x1296, 0x3000 }, + { 0x8700, 0x1294, 0x2000 }, + { 0x0700, 0x1293, 0x0000 }, + { 0x0700, 0x1295, 0x0000 }, + { 0x8700, 0x1298, 0x2000 }, + { 0x0700, 0x1297, 0x0000 }, + { 0x0700, 0x1299, 0x0000 }, + { 0x8700, 0x129e, 0x3000 }, + { 0x8700, 0x129c, 0x2000 }, + { 0x0700, 0x129b, 0x0000 }, + { 0x0700, 0x129d, 0x0000 }, + { 0x8700, 0x12a0, 0x2000 }, + { 0x0700, 0x129f, 0x0000 }, + { 0x0700, 0x12a1, 0x0000 }, + { 0x8700, 0x12aa, 0x4000 }, + { 0x8700, 0x12a6, 0x3000 }, + { 0x8700, 0x12a4, 0x2000 }, + { 0x0700, 0x12a3, 0x0000 }, + { 0x0700, 0x12a5, 0x0000 }, + { 0x8700, 0x12a8, 0x2000 }, + { 0x0700, 0x12a7, 0x0000 }, + { 0x0700, 0x12a9, 0x0000 }, + { 0x8700, 0x12ae, 0x3000 }, + { 0x8700, 0x12ac, 0x2000 }, + { 0x0700, 0x12ab, 0x0000 }, + { 0x0700, 0x12ad, 0x0000 }, + { 0x8700, 0x12b2, 0x2000 }, + { 0x0700, 0x12b0, 0x0000 }, + { 0x0700, 0x12b3, 0x0000 }, + { 0x8700, 0x12ca, 0x5000 }, + { 0x8700, 0x12be, 0x4000 }, + { 0x8700, 0x12ba, 0x3000 }, + { 0x8700, 0x12b8, 0x2000 }, + { 0x0700, 0x12b5, 0x0000 }, + { 0x0700, 0x12b9, 0x0000 }, + { 0x8700, 0x12bc, 0x2000 }, + { 0x0700, 0x12bb, 0x0000 }, + { 0x0700, 0x12bd, 0x0000 }, + { 0x8700, 0x12c4, 0x3000 }, + { 0x8700, 0x12c2, 0x2000 }, + { 0x0700, 0x12c0, 0x0000 }, + { 0x0700, 0x12c3, 0x0000 }, + { 0x8700, 0x12c8, 0x2000 }, + { 0x0700, 0x12c5, 0x0000 }, + { 0x0700, 0x12c9, 0x0000 }, + { 0x8700, 0x12d3, 0x4000 }, + { 0x8700, 0x12ce, 0x3000 }, + { 0x8700, 0x12cc, 0x2000 }, + { 0x0700, 0x12cb, 0x0000 }, + { 0x0700, 0x12cd, 0x0000 }, + { 0x8700, 0x12d1, 0x2000 }, + { 0x0700, 0x12d0, 0x0000 }, + { 0x0700, 0x12d2, 0x0000 }, + { 0x8700, 0x12d8, 0x3000 }, + { 0x8700, 0x12d5, 0x2000 }, + { 0x0700, 0x12d4, 0x0000 }, + { 0x0700, 0x12d6, 0x0000 }, + { 0x8700, 0x12da, 0x2000 }, + { 0x0700, 0x12d9, 0x0000 }, + { 0x0700, 0x12db, 0x0000 }, + { 0x8700, 0x12fd, 0x6000 }, + { 0x8700, 0x12ec, 0x5000 }, + { 0x8700, 0x12e4, 0x4000 }, + { 0x8700, 0x12e0, 0x3000 }, + { 0x8700, 0x12de, 0x2000 }, + { 0x0700, 0x12dd, 0x0000 }, + { 0x0700, 0x12df, 0x0000 }, + { 0x8700, 0x12e2, 0x2000 }, + { 0x0700, 0x12e1, 0x0000 }, + { 0x0700, 0x12e3, 0x0000 }, + { 0x8700, 0x12e8, 0x3000 }, + { 0x8700, 0x12e6, 0x2000 }, + { 0x0700, 0x12e5, 0x0000 }, + { 0x0700, 0x12e7, 0x0000 }, + { 0x8700, 0x12ea, 0x2000 }, + { 0x0700, 0x12e9, 0x0000 }, + { 0x0700, 0x12eb, 0x0000 }, + { 0x8700, 0x12f5, 0x4000 }, + { 0x8700, 0x12f1, 0x3000 }, + { 0x8700, 0x12ee, 0x2000 }, + { 0x0700, 0x12ed, 0x0000 }, + { 0x0700, 0x12f0, 0x0000 }, + { 0x8700, 0x12f3, 0x2000 }, + { 0x0700, 0x12f2, 0x0000 }, + { 0x0700, 0x12f4, 0x0000 }, + { 0x8700, 0x12f9, 0x3000 }, + { 0x8700, 0x12f7, 0x2000 }, + { 0x0700, 0x12f6, 0x0000 }, + { 0x0700, 0x12f8, 0x0000 }, + { 0x8700, 0x12fb, 0x2000 }, + { 0x0700, 0x12fa, 0x0000 }, + { 0x0700, 0x12fc, 0x0000 }, + { 0x8700, 0x130d, 0x5000 }, + { 0x8700, 0x1305, 0x4000 }, + { 0x8700, 0x1301, 0x3000 }, + { 0x8700, 0x12ff, 0x2000 }, + { 0x0700, 0x12fe, 0x0000 }, + { 0x0700, 0x1300, 0x0000 }, + { 0x8700, 0x1303, 0x2000 }, + { 0x0700, 0x1302, 0x0000 }, + { 0x0700, 0x1304, 0x0000 }, + { 0x8700, 0x1309, 0x3000 }, + { 0x8700, 0x1307, 0x2000 }, + { 0x0700, 0x1306, 0x0000 }, + { 0x0700, 0x1308, 0x0000 }, + { 0x8700, 0x130b, 0x2000 }, + { 0x0700, 0x130a, 0x0000 }, + { 0x0700, 0x130c, 0x0000 }, + { 0x8700, 0x1319, 0x4000 }, + { 0x8700, 0x1313, 0x3000 }, + { 0x8700, 0x1310, 0x2000 }, + { 0x0700, 0x130e, 0x0000 }, + { 0x0700, 0x1312, 0x0000 }, + { 0x8700, 0x1315, 0x2000 }, + { 0x0700, 0x1314, 0x0000 }, + { 0x0700, 0x1318, 0x0000 }, + { 0x8700, 0x131d, 0x3000 }, + { 0x8700, 0x131b, 0x2000 }, + { 0x0700, 0x131a, 0x0000 }, + { 0x0700, 0x131c, 0x0000 }, + { 0x8700, 0x1320, 0x2000 }, + { 0x0700, 0x131e, 0x0000 }, + { 0x0700, 0x1321, 0x0000 }, + { 0x8700, 0x1458, 0x9000 }, + { 0x8700, 0x13cc, 0x8000 }, + { 0x8d00, 0x1369, 0x7000 }, + { 0x8700, 0x1342, 0x6000 }, + { 0x8700, 0x1332, 0x5000 }, + { 0x8700, 0x132a, 0x4000 }, + { 0x8700, 0x1326, 0x3000 }, + { 0x8700, 0x1324, 0x2000 }, + { 0x0700, 0x1323, 0x0000 }, + { 0x0700, 0x1325, 0x0000 }, + { 0x8700, 0x1328, 0x2000 }, + { 0x0700, 0x1327, 0x0000 }, + { 0x0700, 0x1329, 0x0000 }, + { 0x8700, 0x132e, 0x3000 }, + { 0x8700, 0x132c, 0x2000 }, + { 0x0700, 0x132b, 0x0000 }, + { 0x0700, 0x132d, 0x0000 }, + { 0x8700, 0x1330, 0x2000 }, + { 0x0700, 0x132f, 0x0000 }, + { 0x0700, 0x1331, 0x0000 }, + { 0x8700, 0x133a, 0x4000 }, + { 0x8700, 0x1336, 0x3000 }, + { 0x8700, 0x1334, 0x2000 }, + { 0x0700, 0x1333, 0x0000 }, + { 0x0700, 0x1335, 0x0000 }, + { 0x8700, 0x1338, 0x2000 }, + { 0x0700, 0x1337, 0x0000 }, + { 0x0700, 0x1339, 0x0000 }, + { 0x8700, 0x133e, 0x3000 }, + { 0x8700, 0x133c, 0x2000 }, + { 0x0700, 0x133b, 0x0000 }, + { 0x0700, 0x133d, 0x0000 }, + { 0x8700, 0x1340, 0x2000 }, + { 0x0700, 0x133f, 0x0000 }, + { 0x0700, 0x1341, 0x0000 }, + { 0x8700, 0x1353, 0x5000 }, + { 0x8700, 0x134b, 0x4000 }, + { 0x8700, 0x1346, 0x3000 }, + { 0x8700, 0x1344, 0x2000 }, + { 0x0700, 0x1343, 0x0000 }, + { 0x0700, 0x1345, 0x0000 }, + { 0x8700, 0x1349, 0x2000 }, + { 0x0700, 0x1348, 0x0000 }, + { 0x0700, 0x134a, 0x0000 }, + { 0x8700, 0x134f, 0x3000 }, + { 0x8700, 0x134d, 0x2000 }, + { 0x0700, 0x134c, 0x0000 }, + { 0x0700, 0x134e, 0x0000 }, + { 0x8700, 0x1351, 0x2000 }, + { 0x0700, 0x1350, 0x0000 }, + { 0x0700, 0x1352, 0x0000 }, + { 0x9500, 0x1361, 0x4000 }, + { 0x8700, 0x1357, 0x3000 }, + { 0x8700, 0x1355, 0x2000 }, + { 0x0700, 0x1354, 0x0000 }, + { 0x0700, 0x1356, 0x0000 }, + { 0x8700, 0x1359, 0x2000 }, + { 0x0700, 0x1358, 0x0000 }, + { 0x0700, 0x135a, 0x0000 }, + { 0x9500, 0x1365, 0x3000 }, + { 0x9500, 0x1363, 0x2000 }, + { 0x1500, 0x1362, 0x0000 }, + { 0x1500, 0x1364, 0x0000 }, + { 0x9500, 0x1367, 0x2000 }, + { 0x1500, 0x1366, 0x0000 }, + { 0x1500, 0x1368, 0x0000 }, + { 0x8700, 0x13ac, 0x6000 }, + { 0x8f00, 0x1379, 0x5000 }, + { 0x8d00, 0x1371, 0x4000 }, + { 0x8d00, 0x136d, 0x3000 }, + { 0x8d00, 0x136b, 0x2000 }, + { 0x0d00, 0x136a, 0x0000 }, + { 0x0d00, 0x136c, 0x0000 }, + { 0x8d00, 0x136f, 0x2000 }, + { 0x0d00, 0x136e, 0x0000 }, + { 0x0d00, 0x1370, 0x0000 }, + { 0x8f00, 0x1375, 0x3000 }, + { 0x8f00, 0x1373, 0x2000 }, + { 0x0f00, 0x1372, 0x0000 }, + { 0x0f00, 0x1374, 0x0000 }, + { 0x8f00, 0x1377, 0x2000 }, + { 0x0f00, 0x1376, 0x0000 }, + { 0x0f00, 0x1378, 0x0000 }, + { 0x8700, 0x13a4, 0x4000 }, + { 0x8700, 0x13a0, 0x3000 }, + { 0x8f00, 0x137b, 0x2000 }, + { 0x0f00, 0x137a, 0x0000 }, + { 0x0f00, 0x137c, 0x0000 }, + { 0x8700, 0x13a2, 0x2000 }, + { 0x0700, 0x13a1, 0x0000 }, + { 0x0700, 0x13a3, 0x0000 }, + { 0x8700, 0x13a8, 0x3000 }, + { 0x8700, 0x13a6, 0x2000 }, + { 0x0700, 0x13a5, 0x0000 }, + { 0x0700, 0x13a7, 0x0000 }, + { 0x8700, 0x13aa, 0x2000 }, + { 0x0700, 0x13a9, 0x0000 }, + { 0x0700, 0x13ab, 0x0000 }, + { 0x8700, 0x13bc, 0x5000 }, + { 0x8700, 0x13b4, 0x4000 }, + { 0x8700, 0x13b0, 0x3000 }, + { 0x8700, 0x13ae, 0x2000 }, + { 0x0700, 0x13ad, 0x0000 }, + { 0x0700, 0x13af, 0x0000 }, + { 0x8700, 0x13b2, 0x2000 }, + { 0x0700, 0x13b1, 0x0000 }, + { 0x0700, 0x13b3, 0x0000 }, + { 0x8700, 0x13b8, 0x3000 }, + { 0x8700, 0x13b6, 0x2000 }, + { 0x0700, 0x13b5, 0x0000 }, + { 0x0700, 0x13b7, 0x0000 }, + { 0x8700, 0x13ba, 0x2000 }, + { 0x0700, 0x13b9, 0x0000 }, + { 0x0700, 0x13bb, 0x0000 }, + { 0x8700, 0x13c4, 0x4000 }, + { 0x8700, 0x13c0, 0x3000 }, + { 0x8700, 0x13be, 0x2000 }, + { 0x0700, 0x13bd, 0x0000 }, + { 0x0700, 0x13bf, 0x0000 }, + { 0x8700, 0x13c2, 0x2000 }, + { 0x0700, 0x13c1, 0x0000 }, + { 0x0700, 0x13c3, 0x0000 }, + { 0x8700, 0x13c8, 0x3000 }, + { 0x8700, 0x13c6, 0x2000 }, + { 0x0700, 0x13c5, 0x0000 }, + { 0x0700, 0x13c7, 0x0000 }, + { 0x8700, 0x13ca, 0x2000 }, + { 0x0700, 0x13c9, 0x0000 }, + { 0x0700, 0x13cb, 0x0000 }, + { 0x8700, 0x1418, 0x7000 }, + { 0x8700, 0x13ec, 0x6000 }, + { 0x8700, 0x13dc, 0x5000 }, + { 0x8700, 0x13d4, 0x4000 }, + { 0x8700, 0x13d0, 0x3000 }, + { 0x8700, 0x13ce, 0x2000 }, + { 0x0700, 0x13cd, 0x0000 }, + { 0x0700, 0x13cf, 0x0000 }, + { 0x8700, 0x13d2, 0x2000 }, + { 0x0700, 0x13d1, 0x0000 }, + { 0x0700, 0x13d3, 0x0000 }, + { 0x8700, 0x13d8, 0x3000 }, + { 0x8700, 0x13d6, 0x2000 }, + { 0x0700, 0x13d5, 0x0000 }, + { 0x0700, 0x13d7, 0x0000 }, + { 0x8700, 0x13da, 0x2000 }, + { 0x0700, 0x13d9, 0x0000 }, + { 0x0700, 0x13db, 0x0000 }, + { 0x8700, 0x13e4, 0x4000 }, + { 0x8700, 0x13e0, 0x3000 }, + { 0x8700, 0x13de, 0x2000 }, + { 0x0700, 0x13dd, 0x0000 }, + { 0x0700, 0x13df, 0x0000 }, + { 0x8700, 0x13e2, 0x2000 }, + { 0x0700, 0x13e1, 0x0000 }, + { 0x0700, 0x13e3, 0x0000 }, + { 0x8700, 0x13e8, 0x3000 }, + { 0x8700, 0x13e6, 0x2000 }, + { 0x0700, 0x13e5, 0x0000 }, + { 0x0700, 0x13e7, 0x0000 }, + { 0x8700, 0x13ea, 0x2000 }, + { 0x0700, 0x13e9, 0x0000 }, + { 0x0700, 0x13eb, 0x0000 }, + { 0x8700, 0x1408, 0x5000 }, + { 0x8700, 0x13f4, 0x4000 }, + { 0x8700, 0x13f0, 0x3000 }, + { 0x8700, 0x13ee, 0x2000 }, + { 0x0700, 0x13ed, 0x0000 }, + { 0x0700, 0x13ef, 0x0000 }, + { 0x8700, 0x13f2, 0x2000 }, + { 0x0700, 0x13f1, 0x0000 }, + { 0x0700, 0x13f3, 0x0000 }, + { 0x8700, 0x1404, 0x3000 }, + { 0x8700, 0x1402, 0x2000 }, + { 0x0700, 0x1401, 0x0000 }, + { 0x0700, 0x1403, 0x0000 }, + { 0x8700, 0x1406, 0x2000 }, + { 0x0700, 0x1405, 0x0000 }, + { 0x0700, 0x1407, 0x0000 }, + { 0x8700, 0x1410, 0x4000 }, + { 0x8700, 0x140c, 0x3000 }, + { 0x8700, 0x140a, 0x2000 }, + { 0x0700, 0x1409, 0x0000 }, + { 0x0700, 0x140b, 0x0000 }, + { 0x8700, 0x140e, 0x2000 }, + { 0x0700, 0x140d, 0x0000 }, + { 0x0700, 0x140f, 0x0000 }, + { 0x8700, 0x1414, 0x3000 }, + { 0x8700, 0x1412, 0x2000 }, + { 0x0700, 0x1411, 0x0000 }, + { 0x0700, 0x1413, 0x0000 }, + { 0x8700, 0x1416, 0x2000 }, + { 0x0700, 0x1415, 0x0000 }, + { 0x0700, 0x1417, 0x0000 }, + { 0x8700, 0x1438, 0x6000 }, + { 0x8700, 0x1428, 0x5000 }, + { 0x8700, 0x1420, 0x4000 }, + { 0x8700, 0x141c, 0x3000 }, + { 0x8700, 0x141a, 0x2000 }, + { 0x0700, 0x1419, 0x0000 }, + { 0x0700, 0x141b, 0x0000 }, + { 0x8700, 0x141e, 0x2000 }, + { 0x0700, 0x141d, 0x0000 }, + { 0x0700, 0x141f, 0x0000 }, + { 0x8700, 0x1424, 0x3000 }, + { 0x8700, 0x1422, 0x2000 }, + { 0x0700, 0x1421, 0x0000 }, + { 0x0700, 0x1423, 0x0000 }, + { 0x8700, 0x1426, 0x2000 }, + { 0x0700, 0x1425, 0x0000 }, + { 0x0700, 0x1427, 0x0000 }, + { 0x8700, 0x1430, 0x4000 }, + { 0x8700, 0x142c, 0x3000 }, + { 0x8700, 0x142a, 0x2000 }, + { 0x0700, 0x1429, 0x0000 }, + { 0x0700, 0x142b, 0x0000 }, + { 0x8700, 0x142e, 0x2000 }, + { 0x0700, 0x142d, 0x0000 }, + { 0x0700, 0x142f, 0x0000 }, + { 0x8700, 0x1434, 0x3000 }, + { 0x8700, 0x1432, 0x2000 }, + { 0x0700, 0x1431, 0x0000 }, + { 0x0700, 0x1433, 0x0000 }, + { 0x8700, 0x1436, 0x2000 }, + { 0x0700, 0x1435, 0x0000 }, + { 0x0700, 0x1437, 0x0000 }, + { 0x8700, 0x1448, 0x5000 }, + { 0x8700, 0x1440, 0x4000 }, + { 0x8700, 0x143c, 0x3000 }, + { 0x8700, 0x143a, 0x2000 }, + { 0x0700, 0x1439, 0x0000 }, + { 0x0700, 0x143b, 0x0000 }, + { 0x8700, 0x143e, 0x2000 }, + { 0x0700, 0x143d, 0x0000 }, + { 0x0700, 0x143f, 0x0000 }, + { 0x8700, 0x1444, 0x3000 }, + { 0x8700, 0x1442, 0x2000 }, + { 0x0700, 0x1441, 0x0000 }, + { 0x0700, 0x1443, 0x0000 }, + { 0x8700, 0x1446, 0x2000 }, + { 0x0700, 0x1445, 0x0000 }, + { 0x0700, 0x1447, 0x0000 }, + { 0x8700, 0x1450, 0x4000 }, + { 0x8700, 0x144c, 0x3000 }, + { 0x8700, 0x144a, 0x2000 }, + { 0x0700, 0x1449, 0x0000 }, + { 0x0700, 0x144b, 0x0000 }, + { 0x8700, 0x144e, 0x2000 }, + { 0x0700, 0x144d, 0x0000 }, + { 0x0700, 0x144f, 0x0000 }, + { 0x8700, 0x1454, 0x3000 }, + { 0x8700, 0x1452, 0x2000 }, + { 0x0700, 0x1451, 0x0000 }, + { 0x0700, 0x1453, 0x0000 }, + { 0x8700, 0x1456, 0x2000 }, + { 0x0700, 0x1455, 0x0000 }, + { 0x0700, 0x1457, 0x0000 }, + { 0x8700, 0x14d8, 0x8000 }, + { 0x8700, 0x1498, 0x7000 }, + { 0x8700, 0x1478, 0x6000 }, + { 0x8700, 0x1468, 0x5000 }, + { 0x8700, 0x1460, 0x4000 }, + { 0x8700, 0x145c, 0x3000 }, + { 0x8700, 0x145a, 0x2000 }, + { 0x0700, 0x1459, 0x0000 }, + { 0x0700, 0x145b, 0x0000 }, + { 0x8700, 0x145e, 0x2000 }, + { 0x0700, 0x145d, 0x0000 }, + { 0x0700, 0x145f, 0x0000 }, + { 0x8700, 0x1464, 0x3000 }, + { 0x8700, 0x1462, 0x2000 }, + { 0x0700, 0x1461, 0x0000 }, + { 0x0700, 0x1463, 0x0000 }, + { 0x8700, 0x1466, 0x2000 }, + { 0x0700, 0x1465, 0x0000 }, + { 0x0700, 0x1467, 0x0000 }, + { 0x8700, 0x1470, 0x4000 }, + { 0x8700, 0x146c, 0x3000 }, + { 0x8700, 0x146a, 0x2000 }, + { 0x0700, 0x1469, 0x0000 }, + { 0x0700, 0x146b, 0x0000 }, + { 0x8700, 0x146e, 0x2000 }, + { 0x0700, 0x146d, 0x0000 }, + { 0x0700, 0x146f, 0x0000 }, + { 0x8700, 0x1474, 0x3000 }, + { 0x8700, 0x1472, 0x2000 }, + { 0x0700, 0x1471, 0x0000 }, + { 0x0700, 0x1473, 0x0000 }, + { 0x8700, 0x1476, 0x2000 }, + { 0x0700, 0x1475, 0x0000 }, + { 0x0700, 0x1477, 0x0000 }, + { 0x8700, 0x1488, 0x5000 }, + { 0x8700, 0x1480, 0x4000 }, + { 0x8700, 0x147c, 0x3000 }, + { 0x8700, 0x147a, 0x2000 }, + { 0x0700, 0x1479, 0x0000 }, + { 0x0700, 0x147b, 0x0000 }, + { 0x8700, 0x147e, 0x2000 }, + { 0x0700, 0x147d, 0x0000 }, + { 0x0700, 0x147f, 0x0000 }, + { 0x8700, 0x1484, 0x3000 }, + { 0x8700, 0x1482, 0x2000 }, + { 0x0700, 0x1481, 0x0000 }, + { 0x0700, 0x1483, 0x0000 }, + { 0x8700, 0x1486, 0x2000 }, + { 0x0700, 0x1485, 0x0000 }, + { 0x0700, 0x1487, 0x0000 }, + { 0x8700, 0x1490, 0x4000 }, + { 0x8700, 0x148c, 0x3000 }, + { 0x8700, 0x148a, 0x2000 }, + { 0x0700, 0x1489, 0x0000 }, + { 0x0700, 0x148b, 0x0000 }, + { 0x8700, 0x148e, 0x2000 }, + { 0x0700, 0x148d, 0x0000 }, + { 0x0700, 0x148f, 0x0000 }, + { 0x8700, 0x1494, 0x3000 }, + { 0x8700, 0x1492, 0x2000 }, + { 0x0700, 0x1491, 0x0000 }, + { 0x0700, 0x1493, 0x0000 }, + { 0x8700, 0x1496, 0x2000 }, + { 0x0700, 0x1495, 0x0000 }, + { 0x0700, 0x1497, 0x0000 }, + { 0x8700, 0x14b8, 0x6000 }, + { 0x8700, 0x14a8, 0x5000 }, + { 0x8700, 0x14a0, 0x4000 }, + { 0x8700, 0x149c, 0x3000 }, + { 0x8700, 0x149a, 0x2000 }, + { 0x0700, 0x1499, 0x0000 }, + { 0x0700, 0x149b, 0x0000 }, + { 0x8700, 0x149e, 0x2000 }, + { 0x0700, 0x149d, 0x0000 }, + { 0x0700, 0x149f, 0x0000 }, + { 0x8700, 0x14a4, 0x3000 }, + { 0x8700, 0x14a2, 0x2000 }, + { 0x0700, 0x14a1, 0x0000 }, + { 0x0700, 0x14a3, 0x0000 }, + { 0x8700, 0x14a6, 0x2000 }, + { 0x0700, 0x14a5, 0x0000 }, + { 0x0700, 0x14a7, 0x0000 }, + { 0x8700, 0x14b0, 0x4000 }, + { 0x8700, 0x14ac, 0x3000 }, + { 0x8700, 0x14aa, 0x2000 }, + { 0x0700, 0x14a9, 0x0000 }, + { 0x0700, 0x14ab, 0x0000 }, + { 0x8700, 0x14ae, 0x2000 }, + { 0x0700, 0x14ad, 0x0000 }, + { 0x0700, 0x14af, 0x0000 }, + { 0x8700, 0x14b4, 0x3000 }, + { 0x8700, 0x14b2, 0x2000 }, + { 0x0700, 0x14b1, 0x0000 }, + { 0x0700, 0x14b3, 0x0000 }, + { 0x8700, 0x14b6, 0x2000 }, + { 0x0700, 0x14b5, 0x0000 }, + { 0x0700, 0x14b7, 0x0000 }, + { 0x8700, 0x14c8, 0x5000 }, + { 0x8700, 0x14c0, 0x4000 }, + { 0x8700, 0x14bc, 0x3000 }, + { 0x8700, 0x14ba, 0x2000 }, + { 0x0700, 0x14b9, 0x0000 }, + { 0x0700, 0x14bb, 0x0000 }, + { 0x8700, 0x14be, 0x2000 }, + { 0x0700, 0x14bd, 0x0000 }, + { 0x0700, 0x14bf, 0x0000 }, + { 0x8700, 0x14c4, 0x3000 }, + { 0x8700, 0x14c2, 0x2000 }, + { 0x0700, 0x14c1, 0x0000 }, + { 0x0700, 0x14c3, 0x0000 }, + { 0x8700, 0x14c6, 0x2000 }, + { 0x0700, 0x14c5, 0x0000 }, + { 0x0700, 0x14c7, 0x0000 }, + { 0x8700, 0x14d0, 0x4000 }, + { 0x8700, 0x14cc, 0x3000 }, + { 0x8700, 0x14ca, 0x2000 }, + { 0x0700, 0x14c9, 0x0000 }, + { 0x0700, 0x14cb, 0x0000 }, + { 0x8700, 0x14ce, 0x2000 }, + { 0x0700, 0x14cd, 0x0000 }, + { 0x0700, 0x14cf, 0x0000 }, + { 0x8700, 0x14d4, 0x3000 }, + { 0x8700, 0x14d2, 0x2000 }, + { 0x0700, 0x14d1, 0x0000 }, + { 0x0700, 0x14d3, 0x0000 }, + { 0x8700, 0x14d6, 0x2000 }, + { 0x0700, 0x14d5, 0x0000 }, + { 0x0700, 0x14d7, 0x0000 }, + { 0x8700, 0x1518, 0x7000 }, + { 0x8700, 0x14f8, 0x6000 }, + { 0x8700, 0x14e8, 0x5000 }, + { 0x8700, 0x14e0, 0x4000 }, + { 0x8700, 0x14dc, 0x3000 }, + { 0x8700, 0x14da, 0x2000 }, + { 0x0700, 0x14d9, 0x0000 }, + { 0x0700, 0x14db, 0x0000 }, + { 0x8700, 0x14de, 0x2000 }, + { 0x0700, 0x14dd, 0x0000 }, + { 0x0700, 0x14df, 0x0000 }, + { 0x8700, 0x14e4, 0x3000 }, + { 0x8700, 0x14e2, 0x2000 }, + { 0x0700, 0x14e1, 0x0000 }, + { 0x0700, 0x14e3, 0x0000 }, + { 0x8700, 0x14e6, 0x2000 }, + { 0x0700, 0x14e5, 0x0000 }, + { 0x0700, 0x14e7, 0x0000 }, + { 0x8700, 0x14f0, 0x4000 }, + { 0x8700, 0x14ec, 0x3000 }, + { 0x8700, 0x14ea, 0x2000 }, + { 0x0700, 0x14e9, 0x0000 }, + { 0x0700, 0x14eb, 0x0000 }, + { 0x8700, 0x14ee, 0x2000 }, + { 0x0700, 0x14ed, 0x0000 }, + { 0x0700, 0x14ef, 0x0000 }, + { 0x8700, 0x14f4, 0x3000 }, + { 0x8700, 0x14f2, 0x2000 }, + { 0x0700, 0x14f1, 0x0000 }, + { 0x0700, 0x14f3, 0x0000 }, + { 0x8700, 0x14f6, 0x2000 }, + { 0x0700, 0x14f5, 0x0000 }, + { 0x0700, 0x14f7, 0x0000 }, + { 0x8700, 0x1508, 0x5000 }, + { 0x8700, 0x1500, 0x4000 }, + { 0x8700, 0x14fc, 0x3000 }, + { 0x8700, 0x14fa, 0x2000 }, + { 0x0700, 0x14f9, 0x0000 }, + { 0x0700, 0x14fb, 0x0000 }, + { 0x8700, 0x14fe, 0x2000 }, + { 0x0700, 0x14fd, 0x0000 }, + { 0x0700, 0x14ff, 0x0000 }, + { 0x8700, 0x1504, 0x3000 }, + { 0x8700, 0x1502, 0x2000 }, + { 0x0700, 0x1501, 0x0000 }, + { 0x0700, 0x1503, 0x0000 }, + { 0x8700, 0x1506, 0x2000 }, + { 0x0700, 0x1505, 0x0000 }, + { 0x0700, 0x1507, 0x0000 }, + { 0x8700, 0x1510, 0x4000 }, + { 0x8700, 0x150c, 0x3000 }, + { 0x8700, 0x150a, 0x2000 }, + { 0x0700, 0x1509, 0x0000 }, + { 0x0700, 0x150b, 0x0000 }, + { 0x8700, 0x150e, 0x2000 }, + { 0x0700, 0x150d, 0x0000 }, + { 0x0700, 0x150f, 0x0000 }, + { 0x8700, 0x1514, 0x3000 }, + { 0x8700, 0x1512, 0x2000 }, + { 0x0700, 0x1511, 0x0000 }, + { 0x0700, 0x1513, 0x0000 }, + { 0x8700, 0x1516, 0x2000 }, + { 0x0700, 0x1515, 0x0000 }, + { 0x0700, 0x1517, 0x0000 }, + { 0x8700, 0x1538, 0x6000 }, + { 0x8700, 0x1528, 0x5000 }, + { 0x8700, 0x1520, 0x4000 }, + { 0x8700, 0x151c, 0x3000 }, + { 0x8700, 0x151a, 0x2000 }, + { 0x0700, 0x1519, 0x0000 }, + { 0x0700, 0x151b, 0x0000 }, + { 0x8700, 0x151e, 0x2000 }, + { 0x0700, 0x151d, 0x0000 }, + { 0x0700, 0x151f, 0x0000 }, + { 0x8700, 0x1524, 0x3000 }, + { 0x8700, 0x1522, 0x2000 }, + { 0x0700, 0x1521, 0x0000 }, + { 0x0700, 0x1523, 0x0000 }, + { 0x8700, 0x1526, 0x2000 }, + { 0x0700, 0x1525, 0x0000 }, + { 0x0700, 0x1527, 0x0000 }, + { 0x8700, 0x1530, 0x4000 }, + { 0x8700, 0x152c, 0x3000 }, + { 0x8700, 0x152a, 0x2000 }, + { 0x0700, 0x1529, 0x0000 }, + { 0x0700, 0x152b, 0x0000 }, + { 0x8700, 0x152e, 0x2000 }, + { 0x0700, 0x152d, 0x0000 }, + { 0x0700, 0x152f, 0x0000 }, + { 0x8700, 0x1534, 0x3000 }, + { 0x8700, 0x1532, 0x2000 }, + { 0x0700, 0x1531, 0x0000 }, + { 0x0700, 0x1533, 0x0000 }, + { 0x8700, 0x1536, 0x2000 }, + { 0x0700, 0x1535, 0x0000 }, + { 0x0700, 0x1537, 0x0000 }, + { 0x8700, 0x1548, 0x5000 }, + { 0x8700, 0x1540, 0x4000 }, + { 0x8700, 0x153c, 0x3000 }, + { 0x8700, 0x153a, 0x2000 }, + { 0x0700, 0x1539, 0x0000 }, + { 0x0700, 0x153b, 0x0000 }, + { 0x8700, 0x153e, 0x2000 }, + { 0x0700, 0x153d, 0x0000 }, + { 0x0700, 0x153f, 0x0000 }, + { 0x8700, 0x1544, 0x3000 }, + { 0x8700, 0x1542, 0x2000 }, + { 0x0700, 0x1541, 0x0000 }, + { 0x0700, 0x1543, 0x0000 }, + { 0x8700, 0x1546, 0x2000 }, + { 0x0700, 0x1545, 0x0000 }, + { 0x0700, 0x1547, 0x0000 }, + { 0x8700, 0x1550, 0x4000 }, + { 0x8700, 0x154c, 0x3000 }, + { 0x8700, 0x154a, 0x2000 }, + { 0x0700, 0x1549, 0x0000 }, + { 0x0700, 0x154b, 0x0000 }, + { 0x8700, 0x154e, 0x2000 }, + { 0x0700, 0x154d, 0x0000 }, + { 0x0700, 0x154f, 0x0000 }, + { 0x8700, 0x1554, 0x3000 }, + { 0x8700, 0x1552, 0x2000 }, + { 0x0700, 0x1551, 0x0000 }, + { 0x0700, 0x1553, 0x0000 }, + { 0x8700, 0x1556, 0x2000 }, + { 0x0700, 0x1555, 0x0000 }, + { 0x0700, 0x1557, 0x0000 }, + { 0x9900, 0x22ae, 0xc000 }, + { 0x8900, 0x1e24, 0xb001 }, + { 0x8700, 0x17a2, 0xa000 }, + { 0x8700, 0x1658, 0x9000 }, + { 0x8700, 0x15d8, 0x8000 }, + { 0x8700, 0x1598, 0x7000 }, + { 0x8700, 0x1578, 0x6000 }, + { 0x8700, 0x1568, 0x5000 }, + { 0x8700, 0x1560, 0x4000 }, + { 0x8700, 0x155c, 0x3000 }, + { 0x8700, 0x155a, 0x2000 }, + { 0x0700, 0x1559, 0x0000 }, + { 0x0700, 0x155b, 0x0000 }, + { 0x8700, 0x155e, 0x2000 }, + { 0x0700, 0x155d, 0x0000 }, + { 0x0700, 0x155f, 0x0000 }, + { 0x8700, 0x1564, 0x3000 }, + { 0x8700, 0x1562, 0x2000 }, + { 0x0700, 0x1561, 0x0000 }, + { 0x0700, 0x1563, 0x0000 }, + { 0x8700, 0x1566, 0x2000 }, + { 0x0700, 0x1565, 0x0000 }, + { 0x0700, 0x1567, 0x0000 }, + { 0x8700, 0x1570, 0x4000 }, + { 0x8700, 0x156c, 0x3000 }, + { 0x8700, 0x156a, 0x2000 }, + { 0x0700, 0x1569, 0x0000 }, + { 0x0700, 0x156b, 0x0000 }, + { 0x8700, 0x156e, 0x2000 }, + { 0x0700, 0x156d, 0x0000 }, + { 0x0700, 0x156f, 0x0000 }, + { 0x8700, 0x1574, 0x3000 }, + { 0x8700, 0x1572, 0x2000 }, + { 0x0700, 0x1571, 0x0000 }, + { 0x0700, 0x1573, 0x0000 }, + { 0x8700, 0x1576, 0x2000 }, + { 0x0700, 0x1575, 0x0000 }, + { 0x0700, 0x1577, 0x0000 }, + { 0x8700, 0x1588, 0x5000 }, + { 0x8700, 0x1580, 0x4000 }, + { 0x8700, 0x157c, 0x3000 }, + { 0x8700, 0x157a, 0x2000 }, + { 0x0700, 0x1579, 0x0000 }, + { 0x0700, 0x157b, 0x0000 }, + { 0x8700, 0x157e, 0x2000 }, + { 0x0700, 0x157d, 0x0000 }, + { 0x0700, 0x157f, 0x0000 }, + { 0x8700, 0x1584, 0x3000 }, + { 0x8700, 0x1582, 0x2000 }, + { 0x0700, 0x1581, 0x0000 }, + { 0x0700, 0x1583, 0x0000 }, + { 0x8700, 0x1586, 0x2000 }, + { 0x0700, 0x1585, 0x0000 }, + { 0x0700, 0x1587, 0x0000 }, + { 0x8700, 0x1590, 0x4000 }, + { 0x8700, 0x158c, 0x3000 }, + { 0x8700, 0x158a, 0x2000 }, + { 0x0700, 0x1589, 0x0000 }, + { 0x0700, 0x158b, 0x0000 }, + { 0x8700, 0x158e, 0x2000 }, + { 0x0700, 0x158d, 0x0000 }, + { 0x0700, 0x158f, 0x0000 }, + { 0x8700, 0x1594, 0x3000 }, + { 0x8700, 0x1592, 0x2000 }, + { 0x0700, 0x1591, 0x0000 }, + { 0x0700, 0x1593, 0x0000 }, + { 0x8700, 0x1596, 0x2000 }, + { 0x0700, 0x1595, 0x0000 }, + { 0x0700, 0x1597, 0x0000 }, + { 0x8700, 0x15b8, 0x6000 }, + { 0x8700, 0x15a8, 0x5000 }, + { 0x8700, 0x15a0, 0x4000 }, + { 0x8700, 0x159c, 0x3000 }, + { 0x8700, 0x159a, 0x2000 }, + { 0x0700, 0x1599, 0x0000 }, + { 0x0700, 0x159b, 0x0000 }, + { 0x8700, 0x159e, 0x2000 }, + { 0x0700, 0x159d, 0x0000 }, + { 0x0700, 0x159f, 0x0000 }, + { 0x8700, 0x15a4, 0x3000 }, + { 0x8700, 0x15a2, 0x2000 }, + { 0x0700, 0x15a1, 0x0000 }, + { 0x0700, 0x15a3, 0x0000 }, + { 0x8700, 0x15a6, 0x2000 }, + { 0x0700, 0x15a5, 0x0000 }, + { 0x0700, 0x15a7, 0x0000 }, + { 0x8700, 0x15b0, 0x4000 }, + { 0x8700, 0x15ac, 0x3000 }, + { 0x8700, 0x15aa, 0x2000 }, + { 0x0700, 0x15a9, 0x0000 }, + { 0x0700, 0x15ab, 0x0000 }, + { 0x8700, 0x15ae, 0x2000 }, + { 0x0700, 0x15ad, 0x0000 }, + { 0x0700, 0x15af, 0x0000 }, + { 0x8700, 0x15b4, 0x3000 }, + { 0x8700, 0x15b2, 0x2000 }, + { 0x0700, 0x15b1, 0x0000 }, + { 0x0700, 0x15b3, 0x0000 }, + { 0x8700, 0x15b6, 0x2000 }, + { 0x0700, 0x15b5, 0x0000 }, + { 0x0700, 0x15b7, 0x0000 }, + { 0x8700, 0x15c8, 0x5000 }, + { 0x8700, 0x15c0, 0x4000 }, + { 0x8700, 0x15bc, 0x3000 }, + { 0x8700, 0x15ba, 0x2000 }, + { 0x0700, 0x15b9, 0x0000 }, + { 0x0700, 0x15bb, 0x0000 }, + { 0x8700, 0x15be, 0x2000 }, + { 0x0700, 0x15bd, 0x0000 }, + { 0x0700, 0x15bf, 0x0000 }, + { 0x8700, 0x15c4, 0x3000 }, + { 0x8700, 0x15c2, 0x2000 }, + { 0x0700, 0x15c1, 0x0000 }, + { 0x0700, 0x15c3, 0x0000 }, + { 0x8700, 0x15c6, 0x2000 }, + { 0x0700, 0x15c5, 0x0000 }, + { 0x0700, 0x15c7, 0x0000 }, + { 0x8700, 0x15d0, 0x4000 }, + { 0x8700, 0x15cc, 0x3000 }, + { 0x8700, 0x15ca, 0x2000 }, + { 0x0700, 0x15c9, 0x0000 }, + { 0x0700, 0x15cb, 0x0000 }, + { 0x8700, 0x15ce, 0x2000 }, + { 0x0700, 0x15cd, 0x0000 }, + { 0x0700, 0x15cf, 0x0000 }, + { 0x8700, 0x15d4, 0x3000 }, + { 0x8700, 0x15d2, 0x2000 }, + { 0x0700, 0x15d1, 0x0000 }, + { 0x0700, 0x15d3, 0x0000 }, + { 0x8700, 0x15d6, 0x2000 }, + { 0x0700, 0x15d5, 0x0000 }, + { 0x0700, 0x15d7, 0x0000 }, + { 0x8700, 0x1618, 0x7000 }, + { 0x8700, 0x15f8, 0x6000 }, + { 0x8700, 0x15e8, 0x5000 }, + { 0x8700, 0x15e0, 0x4000 }, + { 0x8700, 0x15dc, 0x3000 }, + { 0x8700, 0x15da, 0x2000 }, + { 0x0700, 0x15d9, 0x0000 }, + { 0x0700, 0x15db, 0x0000 }, + { 0x8700, 0x15de, 0x2000 }, + { 0x0700, 0x15dd, 0x0000 }, + { 0x0700, 0x15df, 0x0000 }, + { 0x8700, 0x15e4, 0x3000 }, + { 0x8700, 0x15e2, 0x2000 }, + { 0x0700, 0x15e1, 0x0000 }, + { 0x0700, 0x15e3, 0x0000 }, + { 0x8700, 0x15e6, 0x2000 }, + { 0x0700, 0x15e5, 0x0000 }, + { 0x0700, 0x15e7, 0x0000 }, + { 0x8700, 0x15f0, 0x4000 }, + { 0x8700, 0x15ec, 0x3000 }, + { 0x8700, 0x15ea, 0x2000 }, + { 0x0700, 0x15e9, 0x0000 }, + { 0x0700, 0x15eb, 0x0000 }, + { 0x8700, 0x15ee, 0x2000 }, + { 0x0700, 0x15ed, 0x0000 }, + { 0x0700, 0x15ef, 0x0000 }, + { 0x8700, 0x15f4, 0x3000 }, + { 0x8700, 0x15f2, 0x2000 }, + { 0x0700, 0x15f1, 0x0000 }, + { 0x0700, 0x15f3, 0x0000 }, + { 0x8700, 0x15f6, 0x2000 }, + { 0x0700, 0x15f5, 0x0000 }, + { 0x0700, 0x15f7, 0x0000 }, + { 0x8700, 0x1608, 0x5000 }, + { 0x8700, 0x1600, 0x4000 }, + { 0x8700, 0x15fc, 0x3000 }, + { 0x8700, 0x15fa, 0x2000 }, + { 0x0700, 0x15f9, 0x0000 }, + { 0x0700, 0x15fb, 0x0000 }, + { 0x8700, 0x15fe, 0x2000 }, + { 0x0700, 0x15fd, 0x0000 }, + { 0x0700, 0x15ff, 0x0000 }, + { 0x8700, 0x1604, 0x3000 }, + { 0x8700, 0x1602, 0x2000 }, + { 0x0700, 0x1601, 0x0000 }, + { 0x0700, 0x1603, 0x0000 }, + { 0x8700, 0x1606, 0x2000 }, + { 0x0700, 0x1605, 0x0000 }, + { 0x0700, 0x1607, 0x0000 }, + { 0x8700, 0x1610, 0x4000 }, + { 0x8700, 0x160c, 0x3000 }, + { 0x8700, 0x160a, 0x2000 }, + { 0x0700, 0x1609, 0x0000 }, + { 0x0700, 0x160b, 0x0000 }, + { 0x8700, 0x160e, 0x2000 }, + { 0x0700, 0x160d, 0x0000 }, + { 0x0700, 0x160f, 0x0000 }, + { 0x8700, 0x1614, 0x3000 }, + { 0x8700, 0x1612, 0x2000 }, + { 0x0700, 0x1611, 0x0000 }, + { 0x0700, 0x1613, 0x0000 }, + { 0x8700, 0x1616, 0x2000 }, + { 0x0700, 0x1615, 0x0000 }, + { 0x0700, 0x1617, 0x0000 }, + { 0x8700, 0x1638, 0x6000 }, + { 0x8700, 0x1628, 0x5000 }, + { 0x8700, 0x1620, 0x4000 }, + { 0x8700, 0x161c, 0x3000 }, + { 0x8700, 0x161a, 0x2000 }, + { 0x0700, 0x1619, 0x0000 }, + { 0x0700, 0x161b, 0x0000 }, + { 0x8700, 0x161e, 0x2000 }, + { 0x0700, 0x161d, 0x0000 }, + { 0x0700, 0x161f, 0x0000 }, + { 0x8700, 0x1624, 0x3000 }, + { 0x8700, 0x1622, 0x2000 }, + { 0x0700, 0x1621, 0x0000 }, + { 0x0700, 0x1623, 0x0000 }, + { 0x8700, 0x1626, 0x2000 }, + { 0x0700, 0x1625, 0x0000 }, + { 0x0700, 0x1627, 0x0000 }, + { 0x8700, 0x1630, 0x4000 }, + { 0x8700, 0x162c, 0x3000 }, + { 0x8700, 0x162a, 0x2000 }, + { 0x0700, 0x1629, 0x0000 }, + { 0x0700, 0x162b, 0x0000 }, + { 0x8700, 0x162e, 0x2000 }, + { 0x0700, 0x162d, 0x0000 }, + { 0x0700, 0x162f, 0x0000 }, + { 0x8700, 0x1634, 0x3000 }, + { 0x8700, 0x1632, 0x2000 }, + { 0x0700, 0x1631, 0x0000 }, + { 0x0700, 0x1633, 0x0000 }, + { 0x8700, 0x1636, 0x2000 }, + { 0x0700, 0x1635, 0x0000 }, + { 0x0700, 0x1637, 0x0000 }, + { 0x8700, 0x1648, 0x5000 }, + { 0x8700, 0x1640, 0x4000 }, + { 0x8700, 0x163c, 0x3000 }, + { 0x8700, 0x163a, 0x2000 }, + { 0x0700, 0x1639, 0x0000 }, + { 0x0700, 0x163b, 0x0000 }, + { 0x8700, 0x163e, 0x2000 }, + { 0x0700, 0x163d, 0x0000 }, + { 0x0700, 0x163f, 0x0000 }, + { 0x8700, 0x1644, 0x3000 }, + { 0x8700, 0x1642, 0x2000 }, + { 0x0700, 0x1641, 0x0000 }, + { 0x0700, 0x1643, 0x0000 }, + { 0x8700, 0x1646, 0x2000 }, + { 0x0700, 0x1645, 0x0000 }, + { 0x0700, 0x1647, 0x0000 }, + { 0x8700, 0x1650, 0x4000 }, + { 0x8700, 0x164c, 0x3000 }, + { 0x8700, 0x164a, 0x2000 }, + { 0x0700, 0x1649, 0x0000 }, + { 0x0700, 0x164b, 0x0000 }, + { 0x8700, 0x164e, 0x2000 }, + { 0x0700, 0x164d, 0x0000 }, + { 0x0700, 0x164f, 0x0000 }, + { 0x8700, 0x1654, 0x3000 }, + { 0x8700, 0x1652, 0x2000 }, + { 0x0700, 0x1651, 0x0000 }, + { 0x0700, 0x1653, 0x0000 }, + { 0x8700, 0x1656, 0x2000 }, + { 0x0700, 0x1655, 0x0000 }, + { 0x0700, 0x1657, 0x0000 }, + { 0x8700, 0x16e4, 0x8000 }, + { 0x8700, 0x16a4, 0x7000 }, + { 0x8700, 0x1681, 0x6000 }, + { 0x8700, 0x1668, 0x5000 }, + { 0x8700, 0x1660, 0x4000 }, + { 0x8700, 0x165c, 0x3000 }, + { 0x8700, 0x165a, 0x2000 }, + { 0x0700, 0x1659, 0x0000 }, + { 0x0700, 0x165b, 0x0000 }, + { 0x8700, 0x165e, 0x2000 }, + { 0x0700, 0x165d, 0x0000 }, + { 0x0700, 0x165f, 0x0000 }, + { 0x8700, 0x1664, 0x3000 }, + { 0x8700, 0x1662, 0x2000 }, + { 0x0700, 0x1661, 0x0000 }, + { 0x0700, 0x1663, 0x0000 }, + { 0x8700, 0x1666, 0x2000 }, + { 0x0700, 0x1665, 0x0000 }, + { 0x0700, 0x1667, 0x0000 }, + { 0x8700, 0x1670, 0x4000 }, + { 0x8700, 0x166c, 0x3000 }, + { 0x8700, 0x166a, 0x2000 }, + { 0x0700, 0x1669, 0x0000 }, + { 0x0700, 0x166b, 0x0000 }, + { 0x9500, 0x166e, 0x2000 }, + { 0x1500, 0x166d, 0x0000 }, + { 0x0700, 0x166f, 0x0000 }, + { 0x8700, 0x1674, 0x3000 }, + { 0x8700, 0x1672, 0x2000 }, + { 0x0700, 0x1671, 0x0000 }, + { 0x0700, 0x1673, 0x0000 }, + { 0x8700, 0x1676, 0x2000 }, + { 0x0700, 0x1675, 0x0000 }, + { 0x1d00, 0x1680, 0x0000 }, + { 0x8700, 0x1691, 0x5000 }, + { 0x8700, 0x1689, 0x4000 }, + { 0x8700, 0x1685, 0x3000 }, + { 0x8700, 0x1683, 0x2000 }, + { 0x0700, 0x1682, 0x0000 }, + { 0x0700, 0x1684, 0x0000 }, + { 0x8700, 0x1687, 0x2000 }, + { 0x0700, 0x1686, 0x0000 }, + { 0x0700, 0x1688, 0x0000 }, + { 0x8700, 0x168d, 0x3000 }, + { 0x8700, 0x168b, 0x2000 }, + { 0x0700, 0x168a, 0x0000 }, + { 0x0700, 0x168c, 0x0000 }, + { 0x8700, 0x168f, 0x2000 }, + { 0x0700, 0x168e, 0x0000 }, + { 0x0700, 0x1690, 0x0000 }, + { 0x8700, 0x1699, 0x4000 }, + { 0x8700, 0x1695, 0x3000 }, + { 0x8700, 0x1693, 0x2000 }, + { 0x0700, 0x1692, 0x0000 }, + { 0x0700, 0x1694, 0x0000 }, + { 0x8700, 0x1697, 0x2000 }, + { 0x0700, 0x1696, 0x0000 }, + { 0x0700, 0x1698, 0x0000 }, + { 0x8700, 0x16a0, 0x3000 }, + { 0x9600, 0x169b, 0x2000 }, + { 0x0700, 0x169a, 0x0000 }, + { 0x1200, 0x169c, 0x0000 }, + { 0x8700, 0x16a2, 0x2000 }, + { 0x0700, 0x16a1, 0x0000 }, + { 0x0700, 0x16a3, 0x0000 }, + { 0x8700, 0x16c4, 0x6000 }, + { 0x8700, 0x16b4, 0x5000 }, + { 0x8700, 0x16ac, 0x4000 }, + { 0x8700, 0x16a8, 0x3000 }, + { 0x8700, 0x16a6, 0x2000 }, + { 0x0700, 0x16a5, 0x0000 }, + { 0x0700, 0x16a7, 0x0000 }, + { 0x8700, 0x16aa, 0x2000 }, + { 0x0700, 0x16a9, 0x0000 }, + { 0x0700, 0x16ab, 0x0000 }, + { 0x8700, 0x16b0, 0x3000 }, + { 0x8700, 0x16ae, 0x2000 }, + { 0x0700, 0x16ad, 0x0000 }, + { 0x0700, 0x16af, 0x0000 }, + { 0x8700, 0x16b2, 0x2000 }, + { 0x0700, 0x16b1, 0x0000 }, + { 0x0700, 0x16b3, 0x0000 }, + { 0x8700, 0x16bc, 0x4000 }, + { 0x8700, 0x16b8, 0x3000 }, + { 0x8700, 0x16b6, 0x2000 }, + { 0x0700, 0x16b5, 0x0000 }, + { 0x0700, 0x16b7, 0x0000 }, + { 0x8700, 0x16ba, 0x2000 }, + { 0x0700, 0x16b9, 0x0000 }, + { 0x0700, 0x16bb, 0x0000 }, + { 0x8700, 0x16c0, 0x3000 }, + { 0x8700, 0x16be, 0x2000 }, + { 0x0700, 0x16bd, 0x0000 }, + { 0x0700, 0x16bf, 0x0000 }, + { 0x8700, 0x16c2, 0x2000 }, + { 0x0700, 0x16c1, 0x0000 }, + { 0x0700, 0x16c3, 0x0000 }, + { 0x8700, 0x16d4, 0x5000 }, + { 0x8700, 0x16cc, 0x4000 }, + { 0x8700, 0x16c8, 0x3000 }, + { 0x8700, 0x16c6, 0x2000 }, + { 0x0700, 0x16c5, 0x0000 }, + { 0x0700, 0x16c7, 0x0000 }, + { 0x8700, 0x16ca, 0x2000 }, + { 0x0700, 0x16c9, 0x0000 }, + { 0x0700, 0x16cb, 0x0000 }, + { 0x8700, 0x16d0, 0x3000 }, + { 0x8700, 0x16ce, 0x2000 }, + { 0x0700, 0x16cd, 0x0000 }, + { 0x0700, 0x16cf, 0x0000 }, + { 0x8700, 0x16d2, 0x2000 }, + { 0x0700, 0x16d1, 0x0000 }, + { 0x0700, 0x16d3, 0x0000 }, + { 0x8700, 0x16dc, 0x4000 }, + { 0x8700, 0x16d8, 0x3000 }, + { 0x8700, 0x16d6, 0x2000 }, + { 0x0700, 0x16d5, 0x0000 }, + { 0x0700, 0x16d7, 0x0000 }, + { 0x8700, 0x16da, 0x2000 }, + { 0x0700, 0x16d9, 0x0000 }, + { 0x0700, 0x16db, 0x0000 }, + { 0x8700, 0x16e0, 0x3000 }, + { 0x8700, 0x16de, 0x2000 }, + { 0x0700, 0x16dd, 0x0000 }, + { 0x0700, 0x16df, 0x0000 }, + { 0x8700, 0x16e2, 0x2000 }, + { 0x0700, 0x16e1, 0x0000 }, + { 0x0700, 0x16e3, 0x0000 }, + { 0x8700, 0x1748, 0x7000 }, + { 0x8c00, 0x1714, 0x6000 }, + { 0x8700, 0x1703, 0x5000 }, + { 0x9500, 0x16ec, 0x4000 }, + { 0x8700, 0x16e8, 0x3000 }, + { 0x8700, 0x16e6, 0x2000 }, + { 0x0700, 0x16e5, 0x0000 }, + { 0x0700, 0x16e7, 0x0000 }, + { 0x8700, 0x16ea, 0x2000 }, + { 0x0700, 0x16e9, 0x0000 }, + { 0x1500, 0x16eb, 0x0000 }, + { 0x8e00, 0x16f0, 0x3000 }, + { 0x8e00, 0x16ee, 0x2000 }, + { 0x1500, 0x16ed, 0x0000 }, + { 0x0e00, 0x16ef, 0x0000 }, + { 0x8700, 0x1701, 0x2000 }, + { 0x0700, 0x1700, 0x0000 }, + { 0x0700, 0x1702, 0x0000 }, + { 0x8700, 0x170b, 0x4000 }, + { 0x8700, 0x1707, 0x3000 }, + { 0x8700, 0x1705, 0x2000 }, + { 0x0700, 0x1704, 0x0000 }, + { 0x0700, 0x1706, 0x0000 }, + { 0x8700, 0x1709, 0x2000 }, + { 0x0700, 0x1708, 0x0000 }, + { 0x0700, 0x170a, 0x0000 }, + { 0x8700, 0x1710, 0x3000 }, + { 0x8700, 0x170e, 0x2000 }, + { 0x0700, 0x170c, 0x0000 }, + { 0x0700, 0x170f, 0x0000 }, + { 0x8c00, 0x1712, 0x2000 }, + { 0x0700, 0x1711, 0x0000 }, + { 0x0c00, 0x1713, 0x0000 }, + { 0x8700, 0x172f, 0x5000 }, + { 0x8700, 0x1727, 0x4000 }, + { 0x8700, 0x1723, 0x3000 }, + { 0x8700, 0x1721, 0x2000 }, + { 0x0700, 0x1720, 0x0000 }, + { 0x0700, 0x1722, 0x0000 }, + { 0x8700, 0x1725, 0x2000 }, + { 0x0700, 0x1724, 0x0000 }, + { 0x0700, 0x1726, 0x0000 }, + { 0x8700, 0x172b, 0x3000 }, + { 0x8700, 0x1729, 0x2000 }, + { 0x0700, 0x1728, 0x0000 }, + { 0x0700, 0x172a, 0x0000 }, + { 0x8700, 0x172d, 0x2000 }, + { 0x0700, 0x172c, 0x0000 }, + { 0x0700, 0x172e, 0x0000 }, + { 0x8700, 0x1740, 0x4000 }, + { 0x8c00, 0x1733, 0x3000 }, + { 0x8700, 0x1731, 0x2000 }, + { 0x0700, 0x1730, 0x0000 }, + { 0x0c00, 0x1732, 0x0000 }, + { 0x9500, 0x1735, 0x2000 }, + { 0x0c00, 0x1734, 0x0000 }, + { 0x1500, 0x1736, 0x0000 }, + { 0x8700, 0x1744, 0x3000 }, + { 0x8700, 0x1742, 0x2000 }, + { 0x0700, 0x1741, 0x0000 }, + { 0x0700, 0x1743, 0x0000 }, + { 0x8700, 0x1746, 0x2000 }, + { 0x0700, 0x1745, 0x0000 }, + { 0x0700, 0x1747, 0x0000 }, + { 0x8700, 0x1782, 0x6000 }, + { 0x8700, 0x1764, 0x5000 }, + { 0x8700, 0x1750, 0x4000 }, + { 0x8700, 0x174c, 0x3000 }, + { 0x8700, 0x174a, 0x2000 }, + { 0x0700, 0x1749, 0x0000 }, + { 0x0700, 0x174b, 0x0000 }, + { 0x8700, 0x174e, 0x2000 }, + { 0x0700, 0x174d, 0x0000 }, + { 0x0700, 0x174f, 0x0000 }, + { 0x8700, 0x1760, 0x3000 }, + { 0x8c00, 0x1752, 0x2000 }, + { 0x0700, 0x1751, 0x0000 }, + { 0x0c00, 0x1753, 0x0000 }, + { 0x8700, 0x1762, 0x2000 }, + { 0x0700, 0x1761, 0x0000 }, + { 0x0700, 0x1763, 0x0000 }, + { 0x8700, 0x176c, 0x4000 }, + { 0x8700, 0x1768, 0x3000 }, + { 0x8700, 0x1766, 0x2000 }, + { 0x0700, 0x1765, 0x0000 }, + { 0x0700, 0x1767, 0x0000 }, + { 0x8700, 0x176a, 0x2000 }, + { 0x0700, 0x1769, 0x0000 }, + { 0x0700, 0x176b, 0x0000 }, + { 0x8c00, 0x1772, 0x3000 }, + { 0x8700, 0x176f, 0x2000 }, + { 0x0700, 0x176e, 0x0000 }, + { 0x0700, 0x1770, 0x0000 }, + { 0x8700, 0x1780, 0x2000 }, + { 0x0c00, 0x1773, 0x0000 }, + { 0x0700, 0x1781, 0x0000 }, + { 0x8700, 0x1792, 0x5000 }, + { 0x8700, 0x178a, 0x4000 }, + { 0x8700, 0x1786, 0x3000 }, + { 0x8700, 0x1784, 0x2000 }, + { 0x0700, 0x1783, 0x0000 }, + { 0x0700, 0x1785, 0x0000 }, + { 0x8700, 0x1788, 0x2000 }, + { 0x0700, 0x1787, 0x0000 }, + { 0x0700, 0x1789, 0x0000 }, + { 0x8700, 0x178e, 0x3000 }, + { 0x8700, 0x178c, 0x2000 }, + { 0x0700, 0x178b, 0x0000 }, + { 0x0700, 0x178d, 0x0000 }, + { 0x8700, 0x1790, 0x2000 }, + { 0x0700, 0x178f, 0x0000 }, + { 0x0700, 0x1791, 0x0000 }, + { 0x8700, 0x179a, 0x4000 }, + { 0x8700, 0x1796, 0x3000 }, + { 0x8700, 0x1794, 0x2000 }, + { 0x0700, 0x1793, 0x0000 }, + { 0x0700, 0x1795, 0x0000 }, + { 0x8700, 0x1798, 0x2000 }, + { 0x0700, 0x1797, 0x0000 }, + { 0x0700, 0x1799, 0x0000 }, + { 0x8700, 0x179e, 0x3000 }, + { 0x8700, 0x179c, 0x2000 }, + { 0x0700, 0x179b, 0x0000 }, + { 0x0700, 0x179d, 0x0000 }, + { 0x8700, 0x17a0, 0x2000 }, + { 0x0700, 0x179f, 0x0000 }, + { 0x0700, 0x17a1, 0x0000 }, + { 0x8700, 0x1915, 0x9000 }, + { 0x8700, 0x1837, 0x8000 }, + { 0x8d00, 0x17e4, 0x7000 }, + { 0x8a00, 0x17c2, 0x6000 }, + { 0x8700, 0x17b2, 0x5000 }, + { 0x8700, 0x17aa, 0x4000 }, + { 0x8700, 0x17a6, 0x3000 }, + { 0x8700, 0x17a4, 0x2000 }, + { 0x0700, 0x17a3, 0x0000 }, + { 0x0700, 0x17a5, 0x0000 }, + { 0x8700, 0x17a8, 0x2000 }, + { 0x0700, 0x17a7, 0x0000 }, + { 0x0700, 0x17a9, 0x0000 }, + { 0x8700, 0x17ae, 0x3000 }, + { 0x8700, 0x17ac, 0x2000 }, + { 0x0700, 0x17ab, 0x0000 }, + { 0x0700, 0x17ad, 0x0000 }, + { 0x8700, 0x17b0, 0x2000 }, + { 0x0700, 0x17af, 0x0000 }, + { 0x0700, 0x17b1, 0x0000 }, + { 0x8c00, 0x17ba, 0x4000 }, + { 0x8a00, 0x17b6, 0x3000 }, + { 0x8100, 0x17b4, 0x2000 }, + { 0x0700, 0x17b3, 0x0000 }, + { 0x0100, 0x17b5, 0x0000 }, + { 0x8c00, 0x17b8, 0x2000 }, + { 0x0c00, 0x17b7, 0x0000 }, + { 0x0c00, 0x17b9, 0x0000 }, + { 0x8a00, 0x17be, 0x3000 }, + { 0x8c00, 0x17bc, 0x2000 }, + { 0x0c00, 0x17bb, 0x0000 }, + { 0x0c00, 0x17bd, 0x0000 }, + { 0x8a00, 0x17c0, 0x2000 }, + { 0x0a00, 0x17bf, 0x0000 }, + { 0x0a00, 0x17c1, 0x0000 }, + { 0x8c00, 0x17d2, 0x5000 }, + { 0x8c00, 0x17ca, 0x4000 }, + { 0x8c00, 0x17c6, 0x3000 }, + { 0x8a00, 0x17c4, 0x2000 }, + { 0x0a00, 0x17c3, 0x0000 }, + { 0x0a00, 0x17c5, 0x0000 }, + { 0x8a00, 0x17c8, 0x2000 }, + { 0x0a00, 0x17c7, 0x0000 }, + { 0x0c00, 0x17c9, 0x0000 }, + { 0x8c00, 0x17ce, 0x3000 }, + { 0x8c00, 0x17cc, 0x2000 }, + { 0x0c00, 0x17cb, 0x0000 }, + { 0x0c00, 0x17cd, 0x0000 }, + { 0x8c00, 0x17d0, 0x2000 }, + { 0x0c00, 0x17cf, 0x0000 }, + { 0x0c00, 0x17d1, 0x0000 }, + { 0x9500, 0x17da, 0x4000 }, + { 0x9500, 0x17d6, 0x3000 }, + { 0x9500, 0x17d4, 0x2000 }, + { 0x0c00, 0x17d3, 0x0000 }, + { 0x1500, 0x17d5, 0x0000 }, + { 0x9500, 0x17d8, 0x2000 }, + { 0x0600, 0x17d7, 0x0000 }, + { 0x1500, 0x17d9, 0x0000 }, + { 0x8d00, 0x17e0, 0x3000 }, + { 0x8700, 0x17dc, 0x2000 }, + { 0x1700, 0x17db, 0x0000 }, + { 0x0c00, 0x17dd, 0x0000 }, + { 0x8d00, 0x17e2, 0x2000 }, + { 0x0d00, 0x17e1, 0x0000 }, + { 0x0d00, 0x17e3, 0x0000 }, + { 0x8d00, 0x1811, 0x6000 }, + { 0x9500, 0x1800, 0x5000 }, + { 0x8f00, 0x17f2, 0x4000 }, + { 0x8d00, 0x17e8, 0x3000 }, + { 0x8d00, 0x17e6, 0x2000 }, + { 0x0d00, 0x17e5, 0x0000 }, + { 0x0d00, 0x17e7, 0x0000 }, + { 0x8f00, 0x17f0, 0x2000 }, + { 0x0d00, 0x17e9, 0x0000 }, + { 0x0f00, 0x17f1, 0x0000 }, + { 0x8f00, 0x17f6, 0x3000 }, + { 0x8f00, 0x17f4, 0x2000 }, + { 0x0f00, 0x17f3, 0x0000 }, + { 0x0f00, 0x17f5, 0x0000 }, + { 0x8f00, 0x17f8, 0x2000 }, + { 0x0f00, 0x17f7, 0x0000 }, + { 0x0f00, 0x17f9, 0x0000 }, + { 0x9500, 0x1808, 0x4000 }, + { 0x9500, 0x1804, 0x3000 }, + { 0x9500, 0x1802, 0x2000 }, + { 0x1500, 0x1801, 0x0000 }, + { 0x1500, 0x1803, 0x0000 }, + { 0x9100, 0x1806, 0x2000 }, + { 0x1500, 0x1805, 0x0000 }, + { 0x1500, 0x1807, 0x0000 }, + { 0x8c00, 0x180c, 0x3000 }, + { 0x9500, 0x180a, 0x2000 }, + { 0x1500, 0x1809, 0x0000 }, + { 0x0c00, 0x180b, 0x0000 }, + { 0x9d00, 0x180e, 0x2000 }, + { 0x0c00, 0x180d, 0x0000 }, + { 0x0d00, 0x1810, 0x0000 }, + { 0x8700, 0x1827, 0x5000 }, + { 0x8d00, 0x1819, 0x4000 }, + { 0x8d00, 0x1815, 0x3000 }, + { 0x8d00, 0x1813, 0x2000 }, + { 0x0d00, 0x1812, 0x0000 }, + { 0x0d00, 0x1814, 0x0000 }, + { 0x8d00, 0x1817, 0x2000 }, + { 0x0d00, 0x1816, 0x0000 }, + { 0x0d00, 0x1818, 0x0000 }, + { 0x8700, 0x1823, 0x3000 }, + { 0x8700, 0x1821, 0x2000 }, + { 0x0700, 0x1820, 0x0000 }, + { 0x0700, 0x1822, 0x0000 }, + { 0x8700, 0x1825, 0x2000 }, + { 0x0700, 0x1824, 0x0000 }, + { 0x0700, 0x1826, 0x0000 }, + { 0x8700, 0x182f, 0x4000 }, + { 0x8700, 0x182b, 0x3000 }, + { 0x8700, 0x1829, 0x2000 }, + { 0x0700, 0x1828, 0x0000 }, + { 0x0700, 0x182a, 0x0000 }, + { 0x8700, 0x182d, 0x2000 }, + { 0x0700, 0x182c, 0x0000 }, + { 0x0700, 0x182e, 0x0000 }, + { 0x8700, 0x1833, 0x3000 }, + { 0x8700, 0x1831, 0x2000 }, + { 0x0700, 0x1830, 0x0000 }, + { 0x0700, 0x1832, 0x0000 }, + { 0x8700, 0x1835, 0x2000 }, + { 0x0700, 0x1834, 0x0000 }, + { 0x0700, 0x1836, 0x0000 }, + { 0x8700, 0x1877, 0x7000 }, + { 0x8700, 0x1857, 0x6000 }, + { 0x8700, 0x1847, 0x5000 }, + { 0x8700, 0x183f, 0x4000 }, + { 0x8700, 0x183b, 0x3000 }, + { 0x8700, 0x1839, 0x2000 }, + { 0x0700, 0x1838, 0x0000 }, + { 0x0700, 0x183a, 0x0000 }, + { 0x8700, 0x183d, 0x2000 }, + { 0x0700, 0x183c, 0x0000 }, + { 0x0700, 0x183e, 0x0000 }, + { 0x8600, 0x1843, 0x3000 }, + { 0x8700, 0x1841, 0x2000 }, + { 0x0700, 0x1840, 0x0000 }, + { 0x0700, 0x1842, 0x0000 }, + { 0x8700, 0x1845, 0x2000 }, + { 0x0700, 0x1844, 0x0000 }, + { 0x0700, 0x1846, 0x0000 }, + { 0x8700, 0x184f, 0x4000 }, + { 0x8700, 0x184b, 0x3000 }, + { 0x8700, 0x1849, 0x2000 }, + { 0x0700, 0x1848, 0x0000 }, + { 0x0700, 0x184a, 0x0000 }, + { 0x8700, 0x184d, 0x2000 }, + { 0x0700, 0x184c, 0x0000 }, + { 0x0700, 0x184e, 0x0000 }, + { 0x8700, 0x1853, 0x3000 }, + { 0x8700, 0x1851, 0x2000 }, + { 0x0700, 0x1850, 0x0000 }, + { 0x0700, 0x1852, 0x0000 }, + { 0x8700, 0x1855, 0x2000 }, + { 0x0700, 0x1854, 0x0000 }, + { 0x0700, 0x1856, 0x0000 }, + { 0x8700, 0x1867, 0x5000 }, + { 0x8700, 0x185f, 0x4000 }, + { 0x8700, 0x185b, 0x3000 }, + { 0x8700, 0x1859, 0x2000 }, + { 0x0700, 0x1858, 0x0000 }, + { 0x0700, 0x185a, 0x0000 }, + { 0x8700, 0x185d, 0x2000 }, + { 0x0700, 0x185c, 0x0000 }, + { 0x0700, 0x185e, 0x0000 }, + { 0x8700, 0x1863, 0x3000 }, + { 0x8700, 0x1861, 0x2000 }, + { 0x0700, 0x1860, 0x0000 }, + { 0x0700, 0x1862, 0x0000 }, + { 0x8700, 0x1865, 0x2000 }, + { 0x0700, 0x1864, 0x0000 }, + { 0x0700, 0x1866, 0x0000 }, + { 0x8700, 0x186f, 0x4000 }, + { 0x8700, 0x186b, 0x3000 }, + { 0x8700, 0x1869, 0x2000 }, + { 0x0700, 0x1868, 0x0000 }, + { 0x0700, 0x186a, 0x0000 }, + { 0x8700, 0x186d, 0x2000 }, + { 0x0700, 0x186c, 0x0000 }, + { 0x0700, 0x186e, 0x0000 }, + { 0x8700, 0x1873, 0x3000 }, + { 0x8700, 0x1871, 0x2000 }, + { 0x0700, 0x1870, 0x0000 }, + { 0x0700, 0x1872, 0x0000 }, + { 0x8700, 0x1875, 0x2000 }, + { 0x0700, 0x1874, 0x0000 }, + { 0x0700, 0x1876, 0x0000 }, + { 0x8700, 0x189f, 0x6000 }, + { 0x8700, 0x188f, 0x5000 }, + { 0x8700, 0x1887, 0x4000 }, + { 0x8700, 0x1883, 0x3000 }, + { 0x8700, 0x1881, 0x2000 }, + { 0x0700, 0x1880, 0x0000 }, + { 0x0700, 0x1882, 0x0000 }, + { 0x8700, 0x1885, 0x2000 }, + { 0x0700, 0x1884, 0x0000 }, + { 0x0700, 0x1886, 0x0000 }, + { 0x8700, 0x188b, 0x3000 }, + { 0x8700, 0x1889, 0x2000 }, + { 0x0700, 0x1888, 0x0000 }, + { 0x0700, 0x188a, 0x0000 }, + { 0x8700, 0x188d, 0x2000 }, + { 0x0700, 0x188c, 0x0000 }, + { 0x0700, 0x188e, 0x0000 }, + { 0x8700, 0x1897, 0x4000 }, + { 0x8700, 0x1893, 0x3000 }, + { 0x8700, 0x1891, 0x2000 }, + { 0x0700, 0x1890, 0x0000 }, + { 0x0700, 0x1892, 0x0000 }, + { 0x8700, 0x1895, 0x2000 }, + { 0x0700, 0x1894, 0x0000 }, + { 0x0700, 0x1896, 0x0000 }, + { 0x8700, 0x189b, 0x3000 }, + { 0x8700, 0x1899, 0x2000 }, + { 0x0700, 0x1898, 0x0000 }, + { 0x0700, 0x189a, 0x0000 }, + { 0x8700, 0x189d, 0x2000 }, + { 0x0700, 0x189c, 0x0000 }, + { 0x0700, 0x189e, 0x0000 }, + { 0x8700, 0x1905, 0x5000 }, + { 0x8700, 0x18a7, 0x4000 }, + { 0x8700, 0x18a3, 0x3000 }, + { 0x8700, 0x18a1, 0x2000 }, + { 0x0700, 0x18a0, 0x0000 }, + { 0x0700, 0x18a2, 0x0000 }, + { 0x8700, 0x18a5, 0x2000 }, + { 0x0700, 0x18a4, 0x0000 }, + { 0x0700, 0x18a6, 0x0000 }, + { 0x8700, 0x1901, 0x3000 }, + { 0x8c00, 0x18a9, 0x2000 }, + { 0x0700, 0x18a8, 0x0000 }, + { 0x0700, 0x1900, 0x0000 }, + { 0x8700, 0x1903, 0x2000 }, + { 0x0700, 0x1902, 0x0000 }, + { 0x0700, 0x1904, 0x0000 }, + { 0x8700, 0x190d, 0x4000 }, + { 0x8700, 0x1909, 0x3000 }, + { 0x8700, 0x1907, 0x2000 }, + { 0x0700, 0x1906, 0x0000 }, + { 0x0700, 0x1908, 0x0000 }, + { 0x8700, 0x190b, 0x2000 }, + { 0x0700, 0x190a, 0x0000 }, + { 0x0700, 0x190c, 0x0000 }, + { 0x8700, 0x1911, 0x3000 }, + { 0x8700, 0x190f, 0x2000 }, + { 0x0700, 0x190e, 0x0000 }, + { 0x0700, 0x1910, 0x0000 }, + { 0x8700, 0x1913, 0x2000 }, + { 0x0700, 0x1912, 0x0000 }, + { 0x0700, 0x1914, 0x0000 }, + { 0x8500, 0x1d10, 0x8000 }, + { 0x8700, 0x1963, 0x7000 }, + { 0x9a00, 0x1940, 0x6000 }, + { 0x8c00, 0x1928, 0x5000 }, + { 0x8c00, 0x1920, 0x4000 }, + { 0x8700, 0x1919, 0x3000 }, + { 0x8700, 0x1917, 0x2000 }, + { 0x0700, 0x1916, 0x0000 }, + { 0x0700, 0x1918, 0x0000 }, + { 0x8700, 0x191b, 0x2000 }, + { 0x0700, 0x191a, 0x0000 }, + { 0x0700, 0x191c, 0x0000 }, + { 0x8a00, 0x1924, 0x3000 }, + { 0x8c00, 0x1922, 0x2000 }, + { 0x0c00, 0x1921, 0x0000 }, + { 0x0a00, 0x1923, 0x0000 }, + { 0x8a00, 0x1926, 0x2000 }, + { 0x0a00, 0x1925, 0x0000 }, + { 0x0c00, 0x1927, 0x0000 }, + { 0x8a00, 0x1934, 0x4000 }, + { 0x8a00, 0x1930, 0x3000 }, + { 0x8a00, 0x192a, 0x2000 }, + { 0x0a00, 0x1929, 0x0000 }, + { 0x0a00, 0x192b, 0x0000 }, + { 0x8c00, 0x1932, 0x2000 }, + { 0x0a00, 0x1931, 0x0000 }, + { 0x0a00, 0x1933, 0x0000 }, + { 0x8a00, 0x1938, 0x3000 }, + { 0x8a00, 0x1936, 0x2000 }, + { 0x0a00, 0x1935, 0x0000 }, + { 0x0a00, 0x1937, 0x0000 }, + { 0x8c00, 0x193a, 0x2000 }, + { 0x0c00, 0x1939, 0x0000 }, + { 0x0c00, 0x193b, 0x0000 }, + { 0x8700, 0x1953, 0x5000 }, + { 0x8d00, 0x194b, 0x4000 }, + { 0x8d00, 0x1947, 0x3000 }, + { 0x9500, 0x1945, 0x2000 }, + { 0x1500, 0x1944, 0x0000 }, + { 0x0d00, 0x1946, 0x0000 }, + { 0x8d00, 0x1949, 0x2000 }, + { 0x0d00, 0x1948, 0x0000 }, + { 0x0d00, 0x194a, 0x0000 }, + { 0x8d00, 0x194f, 0x3000 }, + { 0x8d00, 0x194d, 0x2000 }, + { 0x0d00, 0x194c, 0x0000 }, + { 0x0d00, 0x194e, 0x0000 }, + { 0x8700, 0x1951, 0x2000 }, + { 0x0700, 0x1950, 0x0000 }, + { 0x0700, 0x1952, 0x0000 }, + { 0x8700, 0x195b, 0x4000 }, + { 0x8700, 0x1957, 0x3000 }, + { 0x8700, 0x1955, 0x2000 }, + { 0x0700, 0x1954, 0x0000 }, + { 0x0700, 0x1956, 0x0000 }, + { 0x8700, 0x1959, 0x2000 }, + { 0x0700, 0x1958, 0x0000 }, + { 0x0700, 0x195a, 0x0000 }, + { 0x8700, 0x195f, 0x3000 }, + { 0x8700, 0x195d, 0x2000 }, + { 0x0700, 0x195c, 0x0000 }, + { 0x0700, 0x195e, 0x0000 }, + { 0x8700, 0x1961, 0x2000 }, + { 0x0700, 0x1960, 0x0000 }, + { 0x0700, 0x1962, 0x0000 }, + { 0x9a00, 0x19f0, 0x6000 }, + { 0x9a00, 0x19e0, 0x5000 }, + { 0x8700, 0x196b, 0x4000 }, + { 0x8700, 0x1967, 0x3000 }, + { 0x8700, 0x1965, 0x2000 }, + { 0x0700, 0x1964, 0x0000 }, + { 0x0700, 0x1966, 0x0000 }, + { 0x8700, 0x1969, 0x2000 }, + { 0x0700, 0x1968, 0x0000 }, + { 0x0700, 0x196a, 0x0000 }, + { 0x8700, 0x1971, 0x3000 }, + { 0x8700, 0x196d, 0x2000 }, + { 0x0700, 0x196c, 0x0000 }, + { 0x0700, 0x1970, 0x0000 }, + { 0x8700, 0x1973, 0x2000 }, + { 0x0700, 0x1972, 0x0000 }, + { 0x0700, 0x1974, 0x0000 }, + { 0x9a00, 0x19e8, 0x4000 }, + { 0x9a00, 0x19e4, 0x3000 }, + { 0x9a00, 0x19e2, 0x2000 }, + { 0x1a00, 0x19e1, 0x0000 }, + { 0x1a00, 0x19e3, 0x0000 }, + { 0x9a00, 0x19e6, 0x2000 }, + { 0x1a00, 0x19e5, 0x0000 }, + { 0x1a00, 0x19e7, 0x0000 }, + { 0x9a00, 0x19ec, 0x3000 }, + { 0x9a00, 0x19ea, 0x2000 }, + { 0x1a00, 0x19e9, 0x0000 }, + { 0x1a00, 0x19eb, 0x0000 }, + { 0x9a00, 0x19ee, 0x2000 }, + { 0x1a00, 0x19ed, 0x0000 }, + { 0x1a00, 0x19ef, 0x0000 }, + { 0x8500, 0x1d00, 0x5000 }, + { 0x9a00, 0x19f8, 0x4000 }, + { 0x9a00, 0x19f4, 0x3000 }, + { 0x9a00, 0x19f2, 0x2000 }, + { 0x1a00, 0x19f1, 0x0000 }, + { 0x1a00, 0x19f3, 0x0000 }, + { 0x9a00, 0x19f6, 0x2000 }, + { 0x1a00, 0x19f5, 0x0000 }, + { 0x1a00, 0x19f7, 0x0000 }, + { 0x9a00, 0x19fc, 0x3000 }, + { 0x9a00, 0x19fa, 0x2000 }, + { 0x1a00, 0x19f9, 0x0000 }, + { 0x1a00, 0x19fb, 0x0000 }, + { 0x9a00, 0x19fe, 0x2000 }, + { 0x1a00, 0x19fd, 0x0000 }, + { 0x1a00, 0x19ff, 0x0000 }, + { 0x8500, 0x1d08, 0x4000 }, + { 0x8500, 0x1d04, 0x3000 }, + { 0x8500, 0x1d02, 0x2000 }, + { 0x0500, 0x1d01, 0x0000 }, + { 0x0500, 0x1d03, 0x0000 }, + { 0x8500, 0x1d06, 0x2000 }, + { 0x0500, 0x1d05, 0x0000 }, + { 0x0500, 0x1d07, 0x0000 }, + { 0x8500, 0x1d0c, 0x3000 }, + { 0x8500, 0x1d0a, 0x2000 }, + { 0x0500, 0x1d09, 0x0000 }, + { 0x0500, 0x1d0b, 0x0000 }, + { 0x8500, 0x1d0e, 0x2000 }, + { 0x0500, 0x1d0d, 0x0000 }, + { 0x0500, 0x1d0f, 0x0000 }, + { 0x8600, 0x1d50, 0x7000 }, + { 0x8600, 0x1d30, 0x6000 }, + { 0x8500, 0x1d20, 0x5000 }, + { 0x8500, 0x1d18, 0x4000 }, + { 0x8500, 0x1d14, 0x3000 }, + { 0x8500, 0x1d12, 0x2000 }, + { 0x0500, 0x1d11, 0x0000 }, + { 0x0500, 0x1d13, 0x0000 }, + { 0x8500, 0x1d16, 0x2000 }, + { 0x0500, 0x1d15, 0x0000 }, + { 0x0500, 0x1d17, 0x0000 }, + { 0x8500, 0x1d1c, 0x3000 }, + { 0x8500, 0x1d1a, 0x2000 }, + { 0x0500, 0x1d19, 0x0000 }, + { 0x0500, 0x1d1b, 0x0000 }, + { 0x8500, 0x1d1e, 0x2000 }, + { 0x0500, 0x1d1d, 0x0000 }, + { 0x0500, 0x1d1f, 0x0000 }, + { 0x8500, 0x1d28, 0x4000 }, + { 0x8500, 0x1d24, 0x3000 }, + { 0x8500, 0x1d22, 0x2000 }, + { 0x0500, 0x1d21, 0x0000 }, + { 0x0500, 0x1d23, 0x0000 }, + { 0x8500, 0x1d26, 0x2000 }, + { 0x0500, 0x1d25, 0x0000 }, + { 0x0500, 0x1d27, 0x0000 }, + { 0x8600, 0x1d2c, 0x3000 }, + { 0x8500, 0x1d2a, 0x2000 }, + { 0x0500, 0x1d29, 0x0000 }, + { 0x0500, 0x1d2b, 0x0000 }, + { 0x8600, 0x1d2e, 0x2000 }, + { 0x0600, 0x1d2d, 0x0000 }, + { 0x0600, 0x1d2f, 0x0000 }, + { 0x8600, 0x1d40, 0x5000 }, + { 0x8600, 0x1d38, 0x4000 }, + { 0x8600, 0x1d34, 0x3000 }, + { 0x8600, 0x1d32, 0x2000 }, + { 0x0600, 0x1d31, 0x0000 }, + { 0x0600, 0x1d33, 0x0000 }, + { 0x8600, 0x1d36, 0x2000 }, + { 0x0600, 0x1d35, 0x0000 }, + { 0x0600, 0x1d37, 0x0000 }, + { 0x8600, 0x1d3c, 0x3000 }, + { 0x8600, 0x1d3a, 0x2000 }, + { 0x0600, 0x1d39, 0x0000 }, + { 0x0600, 0x1d3b, 0x0000 }, + { 0x8600, 0x1d3e, 0x2000 }, + { 0x0600, 0x1d3d, 0x0000 }, + { 0x0600, 0x1d3f, 0x0000 }, + { 0x8600, 0x1d48, 0x4000 }, + { 0x8600, 0x1d44, 0x3000 }, + { 0x8600, 0x1d42, 0x2000 }, + { 0x0600, 0x1d41, 0x0000 }, + { 0x0600, 0x1d43, 0x0000 }, + { 0x8600, 0x1d46, 0x2000 }, + { 0x0600, 0x1d45, 0x0000 }, + { 0x0600, 0x1d47, 0x0000 }, + { 0x8600, 0x1d4c, 0x3000 }, + { 0x8600, 0x1d4a, 0x2000 }, + { 0x0600, 0x1d49, 0x0000 }, + { 0x0600, 0x1d4b, 0x0000 }, + { 0x8600, 0x1d4e, 0x2000 }, + { 0x0600, 0x1d4d, 0x0000 }, + { 0x0600, 0x1d4f, 0x0000 }, + { 0x8900, 0x1e04, 0x6001 }, + { 0x8600, 0x1d60, 0x5000 }, + { 0x8600, 0x1d58, 0x4000 }, + { 0x8600, 0x1d54, 0x3000 }, + { 0x8600, 0x1d52, 0x2000 }, + { 0x0600, 0x1d51, 0x0000 }, + { 0x0600, 0x1d53, 0x0000 }, + { 0x8600, 0x1d56, 0x2000 }, + { 0x0600, 0x1d55, 0x0000 }, + { 0x0600, 0x1d57, 0x0000 }, + { 0x8600, 0x1d5c, 0x3000 }, + { 0x8600, 0x1d5a, 0x2000 }, + { 0x0600, 0x1d59, 0x0000 }, + { 0x0600, 0x1d5b, 0x0000 }, + { 0x8600, 0x1d5e, 0x2000 }, + { 0x0600, 0x1d5d, 0x0000 }, + { 0x0600, 0x1d5f, 0x0000 }, + { 0x8500, 0x1d68, 0x4000 }, + { 0x8500, 0x1d64, 0x3000 }, + { 0x8500, 0x1d62, 0x2000 }, + { 0x0600, 0x1d61, 0x0000 }, + { 0x0500, 0x1d63, 0x0000 }, + { 0x8500, 0x1d66, 0x2000 }, + { 0x0500, 0x1d65, 0x0000 }, + { 0x0500, 0x1d67, 0x0000 }, + { 0x8900, 0x1e00, 0x3001 }, + { 0x8500, 0x1d6a, 0x2000 }, + { 0x0500, 0x1d69, 0x0000 }, + { 0x0500, 0x1d6b, 0x0000 }, + { 0x8900, 0x1e02, 0x2001 }, + { 0x0500, 0x1e01, 0x0fff }, + { 0x0500, 0x1e03, 0x0fff }, + { 0x8900, 0x1e14, 0x5001 }, + { 0x8900, 0x1e0c, 0x4001 }, + { 0x8900, 0x1e08, 0x3001 }, + { 0x8900, 0x1e06, 0x2001 }, + { 0x0500, 0x1e05, 0x0fff }, + { 0x0500, 0x1e07, 0x0fff }, + { 0x8900, 0x1e0a, 0x2001 }, + { 0x0500, 0x1e09, 0x0fff }, + { 0x0500, 0x1e0b, 0x0fff }, + { 0x8900, 0x1e10, 0x3001 }, + { 0x8900, 0x1e0e, 0x2001 }, + { 0x0500, 0x1e0d, 0x0fff }, + { 0x0500, 0x1e0f, 0x0fff }, + { 0x8900, 0x1e12, 0x2001 }, + { 0x0500, 0x1e11, 0x0fff }, + { 0x0500, 0x1e13, 0x0fff }, + { 0x8900, 0x1e1c, 0x4001 }, + { 0x8900, 0x1e18, 0x3001 }, + { 0x8900, 0x1e16, 0x2001 }, + { 0x0500, 0x1e15, 0x0fff }, + { 0x0500, 0x1e17, 0x0fff }, + { 0x8900, 0x1e1a, 0x2001 }, + { 0x0500, 0x1e19, 0x0fff }, + { 0x0500, 0x1e1b, 0x0fff }, + { 0x8900, 0x1e20, 0x3001 }, + { 0x8900, 0x1e1e, 0x2001 }, + { 0x0500, 0x1e1d, 0x0fff }, + { 0x0500, 0x1e1f, 0x0fff }, + { 0x8900, 0x1e22, 0x2001 }, + { 0x0500, 0x1e21, 0x0fff }, + { 0x0500, 0x1e23, 0x0fff }, + { 0x9600, 0x2045, 0xa000 }, + { 0x8500, 0x1f32, 0x9008 }, + { 0x8900, 0x1ea8, 0x8001 }, + { 0x8900, 0x1e64, 0x7001 }, + { 0x8900, 0x1e44, 0x6001 }, + { 0x8900, 0x1e34, 0x5001 }, + { 0x8900, 0x1e2c, 0x4001 }, + { 0x8900, 0x1e28, 0x3001 }, + { 0x8900, 0x1e26, 0x2001 }, + { 0x0500, 0x1e25, 0x0fff }, + { 0x0500, 0x1e27, 0x0fff }, + { 0x8900, 0x1e2a, 0x2001 }, + { 0x0500, 0x1e29, 0x0fff }, + { 0x0500, 0x1e2b, 0x0fff }, + { 0x8900, 0x1e30, 0x3001 }, + { 0x8900, 0x1e2e, 0x2001 }, + { 0x0500, 0x1e2d, 0x0fff }, + { 0x0500, 0x1e2f, 0x0fff }, + { 0x8900, 0x1e32, 0x2001 }, + { 0x0500, 0x1e31, 0x0fff }, + { 0x0500, 0x1e33, 0x0fff }, + { 0x8900, 0x1e3c, 0x4001 }, + { 0x8900, 0x1e38, 0x3001 }, + { 0x8900, 0x1e36, 0x2001 }, + { 0x0500, 0x1e35, 0x0fff }, + { 0x0500, 0x1e37, 0x0fff }, + { 0x8900, 0x1e3a, 0x2001 }, + { 0x0500, 0x1e39, 0x0fff }, + { 0x0500, 0x1e3b, 0x0fff }, + { 0x8900, 0x1e40, 0x3001 }, + { 0x8900, 0x1e3e, 0x2001 }, + { 0x0500, 0x1e3d, 0x0fff }, + { 0x0500, 0x1e3f, 0x0fff }, + { 0x8900, 0x1e42, 0x2001 }, + { 0x0500, 0x1e41, 0x0fff }, + { 0x0500, 0x1e43, 0x0fff }, + { 0x8900, 0x1e54, 0x5001 }, + { 0x8900, 0x1e4c, 0x4001 }, + { 0x8900, 0x1e48, 0x3001 }, + { 0x8900, 0x1e46, 0x2001 }, + { 0x0500, 0x1e45, 0x0fff }, + { 0x0500, 0x1e47, 0x0fff }, + { 0x8900, 0x1e4a, 0x2001 }, + { 0x0500, 0x1e49, 0x0fff }, + { 0x0500, 0x1e4b, 0x0fff }, + { 0x8900, 0x1e50, 0x3001 }, + { 0x8900, 0x1e4e, 0x2001 }, + { 0x0500, 0x1e4d, 0x0fff }, + { 0x0500, 0x1e4f, 0x0fff }, + { 0x8900, 0x1e52, 0x2001 }, + { 0x0500, 0x1e51, 0x0fff }, + { 0x0500, 0x1e53, 0x0fff }, + { 0x8900, 0x1e5c, 0x4001 }, + { 0x8900, 0x1e58, 0x3001 }, + { 0x8900, 0x1e56, 0x2001 }, + { 0x0500, 0x1e55, 0x0fff }, + { 0x0500, 0x1e57, 0x0fff }, + { 0x8900, 0x1e5a, 0x2001 }, + { 0x0500, 0x1e59, 0x0fff }, + { 0x0500, 0x1e5b, 0x0fff }, + { 0x8900, 0x1e60, 0x3001 }, + { 0x8900, 0x1e5e, 0x2001 }, + { 0x0500, 0x1e5d, 0x0fff }, + { 0x0500, 0x1e5f, 0x0fff }, + { 0x8900, 0x1e62, 0x2001 }, + { 0x0500, 0x1e61, 0x0fff }, + { 0x0500, 0x1e63, 0x0fff }, + { 0x8900, 0x1e84, 0x6001 }, + { 0x8900, 0x1e74, 0x5001 }, + { 0x8900, 0x1e6c, 0x4001 }, + { 0x8900, 0x1e68, 0x3001 }, + { 0x8900, 0x1e66, 0x2001 }, + { 0x0500, 0x1e65, 0x0fff }, + { 0x0500, 0x1e67, 0x0fff }, + { 0x8900, 0x1e6a, 0x2001 }, + { 0x0500, 0x1e69, 0x0fff }, + { 0x0500, 0x1e6b, 0x0fff }, + { 0x8900, 0x1e70, 0x3001 }, + { 0x8900, 0x1e6e, 0x2001 }, + { 0x0500, 0x1e6d, 0x0fff }, + { 0x0500, 0x1e6f, 0x0fff }, + { 0x8900, 0x1e72, 0x2001 }, + { 0x0500, 0x1e71, 0x0fff }, + { 0x0500, 0x1e73, 0x0fff }, + { 0x8900, 0x1e7c, 0x4001 }, + { 0x8900, 0x1e78, 0x3001 }, + { 0x8900, 0x1e76, 0x2001 }, + { 0x0500, 0x1e75, 0x0fff }, + { 0x0500, 0x1e77, 0x0fff }, + { 0x8900, 0x1e7a, 0x2001 }, + { 0x0500, 0x1e79, 0x0fff }, + { 0x0500, 0x1e7b, 0x0fff }, + { 0x8900, 0x1e80, 0x3001 }, + { 0x8900, 0x1e7e, 0x2001 }, + { 0x0500, 0x1e7d, 0x0fff }, + { 0x0500, 0x1e7f, 0x0fff }, + { 0x8900, 0x1e82, 0x2001 }, + { 0x0500, 0x1e81, 0x0fff }, + { 0x0500, 0x1e83, 0x0fff }, + { 0x8900, 0x1e94, 0x5001 }, + { 0x8900, 0x1e8c, 0x4001 }, + { 0x8900, 0x1e88, 0x3001 }, + { 0x8900, 0x1e86, 0x2001 }, + { 0x0500, 0x1e85, 0x0fff }, + { 0x0500, 0x1e87, 0x0fff }, + { 0x8900, 0x1e8a, 0x2001 }, + { 0x0500, 0x1e89, 0x0fff }, + { 0x0500, 0x1e8b, 0x0fff }, + { 0x8900, 0x1e90, 0x3001 }, + { 0x8900, 0x1e8e, 0x2001 }, + { 0x0500, 0x1e8d, 0x0fff }, + { 0x0500, 0x1e8f, 0x0fff }, + { 0x8900, 0x1e92, 0x2001 }, + { 0x0500, 0x1e91, 0x0fff }, + { 0x0500, 0x1e93, 0x0fff }, + { 0x8900, 0x1ea0, 0x4001 }, + { 0x8500, 0x1e98, 0x3000 }, + { 0x8500, 0x1e96, 0x2000 }, + { 0x0500, 0x1e95, 0x0fff }, + { 0x0500, 0x1e97, 0x0000 }, + { 0x8500, 0x1e9a, 0x2000 }, + { 0x0500, 0x1e99, 0x0000 }, + { 0x0500, 0x1e9b, 0x0fc5 }, + { 0x8900, 0x1ea4, 0x3001 }, + { 0x8900, 0x1ea2, 0x2001 }, + { 0x0500, 0x1ea1, 0x0fff }, + { 0x0500, 0x1ea3, 0x0fff }, + { 0x8900, 0x1ea6, 0x2001 }, + { 0x0500, 0x1ea5, 0x0fff }, + { 0x0500, 0x1ea7, 0x0fff }, + { 0x8900, 0x1ee8, 0x7001 }, + { 0x8900, 0x1ec8, 0x6001 }, + { 0x8900, 0x1eb8, 0x5001 }, + { 0x8900, 0x1eb0, 0x4001 }, + { 0x8900, 0x1eac, 0x3001 }, + { 0x8900, 0x1eaa, 0x2001 }, + { 0x0500, 0x1ea9, 0x0fff }, + { 0x0500, 0x1eab, 0x0fff }, + { 0x8900, 0x1eae, 0x2001 }, + { 0x0500, 0x1ead, 0x0fff }, + { 0x0500, 0x1eaf, 0x0fff }, + { 0x8900, 0x1eb4, 0x3001 }, + { 0x8900, 0x1eb2, 0x2001 }, + { 0x0500, 0x1eb1, 0x0fff }, + { 0x0500, 0x1eb3, 0x0fff }, + { 0x8900, 0x1eb6, 0x2001 }, + { 0x0500, 0x1eb5, 0x0fff }, + { 0x0500, 0x1eb7, 0x0fff }, + { 0x8900, 0x1ec0, 0x4001 }, + { 0x8900, 0x1ebc, 0x3001 }, + { 0x8900, 0x1eba, 0x2001 }, + { 0x0500, 0x1eb9, 0x0fff }, + { 0x0500, 0x1ebb, 0x0fff }, + { 0x8900, 0x1ebe, 0x2001 }, + { 0x0500, 0x1ebd, 0x0fff }, + { 0x0500, 0x1ebf, 0x0fff }, + { 0x8900, 0x1ec4, 0x3001 }, + { 0x8900, 0x1ec2, 0x2001 }, + { 0x0500, 0x1ec1, 0x0fff }, + { 0x0500, 0x1ec3, 0x0fff }, + { 0x8900, 0x1ec6, 0x2001 }, + { 0x0500, 0x1ec5, 0x0fff }, + { 0x0500, 0x1ec7, 0x0fff }, + { 0x8900, 0x1ed8, 0x5001 }, + { 0x8900, 0x1ed0, 0x4001 }, + { 0x8900, 0x1ecc, 0x3001 }, + { 0x8900, 0x1eca, 0x2001 }, + { 0x0500, 0x1ec9, 0x0fff }, + { 0x0500, 0x1ecb, 0x0fff }, + { 0x8900, 0x1ece, 0x2001 }, + { 0x0500, 0x1ecd, 0x0fff }, + { 0x0500, 0x1ecf, 0x0fff }, + { 0x8900, 0x1ed4, 0x3001 }, + { 0x8900, 0x1ed2, 0x2001 }, + { 0x0500, 0x1ed1, 0x0fff }, + { 0x0500, 0x1ed3, 0x0fff }, + { 0x8900, 0x1ed6, 0x2001 }, + { 0x0500, 0x1ed5, 0x0fff }, + { 0x0500, 0x1ed7, 0x0fff }, + { 0x8900, 0x1ee0, 0x4001 }, + { 0x8900, 0x1edc, 0x3001 }, + { 0x8900, 0x1eda, 0x2001 }, + { 0x0500, 0x1ed9, 0x0fff }, + { 0x0500, 0x1edb, 0x0fff }, + { 0x8900, 0x1ede, 0x2001 }, + { 0x0500, 0x1edd, 0x0fff }, + { 0x0500, 0x1edf, 0x0fff }, + { 0x8900, 0x1ee4, 0x3001 }, + { 0x8900, 0x1ee2, 0x2001 }, + { 0x0500, 0x1ee1, 0x0fff }, + { 0x0500, 0x1ee3, 0x0fff }, + { 0x8900, 0x1ee6, 0x2001 }, + { 0x0500, 0x1ee5, 0x0fff }, + { 0x0500, 0x1ee7, 0x0fff }, + { 0x8900, 0x1f0e, 0x6ff8 }, + { 0x8900, 0x1ef8, 0x5001 }, + { 0x8900, 0x1ef0, 0x4001 }, + { 0x8900, 0x1eec, 0x3001 }, + { 0x8900, 0x1eea, 0x2001 }, + { 0x0500, 0x1ee9, 0x0fff }, + { 0x0500, 0x1eeb, 0x0fff }, + { 0x8900, 0x1eee, 0x2001 }, + { 0x0500, 0x1eed, 0x0fff }, + { 0x0500, 0x1eef, 0x0fff }, + { 0x8900, 0x1ef4, 0x3001 }, + { 0x8900, 0x1ef2, 0x2001 }, + { 0x0500, 0x1ef1, 0x0fff }, + { 0x0500, 0x1ef3, 0x0fff }, + { 0x8900, 0x1ef6, 0x2001 }, + { 0x0500, 0x1ef5, 0x0fff }, + { 0x0500, 0x1ef7, 0x0fff }, + { 0x8500, 0x1f06, 0x4008 }, + { 0x8500, 0x1f02, 0x3008 }, + { 0x8500, 0x1f00, 0x2008 }, + { 0x0500, 0x1ef9, 0x0fff }, + { 0x0500, 0x1f01, 0x0008 }, + { 0x8500, 0x1f04, 0x2008 }, + { 0x0500, 0x1f03, 0x0008 }, + { 0x0500, 0x1f05, 0x0008 }, + { 0x8900, 0x1f0a, 0x3ff8 }, + { 0x8900, 0x1f08, 0x2ff8 }, + { 0x0500, 0x1f07, 0x0008 }, + { 0x0900, 0x1f09, 0x0ff8 }, + { 0x8900, 0x1f0c, 0x2ff8 }, + { 0x0900, 0x1f0b, 0x0ff8 }, + { 0x0900, 0x1f0d, 0x0ff8 }, + { 0x8500, 0x1f22, 0x5008 }, + { 0x8900, 0x1f18, 0x4ff8 }, + { 0x8500, 0x1f12, 0x3008 }, + { 0x8500, 0x1f10, 0x2008 }, + { 0x0900, 0x1f0f, 0x0ff8 }, + { 0x0500, 0x1f11, 0x0008 }, + { 0x8500, 0x1f14, 0x2008 }, + { 0x0500, 0x1f13, 0x0008 }, + { 0x0500, 0x1f15, 0x0008 }, + { 0x8900, 0x1f1c, 0x3ff8 }, + { 0x8900, 0x1f1a, 0x2ff8 }, + { 0x0900, 0x1f19, 0x0ff8 }, + { 0x0900, 0x1f1b, 0x0ff8 }, + { 0x8500, 0x1f20, 0x2008 }, + { 0x0900, 0x1f1d, 0x0ff8 }, + { 0x0500, 0x1f21, 0x0008 }, + { 0x8900, 0x1f2a, 0x4ff8 }, + { 0x8500, 0x1f26, 0x3008 }, + { 0x8500, 0x1f24, 0x2008 }, + { 0x0500, 0x1f23, 0x0008 }, + { 0x0500, 0x1f25, 0x0008 }, + { 0x8900, 0x1f28, 0x2ff8 }, + { 0x0500, 0x1f27, 0x0008 }, + { 0x0900, 0x1f29, 0x0ff8 }, + { 0x8900, 0x1f2e, 0x3ff8 }, + { 0x8900, 0x1f2c, 0x2ff8 }, + { 0x0900, 0x1f2b, 0x0ff8 }, + { 0x0900, 0x1f2d, 0x0ff8 }, + { 0x8500, 0x1f30, 0x2008 }, + { 0x0900, 0x1f2f, 0x0ff8 }, + { 0x0500, 0x1f31, 0x0008 }, + { 0x9800, 0x1fbd, 0x8000 }, + { 0x8500, 0x1f7a, 0x7070 }, + { 0x8500, 0x1f56, 0x6000 }, + { 0x8500, 0x1f42, 0x5008 }, + { 0x8900, 0x1f3a, 0x4ff8 }, + { 0x8500, 0x1f36, 0x3008 }, + { 0x8500, 0x1f34, 0x2008 }, + { 0x0500, 0x1f33, 0x0008 }, + { 0x0500, 0x1f35, 0x0008 }, + { 0x8900, 0x1f38, 0x2ff8 }, + { 0x0500, 0x1f37, 0x0008 }, + { 0x0900, 0x1f39, 0x0ff8 }, + { 0x8900, 0x1f3e, 0x3ff8 }, + { 0x8900, 0x1f3c, 0x2ff8 }, + { 0x0900, 0x1f3b, 0x0ff8 }, + { 0x0900, 0x1f3d, 0x0ff8 }, + { 0x8500, 0x1f40, 0x2008 }, + { 0x0900, 0x1f3f, 0x0ff8 }, + { 0x0500, 0x1f41, 0x0008 }, + { 0x8900, 0x1f4c, 0x4ff8 }, + { 0x8900, 0x1f48, 0x3ff8 }, + { 0x8500, 0x1f44, 0x2008 }, + { 0x0500, 0x1f43, 0x0008 }, + { 0x0500, 0x1f45, 0x0008 }, + { 0x8900, 0x1f4a, 0x2ff8 }, + { 0x0900, 0x1f49, 0x0ff8 }, + { 0x0900, 0x1f4b, 0x0ff8 }, + { 0x8500, 0x1f52, 0x3000 }, + { 0x8500, 0x1f50, 0x2000 }, + { 0x0900, 0x1f4d, 0x0ff8 }, + { 0x0500, 0x1f51, 0x0008 }, + { 0x8500, 0x1f54, 0x2000 }, + { 0x0500, 0x1f53, 0x0008 }, + { 0x0500, 0x1f55, 0x0008 }, + { 0x8900, 0x1f6a, 0x5ff8 }, + { 0x8500, 0x1f62, 0x4008 }, + { 0x8900, 0x1f5d, 0x3ff8 }, + { 0x8900, 0x1f59, 0x2ff8 }, + { 0x0500, 0x1f57, 0x0008 }, + { 0x0900, 0x1f5b, 0x0ff8 }, + { 0x8500, 0x1f60, 0x2008 }, + { 0x0900, 0x1f5f, 0x0ff8 }, + { 0x0500, 0x1f61, 0x0008 }, + { 0x8500, 0x1f66, 0x3008 }, + { 0x8500, 0x1f64, 0x2008 }, + { 0x0500, 0x1f63, 0x0008 }, + { 0x0500, 0x1f65, 0x0008 }, + { 0x8900, 0x1f68, 0x2ff8 }, + { 0x0500, 0x1f67, 0x0008 }, + { 0x0900, 0x1f69, 0x0ff8 }, + { 0x8500, 0x1f72, 0x4056 }, + { 0x8900, 0x1f6e, 0x3ff8 }, + { 0x8900, 0x1f6c, 0x2ff8 }, + { 0x0900, 0x1f6b, 0x0ff8 }, + { 0x0900, 0x1f6d, 0x0ff8 }, + { 0x8500, 0x1f70, 0x204a }, + { 0x0900, 0x1f6f, 0x0ff8 }, + { 0x0500, 0x1f71, 0x004a }, + { 0x8500, 0x1f76, 0x3064 }, + { 0x8500, 0x1f74, 0x2056 }, + { 0x0500, 0x1f73, 0x0056 }, + { 0x0500, 0x1f75, 0x0056 }, + { 0x8500, 0x1f78, 0x2080 }, + { 0x0500, 0x1f77, 0x0064 }, + { 0x0500, 0x1f79, 0x0080 }, + { 0x8800, 0x1f9c, 0x6000 }, + { 0x8800, 0x1f8c, 0x5000 }, + { 0x8500, 0x1f84, 0x4008 }, + { 0x8500, 0x1f80, 0x3008 }, + { 0x8500, 0x1f7c, 0x207e }, + { 0x0500, 0x1f7b, 0x0070 }, + { 0x0500, 0x1f7d, 0x007e }, + { 0x8500, 0x1f82, 0x2008 }, + { 0x0500, 0x1f81, 0x0008 }, + { 0x0500, 0x1f83, 0x0008 }, + { 0x8800, 0x1f88, 0x3000 }, + { 0x8500, 0x1f86, 0x2008 }, + { 0x0500, 0x1f85, 0x0008 }, + { 0x0500, 0x1f87, 0x0008 }, + { 0x8800, 0x1f8a, 0x2000 }, + { 0x0800, 0x1f89, 0x0000 }, + { 0x0800, 0x1f8b, 0x0000 }, + { 0x8500, 0x1f94, 0x4008 }, + { 0x8500, 0x1f90, 0x3008 }, + { 0x8800, 0x1f8e, 0x2000 }, + { 0x0800, 0x1f8d, 0x0000 }, + { 0x0800, 0x1f8f, 0x0000 }, + { 0x8500, 0x1f92, 0x2008 }, + { 0x0500, 0x1f91, 0x0008 }, + { 0x0500, 0x1f93, 0x0008 }, + { 0x8800, 0x1f98, 0x3000 }, + { 0x8500, 0x1f96, 0x2008 }, + { 0x0500, 0x1f95, 0x0008 }, + { 0x0500, 0x1f97, 0x0008 }, + { 0x8800, 0x1f9a, 0x2000 }, + { 0x0800, 0x1f99, 0x0000 }, + { 0x0800, 0x1f9b, 0x0000 }, + { 0x8800, 0x1fac, 0x5000 }, + { 0x8500, 0x1fa4, 0x4008 }, + { 0x8500, 0x1fa0, 0x3008 }, + { 0x8800, 0x1f9e, 0x2000 }, + { 0x0800, 0x1f9d, 0x0000 }, + { 0x0800, 0x1f9f, 0x0000 }, + { 0x8500, 0x1fa2, 0x2008 }, + { 0x0500, 0x1fa1, 0x0008 }, + { 0x0500, 0x1fa3, 0x0008 }, + { 0x8800, 0x1fa8, 0x3000 }, + { 0x8500, 0x1fa6, 0x2008 }, + { 0x0500, 0x1fa5, 0x0008 }, + { 0x0500, 0x1fa7, 0x0008 }, + { 0x8800, 0x1faa, 0x2000 }, + { 0x0800, 0x1fa9, 0x0000 }, + { 0x0800, 0x1fab, 0x0000 }, + { 0x8500, 0x1fb4, 0x4000 }, + { 0x8500, 0x1fb0, 0x3008 }, + { 0x8800, 0x1fae, 0x2000 }, + { 0x0800, 0x1fad, 0x0000 }, + { 0x0800, 0x1faf, 0x0000 }, + { 0x8500, 0x1fb2, 0x2000 }, + { 0x0500, 0x1fb1, 0x0008 }, + { 0x0500, 0x1fb3, 0x0009 }, + { 0x8900, 0x1fb9, 0x3ff8 }, + { 0x8500, 0x1fb7, 0x2000 }, + { 0x0500, 0x1fb6, 0x0000 }, + { 0x0900, 0x1fb8, 0x0ff8 }, + { 0x8900, 0x1fbb, 0x2fb6 }, + { 0x0900, 0x1fba, 0x0fb6 }, + { 0x0800, 0x1fbc, 0x0000 }, + { 0x9d00, 0x2005, 0x7000 }, + { 0x8500, 0x1fe1, 0x6008 }, + { 0x9800, 0x1fce, 0x5000 }, + { 0x8500, 0x1fc6, 0x4000 }, + { 0x9800, 0x1fc1, 0x3000 }, + { 0x9800, 0x1fbf, 0x2000 }, + { 0x0500, 0x1fbe, 0x0000 }, + { 0x1800, 0x1fc0, 0x0000 }, + { 0x8500, 0x1fc3, 0x2009 }, + { 0x0500, 0x1fc2, 0x0000 }, + { 0x0500, 0x1fc4, 0x0000 }, + { 0x8900, 0x1fca, 0x3faa }, + { 0x8900, 0x1fc8, 0x2faa }, + { 0x0500, 0x1fc7, 0x0000 }, + { 0x0900, 0x1fc9, 0x0faa }, + { 0x8800, 0x1fcc, 0x2000 }, + { 0x0900, 0x1fcb, 0x0faa }, + { 0x1800, 0x1fcd, 0x0000 }, + { 0x8900, 0x1fd8, 0x4ff8 }, + { 0x8500, 0x1fd2, 0x3000 }, + { 0x8500, 0x1fd0, 0x2008 }, + { 0x1800, 0x1fcf, 0x0000 }, + { 0x0500, 0x1fd1, 0x0008 }, + { 0x8500, 0x1fd6, 0x2000 }, + { 0x0500, 0x1fd3, 0x0000 }, + { 0x0500, 0x1fd7, 0x0000 }, + { 0x9800, 0x1fdd, 0x3000 }, + { 0x8900, 0x1fda, 0x2f9c }, + { 0x0900, 0x1fd9, 0x0ff8 }, + { 0x0900, 0x1fdb, 0x0f9c }, + { 0x9800, 0x1fdf, 0x2000 }, + { 0x1800, 0x1fde, 0x0000 }, + { 0x0500, 0x1fe0, 0x0008 }, + { 0x8500, 0x1ff3, 0x5009 }, + { 0x8900, 0x1fe9, 0x4ff8 }, + { 0x8500, 0x1fe5, 0x3007 }, + { 0x8500, 0x1fe3, 0x2000 }, + { 0x0500, 0x1fe2, 0x0000 }, + { 0x0500, 0x1fe4, 0x0000 }, + { 0x8500, 0x1fe7, 0x2000 }, + { 0x0500, 0x1fe6, 0x0000 }, + { 0x0900, 0x1fe8, 0x0ff8 }, + { 0x9800, 0x1fed, 0x3000 }, + { 0x8900, 0x1feb, 0x2f90 }, + { 0x0900, 0x1fea, 0x0f90 }, + { 0x0900, 0x1fec, 0x0ff9 }, + { 0x9800, 0x1fef, 0x2000 }, + { 0x1800, 0x1fee, 0x0000 }, + { 0x0500, 0x1ff2, 0x0000 }, + { 0x8800, 0x1ffc, 0x4000 }, + { 0x8900, 0x1ff8, 0x3f80 }, + { 0x8500, 0x1ff6, 0x2000 }, + { 0x0500, 0x1ff4, 0x0000 }, + { 0x0500, 0x1ff7, 0x0000 }, + { 0x8900, 0x1ffa, 0x2f82 }, + { 0x0900, 0x1ff9, 0x0f80 }, + { 0x0900, 0x1ffb, 0x0f82 }, + { 0x9d00, 0x2001, 0x3000 }, + { 0x9800, 0x1ffe, 0x2000 }, + { 0x1800, 0x1ffd, 0x0000 }, + { 0x1d00, 0x2000, 0x0000 }, + { 0x9d00, 0x2003, 0x2000 }, + { 0x1d00, 0x2002, 0x0000 }, + { 0x1d00, 0x2004, 0x0000 }, + { 0x9500, 0x2025, 0x6000 }, + { 0x9100, 0x2015, 0x5000 }, + { 0x8100, 0x200d, 0x4000 }, + { 0x9d00, 0x2009, 0x3000 }, + { 0x9d00, 0x2007, 0x2000 }, + { 0x1d00, 0x2006, 0x0000 }, + { 0x1d00, 0x2008, 0x0000 }, + { 0x9d00, 0x200b, 0x2000 }, + { 0x1d00, 0x200a, 0x0000 }, + { 0x0100, 0x200c, 0x0000 }, + { 0x9100, 0x2011, 0x3000 }, + { 0x8100, 0x200f, 0x2000 }, + { 0x0100, 0x200e, 0x0000 }, + { 0x1100, 0x2010, 0x0000 }, + { 0x9100, 0x2013, 0x2000 }, + { 0x1100, 0x2012, 0x0000 }, + { 0x1100, 0x2014, 0x0000 }, + { 0x9300, 0x201d, 0x4000 }, + { 0x9300, 0x2019, 0x3000 }, + { 0x9500, 0x2017, 0x2000 }, + { 0x1500, 0x2016, 0x0000 }, + { 0x1400, 0x2018, 0x0000 }, + { 0x9400, 0x201b, 0x2000 }, + { 0x1600, 0x201a, 0x0000 }, + { 0x1400, 0x201c, 0x0000 }, + { 0x9500, 0x2021, 0x3000 }, + { 0x9400, 0x201f, 0x2000 }, + { 0x1600, 0x201e, 0x0000 }, + { 0x1500, 0x2020, 0x0000 }, + { 0x9500, 0x2023, 0x2000 }, + { 0x1500, 0x2022, 0x0000 }, + { 0x1500, 0x2024, 0x0000 }, + { 0x9500, 0x2035, 0x5000 }, + { 0x8100, 0x202d, 0x4000 }, + { 0x9c00, 0x2029, 0x3000 }, + { 0x9500, 0x2027, 0x2000 }, + { 0x1500, 0x2026, 0x0000 }, + { 0x1b00, 0x2028, 0x0000 }, + { 0x8100, 0x202b, 0x2000 }, + { 0x0100, 0x202a, 0x0000 }, + { 0x0100, 0x202c, 0x0000 }, + { 0x9500, 0x2031, 0x3000 }, + { 0x9d00, 0x202f, 0x2000 }, + { 0x0100, 0x202e, 0x0000 }, + { 0x1500, 0x2030, 0x0000 }, + { 0x9500, 0x2033, 0x2000 }, + { 0x1500, 0x2032, 0x0000 }, + { 0x1500, 0x2034, 0x0000 }, + { 0x9500, 0x203d, 0x4000 }, + { 0x9400, 0x2039, 0x3000 }, + { 0x9500, 0x2037, 0x2000 }, + { 0x1500, 0x2036, 0x0000 }, + { 0x1500, 0x2038, 0x0000 }, + { 0x9500, 0x203b, 0x2000 }, + { 0x1300, 0x203a, 0x0000 }, + { 0x1500, 0x203c, 0x0000 }, + { 0x9500, 0x2041, 0x3000 }, + { 0x9000, 0x203f, 0x2000 }, + { 0x1500, 0x203e, 0x0000 }, + { 0x1000, 0x2040, 0x0000 }, + { 0x9500, 0x2043, 0x2000 }, + { 0x1500, 0x2042, 0x0000 }, + { 0x1900, 0x2044, 0x0000 }, + { 0x9900, 0x21ae, 0x9000 }, + { 0x8900, 0x211a, 0x8000 }, + { 0x9700, 0x20a7, 0x7000 }, + { 0x8f00, 0x2076, 0x6000 }, + { 0x9500, 0x2057, 0x5000 }, + { 0x9500, 0x204d, 0x4000 }, + { 0x9500, 0x2049, 0x3000 }, + { 0x9500, 0x2047, 0x2000 }, + { 0x1200, 0x2046, 0x0000 }, + { 0x1500, 0x2048, 0x0000 }, + { 0x9500, 0x204b, 0x2000 }, + { 0x1500, 0x204a, 0x0000 }, + { 0x1500, 0x204c, 0x0000 }, + { 0x9500, 0x2051, 0x3000 }, + { 0x9500, 0x204f, 0x2000 }, + { 0x1500, 0x204e, 0x0000 }, + { 0x1500, 0x2050, 0x0000 }, + { 0x9500, 0x2053, 0x2000 }, + { 0x1900, 0x2052, 0x0000 }, + { 0x1000, 0x2054, 0x0000 }, + { 0x8100, 0x206c, 0x4000 }, + { 0x8100, 0x2062, 0x3000 }, + { 0x8100, 0x2060, 0x2000 }, + { 0x1d00, 0x205f, 0x0000 }, + { 0x0100, 0x2061, 0x0000 }, + { 0x8100, 0x206a, 0x2000 }, + { 0x0100, 0x2063, 0x0000 }, + { 0x0100, 0x206b, 0x0000 }, + { 0x8f00, 0x2070, 0x3000 }, + { 0x8100, 0x206e, 0x2000 }, + { 0x0100, 0x206d, 0x0000 }, + { 0x0100, 0x206f, 0x0000 }, + { 0x8f00, 0x2074, 0x2000 }, + { 0x0500, 0x2071, 0x0000 }, + { 0x0f00, 0x2075, 0x0000 }, + { 0x8f00, 0x2086, 0x5000 }, + { 0x9200, 0x207e, 0x4000 }, + { 0x9900, 0x207a, 0x3000 }, + { 0x8f00, 0x2078, 0x2000 }, + { 0x0f00, 0x2077, 0x0000 }, + { 0x0f00, 0x2079, 0x0000 }, + { 0x9900, 0x207c, 0x2000 }, + { 0x1900, 0x207b, 0x0000 }, + { 0x1600, 0x207d, 0x0000 }, + { 0x8f00, 0x2082, 0x3000 }, + { 0x8f00, 0x2080, 0x2000 }, + { 0x0500, 0x207f, 0x0000 }, + { 0x0f00, 0x2081, 0x0000 }, + { 0x8f00, 0x2084, 0x2000 }, + { 0x0f00, 0x2083, 0x0000 }, + { 0x0f00, 0x2085, 0x0000 }, + { 0x9200, 0x208e, 0x4000 }, + { 0x9900, 0x208a, 0x3000 }, + { 0x8f00, 0x2088, 0x2000 }, + { 0x0f00, 0x2087, 0x0000 }, + { 0x0f00, 0x2089, 0x0000 }, + { 0x9900, 0x208c, 0x2000 }, + { 0x1900, 0x208b, 0x0000 }, + { 0x1600, 0x208d, 0x0000 }, + { 0x9700, 0x20a3, 0x3000 }, + { 0x9700, 0x20a1, 0x2000 }, + { 0x1700, 0x20a0, 0x0000 }, + { 0x1700, 0x20a2, 0x0000 }, + { 0x9700, 0x20a5, 0x2000 }, + { 0x1700, 0x20a4, 0x0000 }, + { 0x1700, 0x20a6, 0x0000 }, + { 0x8c00, 0x20e5, 0x6000 }, + { 0x8c00, 0x20d5, 0x5000 }, + { 0x9700, 0x20af, 0x4000 }, + { 0x9700, 0x20ab, 0x3000 }, + { 0x9700, 0x20a9, 0x2000 }, + { 0x1700, 0x20a8, 0x0000 }, + { 0x1700, 0x20aa, 0x0000 }, + { 0x9700, 0x20ad, 0x2000 }, + { 0x1700, 0x20ac, 0x0000 }, + { 0x1700, 0x20ae, 0x0000 }, + { 0x8c00, 0x20d1, 0x3000 }, + { 0x9700, 0x20b1, 0x2000 }, + { 0x1700, 0x20b0, 0x0000 }, + { 0x0c00, 0x20d0, 0x0000 }, + { 0x8c00, 0x20d3, 0x2000 }, + { 0x0c00, 0x20d2, 0x0000 }, + { 0x0c00, 0x20d4, 0x0000 }, + { 0x8b00, 0x20dd, 0x4000 }, + { 0x8c00, 0x20d9, 0x3000 }, + { 0x8c00, 0x20d7, 0x2000 }, + { 0x0c00, 0x20d6, 0x0000 }, + { 0x0c00, 0x20d8, 0x0000 }, + { 0x8c00, 0x20db, 0x2000 }, + { 0x0c00, 0x20da, 0x0000 }, + { 0x0c00, 0x20dc, 0x0000 }, + { 0x8c00, 0x20e1, 0x3000 }, + { 0x8b00, 0x20df, 0x2000 }, + { 0x0b00, 0x20de, 0x0000 }, + { 0x0b00, 0x20e0, 0x0000 }, + { 0x8b00, 0x20e3, 0x2000 }, + { 0x0b00, 0x20e2, 0x0000 }, + { 0x0b00, 0x20e4, 0x0000 }, + { 0x8500, 0x210a, 0x5000 }, + { 0x8900, 0x2102, 0x4000 }, + { 0x8c00, 0x20e9, 0x3000 }, + { 0x8c00, 0x20e7, 0x2000 }, + { 0x0c00, 0x20e6, 0x0000 }, + { 0x0c00, 0x20e8, 0x0000 }, + { 0x9a00, 0x2100, 0x2000 }, + { 0x0c00, 0x20ea, 0x0000 }, + { 0x1a00, 0x2101, 0x0000 }, + { 0x9a00, 0x2106, 0x3000 }, + { 0x9a00, 0x2104, 0x2000 }, + { 0x1a00, 0x2103, 0x0000 }, + { 0x1a00, 0x2105, 0x0000 }, + { 0x9a00, 0x2108, 0x2000 }, + { 0x0900, 0x2107, 0x0000 }, + { 0x1a00, 0x2109, 0x0000 }, + { 0x8900, 0x2112, 0x4000 }, + { 0x8500, 0x210e, 0x3000 }, + { 0x8900, 0x210c, 0x2000 }, + { 0x0900, 0x210b, 0x0000 }, + { 0x0900, 0x210d, 0x0000 }, + { 0x8900, 0x2110, 0x2000 }, + { 0x0500, 0x210f, 0x0000 }, + { 0x0900, 0x2111, 0x0000 }, + { 0x9a00, 0x2116, 0x3000 }, + { 0x9a00, 0x2114, 0x2000 }, + { 0x0500, 0x2113, 0x0000 }, + { 0x0900, 0x2115, 0x0000 }, + { 0x9a00, 0x2118, 0x2000 }, + { 0x1a00, 0x2117, 0x0000 }, + { 0x0900, 0x2119, 0x0000 }, + { 0x8e00, 0x2162, 0x7000 }, + { 0x9a00, 0x213a, 0x6000 }, + { 0x8900, 0x212a, 0x5000 }, + { 0x9a00, 0x2122, 0x4000 }, + { 0x9a00, 0x211e, 0x3000 }, + { 0x8900, 0x211c, 0x2000 }, + { 0x0900, 0x211b, 0x0000 }, + { 0x0900, 0x211d, 0x0000 }, + { 0x9a00, 0x2120, 0x2000 }, + { 0x1a00, 0x211f, 0x0000 }, + { 0x1a00, 0x2121, 0x0000 }, + { 0x8900, 0x2126, 0x3000 }, + { 0x8900, 0x2124, 0x2000 }, + { 0x1a00, 0x2123, 0x0000 }, + { 0x1a00, 0x2125, 0x0000 }, + { 0x8900, 0x2128, 0x2000 }, + { 0x1a00, 0x2127, 0x0000 }, + { 0x1a00, 0x2129, 0x0000 }, + { 0x9a00, 0x2132, 0x4000 }, + { 0x9a00, 0x212e, 0x3000 }, + { 0x8900, 0x212c, 0x2000 }, + { 0x0900, 0x212b, 0x0000 }, + { 0x0900, 0x212d, 0x0000 }, + { 0x8900, 0x2130, 0x2000 }, + { 0x0500, 0x212f, 0x0000 }, + { 0x0900, 0x2131, 0x0000 }, + { 0x8700, 0x2136, 0x3000 }, + { 0x8500, 0x2134, 0x2000 }, + { 0x0900, 0x2133, 0x0000 }, + { 0x0700, 0x2135, 0x0000 }, + { 0x8700, 0x2138, 0x2000 }, + { 0x0700, 0x2137, 0x0000 }, + { 0x0500, 0x2139, 0x0000 }, + { 0x9900, 0x214b, 0x5000 }, + { 0x9900, 0x2143, 0x4000 }, + { 0x8900, 0x213f, 0x3000 }, + { 0x8500, 0x213d, 0x2000 }, + { 0x1a00, 0x213b, 0x0000 }, + { 0x0900, 0x213e, 0x0000 }, + { 0x9900, 0x2141, 0x2000 }, + { 0x1900, 0x2140, 0x0000 }, + { 0x1900, 0x2142, 0x0000 }, + { 0x8500, 0x2147, 0x3000 }, + { 0x8900, 0x2145, 0x2000 }, + { 0x1900, 0x2144, 0x0000 }, + { 0x0500, 0x2146, 0x0000 }, + { 0x8500, 0x2149, 0x2000 }, + { 0x0500, 0x2148, 0x0000 }, + { 0x1a00, 0x214a, 0x0000 }, + { 0x8f00, 0x215a, 0x4000 }, + { 0x8f00, 0x2156, 0x3000 }, + { 0x8f00, 0x2154, 0x2000 }, + { 0x0f00, 0x2153, 0x0000 }, + { 0x0f00, 0x2155, 0x0000 }, + { 0x8f00, 0x2158, 0x2000 }, + { 0x0f00, 0x2157, 0x0000 }, + { 0x0f00, 0x2159, 0x0000 }, + { 0x8f00, 0x215e, 0x3000 }, + { 0x8f00, 0x215c, 0x2000 }, + { 0x0f00, 0x215b, 0x0000 }, + { 0x0f00, 0x215d, 0x0000 }, + { 0x8e00, 0x2160, 0x2000 }, + { 0x0f00, 0x215f, 0x0000 }, + { 0x0e00, 0x2161, 0x0000 }, + { 0x8e00, 0x2182, 0x6000 }, + { 0x8e00, 0x2172, 0x5000 }, + { 0x8e00, 0x216a, 0x4000 }, + { 0x8e00, 0x2166, 0x3000 }, + { 0x8e00, 0x2164, 0x2000 }, + { 0x0e00, 0x2163, 0x0000 }, + { 0x0e00, 0x2165, 0x0000 }, + { 0x8e00, 0x2168, 0x2000 }, + { 0x0e00, 0x2167, 0x0000 }, + { 0x0e00, 0x2169, 0x0000 }, + { 0x8e00, 0x216e, 0x3000 }, + { 0x8e00, 0x216c, 0x2000 }, + { 0x0e00, 0x216b, 0x0000 }, + { 0x0e00, 0x216d, 0x0000 }, + { 0x8e00, 0x2170, 0x2000 }, + { 0x0e00, 0x216f, 0x0000 }, + { 0x0e00, 0x2171, 0x0000 }, + { 0x8e00, 0x217a, 0x4000 }, + { 0x8e00, 0x2176, 0x3000 }, + { 0x8e00, 0x2174, 0x2000 }, + { 0x0e00, 0x2173, 0x0000 }, + { 0x0e00, 0x2175, 0x0000 }, + { 0x8e00, 0x2178, 0x2000 }, + { 0x0e00, 0x2177, 0x0000 }, + { 0x0e00, 0x2179, 0x0000 }, + { 0x8e00, 0x217e, 0x3000 }, + { 0x8e00, 0x217c, 0x2000 }, + { 0x0e00, 0x217b, 0x0000 }, + { 0x0e00, 0x217d, 0x0000 }, + { 0x8e00, 0x2180, 0x2000 }, + { 0x0e00, 0x217f, 0x0000 }, + { 0x0e00, 0x2181, 0x0000 }, + { 0x9a00, 0x219e, 0x5000 }, + { 0x9a00, 0x2196, 0x4000 }, + { 0x9900, 0x2192, 0x3000 }, + { 0x9900, 0x2190, 0x2000 }, + { 0x0e00, 0x2183, 0x0000 }, + { 0x1900, 0x2191, 0x0000 }, + { 0x9900, 0x2194, 0x2000 }, + { 0x1900, 0x2193, 0x0000 }, + { 0x1a00, 0x2195, 0x0000 }, + { 0x9900, 0x219a, 0x3000 }, + { 0x9a00, 0x2198, 0x2000 }, + { 0x1a00, 0x2197, 0x0000 }, + { 0x1a00, 0x2199, 0x0000 }, + { 0x9a00, 0x219c, 0x2000 }, + { 0x1900, 0x219b, 0x0000 }, + { 0x1a00, 0x219d, 0x0000 }, + { 0x9900, 0x21a6, 0x4000 }, + { 0x9a00, 0x21a2, 0x3000 }, + { 0x9900, 0x21a0, 0x2000 }, + { 0x1a00, 0x219f, 0x0000 }, + { 0x1a00, 0x21a1, 0x0000 }, + { 0x9a00, 0x21a4, 0x2000 }, + { 0x1900, 0x21a3, 0x0000 }, + { 0x1a00, 0x21a5, 0x0000 }, + { 0x9a00, 0x21aa, 0x3000 }, + { 0x9a00, 0x21a8, 0x2000 }, + { 0x1a00, 0x21a7, 0x0000 }, + { 0x1a00, 0x21a9, 0x0000 }, + { 0x9a00, 0x21ac, 0x2000 }, + { 0x1a00, 0x21ab, 0x0000 }, + { 0x1a00, 0x21ad, 0x0000 }, + { 0x9900, 0x222e, 0x8000 }, + { 0x9a00, 0x21ee, 0x7000 }, + { 0x9900, 0x21ce, 0x6000 }, + { 0x9a00, 0x21be, 0x5000 }, + { 0x9a00, 0x21b6, 0x4000 }, + { 0x9a00, 0x21b2, 0x3000 }, + { 0x9a00, 0x21b0, 0x2000 }, + { 0x1a00, 0x21af, 0x0000 }, + { 0x1a00, 0x21b1, 0x0000 }, + { 0x9a00, 0x21b4, 0x2000 }, + { 0x1a00, 0x21b3, 0x0000 }, + { 0x1a00, 0x21b5, 0x0000 }, + { 0x9a00, 0x21ba, 0x3000 }, + { 0x9a00, 0x21b8, 0x2000 }, + { 0x1a00, 0x21b7, 0x0000 }, + { 0x1a00, 0x21b9, 0x0000 }, + { 0x9a00, 0x21bc, 0x2000 }, + { 0x1a00, 0x21bb, 0x0000 }, + { 0x1a00, 0x21bd, 0x0000 }, + { 0x9a00, 0x21c6, 0x4000 }, + { 0x9a00, 0x21c2, 0x3000 }, + { 0x9a00, 0x21c0, 0x2000 }, + { 0x1a00, 0x21bf, 0x0000 }, + { 0x1a00, 0x21c1, 0x0000 }, + { 0x9a00, 0x21c4, 0x2000 }, + { 0x1a00, 0x21c3, 0x0000 }, + { 0x1a00, 0x21c5, 0x0000 }, + { 0x9a00, 0x21ca, 0x3000 }, + { 0x9a00, 0x21c8, 0x2000 }, + { 0x1a00, 0x21c7, 0x0000 }, + { 0x1a00, 0x21c9, 0x0000 }, + { 0x9a00, 0x21cc, 0x2000 }, + { 0x1a00, 0x21cb, 0x0000 }, + { 0x1a00, 0x21cd, 0x0000 }, + { 0x9a00, 0x21de, 0x5000 }, + { 0x9a00, 0x21d6, 0x4000 }, + { 0x9900, 0x21d2, 0x3000 }, + { 0x9a00, 0x21d0, 0x2000 }, + { 0x1900, 0x21cf, 0x0000 }, + { 0x1a00, 0x21d1, 0x0000 }, + { 0x9900, 0x21d4, 0x2000 }, + { 0x1a00, 0x21d3, 0x0000 }, + { 0x1a00, 0x21d5, 0x0000 }, + { 0x9a00, 0x21da, 0x3000 }, + { 0x9a00, 0x21d8, 0x2000 }, + { 0x1a00, 0x21d7, 0x0000 }, + { 0x1a00, 0x21d9, 0x0000 }, + { 0x9a00, 0x21dc, 0x2000 }, + { 0x1a00, 0x21db, 0x0000 }, + { 0x1a00, 0x21dd, 0x0000 }, + { 0x9a00, 0x21e6, 0x4000 }, + { 0x9a00, 0x21e2, 0x3000 }, + { 0x9a00, 0x21e0, 0x2000 }, + { 0x1a00, 0x21df, 0x0000 }, + { 0x1a00, 0x21e1, 0x0000 }, + { 0x9a00, 0x21e4, 0x2000 }, + { 0x1a00, 0x21e3, 0x0000 }, + { 0x1a00, 0x21e5, 0x0000 }, + { 0x9a00, 0x21ea, 0x3000 }, + { 0x9a00, 0x21e8, 0x2000 }, + { 0x1a00, 0x21e7, 0x0000 }, + { 0x1a00, 0x21e9, 0x0000 }, + { 0x9a00, 0x21ec, 0x2000 }, + { 0x1a00, 0x21eb, 0x0000 }, + { 0x1a00, 0x21ed, 0x0000 }, + { 0x9900, 0x220e, 0x6000 }, + { 0x9900, 0x21fe, 0x5000 }, + { 0x9900, 0x21f6, 0x4000 }, + { 0x9a00, 0x21f2, 0x3000 }, + { 0x9a00, 0x21f0, 0x2000 }, + { 0x1a00, 0x21ef, 0x0000 }, + { 0x1a00, 0x21f1, 0x0000 }, + { 0x9900, 0x21f4, 0x2000 }, + { 0x1a00, 0x21f3, 0x0000 }, + { 0x1900, 0x21f5, 0x0000 }, + { 0x9900, 0x21fa, 0x3000 }, + { 0x9900, 0x21f8, 0x2000 }, + { 0x1900, 0x21f7, 0x0000 }, + { 0x1900, 0x21f9, 0x0000 }, + { 0x9900, 0x21fc, 0x2000 }, + { 0x1900, 0x21fb, 0x0000 }, + { 0x1900, 0x21fd, 0x0000 }, + { 0x9900, 0x2206, 0x4000 }, + { 0x9900, 0x2202, 0x3000 }, + { 0x9900, 0x2200, 0x2000 }, + { 0x1900, 0x21ff, 0x0000 }, + { 0x1900, 0x2201, 0x0000 }, + { 0x9900, 0x2204, 0x2000 }, + { 0x1900, 0x2203, 0x0000 }, + { 0x1900, 0x2205, 0x0000 }, + { 0x9900, 0x220a, 0x3000 }, + { 0x9900, 0x2208, 0x2000 }, + { 0x1900, 0x2207, 0x0000 }, + { 0x1900, 0x2209, 0x0000 }, + { 0x9900, 0x220c, 0x2000 }, + { 0x1900, 0x220b, 0x0000 }, + { 0x1900, 0x220d, 0x0000 }, + { 0x9900, 0x221e, 0x5000 }, + { 0x9900, 0x2216, 0x4000 }, + { 0x9900, 0x2212, 0x3000 }, + { 0x9900, 0x2210, 0x2000 }, + { 0x1900, 0x220f, 0x0000 }, + { 0x1900, 0x2211, 0x0000 }, + { 0x9900, 0x2214, 0x2000 }, + { 0x1900, 0x2213, 0x0000 }, + { 0x1900, 0x2215, 0x0000 }, + { 0x9900, 0x221a, 0x3000 }, + { 0x9900, 0x2218, 0x2000 }, + { 0x1900, 0x2217, 0x0000 }, + { 0x1900, 0x2219, 0x0000 }, + { 0x9900, 0x221c, 0x2000 }, + { 0x1900, 0x221b, 0x0000 }, + { 0x1900, 0x221d, 0x0000 }, + { 0x9900, 0x2226, 0x4000 }, + { 0x9900, 0x2222, 0x3000 }, + { 0x9900, 0x2220, 0x2000 }, + { 0x1900, 0x221f, 0x0000 }, + { 0x1900, 0x2221, 0x0000 }, + { 0x9900, 0x2224, 0x2000 }, + { 0x1900, 0x2223, 0x0000 }, + { 0x1900, 0x2225, 0x0000 }, + { 0x9900, 0x222a, 0x3000 }, + { 0x9900, 0x2228, 0x2000 }, + { 0x1900, 0x2227, 0x0000 }, + { 0x1900, 0x2229, 0x0000 }, + { 0x9900, 0x222c, 0x2000 }, + { 0x1900, 0x222b, 0x0000 }, + { 0x1900, 0x222d, 0x0000 }, + { 0x9900, 0x226e, 0x7000 }, + { 0x9900, 0x224e, 0x6000 }, + { 0x9900, 0x223e, 0x5000 }, + { 0x9900, 0x2236, 0x4000 }, + { 0x9900, 0x2232, 0x3000 }, + { 0x9900, 0x2230, 0x2000 }, + { 0x1900, 0x222f, 0x0000 }, + { 0x1900, 0x2231, 0x0000 }, + { 0x9900, 0x2234, 0x2000 }, + { 0x1900, 0x2233, 0x0000 }, + { 0x1900, 0x2235, 0x0000 }, + { 0x9900, 0x223a, 0x3000 }, + { 0x9900, 0x2238, 0x2000 }, + { 0x1900, 0x2237, 0x0000 }, + { 0x1900, 0x2239, 0x0000 }, + { 0x9900, 0x223c, 0x2000 }, + { 0x1900, 0x223b, 0x0000 }, + { 0x1900, 0x223d, 0x0000 }, + { 0x9900, 0x2246, 0x4000 }, + { 0x9900, 0x2242, 0x3000 }, + { 0x9900, 0x2240, 0x2000 }, + { 0x1900, 0x223f, 0x0000 }, + { 0x1900, 0x2241, 0x0000 }, + { 0x9900, 0x2244, 0x2000 }, + { 0x1900, 0x2243, 0x0000 }, + { 0x1900, 0x2245, 0x0000 }, + { 0x9900, 0x224a, 0x3000 }, + { 0x9900, 0x2248, 0x2000 }, + { 0x1900, 0x2247, 0x0000 }, + { 0x1900, 0x2249, 0x0000 }, + { 0x9900, 0x224c, 0x2000 }, + { 0x1900, 0x224b, 0x0000 }, + { 0x1900, 0x224d, 0x0000 }, + { 0x9900, 0x225e, 0x5000 }, + { 0x9900, 0x2256, 0x4000 }, + { 0x9900, 0x2252, 0x3000 }, + { 0x9900, 0x2250, 0x2000 }, + { 0x1900, 0x224f, 0x0000 }, + { 0x1900, 0x2251, 0x0000 }, + { 0x9900, 0x2254, 0x2000 }, + { 0x1900, 0x2253, 0x0000 }, + { 0x1900, 0x2255, 0x0000 }, + { 0x9900, 0x225a, 0x3000 }, + { 0x9900, 0x2258, 0x2000 }, + { 0x1900, 0x2257, 0x0000 }, + { 0x1900, 0x2259, 0x0000 }, + { 0x9900, 0x225c, 0x2000 }, + { 0x1900, 0x225b, 0x0000 }, + { 0x1900, 0x225d, 0x0000 }, + { 0x9900, 0x2266, 0x4000 }, + { 0x9900, 0x2262, 0x3000 }, + { 0x9900, 0x2260, 0x2000 }, + { 0x1900, 0x225f, 0x0000 }, + { 0x1900, 0x2261, 0x0000 }, + { 0x9900, 0x2264, 0x2000 }, + { 0x1900, 0x2263, 0x0000 }, + { 0x1900, 0x2265, 0x0000 }, + { 0x9900, 0x226a, 0x3000 }, + { 0x9900, 0x2268, 0x2000 }, + { 0x1900, 0x2267, 0x0000 }, + { 0x1900, 0x2269, 0x0000 }, + { 0x9900, 0x226c, 0x2000 }, + { 0x1900, 0x226b, 0x0000 }, + { 0x1900, 0x226d, 0x0000 }, + { 0x9900, 0x228e, 0x6000 }, + { 0x9900, 0x227e, 0x5000 }, + { 0x9900, 0x2276, 0x4000 }, + { 0x9900, 0x2272, 0x3000 }, + { 0x9900, 0x2270, 0x2000 }, + { 0x1900, 0x226f, 0x0000 }, + { 0x1900, 0x2271, 0x0000 }, + { 0x9900, 0x2274, 0x2000 }, + { 0x1900, 0x2273, 0x0000 }, + { 0x1900, 0x2275, 0x0000 }, + { 0x9900, 0x227a, 0x3000 }, + { 0x9900, 0x2278, 0x2000 }, + { 0x1900, 0x2277, 0x0000 }, + { 0x1900, 0x2279, 0x0000 }, + { 0x9900, 0x227c, 0x2000 }, + { 0x1900, 0x227b, 0x0000 }, + { 0x1900, 0x227d, 0x0000 }, + { 0x9900, 0x2286, 0x4000 }, + { 0x9900, 0x2282, 0x3000 }, + { 0x9900, 0x2280, 0x2000 }, + { 0x1900, 0x227f, 0x0000 }, + { 0x1900, 0x2281, 0x0000 }, + { 0x9900, 0x2284, 0x2000 }, + { 0x1900, 0x2283, 0x0000 }, + { 0x1900, 0x2285, 0x0000 }, + { 0x9900, 0x228a, 0x3000 }, + { 0x9900, 0x2288, 0x2000 }, + { 0x1900, 0x2287, 0x0000 }, + { 0x1900, 0x2289, 0x0000 }, + { 0x9900, 0x228c, 0x2000 }, + { 0x1900, 0x228b, 0x0000 }, + { 0x1900, 0x228d, 0x0000 }, + { 0x9900, 0x229e, 0x5000 }, + { 0x9900, 0x2296, 0x4000 }, + { 0x9900, 0x2292, 0x3000 }, + { 0x9900, 0x2290, 0x2000 }, + { 0x1900, 0x228f, 0x0000 }, + { 0x1900, 0x2291, 0x0000 }, + { 0x9900, 0x2294, 0x2000 }, + { 0x1900, 0x2293, 0x0000 }, + { 0x1900, 0x2295, 0x0000 }, + { 0x9900, 0x229a, 0x3000 }, + { 0x9900, 0x2298, 0x2000 }, + { 0x1900, 0x2297, 0x0000 }, + { 0x1900, 0x2299, 0x0000 }, + { 0x9900, 0x229c, 0x2000 }, + { 0x1900, 0x229b, 0x0000 }, + { 0x1900, 0x229d, 0x0000 }, + { 0x9900, 0x22a6, 0x4000 }, + { 0x9900, 0x22a2, 0x3000 }, + { 0x9900, 0x22a0, 0x2000 }, + { 0x1900, 0x229f, 0x0000 }, + { 0x1900, 0x22a1, 0x0000 }, + { 0x9900, 0x22a4, 0x2000 }, + { 0x1900, 0x22a3, 0x0000 }, + { 0x1900, 0x22a5, 0x0000 }, + { 0x9900, 0x22aa, 0x3000 }, + { 0x9900, 0x22a8, 0x2000 }, + { 0x1900, 0x22a7, 0x0000 }, + { 0x1900, 0x22a9, 0x0000 }, + { 0x9900, 0x22ac, 0x2000 }, + { 0x1900, 0x22ab, 0x0000 }, + { 0x1900, 0x22ad, 0x0000 }, + { 0x8f00, 0x2787, 0xb000 }, + { 0x9a00, 0x250b, 0xa000 }, + { 0x9900, 0x23ae, 0x9000 }, + { 0x9a00, 0x232e, 0x8000 }, + { 0x9900, 0x22ee, 0x7000 }, + { 0x9900, 0x22ce, 0x6000 }, + { 0x9900, 0x22be, 0x5000 }, + { 0x9900, 0x22b6, 0x4000 }, + { 0x9900, 0x22b2, 0x3000 }, + { 0x9900, 0x22b0, 0x2000 }, + { 0x1900, 0x22af, 0x0000 }, + { 0x1900, 0x22b1, 0x0000 }, + { 0x9900, 0x22b4, 0x2000 }, + { 0x1900, 0x22b3, 0x0000 }, + { 0x1900, 0x22b5, 0x0000 }, + { 0x9900, 0x22ba, 0x3000 }, + { 0x9900, 0x22b8, 0x2000 }, + { 0x1900, 0x22b7, 0x0000 }, + { 0x1900, 0x22b9, 0x0000 }, + { 0x9900, 0x22bc, 0x2000 }, + { 0x1900, 0x22bb, 0x0000 }, + { 0x1900, 0x22bd, 0x0000 }, + { 0x9900, 0x22c6, 0x4000 }, + { 0x9900, 0x22c2, 0x3000 }, + { 0x9900, 0x22c0, 0x2000 }, + { 0x1900, 0x22bf, 0x0000 }, + { 0x1900, 0x22c1, 0x0000 }, + { 0x9900, 0x22c4, 0x2000 }, + { 0x1900, 0x22c3, 0x0000 }, + { 0x1900, 0x22c5, 0x0000 }, + { 0x9900, 0x22ca, 0x3000 }, + { 0x9900, 0x22c8, 0x2000 }, + { 0x1900, 0x22c7, 0x0000 }, + { 0x1900, 0x22c9, 0x0000 }, + { 0x9900, 0x22cc, 0x2000 }, + { 0x1900, 0x22cb, 0x0000 }, + { 0x1900, 0x22cd, 0x0000 }, + { 0x9900, 0x22de, 0x5000 }, + { 0x9900, 0x22d6, 0x4000 }, + { 0x9900, 0x22d2, 0x3000 }, + { 0x9900, 0x22d0, 0x2000 }, + { 0x1900, 0x22cf, 0x0000 }, + { 0x1900, 0x22d1, 0x0000 }, + { 0x9900, 0x22d4, 0x2000 }, + { 0x1900, 0x22d3, 0x0000 }, + { 0x1900, 0x22d5, 0x0000 }, + { 0x9900, 0x22da, 0x3000 }, + { 0x9900, 0x22d8, 0x2000 }, + { 0x1900, 0x22d7, 0x0000 }, + { 0x1900, 0x22d9, 0x0000 }, + { 0x9900, 0x22dc, 0x2000 }, + { 0x1900, 0x22db, 0x0000 }, + { 0x1900, 0x22dd, 0x0000 }, + { 0x9900, 0x22e6, 0x4000 }, + { 0x9900, 0x22e2, 0x3000 }, + { 0x9900, 0x22e0, 0x2000 }, + { 0x1900, 0x22df, 0x0000 }, + { 0x1900, 0x22e1, 0x0000 }, + { 0x9900, 0x22e4, 0x2000 }, + { 0x1900, 0x22e3, 0x0000 }, + { 0x1900, 0x22e5, 0x0000 }, + { 0x9900, 0x22ea, 0x3000 }, + { 0x9900, 0x22e8, 0x2000 }, + { 0x1900, 0x22e7, 0x0000 }, + { 0x1900, 0x22e9, 0x0000 }, + { 0x9900, 0x22ec, 0x2000 }, + { 0x1900, 0x22eb, 0x0000 }, + { 0x1900, 0x22ed, 0x0000 }, + { 0x9a00, 0x230e, 0x6000 }, + { 0x9900, 0x22fe, 0x5000 }, + { 0x9900, 0x22f6, 0x4000 }, + { 0x9900, 0x22f2, 0x3000 }, + { 0x9900, 0x22f0, 0x2000 }, + { 0x1900, 0x22ef, 0x0000 }, + { 0x1900, 0x22f1, 0x0000 }, + { 0x9900, 0x22f4, 0x2000 }, + { 0x1900, 0x22f3, 0x0000 }, + { 0x1900, 0x22f5, 0x0000 }, + { 0x9900, 0x22fa, 0x3000 }, + { 0x9900, 0x22f8, 0x2000 }, + { 0x1900, 0x22f7, 0x0000 }, + { 0x1900, 0x22f9, 0x0000 }, + { 0x9900, 0x22fc, 0x2000 }, + { 0x1900, 0x22fb, 0x0000 }, + { 0x1900, 0x22fd, 0x0000 }, + { 0x9a00, 0x2306, 0x4000 }, + { 0x9a00, 0x2302, 0x3000 }, + { 0x9a00, 0x2300, 0x2000 }, + { 0x1900, 0x22ff, 0x0000 }, + { 0x1a00, 0x2301, 0x0000 }, + { 0x9a00, 0x2304, 0x2000 }, + { 0x1a00, 0x2303, 0x0000 }, + { 0x1a00, 0x2305, 0x0000 }, + { 0x9900, 0x230a, 0x3000 }, + { 0x9900, 0x2308, 0x2000 }, + { 0x1a00, 0x2307, 0x0000 }, + { 0x1900, 0x2309, 0x0000 }, + { 0x9a00, 0x230c, 0x2000 }, + { 0x1900, 0x230b, 0x0000 }, + { 0x1a00, 0x230d, 0x0000 }, + { 0x9a00, 0x231e, 0x5000 }, + { 0x9a00, 0x2316, 0x4000 }, + { 0x9a00, 0x2312, 0x3000 }, + { 0x9a00, 0x2310, 0x2000 }, + { 0x1a00, 0x230f, 0x0000 }, + { 0x1a00, 0x2311, 0x0000 }, + { 0x9a00, 0x2314, 0x2000 }, + { 0x1a00, 0x2313, 0x0000 }, + { 0x1a00, 0x2315, 0x0000 }, + { 0x9a00, 0x231a, 0x3000 }, + { 0x9a00, 0x2318, 0x2000 }, + { 0x1a00, 0x2317, 0x0000 }, + { 0x1a00, 0x2319, 0x0000 }, + { 0x9a00, 0x231c, 0x2000 }, + { 0x1a00, 0x231b, 0x0000 }, + { 0x1a00, 0x231d, 0x0000 }, + { 0x9a00, 0x2326, 0x4000 }, + { 0x9a00, 0x2322, 0x3000 }, + { 0x9900, 0x2320, 0x2000 }, + { 0x1a00, 0x231f, 0x0000 }, + { 0x1900, 0x2321, 0x0000 }, + { 0x9a00, 0x2324, 0x2000 }, + { 0x1a00, 0x2323, 0x0000 }, + { 0x1a00, 0x2325, 0x0000 }, + { 0x9200, 0x232a, 0x3000 }, + { 0x9a00, 0x2328, 0x2000 }, + { 0x1a00, 0x2327, 0x0000 }, + { 0x1600, 0x2329, 0x0000 }, + { 0x9a00, 0x232c, 0x2000 }, + { 0x1a00, 0x232b, 0x0000 }, + { 0x1a00, 0x232d, 0x0000 }, + { 0x9a00, 0x236e, 0x7000 }, + { 0x9a00, 0x234e, 0x6000 }, + { 0x9a00, 0x233e, 0x5000 }, + { 0x9a00, 0x2336, 0x4000 }, + { 0x9a00, 0x2332, 0x3000 }, + { 0x9a00, 0x2330, 0x2000 }, + { 0x1a00, 0x232f, 0x0000 }, + { 0x1a00, 0x2331, 0x0000 }, + { 0x9a00, 0x2334, 0x2000 }, + { 0x1a00, 0x2333, 0x0000 }, + { 0x1a00, 0x2335, 0x0000 }, + { 0x9a00, 0x233a, 0x3000 }, + { 0x9a00, 0x2338, 0x2000 }, + { 0x1a00, 0x2337, 0x0000 }, + { 0x1a00, 0x2339, 0x0000 }, + { 0x9a00, 0x233c, 0x2000 }, + { 0x1a00, 0x233b, 0x0000 }, + { 0x1a00, 0x233d, 0x0000 }, + { 0x9a00, 0x2346, 0x4000 }, + { 0x9a00, 0x2342, 0x3000 }, + { 0x9a00, 0x2340, 0x2000 }, + { 0x1a00, 0x233f, 0x0000 }, + { 0x1a00, 0x2341, 0x0000 }, + { 0x9a00, 0x2344, 0x2000 }, + { 0x1a00, 0x2343, 0x0000 }, + { 0x1a00, 0x2345, 0x0000 }, + { 0x9a00, 0x234a, 0x3000 }, + { 0x9a00, 0x2348, 0x2000 }, + { 0x1a00, 0x2347, 0x0000 }, + { 0x1a00, 0x2349, 0x0000 }, + { 0x9a00, 0x234c, 0x2000 }, + { 0x1a00, 0x234b, 0x0000 }, + { 0x1a00, 0x234d, 0x0000 }, + { 0x9a00, 0x235e, 0x5000 }, + { 0x9a00, 0x2356, 0x4000 }, + { 0x9a00, 0x2352, 0x3000 }, + { 0x9a00, 0x2350, 0x2000 }, + { 0x1a00, 0x234f, 0x0000 }, + { 0x1a00, 0x2351, 0x0000 }, + { 0x9a00, 0x2354, 0x2000 }, + { 0x1a00, 0x2353, 0x0000 }, + { 0x1a00, 0x2355, 0x0000 }, + { 0x9a00, 0x235a, 0x3000 }, + { 0x9a00, 0x2358, 0x2000 }, + { 0x1a00, 0x2357, 0x0000 }, + { 0x1a00, 0x2359, 0x0000 }, + { 0x9a00, 0x235c, 0x2000 }, + { 0x1a00, 0x235b, 0x0000 }, + { 0x1a00, 0x235d, 0x0000 }, + { 0x9a00, 0x2366, 0x4000 }, + { 0x9a00, 0x2362, 0x3000 }, + { 0x9a00, 0x2360, 0x2000 }, + { 0x1a00, 0x235f, 0x0000 }, + { 0x1a00, 0x2361, 0x0000 }, + { 0x9a00, 0x2364, 0x2000 }, + { 0x1a00, 0x2363, 0x0000 }, + { 0x1a00, 0x2365, 0x0000 }, + { 0x9a00, 0x236a, 0x3000 }, + { 0x9a00, 0x2368, 0x2000 }, + { 0x1a00, 0x2367, 0x0000 }, + { 0x1a00, 0x2369, 0x0000 }, + { 0x9a00, 0x236c, 0x2000 }, + { 0x1a00, 0x236b, 0x0000 }, + { 0x1a00, 0x236d, 0x0000 }, + { 0x9a00, 0x238e, 0x6000 }, + { 0x9a00, 0x237e, 0x5000 }, + { 0x9a00, 0x2376, 0x4000 }, + { 0x9a00, 0x2372, 0x3000 }, + { 0x9a00, 0x2370, 0x2000 }, + { 0x1a00, 0x236f, 0x0000 }, + { 0x1a00, 0x2371, 0x0000 }, + { 0x9a00, 0x2374, 0x2000 }, + { 0x1a00, 0x2373, 0x0000 }, + { 0x1a00, 0x2375, 0x0000 }, + { 0x9a00, 0x237a, 0x3000 }, + { 0x9a00, 0x2378, 0x2000 }, + { 0x1a00, 0x2377, 0x0000 }, + { 0x1a00, 0x2379, 0x0000 }, + { 0x9900, 0x237c, 0x2000 }, + { 0x1a00, 0x237b, 0x0000 }, + { 0x1a00, 0x237d, 0x0000 }, + { 0x9a00, 0x2386, 0x4000 }, + { 0x9a00, 0x2382, 0x3000 }, + { 0x9a00, 0x2380, 0x2000 }, + { 0x1a00, 0x237f, 0x0000 }, + { 0x1a00, 0x2381, 0x0000 }, + { 0x9a00, 0x2384, 0x2000 }, + { 0x1a00, 0x2383, 0x0000 }, + { 0x1a00, 0x2385, 0x0000 }, + { 0x9a00, 0x238a, 0x3000 }, + { 0x9a00, 0x2388, 0x2000 }, + { 0x1a00, 0x2387, 0x0000 }, + { 0x1a00, 0x2389, 0x0000 }, + { 0x9a00, 0x238c, 0x2000 }, + { 0x1a00, 0x238b, 0x0000 }, + { 0x1a00, 0x238d, 0x0000 }, + { 0x9900, 0x239e, 0x5000 }, + { 0x9a00, 0x2396, 0x4000 }, + { 0x9a00, 0x2392, 0x3000 }, + { 0x9a00, 0x2390, 0x2000 }, + { 0x1a00, 0x238f, 0x0000 }, + { 0x1a00, 0x2391, 0x0000 }, + { 0x9a00, 0x2394, 0x2000 }, + { 0x1a00, 0x2393, 0x0000 }, + { 0x1a00, 0x2395, 0x0000 }, + { 0x9a00, 0x239a, 0x3000 }, + { 0x9a00, 0x2398, 0x2000 }, + { 0x1a00, 0x2397, 0x0000 }, + { 0x1a00, 0x2399, 0x0000 }, + { 0x9900, 0x239c, 0x2000 }, + { 0x1900, 0x239b, 0x0000 }, + { 0x1900, 0x239d, 0x0000 }, + { 0x9900, 0x23a6, 0x4000 }, + { 0x9900, 0x23a2, 0x3000 }, + { 0x9900, 0x23a0, 0x2000 }, + { 0x1900, 0x239f, 0x0000 }, + { 0x1900, 0x23a1, 0x0000 }, + { 0x9900, 0x23a4, 0x2000 }, + { 0x1900, 0x23a3, 0x0000 }, + { 0x1900, 0x23a5, 0x0000 }, + { 0x9900, 0x23aa, 0x3000 }, + { 0x9900, 0x23a8, 0x2000 }, + { 0x1900, 0x23a7, 0x0000 }, + { 0x1900, 0x23a9, 0x0000 }, + { 0x9900, 0x23ac, 0x2000 }, + { 0x1900, 0x23ab, 0x0000 }, + { 0x1900, 0x23ad, 0x0000 }, + { 0x8f00, 0x248b, 0x8000 }, + { 0x9a00, 0x241d, 0x7000 }, + { 0x9a00, 0x23ce, 0x6000 }, + { 0x9a00, 0x23be, 0x5000 }, + { 0x9500, 0x23b6, 0x4000 }, + { 0x9900, 0x23b2, 0x3000 }, + { 0x9900, 0x23b0, 0x2000 }, + { 0x1900, 0x23af, 0x0000 }, + { 0x1900, 0x23b1, 0x0000 }, + { 0x9600, 0x23b4, 0x2000 }, + { 0x1900, 0x23b3, 0x0000 }, + { 0x1200, 0x23b5, 0x0000 }, + { 0x9a00, 0x23ba, 0x3000 }, + { 0x9a00, 0x23b8, 0x2000 }, + { 0x1a00, 0x23b7, 0x0000 }, + { 0x1a00, 0x23b9, 0x0000 }, + { 0x9a00, 0x23bc, 0x2000 }, + { 0x1a00, 0x23bb, 0x0000 }, + { 0x1a00, 0x23bd, 0x0000 }, + { 0x9a00, 0x23c6, 0x4000 }, + { 0x9a00, 0x23c2, 0x3000 }, + { 0x9a00, 0x23c0, 0x2000 }, + { 0x1a00, 0x23bf, 0x0000 }, + { 0x1a00, 0x23c1, 0x0000 }, + { 0x9a00, 0x23c4, 0x2000 }, + { 0x1a00, 0x23c3, 0x0000 }, + { 0x1a00, 0x23c5, 0x0000 }, + { 0x9a00, 0x23ca, 0x3000 }, + { 0x9a00, 0x23c8, 0x2000 }, + { 0x1a00, 0x23c7, 0x0000 }, + { 0x1a00, 0x23c9, 0x0000 }, + { 0x9a00, 0x23cc, 0x2000 }, + { 0x1a00, 0x23cb, 0x0000 }, + { 0x1a00, 0x23cd, 0x0000 }, + { 0x9a00, 0x240d, 0x5000 }, + { 0x9a00, 0x2405, 0x4000 }, + { 0x9a00, 0x2401, 0x3000 }, + { 0x9a00, 0x23d0, 0x2000 }, + { 0x1a00, 0x23cf, 0x0000 }, + { 0x1a00, 0x2400, 0x0000 }, + { 0x9a00, 0x2403, 0x2000 }, + { 0x1a00, 0x2402, 0x0000 }, + { 0x1a00, 0x2404, 0x0000 }, + { 0x9a00, 0x2409, 0x3000 }, + { 0x9a00, 0x2407, 0x2000 }, + { 0x1a00, 0x2406, 0x0000 }, + { 0x1a00, 0x2408, 0x0000 }, + { 0x9a00, 0x240b, 0x2000 }, + { 0x1a00, 0x240a, 0x0000 }, + { 0x1a00, 0x240c, 0x0000 }, + { 0x9a00, 0x2415, 0x4000 }, + { 0x9a00, 0x2411, 0x3000 }, + { 0x9a00, 0x240f, 0x2000 }, + { 0x1a00, 0x240e, 0x0000 }, + { 0x1a00, 0x2410, 0x0000 }, + { 0x9a00, 0x2413, 0x2000 }, + { 0x1a00, 0x2412, 0x0000 }, + { 0x1a00, 0x2414, 0x0000 }, + { 0x9a00, 0x2419, 0x3000 }, + { 0x9a00, 0x2417, 0x2000 }, + { 0x1a00, 0x2416, 0x0000 }, + { 0x1a00, 0x2418, 0x0000 }, + { 0x9a00, 0x241b, 0x2000 }, + { 0x1a00, 0x241a, 0x0000 }, + { 0x1a00, 0x241c, 0x0000 }, + { 0x8f00, 0x246b, 0x6000 }, + { 0x9a00, 0x2446, 0x5000 }, + { 0x9a00, 0x2425, 0x4000 }, + { 0x9a00, 0x2421, 0x3000 }, + { 0x9a00, 0x241f, 0x2000 }, + { 0x1a00, 0x241e, 0x0000 }, + { 0x1a00, 0x2420, 0x0000 }, + { 0x9a00, 0x2423, 0x2000 }, + { 0x1a00, 0x2422, 0x0000 }, + { 0x1a00, 0x2424, 0x0000 }, + { 0x9a00, 0x2442, 0x3000 }, + { 0x9a00, 0x2440, 0x2000 }, + { 0x1a00, 0x2426, 0x0000 }, + { 0x1a00, 0x2441, 0x0000 }, + { 0x9a00, 0x2444, 0x2000 }, + { 0x1a00, 0x2443, 0x0000 }, + { 0x1a00, 0x2445, 0x0000 }, + { 0x8f00, 0x2463, 0x4000 }, + { 0x9a00, 0x244a, 0x3000 }, + { 0x9a00, 0x2448, 0x2000 }, + { 0x1a00, 0x2447, 0x0000 }, + { 0x1a00, 0x2449, 0x0000 }, + { 0x8f00, 0x2461, 0x2000 }, + { 0x0f00, 0x2460, 0x0000 }, + { 0x0f00, 0x2462, 0x0000 }, + { 0x8f00, 0x2467, 0x3000 }, + { 0x8f00, 0x2465, 0x2000 }, + { 0x0f00, 0x2464, 0x0000 }, + { 0x0f00, 0x2466, 0x0000 }, + { 0x8f00, 0x2469, 0x2000 }, + { 0x0f00, 0x2468, 0x0000 }, + { 0x0f00, 0x246a, 0x0000 }, + { 0x8f00, 0x247b, 0x5000 }, + { 0x8f00, 0x2473, 0x4000 }, + { 0x8f00, 0x246f, 0x3000 }, + { 0x8f00, 0x246d, 0x2000 }, + { 0x0f00, 0x246c, 0x0000 }, + { 0x0f00, 0x246e, 0x0000 }, + { 0x8f00, 0x2471, 0x2000 }, + { 0x0f00, 0x2470, 0x0000 }, + { 0x0f00, 0x2472, 0x0000 }, + { 0x8f00, 0x2477, 0x3000 }, + { 0x8f00, 0x2475, 0x2000 }, + { 0x0f00, 0x2474, 0x0000 }, + { 0x0f00, 0x2476, 0x0000 }, + { 0x8f00, 0x2479, 0x2000 }, + { 0x0f00, 0x2478, 0x0000 }, + { 0x0f00, 0x247a, 0x0000 }, + { 0x8f00, 0x2483, 0x4000 }, + { 0x8f00, 0x247f, 0x3000 }, + { 0x8f00, 0x247d, 0x2000 }, + { 0x0f00, 0x247c, 0x0000 }, + { 0x0f00, 0x247e, 0x0000 }, + { 0x8f00, 0x2481, 0x2000 }, + { 0x0f00, 0x2480, 0x0000 }, + { 0x0f00, 0x2482, 0x0000 }, + { 0x8f00, 0x2487, 0x3000 }, + { 0x8f00, 0x2485, 0x2000 }, + { 0x0f00, 0x2484, 0x0000 }, + { 0x0f00, 0x2486, 0x0000 }, + { 0x8f00, 0x2489, 0x2000 }, + { 0x0f00, 0x2488, 0x0000 }, + { 0x0f00, 0x248a, 0x0000 }, + { 0x9a00, 0x24cb, 0x7000 }, + { 0x9a00, 0x24ab, 0x6000 }, + { 0x8f00, 0x249b, 0x5000 }, + { 0x8f00, 0x2493, 0x4000 }, + { 0x8f00, 0x248f, 0x3000 }, + { 0x8f00, 0x248d, 0x2000 }, + { 0x0f00, 0x248c, 0x0000 }, + { 0x0f00, 0x248e, 0x0000 }, + { 0x8f00, 0x2491, 0x2000 }, + { 0x0f00, 0x2490, 0x0000 }, + { 0x0f00, 0x2492, 0x0000 }, + { 0x8f00, 0x2497, 0x3000 }, + { 0x8f00, 0x2495, 0x2000 }, + { 0x0f00, 0x2494, 0x0000 }, + { 0x0f00, 0x2496, 0x0000 }, + { 0x8f00, 0x2499, 0x2000 }, + { 0x0f00, 0x2498, 0x0000 }, + { 0x0f00, 0x249a, 0x0000 }, + { 0x9a00, 0x24a3, 0x4000 }, + { 0x9a00, 0x249f, 0x3000 }, + { 0x9a00, 0x249d, 0x2000 }, + { 0x1a00, 0x249c, 0x0000 }, + { 0x1a00, 0x249e, 0x0000 }, + { 0x9a00, 0x24a1, 0x2000 }, + { 0x1a00, 0x24a0, 0x0000 }, + { 0x1a00, 0x24a2, 0x0000 }, + { 0x9a00, 0x24a7, 0x3000 }, + { 0x9a00, 0x24a5, 0x2000 }, + { 0x1a00, 0x24a4, 0x0000 }, + { 0x1a00, 0x24a6, 0x0000 }, + { 0x9a00, 0x24a9, 0x2000 }, + { 0x1a00, 0x24a8, 0x0000 }, + { 0x1a00, 0x24aa, 0x0000 }, + { 0x9a00, 0x24bb, 0x5000 }, + { 0x9a00, 0x24b3, 0x4000 }, + { 0x9a00, 0x24af, 0x3000 }, + { 0x9a00, 0x24ad, 0x2000 }, + { 0x1a00, 0x24ac, 0x0000 }, + { 0x1a00, 0x24ae, 0x0000 }, + { 0x9a00, 0x24b1, 0x2000 }, + { 0x1a00, 0x24b0, 0x0000 }, + { 0x1a00, 0x24b2, 0x0000 }, + { 0x9a00, 0x24b7, 0x3000 }, + { 0x9a00, 0x24b5, 0x2000 }, + { 0x1a00, 0x24b4, 0x0000 }, + { 0x1a00, 0x24b6, 0x0000 }, + { 0x9a00, 0x24b9, 0x2000 }, + { 0x1a00, 0x24b8, 0x0000 }, + { 0x1a00, 0x24ba, 0x0000 }, + { 0x9a00, 0x24c3, 0x4000 }, + { 0x9a00, 0x24bf, 0x3000 }, + { 0x9a00, 0x24bd, 0x2000 }, + { 0x1a00, 0x24bc, 0x0000 }, + { 0x1a00, 0x24be, 0x0000 }, + { 0x9a00, 0x24c1, 0x2000 }, + { 0x1a00, 0x24c0, 0x0000 }, + { 0x1a00, 0x24c2, 0x0000 }, + { 0x9a00, 0x24c7, 0x3000 }, + { 0x9a00, 0x24c5, 0x2000 }, + { 0x1a00, 0x24c4, 0x0000 }, + { 0x1a00, 0x24c6, 0x0000 }, + { 0x9a00, 0x24c9, 0x2000 }, + { 0x1a00, 0x24c8, 0x0000 }, + { 0x1a00, 0x24ca, 0x0000 }, + { 0x8f00, 0x24eb, 0x6000 }, + { 0x9a00, 0x24db, 0x5000 }, + { 0x9a00, 0x24d3, 0x4000 }, + { 0x9a00, 0x24cf, 0x3000 }, + { 0x9a00, 0x24cd, 0x2000 }, + { 0x1a00, 0x24cc, 0x0000 }, + { 0x1a00, 0x24ce, 0x0000 }, + { 0x9a00, 0x24d1, 0x2000 }, + { 0x1a00, 0x24d0, 0x0000 }, + { 0x1a00, 0x24d2, 0x0000 }, + { 0x9a00, 0x24d7, 0x3000 }, + { 0x9a00, 0x24d5, 0x2000 }, + { 0x1a00, 0x24d4, 0x0000 }, + { 0x1a00, 0x24d6, 0x0000 }, + { 0x9a00, 0x24d9, 0x2000 }, + { 0x1a00, 0x24d8, 0x0000 }, + { 0x1a00, 0x24da, 0x0000 }, + { 0x9a00, 0x24e3, 0x4000 }, + { 0x9a00, 0x24df, 0x3000 }, + { 0x9a00, 0x24dd, 0x2000 }, + { 0x1a00, 0x24dc, 0x0000 }, + { 0x1a00, 0x24de, 0x0000 }, + { 0x9a00, 0x24e1, 0x2000 }, + { 0x1a00, 0x24e0, 0x0000 }, + { 0x1a00, 0x24e2, 0x0000 }, + { 0x9a00, 0x24e7, 0x3000 }, + { 0x9a00, 0x24e5, 0x2000 }, + { 0x1a00, 0x24e4, 0x0000 }, + { 0x1a00, 0x24e6, 0x0000 }, + { 0x9a00, 0x24e9, 0x2000 }, + { 0x1a00, 0x24e8, 0x0000 }, + { 0x0f00, 0x24ea, 0x0000 }, + { 0x8f00, 0x24fb, 0x5000 }, + { 0x8f00, 0x24f3, 0x4000 }, + { 0x8f00, 0x24ef, 0x3000 }, + { 0x8f00, 0x24ed, 0x2000 }, + { 0x0f00, 0x24ec, 0x0000 }, + { 0x0f00, 0x24ee, 0x0000 }, + { 0x8f00, 0x24f1, 0x2000 }, + { 0x0f00, 0x24f0, 0x0000 }, + { 0x0f00, 0x24f2, 0x0000 }, + { 0x8f00, 0x24f7, 0x3000 }, + { 0x8f00, 0x24f5, 0x2000 }, + { 0x0f00, 0x24f4, 0x0000 }, + { 0x0f00, 0x24f6, 0x0000 }, + { 0x8f00, 0x24f9, 0x2000 }, + { 0x0f00, 0x24f8, 0x0000 }, + { 0x0f00, 0x24fa, 0x0000 }, + { 0x9a00, 0x2503, 0x4000 }, + { 0x8f00, 0x24ff, 0x3000 }, + { 0x8f00, 0x24fd, 0x2000 }, + { 0x0f00, 0x24fc, 0x0000 }, + { 0x0f00, 0x24fe, 0x0000 }, + { 0x9a00, 0x2501, 0x2000 }, + { 0x1a00, 0x2500, 0x0000 }, + { 0x1a00, 0x2502, 0x0000 }, + { 0x9a00, 0x2507, 0x3000 }, + { 0x9a00, 0x2505, 0x2000 }, + { 0x1a00, 0x2504, 0x0000 }, + { 0x1a00, 0x2506, 0x0000 }, + { 0x9a00, 0x2509, 0x2000 }, + { 0x1a00, 0x2508, 0x0000 }, + { 0x1a00, 0x250a, 0x0000 }, + { 0x9a00, 0x260b, 0x9000 }, + { 0x9a00, 0x258b, 0x8000 }, + { 0x9a00, 0x254b, 0x7000 }, + { 0x9a00, 0x252b, 0x6000 }, + { 0x9a00, 0x251b, 0x5000 }, + { 0x9a00, 0x2513, 0x4000 }, + { 0x9a00, 0x250f, 0x3000 }, + { 0x9a00, 0x250d, 0x2000 }, + { 0x1a00, 0x250c, 0x0000 }, + { 0x1a00, 0x250e, 0x0000 }, + { 0x9a00, 0x2511, 0x2000 }, + { 0x1a00, 0x2510, 0x0000 }, + { 0x1a00, 0x2512, 0x0000 }, + { 0x9a00, 0x2517, 0x3000 }, + { 0x9a00, 0x2515, 0x2000 }, + { 0x1a00, 0x2514, 0x0000 }, + { 0x1a00, 0x2516, 0x0000 }, + { 0x9a00, 0x2519, 0x2000 }, + { 0x1a00, 0x2518, 0x0000 }, + { 0x1a00, 0x251a, 0x0000 }, + { 0x9a00, 0x2523, 0x4000 }, + { 0x9a00, 0x251f, 0x3000 }, + { 0x9a00, 0x251d, 0x2000 }, + { 0x1a00, 0x251c, 0x0000 }, + { 0x1a00, 0x251e, 0x0000 }, + { 0x9a00, 0x2521, 0x2000 }, + { 0x1a00, 0x2520, 0x0000 }, + { 0x1a00, 0x2522, 0x0000 }, + { 0x9a00, 0x2527, 0x3000 }, + { 0x9a00, 0x2525, 0x2000 }, + { 0x1a00, 0x2524, 0x0000 }, + { 0x1a00, 0x2526, 0x0000 }, + { 0x9a00, 0x2529, 0x2000 }, + { 0x1a00, 0x2528, 0x0000 }, + { 0x1a00, 0x252a, 0x0000 }, + { 0x9a00, 0x253b, 0x5000 }, + { 0x9a00, 0x2533, 0x4000 }, + { 0x9a00, 0x252f, 0x3000 }, + { 0x9a00, 0x252d, 0x2000 }, + { 0x1a00, 0x252c, 0x0000 }, + { 0x1a00, 0x252e, 0x0000 }, + { 0x9a00, 0x2531, 0x2000 }, + { 0x1a00, 0x2530, 0x0000 }, + { 0x1a00, 0x2532, 0x0000 }, + { 0x9a00, 0x2537, 0x3000 }, + { 0x9a00, 0x2535, 0x2000 }, + { 0x1a00, 0x2534, 0x0000 }, + { 0x1a00, 0x2536, 0x0000 }, + { 0x9a00, 0x2539, 0x2000 }, + { 0x1a00, 0x2538, 0x0000 }, + { 0x1a00, 0x253a, 0x0000 }, + { 0x9a00, 0x2543, 0x4000 }, + { 0x9a00, 0x253f, 0x3000 }, + { 0x9a00, 0x253d, 0x2000 }, + { 0x1a00, 0x253c, 0x0000 }, + { 0x1a00, 0x253e, 0x0000 }, + { 0x9a00, 0x2541, 0x2000 }, + { 0x1a00, 0x2540, 0x0000 }, + { 0x1a00, 0x2542, 0x0000 }, + { 0x9a00, 0x2547, 0x3000 }, + { 0x9a00, 0x2545, 0x2000 }, + { 0x1a00, 0x2544, 0x0000 }, + { 0x1a00, 0x2546, 0x0000 }, + { 0x9a00, 0x2549, 0x2000 }, + { 0x1a00, 0x2548, 0x0000 }, + { 0x1a00, 0x254a, 0x0000 }, + { 0x9a00, 0x256b, 0x6000 }, + { 0x9a00, 0x255b, 0x5000 }, + { 0x9a00, 0x2553, 0x4000 }, + { 0x9a00, 0x254f, 0x3000 }, + { 0x9a00, 0x254d, 0x2000 }, + { 0x1a00, 0x254c, 0x0000 }, + { 0x1a00, 0x254e, 0x0000 }, + { 0x9a00, 0x2551, 0x2000 }, + { 0x1a00, 0x2550, 0x0000 }, + { 0x1a00, 0x2552, 0x0000 }, + { 0x9a00, 0x2557, 0x3000 }, + { 0x9a00, 0x2555, 0x2000 }, + { 0x1a00, 0x2554, 0x0000 }, + { 0x1a00, 0x2556, 0x0000 }, + { 0x9a00, 0x2559, 0x2000 }, + { 0x1a00, 0x2558, 0x0000 }, + { 0x1a00, 0x255a, 0x0000 }, + { 0x9a00, 0x2563, 0x4000 }, + { 0x9a00, 0x255f, 0x3000 }, + { 0x9a00, 0x255d, 0x2000 }, + { 0x1a00, 0x255c, 0x0000 }, + { 0x1a00, 0x255e, 0x0000 }, + { 0x9a00, 0x2561, 0x2000 }, + { 0x1a00, 0x2560, 0x0000 }, + { 0x1a00, 0x2562, 0x0000 }, + { 0x9a00, 0x2567, 0x3000 }, + { 0x9a00, 0x2565, 0x2000 }, + { 0x1a00, 0x2564, 0x0000 }, + { 0x1a00, 0x2566, 0x0000 }, + { 0x9a00, 0x2569, 0x2000 }, + { 0x1a00, 0x2568, 0x0000 }, + { 0x1a00, 0x256a, 0x0000 }, + { 0x9a00, 0x257b, 0x5000 }, + { 0x9a00, 0x2573, 0x4000 }, + { 0x9a00, 0x256f, 0x3000 }, + { 0x9a00, 0x256d, 0x2000 }, + { 0x1a00, 0x256c, 0x0000 }, + { 0x1a00, 0x256e, 0x0000 }, + { 0x9a00, 0x2571, 0x2000 }, + { 0x1a00, 0x2570, 0x0000 }, + { 0x1a00, 0x2572, 0x0000 }, + { 0x9a00, 0x2577, 0x3000 }, + { 0x9a00, 0x2575, 0x2000 }, + { 0x1a00, 0x2574, 0x0000 }, + { 0x1a00, 0x2576, 0x0000 }, + { 0x9a00, 0x2579, 0x2000 }, + { 0x1a00, 0x2578, 0x0000 }, + { 0x1a00, 0x257a, 0x0000 }, + { 0x9a00, 0x2583, 0x4000 }, + { 0x9a00, 0x257f, 0x3000 }, + { 0x9a00, 0x257d, 0x2000 }, + { 0x1a00, 0x257c, 0x0000 }, + { 0x1a00, 0x257e, 0x0000 }, + { 0x9a00, 0x2581, 0x2000 }, + { 0x1a00, 0x2580, 0x0000 }, + { 0x1a00, 0x2582, 0x0000 }, + { 0x9a00, 0x2587, 0x3000 }, + { 0x9a00, 0x2585, 0x2000 }, + { 0x1a00, 0x2584, 0x0000 }, + { 0x1a00, 0x2586, 0x0000 }, + { 0x9a00, 0x2589, 0x2000 }, + { 0x1a00, 0x2588, 0x0000 }, + { 0x1a00, 0x258a, 0x0000 }, + { 0x9a00, 0x25cb, 0x7000 }, + { 0x9a00, 0x25ab, 0x6000 }, + { 0x9a00, 0x259b, 0x5000 }, + { 0x9a00, 0x2593, 0x4000 }, + { 0x9a00, 0x258f, 0x3000 }, + { 0x9a00, 0x258d, 0x2000 }, + { 0x1a00, 0x258c, 0x0000 }, + { 0x1a00, 0x258e, 0x0000 }, + { 0x9a00, 0x2591, 0x2000 }, + { 0x1a00, 0x2590, 0x0000 }, + { 0x1a00, 0x2592, 0x0000 }, + { 0x9a00, 0x2597, 0x3000 }, + { 0x9a00, 0x2595, 0x2000 }, + { 0x1a00, 0x2594, 0x0000 }, + { 0x1a00, 0x2596, 0x0000 }, + { 0x9a00, 0x2599, 0x2000 }, + { 0x1a00, 0x2598, 0x0000 }, + { 0x1a00, 0x259a, 0x0000 }, + { 0x9a00, 0x25a3, 0x4000 }, + { 0x9a00, 0x259f, 0x3000 }, + { 0x9a00, 0x259d, 0x2000 }, + { 0x1a00, 0x259c, 0x0000 }, + { 0x1a00, 0x259e, 0x0000 }, + { 0x9a00, 0x25a1, 0x2000 }, + { 0x1a00, 0x25a0, 0x0000 }, + { 0x1a00, 0x25a2, 0x0000 }, + { 0x9a00, 0x25a7, 0x3000 }, + { 0x9a00, 0x25a5, 0x2000 }, + { 0x1a00, 0x25a4, 0x0000 }, + { 0x1a00, 0x25a6, 0x0000 }, + { 0x9a00, 0x25a9, 0x2000 }, + { 0x1a00, 0x25a8, 0x0000 }, + { 0x1a00, 0x25aa, 0x0000 }, + { 0x9a00, 0x25bb, 0x5000 }, + { 0x9a00, 0x25b3, 0x4000 }, + { 0x9a00, 0x25af, 0x3000 }, + { 0x9a00, 0x25ad, 0x2000 }, + { 0x1a00, 0x25ac, 0x0000 }, + { 0x1a00, 0x25ae, 0x0000 }, + { 0x9a00, 0x25b1, 0x2000 }, + { 0x1a00, 0x25b0, 0x0000 }, + { 0x1a00, 0x25b2, 0x0000 }, + { 0x9900, 0x25b7, 0x3000 }, + { 0x9a00, 0x25b5, 0x2000 }, + { 0x1a00, 0x25b4, 0x0000 }, + { 0x1a00, 0x25b6, 0x0000 }, + { 0x9a00, 0x25b9, 0x2000 }, + { 0x1a00, 0x25b8, 0x0000 }, + { 0x1a00, 0x25ba, 0x0000 }, + { 0x9a00, 0x25c3, 0x4000 }, + { 0x9a00, 0x25bf, 0x3000 }, + { 0x9a00, 0x25bd, 0x2000 }, + { 0x1a00, 0x25bc, 0x0000 }, + { 0x1a00, 0x25be, 0x0000 }, + { 0x9900, 0x25c1, 0x2000 }, + { 0x1a00, 0x25c0, 0x0000 }, + { 0x1a00, 0x25c2, 0x0000 }, + { 0x9a00, 0x25c7, 0x3000 }, + { 0x9a00, 0x25c5, 0x2000 }, + { 0x1a00, 0x25c4, 0x0000 }, + { 0x1a00, 0x25c6, 0x0000 }, + { 0x9a00, 0x25c9, 0x2000 }, + { 0x1a00, 0x25c8, 0x0000 }, + { 0x1a00, 0x25ca, 0x0000 }, + { 0x9a00, 0x25eb, 0x6000 }, + { 0x9a00, 0x25db, 0x5000 }, + { 0x9a00, 0x25d3, 0x4000 }, + { 0x9a00, 0x25cf, 0x3000 }, + { 0x9a00, 0x25cd, 0x2000 }, + { 0x1a00, 0x25cc, 0x0000 }, + { 0x1a00, 0x25ce, 0x0000 }, + { 0x9a00, 0x25d1, 0x2000 }, + { 0x1a00, 0x25d0, 0x0000 }, + { 0x1a00, 0x25d2, 0x0000 }, + { 0x9a00, 0x25d7, 0x3000 }, + { 0x9a00, 0x25d5, 0x2000 }, + { 0x1a00, 0x25d4, 0x0000 }, + { 0x1a00, 0x25d6, 0x0000 }, + { 0x9a00, 0x25d9, 0x2000 }, + { 0x1a00, 0x25d8, 0x0000 }, + { 0x1a00, 0x25da, 0x0000 }, + { 0x9a00, 0x25e3, 0x4000 }, + { 0x9a00, 0x25df, 0x3000 }, + { 0x9a00, 0x25dd, 0x2000 }, + { 0x1a00, 0x25dc, 0x0000 }, + { 0x1a00, 0x25de, 0x0000 }, + { 0x9a00, 0x25e1, 0x2000 }, + { 0x1a00, 0x25e0, 0x0000 }, + { 0x1a00, 0x25e2, 0x0000 }, + { 0x9a00, 0x25e7, 0x3000 }, + { 0x9a00, 0x25e5, 0x2000 }, + { 0x1a00, 0x25e4, 0x0000 }, + { 0x1a00, 0x25e6, 0x0000 }, + { 0x9a00, 0x25e9, 0x2000 }, + { 0x1a00, 0x25e8, 0x0000 }, + { 0x1a00, 0x25ea, 0x0000 }, + { 0x9900, 0x25fb, 0x5000 }, + { 0x9a00, 0x25f3, 0x4000 }, + { 0x9a00, 0x25ef, 0x3000 }, + { 0x9a00, 0x25ed, 0x2000 }, + { 0x1a00, 0x25ec, 0x0000 }, + { 0x1a00, 0x25ee, 0x0000 }, + { 0x9a00, 0x25f1, 0x2000 }, + { 0x1a00, 0x25f0, 0x0000 }, + { 0x1a00, 0x25f2, 0x0000 }, + { 0x9a00, 0x25f7, 0x3000 }, + { 0x9a00, 0x25f5, 0x2000 }, + { 0x1a00, 0x25f4, 0x0000 }, + { 0x1a00, 0x25f6, 0x0000 }, + { 0x9900, 0x25f9, 0x2000 }, + { 0x1900, 0x25f8, 0x0000 }, + { 0x1900, 0x25fa, 0x0000 }, + { 0x9a00, 0x2603, 0x4000 }, + { 0x9900, 0x25ff, 0x3000 }, + { 0x9900, 0x25fd, 0x2000 }, + { 0x1900, 0x25fc, 0x0000 }, + { 0x1900, 0x25fe, 0x0000 }, + { 0x9a00, 0x2601, 0x2000 }, + { 0x1a00, 0x2600, 0x0000 }, + { 0x1a00, 0x2602, 0x0000 }, + { 0x9a00, 0x2607, 0x3000 }, + { 0x9a00, 0x2605, 0x2000 }, + { 0x1a00, 0x2604, 0x0000 }, + { 0x1a00, 0x2606, 0x0000 }, + { 0x9a00, 0x2609, 0x2000 }, + { 0x1a00, 0x2608, 0x0000 }, + { 0x1a00, 0x260a, 0x0000 }, + { 0x9a00, 0x268e, 0x8000 }, + { 0x9a00, 0x264c, 0x7000 }, + { 0x9a00, 0x262c, 0x6000 }, + { 0x9a00, 0x261c, 0x5000 }, + { 0x9a00, 0x2613, 0x4000 }, + { 0x9a00, 0x260f, 0x3000 }, + { 0x9a00, 0x260d, 0x2000 }, + { 0x1a00, 0x260c, 0x0000 }, + { 0x1a00, 0x260e, 0x0000 }, + { 0x9a00, 0x2611, 0x2000 }, + { 0x1a00, 0x2610, 0x0000 }, + { 0x1a00, 0x2612, 0x0000 }, + { 0x9a00, 0x2617, 0x3000 }, + { 0x9a00, 0x2615, 0x2000 }, + { 0x1a00, 0x2614, 0x0000 }, + { 0x1a00, 0x2616, 0x0000 }, + { 0x9a00, 0x261a, 0x2000 }, + { 0x1a00, 0x2619, 0x0000 }, + { 0x1a00, 0x261b, 0x0000 }, + { 0x9a00, 0x2624, 0x4000 }, + { 0x9a00, 0x2620, 0x3000 }, + { 0x9a00, 0x261e, 0x2000 }, + { 0x1a00, 0x261d, 0x0000 }, + { 0x1a00, 0x261f, 0x0000 }, + { 0x9a00, 0x2622, 0x2000 }, + { 0x1a00, 0x2621, 0x0000 }, + { 0x1a00, 0x2623, 0x0000 }, + { 0x9a00, 0x2628, 0x3000 }, + { 0x9a00, 0x2626, 0x2000 }, + { 0x1a00, 0x2625, 0x0000 }, + { 0x1a00, 0x2627, 0x0000 }, + { 0x9a00, 0x262a, 0x2000 }, + { 0x1a00, 0x2629, 0x0000 }, + { 0x1a00, 0x262b, 0x0000 }, + { 0x9a00, 0x263c, 0x5000 }, + { 0x9a00, 0x2634, 0x4000 }, + { 0x9a00, 0x2630, 0x3000 }, + { 0x9a00, 0x262e, 0x2000 }, + { 0x1a00, 0x262d, 0x0000 }, + { 0x1a00, 0x262f, 0x0000 }, + { 0x9a00, 0x2632, 0x2000 }, + { 0x1a00, 0x2631, 0x0000 }, + { 0x1a00, 0x2633, 0x0000 }, + { 0x9a00, 0x2638, 0x3000 }, + { 0x9a00, 0x2636, 0x2000 }, + { 0x1a00, 0x2635, 0x0000 }, + { 0x1a00, 0x2637, 0x0000 }, + { 0x9a00, 0x263a, 0x2000 }, + { 0x1a00, 0x2639, 0x0000 }, + { 0x1a00, 0x263b, 0x0000 }, + { 0x9a00, 0x2644, 0x4000 }, + { 0x9a00, 0x2640, 0x3000 }, + { 0x9a00, 0x263e, 0x2000 }, + { 0x1a00, 0x263d, 0x0000 }, + { 0x1a00, 0x263f, 0x0000 }, + { 0x9a00, 0x2642, 0x2000 }, + { 0x1a00, 0x2641, 0x0000 }, + { 0x1a00, 0x2643, 0x0000 }, + { 0x9a00, 0x2648, 0x3000 }, + { 0x9a00, 0x2646, 0x2000 }, + { 0x1a00, 0x2645, 0x0000 }, + { 0x1a00, 0x2647, 0x0000 }, + { 0x9a00, 0x264a, 0x2000 }, + { 0x1a00, 0x2649, 0x0000 }, + { 0x1a00, 0x264b, 0x0000 }, + { 0x9a00, 0x266c, 0x6000 }, + { 0x9a00, 0x265c, 0x5000 }, + { 0x9a00, 0x2654, 0x4000 }, + { 0x9a00, 0x2650, 0x3000 }, + { 0x9a00, 0x264e, 0x2000 }, + { 0x1a00, 0x264d, 0x0000 }, + { 0x1a00, 0x264f, 0x0000 }, + { 0x9a00, 0x2652, 0x2000 }, + { 0x1a00, 0x2651, 0x0000 }, + { 0x1a00, 0x2653, 0x0000 }, + { 0x9a00, 0x2658, 0x3000 }, + { 0x9a00, 0x2656, 0x2000 }, + { 0x1a00, 0x2655, 0x0000 }, + { 0x1a00, 0x2657, 0x0000 }, + { 0x9a00, 0x265a, 0x2000 }, + { 0x1a00, 0x2659, 0x0000 }, + { 0x1a00, 0x265b, 0x0000 }, + { 0x9a00, 0x2664, 0x4000 }, + { 0x9a00, 0x2660, 0x3000 }, + { 0x9a00, 0x265e, 0x2000 }, + { 0x1a00, 0x265d, 0x0000 }, + { 0x1a00, 0x265f, 0x0000 }, + { 0x9a00, 0x2662, 0x2000 }, + { 0x1a00, 0x2661, 0x0000 }, + { 0x1a00, 0x2663, 0x0000 }, + { 0x9a00, 0x2668, 0x3000 }, + { 0x9a00, 0x2666, 0x2000 }, + { 0x1a00, 0x2665, 0x0000 }, + { 0x1a00, 0x2667, 0x0000 }, + { 0x9a00, 0x266a, 0x2000 }, + { 0x1a00, 0x2669, 0x0000 }, + { 0x1a00, 0x266b, 0x0000 }, + { 0x9a00, 0x267c, 0x5000 }, + { 0x9a00, 0x2674, 0x4000 }, + { 0x9a00, 0x2670, 0x3000 }, + { 0x9a00, 0x266e, 0x2000 }, + { 0x1a00, 0x266d, 0x0000 }, + { 0x1900, 0x266f, 0x0000 }, + { 0x9a00, 0x2672, 0x2000 }, + { 0x1a00, 0x2671, 0x0000 }, + { 0x1a00, 0x2673, 0x0000 }, + { 0x9a00, 0x2678, 0x3000 }, + { 0x9a00, 0x2676, 0x2000 }, + { 0x1a00, 0x2675, 0x0000 }, + { 0x1a00, 0x2677, 0x0000 }, + { 0x9a00, 0x267a, 0x2000 }, + { 0x1a00, 0x2679, 0x0000 }, + { 0x1a00, 0x267b, 0x0000 }, + { 0x9a00, 0x2686, 0x4000 }, + { 0x9a00, 0x2682, 0x3000 }, + { 0x9a00, 0x2680, 0x2000 }, + { 0x1a00, 0x267d, 0x0000 }, + { 0x1a00, 0x2681, 0x0000 }, + { 0x9a00, 0x2684, 0x2000 }, + { 0x1a00, 0x2683, 0x0000 }, + { 0x1a00, 0x2685, 0x0000 }, + { 0x9a00, 0x268a, 0x3000 }, + { 0x9a00, 0x2688, 0x2000 }, + { 0x1a00, 0x2687, 0x0000 }, + { 0x1a00, 0x2689, 0x0000 }, + { 0x9a00, 0x268c, 0x2000 }, + { 0x1a00, 0x268b, 0x0000 }, + { 0x1a00, 0x268d, 0x0000 }, + { 0x9a00, 0x273f, 0x7000 }, + { 0x9a00, 0x271e, 0x6000 }, + { 0x9a00, 0x270e, 0x5000 }, + { 0x9a00, 0x2703, 0x4000 }, + { 0x9a00, 0x26a0, 0x3000 }, + { 0x9a00, 0x2690, 0x2000 }, + { 0x1a00, 0x268f, 0x0000 }, + { 0x1a00, 0x2691, 0x0000 }, + { 0x9a00, 0x2701, 0x2000 }, + { 0x1a00, 0x26a1, 0x0000 }, + { 0x1a00, 0x2702, 0x0000 }, + { 0x9a00, 0x2708, 0x3000 }, + { 0x9a00, 0x2706, 0x2000 }, + { 0x1a00, 0x2704, 0x0000 }, + { 0x1a00, 0x2707, 0x0000 }, + { 0x9a00, 0x270c, 0x2000 }, + { 0x1a00, 0x2709, 0x0000 }, + { 0x1a00, 0x270d, 0x0000 }, + { 0x9a00, 0x2716, 0x4000 }, + { 0x9a00, 0x2712, 0x3000 }, + { 0x9a00, 0x2710, 0x2000 }, + { 0x1a00, 0x270f, 0x0000 }, + { 0x1a00, 0x2711, 0x0000 }, + { 0x9a00, 0x2714, 0x2000 }, + { 0x1a00, 0x2713, 0x0000 }, + { 0x1a00, 0x2715, 0x0000 }, + { 0x9a00, 0x271a, 0x3000 }, + { 0x9a00, 0x2718, 0x2000 }, + { 0x1a00, 0x2717, 0x0000 }, + { 0x1a00, 0x2719, 0x0000 }, + { 0x9a00, 0x271c, 0x2000 }, + { 0x1a00, 0x271b, 0x0000 }, + { 0x1a00, 0x271d, 0x0000 }, + { 0x9a00, 0x272f, 0x5000 }, + { 0x9a00, 0x2726, 0x4000 }, + { 0x9a00, 0x2722, 0x3000 }, + { 0x9a00, 0x2720, 0x2000 }, + { 0x1a00, 0x271f, 0x0000 }, + { 0x1a00, 0x2721, 0x0000 }, + { 0x9a00, 0x2724, 0x2000 }, + { 0x1a00, 0x2723, 0x0000 }, + { 0x1a00, 0x2725, 0x0000 }, + { 0x9a00, 0x272b, 0x3000 }, + { 0x9a00, 0x2729, 0x2000 }, + { 0x1a00, 0x2727, 0x0000 }, + { 0x1a00, 0x272a, 0x0000 }, + { 0x9a00, 0x272d, 0x2000 }, + { 0x1a00, 0x272c, 0x0000 }, + { 0x1a00, 0x272e, 0x0000 }, + { 0x9a00, 0x2737, 0x4000 }, + { 0x9a00, 0x2733, 0x3000 }, + { 0x9a00, 0x2731, 0x2000 }, + { 0x1a00, 0x2730, 0x0000 }, + { 0x1a00, 0x2732, 0x0000 }, + { 0x9a00, 0x2735, 0x2000 }, + { 0x1a00, 0x2734, 0x0000 }, + { 0x1a00, 0x2736, 0x0000 }, + { 0x9a00, 0x273b, 0x3000 }, + { 0x9a00, 0x2739, 0x2000 }, + { 0x1a00, 0x2738, 0x0000 }, + { 0x1a00, 0x273a, 0x0000 }, + { 0x9a00, 0x273d, 0x2000 }, + { 0x1a00, 0x273c, 0x0000 }, + { 0x1a00, 0x273e, 0x0000 }, + { 0x9a00, 0x2767, 0x6000 }, + { 0x9a00, 0x2751, 0x5000 }, + { 0x9a00, 0x2747, 0x4000 }, + { 0x9a00, 0x2743, 0x3000 }, + { 0x9a00, 0x2741, 0x2000 }, + { 0x1a00, 0x2740, 0x0000 }, + { 0x1a00, 0x2742, 0x0000 }, + { 0x9a00, 0x2745, 0x2000 }, + { 0x1a00, 0x2744, 0x0000 }, + { 0x1a00, 0x2746, 0x0000 }, + { 0x9a00, 0x274b, 0x3000 }, + { 0x9a00, 0x2749, 0x2000 }, + { 0x1a00, 0x2748, 0x0000 }, + { 0x1a00, 0x274a, 0x0000 }, + { 0x9a00, 0x274f, 0x2000 }, + { 0x1a00, 0x274d, 0x0000 }, + { 0x1a00, 0x2750, 0x0000 }, + { 0x9a00, 0x275d, 0x4000 }, + { 0x9a00, 0x2759, 0x3000 }, + { 0x9a00, 0x2756, 0x2000 }, + { 0x1a00, 0x2752, 0x0000 }, + { 0x1a00, 0x2758, 0x0000 }, + { 0x9a00, 0x275b, 0x2000 }, + { 0x1a00, 0x275a, 0x0000 }, + { 0x1a00, 0x275c, 0x0000 }, + { 0x9a00, 0x2763, 0x3000 }, + { 0x9a00, 0x2761, 0x2000 }, + { 0x1a00, 0x275e, 0x0000 }, + { 0x1a00, 0x2762, 0x0000 }, + { 0x9a00, 0x2765, 0x2000 }, + { 0x1a00, 0x2764, 0x0000 }, + { 0x1a00, 0x2766, 0x0000 }, + { 0x8f00, 0x2777, 0x5000 }, + { 0x9200, 0x276f, 0x4000 }, + { 0x9200, 0x276b, 0x3000 }, + { 0x9200, 0x2769, 0x2000 }, + { 0x1600, 0x2768, 0x0000 }, + { 0x1600, 0x276a, 0x0000 }, + { 0x9200, 0x276d, 0x2000 }, + { 0x1600, 0x276c, 0x0000 }, + { 0x1600, 0x276e, 0x0000 }, + { 0x9200, 0x2773, 0x3000 }, + { 0x9200, 0x2771, 0x2000 }, + { 0x1600, 0x2770, 0x0000 }, + { 0x1600, 0x2772, 0x0000 }, + { 0x9200, 0x2775, 0x2000 }, + { 0x1600, 0x2774, 0x0000 }, + { 0x0f00, 0x2776, 0x0000 }, + { 0x8f00, 0x277f, 0x4000 }, + { 0x8f00, 0x277b, 0x3000 }, + { 0x8f00, 0x2779, 0x2000 }, + { 0x0f00, 0x2778, 0x0000 }, + { 0x0f00, 0x277a, 0x0000 }, + { 0x8f00, 0x277d, 0x2000 }, + { 0x0f00, 0x277c, 0x0000 }, + { 0x0f00, 0x277e, 0x0000 }, + { 0x8f00, 0x2783, 0x3000 }, + { 0x8f00, 0x2781, 0x2000 }, + { 0x0f00, 0x2780, 0x0000 }, + { 0x0f00, 0x2782, 0x0000 }, + { 0x8f00, 0x2785, 0x2000 }, + { 0x0f00, 0x2784, 0x0000 }, + { 0x0f00, 0x2786, 0x0000 }, + { 0x9900, 0x29a0, 0xa000 }, + { 0x9a00, 0x28a0, 0x9000 }, + { 0x9a00, 0x2820, 0x8000 }, + { 0x9900, 0x27dc, 0x7000 }, + { 0x9a00, 0x27aa, 0x6000 }, + { 0x9a00, 0x279a, 0x5000 }, + { 0x8f00, 0x278f, 0x4000 }, + { 0x8f00, 0x278b, 0x3000 }, + { 0x8f00, 0x2789, 0x2000 }, + { 0x0f00, 0x2788, 0x0000 }, + { 0x0f00, 0x278a, 0x0000 }, + { 0x8f00, 0x278d, 0x2000 }, + { 0x0f00, 0x278c, 0x0000 }, + { 0x0f00, 0x278e, 0x0000 }, + { 0x8f00, 0x2793, 0x3000 }, + { 0x8f00, 0x2791, 0x2000 }, + { 0x0f00, 0x2790, 0x0000 }, + { 0x0f00, 0x2792, 0x0000 }, + { 0x9a00, 0x2798, 0x2000 }, + { 0x1a00, 0x2794, 0x0000 }, + { 0x1a00, 0x2799, 0x0000 }, + { 0x9a00, 0x27a2, 0x4000 }, + { 0x9a00, 0x279e, 0x3000 }, + { 0x9a00, 0x279c, 0x2000 }, + { 0x1a00, 0x279b, 0x0000 }, + { 0x1a00, 0x279d, 0x0000 }, + { 0x9a00, 0x27a0, 0x2000 }, + { 0x1a00, 0x279f, 0x0000 }, + { 0x1a00, 0x27a1, 0x0000 }, + { 0x9a00, 0x27a6, 0x3000 }, + { 0x9a00, 0x27a4, 0x2000 }, + { 0x1a00, 0x27a3, 0x0000 }, + { 0x1a00, 0x27a5, 0x0000 }, + { 0x9a00, 0x27a8, 0x2000 }, + { 0x1a00, 0x27a7, 0x0000 }, + { 0x1a00, 0x27a9, 0x0000 }, + { 0x9a00, 0x27bb, 0x5000 }, + { 0x9a00, 0x27b3, 0x4000 }, + { 0x9a00, 0x27ae, 0x3000 }, + { 0x9a00, 0x27ac, 0x2000 }, + { 0x1a00, 0x27ab, 0x0000 }, + { 0x1a00, 0x27ad, 0x0000 }, + { 0x9a00, 0x27b1, 0x2000 }, + { 0x1a00, 0x27af, 0x0000 }, + { 0x1a00, 0x27b2, 0x0000 }, + { 0x9a00, 0x27b7, 0x3000 }, + { 0x9a00, 0x27b5, 0x2000 }, + { 0x1a00, 0x27b4, 0x0000 }, + { 0x1a00, 0x27b6, 0x0000 }, + { 0x9a00, 0x27b9, 0x2000 }, + { 0x1a00, 0x27b8, 0x0000 }, + { 0x1a00, 0x27ba, 0x0000 }, + { 0x9900, 0x27d4, 0x4000 }, + { 0x9900, 0x27d0, 0x3000 }, + { 0x9a00, 0x27bd, 0x2000 }, + { 0x1a00, 0x27bc, 0x0000 }, + { 0x1a00, 0x27be, 0x0000 }, + { 0x9900, 0x27d2, 0x2000 }, + { 0x1900, 0x27d1, 0x0000 }, + { 0x1900, 0x27d3, 0x0000 }, + { 0x9900, 0x27d8, 0x3000 }, + { 0x9900, 0x27d6, 0x2000 }, + { 0x1900, 0x27d5, 0x0000 }, + { 0x1900, 0x27d7, 0x0000 }, + { 0x9900, 0x27da, 0x2000 }, + { 0x1900, 0x27d9, 0x0000 }, + { 0x1900, 0x27db, 0x0000 }, + { 0x9a00, 0x2800, 0x6000 }, + { 0x9900, 0x27f0, 0x5000 }, + { 0x9900, 0x27e4, 0x4000 }, + { 0x9900, 0x27e0, 0x3000 }, + { 0x9900, 0x27de, 0x2000 }, + { 0x1900, 0x27dd, 0x0000 }, + { 0x1900, 0x27df, 0x0000 }, + { 0x9900, 0x27e2, 0x2000 }, + { 0x1900, 0x27e1, 0x0000 }, + { 0x1900, 0x27e3, 0x0000 }, + { 0x9600, 0x27e8, 0x3000 }, + { 0x9600, 0x27e6, 0x2000 }, + { 0x1900, 0x27e5, 0x0000 }, + { 0x1200, 0x27e7, 0x0000 }, + { 0x9600, 0x27ea, 0x2000 }, + { 0x1200, 0x27e9, 0x0000 }, + { 0x1200, 0x27eb, 0x0000 }, + { 0x9900, 0x27f8, 0x4000 }, + { 0x9900, 0x27f4, 0x3000 }, + { 0x9900, 0x27f2, 0x2000 }, + { 0x1900, 0x27f1, 0x0000 }, + { 0x1900, 0x27f3, 0x0000 }, + { 0x9900, 0x27f6, 0x2000 }, + { 0x1900, 0x27f5, 0x0000 }, + { 0x1900, 0x27f7, 0x0000 }, + { 0x9900, 0x27fc, 0x3000 }, + { 0x9900, 0x27fa, 0x2000 }, + { 0x1900, 0x27f9, 0x0000 }, + { 0x1900, 0x27fb, 0x0000 }, + { 0x9900, 0x27fe, 0x2000 }, + { 0x1900, 0x27fd, 0x0000 }, + { 0x1900, 0x27ff, 0x0000 }, + { 0x9a00, 0x2810, 0x5000 }, + { 0x9a00, 0x2808, 0x4000 }, + { 0x9a00, 0x2804, 0x3000 }, + { 0x9a00, 0x2802, 0x2000 }, + { 0x1a00, 0x2801, 0x0000 }, + { 0x1a00, 0x2803, 0x0000 }, + { 0x9a00, 0x2806, 0x2000 }, + { 0x1a00, 0x2805, 0x0000 }, + { 0x1a00, 0x2807, 0x0000 }, + { 0x9a00, 0x280c, 0x3000 }, + { 0x9a00, 0x280a, 0x2000 }, + { 0x1a00, 0x2809, 0x0000 }, + { 0x1a00, 0x280b, 0x0000 }, + { 0x9a00, 0x280e, 0x2000 }, + { 0x1a00, 0x280d, 0x0000 }, + { 0x1a00, 0x280f, 0x0000 }, + { 0x9a00, 0x2818, 0x4000 }, + { 0x9a00, 0x2814, 0x3000 }, + { 0x9a00, 0x2812, 0x2000 }, + { 0x1a00, 0x2811, 0x0000 }, + { 0x1a00, 0x2813, 0x0000 }, + { 0x9a00, 0x2816, 0x2000 }, + { 0x1a00, 0x2815, 0x0000 }, + { 0x1a00, 0x2817, 0x0000 }, + { 0x9a00, 0x281c, 0x3000 }, + { 0x9a00, 0x281a, 0x2000 }, + { 0x1a00, 0x2819, 0x0000 }, + { 0x1a00, 0x281b, 0x0000 }, + { 0x9a00, 0x281e, 0x2000 }, + { 0x1a00, 0x281d, 0x0000 }, + { 0x1a00, 0x281f, 0x0000 }, + { 0x9a00, 0x2860, 0x7000 }, + { 0x9a00, 0x2840, 0x6000 }, + { 0x9a00, 0x2830, 0x5000 }, + { 0x9a00, 0x2828, 0x4000 }, + { 0x9a00, 0x2824, 0x3000 }, + { 0x9a00, 0x2822, 0x2000 }, + { 0x1a00, 0x2821, 0x0000 }, + { 0x1a00, 0x2823, 0x0000 }, + { 0x9a00, 0x2826, 0x2000 }, + { 0x1a00, 0x2825, 0x0000 }, + { 0x1a00, 0x2827, 0x0000 }, + { 0x9a00, 0x282c, 0x3000 }, + { 0x9a00, 0x282a, 0x2000 }, + { 0x1a00, 0x2829, 0x0000 }, + { 0x1a00, 0x282b, 0x0000 }, + { 0x9a00, 0x282e, 0x2000 }, + { 0x1a00, 0x282d, 0x0000 }, + { 0x1a00, 0x282f, 0x0000 }, + { 0x9a00, 0x2838, 0x4000 }, + { 0x9a00, 0x2834, 0x3000 }, + { 0x9a00, 0x2832, 0x2000 }, + { 0x1a00, 0x2831, 0x0000 }, + { 0x1a00, 0x2833, 0x0000 }, + { 0x9a00, 0x2836, 0x2000 }, + { 0x1a00, 0x2835, 0x0000 }, + { 0x1a00, 0x2837, 0x0000 }, + { 0x9a00, 0x283c, 0x3000 }, + { 0x9a00, 0x283a, 0x2000 }, + { 0x1a00, 0x2839, 0x0000 }, + { 0x1a00, 0x283b, 0x0000 }, + { 0x9a00, 0x283e, 0x2000 }, + { 0x1a00, 0x283d, 0x0000 }, + { 0x1a00, 0x283f, 0x0000 }, + { 0x9a00, 0x2850, 0x5000 }, + { 0x9a00, 0x2848, 0x4000 }, + { 0x9a00, 0x2844, 0x3000 }, + { 0x9a00, 0x2842, 0x2000 }, + { 0x1a00, 0x2841, 0x0000 }, + { 0x1a00, 0x2843, 0x0000 }, + { 0x9a00, 0x2846, 0x2000 }, + { 0x1a00, 0x2845, 0x0000 }, + { 0x1a00, 0x2847, 0x0000 }, + { 0x9a00, 0x284c, 0x3000 }, + { 0x9a00, 0x284a, 0x2000 }, + { 0x1a00, 0x2849, 0x0000 }, + { 0x1a00, 0x284b, 0x0000 }, + { 0x9a00, 0x284e, 0x2000 }, + { 0x1a00, 0x284d, 0x0000 }, + { 0x1a00, 0x284f, 0x0000 }, + { 0x9a00, 0x2858, 0x4000 }, + { 0x9a00, 0x2854, 0x3000 }, + { 0x9a00, 0x2852, 0x2000 }, + { 0x1a00, 0x2851, 0x0000 }, + { 0x1a00, 0x2853, 0x0000 }, + { 0x9a00, 0x2856, 0x2000 }, + { 0x1a00, 0x2855, 0x0000 }, + { 0x1a00, 0x2857, 0x0000 }, + { 0x9a00, 0x285c, 0x3000 }, + { 0x9a00, 0x285a, 0x2000 }, + { 0x1a00, 0x2859, 0x0000 }, + { 0x1a00, 0x285b, 0x0000 }, + { 0x9a00, 0x285e, 0x2000 }, + { 0x1a00, 0x285d, 0x0000 }, + { 0x1a00, 0x285f, 0x0000 }, + { 0x9a00, 0x2880, 0x6000 }, + { 0x9a00, 0x2870, 0x5000 }, + { 0x9a00, 0x2868, 0x4000 }, + { 0x9a00, 0x2864, 0x3000 }, + { 0x9a00, 0x2862, 0x2000 }, + { 0x1a00, 0x2861, 0x0000 }, + { 0x1a00, 0x2863, 0x0000 }, + { 0x9a00, 0x2866, 0x2000 }, + { 0x1a00, 0x2865, 0x0000 }, + { 0x1a00, 0x2867, 0x0000 }, + { 0x9a00, 0x286c, 0x3000 }, + { 0x9a00, 0x286a, 0x2000 }, + { 0x1a00, 0x2869, 0x0000 }, + { 0x1a00, 0x286b, 0x0000 }, + { 0x9a00, 0x286e, 0x2000 }, + { 0x1a00, 0x286d, 0x0000 }, + { 0x1a00, 0x286f, 0x0000 }, + { 0x9a00, 0x2878, 0x4000 }, + { 0x9a00, 0x2874, 0x3000 }, + { 0x9a00, 0x2872, 0x2000 }, + { 0x1a00, 0x2871, 0x0000 }, + { 0x1a00, 0x2873, 0x0000 }, + { 0x9a00, 0x2876, 0x2000 }, + { 0x1a00, 0x2875, 0x0000 }, + { 0x1a00, 0x2877, 0x0000 }, + { 0x9a00, 0x287c, 0x3000 }, + { 0x9a00, 0x287a, 0x2000 }, + { 0x1a00, 0x2879, 0x0000 }, + { 0x1a00, 0x287b, 0x0000 }, + { 0x9a00, 0x287e, 0x2000 }, + { 0x1a00, 0x287d, 0x0000 }, + { 0x1a00, 0x287f, 0x0000 }, + { 0x9a00, 0x2890, 0x5000 }, + { 0x9a00, 0x2888, 0x4000 }, + { 0x9a00, 0x2884, 0x3000 }, + { 0x9a00, 0x2882, 0x2000 }, + { 0x1a00, 0x2881, 0x0000 }, + { 0x1a00, 0x2883, 0x0000 }, + { 0x9a00, 0x2886, 0x2000 }, + { 0x1a00, 0x2885, 0x0000 }, + { 0x1a00, 0x2887, 0x0000 }, + { 0x9a00, 0x288c, 0x3000 }, + { 0x9a00, 0x288a, 0x2000 }, + { 0x1a00, 0x2889, 0x0000 }, + { 0x1a00, 0x288b, 0x0000 }, + { 0x9a00, 0x288e, 0x2000 }, + { 0x1a00, 0x288d, 0x0000 }, + { 0x1a00, 0x288f, 0x0000 }, + { 0x9a00, 0x2898, 0x4000 }, + { 0x9a00, 0x2894, 0x3000 }, + { 0x9a00, 0x2892, 0x2000 }, + { 0x1a00, 0x2891, 0x0000 }, + { 0x1a00, 0x2893, 0x0000 }, + { 0x9a00, 0x2896, 0x2000 }, + { 0x1a00, 0x2895, 0x0000 }, + { 0x1a00, 0x2897, 0x0000 }, + { 0x9a00, 0x289c, 0x3000 }, + { 0x9a00, 0x289a, 0x2000 }, + { 0x1a00, 0x2899, 0x0000 }, + { 0x1a00, 0x289b, 0x0000 }, + { 0x9a00, 0x289e, 0x2000 }, + { 0x1a00, 0x289d, 0x0000 }, + { 0x1a00, 0x289f, 0x0000 }, + { 0x9900, 0x2920, 0x8000 }, + { 0x9a00, 0x28e0, 0x7000 }, + { 0x9a00, 0x28c0, 0x6000 }, + { 0x9a00, 0x28b0, 0x5000 }, + { 0x9a00, 0x28a8, 0x4000 }, + { 0x9a00, 0x28a4, 0x3000 }, + { 0x9a00, 0x28a2, 0x2000 }, + { 0x1a00, 0x28a1, 0x0000 }, + { 0x1a00, 0x28a3, 0x0000 }, + { 0x9a00, 0x28a6, 0x2000 }, + { 0x1a00, 0x28a5, 0x0000 }, + { 0x1a00, 0x28a7, 0x0000 }, + { 0x9a00, 0x28ac, 0x3000 }, + { 0x9a00, 0x28aa, 0x2000 }, + { 0x1a00, 0x28a9, 0x0000 }, + { 0x1a00, 0x28ab, 0x0000 }, + { 0x9a00, 0x28ae, 0x2000 }, + { 0x1a00, 0x28ad, 0x0000 }, + { 0x1a00, 0x28af, 0x0000 }, + { 0x9a00, 0x28b8, 0x4000 }, + { 0x9a00, 0x28b4, 0x3000 }, + { 0x9a00, 0x28b2, 0x2000 }, + { 0x1a00, 0x28b1, 0x0000 }, + { 0x1a00, 0x28b3, 0x0000 }, + { 0x9a00, 0x28b6, 0x2000 }, + { 0x1a00, 0x28b5, 0x0000 }, + { 0x1a00, 0x28b7, 0x0000 }, + { 0x9a00, 0x28bc, 0x3000 }, + { 0x9a00, 0x28ba, 0x2000 }, + { 0x1a00, 0x28b9, 0x0000 }, + { 0x1a00, 0x28bb, 0x0000 }, + { 0x9a00, 0x28be, 0x2000 }, + { 0x1a00, 0x28bd, 0x0000 }, + { 0x1a00, 0x28bf, 0x0000 }, + { 0x9a00, 0x28d0, 0x5000 }, + { 0x9a00, 0x28c8, 0x4000 }, + { 0x9a00, 0x28c4, 0x3000 }, + { 0x9a00, 0x28c2, 0x2000 }, + { 0x1a00, 0x28c1, 0x0000 }, + { 0x1a00, 0x28c3, 0x0000 }, + { 0x9a00, 0x28c6, 0x2000 }, + { 0x1a00, 0x28c5, 0x0000 }, + { 0x1a00, 0x28c7, 0x0000 }, + { 0x9a00, 0x28cc, 0x3000 }, + { 0x9a00, 0x28ca, 0x2000 }, + { 0x1a00, 0x28c9, 0x0000 }, + { 0x1a00, 0x28cb, 0x0000 }, + { 0x9a00, 0x28ce, 0x2000 }, + { 0x1a00, 0x28cd, 0x0000 }, + { 0x1a00, 0x28cf, 0x0000 }, + { 0x9a00, 0x28d8, 0x4000 }, + { 0x9a00, 0x28d4, 0x3000 }, + { 0x9a00, 0x28d2, 0x2000 }, + { 0x1a00, 0x28d1, 0x0000 }, + { 0x1a00, 0x28d3, 0x0000 }, + { 0x9a00, 0x28d6, 0x2000 }, + { 0x1a00, 0x28d5, 0x0000 }, + { 0x1a00, 0x28d7, 0x0000 }, + { 0x9a00, 0x28dc, 0x3000 }, + { 0x9a00, 0x28da, 0x2000 }, + { 0x1a00, 0x28d9, 0x0000 }, + { 0x1a00, 0x28db, 0x0000 }, + { 0x9a00, 0x28de, 0x2000 }, + { 0x1a00, 0x28dd, 0x0000 }, + { 0x1a00, 0x28df, 0x0000 }, + { 0x9900, 0x2900, 0x6000 }, + { 0x9a00, 0x28f0, 0x5000 }, + { 0x9a00, 0x28e8, 0x4000 }, + { 0x9a00, 0x28e4, 0x3000 }, + { 0x9a00, 0x28e2, 0x2000 }, + { 0x1a00, 0x28e1, 0x0000 }, + { 0x1a00, 0x28e3, 0x0000 }, + { 0x9a00, 0x28e6, 0x2000 }, + { 0x1a00, 0x28e5, 0x0000 }, + { 0x1a00, 0x28e7, 0x0000 }, + { 0x9a00, 0x28ec, 0x3000 }, + { 0x9a00, 0x28ea, 0x2000 }, + { 0x1a00, 0x28e9, 0x0000 }, + { 0x1a00, 0x28eb, 0x0000 }, + { 0x9a00, 0x28ee, 0x2000 }, + { 0x1a00, 0x28ed, 0x0000 }, + { 0x1a00, 0x28ef, 0x0000 }, + { 0x9a00, 0x28f8, 0x4000 }, + { 0x9a00, 0x28f4, 0x3000 }, + { 0x9a00, 0x28f2, 0x2000 }, + { 0x1a00, 0x28f1, 0x0000 }, + { 0x1a00, 0x28f3, 0x0000 }, + { 0x9a00, 0x28f6, 0x2000 }, + { 0x1a00, 0x28f5, 0x0000 }, + { 0x1a00, 0x28f7, 0x0000 }, + { 0x9a00, 0x28fc, 0x3000 }, + { 0x9a00, 0x28fa, 0x2000 }, + { 0x1a00, 0x28f9, 0x0000 }, + { 0x1a00, 0x28fb, 0x0000 }, + { 0x9a00, 0x28fe, 0x2000 }, + { 0x1a00, 0x28fd, 0x0000 }, + { 0x1a00, 0x28ff, 0x0000 }, + { 0x9900, 0x2910, 0x5000 }, + { 0x9900, 0x2908, 0x4000 }, + { 0x9900, 0x2904, 0x3000 }, + { 0x9900, 0x2902, 0x2000 }, + { 0x1900, 0x2901, 0x0000 }, + { 0x1900, 0x2903, 0x0000 }, + { 0x9900, 0x2906, 0x2000 }, + { 0x1900, 0x2905, 0x0000 }, + { 0x1900, 0x2907, 0x0000 }, + { 0x9900, 0x290c, 0x3000 }, + { 0x9900, 0x290a, 0x2000 }, + { 0x1900, 0x2909, 0x0000 }, + { 0x1900, 0x290b, 0x0000 }, + { 0x9900, 0x290e, 0x2000 }, + { 0x1900, 0x290d, 0x0000 }, + { 0x1900, 0x290f, 0x0000 }, + { 0x9900, 0x2918, 0x4000 }, + { 0x9900, 0x2914, 0x3000 }, + { 0x9900, 0x2912, 0x2000 }, + { 0x1900, 0x2911, 0x0000 }, + { 0x1900, 0x2913, 0x0000 }, + { 0x9900, 0x2916, 0x2000 }, + { 0x1900, 0x2915, 0x0000 }, + { 0x1900, 0x2917, 0x0000 }, + { 0x9900, 0x291c, 0x3000 }, + { 0x9900, 0x291a, 0x2000 }, + { 0x1900, 0x2919, 0x0000 }, + { 0x1900, 0x291b, 0x0000 }, + { 0x9900, 0x291e, 0x2000 }, + { 0x1900, 0x291d, 0x0000 }, + { 0x1900, 0x291f, 0x0000 }, + { 0x9900, 0x2960, 0x7000 }, + { 0x9900, 0x2940, 0x6000 }, + { 0x9900, 0x2930, 0x5000 }, + { 0x9900, 0x2928, 0x4000 }, + { 0x9900, 0x2924, 0x3000 }, + { 0x9900, 0x2922, 0x2000 }, + { 0x1900, 0x2921, 0x0000 }, + { 0x1900, 0x2923, 0x0000 }, + { 0x9900, 0x2926, 0x2000 }, + { 0x1900, 0x2925, 0x0000 }, + { 0x1900, 0x2927, 0x0000 }, + { 0x9900, 0x292c, 0x3000 }, + { 0x9900, 0x292a, 0x2000 }, + { 0x1900, 0x2929, 0x0000 }, + { 0x1900, 0x292b, 0x0000 }, + { 0x9900, 0x292e, 0x2000 }, + { 0x1900, 0x292d, 0x0000 }, + { 0x1900, 0x292f, 0x0000 }, + { 0x9900, 0x2938, 0x4000 }, + { 0x9900, 0x2934, 0x3000 }, + { 0x9900, 0x2932, 0x2000 }, + { 0x1900, 0x2931, 0x0000 }, + { 0x1900, 0x2933, 0x0000 }, + { 0x9900, 0x2936, 0x2000 }, + { 0x1900, 0x2935, 0x0000 }, + { 0x1900, 0x2937, 0x0000 }, + { 0x9900, 0x293c, 0x3000 }, + { 0x9900, 0x293a, 0x2000 }, + { 0x1900, 0x2939, 0x0000 }, + { 0x1900, 0x293b, 0x0000 }, + { 0x9900, 0x293e, 0x2000 }, + { 0x1900, 0x293d, 0x0000 }, + { 0x1900, 0x293f, 0x0000 }, + { 0x9900, 0x2950, 0x5000 }, + { 0x9900, 0x2948, 0x4000 }, + { 0x9900, 0x2944, 0x3000 }, + { 0x9900, 0x2942, 0x2000 }, + { 0x1900, 0x2941, 0x0000 }, + { 0x1900, 0x2943, 0x0000 }, + { 0x9900, 0x2946, 0x2000 }, + { 0x1900, 0x2945, 0x0000 }, + { 0x1900, 0x2947, 0x0000 }, + { 0x9900, 0x294c, 0x3000 }, + { 0x9900, 0x294a, 0x2000 }, + { 0x1900, 0x2949, 0x0000 }, + { 0x1900, 0x294b, 0x0000 }, + { 0x9900, 0x294e, 0x2000 }, + { 0x1900, 0x294d, 0x0000 }, + { 0x1900, 0x294f, 0x0000 }, + { 0x9900, 0x2958, 0x4000 }, + { 0x9900, 0x2954, 0x3000 }, + { 0x9900, 0x2952, 0x2000 }, + { 0x1900, 0x2951, 0x0000 }, + { 0x1900, 0x2953, 0x0000 }, + { 0x9900, 0x2956, 0x2000 }, + { 0x1900, 0x2955, 0x0000 }, + { 0x1900, 0x2957, 0x0000 }, + { 0x9900, 0x295c, 0x3000 }, + { 0x9900, 0x295a, 0x2000 }, + { 0x1900, 0x2959, 0x0000 }, + { 0x1900, 0x295b, 0x0000 }, + { 0x9900, 0x295e, 0x2000 }, + { 0x1900, 0x295d, 0x0000 }, + { 0x1900, 0x295f, 0x0000 }, + { 0x9900, 0x2980, 0x6000 }, + { 0x9900, 0x2970, 0x5000 }, + { 0x9900, 0x2968, 0x4000 }, + { 0x9900, 0x2964, 0x3000 }, + { 0x9900, 0x2962, 0x2000 }, + { 0x1900, 0x2961, 0x0000 }, + { 0x1900, 0x2963, 0x0000 }, + { 0x9900, 0x2966, 0x2000 }, + { 0x1900, 0x2965, 0x0000 }, + { 0x1900, 0x2967, 0x0000 }, + { 0x9900, 0x296c, 0x3000 }, + { 0x9900, 0x296a, 0x2000 }, + { 0x1900, 0x2969, 0x0000 }, + { 0x1900, 0x296b, 0x0000 }, + { 0x9900, 0x296e, 0x2000 }, + { 0x1900, 0x296d, 0x0000 }, + { 0x1900, 0x296f, 0x0000 }, + { 0x9900, 0x2978, 0x4000 }, + { 0x9900, 0x2974, 0x3000 }, + { 0x9900, 0x2972, 0x2000 }, + { 0x1900, 0x2971, 0x0000 }, + { 0x1900, 0x2973, 0x0000 }, + { 0x9900, 0x2976, 0x2000 }, + { 0x1900, 0x2975, 0x0000 }, + { 0x1900, 0x2977, 0x0000 }, + { 0x9900, 0x297c, 0x3000 }, + { 0x9900, 0x297a, 0x2000 }, + { 0x1900, 0x2979, 0x0000 }, + { 0x1900, 0x297b, 0x0000 }, + { 0x9900, 0x297e, 0x2000 }, + { 0x1900, 0x297d, 0x0000 }, + { 0x1900, 0x297f, 0x0000 }, + { 0x9200, 0x2990, 0x5000 }, + { 0x9200, 0x2988, 0x4000 }, + { 0x9200, 0x2984, 0x3000 }, + { 0x9900, 0x2982, 0x2000 }, + { 0x1900, 0x2981, 0x0000 }, + { 0x1600, 0x2983, 0x0000 }, + { 0x9200, 0x2986, 0x2000 }, + { 0x1600, 0x2985, 0x0000 }, + { 0x1600, 0x2987, 0x0000 }, + { 0x9200, 0x298c, 0x3000 }, + { 0x9200, 0x298a, 0x2000 }, + { 0x1600, 0x2989, 0x0000 }, + { 0x1600, 0x298b, 0x0000 }, + { 0x9200, 0x298e, 0x2000 }, + { 0x1600, 0x298d, 0x0000 }, + { 0x1600, 0x298f, 0x0000 }, + { 0x9200, 0x2998, 0x4000 }, + { 0x9200, 0x2994, 0x3000 }, + { 0x9200, 0x2992, 0x2000 }, + { 0x1600, 0x2991, 0x0000 }, + { 0x1600, 0x2993, 0x0000 }, + { 0x9200, 0x2996, 0x2000 }, + { 0x1600, 0x2995, 0x0000 }, + { 0x1600, 0x2997, 0x0000 }, + { 0x9900, 0x299c, 0x3000 }, + { 0x9900, 0x299a, 0x2000 }, + { 0x1900, 0x2999, 0x0000 }, + { 0x1900, 0x299b, 0x0000 }, + { 0x9900, 0x299e, 0x2000 }, + { 0x1900, 0x299d, 0x0000 }, + { 0x1900, 0x299f, 0x0000 }, + { 0x9900, 0x2aa0, 0x9000 }, + { 0x9900, 0x2a20, 0x8000 }, + { 0x9900, 0x29e0, 0x7000 }, + { 0x9900, 0x29c0, 0x6000 }, + { 0x9900, 0x29b0, 0x5000 }, + { 0x9900, 0x29a8, 0x4000 }, + { 0x9900, 0x29a4, 0x3000 }, + { 0x9900, 0x29a2, 0x2000 }, + { 0x1900, 0x29a1, 0x0000 }, + { 0x1900, 0x29a3, 0x0000 }, + { 0x9900, 0x29a6, 0x2000 }, + { 0x1900, 0x29a5, 0x0000 }, + { 0x1900, 0x29a7, 0x0000 }, + { 0x9900, 0x29ac, 0x3000 }, + { 0x9900, 0x29aa, 0x2000 }, + { 0x1900, 0x29a9, 0x0000 }, + { 0x1900, 0x29ab, 0x0000 }, + { 0x9900, 0x29ae, 0x2000 }, + { 0x1900, 0x29ad, 0x0000 }, + { 0x1900, 0x29af, 0x0000 }, + { 0x9900, 0x29b8, 0x4000 }, + { 0x9900, 0x29b4, 0x3000 }, + { 0x9900, 0x29b2, 0x2000 }, + { 0x1900, 0x29b1, 0x0000 }, + { 0x1900, 0x29b3, 0x0000 }, + { 0x9900, 0x29b6, 0x2000 }, + { 0x1900, 0x29b5, 0x0000 }, + { 0x1900, 0x29b7, 0x0000 }, + { 0x9900, 0x29bc, 0x3000 }, + { 0x9900, 0x29ba, 0x2000 }, + { 0x1900, 0x29b9, 0x0000 }, + { 0x1900, 0x29bb, 0x0000 }, + { 0x9900, 0x29be, 0x2000 }, + { 0x1900, 0x29bd, 0x0000 }, + { 0x1900, 0x29bf, 0x0000 }, + { 0x9900, 0x29d0, 0x5000 }, + { 0x9900, 0x29c8, 0x4000 }, + { 0x9900, 0x29c4, 0x3000 }, + { 0x9900, 0x29c2, 0x2000 }, + { 0x1900, 0x29c1, 0x0000 }, + { 0x1900, 0x29c3, 0x0000 }, + { 0x9900, 0x29c6, 0x2000 }, + { 0x1900, 0x29c5, 0x0000 }, + { 0x1900, 0x29c7, 0x0000 }, + { 0x9900, 0x29cc, 0x3000 }, + { 0x9900, 0x29ca, 0x2000 }, + { 0x1900, 0x29c9, 0x0000 }, + { 0x1900, 0x29cb, 0x0000 }, + { 0x9900, 0x29ce, 0x2000 }, + { 0x1900, 0x29cd, 0x0000 }, + { 0x1900, 0x29cf, 0x0000 }, + { 0x9600, 0x29d8, 0x4000 }, + { 0x9900, 0x29d4, 0x3000 }, + { 0x9900, 0x29d2, 0x2000 }, + { 0x1900, 0x29d1, 0x0000 }, + { 0x1900, 0x29d3, 0x0000 }, + { 0x9900, 0x29d6, 0x2000 }, + { 0x1900, 0x29d5, 0x0000 }, + { 0x1900, 0x29d7, 0x0000 }, + { 0x9900, 0x29dc, 0x3000 }, + { 0x9600, 0x29da, 0x2000 }, + { 0x1200, 0x29d9, 0x0000 }, + { 0x1200, 0x29db, 0x0000 }, + { 0x9900, 0x29de, 0x2000 }, + { 0x1900, 0x29dd, 0x0000 }, + { 0x1900, 0x29df, 0x0000 }, + { 0x9900, 0x2a00, 0x6000 }, + { 0x9900, 0x29f0, 0x5000 }, + { 0x9900, 0x29e8, 0x4000 }, + { 0x9900, 0x29e4, 0x3000 }, + { 0x9900, 0x29e2, 0x2000 }, + { 0x1900, 0x29e1, 0x0000 }, + { 0x1900, 0x29e3, 0x0000 }, + { 0x9900, 0x29e6, 0x2000 }, + { 0x1900, 0x29e5, 0x0000 }, + { 0x1900, 0x29e7, 0x0000 }, + { 0x9900, 0x29ec, 0x3000 }, + { 0x9900, 0x29ea, 0x2000 }, + { 0x1900, 0x29e9, 0x0000 }, + { 0x1900, 0x29eb, 0x0000 }, + { 0x9900, 0x29ee, 0x2000 }, + { 0x1900, 0x29ed, 0x0000 }, + { 0x1900, 0x29ef, 0x0000 }, + { 0x9900, 0x29f8, 0x4000 }, + { 0x9900, 0x29f4, 0x3000 }, + { 0x9900, 0x29f2, 0x2000 }, + { 0x1900, 0x29f1, 0x0000 }, + { 0x1900, 0x29f3, 0x0000 }, + { 0x9900, 0x29f6, 0x2000 }, + { 0x1900, 0x29f5, 0x0000 }, + { 0x1900, 0x29f7, 0x0000 }, + { 0x9600, 0x29fc, 0x3000 }, + { 0x9900, 0x29fa, 0x2000 }, + { 0x1900, 0x29f9, 0x0000 }, + { 0x1900, 0x29fb, 0x0000 }, + { 0x9900, 0x29fe, 0x2000 }, + { 0x1200, 0x29fd, 0x0000 }, + { 0x1900, 0x29ff, 0x0000 }, + { 0x9900, 0x2a10, 0x5000 }, + { 0x9900, 0x2a08, 0x4000 }, + { 0x9900, 0x2a04, 0x3000 }, + { 0x9900, 0x2a02, 0x2000 }, + { 0x1900, 0x2a01, 0x0000 }, + { 0x1900, 0x2a03, 0x0000 }, + { 0x9900, 0x2a06, 0x2000 }, + { 0x1900, 0x2a05, 0x0000 }, + { 0x1900, 0x2a07, 0x0000 }, + { 0x9900, 0x2a0c, 0x3000 }, + { 0x9900, 0x2a0a, 0x2000 }, + { 0x1900, 0x2a09, 0x0000 }, + { 0x1900, 0x2a0b, 0x0000 }, + { 0x9900, 0x2a0e, 0x2000 }, + { 0x1900, 0x2a0d, 0x0000 }, + { 0x1900, 0x2a0f, 0x0000 }, + { 0x9900, 0x2a18, 0x4000 }, + { 0x9900, 0x2a14, 0x3000 }, + { 0x9900, 0x2a12, 0x2000 }, + { 0x1900, 0x2a11, 0x0000 }, + { 0x1900, 0x2a13, 0x0000 }, + { 0x9900, 0x2a16, 0x2000 }, + { 0x1900, 0x2a15, 0x0000 }, + { 0x1900, 0x2a17, 0x0000 }, + { 0x9900, 0x2a1c, 0x3000 }, + { 0x9900, 0x2a1a, 0x2000 }, + { 0x1900, 0x2a19, 0x0000 }, + { 0x1900, 0x2a1b, 0x0000 }, + { 0x9900, 0x2a1e, 0x2000 }, + { 0x1900, 0x2a1d, 0x0000 }, + { 0x1900, 0x2a1f, 0x0000 }, + { 0x9900, 0x2a60, 0x7000 }, + { 0x9900, 0x2a40, 0x6000 }, + { 0x9900, 0x2a30, 0x5000 }, + { 0x9900, 0x2a28, 0x4000 }, + { 0x9900, 0x2a24, 0x3000 }, + { 0x9900, 0x2a22, 0x2000 }, + { 0x1900, 0x2a21, 0x0000 }, + { 0x1900, 0x2a23, 0x0000 }, + { 0x9900, 0x2a26, 0x2000 }, + { 0x1900, 0x2a25, 0x0000 }, + { 0x1900, 0x2a27, 0x0000 }, + { 0x9900, 0x2a2c, 0x3000 }, + { 0x9900, 0x2a2a, 0x2000 }, + { 0x1900, 0x2a29, 0x0000 }, + { 0x1900, 0x2a2b, 0x0000 }, + { 0x9900, 0x2a2e, 0x2000 }, + { 0x1900, 0x2a2d, 0x0000 }, + { 0x1900, 0x2a2f, 0x0000 }, + { 0x9900, 0x2a38, 0x4000 }, + { 0x9900, 0x2a34, 0x3000 }, + { 0x9900, 0x2a32, 0x2000 }, + { 0x1900, 0x2a31, 0x0000 }, + { 0x1900, 0x2a33, 0x0000 }, + { 0x9900, 0x2a36, 0x2000 }, + { 0x1900, 0x2a35, 0x0000 }, + { 0x1900, 0x2a37, 0x0000 }, + { 0x9900, 0x2a3c, 0x3000 }, + { 0x9900, 0x2a3a, 0x2000 }, + { 0x1900, 0x2a39, 0x0000 }, + { 0x1900, 0x2a3b, 0x0000 }, + { 0x9900, 0x2a3e, 0x2000 }, + { 0x1900, 0x2a3d, 0x0000 }, + { 0x1900, 0x2a3f, 0x0000 }, + { 0x9900, 0x2a50, 0x5000 }, + { 0x9900, 0x2a48, 0x4000 }, + { 0x9900, 0x2a44, 0x3000 }, + { 0x9900, 0x2a42, 0x2000 }, + { 0x1900, 0x2a41, 0x0000 }, + { 0x1900, 0x2a43, 0x0000 }, + { 0x9900, 0x2a46, 0x2000 }, + { 0x1900, 0x2a45, 0x0000 }, + { 0x1900, 0x2a47, 0x0000 }, + { 0x9900, 0x2a4c, 0x3000 }, + { 0x9900, 0x2a4a, 0x2000 }, + { 0x1900, 0x2a49, 0x0000 }, + { 0x1900, 0x2a4b, 0x0000 }, + { 0x9900, 0x2a4e, 0x2000 }, + { 0x1900, 0x2a4d, 0x0000 }, + { 0x1900, 0x2a4f, 0x0000 }, + { 0x9900, 0x2a58, 0x4000 }, + { 0x9900, 0x2a54, 0x3000 }, + { 0x9900, 0x2a52, 0x2000 }, + { 0x1900, 0x2a51, 0x0000 }, + { 0x1900, 0x2a53, 0x0000 }, + { 0x9900, 0x2a56, 0x2000 }, + { 0x1900, 0x2a55, 0x0000 }, + { 0x1900, 0x2a57, 0x0000 }, + { 0x9900, 0x2a5c, 0x3000 }, + { 0x9900, 0x2a5a, 0x2000 }, + { 0x1900, 0x2a59, 0x0000 }, + { 0x1900, 0x2a5b, 0x0000 }, + { 0x9900, 0x2a5e, 0x2000 }, + { 0x1900, 0x2a5d, 0x0000 }, + { 0x1900, 0x2a5f, 0x0000 }, + { 0x9900, 0x2a80, 0x6000 }, + { 0x9900, 0x2a70, 0x5000 }, + { 0x9900, 0x2a68, 0x4000 }, + { 0x9900, 0x2a64, 0x3000 }, + { 0x9900, 0x2a62, 0x2000 }, + { 0x1900, 0x2a61, 0x0000 }, + { 0x1900, 0x2a63, 0x0000 }, + { 0x9900, 0x2a66, 0x2000 }, + { 0x1900, 0x2a65, 0x0000 }, + { 0x1900, 0x2a67, 0x0000 }, + { 0x9900, 0x2a6c, 0x3000 }, + { 0x9900, 0x2a6a, 0x2000 }, + { 0x1900, 0x2a69, 0x0000 }, + { 0x1900, 0x2a6b, 0x0000 }, + { 0x9900, 0x2a6e, 0x2000 }, + { 0x1900, 0x2a6d, 0x0000 }, + { 0x1900, 0x2a6f, 0x0000 }, + { 0x9900, 0x2a78, 0x4000 }, + { 0x9900, 0x2a74, 0x3000 }, + { 0x9900, 0x2a72, 0x2000 }, + { 0x1900, 0x2a71, 0x0000 }, + { 0x1900, 0x2a73, 0x0000 }, + { 0x9900, 0x2a76, 0x2000 }, + { 0x1900, 0x2a75, 0x0000 }, + { 0x1900, 0x2a77, 0x0000 }, + { 0x9900, 0x2a7c, 0x3000 }, + { 0x9900, 0x2a7a, 0x2000 }, + { 0x1900, 0x2a79, 0x0000 }, + { 0x1900, 0x2a7b, 0x0000 }, + { 0x9900, 0x2a7e, 0x2000 }, + { 0x1900, 0x2a7d, 0x0000 }, + { 0x1900, 0x2a7f, 0x0000 }, + { 0x9900, 0x2a90, 0x5000 }, + { 0x9900, 0x2a88, 0x4000 }, + { 0x9900, 0x2a84, 0x3000 }, + { 0x9900, 0x2a82, 0x2000 }, + { 0x1900, 0x2a81, 0x0000 }, + { 0x1900, 0x2a83, 0x0000 }, + { 0x9900, 0x2a86, 0x2000 }, + { 0x1900, 0x2a85, 0x0000 }, + { 0x1900, 0x2a87, 0x0000 }, + { 0x9900, 0x2a8c, 0x3000 }, + { 0x9900, 0x2a8a, 0x2000 }, + { 0x1900, 0x2a89, 0x0000 }, + { 0x1900, 0x2a8b, 0x0000 }, + { 0x9900, 0x2a8e, 0x2000 }, + { 0x1900, 0x2a8d, 0x0000 }, + { 0x1900, 0x2a8f, 0x0000 }, + { 0x9900, 0x2a98, 0x4000 }, + { 0x9900, 0x2a94, 0x3000 }, + { 0x9900, 0x2a92, 0x2000 }, + { 0x1900, 0x2a91, 0x0000 }, + { 0x1900, 0x2a93, 0x0000 }, + { 0x9900, 0x2a96, 0x2000 }, + { 0x1900, 0x2a95, 0x0000 }, + { 0x1900, 0x2a97, 0x0000 }, + { 0x9900, 0x2a9c, 0x3000 }, + { 0x9900, 0x2a9a, 0x2000 }, + { 0x1900, 0x2a99, 0x0000 }, + { 0x1900, 0x2a9b, 0x0000 }, + { 0x9900, 0x2a9e, 0x2000 }, + { 0x1900, 0x2a9d, 0x0000 }, + { 0x1900, 0x2a9f, 0x0000 }, + { 0x9a00, 0x2e92, 0x8000 }, + { 0x9900, 0x2ae0, 0x7000 }, + { 0x9900, 0x2ac0, 0x6000 }, + { 0x9900, 0x2ab0, 0x5000 }, + { 0x9900, 0x2aa8, 0x4000 }, + { 0x9900, 0x2aa4, 0x3000 }, + { 0x9900, 0x2aa2, 0x2000 }, + { 0x1900, 0x2aa1, 0x0000 }, + { 0x1900, 0x2aa3, 0x0000 }, + { 0x9900, 0x2aa6, 0x2000 }, + { 0x1900, 0x2aa5, 0x0000 }, + { 0x1900, 0x2aa7, 0x0000 }, + { 0x9900, 0x2aac, 0x3000 }, + { 0x9900, 0x2aaa, 0x2000 }, + { 0x1900, 0x2aa9, 0x0000 }, + { 0x1900, 0x2aab, 0x0000 }, + { 0x9900, 0x2aae, 0x2000 }, + { 0x1900, 0x2aad, 0x0000 }, + { 0x1900, 0x2aaf, 0x0000 }, + { 0x9900, 0x2ab8, 0x4000 }, + { 0x9900, 0x2ab4, 0x3000 }, + { 0x9900, 0x2ab2, 0x2000 }, + { 0x1900, 0x2ab1, 0x0000 }, + { 0x1900, 0x2ab3, 0x0000 }, + { 0x9900, 0x2ab6, 0x2000 }, + { 0x1900, 0x2ab5, 0x0000 }, + { 0x1900, 0x2ab7, 0x0000 }, + { 0x9900, 0x2abc, 0x3000 }, + { 0x9900, 0x2aba, 0x2000 }, + { 0x1900, 0x2ab9, 0x0000 }, + { 0x1900, 0x2abb, 0x0000 }, + { 0x9900, 0x2abe, 0x2000 }, + { 0x1900, 0x2abd, 0x0000 }, + { 0x1900, 0x2abf, 0x0000 }, + { 0x9900, 0x2ad0, 0x5000 }, + { 0x9900, 0x2ac8, 0x4000 }, + { 0x9900, 0x2ac4, 0x3000 }, + { 0x9900, 0x2ac2, 0x2000 }, + { 0x1900, 0x2ac1, 0x0000 }, + { 0x1900, 0x2ac3, 0x0000 }, + { 0x9900, 0x2ac6, 0x2000 }, + { 0x1900, 0x2ac5, 0x0000 }, + { 0x1900, 0x2ac7, 0x0000 }, + { 0x9900, 0x2acc, 0x3000 }, + { 0x9900, 0x2aca, 0x2000 }, + { 0x1900, 0x2ac9, 0x0000 }, + { 0x1900, 0x2acb, 0x0000 }, + { 0x9900, 0x2ace, 0x2000 }, + { 0x1900, 0x2acd, 0x0000 }, + { 0x1900, 0x2acf, 0x0000 }, + { 0x9900, 0x2ad8, 0x4000 }, + { 0x9900, 0x2ad4, 0x3000 }, + { 0x9900, 0x2ad2, 0x2000 }, + { 0x1900, 0x2ad1, 0x0000 }, + { 0x1900, 0x2ad3, 0x0000 }, + { 0x9900, 0x2ad6, 0x2000 }, + { 0x1900, 0x2ad5, 0x0000 }, + { 0x1900, 0x2ad7, 0x0000 }, + { 0x9900, 0x2adc, 0x3000 }, + { 0x9900, 0x2ada, 0x2000 }, + { 0x1900, 0x2ad9, 0x0000 }, + { 0x1900, 0x2adb, 0x0000 }, + { 0x9900, 0x2ade, 0x2000 }, + { 0x1900, 0x2add, 0x0000 }, + { 0x1900, 0x2adf, 0x0000 }, + { 0x9a00, 0x2b00, 0x6000 }, + { 0x9900, 0x2af0, 0x5000 }, + { 0x9900, 0x2ae8, 0x4000 }, + { 0x9900, 0x2ae4, 0x3000 }, + { 0x9900, 0x2ae2, 0x2000 }, + { 0x1900, 0x2ae1, 0x0000 }, + { 0x1900, 0x2ae3, 0x0000 }, + { 0x9900, 0x2ae6, 0x2000 }, + { 0x1900, 0x2ae5, 0x0000 }, + { 0x1900, 0x2ae7, 0x0000 }, + { 0x9900, 0x2aec, 0x3000 }, + { 0x9900, 0x2aea, 0x2000 }, + { 0x1900, 0x2ae9, 0x0000 }, + { 0x1900, 0x2aeb, 0x0000 }, + { 0x9900, 0x2aee, 0x2000 }, + { 0x1900, 0x2aed, 0x0000 }, + { 0x1900, 0x2aef, 0x0000 }, + { 0x9900, 0x2af8, 0x4000 }, + { 0x9900, 0x2af4, 0x3000 }, + { 0x9900, 0x2af2, 0x2000 }, + { 0x1900, 0x2af1, 0x0000 }, + { 0x1900, 0x2af3, 0x0000 }, + { 0x9900, 0x2af6, 0x2000 }, + { 0x1900, 0x2af5, 0x0000 }, + { 0x1900, 0x2af7, 0x0000 }, + { 0x9900, 0x2afc, 0x3000 }, + { 0x9900, 0x2afa, 0x2000 }, + { 0x1900, 0x2af9, 0x0000 }, + { 0x1900, 0x2afb, 0x0000 }, + { 0x9900, 0x2afe, 0x2000 }, + { 0x1900, 0x2afd, 0x0000 }, + { 0x1900, 0x2aff, 0x0000 }, + { 0x9a00, 0x2e82, 0x5000 }, + { 0x9a00, 0x2b08, 0x4000 }, + { 0x9a00, 0x2b04, 0x3000 }, + { 0x9a00, 0x2b02, 0x2000 }, + { 0x1a00, 0x2b01, 0x0000 }, + { 0x1a00, 0x2b03, 0x0000 }, + { 0x9a00, 0x2b06, 0x2000 }, + { 0x1a00, 0x2b05, 0x0000 }, + { 0x1a00, 0x2b07, 0x0000 }, + { 0x9a00, 0x2b0c, 0x3000 }, + { 0x9a00, 0x2b0a, 0x2000 }, + { 0x1a00, 0x2b09, 0x0000 }, + { 0x1a00, 0x2b0b, 0x0000 }, + { 0x9a00, 0x2e80, 0x2000 }, + { 0x1a00, 0x2b0d, 0x0000 }, + { 0x1a00, 0x2e81, 0x0000 }, + { 0x9a00, 0x2e8a, 0x4000 }, + { 0x9a00, 0x2e86, 0x3000 }, + { 0x9a00, 0x2e84, 0x2000 }, + { 0x1a00, 0x2e83, 0x0000 }, + { 0x1a00, 0x2e85, 0x0000 }, + { 0x9a00, 0x2e88, 0x2000 }, + { 0x1a00, 0x2e87, 0x0000 }, + { 0x1a00, 0x2e89, 0x0000 }, + { 0x9a00, 0x2e8e, 0x3000 }, + { 0x9a00, 0x2e8c, 0x2000 }, + { 0x1a00, 0x2e8b, 0x0000 }, + { 0x1a00, 0x2e8d, 0x0000 }, + { 0x9a00, 0x2e90, 0x2000 }, + { 0x1a00, 0x2e8f, 0x0000 }, + { 0x1a00, 0x2e91, 0x0000 }, + { 0x9a00, 0x2ed3, 0x7000 }, + { 0x9a00, 0x2eb3, 0x6000 }, + { 0x9a00, 0x2ea3, 0x5000 }, + { 0x9a00, 0x2e9b, 0x4000 }, + { 0x9a00, 0x2e96, 0x3000 }, + { 0x9a00, 0x2e94, 0x2000 }, + { 0x1a00, 0x2e93, 0x0000 }, + { 0x1a00, 0x2e95, 0x0000 }, + { 0x9a00, 0x2e98, 0x2000 }, + { 0x1a00, 0x2e97, 0x0000 }, + { 0x1a00, 0x2e99, 0x0000 }, + { 0x9a00, 0x2e9f, 0x3000 }, + { 0x9a00, 0x2e9d, 0x2000 }, + { 0x1a00, 0x2e9c, 0x0000 }, + { 0x1a00, 0x2e9e, 0x0000 }, + { 0x9a00, 0x2ea1, 0x2000 }, + { 0x1a00, 0x2ea0, 0x0000 }, + { 0x1a00, 0x2ea2, 0x0000 }, + { 0x9a00, 0x2eab, 0x4000 }, + { 0x9a00, 0x2ea7, 0x3000 }, + { 0x9a00, 0x2ea5, 0x2000 }, + { 0x1a00, 0x2ea4, 0x0000 }, + { 0x1a00, 0x2ea6, 0x0000 }, + { 0x9a00, 0x2ea9, 0x2000 }, + { 0x1a00, 0x2ea8, 0x0000 }, + { 0x1a00, 0x2eaa, 0x0000 }, + { 0x9a00, 0x2eaf, 0x3000 }, + { 0x9a00, 0x2ead, 0x2000 }, + { 0x1a00, 0x2eac, 0x0000 }, + { 0x1a00, 0x2eae, 0x0000 }, + { 0x9a00, 0x2eb1, 0x2000 }, + { 0x1a00, 0x2eb0, 0x0000 }, + { 0x1a00, 0x2eb2, 0x0000 }, + { 0x9a00, 0x2ec3, 0x5000 }, + { 0x9a00, 0x2ebb, 0x4000 }, + { 0x9a00, 0x2eb7, 0x3000 }, + { 0x9a00, 0x2eb5, 0x2000 }, + { 0x1a00, 0x2eb4, 0x0000 }, + { 0x1a00, 0x2eb6, 0x0000 }, + { 0x9a00, 0x2eb9, 0x2000 }, + { 0x1a00, 0x2eb8, 0x0000 }, + { 0x1a00, 0x2eba, 0x0000 }, + { 0x9a00, 0x2ebf, 0x3000 }, + { 0x9a00, 0x2ebd, 0x2000 }, + { 0x1a00, 0x2ebc, 0x0000 }, + { 0x1a00, 0x2ebe, 0x0000 }, + { 0x9a00, 0x2ec1, 0x2000 }, + { 0x1a00, 0x2ec0, 0x0000 }, + { 0x1a00, 0x2ec2, 0x0000 }, + { 0x9a00, 0x2ecb, 0x4000 }, + { 0x9a00, 0x2ec7, 0x3000 }, + { 0x9a00, 0x2ec5, 0x2000 }, + { 0x1a00, 0x2ec4, 0x0000 }, + { 0x1a00, 0x2ec6, 0x0000 }, + { 0x9a00, 0x2ec9, 0x2000 }, + { 0x1a00, 0x2ec8, 0x0000 }, + { 0x1a00, 0x2eca, 0x0000 }, + { 0x9a00, 0x2ecf, 0x3000 }, + { 0x9a00, 0x2ecd, 0x2000 }, + { 0x1a00, 0x2ecc, 0x0000 }, + { 0x1a00, 0x2ece, 0x0000 }, + { 0x9a00, 0x2ed1, 0x2000 }, + { 0x1a00, 0x2ed0, 0x0000 }, + { 0x1a00, 0x2ed2, 0x0000 }, + { 0x9a00, 0x2ef3, 0x6000 }, + { 0x9a00, 0x2ee3, 0x5000 }, + { 0x9a00, 0x2edb, 0x4000 }, + { 0x9a00, 0x2ed7, 0x3000 }, + { 0x9a00, 0x2ed5, 0x2000 }, + { 0x1a00, 0x2ed4, 0x0000 }, + { 0x1a00, 0x2ed6, 0x0000 }, + { 0x9a00, 0x2ed9, 0x2000 }, + { 0x1a00, 0x2ed8, 0x0000 }, + { 0x1a00, 0x2eda, 0x0000 }, + { 0x9a00, 0x2edf, 0x3000 }, + { 0x9a00, 0x2edd, 0x2000 }, + { 0x1a00, 0x2edc, 0x0000 }, + { 0x1a00, 0x2ede, 0x0000 }, + { 0x9a00, 0x2ee1, 0x2000 }, + { 0x1a00, 0x2ee0, 0x0000 }, + { 0x1a00, 0x2ee2, 0x0000 }, + { 0x9a00, 0x2eeb, 0x4000 }, + { 0x9a00, 0x2ee7, 0x3000 }, + { 0x9a00, 0x2ee5, 0x2000 }, + { 0x1a00, 0x2ee4, 0x0000 }, + { 0x1a00, 0x2ee6, 0x0000 }, + { 0x9a00, 0x2ee9, 0x2000 }, + { 0x1a00, 0x2ee8, 0x0000 }, + { 0x1a00, 0x2eea, 0x0000 }, + { 0x9a00, 0x2eef, 0x3000 }, + { 0x9a00, 0x2eed, 0x2000 }, + { 0x1a00, 0x2eec, 0x0000 }, + { 0x1a00, 0x2eee, 0x0000 }, + { 0x9a00, 0x2ef1, 0x2000 }, + { 0x1a00, 0x2ef0, 0x0000 }, + { 0x1a00, 0x2ef2, 0x0000 }, + { 0x9a00, 0x2f0f, 0x5000 }, + { 0x9a00, 0x2f07, 0x4000 }, + { 0x9a00, 0x2f03, 0x3000 }, + { 0x9a00, 0x2f01, 0x2000 }, + { 0x1a00, 0x2f00, 0x0000 }, + { 0x1a00, 0x2f02, 0x0000 }, + { 0x9a00, 0x2f05, 0x2000 }, + { 0x1a00, 0x2f04, 0x0000 }, + { 0x1a00, 0x2f06, 0x0000 }, + { 0x9a00, 0x2f0b, 0x3000 }, + { 0x9a00, 0x2f09, 0x2000 }, + { 0x1a00, 0x2f08, 0x0000 }, + { 0x1a00, 0x2f0a, 0x0000 }, + { 0x9a00, 0x2f0d, 0x2000 }, + { 0x1a00, 0x2f0c, 0x0000 }, + { 0x1a00, 0x2f0e, 0x0000 }, + { 0x9a00, 0x2f17, 0x4000 }, + { 0x9a00, 0x2f13, 0x3000 }, + { 0x9a00, 0x2f11, 0x2000 }, + { 0x1a00, 0x2f10, 0x0000 }, + { 0x1a00, 0x2f12, 0x0000 }, + { 0x9a00, 0x2f15, 0x2000 }, + { 0x1a00, 0x2f14, 0x0000 }, + { 0x1a00, 0x2f16, 0x0000 }, + { 0x9a00, 0x2f1b, 0x3000 }, + { 0x9a00, 0x2f19, 0x2000 }, + { 0x1a00, 0x2f18, 0x0000 }, + { 0x1a00, 0x2f1a, 0x0000 }, + { 0x9a00, 0x2f1d, 0x2000 }, + { 0x1a00, 0x2f1c, 0x0000 }, + { 0x1a00, 0x2f1e, 0x0000 }, + { 0x8701, 0x00f0, 0xd000 }, + { 0x8700, 0xa34d, 0xc000 }, + { 0x9a00, 0x3391, 0xb000 }, + { 0x8700, 0x3149, 0xa000 }, + { 0x9500, 0x303d, 0x9000 }, + { 0x9a00, 0x2f9f, 0x8000 }, + { 0x9a00, 0x2f5f, 0x7000 }, + { 0x9a00, 0x2f3f, 0x6000 }, + { 0x9a00, 0x2f2f, 0x5000 }, + { 0x9a00, 0x2f27, 0x4000 }, + { 0x9a00, 0x2f23, 0x3000 }, + { 0x9a00, 0x2f21, 0x2000 }, + { 0x1a00, 0x2f20, 0x0000 }, + { 0x1a00, 0x2f22, 0x0000 }, + { 0x9a00, 0x2f25, 0x2000 }, + { 0x1a00, 0x2f24, 0x0000 }, + { 0x1a00, 0x2f26, 0x0000 }, + { 0x9a00, 0x2f2b, 0x3000 }, + { 0x9a00, 0x2f29, 0x2000 }, + { 0x1a00, 0x2f28, 0x0000 }, + { 0x1a00, 0x2f2a, 0x0000 }, + { 0x9a00, 0x2f2d, 0x2000 }, + { 0x1a00, 0x2f2c, 0x0000 }, + { 0x1a00, 0x2f2e, 0x0000 }, + { 0x9a00, 0x2f37, 0x4000 }, + { 0x9a00, 0x2f33, 0x3000 }, + { 0x9a00, 0x2f31, 0x2000 }, + { 0x1a00, 0x2f30, 0x0000 }, + { 0x1a00, 0x2f32, 0x0000 }, + { 0x9a00, 0x2f35, 0x2000 }, + { 0x1a00, 0x2f34, 0x0000 }, + { 0x1a00, 0x2f36, 0x0000 }, + { 0x9a00, 0x2f3b, 0x3000 }, + { 0x9a00, 0x2f39, 0x2000 }, + { 0x1a00, 0x2f38, 0x0000 }, + { 0x1a00, 0x2f3a, 0x0000 }, + { 0x9a00, 0x2f3d, 0x2000 }, + { 0x1a00, 0x2f3c, 0x0000 }, + { 0x1a00, 0x2f3e, 0x0000 }, + { 0x9a00, 0x2f4f, 0x5000 }, + { 0x9a00, 0x2f47, 0x4000 }, + { 0x9a00, 0x2f43, 0x3000 }, + { 0x9a00, 0x2f41, 0x2000 }, + { 0x1a00, 0x2f40, 0x0000 }, + { 0x1a00, 0x2f42, 0x0000 }, + { 0x9a00, 0x2f45, 0x2000 }, + { 0x1a00, 0x2f44, 0x0000 }, + { 0x1a00, 0x2f46, 0x0000 }, + { 0x9a00, 0x2f4b, 0x3000 }, + { 0x9a00, 0x2f49, 0x2000 }, + { 0x1a00, 0x2f48, 0x0000 }, + { 0x1a00, 0x2f4a, 0x0000 }, + { 0x9a00, 0x2f4d, 0x2000 }, + { 0x1a00, 0x2f4c, 0x0000 }, + { 0x1a00, 0x2f4e, 0x0000 }, + { 0x9a00, 0x2f57, 0x4000 }, + { 0x9a00, 0x2f53, 0x3000 }, + { 0x9a00, 0x2f51, 0x2000 }, + { 0x1a00, 0x2f50, 0x0000 }, + { 0x1a00, 0x2f52, 0x0000 }, + { 0x9a00, 0x2f55, 0x2000 }, + { 0x1a00, 0x2f54, 0x0000 }, + { 0x1a00, 0x2f56, 0x0000 }, + { 0x9a00, 0x2f5b, 0x3000 }, + { 0x9a00, 0x2f59, 0x2000 }, + { 0x1a00, 0x2f58, 0x0000 }, + { 0x1a00, 0x2f5a, 0x0000 }, + { 0x9a00, 0x2f5d, 0x2000 }, + { 0x1a00, 0x2f5c, 0x0000 }, + { 0x1a00, 0x2f5e, 0x0000 }, + { 0x9a00, 0x2f7f, 0x6000 }, + { 0x9a00, 0x2f6f, 0x5000 }, + { 0x9a00, 0x2f67, 0x4000 }, + { 0x9a00, 0x2f63, 0x3000 }, + { 0x9a00, 0x2f61, 0x2000 }, + { 0x1a00, 0x2f60, 0x0000 }, + { 0x1a00, 0x2f62, 0x0000 }, + { 0x9a00, 0x2f65, 0x2000 }, + { 0x1a00, 0x2f64, 0x0000 }, + { 0x1a00, 0x2f66, 0x0000 }, + { 0x9a00, 0x2f6b, 0x3000 }, + { 0x9a00, 0x2f69, 0x2000 }, + { 0x1a00, 0x2f68, 0x0000 }, + { 0x1a00, 0x2f6a, 0x0000 }, + { 0x9a00, 0x2f6d, 0x2000 }, + { 0x1a00, 0x2f6c, 0x0000 }, + { 0x1a00, 0x2f6e, 0x0000 }, + { 0x9a00, 0x2f77, 0x4000 }, + { 0x9a00, 0x2f73, 0x3000 }, + { 0x9a00, 0x2f71, 0x2000 }, + { 0x1a00, 0x2f70, 0x0000 }, + { 0x1a00, 0x2f72, 0x0000 }, + { 0x9a00, 0x2f75, 0x2000 }, + { 0x1a00, 0x2f74, 0x0000 }, + { 0x1a00, 0x2f76, 0x0000 }, + { 0x9a00, 0x2f7b, 0x3000 }, + { 0x9a00, 0x2f79, 0x2000 }, + { 0x1a00, 0x2f78, 0x0000 }, + { 0x1a00, 0x2f7a, 0x0000 }, + { 0x9a00, 0x2f7d, 0x2000 }, + { 0x1a00, 0x2f7c, 0x0000 }, + { 0x1a00, 0x2f7e, 0x0000 }, + { 0x9a00, 0x2f8f, 0x5000 }, + { 0x9a00, 0x2f87, 0x4000 }, + { 0x9a00, 0x2f83, 0x3000 }, + { 0x9a00, 0x2f81, 0x2000 }, + { 0x1a00, 0x2f80, 0x0000 }, + { 0x1a00, 0x2f82, 0x0000 }, + { 0x9a00, 0x2f85, 0x2000 }, + { 0x1a00, 0x2f84, 0x0000 }, + { 0x1a00, 0x2f86, 0x0000 }, + { 0x9a00, 0x2f8b, 0x3000 }, + { 0x9a00, 0x2f89, 0x2000 }, + { 0x1a00, 0x2f88, 0x0000 }, + { 0x1a00, 0x2f8a, 0x0000 }, + { 0x9a00, 0x2f8d, 0x2000 }, + { 0x1a00, 0x2f8c, 0x0000 }, + { 0x1a00, 0x2f8e, 0x0000 }, + { 0x9a00, 0x2f97, 0x4000 }, + { 0x9a00, 0x2f93, 0x3000 }, + { 0x9a00, 0x2f91, 0x2000 }, + { 0x1a00, 0x2f90, 0x0000 }, + { 0x1a00, 0x2f92, 0x0000 }, + { 0x9a00, 0x2f95, 0x2000 }, + { 0x1a00, 0x2f94, 0x0000 }, + { 0x1a00, 0x2f96, 0x0000 }, + { 0x9a00, 0x2f9b, 0x3000 }, + { 0x9a00, 0x2f99, 0x2000 }, + { 0x1a00, 0x2f98, 0x0000 }, + { 0x1a00, 0x2f9a, 0x0000 }, + { 0x9a00, 0x2f9d, 0x2000 }, + { 0x1a00, 0x2f9c, 0x0000 }, + { 0x1a00, 0x2f9e, 0x0000 }, + { 0x9a00, 0x2ff9, 0x7000 }, + { 0x9a00, 0x2fbf, 0x6000 }, + { 0x9a00, 0x2faf, 0x5000 }, + { 0x9a00, 0x2fa7, 0x4000 }, + { 0x9a00, 0x2fa3, 0x3000 }, + { 0x9a00, 0x2fa1, 0x2000 }, + { 0x1a00, 0x2fa0, 0x0000 }, + { 0x1a00, 0x2fa2, 0x0000 }, + { 0x9a00, 0x2fa5, 0x2000 }, + { 0x1a00, 0x2fa4, 0x0000 }, + { 0x1a00, 0x2fa6, 0x0000 }, + { 0x9a00, 0x2fab, 0x3000 }, + { 0x9a00, 0x2fa9, 0x2000 }, + { 0x1a00, 0x2fa8, 0x0000 }, + { 0x1a00, 0x2faa, 0x0000 }, + { 0x9a00, 0x2fad, 0x2000 }, + { 0x1a00, 0x2fac, 0x0000 }, + { 0x1a00, 0x2fae, 0x0000 }, + { 0x9a00, 0x2fb7, 0x4000 }, + { 0x9a00, 0x2fb3, 0x3000 }, + { 0x9a00, 0x2fb1, 0x2000 }, + { 0x1a00, 0x2fb0, 0x0000 }, + { 0x1a00, 0x2fb2, 0x0000 }, + { 0x9a00, 0x2fb5, 0x2000 }, + { 0x1a00, 0x2fb4, 0x0000 }, + { 0x1a00, 0x2fb6, 0x0000 }, + { 0x9a00, 0x2fbb, 0x3000 }, + { 0x9a00, 0x2fb9, 0x2000 }, + { 0x1a00, 0x2fb8, 0x0000 }, + { 0x1a00, 0x2fba, 0x0000 }, + { 0x9a00, 0x2fbd, 0x2000 }, + { 0x1a00, 0x2fbc, 0x0000 }, + { 0x1a00, 0x2fbe, 0x0000 }, + { 0x9a00, 0x2fcf, 0x5000 }, + { 0x9a00, 0x2fc7, 0x4000 }, + { 0x9a00, 0x2fc3, 0x3000 }, + { 0x9a00, 0x2fc1, 0x2000 }, + { 0x1a00, 0x2fc0, 0x0000 }, + { 0x1a00, 0x2fc2, 0x0000 }, + { 0x9a00, 0x2fc5, 0x2000 }, + { 0x1a00, 0x2fc4, 0x0000 }, + { 0x1a00, 0x2fc6, 0x0000 }, + { 0x9a00, 0x2fcb, 0x3000 }, + { 0x9a00, 0x2fc9, 0x2000 }, + { 0x1a00, 0x2fc8, 0x0000 }, + { 0x1a00, 0x2fca, 0x0000 }, + { 0x9a00, 0x2fcd, 0x2000 }, + { 0x1a00, 0x2fcc, 0x0000 }, + { 0x1a00, 0x2fce, 0x0000 }, + { 0x9a00, 0x2ff1, 0x4000 }, + { 0x9a00, 0x2fd3, 0x3000 }, + { 0x9a00, 0x2fd1, 0x2000 }, + { 0x1a00, 0x2fd0, 0x0000 }, + { 0x1a00, 0x2fd2, 0x0000 }, + { 0x9a00, 0x2fd5, 0x2000 }, + { 0x1a00, 0x2fd4, 0x0000 }, + { 0x1a00, 0x2ff0, 0x0000 }, + { 0x9a00, 0x2ff5, 0x3000 }, + { 0x9a00, 0x2ff3, 0x2000 }, + { 0x1a00, 0x2ff2, 0x0000 }, + { 0x1a00, 0x2ff4, 0x0000 }, + { 0x9a00, 0x2ff7, 0x2000 }, + { 0x1a00, 0x2ff6, 0x0000 }, + { 0x1a00, 0x2ff8, 0x0000 }, + { 0x9600, 0x301d, 0x6000 }, + { 0x9200, 0x300d, 0x5000 }, + { 0x8600, 0x3005, 0x4000 }, + { 0x9500, 0x3001, 0x3000 }, + { 0x9a00, 0x2ffb, 0x2000 }, + { 0x1a00, 0x2ffa, 0x0000 }, + { 0x1d00, 0x3000, 0x0000 }, + { 0x9500, 0x3003, 0x2000 }, + { 0x1500, 0x3002, 0x0000 }, + { 0x1a00, 0x3004, 0x0000 }, + { 0x9200, 0x3009, 0x3000 }, + { 0x8e00, 0x3007, 0x2000 }, + { 0x0700, 0x3006, 0x0000 }, + { 0x1600, 0x3008, 0x0000 }, + { 0x9200, 0x300b, 0x2000 }, + { 0x1600, 0x300a, 0x0000 }, + { 0x1600, 0x300c, 0x0000 }, + { 0x9200, 0x3015, 0x4000 }, + { 0x9200, 0x3011, 0x3000 }, + { 0x9200, 0x300f, 0x2000 }, + { 0x1600, 0x300e, 0x0000 }, + { 0x1600, 0x3010, 0x0000 }, + { 0x9a00, 0x3013, 0x2000 }, + { 0x1a00, 0x3012, 0x0000 }, + { 0x1600, 0x3014, 0x0000 }, + { 0x9200, 0x3019, 0x3000 }, + { 0x9200, 0x3017, 0x2000 }, + { 0x1600, 0x3016, 0x0000 }, + { 0x1600, 0x3018, 0x0000 }, + { 0x9200, 0x301b, 0x2000 }, + { 0x1600, 0x301a, 0x0000 }, + { 0x1100, 0x301c, 0x0000 }, + { 0x8c00, 0x302d, 0x5000 }, + { 0x8e00, 0x3025, 0x4000 }, + { 0x8e00, 0x3021, 0x3000 }, + { 0x9200, 0x301f, 0x2000 }, + { 0x1200, 0x301e, 0x0000 }, + { 0x1a00, 0x3020, 0x0000 }, + { 0x8e00, 0x3023, 0x2000 }, + { 0x0e00, 0x3022, 0x0000 }, + { 0x0e00, 0x3024, 0x0000 }, + { 0x8e00, 0x3029, 0x3000 }, + { 0x8e00, 0x3027, 0x2000 }, + { 0x0e00, 0x3026, 0x0000 }, + { 0x0e00, 0x3028, 0x0000 }, + { 0x8c00, 0x302b, 0x2000 }, + { 0x0c00, 0x302a, 0x0000 }, + { 0x0c00, 0x302c, 0x0000 }, + { 0x8600, 0x3035, 0x4000 }, + { 0x8600, 0x3031, 0x3000 }, + { 0x8c00, 0x302f, 0x2000 }, + { 0x0c00, 0x302e, 0x0000 }, + { 0x1100, 0x3030, 0x0000 }, + { 0x8600, 0x3033, 0x2000 }, + { 0x0600, 0x3032, 0x0000 }, + { 0x0600, 0x3034, 0x0000 }, + { 0x8e00, 0x3039, 0x3000 }, + { 0x9a00, 0x3037, 0x2000 }, + { 0x1a00, 0x3036, 0x0000 }, + { 0x0e00, 0x3038, 0x0000 }, + { 0x8600, 0x303b, 0x2000 }, + { 0x0e00, 0x303a, 0x0000 }, + { 0x0700, 0x303c, 0x0000 }, + { 0x8700, 0x30c0, 0x8000 }, + { 0x8700, 0x307e, 0x7000 }, + { 0x8700, 0x305e, 0x6000 }, + { 0x8700, 0x304e, 0x5000 }, + { 0x8700, 0x3046, 0x4000 }, + { 0x8700, 0x3042, 0x3000 }, + { 0x9a00, 0x303f, 0x2000 }, + { 0x1a00, 0x303e, 0x0000 }, + { 0x0700, 0x3041, 0x0000 }, + { 0x8700, 0x3044, 0x2000 }, + { 0x0700, 0x3043, 0x0000 }, + { 0x0700, 0x3045, 0x0000 }, + { 0x8700, 0x304a, 0x3000 }, + { 0x8700, 0x3048, 0x2000 }, + { 0x0700, 0x3047, 0x0000 }, + { 0x0700, 0x3049, 0x0000 }, + { 0x8700, 0x304c, 0x2000 }, + { 0x0700, 0x304b, 0x0000 }, + { 0x0700, 0x304d, 0x0000 }, + { 0x8700, 0x3056, 0x4000 }, + { 0x8700, 0x3052, 0x3000 }, + { 0x8700, 0x3050, 0x2000 }, + { 0x0700, 0x304f, 0x0000 }, + { 0x0700, 0x3051, 0x0000 }, + { 0x8700, 0x3054, 0x2000 }, + { 0x0700, 0x3053, 0x0000 }, + { 0x0700, 0x3055, 0x0000 }, + { 0x8700, 0x305a, 0x3000 }, + { 0x8700, 0x3058, 0x2000 }, + { 0x0700, 0x3057, 0x0000 }, + { 0x0700, 0x3059, 0x0000 }, + { 0x8700, 0x305c, 0x2000 }, + { 0x0700, 0x305b, 0x0000 }, + { 0x0700, 0x305d, 0x0000 }, + { 0x8700, 0x306e, 0x5000 }, + { 0x8700, 0x3066, 0x4000 }, + { 0x8700, 0x3062, 0x3000 }, + { 0x8700, 0x3060, 0x2000 }, + { 0x0700, 0x305f, 0x0000 }, + { 0x0700, 0x3061, 0x0000 }, + { 0x8700, 0x3064, 0x2000 }, + { 0x0700, 0x3063, 0x0000 }, + { 0x0700, 0x3065, 0x0000 }, + { 0x8700, 0x306a, 0x3000 }, + { 0x8700, 0x3068, 0x2000 }, + { 0x0700, 0x3067, 0x0000 }, + { 0x0700, 0x3069, 0x0000 }, + { 0x8700, 0x306c, 0x2000 }, + { 0x0700, 0x306b, 0x0000 }, + { 0x0700, 0x306d, 0x0000 }, + { 0x8700, 0x3076, 0x4000 }, + { 0x8700, 0x3072, 0x3000 }, + { 0x8700, 0x3070, 0x2000 }, + { 0x0700, 0x306f, 0x0000 }, + { 0x0700, 0x3071, 0x0000 }, + { 0x8700, 0x3074, 0x2000 }, + { 0x0700, 0x3073, 0x0000 }, + { 0x0700, 0x3075, 0x0000 }, + { 0x8700, 0x307a, 0x3000 }, + { 0x8700, 0x3078, 0x2000 }, + { 0x0700, 0x3077, 0x0000 }, + { 0x0700, 0x3079, 0x0000 }, + { 0x8700, 0x307c, 0x2000 }, + { 0x0700, 0x307b, 0x0000 }, + { 0x0700, 0x307d, 0x0000 }, + { 0x9100, 0x30a0, 0x6000 }, + { 0x8700, 0x308e, 0x5000 }, + { 0x8700, 0x3086, 0x4000 }, + { 0x8700, 0x3082, 0x3000 }, + { 0x8700, 0x3080, 0x2000 }, + { 0x0700, 0x307f, 0x0000 }, + { 0x0700, 0x3081, 0x0000 }, + { 0x8700, 0x3084, 0x2000 }, + { 0x0700, 0x3083, 0x0000 }, + { 0x0700, 0x3085, 0x0000 }, + { 0x8700, 0x308a, 0x3000 }, + { 0x8700, 0x3088, 0x2000 }, + { 0x0700, 0x3087, 0x0000 }, + { 0x0700, 0x3089, 0x0000 }, + { 0x8700, 0x308c, 0x2000 }, + { 0x0700, 0x308b, 0x0000 }, + { 0x0700, 0x308d, 0x0000 }, + { 0x8700, 0x3096, 0x4000 }, + { 0x8700, 0x3092, 0x3000 }, + { 0x8700, 0x3090, 0x2000 }, + { 0x0700, 0x308f, 0x0000 }, + { 0x0700, 0x3091, 0x0000 }, + { 0x8700, 0x3094, 0x2000 }, + { 0x0700, 0x3093, 0x0000 }, + { 0x0700, 0x3095, 0x0000 }, + { 0x9800, 0x309c, 0x3000 }, + { 0x8c00, 0x309a, 0x2000 }, + { 0x0c00, 0x3099, 0x0000 }, + { 0x1800, 0x309b, 0x0000 }, + { 0x8600, 0x309e, 0x2000 }, + { 0x0600, 0x309d, 0x0000 }, + { 0x0700, 0x309f, 0x0000 }, + { 0x8700, 0x30b0, 0x5000 }, + { 0x8700, 0x30a8, 0x4000 }, + { 0x8700, 0x30a4, 0x3000 }, + { 0x8700, 0x30a2, 0x2000 }, + { 0x0700, 0x30a1, 0x0000 }, + { 0x0700, 0x30a3, 0x0000 }, + { 0x8700, 0x30a6, 0x2000 }, + { 0x0700, 0x30a5, 0x0000 }, + { 0x0700, 0x30a7, 0x0000 }, + { 0x8700, 0x30ac, 0x3000 }, + { 0x8700, 0x30aa, 0x2000 }, + { 0x0700, 0x30a9, 0x0000 }, + { 0x0700, 0x30ab, 0x0000 }, + { 0x8700, 0x30ae, 0x2000 }, + { 0x0700, 0x30ad, 0x0000 }, + { 0x0700, 0x30af, 0x0000 }, + { 0x8700, 0x30b8, 0x4000 }, + { 0x8700, 0x30b4, 0x3000 }, + { 0x8700, 0x30b2, 0x2000 }, + { 0x0700, 0x30b1, 0x0000 }, + { 0x0700, 0x30b3, 0x0000 }, + { 0x8700, 0x30b6, 0x2000 }, + { 0x0700, 0x30b5, 0x0000 }, + { 0x0700, 0x30b7, 0x0000 }, + { 0x8700, 0x30bc, 0x3000 }, + { 0x8700, 0x30ba, 0x2000 }, + { 0x0700, 0x30b9, 0x0000 }, + { 0x0700, 0x30bb, 0x0000 }, + { 0x8700, 0x30be, 0x2000 }, + { 0x0700, 0x30bd, 0x0000 }, + { 0x0700, 0x30bf, 0x0000 }, + { 0x8700, 0x3105, 0x7000 }, + { 0x8700, 0x30e0, 0x6000 }, + { 0x8700, 0x30d0, 0x5000 }, + { 0x8700, 0x30c8, 0x4000 }, + { 0x8700, 0x30c4, 0x3000 }, + { 0x8700, 0x30c2, 0x2000 }, + { 0x0700, 0x30c1, 0x0000 }, + { 0x0700, 0x30c3, 0x0000 }, + { 0x8700, 0x30c6, 0x2000 }, + { 0x0700, 0x30c5, 0x0000 }, + { 0x0700, 0x30c7, 0x0000 }, + { 0x8700, 0x30cc, 0x3000 }, + { 0x8700, 0x30ca, 0x2000 }, + { 0x0700, 0x30c9, 0x0000 }, + { 0x0700, 0x30cb, 0x0000 }, + { 0x8700, 0x30ce, 0x2000 }, + { 0x0700, 0x30cd, 0x0000 }, + { 0x0700, 0x30cf, 0x0000 }, + { 0x8700, 0x30d8, 0x4000 }, + { 0x8700, 0x30d4, 0x3000 }, + { 0x8700, 0x30d2, 0x2000 }, + { 0x0700, 0x30d1, 0x0000 }, + { 0x0700, 0x30d3, 0x0000 }, + { 0x8700, 0x30d6, 0x2000 }, + { 0x0700, 0x30d5, 0x0000 }, + { 0x0700, 0x30d7, 0x0000 }, + { 0x8700, 0x30dc, 0x3000 }, + { 0x8700, 0x30da, 0x2000 }, + { 0x0700, 0x30d9, 0x0000 }, + { 0x0700, 0x30db, 0x0000 }, + { 0x8700, 0x30de, 0x2000 }, + { 0x0700, 0x30dd, 0x0000 }, + { 0x0700, 0x30df, 0x0000 }, + { 0x8700, 0x30f0, 0x5000 }, + { 0x8700, 0x30e8, 0x4000 }, + { 0x8700, 0x30e4, 0x3000 }, + { 0x8700, 0x30e2, 0x2000 }, + { 0x0700, 0x30e1, 0x0000 }, + { 0x0700, 0x30e3, 0x0000 }, + { 0x8700, 0x30e6, 0x2000 }, + { 0x0700, 0x30e5, 0x0000 }, + { 0x0700, 0x30e7, 0x0000 }, + { 0x8700, 0x30ec, 0x3000 }, + { 0x8700, 0x30ea, 0x2000 }, + { 0x0700, 0x30e9, 0x0000 }, + { 0x0700, 0x30eb, 0x0000 }, + { 0x8700, 0x30ee, 0x2000 }, + { 0x0700, 0x30ed, 0x0000 }, + { 0x0700, 0x30ef, 0x0000 }, + { 0x8700, 0x30f8, 0x4000 }, + { 0x8700, 0x30f4, 0x3000 }, + { 0x8700, 0x30f2, 0x2000 }, + { 0x0700, 0x30f1, 0x0000 }, + { 0x0700, 0x30f3, 0x0000 }, + { 0x8700, 0x30f6, 0x2000 }, + { 0x0700, 0x30f5, 0x0000 }, + { 0x0700, 0x30f7, 0x0000 }, + { 0x8600, 0x30fc, 0x3000 }, + { 0x8700, 0x30fa, 0x2000 }, + { 0x0700, 0x30f9, 0x0000 }, + { 0x1000, 0x30fb, 0x0000 }, + { 0x8600, 0x30fe, 0x2000 }, + { 0x0600, 0x30fd, 0x0000 }, + { 0x0700, 0x30ff, 0x0000 }, + { 0x8700, 0x3125, 0x6000 }, + { 0x8700, 0x3115, 0x5000 }, + { 0x8700, 0x310d, 0x4000 }, + { 0x8700, 0x3109, 0x3000 }, + { 0x8700, 0x3107, 0x2000 }, + { 0x0700, 0x3106, 0x0000 }, + { 0x0700, 0x3108, 0x0000 }, + { 0x8700, 0x310b, 0x2000 }, + { 0x0700, 0x310a, 0x0000 }, + { 0x0700, 0x310c, 0x0000 }, + { 0x8700, 0x3111, 0x3000 }, + { 0x8700, 0x310f, 0x2000 }, + { 0x0700, 0x310e, 0x0000 }, + { 0x0700, 0x3110, 0x0000 }, + { 0x8700, 0x3113, 0x2000 }, + { 0x0700, 0x3112, 0x0000 }, + { 0x0700, 0x3114, 0x0000 }, + { 0x8700, 0x311d, 0x4000 }, + { 0x8700, 0x3119, 0x3000 }, + { 0x8700, 0x3117, 0x2000 }, + { 0x0700, 0x3116, 0x0000 }, + { 0x0700, 0x3118, 0x0000 }, + { 0x8700, 0x311b, 0x2000 }, + { 0x0700, 0x311a, 0x0000 }, + { 0x0700, 0x311c, 0x0000 }, + { 0x8700, 0x3121, 0x3000 }, + { 0x8700, 0x311f, 0x2000 }, + { 0x0700, 0x311e, 0x0000 }, + { 0x0700, 0x3120, 0x0000 }, + { 0x8700, 0x3123, 0x2000 }, + { 0x0700, 0x3122, 0x0000 }, + { 0x0700, 0x3124, 0x0000 }, + { 0x8700, 0x3139, 0x5000 }, + { 0x8700, 0x3131, 0x4000 }, + { 0x8700, 0x3129, 0x3000 }, + { 0x8700, 0x3127, 0x2000 }, + { 0x0700, 0x3126, 0x0000 }, + { 0x0700, 0x3128, 0x0000 }, + { 0x8700, 0x312b, 0x2000 }, + { 0x0700, 0x312a, 0x0000 }, + { 0x0700, 0x312c, 0x0000 }, + { 0x8700, 0x3135, 0x3000 }, + { 0x8700, 0x3133, 0x2000 }, + { 0x0700, 0x3132, 0x0000 }, + { 0x0700, 0x3134, 0x0000 }, + { 0x8700, 0x3137, 0x2000 }, + { 0x0700, 0x3136, 0x0000 }, + { 0x0700, 0x3138, 0x0000 }, + { 0x8700, 0x3141, 0x4000 }, + { 0x8700, 0x313d, 0x3000 }, + { 0x8700, 0x313b, 0x2000 }, + { 0x0700, 0x313a, 0x0000 }, + { 0x0700, 0x313c, 0x0000 }, + { 0x8700, 0x313f, 0x2000 }, + { 0x0700, 0x313e, 0x0000 }, + { 0x0700, 0x3140, 0x0000 }, + { 0x8700, 0x3145, 0x3000 }, + { 0x8700, 0x3143, 0x2000 }, + { 0x0700, 0x3142, 0x0000 }, + { 0x0700, 0x3144, 0x0000 }, + { 0x8700, 0x3147, 0x2000 }, + { 0x0700, 0x3146, 0x0000 }, + { 0x0700, 0x3148, 0x0000 }, + { 0x9a00, 0x3290, 0x9000 }, + { 0x9a00, 0x3202, 0x8000 }, + { 0x8700, 0x3189, 0x7000 }, + { 0x8700, 0x3169, 0x6000 }, + { 0x8700, 0x3159, 0x5000 }, + { 0x8700, 0x3151, 0x4000 }, + { 0x8700, 0x314d, 0x3000 }, + { 0x8700, 0x314b, 0x2000 }, + { 0x0700, 0x314a, 0x0000 }, + { 0x0700, 0x314c, 0x0000 }, + { 0x8700, 0x314f, 0x2000 }, + { 0x0700, 0x314e, 0x0000 }, + { 0x0700, 0x3150, 0x0000 }, + { 0x8700, 0x3155, 0x3000 }, + { 0x8700, 0x3153, 0x2000 }, + { 0x0700, 0x3152, 0x0000 }, + { 0x0700, 0x3154, 0x0000 }, + { 0x8700, 0x3157, 0x2000 }, + { 0x0700, 0x3156, 0x0000 }, + { 0x0700, 0x3158, 0x0000 }, + { 0x8700, 0x3161, 0x4000 }, + { 0x8700, 0x315d, 0x3000 }, + { 0x8700, 0x315b, 0x2000 }, + { 0x0700, 0x315a, 0x0000 }, + { 0x0700, 0x315c, 0x0000 }, + { 0x8700, 0x315f, 0x2000 }, + { 0x0700, 0x315e, 0x0000 }, + { 0x0700, 0x3160, 0x0000 }, + { 0x8700, 0x3165, 0x3000 }, + { 0x8700, 0x3163, 0x2000 }, + { 0x0700, 0x3162, 0x0000 }, + { 0x0700, 0x3164, 0x0000 }, + { 0x8700, 0x3167, 0x2000 }, + { 0x0700, 0x3166, 0x0000 }, + { 0x0700, 0x3168, 0x0000 }, + { 0x8700, 0x3179, 0x5000 }, + { 0x8700, 0x3171, 0x4000 }, + { 0x8700, 0x316d, 0x3000 }, + { 0x8700, 0x316b, 0x2000 }, + { 0x0700, 0x316a, 0x0000 }, + { 0x0700, 0x316c, 0x0000 }, + { 0x8700, 0x316f, 0x2000 }, + { 0x0700, 0x316e, 0x0000 }, + { 0x0700, 0x3170, 0x0000 }, + { 0x8700, 0x3175, 0x3000 }, + { 0x8700, 0x3173, 0x2000 }, + { 0x0700, 0x3172, 0x0000 }, + { 0x0700, 0x3174, 0x0000 }, + { 0x8700, 0x3177, 0x2000 }, + { 0x0700, 0x3176, 0x0000 }, + { 0x0700, 0x3178, 0x0000 }, + { 0x8700, 0x3181, 0x4000 }, + { 0x8700, 0x317d, 0x3000 }, + { 0x8700, 0x317b, 0x2000 }, + { 0x0700, 0x317a, 0x0000 }, + { 0x0700, 0x317c, 0x0000 }, + { 0x8700, 0x317f, 0x2000 }, + { 0x0700, 0x317e, 0x0000 }, + { 0x0700, 0x3180, 0x0000 }, + { 0x8700, 0x3185, 0x3000 }, + { 0x8700, 0x3183, 0x2000 }, + { 0x0700, 0x3182, 0x0000 }, + { 0x0700, 0x3184, 0x0000 }, + { 0x8700, 0x3187, 0x2000 }, + { 0x0700, 0x3186, 0x0000 }, + { 0x0700, 0x3188, 0x0000 }, + { 0x8700, 0x31aa, 0x6000 }, + { 0x9a00, 0x319a, 0x5000 }, + { 0x8f00, 0x3192, 0x4000 }, + { 0x8700, 0x318d, 0x3000 }, + { 0x8700, 0x318b, 0x2000 }, + { 0x0700, 0x318a, 0x0000 }, + { 0x0700, 0x318c, 0x0000 }, + { 0x9a00, 0x3190, 0x2000 }, + { 0x0700, 0x318e, 0x0000 }, + { 0x1a00, 0x3191, 0x0000 }, + { 0x9a00, 0x3196, 0x3000 }, + { 0x8f00, 0x3194, 0x2000 }, + { 0x0f00, 0x3193, 0x0000 }, + { 0x0f00, 0x3195, 0x0000 }, + { 0x9a00, 0x3198, 0x2000 }, + { 0x1a00, 0x3197, 0x0000 }, + { 0x1a00, 0x3199, 0x0000 }, + { 0x8700, 0x31a2, 0x4000 }, + { 0x9a00, 0x319e, 0x3000 }, + { 0x9a00, 0x319c, 0x2000 }, + { 0x1a00, 0x319b, 0x0000 }, + { 0x1a00, 0x319d, 0x0000 }, + { 0x8700, 0x31a0, 0x2000 }, + { 0x1a00, 0x319f, 0x0000 }, + { 0x0700, 0x31a1, 0x0000 }, + { 0x8700, 0x31a6, 0x3000 }, + { 0x8700, 0x31a4, 0x2000 }, + { 0x0700, 0x31a3, 0x0000 }, + { 0x0700, 0x31a5, 0x0000 }, + { 0x8700, 0x31a8, 0x2000 }, + { 0x0700, 0x31a7, 0x0000 }, + { 0x0700, 0x31a9, 0x0000 }, + { 0x8700, 0x31f2, 0x5000 }, + { 0x8700, 0x31b2, 0x4000 }, + { 0x8700, 0x31ae, 0x3000 }, + { 0x8700, 0x31ac, 0x2000 }, + { 0x0700, 0x31ab, 0x0000 }, + { 0x0700, 0x31ad, 0x0000 }, + { 0x8700, 0x31b0, 0x2000 }, + { 0x0700, 0x31af, 0x0000 }, + { 0x0700, 0x31b1, 0x0000 }, + { 0x8700, 0x31b6, 0x3000 }, + { 0x8700, 0x31b4, 0x2000 }, + { 0x0700, 0x31b3, 0x0000 }, + { 0x0700, 0x31b5, 0x0000 }, + { 0x8700, 0x31f0, 0x2000 }, + { 0x0700, 0x31b7, 0x0000 }, + { 0x0700, 0x31f1, 0x0000 }, + { 0x8700, 0x31fa, 0x4000 }, + { 0x8700, 0x31f6, 0x3000 }, + { 0x8700, 0x31f4, 0x2000 }, + { 0x0700, 0x31f3, 0x0000 }, + { 0x0700, 0x31f5, 0x0000 }, + { 0x8700, 0x31f8, 0x2000 }, + { 0x0700, 0x31f7, 0x0000 }, + { 0x0700, 0x31f9, 0x0000 }, + { 0x8700, 0x31fe, 0x3000 }, + { 0x8700, 0x31fc, 0x2000 }, + { 0x0700, 0x31fb, 0x0000 }, + { 0x0700, 0x31fd, 0x0000 }, + { 0x9a00, 0x3200, 0x2000 }, + { 0x0700, 0x31ff, 0x0000 }, + { 0x1a00, 0x3201, 0x0000 }, + { 0x9a00, 0x3243, 0x7000 }, + { 0x8f00, 0x3223, 0x6000 }, + { 0x9a00, 0x3212, 0x5000 }, + { 0x9a00, 0x320a, 0x4000 }, + { 0x9a00, 0x3206, 0x3000 }, + { 0x9a00, 0x3204, 0x2000 }, + { 0x1a00, 0x3203, 0x0000 }, + { 0x1a00, 0x3205, 0x0000 }, + { 0x9a00, 0x3208, 0x2000 }, + { 0x1a00, 0x3207, 0x0000 }, + { 0x1a00, 0x3209, 0x0000 }, + { 0x9a00, 0x320e, 0x3000 }, + { 0x9a00, 0x320c, 0x2000 }, + { 0x1a00, 0x320b, 0x0000 }, + { 0x1a00, 0x320d, 0x0000 }, + { 0x9a00, 0x3210, 0x2000 }, + { 0x1a00, 0x320f, 0x0000 }, + { 0x1a00, 0x3211, 0x0000 }, + { 0x9a00, 0x321a, 0x4000 }, + { 0x9a00, 0x3216, 0x3000 }, + { 0x9a00, 0x3214, 0x2000 }, + { 0x1a00, 0x3213, 0x0000 }, + { 0x1a00, 0x3215, 0x0000 }, + { 0x9a00, 0x3218, 0x2000 }, + { 0x1a00, 0x3217, 0x0000 }, + { 0x1a00, 0x3219, 0x0000 }, + { 0x9a00, 0x321e, 0x3000 }, + { 0x9a00, 0x321c, 0x2000 }, + { 0x1a00, 0x321b, 0x0000 }, + { 0x1a00, 0x321d, 0x0000 }, + { 0x8f00, 0x3221, 0x2000 }, + { 0x0f00, 0x3220, 0x0000 }, + { 0x0f00, 0x3222, 0x0000 }, + { 0x9a00, 0x3233, 0x5000 }, + { 0x9a00, 0x322b, 0x4000 }, + { 0x8f00, 0x3227, 0x3000 }, + { 0x8f00, 0x3225, 0x2000 }, + { 0x0f00, 0x3224, 0x0000 }, + { 0x0f00, 0x3226, 0x0000 }, + { 0x8f00, 0x3229, 0x2000 }, + { 0x0f00, 0x3228, 0x0000 }, + { 0x1a00, 0x322a, 0x0000 }, + { 0x9a00, 0x322f, 0x3000 }, + { 0x9a00, 0x322d, 0x2000 }, + { 0x1a00, 0x322c, 0x0000 }, + { 0x1a00, 0x322e, 0x0000 }, + { 0x9a00, 0x3231, 0x2000 }, + { 0x1a00, 0x3230, 0x0000 }, + { 0x1a00, 0x3232, 0x0000 }, + { 0x9a00, 0x323b, 0x4000 }, + { 0x9a00, 0x3237, 0x3000 }, + { 0x9a00, 0x3235, 0x2000 }, + { 0x1a00, 0x3234, 0x0000 }, + { 0x1a00, 0x3236, 0x0000 }, + { 0x9a00, 0x3239, 0x2000 }, + { 0x1a00, 0x3238, 0x0000 }, + { 0x1a00, 0x323a, 0x0000 }, + { 0x9a00, 0x323f, 0x3000 }, + { 0x9a00, 0x323d, 0x2000 }, + { 0x1a00, 0x323c, 0x0000 }, + { 0x1a00, 0x323e, 0x0000 }, + { 0x9a00, 0x3241, 0x2000 }, + { 0x1a00, 0x3240, 0x0000 }, + { 0x1a00, 0x3242, 0x0000 }, + { 0x9a00, 0x326f, 0x6000 }, + { 0x8f00, 0x325f, 0x5000 }, + { 0x8f00, 0x3257, 0x4000 }, + { 0x8f00, 0x3253, 0x3000 }, + { 0x8f00, 0x3251, 0x2000 }, + { 0x1a00, 0x3250, 0x0000 }, + { 0x0f00, 0x3252, 0x0000 }, + { 0x8f00, 0x3255, 0x2000 }, + { 0x0f00, 0x3254, 0x0000 }, + { 0x0f00, 0x3256, 0x0000 }, + { 0x8f00, 0x325b, 0x3000 }, + { 0x8f00, 0x3259, 0x2000 }, + { 0x0f00, 0x3258, 0x0000 }, + { 0x0f00, 0x325a, 0x0000 }, + { 0x8f00, 0x325d, 0x2000 }, + { 0x0f00, 0x325c, 0x0000 }, + { 0x0f00, 0x325e, 0x0000 }, + { 0x9a00, 0x3267, 0x4000 }, + { 0x9a00, 0x3263, 0x3000 }, + { 0x9a00, 0x3261, 0x2000 }, + { 0x1a00, 0x3260, 0x0000 }, + { 0x1a00, 0x3262, 0x0000 }, + { 0x9a00, 0x3265, 0x2000 }, + { 0x1a00, 0x3264, 0x0000 }, + { 0x1a00, 0x3266, 0x0000 }, + { 0x9a00, 0x326b, 0x3000 }, + { 0x9a00, 0x3269, 0x2000 }, + { 0x1a00, 0x3268, 0x0000 }, + { 0x1a00, 0x326a, 0x0000 }, + { 0x9a00, 0x326d, 0x2000 }, + { 0x1a00, 0x326c, 0x0000 }, + { 0x1a00, 0x326e, 0x0000 }, + { 0x8f00, 0x3280, 0x5000 }, + { 0x9a00, 0x3277, 0x4000 }, + { 0x9a00, 0x3273, 0x3000 }, + { 0x9a00, 0x3271, 0x2000 }, + { 0x1a00, 0x3270, 0x0000 }, + { 0x1a00, 0x3272, 0x0000 }, + { 0x9a00, 0x3275, 0x2000 }, + { 0x1a00, 0x3274, 0x0000 }, + { 0x1a00, 0x3276, 0x0000 }, + { 0x9a00, 0x327b, 0x3000 }, + { 0x9a00, 0x3279, 0x2000 }, + { 0x1a00, 0x3278, 0x0000 }, + { 0x1a00, 0x327a, 0x0000 }, + { 0x9a00, 0x327d, 0x2000 }, + { 0x1a00, 0x327c, 0x0000 }, + { 0x1a00, 0x327f, 0x0000 }, + { 0x8f00, 0x3288, 0x4000 }, + { 0x8f00, 0x3284, 0x3000 }, + { 0x8f00, 0x3282, 0x2000 }, + { 0x0f00, 0x3281, 0x0000 }, + { 0x0f00, 0x3283, 0x0000 }, + { 0x8f00, 0x3286, 0x2000 }, + { 0x0f00, 0x3285, 0x0000 }, + { 0x0f00, 0x3287, 0x0000 }, + { 0x9a00, 0x328c, 0x3000 }, + { 0x9a00, 0x328a, 0x2000 }, + { 0x0f00, 0x3289, 0x0000 }, + { 0x1a00, 0x328b, 0x0000 }, + { 0x9a00, 0x328e, 0x2000 }, + { 0x1a00, 0x328d, 0x0000 }, + { 0x1a00, 0x328f, 0x0000 }, + { 0x9a00, 0x3311, 0x8000 }, + { 0x9a00, 0x32d0, 0x7000 }, + { 0x9a00, 0x32b0, 0x6000 }, + { 0x9a00, 0x32a0, 0x5000 }, + { 0x9a00, 0x3298, 0x4000 }, + { 0x9a00, 0x3294, 0x3000 }, + { 0x9a00, 0x3292, 0x2000 }, + { 0x1a00, 0x3291, 0x0000 }, + { 0x1a00, 0x3293, 0x0000 }, + { 0x9a00, 0x3296, 0x2000 }, + { 0x1a00, 0x3295, 0x0000 }, + { 0x1a00, 0x3297, 0x0000 }, + { 0x9a00, 0x329c, 0x3000 }, + { 0x9a00, 0x329a, 0x2000 }, + { 0x1a00, 0x3299, 0x0000 }, + { 0x1a00, 0x329b, 0x0000 }, + { 0x9a00, 0x329e, 0x2000 }, + { 0x1a00, 0x329d, 0x0000 }, + { 0x1a00, 0x329f, 0x0000 }, + { 0x9a00, 0x32a8, 0x4000 }, + { 0x9a00, 0x32a4, 0x3000 }, + { 0x9a00, 0x32a2, 0x2000 }, + { 0x1a00, 0x32a1, 0x0000 }, + { 0x1a00, 0x32a3, 0x0000 }, + { 0x9a00, 0x32a6, 0x2000 }, + { 0x1a00, 0x32a5, 0x0000 }, + { 0x1a00, 0x32a7, 0x0000 }, + { 0x9a00, 0x32ac, 0x3000 }, + { 0x9a00, 0x32aa, 0x2000 }, + { 0x1a00, 0x32a9, 0x0000 }, + { 0x1a00, 0x32ab, 0x0000 }, + { 0x9a00, 0x32ae, 0x2000 }, + { 0x1a00, 0x32ad, 0x0000 }, + { 0x1a00, 0x32af, 0x0000 }, + { 0x9a00, 0x32c0, 0x5000 }, + { 0x8f00, 0x32b8, 0x4000 }, + { 0x8f00, 0x32b4, 0x3000 }, + { 0x8f00, 0x32b2, 0x2000 }, + { 0x0f00, 0x32b1, 0x0000 }, + { 0x0f00, 0x32b3, 0x0000 }, + { 0x8f00, 0x32b6, 0x2000 }, + { 0x0f00, 0x32b5, 0x0000 }, + { 0x0f00, 0x32b7, 0x0000 }, + { 0x8f00, 0x32bc, 0x3000 }, + { 0x8f00, 0x32ba, 0x2000 }, + { 0x0f00, 0x32b9, 0x0000 }, + { 0x0f00, 0x32bb, 0x0000 }, + { 0x8f00, 0x32be, 0x2000 }, + { 0x0f00, 0x32bd, 0x0000 }, + { 0x0f00, 0x32bf, 0x0000 }, + { 0x9a00, 0x32c8, 0x4000 }, + { 0x9a00, 0x32c4, 0x3000 }, + { 0x9a00, 0x32c2, 0x2000 }, + { 0x1a00, 0x32c1, 0x0000 }, + { 0x1a00, 0x32c3, 0x0000 }, + { 0x9a00, 0x32c6, 0x2000 }, + { 0x1a00, 0x32c5, 0x0000 }, + { 0x1a00, 0x32c7, 0x0000 }, + { 0x9a00, 0x32cc, 0x3000 }, + { 0x9a00, 0x32ca, 0x2000 }, + { 0x1a00, 0x32c9, 0x0000 }, + { 0x1a00, 0x32cb, 0x0000 }, + { 0x9a00, 0x32ce, 0x2000 }, + { 0x1a00, 0x32cd, 0x0000 }, + { 0x1a00, 0x32cf, 0x0000 }, + { 0x9a00, 0x32f0, 0x6000 }, + { 0x9a00, 0x32e0, 0x5000 }, + { 0x9a00, 0x32d8, 0x4000 }, + { 0x9a00, 0x32d4, 0x3000 }, + { 0x9a00, 0x32d2, 0x2000 }, + { 0x1a00, 0x32d1, 0x0000 }, + { 0x1a00, 0x32d3, 0x0000 }, + { 0x9a00, 0x32d6, 0x2000 }, + { 0x1a00, 0x32d5, 0x0000 }, + { 0x1a00, 0x32d7, 0x0000 }, + { 0x9a00, 0x32dc, 0x3000 }, + { 0x9a00, 0x32da, 0x2000 }, + { 0x1a00, 0x32d9, 0x0000 }, + { 0x1a00, 0x32db, 0x0000 }, + { 0x9a00, 0x32de, 0x2000 }, + { 0x1a00, 0x32dd, 0x0000 }, + { 0x1a00, 0x32df, 0x0000 }, + { 0x9a00, 0x32e8, 0x4000 }, + { 0x9a00, 0x32e4, 0x3000 }, + { 0x9a00, 0x32e2, 0x2000 }, + { 0x1a00, 0x32e1, 0x0000 }, + { 0x1a00, 0x32e3, 0x0000 }, + { 0x9a00, 0x32e6, 0x2000 }, + { 0x1a00, 0x32e5, 0x0000 }, + { 0x1a00, 0x32e7, 0x0000 }, + { 0x9a00, 0x32ec, 0x3000 }, + { 0x9a00, 0x32ea, 0x2000 }, + { 0x1a00, 0x32e9, 0x0000 }, + { 0x1a00, 0x32eb, 0x0000 }, + { 0x9a00, 0x32ee, 0x2000 }, + { 0x1a00, 0x32ed, 0x0000 }, + { 0x1a00, 0x32ef, 0x0000 }, + { 0x9a00, 0x3301, 0x5000 }, + { 0x9a00, 0x32f8, 0x4000 }, + { 0x9a00, 0x32f4, 0x3000 }, + { 0x9a00, 0x32f2, 0x2000 }, + { 0x1a00, 0x32f1, 0x0000 }, + { 0x1a00, 0x32f3, 0x0000 }, + { 0x9a00, 0x32f6, 0x2000 }, + { 0x1a00, 0x32f5, 0x0000 }, + { 0x1a00, 0x32f7, 0x0000 }, + { 0x9a00, 0x32fc, 0x3000 }, + { 0x9a00, 0x32fa, 0x2000 }, + { 0x1a00, 0x32f9, 0x0000 }, + { 0x1a00, 0x32fb, 0x0000 }, + { 0x9a00, 0x32fe, 0x2000 }, + { 0x1a00, 0x32fd, 0x0000 }, + { 0x1a00, 0x3300, 0x0000 }, + { 0x9a00, 0x3309, 0x4000 }, + { 0x9a00, 0x3305, 0x3000 }, + { 0x9a00, 0x3303, 0x2000 }, + { 0x1a00, 0x3302, 0x0000 }, + { 0x1a00, 0x3304, 0x0000 }, + { 0x9a00, 0x3307, 0x2000 }, + { 0x1a00, 0x3306, 0x0000 }, + { 0x1a00, 0x3308, 0x0000 }, + { 0x9a00, 0x330d, 0x3000 }, + { 0x9a00, 0x330b, 0x2000 }, + { 0x1a00, 0x330a, 0x0000 }, + { 0x1a00, 0x330c, 0x0000 }, + { 0x9a00, 0x330f, 0x2000 }, + { 0x1a00, 0x330e, 0x0000 }, + { 0x1a00, 0x3310, 0x0000 }, + { 0x9a00, 0x3351, 0x7000 }, + { 0x9a00, 0x3331, 0x6000 }, + { 0x9a00, 0x3321, 0x5000 }, + { 0x9a00, 0x3319, 0x4000 }, + { 0x9a00, 0x3315, 0x3000 }, + { 0x9a00, 0x3313, 0x2000 }, + { 0x1a00, 0x3312, 0x0000 }, + { 0x1a00, 0x3314, 0x0000 }, + { 0x9a00, 0x3317, 0x2000 }, + { 0x1a00, 0x3316, 0x0000 }, + { 0x1a00, 0x3318, 0x0000 }, + { 0x9a00, 0x331d, 0x3000 }, + { 0x9a00, 0x331b, 0x2000 }, + { 0x1a00, 0x331a, 0x0000 }, + { 0x1a00, 0x331c, 0x0000 }, + { 0x9a00, 0x331f, 0x2000 }, + { 0x1a00, 0x331e, 0x0000 }, + { 0x1a00, 0x3320, 0x0000 }, + { 0x9a00, 0x3329, 0x4000 }, + { 0x9a00, 0x3325, 0x3000 }, + { 0x9a00, 0x3323, 0x2000 }, + { 0x1a00, 0x3322, 0x0000 }, + { 0x1a00, 0x3324, 0x0000 }, + { 0x9a00, 0x3327, 0x2000 }, + { 0x1a00, 0x3326, 0x0000 }, + { 0x1a00, 0x3328, 0x0000 }, + { 0x9a00, 0x332d, 0x3000 }, + { 0x9a00, 0x332b, 0x2000 }, + { 0x1a00, 0x332a, 0x0000 }, + { 0x1a00, 0x332c, 0x0000 }, + { 0x9a00, 0x332f, 0x2000 }, + { 0x1a00, 0x332e, 0x0000 }, + { 0x1a00, 0x3330, 0x0000 }, + { 0x9a00, 0x3341, 0x5000 }, + { 0x9a00, 0x3339, 0x4000 }, + { 0x9a00, 0x3335, 0x3000 }, + { 0x9a00, 0x3333, 0x2000 }, + { 0x1a00, 0x3332, 0x0000 }, + { 0x1a00, 0x3334, 0x0000 }, + { 0x9a00, 0x3337, 0x2000 }, + { 0x1a00, 0x3336, 0x0000 }, + { 0x1a00, 0x3338, 0x0000 }, + { 0x9a00, 0x333d, 0x3000 }, + { 0x9a00, 0x333b, 0x2000 }, + { 0x1a00, 0x333a, 0x0000 }, + { 0x1a00, 0x333c, 0x0000 }, + { 0x9a00, 0x333f, 0x2000 }, + { 0x1a00, 0x333e, 0x0000 }, + { 0x1a00, 0x3340, 0x0000 }, + { 0x9a00, 0x3349, 0x4000 }, + { 0x9a00, 0x3345, 0x3000 }, + { 0x9a00, 0x3343, 0x2000 }, + { 0x1a00, 0x3342, 0x0000 }, + { 0x1a00, 0x3344, 0x0000 }, + { 0x9a00, 0x3347, 0x2000 }, + { 0x1a00, 0x3346, 0x0000 }, + { 0x1a00, 0x3348, 0x0000 }, + { 0x9a00, 0x334d, 0x3000 }, + { 0x9a00, 0x334b, 0x2000 }, + { 0x1a00, 0x334a, 0x0000 }, + { 0x1a00, 0x334c, 0x0000 }, + { 0x9a00, 0x334f, 0x2000 }, + { 0x1a00, 0x334e, 0x0000 }, + { 0x1a00, 0x3350, 0x0000 }, + { 0x9a00, 0x3371, 0x6000 }, + { 0x9a00, 0x3361, 0x5000 }, + { 0x9a00, 0x3359, 0x4000 }, + { 0x9a00, 0x3355, 0x3000 }, + { 0x9a00, 0x3353, 0x2000 }, + { 0x1a00, 0x3352, 0x0000 }, + { 0x1a00, 0x3354, 0x0000 }, + { 0x9a00, 0x3357, 0x2000 }, + { 0x1a00, 0x3356, 0x0000 }, + { 0x1a00, 0x3358, 0x0000 }, + { 0x9a00, 0x335d, 0x3000 }, + { 0x9a00, 0x335b, 0x2000 }, + { 0x1a00, 0x335a, 0x0000 }, + { 0x1a00, 0x335c, 0x0000 }, + { 0x9a00, 0x335f, 0x2000 }, + { 0x1a00, 0x335e, 0x0000 }, + { 0x1a00, 0x3360, 0x0000 }, + { 0x9a00, 0x3369, 0x4000 }, + { 0x9a00, 0x3365, 0x3000 }, + { 0x9a00, 0x3363, 0x2000 }, + { 0x1a00, 0x3362, 0x0000 }, + { 0x1a00, 0x3364, 0x0000 }, + { 0x9a00, 0x3367, 0x2000 }, + { 0x1a00, 0x3366, 0x0000 }, + { 0x1a00, 0x3368, 0x0000 }, + { 0x9a00, 0x336d, 0x3000 }, + { 0x9a00, 0x336b, 0x2000 }, + { 0x1a00, 0x336a, 0x0000 }, + { 0x1a00, 0x336c, 0x0000 }, + { 0x9a00, 0x336f, 0x2000 }, + { 0x1a00, 0x336e, 0x0000 }, + { 0x1a00, 0x3370, 0x0000 }, + { 0x9a00, 0x3381, 0x5000 }, + { 0x9a00, 0x3379, 0x4000 }, + { 0x9a00, 0x3375, 0x3000 }, + { 0x9a00, 0x3373, 0x2000 }, + { 0x1a00, 0x3372, 0x0000 }, + { 0x1a00, 0x3374, 0x0000 }, + { 0x9a00, 0x3377, 0x2000 }, + { 0x1a00, 0x3376, 0x0000 }, + { 0x1a00, 0x3378, 0x0000 }, + { 0x9a00, 0x337d, 0x3000 }, + { 0x9a00, 0x337b, 0x2000 }, + { 0x1a00, 0x337a, 0x0000 }, + { 0x1a00, 0x337c, 0x0000 }, + { 0x9a00, 0x337f, 0x2000 }, + { 0x1a00, 0x337e, 0x0000 }, + { 0x1a00, 0x3380, 0x0000 }, + { 0x9a00, 0x3389, 0x4000 }, + { 0x9a00, 0x3385, 0x3000 }, + { 0x9a00, 0x3383, 0x2000 }, + { 0x1a00, 0x3382, 0x0000 }, + { 0x1a00, 0x3384, 0x0000 }, + { 0x9a00, 0x3387, 0x2000 }, + { 0x1a00, 0x3386, 0x0000 }, + { 0x1a00, 0x3388, 0x0000 }, + { 0x9a00, 0x338d, 0x3000 }, + { 0x9a00, 0x338b, 0x2000 }, + { 0x1a00, 0x338a, 0x0000 }, + { 0x1a00, 0x338c, 0x0000 }, + { 0x9a00, 0x338f, 0x2000 }, + { 0x1a00, 0x338e, 0x0000 }, + { 0x1a00, 0x3390, 0x0000 }, + { 0x8700, 0xa14d, 0xa000 }, + { 0x8700, 0xa04d, 0x9000 }, + { 0x9a00, 0x4dcf, 0x8000 }, + { 0x9a00, 0x33d1, 0x7000 }, + { 0x9a00, 0x33b1, 0x6000 }, + { 0x9a00, 0x33a1, 0x5000 }, + { 0x9a00, 0x3399, 0x4000 }, + { 0x9a00, 0x3395, 0x3000 }, + { 0x9a00, 0x3393, 0x2000 }, + { 0x1a00, 0x3392, 0x0000 }, + { 0x1a00, 0x3394, 0x0000 }, + { 0x9a00, 0x3397, 0x2000 }, + { 0x1a00, 0x3396, 0x0000 }, + { 0x1a00, 0x3398, 0x0000 }, + { 0x9a00, 0x339d, 0x3000 }, + { 0x9a00, 0x339b, 0x2000 }, + { 0x1a00, 0x339a, 0x0000 }, + { 0x1a00, 0x339c, 0x0000 }, + { 0x9a00, 0x339f, 0x2000 }, + { 0x1a00, 0x339e, 0x0000 }, + { 0x1a00, 0x33a0, 0x0000 }, + { 0x9a00, 0x33a9, 0x4000 }, + { 0x9a00, 0x33a5, 0x3000 }, + { 0x9a00, 0x33a3, 0x2000 }, + { 0x1a00, 0x33a2, 0x0000 }, + { 0x1a00, 0x33a4, 0x0000 }, + { 0x9a00, 0x33a7, 0x2000 }, + { 0x1a00, 0x33a6, 0x0000 }, + { 0x1a00, 0x33a8, 0x0000 }, + { 0x9a00, 0x33ad, 0x3000 }, + { 0x9a00, 0x33ab, 0x2000 }, + { 0x1a00, 0x33aa, 0x0000 }, + { 0x1a00, 0x33ac, 0x0000 }, + { 0x9a00, 0x33af, 0x2000 }, + { 0x1a00, 0x33ae, 0x0000 }, + { 0x1a00, 0x33b0, 0x0000 }, + { 0x9a00, 0x33c1, 0x5000 }, + { 0x9a00, 0x33b9, 0x4000 }, + { 0x9a00, 0x33b5, 0x3000 }, + { 0x9a00, 0x33b3, 0x2000 }, + { 0x1a00, 0x33b2, 0x0000 }, + { 0x1a00, 0x33b4, 0x0000 }, + { 0x9a00, 0x33b7, 0x2000 }, + { 0x1a00, 0x33b6, 0x0000 }, + { 0x1a00, 0x33b8, 0x0000 }, + { 0x9a00, 0x33bd, 0x3000 }, + { 0x9a00, 0x33bb, 0x2000 }, + { 0x1a00, 0x33ba, 0x0000 }, + { 0x1a00, 0x33bc, 0x0000 }, + { 0x9a00, 0x33bf, 0x2000 }, + { 0x1a00, 0x33be, 0x0000 }, + { 0x1a00, 0x33c0, 0x0000 }, + { 0x9a00, 0x33c9, 0x4000 }, + { 0x9a00, 0x33c5, 0x3000 }, + { 0x9a00, 0x33c3, 0x2000 }, + { 0x1a00, 0x33c2, 0x0000 }, + { 0x1a00, 0x33c4, 0x0000 }, + { 0x9a00, 0x33c7, 0x2000 }, + { 0x1a00, 0x33c6, 0x0000 }, + { 0x1a00, 0x33c8, 0x0000 }, + { 0x9a00, 0x33cd, 0x3000 }, + { 0x9a00, 0x33cb, 0x2000 }, + { 0x1a00, 0x33ca, 0x0000 }, + { 0x1a00, 0x33cc, 0x0000 }, + { 0x9a00, 0x33cf, 0x2000 }, + { 0x1a00, 0x33ce, 0x0000 }, + { 0x1a00, 0x33d0, 0x0000 }, + { 0x9a00, 0x33f1, 0x6000 }, + { 0x9a00, 0x33e1, 0x5000 }, + { 0x9a00, 0x33d9, 0x4000 }, + { 0x9a00, 0x33d5, 0x3000 }, + { 0x9a00, 0x33d3, 0x2000 }, + { 0x1a00, 0x33d2, 0x0000 }, + { 0x1a00, 0x33d4, 0x0000 }, + { 0x9a00, 0x33d7, 0x2000 }, + { 0x1a00, 0x33d6, 0x0000 }, + { 0x1a00, 0x33d8, 0x0000 }, + { 0x9a00, 0x33dd, 0x3000 }, + { 0x9a00, 0x33db, 0x2000 }, + { 0x1a00, 0x33da, 0x0000 }, + { 0x1a00, 0x33dc, 0x0000 }, + { 0x9a00, 0x33df, 0x2000 }, + { 0x1a00, 0x33de, 0x0000 }, + { 0x1a00, 0x33e0, 0x0000 }, + { 0x9a00, 0x33e9, 0x4000 }, + { 0x9a00, 0x33e5, 0x3000 }, + { 0x9a00, 0x33e3, 0x2000 }, + { 0x1a00, 0x33e2, 0x0000 }, + { 0x1a00, 0x33e4, 0x0000 }, + { 0x9a00, 0x33e7, 0x2000 }, + { 0x1a00, 0x33e6, 0x0000 }, + { 0x1a00, 0x33e8, 0x0000 }, + { 0x9a00, 0x33ed, 0x3000 }, + { 0x9a00, 0x33eb, 0x2000 }, + { 0x1a00, 0x33ea, 0x0000 }, + { 0x1a00, 0x33ec, 0x0000 }, + { 0x9a00, 0x33ef, 0x2000 }, + { 0x1a00, 0x33ee, 0x0000 }, + { 0x1a00, 0x33f0, 0x0000 }, + { 0x8700, 0x4db5, 0x5000 }, + { 0x9a00, 0x33f9, 0x4000 }, + { 0x9a00, 0x33f5, 0x3000 }, + { 0x9a00, 0x33f3, 0x2000 }, + { 0x1a00, 0x33f2, 0x0000 }, + { 0x1a00, 0x33f4, 0x0000 }, + { 0x9a00, 0x33f7, 0x2000 }, + { 0x1a00, 0x33f6, 0x0000 }, + { 0x1a00, 0x33f8, 0x0000 }, + { 0x9a00, 0x33fd, 0x3000 }, + { 0x9a00, 0x33fb, 0x2000 }, + { 0x1a00, 0x33fa, 0x0000 }, + { 0x1a00, 0x33fc, 0x0000 }, + { 0x9a00, 0x33ff, 0x2000 }, + { 0x1a00, 0x33fe, 0x0000 }, + { 0x0700, 0x3400, 0x0000 }, + { 0x9a00, 0x4dc7, 0x4000 }, + { 0x9a00, 0x4dc3, 0x3000 }, + { 0x9a00, 0x4dc1, 0x2000 }, + { 0x1a00, 0x4dc0, 0x0000 }, + { 0x1a00, 0x4dc2, 0x0000 }, + { 0x9a00, 0x4dc5, 0x2000 }, + { 0x1a00, 0x4dc4, 0x0000 }, + { 0x1a00, 0x4dc6, 0x0000 }, + { 0x9a00, 0x4dcb, 0x3000 }, + { 0x9a00, 0x4dc9, 0x2000 }, + { 0x1a00, 0x4dc8, 0x0000 }, + { 0x1a00, 0x4dca, 0x0000 }, + { 0x9a00, 0x4dcd, 0x2000 }, + { 0x1a00, 0x4dcc, 0x0000 }, + { 0x1a00, 0x4dce, 0x0000 }, + { 0x8700, 0xa00d, 0x7000 }, + { 0x9a00, 0x4def, 0x6000 }, + { 0x9a00, 0x4ddf, 0x5000 }, + { 0x9a00, 0x4dd7, 0x4000 }, + { 0x9a00, 0x4dd3, 0x3000 }, + { 0x9a00, 0x4dd1, 0x2000 }, + { 0x1a00, 0x4dd0, 0x0000 }, + { 0x1a00, 0x4dd2, 0x0000 }, + { 0x9a00, 0x4dd5, 0x2000 }, + { 0x1a00, 0x4dd4, 0x0000 }, + { 0x1a00, 0x4dd6, 0x0000 }, + { 0x9a00, 0x4ddb, 0x3000 }, + { 0x9a00, 0x4dd9, 0x2000 }, + { 0x1a00, 0x4dd8, 0x0000 }, + { 0x1a00, 0x4dda, 0x0000 }, + { 0x9a00, 0x4ddd, 0x2000 }, + { 0x1a00, 0x4ddc, 0x0000 }, + { 0x1a00, 0x4dde, 0x0000 }, + { 0x9a00, 0x4de7, 0x4000 }, + { 0x9a00, 0x4de3, 0x3000 }, + { 0x9a00, 0x4de1, 0x2000 }, + { 0x1a00, 0x4de0, 0x0000 }, + { 0x1a00, 0x4de2, 0x0000 }, + { 0x9a00, 0x4de5, 0x2000 }, + { 0x1a00, 0x4de4, 0x0000 }, + { 0x1a00, 0x4de6, 0x0000 }, + { 0x9a00, 0x4deb, 0x3000 }, + { 0x9a00, 0x4de9, 0x2000 }, + { 0x1a00, 0x4de8, 0x0000 }, + { 0x1a00, 0x4dea, 0x0000 }, + { 0x9a00, 0x4ded, 0x2000 }, + { 0x1a00, 0x4dec, 0x0000 }, + { 0x1a00, 0x4dee, 0x0000 }, + { 0x9a00, 0x4dff, 0x5000 }, + { 0x9a00, 0x4df7, 0x4000 }, + { 0x9a00, 0x4df3, 0x3000 }, + { 0x9a00, 0x4df1, 0x2000 }, + { 0x1a00, 0x4df0, 0x0000 }, + { 0x1a00, 0x4df2, 0x0000 }, + { 0x9a00, 0x4df5, 0x2000 }, + { 0x1a00, 0x4df4, 0x0000 }, + { 0x1a00, 0x4df6, 0x0000 }, + { 0x9a00, 0x4dfb, 0x3000 }, + { 0x9a00, 0x4df9, 0x2000 }, + { 0x1a00, 0x4df8, 0x0000 }, + { 0x1a00, 0x4dfa, 0x0000 }, + { 0x9a00, 0x4dfd, 0x2000 }, + { 0x1a00, 0x4dfc, 0x0000 }, + { 0x1a00, 0x4dfe, 0x0000 }, + { 0x8700, 0xa005, 0x4000 }, + { 0x8700, 0xa001, 0x3000 }, + { 0x8700, 0x9fa5, 0x2000 }, + { 0x0700, 0x4e00, 0x0000 }, + { 0x0700, 0xa000, 0x0000 }, + { 0x8700, 0xa003, 0x2000 }, + { 0x0700, 0xa002, 0x0000 }, + { 0x0700, 0xa004, 0x0000 }, + { 0x8700, 0xa009, 0x3000 }, + { 0x8700, 0xa007, 0x2000 }, + { 0x0700, 0xa006, 0x0000 }, + { 0x0700, 0xa008, 0x0000 }, + { 0x8700, 0xa00b, 0x2000 }, + { 0x0700, 0xa00a, 0x0000 }, + { 0x0700, 0xa00c, 0x0000 }, + { 0x8700, 0xa02d, 0x6000 }, + { 0x8700, 0xa01d, 0x5000 }, + { 0x8700, 0xa015, 0x4000 }, + { 0x8700, 0xa011, 0x3000 }, + { 0x8700, 0xa00f, 0x2000 }, + { 0x0700, 0xa00e, 0x0000 }, + { 0x0700, 0xa010, 0x0000 }, + { 0x8700, 0xa013, 0x2000 }, + { 0x0700, 0xa012, 0x0000 }, + { 0x0700, 0xa014, 0x0000 }, + { 0x8700, 0xa019, 0x3000 }, + { 0x8700, 0xa017, 0x2000 }, + { 0x0700, 0xa016, 0x0000 }, + { 0x0700, 0xa018, 0x0000 }, + { 0x8700, 0xa01b, 0x2000 }, + { 0x0700, 0xa01a, 0x0000 }, + { 0x0700, 0xa01c, 0x0000 }, + { 0x8700, 0xa025, 0x4000 }, + { 0x8700, 0xa021, 0x3000 }, + { 0x8700, 0xa01f, 0x2000 }, + { 0x0700, 0xa01e, 0x0000 }, + { 0x0700, 0xa020, 0x0000 }, + { 0x8700, 0xa023, 0x2000 }, + { 0x0700, 0xa022, 0x0000 }, + { 0x0700, 0xa024, 0x0000 }, + { 0x8700, 0xa029, 0x3000 }, + { 0x8700, 0xa027, 0x2000 }, + { 0x0700, 0xa026, 0x0000 }, + { 0x0700, 0xa028, 0x0000 }, + { 0x8700, 0xa02b, 0x2000 }, + { 0x0700, 0xa02a, 0x0000 }, + { 0x0700, 0xa02c, 0x0000 }, + { 0x8700, 0xa03d, 0x5000 }, + { 0x8700, 0xa035, 0x4000 }, + { 0x8700, 0xa031, 0x3000 }, + { 0x8700, 0xa02f, 0x2000 }, + { 0x0700, 0xa02e, 0x0000 }, + { 0x0700, 0xa030, 0x0000 }, + { 0x8700, 0xa033, 0x2000 }, + { 0x0700, 0xa032, 0x0000 }, + { 0x0700, 0xa034, 0x0000 }, + { 0x8700, 0xa039, 0x3000 }, + { 0x8700, 0xa037, 0x2000 }, + { 0x0700, 0xa036, 0x0000 }, + { 0x0700, 0xa038, 0x0000 }, + { 0x8700, 0xa03b, 0x2000 }, + { 0x0700, 0xa03a, 0x0000 }, + { 0x0700, 0xa03c, 0x0000 }, + { 0x8700, 0xa045, 0x4000 }, + { 0x8700, 0xa041, 0x3000 }, + { 0x8700, 0xa03f, 0x2000 }, + { 0x0700, 0xa03e, 0x0000 }, + { 0x0700, 0xa040, 0x0000 }, + { 0x8700, 0xa043, 0x2000 }, + { 0x0700, 0xa042, 0x0000 }, + { 0x0700, 0xa044, 0x0000 }, + { 0x8700, 0xa049, 0x3000 }, + { 0x8700, 0xa047, 0x2000 }, + { 0x0700, 0xa046, 0x0000 }, + { 0x0700, 0xa048, 0x0000 }, + { 0x8700, 0xa04b, 0x2000 }, + { 0x0700, 0xa04a, 0x0000 }, + { 0x0700, 0xa04c, 0x0000 }, + { 0x8700, 0xa0cd, 0x8000 }, + { 0x8700, 0xa08d, 0x7000 }, + { 0x8700, 0xa06d, 0x6000 }, + { 0x8700, 0xa05d, 0x5000 }, + { 0x8700, 0xa055, 0x4000 }, + { 0x8700, 0xa051, 0x3000 }, + { 0x8700, 0xa04f, 0x2000 }, + { 0x0700, 0xa04e, 0x0000 }, + { 0x0700, 0xa050, 0x0000 }, + { 0x8700, 0xa053, 0x2000 }, + { 0x0700, 0xa052, 0x0000 }, + { 0x0700, 0xa054, 0x0000 }, + { 0x8700, 0xa059, 0x3000 }, + { 0x8700, 0xa057, 0x2000 }, + { 0x0700, 0xa056, 0x0000 }, + { 0x0700, 0xa058, 0x0000 }, + { 0x8700, 0xa05b, 0x2000 }, + { 0x0700, 0xa05a, 0x0000 }, + { 0x0700, 0xa05c, 0x0000 }, + { 0x8700, 0xa065, 0x4000 }, + { 0x8700, 0xa061, 0x3000 }, + { 0x8700, 0xa05f, 0x2000 }, + { 0x0700, 0xa05e, 0x0000 }, + { 0x0700, 0xa060, 0x0000 }, + { 0x8700, 0xa063, 0x2000 }, + { 0x0700, 0xa062, 0x0000 }, + { 0x0700, 0xa064, 0x0000 }, + { 0x8700, 0xa069, 0x3000 }, + { 0x8700, 0xa067, 0x2000 }, + { 0x0700, 0xa066, 0x0000 }, + { 0x0700, 0xa068, 0x0000 }, + { 0x8700, 0xa06b, 0x2000 }, + { 0x0700, 0xa06a, 0x0000 }, + { 0x0700, 0xa06c, 0x0000 }, + { 0x8700, 0xa07d, 0x5000 }, + { 0x8700, 0xa075, 0x4000 }, + { 0x8700, 0xa071, 0x3000 }, + { 0x8700, 0xa06f, 0x2000 }, + { 0x0700, 0xa06e, 0x0000 }, + { 0x0700, 0xa070, 0x0000 }, + { 0x8700, 0xa073, 0x2000 }, + { 0x0700, 0xa072, 0x0000 }, + { 0x0700, 0xa074, 0x0000 }, + { 0x8700, 0xa079, 0x3000 }, + { 0x8700, 0xa077, 0x2000 }, + { 0x0700, 0xa076, 0x0000 }, + { 0x0700, 0xa078, 0x0000 }, + { 0x8700, 0xa07b, 0x2000 }, + { 0x0700, 0xa07a, 0x0000 }, + { 0x0700, 0xa07c, 0x0000 }, + { 0x8700, 0xa085, 0x4000 }, + { 0x8700, 0xa081, 0x3000 }, + { 0x8700, 0xa07f, 0x2000 }, + { 0x0700, 0xa07e, 0x0000 }, + { 0x0700, 0xa080, 0x0000 }, + { 0x8700, 0xa083, 0x2000 }, + { 0x0700, 0xa082, 0x0000 }, + { 0x0700, 0xa084, 0x0000 }, + { 0x8700, 0xa089, 0x3000 }, + { 0x8700, 0xa087, 0x2000 }, + { 0x0700, 0xa086, 0x0000 }, + { 0x0700, 0xa088, 0x0000 }, + { 0x8700, 0xa08b, 0x2000 }, + { 0x0700, 0xa08a, 0x0000 }, + { 0x0700, 0xa08c, 0x0000 }, + { 0x8700, 0xa0ad, 0x6000 }, + { 0x8700, 0xa09d, 0x5000 }, + { 0x8700, 0xa095, 0x4000 }, + { 0x8700, 0xa091, 0x3000 }, + { 0x8700, 0xa08f, 0x2000 }, + { 0x0700, 0xa08e, 0x0000 }, + { 0x0700, 0xa090, 0x0000 }, + { 0x8700, 0xa093, 0x2000 }, + { 0x0700, 0xa092, 0x0000 }, + { 0x0700, 0xa094, 0x0000 }, + { 0x8700, 0xa099, 0x3000 }, + { 0x8700, 0xa097, 0x2000 }, + { 0x0700, 0xa096, 0x0000 }, + { 0x0700, 0xa098, 0x0000 }, + { 0x8700, 0xa09b, 0x2000 }, + { 0x0700, 0xa09a, 0x0000 }, + { 0x0700, 0xa09c, 0x0000 }, + { 0x8700, 0xa0a5, 0x4000 }, + { 0x8700, 0xa0a1, 0x3000 }, + { 0x8700, 0xa09f, 0x2000 }, + { 0x0700, 0xa09e, 0x0000 }, + { 0x0700, 0xa0a0, 0x0000 }, + { 0x8700, 0xa0a3, 0x2000 }, + { 0x0700, 0xa0a2, 0x0000 }, + { 0x0700, 0xa0a4, 0x0000 }, + { 0x8700, 0xa0a9, 0x3000 }, + { 0x8700, 0xa0a7, 0x2000 }, + { 0x0700, 0xa0a6, 0x0000 }, + { 0x0700, 0xa0a8, 0x0000 }, + { 0x8700, 0xa0ab, 0x2000 }, + { 0x0700, 0xa0aa, 0x0000 }, + { 0x0700, 0xa0ac, 0x0000 }, + { 0x8700, 0xa0bd, 0x5000 }, + { 0x8700, 0xa0b5, 0x4000 }, + { 0x8700, 0xa0b1, 0x3000 }, + { 0x8700, 0xa0af, 0x2000 }, + { 0x0700, 0xa0ae, 0x0000 }, + { 0x0700, 0xa0b0, 0x0000 }, + { 0x8700, 0xa0b3, 0x2000 }, + { 0x0700, 0xa0b2, 0x0000 }, + { 0x0700, 0xa0b4, 0x0000 }, + { 0x8700, 0xa0b9, 0x3000 }, + { 0x8700, 0xa0b7, 0x2000 }, + { 0x0700, 0xa0b6, 0x0000 }, + { 0x0700, 0xa0b8, 0x0000 }, + { 0x8700, 0xa0bb, 0x2000 }, + { 0x0700, 0xa0ba, 0x0000 }, + { 0x0700, 0xa0bc, 0x0000 }, + { 0x8700, 0xa0c5, 0x4000 }, + { 0x8700, 0xa0c1, 0x3000 }, + { 0x8700, 0xa0bf, 0x2000 }, + { 0x0700, 0xa0be, 0x0000 }, + { 0x0700, 0xa0c0, 0x0000 }, + { 0x8700, 0xa0c3, 0x2000 }, + { 0x0700, 0xa0c2, 0x0000 }, + { 0x0700, 0xa0c4, 0x0000 }, + { 0x8700, 0xa0c9, 0x3000 }, + { 0x8700, 0xa0c7, 0x2000 }, + { 0x0700, 0xa0c6, 0x0000 }, + { 0x0700, 0xa0c8, 0x0000 }, + { 0x8700, 0xa0cb, 0x2000 }, + { 0x0700, 0xa0ca, 0x0000 }, + { 0x0700, 0xa0cc, 0x0000 }, + { 0x8700, 0xa10d, 0x7000 }, + { 0x8700, 0xa0ed, 0x6000 }, + { 0x8700, 0xa0dd, 0x5000 }, + { 0x8700, 0xa0d5, 0x4000 }, + { 0x8700, 0xa0d1, 0x3000 }, + { 0x8700, 0xa0cf, 0x2000 }, + { 0x0700, 0xa0ce, 0x0000 }, + { 0x0700, 0xa0d0, 0x0000 }, + { 0x8700, 0xa0d3, 0x2000 }, + { 0x0700, 0xa0d2, 0x0000 }, + { 0x0700, 0xa0d4, 0x0000 }, + { 0x8700, 0xa0d9, 0x3000 }, + { 0x8700, 0xa0d7, 0x2000 }, + { 0x0700, 0xa0d6, 0x0000 }, + { 0x0700, 0xa0d8, 0x0000 }, + { 0x8700, 0xa0db, 0x2000 }, + { 0x0700, 0xa0da, 0x0000 }, + { 0x0700, 0xa0dc, 0x0000 }, + { 0x8700, 0xa0e5, 0x4000 }, + { 0x8700, 0xa0e1, 0x3000 }, + { 0x8700, 0xa0df, 0x2000 }, + { 0x0700, 0xa0de, 0x0000 }, + { 0x0700, 0xa0e0, 0x0000 }, + { 0x8700, 0xa0e3, 0x2000 }, + { 0x0700, 0xa0e2, 0x0000 }, + { 0x0700, 0xa0e4, 0x0000 }, + { 0x8700, 0xa0e9, 0x3000 }, + { 0x8700, 0xa0e7, 0x2000 }, + { 0x0700, 0xa0e6, 0x0000 }, + { 0x0700, 0xa0e8, 0x0000 }, + { 0x8700, 0xa0eb, 0x2000 }, + { 0x0700, 0xa0ea, 0x0000 }, + { 0x0700, 0xa0ec, 0x0000 }, + { 0x8700, 0xa0fd, 0x5000 }, + { 0x8700, 0xa0f5, 0x4000 }, + { 0x8700, 0xa0f1, 0x3000 }, + { 0x8700, 0xa0ef, 0x2000 }, + { 0x0700, 0xa0ee, 0x0000 }, + { 0x0700, 0xa0f0, 0x0000 }, + { 0x8700, 0xa0f3, 0x2000 }, + { 0x0700, 0xa0f2, 0x0000 }, + { 0x0700, 0xa0f4, 0x0000 }, + { 0x8700, 0xa0f9, 0x3000 }, + { 0x8700, 0xa0f7, 0x2000 }, + { 0x0700, 0xa0f6, 0x0000 }, + { 0x0700, 0xa0f8, 0x0000 }, + { 0x8700, 0xa0fb, 0x2000 }, + { 0x0700, 0xa0fa, 0x0000 }, + { 0x0700, 0xa0fc, 0x0000 }, + { 0x8700, 0xa105, 0x4000 }, + { 0x8700, 0xa101, 0x3000 }, + { 0x8700, 0xa0ff, 0x2000 }, + { 0x0700, 0xa0fe, 0x0000 }, + { 0x0700, 0xa100, 0x0000 }, + { 0x8700, 0xa103, 0x2000 }, + { 0x0700, 0xa102, 0x0000 }, + { 0x0700, 0xa104, 0x0000 }, + { 0x8700, 0xa109, 0x3000 }, + { 0x8700, 0xa107, 0x2000 }, + { 0x0700, 0xa106, 0x0000 }, + { 0x0700, 0xa108, 0x0000 }, + { 0x8700, 0xa10b, 0x2000 }, + { 0x0700, 0xa10a, 0x0000 }, + { 0x0700, 0xa10c, 0x0000 }, + { 0x8700, 0xa12d, 0x6000 }, + { 0x8700, 0xa11d, 0x5000 }, + { 0x8700, 0xa115, 0x4000 }, + { 0x8700, 0xa111, 0x3000 }, + { 0x8700, 0xa10f, 0x2000 }, + { 0x0700, 0xa10e, 0x0000 }, + { 0x0700, 0xa110, 0x0000 }, + { 0x8700, 0xa113, 0x2000 }, + { 0x0700, 0xa112, 0x0000 }, + { 0x0700, 0xa114, 0x0000 }, + { 0x8700, 0xa119, 0x3000 }, + { 0x8700, 0xa117, 0x2000 }, + { 0x0700, 0xa116, 0x0000 }, + { 0x0700, 0xa118, 0x0000 }, + { 0x8700, 0xa11b, 0x2000 }, + { 0x0700, 0xa11a, 0x0000 }, + { 0x0700, 0xa11c, 0x0000 }, + { 0x8700, 0xa125, 0x4000 }, + { 0x8700, 0xa121, 0x3000 }, + { 0x8700, 0xa11f, 0x2000 }, + { 0x0700, 0xa11e, 0x0000 }, + { 0x0700, 0xa120, 0x0000 }, + { 0x8700, 0xa123, 0x2000 }, + { 0x0700, 0xa122, 0x0000 }, + { 0x0700, 0xa124, 0x0000 }, + { 0x8700, 0xa129, 0x3000 }, + { 0x8700, 0xa127, 0x2000 }, + { 0x0700, 0xa126, 0x0000 }, + { 0x0700, 0xa128, 0x0000 }, + { 0x8700, 0xa12b, 0x2000 }, + { 0x0700, 0xa12a, 0x0000 }, + { 0x0700, 0xa12c, 0x0000 }, + { 0x8700, 0xa13d, 0x5000 }, + { 0x8700, 0xa135, 0x4000 }, + { 0x8700, 0xa131, 0x3000 }, + { 0x8700, 0xa12f, 0x2000 }, + { 0x0700, 0xa12e, 0x0000 }, + { 0x0700, 0xa130, 0x0000 }, + { 0x8700, 0xa133, 0x2000 }, + { 0x0700, 0xa132, 0x0000 }, + { 0x0700, 0xa134, 0x0000 }, + { 0x8700, 0xa139, 0x3000 }, + { 0x8700, 0xa137, 0x2000 }, + { 0x0700, 0xa136, 0x0000 }, + { 0x0700, 0xa138, 0x0000 }, + { 0x8700, 0xa13b, 0x2000 }, + { 0x0700, 0xa13a, 0x0000 }, + { 0x0700, 0xa13c, 0x0000 }, + { 0x8700, 0xa145, 0x4000 }, + { 0x8700, 0xa141, 0x3000 }, + { 0x8700, 0xa13f, 0x2000 }, + { 0x0700, 0xa13e, 0x0000 }, + { 0x0700, 0xa140, 0x0000 }, + { 0x8700, 0xa143, 0x2000 }, + { 0x0700, 0xa142, 0x0000 }, + { 0x0700, 0xa144, 0x0000 }, + { 0x8700, 0xa149, 0x3000 }, + { 0x8700, 0xa147, 0x2000 }, + { 0x0700, 0xa146, 0x0000 }, + { 0x0700, 0xa148, 0x0000 }, + { 0x8700, 0xa14b, 0x2000 }, + { 0x0700, 0xa14a, 0x0000 }, + { 0x0700, 0xa14c, 0x0000 }, + { 0x8700, 0xa24d, 0x9000 }, + { 0x8700, 0xa1cd, 0x8000 }, + { 0x8700, 0xa18d, 0x7000 }, + { 0x8700, 0xa16d, 0x6000 }, + { 0x8700, 0xa15d, 0x5000 }, + { 0x8700, 0xa155, 0x4000 }, + { 0x8700, 0xa151, 0x3000 }, + { 0x8700, 0xa14f, 0x2000 }, + { 0x0700, 0xa14e, 0x0000 }, + { 0x0700, 0xa150, 0x0000 }, + { 0x8700, 0xa153, 0x2000 }, + { 0x0700, 0xa152, 0x0000 }, + { 0x0700, 0xa154, 0x0000 }, + { 0x8700, 0xa159, 0x3000 }, + { 0x8700, 0xa157, 0x2000 }, + { 0x0700, 0xa156, 0x0000 }, + { 0x0700, 0xa158, 0x0000 }, + { 0x8700, 0xa15b, 0x2000 }, + { 0x0700, 0xa15a, 0x0000 }, + { 0x0700, 0xa15c, 0x0000 }, + { 0x8700, 0xa165, 0x4000 }, + { 0x8700, 0xa161, 0x3000 }, + { 0x8700, 0xa15f, 0x2000 }, + { 0x0700, 0xa15e, 0x0000 }, + { 0x0700, 0xa160, 0x0000 }, + { 0x8700, 0xa163, 0x2000 }, + { 0x0700, 0xa162, 0x0000 }, + { 0x0700, 0xa164, 0x0000 }, + { 0x8700, 0xa169, 0x3000 }, + { 0x8700, 0xa167, 0x2000 }, + { 0x0700, 0xa166, 0x0000 }, + { 0x0700, 0xa168, 0x0000 }, + { 0x8700, 0xa16b, 0x2000 }, + { 0x0700, 0xa16a, 0x0000 }, + { 0x0700, 0xa16c, 0x0000 }, + { 0x8700, 0xa17d, 0x5000 }, + { 0x8700, 0xa175, 0x4000 }, + { 0x8700, 0xa171, 0x3000 }, + { 0x8700, 0xa16f, 0x2000 }, + { 0x0700, 0xa16e, 0x0000 }, + { 0x0700, 0xa170, 0x0000 }, + { 0x8700, 0xa173, 0x2000 }, + { 0x0700, 0xa172, 0x0000 }, + { 0x0700, 0xa174, 0x0000 }, + { 0x8700, 0xa179, 0x3000 }, + { 0x8700, 0xa177, 0x2000 }, + { 0x0700, 0xa176, 0x0000 }, + { 0x0700, 0xa178, 0x0000 }, + { 0x8700, 0xa17b, 0x2000 }, + { 0x0700, 0xa17a, 0x0000 }, + { 0x0700, 0xa17c, 0x0000 }, + { 0x8700, 0xa185, 0x4000 }, + { 0x8700, 0xa181, 0x3000 }, + { 0x8700, 0xa17f, 0x2000 }, + { 0x0700, 0xa17e, 0x0000 }, + { 0x0700, 0xa180, 0x0000 }, + { 0x8700, 0xa183, 0x2000 }, + { 0x0700, 0xa182, 0x0000 }, + { 0x0700, 0xa184, 0x0000 }, + { 0x8700, 0xa189, 0x3000 }, + { 0x8700, 0xa187, 0x2000 }, + { 0x0700, 0xa186, 0x0000 }, + { 0x0700, 0xa188, 0x0000 }, + { 0x8700, 0xa18b, 0x2000 }, + { 0x0700, 0xa18a, 0x0000 }, + { 0x0700, 0xa18c, 0x0000 }, + { 0x8700, 0xa1ad, 0x6000 }, + { 0x8700, 0xa19d, 0x5000 }, + { 0x8700, 0xa195, 0x4000 }, + { 0x8700, 0xa191, 0x3000 }, + { 0x8700, 0xa18f, 0x2000 }, + { 0x0700, 0xa18e, 0x0000 }, + { 0x0700, 0xa190, 0x0000 }, + { 0x8700, 0xa193, 0x2000 }, + { 0x0700, 0xa192, 0x0000 }, + { 0x0700, 0xa194, 0x0000 }, + { 0x8700, 0xa199, 0x3000 }, + { 0x8700, 0xa197, 0x2000 }, + { 0x0700, 0xa196, 0x0000 }, + { 0x0700, 0xa198, 0x0000 }, + { 0x8700, 0xa19b, 0x2000 }, + { 0x0700, 0xa19a, 0x0000 }, + { 0x0700, 0xa19c, 0x0000 }, + { 0x8700, 0xa1a5, 0x4000 }, + { 0x8700, 0xa1a1, 0x3000 }, + { 0x8700, 0xa19f, 0x2000 }, + { 0x0700, 0xa19e, 0x0000 }, + { 0x0700, 0xa1a0, 0x0000 }, + { 0x8700, 0xa1a3, 0x2000 }, + { 0x0700, 0xa1a2, 0x0000 }, + { 0x0700, 0xa1a4, 0x0000 }, + { 0x8700, 0xa1a9, 0x3000 }, + { 0x8700, 0xa1a7, 0x2000 }, + { 0x0700, 0xa1a6, 0x0000 }, + { 0x0700, 0xa1a8, 0x0000 }, + { 0x8700, 0xa1ab, 0x2000 }, + { 0x0700, 0xa1aa, 0x0000 }, + { 0x0700, 0xa1ac, 0x0000 }, + { 0x8700, 0xa1bd, 0x5000 }, + { 0x8700, 0xa1b5, 0x4000 }, + { 0x8700, 0xa1b1, 0x3000 }, + { 0x8700, 0xa1af, 0x2000 }, + { 0x0700, 0xa1ae, 0x0000 }, + { 0x0700, 0xa1b0, 0x0000 }, + { 0x8700, 0xa1b3, 0x2000 }, + { 0x0700, 0xa1b2, 0x0000 }, + { 0x0700, 0xa1b4, 0x0000 }, + { 0x8700, 0xa1b9, 0x3000 }, + { 0x8700, 0xa1b7, 0x2000 }, + { 0x0700, 0xa1b6, 0x0000 }, + { 0x0700, 0xa1b8, 0x0000 }, + { 0x8700, 0xa1bb, 0x2000 }, + { 0x0700, 0xa1ba, 0x0000 }, + { 0x0700, 0xa1bc, 0x0000 }, + { 0x8700, 0xa1c5, 0x4000 }, + { 0x8700, 0xa1c1, 0x3000 }, + { 0x8700, 0xa1bf, 0x2000 }, + { 0x0700, 0xa1be, 0x0000 }, + { 0x0700, 0xa1c0, 0x0000 }, + { 0x8700, 0xa1c3, 0x2000 }, + { 0x0700, 0xa1c2, 0x0000 }, + { 0x0700, 0xa1c4, 0x0000 }, + { 0x8700, 0xa1c9, 0x3000 }, + { 0x8700, 0xa1c7, 0x2000 }, + { 0x0700, 0xa1c6, 0x0000 }, + { 0x0700, 0xa1c8, 0x0000 }, + { 0x8700, 0xa1cb, 0x2000 }, + { 0x0700, 0xa1ca, 0x0000 }, + { 0x0700, 0xa1cc, 0x0000 }, + { 0x8700, 0xa20d, 0x7000 }, + { 0x8700, 0xa1ed, 0x6000 }, + { 0x8700, 0xa1dd, 0x5000 }, + { 0x8700, 0xa1d5, 0x4000 }, + { 0x8700, 0xa1d1, 0x3000 }, + { 0x8700, 0xa1cf, 0x2000 }, + { 0x0700, 0xa1ce, 0x0000 }, + { 0x0700, 0xa1d0, 0x0000 }, + { 0x8700, 0xa1d3, 0x2000 }, + { 0x0700, 0xa1d2, 0x0000 }, + { 0x0700, 0xa1d4, 0x0000 }, + { 0x8700, 0xa1d9, 0x3000 }, + { 0x8700, 0xa1d7, 0x2000 }, + { 0x0700, 0xa1d6, 0x0000 }, + { 0x0700, 0xa1d8, 0x0000 }, + { 0x8700, 0xa1db, 0x2000 }, + { 0x0700, 0xa1da, 0x0000 }, + { 0x0700, 0xa1dc, 0x0000 }, + { 0x8700, 0xa1e5, 0x4000 }, + { 0x8700, 0xa1e1, 0x3000 }, + { 0x8700, 0xa1df, 0x2000 }, + { 0x0700, 0xa1de, 0x0000 }, + { 0x0700, 0xa1e0, 0x0000 }, + { 0x8700, 0xa1e3, 0x2000 }, + { 0x0700, 0xa1e2, 0x0000 }, + { 0x0700, 0xa1e4, 0x0000 }, + { 0x8700, 0xa1e9, 0x3000 }, + { 0x8700, 0xa1e7, 0x2000 }, + { 0x0700, 0xa1e6, 0x0000 }, + { 0x0700, 0xa1e8, 0x0000 }, + { 0x8700, 0xa1eb, 0x2000 }, + { 0x0700, 0xa1ea, 0x0000 }, + { 0x0700, 0xa1ec, 0x0000 }, + { 0x8700, 0xa1fd, 0x5000 }, + { 0x8700, 0xa1f5, 0x4000 }, + { 0x8700, 0xa1f1, 0x3000 }, + { 0x8700, 0xa1ef, 0x2000 }, + { 0x0700, 0xa1ee, 0x0000 }, + { 0x0700, 0xa1f0, 0x0000 }, + { 0x8700, 0xa1f3, 0x2000 }, + { 0x0700, 0xa1f2, 0x0000 }, + { 0x0700, 0xa1f4, 0x0000 }, + { 0x8700, 0xa1f9, 0x3000 }, + { 0x8700, 0xa1f7, 0x2000 }, + { 0x0700, 0xa1f6, 0x0000 }, + { 0x0700, 0xa1f8, 0x0000 }, + { 0x8700, 0xa1fb, 0x2000 }, + { 0x0700, 0xa1fa, 0x0000 }, + { 0x0700, 0xa1fc, 0x0000 }, + { 0x8700, 0xa205, 0x4000 }, + { 0x8700, 0xa201, 0x3000 }, + { 0x8700, 0xa1ff, 0x2000 }, + { 0x0700, 0xa1fe, 0x0000 }, + { 0x0700, 0xa200, 0x0000 }, + { 0x8700, 0xa203, 0x2000 }, + { 0x0700, 0xa202, 0x0000 }, + { 0x0700, 0xa204, 0x0000 }, + { 0x8700, 0xa209, 0x3000 }, + { 0x8700, 0xa207, 0x2000 }, + { 0x0700, 0xa206, 0x0000 }, + { 0x0700, 0xa208, 0x0000 }, + { 0x8700, 0xa20b, 0x2000 }, + { 0x0700, 0xa20a, 0x0000 }, + { 0x0700, 0xa20c, 0x0000 }, + { 0x8700, 0xa22d, 0x6000 }, + { 0x8700, 0xa21d, 0x5000 }, + { 0x8700, 0xa215, 0x4000 }, + { 0x8700, 0xa211, 0x3000 }, + { 0x8700, 0xa20f, 0x2000 }, + { 0x0700, 0xa20e, 0x0000 }, + { 0x0700, 0xa210, 0x0000 }, + { 0x8700, 0xa213, 0x2000 }, + { 0x0700, 0xa212, 0x0000 }, + { 0x0700, 0xa214, 0x0000 }, + { 0x8700, 0xa219, 0x3000 }, + { 0x8700, 0xa217, 0x2000 }, + { 0x0700, 0xa216, 0x0000 }, + { 0x0700, 0xa218, 0x0000 }, + { 0x8700, 0xa21b, 0x2000 }, + { 0x0700, 0xa21a, 0x0000 }, + { 0x0700, 0xa21c, 0x0000 }, + { 0x8700, 0xa225, 0x4000 }, + { 0x8700, 0xa221, 0x3000 }, + { 0x8700, 0xa21f, 0x2000 }, + { 0x0700, 0xa21e, 0x0000 }, + { 0x0700, 0xa220, 0x0000 }, + { 0x8700, 0xa223, 0x2000 }, + { 0x0700, 0xa222, 0x0000 }, + { 0x0700, 0xa224, 0x0000 }, + { 0x8700, 0xa229, 0x3000 }, + { 0x8700, 0xa227, 0x2000 }, + { 0x0700, 0xa226, 0x0000 }, + { 0x0700, 0xa228, 0x0000 }, + { 0x8700, 0xa22b, 0x2000 }, + { 0x0700, 0xa22a, 0x0000 }, + { 0x0700, 0xa22c, 0x0000 }, + { 0x8700, 0xa23d, 0x5000 }, + { 0x8700, 0xa235, 0x4000 }, + { 0x8700, 0xa231, 0x3000 }, + { 0x8700, 0xa22f, 0x2000 }, + { 0x0700, 0xa22e, 0x0000 }, + { 0x0700, 0xa230, 0x0000 }, + { 0x8700, 0xa233, 0x2000 }, + { 0x0700, 0xa232, 0x0000 }, + { 0x0700, 0xa234, 0x0000 }, + { 0x8700, 0xa239, 0x3000 }, + { 0x8700, 0xa237, 0x2000 }, + { 0x0700, 0xa236, 0x0000 }, + { 0x0700, 0xa238, 0x0000 }, + { 0x8700, 0xa23b, 0x2000 }, + { 0x0700, 0xa23a, 0x0000 }, + { 0x0700, 0xa23c, 0x0000 }, + { 0x8700, 0xa245, 0x4000 }, + { 0x8700, 0xa241, 0x3000 }, + { 0x8700, 0xa23f, 0x2000 }, + { 0x0700, 0xa23e, 0x0000 }, + { 0x0700, 0xa240, 0x0000 }, + { 0x8700, 0xa243, 0x2000 }, + { 0x0700, 0xa242, 0x0000 }, + { 0x0700, 0xa244, 0x0000 }, + { 0x8700, 0xa249, 0x3000 }, + { 0x8700, 0xa247, 0x2000 }, + { 0x0700, 0xa246, 0x0000 }, + { 0x0700, 0xa248, 0x0000 }, + { 0x8700, 0xa24b, 0x2000 }, + { 0x0700, 0xa24a, 0x0000 }, + { 0x0700, 0xa24c, 0x0000 }, + { 0x8700, 0xa2cd, 0x8000 }, + { 0x8700, 0xa28d, 0x7000 }, + { 0x8700, 0xa26d, 0x6000 }, + { 0x8700, 0xa25d, 0x5000 }, + { 0x8700, 0xa255, 0x4000 }, + { 0x8700, 0xa251, 0x3000 }, + { 0x8700, 0xa24f, 0x2000 }, + { 0x0700, 0xa24e, 0x0000 }, + { 0x0700, 0xa250, 0x0000 }, + { 0x8700, 0xa253, 0x2000 }, + { 0x0700, 0xa252, 0x0000 }, + { 0x0700, 0xa254, 0x0000 }, + { 0x8700, 0xa259, 0x3000 }, + { 0x8700, 0xa257, 0x2000 }, + { 0x0700, 0xa256, 0x0000 }, + { 0x0700, 0xa258, 0x0000 }, + { 0x8700, 0xa25b, 0x2000 }, + { 0x0700, 0xa25a, 0x0000 }, + { 0x0700, 0xa25c, 0x0000 }, + { 0x8700, 0xa265, 0x4000 }, + { 0x8700, 0xa261, 0x3000 }, + { 0x8700, 0xa25f, 0x2000 }, + { 0x0700, 0xa25e, 0x0000 }, + { 0x0700, 0xa260, 0x0000 }, + { 0x8700, 0xa263, 0x2000 }, + { 0x0700, 0xa262, 0x0000 }, + { 0x0700, 0xa264, 0x0000 }, + { 0x8700, 0xa269, 0x3000 }, + { 0x8700, 0xa267, 0x2000 }, + { 0x0700, 0xa266, 0x0000 }, + { 0x0700, 0xa268, 0x0000 }, + { 0x8700, 0xa26b, 0x2000 }, + { 0x0700, 0xa26a, 0x0000 }, + { 0x0700, 0xa26c, 0x0000 }, + { 0x8700, 0xa27d, 0x5000 }, + { 0x8700, 0xa275, 0x4000 }, + { 0x8700, 0xa271, 0x3000 }, + { 0x8700, 0xa26f, 0x2000 }, + { 0x0700, 0xa26e, 0x0000 }, + { 0x0700, 0xa270, 0x0000 }, + { 0x8700, 0xa273, 0x2000 }, + { 0x0700, 0xa272, 0x0000 }, + { 0x0700, 0xa274, 0x0000 }, + { 0x8700, 0xa279, 0x3000 }, + { 0x8700, 0xa277, 0x2000 }, + { 0x0700, 0xa276, 0x0000 }, + { 0x0700, 0xa278, 0x0000 }, + { 0x8700, 0xa27b, 0x2000 }, + { 0x0700, 0xa27a, 0x0000 }, + { 0x0700, 0xa27c, 0x0000 }, + { 0x8700, 0xa285, 0x4000 }, + { 0x8700, 0xa281, 0x3000 }, + { 0x8700, 0xa27f, 0x2000 }, + { 0x0700, 0xa27e, 0x0000 }, + { 0x0700, 0xa280, 0x0000 }, + { 0x8700, 0xa283, 0x2000 }, + { 0x0700, 0xa282, 0x0000 }, + { 0x0700, 0xa284, 0x0000 }, + { 0x8700, 0xa289, 0x3000 }, + { 0x8700, 0xa287, 0x2000 }, + { 0x0700, 0xa286, 0x0000 }, + { 0x0700, 0xa288, 0x0000 }, + { 0x8700, 0xa28b, 0x2000 }, + { 0x0700, 0xa28a, 0x0000 }, + { 0x0700, 0xa28c, 0x0000 }, + { 0x8700, 0xa2ad, 0x6000 }, + { 0x8700, 0xa29d, 0x5000 }, + { 0x8700, 0xa295, 0x4000 }, + { 0x8700, 0xa291, 0x3000 }, + { 0x8700, 0xa28f, 0x2000 }, + { 0x0700, 0xa28e, 0x0000 }, + { 0x0700, 0xa290, 0x0000 }, + { 0x8700, 0xa293, 0x2000 }, + { 0x0700, 0xa292, 0x0000 }, + { 0x0700, 0xa294, 0x0000 }, + { 0x8700, 0xa299, 0x3000 }, + { 0x8700, 0xa297, 0x2000 }, + { 0x0700, 0xa296, 0x0000 }, + { 0x0700, 0xa298, 0x0000 }, + { 0x8700, 0xa29b, 0x2000 }, + { 0x0700, 0xa29a, 0x0000 }, + { 0x0700, 0xa29c, 0x0000 }, + { 0x8700, 0xa2a5, 0x4000 }, + { 0x8700, 0xa2a1, 0x3000 }, + { 0x8700, 0xa29f, 0x2000 }, + { 0x0700, 0xa29e, 0x0000 }, + { 0x0700, 0xa2a0, 0x0000 }, + { 0x8700, 0xa2a3, 0x2000 }, + { 0x0700, 0xa2a2, 0x0000 }, + { 0x0700, 0xa2a4, 0x0000 }, + { 0x8700, 0xa2a9, 0x3000 }, + { 0x8700, 0xa2a7, 0x2000 }, + { 0x0700, 0xa2a6, 0x0000 }, + { 0x0700, 0xa2a8, 0x0000 }, + { 0x8700, 0xa2ab, 0x2000 }, + { 0x0700, 0xa2aa, 0x0000 }, + { 0x0700, 0xa2ac, 0x0000 }, + { 0x8700, 0xa2bd, 0x5000 }, + { 0x8700, 0xa2b5, 0x4000 }, + { 0x8700, 0xa2b1, 0x3000 }, + { 0x8700, 0xa2af, 0x2000 }, + { 0x0700, 0xa2ae, 0x0000 }, + { 0x0700, 0xa2b0, 0x0000 }, + { 0x8700, 0xa2b3, 0x2000 }, + { 0x0700, 0xa2b2, 0x0000 }, + { 0x0700, 0xa2b4, 0x0000 }, + { 0x8700, 0xa2b9, 0x3000 }, + { 0x8700, 0xa2b7, 0x2000 }, + { 0x0700, 0xa2b6, 0x0000 }, + { 0x0700, 0xa2b8, 0x0000 }, + { 0x8700, 0xa2bb, 0x2000 }, + { 0x0700, 0xa2ba, 0x0000 }, + { 0x0700, 0xa2bc, 0x0000 }, + { 0x8700, 0xa2c5, 0x4000 }, + { 0x8700, 0xa2c1, 0x3000 }, + { 0x8700, 0xa2bf, 0x2000 }, + { 0x0700, 0xa2be, 0x0000 }, + { 0x0700, 0xa2c0, 0x0000 }, + { 0x8700, 0xa2c3, 0x2000 }, + { 0x0700, 0xa2c2, 0x0000 }, + { 0x0700, 0xa2c4, 0x0000 }, + { 0x8700, 0xa2c9, 0x3000 }, + { 0x8700, 0xa2c7, 0x2000 }, + { 0x0700, 0xa2c6, 0x0000 }, + { 0x0700, 0xa2c8, 0x0000 }, + { 0x8700, 0xa2cb, 0x2000 }, + { 0x0700, 0xa2ca, 0x0000 }, + { 0x0700, 0xa2cc, 0x0000 }, + { 0x8700, 0xa30d, 0x7000 }, + { 0x8700, 0xa2ed, 0x6000 }, + { 0x8700, 0xa2dd, 0x5000 }, + { 0x8700, 0xa2d5, 0x4000 }, + { 0x8700, 0xa2d1, 0x3000 }, + { 0x8700, 0xa2cf, 0x2000 }, + { 0x0700, 0xa2ce, 0x0000 }, + { 0x0700, 0xa2d0, 0x0000 }, + { 0x8700, 0xa2d3, 0x2000 }, + { 0x0700, 0xa2d2, 0x0000 }, + { 0x0700, 0xa2d4, 0x0000 }, + { 0x8700, 0xa2d9, 0x3000 }, + { 0x8700, 0xa2d7, 0x2000 }, + { 0x0700, 0xa2d6, 0x0000 }, + { 0x0700, 0xa2d8, 0x0000 }, + { 0x8700, 0xa2db, 0x2000 }, + { 0x0700, 0xa2da, 0x0000 }, + { 0x0700, 0xa2dc, 0x0000 }, + { 0x8700, 0xa2e5, 0x4000 }, + { 0x8700, 0xa2e1, 0x3000 }, + { 0x8700, 0xa2df, 0x2000 }, + { 0x0700, 0xa2de, 0x0000 }, + { 0x0700, 0xa2e0, 0x0000 }, + { 0x8700, 0xa2e3, 0x2000 }, + { 0x0700, 0xa2e2, 0x0000 }, + { 0x0700, 0xa2e4, 0x0000 }, + { 0x8700, 0xa2e9, 0x3000 }, + { 0x8700, 0xa2e7, 0x2000 }, + { 0x0700, 0xa2e6, 0x0000 }, + { 0x0700, 0xa2e8, 0x0000 }, + { 0x8700, 0xa2eb, 0x2000 }, + { 0x0700, 0xa2ea, 0x0000 }, + { 0x0700, 0xa2ec, 0x0000 }, + { 0x8700, 0xa2fd, 0x5000 }, + { 0x8700, 0xa2f5, 0x4000 }, + { 0x8700, 0xa2f1, 0x3000 }, + { 0x8700, 0xa2ef, 0x2000 }, + { 0x0700, 0xa2ee, 0x0000 }, + { 0x0700, 0xa2f0, 0x0000 }, + { 0x8700, 0xa2f3, 0x2000 }, + { 0x0700, 0xa2f2, 0x0000 }, + { 0x0700, 0xa2f4, 0x0000 }, + { 0x8700, 0xa2f9, 0x3000 }, + { 0x8700, 0xa2f7, 0x2000 }, + { 0x0700, 0xa2f6, 0x0000 }, + { 0x0700, 0xa2f8, 0x0000 }, + { 0x8700, 0xa2fb, 0x2000 }, + { 0x0700, 0xa2fa, 0x0000 }, + { 0x0700, 0xa2fc, 0x0000 }, + { 0x8700, 0xa305, 0x4000 }, + { 0x8700, 0xa301, 0x3000 }, + { 0x8700, 0xa2ff, 0x2000 }, + { 0x0700, 0xa2fe, 0x0000 }, + { 0x0700, 0xa300, 0x0000 }, + { 0x8700, 0xa303, 0x2000 }, + { 0x0700, 0xa302, 0x0000 }, + { 0x0700, 0xa304, 0x0000 }, + { 0x8700, 0xa309, 0x3000 }, + { 0x8700, 0xa307, 0x2000 }, + { 0x0700, 0xa306, 0x0000 }, + { 0x0700, 0xa308, 0x0000 }, + { 0x8700, 0xa30b, 0x2000 }, + { 0x0700, 0xa30a, 0x0000 }, + { 0x0700, 0xa30c, 0x0000 }, + { 0x8700, 0xa32d, 0x6000 }, + { 0x8700, 0xa31d, 0x5000 }, + { 0x8700, 0xa315, 0x4000 }, + { 0x8700, 0xa311, 0x3000 }, + { 0x8700, 0xa30f, 0x2000 }, + { 0x0700, 0xa30e, 0x0000 }, + { 0x0700, 0xa310, 0x0000 }, + { 0x8700, 0xa313, 0x2000 }, + { 0x0700, 0xa312, 0x0000 }, + { 0x0700, 0xa314, 0x0000 }, + { 0x8700, 0xa319, 0x3000 }, + { 0x8700, 0xa317, 0x2000 }, + { 0x0700, 0xa316, 0x0000 }, + { 0x0700, 0xa318, 0x0000 }, + { 0x8700, 0xa31b, 0x2000 }, + { 0x0700, 0xa31a, 0x0000 }, + { 0x0700, 0xa31c, 0x0000 }, + { 0x8700, 0xa325, 0x4000 }, + { 0x8700, 0xa321, 0x3000 }, + { 0x8700, 0xa31f, 0x2000 }, + { 0x0700, 0xa31e, 0x0000 }, + { 0x0700, 0xa320, 0x0000 }, + { 0x8700, 0xa323, 0x2000 }, + { 0x0700, 0xa322, 0x0000 }, + { 0x0700, 0xa324, 0x0000 }, + { 0x8700, 0xa329, 0x3000 }, + { 0x8700, 0xa327, 0x2000 }, + { 0x0700, 0xa326, 0x0000 }, + { 0x0700, 0xa328, 0x0000 }, + { 0x8700, 0xa32b, 0x2000 }, + { 0x0700, 0xa32a, 0x0000 }, + { 0x0700, 0xa32c, 0x0000 }, + { 0x8700, 0xa33d, 0x5000 }, + { 0x8700, 0xa335, 0x4000 }, + { 0x8700, 0xa331, 0x3000 }, + { 0x8700, 0xa32f, 0x2000 }, + { 0x0700, 0xa32e, 0x0000 }, + { 0x0700, 0xa330, 0x0000 }, + { 0x8700, 0xa333, 0x2000 }, + { 0x0700, 0xa332, 0x0000 }, + { 0x0700, 0xa334, 0x0000 }, + { 0x8700, 0xa339, 0x3000 }, + { 0x8700, 0xa337, 0x2000 }, + { 0x0700, 0xa336, 0x0000 }, + { 0x0700, 0xa338, 0x0000 }, + { 0x8700, 0xa33b, 0x2000 }, + { 0x0700, 0xa33a, 0x0000 }, + { 0x0700, 0xa33c, 0x0000 }, + { 0x8700, 0xa345, 0x4000 }, + { 0x8700, 0xa341, 0x3000 }, + { 0x8700, 0xa33f, 0x2000 }, + { 0x0700, 0xa33e, 0x0000 }, + { 0x0700, 0xa340, 0x0000 }, + { 0x8700, 0xa343, 0x2000 }, + { 0x0700, 0xa342, 0x0000 }, + { 0x0700, 0xa344, 0x0000 }, + { 0x8700, 0xa349, 0x3000 }, + { 0x8700, 0xa347, 0x2000 }, + { 0x0700, 0xa346, 0x0000 }, + { 0x0700, 0xa348, 0x0000 }, + { 0x8700, 0xa34b, 0x2000 }, + { 0x0700, 0xa34a, 0x0000 }, + { 0x0700, 0xa34c, 0x0000 }, + { 0x8700, 0xfc4d, 0xb000 }, + { 0x8700, 0xf97f, 0xa000 }, + { 0x8700, 0xa44d, 0x9000 }, + { 0x8700, 0xa3cd, 0x8000 }, + { 0x8700, 0xa38d, 0x7000 }, + { 0x8700, 0xa36d, 0x6000 }, + { 0x8700, 0xa35d, 0x5000 }, + { 0x8700, 0xa355, 0x4000 }, + { 0x8700, 0xa351, 0x3000 }, + { 0x8700, 0xa34f, 0x2000 }, + { 0x0700, 0xa34e, 0x0000 }, + { 0x0700, 0xa350, 0x0000 }, + { 0x8700, 0xa353, 0x2000 }, + { 0x0700, 0xa352, 0x0000 }, + { 0x0700, 0xa354, 0x0000 }, + { 0x8700, 0xa359, 0x3000 }, + { 0x8700, 0xa357, 0x2000 }, + { 0x0700, 0xa356, 0x0000 }, + { 0x0700, 0xa358, 0x0000 }, + { 0x8700, 0xa35b, 0x2000 }, + { 0x0700, 0xa35a, 0x0000 }, + { 0x0700, 0xa35c, 0x0000 }, + { 0x8700, 0xa365, 0x4000 }, + { 0x8700, 0xa361, 0x3000 }, + { 0x8700, 0xa35f, 0x2000 }, + { 0x0700, 0xa35e, 0x0000 }, + { 0x0700, 0xa360, 0x0000 }, + { 0x8700, 0xa363, 0x2000 }, + { 0x0700, 0xa362, 0x0000 }, + { 0x0700, 0xa364, 0x0000 }, + { 0x8700, 0xa369, 0x3000 }, + { 0x8700, 0xa367, 0x2000 }, + { 0x0700, 0xa366, 0x0000 }, + { 0x0700, 0xa368, 0x0000 }, + { 0x8700, 0xa36b, 0x2000 }, + { 0x0700, 0xa36a, 0x0000 }, + { 0x0700, 0xa36c, 0x0000 }, + { 0x8700, 0xa37d, 0x5000 }, + { 0x8700, 0xa375, 0x4000 }, + { 0x8700, 0xa371, 0x3000 }, + { 0x8700, 0xa36f, 0x2000 }, + { 0x0700, 0xa36e, 0x0000 }, + { 0x0700, 0xa370, 0x0000 }, + { 0x8700, 0xa373, 0x2000 }, + { 0x0700, 0xa372, 0x0000 }, + { 0x0700, 0xa374, 0x0000 }, + { 0x8700, 0xa379, 0x3000 }, + { 0x8700, 0xa377, 0x2000 }, + { 0x0700, 0xa376, 0x0000 }, + { 0x0700, 0xa378, 0x0000 }, + { 0x8700, 0xa37b, 0x2000 }, + { 0x0700, 0xa37a, 0x0000 }, + { 0x0700, 0xa37c, 0x0000 }, + { 0x8700, 0xa385, 0x4000 }, + { 0x8700, 0xa381, 0x3000 }, + { 0x8700, 0xa37f, 0x2000 }, + { 0x0700, 0xa37e, 0x0000 }, + { 0x0700, 0xa380, 0x0000 }, + { 0x8700, 0xa383, 0x2000 }, + { 0x0700, 0xa382, 0x0000 }, + { 0x0700, 0xa384, 0x0000 }, + { 0x8700, 0xa389, 0x3000 }, + { 0x8700, 0xa387, 0x2000 }, + { 0x0700, 0xa386, 0x0000 }, + { 0x0700, 0xa388, 0x0000 }, + { 0x8700, 0xa38b, 0x2000 }, + { 0x0700, 0xa38a, 0x0000 }, + { 0x0700, 0xa38c, 0x0000 }, + { 0x8700, 0xa3ad, 0x6000 }, + { 0x8700, 0xa39d, 0x5000 }, + { 0x8700, 0xa395, 0x4000 }, + { 0x8700, 0xa391, 0x3000 }, + { 0x8700, 0xa38f, 0x2000 }, + { 0x0700, 0xa38e, 0x0000 }, + { 0x0700, 0xa390, 0x0000 }, + { 0x8700, 0xa393, 0x2000 }, + { 0x0700, 0xa392, 0x0000 }, + { 0x0700, 0xa394, 0x0000 }, + { 0x8700, 0xa399, 0x3000 }, + { 0x8700, 0xa397, 0x2000 }, + { 0x0700, 0xa396, 0x0000 }, + { 0x0700, 0xa398, 0x0000 }, + { 0x8700, 0xa39b, 0x2000 }, + { 0x0700, 0xa39a, 0x0000 }, + { 0x0700, 0xa39c, 0x0000 }, + { 0x8700, 0xa3a5, 0x4000 }, + { 0x8700, 0xa3a1, 0x3000 }, + { 0x8700, 0xa39f, 0x2000 }, + { 0x0700, 0xa39e, 0x0000 }, + { 0x0700, 0xa3a0, 0x0000 }, + { 0x8700, 0xa3a3, 0x2000 }, + { 0x0700, 0xa3a2, 0x0000 }, + { 0x0700, 0xa3a4, 0x0000 }, + { 0x8700, 0xa3a9, 0x3000 }, + { 0x8700, 0xa3a7, 0x2000 }, + { 0x0700, 0xa3a6, 0x0000 }, + { 0x0700, 0xa3a8, 0x0000 }, + { 0x8700, 0xa3ab, 0x2000 }, + { 0x0700, 0xa3aa, 0x0000 }, + { 0x0700, 0xa3ac, 0x0000 }, + { 0x8700, 0xa3bd, 0x5000 }, + { 0x8700, 0xa3b5, 0x4000 }, + { 0x8700, 0xa3b1, 0x3000 }, + { 0x8700, 0xa3af, 0x2000 }, + { 0x0700, 0xa3ae, 0x0000 }, + { 0x0700, 0xa3b0, 0x0000 }, + { 0x8700, 0xa3b3, 0x2000 }, + { 0x0700, 0xa3b2, 0x0000 }, + { 0x0700, 0xa3b4, 0x0000 }, + { 0x8700, 0xa3b9, 0x3000 }, + { 0x8700, 0xa3b7, 0x2000 }, + { 0x0700, 0xa3b6, 0x0000 }, + { 0x0700, 0xa3b8, 0x0000 }, + { 0x8700, 0xa3bb, 0x2000 }, + { 0x0700, 0xa3ba, 0x0000 }, + { 0x0700, 0xa3bc, 0x0000 }, + { 0x8700, 0xa3c5, 0x4000 }, + { 0x8700, 0xa3c1, 0x3000 }, + { 0x8700, 0xa3bf, 0x2000 }, + { 0x0700, 0xa3be, 0x0000 }, + { 0x0700, 0xa3c0, 0x0000 }, + { 0x8700, 0xa3c3, 0x2000 }, + { 0x0700, 0xa3c2, 0x0000 }, + { 0x0700, 0xa3c4, 0x0000 }, + { 0x8700, 0xa3c9, 0x3000 }, + { 0x8700, 0xa3c7, 0x2000 }, + { 0x0700, 0xa3c6, 0x0000 }, + { 0x0700, 0xa3c8, 0x0000 }, + { 0x8700, 0xa3cb, 0x2000 }, + { 0x0700, 0xa3ca, 0x0000 }, + { 0x0700, 0xa3cc, 0x0000 }, + { 0x8700, 0xa40d, 0x7000 }, + { 0x8700, 0xa3ed, 0x6000 }, + { 0x8700, 0xa3dd, 0x5000 }, + { 0x8700, 0xa3d5, 0x4000 }, + { 0x8700, 0xa3d1, 0x3000 }, + { 0x8700, 0xa3cf, 0x2000 }, + { 0x0700, 0xa3ce, 0x0000 }, + { 0x0700, 0xa3d0, 0x0000 }, + { 0x8700, 0xa3d3, 0x2000 }, + { 0x0700, 0xa3d2, 0x0000 }, + { 0x0700, 0xa3d4, 0x0000 }, + { 0x8700, 0xa3d9, 0x3000 }, + { 0x8700, 0xa3d7, 0x2000 }, + { 0x0700, 0xa3d6, 0x0000 }, + { 0x0700, 0xa3d8, 0x0000 }, + { 0x8700, 0xa3db, 0x2000 }, + { 0x0700, 0xa3da, 0x0000 }, + { 0x0700, 0xa3dc, 0x0000 }, + { 0x8700, 0xa3e5, 0x4000 }, + { 0x8700, 0xa3e1, 0x3000 }, + { 0x8700, 0xa3df, 0x2000 }, + { 0x0700, 0xa3de, 0x0000 }, + { 0x0700, 0xa3e0, 0x0000 }, + { 0x8700, 0xa3e3, 0x2000 }, + { 0x0700, 0xa3e2, 0x0000 }, + { 0x0700, 0xa3e4, 0x0000 }, + { 0x8700, 0xa3e9, 0x3000 }, + { 0x8700, 0xa3e7, 0x2000 }, + { 0x0700, 0xa3e6, 0x0000 }, + { 0x0700, 0xa3e8, 0x0000 }, + { 0x8700, 0xa3eb, 0x2000 }, + { 0x0700, 0xa3ea, 0x0000 }, + { 0x0700, 0xa3ec, 0x0000 }, + { 0x8700, 0xa3fd, 0x5000 }, + { 0x8700, 0xa3f5, 0x4000 }, + { 0x8700, 0xa3f1, 0x3000 }, + { 0x8700, 0xa3ef, 0x2000 }, + { 0x0700, 0xa3ee, 0x0000 }, + { 0x0700, 0xa3f0, 0x0000 }, + { 0x8700, 0xa3f3, 0x2000 }, + { 0x0700, 0xa3f2, 0x0000 }, + { 0x0700, 0xa3f4, 0x0000 }, + { 0x8700, 0xa3f9, 0x3000 }, + { 0x8700, 0xa3f7, 0x2000 }, + { 0x0700, 0xa3f6, 0x0000 }, + { 0x0700, 0xa3f8, 0x0000 }, + { 0x8700, 0xa3fb, 0x2000 }, + { 0x0700, 0xa3fa, 0x0000 }, + { 0x0700, 0xa3fc, 0x0000 }, + { 0x8700, 0xa405, 0x4000 }, + { 0x8700, 0xa401, 0x3000 }, + { 0x8700, 0xa3ff, 0x2000 }, + { 0x0700, 0xa3fe, 0x0000 }, + { 0x0700, 0xa400, 0x0000 }, + { 0x8700, 0xa403, 0x2000 }, + { 0x0700, 0xa402, 0x0000 }, + { 0x0700, 0xa404, 0x0000 }, + { 0x8700, 0xa409, 0x3000 }, + { 0x8700, 0xa407, 0x2000 }, + { 0x0700, 0xa406, 0x0000 }, + { 0x0700, 0xa408, 0x0000 }, + { 0x8700, 0xa40b, 0x2000 }, + { 0x0700, 0xa40a, 0x0000 }, + { 0x0700, 0xa40c, 0x0000 }, + { 0x8700, 0xa42d, 0x6000 }, + { 0x8700, 0xa41d, 0x5000 }, + { 0x8700, 0xa415, 0x4000 }, + { 0x8700, 0xa411, 0x3000 }, + { 0x8700, 0xa40f, 0x2000 }, + { 0x0700, 0xa40e, 0x0000 }, + { 0x0700, 0xa410, 0x0000 }, + { 0x8700, 0xa413, 0x2000 }, + { 0x0700, 0xa412, 0x0000 }, + { 0x0700, 0xa414, 0x0000 }, + { 0x8700, 0xa419, 0x3000 }, + { 0x8700, 0xa417, 0x2000 }, + { 0x0700, 0xa416, 0x0000 }, + { 0x0700, 0xa418, 0x0000 }, + { 0x8700, 0xa41b, 0x2000 }, + { 0x0700, 0xa41a, 0x0000 }, + { 0x0700, 0xa41c, 0x0000 }, + { 0x8700, 0xa425, 0x4000 }, + { 0x8700, 0xa421, 0x3000 }, + { 0x8700, 0xa41f, 0x2000 }, + { 0x0700, 0xa41e, 0x0000 }, + { 0x0700, 0xa420, 0x0000 }, + { 0x8700, 0xa423, 0x2000 }, + { 0x0700, 0xa422, 0x0000 }, + { 0x0700, 0xa424, 0x0000 }, + { 0x8700, 0xa429, 0x3000 }, + { 0x8700, 0xa427, 0x2000 }, + { 0x0700, 0xa426, 0x0000 }, + { 0x0700, 0xa428, 0x0000 }, + { 0x8700, 0xa42b, 0x2000 }, + { 0x0700, 0xa42a, 0x0000 }, + { 0x0700, 0xa42c, 0x0000 }, + { 0x8700, 0xa43d, 0x5000 }, + { 0x8700, 0xa435, 0x4000 }, + { 0x8700, 0xa431, 0x3000 }, + { 0x8700, 0xa42f, 0x2000 }, + { 0x0700, 0xa42e, 0x0000 }, + { 0x0700, 0xa430, 0x0000 }, + { 0x8700, 0xa433, 0x2000 }, + { 0x0700, 0xa432, 0x0000 }, + { 0x0700, 0xa434, 0x0000 }, + { 0x8700, 0xa439, 0x3000 }, + { 0x8700, 0xa437, 0x2000 }, + { 0x0700, 0xa436, 0x0000 }, + { 0x0700, 0xa438, 0x0000 }, + { 0x8700, 0xa43b, 0x2000 }, + { 0x0700, 0xa43a, 0x0000 }, + { 0x0700, 0xa43c, 0x0000 }, + { 0x8700, 0xa445, 0x4000 }, + { 0x8700, 0xa441, 0x3000 }, + { 0x8700, 0xa43f, 0x2000 }, + { 0x0700, 0xa43e, 0x0000 }, + { 0x0700, 0xa440, 0x0000 }, + { 0x8700, 0xa443, 0x2000 }, + { 0x0700, 0xa442, 0x0000 }, + { 0x0700, 0xa444, 0x0000 }, + { 0x8700, 0xa449, 0x3000 }, + { 0x8700, 0xa447, 0x2000 }, + { 0x0700, 0xa446, 0x0000 }, + { 0x0700, 0xa448, 0x0000 }, + { 0x8700, 0xa44b, 0x2000 }, + { 0x0700, 0xa44a, 0x0000 }, + { 0x0700, 0xa44c, 0x0000 }, + { 0x8300, 0xf8ff, 0x8000 }, + { 0x9a00, 0xa490, 0x7000 }, + { 0x8700, 0xa46d, 0x6000 }, + { 0x8700, 0xa45d, 0x5000 }, + { 0x8700, 0xa455, 0x4000 }, + { 0x8700, 0xa451, 0x3000 }, + { 0x8700, 0xa44f, 0x2000 }, + { 0x0700, 0xa44e, 0x0000 }, + { 0x0700, 0xa450, 0x0000 }, + { 0x8700, 0xa453, 0x2000 }, + { 0x0700, 0xa452, 0x0000 }, + { 0x0700, 0xa454, 0x0000 }, + { 0x8700, 0xa459, 0x3000 }, + { 0x8700, 0xa457, 0x2000 }, + { 0x0700, 0xa456, 0x0000 }, + { 0x0700, 0xa458, 0x0000 }, + { 0x8700, 0xa45b, 0x2000 }, + { 0x0700, 0xa45a, 0x0000 }, + { 0x0700, 0xa45c, 0x0000 }, + { 0x8700, 0xa465, 0x4000 }, + { 0x8700, 0xa461, 0x3000 }, + { 0x8700, 0xa45f, 0x2000 }, + { 0x0700, 0xa45e, 0x0000 }, + { 0x0700, 0xa460, 0x0000 }, + { 0x8700, 0xa463, 0x2000 }, + { 0x0700, 0xa462, 0x0000 }, + { 0x0700, 0xa464, 0x0000 }, + { 0x8700, 0xa469, 0x3000 }, + { 0x8700, 0xa467, 0x2000 }, + { 0x0700, 0xa466, 0x0000 }, + { 0x0700, 0xa468, 0x0000 }, + { 0x8700, 0xa46b, 0x2000 }, + { 0x0700, 0xa46a, 0x0000 }, + { 0x0700, 0xa46c, 0x0000 }, + { 0x8700, 0xa47d, 0x5000 }, + { 0x8700, 0xa475, 0x4000 }, + { 0x8700, 0xa471, 0x3000 }, + { 0x8700, 0xa46f, 0x2000 }, + { 0x0700, 0xa46e, 0x0000 }, + { 0x0700, 0xa470, 0x0000 }, + { 0x8700, 0xa473, 0x2000 }, + { 0x0700, 0xa472, 0x0000 }, + { 0x0700, 0xa474, 0x0000 }, + { 0x8700, 0xa479, 0x3000 }, + { 0x8700, 0xa477, 0x2000 }, + { 0x0700, 0xa476, 0x0000 }, + { 0x0700, 0xa478, 0x0000 }, + { 0x8700, 0xa47b, 0x2000 }, + { 0x0700, 0xa47a, 0x0000 }, + { 0x0700, 0xa47c, 0x0000 }, + { 0x8700, 0xa485, 0x4000 }, + { 0x8700, 0xa481, 0x3000 }, + { 0x8700, 0xa47f, 0x2000 }, + { 0x0700, 0xa47e, 0x0000 }, + { 0x0700, 0xa480, 0x0000 }, + { 0x8700, 0xa483, 0x2000 }, + { 0x0700, 0xa482, 0x0000 }, + { 0x0700, 0xa484, 0x0000 }, + { 0x8700, 0xa489, 0x3000 }, + { 0x8700, 0xa487, 0x2000 }, + { 0x0700, 0xa486, 0x0000 }, + { 0x0700, 0xa488, 0x0000 }, + { 0x8700, 0xa48b, 0x2000 }, + { 0x0700, 0xa48a, 0x0000 }, + { 0x0700, 0xa48c, 0x0000 }, + { 0x9a00, 0xa4b0, 0x6000 }, + { 0x9a00, 0xa4a0, 0x5000 }, + { 0x9a00, 0xa498, 0x4000 }, + { 0x9a00, 0xa494, 0x3000 }, + { 0x9a00, 0xa492, 0x2000 }, + { 0x1a00, 0xa491, 0x0000 }, + { 0x1a00, 0xa493, 0x0000 }, + { 0x9a00, 0xa496, 0x2000 }, + { 0x1a00, 0xa495, 0x0000 }, + { 0x1a00, 0xa497, 0x0000 }, + { 0x9a00, 0xa49c, 0x3000 }, + { 0x9a00, 0xa49a, 0x2000 }, + { 0x1a00, 0xa499, 0x0000 }, + { 0x1a00, 0xa49b, 0x0000 }, + { 0x9a00, 0xa49e, 0x2000 }, + { 0x1a00, 0xa49d, 0x0000 }, + { 0x1a00, 0xa49f, 0x0000 }, + { 0x9a00, 0xa4a8, 0x4000 }, + { 0x9a00, 0xa4a4, 0x3000 }, + { 0x9a00, 0xa4a2, 0x2000 }, + { 0x1a00, 0xa4a1, 0x0000 }, + { 0x1a00, 0xa4a3, 0x0000 }, + { 0x9a00, 0xa4a6, 0x2000 }, + { 0x1a00, 0xa4a5, 0x0000 }, + { 0x1a00, 0xa4a7, 0x0000 }, + { 0x9a00, 0xa4ac, 0x3000 }, + { 0x9a00, 0xa4aa, 0x2000 }, + { 0x1a00, 0xa4a9, 0x0000 }, + { 0x1a00, 0xa4ab, 0x0000 }, + { 0x9a00, 0xa4ae, 0x2000 }, + { 0x1a00, 0xa4ad, 0x0000 }, + { 0x1a00, 0xa4af, 0x0000 }, + { 0x9a00, 0xa4c0, 0x5000 }, + { 0x9a00, 0xa4b8, 0x4000 }, + { 0x9a00, 0xa4b4, 0x3000 }, + { 0x9a00, 0xa4b2, 0x2000 }, + { 0x1a00, 0xa4b1, 0x0000 }, + { 0x1a00, 0xa4b3, 0x0000 }, + { 0x9a00, 0xa4b6, 0x2000 }, + { 0x1a00, 0xa4b5, 0x0000 }, + { 0x1a00, 0xa4b7, 0x0000 }, + { 0x9a00, 0xa4bc, 0x3000 }, + { 0x9a00, 0xa4ba, 0x2000 }, + { 0x1a00, 0xa4b9, 0x0000 }, + { 0x1a00, 0xa4bb, 0x0000 }, + { 0x9a00, 0xa4be, 0x2000 }, + { 0x1a00, 0xa4bd, 0x0000 }, + { 0x1a00, 0xa4bf, 0x0000 }, + { 0x8700, 0xd7a3, 0x4000 }, + { 0x9a00, 0xa4c4, 0x3000 }, + { 0x9a00, 0xa4c2, 0x2000 }, + { 0x1a00, 0xa4c1, 0x0000 }, + { 0x1a00, 0xa4c3, 0x0000 }, + { 0x9a00, 0xa4c6, 0x2000 }, + { 0x1a00, 0xa4c5, 0x0000 }, + { 0x0700, 0xac00, 0x0000 }, + { 0x8400, 0xdbff, 0x3000 }, + { 0x8400, 0xdb7f, 0x2000 }, + { 0x0400, 0xd800, 0x0000 }, + { 0x0400, 0xdb80, 0x0000 }, + { 0x8400, 0xdfff, 0x2000 }, + { 0x0400, 0xdc00, 0x0000 }, + { 0x0300, 0xe000, 0x0000 }, + { 0x8700, 0xf93f, 0x7000 }, + { 0x8700, 0xf91f, 0x6000 }, + { 0x8700, 0xf90f, 0x5000 }, + { 0x8700, 0xf907, 0x4000 }, + { 0x8700, 0xf903, 0x3000 }, + { 0x8700, 0xf901, 0x2000 }, + { 0x0700, 0xf900, 0x0000 }, + { 0x0700, 0xf902, 0x0000 }, + { 0x8700, 0xf905, 0x2000 }, + { 0x0700, 0xf904, 0x0000 }, + { 0x0700, 0xf906, 0x0000 }, + { 0x8700, 0xf90b, 0x3000 }, + { 0x8700, 0xf909, 0x2000 }, + { 0x0700, 0xf908, 0x0000 }, + { 0x0700, 0xf90a, 0x0000 }, + { 0x8700, 0xf90d, 0x2000 }, + { 0x0700, 0xf90c, 0x0000 }, + { 0x0700, 0xf90e, 0x0000 }, + { 0x8700, 0xf917, 0x4000 }, + { 0x8700, 0xf913, 0x3000 }, + { 0x8700, 0xf911, 0x2000 }, + { 0x0700, 0xf910, 0x0000 }, + { 0x0700, 0xf912, 0x0000 }, + { 0x8700, 0xf915, 0x2000 }, + { 0x0700, 0xf914, 0x0000 }, + { 0x0700, 0xf916, 0x0000 }, + { 0x8700, 0xf91b, 0x3000 }, + { 0x8700, 0xf919, 0x2000 }, + { 0x0700, 0xf918, 0x0000 }, + { 0x0700, 0xf91a, 0x0000 }, + { 0x8700, 0xf91d, 0x2000 }, + { 0x0700, 0xf91c, 0x0000 }, + { 0x0700, 0xf91e, 0x0000 }, + { 0x8700, 0xf92f, 0x5000 }, + { 0x8700, 0xf927, 0x4000 }, + { 0x8700, 0xf923, 0x3000 }, + { 0x8700, 0xf921, 0x2000 }, + { 0x0700, 0xf920, 0x0000 }, + { 0x0700, 0xf922, 0x0000 }, + { 0x8700, 0xf925, 0x2000 }, + { 0x0700, 0xf924, 0x0000 }, + { 0x0700, 0xf926, 0x0000 }, + { 0x8700, 0xf92b, 0x3000 }, + { 0x8700, 0xf929, 0x2000 }, + { 0x0700, 0xf928, 0x0000 }, + { 0x0700, 0xf92a, 0x0000 }, + { 0x8700, 0xf92d, 0x2000 }, + { 0x0700, 0xf92c, 0x0000 }, + { 0x0700, 0xf92e, 0x0000 }, + { 0x8700, 0xf937, 0x4000 }, + { 0x8700, 0xf933, 0x3000 }, + { 0x8700, 0xf931, 0x2000 }, + { 0x0700, 0xf930, 0x0000 }, + { 0x0700, 0xf932, 0x0000 }, + { 0x8700, 0xf935, 0x2000 }, + { 0x0700, 0xf934, 0x0000 }, + { 0x0700, 0xf936, 0x0000 }, + { 0x8700, 0xf93b, 0x3000 }, + { 0x8700, 0xf939, 0x2000 }, + { 0x0700, 0xf938, 0x0000 }, + { 0x0700, 0xf93a, 0x0000 }, + { 0x8700, 0xf93d, 0x2000 }, + { 0x0700, 0xf93c, 0x0000 }, + { 0x0700, 0xf93e, 0x0000 }, + { 0x8700, 0xf95f, 0x6000 }, + { 0x8700, 0xf94f, 0x5000 }, + { 0x8700, 0xf947, 0x4000 }, + { 0x8700, 0xf943, 0x3000 }, + { 0x8700, 0xf941, 0x2000 }, + { 0x0700, 0xf940, 0x0000 }, + { 0x0700, 0xf942, 0x0000 }, + { 0x8700, 0xf945, 0x2000 }, + { 0x0700, 0xf944, 0x0000 }, + { 0x0700, 0xf946, 0x0000 }, + { 0x8700, 0xf94b, 0x3000 }, + { 0x8700, 0xf949, 0x2000 }, + { 0x0700, 0xf948, 0x0000 }, + { 0x0700, 0xf94a, 0x0000 }, + { 0x8700, 0xf94d, 0x2000 }, + { 0x0700, 0xf94c, 0x0000 }, + { 0x0700, 0xf94e, 0x0000 }, + { 0x8700, 0xf957, 0x4000 }, + { 0x8700, 0xf953, 0x3000 }, + { 0x8700, 0xf951, 0x2000 }, + { 0x0700, 0xf950, 0x0000 }, + { 0x0700, 0xf952, 0x0000 }, + { 0x8700, 0xf955, 0x2000 }, + { 0x0700, 0xf954, 0x0000 }, + { 0x0700, 0xf956, 0x0000 }, + { 0x8700, 0xf95b, 0x3000 }, + { 0x8700, 0xf959, 0x2000 }, + { 0x0700, 0xf958, 0x0000 }, + { 0x0700, 0xf95a, 0x0000 }, + { 0x8700, 0xf95d, 0x2000 }, + { 0x0700, 0xf95c, 0x0000 }, + { 0x0700, 0xf95e, 0x0000 }, + { 0x8700, 0xf96f, 0x5000 }, + { 0x8700, 0xf967, 0x4000 }, + { 0x8700, 0xf963, 0x3000 }, + { 0x8700, 0xf961, 0x2000 }, + { 0x0700, 0xf960, 0x0000 }, + { 0x0700, 0xf962, 0x0000 }, + { 0x8700, 0xf965, 0x2000 }, + { 0x0700, 0xf964, 0x0000 }, + { 0x0700, 0xf966, 0x0000 }, + { 0x8700, 0xf96b, 0x3000 }, + { 0x8700, 0xf969, 0x2000 }, + { 0x0700, 0xf968, 0x0000 }, + { 0x0700, 0xf96a, 0x0000 }, + { 0x8700, 0xf96d, 0x2000 }, + { 0x0700, 0xf96c, 0x0000 }, + { 0x0700, 0xf96e, 0x0000 }, + { 0x8700, 0xf977, 0x4000 }, + { 0x8700, 0xf973, 0x3000 }, + { 0x8700, 0xf971, 0x2000 }, + { 0x0700, 0xf970, 0x0000 }, + { 0x0700, 0xf972, 0x0000 }, + { 0x8700, 0xf975, 0x2000 }, + { 0x0700, 0xf974, 0x0000 }, + { 0x0700, 0xf976, 0x0000 }, + { 0x8700, 0xf97b, 0x3000 }, + { 0x8700, 0xf979, 0x2000 }, + { 0x0700, 0xf978, 0x0000 }, + { 0x0700, 0xf97a, 0x0000 }, + { 0x8700, 0xf97d, 0x2000 }, + { 0x0700, 0xf97c, 0x0000 }, + { 0x0700, 0xf97e, 0x0000 }, + { 0x8700, 0xfb27, 0x9000 }, + { 0x8700, 0xf9ff, 0x8000 }, + { 0x8700, 0xf9bf, 0x7000 }, + { 0x8700, 0xf99f, 0x6000 }, + { 0x8700, 0xf98f, 0x5000 }, + { 0x8700, 0xf987, 0x4000 }, + { 0x8700, 0xf983, 0x3000 }, + { 0x8700, 0xf981, 0x2000 }, + { 0x0700, 0xf980, 0x0000 }, + { 0x0700, 0xf982, 0x0000 }, + { 0x8700, 0xf985, 0x2000 }, + { 0x0700, 0xf984, 0x0000 }, + { 0x0700, 0xf986, 0x0000 }, + { 0x8700, 0xf98b, 0x3000 }, + { 0x8700, 0xf989, 0x2000 }, + { 0x0700, 0xf988, 0x0000 }, + { 0x0700, 0xf98a, 0x0000 }, + { 0x8700, 0xf98d, 0x2000 }, + { 0x0700, 0xf98c, 0x0000 }, + { 0x0700, 0xf98e, 0x0000 }, + { 0x8700, 0xf997, 0x4000 }, + { 0x8700, 0xf993, 0x3000 }, + { 0x8700, 0xf991, 0x2000 }, + { 0x0700, 0xf990, 0x0000 }, + { 0x0700, 0xf992, 0x0000 }, + { 0x8700, 0xf995, 0x2000 }, + { 0x0700, 0xf994, 0x0000 }, + { 0x0700, 0xf996, 0x0000 }, + { 0x8700, 0xf99b, 0x3000 }, + { 0x8700, 0xf999, 0x2000 }, + { 0x0700, 0xf998, 0x0000 }, + { 0x0700, 0xf99a, 0x0000 }, + { 0x8700, 0xf99d, 0x2000 }, + { 0x0700, 0xf99c, 0x0000 }, + { 0x0700, 0xf99e, 0x0000 }, + { 0x8700, 0xf9af, 0x5000 }, + { 0x8700, 0xf9a7, 0x4000 }, + { 0x8700, 0xf9a3, 0x3000 }, + { 0x8700, 0xf9a1, 0x2000 }, + { 0x0700, 0xf9a0, 0x0000 }, + { 0x0700, 0xf9a2, 0x0000 }, + { 0x8700, 0xf9a5, 0x2000 }, + { 0x0700, 0xf9a4, 0x0000 }, + { 0x0700, 0xf9a6, 0x0000 }, + { 0x8700, 0xf9ab, 0x3000 }, + { 0x8700, 0xf9a9, 0x2000 }, + { 0x0700, 0xf9a8, 0x0000 }, + { 0x0700, 0xf9aa, 0x0000 }, + { 0x8700, 0xf9ad, 0x2000 }, + { 0x0700, 0xf9ac, 0x0000 }, + { 0x0700, 0xf9ae, 0x0000 }, + { 0x8700, 0xf9b7, 0x4000 }, + { 0x8700, 0xf9b3, 0x3000 }, + { 0x8700, 0xf9b1, 0x2000 }, + { 0x0700, 0xf9b0, 0x0000 }, + { 0x0700, 0xf9b2, 0x0000 }, + { 0x8700, 0xf9b5, 0x2000 }, + { 0x0700, 0xf9b4, 0x0000 }, + { 0x0700, 0xf9b6, 0x0000 }, + { 0x8700, 0xf9bb, 0x3000 }, + { 0x8700, 0xf9b9, 0x2000 }, + { 0x0700, 0xf9b8, 0x0000 }, + { 0x0700, 0xf9ba, 0x0000 }, + { 0x8700, 0xf9bd, 0x2000 }, + { 0x0700, 0xf9bc, 0x0000 }, + { 0x0700, 0xf9be, 0x0000 }, + { 0x8700, 0xf9df, 0x6000 }, + { 0x8700, 0xf9cf, 0x5000 }, + { 0x8700, 0xf9c7, 0x4000 }, + { 0x8700, 0xf9c3, 0x3000 }, + { 0x8700, 0xf9c1, 0x2000 }, + { 0x0700, 0xf9c0, 0x0000 }, + { 0x0700, 0xf9c2, 0x0000 }, + { 0x8700, 0xf9c5, 0x2000 }, + { 0x0700, 0xf9c4, 0x0000 }, + { 0x0700, 0xf9c6, 0x0000 }, + { 0x8700, 0xf9cb, 0x3000 }, + { 0x8700, 0xf9c9, 0x2000 }, + { 0x0700, 0xf9c8, 0x0000 }, + { 0x0700, 0xf9ca, 0x0000 }, + { 0x8700, 0xf9cd, 0x2000 }, + { 0x0700, 0xf9cc, 0x0000 }, + { 0x0700, 0xf9ce, 0x0000 }, + { 0x8700, 0xf9d7, 0x4000 }, + { 0x8700, 0xf9d3, 0x3000 }, + { 0x8700, 0xf9d1, 0x2000 }, + { 0x0700, 0xf9d0, 0x0000 }, + { 0x0700, 0xf9d2, 0x0000 }, + { 0x8700, 0xf9d5, 0x2000 }, + { 0x0700, 0xf9d4, 0x0000 }, + { 0x0700, 0xf9d6, 0x0000 }, + { 0x8700, 0xf9db, 0x3000 }, + { 0x8700, 0xf9d9, 0x2000 }, + { 0x0700, 0xf9d8, 0x0000 }, + { 0x0700, 0xf9da, 0x0000 }, + { 0x8700, 0xf9dd, 0x2000 }, + { 0x0700, 0xf9dc, 0x0000 }, + { 0x0700, 0xf9de, 0x0000 }, + { 0x8700, 0xf9ef, 0x5000 }, + { 0x8700, 0xf9e7, 0x4000 }, + { 0x8700, 0xf9e3, 0x3000 }, + { 0x8700, 0xf9e1, 0x2000 }, + { 0x0700, 0xf9e0, 0x0000 }, + { 0x0700, 0xf9e2, 0x0000 }, + { 0x8700, 0xf9e5, 0x2000 }, + { 0x0700, 0xf9e4, 0x0000 }, + { 0x0700, 0xf9e6, 0x0000 }, + { 0x8700, 0xf9eb, 0x3000 }, + { 0x8700, 0xf9e9, 0x2000 }, + { 0x0700, 0xf9e8, 0x0000 }, + { 0x0700, 0xf9ea, 0x0000 }, + { 0x8700, 0xf9ed, 0x2000 }, + { 0x0700, 0xf9ec, 0x0000 }, + { 0x0700, 0xf9ee, 0x0000 }, + { 0x8700, 0xf9f7, 0x4000 }, + { 0x8700, 0xf9f3, 0x3000 }, + { 0x8700, 0xf9f1, 0x2000 }, + { 0x0700, 0xf9f0, 0x0000 }, + { 0x0700, 0xf9f2, 0x0000 }, + { 0x8700, 0xf9f5, 0x2000 }, + { 0x0700, 0xf9f4, 0x0000 }, + { 0x0700, 0xf9f6, 0x0000 }, + { 0x8700, 0xf9fb, 0x3000 }, + { 0x8700, 0xf9f9, 0x2000 }, + { 0x0700, 0xf9f8, 0x0000 }, + { 0x0700, 0xf9fa, 0x0000 }, + { 0x8700, 0xf9fd, 0x2000 }, + { 0x0700, 0xf9fc, 0x0000 }, + { 0x0700, 0xf9fe, 0x0000 }, + { 0x8700, 0xfa41, 0x7000 }, + { 0x8700, 0xfa1f, 0x6000 }, + { 0x8700, 0xfa0f, 0x5000 }, + { 0x8700, 0xfa07, 0x4000 }, + { 0x8700, 0xfa03, 0x3000 }, + { 0x8700, 0xfa01, 0x2000 }, + { 0x0700, 0xfa00, 0x0000 }, + { 0x0700, 0xfa02, 0x0000 }, + { 0x8700, 0xfa05, 0x2000 }, + { 0x0700, 0xfa04, 0x0000 }, + { 0x0700, 0xfa06, 0x0000 }, + { 0x8700, 0xfa0b, 0x3000 }, + { 0x8700, 0xfa09, 0x2000 }, + { 0x0700, 0xfa08, 0x0000 }, + { 0x0700, 0xfa0a, 0x0000 }, + { 0x8700, 0xfa0d, 0x2000 }, + { 0x0700, 0xfa0c, 0x0000 }, + { 0x0700, 0xfa0e, 0x0000 }, + { 0x8700, 0xfa17, 0x4000 }, + { 0x8700, 0xfa13, 0x3000 }, + { 0x8700, 0xfa11, 0x2000 }, + { 0x0700, 0xfa10, 0x0000 }, + { 0x0700, 0xfa12, 0x0000 }, + { 0x8700, 0xfa15, 0x2000 }, + { 0x0700, 0xfa14, 0x0000 }, + { 0x0700, 0xfa16, 0x0000 }, + { 0x8700, 0xfa1b, 0x3000 }, + { 0x8700, 0xfa19, 0x2000 }, + { 0x0700, 0xfa18, 0x0000 }, + { 0x0700, 0xfa1a, 0x0000 }, + { 0x8700, 0xfa1d, 0x2000 }, + { 0x0700, 0xfa1c, 0x0000 }, + { 0x0700, 0xfa1e, 0x0000 }, + { 0x8700, 0xfa31, 0x5000 }, + { 0x8700, 0xfa27, 0x4000 }, + { 0x8700, 0xfa23, 0x3000 }, + { 0x8700, 0xfa21, 0x2000 }, + { 0x0700, 0xfa20, 0x0000 }, + { 0x0700, 0xfa22, 0x0000 }, + { 0x8700, 0xfa25, 0x2000 }, + { 0x0700, 0xfa24, 0x0000 }, + { 0x0700, 0xfa26, 0x0000 }, + { 0x8700, 0xfa2b, 0x3000 }, + { 0x8700, 0xfa29, 0x2000 }, + { 0x0700, 0xfa28, 0x0000 }, + { 0x0700, 0xfa2a, 0x0000 }, + { 0x8700, 0xfa2d, 0x2000 }, + { 0x0700, 0xfa2c, 0x0000 }, + { 0x0700, 0xfa30, 0x0000 }, + { 0x8700, 0xfa39, 0x4000 }, + { 0x8700, 0xfa35, 0x3000 }, + { 0x8700, 0xfa33, 0x2000 }, + { 0x0700, 0xfa32, 0x0000 }, + { 0x0700, 0xfa34, 0x0000 }, + { 0x8700, 0xfa37, 0x2000 }, + { 0x0700, 0xfa36, 0x0000 }, + { 0x0700, 0xfa38, 0x0000 }, + { 0x8700, 0xfa3d, 0x3000 }, + { 0x8700, 0xfa3b, 0x2000 }, + { 0x0700, 0xfa3a, 0x0000 }, + { 0x0700, 0xfa3c, 0x0000 }, + { 0x8700, 0xfa3f, 0x2000 }, + { 0x0700, 0xfa3e, 0x0000 }, + { 0x0700, 0xfa40, 0x0000 }, + { 0x8700, 0xfa61, 0x6000 }, + { 0x8700, 0xfa51, 0x5000 }, + { 0x8700, 0xfa49, 0x4000 }, + { 0x8700, 0xfa45, 0x3000 }, + { 0x8700, 0xfa43, 0x2000 }, + { 0x0700, 0xfa42, 0x0000 }, + { 0x0700, 0xfa44, 0x0000 }, + { 0x8700, 0xfa47, 0x2000 }, + { 0x0700, 0xfa46, 0x0000 }, + { 0x0700, 0xfa48, 0x0000 }, + { 0x8700, 0xfa4d, 0x3000 }, + { 0x8700, 0xfa4b, 0x2000 }, + { 0x0700, 0xfa4a, 0x0000 }, + { 0x0700, 0xfa4c, 0x0000 }, + { 0x8700, 0xfa4f, 0x2000 }, + { 0x0700, 0xfa4e, 0x0000 }, + { 0x0700, 0xfa50, 0x0000 }, + { 0x8700, 0xfa59, 0x4000 }, + { 0x8700, 0xfa55, 0x3000 }, + { 0x8700, 0xfa53, 0x2000 }, + { 0x0700, 0xfa52, 0x0000 }, + { 0x0700, 0xfa54, 0x0000 }, + { 0x8700, 0xfa57, 0x2000 }, + { 0x0700, 0xfa56, 0x0000 }, + { 0x0700, 0xfa58, 0x0000 }, + { 0x8700, 0xfa5d, 0x3000 }, + { 0x8700, 0xfa5b, 0x2000 }, + { 0x0700, 0xfa5a, 0x0000 }, + { 0x0700, 0xfa5c, 0x0000 }, + { 0x8700, 0xfa5f, 0x2000 }, + { 0x0700, 0xfa5e, 0x0000 }, + { 0x0700, 0xfa60, 0x0000 }, + { 0x8500, 0xfb06, 0x5000 }, + { 0x8700, 0xfa69, 0x4000 }, + { 0x8700, 0xfa65, 0x3000 }, + { 0x8700, 0xfa63, 0x2000 }, + { 0x0700, 0xfa62, 0x0000 }, + { 0x0700, 0xfa64, 0x0000 }, + { 0x8700, 0xfa67, 0x2000 }, + { 0x0700, 0xfa66, 0x0000 }, + { 0x0700, 0xfa68, 0x0000 }, + { 0x8500, 0xfb02, 0x3000 }, + { 0x8500, 0xfb00, 0x2000 }, + { 0x0700, 0xfa6a, 0x0000 }, + { 0x0500, 0xfb01, 0x0000 }, + { 0x8500, 0xfb04, 0x2000 }, + { 0x0500, 0xfb03, 0x0000 }, + { 0x0500, 0xfb05, 0x0000 }, + { 0x8700, 0xfb1f, 0x4000 }, + { 0x8500, 0xfb16, 0x3000 }, + { 0x8500, 0xfb14, 0x2000 }, + { 0x0500, 0xfb13, 0x0000 }, + { 0x0500, 0xfb15, 0x0000 }, + { 0x8700, 0xfb1d, 0x2000 }, + { 0x0500, 0xfb17, 0x0000 }, + { 0x0c00, 0xfb1e, 0x0000 }, + { 0x8700, 0xfb23, 0x3000 }, + { 0x8700, 0xfb21, 0x2000 }, + { 0x0700, 0xfb20, 0x0000 }, + { 0x0700, 0xfb22, 0x0000 }, + { 0x8700, 0xfb25, 0x2000 }, + { 0x0700, 0xfb24, 0x0000 }, + { 0x0700, 0xfb26, 0x0000 }, + { 0x8700, 0xfbac, 0x8000 }, + { 0x8700, 0xfb6c, 0x7000 }, + { 0x8700, 0xfb4c, 0x6000 }, + { 0x8700, 0xfb38, 0x5000 }, + { 0x8700, 0xfb2f, 0x4000 }, + { 0x8700, 0xfb2b, 0x3000 }, + { 0x9900, 0xfb29, 0x2000 }, + { 0x0700, 0xfb28, 0x0000 }, + { 0x0700, 0xfb2a, 0x0000 }, + { 0x8700, 0xfb2d, 0x2000 }, + { 0x0700, 0xfb2c, 0x0000 }, + { 0x0700, 0xfb2e, 0x0000 }, + { 0x8700, 0xfb33, 0x3000 }, + { 0x8700, 0xfb31, 0x2000 }, + { 0x0700, 0xfb30, 0x0000 }, + { 0x0700, 0xfb32, 0x0000 }, + { 0x8700, 0xfb35, 0x2000 }, + { 0x0700, 0xfb34, 0x0000 }, + { 0x0700, 0xfb36, 0x0000 }, + { 0x8700, 0xfb43, 0x4000 }, + { 0x8700, 0xfb3c, 0x3000 }, + { 0x8700, 0xfb3a, 0x2000 }, + { 0x0700, 0xfb39, 0x0000 }, + { 0x0700, 0xfb3b, 0x0000 }, + { 0x8700, 0xfb40, 0x2000 }, + { 0x0700, 0xfb3e, 0x0000 }, + { 0x0700, 0xfb41, 0x0000 }, + { 0x8700, 0xfb48, 0x3000 }, + { 0x8700, 0xfb46, 0x2000 }, + { 0x0700, 0xfb44, 0x0000 }, + { 0x0700, 0xfb47, 0x0000 }, + { 0x8700, 0xfb4a, 0x2000 }, + { 0x0700, 0xfb49, 0x0000 }, + { 0x0700, 0xfb4b, 0x0000 }, + { 0x8700, 0xfb5c, 0x5000 }, + { 0x8700, 0xfb54, 0x4000 }, + { 0x8700, 0xfb50, 0x3000 }, + { 0x8700, 0xfb4e, 0x2000 }, + { 0x0700, 0xfb4d, 0x0000 }, + { 0x0700, 0xfb4f, 0x0000 }, + { 0x8700, 0xfb52, 0x2000 }, + { 0x0700, 0xfb51, 0x0000 }, + { 0x0700, 0xfb53, 0x0000 }, + { 0x8700, 0xfb58, 0x3000 }, + { 0x8700, 0xfb56, 0x2000 }, + { 0x0700, 0xfb55, 0x0000 }, + { 0x0700, 0xfb57, 0x0000 }, + { 0x8700, 0xfb5a, 0x2000 }, + { 0x0700, 0xfb59, 0x0000 }, + { 0x0700, 0xfb5b, 0x0000 }, + { 0x8700, 0xfb64, 0x4000 }, + { 0x8700, 0xfb60, 0x3000 }, + { 0x8700, 0xfb5e, 0x2000 }, + { 0x0700, 0xfb5d, 0x0000 }, + { 0x0700, 0xfb5f, 0x0000 }, + { 0x8700, 0xfb62, 0x2000 }, + { 0x0700, 0xfb61, 0x0000 }, + { 0x0700, 0xfb63, 0x0000 }, + { 0x8700, 0xfb68, 0x3000 }, + { 0x8700, 0xfb66, 0x2000 }, + { 0x0700, 0xfb65, 0x0000 }, + { 0x0700, 0xfb67, 0x0000 }, + { 0x8700, 0xfb6a, 0x2000 }, + { 0x0700, 0xfb69, 0x0000 }, + { 0x0700, 0xfb6b, 0x0000 }, + { 0x8700, 0xfb8c, 0x6000 }, + { 0x8700, 0xfb7c, 0x5000 }, + { 0x8700, 0xfb74, 0x4000 }, + { 0x8700, 0xfb70, 0x3000 }, + { 0x8700, 0xfb6e, 0x2000 }, + { 0x0700, 0xfb6d, 0x0000 }, + { 0x0700, 0xfb6f, 0x0000 }, + { 0x8700, 0xfb72, 0x2000 }, + { 0x0700, 0xfb71, 0x0000 }, + { 0x0700, 0xfb73, 0x0000 }, + { 0x8700, 0xfb78, 0x3000 }, + { 0x8700, 0xfb76, 0x2000 }, + { 0x0700, 0xfb75, 0x0000 }, + { 0x0700, 0xfb77, 0x0000 }, + { 0x8700, 0xfb7a, 0x2000 }, + { 0x0700, 0xfb79, 0x0000 }, + { 0x0700, 0xfb7b, 0x0000 }, + { 0x8700, 0xfb84, 0x4000 }, + { 0x8700, 0xfb80, 0x3000 }, + { 0x8700, 0xfb7e, 0x2000 }, + { 0x0700, 0xfb7d, 0x0000 }, + { 0x0700, 0xfb7f, 0x0000 }, + { 0x8700, 0xfb82, 0x2000 }, + { 0x0700, 0xfb81, 0x0000 }, + { 0x0700, 0xfb83, 0x0000 }, + { 0x8700, 0xfb88, 0x3000 }, + { 0x8700, 0xfb86, 0x2000 }, + { 0x0700, 0xfb85, 0x0000 }, + { 0x0700, 0xfb87, 0x0000 }, + { 0x8700, 0xfb8a, 0x2000 }, + { 0x0700, 0xfb89, 0x0000 }, + { 0x0700, 0xfb8b, 0x0000 }, + { 0x8700, 0xfb9c, 0x5000 }, + { 0x8700, 0xfb94, 0x4000 }, + { 0x8700, 0xfb90, 0x3000 }, + { 0x8700, 0xfb8e, 0x2000 }, + { 0x0700, 0xfb8d, 0x0000 }, + { 0x0700, 0xfb8f, 0x0000 }, + { 0x8700, 0xfb92, 0x2000 }, + { 0x0700, 0xfb91, 0x0000 }, + { 0x0700, 0xfb93, 0x0000 }, + { 0x8700, 0xfb98, 0x3000 }, + { 0x8700, 0xfb96, 0x2000 }, + { 0x0700, 0xfb95, 0x0000 }, + { 0x0700, 0xfb97, 0x0000 }, + { 0x8700, 0xfb9a, 0x2000 }, + { 0x0700, 0xfb99, 0x0000 }, + { 0x0700, 0xfb9b, 0x0000 }, + { 0x8700, 0xfba4, 0x4000 }, + { 0x8700, 0xfba0, 0x3000 }, + { 0x8700, 0xfb9e, 0x2000 }, + { 0x0700, 0xfb9d, 0x0000 }, + { 0x0700, 0xfb9f, 0x0000 }, + { 0x8700, 0xfba2, 0x2000 }, + { 0x0700, 0xfba1, 0x0000 }, + { 0x0700, 0xfba3, 0x0000 }, + { 0x8700, 0xfba8, 0x3000 }, + { 0x8700, 0xfba6, 0x2000 }, + { 0x0700, 0xfba5, 0x0000 }, + { 0x0700, 0xfba7, 0x0000 }, + { 0x8700, 0xfbaa, 0x2000 }, + { 0x0700, 0xfba9, 0x0000 }, + { 0x0700, 0xfbab, 0x0000 }, + { 0x8700, 0xfc0d, 0x7000 }, + { 0x8700, 0xfbed, 0x6000 }, + { 0x8700, 0xfbdd, 0x5000 }, + { 0x8700, 0xfbd5, 0x4000 }, + { 0x8700, 0xfbb0, 0x3000 }, + { 0x8700, 0xfbae, 0x2000 }, + { 0x0700, 0xfbad, 0x0000 }, + { 0x0700, 0xfbaf, 0x0000 }, + { 0x8700, 0xfbd3, 0x2000 }, + { 0x0700, 0xfbb1, 0x0000 }, + { 0x0700, 0xfbd4, 0x0000 }, + { 0x8700, 0xfbd9, 0x3000 }, + { 0x8700, 0xfbd7, 0x2000 }, + { 0x0700, 0xfbd6, 0x0000 }, + { 0x0700, 0xfbd8, 0x0000 }, + { 0x8700, 0xfbdb, 0x2000 }, + { 0x0700, 0xfbda, 0x0000 }, + { 0x0700, 0xfbdc, 0x0000 }, + { 0x8700, 0xfbe5, 0x4000 }, + { 0x8700, 0xfbe1, 0x3000 }, + { 0x8700, 0xfbdf, 0x2000 }, + { 0x0700, 0xfbde, 0x0000 }, + { 0x0700, 0xfbe0, 0x0000 }, + { 0x8700, 0xfbe3, 0x2000 }, + { 0x0700, 0xfbe2, 0x0000 }, + { 0x0700, 0xfbe4, 0x0000 }, + { 0x8700, 0xfbe9, 0x3000 }, + { 0x8700, 0xfbe7, 0x2000 }, + { 0x0700, 0xfbe6, 0x0000 }, + { 0x0700, 0xfbe8, 0x0000 }, + { 0x8700, 0xfbeb, 0x2000 }, + { 0x0700, 0xfbea, 0x0000 }, + { 0x0700, 0xfbec, 0x0000 }, + { 0x8700, 0xfbfd, 0x5000 }, + { 0x8700, 0xfbf5, 0x4000 }, + { 0x8700, 0xfbf1, 0x3000 }, + { 0x8700, 0xfbef, 0x2000 }, + { 0x0700, 0xfbee, 0x0000 }, + { 0x0700, 0xfbf0, 0x0000 }, + { 0x8700, 0xfbf3, 0x2000 }, + { 0x0700, 0xfbf2, 0x0000 }, + { 0x0700, 0xfbf4, 0x0000 }, + { 0x8700, 0xfbf9, 0x3000 }, + { 0x8700, 0xfbf7, 0x2000 }, + { 0x0700, 0xfbf6, 0x0000 }, + { 0x0700, 0xfbf8, 0x0000 }, + { 0x8700, 0xfbfb, 0x2000 }, + { 0x0700, 0xfbfa, 0x0000 }, + { 0x0700, 0xfbfc, 0x0000 }, + { 0x8700, 0xfc05, 0x4000 }, + { 0x8700, 0xfc01, 0x3000 }, + { 0x8700, 0xfbff, 0x2000 }, + { 0x0700, 0xfbfe, 0x0000 }, + { 0x0700, 0xfc00, 0x0000 }, + { 0x8700, 0xfc03, 0x2000 }, + { 0x0700, 0xfc02, 0x0000 }, + { 0x0700, 0xfc04, 0x0000 }, + { 0x8700, 0xfc09, 0x3000 }, + { 0x8700, 0xfc07, 0x2000 }, + { 0x0700, 0xfc06, 0x0000 }, + { 0x0700, 0xfc08, 0x0000 }, + { 0x8700, 0xfc0b, 0x2000 }, + { 0x0700, 0xfc0a, 0x0000 }, + { 0x0700, 0xfc0c, 0x0000 }, + { 0x8700, 0xfc2d, 0x6000 }, + { 0x8700, 0xfc1d, 0x5000 }, + { 0x8700, 0xfc15, 0x4000 }, + { 0x8700, 0xfc11, 0x3000 }, + { 0x8700, 0xfc0f, 0x2000 }, + { 0x0700, 0xfc0e, 0x0000 }, + { 0x0700, 0xfc10, 0x0000 }, + { 0x8700, 0xfc13, 0x2000 }, + { 0x0700, 0xfc12, 0x0000 }, + { 0x0700, 0xfc14, 0x0000 }, + { 0x8700, 0xfc19, 0x3000 }, + { 0x8700, 0xfc17, 0x2000 }, + { 0x0700, 0xfc16, 0x0000 }, + { 0x0700, 0xfc18, 0x0000 }, + { 0x8700, 0xfc1b, 0x2000 }, + { 0x0700, 0xfc1a, 0x0000 }, + { 0x0700, 0xfc1c, 0x0000 }, + { 0x8700, 0xfc25, 0x4000 }, + { 0x8700, 0xfc21, 0x3000 }, + { 0x8700, 0xfc1f, 0x2000 }, + { 0x0700, 0xfc1e, 0x0000 }, + { 0x0700, 0xfc20, 0x0000 }, + { 0x8700, 0xfc23, 0x2000 }, + { 0x0700, 0xfc22, 0x0000 }, + { 0x0700, 0xfc24, 0x0000 }, + { 0x8700, 0xfc29, 0x3000 }, + { 0x8700, 0xfc27, 0x2000 }, + { 0x0700, 0xfc26, 0x0000 }, + { 0x0700, 0xfc28, 0x0000 }, + { 0x8700, 0xfc2b, 0x2000 }, + { 0x0700, 0xfc2a, 0x0000 }, + { 0x0700, 0xfc2c, 0x0000 }, + { 0x8700, 0xfc3d, 0x5000 }, + { 0x8700, 0xfc35, 0x4000 }, + { 0x8700, 0xfc31, 0x3000 }, + { 0x8700, 0xfc2f, 0x2000 }, + { 0x0700, 0xfc2e, 0x0000 }, + { 0x0700, 0xfc30, 0x0000 }, + { 0x8700, 0xfc33, 0x2000 }, + { 0x0700, 0xfc32, 0x0000 }, + { 0x0700, 0xfc34, 0x0000 }, + { 0x8700, 0xfc39, 0x3000 }, + { 0x8700, 0xfc37, 0x2000 }, + { 0x0700, 0xfc36, 0x0000 }, + { 0x0700, 0xfc38, 0x0000 }, + { 0x8700, 0xfc3b, 0x2000 }, + { 0x0700, 0xfc3a, 0x0000 }, + { 0x0700, 0xfc3c, 0x0000 }, + { 0x8700, 0xfc45, 0x4000 }, + { 0x8700, 0xfc41, 0x3000 }, + { 0x8700, 0xfc3f, 0x2000 }, + { 0x0700, 0xfc3e, 0x0000 }, + { 0x0700, 0xfc40, 0x0000 }, + { 0x8700, 0xfc43, 0x2000 }, + { 0x0700, 0xfc42, 0x0000 }, + { 0x0700, 0xfc44, 0x0000 }, + { 0x8700, 0xfc49, 0x3000 }, + { 0x8700, 0xfc47, 0x2000 }, + { 0x0700, 0xfc46, 0x0000 }, + { 0x0700, 0xfc48, 0x0000 }, + { 0x8700, 0xfc4b, 0x2000 }, + { 0x0700, 0xfc4a, 0x0000 }, + { 0x0700, 0xfc4c, 0x0000 }, + { 0x8700, 0xfeac, 0xa000 }, + { 0x8700, 0xfd5d, 0x9000 }, + { 0x8700, 0xfccd, 0x8000 }, + { 0x8700, 0xfc8d, 0x7000 }, + { 0x8700, 0xfc6d, 0x6000 }, + { 0x8700, 0xfc5d, 0x5000 }, + { 0x8700, 0xfc55, 0x4000 }, + { 0x8700, 0xfc51, 0x3000 }, + { 0x8700, 0xfc4f, 0x2000 }, + { 0x0700, 0xfc4e, 0x0000 }, + { 0x0700, 0xfc50, 0x0000 }, + { 0x8700, 0xfc53, 0x2000 }, + { 0x0700, 0xfc52, 0x0000 }, + { 0x0700, 0xfc54, 0x0000 }, + { 0x8700, 0xfc59, 0x3000 }, + { 0x8700, 0xfc57, 0x2000 }, + { 0x0700, 0xfc56, 0x0000 }, + { 0x0700, 0xfc58, 0x0000 }, + { 0x8700, 0xfc5b, 0x2000 }, + { 0x0700, 0xfc5a, 0x0000 }, + { 0x0700, 0xfc5c, 0x0000 }, + { 0x8700, 0xfc65, 0x4000 }, + { 0x8700, 0xfc61, 0x3000 }, + { 0x8700, 0xfc5f, 0x2000 }, + { 0x0700, 0xfc5e, 0x0000 }, + { 0x0700, 0xfc60, 0x0000 }, + { 0x8700, 0xfc63, 0x2000 }, + { 0x0700, 0xfc62, 0x0000 }, + { 0x0700, 0xfc64, 0x0000 }, + { 0x8700, 0xfc69, 0x3000 }, + { 0x8700, 0xfc67, 0x2000 }, + { 0x0700, 0xfc66, 0x0000 }, + { 0x0700, 0xfc68, 0x0000 }, + { 0x8700, 0xfc6b, 0x2000 }, + { 0x0700, 0xfc6a, 0x0000 }, + { 0x0700, 0xfc6c, 0x0000 }, + { 0x8700, 0xfc7d, 0x5000 }, + { 0x8700, 0xfc75, 0x4000 }, + { 0x8700, 0xfc71, 0x3000 }, + { 0x8700, 0xfc6f, 0x2000 }, + { 0x0700, 0xfc6e, 0x0000 }, + { 0x0700, 0xfc70, 0x0000 }, + { 0x8700, 0xfc73, 0x2000 }, + { 0x0700, 0xfc72, 0x0000 }, + { 0x0700, 0xfc74, 0x0000 }, + { 0x8700, 0xfc79, 0x3000 }, + { 0x8700, 0xfc77, 0x2000 }, + { 0x0700, 0xfc76, 0x0000 }, + { 0x0700, 0xfc78, 0x0000 }, + { 0x8700, 0xfc7b, 0x2000 }, + { 0x0700, 0xfc7a, 0x0000 }, + { 0x0700, 0xfc7c, 0x0000 }, + { 0x8700, 0xfc85, 0x4000 }, + { 0x8700, 0xfc81, 0x3000 }, + { 0x8700, 0xfc7f, 0x2000 }, + { 0x0700, 0xfc7e, 0x0000 }, + { 0x0700, 0xfc80, 0x0000 }, + { 0x8700, 0xfc83, 0x2000 }, + { 0x0700, 0xfc82, 0x0000 }, + { 0x0700, 0xfc84, 0x0000 }, + { 0x8700, 0xfc89, 0x3000 }, + { 0x8700, 0xfc87, 0x2000 }, + { 0x0700, 0xfc86, 0x0000 }, + { 0x0700, 0xfc88, 0x0000 }, + { 0x8700, 0xfc8b, 0x2000 }, + { 0x0700, 0xfc8a, 0x0000 }, + { 0x0700, 0xfc8c, 0x0000 }, + { 0x8700, 0xfcad, 0x6000 }, + { 0x8700, 0xfc9d, 0x5000 }, + { 0x8700, 0xfc95, 0x4000 }, + { 0x8700, 0xfc91, 0x3000 }, + { 0x8700, 0xfc8f, 0x2000 }, + { 0x0700, 0xfc8e, 0x0000 }, + { 0x0700, 0xfc90, 0x0000 }, + { 0x8700, 0xfc93, 0x2000 }, + { 0x0700, 0xfc92, 0x0000 }, + { 0x0700, 0xfc94, 0x0000 }, + { 0x8700, 0xfc99, 0x3000 }, + { 0x8700, 0xfc97, 0x2000 }, + { 0x0700, 0xfc96, 0x0000 }, + { 0x0700, 0xfc98, 0x0000 }, + { 0x8700, 0xfc9b, 0x2000 }, + { 0x0700, 0xfc9a, 0x0000 }, + { 0x0700, 0xfc9c, 0x0000 }, + { 0x8700, 0xfca5, 0x4000 }, + { 0x8700, 0xfca1, 0x3000 }, + { 0x8700, 0xfc9f, 0x2000 }, + { 0x0700, 0xfc9e, 0x0000 }, + { 0x0700, 0xfca0, 0x0000 }, + { 0x8700, 0xfca3, 0x2000 }, + { 0x0700, 0xfca2, 0x0000 }, + { 0x0700, 0xfca4, 0x0000 }, + { 0x8700, 0xfca9, 0x3000 }, + { 0x8700, 0xfca7, 0x2000 }, + { 0x0700, 0xfca6, 0x0000 }, + { 0x0700, 0xfca8, 0x0000 }, + { 0x8700, 0xfcab, 0x2000 }, + { 0x0700, 0xfcaa, 0x0000 }, + { 0x0700, 0xfcac, 0x0000 }, + { 0x8700, 0xfcbd, 0x5000 }, + { 0x8700, 0xfcb5, 0x4000 }, + { 0x8700, 0xfcb1, 0x3000 }, + { 0x8700, 0xfcaf, 0x2000 }, + { 0x0700, 0xfcae, 0x0000 }, + { 0x0700, 0xfcb0, 0x0000 }, + { 0x8700, 0xfcb3, 0x2000 }, + { 0x0700, 0xfcb2, 0x0000 }, + { 0x0700, 0xfcb4, 0x0000 }, + { 0x8700, 0xfcb9, 0x3000 }, + { 0x8700, 0xfcb7, 0x2000 }, + { 0x0700, 0xfcb6, 0x0000 }, + { 0x0700, 0xfcb8, 0x0000 }, + { 0x8700, 0xfcbb, 0x2000 }, + { 0x0700, 0xfcba, 0x0000 }, + { 0x0700, 0xfcbc, 0x0000 }, + { 0x8700, 0xfcc5, 0x4000 }, + { 0x8700, 0xfcc1, 0x3000 }, + { 0x8700, 0xfcbf, 0x2000 }, + { 0x0700, 0xfcbe, 0x0000 }, + { 0x0700, 0xfcc0, 0x0000 }, + { 0x8700, 0xfcc3, 0x2000 }, + { 0x0700, 0xfcc2, 0x0000 }, + { 0x0700, 0xfcc4, 0x0000 }, + { 0x8700, 0xfcc9, 0x3000 }, + { 0x8700, 0xfcc7, 0x2000 }, + { 0x0700, 0xfcc6, 0x0000 }, + { 0x0700, 0xfcc8, 0x0000 }, + { 0x8700, 0xfccb, 0x2000 }, + { 0x0700, 0xfcca, 0x0000 }, + { 0x0700, 0xfccc, 0x0000 }, + { 0x8700, 0xfd0d, 0x7000 }, + { 0x8700, 0xfced, 0x6000 }, + { 0x8700, 0xfcdd, 0x5000 }, + { 0x8700, 0xfcd5, 0x4000 }, + { 0x8700, 0xfcd1, 0x3000 }, + { 0x8700, 0xfccf, 0x2000 }, + { 0x0700, 0xfcce, 0x0000 }, + { 0x0700, 0xfcd0, 0x0000 }, + { 0x8700, 0xfcd3, 0x2000 }, + { 0x0700, 0xfcd2, 0x0000 }, + { 0x0700, 0xfcd4, 0x0000 }, + { 0x8700, 0xfcd9, 0x3000 }, + { 0x8700, 0xfcd7, 0x2000 }, + { 0x0700, 0xfcd6, 0x0000 }, + { 0x0700, 0xfcd8, 0x0000 }, + { 0x8700, 0xfcdb, 0x2000 }, + { 0x0700, 0xfcda, 0x0000 }, + { 0x0700, 0xfcdc, 0x0000 }, + { 0x8700, 0xfce5, 0x4000 }, + { 0x8700, 0xfce1, 0x3000 }, + { 0x8700, 0xfcdf, 0x2000 }, + { 0x0700, 0xfcde, 0x0000 }, + { 0x0700, 0xfce0, 0x0000 }, + { 0x8700, 0xfce3, 0x2000 }, + { 0x0700, 0xfce2, 0x0000 }, + { 0x0700, 0xfce4, 0x0000 }, + { 0x8700, 0xfce9, 0x3000 }, + { 0x8700, 0xfce7, 0x2000 }, + { 0x0700, 0xfce6, 0x0000 }, + { 0x0700, 0xfce8, 0x0000 }, + { 0x8700, 0xfceb, 0x2000 }, + { 0x0700, 0xfcea, 0x0000 }, + { 0x0700, 0xfcec, 0x0000 }, + { 0x8700, 0xfcfd, 0x5000 }, + { 0x8700, 0xfcf5, 0x4000 }, + { 0x8700, 0xfcf1, 0x3000 }, + { 0x8700, 0xfcef, 0x2000 }, + { 0x0700, 0xfcee, 0x0000 }, + { 0x0700, 0xfcf0, 0x0000 }, + { 0x8700, 0xfcf3, 0x2000 }, + { 0x0700, 0xfcf2, 0x0000 }, + { 0x0700, 0xfcf4, 0x0000 }, + { 0x8700, 0xfcf9, 0x3000 }, + { 0x8700, 0xfcf7, 0x2000 }, + { 0x0700, 0xfcf6, 0x0000 }, + { 0x0700, 0xfcf8, 0x0000 }, + { 0x8700, 0xfcfb, 0x2000 }, + { 0x0700, 0xfcfa, 0x0000 }, + { 0x0700, 0xfcfc, 0x0000 }, + { 0x8700, 0xfd05, 0x4000 }, + { 0x8700, 0xfd01, 0x3000 }, + { 0x8700, 0xfcff, 0x2000 }, + { 0x0700, 0xfcfe, 0x0000 }, + { 0x0700, 0xfd00, 0x0000 }, + { 0x8700, 0xfd03, 0x2000 }, + { 0x0700, 0xfd02, 0x0000 }, + { 0x0700, 0xfd04, 0x0000 }, + { 0x8700, 0xfd09, 0x3000 }, + { 0x8700, 0xfd07, 0x2000 }, + { 0x0700, 0xfd06, 0x0000 }, + { 0x0700, 0xfd08, 0x0000 }, + { 0x8700, 0xfd0b, 0x2000 }, + { 0x0700, 0xfd0a, 0x0000 }, + { 0x0700, 0xfd0c, 0x0000 }, + { 0x8700, 0xfd2d, 0x6000 }, + { 0x8700, 0xfd1d, 0x5000 }, + { 0x8700, 0xfd15, 0x4000 }, + { 0x8700, 0xfd11, 0x3000 }, + { 0x8700, 0xfd0f, 0x2000 }, + { 0x0700, 0xfd0e, 0x0000 }, + { 0x0700, 0xfd10, 0x0000 }, + { 0x8700, 0xfd13, 0x2000 }, + { 0x0700, 0xfd12, 0x0000 }, + { 0x0700, 0xfd14, 0x0000 }, + { 0x8700, 0xfd19, 0x3000 }, + { 0x8700, 0xfd17, 0x2000 }, + { 0x0700, 0xfd16, 0x0000 }, + { 0x0700, 0xfd18, 0x0000 }, + { 0x8700, 0xfd1b, 0x2000 }, + { 0x0700, 0xfd1a, 0x0000 }, + { 0x0700, 0xfd1c, 0x0000 }, + { 0x8700, 0xfd25, 0x4000 }, + { 0x8700, 0xfd21, 0x3000 }, + { 0x8700, 0xfd1f, 0x2000 }, + { 0x0700, 0xfd1e, 0x0000 }, + { 0x0700, 0xfd20, 0x0000 }, + { 0x8700, 0xfd23, 0x2000 }, + { 0x0700, 0xfd22, 0x0000 }, + { 0x0700, 0xfd24, 0x0000 }, + { 0x8700, 0xfd29, 0x3000 }, + { 0x8700, 0xfd27, 0x2000 }, + { 0x0700, 0xfd26, 0x0000 }, + { 0x0700, 0xfd28, 0x0000 }, + { 0x8700, 0xfd2b, 0x2000 }, + { 0x0700, 0xfd2a, 0x0000 }, + { 0x0700, 0xfd2c, 0x0000 }, + { 0x8700, 0xfd3d, 0x5000 }, + { 0x8700, 0xfd35, 0x4000 }, + { 0x8700, 0xfd31, 0x3000 }, + { 0x8700, 0xfd2f, 0x2000 }, + { 0x0700, 0xfd2e, 0x0000 }, + { 0x0700, 0xfd30, 0x0000 }, + { 0x8700, 0xfd33, 0x2000 }, + { 0x0700, 0xfd32, 0x0000 }, + { 0x0700, 0xfd34, 0x0000 }, + { 0x8700, 0xfd39, 0x3000 }, + { 0x8700, 0xfd37, 0x2000 }, + { 0x0700, 0xfd36, 0x0000 }, + { 0x0700, 0xfd38, 0x0000 }, + { 0x8700, 0xfd3b, 0x2000 }, + { 0x0700, 0xfd3a, 0x0000 }, + { 0x0700, 0xfd3c, 0x0000 }, + { 0x8700, 0xfd55, 0x4000 }, + { 0x8700, 0xfd51, 0x3000 }, + { 0x9200, 0xfd3f, 0x2000 }, + { 0x1600, 0xfd3e, 0x0000 }, + { 0x0700, 0xfd50, 0x0000 }, + { 0x8700, 0xfd53, 0x2000 }, + { 0x0700, 0xfd52, 0x0000 }, + { 0x0700, 0xfd54, 0x0000 }, + { 0x8700, 0xfd59, 0x3000 }, + { 0x8700, 0xfd57, 0x2000 }, + { 0x0700, 0xfd56, 0x0000 }, + { 0x0700, 0xfd58, 0x0000 }, + { 0x8700, 0xfd5b, 0x2000 }, + { 0x0700, 0xfd5a, 0x0000 }, + { 0x0700, 0xfd5c, 0x0000 }, + { 0x8c00, 0xfe09, 0x8000 }, + { 0x8700, 0xfd9f, 0x7000 }, + { 0x8700, 0xfd7d, 0x6000 }, + { 0x8700, 0xfd6d, 0x5000 }, + { 0x8700, 0xfd65, 0x4000 }, + { 0x8700, 0xfd61, 0x3000 }, + { 0x8700, 0xfd5f, 0x2000 }, + { 0x0700, 0xfd5e, 0x0000 }, + { 0x0700, 0xfd60, 0x0000 }, + { 0x8700, 0xfd63, 0x2000 }, + { 0x0700, 0xfd62, 0x0000 }, + { 0x0700, 0xfd64, 0x0000 }, + { 0x8700, 0xfd69, 0x3000 }, + { 0x8700, 0xfd67, 0x2000 }, + { 0x0700, 0xfd66, 0x0000 }, + { 0x0700, 0xfd68, 0x0000 }, + { 0x8700, 0xfd6b, 0x2000 }, + { 0x0700, 0xfd6a, 0x0000 }, + { 0x0700, 0xfd6c, 0x0000 }, + { 0x8700, 0xfd75, 0x4000 }, + { 0x8700, 0xfd71, 0x3000 }, + { 0x8700, 0xfd6f, 0x2000 }, + { 0x0700, 0xfd6e, 0x0000 }, + { 0x0700, 0xfd70, 0x0000 }, + { 0x8700, 0xfd73, 0x2000 }, + { 0x0700, 0xfd72, 0x0000 }, + { 0x0700, 0xfd74, 0x0000 }, + { 0x8700, 0xfd79, 0x3000 }, + { 0x8700, 0xfd77, 0x2000 }, + { 0x0700, 0xfd76, 0x0000 }, + { 0x0700, 0xfd78, 0x0000 }, + { 0x8700, 0xfd7b, 0x2000 }, + { 0x0700, 0xfd7a, 0x0000 }, + { 0x0700, 0xfd7c, 0x0000 }, + { 0x8700, 0xfd8d, 0x5000 }, + { 0x8700, 0xfd85, 0x4000 }, + { 0x8700, 0xfd81, 0x3000 }, + { 0x8700, 0xfd7f, 0x2000 }, + { 0x0700, 0xfd7e, 0x0000 }, + { 0x0700, 0xfd80, 0x0000 }, + { 0x8700, 0xfd83, 0x2000 }, + { 0x0700, 0xfd82, 0x0000 }, + { 0x0700, 0xfd84, 0x0000 }, + { 0x8700, 0xfd89, 0x3000 }, + { 0x8700, 0xfd87, 0x2000 }, + { 0x0700, 0xfd86, 0x0000 }, + { 0x0700, 0xfd88, 0x0000 }, + { 0x8700, 0xfd8b, 0x2000 }, + { 0x0700, 0xfd8a, 0x0000 }, + { 0x0700, 0xfd8c, 0x0000 }, + { 0x8700, 0xfd97, 0x4000 }, + { 0x8700, 0xfd93, 0x3000 }, + { 0x8700, 0xfd8f, 0x2000 }, + { 0x0700, 0xfd8e, 0x0000 }, + { 0x0700, 0xfd92, 0x0000 }, + { 0x8700, 0xfd95, 0x2000 }, + { 0x0700, 0xfd94, 0x0000 }, + { 0x0700, 0xfd96, 0x0000 }, + { 0x8700, 0xfd9b, 0x3000 }, + { 0x8700, 0xfd99, 0x2000 }, + { 0x0700, 0xfd98, 0x0000 }, + { 0x0700, 0xfd9a, 0x0000 }, + { 0x8700, 0xfd9d, 0x2000 }, + { 0x0700, 0xfd9c, 0x0000 }, + { 0x0700, 0xfd9e, 0x0000 }, + { 0x8700, 0xfdbf, 0x6000 }, + { 0x8700, 0xfdaf, 0x5000 }, + { 0x8700, 0xfda7, 0x4000 }, + { 0x8700, 0xfda3, 0x3000 }, + { 0x8700, 0xfda1, 0x2000 }, + { 0x0700, 0xfda0, 0x0000 }, + { 0x0700, 0xfda2, 0x0000 }, + { 0x8700, 0xfda5, 0x2000 }, + { 0x0700, 0xfda4, 0x0000 }, + { 0x0700, 0xfda6, 0x0000 }, + { 0x8700, 0xfdab, 0x3000 }, + { 0x8700, 0xfda9, 0x2000 }, + { 0x0700, 0xfda8, 0x0000 }, + { 0x0700, 0xfdaa, 0x0000 }, + { 0x8700, 0xfdad, 0x2000 }, + { 0x0700, 0xfdac, 0x0000 }, + { 0x0700, 0xfdae, 0x0000 }, + { 0x8700, 0xfdb7, 0x4000 }, + { 0x8700, 0xfdb3, 0x3000 }, + { 0x8700, 0xfdb1, 0x2000 }, + { 0x0700, 0xfdb0, 0x0000 }, + { 0x0700, 0xfdb2, 0x0000 }, + { 0x8700, 0xfdb5, 0x2000 }, + { 0x0700, 0xfdb4, 0x0000 }, + { 0x0700, 0xfdb6, 0x0000 }, + { 0x8700, 0xfdbb, 0x3000 }, + { 0x8700, 0xfdb9, 0x2000 }, + { 0x0700, 0xfdb8, 0x0000 }, + { 0x0700, 0xfdba, 0x0000 }, + { 0x8700, 0xfdbd, 0x2000 }, + { 0x0700, 0xfdbc, 0x0000 }, + { 0x0700, 0xfdbe, 0x0000 }, + { 0x8700, 0xfdf7, 0x5000 }, + { 0x8700, 0xfdc7, 0x4000 }, + { 0x8700, 0xfdc3, 0x3000 }, + { 0x8700, 0xfdc1, 0x2000 }, + { 0x0700, 0xfdc0, 0x0000 }, + { 0x0700, 0xfdc2, 0x0000 }, + { 0x8700, 0xfdc5, 0x2000 }, + { 0x0700, 0xfdc4, 0x0000 }, + { 0x0700, 0xfdc6, 0x0000 }, + { 0x8700, 0xfdf3, 0x3000 }, + { 0x8700, 0xfdf1, 0x2000 }, + { 0x0700, 0xfdf0, 0x0000 }, + { 0x0700, 0xfdf2, 0x0000 }, + { 0x8700, 0xfdf5, 0x2000 }, + { 0x0700, 0xfdf4, 0x0000 }, + { 0x0700, 0xfdf6, 0x0000 }, + { 0x8c00, 0xfe01, 0x4000 }, + { 0x8700, 0xfdfb, 0x3000 }, + { 0x8700, 0xfdf9, 0x2000 }, + { 0x0700, 0xfdf8, 0x0000 }, + { 0x0700, 0xfdfa, 0x0000 }, + { 0x9a00, 0xfdfd, 0x2000 }, + { 0x1700, 0xfdfc, 0x0000 }, + { 0x0c00, 0xfe00, 0x0000 }, + { 0x8c00, 0xfe05, 0x3000 }, + { 0x8c00, 0xfe03, 0x2000 }, + { 0x0c00, 0xfe02, 0x0000 }, + { 0x0c00, 0xfe04, 0x0000 }, + { 0x8c00, 0xfe07, 0x2000 }, + { 0x0c00, 0xfe06, 0x0000 }, + { 0x0c00, 0xfe08, 0x0000 }, + { 0x9900, 0xfe66, 0x7000 }, + { 0x9500, 0xfe45, 0x6000 }, + { 0x9600, 0xfe35, 0x5000 }, + { 0x8c00, 0xfe21, 0x4000 }, + { 0x8c00, 0xfe0d, 0x3000 }, + { 0x8c00, 0xfe0b, 0x2000 }, + { 0x0c00, 0xfe0a, 0x0000 }, + { 0x0c00, 0xfe0c, 0x0000 }, + { 0x8c00, 0xfe0f, 0x2000 }, + { 0x0c00, 0xfe0e, 0x0000 }, + { 0x0c00, 0xfe20, 0x0000 }, + { 0x9100, 0xfe31, 0x3000 }, + { 0x8c00, 0xfe23, 0x2000 }, + { 0x0c00, 0xfe22, 0x0000 }, + { 0x1500, 0xfe30, 0x0000 }, + { 0x9000, 0xfe33, 0x2000 }, + { 0x1100, 0xfe32, 0x0000 }, + { 0x1000, 0xfe34, 0x0000 }, + { 0x9600, 0xfe3d, 0x4000 }, + { 0x9600, 0xfe39, 0x3000 }, + { 0x9600, 0xfe37, 0x2000 }, + { 0x1200, 0xfe36, 0x0000 }, + { 0x1200, 0xfe38, 0x0000 }, + { 0x9600, 0xfe3b, 0x2000 }, + { 0x1200, 0xfe3a, 0x0000 }, + { 0x1200, 0xfe3c, 0x0000 }, + { 0x9600, 0xfe41, 0x3000 }, + { 0x9600, 0xfe3f, 0x2000 }, + { 0x1200, 0xfe3e, 0x0000 }, + { 0x1200, 0xfe40, 0x0000 }, + { 0x9600, 0xfe43, 0x2000 }, + { 0x1200, 0xfe42, 0x0000 }, + { 0x1200, 0xfe44, 0x0000 }, + { 0x9500, 0xfe56, 0x5000 }, + { 0x9000, 0xfe4d, 0x4000 }, + { 0x9500, 0xfe49, 0x3000 }, + { 0x9600, 0xfe47, 0x2000 }, + { 0x1500, 0xfe46, 0x0000 }, + { 0x1200, 0xfe48, 0x0000 }, + { 0x9500, 0xfe4b, 0x2000 }, + { 0x1500, 0xfe4a, 0x0000 }, + { 0x1500, 0xfe4c, 0x0000 }, + { 0x9500, 0xfe51, 0x3000 }, + { 0x9000, 0xfe4f, 0x2000 }, + { 0x1000, 0xfe4e, 0x0000 }, + { 0x1500, 0xfe50, 0x0000 }, + { 0x9500, 0xfe54, 0x2000 }, + { 0x1500, 0xfe52, 0x0000 }, + { 0x1500, 0xfe55, 0x0000 }, + { 0x9200, 0xfe5e, 0x4000 }, + { 0x9200, 0xfe5a, 0x3000 }, + { 0x9100, 0xfe58, 0x2000 }, + { 0x1500, 0xfe57, 0x0000 }, + { 0x1600, 0xfe59, 0x0000 }, + { 0x9200, 0xfe5c, 0x2000 }, + { 0x1600, 0xfe5b, 0x0000 }, + { 0x1600, 0xfe5d, 0x0000 }, + { 0x9900, 0xfe62, 0x3000 }, + { 0x9500, 0xfe60, 0x2000 }, + { 0x1500, 0xfe5f, 0x0000 }, + { 0x1500, 0xfe61, 0x0000 }, + { 0x9900, 0xfe64, 0x2000 }, + { 0x1100, 0xfe63, 0x0000 }, + { 0x1900, 0xfe65, 0x0000 }, + { 0x8700, 0xfe8c, 0x6000 }, + { 0x8700, 0xfe7c, 0x5000 }, + { 0x8700, 0xfe73, 0x4000 }, + { 0x9500, 0xfe6b, 0x3000 }, + { 0x9700, 0xfe69, 0x2000 }, + { 0x1500, 0xfe68, 0x0000 }, + { 0x1500, 0xfe6a, 0x0000 }, + { 0x8700, 0xfe71, 0x2000 }, + { 0x0700, 0xfe70, 0x0000 }, + { 0x0700, 0xfe72, 0x0000 }, + { 0x8700, 0xfe78, 0x3000 }, + { 0x8700, 0xfe76, 0x2000 }, + { 0x0700, 0xfe74, 0x0000 }, + { 0x0700, 0xfe77, 0x0000 }, + { 0x8700, 0xfe7a, 0x2000 }, + { 0x0700, 0xfe79, 0x0000 }, + { 0x0700, 0xfe7b, 0x0000 }, + { 0x8700, 0xfe84, 0x4000 }, + { 0x8700, 0xfe80, 0x3000 }, + { 0x8700, 0xfe7e, 0x2000 }, + { 0x0700, 0xfe7d, 0x0000 }, + { 0x0700, 0xfe7f, 0x0000 }, + { 0x8700, 0xfe82, 0x2000 }, + { 0x0700, 0xfe81, 0x0000 }, + { 0x0700, 0xfe83, 0x0000 }, + { 0x8700, 0xfe88, 0x3000 }, + { 0x8700, 0xfe86, 0x2000 }, + { 0x0700, 0xfe85, 0x0000 }, + { 0x0700, 0xfe87, 0x0000 }, + { 0x8700, 0xfe8a, 0x2000 }, + { 0x0700, 0xfe89, 0x0000 }, + { 0x0700, 0xfe8b, 0x0000 }, + { 0x8700, 0xfe9c, 0x5000 }, + { 0x8700, 0xfe94, 0x4000 }, + { 0x8700, 0xfe90, 0x3000 }, + { 0x8700, 0xfe8e, 0x2000 }, + { 0x0700, 0xfe8d, 0x0000 }, + { 0x0700, 0xfe8f, 0x0000 }, + { 0x8700, 0xfe92, 0x2000 }, + { 0x0700, 0xfe91, 0x0000 }, + { 0x0700, 0xfe93, 0x0000 }, + { 0x8700, 0xfe98, 0x3000 }, + { 0x8700, 0xfe96, 0x2000 }, + { 0x0700, 0xfe95, 0x0000 }, + { 0x0700, 0xfe97, 0x0000 }, + { 0x8700, 0xfe9a, 0x2000 }, + { 0x0700, 0xfe99, 0x0000 }, + { 0x0700, 0xfe9b, 0x0000 }, + { 0x8700, 0xfea4, 0x4000 }, + { 0x8700, 0xfea0, 0x3000 }, + { 0x8700, 0xfe9e, 0x2000 }, + { 0x0700, 0xfe9d, 0x0000 }, + { 0x0700, 0xfe9f, 0x0000 }, + { 0x8700, 0xfea2, 0x2000 }, + { 0x0700, 0xfea1, 0x0000 }, + { 0x0700, 0xfea3, 0x0000 }, + { 0x8700, 0xfea8, 0x3000 }, + { 0x8700, 0xfea6, 0x2000 }, + { 0x0700, 0xfea5, 0x0000 }, + { 0x0700, 0xfea7, 0x0000 }, + { 0x8700, 0xfeaa, 0x2000 }, + { 0x0700, 0xfea9, 0x0000 }, + { 0x0700, 0xfeab, 0x0000 }, + { 0x8700, 0xffaf, 0x9000 }, + { 0x8900, 0xff2f, 0x8020 }, + { 0x8700, 0xfeec, 0x7000 }, + { 0x8700, 0xfecc, 0x6000 }, + { 0x8700, 0xfebc, 0x5000 }, + { 0x8700, 0xfeb4, 0x4000 }, + { 0x8700, 0xfeb0, 0x3000 }, + { 0x8700, 0xfeae, 0x2000 }, + { 0x0700, 0xfead, 0x0000 }, + { 0x0700, 0xfeaf, 0x0000 }, + { 0x8700, 0xfeb2, 0x2000 }, + { 0x0700, 0xfeb1, 0x0000 }, + { 0x0700, 0xfeb3, 0x0000 }, + { 0x8700, 0xfeb8, 0x3000 }, + { 0x8700, 0xfeb6, 0x2000 }, + { 0x0700, 0xfeb5, 0x0000 }, + { 0x0700, 0xfeb7, 0x0000 }, + { 0x8700, 0xfeba, 0x2000 }, + { 0x0700, 0xfeb9, 0x0000 }, + { 0x0700, 0xfebb, 0x0000 }, + { 0x8700, 0xfec4, 0x4000 }, + { 0x8700, 0xfec0, 0x3000 }, + { 0x8700, 0xfebe, 0x2000 }, + { 0x0700, 0xfebd, 0x0000 }, + { 0x0700, 0xfebf, 0x0000 }, + { 0x8700, 0xfec2, 0x2000 }, + { 0x0700, 0xfec1, 0x0000 }, + { 0x0700, 0xfec3, 0x0000 }, + { 0x8700, 0xfec8, 0x3000 }, + { 0x8700, 0xfec6, 0x2000 }, + { 0x0700, 0xfec5, 0x0000 }, + { 0x0700, 0xfec7, 0x0000 }, + { 0x8700, 0xfeca, 0x2000 }, + { 0x0700, 0xfec9, 0x0000 }, + { 0x0700, 0xfecb, 0x0000 }, + { 0x8700, 0xfedc, 0x5000 }, + { 0x8700, 0xfed4, 0x4000 }, + { 0x8700, 0xfed0, 0x3000 }, + { 0x8700, 0xfece, 0x2000 }, + { 0x0700, 0xfecd, 0x0000 }, + { 0x0700, 0xfecf, 0x0000 }, + { 0x8700, 0xfed2, 0x2000 }, + { 0x0700, 0xfed1, 0x0000 }, + { 0x0700, 0xfed3, 0x0000 }, + { 0x8700, 0xfed8, 0x3000 }, + { 0x8700, 0xfed6, 0x2000 }, + { 0x0700, 0xfed5, 0x0000 }, + { 0x0700, 0xfed7, 0x0000 }, + { 0x8700, 0xfeda, 0x2000 }, + { 0x0700, 0xfed9, 0x0000 }, + { 0x0700, 0xfedb, 0x0000 }, + { 0x8700, 0xfee4, 0x4000 }, + { 0x8700, 0xfee0, 0x3000 }, + { 0x8700, 0xfede, 0x2000 }, + { 0x0700, 0xfedd, 0x0000 }, + { 0x0700, 0xfedf, 0x0000 }, + { 0x8700, 0xfee2, 0x2000 }, + { 0x0700, 0xfee1, 0x0000 }, + { 0x0700, 0xfee3, 0x0000 }, + { 0x8700, 0xfee8, 0x3000 }, + { 0x8700, 0xfee6, 0x2000 }, + { 0x0700, 0xfee5, 0x0000 }, + { 0x0700, 0xfee7, 0x0000 }, + { 0x8700, 0xfeea, 0x2000 }, + { 0x0700, 0xfee9, 0x0000 }, + { 0x0700, 0xfeeb, 0x0000 }, + { 0x9500, 0xff0f, 0x6000 }, + { 0x8700, 0xfefc, 0x5000 }, + { 0x8700, 0xfef4, 0x4000 }, + { 0x8700, 0xfef0, 0x3000 }, + { 0x8700, 0xfeee, 0x2000 }, + { 0x0700, 0xfeed, 0x0000 }, + { 0x0700, 0xfeef, 0x0000 }, + { 0x8700, 0xfef2, 0x2000 }, + { 0x0700, 0xfef1, 0x0000 }, + { 0x0700, 0xfef3, 0x0000 }, + { 0x8700, 0xfef8, 0x3000 }, + { 0x8700, 0xfef6, 0x2000 }, + { 0x0700, 0xfef5, 0x0000 }, + { 0x0700, 0xfef7, 0x0000 }, + { 0x8700, 0xfefa, 0x2000 }, + { 0x0700, 0xfef9, 0x0000 }, + { 0x0700, 0xfefb, 0x0000 }, + { 0x9500, 0xff07, 0x4000 }, + { 0x9500, 0xff03, 0x3000 }, + { 0x9500, 0xff01, 0x2000 }, + { 0x0100, 0xfeff, 0x0000 }, + { 0x1500, 0xff02, 0x0000 }, + { 0x9500, 0xff05, 0x2000 }, + { 0x1700, 0xff04, 0x0000 }, + { 0x1500, 0xff06, 0x0000 }, + { 0x9900, 0xff0b, 0x3000 }, + { 0x9200, 0xff09, 0x2000 }, + { 0x1600, 0xff08, 0x0000 }, + { 0x1500, 0xff0a, 0x0000 }, + { 0x9100, 0xff0d, 0x2000 }, + { 0x1500, 0xff0c, 0x0000 }, + { 0x1500, 0xff0e, 0x0000 }, + { 0x9500, 0xff1f, 0x5000 }, + { 0x8d00, 0xff17, 0x4000 }, + { 0x8d00, 0xff13, 0x3000 }, + { 0x8d00, 0xff11, 0x2000 }, + { 0x0d00, 0xff10, 0x0000 }, + { 0x0d00, 0xff12, 0x0000 }, + { 0x8d00, 0xff15, 0x2000 }, + { 0x0d00, 0xff14, 0x0000 }, + { 0x0d00, 0xff16, 0x0000 }, + { 0x9500, 0xff1b, 0x3000 }, + { 0x8d00, 0xff19, 0x2000 }, + { 0x0d00, 0xff18, 0x0000 }, + { 0x1500, 0xff1a, 0x0000 }, + { 0x9900, 0xff1d, 0x2000 }, + { 0x1900, 0xff1c, 0x0000 }, + { 0x1900, 0xff1e, 0x0000 }, + { 0x8900, 0xff27, 0x4020 }, + { 0x8900, 0xff23, 0x3020 }, + { 0x8900, 0xff21, 0x2020 }, + { 0x1500, 0xff20, 0x0000 }, + { 0x0900, 0xff22, 0x0020 }, + { 0x8900, 0xff25, 0x2020 }, + { 0x0900, 0xff24, 0x0020 }, + { 0x0900, 0xff26, 0x0020 }, + { 0x8900, 0xff2b, 0x3020 }, + { 0x8900, 0xff29, 0x2020 }, + { 0x0900, 0xff28, 0x0020 }, + { 0x0900, 0xff2a, 0x0020 }, + { 0x8900, 0xff2d, 0x2020 }, + { 0x0900, 0xff2c, 0x0020 }, + { 0x0900, 0xff2e, 0x0020 }, + { 0x8700, 0xff6f, 0x7000 }, + { 0x8500, 0xff4f, 0x6fe0 }, + { 0x9000, 0xff3f, 0x5000 }, + { 0x8900, 0xff37, 0x4020 }, + { 0x8900, 0xff33, 0x3020 }, + { 0x8900, 0xff31, 0x2020 }, + { 0x0900, 0xff30, 0x0020 }, + { 0x0900, 0xff32, 0x0020 }, + { 0x8900, 0xff35, 0x2020 }, + { 0x0900, 0xff34, 0x0020 }, + { 0x0900, 0xff36, 0x0020 }, + { 0x9600, 0xff3b, 0x3000 }, + { 0x8900, 0xff39, 0x2020 }, + { 0x0900, 0xff38, 0x0020 }, + { 0x0900, 0xff3a, 0x0020 }, + { 0x9200, 0xff3d, 0x2000 }, + { 0x1500, 0xff3c, 0x0000 }, + { 0x1800, 0xff3e, 0x0000 }, + { 0x8500, 0xff47, 0x4fe0 }, + { 0x8500, 0xff43, 0x3fe0 }, + { 0x8500, 0xff41, 0x2fe0 }, + { 0x1800, 0xff40, 0x0000 }, + { 0x0500, 0xff42, 0x0fe0 }, + { 0x8500, 0xff45, 0x2fe0 }, + { 0x0500, 0xff44, 0x0fe0 }, + { 0x0500, 0xff46, 0x0fe0 }, + { 0x8500, 0xff4b, 0x3fe0 }, + { 0x8500, 0xff49, 0x2fe0 }, + { 0x0500, 0xff48, 0x0fe0 }, + { 0x0500, 0xff4a, 0x0fe0 }, + { 0x8500, 0xff4d, 0x2fe0 }, + { 0x0500, 0xff4c, 0x0fe0 }, + { 0x0500, 0xff4e, 0x0fe0 }, + { 0x9600, 0xff5f, 0x5000 }, + { 0x8500, 0xff57, 0x4fe0 }, + { 0x8500, 0xff53, 0x3fe0 }, + { 0x8500, 0xff51, 0x2fe0 }, + { 0x0500, 0xff50, 0x0fe0 }, + { 0x0500, 0xff52, 0x0fe0 }, + { 0x8500, 0xff55, 0x2fe0 }, + { 0x0500, 0xff54, 0x0fe0 }, + { 0x0500, 0xff56, 0x0fe0 }, + { 0x9600, 0xff5b, 0x3000 }, + { 0x8500, 0xff59, 0x2fe0 }, + { 0x0500, 0xff58, 0x0fe0 }, + { 0x0500, 0xff5a, 0x0fe0 }, + { 0x9200, 0xff5d, 0x2000 }, + { 0x1900, 0xff5c, 0x0000 }, + { 0x1900, 0xff5e, 0x0000 }, + { 0x8700, 0xff67, 0x4000 }, + { 0x9200, 0xff63, 0x3000 }, + { 0x9500, 0xff61, 0x2000 }, + { 0x1200, 0xff60, 0x0000 }, + { 0x1600, 0xff62, 0x0000 }, + { 0x9000, 0xff65, 0x2000 }, + { 0x1500, 0xff64, 0x0000 }, + { 0x0700, 0xff66, 0x0000 }, + { 0x8700, 0xff6b, 0x3000 }, + { 0x8700, 0xff69, 0x2000 }, + { 0x0700, 0xff68, 0x0000 }, + { 0x0700, 0xff6a, 0x0000 }, + { 0x8700, 0xff6d, 0x2000 }, + { 0x0700, 0xff6c, 0x0000 }, + { 0x0700, 0xff6e, 0x0000 }, + { 0x8700, 0xff8f, 0x6000 }, + { 0x8700, 0xff7f, 0x5000 }, + { 0x8700, 0xff77, 0x4000 }, + { 0x8700, 0xff73, 0x3000 }, + { 0x8700, 0xff71, 0x2000 }, + { 0x0600, 0xff70, 0x0000 }, + { 0x0700, 0xff72, 0x0000 }, + { 0x8700, 0xff75, 0x2000 }, + { 0x0700, 0xff74, 0x0000 }, + { 0x0700, 0xff76, 0x0000 }, + { 0x8700, 0xff7b, 0x3000 }, + { 0x8700, 0xff79, 0x2000 }, + { 0x0700, 0xff78, 0x0000 }, + { 0x0700, 0xff7a, 0x0000 }, + { 0x8700, 0xff7d, 0x2000 }, + { 0x0700, 0xff7c, 0x0000 }, + { 0x0700, 0xff7e, 0x0000 }, + { 0x8700, 0xff87, 0x4000 }, + { 0x8700, 0xff83, 0x3000 }, + { 0x8700, 0xff81, 0x2000 }, + { 0x0700, 0xff80, 0x0000 }, + { 0x0700, 0xff82, 0x0000 }, + { 0x8700, 0xff85, 0x2000 }, + { 0x0700, 0xff84, 0x0000 }, + { 0x0700, 0xff86, 0x0000 }, + { 0x8700, 0xff8b, 0x3000 }, + { 0x8700, 0xff89, 0x2000 }, + { 0x0700, 0xff88, 0x0000 }, + { 0x0700, 0xff8a, 0x0000 }, + { 0x8700, 0xff8d, 0x2000 }, + { 0x0700, 0xff8c, 0x0000 }, + { 0x0700, 0xff8e, 0x0000 }, + { 0x8600, 0xff9f, 0x5000 }, + { 0x8700, 0xff97, 0x4000 }, + { 0x8700, 0xff93, 0x3000 }, + { 0x8700, 0xff91, 0x2000 }, + { 0x0700, 0xff90, 0x0000 }, + { 0x0700, 0xff92, 0x0000 }, + { 0x8700, 0xff95, 0x2000 }, + { 0x0700, 0xff94, 0x0000 }, + { 0x0700, 0xff96, 0x0000 }, + { 0x8700, 0xff9b, 0x3000 }, + { 0x8700, 0xff99, 0x2000 }, + { 0x0700, 0xff98, 0x0000 }, + { 0x0700, 0xff9a, 0x0000 }, + { 0x8700, 0xff9d, 0x2000 }, + { 0x0700, 0xff9c, 0x0000 }, + { 0x0600, 0xff9e, 0x0000 }, + { 0x8700, 0xffa7, 0x4000 }, + { 0x8700, 0xffa3, 0x3000 }, + { 0x8700, 0xffa1, 0x2000 }, + { 0x0700, 0xffa0, 0x0000 }, + { 0x0700, 0xffa2, 0x0000 }, + { 0x8700, 0xffa5, 0x2000 }, + { 0x0700, 0xffa4, 0x0000 }, + { 0x0700, 0xffa6, 0x0000 }, + { 0x8700, 0xffab, 0x3000 }, + { 0x8700, 0xffa9, 0x2000 }, + { 0x0700, 0xffa8, 0x0000 }, + { 0x0700, 0xffaa, 0x0000 }, + { 0x8700, 0xffad, 0x2000 }, + { 0x0700, 0xffac, 0x0000 }, + { 0x0700, 0xffae, 0x0000 }, + { 0x8701, 0x004c, 0x8000 }, + { 0x8701, 0x0008, 0x7000 }, + { 0x8700, 0xffd6, 0x6000 }, + { 0x8700, 0xffc2, 0x5000 }, + { 0x8700, 0xffb7, 0x4000 }, + { 0x8700, 0xffb3, 0x3000 }, + { 0x8700, 0xffb1, 0x2000 }, + { 0x0700, 0xffb0, 0x0000 }, + { 0x0700, 0xffb2, 0x0000 }, + { 0x8700, 0xffb5, 0x2000 }, + { 0x0700, 0xffb4, 0x0000 }, + { 0x0700, 0xffb6, 0x0000 }, + { 0x8700, 0xffbb, 0x3000 }, + { 0x8700, 0xffb9, 0x2000 }, + { 0x0700, 0xffb8, 0x0000 }, + { 0x0700, 0xffba, 0x0000 }, + { 0x8700, 0xffbd, 0x2000 }, + { 0x0700, 0xffbc, 0x0000 }, + { 0x0700, 0xffbe, 0x0000 }, + { 0x8700, 0xffcc, 0x4000 }, + { 0x8700, 0xffc6, 0x3000 }, + { 0x8700, 0xffc4, 0x2000 }, + { 0x0700, 0xffc3, 0x0000 }, + { 0x0700, 0xffc5, 0x0000 }, + { 0x8700, 0xffca, 0x2000 }, + { 0x0700, 0xffc7, 0x0000 }, + { 0x0700, 0xffcb, 0x0000 }, + { 0x8700, 0xffd2, 0x3000 }, + { 0x8700, 0xffce, 0x2000 }, + { 0x0700, 0xffcd, 0x0000 }, + { 0x0700, 0xffcf, 0x0000 }, + { 0x8700, 0xffd4, 0x2000 }, + { 0x0700, 0xffd3, 0x0000 }, + { 0x0700, 0xffd5, 0x0000 }, + { 0x9900, 0xffec, 0x5000 }, + { 0x9800, 0xffe3, 0x4000 }, + { 0x8700, 0xffdc, 0x3000 }, + { 0x8700, 0xffda, 0x2000 }, + { 0x0700, 0xffd7, 0x0000 }, + { 0x0700, 0xffdb, 0x0000 }, + { 0x9700, 0xffe1, 0x2000 }, + { 0x1700, 0xffe0, 0x0000 }, + { 0x1900, 0xffe2, 0x0000 }, + { 0x9a00, 0xffe8, 0x3000 }, + { 0x9700, 0xffe5, 0x2000 }, + { 0x1a00, 0xffe4, 0x0000 }, + { 0x1700, 0xffe6, 0x0000 }, + { 0x9900, 0xffea, 0x2000 }, + { 0x1900, 0xffe9, 0x0000 }, + { 0x1900, 0xffeb, 0x0000 }, + { 0x8701, 0x0000, 0x4000 }, + { 0x8100, 0xfffa, 0x3000 }, + { 0x9a00, 0xffee, 0x2000 }, + { 0x1a00, 0xffed, 0x0000 }, + { 0x0100, 0xfff9, 0x0000 }, + { 0x9a00, 0xfffc, 0x2000 }, + { 0x0100, 0xfffb, 0x0000 }, + { 0x1a00, 0xfffd, 0x0000 }, + { 0x8701, 0x0004, 0x3000 }, + { 0x8701, 0x0002, 0x2000 }, + { 0x0701, 0x0001, 0x0000 }, + { 0x0701, 0x0003, 0x0000 }, + { 0x8701, 0x0006, 0x2000 }, + { 0x0701, 0x0005, 0x0000 }, + { 0x0701, 0x0007, 0x0000 }, + { 0x8701, 0x002a, 0x6000 }, + { 0x8701, 0x0019, 0x5000 }, + { 0x8701, 0x0011, 0x4000 }, + { 0x8701, 0x000d, 0x3000 }, + { 0x8701, 0x000a, 0x2000 }, + { 0x0701, 0x0009, 0x0000 }, + { 0x0701, 0x000b, 0x0000 }, + { 0x8701, 0x000f, 0x2000 }, + { 0x0701, 0x000e, 0x0000 }, + { 0x0701, 0x0010, 0x0000 }, + { 0x8701, 0x0015, 0x3000 }, + { 0x8701, 0x0013, 0x2000 }, + { 0x0701, 0x0012, 0x0000 }, + { 0x0701, 0x0014, 0x0000 }, + { 0x8701, 0x0017, 0x2000 }, + { 0x0701, 0x0016, 0x0000 }, + { 0x0701, 0x0018, 0x0000 }, + { 0x8701, 0x0021, 0x4000 }, + { 0x8701, 0x001d, 0x3000 }, + { 0x8701, 0x001b, 0x2000 }, + { 0x0701, 0x001a, 0x0000 }, + { 0x0701, 0x001c, 0x0000 }, + { 0x8701, 0x001f, 0x2000 }, + { 0x0701, 0x001e, 0x0000 }, + { 0x0701, 0x0020, 0x0000 }, + { 0x8701, 0x0025, 0x3000 }, + { 0x8701, 0x0023, 0x2000 }, + { 0x0701, 0x0022, 0x0000 }, + { 0x0701, 0x0024, 0x0000 }, + { 0x8701, 0x0028, 0x2000 }, + { 0x0701, 0x0026, 0x0000 }, + { 0x0701, 0x0029, 0x0000 }, + { 0x8701, 0x003a, 0x5000 }, + { 0x8701, 0x0032, 0x4000 }, + { 0x8701, 0x002e, 0x3000 }, + { 0x8701, 0x002c, 0x2000 }, + { 0x0701, 0x002b, 0x0000 }, + { 0x0701, 0x002d, 0x0000 }, + { 0x8701, 0x0030, 0x2000 }, + { 0x0701, 0x002f, 0x0000 }, + { 0x0701, 0x0031, 0x0000 }, + { 0x8701, 0x0036, 0x3000 }, + { 0x8701, 0x0034, 0x2000 }, + { 0x0701, 0x0033, 0x0000 }, + { 0x0701, 0x0035, 0x0000 }, + { 0x8701, 0x0038, 0x2000 }, + { 0x0701, 0x0037, 0x0000 }, + { 0x0701, 0x0039, 0x0000 }, + { 0x8701, 0x0044, 0x4000 }, + { 0x8701, 0x0040, 0x3000 }, + { 0x8701, 0x003d, 0x2000 }, + { 0x0701, 0x003c, 0x0000 }, + { 0x0701, 0x003f, 0x0000 }, + { 0x8701, 0x0042, 0x2000 }, + { 0x0701, 0x0041, 0x0000 }, + { 0x0701, 0x0043, 0x0000 }, + { 0x8701, 0x0048, 0x3000 }, + { 0x8701, 0x0046, 0x2000 }, + { 0x0701, 0x0045, 0x0000 }, + { 0x0701, 0x0047, 0x0000 }, + { 0x8701, 0x004a, 0x2000 }, + { 0x0701, 0x0049, 0x0000 }, + { 0x0701, 0x004b, 0x0000 }, + { 0x8701, 0x00b0, 0x7000 }, + { 0x8701, 0x0090, 0x6000 }, + { 0x8701, 0x0080, 0x5000 }, + { 0x8701, 0x0056, 0x4000 }, + { 0x8701, 0x0052, 0x3000 }, + { 0x8701, 0x0050, 0x2000 }, + { 0x0701, 0x004d, 0x0000 }, + { 0x0701, 0x0051, 0x0000 }, + { 0x8701, 0x0054, 0x2000 }, + { 0x0701, 0x0053, 0x0000 }, + { 0x0701, 0x0055, 0x0000 }, + { 0x8701, 0x005a, 0x3000 }, + { 0x8701, 0x0058, 0x2000 }, + { 0x0701, 0x0057, 0x0000 }, + { 0x0701, 0x0059, 0x0000 }, + { 0x8701, 0x005c, 0x2000 }, + { 0x0701, 0x005b, 0x0000 }, + { 0x0701, 0x005d, 0x0000 }, + { 0x8701, 0x0088, 0x4000 }, + { 0x8701, 0x0084, 0x3000 }, + { 0x8701, 0x0082, 0x2000 }, + { 0x0701, 0x0081, 0x0000 }, + { 0x0701, 0x0083, 0x0000 }, + { 0x8701, 0x0086, 0x2000 }, + { 0x0701, 0x0085, 0x0000 }, + { 0x0701, 0x0087, 0x0000 }, + { 0x8701, 0x008c, 0x3000 }, + { 0x8701, 0x008a, 0x2000 }, + { 0x0701, 0x0089, 0x0000 }, + { 0x0701, 0x008b, 0x0000 }, + { 0x8701, 0x008e, 0x2000 }, + { 0x0701, 0x008d, 0x0000 }, + { 0x0701, 0x008f, 0x0000 }, + { 0x8701, 0x00a0, 0x5000 }, + { 0x8701, 0x0098, 0x4000 }, + { 0x8701, 0x0094, 0x3000 }, + { 0x8701, 0x0092, 0x2000 }, + { 0x0701, 0x0091, 0x0000 }, + { 0x0701, 0x0093, 0x0000 }, + { 0x8701, 0x0096, 0x2000 }, + { 0x0701, 0x0095, 0x0000 }, + { 0x0701, 0x0097, 0x0000 }, + { 0x8701, 0x009c, 0x3000 }, + { 0x8701, 0x009a, 0x2000 }, + { 0x0701, 0x0099, 0x0000 }, + { 0x0701, 0x009b, 0x0000 }, + { 0x8701, 0x009e, 0x2000 }, + { 0x0701, 0x009d, 0x0000 }, + { 0x0701, 0x009f, 0x0000 }, + { 0x8701, 0x00a8, 0x4000 }, + { 0x8701, 0x00a4, 0x3000 }, + { 0x8701, 0x00a2, 0x2000 }, + { 0x0701, 0x00a1, 0x0000 }, + { 0x0701, 0x00a3, 0x0000 }, + { 0x8701, 0x00a6, 0x2000 }, + { 0x0701, 0x00a5, 0x0000 }, + { 0x0701, 0x00a7, 0x0000 }, + { 0x8701, 0x00ac, 0x3000 }, + { 0x8701, 0x00aa, 0x2000 }, + { 0x0701, 0x00a9, 0x0000 }, + { 0x0701, 0x00ab, 0x0000 }, + { 0x8701, 0x00ae, 0x2000 }, + { 0x0701, 0x00ad, 0x0000 }, + { 0x0701, 0x00af, 0x0000 }, + { 0x8701, 0x00d0, 0x6000 }, + { 0x8701, 0x00c0, 0x5000 }, + { 0x8701, 0x00b8, 0x4000 }, + { 0x8701, 0x00b4, 0x3000 }, + { 0x8701, 0x00b2, 0x2000 }, + { 0x0701, 0x00b1, 0x0000 }, + { 0x0701, 0x00b3, 0x0000 }, + { 0x8701, 0x00b6, 0x2000 }, + { 0x0701, 0x00b5, 0x0000 }, + { 0x0701, 0x00b7, 0x0000 }, + { 0x8701, 0x00bc, 0x3000 }, + { 0x8701, 0x00ba, 0x2000 }, + { 0x0701, 0x00b9, 0x0000 }, + { 0x0701, 0x00bb, 0x0000 }, + { 0x8701, 0x00be, 0x2000 }, + { 0x0701, 0x00bd, 0x0000 }, + { 0x0701, 0x00bf, 0x0000 }, + { 0x8701, 0x00c8, 0x4000 }, + { 0x8701, 0x00c4, 0x3000 }, + { 0x8701, 0x00c2, 0x2000 }, + { 0x0701, 0x00c1, 0x0000 }, + { 0x0701, 0x00c3, 0x0000 }, + { 0x8701, 0x00c6, 0x2000 }, + { 0x0701, 0x00c5, 0x0000 }, + { 0x0701, 0x00c7, 0x0000 }, + { 0x8701, 0x00cc, 0x3000 }, + { 0x8701, 0x00ca, 0x2000 }, + { 0x0701, 0x00c9, 0x0000 }, + { 0x0701, 0x00cb, 0x0000 }, + { 0x8701, 0x00ce, 0x2000 }, + { 0x0701, 0x00cd, 0x0000 }, + { 0x0701, 0x00cf, 0x0000 }, + { 0x8701, 0x00e0, 0x5000 }, + { 0x8701, 0x00d8, 0x4000 }, + { 0x8701, 0x00d4, 0x3000 }, + { 0x8701, 0x00d2, 0x2000 }, + { 0x0701, 0x00d1, 0x0000 }, + { 0x0701, 0x00d3, 0x0000 }, + { 0x8701, 0x00d6, 0x2000 }, + { 0x0701, 0x00d5, 0x0000 }, + { 0x0701, 0x00d7, 0x0000 }, + { 0x8701, 0x00dc, 0x3000 }, + { 0x8701, 0x00da, 0x2000 }, + { 0x0701, 0x00d9, 0x0000 }, + { 0x0701, 0x00db, 0x0000 }, + { 0x8701, 0x00de, 0x2000 }, + { 0x0701, 0x00dd, 0x0000 }, + { 0x0701, 0x00df, 0x0000 }, + { 0x8701, 0x00e8, 0x4000 }, + { 0x8701, 0x00e4, 0x3000 }, + { 0x8701, 0x00e2, 0x2000 }, + { 0x0701, 0x00e1, 0x0000 }, + { 0x0701, 0x00e3, 0x0000 }, + { 0x8701, 0x00e6, 0x2000 }, + { 0x0701, 0x00e5, 0x0000 }, + { 0x0701, 0x00e7, 0x0000 }, + { 0x8701, 0x00ec, 0x3000 }, + { 0x8701, 0x00ea, 0x2000 }, + { 0x0701, 0x00e9, 0x0000 }, + { 0x0701, 0x00eb, 0x0000 }, + { 0x8701, 0x00ee, 0x2000 }, + { 0x0701, 0x00ed, 0x0000 }, + { 0x0701, 0x00ef, 0x0000 }, + { 0x8501, 0xd459, 0xb000 }, + { 0x9a01, 0xd080, 0xa000 }, + { 0x8701, 0x045f, 0x9000 }, + { 0x8701, 0x0349, 0x8000 }, + { 0x9a01, 0x013c, 0x7000 }, + { 0x8f01, 0x0119, 0x6000 }, + { 0x8f01, 0x0109, 0x5000 }, + { 0x8701, 0x00f8, 0x4000 }, + { 0x8701, 0x00f4, 0x3000 }, + { 0x8701, 0x00f2, 0x2000 }, + { 0x0701, 0x00f1, 0x0000 }, + { 0x0701, 0x00f3, 0x0000 }, + { 0x8701, 0x00f6, 0x2000 }, + { 0x0701, 0x00f5, 0x0000 }, + { 0x0701, 0x00f7, 0x0000 }, + { 0x9501, 0x0101, 0x3000 }, + { 0x8701, 0x00fa, 0x2000 }, + { 0x0701, 0x00f9, 0x0000 }, + { 0x1501, 0x0100, 0x0000 }, + { 0x8f01, 0x0107, 0x2000 }, + { 0x1a01, 0x0102, 0x0000 }, + { 0x0f01, 0x0108, 0x0000 }, + { 0x8f01, 0x0111, 0x4000 }, + { 0x8f01, 0x010d, 0x3000 }, + { 0x8f01, 0x010b, 0x2000 }, + { 0x0f01, 0x010a, 0x0000 }, + { 0x0f01, 0x010c, 0x0000 }, + { 0x8f01, 0x010f, 0x2000 }, + { 0x0f01, 0x010e, 0x0000 }, + { 0x0f01, 0x0110, 0x0000 }, + { 0x8f01, 0x0115, 0x3000 }, + { 0x8f01, 0x0113, 0x2000 }, + { 0x0f01, 0x0112, 0x0000 }, + { 0x0f01, 0x0114, 0x0000 }, + { 0x8f01, 0x0117, 0x2000 }, + { 0x0f01, 0x0116, 0x0000 }, + { 0x0f01, 0x0118, 0x0000 }, + { 0x8f01, 0x0129, 0x5000 }, + { 0x8f01, 0x0121, 0x4000 }, + { 0x8f01, 0x011d, 0x3000 }, + { 0x8f01, 0x011b, 0x2000 }, + { 0x0f01, 0x011a, 0x0000 }, + { 0x0f01, 0x011c, 0x0000 }, + { 0x8f01, 0x011f, 0x2000 }, + { 0x0f01, 0x011e, 0x0000 }, + { 0x0f01, 0x0120, 0x0000 }, + { 0x8f01, 0x0125, 0x3000 }, + { 0x8f01, 0x0123, 0x2000 }, + { 0x0f01, 0x0122, 0x0000 }, + { 0x0f01, 0x0124, 0x0000 }, + { 0x8f01, 0x0127, 0x2000 }, + { 0x0f01, 0x0126, 0x0000 }, + { 0x0f01, 0x0128, 0x0000 }, + { 0x8f01, 0x0131, 0x4000 }, + { 0x8f01, 0x012d, 0x3000 }, + { 0x8f01, 0x012b, 0x2000 }, + { 0x0f01, 0x012a, 0x0000 }, + { 0x0f01, 0x012c, 0x0000 }, + { 0x8f01, 0x012f, 0x2000 }, + { 0x0f01, 0x012e, 0x0000 }, + { 0x0f01, 0x0130, 0x0000 }, + { 0x9a01, 0x0138, 0x3000 }, + { 0x8f01, 0x0133, 0x2000 }, + { 0x0f01, 0x0132, 0x0000 }, + { 0x1a01, 0x0137, 0x0000 }, + { 0x9a01, 0x013a, 0x2000 }, + { 0x1a01, 0x0139, 0x0000 }, + { 0x1a01, 0x013b, 0x0000 }, + { 0x8701, 0x031c, 0x6000 }, + { 0x8701, 0x030c, 0x5000 }, + { 0x8701, 0x0304, 0x4000 }, + { 0x8701, 0x0300, 0x3000 }, + { 0x9a01, 0x013e, 0x2000 }, + { 0x1a01, 0x013d, 0x0000 }, + { 0x1a01, 0x013f, 0x0000 }, + { 0x8701, 0x0302, 0x2000 }, + { 0x0701, 0x0301, 0x0000 }, + { 0x0701, 0x0303, 0x0000 }, + { 0x8701, 0x0308, 0x3000 }, + { 0x8701, 0x0306, 0x2000 }, + { 0x0701, 0x0305, 0x0000 }, + { 0x0701, 0x0307, 0x0000 }, + { 0x8701, 0x030a, 0x2000 }, + { 0x0701, 0x0309, 0x0000 }, + { 0x0701, 0x030b, 0x0000 }, + { 0x8701, 0x0314, 0x4000 }, + { 0x8701, 0x0310, 0x3000 }, + { 0x8701, 0x030e, 0x2000 }, + { 0x0701, 0x030d, 0x0000 }, + { 0x0701, 0x030f, 0x0000 }, + { 0x8701, 0x0312, 0x2000 }, + { 0x0701, 0x0311, 0x0000 }, + { 0x0701, 0x0313, 0x0000 }, + { 0x8701, 0x0318, 0x3000 }, + { 0x8701, 0x0316, 0x2000 }, + { 0x0701, 0x0315, 0x0000 }, + { 0x0701, 0x0317, 0x0000 }, + { 0x8701, 0x031a, 0x2000 }, + { 0x0701, 0x0319, 0x0000 }, + { 0x0701, 0x031b, 0x0000 }, + { 0x8701, 0x0339, 0x5000 }, + { 0x8701, 0x0331, 0x4000 }, + { 0x8f01, 0x0321, 0x3000 }, + { 0x8701, 0x031e, 0x2000 }, + { 0x0701, 0x031d, 0x0000 }, + { 0x0f01, 0x0320, 0x0000 }, + { 0x8f01, 0x0323, 0x2000 }, + { 0x0f01, 0x0322, 0x0000 }, + { 0x0701, 0x0330, 0x0000 }, + { 0x8701, 0x0335, 0x3000 }, + { 0x8701, 0x0333, 0x2000 }, + { 0x0701, 0x0332, 0x0000 }, + { 0x0701, 0x0334, 0x0000 }, + { 0x8701, 0x0337, 0x2000 }, + { 0x0701, 0x0336, 0x0000 }, + { 0x0701, 0x0338, 0x0000 }, + { 0x8701, 0x0341, 0x4000 }, + { 0x8701, 0x033d, 0x3000 }, + { 0x8701, 0x033b, 0x2000 }, + { 0x0701, 0x033a, 0x0000 }, + { 0x0701, 0x033c, 0x0000 }, + { 0x8701, 0x033f, 0x2000 }, + { 0x0701, 0x033e, 0x0000 }, + { 0x0701, 0x0340, 0x0000 }, + { 0x8701, 0x0345, 0x3000 }, + { 0x8701, 0x0343, 0x2000 }, + { 0x0701, 0x0342, 0x0000 }, + { 0x0701, 0x0344, 0x0000 }, + { 0x8701, 0x0347, 0x2000 }, + { 0x0701, 0x0346, 0x0000 }, + { 0x0701, 0x0348, 0x0000 }, + { 0x8901, 0x041f, 0x7028 }, + { 0x9501, 0x039f, 0x6000 }, + { 0x8701, 0x038e, 0x5000 }, + { 0x8701, 0x0386, 0x4000 }, + { 0x8701, 0x0382, 0x3000 }, + { 0x8701, 0x0380, 0x2000 }, + { 0x0e01, 0x034a, 0x0000 }, + { 0x0701, 0x0381, 0x0000 }, + { 0x8701, 0x0384, 0x2000 }, + { 0x0701, 0x0383, 0x0000 }, + { 0x0701, 0x0385, 0x0000 }, + { 0x8701, 0x038a, 0x3000 }, + { 0x8701, 0x0388, 0x2000 }, + { 0x0701, 0x0387, 0x0000 }, + { 0x0701, 0x0389, 0x0000 }, + { 0x8701, 0x038c, 0x2000 }, + { 0x0701, 0x038b, 0x0000 }, + { 0x0701, 0x038d, 0x0000 }, + { 0x8701, 0x0396, 0x4000 }, + { 0x8701, 0x0392, 0x3000 }, + { 0x8701, 0x0390, 0x2000 }, + { 0x0701, 0x038f, 0x0000 }, + { 0x0701, 0x0391, 0x0000 }, + { 0x8701, 0x0394, 0x2000 }, + { 0x0701, 0x0393, 0x0000 }, + { 0x0701, 0x0395, 0x0000 }, + { 0x8701, 0x039a, 0x3000 }, + { 0x8701, 0x0398, 0x2000 }, + { 0x0701, 0x0397, 0x0000 }, + { 0x0701, 0x0399, 0x0000 }, + { 0x8701, 0x039c, 0x2000 }, + { 0x0701, 0x039b, 0x0000 }, + { 0x0701, 0x039d, 0x0000 }, + { 0x8901, 0x040f, 0x5028 }, + { 0x8901, 0x0407, 0x4028 }, + { 0x8901, 0x0403, 0x3028 }, + { 0x8901, 0x0401, 0x2028 }, + { 0x0901, 0x0400, 0x0028 }, + { 0x0901, 0x0402, 0x0028 }, + { 0x8901, 0x0405, 0x2028 }, + { 0x0901, 0x0404, 0x0028 }, + { 0x0901, 0x0406, 0x0028 }, + { 0x8901, 0x040b, 0x3028 }, + { 0x8901, 0x0409, 0x2028 }, + { 0x0901, 0x0408, 0x0028 }, + { 0x0901, 0x040a, 0x0028 }, + { 0x8901, 0x040d, 0x2028 }, + { 0x0901, 0x040c, 0x0028 }, + { 0x0901, 0x040e, 0x0028 }, + { 0x8901, 0x0417, 0x4028 }, + { 0x8901, 0x0413, 0x3028 }, + { 0x8901, 0x0411, 0x2028 }, + { 0x0901, 0x0410, 0x0028 }, + { 0x0901, 0x0412, 0x0028 }, + { 0x8901, 0x0415, 0x2028 }, + { 0x0901, 0x0414, 0x0028 }, + { 0x0901, 0x0416, 0x0028 }, + { 0x8901, 0x041b, 0x3028 }, + { 0x8901, 0x0419, 0x2028 }, + { 0x0901, 0x0418, 0x0028 }, + { 0x0901, 0x041a, 0x0028 }, + { 0x8901, 0x041d, 0x2028 }, + { 0x0901, 0x041c, 0x0028 }, + { 0x0901, 0x041e, 0x0028 }, + { 0x8501, 0x043f, 0x6fd8 }, + { 0x8501, 0x042f, 0x5fd8 }, + { 0x8901, 0x0427, 0x4028 }, + { 0x8901, 0x0423, 0x3028 }, + { 0x8901, 0x0421, 0x2028 }, + { 0x0901, 0x0420, 0x0028 }, + { 0x0901, 0x0422, 0x0028 }, + { 0x8901, 0x0425, 0x2028 }, + { 0x0901, 0x0424, 0x0028 }, + { 0x0901, 0x0426, 0x0028 }, + { 0x8501, 0x042b, 0x3fd8 }, + { 0x8501, 0x0429, 0x2fd8 }, + { 0x0501, 0x0428, 0x0fd8 }, + { 0x0501, 0x042a, 0x0fd8 }, + { 0x8501, 0x042d, 0x2fd8 }, + { 0x0501, 0x042c, 0x0fd8 }, + { 0x0501, 0x042e, 0x0fd8 }, + { 0x8501, 0x0437, 0x4fd8 }, + { 0x8501, 0x0433, 0x3fd8 }, + { 0x8501, 0x0431, 0x2fd8 }, + { 0x0501, 0x0430, 0x0fd8 }, + { 0x0501, 0x0432, 0x0fd8 }, + { 0x8501, 0x0435, 0x2fd8 }, + { 0x0501, 0x0434, 0x0fd8 }, + { 0x0501, 0x0436, 0x0fd8 }, + { 0x8501, 0x043b, 0x3fd8 }, + { 0x8501, 0x0439, 0x2fd8 }, + { 0x0501, 0x0438, 0x0fd8 }, + { 0x0501, 0x043a, 0x0fd8 }, + { 0x8501, 0x043d, 0x2fd8 }, + { 0x0501, 0x043c, 0x0fd8 }, + { 0x0501, 0x043e, 0x0fd8 }, + { 0x8501, 0x044f, 0x5fd8 }, + { 0x8501, 0x0447, 0x4fd8 }, + { 0x8501, 0x0443, 0x3fd8 }, + { 0x8501, 0x0441, 0x2fd8 }, + { 0x0501, 0x0440, 0x0fd8 }, + { 0x0501, 0x0442, 0x0fd8 }, + { 0x8501, 0x0445, 0x2fd8 }, + { 0x0501, 0x0444, 0x0fd8 }, + { 0x0501, 0x0446, 0x0fd8 }, + { 0x8501, 0x044b, 0x3fd8 }, + { 0x8501, 0x0449, 0x2fd8 }, + { 0x0501, 0x0448, 0x0fd8 }, + { 0x0501, 0x044a, 0x0fd8 }, + { 0x8501, 0x044d, 0x2fd8 }, + { 0x0501, 0x044c, 0x0fd8 }, + { 0x0501, 0x044e, 0x0fd8 }, + { 0x8701, 0x0457, 0x4000 }, + { 0x8701, 0x0453, 0x3000 }, + { 0x8701, 0x0451, 0x2000 }, + { 0x0701, 0x0450, 0x0000 }, + { 0x0701, 0x0452, 0x0000 }, + { 0x8701, 0x0455, 0x2000 }, + { 0x0701, 0x0454, 0x0000 }, + { 0x0701, 0x0456, 0x0000 }, + { 0x8701, 0x045b, 0x3000 }, + { 0x8701, 0x0459, 0x2000 }, + { 0x0701, 0x0458, 0x0000 }, + { 0x0701, 0x045a, 0x0000 }, + { 0x8701, 0x045d, 0x2000 }, + { 0x0701, 0x045c, 0x0000 }, + { 0x0701, 0x045e, 0x0000 }, + { 0x9a01, 0xd000, 0x8000 }, + { 0x8d01, 0x04a1, 0x7000 }, + { 0x8701, 0x047f, 0x6000 }, + { 0x8701, 0x046f, 0x5000 }, + { 0x8701, 0x0467, 0x4000 }, + { 0x8701, 0x0463, 0x3000 }, + { 0x8701, 0x0461, 0x2000 }, + { 0x0701, 0x0460, 0x0000 }, + { 0x0701, 0x0462, 0x0000 }, + { 0x8701, 0x0465, 0x2000 }, + { 0x0701, 0x0464, 0x0000 }, + { 0x0701, 0x0466, 0x0000 }, + { 0x8701, 0x046b, 0x3000 }, + { 0x8701, 0x0469, 0x2000 }, + { 0x0701, 0x0468, 0x0000 }, + { 0x0701, 0x046a, 0x0000 }, + { 0x8701, 0x046d, 0x2000 }, + { 0x0701, 0x046c, 0x0000 }, + { 0x0701, 0x046e, 0x0000 }, + { 0x8701, 0x0477, 0x4000 }, + { 0x8701, 0x0473, 0x3000 }, + { 0x8701, 0x0471, 0x2000 }, + { 0x0701, 0x0470, 0x0000 }, + { 0x0701, 0x0472, 0x0000 }, + { 0x8701, 0x0475, 0x2000 }, + { 0x0701, 0x0474, 0x0000 }, + { 0x0701, 0x0476, 0x0000 }, + { 0x8701, 0x047b, 0x3000 }, + { 0x8701, 0x0479, 0x2000 }, + { 0x0701, 0x0478, 0x0000 }, + { 0x0701, 0x047a, 0x0000 }, + { 0x8701, 0x047d, 0x2000 }, + { 0x0701, 0x047c, 0x0000 }, + { 0x0701, 0x047e, 0x0000 }, + { 0x8701, 0x048f, 0x5000 }, + { 0x8701, 0x0487, 0x4000 }, + { 0x8701, 0x0483, 0x3000 }, + { 0x8701, 0x0481, 0x2000 }, + { 0x0701, 0x0480, 0x0000 }, + { 0x0701, 0x0482, 0x0000 }, + { 0x8701, 0x0485, 0x2000 }, + { 0x0701, 0x0484, 0x0000 }, + { 0x0701, 0x0486, 0x0000 }, + { 0x8701, 0x048b, 0x3000 }, + { 0x8701, 0x0489, 0x2000 }, + { 0x0701, 0x0488, 0x0000 }, + { 0x0701, 0x048a, 0x0000 }, + { 0x8701, 0x048d, 0x2000 }, + { 0x0701, 0x048c, 0x0000 }, + { 0x0701, 0x048e, 0x0000 }, + { 0x8701, 0x0497, 0x4000 }, + { 0x8701, 0x0493, 0x3000 }, + { 0x8701, 0x0491, 0x2000 }, + { 0x0701, 0x0490, 0x0000 }, + { 0x0701, 0x0492, 0x0000 }, + { 0x8701, 0x0495, 0x2000 }, + { 0x0701, 0x0494, 0x0000 }, + { 0x0701, 0x0496, 0x0000 }, + { 0x8701, 0x049b, 0x3000 }, + { 0x8701, 0x0499, 0x2000 }, + { 0x0701, 0x0498, 0x0000 }, + { 0x0701, 0x049a, 0x0000 }, + { 0x8701, 0x049d, 0x2000 }, + { 0x0701, 0x049c, 0x0000 }, + { 0x0d01, 0x04a0, 0x0000 }, + { 0x8701, 0x081a, 0x6000 }, + { 0x8701, 0x080a, 0x5000 }, + { 0x8d01, 0x04a9, 0x4000 }, + { 0x8d01, 0x04a5, 0x3000 }, + { 0x8d01, 0x04a3, 0x2000 }, + { 0x0d01, 0x04a2, 0x0000 }, + { 0x0d01, 0x04a4, 0x0000 }, + { 0x8d01, 0x04a7, 0x2000 }, + { 0x0d01, 0x04a6, 0x0000 }, + { 0x0d01, 0x04a8, 0x0000 }, + { 0x8701, 0x0803, 0x3000 }, + { 0x8701, 0x0801, 0x2000 }, + { 0x0701, 0x0800, 0x0000 }, + { 0x0701, 0x0802, 0x0000 }, + { 0x8701, 0x0805, 0x2000 }, + { 0x0701, 0x0804, 0x0000 }, + { 0x0701, 0x0808, 0x0000 }, + { 0x8701, 0x0812, 0x4000 }, + { 0x8701, 0x080e, 0x3000 }, + { 0x8701, 0x080c, 0x2000 }, + { 0x0701, 0x080b, 0x0000 }, + { 0x0701, 0x080d, 0x0000 }, + { 0x8701, 0x0810, 0x2000 }, + { 0x0701, 0x080f, 0x0000 }, + { 0x0701, 0x0811, 0x0000 }, + { 0x8701, 0x0816, 0x3000 }, + { 0x8701, 0x0814, 0x2000 }, + { 0x0701, 0x0813, 0x0000 }, + { 0x0701, 0x0815, 0x0000 }, + { 0x8701, 0x0818, 0x2000 }, + { 0x0701, 0x0817, 0x0000 }, + { 0x0701, 0x0819, 0x0000 }, + { 0x8701, 0x082a, 0x5000 }, + { 0x8701, 0x0822, 0x4000 }, + { 0x8701, 0x081e, 0x3000 }, + { 0x8701, 0x081c, 0x2000 }, + { 0x0701, 0x081b, 0x0000 }, + { 0x0701, 0x081d, 0x0000 }, + { 0x8701, 0x0820, 0x2000 }, + { 0x0701, 0x081f, 0x0000 }, + { 0x0701, 0x0821, 0x0000 }, + { 0x8701, 0x0826, 0x3000 }, + { 0x8701, 0x0824, 0x2000 }, + { 0x0701, 0x0823, 0x0000 }, + { 0x0701, 0x0825, 0x0000 }, + { 0x8701, 0x0828, 0x2000 }, + { 0x0701, 0x0827, 0x0000 }, + { 0x0701, 0x0829, 0x0000 }, + { 0x8701, 0x0832, 0x4000 }, + { 0x8701, 0x082e, 0x3000 }, + { 0x8701, 0x082c, 0x2000 }, + { 0x0701, 0x082b, 0x0000 }, + { 0x0701, 0x082d, 0x0000 }, + { 0x8701, 0x0830, 0x2000 }, + { 0x0701, 0x082f, 0x0000 }, + { 0x0701, 0x0831, 0x0000 }, + { 0x8701, 0x0837, 0x3000 }, + { 0x8701, 0x0834, 0x2000 }, + { 0x0701, 0x0833, 0x0000 }, + { 0x0701, 0x0835, 0x0000 }, + { 0x8701, 0x083c, 0x2000 }, + { 0x0701, 0x0838, 0x0000 }, + { 0x0701, 0x083f, 0x0000 }, + { 0x9a01, 0xd040, 0x7000 }, + { 0x9a01, 0xd020, 0x6000 }, + { 0x9a01, 0xd010, 0x5000 }, + { 0x9a01, 0xd008, 0x4000 }, + { 0x9a01, 0xd004, 0x3000 }, + { 0x9a01, 0xd002, 0x2000 }, + { 0x1a01, 0xd001, 0x0000 }, + { 0x1a01, 0xd003, 0x0000 }, + { 0x9a01, 0xd006, 0x2000 }, + { 0x1a01, 0xd005, 0x0000 }, + { 0x1a01, 0xd007, 0x0000 }, + { 0x9a01, 0xd00c, 0x3000 }, + { 0x9a01, 0xd00a, 0x2000 }, + { 0x1a01, 0xd009, 0x0000 }, + { 0x1a01, 0xd00b, 0x0000 }, + { 0x9a01, 0xd00e, 0x2000 }, + { 0x1a01, 0xd00d, 0x0000 }, + { 0x1a01, 0xd00f, 0x0000 }, + { 0x9a01, 0xd018, 0x4000 }, + { 0x9a01, 0xd014, 0x3000 }, + { 0x9a01, 0xd012, 0x2000 }, + { 0x1a01, 0xd011, 0x0000 }, + { 0x1a01, 0xd013, 0x0000 }, + { 0x9a01, 0xd016, 0x2000 }, + { 0x1a01, 0xd015, 0x0000 }, + { 0x1a01, 0xd017, 0x0000 }, + { 0x9a01, 0xd01c, 0x3000 }, + { 0x9a01, 0xd01a, 0x2000 }, + { 0x1a01, 0xd019, 0x0000 }, + { 0x1a01, 0xd01b, 0x0000 }, + { 0x9a01, 0xd01e, 0x2000 }, + { 0x1a01, 0xd01d, 0x0000 }, + { 0x1a01, 0xd01f, 0x0000 }, + { 0x9a01, 0xd030, 0x5000 }, + { 0x9a01, 0xd028, 0x4000 }, + { 0x9a01, 0xd024, 0x3000 }, + { 0x9a01, 0xd022, 0x2000 }, + { 0x1a01, 0xd021, 0x0000 }, + { 0x1a01, 0xd023, 0x0000 }, + { 0x9a01, 0xd026, 0x2000 }, + { 0x1a01, 0xd025, 0x0000 }, + { 0x1a01, 0xd027, 0x0000 }, + { 0x9a01, 0xd02c, 0x3000 }, + { 0x9a01, 0xd02a, 0x2000 }, + { 0x1a01, 0xd029, 0x0000 }, + { 0x1a01, 0xd02b, 0x0000 }, + { 0x9a01, 0xd02e, 0x2000 }, + { 0x1a01, 0xd02d, 0x0000 }, + { 0x1a01, 0xd02f, 0x0000 }, + { 0x9a01, 0xd038, 0x4000 }, + { 0x9a01, 0xd034, 0x3000 }, + { 0x9a01, 0xd032, 0x2000 }, + { 0x1a01, 0xd031, 0x0000 }, + { 0x1a01, 0xd033, 0x0000 }, + { 0x9a01, 0xd036, 0x2000 }, + { 0x1a01, 0xd035, 0x0000 }, + { 0x1a01, 0xd037, 0x0000 }, + { 0x9a01, 0xd03c, 0x3000 }, + { 0x9a01, 0xd03a, 0x2000 }, + { 0x1a01, 0xd039, 0x0000 }, + { 0x1a01, 0xd03b, 0x0000 }, + { 0x9a01, 0xd03e, 0x2000 }, + { 0x1a01, 0xd03d, 0x0000 }, + { 0x1a01, 0xd03f, 0x0000 }, + { 0x9a01, 0xd060, 0x6000 }, + { 0x9a01, 0xd050, 0x5000 }, + { 0x9a01, 0xd048, 0x4000 }, + { 0x9a01, 0xd044, 0x3000 }, + { 0x9a01, 0xd042, 0x2000 }, + { 0x1a01, 0xd041, 0x0000 }, + { 0x1a01, 0xd043, 0x0000 }, + { 0x9a01, 0xd046, 0x2000 }, + { 0x1a01, 0xd045, 0x0000 }, + { 0x1a01, 0xd047, 0x0000 }, + { 0x9a01, 0xd04c, 0x3000 }, + { 0x9a01, 0xd04a, 0x2000 }, + { 0x1a01, 0xd049, 0x0000 }, + { 0x1a01, 0xd04b, 0x0000 }, + { 0x9a01, 0xd04e, 0x2000 }, + { 0x1a01, 0xd04d, 0x0000 }, + { 0x1a01, 0xd04f, 0x0000 }, + { 0x9a01, 0xd058, 0x4000 }, + { 0x9a01, 0xd054, 0x3000 }, + { 0x9a01, 0xd052, 0x2000 }, + { 0x1a01, 0xd051, 0x0000 }, + { 0x1a01, 0xd053, 0x0000 }, + { 0x9a01, 0xd056, 0x2000 }, + { 0x1a01, 0xd055, 0x0000 }, + { 0x1a01, 0xd057, 0x0000 }, + { 0x9a01, 0xd05c, 0x3000 }, + { 0x9a01, 0xd05a, 0x2000 }, + { 0x1a01, 0xd059, 0x0000 }, + { 0x1a01, 0xd05b, 0x0000 }, + { 0x9a01, 0xd05e, 0x2000 }, + { 0x1a01, 0xd05d, 0x0000 }, + { 0x1a01, 0xd05f, 0x0000 }, + { 0x9a01, 0xd070, 0x5000 }, + { 0x9a01, 0xd068, 0x4000 }, + { 0x9a01, 0xd064, 0x3000 }, + { 0x9a01, 0xd062, 0x2000 }, + { 0x1a01, 0xd061, 0x0000 }, + { 0x1a01, 0xd063, 0x0000 }, + { 0x9a01, 0xd066, 0x2000 }, + { 0x1a01, 0xd065, 0x0000 }, + { 0x1a01, 0xd067, 0x0000 }, + { 0x9a01, 0xd06c, 0x3000 }, + { 0x9a01, 0xd06a, 0x2000 }, + { 0x1a01, 0xd069, 0x0000 }, + { 0x1a01, 0xd06b, 0x0000 }, + { 0x9a01, 0xd06e, 0x2000 }, + { 0x1a01, 0xd06d, 0x0000 }, + { 0x1a01, 0xd06f, 0x0000 }, + { 0x9a01, 0xd078, 0x4000 }, + { 0x9a01, 0xd074, 0x3000 }, + { 0x9a01, 0xd072, 0x2000 }, + { 0x1a01, 0xd071, 0x0000 }, + { 0x1a01, 0xd073, 0x0000 }, + { 0x9a01, 0xd076, 0x2000 }, + { 0x1a01, 0xd075, 0x0000 }, + { 0x1a01, 0xd077, 0x0000 }, + { 0x9a01, 0xd07c, 0x3000 }, + { 0x9a01, 0xd07a, 0x2000 }, + { 0x1a01, 0xd079, 0x0000 }, + { 0x1a01, 0xd07b, 0x0000 }, + { 0x9a01, 0xd07e, 0x2000 }, + { 0x1a01, 0xd07d, 0x0000 }, + { 0x1a01, 0xd07f, 0x0000 }, + { 0x9a01, 0xd18d, 0x9000 }, + { 0x9a01, 0xd10a, 0x8000 }, + { 0x9a01, 0xd0c0, 0x7000 }, + { 0x9a01, 0xd0a0, 0x6000 }, + { 0x9a01, 0xd090, 0x5000 }, + { 0x9a01, 0xd088, 0x4000 }, + { 0x9a01, 0xd084, 0x3000 }, + { 0x9a01, 0xd082, 0x2000 }, + { 0x1a01, 0xd081, 0x0000 }, + { 0x1a01, 0xd083, 0x0000 }, + { 0x9a01, 0xd086, 0x2000 }, + { 0x1a01, 0xd085, 0x0000 }, + { 0x1a01, 0xd087, 0x0000 }, + { 0x9a01, 0xd08c, 0x3000 }, + { 0x9a01, 0xd08a, 0x2000 }, + { 0x1a01, 0xd089, 0x0000 }, + { 0x1a01, 0xd08b, 0x0000 }, + { 0x9a01, 0xd08e, 0x2000 }, + { 0x1a01, 0xd08d, 0x0000 }, + { 0x1a01, 0xd08f, 0x0000 }, + { 0x9a01, 0xd098, 0x4000 }, + { 0x9a01, 0xd094, 0x3000 }, + { 0x9a01, 0xd092, 0x2000 }, + { 0x1a01, 0xd091, 0x0000 }, + { 0x1a01, 0xd093, 0x0000 }, + { 0x9a01, 0xd096, 0x2000 }, + { 0x1a01, 0xd095, 0x0000 }, + { 0x1a01, 0xd097, 0x0000 }, + { 0x9a01, 0xd09c, 0x3000 }, + { 0x9a01, 0xd09a, 0x2000 }, + { 0x1a01, 0xd099, 0x0000 }, + { 0x1a01, 0xd09b, 0x0000 }, + { 0x9a01, 0xd09e, 0x2000 }, + { 0x1a01, 0xd09d, 0x0000 }, + { 0x1a01, 0xd09f, 0x0000 }, + { 0x9a01, 0xd0b0, 0x5000 }, + { 0x9a01, 0xd0a8, 0x4000 }, + { 0x9a01, 0xd0a4, 0x3000 }, + { 0x9a01, 0xd0a2, 0x2000 }, + { 0x1a01, 0xd0a1, 0x0000 }, + { 0x1a01, 0xd0a3, 0x0000 }, + { 0x9a01, 0xd0a6, 0x2000 }, + { 0x1a01, 0xd0a5, 0x0000 }, + { 0x1a01, 0xd0a7, 0x0000 }, + { 0x9a01, 0xd0ac, 0x3000 }, + { 0x9a01, 0xd0aa, 0x2000 }, + { 0x1a01, 0xd0a9, 0x0000 }, + { 0x1a01, 0xd0ab, 0x0000 }, + { 0x9a01, 0xd0ae, 0x2000 }, + { 0x1a01, 0xd0ad, 0x0000 }, + { 0x1a01, 0xd0af, 0x0000 }, + { 0x9a01, 0xd0b8, 0x4000 }, + { 0x9a01, 0xd0b4, 0x3000 }, + { 0x9a01, 0xd0b2, 0x2000 }, + { 0x1a01, 0xd0b1, 0x0000 }, + { 0x1a01, 0xd0b3, 0x0000 }, + { 0x9a01, 0xd0b6, 0x2000 }, + { 0x1a01, 0xd0b5, 0x0000 }, + { 0x1a01, 0xd0b7, 0x0000 }, + { 0x9a01, 0xd0bc, 0x3000 }, + { 0x9a01, 0xd0ba, 0x2000 }, + { 0x1a01, 0xd0b9, 0x0000 }, + { 0x1a01, 0xd0bb, 0x0000 }, + { 0x9a01, 0xd0be, 0x2000 }, + { 0x1a01, 0xd0bd, 0x0000 }, + { 0x1a01, 0xd0bf, 0x0000 }, + { 0x9a01, 0xd0e0, 0x6000 }, + { 0x9a01, 0xd0d0, 0x5000 }, + { 0x9a01, 0xd0c8, 0x4000 }, + { 0x9a01, 0xd0c4, 0x3000 }, + { 0x9a01, 0xd0c2, 0x2000 }, + { 0x1a01, 0xd0c1, 0x0000 }, + { 0x1a01, 0xd0c3, 0x0000 }, + { 0x9a01, 0xd0c6, 0x2000 }, + { 0x1a01, 0xd0c5, 0x0000 }, + { 0x1a01, 0xd0c7, 0x0000 }, + { 0x9a01, 0xd0cc, 0x3000 }, + { 0x9a01, 0xd0ca, 0x2000 }, + { 0x1a01, 0xd0c9, 0x0000 }, + { 0x1a01, 0xd0cb, 0x0000 }, + { 0x9a01, 0xd0ce, 0x2000 }, + { 0x1a01, 0xd0cd, 0x0000 }, + { 0x1a01, 0xd0cf, 0x0000 }, + { 0x9a01, 0xd0d8, 0x4000 }, + { 0x9a01, 0xd0d4, 0x3000 }, + { 0x9a01, 0xd0d2, 0x2000 }, + { 0x1a01, 0xd0d1, 0x0000 }, + { 0x1a01, 0xd0d3, 0x0000 }, + { 0x9a01, 0xd0d6, 0x2000 }, + { 0x1a01, 0xd0d5, 0x0000 }, + { 0x1a01, 0xd0d7, 0x0000 }, + { 0x9a01, 0xd0dc, 0x3000 }, + { 0x9a01, 0xd0da, 0x2000 }, + { 0x1a01, 0xd0d9, 0x0000 }, + { 0x1a01, 0xd0db, 0x0000 }, + { 0x9a01, 0xd0de, 0x2000 }, + { 0x1a01, 0xd0dd, 0x0000 }, + { 0x1a01, 0xd0df, 0x0000 }, + { 0x9a01, 0xd0f0, 0x5000 }, + { 0x9a01, 0xd0e8, 0x4000 }, + { 0x9a01, 0xd0e4, 0x3000 }, + { 0x9a01, 0xd0e2, 0x2000 }, + { 0x1a01, 0xd0e1, 0x0000 }, + { 0x1a01, 0xd0e3, 0x0000 }, + { 0x9a01, 0xd0e6, 0x2000 }, + { 0x1a01, 0xd0e5, 0x0000 }, + { 0x1a01, 0xd0e7, 0x0000 }, + { 0x9a01, 0xd0ec, 0x3000 }, + { 0x9a01, 0xd0ea, 0x2000 }, + { 0x1a01, 0xd0e9, 0x0000 }, + { 0x1a01, 0xd0eb, 0x0000 }, + { 0x9a01, 0xd0ee, 0x2000 }, + { 0x1a01, 0xd0ed, 0x0000 }, + { 0x1a01, 0xd0ef, 0x0000 }, + { 0x9a01, 0xd102, 0x4000 }, + { 0x9a01, 0xd0f4, 0x3000 }, + { 0x9a01, 0xd0f2, 0x2000 }, + { 0x1a01, 0xd0f1, 0x0000 }, + { 0x1a01, 0xd0f3, 0x0000 }, + { 0x9a01, 0xd100, 0x2000 }, + { 0x1a01, 0xd0f5, 0x0000 }, + { 0x1a01, 0xd101, 0x0000 }, + { 0x9a01, 0xd106, 0x3000 }, + { 0x9a01, 0xd104, 0x2000 }, + { 0x1a01, 0xd103, 0x0000 }, + { 0x1a01, 0xd105, 0x0000 }, + { 0x9a01, 0xd108, 0x2000 }, + { 0x1a01, 0xd107, 0x0000 }, + { 0x1a01, 0xd109, 0x0000 }, + { 0x9a01, 0xd14d, 0x7000 }, + { 0x9a01, 0xd12d, 0x6000 }, + { 0x9a01, 0xd11a, 0x5000 }, + { 0x9a01, 0xd112, 0x4000 }, + { 0x9a01, 0xd10e, 0x3000 }, + { 0x9a01, 0xd10c, 0x2000 }, + { 0x1a01, 0xd10b, 0x0000 }, + { 0x1a01, 0xd10d, 0x0000 }, + { 0x9a01, 0xd110, 0x2000 }, + { 0x1a01, 0xd10f, 0x0000 }, + { 0x1a01, 0xd111, 0x0000 }, + { 0x9a01, 0xd116, 0x3000 }, + { 0x9a01, 0xd114, 0x2000 }, + { 0x1a01, 0xd113, 0x0000 }, + { 0x1a01, 0xd115, 0x0000 }, + { 0x9a01, 0xd118, 0x2000 }, + { 0x1a01, 0xd117, 0x0000 }, + { 0x1a01, 0xd119, 0x0000 }, + { 0x9a01, 0xd122, 0x4000 }, + { 0x9a01, 0xd11e, 0x3000 }, + { 0x9a01, 0xd11c, 0x2000 }, + { 0x1a01, 0xd11b, 0x0000 }, + { 0x1a01, 0xd11d, 0x0000 }, + { 0x9a01, 0xd120, 0x2000 }, + { 0x1a01, 0xd11f, 0x0000 }, + { 0x1a01, 0xd121, 0x0000 }, + { 0x9a01, 0xd126, 0x3000 }, + { 0x9a01, 0xd124, 0x2000 }, + { 0x1a01, 0xd123, 0x0000 }, + { 0x1a01, 0xd125, 0x0000 }, + { 0x9a01, 0xd12b, 0x2000 }, + { 0x1a01, 0xd12a, 0x0000 }, + { 0x1a01, 0xd12c, 0x0000 }, + { 0x9a01, 0xd13d, 0x5000 }, + { 0x9a01, 0xd135, 0x4000 }, + { 0x9a01, 0xd131, 0x3000 }, + { 0x9a01, 0xd12f, 0x2000 }, + { 0x1a01, 0xd12e, 0x0000 }, + { 0x1a01, 0xd130, 0x0000 }, + { 0x9a01, 0xd133, 0x2000 }, + { 0x1a01, 0xd132, 0x0000 }, + { 0x1a01, 0xd134, 0x0000 }, + { 0x9a01, 0xd139, 0x3000 }, + { 0x9a01, 0xd137, 0x2000 }, + { 0x1a01, 0xd136, 0x0000 }, + { 0x1a01, 0xd138, 0x0000 }, + { 0x9a01, 0xd13b, 0x2000 }, + { 0x1a01, 0xd13a, 0x0000 }, + { 0x1a01, 0xd13c, 0x0000 }, + { 0x9a01, 0xd145, 0x4000 }, + { 0x9a01, 0xd141, 0x3000 }, + { 0x9a01, 0xd13f, 0x2000 }, + { 0x1a01, 0xd13e, 0x0000 }, + { 0x1a01, 0xd140, 0x0000 }, + { 0x9a01, 0xd143, 0x2000 }, + { 0x1a01, 0xd142, 0x0000 }, + { 0x1a01, 0xd144, 0x0000 }, + { 0x9a01, 0xd149, 0x3000 }, + { 0x9a01, 0xd147, 0x2000 }, + { 0x1a01, 0xd146, 0x0000 }, + { 0x1a01, 0xd148, 0x0000 }, + { 0x9a01, 0xd14b, 0x2000 }, + { 0x1a01, 0xd14a, 0x0000 }, + { 0x1a01, 0xd14c, 0x0000 }, + { 0x8a01, 0xd16d, 0x6000 }, + { 0x9a01, 0xd15d, 0x5000 }, + { 0x9a01, 0xd155, 0x4000 }, + { 0x9a01, 0xd151, 0x3000 }, + { 0x9a01, 0xd14f, 0x2000 }, + { 0x1a01, 0xd14e, 0x0000 }, + { 0x1a01, 0xd150, 0x0000 }, + { 0x9a01, 0xd153, 0x2000 }, + { 0x1a01, 0xd152, 0x0000 }, + { 0x1a01, 0xd154, 0x0000 }, + { 0x9a01, 0xd159, 0x3000 }, + { 0x9a01, 0xd157, 0x2000 }, + { 0x1a01, 0xd156, 0x0000 }, + { 0x1a01, 0xd158, 0x0000 }, + { 0x9a01, 0xd15b, 0x2000 }, + { 0x1a01, 0xd15a, 0x0000 }, + { 0x1a01, 0xd15c, 0x0000 }, + { 0x8a01, 0xd165, 0x4000 }, + { 0x9a01, 0xd161, 0x3000 }, + { 0x9a01, 0xd15f, 0x2000 }, + { 0x1a01, 0xd15e, 0x0000 }, + { 0x1a01, 0xd160, 0x0000 }, + { 0x9a01, 0xd163, 0x2000 }, + { 0x1a01, 0xd162, 0x0000 }, + { 0x1a01, 0xd164, 0x0000 }, + { 0x8c01, 0xd169, 0x3000 }, + { 0x8c01, 0xd167, 0x2000 }, + { 0x0a01, 0xd166, 0x0000 }, + { 0x0c01, 0xd168, 0x0000 }, + { 0x9a01, 0xd16b, 0x2000 }, + { 0x1a01, 0xd16a, 0x0000 }, + { 0x1a01, 0xd16c, 0x0000 }, + { 0x8c01, 0xd17d, 0x5000 }, + { 0x8101, 0xd175, 0x4000 }, + { 0x8a01, 0xd171, 0x3000 }, + { 0x8a01, 0xd16f, 0x2000 }, + { 0x0a01, 0xd16e, 0x0000 }, + { 0x0a01, 0xd170, 0x0000 }, + { 0x8101, 0xd173, 0x2000 }, + { 0x0a01, 0xd172, 0x0000 }, + { 0x0101, 0xd174, 0x0000 }, + { 0x8101, 0xd179, 0x3000 }, + { 0x8101, 0xd177, 0x2000 }, + { 0x0101, 0xd176, 0x0000 }, + { 0x0101, 0xd178, 0x0000 }, + { 0x8c01, 0xd17b, 0x2000 }, + { 0x0101, 0xd17a, 0x0000 }, + { 0x0c01, 0xd17c, 0x0000 }, + { 0x8c01, 0xd185, 0x4000 }, + { 0x8c01, 0xd181, 0x3000 }, + { 0x8c01, 0xd17f, 0x2000 }, + { 0x0c01, 0xd17e, 0x0000 }, + { 0x0c01, 0xd180, 0x0000 }, + { 0x9a01, 0xd183, 0x2000 }, + { 0x0c01, 0xd182, 0x0000 }, + { 0x1a01, 0xd184, 0x0000 }, + { 0x8c01, 0xd189, 0x3000 }, + { 0x8c01, 0xd187, 0x2000 }, + { 0x0c01, 0xd186, 0x0000 }, + { 0x0c01, 0xd188, 0x0000 }, + { 0x8c01, 0xd18b, 0x2000 }, + { 0x0c01, 0xd18a, 0x0000 }, + { 0x1a01, 0xd18c, 0x0000 }, + { 0x9a01, 0xd32f, 0x8000 }, + { 0x9a01, 0xd1cd, 0x7000 }, + { 0x8c01, 0xd1ad, 0x6000 }, + { 0x9a01, 0xd19d, 0x5000 }, + { 0x9a01, 0xd195, 0x4000 }, + { 0x9a01, 0xd191, 0x3000 }, + { 0x9a01, 0xd18f, 0x2000 }, + { 0x1a01, 0xd18e, 0x0000 }, + { 0x1a01, 0xd190, 0x0000 }, + { 0x9a01, 0xd193, 0x2000 }, + { 0x1a01, 0xd192, 0x0000 }, + { 0x1a01, 0xd194, 0x0000 }, + { 0x9a01, 0xd199, 0x3000 }, + { 0x9a01, 0xd197, 0x2000 }, + { 0x1a01, 0xd196, 0x0000 }, + { 0x1a01, 0xd198, 0x0000 }, + { 0x9a01, 0xd19b, 0x2000 }, + { 0x1a01, 0xd19a, 0x0000 }, + { 0x1a01, 0xd19c, 0x0000 }, + { 0x9a01, 0xd1a5, 0x4000 }, + { 0x9a01, 0xd1a1, 0x3000 }, + { 0x9a01, 0xd19f, 0x2000 }, + { 0x1a01, 0xd19e, 0x0000 }, + { 0x1a01, 0xd1a0, 0x0000 }, + { 0x9a01, 0xd1a3, 0x2000 }, + { 0x1a01, 0xd1a2, 0x0000 }, + { 0x1a01, 0xd1a4, 0x0000 }, + { 0x9a01, 0xd1a9, 0x3000 }, + { 0x9a01, 0xd1a7, 0x2000 }, + { 0x1a01, 0xd1a6, 0x0000 }, + { 0x1a01, 0xd1a8, 0x0000 }, + { 0x8c01, 0xd1ab, 0x2000 }, + { 0x0c01, 0xd1aa, 0x0000 }, + { 0x0c01, 0xd1ac, 0x0000 }, + { 0x9a01, 0xd1bd, 0x5000 }, + { 0x9a01, 0xd1b5, 0x4000 }, + { 0x9a01, 0xd1b1, 0x3000 }, + { 0x9a01, 0xd1af, 0x2000 }, + { 0x1a01, 0xd1ae, 0x0000 }, + { 0x1a01, 0xd1b0, 0x0000 }, + { 0x9a01, 0xd1b3, 0x2000 }, + { 0x1a01, 0xd1b2, 0x0000 }, + { 0x1a01, 0xd1b4, 0x0000 }, + { 0x9a01, 0xd1b9, 0x3000 }, + { 0x9a01, 0xd1b7, 0x2000 }, + { 0x1a01, 0xd1b6, 0x0000 }, + { 0x1a01, 0xd1b8, 0x0000 }, + { 0x9a01, 0xd1bb, 0x2000 }, + { 0x1a01, 0xd1ba, 0x0000 }, + { 0x1a01, 0xd1bc, 0x0000 }, + { 0x9a01, 0xd1c5, 0x4000 }, + { 0x9a01, 0xd1c1, 0x3000 }, + { 0x9a01, 0xd1bf, 0x2000 }, + { 0x1a01, 0xd1be, 0x0000 }, + { 0x1a01, 0xd1c0, 0x0000 }, + { 0x9a01, 0xd1c3, 0x2000 }, + { 0x1a01, 0xd1c2, 0x0000 }, + { 0x1a01, 0xd1c4, 0x0000 }, + { 0x9a01, 0xd1c9, 0x3000 }, + { 0x9a01, 0xd1c7, 0x2000 }, + { 0x1a01, 0xd1c6, 0x0000 }, + { 0x1a01, 0xd1c8, 0x0000 }, + { 0x9a01, 0xd1cb, 0x2000 }, + { 0x1a01, 0xd1ca, 0x0000 }, + { 0x1a01, 0xd1cc, 0x0000 }, + { 0x9a01, 0xd30f, 0x6000 }, + { 0x9a01, 0xd1dd, 0x5000 }, + { 0x9a01, 0xd1d5, 0x4000 }, + { 0x9a01, 0xd1d1, 0x3000 }, + { 0x9a01, 0xd1cf, 0x2000 }, + { 0x1a01, 0xd1ce, 0x0000 }, + { 0x1a01, 0xd1d0, 0x0000 }, + { 0x9a01, 0xd1d3, 0x2000 }, + { 0x1a01, 0xd1d2, 0x0000 }, + { 0x1a01, 0xd1d4, 0x0000 }, + { 0x9a01, 0xd1d9, 0x3000 }, + { 0x9a01, 0xd1d7, 0x2000 }, + { 0x1a01, 0xd1d6, 0x0000 }, + { 0x1a01, 0xd1d8, 0x0000 }, + { 0x9a01, 0xd1db, 0x2000 }, + { 0x1a01, 0xd1da, 0x0000 }, + { 0x1a01, 0xd1dc, 0x0000 }, + { 0x9a01, 0xd307, 0x4000 }, + { 0x9a01, 0xd303, 0x3000 }, + { 0x9a01, 0xd301, 0x2000 }, + { 0x1a01, 0xd300, 0x0000 }, + { 0x1a01, 0xd302, 0x0000 }, + { 0x9a01, 0xd305, 0x2000 }, + { 0x1a01, 0xd304, 0x0000 }, + { 0x1a01, 0xd306, 0x0000 }, + { 0x9a01, 0xd30b, 0x3000 }, + { 0x9a01, 0xd309, 0x2000 }, + { 0x1a01, 0xd308, 0x0000 }, + { 0x1a01, 0xd30a, 0x0000 }, + { 0x9a01, 0xd30d, 0x2000 }, + { 0x1a01, 0xd30c, 0x0000 }, + { 0x1a01, 0xd30e, 0x0000 }, + { 0x9a01, 0xd31f, 0x5000 }, + { 0x9a01, 0xd317, 0x4000 }, + { 0x9a01, 0xd313, 0x3000 }, + { 0x9a01, 0xd311, 0x2000 }, + { 0x1a01, 0xd310, 0x0000 }, + { 0x1a01, 0xd312, 0x0000 }, + { 0x9a01, 0xd315, 0x2000 }, + { 0x1a01, 0xd314, 0x0000 }, + { 0x1a01, 0xd316, 0x0000 }, + { 0x9a01, 0xd31b, 0x3000 }, + { 0x9a01, 0xd319, 0x2000 }, + { 0x1a01, 0xd318, 0x0000 }, + { 0x1a01, 0xd31a, 0x0000 }, + { 0x9a01, 0xd31d, 0x2000 }, + { 0x1a01, 0xd31c, 0x0000 }, + { 0x1a01, 0xd31e, 0x0000 }, + { 0x9a01, 0xd327, 0x4000 }, + { 0x9a01, 0xd323, 0x3000 }, + { 0x9a01, 0xd321, 0x2000 }, + { 0x1a01, 0xd320, 0x0000 }, + { 0x1a01, 0xd322, 0x0000 }, + { 0x9a01, 0xd325, 0x2000 }, + { 0x1a01, 0xd324, 0x0000 }, + { 0x1a01, 0xd326, 0x0000 }, + { 0x9a01, 0xd32b, 0x3000 }, + { 0x9a01, 0xd329, 0x2000 }, + { 0x1a01, 0xd328, 0x0000 }, + { 0x1a01, 0xd32a, 0x0000 }, + { 0x9a01, 0xd32d, 0x2000 }, + { 0x1a01, 0xd32c, 0x0000 }, + { 0x1a01, 0xd32e, 0x0000 }, + { 0x8901, 0xd418, 0x7000 }, + { 0x9a01, 0xd34f, 0x6000 }, + { 0x9a01, 0xd33f, 0x5000 }, + { 0x9a01, 0xd337, 0x4000 }, + { 0x9a01, 0xd333, 0x3000 }, + { 0x9a01, 0xd331, 0x2000 }, + { 0x1a01, 0xd330, 0x0000 }, + { 0x1a01, 0xd332, 0x0000 }, + { 0x9a01, 0xd335, 0x2000 }, + { 0x1a01, 0xd334, 0x0000 }, + { 0x1a01, 0xd336, 0x0000 }, + { 0x9a01, 0xd33b, 0x3000 }, + { 0x9a01, 0xd339, 0x2000 }, + { 0x1a01, 0xd338, 0x0000 }, + { 0x1a01, 0xd33a, 0x0000 }, + { 0x9a01, 0xd33d, 0x2000 }, + { 0x1a01, 0xd33c, 0x0000 }, + { 0x1a01, 0xd33e, 0x0000 }, + { 0x9a01, 0xd347, 0x4000 }, + { 0x9a01, 0xd343, 0x3000 }, + { 0x9a01, 0xd341, 0x2000 }, + { 0x1a01, 0xd340, 0x0000 }, + { 0x1a01, 0xd342, 0x0000 }, + { 0x9a01, 0xd345, 0x2000 }, + { 0x1a01, 0xd344, 0x0000 }, + { 0x1a01, 0xd346, 0x0000 }, + { 0x9a01, 0xd34b, 0x3000 }, + { 0x9a01, 0xd349, 0x2000 }, + { 0x1a01, 0xd348, 0x0000 }, + { 0x1a01, 0xd34a, 0x0000 }, + { 0x9a01, 0xd34d, 0x2000 }, + { 0x1a01, 0xd34c, 0x0000 }, + { 0x1a01, 0xd34e, 0x0000 }, + { 0x8901, 0xd408, 0x5000 }, + { 0x8901, 0xd400, 0x4000 }, + { 0x9a01, 0xd353, 0x3000 }, + { 0x9a01, 0xd351, 0x2000 }, + { 0x1a01, 0xd350, 0x0000 }, + { 0x1a01, 0xd352, 0x0000 }, + { 0x9a01, 0xd355, 0x2000 }, + { 0x1a01, 0xd354, 0x0000 }, + { 0x1a01, 0xd356, 0x0000 }, + { 0x8901, 0xd404, 0x3000 }, + { 0x8901, 0xd402, 0x2000 }, + { 0x0901, 0xd401, 0x0000 }, + { 0x0901, 0xd403, 0x0000 }, + { 0x8901, 0xd406, 0x2000 }, + { 0x0901, 0xd405, 0x0000 }, + { 0x0901, 0xd407, 0x0000 }, + { 0x8901, 0xd410, 0x4000 }, + { 0x8901, 0xd40c, 0x3000 }, + { 0x8901, 0xd40a, 0x2000 }, + { 0x0901, 0xd409, 0x0000 }, + { 0x0901, 0xd40b, 0x0000 }, + { 0x8901, 0xd40e, 0x2000 }, + { 0x0901, 0xd40d, 0x0000 }, + { 0x0901, 0xd40f, 0x0000 }, + { 0x8901, 0xd414, 0x3000 }, + { 0x8901, 0xd412, 0x2000 }, + { 0x0901, 0xd411, 0x0000 }, + { 0x0901, 0xd413, 0x0000 }, + { 0x8901, 0xd416, 0x2000 }, + { 0x0901, 0xd415, 0x0000 }, + { 0x0901, 0xd417, 0x0000 }, + { 0x8901, 0xd438, 0x6000 }, + { 0x8501, 0xd428, 0x5000 }, + { 0x8501, 0xd420, 0x4000 }, + { 0x8501, 0xd41c, 0x3000 }, + { 0x8501, 0xd41a, 0x2000 }, + { 0x0901, 0xd419, 0x0000 }, + { 0x0501, 0xd41b, 0x0000 }, + { 0x8501, 0xd41e, 0x2000 }, + { 0x0501, 0xd41d, 0x0000 }, + { 0x0501, 0xd41f, 0x0000 }, + { 0x8501, 0xd424, 0x3000 }, + { 0x8501, 0xd422, 0x2000 }, + { 0x0501, 0xd421, 0x0000 }, + { 0x0501, 0xd423, 0x0000 }, + { 0x8501, 0xd426, 0x2000 }, + { 0x0501, 0xd425, 0x0000 }, + { 0x0501, 0xd427, 0x0000 }, + { 0x8501, 0xd430, 0x4000 }, + { 0x8501, 0xd42c, 0x3000 }, + { 0x8501, 0xd42a, 0x2000 }, + { 0x0501, 0xd429, 0x0000 }, + { 0x0501, 0xd42b, 0x0000 }, + { 0x8501, 0xd42e, 0x2000 }, + { 0x0501, 0xd42d, 0x0000 }, + { 0x0501, 0xd42f, 0x0000 }, + { 0x8901, 0xd434, 0x3000 }, + { 0x8501, 0xd432, 0x2000 }, + { 0x0501, 0xd431, 0x0000 }, + { 0x0501, 0xd433, 0x0000 }, + { 0x8901, 0xd436, 0x2000 }, + { 0x0901, 0xd435, 0x0000 }, + { 0x0901, 0xd437, 0x0000 }, + { 0x8901, 0xd448, 0x5000 }, + { 0x8901, 0xd440, 0x4000 }, + { 0x8901, 0xd43c, 0x3000 }, + { 0x8901, 0xd43a, 0x2000 }, + { 0x0901, 0xd439, 0x0000 }, + { 0x0901, 0xd43b, 0x0000 }, + { 0x8901, 0xd43e, 0x2000 }, + { 0x0901, 0xd43d, 0x0000 }, + { 0x0901, 0xd43f, 0x0000 }, + { 0x8901, 0xd444, 0x3000 }, + { 0x8901, 0xd442, 0x2000 }, + { 0x0901, 0xd441, 0x0000 }, + { 0x0901, 0xd443, 0x0000 }, + { 0x8901, 0xd446, 0x2000 }, + { 0x0901, 0xd445, 0x0000 }, + { 0x0901, 0xd447, 0x0000 }, + { 0x8501, 0xd450, 0x4000 }, + { 0x8901, 0xd44c, 0x3000 }, + { 0x8901, 0xd44a, 0x2000 }, + { 0x0901, 0xd449, 0x0000 }, + { 0x0901, 0xd44b, 0x0000 }, + { 0x8501, 0xd44e, 0x2000 }, + { 0x0901, 0xd44d, 0x0000 }, + { 0x0501, 0xd44f, 0x0000 }, + { 0x8501, 0xd454, 0x3000 }, + { 0x8501, 0xd452, 0x2000 }, + { 0x0501, 0xd451, 0x0000 }, + { 0x0501, 0xd453, 0x0000 }, + { 0x8501, 0xd457, 0x2000 }, + { 0x0501, 0xd456, 0x0000 }, + { 0x0501, 0xd458, 0x0000 }, + { 0x8702, 0xf876, 0xb000 }, + { 0x8901, 0xd670, 0xa000 }, + { 0x8901, 0xd570, 0x9000 }, + { 0x8901, 0xd4e4, 0x8000 }, + { 0x8501, 0xd499, 0x7000 }, + { 0x8901, 0xd479, 0x6000 }, + { 0x8901, 0xd469, 0x5000 }, + { 0x8501, 0xd461, 0x4000 }, + { 0x8501, 0xd45d, 0x3000 }, + { 0x8501, 0xd45b, 0x2000 }, + { 0x0501, 0xd45a, 0x0000 }, + { 0x0501, 0xd45c, 0x0000 }, + { 0x8501, 0xd45f, 0x2000 }, + { 0x0501, 0xd45e, 0x0000 }, + { 0x0501, 0xd460, 0x0000 }, + { 0x8501, 0xd465, 0x3000 }, + { 0x8501, 0xd463, 0x2000 }, + { 0x0501, 0xd462, 0x0000 }, + { 0x0501, 0xd464, 0x0000 }, + { 0x8501, 0xd467, 0x2000 }, + { 0x0501, 0xd466, 0x0000 }, + { 0x0901, 0xd468, 0x0000 }, + { 0x8901, 0xd471, 0x4000 }, + { 0x8901, 0xd46d, 0x3000 }, + { 0x8901, 0xd46b, 0x2000 }, + { 0x0901, 0xd46a, 0x0000 }, + { 0x0901, 0xd46c, 0x0000 }, + { 0x8901, 0xd46f, 0x2000 }, + { 0x0901, 0xd46e, 0x0000 }, + { 0x0901, 0xd470, 0x0000 }, + { 0x8901, 0xd475, 0x3000 }, + { 0x8901, 0xd473, 0x2000 }, + { 0x0901, 0xd472, 0x0000 }, + { 0x0901, 0xd474, 0x0000 }, + { 0x8901, 0xd477, 0x2000 }, + { 0x0901, 0xd476, 0x0000 }, + { 0x0901, 0xd478, 0x0000 }, + { 0x8501, 0xd489, 0x5000 }, + { 0x8901, 0xd481, 0x4000 }, + { 0x8901, 0xd47d, 0x3000 }, + { 0x8901, 0xd47b, 0x2000 }, + { 0x0901, 0xd47a, 0x0000 }, + { 0x0901, 0xd47c, 0x0000 }, + { 0x8901, 0xd47f, 0x2000 }, + { 0x0901, 0xd47e, 0x0000 }, + { 0x0901, 0xd480, 0x0000 }, + { 0x8501, 0xd485, 0x3000 }, + { 0x8501, 0xd483, 0x2000 }, + { 0x0501, 0xd482, 0x0000 }, + { 0x0501, 0xd484, 0x0000 }, + { 0x8501, 0xd487, 0x2000 }, + { 0x0501, 0xd486, 0x0000 }, + { 0x0501, 0xd488, 0x0000 }, + { 0x8501, 0xd491, 0x4000 }, + { 0x8501, 0xd48d, 0x3000 }, + { 0x8501, 0xd48b, 0x2000 }, + { 0x0501, 0xd48a, 0x0000 }, + { 0x0501, 0xd48c, 0x0000 }, + { 0x8501, 0xd48f, 0x2000 }, + { 0x0501, 0xd48e, 0x0000 }, + { 0x0501, 0xd490, 0x0000 }, + { 0x8501, 0xd495, 0x3000 }, + { 0x8501, 0xd493, 0x2000 }, + { 0x0501, 0xd492, 0x0000 }, + { 0x0501, 0xd494, 0x0000 }, + { 0x8501, 0xd497, 0x2000 }, + { 0x0501, 0xd496, 0x0000 }, + { 0x0501, 0xd498, 0x0000 }, + { 0x8501, 0xd4c3, 0x6000 }, + { 0x8901, 0xd4b1, 0x5000 }, + { 0x8901, 0xd4a6, 0x4000 }, + { 0x8901, 0xd49e, 0x3000 }, + { 0x8501, 0xd49b, 0x2000 }, + { 0x0501, 0xd49a, 0x0000 }, + { 0x0901, 0xd49c, 0x0000 }, + { 0x8901, 0xd4a2, 0x2000 }, + { 0x0901, 0xd49f, 0x0000 }, + { 0x0901, 0xd4a5, 0x0000 }, + { 0x8901, 0xd4ac, 0x3000 }, + { 0x8901, 0xd4aa, 0x2000 }, + { 0x0901, 0xd4a9, 0x0000 }, + { 0x0901, 0xd4ab, 0x0000 }, + { 0x8901, 0xd4af, 0x2000 }, + { 0x0901, 0xd4ae, 0x0000 }, + { 0x0901, 0xd4b0, 0x0000 }, + { 0x8501, 0xd4b9, 0x4000 }, + { 0x8901, 0xd4b5, 0x3000 }, + { 0x8901, 0xd4b3, 0x2000 }, + { 0x0901, 0xd4b2, 0x0000 }, + { 0x0901, 0xd4b4, 0x0000 }, + { 0x8501, 0xd4b7, 0x2000 }, + { 0x0501, 0xd4b6, 0x0000 }, + { 0x0501, 0xd4b8, 0x0000 }, + { 0x8501, 0xd4bf, 0x3000 }, + { 0x8501, 0xd4bd, 0x2000 }, + { 0x0501, 0xd4bb, 0x0000 }, + { 0x0501, 0xd4be, 0x0000 }, + { 0x8501, 0xd4c1, 0x2000 }, + { 0x0501, 0xd4c0, 0x0000 }, + { 0x0501, 0xd4c2, 0x0000 }, + { 0x8901, 0xd4d4, 0x5000 }, + { 0x8501, 0xd4cc, 0x4000 }, + { 0x8501, 0xd4c8, 0x3000 }, + { 0x8501, 0xd4c6, 0x2000 }, + { 0x0501, 0xd4c5, 0x0000 }, + { 0x0501, 0xd4c7, 0x0000 }, + { 0x8501, 0xd4ca, 0x2000 }, + { 0x0501, 0xd4c9, 0x0000 }, + { 0x0501, 0xd4cb, 0x0000 }, + { 0x8901, 0xd4d0, 0x3000 }, + { 0x8501, 0xd4ce, 0x2000 }, + { 0x0501, 0xd4cd, 0x0000 }, + { 0x0501, 0xd4cf, 0x0000 }, + { 0x8901, 0xd4d2, 0x2000 }, + { 0x0901, 0xd4d1, 0x0000 }, + { 0x0901, 0xd4d3, 0x0000 }, + { 0x8901, 0xd4dc, 0x4000 }, + { 0x8901, 0xd4d8, 0x3000 }, + { 0x8901, 0xd4d6, 0x2000 }, + { 0x0901, 0xd4d5, 0x0000 }, + { 0x0901, 0xd4d7, 0x0000 }, + { 0x8901, 0xd4da, 0x2000 }, + { 0x0901, 0xd4d9, 0x0000 }, + { 0x0901, 0xd4db, 0x0000 }, + { 0x8901, 0xd4e0, 0x3000 }, + { 0x8901, 0xd4de, 0x2000 }, + { 0x0901, 0xd4dd, 0x0000 }, + { 0x0901, 0xd4df, 0x0000 }, + { 0x8901, 0xd4e2, 0x2000 }, + { 0x0901, 0xd4e1, 0x0000 }, + { 0x0901, 0xd4e3, 0x0000 }, + { 0x8501, 0xd529, 0x7000 }, + { 0x8901, 0xd504, 0x6000 }, + { 0x8501, 0xd4f4, 0x5000 }, + { 0x8501, 0xd4ec, 0x4000 }, + { 0x8901, 0xd4e8, 0x3000 }, + { 0x8901, 0xd4e6, 0x2000 }, + { 0x0901, 0xd4e5, 0x0000 }, + { 0x0901, 0xd4e7, 0x0000 }, + { 0x8501, 0xd4ea, 0x2000 }, + { 0x0901, 0xd4e9, 0x0000 }, + { 0x0501, 0xd4eb, 0x0000 }, + { 0x8501, 0xd4f0, 0x3000 }, + { 0x8501, 0xd4ee, 0x2000 }, + { 0x0501, 0xd4ed, 0x0000 }, + { 0x0501, 0xd4ef, 0x0000 }, + { 0x8501, 0xd4f2, 0x2000 }, + { 0x0501, 0xd4f1, 0x0000 }, + { 0x0501, 0xd4f3, 0x0000 }, + { 0x8501, 0xd4fc, 0x4000 }, + { 0x8501, 0xd4f8, 0x3000 }, + { 0x8501, 0xd4f6, 0x2000 }, + { 0x0501, 0xd4f5, 0x0000 }, + { 0x0501, 0xd4f7, 0x0000 }, + { 0x8501, 0xd4fa, 0x2000 }, + { 0x0501, 0xd4f9, 0x0000 }, + { 0x0501, 0xd4fb, 0x0000 }, + { 0x8501, 0xd500, 0x3000 }, + { 0x8501, 0xd4fe, 0x2000 }, + { 0x0501, 0xd4fd, 0x0000 }, + { 0x0501, 0xd4ff, 0x0000 }, + { 0x8501, 0xd502, 0x2000 }, + { 0x0501, 0xd501, 0x0000 }, + { 0x0501, 0xd503, 0x0000 }, + { 0x8901, 0xd518, 0x5000 }, + { 0x8901, 0xd50f, 0x4000 }, + { 0x8901, 0xd509, 0x3000 }, + { 0x8901, 0xd507, 0x2000 }, + { 0x0901, 0xd505, 0x0000 }, + { 0x0901, 0xd508, 0x0000 }, + { 0x8901, 0xd50d, 0x2000 }, + { 0x0901, 0xd50a, 0x0000 }, + { 0x0901, 0xd50e, 0x0000 }, + { 0x8901, 0xd513, 0x3000 }, + { 0x8901, 0xd511, 0x2000 }, + { 0x0901, 0xd510, 0x0000 }, + { 0x0901, 0xd512, 0x0000 }, + { 0x8901, 0xd516, 0x2000 }, + { 0x0901, 0xd514, 0x0000 }, + { 0x0901, 0xd517, 0x0000 }, + { 0x8501, 0xd521, 0x4000 }, + { 0x8901, 0xd51c, 0x3000 }, + { 0x8901, 0xd51a, 0x2000 }, + { 0x0901, 0xd519, 0x0000 }, + { 0x0901, 0xd51b, 0x0000 }, + { 0x8501, 0xd51f, 0x2000 }, + { 0x0501, 0xd51e, 0x0000 }, + { 0x0501, 0xd520, 0x0000 }, + { 0x8501, 0xd525, 0x3000 }, + { 0x8501, 0xd523, 0x2000 }, + { 0x0501, 0xd522, 0x0000 }, + { 0x0501, 0xd524, 0x0000 }, + { 0x8501, 0xd527, 0x2000 }, + { 0x0501, 0xd526, 0x0000 }, + { 0x0501, 0xd528, 0x0000 }, + { 0x8901, 0xd54f, 0x6000 }, + { 0x8901, 0xd539, 0x5000 }, + { 0x8501, 0xd531, 0x4000 }, + { 0x8501, 0xd52d, 0x3000 }, + { 0x8501, 0xd52b, 0x2000 }, + { 0x0501, 0xd52a, 0x0000 }, + { 0x0501, 0xd52c, 0x0000 }, + { 0x8501, 0xd52f, 0x2000 }, + { 0x0501, 0xd52e, 0x0000 }, + { 0x0501, 0xd530, 0x0000 }, + { 0x8501, 0xd535, 0x3000 }, + { 0x8501, 0xd533, 0x2000 }, + { 0x0501, 0xd532, 0x0000 }, + { 0x0501, 0xd534, 0x0000 }, + { 0x8501, 0xd537, 0x2000 }, + { 0x0501, 0xd536, 0x0000 }, + { 0x0901, 0xd538, 0x0000 }, + { 0x8901, 0xd543, 0x4000 }, + { 0x8901, 0xd53e, 0x3000 }, + { 0x8901, 0xd53c, 0x2000 }, + { 0x0901, 0xd53b, 0x0000 }, + { 0x0901, 0xd53d, 0x0000 }, + { 0x8901, 0xd541, 0x2000 }, + { 0x0901, 0xd540, 0x0000 }, + { 0x0901, 0xd542, 0x0000 }, + { 0x8901, 0xd54b, 0x3000 }, + { 0x8901, 0xd546, 0x2000 }, + { 0x0901, 0xd544, 0x0000 }, + { 0x0901, 0xd54a, 0x0000 }, + { 0x8901, 0xd54d, 0x2000 }, + { 0x0901, 0xd54c, 0x0000 }, + { 0x0901, 0xd54e, 0x0000 }, + { 0x8501, 0xd560, 0x5000 }, + { 0x8501, 0xd558, 0x4000 }, + { 0x8501, 0xd554, 0x3000 }, + { 0x8501, 0xd552, 0x2000 }, + { 0x0901, 0xd550, 0x0000 }, + { 0x0501, 0xd553, 0x0000 }, + { 0x8501, 0xd556, 0x2000 }, + { 0x0501, 0xd555, 0x0000 }, + { 0x0501, 0xd557, 0x0000 }, + { 0x8501, 0xd55c, 0x3000 }, + { 0x8501, 0xd55a, 0x2000 }, + { 0x0501, 0xd559, 0x0000 }, + { 0x0501, 0xd55b, 0x0000 }, + { 0x8501, 0xd55e, 0x2000 }, + { 0x0501, 0xd55d, 0x0000 }, + { 0x0501, 0xd55f, 0x0000 }, + { 0x8501, 0xd568, 0x4000 }, + { 0x8501, 0xd564, 0x3000 }, + { 0x8501, 0xd562, 0x2000 }, + { 0x0501, 0xd561, 0x0000 }, + { 0x0501, 0xd563, 0x0000 }, + { 0x8501, 0xd566, 0x2000 }, + { 0x0501, 0xd565, 0x0000 }, + { 0x0501, 0xd567, 0x0000 }, + { 0x8901, 0xd56c, 0x3000 }, + { 0x8501, 0xd56a, 0x2000 }, + { 0x0501, 0xd569, 0x0000 }, + { 0x0501, 0xd56b, 0x0000 }, + { 0x8901, 0xd56e, 0x2000 }, + { 0x0901, 0xd56d, 0x0000 }, + { 0x0901, 0xd56f, 0x0000 }, + { 0x8501, 0xd5f0, 0x8000 }, + { 0x8901, 0xd5b0, 0x7000 }, + { 0x8501, 0xd590, 0x6000 }, + { 0x8901, 0xd580, 0x5000 }, + { 0x8901, 0xd578, 0x4000 }, + { 0x8901, 0xd574, 0x3000 }, + { 0x8901, 0xd572, 0x2000 }, + { 0x0901, 0xd571, 0x0000 }, + { 0x0901, 0xd573, 0x0000 }, + { 0x8901, 0xd576, 0x2000 }, + { 0x0901, 0xd575, 0x0000 }, + { 0x0901, 0xd577, 0x0000 }, + { 0x8901, 0xd57c, 0x3000 }, + { 0x8901, 0xd57a, 0x2000 }, + { 0x0901, 0xd579, 0x0000 }, + { 0x0901, 0xd57b, 0x0000 }, + { 0x8901, 0xd57e, 0x2000 }, + { 0x0901, 0xd57d, 0x0000 }, + { 0x0901, 0xd57f, 0x0000 }, + { 0x8501, 0xd588, 0x4000 }, + { 0x8901, 0xd584, 0x3000 }, + { 0x8901, 0xd582, 0x2000 }, + { 0x0901, 0xd581, 0x0000 }, + { 0x0901, 0xd583, 0x0000 }, + { 0x8501, 0xd586, 0x2000 }, + { 0x0901, 0xd585, 0x0000 }, + { 0x0501, 0xd587, 0x0000 }, + { 0x8501, 0xd58c, 0x3000 }, + { 0x8501, 0xd58a, 0x2000 }, + { 0x0501, 0xd589, 0x0000 }, + { 0x0501, 0xd58b, 0x0000 }, + { 0x8501, 0xd58e, 0x2000 }, + { 0x0501, 0xd58d, 0x0000 }, + { 0x0501, 0xd58f, 0x0000 }, + { 0x8901, 0xd5a0, 0x5000 }, + { 0x8501, 0xd598, 0x4000 }, + { 0x8501, 0xd594, 0x3000 }, + { 0x8501, 0xd592, 0x2000 }, + { 0x0501, 0xd591, 0x0000 }, + { 0x0501, 0xd593, 0x0000 }, + { 0x8501, 0xd596, 0x2000 }, + { 0x0501, 0xd595, 0x0000 }, + { 0x0501, 0xd597, 0x0000 }, + { 0x8501, 0xd59c, 0x3000 }, + { 0x8501, 0xd59a, 0x2000 }, + { 0x0501, 0xd599, 0x0000 }, + { 0x0501, 0xd59b, 0x0000 }, + { 0x8501, 0xd59e, 0x2000 }, + { 0x0501, 0xd59d, 0x0000 }, + { 0x0501, 0xd59f, 0x0000 }, + { 0x8901, 0xd5a8, 0x4000 }, + { 0x8901, 0xd5a4, 0x3000 }, + { 0x8901, 0xd5a2, 0x2000 }, + { 0x0901, 0xd5a1, 0x0000 }, + { 0x0901, 0xd5a3, 0x0000 }, + { 0x8901, 0xd5a6, 0x2000 }, + { 0x0901, 0xd5a5, 0x0000 }, + { 0x0901, 0xd5a7, 0x0000 }, + { 0x8901, 0xd5ac, 0x3000 }, + { 0x8901, 0xd5aa, 0x2000 }, + { 0x0901, 0xd5a9, 0x0000 }, + { 0x0901, 0xd5ab, 0x0000 }, + { 0x8901, 0xd5ae, 0x2000 }, + { 0x0901, 0xd5ad, 0x0000 }, + { 0x0901, 0xd5af, 0x0000 }, + { 0x8501, 0xd5d0, 0x6000 }, + { 0x8501, 0xd5c0, 0x5000 }, + { 0x8901, 0xd5b8, 0x4000 }, + { 0x8901, 0xd5b4, 0x3000 }, + { 0x8901, 0xd5b2, 0x2000 }, + { 0x0901, 0xd5b1, 0x0000 }, + { 0x0901, 0xd5b3, 0x0000 }, + { 0x8901, 0xd5b6, 0x2000 }, + { 0x0901, 0xd5b5, 0x0000 }, + { 0x0901, 0xd5b7, 0x0000 }, + { 0x8501, 0xd5bc, 0x3000 }, + { 0x8501, 0xd5ba, 0x2000 }, + { 0x0901, 0xd5b9, 0x0000 }, + { 0x0501, 0xd5bb, 0x0000 }, + { 0x8501, 0xd5be, 0x2000 }, + { 0x0501, 0xd5bd, 0x0000 }, + { 0x0501, 0xd5bf, 0x0000 }, + { 0x8501, 0xd5c8, 0x4000 }, + { 0x8501, 0xd5c4, 0x3000 }, + { 0x8501, 0xd5c2, 0x2000 }, + { 0x0501, 0xd5c1, 0x0000 }, + { 0x0501, 0xd5c3, 0x0000 }, + { 0x8501, 0xd5c6, 0x2000 }, + { 0x0501, 0xd5c5, 0x0000 }, + { 0x0501, 0xd5c7, 0x0000 }, + { 0x8501, 0xd5cc, 0x3000 }, + { 0x8501, 0xd5ca, 0x2000 }, + { 0x0501, 0xd5c9, 0x0000 }, + { 0x0501, 0xd5cb, 0x0000 }, + { 0x8501, 0xd5ce, 0x2000 }, + { 0x0501, 0xd5cd, 0x0000 }, + { 0x0501, 0xd5cf, 0x0000 }, + { 0x8901, 0xd5e0, 0x5000 }, + { 0x8901, 0xd5d8, 0x4000 }, + { 0x8901, 0xd5d4, 0x3000 }, + { 0x8501, 0xd5d2, 0x2000 }, + { 0x0501, 0xd5d1, 0x0000 }, + { 0x0501, 0xd5d3, 0x0000 }, + { 0x8901, 0xd5d6, 0x2000 }, + { 0x0901, 0xd5d5, 0x0000 }, + { 0x0901, 0xd5d7, 0x0000 }, + { 0x8901, 0xd5dc, 0x3000 }, + { 0x8901, 0xd5da, 0x2000 }, + { 0x0901, 0xd5d9, 0x0000 }, + { 0x0901, 0xd5db, 0x0000 }, + { 0x8901, 0xd5de, 0x2000 }, + { 0x0901, 0xd5dd, 0x0000 }, + { 0x0901, 0xd5df, 0x0000 }, + { 0x8901, 0xd5e8, 0x4000 }, + { 0x8901, 0xd5e4, 0x3000 }, + { 0x8901, 0xd5e2, 0x2000 }, + { 0x0901, 0xd5e1, 0x0000 }, + { 0x0901, 0xd5e3, 0x0000 }, + { 0x8901, 0xd5e6, 0x2000 }, + { 0x0901, 0xd5e5, 0x0000 }, + { 0x0901, 0xd5e7, 0x0000 }, + { 0x8901, 0xd5ec, 0x3000 }, + { 0x8901, 0xd5ea, 0x2000 }, + { 0x0901, 0xd5e9, 0x0000 }, + { 0x0901, 0xd5eb, 0x0000 }, + { 0x8501, 0xd5ee, 0x2000 }, + { 0x0901, 0xd5ed, 0x0000 }, + { 0x0501, 0xd5ef, 0x0000 }, + { 0x8501, 0xd630, 0x7000 }, + { 0x8901, 0xd610, 0x6000 }, + { 0x8501, 0xd600, 0x5000 }, + { 0x8501, 0xd5f8, 0x4000 }, + { 0x8501, 0xd5f4, 0x3000 }, + { 0x8501, 0xd5f2, 0x2000 }, + { 0x0501, 0xd5f1, 0x0000 }, + { 0x0501, 0xd5f3, 0x0000 }, + { 0x8501, 0xd5f6, 0x2000 }, + { 0x0501, 0xd5f5, 0x0000 }, + { 0x0501, 0xd5f7, 0x0000 }, + { 0x8501, 0xd5fc, 0x3000 }, + { 0x8501, 0xd5fa, 0x2000 }, + { 0x0501, 0xd5f9, 0x0000 }, + { 0x0501, 0xd5fb, 0x0000 }, + { 0x8501, 0xd5fe, 0x2000 }, + { 0x0501, 0xd5fd, 0x0000 }, + { 0x0501, 0xd5ff, 0x0000 }, + { 0x8901, 0xd608, 0x4000 }, + { 0x8501, 0xd604, 0x3000 }, + { 0x8501, 0xd602, 0x2000 }, + { 0x0501, 0xd601, 0x0000 }, + { 0x0501, 0xd603, 0x0000 }, + { 0x8501, 0xd606, 0x2000 }, + { 0x0501, 0xd605, 0x0000 }, + { 0x0501, 0xd607, 0x0000 }, + { 0x8901, 0xd60c, 0x3000 }, + { 0x8901, 0xd60a, 0x2000 }, + { 0x0901, 0xd609, 0x0000 }, + { 0x0901, 0xd60b, 0x0000 }, + { 0x8901, 0xd60e, 0x2000 }, + { 0x0901, 0xd60d, 0x0000 }, + { 0x0901, 0xd60f, 0x0000 }, + { 0x8901, 0xd620, 0x5000 }, + { 0x8901, 0xd618, 0x4000 }, + { 0x8901, 0xd614, 0x3000 }, + { 0x8901, 0xd612, 0x2000 }, + { 0x0901, 0xd611, 0x0000 }, + { 0x0901, 0xd613, 0x0000 }, + { 0x8901, 0xd616, 0x2000 }, + { 0x0901, 0xd615, 0x0000 }, + { 0x0901, 0xd617, 0x0000 }, + { 0x8901, 0xd61c, 0x3000 }, + { 0x8901, 0xd61a, 0x2000 }, + { 0x0901, 0xd619, 0x0000 }, + { 0x0901, 0xd61b, 0x0000 }, + { 0x8901, 0xd61e, 0x2000 }, + { 0x0901, 0xd61d, 0x0000 }, + { 0x0901, 0xd61f, 0x0000 }, + { 0x8501, 0xd628, 0x4000 }, + { 0x8501, 0xd624, 0x3000 }, + { 0x8501, 0xd622, 0x2000 }, + { 0x0901, 0xd621, 0x0000 }, + { 0x0501, 0xd623, 0x0000 }, + { 0x8501, 0xd626, 0x2000 }, + { 0x0501, 0xd625, 0x0000 }, + { 0x0501, 0xd627, 0x0000 }, + { 0x8501, 0xd62c, 0x3000 }, + { 0x8501, 0xd62a, 0x2000 }, + { 0x0501, 0xd629, 0x0000 }, + { 0x0501, 0xd62b, 0x0000 }, + { 0x8501, 0xd62e, 0x2000 }, + { 0x0501, 0xd62d, 0x0000 }, + { 0x0501, 0xd62f, 0x0000 }, + { 0x8901, 0xd650, 0x6000 }, + { 0x8901, 0xd640, 0x5000 }, + { 0x8501, 0xd638, 0x4000 }, + { 0x8501, 0xd634, 0x3000 }, + { 0x8501, 0xd632, 0x2000 }, + { 0x0501, 0xd631, 0x0000 }, + { 0x0501, 0xd633, 0x0000 }, + { 0x8501, 0xd636, 0x2000 }, + { 0x0501, 0xd635, 0x0000 }, + { 0x0501, 0xd637, 0x0000 }, + { 0x8901, 0xd63c, 0x3000 }, + { 0x8501, 0xd63a, 0x2000 }, + { 0x0501, 0xd639, 0x0000 }, + { 0x0501, 0xd63b, 0x0000 }, + { 0x8901, 0xd63e, 0x2000 }, + { 0x0901, 0xd63d, 0x0000 }, + { 0x0901, 0xd63f, 0x0000 }, + { 0x8901, 0xd648, 0x4000 }, + { 0x8901, 0xd644, 0x3000 }, + { 0x8901, 0xd642, 0x2000 }, + { 0x0901, 0xd641, 0x0000 }, + { 0x0901, 0xd643, 0x0000 }, + { 0x8901, 0xd646, 0x2000 }, + { 0x0901, 0xd645, 0x0000 }, + { 0x0901, 0xd647, 0x0000 }, + { 0x8901, 0xd64c, 0x3000 }, + { 0x8901, 0xd64a, 0x2000 }, + { 0x0901, 0xd649, 0x0000 }, + { 0x0901, 0xd64b, 0x0000 }, + { 0x8901, 0xd64e, 0x2000 }, + { 0x0901, 0xd64d, 0x0000 }, + { 0x0901, 0xd64f, 0x0000 }, + { 0x8501, 0xd660, 0x5000 }, + { 0x8501, 0xd658, 0x4000 }, + { 0x8901, 0xd654, 0x3000 }, + { 0x8901, 0xd652, 0x2000 }, + { 0x0901, 0xd651, 0x0000 }, + { 0x0901, 0xd653, 0x0000 }, + { 0x8501, 0xd656, 0x2000 }, + { 0x0901, 0xd655, 0x0000 }, + { 0x0501, 0xd657, 0x0000 }, + { 0x8501, 0xd65c, 0x3000 }, + { 0x8501, 0xd65a, 0x2000 }, + { 0x0501, 0xd659, 0x0000 }, + { 0x0501, 0xd65b, 0x0000 }, + { 0x8501, 0xd65e, 0x2000 }, + { 0x0501, 0xd65d, 0x0000 }, + { 0x0501, 0xd65f, 0x0000 }, + { 0x8501, 0xd668, 0x4000 }, + { 0x8501, 0xd664, 0x3000 }, + { 0x8501, 0xd662, 0x2000 }, + { 0x0501, 0xd661, 0x0000 }, + { 0x0501, 0xd663, 0x0000 }, + { 0x8501, 0xd666, 0x2000 }, + { 0x0501, 0xd665, 0x0000 }, + { 0x0501, 0xd667, 0x0000 }, + { 0x8501, 0xd66c, 0x3000 }, + { 0x8501, 0xd66a, 0x2000 }, + { 0x0501, 0xd669, 0x0000 }, + { 0x0501, 0xd66b, 0x0000 }, + { 0x8501, 0xd66e, 0x2000 }, + { 0x0501, 0xd66d, 0x0000 }, + { 0x0501, 0xd66f, 0x0000 }, + { 0x8501, 0xd774, 0x9000 }, + { 0x8901, 0xd6f4, 0x8000 }, + { 0x8901, 0xd6b4, 0x7000 }, + { 0x8501, 0xd690, 0x6000 }, + { 0x8901, 0xd680, 0x5000 }, + { 0x8901, 0xd678, 0x4000 }, + { 0x8901, 0xd674, 0x3000 }, + { 0x8901, 0xd672, 0x2000 }, + { 0x0901, 0xd671, 0x0000 }, + { 0x0901, 0xd673, 0x0000 }, + { 0x8901, 0xd676, 0x2000 }, + { 0x0901, 0xd675, 0x0000 }, + { 0x0901, 0xd677, 0x0000 }, + { 0x8901, 0xd67c, 0x3000 }, + { 0x8901, 0xd67a, 0x2000 }, + { 0x0901, 0xd679, 0x0000 }, + { 0x0901, 0xd67b, 0x0000 }, + { 0x8901, 0xd67e, 0x2000 }, + { 0x0901, 0xd67d, 0x0000 }, + { 0x0901, 0xd67f, 0x0000 }, + { 0x8901, 0xd688, 0x4000 }, + { 0x8901, 0xd684, 0x3000 }, + { 0x8901, 0xd682, 0x2000 }, + { 0x0901, 0xd681, 0x0000 }, + { 0x0901, 0xd683, 0x0000 }, + { 0x8901, 0xd686, 0x2000 }, + { 0x0901, 0xd685, 0x0000 }, + { 0x0901, 0xd687, 0x0000 }, + { 0x8501, 0xd68c, 0x3000 }, + { 0x8501, 0xd68a, 0x2000 }, + { 0x0901, 0xd689, 0x0000 }, + { 0x0501, 0xd68b, 0x0000 }, + { 0x8501, 0xd68e, 0x2000 }, + { 0x0501, 0xd68d, 0x0000 }, + { 0x0501, 0xd68f, 0x0000 }, + { 0x8501, 0xd6a0, 0x5000 }, + { 0x8501, 0xd698, 0x4000 }, + { 0x8501, 0xd694, 0x3000 }, + { 0x8501, 0xd692, 0x2000 }, + { 0x0501, 0xd691, 0x0000 }, + { 0x0501, 0xd693, 0x0000 }, + { 0x8501, 0xd696, 0x2000 }, + { 0x0501, 0xd695, 0x0000 }, + { 0x0501, 0xd697, 0x0000 }, + { 0x8501, 0xd69c, 0x3000 }, + { 0x8501, 0xd69a, 0x2000 }, + { 0x0501, 0xd699, 0x0000 }, + { 0x0501, 0xd69b, 0x0000 }, + { 0x8501, 0xd69e, 0x2000 }, + { 0x0501, 0xd69d, 0x0000 }, + { 0x0501, 0xd69f, 0x0000 }, + { 0x8901, 0xd6ac, 0x4000 }, + { 0x8901, 0xd6a8, 0x3000 }, + { 0x8501, 0xd6a2, 0x2000 }, + { 0x0501, 0xd6a1, 0x0000 }, + { 0x0501, 0xd6a3, 0x0000 }, + { 0x8901, 0xd6aa, 0x2000 }, + { 0x0901, 0xd6a9, 0x0000 }, + { 0x0901, 0xd6ab, 0x0000 }, + { 0x8901, 0xd6b0, 0x3000 }, + { 0x8901, 0xd6ae, 0x2000 }, + { 0x0901, 0xd6ad, 0x0000 }, + { 0x0901, 0xd6af, 0x0000 }, + { 0x8901, 0xd6b2, 0x2000 }, + { 0x0901, 0xd6b1, 0x0000 }, + { 0x0901, 0xd6b3, 0x0000 }, + { 0x8501, 0xd6d4, 0x6000 }, + { 0x8501, 0xd6c4, 0x5000 }, + { 0x8901, 0xd6bc, 0x4000 }, + { 0x8901, 0xd6b8, 0x3000 }, + { 0x8901, 0xd6b6, 0x2000 }, + { 0x0901, 0xd6b5, 0x0000 }, + { 0x0901, 0xd6b7, 0x0000 }, + { 0x8901, 0xd6ba, 0x2000 }, + { 0x0901, 0xd6b9, 0x0000 }, + { 0x0901, 0xd6bb, 0x0000 }, + { 0x8901, 0xd6c0, 0x3000 }, + { 0x8901, 0xd6be, 0x2000 }, + { 0x0901, 0xd6bd, 0x0000 }, + { 0x0901, 0xd6bf, 0x0000 }, + { 0x8501, 0xd6c2, 0x2000 }, + { 0x1901, 0xd6c1, 0x0000 }, + { 0x0501, 0xd6c3, 0x0000 }, + { 0x8501, 0xd6cc, 0x4000 }, + { 0x8501, 0xd6c8, 0x3000 }, + { 0x8501, 0xd6c6, 0x2000 }, + { 0x0501, 0xd6c5, 0x0000 }, + { 0x0501, 0xd6c7, 0x0000 }, + { 0x8501, 0xd6ca, 0x2000 }, + { 0x0501, 0xd6c9, 0x0000 }, + { 0x0501, 0xd6cb, 0x0000 }, + { 0x8501, 0xd6d0, 0x3000 }, + { 0x8501, 0xd6ce, 0x2000 }, + { 0x0501, 0xd6cd, 0x0000 }, + { 0x0501, 0xd6cf, 0x0000 }, + { 0x8501, 0xd6d2, 0x2000 }, + { 0x0501, 0xd6d1, 0x0000 }, + { 0x0501, 0xd6d3, 0x0000 }, + { 0x8901, 0xd6e4, 0x5000 }, + { 0x8501, 0xd6dc, 0x4000 }, + { 0x8501, 0xd6d8, 0x3000 }, + { 0x8501, 0xd6d6, 0x2000 }, + { 0x0501, 0xd6d5, 0x0000 }, + { 0x0501, 0xd6d7, 0x0000 }, + { 0x8501, 0xd6da, 0x2000 }, + { 0x0501, 0xd6d9, 0x0000 }, + { 0x1901, 0xd6db, 0x0000 }, + { 0x8501, 0xd6e0, 0x3000 }, + { 0x8501, 0xd6de, 0x2000 }, + { 0x0501, 0xd6dd, 0x0000 }, + { 0x0501, 0xd6df, 0x0000 }, + { 0x8901, 0xd6e2, 0x2000 }, + { 0x0501, 0xd6e1, 0x0000 }, + { 0x0901, 0xd6e3, 0x0000 }, + { 0x8901, 0xd6ec, 0x4000 }, + { 0x8901, 0xd6e8, 0x3000 }, + { 0x8901, 0xd6e6, 0x2000 }, + { 0x0901, 0xd6e5, 0x0000 }, + { 0x0901, 0xd6e7, 0x0000 }, + { 0x8901, 0xd6ea, 0x2000 }, + { 0x0901, 0xd6e9, 0x0000 }, + { 0x0901, 0xd6eb, 0x0000 }, + { 0x8901, 0xd6f0, 0x3000 }, + { 0x8901, 0xd6ee, 0x2000 }, + { 0x0901, 0xd6ed, 0x0000 }, + { 0x0901, 0xd6ef, 0x0000 }, + { 0x8901, 0xd6f2, 0x2000 }, + { 0x0901, 0xd6f1, 0x0000 }, + { 0x0901, 0xd6f3, 0x0000 }, + { 0x8901, 0xd734, 0x7000 }, + { 0x8501, 0xd714, 0x6000 }, + { 0x8501, 0xd704, 0x5000 }, + { 0x8501, 0xd6fc, 0x4000 }, + { 0x8901, 0xd6f8, 0x3000 }, + { 0x8901, 0xd6f6, 0x2000 }, + { 0x0901, 0xd6f5, 0x0000 }, + { 0x0901, 0xd6f7, 0x0000 }, + { 0x8901, 0xd6fa, 0x2000 }, + { 0x0901, 0xd6f9, 0x0000 }, + { 0x1901, 0xd6fb, 0x0000 }, + { 0x8501, 0xd700, 0x3000 }, + { 0x8501, 0xd6fe, 0x2000 }, + { 0x0501, 0xd6fd, 0x0000 }, + { 0x0501, 0xd6ff, 0x0000 }, + { 0x8501, 0xd702, 0x2000 }, + { 0x0501, 0xd701, 0x0000 }, + { 0x0501, 0xd703, 0x0000 }, + { 0x8501, 0xd70c, 0x4000 }, + { 0x8501, 0xd708, 0x3000 }, + { 0x8501, 0xd706, 0x2000 }, + { 0x0501, 0xd705, 0x0000 }, + { 0x0501, 0xd707, 0x0000 }, + { 0x8501, 0xd70a, 0x2000 }, + { 0x0501, 0xd709, 0x0000 }, + { 0x0501, 0xd70b, 0x0000 }, + { 0x8501, 0xd710, 0x3000 }, + { 0x8501, 0xd70e, 0x2000 }, + { 0x0501, 0xd70d, 0x0000 }, + { 0x0501, 0xd70f, 0x0000 }, + { 0x8501, 0xd712, 0x2000 }, + { 0x0501, 0xd711, 0x0000 }, + { 0x0501, 0xd713, 0x0000 }, + { 0x8901, 0xd724, 0x5000 }, + { 0x8901, 0xd71c, 0x4000 }, + { 0x8501, 0xd718, 0x3000 }, + { 0x8501, 0xd716, 0x2000 }, + { 0x1901, 0xd715, 0x0000 }, + { 0x0501, 0xd717, 0x0000 }, + { 0x8501, 0xd71a, 0x2000 }, + { 0x0501, 0xd719, 0x0000 }, + { 0x0501, 0xd71b, 0x0000 }, + { 0x8901, 0xd720, 0x3000 }, + { 0x8901, 0xd71e, 0x2000 }, + { 0x0901, 0xd71d, 0x0000 }, + { 0x0901, 0xd71f, 0x0000 }, + { 0x8901, 0xd722, 0x2000 }, + { 0x0901, 0xd721, 0x0000 }, + { 0x0901, 0xd723, 0x0000 }, + { 0x8901, 0xd72c, 0x4000 }, + { 0x8901, 0xd728, 0x3000 }, + { 0x8901, 0xd726, 0x2000 }, + { 0x0901, 0xd725, 0x0000 }, + { 0x0901, 0xd727, 0x0000 }, + { 0x8901, 0xd72a, 0x2000 }, + { 0x0901, 0xd729, 0x0000 }, + { 0x0901, 0xd72b, 0x0000 }, + { 0x8901, 0xd730, 0x3000 }, + { 0x8901, 0xd72e, 0x2000 }, + { 0x0901, 0xd72d, 0x0000 }, + { 0x0901, 0xd72f, 0x0000 }, + { 0x8901, 0xd732, 0x2000 }, + { 0x0901, 0xd731, 0x0000 }, + { 0x0901, 0xd733, 0x0000 }, + { 0x8501, 0xd754, 0x6000 }, + { 0x8501, 0xd744, 0x5000 }, + { 0x8501, 0xd73c, 0x4000 }, + { 0x8501, 0xd738, 0x3000 }, + { 0x8501, 0xd736, 0x2000 }, + { 0x1901, 0xd735, 0x0000 }, + { 0x0501, 0xd737, 0x0000 }, + { 0x8501, 0xd73a, 0x2000 }, + { 0x0501, 0xd739, 0x0000 }, + { 0x0501, 0xd73b, 0x0000 }, + { 0x8501, 0xd740, 0x3000 }, + { 0x8501, 0xd73e, 0x2000 }, + { 0x0501, 0xd73d, 0x0000 }, + { 0x0501, 0xd73f, 0x0000 }, + { 0x8501, 0xd742, 0x2000 }, + { 0x0501, 0xd741, 0x0000 }, + { 0x0501, 0xd743, 0x0000 }, + { 0x8501, 0xd74c, 0x4000 }, + { 0x8501, 0xd748, 0x3000 }, + { 0x8501, 0xd746, 0x2000 }, + { 0x0501, 0xd745, 0x0000 }, + { 0x0501, 0xd747, 0x0000 }, + { 0x8501, 0xd74a, 0x2000 }, + { 0x0501, 0xd749, 0x0000 }, + { 0x0501, 0xd74b, 0x0000 }, + { 0x8501, 0xd750, 0x3000 }, + { 0x8501, 0xd74e, 0x2000 }, + { 0x0501, 0xd74d, 0x0000 }, + { 0x1901, 0xd74f, 0x0000 }, + { 0x8501, 0xd752, 0x2000 }, + { 0x0501, 0xd751, 0x0000 }, + { 0x0501, 0xd753, 0x0000 }, + { 0x8901, 0xd764, 0x5000 }, + { 0x8901, 0xd75c, 0x4000 }, + { 0x8901, 0xd758, 0x3000 }, + { 0x8901, 0xd756, 0x2000 }, + { 0x0501, 0xd755, 0x0000 }, + { 0x0901, 0xd757, 0x0000 }, + { 0x8901, 0xd75a, 0x2000 }, + { 0x0901, 0xd759, 0x0000 }, + { 0x0901, 0xd75b, 0x0000 }, + { 0x8901, 0xd760, 0x3000 }, + { 0x8901, 0xd75e, 0x2000 }, + { 0x0901, 0xd75d, 0x0000 }, + { 0x0901, 0xd75f, 0x0000 }, + { 0x8901, 0xd762, 0x2000 }, + { 0x0901, 0xd761, 0x0000 }, + { 0x0901, 0xd763, 0x0000 }, + { 0x8901, 0xd76c, 0x4000 }, + { 0x8901, 0xd768, 0x3000 }, + { 0x8901, 0xd766, 0x2000 }, + { 0x0901, 0xd765, 0x0000 }, + { 0x0901, 0xd767, 0x0000 }, + { 0x8901, 0xd76a, 0x2000 }, + { 0x0901, 0xd769, 0x0000 }, + { 0x0901, 0xd76b, 0x0000 }, + { 0x8501, 0xd770, 0x3000 }, + { 0x8901, 0xd76e, 0x2000 }, + { 0x0901, 0xd76d, 0x0000 }, + { 0x1901, 0xd76f, 0x0000 }, + { 0x8501, 0xd772, 0x2000 }, + { 0x0501, 0xd771, 0x0000 }, + { 0x0501, 0xd773, 0x0000 }, + { 0x8d01, 0xd7f8, 0x8000 }, + { 0x8501, 0xd7b4, 0x7000 }, + { 0x8901, 0xd794, 0x6000 }, + { 0x8501, 0xd784, 0x5000 }, + { 0x8501, 0xd77c, 0x4000 }, + { 0x8501, 0xd778, 0x3000 }, + { 0x8501, 0xd776, 0x2000 }, + { 0x0501, 0xd775, 0x0000 }, + { 0x0501, 0xd777, 0x0000 }, + { 0x8501, 0xd77a, 0x2000 }, + { 0x0501, 0xd779, 0x0000 }, + { 0x0501, 0xd77b, 0x0000 }, + { 0x8501, 0xd780, 0x3000 }, + { 0x8501, 0xd77e, 0x2000 }, + { 0x0501, 0xd77d, 0x0000 }, + { 0x0501, 0xd77f, 0x0000 }, + { 0x8501, 0xd782, 0x2000 }, + { 0x0501, 0xd781, 0x0000 }, + { 0x0501, 0xd783, 0x0000 }, + { 0x8501, 0xd78c, 0x4000 }, + { 0x8501, 0xd788, 0x3000 }, + { 0x8501, 0xd786, 0x2000 }, + { 0x0501, 0xd785, 0x0000 }, + { 0x0501, 0xd787, 0x0000 }, + { 0x8501, 0xd78a, 0x2000 }, + { 0x1901, 0xd789, 0x0000 }, + { 0x0501, 0xd78b, 0x0000 }, + { 0x8901, 0xd790, 0x3000 }, + { 0x8501, 0xd78e, 0x2000 }, + { 0x0501, 0xd78d, 0x0000 }, + { 0x0501, 0xd78f, 0x0000 }, + { 0x8901, 0xd792, 0x2000 }, + { 0x0901, 0xd791, 0x0000 }, + { 0x0901, 0xd793, 0x0000 }, + { 0x8901, 0xd7a4, 0x5000 }, + { 0x8901, 0xd79c, 0x4000 }, + { 0x8901, 0xd798, 0x3000 }, + { 0x8901, 0xd796, 0x2000 }, + { 0x0901, 0xd795, 0x0000 }, + { 0x0901, 0xd797, 0x0000 }, + { 0x8901, 0xd79a, 0x2000 }, + { 0x0901, 0xd799, 0x0000 }, + { 0x0901, 0xd79b, 0x0000 }, + { 0x8901, 0xd7a0, 0x3000 }, + { 0x8901, 0xd79e, 0x2000 }, + { 0x0901, 0xd79d, 0x0000 }, + { 0x0901, 0xd79f, 0x0000 }, + { 0x8901, 0xd7a2, 0x2000 }, + { 0x0901, 0xd7a1, 0x0000 }, + { 0x0901, 0xd7a3, 0x0000 }, + { 0x8501, 0xd7ac, 0x4000 }, + { 0x8901, 0xd7a8, 0x3000 }, + { 0x8901, 0xd7a6, 0x2000 }, + { 0x0901, 0xd7a5, 0x0000 }, + { 0x0901, 0xd7a7, 0x0000 }, + { 0x8501, 0xd7aa, 0x2000 }, + { 0x1901, 0xd7a9, 0x0000 }, + { 0x0501, 0xd7ab, 0x0000 }, + { 0x8501, 0xd7b0, 0x3000 }, + { 0x8501, 0xd7ae, 0x2000 }, + { 0x0501, 0xd7ad, 0x0000 }, + { 0x0501, 0xd7af, 0x0000 }, + { 0x8501, 0xd7b2, 0x2000 }, + { 0x0501, 0xd7b1, 0x0000 }, + { 0x0501, 0xd7b3, 0x0000 }, + { 0x8d01, 0xd7d8, 0x6000 }, + { 0x8501, 0xd7c4, 0x5000 }, + { 0x8501, 0xd7bc, 0x4000 }, + { 0x8501, 0xd7b8, 0x3000 }, + { 0x8501, 0xd7b6, 0x2000 }, + { 0x0501, 0xd7b5, 0x0000 }, + { 0x0501, 0xd7b7, 0x0000 }, + { 0x8501, 0xd7ba, 0x2000 }, + { 0x0501, 0xd7b9, 0x0000 }, + { 0x0501, 0xd7bb, 0x0000 }, + { 0x8501, 0xd7c0, 0x3000 }, + { 0x8501, 0xd7be, 0x2000 }, + { 0x0501, 0xd7bd, 0x0000 }, + { 0x0501, 0xd7bf, 0x0000 }, + { 0x8501, 0xd7c2, 0x2000 }, + { 0x0501, 0xd7c1, 0x0000 }, + { 0x1901, 0xd7c3, 0x0000 }, + { 0x8d01, 0xd7d0, 0x4000 }, + { 0x8501, 0xd7c8, 0x3000 }, + { 0x8501, 0xd7c6, 0x2000 }, + { 0x0501, 0xd7c5, 0x0000 }, + { 0x0501, 0xd7c7, 0x0000 }, + { 0x8d01, 0xd7ce, 0x2000 }, + { 0x0501, 0xd7c9, 0x0000 }, + { 0x0d01, 0xd7cf, 0x0000 }, + { 0x8d01, 0xd7d4, 0x3000 }, + { 0x8d01, 0xd7d2, 0x2000 }, + { 0x0d01, 0xd7d1, 0x0000 }, + { 0x0d01, 0xd7d3, 0x0000 }, + { 0x8d01, 0xd7d6, 0x2000 }, + { 0x0d01, 0xd7d5, 0x0000 }, + { 0x0d01, 0xd7d7, 0x0000 }, + { 0x8d01, 0xd7e8, 0x5000 }, + { 0x8d01, 0xd7e0, 0x4000 }, + { 0x8d01, 0xd7dc, 0x3000 }, + { 0x8d01, 0xd7da, 0x2000 }, + { 0x0d01, 0xd7d9, 0x0000 }, + { 0x0d01, 0xd7db, 0x0000 }, + { 0x8d01, 0xd7de, 0x2000 }, + { 0x0d01, 0xd7dd, 0x0000 }, + { 0x0d01, 0xd7df, 0x0000 }, + { 0x8d01, 0xd7e4, 0x3000 }, + { 0x8d01, 0xd7e2, 0x2000 }, + { 0x0d01, 0xd7e1, 0x0000 }, + { 0x0d01, 0xd7e3, 0x0000 }, + { 0x8d01, 0xd7e6, 0x2000 }, + { 0x0d01, 0xd7e5, 0x0000 }, + { 0x0d01, 0xd7e7, 0x0000 }, + { 0x8d01, 0xd7f0, 0x4000 }, + { 0x8d01, 0xd7ec, 0x3000 }, + { 0x8d01, 0xd7ea, 0x2000 }, + { 0x0d01, 0xd7e9, 0x0000 }, + { 0x0d01, 0xd7eb, 0x0000 }, + { 0x8d01, 0xd7ee, 0x2000 }, + { 0x0d01, 0xd7ed, 0x0000 }, + { 0x0d01, 0xd7ef, 0x0000 }, + { 0x8d01, 0xd7f4, 0x3000 }, + { 0x8d01, 0xd7f2, 0x2000 }, + { 0x0d01, 0xd7f1, 0x0000 }, + { 0x0d01, 0xd7f3, 0x0000 }, + { 0x8d01, 0xd7f6, 0x2000 }, + { 0x0d01, 0xd7f5, 0x0000 }, + { 0x0d01, 0xd7f7, 0x0000 }, + { 0x8702, 0xf836, 0x7000 }, + { 0x8702, 0xf816, 0x6000 }, + { 0x8702, 0xf806, 0x5000 }, + { 0x8702, 0x0000, 0x4000 }, + { 0x8d01, 0xd7fc, 0x3000 }, + { 0x8d01, 0xd7fa, 0x2000 }, + { 0x0d01, 0xd7f9, 0x0000 }, + { 0x0d01, 0xd7fb, 0x0000 }, + { 0x8d01, 0xd7fe, 0x2000 }, + { 0x0d01, 0xd7fd, 0x0000 }, + { 0x0d01, 0xd7ff, 0x0000 }, + { 0x8702, 0xf802, 0x3000 }, + { 0x8702, 0xf800, 0x2000 }, + { 0x0702, 0xa6d6, 0x0000 }, + { 0x0702, 0xf801, 0x0000 }, + { 0x8702, 0xf804, 0x2000 }, + { 0x0702, 0xf803, 0x0000 }, + { 0x0702, 0xf805, 0x0000 }, + { 0x8702, 0xf80e, 0x4000 }, + { 0x8702, 0xf80a, 0x3000 }, + { 0x8702, 0xf808, 0x2000 }, + { 0x0702, 0xf807, 0x0000 }, + { 0x0702, 0xf809, 0x0000 }, + { 0x8702, 0xf80c, 0x2000 }, + { 0x0702, 0xf80b, 0x0000 }, + { 0x0702, 0xf80d, 0x0000 }, + { 0x8702, 0xf812, 0x3000 }, + { 0x8702, 0xf810, 0x2000 }, + { 0x0702, 0xf80f, 0x0000 }, + { 0x0702, 0xf811, 0x0000 }, + { 0x8702, 0xf814, 0x2000 }, + { 0x0702, 0xf813, 0x0000 }, + { 0x0702, 0xf815, 0x0000 }, + { 0x8702, 0xf826, 0x5000 }, + { 0x8702, 0xf81e, 0x4000 }, + { 0x8702, 0xf81a, 0x3000 }, + { 0x8702, 0xf818, 0x2000 }, + { 0x0702, 0xf817, 0x0000 }, + { 0x0702, 0xf819, 0x0000 }, + { 0x8702, 0xf81c, 0x2000 }, + { 0x0702, 0xf81b, 0x0000 }, + { 0x0702, 0xf81d, 0x0000 }, + { 0x8702, 0xf822, 0x3000 }, + { 0x8702, 0xf820, 0x2000 }, + { 0x0702, 0xf81f, 0x0000 }, + { 0x0702, 0xf821, 0x0000 }, + { 0x8702, 0xf824, 0x2000 }, + { 0x0702, 0xf823, 0x0000 }, + { 0x0702, 0xf825, 0x0000 }, + { 0x8702, 0xf82e, 0x4000 }, + { 0x8702, 0xf82a, 0x3000 }, + { 0x8702, 0xf828, 0x2000 }, + { 0x0702, 0xf827, 0x0000 }, + { 0x0702, 0xf829, 0x0000 }, + { 0x8702, 0xf82c, 0x2000 }, + { 0x0702, 0xf82b, 0x0000 }, + { 0x0702, 0xf82d, 0x0000 }, + { 0x8702, 0xf832, 0x3000 }, + { 0x8702, 0xf830, 0x2000 }, + { 0x0702, 0xf82f, 0x0000 }, + { 0x0702, 0xf831, 0x0000 }, + { 0x8702, 0xf834, 0x2000 }, + { 0x0702, 0xf833, 0x0000 }, + { 0x0702, 0xf835, 0x0000 }, + { 0x8702, 0xf856, 0x6000 }, + { 0x8702, 0xf846, 0x5000 }, + { 0x8702, 0xf83e, 0x4000 }, + { 0x8702, 0xf83a, 0x3000 }, + { 0x8702, 0xf838, 0x2000 }, + { 0x0702, 0xf837, 0x0000 }, + { 0x0702, 0xf839, 0x0000 }, + { 0x8702, 0xf83c, 0x2000 }, + { 0x0702, 0xf83b, 0x0000 }, + { 0x0702, 0xf83d, 0x0000 }, + { 0x8702, 0xf842, 0x3000 }, + { 0x8702, 0xf840, 0x2000 }, + { 0x0702, 0xf83f, 0x0000 }, + { 0x0702, 0xf841, 0x0000 }, + { 0x8702, 0xf844, 0x2000 }, + { 0x0702, 0xf843, 0x0000 }, + { 0x0702, 0xf845, 0x0000 }, + { 0x8702, 0xf84e, 0x4000 }, + { 0x8702, 0xf84a, 0x3000 }, + { 0x8702, 0xf848, 0x2000 }, + { 0x0702, 0xf847, 0x0000 }, + { 0x0702, 0xf849, 0x0000 }, + { 0x8702, 0xf84c, 0x2000 }, + { 0x0702, 0xf84b, 0x0000 }, + { 0x0702, 0xf84d, 0x0000 }, + { 0x8702, 0xf852, 0x3000 }, + { 0x8702, 0xf850, 0x2000 }, + { 0x0702, 0xf84f, 0x0000 }, + { 0x0702, 0xf851, 0x0000 }, + { 0x8702, 0xf854, 0x2000 }, + { 0x0702, 0xf853, 0x0000 }, + { 0x0702, 0xf855, 0x0000 }, + { 0x8702, 0xf866, 0x5000 }, + { 0x8702, 0xf85e, 0x4000 }, + { 0x8702, 0xf85a, 0x3000 }, + { 0x8702, 0xf858, 0x2000 }, + { 0x0702, 0xf857, 0x0000 }, + { 0x0702, 0xf859, 0x0000 }, + { 0x8702, 0xf85c, 0x2000 }, + { 0x0702, 0xf85b, 0x0000 }, + { 0x0702, 0xf85d, 0x0000 }, + { 0x8702, 0xf862, 0x3000 }, + { 0x8702, 0xf860, 0x2000 }, + { 0x0702, 0xf85f, 0x0000 }, + { 0x0702, 0xf861, 0x0000 }, + { 0x8702, 0xf864, 0x2000 }, + { 0x0702, 0xf863, 0x0000 }, + { 0x0702, 0xf865, 0x0000 }, + { 0x8702, 0xf86e, 0x4000 }, + { 0x8702, 0xf86a, 0x3000 }, + { 0x8702, 0xf868, 0x2000 }, + { 0x0702, 0xf867, 0x0000 }, + { 0x0702, 0xf869, 0x0000 }, + { 0x8702, 0xf86c, 0x2000 }, + { 0x0702, 0xf86b, 0x0000 }, + { 0x0702, 0xf86d, 0x0000 }, + { 0x8702, 0xf872, 0x3000 }, + { 0x8702, 0xf870, 0x2000 }, + { 0x0702, 0xf86f, 0x0000 }, + { 0x0702, 0xf871, 0x0000 }, + { 0x8702, 0xf874, 0x2000 }, + { 0x0702, 0xf873, 0x0000 }, + { 0x0702, 0xf875, 0x0000 }, + { 0x8702, 0xf976, 0x9000 }, + { 0x8702, 0xf8f6, 0x8000 }, + { 0x8702, 0xf8b6, 0x7000 }, + { 0x8702, 0xf896, 0x6000 }, + { 0x8702, 0xf886, 0x5000 }, + { 0x8702, 0xf87e, 0x4000 }, + { 0x8702, 0xf87a, 0x3000 }, + { 0x8702, 0xf878, 0x2000 }, + { 0x0702, 0xf877, 0x0000 }, + { 0x0702, 0xf879, 0x0000 }, + { 0x8702, 0xf87c, 0x2000 }, + { 0x0702, 0xf87b, 0x0000 }, + { 0x0702, 0xf87d, 0x0000 }, + { 0x8702, 0xf882, 0x3000 }, + { 0x8702, 0xf880, 0x2000 }, + { 0x0702, 0xf87f, 0x0000 }, + { 0x0702, 0xf881, 0x0000 }, + { 0x8702, 0xf884, 0x2000 }, + { 0x0702, 0xf883, 0x0000 }, + { 0x0702, 0xf885, 0x0000 }, + { 0x8702, 0xf88e, 0x4000 }, + { 0x8702, 0xf88a, 0x3000 }, + { 0x8702, 0xf888, 0x2000 }, + { 0x0702, 0xf887, 0x0000 }, + { 0x0702, 0xf889, 0x0000 }, + { 0x8702, 0xf88c, 0x2000 }, + { 0x0702, 0xf88b, 0x0000 }, + { 0x0702, 0xf88d, 0x0000 }, + { 0x8702, 0xf892, 0x3000 }, + { 0x8702, 0xf890, 0x2000 }, + { 0x0702, 0xf88f, 0x0000 }, + { 0x0702, 0xf891, 0x0000 }, + { 0x8702, 0xf894, 0x2000 }, + { 0x0702, 0xf893, 0x0000 }, + { 0x0702, 0xf895, 0x0000 }, + { 0x8702, 0xf8a6, 0x5000 }, + { 0x8702, 0xf89e, 0x4000 }, + { 0x8702, 0xf89a, 0x3000 }, + { 0x8702, 0xf898, 0x2000 }, + { 0x0702, 0xf897, 0x0000 }, + { 0x0702, 0xf899, 0x0000 }, + { 0x8702, 0xf89c, 0x2000 }, + { 0x0702, 0xf89b, 0x0000 }, + { 0x0702, 0xf89d, 0x0000 }, + { 0x8702, 0xf8a2, 0x3000 }, + { 0x8702, 0xf8a0, 0x2000 }, + { 0x0702, 0xf89f, 0x0000 }, + { 0x0702, 0xf8a1, 0x0000 }, + { 0x8702, 0xf8a4, 0x2000 }, + { 0x0702, 0xf8a3, 0x0000 }, + { 0x0702, 0xf8a5, 0x0000 }, + { 0x8702, 0xf8ae, 0x4000 }, + { 0x8702, 0xf8aa, 0x3000 }, + { 0x8702, 0xf8a8, 0x2000 }, + { 0x0702, 0xf8a7, 0x0000 }, + { 0x0702, 0xf8a9, 0x0000 }, + { 0x8702, 0xf8ac, 0x2000 }, + { 0x0702, 0xf8ab, 0x0000 }, + { 0x0702, 0xf8ad, 0x0000 }, + { 0x8702, 0xf8b2, 0x3000 }, + { 0x8702, 0xf8b0, 0x2000 }, + { 0x0702, 0xf8af, 0x0000 }, + { 0x0702, 0xf8b1, 0x0000 }, + { 0x8702, 0xf8b4, 0x2000 }, + { 0x0702, 0xf8b3, 0x0000 }, + { 0x0702, 0xf8b5, 0x0000 }, + { 0x8702, 0xf8d6, 0x6000 }, + { 0x8702, 0xf8c6, 0x5000 }, + { 0x8702, 0xf8be, 0x4000 }, + { 0x8702, 0xf8ba, 0x3000 }, + { 0x8702, 0xf8b8, 0x2000 }, + { 0x0702, 0xf8b7, 0x0000 }, + { 0x0702, 0xf8b9, 0x0000 }, + { 0x8702, 0xf8bc, 0x2000 }, + { 0x0702, 0xf8bb, 0x0000 }, + { 0x0702, 0xf8bd, 0x0000 }, + { 0x8702, 0xf8c2, 0x3000 }, + { 0x8702, 0xf8c0, 0x2000 }, + { 0x0702, 0xf8bf, 0x0000 }, + { 0x0702, 0xf8c1, 0x0000 }, + { 0x8702, 0xf8c4, 0x2000 }, + { 0x0702, 0xf8c3, 0x0000 }, + { 0x0702, 0xf8c5, 0x0000 }, + { 0x8702, 0xf8ce, 0x4000 }, + { 0x8702, 0xf8ca, 0x3000 }, + { 0x8702, 0xf8c8, 0x2000 }, + { 0x0702, 0xf8c7, 0x0000 }, + { 0x0702, 0xf8c9, 0x0000 }, + { 0x8702, 0xf8cc, 0x2000 }, + { 0x0702, 0xf8cb, 0x0000 }, + { 0x0702, 0xf8cd, 0x0000 }, + { 0x8702, 0xf8d2, 0x3000 }, + { 0x8702, 0xf8d0, 0x2000 }, + { 0x0702, 0xf8cf, 0x0000 }, + { 0x0702, 0xf8d1, 0x0000 }, + { 0x8702, 0xf8d4, 0x2000 }, + { 0x0702, 0xf8d3, 0x0000 }, + { 0x0702, 0xf8d5, 0x0000 }, + { 0x8702, 0xf8e6, 0x5000 }, + { 0x8702, 0xf8de, 0x4000 }, + { 0x8702, 0xf8da, 0x3000 }, + { 0x8702, 0xf8d8, 0x2000 }, + { 0x0702, 0xf8d7, 0x0000 }, + { 0x0702, 0xf8d9, 0x0000 }, + { 0x8702, 0xf8dc, 0x2000 }, + { 0x0702, 0xf8db, 0x0000 }, + { 0x0702, 0xf8dd, 0x0000 }, + { 0x8702, 0xf8e2, 0x3000 }, + { 0x8702, 0xf8e0, 0x2000 }, + { 0x0702, 0xf8df, 0x0000 }, + { 0x0702, 0xf8e1, 0x0000 }, + { 0x8702, 0xf8e4, 0x2000 }, + { 0x0702, 0xf8e3, 0x0000 }, + { 0x0702, 0xf8e5, 0x0000 }, + { 0x8702, 0xf8ee, 0x4000 }, + { 0x8702, 0xf8ea, 0x3000 }, + { 0x8702, 0xf8e8, 0x2000 }, + { 0x0702, 0xf8e7, 0x0000 }, + { 0x0702, 0xf8e9, 0x0000 }, + { 0x8702, 0xf8ec, 0x2000 }, + { 0x0702, 0xf8eb, 0x0000 }, + { 0x0702, 0xf8ed, 0x0000 }, + { 0x8702, 0xf8f2, 0x3000 }, + { 0x8702, 0xf8f0, 0x2000 }, + { 0x0702, 0xf8ef, 0x0000 }, + { 0x0702, 0xf8f1, 0x0000 }, + { 0x8702, 0xf8f4, 0x2000 }, + { 0x0702, 0xf8f3, 0x0000 }, + { 0x0702, 0xf8f5, 0x0000 }, + { 0x8702, 0xf936, 0x7000 }, + { 0x8702, 0xf916, 0x6000 }, + { 0x8702, 0xf906, 0x5000 }, + { 0x8702, 0xf8fe, 0x4000 }, + { 0x8702, 0xf8fa, 0x3000 }, + { 0x8702, 0xf8f8, 0x2000 }, + { 0x0702, 0xf8f7, 0x0000 }, + { 0x0702, 0xf8f9, 0x0000 }, + { 0x8702, 0xf8fc, 0x2000 }, + { 0x0702, 0xf8fb, 0x0000 }, + { 0x0702, 0xf8fd, 0x0000 }, + { 0x8702, 0xf902, 0x3000 }, + { 0x8702, 0xf900, 0x2000 }, + { 0x0702, 0xf8ff, 0x0000 }, + { 0x0702, 0xf901, 0x0000 }, + { 0x8702, 0xf904, 0x2000 }, + { 0x0702, 0xf903, 0x0000 }, + { 0x0702, 0xf905, 0x0000 }, + { 0x8702, 0xf90e, 0x4000 }, + { 0x8702, 0xf90a, 0x3000 }, + { 0x8702, 0xf908, 0x2000 }, + { 0x0702, 0xf907, 0x0000 }, + { 0x0702, 0xf909, 0x0000 }, + { 0x8702, 0xf90c, 0x2000 }, + { 0x0702, 0xf90b, 0x0000 }, + { 0x0702, 0xf90d, 0x0000 }, + { 0x8702, 0xf912, 0x3000 }, + { 0x8702, 0xf910, 0x2000 }, + { 0x0702, 0xf90f, 0x0000 }, + { 0x0702, 0xf911, 0x0000 }, + { 0x8702, 0xf914, 0x2000 }, + { 0x0702, 0xf913, 0x0000 }, + { 0x0702, 0xf915, 0x0000 }, + { 0x8702, 0xf926, 0x5000 }, + { 0x8702, 0xf91e, 0x4000 }, + { 0x8702, 0xf91a, 0x3000 }, + { 0x8702, 0xf918, 0x2000 }, + { 0x0702, 0xf917, 0x0000 }, + { 0x0702, 0xf919, 0x0000 }, + { 0x8702, 0xf91c, 0x2000 }, + { 0x0702, 0xf91b, 0x0000 }, + { 0x0702, 0xf91d, 0x0000 }, + { 0x8702, 0xf922, 0x3000 }, + { 0x8702, 0xf920, 0x2000 }, + { 0x0702, 0xf91f, 0x0000 }, + { 0x0702, 0xf921, 0x0000 }, + { 0x8702, 0xf924, 0x2000 }, + { 0x0702, 0xf923, 0x0000 }, + { 0x0702, 0xf925, 0x0000 }, + { 0x8702, 0xf92e, 0x4000 }, + { 0x8702, 0xf92a, 0x3000 }, + { 0x8702, 0xf928, 0x2000 }, + { 0x0702, 0xf927, 0x0000 }, + { 0x0702, 0xf929, 0x0000 }, + { 0x8702, 0xf92c, 0x2000 }, + { 0x0702, 0xf92b, 0x0000 }, + { 0x0702, 0xf92d, 0x0000 }, + { 0x8702, 0xf932, 0x3000 }, + { 0x8702, 0xf930, 0x2000 }, + { 0x0702, 0xf92f, 0x0000 }, + { 0x0702, 0xf931, 0x0000 }, + { 0x8702, 0xf934, 0x2000 }, + { 0x0702, 0xf933, 0x0000 }, + { 0x0702, 0xf935, 0x0000 }, + { 0x8702, 0xf956, 0x6000 }, + { 0x8702, 0xf946, 0x5000 }, + { 0x8702, 0xf93e, 0x4000 }, + { 0x8702, 0xf93a, 0x3000 }, + { 0x8702, 0xf938, 0x2000 }, + { 0x0702, 0xf937, 0x0000 }, + { 0x0702, 0xf939, 0x0000 }, + { 0x8702, 0xf93c, 0x2000 }, + { 0x0702, 0xf93b, 0x0000 }, + { 0x0702, 0xf93d, 0x0000 }, + { 0x8702, 0xf942, 0x3000 }, + { 0x8702, 0xf940, 0x2000 }, + { 0x0702, 0xf93f, 0x0000 }, + { 0x0702, 0xf941, 0x0000 }, + { 0x8702, 0xf944, 0x2000 }, + { 0x0702, 0xf943, 0x0000 }, + { 0x0702, 0xf945, 0x0000 }, + { 0x8702, 0xf94e, 0x4000 }, + { 0x8702, 0xf94a, 0x3000 }, + { 0x8702, 0xf948, 0x2000 }, + { 0x0702, 0xf947, 0x0000 }, + { 0x0702, 0xf949, 0x0000 }, + { 0x8702, 0xf94c, 0x2000 }, + { 0x0702, 0xf94b, 0x0000 }, + { 0x0702, 0xf94d, 0x0000 }, + { 0x8702, 0xf952, 0x3000 }, + { 0x8702, 0xf950, 0x2000 }, + { 0x0702, 0xf94f, 0x0000 }, + { 0x0702, 0xf951, 0x0000 }, + { 0x8702, 0xf954, 0x2000 }, + { 0x0702, 0xf953, 0x0000 }, + { 0x0702, 0xf955, 0x0000 }, + { 0x8702, 0xf966, 0x5000 }, + { 0x8702, 0xf95e, 0x4000 }, + { 0x8702, 0xf95a, 0x3000 }, + { 0x8702, 0xf958, 0x2000 }, + { 0x0702, 0xf957, 0x0000 }, + { 0x0702, 0xf959, 0x0000 }, + { 0x8702, 0xf95c, 0x2000 }, + { 0x0702, 0xf95b, 0x0000 }, + { 0x0702, 0xf95d, 0x0000 }, + { 0x8702, 0xf962, 0x3000 }, + { 0x8702, 0xf960, 0x2000 }, + { 0x0702, 0xf95f, 0x0000 }, + { 0x0702, 0xf961, 0x0000 }, + { 0x8702, 0xf964, 0x2000 }, + { 0x0702, 0xf963, 0x0000 }, + { 0x0702, 0xf965, 0x0000 }, + { 0x8702, 0xf96e, 0x4000 }, + { 0x8702, 0xf96a, 0x3000 }, + { 0x8702, 0xf968, 0x2000 }, + { 0x0702, 0xf967, 0x0000 }, + { 0x0702, 0xf969, 0x0000 }, + { 0x8702, 0xf96c, 0x2000 }, + { 0x0702, 0xf96b, 0x0000 }, + { 0x0702, 0xf96d, 0x0000 }, + { 0x8702, 0xf972, 0x3000 }, + { 0x8702, 0xf970, 0x2000 }, + { 0x0702, 0xf96f, 0x0000 }, + { 0x0702, 0xf971, 0x0000 }, + { 0x8702, 0xf974, 0x2000 }, + { 0x0702, 0xf973, 0x0000 }, + { 0x0702, 0xf975, 0x0000 }, + { 0x810e, 0x0077, 0x9000 }, + { 0x8702, 0xf9f6, 0x8000 }, + { 0x8702, 0xf9b6, 0x7000 }, + { 0x8702, 0xf996, 0x6000 }, + { 0x8702, 0xf986, 0x5000 }, + { 0x8702, 0xf97e, 0x4000 }, + { 0x8702, 0xf97a, 0x3000 }, + { 0x8702, 0xf978, 0x2000 }, + { 0x0702, 0xf977, 0x0000 }, + { 0x0702, 0xf979, 0x0000 }, + { 0x8702, 0xf97c, 0x2000 }, + { 0x0702, 0xf97b, 0x0000 }, + { 0x0702, 0xf97d, 0x0000 }, + { 0x8702, 0xf982, 0x3000 }, + { 0x8702, 0xf980, 0x2000 }, + { 0x0702, 0xf97f, 0x0000 }, + { 0x0702, 0xf981, 0x0000 }, + { 0x8702, 0xf984, 0x2000 }, + { 0x0702, 0xf983, 0x0000 }, + { 0x0702, 0xf985, 0x0000 }, + { 0x8702, 0xf98e, 0x4000 }, + { 0x8702, 0xf98a, 0x3000 }, + { 0x8702, 0xf988, 0x2000 }, + { 0x0702, 0xf987, 0x0000 }, + { 0x0702, 0xf989, 0x0000 }, + { 0x8702, 0xf98c, 0x2000 }, + { 0x0702, 0xf98b, 0x0000 }, + { 0x0702, 0xf98d, 0x0000 }, + { 0x8702, 0xf992, 0x3000 }, + { 0x8702, 0xf990, 0x2000 }, + { 0x0702, 0xf98f, 0x0000 }, + { 0x0702, 0xf991, 0x0000 }, + { 0x8702, 0xf994, 0x2000 }, + { 0x0702, 0xf993, 0x0000 }, + { 0x0702, 0xf995, 0x0000 }, + { 0x8702, 0xf9a6, 0x5000 }, + { 0x8702, 0xf99e, 0x4000 }, + { 0x8702, 0xf99a, 0x3000 }, + { 0x8702, 0xf998, 0x2000 }, + { 0x0702, 0xf997, 0x0000 }, + { 0x0702, 0xf999, 0x0000 }, + { 0x8702, 0xf99c, 0x2000 }, + { 0x0702, 0xf99b, 0x0000 }, + { 0x0702, 0xf99d, 0x0000 }, + { 0x8702, 0xf9a2, 0x3000 }, + { 0x8702, 0xf9a0, 0x2000 }, + { 0x0702, 0xf99f, 0x0000 }, + { 0x0702, 0xf9a1, 0x0000 }, + { 0x8702, 0xf9a4, 0x2000 }, + { 0x0702, 0xf9a3, 0x0000 }, + { 0x0702, 0xf9a5, 0x0000 }, + { 0x8702, 0xf9ae, 0x4000 }, + { 0x8702, 0xf9aa, 0x3000 }, + { 0x8702, 0xf9a8, 0x2000 }, + { 0x0702, 0xf9a7, 0x0000 }, + { 0x0702, 0xf9a9, 0x0000 }, + { 0x8702, 0xf9ac, 0x2000 }, + { 0x0702, 0xf9ab, 0x0000 }, + { 0x0702, 0xf9ad, 0x0000 }, + { 0x8702, 0xf9b2, 0x3000 }, + { 0x8702, 0xf9b0, 0x2000 }, + { 0x0702, 0xf9af, 0x0000 }, + { 0x0702, 0xf9b1, 0x0000 }, + { 0x8702, 0xf9b4, 0x2000 }, + { 0x0702, 0xf9b3, 0x0000 }, + { 0x0702, 0xf9b5, 0x0000 }, + { 0x8702, 0xf9d6, 0x6000 }, + { 0x8702, 0xf9c6, 0x5000 }, + { 0x8702, 0xf9be, 0x4000 }, + { 0x8702, 0xf9ba, 0x3000 }, + { 0x8702, 0xf9b8, 0x2000 }, + { 0x0702, 0xf9b7, 0x0000 }, + { 0x0702, 0xf9b9, 0x0000 }, + { 0x8702, 0xf9bc, 0x2000 }, + { 0x0702, 0xf9bb, 0x0000 }, + { 0x0702, 0xf9bd, 0x0000 }, + { 0x8702, 0xf9c2, 0x3000 }, + { 0x8702, 0xf9c0, 0x2000 }, + { 0x0702, 0xf9bf, 0x0000 }, + { 0x0702, 0xf9c1, 0x0000 }, + { 0x8702, 0xf9c4, 0x2000 }, + { 0x0702, 0xf9c3, 0x0000 }, + { 0x0702, 0xf9c5, 0x0000 }, + { 0x8702, 0xf9ce, 0x4000 }, + { 0x8702, 0xf9ca, 0x3000 }, + { 0x8702, 0xf9c8, 0x2000 }, + { 0x0702, 0xf9c7, 0x0000 }, + { 0x0702, 0xf9c9, 0x0000 }, + { 0x8702, 0xf9cc, 0x2000 }, + { 0x0702, 0xf9cb, 0x0000 }, + { 0x0702, 0xf9cd, 0x0000 }, + { 0x8702, 0xf9d2, 0x3000 }, + { 0x8702, 0xf9d0, 0x2000 }, + { 0x0702, 0xf9cf, 0x0000 }, + { 0x0702, 0xf9d1, 0x0000 }, + { 0x8702, 0xf9d4, 0x2000 }, + { 0x0702, 0xf9d3, 0x0000 }, + { 0x0702, 0xf9d5, 0x0000 }, + { 0x8702, 0xf9e6, 0x5000 }, + { 0x8702, 0xf9de, 0x4000 }, + { 0x8702, 0xf9da, 0x3000 }, + { 0x8702, 0xf9d8, 0x2000 }, + { 0x0702, 0xf9d7, 0x0000 }, + { 0x0702, 0xf9d9, 0x0000 }, + { 0x8702, 0xf9dc, 0x2000 }, + { 0x0702, 0xf9db, 0x0000 }, + { 0x0702, 0xf9dd, 0x0000 }, + { 0x8702, 0xf9e2, 0x3000 }, + { 0x8702, 0xf9e0, 0x2000 }, + { 0x0702, 0xf9df, 0x0000 }, + { 0x0702, 0xf9e1, 0x0000 }, + { 0x8702, 0xf9e4, 0x2000 }, + { 0x0702, 0xf9e3, 0x0000 }, + { 0x0702, 0xf9e5, 0x0000 }, + { 0x8702, 0xf9ee, 0x4000 }, + { 0x8702, 0xf9ea, 0x3000 }, + { 0x8702, 0xf9e8, 0x2000 }, + { 0x0702, 0xf9e7, 0x0000 }, + { 0x0702, 0xf9e9, 0x0000 }, + { 0x8702, 0xf9ec, 0x2000 }, + { 0x0702, 0xf9eb, 0x0000 }, + { 0x0702, 0xf9ed, 0x0000 }, + { 0x8702, 0xf9f2, 0x3000 }, + { 0x8702, 0xf9f0, 0x2000 }, + { 0x0702, 0xf9ef, 0x0000 }, + { 0x0702, 0xf9f1, 0x0000 }, + { 0x8702, 0xf9f4, 0x2000 }, + { 0x0702, 0xf9f3, 0x0000 }, + { 0x0702, 0xf9f5, 0x0000 }, + { 0x810e, 0x0037, 0x7000 }, + { 0x8702, 0xfa16, 0x6000 }, + { 0x8702, 0xfa06, 0x5000 }, + { 0x8702, 0xf9fe, 0x4000 }, + { 0x8702, 0xf9fa, 0x3000 }, + { 0x8702, 0xf9f8, 0x2000 }, + { 0x0702, 0xf9f7, 0x0000 }, + { 0x0702, 0xf9f9, 0x0000 }, + { 0x8702, 0xf9fc, 0x2000 }, + { 0x0702, 0xf9fb, 0x0000 }, + { 0x0702, 0xf9fd, 0x0000 }, + { 0x8702, 0xfa02, 0x3000 }, + { 0x8702, 0xfa00, 0x2000 }, + { 0x0702, 0xf9ff, 0x0000 }, + { 0x0702, 0xfa01, 0x0000 }, + { 0x8702, 0xfa04, 0x2000 }, + { 0x0702, 0xfa03, 0x0000 }, + { 0x0702, 0xfa05, 0x0000 }, + { 0x8702, 0xfa0e, 0x4000 }, + { 0x8702, 0xfa0a, 0x3000 }, + { 0x8702, 0xfa08, 0x2000 }, + { 0x0702, 0xfa07, 0x0000 }, + { 0x0702, 0xfa09, 0x0000 }, + { 0x8702, 0xfa0c, 0x2000 }, + { 0x0702, 0xfa0b, 0x0000 }, + { 0x0702, 0xfa0d, 0x0000 }, + { 0x8702, 0xfa12, 0x3000 }, + { 0x8702, 0xfa10, 0x2000 }, + { 0x0702, 0xfa0f, 0x0000 }, + { 0x0702, 0xfa11, 0x0000 }, + { 0x8702, 0xfa14, 0x2000 }, + { 0x0702, 0xfa13, 0x0000 }, + { 0x0702, 0xfa15, 0x0000 }, + { 0x810e, 0x0027, 0x5000 }, + { 0x810e, 0x0001, 0x4000 }, + { 0x8702, 0xfa1a, 0x3000 }, + { 0x8702, 0xfa18, 0x2000 }, + { 0x0702, 0xfa17, 0x0000 }, + { 0x0702, 0xfa19, 0x0000 }, + { 0x8702, 0xfa1c, 0x2000 }, + { 0x0702, 0xfa1b, 0x0000 }, + { 0x0702, 0xfa1d, 0x0000 }, + { 0x810e, 0x0023, 0x3000 }, + { 0x810e, 0x0021, 0x2000 }, + { 0x010e, 0x0020, 0x0000 }, + { 0x010e, 0x0022, 0x0000 }, + { 0x810e, 0x0025, 0x2000 }, + { 0x010e, 0x0024, 0x0000 }, + { 0x010e, 0x0026, 0x0000 }, + { 0x810e, 0x002f, 0x4000 }, + { 0x810e, 0x002b, 0x3000 }, + { 0x810e, 0x0029, 0x2000 }, + { 0x010e, 0x0028, 0x0000 }, + { 0x010e, 0x002a, 0x0000 }, + { 0x810e, 0x002d, 0x2000 }, + { 0x010e, 0x002c, 0x0000 }, + { 0x010e, 0x002e, 0x0000 }, + { 0x810e, 0x0033, 0x3000 }, + { 0x810e, 0x0031, 0x2000 }, + { 0x010e, 0x0030, 0x0000 }, + { 0x010e, 0x0032, 0x0000 }, + { 0x810e, 0x0035, 0x2000 }, + { 0x010e, 0x0034, 0x0000 }, + { 0x010e, 0x0036, 0x0000 }, + { 0x810e, 0x0057, 0x6000 }, + { 0x810e, 0x0047, 0x5000 }, + { 0x810e, 0x003f, 0x4000 }, + { 0x810e, 0x003b, 0x3000 }, + { 0x810e, 0x0039, 0x2000 }, + { 0x010e, 0x0038, 0x0000 }, + { 0x010e, 0x003a, 0x0000 }, + { 0x810e, 0x003d, 0x2000 }, + { 0x010e, 0x003c, 0x0000 }, + { 0x010e, 0x003e, 0x0000 }, + { 0x810e, 0x0043, 0x3000 }, + { 0x810e, 0x0041, 0x2000 }, + { 0x010e, 0x0040, 0x0000 }, + { 0x010e, 0x0042, 0x0000 }, + { 0x810e, 0x0045, 0x2000 }, + { 0x010e, 0x0044, 0x0000 }, + { 0x010e, 0x0046, 0x0000 }, + { 0x810e, 0x004f, 0x4000 }, + { 0x810e, 0x004b, 0x3000 }, + { 0x810e, 0x0049, 0x2000 }, + { 0x010e, 0x0048, 0x0000 }, + { 0x010e, 0x004a, 0x0000 }, + { 0x810e, 0x004d, 0x2000 }, + { 0x010e, 0x004c, 0x0000 }, + { 0x010e, 0x004e, 0x0000 }, + { 0x810e, 0x0053, 0x3000 }, + { 0x810e, 0x0051, 0x2000 }, + { 0x010e, 0x0050, 0x0000 }, + { 0x010e, 0x0052, 0x0000 }, + { 0x810e, 0x0055, 0x2000 }, + { 0x010e, 0x0054, 0x0000 }, + { 0x010e, 0x0056, 0x0000 }, + { 0x810e, 0x0067, 0x5000 }, + { 0x810e, 0x005f, 0x4000 }, + { 0x810e, 0x005b, 0x3000 }, + { 0x810e, 0x0059, 0x2000 }, + { 0x010e, 0x0058, 0x0000 }, + { 0x010e, 0x005a, 0x0000 }, + { 0x810e, 0x005d, 0x2000 }, + { 0x010e, 0x005c, 0x0000 }, + { 0x010e, 0x005e, 0x0000 }, + { 0x810e, 0x0063, 0x3000 }, + { 0x810e, 0x0061, 0x2000 }, + { 0x010e, 0x0060, 0x0000 }, + { 0x010e, 0x0062, 0x0000 }, + { 0x810e, 0x0065, 0x2000 }, + { 0x010e, 0x0064, 0x0000 }, + { 0x010e, 0x0066, 0x0000 }, + { 0x810e, 0x006f, 0x4000 }, + { 0x810e, 0x006b, 0x3000 }, + { 0x810e, 0x0069, 0x2000 }, + { 0x010e, 0x0068, 0x0000 }, + { 0x010e, 0x006a, 0x0000 }, + { 0x810e, 0x006d, 0x2000 }, + { 0x010e, 0x006c, 0x0000 }, + { 0x010e, 0x006e, 0x0000 }, + { 0x810e, 0x0073, 0x3000 }, + { 0x810e, 0x0071, 0x2000 }, + { 0x010e, 0x0070, 0x0000 }, + { 0x010e, 0x0072, 0x0000 }, + { 0x810e, 0x0075, 0x2000 }, + { 0x010e, 0x0074, 0x0000 }, + { 0x010e, 0x0076, 0x0000 }, + { 0x8c0e, 0x0177, 0x8000 }, + { 0x8c0e, 0x0137, 0x7000 }, + { 0x8c0e, 0x0117, 0x6000 }, + { 0x8c0e, 0x0107, 0x5000 }, + { 0x810e, 0x007f, 0x4000 }, + { 0x810e, 0x007b, 0x3000 }, + { 0x810e, 0x0079, 0x2000 }, + { 0x010e, 0x0078, 0x0000 }, + { 0x010e, 0x007a, 0x0000 }, + { 0x810e, 0x007d, 0x2000 }, + { 0x010e, 0x007c, 0x0000 }, + { 0x010e, 0x007e, 0x0000 }, + { 0x8c0e, 0x0103, 0x3000 }, + { 0x8c0e, 0x0101, 0x2000 }, + { 0x0c0e, 0x0100, 0x0000 }, + { 0x0c0e, 0x0102, 0x0000 }, + { 0x8c0e, 0x0105, 0x2000 }, + { 0x0c0e, 0x0104, 0x0000 }, + { 0x0c0e, 0x0106, 0x0000 }, + { 0x8c0e, 0x010f, 0x4000 }, + { 0x8c0e, 0x010b, 0x3000 }, + { 0x8c0e, 0x0109, 0x2000 }, + { 0x0c0e, 0x0108, 0x0000 }, + { 0x0c0e, 0x010a, 0x0000 }, + { 0x8c0e, 0x010d, 0x2000 }, + { 0x0c0e, 0x010c, 0x0000 }, + { 0x0c0e, 0x010e, 0x0000 }, + { 0x8c0e, 0x0113, 0x3000 }, + { 0x8c0e, 0x0111, 0x2000 }, + { 0x0c0e, 0x0110, 0x0000 }, + { 0x0c0e, 0x0112, 0x0000 }, + { 0x8c0e, 0x0115, 0x2000 }, + { 0x0c0e, 0x0114, 0x0000 }, + { 0x0c0e, 0x0116, 0x0000 }, + { 0x8c0e, 0x0127, 0x5000 }, + { 0x8c0e, 0x011f, 0x4000 }, + { 0x8c0e, 0x011b, 0x3000 }, + { 0x8c0e, 0x0119, 0x2000 }, + { 0x0c0e, 0x0118, 0x0000 }, + { 0x0c0e, 0x011a, 0x0000 }, + { 0x8c0e, 0x011d, 0x2000 }, + { 0x0c0e, 0x011c, 0x0000 }, + { 0x0c0e, 0x011e, 0x0000 }, + { 0x8c0e, 0x0123, 0x3000 }, + { 0x8c0e, 0x0121, 0x2000 }, + { 0x0c0e, 0x0120, 0x0000 }, + { 0x0c0e, 0x0122, 0x0000 }, + { 0x8c0e, 0x0125, 0x2000 }, + { 0x0c0e, 0x0124, 0x0000 }, + { 0x0c0e, 0x0126, 0x0000 }, + { 0x8c0e, 0x012f, 0x4000 }, + { 0x8c0e, 0x012b, 0x3000 }, + { 0x8c0e, 0x0129, 0x2000 }, + { 0x0c0e, 0x0128, 0x0000 }, + { 0x0c0e, 0x012a, 0x0000 }, + { 0x8c0e, 0x012d, 0x2000 }, + { 0x0c0e, 0x012c, 0x0000 }, + { 0x0c0e, 0x012e, 0x0000 }, + { 0x8c0e, 0x0133, 0x3000 }, + { 0x8c0e, 0x0131, 0x2000 }, + { 0x0c0e, 0x0130, 0x0000 }, + { 0x0c0e, 0x0132, 0x0000 }, + { 0x8c0e, 0x0135, 0x2000 }, + { 0x0c0e, 0x0134, 0x0000 }, + { 0x0c0e, 0x0136, 0x0000 }, + { 0x8c0e, 0x0157, 0x6000 }, + { 0x8c0e, 0x0147, 0x5000 }, + { 0x8c0e, 0x013f, 0x4000 }, + { 0x8c0e, 0x013b, 0x3000 }, + { 0x8c0e, 0x0139, 0x2000 }, + { 0x0c0e, 0x0138, 0x0000 }, + { 0x0c0e, 0x013a, 0x0000 }, + { 0x8c0e, 0x013d, 0x2000 }, + { 0x0c0e, 0x013c, 0x0000 }, + { 0x0c0e, 0x013e, 0x0000 }, + { 0x8c0e, 0x0143, 0x3000 }, + { 0x8c0e, 0x0141, 0x2000 }, + { 0x0c0e, 0x0140, 0x0000 }, + { 0x0c0e, 0x0142, 0x0000 }, + { 0x8c0e, 0x0145, 0x2000 }, + { 0x0c0e, 0x0144, 0x0000 }, + { 0x0c0e, 0x0146, 0x0000 }, + { 0x8c0e, 0x014f, 0x4000 }, + { 0x8c0e, 0x014b, 0x3000 }, + { 0x8c0e, 0x0149, 0x2000 }, + { 0x0c0e, 0x0148, 0x0000 }, + { 0x0c0e, 0x014a, 0x0000 }, + { 0x8c0e, 0x014d, 0x2000 }, + { 0x0c0e, 0x014c, 0x0000 }, + { 0x0c0e, 0x014e, 0x0000 }, + { 0x8c0e, 0x0153, 0x3000 }, + { 0x8c0e, 0x0151, 0x2000 }, + { 0x0c0e, 0x0150, 0x0000 }, + { 0x0c0e, 0x0152, 0x0000 }, + { 0x8c0e, 0x0155, 0x2000 }, + { 0x0c0e, 0x0154, 0x0000 }, + { 0x0c0e, 0x0156, 0x0000 }, + { 0x8c0e, 0x0167, 0x5000 }, + { 0x8c0e, 0x015f, 0x4000 }, + { 0x8c0e, 0x015b, 0x3000 }, + { 0x8c0e, 0x0159, 0x2000 }, + { 0x0c0e, 0x0158, 0x0000 }, + { 0x0c0e, 0x015a, 0x0000 }, + { 0x8c0e, 0x015d, 0x2000 }, + { 0x0c0e, 0x015c, 0x0000 }, + { 0x0c0e, 0x015e, 0x0000 }, + { 0x8c0e, 0x0163, 0x3000 }, + { 0x8c0e, 0x0161, 0x2000 }, + { 0x0c0e, 0x0160, 0x0000 }, + { 0x0c0e, 0x0162, 0x0000 }, + { 0x8c0e, 0x0165, 0x2000 }, + { 0x0c0e, 0x0164, 0x0000 }, + { 0x0c0e, 0x0166, 0x0000 }, + { 0x8c0e, 0x016f, 0x4000 }, + { 0x8c0e, 0x016b, 0x3000 }, + { 0x8c0e, 0x0169, 0x2000 }, + { 0x0c0e, 0x0168, 0x0000 }, + { 0x0c0e, 0x016a, 0x0000 }, + { 0x8c0e, 0x016d, 0x2000 }, + { 0x0c0e, 0x016c, 0x0000 }, + { 0x0c0e, 0x016e, 0x0000 }, + { 0x8c0e, 0x0173, 0x3000 }, + { 0x8c0e, 0x0171, 0x2000 }, + { 0x0c0e, 0x0170, 0x0000 }, + { 0x0c0e, 0x0172, 0x0000 }, + { 0x8c0e, 0x0175, 0x2000 }, + { 0x0c0e, 0x0174, 0x0000 }, + { 0x0c0e, 0x0176, 0x0000 }, + { 0x8c0e, 0x01b7, 0x7000 }, + { 0x8c0e, 0x0197, 0x6000 }, + { 0x8c0e, 0x0187, 0x5000 }, + { 0x8c0e, 0x017f, 0x4000 }, + { 0x8c0e, 0x017b, 0x3000 }, + { 0x8c0e, 0x0179, 0x2000 }, + { 0x0c0e, 0x0178, 0x0000 }, + { 0x0c0e, 0x017a, 0x0000 }, + { 0x8c0e, 0x017d, 0x2000 }, + { 0x0c0e, 0x017c, 0x0000 }, + { 0x0c0e, 0x017e, 0x0000 }, + { 0x8c0e, 0x0183, 0x3000 }, + { 0x8c0e, 0x0181, 0x2000 }, + { 0x0c0e, 0x0180, 0x0000 }, + { 0x0c0e, 0x0182, 0x0000 }, + { 0x8c0e, 0x0185, 0x2000 }, + { 0x0c0e, 0x0184, 0x0000 }, + { 0x0c0e, 0x0186, 0x0000 }, + { 0x8c0e, 0x018f, 0x4000 }, + { 0x8c0e, 0x018b, 0x3000 }, + { 0x8c0e, 0x0189, 0x2000 }, + { 0x0c0e, 0x0188, 0x0000 }, + { 0x0c0e, 0x018a, 0x0000 }, + { 0x8c0e, 0x018d, 0x2000 }, + { 0x0c0e, 0x018c, 0x0000 }, + { 0x0c0e, 0x018e, 0x0000 }, + { 0x8c0e, 0x0193, 0x3000 }, + { 0x8c0e, 0x0191, 0x2000 }, + { 0x0c0e, 0x0190, 0x0000 }, + { 0x0c0e, 0x0192, 0x0000 }, + { 0x8c0e, 0x0195, 0x2000 }, + { 0x0c0e, 0x0194, 0x0000 }, + { 0x0c0e, 0x0196, 0x0000 }, + { 0x8c0e, 0x01a7, 0x5000 }, + { 0x8c0e, 0x019f, 0x4000 }, + { 0x8c0e, 0x019b, 0x3000 }, + { 0x8c0e, 0x0199, 0x2000 }, + { 0x0c0e, 0x0198, 0x0000 }, + { 0x0c0e, 0x019a, 0x0000 }, + { 0x8c0e, 0x019d, 0x2000 }, + { 0x0c0e, 0x019c, 0x0000 }, + { 0x0c0e, 0x019e, 0x0000 }, + { 0x8c0e, 0x01a3, 0x3000 }, + { 0x8c0e, 0x01a1, 0x2000 }, + { 0x0c0e, 0x01a0, 0x0000 }, + { 0x0c0e, 0x01a2, 0x0000 }, + { 0x8c0e, 0x01a5, 0x2000 }, + { 0x0c0e, 0x01a4, 0x0000 }, + { 0x0c0e, 0x01a6, 0x0000 }, + { 0x8c0e, 0x01af, 0x4000 }, + { 0x8c0e, 0x01ab, 0x3000 }, + { 0x8c0e, 0x01a9, 0x2000 }, + { 0x0c0e, 0x01a8, 0x0000 }, + { 0x0c0e, 0x01aa, 0x0000 }, + { 0x8c0e, 0x01ad, 0x2000 }, + { 0x0c0e, 0x01ac, 0x0000 }, + { 0x0c0e, 0x01ae, 0x0000 }, + { 0x8c0e, 0x01b3, 0x3000 }, + { 0x8c0e, 0x01b1, 0x2000 }, + { 0x0c0e, 0x01b0, 0x0000 }, + { 0x0c0e, 0x01b2, 0x0000 }, + { 0x8c0e, 0x01b5, 0x2000 }, + { 0x0c0e, 0x01b4, 0x0000 }, + { 0x0c0e, 0x01b6, 0x0000 }, + { 0x8c0e, 0x01d7, 0x6000 }, + { 0x8c0e, 0x01c7, 0x5000 }, + { 0x8c0e, 0x01bf, 0x4000 }, + { 0x8c0e, 0x01bb, 0x3000 }, + { 0x8c0e, 0x01b9, 0x2000 }, + { 0x0c0e, 0x01b8, 0x0000 }, + { 0x0c0e, 0x01ba, 0x0000 }, + { 0x8c0e, 0x01bd, 0x2000 }, + { 0x0c0e, 0x01bc, 0x0000 }, + { 0x0c0e, 0x01be, 0x0000 }, + { 0x8c0e, 0x01c3, 0x3000 }, + { 0x8c0e, 0x01c1, 0x2000 }, + { 0x0c0e, 0x01c0, 0x0000 }, + { 0x0c0e, 0x01c2, 0x0000 }, + { 0x8c0e, 0x01c5, 0x2000 }, + { 0x0c0e, 0x01c4, 0x0000 }, + { 0x0c0e, 0x01c6, 0x0000 }, + { 0x8c0e, 0x01cf, 0x4000 }, + { 0x8c0e, 0x01cb, 0x3000 }, + { 0x8c0e, 0x01c9, 0x2000 }, + { 0x0c0e, 0x01c8, 0x0000 }, + { 0x0c0e, 0x01ca, 0x0000 }, + { 0x8c0e, 0x01cd, 0x2000 }, + { 0x0c0e, 0x01cc, 0x0000 }, + { 0x0c0e, 0x01ce, 0x0000 }, + { 0x8c0e, 0x01d3, 0x3000 }, + { 0x8c0e, 0x01d1, 0x2000 }, + { 0x0c0e, 0x01d0, 0x0000 }, + { 0x0c0e, 0x01d2, 0x0000 }, + { 0x8c0e, 0x01d5, 0x2000 }, + { 0x0c0e, 0x01d4, 0x0000 }, + { 0x0c0e, 0x01d6, 0x0000 }, + { 0x8c0e, 0x01e7, 0x5000 }, + { 0x8c0e, 0x01df, 0x4000 }, + { 0x8c0e, 0x01db, 0x3000 }, + { 0x8c0e, 0x01d9, 0x2000 }, + { 0x0c0e, 0x01d8, 0x0000 }, + { 0x0c0e, 0x01da, 0x0000 }, + { 0x8c0e, 0x01dd, 0x2000 }, + { 0x0c0e, 0x01dc, 0x0000 }, + { 0x0c0e, 0x01de, 0x0000 }, + { 0x8c0e, 0x01e3, 0x3000 }, + { 0x8c0e, 0x01e1, 0x2000 }, + { 0x0c0e, 0x01e0, 0x0000 }, + { 0x0c0e, 0x01e2, 0x0000 }, + { 0x8c0e, 0x01e5, 0x2000 }, + { 0x0c0e, 0x01e4, 0x0000 }, + { 0x0c0e, 0x01e6, 0x0000 }, + { 0x8c0e, 0x01ef, 0x4000 }, + { 0x8c0e, 0x01eb, 0x3000 }, + { 0x8c0e, 0x01e9, 0x2000 }, + { 0x0c0e, 0x01e8, 0x0000 }, + { 0x0c0e, 0x01ea, 0x0000 }, + { 0x8c0e, 0x01ed, 0x2000 }, + { 0x0c0e, 0x01ec, 0x0000 }, + { 0x0c0e, 0x01ee, 0x0000 }, + { 0x830f, 0xfffd, 0x2000 }, + { 0x030f, 0x0000, 0x0000 }, + { 0x0310, 0x0000, 0x1000 }, + { 0x0310, 0xfffd, 0x0000 }, +}; diff --git a/mozilla/js/tamarin/platform/arm/DateUnix.cpp b/mozilla/js/tamarin/platform/arm/DateUnix.cpp new file mode 100644 index 00000000000..eeaaf13cda4 --- /dev/null +++ b/mozilla/js/tamarin/platform/arm/DateUnix.cpp @@ -0,0 +1,113 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include +#include + +#include + +#include "avmplus.h" + +namespace avmplus +{ + /* + * Unix implementation of platform-dependent date and time code + */ + +#define kMsecPerDay 86400000 +#define kMsecPerHour 3600000 +#define kMsecPerSecond 1000 +#define kMsecPerMinute 60000 + +#define DIVCLOCK ( CLOCKS_PER_SEC / 1000 ) + +#define kMicroPerSec 1000000.0 + + double OSDep::localTZA(double ti) + { + struct tm* t; + time_t current, localSec, globalSec; + + // The win32 implementation ignores the passed in time + // and uses current time instead, so to keep similar + // behaviour we will do the same + time( ¤t ); + + t = localtime( ¤t ); + localSec = mktime( t ); + + t = gmtime( ¤t ); + globalSec = mktime( t ); + + return double( localSec - globalSec ) * 1000.0; + } + + double OSDep::getDate() + { + struct timeval tv; + struct timezone tz; // Unused + + gettimeofday(&tv, &tz); + double v = (tv.tv_sec + (tv.tv_usec/kMicroPerSec)) * kMsecPerSecond; + double ip, fp = ::modf(v, &ip); // strip fractional part + return ip; + } + + //time is passed in as milliseconds from UTC. + double OSDep::daylightSavingTA(double newtime) // R41 + { + struct tm *broken_down_time; + + //convert time from milliseconds + newtime=newtime/kMsecPerSecond; + + long int longint_time=(long int) newtime; + + //pull out a struct tm + broken_down_time = localtime( (const time_t*) &longint_time ); + + if (!broken_down_time) + { + return 0; + } + + if (broken_down_time->tm_isdst > 0) + { + //daylight saving is definitely in effect. + //return # of milliseconds in one hour. + return kMsecPerHour; + } + + //either daylight saving is not in effect, or we don't know (if tm_isdst is negative). + return 0; + } +} diff --git a/mozilla/js/tamarin/platform/arm/Makefile b/mozilla/js/tamarin/platform/arm/Makefile new file mode 100644 index 00000000000..19bbfe76332 --- /dev/null +++ b/mozilla/js/tamarin/platform/arm/Makefile @@ -0,0 +1,286 @@ +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# The contents of this file are subject to the Mozilla Public License Version 1.1 (the +# "License"); you may not use this file except in compliance with the License. You may obtain +# a copy of the License at http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +# WARRANTY OF ANY KIND, either express or implied. See the License for the specific +# language governing rights and limitations under the License. +# +# The Original Code is [Open Source Virtual Machine.] +# +# The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +# by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights +# Reserved. +# +# Contributor(s): Adobe AS3 Team +# +# Alternatively, the contents of this file may be used under the terms of either the GNU +# General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +# License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +# LGPL are applicable instead of those above. If you wish to allow use of your version of this +# file only under the terms of either the GPL or the LGPL, and not to allow others to use your +# version of this file under the terms of the MPL, indicate your decision by deleting provisions +# above and replace them with the notice and other provisions required by the GPL or the +# LGPL. If you do not delete the provisions above, a recipient may use your version of this file +# under the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** */ + + +# DEBUG can be set to YES to include debugging info, or NO otherwise +DEBUG := YES + +# Set to YES if doing ARM skunkworks +ARM_SKUNKWORKS := YES + +# Set to YES if using GNUARM toolchain +GNUARM := YES + +# Set to YES if a bflt executable desired +BFLT := NO + +CC := arm-elf-gcc +CXX := arm-elf-g++ +AR := arm-elf-ar + +ifeq (YES, ${ARM_SKUNKWORKS}) + ifeq (YES, ${GNUARM}) + SOFT_FLOAT := + GNUARM_DEF := -DAVMPLUS_GNUARM + else + SOFT_FLOAT := -msoft-float + GNUARM_DEF := + endif +else + SOFT_FLOAT := + GNUARM_DEF := +endif + +DEBUG_CFLAGS := -g ${SOFT_FLOAT} ${GNUARM_DEF} +RELEASE_CFLAGS := -O3 ${SOFT_FLOAT} ${GNUARM_DEF} + +ifeq (YES, ${BFLT}) + LDFLAGS := -elf2flt +else + LDFLAGS := +endif + +DEBUG_CXXFLAGS := ${DEBUG_CFLAGS} -fno-exceptions -fno-rtti +RELEASE_CXXFLAGS := ${RELEASE_CFLAGS} -fno-exceptions -fno-rtti + +ifeq (YES, ${DEBUG}) + CFLAGS := ${DEBUG_CFLAGS} + CXXFLAGS := ${DEBUG_CXXFLAGS} +else + CFLAGS := ${RELEASE_CFLAGS} + CXXFLAGS := ${RELEASE_CXXFLAGS} +endif + +#**************************************************************************** +# Preprocessor directives +#**************************************************************************** + +ifeq (YES, ${ARM_SKUNKWORKS}) + DEFS := -DUNIX -DCYGWIN -DAVMPLUS_ARM -DMMGC_ARM -DDEBUGGER -DENABLE_COMPILER -DAVMPLUS_CDECL -DAVMPLUS_UCLINUX +else + DEFS := -DUNIX -DAVMPLUS_IA32 -DDEBUGGER -DENABLE_COMPILER -DAVMPLUS_CDECL -DAVMPLUS_LINUX +endif + +CFLAGS := ${CFLAGS} ${DEFS} +CXXFLAGS := ${CXXFLAGS} ${DEFS} + +#**************************************************************************** +# Include paths +#**************************************************************************** + +INCS := -I../../core -I../../MMgc -I../../codegen -I../../regexp -I../../../../../zlib + +#**************************************************************************** +# Libraries +#**************************************************************************** + +LIBS := -L. -L../../MMgc -lavmplus -lmmgc +#-lpthread + +#**************************************************************************** +# Targets of the build +#**************************************************************************** + +AVMPLUS_OUTPUT := libavmplus.a + +SHELL_OUTPUT := avmplus + +all: ${SHELL_OUTPUT} ${AVMPLUS_OUTPUT} + +#**************************************************************************** +# Source files +#**************************************************************************** + +SHELL_SRCS := ../../../../../zlib/zutil.cpp \ + ../../../../../zlib/uncompr.cpp \ + ../../../../../zlib/trees.cpp \ + ../../../../../zlib/inftrees.cpp \ + ../../../../../zlib/inflate.cpp \ + ../../../../../zlib/inffast.cpp \ + ../../../../../zlib/infback.cpp \ + ../../../../../zlib/deflate.cpp \ + ../../../../../zlib/crc32.cpp \ + ../../../../../zlib/compress.cpp \ + ../../../../../zlib/adler32.cpp \ + ../../shell/TypedArrayClass.cpp \ + ../../shell/SystemClass.cpp \ + ../../shell/StringBuilderClass.cpp \ + ../../shell/FileInputStream.cpp \ + ../../shell/FileClass.cpp \ + ../../shell/DomainClass.cpp \ + ../../shell/DebugCLI.cpp \ + ../../shell/DataIO.cpp \ + ../../shell/ConsoleOutputStream.cpp \ + ../../shell/ByteArrayGlue.cpp \ + ../../shell/avmshell.cpp \ + ../../extensions/Dictionary.cpp + +# Use this target to generate a list of source files +gensrclist : + `find ../../core -type f -name "*.cpp" -printf "\t%p \134\n" > src.lst` + `find ../../regexp -type f -name "*.cpp" -printf "\t%p \134\n" >> src.lst` + `find ../unix -type f -name "*.cpp" -printf "\t%p \134\n" >> src.lst` + + +AVMPLUS_SRCS := ../../core/AbcEnv.cpp \ + ../../core/AbcGen.cpp \ + ../../core/AbcParser.cpp \ + ../../core/AbstractFunction.cpp \ + ../../core/Accessor.cpp \ + ../../core/ActionBlockConstants.cpp \ + ../../core/ArrayClass.cpp \ + ../../core/ArrayObject.cpp \ + ../../core/AtomArray.cpp \ + ../../core/AtomConstants.cpp \ + ../../core/AvmCore.cpp \ + ../../core/avmplus.cpp \ + ../../core/avmplusDebugger.cpp \ + ../../core/avmplusHashtable.cpp \ + ../../core/avmplusProfiler.cpp \ + ../../core/BigInteger.cpp \ + ../../core/BooleanClass.cpp \ + ../../core/builtin.cpp \ + ../../codegen/ArmAssembler.cpp \ + ../../codegen/CodegenMIR.cpp \ + ../../core/BuiltinTraits.cpp \ + ../../core/ClassClass.cpp \ + ../../core/ClassClosure.cpp \ + ../../core/Date.cpp \ + ../../core/DateClass.cpp \ + ../../core/DateObject.cpp \ + ../../core/Domain.cpp \ + ../../core/DomainEnv.cpp \ + ../../core/DynamicProfiler.cpp \ + ../../core/E4XNode.cpp \ + ../../core/ErrorClass.cpp \ + ../../core/ErrorConstants.cpp \ + ../../core/Exception.cpp \ + ../../core/FrameState.cpp \ + ../../core/FunctionClass.cpp \ + ../../core/GrowableBuffer.cpp \ + ../../core/IntClass.cpp \ + ../../core/Interpreter.cpp \ + ../../core/MathClass.cpp \ + ../../core/MathUtils.cpp \ + ../../core/MethodClosure.cpp \ + ../../core/MethodEnv.cpp \ + ../../core/MethodInfo.cpp \ + ../../core/Multiname.cpp \ + ../../core/MultinameHashtable.cpp \ + ../../core/Namespace.cpp \ + ../../core/NamespaceClass.cpp \ + ../../core/NamespaceSet.cpp \ + ../../core/NativeFunction.cpp \ + ../../core/NumberClass.cpp \ + ../../core/ObjectClass.cpp \ + ../../core/opcodes.cpp \ + ../../core/PoolObject.cpp \ + ../../core/PrintWriter.cpp \ + ../../core/RegExpClass.cpp \ + ../../core/RegExpObject.cpp \ + ../../core/ScopeChain.cpp \ + ../../core/ScriptBuffer.cpp \ + ../../core/ScriptObject.cpp \ + ../../core/StackTrace.cpp \ + ../../core/StaticProfiler.cpp \ + ../../core/StringBuffer.cpp \ + ../../core/StringClass.cpp \ + ../../core/StringObject.cpp \ + ../../core/Toplevel.cpp \ + ../../core/Traits.cpp \ + ../../core/UnicodeUtils.cpp \ + ../../core/Verifier.cpp \ + ../../core/VTable.cpp \ + ../../core/XMLClass.cpp \ + ../../core/XMLListClass.cpp \ + ../../core/XMLListObject.cpp \ + ../../core/XMLObject.cpp \ + ../../core/XMLParser16.cpp \ + ../../regexp/chartables.cpp \ + ../../regexp/pcre.cpp \ + ../arm/DateUnix.cpp \ + ../arm/MathUtilsUnix.cpp \ + ../arm/OSDepUnix.cpp + + +#**************************************************************************** +# Output +#**************************************************************************** + +AVMPLUS_OBJS := $(addsuffix .o,$(basename ${AVMPLUS_SRCS})) + +${AVMPLUS_OUTPUT}: ${AVMPLUS_OBJS} + ${AR} rcs $@ ${AVMPLUS_OBJS} + @echo "Done" + +SHELL_OBJS := $(addsuffix .o,$(basename ${SHELL_SRCS})) + +${SHELL_OUTPUT}: ${SHELL_OBJS} ${AVMPLUS_OUTPUT} + @echo "=== linking:" $@ "===" + @${CXX} -o $@ ${LDFLAGS} ${SHELL_OBJS} ${LIBS} ${EXTRA_LIBS} + @echo "=== done:" $@ "===" + +#**************************************************************************** +# Dependencies +#**************************************************************************** + +ALL_SRCS := ${AVMPLUS_SRCS} ${SHELL_SRCS} + +ALL_OBJS := ${AVMPLUS_OBJS} ${SHELL_OBJS} + +# Create a lists of object and .d files to create - +# one for each source file in the directory +DEPS := ${patsubst %${strip .cpp},%.d,${ALL_SRCS}} + +# make any non-existent make files (using the g++ preprocessor) +${DEPS} : %.d : %.cpp + ${CXX} ${CPPFLAGS} ${INCS} -MM $< > $@ + +#**************************************************************************** +# Rules +#**************************************************************************** + +# Rules for compiling source files to object files +%.o : %.cpp + @echo "=== compiling:" $@ ${OPT} + @${CXX} -c ${OPT} ${CXXFLAGS} -Wa,-ahld=$(addsuffix .s, $(basename $<)) ${INCS} $< -o $@ + +clean: + -rm -f core* ${ALL_OBJS} ${DEPS} ${SHELL_OUTPUT} ${AVMPLUS_OUTPUT} log outputdebug.txt + -rm -Rf ../../**/*.s + +install: + @cp -vf ${SHELL_OUTPUT} /home/mtilburg/bin/ + +#ifneq (${MAKECMDGOALS},clean) +#include ${DEPS} # include the generated make files, which make the object files +#endif + diff --git a/mozilla/js/tamarin/platform/arm/MathUtilsUnix.cpp b/mozilla/js/tamarin/platform/arm/MathUtilsUnix.cpp new file mode 100644 index 00000000000..2babb785b7f --- /dev/null +++ b/mozilla/js/tamarin/platform/arm/MathUtilsUnix.cpp @@ -0,0 +1,125 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 1993-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include + +#include "avmplus.h" + +namespace avmplus +{ + // todo need asm versions from Player + + double MathUtils::abs(double value) + { + return ::fabs(value); + } + + double MathUtils::acos(double value) + { + return ::acos(value); + } + + double MathUtils::asin(double value) + { + return ::asin(value); + } + + double MathUtils::atan(double value) + { + return ::atan(value); + } + + double MathUtils::atan2(double y, double x) + { + return ::atan2(y, x); + } + + double MathUtils::ceil(double value) + { + return ::ceil(value); + } + + double MathUtils::cos(double value) + { + return ::cos(value); + } + + double MathUtils::exp(double value) + { + return ::exp(value); + } + + double MathUtils::floor(double value) + { + return ::floor(value); + } + + uint64 MathUtils::frexp(double value, int *eptr) + { + double fracMantissa = ::frexp(value, eptr); + + // correct mantissa and eptr to get integer values + // for both + *eptr -= 53; // 52 mantissa bits + the hidden bit + return (uint64)(fracMantissa * (double)(1LL << 53)); + } + + double MathUtils::log(double value) + { + return ::log(value); + } + + double MathUtils::mod(double x, double y) + { + return ::fmod(x, y); + } + + double MathUtils::powInternal(double x, double y) + { + return ::pow(x, y); + } + + double MathUtils::sin(double value) + { + return ::sin(value); + } + + double MathUtils::sqrt(double value) + { + return ::sqrt(value); + } + + double MathUtils::tan(double value) + { + return ::tan(value); + } +} diff --git a/mozilla/js/tamarin/platform/arm/OSDepUnix.cpp b/mozilla/js/tamarin/platform/arm/OSDepUnix.cpp new file mode 100644 index 00000000000..f87073acb7a --- /dev/null +++ b/mozilla/js/tamarin/platform/arm/OSDepUnix.cpp @@ -0,0 +1,47 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 1993-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include +#include + +#include "avmplus.h" + +namespace avmplus +{ + uint64 OSDep::currentTimeMillis() + { + struct timeval tv; + ::gettimeofday(&tv, NULL); + uint64 result = (tv.tv_sec * 1000) + (tv.tv_usec / 1000); + return result; + } +} diff --git a/mozilla/js/tamarin/platform/mac/AvmDebugMac.cpp b/mozilla/js/tamarin/platform/mac/AvmDebugMac.cpp new file mode 100644 index 00000000000..7b4401dba6c --- /dev/null +++ b/mozilla/js/tamarin/platform/mac/AvmDebugMac.cpp @@ -0,0 +1,84 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmplus.h" + +#include +#include +#include + +#ifdef MEMORY_CHECK +#include +#include +#include +#endif + +namespace avmplus +{ + #ifdef DARWIN + void AvmDebugMsg(bool /*debuggerBreak*/, const char* format, ...) + { + va_list ap; + va_start(ap, format); + vfprintf(stderr, format, ap); + putc('\n', stderr); + va_end(ap); + } + + void AvmDebugMsg(const char* p, bool /*debugBreak*/) + { + fprintf(stderr, "%s\n", p); + } + #else + void AvmDebugMsg(bool debuggerBreak, const char* format, ...) + { + char buf[4096]; + va_list args; + va_start(args, format); + + vsprintf(buf, format, args); + va_end(args); + if(debuggerBreak) + { + AvmDebugMsg(buf, debuggerBreak); + } + } + + void AvmDebugMsg(const char* p, bool debugBreak) + { + char buf[256]; + strcpy(buf, p); + ::CopyCStringToPascal(buf, (StringPtr)buf); + DebugStr((StringPtr) buf); + } + #endif +} diff --git a/mozilla/js/tamarin/platform/mac/DateMac.cpp b/mozilla/js/tamarin/platform/mac/DateMac.cpp new file mode 100644 index 00000000000..11d0819d0ff --- /dev/null +++ b/mozilla/js/tamarin/platform/mac/DateMac.cpp @@ -0,0 +1,242 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#include "avmplus.h" +#include "DateMac.h" + +#include + +namespace avmplus +{ + double UTC(double t); + + namespace MacDateTime + { + /** + * Constants used internally + */ + const int kMsecPerSecond = 1000; + const int kMsecPerDay = 86400000; + const int kMsecPerHour = 3600000; + const int kMsecPerMinute = 60000; + const unsigned long kMacEpochBias = 2082844800; + const double kTwoPower32 = (4294967296.0); /* 2^32 */ + + double g_timeAtStartup; + UnsignedWide g_microsecondsAtStartup; + + /** + * Core Foundation internal functions + */ + CFAbsoluteTime ECMADateToCFAbsoluteTime(double ecmaDate); + double CFAbsoluteTimeToECMADate(CFAbsoluteTime time); + + /** + * Classic internal functions + */ + void ReadMachineLocation(MachineLocation* loc); + void MicrosecondDelta(register const UnsignedWide *startPtr, + register const UnsignedWide *endPtr, + register UnsignedWide *resultPtr); + + /** + * MacDateTime::ECMADateToCFAbsoluteTime + * + * Converts an ECMAscript time (milliseconds since Jan 1 1970 GMT) + * to a Macintosh CFAbsoluteTime. + */ + CFAbsoluteTime MacDateTime::ECMADateToCFAbsoluteTime(double ecmaDate) + { + CFAbsoluteTime result = ecmaDate; + + // ECMAScript times are in milliseconds, CFAbsoluteTime + // is in seconds. + result /= kMsecPerSecond; + + // ECMAScript time is based at January 1 1970 midnight GMT. + result -= kCFAbsoluteTimeIntervalSince1970; + + return result; + } + + /** + * MacDateTime::ECMADateToCFAbsoluteTime + * + * Converts a CFAbsoluteTime to an ECMAscript time (milliseconds since + * Jan 1 1970 GMT) + */ + double MacDateTime::CFAbsoluteTimeToECMADate(CFAbsoluteTime time) + { + double result = time; + + // ECMAScript time is based at January 1 1970 midnight GMT. + result += kCFAbsoluteTimeIntervalSince1970; + + // ECMAScript times are in milliseconds, CFAbsoluteTime + // is in seconds. + result *= kMsecPerSecond; + + return result; + } + + /** + * MacDateTime::ReadMachineLocation + * + * (Classic) Reads the machine location, for determining time zone + * and Daylight Saving Time + */ + void MacDateTime::ReadMachineLocation(MachineLocation* loc) + { + static MachineLocation gStoredLoc; + static bool gDidReadLocation = false; + if (!gDidReadLocation) { + ::ReadLocation(&gStoredLoc); + gDidReadLocation = true; + } + *loc = gStoredLoc; + } + + /** + * MacDateTime::LocalTZA + * + * Determines the Local Time Zone Adjustment, in seconds from GMT + */ + double MacDateTime::LocalTZA(double time) + { + CFTimeZoneRef tz = CFTimeZoneCopySystem(); + if (tz) + { + CFAbsoluteTime at = ECMADateToCFAbsoluteTime(time); + // pass now as the reference. + // This will include any daylight savings offsets in the result. + CFTimeInterval result = CFTimeZoneGetSecondsFromGMT(tz, at); + + CFRelease(tz); + + result *= kMsecPerSecond; + + // Remove the effects of daylight saving time + return ( result -= MacDateTime::DaylightSavingTA(time) ); + } + + MachineLocation location; + ReadMachineLocation(&location); + + // Extract the GMT delta + long gmtDelta = location.u.gmtDelta & 0xFFFFFF; + if (gmtDelta & 0x800000) { + gmtDelta |= 0xFF000000; + } + + // Remove the effects of daylight saving time + if (location.u.dlsDelta < 0) { + gmtDelta -= 3600; + } + + return (double)gmtDelta * kMsecPerSecond; + } + + /** + * MacDateTime::DaylightSavingTA + * + * Determines whether the specified time is affected by + * Daylight Saving Time in the current system time zone + */ + double MacDateTime::DaylightSavingTA(double time) + { + CFTimeZoneRef tz = CFTimeZoneCopyDefault(); + if (tz) { + CFAbsoluteTime at = ECMADateToCFAbsoluteTime(time); + Boolean isDST = CFTimeZoneIsDaylightSavingTime(tz, at); + CFRelease(tz); + return (isDST ? kMsecPerHour : 0); + } + + time; + + // On Macintosh, punt and just report the daylight + // saving adjustment currently in effect, rather + // than the daylight saving time adjustment for the + // exact time passed in. + MachineLocation location; + ReadMachineLocation(&location); + return (location.u.dlsDelta < 0) ? kMsecPerHour : 0; + } + + /** + * MacDateTime::MicrosecondDelta + * + * Determines the interval between two Macintosh "Microseconds" 64-bit + * quantities. + */ + void MacDateTime::MicrosecondDelta(register const UnsignedWide *startPtr, + register const UnsignedWide *endPtr, + register UnsignedWide *resultPtr) + { + if (endPtr->lo >= startPtr->lo) { + resultPtr->hi = endPtr->hi - startPtr->hi; + } else { + resultPtr->hi = (endPtr->hi - 1) - startPtr->hi; + } + resultPtr->lo = endPtr->lo - startPtr->lo; + } + + /** + * MacDateTime::GetTime + * + * Returns the ECMAscript time (milliseconds since Jan 1 1970 GMT) + */ + double MacDateTime::GetTime() + { + CFAbsoluteTime at = CFAbsoluteTimeGetCurrent(); + return CFAbsoluteTimeToECMADate(at); + } + + /** + * MacDateTime::GetMsecCount + * + * Returns the number of milliseconds since system startup time, + * in a 64-bit integer. + */ + uint64 MacDateTime::GetMsecCount() + { + UnsignedWide microsecs; + ::Microseconds(µsecs); + + UInt64 usecs; + UInt64 divisor = 1000; + memcpy(&usecs, µsecs, sizeof(usecs)); + + return usecs / divisor; + } + } +} + diff --git a/mozilla/js/tamarin/platform/mac/DateMac.h b/mozilla/js/tamarin/platform/mac/DateMac.h new file mode 100644 index 00000000000..5fef23558b5 --- /dev/null +++ b/mozilla/js/tamarin/platform/mac/DateMac.h @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmplus_DateMac__ +#define __avmplus_DateMac__ + +namespace avmplus +{ + /** + * MacDateTime + * + * Date/time support code for Macintosh + */ + namespace MacDateTime + { + // Entry points + double LocalTZA(double time); + double GetTime(); + double DaylightSavingTA(double time); + uint64 GetMsecCount(); + } +} + +#endif /* __avmplus_DateMac__ */ diff --git a/mozilla/js/tamarin/platform/mac/MMgc/MMgc.xcodeproj/project.pbxproj b/mozilla/js/tamarin/platform/mac/MMgc/MMgc.xcodeproj/project.pbxproj new file mode 100644 index 00000000000..896917f1e31 --- /dev/null +++ b/mozilla/js/tamarin/platform/mac/MMgc/MMgc.xcodeproj/project.pbxproj @@ -0,0 +1,495 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 42; + objects = { + +/* Begin PBXBuildFile section */ + 1E60773C09733377007D0E1E /* FixedAlloc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E60771109733377007D0E1E /* FixedAlloc.cpp */; }; + 1E60773D09733377007D0E1E /* FixedAlloc.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E60771209733377007D0E1E /* FixedAlloc.h */; }; + 1E60773E09733377007D0E1E /* FixedMalloc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E60771309733377007D0E1E /* FixedMalloc.cpp */; }; + 1E60773F09733377007D0E1E /* FixedMalloc.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E60771409733377007D0E1E /* FixedMalloc.h */; }; + 1E60774009733377007D0E1E /* GC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E60771509733377007D0E1E /* GC.cpp */; }; + 1E60774109733377007D0E1E /* GC.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E60771609733377007D0E1E /* GC.h */; }; + 1E60774209733377007D0E1E /* GCAlloc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E60771709733377007D0E1E /* GCAlloc.cpp */; }; + 1E60774309733377007D0E1E /* GCAlloc.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E60771809733377007D0E1E /* GCAlloc.h */; }; + 1E60774609733377007D0E1E /* GCAllocObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E60771B09733377007D0E1E /* GCAllocObject.h */; }; + 1E60774709733377007D0E1E /* GCAllocObjectMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E60771C09733377007D0E1E /* GCAllocObjectMac.cpp */; }; + 1E60774A09733377007D0E1E /* GCDebug.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E60771F09733377007D0E1E /* GCDebug.h */; }; + 1E60774B09733377007D0E1E /* GCDebugMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E60772009733377007D0E1E /* GCDebugMac.cpp */; }; + 1E60774E09733377007D0E1E /* GCHashtable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E60772309733377007D0E1E /* GCHashtable.cpp */; }; + 1E60774F09733377007D0E1E /* GCHashtable.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E60772409733377007D0E1E /* GCHashtable.h */; }; + 1E60775009733377007D0E1E /* GCHeap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E60772509733377007D0E1E /* GCHeap.cpp */; }; + 1E60775109733377007D0E1E /* GCHeap.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E60772609733377007D0E1E /* GCHeap.h */; }; + 1E60775209733377007D0E1E /* GCHeapMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E60772709733377007D0E1E /* GCHeapMac.cpp */; }; + 1E60775509733377007D0E1E /* GCLargeAlloc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E60772A09733377007D0E1E /* GCLargeAlloc.cpp */; }; + 1E60775609733377007D0E1E /* GCLargeAlloc.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E60772B09733377007D0E1E /* GCLargeAlloc.h */; }; + 1E60775709733377007D0E1E /* GCMemoryProfiler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E60772C09733377007D0E1E /* GCMemoryProfiler.cpp */; }; + 1E60775809733377007D0E1E /* GCMemoryProfiler.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E60772D09733377007D0E1E /* GCMemoryProfiler.h */; }; + 1E60775909733377007D0E1E /* GCObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E60772E09733377007D0E1E /* GCObject.cpp */; }; + 1E60775A09733377007D0E1E /* GCObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E60772F09733377007D0E1E /* GCObject.h */; }; + 1E60775C09733377007D0E1E /* GCSpinLockMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E60773109733377007D0E1E /* GCSpinLockMac.h */; }; + 1E60775E09733377007D0E1E /* GCStack.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E60773309733377007D0E1E /* GCStack.h */; }; + 1E60775F09733377007D0E1E /* GCTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E60773409733377007D0E1E /* GCTests.cpp */; }; + 1E60776009733377007D0E1E /* GCTests.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E60773509733377007D0E1E /* GCTests.h */; }; + 1E60776109733377007D0E1E /* GCTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E60773609733377007D0E1E /* GCTypes.h */; }; + 1E60776209733377007D0E1E /* GCWeakRef.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E60773709733377007D0E1E /* GCWeakRef.h */; }; + 1E60776409733377007D0E1E /* macbuild.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E60773909733377007D0E1E /* macbuild.h */; }; + 1E60776509733377007D0E1E /* MMgc.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E60773A09733377007D0E1E /* MMgc.h */; }; + 1E60776609733377007D0E1E /* WriteBarrier.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E60773B09733377007D0E1E /* WriteBarrier.h */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 1E60771109733377007D0E1E /* FixedAlloc.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = FixedAlloc.cpp; path = ../../../MMgc/FixedAlloc.cpp; sourceTree = SOURCE_ROOT; }; + 1E60771209733377007D0E1E /* FixedAlloc.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = FixedAlloc.h; path = ../../../MMgc/FixedAlloc.h; sourceTree = SOURCE_ROOT; }; + 1E60771309733377007D0E1E /* FixedMalloc.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = FixedMalloc.cpp; path = ../../../MMgc/FixedMalloc.cpp; sourceTree = SOURCE_ROOT; }; + 1E60771409733377007D0E1E /* FixedMalloc.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = FixedMalloc.h; path = ../../../MMgc/FixedMalloc.h; sourceTree = SOURCE_ROOT; }; + 1E60771509733377007D0E1E /* GC.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = GC.cpp; path = ../../../MMgc/GC.cpp; sourceTree = SOURCE_ROOT; }; + 1E60771609733377007D0E1E /* GC.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = GC.h; path = ../../../MMgc/GC.h; sourceTree = SOURCE_ROOT; }; + 1E60771709733377007D0E1E /* GCAlloc.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = GCAlloc.cpp; path = ../../../MMgc/GCAlloc.cpp; sourceTree = SOURCE_ROOT; }; + 1E60771809733377007D0E1E /* GCAlloc.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = GCAlloc.h; path = ../../../MMgc/GCAlloc.h; sourceTree = SOURCE_ROOT; }; + 1E60771B09733377007D0E1E /* GCAllocObject.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = GCAllocObject.h; path = ../../../MMgc/GCAllocObject.h; sourceTree = SOURCE_ROOT; }; + 1E60771C09733377007D0E1E /* GCAllocObjectMac.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = GCAllocObjectMac.cpp; path = ../../../MMgc/GCAllocObjectMac.cpp; sourceTree = SOURCE_ROOT; }; + 1E60771F09733377007D0E1E /* GCDebug.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = GCDebug.h; path = ../../../MMgc/GCDebug.h; sourceTree = SOURCE_ROOT; }; + 1E60772009733377007D0E1E /* GCDebugMac.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = GCDebugMac.cpp; path = ../../../MMgc/GCDebugMac.cpp; sourceTree = SOURCE_ROOT; }; + 1E60772309733377007D0E1E /* GCHashtable.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = GCHashtable.cpp; path = ../../../MMgc/GCHashtable.cpp; sourceTree = SOURCE_ROOT; }; + 1E60772409733377007D0E1E /* GCHashtable.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = GCHashtable.h; path = ../../../MMgc/GCHashtable.h; sourceTree = SOURCE_ROOT; }; + 1E60772509733377007D0E1E /* GCHeap.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = GCHeap.cpp; path = ../../../MMgc/GCHeap.cpp; sourceTree = SOURCE_ROOT; }; + 1E60772609733377007D0E1E /* GCHeap.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = GCHeap.h; path = ../../../MMgc/GCHeap.h; sourceTree = SOURCE_ROOT; }; + 1E60772709733377007D0E1E /* GCHeapMac.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = GCHeapMac.cpp; path = ../../../MMgc/GCHeapMac.cpp; sourceTree = SOURCE_ROOT; }; + 1E60772A09733377007D0E1E /* GCLargeAlloc.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = GCLargeAlloc.cpp; path = ../../../MMgc/GCLargeAlloc.cpp; sourceTree = SOURCE_ROOT; }; + 1E60772B09733377007D0E1E /* GCLargeAlloc.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = GCLargeAlloc.h; path = ../../../MMgc/GCLargeAlloc.h; sourceTree = SOURCE_ROOT; }; + 1E60772C09733377007D0E1E /* GCMemoryProfiler.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = GCMemoryProfiler.cpp; path = ../../../MMgc/GCMemoryProfiler.cpp; sourceTree = SOURCE_ROOT; }; + 1E60772D09733377007D0E1E /* GCMemoryProfiler.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = GCMemoryProfiler.h; path = ../../../MMgc/GCMemoryProfiler.h; sourceTree = SOURCE_ROOT; }; + 1E60772E09733377007D0E1E /* GCObject.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = GCObject.cpp; path = ../../../MMgc/GCObject.cpp; sourceTree = SOURCE_ROOT; }; + 1E60772F09733377007D0E1E /* GCObject.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = GCObject.h; path = ../../../MMgc/GCObject.h; sourceTree = SOURCE_ROOT; }; + 1E60773109733377007D0E1E /* GCSpinLockMac.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = GCSpinLockMac.h; path = ../../../MMgc/GCSpinLockMac.h; sourceTree = SOURCE_ROOT; }; + 1E60773309733377007D0E1E /* GCStack.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = GCStack.h; path = ../../../MMgc/GCStack.h; sourceTree = SOURCE_ROOT; }; + 1E60773409733377007D0E1E /* GCTests.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = GCTests.cpp; path = ../../../MMgc/GCTests.cpp; sourceTree = SOURCE_ROOT; }; + 1E60773509733377007D0E1E /* GCTests.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = GCTests.h; path = ../../../MMgc/GCTests.h; sourceTree = SOURCE_ROOT; }; + 1E60773609733377007D0E1E /* GCTypes.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = GCTypes.h; path = ../../../MMgc/GCTypes.h; sourceTree = SOURCE_ROOT; }; + 1E60773709733377007D0E1E /* GCWeakRef.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = GCWeakRef.h; path = ../../../MMgc/GCWeakRef.h; sourceTree = SOURCE_ROOT; }; + 1E60773909733377007D0E1E /* macbuild.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = macbuild.h; path = ../../../MMgc/macbuild.h; sourceTree = SOURCE_ROOT; }; + 1E60773A09733377007D0E1E /* MMgc.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = MMgc.h; path = ../../../MMgc/MMgc.h; sourceTree = SOURCE_ROOT; }; + 1E60773B09733377007D0E1E /* WriteBarrier.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = WriteBarrier.h; path = ../../../MMgc/WriteBarrier.h; sourceTree = SOURCE_ROOT; }; + D2AAC046055464E500DB518D /* libMMgc.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libMMgc.a; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + D289987405E68DCB004EDB86 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 08FB7794FE84155DC02AAC07 /* MMgc */ = { + isa = PBXGroup; + children = ( + 08FB7795FE84155DC02AAC07 /* Source */, + C6A0FF2B0290797F04C91782 /* Documentation */, + 1AB674ADFE9D54B511CA2CBB /* Products */, + ); + name = MMgc; + sourceTree = ""; + }; + 08FB7795FE84155DC02AAC07 /* Source */ = { + isa = PBXGroup; + children = ( + 1E60771109733377007D0E1E /* FixedAlloc.cpp */, + 1E60771209733377007D0E1E /* FixedAlloc.h */, + 1E60771309733377007D0E1E /* FixedMalloc.cpp */, + 1E60771409733377007D0E1E /* FixedMalloc.h */, + 1E60771509733377007D0E1E /* GC.cpp */, + 1E60771609733377007D0E1E /* GC.h */, + 1E60771709733377007D0E1E /* GCAlloc.cpp */, + 1E60771809733377007D0E1E /* GCAlloc.h */, + 1E60771B09733377007D0E1E /* GCAllocObject.h */, + 1E60771C09733377007D0E1E /* GCAllocObjectMac.cpp */, + 1E60771F09733377007D0E1E /* GCDebug.h */, + 1E60772009733377007D0E1E /* GCDebugMac.cpp */, + 1E60772309733377007D0E1E /* GCHashtable.cpp */, + 1E60772409733377007D0E1E /* GCHashtable.h */, + 1E60772509733377007D0E1E /* GCHeap.cpp */, + 1E60772609733377007D0E1E /* GCHeap.h */, + 1E60772709733377007D0E1E /* GCHeapMac.cpp */, + 1E60772A09733377007D0E1E /* GCLargeAlloc.cpp */, + 1E60772B09733377007D0E1E /* GCLargeAlloc.h */, + 1E60772C09733377007D0E1E /* GCMemoryProfiler.cpp */, + 1E60772D09733377007D0E1E /* GCMemoryProfiler.h */, + 1E60772E09733377007D0E1E /* GCObject.cpp */, + 1E60772F09733377007D0E1E /* GCObject.h */, + 1E60773109733377007D0E1E /* GCSpinLockMac.h */, + 1E60773309733377007D0E1E /* GCStack.h */, + 1E60773409733377007D0E1E /* GCTests.cpp */, + 1E60773509733377007D0E1E /* GCTests.h */, + 1E60773609733377007D0E1E /* GCTypes.h */, + 1E60773709733377007D0E1E /* GCWeakRef.h */, + 1E60773909733377007D0E1E /* macbuild.h */, + 1E60773A09733377007D0E1E /* MMgc.h */, + 1E60773B09733377007D0E1E /* WriteBarrier.h */, + ); + name = Source; + sourceTree = ""; + }; + 1AB674ADFE9D54B511CA2CBB /* Products */ = { + isa = PBXGroup; + children = ( + D2AAC046055464E500DB518D /* libMMgc.a */, + ); + name = Products; + sourceTree = ""; + }; + C6A0FF2B0290797F04C91782 /* Documentation */ = { + isa = PBXGroup; + children = ( + ); + name = Documentation; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + D2AAC043055464E500DB518D /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 1E60773D09733377007D0E1E /* FixedAlloc.h in Headers */, + 1E60773F09733377007D0E1E /* FixedMalloc.h in Headers */, + 1E60774109733377007D0E1E /* GC.h in Headers */, + 1E60774309733377007D0E1E /* GCAlloc.h in Headers */, + 1E60774609733377007D0E1E /* GCAllocObject.h in Headers */, + 1E60774A09733377007D0E1E /* GCDebug.h in Headers */, + 1E60774F09733377007D0E1E /* GCHashtable.h in Headers */, + 1E60775109733377007D0E1E /* GCHeap.h in Headers */, + 1E60775609733377007D0E1E /* GCLargeAlloc.h in Headers */, + 1E60775809733377007D0E1E /* GCMemoryProfiler.h in Headers */, + 1E60775A09733377007D0E1E /* GCObject.h in Headers */, + 1E60775C09733377007D0E1E /* GCSpinLockMac.h in Headers */, + 1E60775E09733377007D0E1E /* GCStack.h in Headers */, + 1E60776009733377007D0E1E /* GCTests.h in Headers */, + 1E60776109733377007D0E1E /* GCTypes.h in Headers */, + 1E60776209733377007D0E1E /* GCWeakRef.h in Headers */, + 1E60776409733377007D0E1E /* macbuild.h in Headers */, + 1E60776509733377007D0E1E /* MMgc.h in Headers */, + 1E60776609733377007D0E1E /* WriteBarrier.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + D2AAC045055464E500DB518D /* MMgc */ = { + isa = PBXNativeTarget; + buildConfigurationList = 1DEB91EB08733DB70010E9CD /* Build configuration list for PBXNativeTarget "MMgc" */; + buildPhases = ( + D2AAC043055464E500DB518D /* Headers */, + D2AAC044055464E500DB518D /* Sources */, + D289987405E68DCB004EDB86 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = MMgc; + productName = MMgc; + productReference = D2AAC046055464E500DB518D /* libMMgc.a */; + productType = "com.apple.product-type.library.static"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 08FB7793FE84155DC02AAC07 /* Project object */ = { + isa = PBXProject; + buildConfigurationList = 1DEB91EF08733DB70010E9CD /* Build configuration list for PBXProject "MMgc" */; + hasScannedForEncodings = 1; + mainGroup = 08FB7794FE84155DC02AAC07 /* MMgc */; + projectDirPath = ""; + targets = ( + D2AAC045055464E500DB518D /* MMgc */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXSourcesBuildPhase section */ + D2AAC044055464E500DB518D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 1E60773C09733377007D0E1E /* FixedAlloc.cpp in Sources */, + 1E60773E09733377007D0E1E /* FixedMalloc.cpp in Sources */, + 1E60774009733377007D0E1E /* GC.cpp in Sources */, + 1E60774209733377007D0E1E /* GCAlloc.cpp in Sources */, + 1E60774709733377007D0E1E /* GCAllocObjectMac.cpp in Sources */, + 1E60774B09733377007D0E1E /* GCDebugMac.cpp in Sources */, + 1E60774E09733377007D0E1E /* GCHashtable.cpp in Sources */, + 1E60775009733377007D0E1E /* GCHeap.cpp in Sources */, + 1E60775209733377007D0E1E /* GCHeapMac.cpp in Sources */, + 1E60775509733377007D0E1E /* GCLargeAlloc.cpp in Sources */, + 1E60775709733377007D0E1E /* GCMemoryProfiler.cpp in Sources */, + 1E60775909733377007D0E1E /* GCObject.cpp in Sources */, + 1E60775F09733377007D0E1E /* GCTests.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 1DEB91EC08733DB70010E9CD /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(NATIVE_ARCH)"; + COPY_PHASE_STRIP = NO; + GCC_ALTIVEC_EXTENSIONS = YES; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_CPP_EXCEPTIONS = YES; + GCC_ENABLE_CPP_RTTI = YES; + GCC_ENABLE_FIX_AND_CONTINUE = YES; + GCC_MODEL_TUNING = G5; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + __DEBUGGING__, + _MAC, + "DARWIN=1", + "TARGET_API_MAC_CARBON=1", + "TARGET_RT_MAC_MACHO=1", + USE_MMAP, + _MAC, + DEBUG, + _DEBUG, + ENABLE_PROFILER, + ENABLE_COMPILER, + SOFT_ASSERTS, + ); + INSTALL_PATH = /usr/local/lib; + PRODUCT_NAME = MMgc; + USER_HEADER_SEARCH_PATHS = "$(USER_HEADER_SEARCH_PATHS) ../../../codegen ../../../core"; + ZERO_LINK = NO; + }; + name = Debug; + }; + 1DEB91ED08733DB70010E9CD /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = ( + ppc, + i386, + ); + GCC_ALTIVEC_EXTENSIONS = YES; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_CPP_EXCEPTIONS = NO; + GCC_ENABLE_CPP_RTTI = NO; + GCC_GENERATE_DEBUGGING_SYMBOLS = NO; + GCC_MODEL_TUNING = G5; + GCC_OPTIMIZATION_LEVEL = s; + GCC_PREPROCESSOR_DEFINITIONS = ( + __DEBUGGING__, + _MAC, + "DARWIN=1", + "TARGET_API_MAC_CARBON=1", + "TARGET_RT_MAC_MACHO=1", + SOFT_ASSERTS, + USE_MMAP, + _MAC, + ); + INSTALL_PATH = /usr/local/lib; + OTHER_CFLAGS = ( + "-finline-functions", + "-finline-limit=256", + ); + PRODUCT_NAME = MMgc; + USER_HEADER_SEARCH_PATHS = "$(USER_HEADER_SEARCH_PATHS) ../../../codegen ../../../core"; + }; + name = Release; + }; + 1DEB91F008733DB70010E9CD /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)"; + DEBUG_INFORMATION_FORMAT = dwarf; + GCC_TREAT_WARNINGS_AS_ERRORS = YES; + GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO; + GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = NO; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; + GCC_WARN_MISSING_PARENTHESES = YES; + GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; + GCC_WARN_UNUSED_LABEL = YES; + GCC_WARN_UNUSED_PARAMETER = YES; + GCC_WARN_UNUSED_VALUE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + PREBINDING = NO; + SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; + SYMROOT = "$(PROJECT_DIR)/../../../../platform/mac/flash/Builds"; + }; + name = Debug; + }; + 1DEB91F108733DB70010E9CD /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)"; + DEBUG_INFORMATION_FORMAT = dwarf; + GCC_TREAT_WARNINGS_AS_ERRORS = YES; + GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO; + GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = NO; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; + GCC_WARN_MISSING_PARENTHESES = YES; + GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_LABEL = YES; + GCC_WARN_UNUSED_PARAMETER = YES; + GCC_WARN_UNUSED_VALUE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + PREBINDING = NO; + SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; + SYMROOT = "$(PROJECT_DIR)/../../../../platform/mac/flash/Builds"; + }; + name = Release; + }; + 8E8B52F709AABCC40057BEE4 /* Debug Debugger */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(NATIVE_ARCH)"; + COPY_PHASE_STRIP = NO; + GCC_ALTIVEC_EXTENSIONS = YES; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_CPP_EXCEPTIONS = YES; + GCC_ENABLE_CPP_RTTI = YES; + GCC_ENABLE_FIX_AND_CONTINUE = YES; + GCC_MODEL_TUNING = G5; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + __DEBUGGING__, + _MAC, + "DARWIN=1", + "TARGET_API_MAC_CARBON=1", + "TARGET_RT_MAC_MACHO=1", + USE_MMAP, + _MAC, + DEBUG, + _DEBUG, + ENABLE_PROFILER, + ENABLE_COMPILER, + SOFT_ASSERTS, + ); + INSTALL_PATH = /usr/local/lib; + PRODUCT_NAME = MMgc; + USER_HEADER_SEARCH_PATHS = "$(USER_HEADER_SEARCH_PATHS) ../../../codegen ../../../core"; + ZERO_LINK = NO; + }; + name = "Debug Debugger"; + }; + 8E8B52F809AABCC40057BEE4 /* Release Debugger */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = ( + ppc, + i386, + ); + GCC_ALTIVEC_EXTENSIONS = YES; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_CPP_EXCEPTIONS = NO; + GCC_ENABLE_CPP_RTTI = NO; + GCC_GENERATE_DEBUGGING_SYMBOLS = NO; + GCC_MODEL_TUNING = G5; + GCC_OPTIMIZATION_LEVEL = s; + GCC_PREPROCESSOR_DEFINITIONS = ( + SOFT_ASSERTS, + __DEBUGGING__, + _MAC, + "DARWIN=1", + "TARGET_API_MAC_CARBON=1", + "TARGET_RT_MAC_MACHO=1", + USE_MMAP, + _MAC, + ); + INSTALL_PATH = /usr/local/lib; + OTHER_CFLAGS = ( + "-finline-functions", + "-finline-limit=256", + ); + PRODUCT_NAME = MMgc; + USER_HEADER_SEARCH_PATHS = "$(USER_HEADER_SEARCH_PATHS) ../../../codegen ../../../core"; + }; + name = "Release Debugger"; + }; + 8E8B52F909AABCC40057BEE4 /* Debug Debugger */ = { + isa = XCBuildConfiguration; + buildSettings = { + CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)"; + DEBUG_INFORMATION_FORMAT = dwarf; + GCC_TREAT_WARNINGS_AS_ERRORS = YES; + GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO; + GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = NO; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; + GCC_WARN_MISSING_PARENTHESES = YES; + GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; + GCC_WARN_UNUSED_LABEL = YES; + GCC_WARN_UNUSED_PARAMETER = YES; + GCC_WARN_UNUSED_VALUE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + PREBINDING = NO; + SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; + SYMROOT = "$(PROJECT_DIR)/../../../../platform/mac/flash/Builds"; + }; + name = "Debug Debugger"; + }; + 8E8B52FA09AABCC40057BEE4 /* Release Debugger */ = { + isa = XCBuildConfiguration; + buildSettings = { + CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)"; + DEBUG_INFORMATION_FORMAT = dwarf; + GCC_TREAT_WARNINGS_AS_ERRORS = YES; + GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO; + GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = NO; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; + GCC_WARN_MISSING_PARENTHESES = YES; + GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_LABEL = YES; + GCC_WARN_UNUSED_PARAMETER = YES; + GCC_WARN_UNUSED_VALUE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + PREBINDING = NO; + SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; + SYMROOT = "$(PROJECT_DIR)/../../../../platform/mac/flash/Builds"; + }; + name = "Release Debugger"; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 1DEB91EB08733DB70010E9CD /* Build configuration list for PBXNativeTarget "MMgc" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1DEB91EC08733DB70010E9CD /* Debug */, + 8E8B52F709AABCC40057BEE4 /* Debug Debugger */, + 1DEB91ED08733DB70010E9CD /* Release */, + 8E8B52F809AABCC40057BEE4 /* Release Debugger */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 1DEB91EF08733DB70010E9CD /* Build configuration list for PBXProject "MMgc" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1DEB91F008733DB70010E9CD /* Debug */, + 8E8B52F909AABCC40057BEE4 /* Debug Debugger */, + 1DEB91F108733DB70010E9CD /* Release */, + 8E8B52FA09AABCC40057BEE4 /* Release Debugger */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 08FB7793FE84155DC02AAC07 /* Project object */; +} diff --git a/mozilla/js/tamarin/platform/mac/Makefile b/mozilla/js/tamarin/platform/mac/Makefile new file mode 100644 index 00000000000..6fd97720069 --- /dev/null +++ b/mozilla/js/tamarin/platform/mac/Makefile @@ -0,0 +1,262 @@ +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# The contents of this file are subject to the Mozilla Public License Version 1.1 (the +# "License"); you may not use this file except in compliance with the License. You may obtain +# a copy of the License at http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +# WARRANTY OF ANY KIND, either express or implied. See the License for the specific +# language governing rights and limitations under the License. +# +# The Original Code is [Open Source Virtual Machine.] +# +# The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +# by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights +# Reserved. +# +# Contributor(s): Adobe AS3 Team +# +# Alternatively, the contents of this file may be used under the terms of either the GNU +# General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +# License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +# LGPL are applicable instead of those above. If you wish to allow use of your version of this +# file only under the terms of either the GPL or the LGPL, and not to allow others to use your +# version of this file under the terms of the MPL, indicate your decision by deleting provisions +# above and replace them with the notice and other provisions required by the GPL or the +# LGPL. If you do not delete the provisions above, a recipient may use your version of this file +# under the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** */ + + +# DEBUG can be set to YES to include debugging info, or NO otherwise +DEBUG := YES + +CC := gcc +CXX := g++ +AR := ar + +DEBUG_CFLAGS := -g -D_DEBUG +RELEASE_CFLAGS := -O2 + +DEBUG_CXXFLAGS := ${DEBUG_CFLAGS} -fno-exceptions -fno-rtti -fcheck-new +RELEASE_CXXFLAGS := ${RELEASE_CFLAGS} -fno-exceptions -fno-rtti -fcheck-new + +ifeq (YES, ${DEBUG}) + CFLAGS := ${DEBUG_CFLAGS} + CXXFLAGS := ${DEBUG_CXXFLAGS} +else + CFLAGS := ${RELEASE_CFLAGS} + CXXFLAGS := ${RELEASE_CXXFLAGS} +endif + +#**************************************************************************** +# Preprocessor directives +#**************************************************************************** + +ARCH := $(shell uname -m) + +DEFS := -DMEMORY_INFO -DSOFT_ASSERTS -D_MAC -DAVMPLUS_MAC -DAVMPLUS_SHELL -DDARWIN -DUNIX -DDEBUGGER -DENABLE_COMPILER -DTARGET_RT_MAC_MACHO=1 + +ifeq (i386, ${ARCH}) + DEFS := -DAVMPLUS_IA32 ${DEFS} +else + DEFS := -DAVMPLUS_PPC ${DEFS} +endif + +CFLAGS := ${CFLAGS} ${DEFS} +CXXFLAGS := ${CXXFLAGS} ${DEFS} + +#**************************************************************************** +# Include paths +#**************************************************************************** + +INCS := -I../../core -I../../MMgc -I../../extensions -I../../codegen -I../../pcre -I../../shell + +#**************************************************************************** +# Libraries +#**************************************************************************** + +LIBS := -L. -L../../MMgc -lavmplus -lmmgc -framework Carbon + +#**************************************************************************** +# Targets of the build +#**************************************************************************** + +AVMPLUS_OUTPUT := libavmplus.a + +SHELL_OUTPUT := avmplus.out + +all: ${SHELL_OUTPUT} ${AVMPLUS_OUTPUT} + +#**************************************************************************** +# Source files +#**************************************************************************** + +SHELL_SRCS := ../../shell/avmshell.cpp \ + ../../shell/ByteArrayGlue.cpp \ + ../../shell/DataIO.cpp \ + ../../shell/DomainClass.cpp \ + ../../shell/TypedArrayClass.cpp \ + ../../shell/ConsoleOutputStream.cpp \ + ../../shell/FileClass.cpp \ + ../../shell/FileInputStream.cpp \ + ../../shell/DebugCLI.cpp \ + ../../shell/StringBuilderClass.cpp \ + ../../shell/SystemClass.cpp \ + ../../extensions/DictionaryGlue.cpp + +AVMPLUS_SRCS := \ + ../../core/AbcEnv.cpp \ + ../../core/AbcGen.cpp \ + ../../core/AbcParser.cpp \ + ../../core/AbstractFunction.cpp \ + ../../core/Accessor.cpp \ + ../../core/ActionBlockConstants.cpp \ + ../../core/ArrayClass.cpp \ + ../../core/ArrayObject.cpp \ + ../../core/AtomArray.cpp \ + ../../core/AtomConstants.cpp \ + ../../core/AvmCore.cpp \ + ../mac/AvmDebugMac.cpp \ + ../../core/BigInteger.cpp \ + ../../core/BooleanClass.cpp \ + ../../core/BuiltinTraits.cpp \ + ../../core/ClassClass.cpp \ + ../../core/ClassClosure.cpp \ + ../../codegen/Ia32Assembler.cpp \ + ../../codegen/PpcAssembler.cpp \ + ../../codegen/CodegenMIR.cpp \ + ../../core/Date.cpp \ + ../unix/DateUnix.cpp \ + ../../core/DateClass.cpp \ + ../../core/DateObject.cpp \ + ../../core/Domain.cpp \ + ../../core/DomainEnv.cpp \ + ../../core/DynamicProfiler.cpp \ + ../../core/E4XNode.cpp \ + ../../core/ErrorClass.cpp \ + ../../core/ErrorConstants.cpp \ + ../../core/Exception.cpp \ + ../../core/FrameState.cpp \ + ../../core/GrowableBuffer.cpp \ + ../../core/FunctionClass.cpp \ + ../../core/IntClass.cpp \ + ../../core/Interpreter.cpp \ + ../../core/MathClass.cpp \ + ../../core/MathUtils.cpp \ + ../unix/MathUtilsUnix.cpp \ + ../../core/MethodClosure.cpp \ + ../../core/MethodEnv.cpp \ + ../../core/MethodInfo.cpp \ + ../../core/Multiname.cpp \ + ../../core/MultinameHashtable.cpp \ + ../../core/Namespace.cpp \ + ../../core/NamespaceSet.cpp \ + ../../core/NamespaceClass.cpp \ + ../../core/NativeFunction.cpp \ + ../mac/NativeFunctionMac.cpp \ + ../../core/NumberClass.cpp \ + ../../core/ObjectClass.cpp \ + ../unix/OSDepUnix.cpp \ + ../../core/PoolObject.cpp \ + ../../core/PrintWriter.cpp \ + ../../core/RegExpClass.cpp \ + ../../core/RegExpObject.cpp \ + ../../core/ScopeChain.cpp \ + ../../core/ScriptBuffer.cpp \ + ../../core/ScriptObject.cpp \ + ../../core/StackTrace.cpp \ + ../../core/StaticProfiler.cpp \ + ../../core/StringBuffer.cpp \ + ../../core/StringClass.cpp \ + ../../core/StringObject.cpp \ + ../../core/Toplevel.cpp \ + ../../core/Traits.cpp \ + ../../core/UnicodeUtils.cpp \ + ../../core/Verifier.cpp \ + ../../core/VTable.cpp \ + ../../core/XMLClass.cpp \ + ../../core/XMLListClass.cpp \ + ../../core/XMLListObject.cpp \ + ../../core/XMLObject.cpp \ + ../../core/XMLParser16.cpp \ + ../../core/avmplus.cpp \ + ../../core/avmplusDebugger.cpp \ + ../../core/avmplusHashtable.cpp \ + ../../pcre/pcre_chartables.cpp \ + ../../pcre/pcre_compile.cpp \ + ../../pcre/pcre_config.cpp \ + ../../pcre/pcre_exec.cpp \ + ../../pcre/pcre_fullinfo.cpp \ + ../../pcre/pcre_get.cpp \ + ../../pcre/pcre_globals.cpp \ + ../../pcre/pcre_info.cpp \ + ../../pcre/pcre_ord2utf8.cpp \ + ../../pcre/pcre_refcount.cpp \ + ../../pcre/pcre_study.cpp \ + ../../pcre/pcre_tables.cpp \ + ../../pcre/pcre_try_flipped.cpp \ + ../../pcre/pcre_valid_utf8.cpp \ + ../../pcre/pcre_version.cpp \ + ../../pcre/pcre_xclass.cpp \ + ../../../zlib/adler32.cpp \ + ../../../zlib/compress.cpp \ + ../../../zlib/crc32.cpp \ + ../../../zlib/deflate.cpp \ + ../../../zlib/inflate.cpp \ + ../../../zlib/inffast.cpp \ + ../../../zlib/inftrees.cpp \ + ../../../zlib/trees.cpp \ + ../../../zlib/zutil.cpp + +#**************************************************************************** +# Output +#**************************************************************************** + +AVMPLUS_OBJS := $(addsuffix .o,$(basename ${AVMPLUS_SRCS})) + +${AVMPLUS_OUTPUT}: ${AVMPLUS_OBJS} + ${AR} rcs $@ ${AVMPLUS_OBJS} + @echo "Done" + +SHELL_OBJS := $(addsuffix .o,$(basename ${SHELL_SRCS})) + +${SHELL_OUTPUT}: ${SHELL_OBJS} ${AVMPLUS_OUTPUT} + @echo "=== linking:" $@ "===" + @${CXX} -o $@ ${LDFLAGS} ${SHELL_OBJS} ${LIBS} ${EXTRA_LIBS} + @echo "=== done:" $@ "===" + +#**************************************************************************** +# Dependencies +#**************************************************************************** + +ALL_SRCS := ${AVMPLUS_SRCS} ${SHELL_SRCS} + +ALL_OBJS := ${AVMPLUS_OBJS} ${SHELL_OBJS} + +# Create a lists of object and .d files to create - +# one for each source file in the directory +DEPS := ${patsubst %${strip .cpp},%.d,${ALL_SRCS}} + +# make any non-existent make files (using the g++ preprocessor) +${DEPS} : %.d : %.cpp + ${CXX} ${CXXFLAGS} ${INCS} -MM $< > $@ + +#**************************************************************************** +# Rules +#**************************************************************************** + +# Rules for compiling source files to object files +%.o : %.cpp + @echo "=== compiling:" $@ ${OPT} + @${CXX} -c ${OPT} ${CXXFLAGS} ${INCS} $< -o $@ + +clean: + -rm -f core* ${ALL_OBJS} ${DEPS} ${SHELL_OUTPUT} ${AVMPLUS_OUTPUT} log outputdebug.txt + +ifneq (${MAKECMDGOALS},clean) +include ${DEPS} # include the generated make files, which make the object files +endif + diff --git a/mozilla/js/tamarin/platform/mac/Makefile.2 b/mozilla/js/tamarin/platform/mac/Makefile.2 new file mode 100644 index 00000000000..c30e2e8b52f --- /dev/null +++ b/mozilla/js/tamarin/platform/mac/Makefile.2 @@ -0,0 +1,231 @@ + +# DEBUG can be set to YES to include debugging info, or NO otherwise +DEBUG := YES + +CC := gcc +CXX := g++ +AR := ar + +DEBUG_CFLAGS := -g -D_DEBUG +RELEASE_CFLAGS := -O2 + +DEBUG_CXXFLAGS := ${DEBUG_CFLAGS} -fno-exceptions -fno-rtti -fcheck-new +RELEASE_CXXFLAGS := ${RELEASE_CFLAGS} -fno-exceptions -fno-rtti -fcheck-new + +ifeq (YES, ${DEBUG}) + CFLAGS := ${DEBUG_CFLAGS} + CXXFLAGS := ${DEBUG_CXXFLAGS} +else + CFLAGS := ${RELEASE_CFLAGS} + CXXFLAGS := ${RELEASE_CXXFLAGS} +endif + +#**************************************************************************** +# Preprocessor directives +#**************************************************************************** + +ARCH := $(shell uname -m) + +DEFS := -DMEMORY_INFO -DSOFT_ASSERTS -D_MAC -DAVMPLUS_MAC -DAVMPLUS_SHELL -DDARWIN -DUNIX -DDEBUGGER -DENABLE_COMPILER -DTARGET_RT_MAC_MACHO=1 + +ifeq (i386, ${ARCH}) + DEFS := -DAVMPLUS_IA32 ${DEFS} +else + DEFS := -DAVMPLUS_PPC ${DEFS} +endif + +CFLAGS := ${CFLAGS} ${DEFS} +CXXFLAGS := ${CXXFLAGS} ${DEFS} + +#**************************************************************************** +# Include paths +#**************************************************************************** + +INCS := -I../../core -I../../MMgc -I../../extensions -I../../codegen -I../../pcre -I../../shell + +#**************************************************************************** +# Libraries +#**************************************************************************** + +LIBS := -L. -L../../MMgc -lavmplus -lmmgc -framework Carbon + +#**************************************************************************** +# Targets of the build +#**************************************************************************** + +AVMPLUS_OUTPUT := libavmplus.a + +SHELL_OUTPUT := avmplus.out + +all: ${SHELL_OUTPUT} ${AVMPLUS_OUTPUT} + +#**************************************************************************** +# Source files +#**************************************************************************** + +SHELL_SRCS := ../../shell/avmshell.cpp \ + ../../shell/ByteArrayGlue.cpp \ + ../../shell/DataIO.cpp \ + ../../shell/DomainClass.cpp \ + ../../shell/TypedArrayClass.cpp \ + ../../shell/ConsoleOutputStream.cpp \ + ../../shell/FileClass.cpp \ + ../../shell/FileInputStream.cpp \ + ../../shell/DebugCLI.cpp \ + ../../shell/StringBuilderClass.cpp \ + ../../shell/SystemClass.cpp \ + ../../extensions/DictionaryGlue.cpp + +AVMPLUS_SRCS := \ + ../../core/AbcEnv.cpp \ + ../../core/AbcGen.cpp \ + ../../core/AbcParser.cpp \ + ../../core/AbstractFunction.cpp \ + ../../core/Accessor.cpp \ + ../../core/ActionBlockConstants.cpp \ + ../../core/ArrayClass.cpp \ + ../../core/ArrayObject.cpp \ + ../../core/AtomArray.cpp \ + ../../core/AtomConstants.cpp \ + ../../core/AvmCore.cpp \ + ../mac/AvmDebugMac.cpp \ + ../../core/BigInteger.cpp \ + ../../core/BooleanClass.cpp \ + ../../core/BuiltinTraits.cpp \ + ../../core/ClassClass.cpp \ + ../../core/ClassClosure.cpp \ + ../../codegen/Ia32Assembler.cpp \ + ../../codegen/PpcAssembler.cpp \ + ../../codegen/CodegenMIR.cpp \ + ../../core/Date.cpp \ + ../unix/DateUnix.cpp \ + ../../core/DateClass.cpp \ + ../../core/DateObject.cpp \ + ../../core/Domain.cpp \ + ../../core/DomainEnv.cpp \ + ../../core/DynamicProfiler.cpp \ + ../../core/E4XNode.cpp \ + ../../core/ErrorClass.cpp \ + ../../core/ErrorConstants.cpp \ + ../../core/Exception.cpp \ + ../../core/FrameState.cpp \ + ../../core/GrowableBuffer.cpp \ + ../../core/FunctionClass.cpp \ + ../../core/IntClass.cpp \ + ../../core/Interpreter.cpp \ + ../../core/MathClass.cpp \ + ../../core/MathUtils.cpp \ + ../unix/MathUtilsUnix.cpp \ + ../../core/MethodClosure.cpp \ + ../../core/MethodEnv.cpp \ + ../../core/MethodInfo.cpp \ + ../../core/Multiname.cpp \ + ../../core/MultinameHashtable.cpp \ + ../../core/Namespace.cpp \ + ../../core/NamespaceSet.cpp \ + ../../core/NamespaceClass.cpp \ + ../../core/NativeFunction.cpp \ + ../mac/NativeFunctionMac.cpp \ + ../../core/NumberClass.cpp \ + ../../core/ObjectClass.cpp \ + ../unix/OSDepUnix.cpp \ + ../../core/PoolObject.cpp \ + ../../core/PrintWriter.cpp \ + ../../core/RegExpClass.cpp \ + ../../core/RegExpObject.cpp \ + ../../core/ScopeChain.cpp \ + ../../core/ScriptBuffer.cpp \ + ../../core/ScriptObject.cpp \ + ../../core/StackTrace.cpp \ + ../../core/StaticProfiler.cpp \ + ../../core/StringBuffer.cpp \ + ../../core/StringClass.cpp \ + ../../core/StringObject.cpp \ + ../../core/Toplevel.cpp \ + ../../core/Traits.cpp \ + ../../core/UnicodeUtils.cpp \ + ../../core/Verifier.cpp \ + ../../core/VTable.cpp \ + ../../core/XMLClass.cpp \ + ../../core/XMLListClass.cpp \ + ../../core/XMLListObject.cpp \ + ../../core/XMLObject.cpp \ + ../../core/XMLParser16.cpp \ + ../../core/avmplus.cpp \ + ../../core/avmplusDebugger.cpp \ + ../../core/avmplusHashtable.cpp \ + ../../pcre/pcre_chartables.cpp \ + ../../pcre/pcre_compile.cpp \ + ../../pcre/pcre_config.cpp \ + ../../pcre/pcre_exec.cpp \ + ../../pcre/pcre_fullinfo.cpp \ + ../../pcre/pcre_get.cpp \ + ../../pcre/pcre_globals.cpp \ + ../../pcre/pcre_info.cpp \ + ../../pcre/pcre_ord2utf8.cpp \ + ../../pcre/pcre_refcount.cpp \ + ../../pcre/pcre_study.cpp \ + ../../pcre/pcre_tables.cpp \ + ../../pcre/pcre_try_flipped.cpp \ + ../../pcre/pcre_valid_utf8.cpp \ + ../../pcre/pcre_version.cpp \ + ../../pcre/pcre_xclass.cpp \ + ../../../zlib/adler32.cpp \ + ../../../zlib/compress.cpp \ + ../../../zlib/crc32.cpp \ + ../../../zlib/deflate.cpp \ + ../../../zlib/inflate.cpp \ + ../../../zlib/inffast.cpp \ + ../../../zlib/inftrees.cpp \ + ../../../zlib/trees.cpp \ + ../../../zlib/zutil.cpp + +#**************************************************************************** +# Output +#**************************************************************************** + +AVMPLUS_OBJS := $(addsuffix .o,$(basename ${AVMPLUS_SRCS})) + +${AVMPLUS_OUTPUT}: ${AVMPLUS_OBJS} + ${AR} rcs $@ ${AVMPLUS_OBJS} + @echo "Done" + +SHELL_OBJS := $(addsuffix .o,$(basename ${SHELL_SRCS})) + +${SHELL_OUTPUT}: ${SHELL_OBJS} ${AVMPLUS_OUTPUT} + @echo "=== linking:" $@ "===" + @${CXX} -o $@ ${LDFLAGS} ${SHELL_OBJS} ${LIBS} ${EXTRA_LIBS} + @echo "=== done:" $@ "===" + +#**************************************************************************** +# Dependencies +#**************************************************************************** + +ALL_SRCS := ${AVMPLUS_SRCS} ${SHELL_SRCS} + +ALL_OBJS := ${AVMPLUS_OBJS} ${SHELL_OBJS} + +# Create a lists of object and .d files to create - +# one for each source file in the directory +DEPS := ${patsubst %${strip .cpp},%.d,${ALL_SRCS}} + +# make any non-existent make files (using the g++ preprocessor) +${DEPS} : %.d : %.cpp + ${CXX} ${CXXFLAGS} ${INCS} -MM $< > $@ + +#**************************************************************************** +# Rules +#**************************************************************************** + +# Rules for compiling source files to object files +%.o : %.cpp + @echo "=== compiling:" $@ ${OPT} + @${CXX} -c ${OPT} ${CXXFLAGS} ${INCS} $< -o $@ + +clean: + -rm -f core* ${ALL_OBJS} ${DEPS} ${SHELL_OUTPUT} ${AVMPLUS_OUTPUT} log outputdebug.txt + +ifneq (${MAKECMDGOALS},clean) +include ${DEPS} # include the generated make files, which make the object files +endif + diff --git a/mozilla/js/tamarin/platform/mac/MathUtilsMac.cpp b/mozilla/js/tamarin/platform/mac/MathUtilsMac.cpp new file mode 100644 index 00000000000..f5bb68bd2cc --- /dev/null +++ b/mozilla/js/tamarin/platform/mac/MathUtilsMac.cpp @@ -0,0 +1,124 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 1993-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include + +#include "avmplus.h" + +namespace avmplus +{ + // todo need asm versions from Player + + double MathUtils::abs(double value) + { + return ::fabs(value); + } + + double MathUtils::acos(double value) + { + return ::acos(value); + } + + double MathUtils::asin(double value) + { + return ::asin(value); + } + + double MathUtils::atan(double value) + { + return ::atan(value); + } + + double MathUtils::atan2(double y, double x) + { + return ::atan2(y, x); + } + + double MathUtils::ceil(double value) + { + return ::ceil(value); + } + + double MathUtils::cos(double value) + { + return ::cos(value); + } + + double MathUtils::exp(double value) + { + return ::exp(value); + } + + double MathUtils::floor(double value) + { + return ::floor(value); + } + + uint64 MathUtils::frexp(double value, int *eptr) + { + double fracMantissa = ::frexp(value, eptr); + // correct mantissa and eptr to get integer values + // for both + *eptr -= 53; // 52 mantissa bits + the hidden bit + return (uint64)((fracMantissa) * (double)(1LL << 53)); + } + + double MathUtils::log(double value) + { + return ::log(value); + } + + double MathUtils::mod(double x, double y) + { + return ::fmod(x, y); + } + + double MathUtils::powInternal(double x, double y) + { + return ::pow(x, y); + } + + double MathUtils::sin(double value) + { + return ::sin(value); + } + + double MathUtils::sqrt(double value) + { + return ::sqrt(value); + } + + double MathUtils::tan(double value) + { + return ::tan(value); + } +} diff --git a/mozilla/js/tamarin/platform/mac/NativeFunctionMac.cpp b/mozilla/js/tamarin/platform/mac/NativeFunctionMac.cpp new file mode 100644 index 00000000000..0898e875c71 --- /dev/null +++ b/mozilla/js/tamarin/platform/mac/NativeFunctionMac.cpp @@ -0,0 +1,64 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#include + +#include "avmplus.h" + +namespace avmplus +{ + /** + * call a native method using powerpc calling conventions. + * we use the traits of the function to figure out what native types + * to convert to, as follows: + * + * AS type C++ type + * ------- -------- + * Void void + * Object Atom + * Boolean bool (unsigned 1bit) + * int int (signed 32bit) + * uint unsigned (unsigned 32bit) + * Number double (float 64bit) + * String String* + * Class ClassClosure* + * MovieClip MovieClipObject* (similar for any other class) + * + * The PowerPC uses a standard calling convention with registers + * r3-r10 used for the first 8 non-floating point arguments, + * from left to right. Floating point registers f1-f13 are used + * for the first 13 floating point arguments. + * The return value is placed in r3 (non-FP) or f1 (FP). + * + * All arguments are pushed on the stack. + * + */ +} diff --git a/mozilla/js/tamarin/platform/mac/OSDepMac.cpp b/mozilla/js/tamarin/platform/mac/OSDepMac.cpp new file mode 100644 index 00000000000..d9f15c1122f --- /dev/null +++ b/mozilla/js/tamarin/platform/mac/OSDepMac.cpp @@ -0,0 +1,77 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#include "avmplus.h" +#include "DateMac.h" + +namespace avmplus +{ + double OSDep::getDate() + { + // 23apr04 grandma : Warning, Actionscript expects an integer count stored as a double, + // but (MAC ONLY) this returns two digits of accuracy. The Date object rounds the return + // from this (for version 8 or greater), and so should you if you are writing new code. + return MacDateTime::GetTime(); + } + + double OSDep::localTZA(double time) + { + return MacDateTime::LocalTZA(time); + } + + double OSDep::daylightSavingTA(double time) + { + return MacDateTime::DaylightSavingTA(time); + } + + void MicrosecondDelta(register const UnsignedWide *startPtr, + register const UnsignedWide *endPtr, + register UnsignedWide *resultPtr) + { + if (endPtr->lo >= startPtr->lo) { + resultPtr->hi = endPtr->hi - startPtr->hi; + } else { + resultPtr->hi = (endPtr->hi - 1) - startPtr->hi; + } + resultPtr->lo = endPtr->lo - startPtr->lo; + } + + + uint64 OSDep::currentTimeMillis() + { + return MacDateTime::GetMsecCount(); + } + +#ifdef DEBUGGER + intptr OSDep::startIntWriteTimer(uint32 millis, int *addr) { return 0; } + void OSDep::stopTimer(intptr handle) {} +#endif +} diff --git a/mozilla/js/tamarin/platform/mac/avmplus.mcp b/mozilla/js/tamarin/platform/mac/avmplus.mcp new file mode 100644 index 0000000000000000000000000000000000000000..4b35eb96b31a4e488553d6e8a55160a5b657208f GIT binary patch literal 1593130 zcmeF437k{K{lF*5ZnCgka*GGy5D;(|P!aLkWtU@tm6b)oa|uay6UZhp$s%~JH(C$8 zwI{V!ZSA4ew*Eb-^{m>`iUqX?Ue$Wr+G@S{e}6OYB`?b^AmGL3<@3$_=6o~1nKy6V zym{{h6N#8o%A=HPlp65P6gA-8#Y!E&8mCuXZWmr=t4f5z^8=|=G?DVxr4oz7!Hn(I zS>8Ec=t)5V|SP)yggVXEPZ&MMUpQ&xrAPZ(TOofqURb z-scbTdtdCeN~uM$uzzYQl}M%4i|?%@tjqh%tFNnrpWfhoxg@FWFMQwR_k}AZDYy5< zp5G9``{LwxFg)H3-+xZqH(a?2)9ro!x?{Ed`JeceI%ADGYuZzu54|+#>U$*2c(*C-Va=WMQvRhG+h~zHo zVhPzmc1=qQLOXu>8!CSX$loOS8!mru$lsgt_ZDT9{mQ>HWosXja&Lltq;^4)o$u1N zs1fbq_>-tQDMvnCTaM;PVJ8%OIm_fwjHygoWY3v_rGctgAe|1U%N7Sx&hR21Q&Z=! zoqtT7b~g!_ijx$inl`_6k^Z{F&84Ji>E+!RSop(@NVgqvxmBC z%=29g3QyFOV~iXb(-vF`;}Q;~^Q1c7;-q!Lf{_dw`s! zAU1lSk$gZ)9S5M=NsW48lgG8_a4!y#}eNXx8%N|*xlKl<`wD&{np4l|$z zaiF1V3Qq_(aF`)AQWL&KLo@^UGkxhB}| z`uy?>Q}S7K--*I{D63nKWVfc!uDZG^Ykr;JWl*h$yKbZ+ReD+lW+|ABF&=6cKd7+P<|A6zv~?e~L~)l)00 ztGX#wf$Nk9xIk*v-ukbtJ?E1z(c2E!E^eKS@hmwh8V?~dj=ui%J+u4GkLk2!{HpY= zR>^zuFP`FH>2S++>(b(_sge#u+a9}U!KM1-Cg)S(SU8Xlm$f-QO#1w5ft-lA1irrU9Euklr|(f-UQlJb%&(vYt#;>)Bl8`Pg(_%5U|KLo9Qs<^PHC_k3!F8zw_k zw&8jPSmtK6PTdz;`x{}U-^VihOE^xzx5FLqOZXN18t#PugS+5vxEJn&`(ZWw1|ERl z!h`S-JPeP(qwpB~4jujo`)CU zMR*BbhJV0o@H)H!Z^FCqZ+H*>1OJ8h;RE;(K7x+QoD8SHsc<@+ z0j+Q*oCRmYIdC4F4=dmTxDdVp7s16=JJ$z6;jf^9f(AOb271hS*Q_#7F4beshvS_6 zLytM@k~_V2T>3tu>f9?K^%W*9fXz9y%*k6`m1tkFng$~=WuzvfE4iqY`-?Kd^MQ=O zWE9BAs&Ee;9n6MWI2@QmE!=}g2P@$+*!l0lQ%E^d^r2?1ZNx=yJIx9eHa*YM6izXJ*!HOwMtHizk;c+y%Ql8he6j&Q`!fd}wY>cOZ@wMT zH(0@CWLnq?8pvuu4w6p4@=cDOtzUcME*>%X9b$}d-@|`dD{D#im({suGwIkpfUjuX zGp%PIzK5*b)muE>+P!GqWBTrW(YlXswVZdiOf}Hm+G@*~W7O!6wRJDskvse1w(%3~ z(8G3a(;N9VzK@IBUX#*={q1>&4(o1p7mxh&MM1_~PJ#2V=Is}QVrIaSdHs#v9^ z&l-CD_GdhANE^yO=Wc!_I``oV?^v+bhFVH@9EM+o`(;}(w=O4Dko^0y_oQ;Ipv~;n zPIFh8^`=s4DJZllrK1*YQ9ngtMG&{~%GING?##+$G8PR6&+2^GQJjqIC8WnSjQi>*~n-d;t;CvI?-*mL3-ztdijKYtB)!tct97r86ff2A7o zs62lon|OZXd*T`Cp8-}77K!ShmqAoA15{%+MNN&mmd zLkQN2iu)oDjfcV^^aG?p5E}fSf{>e6ST=%HIers-oL4MZauCPx3cP zi>gTKVsG$EwPB71wqh~IxK~}%3wa9iSmh0&zv6|+`v6<9ykE3Ti>mlrnB}HD6yJe7 z&a{W(b;#pQdno<@d4g#VUU?Q^U(+7E@>Z+;OndMyK;GZ92d@-vqG=D_i;)j7?ZNwF z%x@iw3^8D5e z(;iBsUTRExD0vKdCe==RD0u~WmT3=NijZfU_RwW0axJXnQNe>S4+qNHMcy+j&&auu z&%l)9lKSkj3iAl?Am58A$6^oUzhlKEGcCu zm9m^b>f|}QX_-H#Th?>CpV1-J9dTEucFN(^WU3;Yu^lO(p)R%IR8!bLXItO!ojb>J zt1M8KN~h>nwsn(1>=(T4(ERU!yieW%X>4;6UxNO(Ij^5n#4lC&p0uDs%d`swoFE032?cs|k|tU*$9Y#$2tYFv_hS zzFJk?->TzPJ!1K5({?8uS4Y)DNVmda4sTUvbGvzLr^7$)|DzH9wso}(BSSWq+BNsi zO#K87&pMhXaUv!gM)Ptt?`)2)El0DX@0=#bbZ*nl+^9#IX?83A3Osi%9nhAx%^z)) z!rJl*XFGN#Gphiuu{O7D@0Cp6ppfgoZCDLQUs)Rn&Z+my`>|(7<4eLacTm_08t60{ zs0ySOCE|YlqI9MI{dKXx^3HQ0aMmtdTXmY|zU6{Cz9rBz?^^AT8%(Rbw$EwRx`&*B^olfS_xz7Ra3iGwNQr1}Od1ll@73K?ZrCJiVQh9y5@@uISX^57(APv=03DPhvxsZlyNk-SC?D8scBX#a7 z^+(!E``T^?WPK0RdExrTRh5;d>MzcT+jM<#DpKYvKFc6lE^M1>U`y|M$PUuEHZEMd zWc8O-%NKd=qFgU>q`d}jz?;CGHP`F#A9x@B1^x-ys5ADH2JK<~X%JXmXN#68bZPLX(F>2nPUXHO~;-q_-yDu63AR#6J)peYiyzKLTkFPhj2zH^MFOL&`^RUMR0T|AS9q zBX;5!kzP?(=mI{{L7y(_+tq~pYxosmZ-5_wr29C$1TVs0;5ouBgaBd5w~Mm5$hYfB zcpm|3fvzf&XI5wGHp=(4pR7u z-v12b&3!#?WkCM)8v?(HNq${FfuFJu%Hol-h)zkrs3-J7{sr7d*m96OM<7aiPh)1F z1tx%mA-*CVJ$pM46J06v?!w)LyK5<&1j}GK>`OXp;VJkN{1Mgwb>=!5PJ!d#RNO=d z?B7kE-PeKSpW{o3``d&$9!|hc+#>c}GywWTKm6Z8 z%mUi4dnn9hWrVY5zkLzmq9nel) zDM+)ASJBIN;M>^m!u%Fc{~qeZL*01Lm501~D4U1+_Mj6_A3%?uU4XK9dO{Bv1?a)k z4N3tWdnls^op?CDJ?KnU8@XS>MAseP8uKn8!==cTX`&W9Dai7rk=J`GOC zPB=F@k}njy@sqCdQdmP%|PDlFaCN6>k-|~z9-a^5JC`!MnHcZevNq&e$SAP z%iwaj04~Ihy4GKxeim~woJ2V(yX$Z87wpuLzBhFc=5zR=U)SH^uRxk^+LZf4*4#@YcN;A*+6^eOEk(&8<#IkyO&~~g9-Wz&y>w`7Mux`)kAqa zt#AhZ#8cSy7obHC=-P#@JwpL!kDqilVh+b-Kl+Q^=tRC^?H2v9Klz%q8@v9J_Xf;U zu;Zpq#YC1bT)RcaRHtKteCgUP`)|brMc&*XU%hsNYZXvVbsn&P7lvyHkT0$Wl&b=V z^9lPN{2Ok>P8)Z*F{QrAyqmV-4k7;o=EDLg!=JVwFG6+|FRCDNqGnh(levsZ&>1!d-+(pWv#7O6(V7(oeX`VJ*;asB19$V_t$O z$ML0@Jz+GAfw8a;^uli?Chfy@J^TQ>v}gJx{e^7|8FaYnFhx0(MXe?;Qa0L->uKuj zJUEwN#3>>j{Z(%A8hA-o5D$*RR7+MjDL?C8;hZat5Iw58{99|0qgU%e)k`d#HO4?Z6}Lgnhe7*Zn9wLfDxw3uZ$tVW>|J zZOVhctYY&>yV`@W|AKenA$S<~Kf)UFyf=&j@>WD1i^zY`aGZOSGP=vmV_Js-T>vrhHJ}xIe1Cga%hXG}B{Q~oDp!|yRE6VS_8E!&88x!P< zQJxs`gYaA2_r(4Y=3wvx`QfWi%JT^_`O~u`(helggmFK>ekNneek!;CTG1;Gd)~c_f^RG}XD-h3~^E?61Lh;dSg+ z5awXa+W`Hz2@ZSOS;&xrRE>@Q;{U!Kcw3*yGHrB_GKLjDiThW`?7Z_M{GkA`CikLg)} z8*Rh22J?Q*f5KD5?*W5gJWPfvARRZs+`|CU!_h zy-H`_rh51C9d~@S8tf~Ljk`^hwVDtEpvO?h)UYm7 z#b)B^nImeRc(hCRj5hHaB_z#b?9bj%`*{ABizl-LGAqM238`0U=D#ob4)}!QN4Aou z;Uj5PUAtnn>a&C+u}g35TAFk1(ihi}+O@mGwGvrxUAx&*!R*8ukapEq_@I}qc3gG-0yVhgm$~@fFq2OwJL3I@n5y# z4_*77+NHR`5q~}LUvb7)71)M*|MOIlZ}^Aw$uh=KeSL$b#(aB?;hZDeh$r}Ko5v6I zKD?!gU#w>CfF?KoIH>%+!HOBRSx%hHr zDnSnKM9tITN~kBkny%UstwbyCXmU zhxN1KPx$W^d>NoP+eZu|MVjkh3XAjm&B5`Rv^> zrQPodgTW6&U??y)lWPhY$IHD6H4>x`krqE1#=uzE2g*Q>#BsnlPtPyzi@6`{4-?@4 z;GC-GPbOn>ZJ_4@4#7MW4ucA?&yXAy&TXf8YnRJesytby6zq-CTLCx!{yJ$h5>%!% zvfEaE5jm1*Fe`l9d<&Uwk?EC)fWI=aP@eyg1;5O*UIpy7EELPqb%am94zoEL=fkiPUv9@8WpFeFvWnJBDqE?vb)>O_mq}4WxefsH{%j34ab|LS< zuC{yW9Cn!mC~Tcq1MV`JGU~jWUg6Psi?4Q_77L^!elzQ99?t7zkL7jZ%9o;>xyw$j zghKI^;{z1w@|t)ioQj7t{;A87u|z7IDhni&N`c71}bRr>#u=M{|zL^ zQ@Ok6J(a5;S?7H$+UyiJMLYddxjWDI4_&g#SfjfreUFnr+qC+v3NhuDFW2f@c&<}! zb?Vi0g*R`D(h8eH1D*cO+bmFIVC|PfB&(Jp8EJc7U;W2Z(;GKl^3-JMiut&R+ete{*4$yE=3Bq)u0(lQvHXb*QMqoO*|<>8u`|eoj4qor)Y=g1iAh zwywPXE3mXV8EZ*51kDqy=Bc_^bWzF#k?&l|W^AAFzpzqNziR6o?{#YmE8rH}LmD7w8Uq!5Aoq{h<~ja29;aefJf!4VRxvn&-epa4l{#Fz!96s-(%0g{vkt$4c}|T$WeQb9y4~Ivhs1`C+xf5 z{u2+Fbl~KJ4nE}2!zu!cf}wC@QzW{0Nvt`ZNS>HVXIhq?v~2mw#~ye52@MN7_CMv+ z(@sC5^~|%*KIh!?&R=oCh2Oa7;!7@FdD-PxTzS>i*IawuH^24m?|k=rtG<8z4{rG3 zjW^x=qaWY$lb`Z#MF�L>Yj*A7bLx(mTR-o}qvkI-`WRFGj{Uc( z{K=U9==KgPKX*p-Mj!V~QvBV%zD*o^6ja%%;T8mK|}{ z+i@Ij&*ApG`|j_S8o%!@6jSzRhq3o<%=PccJ7(EjYCv-!m`sHmqsz>jLs*lV3dfu) zQq9Z*|5{)zl89T5X7;qR{^vb^h)xPyTMf`ke4HX=S*Hen-GF3Cs1a}}(kBsXYS@{A ztQ*x^HmD>;LLOc##HODHm3Sv!e5(oQ?NwBK;szs|f6s|y{7!p8{`@uI3BRju(My5* zuT(=Gl_z#(vukk}vR$>(HF?sJk~+*rC~~j5bR6dSP~5dL6vDg-ymis|T+D~T7pO}_ zF<*m{+L{cH6U$qeRhP`%Fe_MG@FL5@&(BKVo}MPe$#4yEBxcQ56D!_BmeT2Q#CLXJ1T$*ijjAX#;eGiyg6JAs>;Ml zk*6Z>7HbK2L2g3cJ=Ue3H02G>YL9tgIhT2EKz6BA0DsSKkq6I91%k-D)l&JpRi`9< z-tMY~5Udpy_eCBW4~0X>@)oaQdO)m-<{=Mvulmjg++~JK^1)VgDSsohsETgG6#cRl zJ;~oFEvh1^i@m`w)rL75*ows*<6dw3zY{jSXSEfZ(%o~1H zxoHo@cOZ{5?V(t%TE?69Q2YV%1k)b8^47C`O?&Xl+sO7a?ZLYMd4JO$yy!?xH0{BA zG4cVXJ$QeNJjt{N@1w{En)cw8dYNq6gU^e6kZBLTVaNxY_TZB_ze7xW@bSiAb*QOd zpOob=(;j?MmI~7zeD@$%8vXm8L!M%V{~vOdX%8j+k*iI6D3NQ6sir-YNWDxm?V;pE zjg_m>8c9nWLnl?o{=_>VdOigo=r_tzl5hy48G;d%eEY?0gxKI(f$R(s zYZGFPd_ylU1bfL#W3_x;#1SIXC~5rD>_g`x>Ef)P7lN~EHiY9z)B){2iR!%Mw^Q9Y z%})O$s*IqlmXd9h;!@1#pfZ6}M&vJRbG|WGk4t;b3@i;)@m`U1I9;|lAXg`O+c7nD z{@VG+$Y|AW{e>?xh%S=8(ra&p4}3kZY83}6m@hNju*TQ(hJ~;UR{DC}JPs4LAC`Du z_yPR-T3^q(V)uJr`2Kp#1+c>V!tEO{?}T@7U*_w1<0we_ydSOdzHq~O?+ZU)=~FKd z?&mlAyz6eoTn)s(aWxS4CIth%Yaj20InGyl;|k0=X!WUot@b|MWhL^h@F+<54}3ju zChX1Z=jIAvpEutO>%I5gyUJJk%@Xh0hgQG>U(X+r_KyboO0Rnq`x^3-^sapv|A%Kt zsl6|3xK+%;*2y(cdebu6-L>$luZwSuckL6c-WRT)fqAEQ?E}la_g}OClCT0+d)Ka` zok?50X`%OpdueOy*W>5pUZo*_r9kVde=TLi2Kd3!F&Ie9Mdna!X*Bc5peX#QVZ)9DhegfaCP&JF%1g)uYHK@vbJ_t5?9S zKzi5sz4xuHAV0WWgWokPy|0kQD?eTjq#{pS8myW z>4yc-3Z#48dhh+;R4~ft8zgcaX-&dhX1e`(Pk8_D9L@rRt||VwV#2s_2h!MG`!N+! z<-Pkd=7a`aE3H2iUN(=Jg2I;>%;jPy{W1d$L1y;~Z=#n&qOf&p4VX94Z{%*iy1Hw9 zDj4DFFe4X(Twn6P4I62d-gR|xeQGJm?2xodNUJg#Et?@Z+Rl7Y#-+^sr!%CsBhm^@ znYTQ-1Jde3zG|cCpd_^;@>QQnwdlmQQ(vO{d2?owt!>oT8fikNO^EK%R=9qL=&OF} zQeGgZ=PkCSjDcLfO6yslrMlFHQ%zz2oR)380M6Z)b}4UQ+g>6pdD5HQ>;8hb9h(0g zkoPZjHup=={|->u4o%`q)&CAHNg=Uq(m+x5?CA@FOQNB=RATY``noD+2)Dmia!X&k zW41O6ha7n`D}{E#*{ld8MD^nF; zN=6D_0r^tY{*~EjpS-Vt)WtgAQnas3ReU)ak$Wp!+A1V~z7XWkm|f$Ec%V647G4(K zQtX0%K?4O1d{G*Zm6V08pn-x03K~EIo&Kvnraxrz*)ieFqjZh_Aq@?QWG0%3kK&Q) zV4^u0jfMB_J}ep!##%yQ|4^Q_jwBj*zFHp9C~FQz#*7)-eONdiiZ*sfv0JlN{dU4V zQO#eq@_dKcc%H=C+_t^zd7ZbxJj#75+y=jZ+u;uQCHxA04R^v_a5vlo_riT}Kdgq| zzyt7Gcn}_fhv5-;6dr@$!Q=1*JPE&tKfoIJBRmCb;c56Ytb_IN9Q+0T3V(yY!v=UB zUVsd<>t!r?An(BXRs(;06yAK{0rt z3v`82=my=P2lRwqunY8tKF}BXL4Ozk17TMf1be`qFc^lyFc=Pd!3fwJM#C5w3;RGB zl*2d}4-;Tt*dHds0Wb*;gvoFa91MrRp>P;fKqX9p*-#6ILp{ucBjG5R4-4REI2MkB z0Bv=L~!zpkooCc@E8PE!6 z!P#&QoD1i{`LF^mu#OoyfaR!@BU&y(SOKqBhWRi{pbPM9q2hU5)eYn*l_Rbv^a7rJ zRK1}O$a9bVK%V8~*+(@HV;lp2@`vtTyV!r>s#aNR)iH1^90$jPJZIVf z3n2iDAP6Cl3%^E?Cs`s8g~hN0SmU9ZAr3qrs*-Rb$P)o+kX0KkuoO;$Ww0DhhEw2F zI1PRVr^6Z03TMJua5kI+=fZh#K3ohd-~zZ1z5y4(C2%RMgv;P^xB{+(tKe$52Cjwc z;G6I*_%?h8z6;-jRq%bd9)18fzz^X@xCw5CAHk2|7WfJL6n+l3!fo&ixE(&%t(5*7 zeghA{Z{b0B2p)z<;8FM;JPuF5lkj`^1FV5R!k^$NSPM_XpJ5%WhiBkfcnrcn98vf5E@uefR+W2Oq+xr5yI)0ylV|2#Uc6 zCC~-BLMe2E?$85zLNC|_dP5)R3;m!!>G5=Oz^ zFdFuOGAM@$urKTf`@=*y5GKPxa4;MKhr(e{0hKTXs$eQigXu5>YG5YJg4s|Dhr=AG zgCk%r90$k42@r%3grO0dAOcZX0x@WYI3(aiNI@Dh&;m>0Bv=N^;bb@kPKDFpbT|WA z;Y>IS&Vh5`JUAa#z=iM)xCkzWOW;yi375kaa3x#?SHm@MEy(dGn+x3Ffg&gdFZiGY zxKLtdO%O;1-n3R=mUMBAM}R-Fc5ZyL9iR_4tv0!Fc|zW1ct&e7!G^E2p9>Y zU~d==V_+=o17%PS<6t~YfPG;<*dHds0Wb*;gvoFa91MrRp>P;fKqX9pDyW93Fb$@| z45)#bFbifwEgTMWpbn0Jxlj-D;7B+M=EDLw8jgWu;W#)RPJjkj2mx3GK?p$@8ledy z5QW9C1Y*z(aY#TCPJ|SsApW%iwaj0 z;Bj~Yo`m1SA7Bmq5&i^E!CH74{tWA2Jv;-?!gKH!_$&MkHo)`n0=x(>!OQR}{1aY- z*WnF#6W)Ti;T?Dn{saGo_u(V>1U`k0-RK6u1#T#UV(@|wN}vmLg;MAS-Ju8cgkG=< z^oBmr9|pic*cArBZm>J-0eiw=@WT)o3d3MH>;)rWB#eeJFc!*T9E^tvurEx61AwnO zc@Biha1a~}hrpq57*xO%sDf&k3e#XZ%zzr03A11})WYE~2abkg;8<7)0aye<2tgPc zAp%iY3`-yeaY#TCPJ|SsAp0mi{VmO375g;a0OfmSAiU#vbn$w9w>rh@PZFYpbK<`Qs@TVp$GJYUa$-FhCa|2 z`aypf00UuH7zDe)?yv{!34_58LtrQjgW<3jjDV3a3igK4Fb2lLK2QebFb>AU1lSk$ zgZ*J58~~HxK$r{%!NG6{914d)1ysTmsDf&k3e#XZ%zzr03A11})WYE~2kPJmm<#nV z4~~SRU_LB>qv04h7LJ4C;RI-ag%E&65QGqfp%I!O0#R5DOCSc#5QhXL;Y3J58ZyuV zOW`C~2Fu}OI0a6H)8J=tI-CKma3-7uXTv#gE}RD!!}+iRE`ST+8*mX^0++%{xC}0b zE8t4F3a*B0;99s2z6sxgZ^L)syYM|&1>cA3;RkR7{19%0o8V^n5&Rf#fuF!n;pcEG z+y=jZ+u?KFrZCq7cfc>;}8T9^i)|FckKJ5ik-)!QLov#2ggGLEQAn*p%I!O3X5S0#Go1C zkboqd2q{QI23lY#oCM2YIh+iq!f9|ioB^$H7Mu;|z`1Z9oDVDDLih$;1Q)|4a4D>W z%XAN~yMEo@f3C+(A@Q%524p(F(|?I(7hPvAwM(1#!fyI{7_`NK#J>pE=Gt;JJLt}7 z_Hq`>r5@MTgIsdH)?4uhSB+Eq{a|JF)XHiGtu{)$w|?82+_;H;`BYU`^}H(v}OFN^sQE@!{T2&RpRt%Bj>7FYTd1?J?GXYaMtS5 zW9uT@t_A*V({is6(+%j)O}XSyWW#WsdaAV(N_56Xac%oAp%|%qdgp($r7ZWg7Kz2c z*V>HjGydCI`i#+brr>fhQP>I^_}nz$_-4zNj^)oS4~2va8u%(`z+*B|JW9+j?;8(Q zmM)5CPP?;sW(~}MS+5q)oCCEmbw3zuhqHp~NhOhsKKka|_OQQeAbz%Nr-56YxI4eu zg1sJ&hO@;F){80ou;YomHCyq_nHzv|%zTHk42MZY9|aCB`sjokiau&sVC05X#uRs< z;hlWD?QWY5@92HE`67%e+Kz9+$e6?a+KOdv`bC(c1^HoeUxe{)_KPsiuf;f1$bAu} zXzRWQBcbeEX2*G3Qx97c=4&|Skg>6c0d6s4a33?tT^O5|GK1Wm+2fuJaCc$WxDPYN z{g^Etz)bP3%o6X$4DlY!4i8p-HAD?%PIx%;!6TRp9>qNHXy$;&GXGn~-0wK%eJ3#I zyC3tt6PfFs#60h0=6DZge)mx3b}N`yUBsMfi22k;=29cfqb_C+HOBmDoVn8^wUuJd zG{b!9QszpRF;99jbF{}XKYIdmvkSK={wd6`p2p1T8LE{z)w7sSJ%_o}^O!?j!Tjlk z%$;7uoa!aao33Qe^m67)uVk+DYUW9=WsdZl%#VJXxzX=3FS?33(d(HHy@9#V8`VwL zH(PFD_VcIA-u|4K&)b;wyj|U)eyM(?ey#50Elzi-yVX7FUUi?kU#(WZQ4gr!st46W zd@L2PA^{VhJ{JL+BaFZFNrp8AjauXV?>+seE9_hB-I=tr7cWp%1 zQk3kr^=mNo_dNO5jrp$UCMz+!Sm|d|ZX?K?`;$}oo2ooAzt3j!;i~0R#{1~kl^W;H z_FvhON$fK{91o`g8TrgaVe41}b(U9IXgPBg9f#wEg^@Xa`7A;z6HaX!uByCh%$QA` zH*qOziZ*WI=y0e?B$xZ=CH!@P;F3U7*x|EvVzxZdU_8B8*^Sy^``K*m zaA(v}Kgwrjik#ij=JME~Uqi$8uHEi1>8k9f$ctTenrbw$W}oE z1q~E5u(cZKxwQcc;dWLH%&(k#%yyTpa6a8`6&4cM88pCpwnSRig%`Gh20F0@3dg}# zSAKCeWT!uiW))D-$)=5>&0WZBfVM*ZOtYv|=xPNkjQHE?tJB#FBmPcT<%I%&ZW<_z zbUruL783p%X`pZ%Y;|R^-ppDokQ?W2b>u?8omm62(6G}#9lE*a19#@i-%{D+%Ff+( zeQt-5Ty=F-e)*sMfC>k)=>Ys`Ru9%u+Dh5m`U4>V1o!YerdtYqsfGzY;a* zo>u&Jv%MT?c2z@Pmw3anesi+%x~b8!xL3bv#CY>e1=TEh>7n*{PP#+Mq1keI>818x zSAn0ral~vhY{5L-i65K(vpwijzw9+_`5Ce^rcIY#s+MyajkvW}_CDn*4s73x>*e9p z+Nlesveyce32QC2v26Fh)Wp~EtCZVa@Ex4M*YJsy9jt-Qom^-Cx=rVdMgAeXyA+1K#$GuaC@&<@?IRXwbv7F-moYS z&G746p9#c6fmk9Qo*O>7I=rZ*Y14NxZN3O!Yu~;jtL9Ws9qAugT{*83qpqfEo;;S? zX*PK-SFS|+FptY;MH-{avR@F1`x7M z`~??|cI$~`>&a@PPLFXn6~qIB^)+&xU)Vaa1|peEa&me3;=s~CS-K@&#^-{{lc_|g zC74N)FY>(GW@^vsA$LNhevw7`@}E#vuG;$9eja`= zV@ADfHqX$DeQrxU6KxLLPBX%>SYm!66$_OGlPVZUElR}8QaWT+S(UNcQR{2w9J#>h zX#B-{nKH7!J`<8%`l}N0bRrg3lLKXmmW(2d^@zToJ*z1J_L_+M*?Use&iCtQ^tBJ8 zI7NucbhBDeHD}s1XRNxZdDhxMa8A8M^3RUOm+43fd;B~qcZGI_5u-!n^D*7<={TqiZBC6jE)`1$BBd$C>}kRn&{a7@aHo z2%+WbXgZKihnpA0D2#Yck0llbV*WXNHLW>%vgK$MR{T+j4rlI`WJE@BR_bVy)b&@^ zQfhLWdhwg;Qj;0LTjS@3aT6zu)0GuSFOLUl4oS5rkd6i$6Y)&iSi_OP(r6-OEYZxO zmPRcGsm?{b7QuuHCQ{)hopa0Hl3E(p;X=IiLK>g3gqKExMhu6dnM`WC#9ch*d%vsZ!6nfS6rf{O!2zqB)j1VIeK!Mt}I2krUmxPxuN(53S*(KB}Z;H?% zV$nsZKx%pVBvX*)L@F7H#%M`3gDn)yPg7V^(Tnv0KIBsMFFMZq8~BIi6T#+WBJYE@niUPC9&IOE_*FC}Pjm zWiWwzAf|I2Oa;eJ)RGj+ZdD>T2jWDdO=W#?aW-o!Q0}ma?VFRE$+3=Tj)iEWX|CBL z!}dF|C15puyl8Ev-5{sa!BE&bx{~{55(%qlc%77@!?jvsGlyz^>BJ>MLfHUK$hm_t znTRbV#eAMx78DE*z|yvFu5jBpP3hKPR?yIN2RfG+M1pU zG}iIP8?ArNgfq0J($*O}DId>NjlAr5Q7UngsUxnB?Vd;HBEX)Vjfszorvf@C?JC`Z zEye+5+99e5IJ%8y&aAuw#}T_Z8cZdU5vF0x&gAHiNHZ|;(~&?b9CGw)8NTxAP>Z(a z8urp?D4fXkjhP@FOMHoAcbTA-1--Y7bQgA)76@_n+;@WZh{hWi#ptnZizI0>gij;K zvh5M$#AM54BNs^OL3^~s>7SCOpF270%4t0vvCgG_J;?Ca>C*xOid0(07fsFKc;4`5 z;-p!swr;*XuF+O|03;U2AV;i|JKjZ*(HTQEz1ykrCTc5EmP)6B#${THUc>1yJ)Gje zcZ8TpmBzyyKspj_$YkAEjhvUPadM_>T$~9Tm;98E3a8SXjIwFz!KEHcHq5WApEor- zJWWy!jfqrq_CSm%GZcw92O?PPVF;obghUv*+CvbLbyG&jYsg|xaY!?^V~)@{O2MYb zC=umo=-Oh2D~M*Wf{+LjIXhs9aFEGx1v58Tu`IM#8LC87lf3ZD9!H6laSMhSwM0~I z%o0&GGWMV&!(R_xA}Tv{i73ZlC8F|=LF~CBP%OFQ4_j_jgC#eniKxQ^nds8+96jDh zvrl7RP&?Z=;gTEkL=^S2+kasV?(GaimcFMfJl zX?dA5j|tYMElJR9LlTP&m#t{lDayo424Y<6i25ZIXI(ka0y3_!Ty)*q7Jd3M9@05P zrGZPlZ1Ign&SSy#m$2r1hQD|S1vGuO>C;p@J~NZjL$>E*dcAxfvj=~B$yr|QrDu6r2}+5r4$K~T zWcxGma~$Wkzr)Esgez02z;f##mSE<0@H#4^=28J&CU7K!~9dopp%wGrh3f-x1StXi7IX z1Q}+?*;|Pv&xeyeT?H3g+KbbnNrjt5O$~IjTo9>PlJPA4SeVI0nJ>VSqLT{JNs(dchER{W?P|7H=_KVrpe^Bo*36Q~;?rnd7>gNEN3=wPOXe{_AYRPo#6u#;nYxkr zne=ilzRXo@8z;LB<%N;v=7>grKW`edQg%PDTX&vIM9Fjs4KK|^OfryR^dy0*^|$Ib zbapD|(Lz7(lSu073e?OBC3PGmlswyvr~h%hTB084WKUdG zde$JKs;x^ixkSrleoA)4YZu43@aiR4S2@^PTOG4NyBJnxUJur(5bB zc1C)M=J29a_@s18GTSS*bu$A$X9yVx+IGe~R{OGDq=~k5v&JyaAbL<^J4DnBax#US zn5HCY)LoT1*;tbj`7V0oxHJ%4-eTr^=S&orhjW)?Ih_Nd9t(`O1-aPKF4EU)VLw~g-xem?!T|_&RwAb2 zk36!bT4!4qUE8=AmGd=M_NHUXDo^Fsy0quUT?DzxB%XbWvs0Lz;OaPfGS_;jklQ5L zDgQPe)`fZ-S83^~@X1kqmBbyS2I~$|gMAJcx2gtf=1Go2BkGQqTO>=wNfL<#m_#w> zREO0ZT%5B4v0x$|XTHv!xYmK%xJT4%lL}YE9eGJ3Y3nI&)yv}nhRRcz71Js=>dmRG zG8Xe&D&YOhhclO@tj;CZnMj_(OPSI!r|0@G69>`Easuf47j#fqqPac!bG?DT zdQp=#XXK|=mD9_*Flg&c3^~?`*S-%2wDy@?8|EgLpF2>}9nGotYr9jn?iAU>M=nRV zB0F~S&YX&yBe%{3+ju!+ai#c%H$(dw&W;+SVE*7^JK|Jyz)^SdWUt@C5oZ@2IqfC^S=B15My&L* zR!OWe!gVYY8FF7OCyS3Pi?A1g$bCz*=mSYF`QXAk$|^B#<1)WwE&VW3ZsAAPp4&y< zq7N>n_SF}!k})%zXl@hAau3P6EQ3OptKIDVLnE7YAKF=N_ZvrR&4+e1vzFX%PZ&S5 z0z|x6n`I0spnb#6vFbxSb89}BGs>>`z$d%jgBdYPIoZ`75p@g`74~FQPHx*CB8r7` z+zQJqX9Z!Jt0XRDX}8WxSpvu$a>`uN%9SiPOQtRhMgnoh`1&$3&w(i^8op_%`pU&D zf6UuYZdG2}Pw>>S=7LWQC1R>R!i<9v9SPFJb^5uZ$7vPcbSM$fSJ3AAG=HkOGA6ep z%rr^0UK-P}3$w-Y-6USbVBZ=^q*QZoQFAiL_k7IkvBOFW3kQ;+7OGDgu)`usua5*| z#zY&s5>kmYIo0c|bZXL=+c-%$Zpvuw6E`c0yBwbFM~F8`E7W;NW@U-O$DOi1Iaz#; zs+(vxm8>Z4Es12t+;RwoxhoQ~*Eh+n&IaaFIOJpocpmqnS=+#TWm4`_=UFA0G!tgA zaLCMtTTMo$+Tt{MR){l7PWhneoKzyxq*|W;IDP5k8)O^;%wb3i%LXG z7KvVsDhf6jcgv=akK`g#pyVQ}Up7rM5uYH7sEBJzvUicKt_h!J`a|iUO$=5HCut7$ zy##96UI|*Ao&To>vo~*?cLAL4vLDkCHp|>zR&=hansj*lznT|@W&|m-(|zRm(HT3{>##=DNzu5yGNQJ&DOlFb>V7S7R0V>z*Yqm; z#?|zyde*)(Vp}qw1;7!Nvom+7?bhuR@tQ5G=Q%IwwNQChDfRR!79%DlnVgM@RI|9* zcuJZ%Po2EPvE1|>fLwfS)nW85O+Iqo4oAmc9Im;YIUIB8O)+Dq=~dcS+f3H9Jr~Z( zoOaOiG+Fso8?e;iv`Ktz*GXt?5v{FDeyF?vI(;+d@ay86x?@yhKWD+oUf(0qb?TUV zr?8QI<~Sm;A}APX2$e}(?K#eG$JHw5USJ!|+xn`ko;H^r!a8SRlSKkYX4fX;z(LOH z)Ks%Mcy*?6t!@d#sX{FXq z81Drd8&g&nYs;(@T*`U2C9TV8YtFjGmbL2f6Ay222ZTkTq@0zdF2q(P=Vi|H(p%)) zbqL3*8vGr$tgrsKsYG7H`JJKIH12umI~wgc=}3!$b!PFZ1h8exN6u^L{{XEU#+fE0 zH?1Nv49(gkH1_NPnv*Rb8QnU49d<_uJL^Q30LE(hJN$C)S^*BLE~vgMpQpz5oF&lf8f9_ZX89LL+=}`#P=5(;auwn#7%lTSYtFh$Lw{y;AXtXh^)5(ew$~-5; z8gcZm9~rWii`#9aKA4IobK1+Z>b+?HTq&GZcQ#TW`Y3j0Mwhrfp9oC$`T~_0rs~Mx(oSnOx@yvW~TfX$E;s7zVgr*BO>;FcuOpn zi$ABH;RCMbkt@n9i!iY2)vfj(oi?3tOYg?w!*ZFtj_bSlK4@HXvj`CCyS4DW7M1tSXyNkVdPE@a*-r8#L>vbeNK?L z*(|W0Xjw4K!);b)uJ5}$yAI=E)s3wOJ45+)NmvgArIXO@QWiNGi}>aC#9n3fPEI|! zGmZolo4t#iEIx9T$hDC*UU1s9uVgdV0(25~Iu1)VC^|9T;xdKHG8#cvTUG>fjBOe~ zT&%miK&#Stp!YX$&In{_CAcvorJO)z`dI)xsJ2_QRbc~(c-^z-uI0dd>3EJqlJ{;Yh@ z;E@h{GHeqkiAkQSScFBgwj{2)_pygg`3I`)nr&#dgVlz_Dy#E!^RoTup;>XMp9Bcn zmu5^mrF7QJs42;{CK0vaC{lJjXXjqVciBp?&uipeYueslb9VK0NUyS$RZQ);v6QKe zD^;A0(XMZb-o`wTl#7X*3|}pGtLUzLqlxUNjp6t0ihc&A(YngsSNXj9jXiKeGcT@UJecBDIb(XJHxW!*Tu=@oS``GN5C+8?>Wd|+XUmT#j}3&PVubQZ#8-HsN(RsE0vn@%HYX!-rl%oY`OTWg~Jo- zxUmVfz(0Mdn%L{;IpyUlR^H=q(%AjZQG?5iW+YURvF~wS<+{2R3s#JnF{7@$>y(kn zid4@B&OWQP+$Et8y0&Ir%^RwBevG7R_1R5b$Mv~&Zc|b6(}!D=ZtMdGm8%|ijaKfa z9*^@s6B>(>pFG^^_qbc-^9xNSy$EsUXyr*35x&Q`a@FhB#j1!jJ|c}0+y)&vr@Y&Y z#mYNlnexj1HπOe*g`ObUgqpn<^^Uo#!JX!sspm|d*A%ExC&y6|<(Qq@g$=UXH_ zRWG#*-#+Q1`l^1azZ#$hs$JC}zId{`+C%NB1}ncBqK5L7li_MFHA0P4qtxE|yC!4R zK77NZT#ZxX)daP#+E4AzcS{aXlhlD~vN}i|tPW9!s>As1MnLf}t_rEJYE(@sqM~ZC zTB2gAS;bXCCDn;4rP3;+TGUc?60d|?u1;3Rs^ir0>IBuG7H(7gQ`D*IGtR7L1s>jst)Z^+2^`!c}`h!}d{;2+>o>FVo z)9TM^om#J+QO~O9)L+zJ)!)?L)duyvdO^LYUQ#csf2dc~tLmTXHTAlBL%pfqQg5qw z)Vu0m>fh=;^&jPsBYFLN>R-NPK@cIg|H(R>=egHxU*GQdWM(Nq$tZ%XLgmoxgVe zF?GaYHv=nPSG0Jg7H-`5{GGn4fqos{YhE_1-zuyBbZFC zc%QM}V*GcpOUapp)+^dDxs9m9U_=&zCOZ|>fQY*hj6+|(%s zt=iO^$Zvz)I6g-1D~=Rf^3qR>$~6d6>WR%Yn!f>BRIW*w11(wJ{Hs5?M3^IyB@UY_ z%%Ao3CYKzyyNfICQpP>BsQ#b5^8k#h%KG@7nPet~5_%D3=p`@#L_|D1msH54|g%VEsf$PZ^OL_UR?+MCVnM^1i0vYm*ZsTvB~ zS;%vlFF`(y`3B?^6G%4d#~B(5+n2j2sulynq+iZv8Ti;>S~_93S@MoOagk{(hL zwReGrBI#1(CCn7J3z_dmel+u=$d6%u9{I7%e??CIMM|RnJzhhR^cC_&%s(P8)j65k z>t^nPoa%~{d;osRG!)4czvavnJ0520t0m0jo2ATD7m8z~wimHA@ir!ilL zypH)#$Vm^${uF-B&`{W4MNU3KvcHd?Gc^?UFOgHMAla!OX}f^rpl$X!8VW~0ZTQ#v5Oin%xP^~|G?U(HPYat$-p|61k}Bo%y%NciTP3FH#5J8{1)cFA-|RRbL6)%e~0{bol_~hgPHnbBXeKm zWCJOcV(cyrMd~=@)b~iKQ}A=Qh9Y$i@_U%6U+!ggBfpQC;%*Z&wd;On^4SB-RF?;t zA3{!ol=>Wg9@bE#et?|%3@PNBJcXZ%cq@n0k0Pf6uG?>;Uq)tn~U6=!4@*`5Gv%%e%F9lPaA$7VA4BHyt3+~DM zEVvi*c5rWI#IvOjGh#$LXTYCS70Z75^v=|le#}|m{h9N?)R#z|%fS7aPX#-fuLe`x zBXxcVJdm0EJct?Vx@9o)$KWB%-+_nfoB_XD;73XsD9WhoZ09WFn5oVOGGkj}8PEI?7pN zG%;e?aCr z(WMHU!@L>{A5rRZF*uj`7VtFYhr!dCUjxrz{sKHx=dM^+EU-*e4hm~RH7UnzCH3tY^+2|S{Az zS2EuUK7pCqyNda7FyfL@_if-4nYV*aV*Ub*aw&EH8H`w=)Pwp9+Zv7gf=^=}46b9& z0-w%&DEJI!#IiP)fj@gtyUyh4)ULCb(N@dZ%vjEH4)Z!NVw6%3YS+2Ue+Hk&OtE)9 zGqvRcW@^iY%+!{PbnclBzL=TX0vnWijsnAv8dLo*Wu6Vbj2SU*xtzHId<8RnY(dOX z>WO+;u429hyqzV%zzCq_+$>1BA`+zqvXM%5H zrft{F%-CjFu-&253+tH$e$*H-Yq^d2MDXp*@TKJrX7V}eO{v#r@SV)>f$w7eANWr? z_wEe7n|TEI9_C5ldzq;|_c0#}MvPMGjdjIxKl4f82bkew%Y)1m&+r|k-YrPx_(|sO;HQ}Tf}ds{4u&r%^%)P|qM_(B z1^f&%weeZz`QYc6u|2b(zbW-u0)Bzn2SyxI>O-;gA~V(}%Qj|;tCyG&j~29_QXj;K zz9^%+#)Tm`?!jV5a*2jT!5KOo`8zXm3;LB(-+zNYWTw8` zsq=ocjrxfB0Prqm7Z~lNwBKa#C(MU}KV{AVf5uF0`JCAe{(`v%{14`Hz+W%zePg%wxcI=2>6|^CEBxGh)dKe^ELB+i7i_ zniw%}P1h!i1D*$WVEzEykr_U)B0ebf?+WhBJPMq_JQLi78U1dB9;N;#gS#rO z0PfF>b=~S@Ml4$gFr%-uv3vYEfb0&^rw_ooU>(d%?H$5Qejdt9en$LJ8gLPKIP-1b z5zJ44M>4++&Sd^K7(S&m5PfJJ&5Zh5VVlyxL%?Xi#>HUty~bYfSmv|9fn;}r&Vvvm+O-P&ISBr+PUPui7eZ+eV%s{2c_|p%1xkZX10TvvK0l24 ze(>SUSf{L0m_Gt%Gyeq6(Rnc9$U2o7{#& zehi$){3dudGqy3-IXVx)I%Lgf?hh_trnb*zo)0c$_JQFGN<+x*5zM!M=P^G4Mn6#+ zLUysd#@PN@kJNdn1$-29A28ZRX(;;8TEdJvS{E{xfsbZB349DQ#oMvW8^OmhKMOvd z`91I==I_9zIuEmf-OSy9QwVcWs*yT%`Y(f1mE242DZ4LHF3Gq^_Q;c4I? z^M2r3=8@o)%;UjWhbax83|_^In6j>Bo)12exfFa7GumN2nHgnUPhmbCjP_F+ehK(A z=Ig+9%(sA{M``$j;4_%FfY&hp1$-v+yI`#6l!jB=&u0D!e2&f|lEG`4sZSB3ltv5y zpU0d9KA#!uoE3dTX#}ZM(SBz=m1w2jh;4d6>P6eBi)FJpcj zd^z(A;47H7gRf-%7IKtT!{mz7>5#Y2=^4w=!=5-^Tn3_;%(U;5(SV1!Fy=H1ap_ zojPZxgYRPQ1xC4)GKYZgW*!5+hnd=SFEh3o*87;TE?VJVN|}gp>;24#5$glYRDZ-1 zrA*Y(`VcebYuAQp`jg;4^Yquik1$hQJ<9w&_%Y_)VDu%WQK{f3n7e{e7Nt@Bz)vv` z13%3?9=w^E+O>r_5Bv=CeDJf(rQqk7mw}&WUIj)BQ5tm?cq=nv*7_ndV!^tNncDsm zGqwF?<}G0KAEi;We!a^4cQAZGY19{B%%e0KVtrjhF}g4K4QA@QzcP;l{~z-d@SDtY z!H9KAqmKr^#asb?n>h%6hxs%x;)&8|tgqI;F=PF(zRQf*w7$oTezv~P4F6ft21=t* zFDtf{8t(*u$oxMr{-)%zgFj;K1K!0v9E^36lItMwC(P5ppE4JM5i68jrQpvs6t3l9 z_>PimCHNoAYrtPJ)4KK*^9JzO%y)tR$&7fh{)-uXV*NKW>|4KKrgaTMDT}rh|6$Gm z|Cf0H_&etDV8k?~EQ&q&LgVAXKQONV|Hxbi{)u@#_-AIUuhw6f5vSH)nc-vWZ_KE> z^>=3IT6gO_20pjxD8_UKqu!Lp^aNX(QD++~jmZQj@$|{yWac?wltpRGQD6tN2b{tT z|JzcT&jhD2Uj|NRz6soc8UD9*WPTXjiTQaj>Pl(MU%>FM#vg;bFvCx_t~!s!a<*>F z2Y|aXj{^5#J`{{LQyM!1+>3c0xHt0xFyfNZSoDz%>z>A5@P5oEgZnXG1m2(dW-x41 z8hanOKl9UIC-W;{_?pt#?cjmT)UH9yh$GuzoyQ@w4Pk~4Y(tq*whh}mO5-rihV@6| zEbs{C!@(n&^TFs>O5=_L!!H`wfJZY^f4P_udp49sY22OQG0gXa$1-mLQw5R6Z3Q35 z{5BYIPifpPFxF>{zXnfWM!ee&*7-ohk!>O~`ptF-vlBdt8TGOu7AYM_?LuE_Tm(Lh z`FJqqY16C0Qe548A=B|1okk$3|_+gH}F#C zFToYe6jzlxPrx?Gwv4$qcsVnzFJ5Nqiz;UHzYV^oG=ciU$4vG2Gp_=#U_KihV7?NJ zwo#gJ6FA6xFSwTZ3Ghm0YRd`CJHaTI(u9A3S2O<)e4@?=Q(PgADIMGmd@}PO@F~n# zFKwqXBgSo~F(bZgb*(7V8oopw}H`SjqeAa!@L>1 zmiZ0vxy&Df&tv`$jB+VWbbv2lrnX$j>;zxLOfhybb2fM#Gu9g$VujK~YRjd})RxPb z;WOLi%xItO3TA2-`ias+>MyiSW9qN<%=dw>X5Iq6hWRz{wakA9U&s7!@b%2Uf^X3I zkaX~k%(NbDV5ZoEJxYg+2j9$`4ZekWF8EgFW5Mt{r9%+2w%eHz3${C$;d|RgX6mmy znPJ~{7c-`5_b=klLmmU)&C@9k?_qu)jCiGV2*n|ML1~f|yotFh7=2G^(qQld%oKYM zGG~JyVy6Cjn7IV}XXYi~N0_U?k20?WqkfboQM(>zhQDoCe<)3Y4{T2|!@lh)=4ZiA zGgE&dE-6jg0p6manDjaL8Rj3sSccN%RPb}m{lL#NyTC6n=YY2|9|eAqxfHyOnfmA@ zW?HAD9SWb> zK47Lgqpp+=#WdSa4aK44|Bsme1K!2_8yMRQN{89OpD@$*;Zx>;V6>UiVH9sDOXI`A zUocbs|H14Bf62TC{1x+c;IEng1pX&8V$FuQr*s(kA3oKXeEtnHtry?we0UNVZJ=~` zPw;=4v%udm&j5eVJP-Uo<|W`Cn9l$s7AYN0b^D3=UhvP%h<)2H%!m=&ugvhJ4Zfpv zIPBPd*Lg}B7;!*pN^jhotD~4Q9Bk45m@*M;Wkx-dY|N!#USJAhASs!rUktW0BLTn9D&4@%iiFt&-5vZsPOFwX@eMk!?<3+}{>zDw%Nd?Gl5`D}0( z=5^q%%(sCNE0nUI1b1h~I+xUg`F$|@iBdM=C8-xP`XmWHqLdAvCH2uc2X#;C%e)^L zLMg`u?#FyEcz5j;}osqlAFCNt`oG>Ul~cr^1gFxp0GD%BZrtZ_AX3^UfFB&>Vd z^vl3lUgMj=2QohZ9?$$7_#kGiM@bWO-bcR<{oXfT0iv(OqD3|MU>VkpeU?(|Pw6A7 z0v{(~4WELPQ&f~M=z*XW7jDuQw`U|Juh=OUWm}Qyl>b)T{2s7*z7^OZVcXktofxnU z+Yl{PB9TCZCIpyWZ?||5gDy!!q-wJWKi+tGr zX!pdX6yyaxxJFFd?bIM%`Us}&Nm_xYx)z)VP7mT`c;MyW4nV}ab}vvzUyTR$wfj;! zRpJeW;OC*!xwyi20{9bf#w>ir8ch43E(N}oVC|Y_*O{Im^sO^7y&Dj9)2`8UKM`-C z1fPrPJ@Ddc(!U4Xll8G37rlbH^HG0o46t|5dz2e4NXGO&mDRbZn>J3;H#g`_2T#ZJ z{qWJ(RPa)8KW}O=%GAzZ_MeZpdV_DpbPGNnj``ZLUw?XcC-^N)cXpT-pz^VA5CfoA z2N!n-55x;;;ahE+Hi%x@51x;o!PX7e?*s?HLm)^=*k6X8*Gjq{O#VemdJR9ky-xZP zJObjRZbQ!7>txC^tsAb&z;x_a#3*4e9}F%9^Y%LV6fkeEldlD5>G6>K5O|Cp56Rd! zh_QM+Bx8Rd#_923r+wUkdOX-^n>=2R2RpX=;vhX9?9{jkdOX-K1Rt!&gZ(b>L_Hqt z+rWqD@nHW9JV}oShaEgwj|ayf@S%D(d~$bl+VF)^ms^30_W@TkV^aO0?0b7Hj|Ohg`lme$0ILExs6DUM1^f$`>e?NPK(yzzdV$A+kAh&GPouIIKyciVR)xG| zj%PL2*)-~xg@`G{NgDOb(Ro#VtVd~E!N(LWaOQzO1|K^|Om$ zI_jp9@_@j%w7r#Oc*iSVLY<|(H5XspcH+Ii_=Ggxqv`hhvuLfSuTN%auXXyPlJa8P z_dut@Z=KkjAX!AG!k@>;+lNkt@A%t(3&XU4wvpPFoPR><$#}$bA0PIMWZJ{Tn5^}~ z0WlUt{%KU5Mt{hKPsOPAjJ*8m$WNsGW!RKW8d^u-N6*u$ecEfP@gBmkiz@}?0p)=f z@_>ckEOGGfbkvJ<&`El({bJ>%r{%OKgYLl;>uK7XSR{=<=xg)n%!ZDJar7&fS0|<( zio^ZEp?nKe8qd#l==1e_i#C=uZSWS6ySYwVF84*AujQfX(8Ia#v;inLTgnI52|Zb@ zc>RsxPwU<;+pe6Bt6h-w^1hrKrZVLL<$(nCK*AsEV~j?<& z^n6FRbKe((Qm4~j`f~Jqy#DMq-BoU#wa0QxNE0_BjJo%0G1~T1!*W(!*W_pZa23~@ zkskctCys-E+eFrIMHW}(Q+^Q`+eyPQd#FECe#7dE;9^6bWOJo!_O_bzY|@O7fH+S!1ABV%ZqIMHQ4_Bn@NtrKd%F4 zK)O5nPWL*7WPS%m8u}`J_N?QNnhkrp?}072D`l5%gWjb>_w3rf!4lSV|7l;)T0RWx zgeAB~9e<`Jx~y>wU-XH{v^>_ZJl!Ly-5+RmjCv?vd&6%wmLKmZy!1)OknGD*GSZBn@K@3VdkL}-zTVHlTn-cmM=l}R* zA-;2ruNvwT6Y5tR{#c}+1TM1ZgfQlu7m@L72$KHnQ%!yE3b zvl@xmV4wQGmG~f`tC2JWZQG0MM-U$M^AMya?LC8apharE4JOX(X z@;KxP$diz#AWuU!L$*MkfjkR&4)Q$Y1;|#&i;!)Qmmn`gUV*#{c@6Rx$m@_dAb*9t z3E2*L3-UJP9mo#Idyw}be}{Yk`4F-b@)2Ygj4e~o=cP=iiLo5(01P_zjk|4q8r=?3Wz=>h2p=>_Qx=>zEt*&lKMq(5XJWDsO9WC&y^WCUa+Boi_UG8*E7 zWI@J2#zMwH4ul*8nE*K$G7)kJWD;aD7g7bOhWH?U$O=dRQUeJ>Y9T8j zt01c(CqhnwoD4Y?avG!#aysM;$QsC*kh3A@K-NOeg`5XDA94ZY!aYKp{bt~}Z8@EDc{vs@OC0l4pY>CP$b)S7A2ZPjhDK2bUTuf4T8%XX+Sd`+TC&$I4Nt0H3 zs>^+Wno0UiYWbCm7mamIm|3u>c-kBlHVF|cQe5#M5rRZq&RF7wuwd(=K8Vd6uIi%xo6xXTKQoyE0& zzb_D+)bJ>Piiw1Y32LYm7ajHz7YXGH)z}6PNO57S-;XrRR+OL~km7>grf5l%ykN#S?XB!Wdkzj>4Gp-*?qI4brOpj?jPBti^-PRVhXr~pCF-x$r9BXz zsLdCaoP=$<*6_YFyzZI`XXuqlp2f9G@v3LLdi#2&CTtexT3<%r8vipm3R(F3>_l3$KR z_jReHJW%fedIL$7yRy1|LLvgb7)awMp)r)GU9j(O;Kzc>edH;)9Es*5uIROddSUfNVn&KKH57G??mAzxw4!p^ za&J|&&%Yv26Rcf%!m8CL9&_w*$1f^%FD@(h>~;Q0C!ccaX?3TcvF6OP&OT@Dx#yjK z!G#xHyzY`qFT4DTE3aCA^)=UCcl`}FZn){@TW-DW_B%G-dDoxrzUSWiHr@ZggAYCY z=SLoW?C~d_eCp}VTb_CLx#wTl`r@{iUVi1(*Z%VQ8-M-3H@Cm__B%WN_U?P{|NVmx zcYd_%<4->Q?DH@F@#R-v|MOq}{^r~N{P(->|M$a>KmGj6ufP4iTUe~Nq-47zB{eO* zL&r{?GrDx`*1bp1UcLMD-LK#N2lRIi7&vI~kfFndj~JObYP2hB%-C@Ujz4I^!4nUe zG&!$&iO+>EQ_;uvX64PElV32mu;_?+#q*CmYC*}uqxJUZOwFA(ea6ha%x@L#&*gwm zwmdg6*|HV#0%V&r+43snWyrH9L-2-!#!35|0_BP8-?i>VPSX?Kv2p#oAr6&+X*)v8 zNYmcKw2!P$+>ox%yP=eFvKrE9Tm$33k}WTmLeP#E{g7KBk79GO$3KhRlBECJbI#uW zwoDao?Cl@MUA5^+C4cm zZ8Dw}aNvzWsdz>vU33r~@!iAD*rjw4T}3y1*`X(zLPluPa0(Uz1pWXv&0xNR*Vw|it%{o-~@57m?#dxfWc&Os5nd< zE~en>iCZidWuhGK1Y9DPiV9IFmWk!UE2>1b@CiS9G$3k3P}GW*;smiutQIGVW5luI zID89nktmI7`IE%S;uLYJI8D@v)5RHLjW|=BCCCr)rMOD07gvjG#I@o&alN=f+$c7Po5aoH7ICY%P27$zxNa18io5Vp*t^9& z;$Ds)^*&p2gx`_AeiP(JN9QZ*bkETHY;S$T(fQU=$STM>N2iTrkYn0yDfV5rKpt7| z=sb`9cG`E{v;%nwWUYPIgFBHw3i$@pS2;T0J{;nA*ninz-*xK_`>y-eIm9mL-M7(U ze`gc&Ef6e!`xXe6y+c5H+qb`xfqaZ3{r0uUiy(Cl@t-aBw^G-EH$k>RNdHGi=Z(pD>8Cb0(yvLeZ+~Geq{PwrPLzFTZ%6vo+wk`rsE^;ieJkc~oki`o z@7lRZZ@>CYXb+^{u?lgw9`c1F)$xXX`>S>KT{q7{{-}NXv#aczFDQZdA!{L9?AzZ# zoKdXaQEK1y6k=`14ov^izWKu85a?a_CyX#kx4-)Z@@@9b>oOd6*Cym8_FZ2UA&0$nZ`e0qk^)=Mxn!b!*FT3NuY*AU(i8}6 zTv`EH4}tEbKiW562A#`FAaxFleWU&9H%sl?KO&*&8zDRGn=i*Y{pkkeSpIU<>vFXJ z&b5$@kT)RTU>eH1LO`H%g&zX_E4D#?bfn)k3sPa<^(EH7g%uF2rwbp&-zfje;ixB; zyAtJIxfZesg7U6%+MnK@jrw5PRhW0xI{W7+> zn|<@uc(?DLb|QB|N+5L*lza6K`{ru|WVpl8m$(RJO+>y*Kl_~js{OGui-hQVRr0Ud zC~R1Y92y{(ZJWbPb)Y(|IMG%-bMz zY)aE{)=FT0B*@8-Qy}+3PKBHXse_yjIRml=awg;~$k~t!A?HBWLe7Pp2RR>d z0pudc#gKK7OCXm*E`wYSxdL(}59B_`CdmDe2OtkZnm<|fF&Q$1Gj5B%-K9SaP21t--8A

    EZ@q-l?(ijGk zJtHZ3#ZC?R$F?HVDgUjw`8{Csd`p8&Nf^RhCkAYz@jgnS(VanHt2RX+FSONEq!i(A z8m~*TZn$_1avCp7PRl7TM^58c_M*ya8Xw#Wakz_oG@kb*B&8rPh_OCP3OF@5&x7$h z%P??Sfu|Z{c$PeHdN9|Au|5lp{dE9he9uB-a~*v(_(+DZ&^TGAN-sW&AuP{>I~P~@ zFz#ph1e`IevYg7Nv8OHtzLj9>U~t!&9=e6ZIuqOth`L#qfxDmR$;FtWmB#sccq^%H zRvKsP$@;H=dj)gnqyE;tjTS1zEh6B?eA{#2{__LwGVohqXNPG4D*u1r0Z^-hi@SpdR+oFq z!3Ti{X*c|cr1{{%)(zM1#Pk4|>VcF*Neyf zAxO!TXIeL0l>wd#9wqGM@LzH%cr*klnZ{CG8j55Z+sxAAA^9Qj7(E`6-vN)+<01J+ z@Hjml?0vuo>hWNo03NT$gPq2V57Oho4j+jLdOX-K1Rt!&gZ(b>L_Hqt+rWqD@nENZ znWV>q!w#OT$Ae=K_)t9_98G9y8@#w?#{&i4Wrs(nDptfY|@!)t8oTK~S@g8_8 z>;DAK)#D+hCwQ734=EGD)Ae{rp?;a6$3qH@Q_s}nA%(_^XX){fLj97b$3x0X;MwSQ z#6!yG;5m9cq$Yv$^>|1f2rhuE!)h}b`CJIvno48pg%At)G~~2iqCZnNAU^_P13!hF z*2PZX50Mu`x`2N{PIc{$MIhQ3elPG?@KF$~^J!G}0!Tk_74nifp4C`q)2Lq-BBl^0 zY1A)A=T-T!9;IysA5*lznFszDeC!-C)s0n}+H#!NPi;u2wj7VrQ8$&82lk-{df;k? zO3DMu1Nzl%6F<}h-GQLV{BX1AR^9r9qa*cBaP7W>dY2GL9%?jQ{Smnb_Wk1|=tepU zeN0$Bp6i^GJm=1DlIMK2NpFEoBzw-nG2E=r`%fzT_wF}FWzl?5I@l+U9pw`x&Y3I4 zgp7rSSy{rH)oCuu==bRG{#i-0eE6ui_V@m0=e$$2wq)(lS+k0=(xwjcX9qezyXK6# zEDLE*UZ3|)-q)gQ<0br-Eo+vhjp?>&-qIxh?_2BqR{Y(&ZW z^8dEA&S|sO(ZS!+lniK`K2q5HNzm^!CQD>&S|*ZE#xE!%1=IQ-S(w#f)-qwAwMy8@ z{?2I`{ZYyfTTy~a$^-qg$p@aYU~yi-G*_A5FQ$2dp+74`Rb@??HdTWPQCu*!GFTi8 zc-&RmWclw3F`r%{giq0<6vhgX>#OnyJT)~_y}q*L+N{P?8Z>4E+*KY;!&6;WZ#cvi zVtRF1fiGC;tJZWH{*vb8)acc!pIJ~)qG`|Y1*+V^peL}$UlnNXVz0oLf~%L#sPu*u zXdw{M{D~+dAh}lKc zXEw}j_^Y9r4Rb>c*QZnn?VTrxSM=oA33}htTTtq!R0w~da-~~4)3wt1bVSLTJhcBe z&>U)|Q3zLER}77uRKKKNPUujekHN|K!m8>YBQaN$3nF>g$91c8efhWDJUN;XYE@(3gr=%oc|dtUc_48-pzh&KoW52qRUS|tP##bo zP##boP##boP##boP##boXrCVF+&-J7S{1nm7UayMXZmAHYOFjq|EZTYCVX^O{8Sg-@_8xg%%X&O^Fpgf>F zpgf>Fpgf>Fpgf>Fpghn{J&;`Au7n@$tam`;YnU{d1n=?F66Q`p$|)+!$2fZZLOeI& zvPlWoV%6YA9#HFm_Gzz1K2d)pmItir?QzY~;jQBBaiQ1B*tM?`W@giyoh`!Va%JIv z8D5Lj94%L6wiOT10pM;VWP=*wqM%@DSzBp=s%LX}K#GgO6c>WF7tLWvmD#2|AjQRS z#D!(jBy|SWraG{hDl5fBPmT+O#!63hIbP~GDc2oX?5obNT)b$kYr@QeMa9$RsIY0K zo@iagN^x;O!|{c`OdWT&u6}Ci+DLIRQf)6<+WW27UMMcI=}Y!j9A6X^=aVeT)ql13 z3Qx+bF7wuwd(=Lp^>$>OYbM1-Cp|9QWrfAgV(p#K!AS+~vRNK?xd+D@aW<@qYtU%X2R2ikrMOUIBM+>i<^I{)DeW(zN`UCHT~Oc~QW(Y(a5RF0L#W(MT`->s%akSC_lJzG}}r z&x!aVd4i?x!*UC!O&{hQHZ5m<4zi-W-1);2$pKI2nxXcQ`^fRF#H`iT9zP4vN}SsUsuAmUz6~_d zw2CqBLrhC=12Y@HeWndmSXHr|c|d(Zqn&lAYEIN1pwk+aln0atlm`;o1L_+PiQN0D z?aBkn1Ih!+1Ih!+1Ih!+1Ih!+1Ih!+1MR^BHr$%1e-T(~O+j%U-6f(@0(+n$81zrd z%39`L>2}rBR=di4RayRkue`P_Sd+D^e0kPb*VwFbUs+9-+h5rpZ&B4@#Zql>iZ`gMZNd+Mma6U_q)a^@W!bDPywr9KkZc7nAnVu#w| zLMMf5Q!Mj~cwv{%yp(vv8(DDq{l2iyGp~y2+)|z!B}Z1qDT6 zwoE2VM>s1RdNh!0d@7(7l-3f*fv{xJ_hZ4TSWXJ4JzA{|e(LvQG=6WOLzA(8F)hk; zCYP(Vr)r6bmGHA7vC|UUNz_yud3CwXH~q77=JDQTujiIw8=TD=t}?p1V5}ale~g!G zJjb=P(zJu()}FmwC6Q|qYkMfJDY;Ip^y{?u-+0*3#}Fn=oMXJ<*e}7y5a67>`#;>& zCXOLQZ>NRE5DKTxc7|{Bg3u9Z)a@zCZ`Q*DtqG<0ZHav$+0phLVUFOiF6(0mQF|?9 z$Lvf?+ZV>kj(LOP*B;YNV8gj^%zpEm8j4$cTH6>xlzyXqlor>Kjv+*8r%tkC7TK}( zPraQmN9y6m2*S-rb9fBFvy`|wQ-Yt{M;UQVKDUqB4)uL&Ikzt;ihaMWwWl4O+v~^1 z+RH7CR#QiNJ2r07W1<$=*1G-vaN{#ZeH-!gQfRisc{|yOWPB59F(<@+#ppuQi_6{H zTkIF)=QZWpvhJcNJl(`=*wNc*+BNLx?X=MOXNzu|%ujC`&O69!d%4RX?$>-{wqxF) z`s3%A?U)?Xp_p zykkLS^?~D@t0qn`9$W6wq_Hs+MRngZ#eG{Fvz-XHwK3a?a9bO@9aBT~`;J)clzU9C z-|X4%(fqB&o9SII(imx!?Wy0^R+w!8<7p?tePOKa@de7G@p)603GF+~mWegq>QH#d zj#&@I%}$u_S-=i9m9gEQS=qF67lTMJ^SVB-5*LBOX%#MB7PnIGP|gc`O^Kj zvDs;<`)j!LQwzO?iE4jCMUTyXK;^MMEr9aA#`-Iw4S#EkO&?K0g z!1+KVV}0TJIo$kGZmA1_Y1-&G%)}`eo+BwS8|)j??#BA2EzA$+IyyBiG`RyRlJky8 z#uVdXCxYi<;$kO)F~zvpX^&%yE%jWCyM>-pFh9+080(`))DRR-+R8{PT_o#|woNZH zJ4%<%qhhvW-k|#Pftc->o=(TnZxNms#@e3NHbxp{dzyUS9}_=%}%8EHbof+b=Vd*X&fRBcFa5%tKa1Im~~P7?08K#*!cRM-xCO~#)(}` z(3$J2@>hE0JJ}n}m-b6C>iy$2eE_FXIkDJjfpZtFJtr)0_Io1QFYf8 zDM?t;rmymp)dt;*y-mL+MCBAOm@$s;Tg=wW4UOFEf5q|}s%htjI!3p_Y}DvjYSea@ zRma+Gx9{Rn^F%+^w&cXai*2`z-ZSui$O>n!JFpmUYoF#>T)T9sCoseMza zZf*00NO3U?abcM>NgZ>v`A&^P1Ejd<$#H?uSm~)Q_XTPu>4VOA^U|WRt_d>>78OsM zqrxT*UT^(HNO94>;rPN|rj9#Xf8RA{4W+mkp|%&z>FKsrb|@~gg%}~MIKC(-&L>%v ztN;3{s(jUx@~X?cwdEeQ4{2MS8$)fSxag$Eh4wnN;#zzOB@mp1hqPyT+~pn|Ys6qg zE!yThAjL(8y~IVEYmcgMd^{kl5D`lg;ShFa-yl(L5 zCn4MG29Np?`IhAL@>R*{WgC%iK)xPQ2l3l4?%0oexGVtwM$?Bw(U{Jq|(=U2U<=huCW`F2Puq$6Yq zBomSaIS5h!seqgTxz_r`W%;^XdNRs96LJA$J*Le<{t)Cz$aVRqgYy2-E~?SDvtH^@+zEd))DhN{#2Abn+>uo>q7I8Eeiw>+EyZo_pT;7hHJJ z#p^D)^s>vZxbmv?S6_4Ob=Ti;E%~meeEx=zwy`qdvp6+Z@;tSZ|}bM{@*|NaOX$6 zKK|s>&p!X+A76g;^*{gh?{B{S&ws!B{(nFG_|wn7{QBGPyG5++&zYJ#ZTgIvv+`!o z$uF2&Saig^;`v7&wV-6-(R%xh=SS6kzgK&YPu$v{%i*7#UN}5CeIDcp$o!1t^b*KX zkhxw+c}Op`wuJu1cI@4~$!U5LG%v)`GCM-cNYmcKw2!P$+>ox%yP=eFvKP_`*{;t+ z*GrRy1JgQW3(=!t+)7<9t@l%cLg@Gb&9^ngg}Ppvpy5#8Y$-1AOjYQ}vVOLL1oeOv z7xwz?MS}W5HM_wBQe5DDC!zbX)OE224<#l^agmO3D;oy3wXcToKzA08a%T-cp{&9k zSQK>f4Cj){RU;D9WeL&hP+VjSM1@IQnmHHJ_pkm90C!|_GT6?!fA-83A{d=LBD1d5zG26UTe)xTOdTdJZ64h;Dm1zG%k{S4}hX zfV91k&Qs0zBhx%9Jzn}KO#RskUOf@i?*SItiwDdss(Ed}15#Xc7j~*KP0^k)qg*BB z0nG#Svau?6WpzTkql@ke(FbpV_6Ix|s##Rd@88jKSN(@aXeGi^HM}3I1Ih!+1I_CJ_4T^u^=}&}U46Z-4Rn&KVjJ-QMhbj2tJ+9qRW+3dn#lud zJ&4$`^p-t6CHz@wy#uVB3g*qu@#BNxWo{am4SA>`uUBoDq)2%{c|dtUc|dtUc|dtU zc|dtUc|dtUc|dtUd7#yJ0Cz%3Um;2O^Z2;GOQ+Rzw5mu%9#CJQQJ)HkC{Wt5k`?bx zvLw4*o>eh?U55551=CBW!%x||ujKoHWA`5Is@mc=zhZBBd`nP!y!iUFt(BJO-<57_ z{T1)}#=4!4cYRvAyqNbPEnVSw+v{XrU`@~+i1PECTEUGDsMXc=dS}<4YBzosi6)bz zu_B($>^$4O(w&R1zt?zbT+7^n`XU&P&MR^jEI7JI`%^ErahZEAp#D}KXl@Uv=bM__ z!>atY;sG1>fq2|6w8bwd&ZDzpl@izk6~Ul?QdZV7?Acv4wbd>>=A7jZ_{wX`f;Cyo z@RF~wuCZC=zOtGux4$y09Xd)Kb?%c+4Q+$!H%9xU7RspdfbxLyKr8S-<1=O2Jd(tA z_O0%hZv`Ezs-QfeJfJ+FJfJ+FJfJ+FJfJ+FJfJ+FJfJ)fg9p?*nqqKX`&d-Hqp5xL zqiRKK@PK+ZO>5`{Rfm1;0ks}P+ym;F#YV1DPjEDHN8_CHTOv*-%c1j^cfM;o=UCGQ?@hC2lD`LhRwuuZn= zW$*C~w1!4Q?;+?NYM>|G%x!%bdWRY4)fb5J{tUgt4fN#l9)aEz13kICN1>M;f!<@# z%Q4WC?LH2@sRnwo-6x=zYoI5W_Z0M|8|ca9Jq^7X26}RNo1r(;Ku<1j3-o3g=*i_h z1HC*0J-NJRp*Pz=PcH8{=*=9OF7H+7%{S1K%XqHbz2gn^ zcxQ%ljMj+y;7bdGA7Rv4Ngk-h0q1GtiUE`v7`N4D{skK7`&< z13kICozSZ=(38vi2zr$UdUAQYptmdny^o={+(1vZ`w8^C270pHPoY<3peL928T6_R z^yKosgx(4RJ-NKEpcgRElgs-WdNl@ma(VxRUeG{KF7I3DonW9Rm-k=jt&TwNJLsJl zf!_DfJ1GLa|3U9$13kGNKS1vk13kGNKSJ+R13kICpP^T0peL923-nGm(38vi6?$hF z=*i{%2E8=~dUAQcL+?xjJ-NKy&^yaOPb!ZN5N&50=t9Z38{I9rK{KBLckz(EGqZPqteEy$=oa zWV;KYx6?pRF7IgQePo~~mv;>Gc156fEc8A$(39;R2fa@s&|3t(&kXeB`jtZOa|1ou zu3Lzt4iV@rhF(VlJ=ty<^g2bL=Ry5GjX-Y+%FBpAZz=S;80g9Et$<$F2=pqU*Udmr zZtpVabvMwH?JkF24+A~9JTLTm8tBR8RY9+pfu3AmHS~HL=*i{zpx4JhPcF|7y}kx| za(OGDx1WKYTwVZr{S5Tv@@k;Bzk!}yUJ!Z*80g96)k3eofu3C6O6WNw&|3w)ff4Af zhTfnE^iG7{;0W|ig5Hn_^iGD}&Izj z-WuqQjzI5B=(!@$I~#gqBG5YrdSfHdTMNB$5$K(Z?c`q#^yGLx59J+bpeM)k`Oq65 zf!+nsJ17FZ3!yi`Ku@k;M0V>JP@p`ZJka($kS0WdyR5L-S>h}z%5~;fRxkHp53iE) zK%#g6@n12z&^gVsxEALm37BwK4+e!)QXbGfkSe_bIH7%F{Q}LO=;*MpPIp6cM%q(X zW~AreFS=$pjy-Og=UI`b%HVf-C6O&ZK9<*qC+J9?LBuO(7hk?)_Sfw*AzwoE0Mq){C|BCxSB4ga7-) zaqw@Ov?(IxEg@2V!S|6w8uszpy8@A={3b+dS8Zx~!_-t<>q;G_P3ipE4c8J? zN_Y=Y99kU%&+I39rTI7xpFz}K1i1m;v4%Y4r1d7daU4(nl;b$}oD$JL<>7|q?HF0K zWAvn9`2oZ6SNR^xf5FQS-2R>DlDtS-eg~HSTwY#eJH zM3*&=;fp>InU=>ImQTV}*d*FESRJDt$``msM0K=`cNAXwq+>|-<@g)vP@867I6A+& zMRc>KH!N>|0d0I8Dpp6vu)$(~P&SF9WcYXX@Bc~dL+Y5z%MX33LS)*u>dT9Fh3J9N zke;|wC@hYlPn{{?aZv|(sB!(L^x);E{$qm}lyn~3zg36>cR`zyRXbmp<#CsL0yQp- z9VcAUPL~$tx&w=S)r)d7GZ$e(z*pm{NEA=ZpZ?67!j9HHCM+M%b(SQ>-<*y-Mep===AtVVO`qk75vVIEJ^bJwzbY_v(`~4FHOmS#_1!4 z&7TDQPGhn}#-?Q=31$3(GEy+D?~#RB9cC>P_F1cho$T+NmeC)j{IC@zsH8m5Kbw3| zyVP0aO_24+xQbc%4Pq;0Y@o9Ym2_qBEAFW0)?Gt`OX#CvZ+8 zD8g{xoWMPC+SwJ3qC{T^?m-i{zf3z0Iskcph!ZjZG7vHdG8i%hG88flLdTSJ1T+$o z2^j?$4Z(d(+F9Ee2k9aezvP8< z?d*;GfFXA41XPuGa1rHjs(=F})1MBYFtAo2-H29ak_9*F#tE|Tzzk}Y;^ z8cMgMh@O~Bp40Vc+QId657Fv^ezN4&({#<3G;O9<9#Ig>hf)$5fwmF zpgf>Fpgf>Fpgf>Fpgf>Fpgf>Fpghp59!M6c`co06&qVagDJsfu)_S1uQb>;9?`;V? z1qJz2!`aENTvl5fs=r~1pB?iC#m|np+v8}*)KJ{)cvhL(G3>Y|%+TV%Jgh~m?a4rW zG&}w>Q%kYhsgvxOMRwfmgxTuM^Uy8a#wpx|jiu=^j< znGxfjuH08v8%sSSS+*2PE%AzNvQtyxU5v~$6-|%TYp@fnZ4o=v5EnYhv_Ub>EaK%| zKJ$X&5pQI{<@fu-I?uc+rgKYqZgaoao$So@RnwCSX30`eP!wj%WVU!@^Rl5f+r82q z=JDvXmN*VXRV?~`ELauGNddLTto8N#v1R6p*uR(-Wjd29ptYxJiCJ~R&WprOOKc}m zQSA;Hm)m^PKRah0?_HvM-aeZ>;wtmHYfSc;;rb`6V?%b9R+@HD+}g9uZMr_k+8&B) zO0E+t{W|UaHy(EMF@y;d=NNA|_Dk?F1UP5!{tq{`iDL-S+i9UOguv*m?Jo>%la5X)LskOF+0=3laX<=W8R?n*)iP&#<4wq zQ$ulUPiq@Ph%(-2AEm{0q+H1{ZntpbkB}$M%=~_JWJ8EW=#oxZXadD zHTm2=YCF{Vt>xUlpeXkJw$`3@bZ)O78y9#2OASx)9qsMdxJ8eNT3}o2_WKPxFJ2qp zQWVq@=j~)ClJQNb#heiP^u{r>i_6{HTkIF)=QZWpvhJcNJl(`=*wNc*+BNLx?X=MO zXNzu|%ujC`&O69!d%4RX?$>-{wqxF)`s3%A?U)?Xp_pykkLS^?~D@t0qn`9$W6wq_Hs+MRngZ#eG{F zvz-XHwK3a?a9bO@9aBT~`;J)clzU9C-|X4%(fqB&o9SII(imx!?Wy0^R+w!8<7p?t zePOKa@de7G@p)603GF+~mWegq>QH#dj#&@I%}$uF%fk*fm9gEQS=qF67lTMJ^SVB- z5*LBOX%#MB7PnIGQIjQgmnLHY<61e{u*zk>1{7@YfqT_c;ePSzQxPTVj*sJ z0v?mQ2ZW%N$5X>0XI3GTd8_dMnT>e;9?ml)L97%}xuP4@5H77mqlg_PG$4d$u#)f8!J^+}Ab6 zw7apsX$!+X7el9}g(i1EMRMK|$(UkX>_qTfOkC_lFs2w6JMD2yv8A4iaktQO3g)M| z4P$+D6#+rvq^*p!@rq>q(YEPjW=HALc~s1H%o|jHJ`l4V)6?lV`Ypoq!dTnW+Qvwu zY)_NV+hexVy!}((9&cI8jH`rs<|S_HPnEf$xY>#H-lizypbpzYZTkj0W?Q&e+audC z^ITl*m>7zm9k1yIyC~rEdji4LII*h58yN^Cl)&` zaPFeD=Y-|WeosWZyk-(+JSrZ?y%c*bacxGov)Xh-DsJrw^IS%*&%fF^-{&lHmo0Z2 z-)kkWmW{ZG|8iB9RhtbI#m&w#zv;c3akFFEJ2>u*!}+Ne2i4}|l5uNKm{&v;c>-R< zfzN25h~_uyc!NJ&elIro1~V}^*7neG6{Qw?j?rIZdc~@^!s9h{oL*hS-#VVt63$ulumv!fDfoIfqTl znV*BKC@**Zuomo`eQpZh_(8IWURCZgf55Y(a@C@8`hYf~AmH)JF`)0s@T)yYc;D%saj0;hcMW zlF(5@MS0C~tf1Q0mMqm!rk=v$X_Hm_ zIrPIsZIOcFyy+1ys}$R%2P%R=|D>#}WjOYC)zntI%6wH>{(!H%wk%kawXA%3)>zlr zEL?o7$#VNEv)Z8xZ1|LK!#HljA6=?3z;+npO=*%E2iHFL-4vH8-FD^yE56NcNp`zD zt75pXhxRH3(@W?GD_i$Zm=UrjI+1o&ZSksO6PwxW>S~YI>@IHA2CT03cv#!2UEZoH z7wdMuRW&Ax%EY`6iNa>9T11VCw5slC4V6jwQISsOy-*W$2co=bPAj<4NhU^Mq(q0c zBxyX&{>LlRlD3A8uS{!`_Fet=tepB=d7!yH(4*z=9c}I=sq&QvqVhn(kKjk;HMNlP zfbu|l@_@Bd!Mxe@72(P$QogNXg5o*QfADs>lq zBX=a;AB}G5OT6Y&i`6=inEhVgYW3V$y(`*3sI|TQ_pwTc%d@vACTc|duf?RX%$zN!hoMXYy#dKRWW zC=@6UC=VzPC=VzPC=VzPC=VzPC=VzPC=VzPv`G)BXJOi8x5cy4>RFh0dQ+8^*d9>N z03>$*tJdotQ0qa&k)Yn79kHttMKR&upsk({YZU70Zuv&;NW4GP^I_`wu*8e{#w}LQ zhc)&`yZ%e<@!ECwhHadBJ}j(@+O>juJ}kkX4@(xQ1@5xKVrNlNt~0-~dbuaCmw@k= zQ&g0{m+5hxREpB*UGQ-&bT5UGoq~e=se75#Xi|RVVrO2J-xmmya~jQx_>Y33{2Aet z<6>t)?zC`rVx3=#0_GLZi_#O3TPHj7r zJYK)4qRC9nPML`UW)&=O=4Rz)W*SACHq*Qa-EU=?nPzJ7vt!<%_}MXcdmQbU8j718 z&niSTIW~(#LbE0WCgqu$bYksRS zEk?klSeSC?4lm!g0`O~8Dk6RQy{Pj+f5yosF2COw)_LYtF`Zk=bDR4Nf$Yrn zReRW+QD!M9CGFmk9>Df@7?Oy3NJ{8c)N^6PZKv=Tq`>|kEEGGrj9<9~}KlS^u zW#)?5znB(fI+JZ{?WtN~P?N|eM`EWXwv(u>_VA+1ZNBNBoimU3E_*$<4BO~z)^L@1 z-8Clr%y9h^)=qqMk=bPOR% zJ9UyBv&fFMf9ma+?%A=;h}#%~XDOQ2tSQ0I?W2siCZF3!ZHGF)wVc}*6ve*Z*4opK z&h7PM;{s1$so^QUqrDv)x9BlZ3v6rMe!pSo#cShRih^3=yq)YsGQJ75m=j{ZVsxSD z#pUkpE%poY^O|yPS$9zso^Ikb?C9+@?HYFUc3SBCvqiT}=BGCe=N;s=z1(FG_iMf} z+c9rY{qb|mc1%yB;^?;s&(~sYPis40i?TgUK3|K{P93&~q4UCs&evkK(*nm3?d?2@ zc3CZP-m##v`oM9{RTC!|k1h9T(%2Y^qPp*y;=Zko*-nJp+L-M`xUG%dj;W#geMhWz z$~~snZ}#l>X#UpX&GfDpX^b?=_SA1{E6lcl@w5}+zA)DI_yXn8_`E60g!Ua~%fuRQ zbtpV!$E=6qW+%+8FR+76Wo-9nRyOV2#UK*Qyspoy#6_TRT7`?3g{}cbZHH{QOt1b6 zA>Dr)o1K=rzs6f>dfQ9f+7sqJp1AdoZ}Bp-ScsdQfXC$S0U>DR@zik0nN`SS-YS34 z_$WnR&JoG^XROx;N?}XeHnoy_o9ES5&o3@63sm}pCf+ljrM0KB-1JtURsJvv<|eec znw=InABbeEFCK9~jdCF{BWQX|DmVqhb0j5ZgMDM#-B{nWg<+qIp;OaBlRKayIq!&M zOffEYB6uz)E_NaqQ;dt9_Bf{4QqRS>Tj)6j^V8ghu|9f44ME|gt&Fs#ie&xKw&_iH zE+#fR<_)SpABedIgG8CMDO%uC$X zpDJ@hakCTYy-iWZK^?Y*+V%~0A{vK?gB>%^#p*Y?J!V}LKRaI24R%q$=l2AHt8rpi z6LjYKs{EB+`A+sm^QHZgjC%igO&`E%R8A~*THxG8YtISGoBf`Mc6rSt%y?8hj(aKg zTH@M_ZfCXWh*aF#6Xv;$T%UinbH2}6^Vk%jp-Gu;tG$~)Ny)s4S(x+PD?y5Nv2%p%@MJ-hnoXC!9Zp8Qo~I`+~Ocu zxy0-MJ61c|_RSV*mCBU|_K647_rUjw+m+E)=mG8d=~h@TRVC#CT z=}lEuVtb&p{dZpuPtlv8xhAQGE|wh$%?gQ@ZL~$m(0jiL&Aw zwNtGFY8^0&jYOHQz6YKtJ&ks%?|~;!XYZw{>U-dOaY_PBQr`n_?x)vUcQDz6b(0Xb z$yWV2F^jO&-;dg;;?TPvdWRb5)h`6S2cUPDfnI%?(0dSiha2e0dm-htpW*F$npf}$@PcH9e=pAXGCztmM z^o}ynlgoP*dJ7En|*P(Z`fu3yl4d@+XpeNh?EA);v(38u1 z6MDxR=*i`6hu$IsJ-NKMpjT?3Cztm&^xOt|a(VASZ?S=%T;2}ol^N*C<-G^JB?fwO zdGAASseztc-ru2DVW20M_W|@O4fN#lK7`(~2=sPBZ@GbpJZlEWZ z_Y?HaFwm3B`x$y`4D{skeu3VZ26}RNze4XU13kIC-=KH4fu3C6@6bEPKu<1jH}uvT z=ta(TU>cT)s#eIIp6juTd+DzK>i<@EWvB_Mnaa#0%uK%xU#e#MnXjtes_vfd zuCJ$)1$P3t&IV2|cNVxV7MvgT`^m2!0G;i;C44~y1x^_^)Ya|zYw@W3$7kqUkh$AxIHbnCE)s5 za3_J=%Ys`9Zf^_jWN`g0xKqIGYr&lgZa)j|G;jkfxYNN6wBXJFH^_o(09Rzeods^N z1-BgB5DV^Xa6>J)71&R{X5jSkd=C5#GjRHNJ{R2n7Tij32Uu|Dfg5h%^!izq8~y+@ zRDcR(t^&B)DVLnL<==r{E}zwLPD8&zkHFq&=r`~Oq#JU_^&Xo$Zr7zqgGlGY%3&pV zJpv}v!MWq|ur99}hV^-KV8_E|z^1_}U=v~RlZVgd9g#b(<7%Y!Sr6Z^5%xT6L)OEW z!B_5@tcO<@y6M#$-Sqlzus#pg9@ZJQ7i<8m7BjjNek+xQGF^X2(++<#5i zH22y!N^FewFK5QK|04OkqqhFbIx5;f%>D2QhtNIboVfL$IMMQ7W1VqrJiQiN#7OSq z%gWBl&C74szC*`Oox5}`=+?c*4m^{-TM^o(Ra^&d+ohX|9$rxFmO;& z@!%mthwXpB@L!BL@SuYaIrOl@OZ>Ad@$e9`b@) z=Jj#4KUnQN0X}K%FIA%n`?w!+$F+yGgLT}LJFY9NGc4~A*#3=NRrq zS}>7V^E7dEDdvuh8Rw+us&u7F&r|97D!o9Z^(tMg(j@{j8Omb+=B!pOvs56n6u|hO zKWK8{lt6XBUxzy)o?EbEN%}dO=S0k)24l9II@aJQ%!LYURX~O^E%I04ex`SqGiTg8 za$QepQjPg@>J~a7Uda2TE|>!;@Rh#9S3hGBq9a~s?SuFF!!W;3bk8r{am}4bkuU%G z=S}bA<6=SA@%|%Ln?AD~pFuG@mwYV* z<|vAapMU=Nf&9{))j5Q-*8Ril44N3sZU+VU8)e%;bQYPC3g{>9DOo{QiV9ExD$vRb zY(1a!{2nnZ0Dq&bl?NT&QvoVK1*iZOpaN8Y3Qz$mKn17(6=-Dz@O%|6-d2FWQReOb zXX}%xz#{%eSu*9MuQXMF+kth*@i)q>rSb~M-zej6l<8xgv)^?!JecQil<`-KJUHwl zn#|uQi;yF;U+{>R+5H=}p#oHZ3Qz$mKn17(6`%rCfC^9nDv*{6 zFg`3TyDgcOW_(yO)ubR+5H=y3s<+w0Ry68$tx#%gOXQH zblHuR!(4P)N-Qro$WejyhR_@36Hk|RK_VMSQ)jXM0IP>%853zlU7cQz0Q=t z$x*u@)_VD2N4L7DZUhcGBkLALXJW0LQ93#1@kcUa5kLC&g-0BJ0c5hl^^Xdr8K4lO+@dgS9cm zi(ZweYb(^+);>d!*0zOu6N7<(pF;RKQrd{+KMvH4WMao(XVz6YWtpL-mu zUzEs6fozXcYr~)Lacn_!5XYCOuA;6~WjpOzG}llQySHu1X^Z_NYU>0q7Wt#^`p1u) zqK+=jo?FIjbcrI0D&_BHoAFrvWBz31nxc7CQ9CGU?ZNMVN0uD)jS!Lx{heHoAr|dDQsA*lnKP_>DB~_LNU- z)vpIm6DshxEslk<9Ou{(;~N~dW%n9F+^RK}6YWe3*UyqxPV@#Pubim6z$CUO7`33J zwI|iCA;dY}PPBi*KxqVrA;>T^LJsEUv?|wHf3xwtwPx13J?YnWCekW>!eXTzjGZ}*-8fl#E3GZv?N81A? zvmDD~VWRD+4b6#1^Ok(3@z@dVGl`D31~_jlCt43Bt(+KBUr-Kqm5I&ItZLc0i(w>0 zQ{7!xg_}UJsL8VzG~NS>yBt|YQPjKtLTK}E6Dy~!=GRnLMVT*f%)iuJs*pY|OYAd1^X2$_yx*^A4M9ib*NQA}%H=oeIS)@#QlJ?r*Qb<_Zy z2tSFG(+1}*PJ2#T*y?j4GV-2DjO$U!_}(kWUR&Ioam!g2^@>!|+7lx#qqH`-tZ-Uw zVY$C@q2D~$O5ZFa^5yDPQB`G4vfFtwl@qmhaQ`3)=cmp%sEK}EGHLCJ z@ra1>K&Tqypw@JuNUo3Qc*BdLU^RC5hLw0b(e}viRdQ*wIL2UI)H_yF=Lf2z3g=eW z__sl=X^VJCSyWN<=7>bwqnd+q>O)mE^NhQMq>Y36s=3j=U?*CRvwzEOY!y=~uw4}3 z?}2X@*;!}`D&WLVr(nHUB`QD#s6bmOkQ*+@^Lxaw0Q^1h@StFZ3Qz$mKn17(6`%rC zfC^9nDnJFOKw2um-=a**Zfng-^S3A?)RmXPq;*j5c8yre7amk#`p79W6K;0+@@m4K z=zt2Ou>yCq*?Lz2ZU@#Qff4-HQh5br1V7`$^s&y_^12!x%ricW z@nIeu_7P2Hd{~4Wnf-!Cyv*+3Sgm7xSS*Dydp+aBJRTpGCq&or{w4m>YJXi_psr|v zf1BSTojI<&ux$EF_s169>8jyLtC_uZuys^`3Qz%~0*tOTO2ZXxq5z|7+eBs-k_HMe zsw~_|;Vqt-N{#gGj5WvDLtm20^AO)`;0Tstfle_==qsvKH&?W zqeSa;J{2RHI$TEur~nn90#twsPys4H1*iZOpaN7N^%dZ+lST9q=i*1m;k_4(K4bKm z_eOnWi?c+R$Tyn4s;l>h>YKjVg4YonS-$Wk8UZ1HU$boVjM1nE46sUVp}Fqf6nYVuFA3Zow?Kn18k3Mvr!tyJz6rFBp>Wkg%J%fbf?&Ik=_!VDFl0#twsPys4H z1*iZOpaN8Y3Q&QxR3P4`QQF0lw&lzs+xXV)#qqg7X}N(Uv(kJnP%_n|FK;Wr=b?DJ z|Jiz10d5D@BZ1EavX;s#py!_p#F)T{q0Xp<2sym>f{{Cn3H08mk8Cl2kuFk?jDE!< zUPgCs%*HWJFQ!Bp4KPkG!C3EfA04)L#5i->vZuo{r(5^#s%^j7a$dMw8##t8`;!1=W)XD&0X|ok;f{ zOsxKlZcI$SbpJG?8$BM~$X|2`Z^Geli`0lqWGr5|XPDV83NRLLyU5N$Q&55M!660f z#wt+(DnJF=LIK{NZ3~rCx(wc*P3i7o<slgJpUZQU&d zsQ?wA0#twsPys4H1*iZOpaN8Y3Z$e0e6C_jcFXpx6rZao#Nk**mX}XN#H#0KeK0;? zdv1*>P&T&#KD{6XhT(RtLY9b}i!F}|(pu|jyQwk%oKb+=brP`@i7NY=D zuTR>tMvMaVcod-R)0wsx$0)_{?jU?gBH4Wr`5iZ09y3&+jTB(KVH*j}Vp3j#@NPck zYsv~z0V+TRT1Nriqi!8t)7Y!$?@=fF%+J8TjNl8a( ztN^zI>(0Y{IL5}P3V=u!ScsMA>_D)RXEY`3eW~e|LDZrS@HWHe}q`U&*-FM2@log}`RDcS! zjslEZY8_qal?qS+DnJFO02QDDRDcRl0V+TRs6bmOz?hk~QaWYJVa!a*b`2|*b_y_7 zAnm%06>bFuxE)xF%4b$uOXU^N^Uthg99hIr=dAh&IlT9Rab%1m^WLbBY%$}=BK64V zS3Kfnboa(=9OKAhN|ez6W(FRWU_Y$}<22S_)GPolRobK-xaAOUe?(dJ_#u+%>->cxp8#vwHMsO1hobK;6 za1#xj?(a|F$_$+D?{#pK44m%o4RDh!xHrL-8#uk(x4<1`;Pi6e1~HgjUH`T!D z{@w*Q&A{pY-UD~Efz$oH5AGNPr~CUexakH?_xAy~83s=G_aV4rEx3=s%`|X&xtqWp zXW;a5KL&Tafz$nc0`3F@r~CU9+$;m9`}+)Bg@M!keGblV;B4@2e=vor~CUJ+=&KG_xA(1kb%?v{Rdo~fz$o{7hJu8)BXJf?j!@J`IBEDvX@zK z@ST0K1(yZx6blXoXP;`|w030YfIH2=>FvOi0kTgwaJs*Ia191d_ty^GnFdbx*B;zi z22S_a0o-x}r~B&&?ra06`|AX5g@M!kbq05ifz$or+iUi@22S^fIbGQ+4V><;0Ni;7 zPWRUh-1!Dh_tzcV1qM#{*8|*z22S_41GtL}obGQ&a2Fdm-Cs{|ml!zR-!9-TGjO`U zUf?b_aJs);!ChhCbbr0UU1`DX2JR{Yr(>w54F*oH-(KKuG;q4Vy}|v;!0G<>0k_7$>HhkIyUBvv7u?MT zPA_*qaJLvZz1%_IZZmMYzantATX4nT?l5qAxkJI-Y2fs7hk^T@fz$o%4{ogmcL2C` z22L+`IJn;%IKA8h!QExxbbq*Hoqe}~)BPO`?j8fD`#S{Oy#`MAcPO~~EV#qK-EZLZ zat{ahfPvG?EdlqSfz$ns1ox1E)BTMC_ppJ}{gr}y#K7tPMuU6I!0GHa2yd&Yt*1NW?f)61O%?l}Xempd8U z^9D}$R}St43+^azFIsR@z`bO_9S`nJ1E;s+m*CzqaC$pV0Qas1R|)Pz1E-fe2i!*n zPA@kAZj*u2{mljUv4PY5%>%dDf}0QS69cE0TLtb@3vMB}&kdYjziMz_7&yJ$MMC6s zvfygKbvAH%xwYWBSa2tzexF%zA^0n>;OfA2GjMu)>%n!m;1+}HVc_)kE&;cLfz!)9 z3EYkbPWQJITu%e1`&$NXCj+PZI~m;022S^P3bwi?(Z~kyBav%-|66b z8#vwH8Q^v^aJs(+aJw5g-QStu`WQIf-&x=aEx5D6^|jzufZNl8I|p1p3+`NSds%QR z!R>9qoe!?R1$P0seJ!{P!R=?kT?B4`1$QyHffn2);09T6tH2dmaF>A_Y{6X)ZioeU z1-PLW+?Ci*zGmR`@q88h4Kr~1c)l9k{ubP7a0gg$*MJ*t;Pm=gl^gy5GgN>Iq@4nt zMAoC&UmYB4e*o?=aEBPU@cs(i3Y4%}!1r~7*z+!zC=`+EW0kp@op_aeBl22S_)61Z^&PWSgR zxbX%~_xB382?kF0_eXFO4V>=pRd8hnPWQJF+$001`+E&s%=`NoSAPN*^Zq`#*TEfS zQSKYyrWiQA9dCl0YT)#CyajHWfz$oH4en?Ir~8xh3XU;wy1#e9O*e45zxTk!yuT0q z2;B)4V>=pU*JLpPWSh3aCHVw_xC-x zdIP8X`w`qp22S_)KXA(|xSznCY{C5u?v&VEHtG=j{(dKsjW)%;zYi`8-06mLHC>$f z0u2UE({?0UTy1zVdXBjx%Up~0y22S_a4qVLp`)F@_a4RhQbpUscfz#{P5!|^3 zPOo1la4QX*?yobr^9-EsuM4>I4V><;E4T{`obImx+=T{C_b2BSTx8&Mf8D`dY~XZ% zJ;24hzmI;J@+`#Ge+Zo&y22QWvF5s@T;N-l5s|=i8?ylgjHgI~my}`x2 zzYkq@19y#uzum!IYr*vacbx@S2=00Vr?+FmN&N?_<0S2X~i+zh8j6+ra7V7y<4c1E<&TKyddOINhI| zS8$&NcQCm74V+%?A>d-(--j-Tf_u=y-(lb$GH`l34hQ$Jfz#_(0`3t5r~4ZP?lA+W z`zrt^t$w-@sY zV&C6~zYw?{27h{c>%i?`;Pi6kyn-DKobFG~E9hz9bbm|0?PTC|ebEVzrn6E~Bh6+%Dj8$Ni$hsT*wS!~rH^AKk?hpeP-mihX7hKGF z0O0NecbJ90`@tP<;KKa^e-D5wvEUvAH`2iA?RW^>C3Y6x?V7r~7*h z+!zC=`+FSRkp@opw*lN(1E>3Y0^B$Qr~7*n+;{`0`+Ex91Ouo0dm7wC1E>3Y23(ne z)BQaQZjyo1{XGXR<~#t5tLMSRoCg5z1#m}Ml=~vMDF#k&$4lU*8aTZjFN2$A;BHhu*?id57`+F7KbOWdR+Xyb^JOJqT8n|N({`7MH1a78*)60Dw+;Ij@_xA?4 z;|-kd?=5gA7&zVE+u&vyINjen;3^E9?(bc2egmibdk@@f1E>3YA6%t@)BSx2ZmxmT z{e1*(o`KW-Z2~vn!0G-z23KX^bbp({EwJD|0k_b=>E(V3uG+xq<$eZkk%80weGab1 z!0G|^s_g`=g22S_)Be*jSobK=cz@25_bbtQ?x7@(# z{(b@%a~=TpyFY_l5!+uj>JWP#z$kaV#km&#vfyu}fz#TXje=v(13zj(GjO`UQQ)38aJs)za53irpdCkm zd(pz*XmBrCaFfBkY2fsBl!JTA!0GLn4(>w(r~8`$?jr-I`#TogCIhGYn+fh?1E>2t z4%}u7?s#yY7&yJ$UxJHye;@re3*6@he|r5Yzb5L{0Kr?=xoa61_|y?!BZG3NoGes$n>vG7+9u9tz+>$e!(t_Du8-x6@W4V>=p zBych30iYdA!R>D0ZyC5g22QWv$>0htxKqLPwct(zx2FYnI=Gng0MOnu!0lz>uL0cN z7Tj6j`de_z!Nr^hfcl*cZa)iuE5Hq~;LZUz(1JS`+#m~1&SxmH;N(1onDYS8UO7); zh=sok!40+GF2a8DH3O$_9~Z;lFaxKL=S#rtZ^5kscYpnxUk;vcQ3dS3+_H} zBMqG1j{CulGH`mi4}dE*aJs*Tz>PL=y1$3PjWKY#zem6wY2b8!kAfR(;B3Y2VA9r)BU{4@5M0dr`xq}D zfm>kkrHfX|ccOvQ{e1~8WZ-mve*sr# z;B4@5nRms`)Kd~fm>nW?|reQ zegb!{fz#{vGq{xoPV<+IeC+%CrS80f^DX>k!QTZ2POG0Yui!!hr`InB{w^|by1!g- z7aKU;Umm!a_xI7>_TVnF@Yey{y<1E-hU z6dx`Dgag6j_MIt#7`xa$p^-rgO+#k{|dcI*i5MhkyE!Trj>>H6&i zZjFJ{>$fwwn=H6pz};-%^m2QFyT!oio+a28P7F-{2cNjRm+`i!MG;n&k zdxHC&fz$o<1Gm;GQ#Zy1&E0J#XN2e2t8r&uWr~5kw+{Xq^_ctBfW(#fxxK9k6Uhc8rV&30Jza0ne zbAvy=JkNY#744m$7Hn`3PPWM*{u8Rd1K>a?m;O4?#%=`P$ zPtGgoX7H!CV?Ma<7F-p$9tKWt?*ec;7&yJ$h2VBHaJs*0a6Jv2?r#yeoeZ4ruLfMq z`}@$Z7Thit{(|6o892RuCxYA6!0Gi1f$MGHbboc=V&30JJLuip}I zg%;dWaD6SfW#IO-;7$e?^Zq{CdkVO{Ec~4cZf^_jba4GGxHG`TyuXk7HGtdC!rz(T z23T-sfg5PSEeAKqf|K(PiY&Nuz{R}3kM^DmZit0HIj>--1$Q3yldl;#efu~c{)QPi zeLP(fPYRPR9D>pq{{jJ z(5(8#6@_!Fmg2@2mkd>)aa@!LjEX4ZVq|r7ZKXd$MPReGQ9v6P+WClkwu-+?0yT4L zvAdWXbao^&it6SpEM8m}Dz2)jtX@1PAl$#(xaAvZu7EZ!I&b}c5qn%zSIrioV)>U# zCMuwfi!Qd~V(PNG`oN;%iB+>h{?M}GF(Ln=z)7{Cg>}OHn~6Gku1y#i^14=u5M7)3 ze&IPe*kD%yZGWMir$#@H91&O&sICnLLgBNOG1dP1Qh#W6ZH;jMQrQ&q0&__VdPp#d5u<=vOO_A6P496dt)m z3@VSQ6^`08Q+^bl0d1yb8HLuG{_&Xjp zHz)YNXB!H$vl`?{)x35EAkN$mKg^K>zRTcZQLui2$bpX^;iDbi>vi5w(-8%I;N|;g;eiVk=u;v!z}+FAxT?d{Q04ro_5S)IOzgtkDg2FNfv=7aU6ngE zv;=OF;;S8ejSN;5jg>V@uwH26lG56mx_Wp^hOarJrY#F5!B>0KtE{T7Qo2e;y{6WO z7CX)o)JtkVZSn+ED^9&O$|2;A38_8Q3QSFkUQB&wO$>kigxl9mq-QV z5i`-nhaF3kg?Ad82*Q_btiX=GZ3bl<*MP-Qfz(idTS98|18YGAsKEA905Se*@%$b! zEI?M5vMJ+727}dAmHzrFTngQ038UMr;Tu$d3Qz$mKn17(6`%rCfC^9nDnJFO!1h-F z&*bCcZ3U)}oH8?E1$YH0VF~FV6BJnFudJ=ZlZ&`e0WT}S?ZCSCvwd<2&yXscI&QS} zX9;Gc0`u$Zg9jBCFYqt%7u7AUDXOepR2&S|&RJYpUst>Up^!t0h7`}Kt*k5d2dnTL z-Hcl>JMeHUBg@Mt3b}E3e8Ho6xp-LtZUchbfR{G_v^@(?w)5rsivmj%c$S?!s+5hM zA-`djxOz4|IM02R=wErL%JUb6>Ou)TSdCjdxAsH_Vw!(Gt0)t{)~0!Q~gpVPuQmZy}%J{H06q`jgqX6T>nh}L>c~Sw-UxD*vud~rqfC}geM1CukdqrvZ zg;r-_^q3ODmBo3%=&`US%uoR;Kn17(6`%rCfC^9nDnJFO02N3}1@QdjuH!LBwY1t_ zR~M)&THwcTPe(2@$CVeBO`loryz5>?X3SZnL>_#_m@^M{I-A@|3NY5Dm4v0+v{HcE zfpvE==FD0uuYim>W6YU8)){Z3tKq>sqfi)y;=y4b(c~=ACF1oqFY4<3q55s!wSOaG zBV&AMwx^5~l89hhMC8Q+$mfNB15#saHwHx20a6utw>s0ONYnwdYvxWGcYzz*W&6_D|5jBnG&I%nYP zYIrao5qjgn_M^$%2E5tt;Z`%gEi8qbk@I>I{_P#^S-59uGOoP#lJRX`>+#6;GQN%R zZIL5_uc$zqD!}-*HkF%&rLY3waD^1EBdbOQr~nmcO$8X=W~pxYfWi1SOT~y$0V+TR zr~nn90#twsPys4H1*iZONKpkC-^)yaF=5jqz>zSZ8dHu7(Hmj6z`)iU)^%M3Wic79ocajBjfqNSrTubd6KE4EY%2 z+cKmh<7@`w+Zf*#=g{HDs6a9lV0>FLRHTngP#_$xkO_@p8>j#kpaO9y!1y*x(ZUA| z#sYTRE!uEpaN8Y3Qz$mKn17(6`%rCfC^B76jgxnZ7JF@sa`F{x21Xy zv3}{J0ONYnr>|Jk)>DAnfwi`bZ?l%lDT;E~g1rFBs6#dl{d zH|#My{WkoL$1-67B4=!SOa(SK1r%T$VG48ttB?{3gm=p+Q5#l*3Qz$m(Dn*+ZTliw zVrnVCIdG}fAFNF}E5Nxw>D+s)d$JVZc3`a}=fGJ@5_N6F zl%mKh^YY4&w8ZX!@M$Aa_2)_|Kn17(6`%rCfC^9nDnJFO02QDDDX##o7aWddWO?~S z5pf|QPINz?%(`q3UkM*WwnwFtS!U!N<79fKFDhW8 z0AsmqR3hUA1sKcagrouqMn<0V+TRr~nn90#twsPys4H z1*iZONJ|Cy?3%Rfwq#bC&#pft<7_L8w^UhDD5_A(YN z!Fc9KIn(bIW6{#D&oZmVj77_={$y+7S0EgC5Wfq4k_u1(Dv;I+M1CukdqruD&(vq6 zTDWt=2Mk84g*9P@3Qz$mKn17(6`%rCfC^9nDnJFOKw2u0Cq&or{w4m>YJXi_psr|v zKh(4xGsl$|mQ9~o?!50_6kvQ?Q;|IPn(=L(>vA@@)f8Y{Ppe5w$7!Shw*%|WVtkvm zR9*oY-^SlR)5kjF+jKQNm}e9Uqfk6J>?4}Y__hc+-04n?Z)+k-94~ovjYG5y`UvCO zGN?1-XbR)o7~dAhu;E9jK(Z8Id|R@Vq@Q$GARMlc?hRr6sQ?wA0&yz9_%=)7!Uqh- zw^=Gij0#WzDnJFO02QDDRDcRl0V+TRs6dJ;!1%Tl?U+=r7USDey@y!8^ihCuJ?Ya| ztZC~h!0o_VTgJCpOXU@i@okK6)5khz;OlC5Fwgil#ds&cN5z@L--57Tx7~jVDwzvlmKS%`9Tp=@> z!&XoMDnJEVtN`QNEF}vcFc{xvsTeUTKn17(6`%rCfC^9nDnJFO02QDDDXIYD+fuY+ zQoUM?Z%g$aV*S!b0mk*DPhYX7t)~FD18Z#=-)1e9S3t(MF}_V7>zskFtKq>sG5IA0#twsv{(Vgw^>RSK437u%~CO9RDcRl0V+TRr~nn90#twsPys4H z1yWRj_~P3*w>m|;bNf}x^K+}aMAyEq-XE%ujznD>F;%r|RFo?{paA1bJ8q+QELO=f)} zOXLe*qEQj@s8Tk1#%M@W;>uHyRF&kcpFDqpkqg|~xwR*CRHmOZM!%(BpCz-#iSFl< zS(okME8%0v_Na6+%ZxlfOr~f0q5?JwF#63#B{E)6ARNr#g~qatRDcRlfo2rQ4Zr94 zJz`h@#2K-sk{Pu{uu*|DvKEEj4F$e!+S3nXTmrW?~VG%7W4Pp zBJ~iAU~3{soG*EFjZ?S``4}VEGNdEpYz8CP5{!b5Q}>kl7$ewHrYk&J5k|0iwBy0_NU@O3pjm}h(&?4}Y__hc+-04mU|GEzMEZnm+8CPC=$@n&}^>}1^ z8Q;eEw#X5|S5%-)6<~Z@o660?Qdog-xIzlokyWDtRDcS!rUHy_vs5>Hz+ilvrDDXW z02QDDRDcRl0V+TRr~nn90#twsq^JUnZ%fgRN%d+mzAe>zi1kY!1sK5>qREVJi;#oyZB68e`z4RAaZ8sG zA7p%6Ms#D`jbMBmgHYpJ{fGQN%RZTeW}418S;59S%)#`rc54*Q5E zGrlcC4#u}Nkt6PxJi5j$T}FJ6@ogE=jd3@E@okK6i+k|!gH#}K1sLC!xQ6tQ8485M z6*8kaYy}md0#u;I3Pg`@i*LSHZnzen-^+#tU{qXqP%uLUr~nn90#twsPys4H1*iZO zpaN7NEfwgRmbGT3lc)gW+ma|IU3pvq#`So70I>Ov0^AO)2Lj{Utfle_$oMwKx9MY@ zGw^jaJeX&E8{^wNIP4>u%=oqlIT+v8M2@&$^5`13bQ$qM#G%BmYtoi|IZr+`v~~nZK%LP-(Tlt}fjh6kq*EF0QW~bY!3=5c1at z=EUd2E1xP?4K13pth#Epxz%O<%K4KE$1MuhhUx>MZMo9o(g6dueS4dCisn_#-R4d0 zjndlSvchS#h2{Rrh5mT~ZH-+v+@7k+nrOp6Y2_>k&Wl#Fq?Hr3cZAUUM{qyjbP4wZ z(MBfMWxN914{$%=4)S(oXUCzPcmwqmkdWdU2pV^744xySn{U_{=^B`Q4@k>Lhe4NCh~=yjtEKr|3-cfU=2d#?0|gVnmO_tWX=J|?^z|?h@5Ho(=Thy z4V#dc--Kj6u;g5VKYKe_k@E+nQeP}Nui#IACo6KkLb@-kP>9?PNcV$b$(8AVtTk8T zCR*+&TIoLtX3$sejYA`lD(DxC`@Wz)y|m-uIeR|ghV z)tC8$qUrl}^`WZD`Y~12fl2;F_$pyuKeh_jU_zDimx)QWll=8nO9Ep9{yBkAofto9 zT;v;57uOt97Wr0Fzp_4!pKrP@=w2^CrR3#_rfcT~YD#MtEeh1sZ(CceGdZ2_RCe03 zU|<`MLuL(`1(!iIYIgOus{=KDygjn6E)Z&_$a;ThUZDP%GBKoR2y7^97;Jwb^)GDH zA734s{`2Mea@>DS*EILqH%e@5_8<2H&W_OQ-v^R;q~X2CWUARlzPKOYejq&5@HJp= z&f4YO@J46(W^UKJ8k_;*juO1%5bJu%^W`pzSk)Y{6V9rI^Go9Jv8EYf?Rhw77dY2- zN?G3wv2N~NSSjlw>#?C3Vr|V5tn99cjlKtvb1?aiThjw_knJH~!^b9HHZqaK+K-3f zJ$arli7mdjwk5vI!h1Wq#NER8{x-zA9eUzDY4CA(fls!qNhuF(!h1WxBvI&l9hoM? zMe^KYXGIKlRyHC2Bd;TrZ6vHf}@Us!9a0VH*P1Fp zIK2a6gHLYtO?;f6kN4!>4*Q!2wnXaTma_B(tdu%|cu@G{70s=6;eLSo0XZ~MZ(%$~ z+r)FY`xEX5xF1NpeSoYH_XFGywBg9)b;33jn?I1-RqT9d`_Nz!m?VxMIIEuDJKY z74zO=H?h0uBMLD$u&>xt^uwILy)nP9Kj!l7Ck6zoor!_PVz3w@hKgZge{p~qE`A|K zhy(FO{a|s3I8+=a4i_cDFJ_BMF-HW%Trp3~7gb_`SSYH+B2go1MNph5LZVL8i^XDz zI7uuO%f!jzIB~rAr8q&%5*2ZM{uFVlI8B@`&JYdaOmUW2F3uJ!#5v+zu~M8T&KDPm z3&lm^VsVLBB`y`0iOaez)gSb)rN~{q#iJQeO>Utxu5Agax zD{P{4nKlaW`+(C`JTGXy5zBc+t*33$Jaa$5{Qwk5yLqr`c5Kd!ZU05io6S3F>%Xj{ z?EdK5%YhV4!fnn7(mkxH1pai zCt@Dbw$PNo$=klEy%TG_L_>9vXIH>p&;U##9QRhxg?B(Bt93&dMglbMgrSPP_q#5+CLa zH}SD<@*2G7#2bJpZ;qI-34{}G0HVStzlTMZvaY+_V>$5#Ac8)5k);VS7&ojP~vTF|X~j~#aGxzo+@tTF{r1{>pZ@#q zH(=nPqT<0rh7Q~RfZ@Lwao|A*A9CnnhnM(gSI!B{oj1Q~!NTfAHMPMLLv{6wmz=b8 z*~!Np|H~6*RhZYGa_VWPpV4sUSQzxnN*zgxTR_v`;~*WLHrd*A&JJowPVk39O=;~SoM@~Nkv zdG@*IUwHAQmtXngs~cbY)9Y`%`PSR-y!+n!fBxXZk2Zb0`IApS`}~V9|MJz>-+cSm zzis*M@BjGczyAIG5C8e^kN@|-pMDmJwtwWP(j!KXIdbf{@e?MNO`2SO)Rd{yjy`7k zjALiI?N{sheZU=++z+&9>)f7jtIQk1Q@#e_iC)HeLuy`8=FA(qRs34qCTkVb%8TP+;M_;+_^;uU5#uXMHDtil*r%9C{#qVR~ugc9BcPb zL`gF~)?RQw);iZCP>*uoJ9y<_@-uEtPnL6w_LQ$dR5a(~yCbo(pCW?I5bH+CUjdQN z0F^!(nj?<76D#HHAxW%ihFE*OeAD?=5)f;eBi@noe&sAJ>0^B}^Q6|^eic^AYc!JB z(43DSpTeSqHw zw$}lX1wO7D75Abz7F89}0tk1pmx2xPwZgU=R@!#Dq>E`o* zi~nA*&A0r>--WsOyA9hA5$6H97k{@t;&)-VA8@*Z*9Yv!b2^cHCYoh$aX-NQfMKZM zF*~Mb-!y(A-)4SMtoetr)>oi3XMWM_`Hkf^n~w5VSJ&3o6pjs42b%>f-gL^Tj1Ep& zTr+Lz)XGp*0*@hb%8BuKr#5~56ZZp7r}O(j^s%3^Ye(d+>(~yDFOg3JnSy7bxZ^ox ztD8v0eD!!9du|e1nC1SyVMJZHA8_RG`hI}VDb=4~%IB2U;n!WgxOja(kaFKsqYT1W z=MnOwHuLRc`H8i@Le(*apHn(h6m)ti_puR$x$AuDx}>Uf(}dp#97VjoA80x(Y+pP3 z4_t|kw#3?=Vy&0Hxm`Q)iG#k{^B$bIV2FLR$7I5zi*Z)fB_ z@$MGq^^*e|a-aC-2-xb}Cq5NeHv;)BQHEI4Ref`xJZg>O@5!T9x#{E$>UE);mY1m4 z>(y(;joaeB9;aT9RqMwNcHcizrDN3k(Q5tZ0(bopL6r(OEmd5pDtDCPM-6t@kKCwI zRiBbg?&}h@{&4mB@CNt&!xVp5q5JyKayLC>gGwvh^x#!)dXRemAjKWH$$kI81~(nP zMx}$@^nmp$Rs8;2+}HcBa?_y|Zd$CkV#O7y*G1~}pe-&pXq8F_yXnAJ*o`8Z^Z{Py$@g;adSsI?3z_isH<#%DSGtaYBpj8e**Bd(SY50JiPJt}x z*Yo?!umEm`=kq+D4{sdIcu;|?E@e~3j|>K@t1A8VRkiX`OOqwM%V_dGUs3@oKn17( z6`%rCfC^9nDnJFO02QDDsh|L6W^^6zU*a#V_Se+~>WUWlx0#VSb6k00+4Py^PIcWg zeP?z;Dpa3!*j@@uA30^__9~m@Qh|(7z}cfF`AJS0BMuwlEd{t8Soe1}epV0D+!}Aa zluaEs+WNBuGg5*1_4UDnii;QE`+QN|;+mq$+C{~|Q0<(>mGyPS3+5~=9#S-<7(ZWB zSL_c~6=$FXnBx)trAq$lWZV4eWCjkSjA;_L0d4~sGnnISNR}IIWBznqy+0J?r;p7a zRBIwOvV7sgZz%_s24a592*@K?+2|Sa+gynYIiWsAKAshM{vw;OXtV2xMw_urUejzW zbS5{LZHrJKt0)t{LPs=_FQ@<&FewljQDCC@J{4#!1sLbrTFTOIx+&0jAw1pc&H7RS zDnJF2r9kAjQn^=@#yHn)^bH>{+zjJf8RsgB76j*QGf=cQN^6753a8Z;misFg;&(H( zHFjBd5~UDDHC3~teIjY)AZW8L%Ej$O%W1qaT@(z~Mr}~E##*eaP)veXt)rL3IM?X< za4i*}0#twsPys4H1*iZOpaN8Y3Q&PmSAcP@sop~=T0h3QrfA2oTIr>LbC-qjed*O{ ztZnNk!0o_VSH`(oOXU@iajuMW)yFy`adb62m}fK^<6J#B>?4}YIM)a{+!u^&E=9 zw^qQG!dB&XxnnR=y!Y#Nd7E#6-M>1&>lFFAFmLls?;xE4TbZ}{?oCJ^fNjD1OY^(l z)*lwk&--yr-sW51$=m$2Uy%3sB_s0Qcz+erhP*f4`x5E%d5^Cu$j>WU zk90=f=C8|4?0|-}Xn^00VznI~dBiY(8u?4D4k;|IJF+9k7kCEqD+9t`smZ zR|a9=uY4Z%Lw?8Kj)l$7+x!)_zhmdau$>!mwAt`E`XuT)k|S`fA#Zuk6$D5zPNJ}(n8n_ zSOW}xuX!i$@oNRFe|~;1nJa{{5dqDl{L4`}}6sk2J`q1m-Hvq}dHn1we&wRJ`F zy`sf5`J}2Gk<-n;WKpnsaosH3+?rooR9!XOU2JtIojz`K*~D?9z?ay5#+D1m`c15w z9rA~k#T`e)D~-I;XglaKl=J%a0N=cW*q_S32K&8OBuVoq*vZxbmv2S6_4Ob=Ti;7%Xj{ z?EdKA^ud$Xnv9xdL`ZT=H?-N-f8@-z=@?!(*y~N&PAJJdzEA|ru#6U4f z6p3OnSPT(E#W1nII6w>+zYrtDf%sx}usB2A}Z zP*jUWqDIt;AbK<;>O{R*ES89q#8R#cFYlxK>;zt`|3m z8^y208gY}jS==IS6~7j@iQ9wK&Xa=f6u%Q|#X9kOv0nT^+$HW7_lSGNed2!cfOt?m zBpw!zh)2a^;&HJ-JRzPGPl>0+GvZnCoOoWmAYK$NiI>GI;*a80jP%#UpTz6p4e_RU zOS~=K5$}rk#QWmU;sf!a_(*ILAB)Z66Y;6|OnffB5MPSFh_A%g;v4a;_^bGv*do3Y ze;5A{{}lfc{}$hiAH;vef5ngD|HS{qPvU2c@7CylxShYDrQ1&0@bW@v7AzYk_aM12 z#71K45!ikNwjlReaUGF%f^~*>jNu&+BFw#R{hr$kn$urRs*httYm^_dj0h8CR$H0z+jfIVajfYKu zO@x)fCc!4da5qF81(Qd@sjz9VqhZIuro(VoL>vp72|EsUJnWaS6JWDo6)-<+Hmnjh z2NrdnPJ%6kErXp5I|X(s>@?Uq z*y*q{U=6S{VQ0aX!_J1SfSm)o2zD-PCG0%d`LGLM7s4)vT>@JLyA*aA>~h!@uq$C# z!LEj_hFt@@7Iq!%de{xH8)3hKt%2PHyBT&1>{i&XVYk6>1dzu;*aU!(N2F1bZ3w3ha-tS794rufhHV zdmZ)$>`mBPu(x6Fz}|(u2YVm(XV?d@4`Cm{Ho-oIeFFOw_8IJR*cY%bVPC_(fqe`6 zE9`HuEwJxke~0}8_C4$e*neREh5d8{HhY*4mIcd(<-l@b`LK4d_OK4Hj<8O!&af`9 zuCM}FH&}OA57-W{9br9TyTE$Ec7^qZ?FQQ&)(2Jy+XL1YwkNC~Y%kc}uzg_tVf(`N zgAIZe!HQu+VZ&hi!w!HAhaCtz2zD^+5ZIxx!(fNQN?;>lqhO`5(XcVFBVl7<<6z@q z6JQfzWw1%G$*^+RQLrhn<6*yqRl?@L0_f z3R?y{8FmWnRM=^-(_v@88enI_&Vnt6oef(7I|sHBb{_0}*aff)VHd+LfvtjF3cCz; zIqVA9Rj{jJt6|r`u7zC(yB>Cf^90bnrc9nJ_gLYj-H}s{mb)~$?3rI$J0~zNAa^xc zW5!J!JsM3`X-MM=b4qJNa-VgTT3M;m*>0Nkj7pzY=~F6wQl%fN^aGW?uF^lL^fi?} zq0$X1eO#rFsq|4d%`R2xM3qiZ=_r+!sPu4^9;VVmRXSd!<5U_{=~$H>tI{zlov+d= zm5x^F5h^`Ur9)I&tkQuh9iY;|D&0?|hp6;ml^&$h5i0$KN{6d-nMzMq=_x8bRi(pJ zI#i|oRJyxLk5uVyD($V(JyqIQrF*EfP^Ep`H0yhn{#&L0Qt3b4Gz!2E(@nGftkU<@ z`*TzpQ15S4>8mRJqe@><>B}m8Nu@8U^aYhZuhQq-G`mKnwJJSLrKhX(43##h^ct03 ztL?=0XjfkCub*2Rl3%VG2jENvPFCq8m6oZrPNnslqmDhwLjnBAX0WO{FsD#Wf`LzG zkVCX7@-rPp_6aiWB(jf_X*LczGA+eHMyA-)E|e*D)J~&D;h>|H(Kj!I{qj=z-LJ9F zR;Z7iqtbI#x>BX*sq_MsUZ~QGRC=*WFHz|#m0qgS%T;=XO0QJuRVuw&rK?qXrb^FJ z>GBxwhdKFFYG?XP;f%ua^3uYIRW%C(^4l#JD&P?XF#hKcnp}9qpd$ja7t6CiuPyiq z>w~=3X13R?Kps{-D14txDx8oz;Wt}yCwwi>`>|w;+`x)exJ>g!pMxgxf1l!k zcNn!#uq4#=$>nD?6#FE7@al1IkNZY+kNiZ?w_*9b4ugBFpE55e_|vlu!7RMqxmU61 z^3Z-FYhIU^@OM0HZcgxj&o&fhXEn$RZ1dU`fH-qMksZtd-(_&IC|JKh4<_p@bdk$@W6!%^eIU*4O-`FytnVh$Sa^8zZ-+iK;Grk z7av|o!})`=;F!^Mynl(mwAx=+7pN;*;NRvfV&=H=!m{Zz-3wmwv+~|Yd-v=k>bXbn zk>%y`PC%jqq}f*s~j*O8kW3rqBkgc=F^@lz8I$0VZcc5bybIr|O9i}#>O#?XI!UO3ET?XM_3T)# z%10-v8p^3(+$QD7wiKb0Vznue_2ufrMRJ}-lqDJCO}fvB-&;dFDqxdpYvdi}Xp66` ztUSh^DcZ;F)|CL0ClN7jLv(11?}4a_&pnRSFG}R3K(;4Z>%+&f1<^qqU!uB-x>8lZ zY0sj$(W(=3olQAyv7bamopZ<{fAn4d_>oi8(Ivk7S|v)6qDpyYYnCTg|Cm1+xu$4d zRn!hjT6>x~L)UAPXnW+imP^seRY5n`{NH4h<6c7;K4OA-$FZx&uOUF3=Jk*DZVRs= z#9vMuT|<~WYJ6erHcxN-MjCf}$|tt!&#^j9sKDR0I2OusoMT6fZ*bU_-D?POtJYXf zv@aSr5a)Q4$0%o9+g?M6vz!L4oMgxXY1aAyv-p%gPf!ZaeMCgx^v}Ln>hI zcjK}^XrA#DKR?sH8@K6qqBhvq`h!7Z=gIM!jHLoj+Ty%jmSb~$6IjBFn%Nia=JF1i zHulx?+oEcx-Sc%Nib^-XvW54s<1eRW_pswHr;W}(+jQR){q$z*d52W3nOO!&zvr89 zInf&w{{EbBIZ;oelBk>I`C6jwNwxE}INQ_W^R+n3X}~V8@x0LLd@a#(+Tc4xrkzL0 zqf%R(cTBIU88)4@RxYs)*f=-L=u$+|aPlD@A^xE#xUZNlYP?rRe-Cu%|AV@IOp z%n3xjf77(z<9Y3jx2UsTv}>eswkN!=ogZxvn9Oo4kA;c0r#3Vv9?e_wnZ{#Bw9h0u z-WuS%v7BffL`l;$-VQ-^9vktNAt6RZ-^*C9OR%=J6!0e`;qhh&C3IR!%4oW%d9bUxSS& zP^X4mvHhJL1@w zaWV4LbaIp#P&VfsHrEuBQjSGjOj63RxTcttax(FnVq3+<_?;(iB(zV6^$N_47XgE!Q0`?k$2QxKTTZlZ>DqZz!sSG7Q22Zx;c}v$PA5?}%k#oS+mmY7NaJiz zi_hB=E~j<-C)}Ru%C@<#5+mj%Y1_}D=mjOM9NW1~agKuq>(H2wb=cI+LJ|`k0@0rB79+iymy|Rzm;@*r~&a$Xiq>|R27;zb;wZUbD z(`pOL{gn&-=DAj~%FQn2>fNHM%9>~wijr2&f?(9Sn@KAtYVSDn(-J;EmC_Z}M87VX zwD!b!L_~QYRE=>^Yr0S**Ec%=n!MTgTM$j&4!=yaJ@R{%T-q#-F<2M%j@8upf$FHj zxz#oPZBT3C{#{9<=g1Wmjpamdj!3jUjinaV)rYET<{5VhNgD_CRdb_#!A`UsXaAPl z*eW-6FZ{}b87FvAwmaK{jc1cnNr4^l%R5}C02NR%8a>~r@P%Mk20-2?Na}{)vzp}P&X=XKyt)T)fRe;-p zwPM-0d4}m%jWxvi5 zSy()zXh<5?$-RRy>mSob{RT&<<@3dlHDK0{d_>x{(F)$m}R(P)fw_296N zXfoqmBjj*jFwV6ZQCj#GkFG5gEW>cdxn@|0vN=?sB?@qUyrY)af6=KWLxya|D&X!7 zgy@GBW~o*liL^29Xc6)`>itWRHbxxXi#+baJIe?7o9||Ql5MB*`yy?x@?}U>)RIp= zo~NUF|2m|dRQ@rfomKvGr0PjOS>2IW_wKXyM_xTZCu=(L-C$UOA>BjeUqRYe<+mW+)6M6~y34-7k}G}gT=eoj{8Ni7Gc{4bCWRQXDzgH-+!q(v(K2c*R+{{~X27nZyq z@n?vW75TF6Lsee(^)Qt`3F-bS|0|>isJyJ(aFv(smG!{VPWFRrCzf`H;?IFjR9QBAu-APa!Q=dD-5h+NT;j(>quv)ylnfiZoac@yWBRgbS}XksUw!o75F3TjivK){Q0Gm6`gNGdVygTB z8_N#w;m^fRR_rMCzeMHtLApxi<=DSe<)wa?sr=1IFIV~3kV+k~?D%i|xzfpsp1qM? zrSfu{mhHjPQ|iCk$%>w`OgZMT^n4h9u644a=VqkWx%r(sBE4SahakN{<>fXZw_7Yb z$+pTdfn_Jz#x*jB{GagWCMPR)lG~cBH8&a+$L6n9Ubg8rm46)R z?JEBlq<6UaUAiHa{f%Xp5%}|4Co6WDjr2~Hm-_!s<$sTKt;);szfR?UMk?1~>9rsJ z$Tnc!L9>1!%4$EqApSo+95dELp1J|7}| z!_61wA$?Qj2P1t;<)>+jCr1F15`mvku+Y71OuCVki#h*`{tmrGXlKqXP?^XEonUfWL zrB{^{oT>W}naDnA3M9CKLq zIvsz$cd}wHxj*ff~kIKt3|Lf-W-WlnSDqn(BmVssO`S|lcCoA^80_jgGFUP*z zhOz7oZG3K4>;tXv$Z==c2jj|@rSj0qm#y;WBcG%4_adLG^5}D)98XyK|37)4gv&&Y z=ee%eaeRLH{0X1)IL_~WSbOiauIoI{Ykj}py7i9W1i2jM&ldSw;6!;Cwwe<8R^eos zx$>eid-7t=`Salv`DL71?t@vkMSg1KrI9%|URs$Nc%)8XfDv!WV%C^UBvh6Xub0KQ%<&bTUIpqd8mpmA= zZi_;kWiO9>8t0Yix%ZTFVb!p=pgt5-xW zj*H67zgJ8ifcc(9ktMiN2(To{{U|8uEL%ru;FkB_GDj zlST16_&Mhi%#K%E=6>GuatF+PElNzpb>%Pc3-Wbb&$*=a^hKGqdoRgtFz3Odr1iAE zyaBU+i<0Ls^JGyf2{)AKoA;{R7}HCOQiCvm4*VHzBA>vo$#yoII+reho5_6NYcBW4 zugeQ@3;7_X#}=jk!mR?PDw7?*A+v9fd9^6h1HUED#;s+WEB0?u#%kWyxvbT^olLL1 zw`IFed)e0Wj(iBy4~w#PpN`JuGU84${r5V{eBbLL&%|Bjow%EP6~F6TK0WR(GlRiD z@8FN+t#>_jeIjPIEXvz`ddaq)-p&;=;rC^`Pam1uczxvwxSzZkGxru1?A*~0i;5|D zfLsO-l&QTpNFI#`%XaRD$Uowt&Xw#w!(>~}aGCyiAIf&05%N0Bj9OH(b2rMlasuY( zEGn14V`OH^8!PjCZ=AdmkC#tl_H0r4A*PNNRr29UGH1n`EK?_Mio6U@mA}Ft$@lRz z=c>8zbeVJM&5%1|dT&v67A6Dl#>{Bo-|!sgYBmEO%hm8)nc4B?$voeiFI(?Ek>~^{kN_Vdlo7hTVtW2WB7MdifyUApedxI@ipKH_1G}`&@31sf$HT zdh2bG`M$SRK8L?>t`(2B$p!It*=qHrJOuBMshP*wv#50h?~?z(yPco4we68B;k|M@ zyiaCkz5O!#^A5;oF?+UnE)MhF32ZZeShl+H?BF`@0PmzL71Ixk+K*x8 zIB+@qwcHwiBXe%Nld{$Alzbkac78q?pOH)AZ{?<#8M1hubMLXAz|4#Hz0A*gKRDNk zVESQErwHcV5!mYglgxX_J1;Yv-UXR@co*gS_-E(3Iq)U94*o^%hA+!=@D-W*dDO_F zuFcq0=NB^KYjS0LU2cPK$kxZ-Wb5NinLT;8oa-gx+j1#tptB@!|*gZ+Qj&N2a&lzcSan2hK0$!4KsZ@qcnx%=0W>n)AQ^ znE$1{*wc0P=ljktQ!76tKZBWFi1115digxg;M~C0#y%|? zl*5_i=J;`W5Y8+!t9};Q*7k&a2WNF|$XEYK+3LnxEgHUqv&)=EKZne_&Ce+_zkV*~ zSE-GkTP}p@tHrDJabB5sh5wXnJ$+iR(oFiTSfdlhL@m z%sKKa$ft2dnYs2WIlo2?eAZ;~+6%af{2s0z8n>$suw>&&?Ss%-PwNVeWJmOsQzb}xk!Rx$@>bkYK8vY^MN4~DXXjQC+(piXyUNU+&rDdfqTc?yGGG1f@;KZ> zUW$9l2l0FIMchk%fO|W?kr}@)b8h@TGIQbgm07#rPqt@$AlrGNz7}sBzyst9c%bu} ziFlA)91oW1p+7_(fvKIvn``he`8zz^`K>t2+*rI-2=hCEttKO7>-8vk2_7xm85|?q zERA(;od>fYi`KT^@iKMtC&-KNMEMAwB>#aYJGaS>r^qkhsWLtBIWrb*KE~7Jy?DC( zJD%a(*6zcMTC{x$&ywk<&pcVQ{RHz~2z(rK-@teAT<3Py(|K}rJYQ~)`F)FatUdU5 z*yb&GVQ@KByUUn8TfChSe=0wV7t0+n^|g50?z2?hgg=wN$IG1ChwyT_0A3;69#_iU z@hX`b_{^3?`|X&S2yAn;*7=*a=cgKTxhjf@) zSac|ZIk$nE;xA-o+21C!SD*D+bU22;l>fjxoI7U1JLT$lmu$V@9cs~$dGT3OV5=eX z5%@gb=iDg~@0au819Dw_Q0{^c$<~*{GW+wHU5idX;G@o+<1p*C=v)jlPl21`6LNq2 zl{_DFmMl8+eE%Ey7C!0RB?~?!*Tkn~o0&7Rt?gTxTKeC~m+)EVu1S~~vgle0v+lt5 z-Z&=@$3M!}i=Skk>7SP$;S0{)p2into0FgAKA2})bhADFB2z#AvV0F;aeg-&{#AYs zGeZ{d@?Q6^$useFnSS~=WSfoOoV(jOy(!ni)X}1QH+);RTHTSYkDPOh?&tCE0aNuz zz}(lOhxPGKxe@+L9)#J0MUU0^zD&*hzny#9Jp3aU!2ini@dLRxekd=%|H;ghPpvI_ z@_deb5btHhp3FNW@k!gGY=u2VbOaaek@?B-ivV>`29$j{&>?@(d+Wn4t=gL#I<2McjA`5-PXTg^*2_s@Zu1B?F8<5F@jTw4AZmy!43 zvNGo>RL*$-^$SrWiviE#3UXImQJ#h?$$N2S+3r)tc_1|oRh6H^)#M(yx;!7#SBrsr za1ELFM5w0oAZ995OXm3@)?_iL4d%Xq$KcxX=a~Hm*MG%zoCh;sp}I0_480)Red@_J z1I(+%;0^dC`2wal7DG5Uq53j)4ZR}2jvL4$Fz3f&$ZGtmdDbzK`E>9?qEvwU%v` zsFB6+UbwAn_h~18gWs0_#_gRydDqDFxyCh=R7t)9xvN{CdjNMG*MoLC&}MpYG*MnjHk%? z@Kl-e6#7WES(+x##na`3c!q4fqpud@dEbX-$uHp9GJOa!Ll)yd!5_nuVyf#l$U` zdIkOoFL$04#q`x;QW?BbZi!dP^e41hwpm&u|A5yzPfoz=y2 zX_IWT^ttmCyU%91EN0ynQ+UUOw#v*@=nI*9gtp0NF=xhNs)xUnZI*V(^)WTInA#Wb zlC5{Ua^WL#U3^sL{So5X z7Souc&~ce(hEB-8;jf&hKaP19TTFijekFz3f&MpgWs zY_mj7EoO|v^eHg?3DNt&m+?90nJM^3xg2KBEN0p)oe!95rp?j?+3s^uzKVZ#o|PJ3 zk}Kg~cB)Ke3mfPT{JQDMB7W3C*W+*VT6UQ7_d_u-O7BJN(c`@^9 z@d;-qF0I@Rr;}&k^fEIamqBJm;xalf;A>naxhCc;SuCLbar7oI^^c<#fqBoxJt1>$ z;<7p~az30*ei3JvyW<@4ESyu`fpf{sdt7ekMbsuPk6aS7XNyHm@l&$(^lAB1 z%(E>P9mUK+VCF5Zfb*xUE3Tl-yu}rg+u_3Ucw9u@jEl-Y;$qH=!??K2bK*+K4KZuA zSo{GlC4YuX%eJ;MGP57YOjsu2sNP zD|t@b8**>_raT+JCGW(o<;$2kuvittZDnRKj@h+XW#@u(8~8)qUbeMS)8P6U+(G^q zcXVFO8I9{CTQ54x{A^qoc@pj_Z^GT=@A13NYkb^YehT-HnT5EXGWUpkPyPt^lE1*z z!eWi}m!4UyjmLdt&TCv>nf}N1lerehOk1qA{`Qx5;Q_ME^FZfyY4ISr3?3}g&$uBn zzZW-DUW%D-i*;Y&;qpUFtu5AD4M)hFgSe40b&4A$Pr%HL#d@3PF|ze#tZaQ5=e!{& z9xvC#{JzBo`W81)o{s5_#fCk2vV0j&ao(7Sr^dJ5#imktj@%g21B*@cA#Sd`5YLkj;ra4){E74D>G1-&0_JxtK5vN^ z$<#IOQ+YXFET6zjCj^X44*GudjmOy*3)@%t8=seRlEc@thK|AcwZT5L(it7WU< z8o3c(D-Xc*)nbdy;d*%|-XQ;iH#%>%zVJMYtwr(Y@+)|=%v#EWY60ah#LD7x8ZAZMHV%$zoec%p3%6iucI_@qU>a z#~qNr!3X6Bn0{Mq&w&pIOtt+5d_?Bm5O-8&j^d8V{9fE~`8KA<7GK&PzmltCYGLtZ zC(N@0Pr)Z;Y7=)#{u!Tk-tibdBUi-V$~GI{$(+Bqvof`h`(D0+e{kMuwK^wTAAgi> zHkcucogd)y0aNX?K3+%v2n|Z?W5Ib<25=?U5c>?6G;cBR9u)zDUat8l!ob6&#38$9xW9HT3;7d4-+!Lpj=i+oSXEB^! zzJ)V5AL45`qg(}ZmMjjn#_T`vNX*;>UW>EHoP+Qa&WEX4IIEl&(*ujcFXL=-Z=7AW zwdIg`2ZVFV%v3m+^AXk+&MjBPd1TIGm}giVnShy_z*hgK<#RZn^HFLard}3DOX33Z z8@Ql63>T7DgFlsRRu?;8$c2~4_3%=eSq^_DQ=9NI zc{5%v+dF54^Th2~ zc`*J;rf=b|WqvQrd{|uh9kXYPUo+!Va#c*9EPic=&&Xr&w=(?+enoBm9r^&4Tz}*=qGb?v5YIc8;j8#Z6{B z%pYxQN^d7nLXDV)ABOT;{yS(|e11^fSJs%-8r*@@u%XJQ$aemtbmP zaqlQDC;x@ZJKv|4@zmYo{?y@)`WDvlqtQ<@~sZ+z|Ja2jKVQd6-!tJZ~@VEnmm)JKNuLiti(r$9-jL9N$kK zfj^KpV(LhE{w2)w%=X#L_<^$3pZyS?eO@enu*@^#hsX;svqE^GBY2o>voYM+{vB!j zhw?L+br7EYdzko<@>o1dwzV zC?Cg@5a_v5F@U*PHT1w6w!A%T*U8@_hORpVps7#=alq#zg!hl3&Kljg%8TZ@FAJn#~+rz!kjC@ zOZgigbxxfPvu?Ydx;AFM1HXq)$jn7NzaLz;`hP83{l9U3EG<4M+uWX#TjA642z*AS z=kedl+#{a(AiT%^#b=$<@MH4JIE~yBGwXzxc{b+Rfp=ieXJC4skij_%*AlFd{Ct+`IFoE^dt4renJ2=_ z!aFG;i_G~*ctWQ330a+=$cdknpT*haPB^7c-ea3lJYEEO5TY}%bdA{GS1oQX9D{qyzG2Gp`83WE-!zGE6B@n zMfn?CNxp}fGs4S3EfYBZf$QR`a&KHswzW|U!ppH2KO=M26KXi;WbP7b%IqnjmfQr> zW5Ub%0e((ih-=FSFlUnRa@x6|M&?}1MFMLIY-@W#?u_fnlkki3Cj65817_|CFLxN% zm+4!=D{=!&5?*fGZ$o(=epR;pHj=O6#?E=tVD?6MdCK9}Xgt*?ug%zr{Fi`?f5PEXWZKPsU+M+W;PSr%B(S=oje%7 zEw94NH{m^HYkNn2fIB!p%^6By9fbEZ{Y>Dj2IglI=tto3xQo0Vca^`#-Q-93UFUpu zF1pLqJE4bcYwIa5!tcokaWDBdOwR}}zxCpMnRAfPM{b4t%ENF!c`0TV2`~Q%++Y3! z4{$D!2@jO3V0uY-1*mZX>kB*z50S0EL*Z%za!-d znEMi5L7V5%@_9VQxlkM)D;L1y~giTV<=^7tST~;B9g}yj`|A{8DC)5_ZU}F=3}{ec2^H#JinK z<-mL7+L-+iUa1~*D$E(g2Y&NdRb@6rC`glX0iGP#na{@IYyb6EdTh0}8(nNa!MQqpjAWEw#F^v|@Z<7woLT+~XOZbuht z%m?Asw6ztKXW&Bec3fD#go`-Wis7O%=P^=DZh?!-R)5w_c(s<{lJXf`%K2GlEmB(M zevvXVvl=NY_s2Yg@Sa_YIU9iwVP+^WXEDP2#rz!oj8u}j7W{7p*!8z?6&I;1$h&$C!fd6CE?kBS1t0AOzk5t%T~AgveoSs`BTjI2(ONE+mlkn+CzyTJDM4$g^-;c{k>rLU{Fl#cw;mm=?E}tKoO#&bWhY^`{?%_oCIG z{RjR5^K<5xY;L>AwzjS^^^SCtd*gTIIk>yL7x$2_VfH|HFWbDmCvy%Wy=3Ya;a-II z@=*M~Y(4EGpTK?Pd$^x-eVexrWM(kZU$%K0AWy^t<;{4I{4*Zx{EE%n5Vd=r1<{AxNpO)iI-d%}B_*|dND9+-VZX3DED^A}vV z{mzyjV0v%Y8`*w8mU(AH=E`=y=EUK2aBtDRp<#%p9-+giB^ zUMDkCk@YhBi*PT(du<=yC|}2$oSQy|KbOm5W|Z)nHp5$FI~UX|xX$w(a!}rZ znLom7ei&+`{Jh8@Uo@MhUM)D||{G zj!(&toB z`a*pPuT@=qQSOX?mN}!5OEUe5{374P)RFMsu$j3cm&Cuyjqz34YIseyGs4Uf-W&8J zLhS0oIDVR<)t`YW)2gXW5R1gT@xeDZBt|SFt06rNleo9*Ko4j4@c#NI3_dWi77Js zOXOaJ*Df2T-+`;+G;&*u_jC>qZ>)`r5T+_KrHe5^QYvQwV zJN%qH5!aSK$Ir_@V$LVwb>&PX)|IJu;tTRCxSrexzbMp}dod>hwy?#7HK z^819>jlCu|kl)7CF}OYzzbf0>8p#)NW9N4{i-}ES<|6SmnP(<4$AtH8PuxtNiJQwi z@$2$0m|7EFcRLp?W%`!bO18DVA&pkgJVrRK4?jl=%`7`15+=9Ew=kdGF z?}c%9xhU=-TYsq?;l1}BCIj0%_mcNvW<9um4ZrW)>oMF%E{Xff)H|`CJPdyzufhFg ztKk6o0UqewJ1^$U6JBp-JaMpW^E^bhz6_PEFFb?rdY{6><@@+U=l65q5i)a~I8tU$ ziKAqj8SYDX?{C9nP-8k7eqY$h`=!-!eQ; zK8fec_wgsrA7sM|8~l}qB!WSc|QL3sV`EH9VY zYvKyo`m$2~8Pj{h8xW6I%SAAA7F=(N*UHRA;yRhNB(9ea;|=m%%$X#-ftm3pxhDQx z?u<9f^eSLDwnbX7_GW$r}DO)dgIomNv+%4zF z%oE`au8;T1{qa7T{v_^~ZI8?f;SK&1A9Nm)6CaXmV}6eChIGS6WM(k&sLV4HkIA?2 zap$2n8z!{#s@>6TgwIR_u-NhFTv_IS;ehI4u{)XJqT+xAH*zoy@!>o|XBU z_`UP+MErwn^KedXh<}v(;-6$@Jn_8DUK5#D!W(`MUv&O3J7%qR{ljPRCAlm9MYdX9 zmTiyB0pWdU^YE+lh{y0%xjeomzmBiVBk>KH`Az&ywmsf-9+`mY0pX1-jBm@f$2+pk z12au{BROY@zsvL|@elbQ%uEp8s2un&xgKW!gg2@;=3NkYG5%X-MiTk`;5y$={MUJO z9?U!4u8+1_J(N4*|K!Q|k-Q~UDq3&hji$y)p7R*`nB>c)a7ca&$H|j0?`6UpvkAw` z^gM|g+4ZsfUQ$HPkGXGfy#aO)_Qv+Z$-2G(N9BV!CR59#6z6e|lC)%YoyGoAFb z%v>bpbDqRICy5>q-lXSo0l70SC{M@Kg77Bo!_0SJW;Usa^JJ@kQQ7KWOt#r5E|0_| z8NlPbwpH`YgZ zQ>|`QiXDfh><aI~5;L!aH@6iYAlupo%BwMRLwIvf;=%IY zn4a17dD-w#*=Bf{Og)l@%Tw`(vh8<-d=Zayo^SgdCG+k{8ZF!TqL+j>pZz7VzQFVG zIC(c7FaL%oIDe8JPn0X*Nis8%G+E~PNmJyNn6(n#C#Ug8&I|aGG)>Nnr^}qnq!}_j zPns#u!X)7>uroVbzJupDFSNCNELXwI7U3;qHk0Pb)G3L565hh)_!IdnY>Tq%f8mAB zi=M=b6~syj`|==FAY@(p-3l{4Cxncf`A7W-W=CBfO#<$m~tOrMjO6~bF~60_&P zHZ$KiFVBqmo?TyF8K07^hNopaBWGlKoAj;B&nA5*TMf@TugHPFmuuo5w#W|02`#q|5SoOdSbtRRaE1E{3nlR>Ny@ zAI$6$-l{qHhP)p$f5G)z_@?vfCoq4u>#MDXx8=6@jyxXUm2D1xm+4Q^AM&4=B)m1& z7y1;qD!wPbiSNs!Fm)%qH5>6iGIdI#c6NPj9DX1_jUUR-;s4}z_>s(cVazPNwX8GQ zlaFIxX0OR1XZvr&CG!lzTUP>y<@z{Y?tv5Jk8nih949Br%u;fa%s!IcBE0okanxO3 zPi>PqSA@6zEu10`#;N5`@MAJ(F*%J)ZA$($>~+guKF-@tER<|FV(TvA?xOUY+(Y3D7>S8^GdwIr978({8Bcw747^6~;) zK|X{l%6D)j=dJWDnHeIytyOUqxeeye!S&I&n!FxYm#uEkIDZkwHDv0MTvN7Q)RJv& z&&u=hbMk&%TfT{(cizU_CD)Nzdor^~c-yRQFUX^CJ$W5|QT`skqs zTU!t3Jt?@SY%}nlY%@U52yf3|+*{s^-=G`Exu>K8J_P5Alc2`#ICeBV_uPJW`&FnQy|| zzZH*`f5be)t{=#R$I7+vIGOq-vme4cFdI*hZJsB}_wXd=gEogekMIt@g6Vf)YMD%* z0?)!9$u`f^oDcCOdAeK#&yek0%#`U>GQUrFhgM_O6xjB{e47u)@W*m#JXdal=gF)+ zdA@9W`9!{n7dYF03odz~TpllynY-jqWuB9~Shh2@ME)Hwbv~K_eqU&8dvu76|opd&8lRF!;?uI#ncpY8lNa%~&Zn$C-^o?+ zS-BnlUgk_E{~%MdWZnyecgkkwN9WTy@K17Wd|vK=FUZV$GS4Qw)9f#qJ_Y^{QzP@4 zy!aRSIeb|jfawR}one-ff0bEp@>S<=J$y~hjjzj1@eO%6{!M0nlW)q@Ao-U355DdE zU2)7l3Gcht@m<+!!r2S1uf~7K^eXvJ=d%g;FWJt*J-G$GFAu?g%T^zrO?YQ*J^wn} zf5R>Lfm{qflwZZvj_|(ki66<-CmN9J^f^jh2=51GFY3z$aY%jv^9;iKf%QcBxxl;+ zqVY2QkFp=TevW%YBXVw>D8Gi2q#v)!jH*= zaT<9sPAl)n>6~rsqUmMMW;BCLzoHrCVK|e#1V1h_o6*e9=XriKi(CaiA#*mPS!K>t z^htRq&L%TQ(d^C__}ORiB87H_j(7 z#Q9}rFIqrm)}qvu@P1~m(L(Y|xUk$8Q!m2%*=kZ$K8BgI;QB3G-1!pgiZaJ`{nE?0 zq}&gelIP>nvel=IZ0jlOZ2uj$XgT>sTwd;uE69^^MR_l-B;UZ5oiEe#D19Ql%RDn$ zRj!Y#$(=B@BfQJjyJzI3nBD}}58#^eFSwTT6%Riv=fKa&tR-4oZj7Io-@|p}DY&k@ z7IVf3@5*6ZPqw|Vf4lxG=O#*T0@LRx^$q+gWdxrw%y>0$I8neRtC$YXFv`BThH z5Z-m0&(88W+(rHycXhtOyCK?5W@e-B%GMX=mGExx{b&z)0`4g<$IJxb-Pn)mUtp_S zZ|C3Q@cXizi#{^5ALV=!-fz@C+E3>D(GTQlm^u>PZ+r0o`3fHBeACB+Rj%y|p0Gi%YQGBt~SB-?qUUW9jhJ!Wr#zr{1; z2Y9CQos5|E5#F8Rc(%;hjn0voyXeOilOi{z5K< zx5?J`?Xu1Am$J>+4w;@ucgn0cx=a2F@0M@iJk7T(`QN zlrP~^&iC!?pO&A%XXHwlxhK5)O)={W+zX$TnZfAyGW(AHAYa7i8`=ka%W3jRZ8uA_g-)GYd!%-85W z=Lc!|I6aGj32>&bFEIp7}d-S36L+dF$AiRgq<41DORH#4PvZ=@Kfc*kI4-%^$M;Jz-i@`nCAu8nbTN$XOHK{GRS3dM!5~n zBu~VT%e*sUnPuiBmc`lUT8#PXOlVKvF!3aoWnVk2j`Su!nx%B zm^mZ-&@#-=1wM<}zd4S2$DWc)HRUU?`$?I@+`6tX=5`Lo9wuVeSV(cflULVu% zz_y-eWvkC~@@8CHK8M)@;oIl$Vs)JDvt6;evdzy6^1Ha6JO{rhAH*-oR;!nt?cXWI zSQFvfzh{WOBHI~nAkW1O<-_<@`A^))+5Z35vBq+K+(c$iF=|Kn_WuTtHI)b8X7UW& zT;7OZmrvjp@>Sf@+0K2emCT&Rm{-EL8pqz0?OAWh12KOl{Fv>fjcj#pD}RmK$#?PF z&MCYnV(sM;_#K%(#5%})jdhgA;!d*7SZCSJP8azU?keBL-JDY=;df=uWsLbC{M1!( z51HD>ddfCG@5xhfFL@L0Eg#44%XVh_I6oGL`^q_RKe-zIK&IX?-Xnzn7~hW#kf-B; zvOQ~%{0$x~-^4?l)1<{iWzKqx^F#P)n8(;~nHt1Cl*i){@@hO%K7vQdSMX@(w263( zoFCHz!cWUNh>er!ZH)T{*SSY*g1iz>l=tFE@_9U2et@Sq+kYD{My&}yU1|K0+yGCL z>3NJA5q>)M7h}Eye~M?yhwv=fYBk$AeFSrE2|vA^@sDMjfw?m0CN@u|hq3uG_l_}h zgrDB}vOu=JER^r!Ma~&gFl!?G3|6m8s_;Z=} zR*Z8VT?BfG+c6?ASkEu1`XMP1AmU%bCj>yb%jQbLPX8I62Cfl=) z%T~h^&RHV(E7^MVwOkQ1H-w+189ph$k59?7@M)P|#m>n5Z0uY4FZ`YJ6Uq3joCkj| zSHVBXuiw1mBZi#P{Wn_-}a}{ztZV5%(heY|LHkfo!w!P_`P9gr7YVek2!9 zl`175*I&S%uD8X^F5zb%j6?D)94D{AVVQYMiI=HCN`iBabeOp${2T>wqFfUv$*nN+ zMEE)S;ixj0T(5)qUf|9+y*w6E_u%?6 zoKfa{rBI{bI&+coxN|Pnm6BP`hqK5v@Dp+yoKv-JP%isci`&sCH#!cxk;hNg#Wbl zh1m^U3zLDH<7eewm}dvqC*#`kYW%!>1XF9mfBG7(>zpr)UyzxdlzKAzNTFVYpYIL) zl5DklS)PmQ%Ukd(@=4r4zKI(;=a1r7W#%HKk<9*58p|y(Ge`LO`(obdfv4i8@=DxH zK7pwP;phJizwTTh5pyrQUcjE!Qnnhll5O7D8{rqQ9=$0~!}Kq>z6tYlfluK!@;%(v zxnOGCPG&Y!-j=CHN_&~_r!aGbUvMDqAkV}dnU{?VZrYxlkPLDrdpnWM($y zU70$ibeH?#9`Y32Q(l4JllS9Z@&(*meuUq5E}Rwjk;`IwL->X1e+thC%z9HkkVjx@ z8eE@`2gtkeK>0i#BtO7|or~DBhRC+Bp>ku){1JW;_MI|Z9)&-YKf^qm@QWP4BjszD zpR?;l?Oill&W*>&HXCDQtKm4ATBeMb`F_d-c?q5<@4}PhA2H{U@Qd1@TBhui`I^ERCj8RZ@d4*D$@rjL03VWV-VV#Wds2?b)|aC){Yjx8gkOex zryQ5B;Sm&T~ z6Y*u4*-W`2Q_GZJnSTk>IiTjpm| zm?y%on1t`jPvPI?=kXu1-Jf>^;a41w|B^q$_hfpWa$n{iDStaxvR+d!!mso+=KKe) zi66*s;)n78{Ga?Wek9Y2)B(8!V6UWOFaDu!H zN9048x)Xk7dSd^K%v^>0rDi{Yv*V~-8OP)%I7NOJyG8p|n5)!}>H0dHMm~Yl%Jd|4 zI_Ij~BXxSY2+knWm(S`dC!&Uor9GBcd|3Fm6mFE#I9!mpMG zKPgwh+2n?peG-1PE;xrVm0xW%&MAM2bIH4LZkh9xn)?!dHR}m=_!pZA!5 zle|UVCOJR;x8z;&EAk}yJIVa{f0BQZys!NGgWsCS5ZhNyXnnun-)h?<9}d5D^asCkH*hmMidJhY!YL{j?@ zwGUDI5Va3c`w+DcQTxz)`(S0`;zaIgUG?;P;wYKocxd+L5?Ixk)z2W z7$Y2@nJ=Gx`Ugqs;+%0_B!T8<3sI7s!{$&SV#|E7^^F zm+VgV;ByV^&;DJleg4uur)i(Jw11aqpS85lVcO?A?K7M9c~1MxrG3`YK38dYX z(PWQ|=g;ih{yu1O*!>+;`+KFysmKVKNb(2!EN^m@jFBm1YVt8M4VjiqBGZxS$qZyh zG84bYjN9jZ?eA#X-_5kYlWBh!)BX;oefBpwL_W!LACQl5HZnWktHReDWKJ>{nVZZ* zTHj~0W}BY{&W%w z267|0iTs@0Ol~2!l3$S9$nE5ps!*jXayGxFQUIdg#my#eTqM!sq zCn2FIU?U*}5=c3cP;H@zsHg}i*s){p6{SiMETE{^0Y$KP#r{2WX@h@eZ^<3`5N_eg z?Ct*ceP`a8+q;>a+kFq-hY#RG_y|6R9q2LvD2p7S{ zY;Qw;sV8|oR$iZ#*Ky@FSb6PLUUQY#X8m&)XkYSrue|muuer)=t@0YHytXQ@smg1q z@*1kVb}Fx#%4?{>!R}da`aN5{mAQ~@;a!z{wc3}%Ilr-I%o7MpuNcJ zjnUMByiO^vG0JO;@|vQ&_9(A!%4?SLdS>+Num!dP?L}TYl-CU9wL*D~P+l99*97IY zKzR*NUi*{RIOTP}=+!`*l-K>_^*(u>FM0>;1lomlcO$hjSIPKTV!A?I+&xf^oMhMcP*=V-{e8FCJa zoR=Zzx5)V`a$bg4Ld-wra;&0yED(P=&LR8nvfnQI>$0CN`{%M>F8kxMA1=rE z`t2hYQDcmYIZ@`yc;T?Dhw!@3C3f_hH;C=W2K7^0pW7xsliWti|s3tKqiLXfvpDx zHi^GUTutI?QdY0rMr=*uXHssH_?g7lB$nnfI#%Ch_-@FOxbjsRNTbFsTERI`E#zTQ;6N*Cp)?ouCV^ z>ye%cr$7fd2|B`Q&=pSSSn}jL1G+;3^njj_2)&>i^oBmr7y3bej+5me|ML0fu7QvQ z$uNlRl*x56q(B_V{H4NR_EA>(%yRjxa@R086V75gdb0-9hdOW!G=v6F6DXUUw`w+m z#&8@ofmk>mnnE*Z4lUqVXbG*LHJku#pe?k6_CVfD;${*jllYj`p%#!|lQ@~g(IjT3 z%o}kviK7Sqaz3sHe;)jM@F(ZwdgM0zd&rxIJbB2UM{dWz2jAWur1>ldUL##ZM*+YGK zWW9b$O1*lhR}b~-pEg$+Pso9@fG}Udz0^3>#n-yaa1t6KsZ8Irb;g*Wh*7 z0$bq?coVk4EASS)4e!8qc$edThF@5J58j6l;6wO`?Z1+)gO6batOgmYo$T93D$6d* zDa*4PK4W`tJ_a+$Gx3QW591(**Tg6?7bd_M$bzwu2l+6Ok6RCE0Te*>L2amuP1;ygJ*W>2fcHui^&dssjFS86z_D-~ zG=W$+p5xdif1euF6q-SEXaOzRE_Kn+3S2;WqgulW?32g0fws^N+Cv;=NapK`jJrun zJPl%J5Ks9V0fU$t#Mj6L;%*RsgBTmc*dVrE;%X3IL#D*nAg%^+HHv|_8q|S7Yz<;+ z5KDtt8pP3y)+@Ed(;%J(@id61aV6X3@zkv`4<-QhZd?UdvrpQ+2Ij-HumBdaowB&z zB+tagMf-HU10V33IJrIq+N+DU?b;4+!$7>(3j5$U_?_*iQXdbH=Va2y z;SqR}*Mmr(f+yfXcoZInr{NhOAM$s-QRF2GzfstadJ$H@N>~MyF={oefwk}wtmC*7 zp(E?-VFPT0mthmzJCQyHo8f+V2ws6#*>@7@Yw$X3fvrF}y@UB$OZ$kHDfKI#b?T6y$SBYZ6zJxSGV(B(5fPU=mxCn3|N=B=079_sYDIN0a=T+swARP^9FcQv# zb07o8z*vsGk8~VlK{kws36KN1kO_H^4?dU(1sq2k@jk$MAr!$RAm*+qY=4mSe3%Nu z;cS=&)7keB=>38rW>$RXZ)PcHC4~VTnJUzXLYb(-$ z&<~P%-I{a|BtdWJ4}Bp8QegmY=b^4V#L)X0 z>|vdH^-zx<>eWM?dZ6OID3eJM;`k%dk<^zLn~`3i&LXL^ zNa`$-I`dM_$a&=X6w-w-AFktd7t-rt5nKh=!ZolMmcWgi%cPx~;AXf5ZiU-mDclY> zz#VWW+y!^TJsgK``TLv5dtn*e2lvARY_CDO03L)Z;c9pY9%diyD)JF{6dr@e;R(tx zfOBXE^4y)2azvd3r}8?1^faI>Q76L5&uY7ke0 zxEj=fL2M0TY7k3KHPCO0bX%J6?cp6W#eKsj|Ydi(C0fTxso`z@GcPZ(! z@Ekl3%i#sK$8rAolRP)!^S}uLOkT&5y1-yR?a=KY{f88RoASA%IQB(SFH{5Cl{*Hi zLk*}2v}1QIs10?XF4W_=6|j=^`p^K5frikC?W;&5pfUdbfWKKk7LH@zYEqd`nYZJC z`gBvDUfEu@k!R{L>V4P_AM#q($)umar?4A7gFUbpK8Ky~ z1$+r#!PoE&$90BNSpOEjgYV%7_>t{hNZ*5>;7xcNeuiJzcPi6_zV>bSEqdN{;c~bFu7r7PCx4zoxC(M0AFhUL*hjuS^Wj=p01IIe+Y|Xbu1TIx zBy9k7p&_q3k~V^4pcd4FI?x!7g(e*PH)$+Thmq7^+D#R2Gj@H{*Vt6(*(#ilIVORx@je?)Eo>Ob;j*aT}}GrR(?!fWt4$C0mUG9FuC zE4%@3!Zx&T@4dQ7KJA-&eQ)Yvh z8pPM2J`Cb+5PyRh8^qWkw%!6#;%g9JgZLW6)gZ10aW#mmK^+*x)*z+^u{4OKK^(n> zP{ca%G>E4`JPqP$5J&GMQtH+qhQ={Ky&GMj8~Y}co(^X~cSwL9Y{$2226;yBnhTc# z?K7Hkxvm7-t7|6A0ot`|9?(`@*Kq8^r1RlgSO5!Q5nKn?!_}}DmcR{gBizJskHDj> z-we0Ft#BJGW&2~Km%;5&471=4xRZU4lime)!#!{>EMq${h#CoLa2||?3`mEw;e0q3 z#y}>FqfV)Zs4U2a@h|~$AQ$prEaZa^CIa;pMeM6lFV(2ODC!`Jct;V}s3|a&?bK(~ zD3}H#;2f9^7qE|dj=B&of{Wo2pnTpG&Py$T`ge1@I}YN3w%{g@ZjN)~&rMr!(-z#c z1MeDA+Jc)l;HC|@DZiUG;64>j1KNw5dUsRrZtC1kox7=X?^<|?^#q{q-8~@@da->S zDQ&^s8=3>|0OT5BkFZ7zjyh$A?L*3KBPEt5aW$z2lX#n% zKx|E7YZ6oMm88VgB(5fLHHoK5JWb+h5>J!Zo5a*4mL@SYiJ?jSyz_weXA(z~IGV)K zB#!0`wqH$3otiU&x;LqBa~8~I-!-I{!W_5^=ECJ{C$26Rd9FlbD&5#U!pKadhK9 znzFj_=f=Mqf6+pp4{Zmjej@(F(}O z(1TwOem(g0;Me;Be8@WfJ^1%fuO8~uLmhfQ;yB9gp)TFT%1xO))R#xr>&K+jtA~2^ zP_G{9)kD2{6G*Qo&&1wy3)~2|@tS(@P^X?-VKLkUHvo0)p*}r#aV&M=xf||*dtn*e z2lvARK;3#Cgoof^cmy8hIO@_%{ydMt?4+*=iqr* z4llrqZ12Tq*JdZIO?k!^%Z$0oCU*S1dL=mbr?xpBhQ9Yp&Oh7=dzEwjXV#|hf$CQ>6C%I zL{fjzGM~F)7wqA+Ja#X92Gn8XC$JMfhcDnOY*L?*U&A**okSAfNa7nwEF+0o^F$1L41u~Kv@mqZxCaH7#qaaJB5_^8pPKiz6NnMh^s+d4dQB0 z2L`bek2r+JHg58)G1oeHW09g>jGt z*)X2%?KuD3Po62Gi}vYy7@pvDW6~$#ad-e|%P!ir>nWhEx}N1&bgt*%c~}lFz>BZ~ zR>Cu|3Rc4!SPL(49Cp3Z&N^5R8(<^6%ywz}QP>3c!Go|FUSXfK_bR*wufrDD%JweQ z$4v4}yrV9MIdCPfsf(z2a0SeQ%ivPD3a*Cv)NNbRYheK_ghg;2Tn~%k8dw51z>RPd z+{|(9pgrriz^!l_EQQ+_VLE8qgNpqk%TyJ_p7C_3x(c-Q$3| z_Y!L_v36$zZNNPNav+!O#NADMbmu`b$b994kA0g-Cqe-fLJ>@2dp98juLZ9Kuf=4T z0@xPl1-8Ugpxp}EsNi^kPk~*5Pe&&>2~LL2a0*bTj#Jrx0bB?d!NqV16a#S;)VZKu z#cUvdg1QxyNl+HYY0wqOo8xpi1G+;3`yYab;SqQg9)r8!0iZs_eoU2I;cCxx$K`0*TMo=2#eq{xEij6>)?7=4A;P1msrLm%kN{v~h& z+z2bj0p)(1d*>NMqr6XbR1sIon&1z5vvp zgZgt&caBv+8*w}j&%kO}18ZS9JPFUj)9@0kgY~chHp0uW2{ywk@G3k9uL14PL0fXX z3-7`E@Bw@XTi_ko1|Px4umiTkR(K2Egq^SpK7mhRH+%+rU@v?QU%=b&CAjG#u z5f0#e6~TrGCm0+z1~OSsg~4Eg3*2lU%ke+5?jijOzGb~V#IbK2DfJpbyNjS*MNq#H zv@0)piKq>Apf1#d`Vd7~C__X|h=B&YCVvsMzX;l1L@n?_b%=(O;AH5G%`DPWpbMM| zr$HlV49CI{I1Yva?JI(|6+zqbX2W>ahryZ96q-SEwof3f0WBaBszF!i#=acV)8P#0 z4hhhM?Zj7Xg3a&>(3Zq&uo^bPI(Qwnz*cw}*1&priTIrd=ffySgLD`T)SY+(-h^%N z7SLVakab0!IEa;layuxu!vN~j;R5Q@;o%tC zlp}(acHyAh4(i20+#OD~$#zB}s29gHm<|`fg>VsE43_}0a!^MO>d`@cIf$c!dUa5T z4(i@P-8-mz2gV%KzxW;gV!aq^}>J!w47&XG1dWSsp(O2E#eLmgPPdsCRKD41yt$ik%kF5?ax&u;FM8CqNr$ zi-vY0XeT0#w%3O=owP40?L}k&_3p*57e5jGpg-F(VJwVeyYxF0vLFdku-gvWvyc2Z z;vgP6z=_b2?J_^t!U9+bi{Lt#3)jFrxE>b65||H{!&Pu4+y!^TJ=h}uj(cGl+z0o= z4R9meM1BX5-b^}>^cJ`kZsR!0>`h}kd5$2aj-_xr+`)EY;J6y@gv;OxcmN(`A8~O! z1P{X_@F+aS_Eti~P}Z2va57NNm@aTCoCc==afs;z#380Dbc5634CoFC&;xoxBJ_gZ zK)uBDg_EEk5Zf5y8ADyfP`((-7DG8=C`Zg7NP$$K4a87)G1PkuZ7GJjilI(oh*=Ev z8AH9r(7s}5Gcm*?hIqtK_87_-L*2(v_c7FU40Rnd4zeH{#=``lUB=|VV4yw5k*?AK(shj^< z8uv&|P5Pg$A>NRNy&gVaPKeF^k2&clIXQ{Gw05Q<%llGd(9K zKR++FUuF*HugWccKN;4?CJ&EIj8AOaR@d76JFQKW#4V#O=MMc6IzQG03Y{P8u!qo( zrK6Df$((BGM_+UH_xRhJb+Z=1mZt{U@%!;*Sb7T9PqE_1s%3}FPk^(|kj&|p6%lB^ zJlG#Mz5!V+eCYHj%r76purM~^;$sMc7iM`Es{2byYTb5D!(!3ATtxx>}dJHN3 zbU9$(vdoq?O(@+HmywfRXz`gDsD88#{DL2)5z_cu6`zIDkN>kHz&AMF%Ozt7m5y4OAFG}g<7XlBV_l%o`LR3&hOj(7OGhCq z&*3(PP|5ZtKcoEZ+U^)aCH)jDeymz{u=P{!$MTb%b4JL<5Hh(2b7+^Nyl-F07I)Bn z`%3$fwSTzu?UPf3|J?SM=LqWCmwY!)&MX+G?c%$SwC~1M`kkl>&b8@2pSJQsb@ole zP*wEXr5`)vo5+G*X!}|1Q!Fno*E!PKesWU(gSoa`5~4~(`XH}iSKiOTUBj-tpDOBq zR_VFPx_eX6?~qYDz$}B1U-J#xk9C2{zdr}<$Fdt0!noP&uLWD4!>zwo$?_a@f31>! zia8&a^$TtF*Mjv^1>Yf#w0@NQ$f}Bd$MEdDP90;XcIm7iTdsRhV`G?-dH?qk@^fv_ zer%p=gZ5+dTpPR}OGo9O9l`n;lWBSV=HK;Rnb-dIW;yFc86&M^dCJeVSypGjQ2Md? zSr}}2@(adPCguloOxb6L)iJ@gw_=Q!`LU{@kogHP^#wniDubJ!nSF457fnmBih9Yu zY%T%?Ql*R@Uv>?s(tf0mILoX5{6L{%o^Nn|s%m~sPPXN=mynewz&xIi)ldHD@m6gi zWPS=VEoKk!qZ-~knT4fI&MHF|`=7Un(7N6u;JV9rwaN5cE+3Z#;O}B&*EGdq29%wChn+FSkod9jyO@ypu`#9?5L-YAn5W~cBexaH=F&!V9Rs3jgeNe zJO|xx58BV6t)KGpJs59C3+pl~ssjDURlVkY!UVOahEYh2nd!YXM@jlDBn<4XKSvy=m2tohU-wyJu$0b8no&dLq zNX;zBp&jJw28!hV{VHDbBF>k?31735&B2yOey@^CmHm#>~YG_twj%DCVva9`D zT)L+!elICq#aS0e1Y4fc;^3#KAUkiI_LLB^c2JZ(*6Is(uzuwEt(S;cC4{r9yaOAH z!+)DB|LXpK(5*(-O{4Sw?oS?pZVkHAHM(-6=+>e;L!(pey@am2MyJ|ahc3Z}Zauml z8lCEQ1G=6Xo$7ZZx%&9YILf-_tBlD(W&-6KsQ{YQ|*0-ZiGgs z+WQFINE^D3(VeZ)seX5$J4d5a{q96}u12TY`vl$j8l7tIQ*@&=I@R88bZHu$YVR|2 z=^CACZx6cB8l7ryFS-nkPPO+Xy0IFaYVRv_<1{+e-q+}|G&Yv(M`=u~^$`_5UY z(W&;hKc2Hlqf_m1-#q6OjZU#Azd$&r+0bFzIo*aX0^J2RbU1cisL?6qa2n_?(&*H3 znCLFn=u~@dbj2E-YR`jihDN8_zd$H(l(CAcq$D_N^hOQ~Pn{4Qsp}Se5Q}fpx z-7OlOn!gt4Zq?{ido9u3rqQYPTA^F2(W&-Yqr2UPj{A~2@6hN}zirUnsnMx^+oQWj zqf_n0p}W_HE*{-7jZXF35#0kCo$9v}x(78n)!s?y9CQ(qI@Rx~ z=pNVTRC}kPdqSgA?R7=>q(-OO>xS+rjZU?9I=ZKA=*~d*j7F#W?T+qQjZXEOfbKbs zPPNwq-SZlqYOg1{|o=u~?Xc}7z;jZU>!fG%32 zQ|%R^i?N~OrftsMHguD*SHp&G3c8vaom!5m=xW)}O+!~(qf^T}9bFxbPW5{My1E*j zYVSgH^)x!w-bLu@Yjmo;i_taE=u~@`pgTsRQ|%R_YpBtw_GX}Kq|vGNW}<7X(W&-k zp*vQiQ|--0cbrD2+Pf586OB%_HwRs;4c%OHO>O8dN7u}T?h16xZRoB<*TRNw9=et` zbXTKmZ9{hrx)W^Z=A&z4Lw7B@wl;JN(6zInTZpc`4c#JiaW-_Y5%}*# zfYDR`VhYBqMO1~jEjrse@1=*-`2y+(HjBzLG%v`iL;_zBqxufR~TN7-Uuk| z!jSFa=#50UVn&WxIl%0kl$F&l8X!ZfVUmP*T3>W0!BA}cvlzyu9=SZ*2 z$(cFwC;#QWl|DJ?MTzMJqx17b$=`#^L|A>;ML=m6(ZUpwCH+)+V~nKiyb0>v9m=!b z_=vlAnT>mW@u69E4^Dzp9*cuoImqYNRo+kdUS9`QFJ)r?y*v(+`$VeubScZ9njVUK zeW~`#*6sVTzHk=0^7zWKcEB`*ek>h@%+FzXudf3IHc&f|m)pzky>y`C%eDm@w_?SQ z-FrNh`Bu|F-w&M-$<05`*_=M7f9mppC_}5a{1vwrI$d@j4%Hj8&AP4 zyzn_@Y07eEsa=10a``z(5Q`l@hq%d>I|l8?@)Q`txY@iPb+F|*+{O?pSswY>;cwS=?-N}~KgEh4 ztCk&Xdn@;2`N_^XBa@$QS}cL~%R~KfE6n6K!-sY`%KP?}Y;ini`r!KZmG&cR|8VKs zhvIYFUmm7R9?B2zH0gw;D(=@>^4&N&vp|1eX7`cy-MC7>6IH>vHr?k7G(J<(pn~|D z#<5k=Z^xS0Ky{YJT$l5u;)&D@(tYot(=@(jkt5y1ILHn^TQ2F=gp#9kFuLbYN(ox9D zbGY@_DjBzf?yptSPjOkhw)%U9{fx;B?gE=^*Z~%Qd*d!_R!gwuDL>a* zKG{t9Y_DY8D*V_SyA0M(egXH_JG6_xe(a7ZRiIXHA8yJOSqM zgsgt@M~|1~(k&tLQ;=yfdq4>J=E*E9ozkVtOn~h?YFz&k)9~d# zHytK(n}F~#(P0B0xb_Go9X{~VY;)v~{4$4(%P-;edz+KT=s!+eWeQ4WTg&&*!_F&7ClTkI}Dgl1;60-JY^?-Fw zTp{ygcO0UU^;1k<{pV4;W91?6V^u}L#!W4cRTYKKPmbjYJ7mwM_i=wG>PokS%uj%C z2Z8zwf%eP%``g=;35R@6#1VPTB*1u7D8Bc~I;yhqs4>$lN2Eelo&dkg2*op^{c+3A z$g>(K3YnkrKFhhAA@gHdJABTCpnvL*Tb}i}WXQ_nv;H-he8zq3u>5?TO755W4Yb7h zat5jQ=B(2Pkb#X+nlV#R61k%)5YyG%HFldz4thLbbBBaC#I+K(@mOchlL8 zMg6G!(ssC-R?8EaoVOB}h_cwk%J)se{_VKy?$UOgc-aWi#Pd|e@h*A@F8NcJ^5c(h z&8sp0I(~2I@lCh=Bx;(Yl;gK^{2ujqk-)3wuAkpD+|7TV&$@gc)^RuNo#SrN_9xa^ zTE4=cf9G+Z--pYa|M)7=LhLH>;lP6PL->v(BD}s!_R4p8E8Y{1qJQP_cX>q3S?<=O zJ{4^p&s7|6@N{BBo*N?E?Vd~$CrjTPf08?8!3*vd35$5m(#`4jFWl8%StV*mcq@)~ zt)q;uBZ+X=Xw_UC%UXiOJ)-qbuAje_(rbA8G2;yoei&Jm)Xyn(dC z-SWlRLiWju;mQ5;-@R_>@jX9ZDw-Krl={C*h)%mu%O%49U9j{v)p1r`)e`-Y_m{82 zDMLq<-0p5vV%xT(*ievP7#Cos&yf>|VZAAf!6%0Q=PI!&lZq-=w(czcYkhp(aHR+N zjnILSDqcdG{}AN;v=G>+w2A+R_*Xiwhv>ln*Z3czGKI|^Lms|SN0PEiVspye#&Gz zn7sFMrO(0PcfSa~`wz159bxi_IQjMd=v^G;qXkE241zt+ADvMDGX3m;@>72{vUVg=u z^RBx3n)%l*Sh(oA>lZJ%;l`V8zU9{2mfn8Hop;@R&%Mj;yZ?a)AA0zaM<09qi6@_W z`k7~+dw%%~FRoa*YW146FRfd@VdKl2Hox-fYp-wF`o^2v-g^6;?eD(#{s$j^^zn|J zyFU4J_h)rjT#?&T$9-2n>K6SqGhYrC$wqXu6w66X0 z#^#q@;qTXfz`&&BK`E(&hYTHd=2^o>j6A!f{5^Um_UhfI?*aB77UfSYtwz(awu|Xl z59?rKtm$|KHo=+;p{Pt(R_p%P@;k@!Ti%N}0GE_3LhdVDFSEh6?PbR(+umo}&WPo= zdQ0}*nkG}}uS`?sJ5XvmHlzXN*x-Y^;8{7=vj0Da%VCuK+kg9kUpab;EeHBXzuv#y z81cXV_Sd@xSNw|@Z110H!I)U_PfWD=uPo1u#~<~JgR4_cYS$Dlu4Q{fq=*t;QB6ei z%&Y2L1FR`(iQ1x$s4MD;`dqC)Ml=+SL}RX|9VeQISaG~)Dw>JrT={D$T8Y-;1kpyc z_2u~I_r!}1;zZF=bP^|V^{%rxg=_Ao@`bdk=q64VXNc}xk4qP$MTQu|)wQu=oX8T{ zV!W6jazw7k6ZyhNjTVSPQ6wgb$zqC_DyE6);v8|VI8U4}Mv1ga9e;tiP+TM~7ME~6 zZ-$sDW{KJ2QZYwdCgzIE#TDX8F;842t`^sb`Qlo!Kr9rC#C76&u~;k-H;5a>P2y&8 zi?~(XCYFlZ#U0{KahJGT+#~K4%fx-+e(`{KP&_0aE^S*b8*MB>YW&TSKP72YUVa`A zm5a-qDla^Smv98a5jZR&;5;mH5za(70^tZ81`&u!`98K}Dv?9Pr2O82Z&T$!r`lVCF2ROwExH~Wo$B``bUigX)$clVi5i`1Zv(pC8l7ryBf35sooer8bbU2C z)!rs_{WLn&-ez?DH9FNEvnZVdG&GOV#L9zi*-&tkJ1{x1k%N(W&;B&Fvhj(W&;{MmJ2OQ|-Nj?o5qNwa46A z=UEz^YVTci!!k(H9FNE16|HyjZU>^qMM=7srDFYbI#Q0RD1ls$2m)* zQ|)=s&DQ8tdy(ia)#y}v{HDk`N262i@hc!AKgNY zPPNwn-6D-nwa4#ToY&dVHAHv4MyL91gl@4$r}}M-Ziz;x+T)ip&Kop3)!uRFZnU9m zg6<|8x>$5KYjkSP8l7sdC%P3HooX);-AWs} zUg%cY(Dg>QTBB3**9YAijZV#9Uvz6VI@Ml3bT4Uis=fZ`*4fYvK(}6_Q~eG^w?U&* z{U)K?sL`qRlF_|vLpKQBCL6jGbenDHMxuL5qf^UqHoCVpI<*{W=swcuRD0>@KGx_| zd!y0q(CAcq8R&LubgI2E=yuuAWup5;qf`BkMfa%8a8zNM%1XO(W&K_gszqi-DGsN zH9EDtQ_$7X=v2Q`(bd)HRD09V)zj!yd(+X?*XUGx7ocmP(W&+>M0bovr`o#+T|@9PUV`o<8@e0NooqvQBf8ES zoti&ee#;LCuY@BIj=+%~0eN1E04FfM&AeJ}LIaFBGrN`>fB@sb%&`^BvgP(Oz_=@O zZA(1;#0vds}j^tYb(U0%Ly6!WI6z+At2sTwEby;dp2Y&4BSL z=H+tR9$*ZK*|~!Gxq=zGLbL_OcSL)LgLq(khWWaJ8N1xP22O&LfpHP$?)vYT#r$32 z|4A8R49wyc%;OczBY}PybASc2fCck_1v7yKbAg3OgLD`T89=|sf7hO|q~jn9vSB<- zfE>t$Jje&W=QH1!hs8o66u~5z3{!ybyUafp%s>``@1V>g7R)0S{+YgfH)KAs5XCS9 zX2L9(4SbJccClbiv0#p|V3x69p0Qx2v0$#TV79Sfwy|Kov0%orV9v2%*0EsTv0&!0 zVD7PC_OW38v0w(WU=Ffi7P4R-vS22%U@o#?HnLzovJgw*cDMuXguCEwxCicqWpE$d z4-deD@DMx#kHTZ{I6MJ|d|?jDi?9M#!YWt|YhW$B1nXb}Y=oC#6KsZ8;8l1HUWYBP z72be1VH>;!Z^JvV9o~ia;C=W2K7@~82keAh@CkehyJ0VU4qw2R@D+Rw-@v!<9sC48 z!!PhF`~iQ#-|$awP6Ob82r$3|7r4O#kq`x5s0Psx1J$7h)P!148|p!QXaL7RLudqz z;aE5hnm{ZZ4^5#NG=~<@5?VnUXbbHi9y-8@&=ER8XE+7Az^QN=bcJqkI-CLBApv?q zBJ_gZ&P&|*q{!GuCl@;4mUBOn4ajM8>d{Q%!Dj(`G&i%^*eDCY~MpK5)+ z=#@D+Gbi7dSy0|v>64RQRPxve;lDj-WpWZe=5UID(k^PqE8%7RRQd4Kr0l#22YQnG z;gtVyUcwOwWdvydS?yC|d$k{uDd!^`eG7NYIPK^wb-2X32$(!1$v<{!`H9fj{}d#h zjSy{5!%h!hfXAYSz?bxsoSY=*O<686f1AIXU_Hd9nR6bL5=0N-cgr z0p=d4Pl7*?lf-zQ<#wPQ%C-_e*0Rv~u`W>P{8)!Qgnld?h0IUpR7*cfbyj-S-wv#s zwFtI6HOQUck1xa0Q?P!D6+c!jJ7j(WoOOm|$|q-oZujkgx^`C@6xa%X7<{N>3VYn7dV`|S8R z#7(v=k8*fX#HCxG`UmtFQu^sqxzWaiQg3k?Iq8KKpP7N`r_@ZqByL=`Wd((-Jmb?X z-_OC8N49IZ#7)okm8>23Zz%kfj3IRHGEjfwXmpg1ArPDc$3M{4gB(Msyq_u>LrCd4 zAU1HBhnIaLt#o-(lkx+8w+fVxK>O1WRK;hZ^yB~R2=EP#_p*POAhyy`EAwO3(_;KA zWPYp*6goear@#=F$7ks%WaT;B#tDyw`ac|Qkt4ZHGws;K{2rROH=?oCC%Lq_cY zvkXFh%{OR2)&(m6{v5O)%WhN%<7TtJ7HoMAxBgls%X85EwMzOa=6qMyFSONP3)W8+ ze1|yF`cd*DsVe#%!?W``b&Q?brL%r)x$Z%YjbTdW{ohN-&$U7Ov3afy+KGPp7E8#=6JQ=s$m%D5^mvQnh>-ay$h4R}z)dfC z^JEs5HaV*dS?rtYE7E^UDLKwTYxmQmhxcHTe!b9#o=w{)c+6|^7g0+sg%g7#zCoep8#Z1xL-EzjXLMq0`89CW`u zXg`Oxe#*;}lTkI}Dgl1;60-MCuC=3(`LR2(=11%LROvtzspF>_f3l(mLHp%o-rX^ zKiBGC@4AYYsimuN*%^6O14SY8Gu~%8cQa&uENjOwL$fk-ECW}PUG3lE(mho% zr&79#vo4MZwmhZ9!B0^^cHTJcDIsL-peTE+)fenw{rJyskq+(vR93R1Hubr^OCE)N z?&{YSmqfv=5%uC-Tin&}N`t8|-yO5811a0?_PBQ43C}EXS05r@$GUdizMXUg%ysR0 zVh8E7@EzNyx~t#Q8hmcoA4^@k?%M9!^~ij;*oE$qWp39ykCLtej=yIWaO}MT8o0J? zu0h(t?Y(C%X(|-E#Sg1oZ$-{${ZZHmQoqk#eHq$i_*s?!_*}LOw!2omxYX^v(c{{- zZZ3>)SHBP2_cd^PZ`jD|E#$}N+P0qk>-))ayLRn(w50suzejZhy!TF}-7SH=?nw6* z*S1%RUAyk+NBXR5+nTAamGee`59Y!u*S2?PXR@u{o95c}B5iH^cDC z;PusAU@BnegZXZE{WRA1v0lTq@|rHLZST(~Ep}~tZ!hUa*UI@d+^)DsNk_PLeVIy% zzxi8SE3ft73(d7%T)Vz*OkHn0 zBeQ__>Bwh!js5FelTVJj9=q4ig+~EAg;`y#U*w}ObcEI-HXJM~v z<&qkJ&m~iV?MpVgR^A|7dmh+98Ve(!7_fW8cGt=q1+;d%8_M-mY;_^!8G7<$KkOCP zbF(@9H(YG~nb5IA2l-e*$4NZyFVVI9T82^^%IDmPF_}|`@m;<2(FJi3@RebHee-pxA-t!27;42Yy-l8Q~OW=B4v_ zwB(*9r=@)R&z5%aa=%Dxo-fXAmoG-d_MI#`*BF@+A1`v^V+LWP@w2U)#2fwcg;DbQ z*f~AkNu4`lZp(iCQsbj~w(=zuR9`b|W^uejs=F@f|4#p}M6Lag@Htk^8W+`}_M=0_ z8NR>Q7yBZ3-JoH-heQ~TaqF6qBVVtK1iWzNqh@F8xrbE1_ z@#uJAVB-&Lc-YqP%#`?Q{l*Jdzp26{{qN{iqX|}iU5|zE5{^KV1Q~gA@F__TN&W@ZZhdugJ{HD0f`8o+WzcWhCbpW#{MlH5IRvJ={!c|DDOnBm5is z64vPCXgG+ZpFqdJ~}G$RJJaUR`XQx%D?A-O3wcM zwyCO$()XJ*c5H5XNh!6LZ=toX^l9R-IqU!gu|CTHb3f>Qy3&IjA#h-%ikFb)KLmOI zf4ztA|3myk5VDY(_SMA0RAIklK4Pn$vpPcK@sc>afA7+nUI}*e2cs!JWhP~hE=cF|(a!Y4133u4`$hQO zf1rkO^lXcWi$8h_dw`NUdK_TmQM4)8^ZZd1sw1ioJ)g<^+e?!RpCfx4e!i{q<*De$tNVwEFtKSj}4Y2$On zi_alv-c{tIXe_gP$`vviET%sm?e@+Z{mRMpzZGd_jWg zP3HBI*phVdmXh@5uh{Q`NQj0O&=%t1WJrcAmA*P678KcI||?ElZf%z4x1!H2xKQYnfzp^|tivHhPLO#mjh;SOF%k7Db@>YwE zsa~UIt=e_!)~ny(n1+oSAA4Mr*yEcvYu=(|tJWv9Y1^)STzrQUJ9awhE>H*y>033cief`-S^zP?7sUSc<`Zz zA9?h#$Deresi&WL_POVmzwqLUm8({-S^Ltu^&2+6ylL|*ufF#BmaT8Rx$UjD-`W1| zd+&en;YT0u*tzSIPj`Q|XYc1H-zyA@zmcK{O z#9qDo^zGMwz`&&BK`E(&hYTHd=2^o>j6A!f{QCWsD!(tsKl?Rg<(DUAxtQLR)~0s| z42EGfOz#Ld3kK!Dm@-|7T8OgOoX6ff5SNrJLhdVDSB}|Uc8s#^eYWk4SbnRwWZ$i6 zGL`wad1KOZcw`4Z&*p0Aq;cc8c6!vz5vkKEF{M}URK$sU(E^^pH;#zqFil5hmV5jdhF z;G}fnUR_zgPey|!+^Z}3Rg=<-lRZNlJvx6+G2E*w>Gy?ubtP{nMp44Ox}bWs`d(YO zS9i%J;a*+Y`|J>>M}4o(tQZfjbf_arx_Xs9UODhzKhq5NIhELiSHltbk4JzjA>~({ zOJ|G9fkeAAMP=#3vqk?KZ6M^=QT`jn4(GBo0^!-BM|V>Q_B?-dNACzIJ+nm{{Cl=& z*@u1Uz1sX!MZ>d2D_z;)&)7bDcR=QKLi z9(TENKCjWK_D)8(T%%L%@#H|~3mTnjj~UO-6&jstk6Up$SK83=1=qRChOR5R)f%0e zzi#N(Xmo1+PDi&^qf_mjf$k-ZPPNDH;hgJi=n~Ma*XUHgJO@uaicnw&!cmopiYB$_o@;2}d9t zf&W|t5=F$LoUgiS&M)QVLH8KCZW>+r`3l|R=uX$@RC`aLJ42&W?LCREyGEzldkS5G z4c*h|dT4a2-)GSE)aX>d&!S7z=u~^pqwB5FsrHtm>!Z=B_Fh2OSEEzyy@;-#MyJ|a zfv&$sr`lVIZh%Io+FONgphlG>x_Fh7lVneqMU8+W> z`dyE1utul)-GFY0MyJ}_h;FDxr`mfN-7t+#wYLe~nHrsHZ!@~HG&b*z2DKz(&$usf1sPK(W&A|(W!o$p?grHQ|&cJ_mB-;3v>@_bgJK$=pNDNRKF*ndt9Sa?X^Moghr>@Ym4ql zjZU@K4&754oocT=x~FaE;?O;#(W!pp(FMG|pI9=l;5i%iPQ>2x8l75>j_8(abZY)O zp?g82Q|+CMZiPmt+UtyNr48LF=vLX#bwRgUqf_&DD!MfqotnSX(5=&ykPGe8?dpf%H8lCF*40IbbI@MlxbQ?7~)m{R+mu={Jpxb0a*Av}l8@eQPZ)tRD zIg-)6te#AjZU>U4Bf{Xooeq)bUQRU)!td?c4~C0z2WF~+0czZ_lZWQ`W=Zb z;Prjl-#O?$)7Vq-*TtMps*7Pc83wbaga3)$as!bu~KGUJkl?8l7q{ z7hQdgPPLbZF5vZj%A1ew7#sF{=o)HtYW^moYoyVs`71!zSff+z6`~7xeV=j^p*zlo zy-DbrXmo1+CZmhBp__`XsSVvUbj@t&rlSjZeV_7PfUboNdl#Z>X+w80y4E&ym!Lbr zhOQW08ymVA=-S%Q%|zGEhHe(R_BM2K{z04#-5hiQukTYIa$doSHtflH1s!eZF6TVC zRijhiA6Hi)N;t{wLLXD)vvr>o2b#L_BNsG zt zr`mf1U9v`}+Ith-AdOD7w+&suc>uK2x6lQg2Y~Kvbc1d9eFxnTjZQ7cc638EI<*|{ zq8p~ssrKGOccwURga zb2K{D-cEGqYILf-PtcvO(W&-6MK?;LQ|;|Wm!{FF_C7ELV?fr^wqDH6M+lQ_|qf_nuhOSVfQ|vU0_3p_VRFS>y904Q%YbeGz&7maR?MyKX42Hj;EotnSu=;ms4sy%sK_i~L+ zwO13}6&jstuNJy1H9FN^ZFKWAI@O-Mu6vb6r`oHF?rM!rwO0>azt3(XseX?`w^*Z7{mSdQ0p|e_msoTG=K-KQ9^H*L z{5C~*lMP)nbT?~sYI&QZ3pfve{Ix)Ls||ZC(cPxesqt%tZmCA6=C3un+imFNb>}-Y zI@NC*ba!fWs^9kL?$PK}dvWOQwV{hgw@jl`{dPq6fJUeK?S$?@jZU?961s&uDb2 zUwOSY;5-20l7KGYJOFe(&^@p5tCpiDy5$<3n!iMJFKBeCz24|nXmqN*KIm53(Dg;P z%7(5Vy44z;n!o<&)@XEU{sy31tI?_U2BHf%4}kheLbpz1PxYIOZoNjQ`W=LBgGQ&? zOF_3$qf_mrqI=nfZZNt{HgrSKZMLC17u{PLomvig-T7^ePAx|Ux{owE)!rC%A8T}~ zy-ajFG&M43?lX-&HGeti_Gomf-+XlY zG&WeuEPeN2S8lpb=ZLO0MJcAS5xCxEr+~bTg!%S z8oJsVom$@M=;~;6s$Y4%wys8}+Pe^4J&jJacM-b!8l7tIVss5OI@O-Mt{ZS30C6rx z*U*N&8R!~mbZY))qHC@;4jZaW?E-imr)9r{-@Cx>y^!x#*hO&|QwM znGM|)=mO3IpuAV23pft|-8^(HZTP(!U27Ye4c$U? z?QQ55p^LMjyB=M@c>u(DF}f3N*js|GqYd2+oF}(xbn5%#M(lOc=+yRn6S|WQS6z95 z!Yknjgd^~ui$HG?@gnD|uA1{pd3n&SK-W#9D?eYMTZt~<^?h`!(4Aq!-fDE+H99qa zYtSXw(5*$+L!(p6@e;b88lCEQ9lAt~PPMlIUBK)6#APG8J~r&VjIOUnr{-@Hx_%m+ zn!nBH`fGHmy;sl;(CAcquc8~M(W&-cLzkq{srFt+m#opL_O_rKq|vGNwxSDoeV_Vx z16{!D`{>?8H`s<>Ij>-dMyHlT&MO$I(W&Kl8{IICPPHfJ6`ZNjsrKZ&g0nQb|6}hx z0OKg`_W!eFn__wmU35Z`2_%F70o%eA%NDl5rUXlt&$et?5|Ruy5HKY`LP=f-fdoQG zc@y4W%9}TVkN}}~5?W}1gbrz>7f6Huv$wN*-`SmKz9ZdPf5*Nv!${hXo~ieJc6UxY zQtzkWW)n{8JqKK?>b(qZ zF5#r!E8toQC-q(h*G4$0_Zql)gp+!&gKH<8)cYm41%#7&zXG?Aa8mEr;1&^1>iq^> z2jQgNo8T4)aK8n&gmALl-+}8SoGkbE;Fc0j>iq#+7vZGdU%;JAIH~tnaJ__+dVd4g zM>we$eXgLNa8mD|;7%o+)cZHM6#?8k;7$wR-UWBM&efw1`uhI(_;Us7`aZZi=$%Q* z75!5ByueDriGC@4Uf^uPNxhLM_Z-4Wy>-ByOE{^wE;x04AMITaoVvabZhdg)lX7MK zMuEG4aI$_IfV+@zQg1_WA19pD+X&nz2q*P626qwRq~0drE+(AR+Z5a-gp+!kfxDD& zQg3r`>iRy$V=Hi%1?X)J?sCG(`n?C-rwJ$Pw+*-}0=R9#eTHzd-0i?!NjO>V_Ta7} zoYdO^+-C_V^>zgJxd3h_a90O#4dAXJoUGr@;MDbfjPEYst_{%J72FpHC)>Llxa$Zf z>$f|&F9vXXfcp~RWVw5S`!eBVxqE~AD&eHwKH$CI zq~80$eKUYN0Nl3-C(At$oVvb``En4r?*!<55ZreOC);r_xEly3>-QmWHxf?j9Rluq z0o-4Vcz2X`moWc?<9yNhtLeiOmnO*pAH37opVkNG?qoVvabZVI^j0?IuK-2H@; z?U)Mg0m8|4M4u~oFo2r|?x6r~I=F`exZ}V*ML5}xmIN6R?a4!%}>a~G;k#JIP z9=MkXC-vIFy-YZ%Hy_+90bCK>tAvx~E&!*l?_*vq0`~^dllAKW_Y1i2p8*9SdyeINbT4{lSUC)xa|oi^;UvY*Z0wmv%&2cpmz?qod_rEcP_Yw0PbVpb_w9l2e)egcL6wceIM<; z5ZvwodLIY3M*w#bxV-|ni^07&fV%|T-T~aD;PwgNJ_&B$0Pa)Z_6y*m&lNNVaF>Hq z*Y`0V(dPx;7oc|qxB~*X&mc}dPB{7gxDt8?5>C$NtH8Z~b>-3q)xN0pK&=PX`W|R8 zJhgw0e;^|nbPgG9dqRv(M_9~SV{SR}0(SFk#T3VVKrgn5K zDLRH~i#2WTH&2~BF6{vF#ng^@Nt}$kh;Y6iH#bimnsQpE;$EQtRh9P4Zo)mxRr_j% z{E)^b#axPq)W>>8ohcU^1)XovK z+ z*YtUdlWU|wmlKuH*yb-sT)R|O&JcKEsXd(?-fQ=&wMV(vSGDo!p10UHLRBlLw}>@t z{)*l_#Xd9TIOaXFyr-X^rNqCvPRRAAc0Q>cZ$(+9*fh_3nqC;!*4f$J-PJIu*y)Y^ zzDAeI@t>*`W-RNPHFIWrZ$}S49x%vPshp1a-usu!dlVp`>{2;Ha6J%mp016vcD&WJ zw-FOFpy?GM@qO+&zMFmfuW|SKjyz7iZy(*-nQp?0>jr4Zbw|iO#j2DOa8I!+&vqL*75JNBPdu#dTE0 z<@g&^z4rJmyNcy_3#wWnZ*IqzRhw^1 z{RLI6oX~sagB+ig=%Z46Lpi<(S801>Ili8&YB`>Qs#i{@H(A?NGjTa9ymzFk)}DnOUjJ$8?pe_=tGl74t$j%w|EyJ1W#_BK{Is#7y~}r_sA}ab z?pf%pi1}gF%JGg){284}uTP^YH+K2&OIEEt%178*ioKnf2i@#OQFPqb@5!;oo=yb( z~ z574^@+!2J6^}83`m;mlRaAOH4+i^d*afFlQJ^-$Xa8mCfaN`Ll^&SQ{fpAjqN8lzB zPU`&_+$6$Dy+^=JCY;oJ6x zsrNd#R>DcWH^8+KPU`&v+&scbym-~k_fO!K5>D#<8C)0Pq~2TLP9~hxdmCIY;iTT*!SxYN z>iq*;KjEa_JK#(BiHR|oF&fO1i={@gF<4F{(__Y2$zaA%To zMZeVc^-2d{e1ZPk2>o|KK>uwF?n1()iqOMlk^bB-aGQerM1bCA;4UJZ9N*2sT}(Jx zzb(LBLO7|nCAdooC-t@hr#|-!?cE04WdVBIg1ek>vVPI?w?0icS-XsNb&Ot|6Rk?{47K=YFBw z-N9WOptlFOFAz@l-=5&EBb=_jSU_at{Re4Z=yi_k;Up0QUiK-y)nW7oSbnpZkUR@*!~F3D7$P+;<5l z+Yvo~>juKf`bE#*x{+{FFM9sg_X4=X!QDhSS#I?FE%muy=$A3z)aQPI8w*Z-?iaXm z;BE=1UlX`n2`BqyJhCgQ_{f-9rP=MYHa1RG? z$AEi;aIzi8f_pT8n+@(U!pZjHBR2Z;PSD=tz&#P5cOtl_2q)X|5pYivPS&p-+zW)0 zdh@}(NI0oi1osl*q}~E>FB4AcEd=*U0JjL-tAvx~M$a2lpI?UYSOV@1q9^NzH4y#z zWzg#e_jZ8Z$#|a4285IC=mobS;bi^#z-<)3Ekpg(=a-=!r$A4Aei^t^!EH*)mF-v# zZnFSx1-Q)#C);}(xGe}L%Z;8Rwk6@D-WlMwBAnFwD7dW&C-u$*_a4GYz34e&>hsIc z&nv;H&o2XaHn{Cbxw3xefZLvMvVP}+Q=eaka?b;|V}Rbr!0kjhS->^$Y6f zwBfZcTs;ttPaRS{67CljMj(wuS_f%er1g;2M;e8+0n&y@xZhF0y^I3xQxtFyqJaAg z1>8F*;J!cs*Zc)s&lk2vdJht=*$cQHFW_3cfa~Z2u8|A4{w?6zw$OmIGZL;h3%erW zIx-bT5EYdinCZr>g#v@HYnuvt+#RAR+ z3pmd!;2f@i^RoiZy$U$5D&U-{fb*dO&UFenk15PVnuUaOl>*K~3OL6o;QXP0bA!V1 zNGBk{{|oT;!bwPTky?@3kmez^Bh5!DA}v5#hy-6O!1D@=k>F_s_*G#kQWp|DsnCN2 z&ndu93h;_TKN7s4fH+@33@;!)7Z7_3h^qy}%mU(J0kN)tI99-Wr?3*~Y@~CL&P6&8 z>0?OeBVB-WA=1Z@K7n)*(#1%ZAYF=d1=1&xK85sONS7g9j`V4y&mdiibQRKPkv@lX zHPSUmpGUeD=?h5LA$<|)OGsZv`U;Z&HEftXo_;g2P>;UTy%HSyR`*J9=zrZS!C{Pa zuLOs2)V&fM##;AEaF`FeSAxTw(Y+EJ=9TW1;4t@euLOtrse2_j%wgRtLpeD)YF~>U z*u;E2q7>uz923RaVTJm}#?kn%y}LJxI?j+XG@=?16YO?2tpEORw5%ZSMgw zFSf$nhGB;^&zu^ixlQr^yO%EQ?mA?0S9|BO`Ni6lS!DkyljEk39$n}hz0oviZ2$ee zb{ai=Qg>l^{QVB+kA0@)!Z{c2F=wEyVBCf{CM7!HkpLStS0Y};d|kKSO?;=;&D%L^l;@?Sb~ zlbxXQ)_qW@y=pzM)0n6amMv^(>0A~qL#++3o39<329vE@>%3-C| z?FbxES_@x)Otki0TQkwRZml_0v#^P;w9Lb_|M`LUQ6 zBcge+)-=42c`-7L7vA5f9b6lFK+KDEaA9AMo8i$@KO4-=@zLha_~^Y(ZC}*Z zJGVbM(6FFm`Fq!f4q8jwn9PeY(d{13ycmnenzy&DrJb}EHe1XKaXk`$!VmvHrPwvU zySH!jf}T1b@P(%aU%V)TUGwxz{WyL*>Je|%7Ttsy;ti4lDkcue#+Kl$^E zHKdWXW(>3kM7&rhG+rE8Jf+wfJvutQTA9$<*5B0DJFh$X8>ZT84d?+eFE$uosQV#q zhaXD*#xrd#xZA)TMz~0_^a6J~IQ7|@;O+o-c!1uW;Eo`iDK+{dz|u24#{_V9LvJkM zWIOHwH;!P&(=i!?gytnTNB&^;3klAW&IumH<56%eh-10L^!GUFgW$unyBB8 zz^TvH1ovZbN0D-6{T=}~m2k3tkAiC^oYZ>^+%&>Ty~n|+&(=gco&cvlTNB(*z^TvH z1otGk8Ki!)9Z!LqNjTY#r@_r4oYZ>;+%bfcde4G8mT*$XW(J#+~ zQ=hE~?q}fCXKRA{Ik*!@{bV~{0CytcWIJ90cM{>G-pkD#90-QUQ>a#Ubzc<0D&(;L@TX0JP z%KaU-QG8e!|K6{S(}& zgp+#z2Dc)Bdk5TU0UZ9eQGd4P_|meR{%lQfXp{bIO>p=;qW)}6aKpi^)Z0;dR_ED- z6a8F|Pczn^LpagTrDuAcOE{^wF7(bLoYY$n+{Xwf_0|V>KH;R^C~y}LPU>v{?n1&z zy$!*AoN!WaBXH`oH8E}*gS#j|Zxe7A6HeA|Q*f6MPS$TTaF-HJ>TM2AeYPgru@$(> z0`#^9cRAr?{oVua(}a`t+Xmbf0o=CWK0`QJ?snj=B%CaFdvNNrHPJ6SfctEK-j3it z7r^ZV?&<)p0o*l&lkMFZoce4{v||@=*9PeA3hoPpll`|Fxa$Zf>$f|&F9vXXfcp~R zWVw5S`!eBVxqE~AD&eHwKH$CIq~80$eKUYN0Nl3- zC(At$-2W0zmU|Gm?+{MveGuGt2`BXq26qGDq~3?X-AFj8hrbBZpRI{`e<-+{h@LF> zFmUR#HKF%ma6bspI~?52gp=(!0^BWxll2<|?pDG{y>Z}fBb?N00(W}=cOV)XYl1rl+~Wb|9t-XX!pZ(S z4%}0OlkGSjoce4{)UOrX3jum<;9ex0tlvCvFA+}GuN~aWgp+#n!Mzf|6~VnqI9cuj zaO$%)(Jza@y+QP3{W`$?f^f3jCE(s7oYd>WbD}mNoYda#V$^@CHNtqE=!xXnoYWP48mw>jZtdrt+o1>vOLa&TJ`PU@`yr#@Q~?KlnG z)&Y8_gHxZa3B5DGZ4;pPQE=N5PPX?+Y?Uetpuk&TNCX#8{Ccodgp-K ziEy%h=Ynep;6m#c)X!u8@le||I%8k0{9 zA7NgD>XMqr)*hxfsEJeirQjYI7QI1ZT6-@CYu3P85Bw+gK)tN=f`yAZ7BA^s+ST22 za&KS%vQti7zT&hKPW;G8b6eZywa+g)kDq?VN6$QK<=N+)d)~*+zu>};f8wHxFS+!S zpZc%MF8}lupSkj?&wlReYd(MN7q0u_m%jX!|NiRNuK%C^_w{dl^IQM>?f?7EcW=1y zdpCXm2RGkx>kn_c{f;~Dy8E7c@4Nqj2OoO)M?Ze#(Z?Qt;wMi&_4G5({`9%$fA;ei zUVQ20S6+SX^*4U;%U}KaH*fy-cfbF`AOG~{zx?%YZ@vBZfBf@b|9B#XDCOVF<7VXD!R_Qfj*xd(@7Uc;gV4=eIK23l%5h6 zJt@piXT`7RiDJ(sUnd&)*|P~Rem3wYk0q7KOXM9R(t$z)R z{wfD!I|BRktb;vz*2Dfhqp&y6hIoeR#&~Mcrr3{XbL_>lCHCRj8hh|;gZ+25!`?eP zVBejc3JutCXBRx>e>dy^u?Ke9*$X@D>|NNWr!#u@V^^L1v7^ob*iGmC*h%Lg?4olp zcF;KlyXPE+opTPyt~q0{W6eD5Rx=+v)hxg+HH)xA&0_3M(}|sFy09xv4@R^XyV3Mx zCz?~R3(a!uKyw;)zc~>*-<*V9Z(0ZS`=?{?nvY`NnzITkv183S*sbO~>{N3;cB#1# zJJfsvyVG2ZooOz`jx?XbZZwx+Cz?-Vhnmk|7n-ZE1I_2K`^+`idFEQ|I&&R%ocR)V zoB2xNzYAY2e64VO;eQJMukiK4Hwxb@e9O$O5ry@dOMh+O($ds0wWDiE5vxGC*Y@Uq zW$r*Vf6xlCu{}MV)zoxpMddU%PaWqvCVz%M{cD)KGOT=Pp+cvd-`$Q+aje=`E986odi_DC3RQ^8>08t}Pm^jHUumzQ zoc?7)Qcl#CMhueHrb>>tm|t$h=aPJ{YRtDtzY#kpsGaAlh;ppe93R{Qx*{$PN99cG z?$SO?Fs!+`MTty8bdX<;!S79JJEe_Z3Y3J`AByuplr${%vHqo%Togp@Dbo?4AEFxgX6e1 zKKwWBBaI6?yaQCV_AGAmzMm^?Pc*NiSL10NJ@HrW|5u}&_#VPR2Oq@)$98M^Jp^=) zyZ^PH4)7kr;L91JdkE9VO=-~EJUclf9dvtIrmoV{gHjV(@&BRl!l;~*cPM9YcrVBI z5C+|ANjbhNE!;n=S~>m(Rj(Xx2&`gzdb|Zytv##TJ%mBdx5%SP^E&h%!XV38Da!H9 z>`KQcEywHZh#6J8hfrMQ+m@{5*Y<;)aRa`#A9OjG+N;gAeRE6YzFlh18gy+RpBpz9 zdl%A6{B_o}bK@aBCmMoS+t$-V2QQkh)p)f+WGJrNqjEy-Zvw0Mg}J|Izv9Ue-juI9qF!@+%Ao3Nz7?0_ zZ%}&vTyZ(x%cv^$Tj2FtrR`bWuGa?Ho&jI44YHh-h=<8_VbJwjrR5C4ImDWF9Ti#D zP^>A=?&v!3fQIDt8Cylj>d=apkjt?JMyPUn!N&x0Mi2%JGd* z)yh#m`hs#0Dl7YZX2-y;UC2!E^?H1)1B*Z!HGSUVWDRK0d`dd7YVA=z$5XZO>7KWkG^O<8s+H4Q^nT(ldh-%$e=I9X-*XUJUM4YEQ>}??-`__b5O>(WP>R;CdkB zUSBolLDb|%Ow53$SA^gath8&R=VssjYuvrQBae%o5iD4sv`3eBEAgIf2*hm6p@lJ~a1Ll)rhY z+I(B;FQ{tegnqVZkmIuwv9J{1P>wIcRoWg|j<4scT8^in>Xp;!4cINc(YAj5D{x`g z*Wb|8y|kyJQ+|@&Ixc)kei@GscBz&>%zSO>R8r0mT)ULobLx^+{+Wn1a?M1!A61R> z-e_tK#oA0<&I<1xsj9U{`MZp!?w%D5v$`8v+S-@2@y}Xi-gV_~Tg;b@9qnDd8%0$s zXK|1Bvzt{b$2&SW@2$f1X=xsGb$I_AuWId49ud(}?Cr!n=w>&HqT}UJ=U*ky31UR0 z?TOA4qt}rA9b-?Qcg1SvqGG4F`Kdt;@iYR-FNYn|3k^s(~~Ag+zsFkBV6h4{vsIMjo{Q>Yr%aF+~EOw zH-S5XaI${i2R9~w`vJJIgp=*K8QeI+$#QQ2*F-p}_d{^%uC?fw+rUi-(7PSnM8e7X z-2rYA;bi^p1UH#*QtvKs>aMkD$KBwL3edX;+*HEJ`rQkznQ*dx_ko*6IH`9(ICa-r zwBrGA>aMlm9t5ZES_|$Wa5G5#WIG-PH++_8j{dXIve zO*pCd7`QovlX}rE!p8-0Pk=j~aI)N=fIES3vfL-Zok%#T_cXYZ2q*QP0XLU$Qtw%C zt%Q?$KLyuDIH~s>xOs$=de4JvC!ExK0o($@Nxc`rEhL=OdkNek!b!cC!F3Q$>b(L^ z-L)3)w^zX}A$qdh*T8iWPL}&RxTS=XdT)U1BAnFwH8^$GTD0Rg;Cch}-UQc2I9b2n zg6k)otluBOok}>V_h)b`0=U0`J1v0wE4b4GxW9orgK)APZ-M(L;bc4B26ramq~1Tk ztt6b(`zN@w2`Bab1@0WeNxgrAJC|@$?;UXJuCIQvV#3M#tpn~7!pZur3+__FNxf(n zVRhG9v||Hsmj&o;2<~#i$@*;!?h3-m`r$HF-;Eaai+1z9GC*%LaO!Tf(Ayl`X9M)M z0Qb27ZcA`i2XI?~yM}PG|F#CF?naAtya(L10eahj`vT$Qcx(&qI>O2NZ3pg)0o?ZB zzC<`#?hfF-OgLF?1GujePU`Ip?rQwoGf>Da9<~!EO!rZ-yodS+Y{V31Gv4w zeT#6i-1mZ0ccaC8*%#b*0`&F+_g%utb~J)hccVqQqru%6ptnD`?*(wtZoW4WPWHD3dIB+i!PS)>ua4!>1>YV`Yl>qKUaIX?h zmirNK>Ta~?m$~5HAbPTXt>At^I9YBRcF|mia8hp`xD5y=_1eL0NI0oCAKXR(+yb;i z-HjIgf;BXKH(GFuz^S{@g6jac8L6LaFFv!b??wx~CE(QEXu)-Y+me(k`)?_@tq3RU z7wsavHQ}UQH#l`STGX!x+%^GvCxhFTaI${*l!Cq+Ez0c!w|#(KKR9(aTIekUw_||b zDd2V@ob10-!8HVMq4f*u=d>ehUsydbsZjTA#EnDAc%&@2{{wdz;nML1_Z@KR`WCqF zf;&7w?*?#35Kh+bMsQ;SxbJ}*OE}q%o4}1DoGkbI;F<_0^=<~Iu5Y1VZUHwTK<`#? z6A35l_d{@#2q)_ot*fc)Td3dd;MDakaCd+^ij*tscPF^1gp>8V3tThdq~6`&rV&o+ z-2+Zt-$Fa?1*fiWfx8c!y1oT2T34Gv>L=Ur062Ah3wjTNQ`fh^MeAzEkaA_eMC)qm z`WEzl1a5YK-jBhl>s!!^*42(9da_?01$R8*WIG-McLL$0-s9j-B%IXy3AmF8C-t5L zH-p{}-B%IXyIk-iHlX}s* zn!3J)`SKz-b$tumOW>9Sl>0KcPQuA{yaH}1;bc2r1=mG5srL(T>iQPi@k?;M0eZgz zr><{7FIrbq*SEm^4&14vT-n|~fLjs3{Sn-00oiQPAI_O zHb8GvaGwj{HUoEc0Jk}~YX~RXy9GFPeGBc_65O=`dRu|}0^wx;Z4K@^!pZu*2iz9} zxM*GNON5iR+YQ_| ziJmNXcW~b#oGdq5S5w!wQ0{xdeJ4O~Z*c1R7WDQ3r><{-+ZWu8q+HqFXkATR--2Ev zxSNQc?3dBt)b%as?GNq;0ebHPcQfH+I}QMM3*lt_4g_~A;iTRNz}-eTsdo^#+XJ`{ zg1aMtI~d%Zgp>7)*46GJoUGp=;O-`z)H@WMy1s>RI}F^tL{FCcVQ}{mPL_K(xcdnw z^^O4d0O6$G7;x(P7TPfuoVvaRZXCFW1Iir_?h(Stc1!@Lu5Y2-iQpb1da}LIy4vG} zljTkZ_XOdj-c)c;5l-qggL|5AQg0@>7YHZyW`TQ=a8mCWa4!)~>KzO2Wx`3l+2CFY z;O2mPm2k4$X#GuH-@^Ew0PYQi>iQPyHy7N70eY?A zHVWY8p&jb_7Rqgh-X;Nh^TDa>ThJ?l+l=VR{#yWUbHd5~i`L)N^(~Yet-oyj9^(Z=oG0 zgWEAcuNT}-gp>8_1J@A1h1M^qpVNldz8G8&L?gKSjOo+iBIVb*6K5RLV!qvVou=;j z#f3#o(?Z>Z$y3J)tirk2LuRlMgrf zVv{d1dA-TaWUu>U{C(ZqCV$K1e>3@CP5x(-|Hb5QnEZ8$JQ`6edc zILePK)R)FB$q^JbGRHSG`37-b_k_tGH$OkY6~eCco3^Pr*V^luyQji>SjcBYP3AOV8v==K7Qf!x&9A`6QE1 zHTh8{?>G4}lbYxbR5$0NGBo9MQTNA zLz;)wjx-;sh_nD{5mE=zVx%QVok&ZOx{-R2PDbiQ>O<;BT84yisy`KJIns*4`uJml zwo{h&bS~?g+uqhYue)pR{NlW23mfr(2b|4CuOrMW{%(N(A2uvK?;GH6t}!@n4%J?@ z9$0lfFf4k5#`4;GdDT^-rd;cR)uIPdzrm?av@WEs(}9cDh17LAaM3!Bx=sf!TE|h> z>A*$nIO;kbxM2z>vZ6v^%-@Y4qUW8^KEk9C!IXt zqV<{oBb*%HXnjUq_k&)vKBKPtfs58>)O9~_(fW+K?guVfpHbKSz(wmb>bf7eXnjUq z_X9TuoVxA@ZY(%;-49%}KBKPtfolS%uKR(D)^XHzKXB1Hj=Js#E?UP?*Zsgn>p1GV zAGl~8M_u;=HwB!!?g#EDaO%1rxM*ESUH1bQtqZB^e&D8oQ`h~#O$Vp0`+>uaK7HK} z+|l6Fbw6-3z^Utg;G*>?b=?nKv>v6d`+we(c!2NeXoQ&3mzCt(|cd;&{uOp&dtPAPuh~RLKS6@d2hjk%+9T6PXh4ghq za99`8*Ac;CT}WR?1c&t=eH{@T)* z5y3_4I2)7t$@zlYRr-1(^!lNvt~Y{P22NdX1a}HJb-fYXso>Q0MsUl)sq2m4R)AC2 z8^N6hPF-&VcRDzAy%F3Q;MDa-a32Myt~aIwSo>mdJy0M2+K9R+-}jg2&K)&>A80kW! z^N>D;bOsW1rr~#|^^X`e^8w^vsk`O#k0CvPbVuDSmyH=Qsu|y3)ez@bJ{ITKyouu@ zk=8@n5NUU$eUL^YeE_K$X%W&nNLSb0a{1IaU3LaE&qKNx=_>qe67n06Zbf<$3A&fB zJGpB?w|SN+jz>%>MH1La6vE^1Q%`|P`4Kb&e)<_7 zJ@c%UXPc1|#{L@!_=E|!+`?;&H`TVtCxbBNz`tn!) z`>S8O{(t`8*T3=2Z~gDL|L;5Bz2V01-Sqt*+1d=`n~WGW2kBU(X`M*(6VBj;IP>bY2bYPSR~5_g7F4xzR>QrWT-~e9gH7;D$zD6I-%oy4X}_%$ z<%I6(lawuUtvzWu=JNyccjecW?n4=AmHI9E(2VB=(;3?reORZ0*PN#5xEJkzMa+a` zci}-g-I}&HP2ZwU+l0r8v2$e<^NI z5Be3g$M?&rk1h6t@G-BH_n@gjsXa@vY*4`~q?}beWs};M?)f*i;r6%ZHD&A!&yK&I zUo?ltn7pyQv#rnLncDd1CB;OevbR>%+OxRL`+lypJ<+_5UX7=9Xy>&dQz{m7{68uu zzK3wo!AJ4HvE5pJ4*{Ly=)8a*4e%bq;L91JdkE9VO=-}Y-P|%eIU^l(ds?P;tLIi) zJ+$Mk0EWT~qjE~#;lJcA?+-obUQ5dHU1^E^p(`%O-=Or`vEp*PA+U=57P$X#rR`bW z?ja1aJ&|{m=5^@4z=JGjr6|WYvn!o%X*phJN6aWbJfkK3lSCUu*fb z{UB%DfUoTbT~0LmtIM^0HGI3&o}QjnYTm6;A$SeN{+#i-adWYk@58&!ns#nHq~}CK z5Nq3ddbIm9@r0`2|E>7lp}203$_cr@39RB5=KiAnrZ@N&m$z8c=6>_k$>X$+6KlS4 z7iquXINm(4HSEEcGq5%6!Iv{c*PlZgoBWqIb%D+MYDldLy9l_CfYrxtzdzmz9>&-HX4&TD7mz_=Mh59AtY| zq6tYkK^|3UIlXE;K&YJ2R7uZv4D8y4v`DW(2Nr=eYWlpz$r{k0%ZbWp^sfFF3gTL< zvT|VXTAM04-eP_^dc=)Sr)up{KF3qF@#&t2=U4Jq)ynBDdOkf+C`50bVxO6EygJ?^ z%X|9ySxWqy>x5i?YWM%OO9I=wdtES*Zq5p|Pw zNWRvt8MNb(PN_YoE?MQDiC81oOqBak)j02s#%Rbs6E=T^_l{K6+N1nkMpJjsiiTO; z4J~c$OWOEnt)i}RzFN#r8#~&&d^d`!R?gxc?`JowR*rXcaNb*m>(i*~8oT`WC9Bq+ z9`7xnLQAo?6Z4>(QPFYd1jzi*JSQmg)AF~KwkJBTie5wZcZ@xK-W98vi;A7zj*F{H z|G&~48H&$TMnyIHn^UN?J*GJ*r@yzOYatB@RhtL>9SeLX*p-%(#5eTZP?Tgnp+EY| zy^i*|^LvY(V)>%>g#KiX4KAb>9Tcqf;)_GrN5XrdUt{QFySJk^g_9JgFBpXQtuvcM-VQNi`sE7xG@3Tec;9t zPL_K=xN(G&P!5>D#<7~CYnNxetFO(vYwdlcLh z!b!cyz#T<6srNXzsf3eyPk?JCoYeaXxM_rwdQXCz9>6^Xu7z;2+^4}EO*mQZGvH}1^?nO(5#glX@4$5sPU`(0+~NT458##%PL}&eaGivc<^BoW zQo>2SKZENcoYZ>@+{uKKdT)d4C7jgzJGef=Nxgr7>nEJldk5U9gcEx8__}^Y00-^* z(*n3UaHj`wD7gL%!ijd&4+r;A!pU}w0Cy(gq~1EfwfB{l^I>^)?0f3BpOe z&A?qmIH|WexQhuV^|k!9N2`BaT0QUvLNxeP6T}L>nw->lC25_}q+S1-F$o_jj`tO?o{r3TI-y&S9jNL)- z*IGflw0#KNcLMZq+qAZ;TH3+p3-t3?^h<45wYWdze6H=PR-P=fU$CH5+f}XHHSt$? zA03B&d4j|t*?-mERjnQ6zCg-NtBLx}2lpc3Wc`ZZULu^-!=hzv7c|o$vj6b+Q~$s0 zf`*mq+U{nK@i-0RvD)r#hWF)}sNc2$@3*tSZAUmc|5k$Ao^bO0dp5Wo2q*Q<0koj%GFD@)% zv&h2m36rOeABNlMCO_8XA2E4R{9eQGrtV&NPT@*(@OYCS7w2`inEYmw|G?zmH~Et$ z|B1;TH2DK2zu)9Hnf!YuztQA3nEbnOUjHGJk2CpLlOJsIgG~MblfU2O2bz40$&WC3 zyU7nX`E-*XX7afvZ#DU$CO^dFqfNf2$#*yTE+*gEGWnKqUiVv* zziIN{nEcmqUcZCMw>SBA=J-1%|F_BiWsc7=`E2v^f13Os=I6sqUNCuw$rr_W-Mi-d zktQEu@?^3vHs3EXdA-T&;=JyUCjXPk|8DZPP5ze2|7P;Pn*7fu|BK1rF!}2yf6e5t zn*3#xzhv?kP5y$(pEvn)CjY6)pEdb2CV$%GkDB}ulmFP{KQj5lCV$A}ubBL?IImyN zag>iQ)F<;|BlGhOO};^#*F9nK$IZ`2nS6bdpJ4J6s(5TH@dW-GxA05nZm{e?=U+l#RUcq!i{fy{$Mq$A%$~VA5UX<5kVK>T~ zuqAVpqccmB@yJ4b=}kPYP(MHV`9v(3MfoJdO~FD@^gT{Sx-m)q0@T1FJ<3)OL2J!yulJhQEcUnD@W{cV!xUIkhL)c*lVqEd7Q0YV!0m`J@6@ zeOJX3Y$_`UONpLW_1e?pDaC#wj|&X%x9}&VR8-Dt_yn85v?d)uKZ?dx2h)*>5 zUbUT_?cQm{x3!&}?LINz)pmAvbW6xKyh9NuQMJ)EjpTS96zZI1;z@4=Qy>sIL?;#AnoFTf0P}|wrno2?6MDwk5ufl)HU4EMD zpl3l+j_*oKTys}kj=w?aHC@H!1l~iayc};qRcp`cb`N2Y{Wjox2!kwVW%B+Befnvo z-mw8K?=p%l%x=F*NAwVj=FgIwVc zqP{Ji6AeMEt?leQxWU5QukGyY=sK~s9Cwj}(S9_*>(9ZL6R-hz_O0U-{EoXJRUK?b427J9X z$Z}RD@1M}?wMxqwf^ a+iW3*v+!Gvoqcdj#nC+$bO{Z-r)^_S6~b8Tnm+zO$Y)xjOZtj;#9kBcDb{v&uI=nRe$K4McJJkM`MMqVl`Gp3JMg-&(sEX} zd!&PGPkNoZDDa+q#pSHp@k!fL+u3<=ai_Mk^MLwoCC(2@*DmO{+Ro0=*;4$nc79HN zn91Y&M42CEzSXW7wBwOnshrx*&Y7O|f7@yfYxkq7ao!shRomIwba-IaVz}DQ&US}| zT+cL(lQm@I417OWF`-=V;y+%;OC9YbsXGA;lqX{QjSvAjvrP1xpiwtx2-X)tZN*- z#a_Lf&6@%jX|M zdI0H;x?3)T)`;usZn>%<&aZqd&aZhB$44TqhqNKm?nwI}jYj$aQZv#bq;rt2uDj*( z=vneemz{xh9@51~SK()P-uz`ZAl-`eBocHlUw3lXg6_ti((~x?oacxsrAQ))`E!-mKI?4P^88#XR|w){J-`*`uf`Q=&{eoRK5Kij-7~D~WlX{PUn@TvT_b9k#!b!cyz)d5Z)O#G< z^Z@P&a4m$B<^BZR(S(!bJ_&9H;iTSE;ARp|>OBo^7U85G&id+)A)M5E7TmFflX^b| zH=A%$?>TUD2q*QP2X|Zm_cL(E6Hb=}1^?nU*5#glXZ@_gBPU^i0 zZgBwjTX0JVC(HdExK6^!a(@qQDdD8vAHa1HPU`&y+{uKKdVdAiOE{_bH*kG~lX`D~ z>nEJl`zN?l2`Bab4Q@pM_YSzz0=Rdy>a7FrT*67cb-|rSIH|WDxQ`J|>a7p%e8Ne+QQ$5h zoYdO@+=YabdK-fKIN_w;M&Ld{IH|WWxQhrU^{^;ke=*^t-lpI#A)M6P4BVxJlX{zj z`y}C{-d5l)Bb?OR8rj)?Hb_e&x0B#R( zUm~0=cTaF%CY&sHZ*X5FoYdO~+}8rQeZgH%I9V;BF+G)WZ^9{r3X6L&4od zI9cvt;J!~dS?-6y{eW;%?{IK86He-3m8kv}!b!a`;BF zBY+zZ?oPtV`b_|L7vW_6CW5=0a8hp)xO)gE^(KS6H-MW0?moiFa*qOcKjCD#Q^7qz zIH}hR?!f?V8n}l7xar^?4&Y{hdxUVZ9W%i_8oKza6X~IdpR&Xy6PU^LRdy#NbZyvap2q*R0!M#j4sW%_oD*;>)+^d9>a8hqMxc3lF z>a75`4dJBTY2dacoYXrV+;)VMdS`&!o^Vp{qu_QRoYXrL+>V5kdS`*#iEvVHCAfwF zF0_6@{hU^`_Qjxj0G|&SQ~NwZ{P~31=Me@qg$DggxPYqeYgk=n>+x;#+VKd$g^M~C zFX>#`)!lP)Z(skiQ%+sJ;Q@~NkvdG@EzJ^!HofKO88c@cbL{Ln#~mNHpC2Do`+GY3a86LDTKjQ9S$h2^ejdSm*nVdJ z{D!7|_GxJ9?&|CAEFLnWxU{>!7=H%8K$x-1`n&h*Z|hxH>}Ng~i^6mbR{9 zC!=O|FY9eDHq7cR7W)`8w!OXB*9V>cMU*N1#XwXV9^Td8v9!pvW|ivPFtga--_f;@ z%1!9#EaEXFJv}~X+_H|&`3>Wj_xH9@p|oCc!K_+M%li7emo^+#TyZKMI7!v8y$6PA zesN;4iz!9OksW<)eSO8H_@lXAA2+eHdtO^-!}K2XSjTC8c4|l05Bv+xJC{53mpE2 zh#vc*%)AH*nRyWxI`bmdKl362o7=L%DINAtOd#00*xyBX%tU$WntpF61&OI0FcdNo zqry$6Mb9+C<`OH3_? zdKo9Bo%tzi0{YS1yz=8_YWX33c4gd+%ViAC1I8Z5fqZ=DtQF!p)?%NtdBAdHEBL9v zk&8m*07fpt)sc&!$Qt|=)W;S&WrN^imPc4v{D-Wb2xI^rdkm1iqn%O5K;C#`7*C`z z1dlPpG-F1ycr(2L|v(f&^hPKpa>5U4P#THBY}g-|OO6ePhDk-$sDHvrBKth6%mJuJ%Qq z_qT=dce#c6-|H6YeaBm*=Y4N+{M~P1rEj9EZdVMjNFE6+jK%|t@y5; zCnuwiEssE!m==eo^mG;bifSA(m==c&R;q!#vu3$YTt9;b#34hfama959Lm;_$00*% zamZjw95Pfu95SR5hXkd~W`TypA%XMREFjNZHIyEQEYKH+5|G9r0|dn(!)kHJV0s)% zKz|$(RN%;k#v!4sj+`eB2^oECwK!zNv^X@e*o#}MY8*0{7KaQL5{C>L5Qhw@#v#LL zaVT3y9)}F6#UXr1FoAZYvoAt&b z8}$Su8|2Z*=F)n)!jX;gcw}=lAlaBVBH1VnNqLOV>^$oaN_pNjxAT;9>e`quF1bi| zV9Jn=$Yc{rXtH4*n{3V(oH8VfPI)YJ5cT+!*VYHo8KLq*0prYLlr5(QDRWZA*Qbo0 z;nW~yxb)5MxmVm^*pMJ)P(4T)Pz_SqdU}GCLDe8-I4wvSEF?%7R0~o9Q|Gr}gMyUc zJ@Z>ozR7E_fFNa&-XN8bJV+TLEJztx4N`^+2vP~D1Sx@q4q|YS659G8`ht`Y3K(ZK zNEtabNSQM(HAopw4N`^+3Q~p*2~q~tgOmZ)AeF7BCrBAo4N`{Ff|S8Rf|NnEASEz$ zehW4zND1CEzXj!+yao#hQWohAQVGd}lp(@`l!4VCWw?MKm5@r15?JUU1_vpjtq-Cv zNC}~UaaMzrk>f$C6h_SRq7Ny5{LgWxIzE>=r1UX6>l1(qn|=sT;q1==DsVh|JfBan zJ`Ly>lOG7=Wad+09E?6wm3-dMPw`o3jY=e#`*@gN*&ldv>aHo9gFMrbO`NbPBPsV} zk%VWONX#`snH=t#I627E zndYR~JADijG<_uNn?90Lr;mjB^pTX_;(+O61oi1-KxO&}N}E0c4VgXy51Bp!=hH_( zp3XFN=LoH~6Z%%_i}^cDw9A0wzw9|J1WM^M`I5opNt5qQY-5jdYd z0&;d{Y;MV_2AMxLq)Z?O?4Cgm&@+V`v}+DIuz+@ZXOS)Gn?^QC=TRQx6DiO7XHuT` zPo+HXnoD`g*Qq9C`6rWs!X}f1y^~3T`ec%{XEI4Fpxq&p$w&rFCPQkINnq+^5^T_9 z5`55P61-0CV=@TlYzn}lZ3sKNrL)hlC)SPjZ z&}0&P&}0(4XEF&Y)2Z>kPuBKd&QB4!IM*#_7gsvbUnu@k*jyO9SaQqRg*tCJyFk}1 zXBU^&)4t{GLS46Wz+Z0=jmF2R`0-g0)5 z)-7ijL2o&`;5b~Fzt;84UH2_#mtu4$H*>F#VWETQyXDNZ^+C+sa%MsScc za&~b!$8$l{@hF^iJPJA;kJ7f|Q7oVziQ~B>-HzuX9gfGa(D@iiGRI@u0|`QrzCM2= zD$}WAzsvnf5#Q-|dCKK>c`Ee~=Vw4lM@^~3>GG0JpUYz|m&;RW{cMlRgD!{5Qx1R2 zL&V+kpu^kTkZTgUNj9b2v^}BRj5?j%j+Pg5`*6;bLFL6z9p#{#m-`z{-;9wC7c#+5-xp1djd|v285ghRfA3f zYGEhg(t7g1lb~AYNjN3=Bv?TBNl+yKNlcs5k_`z$lIQbUQl5#MV0tLB$?VCsYXZCe z5<2#^L@OvDC9oEf5>5|FDd`VO5(^!~(9k5c^+EK6Cn*##&RU2{58l=jkH%M7n=pY6LDN9=)L>{Cpp@4B# zf>bJ}2PuTJfDjc?dVq?k^lk4APZ1duoFXtFG)0&mn5_Ew!cqk4K`EltkQ6~d0Vx92 zaFjs$JWj~4P?XTVIh-)w=@~&GL8#36Lr{tH1fb}6VEBnpJ@`aaNa!hXTHr~bu;B_1 zI*G0}T;70_h^XVK2b)Mr4>j@mQ0``;q1*u3Oa8#QaYY6jt{xoRrU5^ z+-`ES(N(hhW}}OA+-zi+J_qA^`ffHd?XVzI*7wcZGUe^mXv!&5DMA7#Qi}SgQHljj zqLlSbp%hZv8Z><(xsb^daq84bAbsK_B)dm#Pn(1en=}dSn=%Q*J2ClmeM_kui}RK( zT!<(1I^NbPSPt#U!%wY`AeUyTgkeH>LTctVx@fqAb)A94AAdQ-SI-1dYA7&I-SU)O zE7$UZyK+vF){)W9sw%KuW6|enjCR-9NzxiK+F4@-_SHC=%pvtHae=i>*nqlbP*c;f zot+KG7JK`mhvV9p3)T_q62UrBdcR;i(kGl-N8?h;&o#FW+Nb~4A?uXiI+B*>YJhcW zZ~dA)owp8TPvPx@qvI#gn}>rtj-@BL)-epn^qCFKMLdY!JaO1MY@MuHM=~d<_ObGu zD6j)bNXs3!VtwvtE@I~h6Qy%Mw>8`&6gKxeNwCizC_n7fI%1ukT1U!f5!R3M zXAaik%v;ntR{GWSOd@~CK6}U?H)jm_1I{*Q&kU?z%bX2Z$K)A6?f{<&&J)Dk@B8OU zq~V$?(a)1cMjsOCThtIe`@7-Dc?*q!HjM9DXh$FqXT>8Amqv@^riF*i#wrhLM=lR& z#W4?;*3-OGJg61pJe-Vp9xNOGe5f4_RWgl@92R7XqD*6-!w4zAy9kgvi(oviA}Qi1Zp7s#8Ip#e4Cf6e8P?$-8G^fq8}z^3T&|JP zQ3jm4g^;06AsCNK2#PsG1_>D&)fqCHp~FZVA*1H%Rb0PBH=}SBqg}oTjCz8tmWE%K zE!e2f8Elf9gUwNYu(7m`jyY?S)Fo_;8HG*xydpz#yKsR{$FM=SY1oY4H*D5p9X80_ z!@+R_alj4_aZvjF_c@6z=r#9!tr9#8oKeGL}3{16UsQ#-%*&aF{&AO@^}S zd)8$&c{P1rP{XmssOQ+2$98OxIZvJn96Qy2^2!4kYT`n9P2S^ex)G(MW<)mVF`@+Y8BxN77*WEiMwEb> z5m}sOL>5eq$fET5uNzS!7-B>Ts~Ay&sYaB7UL$f)+=wKs1T%>SL??+;Ba)D2L=IMc z&vGM@YWloTj3^OPj3~iWBT7KO5lJd=>;jEQDi2_&y+$N8T^(*Nni9-EXqB}Njgm_L%Lll1Nm(! z1ABZaLvmwsf!vu~w8NTQSioDtXHFSOzdL1MYEK!?<4;+V7!=1`4&|U}m~*h+z~$f_ zCgq^GOL16#E4zHkp%*Yos8eO+s8wY+k5^?#W>yX?bQo2;a%c}^*ok2|R9!tES(QP( zH}NtYb*v1RI)TfvGOW+BGAMVf3`iX-!=?3fO!Ev%9V^2z$I4(n$I7DIv7DsSu`;CF zu`-a~u`;m7u`(ogEEmWf%SAgJ%Y_BJC47#Rk@P!O2Bwac;XIC&C5dBk%;i`PnuakVBF-r-mdiaQpE^|!Liu^f5;By%hW7CMZoV>z@3 zGVH{$9I8ss!{dS+E8;>NE8+VulbT~ir0Q4^6zo_L9OhW5Z2DIlj(gC!>TgKFAje8+zhk9Xz*{2Fu_DP}$BN(( z$BMWx$10J!V`VVKu@X8Y)Fo_a=t_9MVy^n$4WTGu@Wr6u~JlZESvN>Rzi9mD}jO>D}i;#O30F|&#^2}bu5eKj%8s1Z;1fM zN+g3ED}gn~N;uuIQqu2O4$R|NlGZ|N_8v;tiP2#jwSU1CW+=)iJazG z38y<&LMo0WvCv@*bu6hpkYV>bmQ+o8-u_cse8wD>)=pzTcxmpT*W%DzOAyem;O<4KgW9m$W`e&lD3 z8~Gu1vS*!$%H@5CqLvF$D&s+%6AlytCH~`Ot+3@Kb3w>U8|U#dw(o?X+M6@+9Iuu- z6)eA@QkL6LD&sYjlTPD>!UoLgGG5*A;S~TxX@W_-@p?}7R21eg3{paFc%B- zc#FkRYq2QiEEbg3EkAcHj`@lO5nHhskE_@mH5CWu@)QemT8c$@9mOKKp;#F8lRQQ3 zB#-9ZB+qCw+v6pcnAb`yk~xV5aU-!Yw~sK!VIw(|1*IJ5i!wPl?;$yaS_mVRccH^T za!T6hGyAZFn0r_dHxCOV-jQR1MoDvyoNDlpx_u+3$GbPWE>UeGh7{X~p)@pe+lWEk zHeyb*jhIqwBU3jzVPj6QjTrLVM$G88VK~h;B<8V=81vaiOoZ4*Oscja1k)R1`ST7z zX|^FyY8!&lX0~n{u~>+0#H3;yF{Ijt!MwJSW4LXUQ6(Ui!GIW3hN*3o5zRJor1CE0 zwoz8nMqjawSV*yr7*cH`#{9NXW`ag3&^F4d!9(h`jk2DjdvUYNJTZa0hGdv&NXF+G zlJi)G#HeFPh#7`t(t71*s>GOGNQStDL_B6;Vbm+~l*=k4<#Y-Oc#T4W+$SVel5^Qa z4x%oRBl9MaLzHRku?Q*UbqEPEgOCjO2a9ss13?__kR@5z$#T9xl4bMOkR_-y5YYd2 zbNE75M;UPD3Q~rdf@HWSNQziO76};|%@DGhp~L95gRC0u)z~nszbF-_fU!)>_}w68 z(x~gWf{nwpp1kJO_&>$HA9Ed=LTgpN3V+8PQIn?48}Ym zgZXSBgL<4HLsE0daLgYvSX#&YoXwETB{CQ>iVWrPiY!U(!U?(@BLg~3Bg1%oBg1m* z$bcnLmwUK4Y9KB+?;$QqpZ^{w$q0JQB*QX4$za@4vY^{lIOQ-F2h0MP1NFrv2cCBr z2SiPVv+8@+VKojleO@rb$%rw}$za@eG9Ymt2NgJWn*TVI2Qbub7jkIw4v)+#z=#q| zF`@)ZgS_MV#8fXqbt6hh&4?0CF`@)Z>qsYcLMld-V16S?DBXxsQZphO^cYbB`iv-H zLX0S3RU=A3&4?^cGa?J7Mr2X?{MU^r5ezY+gjI|v!BitkL9Y=xC~ia&R)U#C1EQ0} zsS!y?Ga?78zGt}+Ni}_5C`OcsDMplFsu3li--sj?ICg)Prn{S&&Vo^~=v@8)OD#Q^bF4$YVblkh+hHbD59LIlae5 zyw+o*+<9z{8jk~`zT;r?w&Q@*$?h>7Th8k_Hp(o=rnuu|IJe_OBn8ReSG=w`WCWCrBCPPw_$#BeNGFV#2{7lY}%x5wfF`5kJahfbit;Pwu zye0!W%_hTm-6q3wyUBpmZ(JNT92cB-92cd}e~;&61ihw{VVUb>Fm5|p(Cs^%au|;T zW`WFs`eKs<&wGypqUOU{^*!sbABUPgFPH&k#FztRFm6E^ka&=T3LHDlg&fKQ7;3i< zIW&2PN0&nZMwDQR5hYj}(X-4E=)%PqnBB`d&3&n^MF~x`yOf{ke^c#_+0>>`Uh@|oWhT3aH zQq$4l<;y0Y57`v6A)87gyu*cT(qlq4NIl5Lm<8EXTEF~kwn1hN^fLZ#xc1o$MadvE{s;W24M+Y>GQhhI1PZg&cm9 zXIaR~lfDp?r}Ji$XQrK{UxEi{*pkdzoekz zFE+>hCE+~&k{|*8lAxNuB%Il1TaeC80EbNjR^+NGNQ;!u&<*h7YgL zU!!JU15>hjwgj0+t!O}X?Nu7|25ha-4 zh!RRSqLkE($Ob(|lz=`XN|+EMN?6s15>PWDi_?tAf~gT%ls^A;BT58Aj3{9hBT6vU zh*HpNL=K7@k%X0CCeeWCBynm)64H#w!K&|BZbVW|pBIV|C1Q#ZC75bN3FtQ>Nd=Bw zpb<&s0SvX*h@_^Y!{u!`?n5@kY{;h42=8zqoAj8F4N?!XF=jzFmDVpmn{AL8kWCT) zu_2HBWI*aZF3x2>Hs|yn8}V9?jdJI)Ichu(jQWm)&D)LxQYX8|bZj}V=h!H-9Gl{f zli}QkLm`LX|cHsLJQOxy zn#JUG!-v;xFnLAV&xr|ztmyFjZE=B#RvN#lza*sUFA1plOM?0RC85&#u_>H@et$_Q zufHUa>Mtp%_>0YPe@Qrxza&V2za*&UFA1mki-jrvVzJC$EJ&T~s=p+10sfMpet$_Q z&0kW^=PwS3`io@!;YyNv0FpHG7s)98;y|@GC-oPprA`IEza&zAe@Q6KUlPviFA@qH zurPm-y5Ym?^B1Y;=x1@eZAo{?f(|Hl{bFmS@!R1qHtF#f8>IeXW6WP{Dy?6B3fmy_ z7n>sfVnZH($$->fT%5~aY|iN~HsbXc8|D6DbJSlP81)wioA(z7q)v8^zu0nKf3Z>K zFE+*fCBwP>g+dO0$+Ik6|#a|5N z_ZI`{{*r*2zgV2dUkvB-7lVZOi$PU?k&>RLtVvAs7s*n8k&rssb$>B(A^u`e#a|4i z`b)xj{Ur}^e-W$_t^^qnfCNqbMKGGb5atO5$Mk?<@hk@jjw9#kwVF@w!upn+87Dl`y#{`X% z<{UZI;30MUMoy1*udx<=RmF4DD=y6_rJ>nzO=5wnZ5TntHVoyrjcnc6gf*PsHVovo z4a2Cmk#LG_SQxhrgL!Pj5COJfNX<5+Ah!)kDYhX|W*d^xX0~b@Ml8TK4C%KG18KIA zU_RT(Gt@Q&>JLZ))MJc*nQaI}v5h>bybGyq2qkUw{kCC*{I+2r%{C0?wGF`pjZ&Cx z2-V;r_1T8db9Aq`c7DsKvqL^)1P+GVAgta(k8x}-t!(u$P zVRO_r9GJ^CEX-*e7U8uGi{!RpVI@JAZR9Cx8+kNu8+k^X*&f@l#Jsj)k<2zMh}(vZ zxov|n4%^6~EFk4TUyRAYdE3Y#)HWEYybB$+kyFw}pV@{b#B9TYxNTS%v5g!PG)kIn zI>Mx2U!eL+mD%DJ_Q5(CoO{ut425VnNL|VoI@%Ox@^&jXA|OV#seB zF{9gt;WXQjn8!9^%x4=h5n>xLsoI7R^w@@=G}{m;wGF{&Gh4TfSS-XgVp6e<7*cJ+ zU|!qEG2AxFs1lIMU_gv1!_+p)h-Mo(Qh670+bAn(qp#RTETq^*45_veV}9ExGeM&i zXd7kK;34(eMp@6%z2zHO+%+V_OhYn0&ybwQG9*SFLqg0jB$L)FKT{>f>_RfcEhOSG z3k#!Ok*8c%At|R*NWg0p668K1sgj(_CUOvUi5!_Xi5#L#V~<5hDX&9FkQszzxIb8w z+a3twaEC0(!cLa+1(GbAw}vc1oq>S1_DytK#jq^cWN5j6OFgt2ugA+;%GVb%p%lMuf2|gp8Wc7BZ;E88Rd_hYZL3A%mrL%+J{j$y_3X z5u?aZ905_P$Ui=zhOg7Y5YqV)OiagvOn*Gw`j z^OFq5EhP)OU4>H)V{yPNfH_cKTyo%fhjBpEWH_t7XB}4KP}AoHGn|YV^PCLEZ6^Z~ z=W$ShW2gC#LwNv0?RFuDChzdbtOATE!4xA(ur$a!u1`$$5>z*$gw%{E;S?iEu(XbJ zQYWNhL<#0MqJ+|oC?z!`vO$j#C7{oU5+=lm5>_>$1k{Yk;xr?&U}{7brO$ueh!VjN zBT87sh!RXSq7?KRk%Qt!Bw;0(Ni-ljNt_yygft^^u*wHb_0l#+U`!R9e6M zY_>sWKsH7E$A&!ilL4vwxHy;j*qqaQY{Y9lHp-pH=BV*FFzP!FHg7u)NS*8+)3N2e zo@1lTa%_q_PKI+E4uu?klV@4T%9Fkjl&AA%lV_;cP*i(!I-Dl2rA`IrGqx178JprR zV{^o0@=(}-X%>^$4If^&!Q>TbKPM)nufX{3x5Wh}T50^I{*sWYza*gIFA3)NmxM~| z$EI)s`u!!Ly#A6vs=uV5;x9JG{UzZ%{*oX8{*s`Yza*UEFBYcwi^Vd3u^@G_tNxP6 z1^7#X`u!!LG=E7spT9UD>MxS@hbu|y0Z7u!UnHaWiv!i(oYY^WmO2&u{*p-f{UxC^ ze@Qs6zep%-z{31R>V^-m&tIgXqo2j?wgn;UISWEoa~2$u25*PCSVelg#p0;7SQK*> z3rg#jpSu>ve8qx@tyql5Rcwx$iUV_biiJ5X#Ui|pVv*cXER6a|o}zY=NAqryXSA8^ z@e)hSYb6%RoWz2-k=U5qM;POR&(Xc*TVC8XB*RQYGCt3coX0XGMjb;!%rGRA z)+;|#CC2PRGQ=$;;xP*gqh67xTvj0|r&CD4YZMaXJ|U@+oXaM15Os+hnKy|XqD*6t zMMx>HLr9Prgk-osSd`ly2;y*uEXl%7mh%OYEStB6EJ2-tfd03e!xyqT%78OhkTT2^ zB*Q&HQp6InNXXD=hLF_^9Y(huWYuV|#)hGpz zVyOT(h(W&_#Ej+!hVr>V4xw&PCjB9&%;{mI%rZA96N($;K>yo~x(2 zh#AcdV#@0VWh7*1!rY*&89IzUHz=z)dR5$ZS{Sktu`pyMVqxe?#KJ>7j$l=dT7pF} zPq3iWtn#ze;+QK~5U~Y|@%VzxQDbmmE@!YXr!`oF*BdO7n}daw1YPcsr>H&T(Y!z8 z8Es~J9KsUwT7*S1kFX$a5;o>`3C1{VB8ReIlmmScCI{!8B8O0`V5IUcbeKg>NgI7; z7nTt73k%|gVPV8Ea!k-DX`Yc&4IWarYvlC)zxK{NK8hm!|I?GnOp?hA2#5s1jR=Z} zihziy$SuerpeBeea>yY8Glzy1S}-;E&&5-+sNE9^TKVtE--Rj>%*u+TBa7CAMv_$o8g^xEqVS(roxS z!Y7Px8$4iK+hA2p+X&3f8nCR3X&WqxZX2wLZyQ1v*EV!nMB89lRNG)hA#H<|v28;e zFrsZ}s<^hHNv&-|)5Jw~eB0o`3TYdxjA;+6E64(>7QX+csDh-8Ph_pj|4kZKzQT-qOgnp~f?~SG_%D z?;5(s)--fYRL{_L5iLWPSv!UGD|(1)=#1zltB3A)PC5`vOKwkED2 z1jj6N8_n$?IGWX~+%V#Q6JdYniEqW@cvaW%6NIjd?FKwtOgCUrbT(pnz_`!nkgr4QKBLnkc3lXi8f*&?GTo9NP_er~Pst5E4eGo3$ILabh++x*PB?(cOSG zaovDbk=;N^3fY>%x`7(A&~1$B25K~eSGBjD&aN9($nPRZX8Q>tFj`bw2uLG3LqKV5 z4gsC5KLljn9K$giP};ggKxSza0aZk=2r8}Z!YDL#jDXPCGyeu=0$N)?3CQd%B`7p^6}!sNSPWuY0W(OW>XJbo?l1jM5qZkEM&uVp zG$JXCYD7{~NF$Qk*hVCUagE5Qi)%zav9%HTRPpg2--zUZg)}0mjcG(u7TbtCVPqpR zsO*hM7snJcU0OhO(&g4hq>JJjkwF`qv-U=$j}{*nF^xzL7So8NEVdCzVRR$XRR!){ zfsIHXc{jE?vJvTH8XT_PLW}A{ewD2a`Bh$pH*_JtGNK9jh1MSAm)Tm7U**j&9L;{A ztpWK}mj2@xMYNxQ(As@WI#cuU>x{j}FNthDeyP3l_;uFCV~|<8&A-u!GKEQQhiMXDnEixkE77f%?|U;H|If04R~{vss>^cN|O>n~Cl z(_ehDnEv9^+WL!66dUZZ{Y4H}K!1_a=>8&Aas9>9MfDeh$l70YZFITPmGK2gSKIoF zu8HX{25DS!TKkJWR%|Fl_ZK--bbpbmxc(w_k^My%6}Dl8^%s5I!nZf7zvv?x{H(p* zR$IvLb7~9uZBA{W-z}*v@Vh0oU97Few*Xsb@rfcDi%)0kD?X8>t@tz%UB$1nHWh=+ z)Kh#iV@vTVB0GvtX>TY#nYEvURn~SAmWI1YSQ8i75xvAWSY#{lDQ%s^C$cvZzs%f6 zY#Kuw2}x~5DI|=lG9huehlC{77GhI|J4i@5xObmKpGl*pO{nZSYU=39uzl*3iDSpq zMQOTEn_M|~RL$5)R*|iH`0i$J9zL0+cZ4(r?NVIl2#s3smYVxUXgqszQFDoH8!WQD z=_T&QBCj+XekSn=BYq_D>EhZ3-!`Ug1mQlIv28=hBHKntV{aQu z8dH#zuz(t)#MZWRZz!_OVQ!r)Nb#!jINA{&J+wD$>Ju8xuyzKEFgo1~eIYnb%!Wt57lpy_ zirCf^^jq0`g08Z(grKC5t%++0!7&TnMsqs|j%M{LH;nk-Y}ns<;#=`JUez`H1flC< zy8#au(+yY@-3VD!`Zum zCW`3>n$p${G)YVt$94lAs(^05!su?mnz(KtR8id^B(Zh_rHn2)N*7;7l-AY_lp>}Z zgoM%QX6*)QoR|%d?gl(ebT?p4TsL4?@X z88xZ0YV6c$XHTh_=Km#x!S4H+z+ew`0D~r2{S6X-CzA9|6 z2P&{Zp;upvInLe2s%sgmkZsYbtz{JHG4=bCDK(XDZ4$pn=`y|c?6W3So;Z5<0LUsAwSsL$X7vD5Zi!$kq z%aKC+LWCl?1km%}Kq zcsU$1Roi8zSr??03$TiPYq6;!mW5r}lV$N`g)PgVwJ%GEW0u7#)3Q__+?~zRuZmfe zRcct1PitF}F0!wPS6q1b@u&vZhZ<6)Rcc*P%qHmrnpVV3i|*_G&{g=N0vE>YRFvAV zw4mI!Ujbdj0?AGEQ{`?iP+nNr0*z|>0zG-m0;SHhK;Gfq-$4I$G0Te(8&(%k+ZN}S z+1DmlU-;hf$nv^^)@Br2*XF6C*Cu7AwfSPVZubKdYeYoX#k`V`?;sh~hUEoj1%>f- zdvMr@1+owJV1e?&nC%lYHmdCl^yD!MlseM__4wVL_4%)hSzd(Lu)2WSwm84czBak~ zJ2(e*p0kv&yep$rYX!(1x zHgR2HYcq-MYm@4jwF#MNZ7OPaYiYjAVpe9?8W!dk+t%e%*_S2OU3fI|xYDbUZ{BDx zE8#hx3#`kM14l0_Vz;zd-Gi51SRLLe_DwZ1#{yczvV8M_J+`mmjq1*wDtr3hjgpOz z7QP3|;>!wKmO*P@mJr7*i&ds&sVLo@Rq0p7EXpc1tjVXfElC&ISHvscldK9vR5<#0 z0)_38PaC}=`yOc#Oux)1d{Kc5V|FS^ZP=`!+_t)a&a`DhLLS(o1I)A}9$8*j(Atb*>)JeZ^xCA%v^Fhv z$L(3(joXc07SI|N=9>@fvAqnxIE?OPd$25WSYWE*BB`ZxKx>? zO24Y0D8vQ9^&8gY8`icYU1VPouXs-~E8zO@Ht_@uJ8E4~%qHmrnpUJm@c2E;sPVgz zQ30)CQNH=W9-C44g?DsD?ZL9hr-7-4w@S;XfY!b&F>uVXSY=w4iqG9ym3~#h85O@K z->|kN=_31zc*T2?QGscOw}~fU*ipkS`Lxk1vhR@=!SrE=!WR{|FlMKs)P|)6<+jxY zbfzs667s+vEl^%q*aD4e`vN_A%mSs(v_KWJySG07bur6}5F1t(P}>&gm)X}QS6_H= z^2qYKg4SjfTi52Pqt_;7rnPCYTf1j@SGya%ETAuVXSY=w4iq+j&m3~!0QHTqI>o=^)H>_<*y2!pFUh$q}R>1Y)ZQ=3n-)5cp=#%c6H%!`~9pY@u%mX*Tzh zQ}|?grTl&<-BYuhz8R#M!`}+hjG=D?X*Tb^+E*VmbLg8unl1P(AkAd@29RzJfBPq7 z^?mb4v--dFqZ!^^bS3-du^@j z`ms}kQ*jmA_kn`9(jzlq>osLerNwOi4v=^DeE}t4 zH-4!kpb-Ts;B8yx2QKzL;%af87-qtuC&>@Nn(spbbFR<`^cTSl*V*r>{*X)XvQP!m z78Lr#b%o)mz;huD2npuik1_f4$WV z=6b6M4E0vCx|jRvZO|B9Z$s)(y$vd~dK)xZg3DBIwM)(QRuhEkt!6XSTiqI{w`P-G zZv%=@!UpWdWDIDuWDHnL_0}e__|{x+!-E9sZ9pLFZ4hhq)^GCHTiq6_x0*3jZ#A2t z-fC7VU3$F@nq<8V@Tl#x*4w}saa$ayw}Gn-+eU@l_xGo$QHaaPW~;Yk^Xi`d`c}I( zqTbTw)_O}uTfOz&H(YPYY^%3qv(#HMMbul@Y^}G-YO1$nHP%})MAlmp*z2u#xvAcI z#)9gtQrqgSrwG?u&twU%h}NVM|zPk4i?V3D;X` ziKw?BiN&{(^;R3iTyLcyP;WgPuD8NuthcVsR&U8@tG8sc*ITk$>aAxA)LY4;wlA*U z$}!@$*j#Vr)pFa^_w|C`N$y@VYSM)>@Rn@PDK$0tGw$^6M#T51d%8tv@YJ!jQ>Tm> zJ8jyOseUmR-!Ac^3Sr!MvckLP0*3YL3mu)@6+dM;HmMCGQ{VFbHi~gHpTaPL+9lZl z@tzjGG-({nCN5}PETQmmSsXnszxh_!baibZqZT$<9<`9UiWdkpS^Co4Zg`jE(KA*r zK6Ynpnsxlx%5Q~C+pmtEwenrzBNsMjpRen7&)0Rk zg^XI*WR-Ud^Z_owXENh9P1}g^h5NSPacOOF<0^l}536en^=+Y}7BW}OUG!16-S95S zqh~C}rfKZP*is%nw(?scL;KZ*j4Wpn=MWxQstqI4>*&B|X^dkUbe7ThmhNX;tRrcf z=ut3p^QO~$#3-b(jH1HFK8mJ^9wl-vDws@j3IBjWTY^6XAN>=f{LzKQhS_Q3vNP~l zz_7ZukWmYpERVW-bB+IzLCrPp=LL2DLPw>!8b_u7JDdFJ-v5rO&*FPO)n}1E-+G_U z@>zrLrTUEicT#;O-}|UOi+4ZqE~?Mydk@uT(ceM!8%%-eQv}~(^&9=~uNrK=w>=DY z@7-6QE&K+f&+L19(PyDI*W|nWHiLZgFl6_=_Y|^*-c<@I#M_1;9(>c#E|Bj%g%tF5 zUl@uv`+^4bR-fPEd!x^1^1aRHvjpDc^V#&b_`(KygD*twE;hco7rH)r6SOz>LRSV{ zi;^&Q)U>h2q?a~R+Dn_4i1ODc;)c?0NquQHCciYA(qG!V`}zxjG@D9*v>A$kXNo8T zQe!Cup4nIm{8m#j@GFAlKw7N@K?+PILD~#O!C(rM1zll^THS7oN?qeG4!Xrs9*h!8 z6w?Z|5}{vezams7yvt05LK;n_LfXv5LRt;w!e`P7hR&m$A5}E;G2%8TTsZWr11{`! zsGEew(jjf8(jjeL3I|Guv|CDtG#g8YG@43>w0ZaSmkwz*l@4h$ln&1nQ97i?QaU`d zv2^&Yrqbb81WSjsT1$r%m`aDV8A^x26eu0K!W6x_-4>a;#$P&gi=}iJC6*`-ln(t; z`xT+m;az4b9nxqj9nxkl9nxwj9X^v*I&>c8{HW5Qj}f;);nJaB9daS+iluOn#auSX z;w5jWXpq%fGRSBt7-TY+3*Y^M#e$6HQb87Dp>Pe6Wr7seBHB|_QE1wz@w<$-Jw z#evM`(m)ntVF(yPWkK4_aVf3#h?9z7L6F>94nhKBT!u=4yv(LHlmYh=a}gkuxdf2K zRshImOn=YdOMXf1E{;xod42RIn37&zDV>GQppS4EUMu)4zLfV_LMiXF22CqIMS>Q$BQk^d@L2AG$K&EL4K;s;F%)IfYewDfoC?B0>9N%4E%~!z*G{X z%}^8!ra)QH6{e`w?Y5}YHU8qDTd+1$c`!;WQ5+}{`la?OLS@3c%v30((Nrp=&0H*` z)le>cCaqxTJj(e|MMEDWZiB*wL%%xULiw|U@6+8P{iV%RI;71@;Xvt-c1!7yW@G7) zMpNmKHt)Xv(jm>J(jjez(&3pRN{7@~N{44QmJYwwR66{MVCj%nYw3^zQ|XX4L+LP> z0;NM&n4(v=+agof_)CXwv6K#@#1h4U(xG2!zamsRyvt0bLmEw`L)y%xLs|``!)MY; zht8v%A5}W^G2%8TTsritLoP&J@xQm=6%MkP%LZAzMrPUsB zQV}c&l3U9`NMMZ1P$`g?+0=$I;9g=b0%S6m0J7K$0NIS`?-_i_FR9(d(TOjwkKP1R z(#tEQvwCX(2QGig`z*ec_gO+I@3RI|-e>fuywBuId7s6*pGbM1(UNE-=QW zO!?4dHnmE5|0TYZ_nCYt@3RC_-e=QOK5U?r4^g{|jVT|xK6(?hln-5La#rB4N$J<% zLz!dfOGbEWt8T(H-$KTR8@>O^sI(s+X!ZUpt%aYyQitjRj!5q3Qcax0V3@`=Q=vm$U-!vzUqi3#=i^=Ew+S ziJ=a#A*v7r6y|U>l>)xdsy7z{Tx6{V6iqYm=`Z81M$`lGhkM1};_z>mTPlJTfiH;g zcWh1I5n{H)QWf~xpx^KcA^e`BT#GasOM^6eEn5B*5WLz}9^?S#7Y5R5ED_S^-8)bu zq}})mK^jek!m~xaPLLv7vGDBXR||f#v0(Tmp^_oZ_LmJ(VJsWcXnOHrumwwpE-?nP zF0jU`E(#P7-DE2vMvX1FgJnd&IO3XcDe*2e787YTmJ?~T6clN83rC=&_-uMn(G8J1 z5m{LDQDV2tP+auugWijpaoey%Z0Y7b&on7il+_7il$?7iskF9Vjo- zZY(d-XeuwBEvmdok*&OVc5`|0n~mkgFA0?wX||UasW6roX*87=gDqHIbcr#jb%8Zr zby1+a=q6ivF=}kV9V{>U#Szzp%ZqoRvAjsDvAjs5rMyV9sl51XdU??ekvkDtUi497 zx64po^y|akMDek_k#Q)QETx4^UUG*E3z_X@g{-!sLN-fD@!d02P{?X2CuA}g6W0=5 zN=RZaB(Bv~MwHP~M3lf#LdY0ZK*(+>A7nBYkANjyI;6l7uF@P4hf)$M8q#1d86kx^ zT*Ku;UTD>uN`-rorBIN~QYOe`EfQojmk7_|FAx$(_&cUJ$Pr?;#8?>QwbE~i|2zKA z1OLB0u=k3IiDa+DbzLXK0k&9gc0_edl< zh;cNYnAJ9s*h`F~^J6|vB#PSCP8~Zgan<}gFis;L>-YwVL~#l8|Mmjgn|ZIMiG)+1 z`MND&jhPQx4gDJCzg`Wt5A)t_a2DgQIvvlOFhAw0L?UxB>o0m3tb+L&Y0RgQ%dhU* z0u1-Vk(z<~{Ndxtb+zOl$7SwA`2y(Mflu>ur#1dvAN*`TZ}DX!k$i1(-J~gg-hV0n zT{*dKT44MqZ@@4wOs*RbuKTU%PUzcCo>E8StE1k8*Aj_z?cf2^>JnG?`W}W>Y)rSr zecMj1od&%=j?)?T*4WjB~}E=KE=Ju6Uw61wH#G zRk8uktMMO>@+Np-{}eq>z8OXooN|!&rRcw};Q47pfoLDtKSl30$MfMt6N&yWc>XEc zO0h;c4|F;1CH#{rdjn*I%M+WCN5VfvN0WY(%botno#J_}Kj%LAPh3m$!)eGIuP)8K zs6K$G8?`&|oYyt?j(71Ke#epQhCHeFp*zl%zkCY5ugep~w7;Er{BgzL&0OwOp)QqP z#`@3ufz#S>JT@Et7vnE^865t_;S?j^#XPUvd>??wuRH40JX_OzM1Ebe9M8o#e@5=O zbqe#G55LKIZeI^B@~dxZLFi)}X z&huID1vGu6BE_M|i+ksTU+>~Xf4VR4yK_TJaLkpCL9_87^5PN1iE|^-L~`)0crNl{ zT6;XdiTM!huh@6zKgccT7MCZ=$bT~aF&}Z1{1bEb>b&C4AHKx8WSv($;b6{Q{44Gp zfN{J!uXv(-D)jQceN<47)l0MFU~$?YfO z`LE1Ztip4yOGUkCzkX+)>*3{H@@CY|B=^+hCX6ZT=e=KmH)8#!#W;(3evUDc{CXg{ z>0WR#&ud- z#7MFWkMqtpHP6>Ewx9!X? zz?zbMSl^)%XEDwvSAd_ueCBgF^Eio}r~ygTRvgY$tV51-{kh;Lx;)Xb3TH9So2P@H z#C#FrM9$}?3h*H=&o^!Ajg$Blb59OseaAYS#W-VUfFn2PSavZU#JVPI20zus`4(w! z9B08};4}}Me%R#2;j#5@1sLn{#4`9(jC0I;i239>E-&hc`-^oQJ8&`hB<9C<_2OZ3 z>xST1GmfI}uX*vXxr)Y_>heSp2S`kb3CL*y{Y`r z{dRDUhg4tWuh_@b1OEi)cu1Xdisy%-FX_I#zs@DNukb^vM>Y6Nnr0$(?nLE>XBvQ` z<`REk5uWqwv{X;Lb}PP_`Ks1<&VERp4__9;FLbP@d=Y+Fbs9Ko0ghC6RiE9t6=PiD z|7fTD(D_5?(M#y~c0L|NJggl9j-13%+;o!XhoY}v2SCgbKVXOQ!)=I>;>FAlf`7#8 z&r}bZ=N&G0F2^|157&PTeh=#pZL0jx{cP}inIDaKmwvb+i|5ZV@A@{L3qRcXFFb$V z<<964IE%d4@H062B92u5%e;6f`UpNR#-8CQ?uoUFK9x#!1VEnPNDijF5%Dng2=EtO zUVQT7o*z(7JVWM1Tc z0Y`4*C_aCi^22G5g12#ba;A!h)Ph&Ru?Es#0YAz5a1o8)mic`6P5R*|Xj9y;i?7Gr zWIU|>0=%88FM9eroY@blduUyqc${0NdVWZ?y9pe%14r@agYY2y(DH6@t~15kv5(RZ zw^o7=cJ;|0p2J!A;a`6QAL8=jZ$D9f==yhX_#H>_cZeAo4<*>^)X6R{I*sBznq zz)x{`IthPDKMcPM9I=igT|P|tVZwXhT;J055dYE-^s`zDxr!sz?M^%jKRk;uQfIn6 zz4sjDhenuNY9#ZM;Wz1rUgN;0Ge2#%^1~JIRq8^Qr+T!&S@>Zd`C$g@N6b}zn6@1J zBIak_s{GJl9r(p!oNhP^KXk{QrY>Rq6x?6>A^SKu#UGYB{Ws-@Gf>-8vzT98U-@C& z?ci7^j#U39cocrP>l*;f4@Y_q;$7rL>dp(m|IGZV2Fed*h@BMIne<cP~_a zxEW)lxW1+DZ>Ie40(_jp{cxloLLSI?=rI-?v4|seA;pWR58q?$sRv!2e!P$JLp|Ex zhg_aXV}E5l^g#_MMvmdgWFJs|Xg(FszjS%(!qqs7c=*fN;Qw)Xratyg`r#qWrFc8@ zyo<4y2 z1&B}ShqImlKZg0#Rmu-Vq{kX?WLiFjN8yKVG*8@v_$33BAI|Lw-j(^)mC6s9f#An8 zpE?_7;fG7nN7CJx&m5`z@EZ0c-JSWBpLl*qy|oFv2lGY0;dx{C=b+Ru)TMN9=6BG3 zioEz8zEAfT9DbAWFyJt7%o|7MZ}7A9!>@zE&tksvXXS@c)!>K~(mz6v!VfRc1s_KM zd_U!fpO91O@ys7>ulz8*1bhPX7xOp^KP*Hnr;%egGA~V6ez*cTn#TNyzk&72yf_lE zlRk&}zv|<;@WaA)@Vtiki<58`b@IkCaO4Ay%=-u8VLSURyB7RB=39UF{7}4a2K-v) zUtFX7Fz+_-dCWI=!CCm>Xv&Mf2tG{t;Ud)S^nB*u!B4Vp4*4tibk@*_&Ed4NSF*yE>qa=yAkbby~;`wHmXSQnf;oBkLSOe)Bq&z*cF{BRXwJWY9sagN{a`JuS=MDVAXBLzJ_ zbeo0e&jCPx_)5Uc5rn4dOR`Qdi#Rr+J* z{g7+Y4;$VG$7@_1B|~rW{7{@;4Zel>n6}Cf2VD-nm3hC*aOQX@ZccUb6Xtc-C_fCq z^Yo|8M##!*_+&htZhZ^TIE3g%NVf0-A%CV|7(I7(Je$0Pe8J--n+`4{8Ns`UJjzWz?| zKQo`Z)bm5}2UvUND&|)|?)f22KbvQ`zLl(A3A@OP&))#&I#YTb`HKCJ9`X>LbDb%@ z1^FuaMe$GXfn&`$N^kG0{IC@0q3N9~O-Ur~5&_6n+-*knVt3&fL%Z?m3RsfFo~ll>Sog`5}EEe4gR@R=TSNtRfyhrulH4Dcv;>&qX|pza7u9$2iI| zGrV|6cS25QerKM;y+nOTZ^RyDb}?^IA7>E{haHaqcQJk)dYJMXQ`U93=ZE4QqreYhea~&m57)E>Z_T{#4xEJ_HXz1J zu*W#c`r$q@FAhEgybbdcu`kjOjnOMgU?cr$B@hw?+iqrvZDPQMS8 zeptEzoQf{=TL)==pm@8R`EP@jANKwRe3{TU!CCm>(e>bnIUHqQ|E&CQ3UTZQ@t@&W zSsz+s?2^B^JX_vY`C$ZVObOzH^uNx>qwvEBu5F3&dTq5Sapli&|CZ;Ch(eKY;f z*5I!){{w1^jECFCgTLnTvR{A0S>(mP&HzVl0E%;BUCR z>^H=r^uvWzH{Nu4_Q*$+A9{TW4qxEN9^YB{;i@0O-(uclfbzov+IQ}E*}m9c>4$S4 z0O!7w?TdNIyx2)GH3F<(XFab9F5W38o!3O-Ny;ifL& zhcSOD>%jzeKV6lzLfT3z83o;{E#WW z6C7jV$ZjORvL7-Pbl?7hpMvM?hs=EUgl}#`8m_{aA4BJJ}zGD?dDcHux0Q@7(73A^jlsuC$i0g<5#=gkB*!&l8T!W+h zgiUx9d9eVoQ+gZo{x{&ch=)$!;rU|beH(dx$V@sI{C4K2c2a)0_8Raz#W<~T7JjI? z8T?-6rz5^Zoy^QA2mc%MF`Yd>q~EUq$7=-~`j?r{ov!>a z6*Z<5`$YPyv36M>_NDo}%KSR=hw#IN@NwyS<_i$F(hsK%14nG(D8FT==ZDOZ7`qg` ziumnwl^^Im!cxqM_|o}!6!CB&&40V#E0rIvMJ|?p#r$sgPx@gv?IYp_NBN_)&%zJ0 zDbBwU{B1lJepvPfo+FoVls}6(%R2c8#SCf+@zs-*AC5q*mcoz3*UZ7As1Fad0>?UC zj{8eLtoR4`ugu@vsQfVTRJ;Ib$o$<2o*&ZNQBTSmG5-L2E$hQO$ARxH_&nu@zqbKz z%=|;_i}XY7KydU<9Oc_*;!)(qzgK}%oDqKna})L9Ma;bnF-rW$&YmAK*Zm8;Df3?j zcz#Gfy#*XKg7mva<5BqGG0dTi`%d|;b;=Lv$>7{~a+xQUAIdO?vSZzGa=E_B4{JMu zW6d~n4F=;;#6yQU;9Ui;@%)f}=>hQLnKy(+`e6ooY*{zv2aLd3#KQyFqq6RT-{AQn z(*Qm%>%sg`_({Y=hCVw~){}X=ww@m{ImAdA_q$vtx=!T9Sj1r&{DmXeX{GYRm5BW^ z><#g*ia!*GiK$5?++iSon9Qt-!_&#sTN@WZ1NpHB#WmhuC= zcU^`!!;!mmy7I$Q%fOM7#AhFdN8yK8;j^-*m|u5_^25RJf^=t9Dc-++ttYPL*{G5X11Qo^Cb(FAI9|qug^TYT=`+vgWz1}^Lwp^ zo&8Xf$K0|Ntf%+Qq#x$}54@?%6YDTeqP6>buIx4NWfpV7;f(I2_);4GAeU#Z`dRVy z?|`>`@l$#F2Svu;R;+YuUq@Z*HLYe+GcJW4`51#V6hjeuUs_74L&J zW!npm+!XgMuR#6Dc3{5s3Xf<1at%1*8%JjAO2w~%FSADqj@*~?KM#A7CBH-eEiG8A zYke#5qXfsE%KK)J@7d1GziaIAY!}qwEMgHy=DV(ne{wxI;vPpy$uPzLSqXj&Vf@L5|aj_KV_-^fii)M($>N zGe7x0#k-+TW$Ak8Pku}BcTf|uComtiRPol>t88DvUsL?JpTPSG{=MS2o&|m)^U)tF zKKc>x{>;au6rV!#M2zAnnO5iV@}eE!0|md;3E|6<x(p904<#9waX@fA zQSbrG-$sq)*Imgbzpn-7`j&tHP1xPnUCE01=pp5USpWXl@^x3Tq7`aqIoG%R2c932 z6&KWkBi3=`KY}0lb!oEVj<3MsQ{rD!T)3}GlTEf_Ps@ig|E8IIJ(jF!j9OmK^)3JN z68U;8SQnZSL6r3kCAM$8u46S?T%B=!CLtBShAu6a;5xC=Jb6Uem$0KvJ*9? zd?fQS_?h3=N>(gb1U`d#y$3x1R8-<#6KvzYelV!_|_{L^IPEO4%4_4fW! z?n|;_z-8bwSzqy;@=xXra9o3<-ofke$o{FgaRm5m!ijoqQp!Ki^#H$=d55{mKM$tC z=P>VdtLLAJqBh`{Ge7nroZZ)}$%=tLf}@wT^S2BKD z+zGyd`9)+G{^|Dx_)6xRM|%Eg^2-=-uB-LF{6zU@Y7IE{6-T|Vepdcj&;k5m=HKUW z7XDd=*C6Hp5FBwK;-_N&+rgh={u^>%_^0V!--9C#aMXA3T;x~9I}d_$U9F$~4OZcw zYw#MXd;{wv7bl-vdkkeEA0WM&^|F(mx+91pk0}vj#W||I|zd|4{J0 zo_{LVy$t?u=B-de`2CP%#k{k@H!*MhvGULHh>dct^Ysry%n1K9rOz~#V-IlDKYXPvGl}GLu=DrXoq0>ZN8;Z& ziqOZL0X$Bta_~{ileC}1nLqs^IL4x*s3RWu`}I!EI&j1^9pk#fKL@hDH|ksNEaoNi zao*taWFGsT8_T?i{4K^=k^{%u=qQ?w2f2%Df2mS>{(2?v9{p^Da1xaSq)KeiifmY2O9^ko<5p^U~Qki|^O3zaAX1NJlAM zC-Q4Gaw~VOixchI;4Jd1eN%Awg^nW@;eqqZX?qMfY99`VexBn#m2e(!3{G_cM@RCH z$gf+_>vGq**g5J+m0!!?n;dj>9Q`5mBEPPu`CzU%oUWLsjFShqgWurt#B_`!^2^yc z1N=tj`|rS6_~G2y;5RXE-w9`tU)AfuZx$STA@i$W5_}=^=5!MC|AgZ97Uu0~KSexT zh8me$#JmjGN`LmFdh%E19lGMo`ISsy&beD%?lkP9^6P@;bgS29WayV&JL zZ*}wX%Q^2CaJ(kK;p_vS%l>sQ>6b8n^&#cArIp}_Q5?m0j8OTtbQw7E97po7&MLpY zf{$}|x!jqAlk8tR4gz1weEmyaekJ#91b(;66U75@7Jcg27T~xC9h2u^vVxy*GWb2r zkD!zAXKSoAcQ5lAj4$)++tuKIV}1;BHZhv>>wJpm`xfNoZW7RnHvtw>0^Y(~O8CO4{7Uu3}-kkcO$ghRa<{l8d z24|69RbPTX$hAMlRM_it`cmn(* z;`5JJfFtKgKNa;!_AmN9NNyGD={*6NUk9!Oe~k6?`&^k{`!4}UU8ds^=w<)PCc&Rz z-VyO8{Y;;Y%^{}g=!p1{`PCM4%l*T}iB5fR7X9m4>|GAm(9vl+9>n~Q8xH=oixbC? z-$XpLdl&o}!RO*E{CUG$;LkEYhx{-4*XtjEKj(61MoX1n)!6IY^Q>=9{uljg?NV^W z7LKAu*dzJ+aQI~Kf4V&Rhh8ebx}6680`r!qD8C(Y9QcbaPe0dQ>07`lZg9+?d=dOZ%q90K z^Y%+{7XDmu75Hn+H(|Xpzy620FDqw9>h3_960up4tgI?=GUi3g8$3Ki53)ZBEROg z1Am)&JH)Mwhrjm(e~0-h+F#MX29n* zi2dBZnRmgyNI!JkAAA$@V{X7%^siPIfMX4GOhRtT{2G2Y_{T)y=il)l@~ejUW)~+q zwZ&P)L(O;Kh#@+Tc?b_8zdG*%M=a8D(ONu+{ObNk@K0QvY%@XS*PkfAK6QDbc~hL_ z-?!<(43DKnn5Xx5brg3F`3&R8zpJA-e_mMrT`9$#!x0bO-_=o^KZon)wNth8I?M;- z;wbv27Ju5UBgL~*wXF{PbC)Mtt&(}|R6W!le4EQtxBMvg%c)v)Klm3euXoWFnb%I$ z7OXKx`-DtfQYQ1-sakw6IC=&S=LqPzZ#va|5KFo3E>GQin9OUZx+!XQ?kkrkO5jh< zYp3e#`@p|u-p0#or~16(!M_oD#3b*dQ{9~MXot(4BawG7`oSDJi2|;srn5)D))oS6Nk|H zc$}(N5vw`)k&c15m*k%u1^$zZ6D3#R?B=yoJ>`1vpP6@>kFy(xPSx8df&b!i=S1W< z=e1LP*rnh*S-;~moZY;3s$L-f{Oa-sUzE$dcB*cF1{~|b;Y_K-gPRvl^+A2X|L5`s zJ8*yQn@-hjW5FqZAg%3;2lsWUQ}r`^nL}>iNFR5;7bn$yF2@^WH(L|J+94 z#mpBW#$-IqLyYIs%#Xp^g+HtRgq+T2T<#QC;_T+NQ+?*&z)M`7tXL!S+Nq|`SmjGy zo>+7i&N8oQFZd{JfjIa6UYz2|YujQR`S;=!PxK#v3uRs_o;+@zme-0W+LB{MUcXs} z`QSesr9Ch=nb)6g0?)cU*>IT3>#xw$@`wW*=@XH&T!)>iRkOj7GdT7-yvob#>J;`U zPxr%HUA=K1{&~}>+Hf{_J(njhJVoX8i0(^>XAy5FT?@XC%ZpxzANc(or@B94fj;Yr!+GyrJaS%FpSl&i!sUt0 zn5P`4AI8YzdO9|vu1ekvy(_=3ixUG8|1z&ftp#t!e9>T>MP9F158mA6$?_gJyZzd! zZb0*gA8{m`Ou!@Ob#-sl$^0K&UT@%GUS3x>qJ61!dGeS!ScJ$6`kOiV{aJr1?YsLv zhEqN5kKip>|L79vIj^fb-U@yI>rY2qi8!h5h#1JXba~Mch-dEC$Wz*{RxWp%&BR&M zy$?_)^Ryp09zz_;yk31Y_(3jqjv9)y$m@Ay!CMP{8O}Was(-`x`GcAFJ|Aa}hpHc* z1#jc>#JWW|vp=ipZvf^Gae1;Lg)`@M)n~VWW8OF#{G{deMVEjd>hgp$5@(s$y_n%~ zuk-q7{aW#Qqu)gQ%YLo6(`*T@l6kFoy>Y-^zg9eP_=zxZURU?J6Z65o;@Im(_)p|@ zb<+jlhr2x8^C~Z|tLu7$w{v;DDQBtux(an8e}v2TS~*`d*;*=MP66W`VqW? z%Tx6I649@#zPK5@BaeR`@<`-$)ni|PAL;T$!`V1<{#I9i0^Z5x$>s|YSAtJ|1^g(N zJH6-QEcWq{-@!Y(Je7R`dXd+wv8Q>&3J$0DeRv$fd3`u)RlW=J{#3U_y#2fc9JK() zUcX_DBCo5y9|?Y}%ag}aoN!)OtzQOyoXeg5XR==sqQQ@&g*D&beJUu(P@=Iixq#hpF};wqWfiZ|#vTgz+3 z6N}(O*{`2ojrk14zj5C_7+>afNfP{I=1q}j{Qi|w^*r`E51*3$%-L$c24jr;sm#YB zPWb&{r@9ut%2zS}`(-MxXEy?`c6oX*>Wa+kcadB9VXS}nUW_mL^{EsOr@1`Qq7rA3 zzjtAe@~{!PAM=-aeLBX>pYC$!DB2gXk7pv+^0a;|sR=Y9ud5eQ{G<2aa4!8AkM7Uc zPW1!3z(){HI2%^tk>joU&~L%dba{g(9{2LPdRQy)kuEQ;n1Qp%>(BQFALVjq!<#sZ zaZaH7ju!ko#f#^IBUkBojQWds9X^oegLtCj+c|jPysmopPVliVPOhSPihliP)WZBY zm#6z;?J}=hW3Bn|E^qM6CNHn6cGiMVaCzxy@{j0u@1ut0&u0BgYq2jPp5NUGK9TwB z7+<~)fAk!1{D-5#I@(9~_jFG64F`iyV*d71Dz96;2R_;5&ijZB>7VoKgV(q`nJdRx zde+QrHa;NwioJF0y lI1f(s1yk=weS`aT^?l!i*SWmGyKB6>uD%gt ]> Carbon Debug UserSourceTrees AlwaysSearchUserPathsfalse InterpretDOSAndUnixPathsfalse RequireFrameworkStyleIncludesfalse SourceRelativeIncludesfalse UserSearchPaths SearchPath Path../../core PathFormatUnix PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path../../MMgc PathFormatUnix PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path: PathFormatMacOS PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path::: PathFormatMacOS PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path::::::vendors:CarbonLib_1.6GM_SDK: PathFormatMacOS PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path../../pcre PathFormatUnix PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SystemSearchPaths SearchPath Path::::::vendors:CarbonLib_1.6GM_SDK: PathFormatMacOS PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path:MSL:MSL_C:MSL_Common:Include: PathFormatMacOS PathRootCodeWarrior Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path:MacOS Support:MacHeaders: PathFormatMacOS PathRootCodeWarrior Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path:MacOS Support: PathFormatMacOS PathRootCodeWarrior Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path:MSL: PathFormatMacOS PathRootCodeWarrior Recursivetrue FrameworkPathfalse HostFlagsAll MWRuntimeSettings_WorkingDirectory MWRuntimeSettings_CommandLine MWRuntimeSettings_HostApplication Path PathFormatGeneric PathRootAbsolute MWRuntimeSettings_EnvVars LinkerMacOS PPC Linker PreLinker PostLinker TargetnameCarbon Debug OutputDirectory Path: PathFormatMacOS PathRootProject SaveEntriesUsingRelativePathsfalse FileMappings FileTypeAPPL FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeAppl FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeMMLB FileExtension CompilerLib Import PPC EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMPLF FileExtension CompilerLib Import PPC EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMWCD FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeRSRC FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeTEXT FileExtension.arr Compiler EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.bh CompilerBalloon Help EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.c CompilerMW C/C++ PPC EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.c++ CompilerMW C/C++ PPC EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cc CompilerMW C/C++ PPC EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cp CompilerMW C/C++ PPC EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cpp CompilerMW C/C++ PPC EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.exp Compiler EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.h CompilerMW C/C++ PPC EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileTypeTEXT FileExtension.pch CompilerMW C/C++ PPC EditLanguageC/C++ Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pch++ CompilerMW C/C++ PPC EditLanguageC/C++ Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.r CompilerRez EditLanguageRez Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.s CompilerPPCAsm EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeXCOF FileExtension CompilerXCOFF Import PPC EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypedocu FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypersrc FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeshlb FileExtension CompilerPEF Import PPC EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypestub FileExtension CompilerPEF Import PPC EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileExtension.doc Compiler EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue FileExtension.o CompilerXCOFF Import PPC EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileExtension.ppob Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileExtension.rsrc Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse CacheModDatestrue DumpBrowserInfofalse CacheSubprojectstrue UseThirdPartyDebuggerfalse BrowserGenerator1 DebuggerAppPath Path PathFormatGeneric PathRootAbsolute DebuggerCmdLineArgs DebuggerWorkingDir Path PathFormatGeneric PathRootAbsolute CodeCompletionPrefixFileNameMacHeaders.c CodeCompletionMacroFileNameMacOS_Carbon_C++_Macros.h ConsoleEncoding0 LogSystemMessagesfalse AutoTargetDLLsPopUp0 StopAtWatchpointstrue PauseWhileRunningfalse PauseInterval5 PauseUIFlags0 AltExePath Path PathFormatGeneric PathRootAbsolute StopAtTempBPOnLaunchtrue CacheSymbolicstrue TempBPFunctionNamemain TempBPType0 Enabledfalse ConnectionName DownloadPath LaunchRemoteAppfalse RemoteAppPath CoreID0 JTAGClockSpeed8000 IsMultiCorefalse OSDownloadfalse UseGlobalOSDownloadfalse OSDownloadConnectionName OSDownloadPath AltDownloadfalse AltDownloadConnectionName OtherExecutables AnalyzerConnectionName CustomColor1 Red0 Green32767 Blue0 CustomColor2 Red0 Green32767 Blue0 CustomColor3 Red0 Green32767 Blue0 CustomColor4 Red0 Green32767 Blue0 MWFrontEnd_C_cplusplus0 MWFrontEnd_C_checkprotos0 MWFrontEnd_C_arm0 MWFrontEnd_C_trigraphs0 MWFrontEnd_C_onlystdkeywords0 MWFrontEnd_C_enumsalwaysint1 MWFrontEnd_C_ansistrict0 MWFrontEnd_C_wchar_type1 MWFrontEnd_C_enableexceptions0 MWFrontEnd_C_dontreusestrings0 MWFrontEnd_C_poolstrings0 MWFrontEnd_C_dontinline1 MWFrontEnd_C_useRTTI0 MWFrontEnd_C_unsignedchars0 MWFrontEnd_C_autoinline0 MWFrontEnd_C_booltruefalse1 MWFrontEnd_C_inlinelevel0 MWFrontEnd_C_ecplusplus0 MWFrontEnd_C_defer_codegen0 MWFrontEnd_C_templateparser0 MWFrontEnd_C_c990 MWFrontEnd_C_bottomupinline1 MWFrontEnd_C_gcc_extensions0 MWFrontEnd_C_instance_manager0 C_CPP_Preprocessor_EmitFiletrue C_CPP_Preprocessor_EmitLinefalse C_CPP_Preprocessor_EmitFullPathfalse C_CPP_Preprocessor_KeepCommentsfalse C_CPP_Preprocessor_PCHUsesPrefixTextfalse C_CPP_Preprocessor_EmitPragmastrue C_CPP_Preprocessor_KeepWhiteSpacefalse C_CPP_Preprocessor_MultiByteEncodingencAutoDetectMultibyte C_CPP_Preprocessor_PrefixText#if !__option(precompile) #include "macprefix_debug.mch++" #endif MWWarning_C_warn_illpragma1 MWWarning_C_warn_emptydecl1 MWWarning_C_warn_possunwant1 MWWarning_C_warn_unusedvar1 MWWarning_C_warn_unusedarg0 MWWarning_C_warn_extracomma0 MWWarning_C_pedantic1 MWWarning_C_warningerrors0 MWWarning_C_warn_hidevirtual0 MWWarning_C_warn_implicitconv0 MWWarning_C_warn_notinlined0 MWWarning_C_warn_structclass1 MWWarning_C_warn_missingreturn0 MWWarning_C_warn_no_side_effect0 MWWarning_C_warn_resultnotused0 MWWarning_C_warn_padding0 MWWarning_C_warn_impl_i2f_conv0 MWWarning_C_warn_impl_f2i_conv0 MWWarning_C_warn_impl_s2u_conv0 MWWarning_C_warn_illtokenpasting0 MWWarning_C_warn_filenamecaps0 MWWarning_C_warn_filenamecapssystem0 MWWarning_C_warn_undefmacro0 MWWarning_C_warn_ptrintconv1 MWMerge_MacOS_projectTypeApplication MWMerge_MacOS_outputNameMerge Out MWMerge_MacOS_outputCreator???? MWMerge_MacOS_outputTypeAPPL MWMerge_MacOS_suppressWarning0 MWMerge_MacOS_copyFragments1 MWMerge_MacOS_copyResources1 MWMerge_MacOS_flattenResource0 MWMerge_MacOS_flatFileNamea.rsrc MWMerge_MacOS_flatFileOutputPath Path: PathFormatMacOS PathRootProject MWMerge_MacOS_skipResources DLGX ckid Proj WSPC FileLockedfalse ResourcesMapIsReadOnlyfalse PrinterDriverIsMultiFinderCompatiblefalse Invisiblefalse HasBundlefalse NameLockedfalse Stationeryfalse HasCustomIconfalse Sharedfalse HasBeenInitedfalse Label0 Comments HasCustomBadgefalse HasRoutingInfofalse MWCodeGen_PPC_structalignmentPPC_mw MWCodeGen_PPC_tracebacktablesInline MWCodeGen_PPC_processorGeneric MWCodeGen_PPC_function_align4 MWCodeGen_PPC_tocdata1 MWCodeGen_PPC_largetoc0 MWCodeGen_PPC_profiler0 MWCodeGen_PPC_vectortocdata1 MWCodeGen_PPC_poolconst0 MWCodeGen_PPC_peephole0 MWCodeGen_PPC_readonlystrings0 MWCodeGen_PPC_linkerpoolsstrings0 MWCodeGen_PPC_volatileasm0 MWCodeGen_PPC_schedule0 MWCodeGen_PPC_altivec1 MWCodeGen_PPC_altivec_move_block0 MWCodeGen_PPC_strictIEEEfp0 MWCodeGen_PPC_fpcontract1 MWCodeGen_PPC_genfsel0 MWCodeGen_PPC_orderedfpcmp0 MWCodeGen_MachO_structalignmentPPC_mw MWCodeGen_MachO_profiler_enumOff MWCodeGen_MachO_processorGeneric MWCodeGen_MachO_function_align4 MWCodeGen_MachO_common0 MWCodeGen_MachO_boolisint0 MWCodeGen_MachO_peephole1 MWCodeGen_MachO_readonlystrings0 MWCodeGen_MachO_linkerpoolsstrings1 MWCodeGen_MachO_volatileasm0 MWCodeGen_MachO_schedule0 MWCodeGen_MachO_altivec0 MWCodeGen_MachO_vecmove0 MWCodeGen_MachO_fp_ieee_strict0 MWCodeGen_MachO_fpcontract1 MWCodeGen_MachO_genfsel0 MWCodeGen_MachO_fp_cmps_ordered0 MWDisassembler_PPC_showcode1 MWDisassembler_PPC_extended1 MWDisassembler_PPC_mix0 MWDisassembler_PPC_nohex0 MWDisassembler_PPC_showdata1 MWDisassembler_PPC_showexceptions1 MWDisassembler_PPC_showsym1 MWDisassembler_PPC_shownames1 GlobalOptimizer_PPC_optimizationlevelLevel0 GlobalOptimizer_PPC_optforSize MWLinker_PPC_linksym1 MWLinker_PPC_symfullpath1 MWLinker_PPC_linkmap1 MWLinker_PPC_nolinkwarnings0 MWLinker_PPC_dontdeadstripinitcode0 MWLinker_PPC_permitmultdefs0 MWLinker_PPC_linkmodeFast MWLinker_PPC_code_foldingNone MWLinker_PPC_initname MWLinker_PPC_mainname__start MWLinker_PPC_termname MWLinker_MacOSX_linksym0 MWLinker_MacOSX_symfullpath0 MWLinker_MacOSX_nolinkwarnings0 MWLinker_MacOSX_linkmap0 MWLinker_MacOSX_dontdeadstripinitcode0 MWLinker_MacOSX_permitmultdefs1 MWLinker_MacOSX_use_objectivec_semantics0 MWLinker_MacOSX_strip_debug_symbols0 MWLinker_MacOSX_prebind_all_twolevel_modules0 MWLinker_MacOSX_data_before_text_segment0 MWLinker_MacOSX_report_msl_overloads0 MWLinker_MacOSX_objects_follow_linkorder0 MWLinker_MacOSX_linkmodeFast MWLinker_MacOSX_exportsReferencedGlobals MWLinker_MacOSX_sortcodeNone MWLinker_MacOSX_mainnamestart MWLinker_MacOSX_initname MWLinker_MacOSX_code_foldingNone MWLinker_MacOSX_stabsgenNone MWProject_MacOSX_typeExecutable MWProject_MacOSX_outfileFlash Carbon Debug Player MWProject_MacOSX_filecreatorSWF2 MWProject_MacOSX_filetypeAPPL MWProject_MacOSX_vmaddress4096 MWProject_MacOSX_usedefaultvmaddr1 MWProject_MacOSX_flatrsrc0 MWProject_MacOSX_flatrsrcfilename MWProject_MacOSX_flatrsrcoutputdir Path: PathFormatMacOS PathRootProject MWProject_MacOSX_installpath./ MWProject_MacOSX_dont_prebind0 MWProject_MacOSX_flat_namespace0 MWProject_MacOSX_frameworkversionA MWProject_MacOSX_currentversion0 MWProject_MacOSX_flat_oldimpversion0 MWProject_MacOSX_AddrMode0 MWPEF_exportsNone MWPEF_libfolder0 MWPEF_sortcodeNone MWPEF_expandbss0 MWPEF_sharedata0 MWPEF_olddefversion0 MWPEF_oldimpversion0 MWPEF_currentversion0 MWPEF_fragmentname MWPEF_collapsereloads0 MWProject_PPC_typeLibrary MWProject_PPC_outfileavmplus_carbon_debug.lib MWProject_PPC_filecreator???? MWProject_PPC_filetype???? MWProject_PPC_size0 MWProject_PPC_minsize0 MWProject_PPC_stacksize0 MWProject_PPC_flags0 MWProject_PPC_symfilename MWProject_PPC_rsrcname MWProject_PPC_rsrcheaderNative MWProject_PPC_rsrctype???? MWProject_PPC_rsrcid0 MWProject_PPC_rsrcflags0 MWProject_PPC_rsrcstore0 MWProject_PPC_rsrcmerge0 MWProject_PPC_flatrsrc0 MWProject_PPC_flatrsrcoutputdir Path: PathFormatMacOS PathRootProject MWProject_PPC_flatrsrcfilename MWAssembler_PPC_auxheader0 MWAssembler_PPC_symmodeMac MWAssembler_PPC_dialectPPC MWAssembler_PPC_prefixfile MWAssembler_PPC_typecheck0 MWAssembler_PPC_warnings0 MWAssembler_PPC_casesensitive0 PList_OutputTypeFile PList_OutputEncodingUTF-8 PList_PListVersion0.9 PList_Prefix PList_FileFilenameInfo.plist PList_FileDirectory Path: PathFormatMacOS PathRootProject PList_ResourceTypeplst PList_ResourceID0 PList_ResourceName MWRez_Language_maxwidth80 MWRez_Language_scriptRoman MWRez_Language_alignmentAlign1 MWRez_Language_filtermodeFilterSkip MWRez_Language_suppresswarnings0 MWRez_Language_escapecontrolchars1 MWRez_Language_prefixnameStandaloneRezDebug.h MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' MWWinRC_prefixname MWCodeGen_X86_processorGeneric MWCodeGen_X86_alignmentbytes8 MWCodeGen_X86_exceptionsZeroOverhead MWCodeGen_X86_name_manglingMWWin32 MWCodeGen_X86_use_extinst0 MWCodeGen_X86_extinst_mmx0 MWCodeGen_X86_extinst_3dnow0 MWCodeGen_X86_use_mmx_3dnow_convention0 MWCodeGen_X86_extinst_cmov0 MWCodeGen_X86_extinst_sse0 MWCodeGen_X86_extinst_sse20 MWCodeGen_X86_intrinsics0 MWCodeGen_X86_optimizeasm0 MWCodeGen_X86_disableopts0 MWCodeGen_X86_profile0 MWLinker_X86_runtimeCustom MWCodeGen_X86_readonlystrings0 MWCodeGen_X86_vectorize0 MWCodeGen_X86_relaxieee0 MWLinker_X86_subsysmajorid4 MWLinker_X86_subsysminorid0 MWCOFF_X86_opsysmajorid4 MWCOFF_X86_opsysminorid0 MWLinker_X86_usrmajorid0 MWLinker_X86_usrminorid0 MWProject_X86_maxstacksize1024 MWProject_X86_minstacksize4 MWProject_X86_size1024 MWProject_X86_minsize4 MWCOFF_X86_coff_flags0 MWCOFF_X86_dll_flags0 MWProject_X86_baseaddress4194304 MWCOFF_X86_filealign512 MWCOFF_X86_sectionalign4096 PDisasmX86_showHeaderstrue PDisasmX86_showSectHeaderstrue PDisasmX86_showSymTabtrue PDisasmX86_showCodetrue PDisasmX86_showDatatrue PDisasmX86_showDebugfalse PDisasmX86_showExceptionsfalse PDisasmX86_showRawfalse PDisasmX86_showAllRawfalse PDisasmX86_showSourcefalse PDisasmX86_showRelocationtrue PDisasmX86_showHextrue PDisasmX86_showCommentsfalse PDisasmX86_showSymDefstrue PDisasmX86_unmangletrue PDisasmX86_verbosetrue PDisasmX86_resolveRelocstrue PDisasmX86_resolveLocalsfalse MWDebugger_X86_Exceptions 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 GlobalOptimizer_X86_optimizationlevelLevel0 GlobalOptimizer_X86_optforSpeed MWLinker_X86_entrypointusageDefault MWLinker_X86_entrypoint MWLinker_X86_subsystemWinGUI MWLinker_X86_commandfile MWLinker_X86_generatemap0 MWLinker_X86_linksym0 MWLinker_X86_linkCV1 MWLinker_X86_symfullpathfalse MWLinker_X86_linkdebugtrue MWLinker_X86_checksumfalse MWLinker_X86_zero_init_bssfalse MWLinker_X86_mergedatafalse MWLinker_X86_usedefaultlibsfalse MWLinker_X86_adddefaultlibsfalse MWLinker_X86_nowarningsfalse MWLinker_X86_verbosefalse MWLinker_X86_linkformemfalse MWLinker_X86_codefoldingNone MWLinker_X86_debuginlinefalse MWProject_X86_typeApplication MWProject_X86_outfilenoname.exe MWProject_X86_importlib MWProject_X86_setimportlibdirfalse MWProject_X86_dontgenerateimportlibfalse MWProject_X86_oldformatlibfalse MWProject_X86_replaceobjextensionfalse MWProject_X86_copyallfilesfalse Name AtomConstants.h Unix Text Name AtomConstants.cpp Unix Text Debug Name ArrayObject.h Unix Text Name ArrayObject.cpp Unix Text Debug Name ArrayClass.h Unix Text Name AbstractFunction.h Unix Text Name AbstractFunction.cpp Unix Text Debug Name AbcParser.h Unix Text Name AbcParser.cpp Unix Text Debug Name XMLParser16.h Unix Text Name XMLParser16.cpp Unix Text Debug Name XMLObject.h Unix Text Name XMLObject.cpp Unix Text Debug Name XMLListObject.h Unix Text Name XMLListObject.cpp Unix Text Debug Name XMLListClass.h Unix Text Name XMLListClass.cpp Unix Text Debug Name XMLClass.h Unix Text Name XMLClass.cpp Unix Text Debug Name ArrayClass.cpp Unix Text Debug Name ActionBlockConstants.h Unix Text Name ActionBlockConstants.cpp Unix Text Debug Name StringBuffer.h Unix Text Name StringBuffer.cpp Unix Text Debug Name StaticProfiler.h Unix Text Name StaticProfiler.cpp Unix Text Debug Name StackTrace.h Unix Text Name StackTrace.cpp Unix Text Debug Name StringClass.h Unix Text Name Verifier.h Unix Text Name Verifier.cpp Unix Text Debug Name Accessor.h Unix Text Name Accessor.cpp Unix Text Debug Name ScriptObject.h Unix Text Name ScriptObject.cpp Unix Text Debug Name ScriptBuffer.h Unix Text Name ScriptBuffer.cpp Unix Text Debug Name ScopeChain.h Unix Text Name ScopeChain.cpp Unix Text Debug Name RegExpObject.h Unix Text Name RegExpObject.cpp Unix Text Debug Name RegExpClass.h Unix Text Name RegExpClass.cpp Unix Text Debug Name StringClass.cpp Unix Text Debug Name PrintWriter.h Unix Text Name PrintWriter.cpp Unix Text Debug Name PoolObject.h Unix Text Name PoolObject.cpp Unix Text Debug Name Interpreter.h Unix Text Name Interpreter.cpp Unix Text Debug Name IntClass.h Unix Text Name IntClass.cpp Unix Text Debug Name NativeObjectHelpers.h Unix Text Name OSDep.h Unix Text Name OutputStream.h Unix Text Name ObjectClass.h Unix Text Name ObjectClass.cpp Unix Text Debug Name NumberClass.h Unix Text Name NumberClass.cpp Unix Text Debug Name MethodInfo.h Unix Text Name MethodInfo.cpp Unix Text Debug Name MethodClosure.h Unix Text Name MethodClosure.cpp Unix Text Debug Name MathUtils.h Unix Text Name Namespace.cpp Unix Text Debug Name Multiname.h Unix Text Name Multiname.cpp Unix Text Debug Name NativeFunction.h Unix Text Name NativeFunction.cpp Unix Text Debug Name NamespaceClass.h Unix Text Name NamespaceClass.cpp Unix Text Debug Name Namespace.h Unix Text Name Toplevel.cpp Unix Text Debug Name StringObject.h Unix Text Name StringObject.cpp Unix Text Debug Name UnicodeUtils.h Unix Text Name UnicodeUtils.cpp Unix Text Debug Name types.h Unix Text Name Traits.h Unix Text Name Traits.cpp Unix Text Debug Name Toplevel.h Unix Text Name Exception.cpp Unix Text Debug Name ErrorConstants.h Unix Text Name ErrorClass.h Unix Text Name FunctionClass.h Unix Text Name FunctionClass.cpp Unix Text Debug Name FrameState.h Unix Text Name FrameState.cpp Unix Text Debug Name Exception.h Unix Text Name ErrorClass.cpp Unix Text Debug Name MathUtils.cpp Unix Text Debug Name MathClass.h Unix Text Name MathClass.cpp Unix Text Debug Name ClassClosure.h Unix Text Name ClassClass.h Unix Text Name ClassClass.cpp Unix Text Debug Name BuiltinTraits.h Unix Text Name ClassClosure.cpp Unix Text Debug Name BuiltinTraits.cpp Unix Text Debug Name DynamicProfiler.h Unix Text Name DynamicProfiler.cpp Unix Text Debug Name DateObject.h Unix Text Name DateObject.cpp Unix Text Debug Name DateClass.h Unix Text Name builtin.cpp Unix Text Debug Name DateClass.cpp Unix Text Debug Name Date.h Unix Text Name Date.cpp Unix Text Debug Name avmplusDebugger.h Unix Text Name avmplusDebugger.cpp Unix Text Debug Name avmplus.h Unix Text Name avmplus.cpp Unix Text Debug Name AvmDebug.h Unix Text Name avmbuild.h Unix Text Name BooleanClass.h Unix Text Name BooleanClass.cpp Unix Text Debug Name avmplusVersion.h Unix Text Name ErrorConstants.cpp Unix Text Debug Name avmplusProfiler.h Unix Text Name avmplusHashtable.h Unix Text Name avmplusHashtable.cpp Unix Text Debug Name AvmCore.h Unix Text Name AvmCore.cpp Unix Text Debug Name OSDepMac.cpp Unix Text Debug Name NativeFunctionMac.cpp Unix Text Debug Name MathUtilsMac.cpp Unix Text Debug Name avmplusStack.h Unix Text Name AvmDebugMac.cpp Unix Text Debug Name macprefix_debug.pch++ Unix Text Debug Name MethodEnv.h Unix Text Name MethodEnv.cpp Unix Text Debug Name AbcEnv.h Unix Text Name AbcEnv.cpp Unix Text Debug Name VTable.cpp Unix Text Debug Name VTable.h Unix Text Name CodegenMIR.h Unix Text Name BigInteger.cpp Unix Text Debug Name BigInteger.h Unix Text Name AtomArray.h Unix Text Name AtomArray.cpp Unix Text Debug Name avmplusProfiler.cpp Unix Text Debug Name CodegenMIR.cpp Unix Text Debug Name DateMac.cpp Unix Text Debug Name DateMac.h Unix Text Name MultinameHashtable.h Unix Text Name MultinameHashtable.cpp Unix Text Debug Name NamespaceSet.h Unix Text Name NamespaceSet.cpp Unix Text Debug Name DomainEnv.h Unix Text Name DomainEnv.cpp Unix Text Debug Name Domain.h Unix Text Name Domain.cpp Unix Text Debug Name GrowableBuffer.h Unix Text Name GrowableBuffer.cpp Unix Text Debug Name AbcGen.h Unix Text Name AbcGen.cpp Unix Text Debug Name E4XNode.h Unix Text Name E4XNode.cpp Unix Text Debug Name PpcAssembler.cpp Unix Text Debug Name pcre_info.cpp Unix Text Debug Name pcre_globals.cpp Unix Text Debug Name pcre_get.cpp Unix Text Debug Name pcre_fullinfo.cpp Unix Text Debug Name pcre_exec.cpp Unix Text Debug Name pcre_config.cpp Unix Text Debug Name pcre_compile.cpp Unix Text Debug Name pcre_chartables.cpp Unix Text Debug Name pcre_ord2utf8.cpp Unix Text Debug Name pcre_maketables.cpp Unix Text Debug Name pcre_refcount.cpp Unix Text Debug Name pcre_valid_utf8.cpp Unix Text Debug Name pcre_try_flipped.cpp Unix Text Debug Name pcre_tables.cpp Unix Text Debug Name pcre_study.cpp Unix Text Debug Name pcre.h Unix Text Name pcre_xclass.cpp Unix Text Debug Name pcre_version.cpp Unix Text Debug Name AvmPlusScriptableObject.cpp Unix Text Debug Name AvmPlusScriptableObject.h Unix Text Name AtomConstants.h Unix Name AtomConstants.cpp Unix Name ArrayObject.h Unix Name ArrayObject.cpp Unix Name ArrayClass.h Unix Name AbstractFunction.h Unix Name AbstractFunction.cpp Unix Name AbcParser.h Unix Name AbcParser.cpp Unix Name XMLParser16.h Unix Name XMLParser16.cpp Unix Name XMLObject.h Unix Name XMLObject.cpp Unix Name XMLListObject.h Unix Name XMLListObject.cpp Unix Name XMLListClass.h Unix Name XMLListClass.cpp Unix Name XMLClass.h Unix Name XMLClass.cpp Unix Name ArrayClass.cpp Unix Name ActionBlockConstants.h Unix Name ActionBlockConstants.cpp Unix Name StringBuffer.h Unix Name StringBuffer.cpp Unix Name StaticProfiler.h Unix Name StaticProfiler.cpp Unix Name StackTrace.h Unix Name StackTrace.cpp Unix Name StringClass.h Unix Name Verifier.h Unix Name Verifier.cpp Unix Name Accessor.h Unix Name Accessor.cpp Unix Name ScriptObject.h Unix Name ScriptObject.cpp Unix Name ScriptBuffer.h Unix Name ScriptBuffer.cpp Unix Name ScopeChain.h Unix Name ScopeChain.cpp Unix Name RegExpObject.h Unix Name RegExpObject.cpp Unix Name RegExpClass.h Unix Name RegExpClass.cpp Unix Name StringClass.cpp Unix Name PrintWriter.h Unix Name PrintWriter.cpp Unix Name PoolObject.h Unix Name PoolObject.cpp Unix Name Interpreter.h Unix Name Interpreter.cpp Unix Name IntClass.h Unix Name IntClass.cpp Unix Name NativeObjectHelpers.h Unix Name OSDep.h Unix Name OutputStream.h Unix Name ObjectClass.h Unix Name ObjectClass.cpp Unix Name NumberClass.h Unix Name NumberClass.cpp Unix Name MethodInfo.h Unix Name MethodInfo.cpp Unix Name MethodClosure.h Unix Name MethodClosure.cpp Unix Name MathUtils.h Unix Name Namespace.cpp Unix Name Multiname.h Unix Name Multiname.cpp Unix Name NativeFunction.h Unix Name NativeFunction.cpp Unix Name NamespaceClass.h Unix Name NamespaceClass.cpp Unix Name Namespace.h Unix Name Toplevel.cpp Unix Name StringObject.h Unix Name StringObject.cpp Unix Name UnicodeUtils.h Unix Name UnicodeUtils.cpp Unix Name types.h Unix Name Traits.h Unix Name Traits.cpp Unix Name Toplevel.h Unix Name Exception.cpp Unix Name ErrorConstants.h Unix Name ErrorClass.h Unix Name FunctionClass.h Unix Name FunctionClass.cpp Unix Name FrameState.h Unix Name FrameState.cpp Unix Name Exception.h Unix Name ErrorClass.cpp Unix Name MathUtils.cpp Unix Name MathClass.h Unix Name MathClass.cpp Unix Name ClassClosure.h Unix Name ClassClass.h Unix Name ClassClass.cpp Unix Name BuiltinTraits.h Unix Name ClassClosure.cpp Unix Name BuiltinTraits.cpp Unix Name DynamicProfiler.h Unix Name DynamicProfiler.cpp Unix Name DateObject.h Unix Name DateObject.cpp Unix Name DateClass.h Unix Name builtin.cpp Unix Name DateClass.cpp Unix Name Date.h Unix Name Date.cpp Unix Name avmplusDebugger.h Unix Name avmplusDebugger.cpp Unix Name avmplus.h Unix Name avmplus.cpp Unix Name AvmDebug.h Unix Name avmbuild.h Unix Name BooleanClass.h Unix Name BooleanClass.cpp Unix Name avmplusVersion.h Unix Name ErrorConstants.cpp Unix Name avmplusProfiler.h Unix Name avmplusHashtable.h Unix Name avmplusHashtable.cpp Unix Name AvmCore.h Unix Name AvmCore.cpp Unix Name OSDepMac.cpp Unix Name NativeFunctionMac.cpp Unix Name MathUtilsMac.cpp Unix Name avmplusStack.h Unix Name AvmDebugMac.cpp Unix Name macprefix_debug.pch++ Unix Name MethodEnv.h Unix Name MethodEnv.cpp Unix Name AbcEnv.h Unix Name AbcEnv.cpp Unix Name VTable.cpp Unix Name VTable.h Unix Name CodegenMIR.h Unix Name BigInteger.cpp Unix Name BigInteger.h Unix Name AtomArray.h Unix Name AtomArray.cpp Unix Name avmplusProfiler.cpp Unix Name CodegenMIR.cpp Unix Name DateMac.cpp Unix Name DateMac.h Unix Name MultinameHashtable.h Unix Name MultinameHashtable.cpp Unix Name NamespaceSet.h Unix Name NamespaceSet.cpp Unix Name DomainEnv.h Unix Name DomainEnv.cpp Unix Name Domain.h Unix Name Domain.cpp Unix Name GrowableBuffer.h Unix Name GrowableBuffer.cpp Unix Name AbcGen.h Unix Name AbcGen.cpp Unix Name E4XNode.h Unix Name E4XNode.cpp Unix Name PpcAssembler.cpp Unix Name pcre_info.cpp Unix Name pcre_globals.cpp Unix Name pcre_get.cpp Unix Name pcre_fullinfo.cpp Unix Name pcre_exec.cpp Unix Name pcre_config.cpp Unix Name pcre_compile.cpp Unix Name pcre_chartables.cpp Unix Name pcre_ord2utf8.cpp Unix Name pcre_maketables.cpp Unix Name pcre_refcount.cpp Unix Name pcre_valid_utf8.cpp Unix Name pcre_try_flipped.cpp Unix Name pcre_tables.cpp Unix Name pcre_study.cpp Unix Name pcre.h Unix Name pcre_xclass.cpp Unix Name pcre_version.cpp Unix Name AvmPlusScriptableObject.cpp Unix Name AvmPlusScriptableObject.h Unix Carbon Release UserSourceTrees AlwaysSearchUserPathsfalse InterpretDOSAndUnixPathsfalse RequireFrameworkStyleIncludesfalse SourceRelativeIncludesfalse UserSearchPaths SearchPath Path../../core PathFormatUnix PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path../../MMgc PathFormatUnix PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path PathFormatUnix PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path::: PathFormatMacOS PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path::::::vendors:CarbonLib_1.6GM_SDK: PathFormatMacOS PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path../../pcre PathFormatUnix PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SystemSearchPaths SearchPath Path::::::vendors:CarbonLib_1.6GM_SDK: PathFormatMacOS PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path:MSL:MSL_C:MSL_Common:Include: PathFormatMacOS PathRootCodeWarrior Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path:MacOS Support:MacHeaders: PathFormatMacOS PathRootCodeWarrior Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path:MacOS Support: PathFormatMacOS PathRootCodeWarrior Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path:MSL: PathFormatMacOS PathRootCodeWarrior Recursivetrue FrameworkPathfalse HostFlagsAll MWRuntimeSettings_WorkingDirectory MWRuntimeSettings_CommandLine MWRuntimeSettings_HostApplication Path PathFormatGeneric PathRootAbsolute MWRuntimeSettings_EnvVars LinkerMacOS PPC Linker PreLinker PostLinker TargetnameCarbon Release OutputDirectory Path: PathFormatMacOS PathRootProject SaveEntriesUsingRelativePathsfalse FileMappings FileTypeAPPL FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeAppl FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeMMLB FileExtension CompilerLib Import PPC EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMPLF FileExtension CompilerLib Import PPC EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMWCD FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeRSRC FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeTEXT FileExtension.arr Compiler EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.bh CompilerBalloon Help EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.c CompilerMW C/C++ PPC EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.c++ CompilerMW C/C++ PPC EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cc CompilerMW C/C++ PPC EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cp CompilerMW C/C++ PPC EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cpp CompilerMW C/C++ PPC EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.exp Compiler EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.h CompilerMW C/C++ PPC EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileTypeTEXT FileExtension.pch CompilerMW C/C++ PPC EditLanguageC/C++ Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pch++ CompilerMW C/C++ PPC EditLanguageC/C++ Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.r CompilerRez EditLanguageRez Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.s CompilerPPCAsm EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeXCOF FileExtension CompilerXCOFF Import PPC EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypedocu FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypersrc FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeshlb FileExtension CompilerPEF Import PPC EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypestub FileExtension CompilerPEF Import PPC EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileExtension.doc Compiler EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue FileExtension.o CompilerXCOFF Import PPC EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileExtension.ppob Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileExtension.rsrc Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse CacheModDatestrue DumpBrowserInfofalse CacheSubprojectstrue UseThirdPartyDebuggerfalse BrowserGenerator1 DebuggerAppPath Path PathFormatGeneric PathRootAbsolute DebuggerCmdLineArgs DebuggerWorkingDir Path PathFormatGeneric PathRootAbsolute CodeCompletionPrefixFileNameMacHeaders.c CodeCompletionMacroFileNameMacOS_Carbon_C++_Macros.h ConsoleEncoding0 LogSystemMessagestrue AutoTargetDLLsPopUp0 StopAtWatchpointstrue PauseWhileRunningfalse PauseInterval5 PauseUIFlags0 AltExePath Path PathFormatGeneric PathRootAbsolute StopAtTempBPOnLaunchtrue CacheSymbolicstrue TempBPFunctionNamemain TempBPType0 Enabledfalse ConnectionName DownloadPath LaunchRemoteAppfalse RemoteAppPath CoreID0 JTAGClockSpeed8000 IsMultiCorefalse OSDownloadfalse UseGlobalOSDownloadfalse OSDownloadConnectionName OSDownloadPath AltDownloadfalse AltDownloadConnectionName OtherExecutables AnalyzerConnectionName CustomColor1 Red0 Green32767 Blue0 CustomColor2 Red0 Green32767 Blue0 CustomColor3 Red0 Green32767 Blue0 CustomColor4 Red0 Green32767 Blue0 MWFrontEnd_C_cplusplus0 MWFrontEnd_C_checkprotos0 MWFrontEnd_C_arm0 MWFrontEnd_C_trigraphs0 MWFrontEnd_C_onlystdkeywords0 MWFrontEnd_C_enumsalwaysint1 MWFrontEnd_C_ansistrict0 MWFrontEnd_C_wchar_type1 MWFrontEnd_C_enableexceptions0 MWFrontEnd_C_dontreusestrings0 MWFrontEnd_C_poolstrings0 MWFrontEnd_C_dontinline0 MWFrontEnd_C_useRTTI0 MWFrontEnd_C_unsignedchars0 MWFrontEnd_C_autoinline0 MWFrontEnd_C_booltruefalse1 MWFrontEnd_C_inlinelevel8 MWFrontEnd_C_ecplusplus0 MWFrontEnd_C_defer_codegen1 MWFrontEnd_C_templateparser0 MWFrontEnd_C_c990 MWFrontEnd_C_bottomupinline1 MWFrontEnd_C_gcc_extensions0 MWFrontEnd_C_instance_manager0 C_CPP_Preprocessor_EmitFiletrue C_CPP_Preprocessor_EmitLinefalse C_CPP_Preprocessor_EmitFullPathfalse C_CPP_Preprocessor_KeepCommentsfalse C_CPP_Preprocessor_PCHUsesPrefixTextfalse C_CPP_Preprocessor_EmitPragmastrue C_CPP_Preprocessor_KeepWhiteSpacefalse C_CPP_Preprocessor_MultiByteEncodingencAutoDetectMultibyte C_CPP_Preprocessor_PrefixText#if !__option(precompile) #include "macprefix_release.mch++" #endif MWWarning_C_warn_illpragma1 MWWarning_C_warn_emptydecl1 MWWarning_C_warn_possunwant1 MWWarning_C_warn_unusedvar1 MWWarning_C_warn_unusedarg0 MWWarning_C_warn_extracomma0 MWWarning_C_pedantic1 MWWarning_C_warningerrors0 MWWarning_C_warn_hidevirtual0 MWWarning_C_warn_implicitconv0 MWWarning_C_warn_notinlined0 MWWarning_C_warn_structclass1 MWWarning_C_warn_missingreturn0 MWWarning_C_warn_no_side_effect0 MWWarning_C_warn_resultnotused0 MWWarning_C_warn_padding0 MWWarning_C_warn_impl_i2f_conv0 MWWarning_C_warn_impl_f2i_conv0 MWWarning_C_warn_impl_s2u_conv0 MWWarning_C_warn_illtokenpasting0 MWWarning_C_warn_filenamecaps0 MWWarning_C_warn_filenamecapssystem0 MWWarning_C_warn_undefmacro0 MWWarning_C_warn_ptrintconv1 MWMerge_MacOS_projectTypeApplication MWMerge_MacOS_outputNameMerge Out MWMerge_MacOS_outputCreator???? MWMerge_MacOS_outputTypeAPPL MWMerge_MacOS_suppressWarning0 MWMerge_MacOS_copyFragments1 MWMerge_MacOS_copyResources1 MWMerge_MacOS_flattenResource0 MWMerge_MacOS_flatFileNamea.rsrc MWMerge_MacOS_flatFileOutputPath Path: PathFormatMacOS PathRootProject MWMerge_MacOS_skipResources DLGX ckid Proj WSPC FileLockedfalse ResourcesMapIsReadOnlyfalse PrinterDriverIsMultiFinderCompatiblefalse Invisiblefalse HasBundlefalse NameLockedfalse Stationeryfalse HasCustomIconfalse Sharedfalse HasBeenInitedfalse Label0 Comments HasCustomBadgefalse HasRoutingInfotrue MWCodeGen_PPC_structalignmentPPC_mw MWCodeGen_PPC_tracebacktablesNone MWCodeGen_PPC_processorGeneric MWCodeGen_PPC_function_align4 MWCodeGen_PPC_tocdata1 MWCodeGen_PPC_largetoc0 MWCodeGen_PPC_profiler0 MWCodeGen_PPC_vectortocdata1 MWCodeGen_PPC_poolconst1 MWCodeGen_PPC_peephole1 MWCodeGen_PPC_readonlystrings1 MWCodeGen_PPC_linkerpoolsstrings1 MWCodeGen_PPC_volatileasm0 MWCodeGen_PPC_schedule1 MWCodeGen_PPC_altivec1 MWCodeGen_PPC_altivec_move_block0 MWCodeGen_PPC_strictIEEEfp0 MWCodeGen_PPC_fpcontract1 MWCodeGen_PPC_genfsel0 MWCodeGen_PPC_orderedfpcmp0 MWCodeGen_MachO_structalignmentPPC_mw MWCodeGen_MachO_profiler_enumOff MWCodeGen_MachO_processorGeneric MWCodeGen_MachO_function_align4 MWCodeGen_MachO_common0 MWCodeGen_MachO_boolisint0 MWCodeGen_MachO_peephole1 MWCodeGen_MachO_readonlystrings0 MWCodeGen_MachO_linkerpoolsstrings1 MWCodeGen_MachO_volatileasm0 MWCodeGen_MachO_schedule0 MWCodeGen_MachO_altivec0 MWCodeGen_MachO_vecmove0 MWCodeGen_MachO_fp_ieee_strict0 MWCodeGen_MachO_fpcontract1 MWCodeGen_MachO_genfsel0 MWCodeGen_MachO_fp_cmps_ordered0 MWDisassembler_PPC_showcode1 MWDisassembler_PPC_extended1 MWDisassembler_PPC_mix0 MWDisassembler_PPC_nohex0 MWDisassembler_PPC_showdata1 MWDisassembler_PPC_showexceptions1 MWDisassembler_PPC_showsym0 MWDisassembler_PPC_shownames1 GlobalOptimizer_PPC_optimizationlevelLevel4 GlobalOptimizer_PPC_optforSpeed MWLinker_PPC_linksym1 MWLinker_PPC_symfullpath1 MWLinker_PPC_linkmap0 MWLinker_PPC_nolinkwarnings0 MWLinker_PPC_dontdeadstripinitcode0 MWLinker_PPC_permitmultdefs0 MWLinker_PPC_linkmodeFast MWLinker_PPC_code_foldingNone MWLinker_PPC_initname MWLinker_PPC_mainname__start MWLinker_PPC_termname MWLinker_MacOSX_linksym0 MWLinker_MacOSX_symfullpath0 MWLinker_MacOSX_nolinkwarnings0 MWLinker_MacOSX_linkmap0 MWLinker_MacOSX_dontdeadstripinitcode0 MWLinker_MacOSX_permitmultdefs1 MWLinker_MacOSX_use_objectivec_semantics0 MWLinker_MacOSX_strip_debug_symbols0 MWLinker_MacOSX_prebind_all_twolevel_modules0 MWLinker_MacOSX_data_before_text_segment0 MWLinker_MacOSX_report_msl_overloads0 MWLinker_MacOSX_objects_follow_linkorder0 MWLinker_MacOSX_linkmodeFast MWLinker_MacOSX_exportsReferencedGlobals MWLinker_MacOSX_sortcodeNone MWLinker_MacOSX_mainnamestart MWLinker_MacOSX_initname MWLinker_MacOSX_code_foldingNone MWLinker_MacOSX_stabsgenNone MWProject_MacOSX_typeExecutable MWProject_MacOSX_outfileFlash Carbon Player MWProject_MacOSX_filecreatorSWF2 MWProject_MacOSX_filetypeAPPL MWProject_MacOSX_vmaddress4096 MWProject_MacOSX_usedefaultvmaddr1 MWProject_MacOSX_flatrsrc0 MWProject_MacOSX_flatrsrcfilename MWProject_MacOSX_flatrsrcoutputdir Path: PathFormatMacOS PathRootProject MWProject_MacOSX_installpath./ MWProject_MacOSX_dont_prebind0 MWProject_MacOSX_flat_namespace0 MWProject_MacOSX_frameworkversionA MWProject_MacOSX_currentversion0 MWProject_MacOSX_flat_oldimpversion0 MWProject_MacOSX_AddrMode0 MWPEF_exportsNone MWPEF_libfolder0 MWPEF_sortcodeNone MWPEF_expandbss0 MWPEF_sharedata0 MWPEF_olddefversion0 MWPEF_oldimpversion0 MWPEF_currentversion0 MWPEF_fragmentname MWPEF_collapsereloads1 MWProject_PPC_typeLibrary MWProject_PPC_outfileavmplus_carbon.lib MWProject_PPC_filecreator???? MWProject_PPC_filetype???? MWProject_PPC_size0 MWProject_PPC_minsize0 MWProject_PPC_stacksize0 MWProject_PPC_flags0 MWProject_PPC_symfilename MWProject_PPC_rsrcname MWProject_PPC_rsrcheaderNative MWProject_PPC_rsrctype???? MWProject_PPC_rsrcid0 MWProject_PPC_rsrcflags0 MWProject_PPC_rsrcstore0 MWProject_PPC_rsrcmerge0 MWProject_PPC_flatrsrc0 MWProject_PPC_flatrsrcoutputdir Path: PathFormatMacOS PathRootProject MWProject_PPC_flatrsrcfilename MWAssembler_PPC_auxheader0 MWAssembler_PPC_symmodeMac MWAssembler_PPC_dialectPPC MWAssembler_PPC_prefixfile MWAssembler_PPC_typecheck0 MWAssembler_PPC_warnings0 MWAssembler_PPC_casesensitive0 PList_OutputTypeFile PList_OutputEncodingUTF-8 PList_PListVersion0.9 PList_Prefix PList_FileFilenameInfo.plist PList_FileDirectory Path: PathFormatMacOS PathRootProject PList_ResourceTypeplst PList_ResourceID0 PList_ResourceName MWRez_Language_maxwidth80 MWRez_Language_scriptRoman MWRez_Language_alignmentAlign1 MWRez_Language_filtermodeFilterSkip MWRez_Language_suppresswarnings0 MWRez_Language_escapecontrolchars1 MWRez_Language_prefixnameStandaloneRez.h MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' MWWinRC_prefixname MWCodeGen_X86_processorGeneric MWCodeGen_X86_alignmentbytes8 MWCodeGen_X86_exceptionsZeroOverhead MWCodeGen_X86_name_manglingMWWin32 MWCodeGen_X86_use_extinst0 MWCodeGen_X86_extinst_mmx0 MWCodeGen_X86_extinst_3dnow0 MWCodeGen_X86_use_mmx_3dnow_convention0 MWCodeGen_X86_extinst_cmov0 MWCodeGen_X86_extinst_sse0 MWCodeGen_X86_extinst_sse20 MWCodeGen_X86_intrinsics0 MWCodeGen_X86_optimizeasm0 MWCodeGen_X86_disableopts0 MWCodeGen_X86_profile0 MWLinker_X86_runtimeCustom MWCodeGen_X86_readonlystrings0 MWCodeGen_X86_vectorize0 MWCodeGen_X86_relaxieee0 MWLinker_X86_subsysmajorid4 MWLinker_X86_subsysminorid0 MWCOFF_X86_opsysmajorid4 MWCOFF_X86_opsysminorid0 MWLinker_X86_usrmajorid0 MWLinker_X86_usrminorid0 MWProject_X86_maxstacksize1024 MWProject_X86_minstacksize4 MWProject_X86_size1024 MWProject_X86_minsize4 MWCOFF_X86_coff_flags0 MWCOFF_X86_dll_flags0 MWProject_X86_baseaddress4194304 MWCOFF_X86_filealign512 MWCOFF_X86_sectionalign4096 PDisasmX86_showHeaderstrue PDisasmX86_showSectHeaderstrue PDisasmX86_showSymTabtrue PDisasmX86_showCodetrue PDisasmX86_showDatatrue PDisasmX86_showDebugfalse PDisasmX86_showExceptionsfalse PDisasmX86_showRawfalse PDisasmX86_showAllRawfalse PDisasmX86_showSourcefalse PDisasmX86_showRelocationtrue PDisasmX86_showHextrue PDisasmX86_showCommentsfalse PDisasmX86_showSymDefstrue PDisasmX86_unmangletrue PDisasmX86_verbosetrue PDisasmX86_resolveRelocstrue PDisasmX86_resolveLocalsfalse MWDebugger_X86_Exceptions 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 GlobalOptimizer_X86_optimizationlevelLevel0 GlobalOptimizer_X86_optforSpeed MWLinker_X86_entrypointusageDefault MWLinker_X86_entrypoint MWLinker_X86_subsystemWinGUI MWLinker_X86_commandfile MWLinker_X86_generatemap0 MWLinker_X86_linksym0 MWLinker_X86_linkCV1 MWLinker_X86_symfullpathfalse MWLinker_X86_linkdebugtrue MWLinker_X86_checksumfalse MWLinker_X86_zero_init_bssfalse MWLinker_X86_mergedatafalse MWLinker_X86_usedefaultlibsfalse MWLinker_X86_adddefaultlibsfalse MWLinker_X86_nowarningsfalse MWLinker_X86_verbosefalse MWLinker_X86_linkformemfalse MWLinker_X86_codefoldingNone MWLinker_X86_debuginlinefalse MWProject_X86_typeApplication MWProject_X86_outfilenoname.exe MWProject_X86_importlib MWProject_X86_setimportlibdirfalse MWProject_X86_dontgenerateimportlibfalse MWProject_X86_oldformatlibfalse MWProject_X86_replaceobjextensionfalse MWProject_X86_copyallfilesfalse Name AtomConstants.h Unix Text Name AtomConstants.cpp Unix Text Debug Name ArrayObject.h Unix Text Name ArrayObject.cpp Unix Text Debug Name ArrayClass.h Unix Text Name AbstractFunction.h Unix Text Name AbstractFunction.cpp Unix Text Debug Name AbcParser.h Unix Text Name AbcParser.cpp Unix Text Debug Name XMLParser16.h Unix Text Name XMLParser16.cpp Unix Text Debug Name XMLObject.h Unix Text Name XMLObject.cpp Unix Text Debug Name XMLListObject.h Unix Text Name XMLListObject.cpp Unix Text Debug Name XMLListClass.h Unix Text Name XMLListClass.cpp Unix Text Debug Name XMLClass.h Unix Text Name XMLClass.cpp Unix Text Debug Name ArrayClass.cpp Unix Text Debug Name ActionBlockConstants.h Unix Text Name ActionBlockConstants.cpp Unix Text Debug Name StringBuffer.h Unix Text Name StringBuffer.cpp Unix Text Debug Name StaticProfiler.h Unix Text Name StaticProfiler.cpp Unix Text Debug Name StackTrace.h Unix Text Name StackTrace.cpp Unix Text Debug Name StringClass.h Unix Text Name Verifier.h Unix Text Name Verifier.cpp Unix Text Debug Name Accessor.h Unix Text Name Accessor.cpp Unix Text Debug Name ScriptObject.h Unix Text Name ScriptObject.cpp Unix Text Debug Name ScriptBuffer.h Unix Text Name ScriptBuffer.cpp Unix Text Debug Name ScopeChain.h Unix Text Name ScopeChain.cpp Unix Text Debug Name RegExpObject.h Unix Text Name RegExpObject.cpp Unix Text Debug Name RegExpClass.h Unix Text Name RegExpClass.cpp Unix Text Debug Name StringClass.cpp Unix Text Debug Name PrintWriter.h Unix Text Name PrintWriter.cpp Unix Text Debug Name PoolObject.h Unix Text Name PoolObject.cpp Unix Text Debug Name Interpreter.h Unix Text Name Interpreter.cpp Unix Text Debug Name IntClass.h Unix Text Name IntClass.cpp Unix Text Debug Name NativeObjectHelpers.h Unix Text Name OSDep.h Unix Text Name OutputStream.h Unix Text Name ObjectClass.h Unix Text Name ObjectClass.cpp Unix Text Debug Name NumberClass.h Unix Text Name NumberClass.cpp Unix Text Debug Name MethodInfo.h Unix Text Name MethodInfo.cpp Unix Text Debug Name MethodClosure.h Unix Text Name MethodClosure.cpp Unix Text Debug Name MathUtils.h Unix Text Name Namespace.cpp Unix Text Debug Name Multiname.h Unix Text Name Multiname.cpp Unix Text Debug Name NativeFunction.h Unix Text Name NativeFunction.cpp Unix Text Debug Name NamespaceClass.h Unix Text Name NamespaceClass.cpp Unix Text Debug Name Namespace.h Unix Text Name Toplevel.cpp Unix Text Debug Name StringObject.h Unix Text Name StringObject.cpp Unix Text Debug Name UnicodeUtils.h Unix Text Name UnicodeUtils.cpp Unix Text Debug Name types.h Unix Text Name Traits.h Unix Text Name Traits.cpp Unix Text Debug Name Toplevel.h Unix Text Name Exception.cpp Unix Text Debug Name ErrorConstants.h Unix Text Name ErrorClass.h Unix Text Name FunctionClass.h Unix Text Name FunctionClass.cpp Unix Text Debug Name FrameState.h Unix Text Name FrameState.cpp Unix Text Debug Name Exception.h Unix Text Name ErrorClass.cpp Unix Text Debug Name MathUtils.cpp Unix Text Debug Name MathClass.h Unix Text Name MathClass.cpp Unix Text Debug Name ClassClosure.h Unix Text Name ClassClass.h Unix Text Name ClassClass.cpp Unix Text Debug Name BuiltinTraits.h Unix Text Name ClassClosure.cpp Unix Text Debug Name BuiltinTraits.cpp Unix Text Debug Name DynamicProfiler.h Unix Text Name DynamicProfiler.cpp Unix Text Debug Name DateObject.h Unix Text Name DateObject.cpp Unix Text Debug Name DateClass.h Unix Text Name builtin.cpp Unix Text Debug Name DateClass.cpp Unix Text Debug Name Date.h Unix Text Name Date.cpp Unix Text Debug Name avmplusDebugger.h Unix Text Name avmplusDebugger.cpp Unix Text Debug Name avmplus.h Unix Text Name avmplus.cpp Unix Text Debug Name AvmDebug.h Unix Text Name avmbuild.h Unix Text Name BooleanClass.h Unix Text Name BooleanClass.cpp Unix Text Debug Name avmplusVersion.h Unix Text Name ErrorConstants.cpp Unix Text Debug Name avmplusProfiler.h Unix Text Name avmplusHashtable.h Unix Text Name avmplusHashtable.cpp Unix Text Debug Name AvmCore.h Unix Text Name AvmCore.cpp Unix Text Debug Name OSDepMac.cpp Unix Text Debug Name NativeFunctionMac.cpp Unix Text Debug Name MathUtilsMac.cpp Unix Text Debug Name avmplusStack.h Unix Text Name AvmDebugMac.cpp Unix Text Debug Name macprefix_release.pch++ Unix Text Debug Name MethodEnv.h Unix Text Name MethodEnv.cpp Unix Text Debug Name AbcEnv.h Unix Text Name AbcEnv.cpp Unix Text Debug Name VTable.cpp Unix Text Debug Name VTable.h Unix Text Name CodegenMIR.h Unix Text Name BigInteger.cpp Unix Text Debug Name BigInteger.h Unix Text Name AtomArray.h Unix Text Name AtomArray.cpp Unix Text Debug Name avmplusProfiler.cpp Unix Text Debug Name CodegenMIR.cpp Unix Text Debug Name DateMac.cpp Unix Text Debug Name DateMac.h Unix Text Name MultinameHashtable.h Unix Text Name MultinameHashtable.cpp Unix Text Debug Name NamespaceSet.h Unix Text Name NamespaceSet.cpp Unix Text Debug Name DomainEnv.h Unix Text Name DomainEnv.cpp Unix Text Debug Name Domain.h Unix Text Name Domain.cpp Unix Text Debug Name GrowableBuffer.h Unix Text Name GrowableBuffer.cpp Unix Text Debug Name AbcGen.h Unix Text Name AbcGen.cpp Unix Text Debug Name E4XNode.h Unix Text Name E4XNode.cpp Unix Text Debug Name PpcAssembler.cpp Unix Text Debug Name pcre_info.cpp Unix Text Debug Name pcre_globals.cpp Unix Text Debug Name pcre_get.cpp Unix Text Debug Name pcre_fullinfo.cpp Unix Text Debug Name pcre_exec.cpp Unix Text Debug Name pcre_config.cpp Unix Text Debug Name pcre_compile.cpp Unix Text Debug Name pcre_chartables.cpp Unix Text Debug Name pcre_ord2utf8.cpp Unix Text Debug Name pcre_maketables.cpp Unix Text Debug Name pcre_refcount.cpp Unix Text Debug Name pcre_valid_utf8.cpp Unix Text Debug Name pcre_try_flipped.cpp Unix Text Debug Name pcre_tables.cpp Unix Text Debug Name pcre_study.cpp Unix Text Debug Name pcre.h Unix Text Name pcre_xclass.cpp Unix Text Debug Name pcre_version.cpp Unix Text Debug Name AvmPlusScriptableObject.cpp Unix Text Debug Name AvmPlusScriptableObject.h Unix Text Name AtomConstants.h Unix Name AtomConstants.cpp Unix Name ArrayObject.h Unix Name ArrayObject.cpp Unix Name ArrayClass.h Unix Name AbstractFunction.h Unix Name AbstractFunction.cpp Unix Name AbcParser.h Unix Name AbcParser.cpp Unix Name XMLParser16.h Unix Name XMLParser16.cpp Unix Name XMLObject.h Unix Name XMLObject.cpp Unix Name XMLListObject.h Unix Name XMLListObject.cpp Unix Name XMLListClass.h Unix Name XMLListClass.cpp Unix Name XMLClass.h Unix Name XMLClass.cpp Unix Name ArrayClass.cpp Unix Name ActionBlockConstants.h Unix Name ActionBlockConstants.cpp Unix Name StringBuffer.h Unix Name StringBuffer.cpp Unix Name StaticProfiler.h Unix Name StaticProfiler.cpp Unix Name StackTrace.h Unix Name StackTrace.cpp Unix Name StringClass.h Unix Name Verifier.h Unix Name Verifier.cpp Unix Name Accessor.h Unix Name Accessor.cpp Unix Name ScriptObject.h Unix Name ScriptObject.cpp Unix Name ScriptBuffer.h Unix Name ScriptBuffer.cpp Unix Name ScopeChain.h Unix Name ScopeChain.cpp Unix Name RegExpObject.h Unix Name RegExpObject.cpp Unix Name RegExpClass.h Unix Name RegExpClass.cpp Unix Name StringClass.cpp Unix Name PrintWriter.h Unix Name PrintWriter.cpp Unix Name PoolObject.h Unix Name PoolObject.cpp Unix Name Interpreter.h Unix Name Interpreter.cpp Unix Name IntClass.h Unix Name IntClass.cpp Unix Name NativeObjectHelpers.h Unix Name OSDep.h Unix Name OutputStream.h Unix Name ObjectClass.h Unix Name ObjectClass.cpp Unix Name NumberClass.h Unix Name NumberClass.cpp Unix Name MethodInfo.h Unix Name MethodInfo.cpp Unix Name MethodClosure.h Unix Name MethodClosure.cpp Unix Name MathUtils.h Unix Name Namespace.cpp Unix Name Multiname.h Unix Name Multiname.cpp Unix Name NativeFunction.h Unix Name NativeFunction.cpp Unix Name NamespaceClass.h Unix Name NamespaceClass.cpp Unix Name Namespace.h Unix Name Toplevel.cpp Unix Name StringObject.h Unix Name StringObject.cpp Unix Name UnicodeUtils.h Unix Name UnicodeUtils.cpp Unix Name types.h Unix Name Traits.h Unix Name Traits.cpp Unix Name Toplevel.h Unix Name Exception.cpp Unix Name ErrorConstants.h Unix Name ErrorClass.h Unix Name FunctionClass.h Unix Name FunctionClass.cpp Unix Name FrameState.h Unix Name FrameState.cpp Unix Name Exception.h Unix Name ErrorClass.cpp Unix Name MathUtils.cpp Unix Name MathClass.h Unix Name MathClass.cpp Unix Name ClassClosure.h Unix Name ClassClass.h Unix Name ClassClass.cpp Unix Name BuiltinTraits.h Unix Name ClassClosure.cpp Unix Name BuiltinTraits.cpp Unix Name DynamicProfiler.h Unix Name DynamicProfiler.cpp Unix Name DateObject.h Unix Name DateObject.cpp Unix Name DateClass.h Unix Name builtin.cpp Unix Name DateClass.cpp Unix Name Date.h Unix Name Date.cpp Unix Name avmplusDebugger.h Unix Name avmplusDebugger.cpp Unix Name avmplus.h Unix Name avmplus.cpp Unix Name AvmDebug.h Unix Name avmbuild.h Unix Name BooleanClass.h Unix Name BooleanClass.cpp Unix Name avmplusVersion.h Unix Name ErrorConstants.cpp Unix Name avmplusProfiler.h Unix Name avmplusHashtable.h Unix Name avmplusHashtable.cpp Unix Name AvmCore.h Unix Name AvmCore.cpp Unix Name OSDepMac.cpp Unix Name NativeFunctionMac.cpp Unix Name MathUtilsMac.cpp Unix Name avmplusStack.h Unix Name AvmDebugMac.cpp Unix Name macprefix_release.pch++ Unix Name MethodEnv.h Unix Name MethodEnv.cpp Unix Name AbcEnv.h Unix Name AbcEnv.cpp Unix Name VTable.cpp Unix Name VTable.h Unix Name CodegenMIR.h Unix Name BigInteger.cpp Unix Name BigInteger.h Unix Name AtomArray.h Unix Name AtomArray.cpp Unix Name avmplusProfiler.cpp Unix Name CodegenMIR.cpp Unix Name DateMac.cpp Unix Name DateMac.h Unix Name MultinameHashtable.h Unix Name MultinameHashtable.cpp Unix Name NamespaceSet.h Unix Name NamespaceSet.cpp Unix Name DomainEnv.h Unix Name DomainEnv.cpp Unix Name Domain.h Unix Name Domain.cpp Unix Name GrowableBuffer.h Unix Name GrowableBuffer.cpp Unix Name AbcGen.h Unix Name AbcGen.cpp Unix Name E4XNode.h Unix Name E4XNode.cpp Unix Name PpcAssembler.cpp Unix Name pcre_info.cpp Unix Name pcre_globals.cpp Unix Name pcre_get.cpp Unix Name pcre_fullinfo.cpp Unix Name pcre_exec.cpp Unix Name pcre_config.cpp Unix Name pcre_compile.cpp Unix Name pcre_chartables.cpp Unix Name pcre_ord2utf8.cpp Unix Name pcre_maketables.cpp Unix Name pcre_refcount.cpp Unix Name pcre_valid_utf8.cpp Unix Name pcre_try_flipped.cpp Unix Name pcre_tables.cpp Unix Name pcre_study.cpp Unix Name pcre.h Unix Name pcre_xclass.cpp Unix Name pcre_version.cpp Unix Name AvmPlusScriptableObject.cpp Unix Name AvmPlusScriptableObject.h Unix Carbon D-Debug UserSourceTrees AlwaysSearchUserPathsfalse InterpretDOSAndUnixPathsfalse RequireFrameworkStyleIncludesfalse SourceRelativeIncludesfalse UserSearchPaths SearchPath Path../../core PathFormatUnix PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path../../MMgc PathFormatUnix PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path PathFormatUnix PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path::: PathFormatMacOS PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path::::::vendors:CarbonLib_1.6GM_SDK: PathFormatMacOS PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path../../pcre PathFormatUnix PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SystemSearchPaths SearchPath Path::::::vendors:CarbonLib_1.6GM_SDK: PathFormatMacOS PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path:MSL:MSL_C:MSL_Common:Include: PathFormatMacOS PathRootCodeWarrior Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path:MacOS Support:MacHeaders: PathFormatMacOS PathRootCodeWarrior Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path:MacOS Support: PathFormatMacOS PathRootCodeWarrior Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path:MSL: PathFormatMacOS PathRootCodeWarrior Recursivetrue FrameworkPathfalse HostFlagsAll MWRuntimeSettings_WorkingDirectory MWRuntimeSettings_CommandLine MWRuntimeSettings_HostApplication Path PathFormatGeneric PathRootAbsolute MWRuntimeSettings_EnvVars LinkerMacOS PPC Linker PreLinker PostLinker TargetnameCarbon D-Debug OutputDirectory Path: PathFormatMacOS PathRootProject SaveEntriesUsingRelativePathsfalse FileMappings FileTypeAPPL FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeAppl FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeMMLB FileExtension CompilerLib Import PPC EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMPLF FileExtension CompilerLib Import PPC EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMWCD FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeRSRC FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeTEXT FileExtension.arr Compiler EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.bh CompilerBalloon Help EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.c CompilerMW C/C++ PPC EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.c++ CompilerMW C/C++ PPC EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cc CompilerMW C/C++ PPC EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cp CompilerMW C/C++ PPC EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cpp CompilerMW C/C++ PPC EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.exp Compiler EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.h CompilerMW C/C++ PPC EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileTypeTEXT FileExtension.pch CompilerMW C/C++ PPC EditLanguageC/C++ Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pch++ CompilerMW C/C++ PPC EditLanguageC/C++ Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.r CompilerRez EditLanguageRez Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.s CompilerPPCAsm EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeXCOF FileExtension CompilerXCOFF Import PPC EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypedocu FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypersrc FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeshlb FileExtension CompilerPEF Import PPC EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypestub FileExtension CompilerPEF Import PPC EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileExtension.doc Compiler EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue FileExtension.o CompilerXCOFF Import PPC EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileExtension.ppob Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileExtension.rsrc Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse CacheModDatestrue DumpBrowserInfofalse CacheSubprojectstrue UseThirdPartyDebuggerfalse BrowserGenerator1 DebuggerAppPath Path PathFormatGeneric PathRootAbsolute DebuggerCmdLineArgs DebuggerWorkingDir Path PathFormatGeneric PathRootAbsolute CodeCompletionPrefixFileNameMacHeaders.c CodeCompletionMacroFileNameMacOS_Carbon_C++_Macros.h ConsoleEncoding0 LogSystemMessagesfalse AutoTargetDLLsPopUp0 StopAtWatchpointstrue PauseWhileRunningfalse PauseInterval5 PauseUIFlags0 AltExePath Path PathFormatGeneric PathRootAbsolute StopAtTempBPOnLaunchtrue CacheSymbolicstrue TempBPFunctionNamemain TempBPType0 Enabledfalse ConnectionName DownloadPath LaunchRemoteAppfalse RemoteAppPath CoreID0 JTAGClockSpeed8000 IsMultiCorefalse OSDownloadfalse UseGlobalOSDownloadfalse OSDownloadConnectionName OSDownloadPath AltDownloadfalse AltDownloadConnectionName OtherExecutables AnalyzerConnectionName CustomColor1 Red0 Green32767 Blue0 CustomColor2 Red0 Green32767 Blue0 CustomColor3 Red0 Green32767 Blue0 CustomColor4 Red0 Green32767 Blue0 MWFrontEnd_C_cplusplus0 MWFrontEnd_C_checkprotos0 MWFrontEnd_C_arm0 MWFrontEnd_C_trigraphs0 MWFrontEnd_C_onlystdkeywords0 MWFrontEnd_C_enumsalwaysint1 MWFrontEnd_C_ansistrict0 MWFrontEnd_C_wchar_type1 MWFrontEnd_C_enableexceptions0 MWFrontEnd_C_dontreusestrings0 MWFrontEnd_C_poolstrings0 MWFrontEnd_C_dontinline1 MWFrontEnd_C_useRTTI0 MWFrontEnd_C_unsignedchars0 MWFrontEnd_C_autoinline0 MWFrontEnd_C_booltruefalse1 MWFrontEnd_C_inlinelevel0 MWFrontEnd_C_ecplusplus0 MWFrontEnd_C_defer_codegen0 MWFrontEnd_C_templateparser0 MWFrontEnd_C_c990 MWFrontEnd_C_bottomupinline1 MWFrontEnd_C_gcc_extensions0 MWFrontEnd_C_instance_manager0 C_CPP_Preprocessor_EmitFiletrue C_CPP_Preprocessor_EmitLinefalse C_CPP_Preprocessor_EmitFullPathfalse C_CPP_Preprocessor_KeepCommentsfalse C_CPP_Preprocessor_PCHUsesPrefixTextfalse C_CPP_Preprocessor_EmitPragmastrue C_CPP_Preprocessor_KeepWhiteSpacefalse C_CPP_Preprocessor_MultiByteEncodingencAutoDetectMultibyte C_CPP_Preprocessor_PrefixText#if !__option(precompile) #include "macprefix_debuggerdebug.mch++" #endif MWWarning_C_warn_illpragma1 MWWarning_C_warn_emptydecl1 MWWarning_C_warn_possunwant1 MWWarning_C_warn_unusedvar1 MWWarning_C_warn_unusedarg0 MWWarning_C_warn_extracomma0 MWWarning_C_pedantic1 MWWarning_C_warningerrors0 MWWarning_C_warn_hidevirtual0 MWWarning_C_warn_implicitconv0 MWWarning_C_warn_notinlined0 MWWarning_C_warn_structclass1 MWWarning_C_warn_missingreturn0 MWWarning_C_warn_no_side_effect0 MWWarning_C_warn_resultnotused0 MWWarning_C_warn_padding0 MWWarning_C_warn_impl_i2f_conv0 MWWarning_C_warn_impl_f2i_conv0 MWWarning_C_warn_impl_s2u_conv0 MWWarning_C_warn_illtokenpasting0 MWWarning_C_warn_filenamecaps0 MWWarning_C_warn_filenamecapssystem0 MWWarning_C_warn_undefmacro0 MWWarning_C_warn_ptrintconv1 MWMerge_MacOS_projectTypeApplication MWMerge_MacOS_outputNameMerge Out MWMerge_MacOS_outputCreator???? MWMerge_MacOS_outputTypeAPPL MWMerge_MacOS_suppressWarning0 MWMerge_MacOS_copyFragments1 MWMerge_MacOS_copyResources1 MWMerge_MacOS_flattenResource0 MWMerge_MacOS_flatFileNamea.rsrc MWMerge_MacOS_flatFileOutputPath Path: PathFormatMacOS PathRootProject MWMerge_MacOS_skipResources DLGX ckid Proj WSPC FileLockedfalse ResourcesMapIsReadOnlyfalse PrinterDriverIsMultiFinderCompatiblefalse Invisiblefalse HasBundlefalse NameLockedfalse Stationeryfalse HasCustomIconfalse Sharedfalse HasBeenInitedfalse Label0 Comments HasCustomBadgefalse HasRoutingInfofalse MWCodeGen_PPC_structalignmentPPC_mw MWCodeGen_PPC_tracebacktablesInline MWCodeGen_PPC_processorGeneric MWCodeGen_PPC_function_align4 MWCodeGen_PPC_tocdata1 MWCodeGen_PPC_largetoc0 MWCodeGen_PPC_profiler0 MWCodeGen_PPC_vectortocdata1 MWCodeGen_PPC_poolconst0 MWCodeGen_PPC_peephole0 MWCodeGen_PPC_readonlystrings0 MWCodeGen_PPC_linkerpoolsstrings0 MWCodeGen_PPC_volatileasm0 MWCodeGen_PPC_schedule0 MWCodeGen_PPC_altivec1 MWCodeGen_PPC_altivec_move_block0 MWCodeGen_PPC_strictIEEEfp0 MWCodeGen_PPC_fpcontract1 MWCodeGen_PPC_genfsel0 MWCodeGen_PPC_orderedfpcmp0 MWCodeGen_MachO_structalignmentPPC_mw MWCodeGen_MachO_profiler_enumOff MWCodeGen_MachO_processorGeneric MWCodeGen_MachO_function_align4 MWCodeGen_MachO_common0 MWCodeGen_MachO_boolisint0 MWCodeGen_MachO_peephole1 MWCodeGen_MachO_readonlystrings0 MWCodeGen_MachO_linkerpoolsstrings1 MWCodeGen_MachO_volatileasm0 MWCodeGen_MachO_schedule0 MWCodeGen_MachO_altivec0 MWCodeGen_MachO_vecmove0 MWCodeGen_MachO_fp_ieee_strict0 MWCodeGen_MachO_fpcontract1 MWCodeGen_MachO_genfsel0 MWCodeGen_MachO_fp_cmps_ordered0 MWDisassembler_PPC_showcode1 MWDisassembler_PPC_extended1 MWDisassembler_PPC_mix0 MWDisassembler_PPC_nohex0 MWDisassembler_PPC_showdata1 MWDisassembler_PPC_showexceptions1 MWDisassembler_PPC_showsym1 MWDisassembler_PPC_shownames1 GlobalOptimizer_PPC_optimizationlevelLevel0 GlobalOptimizer_PPC_optforSize MWLinker_PPC_linksym1 MWLinker_PPC_symfullpath1 MWLinker_PPC_linkmap1 MWLinker_PPC_nolinkwarnings0 MWLinker_PPC_dontdeadstripinitcode0 MWLinker_PPC_permitmultdefs0 MWLinker_PPC_linkmodeFast MWLinker_PPC_code_foldingNone MWLinker_PPC_initname MWLinker_PPC_mainname__start MWLinker_PPC_termname MWLinker_MacOSX_linksym0 MWLinker_MacOSX_symfullpath0 MWLinker_MacOSX_nolinkwarnings0 MWLinker_MacOSX_linkmap0 MWLinker_MacOSX_dontdeadstripinitcode0 MWLinker_MacOSX_permitmultdefs1 MWLinker_MacOSX_use_objectivec_semantics0 MWLinker_MacOSX_strip_debug_symbols0 MWLinker_MacOSX_prebind_all_twolevel_modules0 MWLinker_MacOSX_data_before_text_segment0 MWLinker_MacOSX_report_msl_overloads0 MWLinker_MacOSX_objects_follow_linkorder0 MWLinker_MacOSX_linkmodeFast MWLinker_MacOSX_exportsReferencedGlobals MWLinker_MacOSX_sortcodeNone MWLinker_MacOSX_mainnamestart MWLinker_MacOSX_initname MWLinker_MacOSX_code_foldingNone MWLinker_MacOSX_stabsgenNone MWProject_MacOSX_typeExecutable MWProject_MacOSX_outfileFlash Carbon DebuggerDebug MWProject_MacOSX_filecreatorSWF2 MWProject_MacOSX_filetypeAPPL MWProject_MacOSX_vmaddress4096 MWProject_MacOSX_usedefaultvmaddr1 MWProject_MacOSX_flatrsrc0 MWProject_MacOSX_flatrsrcfilename MWProject_MacOSX_flatrsrcoutputdir Path: PathFormatMacOS PathRootProject MWProject_MacOSX_installpath./ MWProject_MacOSX_dont_prebind0 MWProject_MacOSX_flat_namespace0 MWProject_MacOSX_frameworkversionA MWProject_MacOSX_currentversion0 MWProject_MacOSX_flat_oldimpversion0 MWProject_MacOSX_AddrMode0 MWPEF_exportsNone MWPEF_libfolder0 MWPEF_sortcodeNone MWPEF_expandbss0 MWPEF_sharedata0 MWPEF_olddefversion0 MWPEF_oldimpversion0 MWPEF_currentversion0 MWPEF_fragmentname MWPEF_collapsereloads0 MWProject_PPC_typeLibrary MWProject_PPC_outfileavmplus_carbon_ddebug.lib MWProject_PPC_filecreator???? MWProject_PPC_filetype???? MWProject_PPC_size0 MWProject_PPC_minsize0 MWProject_PPC_stacksize0 MWProject_PPC_flags0 MWProject_PPC_symfilename MWProject_PPC_rsrcname MWProject_PPC_rsrcheaderNative MWProject_PPC_rsrctype???? MWProject_PPC_rsrcid0 MWProject_PPC_rsrcflags0 MWProject_PPC_rsrcstore0 MWProject_PPC_rsrcmerge0 MWProject_PPC_flatrsrc0 MWProject_PPC_flatrsrcoutputdir Path: PathFormatMacOS PathRootProject MWProject_PPC_flatrsrcfilename MWAssembler_PPC_auxheader0 MWAssembler_PPC_symmodeMac MWAssembler_PPC_dialectPPC MWAssembler_PPC_prefixfile MWAssembler_PPC_typecheck0 MWAssembler_PPC_warnings0 MWAssembler_PPC_casesensitive0 PList_OutputTypeFile PList_OutputEncodingUTF-8 PList_PListVersion0.9 PList_Prefix PList_FileFilenameInfo.plist PList_FileDirectory Path: PathFormatMacOS PathRootProject PList_ResourceTypeplst PList_ResourceID0 PList_ResourceName MWRez_Language_maxwidth80 MWRez_Language_scriptRoman MWRez_Language_alignmentAlign1 MWRez_Language_filtermodeFilterSkip MWRez_Language_suppresswarnings0 MWRez_Language_escapecontrolchars1 MWRez_Language_prefixnameStandaloneRezDebuggerDebug.h MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' MWWinRC_prefixname MWCodeGen_X86_processorGeneric MWCodeGen_X86_alignmentbytes8 MWCodeGen_X86_exceptionsZeroOverhead MWCodeGen_X86_name_manglingMWWin32 MWCodeGen_X86_use_extinst0 MWCodeGen_X86_extinst_mmx0 MWCodeGen_X86_extinst_3dnow0 MWCodeGen_X86_use_mmx_3dnow_convention0 MWCodeGen_X86_extinst_cmov0 MWCodeGen_X86_extinst_sse0 MWCodeGen_X86_extinst_sse20 MWCodeGen_X86_intrinsics0 MWCodeGen_X86_optimizeasm0 MWCodeGen_X86_disableopts0 MWCodeGen_X86_profile0 MWLinker_X86_runtimeCustom MWCodeGen_X86_readonlystrings0 MWCodeGen_X86_vectorize0 MWCodeGen_X86_relaxieee0 MWLinker_X86_subsysmajorid4 MWLinker_X86_subsysminorid0 MWCOFF_X86_opsysmajorid4 MWCOFF_X86_opsysminorid0 MWLinker_X86_usrmajorid0 MWLinker_X86_usrminorid0 MWProject_X86_maxstacksize1024 MWProject_X86_minstacksize4 MWProject_X86_size1024 MWProject_X86_minsize4 MWCOFF_X86_coff_flags0 MWCOFF_X86_dll_flags0 MWProject_X86_baseaddress4194304 MWCOFF_X86_filealign512 MWCOFF_X86_sectionalign4096 PDisasmX86_showHeaderstrue PDisasmX86_showSectHeaderstrue PDisasmX86_showSymTabtrue PDisasmX86_showCodetrue PDisasmX86_showDatatrue PDisasmX86_showDebugfalse PDisasmX86_showExceptionsfalse PDisasmX86_showRawfalse PDisasmX86_showAllRawfalse PDisasmX86_showSourcefalse PDisasmX86_showRelocationtrue PDisasmX86_showHextrue PDisasmX86_showCommentsfalse PDisasmX86_showSymDefstrue PDisasmX86_unmanglefalse PDisasmX86_verbosefalse PDisasmX86_resolveRelocstrue PDisasmX86_resolveLocalsfalse MWDebugger_X86_Exceptions 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 GlobalOptimizer_X86_optimizationlevelLevel0 GlobalOptimizer_X86_optforSpeed MWLinker_X86_entrypointusageDefault MWLinker_X86_entrypoint MWLinker_X86_subsystemWinGUI MWLinker_X86_commandfile MWLinker_X86_generatemap0 MWLinker_X86_linksym0 MWLinker_X86_linkCV1 MWLinker_X86_symfullpathfalse MWLinker_X86_linkdebugtrue MWLinker_X86_checksumfalse MWLinker_X86_zero_init_bssfalse MWLinker_X86_mergedatafalse MWLinker_X86_usedefaultlibsfalse MWLinker_X86_adddefaultlibsfalse MWLinker_X86_nowarningsfalse MWLinker_X86_verbosefalse MWLinker_X86_linkformemfalse MWLinker_X86_codefoldingNone MWLinker_X86_debuginlinefalse MWProject_X86_typeApplication MWProject_X86_outfilenoname.exe MWProject_X86_importlib MWProject_X86_setimportlibdirfalse MWProject_X86_dontgenerateimportlibfalse MWProject_X86_oldformatlibfalse MWProject_X86_replaceobjextensionfalse MWProject_X86_copyallfilesfalse Name AtomConstants.h Unix Text Name AtomConstants.cpp Unix Text Debug Name ArrayObject.h Unix Text Name ArrayObject.cpp Unix Text Debug Name ArrayClass.h Unix Text Name AbstractFunction.h Unix Text Name AbstractFunction.cpp Unix Text Debug Name AbcParser.h Unix Text Name AbcParser.cpp Unix Text Debug Name XMLParser16.h Unix Text Name XMLParser16.cpp Unix Text Debug Name XMLObject.h Unix Text Name XMLObject.cpp Unix Text Debug Name XMLListObject.h Unix Text Name XMLListObject.cpp Unix Text Debug Name XMLListClass.h Unix Text Name XMLListClass.cpp Unix Text Debug Name XMLClass.h Unix Text Name XMLClass.cpp Unix Text Debug Name ArrayClass.cpp Unix Text Debug Name ActionBlockConstants.h Unix Text Name ActionBlockConstants.cpp Unix Text Debug Name StringBuffer.h Unix Text Name StringBuffer.cpp Unix Text Debug Name StaticProfiler.h Unix Text Name StaticProfiler.cpp Unix Text Debug Name StackTrace.h Unix Text Name StackTrace.cpp Unix Text Debug Name StringClass.h Unix Text Name Verifier.h Unix Text Name Verifier.cpp Unix Text Debug Name Accessor.h Unix Text Name Accessor.cpp Unix Text Debug Name ScriptObject.h Unix Text Name ScriptObject.cpp Unix Text Debug Name ScriptBuffer.h Unix Text Name ScriptBuffer.cpp Unix Text Debug Name ScopeChain.h Unix Text Name ScopeChain.cpp Unix Text Debug Name RegExpObject.h Unix Text Name RegExpObject.cpp Unix Text Debug Name RegExpClass.h Unix Text Name RegExpClass.cpp Unix Text Debug Name StringClass.cpp Unix Text Debug Name PrintWriter.h Unix Text Name PrintWriter.cpp Unix Text Debug Name PoolObject.h Unix Text Name PoolObject.cpp Unix Text Debug Name Interpreter.h Unix Text Name Interpreter.cpp Unix Text Debug Name IntClass.h Unix Text Name IntClass.cpp Unix Text Debug Name NativeObjectHelpers.h Unix Text Name OSDep.h Unix Text Name OutputStream.h Unix Text Name ObjectClass.h Unix Text Name ObjectClass.cpp Unix Text Debug Name NumberClass.h Unix Text Name NumberClass.cpp Unix Text Debug Name MethodInfo.h Unix Text Name MethodInfo.cpp Unix Text Debug Name MethodClosure.h Unix Text Name MethodClosure.cpp Unix Text Debug Name MathUtils.h Unix Text Name Namespace.cpp Unix Text Debug Name Multiname.h Unix Text Name Multiname.cpp Unix Text Debug Name NativeFunction.h Unix Text Name NativeFunction.cpp Unix Text Debug Name NamespaceClass.h Unix Text Name NamespaceClass.cpp Unix Text Debug Name Namespace.h Unix Text Name Toplevel.cpp Unix Text Debug Name StringObject.h Unix Text Name StringObject.cpp Unix Text Debug Name UnicodeUtils.h Unix Text Name UnicodeUtils.cpp Unix Text Debug Name types.h Unix Text Name Traits.h Unix Text Name Traits.cpp Unix Text Debug Name Toplevel.h Unix Text Name Exception.cpp Unix Text Debug Name ErrorConstants.h Unix Text Name ErrorClass.h Unix Text Name FunctionClass.h Unix Text Name FunctionClass.cpp Unix Text Debug Name FrameState.h Unix Text Name FrameState.cpp Unix Text Debug Name Exception.h Unix Text Name ErrorClass.cpp Unix Text Debug Name MathUtils.cpp Unix Text Debug Name MathClass.h Unix Text Name MathClass.cpp Unix Text Debug Name ClassClosure.h Unix Text Name ClassClass.h Unix Text Name ClassClass.cpp Unix Text Debug Name BuiltinTraits.h Unix Text Name ClassClosure.cpp Unix Text Debug Name BuiltinTraits.cpp Unix Text Debug Name DynamicProfiler.h Unix Text Name DynamicProfiler.cpp Unix Text Debug Name DateObject.h Unix Text Name DateObject.cpp Unix Text Debug Name DateClass.h Unix Text Name builtin.cpp Unix Text Debug Name DateClass.cpp Unix Text Debug Name Date.h Unix Text Name Date.cpp Unix Text Debug Name avmplusDebugger.h Unix Text Name avmplusDebugger.cpp Unix Text Debug Name avmplus.h Unix Text Name avmplus.cpp Unix Text Debug Name AvmDebug.h Unix Text Name avmbuild.h Unix Text Name BooleanClass.h Unix Text Name BooleanClass.cpp Unix Text Debug Name avmplusVersion.h Unix Text Name ErrorConstants.cpp Unix Text Debug Name avmplusProfiler.h Unix Text Name avmplusHashtable.h Unix Text Name avmplusHashtable.cpp Unix Text Debug Name AvmCore.h Unix Text Name AvmCore.cpp Unix Text Debug Name OSDepMac.cpp Unix Text Debug Name NativeFunctionMac.cpp Unix Text Debug Name MathUtilsMac.cpp Unix Text Debug Name avmplusStack.h Unix Text Name AvmDebugMac.cpp Unix Text Debug Name macprefix_debuggerdebug.pch++ Unix Text Debug Name MethodEnv.h Unix Text Name MethodEnv.cpp Unix Text Debug Name AbcEnv.h Unix Text Name AbcEnv.cpp Unix Text Debug Name VTable.cpp Unix Text Debug Name VTable.h Unix Text Name CodegenMIR.h Unix Text Name BigInteger.cpp Unix Text Debug Name BigInteger.h Unix Text Name AtomArray.h Unix Text Name AtomArray.cpp Unix Text Debug Name avmplusProfiler.cpp Unix Text Debug Name CodegenMIR.cpp Unix Text Debug Name DateMac.cpp Unix Text Debug Name DateMac.h Unix Text Name MultinameHashtable.h Unix Text Name MultinameHashtable.cpp Unix Text Debug Name NamespaceSet.h Unix Text Name NamespaceSet.cpp Unix Text Debug Name DomainEnv.h Unix Text Name DomainEnv.cpp Unix Text Debug Name Domain.h Unix Text Name Domain.cpp Unix Text Debug Name GrowableBuffer.h Unix Text Name GrowableBuffer.cpp Unix Text Debug Name AbcGen.h Unix Text Name AbcGen.cpp Unix Text Debug Name E4XNode.h Unix Text Name E4XNode.cpp Unix Text Debug Name PpcAssembler.cpp Unix Text Debug Name pcre_info.cpp Unix Text Debug Name pcre_globals.cpp Unix Text Debug Name pcre_get.cpp Unix Text Debug Name pcre_fullinfo.cpp Unix Text Debug Name pcre_exec.cpp Unix Text Debug Name pcre_config.cpp Unix Text Debug Name pcre_compile.cpp Unix Text Debug Name pcre_chartables.cpp Unix Text Debug Name pcre_ord2utf8.cpp Unix Text Debug Name pcre_maketables.cpp Unix Text Debug Name pcre_refcount.cpp Unix Text Debug Name pcre_valid_utf8.cpp Unix Text Debug Name pcre_try_flipped.cpp Unix Text Debug Name pcre_tables.cpp Unix Text Debug Name pcre_study.cpp Unix Text Debug Name pcre.h Unix Text Name pcre_xclass.cpp Unix Text Debug Name pcre_version.cpp Unix Text Debug Name AvmPlusScriptableObject.cpp Unix Text Debug Name AvmPlusScriptableObject.h Unix Text Name AtomConstants.h Unix Name AtomConstants.cpp Unix Name ArrayObject.h Unix Name ArrayObject.cpp Unix Name ArrayClass.h Unix Name AbstractFunction.h Unix Name AbstractFunction.cpp Unix Name AbcParser.h Unix Name AbcParser.cpp Unix Name XMLParser16.h Unix Name XMLParser16.cpp Unix Name XMLObject.h Unix Name XMLObject.cpp Unix Name XMLListObject.h Unix Name XMLListObject.cpp Unix Name XMLListClass.h Unix Name XMLListClass.cpp Unix Name XMLClass.h Unix Name XMLClass.cpp Unix Name ArrayClass.cpp Unix Name ActionBlockConstants.h Unix Name ActionBlockConstants.cpp Unix Name StringBuffer.h Unix Name StringBuffer.cpp Unix Name StaticProfiler.h Unix Name StaticProfiler.cpp Unix Name StackTrace.h Unix Name StackTrace.cpp Unix Name StringClass.h Unix Name Verifier.h Unix Name Verifier.cpp Unix Name Accessor.h Unix Name Accessor.cpp Unix Name ScriptObject.h Unix Name ScriptObject.cpp Unix Name ScriptBuffer.h Unix Name ScriptBuffer.cpp Unix Name ScopeChain.h Unix Name ScopeChain.cpp Unix Name RegExpObject.h Unix Name RegExpObject.cpp Unix Name RegExpClass.h Unix Name RegExpClass.cpp Unix Name StringClass.cpp Unix Name PrintWriter.h Unix Name PrintWriter.cpp Unix Name PoolObject.h Unix Name PoolObject.cpp Unix Name Interpreter.h Unix Name Interpreter.cpp Unix Name IntClass.h Unix Name IntClass.cpp Unix Name NativeObjectHelpers.h Unix Name OSDep.h Unix Name OutputStream.h Unix Name ObjectClass.h Unix Name ObjectClass.cpp Unix Name NumberClass.h Unix Name NumberClass.cpp Unix Name MethodInfo.h Unix Name MethodInfo.cpp Unix Name MethodClosure.h Unix Name MethodClosure.cpp Unix Name MathUtils.h Unix Name Namespace.cpp Unix Name Multiname.h Unix Name Multiname.cpp Unix Name NativeFunction.h Unix Name NativeFunction.cpp Unix Name NamespaceClass.h Unix Name NamespaceClass.cpp Unix Name Namespace.h Unix Name Toplevel.cpp Unix Name StringObject.h Unix Name StringObject.cpp Unix Name UnicodeUtils.h Unix Name UnicodeUtils.cpp Unix Name types.h Unix Name Traits.h Unix Name Traits.cpp Unix Name Toplevel.h Unix Name Exception.cpp Unix Name ErrorConstants.h Unix Name ErrorClass.h Unix Name FunctionClass.h Unix Name FunctionClass.cpp Unix Name FrameState.h Unix Name FrameState.cpp Unix Name Exception.h Unix Name ErrorClass.cpp Unix Name MathUtils.cpp Unix Name MathClass.h Unix Name MathClass.cpp Unix Name ClassClosure.h Unix Name ClassClass.h Unix Name ClassClass.cpp Unix Name BuiltinTraits.h Unix Name ClassClosure.cpp Unix Name BuiltinTraits.cpp Unix Name DynamicProfiler.h Unix Name DynamicProfiler.cpp Unix Name DateObject.h Unix Name DateObject.cpp Unix Name DateClass.h Unix Name builtin.cpp Unix Name DateClass.cpp Unix Name Date.h Unix Name Date.cpp Unix Name avmplusDebugger.h Unix Name avmplusDebugger.cpp Unix Name avmplus.h Unix Name avmplus.cpp Unix Name AvmDebug.h Unix Name avmbuild.h Unix Name BooleanClass.h Unix Name BooleanClass.cpp Unix Name avmplusVersion.h Unix Name ErrorConstants.cpp Unix Name avmplusProfiler.h Unix Name avmplusHashtable.h Unix Name avmplusHashtable.cpp Unix Name AvmCore.h Unix Name AvmCore.cpp Unix Name OSDepMac.cpp Unix Name NativeFunctionMac.cpp Unix Name MathUtilsMac.cpp Unix Name avmplusStack.h Unix Name AvmDebugMac.cpp Unix Name macprefix_debuggerdebug.pch++ Unix Name MethodEnv.h Unix Name MethodEnv.cpp Unix Name AbcEnv.h Unix Name AbcEnv.cpp Unix Name VTable.cpp Unix Name VTable.h Unix Name CodegenMIR.h Unix Name BigInteger.cpp Unix Name BigInteger.h Unix Name AtomArray.h Unix Name AtomArray.cpp Unix Name avmplusProfiler.cpp Unix Name CodegenMIR.cpp Unix Name DateMac.cpp Unix Name DateMac.h Unix Name MultinameHashtable.h Unix Name MultinameHashtable.cpp Unix Name NamespaceSet.h Unix Name NamespaceSet.cpp Unix Name DomainEnv.h Unix Name DomainEnv.cpp Unix Name Domain.h Unix Name Domain.cpp Unix Name GrowableBuffer.h Unix Name GrowableBuffer.cpp Unix Name AbcGen.h Unix Name AbcGen.cpp Unix Name E4XNode.h Unix Name E4XNode.cpp Unix Name PpcAssembler.cpp Unix Name pcre_info.cpp Unix Name pcre_globals.cpp Unix Name pcre_get.cpp Unix Name pcre_fullinfo.cpp Unix Name pcre_exec.cpp Unix Name pcre_config.cpp Unix Name pcre_compile.cpp Unix Name pcre_chartables.cpp Unix Name pcre_ord2utf8.cpp Unix Name pcre_maketables.cpp Unix Name pcre_refcount.cpp Unix Name pcre_valid_utf8.cpp Unix Name pcre_try_flipped.cpp Unix Name pcre_tables.cpp Unix Name pcre_study.cpp Unix Name pcre.h Unix Name pcre_xclass.cpp Unix Name pcre_version.cpp Unix Name AvmPlusScriptableObject.cpp Unix Name AvmPlusScriptableObject.h Unix Carbon D-Rel UserSourceTrees AlwaysSearchUserPathsfalse InterpretDOSAndUnixPathsfalse RequireFrameworkStyleIncludesfalse SourceRelativeIncludesfalse UserSearchPaths SearchPath Path../../core PathFormatUnix PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path../../MMgc PathFormatUnix PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path PathFormatUnix PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path::: PathFormatMacOS PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path::::::vendors:CarbonLib_1.6GM_SDK: PathFormatMacOS PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path../../pcre PathFormatUnix PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SystemSearchPaths SearchPath Path::::::vendors:CarbonLib_1.6GM_SDK: PathFormatMacOS PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path:MSL:MSL_C:MSL_Common:Include: PathFormatMacOS PathRootCodeWarrior Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path:MacOS Support:MacHeaders: PathFormatMacOS PathRootCodeWarrior Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path:MacOS Support: PathFormatMacOS PathRootCodeWarrior Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path:MSL: PathFormatMacOS PathRootCodeWarrior Recursivetrue FrameworkPathfalse HostFlagsAll MWRuntimeSettings_WorkingDirectory MWRuntimeSettings_CommandLine MWRuntimeSettings_HostApplication Path PathFormatGeneric PathRootAbsolute MWRuntimeSettings_EnvVars LinkerMacOS PPC Linker PreLinker PostLinker TargetnameCarbon D-Rel OutputDirectory Path: PathFormatMacOS PathRootProject SaveEntriesUsingRelativePathsfalse FileMappings FileTypeAPPL FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeAppl FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeMMLB FileExtension CompilerLib Import PPC EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMPLF FileExtension CompilerLib Import PPC EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMWCD FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeRSRC FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeTEXT FileExtension.arr Compiler EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.bh CompilerBalloon Help EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.c CompilerMW C/C++ PPC EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.c++ CompilerMW C/C++ PPC EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cc CompilerMW C/C++ PPC EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cp CompilerMW C/C++ PPC EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cpp CompilerMW C/C++ PPC EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.exp Compiler EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.h CompilerMW C/C++ PPC EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileTypeTEXT FileExtension.pch CompilerMW C/C++ PPC EditLanguageC/C++ Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pch++ CompilerMW C/C++ PPC EditLanguageC/C++ Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.r CompilerRez EditLanguageRez Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.s CompilerPPCAsm EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeXCOF FileExtension CompilerXCOFF Import PPC EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypedocu FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypersrc FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeshlb FileExtension CompilerPEF Import PPC EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypestub FileExtension CompilerPEF Import PPC EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileExtension.doc Compiler EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue FileExtension.o CompilerXCOFF Import PPC EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileExtension.ppob Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileExtension.rsrc Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse CacheModDatestrue DumpBrowserInfofalse CacheSubprojectstrue UseThirdPartyDebuggerfalse BrowserGenerator1 DebuggerAppPath Path PathFormatGeneric PathRootAbsolute DebuggerCmdLineArgs DebuggerWorkingDir Path PathFormatGeneric PathRootAbsolute CodeCompletionPrefixFileNameMacHeaders.c CodeCompletionMacroFileNameMacOS_Carbon_C++_Macros.h ConsoleEncoding0 LogSystemMessagestrue AutoTargetDLLsPopUp0 StopAtWatchpointstrue PauseWhileRunningfalse PauseInterval5 PauseUIFlags0 AltExePath Path PathFormatGeneric PathRootAbsolute StopAtTempBPOnLaunchtrue CacheSymbolicstrue TempBPFunctionNamemain TempBPType0 Enabledfalse ConnectionName DownloadPath LaunchRemoteAppfalse RemoteAppPath CoreID0 JTAGClockSpeed8000 IsMultiCorefalse OSDownloadfalse UseGlobalOSDownloadfalse OSDownloadConnectionName OSDownloadPath AltDownloadfalse AltDownloadConnectionName OtherExecutables AnalyzerConnectionName CustomColor1 Red0 Green32767 Blue0 CustomColor2 Red0 Green32767 Blue0 CustomColor3 Red0 Green32767 Blue0 CustomColor4 Red0 Green32767 Blue0 MWFrontEnd_C_cplusplus0 MWFrontEnd_C_checkprotos0 MWFrontEnd_C_arm0 MWFrontEnd_C_trigraphs0 MWFrontEnd_C_onlystdkeywords0 MWFrontEnd_C_enumsalwaysint1 MWFrontEnd_C_ansistrict0 MWFrontEnd_C_wchar_type1 MWFrontEnd_C_enableexceptions0 MWFrontEnd_C_dontreusestrings0 MWFrontEnd_C_poolstrings0 MWFrontEnd_C_dontinline0 MWFrontEnd_C_useRTTI0 MWFrontEnd_C_unsignedchars0 MWFrontEnd_C_autoinline0 MWFrontEnd_C_booltruefalse1 MWFrontEnd_C_inlinelevel8 MWFrontEnd_C_ecplusplus0 MWFrontEnd_C_defer_codegen1 MWFrontEnd_C_templateparser0 MWFrontEnd_C_c990 MWFrontEnd_C_bottomupinline1 MWFrontEnd_C_gcc_extensions0 MWFrontEnd_C_instance_manager0 C_CPP_Preprocessor_EmitFiletrue C_CPP_Preprocessor_EmitLinefalse C_CPP_Preprocessor_EmitFullPathfalse C_CPP_Preprocessor_KeepCommentsfalse C_CPP_Preprocessor_PCHUsesPrefixTextfalse C_CPP_Preprocessor_EmitPragmastrue C_CPP_Preprocessor_KeepWhiteSpacefalse C_CPP_Preprocessor_MultiByteEncodingencAutoDetectMultibyte C_CPP_Preprocessor_PrefixText#if !__option(precompile) #include "macprefix_debuggerrel.mch++" #endif MWWarning_C_warn_illpragma1 MWWarning_C_warn_emptydecl1 MWWarning_C_warn_possunwant1 MWWarning_C_warn_unusedvar1 MWWarning_C_warn_unusedarg0 MWWarning_C_warn_extracomma0 MWWarning_C_pedantic1 MWWarning_C_warningerrors0 MWWarning_C_warn_hidevirtual0 MWWarning_C_warn_implicitconv0 MWWarning_C_warn_notinlined0 MWWarning_C_warn_structclass1 MWWarning_C_warn_missingreturn0 MWWarning_C_warn_no_side_effect0 MWWarning_C_warn_resultnotused0 MWWarning_C_warn_padding0 MWWarning_C_warn_impl_i2f_conv0 MWWarning_C_warn_impl_f2i_conv0 MWWarning_C_warn_impl_s2u_conv0 MWWarning_C_warn_illtokenpasting0 MWWarning_C_warn_filenamecaps0 MWWarning_C_warn_filenamecapssystem0 MWWarning_C_warn_undefmacro0 MWWarning_C_warn_ptrintconv1 MWMerge_MacOS_projectTypeApplication MWMerge_MacOS_outputNameMerge Out MWMerge_MacOS_outputCreator???? MWMerge_MacOS_outputTypeAPPL MWMerge_MacOS_suppressWarning0 MWMerge_MacOS_copyFragments1 MWMerge_MacOS_copyResources1 MWMerge_MacOS_flattenResource0 MWMerge_MacOS_flatFileNamea.rsrc MWMerge_MacOS_flatFileOutputPath Path: PathFormatMacOS PathRootProject MWMerge_MacOS_skipResources DLGX ckid Proj WSPC FileLockedfalse ResourcesMapIsReadOnlyfalse PrinterDriverIsMultiFinderCompatiblefalse Invisiblefalse HasBundlefalse NameLockedfalse Stationeryfalse HasCustomIconfalse Sharedfalse HasBeenInitedfalse Label0 Comments HasCustomBadgefalse HasRoutingInfofalse MWCodeGen_PPC_structalignmentPPC_mw MWCodeGen_PPC_tracebacktablesNone MWCodeGen_PPC_processorGeneric MWCodeGen_PPC_function_align4 MWCodeGen_PPC_tocdata1 MWCodeGen_PPC_largetoc0 MWCodeGen_PPC_profiler0 MWCodeGen_PPC_vectortocdata1 MWCodeGen_PPC_poolconst0 MWCodeGen_PPC_peephole1 MWCodeGen_PPC_readonlystrings0 MWCodeGen_PPC_linkerpoolsstrings0 MWCodeGen_PPC_volatileasm0 MWCodeGen_PPC_schedule0 MWCodeGen_PPC_altivec1 MWCodeGen_PPC_altivec_move_block0 MWCodeGen_PPC_strictIEEEfp0 MWCodeGen_PPC_fpcontract1 MWCodeGen_PPC_genfsel0 MWCodeGen_PPC_orderedfpcmp0 MWCodeGen_MachO_structalignmentPPC_mw MWCodeGen_MachO_profiler_enumOff MWCodeGen_MachO_processorGeneric MWCodeGen_MachO_function_align4 MWCodeGen_MachO_common0 MWCodeGen_MachO_boolisint0 MWCodeGen_MachO_peephole1 MWCodeGen_MachO_readonlystrings0 MWCodeGen_MachO_linkerpoolsstrings1 MWCodeGen_MachO_volatileasm0 MWCodeGen_MachO_schedule0 MWCodeGen_MachO_altivec0 MWCodeGen_MachO_vecmove0 MWCodeGen_MachO_fp_ieee_strict0 MWCodeGen_MachO_fpcontract1 MWCodeGen_MachO_genfsel0 MWCodeGen_MachO_fp_cmps_ordered0 MWDisassembler_PPC_showcode1 MWDisassembler_PPC_extended1 MWDisassembler_PPC_mix0 MWDisassembler_PPC_nohex0 MWDisassembler_PPC_showdata1 MWDisassembler_PPC_showexceptions1 MWDisassembler_PPC_showsym0 MWDisassembler_PPC_shownames1 GlobalOptimizer_PPC_optimizationlevelLevel4 GlobalOptimizer_PPC_optforSpeed MWLinker_PPC_linksym1 MWLinker_PPC_symfullpath1 MWLinker_PPC_linkmap1 MWLinker_PPC_nolinkwarnings0 MWLinker_PPC_dontdeadstripinitcode0 MWLinker_PPC_permitmultdefs0 MWLinker_PPC_linkmodeFast MWLinker_PPC_code_foldingNone MWLinker_PPC_initname MWLinker_PPC_mainname__start MWLinker_PPC_termname MWLinker_MacOSX_linksym0 MWLinker_MacOSX_symfullpath0 MWLinker_MacOSX_nolinkwarnings0 MWLinker_MacOSX_linkmap0 MWLinker_MacOSX_dontdeadstripinitcode0 MWLinker_MacOSX_permitmultdefs1 MWLinker_MacOSX_use_objectivec_semantics0 MWLinker_MacOSX_strip_debug_symbols0 MWLinker_MacOSX_prebind_all_twolevel_modules0 MWLinker_MacOSX_data_before_text_segment0 MWLinker_MacOSX_report_msl_overloads0 MWLinker_MacOSX_objects_follow_linkorder0 MWLinker_MacOSX_linkmodeFast MWLinker_MacOSX_exportsReferencedGlobals MWLinker_MacOSX_sortcodeNone MWLinker_MacOSX_mainnamestart MWLinker_MacOSX_initname MWLinker_MacOSX_code_foldingNone MWLinker_MacOSX_stabsgenNone MWProject_MacOSX_typeExecutable MWProject_MacOSX_outfileFlash Carbon DebuggerRel MWProject_MacOSX_filecreatorSWF2 MWProject_MacOSX_filetypeAPPL MWProject_MacOSX_vmaddress4096 MWProject_MacOSX_usedefaultvmaddr1 MWProject_MacOSX_flatrsrc0 MWProject_MacOSX_flatrsrcfilename MWProject_MacOSX_flatrsrcoutputdir Path: PathFormatMacOS PathRootProject MWProject_MacOSX_installpath./ MWProject_MacOSX_dont_prebind0 MWProject_MacOSX_flat_namespace0 MWProject_MacOSX_frameworkversionA MWProject_MacOSX_currentversion0 MWProject_MacOSX_flat_oldimpversion0 MWProject_MacOSX_AddrMode0 MWPEF_exportsNone MWPEF_libfolder0 MWPEF_sortcodeNone MWPEF_expandbss0 MWPEF_sharedata0 MWPEF_olddefversion0 MWPEF_oldimpversion0 MWPEF_currentversion0 MWPEF_fragmentname MWPEF_collapsereloads1 MWProject_PPC_typeLibrary MWProject_PPC_outfileavmplus_carbon_drel.lib MWProject_PPC_filecreator???? MWProject_PPC_filetype???? MWProject_PPC_size0 MWProject_PPC_minsize0 MWProject_PPC_stacksize0 MWProject_PPC_flags0 MWProject_PPC_symfilename MWProject_PPC_rsrcname MWProject_PPC_rsrcheaderNative MWProject_PPC_rsrctype???? MWProject_PPC_rsrcid0 MWProject_PPC_rsrcflags0 MWProject_PPC_rsrcstore0 MWProject_PPC_rsrcmerge0 MWProject_PPC_flatrsrc0 MWProject_PPC_flatrsrcoutputdir Path: PathFormatMacOS PathRootProject MWProject_PPC_flatrsrcfilename MWAssembler_PPC_auxheader0 MWAssembler_PPC_symmodeMac MWAssembler_PPC_dialectPPC MWAssembler_PPC_prefixfile MWAssembler_PPC_typecheck0 MWAssembler_PPC_warnings0 MWAssembler_PPC_casesensitive0 PList_OutputTypeFile PList_OutputEncodingUTF-8 PList_PListVersion0.9 PList_Prefix PList_FileFilenameInfo.plist PList_FileDirectory Path: PathFormatMacOS PathRootProject PList_ResourceTypeplst PList_ResourceID0 PList_ResourceName MWRez_Language_maxwidth80 MWRez_Language_scriptRoman MWRez_Language_alignmentAlign1 MWRez_Language_filtermodeFilterSkip MWRez_Language_suppresswarnings0 MWRez_Language_escapecontrolchars1 MWRez_Language_prefixnameStandaloneRezDebugger.h MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' MWWinRC_prefixname MWCodeGen_X86_processorGeneric MWCodeGen_X86_alignmentbytes8 MWCodeGen_X86_exceptionsZeroOverhead MWCodeGen_X86_name_manglingMWWin32 MWCodeGen_X86_use_extinst0 MWCodeGen_X86_extinst_mmx0 MWCodeGen_X86_extinst_3dnow0 MWCodeGen_X86_use_mmx_3dnow_convention0 MWCodeGen_X86_extinst_cmov0 MWCodeGen_X86_extinst_sse0 MWCodeGen_X86_extinst_sse20 MWCodeGen_X86_intrinsics0 MWCodeGen_X86_optimizeasm0 MWCodeGen_X86_disableopts0 MWCodeGen_X86_profile0 MWLinker_X86_runtimeCustom MWCodeGen_X86_readonlystrings0 MWCodeGen_X86_vectorize0 MWCodeGen_X86_relaxieee0 MWLinker_X86_subsysmajorid4 MWLinker_X86_subsysminorid0 MWCOFF_X86_opsysmajorid4 MWCOFF_X86_opsysminorid0 MWLinker_X86_usrmajorid0 MWLinker_X86_usrminorid0 MWProject_X86_maxstacksize1024 MWProject_X86_minstacksize4 MWProject_X86_size1024 MWProject_X86_minsize4 MWCOFF_X86_coff_flags0 MWCOFF_X86_dll_flags0 MWProject_X86_baseaddress4194304 MWCOFF_X86_filealign512 MWCOFF_X86_sectionalign4096 PDisasmX86_showHeaderstrue PDisasmX86_showSectHeaderstrue PDisasmX86_showSymTabtrue PDisasmX86_showCodetrue PDisasmX86_showDatatrue PDisasmX86_showDebugfalse PDisasmX86_showExceptionsfalse PDisasmX86_showRawfalse PDisasmX86_showAllRawfalse PDisasmX86_showSourcefalse PDisasmX86_showRelocationtrue PDisasmX86_showHextrue PDisasmX86_showCommentsfalse PDisasmX86_showSymDefstrue PDisasmX86_unmanglefalse PDisasmX86_verbosefalse PDisasmX86_resolveRelocstrue PDisasmX86_resolveLocalsfalse MWDebugger_X86_Exceptions 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 GlobalOptimizer_X86_optimizationlevelLevel0 GlobalOptimizer_X86_optforSpeed MWLinker_X86_entrypointusageDefault MWLinker_X86_entrypoint MWLinker_X86_subsystemWinGUI MWLinker_X86_commandfile MWLinker_X86_generatemap0 MWLinker_X86_linksym0 MWLinker_X86_linkCV1 MWLinker_X86_symfullpathfalse MWLinker_X86_linkdebugtrue MWLinker_X86_checksumfalse MWLinker_X86_zero_init_bssfalse MWLinker_X86_mergedatafalse MWLinker_X86_usedefaultlibsfalse MWLinker_X86_adddefaultlibsfalse MWLinker_X86_nowarningsfalse MWLinker_X86_verbosefalse MWLinker_X86_linkformemfalse MWLinker_X86_codefoldingNone MWLinker_X86_debuginlinefalse MWProject_X86_typeApplication MWProject_X86_outfilenoname.exe MWProject_X86_importlib MWProject_X86_setimportlibdirfalse MWProject_X86_dontgenerateimportlibfalse MWProject_X86_oldformatlibfalse MWProject_X86_replaceobjextensionfalse MWProject_X86_copyallfilesfalse Name AtomConstants.h Unix Text Name AtomConstants.cpp Unix Text Debug Name ArrayObject.h Unix Text Name ArrayObject.cpp Unix Text Debug Name ArrayClass.h Unix Text Name AbstractFunction.h Unix Text Name AbstractFunction.cpp Unix Text Debug Name AbcParser.h Unix Text Name AbcParser.cpp Unix Text Debug Name XMLParser16.h Unix Text Name XMLParser16.cpp Unix Text Debug Name XMLObject.h Unix Text Name XMLObject.cpp Unix Text Debug Name XMLListObject.h Unix Text Name XMLListObject.cpp Unix Text Debug Name XMLListClass.h Unix Text Name XMLListClass.cpp Unix Text Debug Name XMLClass.h Unix Text Name XMLClass.cpp Unix Text Debug Name ArrayClass.cpp Unix Text Debug Name ActionBlockConstants.h Unix Text Name ActionBlockConstants.cpp Unix Text Debug Name StringBuffer.h Unix Text Name StringBuffer.cpp Unix Text Debug Name StaticProfiler.h Unix Text Name StaticProfiler.cpp Unix Text Debug Name StackTrace.h Unix Text Name StackTrace.cpp Unix Text Debug Name StringClass.h Unix Text Name Verifier.h Unix Text Name Verifier.cpp Unix Text Debug Name Accessor.h Unix Text Name Accessor.cpp Unix Text Debug Name ScriptObject.h Unix Text Name ScriptObject.cpp Unix Text Debug Name ScriptBuffer.h Unix Text Name ScriptBuffer.cpp Unix Text Debug Name ScopeChain.h Unix Text Name ScopeChain.cpp Unix Text Debug Name RegExpObject.h Unix Text Name RegExpObject.cpp Unix Text Debug Name RegExpClass.h Unix Text Name RegExpClass.cpp Unix Text Debug Name StringClass.cpp Unix Text Debug Name PrintWriter.h Unix Text Name PrintWriter.cpp Unix Text Debug Name PoolObject.h Unix Text Name PoolObject.cpp Unix Text Debug Name Interpreter.h Unix Text Name Interpreter.cpp Unix Text Debug Name IntClass.h Unix Text Name IntClass.cpp Unix Text Debug Name NativeObjectHelpers.h Unix Text Name OSDep.h Unix Text Name OutputStream.h Unix Text Name ObjectClass.h Unix Text Name ObjectClass.cpp Unix Text Debug Name NumberClass.h Unix Text Name NumberClass.cpp Unix Text Debug Name MethodInfo.h Unix Text Name MethodInfo.cpp Unix Text Debug Name MethodClosure.h Unix Text Name MethodClosure.cpp Unix Text Debug Name MathUtils.h Unix Text Name Namespace.cpp Unix Text Debug Name Multiname.h Unix Text Name Multiname.cpp Unix Text Debug Name NativeFunction.h Unix Text Name NativeFunction.cpp Unix Text Debug Name NamespaceClass.h Unix Text Name NamespaceClass.cpp Unix Text Debug Name Namespace.h Unix Text Name Toplevel.cpp Unix Text Debug Name StringObject.h Unix Text Name StringObject.cpp Unix Text Debug Name UnicodeUtils.h Unix Text Name UnicodeUtils.cpp Unix Text Debug Name types.h Unix Text Name Traits.h Unix Text Name Traits.cpp Unix Text Debug Name Toplevel.h Unix Text Name Exception.cpp Unix Text Debug Name ErrorConstants.h Unix Text Name ErrorClass.h Unix Text Name FunctionClass.h Unix Text Name FunctionClass.cpp Unix Text Debug Name FrameState.h Unix Text Name FrameState.cpp Unix Text Debug Name Exception.h Unix Text Name ErrorClass.cpp Unix Text Debug Name MathUtils.cpp Unix Text Debug Name MathClass.h Unix Text Name MathClass.cpp Unix Text Debug Name ClassClosure.h Unix Text Name ClassClass.h Unix Text Name ClassClass.cpp Unix Text Debug Name BuiltinTraits.h Unix Text Name ClassClosure.cpp Unix Text Debug Name BuiltinTraits.cpp Unix Text Debug Name DynamicProfiler.h Unix Text Name DynamicProfiler.cpp Unix Text Debug Name DateObject.h Unix Text Name DateObject.cpp Unix Text Debug Name DateClass.h Unix Text Name builtin.cpp Unix Text Debug Name DateClass.cpp Unix Text Debug Name Date.h Unix Text Name Date.cpp Unix Text Debug Name avmplusDebugger.h Unix Text Name avmplusDebugger.cpp Unix Text Debug Name avmplus.h Unix Text Name avmplus.cpp Unix Text Debug Name AvmDebug.h Unix Text Name avmbuild.h Unix Text Name BooleanClass.h Unix Text Name BooleanClass.cpp Unix Text Debug Name avmplusVersion.h Unix Text Name ErrorConstants.cpp Unix Text Debug Name avmplusProfiler.h Unix Text Name avmplusHashtable.h Unix Text Name avmplusHashtable.cpp Unix Text Debug Name AvmCore.h Unix Text Name AvmCore.cpp Unix Text Debug Name OSDepMac.cpp Unix Text Debug Name NativeFunctionMac.cpp Unix Text Debug Name MathUtilsMac.cpp Unix Text Debug Name avmplusStack.h Unix Text Name AvmDebugMac.cpp Unix Text Debug Name macprefix_debuggerrel.pch++ Unix Text Debug Name MethodEnv.h Unix Text Name MethodEnv.cpp Unix Text Debug Name AbcEnv.h Unix Text Name AbcEnv.cpp Unix Text Debug Name VTable.cpp Unix Text Debug Name VTable.h Unix Text Name CodegenMIR.h Unix Text Name BigInteger.cpp Unix Text Debug Name BigInteger.h Unix Text Name AtomArray.h Unix Text Name AtomArray.cpp Unix Text Debug Name avmplusProfiler.cpp Unix Text Debug Name CodegenMIR.cpp Unix Text Debug Name DateMac.cpp Unix Text Debug Name DateMac.h Unix Text Name MultinameHashtable.h Unix Text Name MultinameHashtable.cpp Unix Text Debug Name NamespaceSet.h Unix Text Name NamespaceSet.cpp Unix Text Debug Name DomainEnv.h Unix Text Name DomainEnv.cpp Unix Text Debug Name Domain.h Unix Text Name Domain.cpp Unix Text Debug Name GrowableBuffer.h Unix Text Name GrowableBuffer.cpp Unix Text Debug Name AbcGen.h Unix Text Name AbcGen.cpp Unix Text Debug Name E4XNode.h Unix Text Name E4XNode.cpp Unix Text Debug Name PpcAssembler.cpp Unix Text Debug Name pcre_info.cpp Unix Text Debug Name pcre_globals.cpp Unix Text Debug Name pcre_get.cpp Unix Text Debug Name pcre_fullinfo.cpp Unix Text Debug Name pcre_exec.cpp Unix Text Debug Name pcre_config.cpp Unix Text Debug Name pcre_compile.cpp Unix Text Debug Name pcre_chartables.cpp Unix Text Debug Name pcre_ord2utf8.cpp Unix Text Debug Name pcre_maketables.cpp Unix Text Debug Name pcre_refcount.cpp Unix Text Debug Name pcre_valid_utf8.cpp Unix Text Debug Name pcre_try_flipped.cpp Unix Text Debug Name pcre_tables.cpp Unix Text Debug Name pcre_study.cpp Unix Text Debug Name pcre.h Unix Text Name pcre_xclass.cpp Unix Text Debug Name pcre_version.cpp Unix Text Debug Name AvmPlusScriptableObject.cpp Unix Text Debug Name AvmPlusScriptableObject.h Unix Text Name AtomConstants.h Unix Name AtomConstants.cpp Unix Name ArrayObject.h Unix Name ArrayObject.cpp Unix Name ArrayClass.h Unix Name AbstractFunction.h Unix Name AbstractFunction.cpp Unix Name AbcParser.h Unix Name AbcParser.cpp Unix Name XMLParser16.h Unix Name XMLParser16.cpp Unix Name XMLObject.h Unix Name XMLObject.cpp Unix Name XMLListObject.h Unix Name XMLListObject.cpp Unix Name XMLListClass.h Unix Name XMLListClass.cpp Unix Name XMLClass.h Unix Name XMLClass.cpp Unix Name ArrayClass.cpp Unix Name ActionBlockConstants.h Unix Name ActionBlockConstants.cpp Unix Name StringBuffer.h Unix Name StringBuffer.cpp Unix Name StaticProfiler.h Unix Name StaticProfiler.cpp Unix Name StackTrace.h Unix Name StackTrace.cpp Unix Name StringClass.h Unix Name Verifier.h Unix Name Verifier.cpp Unix Name Accessor.h Unix Name Accessor.cpp Unix Name ScriptObject.h Unix Name ScriptObject.cpp Unix Name ScriptBuffer.h Unix Name ScriptBuffer.cpp Unix Name ScopeChain.h Unix Name ScopeChain.cpp Unix Name RegExpObject.h Unix Name RegExpObject.cpp Unix Name RegExpClass.h Unix Name RegExpClass.cpp Unix Name StringClass.cpp Unix Name PrintWriter.h Unix Name PrintWriter.cpp Unix Name PoolObject.h Unix Name PoolObject.cpp Unix Name Interpreter.h Unix Name Interpreter.cpp Unix Name IntClass.h Unix Name IntClass.cpp Unix Name NativeObjectHelpers.h Unix Name OSDep.h Unix Name OutputStream.h Unix Name ObjectClass.h Unix Name ObjectClass.cpp Unix Name NumberClass.h Unix Name NumberClass.cpp Unix Name MethodInfo.h Unix Name MethodInfo.cpp Unix Name MethodClosure.h Unix Name MethodClosure.cpp Unix Name MathUtils.h Unix Name Namespace.cpp Unix Name Multiname.h Unix Name Multiname.cpp Unix Name NativeFunction.h Unix Name NativeFunction.cpp Unix Name NamespaceClass.h Unix Name NamespaceClass.cpp Unix Name Namespace.h Unix Name Toplevel.cpp Unix Name StringObject.h Unix Name StringObject.cpp Unix Name UnicodeUtils.h Unix Name UnicodeUtils.cpp Unix Name types.h Unix Name Traits.h Unix Name Traits.cpp Unix Name Toplevel.h Unix Name Exception.cpp Unix Name ErrorConstants.h Unix Name ErrorClass.h Unix Name FunctionClass.h Unix Name FunctionClass.cpp Unix Name FrameState.h Unix Name FrameState.cpp Unix Name Exception.h Unix Name ErrorClass.cpp Unix Name MathUtils.cpp Unix Name MathClass.h Unix Name MathClass.cpp Unix Name ClassClosure.h Unix Name ClassClass.h Unix Name ClassClass.cpp Unix Name BuiltinTraits.h Unix Name ClassClosure.cpp Unix Name BuiltinTraits.cpp Unix Name DynamicProfiler.h Unix Name DynamicProfiler.cpp Unix Name DateObject.h Unix Name DateObject.cpp Unix Name DateClass.h Unix Name builtin.cpp Unix Name DateClass.cpp Unix Name Date.h Unix Name Date.cpp Unix Name avmplusDebugger.h Unix Name avmplusDebugger.cpp Unix Name avmplus.h Unix Name avmplus.cpp Unix Name AvmDebug.h Unix Name avmbuild.h Unix Name BooleanClass.h Unix Name BooleanClass.cpp Unix Name avmplusVersion.h Unix Name ErrorConstants.cpp Unix Name avmplusProfiler.h Unix Name avmplusHashtable.h Unix Name avmplusHashtable.cpp Unix Name AvmCore.h Unix Name AvmCore.cpp Unix Name OSDepMac.cpp Unix Name NativeFunctionMac.cpp Unix Name MathUtilsMac.cpp Unix Name avmplusStack.h Unix Name AvmDebugMac.cpp Unix Name macprefix_debuggerrel.pch++ Unix Name MethodEnv.h Unix Name MethodEnv.cpp Unix Name AbcEnv.h Unix Name AbcEnv.cpp Unix Name VTable.cpp Unix Name VTable.h Unix Name CodegenMIR.h Unix Name BigInteger.cpp Unix Name BigInteger.h Unix Name AtomArray.h Unix Name AtomArray.cpp Unix Name avmplusProfiler.cpp Unix Name CodegenMIR.cpp Unix Name DateMac.cpp Unix Name DateMac.h Unix Name MultinameHashtable.h Unix Name MultinameHashtable.cpp Unix Name NamespaceSet.h Unix Name NamespaceSet.cpp Unix Name DomainEnv.h Unix Name DomainEnv.cpp Unix Name Domain.h Unix Name Domain.cpp Unix Name GrowableBuffer.h Unix Name GrowableBuffer.cpp Unix Name AbcGen.h Unix Name AbcGen.cpp Unix Name E4XNode.h Unix Name E4XNode.cpp Unix Name PpcAssembler.cpp Unix Name pcre_info.cpp Unix Name pcre_globals.cpp Unix Name pcre_get.cpp Unix Name pcre_fullinfo.cpp Unix Name pcre_exec.cpp Unix Name pcre_config.cpp Unix Name pcre_compile.cpp Unix Name pcre_chartables.cpp Unix Name pcre_ord2utf8.cpp Unix Name pcre_maketables.cpp Unix Name pcre_refcount.cpp Unix Name pcre_valid_utf8.cpp Unix Name pcre_try_flipped.cpp Unix Name pcre_tables.cpp Unix Name pcre_study.cpp Unix Name pcre.h Unix Name pcre_xclass.cpp Unix Name pcre_version.cpp Unix Name AvmPlusScriptableObject.cpp Unix Name AvmPlusScriptableObject.h Unix Mach-O Debug UserSourceTrees AlwaysSearchUserPathsfalse InterpretDOSAndUnixPathsfalse RequireFrameworkStyleIncludesfalse SourceRelativeIncludesfalse UserSearchPaths SearchPath Path../../core PathFormatUnix PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path../../MMgc PathFormatUnix PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path PathFormatUnix PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path../.. PathFormatUnix PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path../../pcre PathFormatUnix PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SystemSearchPaths SearchPath PathMacOS X Support/Headers/(wchar_t Support fix) PathFormatUnix PathRootCodeWarrior Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath PathMacOS X Support/Headers/Alloca PathFormatUnix PathRootCodeWarrior Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path../../../../../../../vendors/fpMacOSX.sdk/usr/include PathFormatUnix PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path../../../../../../../vendors/fpMacOSX.sdk/usr/lib PathFormatUnix PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path../../../../../../../vendors/fpMacOSX.sdk/System/Library/Frameworks PathFormatUnix PathRootProject Recursivefalse FrameworkPathtrue HostFlagsAll SearchPath PathMacOS X Support PathFormatUnix PathRootCodeWarrior Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path../../../../../../../vendors/fpMacOSX.sdk/Developer/Headers/FlatCarbon PathFormatUnix PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll MWRuntimeSettings_WorkingDirectory MWRuntimeSettings_CommandLine MWRuntimeSettings_HostApplication Path PathFormatGeneric PathRootAbsolute MWRuntimeSettings_EnvVars LinkerMacOS X PPC Linker PreLinker PostLinker TargetnameMach-O Debug OutputDirectory Path: PathFormatMacOS PathRootProject SaveEntriesUsingRelativePathsfalse FileMappings FileTypeAPPL FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeAppl FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeMDYL FileExtension CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMLIB FileExtension CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMMLB FileExtension CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMPLF FileExtension CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMWCD FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeRSRC FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeTEXT FileExtension.arr Compiler EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.axp Compiler EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.c CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.c++ CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cc CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cp CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cpp CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.exp Compiler EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.h CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileTypeTEXT FileExtension.h++ CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileTypeTEXT FileExtension.hpp CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileTypeTEXT FileExtension.lcf Compiler EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.m CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.mm CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pch CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pch++ CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pchm CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pchmm CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.plc CompilerProperty List Compiler EditLanguageProperty List Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.ploc CompilerProperty List Compiler EditLanguageProperty List Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.r CompilerRez EditLanguageRez Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.wke Compiler EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypedocu FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypersrc FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileExtension.a CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileExtension.doc Compiler EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue FileExtension.dylib CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileExtension.gif CompilerCopy To Package EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue FileExtension.icns CompilerCopy To Package EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue FileExtension.jpg CompilerCopy To Package EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue FileExtension.lib CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileExtension.nib CompilerCopy To Package EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue FileExtension.pl CompilerPerl Tool EditLanguagePerl Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileExtension.plist CompilerCopy To Package EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileExtension.ppob Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileExtension.psh CompilerShell Tool EditLanguage Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileExtension.rsrc Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileExtension.sh CompilerShell Tool EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileExtension.strings CompilerCopy To Package EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileExtension.tiff CompilerCopy To Package EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue CacheModDatestrue DumpBrowserInfofalse CacheSubprojectstrue UseThirdPartyDebuggerfalse BrowserGenerator1 DebuggerAppPath Path PathFormatGeneric PathRootAbsolute DebuggerCmdLineArgs DebuggerWorkingDir Path PathFormatGeneric PathRootAbsolute CodeCompletionPrefixFileNameMacHeaders.c CodeCompletionMacroFileNameMacOS_Carbon_C++_Macros.h ConsoleEncoding0 LogSystemMessagesfalse AutoTargetDLLsPopUp0 StopAtWatchpointstrue PauseWhileRunningfalse PauseInterval5 PauseUIFlags0 AltExePath Path PathFormatGeneric PathRootAbsolute StopAtTempBPOnLaunchtrue CacheSymbolicstrue TempBPFunctionNamemain TempBPType0 Enabledfalse ConnectionName DownloadPath LaunchRemoteAppfalse RemoteAppPath CoreID0 JTAGClockSpeed8000 IsMultiCorefalse OSDownloadfalse UseGlobalOSDownloadfalse OSDownloadConnectionName OSDownloadPath AltDownloadfalse AltDownloadConnectionName OtherExecutables AnalyzerConnectionName CustomColor1 Red0 Green32767 Blue0 CustomColor2 Red0 Green32767 Blue0 CustomColor3 Red0 Green32767 Blue0 CustomColor4 Red0 Green32767 Blue0 MWFrontEnd_C_cplusplus0 MWFrontEnd_C_checkprotos0 MWFrontEnd_C_arm0 MWFrontEnd_C_trigraphs0 MWFrontEnd_C_onlystdkeywords0 MWFrontEnd_C_enumsalwaysint1 MWFrontEnd_C_ansistrict0 MWFrontEnd_C_wchar_type1 MWFrontEnd_C_enableexceptions0 MWFrontEnd_C_dontreusestrings0 MWFrontEnd_C_poolstrings0 MWFrontEnd_C_dontinline1 MWFrontEnd_C_useRTTI0 MWFrontEnd_C_unsignedchars0 MWFrontEnd_C_autoinline0 MWFrontEnd_C_booltruefalse1 MWFrontEnd_C_inlinelevel0 MWFrontEnd_C_ecplusplus0 MWFrontEnd_C_defer_codegen0 MWFrontEnd_C_templateparser0 MWFrontEnd_C_c990 MWFrontEnd_C_bottomupinline1 MWFrontEnd_C_gcc_extensions0 MWFrontEnd_C_instance_manager0 C_CPP_Preprocessor_EmitFiletrue C_CPP_Preprocessor_EmitLinefalse C_CPP_Preprocessor_EmitFullPathfalse C_CPP_Preprocessor_KeepCommentsfalse C_CPP_Preprocessor_PCHUsesPrefixTextfalse C_CPP_Preprocessor_EmitPragmastrue C_CPP_Preprocessor_KeepWhiteSpacefalse C_CPP_Preprocessor_MultiByteEncodingencAutoDetectMultibyte C_CPP_Preprocessor_PrefixText#if !__option(precompile) #include "macho_debug.mch++" #endif MWWarning_C_warn_illpragma1 MWWarning_C_warn_emptydecl1 MWWarning_C_warn_possunwant1 MWWarning_C_warn_unusedvar1 MWWarning_C_warn_unusedarg0 MWWarning_C_warn_extracomma0 MWWarning_C_pedantic1 MWWarning_C_warningerrors0 MWWarning_C_warn_hidevirtual0 MWWarning_C_warn_implicitconv0 MWWarning_C_warn_notinlined0 MWWarning_C_warn_structclass1 MWWarning_C_warn_missingreturn0 MWWarning_C_warn_no_side_effect0 MWWarning_C_warn_resultnotused0 MWWarning_C_warn_padding0 MWWarning_C_warn_impl_i2f_conv0 MWWarning_C_warn_impl_f2i_conv0 MWWarning_C_warn_impl_s2u_conv0 MWWarning_C_warn_illtokenpasting0 MWWarning_C_warn_filenamecaps0 MWWarning_C_warn_filenamecapssystem0 MWWarning_C_warn_undefmacro0 MWWarning_C_warn_ptrintconv1 MWMerge_MacOS_projectTypeApplication MWMerge_MacOS_outputNameMerge Out MWMerge_MacOS_outputCreator???? MWMerge_MacOS_outputTypeAPPL MWMerge_MacOS_suppressWarning0 MWMerge_MacOS_copyFragments1 MWMerge_MacOS_copyResources1 MWMerge_MacOS_flattenResource0 MWMerge_MacOS_flatFileNamea.rsrc MWMerge_MacOS_flatFileOutputPath Path: PathFormatMacOS PathRootProject MWMerge_MacOS_skipResources DLGX ckid Proj WSPC FileLockedfalse ResourcesMapIsReadOnlyfalse PrinterDriverIsMultiFinderCompatiblefalse Invisiblefalse HasBundlefalse NameLockedfalse Stationeryfalse HasCustomIconfalse Sharedfalse HasBeenInitedfalse Label0 Comments HasCustomBadgefalse HasRoutingInfofalse MWCodeGen_PPC_structalignmentPPC_mw MWCodeGen_PPC_tracebacktablesInline MWCodeGen_PPC_processorGeneric MWCodeGen_PPC_function_align4 MWCodeGen_PPC_tocdata1 MWCodeGen_PPC_largetoc0 MWCodeGen_PPC_profiler0 MWCodeGen_PPC_vectortocdata1 MWCodeGen_PPC_poolconst0 MWCodeGen_PPC_peephole0 MWCodeGen_PPC_readonlystrings0 MWCodeGen_PPC_linkerpoolsstrings0 MWCodeGen_PPC_volatileasm0 MWCodeGen_PPC_schedule0 MWCodeGen_PPC_altivec1 MWCodeGen_PPC_altivec_move_block0 MWCodeGen_PPC_strictIEEEfp0 MWCodeGen_PPC_fpcontract1 MWCodeGen_PPC_genfsel0 MWCodeGen_PPC_orderedfpcmp0 MWCodeGen_MachO_structalignmentPPC_mw MWCodeGen_MachO_profiler_enumOff MWCodeGen_MachO_processorGeneric MWCodeGen_MachO_function_align4 MWCodeGen_MachO_common0 MWCodeGen_MachO_boolisint0 MWCodeGen_MachO_peephole1 MWCodeGen_MachO_readonlystrings0 MWCodeGen_MachO_linkerpoolsstrings1 MWCodeGen_MachO_volatileasm0 MWCodeGen_MachO_schedule0 MWCodeGen_MachO_altivec0 MWCodeGen_MachO_vecmove0 MWCodeGen_MachO_fp_ieee_strict0 MWCodeGen_MachO_fpcontract1 MWCodeGen_MachO_genfsel0 MWCodeGen_MachO_fp_cmps_ordered0 MWDisassembler_PPC_showcode1 MWDisassembler_PPC_extended1 MWDisassembler_PPC_mix0 MWDisassembler_PPC_nohex0 MWDisassembler_PPC_showdata1 MWDisassembler_PPC_showexceptions1 MWDisassembler_PPC_showsym1 MWDisassembler_PPC_shownames1 GlobalOptimizer_PPC_optimizationlevelLevel0 GlobalOptimizer_PPC_optforSize MWLinker_PPC_linksym1 MWLinker_PPC_symfullpath1 MWLinker_PPC_linkmap1 MWLinker_PPC_nolinkwarnings0 MWLinker_PPC_dontdeadstripinitcode0 MWLinker_PPC_permitmultdefs0 MWLinker_PPC_linkmodeFast MWLinker_PPC_code_foldingNone MWLinker_PPC_initname MWLinker_PPC_mainname__start MWLinker_PPC_termname MWLinker_MacOSX_linksym0 MWLinker_MacOSX_symfullpath0 MWLinker_MacOSX_nolinkwarnings0 MWLinker_MacOSX_linkmap0 MWLinker_MacOSX_dontdeadstripinitcode0 MWLinker_MacOSX_permitmultdefs1 MWLinker_MacOSX_use_objectivec_semantics0 MWLinker_MacOSX_strip_debug_symbols0 MWLinker_MacOSX_prebind_all_twolevel_modules0 MWLinker_MacOSX_data_before_text_segment0 MWLinker_MacOSX_report_msl_overloads0 MWLinker_MacOSX_objects_follow_linkorder0 MWLinker_MacOSX_linkmodeFast MWLinker_MacOSX_exportsReferencedGlobals MWLinker_MacOSX_sortcodeNone MWLinker_MacOSX_mainnamestart MWLinker_MacOSX_initname MWLinker_MacOSX_code_foldingNone MWLinker_MacOSX_stabsgenNone MWProject_MacOSX_typeLibrary MWProject_MacOSX_outfileavmplus_macho_debug.lib MWProject_MacOSX_filecreatorCWIE MWProject_MacOSX_filetypeMLIB MWProject_MacOSX_vmaddress0 MWProject_MacOSX_usedefaultvmaddr1 MWProject_MacOSX_flatrsrc0 MWProject_MacOSX_flatrsrcfilename MWProject_MacOSX_flatrsrcoutputdir Path: PathFormatMacOS PathRootProject MWProject_MacOSX_installpath./ MWProject_MacOSX_dont_prebind0 MWProject_MacOSX_flat_namespace0 MWProject_MacOSX_frameworkversionA MWProject_MacOSX_currentversion0 MWProject_MacOSX_flat_oldimpversion0 MWProject_MacOSX_AddrMode0 MWPEF_exportsNone MWPEF_libfolder0 MWPEF_sortcodeNone MWPEF_expandbss0 MWPEF_sharedata0 MWPEF_olddefversion0 MWPEF_oldimpversion0 MWPEF_currentversion0 MWPEF_fragmentname MWPEF_collapsereloads0 MWProject_PPC_typeLibrary MWProject_PPC_outfileavmplus_carbon_debug.lib MWProject_PPC_filecreator???? MWProject_PPC_filetype???? MWProject_PPC_size0 MWProject_PPC_minsize0 MWProject_PPC_stacksize0 MWProject_PPC_flags0 MWProject_PPC_symfilename MWProject_PPC_rsrcname MWProject_PPC_rsrcheaderNative MWProject_PPC_rsrctype???? MWProject_PPC_rsrcid0 MWProject_PPC_rsrcflags0 MWProject_PPC_rsrcstore0 MWProject_PPC_rsrcmerge0 MWProject_PPC_flatrsrc0 MWProject_PPC_flatrsrcoutputdir Path: PathFormatMacOS PathRootProject MWProject_PPC_flatrsrcfilename MWAssembler_PPC_auxheader0 MWAssembler_PPC_symmodeMac MWAssembler_PPC_dialectPPC MWAssembler_PPC_prefixfile MWAssembler_PPC_typecheck0 MWAssembler_PPC_warnings0 MWAssembler_PPC_casesensitive0 PList_OutputTypeFile PList_OutputEncodingUTF-8 PList_PListVersion0.9 PList_Prefix PList_FileFilenameInfo.plist PList_FileDirectory Path: PathFormatMacOS PathRootProject PList_ResourceTypeplst PList_ResourceID0 PList_ResourceName MWRez_Language_maxwidth80 MWRez_Language_scriptRoman MWRez_Language_alignmentAlign1 MWRez_Language_filtermodeFilterSkip MWRez_Language_suppresswarnings0 MWRez_Language_escapecontrolchars1 MWRez_Language_prefixnameStandaloneRezDebug.h MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' MWWinRC_prefixname MWCodeGen_X86_processorGeneric MWCodeGen_X86_alignmentbytes8 MWCodeGen_X86_exceptionsZeroOverhead MWCodeGen_X86_name_manglingMWWin32 MWCodeGen_X86_use_extinst0 MWCodeGen_X86_extinst_mmx0 MWCodeGen_X86_extinst_3dnow0 MWCodeGen_X86_use_mmx_3dnow_convention0 MWCodeGen_X86_extinst_cmov0 MWCodeGen_X86_extinst_sse0 MWCodeGen_X86_extinst_sse20 MWCodeGen_X86_intrinsics0 MWCodeGen_X86_optimizeasm0 MWCodeGen_X86_disableopts0 MWCodeGen_X86_profile0 MWLinker_X86_runtimeCustom MWCodeGen_X86_readonlystrings0 MWCodeGen_X86_vectorize0 MWCodeGen_X86_relaxieee0 MWLinker_X86_subsysmajorid4 MWLinker_X86_subsysminorid0 MWCOFF_X86_opsysmajorid4 MWCOFF_X86_opsysminorid0 MWLinker_X86_usrmajorid0 MWLinker_X86_usrminorid0 MWProject_X86_maxstacksize1024 MWProject_X86_minstacksize4 MWProject_X86_size1024 MWProject_X86_minsize4 MWCOFF_X86_coff_flags0 MWCOFF_X86_dll_flags0 MWProject_X86_baseaddress4194304 MWCOFF_X86_filealign512 MWCOFF_X86_sectionalign4096 PDisasmX86_showHeaderstrue PDisasmX86_showSectHeaderstrue PDisasmX86_showSymTabtrue PDisasmX86_showCodetrue PDisasmX86_showDatatrue PDisasmX86_showDebugfalse PDisasmX86_showExceptionsfalse PDisasmX86_showRawfalse PDisasmX86_showAllRawfalse PDisasmX86_showSourcefalse PDisasmX86_showRelocationtrue PDisasmX86_showHextrue PDisasmX86_showCommentsfalse PDisasmX86_showSymDefstrue PDisasmX86_unmangletrue PDisasmX86_verbosetrue PDisasmX86_resolveRelocstrue PDisasmX86_resolveLocalsfalse MWDebugger_X86_Exceptions 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 GlobalOptimizer_X86_optimizationlevelLevel0 GlobalOptimizer_X86_optforSpeed MWLinker_X86_entrypointusageDefault MWLinker_X86_entrypoint MWLinker_X86_subsystemWinGUI MWLinker_X86_commandfile MWLinker_X86_generatemap0 MWLinker_X86_linksym0 MWLinker_X86_linkCV1 MWLinker_X86_symfullpathfalse MWLinker_X86_linkdebugtrue MWLinker_X86_checksumfalse MWLinker_X86_zero_init_bssfalse MWLinker_X86_mergedatafalse MWLinker_X86_usedefaultlibsfalse MWLinker_X86_adddefaultlibsfalse MWLinker_X86_nowarningsfalse MWLinker_X86_verbosefalse MWLinker_X86_linkformemfalse MWLinker_X86_codefoldingNone MWLinker_X86_debuginlinefalse MWProject_X86_typeApplication MWProject_X86_outfilenoname.exe MWProject_X86_importlib MWProject_X86_setimportlibdirfalse MWProject_X86_dontgenerateimportlibfalse MWProject_X86_oldformatlibfalse MWProject_X86_replaceobjextensionfalse MWProject_X86_copyallfilesfalse Name AtomConstants.h Unix Text Name AtomConstants.cpp Unix Text Debug Name ArrayObject.h Unix Text Name ArrayObject.cpp Unix Text Debug Name ArrayClass.h Unix Text Name AbstractFunction.h Unix Text Name AbstractFunction.cpp Unix Text Debug Name AbcParser.h Unix Text Name AbcParser.cpp Unix Text Debug Name XMLParser16.h Unix Text Name XMLParser16.cpp Unix Text Debug Name XMLObject.h Unix Text Name XMLObject.cpp Unix Text Debug Name XMLListObject.h Unix Text Name XMLListObject.cpp Unix Text Debug Name XMLListClass.h Unix Text Name XMLListClass.cpp Unix Text Debug Name XMLClass.h Unix Text Name XMLClass.cpp Unix Text Debug Name ArrayClass.cpp Unix Text Debug Name ActionBlockConstants.h Unix Text Name ActionBlockConstants.cpp Unix Text Debug Name StringBuffer.h Unix Text Name StringBuffer.cpp Unix Text Debug Name StaticProfiler.h Unix Text Name StaticProfiler.cpp Unix Text Debug Name StackTrace.h Unix Text Name StackTrace.cpp Unix Text Debug Name StringClass.h Unix Text Name Verifier.h Unix Text Name Verifier.cpp Unix Text Debug Name Accessor.h Unix Text Name Accessor.cpp Unix Text Debug Name ScriptObject.h Unix Text Name ScriptObject.cpp Unix Text Debug Name ScriptBuffer.h Unix Text Name ScriptBuffer.cpp Unix Text Debug Name ScopeChain.h Unix Text Name ScopeChain.cpp Unix Text Debug Name RegExpObject.h Unix Text Name RegExpObject.cpp Unix Text Debug Name RegExpClass.h Unix Text Name RegExpClass.cpp Unix Text Debug Name StringClass.cpp Unix Text Debug Name PrintWriter.h Unix Text Name PrintWriter.cpp Unix Text Debug Name PoolObject.h Unix Text Name PoolObject.cpp Unix Text Debug Name Interpreter.h Unix Text Name Interpreter.cpp Unix Text Debug Name IntClass.h Unix Text Name IntClass.cpp Unix Text Debug Name NativeObjectHelpers.h Unix Text Name OSDep.h Unix Text Name OutputStream.h Unix Text Name ObjectClass.h Unix Text Name ObjectClass.cpp Unix Text Debug Name NumberClass.h Unix Text Name NumberClass.cpp Unix Text Debug Name MethodInfo.h Unix Text Name MethodInfo.cpp Unix Text Debug Name MethodClosure.h Unix Text Name MethodClosure.cpp Unix Text Debug Name MathUtils.h Unix Text Name Namespace.cpp Unix Text Debug Name Multiname.h Unix Text Name Multiname.cpp Unix Text Debug Name NativeFunction.h Unix Text Name NativeFunction.cpp Unix Text Debug Name NamespaceClass.h Unix Text Name NamespaceClass.cpp Unix Text Debug Name Namespace.h Unix Text Name Toplevel.cpp Unix Text Debug Name StringObject.h Unix Text Name StringObject.cpp Unix Text Debug Name UnicodeUtils.h Unix Text Name UnicodeUtils.cpp Unix Text Debug Name types.h Unix Text Name Traits.h Unix Text Name Traits.cpp Unix Text Debug Name Toplevel.h Unix Text Name Exception.cpp Unix Text Debug Name ErrorConstants.h Unix Text Name ErrorClass.h Unix Text Name FunctionClass.h Unix Text Name FunctionClass.cpp Unix Text Debug Name FrameState.h Unix Text Name FrameState.cpp Unix Text Debug Name Exception.h Unix Text Name ErrorClass.cpp Unix Text Debug Name MathUtils.cpp Unix Text Debug Name MathClass.h Unix Text Name MathClass.cpp Unix Text Debug Name ClassClosure.h Unix Text Name ClassClass.h Unix Text Name ClassClass.cpp Unix Text Debug Name BuiltinTraits.h Unix Text Name ClassClosure.cpp Unix Text Debug Name BuiltinTraits.cpp Unix Text Debug Name DynamicProfiler.h Unix Text Name DynamicProfiler.cpp Unix Text Debug Name DateObject.h Unix Text Name DateObject.cpp Unix Text Debug Name DateClass.h Unix Text Name builtin.cpp Unix Text Debug Name DateClass.cpp Unix Text Debug Name Date.h Unix Text Name Date.cpp Unix Text Debug Name avmplusDebugger.h Unix Text Name avmplusDebugger.cpp Unix Text Debug Name avmplus.h Unix Text Name avmplus.cpp Unix Text Debug Name AvmDebug.h Unix Text Name avmbuild.h Unix Text Name BooleanClass.h Unix Text Name BooleanClass.cpp Unix Text Debug Name avmplusVersion.h Unix Text Name ErrorConstants.cpp Unix Text Debug Name avmplusProfiler.h Unix Text Name avmplusHashtable.h Unix Text Name avmplusHashtable.cpp Unix Text Debug Name AvmCore.h Unix Text Name AvmCore.cpp Unix Text Debug Name OSDepMac.cpp Unix Text Debug Name NativeFunctionMac.cpp Unix Text Debug Name MathUtilsMac.cpp Unix Text Debug Name avmplusStack.h Unix Text Name AvmDebugMac.cpp Unix Text Debug Name MethodEnv.h Unix Text Name MethodEnv.cpp Unix Text Debug Name AbcEnv.h Unix Text Name AbcEnv.cpp Unix Text Debug Name VTable.cpp Unix Text Debug Name VTable.h Unix Text Name CodegenMIR.h Unix Text Name BigInteger.cpp Unix Text Debug Name BigInteger.h Unix Text Name macho_debug.pch++ Unix Text Debug Name AtomArray.h Unix Text Name AtomArray.cpp Unix Text Debug Name avmplusProfiler.cpp Unix Text Debug Name CodegenMIR.cpp Unix Text Debug Name DateMac.cpp Unix Text Debug Name DateMac.h Unix Text Name MultinameHashtable.h Unix Text Name MultinameHashtable.cpp Unix Text Debug Name NamespaceSet.h Unix Text Name NamespaceSet.cpp Unix Text Debug Name DomainEnv.h Unix Text Name DomainEnv.cpp Unix Text Debug Name Domain.h Unix Text Name Domain.cpp Unix Text Debug Name GrowableBuffer.h Unix Text Name GrowableBuffer.cpp Unix Text Debug Name AbcGen.h Unix Text Name AbcGen.cpp Unix Text Debug Name E4XNode.h Unix Text Name E4XNode.cpp Unix Text Debug Name PpcAssembler.cpp Unix Text Debug Name pcre_info.cpp Unix Text Debug Name pcre_globals.cpp Unix Text Debug Name pcre_get.cpp Unix Text Debug Name pcre_fullinfo.cpp Unix Text Debug Name pcre_exec.cpp Unix Text Debug Name pcre_config.cpp Unix Text Debug Name pcre_compile.cpp Unix Text Debug Name pcre_chartables.cpp Unix Text Debug Name pcre_ord2utf8.cpp Unix Text Debug Name pcre_maketables.cpp Unix Text Debug Name pcre_refcount.cpp Unix Text Debug Name pcre_valid_utf8.cpp Unix Text Debug Name pcre_try_flipped.cpp Unix Text Debug Name pcre_tables.cpp Unix Text Debug Name pcre_study.cpp Unix Text Debug Name pcre.h Unix Text Name pcre_xclass.cpp Unix Text Debug Name pcre_version.cpp Unix Text Debug Name AvmPlusScriptableObject.cpp Unix Text Debug Name AvmPlusScriptableObject.h Unix Text Name AtomConstants.h Unix Name AtomConstants.cpp Unix Name ArrayObject.h Unix Name ArrayObject.cpp Unix Name ArrayClass.h Unix Name AbstractFunction.h Unix Name AbstractFunction.cpp Unix Name AbcParser.h Unix Name AbcParser.cpp Unix Name XMLParser16.h Unix Name XMLParser16.cpp Unix Name XMLObject.h Unix Name XMLObject.cpp Unix Name XMLListObject.h Unix Name XMLListObject.cpp Unix Name XMLListClass.h Unix Name XMLListClass.cpp Unix Name XMLClass.h Unix Name XMLClass.cpp Unix Name ArrayClass.cpp Unix Name ActionBlockConstants.h Unix Name ActionBlockConstants.cpp Unix Name StringBuffer.h Unix Name StringBuffer.cpp Unix Name StaticProfiler.h Unix Name StaticProfiler.cpp Unix Name StackTrace.h Unix Name StackTrace.cpp Unix Name StringClass.h Unix Name Verifier.h Unix Name Verifier.cpp Unix Name Accessor.h Unix Name Accessor.cpp Unix Name ScriptObject.h Unix Name ScriptObject.cpp Unix Name ScriptBuffer.h Unix Name ScriptBuffer.cpp Unix Name ScopeChain.h Unix Name ScopeChain.cpp Unix Name RegExpObject.h Unix Name RegExpObject.cpp Unix Name RegExpClass.h Unix Name RegExpClass.cpp Unix Name StringClass.cpp Unix Name PrintWriter.h Unix Name PrintWriter.cpp Unix Name PoolObject.h Unix Name PoolObject.cpp Unix Name Interpreter.h Unix Name Interpreter.cpp Unix Name IntClass.h Unix Name IntClass.cpp Unix Name NativeObjectHelpers.h Unix Name OSDep.h Unix Name OutputStream.h Unix Name ObjectClass.h Unix Name ObjectClass.cpp Unix Name NumberClass.h Unix Name NumberClass.cpp Unix Name MethodInfo.h Unix Name MethodInfo.cpp Unix Name MethodClosure.h Unix Name MethodClosure.cpp Unix Name MathUtils.h Unix Name Namespace.cpp Unix Name Multiname.h Unix Name Multiname.cpp Unix Name NativeFunction.h Unix Name NativeFunction.cpp Unix Name NamespaceClass.h Unix Name NamespaceClass.cpp Unix Name Namespace.h Unix Name Toplevel.cpp Unix Name StringObject.h Unix Name StringObject.cpp Unix Name UnicodeUtils.h Unix Name UnicodeUtils.cpp Unix Name types.h Unix Name Traits.h Unix Name Traits.cpp Unix Name Toplevel.h Unix Name Exception.cpp Unix Name ErrorConstants.h Unix Name ErrorClass.h Unix Name FunctionClass.h Unix Name FunctionClass.cpp Unix Name FrameState.h Unix Name FrameState.cpp Unix Name Exception.h Unix Name ErrorClass.cpp Unix Name MathUtils.cpp Unix Name MathClass.h Unix Name MathClass.cpp Unix Name ClassClosure.h Unix Name ClassClass.h Unix Name ClassClass.cpp Unix Name BuiltinTraits.h Unix Name ClassClosure.cpp Unix Name BuiltinTraits.cpp Unix Name DynamicProfiler.h Unix Name DynamicProfiler.cpp Unix Name DateObject.h Unix Name DateObject.cpp Unix Name DateClass.h Unix Name builtin.cpp Unix Name DateClass.cpp Unix Name Date.h Unix Name Date.cpp Unix Name avmplusDebugger.h Unix Name avmplusDebugger.cpp Unix Name avmplus.h Unix Name avmplus.cpp Unix Name AvmDebug.h Unix Name avmbuild.h Unix Name BooleanClass.h Unix Name BooleanClass.cpp Unix Name avmplusVersion.h Unix Name ErrorConstants.cpp Unix Name avmplusProfiler.h Unix Name avmplusHashtable.h Unix Name avmplusHashtable.cpp Unix Name AvmCore.h Unix Name AvmCore.cpp Unix Name OSDepMac.cpp Unix Name NativeFunctionMac.cpp Unix Name MathUtilsMac.cpp Unix Name avmplusStack.h Unix Name AvmDebugMac.cpp Unix Name MethodEnv.h Unix Name MethodEnv.cpp Unix Name AbcEnv.h Unix Name AbcEnv.cpp Unix Name VTable.cpp Unix Name VTable.h Unix Name CodegenMIR.h Unix Name BigInteger.cpp Unix Name BigInteger.h Unix Name macho_debug.pch++ Unix Name AtomArray.h Unix Name AtomArray.cpp Unix Name avmplusProfiler.cpp Unix Name CodegenMIR.cpp Unix Name DateMac.cpp Unix Name DateMac.h Unix Name MultinameHashtable.h Unix Name MultinameHashtable.cpp Unix Name NamespaceSet.h Unix Name NamespaceSet.cpp Unix Name DomainEnv.h Unix Name DomainEnv.cpp Unix Name Domain.h Unix Name Domain.cpp Unix Name GrowableBuffer.h Unix Name GrowableBuffer.cpp Unix Name AbcGen.h Unix Name AbcGen.cpp Unix Name E4XNode.h Unix Name E4XNode.cpp Unix Name PpcAssembler.cpp Unix Name pcre_info.cpp Unix Name pcre_globals.cpp Unix Name pcre_get.cpp Unix Name pcre_fullinfo.cpp Unix Name pcre_exec.cpp Unix Name pcre_config.cpp Unix Name pcre_compile.cpp Unix Name pcre_chartables.cpp Unix Name pcre_ord2utf8.cpp Unix Name pcre_maketables.cpp Unix Name pcre_refcount.cpp Unix Name pcre_valid_utf8.cpp Unix Name pcre_try_flipped.cpp Unix Name pcre_tables.cpp Unix Name pcre_study.cpp Unix Name pcre.h Unix Name pcre_xclass.cpp Unix Name pcre_version.cpp Unix Name AvmPlusScriptableObject.cpp Unix Name AvmPlusScriptableObject.h Unix Mach-O Release UserSourceTrees AlwaysSearchUserPathsfalse InterpretDOSAndUnixPathsfalse RequireFrameworkStyleIncludesfalse SourceRelativeIncludesfalse UserSearchPaths SearchPath Path../../core PathFormatUnix PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path../../MMgc PathFormatUnix PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path PathFormatUnix PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path../.. PathFormatUnix PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path../../pcre PathFormatUnix PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SystemSearchPaths SearchPath PathMacOS X Support/Headers/(wchar_t Support fix) PathFormatUnix PathRootCodeWarrior Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath PathMacOS X Support/Headers/Alloca PathFormatUnix PathRootCodeWarrior Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path../../../../../../../vendors/fpMacOSX.sdk/usr/include PathFormatUnix PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path../../../../../../../vendors/fpMacOSX.sdk/usr/lib PathFormatUnix PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path../../../../../../../vendors/fpMacOSX.sdk/System/Library/Frameworks PathFormatUnix PathRootProject Recursivefalse FrameworkPathtrue HostFlagsAll SearchPath PathMacOS X Support PathFormatUnix PathRootCodeWarrior Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path../../../../../../../vendors/fpMacOSX.sdk/Developer/Headers/FlatCarbon PathFormatUnix PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll MWRuntimeSettings_WorkingDirectory MWRuntimeSettings_CommandLine MWRuntimeSettings_HostApplication Path PathFormatGeneric PathRootAbsolute MWRuntimeSettings_EnvVars LinkerMacOS X PPC Linker PreLinker PostLinker TargetnameMach-O Release OutputDirectory Path: PathFormatMacOS PathRootProject SaveEntriesUsingRelativePathsfalse FileMappings FileTypeAPPL FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeAppl FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeMDYL FileExtension CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMLIB FileExtension CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMMLB FileExtension CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMPLF FileExtension CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMWCD FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeRSRC FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeTEXT FileExtension.arr Compiler EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.axp Compiler EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.c CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.c++ CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cc CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cp CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cpp CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.exp Compiler EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.h CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileTypeTEXT FileExtension.h++ CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileTypeTEXT FileExtension.hpp CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileTypeTEXT FileExtension.lcf Compiler EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.m CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.mm CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pch CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pch++ CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pchm CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pchmm CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.plc CompilerProperty List Compiler EditLanguageProperty List Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.ploc CompilerProperty List Compiler EditLanguageProperty List Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.r CompilerRez EditLanguageRez Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.wke Compiler EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypedocu FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypersrc FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileExtension.a CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileExtension.doc Compiler EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue FileExtension.dylib CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileExtension.gif CompilerCopy To Package EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue FileExtension.icns CompilerCopy To Package EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue FileExtension.jpg CompilerCopy To Package EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue FileExtension.lib CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileExtension.nib CompilerCopy To Package EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue FileExtension.pl CompilerPerl Tool EditLanguagePerl Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileExtension.plist CompilerCopy To Package EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileExtension.ppob Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileExtension.psh CompilerShell Tool EditLanguage Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileExtension.rsrc Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileExtension.sh CompilerShell Tool EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileExtension.strings CompilerCopy To Package EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileExtension.tiff CompilerCopy To Package EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue CacheModDatestrue DumpBrowserInfofalse CacheSubprojectstrue UseThirdPartyDebuggerfalse BrowserGenerator1 DebuggerAppPath Path PathFormatGeneric PathRootAbsolute DebuggerCmdLineArgs DebuggerWorkingDir Path PathFormatGeneric PathRootAbsolute CodeCompletionPrefixFileNameMacHeaders.c CodeCompletionMacroFileNameMacOS_Carbon_C++_Macros.h ConsoleEncoding0 LogSystemMessagestrue AutoTargetDLLsPopUp0 StopAtWatchpointstrue PauseWhileRunningfalse PauseInterval5 PauseUIFlags0 AltExePath Path PathFormatGeneric PathRootAbsolute StopAtTempBPOnLaunchtrue CacheSymbolicstrue TempBPFunctionNamemain TempBPType0 Enabledfalse ConnectionName DownloadPath LaunchRemoteAppfalse RemoteAppPath CoreID0 JTAGClockSpeed8000 IsMultiCorefalse OSDownloadfalse UseGlobalOSDownloadfalse OSDownloadConnectionName OSDownloadPath AltDownloadfalse AltDownloadConnectionName OtherExecutables AnalyzerConnectionName CustomColor1 Red0 Green32767 Blue0 CustomColor2 Red0 Green32767 Blue0 CustomColor3 Red0 Green32767 Blue0 CustomColor4 Red0 Green32767 Blue0 MWFrontEnd_C_cplusplus0 MWFrontEnd_C_checkprotos0 MWFrontEnd_C_arm0 MWFrontEnd_C_trigraphs0 MWFrontEnd_C_onlystdkeywords0 MWFrontEnd_C_enumsalwaysint1 MWFrontEnd_C_ansistrict0 MWFrontEnd_C_wchar_type1 MWFrontEnd_C_enableexceptions0 MWFrontEnd_C_dontreusestrings0 MWFrontEnd_C_poolstrings0 MWFrontEnd_C_dontinline0 MWFrontEnd_C_useRTTI0 MWFrontEnd_C_unsignedchars0 MWFrontEnd_C_autoinline0 MWFrontEnd_C_booltruefalse1 MWFrontEnd_C_inlinelevel8 MWFrontEnd_C_ecplusplus0 MWFrontEnd_C_defer_codegen1 MWFrontEnd_C_templateparser0 MWFrontEnd_C_c990 MWFrontEnd_C_bottomupinline1 MWFrontEnd_C_gcc_extensions0 MWFrontEnd_C_instance_manager0 C_CPP_Preprocessor_EmitFiletrue C_CPP_Preprocessor_EmitLinefalse C_CPP_Preprocessor_EmitFullPathfalse C_CPP_Preprocessor_KeepCommentsfalse C_CPP_Preprocessor_PCHUsesPrefixTextfalse C_CPP_Preprocessor_EmitPragmastrue C_CPP_Preprocessor_KeepWhiteSpacefalse C_CPP_Preprocessor_MultiByteEncodingencAutoDetectMultibyte C_CPP_Preprocessor_PrefixText#if !__option(precompile) #include "macho_release.mch++" #endif MWWarning_C_warn_illpragma1 MWWarning_C_warn_emptydecl1 MWWarning_C_warn_possunwant1 MWWarning_C_warn_unusedvar1 MWWarning_C_warn_unusedarg0 MWWarning_C_warn_extracomma0 MWWarning_C_pedantic1 MWWarning_C_warningerrors0 MWWarning_C_warn_hidevirtual0 MWWarning_C_warn_implicitconv0 MWWarning_C_warn_notinlined0 MWWarning_C_warn_structclass1 MWWarning_C_warn_missingreturn0 MWWarning_C_warn_no_side_effect0 MWWarning_C_warn_resultnotused0 MWWarning_C_warn_padding0 MWWarning_C_warn_impl_i2f_conv0 MWWarning_C_warn_impl_f2i_conv0 MWWarning_C_warn_impl_s2u_conv0 MWWarning_C_warn_illtokenpasting0 MWWarning_C_warn_filenamecaps0 MWWarning_C_warn_filenamecapssystem0 MWWarning_C_warn_undefmacro0 MWWarning_C_warn_ptrintconv1 MWMerge_MacOS_projectTypeApplication MWMerge_MacOS_outputNameMerge Out MWMerge_MacOS_outputCreator???? MWMerge_MacOS_outputTypeAPPL MWMerge_MacOS_suppressWarning0 MWMerge_MacOS_copyFragments1 MWMerge_MacOS_copyResources1 MWMerge_MacOS_flattenResource0 MWMerge_MacOS_flatFileNamea.rsrc MWMerge_MacOS_flatFileOutputPath Path: PathFormatMacOS PathRootProject MWMerge_MacOS_skipResources DLGX ckid Proj WSPC FileLockedfalse ResourcesMapIsReadOnlyfalse PrinterDriverIsMultiFinderCompatiblefalse Invisiblefalse HasBundlefalse NameLockedfalse Stationeryfalse HasCustomIconfalse Sharedfalse HasBeenInitedfalse Label0 Comments HasCustomBadgefalse HasRoutingInfofalse MWCodeGen_PPC_structalignmentPPC_mw MWCodeGen_PPC_tracebacktablesNone MWCodeGen_PPC_processorGeneric MWCodeGen_PPC_function_align4 MWCodeGen_PPC_tocdata1 MWCodeGen_PPC_largetoc0 MWCodeGen_PPC_profiler0 MWCodeGen_PPC_vectortocdata1 MWCodeGen_PPC_poolconst1 MWCodeGen_PPC_peephole1 MWCodeGen_PPC_readonlystrings1 MWCodeGen_PPC_linkerpoolsstrings1 MWCodeGen_PPC_volatileasm0 MWCodeGen_PPC_schedule1 MWCodeGen_PPC_altivec1 MWCodeGen_PPC_altivec_move_block0 MWCodeGen_PPC_strictIEEEfp0 MWCodeGen_PPC_fpcontract1 MWCodeGen_PPC_genfsel0 MWCodeGen_PPC_orderedfpcmp0 MWCodeGen_MachO_structalignmentPPC_mw MWCodeGen_MachO_profiler_enumOff MWCodeGen_MachO_processorGeneric MWCodeGen_MachO_function_align4 MWCodeGen_MachO_common0 MWCodeGen_MachO_boolisint0 MWCodeGen_MachO_peephole1 MWCodeGen_MachO_readonlystrings0 MWCodeGen_MachO_linkerpoolsstrings1 MWCodeGen_MachO_volatileasm0 MWCodeGen_MachO_schedule0 MWCodeGen_MachO_altivec0 MWCodeGen_MachO_vecmove0 MWCodeGen_MachO_fp_ieee_strict0 MWCodeGen_MachO_fpcontract1 MWCodeGen_MachO_genfsel0 MWCodeGen_MachO_fp_cmps_ordered0 MWDisassembler_PPC_showcode1 MWDisassembler_PPC_extended1 MWDisassembler_PPC_mix0 MWDisassembler_PPC_nohex0 MWDisassembler_PPC_showdata1 MWDisassembler_PPC_showexceptions1 MWDisassembler_PPC_showsym0 MWDisassembler_PPC_shownames1 GlobalOptimizer_PPC_optimizationlevelLevel4 GlobalOptimizer_PPC_optforSpeed MWLinker_PPC_linksym1 MWLinker_PPC_symfullpath1 MWLinker_PPC_linkmap0 MWLinker_PPC_nolinkwarnings0 MWLinker_PPC_dontdeadstripinitcode0 MWLinker_PPC_permitmultdefs0 MWLinker_PPC_linkmodeFast MWLinker_PPC_code_foldingNone MWLinker_PPC_initname MWLinker_PPC_mainname__start MWLinker_PPC_termname MWLinker_MacOSX_linksym0 MWLinker_MacOSX_symfullpath0 MWLinker_MacOSX_nolinkwarnings0 MWLinker_MacOSX_linkmap0 MWLinker_MacOSX_dontdeadstripinitcode0 MWLinker_MacOSX_permitmultdefs1 MWLinker_MacOSX_use_objectivec_semantics0 MWLinker_MacOSX_strip_debug_symbols0 MWLinker_MacOSX_prebind_all_twolevel_modules0 MWLinker_MacOSX_data_before_text_segment0 MWLinker_MacOSX_report_msl_overloads0 MWLinker_MacOSX_objects_follow_linkorder0 MWLinker_MacOSX_linkmodeFast MWLinker_MacOSX_exportsReferencedGlobals MWLinker_MacOSX_sortcodeNone MWLinker_MacOSX_mainnamestart MWLinker_MacOSX_initname MWLinker_MacOSX_code_foldingNone MWLinker_MacOSX_stabsgenNone MWProject_MacOSX_typeLibrary MWProject_MacOSX_outfileavmplus_macho.lib MWProject_MacOSX_filecreatorCWIE MWProject_MacOSX_filetypeMLIB MWProject_MacOSX_vmaddress0 MWProject_MacOSX_usedefaultvmaddr1 MWProject_MacOSX_flatrsrc0 MWProject_MacOSX_flatrsrcfilename MWProject_MacOSX_flatrsrcoutputdir Path: PathFormatMacOS PathRootProject MWProject_MacOSX_installpath./ MWProject_MacOSX_dont_prebind0 MWProject_MacOSX_flat_namespace0 MWProject_MacOSX_frameworkversionA MWProject_MacOSX_currentversion0 MWProject_MacOSX_flat_oldimpversion0 MWProject_MacOSX_AddrMode0 MWPEF_exportsNone MWPEF_libfolder0 MWPEF_sortcodeNone MWPEF_expandbss0 MWPEF_sharedata0 MWPEF_olddefversion0 MWPEF_oldimpversion0 MWPEF_currentversion0 MWPEF_fragmentname MWPEF_collapsereloads1 MWProject_PPC_typeLibrary MWProject_PPC_outfileavmplus_carbon.lib MWProject_PPC_filecreator???? MWProject_PPC_filetype???? MWProject_PPC_size0 MWProject_PPC_minsize0 MWProject_PPC_stacksize0 MWProject_PPC_flags0 MWProject_PPC_symfilename MWProject_PPC_rsrcname MWProject_PPC_rsrcheaderNative MWProject_PPC_rsrctype???? MWProject_PPC_rsrcid0 MWProject_PPC_rsrcflags0 MWProject_PPC_rsrcstore0 MWProject_PPC_rsrcmerge0 MWProject_PPC_flatrsrc0 MWProject_PPC_flatrsrcoutputdir Path: PathFormatMacOS PathRootProject MWProject_PPC_flatrsrcfilename MWAssembler_PPC_auxheader0 MWAssembler_PPC_symmodeMac MWAssembler_PPC_dialectPPC MWAssembler_PPC_prefixfile MWAssembler_PPC_typecheck0 MWAssembler_PPC_warnings0 MWAssembler_PPC_casesensitive0 PList_OutputTypeFile PList_OutputEncodingUTF-8 PList_PListVersion0.9 PList_Prefix PList_FileFilenameInfo.plist PList_FileDirectory Path: PathFormatMacOS PathRootProject PList_ResourceTypeplst PList_ResourceID0 PList_ResourceName MWRez_Language_maxwidth80 MWRez_Language_scriptRoman MWRez_Language_alignmentAlign1 MWRez_Language_filtermodeFilterSkip MWRez_Language_suppresswarnings0 MWRez_Language_escapecontrolchars1 MWRez_Language_prefixnameStandaloneRez.h MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' MWWinRC_prefixname MWCodeGen_X86_processorGeneric MWCodeGen_X86_alignmentbytes8 MWCodeGen_X86_exceptionsZeroOverhead MWCodeGen_X86_name_manglingMWWin32 MWCodeGen_X86_use_extinst0 MWCodeGen_X86_extinst_mmx0 MWCodeGen_X86_extinst_3dnow0 MWCodeGen_X86_use_mmx_3dnow_convention0 MWCodeGen_X86_extinst_cmov0 MWCodeGen_X86_extinst_sse0 MWCodeGen_X86_extinst_sse20 MWCodeGen_X86_intrinsics0 MWCodeGen_X86_optimizeasm0 MWCodeGen_X86_disableopts0 MWCodeGen_X86_profile0 MWLinker_X86_runtimeCustom MWCodeGen_X86_readonlystrings0 MWCodeGen_X86_vectorize0 MWCodeGen_X86_relaxieee0 MWLinker_X86_subsysmajorid4 MWLinker_X86_subsysminorid0 MWCOFF_X86_opsysmajorid4 MWCOFF_X86_opsysminorid0 MWLinker_X86_usrmajorid0 MWLinker_X86_usrminorid0 MWProject_X86_maxstacksize1024 MWProject_X86_minstacksize4 MWProject_X86_size1024 MWProject_X86_minsize4 MWCOFF_X86_coff_flags0 MWCOFF_X86_dll_flags0 MWProject_X86_baseaddress4194304 MWCOFF_X86_filealign512 MWCOFF_X86_sectionalign4096 PDisasmX86_showHeaderstrue PDisasmX86_showSectHeaderstrue PDisasmX86_showSymTabtrue PDisasmX86_showCodetrue PDisasmX86_showDatatrue PDisasmX86_showDebugfalse PDisasmX86_showExceptionsfalse PDisasmX86_showRawfalse PDisasmX86_showAllRawfalse PDisasmX86_showSourcefalse PDisasmX86_showRelocationtrue PDisasmX86_showHextrue PDisasmX86_showCommentsfalse PDisasmX86_showSymDefstrue PDisasmX86_unmangletrue PDisasmX86_verbosetrue PDisasmX86_resolveRelocstrue PDisasmX86_resolveLocalsfalse MWDebugger_X86_Exceptions 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 GlobalOptimizer_X86_optimizationlevelLevel0 GlobalOptimizer_X86_optforSpeed MWLinker_X86_entrypointusageDefault MWLinker_X86_entrypoint MWLinker_X86_subsystemWinGUI MWLinker_X86_commandfile MWLinker_X86_generatemap0 MWLinker_X86_linksym0 MWLinker_X86_linkCV1 MWLinker_X86_symfullpathfalse MWLinker_X86_linkdebugtrue MWLinker_X86_checksumfalse MWLinker_X86_zero_init_bssfalse MWLinker_X86_mergedatafalse MWLinker_X86_usedefaultlibsfalse MWLinker_X86_adddefaultlibsfalse MWLinker_X86_nowarningsfalse MWLinker_X86_verbosefalse MWLinker_X86_linkformemfalse MWLinker_X86_codefoldingNone MWLinker_X86_debuginlinefalse MWProject_X86_typeApplication MWProject_X86_outfilenoname.exe MWProject_X86_importlib MWProject_X86_setimportlibdirfalse MWProject_X86_dontgenerateimportlibfalse MWProject_X86_oldformatlibfalse MWProject_X86_replaceobjextensionfalse MWProject_X86_copyallfilesfalse Name AtomConstants.h Unix Text Name AtomConstants.cpp Unix Text Debug Name ArrayObject.h Unix Text Name ArrayObject.cpp Unix Text Debug Name ArrayClass.h Unix Text Name AbstractFunction.h Unix Text Name AbstractFunction.cpp Unix Text Debug Name AbcParser.h Unix Text Name AbcParser.cpp Unix Text Debug Name XMLParser16.h Unix Text Name XMLParser16.cpp Unix Text Debug Name XMLObject.h Unix Text Name XMLObject.cpp Unix Text Debug Name XMLListObject.h Unix Text Name XMLListObject.cpp Unix Text Debug Name XMLListClass.h Unix Text Name XMLListClass.cpp Unix Text Debug Name XMLClass.h Unix Text Name XMLClass.cpp Unix Text Debug Name ArrayClass.cpp Unix Text Debug Name ActionBlockConstants.h Unix Text Name ActionBlockConstants.cpp Unix Text Debug Name StringBuffer.h Unix Text Name StringBuffer.cpp Unix Text Debug Name StaticProfiler.h Unix Text Name StaticProfiler.cpp Unix Text Debug Name StackTrace.h Unix Text Name StackTrace.cpp Unix Text Debug Name StringClass.h Unix Text Name Verifier.h Unix Text Name Verifier.cpp Unix Text Debug Name Accessor.h Unix Text Name Accessor.cpp Unix Text Debug Name ScriptObject.h Unix Text Name ScriptObject.cpp Unix Text Debug Name ScriptBuffer.h Unix Text Name ScriptBuffer.cpp Unix Text Debug Name ScopeChain.h Unix Text Name ScopeChain.cpp Unix Text Debug Name RegExpObject.h Unix Text Name RegExpObject.cpp Unix Text Debug Name RegExpClass.h Unix Text Name RegExpClass.cpp Unix Text Debug Name StringClass.cpp Unix Text Debug Name PrintWriter.h Unix Text Name PrintWriter.cpp Unix Text Debug Name PoolObject.h Unix Text Name PoolObject.cpp Unix Text Debug Name Interpreter.h Unix Text Name Interpreter.cpp Unix Text Debug Name IntClass.h Unix Text Name IntClass.cpp Unix Text Debug Name NativeObjectHelpers.h Unix Text Name OSDep.h Unix Text Name OutputStream.h Unix Text Name ObjectClass.h Unix Text Name ObjectClass.cpp Unix Text Debug Name NumberClass.h Unix Text Name NumberClass.cpp Unix Text Debug Name MethodInfo.h Unix Text Name MethodInfo.cpp Unix Text Debug Name MethodClosure.h Unix Text Name MethodClosure.cpp Unix Text Debug Name MathUtils.h Unix Text Name Namespace.cpp Unix Text Debug Name Multiname.h Unix Text Name Multiname.cpp Unix Text Debug Name NativeFunction.h Unix Text Name NativeFunction.cpp Unix Text Debug Name NamespaceClass.h Unix Text Name NamespaceClass.cpp Unix Text Debug Name Namespace.h Unix Text Name Toplevel.cpp Unix Text Debug Name StringObject.h Unix Text Name StringObject.cpp Unix Text Debug Name UnicodeUtils.h Unix Text Name UnicodeUtils.cpp Unix Text Debug Name types.h Unix Text Name Traits.h Unix Text Name Traits.cpp Unix Text Debug Name Toplevel.h Unix Text Name Exception.cpp Unix Text Debug Name ErrorConstants.h Unix Text Name ErrorClass.h Unix Text Name FunctionClass.h Unix Text Name FunctionClass.cpp Unix Text Debug Name FrameState.h Unix Text Name FrameState.cpp Unix Text Debug Name Exception.h Unix Text Name ErrorClass.cpp Unix Text Debug Name MathUtils.cpp Unix Text Debug Name MathClass.h Unix Text Name MathClass.cpp Unix Text Debug Name ClassClosure.h Unix Text Name ClassClass.h Unix Text Name ClassClass.cpp Unix Text Debug Name BuiltinTraits.h Unix Text Name ClassClosure.cpp Unix Text Debug Name BuiltinTraits.cpp Unix Text Debug Name DynamicProfiler.h Unix Text Name DynamicProfiler.cpp Unix Text Debug Name DateObject.h Unix Text Name DateObject.cpp Unix Text Debug Name DateClass.h Unix Text Name builtin.cpp Unix Text Debug Name DateClass.cpp Unix Text Debug Name Date.h Unix Text Name Date.cpp Unix Text Debug Name avmplusDebugger.h Unix Text Name avmplusDebugger.cpp Unix Text Debug Name avmplus.h Unix Text Name avmplus.cpp Unix Text Debug Name AvmDebug.h Unix Text Name avmbuild.h Unix Text Name BooleanClass.h Unix Text Name BooleanClass.cpp Unix Text Debug Name avmplusVersion.h Unix Text Name ErrorConstants.cpp Unix Text Debug Name avmplusProfiler.h Unix Text Name avmplusHashtable.h Unix Text Name avmplusHashtable.cpp Unix Text Debug Name AvmCore.h Unix Text Name AvmCore.cpp Unix Text Debug Name OSDepMac.cpp Unix Text Debug Name NativeFunctionMac.cpp Unix Text Debug Name MathUtilsMac.cpp Unix Text Debug Name avmplusStack.h Unix Text Name AvmDebugMac.cpp Unix Text Debug Name MethodEnv.h Unix Text Name MethodEnv.cpp Unix Text Debug Name AbcEnv.h Unix Text Name AbcEnv.cpp Unix Text Debug Name VTable.cpp Unix Text Debug Name VTable.h Unix Text Name CodegenMIR.h Unix Text Name BigInteger.cpp Unix Text Debug Name BigInteger.h Unix Text Name macho_release.pch++ Unix Text Debug Name AtomArray.h Unix Text Name AtomArray.cpp Unix Text Debug Name avmplusProfiler.cpp Unix Text Debug Name CodegenMIR.cpp Unix Text Debug Name DateMac.cpp Unix Text Debug Name DateMac.h Unix Text Name MultinameHashtable.h Unix Text Name MultinameHashtable.cpp Unix Text Debug Name NamespaceSet.h Unix Text Name NamespaceSet.cpp Unix Text Debug Name DomainEnv.h Unix Text Name DomainEnv.cpp Unix Text Debug Name Domain.h Unix Text Name Domain.cpp Unix Text Debug Name GrowableBuffer.h Unix Text Name GrowableBuffer.cpp Unix Text Debug Name AbcGen.h Unix Text Name AbcGen.cpp Unix Text Debug Name E4XNode.h Unix Text Name E4XNode.cpp Unix Text Debug Name PpcAssembler.cpp Unix Text Debug Name pcre_info.cpp Unix Text Debug Name pcre_globals.cpp Unix Text Debug Name pcre_get.cpp Unix Text Debug Name pcre_fullinfo.cpp Unix Text Debug Name pcre_exec.cpp Unix Text Debug Name pcre_config.cpp Unix Text Debug Name pcre_compile.cpp Unix Text Debug Name pcre_chartables.cpp Unix Text Debug Name pcre_ord2utf8.cpp Unix Text Debug Name pcre_maketables.cpp Unix Text Debug Name pcre_refcount.cpp Unix Text Debug Name pcre_valid_utf8.cpp Unix Text Debug Name pcre_try_flipped.cpp Unix Text Debug Name pcre_tables.cpp Unix Text Debug Name pcre_study.cpp Unix Text Debug Name pcre.h Unix Text Name pcre_xclass.cpp Unix Text Debug Name pcre_version.cpp Unix Text Debug Name AvmPlusScriptableObject.cpp Unix Text Debug Name AvmPlusScriptableObject.h Unix Text Name AtomConstants.h Unix Name AtomConstants.cpp Unix Name ArrayObject.h Unix Name ArrayObject.cpp Unix Name ArrayClass.h Unix Name AbstractFunction.h Unix Name AbstractFunction.cpp Unix Name AbcParser.h Unix Name AbcParser.cpp Unix Name XMLParser16.h Unix Name XMLParser16.cpp Unix Name XMLObject.h Unix Name XMLObject.cpp Unix Name XMLListObject.h Unix Name XMLListObject.cpp Unix Name XMLListClass.h Unix Name XMLListClass.cpp Unix Name XMLClass.h Unix Name XMLClass.cpp Unix Name ArrayClass.cpp Unix Name ActionBlockConstants.h Unix Name ActionBlockConstants.cpp Unix Name StringBuffer.h Unix Name StringBuffer.cpp Unix Name StaticProfiler.h Unix Name StaticProfiler.cpp Unix Name StackTrace.h Unix Name StackTrace.cpp Unix Name StringClass.h Unix Name Verifier.h Unix Name Verifier.cpp Unix Name Accessor.h Unix Name Accessor.cpp Unix Name ScriptObject.h Unix Name ScriptObject.cpp Unix Name ScriptBuffer.h Unix Name ScriptBuffer.cpp Unix Name ScopeChain.h Unix Name ScopeChain.cpp Unix Name RegExpObject.h Unix Name RegExpObject.cpp Unix Name RegExpClass.h Unix Name RegExpClass.cpp Unix Name StringClass.cpp Unix Name PrintWriter.h Unix Name PrintWriter.cpp Unix Name PoolObject.h Unix Name PoolObject.cpp Unix Name Interpreter.h Unix Name Interpreter.cpp Unix Name IntClass.h Unix Name IntClass.cpp Unix Name NativeObjectHelpers.h Unix Name OSDep.h Unix Name OutputStream.h Unix Name ObjectClass.h Unix Name ObjectClass.cpp Unix Name NumberClass.h Unix Name NumberClass.cpp Unix Name MethodInfo.h Unix Name MethodInfo.cpp Unix Name MethodClosure.h Unix Name MethodClosure.cpp Unix Name MathUtils.h Unix Name Namespace.cpp Unix Name Multiname.h Unix Name Multiname.cpp Unix Name NativeFunction.h Unix Name NativeFunction.cpp Unix Name NamespaceClass.h Unix Name NamespaceClass.cpp Unix Name Namespace.h Unix Name Toplevel.cpp Unix Name StringObject.h Unix Name StringObject.cpp Unix Name UnicodeUtils.h Unix Name UnicodeUtils.cpp Unix Name types.h Unix Name Traits.h Unix Name Traits.cpp Unix Name Toplevel.h Unix Name Exception.cpp Unix Name ErrorConstants.h Unix Name ErrorClass.h Unix Name FunctionClass.h Unix Name FunctionClass.cpp Unix Name FrameState.h Unix Name FrameState.cpp Unix Name Exception.h Unix Name ErrorClass.cpp Unix Name MathUtils.cpp Unix Name MathClass.h Unix Name MathClass.cpp Unix Name ClassClosure.h Unix Name ClassClass.h Unix Name ClassClass.cpp Unix Name BuiltinTraits.h Unix Name ClassClosure.cpp Unix Name BuiltinTraits.cpp Unix Name DynamicProfiler.h Unix Name DynamicProfiler.cpp Unix Name DateObject.h Unix Name DateObject.cpp Unix Name DateClass.h Unix Name builtin.cpp Unix Name DateClass.cpp Unix Name Date.h Unix Name Date.cpp Unix Name avmplusDebugger.h Unix Name avmplusDebugger.cpp Unix Name avmplus.h Unix Name avmplus.cpp Unix Name AvmDebug.h Unix Name avmbuild.h Unix Name BooleanClass.h Unix Name BooleanClass.cpp Unix Name avmplusVersion.h Unix Name ErrorConstants.cpp Unix Name avmplusProfiler.h Unix Name avmplusHashtable.h Unix Name avmplusHashtable.cpp Unix Name AvmCore.h Unix Name AvmCore.cpp Unix Name OSDepMac.cpp Unix Name NativeFunctionMac.cpp Unix Name MathUtilsMac.cpp Unix Name avmplusStack.h Unix Name AvmDebugMac.cpp Unix Name MethodEnv.h Unix Name MethodEnv.cpp Unix Name AbcEnv.h Unix Name AbcEnv.cpp Unix Name VTable.cpp Unix Name VTable.h Unix Name CodegenMIR.h Unix Name BigInteger.cpp Unix Name BigInteger.h Unix Name macho_release.pch++ Unix Name AtomArray.h Unix Name AtomArray.cpp Unix Name avmplusProfiler.cpp Unix Name CodegenMIR.cpp Unix Name DateMac.cpp Unix Name DateMac.h Unix Name MultinameHashtable.h Unix Name MultinameHashtable.cpp Unix Name NamespaceSet.h Unix Name NamespaceSet.cpp Unix Name DomainEnv.h Unix Name DomainEnv.cpp Unix Name Domain.h Unix Name Domain.cpp Unix Name GrowableBuffer.h Unix Name GrowableBuffer.cpp Unix Name AbcGen.h Unix Name AbcGen.cpp Unix Name E4XNode.h Unix Name E4XNode.cpp Unix Name PpcAssembler.cpp Unix Name pcre_info.cpp Unix Name pcre_globals.cpp Unix Name pcre_get.cpp Unix Name pcre_fullinfo.cpp Unix Name pcre_exec.cpp Unix Name pcre_config.cpp Unix Name pcre_compile.cpp Unix Name pcre_chartables.cpp Unix Name pcre_ord2utf8.cpp Unix Name pcre_maketables.cpp Unix Name pcre_refcount.cpp Unix Name pcre_valid_utf8.cpp Unix Name pcre_try_flipped.cpp Unix Name pcre_tables.cpp Unix Name pcre_study.cpp Unix Name pcre.h Unix Name pcre_xclass.cpp Unix Name pcre_version.cpp Unix Name AvmPlusScriptableObject.cpp Unix Name AvmPlusScriptableObject.h Unix Mach-O D-Debug UserSourceTrees AlwaysSearchUserPathsfalse InterpretDOSAndUnixPathsfalse RequireFrameworkStyleIncludesfalse SourceRelativeIncludesfalse UserSearchPaths SearchPath Path../../core PathFormatUnix PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path../../MMgc PathFormatUnix PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path PathFormatUnix PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path../.. PathFormatUnix PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path../../pcre PathFormatUnix PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SystemSearchPaths SearchPath PathMacOS X Support/Headers/(wchar_t Support fix) PathFormatUnix PathRootCodeWarrior Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath PathMacOS X Support/Headers/Alloca PathFormatUnix PathRootCodeWarrior Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path../../../../../../../vendors/fpMacOSX.sdk/usr/include PathFormatUnix PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path../../../../../../../vendors/fpMacOSX.sdk/usr/lib PathFormatUnix PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path../../../../../../../vendors/fpMacOSX.sdk/System/Library/Frameworks PathFormatUnix PathRootProject Recursivefalse FrameworkPathtrue HostFlagsAll SearchPath PathMacOS X Support PathFormatUnix PathRootCodeWarrior Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path../../../../../../../vendors/fpMacOSX.sdk/Developer/Headers/FlatCarbon PathFormatUnix PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll MWRuntimeSettings_WorkingDirectory MWRuntimeSettings_CommandLine MWRuntimeSettings_HostApplication Path PathFormatGeneric PathRootAbsolute MWRuntimeSettings_EnvVars LinkerMacOS X PPC Linker PreLinker PostLinker TargetnameMach-O D-Debug OutputDirectory Path: PathFormatMacOS PathRootProject SaveEntriesUsingRelativePathsfalse FileMappings FileTypeAPPL FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeAppl FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeMDYL FileExtension CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMLIB FileExtension CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMMLB FileExtension CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMPLF FileExtension CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMWCD FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeRSRC FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeTEXT FileExtension.arr Compiler EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.axp Compiler EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.c CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.c++ CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cc CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cp CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cpp CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.exp Compiler EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.h CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileTypeTEXT FileExtension.h++ CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileTypeTEXT FileExtension.hpp CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileTypeTEXT FileExtension.lcf Compiler EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.m CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.mm CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pch CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pch++ CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pchm CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pchmm CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.plc CompilerProperty List Compiler EditLanguageProperty List Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.ploc CompilerProperty List Compiler EditLanguageProperty List Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.r CompilerRez EditLanguageRez Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.wke Compiler EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypedocu FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypersrc FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileExtension.a CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileExtension.doc Compiler EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue FileExtension.dylib CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileExtension.gif CompilerCopy To Package EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue FileExtension.icns CompilerCopy To Package EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue FileExtension.jpg CompilerCopy To Package EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue FileExtension.lib CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileExtension.nib CompilerCopy To Package EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue FileExtension.pl CompilerPerl Tool EditLanguagePerl Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileExtension.plist CompilerCopy To Package EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileExtension.ppob Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileExtension.psh CompilerShell Tool EditLanguage Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileExtension.rsrc Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileExtension.sh CompilerShell Tool EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileExtension.strings CompilerCopy To Package EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileExtension.tiff CompilerCopy To Package EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue CacheModDatestrue DumpBrowserInfofalse CacheSubprojectstrue UseThirdPartyDebuggerfalse BrowserGenerator1 DebuggerAppPath Path PathFormatGeneric PathRootAbsolute DebuggerCmdLineArgs DebuggerWorkingDir Path PathFormatGeneric PathRootAbsolute CodeCompletionPrefixFileNameMacHeaders.c CodeCompletionMacroFileNameMacOS_Carbon_C++_Macros.h ConsoleEncoding0 LogSystemMessagesfalse AutoTargetDLLsPopUp0 StopAtWatchpointstrue PauseWhileRunningfalse PauseInterval5 PauseUIFlags0 AltExePath Path PathFormatGeneric PathRootAbsolute StopAtTempBPOnLaunchtrue CacheSymbolicstrue TempBPFunctionNamemain TempBPType0 Enabledfalse ConnectionName DownloadPath LaunchRemoteAppfalse RemoteAppPath CoreID0 JTAGClockSpeed8000 IsMultiCorefalse OSDownloadfalse UseGlobalOSDownloadfalse OSDownloadConnectionName OSDownloadPath AltDownloadfalse AltDownloadConnectionName OtherExecutables AnalyzerConnectionName CustomColor1 Red0 Green32767 Blue0 CustomColor2 Red0 Green32767 Blue0 CustomColor3 Red0 Green32767 Blue0 CustomColor4 Red0 Green32767 Blue0 MWFrontEnd_C_cplusplus0 MWFrontEnd_C_checkprotos0 MWFrontEnd_C_arm0 MWFrontEnd_C_trigraphs0 MWFrontEnd_C_onlystdkeywords0 MWFrontEnd_C_enumsalwaysint1 MWFrontEnd_C_ansistrict0 MWFrontEnd_C_wchar_type1 MWFrontEnd_C_enableexceptions0 MWFrontEnd_C_dontreusestrings0 MWFrontEnd_C_poolstrings0 MWFrontEnd_C_dontinline1 MWFrontEnd_C_useRTTI0 MWFrontEnd_C_unsignedchars0 MWFrontEnd_C_autoinline0 MWFrontEnd_C_booltruefalse1 MWFrontEnd_C_inlinelevel0 MWFrontEnd_C_ecplusplus0 MWFrontEnd_C_defer_codegen0 MWFrontEnd_C_templateparser0 MWFrontEnd_C_c990 MWFrontEnd_C_bottomupinline1 MWFrontEnd_C_gcc_extensions0 MWFrontEnd_C_instance_manager0 C_CPP_Preprocessor_EmitFiletrue C_CPP_Preprocessor_EmitLinefalse C_CPP_Preprocessor_EmitFullPathfalse C_CPP_Preprocessor_KeepCommentsfalse C_CPP_Preprocessor_PCHUsesPrefixTextfalse C_CPP_Preprocessor_EmitPragmastrue C_CPP_Preprocessor_KeepWhiteSpacefalse C_CPP_Preprocessor_MultiByteEncodingencAutoDetectMultibyte C_CPP_Preprocessor_PrefixText#if !__option(precompile) #include "macho_debuggerdebug.mch++" #endif MWWarning_C_warn_illpragma1 MWWarning_C_warn_emptydecl1 MWWarning_C_warn_possunwant1 MWWarning_C_warn_unusedvar1 MWWarning_C_warn_unusedarg0 MWWarning_C_warn_extracomma0 MWWarning_C_pedantic1 MWWarning_C_warningerrors0 MWWarning_C_warn_hidevirtual0 MWWarning_C_warn_implicitconv0 MWWarning_C_warn_notinlined0 MWWarning_C_warn_structclass1 MWWarning_C_warn_missingreturn0 MWWarning_C_warn_no_side_effect0 MWWarning_C_warn_resultnotused0 MWWarning_C_warn_padding0 MWWarning_C_warn_impl_i2f_conv0 MWWarning_C_warn_impl_f2i_conv0 MWWarning_C_warn_impl_s2u_conv0 MWWarning_C_warn_illtokenpasting0 MWWarning_C_warn_filenamecaps0 MWWarning_C_warn_filenamecapssystem0 MWWarning_C_warn_undefmacro0 MWWarning_C_warn_ptrintconv1 MWMerge_MacOS_projectTypeApplication MWMerge_MacOS_outputNameMerge Out MWMerge_MacOS_outputCreator???? MWMerge_MacOS_outputTypeAPPL MWMerge_MacOS_suppressWarning0 MWMerge_MacOS_copyFragments1 MWMerge_MacOS_copyResources1 MWMerge_MacOS_flattenResource0 MWMerge_MacOS_flatFileNamea.rsrc MWMerge_MacOS_flatFileOutputPath Path: PathFormatMacOS PathRootProject MWMerge_MacOS_skipResources DLGX ckid Proj WSPC FileLockedfalse ResourcesMapIsReadOnlyfalse PrinterDriverIsMultiFinderCompatiblefalse Invisiblefalse HasBundlefalse NameLockedfalse Stationeryfalse HasCustomIconfalse Sharedfalse HasBeenInitedfalse Label0 Comments HasCustomBadgefalse HasRoutingInfofalse MWCodeGen_PPC_structalignmentPPC_mw MWCodeGen_PPC_tracebacktablesInline MWCodeGen_PPC_processorGeneric MWCodeGen_PPC_function_align4 MWCodeGen_PPC_tocdata1 MWCodeGen_PPC_largetoc0 MWCodeGen_PPC_profiler0 MWCodeGen_PPC_vectortocdata1 MWCodeGen_PPC_poolconst0 MWCodeGen_PPC_peephole0 MWCodeGen_PPC_readonlystrings0 MWCodeGen_PPC_linkerpoolsstrings0 MWCodeGen_PPC_volatileasm0 MWCodeGen_PPC_schedule0 MWCodeGen_PPC_altivec1 MWCodeGen_PPC_altivec_move_block0 MWCodeGen_PPC_strictIEEEfp0 MWCodeGen_PPC_fpcontract1 MWCodeGen_PPC_genfsel0 MWCodeGen_PPC_orderedfpcmp0 MWCodeGen_MachO_structalignmentPPC_mw MWCodeGen_MachO_profiler_enumOff MWCodeGen_MachO_processorGeneric MWCodeGen_MachO_function_align4 MWCodeGen_MachO_common0 MWCodeGen_MachO_boolisint0 MWCodeGen_MachO_peephole1 MWCodeGen_MachO_readonlystrings0 MWCodeGen_MachO_linkerpoolsstrings1 MWCodeGen_MachO_volatileasm0 MWCodeGen_MachO_schedule0 MWCodeGen_MachO_altivec0 MWCodeGen_MachO_vecmove0 MWCodeGen_MachO_fp_ieee_strict0 MWCodeGen_MachO_fpcontract1 MWCodeGen_MachO_genfsel0 MWCodeGen_MachO_fp_cmps_ordered0 MWDisassembler_PPC_showcode1 MWDisassembler_PPC_extended1 MWDisassembler_PPC_mix0 MWDisassembler_PPC_nohex0 MWDisassembler_PPC_showdata1 MWDisassembler_PPC_showexceptions1 MWDisassembler_PPC_showsym1 MWDisassembler_PPC_shownames1 GlobalOptimizer_PPC_optimizationlevelLevel0 GlobalOptimizer_PPC_optforSize MWLinker_PPC_linksym1 MWLinker_PPC_symfullpath1 MWLinker_PPC_linkmap1 MWLinker_PPC_nolinkwarnings0 MWLinker_PPC_dontdeadstripinitcode0 MWLinker_PPC_permitmultdefs0 MWLinker_PPC_linkmodeFast MWLinker_PPC_code_foldingNone MWLinker_PPC_initname MWLinker_PPC_mainname__start MWLinker_PPC_termname MWLinker_MacOSX_linksym0 MWLinker_MacOSX_symfullpath0 MWLinker_MacOSX_nolinkwarnings0 MWLinker_MacOSX_linkmap0 MWLinker_MacOSX_dontdeadstripinitcode0 MWLinker_MacOSX_permitmultdefs1 MWLinker_MacOSX_use_objectivec_semantics0 MWLinker_MacOSX_strip_debug_symbols0 MWLinker_MacOSX_prebind_all_twolevel_modules0 MWLinker_MacOSX_data_before_text_segment0 MWLinker_MacOSX_report_msl_overloads0 MWLinker_MacOSX_objects_follow_linkorder0 MWLinker_MacOSX_linkmodeFast MWLinker_MacOSX_exportsReferencedGlobals MWLinker_MacOSX_sortcodeNone MWLinker_MacOSX_mainnamestart MWLinker_MacOSX_initname MWLinker_MacOSX_code_foldingNone MWLinker_MacOSX_stabsgenNone MWProject_MacOSX_typeLibrary MWProject_MacOSX_outfileavmplus_macho_ddebug.lib MWProject_MacOSX_filecreatorCWIE MWProject_MacOSX_filetypeMLIB MWProject_MacOSX_vmaddress0 MWProject_MacOSX_usedefaultvmaddr1 MWProject_MacOSX_flatrsrc0 MWProject_MacOSX_flatrsrcfilename MWProject_MacOSX_flatrsrcoutputdir Path: PathFormatMacOS PathRootProject MWProject_MacOSX_installpath./ MWProject_MacOSX_dont_prebind0 MWProject_MacOSX_flat_namespace0 MWProject_MacOSX_frameworkversionA MWProject_MacOSX_currentversion0 MWProject_MacOSX_flat_oldimpversion0 MWProject_MacOSX_AddrMode0 MWPEF_exportsNone MWPEF_libfolder0 MWPEF_sortcodeNone MWPEF_expandbss0 MWPEF_sharedata0 MWPEF_olddefversion0 MWPEF_oldimpversion0 MWPEF_currentversion0 MWPEF_fragmentname MWPEF_collapsereloads0 MWProject_PPC_typeLibrary MWProject_PPC_outfileavmplus_carbon_ddebug.lib MWProject_PPC_filecreator???? MWProject_PPC_filetype???? MWProject_PPC_size0 MWProject_PPC_minsize0 MWProject_PPC_stacksize0 MWProject_PPC_flags0 MWProject_PPC_symfilename MWProject_PPC_rsrcname MWProject_PPC_rsrcheaderNative MWProject_PPC_rsrctype???? MWProject_PPC_rsrcid0 MWProject_PPC_rsrcflags0 MWProject_PPC_rsrcstore0 MWProject_PPC_rsrcmerge0 MWProject_PPC_flatrsrc0 MWProject_PPC_flatrsrcoutputdir Path: PathFormatMacOS PathRootProject MWProject_PPC_flatrsrcfilename MWAssembler_PPC_auxheader0 MWAssembler_PPC_symmodeMac MWAssembler_PPC_dialectPPC MWAssembler_PPC_prefixfile MWAssembler_PPC_typecheck0 MWAssembler_PPC_warnings0 MWAssembler_PPC_casesensitive0 PList_OutputTypeFile PList_OutputEncodingUTF-8 PList_PListVersion0.9 PList_Prefix PList_FileFilenameInfo.plist PList_FileDirectory Path: PathFormatMacOS PathRootProject PList_ResourceTypeplst PList_ResourceID0 PList_ResourceName MWRez_Language_maxwidth80 MWRez_Language_scriptRoman MWRez_Language_alignmentAlign1 MWRez_Language_filtermodeFilterSkip MWRez_Language_suppresswarnings0 MWRez_Language_escapecontrolchars1 MWRez_Language_prefixnameStandaloneRezDebuggerDebug.h MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' MWWinRC_prefixname MWCodeGen_X86_processorGeneric MWCodeGen_X86_alignmentbytes8 MWCodeGen_X86_exceptionsZeroOverhead MWCodeGen_X86_name_manglingMWWin32 MWCodeGen_X86_use_extinst0 MWCodeGen_X86_extinst_mmx0 MWCodeGen_X86_extinst_3dnow0 MWCodeGen_X86_use_mmx_3dnow_convention0 MWCodeGen_X86_extinst_cmov0 MWCodeGen_X86_extinst_sse0 MWCodeGen_X86_extinst_sse20 MWCodeGen_X86_intrinsics0 MWCodeGen_X86_optimizeasm0 MWCodeGen_X86_disableopts0 MWCodeGen_X86_profile0 MWLinker_X86_runtimeCustom MWCodeGen_X86_readonlystrings0 MWCodeGen_X86_vectorize0 MWCodeGen_X86_relaxieee0 MWLinker_X86_subsysmajorid4 MWLinker_X86_subsysminorid0 MWCOFF_X86_opsysmajorid4 MWCOFF_X86_opsysminorid0 MWLinker_X86_usrmajorid0 MWLinker_X86_usrminorid0 MWProject_X86_maxstacksize1024 MWProject_X86_minstacksize4 MWProject_X86_size1024 MWProject_X86_minsize4 MWCOFF_X86_coff_flags0 MWCOFF_X86_dll_flags0 MWProject_X86_baseaddress4194304 MWCOFF_X86_filealign512 MWCOFF_X86_sectionalign4096 PDisasmX86_showHeaderstrue PDisasmX86_showSectHeaderstrue PDisasmX86_showSymTabtrue PDisasmX86_showCodetrue PDisasmX86_showDatatrue PDisasmX86_showDebugfalse PDisasmX86_showExceptionsfalse PDisasmX86_showRawfalse PDisasmX86_showAllRawfalse PDisasmX86_showSourcefalse PDisasmX86_showRelocationtrue PDisasmX86_showHextrue PDisasmX86_showCommentsfalse PDisasmX86_showSymDefstrue PDisasmX86_unmanglefalse PDisasmX86_verbosefalse PDisasmX86_resolveRelocstrue PDisasmX86_resolveLocalsfalse MWDebugger_X86_Exceptions 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 GlobalOptimizer_X86_optimizationlevelLevel0 GlobalOptimizer_X86_optforSpeed MWLinker_X86_entrypointusageDefault MWLinker_X86_entrypoint MWLinker_X86_subsystemWinGUI MWLinker_X86_commandfile MWLinker_X86_generatemap0 MWLinker_X86_linksym0 MWLinker_X86_linkCV1 MWLinker_X86_symfullpathfalse MWLinker_X86_linkdebugtrue MWLinker_X86_checksumfalse MWLinker_X86_zero_init_bssfalse MWLinker_X86_mergedatafalse MWLinker_X86_usedefaultlibsfalse MWLinker_X86_adddefaultlibsfalse MWLinker_X86_nowarningsfalse MWLinker_X86_verbosefalse MWLinker_X86_linkformemfalse MWLinker_X86_codefoldingNone MWLinker_X86_debuginlinefalse MWProject_X86_typeApplication MWProject_X86_outfilenoname.exe MWProject_X86_importlib MWProject_X86_setimportlibdirfalse MWProject_X86_dontgenerateimportlibfalse MWProject_X86_oldformatlibfalse MWProject_X86_replaceobjextensionfalse MWProject_X86_copyallfilesfalse Name AtomConstants.h Unix Text Name AtomConstants.cpp Unix Text Debug Name ArrayObject.h Unix Text Name ArrayObject.cpp Unix Text Debug Name ArrayClass.h Unix Text Name AbstractFunction.h Unix Text Name AbstractFunction.cpp Unix Text Debug Name AbcParser.h Unix Text Name AbcParser.cpp Unix Text Debug Name XMLParser16.h Unix Text Name XMLParser16.cpp Unix Text Debug Name XMLObject.h Unix Text Name XMLObject.cpp Unix Text Debug Name XMLListObject.h Unix Text Name XMLListObject.cpp Unix Text Debug Name XMLListClass.h Unix Text Name XMLListClass.cpp Unix Text Debug Name XMLClass.h Unix Text Name XMLClass.cpp Unix Text Debug Name ArrayClass.cpp Unix Text Debug Name ActionBlockConstants.h Unix Text Name ActionBlockConstants.cpp Unix Text Debug Name StringBuffer.h Unix Text Name StringBuffer.cpp Unix Text Debug Name StaticProfiler.h Unix Text Name StaticProfiler.cpp Unix Text Debug Name StackTrace.h Unix Text Name StackTrace.cpp Unix Text Debug Name StringClass.h Unix Text Name Verifier.h Unix Text Name Verifier.cpp Unix Text Debug Name Accessor.h Unix Text Name Accessor.cpp Unix Text Debug Name ScriptObject.h Unix Text Name ScriptObject.cpp Unix Text Debug Name ScriptBuffer.h Unix Text Name ScriptBuffer.cpp Unix Text Debug Name ScopeChain.h Unix Text Name ScopeChain.cpp Unix Text Debug Name RegExpObject.h Unix Text Name RegExpObject.cpp Unix Text Debug Name RegExpClass.h Unix Text Name RegExpClass.cpp Unix Text Debug Name StringClass.cpp Unix Text Debug Name PrintWriter.h Unix Text Name PrintWriter.cpp Unix Text Debug Name PoolObject.h Unix Text Name PoolObject.cpp Unix Text Debug Name Interpreter.h Unix Text Name Interpreter.cpp Unix Text Debug Name IntClass.h Unix Text Name IntClass.cpp Unix Text Debug Name NativeObjectHelpers.h Unix Text Name OSDep.h Unix Text Name OutputStream.h Unix Text Name ObjectClass.h Unix Text Name ObjectClass.cpp Unix Text Debug Name NumberClass.h Unix Text Name NumberClass.cpp Unix Text Debug Name MethodInfo.h Unix Text Name MethodInfo.cpp Unix Text Debug Name MethodClosure.h Unix Text Name MethodClosure.cpp Unix Text Debug Name MathUtils.h Unix Text Name Namespace.cpp Unix Text Debug Name Multiname.h Unix Text Name Multiname.cpp Unix Text Debug Name NativeFunction.h Unix Text Name NativeFunction.cpp Unix Text Debug Name NamespaceClass.h Unix Text Name NamespaceClass.cpp Unix Text Debug Name Namespace.h Unix Text Name Toplevel.cpp Unix Text Debug Name StringObject.h Unix Text Name StringObject.cpp Unix Text Debug Name UnicodeUtils.h Unix Text Name UnicodeUtils.cpp Unix Text Debug Name types.h Unix Text Name Traits.h Unix Text Name Traits.cpp Unix Text Debug Name Toplevel.h Unix Text Name Exception.cpp Unix Text Debug Name ErrorConstants.h Unix Text Name ErrorClass.h Unix Text Name FunctionClass.h Unix Text Name FunctionClass.cpp Unix Text Debug Name FrameState.h Unix Text Name FrameState.cpp Unix Text Debug Name Exception.h Unix Text Name ErrorClass.cpp Unix Text Debug Name MathUtils.cpp Unix Text Debug Name MathClass.h Unix Text Name MathClass.cpp Unix Text Debug Name ClassClosure.h Unix Text Name ClassClass.h Unix Text Name ClassClass.cpp Unix Text Debug Name BuiltinTraits.h Unix Text Name ClassClosure.cpp Unix Text Debug Name BuiltinTraits.cpp Unix Text Debug Name DynamicProfiler.h Unix Text Name DynamicProfiler.cpp Unix Text Debug Name DateObject.h Unix Text Name DateObject.cpp Unix Text Debug Name DateClass.h Unix Text Name builtin.cpp Unix Text Debug Name DateClass.cpp Unix Text Debug Name Date.h Unix Text Name Date.cpp Unix Text Debug Name avmplusDebugger.h Unix Text Name avmplusDebugger.cpp Unix Text Debug Name avmplus.h Unix Text Name avmplus.cpp Unix Text Debug Name AvmDebug.h Unix Text Name avmbuild.h Unix Text Name BooleanClass.h Unix Text Name BooleanClass.cpp Unix Text Debug Name avmplusVersion.h Unix Text Name ErrorConstants.cpp Unix Text Debug Name avmplusProfiler.h Unix Text Name avmplusHashtable.h Unix Text Name avmplusHashtable.cpp Unix Text Debug Name AvmCore.h Unix Text Name AvmCore.cpp Unix Text Debug Name OSDepMac.cpp Unix Text Debug Name NativeFunctionMac.cpp Unix Text Debug Name MathUtilsMac.cpp Unix Text Debug Name avmplusStack.h Unix Text Name AvmDebugMac.cpp Unix Text Debug Name MethodEnv.h Unix Text Name MethodEnv.cpp Unix Text Debug Name AbcEnv.h Unix Text Name AbcEnv.cpp Unix Text Debug Name VTable.cpp Unix Text Debug Name VTable.h Unix Text Name CodegenMIR.h Unix Text Name BigInteger.cpp Unix Text Debug Name BigInteger.h Unix Text Name macho_debuggerdebug.pch++ Unix Text Debug Name AtomArray.h Unix Text Name AtomArray.cpp Unix Text Debug Name avmplusProfiler.cpp Unix Text Debug Name CodegenMIR.cpp Unix Text Debug Name DateMac.cpp Unix Text Debug Name DateMac.h Unix Text Name MultinameHashtable.h Unix Text Name MultinameHashtable.cpp Unix Text Debug Name NamespaceSet.h Unix Text Name NamespaceSet.cpp Unix Text Debug Name DomainEnv.h Unix Text Name DomainEnv.cpp Unix Text Debug Name Domain.h Unix Text Name Domain.cpp Unix Text Debug Name GrowableBuffer.h Unix Text Name GrowableBuffer.cpp Unix Text Debug Name AbcGen.h Unix Text Name AbcGen.cpp Unix Text Debug Name E4XNode.h Unix Text Name E4XNode.cpp Unix Text Debug Name PpcAssembler.cpp Unix Text Debug Name pcre_info.cpp Unix Text Debug Name pcre_globals.cpp Unix Text Debug Name pcre_get.cpp Unix Text Debug Name pcre_fullinfo.cpp Unix Text Debug Name pcre_exec.cpp Unix Text Debug Name pcre_config.cpp Unix Text Debug Name pcre_compile.cpp Unix Text Debug Name pcre_chartables.cpp Unix Text Debug Name pcre_ord2utf8.cpp Unix Text Debug Name pcre_maketables.cpp Unix Text Debug Name pcre_refcount.cpp Unix Text Debug Name pcre_valid_utf8.cpp Unix Text Debug Name pcre_try_flipped.cpp Unix Text Debug Name pcre_tables.cpp Unix Text Debug Name pcre_study.cpp Unix Text Debug Name pcre.h Unix Text Name pcre_xclass.cpp Unix Text Debug Name pcre_version.cpp Unix Text Debug Name AvmPlusScriptableObject.cpp Unix Text Debug Name AvmPlusScriptableObject.h Unix Text Name AtomConstants.h Unix Name AtomConstants.cpp Unix Name ArrayObject.h Unix Name ArrayObject.cpp Unix Name ArrayClass.h Unix Name AbstractFunction.h Unix Name AbstractFunction.cpp Unix Name AbcParser.h Unix Name AbcParser.cpp Unix Name XMLParser16.h Unix Name XMLParser16.cpp Unix Name XMLObject.h Unix Name XMLObject.cpp Unix Name XMLListObject.h Unix Name XMLListObject.cpp Unix Name XMLListClass.h Unix Name XMLListClass.cpp Unix Name XMLClass.h Unix Name XMLClass.cpp Unix Name ArrayClass.cpp Unix Name ActionBlockConstants.h Unix Name ActionBlockConstants.cpp Unix Name StringBuffer.h Unix Name StringBuffer.cpp Unix Name StaticProfiler.h Unix Name StaticProfiler.cpp Unix Name StackTrace.h Unix Name StackTrace.cpp Unix Name StringClass.h Unix Name Verifier.h Unix Name Verifier.cpp Unix Name Accessor.h Unix Name Accessor.cpp Unix Name ScriptObject.h Unix Name ScriptObject.cpp Unix Name ScriptBuffer.h Unix Name ScriptBuffer.cpp Unix Name ScopeChain.h Unix Name ScopeChain.cpp Unix Name RegExpObject.h Unix Name RegExpObject.cpp Unix Name RegExpClass.h Unix Name RegExpClass.cpp Unix Name StringClass.cpp Unix Name PrintWriter.h Unix Name PrintWriter.cpp Unix Name PoolObject.h Unix Name PoolObject.cpp Unix Name Interpreter.h Unix Name Interpreter.cpp Unix Name IntClass.h Unix Name IntClass.cpp Unix Name NativeObjectHelpers.h Unix Name OSDep.h Unix Name OutputStream.h Unix Name ObjectClass.h Unix Name ObjectClass.cpp Unix Name NumberClass.h Unix Name NumberClass.cpp Unix Name MethodInfo.h Unix Name MethodInfo.cpp Unix Name MethodClosure.h Unix Name MethodClosure.cpp Unix Name MathUtils.h Unix Name Namespace.cpp Unix Name Multiname.h Unix Name Multiname.cpp Unix Name NativeFunction.h Unix Name NativeFunction.cpp Unix Name NamespaceClass.h Unix Name NamespaceClass.cpp Unix Name Namespace.h Unix Name Toplevel.cpp Unix Name StringObject.h Unix Name StringObject.cpp Unix Name UnicodeUtils.h Unix Name UnicodeUtils.cpp Unix Name types.h Unix Name Traits.h Unix Name Traits.cpp Unix Name Toplevel.h Unix Name Exception.cpp Unix Name ErrorConstants.h Unix Name ErrorClass.h Unix Name FunctionClass.h Unix Name FunctionClass.cpp Unix Name FrameState.h Unix Name FrameState.cpp Unix Name Exception.h Unix Name ErrorClass.cpp Unix Name MathUtils.cpp Unix Name MathClass.h Unix Name MathClass.cpp Unix Name ClassClosure.h Unix Name ClassClass.h Unix Name ClassClass.cpp Unix Name BuiltinTraits.h Unix Name ClassClosure.cpp Unix Name BuiltinTraits.cpp Unix Name DynamicProfiler.h Unix Name DynamicProfiler.cpp Unix Name DateObject.h Unix Name DateObject.cpp Unix Name DateClass.h Unix Name builtin.cpp Unix Name DateClass.cpp Unix Name Date.h Unix Name Date.cpp Unix Name avmplusDebugger.h Unix Name avmplusDebugger.cpp Unix Name avmplus.h Unix Name avmplus.cpp Unix Name AvmDebug.h Unix Name avmbuild.h Unix Name BooleanClass.h Unix Name BooleanClass.cpp Unix Name avmplusVersion.h Unix Name ErrorConstants.cpp Unix Name avmplusProfiler.h Unix Name avmplusHashtable.h Unix Name avmplusHashtable.cpp Unix Name AvmCore.h Unix Name AvmCore.cpp Unix Name OSDepMac.cpp Unix Name NativeFunctionMac.cpp Unix Name MathUtilsMac.cpp Unix Name avmplusStack.h Unix Name AvmDebugMac.cpp Unix Name MethodEnv.h Unix Name MethodEnv.cpp Unix Name AbcEnv.h Unix Name AbcEnv.cpp Unix Name VTable.cpp Unix Name VTable.h Unix Name CodegenMIR.h Unix Name BigInteger.cpp Unix Name BigInteger.h Unix Name macho_debuggerdebug.pch++ Unix Name AtomArray.h Unix Name AtomArray.cpp Unix Name avmplusProfiler.cpp Unix Name CodegenMIR.cpp Unix Name DateMac.cpp Unix Name DateMac.h Unix Name MultinameHashtable.h Unix Name MultinameHashtable.cpp Unix Name NamespaceSet.h Unix Name NamespaceSet.cpp Unix Name DomainEnv.h Unix Name DomainEnv.cpp Unix Name Domain.h Unix Name Domain.cpp Unix Name GrowableBuffer.h Unix Name GrowableBuffer.cpp Unix Name AbcGen.h Unix Name AbcGen.cpp Unix Name E4XNode.h Unix Name E4XNode.cpp Unix Name PpcAssembler.cpp Unix Name pcre_info.cpp Unix Name pcre_globals.cpp Unix Name pcre_get.cpp Unix Name pcre_fullinfo.cpp Unix Name pcre_exec.cpp Unix Name pcre_config.cpp Unix Name pcre_compile.cpp Unix Name pcre_chartables.cpp Unix Name pcre_ord2utf8.cpp Unix Name pcre_maketables.cpp Unix Name pcre_refcount.cpp Unix Name pcre_valid_utf8.cpp Unix Name pcre_try_flipped.cpp Unix Name pcre_tables.cpp Unix Name pcre_study.cpp Unix Name pcre.h Unix Name pcre_xclass.cpp Unix Name pcre_version.cpp Unix Name AvmPlusScriptableObject.cpp Unix Name AvmPlusScriptableObject.h Unix Mach-O D-Rel UserSourceTrees AlwaysSearchUserPathsfalse InterpretDOSAndUnixPathsfalse RequireFrameworkStyleIncludesfalse SourceRelativeIncludesfalse UserSearchPaths SearchPath Path../../core PathFormatUnix PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path../../MMgc PathFormatUnix PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path PathFormatUnix PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path../.. PathFormatUnix PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path../../pcre PathFormatUnix PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SystemSearchPaths SearchPath PathMacOS X Support/Headers/(wchar_t Support fix) PathFormatUnix PathRootCodeWarrior Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath PathMacOS X Support/Headers/Alloca PathFormatUnix PathRootCodeWarrior Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path../../../../../../../vendors/fpMacOSX.sdk/usr/include PathFormatUnix PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path../../../../../../../vendors/fpMacOSX.sdk/usr/lib PathFormatUnix PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path../../../../../../../vendors/fpMacOSX.sdk/System/Library/Frameworks PathFormatUnix PathRootProject Recursivefalse FrameworkPathtrue HostFlagsAll SearchPath PathMacOS X Support PathFormatUnix PathRootCodeWarrior Recursivetrue FrameworkPathfalse HostFlagsAll SearchPath Path../../../../../../../vendors/fpMacOSX.sdk/Developer/Headers/FlatCarbon PathFormatUnix PathRootProject Recursivetrue FrameworkPathfalse HostFlagsAll MWRuntimeSettings_WorkingDirectory MWRuntimeSettings_CommandLine MWRuntimeSettings_HostApplication Path PathFormatGeneric PathRootAbsolute MWRuntimeSettings_EnvVars LinkerMacOS X PPC Linker PreLinker PostLinker TargetnameMach-O D-Rel OutputDirectory Path: PathFormatMacOS PathRootProject SaveEntriesUsingRelativePathsfalse FileMappings FileTypeAPPL FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeAppl FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeMDYL FileExtension CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMLIB FileExtension CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMMLB FileExtension CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMPLF FileExtension CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMWCD FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeRSRC FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeTEXT FileExtension.arr Compiler EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.axp Compiler EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.c CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.c++ CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cc CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cp CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cpp CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.exp Compiler EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.h CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileTypeTEXT FileExtension.h++ CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileTypeTEXT FileExtension.hpp CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileTypeTEXT FileExtension.lcf Compiler EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.m CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.mm CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pch CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pch++ CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pchm CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pchmm CompilerMW C/C++ PPC Mac OS X EditLanguageC/C++ Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.plc CompilerProperty List Compiler EditLanguageProperty List Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.ploc CompilerProperty List Compiler EditLanguageProperty List Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.r CompilerRez EditLanguageRez Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.wke Compiler EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypedocu FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypersrc FileExtension Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileExtension.a CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileExtension.doc Compiler EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue FileExtension.dylib CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileExtension.gif CompilerCopy To Package EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue FileExtension.icns CompilerCopy To Package EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue FileExtension.jpg CompilerCopy To Package EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue FileExtension.lib CompilerMachO Importer EditLanguageC/C++ Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileExtension.nib CompilerCopy To Package EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue FileExtension.pl CompilerPerl Tool EditLanguagePerl Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileExtension.plist CompilerCopy To Package EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileExtension.ppob Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileExtension.psh CompilerShell Tool EditLanguage Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileExtension.rsrc Compiler EditLanguage Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileExtension.sh CompilerShell Tool EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileExtension.strings CompilerCopy To Package EditLanguage Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileExtension.tiff CompilerCopy To Package EditLanguage Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue CacheModDatestrue DumpBrowserInfofalse CacheSubprojectstrue UseThirdPartyDebuggerfalse BrowserGenerator1 DebuggerAppPath Path PathFormatGeneric PathRootAbsolute DebuggerCmdLineArgs DebuggerWorkingDir Path PathFormatGeneric PathRootAbsolute CodeCompletionPrefixFileNameMacHeaders.c CodeCompletionMacroFileNameMacOS_Carbon_C++_Macros.h ConsoleEncoding0 LogSystemMessagestrue AutoTargetDLLsPopUp0 StopAtWatchpointstrue PauseWhileRunningfalse PauseInterval5 PauseUIFlags0 AltExePath Path PathFormatGeneric PathRootAbsolute StopAtTempBPOnLaunchtrue CacheSymbolicstrue TempBPFunctionNamemain TempBPType0 Enabledfalse ConnectionName DownloadPath LaunchRemoteAppfalse RemoteAppPath CoreID0 JTAGClockSpeed8000 IsMultiCorefalse OSDownloadfalse UseGlobalOSDownloadfalse OSDownloadConnectionName OSDownloadPath AltDownloadfalse AltDownloadConnectionName OtherExecutables AnalyzerConnectionName CustomColor1 Red0 Green32767 Blue0 CustomColor2 Red0 Green32767 Blue0 CustomColor3 Red0 Green32767 Blue0 CustomColor4 Red0 Green32767 Blue0 MWFrontEnd_C_cplusplus0 MWFrontEnd_C_checkprotos0 MWFrontEnd_C_arm0 MWFrontEnd_C_trigraphs0 MWFrontEnd_C_onlystdkeywords0 MWFrontEnd_C_enumsalwaysint1 MWFrontEnd_C_ansistrict0 MWFrontEnd_C_wchar_type1 MWFrontEnd_C_enableexceptions0 MWFrontEnd_C_dontreusestrings0 MWFrontEnd_C_poolstrings0 MWFrontEnd_C_dontinline0 MWFrontEnd_C_useRTTI0 MWFrontEnd_C_unsignedchars0 MWFrontEnd_C_autoinline0 MWFrontEnd_C_booltruefalse1 MWFrontEnd_C_inlinelevel8 MWFrontEnd_C_ecplusplus0 MWFrontEnd_C_defer_codegen1 MWFrontEnd_C_templateparser0 MWFrontEnd_C_c990 MWFrontEnd_C_bottomupinline1 MWFrontEnd_C_gcc_extensions0 MWFrontEnd_C_instance_manager0 C_CPP_Preprocessor_EmitFiletrue C_CPP_Preprocessor_EmitLinefalse C_CPP_Preprocessor_EmitFullPathfalse C_CPP_Preprocessor_KeepCommentsfalse C_CPP_Preprocessor_PCHUsesPrefixTextfalse C_CPP_Preprocessor_EmitPragmastrue C_CPP_Preprocessor_KeepWhiteSpacefalse C_CPP_Preprocessor_MultiByteEncodingencAutoDetectMultibyte C_CPP_Preprocessor_PrefixText#if !__option(precompile) #include "macho_debuggerrelease.mch++" #endif MWWarning_C_warn_illpragma1 MWWarning_C_warn_emptydecl1 MWWarning_C_warn_possunwant1 MWWarning_C_warn_unusedvar1 MWWarning_C_warn_unusedarg0 MWWarning_C_warn_extracomma0 MWWarning_C_pedantic1 MWWarning_C_warningerrors0 MWWarning_C_warn_hidevirtual0 MWWarning_C_warn_implicitconv0 MWWarning_C_warn_notinlined0 MWWarning_C_warn_structclass1 MWWarning_C_warn_missingreturn0 MWWarning_C_warn_no_side_effect0 MWWarning_C_warn_resultnotused0 MWWarning_C_warn_padding0 MWWarning_C_warn_impl_i2f_conv0 MWWarning_C_warn_impl_f2i_conv0 MWWarning_C_warn_impl_s2u_conv0 MWWarning_C_warn_illtokenpasting0 MWWarning_C_warn_filenamecaps0 MWWarning_C_warn_filenamecapssystem0 MWWarning_C_warn_undefmacro0 MWWarning_C_warn_ptrintconv1 MWMerge_MacOS_projectTypeApplication MWMerge_MacOS_outputNameMerge Out MWMerge_MacOS_outputCreator???? MWMerge_MacOS_outputTypeAPPL MWMerge_MacOS_suppressWarning0 MWMerge_MacOS_copyFragments1 MWMerge_MacOS_copyResources1 MWMerge_MacOS_flattenResource0 MWMerge_MacOS_flatFileNamea.rsrc MWMerge_MacOS_flatFileOutputPath Path: PathFormatMacOS PathRootProject MWMerge_MacOS_skipResources DLGX ckid Proj WSPC FileLockedfalse ResourcesMapIsReadOnlyfalse PrinterDriverIsMultiFinderCompatiblefalse Invisiblefalse HasBundlefalse NameLockedfalse Stationeryfalse HasCustomIconfalse Sharedfalse HasBeenInitedfalse Label0 Comments HasCustomBadgefalse HasRoutingInfofalse MWCodeGen_PPC_structalignmentPPC_mw MWCodeGen_PPC_tracebacktablesNone MWCodeGen_PPC_processorGeneric MWCodeGen_PPC_function_align4 MWCodeGen_PPC_tocdata1 MWCodeGen_PPC_largetoc0 MWCodeGen_PPC_profiler0 MWCodeGen_PPC_vectortocdata1 MWCodeGen_PPC_poolconst0 MWCodeGen_PPC_peephole1 MWCodeGen_PPC_readonlystrings0 MWCodeGen_PPC_linkerpoolsstrings0 MWCodeGen_PPC_volatileasm0 MWCodeGen_PPC_schedule0 MWCodeGen_PPC_altivec1 MWCodeGen_PPC_altivec_move_block0 MWCodeGen_PPC_strictIEEEfp0 MWCodeGen_PPC_fpcontract1 MWCodeGen_PPC_genfsel0 MWCodeGen_PPC_orderedfpcmp0 MWCodeGen_MachO_structalignmentPPC_mw MWCodeGen_MachO_profiler_enumOff MWCodeGen_MachO_processorGeneric MWCodeGen_MachO_function_align4 MWCodeGen_MachO_common0 MWCodeGen_MachO_boolisint0 MWCodeGen_MachO_peephole1 MWCodeGen_MachO_readonlystrings0 MWCodeGen_MachO_linkerpoolsstrings1 MWCodeGen_MachO_volatileasm0 MWCodeGen_MachO_schedule0 MWCodeGen_MachO_altivec0 MWCodeGen_MachO_vecmove0 MWCodeGen_MachO_fp_ieee_strict0 MWCodeGen_MachO_fpcontract1 MWCodeGen_MachO_genfsel0 MWCodeGen_MachO_fp_cmps_ordered0 MWDisassembler_PPC_showcode1 MWDisassembler_PPC_extended1 MWDisassembler_PPC_mix0 MWDisassembler_PPC_nohex0 MWDisassembler_PPC_showdata1 MWDisassembler_PPC_showexceptions1 MWDisassembler_PPC_showsym0 MWDisassembler_PPC_shownames1 GlobalOptimizer_PPC_optimizationlevelLevel4 GlobalOptimizer_PPC_optforSpeed MWLinker_PPC_linksym1 MWLinker_PPC_symfullpath1 MWLinker_PPC_linkmap1 MWLinker_PPC_nolinkwarnings0 MWLinker_PPC_dontdeadstripinitcode0 MWLinker_PPC_permitmultdefs0 MWLinker_PPC_linkmodeFast MWLinker_PPC_code_foldingNone MWLinker_PPC_initname MWLinker_PPC_mainname__start MWLinker_PPC_termname MWLinker_MacOSX_linksym0 MWLinker_MacOSX_symfullpath0 MWLinker_MacOSX_nolinkwarnings0 MWLinker_MacOSX_linkmap0 MWLinker_MacOSX_dontdeadstripinitcode0 MWLinker_MacOSX_permitmultdefs1 MWLinker_MacOSX_use_objectivec_semantics0 MWLinker_MacOSX_strip_debug_symbols0 MWLinker_MacOSX_prebind_all_twolevel_modules0 MWLinker_MacOSX_data_before_text_segment0 MWLinker_MacOSX_report_msl_overloads0 MWLinker_MacOSX_objects_follow_linkorder0 MWLinker_MacOSX_linkmodeFast MWLinker_MacOSX_exportsReferencedGlobals MWLinker_MacOSX_sortcodeNone MWLinker_MacOSX_mainnamestart MWLinker_MacOSX_initname MWLinker_MacOSX_code_foldingNone MWLinker_MacOSX_stabsgenNone MWProject_MacOSX_typeLibrary MWProject_MacOSX_outfileavmplus_macho_drel.lib MWProject_MacOSX_filecreatorCWIE MWProject_MacOSX_filetypeMLIB MWProject_MacOSX_vmaddress0 MWProject_MacOSX_usedefaultvmaddr1 MWProject_MacOSX_flatrsrc0 MWProject_MacOSX_flatrsrcfilename MWProject_MacOSX_flatrsrcoutputdir Path: PathFormatMacOS PathRootProject MWProject_MacOSX_installpath./ MWProject_MacOSX_dont_prebind0 MWProject_MacOSX_flat_namespace0 MWProject_MacOSX_frameworkversionA MWProject_MacOSX_currentversion0 MWProject_MacOSX_flat_oldimpversion0 MWProject_MacOSX_AddrMode0 MWPEF_exportsNone MWPEF_libfolder0 MWPEF_sortcodeNone MWPEF_expandbss0 MWPEF_sharedata0 MWPEF_olddefversion0 MWPEF_oldimpversion0 MWPEF_currentversion0 MWPEF_fragmentname MWPEF_collapsereloads1 MWProject_PPC_typeLibrary MWProject_PPC_outfileavmplus_carbon_drel.lib MWProject_PPC_filecreator???? MWProject_PPC_filetype???? MWProject_PPC_size0 MWProject_PPC_minsize0 MWProject_PPC_stacksize0 MWProject_PPC_flags0 MWProject_PPC_symfilename MWProject_PPC_rsrcname MWProject_PPC_rsrcheaderNative MWProject_PPC_rsrctype???? MWProject_PPC_rsrcid0 MWProject_PPC_rsrcflags0 MWProject_PPC_rsrcstore0 MWProject_PPC_rsrcmerge0 MWProject_PPC_flatrsrc0 MWProject_PPC_flatrsrcoutputdir Path: PathFormatMacOS PathRootProject MWProject_PPC_flatrsrcfilename MWAssembler_PPC_auxheader0 MWAssembler_PPC_symmodeMac MWAssembler_PPC_dialectPPC MWAssembler_PPC_prefixfile MWAssembler_PPC_typecheck0 MWAssembler_PPC_warnings0 MWAssembler_PPC_casesensitive0 PList_OutputTypeFile PList_OutputEncodingUTF-8 PList_PListVersion0.9 PList_Prefix PList_FileFilenameInfo.plist PList_FileDirectory Path: PathFormatMacOS PathRootProject PList_ResourceTypeplst PList_ResourceID0 PList_ResourceName MWRez_Language_maxwidth80 MWRez_Language_scriptRoman MWRez_Language_alignmentAlign1 MWRez_Language_filtermodeFilterSkip MWRez_Language_suppresswarnings0 MWRez_Language_escapecontrolchars1 MWRez_Language_prefixnameStandaloneRezDebugger.h MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' MWWinRC_prefixname MWCodeGen_X86_processorGeneric MWCodeGen_X86_alignmentbytes8 MWCodeGen_X86_exceptionsZeroOverhead MWCodeGen_X86_name_manglingMWWin32 MWCodeGen_X86_use_extinst0 MWCodeGen_X86_extinst_mmx0 MWCodeGen_X86_extinst_3dnow0 MWCodeGen_X86_use_mmx_3dnow_convention0 MWCodeGen_X86_extinst_cmov0 MWCodeGen_X86_extinst_sse0 MWCodeGen_X86_extinst_sse20 MWCodeGen_X86_intrinsics0 MWCodeGen_X86_optimizeasm0 MWCodeGen_X86_disableopts0 MWCodeGen_X86_profile0 MWLinker_X86_runtimeCustom MWCodeGen_X86_readonlystrings0 MWCodeGen_X86_vectorize0 MWCodeGen_X86_relaxieee0 MWLinker_X86_subsysmajorid4 MWLinker_X86_subsysminorid0 MWCOFF_X86_opsysmajorid4 MWCOFF_X86_opsysminorid0 MWLinker_X86_usrmajorid0 MWLinker_X86_usrminorid0 MWProject_X86_maxstacksize1024 MWProject_X86_minstacksize4 MWProject_X86_size1024 MWProject_X86_minsize4 MWCOFF_X86_coff_flags0 MWCOFF_X86_dll_flags0 MWProject_X86_baseaddress4194304 MWCOFF_X86_filealign512 MWCOFF_X86_sectionalign4096 PDisasmX86_showHeaderstrue PDisasmX86_showSectHeaderstrue PDisasmX86_showSymTabtrue PDisasmX86_showCodetrue PDisasmX86_showDatatrue PDisasmX86_showDebugfalse PDisasmX86_showExceptionsfalse PDisasmX86_showRawfalse PDisasmX86_showAllRawfalse PDisasmX86_showSourcefalse PDisasmX86_showRelocationtrue PDisasmX86_showHextrue PDisasmX86_showCommentsfalse PDisasmX86_showSymDefstrue PDisasmX86_unmanglefalse PDisasmX86_verbosefalse PDisasmX86_resolveRelocstrue PDisasmX86_resolveLocalsfalse MWDebugger_X86_Exceptions 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 GlobalOptimizer_X86_optimizationlevelLevel0 GlobalOptimizer_X86_optforSpeed MWLinker_X86_entrypointusageDefault MWLinker_X86_entrypoint MWLinker_X86_subsystemWinGUI MWLinker_X86_commandfile MWLinker_X86_generatemap0 MWLinker_X86_linksym0 MWLinker_X86_linkCV1 MWLinker_X86_symfullpathfalse MWLinker_X86_linkdebugtrue MWLinker_X86_checksumfalse MWLinker_X86_zero_init_bssfalse MWLinker_X86_mergedatafalse MWLinker_X86_usedefaultlibsfalse MWLinker_X86_adddefaultlibsfalse MWLinker_X86_nowarningsfalse MWLinker_X86_verbosefalse MWLinker_X86_linkformemfalse MWLinker_X86_codefoldingNone MWLinker_X86_debuginlinefalse MWProject_X86_typeApplication MWProject_X86_outfilenoname.exe MWProject_X86_importlib MWProject_X86_setimportlibdirfalse MWProject_X86_dontgenerateimportlibfalse MWProject_X86_oldformatlibfalse MWProject_X86_replaceobjextensionfalse MWProject_X86_copyallfilesfalse Name AtomConstants.h Unix Text Name AtomConstants.cpp Unix Text Debug Name ArrayObject.h Unix Text Name ArrayObject.cpp Unix Text Debug Name ArrayClass.h Unix Text Name AbstractFunction.h Unix Text Name AbstractFunction.cpp Unix Text Debug Name AbcParser.h Unix Text Name AbcParser.cpp Unix Text Debug Name XMLParser16.h Unix Text Name XMLParser16.cpp Unix Text Debug Name XMLObject.h Unix Text Name XMLObject.cpp Unix Text Debug Name XMLListObject.h Unix Text Name XMLListObject.cpp Unix Text Debug Name XMLListClass.h Unix Text Name XMLListClass.cpp Unix Text Debug Name XMLClass.h Unix Text Name XMLClass.cpp Unix Text Debug Name ArrayClass.cpp Unix Text Debug Name ActionBlockConstants.h Unix Text Name ActionBlockConstants.cpp Unix Text Debug Name StringBuffer.h Unix Text Name StringBuffer.cpp Unix Text Debug Name StaticProfiler.h Unix Text Name StaticProfiler.cpp Unix Text Debug Name StackTrace.h Unix Text Name StackTrace.cpp Unix Text Debug Name StringClass.h Unix Text Name Verifier.h Unix Text Name Verifier.cpp Unix Text Debug Name Accessor.h Unix Text Name Accessor.cpp Unix Text Debug Name ScriptObject.h Unix Text Name ScriptObject.cpp Unix Text Debug Name ScriptBuffer.h Unix Text Name ScriptBuffer.cpp Unix Text Debug Name ScopeChain.h Unix Text Name ScopeChain.cpp Unix Text Debug Name RegExpObject.h Unix Text Name RegExpObject.cpp Unix Text Debug Name RegExpClass.h Unix Text Name RegExpClass.cpp Unix Text Debug Name StringClass.cpp Unix Text Debug Name PrintWriter.h Unix Text Name PrintWriter.cpp Unix Text Debug Name PoolObject.h Unix Text Name PoolObject.cpp Unix Text Debug Name Interpreter.h Unix Text Name Interpreter.cpp Unix Text Debug Name IntClass.h Unix Text Name IntClass.cpp Unix Text Debug Name NativeObjectHelpers.h Unix Text Name OSDep.h Unix Text Name OutputStream.h Unix Text Name ObjectClass.h Unix Text Name ObjectClass.cpp Unix Text Debug Name NumberClass.h Unix Text Name NumberClass.cpp Unix Text Debug Name MethodInfo.h Unix Text Name MethodInfo.cpp Unix Text Debug Name MethodClosure.h Unix Text Name MethodClosure.cpp Unix Text Debug Name MathUtils.h Unix Text Name Namespace.cpp Unix Text Debug Name Multiname.h Unix Text Name Multiname.cpp Unix Text Debug Name NativeFunction.h Unix Text Name NativeFunction.cpp Unix Text Debug Name NamespaceClass.h Unix Text Name NamespaceClass.cpp Unix Text Debug Name Namespace.h Unix Text Name Toplevel.cpp Unix Text Debug Name StringObject.h Unix Text Name StringObject.cpp Unix Text Debug Name UnicodeUtils.h Unix Text Name UnicodeUtils.cpp Unix Text Debug Name types.h Unix Text Name Traits.h Unix Text Name Traits.cpp Unix Text Debug Name Toplevel.h Unix Text Name Exception.cpp Unix Text Debug Name ErrorConstants.h Unix Text Name ErrorClass.h Unix Text Name FunctionClass.h Unix Text Name FunctionClass.cpp Unix Text Debug Name FrameState.h Unix Text Name FrameState.cpp Unix Text Debug Name Exception.h Unix Text Name ErrorClass.cpp Unix Text Debug Name MathUtils.cpp Unix Text Debug Name MathClass.h Unix Text Name MathClass.cpp Unix Text Debug Name ClassClosure.h Unix Text Name ClassClass.h Unix Text Name ClassClass.cpp Unix Text Debug Name BuiltinTraits.h Unix Text Name ClassClosure.cpp Unix Text Debug Name BuiltinTraits.cpp Unix Text Debug Name DynamicProfiler.h Unix Text Name DynamicProfiler.cpp Unix Text Debug Name DateObject.h Unix Text Name DateObject.cpp Unix Text Debug Name DateClass.h Unix Text Name builtin.cpp Unix Text Debug Name DateClass.cpp Unix Text Debug Name Date.h Unix Text Name Date.cpp Unix Text Debug Name avmplusDebugger.h Unix Text Name avmplusDebugger.cpp Unix Text Debug Name avmplus.h Unix Text Name avmplus.cpp Unix Text Debug Name AvmDebug.h Unix Text Name avmbuild.h Unix Text Name BooleanClass.h Unix Text Name BooleanClass.cpp Unix Text Debug Name avmplusVersion.h Unix Text Name ErrorConstants.cpp Unix Text Debug Name avmplusProfiler.h Unix Text Name avmplusHashtable.h Unix Text Name avmplusHashtable.cpp Unix Text Debug Name AvmCore.h Unix Text Name AvmCore.cpp Unix Text Debug Name OSDepMac.cpp Unix Text Debug Name NativeFunctionMac.cpp Unix Text Debug Name MathUtilsMac.cpp Unix Text Debug Name avmplusStack.h Unix Text Name AvmDebugMac.cpp Unix Text Debug Name MethodEnv.h Unix Text Name MethodEnv.cpp Unix Text Debug Name AbcEnv.h Unix Text Name AbcEnv.cpp Unix Text Debug Name VTable.cpp Unix Text Debug Name VTable.h Unix Text Name CodegenMIR.h Unix Text Name BigInteger.cpp Unix Text Debug Name BigInteger.h Unix Text Name macho_debuggerrelease.pch++ Unix Text Debug Name AtomArray.h Unix Text Name AtomArray.cpp Unix Text Debug Name avmplusProfiler.cpp Unix Text Debug Name CodegenMIR.cpp Unix Text Debug Name DateMac.cpp Unix Text Debug Name DateMac.h Unix Text Name MultinameHashtable.h Unix Text Name MultinameHashtable.cpp Unix Text Debug Name NamespaceSet.h Unix Text Name NamespaceSet.cpp Unix Text Debug Name DomainEnv.h Unix Text Name DomainEnv.cpp Unix Text Debug Name Domain.h Unix Text Name Domain.cpp Unix Text Debug Name GrowableBuffer.h Unix Text Name GrowableBuffer.cpp Unix Text Debug Name AbcGen.h Unix Text Name AbcGen.cpp Unix Text Debug Name E4XNode.h Unix Text Name E4XNode.cpp Unix Text Debug Name PpcAssembler.cpp Unix Text Debug Name pcre_info.cpp Unix Text Debug Name pcre_globals.cpp Unix Text Debug Name pcre_get.cpp Unix Text Debug Name pcre_fullinfo.cpp Unix Text Debug Name pcre_exec.cpp Unix Text Debug Name pcre_config.cpp Unix Text Debug Name pcre_compile.cpp Unix Text Debug Name pcre_chartables.cpp Unix Text Debug Name pcre_ord2utf8.cpp Unix Text Debug Name pcre_maketables.cpp Unix Text Debug Name pcre_refcount.cpp Unix Text Debug Name pcre_valid_utf8.cpp Unix Text Debug Name pcre_try_flipped.cpp Unix Text Debug Name pcre_tables.cpp Unix Text Debug Name pcre_study.cpp Unix Text Debug Name pcre.h Unix Text Name pcre_xclass.cpp Unix Text Debug Name pcre_version.cpp Unix Text Debug Name AvmPlusScriptableObject.cpp Unix Text Debug Name AvmPlusScriptableObject.h Unix Text Name AtomConstants.h Unix Name AtomConstants.cpp Unix Name ArrayObject.h Unix Name ArrayObject.cpp Unix Name ArrayClass.h Unix Name AbstractFunction.h Unix Name AbstractFunction.cpp Unix Name AbcParser.h Unix Name AbcParser.cpp Unix Name XMLParser16.h Unix Name XMLParser16.cpp Unix Name XMLObject.h Unix Name XMLObject.cpp Unix Name XMLListObject.h Unix Name XMLListObject.cpp Unix Name XMLListClass.h Unix Name XMLListClass.cpp Unix Name XMLClass.h Unix Name XMLClass.cpp Unix Name ArrayClass.cpp Unix Name ActionBlockConstants.h Unix Name ActionBlockConstants.cpp Unix Name StringBuffer.h Unix Name StringBuffer.cpp Unix Name StaticProfiler.h Unix Name StaticProfiler.cpp Unix Name StackTrace.h Unix Name StackTrace.cpp Unix Name StringClass.h Unix Name Verifier.h Unix Name Verifier.cpp Unix Name Accessor.h Unix Name Accessor.cpp Unix Name ScriptObject.h Unix Name ScriptObject.cpp Unix Name ScriptBuffer.h Unix Name ScriptBuffer.cpp Unix Name ScopeChain.h Unix Name ScopeChain.cpp Unix Name RegExpObject.h Unix Name RegExpObject.cpp Unix Name RegExpClass.h Unix Name RegExpClass.cpp Unix Name StringClass.cpp Unix Name PrintWriter.h Unix Name PrintWriter.cpp Unix Name PoolObject.h Unix Name PoolObject.cpp Unix Name Interpreter.h Unix Name Interpreter.cpp Unix Name IntClass.h Unix Name IntClass.cpp Unix Name NativeObjectHelpers.h Unix Name OSDep.h Unix Name OutputStream.h Unix Name ObjectClass.h Unix Name ObjectClass.cpp Unix Name NumberClass.h Unix Name NumberClass.cpp Unix Name MethodInfo.h Unix Name MethodInfo.cpp Unix Name MethodClosure.h Unix Name MethodClosure.cpp Unix Name MathUtils.h Unix Name Namespace.cpp Unix Name Multiname.h Unix Name Multiname.cpp Unix Name NativeFunction.h Unix Name NativeFunction.cpp Unix Name NamespaceClass.h Unix Name NamespaceClass.cpp Unix Name Namespace.h Unix Name Toplevel.cpp Unix Name StringObject.h Unix Name StringObject.cpp Unix Name UnicodeUtils.h Unix Name UnicodeUtils.cpp Unix Name types.h Unix Name Traits.h Unix Name Traits.cpp Unix Name Toplevel.h Unix Name Exception.cpp Unix Name ErrorConstants.h Unix Name ErrorClass.h Unix Name FunctionClass.h Unix Name FunctionClass.cpp Unix Name FrameState.h Unix Name FrameState.cpp Unix Name Exception.h Unix Name ErrorClass.cpp Unix Name MathUtils.cpp Unix Name MathClass.h Unix Name MathClass.cpp Unix Name ClassClosure.h Unix Name ClassClass.h Unix Name ClassClass.cpp Unix Name BuiltinTraits.h Unix Name ClassClosure.cpp Unix Name BuiltinTraits.cpp Unix Name DynamicProfiler.h Unix Name DynamicProfiler.cpp Unix Name DateObject.h Unix Name DateObject.cpp Unix Name DateClass.h Unix Name builtin.cpp Unix Name DateClass.cpp Unix Name Date.h Unix Name Date.cpp Unix Name avmplusDebugger.h Unix Name avmplusDebugger.cpp Unix Name avmplus.h Unix Name avmplus.cpp Unix Name AvmDebug.h Unix Name avmbuild.h Unix Name BooleanClass.h Unix Name BooleanClass.cpp Unix Name avmplusVersion.h Unix Name ErrorConstants.cpp Unix Name avmplusProfiler.h Unix Name avmplusHashtable.h Unix Name avmplusHashtable.cpp Unix Name AvmCore.h Unix Name AvmCore.cpp Unix Name OSDepMac.cpp Unix Name NativeFunctionMac.cpp Unix Name MathUtilsMac.cpp Unix Name avmplusStack.h Unix Name AvmDebugMac.cpp Unix Name MethodEnv.h Unix Name MethodEnv.cpp Unix Name AbcEnv.h Unix Name AbcEnv.cpp Unix Name VTable.cpp Unix Name VTable.h Unix Name CodegenMIR.h Unix Name BigInteger.cpp Unix Name BigInteger.h Unix Name macho_debuggerrelease.pch++ Unix Name AtomArray.h Unix Name AtomArray.cpp Unix Name avmplusProfiler.cpp Unix Name CodegenMIR.cpp Unix Name DateMac.cpp Unix Name DateMac.h Unix Name MultinameHashtable.h Unix Name MultinameHashtable.cpp Unix Name NamespaceSet.h Unix Name NamespaceSet.cpp Unix Name DomainEnv.h Unix Name DomainEnv.cpp Unix Name Domain.h Unix Name Domain.cpp Unix Name GrowableBuffer.h Unix Name GrowableBuffer.cpp Unix Name AbcGen.h Unix Name AbcGen.cpp Unix Name E4XNode.h Unix Name E4XNode.cpp Unix Name PpcAssembler.cpp Unix Name pcre_info.cpp Unix Name pcre_globals.cpp Unix Name pcre_get.cpp Unix Name pcre_fullinfo.cpp Unix Name pcre_exec.cpp Unix Name pcre_config.cpp Unix Name pcre_compile.cpp Unix Name pcre_chartables.cpp Unix Name pcre_ord2utf8.cpp Unix Name pcre_maketables.cpp Unix Name pcre_refcount.cpp Unix Name pcre_valid_utf8.cpp Unix Name pcre_try_flipped.cpp Unix Name pcre_tables.cpp Unix Name pcre_study.cpp Unix Name pcre.h Unix Name pcre_xclass.cpp Unix Name pcre_version.cpp Unix Name AvmPlusScriptableObject.cpp Unix Name AvmPlusScriptableObject.h Unix Carbon Debug Carbon Release Carbon D-Debug Carbon D-Rel Mach-O Debug Mach-O Release Mach-O D-Debug Mach-O D-Rel Codegen Carbon Debug Name CodegenMIR.h Unix Carbon Debug Name CodegenMIR.cpp Unix Core Carbon Debug Name AbcEnv.cpp Unix Carbon Debug Name AbcEnv.h Unix Carbon Debug Name AbcParser.cpp Unix Carbon Debug Name AbcParser.h Unix Carbon Debug Name AbstractFunction.cpp Unix Carbon Debug Name AbstractFunction.h Unix Carbon Debug Name Accessor.cpp Unix Carbon Debug Name Accessor.h Unix Carbon Debug Name ActionBlockConstants.cpp Unix Carbon Debug Name ActionBlockConstants.h Unix Carbon Debug Name ArrayClass.cpp Unix Carbon Debug Name ArrayClass.h Unix Carbon Debug Name ArrayObject.cpp Unix Carbon Debug Name ArrayObject.h Unix Carbon Debug Name AtomConstants.cpp Unix Carbon Debug Name AtomConstants.h Unix Carbon Debug Name avmbuild.h Unix Carbon Debug Name AvmCore.cpp Unix Carbon Debug Name AvmCore.h Unix Carbon Debug Name AvmDebug.h Unix Carbon Debug Name avmplus.cpp Unix Carbon Debug Name avmplus.h Unix Carbon Debug Name avmplusDebugger.cpp Unix Carbon Debug Name avmplusDebugger.h Unix Carbon Debug Name avmplusHashtable.cpp Unix Carbon Debug Name avmplusHashtable.h Unix Carbon Debug Name avmplusProfiler.cpp Unix Carbon Debug Name avmplusProfiler.h Unix Carbon Debug Name avmplusStack.h Unix Carbon Debug Name avmplusVersion.h Unix Carbon Debug Name BigInteger.cpp Unix Carbon Debug Name BigInteger.h Unix Carbon Debug Name BooleanClass.cpp Unix Carbon Debug Name BooleanClass.h Unix Carbon Debug Name builtin.cpp Unix Carbon Debug Name BuiltinTraits.cpp Unix Carbon Debug Name BuiltinTraits.h Unix Carbon Debug Name ClassClass.cpp Unix Carbon Debug Name ClassClass.h Unix Carbon Debug Name ClassClosure.cpp Unix Carbon Debug Name ClassClosure.h Unix Carbon Debug Name Date.cpp Unix Carbon Debug Name Date.h Unix Carbon Debug Name DateClass.cpp Unix Carbon Debug Name DateClass.h Unix Carbon Debug Name DateObject.cpp Unix Carbon Debug Name DateObject.h Unix Carbon Debug Name DomainEnv.h Unix Carbon Debug Name DomainEnv.cpp Unix Carbon Debug Name Domain.h Unix Carbon Debug Name Domain.cpp Unix Carbon Debug Name DynamicProfiler.cpp Unix Carbon Debug Name DynamicProfiler.h Unix Carbon Debug Name ErrorClass.cpp Unix Carbon Debug Name ErrorClass.h Unix Carbon Debug Name ErrorConstants.cpp Unix Carbon Debug Name ErrorConstants.h Unix Carbon Debug Name Exception.cpp Unix Carbon Debug Name Exception.h Unix Carbon Debug Name FrameState.cpp Unix Carbon Debug Name FrameState.h Unix Carbon Debug Name FunctionClass.cpp Unix Carbon Debug Name FunctionClass.h Unix Carbon Debug Name IntClass.cpp Unix Carbon Debug Name IntClass.h Unix Carbon Debug Name Interpreter.cpp Unix Carbon Debug Name Interpreter.h Unix Carbon Debug Name MathClass.cpp Unix Carbon Debug Name MathClass.h Unix Carbon Debug Name MathUtils.cpp Unix Carbon Debug Name MathUtils.h Unix Carbon Debug Name MethodClosure.cpp Unix Carbon Debug Name MethodClosure.h Unix Carbon Debug Name MethodEnv.cpp Unix Carbon Debug Name MethodEnv.h Unix Carbon Debug Name MethodInfo.cpp Unix Carbon Debug Name MethodInfo.h Unix Carbon Debug Name Multiname.cpp Unix Carbon Debug Name Multiname.h Unix Carbon Debug Name MultinameHashtable.cpp Unix Carbon Debug Name MultinameHashtable.h Unix Carbon Debug Name Namespace.cpp Unix Carbon Debug Name Namespace.h Unix Carbon Debug Name NamespaceClass.cpp Unix Carbon Debug Name NamespaceClass.h Unix Carbon Debug Name NamespaceSet.h Unix Carbon Debug Name NamespaceSet.cpp Unix Carbon Debug Name NativeFunction.cpp Unix Carbon Debug Name NativeFunction.h Unix Carbon Debug Name NativeObjectHelpers.h Unix Carbon Debug Name NumberClass.cpp Unix Carbon Debug Name NumberClass.h Unix Carbon Debug Name ObjectClass.cpp Unix Carbon Debug Name ObjectClass.h Unix Carbon Debug Name OSDep.h Unix Carbon Debug Name OutputStream.h Unix Carbon Debug Name PoolObject.cpp Unix Carbon Debug Name PoolObject.h Unix Carbon Debug Name PrintWriter.cpp Unix Carbon Debug Name PrintWriter.h Unix Carbon Debug Name RegExpClass.cpp Unix Carbon Debug Name RegExpClass.h Unix Carbon Debug Name RegExpObject.cpp Unix Carbon Debug Name RegExpObject.h Unix Carbon Debug Name ScopeChain.cpp Unix Carbon Debug Name ScopeChain.h Unix Carbon Debug Name ScriptBuffer.cpp Unix Carbon Debug Name ScriptBuffer.h Unix Carbon Debug Name ScriptObject.cpp Unix Carbon Debug Name ScriptObject.h Unix Carbon Debug Name StackTrace.cpp Unix Carbon Debug Name StackTrace.h Unix Carbon Debug Name StaticProfiler.cpp Unix Carbon Debug Name StaticProfiler.h Unix Carbon Debug Name StringBuffer.cpp Unix Carbon Debug Name StringBuffer.h Unix Carbon Debug Name StringClass.cpp Unix Carbon Debug Name StringClass.h Unix Carbon Debug Name StringObject.cpp Unix Carbon Debug Name StringObject.h Unix Carbon Debug Name Toplevel.cpp Unix Carbon Debug Name Toplevel.h Unix Carbon Debug Name Traits.cpp Unix Carbon Debug Name Traits.h Unix Mach-O Release Name types.h Unix Carbon Debug Name types.h Unix Carbon Debug Name UnicodeUtils.cpp Unix Carbon Debug Name UnicodeUtils.h Unix Carbon Debug Name Verifier.cpp Unix Carbon Debug Name Verifier.h Unix Carbon Debug Name VTable.cpp Unix Carbon Debug Name VTable.h Unix Carbon Debug Name XMLClass.cpp Unix Carbon Debug Name XMLClass.h Unix Carbon Debug Name XMLListClass.cpp Unix Carbon Debug Name XMLListClass.h Unix Carbon Debug Name XMLListObject.cpp Unix Carbon Debug Name XMLListObject.h Unix Carbon Debug Name XMLObject.cpp Unix Carbon Debug Name XMLObject.h Unix Carbon Debug Name XMLParser16.cpp Unix Carbon Debug Name XMLParser16.h Unix Carbon Debug Name AtomArray.h Unix Carbon Debug Name AtomArray.cpp Unix Carbon Debug Name GrowableBuffer.h Unix Carbon Debug Name GrowableBuffer.cpp Unix Carbon Debug Name AbcGen.h Unix Carbon Debug Name AbcGen.cpp Unix Carbon Debug Name AvmPlusScriptableObject.cpp Unix Carbon Debug Name AvmPlusScriptableObject.h Unix Platform Carbon Debug Name AvmDebugMac.cpp Unix Carbon Debug Name MathUtilsMac.cpp Unix Carbon Debug Name NativeFunctionMac.cpp Unix Carbon Debug Name OSDepMac.cpp Unix Carbon Debug Name DateMac.cpp Unix Carbon Debug Name DateMac.h Unix Precompiled Headers Carbon Debug Name macprefix_debug.pch++ Unix Carbon D-Debug Name macprefix_debuggerdebug.pch++ Unix Carbon D-Rel Name macprefix_debuggerrel.pch++ Unix Carbon Release Name macprefix_release.pch++ Unix Mach-O Release Name macho_release.pch++ Unix Mach-O D-Rel Name macho_debuggerrelease.pch++ Unix Mach-O D-Debug Name macho_debuggerdebug.pch++ Unix Mach-O Debug Name macho_debug.pch++ Unix regexp Carbon Debug Name pcre_info.cpp Unix Carbon Debug Name pcre_globals.cpp Unix Carbon Debug Name pcre_get.cpp Unix Carbon Debug Name pcre_fullinfo.cpp Unix Carbon Debug Name pcre_exec.cpp Unix Carbon Debug Name pcre_config.cpp Unix Carbon Debug Name pcre_compile.cpp Unix Carbon Debug Name pcre_chartables.cpp Unix Carbon Debug Name pcre_ord2utf8.cpp Unix Carbon Debug Name pcre_maketables.cpp Unix Carbon Debug Name pcre_refcount.cpp Unix Carbon Debug Name pcre_valid_utf8.cpp Unix Carbon Debug Name pcre_try_flipped.cpp Unix Carbon Debug Name pcre_tables.cpp Unix Carbon Debug Name pcre_study.cpp Unix Carbon Debug Name pcre.h Unix Carbon Debug Name pcre_xclass.cpp Unix Carbon Debug Name pcre_version.cpp Unix Carbon Debug Name E4XNode.h Unix Carbon Debug Name E4XNode.cpp Unix Carbon Debug Name PpcAssembler.cpp Unix \ No newline at end of file diff --git a/mozilla/js/tamarin/platform/mac/avmplus/avmplus.xcodeproj/project.pbxproj b/mozilla/js/tamarin/platform/mac/avmplus/avmplus.xcodeproj/project.pbxproj new file mode 100644 index 00000000000..b70db26bad3 --- /dev/null +++ b/mozilla/js/tamarin/platform/mac/avmplus/avmplus.xcodeproj/project.pbxproj @@ -0,0 +1,1155 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 42; + objects = { + +/* Begin PBXBuildFile section */ + 1E6078E8097335B3007D0E1E /* CodegenMIR.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E6078E4097335B3007D0E1E /* CodegenMIR.cpp */; }; + 1E6078E9097335B3007D0E1E /* CodegenMIR.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E6078E5097335B3007D0E1E /* CodegenMIR.h */; }; + 1E6078EA097335B3007D0E1E /* Ia32Assembler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E6078E6097335B3007D0E1E /* Ia32Assembler.cpp */; }; + 1E6078EB097335B3007D0E1E /* PpcAssembler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E6078E7097335B3007D0E1E /* PpcAssembler.cpp */; }; + 1E60798E097335EF007D0E1E /* AbcEnv.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E6078EE097335EF007D0E1E /* AbcEnv.cpp */; }; + 1E60798F097335EF007D0E1E /* AbcEnv.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E6078EF097335EF007D0E1E /* AbcEnv.h */; }; + 1E607990097335EF007D0E1E /* AbcGen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E6078F0097335EF007D0E1E /* AbcGen.cpp */; }; + 1E607991097335EF007D0E1E /* AbcGen.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E6078F1097335EF007D0E1E /* AbcGen.h */; }; + 1E607992097335EF007D0E1E /* AbcParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E6078F2097335EF007D0E1E /* AbcParser.cpp */; }; + 1E607993097335EF007D0E1E /* AbcParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E6078F3097335EF007D0E1E /* AbcParser.h */; }; + 1E607994097335EF007D0E1E /* AbstractFunction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E6078F4097335EF007D0E1E /* AbstractFunction.cpp */; }; + 1E607995097335EF007D0E1E /* AbstractFunction.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E6078F5097335EF007D0E1E /* AbstractFunction.h */; }; + 1E607998097335EF007D0E1E /* ActionBlockConstants.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E6078F8097335EF007D0E1E /* ActionBlockConstants.cpp */; }; + 1E607999097335EF007D0E1E /* ActionBlockConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E6078F9097335EF007D0E1E /* ActionBlockConstants.h */; }; + 1E60799A097335EF007D0E1E /* ArrayClass.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E6078FA097335EF007D0E1E /* ArrayClass.cpp */; }; + 1E60799B097335EF007D0E1E /* ArrayClass.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E6078FB097335EF007D0E1E /* ArrayClass.h */; }; + 1E60799C097335EF007D0E1E /* ArrayObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E6078FC097335EF007D0E1E /* ArrayObject.cpp */; }; + 1E60799D097335EF007D0E1E /* ArrayObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E6078FD097335EF007D0E1E /* ArrayObject.h */; }; + 1E60799E097335EF007D0E1E /* AtomArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E6078FE097335EF007D0E1E /* AtomArray.cpp */; }; + 1E60799F097335EF007D0E1E /* AtomArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E6078FF097335EF007D0E1E /* AtomArray.h */; }; + 1E6079A0097335EF007D0E1E /* AtomConstants.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E607900097335EF007D0E1E /* AtomConstants.cpp */; }; + 1E6079A1097335EF007D0E1E /* AtomConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E607901097335EF007D0E1E /* AtomConstants.h */; }; + 1E6079A2097335EF007D0E1E /* AtomWriteBarrier.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E607902097335EF007D0E1E /* AtomWriteBarrier.h */; }; + 1E6079A3097335EF007D0E1E /* avmbuild.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E607903097335EF007D0E1E /* avmbuild.h */; }; + 1E6079A4097335EF007D0E1E /* AvmCore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E607904097335EF007D0E1E /* AvmCore.cpp */; }; + 1E6079A5097335EF007D0E1E /* AvmCore.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E607905097335EF007D0E1E /* AvmCore.h */; }; + 1E6079A6097335EF007D0E1E /* AvmDebug.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E607906097335EF007D0E1E /* AvmDebug.h */; }; + 1E6079A8097335EF007D0E1E /* AvmError.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E607908097335EF007D0E1E /* AvmError.h */; }; + 1E6079A9097335EF007D0E1E /* avmplus.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E607909097335EF007D0E1E /* avmplus.cpp */; }; + 1E6079AA097335EF007D0E1E /* avmplus.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E60790A097335EF007D0E1E /* avmplus.h */; }; + 1E6079AB097335EF007D0E1E /* avmplusDebugger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E60790B097335EF007D0E1E /* avmplusDebugger.cpp */; }; + 1E6079AC097335EF007D0E1E /* avmplusDebugger.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E60790C097335EF007D0E1E /* avmplusDebugger.h */; }; + 1E6079AD097335EF007D0E1E /* avmplusHashtable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E60790D097335EF007D0E1E /* avmplusHashtable.cpp */; }; + 1E6079AE097335EF007D0E1E /* avmplusHashtable.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E60790E097335EF007D0E1E /* avmplusHashtable.h */; }; + 1E6079AF097335EF007D0E1E /* avmplusList.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E60790F097335EF007D0E1E /* avmplusList.h */; }; + 1E6079B0097335EF007D0E1E /* avmplusProfiler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E607910097335EF007D0E1E /* avmplusProfiler.cpp */; }; + 1E6079B1097335EF007D0E1E /* avmplusProfiler.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E607911097335EF007D0E1E /* avmplusProfiler.h */; }; + 1E6079B2097335EF007D0E1E /* avmplusStack.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E607912097335EF007D0E1E /* avmplusStack.h */; }; + 1E6079B3097335EF007D0E1E /* avmplusTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E607913097335EF007D0E1E /* avmplusTypes.h */; }; + 1E6079B4097335EF007D0E1E /* avmplusVersion.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E607914097335EF007D0E1E /* avmplusVersion.h */; }; + 1E6079B5097335EF007D0E1E /* avmsetjmp.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E607915097335EF007D0E1E /* avmsetjmp.h */; }; + 1E6079B6097335EF007D0E1E /* BigInteger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E607916097335EF007D0E1E /* BigInteger.cpp */; }; + 1E6079B7097335EF007D0E1E /* BigInteger.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E607917097335EF007D0E1E /* BigInteger.h */; }; + 1E6079B8097335EF007D0E1E /* BitSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E607918097335EF007D0E1E /* BitSet.h */; }; + 1E6079B9097335EF007D0E1E /* BooleanClass.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E607919097335EF007D0E1E /* BooleanClass.cpp */; }; + 1E6079BA097335EF007D0E1E /* BooleanClass.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E60791A097335EF007D0E1E /* BooleanClass.h */; }; + 1E6079BC097335EF007D0E1E /* builtin.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E60791C097335EF007D0E1E /* builtin.h */; }; + 1E6079BD097335EF007D0E1E /* BuiltinTraits.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E60791D097335EF007D0E1E /* BuiltinTraits.cpp */; }; + 1E6079BE097335EF007D0E1E /* BuiltinTraits.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E60791E097335EF007D0E1E /* BuiltinTraits.h */; }; + 1E6079BF097335EF007D0E1E /* ClassClass.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E60791F097335EF007D0E1E /* ClassClass.cpp */; }; + 1E6079C0097335EF007D0E1E /* ClassClass.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E607920097335EF007D0E1E /* ClassClass.h */; }; + 1E6079C1097335EF007D0E1E /* ClassClosure.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E607921097335EF007D0E1E /* ClassClosure.cpp */; }; + 1E6079C2097335EF007D0E1E /* ClassClosure.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E607922097335EF007D0E1E /* ClassClosure.h */; }; + 1E6079C3097335EF007D0E1E /* CodeContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E607923097335EF007D0E1E /* CodeContext.h */; }; + 1E6079C4097335EF007D0E1E /* Date.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E607924097335EF007D0E1E /* Date.h */; }; + 1E6079C5097335EF007D0E1E /* DateClass.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E607925097335EF007D0E1E /* DateClass.cpp */; }; + 1E6079C6097335EF007D0E1E /* DateClass.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E607926097335EF007D0E1E /* DateClass.h */; }; + 1E6079C7097335EF007D0E1E /* DateObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E607927097335EF007D0E1E /* DateObject.cpp */; }; + 1E6079C8097335EF007D0E1E /* DateObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E607928097335EF007D0E1E /* DateObject.h */; }; + 1E6079C9097335EF007D0E1E /* Domain.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E607929097335EF007D0E1E /* Domain.cpp */; }; + 1E6079CA097335EF007D0E1E /* Domain.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E60792A097335EF007D0E1E /* Domain.h */; }; + 1E6079CB097335EF007D0E1E /* DomainEnv.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E60792B097335EF007D0E1E /* DomainEnv.cpp */; }; + 1E6079CC097335EF007D0E1E /* DomainEnv.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E60792C097335EF007D0E1E /* DomainEnv.h */; }; + 1E6079CD097335EF007D0E1E /* DynamicProfiler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E60792D097335EF007D0E1E /* DynamicProfiler.cpp */; }; + 1E6079CE097335EF007D0E1E /* DynamicProfiler.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E60792E097335EF007D0E1E /* DynamicProfiler.h */; }; + 1E6079CF097335EF007D0E1E /* E4XNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E60792F097335EF007D0E1E /* E4XNode.cpp */; }; + 1E6079D0097335EF007D0E1E /* E4XNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E607930097335EF007D0E1E /* E4XNode.h */; }; + 1E6079D1097335EF007D0E1E /* ErrorClass.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E607931097335EF007D0E1E /* ErrorClass.cpp */; }; + 1E6079D2097335EF007D0E1E /* ErrorClass.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E607932097335EF007D0E1E /* ErrorClass.h */; }; + 1E6079D3097335EF007D0E1E /* ErrorConstants.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E607933097335EF007D0E1E /* ErrorConstants.cpp */; }; + 1E6079D4097335EF007D0E1E /* ErrorConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E607934097335EF007D0E1E /* ErrorConstants.h */; }; + 1E6079D5097335EF007D0E1E /* Exception.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E607935097335EF007D0E1E /* Exception.cpp */; }; + 1E6079D6097335EF007D0E1E /* Exception.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E607936097335EF007D0E1E /* Exception.h */; }; + 1E6079D7097335EF007D0E1E /* FrameState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E607937097335EF007D0E1E /* FrameState.cpp */; }; + 1E6079D8097335EF007D0E1E /* FrameState.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E607938097335EF007D0E1E /* FrameState.h */; }; + 1E6079D9097335EF007D0E1E /* FunctionClass.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E607939097335EF007D0E1E /* FunctionClass.cpp */; }; + 1E6079DA097335EF007D0E1E /* FunctionClass.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E60793A097335EF007D0E1E /* FunctionClass.h */; }; + 1E6079DB097335EF007D0E1E /* GrowableBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E60793B097335EF007D0E1E /* GrowableBuffer.cpp */; }; + 1E6079DC097335EF007D0E1E /* GrowableBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E60793C097335EF007D0E1E /* GrowableBuffer.h */; }; + 1E6079DD097335EF007D0E1E /* IntClass.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E60793D097335EF007D0E1E /* IntClass.cpp */; }; + 1E6079DE097335EF007D0E1E /* IntClass.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E60793E097335EF007D0E1E /* IntClass.h */; }; + 1E6079DF097335EF007D0E1E /* Interpreter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E60793F097335EF007D0E1E /* Interpreter.cpp */; }; + 1E6079E0097335EF007D0E1E /* Interpreter.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E607940097335EF007D0E1E /* Interpreter.h */; }; + 1E6079E1097335EF007D0E1E /* MathClass.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E607941097335EF007D0E1E /* MathClass.cpp */; }; + 1E6079E2097335EF007D0E1E /* MathClass.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E607942097335EF007D0E1E /* MathClass.h */; }; + 1E6079E3097335EF007D0E1E /* MathUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E607943097335EF007D0E1E /* MathUtils.cpp */; }; + 1E6079E4097335EF007D0E1E /* MathUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E607944097335EF007D0E1E /* MathUtils.h */; }; + 1E6079E5097335EF007D0E1E /* MethodClosure.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E607945097335EF007D0E1E /* MethodClosure.cpp */; }; + 1E6079E6097335EF007D0E1E /* MethodClosure.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E607946097335EF007D0E1E /* MethodClosure.h */; }; + 1E6079E7097335EF007D0E1E /* MethodEnv.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E607947097335EF007D0E1E /* MethodEnv.cpp */; }; + 1E6079E8097335EF007D0E1E /* MethodEnv.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E607948097335EF007D0E1E /* MethodEnv.h */; }; + 1E6079E9097335EF007D0E1E /* MethodInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E607949097335EF007D0E1E /* MethodInfo.cpp */; }; + 1E6079EA097335EF007D0E1E /* MethodInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E60794A097335EF007D0E1E /* MethodInfo.h */; }; + 1E6079EB097335EF007D0E1E /* Multiname.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E60794B097335EF007D0E1E /* Multiname.cpp */; }; + 1E6079EC097335EF007D0E1E /* Multiname.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E60794C097335EF007D0E1E /* Multiname.h */; }; + 1E6079ED097335EF007D0E1E /* MultinameHashtable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E60794D097335EF007D0E1E /* MultinameHashtable.cpp */; }; + 1E6079EE097335EF007D0E1E /* MultinameHashtable.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E60794E097335EF007D0E1E /* MultinameHashtable.h */; }; + 1E6079EF097335EF007D0E1E /* Namespace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E60794F097335EF007D0E1E /* Namespace.cpp */; }; + 1E6079F0097335EF007D0E1E /* Namespace.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E607950097335EF007D0E1E /* Namespace.h */; }; + 1E6079F1097335EF007D0E1E /* NamespaceClass.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E607951097335EF007D0E1E /* NamespaceClass.cpp */; }; + 1E6079F2097335EF007D0E1E /* NamespaceClass.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E607952097335EF007D0E1E /* NamespaceClass.h */; }; + 1E6079F3097335EF007D0E1E /* NamespaceSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E607953097335EF007D0E1E /* NamespaceSet.cpp */; }; + 1E6079F4097335EF007D0E1E /* NamespaceSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E607954097335EF007D0E1E /* NamespaceSet.h */; }; + 1E6079F5097335EF007D0E1E /* NativeFunction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E607955097335EF007D0E1E /* NativeFunction.cpp */; }; + 1E6079F6097335EF007D0E1E /* NativeFunction.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E607956097335EF007D0E1E /* NativeFunction.h */; }; + 1E6079F7097335EF007D0E1E /* NativeObjectHelpers.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E607957097335EF007D0E1E /* NativeObjectHelpers.h */; }; + 1E6079F8097335EF007D0E1E /* NumberClass.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E607958097335EF007D0E1E /* NumberClass.cpp */; }; + 1E6079F9097335EF007D0E1E /* NumberClass.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E607959097335EF007D0E1E /* NumberClass.h */; }; + 1E6079FA097335EF007D0E1E /* ObjectClass.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E60795A097335EF007D0E1E /* ObjectClass.cpp */; }; + 1E6079FB097335EF007D0E1E /* ObjectClass.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E60795B097335EF007D0E1E /* ObjectClass.h */; }; + 1E6079FC097335EF007D0E1E /* opcodes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E60795C097335EF007D0E1E /* opcodes.cpp */; }; + 1E6079FD097335EF007D0E1E /* opcodes.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E60795D097335EF007D0E1E /* opcodes.h */; }; + 1E6079FE097335EF007D0E1E /* OSDep.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E60795E097335EF007D0E1E /* OSDep.h */; }; + 1E6079FF097335EF007D0E1E /* OutputStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E60795F097335EF007D0E1E /* OutputStream.h */; }; + 1E607A00097335EF007D0E1E /* PoolObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E607960097335EF007D0E1E /* PoolObject.cpp */; }; + 1E607A01097335EF007D0E1E /* PoolObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E607961097335EF007D0E1E /* PoolObject.h */; }; + 1E607A02097335EF007D0E1E /* PrintWriter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E607962097335EF007D0E1E /* PrintWriter.cpp */; }; + 1E607A03097335EF007D0E1E /* PrintWriter.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E607963097335EF007D0E1E /* PrintWriter.h */; }; + 1E607A04097335EF007D0E1E /* RegExpClass.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E607964097335EF007D0E1E /* RegExpClass.cpp */; }; + 1E607A05097335EF007D0E1E /* RegExpClass.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E607965097335EF007D0E1E /* RegExpClass.h */; }; + 1E607A06097335EF007D0E1E /* RegExpObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E607966097335EF007D0E1E /* RegExpObject.cpp */; }; + 1E607A07097335EF007D0E1E /* RegExpObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E607967097335EF007D0E1E /* RegExpObject.h */; }; + 1E607A08097335EF007D0E1E /* ScopeChain.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E607968097335EF007D0E1E /* ScopeChain.cpp */; }; + 1E607A09097335EF007D0E1E /* ScopeChain.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E607969097335EF007D0E1E /* ScopeChain.h */; }; + 1E607A0A097335EF007D0E1E /* ScriptBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E60796A097335EF007D0E1E /* ScriptBuffer.cpp */; }; + 1E607A0B097335EF007D0E1E /* ScriptBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E60796B097335EF007D0E1E /* ScriptBuffer.h */; }; + 1E607A0C097335EF007D0E1E /* ScriptObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E60796C097335EF007D0E1E /* ScriptObject.cpp */; }; + 1E607A0D097335EF007D0E1E /* ScriptObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E60796D097335EF007D0E1E /* ScriptObject.h */; }; + 1E607A0E097335EF007D0E1E /* SortedIntMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E60796E097335EF007D0E1E /* SortedIntMap.h */; }; + 1E607A0F097335EF007D0E1E /* StackTrace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E60796F097335EF007D0E1E /* StackTrace.cpp */; }; + 1E607A10097335EF007D0E1E /* StackTrace.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E607970097335EF007D0E1E /* StackTrace.h */; }; + 1E607A11097335EF007D0E1E /* StaticProfiler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E607971097335EF007D0E1E /* StaticProfiler.cpp */; }; + 1E607A12097335EF007D0E1E /* StaticProfiler.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E607972097335EF007D0E1E /* StaticProfiler.h */; }; + 1E607A13097335EF007D0E1E /* StringBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E607973097335EF007D0E1E /* StringBuffer.cpp */; }; + 1E607A14097335EF007D0E1E /* StringBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E607974097335EF007D0E1E /* StringBuffer.h */; }; + 1E607A15097335EF007D0E1E /* StringClass.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E607975097335EF007D0E1E /* StringClass.cpp */; }; + 1E607A16097335EF007D0E1E /* StringClass.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E607976097335EF007D0E1E /* StringClass.h */; }; + 1E607A17097335EF007D0E1E /* StringObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E607977097335EF007D0E1E /* StringObject.cpp */; }; + 1E607A18097335EF007D0E1E /* StringObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E607978097335EF007D0E1E /* StringObject.h */; }; + 1E607A19097335EF007D0E1E /* Toplevel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E607979097335EF007D0E1E /* Toplevel.cpp */; }; + 1E607A1A097335EF007D0E1E /* Toplevel.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E60797A097335EF007D0E1E /* Toplevel.h */; }; + 1E607A1B097335EF007D0E1E /* Traits.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E60797B097335EF007D0E1E /* Traits.cpp */; }; + 1E607A1C097335EF007D0E1E /* Traits.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E60797C097335EF007D0E1E /* Traits.h */; }; + 1E607A1D097335EF007D0E1E /* TraitsIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E60797D097335EF007D0E1E /* TraitsIterator.h */; }; + 1E607A1E097335EF007D0E1E /* UnicodeUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E60797E097335EF007D0E1E /* UnicodeUtils.cpp */; }; + 1E607A1F097335EF007D0E1E /* UnicodeUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E60797F097335EF007D0E1E /* UnicodeUtils.h */; }; + 1E607A20097335EF007D0E1E /* Verifier.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E607980097335EF007D0E1E /* Verifier.cpp */; }; + 1E607A21097335EF007D0E1E /* Verifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E607981097335EF007D0E1E /* Verifier.h */; }; + 1E607A22097335EF007D0E1E /* VTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E607982097335EF007D0E1E /* VTable.cpp */; }; + 1E607A23097335EF007D0E1E /* VTable.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E607983097335EF007D0E1E /* VTable.h */; }; + 1E607A24097335EF007D0E1E /* XMLClass.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E607984097335EF007D0E1E /* XMLClass.cpp */; }; + 1E607A25097335EF007D0E1E /* XMLClass.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E607985097335EF007D0E1E /* XMLClass.h */; }; + 1E607A26097335EF007D0E1E /* XMLListClass.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E607986097335EF007D0E1E /* XMLListClass.cpp */; }; + 1E607A27097335EF007D0E1E /* XMLListClass.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E607987097335EF007D0E1E /* XMLListClass.h */; }; + 1E607A28097335EF007D0E1E /* XMLListObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E607988097335EF007D0E1E /* XMLListObject.cpp */; }; + 1E607A29097335EF007D0E1E /* XMLListObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E607989097335EF007D0E1E /* XMLListObject.h */; }; + 1E607A2A097335EF007D0E1E /* XMLObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E60798A097335EF007D0E1E /* XMLObject.cpp */; }; + 1E607A2B097335EF007D0E1E /* XMLObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E60798B097335EF007D0E1E /* XMLObject.h */; }; + 1E607A2C097335EF007D0E1E /* XMLParser16.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E60798C097335EF007D0E1E /* XMLParser16.cpp */; }; + 1E607A2D097335EF007D0E1E /* XMLParser16.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E60798D097335EF007D0E1E /* XMLParser16.h */; }; + 1E607A3409733608007D0E1E /* AvmDebugMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E607A2E09733608007D0E1E /* AvmDebugMac.cpp */; }; + 1E607A3809733608007D0E1E /* NativeFunctionMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E607A3209733608007D0E1E /* NativeFunctionMac.cpp */; }; + 1E607F9609733ED1007D0E1E /* DateUnix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E607F9309733ED1007D0E1E /* DateUnix.cpp */; }; + 1E607F9709733ED1007D0E1E /* MathUtilsUnix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E607F9409733ED1007D0E1E /* MathUtilsUnix.cpp */; }; + 1E607F9809733ED1007D0E1E /* OSDepUnix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E607F9509733ED1007D0E1E /* OSDepUnix.cpp */; }; + 1EC50991097391B400040CAB /* Date.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1EC50990097391B400040CAB /* Date.cpp */; }; + 7CD864E60AC47805004C73CB /* AbcData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CD864E50AC47805004C73CB /* AbcData.cpp */; }; + 85125ADF0A5C648300502345 /* AvmPlusScriptableObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 85125ADD0A5C648300502345 /* AvmPlusScriptableObject.cpp */; }; + 85125AE00A5C648300502345 /* AvmPlusScriptableObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 85125ADE0A5C648300502345 /* AvmPlusScriptableObject.h */; }; + 8EE6F43F09AA541600DE11A0 /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EE6F42E09AA541600DE11A0 /* config.h */; }; + 8EE6F44009AA541600DE11A0 /* pcre_chartables.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8EE6F42F09AA541600DE11A0 /* pcre_chartables.cpp */; }; + 8EE6F44109AA541600DE11A0 /* pcre_compile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8EE6F43009AA541600DE11A0 /* pcre_compile.cpp */; }; + 8EE6F44209AA541600DE11A0 /* pcre_config.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8EE6F43109AA541600DE11A0 /* pcre_config.cpp */; }; + 8EE6F44309AA541600DE11A0 /* pcre_exec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8EE6F43209AA541600DE11A0 /* pcre_exec.cpp */; }; + 8EE6F44409AA541600DE11A0 /* pcre_fullinfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8EE6F43309AA541600DE11A0 /* pcre_fullinfo.cpp */; }; + 8EE6F44509AA541600DE11A0 /* pcre_get.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8EE6F43409AA541600DE11A0 /* pcre_get.cpp */; }; + 8EE6F44609AA541600DE11A0 /* pcre_globals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8EE6F43509AA541600DE11A0 /* pcre_globals.cpp */; }; + 8EE6F44709AA541600DE11A0 /* pcre_info.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8EE6F43609AA541600DE11A0 /* pcre_info.cpp */; }; + 8EE6F44809AA541600DE11A0 /* pcre_ord2utf8.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8EE6F43709AA541600DE11A0 /* pcre_ord2utf8.cpp */; }; + 8EE6F44909AA541600DE11A0 /* pcre_refcount.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8EE6F43809AA541600DE11A0 /* pcre_refcount.cpp */; }; + 8EE6F44A09AA541600DE11A0 /* pcre_study.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8EE6F43909AA541600DE11A0 /* pcre_study.cpp */; }; + 8EE6F44B09AA541600DE11A0 /* pcre_tables.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8EE6F43A09AA541600DE11A0 /* pcre_tables.cpp */; }; + 8EE6F44C09AA541600DE11A0 /* pcre_try_flipped.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8EE6F43B09AA541600DE11A0 /* pcre_try_flipped.cpp */; }; + 8EE6F44D09AA541600DE11A0 /* pcre_valid_utf8.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8EE6F43C09AA541600DE11A0 /* pcre_valid_utf8.cpp */; }; + 8EE6F44E09AA541600DE11A0 /* pcre_version.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8EE6F43D09AA541600DE11A0 /* pcre_version.cpp */; }; + 8EE6F44F09AA541600DE11A0 /* pcre_xclass.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8EE6F43E09AA541600DE11A0 /* pcre_xclass.cpp */; }; + 8EE6F45B09AA545E00DE11A0 /* pcre_internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EE6F45909AA545E00DE11A0 /* pcre_internal.h */; }; + 8EE6F45C09AA545E00DE11A0 /* pcre.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EE6F45A09AA545E00DE11A0 /* pcre.h */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 1E6078E4097335B3007D0E1E /* CodegenMIR.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = CodegenMIR.cpp; path = ../../../codegen/CodegenMIR.cpp; sourceTree = SOURCE_ROOT; }; + 1E6078E5097335B3007D0E1E /* CodegenMIR.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CodegenMIR.h; path = ../../../codegen/CodegenMIR.h; sourceTree = SOURCE_ROOT; }; + 1E6078E6097335B3007D0E1E /* Ia32Assembler.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = Ia32Assembler.cpp; path = ../../../codegen/Ia32Assembler.cpp; sourceTree = SOURCE_ROOT; }; + 1E6078E7097335B3007D0E1E /* PpcAssembler.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = PpcAssembler.cpp; path = ../../../codegen/PpcAssembler.cpp; sourceTree = SOURCE_ROOT; }; + 1E6078EE097335EF007D0E1E /* AbcEnv.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = AbcEnv.cpp; path = ../../../core/AbcEnv.cpp; sourceTree = SOURCE_ROOT; }; + 1E6078EF097335EF007D0E1E /* AbcEnv.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = AbcEnv.h; path = ../../../core/AbcEnv.h; sourceTree = SOURCE_ROOT; }; + 1E6078F0097335EF007D0E1E /* AbcGen.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = AbcGen.cpp; path = ../../../core/AbcGen.cpp; sourceTree = SOURCE_ROOT; }; + 1E6078F1097335EF007D0E1E /* AbcGen.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = AbcGen.h; path = ../../../core/AbcGen.h; sourceTree = SOURCE_ROOT; }; + 1E6078F2097335EF007D0E1E /* AbcParser.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = AbcParser.cpp; path = ../../../core/AbcParser.cpp; sourceTree = SOURCE_ROOT; }; + 1E6078F3097335EF007D0E1E /* AbcParser.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = AbcParser.h; path = ../../../core/AbcParser.h; sourceTree = SOURCE_ROOT; }; + 1E6078F4097335EF007D0E1E /* AbstractFunction.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = AbstractFunction.cpp; path = ../../../core/AbstractFunction.cpp; sourceTree = SOURCE_ROOT; }; + 1E6078F5097335EF007D0E1E /* AbstractFunction.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = AbstractFunction.h; path = ../../../core/AbstractFunction.h; sourceTree = SOURCE_ROOT; }; + 1E6078F8097335EF007D0E1E /* ActionBlockConstants.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = ActionBlockConstants.cpp; path = ../../../core/ActionBlockConstants.cpp; sourceTree = SOURCE_ROOT; }; + 1E6078F9097335EF007D0E1E /* ActionBlockConstants.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ActionBlockConstants.h; path = ../../../core/ActionBlockConstants.h; sourceTree = SOURCE_ROOT; }; + 1E6078FA097335EF007D0E1E /* ArrayClass.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = ArrayClass.cpp; path = ../../../core/ArrayClass.cpp; sourceTree = SOURCE_ROOT; }; + 1E6078FB097335EF007D0E1E /* ArrayClass.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ArrayClass.h; path = ../../../core/ArrayClass.h; sourceTree = SOURCE_ROOT; }; + 1E6078FC097335EF007D0E1E /* ArrayObject.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = ArrayObject.cpp; path = ../../../core/ArrayObject.cpp; sourceTree = SOURCE_ROOT; }; + 1E6078FD097335EF007D0E1E /* ArrayObject.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ArrayObject.h; path = ../../../core/ArrayObject.h; sourceTree = SOURCE_ROOT; }; + 1E6078FE097335EF007D0E1E /* AtomArray.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = AtomArray.cpp; path = ../../../core/AtomArray.cpp; sourceTree = SOURCE_ROOT; }; + 1E6078FF097335EF007D0E1E /* AtomArray.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = AtomArray.h; path = ../../../core/AtomArray.h; sourceTree = SOURCE_ROOT; }; + 1E607900097335EF007D0E1E /* AtomConstants.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = AtomConstants.cpp; path = ../../../core/AtomConstants.cpp; sourceTree = SOURCE_ROOT; }; + 1E607901097335EF007D0E1E /* AtomConstants.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = AtomConstants.h; path = ../../../core/AtomConstants.h; sourceTree = SOURCE_ROOT; }; + 1E607902097335EF007D0E1E /* AtomWriteBarrier.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = AtomWriteBarrier.h; path = ../../../core/AtomWriteBarrier.h; sourceTree = SOURCE_ROOT; }; + 1E607903097335EF007D0E1E /* avmbuild.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = avmbuild.h; path = ../../../core/avmbuild.h; sourceTree = SOURCE_ROOT; }; + 1E607904097335EF007D0E1E /* AvmCore.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = AvmCore.cpp; path = ../../../core/AvmCore.cpp; sourceTree = SOURCE_ROOT; }; + 1E607905097335EF007D0E1E /* AvmCore.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = AvmCore.h; path = ../../../core/AvmCore.h; sourceTree = SOURCE_ROOT; }; + 1E607906097335EF007D0E1E /* AvmDebug.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = AvmDebug.h; path = ../../../core/AvmDebug.h; sourceTree = SOURCE_ROOT; }; + 1E607908097335EF007D0E1E /* AvmError.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = AvmError.h; path = ../../../core/AvmError.h; sourceTree = SOURCE_ROOT; }; + 1E607909097335EF007D0E1E /* avmplus.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = avmplus.cpp; path = ../../../core/avmplus.cpp; sourceTree = SOURCE_ROOT; }; + 1E60790A097335EF007D0E1E /* avmplus.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = avmplus.h; path = ../../../core/avmplus.h; sourceTree = SOURCE_ROOT; }; + 1E60790B097335EF007D0E1E /* avmplusDebugger.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = avmplusDebugger.cpp; path = ../../../core/avmplusDebugger.cpp; sourceTree = SOURCE_ROOT; }; + 1E60790C097335EF007D0E1E /* avmplusDebugger.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = avmplusDebugger.h; path = ../../../core/avmplusDebugger.h; sourceTree = SOURCE_ROOT; }; + 1E60790D097335EF007D0E1E /* avmplusHashtable.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = avmplusHashtable.cpp; path = ../../../core/avmplusHashtable.cpp; sourceTree = SOURCE_ROOT; }; + 1E60790E097335EF007D0E1E /* avmplusHashtable.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = avmplusHashtable.h; path = ../../../core/avmplusHashtable.h; sourceTree = SOURCE_ROOT; }; + 1E60790F097335EF007D0E1E /* avmplusList.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = avmplusList.h; path = ../../../core/avmplusList.h; sourceTree = SOURCE_ROOT; }; + 1E607910097335EF007D0E1E /* avmplusProfiler.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = avmplusProfiler.cpp; path = ../../../core/avmplusProfiler.cpp; sourceTree = SOURCE_ROOT; }; + 1E607911097335EF007D0E1E /* avmplusProfiler.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = avmplusProfiler.h; path = ../../../core/avmplusProfiler.h; sourceTree = SOURCE_ROOT; }; + 1E607912097335EF007D0E1E /* avmplusStack.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = avmplusStack.h; path = ../../../core/avmplusStack.h; sourceTree = SOURCE_ROOT; }; + 1E607913097335EF007D0E1E /* avmplusTypes.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = avmplusTypes.h; path = ../../../core/avmplusTypes.h; sourceTree = SOURCE_ROOT; }; + 1E607914097335EF007D0E1E /* avmplusVersion.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = avmplusVersion.h; path = ../../../core/avmplusVersion.h; sourceTree = SOURCE_ROOT; }; + 1E607915097335EF007D0E1E /* avmsetjmp.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = avmsetjmp.h; path = ../../../core/avmsetjmp.h; sourceTree = SOURCE_ROOT; }; + 1E607916097335EF007D0E1E /* BigInteger.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = BigInteger.cpp; path = ../../../core/BigInteger.cpp; sourceTree = SOURCE_ROOT; }; + 1E607917097335EF007D0E1E /* BigInteger.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = BigInteger.h; path = ../../../core/BigInteger.h; sourceTree = SOURCE_ROOT; }; + 1E607918097335EF007D0E1E /* BitSet.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = BitSet.h; path = ../../../core/BitSet.h; sourceTree = SOURCE_ROOT; }; + 1E607919097335EF007D0E1E /* BooleanClass.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = BooleanClass.cpp; path = ../../../core/BooleanClass.cpp; sourceTree = SOURCE_ROOT; }; + 1E60791A097335EF007D0E1E /* BooleanClass.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = BooleanClass.h; path = ../../../core/BooleanClass.h; sourceTree = SOURCE_ROOT; }; + 1E60791C097335EF007D0E1E /* builtin.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = builtin.h; path = ../../../core/builtin.h; sourceTree = SOURCE_ROOT; }; + 1E60791D097335EF007D0E1E /* BuiltinTraits.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = BuiltinTraits.cpp; path = ../../../core/BuiltinTraits.cpp; sourceTree = SOURCE_ROOT; }; + 1E60791E097335EF007D0E1E /* BuiltinTraits.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = BuiltinTraits.h; path = ../../../core/BuiltinTraits.h; sourceTree = SOURCE_ROOT; }; + 1E60791F097335EF007D0E1E /* ClassClass.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = ClassClass.cpp; path = ../../../core/ClassClass.cpp; sourceTree = SOURCE_ROOT; }; + 1E607920097335EF007D0E1E /* ClassClass.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ClassClass.h; path = ../../../core/ClassClass.h; sourceTree = SOURCE_ROOT; }; + 1E607921097335EF007D0E1E /* ClassClosure.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = ClassClosure.cpp; path = ../../../core/ClassClosure.cpp; sourceTree = SOURCE_ROOT; }; + 1E607922097335EF007D0E1E /* ClassClosure.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ClassClosure.h; path = ../../../core/ClassClosure.h; sourceTree = SOURCE_ROOT; }; + 1E607923097335EF007D0E1E /* CodeContext.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CodeContext.h; path = ../../../core/CodeContext.h; sourceTree = SOURCE_ROOT; }; + 1E607924097335EF007D0E1E /* Date.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = Date.h; path = ../../../core/Date.h; sourceTree = SOURCE_ROOT; }; + 1E607925097335EF007D0E1E /* DateClass.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = DateClass.cpp; path = ../../../core/DateClass.cpp; sourceTree = SOURCE_ROOT; }; + 1E607926097335EF007D0E1E /* DateClass.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = DateClass.h; path = ../../../core/DateClass.h; sourceTree = SOURCE_ROOT; }; + 1E607927097335EF007D0E1E /* DateObject.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = DateObject.cpp; path = ../../../core/DateObject.cpp; sourceTree = SOURCE_ROOT; }; + 1E607928097335EF007D0E1E /* DateObject.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = DateObject.h; path = ../../../core/DateObject.h; sourceTree = SOURCE_ROOT; }; + 1E607929097335EF007D0E1E /* Domain.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = Domain.cpp; path = ../../../core/Domain.cpp; sourceTree = SOURCE_ROOT; }; + 1E60792A097335EF007D0E1E /* Domain.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = Domain.h; path = ../../../core/Domain.h; sourceTree = SOURCE_ROOT; }; + 1E60792B097335EF007D0E1E /* DomainEnv.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = DomainEnv.cpp; path = ../../../core/DomainEnv.cpp; sourceTree = SOURCE_ROOT; }; + 1E60792C097335EF007D0E1E /* DomainEnv.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = DomainEnv.h; path = ../../../core/DomainEnv.h; sourceTree = SOURCE_ROOT; }; + 1E60792D097335EF007D0E1E /* DynamicProfiler.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = DynamicProfiler.cpp; path = ../../../core/DynamicProfiler.cpp; sourceTree = SOURCE_ROOT; }; + 1E60792E097335EF007D0E1E /* DynamicProfiler.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = DynamicProfiler.h; path = ../../../core/DynamicProfiler.h; sourceTree = SOURCE_ROOT; }; + 1E60792F097335EF007D0E1E /* E4XNode.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = E4XNode.cpp; path = ../../../core/E4XNode.cpp; sourceTree = SOURCE_ROOT; }; + 1E607930097335EF007D0E1E /* E4XNode.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = E4XNode.h; path = ../../../core/E4XNode.h; sourceTree = SOURCE_ROOT; }; + 1E607931097335EF007D0E1E /* ErrorClass.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = ErrorClass.cpp; path = ../../../core/ErrorClass.cpp; sourceTree = SOURCE_ROOT; }; + 1E607932097335EF007D0E1E /* ErrorClass.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ErrorClass.h; path = ../../../core/ErrorClass.h; sourceTree = SOURCE_ROOT; }; + 1E607933097335EF007D0E1E /* ErrorConstants.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = ErrorConstants.cpp; path = ../../../core/ErrorConstants.cpp; sourceTree = SOURCE_ROOT; }; + 1E607934097335EF007D0E1E /* ErrorConstants.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ErrorConstants.h; path = ../../../core/ErrorConstants.h; sourceTree = SOURCE_ROOT; }; + 1E607935097335EF007D0E1E /* Exception.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = Exception.cpp; path = ../../../core/Exception.cpp; sourceTree = SOURCE_ROOT; }; + 1E607936097335EF007D0E1E /* Exception.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = Exception.h; path = ../../../core/Exception.h; sourceTree = SOURCE_ROOT; }; + 1E607937097335EF007D0E1E /* FrameState.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = FrameState.cpp; path = ../../../core/FrameState.cpp; sourceTree = SOURCE_ROOT; }; + 1E607938097335EF007D0E1E /* FrameState.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = FrameState.h; path = ../../../core/FrameState.h; sourceTree = SOURCE_ROOT; }; + 1E607939097335EF007D0E1E /* FunctionClass.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = FunctionClass.cpp; path = ../../../core/FunctionClass.cpp; sourceTree = SOURCE_ROOT; }; + 1E60793A097335EF007D0E1E /* FunctionClass.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = FunctionClass.h; path = ../../../core/FunctionClass.h; sourceTree = SOURCE_ROOT; }; + 1E60793B097335EF007D0E1E /* GrowableBuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = GrowableBuffer.cpp; path = ../../../core/GrowableBuffer.cpp; sourceTree = SOURCE_ROOT; }; + 1E60793C097335EF007D0E1E /* GrowableBuffer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = GrowableBuffer.h; path = ../../../core/GrowableBuffer.h; sourceTree = SOURCE_ROOT; }; + 1E60793D097335EF007D0E1E /* IntClass.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = IntClass.cpp; path = ../../../core/IntClass.cpp; sourceTree = SOURCE_ROOT; }; + 1E60793E097335EF007D0E1E /* IntClass.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = IntClass.h; path = ../../../core/IntClass.h; sourceTree = SOURCE_ROOT; }; + 1E60793F097335EF007D0E1E /* Interpreter.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = Interpreter.cpp; path = ../../../core/Interpreter.cpp; sourceTree = SOURCE_ROOT; }; + 1E607940097335EF007D0E1E /* Interpreter.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = Interpreter.h; path = ../../../core/Interpreter.h; sourceTree = SOURCE_ROOT; }; + 1E607941097335EF007D0E1E /* MathClass.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = MathClass.cpp; path = ../../../core/MathClass.cpp; sourceTree = SOURCE_ROOT; }; + 1E607942097335EF007D0E1E /* MathClass.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = MathClass.h; path = ../../../core/MathClass.h; sourceTree = SOURCE_ROOT; }; + 1E607943097335EF007D0E1E /* MathUtils.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = MathUtils.cpp; path = ../../../core/MathUtils.cpp; sourceTree = SOURCE_ROOT; }; + 1E607944097335EF007D0E1E /* MathUtils.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = MathUtils.h; path = ../../../core/MathUtils.h; sourceTree = SOURCE_ROOT; }; + 1E607945097335EF007D0E1E /* MethodClosure.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = MethodClosure.cpp; path = ../../../core/MethodClosure.cpp; sourceTree = SOURCE_ROOT; }; + 1E607946097335EF007D0E1E /* MethodClosure.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = MethodClosure.h; path = ../../../core/MethodClosure.h; sourceTree = SOURCE_ROOT; }; + 1E607947097335EF007D0E1E /* MethodEnv.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = MethodEnv.cpp; path = ../../../core/MethodEnv.cpp; sourceTree = SOURCE_ROOT; }; + 1E607948097335EF007D0E1E /* MethodEnv.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = MethodEnv.h; path = ../../../core/MethodEnv.h; sourceTree = SOURCE_ROOT; }; + 1E607949097335EF007D0E1E /* MethodInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = MethodInfo.cpp; path = ../../../core/MethodInfo.cpp; sourceTree = SOURCE_ROOT; }; + 1E60794A097335EF007D0E1E /* MethodInfo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = MethodInfo.h; path = ../../../core/MethodInfo.h; sourceTree = SOURCE_ROOT; }; + 1E60794B097335EF007D0E1E /* Multiname.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = Multiname.cpp; path = ../../../core/Multiname.cpp; sourceTree = SOURCE_ROOT; }; + 1E60794C097335EF007D0E1E /* Multiname.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = Multiname.h; path = ../../../core/Multiname.h; sourceTree = SOURCE_ROOT; }; + 1E60794D097335EF007D0E1E /* MultinameHashtable.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = MultinameHashtable.cpp; path = ../../../core/MultinameHashtable.cpp; sourceTree = SOURCE_ROOT; }; + 1E60794E097335EF007D0E1E /* MultinameHashtable.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = MultinameHashtable.h; path = ../../../core/MultinameHashtable.h; sourceTree = SOURCE_ROOT; }; + 1E60794F097335EF007D0E1E /* Namespace.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = Namespace.cpp; path = ../../../core/Namespace.cpp; sourceTree = SOURCE_ROOT; }; + 1E607950097335EF007D0E1E /* Namespace.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = Namespace.h; path = ../../../core/Namespace.h; sourceTree = SOURCE_ROOT; }; + 1E607951097335EF007D0E1E /* NamespaceClass.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = NamespaceClass.cpp; path = ../../../core/NamespaceClass.cpp; sourceTree = SOURCE_ROOT; }; + 1E607952097335EF007D0E1E /* NamespaceClass.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = NamespaceClass.h; path = ../../../core/NamespaceClass.h; sourceTree = SOURCE_ROOT; }; + 1E607953097335EF007D0E1E /* NamespaceSet.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = NamespaceSet.cpp; path = ../../../core/NamespaceSet.cpp; sourceTree = SOURCE_ROOT; }; + 1E607954097335EF007D0E1E /* NamespaceSet.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = NamespaceSet.h; path = ../../../core/NamespaceSet.h; sourceTree = SOURCE_ROOT; }; + 1E607955097335EF007D0E1E /* NativeFunction.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = NativeFunction.cpp; path = ../../../core/NativeFunction.cpp; sourceTree = SOURCE_ROOT; }; + 1E607956097335EF007D0E1E /* NativeFunction.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = NativeFunction.h; path = ../../../core/NativeFunction.h; sourceTree = SOURCE_ROOT; }; + 1E607957097335EF007D0E1E /* NativeObjectHelpers.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = NativeObjectHelpers.h; path = ../../../core/NativeObjectHelpers.h; sourceTree = SOURCE_ROOT; }; + 1E607958097335EF007D0E1E /* NumberClass.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = NumberClass.cpp; path = ../../../core/NumberClass.cpp; sourceTree = SOURCE_ROOT; }; + 1E607959097335EF007D0E1E /* NumberClass.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = NumberClass.h; path = ../../../core/NumberClass.h; sourceTree = SOURCE_ROOT; }; + 1E60795A097335EF007D0E1E /* ObjectClass.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = ObjectClass.cpp; path = ../../../core/ObjectClass.cpp; sourceTree = SOURCE_ROOT; }; + 1E60795B097335EF007D0E1E /* ObjectClass.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ObjectClass.h; path = ../../../core/ObjectClass.h; sourceTree = SOURCE_ROOT; }; + 1E60795C097335EF007D0E1E /* opcodes.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = opcodes.cpp; path = ../../../core/opcodes.cpp; sourceTree = SOURCE_ROOT; }; + 1E60795D097335EF007D0E1E /* opcodes.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = opcodes.h; path = ../../../core/opcodes.h; sourceTree = SOURCE_ROOT; }; + 1E60795E097335EF007D0E1E /* OSDep.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = OSDep.h; path = ../../../core/OSDep.h; sourceTree = SOURCE_ROOT; }; + 1E60795F097335EF007D0E1E /* OutputStream.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = OutputStream.h; path = ../../../core/OutputStream.h; sourceTree = SOURCE_ROOT; }; + 1E607960097335EF007D0E1E /* PoolObject.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = PoolObject.cpp; path = ../../../core/PoolObject.cpp; sourceTree = SOURCE_ROOT; }; + 1E607961097335EF007D0E1E /* PoolObject.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = PoolObject.h; path = ../../../core/PoolObject.h; sourceTree = SOURCE_ROOT; }; + 1E607962097335EF007D0E1E /* PrintWriter.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = PrintWriter.cpp; path = ../../../core/PrintWriter.cpp; sourceTree = SOURCE_ROOT; }; + 1E607963097335EF007D0E1E /* PrintWriter.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = PrintWriter.h; path = ../../../core/PrintWriter.h; sourceTree = SOURCE_ROOT; }; + 1E607964097335EF007D0E1E /* RegExpClass.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = RegExpClass.cpp; path = ../../../core/RegExpClass.cpp; sourceTree = SOURCE_ROOT; }; + 1E607965097335EF007D0E1E /* RegExpClass.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = RegExpClass.h; path = ../../../core/RegExpClass.h; sourceTree = SOURCE_ROOT; }; + 1E607966097335EF007D0E1E /* RegExpObject.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = RegExpObject.cpp; path = ../../../core/RegExpObject.cpp; sourceTree = SOURCE_ROOT; }; + 1E607967097335EF007D0E1E /* RegExpObject.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = RegExpObject.h; path = ../../../core/RegExpObject.h; sourceTree = SOURCE_ROOT; }; + 1E607968097335EF007D0E1E /* ScopeChain.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = ScopeChain.cpp; path = ../../../core/ScopeChain.cpp; sourceTree = SOURCE_ROOT; }; + 1E607969097335EF007D0E1E /* ScopeChain.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ScopeChain.h; path = ../../../core/ScopeChain.h; sourceTree = SOURCE_ROOT; }; + 1E60796A097335EF007D0E1E /* ScriptBuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = ScriptBuffer.cpp; path = ../../../core/ScriptBuffer.cpp; sourceTree = SOURCE_ROOT; }; + 1E60796B097335EF007D0E1E /* ScriptBuffer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ScriptBuffer.h; path = ../../../core/ScriptBuffer.h; sourceTree = SOURCE_ROOT; }; + 1E60796C097335EF007D0E1E /* ScriptObject.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = ScriptObject.cpp; path = ../../../core/ScriptObject.cpp; sourceTree = SOURCE_ROOT; }; + 1E60796D097335EF007D0E1E /* ScriptObject.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ScriptObject.h; path = ../../../core/ScriptObject.h; sourceTree = SOURCE_ROOT; }; + 1E60796E097335EF007D0E1E /* SortedIntMap.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SortedIntMap.h; path = ../../../core/SortedIntMap.h; sourceTree = SOURCE_ROOT; }; + 1E60796F097335EF007D0E1E /* StackTrace.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = StackTrace.cpp; path = ../../../core/StackTrace.cpp; sourceTree = SOURCE_ROOT; }; + 1E607970097335EF007D0E1E /* StackTrace.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = StackTrace.h; path = ../../../core/StackTrace.h; sourceTree = SOURCE_ROOT; }; + 1E607971097335EF007D0E1E /* StaticProfiler.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = StaticProfiler.cpp; path = ../../../core/StaticProfiler.cpp; sourceTree = SOURCE_ROOT; }; + 1E607972097335EF007D0E1E /* StaticProfiler.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = StaticProfiler.h; path = ../../../core/StaticProfiler.h; sourceTree = SOURCE_ROOT; }; + 1E607973097335EF007D0E1E /* StringBuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = StringBuffer.cpp; path = ../../../core/StringBuffer.cpp; sourceTree = SOURCE_ROOT; }; + 1E607974097335EF007D0E1E /* StringBuffer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = StringBuffer.h; path = ../../../core/StringBuffer.h; sourceTree = SOURCE_ROOT; }; + 1E607975097335EF007D0E1E /* StringClass.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = StringClass.cpp; path = ../../../core/StringClass.cpp; sourceTree = SOURCE_ROOT; }; + 1E607976097335EF007D0E1E /* StringClass.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = StringClass.h; path = ../../../core/StringClass.h; sourceTree = SOURCE_ROOT; }; + 1E607977097335EF007D0E1E /* StringObject.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = StringObject.cpp; path = ../../../core/StringObject.cpp; sourceTree = SOURCE_ROOT; }; + 1E607978097335EF007D0E1E /* StringObject.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = StringObject.h; path = ../../../core/StringObject.h; sourceTree = SOURCE_ROOT; }; + 1E607979097335EF007D0E1E /* Toplevel.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = Toplevel.cpp; path = ../../../core/Toplevel.cpp; sourceTree = SOURCE_ROOT; }; + 1E60797A097335EF007D0E1E /* Toplevel.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = Toplevel.h; path = ../../../core/Toplevel.h; sourceTree = SOURCE_ROOT; }; + 1E60797B097335EF007D0E1E /* Traits.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = Traits.cpp; path = ../../../core/Traits.cpp; sourceTree = SOURCE_ROOT; }; + 1E60797C097335EF007D0E1E /* Traits.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = Traits.h; path = ../../../core/Traits.h; sourceTree = SOURCE_ROOT; }; + 1E60797D097335EF007D0E1E /* TraitsIterator.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = TraitsIterator.h; path = ../../../core/TraitsIterator.h; sourceTree = SOURCE_ROOT; }; + 1E60797E097335EF007D0E1E /* UnicodeUtils.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = UnicodeUtils.cpp; path = ../../../core/UnicodeUtils.cpp; sourceTree = SOURCE_ROOT; }; + 1E60797F097335EF007D0E1E /* UnicodeUtils.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = UnicodeUtils.h; path = ../../../core/UnicodeUtils.h; sourceTree = SOURCE_ROOT; }; + 1E607980097335EF007D0E1E /* Verifier.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = Verifier.cpp; path = ../../../core/Verifier.cpp; sourceTree = SOURCE_ROOT; }; + 1E607981097335EF007D0E1E /* Verifier.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = Verifier.h; path = ../../../core/Verifier.h; sourceTree = SOURCE_ROOT; }; + 1E607982097335EF007D0E1E /* VTable.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = VTable.cpp; path = ../../../core/VTable.cpp; sourceTree = SOURCE_ROOT; }; + 1E607983097335EF007D0E1E /* VTable.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = VTable.h; path = ../../../core/VTable.h; sourceTree = SOURCE_ROOT; }; + 1E607984097335EF007D0E1E /* XMLClass.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = XMLClass.cpp; path = ../../../core/XMLClass.cpp; sourceTree = SOURCE_ROOT; }; + 1E607985097335EF007D0E1E /* XMLClass.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = XMLClass.h; path = ../../../core/XMLClass.h; sourceTree = SOURCE_ROOT; }; + 1E607986097335EF007D0E1E /* XMLListClass.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = XMLListClass.cpp; path = ../../../core/XMLListClass.cpp; sourceTree = SOURCE_ROOT; }; + 1E607987097335EF007D0E1E /* XMLListClass.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = XMLListClass.h; path = ../../../core/XMLListClass.h; sourceTree = SOURCE_ROOT; }; + 1E607988097335EF007D0E1E /* XMLListObject.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = XMLListObject.cpp; path = ../../../core/XMLListObject.cpp; sourceTree = SOURCE_ROOT; }; + 1E607989097335EF007D0E1E /* XMLListObject.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = XMLListObject.h; path = ../../../core/XMLListObject.h; sourceTree = SOURCE_ROOT; }; + 1E60798A097335EF007D0E1E /* XMLObject.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = XMLObject.cpp; path = ../../../core/XMLObject.cpp; sourceTree = SOURCE_ROOT; }; + 1E60798B097335EF007D0E1E /* XMLObject.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = XMLObject.h; path = ../../../core/XMLObject.h; sourceTree = SOURCE_ROOT; }; + 1E60798C097335EF007D0E1E /* XMLParser16.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = XMLParser16.cpp; path = ../../../core/XMLParser16.cpp; sourceTree = SOURCE_ROOT; }; + 1E60798D097335EF007D0E1E /* XMLParser16.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = XMLParser16.h; path = ../../../core/XMLParser16.h; sourceTree = SOURCE_ROOT; }; + 1E607A2E09733608007D0E1E /* AvmDebugMac.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = AvmDebugMac.cpp; path = ../AvmDebugMac.cpp; sourceTree = SOURCE_ROOT; }; + 1E607A3209733608007D0E1E /* NativeFunctionMac.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = NativeFunctionMac.cpp; path = ../NativeFunctionMac.cpp; sourceTree = SOURCE_ROOT; }; + 1E607F9309733ED1007D0E1E /* DateUnix.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = DateUnix.cpp; path = ../../unix/DateUnix.cpp; sourceTree = SOURCE_ROOT; }; + 1E607F9409733ED1007D0E1E /* MathUtilsUnix.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = MathUtilsUnix.cpp; path = ../../unix/MathUtilsUnix.cpp; sourceTree = SOURCE_ROOT; }; + 1E607F9509733ED1007D0E1E /* OSDepUnix.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = OSDepUnix.cpp; path = ../../unix/OSDepUnix.cpp; sourceTree = SOURCE_ROOT; }; + 1EC50990097391B400040CAB /* Date.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = Date.cpp; path = ../../../core/Date.cpp; sourceTree = SOURCE_ROOT; }; + 7CD864E50AC47805004C73CB /* AbcData.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = AbcData.cpp; path = ../../../core/AbcData.cpp; sourceTree = SOURCE_ROOT; }; + 85125ADD0A5C648300502345 /* AvmPlusScriptableObject.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = AvmPlusScriptableObject.cpp; path = ../../../core/AvmPlusScriptableObject.cpp; sourceTree = SOURCE_ROOT; }; + 85125ADE0A5C648300502345 /* AvmPlusScriptableObject.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = AvmPlusScriptableObject.h; path = ../../../core/AvmPlusScriptableObject.h; sourceTree = SOURCE_ROOT; }; + 8EE6F42E09AA541600DE11A0 /* config.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = config.h; path = ../../../pcre/config.h; sourceTree = SOURCE_ROOT; }; + 8EE6F42F09AA541600DE11A0 /* pcre_chartables.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = pcre_chartables.cpp; path = ../../../pcre/pcre_chartables.cpp; sourceTree = SOURCE_ROOT; }; + 8EE6F43009AA541600DE11A0 /* pcre_compile.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = pcre_compile.cpp; path = ../../../pcre/pcre_compile.cpp; sourceTree = SOURCE_ROOT; }; + 8EE6F43109AA541600DE11A0 /* pcre_config.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = pcre_config.cpp; path = ../../../pcre/pcre_config.cpp; sourceTree = SOURCE_ROOT; }; + 8EE6F43209AA541600DE11A0 /* pcre_exec.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = pcre_exec.cpp; path = ../../../pcre/pcre_exec.cpp; sourceTree = SOURCE_ROOT; }; + 8EE6F43309AA541600DE11A0 /* pcre_fullinfo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = pcre_fullinfo.cpp; path = ../../../pcre/pcre_fullinfo.cpp; sourceTree = SOURCE_ROOT; }; + 8EE6F43409AA541600DE11A0 /* pcre_get.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = pcre_get.cpp; path = ../../../pcre/pcre_get.cpp; sourceTree = SOURCE_ROOT; }; + 8EE6F43509AA541600DE11A0 /* pcre_globals.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = pcre_globals.cpp; path = ../../../pcre/pcre_globals.cpp; sourceTree = SOURCE_ROOT; }; + 8EE6F43609AA541600DE11A0 /* pcre_info.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = pcre_info.cpp; path = ../../../pcre/pcre_info.cpp; sourceTree = SOURCE_ROOT; }; + 8EE6F43709AA541600DE11A0 /* pcre_ord2utf8.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = pcre_ord2utf8.cpp; path = ../../../pcre/pcre_ord2utf8.cpp; sourceTree = SOURCE_ROOT; }; + 8EE6F43809AA541600DE11A0 /* pcre_refcount.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = pcre_refcount.cpp; path = ../../../pcre/pcre_refcount.cpp; sourceTree = SOURCE_ROOT; }; + 8EE6F43909AA541600DE11A0 /* pcre_study.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = pcre_study.cpp; path = ../../../pcre/pcre_study.cpp; sourceTree = SOURCE_ROOT; }; + 8EE6F43A09AA541600DE11A0 /* pcre_tables.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = pcre_tables.cpp; path = ../../../pcre/pcre_tables.cpp; sourceTree = SOURCE_ROOT; }; + 8EE6F43B09AA541600DE11A0 /* pcre_try_flipped.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = pcre_try_flipped.cpp; path = ../../../pcre/pcre_try_flipped.cpp; sourceTree = SOURCE_ROOT; }; + 8EE6F43C09AA541600DE11A0 /* pcre_valid_utf8.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = pcre_valid_utf8.cpp; path = ../../../pcre/pcre_valid_utf8.cpp; sourceTree = SOURCE_ROOT; }; + 8EE6F43D09AA541600DE11A0 /* pcre_version.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = pcre_version.cpp; path = ../../../pcre/pcre_version.cpp; sourceTree = SOURCE_ROOT; }; + 8EE6F43E09AA541600DE11A0 /* pcre_xclass.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = pcre_xclass.cpp; path = ../../../pcre/pcre_xclass.cpp; sourceTree = SOURCE_ROOT; }; + 8EE6F45909AA545E00DE11A0 /* pcre_internal.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = pcre_internal.h; path = ../../../pcre/pcre_internal.h; sourceTree = SOURCE_ROOT; }; + 8EE6F45A09AA545E00DE11A0 /* pcre.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = pcre.h; path = ../../../pcre/pcre.h; sourceTree = SOURCE_ROOT; }; + D2AAC046055464E500DB518D /* libavmplus.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libavmplus.a; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + D289987405E68DCB004EDB86 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 08FB7794FE84155DC02AAC07 /* avmplus */ = { + isa = PBXGroup; + children = ( + 1E607AB4097337F4007D0E1E /* pcre */, + 1E607AA009733790007D0E1E /* Platform */, + 1E607A9F09733787007D0E1E /* Core */, + 1E607A9E0973377F007D0E1E /* CodenGen */, + C6A0FF2B0290797F04C91782 /* Documentation */, + 1AB674ADFE9D54B511CA2CBB /* Products */, + ); + name = avmplus; + sourceTree = ""; + }; + 1AB674ADFE9D54B511CA2CBB /* Products */ = { + isa = PBXGroup; + children = ( + D2AAC046055464E500DB518D /* libavmplus.a */, + ); + name = Products; + sourceTree = ""; + }; + 1E607A9E0973377F007D0E1E /* CodenGen */ = { + isa = PBXGroup; + children = ( + 1E6078E4097335B3007D0E1E /* CodegenMIR.cpp */, + 1E6078E5097335B3007D0E1E /* CodegenMIR.h */, + 1E6078E6097335B3007D0E1E /* Ia32Assembler.cpp */, + 1E6078E7097335B3007D0E1E /* PpcAssembler.cpp */, + ); + name = CodenGen; + sourceTree = ""; + }; + 1E607A9F09733787007D0E1E /* Core */ = { + isa = PBXGroup; + children = ( + 7CD864E50AC47805004C73CB /* AbcData.cpp */, + 85125ADD0A5C648300502345 /* AvmPlusScriptableObject.cpp */, + 85125ADE0A5C648300502345 /* AvmPlusScriptableObject.h */, + 1EC50990097391B400040CAB /* Date.cpp */, + 1E6078EE097335EF007D0E1E /* AbcEnv.cpp */, + 1E6078EF097335EF007D0E1E /* AbcEnv.h */, + 1E6078F0097335EF007D0E1E /* AbcGen.cpp */, + 1E6078F1097335EF007D0E1E /* AbcGen.h */, + 1E6078F2097335EF007D0E1E /* AbcParser.cpp */, + 1E6078F3097335EF007D0E1E /* AbcParser.h */, + 1E6078F4097335EF007D0E1E /* AbstractFunction.cpp */, + 1E6078F5097335EF007D0E1E /* AbstractFunction.h */, + 1E6078F8097335EF007D0E1E /* ActionBlockConstants.cpp */, + 1E6078F9097335EF007D0E1E /* ActionBlockConstants.h */, + 1E6078FA097335EF007D0E1E /* ArrayClass.cpp */, + 1E6078FB097335EF007D0E1E /* ArrayClass.h */, + 1E6078FC097335EF007D0E1E /* ArrayObject.cpp */, + 1E6078FD097335EF007D0E1E /* ArrayObject.h */, + 1E6078FE097335EF007D0E1E /* AtomArray.cpp */, + 1E6078FF097335EF007D0E1E /* AtomArray.h */, + 1E607900097335EF007D0E1E /* AtomConstants.cpp */, + 1E607901097335EF007D0E1E /* AtomConstants.h */, + 1E607902097335EF007D0E1E /* AtomWriteBarrier.h */, + 1E607903097335EF007D0E1E /* avmbuild.h */, + 1E607904097335EF007D0E1E /* AvmCore.cpp */, + 1E607905097335EF007D0E1E /* AvmCore.h */, + 1E607906097335EF007D0E1E /* AvmDebug.h */, + 1E607908097335EF007D0E1E /* AvmError.h */, + 1E607909097335EF007D0E1E /* avmplus.cpp */, + 1E60790A097335EF007D0E1E /* avmplus.h */, + 1E60790B097335EF007D0E1E /* avmplusDebugger.cpp */, + 1E60790C097335EF007D0E1E /* avmplusDebugger.h */, + 1E60790D097335EF007D0E1E /* avmplusHashtable.cpp */, + 1E60790E097335EF007D0E1E /* avmplusHashtable.h */, + 1E60790F097335EF007D0E1E /* avmplusList.h */, + 1E607910097335EF007D0E1E /* avmplusProfiler.cpp */, + 1E607911097335EF007D0E1E /* avmplusProfiler.h */, + 1E607912097335EF007D0E1E /* avmplusStack.h */, + 1E607913097335EF007D0E1E /* avmplusTypes.h */, + 1E607914097335EF007D0E1E /* avmplusVersion.h */, + 1E607915097335EF007D0E1E /* avmsetjmp.h */, + 1E607916097335EF007D0E1E /* BigInteger.cpp */, + 1E607917097335EF007D0E1E /* BigInteger.h */, + 1E607918097335EF007D0E1E /* BitSet.h */, + 1E607919097335EF007D0E1E /* BooleanClass.cpp */, + 1E60791A097335EF007D0E1E /* BooleanClass.h */, + 1E60791C097335EF007D0E1E /* builtin.h */, + 1E60791D097335EF007D0E1E /* BuiltinTraits.cpp */, + 1E60791E097335EF007D0E1E /* BuiltinTraits.h */, + 1E60791F097335EF007D0E1E /* ClassClass.cpp */, + 1E607920097335EF007D0E1E /* ClassClass.h */, + 1E607921097335EF007D0E1E /* ClassClosure.cpp */, + 1E607922097335EF007D0E1E /* ClassClosure.h */, + 1E607923097335EF007D0E1E /* CodeContext.h */, + 1E607924097335EF007D0E1E /* Date.h */, + 1E607925097335EF007D0E1E /* DateClass.cpp */, + 1E607926097335EF007D0E1E /* DateClass.h */, + 1E607927097335EF007D0E1E /* DateObject.cpp */, + 1E607928097335EF007D0E1E /* DateObject.h */, + 1E607929097335EF007D0E1E /* Domain.cpp */, + 1E60792A097335EF007D0E1E /* Domain.h */, + 1E60792B097335EF007D0E1E /* DomainEnv.cpp */, + 1E60792C097335EF007D0E1E /* DomainEnv.h */, + 1E60792D097335EF007D0E1E /* DynamicProfiler.cpp */, + 1E60792E097335EF007D0E1E /* DynamicProfiler.h */, + 1E60792F097335EF007D0E1E /* E4XNode.cpp */, + 1E607930097335EF007D0E1E /* E4XNode.h */, + 1E607931097335EF007D0E1E /* ErrorClass.cpp */, + 1E607932097335EF007D0E1E /* ErrorClass.h */, + 1E607933097335EF007D0E1E /* ErrorConstants.cpp */, + 1E607934097335EF007D0E1E /* ErrorConstants.h */, + 1E607935097335EF007D0E1E /* Exception.cpp */, + 1E607936097335EF007D0E1E /* Exception.h */, + 1E607937097335EF007D0E1E /* FrameState.cpp */, + 1E607938097335EF007D0E1E /* FrameState.h */, + 1E607939097335EF007D0E1E /* FunctionClass.cpp */, + 1E60793A097335EF007D0E1E /* FunctionClass.h */, + 1E60793B097335EF007D0E1E /* GrowableBuffer.cpp */, + 1E60793C097335EF007D0E1E /* GrowableBuffer.h */, + 1E60793D097335EF007D0E1E /* IntClass.cpp */, + 1E60793E097335EF007D0E1E /* IntClass.h */, + 1E60793F097335EF007D0E1E /* Interpreter.cpp */, + 1E607940097335EF007D0E1E /* Interpreter.h */, + 1E607941097335EF007D0E1E /* MathClass.cpp */, + 1E607942097335EF007D0E1E /* MathClass.h */, + 1E607943097335EF007D0E1E /* MathUtils.cpp */, + 1E607944097335EF007D0E1E /* MathUtils.h */, + 1E607945097335EF007D0E1E /* MethodClosure.cpp */, + 1E607946097335EF007D0E1E /* MethodClosure.h */, + 1E607947097335EF007D0E1E /* MethodEnv.cpp */, + 1E607948097335EF007D0E1E /* MethodEnv.h */, + 1E607949097335EF007D0E1E /* MethodInfo.cpp */, + 1E60794A097335EF007D0E1E /* MethodInfo.h */, + 1E60794B097335EF007D0E1E /* Multiname.cpp */, + 1E60794C097335EF007D0E1E /* Multiname.h */, + 1E60794D097335EF007D0E1E /* MultinameHashtable.cpp */, + 1E60794E097335EF007D0E1E /* MultinameHashtable.h */, + 1E60794F097335EF007D0E1E /* Namespace.cpp */, + 1E607950097335EF007D0E1E /* Namespace.h */, + 1E607951097335EF007D0E1E /* NamespaceClass.cpp */, + 1E607952097335EF007D0E1E /* NamespaceClass.h */, + 1E607953097335EF007D0E1E /* NamespaceSet.cpp */, + 1E607954097335EF007D0E1E /* NamespaceSet.h */, + 1E607955097335EF007D0E1E /* NativeFunction.cpp */, + 1E607956097335EF007D0E1E /* NativeFunction.h */, + 1E607957097335EF007D0E1E /* NativeObjectHelpers.h */, + 1E607958097335EF007D0E1E /* NumberClass.cpp */, + 1E607959097335EF007D0E1E /* NumberClass.h */, + 1E60795A097335EF007D0E1E /* ObjectClass.cpp */, + 1E60795B097335EF007D0E1E /* ObjectClass.h */, + 1E60795C097335EF007D0E1E /* opcodes.cpp */, + 1E60795D097335EF007D0E1E /* opcodes.h */, + 1E60795E097335EF007D0E1E /* OSDep.h */, + 1E60795F097335EF007D0E1E /* OutputStream.h */, + 1E607960097335EF007D0E1E /* PoolObject.cpp */, + 1E607961097335EF007D0E1E /* PoolObject.h */, + 1E607962097335EF007D0E1E /* PrintWriter.cpp */, + 1E607963097335EF007D0E1E /* PrintWriter.h */, + 1E607964097335EF007D0E1E /* RegExpClass.cpp */, + 1E607965097335EF007D0E1E /* RegExpClass.h */, + 1E607966097335EF007D0E1E /* RegExpObject.cpp */, + 1E607967097335EF007D0E1E /* RegExpObject.h */, + 1E607968097335EF007D0E1E /* ScopeChain.cpp */, + 1E607969097335EF007D0E1E /* ScopeChain.h */, + 1E60796A097335EF007D0E1E /* ScriptBuffer.cpp */, + 1E60796B097335EF007D0E1E /* ScriptBuffer.h */, + 1E60796C097335EF007D0E1E /* ScriptObject.cpp */, + 1E60796D097335EF007D0E1E /* ScriptObject.h */, + 1E60796E097335EF007D0E1E /* SortedIntMap.h */, + 1E60796F097335EF007D0E1E /* StackTrace.cpp */, + 1E607970097335EF007D0E1E /* StackTrace.h */, + 1E607971097335EF007D0E1E /* StaticProfiler.cpp */, + 1E607972097335EF007D0E1E /* StaticProfiler.h */, + 1E607973097335EF007D0E1E /* StringBuffer.cpp */, + 1E607974097335EF007D0E1E /* StringBuffer.h */, + 1E607975097335EF007D0E1E /* StringClass.cpp */, + 1E607976097335EF007D0E1E /* StringClass.h */, + 1E607977097335EF007D0E1E /* StringObject.cpp */, + 1E607978097335EF007D0E1E /* StringObject.h */, + 1E607979097335EF007D0E1E /* Toplevel.cpp */, + 1E60797A097335EF007D0E1E /* Toplevel.h */, + 1E60797B097335EF007D0E1E /* Traits.cpp */, + 1E60797C097335EF007D0E1E /* Traits.h */, + 1E60797D097335EF007D0E1E /* TraitsIterator.h */, + 1E60797E097335EF007D0E1E /* UnicodeUtils.cpp */, + 1E60797F097335EF007D0E1E /* UnicodeUtils.h */, + 1E607980097335EF007D0E1E /* Verifier.cpp */, + 1E607981097335EF007D0E1E /* Verifier.h */, + 1E607982097335EF007D0E1E /* VTable.cpp */, + 1E607983097335EF007D0E1E /* VTable.h */, + 1E607984097335EF007D0E1E /* XMLClass.cpp */, + 1E607985097335EF007D0E1E /* XMLClass.h */, + 1E607986097335EF007D0E1E /* XMLListClass.cpp */, + 1E607987097335EF007D0E1E /* XMLListClass.h */, + 1E607988097335EF007D0E1E /* XMLListObject.cpp */, + 1E607989097335EF007D0E1E /* XMLListObject.h */, + 1E60798A097335EF007D0E1E /* XMLObject.cpp */, + 1E60798B097335EF007D0E1E /* XMLObject.h */, + 1E60798C097335EF007D0E1E /* XMLParser16.cpp */, + 1E60798D097335EF007D0E1E /* XMLParser16.h */, + ); + name = Core; + sourceTree = ""; + }; + 1E607AA009733790007D0E1E /* Platform */ = { + isa = PBXGroup; + children = ( + 1E607AA2097337CB007D0E1E /* unix */, + 1E607AA1097337C6007D0E1E /* mac */, + ); + name = Platform; + sourceTree = ""; + }; + 1E607AA1097337C6007D0E1E /* mac */ = { + isa = PBXGroup; + children = ( + 1E607A2E09733608007D0E1E /* AvmDebugMac.cpp */, + 1E607A3209733608007D0E1E /* NativeFunctionMac.cpp */, + ); + name = mac; + sourceTree = ""; + }; + 1E607AA2097337CB007D0E1E /* unix */ = { + isa = PBXGroup; + children = ( + 1E607F9309733ED1007D0E1E /* DateUnix.cpp */, + 1E607F9409733ED1007D0E1E /* MathUtilsUnix.cpp */, + 1E607F9509733ED1007D0E1E /* OSDepUnix.cpp */, + ); + name = unix; + sourceTree = ""; + }; + 1E607AB4097337F4007D0E1E /* pcre */ = { + isa = PBXGroup; + children = ( + 8EE6F45909AA545E00DE11A0 /* pcre_internal.h */, + 8EE6F45A09AA545E00DE11A0 /* pcre.h */, + 8EE6F42E09AA541600DE11A0 /* config.h */, + 8EE6F42F09AA541600DE11A0 /* pcre_chartables.cpp */, + 8EE6F43009AA541600DE11A0 /* pcre_compile.cpp */, + 8EE6F43109AA541600DE11A0 /* pcre_config.cpp */, + 8EE6F43209AA541600DE11A0 /* pcre_exec.cpp */, + 8EE6F43309AA541600DE11A0 /* pcre_fullinfo.cpp */, + 8EE6F43409AA541600DE11A0 /* pcre_get.cpp */, + 8EE6F43509AA541600DE11A0 /* pcre_globals.cpp */, + 8EE6F43609AA541600DE11A0 /* pcre_info.cpp */, + 8EE6F43709AA541600DE11A0 /* pcre_ord2utf8.cpp */, + 8EE6F43809AA541600DE11A0 /* pcre_refcount.cpp */, + 8EE6F43909AA541600DE11A0 /* pcre_study.cpp */, + 8EE6F43A09AA541600DE11A0 /* pcre_tables.cpp */, + 8EE6F43B09AA541600DE11A0 /* pcre_try_flipped.cpp */, + 8EE6F43C09AA541600DE11A0 /* pcre_valid_utf8.cpp */, + 8EE6F43D09AA541600DE11A0 /* pcre_version.cpp */, + 8EE6F43E09AA541600DE11A0 /* pcre_xclass.cpp */, + ); + name = pcre; + sourceTree = ""; + }; + C6A0FF2B0290797F04C91782 /* Documentation */ = { + isa = PBXGroup; + children = ( + ); + name = Documentation; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + D2AAC043055464E500DB518D /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 1E6078E9097335B3007D0E1E /* CodegenMIR.h in Headers */, + 1E60798F097335EF007D0E1E /* AbcEnv.h in Headers */, + 1E607991097335EF007D0E1E /* AbcGen.h in Headers */, + 1E607993097335EF007D0E1E /* AbcParser.h in Headers */, + 1E607995097335EF007D0E1E /* AbstractFunction.h in Headers */, + 1E607999097335EF007D0E1E /* ActionBlockConstants.h in Headers */, + 1E60799B097335EF007D0E1E /* ArrayClass.h in Headers */, + 1E60799D097335EF007D0E1E /* ArrayObject.h in Headers */, + 1E60799F097335EF007D0E1E /* AtomArray.h in Headers */, + 1E6079A1097335EF007D0E1E /* AtomConstants.h in Headers */, + 1E6079A2097335EF007D0E1E /* AtomWriteBarrier.h in Headers */, + 1E6079A3097335EF007D0E1E /* avmbuild.h in Headers */, + 1E6079A5097335EF007D0E1E /* AvmCore.h in Headers */, + 1E6079A6097335EF007D0E1E /* AvmDebug.h in Headers */, + 1E6079A8097335EF007D0E1E /* AvmError.h in Headers */, + 1E6079AA097335EF007D0E1E /* avmplus.h in Headers */, + 1E6079AC097335EF007D0E1E /* avmplusDebugger.h in Headers */, + 1E6079AE097335EF007D0E1E /* avmplusHashtable.h in Headers */, + 1E6079AF097335EF007D0E1E /* avmplusList.h in Headers */, + 1E6079B1097335EF007D0E1E /* avmplusProfiler.h in Headers */, + 1E6079B2097335EF007D0E1E /* avmplusStack.h in Headers */, + 1E6079B3097335EF007D0E1E /* avmplusTypes.h in Headers */, + 1E6079B4097335EF007D0E1E /* avmplusVersion.h in Headers */, + 1E6079B5097335EF007D0E1E /* avmsetjmp.h in Headers */, + 1E6079B7097335EF007D0E1E /* BigInteger.h in Headers */, + 1E6079B8097335EF007D0E1E /* BitSet.h in Headers */, + 1E6079BA097335EF007D0E1E /* BooleanClass.h in Headers */, + 1E6079BC097335EF007D0E1E /* builtin.h in Headers */, + 1E6079BE097335EF007D0E1E /* BuiltinTraits.h in Headers */, + 1E6079C0097335EF007D0E1E /* ClassClass.h in Headers */, + 1E6079C2097335EF007D0E1E /* ClassClosure.h in Headers */, + 1E6079C3097335EF007D0E1E /* CodeContext.h in Headers */, + 1E6079C4097335EF007D0E1E /* Date.h in Headers */, + 1E6079C6097335EF007D0E1E /* DateClass.h in Headers */, + 1E6079C8097335EF007D0E1E /* DateObject.h in Headers */, + 1E6079CA097335EF007D0E1E /* Domain.h in Headers */, + 1E6079CC097335EF007D0E1E /* DomainEnv.h in Headers */, + 1E6079CE097335EF007D0E1E /* DynamicProfiler.h in Headers */, + 1E6079D0097335EF007D0E1E /* E4XNode.h in Headers */, + 1E6079D2097335EF007D0E1E /* ErrorClass.h in Headers */, + 1E6079D4097335EF007D0E1E /* ErrorConstants.h in Headers */, + 1E6079D6097335EF007D0E1E /* Exception.h in Headers */, + 1E6079D8097335EF007D0E1E /* FrameState.h in Headers */, + 1E6079DA097335EF007D0E1E /* FunctionClass.h in Headers */, + 1E6079DC097335EF007D0E1E /* GrowableBuffer.h in Headers */, + 1E6079DE097335EF007D0E1E /* IntClass.h in Headers */, + 1E6079E0097335EF007D0E1E /* Interpreter.h in Headers */, + 1E6079E2097335EF007D0E1E /* MathClass.h in Headers */, + 1E6079E4097335EF007D0E1E /* MathUtils.h in Headers */, + 1E6079E6097335EF007D0E1E /* MethodClosure.h in Headers */, + 1E6079E8097335EF007D0E1E /* MethodEnv.h in Headers */, + 1E6079EA097335EF007D0E1E /* MethodInfo.h in Headers */, + 1E6079EC097335EF007D0E1E /* Multiname.h in Headers */, + 1E6079EE097335EF007D0E1E /* MultinameHashtable.h in Headers */, + 1E6079F0097335EF007D0E1E /* Namespace.h in Headers */, + 1E6079F2097335EF007D0E1E /* NamespaceClass.h in Headers */, + 1E6079F4097335EF007D0E1E /* NamespaceSet.h in Headers */, + 1E6079F6097335EF007D0E1E /* NativeFunction.h in Headers */, + 1E6079F7097335EF007D0E1E /* NativeObjectHelpers.h in Headers */, + 1E6079F9097335EF007D0E1E /* NumberClass.h in Headers */, + 1E6079FB097335EF007D0E1E /* ObjectClass.h in Headers */, + 1E6079FD097335EF007D0E1E /* opcodes.h in Headers */, + 1E6079FE097335EF007D0E1E /* OSDep.h in Headers */, + 1E6079FF097335EF007D0E1E /* OutputStream.h in Headers */, + 1E607A01097335EF007D0E1E /* PoolObject.h in Headers */, + 1E607A03097335EF007D0E1E /* PrintWriter.h in Headers */, + 1E607A05097335EF007D0E1E /* RegExpClass.h in Headers */, + 1E607A07097335EF007D0E1E /* RegExpObject.h in Headers */, + 1E607A09097335EF007D0E1E /* ScopeChain.h in Headers */, + 1E607A0B097335EF007D0E1E /* ScriptBuffer.h in Headers */, + 1E607A0D097335EF007D0E1E /* ScriptObject.h in Headers */, + 1E607A0E097335EF007D0E1E /* SortedIntMap.h in Headers */, + 1E607A10097335EF007D0E1E /* StackTrace.h in Headers */, + 1E607A12097335EF007D0E1E /* StaticProfiler.h in Headers */, + 1E607A14097335EF007D0E1E /* StringBuffer.h in Headers */, + 1E607A16097335EF007D0E1E /* StringClass.h in Headers */, + 1E607A18097335EF007D0E1E /* StringObject.h in Headers */, + 1E607A1A097335EF007D0E1E /* Toplevel.h in Headers */, + 1E607A1C097335EF007D0E1E /* Traits.h in Headers */, + 1E607A1D097335EF007D0E1E /* TraitsIterator.h in Headers */, + 1E607A1F097335EF007D0E1E /* UnicodeUtils.h in Headers */, + 1E607A21097335EF007D0E1E /* Verifier.h in Headers */, + 1E607A23097335EF007D0E1E /* VTable.h in Headers */, + 1E607A25097335EF007D0E1E /* XMLClass.h in Headers */, + 1E607A27097335EF007D0E1E /* XMLListClass.h in Headers */, + 1E607A29097335EF007D0E1E /* XMLListObject.h in Headers */, + 1E607A2B097335EF007D0E1E /* XMLObject.h in Headers */, + 1E607A2D097335EF007D0E1E /* XMLParser16.h in Headers */, + 8EE6F43F09AA541600DE11A0 /* config.h in Headers */, + 8EE6F45B09AA545E00DE11A0 /* pcre_internal.h in Headers */, + 8EE6F45C09AA545E00DE11A0 /* pcre.h in Headers */, + 85125AE00A5C648300502345 /* AvmPlusScriptableObject.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + D2AAC045055464E500DB518D /* avmplus */ = { + isa = PBXNativeTarget; + buildConfigurationList = 1DEB91EB08733DB70010E9CD /* Build configuration list for PBXNativeTarget "avmplus" */; + buildPhases = ( + D2AAC043055464E500DB518D /* Headers */, + D2AAC044055464E500DB518D /* Sources */, + D289987405E68DCB004EDB86 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = avmplus; + productName = avmplus; + productReference = D2AAC046055464E500DB518D /* libavmplus.a */; + productType = "com.apple.product-type.library.static"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 08FB7793FE84155DC02AAC07 /* Project object */ = { + isa = PBXProject; + buildConfigurationList = 1DEB91EF08733DB70010E9CD /* Build configuration list for PBXProject "avmplus" */; + hasScannedForEncodings = 1; + mainGroup = 08FB7794FE84155DC02AAC07 /* avmplus */; + projectDirPath = ""; + targets = ( + D2AAC045055464E500DB518D /* avmplus */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXSourcesBuildPhase section */ + D2AAC044055464E500DB518D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 1E6078E8097335B3007D0E1E /* CodegenMIR.cpp in Sources */, + 1E6078EA097335B3007D0E1E /* Ia32Assembler.cpp in Sources */, + 1E6078EB097335B3007D0E1E /* PpcAssembler.cpp in Sources */, + 1E60798E097335EF007D0E1E /* AbcEnv.cpp in Sources */, + 1E607990097335EF007D0E1E /* AbcGen.cpp in Sources */, + 1E607992097335EF007D0E1E /* AbcParser.cpp in Sources */, + 1E607994097335EF007D0E1E /* AbstractFunction.cpp in Sources */, + 1E607998097335EF007D0E1E /* ActionBlockConstants.cpp in Sources */, + 1E60799A097335EF007D0E1E /* ArrayClass.cpp in Sources */, + 1E60799C097335EF007D0E1E /* ArrayObject.cpp in Sources */, + 1E60799E097335EF007D0E1E /* AtomArray.cpp in Sources */, + 1E6079A0097335EF007D0E1E /* AtomConstants.cpp in Sources */, + 1E6079A4097335EF007D0E1E /* AvmCore.cpp in Sources */, + 1E6079A9097335EF007D0E1E /* avmplus.cpp in Sources */, + 1E6079AB097335EF007D0E1E /* avmplusDebugger.cpp in Sources */, + 1E6079AD097335EF007D0E1E /* avmplusHashtable.cpp in Sources */, + 1E6079B0097335EF007D0E1E /* avmplusProfiler.cpp in Sources */, + 1E6079B6097335EF007D0E1E /* BigInteger.cpp in Sources */, + 1E6079B9097335EF007D0E1E /* BooleanClass.cpp in Sources */, + 1E6079BD097335EF007D0E1E /* BuiltinTraits.cpp in Sources */, + 1E6079BF097335EF007D0E1E /* ClassClass.cpp in Sources */, + 1E6079C1097335EF007D0E1E /* ClassClosure.cpp in Sources */, + 1E6079C5097335EF007D0E1E /* DateClass.cpp in Sources */, + 1E6079C7097335EF007D0E1E /* DateObject.cpp in Sources */, + 1E6079C9097335EF007D0E1E /* Domain.cpp in Sources */, + 1E6079CB097335EF007D0E1E /* DomainEnv.cpp in Sources */, + 1E6079CD097335EF007D0E1E /* DynamicProfiler.cpp in Sources */, + 1E6079CF097335EF007D0E1E /* E4XNode.cpp in Sources */, + 1E6079D1097335EF007D0E1E /* ErrorClass.cpp in Sources */, + 1E6079D3097335EF007D0E1E /* ErrorConstants.cpp in Sources */, + 1E6079D5097335EF007D0E1E /* Exception.cpp in Sources */, + 1E6079D7097335EF007D0E1E /* FrameState.cpp in Sources */, + 1E6079D9097335EF007D0E1E /* FunctionClass.cpp in Sources */, + 1E6079DB097335EF007D0E1E /* GrowableBuffer.cpp in Sources */, + 1E6079DD097335EF007D0E1E /* IntClass.cpp in Sources */, + 1E6079DF097335EF007D0E1E /* Interpreter.cpp in Sources */, + 1E6079E1097335EF007D0E1E /* MathClass.cpp in Sources */, + 1E6079E3097335EF007D0E1E /* MathUtils.cpp in Sources */, + 1E6079E5097335EF007D0E1E /* MethodClosure.cpp in Sources */, + 1E6079E7097335EF007D0E1E /* MethodEnv.cpp in Sources */, + 1E6079E9097335EF007D0E1E /* MethodInfo.cpp in Sources */, + 1E6079EB097335EF007D0E1E /* Multiname.cpp in Sources */, + 1E6079ED097335EF007D0E1E /* MultinameHashtable.cpp in Sources */, + 1E6079EF097335EF007D0E1E /* Namespace.cpp in Sources */, + 1E6079F1097335EF007D0E1E /* NamespaceClass.cpp in Sources */, + 1E6079F3097335EF007D0E1E /* NamespaceSet.cpp in Sources */, + 1E6079F5097335EF007D0E1E /* NativeFunction.cpp in Sources */, + 1E6079F8097335EF007D0E1E /* NumberClass.cpp in Sources */, + 1E6079FA097335EF007D0E1E /* ObjectClass.cpp in Sources */, + 1E6079FC097335EF007D0E1E /* opcodes.cpp in Sources */, + 1E607A00097335EF007D0E1E /* PoolObject.cpp in Sources */, + 1E607A02097335EF007D0E1E /* PrintWriter.cpp in Sources */, + 1E607A04097335EF007D0E1E /* RegExpClass.cpp in Sources */, + 1E607A06097335EF007D0E1E /* RegExpObject.cpp in Sources */, + 1E607A08097335EF007D0E1E /* ScopeChain.cpp in Sources */, + 1E607A0A097335EF007D0E1E /* ScriptBuffer.cpp in Sources */, + 1E607A0C097335EF007D0E1E /* ScriptObject.cpp in Sources */, + 1E607A0F097335EF007D0E1E /* StackTrace.cpp in Sources */, + 1E607A11097335EF007D0E1E /* StaticProfiler.cpp in Sources */, + 1E607A13097335EF007D0E1E /* StringBuffer.cpp in Sources */, + 1E607A15097335EF007D0E1E /* StringClass.cpp in Sources */, + 1E607A17097335EF007D0E1E /* StringObject.cpp in Sources */, + 1E607A19097335EF007D0E1E /* Toplevel.cpp in Sources */, + 1E607A1B097335EF007D0E1E /* Traits.cpp in Sources */, + 1E607A1E097335EF007D0E1E /* UnicodeUtils.cpp in Sources */, + 1E607A20097335EF007D0E1E /* Verifier.cpp in Sources */, + 1E607A22097335EF007D0E1E /* VTable.cpp in Sources */, + 1E607A24097335EF007D0E1E /* XMLClass.cpp in Sources */, + 1E607A26097335EF007D0E1E /* XMLListClass.cpp in Sources */, + 1E607A28097335EF007D0E1E /* XMLListObject.cpp in Sources */, + 1E607A2A097335EF007D0E1E /* XMLObject.cpp in Sources */, + 1E607A2C097335EF007D0E1E /* XMLParser16.cpp in Sources */, + 1E607A3409733608007D0E1E /* AvmDebugMac.cpp in Sources */, + 1E607A3809733608007D0E1E /* NativeFunctionMac.cpp in Sources */, + 1E607F9609733ED1007D0E1E /* DateUnix.cpp in Sources */, + 1E607F9709733ED1007D0E1E /* MathUtilsUnix.cpp in Sources */, + 1E607F9809733ED1007D0E1E /* OSDepUnix.cpp in Sources */, + 1EC50991097391B400040CAB /* Date.cpp in Sources */, + 8EE6F44009AA541600DE11A0 /* pcre_chartables.cpp in Sources */, + 8EE6F44109AA541600DE11A0 /* pcre_compile.cpp in Sources */, + 8EE6F44209AA541600DE11A0 /* pcre_config.cpp in Sources */, + 8EE6F44309AA541600DE11A0 /* pcre_exec.cpp in Sources */, + 8EE6F44409AA541600DE11A0 /* pcre_fullinfo.cpp in Sources */, + 8EE6F44509AA541600DE11A0 /* pcre_get.cpp in Sources */, + 8EE6F44609AA541600DE11A0 /* pcre_globals.cpp in Sources */, + 8EE6F44709AA541600DE11A0 /* pcre_info.cpp in Sources */, + 8EE6F44809AA541600DE11A0 /* pcre_ord2utf8.cpp in Sources */, + 8EE6F44909AA541600DE11A0 /* pcre_refcount.cpp in Sources */, + 8EE6F44A09AA541600DE11A0 /* pcre_study.cpp in Sources */, + 8EE6F44B09AA541600DE11A0 /* pcre_tables.cpp in Sources */, + 8EE6F44C09AA541600DE11A0 /* pcre_try_flipped.cpp in Sources */, + 8EE6F44D09AA541600DE11A0 /* pcre_valid_utf8.cpp in Sources */, + 8EE6F44E09AA541600DE11A0 /* pcre_version.cpp in Sources */, + 8EE6F44F09AA541600DE11A0 /* pcre_xclass.cpp in Sources */, + 85125ADF0A5C648300502345 /* AvmPlusScriptableObject.cpp in Sources */, + 7CD864E60AC47805004C73CB /* AbcData.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 1DEB91EC08733DB70010E9CD /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(NATIVE_ARCH)"; + COPY_PHASE_STRIP = NO; + GCC_ALTIVEC_EXTENSIONS = YES; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_CPP_EXCEPTIONS = NO; + GCC_ENABLE_CPP_RTTI = YES; + GCC_ENABLE_FIX_AND_CONTINUE = YES; + GCC_MODEL_TUNING = G5; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + __DEBUGGING__, + "TARGET_API_MAC_CARBON=1", + _MAC, + "DARWIN=1", + DEBUG, + _DEBUG, + ENABLE_PROFILER, + ENABLE_COMPILER, + SOFT_ASSERTS, + powerc, + "TARGET_RT_MAC_MACHO=1", + USE_MMAP, + _MAC, + ); + INSTALL_PATH = /usr/local/lib; + PRODUCT_NAME = avmplus; + USER_HEADER_SEARCH_PATHS = "$(USER_HEADER_SEARCH_PATHS) ../../../MMgc"; + ZERO_LINK = NO; + }; + name = Debug; + }; + 1DEB91ED08733DB70010E9CD /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = ( + ppc, + i386, + ); + GCC_ALTIVEC_EXTENSIONS = YES; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_CPP_EXCEPTIONS = NO; + GCC_ENABLE_CPP_RTTI = NO; + GCC_GENERATE_DEBUGGING_SYMBOLS = NO; + GCC_MODEL_TUNING = G5; + GCC_OPTIMIZATION_LEVEL = s; + GCC_PREPROCESSOR_DEFINITIONS = ( + SOFT_ASSERTS, + __DEBUGGING__, + "TARGET_API_MAC_CARBON=1", + "DARWIN=1", + _MAC, + "TARGET_RT_MAC_MACHO=1", + USE_MMAP, + _MAC, + ); + INSTALL_PATH = /usr/local/lib; + OTHER_CFLAGS = ( + "-finline-functions", + "-finline-limit=65536", + ); + PRODUCT_NAME = avmplus; + USER_HEADER_SEARCH_PATHS = "$(USER_HEADER_SEARCH_PATHS) ../../../MMgc"; + }; + name = Release; + }; + 1DEB91F008733DB70010E9CD /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + DEBUG_INFORMATION_FORMAT = dwarf; + GCC_TREAT_WARNINGS_AS_ERRORS = YES; + GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = NO; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; + GCC_WARN_MISSING_PARENTHESES = YES; + GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; + GCC_WARN_UNUSED_LABEL = YES; + GCC_WARN_UNUSED_PARAMETER = YES; + GCC_WARN_UNUSED_VALUE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + PREBINDING = NO; + SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; + SYMROOT = "$(PROJECT_DIR)/../../../../platform/mac/flash/Builds"; + }; + name = Debug; + }; + 1DEB91F108733DB70010E9CD /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + DEBUG_INFORMATION_FORMAT = dwarf; + GCC_TREAT_WARNINGS_AS_ERRORS = YES; + GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = NO; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; + GCC_WARN_MISSING_PARENTHESES = YES; + GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_LABEL = YES; + GCC_WARN_UNUSED_PARAMETER = YES; + GCC_WARN_UNUSED_VALUE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + PREBINDING = NO; + SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; + SYMROOT = "$(PROJECT_DIR)/../../../../platform/mac/flash/Builds"; + }; + name = Release; + }; + 8E8B52EB09AABCA50057BEE4 /* Debug Debugger */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(NATIVE_ARCH)"; + COPY_PHASE_STRIP = NO; + GCC_ALTIVEC_EXTENSIONS = YES; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_CPP_EXCEPTIONS = NO; + GCC_ENABLE_CPP_RTTI = YES; + GCC_ENABLE_FIX_AND_CONTINUE = YES; + GCC_MODEL_TUNING = G5; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + __DEBUGGING__, + "TARGET_API_MAC_CARBON=1", + _MAC, + "DARWIN=1", + DEBUG, + _DEBUG, + ENABLE_PROFILER, + ENABLE_COMPILER, + SOFT_ASSERTS, + powerc, + "TARGET_RT_MAC_MACHO=1", + USE_MMAP, + _MAC, + DEBUGGER, + ); + INSTALL_PATH = /usr/local/lib; + PRODUCT_NAME = avmplus; + USER_HEADER_SEARCH_PATHS = "$(USER_HEADER_SEARCH_PATHS) ../../../MMgc"; + ZERO_LINK = NO; + }; + name = "Debug Debugger"; + }; + 8E8B52EC09AABCA50057BEE4 /* Release Debugger */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = ( + ppc, + i386, + ); + GCC_ALTIVEC_EXTENSIONS = YES; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_CPP_EXCEPTIONS = NO; + GCC_ENABLE_CPP_RTTI = NO; + GCC_GENERATE_DEBUGGING_SYMBOLS = NO; + GCC_MODEL_TUNING = G5; + GCC_OPTIMIZATION_LEVEL = s; + GCC_PREPROCESSOR_DEFINITIONS = ( + SOFT_ASSERTS, + __DEBUGGING__, + "TARGET_API_MAC_CARBON=1", + "DARWIN=1", + _MAC, + "TARGET_RT_MAC_MACHO=1", + USE_MMAP, + _MAC, + DEBUGGER, + ); + INSTALL_PATH = /usr/local/lib; + OTHER_CFLAGS = ( + "-finline-functions", + "-finline-limit=100000", + ); + PRODUCT_NAME = avmplus; + USER_HEADER_SEARCH_PATHS = "$(USER_HEADER_SEARCH_PATHS) ../../../MMgc"; + }; + name = "Release Debugger"; + }; + 8E8B52ED09AABCA50057BEE4 /* Debug Debugger */ = { + isa = XCBuildConfiguration; + buildSettings = { + DEBUG_INFORMATION_FORMAT = dwarf; + GCC_TREAT_WARNINGS_AS_ERRORS = YES; + GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = NO; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; + GCC_WARN_MISSING_PARENTHESES = YES; + GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; + GCC_WARN_UNUSED_LABEL = YES; + GCC_WARN_UNUSED_PARAMETER = YES; + GCC_WARN_UNUSED_VALUE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + PREBINDING = NO; + SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; + SYMROOT = "$(PROJECT_DIR)/../../../../platform/mac/flash/Builds"; + }; + name = "Debug Debugger"; + }; + 8E8B52EE09AABCA50057BEE4 /* Release Debugger */ = { + isa = XCBuildConfiguration; + buildSettings = { + DEBUG_INFORMATION_FORMAT = dwarf; + GCC_TREAT_WARNINGS_AS_ERRORS = YES; + GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = NO; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; + GCC_WARN_MISSING_PARENTHESES = YES; + GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_LABEL = YES; + GCC_WARN_UNUSED_PARAMETER = YES; + GCC_WARN_UNUSED_VALUE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + PREBINDING = NO; + SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; + SYMROOT = "$(PROJECT_DIR)/../../../../platform/mac/flash/Builds"; + }; + name = "Release Debugger"; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 1DEB91EB08733DB70010E9CD /* Build configuration list for PBXNativeTarget "avmplus" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1DEB91EC08733DB70010E9CD /* Debug */, + 8E8B52EB09AABCA50057BEE4 /* Debug Debugger */, + 1DEB91ED08733DB70010E9CD /* Release */, + 8E8B52EC09AABCA50057BEE4 /* Release Debugger */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 1DEB91EF08733DB70010E9CD /* Build configuration list for PBXProject "avmplus" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1DEB91F008733DB70010E9CD /* Debug */, + 8E8B52ED09AABCA50057BEE4 /* Debug Debugger */, + 1DEB91F108733DB70010E9CD /* Release */, + 8E8B52EE09AABCA50057BEE4 /* Release Debugger */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 08FB7793FE84155DC02AAC07 /* Project object */; +} diff --git a/mozilla/js/tamarin/platform/mac/carb.r b/mozilla/js/tamarin/platform/mac/carb.r new file mode 100644 index 00000000000..a4977bcf3dc --- /dev/null +++ b/mozilla/js/tamarin/platform/mac/carb.r @@ -0,0 +1,40 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +/* + * Mark application as being a Carbon app for OS X + */ + +type 'carb' { +}; + +resource 'carb'(0) { +}; diff --git a/mozilla/js/tamarin/platform/mac/macho_debug.pch++ b/mozilla/js/tamarin/platform/mac/macho_debug.pch++ new file mode 100644 index 00000000000..fb888b705d1 --- /dev/null +++ b/mozilla/js/tamarin/platform/mac/macho_debug.pch++ @@ -0,0 +1,68 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +// 11jun04 grandma: +// +// macho_debug.pch++ is a pre-compiled header source file (for C++). +// Metrowerks knows to compile pch's before any other file in a project. +// +// The precompile_target pragma names the output macho_debug.mch. +// mch's are pre-compiled headers (binary files). +// +// In the C/C++ preprocessor tab of our project settings, we've defined +// the following Prefix Text: +// +// #if !__option(precompile) +// #include "macho_debug.mch" +// #endif +// +// Prefix text is implicitly pre-pended to each source file before compiling. +// So macho_debug.mch is implicitly included in every source file (except +// pre-compiled headers) -- reducing compile time by more than a factor of five. +// +#pragma precompile_target "macho_debug.mch++" +#pragma once on +#define TARGET_API_MAC_CARBON 1 +#define TARGET_API_MAC_OSX 1 +#include "MacHeadersMach-O.c" +#include +// +// Defines specific to this build flavour +// +#define _MAC +#define DEBUG 1 +#define _DEBUG +#define ENABLE_COMPILER +#define AVMPLUS_PPC +// +// Every file includes avmplus.h, so we might as well get it out of the way. +// +#include "avmplus.h" diff --git a/mozilla/js/tamarin/platform/mac/macho_debuggerdebug.pch++ b/mozilla/js/tamarin/platform/mac/macho_debuggerdebug.pch++ new file mode 100644 index 00000000000..bef7a86b745 --- /dev/null +++ b/mozilla/js/tamarin/platform/mac/macho_debuggerdebug.pch++ @@ -0,0 +1,69 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +// 11jun04 grandma: +// +// macho_debug.pch++ is a pre-compiled header source file (for C++). +// Metrowerks knows to compile pch's before any other file in a project. +// +// The precompile_target pragma names the output macho_debug.mch. +// mch's are pre-compiled headers (binary files). +// +// In the C/C++ preprocessor tab of our project settings, we've defined +// the following Prefix Text: +// +// #if !__option(precompile) +// #include "macho_debug.mch" +// #endif +// +// Prefix text is implicitly pre-pended to each source file before compiling. +// So macho_debug.mch is implicitly included in every source file (except +// pre-compiled headers) -- reducing compile time by more than a factor of five. +// +#pragma precompile_target "macho_debuggerdebug.mch++" +#pragma once on +#define TARGET_API_MAC_CARBON 1 +#define TARGET_API_MAC_OSX 1 +#include "MacHeadersMach-O.c" +#include +// +// Defines specific to this build flavour +// +#define _MAC +#define DEBUG 1 +#define _DEBUG +#define ENABLE_COMPILER +#define AVMPLUS_PPC +#define DEBUGGER +// +// Every file includes avmplus.h, so we might as well get it out of the way. +// +#include "avmplus.h" diff --git a/mozilla/js/tamarin/platform/mac/macho_debuggerrelease.pch++ b/mozilla/js/tamarin/platform/mac/macho_debuggerrelease.pch++ new file mode 100644 index 00000000000..037c24ac6ad --- /dev/null +++ b/mozilla/js/tamarin/platform/mac/macho_debuggerrelease.pch++ @@ -0,0 +1,67 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +// 11jun04 grandma: +// +// macho_debug.pch++ is a pre-compiled header source file (for C++). +// Metrowerks knows to compile pch's before any other file in a project. +// +// The precompile_target pragma names the output macho_debug.mch. +// mch's are pre-compiled headers (binary files). +// +// In the C/C++ preprocessor tab of our project settings, we've defined +// the following Prefix Text: +// +// #if !__option(precompile) +// #include "macho_debug.mch" +// #endif +// +// Prefix text is implicitly pre-pended to each source file before compiling. +// So macho_debug.mch is implicitly included in every source file (except +// pre-compiled headers) -- reducing compile time by more than a factor of five. +// +#pragma precompile_target "macho_debuggerrelease.mch++" +#pragma once on +#define TARGET_API_MAC_CARBON 1 +#define TARGET_API_MAC_OSX 1 +#include "MacHeadersMach-O.c" +#include +// +// Defines specific to this build flavour +// +#define _MAC +#define ENABLE_COMPILER +#define AVMPLUS_PPC +#define DEBUGGER +// +// Every file includes avmplus.h, so we might as well get it out of the way. +// +#include "avmplus.h" diff --git a/mozilla/js/tamarin/platform/mac/macho_release.pch++ b/mozilla/js/tamarin/platform/mac/macho_release.pch++ new file mode 100644 index 00000000000..614027e8f56 --- /dev/null +++ b/mozilla/js/tamarin/platform/mac/macho_release.pch++ @@ -0,0 +1,66 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +// 11jun04 grandma: +// +// macho_debug.pch++ is a pre-compiled header source file (for C++). +// Metrowerks knows to compile pch's before any other file in a project. +// +// The precompile_target pragma names the output macho_debug.mch. +// mch's are pre-compiled headers (binary files). +// +// In the C/C++ preprocessor tab of our project settings, we've defined +// the following Prefix Text: +// +// #if !__option(precompile) +// #include "macho_debug.mch" +// #endif +// +// Prefix text is implicitly pre-pended to each source file before compiling. +// So macho_debug.mch is implicitly included in every source file (except +// pre-compiled headers) -- reducing compile time by more than a factor of five. +// +#pragma precompile_target "macho_release.mch++" +#pragma once on +#define TARGET_API_MAC_CARBON 1 +#define TARGET_API_MAC_OSX 1 +#include "MacHeadersMach-O.c" +#include +// +// Defines specific to this build flavour +// +#define _MAC +#define ENABLE_COMPILER +#define AVMPLUS_PPC +// +// Every file includes avmplus.h, so we might as well get it out of the way. +// +#include "avmplus.h" diff --git a/mozilla/js/tamarin/platform/mac/macprefix_debug.pch++ b/mozilla/js/tamarin/platform/mac/macprefix_debug.pch++ new file mode 100644 index 00000000000..f03beff8fbc --- /dev/null +++ b/mozilla/js/tamarin/platform/mac/macprefix_debug.pch++ @@ -0,0 +1,58 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 1993-2001 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#ifndef macprefix_debug_h +#define macprefix_debug_h + +#pragma precompile_target "macprefix_debug.mch++" + +#define TARGET_API_MAC_CARBON 1 + +#if __cplusplus + #include +#else + #include +#endif + +#if !defined(TARGET_API_MAC_CARBON) || !TARGET_API_MAC_CARBON +#pragma message(__FILE__": Non-Carbon build.") +#endif + +#define _MAC +#define DEBUG 1 +#define _DEBUG +#define ENABLE_COMPILER +#define AVMPLUS_PPC + +#include "avmplus.h" + +#endif diff --git a/mozilla/js/tamarin/platform/mac/macprefix_debuggerdebug.pch++ b/mozilla/js/tamarin/platform/mac/macprefix_debuggerdebug.pch++ new file mode 100644 index 00000000000..561eef67e85 --- /dev/null +++ b/mozilla/js/tamarin/platform/mac/macprefix_debuggerdebug.pch++ @@ -0,0 +1,59 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 1993-2001 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#ifndef macprefix_debuggerdebug_h +#define macprefix_debuggerdebug_h + +#pragma precompile_target "macprefix_debuggerdebug.mch++" + +#define TARGET_API_MAC_CARBON 1 + +#if __cplusplus + #include +#else + #include +#endif + +#if !defined(TARGET_API_MAC_CARBON) || !TARGET_API_MAC_CARBON +#pragma message(__FILE__": Non-Carbon build.") +#endif + +#define _MAC +#define DEBUG 1 +#define _DEBUG +#define DEBUGGER +#define ENABLE_COMPILER +#define AVMPLUS_PPC + +#include "avmplus.h" + +#endif diff --git a/mozilla/js/tamarin/platform/mac/macprefix_debuggerrel.pch++ b/mozilla/js/tamarin/platform/mac/macprefix_debuggerrel.pch++ new file mode 100644 index 00000000000..684c4fcfe66 --- /dev/null +++ b/mozilla/js/tamarin/platform/mac/macprefix_debuggerrel.pch++ @@ -0,0 +1,57 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 1993-2001 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#ifndef macprefix_debuggerrel_h +#define macprefix_debuggerrel_h + +#pragma precompile_target "macprefix_debuggerrel.mch++" + +#define TARGET_API_MAC_CARBON 1 + +#if __cplusplus + #include +#else + #include +#endif + +#if !defined(TARGET_API_MAC_CARBON) || !TARGET_API_MAC_CARBON +#pragma message(__FILE__": Non-Carbon build.") +#endif + +#define _MAC +#define DEBUGGER +#define ENABLE_COMPILER +#define AVMPLUS_PPC + +#include "avmplus.h" + +#endif diff --git a/mozilla/js/tamarin/platform/mac/macprefix_release.pch++ b/mozilla/js/tamarin/platform/mac/macprefix_release.pch++ new file mode 100644 index 00000000000..2c2263ea3ba --- /dev/null +++ b/mozilla/js/tamarin/platform/mac/macprefix_release.pch++ @@ -0,0 +1,56 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 1993-2001 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#ifndef macprefix_release_h +#define macprefix_release_h + +#pragma precompile_target "macprefix_release.mch++" + +#define TARGET_API_MAC_CARBON 1 + +#if __cplusplus + #include +#else + #include +#endif + +#if !defined(TARGET_API_MAC_CARBON) || !TARGET_API_MAC_CARBON +#pragma message(__FILE__": Non-Carbon build.") +#endif + +#define _MAC +#define ENABLE_COMPILER +#define AVMPLUS_PPC + +#include "avmplus.h" + +#endif diff --git a/mozilla/js/tamarin/platform/mac/shell.mcp b/mozilla/js/tamarin/platform/mac/shell.mcp new file mode 100644 index 0000000000000000000000000000000000000000..04a2d6b50cc3dc43cbd1d7e1f6d5996e490efa6a GIT binary patch literal 151141 zcmeIb31C#!+5dkh8v#LaL3S8G7D2)yDvL`(09g`Jp+<{yHdtoiRlPtp7zpgm1KL()7|^P`}rX?_m$bj`1X zo}u}xpuIHzS?HOXe+k-K^S^`kG5Jg>YhTTu1?{K#S#ntud3Nb|2j zMZdVrzjE*jhgzk4LlkRdN&bgwUg967c|TOr#$|2iFkG=l)}7E1ntu*DQu7}`B`#dH z)Zy8RHL@j+(VCwQ9iw@P{~XQV2py~Wr=fY8e*-#B^M8hpH~Ac?hY6aW2o>OR$~l~? zSR+SlW|HRjL(kK^==^-mi_R}F`7T|dlQl2-ouc^#(5aelgih1E=;1=mAApMO;<_B< za52E;iXC2}SR+^Tm#=xTlLF0)9z-v=T+wr(VvXF#p))l9I&`My{|=RU!gUqfxm2-6 zSIO^e%}d*nG;m$7;V@URMpvN^0O8If!CC&=P8r`MesMP$+P@m@i2wiFNJtUu1nx6!fGUIwkno>`= z9$PrnDAwrlS?DUwe-~P-dC_N`$)9`%bhYO5p=&fRX$CYebyTl;(Px9^--HG=FZvYw z!<{1eyi&2oDN^qt%}cqPG=Cj5ta*vES@S=HuGPHQ(mIpxIT$MX!u1pzT(4N8r<7xZ z=5K^<)cjYVn>7DERN5Qv)NUNEQmk?6IZ)9T?o_G&R^i|!e5+!OQ}2adt@#7cZJPfL zbi2u)mJ1af;ZDoraIIpE)5HdMXkPLwWyYQM5Qm+LHBJ*9Ua$H8f!<*9r=JOx^59OF zc6^g!jnkz*Z`Qo{-JIdK4ShuOVr!3TUef=Z=D!b>cyYa@ zjADzpKK(g7p;)8OEa>MoFZ%z2=B0kVsQE8JpVa)@(5FnkuMi2t^&QSZ>Iv6(0f%Q4 zYxLa={j%mIebE=Lue61)D%R-xztCq*zF$A+*EF9G{krB?L!Z;U)bsP2m+)_B{vh<5 zCf~m+^aah2gC5X)8T3WXOWt16yy*B_n*RaxWzCD;zHRaYL~q~Gd?8e92sc3T_Nroy z0b*0%)x5;_n&y8G{hrAWJQ*r=gBy4O2T2b%a3zP=6>AK<4k|jr4HVtKp;%*}*oL$# z+#nB!w-jp(8Uy{2=9fZ$ta&M;T!R}VHu6)&8iPdkXPOuNOTFR-OQrr?vBuy_puf<( zANr2wZ-Tz7d8z;RG%tSdo4mIh^aIULh91=Xa_BELFZTZ{&5ParTJsW*^g*~GnH>I0 zvBr?$(BEo)A@p~eZ-t6}aYG*A@CU^jL!=)5+vJCeuKuX`DbPP@eiigX&5K?AS@SPK z|6=kd)bVCYBYL<4+y=y6MHhF0JHahL^dNogUT`-0kL=KW5fo;zMclp0O?1h|B${y z>P*`A^FZoK>g^?P0DKL614w@%ZBW{>wA)vJ*u$$pY~wZXJs@rI2jF$^Z6NJV+MBeq zw}7;j{{mur(ypXENjsAEBkksQK>8hNH(v$PCrP`J_9AvE_AG5g+J>}=gFtL>DwqZ? z1Q&tv-~uoSTnsJ&`9Rvw1aKZW7ZiZ$pb*ReGr=ryDVPoBfVp5EC<4V`K3D)sz-2(% zPbnw^=YvIH9GD0egC(FGECtKJ4Xgl_U^}=5Tnl!9>%dNM zJva$;2R*>a;1rMrJRleJ1gC=2KsS&Lx`Hm?bZ`df1$k-!UvfT2L#Fpvpyz$kDw7!AgNbHG@T2hIYia#B`tq65jVILW)@L!9J8bRte{ zQgk4$5J*17iM@zU#EGql?!<{*h`z*0U5gIINu7!A#Yx>u9f;ctBp>4L1yU#C9t2W1 z;=T-|Uc|i&q<+Nx1V}xJ`xTJ-5%(7$^@LMJmHHB1;*fg7d8A&X{%{`AwbUcdGmV4P zC(bjEgVZa|BW*x*g!4!lrH*kPv015SoJVX<;>CGx;WBn{7^hexV;^+9=A|qXH2)>&M9qHF6#ykB8SVmo5KRd8d;x*mS|q==Q7Q|1eG%5vcAWm zRIx_Zo6s`N{{p&5^S^>F*8E?gOH4jn+IP9;`$Ly%UTkNX=0*3HYhKE_T=Np&3eDF* zuh4uDTA}$3&`Ql;4fSdM4(LkFKLi!M;IgHR)rvK;zYXc8aX|oYcxLu8qmDhc)jMO{u?weI*>BpawLvM#hP_z?tda9isOS#YMar^Ku|}7Zp_??{ z54u_N(g$3nd1-%JG(R2Ms`<;HTQx7bm-@hUk-TqHtkFfnw`*R?CFR6**~{Tt#Ts26 zh3?S&Q_$-)FZH!k^Y1{f*Zl9GV&Awf|Kf0?VvXD!=uMhG9eT6oheB`By!0`!A;8UiAHl<|XfsYF=#bbDDo1D(ASa-{tVQVvVkEL!Z$6AD~iZT-X2O@CC&h-FiU3 zsQLcTCp9naMd};Z?E(&8QmoN!2J~somqMS>{7UGTH7|AX70ru%Njt}NlR9};u|_x1 z+1E5LaerO&uRx#E{Li6MHe9z4IebI0=Iw>l8SW%$BQGe{I7#wwEqnh!z0qxox~k|*3rVqdQ+);LM(Q*@0xN%ZuZVvUm|U*FTb*pl=G zxRc)FAm_M~{+q+=iZxF92lR&~-#r8RhUTSS-qgIb{kJqf0{SD(kB9zP^V6U|(Y%!L zrU^CbRHiDag^zYIxrOy|ekUrruAZ4Ky14|7ywQI3&3MQY;PbK4F-Y1zzgPpxnK-92Mhs2K^GwHY8ZGFJOUmD zg51y})spaIl_05||9fT>^&*a^-6*8!=YYr!=@+VytuCddKO7rqO`iA<#a_eo_+ zWvGJ(XUM;JsN)>XOSPLf&C>~#rM1&RZ_o$y1^qyOFaQh$GBr6Ec)<`b6bu7rf#F~T z7zsv!v%zRE2Al)Nf;=z|j0Y3IL~t&c1kMBJgA2f9Fa=Bn)4+w`B5*Od1muGPAo(r? zGr&wR3tS3jgE?R>m zDo_plpa!f0wV)2H25Ue7)Pn{P1dZTI5CTmg44T1Ounx3<^P+e8W*j6-h zo*~6BuY;%zOHf{|@Zv}{7xV&sS~&lU*&v60s3!(Er)m3dDlsxzJvke{euJF1Nm8N` z^pzmxPUCo*F6QZaM&%5BRWChLbEfK*Wp1Rax~7lnK_nLGNn}1mdN1i~rRSIa*YqEw zdUWY)%_4X;ovZ!lX*xq+H(cdI7gxm;e~1fFC!}-AT;Ez>VZhhaipTrhr^97EA}j z!MDMefhb!t_%iq+_zL&}*Z|}vY(0=0EV(IO4lW1Vz|}x*s_p<+f<|x)_zt)kbOT}% z>%dxYCXgzg5Bh;uz^kActOj+U7OVn405#xz;0MLvQt$%!CU^^s1AV|ka60G>o(B(t z2f$~+{a`nE5A*`JgWJHZKy>vS_&WF+couvWd<(n;UIgMMf;YhH;3wcm;OF2M;BD}I z@I&wp_%WykRUiYb1U^s+wt|sB%ym4-1CzjOARiQf?}D?z2yiZ#0eXVjpcQNZncyn0 z8EgU@!A;;s@C_hM?0rxQE(6~K9*_mHK@pe-E&vySOTdNTVlWDv1ZINC;Ck?R@C0}q zOamW){$Kz&1uOuMfzN?~U^Ey61_Ljc1LlG;;2ban3Ti@-i`H`ojA0(-zS;AyZQd#00+PXFcqu;JHZ*?I1}FYQp;#3XPYkiOvpAa*(hNd1U?iY;FRE(Vu?d{6+U1F@|c zU?!LaE(Nne#75`A7lC3hABb&>?OX;H0%=oaKNR0BV#0joeQr~|8k*q7Lx*j@t=TWkbZf)Ho|VbBcLf_0z;tOpywMz9HN23LVC zpcQNdSA%U}I}m%l790zgNg`rLLc2fz&K;gZhrTHF80RwL&eA7o4YbjKNA+7-5nsh{ zh*0gHFH|}#fp&8HB>j~#G1Y+a*qLp3#2}TE)-0`BhR3L<3b8qqloWbP!`0qGZ(*>Z zDH!liUFfe5hW*|d{*}$EjP}6=&EeqKurIXAA5IWj;;UNYTjl3fZ(oBykU*d`*c__z zd&@$8e^Y|sf~qQiQxjK*YZC>lOiA<$n;XJ)_5K7gl&P$FOa0++UBjwGk<6+K_`Sux z#zvd)>CJV4YVXXJaLAYF@@O8+loDj2u(>H5toP3IuU{7oRVRw${K@msceVdge?x-n zC3HqzliYIGuMGG@HX@e>f-8Li?}A1&QMbWXtf;PGjcs7$jr{iYTsW?9%os9R--x;r zWx*8S)&2$>Jr>R?rX&e6KdY?7);{EELsG5xHB@`adZH>;GDW_IRn3@Mg7{T<@xr+U zjg6`<6J}otEocrmHYc)U6>6^>37!$Gihj`0UVX*Bss*LqVn6M~wyb9A-dO=(LOYd6 z?Tti29gIXoTo{Rn*&2ximdu=$K+7sbf6yU(d@q7eK~ueL(HHtRSZvFT#j6@-QC(A_ z3Xv4FGHAP1wPP39WXTLnULY-F+kltUH7u0mY;C_~^7)b6B*=z@I#i8_%xtOh({|~0 zZPg@VE^1K3Y->;gBbKZS9$!^)U2;N+xL!G-M6^?kbj%5*+V;%}h2p#Cgd%Z0bV7+} zesmot6p9<^5=vMHyMzL5yZVGe*52M$AkJWHrP>*Tt)#XG+wi0&(WdiH7)hJ{Ke3EC z1SAZLjRFaSRSz6D5ZH@F#{zqi_~F1_PLBxo0!j7Oc3emp4W4a=hJ<2qqeDW8HaA;| zWn%rN;Up00SZ(E;ZB)8xcQz`L$!t`@bw*r@C2Q&un+#*NMN3+(Tpb(C5=Id>o+XrM zGo~bzk*+#2;@b*1SAs;-Zg8=U&s}v{h8WwJ66sLgLz)j3w&RRN#&)E!$VB`0L}QIb zF4<^f5wjm}EJC&;jzuP#uLOo@5wjh2EHZZEjzuKd$YT++8++P_*cw$ExunL@Mm9mS zZ6o1eFiA!sOGHV=A*)pTk;oF7cr3CABp;313ML$n+6vi^NNpt(j7e=p95k71T(U$( z%T6*fSp;pzCW}mx(a9=B$DF9kODvLTglZ${#*$?;aBImTo7|E`LidTT1(SCX5@XxZ zs!cH+Dx4S+k64yyY{x8%Op;N{B4syjwGnYsHI8Ffn>gK8qs{o$CN?Lns&*t3W2>0+ zh`X7vM5Ou(vnfSqp|pLNQz~jWG$+`mCK?pmOC=f>+e<|Upf&?zdr6z2vAtlz!Lhwq zqT#WZeup36U1!u4oqkE=2fD|Tkn10`+@#o02l}cfx*BFhJc}97&r?I2P42pFbbRv zMuRcn955E-fpK6wm;fe%bHOBV9ylLd049SeU@DjfE(8~Wi@_xz9~6M;pb*ReGr=ry zDVPoBfVp5EC<4V`K3D)sz-6Emlz~NHF<1i1!BVgcTn?6l72pa`0V;tHtOQk{8u&pC zSOsc99as(4fB>im4Il^_!IdBcnm`ydgSB8CXaVcN2Cxxq0-M2AU<+skTfx;}8`uu6 z0oQ^Z;5x7qTn}ypH-VeMEnpY872F1H2fM)?;7+gy+y(Z6yTLwi54hJjmDkGTP3u#O zON$D9p_Rb~8fZ;j3m;3wIliMnQlMVTHp4s~r_18vH~~+1V^1ki6%B=2+##>Gw$|&N za>0a&>4pl+J>T0U}HQowpp<+?#ocWhl z%r7XOSz1z1II~CB%{{sf^EXu2)yUM@OXR#@RXwVr!hBV$ zqT+1th!Nf)F@H1F(z1fGIfWHPbEcOfLb{Fe03N(<@`|n=!`vs4Y^Yr<<%nx2Yl^NC3dgk>0^MRb+|H@az zxO-Y8Jddw{rg`>G{YZybn&DFq%JuS*Rm4engg4&(e0=lRhtGFAkh>{MA ze)0pJd|{Je-VeFS`G~^%-_T$492`;j;78_N?|Facaro~e3fCMQ{>)!nGglJR0JhA` zmCpj;=N8YLzX)Y5E-490Si{1)YWc2jLuuJUFZ9~7V!5w0Zu9xWe&~H`{h=o0AFHYf z$@MQ8tsJ%M@}~M8Qoe6Ay1Zq0A?j-(zN(XN688e0HMtu$aw`?zD&HRF%J+9XhZ-eb zBX_6b)pvsvZc}`;Vs(hacigl6fk1FcFchfHt1@`B@fPMWjh0tbx6+u?!1GUyugWhc z#e4&#C?a|dDIzCVmCjkPs62XQOZ(UGjj85MJ8^jD)Heo0VK3Jk(|sf#Z19qeMx%I% zS5FfW!j!GV!h17DxlE~9ui|YS>!~@*k8osSGVV2wxCJsb&1L;$sqJ!C{Hj*m;#Kro zJ+s|*{m9IF^g9LfG`boTx4zJ389}lhS-KWJZr)ft+D-Uc3M*{nn~=ynCVsIOj^ZZ2 zr^bD4pz1)+xW)w-mU=S7W3?maBoLVyY?BpT4zIpSLUjUqnZe?t6*;w5jF7Lh0@X&K zZe{(ts!%x3XKJ9=OEFL7Rb_tiSh1kAqMXhs!HjWzh3)UC=!?nR`5wf02cu8|p zZ8WqX6!NWKuu^_d2U+Wxh?a&!yrM>cW=ubHi&v4qVO6+xR&#@zoL70A(=^{VKk8F! z#GlK>a~k+kj>!DJdZMtNNod57*Bo*_&~EXY^tL`sbP8`ShYrq5%x8N&7_r1 zEy>28OLT>`%?)dcWkjhW(&=?!7O)k=#GKOp^g5FhVRgBrtXI{MVY7KA1n&4 z^M?vC?PwhB{UoMX&D9$7o9kElLvi^ku4{-!U^21-CB;(~uTCVIg0=OkWwAP{OdxWO zWHdetE0@e-Obb^RJ^qziXp^mo#s*%s%s2Kl@NC-QJEgon`>%R zJB~Xw!=r7V$QlE6;b^X`XG*lh7iuzN@mDp6>cZmkfryK@DdtTI1-5j$DM15`nqu4T7Og>CG>=ePDI-Dw?x>+ zLuA?*MWijvYzT+elLfP7#HvFsDP3rGaHUsd30C1}V}Df(2x3#1G2RmG~c zZ9=sS?!HE4AeZ{XWqes4v)o#votMNJDQK)CYwIIYZ7M;$Vy!^V3WFhkG~<>N2`g=8 zY>ld0a+v5uBvtMs`fJmZ;T>OmxggS{7*18G%~c++IiTs2$Z&=XpWEs%bu!)?4P)%9 zs7IipS`C494K)lAy6diDY!9)ft5P6jrF5}Wb5uyNrmtj*0ZFb<;#Hxlb07lr=nI6&POi#JaSIrmdS~`|G!U12{ABm&JM}I5Q_$xjZo%n805esK_7TnvYVcyh* zdOBH9I>X->QCRd@C(Wcakk-KAXrQOLV$2*x4wvQR%l=C&xXGqRX_wZ3OeY<}K{A|)HAv}JT&%dpr*FVimc%n`TGGV7bRjm~Ks7Q4vc zjT6t*=BCipx`wJibG1Kh6P?l~WIs*iioTlu;T=tn- zRJStZ3$33zE3zQdl(v*kVj`wpFp%i};`HcG?sXCc97ZvDmT&jd0m|p42Ss~4&$-%< z^e|FPi>5VjcpB(szInuKQ`)69(782`ZUddW{?nyTYap!w^YWXS%(#n z9#1>0!gK^Df(GhCt0zu8??fm`x(sOz9JvP4?ZCC})K84cclr#XiO13SPsmT4T@)OD zI#vH}rsySp{#5iN=&QBN{Ob|?RHs~Q(QVhc(}T?o)% zk~#Bd2-=9JPtzLcoEk{ni*-(2bmmg?OQgIp-u6Sb&a9Di**lpA)E6TQyw)#C&Cg6a ziyqSNws)4Ac2~}9BYS?3AGS>HvWkmK+-|d$Jf9{^ ziTB~%Wb3v>@qwJhZFbZy)bwEcs982aQSX$bv!w8-&kt6T<5Y}M(SqABl8)-reIbY5 z)+U0(@HW$Fv6+!QjEEdWRXWFN%ysD1tvd%L%C_36CsBaKPnD-?%ovMTJ2rLcBrj0v z(n)RxDNHA6La9rqrKMe^SUggej{g|7pX9f!aXVsJiWy~{>{^yxlwH>zUAvB@W497y zX1SyF6HDjl+Cem(#;T+>)Y0;^M(T%jlGRY^(n&wNn3iZB-Q0t#_S0m&sy)x0rfdUg z>)hN|sdUz@>F{%sZ6{aPTCT;`EHW#=lPj#@Wxy@xMKdmIjR6O%JWlYj>^UT*~ z+s}5tgmb=zb! zWv7)oreik$d6XMbv^>Xbp0!*yj*V>k*|uKBoN&+nGnUGp&PkoDt64T%Z71t=FDVxk z^P4X1E^OnGl5||mWuzn>7jqdYN#_%o%Xs0?uZ%9&-PX9@*#8Vwl$rI9$KJ^L$D`xj z-18V;e5HKXsEPke9QnpiJ~DQVI_KRN4*h04@pvjZsC$(YZ7#!MB(&axdoc=gcVd*G zotyTf^mZ6?3>`}+d4W<_p2mm@64Df=lQf~!rQ`nDvP1QA9L_NuNqKrw>&mW^KEX0} zSoY5ESUT?K7&?~D(Y1r9-U3xM2^&rdJyrcAc|Mh-I$A#xhnY_Dgi@ByVa&}Oi5;{? z%5xZVGaXGQndUmGH*0z7lO&Y7bkcK8m{8QYx$jc#=NQZZeG+ps>V9Lqw+kb z>gO2D&F~8i=T7ume)7G&c@I#1VDd+o*u4r-wU2@y(iz9=!-)bcer7t!#iCze+fG?J$LwA|`Auuez7OGNiIV9}IyZllZbAtJ-Sls&ohC0% zO1?uex_bCEgan!FTwVt=*H3yhbNg+ha_W~IG>e|yGiUo%v&4qN|@(c)|xcq8b0kcjBN8Pb{rWXp1U&lWRKGEBz?b8u2b=}%TGfy z@f^%-S-fAzvp<$bVot@AI4JGg88xtOv^TS5{70t!-2SSQ3KH94S!w3F(Y2ZDOJ3FS z{Qk(|@r8-!$;|cN>1oEZTW-;ly2SYz{W9_Vzs%PE=ytk$a?(f$OdL-rn7M9De&)J? z<8^*2k1U=*8Sz|~*^*tZ!W89krVCv*K}`{nw~?YrM# zzK@>=tmaq2W#(_}0)FVWGdT*qptQWg@*Byap!}9#=W;nxTy>MsZp7+bib$8Xtp;RI z^m=}mx~+ewI?qnQ9kl$)P>P(|3C$XpR8lWIR0=Ybmq{pXIa8>(?}876v3kD7`S-c> zdde4-{2rcdFXs`$=#Br8#LuNSI>m3zmAkas=Fm`OaZW2s@9|GzC^-Mxp%#AHI~0zb zpD6THRYZ?*DkGfvW3?qAehs>%?GT4aiDU$3@jV`=%T5$E*_DIa(3p*6Vg910n2){; zvol>6GpwCJB-|~nsQ9FfFj zGNZpmpb{)Doip<~b@iHY z6Y?gE;~lc5alXd7amQ&PI+CpnqeNy5)n7;AIRUOcV`Sli88b(EN6siHD}a>DDJ&a# z0+h>j5j@7@BAauUx-_hUrmiAzA<3@X%{NZq2!>T54U43IP6!uqpYeK<#Z!l2p z9jZR=@D}+RRyF%p`G{J;#Oi{a^B z>kkBi>w=*`bw%|NlvzfV;+f_09GY)l&U${ToiDFryQ!sHd%Cr!+9p3`@nz(lh!6jt zvP$>_v)j>r{u9i4I_Xqspr`rvA&-snCVEc3VVnu?N#6ygLb;#*IAj`u=_BUHc;}F> z8K*LIemQL$ zpY|F)viw`@LcYfFOl@uoP1Q>UX`47Qoqo!%x-gP|xxdIaj8md^!CoL~n}}$q)6uqe zahkG=()CSYfBjVUfeHCS>!;2N`Re^lPp)Z7TS_Of5YsLgNOXU3deX0;I*C%!#Y}4; ztpQU5IlcexHCLIK%zFC#UFHTOp302sX+3j#|M@^p?|Z#M@qs~*ztVmruGnCQ0h(kn>@#J3DS8>YoJ3KFn7}NvMDh?2;a~Y4EVjX z>Kc4W_hjr)g2&s%>ACyktwuiC{B-4pStegPw@dFq*tzRJUHY~fNbfXzhr!4=- z)KI38UA^s%>?tb@J@3@0!mIah+I5v-v<_jYE`skT(^6K!-o6!n=6}W&F!CIOE^OP91*GEN}YQxiv62 zU&^oNRc82CHm~Y5`bf{KbegJmEGS>%b}jaYR{6aPnvZbXQp;DDM$V`3JC>B@-%;Vt z0-xwx0O{|D(%%s|o9Kxxku{^}(( znKrfji#--mf_(as7PV_j^ zKy3Z2)3=7G0%U~B;Lnxw7$as4>#0{G4vv^LV!YY0ocDLbnDqA%Ge7hWfA&-(<60sc zVEng{J1gLmIq12?Gv_a&2U=WG5?sl7!@|1iBIt(FvV~sgwPnR6a(f*Jg6z!~=^a^cNkKn(EPl^Q)mJGQFQX#QwEl_|Ws3imsswi>Qetr@ z%OPqBauVk{`cpdzrT`={$-8NFCXGw;7@t_|zU$oS!RCf)euO7+9-_}$qEPlblnb>G(da8aUB3= z1q+vTIIeV`+F=!@BRCN>P#;=7apHL=LP^qPNNeE8HIQxxu639GeQnpO>MVlk-`7t6 zzIMdcJN@r#XX!5hPzaA1u_q1QhVJMao)H}%G3B==^tG`}ipOz~H(m|R1-(FD&=2$n z1HeEq2n+^ZFa!(*!@yZ!I2Zv&f>GdXFdB>j=YX*w4~zrj!2~c7oC_v_^T7Gw0x%g& z0aL*=a3Qz|TnsJ&`Jezy2Zdk;mSl3Q!4rU?r#m)xZyGz$#D+>cDES1_VGoXaGUb2(APn&;-Ju8LS2C zKnqw8Hh_&_6W9!{0$V^U*b1%&+rV~k4Y(HU0M~(?;CgUlyBDJi5$I3I7@4_d)r((csom z4GOA}!@mL+h`)KAoO?z9`3-}=0OUL)!5a9F^!X^xSHu5RpP$Wn9sK{N&&P5uoyPwF z6>rv{g_8C;Al~)Rzp9jR$(00T@CBc_!$8)LKjd8U=*cd8s-*BP9teH~X7g~c3tv-; zUGm_gZro^ZlRq4;YgpCft*e*cfAm*-YeK<#Z!l2p9a=a}ey5?x*RZPDx5_`%+vscX z2fU-l_2@CIuEsm0q9WKBt_wDdY7F_Sg7uAc0sq;AG*ktetNq@g{0eQMFSIh)P!jUj z)V1W*4)v1WI$x7_sOjUa;fkRW-!OkebzO~o)Ok!?zNFGqL-?pu`r~X`hUiIP>J8&D zf8fkipE3mw5vs4x7aA9@h>QJ5ED;KO4BUxU-}W`r-K?34YT577+|onTo}>y@y)Im^ z!2D`hS4OW(7cMH%yr)ZPusKxaZ{qyQS#yeJaz$@V`)Jx%(|(%v*K~lU12r9_>0nL0 znhw!)sHVd-JxkN!nvT$Pq^6@ZJzLY!nvT)*98Je+ny2YFO~-3GLDPwvo~!93P0!Qx zd`&OVbh4&XG@YvHG)*tm^de0!*7Ooh^EEBdbh@U6n$FO4rlzwry;RfLn$FR5uBP)e zEz-1D)A^b%(DX7*7iwCnX_=;rG+nIe5>3lBU8?CaO)uAUxuz>Ly+YFpO)E9^X}VI= zDov|3^=n$A=_*ZYHLcThwWez{4QN`gX@jOgO&c|h*mFpqH)$Hyv{}=&ny%BdMbq_~ zZqRh2rkga~tm##nZqc+=)2*6bt?4#Rw`+Qhrq^n^L(}Ul?K7jR`8$(!s)c50iCj%j z7fNs2OP@#R_4@nflnCQWbF^cGEbX?m-sw`qF2rn@!0L(@Ao-J|JUn(o!~ZcX=T zdXMgHjycITvgZdIoE}oLii=A^M>}u%I)S`KxqY&CCH_#rTNVu3NlCc<)v=Jg#-`fX zS$nRu)*nckQ2R^bd|LHcUh-s&j;15Ys2@l0s*P@Ss_jURf)cf_M!SH+@mT2JkW{>q zP&Q3)rT=6Rxk+bX>B7QfakvR{lTO*p^0K^@NlnF=?h6Eh!3OVaf1uG#x`|{|I*oy< zL}3v>cI<5Qhr;WxH|aFh23Fc#@7CWbok%?CzBZx>_tflb*&vrj z*s#W*$ihdaqOWzzQ6&PY=xg1iQ(Rm$-ARu7Fz*~SbKq^ad$3&VrjKOnr&-4&oh5}c zoYLuNcqI{}VvKUihoqzWbYCcuEjnF(Sm99n*YtHzY2<3C32C;2U_(b4ksL|MwN zYmcs7$I`Lejm@mJ)RpJx+Cj8Dja5l&sH5d+jnoh6B&(s+rIUVkF)h(Ny155e?MJ4T zlQ@Q*f~I`%^y7DweRFIISFrB0cr7j)!&z2pkpW|?j;YiBUlUi4Ho%9Ko^-s$j zUB}XKKgZCqbdIhaMD-S^s!7;zQs}AbC&}}vB-PRSkvPnBk|&h1bPi)~=1A|KGQN3BqQ=cTE)TNW2Yr=%0&dq(7YCp$d4(OAZo00p`F8i{M%KfM)InNhW zbwVZ;_wg#7V>M?|y*^NvWF{zOwN)RO{Lv+LuR>Ib8hgs0#X6i$@&ZN2+zzLc^bskA zdUJUX-r@4Nya(@SI@SJTa}S<$HPLbpeuU+TK2x}T7VB_2N7oKwK2OZqpue*1TU-K;0pxtM#lyx(S1BIlZ{TQFU| zHB9OjtXv&g9X;Z7Bmt*;)>M>7rBfY9`o8y!qN3E4=UCkvJAAaAvhq0G8>g&(9M(ru zW^cij@?EQ~OIbR{>|Q_lO>0NL+i2CA$_uGamu&SWotwW&H=zVlZu&R5>{xt<65B7q zvnzW_|MA&VmVabsIn&6l-u6cJlojf$SeAMkRe1IOO}qFt*480x^E71%SmBlNlJJu3 zDOWt1P58FY?)m~#m_y}T40=! zJ!R>B!duO7=T+f(QUCH#SY~)@$1Whi zBEM9gH+yZHV7{9=Dk^_PBz{HNML@@25$Df~$=cs%oddDNuO1$IZJF4rzMG51ANMY~ zMZSsmVCs6^^2hyc(p?uxw=mea-Z&@dC0&~FjJS7d5B)QmpY&CsW3bn+)S=yKA zC$F(FXvFlhRpcVhB7e2`CD6}~h^(S9{ahFEuM{SxpX=qc*Nu0hfw=tKDE++XM}2S@ z)6YIres4(|dG#r0W1uN4{+9Uf&$GM-W6A#mBG&6x{fHRL=OfC0$JpNsmE9k7JwB?= z^}!O)W0m;z+VY=Ks-KVL^JNk3wIi>OP$L%qx8pvbjQM{@#Cq-cizz=Xnl5`=DF0W5 zTIx}qi=T3vqw=p6%6$jl>UUM2C3+V$n;OxA?ulhrHY3Mp)uQ`2qLTFGQT`Y)Db0Th z^8AVJ?Dh%hKLsjFX%wHR{!?0#bYw@Qfvg!tmzGzpsjKEI+to`-OA2)?(lcd%OhCUW z`<|-%=`PS*&=qt8CxPyu2RIp=0%XuU6`Tf62WNm@fFaoE4Wu{k3;F@s*=PV52nK<{ zzzc?ep;!1!#81LMI2FcF*!CV}&S%%EQYCW9$J zjGr;ZxDZ?fE(Vu?d{6+U1JTC}FcZuImx9?~4wwt(fg(^0<^#E5l2Q0Fun?4jGO!3N z21`IWSPGVb%fWK60?1vI+%Z)GA6N;hKsE3K8J1UpT2Kd8gEb%kWSzSK$T-&sWEUp6 zYm)c*WvpukYk}MuwE(%}*#I_zO@Oh|xC(3mtzav-8f*jG!8PDo@M&=#GRhvl-DKZ{ z;JRQaAWA%ZC*x)D%yOyy{KLOG`4y5yz^e-B6^*vGnek5nJk{G$T(s z{?6+>1)aC-Qu2=W^PO9JCqU_QT$CYSWU}4$`jkYM`?}Z*<<8H%p#=-st2OkSXPV)i3XBjF|bMcf_obUQ;7E z#)#@|xy+_he=nd~#lCbt^7vyIjdHSd|c-|);f zo?I&7`v-Bo&shGX$5;-3GV}^)PiQ4^oM(w6i|evx8_%ovO3b(p9h$uV&>`aLA#&IC z^-Pc{^Zcugcenid-z~F^J%1DbM}5ZPN4FZ~ldBBRTA2nwU2s?W%21<^&ctYH0HCVoCQ}KJyqF|+frqe=rVg$*|r*s zw`}S%N#dCHe}_Jn^fzT0C7WI#?~;cDM&{&$Mkaaq=d`PgKIEg1B_I8CJ_blW44HSO z+>@&g{l_f#Rn61BX$(^3j^#bB+~iB;oohbk8gzSA!GnX0@fJO0=rpnP%Ssy5tK=)8KWR&Se}08UUdkbPqU@&s z{(&r&L~L-NVdiU~q4RZzvN!I77EgZn(0@dqsxDiN%uU(k>tXbH0DT^mGOnM1P7I44 zRzFXCY)(dTYvq$r~ ztv^vO`rkj;IDgs)#`%Pq?R~H@S=qo~W2$KbyJw1=zE-#QXJ3r@McVrls@+{TAllwv zCGHC?@m{Rs%{Sw{{X<>Wpu=a0Ko@tvCw{7B`ZYkdk9q%k1 zZx59(Y4aP+Hb40}bVWLwq|HC1+Pp{l9Meu)vXz}i>S2(!vq2G?zwH|;zWa^E(>5OZ z*kbdB;VJ%ihLQeVMs#q({4OJ9xe441ZUMW%t>89rJJ=2G0C$2t;4ZKi+zs}Dd%(Tm zKJ&id7#zE?>|PqK_7<{9c0*Gz;BUY8ZS?&gl^stjh6{{*7NrkBle_dfV|tx2xrL-d zJE{SXv`{k=r?%YDq|(=?HE>*OfcJNDXRfUaEH1974pdiEA3 z>Bm^%$60cneLlUjzrWMbe*QQ!=X7=sR|9H3-MnZ-;hKXZ3LiRXp2>XrI(efy>LfgR zasn~d`ScU0Sni8*0?jXsD17js`R2wOPmY+erKiC}ki74`E7QmtQTV`y}D?o?>5J!`Q-r zuSvca?1ZkMIUF2&slUM=@`e3JGSS!xb(Svj38Vq@4lCUcbn<>6yYL&&fLag++x5Bl z9SKVGb-SSt&h@SJd5e4vtD1eQ{L*wh8JStxIbCwQb~~wikCRX7dFpAWpV8~g-hKM^ z>px)NpuyfDLx-I;e8k96XOA9p&e*(h<0ni!chY(1Uod&f)M*!9bnzwmzLiyMXS%Ak zZuOc#eM7ME$`C&(wsu|1`VE&aUvWi6rG5CuO`EUUa{Y}r-F)ZWpV@KU&g*Z0y=B*} zx81(`jyw00 zh7xvR^75;$(U&@A)iwA6M%Wj-c@ZPoBWI1TA971= zm5rP=KG~t9)<(`6-)K(iY~-x*Nq?}~M$Q@^ucR7lY~-x*$&M)j7jm+zO1+Jo zHC_1tzrjY%n(lbyf;Mv2_+$r{MjJV6e6q{Sl{RwL_|D}dV~P z$X$foCKqxSBe&T`&YHhVkh{u8jv&)E^<3<Th7TI7jm+5)?F^- zmLa#-M$TG}%aOa=MvfrUalvx9eKvB|_*NiykByv;P1)5IoZRa|t^&FHY~-xzRwDNq z8##hZ#|1vP{VwEIB6q(Fxhmv7>q1Uu)gEvmCy#~?+Q?bUTZ7y~HgW`+jtgYRw1;iv ztnt+%_lS+0j!o5@?7a4U)yRF$M$Q`F8crT_As0aIaT_^ny0R186EUtC0JK3%M=Geba?pD{?Q`$Pr{ZGO!iyfQ_6re^(>-qK%x6 zP4x%cIC;s1+;-%?Wg}-z_ZsA0wvn@@do3s5b|JR|x$oG>S<}4^xmR4sU60)NV{)9u zoak0LBEA9U2Qj&5QW73Lfw__M*Imfngxn8pMRAGwgb4Y?oN$Pr{ZGH^TGPh80DM((FJa@KO(f!xnr$lZzD+b-nxAop_@a(5y3 z3m0;Gk$cBRjv&)fpu6GTwUM)ycOP=^xsbaDxr0t}X6orED;+R~tD--GH33B~7Ut%LCvdSUXAEw+!&KlnUWt>mSI;dPSv8 zx&)aHIa#l8T>n5$)+-#>Kai943di*ix9M?aPll2P6^$+A^y~1(*136i*a9saDPSz_N*FTVx^$N%J z59DOM!g2irIa#l8T>n7sJmf+y>{-?;9M?aH?*il;*FTVx^$N%J59FpGx7J1erXsh_ zh1@jcT3pCoh}?P`IcxtS>lGVpKai943di*ix9M?aPll2P6^$+A^y~1(*136i*a9saDt^_&9^$+A^ zUBhwx136i*a9saDPSz_N*FTV3gxqa5c4}=OvR>i1{y}_8kaJxBKu*>x9M?aPTZ-JB zHu)pSbjU4(+v7s+a^&uEA-5d4y*6@Iy~ujS-8OOrnU4I)dc{5)Ict2fUU83&oQ_T1 zPgZhruM0UJa*pdCi1{(+pVS2(VJ zASde;j_V)D$$Ew3`Ui5dUg5a@ft;*YIIe#nC+iiC>mSI;dWGZq2XeAr;kf>RoUB(k zu74mW>lKdcAIQmih2#1MalKdcAH=r~ zImh)6$$G`}HgeYZT9NyP3%RYxIj(n5$)+-LUNLSV?9M?aHPu43O z*FTVx^$N%J59DOM!g2irIa#l8T>n6BCvuMKAIQnNhU5ANai1{(+pVS2(VJASde;Z@I7+S+8(h{~$hDuW(%dK<*CY9M?aP zll6+9y2#%izl%IKWlLw=8?OLzuebbTo3%S#9!{uEp8?A zc|CPJnZJ((oN9^3>VFpZ*^ziG{uw>9Woe{7+$iZr`!}Ywk8z=L3uX%D$X?>%&d)@n>W(K4wj-53j=Ck{@HRJXfDw9}G+UG3VL2 z75SYdMeK&YGgrpK;b!3Izmo1b^^Hx)TjLoh^P;2BTO0qO@5lVj7|i2fnTN@(_XXPM zf0(R4?5_7I{a7wIYa}OUG=}^&M$Yv=gReCM&yso3Zl?bgGIyuTvG|AZ-Iag#pX6Rc zo(FM@-{Ekw>HmKck39e37XJY?=9vC(`~?r4uX5t|{KE8qx*z_cZ`@!hZ?5ux>Qc{cVbZ(~>vbdV`O;5+bgUx2GXKOU{0(5raJeE@FH zcZp}YDR2B44;lAyzemrfyleWe6#366Z)4bRpy!+Z&;1L2zv+J?{X^I7rvECbtNTs= ze_-dCI^FpvP9x&w>iG99p`adkXe^B{*WZfv|Ow<1fnX7q7 z`5QyKK~23q_1ka4Kdk-FiTRI~`g+9lA1tataKi%b!gDcg3!rQ2s{i-_U;_)Bmil_(`4N z_2G+@>kZR?-b8%9p!^MACV^)Adg{_j{Jv=V|2vz0L+4ZdTK$uz|4^}Qt%rNAhJQ-? z-wM_Ca33~fd`bIDd^$gCrCd*&{==SyYP((XHTY*t|Dl_pI^D-9qan77`_&IP+-K(h z(bM3+BEE*_?Qc-;x?EqQ?8aA>zj4-O&`7_^ZL4+}XH%|de;)JqyxzsqpU3=-ft6et z>Ca>Soh}IiY}@#{=|AM3 zv3_QU*zt{~O!w1WOy zj*rwCZg4pV-Os!v?d|};U404%U0*l9505>G`>!2DR%F&o!=LeZNqHN0&Vy<@c~NZp zTgu-v^Fzw3`GGjPx_J{}(@L!^G2s z-Xi@>nUwYWrvDTl>FR!_PWmv(6YkD>4!WNiej)tp;%j&|-Vp0&mQZ%%hsxjBGZU)y zR`)shH%$NE{wU`E-M;W|n*L{ryzXaw^Wonz{TIs^q1#dRyYO;7?zhrLbU$;?9C*<+ z`I%3CBK^$L1Moiq_`ippNBWt(`|$ax@;5#vJkrlBIEbH&&3IjmJw*DMx7Oh!b%1{n zdXDrnvqU#PH~rW8WBtr&eenB*@;81b_Nevn^$qZ1>$uHzGYR zez(HEC%)WiWpmVa+fC9H+r|Cv5C>B~PySiP%@4$v-%+@iqwZ&#uY*4b@ZWlWte-h} z4?dC){CDi*IIO-VB=zhOFXcQtuYgAUE&ao9WPH9ywU@!qOI`fRl>cAyto1zjA2;Fm zYt#S#Hb?t`!LQZf_Z#JJjFmPuQN`o!b2j{cDSyxU9#9?s>tb)eHT~bfULx^7T7%#3 zO#lBH8;k$V5PrWm{b%lkn(+_5<}&y{DF2KuFb!MJ;B3l6%@2_{lv7?&Dq@9#Q%4@+@PJ@uBz{o@=g*$!CeJNuPq(wapw&`P_3p ahX0Frqoy?+D(jot-f#csvv2p2T>>U=lHdEjH}iYn z%zQI%=G|NA^|~2jX2wjzS<<*iSkm|p80&&4)@VvHk>nxITjiYZ@cUg}zs>IVE_GH0 zf=L}h<~jU}y&hXxpvsmvYLqR{>#6g)os&zQwcdc!mhW6#U(GZ)x%C0>n1I7y?F?v9 z?2gK1j%p`d>+m?;TC6f}y}#0Fo9lNv>$Etzm6guAI@k%+XmWUIDYw#kPry~{)Uq{~ zm)Tb43Yu+KjpO=$&qsW4Qx?iUTd@;6 zX>@mp64_?B9ojpD-JTb#=MhCu&m*4Ro=4p1J&zdn=`*w%hbPOiUBgeH1Yzn%*ud`g5e2NyBjSxk-Z* zwyQ;EMVOyj5=A{C%up?;qDEPKRb&Ir8Fz#JS4qLRW!@5tOpgJfi;*3cK3-F)zi z%#l;VVNhf3$zk(qea z^R}GZB3q2&=NT@K!yR)n60BI0kzgr35u@CNKj)>MkpxQ+0s_%S>la!;3_O1{&ph2TpUTP#AQGnJ$XF17*6N$ zk#Z4iaiz}gcl!KZx<2bwuIaV(wqDDk{1Gg7i0ko3sgl7PB7>2Ck}ShaNZdc+p%zPv z)UScGO8rsDWT}4$nId!(aZ{x}0drSRKkbQ)1ru_R#eJtd0QeObsPwHgz zc&Xn3*vdlcZh&IZ*0XK-#4K0Az;L-+;`N`a#G+Lbp=c zscjIfWOE2tnROQAP^ptYhe`c5$l+3d36k0X!TKc@Be}|w$(N&~ek$Z>saHadk^0q; zSyF!xGF$5JLXy7_lK+dvIIgl3D%W_a&xV{J^$Q?RmO8cdDN^4DIZ^6gKvFpnQhQ)Q z^+ZUWjKyhOWvLaAw2qK^F&0y}%2LUPQ>FeJ$kV0%KgctL-idsCrqqidbEHmw%auBn zZJN}nee=$woN`3Rvi z`Haeh(0L&iw4We!z6^^wTxFf9jwMq6Eu>xOU1(oBOX}qRQmIouWm5M+&XxKNkn^NY z``X!3{}__?C4{cD|CMujygl=D9QN>l(y(gqo>QuHRQYUV;)Gvpm_CV-Pexq_D zbSJ+paRnRPZ84pi3Rmsreo@C& z)`M(NKSSt2eWRYMtjBYZ%ccG~B@jfN8*5tq$tR$5hkTH%YLZZ_x{fIpRg)}gs#>PM;h5`0S`bkfDgC;@B=in z)B!ZQ*8?<~uK;MoqmhnAaT>i>0W@0ED1AAw7@$%5T;P0wM(GOy8U-7Hb-;RH18@=0 z8R!CZ1-b#<0SiFQlnS83@uT3LkZFJw=mewyy@1|8A7Cud7dQ^+2OJOd2TlNzfNWp@ zFa$UeI0+aC3cE>d%!)wPGA#2J|$nC43Iymf08fA57b6MKV1U-R^VpfCSWV@KJXjh zZ@`Vf4Z!8V1mH5@Qs5onYk=B}+LPMvZQw27P2ktS8^G(pAApa5*8uAKzXGV;UjbeP zUItzQUIg|5F96R2dx1T`bHKB}Gr-fpQ^1qJ6TohO`pN;|kHA;Jm%tamUxCkozW{#* zJ_Ei59tYk9{ttKn_$6>Z@EGtY@Cc9w^Z*_P9s(W&b^#lKi-C)P4Zu2JJ%dc%VOU0uXF(t+pKu4zHDsY6LJ67zK<5#sFDBHb8AY4j2zi08R#|A5r^|pU7wAJMtm?K>O0hjs4r2UqP|6a zjQSe&1?m&jH!1+?kBfmypbBsTOMq&i25O8#sd?8Q-F!UB;Yh)3NRHo12_}N0j2?Yz)YY3m<<#GbAS@S4wM3Az&zk=U_NjT zumCt0SO}a4ECMQk#XuF{1ge1=zy&M?mI1YZ2k-(u-~zx8)Byot1<(Mj1Xcm7fi=Kd zpb=OHYyd6>HUgV~OM%OPD}XD3tAWkHwZInOdf*0ND{vEV3ve4i=S$mxJAfU)oxt6| zPT*ePKHz@f0iX%k1w05m1Uw8p0z3*l20RYz2A%+(1fBw(2A%<)1)c-;0DFPwffs;% zz>C1k=y25Uwk2T!yh30|pwTKJ=ULns8I(b#2BSKb#PA;S0YA^;XTR!LwL?-YNTE}$ z&_+n6<_d<;shT<#sVRBKZANYs-b&f>^Dk5K`fL~Lrks>Knp#A_ne{+QTUY*Q?gM=Z zlvzzx9rhZ^8U>)Sk>(_9p7vLHE{^r2VThyogyy53WaBo^yMpMxRHkHKh_jD9Z4iCeJTj@rN@G-Kniz1ygRq|j(${q~JzLg!66 zihL~B>41Usu}}a0dQ4eoyrIM!N=Ng+81%&Oev$q3@3*{v=+IL;I+`<#`brOk4Nt}} z&;4TNOFmsS>nSN><_PUZ%~JKRELv0-aQNwD;AjOCW(ILO$xFZ|EG&Xj7AuD&O`8Bu zqIH%-3mJR(c4!o8;XtJuYD~{!s^+Jzz2pH)Z(amCofWOsSKeAbj-MdYMA?bTiNgsT zej@aj@&tbHL8qZ&y8$x(L}_;*Ke1-aCQF$iWu}ZDBya5xmiY~lcE(9LlvvaWRr=&ZCRu*5WmX=4F;UsHtgvKWxjIs$ljVls z^C@93F|x^yEHB=&0>@TZ>+|{pHss8vIgl$}c|`6$Ry^M(pEN-Vp88^7;6)%-PEX~i zx5Dd1>Q(WeAjrXIo0`1|((D;q{-liht;FyrW}814+wA#QW!vDxapA8BhCOM@SCt1! zn?0f!_9P+|J@|k$>CGNJqlgyIjHxP1D!p&TrF^jpdgu+RX3x(}4r>>iXgX@=MY(SG zqUJ5FidvMBC`v4V&wCxB_)0 zi|J)$Wt9|fk#~jDpXaD^7CQqq-l{Bbgt$n&N}rF-byT12aMvRTY^CU6D>|{t>QPN4 z>$3XAbpb!#rkYXj;m?X;+m>-PtgJan7z*E%$2KRzTJwmYDaxl*RKM&3e?Y0OY6a9# z3b*ZZyMjz4s@8a_-Qllu`r*bhXJx(L6ORfeBCRYU=-7v4l;qvf;DJ!6IM^fp9 z!r1}zKwcq*NYSOvI{rpBIRKV;#x3J&BJlXuc%jx?tF%a|dKKHKSBY+~ud7kWs+Agb z3MZnU1yuda-fSK8X6tf`T35ie+^M+Njy+0oy=nzphf-+MlCpfK56|~vVv;NKJgx@# zlqYaqNx@tYqQRRY164`q)YmR{`c)BO46+o)sbR$~kK&fFMB;~%)l{CscYS&~l#0s- z2_$i|_>T)*G3Qm)sqTt2+e1_6gBKzZ|YWRSbOmJh+f z)|$TD57MBGpRcq zrBU}&8Edvm-By)K^dhIHS{3CDkEjWcpp6PWcvBx^rqfZ&8@<5k@F~Snt<*5p3T;TM za1s|Hk#9fK8JLT2Q>cf77Ev{KRyEkiye(pCTEwWgLurC0&~p@(Q*cP^SH^-F zsx?ZLyA(E8CDbq+Gx{(I%Ka8Sd0dOlP|`34ZKN7V(1}z{ z)O;<}Tlq$+T~+MG)ZHDP@v`E?5j}ajC*WVncfwFAb}bbb-K)5|Qhh?=sKO^LCXDBe zT;*Kib_B#I;qok5OnW2DDJta@*EJ~|#h=EJ5!rA@^K z+@7*22+i!p2zQKf-6K4~SnoI< zND)_2v16V`tm#-o;q=l)9?uv5!?{b4zWI8|N0=Y5iJ< zGeD1OY+LU1*MWa;v=r?7xch&F|ag8~cA*B-N7B>Z}5Lkw9rzCU~MRCC4-%&_S;_eeS_CxpfgU=hN zJeZ1h=Km^(Q^qt6Q%li34r&v+V~_%*0(2K44d@JX0lEU+0Giur@S;Z;RA|f&tAVlFF+D&tPA%>f zbj;ezS|97jbE25yXe?}aL6TNHjswCUIt*{+<_{h6RI;Y~Ea=PqLtZ`Crkn-6dVWr` zv!GXpj2-gGH;qXT!RAl#Ea*$_5wSSzBRf7JD6;~CXO!no_;Hz4JmMg%w_YOrD&&(!g=SUPiVMhMBUOAvzBhgx_1q0yc)6LDQ5+Gi1zeOq0upl-<4dEn?@oJY@6-EQhMYnr#- zQ-x3VN3M@@EJKH;7(eMn9l8!azi>`IA@Wv6tl@zU=7H#=Z3lBkhp%q1H_)gV9Bl_d z56<)Bpa70_vxra&*22d@{qp^JAK#LM7xSAxQ20NtISKzA(Z zE(L|V0J>X2;bA}=4~vgc(A^6P&jRw|1OJEy-OZrz2Y~KsQ1}}_cQ+{f0MK0y1QV5o z?sg!U=ng8~^*}I<#DeaAAeiU{fBwoM^y$#$k&Ov=OZi6!h~vcK1OUNA@5Bt?Dl=_> zJW=YKAy1O}?T`bdejlVw>Q6&vNd0ZdOsRhWNo{~&`UH!?TxF(%kVB;YBjiw_Cy`&} z$y^fI7%t;afgB->K~ftaSe9cko2$%1eFoQaC|It= zqL{19vK?}c)OSIaNc~AjyVPHYJWJ}ohb)!)Um?kl2o|c#T&^-}3MBPo1S|FNv$@Kw z!yxBNo$5t(K(JDs&fzMv5_f^rssB^kAXup`3%SayRG0Ilz8Ug-sow;-Na}Y&R!IGR zNb(Va^(ibCbCp@&gshbM$BeTmZq)vT}{Em=JZA*O! zA(?!(jH@h}@^?%90?1maQ(Zh#zaG*n^`Arfq}~Kc+aM%Ai-n)7EcrD^>Z1tB)W>Ka zLrA7RR?k(I{C7z59YXSdu~@-XmeLurLFxk_S4uq_a+TC`Ab%!x>N~5YPCi~Eb*kT5 zsgsQhrM?leQR+8Bu9G^o%X+C(f1~;%q&$bkMO%WOP$(|%7oB~_95z92%V@e@8BxyM16tU2B8!A z;1^tFopwUrCH38qcT4>hNJ>NKL~V2rS6L@2|GiTG3i3XwQybkc^t8T^zmz(a{{g8_ zglv*}0VMSggtW7tcrdwbZF!y(#q(kZ(zSGUVG*pAGqr)X#_fKdCQ+d{^qU zk5JwSU1)#(4OdwgY8UG32wkZElHU=!P@kecgwTcB=XYFXUC0N&mpbM1fz&^O{7~vt zmp@4TN60@4y=y1P15)n|N!uWF&A{SMTxDHHL6Tn(x}Ji?CtPJ+r$SOcKxtrOdtoy1@eG=pa3WYihyFE1h4~V0cF5k;A~(%P!22r&IJ|%=K<#f6@UY%1f0MU zpayUOOMzv88}I;Lzz19a_<=eg0Mr8wz)D~h@H1cyuok!wSO=^JE&?_JmjIUnmjRap zR{~c7n}KV9Ex>ia4Zw}SO~B2-tpI(X=yu=^;OD@dz%PKEz&*fy!2Q54fhJ%V@F4II z@G$TQ@F?&Y@Hns=cmjA5cnWwLcm{YDcn;VD>;;|&UI6w1F9I(CuMilGPDU_1V0ggr z06Z|{y+B1e_k;=hnjH1`Fyy@oIbXJ8S0(GHTMlt7av@}z$Ln#_I{uzS0}liA}+h5Y`AJBw={&|0qz0g(O$Sg9Es3ei`|B$ z<&cJ_zUXR+5eyH|$SEET!C|Tica!{;+59seY}{DGI~~^ps(wK)IGgE<5e)xE=-3`m z^$YrSCNq8YgW=x@9oqw{e$fd>8m7tkLZWeu(Xsmk)jrrSa_E67-Y*=L_+4duijh8Q zYV?qf+CxIb9JaN9ffA7`Ty+i58Q~K)VH}{?dxz)_97dEDxysIxuf^9c! z4$f_4=~HZM@D!vYE_D#%BIotc8)Pd|UWlf0%ZHO`%?KUV19u$ycEh?u2j?_0+v?P$ zyCyX<6Ml9w^}38hdkWHKeqI5`G@4k!qzsm`I@Np^@iuQjpSB)4wAsuov_2dUFcz<8 zwnnTE2cPRZhyzYlJ*aqNn^n$eI7fT*E|Lwi`MC6HW zRu5!$=oZwW9Cfg7;Q5;G+JJmFAWtek%EsT4+KT6hf_0+uP5A`*37<^m<$OVubJB&7 z@Yxj9D_GvyhyM5DrU6vGlmNzz$tdFh$f2l*Ew|B>PU8sTRu?dn1^VfTPsRTGZ`y{& z8scJnNhjNAgQ2kZOO?IR;2*&DWQWEM8mq|u8PH#Wo=(2PHo4GuZ@LvWV2A7?&N=(g zq1{uS#&`ywpnUbnr;FtGfH_`foG;*O?N#_#YE~u1b+Eusm*lVUEW$74EJB3eOP>qx z5MeQX6ABfj2k)L>rjO^?W?N_9bI>~bi(R7nn24MgZ^mBs>A=Y)e>?Qn=xj=76@$HO z;b<=_x6NG6CZ?ZLlAX=m+1=*A#(>?!2WDFeyv!ojPu!UMzI{{qrlAD|_UyE2!+bgZ z?$2*n-eO^F){SIlp9TDGW3yTMuBFTZ8{fl5D&qRjE6MIsu#_bi zG_YjK|3H5FKv?VyC~_X~WOy z#imDM(1&FBNA~bAU9uy~kLQCT(e%X~g~zKCT7G@CjLJHycRY`R|D!tNC?p;4yv%GSds|r7GxpaORemd368DU>S%pPg0a|QzVv9LOui~j(tv&y!_@2$0Y z-Bq?s@w1mj4o`KxquQBi^Eo_Dw{2v0*RF$HOKcg77I}REm)A2KKS@MCKIC#cM8`JG+A{HMjJUpS_v1&U8nS9KZOCthqt2EoVr)yWMJCxBmD%ng=4*ijPkXW2fDXaMn*ozst4xhmM)09Y{r-xw+jse?ZE@J{-xu` z(=P%T!SFx__JFY;=x%&7o&d&U7r`mCxU6ux?rjZXyYxU!AmE#voxRkt+>upR@5#dB zs@Xojx2nD}P?x>5YFYNUtZ~^@-paachtHMW4qagUwlzMl&D%9JF!0r5?-A%E{Ma8A zGOVEOuv5mYQtx4TCHd2b*@ork&dr6e7v{|!7IQ0ukZ=#AtDj(`Pvs&6=hs$eb`1R7 z_&ECguV7Us(+Ht@l`8HEw%Rkt$cDyiM8`-&9Iav)uhIp7fcR*&fRXRf_CON-&bif* zBRf?z0$%mRl>-ZLm5D8rV6kl9UVD%GX%9!yI;>Mq>k)*8lc=G>~ZH_iC zc)a6$n-@628OA+_B)B|nZZ0@2iyx9o$uWLNs?D3=Sk90x38;TaDl02H^jlKLa>0$V z9Z?Uc`UU;)oEiOs|CZDd&D1b{%zHr9FYuXB-Y@uXNgeYAHwt(}J)r6r$>Iltj31IZ zq7MIw7!US~9OH+iej+W_HpNu+3o}bIemJFVyl&)jta>2A52wszuq#>)3VMi0iFVB=13^d4fQ z#_ItS?V-X*tbIA&tc>jq4;<4Tz*W?==?%`x`ha7x+u5q3s^+^KVIX*Or&Z>fZA9l| z6uO7X*t)OA8}q6$uZphJVV52KnF~{Hhi!UZapPF0W4C{Yt$imPMFbBdI;<1K50@H0 zc53|CX~*3K!fI~(*s1Yjr}%+ZEEFdDa-} zuqkgd`c?J*6qE7}vq2>8>H`@?kRwJnsVf5rPgEB1UXN&YIWgjw9F?p{NdiCk)4TlQ zh%A<>bU`&Kv|*=N)4cVbD*QHIC{C>@4`|YpWU1m+aJqCezi>`ILCrOE!vh`G1HpZ( z!#cpIIQM{+S?72?vF<@xii_?3Bki#qnL(B>`dealr{8Ux>-B1}C|yrkvwU?m(RgJw zPIuIdqHT<{Mwy-!JsTEpK9mh^MVFM>ik<#y&8F;{YquB4BDGqSI#)&AwgRd2!?{sO zIuiBdQ(9J#7ZQtaP&J@cA@5eWW}i z#l^~}0vq}9A)!dy9!{K|eClf4ix0NiOZH2WyuRmaeb6S%0jFH9mq8Tl>Y#x)4 zeCFpJ@pHin6k9zX!RVYH+!B>Tg|yKM)l(Pw!Cb5Z98JG zW{fAss2HzL<)~57Xo<@wdW8~~PxNk(z8v8rr0NoNcuKL_cI@@%k+t&f@*L z=E(NzP(E5${Y0xJu0BV$A1L+lRYq;0cWgl zrH*MQx30Ejd@x4OaTU*J#j?21lY)6_$@09Cn8$C#nGxkkQBQsFOJMa{Wk^(f1q`Xr z`S|gh<#FGUIDXS}&S#$<&1+28HHf-Eeav&qMC3zlkcCDfd8C3}8qV@Y&mj^0jdEza zb7h}5W+O$fa@5ocnc8O8KjltD`;YaB*AE_v{fDa5cGp?U=~O`L?0;0dJNM5&C+2ly zTob7&kz;zKDKa{q`RKpK5MMq=wjU^db5|~Dxz{8%hL1Z@&QB?~c-x0;h zKcA=>C9ZvR9)rhQpDJhD9D_%_o2WVlZ)JUya|*rZVsYoA^IR$#uk(sAus_1u|8jbgW?t7O`& zSgex8OM`buTb&Q(5$l*W5%uBuRJo%*@10*%l$iRo)&0a6-{eYIePSFNC#-#9+#gL? zfAcP08m(_9ET1+z){p+;M!fHBG)iY>`JGXp0HMLnStoa)2oBaWzR_lFaSYBshxY_C zeLTlD+dBK6gVxz!>=H#bGpqCB&G?AwrvoRK{O!T!+%|JLo0xu1 zNp?1KXLp+e8v}L^ADC?^@G^^7KXGI3`}R%cn}!w?*t6574fEyryFb5SePgzX*i*I^ zzF+ty>)Ct@pJ~sA>a?-Fc9m9JeE)l?(U*kve*LpqwQlt2! zUlOZMO$TG$NM`m~!0$FTo2Bns$}F()J#3^RuK&D}>@EdMS#m)GOQ!q}5d&c|^~Y|3k6g)m56dgbpFYesEI)T{E`+@>Z|<-omz`lbP7mn1 z4xZGlxO5hMHN#cu2)MivcJ}69Mr*znX9qb#-{Dc1IE74uA0-ROdKBQ9>=!ErtQK5^K(lV#9a|%OpV)xhJp6rfm;94 z@#9Zv4>d9BV0fVQ9x(O;-M*u_(_C6oB7Ve5Zk9B&be>)6rj#;oy}y#b@^HnB!lLQe zB2CK9Qg)HDo0Q$9>>*`ODSJuTN6NlZ9w+7TQl22?iBg^<tdi0x zWwn$wQo5vED&;aMYo+u^>6OwaCz*3D2m@^^~C0J>cme zwtU{x%$V{#r}0EIGoH=V(TmzM#n=aoeV{$}Z#{KOVt7|dgs_M2tc=C`W&f0mZ?6-#qR)3lE@DEDoMms0%AL3jhq}22Wb!j_iY#JRQ8g;N@%Z)cGC<-gF(jEO{zE%P*Z>UxX-Z@vZ(Ng`l_kh~$;2}u_7@iGnr3O!(Fa0{tDh-~r#`mK+SXr&XQ`;*6Z;b{|ZI5p0 zt<~VE?UjPpsKHa)E5ph<9lUwqZP4JU^F159i!^xZeCK23Vhx_!-Z|i1qQO(!qbHCy z>EN9U-laNt3&Fcg2k$)aF4y3x>#+#DD|PTHz`II=ha?eTcrmoiI(YQ;(`z+&>hjUA z6mHSriA=G?2GtPPYw*0i(bo>|(BP@-LEnq|xdu;U ziX}E!0r3kBp4uM$y6;^YJhi=*Sh-sVZxwhub?{b$cdriK8u0GZ!CMR7{W^G!;60#& zw+_4}4W8P68^C)|2k&C=9@gL?Ndy?)2<;IKo;u%6;60|nlh$}YxD+doYw*l{^Sv6pXEb8;Ju{5Q`@@LU+duA z0p6P$Jas*GfcLfr4@n|mgFB(Uqrp?#yBoasGO@+q(}d zzt!NW?cERF?=*O7dkU?)${SP6Yl0PpEP*F7?#-JQHYNhe7a-e(#-B#D3xo`Uwd22XA8Y4HB4gZB)0Uuf_|rdY!8vk+fu@YMM}2i{j2 zJhi<&SovCmr?$5jyuaz-JrCYN9lRI7`$mI@BoR=6ebD}{!Bdy-MezQigZDCc|J2}# zOtFMvT|8w2Loqy%NDuJoBI&Di>!73|uMQbITV<3c4)@z9UlLt|4j z(;810WX8QB6H6LozG+|I%xU|QGN(NaJYpSW?p$joA)JUm_WI?1!cQ=P*OTk zZjqE*no%w`o6NnxWhJ(C7a|uCk|+dMLei4jJd9O>jNi^fV}u|G6+Glb2$XJ;+eJu5 z)MS<;bCI&KQLYE0gXvhekSS$7hck1;x~g!gq=$?okqeT{7He`!YNxc$UAlJbp5CKp zuikz79@p>q{wEAL@uY#ajLboUhYTGye8k96qsL@rj~zFD!pWyhJay7(lc!8Q{fskn z9E&UQ>q*r$uBFS|wH~kU0)Jhge))=qm8;HOc;5MoDzwvowtCIl3opCk%Bya;`SwdT zU3%H&P_N#6&9z&uyZ(k7x88K~Ew|pb?e^_={Cvlqzqsq}o%h^(-~GRQ_PJdTKJ@S- zk3RPJ?kApn>gi{meQwX*=U>?O;!7{T@~c-jU4F}(Z@%^RJOB6Yd%t;q|Nh_o{(}$y z@W%rm{psURF5P^|HCJDI-St~;yy@W9Tescz&wqXQ@BjSw`yYP%-yu^1T#!30FMs-s znFWQjW)~IDDY2hbS~hpy+4IZKSs+}Xoz7j*xNiN1i!R>y>1%&(d>!iNfBEdMUw!fA zMPK{ewD+@(&0X+7Q*#$Q(4=y~Yp=iY>t6?5@Y~<2T=3_=eEQkvfBoXiufG1|G2B!ahq%8|JC;6uG(|l)l)+;N>X&?Dxc;i!v5879S4rue)uNH8icJu zJLz=C5(gyB^3~wr={!@~^af{TeZaBUO_wMSKPb<9<36s~I{omCXlxNYVCx<#W9vSZ zj`2w&iw+ZQJk!=;nmS@dJNh$irrd~b=`fLf$^uokyiucUdGhyLjPEyhn6~E?<>!cd z4y;c~*)!zzg9nDZG4g7Ov(k}E%SkcNtqAeY|3Ijkeo?{N!xR9d*hzZwl{3|HKp$@Z%S=q5BxiGuN@T2 zK1+tlWV1ETF|Wp1xy)Hr=<(GD$^w3;qt=>XGG`>y2IrdwnZM|llF`MSQP2z9BC4@l zW)sfEES62kPkoMv{3hMAt7&Z0@O!r2v-zG)_cY$qklBQjHH)>za;hmprginTNl5L3 zOxAvql3_7tjP043Z0ecWgi|+*b+o9EHB_PQgDlBYg-6X9PE)u?t=qXrCxm5Hnm1wm z#w62lW(o7C^?=3tDtXj;Q037kds1dofhp6HoYKOfzP&X~HBA*w<(YdcP{d?@j%dqh zo?*Tt;F#g{*E#~z8!DYX`hYC_E+$qDjlaQ!_}EjW=ACRLQj>m0Y3*+vSgaK-cwbl zDnY2`xqiQ6WfW!--}}^kB}MLisYSf6Ol;nC=+ABks+&UXWg%DlW#{Z?&Zs~eZSKzZ zg48R}X8W)x?@hwruR?YB2Q zb1yDPSUS%YJ$aqED>GXQnP)k3xS6Yp*%q*(LN?9DsvIofV74X9>&G|8Ss+!Gz0;%= z+u(kp4U~Z+La)m(**xl&YF#&Rc^4IygnM7fc7aQtBf4gJS7!K}OP2Un_$o0Dns)#E zFLdr03TBo>D>NR8$jP|29E5c{hB#GPmsG}*Eg1LC$7zr+$)rvbTjTAazR(&i*iHtV zlbGfP?FS{&DBocKrQ>AEG#7UF$apIx1&p*D8GKDF=$YVPNQT1G)-%=z7zN}2^MD$F zTMv>A+0Hy*V)UF2v(Q}*)|j3=pq%bMvE%`@dq{SOU}9fTJ+0k%ZE2^&K5Ci;ISNR+ zknh)gofF#mqO+=gy2gg1Fdk7GDT5;O9Ja@z0c0@x1lTj}Dr9e20VQP)JTc|3GL> zpH?^eAUy>na=<+oxs~XRaz#r_pObGBX^kVS|H-|abnAZtC{yEb>$lm<`1-f~(@}a8 ze-}uQ@m^4)$^7G;Q>2$oI6KoW8D+wzsaGR$+bO z^6i4tm}!0O&YzKPeeD`5yUF^*i~Fs67Wibkjj>aBI;|&n+Pz=Bj#`?M(^uG$1c{}Y z|0*(3H3J+nEIIwkw@_ZxFBD*>9|18L0OwfW{Gq@pxMO`Qu<3L9r2Y5Fy7V&r>>1x)9Dc97e%vI}iI}4m{x7U{M zTwGtBlLKuiskQDQ+P4MXKX?W;uOg>EnGZ&)? z*1$`H(0Xe#$R{2hT}_Jhln{8hG8X%-P4K#cH(7_h?%>6IYZLZp#6Dfap1Qt0!HfCU zChYYBFGq*H-r(hG@Q@?|?9rKVo(>+}+sxPCsp~;=%XA&Q{@~5j;2}u_ly3mELLI!5 zz?-duHxRrc4W7ClHt=G;wTbd&fHy~ny-e_8zO@N^gTRaV)+Ts^!8=PMUnGeD-cV>U z-`WIkIC%3k?5X`S6199v{W1g>r zHy*s0Z*3yq3E)-euy-jr+TLm4Ez#gfYkb_Lo7L4C zJhi>4;JGw-YI~<+WvK>FZSPF*+!{Q!y&SB>d}|Ya$pz1&!(JYEG2hyRy?pR4(6Fbj zM*(>CI(UWP#e8cM`4)i}^Q}$riosi@kuQ=&0IvjE%(phdvxB!rhrP4FTdToS`=t!L zMhza4L_of{;u`y{P4LbJZ-a(Cb-we#yGVm4GQ|@1${{Y+;Hm8`0PhkFp4#5ISc&=8 zCh}bf-laP1od@1!I(WDW9{a6L^Z@U`PL?QOTdfy z)+Ts0;9aj#K6Sgfz>E3TChRQ*FXmgD;L-WgzO@M+ zoiW^|qkI>Dw@nAn4_?f-Hj!@~c-uAXAxQ-A0?_Wz;HlfK9=w=uZNgpyc)!qLZzXtl zY4DIF0_?4VcDD{5UAKw()+X$&0q%oip)+X}3 z2)qY1?5W#rBX}|2+JwDJz>E3TCU}>E7xS%6@Gb){=3ATKT@K!E9rd^pyeBnyND=|| zu7VcxtxfPYgZGRMd$>>-`>jpb+XCJm9rmsRZ?6VV-EKF4_ksowNg^QM8=>vf;HmB1 z1l~&;JZX*3zc*v$WeuL%-mT#MN(XNncroAFL_KZ??{y7(ND=|OJD~kq2k+!22*{&x}iKyChXDMm@(hl1n*(+4utYmvQjc91-wTfKGNVR8-Yh} zW5#@I6THX3`&fs)$HDtVgNGy$U~f0HKkMK<0p4G9@SX(kQw^TFzE6P{^Q}#k?`iNp z*I|#|#{8=e-m~Dvd}|Z=J_p{HI_&KMFXmgDu(ubyuXWga9=w=uZNlCQ;Kh7v6TE%k zeWQ^tl0*RSMQAbK+63<<@M6BT3EnH<{ZmK2x_F|L#?tUWf<0hm);V4eor^{bmf~VN zo%bBkkRz?*4a%tb*qwg2ZLZg=#iI1629$j2=$u(Il-1zQQ?!gUw-gDDGCeDLHZ0zJ zD4SwOWl5Q>*y*pB(pA z^zyk`i=%cGHqC*XlwOYwH!JCSL#qPM$LFT&N1DOz_xhavz)D*YUNXjO6tzAV9)1te zo27@Mn`ts1Z?ue>*@-6~RoR*qLaxN}f2?#egPX#dojy{Yk>Xr07?y~!RyS;?zS{J1`R3u{zlDt)_TE9ZdHCoLo;&o(SlBUD zV8O?9hd;(>3u2r>+4R<8#9qx9PmED9UZ2WQ^elj8 zNL)VAE0nl=qIZJ?<`Xre#O2dK_f9lJ!t!yp(f$+tkd?(-pLBSN_v@M?+pk0UM1T4( zarHT}{XnUYuQF;2#ao}oVEZ7SXf2eue2jA!_28jrUg!G{-6@U|Fzw{l)oK&;99Qvt zRxFGAJW0D0BBea9Bg+5f0^ckZ8mPR#4ZxF%9lBFFSd zS48xjBNZ1F#=ORmkbHDp%ScE*I<93TB%h;jEko|w2^STx$d6Up+qH}sGoktz+=fnJ z!`+;6m3Q^*KiqGJag8Cqe4pJVVELu=}zoGV8? zgT?h})it{K^3i{dA-;T$Y(G%^=B`}Qa<55j3?Fx*oS#x|@wN}y5cx#UC}H^=#F0J%iBQg%=qwBtMy!pg<>=NSvhJNj5f%V)^bm_SEta|QDqehWhq0ZFJYn^TacrEh_K9(S zG-3VCyO_QipcxXDPn#Xflb#doF5(w_ zj5;Ut_{--}ooTv9Sd8!en0_btSN$3hy?C_g{-N;CuG#?a#8d_uMxgvj4Tz_{po+KA z`>yGTr|)*C;zyqW{-oM~oAz#1{NfX_ZmSK{k)KuZyYp0T3;RbYCqdhel{Hb4~rl7Mkrob5X*(dkg2tJ zZ$=%9PuRVO_4{ib;XAqQYvOZ%?mGJy(8r7IE-FHE-6`T9pm%;Ji1^J1@s-hZ9^drL zwTMG~D9~&D$)Z2(8bo$Zp;%^`@Chh(VaM4IG4kB+*51f=u!uk7VZ@(GbbKNV-}^D! zMEsV!5HX2IvpXS^WxnrHf1~eBA=v(fg+=g()I*<4vG{Bn`UC4P;;%rN*%XRJd=3g# zB;u#hHwEcCQwW(?&_cxL)4Q$cXA~a6Nuc#A9^dr!bVQ(kPa?>8fk>>`Y% z{P&Ca%s)a0kHUd1@PA(szvxCp6!K`6`2eKwThs6NLzl;4nQtlayCzpapA8_`{)>ee zA9h`Q4|Mc13YmY$LW~c)Mx;TfevEMHd@NoS`7ZlE=yNC*pBEZ}g`3AWeg6mOB@~NS z$ze0)OToW~zP(`Q(X9Al_`jcs??KOtqn{y|OvoqsEfL@EdBl|Rcy`VjB#Loq*Uu== zG7-OU9`;jN&e@kCZmx*W{2!$3KP%pW4jzR;HY{X+xP^RqHh?g$KNhk)xBnA5)e~Xd zcr0YU-FXW1a*9Pf`AOz`ZYp%ND~0k4u-GQbe$pQ`vlwBLyRrRm2;=nDaa zudi3enWh)sL&SMJnyqL;|CIatE87rvzKH++w9q(X`Veu8c)aO<*nflL%xD_ZDnxt_ zjMc$$=Ajc2=iu>d-RRIbb7?2UEf)M5jAwG3*|m%OjQyWN7PYk)XPVxA0eTh1BK|5Y zWP4TJ3*AYvh~EjP7V&mzdY$&IB|MsCe+w!5$&~fbt9iWXMDzhU&g^=8AmVC7{Gbhp zm*b2bV-9oic;=veNA#XUd!W|gSHjpOw;RBW)F`yU9~GT&g^&waWqfD&Is&la-3;;h5Y6d@t%C-E617Y z7ZFGO6=C8CEaW(|@lVkG6w6Gvq5lTQne(ng4Ehs=v3;?Se%sa)dVpfFUr;}i@jJ4i z*HbL`G;hdp#!34W^;d*(Yq5~~(cM(96%>o%>6ci@ac22{pf^w~GmUu@OSjm+n$VZn zN{VKtJ12+6nRBUcuHx~m>^3CI{kq{w#L@Sg5LJiv363+~%4~{cApCN9I zi2tx(Xq@Rm{f)|vFpm16tnW#mL%)z>5r01xa-1n9JB@hl z-}c2m#i%bLoH_vu;h(1WF=jIKKMHg1z(S5QBf3Jrh+>)Pc#IEnoY~d24`OH=g!3I( z+{*oS{F_$j8!48VQn3%p@wvbK3dCF@;`jYV*{}QerESq)DNM@1Vm!CgKbgkJODPt^ z?xR=;`~4?nLMOk#{%hSr_Rpub!u~+<@BBApf6LzxLwO@ia$zCukKPBJ+6?>;U&rn) z_PerC;oh`E}_vx;kwD8>itHR!|qJ4_HwwBOv#%Wpk?0Ceyuod2W3 axBNI25!do)cIugsqP;BtsD-|T;{PAFaivfI literal 0 HcmV?d00001 diff --git a/mozilla/js/tamarin/platform/unix/DateUnix.cpp b/mozilla/js/tamarin/platform/unix/DateUnix.cpp new file mode 100644 index 00000000000..e34687b35c2 --- /dev/null +++ b/mozilla/js/tamarin/platform/unix/DateUnix.cpp @@ -0,0 +1,116 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include +#include + +#ifdef AVMPLUS_LINUX +#include +#endif + +#include "avmplus.h" + +namespace avmplus +{ + /* + * Unix implementation of platform-dependent date and time code + */ + +#define kMsecPerDay 86400000 +#define kMsecPerHour 3600000 +#define kMsecPerSecond 1000 +#define kMsecPerMinute 60000 + +#define DIVCLOCK ( CLOCKS_PER_SEC / 1000 ) + +#define kMicroPerSec 1000000.0 + + double OSDep::localTZA(double /*ti*/) + { + struct tm* t; + time_t current, localSec, globalSec; + + // The win32 implementation ignores the passed in time + // and uses current time instead, so to keep similar + // behaviour we will do the same + time( ¤t ); + + t = localtime( ¤t ); + localSec = mktime( t ); + + t = gmtime( ¤t ); + globalSec = mktime( t ); + + return double( localSec - globalSec ) * 1000.0; + } + + double OSDep::getDate() + { + struct timeval tv; + struct timezone tz; // Unused + + gettimeofday(&tv, &tz); + double v = (tv.tv_sec + (tv.tv_usec/kMicroPerSec)) * kMsecPerSecond; + double ip; + ::modf(v, &ip); // strip fractional part + return ip; + } + + //time is passed in as milliseconds from UTC. + double OSDep::daylightSavingTA(double newtime) // R41 + { + struct tm *broken_down_time; + + //convert time from milliseconds + newtime=newtime/kMsecPerSecond; + + long int longint_time=(long int) newtime; + + //pull out a struct tm + broken_down_time = localtime( (const time_t*) &longint_time ); + + if (!broken_down_time) + { + return 0; + } + + if (broken_down_time->tm_isdst > 0) + { + //daylight saving is definitely in effect. + //return # of milliseconds in one hour. + return kMsecPerHour; + } + + //either daylight saving is not in effect, or we don't know (if tm_isdst is negative). + return 0; + } +} diff --git a/mozilla/js/tamarin/platform/unix/Makefile b/mozilla/js/tamarin/platform/unix/Makefile new file mode 100644 index 00000000000..5682f71261a --- /dev/null +++ b/mozilla/js/tamarin/platform/unix/Makefile @@ -0,0 +1,144 @@ +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# The contents of this file are subject to the Mozilla Public License Version 1.1 (the +# "License"); you may not use this file except in compliance with the License. You may obtain +# a copy of the License at http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +# WARRANTY OF ANY KIND, either express or implied. See the License for the specific +# language governing rights and limitations under the License. +# +# The Original Code is [Open Source Virtual Machine.] +# +# The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +# by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights +# Reserved. +# +# Contributor(s): Adobe AS3 Team +# +# Alternatively, the contents of this file may be used under the terms of either the GNU +# General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +# License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +# LGPL are applicable instead of those above. If you wish to allow use of your version of this +# file only under the terms of either the GPL or the LGPL, and not to allow others to use your +# version of this file under the terms of the MPL, indicate your decision by deleting provisions +# above and replace them with the notice and other provisions required by the GPL or the +# LGPL. If you do not delete the provisions above, a recipient may use your version of this file +# under the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** */ + + +# DEBUG can be set to YES to include debugging info, or NO otherwise +DEBUG := YES +DEBUGGER := YES + +CC := gcc +CXX := g++ +AR := ar + +MMGC_ROOT := ../../MMgc +AVMPLUS_ROOT := ../.. +ZLIB_ROOT := ../../.. + +# avmplus and MMgc make files +include makecommon +include ../../MMgc/makecommon + +#**************************************************************************** +# Targets of the build +#**************************************************************************** + +AVMPLUS_OUTPUT := libavmplus.a +MMGC_OUTPUT := ${MMGC_ROOT}/libmmgc.a +SHELL_OUTPUT := avmplus + +all: ${MMGC_OUTPUT} ${SHELL_OUTPUT} ${AVMPLUS_OUTPUT} + +#**************************************************************************** +# Shell Source files +#**************************************************************************** + +SHELL_SRCS := ../../shell/TypedArrayClass.cpp \ + ../../shell/SystemClass.cpp \ + ../../shell/StringBuilderClass.cpp \ + ../../shell/FileInputStream.cpp \ + ../../shell/FileClass.cpp \ + ../../shell/DomainClass.cpp \ + ../../shell/DebugCLI.cpp \ + ../../shell/DataIO.cpp \ + ../../shell/ConsoleOutputStream.cpp \ + ../../shell/ByteArrayGlue.cpp \ + ../../shell/avmshell.cpp \ + ../../extensions/DictionaryGlue.cpp + +# Use this target to generate a list of source files +gensrclist : + `find ../../core -type f -name "*.cpp" -printf "\t%p \134\n" > src.lst` + `find ../../regexp -type f -name "*.cpp" -printf "\t%p \134\n" >> src.lst` + `find ../unix -type f -name "*.cpp" -printf "\t%p \134\n" >> src.lst` + +#**************************************************************************** +# Output +#**************************************************************************** + +AVMPLUS_OBJS := $(addsuffix .o,$(basename ${AVMPLUS_SRCS})) +MMGC_OBJS := $(addsuffix .o,$(basename ${MMGC_SRCS})) +SHELL_OBJS := $(addsuffix .o,$(basename ${SHELL_SRCS})) +ZLIB_OBJS := $(addsuffix .o,$(basename ${ZLIB_SRCS})) + +${MMGC_OUTPUT}: ${MMGC_OBJS} + ${AR} rcs $@ ${MMGC_OBJS} + @echo "MMgc lib Done" + +${AVMPLUS_OUTPUT}: ${AVMPLUS_OBJS} + ${AR} rcs $@ ${AVMPLUS_OBJS} + @echo "avmplus lib Done" + +${SHELL_OUTPUT}: ${SHELL_OBJS} ${ZLIB_OBJS} ${AVMPLUS_OUTPUT} + @echo "=== linking:" $@ "===" + @${CXX} -o $@ ${LDFLAGS} ${SHELL_OBJS} ${ZLIB_OBJS} ${AVMPLUS_LIBS} ${EXTRA_LIBS} + @echo "=== done:" $@ "===" + +#**************************************************************************** +# Dependencies +#**************************************************************************** + +ALL_SRCS := ${AVMPLUS_SRCS} ${SHELL_SRCS} ${MMGC_SRCS} ${ZLIB_SRCS} + +ALL_OBJS := ${AVMPLUS_OBJS} ${SHELL_OBJS} ${MMGC_OBJS} ${ZLIB_OBJS} + +# Create a lists of object and .d files to create - +# one for each source file in the directory +AVMPLUS_DEPS := ${patsubst %${strip .cpp},%.d,${ALL_SRCS}} + +# make any non-existent make files (using the g++ preprocessor) +${AVMPLUS_DEPS} : %.d : %.cpp + ${CXX} ${CPPFLAGS} ${AVMPLUS_INCS} -MM $< > $@ + +#**************************************************************************** +# Rules +#**************************************************************************** + + +clean: + -rm -f core* ${ALL_OBJS} ${DEPS} ${SHELL_OUTPUT} ${AVMPLUS_OUTPUT} ${MMGC_OUTPUT} log outputdebug.txt + -rm -Rf ../../**/*.s + +clean-gc: + -rm -f core* ${MMGC_OBJS} ${DEPS} ${MMGC_OUTPUT} ${AVMPLUS_OUTPUT} log outputdebug.txt + +clean-vm: + -rm -f core* ${AVMPLUS_OBJS} ${DEPS} ${SHELL_OUTPUT} ${AVMPLUS_OUTPUT} log outputdebug.txt + +clean-zlib: + -rm -f core* ${ZLIB_OBJS} ${DEPS} log outputdebug.txt + +install: + @cp -vf ${SHELL_OUTPUT} /home/mtilburg/bin/ + +#ifneq (${MAKECMDGOALS},clean) +#include ${DEPS} # include the generated make files, which make the object files +#endif + diff --git a/mozilla/js/tamarin/platform/unix/MathUtilsUnix.cpp b/mozilla/js/tamarin/platform/unix/MathUtilsUnix.cpp new file mode 100644 index 00000000000..332d70506f3 --- /dev/null +++ b/mozilla/js/tamarin/platform/unix/MathUtilsUnix.cpp @@ -0,0 +1,124 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#include + +#include "avmplus.h" + +namespace avmplus +{ + // todo need asm versions from Player + + double MathUtils::abs(double value) + { + return ::fabs(value); + } + + double MathUtils::acos(double value) + { + return ::acos(value); + } + + double MathUtils::asin(double value) + { + return ::asin(value); + } + + double MathUtils::atan(double value) + { + return ::atan(value); + } + + double MathUtils::atan2(double y, double x) + { + return ::atan2(y, x); + } + + double MathUtils::ceil(double value) + { + return ::ceil(value); + } + + double MathUtils::cos(double value) + { + return ::cos(value); + } + + double MathUtils::exp(double value) + { + return ::exp(value); + } + + double MathUtils::floor(double value) + { + return ::floor(value); + } + + uint64 MathUtils::frexp(double value, int *eptr) + { + double fracMantissa = ::frexp(value, eptr); + + // correct mantissa and eptr to get integer values + // for both + *eptr -= 53; // 52 mantissa bits + the hidden bit + return (uint64)(fracMantissa * (double)(1LL << 53)); + } + + double MathUtils::log(double value) + { + return ::log(value); + } + + double MathUtils::mod(double x, double y) + { + return ::fmod(x, y); + } + + double MathUtils::powInternal(double x, double y) + { + return ::pow(x, y); + } + + double MathUtils::sin(double value) + { + return ::sin(value); + } + + double MathUtils::sqrt(double value) + { + return ::sqrt(value); + } + + double MathUtils::tan(double value) + { + return ::tan(value); + } +} diff --git a/mozilla/js/tamarin/platform/unix/OSDepUnix.cpp b/mozilla/js/tamarin/platform/unix/OSDepUnix.cpp new file mode 100644 index 00000000000..26767517cda --- /dev/null +++ b/mozilla/js/tamarin/platform/unix/OSDepUnix.cpp @@ -0,0 +1,94 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#include +#include + +#include "avmplus.h" + +#ifdef DEBUGGER +#include +#include +#include +#endif + +namespace avmplus +{ + uint64 OSDep::currentTimeMillis() + { + struct timeval tv; + ::gettimeofday(&tv, NULL); + uint64 result = (tv.tv_sec * 1000) + (tv.tv_usec / 1000); + return result; + } + +#ifdef DEBUGGER + struct IntWriteTimerData + { + uint32 interval; // in microseconds + pthread_t thread; + int *addr; + }; + + void *timerThread(void *arg) + { + IntWriteTimerData *data = (IntWriteTimerData*)arg; + int *addr = data->addr; + uint32 interval = data->interval; + while(data->addr) + { + usleep(interval); + *addr = 1; + } + pthread_exit(NULL); + return NULL; + } + + intptr OSDep::startIntWriteTimer(uint32 millis, int *addr) + { + pthread_t p; + IntWriteTimerData *data = new IntWriteTimerData(); + data->interval = millis*1000; + data->addr = addr; + pthread_create(&p, NULL, timerThread, data); + data->thread = p; + return (intptr)data; + } + + void OSDep::stopTimer(intptr handle) + { + IntWriteTimerData *data = (IntWriteTimerData*) handle; + data->addr = NULL; + pthread_join(data->thread, NULL); + delete data; + } +#endif DEBUGGER +} diff --git a/mozilla/js/tamarin/platform/unix/makecommon b/mozilla/js/tamarin/platform/unix/makecommon new file mode 100644 index 00000000000..5c1f2f8a1ee --- /dev/null +++ b/mozilla/js/tamarin/platform/unix/makecommon @@ -0,0 +1,218 @@ +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# The contents of this file are subject to the Mozilla Public License Version 1.1 (the +# "License"); you may not use this file except in compliance with the License. You may obtain +# a copy of the License at http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +# WARRANTY OF ANY KIND, either express or implied. See the License for the specific +# language governing rights and limitations under the License. +# +# The Original Code is [Open Source Virtual Machine.] +# +# The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +# by the Initial Developer are Copyright (C)[ 2005 ] Adobe Systems Incorporated. All Rights +# Reserved. +# +# Contributor(s): Adobe AS3 Team +# +# Alternatively, the contents of this file may be used under the terms of either the GNU +# General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +# License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +# LGPL are applicable instead of those above. If you wish to allow use of your version of this +# file only under the terms of either the GPL or the LGPL, and not to allow others to use your +# version of this file under the terms of the MPL, indicate your decision by deleting provisions +# above and replace them with the notice and other provisions required by the GPL or the +# LGPL. If you do not delete the provisions above, a recipient may use your version of this file +# under the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** */ + + +AVMPLUS_DEBUG_CFLAGS := -g +AVMPLUS_RELEASE_CFLAGS := -O3 + +AVMPLUS_DEBUG_CXXFLAGS := ${AVMPLUS_DEBUG_CFLAGS} -DAVMPLUS_NOVIRTUAL -DAVMPLUS_SHELL -fno-exceptions -fno-rtti -Wno-invalid-offsetof -rdynamic +AVMPLUS_RELEASE_CXXFLAGS := ${AVMPLUS_RELEASE_CFLAGS} -DAVMPLUS_NOVIRTUAL -DAVMPLUS_SHELL -fno-exceptions -fno-rtti -Wno-invalid-offsetof + +ifeq (YES, ${DEBUG}) + AVMPLUS_CFLAGS := ${AVMPLUS_DEBUG_CFLAGS} -D_DEBUG -DDEBUG + AVMPLUS_CXXFLAGS := ${AVMPLUS_DEBUG_CXXFLAGS} -D_DEBUG -DDEBUG +else + AVMPLUS_CFLAGS := ${AVMPLUS_RELEASE_CFLAGS} + AVMPLUS_CXXFLAGS := ${AVMPLUS_RELEASE_CXXFLAGS} +endif + +#**************************************************************************** +# Include paths +#**************************************************************************** + +AVMPLUS_INCS := -I${AVMPLUS_ROOT}/core -I${AVMPLUS_ROOT}/pcre -I${AVMPLUS_ROOT}/MMgc -I${AVMPLUS_ROOT}/codegen -I${AVMPLUS_ROOT}/regexp -I${AVMPLUS_ROOT}/extensions -I${AVMPLUS_ROOT}/shell + +#**************************************************************************** +# Libraries +#**************************************************************************** + +AVMPLUS_LIBS := -L. -L${AVMPLUS_ROOT}/MMgc -lavmplus -lmmgc -lpthread + +#**************************************************************************** +# Source files +#**************************************************************************** + +ZLIB_SRCS := ${ZLIB_ROOT}/zlib/zutil.cpp \ + ${ZLIB_ROOT}/zlib/uncompr.cpp \ + ${ZLIB_ROOT}/zlib/trees.cpp \ + ${ZLIB_ROOT}/zlib/inftrees.cpp \ + ${ZLIB_ROOT}/zlib/inflate.cpp \ + ${ZLIB_ROOT}/zlib/inffas86.cpp \ + ${ZLIB_ROOT}/zlib/infback.cpp \ + ${ZLIB_ROOT}/zlib/deflate.cpp \ + ${ZLIB_ROOT}/zlib/crc32.cpp \ + ${ZLIB_ROOT}/zlib/compress.cpp \ + ${ZLIB_ROOT}/zlib/adler32.cpp + +AVMPLUS_SRCS := ${AVMPLUS_ROOT}/core/AbcEnv.cpp \ + ${AVMPLUS_ROOT}/core/AbcGen.cpp \ + ${AVMPLUS_ROOT}/core/AbcParser.cpp \ + ${AVMPLUS_ROOT}/core/AbstractFunction.cpp \ + ${AVMPLUS_ROOT}/core/Accessor.cpp \ + ${AVMPLUS_ROOT}/core/ActionBlockConstants.cpp \ + ${AVMPLUS_ROOT}/core/ArrayClass.cpp \ + ${AVMPLUS_ROOT}/core/ArrayObject.cpp \ + ${AVMPLUS_ROOT}/core/AtomArray.cpp \ + ${AVMPLUS_ROOT}/core/AtomConstants.cpp \ + ${AVMPLUS_ROOT}/core/AvmCore.cpp \ + ${AVMPLUS_ROOT}/core/AvmDebugUnix.cpp \ + ${AVMPLUS_ROOT}/core/avmplus.cpp \ + ${AVMPLUS_ROOT}/core/avmplusDebugger.cpp \ + ${AVMPLUS_ROOT}/core/avmplusHashtable.cpp \ + ${AVMPLUS_ROOT}/core/avmplusProfiler.cpp \ + ${AVMPLUS_ROOT}/core/BigInteger.cpp \ + ${AVMPLUS_ROOT}/core/BooleanClass.cpp \ + ${AVMPLUS_ROOT}/core/builtin.cpp \ + ${AVMPLUS_ROOT}/codegen/Ia32Assembler.cpp \ + ${AVMPLUS_ROOT}/codegen/CodegenMIR.cpp \ + ${AVMPLUS_ROOT}/core/BuiltinTraits.cpp \ + ${AVMPLUS_ROOT}/core/ClassClass.cpp \ + ${AVMPLUS_ROOT}/core/ClassClosure.cpp \ + ${AVMPLUS_ROOT}/core/Date.cpp \ + ${AVMPLUS_ROOT}/core/DateClass.cpp \ + ${AVMPLUS_ROOT}/core/DateObject.cpp \ + ${AVMPLUS_ROOT}/core/Domain.cpp \ + ${AVMPLUS_ROOT}/core/DomainEnv.cpp \ + ${AVMPLUS_ROOT}/core/DynamicProfiler.cpp \ + ${AVMPLUS_ROOT}/core/E4XNode.cpp \ + ${AVMPLUS_ROOT}/core/ErrorClass.cpp \ + ${AVMPLUS_ROOT}/core/ErrorConstants.cpp \ + ${AVMPLUS_ROOT}/core/Exception.cpp \ + ${AVMPLUS_ROOT}/core/FrameState.cpp \ + ${AVMPLUS_ROOT}/core/FunctionClass.cpp \ + ${AVMPLUS_ROOT}/core/GrowableBuffer.cpp \ + ${AVMPLUS_ROOT}/core/IntClass.cpp \ + ${AVMPLUS_ROOT}/core/Interpreter.cpp \ + ${AVMPLUS_ROOT}/core/MathClass.cpp \ + ${AVMPLUS_ROOT}/core/MathUtils.cpp \ + ${AVMPLUS_ROOT}/core/MethodClosure.cpp \ + ${AVMPLUS_ROOT}/core/MethodEnv.cpp \ + ${AVMPLUS_ROOT}/core/MethodInfo.cpp \ + ${AVMPLUS_ROOT}/core/Multiname.cpp \ + ${AVMPLUS_ROOT}/core/MultinameHashtable.cpp \ + ${AVMPLUS_ROOT}/core/Namespace.cpp \ + ${AVMPLUS_ROOT}/core/NamespaceClass.cpp \ + ${AVMPLUS_ROOT}/core/NamespaceSet.cpp \ + ${AVMPLUS_ROOT}/core/NativeFunction.cpp \ + ${AVMPLUS_ROOT}/core/NumberClass.cpp \ + ${AVMPLUS_ROOT}/core/ObjectClass.cpp \ + ${AVMPLUS_ROOT}/core/opcodes.cpp \ + ${AVMPLUS_ROOT}/core/PoolObject.cpp \ + ${AVMPLUS_ROOT}/core/PrintWriter.cpp \ + ${AVMPLUS_ROOT}/core/RegExpClass.cpp \ + ${AVMPLUS_ROOT}/core/RegExpObject.cpp \ + ${AVMPLUS_ROOT}/core/ScopeChain.cpp \ + ${AVMPLUS_ROOT}/core/ScriptBuffer.cpp \ + ${AVMPLUS_ROOT}/core/ScriptObject.cpp \ + ${AVMPLUS_ROOT}/core/StackTrace.cpp \ + ${AVMPLUS_ROOT}/core/StaticProfiler.cpp \ + ${AVMPLUS_ROOT}/core/StringBuffer.cpp \ + ${AVMPLUS_ROOT}/core/StringClass.cpp \ + ${AVMPLUS_ROOT}/core/StringObject.cpp \ + ${AVMPLUS_ROOT}/core/Toplevel.cpp \ + ${AVMPLUS_ROOT}/core/Traits.cpp \ + ${AVMPLUS_ROOT}/core/UnicodeUtils.cpp \ + ${AVMPLUS_ROOT}/core/Verifier.cpp \ + ${AVMPLUS_ROOT}/core/VTable.cpp \ + ${AVMPLUS_ROOT}/core/XMLClass.cpp \ + ${AVMPLUS_ROOT}/core/XMLListClass.cpp \ + ${AVMPLUS_ROOT}/core/XMLListObject.cpp \ + ${AVMPLUS_ROOT}/core/XMLObject.cpp \ + ${AVMPLUS_ROOT}/core/XMLParser16.cpp \ + ${AVMPLUS_ROOT}/pcre/pcre_chartables.cpp \ + ${AVMPLUS_ROOT}/pcre/pcre_compile.cpp \ + ${AVMPLUS_ROOT}/pcre/pcre_config.cpp \ + ${AVMPLUS_ROOT}/pcre/pcre_dfa_exec.cpp \ + ${AVMPLUS_ROOT}/pcre/pcre_exec.cpp \ + ${AVMPLUS_ROOT}/pcre/pcre_fullinfo.cpp \ + ${AVMPLUS_ROOT}/pcre/pcre_get.cpp \ + ${AVMPLUS_ROOT}/pcre/pcre_globals.cpp \ + ${AVMPLUS_ROOT}/pcre/pcre_info.cpp \ + ${AVMPLUS_ROOT}/pcre/pcre_maketables.cpp \ + ${AVMPLUS_ROOT}/pcre/pcre_ord2utf8.cpp \ + ${AVMPLUS_ROOT}/pcre/pcre_refcount.cpp \ + ${AVMPLUS_ROOT}/pcre/pcre_study.cpp \ + ${AVMPLUS_ROOT}/pcre/pcre_tables.cpp \ + ${AVMPLUS_ROOT}/pcre/pcre_try_flipped.cpp \ + ${AVMPLUS_ROOT}/pcre/pcre_valid_utf8.cpp \ + ${AVMPLUS_ROOT}/pcre/pcre_version.cpp \ + ${AVMPLUS_ROOT}/pcre/pcre_xclass.cpp \ + ${AVMPLUS_ROOT}/platform/unix/DateUnix.cpp \ + ${AVMPLUS_ROOT}/platform/unix/MathUtilsUnix.cpp \ + ${AVMPLUS_ROOT}/platform/unix/OSDepUnix.cpp + +#**************************************************************************** +# Preprocessor directives +#**************************************************************************** + +ifeq (YES, ${DEBUGGER}) +AVMPLUS_DEFS := -DUNIX -DCYGWIN -DAVMPLUS_IA32 -DDEBUGGER -DENABLE_COMPILER -DAVMPLUS_CDECL -DAVMPLUS_LINUX +else + AVMPLUS_DEFS := -DUNIX -DCYGWIN -DAVMPLUS_IA32 -DENABLE_COMPILER -DAVMPLUS_CDECL -DAVMPLUS_LINUX +endif + +AVMPLUS_CFLAGS := ${AVMPLUS_CFLAGS} ${AVMPLUS_DEFS} +AVMPLUS_CXXFLAGS := ${AVMPLUS_CXXFLAGS} ${AVMPLUS_DEFS} + +#******************************************************************************** +# Rules +#******************************************************************************** +define avmplus-cmd + @echo "=== compiling avmplus: ===" $@ ${OPT} ${AVMPLUS_CXXFLAGS} + @${CXX} -c ${OPT} ${AVMPLUS_CXXFLAGS} -Wa,-ahld=$(addsuffix .s, $(basename $<)) ${AVMPLUS_INCS} $< -o $@ +endef + +${AVMPLUS_ROOT}/core/%.o : ${AVMPLUS_ROOT}/core/%.cpp + $(avmplus-cmd) + +${AVMPLUS_ROOT}/extensions/%.o : ${AVMPLUS_ROOT}/extensions/%.cpp + $(avmplus-cmd) + +${AVMPLUS_ROOT}/shell/%.o : ${AVMPLUS_ROOT}/shell/%.cpp + $(avmplus-cmd) + +${AVMPLUS_ROOT}/codegen/%.o : ${AVMPLUS_ROOT}/codegen/%.cpp + $(avmplus-cmd) + +${AVMPLUS_ROOT}/platform/%.o : ${AVMPLUS_ROOT}/platform/%.cpp + $(avmplus-cmd) + +${AVMPLUS_ROOT}/platform/unix/%.o : ${AVMPLUS_ROOT}/platform/unix/%.cpp + $(avmplus-cmd) + +${AVMPLUS_ROOT}/pcre/%.o : ${AVMPLUS_ROOT}/pcre/%.cpp + $(avmplus-cmd) + +${AVMPLUS_ROOT}/utils/%.o : ${AVMPLUS_ROOT}/utils/%.cpp + $(avmplus-cmd) + + + diff --git a/mozilla/js/tamarin/platform/win32/DateWin.cpp b/mozilla/js/tamarin/platform/win32/DateWin.cpp new file mode 100644 index 00000000000..38ca8858eba --- /dev/null +++ b/mozilla/js/tamarin/platform/win32/DateWin.cpp @@ -0,0 +1,204 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmplus.h" + +namespace avmplus +{ + /* + * Windows implementation of platform-dependent date and time code + */ + int WeekDay(double t); + double MakeDate(double day, double time); + double MakeDay(double year, double month, double date); + double MakeTime(double hour, double min, double sec, double ms); + int YearFromTime(double t); + + static TIME_ZONE_INFORMATION gTimeZoneInfo; + static SYSTEMTIME gGmtCache; + + static double kMsecPerDay = 86400000; + static double kMsecPerHour = 3600000; + static double kMsecPerSecond = 1000; + static double kMsecPerMinute = 60000; + + static void UpdateTimeZoneInfo() + { + SYSTEMTIME gmt; + GetSystemTime(&gmt); + if ((gmt.wMinute != gGmtCache.wMinute) || + (gmt.wHour != gGmtCache.wHour) || + (gmt.wDay != gGmtCache.wDay) || + (gmt.wMonth != gGmtCache.wMonth) || + (gmt.wYear != gGmtCache.wYear) + ) + { + // Cache is invalid. + GetTimeZoneInformation(&gTimeZoneInfo); + gGmtCache = gmt; + } + } + + double OSDep::localTZA(double /*time*/) + { + UpdateTimeZoneInfo(); + return -gTimeZoneInfo.Bias * 60.0 * 1000.0; + } + + double ConvertWin32DST(int year, SYSTEMTIME *st) + { + // The StandardDate and DaylightDate members of + // TIMEZONE_INFORMATION may be specified in two ways: + // 1. An absolute time and date + // 2. A month, day of week and week in month, and a time of day + + if (st->wYear != 0) { + return MakeDate(MakeDay(year, + st->wMonth - 1, + st->wDay), + MakeTime(st->wHour, + st->wMinute, + st->wSecond, + st->wMilliseconds)); + } + + double timeValue = MakeDate(MakeDay(year, + st->wMonth-1, + 1), + MakeTime(st->wHour, + st->wMinute, + st->wSecond, + st->wMilliseconds)); + + double nextMonth; + if (st->wMonth < 12) { + nextMonth = MakeDate(MakeDay(year, st->wMonth, 1), 0); + } else { + nextMonth = MakeDate(MakeDay(year + 1, 0, 1), 0); + } + + int dayOfWeek = WeekDay(timeValue); + if (dayOfWeek != st->wDayOfWeek) { + int dayDelta = st->wDayOfWeek - dayOfWeek; + if (dayDelta < 0) { + dayDelta += 7; + } + timeValue += (double)kMsecPerDay * dayDelta; + } + + // Advance appropriate # of weeks + timeValue += (double)kMsecPerDay * 7.0 * (st->wDay - 1); + + // Cap it at the end of the month + while (timeValue >= nextMonth) { + timeValue -= (double)kMsecPerDay * 7.0; + } + + return timeValue; + } + + double OSDep::daylightSavingTA(double time) + { + // On Windows, ask the OS what the daylight saving time bias + // is. If it's zero, perform no adjustment. + UpdateTimeZoneInfo(); + if (gTimeZoneInfo.DaylightBias != -60 || gTimeZoneInfo.DaylightDate.wMonth == 0) { + return 0; + } + + // In most of the US, Daylight Saving Time begins on the + // first Sunday of April at 2 AM. It ends at 2 am on + // the last Sunday of October. + + // 1. Compute year this time represents. + int year = YearFromTime(time); + + // 2. Compute time that daylight saving time begins + double timeD = ConvertWin32DST(year, &gTimeZoneInfo.DaylightDate); + + // 3. Compute time that standard time begins + double timeS = ConvertWin32DST(year, &gTimeZoneInfo.StandardDate); + + // Subtract the daylight bias from the standard transition time + timeS -= kMsecPerHour; + + // The times we have calculated are in local time, + // but "time" was passed in as UTC. Convert it to local time. + time += OSDep::localTZA(time); + + // Does time fall in the daylight saving period? + + // Where Daylight savings time is earlier in the year than standard time + if(timeS > timeD) + { + if (time >= timeD && time < timeS) + return kMsecPerHour; + else + return 0; + } + // Where Daylight savings time is later in the year than standard time + else + { + if (time >= timeS && time < timeD) + return 0; + else + return kMsecPerHour; + } + + } + +#define FILETIME_EPOCH_BIAS ((LONGLONG)116444736000000000) +#define FILETIME_MS_FACTOR (10000.0) + + static double FlashFromFileTime(FILETIME* ft) + { + LARGE_INTEGER li; + li.LowPart = ft->dwLowDateTime; + li.HighPart = ft->dwHighDateTime; + + return ((double) (li.QuadPart - FILETIME_EPOCH_BIAS)) / FILETIME_MS_FACTOR; + } + + static double SystemTimeToFlashTime(SYSTEMTIME* st) + { + FILETIME ft; + SystemTimeToFileTime(st, &ft); + return FlashFromFileTime(&ft); + } + + double OSDep::getDate() + { + SYSTEMTIME stime; + GetSystemTime(&stime); + return SystemTimeToFlashTime(&stime); + } +} diff --git a/mozilla/js/tamarin/platform/win32/MathUtilsWin.cpp b/mozilla/js/tamarin/platform/win32/MathUtilsWin.cpp new file mode 100644 index 00000000000..4b01462c645 --- /dev/null +++ b/mozilla/js/tamarin/platform/win32/MathUtilsWin.cpp @@ -0,0 +1,376 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#include + +#include "avmplus.h" + +#define X86_MATH + +namespace avmplus +{ + double MathUtils::abs(double value) + { +#ifdef X86_MATH + _asm fld [value]; + _asm fabs; +#else + return ::fabs(value); +#endif /* X86_MATH */ + } + + double MathUtils::acos(double value) + { +#ifdef X86_MATH + return MathUtils::atan2(MathUtils::sqrt(1.0-value*value), value); +#else + return ::acos(value); +#endif /* X86_MATH */ + } + + double MathUtils::asin(double value) + { +#ifdef X86_MATH + return MathUtils::atan2(value, MathUtils::sqrt(1.0-value*value)); +#else + return ::asin(value); +#endif /* X86_MATH */ + } + + double MathUtils::atan(double value) + { +#ifdef X86_MATH + _asm fld [value]; + _asm fld1; + _asm fpatan; +#else + return ::atan(value); +#endif /* X86_MATH */ + } + + double MathUtils::atan2(double y, double x) + { +#ifdef X86_MATH + _asm fld [y]; + _asm fld [x]; + _asm fpatan; +#else + return ::atan2(y, x); +#endif /* X86_MATH */ + } + + double MathUtils::ceil(double value) + { +#ifdef X86_MATH + // todo avoid control word modification + short oldcw, newcw; + _asm fnstcw [oldcw]; + _asm mov ax, [oldcw]; + _asm and ax, 0xf3ff; // Set to round down. + _asm or ax, 0x800; + _asm mov [newcw], ax; + _asm fldcw [newcw]; + _asm fld [value]; + _asm frndint; + _asm fldcw [oldcw]; +#else + return ::ceil(value); +#endif /* X86_MATH */ + } + + double MathUtils::cos(double value) + { +#ifdef X86_MATH + _asm fld [value]; + _asm fcos; +#else + return ::cos(value); +#endif /* X86_MATH */ + } + +#ifdef X86_MATH + // Utility function, this module only. + static double expInternal(double x) + { + double value, exponent; + _asm fld [x]; + _asm fldl2e; + _asm _emit 0xD8; // fmul st(1); + _asm _emit 0xC9; + _asm _emit 0xDD; // fst st(1); + _asm _emit 0xD1; + _asm frndint; + _asm fxch; + _asm _emit 0xD8; // fsub st1; + _asm _emit 0xE1; + _asm f2xm1; + _asm fstp [value]; + _asm fstp [exponent]; + + value += 1.0; + + _asm fld [exponent]; + _asm fld [value]; + _asm fscale; + + _asm fxch; + _asm _emit 0xDD; // fstp st(0); + _asm _emit 0xD8; + } +#endif /* X86_MATH */ + + double MathUtils::exp(double value) + { +#ifdef X86_MATH + switch (isInfinite(value)) { + case 1: + return infinity(); + case -1: + return +0; + default: + return expInternal(value); + } +#else + return ::exp(value); +#endif /* X86_MATH */ + } + + double MathUtils::floor(double value) + { +#ifdef X86_MATH + // todo avoid control word modification + short oldcw, newcw; + _asm fnstcw [oldcw]; + _asm mov ax, [oldcw]; + _asm and ax, 0xf3ff; // Set to round down. + _asm or ax, 0x400; + _asm mov [newcw], ax; + _asm fldcw [newcw]; + _asm fld [value]; + _asm frndint; + _asm fldcw [oldcw]; +#else + return ::floor(value); +#endif /* X86_MATH */ + } + +#ifdef X86_MATH + /* @(#)s_frexp.c 5.1 93/09/24 */ + /* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + + /* + * for non-zero x + * x = frexp(arg,&exp); + * return a double fp quantity x such that 0.5 <= |x| <1.0 + * and the corresponding binary exponent "exp". That is + * arg = x*2^exp. + * If arg is inf, 0.0, or NaN, then frexp(arg,&exp) returns arg + * with *exp=0. + */ + + /* + * NOTE: This is little-endian, must be adjusted to work for + * big-endian systems. + */ +#define EXTRACT_WORDS(hx, lx, x) {DWORD *ptr = (DWORD*)&x; hx=ptr[1]; lx=ptr[0];} +#define SET_HIGH_WORD(x, hx) {DWORD *ptr = (DWORD*)&x; ptr[1]=hx;} +#define GET_HIGH_WORD(hx, x) {DWORD *ptr = (DWORD*)&x; hx=ptr[1];} + static const double two54 = 1.80143985094819840000e+16; /* 0x43500000, 0x00000000 */ + + static double ExtractFraction(double x, int *eptr) + { + DWORD hx, ix, lx; + EXTRACT_WORDS(hx,lx,x); + ix = 0x7fffffff&hx; + *eptr = 0; + if(ix>=0x7ff00000||((ix|lx)==0)) return x; /* 0,inf,nan */ + if (ix<0x00100000) { /* subnormal */ + x *= two54; + GET_HIGH_WORD(hx,x); + ix = hx&0x7fffffff; + *eptr = -54; + } + *eptr += (ix>>20)-1022; + hx = (hx&0x800fffff)|0x3fe00000; + SET_HIGH_WORD(x,hx); + return x; + } + + uint64 MathUtils::frexp(double x, int *eptr) + { + double fracMantissa = ExtractFraction(x, eptr); + // correct mantissa and eptr to get integer values + // for both + *eptr -= 53; // 52 mantissa bits + the hidden bit + return (uint64)((fracMantissa) * (double)(1LL << 53)); + } +#else + double MathUtils::frexp(double x, int *eptr) + { + return ::frexp(x, eptr); + } +#endif /* X86_MATH */ + + double MathUtils::log(double value) + { +#ifdef X86_MATH + _asm fld [value]; + _asm fldln2; + _asm fxch; + _asm fyl2x; +#else + return ::log(value); +#endif /* X86_MATH */ + } + +#ifdef X86_MATH + // utility function for mod + static double modInternal(double x, double y) + { + _asm fld [y]; + _asm fld [x]; + ModLoop: + _asm fprem; + _asm fnstsw ax; + _asm sahf; + _asm jp ModLoop; + _asm _emit 0xDD; // fstp st(1); + _asm _emit 0xD9; + } +#endif /* X86_MATH */ + + double MathUtils::mod(double x, double y) + { +#ifdef X86_MATH + if (!y) { + return nan(); + } + return modInternal(x, y); +#else + return ::fmod(x, y); +#endif /* X86_MATH */ + } + + // Std. library pow() + double MathUtils::powInternal(double x, double y) + { +#ifdef X86_MATH + double value, exponent; + + _asm fld1; + _asm fld [x]; + _asm fyl2x; + _asm fstp [value]; + + _asm fld [value]; + _asm fld [y]; + _asm _emit 0xD8; // fmul st(1); + _asm _emit 0xC9; + _asm _emit 0xDD; // fst st(1); + _asm _emit 0xD1; + _asm frndint; + _asm fxch; + _asm _emit 0xD8; // fsub st1; + _asm _emit 0xE1; + _asm f2xm1; + _asm fstp [value]; + _asm fstp [exponent]; + + value += 1.0; + + _asm fld [exponent]; + _asm fld [value]; + _asm fscale; + + _asm fxch; + _asm _emit 0xDD; // fstp st(0); + _asm _emit 0xD8; +#else + return ::pow(x, y); +#endif /* X86_MATH */ + } + + double MathUtils::sin(double value) + { +#ifdef X86_MATH + _asm fld [value]; + _asm fsin; +#else + return ::sin(value); +#endif /* X86_MATH */ + } + + double MathUtils::sqrt(double value) + { +#ifdef X86_MATH + _asm fld [value]; + _asm fsqrt; +#else + return ::sqrt(value); +#endif /* X86_MATH */ + } + + double MathUtils::tan(double value) + { +#ifdef X86_MATH + _asm fld [value]; + _asm fptan; + _asm _emit 0xDD; // fstp st(0); + _asm _emit 0xD8; +#else + return ::tan(value); +#endif /* X86_MATH */ + } + + int32 MathUtils::real2int(double value) + { + uint16 oldcw, newcw; + int32 intval; + _asm fnstcw [oldcw]; + _asm mov ax,[oldcw]; + _asm or ax,0xc3f; + _asm mov [newcw],ax; + _asm fldcw [newcw]; + _asm fld [value]; + _asm fistp [intval]; + _asm fldcw [oldcw]; + return intval; + } +} diff --git a/mozilla/js/tamarin/platform/win32/NativeFunctionWin.cpp b/mozilla/js/tamarin/platform/win32/NativeFunctionWin.cpp new file mode 100644 index 00000000000..b0df8c28d12 --- /dev/null +++ b/mozilla/js/tamarin/platform/win32/NativeFunctionWin.cpp @@ -0,0 +1,54 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 1993-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + + +#include "avmplus.h" + +namespace avmplus +{ + /** + * call a native method using windows thiscall calling conventions. + * we use the traits of the function to figure out what native types + * to convert to, as follows: + * + * AS type C++ type + * ------- -------- + * Void void + * Object Atom + * Boolean bool (unsigned 8bit) + * int int (signed 32bit) + * Number double (float 64bit) + * String Stringp (const String *) + * Class ClassClosure* + * MovieClip MovieClipObject* (similar for any other class) + */ +} diff --git a/mozilla/js/tamarin/platform/win32/OSDepWin.cpp b/mozilla/js/tamarin/platform/win32/OSDepWin.cpp new file mode 100644 index 00000000000..65ae5811b6e --- /dev/null +++ b/mozilla/js/tamarin/platform/win32/OSDepWin.cpp @@ -0,0 +1,64 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 1993-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include +#include +#include + +#include "avmplus.h" + +#pragma warning(disable:4201) // nonstandard extension used : nameless struct/union +#include // for timeGetTime (oddly, this include must come AFTER avmplus.h) + +namespace avmplus +{ + uint64 OSDep::currentTimeMillis() + { + return timeGetTime(); + } + + void CALLBACK intWriteTimerProc(UINT, UINT, DWORD_PTR dwUser, DWORD_PTR, DWORD_PTR) + { + int *i = (int*)dwUser; + *i = 1; + } + + intptr OSDep::startIntWriteTimer(uint32 millis, int *addr) + { + return (intptr) timeSetEvent(millis, millis, (LPTIMECALLBACK)intWriteTimerProc, (DWORD_PTR)addr, 1); + } + + void OSDep::stopTimer(intptr handle) + { + timeKillEvent((UINT)handle); + } +} diff --git a/mozilla/js/tamarin/platform/win32/avmplus.cpp b/mozilla/js/tamarin/platform/win32/avmplus.cpp new file mode 100644 index 00000000000..0808ee14ca9 --- /dev/null +++ b/mozilla/js/tamarin/platform/win32/avmplus.cpp @@ -0,0 +1,54 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +// +// This is the source file for the avmplus project's precompiled header. +// + +#include "avmplus.h" + +// The default precompiled header setting on project avmplus is +// to replace up to #include "avmplus.h" with avmplus.pch, the +// precompiled header. + +// avmplus.cpp has custom precompiled header settings to create +// avmplus.pch by precompiling this file up until the +// #include "avmplus.h". + +// #include "avmplus.h" should be the first non-comment line in +// any CPP in this project, as the default will be to substitute +// the contents of the pch for everything up to the include. + +// If a file cannot #include "avmplus.h", or cannot include it +// first, then it should disable the precompiled header for that file only +// (for instance, pcre.cpp). + diff --git a/mozilla/js/tamarin/platform/win32/avmplus.sln b/mozilla/js/tamarin/platform/win32/avmplus.sln new file mode 100644 index 00000000000..60d59190bd2 --- /dev/null +++ b/mozilla/js/tamarin/platform/win32/avmplus.sln @@ -0,0 +1,68 @@ +Microsoft Visual Studio Solution File, Format Version 8.00 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shell", "shell.vcproj", "{437E43D2-ED2D-406B-88DB-B5940F838AE9}" + ProjectSection(ProjectDependencies) = postProject + {B004A8CC-B3A9-4600-A1A9-EF1BBCF2434B} = {B004A8CC-B3A9-4600-A1A9-EF1BBCF2434B} + {437E43D2-ED2D-406B-88DB-B5940F838AE8} = {437E43D2-ED2D-406B-88DB-B5940F838AE8} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "avmplus", "avmplus.vcproj", "{437E43D2-ED2D-406B-88DB-B5940F838AE8}" + ProjectSection(ProjectDependencies) = postProject + {B004A8CC-B3A9-4600-A1A9-EF1BBCF2434B} = {B004A8CC-B3A9-4600-A1A9-EF1BBCF2434B} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MMgc", "..\..\MMgc\MMgc.vcproj", "{B004A8CC-B3A9-4600-A1A9-EF1BBCF2434B}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfiguration) = preSolution + Debug = Debug + Debug Debugger = Debug Debugger + Release = Release + Release Debugger = Release Debugger + VTune = VTune + VTune_Performance = VTune_Performance + EndGlobalSection + GlobalSection(ProjectConfiguration) = postSolution + {437E43D2-ED2D-406B-88DB-B5940F838AE8}.Debug.ActiveCfg = Debug|Win32 + {437E43D2-ED2D-406B-88DB-B5940F838AE8}.Debug.Build.0 = Debug|Win32 + {437E43D2-ED2D-406B-88DB-B5940F838AE8}.Debug Debugger.ActiveCfg = Debug Debugger|Win32 + {437E43D2-ED2D-406B-88DB-B5940F838AE8}.Debug Debugger.Build.0 = Debug Debugger|Win32 + {437E43D2-ED2D-406B-88DB-B5940F838AE8}.Release.ActiveCfg = Release|Win32 + {437E43D2-ED2D-406B-88DB-B5940F838AE8}.Release.Build.0 = Release|Win32 + {437E43D2-ED2D-406B-88DB-B5940F838AE8}.Release Debugger.ActiveCfg = Release Debugger|Win32 + {437E43D2-ED2D-406B-88DB-B5940F838AE8}.Release Debugger.Build.0 = Release Debugger|Win32 + {437E43D2-ED2D-406B-88DB-B5940F838AE8}.VTune.ActiveCfg = VTune|Win32 + {437E43D2-ED2D-406B-88DB-B5940F838AE8}.VTune.Build.0 = VTune|Win32 + {437E43D2-ED2D-406B-88DB-B5940F838AE8}.VTune_Performance.ActiveCfg = VTune|Win32 + {437E43D2-ED2D-406B-88DB-B5940F838AE8}.VTune_Performance.Build.0 = VTune|Win32 + {437E43D2-ED2D-406B-88DB-B5940F838AE9}.Debug.ActiveCfg = Debug|Win32 + {437E43D2-ED2D-406B-88DB-B5940F838AE9}.Debug.Build.0 = Debug|Win32 + {437E43D2-ED2D-406B-88DB-B5940F838AE9}.Debug Debugger.ActiveCfg = Debug Debugger|Win32 + {437E43D2-ED2D-406B-88DB-B5940F838AE9}.Debug Debugger.Build.0 = Debug Debugger|Win32 + {437E43D2-ED2D-406B-88DB-B5940F838AE9}.Release.ActiveCfg = Release|Win32 + {437E43D2-ED2D-406B-88DB-B5940F838AE9}.Release.Build.0 = Release|Win32 + {437E43D2-ED2D-406B-88DB-B5940F838AE9}.Release Debugger.ActiveCfg = Release Debugger|Win32 + {437E43D2-ED2D-406B-88DB-B5940F838AE9}.Release Debugger.Build.0 = Release Debugger|Win32 + {437E43D2-ED2D-406B-88DB-B5940F838AE9}.VTune.ActiveCfg = VTune|Win32 + {437E43D2-ED2D-406B-88DB-B5940F838AE9}.VTune.Build.0 = VTune|Win32 + {437E43D2-ED2D-406B-88DB-B5940F838AE9}.VTune_Performance.ActiveCfg = VTune|Win32 + {437E43D2-ED2D-406B-88DB-B5940F838AE9}.VTune_Performance.Build.0 = VTune|Win32 + {B004A8CC-B3A9-4600-A1A9-EF1BBCF2434B}.Debug.ActiveCfg = Debug|Win32 + {B004A8CC-B3A9-4600-A1A9-EF1BBCF2434B}.Debug.Build.0 = Debug|Win32 + {B004A8CC-B3A9-4600-A1A9-EF1BBCF2434B}.Debug Debugger.ActiveCfg = Debug Debugger|Win32 + {B004A8CC-B3A9-4600-A1A9-EF1BBCF2434B}.Debug Debugger.Build.0 = Debug Debugger|Win32 + {B004A8CC-B3A9-4600-A1A9-EF1BBCF2434B}.Release.ActiveCfg = Release|Win32 + {B004A8CC-B3A9-4600-A1A9-EF1BBCF2434B}.Release.Build.0 = Release|Win32 + {B004A8CC-B3A9-4600-A1A9-EF1BBCF2434B}.Release Debugger.ActiveCfg = Release Debugger|Win32 + {B004A8CC-B3A9-4600-A1A9-EF1BBCF2434B}.Release Debugger.Build.0 = Release Debugger|Win32 + {B004A8CC-B3A9-4600-A1A9-EF1BBCF2434B}.VTune.ActiveCfg = VTune|Win32 + {B004A8CC-B3A9-4600-A1A9-EF1BBCF2434B}.VTune.Build.0 = VTune|Win32 + {B004A8CC-B3A9-4600-A1A9-EF1BBCF2434B}.VTune_Performance.ActiveCfg = VTune|Win32 + {B004A8CC-B3A9-4600-A1A9-EF1BBCF2434B}.VTune_Performance.Build.0 = VTune|Win32 + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddIns) = postSolution + EndGlobalSection +EndGlobal diff --git a/mozilla/js/tamarin/platform/win32/avmplus.vcproj b/mozilla/js/tamarin/platform/win32/avmplus.vcproj new file mode 100644 index 00000000000..3a138f2ccc2 --- /dev/null +++ b/mozilla/js/tamarin/platform/win32/avmplus.vcproj @@ -0,0 +1,935 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mozilla/js/tamarin/platform/win32/avmplus_8.vcproj b/mozilla/js/tamarin/platform/win32/avmplus_8.vcproj new file mode 100644 index 00000000000..e51e5d7a99a --- /dev/null +++ b/mozilla/js/tamarin/platform/win32/avmplus_8.vcproj @@ -0,0 +1,1272 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mozilla/js/tamarin/platform/win32/coff.cpp b/mozilla/js/tamarin/platform/win32/coff.cpp new file mode 100644 index 00000000000..19cf85e3052 --- /dev/null +++ b/mozilla/js/tamarin/platform/win32/coff.cpp @@ -0,0 +1,215 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#include "avmplus.h" + +#include +#include +#include "coff.h" + +// ignore deprecated function warnings from msc +#pragma warning(disable:4996) + + // Implementation of basic coff file format library +namespace avmplus +{ +#if defined(AVMPLUS_IA32) && defined(DEBUGGER) + namespace compiler + { + Coff::Coff() + { + initHeader(); + } + + Coff::~Coff() + { + for(int i=0; is_name, "text ", 8); + section->s_paddr = startAddr; + section->s_vaddr = startAddr; + section->s_size = alignedSize; + section->s_scnptr = 0; + section->s_relptr = 0; + section->s_lnnoptr = 0; + section->s_nreloc = 0; + section->s_nlnno = 0; + section->s_flags = STYP_TEXT; + + char* c = (char*)(section+1); + write(c, ar, numBytes); + + // put out our empty alignment bytes + for(int i=numBytes; iname.table.zero = 0; + symbol->name.table.offset = 0; + symbol->value = value; + symbol->scnum = header.f_nscns; //header.f_nscns; + symbol->type = 4; // int + symbol->sclass = 2; // external + symbol->numaux = 0; // no auxillary entries + + // now copy the string onto the end of the record + char* c = (char*)(symbol+1); + c = write(c, (char*)&size, sizeof(int)); + write(c, s, size+1); + } + + char* Coff::write(char* dst, const char* src, int count) + { + for(int i=0; i + * + * + */ + void Coff::done() + { + FILE* f = fopen("avm.jit.o", "w"); + + // Fill in the starting point for each of the section's data segments + // which immeidately follow the section headers + int pos = sizeof(CoffHeader_t) + (header.f_nscns * sizeof(SectionHeader_t)); + for(int i=0; is_scnptr = pos; + pos += sections[i]->s_size; + } + + // now pos points to our symbol table so update our main header + header.f_symptr = pos; + + // point to after the symbol table. + pos += header.f_nsyms * sizeof(SymbolEntry_t); + + // then into the string table (1st element is size of table) + int strSize = pos; // note our starting point for the string table + pos += 4; + + // each symbol name lands in the sting table + for(unsigned int i=0; iname.table.offset = pos - strSize; // name's offset into string table + int* size = (int*)(symbols[i]+1); // the string is stored pascal style (i.e length leads content) + pos += *size; + pos += 1; // null terminator + } + + // now compute the string table size which include 4bytes of length + strSize = (pos - strSize); + + // now we're ready to write... + + // write the main header + int realPos = fwrite(&header, 1, sizeof(CoffHeader_t), f); + + // now write out all the headers of the sections + for(int i=0; is_relptr = pos; // ptr to end of file => no entries + sections[i]->s_lnnoptr = pos; // ptr to end of file => no entries + realPos += fwrite(sections[i], 1, sizeof(SectionHeader_t), f); + } + + // now the content of the sections + for(int i=0; is_size, f); + + // now the symbol table + for(unsigned int i=0; i + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mozilla/js/tamarin/platform/win32/win32cpuid.cpp b/mozilla/js/tamarin/platform/win32/win32cpuid.cpp new file mode 100644 index 00000000000..2b1b0e1347a --- /dev/null +++ b/mozilla/js/tamarin/platform/win32/win32cpuid.cpp @@ -0,0 +1,198 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 1993-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include +#include + +// disable warnings about "Inline asm assigning to FS:0 handler not registered as safe handler" +#pragma warning(disable:4733) + +// Code from Intel that crashes a Cyrix CPU +#define CPUID _asm _emit 0x0F _asm _emit 0xA2 + +#define CPUID_SSE2_FLAG 0x04000000 //; Is IA SSE2 bit (Bit 26 of EDX) in feature flags set +static BOOL gP4OsSupport = FALSE; + +EXCEPTION_DISPOSITION __cdecl MyExceptionHandlerSSE2(struct _EXCEPTION_RECORD *ExceptionRecord, + void * EstablisherFrame, + struct _CONTEXT *ContextRecord, + void * DispatcherContext) +{ + // Turn off the P4 OS support flag. + gP4OsSupport = FALSE; + + // The offending P4 instruction is 3 bytes long. Skip it and continue. + ContextRecord->Eip += 3; + return ExceptionContinueExecution; +} + +bool P4Available() +{ + long featureFlags = 0; + //arun + BOOL procType = 0; + +// disable warnings about unreferenced _asm labels. +#pragma warning(disable:4102) + + _asm { + push ecx + push ebx + +; i386 CPU check +; The AC bit, bit #18, is a new bit introduced in the EFLAGS +; register on the i486 DX CPU to generate alignment faults. +; This bit can not be set on the i386 CPU. +; +check_Intel386: + pushfd + pop eax ; get original EFLAGS + mov ecx,eax ; save original EFLAGS + xor eax,40000h ; flip AC bit in EFLAGS + push eax ; save for EFLAGS + popfd ; copy to EFLAGS + pushfd ; push EFLAGS + pop eax ; get new EFLAGS value + xor eax,ecx ; can't toggle AC bit, CPU=Intel386 + je end_get_cpuid ; CPU is i386, + +; i486 DX CPU / i487 SX MCP and i486 SX CPU checking +; +; Checking for ability to set/clear ID flag (Bit 21) in EFLAGS +; which indicates the presence of a processor +; with the ability to use the CPUID instruction. +; +check_Intel486: + pushfd ; push original EFLAGS + pop eax ; get original EFLAGS in eax + mov ecx,eax ; save original EFLAGS in ecx + xor eax,200000h ; flip ID bit in EFLAGS + push eax ; save for EFLAGS + popfd ; copy to EFLAGS + pushfd ; push EFLAGS + pop eax ; get new EFLAGS value + xor eax, ecx + je end_get_cpuid ; CPU=486 without CPUID instruction functionality + +; Execute CPUID instruction to determine vendor, family, +; model and stepping. The use of the CPUID instruction used +; in this program can be used for B0 and later steppings +; of the P5 processor. + +cpuid_data: + // At this point we know we can do our CPUID instruction + // We need some special code here to handle Cyrix buggy processors + + // Get our Vendors name out first + mov eax, 0 + CPUID + //arun + cmp ebx, 0x47656e75 + jz cyrix_version + cmp edx, 0x696e6549 + jz cyrix_version + cmp ecx, 0x6e74656c + jz cyrix_version + mov procType, 1 + jmp non_cyrix_version + +cyrix_version: + // EAX returns the highest value we can use as input into the + // CPUID instruction. If for some reason it returns 0, assume + // no MMX support. (Since we need to input 1 to query MMX) + cmp eax, 0 + jz end_get_cpuid + + cmp ebx, 0x69727943 // This is "iryC", "Cyri" in memory + jne non_cyrix_version + + // EAX now contains the stepping, model and family information + and eax, 0x0FF0 // isolate model and family info + cmp eax, 0x0520 // We're a 6x86, so there's no MMX + je end_get_cpuid + +non_cyrix_version: + // Non Cyrix version + mov eax, 1 // Our input flag for our CPUID instruction + CPUID + mov featureFlags, edx ; save feature flags + +end_get_cpuid: + pop ecx + pop ebx + } + + BOOL bOsSupport = FALSE; + BOOL bHwSupport = (featureFlags & CPUID_SSE2_FLAG); + + if(bHwSupport) { + // Execute a KNI instruction and use Structured Exception Handling + // to catch the exception if the OS does not support KNI. + + DWORD handler = (DWORD)MyExceptionHandlerSSE2; + + gP4OsSupport = TRUE; + + __asm { // Build EXCEPTION_REGISTRATION record: + push handler // Address of handler function + push FS:[0] // Address of previous handler + mov FS:[0],ESP // Install new EXECEPTION_REGISTRATION + } + + // If so, test a KNI instruction and make sure you don't get + // an exception (this tests OS support) + __asm{ + pushad; + //orpd xmm1,xmm1; //Below are the op codes for this instruction + //emits will compile w/ MSVC 5.0 compiler + //You can comment these out and uncomment the + //orpd when using the Intel Compiler + __emit 0x66 + __emit 0x0f + __emit 0x56 + __emit 0xc9 + popad; + } + + __asm { // Remove our EXECEPTION_REGISTRATION record + mov eax,[ESP] // Get pointer to previous record + mov FS:[0], EAX // Install previous record + add esp, 8 // Clean our EXECEPTION_REGISTRATION off stack + } + + bOsSupport = gP4OsSupport; + } + + return bHwSupport && bOsSupport && procType; + +} + diff --git a/mozilla/js/tamarin/platform/win32/win32setjmp.cpp b/mozilla/js/tamarin/platform/win32/win32setjmp.cpp new file mode 100644 index 00000000000..2fc26c0ccd7 --- /dev/null +++ b/mozilla/js/tamarin/platform/win32/win32setjmp.cpp @@ -0,0 +1,83 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#include "avmplus.h" +#include + + +extern "C" +{ + __declspec(naked) + int __cdecl _setjmp3(jmp_buf /*jmpbuf*/, int /*arg*/) + { + // warning: the order of the registers in jmpbuf is used in + // BufferGuard for in memory swf buffer protection. See + // GrowableBuffer.cpp + _asm + { + mov edx, [esp+4] + mov DWORD PTR [edx],ebp + mov DWORD PTR [edx+4],ebx + mov DWORD PTR [edx+8],edi + mov DWORD PTR [edx+12],esi + mov DWORD PTR [edx+16],esp + mov eax, DWORD PTR [esp] + mov DWORD PTR [edx+20],eax + mov DWORD PTR [edx+24],0xFFFFFFFF + mov DWORD PTR [edx+28],0xFFFFFFFF + mov DWORD PTR [edx+32],0x56433230 + mov DWORD PTR [edx+36],0 + sub eax,eax + ret + } + } + + // Disable the "ebp was modified" warning. + // We really do want to modify it. + #pragma warning ( disable : 4731 ) + + __declspec(noreturn) + void __cdecl longjmp(jmp_buf jmpbuf, int result) + { + _asm + { + mov edx,[jmpbuf] + mov eax,[result] + mov ebp,DWORD PTR [edx] + mov ebx,DWORD PTR [edx+4] + mov edi,DWORD PTR [edx+8] + mov esi,DWORD PTR [edx+12] + mov esp,DWORD PTR [edx+16] + add esp,4 + jmp DWORD PTR [edx+20] + } + } +} diff --git a/mozilla/js/tamarin/shell/ByteArray.as b/mozilla/js/tamarin/shell/ByteArray.as new file mode 100644 index 00000000000..50de4b46031 --- /dev/null +++ b/mozilla/js/tamarin/shell/ByteArray.as @@ -0,0 +1,562 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +package flash.utils +{ + +// +// ByteArray +// + + +/** + * The ByteArray class makes it possible to work with + * binary data in ActionScript in an efficient manner. + * + *

    Note: The ByteArray class are for advanced ActionScript developers who need to access + * data on the byte level.

    + * + *

    Its in-memory representation is a packed array of bytes, but an instance of the ByteArray + * class can be manipulated with the standard the ActionScript array access operators: + * [ and ].

    + * + *

    It also can be read/written to as an in-memory file, using + * methods similar to URLStream and Socket.

    + * + *

    In addition, zlib compression/decompression is supported, as + * well as AMF object serialization.

    + * + *

    Possible uses of the ByteArray class include the following: + * + *

      + * + *
    • Creating a custom protocol to connect to a server.
    • + * + *
    • Writing your own URLEncoder/URLDecoder.
    • + * + *
    • Writing your own AMF/Remoting packet.
    • + * + *
    • Optimizing the size of your data by using data types.
    • + * + *
    + *

    + * + * @playerversion Flash 8.0 + * @langversion 3.0 + * @helpid + * @refpath + * @keyword ByteArray + */ +public class ByteArray +{ + public native static function readFile(filename:String):ByteArray; + public native function writeFile(filename:String):void; + + /** + * Reads length bytes of data from the byte stream. + * The bytes are read into the ByteArray object specified + * by bytes, starting offset bytes into + * the ByteAray. + * + * @param bytes The ByteArray object to read + * data into. + * @param offset The offset into bytes at which data + * read should begin. Defaults to 0. + * @param length The number of bytes to read. The default value + * of 0 will cause all available data to be read. + * @throws EOFError There is not sufficient data available + * to read. + * @throws IOError An I/O error occurred on the byte stream, + * or the byte stream is not open. + * + * @playerversion Flash 8.0 + * @langversion 3.0 + * @helpid + * @refpath + * @keyword ByteArray, ByteArray.readBytes, readBytes + */ + public native function readBytes(bytes:ByteArray, + offset:uint=0, + length:uint=0):void; + + + /** + * Writes a sequence of length bytes from the + * specified byte array, bytes, + * starting offset(zero-based index) bytes + * into the array. + * + *

    offset and length are optional + * parameters. If length is omitted, the default + * length of 0 means to write the entire buffer starting at + * offset. + * + * If offset is also omitted, the entire buffer is + * written.

    If offset or length + * is out of range, they will be clamped to the beginning and end + * of the bytes array.

    + * + * @playerversion Flash 8.0 + * @langversion 3.0 + * @helpid + * @refpath + * @keyword ByteArray, ByteArray.writeBytes, writeBytes + */ + public native function writeBytes(bytes:ByteArray, + offset:uint=0, + length:uint=0):void; + + /** + * Writes a boolean to the byte stream. A single byte is written, + * either 1 for true or 0 for false. + * + * @playerversion Flash 8.0 + * @langversion 3.0 + * @helpid + * @refpath + * @keyword ByteArray, ByteArray.writeBoolean, writeBoolean + */ + public native function writeBoolean(value:Boolean):void; + + /** + * Writes a byte to the byte stream. + *

    The low 8 bits of the + * parameter are used. The high 24 bits are ignored.

    + * + * @playerversion Flash 8.0 + * @langversion 3.0 + * @helpid + * @refpath + * @keyword ByteArray, ByteArray.writeByte, writeByte + */ + public native function writeByte(value:int):void; + + /** + * Writes a 16-bit integer to the byte stream. The bytes written + * are: + * + *
    (v >> 8) & 0xff v & 0xff
    + * + *

    The low 16 bits of the parameter are used. The high 16 bits + * are ignored.

    + * + * @playerversion Flash 8.0 + * @langversion 3.0 + * @helpid + * @refpath + * @keyword ByteArray, ByteArray.writeShort, writeShort + */ + public native function writeShort(value:int):void; + + /** + * Writes a 32-bit signed integer to the byte stream. + * + * @playerversion Flash 8.0 + * @langversion 3.0 + * @helpid + * @refpath + * @keyword ByteArray, ByteArray.writeInt, writeInt + */ + public native function writeInt(value:int):void; + + /** + * Writes a 32-bit unsigned integer to the byte stream. + * + * @playerversion Flash 8.0 + * @langversion 3.0 + * @helpid + * @refpath + * @keyword ByteArray, ByteArray.writeUnsignedInt, writeUnsignedInt + */ + public native function writeUnsignedInt(value:uint):void; + + /** + * Writes an IEEE 754 single-precision floating point number to the byte stream. + * + * @playerversion Flash 8.0 + * @langversion 3.0 + * @helpid + * @refpath + * @keyword ByteArray, ByteArray.writeFloat, writeFloat + */ + public native function writeFloat(value:Number):void; + + /** + * Writes an IEEE 754 double-precision floating point number to the byte stream. + * + * @playerversion Flash 8.0 + * @langversion 3.0 + * @helpid + * @refpath + * @keyword ByteArray, ByteArray.writeDouble, writeDouble + */ + public native function writeDouble(value:Number):void; + + /** + * Writes a 16-bit unsigned integer to the byte stream, specifying + * the length of the UTF-8 string that follows in bytes. Then, + * writes the UTF-8 string to the byte stream. + * + *

    First, the total number of bytes needed to represent all the + * characters of s is calculated.

    + * + * @throws RangeError If the length is larger than + * 65535. + * + * @playerversion Flash 8.0 + * @langversion 3.0 + * @helpid + * @refpath + * @keyword ByteArray, ByteArray.writeUTF, writeUTF + */ + public native function writeUTF(value:String):void; + + /** + * Writes a UTF-8 string to the byte stream. Similar to writeUTF, + * but does not prefix the string with a 16-bit length word. + * + * @playerversion Flash 8.0 + * @langversion 3.0 + * @helpid + * @refpath + * @keyword ByteArray, ByteArray.writeUTFBytes, writeUTFBytes + */ + public native function writeUTFBytes(value:String):void; + + /** + * Reads a boolean from the byte stream. A single byte is read, + * and true is returned if the byte is non-zero, + * false otherwise. + * + * @throws EOFError There is not sufficient data available + * to read. + * + * @playerversion Flash 8.0 + * @langversion 3.0 + * @helpid + * @refpath + * @keyword ByteArray, ByteArray.readBoolean, readBoolean + */ + public native function readBoolean():Boolean; + + /** + * Reads a signed byte from the byte stream. + *

    The returned value is in the range -128...127.

    + * @throws EOFError There is not sufficient data available + * to read. + * + * @playerversion Flash 8.0 + * @langversion 3.0 + * @helpid + * @refpath + * @keyword ByteArray, ByteArray.readByte, readByte + */ + public native function readByte():int; + + /** + * Reads an unsigned byte from the byte stream. + * + *

    The returned value is in the range 0...255.

    + * + * @throws EOFError There is not sufficient data available + * to read. + * + * @playerversion Flash 8.0 + * @langversion 3.0 + * @helpid + * @refpath + * @keyword ByteArray, ByteArray.readUnsignedByte, readUnsignedByte + */ + public native function readUnsignedByte():uint; + + /** + * Reads a signed 16-bit integer from the byte stream. + * + *

    The returned value is in the range -32768...32767.

    + * + * @throws EOFError There is not sufficient data available + * to read. + * + * @playerversion Flash 8.0 + * @langversion 3.0 + * @helpid + * @refpath + * @keyword ByteArray, ByteArray.readShort, readShort + */ + public native function readShort():int; + + + /** + * Reads an unsigned 16-bit integer from the byte stream. + * + *

    The returned value is in the range 0...65535.

    + * @throws EOFError There is not sufficient data available + * to read. + * + * @playerversion Flash 8.0 + * @langversion 3.0 + * @helpid + * @refpath + * @keyword ByteArray, ByteArray.readUnsignedShort, readUnsignedShort + */ + public native function readUnsignedShort():uint; + + /** + * Reads a signed 32-bit integer from the byte stream. + * + *

    The returned value is in the range -2147483648...2147483647.

    + * + * @throws EOFError There is not sufficient data available + * to read. + * + * @playerversion Flash 8.0 + * @langversion 3.0 + * @helpid + * @refpath + * @keyword ByteArray, ByteArray.readInt, readInt + */ + public native function readInt():int; + + /** + * Reads an unsigned 32-bit integer from the byte stream. + * + *

    The returned value is in the range 0...4294967295.

    + * + * @throws EOFError There is not sufficient data available + * to read. + * + * @playerversion Flash 8.0 + * @langversion 3.0 + * @helpid + * @refpath + * @keyword ByteArray, ByteArray.readUnsignedInt, readUnsignedInt + */ + public native function readUnsignedInt():uint; + + /** + * Reads an IEEE 754 single-precision floating point number from the byte stream. + * + * @throws EOFError There is not sufficient data available + * to read. + * + * @playerversion Flash 8.0 + * @langversion 3.0 + * @helpid + * @refpath + * @keyword ByteArray, ByteArray.readFloat, readFloat + */ + public native function readFloat():Number; + + /** + * Reads an IEEE 754 double-precision floating point number from the byte stream. + * + * @throws EOFError There is not sufficient data available + * to read. + * + * @playerversion Flash 8.0 + * @langversion 3.0 + * @helpid + * @refpath + * @keyword ByteArray, ByteArray.readDouble, readDouble + */ + public native function readDouble():Number; + + /** + * Reads a UTF-8 string from the byte stream. The string + * is assumed to be prefixed with an unsigned short indicating + * the length in bytes. + * + *

    This method is similar to the readUTF + * method in the Java DataInput interface.

    + * + * @throws EOFError There is not sufficient data available + * to read. + * + * @playerversion Flash 8.0 + * @langversion 3.0 + * @helpid + * @refpath + * @keyword ByteArray, ByteArray.readUTF, readUTF + */ + public native function readUTF():String; + + /** + * Reads a sequence of length UTF-8 + * bytes from the byte stream, and returns a string. + * + * @throws EOFError There is not sufficient data available + * to read. + * + * @playerversion Flash 8.0 + * @langversion 3.0 + * @helpid + * @refpath + * @keyword ByteArray, ByteArray.readUTFBytes, readUTFBytes + */ + public native function readUTFBytes(length:uint):String; + + /** + * The length of the ByteArray, in bytes. + * + *

    If the length is set to a larger value than the + * current length, the empty space is filled with zeros.

    + * + *

    If the length is set to a smaller value than the + * current length, the array is truncated.

    + * + * @playerversion Flash 8.0 + * @langversion 3.0 + * @helpid + * @refpath + * @keyword ByteArray, ByteArray.length, length + */ + public native function get length():uint; + public native function set length(value:uint):void; + + /** + * Compresses the byte array using zlib compression. + * The entire byte array is compressed. + * + * @see #uncompress + * + * @playerversion Flash 8.0 + * @langversion 3.0 + * @helpid + * @refpath + * @keyword ByteArray, ByteArray.compress, compress + */ + public native function compress():void; + + /** + * Uncompresses the byte array. The byte array + * must have been previously compressed with the + * compress method. + * + * @see #compress + * + * @playerversion Flash 8.0 + * @langversion 3.0 + * @helpid + * @refpath + * @keyword ByteArray, ByteArray.uncompress, uncompress + */ + public native function uncompress():void; + + + /** + * Converts the ByteArray to a String. + * + * @return The String representation of the ByteArray. + * + * @playerversion Flash 8.0 + * @langversion 3.0 + * @helpid + * @refpath + * @keyword ByteArray, ByteArray.toString, toString + */ + public native function toString():String; + + /** + * The number of bytes of data available for reading + * from the current position in the byte array to the + * end of the array. + * + *

    User code must access the bytesAvailable property to ensure + * that sufficient data is available before trying to read + * it with one of the read methods.

    + * + * @playerversion Flash 8.0 + * @langversion 3.0 + * @helpid + * @refpath + * @keyword available, bytes, position + */ + public native function get bytesAvailable():uint; + + /** + * Returns the current position, in bytes, of the file + * pointer into the ByteArray. This is the + * point at which the next call to a read + * method will start reading, or a write + * method will start writing. + * + * @playerversion Flash 8.0 + * @langversion 3.0 + * @helpid + * @refpath + * @keyword ByteArray, ByteArray.getFilePointer, + */ + public native function get position():uint; + + /** + * Moves the file pointer to offset bytes + * into the byte array. The next call to a read + * or write method will start operating + * at this point. + * + * @playerversion Flash 8.0 + * @langversion 3.0 + * @helpid + * @refpath + * @keyword ByteArray, ByteArray.seek, + */ + public native function set position(offset:uint):void; + + public native function get endian():String; + public native function set endian(type:String):void; +}; + + + +/* + * [ggrossman 04/07/05] API SCRUB + * + * - _ByteArray_ now implements the _DataInput_ and _DataOutput_ + * interfaces, as described in the Low Level Data specification. + * + * - Method _available()_ changed to accessor _bytesAvailable_ + * - Method _getFilePointer()_ changed to accessor _position_ + * - Method _seek()_ changed to accessor _position_ + * - Method _readUnsignedByte()_ now returns type _uint_ + * - Method _readUnsignedShort()_ now returns type _uint_ + * + * - Renamed _flash_transient_ namespace to _transient_ and + * put in _flash.net_ package + * + * - Moved _registerClass_ to the _flash.net_ package. + * + * - Moved the _ObjectEncoding_ class from _flash.util_ to the + * _flash.net_ package. + * + * - [srahim 04/05/05] Doc scrub + */ + +} diff --git a/mozilla/js/tamarin/shell/ByteArrayGlue.cpp b/mozilla/js/tamarin/shell/ByteArrayGlue.cpp new file mode 100644 index 00000000000..cccb9ca2aaf --- /dev/null +++ b/mozilla/js/tamarin/shell/ByteArrayGlue.cpp @@ -0,0 +1,696 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + + +#include "avmshell.h" +#include "genericzlib.h" + +namespace avmshell +{ + BEGIN_NATIVE_MAP(ByteArrayClass) + NATIVE_METHOD(flash_utils_ByteArray_toString, ByteArrayObject::_toString) + NATIVE_METHOD(flash_utils_ByteArray_length_get, ByteArrayObject::get_length) + NATIVE_METHOD(flash_utils_ByteArray_length_set, ByteArrayObject::set_length) + + NATIVE_METHOD(flash_utils_ByteArray_readBytes, ByteArrayObject::readBytes) + NATIVE_METHOD(flash_utils_ByteArray_writeBytes, ByteArrayObject::writeBytes) + + NATIVE_METHOD(flash_utils_ByteArray_writeBoolean, ByteArrayObject::writeBoolean) + NATIVE_METHOD(flash_utils_ByteArray_writeByte, ByteArrayObject::writeByte) + NATIVE_METHOD(flash_utils_ByteArray_writeShort, ByteArrayObject::writeShort) + NATIVE_METHOD(flash_utils_ByteArray_writeInt, ByteArrayObject::writeInt) + NATIVE_METHOD(flash_utils_ByteArray_writeUnsignedInt, ByteArrayObject::writeUnsignedInt) + NATIVE_METHOD(flash_utils_ByteArray_writeFloat, ByteArrayObject::writeFloat) + NATIVE_METHOD(flash_utils_ByteArray_writeDouble, ByteArrayObject::writeDouble) + NATIVE_METHOD(flash_utils_ByteArray_writeUTF, ByteArrayObject::writeUTF) + NATIVE_METHOD(flash_utils_ByteArray_writeUTFBytes, ByteArrayObject::writeUTFBytes) + + NATIVE_METHOD(flash_utils_ByteArray_readBoolean, ByteArrayObject::readBoolean) + NATIVE_METHOD(flash_utils_ByteArray_readByte, ByteArrayObject::readByte) + NATIVE_METHOD(flash_utils_ByteArray_readUnsignedByte, ByteArrayObject::readUnsignedByte) + NATIVE_METHOD(flash_utils_ByteArray_readShort, ByteArrayObject::readShort) + NATIVE_METHOD(flash_utils_ByteArray_readUnsignedShort, ByteArrayObject::readUnsignedShort) + NATIVE_METHOD(flash_utils_ByteArray_readInt, ByteArrayObject::readInt) + NATIVE_METHOD(flash_utils_ByteArray_readUnsignedInt, ByteArrayObject::readUnsignedInt) + NATIVE_METHOD(flash_utils_ByteArray_readFloat, ByteArrayObject::readFloat) + NATIVE_METHOD(flash_utils_ByteArray_readDouble, ByteArrayObject::readDouble) + NATIVE_METHOD(flash_utils_ByteArray_readUTF, ByteArrayObject::readUTF) + NATIVE_METHOD(flash_utils_ByteArray_readUTFBytes, ByteArrayObject::readUTFBytes) + + NATIVE_METHOD(flash_utils_ByteArray_bytesAvailable_get, ByteArrayObject::available) + NATIVE_METHOD(flash_utils_ByteArray_position_get, ByteArrayObject::getFilePointer) + NATIVE_METHOD(flash_utils_ByteArray_position_set, ByteArrayObject::seek) + NATIVE_METHOD(flash_utils_ByteArray_compress, ByteArrayObject::compress) + NATIVE_METHOD(flash_utils_ByteArray_uncompress, ByteArrayObject::uncompress) + NATIVE_METHOD(flash_utils_ByteArray_endian_get, ByteArrayObject::get_endian) + NATIVE_METHOD(flash_utils_ByteArray_endian_set, ByteArrayObject::set_endian) + NATIVE_METHOD(flash_utils_ByteArray_writeFile, ByteArrayObject::writeFile) + + NATIVE_METHOD(flash_utils_ByteArray_readFile, ByteArrayClass::readFile) + END_NATIVE_MAP() + + // + // ByteArray + // + + ByteArray::ByteArray() + { + m_capacity = 0; + m_length = 0; + m_array = NULL; + } + + ByteArray::ByteArray(const ByteArray &lhs) + { + m_array = new U8[lhs.m_length]; + if (!m_array) + { + ThrowMemoryError(); + return; + } + + m_capacity = lhs.m_length; + m_length = lhs.m_length; + + memcpy(m_array, lhs.m_array, m_length); + } + + ByteArray::~ByteArray() + { + if (m_array) + { + delete [] m_array; + m_array = NULL; + } + m_capacity = 0; + m_length = 0; + } + + void ByteArray::ThrowMemoryError() + { + // todo throw out of memory exception + // m_toplevel->memoryError->throwError(kOutOfMemoryError); + } + + bool ByteArray::Grow(uint32 minimumCapacity) + { + if (minimumCapacity > m_capacity) + { + uint32 newCapacity = m_capacity << 1; + if (newCapacity < minimumCapacity) + { + newCapacity = minimumCapacity; + } + if (newCapacity < kGrowthIncr) + { + newCapacity = kGrowthIncr; + } + U8 *newArray = new U8[newCapacity]; + if (!newArray) + { + return false; + } + if (m_array) + { + memcpy(newArray, m_array, m_length); + delete [] m_array; + } + memset(newArray+m_length, 0, newCapacity-m_capacity); + m_array = newArray; + m_capacity = newCapacity; + } + return true; + } + + U8 ByteArray::operator[] (uint32 index) const + { + if (m_length <= index) + { + return 0; + } + return m_array[index]; + } + + U8& ByteArray::operator[] (uint32 index) + { + if (m_length <= index) + { + Grow(index+1); + m_length = index+1; + } + return m_array[index]; + } + + void ByteArray::Push(U8 value) + { + if (m_length >= m_capacity) + { + Grow(m_length + 1); + } + m_array[m_length++] = value; + } + + void ByteArray::Push(const U8 *data, uint32 count) + { + Grow(m_length + count); + memcpy(m_array + m_length, data, count); + m_length += count; + } + + void ByteArray::SetLength(uint32 newLength) + { + if (newLength > m_capacity) + { + if (!Grow(newLength)) + { + ThrowMemoryError(); + return; + } + } + m_length = newLength; + } + + // + // ByteArrayFile + // + + ByteArrayFile::ByteArrayFile(Toplevel *toplevel) + : DataInput(toplevel), + DataOutput(toplevel) + { + m_filePointer = 0; + } + + uint32 ByteArrayFile::Available() + { + if (m_filePointer <= m_length) { + return m_length - m_filePointer; + } else { + return 0; + } + } + + void ByteArrayFile::SetLength(uint32 newLength) + { + ByteArray::SetLength(newLength); + if (m_filePointer > newLength) { + m_filePointer = newLength; + } + } + + void ByteArrayFile::Read(void *buffer, uint32 count) + { + CheckEOF(count); + + if (count > 0) + { + memcpy(buffer, m_array+m_filePointer, count); + m_filePointer += count; + } + } + + void ByteArrayFile::Write(const void *buffer, uint32 count) + { + if (m_filePointer+count >= m_length) { + Grow(m_filePointer+count); + m_length = m_filePointer+count; + } + memcpy(m_array+m_filePointer, buffer, count); + m_filePointer += count; + } + + // + // ByteArrayObject + // + + ByteArrayObject::ByteArrayObject(VTable *ivtable, + ScriptObject *delegate) + : ScriptObject(ivtable, delegate), + m_byteArray(toplevel()) + { + c.set(&m_byteArray, sizeof(ByteArrayFile)); + } + + Atom ByteArrayObject::getUintProperty(uint32 i) const + { + if (i < (uint32)m_byteArray.GetLength()) { + return core()->intToAtom(m_byteArray[i]); + } else { + return undefinedAtom; + } + } + + void ByteArrayObject::setUintProperty(uint32 i, Atom value) + { + m_byteArray[i] = core()->integer(value); + } + + Atom ByteArrayObject::getProperty(Atom name) const + { + AvmCore *core = this->core(); + uint32 index; + if (core->getIndexFromAtom(name, &index)) { + if (index < (uint32) m_byteArray.GetLength()) { + return core->intToAtom(m_byteArray[index]); + } else { + return undefinedAtom; + } + } + + return ScriptObject::getProperty(name); + } + + void ByteArrayObject::setProperty(Atom name, Atom value) + { + AvmCore *core = this->core(); + uint32 index; + if (core->getIndexFromAtom(name, &index)) { + int intValue = core->integer(value); + m_byteArray[index] = intValue; + } else { + ScriptObject::setProperty(name, value); + } + } + + bool ByteArrayObject::hasProperty(Atom name) const + { + return ScriptObject::hasProperty(name) || getProperty(name) != undefinedAtom; + } + + void ByteArrayObject::setLength(uint32 newLength) + { + m_byteArray.SetLength(newLength); + } + + uint32 ByteArrayObject::get_length() + { + return m_byteArray.GetLength(); + } + + void ByteArrayObject::set_length(uint32 value) + { + setLength(value); + } + + int ByteArrayObject::getFilePointer() + { + return m_byteArray.GetFilePointer(); + } + + int ByteArrayObject::available() + { + return m_byteArray.Available(); + } + + void ByteArrayObject::seek(int offset) + { + if (offset >= 0) { + m_byteArray.Seek(offset); + } + } + + String* ByteArrayObject::_toString() + { + unsigned char *c = (unsigned char*)m_byteArray.GetBuffer(); + uint32 len = m_byteArray.GetLength(); + + if (len >= 3) + { + // UTF8 BOM + if ((c[0] == 0xef) && (c[1] == 0xbb) && (c[2] == 0xbf)) + { + return core()->newString(((char *)c) + 3, len - 3); + } + else if ((c[0] == 0xfe) && (c[1] == 0xff)) + { + //UTF-16 big endian + c += 2; + len = (len - 2) >> 1; + Stringp out = new (core()->GetGC()) String(len); + wchar *buffer = out->lockBuffer(); + for (uint32 i = 0; i < len; i++) + { + buffer[i] = (c[0] << 8) + c[1]; + c += 2; + } + out->unlockBuffer(); + + return out; + } + else if ((c[0] == 0xff) && (c[1] == 0xfe)) + { + //UTF-16 little endian + c += 2; + len = (len - 2) >> 1; + Stringp out = new (core()->GetGC()) String(len); + wchar *buffer = out->lockBuffer(); + for (uint32 i = 0; i < len; i++) + { + buffer[i] = (c[1] << 8) + c[0]; + c += 2; + } + out->unlockBuffer(); + return out; + } + } + + return core()->newString(((char *)c), len); + } + + int ByteArrayObject::readByte() + { + return (signed char)m_byteArray.ReadU8(); + } + + int ByteArrayObject::readUnsignedByte() + { + return m_byteArray.ReadU8(); + } + + int ByteArrayObject::readShort() + { + return (short)m_byteArray.ReadU16(); + } + + int ByteArrayObject::readUnsignedShort() + { + return m_byteArray.ReadU16(); + } + + int ByteArrayObject::readInt() + { + return (int)m_byteArray.ReadU32(); + } + + uint32 ByteArrayObject::readUnsignedInt() + { + return m_byteArray.ReadU32(); + } + + double ByteArrayObject::readFloat() + { + return m_byteArray.ReadFloat(); + } + + double ByteArrayObject::readDouble() + { + return m_byteArray.ReadDouble(); + } + + bool ByteArrayObject::readBoolean() + { + return m_byteArray.ReadBoolean(); + } + + void ByteArrayObject::writeBoolean(bool value) + { + m_byteArray.WriteBoolean(value); + } + + void ByteArrayObject::writeByte(int value) + { + m_byteArray.WriteU8((U8)value); + } + + void ByteArrayObject::writeShort(int value) + { + m_byteArray.WriteU16((unsigned short)value); + } + + void ByteArrayObject::writeInt(int value) + { + m_byteArray.WriteU32((uint32)value); + } + + void ByteArrayObject::writeUnsignedInt(uint32 value) + { + m_byteArray.WriteU32(value); + } + + void ByteArrayObject::writeFloat(double value) + { + m_byteArray.WriteFloat((float)value); + } + + void ByteArrayObject::writeDouble(double value) + { + m_byteArray.WriteDouble(value); + } + + void ByteArrayObject::compress() + { + int len = m_byteArray.GetLength(); + if (!len) // empty buffer should give us a empty result + return; + unsigned long gzlen = len * 3/2 + 32; // enough for growth plus zlib headers + U8 *gzdata = new U8[gzlen]; + + // Use zlib to compress the data + compress2((U8*)gzdata, (unsigned long*)&gzlen, + m_byteArray.GetBuffer(), len, 9); + + // Replace the byte array with the compressed data + m_byteArray.SetLength(0); + //m_byteArray.WriteU32((U32)len); + m_byteArray.Write(gzdata, gzlen); + + delete [] gzdata; + } + + void ByteArrayObject::uncompress() + { + // Snapshot the compressed data. + unsigned long gzlen = m_byteArray.GetLength(); + if (!gzlen) // empty buffer should give us a empty result + return; + + U8 *gzdata = new U8[gzlen]; + memcpy(gzdata, m_byteArray.GetBuffer(), gzlen); + + // Clear the buffer + m_byteArray.Seek(0); + m_byteArray.SetLength(0); + + // The following block is to force destruction + // of zstream before potential exception throw. + int error = Z_OK; + { + // Decompress the data + PlatformZlibStream zstream; + zstream.SetNextIn(gzdata); + zstream.SetAvailIn(gzlen); + + const int kBufferSize = 8192; + U8 *buffer = new U8 [kBufferSize]; + + do { + zstream.SetNextOut(buffer); + zstream.SetAvailOut(kBufferSize); + error = zstream.InflateWithStatus(); + m_byteArray.Write(buffer, kBufferSize-zstream.AvailOut()); + } while (error == Z_OK); + + delete [] buffer; + delete [] gzdata; + } + + // position byte array at the beginning + m_byteArray.Seek(0); + + if (error != Z_OK && error != Z_STREAM_END) { + toplevel()->throwError(kShellCompressedDataError); + } + } + + void ByteArrayObject::checkNull(void *instance, const char *name) + { + if (instance == NULL) { + toplevel()->throwTypeError(kNullArgumentError, core()->toErrorString(name)); + } + } + void ByteArrayObject::writeBytes(ByteArrayObject *bytes, + uint32 offset, + uint32 length) + { + checkNull(bytes, "bytes"); + + if (length == 0) { + length = bytes->getLength() - offset; + } + + m_byteArray.WriteByteArray(bytes->GetByteArray(), + offset, + length); + } + + void ByteArrayObject::readBytes(ByteArrayObject *bytes, + uint32 offset, + uint32 length) + { + checkNull(bytes, "bytes"); + + if (length == 0) { + length = m_byteArray.Available(); + } + + m_byteArray.ReadByteArray(bytes->GetByteArray(), + offset, + length); + } + + String* ByteArrayObject::readUTF() + { + return m_byteArray.ReadUTF(); + } + + String* ByteArrayObject::readUTFBytes(uint32 length) + { + return m_byteArray.ReadUTFBytes(length); + } + + void ByteArrayObject::writeUTF(String *value) + { + checkNull(value, "value"); + m_byteArray.WriteUTF(value); + } + + void ByteArrayObject::writeUTFBytes(String *value) + { + checkNull(value, "value"); + m_byteArray.WriteUTFBytes(value); + } + + void ByteArrayObject::fill(const void *b, int len) + { + m_byteArray.Write(b, len); + } + + // + // ByteArrayClass + // + + ByteArrayClass::ByteArrayClass(VTable *vtable) + : ClassClosure(vtable) + { + prototype = toplevel()->objectClass->construct(); + } + + ScriptObject* ByteArrayClass::createInstance(VTable *ivtable, + ScriptObject *prototype) + { + return new (core()->GetGC(), ivtable->getExtraSize()) ByteArrayObject(ivtable, prototype); + } + + + ByteArrayObject * ByteArrayClass::readFile(Stringp filename) + { + Toplevel* toplevel = this->toplevel(); + if (!filename) { + toplevel->throwArgumentError(kNullArgumentError, "filename"); + } + UTF8String* filenameUTF8 = filename->toUTF8String(); + FILE *fp = fopen(filenameUTF8->c_str(), "rb"); + if (fp == NULL) { + toplevel->throwError(kFileOpenError, filename); + } + fseek(fp, 0L, SEEK_END); + long len = ftell(fp); + rewind(fp); + + unsigned char *c = new unsigned char[len+1]; + + Atom args[1] = {nullObjectAtom}; + ByteArrayObject *b = (ByteArrayObject*)AvmCore::atomToScriptObject(construct(0,args)); + b->setLength(0); + + while (len > 0) + { + int actual = fread(c, 1, len, fp); + if (actual > 0) + { + b->fill(c, actual); + len -= actual; + } + else + { + break; + } + } + b->seek(0); + + delete [] c; + return b; + } + + Stringp ByteArrayObject::get_endian() + { + return (m_byteArray.GetEndian() == kBigEndian) ? core()->constantString("bigEndian") : core()->constantString("littleEndian"); + } + + void ByteArrayObject::set_endian(Stringp type) + { + AvmCore* core = this->core(); + type = core->internString(type); + if (type == core->constantString("bigEndian")) + { + m_byteArray.SetEndian(kBigEndian); + } + else if (type == core->constantString("littleEndian")) + { + m_byteArray.SetEndian(kLittleEndian); + } + else + { + toplevel()->throwArgumentError(kInvalidArgumentError, "type"); + } + } + + void ByteArrayObject::writeFile(Stringp filename) + { + Toplevel* toplevel = this->toplevel(); + if (!filename) { + toplevel->throwArgumentError(kNullArgumentError, "filename"); + } + + UTF8String* filenameUTF8 = filename->toUTF8String(); + FILE *fp = fopen(filenameUTF8->c_str(), "wb"); + if (fp == NULL) { + toplevel->throwError(kFileWriteError, filename); + } + + fwrite(&(this->GetByteArray())[0], this->get_length(), 1, fp); + fclose(fp); + } + +} + + diff --git a/mozilla/js/tamarin/shell/ByteArrayGlue.h b/mozilla/js/tamarin/shell/ByteArrayGlue.h new file mode 100644 index 00000000000..9d705d1cb05 --- /dev/null +++ b/mozilla/js/tamarin/shell/ByteArrayGlue.h @@ -0,0 +1,168 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#ifndef BYTEARRAYGLUE_INCLUDED +#define BYTEARRAYGLUE_INCLUDED + +namespace avmshell +{ + class ByteArray + { + public: + ByteArray(); + ByteArray(const ByteArray &lhs); + ~ByteArray(); + + U8 operator [] (uint32 index) const; + U8& operator [] (uint32 index); + void Push(U8 value); + void Push(const U8 *buffer, uint32 count); + uint32 GetLength() const { return m_length; } + void SetLength(uint32 newLength); + bool Grow(uint32 newCapacity); + U8 *GetBuffer() const { return m_array; } + + protected: + void ThrowMemoryError(); + + uint32 m_capacity; + uint32 m_length; + U8 *m_array; + + enum { kGrowthIncr = 4096 }; + }; + + class ByteArrayFile : public ByteArray, public DataInput, public DataOutput + { + public: + ByteArrayFile(Toplevel *toplevel); + virtual ~ByteArrayFile() + { + m_filePointer = 0; + } + + uint32 GetFilePointer() { return m_filePointer; } + void Seek(uint32 filePointer) { m_filePointer = filePointer; } + void SetLength(uint32 newLength); + uint32 Available(); + void Read(void *buffer, uint32 count); + void Write(const void *buffer, uint32 count); + + private: + uint32 m_filePointer; + }; + + class ByteArrayObject : public ScriptObject + { + public: + ByteArrayObject(VTable *ivtable, ScriptObject *delegate); + + void fill(const void *b, int len); + + void checkNull(void *instance, const char *name); + + uint32 getLength() { return m_byteArray.GetLength(); } + void setLength(uint32 newLength); + + virtual bool hasProperty(Atom name) const; + virtual void setProperty(Atom name, Atom value); + virtual Atom getProperty(Atom name) const; + virtual Atom getUintProperty(uint32 i) const; + virtual void setUintProperty(uint32 i, Atom value); + + void readBytes(ByteArrayObject *bytes, uint32 offset, uint32 length); + void writeBytes(ByteArrayObject *bytes, uint32 offset, uint32 length); + + String* _toString(); + + void compress(); + void uncompress(); + + void writeBoolean(bool value); + void writeByte(int value); + void writeShort(int value); + void writeInt(int value); + void writeUnsignedInt(uint32 value); + void writeFloat(double value); + void writeDouble(double value); + void writeUTF(String *value); + void writeUTFBytes(String *value); + + bool readBoolean(); + int readByte(); + int readUnsignedByte(); + int readShort(); + int readUnsignedShort(); + int readInt(); + uint32 readUnsignedInt(); + double readFloat(); + double readDouble(); + String* readUTF(); + String* readUTFBytes(uint32 length); + + int available(); + int getFilePointer(); + void seek(int offset); + + uint32 get_length(); + void set_length(uint32 value); + + Stringp get_endian(); + void set_endian(Stringp type); + + ByteArray& GetByteArray() { return m_byteArray; } + + void writeFile(Stringp filename); + + private: + MMgc::Cleaner c; + ByteArrayFile m_byteArray; + }; + + // + // ByteArrayClass + // + + class ByteArrayClass : public ClassClosure + { + public: + ByteArrayClass(VTable *vtable); + + ScriptObject *createInstance(VTable *ivtable, ScriptObject *delegate); + + ByteArrayObject *readFile(Stringp filename); + + DECLARE_NATIVE_MAP(ByteArrayClass) + }; +} + +#endif /* BYTEARRAYGLUE_INCLUDED */ diff --git a/mozilla/js/tamarin/shell/ConsoleOutputStream.cpp b/mozilla/js/tamarin/shell/ConsoleOutputStream.cpp new file mode 100644 index 00000000000..08d0d5b3750 --- /dev/null +++ b/mozilla/js/tamarin/shell/ConsoleOutputStream.cpp @@ -0,0 +1,44 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmshell.h" + +namespace avmshell +{ + int ConsoleOutputStream::write(const void *buffer, + int count) + { + int result = (int) fwrite(buffer, 1, count, stdout); + fflush(stdout); + return result; + } +} diff --git a/mozilla/js/tamarin/shell/ConsoleOutputStream.h b/mozilla/js/tamarin/shell/ConsoleOutputStream.h new file mode 100644 index 00000000000..9b5a16d19cc --- /dev/null +++ b/mozilla/js/tamarin/shell/ConsoleOutputStream.h @@ -0,0 +1,53 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmshell_ConsoleOutputStream__ +#define __avmshell_ConsoleOutputStream__ + + +namespace avmshell +{ + /** + * ConsoleOutputStream is a subclass of OutputStream + * that writes output to the standard output. + * + * This is used for routing print() statements and + * exception messages to stdout in the AVM+ + * command-line shell. + */ + class ConsoleOutputStream : public OutputStream + { + public: + int write(const void *buffer, int count); + }; +} + +#endif /* __avmshell_ConsoleOutputStream__ */ diff --git a/mozilla/js/tamarin/shell/DataIO.cpp b/mozilla/js/tamarin/shell/DataIO.cpp new file mode 100644 index 00000000000..a8d7602d2c7 --- /dev/null +++ b/mozilla/js/tamarin/shell/DataIO.cpp @@ -0,0 +1,233 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmshell.h" + +namespace avmshell +{ + #define M_ERROR_CLASS(class_id) ((ErrorClass*)m_toplevel->getPlayerClass(avmplus::NativeID::abcclass_##class_id)) + + bool DataInput::ReadBoolean() + { + U8 value; + + Read(&value, 1); + return value != 0; + } + + U8 DataInput::ReadU8() + { + U8 value; + + Read(&value, 1); + return value; + } + + unsigned short DataInput::ReadU16() + { + unsigned short value; + + Read(&value, 2); + ConvertU16(value); + return value; + } + + uint32 DataInput::ReadU32() + { + uint32 value; + Read(&value, 4); + ConvertU32(value); + return value; + } + + float DataInput::ReadFloat() + { + union { + uint32 u; + float f; + }; + u = ReadU32(); + return f; + } + + double DataInput::ReadDouble() + { + double value; + Read(&value, 8); + ConvertU64((uint64&)value); + return value; + } + + String* DataInput::ReadUTFBytes(uint32 length) + { + CheckEOF(length); + + char *buffer = new char[length+1]; + if (!buffer) { + ThrowMemoryError(); + } + + Read(buffer, length); + buffer[length] = 0; + + String *out = m_toplevel->core()->newString(buffer); + delete [] buffer; + + return out; + } + + String* DataInput::ReadUTF() + { + return ReadUTFBytes(ReadU16()); + } + + void DataInput::ReadByteArray(ByteArray& buffer, + uint32 offset, + uint32 count) + { + uint32 available = Available(); + + if (count == 0) { + count = available; + } + + if (count > available) { + ThrowEOFError(); + } + + // Grow the buffer if necessary + if (offset + count >= buffer.GetLength()) { + buffer.SetLength(offset + count); + } + + Read(buffer.GetBuffer() + offset, count); + } + + void DataInput::CheckEOF(uint32 count) + { + if (Available() < count) { + ThrowEOFError(); + } + } + + void DataInput::ThrowEOFError() + { + m_toplevel->throwError(kEndOfFileError); + } + + void DataInput::ThrowMemoryError() + { + m_toplevel->throwError(kOutOfMemoryError); + } + + // + // DataOutput + // + + void DataOutput::ThrowRangeError() + { + m_toplevel->throwRangeError(kInvalidRangeError); + } + + void DataOutput::WriteBoolean(bool value) + { + WriteU8(value ? 1 : 0); + } + + void DataOutput::WriteU8(U8 value) + { + Write(&value, 1); + } + + void DataOutput::WriteU16(unsigned short value) + { + ConvertU16(value); + Write(&value, 2); + } + + void DataOutput::WriteU32(uint32 value) + { + ConvertU32(value); + Write(&value, 4); + } + + void DataOutput::WriteFloat(float value) + { + WriteU32(*((uint32*)&value)); + } + + void DataOutput::WriteDouble(double value) + { + ConvertU64((uint64&)value); + Write(&value, 8); + } + + void DataOutput::WriteUTF(String *str) + { + UTF8String* utf8 = str->toUTF8String(); + uint32 length = utf8->length(); + if (length > 65535) { + ThrowRangeError(); + } + WriteU16((unsigned short)length); + Write(utf8->c_str(), length*sizeof(char)); + } + + void DataOutput::WriteUTFBytes(String *str) + { + UTF8String* utf8 = str->toUTF8String(); + int len = utf8->length(); + Write(utf8->c_str(), len*sizeof(char)); + } + + void DataOutput::WriteByteArray(ByteArray& buffer, + uint32 offset, + uint32 count) + { + if (buffer.GetLength() < offset) + offset = buffer.GetLength(); + + if (count == 0) { + count = buffer.GetLength()-offset; + } + + if (count > buffer.GetLength()-offset) { + ThrowRangeError(); + } + + if (count > 0) { + Write(buffer.GetBuffer()+offset, count); + } + } +} + + diff --git a/mozilla/js/tamarin/shell/DataIO.h b/mozilla/js/tamarin/shell/DataIO.h new file mode 100644 index 00000000000..39867a688bb --- /dev/null +++ b/mozilla/js/tamarin/shell/DataIO.h @@ -0,0 +1,186 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#ifndef DATAIO_INCLUDED +#define DATAIO_INCLUDED + +namespace avmshell +{ + template + inline void CoreSwap(T& a, T& b) + { + T t = a; + a = b; + b = t; + } + + inline void FlipU16(uint16& value) + { + uint8 *pa = (uint8 *)&(value); + CoreSwap(pa[0], pa[1]); + } + + inline void FlipU64(uint64& value) + { + uint8 *pa = (uint8 *)&(value); + CoreSwap(pa[0], pa[7]); + CoreSwap(pa[1], pa[6]); + CoreSwap(pa[2], pa[5]); + CoreSwap(pa[3], pa[4]); + } + + inline void FlipU32(uint32& value) + { + uint8 *pa = (uint8 *)&(value); + CoreSwap(pa[0], pa[3]); + CoreSwap(pa[1], pa[2]); + } + + enum ObjectEncoding { + kAMF0 = 0, + kAMF3 = 3, + kEncodeDefault = kAMF3 + }; + + enum Endian + { + kBigEndian = 0, + kLittleEndian = 1 + }; + + class DataIOBase + { + public: + DataIOBase() { m_endian = kBigEndian; } + + virtual ~DataIOBase() + { + m_endian = kBigEndian; + } + + + Endian GetEndian() const { return m_endian; } + void SetEndian(Endian endian) { m_endian = endian; } + + void ConvertU16(uint16& value) + { + if (GetEndian() != GetNativeEndian()) + { + FlipU16(value); + } + } + + void ConvertU32(uint32& value) + { + if (GetEndian() != GetNativeEndian()) + { + FlipU32(value); + } + } + + void ConvertU64(uint64& value) + { + if (GetEndian() != GetNativeEndian()) + { + FlipU64(value); + } + } + + Endian GetNativeEndian() const + { + #ifdef WIN32 + return kLittleEndian; + #else + return kBigEndian; + #endif + } + + private: + Endian m_endian; + }; + + typedef unsigned char U8; + + class DataInput : virtual public DataIOBase + { + public: + DataInput(Toplevel *toplevel) : m_toplevel(toplevel) {} + + virtual uint32 Available() = 0; + virtual void Read(void *buffer, uint32 count) = 0; + + bool ReadBoolean(); + U8 ReadU8(); + unsigned short ReadU16(); + uint32 ReadU32(); + float ReadFloat(); + double ReadDouble(); + String* ReadUTF(); + String* ReadUTFBytes(uint32 length); + void ReadByteArray(ByteArray& buffer, uint32 offset, uint32 count); + + protected: + // FIXME: make const + DRC(Toplevel *) m_toplevel; + + void ThrowEOFError(); + void ThrowMemoryError(); + void CheckEOF(uint32 count); + }; + + class DataOutput : virtual public DataIOBase + { + public: + DataOutput(Toplevel *toplevel) : m_toplevel(toplevel) { } + + virtual void Write(const void *buffer, uint32 count) = 0; + + void WriteBoolean(bool value); + void WriteU8(U8 value); + void WriteU16(unsigned short value); + void WriteU32(uint32 value); + void WriteFloat(float value); + void WriteDouble(double value); + void WriteUTF(String *str); + void WriteUTFBytes(String *str); + void WriteByteArray(ByteArray& buffer, uint32 offset, uint32 count); + + protected: + // FIXME: make const + DRC(Toplevel *) m_toplevel; + + void ThrowRangeError(); + + }; +} + +#endif /* DATAIO_INCLUDED */ diff --git a/mozilla/js/tamarin/shell/DebugCLI.cpp b/mozilla/js/tamarin/shell/DebugCLI.cpp new file mode 100644 index 00000000000..ee67e369d83 --- /dev/null +++ b/mozilla/js/tamarin/shell/DebugCLI.cpp @@ -0,0 +1,784 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#include + +#include "avmshell.h" + +#ifdef DEBUGGER +namespace avmshell +{ + /** + * The array of top level commands that we support. + * They are placed into a Nx2 array, whereby the first component + * is a String which is the command and the 2nd component is the + * integer identifier for the command. + * + * The StringIntArray object provides a convenient wrapper class + * that implements the List interface. + * + * NOTE: order matters! For the case of a single character + * match, we let the first hit act like an unambiguous match. + */ + DebugCLI::StringIntArray DebugCLI::commandArray[] = + { + { "awatch", CMD_AWATCH }, + { "break", CMD_BREAK }, + { "bt", INFO_STACK_CMD }, + { "continue", CMD_CONTINUE }, + { "cf", CMD_CF }, + { "clear", CMD_CLEAR }, + { "commands", CMD_COMMANDS }, + { "condition", CMD_CONDITION }, + { "delete", CMD_DELETE }, + { "disable", CMD_DISABLE }, + { "disassemble", CMD_DISASSEMBLE }, + { "display", CMD_DISPLAY }, + { "enable", CMD_ENABLE }, + { "finish", CMD_FINISH }, + { "file", CMD_FILE }, + { "help", CMD_HELP }, + { "halt", CMD_HALT }, + { "handle", CMD_HANDLE }, + { "home", CMD_HOME }, + { "info", CMD_INFO }, + { "kill", CMD_KILL }, + { "list", CMD_LIST }, + { "next", CMD_NEXT }, + { "nexti", CMD_NEXT }, + { "mctree", CMD_MCTREE }, + { "print", CMD_PRINT }, + { "pwd", CMD_PWD }, + { "quit", CMD_QUIT }, + { "run", CMD_RUN }, + { "rwatch", CMD_RWATCH }, + { "step", CMD_STEP }, + { "stepi", CMD_STEP }, + { "set", CMD_SET }, + { "show", CMD_SHOW }, + { "source", CMD_SOURCE }, + { "tutorial", CMD_TUTORIAL }, + { "undisplay", CMD_UNDISPLAY }, + { "where", INFO_STACK_CMD }, + { "watch", CMD_WATCH }, + { "what", CMD_WHAT }, + { "viewswf", CMD_VIEW_SWF }, + { NULL, 0 } + }; + + /** + * Info sub-commands + */ + DebugCLI::StringIntArray DebugCLI::infoCommandArray[] = + { + { "arguments", INFO_ARGS_CMD }, + { "breakpoints", INFO_BREAK_CMD }, + { "display", INFO_DISPLAY_CMD }, + { "files", INFO_FILES_CMD }, + { "functions", INFO_FUNCTIONS_CMD }, + { "handle", INFO_HANDLE_CMD }, + { "locals", INFO_LOCALS_CMD }, + { "stack", INFO_STACK_CMD }, + { "sources", INFO_SOURCES_CMD }, + { "swfs", INFO_SWFS_CMD }, + { "targets", INFO_TARGETS_CMD }, + { "variables", INFO_VARIABLES_CMD }, + { NULL, 0 } + }; + + /** + * Show sub-commands + */ + DebugCLI::StringIntArray DebugCLI::showCommandArray[] = + { + { "break", SHOW_BREAK_CMD }, + { "files", SHOW_FILES_CMD }, + { "functions", SHOW_FUNC_CMD }, + { "memory", SHOW_MEM_CMD }, + { "net", SHOW_NET_CMD }, + { "properties", SHOW_PROPERTIES_CMD }, + { "uri", SHOW_URI_CMD }, + { "variable", SHOW_VAR_CMD }, + { NULL, 0 } + }; + + /** + * enable sub-commands + */ + DebugCLI::StringIntArray DebugCLI::enableCommandArray[] = + { + { "breakpoints", CMD_BREAK }, + { "display", CMD_DISPLAY }, + { "delete", CMD_DELETE }, + { "once", ENABLE_ONCE_CMD }, + { NULL, 0 } + }; + + /** + * disable sub-commands + */ + DebugCLI::StringIntArray DebugCLI::disableCommandArray[] = + { + { "display", CMD_DISPLAY }, + { "breakpoints", CMD_BREAK }, + { NULL, 0 } + }; + + DebugCLI::DebugCLI(AvmCore *core) + : Debugger(core) + { + currentSourceLen = -1; + } + + DebugCLI::~DebugCLI() + { + if (currentSource) { + delete [] currentSource; + currentSource = NULL; + } + } + + char* DebugCLI::nextToken() + { + char *out = currentToken; + if (currentToken) { + while (*currentToken) { + if (*currentToken == ' ' || *currentToken == '\r' || *currentToken == '\n' || *currentToken == '\t') { + *currentToken++ = 0; + break; + } + currentToken++; + } + currentToken = *currentToken ? currentToken : NULL; + } + return out; + } + + /** + * Attempt to match given the given string against our set of commands + * @return the command code that was hit. + */ + int DebugCLI::determineCommand(DebugCLI::StringIntArray cmdList[], + const char *input, + int defCmd) + { + int inputLen = strlen(input); + + // first check for a comment + if (input[0] == '#') { + return CMD_COMMENT; + } + + int match = -1; + bool ambiguous = false; + + for (int i=0; cmdList[i].text; i++) { + if (!strncmp(input, cmdList[i].text, inputLen)) { + if (match != -1) { + ambiguous = true; + break; + } + match = i; + } + } + + /** + * 3 cases: + * - No hits, return unknown and let our caller + * dump the error. + * - We match unambiguously or we have 1 or more matches + * and the input is a single character. We then take the + * first hit as our command. + * - If we have multiple hits then we dump a 'ambiguous' message + * and puke quietly. + */ + if (match == -1) { + // no command match return unknown + return defCmd; + } + // only 1 match or our input is 1 character or first match is exact + else if (!ambiguous || inputLen == 1 || !strcmp(cmdList[match].text, input)) { + return cmdList[match].id; + } + else { + // matches more than one command dump message and go + core->console << "Ambiguous command '" << input << "': "; + bool first = true; + for (int i=0; cmdList[i].text; i++) { + if (!strncmp(cmdList[i].text, input, inputLen)) { + if (!first) { + core->console << ", "; + } else { + first = false; + } + core->console << cmdList[i].text; + } + } + core->console << ".\n"; + return -1; + } + } + + const char* DebugCLI::commandNumberToCommandName(DebugCLI::StringIntArray cmdList[], + int cmdNumber) + { + for (int i = 0; cmdList[i].text; i++) + { + if (cmdList[i].id == cmdNumber) + return cmdList[i].text; + } + + return "?"; + } + + void DebugCLI::bt() + { + //core->stackTrace->dump(core->console); + //core->console << '\n'; + + // obtain information about each frame + int frameCount = core->debugger->frameCount(); + for(int k=0; kdebugger->frameAt(k); + + // source information + frame->sourceLocation(src, line); + + core->console << "#" << k << " "; + + // this + Atom a = nullObjectAtom; + frame->dhis(a); + core->console << a << "."; + + // method + MethodInfo* info = functionFor(src, line); + if (info) + core->console << info->name; + else + core->console << ""; + + core->console << "("; + + // dump args + frame->arguments(ptr, count); + for(int i=0; igetArgName(i) != core->kundefined) ) + core->console << info->getArgName(i) << "="; + + core->console << *ptr++; + if (iconsole << ","; + } + core->console << ") at "; + if (src) + core->console << src->name(); + else + core->console << "???"; + + core->console << ":" << (line) << "\n"; + } + } + + MethodInfo* DebugCLI::functionFor(SourceInfo* src, int line) + { + MethodInfo* info = NULL; + if (src) + { + // find the function at this location + int size = src->functionCount(); + for(int i=0; ifunctionAt(i); + if (line >= m->firstSourceLine && line <= m->lastSourceLine) + { + info = m; + break; + } + } + } + return info; + } + + // zero based + char* DebugCLI::lineStart(int linenum) + { + if (!currentSource && currentFile) + setCurrentSource(currentFile); + + if (!currentSource) { + return NULL; + } + + // linenumbers map to zero based array entry + char *ptr = currentSource; + for (int i=0; iconsole << "No source available for current instruction\n"; + } else { + // Display status + int lineAt = line; + while(count-- > 0) + { + char* ptr = lineStart(lineAt-1); + if (!ptr) + { + #if WRAP_AROUND + lineAt = 1; + count++; // reset line number to beginning skip this iteration + #else + break; + #endif + } + else + { + core->console << (lineAt) << ": "; + while (*ptr && *ptr != '\n') + core->console << *ptr++; + core->console << '\n'; + lineAt++; + } + } + } + } + + void DebugCLI::list(const char* line) + { + int currentLine = (core->callStack) ? core->callStack->linenum : 0; + int linenum = (line) ? atoi(line) : currentLine; + displayLines(linenum, 10); + } + + void DebugCLI::printIP() + { + int line = (core->callStack) ? core->callStack->linenum : 0; + displayLines(line, 1); + } + + void DebugCLI::breakpoint(char *location) + { + Stringp filename = currentFile; + char *colon = strchr(location, ':'); + + if (colon) { + *colon = 0; + filename = core->constantString(location); + location = colon+1; + } + + AbcFile *abcFile = (AbcFile*) abcAt(0); + if (abcFile == NULL) { + core->console << "No abc file loaded\n"; + return; + } + + SourceFile *sourceFile = abcFile->sourceNamed(filename); + if (sourceFile == NULL) { + core->console << "No source available; can't set breakpoint.\n"; + return; + } + + int targetLine = atoi(location); + + int breakpointId = ++breakpointCount; + + if (breakpointSet(sourceFile, targetLine)) { + core->console << "Breakpoint " << breakpointId << ": file " + << filename + << ", " << (targetLine) << ".\n"; + + BreakAction *breakAction = new (core->GetGC()) BreakAction(sourceFile, + breakpointId, + filename, + targetLine); + breakAction->prev = lastBreakAction; + if (lastBreakAction) { + lastBreakAction->next = breakAction; + } else { + firstBreakAction = breakAction; + } + lastBreakAction = breakAction; + } else { + core->console << "Could not locate specified line.\n"; + } + } + + void DebugCLI::showBreakpoints() + { + BreakAction *breakAction = firstBreakAction; + while (breakAction) { + breakAction->print(core->console); + breakAction = breakAction->next; + } + } + + void DebugCLI::deleteBreakpoint(char *idstr) + { + int id = atoi(idstr); + + BreakAction *breakAction = firstBreakAction; + while (breakAction) { + if (breakAction->id == id) { + break; + } + breakAction = breakAction->next; + } + + if (breakAction) { + if (breakAction->prev) { + breakAction->prev->next = breakAction->next; + } else { + firstBreakAction = breakAction->next; + } + if (breakAction->next) { + breakAction->next->prev = breakAction->prev; + } else { + lastBreakAction = breakAction->prev; + } + if (breakpointClear(breakAction->sourceFile, breakAction->linenum)) { + core->console << "Breakpoint " << id << " deleted.\n"; + } else { + core->console << "Internal error; could not delete breakpoint.\n"; + } + } else { + core->console << "Could not find breakpoint.\n"; + } + } + + void DebugCLI::locals() + { + Atom* ptr; + int count, line; + SourceInfo* src; + DebugFrame* frame = core->debugger->frameAt(0); + + // source information + frame->sourceLocation(src, line); + + // method + MethodInfo* info = functionFor(src, line); + if (info) + { + frame->arguments(ptr, count); + for(int i=0; igetLocalName(i) != core->kundefined) ) + core->console << info->getLocalName(i) << " = "; + + core->console << *ptr++; + //if (iconsole << "\n"; + } + } + } + + Atom DebugCLI::ease2Atom(const char* to, Atom baseline) + { + // first make a string out of the value + Atom a = core->newString(to)->atom(); + + // using the type of baseline try to convert to into an appropriate Atom + if (core->isNumber(baseline)) + return core->numberAtom(a); + else if (core->isBoolean(baseline)) + return core->booleanAtom(a); + + return nullStringAtom; + } + + void DebugCLI::set() + { + const char* what = nextToken(); + const char* equ = nextToken(); + const char* to = nextToken(); + if (!to || !equ || !what || *equ != '=') + { + core->console << " Bad format, should be: 'set {variable} = {value}' "; + } + else + { + // look for the varable in our locals or args. + Atom* ptr; + int count, line; + SourceInfo* src; + DebugFrame* frame = core->debugger->frameAt(0); + + // source information + frame->sourceLocation(src, line); + if (!src) + { + core->console << "Unable to locate debug information for current source file, so no local or argument names known"; + return; + } + + // method + MethodInfo* info = functionFor(src, line); + if (!info) + { + core->console << "Unable to find method debug information, so no local or argument names known"; + return; + } + + frame->arguments(ptr, count); + for(int i=0; igetArgName(i); + if (arg->Equals(what)) + { + // match! + Atom a = ease2Atom(to, ptr[i]); + if (a == undefinedAtom) + core->console << " Type mismatch : current value is " << ptr[i]; + else + frame->setArgument(i, a); + return; + } + } + + frame->locals(ptr, count); + for(int i=0; igetLocalName(i); + if ( local->Equals(what)) + { + // match! + Atom a = ease2Atom(to, ptr[i]); + if (a == undefinedAtom) + core->console << " Type mismatch : current value is " << ptr[i]; + else + frame->setLocal(i, a); + return; + } + } + } + } + + void DebugCLI::print(const char *name) + { + if (!name) { + core->console << "Must specify a name.\n"; + return; + } + + // todo deal with exceptions + Multiname mname( + core->publicNamespace, + core->constantString(name) + ); + + #if 0 + // rick fixme + Atom objAtom = env->findproperty(outerScope, scopes, extraScopes, &mname, false); + Atom valueAtom = env->getproperty(objAtom, &mname); + core->console << core->string(valueAtom) << '\n'; + #endif + } + + bool DebugCLI::filterException(Exception *exception) + { + // Filter exceptions when -d switch specified + if (activeFlag) { + core->console << "Exception has been thrown:\n" + << core->string(exception->atom) + << '\n'; + enterDebugger(); + return true; + } + return false; + } + + void DebugCLI::info() + { + char *command = nextToken(); + int cmd = infoCommandFor(command); + + switch (cmd) { + case -1: + // ambiguous, we already printed error message + break; + case INFO_LOCALS_CMD: + locals(); + break; + case INFO_BREAK_CMD: + showBreakpoints(); + break; + case INFO_UNKNOWN_CMD: + core->console << "Unknown command.\n"; + break; + default: + core->console << "Command not implemented.\n"; + break; + } + } + + void DebugCLI::enterDebugger() + { + setCurrentSource( (core->callStack) ? (core->callStack->filename) : 0 ); + if (currentSource == NULL) + { + stepInto(); + return; + } + + for (;;) { + printIP(); + + core->console << "(asdb) "; + fflush(stdout); + fgets(commandLine, kMaxCommandLine, stdin); + + commandLine[strlen(commandLine)-1] = 0; + + if (!commandLine[0]) { + strcpy(commandLine, lastCommand); + } else { + strcpy(lastCommand, commandLine); + } + + currentToken = commandLine; + + char *command = nextToken(); + int cmd = commandFor(command); + + switch (cmd) { + case -1: + // ambiguous, we already printed error message + break; + case CMD_INFO: + info(); + break; + case CMD_BREAK: + breakpoint(nextToken()); + break; + case CMD_DELETE: + deleteBreakpoint(nextToken()); + break; + case CMD_LIST: + list(nextToken()); + break; + case CMD_UNKNOWN: + core->console << "Unknown command.\n"; + break; + case CMD_QUIT: + exit(0); + break; + case CMD_CONTINUE: + return; + case CMD_PRINT: + print(nextToken()); + break; + case CMD_NEXT: + stepOver(); + return; + case INFO_STACK_CMD: + bt(); + break; + case CMD_FINISH: + stepOut(); + return; + case CMD_STEP: + stepInto(); + return; + case CMD_SET: + set(); + break; + default: + core->console << "Command not implemented.\n"; + break; + } + } + } + + void DebugCLI::setCurrentSource(Stringp file) + { + if (!file) + return; + + currentFile = file; + + if (currentSource) { + delete [] currentSource; + currentSource = NULL; + currentSourceLen = -1; + } + + // Open this file and suck it into memory + FileInputStream f(currentFile->toUTF8String()->c_str()); + if (f.valid()) { + currentSourceLen = f.available(); + currentSource = new char[currentSourceLen+1]; + f.read(currentSource, currentSourceLen); + currentSource[currentSourceLen] = 0; + + // whip through converting \r\n to space \n + for(int i=0; iconsole << "Error opening source file " << currentFile->c_str() << "\n"; + } + } + + // + // BreakAction + // + + void BreakAction::print(PrintWriter& out) + { + out << id << " at " + << filename + << ":" << (linenum) << '\n'; + } +} +#endif diff --git a/mozilla/js/tamarin/shell/DebugCLI.h b/mozilla/js/tamarin/shell/DebugCLI.h new file mode 100644 index 00000000000..d60fb5f0966 --- /dev/null +++ b/mozilla/js/tamarin/shell/DebugCLI.h @@ -0,0 +1,234 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmshell_AvmDebugCLI__ +#define __avmshell_AvmDebugCLI__ + +#ifdef DEBUGGER +namespace avmshell +{ + /** + * Represents a single breakpoint in the Debugger. + */ + class BreakAction : public MMgc::GCObject + { + public: + BreakAction *prev; + BreakAction *next; + SourceFile *sourceFile; + int id; + Stringp filename; + int linenum; + + BreakAction(SourceFile *sourceFile, + int id, + Stringp filename, + int linenum) + { + this->sourceFile = sourceFile; + this->id = id; + this->filename = filename; + this->linenum = linenum; + } + + void print(PrintWriter& out); + }; + + /** + * A simple command line interface for the Debugger. + * Supports a gdb-like command line. + */ + class DebugCLI : public avmplus::Debugger + { + public: + /** @name command codes */ + /*@{*/ + const static int CMD_UNKNOWN = 0; + const static int CMD_QUIT = 1; + const static int CMD_CONTINUE = 2; + const static int CMD_STEP = 3; + const static int CMD_NEXT = 4; + const static int CMD_FINISH = 5; + const static int CMD_BREAK = 6; + const static int CMD_SET = 7; + const static int CMD_LIST = 8; + const static int CMD_PRINT = 9; + const static int CMD_TUTORIAL = 10; + const static int CMD_INFO = 11; + const static int CMD_HOME = 12; + const static int CMD_RUN = 13; + const static int CMD_FILE = 14; + const static int CMD_DELETE = 15; + const static int CMD_SOURCE = 16; + const static int CMD_COMMENT = 17; + const static int CMD_CLEAR = 18; + const static int CMD_HELP = 19; + const static int CMD_SHOW = 20; + const static int CMD_KILL = 21; + const static int CMD_HANDLE = 22; + const static int CMD_ENABLE = 23; + const static int CMD_DISABLE = 24; + const static int CMD_DISPLAY = 25; + const static int CMD_UNDISPLAY = 26; + const static int CMD_COMMANDS = 27; + const static int CMD_PWD = 28; + const static int CMD_CF = 29; + const static int CMD_CONDITION = 30; + const static int CMD_AWATCH = 31; + const static int CMD_WATCH = 32; + const static int CMD_RWATCH = 33; + const static int CMD_WHAT = 34; + const static int CMD_DISASSEMBLE = 35; + const static int CMD_HALT = 36; + const static int CMD_MCTREE = 37; + const static int CMD_VIEW_SWF = 38; + /*@}*/ + + /** @name info sub commands */ + /*@{*/ + const static int INFO_UNKNOWN_CMD = 100; + const static int INFO_ARGS_CMD = 101; + const static int INFO_BREAK_CMD = 102; + const static int INFO_FILES_CMD = 103; + const static int INFO_HANDLE_CMD = 104; + const static int INFO_FUNCTIONS_CMD = 105; + const static int INFO_LOCALS_CMD = 106; + const static int INFO_SOURCES_CMD = 107; + const static int INFO_STACK_CMD = 108; + const static int INFO_VARIABLES_CMD = 109; + const static int INFO_DISPLAY_CMD = 110; + const static int INFO_TARGETS_CMD = 111; + const static int INFO_SWFS_CMD = 112; + /*@}*/ + + /** @name show subcommands */ + /*@{*/ + const static int SHOW_UNKNOWN_CMD = 200; + const static int SHOW_NET_CMD = 201; + const static int SHOW_FUNC_CMD = 202; + const static int SHOW_URI_CMD = 203; + const static int SHOW_PROPERTIES_CMD= 204; + const static int SHOW_FILES_CMD = 205; + const static int SHOW_BREAK_CMD = 206; + const static int SHOW_VAR_CMD = 207; + const static int SHOW_MEM_CMD = 208; + /*@}*/ + + /** @name misc subcommands */ + /*@{*/ + const static int ENABLE_ONCE_CMD = 301; + /*@}*/ + + /** + * StringIntArray is used to store the command arrays + * used to translate command strings into command codes + */ + struct StringIntArray + { + const char *text; + int id; + }; + + DebugCLI(AvmCore *core); + ~DebugCLI(); + + void enterDebugger(); + void setCurrentSource(Stringp file); + bool filterException(Exception *exception); + bool hitWatchpoint() { return false; } + + /** + * @name command implementations + */ + /*@{*/ + void breakpoint(char *location); + void deleteBreakpoint(char *idstr); + void showBreakpoints(); + void bt(); + void locals(); + void info(); + void set(); + void list(const char* line); + void print(const char *name); + void quit(); + /*@}*/ + + void activate() { activeFlag = true; } + + private: + bool activeFlag; + char *currentSource; + int currentSourceLen; + Stringp currentFile; + int breakpointCount; + + BreakAction *firstBreakAction, *lastBreakAction; + + enum { kMaxCommandLine = 1024 }; + char commandLine[kMaxCommandLine]; + char lastCommand[kMaxCommandLine]; + char *currentToken; + char *nextToken(); + + void printIP(); + void displayLines(int linenum, int count); + + char* lineStart(int linenum); + Atom ease2Atom(const char* to, Atom baseline); + MethodInfo* functionFor(SourceInfo* src, int line); + + /** + * @name command name arrays and support code + */ + /*@{*/ + int determineCommand(StringIntArray cmdList[], + const char *input, + int defCmd); + const char* commandNumberToCommandName(StringIntArray cmdList[], + int cmdNumber); + int commandFor(const char *input) { + return determineCommand(commandArray, input, CMD_UNKNOWN); + } + int infoCommandFor(const char *input) { + return determineCommand(infoCommandArray, input, INFO_UNKNOWN_CMD); + } + + static StringIntArray commandArray[]; + static StringIntArray infoCommandArray[]; + static StringIntArray showCommandArray[]; + static StringIntArray enableCommandArray[]; + static StringIntArray disableCommandArray[]; + /*@}*/ + }; +} +#endif + +#endif /* __avmshell_AvmDebugCLI__ */ diff --git a/mozilla/js/tamarin/shell/Domain.as b/mozilla/js/tamarin/shell/Domain.as new file mode 100644 index 00000000000..887374b54d9 --- /dev/null +++ b/mozilla/js/tamarin/shell/Domain.as @@ -0,0 +1,50 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +package avmplus { + +import flash.utils.ByteArray + +public class Domain +{ + public native function Domain(base:Domain); + public native function loadBytes(byteArray:ByteArray); + public native function getClass(className:String):Class; + public native static function get currentDomain():Domain; + + public function load(filename:String) + { + return loadBytes(ByteArray.readFile(filename)) + } +} + +} diff --git a/mozilla/js/tamarin/shell/DomainClass.cpp b/mozilla/js/tamarin/shell/DomainClass.cpp new file mode 100644 index 00000000000..6ff87c8282d --- /dev/null +++ b/mozilla/js/tamarin/shell/DomainClass.cpp @@ -0,0 +1,185 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmshell.h" + +namespace avmshell +{ + BEGIN_NATIVE_MAP(DomainClass) + NATIVE_METHOD(avmplus_Domain_Domain, DomainObject::construct) + NATIVE_METHOD(avmplus_Domain_loadBytes, DomainObject::loadBytes) + NATIVE_METHOD(avmplus_Domain_currentDomain_get, DomainClass::get_currentDomain) + NATIVE_METHOD(avmplus_Domain_getClass, DomainObject::getClass) + END_NATIVE_MAP() + + DomainObject::DomainObject(VTable *vtable, ScriptObject *delegate) + : ScriptObject(vtable, delegate) + { + } + + DomainObject::~DomainObject() + { + } + + void DomainObject::construct(DomainObject *parentDomain) + { + Shell *core = (Shell*) this->core(); + + Domain* baseDomain; + if (parentDomain) { + baseDomain = parentDomain->domainEnv->getDomain(); + } else { + baseDomain = core->builtinDomain; + } + + Domain* domain = new (core->GetGC()) Domain(core, baseDomain); + + if (parentDomain) { + domainToplevel = parentDomain->domainToplevel; + } else { + domainToplevel = core->initShellBuiltins(); + } + + domainEnv = new (core->GetGC()) DomainEnv(core, domain, parentDomain->domainEnv); + } + + Atom DomainObject::loadBytes(ByteArrayObject *b) + { + AvmCore* core = this->core(); + if (!b) + toplevel()->throwTypeError(kNullArgumentError, core->toErrorString("bytes")); + + ShellCodeContext* codeContext = new (core->GetGC()) ShellCodeContext(); + codeContext->domainEnv = domainEnv; + + // parse new bytecode + size_t len = b->get_length(); + ScriptBuffer code = core->newScriptBuffer(len); + memcpy(code.getBuffer(), &b->GetByteArray()[0], len); + Toplevel *toplevel = domainToplevel; + return core->handleActionBlock(code, 0, + domainEnv, + toplevel, + NULL, NULL, NULL, codeContext); + } + + ScriptObject* DomainObject::finddef(Multiname* multiname, + DomainEnv* domainEnv) + { + Toplevel* toplevel = this->toplevel(); + + ScriptEnv* script = (ScriptEnv*) domainEnv->getScriptInit(multiname); + if (script == (ScriptEnv*)BIND_AMBIGUOUS) + toplevel->throwReferenceError(kAmbiguousBindingError, multiname); + + if (script == (ScriptEnv*)BIND_NONE) + toplevel->throwReferenceError(kUndefinedVarError, multiname); + + if (script->global == NULL) + { + script->initGlobal(); + Atom argv[1] = { script->global->atom() }; + script->coerceEnter(0, argv); + } + + return script->global; + } + + ClassClosure* DomainObject::getClass(Stringp name) + { + AvmCore *core = this->core(); + + if (name == NULL) { + toplevel()->throwArgumentError(kNullArgumentError, core->toErrorString("name")); + } + + // Search for a dot from the end. + int dot; + for (dot=name->length()-1; dot >= 0; dot--) + if ((*name)[dot] == (wchar)'.') + break; + + // If there is a '.', this is a fully-qualified + // class name in a package. Must turn it into + // a namespace-qualified multiname. + Namespace* ns; + Stringp className; + if (dot != -1) { + Stringp uri = core->internString(new (core->GetGC()) String(name, 0, dot)); + ns = core->internNamespace(core->newNamespace(uri)); + className = core->internString(new (core->GetGC()) String(name, dot+1, name->length()-(dot+1))); + } else { + ns = core->publicNamespace; + className = core->internString(name); + } + + Multiname multiname(ns, className); + + ShellCodeContext* codeContext = (ShellCodeContext*)core->codeContext(); + + ScriptObject *container = finddef(&multiname, codeContext->domainEnv); + if (!container) { + toplevel()->throwTypeError(kClassNotFoundError, core->toErrorString(&multiname)); + } + Atom atom = toplevel()->getproperty(container->atom(), + &multiname, + container->vtable); + + if (!core->istype(atom, core->traits.class_itraits)) { + toplevel()->throwTypeError(kClassNotFoundError, core->toErrorString(&multiname)); + } + return (ClassClosure*)AvmCore::atomToScriptObject(atom); + } + + DomainClass::DomainClass(VTable *cvtable) + : ClassClosure(cvtable) + { + createVanillaPrototype(); + } + + ScriptObject* DomainClass::createInstance(VTable *ivtable, + ScriptObject *prototype) + { + return new (core()->GetGC(), ivtable->getExtraSize()) DomainObject(ivtable, prototype); + } + + DomainObject* DomainClass::get_currentDomain() + { + ShellCodeContext* codeContext = (ShellCodeContext*)core()->codeContext(); + + DomainObject* domainObject = (DomainObject*) createInstance(ivtable(), prototype); + domainObject->domainEnv = codeContext->domainEnv; + domainObject->domainToplevel = toplevel(); + + return domainObject; + } +} diff --git a/mozilla/js/tamarin/shell/DomainClass.h b/mozilla/js/tamarin/shell/DomainClass.h new file mode 100644 index 00000000000..7cb887285fe --- /dev/null +++ b/mozilla/js/tamarin/shell/DomainClass.h @@ -0,0 +1,68 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmshell_DomainClass__ +#define __avmshell_DomainClass__ + + +namespace avmshell +{ + class DomainObject : public ScriptObject + { + public: + DomainObject(VTable *vtable, ScriptObject *delegate); + ~DomainObject(); + + void construct(DomainObject *base); + Atom loadBytes(ByteArrayObject *bytes); + ClassClosure* getClass(Stringp name); + + DWB(DomainEnv*) domainEnv; + DRCWB(Toplevel*) domainToplevel; + + private: + ScriptObject* finddef(Multiname* multiname, DomainEnv* domainEnv); + }; + + class DomainClass : public ClassClosure + { + public: + DomainClass(VTable* cvtable); + + ScriptObject *createInstance(VTable *ivtable, ScriptObject *delegate); + + DomainObject* get_currentDomain(); + + DECLARE_NATIVE_MAP(DomainClass) + }; +} + +#endif /* __avmshell_DomainClass__ */ diff --git a/mozilla/js/tamarin/shell/DoubleArray.as b/mozilla/js/tamarin/shell/DoubleArray.as new file mode 100644 index 00000000000..58807f85fa4 --- /dev/null +++ b/mozilla/js/tamarin/shell/DoubleArray.as @@ -0,0 +1,40 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +package flash.utils +{ + public class DoubleArray + { + public native function get length():uint + public native function set length(value:uint) + } +} + diff --git a/mozilla/js/tamarin/shell/Endian.as b/mozilla/js/tamarin/shell/Endian.as new file mode 100644 index 00000000000..0a81daa5ac9 --- /dev/null +++ b/mozilla/js/tamarin/shell/Endian.as @@ -0,0 +1,39 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +package flash.utils +{ + public class Endian + { + public static const BIG_ENDIAN:String = "bigEndian"; + public static const LITTLE_ENDIAN:String = "littleEndian"; + } +} diff --git a/mozilla/js/tamarin/shell/FileClass.cpp b/mozilla/js/tamarin/shell/FileClass.cpp new file mode 100644 index 00000000000..36bb081f7a9 --- /dev/null +++ b/mozilla/js/tamarin/shell/FileClass.cpp @@ -0,0 +1,154 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmshell.h" + +#include + +namespace avmshell +{ + BEGIN_NATIVE_MAP(FileClass) + NATIVE_METHOD(avmplus_File_exists, FileClass::exists) + NATIVE_METHOD(avmplus_File_read, FileClass::read) + NATIVE_METHOD(avmplus_File_write, FileClass::write) + END_NATIVE_MAP() + + FileClass::FileClass(VTable *cvtable) + : ClassClosure(cvtable) + { + createVanillaPrototype(); + } + + bool FileClass::exists(Stringp filename) + { + if (!filename) { + toplevel()->throwArgumentError(kNullArgumentError, "filename"); + } + UTF8String* filenameUTF8 = filename->toUTF8String(); + FILE *fp = fopen(filenameUTF8->c_str(), "r"); + if (fp != NULL) { + fclose(fp); + return true; + } + return false; + } + + Stringp FileClass::read(Stringp filename) + { + Toplevel* toplevel = this->toplevel(); + AvmCore* core = this->core(); + + if (!filename) { + toplevel->throwArgumentError(kNullArgumentError, "filename"); + } + UTF8String* filenameUTF8 = filename->toUTF8String(); + FILE *fp = fopen(filenameUTF8->c_str(), "r"); + if (fp == NULL) { + toplevel->throwError(kFileOpenError, filename); + } + fseek(fp, 0L, SEEK_END); + long len = ftell(fp); + rewind(fp); + + unsigned char *c = new unsigned char[len+1]; + len = fread(c, 1, len, fp); + c[len] = 0; + + fclose(fp); + + if (len >= 3) + { + // UTF8 BOM + if ((c[0] == 0xef) && (c[1] == 0xbb) && (c[2] == 0xbf)) + { + return core->newString(((char *)c) + 3, len - 3); + } + else if ((c[0] == 0xfe) && (c[1] == 0xff)) + { + //UTF-16 big endian + c += 2; + len = (len - 2) >> 1; + Stringp out = new (core->GetGC()) String(len); + wchar *buffer = out->lockBuffer(); + for (long i = 0; i < len; i++) + { + buffer[i] = (c[0] << 8) + c[1]; + c += 2; + } + out->unlockBuffer(); + + return out; + } + else if ((c[0] == 0xff) && (c[1] == 0xfe)) + { + //UTF-16 little endian + c += 2; + len = (len - 2) >> 1; + Stringp out = new (core->GetGC()) String(len); + wchar *buffer = out->lockBuffer(); + for (long i = 0; i < len; i++) + { + buffer[i] = (c[1] << 8) + c[0]; + c += 2; + } + out->unlockBuffer(); + return out; + } + } + + Stringp out = core->newString((char *) c); + delete [] c; + + return out; + } + + void FileClass::write(Stringp filename, + Stringp data) + { + Toplevel* toplevel = this->toplevel(); + + if (!filename) { + toplevel->throwArgumentError(kNullArgumentError, "filename"); + } + if (!data) { + toplevel->throwArgumentError(kNullArgumentError, "data"); + } + UTF8String* filenameUTF8 = filename->toUTF8String(); + FILE *fp = fopen(filenameUTF8->c_str(), "w"); + if (fp == NULL) { + toplevel->throwError(kFileWriteError, filename); + } + UTF8String* dataUTF8 = data->toUTF8String(); + fwrite(dataUTF8->c_str(), dataUTF8->length(), 1, fp); + fclose(fp); + } +} diff --git a/mozilla/js/tamarin/shell/FileClass.h b/mozilla/js/tamarin/shell/FileClass.h new file mode 100644 index 00000000000..61ec3530aba --- /dev/null +++ b/mozilla/js/tamarin/shell/FileClass.h @@ -0,0 +1,74 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmshell_FileClass__ +#define __avmshell_FileClass__ + + +namespace avmshell +{ + /** + * A simple class that has some native methods. + * Included as an example for writers of native methods, + * and also to provide some useful QA instrumentation. + */ + class FileClass : public ClassClosure + { + public: + FileClass(VTable* cvtable); + + /** + * Implementation of File.exists + * AS usage: exists = File.exists(filename); + * Tests whether file "filename" exists. + */ + bool exists(Stringp filename); + + /** + * Implementation of File.read + * AS usage: data = File.read(filename); + * Reads the file "filename" into memory and returns + * it as a string + */ + Stringp read(Stringp filename); + + /** + * Implementation of File.write + * AS usage: File.write(filename, data); + * Writes the text "data" to the file "filename" + */ + void write(Stringp filename, Stringp data); + + DECLARE_NATIVE_MAP(FileClass) + }; +} + +#endif /* __avmshell_FileClass__ */ diff --git a/mozilla/js/tamarin/shell/FileInputStream.cpp b/mozilla/js/tamarin/shell/FileInputStream.cpp new file mode 100644 index 00000000000..30a67938d62 --- /dev/null +++ b/mozilla/js/tamarin/shell/FileInputStream.cpp @@ -0,0 +1,74 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#include "avmshell.h" + +namespace avmshell +{ + FileInputStream::FileInputStream(const char *filename) + { + file = fopen(filename, "rb"); + + if (file != NULL) { + fseek(file, 0L, SEEK_END); + len = ftell(file); + rewind(file); + } + } + + bool FileInputStream::valid() const + { + return file != NULL; + } + + FileInputStream::~FileInputStream() + { + if (file != NULL) { + fclose(file); + } + } + + void FileInputStream::seek(int offset) + { + fseek(file, offset, SEEK_SET); + } + + int FileInputStream::available() + { + return len - ftell(file); + } + + int FileInputStream::read(void *buffer, + int count) + { + return (int) fread(buffer, 1, count, file); + } +} diff --git a/mozilla/js/tamarin/shell/FileInputStream.h b/mozilla/js/tamarin/shell/FileInputStream.h new file mode 100644 index 00000000000..63c1d2c3fed --- /dev/null +++ b/mozilla/js/tamarin/shell/FileInputStream.h @@ -0,0 +1,72 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmshell_FileInputStream__ +#define __avmshell_FileInputStream__ + + +namespace avmshell +{ + /** + * InputStream is an abstract base class for input streams. + * Concrete subclasses must implement the available and read + * methods to do appropriate read operations. + */ + class InputStream + { + public: + virtual ~InputStream() {} + virtual int available() = 0; + virtual int read(void *buffer, int count) = 0; + }; + + /** + * FileInputStream is a concrete subclass of InputStream + * that implements file input. + */ + class FileInputStream : public InputStream + { + public: + FileInputStream(const char *filename); + bool valid() const; + ~FileInputStream(); + int available(); + int length() const { return len; } + void seek(int offset); + int read(void *buffer, int count); + + private: + FILE *file; + long len; + }; +} + +#endif /* __avmshell_FileInputStream__ */ diff --git a/mozilla/js/tamarin/shell/FloatArray.as b/mozilla/js/tamarin/shell/FloatArray.as new file mode 100644 index 00000000000..0cb1ecf04ce --- /dev/null +++ b/mozilla/js/tamarin/shell/FloatArray.as @@ -0,0 +1,40 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +package flash.utils +{ + public class FloatArray + { + public native function get length():uint + public native function set length(value:uint) + } +} + diff --git a/mozilla/js/tamarin/shell/IntArray.as b/mozilla/js/tamarin/shell/IntArray.as new file mode 100644 index 00000000000..f2dba916396 --- /dev/null +++ b/mozilla/js/tamarin/shell/IntArray.as @@ -0,0 +1,40 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +package flash.utils +{ + public class IntArray + { + public native function get length():uint; + public native function set length(value:uint) + } +} + diff --git a/mozilla/js/tamarin/shell/Java.as b/mozilla/js/tamarin/shell/Java.as new file mode 100644 index 00000000000..1bc884a200c --- /dev/null +++ b/mozilla/js/tamarin/shell/Java.as @@ -0,0 +1,48 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +package avmplus +{ + public class JObject + { + public native static function create(name:String, ...args):JObject; + public native static function createArray(type:JObject, size:int, fillWith:Array=null):JObject; + public native static function toArray(j:JObject):Array + + // diagnostic routines + public native static function constructorSignature(name:String, ...args):String; + public native static function methodSignature(j:JObject, name:String, ...args):String; + public native static function fieldSignature(j:JObject, name:String):String; + + public native function toString():String; + } +} diff --git a/mozilla/js/tamarin/shell/Profiler.h b/mozilla/js/tamarin/shell/Profiler.h new file mode 100644 index 00000000000..4a0702a4c0c --- /dev/null +++ b/mozilla/js/tamarin/shell/Profiler.h @@ -0,0 +1,61 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmshell_Profiler__ +#define __avmshell_Profiler__ + + +#ifdef DEBUGGER +namespace avmshell +{ + /** + * Dummy implementation of the Profiler interface. + */ + class Profiler : public avmplus::Profiler + { + public: + Profiler(MMgc::GC* gc) : avmplus::Profiler(gc) {} + + void sendDebugFileUrl(UTF8String *url) {} + void sendLineTimestamp(int linenumber) {} + void setEnabled(bool on) {} + void sendFunctionEnter(AbstractFunction* method) {} + void sendFunctionExit() {} + void sendCatch(AbstractFunction* method) {} + void addScriptObject(ScriptObject *scriptObject) {} + void deleteScriptObject(ScriptObject *scriptObject) {} + void sendHeapDump(String *heapDumpName) {} + int computeStringSize(String *myString) { return 0; } + }; +} +#endif + +#endif /* __avmshell_Profiler__ */ diff --git a/mozilla/js/tamarin/shell/ShortArray.as b/mozilla/js/tamarin/shell/ShortArray.as new file mode 100644 index 00000000000..3187dc46a12 --- /dev/null +++ b/mozilla/js/tamarin/shell/ShortArray.as @@ -0,0 +1,40 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +package flash.utils +{ + public class ShortArray + { + public native function get length():uint; + public native function set length(value:uint) + } +} + diff --git a/mozilla/js/tamarin/shell/StringBuilder.as b/mozilla/js/tamarin/shell/StringBuilder.as new file mode 100644 index 00000000000..b8373d966d3 --- /dev/null +++ b/mozilla/js/tamarin/shell/StringBuilder.as @@ -0,0 +1,65 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +package avmplus +{ + +public class StringBuilder +{ + public function StringBuilder(str:String = null) + { + if (str != null) + { + append(str); + } + } + + public native function append(value):void; + public native function get capacity():uint; + public native function charAt(index:uint):String; + public native function charCodeAt(index:uint):uint; + public native function ensureCapacity(minimumCapacity:uint):void; + public native function indexOf(str:String, index:uint=0):int; + public native function insert(index:uint, value):void; + public native function lastIndexOf(str:String, index:uint=0xFFFFFFFF):int; + public native function get length():uint; + public native function set length(value:uint) + public native function remove(beginIndex:uint, endIndex:uint):void; + public native function removeCharAt(index:uint):void; + public native function replace(beginIndex:uint, endIndex:uint, replacement:String):void; + public native function reverse():void; + public native function setCharAt(index:uint, ch:String):void; + public native function substring(beginIndex:uint, endIndex:uint=0xFFFFFFFF):String; + public native function toString():String; + public native function trimToSize():void; +} + +} diff --git a/mozilla/js/tamarin/shell/StringBuilderClass.cpp b/mozilla/js/tamarin/shell/StringBuilderClass.cpp new file mode 100644 index 00000000000..6c808308210 --- /dev/null +++ b/mozilla/js/tamarin/shell/StringBuilderClass.cpp @@ -0,0 +1,399 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmshell.h" + +namespace avmshell +{ + BEGIN_NATIVE_MAP(StringBuilderClass) + NATIVE_METHOD(avmplus_StringBuilder_append, StringBuilderObject::append) + NATIVE_METHOD(avmplus_StringBuilder_capacity_get, StringBuilderObject::get_capacity) + NATIVE_METHOD(avmplus_StringBuilder_charAt, StringBuilderObject::charAt) + NATIVE_METHOD(avmplus_StringBuilder_charCodeAt, StringBuilderObject::charCodeAt) + NATIVE_METHOD(avmplus_StringBuilder_ensureCapacity, StringBuilderObject::ensureCapacity) + NATIVE_METHOD(avmplus_StringBuilder_indexOf, StringBuilderObject::indexOf) + NATIVE_METHOD(avmplus_StringBuilder_insert, StringBuilderObject::insert) + NATIVE_METHOD(avmplus_StringBuilder_lastIndexOf, StringBuilderObject::lastIndexOf) + NATIVE_METHOD(avmplus_StringBuilder_length_get, StringBuilderObject::get_length) + NATIVE_METHOD(avmplus_StringBuilder_length_set, StringBuilderObject::set_length) + NATIVE_METHOD(avmplus_StringBuilder_remove, StringBuilderObject::remove) + NATIVE_METHOD(avmplus_StringBuilder_removeCharAt, StringBuilderObject::removeCharAt) + NATIVE_METHOD(avmplus_StringBuilder_replace, StringBuilderObject::replace) + NATIVE_METHOD(avmplus_StringBuilder_reverse, StringBuilderObject::reverse) + NATIVE_METHOD(avmplus_StringBuilder_setCharAt, StringBuilderObject::setCharAt) + NATIVE_METHOD(avmplus_StringBuilder_substring, StringBuilderObject::substring) + NATIVE_METHOD(avmplus_StringBuilder_toString, StringBuilderObject::_toString) + NATIVE_METHOD(avmplus_StringBuilder_trimToSize, StringBuilderObject::trimToSize) + END_NATIVE_MAP() + + StringBuilderObject::StringBuilderObject(VTable *vtable, ScriptObject *delegate) + : ScriptObject(vtable, delegate) + { + m_buffer = new wchar[kInitialCapacity]; + if (!m_buffer) + { + toplevel()->throwError(kOutOfMemoryError); + } + m_length = 0; + m_capacity = kInitialCapacity; + } + + StringBuilderObject::~StringBuilderObject() + { + delete [] m_buffer; + m_buffer = NULL; + m_length = NULL; + m_capacity = NULL; + } + + void StringBuilderObject::append(Atom value) + { + Stringp str = core()->string(value); + int len = str->length(); + + if (len > 0) + { + ensureCapacity(m_length + len); + memcpy(m_buffer+m_length, str->c_str(), len*sizeof(wchar)); + m_length += len; + } + } + + uint32 StringBuilderObject::get_capacity() + { + return m_capacity; + } + + Stringp StringBuilderObject::charAt(uint32 index) + { + if (index >= m_length) + { + toplevel()->throwRangeError(kStringIndexOutOfBoundsError, core()->toErrorString(index), core()->toErrorString(0), core()->toErrorString(m_length)); + } + return new (gc()) String(m_buffer+index, 1); + } + + uint32 StringBuilderObject::charCodeAt(uint32 index) + { + if (index > m_length) + { + toplevel()->throwRangeError(kStringIndexOutOfBoundsError, core()->toErrorString(index), core()->toErrorString(0), core()->toErrorString(m_length)); + } + return m_buffer[index]; + } + + void StringBuilderObject::ensureCapacity(uint32 minimumCapacity) + { + if (m_capacity < minimumCapacity) + { + /* The new capacity is the larger of + * - The minimumCapacity argument + * - Twice the old capacity, plus 2 + */ + uint32 newCapacity = (m_capacity<<1)+2; + if (newCapacity < minimumCapacity) + { + newCapacity = minimumCapacity; + } + + wchar *newBuffer = new wchar[newCapacity]; + if (newBuffer == NULL) + { + toplevel()->throwError(kOutOfMemoryError); + } + + memcpy(newBuffer, m_buffer, m_length*sizeof(wchar)); + delete [] m_buffer; + m_buffer = newBuffer; + m_capacity = newCapacity; + } + } + + int StringBuilderObject::indexOf(Stringp str, uint32 index) + { + if (!str) { + toplevel()->throwArgumentError(kNullArgumentError, "str"); + } + + uint32 sublen = str->length(); + if (m_length < sublen) + { + return -1; + } + + // endIndex is the last character in selfString subStr could be found at + // (and further, and there isn't enough of selfString remaining for a match to be possible) + const uint32 endIndex = m_length - sublen; + + const wchar *ptr = m_buffer + index; + const wchar *subchars = str->c_str(); + for ( ; index <= endIndex; index++) + { + if (memcmp(ptr, subchars, sublen*sizeof(wchar)) == 0) + { + return index; + } + ptr++; + } + + return -1; + } + + void StringBuilderObject::insert(uint32 index, Atom value) + { + Stringp str = core()->string(value); + uint32 len = str->length(); + + if (index > m_length) + { + toplevel()->throwRangeError(kStringIndexOutOfBoundsError, core()->toErrorString(index), core()->toErrorString(0), core()->toErrorString(m_length)); + } + + ensureCapacity(m_length + len); + memmove(m_buffer+index+len, m_buffer+index, (m_length-index)*sizeof(wchar)); + memcpy(m_buffer+index, str->c_str(), len*sizeof(wchar)); + m_length += len; + } + + int StringBuilderObject::lastIndexOf(Stringp substr, uint32 index) + { + if (!substr) { + toplevel()->throwArgumentError(kNullArgumentError, "str"); + } + + uint32 sublen = substr->length(); + + // endIndex is the last character in selfString subStr could be found at + // (and further, and there isn't enough of selfString remaining for a match to be possible) + const uint32 endIndex = m_length - sublen; + + if (index == 0xFFFFFFFF) + { + index = endIndex; + } + if (index > m_length) + { + toplevel()->throwRangeError(kStringIndexOutOfBoundsError, core()->toErrorString(index), core()->toErrorString(0), core()->toErrorString(m_length)); + } + if (index > endIndex) + { + index = endIndex; + } + + const wchar *ptr = m_buffer + index; + for ( ; index >= 0 ; index-- ) + { + if (memcmp(ptr, substr->c_str(), sublen*sizeof(wchar)) == 0) { + return index; + } + ptr--; + } + + return -1; + } + + uint32 StringBuilderObject::get_length() + { + return m_length; + } + + void StringBuilderObject::set_length(uint32 length) + { + ensureCapacity(length); + if (length > m_length) + { + memset(m_buffer+m_length, 0, (length-m_length)*sizeof(wchar)); + } + m_length = length; + } + + void StringBuilderObject::remove(uint32 start, uint32 end) + { + if (start > end) + { + toplevel()->throwRangeError(kInvalidRangeError); + } + if (start >= m_length) + { + toplevel()->throwRangeError(kStringIndexOutOfBoundsError, core()->toErrorString(start), core()->toErrorString(0), core()->toErrorString(m_length)); + } + if (end > m_length) + { + toplevel()->throwRangeError(kStringIndexOutOfBoundsError, core()->toErrorString(end), core()->toErrorString(0), core()->toErrorString(m_length)); + } + if (start == end) + { + return; + } + memcpy(m_buffer+start, m_buffer+end, (m_length-end)*sizeof(wchar)); + m_length -= (end - start); + } + + void StringBuilderObject::removeCharAt(uint32 index) + { + if (index >= m_length) + { + toplevel()->throwRangeError(kStringIndexOutOfBoundsError, core()->toErrorString(index), core()->toErrorString(0), core()->toErrorString(m_length)); + } + memcpy(m_buffer+index, m_buffer+index+1, (m_length-index-1)*sizeof(wchar)); + m_length--; + } + + void StringBuilderObject::replace(uint32 start, uint32 end, Stringp replacement) + { + if (!replacement) { + toplevel()->throwArgumentError(kNullArgumentError, "replacement"); + } + + if (start > end) + { + toplevel()->throwRangeError(kInvalidRangeError); + } + if (start >= m_length) + { + toplevel()->throwRangeError(kStringIndexOutOfBoundsError, core()->toErrorString(start), core()->toErrorString(0), core()->toErrorString(m_length)); + } + if (end > m_length) + { + toplevel()->throwRangeError(kStringIndexOutOfBoundsError, core()->toErrorString(end), core()->toErrorString(0), core()->toErrorString(m_length)); + } + + uint32 replacementLength = replacement->length(); + + uint32 newLength = m_length + replacementLength - (end - start); + ensureCapacity(newLength); + + memmove(m_buffer + start + replacementLength, + m_buffer + end, + (m_length - end) * sizeof(wchar)); + memcpy(m_buffer + start, + replacement->c_str(), + replacementLength * sizeof(wchar)); + m_length = newLength; + } + + void StringBuilderObject::reverse() + { + wchar *start = m_buffer; + wchar *end = m_buffer+m_length; + + if (m_length) + { + end--; + } + + while (start < end) + { + wchar ch = *start; + *start = *end; + *end = ch; + start++; + end--; + } + } + + void StringBuilderObject::setCharAt(uint32 index, Stringp ch) + { + if (!ch || !ch->length()) { + toplevel()->throwArgumentError(kNullArgumentError, "ch"); + } + + ensureCapacity(index+1); + if (index >= m_length) + { + set_length(index+1); + } + m_buffer[index] = ch->c_str()[0]; + } + + Stringp StringBuilderObject::substring(uint32 start, uint32 end) + { + if (start > end) + { + toplevel()->throwRangeError(kInvalidRangeError); + } + if (start >= m_length) + { + toplevel()->throwRangeError(kStringIndexOutOfBoundsError, core()->toErrorString(start), core()->toErrorString(0), core()->toErrorString(m_length)); + } + if (end > m_length) + { + toplevel()->throwRangeError(kStringIndexOutOfBoundsError, core()->toErrorString(end), core()->toErrorString(0), core()->toErrorString(m_length)); + } + if (start == end) + { + return core()->kEmptyString; + } + return new (gc()) String(m_buffer+start, end-start); + } + + Stringp StringBuilderObject::_toString() + { + return new (gc()) String(m_buffer, m_length); + } + + void StringBuilderObject::trimToSize() + { + if (m_length == m_capacity) + { + // already trimmed + return; + } + uint32 newCapacity = m_length; + if (newCapacity < kInitialCapacity) + { + newCapacity = kInitialCapacity; + } + wchar *newBuffer = new wchar[newCapacity]; + if (!newBuffer) + { + // can't trim + return; + } + delete [] m_buffer; + memcpy(newBuffer, m_buffer, m_length*sizeof(wchar)); + m_capacity = newCapacity; + m_buffer = newBuffer; + } + + StringBuilderClass::StringBuilderClass(VTable *cvtable) + : ClassClosure(cvtable) + { + createVanillaPrototype(); + } + + ScriptObject* StringBuilderClass::createInstance(VTable *ivtable, + ScriptObject *prototype) + { + return new (core()->GetGC(), ivtable->getExtraSize()) StringBuilderObject(ivtable, prototype); + } +} diff --git a/mozilla/js/tamarin/shell/StringBuilderClass.h b/mozilla/js/tamarin/shell/StringBuilderClass.h new file mode 100644 index 00000000000..a25b6831d17 --- /dev/null +++ b/mozilla/js/tamarin/shell/StringBuilderClass.h @@ -0,0 +1,80 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmshell_StringBuilderClass__ +#define __avmshell_StringBuilderClass__ + + +namespace avmshell +{ + class StringBuilderObject : public ScriptObject + { + public: + StringBuilderObject(VTable *vtable, ScriptObject *delegate); + ~StringBuilderObject(); + + void append(Atom value); + uint32 get_capacity(); + Stringp charAt(uint32 index); + uint32 charCodeAt(uint32 index); + void ensureCapacity(uint32 minimumCapacity); + int indexOf(Stringp str, uint32 index); + void insert(uint32 offset, Atom value); + int lastIndexOf(Stringp substr, uint32 index); + uint32 get_length(); + void set_length(uint32 length); + void remove(uint32 start, uint32 end); + void removeCharAt(uint32 index); + void replace(uint32 start, uint32 end, Stringp replacement); + void reverse(); + void setCharAt(uint32 index, Stringp ch); + Stringp substring(uint32 start, uint32 end); + Stringp _toString(); + void trimToSize(); + + private: + wchar *m_buffer; + uint32 m_length; + uint32 m_capacity; + + static const uint32 kInitialCapacity = 16; + }; + + class StringBuilderClass : public ClassClosure + { + public: + StringBuilderClass(VTable* cvtable); + ScriptObject *createInstance(VTable *ivtable, ScriptObject *delegate); + DECLARE_NATIVE_MAP(StringBuilderClass) + }; +} + +#endif /* __avmshell_StringBuilderClass__ */ diff --git a/mozilla/js/tamarin/shell/SystemClass.cpp b/mozilla/js/tamarin/shell/SystemClass.cpp new file mode 100644 index 00000000000..c954749315a --- /dev/null +++ b/mozilla/js/tamarin/shell/SystemClass.cpp @@ -0,0 +1,205 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmshell.h" + +#include + +namespace avmshell +{ + BEGIN_NATIVE_MAP(SystemClass) + NATIVE_METHOD(avmplus_System_exit, SystemClass::exit) + NATIVE_METHOD(avmplus_System_exec, SystemClass::exec) + NATIVE_METHOD(avmplus_System_getAvmplusVersion, SystemClass::getAvmplusVersion) + NATIVE_METHOD(avmplus_System_trace, SystemClass::trace) + NATIVE_METHOD(avmplus_System_write, SystemClass::write) + NATIVE_METHOD(avmplus_System_debugger, SystemClass::debugger) + NATIVE_METHOD(avmplus_System_isDebugger, SystemClass::isDebugger) + NATIVE_METHOD(avmplus_System_getTimer, SystemClass::getTimer) + NATIVE_METHOD(avmplus_System_readLine, SystemClass::readLine) + NATIVE_METHOD(avmplus_System_private_getArgv, SystemClass::getArgv) + END_NATIVE_MAP() + + SystemClass::SystemClass(VTable *cvtable) + : ClassClosure(cvtable) + { + Shell* core = (Shell*)this->core(); + if (core->systemClass == NULL) { + core->systemClass = this; + } + + createVanillaPrototype(); + + // initialTime: support for getTimer + // todo note this is currently routed to the performance counter + // for benchmark purposes. + #ifdef PERFORMANCE_GETTIMER + initialTime = MMgc::GC::getPerformanceCounter(); + #else + initialTime = OSDep::currentTimeMillis(); + #endif // PERFORMANCE_GETTIMER + + } + + SystemClass::~SystemClass() + { + initialTime = 0; + } + + void SystemClass::exit(int status) + { + ::exit(status); + } + + int SystemClass::exec(Stringp command) + { + if (!command) { + toplevel()->throwArgumentError(kNullArgumentError, "command"); + } + UTF8String *commandUTF8 = command->toUTF8String(); + return system(commandUTF8->c_str()); + } + + Stringp SystemClass::getAvmplusVersion() + { + return core()->newString(AVMPLUS_VERSION_USER " " AVMPLUS_BUILD_CODE); + } + + void SystemClass::write(Stringp s) + { + if (!s) + toplevel()->throwArgumentError(kNullArgumentError, "string"); + core()->console << s; + } + + void SystemClass::trace(ArrayObject* a) + { + if (!a) + toplevel()->throwArgumentError(kNullArgumentError, "array"); + AvmCore* core = this->core(); + PrintWriter& console = core->console; + for (int i=0, n = a->getLength(); i < n; i++) + { + if (i > 0) + console << ' '; + Stringp s = core->string(a->getUintProperty(i)); + for (int j = 0; j < s->length(); j++) + { + wchar c = (*s)[j]; + // '\r' gets converted into '\n' + // '\n' is left alone + // '\r\n' is left alone + if (c == '\r') + { + if (((j+1) < s->length()) && (*s)[j+1] == '\n') + { + console << '\r'; + j++; + } + + console << '\n'; + } + else + { + console << c; + } + } + } + console << '\n'; + } + + void SystemClass::debugger() + { + #ifdef DEBUGGER + core()->debugger->enterDebugger(); + #endif + } + + bool SystemClass::isDebugger() + { + #ifdef DEBUGGER + return true; + #else + return false; + #endif + } + + unsigned SystemClass::getTimer() + { +#ifdef PERFORMANCE_GETTIMER + double time = ((double) (MMgc::GC::getPerformanceCounter() - initialTime) * 1000.0 / + (double)MMgc::GC::getPerformanceFrequency()); + return (uint32)time; +#else + return (uint32)(OSDep::currentTimeMillis() - initialTime); +#endif /* PERFORMANCE_GETTIMER */ + + } + + int SystemClass::user_argc; + char **SystemClass::user_argv; + + ArrayObject * SystemClass::getArgv() + { + // get VTable for avmplus.System + Toplevel *toplevel = this->toplevel(); + AvmCore *core = this->core(); + + ArrayObject *array = toplevel->arrayClass->newArray(); + for(int i=0; isetUintProperty(i, core->newString(user_argv[i])->atom()); + + return array; + } + + Stringp SystemClass::readLine() + { + AvmCore* core = this->core(); + Stringp s = core->kEmptyString; + wchar wc[64]; + int i=0; + for (int c = getchar(); c != '\n' && c != EOF; c = getchar()) + { + wc[i++] = c; + if (i == 63) { + wc[i] = 0; + s = core->concatStrings(s, core->newString(wc)); + i = 0; + } + } + if (i > 0) { + wc[i] = 0; + s = core->concatStrings(s, core->newString(wc)); + } + return s; + } +} diff --git a/mozilla/js/tamarin/shell/SystemClass.h b/mozilla/js/tamarin/shell/SystemClass.h new file mode 100644 index 00000000000..f1abd8cda2d --- /dev/null +++ b/mozilla/js/tamarin/shell/SystemClass.h @@ -0,0 +1,112 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmshell_SystemClass__ +#define __avmshell_SystemClass__ + + +namespace avmshell +{ + /** + * A simple class that has some native methods. + * Included as an example for writers of native methods, + * and also to provide some useful QA instrumentation. + */ + class SystemClass : public ClassClosure + { + + //#define PERFORMANCE_GETTIMER + #ifdef PERFORMANCE_GETTIMER + uint64 initialTime; + #else + double initialTime; + #endif + + public: + SystemClass(VTable* cvtable); + ~SystemClass(); + + // set by shell + static int user_argc; + static char **user_argv; + + /** + * Implementation of System.exit + * AS usage: System.exit(status); + * Exits the VM with OS exit code specified by status. + */ + void exit(int status); + + /** + * Implementation of System.getAvmplusVersion + * AS usage: System.getAvmplusVersion(); + * Returns the current version of AVM+ in the form + * "1.0 d100" + */ + Stringp getAvmplusVersion(); + + /** + * Implementation of System.exec + * AS usage: exitCode = System.exec("command"); + * Executes the specified command line and returns + * the status code + */ + int exec(Stringp command); + + void trace(ArrayObject* a); + void write(Stringp s); + + + /** + * @name Debugging Extensions + */ + /*@{*/ + void debugger(); + bool isDebugger(); + /*@}*/ + + /** + * @name ActionScript Extensions + * ActionScript extensions to ECMAScript + */ + /*@{*/ + unsigned getTimer(); + /*@}*/ + + ArrayObject * getArgv(); + + Stringp readLine(); + + DECLARE_NATIVE_MAP(SystemClass) + }; +} + +#endif /* __avmshell_SystemClass__ */ diff --git a/mozilla/js/tamarin/shell/TypedArrayClass.cpp b/mozilla/js/tamarin/shell/TypedArrayClass.cpp new file mode 100644 index 00000000000..8f57fcf1f4f --- /dev/null +++ b/mozilla/js/tamarin/shell/TypedArrayClass.cpp @@ -0,0 +1,163 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + + +#include "avmshell.h" + +namespace avmshell +{ + // + // ShortArrayClass + // + + BEGIN_NATIVE_MAP(ShortArrayClass) + NATIVE_METHOD(flash_utils_ShortArray_length_get, ShortArrayObject::get_length) + NATIVE_METHOD(flash_utils_ShortArray_length_set, ShortArrayObject::set_length) + END_NATIVE_MAP() + + ShortArrayClass::ShortArrayClass(VTable *vtable) + : ClassClosure(vtable) + { + prototype = toplevel()->objectClass->construct(); + } + + ScriptObject* ShortArrayClass::createInstance(VTable *ivtable, + ScriptObject *prototype) + { + return new (core()->GetGC(), ivtable->getExtraSize()) ShortArrayObject(ivtable, prototype); + } + + // + // UShortArrayClass + // + + BEGIN_NATIVE_MAP(UShortArrayClass) + NATIVE_METHOD(flash_utils_UShortArray_length_get, UShortArrayObject::get_length) + NATIVE_METHOD(flash_utils_UShortArray_length_set, UShortArrayObject::set_length) + END_NATIVE_MAP() + + UShortArrayClass::UShortArrayClass(VTable *vtable) + : ClassClosure(vtable) + { + prototype = toplevel()->objectClass->construct(); + } + + ScriptObject* UShortArrayClass::createInstance(VTable *ivtable, + ScriptObject *prototype) + { + return new (core()->GetGC(), ivtable->getExtraSize()) UShortArrayObject(ivtable, prototype); + } + + // + // IntArrayClass + // + + BEGIN_NATIVE_MAP(IntArrayClass) + NATIVE_METHOD(flash_utils_IntArray_length_get, IntArrayObject::get_length) + NATIVE_METHOD(flash_utils_IntArray_length_set, IntArrayObject::set_length) + END_NATIVE_MAP() + + IntArrayClass::IntArrayClass(VTable *vtable) + : ClassClosure(vtable) + { + prototype = toplevel()->objectClass->construct(); + } + + ScriptObject* IntArrayClass::createInstance(VTable *ivtable, + ScriptObject *prototype) + { + return new (core()->GetGC(), ivtable->getExtraSize()) IntArrayObject(ivtable, prototype); + } + + // + // UIntArrayClass + // + + BEGIN_NATIVE_MAP(UIntArrayClass) + NATIVE_METHOD(flash_utils_UIntArray_length_get, UIntArrayObject::get_length) + NATIVE_METHOD(flash_utils_UIntArray_length_set, UIntArrayObject::set_length) + END_NATIVE_MAP() + + UIntArrayClass::UIntArrayClass(VTable *vtable) + : ClassClosure(vtable) + { + prototype = toplevel()->objectClass->construct(); + } + + ScriptObject* UIntArrayClass::createInstance(VTable *ivtable, + ScriptObject *prototype) + { + return new (core()->GetGC(), ivtable->getExtraSize()) UIntArrayObject(ivtable, prototype); + } + + // + // FloatArrayClass + // + + BEGIN_NATIVE_MAP(FloatArrayClass) + NATIVE_METHOD(flash_utils_FloatArray_length_get, FloatArrayObject::get_length) + NATIVE_METHOD(flash_utils_FloatArray_length_set, FloatArrayObject::set_length) + END_NATIVE_MAP() + + FloatArrayClass::FloatArrayClass(VTable *vtable) + : ClassClosure(vtable) + { + prototype = toplevel()->objectClass->construct(); + } + + ScriptObject* FloatArrayClass::createInstance(VTable *ivtable, + ScriptObject *prototype) + { + return new (core()->GetGC(), ivtable->getExtraSize()) FloatArrayObject(ivtable, prototype); + } + + // + // DoubleArrayClass + // + + BEGIN_NATIVE_MAP(DoubleArrayClass) + NATIVE_METHOD(flash_utils_DoubleArray_length_get, DoubleArrayObject::get_length) + NATIVE_METHOD(flash_utils_DoubleArray_length_set, DoubleArrayObject::set_length) + END_NATIVE_MAP() + + DoubleArrayClass::DoubleArrayClass(VTable *vtable) + : ClassClosure(vtable) + { + prototype = toplevel()->objectClass->construct(); + } + + ScriptObject* DoubleArrayClass::createInstance(VTable *ivtable, + ScriptObject *prototype) + { + return new (core()->GetGC(), ivtable->getExtraSize()) DoubleArrayObject(ivtable, prototype); + } +} diff --git a/mozilla/js/tamarin/shell/TypedArrayClass.h b/mozilla/js/tamarin/shell/TypedArrayClass.h new file mode 100644 index 00000000000..4e9ec7222f9 --- /dev/null +++ b/mozilla/js/tamarin/shell/TypedArrayClass.h @@ -0,0 +1,272 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#ifndef TYPEDARRAYCLASS_INCLUDED +#define TYPEDARRAYCLASS_INCLUDED + +namespace avmshell +{ + template + class TypedArrayObject : public ScriptObject + { + public: + TypedArrayObject(VTable *ivtable, ScriptObject *delegate) + : ScriptObject(ivtable, delegate) + { + m_array = NULL; + m_capacity = 0; + m_length = 0; + } + + ~TypedArrayObject() + { + delete [] m_array; + m_array = NULL; + m_capacity = 0; + m_length = 0; + } + + virtual bool hasProperty(Atom name) const + { + return ScriptObject::hasProperty(name) || getProperty(name) != undefinedAtom; + } + + virtual void setProperty(Atom name, Atom value) + { + uint32 index; + if (core()->getIndexFromAtom(name, &index)) + { + setUintProperty(index, value); + } + else + { + ScriptObject::setProperty(name, value); + } + } + + virtual Atom getProperty(Atom name) const + { + uint32 index; + if (core()->getIndexFromAtom(name, &index)) + { + return getUintProperty(index); + } + else + { + return ScriptObject::getProperty(name); + } + } + + virtual Atom getUintProperty(uint32 index) const + { + if (m_length <= index) + { + return undefinedAtom; + } + else + { + return valueToAtom(m_array[index]); + } + } + + virtual void setUintProperty(uint32 index, Atom value) + { + if (m_length <= index) + { + grow(index+1); + m_length = index+1; + } + atomToValue(value, m_array[index]); + } + + uint32 get_length() + { + return m_length; + } + + void set_length(uint32 newLength) + { + if (newLength > m_capacity) + { + grow(newLength); + } + m_length = newLength; + } + + private: + uint32 m_capacity; + uint32 m_length; + T *m_array; + + enum { kGrowthIncr = 4096 }; + + void atomToValue(Atom atom, sint16& value) + { + value = (sint16) core()->integer(atom); + } + void atomToValue(Atom atom, uint16& value) + { + value = (uint16) AvmCore::integer_u(atom); + } + void atomToValue(Atom atom, sint32& value) + { + value = core()->integer(atom); + } + void atomToValue(Atom atom, uint32& value) + { + value = AvmCore::integer_u(atom); + } + void atomToValue(Atom atom, float& value) + { + value = (float) AvmCore::number_d(atom); + } + void atomToValue(Atom atom, double& value) + { + value = AvmCore::number_d(atom); + } + + Atom valueToAtom(sint16 value) const + { + return core()->intToAtom(value); + } + Atom valueToAtom(uint16 value) const + { + return core()->uintToAtom(value); + } + Atom valueToAtom(sint32 value) const + { + return core()->intToAtom(value); + } + Atom valueToAtom(uint32 value) const + { + return core()->uintToAtom(value); + } + Atom valueToAtom(float value) const + { + return core()->doubleToAtom((double)value); + } + Atom valueToAtom(double value) const + { + return core()->doubleToAtom(value); + } + + void grow(uint32 newCapacity) + { + if (newCapacity > m_capacity) + { + newCapacity = ((newCapacity+kGrowthIncr)/kGrowthIncr)*kGrowthIncr; + T *newArray = new T[newCapacity]; + if (!newArray) + { + toplevel()->throwError(kOutOfMemoryError); + } + if (m_array) + { + memcpy(newArray, m_array, m_length * sizeof(T)); + delete [] m_array; + } + memset(newArray+m_length, 0, (newCapacity-m_capacity) * sizeof(T)); + m_array = newArray; + m_capacity = newCapacity; + } + } + }; + + typedef TypedArrayObject ShortArrayObject; + typedef TypedArrayObject UShortArrayObject; + typedef TypedArrayObject IntArrayObject; + typedef TypedArrayObject UIntArrayObject; + typedef TypedArrayObject FloatArrayObject; + typedef TypedArrayObject DoubleArrayObject; + + class ShortArrayClass : public ClassClosure + { + public: + ShortArrayClass(VTable *vtable); + + ScriptObject *createInstance(VTable *ivtable, ScriptObject *delegate); + + DECLARE_NATIVE_MAP(ShortArrayClass) + }; + + class UShortArrayClass : public ClassClosure + { + public: + UShortArrayClass(VTable *vtable); + + ScriptObject *createInstance(VTable *ivtable, ScriptObject *delegate); + + DECLARE_NATIVE_MAP(UShortArrayClass) + }; + + class IntArrayClass : public ClassClosure + { + public: + IntArrayClass(VTable *vtable); + + ScriptObject *createInstance(VTable *ivtable, ScriptObject *delegate); + + DECLARE_NATIVE_MAP(IntArrayClass) + }; + + class UIntArrayClass : public ClassClosure + { + public: + UIntArrayClass(VTable *vtable); + + ScriptObject *createInstance(VTable *ivtable, ScriptObject *delegate); + + DECLARE_NATIVE_MAP(UIntArrayClass) + }; + + class FloatArrayClass : public ClassClosure + { + public: + FloatArrayClass(VTable *vtable); + + ScriptObject *createInstance(VTable *ivtable, ScriptObject *delegate); + + DECLARE_NATIVE_MAP(FloatArrayClass) + }; + + class DoubleArrayClass : public ClassClosure + { + public: + DoubleArrayClass(VTable *vtable); + + ScriptObject *createInstance(VTable *ivtable, ScriptObject *delegate); + + DECLARE_NATIVE_MAP(DoubleArrayClass) + }; +} + +#endif /* TYPEDARRAYCLASS_INCLUDED */ diff --git a/mozilla/js/tamarin/shell/UIntArray.as b/mozilla/js/tamarin/shell/UIntArray.as new file mode 100644 index 00000000000..573152524a6 --- /dev/null +++ b/mozilla/js/tamarin/shell/UIntArray.as @@ -0,0 +1,40 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +package flash.utils +{ + public class UIntArray + { + public native function get length():uint; + public native function set length(value:uint) + } +} + diff --git a/mozilla/js/tamarin/shell/UShortArray.as b/mozilla/js/tamarin/shell/UShortArray.as new file mode 100644 index 00000000000..c986da79184 --- /dev/null +++ b/mozilla/js/tamarin/shell/UShortArray.as @@ -0,0 +1,40 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +package flash.utils +{ + public class UShortArray + { + public native function get length():uint; + public native function set length(value:uint) + } +} + diff --git a/mozilla/js/tamarin/shell/avmshell.cpp b/mozilla/js/tamarin/shell/avmshell.cpp new file mode 100644 index 00000000000..a6379e8cb31 --- /dev/null +++ b/mozilla/js/tamarin/shell/avmshell.cpp @@ -0,0 +1,1143 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + +#include "avmshell.h" + +#if defined(DARWIN) || defined(AVMPLUS_LINUX) +#include +#include +#endif + +#ifdef WIN32 +#include +#include "dbghelp.h" +bool P4Available(); +#endif + +// Custom new and delete operators +// User-defined operator new. + +static MMgc::FixedMalloc* fm; + +void *operator new(size_t size) +{ + return fm->Alloc(size); +} + +void *operator new[](size_t size) +{ + return fm->Alloc(size); +} + +// User-defined operator delete. +#ifdef _MAC + // CW9 wants the C++ official prototype, which means we must have an empty exceptions list for throw. + // (The fact exceptions aren't on doesn't matter.) - mds, 02/05/04 + void operator delete( void *p) throw() +#else + void operator delete( void *p) +#endif + { + fm->Free(p); + } + +#ifdef _MAC + // CW9 wants the C++ official prototype, which means we must have an empty exceptions list for throw. + // (The fact exceptions aren't on doesn't matter.) - mds, 02/05/04 + void operator delete[]( void *p) throw() +#else + void operator delete[]( void *p ) +#endif + { + fm->Free(p); + } + + +namespace avmshell +{ + #include "toplevel.cpp" + + const int kScriptTimeout = 15; + const int kScriptGracePeriod = 5; + + BEGIN_NATIVE_CLASSES(Shell) + NATIVE_CLASS(abcclass_avmplus_System, SystemClass, ScriptObject) + NATIVE_CLASS(abcclass_avmplus_File, FileClass, ScriptObject) + NATIVE_CLASS(abcclass_avmplus_Domain, DomainClass, DomainObject) + NATIVE_CLASS(abcclass_avmplus_StringBuilder, StringBuilderClass, StringBuilderObject) + NATIVE_CLASS(abcclass_avmplus_JObject, JObjectClass, JObject) + NATIVE_CLASS(abcclass_flash_utils_ByteArray, ByteArrayClass, ByteArrayObject) + NATIVE_CLASS(abcclass_flash_utils_ShortArray, ShortArrayClass, ShortArrayObject) + NATIVE_CLASS(abcclass_flash_utils_UShortArray, UShortArrayClass, UShortArrayObject) + NATIVE_CLASS(abcclass_flash_utils_IntArray, IntArrayClass, IntArrayObject) + NATIVE_CLASS(abcclass_flash_utils_UIntArray, UIntArrayClass, UIntArrayObject) + NATIVE_CLASS(abcclass_flash_utils_FloatArray, FloatArrayClass, FloatArrayObject) + NATIVE_CLASS(abcclass_flash_utils_DoubleArray, DoubleArrayClass, DoubleArrayObject) + NATIVE_CLASS(abcclass_flash_utils_Dictionary, DictionaryClass, DictionaryObject) + END_NATIVE_CLASSES() + + BEGIN_NATIVE_SCRIPTS(Shell) + NATIVE_SCRIPT(0/*abcscript_avmplus_debugger*/, AvmplusScript) + END_NATIVE_SCRIPTS() + + BEGIN_NATIVE_MAP(AvmplusScript) + END_NATIVE_MAP() + + Shell *shell = NULL; + bool show_error = false; + + #ifdef WIN32 + void Shell::computeStackBase() + { + const int kStackMargin = 131072; + + SYSTEM_INFO sysinfo; + GetSystemInfo(&sysinfo); + + int dummy; + int sp = (int)(&dummy); + sp &= ~(sysinfo.dwPageSize-1); + + MEMORY_BASIC_INFORMATION buf; + if (VirtualQuery((void*)sp, &buf, sizeof(buf)) == sizeof(buf)) { + minstack = (uint32)buf.AllocationBase + kStackMargin; + } + } + + void CALLBACK TimeoutProc(UINT uTimerID, + UINT uMsg, + DWORD_PTR dwUser, + DWORD_PTR dw1, + DWORD_PTR dw2) + { + AvmCore *core = (AvmCore*)dwUser; + core->interrupted = true; + } + #else + void Shell::computeStackBase() + { + const int kMaxAvmPlusStack = 512*1024; + int sp; + #ifdef AVMPLUS_PPC + asm("mr %0,r1" : "=r" (sp)); + #elif defined(AVMPLUS_ARM) + asm("mov %0,sp" : "=r" (sp)); + #else + asm("movl %%esp,%0" : "=r" (sp)); + #endif + minstack = sp-kMaxAvmPlusStack; + } + + void alarmProc(int signum) + { + shell->interrupted = true; + } + #endif + + void Shell::usage() + { + printf("avmplus shell " AVMPLUS_VERSION_USER " build " AVMPLUS_BUILD_CODE "\n\n"); + printf("usage: avmplus\n"); + #ifdef DEBUGGER + printf(" [-d] enter debugger on start\n"); + #endif + #ifdef AVMPLUS_PROFILE + printf(" [-Ddprofile] dynamic instruction stats\n"); + printf(" [-Dsprofile] show static instruction stats\n"); + #endif /* AVMPLUS_PROFILE */ + #ifdef _DEBUG + printf(" [-Dgreedy] collect before every allocation\n"); + #endif /* _DEBUG */ + #ifdef DEBUGGER + printf(" [-Dnogc] don't collect\n"); + printf(" [-Dgcstats] generate statistics on gc\n"); + printf(" [-Dnoincgc] don't use incremental collection\n"); + printf(" [-Dastrace N] display AS execution information, where N is [1..4]\n"); + #endif + + #ifdef AVMPLUS_INTERP + printf(" [-Dinterp] do not generate machine code, interpret instead\n"); + #endif /* AVMPLUS_INTERP */ + + #ifdef AVMPLUS_VERBOSE + printf(" [-Dverbose] trace every instruction (verbose!)\n"); + printf(" [-Dbbgraph] output MIR basic block graphs for use with Graphviz\n"); + #endif + + #ifdef AVMPLUS_MIR + #ifdef AVMPLUS_INTERP + printf(" [-Dforcemir] use MIR always, never interp\n"); + #endif /* AVMPLUS_INTERP */ + + printf(" [-Dnodce] disable DCE optimization \n"); + printf(" [-Dnocse] disable CSE optimization \n"); + + #ifdef AVMPLUS_IA32 + printf(" [-Dnosse] use FPU stack instead of SSE2 instructions\n"); + #endif /* AVMPLUS_IA32 */ + #endif + + #ifdef AVMPLUS_VERIFYALL + printf(" [-Dverifyall] verify greedily instead of lazily\n"); + #endif + + printf(" [-Dtimeout] enforce maximum 15 seconds execution\n"); + printf(" [-error] crash opens debug dialog, instead of dumping\n"); + #ifdef AVMPLUS_INTERACTIVE + printf(" [-i] interactive mode\n"); + #endif //AVMPLUS_INTERACTIVE + printf(" [-log]\n"); + printf(" [-- args] args passed to AS3 program\n"); + printf(" [-jargs ... ;] args passed to Java runtime\n"); + printf(" filename.abc ...\n"); + printf(" [--] application args\n"); + exit(1); + } + + void Shell::stackOverflow(MethodEnv *env) + { + if (inStackOverflow) + { + // Already handling a stack overflow, so do not + // re-enter handler. + return; + } + + // Temporarily disable stack overflow checks + // so that we can construct an exception object. + // There should be plenty of margin before the + // actual stack bottom to do this. + inStackOverflow = true; + + Toplevel *toplevel = env->vtable->toplevel; + + Stringp errorMessage = getErrorMessage(kStackOverflowError); + Atom args[2] = { nullObjectAtom, errorMessage->atom() }; + Atom errorAtom = toplevel->errorClass()->construct(1, args); + Exception *exception = new (GetGC()) Exception(errorAtom + #ifdef DEBUGGER + ,this + #endif + ); + + // Restore stack overflow checks + inStackOverflow = false; + + // Throw the stack overflow exception + throwException(exception); + } + + void Shell::interrupt(MethodEnv *env) + { + interrupted = false; + + Toplevel *toplevel = env->vtable->toplevel; + + if (gracePeriod) { + // This script has already had its chance; it violated + // the grace period. + // Throw an exception it cannot catch. + Stringp errorMessage = getErrorMessage(kScriptTerminatedError); + Atom args[2] = { nullObjectAtom, errorMessage->atom() }; + Atom errorAtom = toplevel->errorClass()->construct(1, args); + Exception *exception = new (GetGC()) Exception(errorAtom + #ifdef DEBUGGER + ,this + #endif + ); + exception->flags |= Exception::EXIT_EXCEPTION; + throwException(exception); + } + + // Give the script an additional grace period to + // clean up, and throw an exception. + gracePeriod = true; + + #ifdef WIN32 + timeSetEvent(kScriptGracePeriod*1000, + kScriptGracePeriod*1000, + (LPTIMECALLBACK)TimeoutProc, + (DWORD_PTR)this, + TIME_ONESHOT); + #else + #ifndef AVMPLUS_ARM // TODO AVMPLUS_ARM + alarm(kScriptGracePeriod); + #endif + #endif + + toplevel->throwError(kScriptTimeoutError); + } + + void Shell::initShellPool() + { + AbstractFunction *nativeMethods[toplevel_abc_method_count]; + NativeClassInfo *nativeClasses[toplevel_abc_class_count]; + NativeScriptInfo *nativeScripts[toplevel_abc_script_count]; + + memset(nativeMethods, 0, sizeof(AbstractFunction*)*toplevel_abc_method_count); + memset(nativeClasses, 0, sizeof(NativeClassInfo*)*toplevel_abc_class_count); + memset(nativeScripts, 0, sizeof(NativeScriptInfo*)*toplevel_abc_script_count); + + initNativeTables(classEntries, scriptEntries, + nativeMethods, nativeClasses, nativeScripts); + + avmplus::ScriptBuffer code = newScriptBuffer(toplevel_abc_length); + memcpy(code.getBuffer(), toplevel_abc_data, toplevel_abc_length); + shellPool = parseActionBlock(code, 0, NULL, builtinDomain, nativeMethods, nativeClasses, nativeScripts); + } + + Toplevel* Shell::initShellBuiltins() + { + // Initialize a new Toplevel. This will also create a new + // DomainEnv based on the builtinDomain. + Toplevel* toplevel = initTopLevel(); + + // Initialize the shell builtins in the new Toplevel + handleActionPool(shellPool, + toplevel->domainEnv(), + toplevel, + NULL); + + return toplevel; + } + + Shell::Shell(MMgc::GC *gc) : AvmCore(gc) + { + #ifdef DEBUGGER + debugCLI = NULL; + #endif + + systemClass = NULL; + + gracePeriod = false; + inStackOverflow = false; + + consoleOutputStream = new (gc) ConsoleOutputStream(); + setConsoleStream(consoleOutputStream); + + computeStackBase(); + } + + bool Shell::executeProjector(int argc, char *argv[], int& exitCode) + { + TRY(this, kCatchAction_ReportAsError) + { + uint8 header[8]; + + char executablePath[256]; + + #ifdef WIN32 + GetModuleFileName(NULL, executablePath, sizeof(executablePath)); + #else + strncpy(executablePath, argv[0], sizeof(executablePath)); + #endif + + FileInputStream file(executablePath); + if (!file.valid()) + { + return false; + } + + file.seek(file.length() - 8); + file.read(header, 8); + + // Check the magic number + if (header[0] != 0x56 && + header[1] != 0x34 && + header[2] != 0x12 && + header[3] != 0xFA) + { + return false; + } + + int abcLength = (header[4] | + header[5]<<8 | + header[6]<<16 | + header[7]<<24); + + ScriptBuffer code = newScriptBuffer(abcLength); + file.seek(file.length() - 8 - abcLength); + file.read(code.getBuffer(), abcLength); + + initBuiltinPool(); + initShellPool(); + + #ifdef DEBUGGER + // Create the debugger + debugCLI = new (GetGC()) DebugCLI(this); + debugger = debugCLI; + + // Create the profiler + profiler = new Profiler(GetGC()); + #endif + + SystemClass::user_argc = argc-1; + SystemClass::user_argv = &argv[1]; + + // init toplevel internally + Toplevel* toplevel = initShellBuiltins(); + + // Create a new Domain for the user code + Domain* domain = new (GetGC()) Domain(this, + builtinDomain); + + // Return a new DomainEnv for the user code + DomainEnv* domainEnv = new (GetGC()) DomainEnv(this, + domain, + toplevel->domainEnv()); + + ShellCodeContext* codeContext = new (GetGC()) ShellCodeContext(); + codeContext->domainEnv = domainEnv; + + // parse new bytecode + handleActionBlock(code, 0, domainEnv, toplevel, NULL, NULL, NULL, codeContext); + + #ifdef DEBUGGER + delete profiler; + #endif + } + CATCH(Exception *exception) + { + #ifdef DEBUGGER + if (!(exception->flags & Exception::SEEN_BY_DEBUGGER)) + { + console << string(exception->atom) << "\n"; + } + if (exception->getStackTrace()) { + console << exception->getStackTrace()->format(this) << '\n'; + } + delete profiler; + #else + // [ed] always show error, even in release mode, + // see bug #121382 + console << string(exception->atom) << "\n"; + #endif + exit(1); + } + END_CATCH + END_TRY + + #ifdef AVMPLUS_PROFILE + dump(); + #endif + + exitCode = 0; + return true; + } + + int Shell::main(int argc, char *argv[]) + { + TRY(this, kCatchAction_ReportAsError) + { + #ifdef WIN32 + if (!P4Available()) { + sse2 = false; + } + #endif + + int exitCode = 0; + if (executeProjector(argc, argv, exitCode)) + { + return exitCode; + } + + if (argc < 2) { + usage(); + } + + int filenamesPos = -1; + int endFilenamePos = -1; + char *filename = NULL; + bool do_log = false; + bool do_debugger = false; + bool do_interactive = false; +#ifdef AVMPLUS_VERBOSE + bool do_verbose = false; +#endif + + for (int i=1; igreedy = true; + #endif /* _DEBUG */ + + #ifdef AVMPLUS_PROFILE + } else if (!strcmp(arg+2, "dprofile")) { + dprof.dprofile = true; + } else if (!strcmp(arg+2, "sprofile")) { + sprof.sprofile = true; + #endif /* AVMPLUS_PROFILE */ + + #ifdef DEBUGGER + } else if (!strcmp(arg+2, "gcstats")) { + GetGC()->gcstats = true; + } else if (!strcmp(arg+2, "nogc")) { + GetGC()->nogc = true; + } else if (!strcmp(arg+2, "noincgc")) { + GetGC()->incremental = false; + } else if (!strcmp(arg+2, "astrace")) { + avmplus::Debugger::astrace = (avmplus::Debugger::TraceLevel) strtol(argv[++i], 0, 10); + #endif /* DEBUGGER */ + #ifdef AVMPLUS_INTERP + } else if (!strcmp(arg+2, "interp")) { + turbo = false; + #endif /* AVMPLUS_INTERP */ + #ifdef AVMPLUS_VERBOSE + } else if (!strcmp(arg+2, "verbose")) { + do_verbose = true; + #endif + + #ifdef AVMPLUS_MIR + #ifdef AVMPLUS_INTERP + } else if (!strcmp(arg+2, "forcemir")) { + forcemir = true; + #endif /* AVMPLUS_INTERP */ + + } else if (!strcmp(arg+2, "nodce")) { + dceopt = false; + + } else if (!strcmp(arg+2, "nocse")) { + cseopt = false; + + #ifdef AVMPLUS_VERBOSE + } else if (!strcmp(arg+2, "bbgraph")) { + bbgraph = true; // generate basic block graph (only valid with mir switch) + #endif + #endif /* AVMPLUS_MIR */ + + } else { + usage(); + } + } else if (!strcmp(arg, "-log")) { + do_log = true; + #ifdef AVMPLUS_INTERACTIVE + } else if (!strcmp(arg, "-i")) { + do_interactive = true; + #endif //AVMPLUS_INTERACTIVE + } + else if (!strcmp(arg, "-error")) { + show_error = true; + #ifdef WIN32 + SetErrorMode(0); // set to default + #endif // WIN32 + } + else if (!strcmp(arg, "-jargs")) { + // all the following args until the semi colon is for java. + //@todo fix up this hard limit + bool first = true; + Java::startup_options = new char[256]; + memset(Java::startup_options, 0, 256); + + for(i++; iactivate(); + debugCLI->stepInto(); + } + #endif + + // start the 15 second timeout if applicable + if (interrupts) { + #ifdef WIN32 + timeSetEvent(kScriptTimeout*1000, + kScriptTimeout*1000, + (LPTIMECALLBACK)TimeoutProc, + (DWORD_PTR)this, + TIME_ONESHOT); + #else + #ifndef AVMPLUS_ARM // TODO AVMPLUS_ARM + signal(SIGALRM, alarmProc); + alarm(kScriptTimeout); + #endif + #endif + } + + if(endFilenamePos == -1) + endFilenamePos = argc; + SystemClass::user_argc = argc-endFilenamePos-1; + SystemClass::user_argv = &argv[endFilenamePos+1]; + + // init toplevel internally + Toplevel* toplevel = initShellBuiltins(); + + // Create a new Domain for the user code + Domain* domain = new (GetGC()) Domain(this, + builtinDomain); + + // Return a new DomainEnv for the user code + DomainEnv* domainEnv = new (GetGC()) DomainEnv(this, + domain, + toplevel->domainEnv()); + + ShellCodeContext* lastCodeContext = 0; + + // execute each abc file + for (int i=filenamesPos; filename && i < endFilenamePos; i++) + { + filename = argv[i]; + + #ifdef AVMPLUS_VERBOSE + if (verbose) { + console << "run " << filename << "\n"; + } + #endif + + FileInputStream f(filename); + bool isValid = f.valid(); + if (!isValid) { + fprintf(stderr, "cannot open file: %s\n", filename); + #ifdef DEBUGGER + delete profiler; + #endif + if (!do_interactive) + return(1); + } + + ShellCodeContext* codeContext = new (GetGC()) ShellCodeContext(); + codeContext->domainEnv = domainEnv; + + // parse new bytecode + if (isValid) + { + ScriptBuffer code = newScriptBuffer(f.available()); + f.read(code.getBuffer(), f.available()); + handleActionBlock(code, 0, domainEnv, toplevel, NULL, NULL, NULL, codeContext); + } + + lastCodeContext = codeContext; + } + + #ifdef MMGC_COUNTERS + console << "\nGC stats\n"; + console << "mark item " << MMgc::GC::MarkItemCount << "\n"; + console << "mark null ptr " << MMgc::GC::marknullCount << "\n"; + console << "mark alloc " << MMgc::GC::markallocCount << "\n"; + console << "mark large " << MMgc::GC::marklargeCount << "\n"; + console << "mark skip " << MMgc::GC::markskipCount << "\n"; + console << "TrapWriteCount " << MMgc::GC::TrapWriteCount << "\n"; + + console << "\nGCAlloc stats\n"; + console << "SweepBlockCount " << MMgc::GCAlloc::SweepBlockCount << "\n"; + console << "AllocCount " << MMgc::GCAlloc::AllocCount << "\n"; + console << "FreeItemCount " << MMgc::GCAlloc::FreeItemCount << "\n"; + #endif + + #ifdef AVMPLUS_INTERACTIVE + if (do_interactive) + { + enum { kMaxCommandLine = 1024 }; + char commandLine[kMaxCommandLine]; + enum { kMaxFileName = 1024 }; + char fileName[kMaxFileName]; + char imports[kMaxCommandLine]; + strcpy(imports, " "); + + // some defaults + addToImports(imports, "C:\\src\\farm\\main\\as\\lib\\shell.abc"); + addToImports(imports, "C:\\src\\farm\\main\\as\\lib\\global.abc"); + + STARTUPINFO si; + PROCESS_INFORMATION pi; + + while(do_interactive) + { + console << "(avmplus) "; + fflush(stdout); + fgets(commandLine, kMaxCommandLine, stdin); + + commandLine[strlen(commandLine)-1] = 0; + + // build up the file that we are going to compile + bool compile = true; + bool exec = true; + fileName[0] = '\0'; + if (strstr(commandLine, ".run ") == commandLine) + { + // arg + strcpy(fileName, &commandLine[5]); + + // search for .as extension + const char* dotAt = strrchr(fileName, '.'); + bool fail = true; + if (dotAt) + { + if (strcmp(dotAt, ".abc") == 0) + { + compile = false; + fail = false; + } + else if (strcmp(dotAt, ".as") == 0) + { + fail = false; + } + } + + if (fail) + { + console << "only .as and .abc files are supported \n"; + continue; + } + } + else if (strstr(commandLine, ".import ") == commandLine) + { + // add to the import list + strcpy(fileName, &commandLine[8]); + compile = false; + exec = false; + + if (!addToImports(imports, fileName)) + { + console << "file does not exist; not added to import list \n"; + } + console << imports << "\n"; + } + else if (strstr(commandLine, ".quit") == commandLine) + { + return 0; + } + else if (commandLine[0] == '\0' || (strstr(commandLine, ".help") == commandLine) ) + { + console << "ActionScript source can be directly entered on the command line.\nIt will be compiled and executed once the enter key is pressed.\nThe following directives are also recognized\n" ; + console << ".run [f.as|f.abc] - runs f, compiles f.as first if required\n" ; + console << ".import f - add f to the -import list for compiling \n" ; + console << ".quit - exits this shell \n" ; + console << ".help - displays help information \n" ; + continue; + } + else + { + // put our command line contents in a file + strcpy(fileName, "___file_for_io.as"); + FILE* f = fopen(fileName , "w"); + if (!f) + { + console << "i/o error \n"; + return 1; + } + + fputs(commandLine, f); + fclose(f); + } + + // set up for the compile if needed + if (compile) + { + // Set the bInheritHandle flag so pipe handles are inherited. + SECURITY_ATTRIBUTES saAttr; + saAttr.nLength = sizeof(SECURITY_ATTRIBUTES); + saAttr.bInheritHandle = TRUE; + saAttr.lpSecurityDescriptor = NULL; + + HANDLE pRd, pWr; + CreatePipe(&pRd, &pWr, &saAttr, 64*kMaxCommandLine); + SetHandleInformation( pRd, HANDLE_FLAG_INHERIT, 0); // don't inherit read portion; only allow writes from child proc + SetHandleInformation( GetStdHandle(STD_INPUT_HANDLE), HANDLE_FLAG_INHERIT, 0); // don't inherit stdin + + ZeroMemory( &si, sizeof(si) ); + si.cb = sizeof(si); + ZeroMemory( &pi, sizeof(pi) ); + si.hStdError = pWr; + si.hStdOutput = pWr; + si.hStdInput = GetStdHandle(STD_INPUT_HANDLE); + si.dwFlags = STARTF_USESTDHANDLES; + + // now compile and wait + commandLine[0] = '\0'; + strcpy(commandLine, "asc.exe -debug "); + strcat(commandLine, imports); + strcat(commandLine, fileName); + DWORD err = CreateProcess(0, commandLine, 0,0,TRUE,0,0,0, &si, &pi); + if (err) + { + // Wait until child process exits. + WaitForSingleObject( pi.hProcess, 20000 ); + } + else + { + console << "failed to compile err=0x"; + console.writeHexDWord(GetLastError()); + console << "\n"; + exec = false; + } + + // Close process and thread handles. + CloseHandle( pi.hProcess ); + CloseHandle( pi.hThread ); + + // now check the compile + CloseHandle(pWr); // Close the write end of the pipe before reading from the read end of the pipe. + commandLine[0] = '\0'; + DWORD dwRead = 0; + ReadFile( pRd, commandLine, kMaxCommandLine, &dwRead, NULL); + if (dwRead > 0) commandLine[dwRead] = '\0'; + if ( !strstr(commandLine, "bytes written") ) + { + // failed compile + console << commandLine; + + // dump the rest of the message + for(;;) + { + if (!ReadFile( pRd, commandLine, kMaxCommandLine, &dwRead, NULL) || dwRead == 0) + break; + + console << commandLine; + } + exec = false; + console << "\n"; + } + + // now run the abc + int afterDot = strlen(fileName) - 2; + strcpy(&fileName[afterDot], "abc"); + } + + if (exec) + { + FileInputStream fl(fileName); + bool isValid = fl.valid(); + if (isValid) + { + TRY(this, kCatchAction_ReportAsError) + { + ScriptBuffer code = newScriptBuffer(fl.available()); + fl.read(code.getBuffer(), fl.available()); + handleActionBlock(code, 0, domainEnv, toplevel, NULL, NULL, NULL, lastCodeContext); + } + CATCH(Exception *exception) + { + #ifdef DEBUGGER + if (!(exception->flags & Exception::SEEN_BY_DEBUGGER)) + { + console << string(exception->atom) << "\n"; + } + if (exception->getStackTrace()) { + console << exception->getStackTrace()->format(this) << '\n'; + } + #else + // [ed] always show error, even in release mode, + // see bug #121382 + console << string(exception->atom) << "\n"; + #endif + } + END_CATCH + END_TRY + } + else + { + console << "can't find " << fileName << "\n"; + } + } + } + } + #endif //AVMPLUS_INTERACTIVE + + #ifdef DEBUGGER + delete profiler; + #endif + } + CATCH(Exception *exception) + { + #ifdef DEBUGGER + if (!(exception->flags & Exception::SEEN_BY_DEBUGGER)) + { + console << string(exception->atom) << "\n"; + } + if (exception->getStackTrace()) { + console << exception->getStackTrace()->format(this) << '\n'; + } + delete profiler; + #else + // [ed] always show error, even in release mode, + // see bug #121382 + console << string(exception->atom) << "\n"; + #endif + exit(1); + } + END_CATCH + END_TRY + + #ifdef AVMPLUS_PROFILE + dump(); + #endif + if (Java::startup_options) delete Java::startup_options; + return 0; + } + + #ifdef AVMPLUS_INTERACTIVE + int Shell::addToImports(char* imports, char* addition) + { + int worked = 0; + if (addition && addition[0] != '\0') + { + FileInputStream fl(addition); + if (fl.valid()) + { + strcat(imports, " "); + strcat(imports, " -import \""); + strcat(imports, addition); + strcat(imports, "\" "); + worked = 1; + } + } + return worked; + } + #endif //AVMPLUS_INTERACTIVE +} + +int _main(int argc, char *argv[]) +{ + MMgc::GCHeap::Init(); + MMgc::FixedMalloc::Init(); + + fm = MMgc::FixedMalloc::GetInstance(); + MMgc::GCHeap* heap = MMgc::GCHeap::GetGCHeap(); + + // memory zero'ing check +/* int *foo = new int[2]; + AvmAssert(memcmp(foo, "\0\0\0\0\0\0\0\0\0\0\0\0", 2*sizeof(int)) == 0); + delete foo;*/ + + int exitCode = 0; + { + MMgc::GC gc(heap); + avmshell::shell = new avmshell::Shell(&gc); + exitCode = avmshell::shell->main(argc, argv); + delete avmshell::shell; + } + + MMgc::FixedMalloc::Destroy(); + MMgc::GCHeap::Destroy(); + return exitCode; +} + +#ifdef AVMPLUS_WIN32 +unsigned long CrashFilter(LPEXCEPTION_POINTERS pException, int exceptionCode) +{ + unsigned long result; + if ((result = UnhandledExceptionFilter(pException)) != EXCEPTION_EXECUTE_HANDLER) + { + return result; + } + else if (avmshell::show_error) + { + // if -error option dont do a dump + return EXCEPTION_CONTINUE_SEARCH; + } + + printf("avmplus crash: exception 0x%08lX occurred\n", exceptionCode); + + typedef BOOL (WINAPI *MINIDUMP_WRITE_DUMP)( + HANDLE hProcess, + DWORD ProcessId, + HANDLE hFile, + MINIDUMP_TYPE DumpType, + PMINIDUMP_EXCEPTION_INFORMATION ExceptionParam, + PMINIDUMP_USER_STREAM_INFORMATION UserStreamParam, + PMINIDUMP_CALLBACK_INFORMATION CallbackParam + ); + + HMODULE hDbgHelp = LoadLibrary("dbghelp.dll"); + MINIDUMP_WRITE_DUMP MiniDumpWriteDump_ = (MINIDUMP_WRITE_DUMP)GetProcAddress(hDbgHelp, + "MiniDumpWriteDump"); + + if (MiniDumpWriteDump_) + { + MINIDUMP_EXCEPTION_INFORMATION M; + const char DumpPath[] = "avmplusCrash.dmp"; + + M.ThreadId = GetCurrentThreadId(); + M.ExceptionPointers = pException; + M.ClientPointers = 0; + + printf("Writing minidump crash log to %s\n", DumpPath); + + HANDLE hDumpFile = CreateFile(DumpPath, GENERIC_WRITE, 0, + NULL, CREATE_ALWAYS, + FILE_ATTRIBUTE_NORMAL, NULL); + + MiniDumpWriteDump_(GetCurrentProcess(), + GetCurrentProcessId(), + hDumpFile, + MiniDumpNormal, + (pException) ? &M : NULL, NULL, NULL); + + CloseHandle(hDumpFile); + } + else + { + printf("minidump not available, no crash log written.\n"); + } + + return result; +} + +int main(int argc, char *argv[]) +{ + SetErrorMode(SEM_NOGPFAULTERRORBOX); + int code = 0; + __try + { + code = _main(argc, argv); + } + __except(CrashFilter(GetExceptionInformation(), GetExceptionCode())) + { + code = -1; + } + if (avmshell::show_error) printf("error %d", code); + return code; +} +#else + +#ifdef AVMPLUS_ARM +// TODO this is a hack until we learn how to determine stack top +// in ARM +int StackTop; +#endif + +#ifdef AVMPLUS_IA32 +// TODO this is a hack until we learn how to determine stack top +// in IA-32 System V ABI +int StackTop; +#endif + +int main(int argc, char *argv[]) +{ + #ifdef AVMPLUS_ARM + int sp; + asm("mov %0,sp" : "=r" (sp)); + StackTop = sp; + #elif defined AVMPLUS_IA32 + asm("movl %%esp,%0\n" : "=r" (StackTop)); + #endif + +#ifdef AVMPLUS_MACH_EXCEPTIONS + GenericGuard::staticInit(); +#endif + int code = _main(argc, argv); + if (avmshell::show_error) printf("error %d", code); + +#ifdef AVMPLUS_MACH_EXCEPTIONS + GenericGuard::staticDestroy(); +#endif + + return code; +} +#endif + + diff --git a/mozilla/js/tamarin/shell/avmshell.h b/mozilla/js/tamarin/shell/avmshell.h new file mode 100644 index 00000000000..9e6cf9e248d --- /dev/null +++ b/mozilla/js/tamarin/shell/avmshell.h @@ -0,0 +1,151 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +#ifndef __avmshell__ +#define __avmshell__ + +#include +#include + +#include "avmplus.h" + +#if defined(AVMPLUS_WIN32) && defined(_DEBUG) +// interactive shell only supported for windwows debug builds right now +#define AVMPLUS_INTERACTIVE +#endif + +using namespace avmplus; + +namespace avmshell +{ + class ByteArrayObject; + class ByteArray; +} + +namespace avmplus +{ + class Dictionary; +} + +#include "FileInputStream.h" +#include "ConsoleOutputStream.h" +#include "SystemClass.h" +#include "StringBuilderClass.h" +#include "FileClass.h" +#include "DomainClass.h" +#include "DebugCLI.h" +#include "Profiler.h" +#include "DataIO.h" +#include "ByteArrayGlue.h" +#include "TypedArrayClass.h" +#include "DictionaryGlue.h" +#include "JavaGlue.h" + +#pragma warning(disable:4996) + +namespace avmplus +{ + namespace NativeID + { + #include "toplevel.h" + } +} + +namespace avmshell +{ + class ShellCodeContext : public CodeContext + { + public: + DWB(DomainEnv*) domainEnv; +#ifdef DEBUGGER + virtual Toplevel *toplevel() const { return domainEnv->toplevel(); } +#endif + }; + + /** + * A command-line shell around the avmplus core. This can be + * used to execute and debug .abc files from the command line. + */ + class Shell : public AvmCore + { + public: + Shell(MMgc::GC *gc); + void usage(); + int main(int argc, char *argv[]); + + void interrupt(MethodEnv *env); + void stackOverflow(MethodEnv *env); + + void initShellPool(); + Toplevel* initShellBuiltins(); + + void setEnv(Toplevel *toplevel, int argc, char *argv[]); + + SystemClass* systemClass; + + private: + DECLARE_NATIVE_CLASSES() + DECLARE_NATIVE_SCRIPTS() + + ConsoleOutputStream *consoleOutputStream; + bool gracePeriod; + bool inStackOverflow; + PoolObject* shellPool; + + bool executeProjector(int argc, char *argv[], int& exitCode); + + void computeStackBase(); + + #ifdef DEBUGGER + DebugCLI *debugCLI; + #endif + + // for interactive + #ifdef AVMPLUS_INTERACTIVE + int addToImports(char* imports, char* addition); + #endif //AVMPLUS_INTERACTIVE + }; + + class AvmplusScript : public ScriptObject + { + + public: + AvmplusScript(VTable *vtable, ScriptObject* delegate) + : ScriptObject(vtable, delegate) + { + } + + + DECLARE_NATIVE_SCRIPT(AvmplusScript) + }; +} + +#endif /* __avmshell__ */ diff --git a/mozilla/js/tamarin/shell/genericzlib.h b/mozilla/js/tamarin/shell/genericzlib.h new file mode 100644 index 00000000000..fc29d238f97 --- /dev/null +++ b/mozilla/js/tamarin/shell/genericzlib.h @@ -0,0 +1,194 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 1993-2001 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + + +#ifndef GENERIC_ZLIB_H +#define GENERIC_ZLIB_H + +namespace avmshell +{ + +//#include "platformutils.h" +#define PLAYERASSERT AvmAssert +#include "zlib.h" + + +inline bool PlatformZlibInflate( + const U8* pbCompressed, + int nbCompressed, + U8* pbDecompressedOut, + int* pnbDecompressedOut + ) +{ + PLAYERASSERT(nbCompressed > 0); + PLAYERASSERT(*pnbDecompressedOut >= nbCompressed); + PLAYERASSERT(sizeof(uLongf) == sizeof(int)); // Ensure cast is safe + + int error = uncompress( + pbDecompressedOut, + (uLongf*) pnbDecompressedOut, + pbCompressed, + nbCompressed + ); + + PLAYERASSERT(error == Z_OK); + return (error == Z_OK); +} + + +///////////////////////////////////////////////////////////////////////////// + + +class PlatformZlibStream +{ +public: + inline PlatformZlibStream(); + inline ~PlatformZlibStream(); + + // + // Set compressed input stream + // + inline void SetNextIn(const U8* pbCompressed); // set next input byte + inline void SetAvailIn(int nb); // set number of bytes available at next_in + inline int AvailIn(); // get number of bytes available at next_in + + // + // Try decompressing some bytes + // + inline bool Inflate(); // returns false at end of stream! + inline int InflateWithStatus(); // returns the Z_* error code instead of true/false + + // + // Get decompressed output stream + // + inline void SetNextOut(U8* pbDecompressed); // set next output byte should be put there + inline U8* NextOut(); // get next output byte should be put there + + inline void SetAvailOut(int nb); // set remaining free space at next_out + inline int AvailOut(); // get remaining free space at next_out + + inline int TotalOut(); // get total nb of bytes output so far + +private: + z_stream m_zstream; +}; + + +///////////////////////////////////////////////////////////////////////////// + + +PlatformZlibStream::PlatformZlibStream() +{ + memset(&m_zstream, 0, sizeof m_zstream); + int error = inflateInit(&m_zstream); + (void)error; + PLAYERASSERT(error == Z_OK); +} + + +PlatformZlibStream::~PlatformZlibStream() +{ + int error = inflateEnd(&m_zstream); + (void)error; + PLAYERASSERT(error == Z_OK); +} + + +void PlatformZlibStream::SetNextIn(const U8* pbCompressed) +{ + m_zstream.next_in = (Bytef*) pbCompressed; +} + + +void PlatformZlibStream::SetAvailIn(int nb) +{ + PLAYERASSERT(nb >= 0); + m_zstream.avail_in = nb; +} + + +int PlatformZlibStream::AvailIn() +{ + PLAYERASSERT(m_zstream.avail_in >= 0); + return m_zstream.avail_in; +} + + +bool PlatformZlibStream::Inflate() +{ + int error = inflate(&m_zstream, Z_NO_FLUSH); + PLAYERASSERT(error == Z_OK || error == Z_STREAM_END); + return (error == Z_OK); +} + +int PlatformZlibStream::InflateWithStatus() +{ + return inflate(&m_zstream, Z_NO_FLUSH); +} + + +void PlatformZlibStream::SetNextOut(U8* pbDecompressed) +{ + m_zstream.next_out = (Bytef*) pbDecompressed; +} + + +U8* PlatformZlibStream::NextOut() +{ + return m_zstream.next_out; +} + + +void PlatformZlibStream::SetAvailOut(int nb) +{ + PLAYERASSERT(nb >= 0); + m_zstream.avail_out = nb; +} + + +int PlatformZlibStream::AvailOut() +{ + PLAYERASSERT(m_zstream.avail_out >= 0); + return m_zstream.avail_out; +} + + +int PlatformZlibStream::TotalOut() +{ + PLAYERASSERT(m_zstream.total_out >= 0); + return m_zstream.total_out; +} + +///////////////////////////////////////////////////////////////////////////// +} + +#endif // GENERIC_ZLIB_H diff --git a/mozilla/js/tamarin/shell/toplevel.as b/mozilla/js/tamarin/shell/toplevel.as new file mode 100644 index 00000000000..a57c0e5f6ae --- /dev/null +++ b/mozilla/js/tamarin/shell/toplevel.as @@ -0,0 +1,105 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +package avmplus +{ + public class System + { + public native static function exit(status:int):void + public native static function exec(command:String):int + public native static function getAvmplusVersion():String + public native static function trace(a:Array):void + public native static function write(s:String):void + public native static function debugger():void + public native static function isDebugger():Boolean + public native static function getTimer():uint + private native static function getArgv():Array + public static const argv:Array = getArgv(); + public native static function readLine():String + } + + public class File + { + public native static function exists(filename:String):String; + public native static function read(filename:String):String; + public native static function write(filename:String, data:String):void; + } + + public function debugger() + { + System.debugger() + } +} + +// The flash.system package is present so identical ATS test media can be used +// in the command-line VM and the Player +package flash.system +{ + import avmplus.*; + + public final class Capabilities + { + public static function get playerType():String { return "AVMPlus"; } + public static function get isDebugger():Boolean { return System.isDebugger(); } + } +} + +package { + + import avmplus.* + + public function getClassByName(name:String):Class + { + return Domain.currentDomain.getClass(name); + } + + // nonstandard extensions to ECMAScript + public function print(...s) + { + System.trace(s) + } + + // nonstandard Flash Player extensions + public function trace(...s) + { + System.trace(s) + } + + public function getTimer():uint + { + return System.getTimer() + } + + public function readLine():String + { + return System.readLine() + } +} diff --git a/mozilla/js/tamarin/shell/toplevel.cpp b/mozilla/js/tamarin/shell/toplevel.cpp new file mode 100644 index 00000000000..6640bccae07 --- /dev/null +++ b/mozilla/js/tamarin/shell/toplevel.cpp @@ -0,0 +1,312 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +const int toplevel_abc_length = 4403; +const int toplevel_abc_method_count = 137; +const int toplevel_abc_class_count = 15; +const int toplevel_abc_script_count = 13; +static unsigned char toplevel_abc_data[4403] = { +0x10, 0x00, 0x2e, 0x00, 0x02, 0x00, 0x00, 0x02, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xef, 0x41, +0x86, 0x01, 0x08, 0x72, 0x65, 0x61, 0x64, 0x4c, 0x69, 0x6e, 0x65, 0x0d, 0x74, 0x6f, 0x70, 0x6c, +0x65, 0x76, 0x65, 0x6c, 0x2e, 0x61, 0x73, 0x24, 0x31, 0x00, 0x07, 0x61, 0x76, 0x6d, 0x70, 0x6c, +0x75, 0x73, 0x06, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x08, 0x67, 0x65, 0x74, 0x54, 0x69, 0x6d, +0x65, 0x72, 0x04, 0x75, 0x69, 0x6e, 0x74, 0x05, 0x74, 0x72, 0x61, 0x63, 0x65, 0x06, 0x44, 0x6f, +0x6d, 0x61, 0x69, 0x6e, 0x0d, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x44, 0x6f, 0x6d, 0x61, +0x69, 0x6e, 0x08, 0x67, 0x65, 0x74, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x05, 0x43, 0x6c, 0x61, 0x73, +0x73, 0x08, 0x64, 0x65, 0x62, 0x75, 0x67, 0x67, 0x65, 0x72, 0x0e, 0x61, 0x76, 0x6d, 0x70, 0x6c, +0x75, 0x73, 0x3a, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x04, 0x61, 0x72, 0x67, 0x76, 0x07, 0x67, +0x65, 0x74, 0x41, 0x72, 0x67, 0x76, 0x06, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x04, 0x76, 0x6f, +0x69, 0x64, 0x03, 0x69, 0x6e, 0x74, 0x05, 0x41, 0x72, 0x72, 0x61, 0x79, 0x07, 0x42, 0x6f, 0x6f, +0x6c, 0x65, 0x61, 0x6e, 0x0a, 0x69, 0x73, 0x44, 0x65, 0x62, 0x75, 0x67, 0x67, 0x65, 0x72, 0x04, +0x65, 0x78, 0x65, 0x63, 0x11, 0x67, 0x65, 0x74, 0x41, 0x76, 0x6d, 0x70, 0x6c, 0x75, 0x73, 0x56, +0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x04, 0x65, 0x78, 0x69, 0x74, 0x05, 0x77, 0x72, 0x69, 0x74, +0x65, 0x06, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x0c, 0x61, 0x76, 0x6d, 0x70, 0x6c, 0x75, 0x73, +0x3a, 0x46, 0x69, 0x6c, 0x65, 0x06, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x04, 0x72, 0x65, 0x61, +0x64, 0x04, 0x46, 0x69, 0x6c, 0x65, 0x19, 0x66, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x73, 0x79, 0x73, +0x74, 0x65, 0x6d, 0x3a, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, +0x07, 0x41, 0x56, 0x4d, 0x50, 0x6c, 0x75, 0x73, 0x0c, 0x66, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x73, +0x79, 0x73, 0x74, 0x65, 0x6d, 0x0a, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, +0x0c, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x05, 0x70, 0x72, +0x69, 0x6e, 0x74, 0x0e, 0x67, 0x65, 0x74, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x42, 0x79, 0x4e, 0x61, +0x6d, 0x65, 0x0e, 0x61, 0x76, 0x6d, 0x70, 0x6c, 0x75, 0x73, 0x3a, 0x44, 0x6f, 0x6d, 0x61, 0x69, +0x6e, 0x0b, 0x66, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x75, 0x74, 0x69, 0x6c, 0x73, 0x09, 0x42, 0x79, +0x74, 0x65, 0x41, 0x72, 0x72, 0x61, 0x79, 0x09, 0x6c, 0x6f, 0x61, 0x64, 0x42, 0x79, 0x74, 0x65, +0x73, 0x0b, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x61, 0x73, 0x24, 0x32, 0x08, 0x72, 0x65, +0x61, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x04, 0x6c, 0x6f, 0x61, 0x64, 0x15, 0x61, 0x76, 0x6d, 0x70, +0x6c, 0x75, 0x73, 0x3a, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, +0x72, 0x06, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x12, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x42, +0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x2e, 0x61, 0x73, 0x24, 0x33, 0x07, 0x72, 0x65, 0x76, 0x65, +0x72, 0x73, 0x65, 0x06, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x06, 0x6c, 0x65, 0x6e, 0x67, 0x74, +0x68, 0x06, 0x63, 0x68, 0x61, 0x72, 0x41, 0x74, 0x09, 0x73, 0x65, 0x74, 0x43, 0x68, 0x61, 0x72, +0x41, 0x74, 0x0c, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x68, 0x61, 0x72, 0x41, 0x74, 0x07, +0x69, 0x6e, 0x64, 0x65, 0x78, 0x4f, 0x66, 0x09, 0x73, 0x75, 0x62, 0x73, 0x74, 0x72, 0x69, 0x6e, +0x67, 0x08, 0x63, 0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x07, 0x72, 0x65, 0x70, 0x6c, 0x61, +0x63, 0x65, 0x0a, 0x63, 0x68, 0x61, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x41, 0x74, 0x0e, 0x65, 0x6e, +0x73, 0x75, 0x72, 0x65, 0x43, 0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x06, 0x69, 0x6e, 0x73, +0x65, 0x72, 0x74, 0x0b, 0x6c, 0x61, 0x73, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4f, 0x66, 0x08, +0x74, 0x6f, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x0a, 0x74, 0x72, 0x69, 0x6d, 0x54, 0x6f, 0x53, +0x69, 0x7a, 0x65, 0x0d, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, +0x72, 0x15, 0x66, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x75, 0x74, 0x69, 0x6c, 0x73, 0x3a, 0x42, 0x79, +0x74, 0x65, 0x41, 0x72, 0x72, 0x61, 0x79, 0x06, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x0a, 0x75, +0x6e, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x0d, 0x77, 0x72, 0x69, 0x74, 0x65, 0x55, +0x54, 0x46, 0x42, 0x79, 0x74, 0x65, 0x73, 0x0f, 0x72, 0x65, 0x61, 0x64, 0x55, 0x6e, 0x73, 0x69, +0x67, 0x6e, 0x65, 0x64, 0x49, 0x6e, 0x74, 0x09, 0x72, 0x65, 0x61, 0x64, 0x53, 0x68, 0x6f, 0x72, +0x74, 0x08, 0x77, 0x72, 0x69, 0x74, 0x65, 0x55, 0x54, 0x46, 0x0c, 0x77, 0x72, 0x69, 0x74, 0x65, +0x42, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x0a, 0x77, 0x72, 0x69, 0x74, 0x65, 0x42, 0x79, 0x74, +0x65, 0x73, 0x09, 0x77, 0x72, 0x69, 0x74, 0x65, 0x42, 0x79, 0x74, 0x65, 0x08, 0x77, 0x72, 0x69, +0x74, 0x65, 0x49, 0x6e, 0x74, 0x11, 0x72, 0x65, 0x61, 0x64, 0x55, 0x6e, 0x73, 0x69, 0x67, 0x6e, +0x65, 0x64, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x08, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, +0x10, 0x72, 0x65, 0x61, 0x64, 0x55, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x79, 0x74, +0x65, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x0b, 0x77, 0x72, 0x69, +0x74, 0x65, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x10, 0x77, 0x72, 0x69, 0x74, 0x65, 0x55, 0x6e, +0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x49, 0x6e, 0x74, 0x0a, 0x77, 0x72, 0x69, 0x74, 0x65, 0x53, +0x68, 0x6f, 0x72, 0x74, 0x0e, 0x62, 0x79, 0x74, 0x65, 0x73, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, +0x62, 0x6c, 0x65, 0x08, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x09, 0x72, 0x65, 0x61, +0x64, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x06, 0x65, 0x6e, 0x64, 0x69, 0x61, 0x6e, 0x07, 0x72, 0x65, +0x61, 0x64, 0x55, 0x54, 0x46, 0x0b, 0x72, 0x65, 0x61, 0x64, 0x42, 0x6f, 0x6f, 0x6c, 0x65, 0x61, +0x6e, 0x09, 0x72, 0x65, 0x61, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x07, 0x72, 0x65, 0x61, 0x64, +0x49, 0x6e, 0x74, 0x0c, 0x72, 0x65, 0x61, 0x64, 0x55, 0x54, 0x46, 0x42, 0x79, 0x74, 0x65, 0x73, +0x09, 0x77, 0x72, 0x69, 0x74, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x0a, 0x77, 0x72, 0x69, 0x74, 0x65, +0x46, 0x6c, 0x6f, 0x61, 0x74, 0x08, 0x72, 0x65, 0x61, 0x64, 0x42, 0x79, 0x74, 0x65, 0x0e, 0x42, +0x79, 0x74, 0x65, 0x41, 0x72, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x73, 0x24, 0x34, 0x14, 0x66, 0x6c, +0x61, 0x73, 0x68, 0x2e, 0x75, 0x74, 0x69, 0x6c, 0x73, 0x3a, 0x49, 0x6e, 0x74, 0x41, 0x72, 0x72, +0x61, 0x79, 0x08, 0x49, 0x6e, 0x74, 0x41, 0x72, 0x72, 0x61, 0x79, 0x0d, 0x49, 0x6e, 0x74, 0x41, +0x72, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x73, 0x24, 0x35, 0x15, 0x66, 0x6c, 0x61, 0x73, 0x68, 0x2e, +0x75, 0x74, 0x69, 0x6c, 0x73, 0x3a, 0x55, 0x49, 0x6e, 0x74, 0x41, 0x72, 0x72, 0x61, 0x79, 0x09, +0x55, 0x49, 0x6e, 0x74, 0x41, 0x72, 0x72, 0x61, 0x79, 0x0e, 0x55, 0x49, 0x6e, 0x74, 0x41, 0x72, +0x72, 0x61, 0x79, 0x2e, 0x61, 0x73, 0x24, 0x36, 0x17, 0x66, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x75, +0x74, 0x69, 0x6c, 0x73, 0x3a, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x41, 0x72, 0x72, 0x61, 0x79, +0x0b, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x41, 0x72, 0x72, 0x61, 0x79, 0x10, 0x44, 0x6f, 0x75, +0x62, 0x6c, 0x65, 0x41, 0x72, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x73, 0x24, 0x37, 0x16, 0x66, 0x6c, +0x61, 0x73, 0x68, 0x2e, 0x75, 0x74, 0x69, 0x6c, 0x73, 0x3a, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x41, +0x72, 0x72, 0x61, 0x79, 0x0a, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x41, 0x72, 0x72, 0x61, 0x79, 0x0f, +0x46, 0x6c, 0x6f, 0x61, 0x74, 0x41, 0x72, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x73, 0x24, 0x38, 0x16, +0x66, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x75, 0x74, 0x69, 0x6c, 0x73, 0x3a, 0x53, 0x68, 0x6f, 0x72, +0x74, 0x41, 0x72, 0x72, 0x61, 0x79, 0x0a, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x41, 0x72, 0x72, 0x61, +0x79, 0x0f, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x41, 0x72, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x73, 0x24, +0x39, 0x17, 0x66, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x75, 0x74, 0x69, 0x6c, 0x73, 0x3a, 0x55, 0x53, +0x68, 0x6f, 0x72, 0x74, 0x41, 0x72, 0x72, 0x61, 0x79, 0x0b, 0x55, 0x53, 0x68, 0x6f, 0x72, 0x74, +0x41, 0x72, 0x72, 0x61, 0x79, 0x11, 0x55, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x41, 0x72, 0x72, 0x61, +0x79, 0x2e, 0x61, 0x73, 0x24, 0x31, 0x30, 0x16, 0x66, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x75, 0x74, +0x69, 0x6c, 0x73, 0x3a, 0x44, 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x72, 0x79, 0x0a, 0x44, +0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x72, 0x79, 0x10, 0x44, 0x69, 0x63, 0x74, 0x69, 0x6f, +0x6e, 0x61, 0x72, 0x79, 0x2e, 0x61, 0x73, 0x24, 0x31, 0x31, 0x12, 0x66, 0x6c, 0x61, 0x73, 0x68, +0x2e, 0x75, 0x74, 0x69, 0x6c, 0x73, 0x3a, 0x45, 0x6e, 0x64, 0x69, 0x61, 0x6e, 0x0a, 0x42, 0x49, +0x47, 0x5f, 0x45, 0x4e, 0x44, 0x49, 0x41, 0x4e, 0x09, 0x62, 0x69, 0x67, 0x45, 0x6e, 0x64, 0x69, +0x61, 0x6e, 0x0d, 0x4c, 0x49, 0x54, 0x54, 0x4c, 0x45, 0x5f, 0x45, 0x4e, 0x44, 0x49, 0x41, 0x4e, +0x0c, 0x6c, 0x69, 0x74, 0x74, 0x6c, 0x65, 0x45, 0x6e, 0x64, 0x69, 0x61, 0x6e, 0x06, 0x45, 0x6e, +0x64, 0x69, 0x61, 0x6e, 0x0c, 0x45, 0x6e, 0x64, 0x69, 0x61, 0x6e, 0x2e, 0x61, 0x73, 0x24, 0x31, +0x32, 0x0f, 0x61, 0x76, 0x6d, 0x70, 0x6c, 0x75, 0x73, 0x3a, 0x4a, 0x4f, 0x62, 0x6a, 0x65, 0x63, +0x74, 0x07, 0x4a, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x07, 0x74, 0x6f, 0x41, 0x72, 0x72, 0x61, +0x79, 0x0e, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, +0x0f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, +0x06, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x72, +0x72, 0x61, 0x79, 0x14, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x6f, 0x72, 0x53, +0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x0a, 0x4a, 0x61, 0x76, 0x61, 0x2e, 0x61, 0x73, +0x24, 0x31, 0x33, 0x39, 0x05, 0x02, 0x16, 0x03, 0x17, 0x03, 0x16, 0x04, 0x17, 0x04, 0x05, 0x0e, +0x18, 0x0e, 0x1a, 0x0e, 0x1a, 0x11, 0x05, 0x1c, 0x18, 0x1c, 0x05, 0x20, 0x16, 0x22, 0x17, 0x22, +0x18, 0x20, 0x1a, 0x20, 0x05, 0x27, 0x16, 0x28, 0x05, 0x2b, 0x18, 0x27, 0x1a, 0x27, 0x05, 0x2e, +0x05, 0x30, 0x18, 0x2e, 0x1a, 0x2e, 0x05, 0x42, 0x18, 0x42, 0x05, 0x60, 0x17, 0x28, 0x05, 0x61, +0x18, 0x61, 0x05, 0x63, 0x05, 0x64, 0x18, 0x64, 0x05, 0x66, 0x05, 0x67, 0x18, 0x67, 0x05, 0x69, +0x05, 0x6a, 0x18, 0x6a, 0x05, 0x6c, 0x05, 0x6d, 0x18, 0x6d, 0x05, 0x6f, 0x05, 0x70, 0x18, 0x70, +0x05, 0x72, 0x05, 0x73, 0x18, 0x73, 0x05, 0x75, 0x05, 0x76, 0x18, 0x76, 0x05, 0x7c, 0x05, 0x7d, +0x18, 0x7d, 0x05, 0x85, 0x01, 0x15, 0x04, 0x01, 0x02, 0x03, 0x04, 0x04, 0x01, 0x02, 0x04, 0x05, +0x08, 0x01, 0x02, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x09, 0x01, 0x02, 0x04, 0x09, 0x0c, 0x0d, +0x0e, 0x0f, 0x10, 0x05, 0x01, 0x02, 0x04, 0x0d, 0x0e, 0x09, 0x02, 0x04, 0x05, 0x09, 0x11, 0x12, +0x13, 0x14, 0x15, 0x04, 0x02, 0x04, 0x05, 0x13, 0x08, 0x02, 0x04, 0x05, 0x09, 0x16, 0x17, 0x18, +0x19, 0x04, 0x02, 0x04, 0x05, 0x17, 0x01, 0x12, 0x04, 0x02, 0x12, 0x1c, 0x1d, 0x04, 0x02, 0x12, +0x1d, 0x20, 0x04, 0x02, 0x12, 0x1d, 0x23, 0x04, 0x02, 0x12, 0x1d, 0x26, 0x04, 0x02, 0x12, 0x1d, +0x29, 0x04, 0x02, 0x12, 0x1d, 0x2c, 0x04, 0x02, 0x12, 0x1d, 0x2f, 0x04, 0x02, 0x12, 0x1d, 0x32, +0x04, 0x02, 0x12, 0x1d, 0x35, 0x04, 0x02, 0x04, 0x05, 0x38, 0x80, 0x01, 0x09, 0x01, 0x01, 0x07, +0x02, 0x05, 0x09, 0x06, 0x01, 0x07, 0x02, 0x07, 0x09, 0x08, 0x01, 0x09, 0x09, 0x01, 0x09, 0x0a, +0x01, 0x09, 0x0b, 0x01, 0x07, 0x02, 0x0c, 0x09, 0x0d, 0x02, 0x07, 0x02, 0x0f, 0x09, 0x10, 0x03, +0x07, 0x02, 0x12, 0x07, 0x02, 0x13, 0x07, 0x02, 0x14, 0x07, 0x02, 0x15, 0x07, 0x02, 0x0d, 0x07, +0x02, 0x08, 0x07, 0x02, 0x01, 0x07, 0x02, 0x16, 0x07, 0x02, 0x06, 0x07, 0x02, 0x17, 0x07, 0x06, +0x10, 0x07, 0x02, 0x18, 0x07, 0x02, 0x19, 0x07, 0x02, 0x1a, 0x07, 0x04, 0x1b, 0x07, 0x02, 0x11, +0x07, 0x02, 0x1d, 0x07, 0x02, 0x1e, 0x07, 0x04, 0x1f, 0x09, 0x16, 0x04, 0x07, 0x02, 0x23, 0x07, +0x0d, 0x24, 0x09, 0x11, 0x02, 0x09, 0x11, 0x05, 0x07, 0x04, 0x0d, 0x07, 0x02, 0x25, 0x07, 0x02, +0x26, 0x07, 0x04, 0x09, 0x07, 0x12, 0x29, 0x09, 0x2a, 0x06, 0x09, 0x29, 0x06, 0x09, 0x2c, 0x06, +0x07, 0x02, 0x0a, 0x07, 0x02, 0x0b, 0x07, 0x02, 0x2a, 0x07, 0x02, 0x2d, 0x09, 0x11, 0x07, 0x09, +0x2f, 0x08, 0x07, 0x02, 0x31, 0x07, 0x02, 0x32, 0x07, 0x02, 0x33, 0x07, 0x02, 0x34, 0x07, 0x02, +0x35, 0x07, 0x02, 0x36, 0x07, 0x02, 0x37, 0x07, 0x02, 0x38, 0x07, 0x02, 0x39, 0x07, 0x02, 0x3a, +0x07, 0x02, 0x3b, 0x07, 0x02, 0x3c, 0x07, 0x02, 0x3d, 0x07, 0x02, 0x3e, 0x07, 0x02, 0x3f, 0x07, +0x02, 0x2f, 0x07, 0x02, 0x40, 0x07, 0x04, 0x41, 0x09, 0x11, 0x09, 0x07, 0x02, 0x43, 0x07, 0x02, +0x2c, 0x07, 0x02, 0x44, 0x07, 0x02, 0x45, 0x07, 0x02, 0x46, 0x07, 0x02, 0x47, 0x07, 0x02, 0x48, +0x07, 0x02, 0x49, 0x07, 0x02, 0x4a, 0x07, 0x02, 0x4b, 0x07, 0x02, 0x4c, 0x07, 0x02, 0x4d, 0x07, +0x02, 0x4e, 0x07, 0x02, 0x4f, 0x07, 0x02, 0x50, 0x07, 0x02, 0x51, 0x07, 0x02, 0x52, 0x07, 0x02, +0x53, 0x07, 0x02, 0x54, 0x07, 0x02, 0x55, 0x07, 0x02, 0x56, 0x07, 0x02, 0x57, 0x07, 0x02, 0x58, +0x07, 0x02, 0x59, 0x07, 0x02, 0x5a, 0x07, 0x02, 0x5b, 0x07, 0x02, 0x5c, 0x07, 0x02, 0x5d, 0x07, +0x02, 0x5e, 0x07, 0x02, 0x5f, 0x09, 0x29, 0x0a, 0x09, 0x11, 0x0b, 0x07, 0x12, 0x62, 0x09, 0x11, +0x0c, 0x07, 0x12, 0x65, 0x09, 0x11, 0x0d, 0x07, 0x12, 0x68, 0x09, 0x11, 0x0e, 0x07, 0x12, 0x6b, +0x09, 0x11, 0x0f, 0x07, 0x12, 0x6e, 0x09, 0x11, 0x10, 0x07, 0x12, 0x71, 0x09, 0x11, 0x11, 0x07, +0x12, 0x74, 0x09, 0x11, 0x12, 0x07, 0x02, 0x77, 0x07, 0x02, 0x79, 0x07, 0x12, 0x7b, 0x09, 0x11, +0x13, 0x07, 0x04, 0x7e, 0x07, 0x02, 0x7f, 0x07, 0x02, 0x80, 0x01, 0x07, 0x02, 0x81, 0x01, 0x07, +0x02, 0x82, 0x01, 0x07, 0x02, 0x83, 0x01, 0x07, 0x02, 0x84, 0x01, 0x09, 0x11, 0x14, 0x8b, 0x01, +0x00, 0x02, 0x03, 0x00, 0x00, 0x04, 0x03, 0x00, 0x00, 0x00, 0x03, 0x04, 0x00, 0x00, 0x03, 0x04, +0x01, 0x09, 0x02, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x01, 0x0d, 0x0e, +0x03, 0x20, 0x01, 0x0e, 0x02, 0x03, 0x20, 0x00, 0x02, 0x03, 0x20, 0x01, 0x0d, 0x0f, 0x03, 0x20, +0x01, 0x0d, 0x02, 0x03, 0x20, 0x00, 0x0d, 0x03, 0x20, 0x00, 0x10, 0x03, 0x20, 0x00, 0x04, 0x03, +0x20, 0x00, 0x0f, 0x03, 0x20, 0x00, 0x02, 0x03, 0x20, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, +0x00, 0x01, 0x02, 0x02, 0x03, 0x20, 0x01, 0x02, 0x02, 0x03, 0x20, 0x02, 0x0d, 0x02, 0x02, 0x03, +0x20, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00, 0x10, 0x03, +0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x28, 0x03, +0x20, 0x01, 0x00, 0x28, 0x03, 0x20, 0x01, 0x00, 0x29, 0x03, 0x20, 0x01, 0x09, 0x02, 0x03, 0x20, +0x01, 0x00, 0x02, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x01, 0x00, 0x02, +0x03, 0x08, 0x01, 0x0c, 0x0c, 0x01, 0x0d, 0x00, 0x03, 0x20, 0x00, 0x04, 0x03, 0x20, 0x01, 0x02, +0x04, 0x03, 0x20, 0x01, 0x04, 0x04, 0x03, 0x20, 0x01, 0x0d, 0x04, 0x03, 0x20, 0x02, 0x0e, 0x02, +0x04, 0x03, 0x28, 0x01, 0x01, 0x03, 0x02, 0x0d, 0x04, 0x00, 0x03, 0x20, 0x02, 0x0e, 0x02, 0x04, +0x03, 0x28, 0x01, 0x01, 0x06, 0x00, 0x04, 0x03, 0x20, 0x01, 0x00, 0x04, 0x03, 0x20, 0x02, 0x0d, +0x04, 0x04, 0x03, 0x20, 0x01, 0x0d, 0x04, 0x03, 0x20, 0x03, 0x0d, 0x04, 0x04, 0x02, 0x03, 0x20, +0x00, 0x0d, 0x03, 0x20, 0x02, 0x0d, 0x04, 0x02, 0x03, 0x20, 0x02, 0x02, 0x04, 0x04, 0x03, 0x28, +0x01, 0x01, 0x06, 0x00, 0x02, 0x03, 0x20, 0x00, 0x0d, 0x03, 0x20, 0x00, 0x00, 0x03, 0x00, 0x00, +0x00, 0x03, 0x00, 0x01, 0x29, 0x02, 0x03, 0x20, 0x01, 0x0d, 0x02, 0x03, 0x20, 0x03, 0x0d, 0x29, +0x04, 0x04, 0x03, 0x28, 0x02, 0x01, 0x03, 0x01, 0x03, 0x03, 0x0d, 0x29, 0x04, 0x04, 0x03, 0x28, +0x02, 0x01, 0x03, 0x01, 0x03, 0x01, 0x0d, 0x10, 0x03, 0x20, 0x01, 0x0d, 0x0e, 0x03, 0x20, 0x01, +0x0d, 0x0e, 0x03, 0x20, 0x01, 0x0d, 0x0e, 0x03, 0x20, 0x01, 0x0d, 0x04, 0x03, 0x20, 0x01, 0x0d, +0x46, 0x03, 0x20, 0x01, 0x0d, 0x46, 0x03, 0x20, 0x01, 0x0d, 0x02, 0x03, 0x20, 0x01, 0x0d, 0x02, +0x03, 0x20, 0x00, 0x10, 0x03, 0x20, 0x00, 0x0e, 0x03, 0x20, 0x00, 0x04, 0x03, 0x20, 0x00, 0x0e, +0x03, 0x20, 0x00, 0x04, 0x03, 0x20, 0x00, 0x0e, 0x03, 0x20, 0x00, 0x04, 0x03, 0x20, 0x00, 0x46, +0x03, 0x20, 0x00, 0x46, 0x03, 0x20, 0x00, 0x02, 0x03, 0x20, 0x01, 0x02, 0x04, 0x03, 0x20, 0x00, +0x04, 0x03, 0x20, 0x01, 0x0d, 0x04, 0x03, 0x20, 0x00, 0x0d, 0x03, 0x20, 0x00, 0x0d, 0x03, 0x20, +0x00, 0x02, 0x03, 0x20, 0x00, 0x04, 0x03, 0x20, 0x00, 0x04, 0x03, 0x20, 0x01, 0x0d, 0x04, 0x03, +0x20, 0x00, 0x02, 0x03, 0x20, 0x01, 0x0d, 0x02, 0x03, 0x20, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, +0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x04, 0x03, 0x20, 0x01, 0x00, 0x04, 0x03, 0x20, 0x00, +0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x04, 0x03, 0x20, 0x01, +0x00, 0x04, 0x03, 0x20, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, +0x00, 0x04, 0x03, 0x20, 0x01, 0x00, 0x04, 0x03, 0x20, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, +0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x04, 0x03, 0x20, 0x01, 0x00, 0x04, 0x03, 0x20, 0x00, 0x00, +0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x04, 0x03, 0x20, 0x01, 0x00, +0x04, 0x03, 0x20, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, +0x04, 0x03, 0x20, 0x01, 0x00, 0x04, 0x03, 0x20, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, +0x00, 0x00, 0x03, 0x00, 0x01, 0x00, 0x10, 0x03, 0x28, 0x01, 0x0a, 0x0a, 0x00, 0x00, 0x03, 0x00, +0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, +0x01, 0x78, 0x02, 0x03, 0x24, 0x03, 0x78, 0x78, 0x0e, 0x0f, 0x03, 0x28, 0x01, 0x0c, 0x0c, 0x01, +0x0f, 0x78, 0x03, 0x20, 0x01, 0x02, 0x02, 0x03, 0x24, 0x02, 0x02, 0x78, 0x02, 0x03, 0x24, 0x02, +0x02, 0x78, 0x02, 0x03, 0x20, 0x00, 0x02, 0x03, 0x20, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, +0x00, 0x00, 0x0f, 0x1b, 0x1c, 0x09, 0x07, 0x00, 0x11, 0x00, 0x1f, 0x1c, 0x09, 0x0b, 0x00, 0x16, +0x00, 0x22, 0x1c, 0x0b, 0x0f, 0x00, 0x1a, 0x00, 0x28, 0x1c, 0x09, 0x14, 0x00, 0x1e, 0x03, 0x2e, +0x01, 0x00, 0x20, 0x2f, 0x01, 0x00, 0x1f, 0x30, 0x01, 0x00, 0x21, 0x44, 0x1c, 0x09, 0x18, 0x00, +0x24, 0x12, 0x33, 0x01, 0x00, 0x32, 0x34, 0x01, 0x00, 0x2f, 0x35, 0x02, 0x00, 0x2d, 0x36, 0x01, +0x00, 0x27, 0x37, 0x01, 0x00, 0x33, 0x35, 0x03, 0x00, 0x2e, 0x38, 0x01, 0x00, 0x30, 0x39, 0x01, +0x00, 0x2a, 0x3a, 0x01, 0x00, 0x34, 0x3b, 0x02, 0x00, 0x26, 0x3c, 0x01, 0x00, 0x31, 0x3d, 0x01, +0x00, 0x28, 0x3e, 0x01, 0x00, 0x29, 0x3f, 0x01, 0x00, 0x2b, 0x40, 0x01, 0x00, 0x2c, 0x41, 0x01, +0x00, 0x35, 0x42, 0x01, 0x00, 0x25, 0x43, 0x01, 0x00, 0x36, 0x29, 0x1c, 0x09, 0x1b, 0x00, 0x5b, +0x21, 0x48, 0x01, 0x00, 0x54, 0x49, 0x01, 0x00, 0x45, 0x4a, 0x01, 0x00, 0x4c, 0x4b, 0x01, 0x00, +0x49, 0x4c, 0x01, 0x00, 0x44, 0x4d, 0x01, 0x00, 0x3d, 0x4e, 0x01, 0x00, 0x3c, 0x4f, 0x01, 0x00, +0x3e, 0x50, 0x01, 0x00, 0x40, 0x51, 0x01, 0x00, 0x4a, 0x52, 0x03, 0x00, 0x58, 0x53, 0x01, 0x00, +0x48, 0x54, 0x01, 0x00, 0x4e, 0x55, 0x01, 0x00, 0x43, 0x56, 0x01, 0x00, 0x41, 0x57, 0x01, 0x00, +0x3f, 0x58, 0x02, 0x00, 0x56, 0x59, 0x01, 0x00, 0x53, 0x35, 0x03, 0x00, 0x52, 0x5a, 0x01, 0x00, +0x4d, 0x52, 0x02, 0x00, 0x57, 0x5b, 0x02, 0x00, 0x59, 0x41, 0x01, 0x00, 0x55, 0x35, 0x02, 0x00, +0x51, 0x5c, 0x01, 0x00, 0x4f, 0x5d, 0x01, 0x00, 0x46, 0x5e, 0x01, 0x00, 0x3b, 0x5b, 0x03, 0x00, +0x5a, 0x5f, 0x01, 0x00, 0x4b, 0x60, 0x01, 0x00, 0x50, 0x61, 0x01, 0x00, 0x3a, 0x62, 0x01, 0x00, +0x42, 0x63, 0x01, 0x00, 0x47, 0x66, 0x1c, 0x09, 0x1f, 0x00, 0x60, 0x02, 0x35, 0x02, 0x00, 0x5e, +0x35, 0x03, 0x00, 0x5f, 0x68, 0x1c, 0x09, 0x22, 0x00, 0x65, 0x02, 0x35, 0x02, 0x00, 0x63, 0x35, +0x03, 0x00, 0x64, 0x6a, 0x1c, 0x09, 0x25, 0x00, 0x6a, 0x02, 0x35, 0x02, 0x00, 0x68, 0x35, 0x03, +0x00, 0x69, 0x6c, 0x1c, 0x09, 0x28, 0x00, 0x6f, 0x02, 0x35, 0x02, 0x00, 0x6d, 0x35, 0x03, 0x00, +0x6e, 0x6e, 0x1c, 0x09, 0x2b, 0x00, 0x74, 0x02, 0x35, 0x02, 0x00, 0x72, 0x35, 0x03, 0x00, 0x73, +0x70, 0x1c, 0x09, 0x2e, 0x00, 0x79, 0x02, 0x35, 0x02, 0x00, 0x77, 0x35, 0x03, 0x00, 0x78, 0x72, +0x1c, 0x08, 0x31, 0x00, 0x7c, 0x00, 0x76, 0x1c, 0x09, 0x34, 0x00, 0x7f, 0x00, 0x78, 0x1c, 0x09, +0x37, 0x00, 0x89, 0x01, 0x01, 0x41, 0x01, 0x00, 0x88, 0x01, 0x06, 0x0b, 0x0b, 0x06, 0x01, 0x0f, +0x00, 0x11, 0x11, 0x08, 0x0c, 0x12, 0x11, 0x06, 0x0a, 0x13, 0x11, 0x0c, 0x10, 0x14, 0x11, 0x09, +0x0d, 0x15, 0x11, 0x0a, 0x0e, 0x16, 0x11, 0x04, 0x08, 0x17, 0x11, 0x0b, 0x0f, 0x18, 0x11, 0x05, +0x09, 0x19, 0x11, 0x03, 0x07, 0x1a, 0x11, 0x07, 0x0b, 0x12, 0x03, 0x1d, 0x11, 0x03, 0x13, 0x1e, +0x11, 0x04, 0x14, 0x1a, 0x11, 0x05, 0x15, 0x17, 0x02, 0x21, 0x12, 0x03, 0x18, 0x14, 0x12, 0x04, +0x19, 0x1c, 0x01, 0x2d, 0x12, 0x03, 0x1d, 0x23, 0x00, 0x38, 0x01, 0x47, 0x11, 0x03, 0x39, 0x5d, +0x00, 0x62, 0x00, 0x67, 0x00, 0x6c, 0x00, 0x71, 0x00, 0x76, 0x00, 0x7b, 0x00, 0x7e, 0x02, 0x74, +0x06, 0x01, 0x02, 0x78, 0x01, 0x75, 0x06, 0x02, 0x02, 0x7a, 0x01, 0x81, 0x01, 0x06, 0x79, 0x11, +0x05, 0x84, 0x01, 0x7a, 0x11, 0x08, 0x87, 0x01, 0x7b, 0x11, 0x07, 0x86, 0x01, 0x7c, 0x11, 0x03, +0x82, 0x01, 0x7d, 0x11, 0x04, 0x83, 0x01, 0x7e, 0x11, 0x06, 0x85, 0x01, 0x0d, 0x22, 0x01, 0x28, +0x04, 0x01, 0x03, 0x37, 0x01, 0x44, 0x04, 0x01, 0x04, 0x5c, 0x01, 0x29, 0x04, 0x00, 0x05, 0x61, +0x01, 0x66, 0x04, 0x01, 0x06, 0x66, 0x01, 0x68, 0x04, 0x01, 0x07, 0x6b, 0x01, 0x6a, 0x04, 0x01, +0x08, 0x70, 0x01, 0x6c, 0x04, 0x01, 0x09, 0x75, 0x01, 0x6e, 0x04, 0x01, 0x0a, 0x7a, 0x01, 0x70, +0x04, 0x01, 0x0b, 0x7d, 0x01, 0x72, 0x04, 0x01, 0x0c, 0x80, 0x01, 0x01, 0x76, 0x04, 0x01, 0x0d, +0x8a, 0x01, 0x01, 0x78, 0x04, 0x01, 0x0e, 0x1b, 0x09, 0x15, 0x01, 0x05, 0x01, 0x1f, 0x04, 0x02, +0x01, 0x25, 0x01, 0x01, 0x05, 0x13, 0x01, 0x06, 0x00, 0x26, 0x01, 0x03, 0x03, 0x12, 0x01, 0x04, +0x02, 0x1b, 0x04, 0x01, 0x00, 0x22, 0x04, 0x03, 0x02, 0x27, 0x01, 0x02, 0x04, 0x32, 0x00, 0x01, +0x01, 0x01, 0x02, 0x09, 0xd0, 0x30, 0x64, 0x6c, 0x01, 0x46, 0x01, 0x00, 0x48, 0x00, 0x00, 0x01, +0x01, 0x01, 0x01, 0x02, 0x09, 0xd0, 0x30, 0x64, 0x6c, 0x01, 0x46, 0x03, 0x00, 0x48, 0x00, 0x00, +0x02, 0x02, 0x02, 0x01, 0x02, 0x0b, 0xd0, 0x30, 0x64, 0x6c, 0x01, 0xd1, 0x46, 0x05, 0x01, 0x29, +0x47, 0x00, 0x00, 0x03, 0x02, 0x02, 0x01, 0x02, 0x0b, 0xd0, 0x30, 0x64, 0x6c, 0x01, 0xd1, 0x46, +0x05, 0x01, 0x29, 0x47, 0x00, 0x00, 0x04, 0x02, 0x02, 0x01, 0x02, 0x0d, 0xd0, 0x30, 0x5d, 0x06, +0x66, 0x06, 0x66, 0x07, 0xd1, 0x46, 0x08, 0x01, 0x48, 0x00, 0x00, 0x05, 0x01, 0x01, 0x01, 0x02, +0x0a, 0xd0, 0x30, 0x64, 0x6c, 0x01, 0x46, 0x0a, 0x00, 0x29, 0x47, 0x00, 0x00, 0x06, 0x02, 0x01, +0x03, 0x04, 0x0c, 0xd0, 0x30, 0x5e, 0x0b, 0x5d, 0x0c, 0x46, 0x0c, 0x00, 0x68, 0x0b, 0x47, 0x00, +0x00, 0x11, 0x01, 0x01, 0x04, 0x05, 0x06, 0xd0, 0x30, 0xd0, 0x49, 0x00, 0x47, 0x00, 0x00, 0x12, +0x01, 0x01, 0x03, 0x04, 0x03, 0xd0, 0x30, 0x47, 0x00, 0x00, 0x16, 0x01, 0x01, 0x04, 0x05, 0x06, +0xd0, 0x30, 0xd0, 0x49, 0x00, 0x47, 0x00, 0x00, 0x17, 0x01, 0x01, 0x03, 0x04, 0x03, 0xd0, 0x30, +0x47, 0x00, 0x00, 0x18, 0x01, 0x01, 0x03, 0x04, 0x05, 0xd0, 0x30, 0x2c, 0x21, 0x48, 0x00, 0x00, +0x19, 0x01, 0x01, 0x03, 0x04, 0x09, 0xd0, 0x30, 0x64, 0x6c, 0x01, 0x46, 0x20, 0x00, 0x48, 0x00, +0x00, 0x1a, 0x01, 0x01, 0x04, 0x05, 0x06, 0xd0, 0x30, 0xd0, 0x49, 0x00, 0x47, 0x00, 0x00, 0x1b, +0x02, 0x01, 0x01, 0x03, 0x33, 0xd0, 0x30, 0x65, 0x00, 0x5d, 0x1c, 0x66, 0x1c, 0x30, 0x5d, 0x23, +0x66, 0x23, 0x58, 0x00, 0x1d, 0x68, 0x1b, 0x65, 0x00, 0x5d, 0x1c, 0x66, 0x1c, 0x30, 0x5d, 0x23, +0x66, 0x23, 0x58, 0x01, 0x1d, 0x68, 0x1f, 0x65, 0x00, 0x5d, 0x1c, 0x66, 0x1c, 0x30, 0x5d, 0x24, +0x66, 0x24, 0x58, 0x02, 0x1d, 0x68, 0x22, 0x47, 0x00, 0x00, 0x1c, 0x01, 0x01, 0x03, 0x04, 0x03, +0xd0, 0x30, 0x47, 0x00, 0x00, 0x21, 0x03, 0x02, 0x04, 0x05, 0x10, 0xd0, 0x30, 0x5d, 0x2a, 0x5d, +0x2b, 0x66, 0x2b, 0xd1, 0x46, 0x2c, 0x01, 0x46, 0x2a, 0x01, 0x48, 0x00, 0x00, 0x22, 0x02, 0x01, +0x01, 0x03, 0x13, 0xd0, 0x30, 0x65, 0x00, 0x5d, 0x1c, 0x66, 0x1c, 0x30, 0x5d, 0x31, 0x66, 0x31, +0x58, 0x03, 0x1d, 0x68, 0x28, 0x47, 0x00, 0x00, 0x23, 0x01, 0x01, 0x03, 0x04, 0x03, 0xd0, 0x30, +0x47, 0x00, 0x00, 0x24, 0x02, 0x02, 0x04, 0x05, 0x13, 0xd0, 0x30, 0xd0, 0x49, 0x00, 0xd1, 0x20, +0x13, 0x07, 0x00, 0x00, 0x5d, 0x32, 0xd1, 0x46, 0x32, 0x01, 0x29, 0x47, 0x00, 0x00, 0x37, 0x02, +0x01, 0x01, 0x03, 0x13, 0xd0, 0x30, 0x65, 0x00, 0x5d, 0x1c, 0x66, 0x1c, 0x30, 0x5d, 0x45, 0x66, +0x45, 0x58, 0x04, 0x1d, 0x68, 0x44, 0x47, 0x00, 0x00, 0x38, 0x01, 0x01, 0x03, 0x04, 0x03, 0xd0, +0x30, 0x47, 0x00, 0x00, 0x5b, 0x01, 0x01, 0x04, 0x05, 0x06, 0xd0, 0x30, 0xd0, 0x49, 0x00, 0x47, +0x00, 0x00, 0x5c, 0x02, 0x01, 0x01, 0x03, 0x13, 0xd0, 0x30, 0x5d, 0x64, 0x5d, 0x1c, 0x66, 0x1c, +0x30, 0x5d, 0x65, 0x66, 0x65, 0x58, 0x05, 0x1d, 0x68, 0x29, 0x47, 0x00, 0x00, 0x5d, 0x01, 0x01, +0x03, 0x04, 0x03, 0xd0, 0x30, 0x47, 0x00, 0x00, 0x60, 0x01, 0x01, 0x04, 0x05, 0x06, 0xd0, 0x30, +0xd0, 0x49, 0x00, 0x47, 0x00, 0x00, 0x61, 0x02, 0x01, 0x01, 0x03, 0x13, 0xd0, 0x30, 0x65, 0x00, +0x5d, 0x1c, 0x66, 0x1c, 0x30, 0x5d, 0x67, 0x66, 0x67, 0x58, 0x06, 0x1d, 0x68, 0x66, 0x47, 0x00, +0x00, 0x62, 0x01, 0x01, 0x03, 0x04, 0x03, 0xd0, 0x30, 0x47, 0x00, 0x00, 0x65, 0x01, 0x01, 0x04, +0x05, 0x06, 0xd0, 0x30, 0xd0, 0x49, 0x00, 0x47, 0x00, 0x00, 0x66, 0x02, 0x01, 0x01, 0x03, 0x13, +0xd0, 0x30, 0x65, 0x00, 0x5d, 0x1c, 0x66, 0x1c, 0x30, 0x5d, 0x69, 0x66, 0x69, 0x58, 0x07, 0x1d, +0x68, 0x68, 0x47, 0x00, 0x00, 0x67, 0x01, 0x01, 0x03, 0x04, 0x03, 0xd0, 0x30, 0x47, 0x00, 0x00, +0x6a, 0x01, 0x01, 0x04, 0x05, 0x06, 0xd0, 0x30, 0xd0, 0x49, 0x00, 0x47, 0x00, 0x00, 0x6b, 0x02, +0x01, 0x01, 0x03, 0x13, 0xd0, 0x30, 0x65, 0x00, 0x5d, 0x1c, 0x66, 0x1c, 0x30, 0x5d, 0x6b, 0x66, +0x6b, 0x58, 0x08, 0x1d, 0x68, 0x6a, 0x47, 0x00, 0x00, 0x6c, 0x01, 0x01, 0x03, 0x04, 0x03, 0xd0, +0x30, 0x47, 0x00, 0x00, 0x6f, 0x01, 0x01, 0x04, 0x05, 0x06, 0xd0, 0x30, 0xd0, 0x49, 0x00, 0x47, +0x00, 0x00, 0x70, 0x02, 0x01, 0x01, 0x03, 0x13, 0xd0, 0x30, 0x65, 0x00, 0x5d, 0x1c, 0x66, 0x1c, +0x30, 0x5d, 0x6d, 0x66, 0x6d, 0x58, 0x09, 0x1d, 0x68, 0x6c, 0x47, 0x00, 0x00, 0x71, 0x01, 0x01, +0x03, 0x04, 0x03, 0xd0, 0x30, 0x47, 0x00, 0x00, 0x74, 0x01, 0x01, 0x04, 0x05, 0x06, 0xd0, 0x30, +0xd0, 0x49, 0x00, 0x47, 0x00, 0x00, 0x75, 0x02, 0x01, 0x01, 0x03, 0x13, 0xd0, 0x30, 0x65, 0x00, +0x5d, 0x1c, 0x66, 0x1c, 0x30, 0x5d, 0x6f, 0x66, 0x6f, 0x58, 0x0a, 0x1d, 0x68, 0x6e, 0x47, 0x00, +0x00, 0x76, 0x01, 0x01, 0x03, 0x04, 0x03, 0xd0, 0x30, 0x47, 0x00, 0x00, 0x79, 0x01, 0x01, 0x04, +0x05, 0x06, 0xd0, 0x30, 0xd0, 0x49, 0x00, 0x47, 0x00, 0x00, 0x7a, 0x02, 0x01, 0x01, 0x03, 0x13, +0xd0, 0x30, 0x65, 0x00, 0x5d, 0x1c, 0x66, 0x1c, 0x30, 0x5d, 0x71, 0x66, 0x71, 0x58, 0x0b, 0x1d, +0x68, 0x70, 0x47, 0x00, 0x00, 0x7b, 0x01, 0x01, 0x03, 0x04, 0x03, 0xd0, 0x30, 0x47, 0x00, 0x00, +0x7d, 0x02, 0x01, 0x01, 0x03, 0x13, 0xd0, 0x30, 0x65, 0x00, 0x5d, 0x1c, 0x66, 0x1c, 0x30, 0x5d, +0x73, 0x66, 0x73, 0x58, 0x0c, 0x1d, 0x68, 0x72, 0x47, 0x00, 0x00, 0x7e, 0x02, 0x01, 0x03, 0x04, +0x0f, 0xd0, 0x30, 0x5e, 0x74, 0x2c, 0x78, 0x68, 0x74, 0x5e, 0x75, 0x2c, 0x7a, 0x68, 0x75, 0x47, +0x00, 0x00, 0x7f, 0x01, 0x01, 0x04, 0x05, 0x06, 0xd0, 0x30, 0xd0, 0x49, 0x00, 0x47, 0x00, 0x00, +0x80, 0x01, 0x02, 0x01, 0x01, 0x03, 0x13, 0xd0, 0x30, 0x65, 0x00, 0x5d, 0x1c, 0x66, 0x1c, 0x30, +0x5d, 0x77, 0x66, 0x77, 0x58, 0x0d, 0x1d, 0x68, 0x76, 0x47, 0x00, 0x00, 0x81, 0x01, 0x01, 0x01, +0x03, 0x04, 0x03, 0xd0, 0x30, 0x47, 0x00, 0x00, 0x89, 0x01, 0x01, 0x01, 0x04, 0x05, 0x06, 0xd0, +0x30, 0xd0, 0x49, 0x00, 0x47, 0x00, 0x00, 0x8a, 0x01, 0x02, 0x01, 0x01, 0x03, 0x13, 0xd0, 0x30, +0x65, 0x00, 0x5d, 0x1c, 0x66, 0x1c, 0x30, 0x5d, 0x7f, 0x66, 0x7f, 0x58, 0x0e, 0x1d, 0x68, 0x78, +0x47, 0x00, 0x00 }; diff --git a/mozilla/js/tamarin/shell/toplevel.h b/mozilla/js/tamarin/shell/toplevel.h new file mode 100644 index 00000000000..ff8b3bddf33 --- /dev/null +++ b/mozilla/js/tamarin/shell/toplevel.h @@ -0,0 +1,148 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +const int avmplus_System_exit = 7; +const int avmplus_System_exec = 8; +const int avmplus_System_getAvmplusVersion = 9; +const int avmplus_System_trace = 10; +const int avmplus_System_write = 11; +const int avmplus_System_debugger = 12; +const int avmplus_System_isDebugger = 13; +const int avmplus_System_getTimer = 14; +const int avmplus_System_private_getArgv = 15; +const int avmplus_System_readLine = 16; +const int abcclass_avmplus_System = 0; +const int avmplus_File_exists = 19; +const int avmplus_File_read = 20; +const int avmplus_File_write = 21; +const int abcclass_avmplus_File = 1; +const int abcclass_flash_system_Capabilities = 2; +const int abcpackage_toplevel_as = 0; +const int avmplus_Domain_currentDomain_get = 29; +const int avmplus_Domain_Domain = 30; +const int avmplus_Domain_loadBytes = 31; +const int avmplus_Domain_getClass = 32; +const int abcclass_avmplus_Domain = 3; +const int abcpackage_Domain_as = 1; +const int avmplus_StringBuilder_append = 37; +const int avmplus_StringBuilder_capacity_get = 38; +const int avmplus_StringBuilder_charAt = 39; +const int avmplus_StringBuilder_charCodeAt = 40; +const int avmplus_StringBuilder_ensureCapacity = 41; +const int avmplus_StringBuilder_indexOf = 42; +const int avmplus_StringBuilder_insert = 43; +const int avmplus_StringBuilder_lastIndexOf = 44; +const int avmplus_StringBuilder_length_get = 45; +const int avmplus_StringBuilder_length_set = 46; +const int avmplus_StringBuilder_remove = 47; +const int avmplus_StringBuilder_removeCharAt = 48; +const int avmplus_StringBuilder_replace = 49; +const int avmplus_StringBuilder_reverse = 50; +const int avmplus_StringBuilder_setCharAt = 51; +const int avmplus_StringBuilder_substring = 52; +const int avmplus_StringBuilder_toString = 53; +const int avmplus_StringBuilder_trimToSize = 54; +const int abcclass_avmplus_StringBuilder = 4; +const int abcpackage_StringBuilder_as = 2; +const int flash_utils_ByteArray_readFile = 57; +const int flash_utils_ByteArray_writeFile = 58; +const int flash_utils_ByteArray_readBytes = 59; +const int flash_utils_ByteArray_writeBytes = 60; +const int flash_utils_ByteArray_writeBoolean = 61; +const int flash_utils_ByteArray_writeByte = 62; +const int flash_utils_ByteArray_writeShort = 63; +const int flash_utils_ByteArray_writeInt = 64; +const int flash_utils_ByteArray_writeUnsignedInt = 65; +const int flash_utils_ByteArray_writeFloat = 66; +const int flash_utils_ByteArray_writeDouble = 67; +const int flash_utils_ByteArray_writeUTF = 68; +const int flash_utils_ByteArray_writeUTFBytes = 69; +const int flash_utils_ByteArray_readBoolean = 70; +const int flash_utils_ByteArray_readByte = 71; +const int flash_utils_ByteArray_readUnsignedByte = 72; +const int flash_utils_ByteArray_readShort = 73; +const int flash_utils_ByteArray_readUnsignedShort = 74; +const int flash_utils_ByteArray_readInt = 75; +const int flash_utils_ByteArray_readUnsignedInt = 76; +const int flash_utils_ByteArray_readFloat = 77; +const int flash_utils_ByteArray_readDouble = 78; +const int flash_utils_ByteArray_readUTF = 79; +const int flash_utils_ByteArray_readUTFBytes = 80; +const int flash_utils_ByteArray_length_get = 81; +const int flash_utils_ByteArray_length_set = 82; +const int flash_utils_ByteArray_compress = 83; +const int flash_utils_ByteArray_uncompress = 84; +const int flash_utils_ByteArray_toString = 85; +const int flash_utils_ByteArray_bytesAvailable_get = 86; +const int flash_utils_ByteArray_position_get = 87; +const int flash_utils_ByteArray_position_set = 88; +const int flash_utils_ByteArray_endian_get = 89; +const int flash_utils_ByteArray_endian_set = 90; +const int abcclass_flash_utils_ByteArray = 5; +const int abcpackage_ByteArray_as = 3; +const int flash_utils_IntArray_length_get = 94; +const int flash_utils_IntArray_length_set = 95; +const int abcclass_flash_utils_IntArray = 6; +const int abcpackage_IntArray_as = 4; +const int flash_utils_UIntArray_length_get = 99; +const int flash_utils_UIntArray_length_set = 100; +const int abcclass_flash_utils_UIntArray = 7; +const int abcpackage_UIntArray_as = 5; +const int flash_utils_DoubleArray_length_get = 104; +const int flash_utils_DoubleArray_length_set = 105; +const int abcclass_flash_utils_DoubleArray = 8; +const int abcpackage_DoubleArray_as = 6; +const int flash_utils_FloatArray_length_get = 109; +const int flash_utils_FloatArray_length_set = 110; +const int abcclass_flash_utils_FloatArray = 9; +const int abcpackage_FloatArray_as = 7; +const int flash_utils_ShortArray_length_get = 114; +const int flash_utils_ShortArray_length_set = 115; +const int abcclass_flash_utils_ShortArray = 10; +const int abcpackage_ShortArray_as = 8; +const int flash_utils_UShortArray_length_get = 119; +const int flash_utils_UShortArray_length_set = 120; +const int abcclass_flash_utils_UShortArray = 11; +const int abcpackage_UShortArray_as = 9; +const int flash_utils_Dictionary_Dictionary = 124; +const int abcclass_flash_utils_Dictionary = 12; +const int abcpackage_Dictionary_as = 10; +const int abcclass_flash_utils_Endian = 13; +const int abcpackage_Endian_as = 11; +const int avmplus_JObject_create = 130; +const int avmplus_JObject_createArray = 131; +const int avmplus_JObject_toArray = 132; +const int avmplus_JObject_constructorSignature = 133; +const int avmplus_JObject_methodSignature = 134; +const int avmplus_JObject_fieldSignature = 135; +const int avmplus_JObject_toString = 136; +const int abcclass_avmplus_JObject = 14; +const int abcpackage_Java_as = 12; diff --git a/mozilla/js/tamarin/test/as3/AbcDecoder/accessSpecifiers.as b/mozilla/js/tamarin/test/as3/AbcDecoder/accessSpecifiers.as new file mode 100644 index 00000000000..41ce5d5da78 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/AbcDecoder/accessSpecifiers.as @@ -0,0 +1,56 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + /* + * This file access the methods/properties defined in .abc file + * Aim : To test the access specifiers + */ + +var SECTION = " "; +var VERSION = "AS3"; +var TITLE = "import a class defined in .abc file"; + +startTest(); +writeHeaderToLog( SECTION + " "+ TITLE); + +var obj = new accSpecClass(); + +AddTestCase( "invoke the method 'func1()' from the imported file", "string", obj.accSpec1); +AddTestCase( "invoke the method 'func2()' from the imported file", "Inside func1()-public function", obj.func1()); +AddTestCase( "invoke the method 'func2()' from the imported file", "Inside func2()-Dynamic function", obj.func2()); + +var obj = new dynClass(); + +AddTestCase( "invoke the method 'func1()' from the imported file", "string", obj.dynSpec1); +AddTestCase( "invoke the method 'func2()' from the imported file", "Inside func1()-public function", obj.func1()); +AddTestCase( "invoke the method 'func2()' from the imported file", "Inside func2()-Dynamic function", obj.func2()); + +test(); diff --git a/mozilla/js/tamarin/test/as3/AbcDecoder/accessSpecifiers/varsDef.as b/mozilla/js/tamarin/test/as3/AbcDecoder/accessSpecifiers/varsDef.as new file mode 100644 index 00000000000..d72714620fc --- /dev/null +++ b/mozilla/js/tamarin/test/as3/AbcDecoder/accessSpecifiers/varsDef.as @@ -0,0 +1,131 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + /* + This file is imported with other .as files + */ + +package packOne { + public var var1="packOne:var1"; + public var var2="packOne:var2"; + public var var3="packOne:var3"; + public var var4="packOne:var4"; +} + +package packTwo { + public var p2var1="packTwo:var1"; + public var p2var2="packTwo:var2"; + public var p2var3="packTwo:var3"; + public var p2var4="packTwo:var4"; +} +package +{ +public class accSpecClass { + public var accSpec1 = "string"; + public function func1() { + return "Inside func1()-public function"; + } + public function func2() { + return "Inside func2()-Dynamic function"; + } + +} +} + +package +{ +public dynamic class dynClass { + public var dynSpec1 = "string"; + public function func1() { + return "Inside func1()-public function"; + } + public function func2() { + return "Inside func2()-Dynamic function"; + } +} +} + +class testClass { + var testClassVar1 = "Inside testClass"; + function func1() { + return "Inside func1()"; + } + function func2() { + return "Inside func2()"; + + } +} + +final class finClass { + var finClassVar1 = "Inside finClass"; + function finFunc1() { + return "Inside func1()"; + } + function finFunc2() { + return "Inside func2()"; + + } +} + +interface inInterface { + function intFunc1(); + function intFunc2(); +} + + + + + +class baseClass +{ + public function overrideFunc() { + } +} + +class childClass extends baseClass +{ +} + + +var str="imported string"; +var num=10; + +var number:Number = 50; +var str1:String = "str1:String"; + + +namespace Baseball; +namespace Basketball; + +namespace foo = "http://www.macromedia.com/" + + + diff --git a/mozilla/js/tamarin/test/as3/AbcDecoder/extClass.as b/mozilla/js/tamarin/test/as3/AbcDecoder/extClass.as new file mode 100644 index 00000000000..46109db5102 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/AbcDecoder/extClass.as @@ -0,0 +1,55 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package extClass{ + public class subClass extends parentClass { + } +} + +import extClass.*; + +var SECTION = " "; +var VERSION = "AS3"; +var TITLE = "import a class defined in .abc file"; + +startTest(); + +pc = new parentClass(); +sc = new subClass(); + + +AddTestCase( "parent class from imported abc file", true, pc.test()); +AddTestCase( "sub class from imported abc file", true, sc.test()); + + +test(); + + diff --git a/mozilla/js/tamarin/test/as3/AbcDecoder/extClass/parentClass.as b/mozilla/js/tamarin/test/as3/AbcDecoder/extClass/parentClass.as new file mode 100644 index 00000000000..667702d16ac --- /dev/null +++ b/mozilla/js/tamarin/test/as3/AbcDecoder/extClass/parentClass.as @@ -0,0 +1,37 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package extClass{ + public class parentClass{ + public function test(){ + return true; + } + } +} diff --git a/mozilla/js/tamarin/test/as3/AbcDecoder/impClass.as b/mozilla/js/tamarin/test/as3/AbcDecoder/impClass.as new file mode 100644 index 00000000000..a31d6ecd46b --- /dev/null +++ b/mozilla/js/tamarin/test/as3/AbcDecoder/impClass.as @@ -0,0 +1,50 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + /* + * This file is imports a class defined in a '.abc' file + * Extend the class defined in varsDef.abc + */ + +var SECTION = " "; +var VERSION = "AS3"; +var TITLE = "import a class defined in .abc file"; + +startTest(); +writeHeaderToLog( SECTION + " "+ TITLE); + +obj = new testClass(); + +AddTestCase( "invoke the property 'testClassVar1' from the imported file", "Inside testClass", obj.testClassVar1); +AddTestCase( "invoke the method 'func1()' from the imported file", "Inside func1()", obj.func1()); +AddTestCase( "invoke the method 'func2()' from the imported file", "Inside func2()", obj.func2()); + +test(); diff --git a/mozilla/js/tamarin/test/as3/AbcDecoder/impClass/varsDef.as b/mozilla/js/tamarin/test/as3/AbcDecoder/impClass/varsDef.as new file mode 100644 index 00000000000..497463469a9 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/AbcDecoder/impClass/varsDef.as @@ -0,0 +1,125 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + /* + This file is imported with other .as files + */ + +package packOne { + public var var1="packOne:var1"; + public var var2="packOne:var2"; + public var var3="packOne:var3"; + public var var4="packOne:var4"; +} + +package packTwo { + public var p2var1="packTwo:var1"; + public var p2var2="packTwo:var2"; + public var p2var3="packTwo:var3"; + public var p2var4="packTwo:var4"; +} + +package { + public class testClass { + public var testClassVar1 = "Inside testClass"; + public function func1() { + return "Inside func1()"; + } + public function func2() { + return "Inside func2()"; + + } +} +} + +final class finClass { + var finClassVar1 = "Inside finClass"; + function finFunc1() { + return "Inside func1()"; + } + function finFunc2() { + return "Inside func2()"; + + } +} + +interface inInterface { + function intFunc1(); + function intFunc2(); +} + + +class accSpecClass { + var accSpec1 = "string"; + public function func1() { + return "Inside func1()-public function"; + } + function func2() { + return "Inside func2()-Dynamic function"; + } + +} + +dynamic class dynClass { + var dynSpec1 = "string"; + public function func1() { + return "Inside func1()-public function"; + } + function func2() { + return "Inside func2()-Dynamic function"; + } +} + +class baseClass +{ + public function overrideFunc() { + } +} + +class childClass extends baseClass +{ +} + + +var str="imported string"; +var num=10; + +var number:Number = 50; +var str1:String = "str1:String"; + + +namespace Baseball; +namespace Basketball; + +namespace foo = "http://www.macromedia.com/" + + + diff --git a/mozilla/js/tamarin/test/as3/AbcDecoder/impVars.as b/mozilla/js/tamarin/test/as3/AbcDecoder/impVars.as new file mode 100644 index 00000000000..b16922d4003 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/AbcDecoder/impVars.as @@ -0,0 +1,53 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import packOne.*; +import packTwo.*; + +var SECTION = " "; +var VERSION = "AS3"; +var TITLE = "import variable from a .abc file [defined in varsDef.as]"; + +startTest(); +writeHeaderToLog( SECTION + " "+ TITLE); + +AddTestCase( "importing 'var1' of packOne", "packOne:var1", var1); +AddTestCase( "importing 'var2' of packOne", "packOne:var2", var2); +AddTestCase( "importing 'var3' of packOne", "packOne:var3", var3); +AddTestCase( "importing 'var4' of packOne", "packOne:var4", var4); + +/* Importing variables from the pacakge defined in the second pacakge */ +AddTestCase( "importing 'p2var1' of packTwo", "packTwo:var1", p2var1); +AddTestCase( "importing 'p2var2' of packTwo", "packTwo:var2", p2var2); +AddTestCase( "importing 'p2var3' of packTwo", "packTwo:var3", p2var3); +AddTestCase( "importing 'p2var4' of packTwo", "packTwo:var4", p2var4); + +test(); diff --git a/mozilla/js/tamarin/test/as3/AbcDecoder/impVars/varsDef.as b/mozilla/js/tamarin/test/as3/AbcDecoder/impVars/varsDef.as new file mode 100644 index 00000000000..442cb0777d6 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/AbcDecoder/impVars/varsDef.as @@ -0,0 +1,123 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + /* + This file is imported with other .as files + */ + +package packOne { + public var var1="packOne:var1"; + public var var2="packOne:var2"; + public var var3="packOne:var3"; + public var var4="packOne:var4"; +} + +package packTwo { + public var p2var1="packTwo:var1"; + public var p2var2="packTwo:var2"; + public var p2var3="packTwo:var3"; + public var p2var4="packTwo:var4"; +} + +class testClass { + var testClassVar1 = "Inside testClass"; + function func1() { + return "Inside func1()"; + } + function func2() { + return "Inside func2()"; + + } +} + +final class finClass { + var finClassVar1 = "Inside finClass"; + function finFunc1() { + return "Inside func1()"; + } + function finFunc2() { + return "Inside func2()"; + + } +} + +interface inInterface { + function intFunc1(); + function intFunc2(); +} + + +class accSpecClass { + var accSpec1 = "string"; + public function func1() { + return "Inside func1()-public function"; + } + function func2() { + return "Inside func2()-Dynamic function"; + } + +} + +dynamic class dynClass { + var dynSpec1 = "string"; + public function func1() { + return "Inside func1()-public function"; + } + function func2() { + return "Inside func2()-Dynamic function"; + } +} + +class baseClass +{ + public function overrideFunc() { + } +} + +class childClass extends baseClass +{ +} + + +var str="imported string"; +var num=10; + +var number:Number = 50; +var str1:String = "str1:String"; + + +namespace Baseball; +namespace Basketball; + +namespace foo = "http://www.macromedia.com/" + + + diff --git a/mozilla/js/tamarin/test/as3/AbcDecoder/inheritClass.as b/mozilla/js/tamarin/test/as3/AbcDecoder/inheritClass.as new file mode 100644 index 00000000000..8f46d258cf8 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/AbcDecoder/inheritClass.as @@ -0,0 +1,61 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + /* + * This file implements the class defined '.abc' file + */ + +var SECTION = " "; +var VERSION = "AS3"; +var TITLE = "import a class defined in .abc file"; + +startTest(); +writeHeaderToLog( SECTION + " "+ TITLE); + +class impClass implements inInterface { + public function intFunc1() { + return "Inside func1()"; + } + public function intFunc2() { + return "Inside func2()"; + } + function intFunc3() { + return "Inside func3()"; + } +} + +obj = new impClass(); + +AddTestCase( "invoke the method 'func1()' from the imported file", "Inside func1()", obj.intFunc1()); +AddTestCase( "invoke the method 'func2()' from the imported file", "Inside func2()", obj.intFunc2()); +AddTestCase( "invoke the method 'func3()'", "Inside func3()", obj.intFunc3()); + +test(); diff --git a/mozilla/js/tamarin/test/as3/AbcDecoder/inheritClass/varsDef.as b/mozilla/js/tamarin/test/as3/AbcDecoder/inheritClass/varsDef.as new file mode 100644 index 00000000000..d145f143494 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/AbcDecoder/inheritClass/varsDef.as @@ -0,0 +1,127 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + /* + This file is imported with other .as files + */ + +package packOne { + public var var1="packOne:var1"; + public var var2="packOne:var2"; + public var var3="packOne:var3"; + public var var4="packOne:var4"; +} + +package packTwo { + public var p2var1="packTwo:var1"; + public var p2var2="packTwo:var2"; + public var p2var3="packTwo:var3"; + public var p2var4="packTwo:var4"; +} + +package { + public interface inInterface { + function intFunc1(); + function intFunc2(); +} + } + +class testClass { + var testClassVar1 = "Inside testClass"; + function func1() { + return "Inside func1()"; + } + function func2() { + return "Inside func2()"; + + } +} + +final class finClass { + var finClassVar1 = "Inside finClass"; + function finFunc1() { + return "Inside func1()"; + } + function finFunc2() { + return "Inside func2()"; + + } +} + + + + +class accSpecClass { + var accSpec1 = "string"; + public function func1() { + return "Inside func1()-public function"; + } + function func2() { + return "Inside func2()-Dynamic function"; + } + +} + +dynamic class dynClass { + var dynSpec1 = "string"; + public function func1() { + return "Inside func1()-public function"; + } + function func2() { + return "Inside func2()-Dynamic function"; + } +} + +class baseClass +{ + public function overrideFunc() { + } +} + +class childClass extends baseClass +{ +} + + +var str="imported string"; +var num=10; + +var number:Number = 50; +var str1:String = "str1:String"; + + +namespace Baseball; +namespace Basketball; + +namespace foo = "http://www.macromedia.com/" + + + diff --git a/mozilla/js/tamarin/test/as3/AbcDecoder/simple.as b/mozilla/js/tamarin/test/as3/AbcDecoder/simple.as new file mode 100644 index 00000000000..284c3217ba7 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/AbcDecoder/simple.as @@ -0,0 +1,47 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + /* + * This file is imports the variable defined in varsDef.as + * avmplus varsDef.abc simple.abc + */ + +var SECTION = " "; +var VERSION = "AS3"; +var TITLE = "import variables defined from a varsDef.abc file"; + +startTest(); +writeHeaderToLog( SECTION + " "+ TITLE); + +AddTestCase( "importing 'str' ", "imported string", str); +AddTestCase( "importing 'num'", 10, num); + +test(); diff --git a/mozilla/js/tamarin/test/as3/AbcDecoder/simple/varsDef.as b/mozilla/js/tamarin/test/as3/AbcDecoder/simple/varsDef.as new file mode 100644 index 00000000000..a6800ea2aea --- /dev/null +++ b/mozilla/js/tamarin/test/as3/AbcDecoder/simple/varsDef.as @@ -0,0 +1,128 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + /* + This file is imported with other .as files + */ + +package packOne { + public var var1="packOne:var1"; + public var var2="packOne:var2"; + public var var3="packOne:var3"; + public var var4="packOne:var4"; +} + +package packTwo { + public var p2var1="packTwo:var1"; + public var p2var2="packTwo:var2"; + public var p2var3="packTwo:var3"; + public var p2var4="packTwo:var4"; +} + +package { + public var str="imported string"; + public var num=10; +} + +class testClass { + var testClassVar1 = "Inside testClass"; + function func1() { + return "Inside func1()"; + } + function func2() { + return "Inside func2()"; + + } +} + +final class finClass { + var finClassVar1 = "Inside finClass"; + function finFunc1() { + return "Inside func1()"; + } + function finFunc2() { + return "Inside func2()"; + + } +} + +interface inInterface { + function intFunc1(); + function intFunc2(); +} + + +class accSpecClass { + var accSpec1 = "string"; + public function func1() { + return "Inside func1()-public function"; + } + function func2() { + return "Inside func2()-Dynamic function"; + } + +} + +dynamic class dynClass { + var dynSpec1 = "string"; + public function func1() { + return "Inside func1()-public function"; + } + function func2() { + return "Inside func2()-Dynamic function"; + } +} + +class baseClass +{ + public function overrideFunc() { + } +} + +class childClass extends baseClass +{ +} + + + + + +var number:Number = 50; +var str1:String = "str1:String"; + + +namespace Baseball; +namespace Basketball; + +namespace foo = "http://www.macromedia.com/" + + + diff --git a/mozilla/js/tamarin/test/as3/AbcDecoder/typeAnnotation.as b/mozilla/js/tamarin/test/as3/AbcDecoder/typeAnnotation.as new file mode 100644 index 00000000000..8d280fc3ddd --- /dev/null +++ b/mozilla/js/tamarin/test/as3/AbcDecoder/typeAnnotation.as @@ -0,0 +1,47 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + /* + * Ensure the type annotation works while imported + */ + +var SECTION = " "; +var VERSION = "AS3"; +var TITLE = "import annoted type defined in .abc file"; + +startTest(); +writeHeaderToLog( SECTION + " "+ TITLE); + + +AddTestCase( "import the annoted type - number:Number", 50, number); +AddTestCase( "import the annoted type - str1:String", "str1:String", str1); + +test(); diff --git a/mozilla/js/tamarin/test/as3/AbcDecoder/typeAnnotation/varsDef.as b/mozilla/js/tamarin/test/as3/AbcDecoder/typeAnnotation/varsDef.as new file mode 100644 index 00000000000..9ed8cbb25e9 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/AbcDecoder/typeAnnotation/varsDef.as @@ -0,0 +1,125 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + /* + This file is imported with other .as files + */ + +package packOne { + public var var1="packOne:var1"; + public var var2="packOne:var2"; + public var var3="packOne:var3"; + public var var4="packOne:var4"; +} + +package packTwo { + public var p2var1="packTwo:var1"; + public var p2var2="packTwo:var2"; + public var p2var3="packTwo:var3"; + public var p2var4="packTwo:var4"; +} + +package { +public var number:Number = 50; +public var str1:String = "str1:String"; +} + +class testClass { + var testClassVar1 = "Inside testClass"; + function func1() { + return "Inside func1()"; + } + function func2() { + return "Inside func2()"; + + } +} + +final class finClass { + var finClassVar1 = "Inside finClass"; + function finFunc1() { + return "Inside func1()"; + } + function finFunc2() { + return "Inside func2()"; + + } +} + +interface inInterface { + function intFunc1(); + function intFunc2(); +} + + +class accSpecClass { + var accSpec1 = "string"; + public function func1() { + return "Inside func1()-public function"; + } + function func2() { + return "Inside func2()-Dynamic function"; + } + +} + +dynamic class dynClass { + var dynSpec1 = "string"; + public function func1() { + return "Inside func1()-public function"; + } + function func2() { + return "Inside func2()-Dynamic function"; + } +} + +class baseClass +{ + public function overrideFunc() { + } +} + +class childClass extends baseClass +{ +} + + +var str="imported string"; +var num=10; + + +namespace Baseball; +namespace Basketball; + +namespace foo = "http://www.macromedia.com/" + + + diff --git a/mozilla/js/tamarin/test/as3/AbcDecoder/useNS.as b/mozilla/js/tamarin/test/as3/AbcDecoder/useNS.as new file mode 100644 index 00000000000..f40d45e681b --- /dev/null +++ b/mozilla/js/tamarin/test/as3/AbcDecoder/useNS.as @@ -0,0 +1,60 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + /* + * Use the namespace defined in varsDef.as + * avmplus varsDef.abc simple.abc + */ + +var SECTION = " "; +var VERSION = "AS3"; +var TITLE = "import namespace defined from a varsDef.abc file"; + +startTest(); +writeHeaderToLog( SECTION + " "+ TITLE); + +class A{ +use namespace Baseball; +use namespace Basketball; + +Baseball var teamName = "Giants"; +Basketball var teamName = "Kings"; +foo var teamName = "Chargers"; +} + +var obj:A = new A() +AddTestCase( "use namespace 'Baseball' ", "Giants", obj.Baseball::teamName); +AddTestCase( "use namespace 'Basketball' ", "Kings", obj.Basketball::teamName); +AddTestCase( "use namespace 'Basketball' ", "Chargers", obj.foo::teamName); + + + +test(); diff --git a/mozilla/js/tamarin/test/as3/AbcDecoder/useNS/varsDef.as b/mozilla/js/tamarin/test/as3/AbcDecoder/useNS/varsDef.as new file mode 100644 index 00000000000..7d64c90f244 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/AbcDecoder/useNS/varsDef.as @@ -0,0 +1,124 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + /* + This file is imported with other .as files + */ + +package packOne { + public var var1="packOne:var1"; + public var var2="packOne:var2"; + public var var3="packOne:var3"; + public var var4="packOne:var4"; +} + +package packTwo { + public var p2var1="packTwo:var1"; + public var p2var2="packTwo:var2"; + public var p2var3="packTwo:var3"; + public var p2var4="packTwo:var4"; +} +package { +class testClass { + var testClassVar1 = "Inside testClass"; + function func1() { + return "Inside func1()"; + } + function func2() { + return "Inside func2()"; + + } +} + +final class finClass { + var finClassVar1 = "Inside finClass"; + function finFunc1() { + return "Inside func1()"; + } + function finFunc2() { + return "Inside func2()"; + + } +} + +interface inInterface { + function intFunc1(); + function intFunc2(); +} + + +class accSpecClass { + var accSpec1 = "string"; + public function func1() { + return "Inside func1()-public function"; + } + function func2() { + return "Inside func2()-Dynamic function"; + } + +} + +dynamic class dynClass { + var dynSpec1 = "string"; + public function func1() { + return "Inside func1()-public function"; + } + function func2() { + return "Inside func2()-Dynamic function"; + } +} + +class baseClass +{ + public function overrideFunc() { + } +} + +class childClass extends baseClass +{ +} + + +var str="imported string"; +var num=10; + +var number:Number = 50; +var str1:String = "str1:String"; + + +public namespace Baseball; +public namespace Basketball; + +public namespace foo = "http://www.macromedia.com/" +} + + + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/Bug118272Package.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/Bug118272Package.as new file mode 100644 index 00000000000..a24e5d3ae28 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/Bug118272Package.as @@ -0,0 +1,65 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Class Definition"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + +//----------------------------------------------------------------------------- + +import Bug118272Package.*; + + +var eg = new BugTest(); +AddTestCase("Trying to initialize public class identifier", "ReferenceError: Error #1056", referenceError(eg.thisError)); +AddTestCase("Trying to initialize default class identifier", "ReferenceError: Error #1056", referenceError(eg.thisError1)); +AddTestCase("Trying to initialize internal class identifier", "ReferenceError: Error #1056", referenceError(eg.thisError2)); +AddTestCase("Trying to initialize dynamic class identifier", "ReferenceError: Error #1056", referenceError(eg.thisError3)); +AddTestCase("Trying to initialize final class identifier", "ReferenceError: Error #1056", referenceError(eg.thisError4)); + + + +//test case in bug118272 +class A { } +var thisError:String = "no error"; +try{ +A = null; +}catch(e:ReferenceError){ + thisError = e.toString(); +}finally{ +AddTestCase("Trying to initialize class identifier,the class is outside the package", "ReferenceError: Error #1074", referenceError(thisError)); +} + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/Bug118272Package/BugTest.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/Bug118272Package/BugTest.as new file mode 100644 index 00000000000..c0b1ca8adff --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/Bug118272Package/BugTest.as @@ -0,0 +1,87 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +// Bug 118272 - compile-time error to assign to a class identifier + +// more elaborate variants: +package Bug118272Package { + public class pubClass { } + class defClass { } + internal class intClass { } + dynamic class dynClass { } + + final class finClass { } + public class BugTest { + public var thisError="no error"; + public var thisError1="no error"; + public var thisError2="no error"; + public var thisError3="no error"; + public var thisError4="no error"; + public function BugTest(){ + try{ + pubClass = 0; + }catch(e:ReferenceError){ + thisError=e.toString(); + } + + try{ + defClass = 0; + }catch(e1:ReferenceError){ + thisError1=e1.toString(); + } + + try{ + intClass = 0; + }catch(e2:ReferenceError){ + thisError2=e2.toString(); + } + + try{ + dynClass = 0; + }catch(e3:ReferenceError){ + thisError3=e3.toString(); + } + + try{ + finClass = 0; + }catch(e4:ReferenceError){ + thisError4=e4.toString(); + } + } + /*defClass = 1; + intClass = 2; + dynClass = 3; + //expClass = 4; + finClass = 5;*/ + } +} + + + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/Bug155775.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/Bug155775.as new file mode 100644 index 00000000000..761521d344b --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/Bug155775.as @@ -0,0 +1,172 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +// Bug 155775: http://flashqa.macromedia.com/bugapp/detail.asp?ID=155775 + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Class Definition"; // Provide ECMA section title or a description +var BUGNUMBER = "155775"; + +startTest(); +//-------------------------------------------------- + +dynamic class MyClass +{ + public var length:int; + function MyClass() { + length = 3; + this[0] = 0; + this[1] = 1; + this[2] = 123; + } + + function toString():String { + var s:String = ""; + for (var i:int = 0; i < length; i++) + { + s += this[i] + if (i < length - 1) + s += ","; + } + return s; + } +} +MyClass.prototype.concat = Array.prototype.concat; +MyClass.prototype.every = Array.prototype.every; +MyClass.prototype.filter = Array.prototype.filter; +MyClass.prototype.forEach = Array.prototype.forEach; +MyClass.prototype.indexOf = Array.prototype.indexOf; +MyClass.prototype.join = Array.prototype.join; +MyClass.prototype.lastIndexOf = Array.prototype.lastIndexOf; +MyClass.prototype.map = Array.prototype.map; +MyClass.prototype.pop = Array.prototype.pop; +MyClass.prototype.push = Array.prototype.push; +MyClass.prototype.reverse = Array.prototype.reverse; +MyClass.prototype.shift = Array.prototype.shift; +MyClass.prototype.slice = Array.prototype.slice; +MyClass.prototype.some = Array.prototype.some; +MyClass.prototype.sort = Array.prototype.sort; +MyClass.prototype.sortOn = Array.prototype.sortOn; +MyClass.prototype.splice = Array.prototype.splice; +MyClass.prototype.unshift = Array.prototype.unshift; + +class Vegetable { + public var name:String; + public var price:Number; + + public function Vegetable(name:String, price:Number) { + this.name = name; + this.price = price; + } + + public function toString():String { + return " " + name + ":" + price; + } +} + +function isNumeric(item:*, index:int, array:Array):Boolean { + return (item is Number); +} + +var a:MyClass = new MyClass(); +var b:Array = new Array(0, 1, 123); + +// These currently throw a Type Error when -AS3 is not used. +try { + thisError = "no error"; + AddTestCase("a.every(isNumeric)", b.every(isNumeric), a.every(isNumeric)); + AddTestCase("a.filter(isNumeric)", b.filter(isNumeric), a.filter(isNumeric)); + AddTestCase("a.forEach(isNumeric)", b.forEach(isNumeric), a.forEach(isNumeric)); + AddTestCase("a.map(isNumeric)", b.map(isNumeric), a.map(isNumeric)); + AddTestCase("a.some(isNumeric)", b.some(isNumeric), a.some(isNumeric)); +} catch(e:TypeError) { + thisError = e.message; +} finally { + AddTestCase("Array methods with callback functions", "no error", typeError(thisError)); +} + +AddTestCase("a.concat(b)", b.concat(b), a.concat(b)); +AddTestCase("a.indexOf(0)", b.indexOf(0), a.indexOf(0)); +AddTestCase("a.indexOf(1)", b.indexOf(1), a.indexOf(1)); +AddTestCase("a.indexOf(123)", b.indexOf(123), a.indexOf(123)); +AddTestCase("a.join(' and ')", b.join(" and "), a.join(" and ")); + +AddTestCase("a.lastIndexOf(0)", b.lastIndexOf(0), a.lastIndexOf(0)); +AddTestCase("a.lastIndexOf(1)", b.lastIndexOf(1), a.lastIndexOf(1)); +AddTestCase("a.lastIndexOf(123)", b.lastIndexOf(123), a.lastIndexOf(123)); + +AddTestCase("a.pop()", b.pop(), a.pop()); +AddTestCase("a.push(123)", b.push(123), a.push(123)); +AddTestCase("a.reverse()", b.reverse().toString(), a.reverse().toString()); +AddTestCase("a.shift(123)", b.shift(123), a.shift(123)); +AddTestCase("a.slice(0, 2)", b.slice(0, 2).toString(), a.slice(0, 2).toString()); + +var aSort:MyClass = new MyClass(); +aSort.pop(); +aSort.pop(); +aSort.pop(); +aSort.push("lettuce"); +aSort.push("spinach"); +aSort.push("asparagus"); +aSort.push("celery"); +aSort.push("squash"); +var bSort:Array = new Array(); +bSort.push("lettuce"); +bSort.push("spinach"); +bSort.push("asparagus"); +bSort.push("celery"); +bSort.push("squash"); +AddTestCase("aSort.sort()", bSort.sort().toString(), aSort.sort().toString()); + +var aSortOn:MyClass = new MyClass(); +aSortOn.pop(); +aSortOn.pop(); +aSortOn.pop(); +aSortOn.push(new Vegetable("lettuce", 1.49)); +aSortOn.push(new Vegetable("spinach", 1.89)); +aSortOn.push(new Vegetable("asparagus", 3.99)); +aSortOn.push(new Vegetable("celery", 1.29)); +aSortOn.push(new Vegetable("squash", 1.44)); +var bSortOn:Array = new Array(); +bSortOn.push(new Vegetable("lettuce", 1.49)); +bSortOn.push(new Vegetable("spinach", 1.89)); +bSortOn.push(new Vegetable("asparagus", 3.99)); +bSortOn.push(new Vegetable("celery", 1.29)); +bSortOn.push(new Vegetable("squash", 1.44)); +AddTestCase("aSortOn.sortOn('name')", bSortOn.sortOn("name").toString(), aSortOn.sortOn("name").toString()); + +// print results after splicing since splice() returns array of spliced elements, not the result of splicing +AddTestCase("a.splice(2, 0, 3)", (b.splice(2, 0, 3), b.toString()), (a.splice(2, 0, 3), a.toString())); + +AddTestCase("a.unshift(0)", b.unshift(0), a.unshift(0)); + +//-------------------------------------------------- +test(); diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/Bug162570.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/Bug162570.as new file mode 100644 index 00000000000..6c2b1ad3c9d --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/Bug162570.as @@ -0,0 +1,86 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +// Bug 162570: http://flashqa.macromedia.com/bugapp/detail.asp?ID=162570 + +package same { + public class same { + function same() {} + } +} + +package test { + public class More { + function More() {} + + public static var a:int = 0; + public static function foo(foo:int):void { More.a = foo; } + + public var b:Boolean = false; + public function bar(bar:Boolean):void { b = bar; } + } +} + + +//-------------------------------------------------- +startTest(); +//-------------------------------------------------- + +import same.*; +import test.*; + +// same package and class name +var s:same = new same(); +AddTestCase("s is same", true, (s is same)); + +// static method and parameter with the same name +AddTestCase("More.foo(1)", 1, (More.foo(1), More.a)); + +// instance method and parameter with the same name +var m:More = new More(); +AddTestCase("m.bar(true)", true, (m.bar(true), m.b)); + +// instance class and method with the same name +var bar:More = new More(); +AddTestCase("bar.bar(true)", true, (bar.bar(true), bar.b)); + +// instance class and property with the same name +var b:More = new More(); +AddTestCase("b.bar(true)", true, (b.bar(true), b.b)); + +// dynamic method and parameter with the same name +dynamic class C {} +var c:C = new C(); +c.a = false; +c.b = function (b:Boolean):void { c.a = b; } +AddTestCase("c.b(true)", true, (c.b(true), c.a)); + +//-------------------------------------------------- +test(); diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DefaultClass.as new file mode 100644 index 00000000000..f87be952a93 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DefaultClass.as @@ -0,0 +1,124 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + +import DefaultClassSame.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Access Class Properties & Methods"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + +var Obj = new DefaultClassAccessor(); + +// Properties + +// Access default property from same package +AddTestCase( "Access default property from same package", "1,2,3", Obj.accDefProp().toString() ); + +// Access internal property from same package +AddTestCase( "Access internal property from same package", 100, Obj.accIntProp() ); + +// Access protected property from same package - NOT LEGAL OUTSIDE DERIVED CLASS +//AddTestCase( "Access protected property from same package", -1, Obj.accProtProp() ); + +// Access public property from same package +AddTestCase( "Access public property from same package", 1, Obj.accPubProp() ); + +// Access private property from same class and package +AddTestCase( "Access private property from same class and package", true, Obj.accPrivProp() ); + +// Access namespace property from same package +AddTestCase( "Access namespace property from same package", "nsProp", Obj.accNSProp() ); + +// Access static public property from same package +AddTestCase( "Access public static property from same package", true, Obj.accPubStatProp() ); + + +// Methods + + +// Access default method from same package +AddTestCase( "Access default method from same package", true, Obj.accDefMethod() ); + +// Access internal method from same package +AddTestCase( "Access internal method from same package", 50, Obj.accIntMethod() ); + +// Access protected method from same package - NOT LEGAL OUTSIDE DERIVED CLASS +//AddTestCase( "Access protected method from same package", 1, Obj.accProtMethod() ); + +// Access public method from same package +AddTestCase( "Access public method from same package", true, Obj.accPubMethod() ); + +// Access private method from same class and package +AddTestCase( "Access private method from same class and package", true, Obj.accPrivMethod() ); + +// Access namespace method from same package +AddTestCase( "Access namespace method from same package", "nsMethod", Obj.accNSMethod() ); + +// Access final public method from same package +AddTestCase( "Access final public method from same package", 1, Obj.accPubFinMethod() ); + +// Access static public method from same package +AddTestCase( "Access static public method from same package", 42, Obj.accPubStatMethod() ); + +// Error cases + +// access private property from same package not same class +var thisError = "no error thrown"; +try{ + Obj.accPrivPropErr(); +} catch (e) { + thisError = e.toString(); +} finally { + AddTestCase( "Access private property from same package not same class", "ReferenceError: Error #1065", + referenceError( thisError ) ); +} + +// access private method from same package not same class +thisError = "no error thrown"; +try{ + Obj.accPrivMethErr(); +} catch (e2) { + thisError = e2.toString(); +} finally { + AddTestCase( "Access private method from same package not same class", "ReferenceError: Error #1065", + referenceError( thisError ) ); +} + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DefaultClass/DefaultClassSame.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DefaultClass/DefaultClassSame.as new file mode 100644 index 00000000000..88de3c4dce0 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DefaultClass/DefaultClassSame.as @@ -0,0 +1,144 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DefaultClassSame { + + namespace ns; + + class DefaultClass { + + var array:Array = new Array(1,2,3); // Default property + internal var intNumber:Number = 100; // internal property + protected var protInt:int = -1; // protected property + public var pubUint:uint = 1; // public property + private var privVar:Boolean = true; // private property + public static var pubStatBoolean:Boolean = true; // public static property + ns var nsProp:String = "nsProp"; // namespace property + + // default method + function defaultMethod():Boolean{ return true; } + + // Internal method + internal function internalMethod(n:Number):int { return n; } + + // protected method + protected function protectedMethod():uint { return 1; } + + // public method + public function publicMethod():Boolean { return true; } + + // private method + private function privateMethod():Boolean { return true; } + + // namespace method + ns function nsMethod():String { return "nsMethod"; } + + // public final method + public final function publicFinalMethod():Number { return 1; } + + // public static method + public static function publicStaticMethod():int { return 42; } + + // access private property from same class same package + function accPrivProp():Boolean { return this.privVar; } + + // access private method from same class same package + function accPrivMethod():Boolean { return this.privateMethod(); } + + } + + + + public class DefaultClassAccessor { + + var defaultClass:DefaultClass; + + public function DefaultClassAccessor(){ + defaultClass = new DefaultClass(); + } + + // access default property from same package + public function accDefProp():Array{ return defaultClass.array; } + + // access internal property from same package + public function accIntProp():Number{ return defaultClass.intNumber; } + + // access protected property from same package - NOT LEGAL OUTSIDE DERIVED CLASS + // public function accProtProp():int{ return defaultClass.protInt; } + + // access public property from same package + public function accPubProp():uint { return defaultClass.pubUint; } + + // access private property from same class same package + public function accPrivProp():Boolean { return defaultClass.accPrivProp(); } + + // access namespace property from same package + public function accNSProp():String { return defaultClass.ns::nsProp; } + + // access public static property from same package + public function accPubStatProp():Boolean { return DefaultClass.pubStatBoolean; } + + + // access default method from same package + public function accDefMethod():Boolean { return defaultClass.defaultMethod(); } + + // access internal method from same package + public function accIntMethod():Number { return defaultClass.internalMethod(50); } + + // access protected method from same package - NOT LEGAL OUTSIDE DERIVED CLASS + // public function accProtMethod():uint { return defaultClass.protectedMethod(); } + + // access public method from same package + public function accPubMethod():Boolean { return defaultClass.publicMethod(); } + + // access private method from same class and package + public function accPrivMethod():Boolean { return defaultClass.accPrivMethod(); } + + // access namespace method from same package + public function accNSMethod():String { return defaultClass.ns::nsMethod(); } + + // Access final public method from same package + public function accPubFinMethod():Number { return defaultClass.publicFinalMethod(); } + + // access static public method from same package + public function accPubStatMethod():int { return DefaultClass.publicStaticMethod(); } + + // Error cases + + // access private property from same package not same class + public function accPrivPropErr() { return privProp; } + + // access private method from same pakcage not same class + public function accPrivMethErr() { return privMethod(); } + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DefaultClassPrototype.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DefaultClassPrototype.as new file mode 100644 index 00000000000..706be280023 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DefaultClassPrototype.as @@ -0,0 +1,118 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package Prototyping { + + + +import DefaultClassPrototype.*; + +var SECTION = "Class Prototype"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Testing prototype in default classes"; // Provide ECMA section title or a description +//var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var defaultObj = new DefaultClass(); + + +DefaultClass.prototype.array = new Array('a', 'b', 'c'); +AddTestCase( "Try overriding default property through a default class' prototype object", "1,2,3", defaultObj.accessDefaultProperty().toString() ); + +DefaultClass.prototype.intNumber = 500; +AddTestCase( "Try overriding internal property through a default class' prototype object", "100", defaultObj.intNumber.toString() ); + +DefaultClass.prototype.protInt = 0; // Note: this override works because the protected property is not visible! +AddTestCase( "Try overriding protected property through a default class' prototype object", "0", defaultObj.protInt.toString() ); + +DefaultClass.prototype.pubUint = 0; +AddTestCase( "Try overriding public property through a default class' prototype object", "1", defaultObj.pubUint.toString() ); + +DefaultClass.prototype.privVar = false; +AddTestCase( "Try overriding private property through a default class' prototype object", "true", defaultObj.accPrivProp().toString() ); + +DefaultClass.prototype.pubStat = 200; +AddTestCase( "Try overriding public static property through a default class' prototype object", "100", DefaultClass.pubStat.toString() ); + +DefaultClass.prototype.nsProp = "fakeNS"; +AddTestCase( "Try overriding namespace property through a default class' prototype object", "nsProp", defaultObj.accNS().toString() ); + +DefaultClass.prototype.defaultMethod = false; +AddTestCase( "Try overriding default methodsthrough a default class' prototype object", true, defaultObj.defaultMethod() ); + +DefaultClass.prototype.internalMethod = -1; +AddTestCase( "Try overriding internal method through a default class' prototype object", 1, defaultObj.internalMethod() ); + +//DefaultClass.prototype.protectedMethod = -1; +//AddTestCase( "Try overriding protected method through a default class' prototype object", 1, defaultObj.protectedMethod() ); + +DefaultClass.prototype.publicMethod = false; +AddTestCase( "Try overriding public method through a default class' prototype object", true, defaultObj.publicMethod() ); + +DefaultClass.prototype.privateMethod = false; +AddTestCase( "Try overriding private method through a default class' prototype object", true, defaultObj.accPrivMethod() ); + +DefaultClass.prototype.nsMethod = -1; +AddTestCase( "Try overriding namespace method through a default class' prototype object", 1, defaultObj.accNSMethod() ); + +DefaultClass.prototype.publicFinalMethod = -1; +AddTestCase( "Try overriding public final method through a default class' prototype object", 1, defaultObj.publicFinalMethod() ); + +DefaultClass.prototype.publicStaticMethod = -1; +AddTestCase( "Try overriding public static method through a default class' prototype object", 42, DefaultClass.publicStaticMethod() ); + + +DefaultClass.prototype.newArray = new Array('a', 'b', 'c'); +AddTestCase( "Try adding new property through a default class' prototype object", "a,b,c", defaultObj.newArray.toString() ); + +DefaultClass.prototype.testFunction = function () {return true}; +AddTestCase("Try adding new method through a default class' prototype object", true, defaultObj.testFunction()); + +var equivalent:Boolean = (DefaultClass.prototype.constructor == DefaultClass); +AddTestCase("Verify prototype constructor is equivalent to class object", true, equivalent); + + +var thisError10 = "no error thrown"; +var temp:Object = new Object(); +try{ + DefaultClass.prototype = temp; +} catch (e) { + thisError10 = e.toString(); +} finally { + AddTestCase( "Try to write to FinalClass' prototype object", "ReferenceError: Error #1074", + referenceError( thisError10 ) ); +} + +test(); // leave this alone. this executes the test cases and + // displays results. + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DefaultClassPrototype/DefaultClassPrototype.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DefaultClassPrototype/DefaultClassPrototype.as new file mode 100644 index 00000000000..9fca96700a1 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DefaultClassPrototype/DefaultClassPrototype.as @@ -0,0 +1,99 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package Prototyping { + + namespace defaultNS; + + class DefaultClass { + + var array:Array = new Array(1,2,3); // Default property + internal var intNumber:Number = 100; // internal property + protected var protInt:int = -1; // protected property + + public var pubUint:uint = 1; // public property + private var privVar:Boolean = true; // private property + public static var pubStat:Number = 100; // public static property + defaultNS var nsProp:String = "nsProp"; // namespace property + + // default method + function defaultMethod():Boolean{ return true; } + + // Internal method + internal function internalMethod():int { return 1; } + + // protected method + protected function protectedMethod():uint { return 1; } + + // public method + public function publicMethod():Boolean { return true; } + + // private method + private function privateMethod():Boolean { return true; } + + // namespace method + defaultNS function nsMethod():Number { return 1; } + + // public final method + public final function publicFinalMethod():Number { return 1; } + + // public static method + public static function publicStaticMethod():int { return 42; } + + // access private property from same class same package + public function accPrivProp():Boolean { + return this.privVar; + } + + //accessor function for ns property + public function accNS():String { + return this.defaultNS::nsProp; + } + + //accessor function for namespace method + public function accNSMethod():Number{ + return this.defaultNS::nsMethod(); + } + + // access private method from same class same package + public function accPrivMethod():Boolean { + return this.privateMethod(); + } + + //accessor for default property + public function accessDefaultProperty():Array{ + return this.array; + } + + } + + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DefaultDynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DefaultDynamicClass.as new file mode 100644 index 00000000000..3a40ab2fee2 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DefaultDynamicClass.as @@ -0,0 +1,152 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + +import DefaultDynamicClassPackage.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Access Class Properties & Methods"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + +var arr = new Array(1,2,3); +var arr2 = new Array(3,2,1); +var Obj = new DefaultDynamicClassAccessor(); +var d = new Date(0); +var d2 = new Date(1); +var f = new Function(); +var str = "Test"; +var ob = new Object(); + +// ******************************************** +// Access Default method +// ******************************************** +AddTestCase( "*** Access default method of a class ***", 1, 1 ); +AddTestCase( "Obj.setArray(arr), Obj.getArray()", arr, Obj.testGetSetArray(arr) ); + +// ******************************************** +// Access Default virtual method +// ******************************************** +AddTestCase( "*** Access default virtual method of a class ***", 1, 1 ); +AddTestCase( "Obj.setVirtualArray(arr2), Obj.getVirtualArray()", arr2, Obj.testGetSetVirtualArray(arr2) ); + +// ******************************************** +// Access Default Static method +// ******************************************** +AddTestCase( "*** Access static method of a class ***", 1, 1 ); +AddTestCase( "Obj.setStatFunction(f), Obj.getStatFunction()", f, Obj.testGetSetStatFunction(f) ); + +// ******************************************** +// Access Default Final method +// ******************************************** +AddTestCase( "*** Access final method of a class ***", 1, 1 ); +AddTestCase( "Obj.setFinNumber(10), Obj.getFinNumber()", 10, Obj.testGetSetFinNumber(10) ); + +// ******************************************** +// Access Internal method +// ******************************************** +AddTestCase( "*** Access internal method of a class ***", 1, 1 ); +AddTestCase( "Obj.setInternalArray(arr), Obj.getInternalArray()", arr, Obj.testGetSetInternalArray(arr) ); + +// ******************************************** +// Access Internal virtual method +// ******************************************** +AddTestCase( "*** Access internal virtual method of a class ***", 1, 1 ); +AddTestCase( "Obj.setInternalVirtualArray(arr2), Obj.getInternalVirtualArray()", arr2, Obj.testGetSetInternalVirtualArray(arr2) ); + +// ******************************************** +// Access Internal Static method +// ******************************************** +AddTestCase( "*** Access internal static method of a class ***", 1, 1 ); +AddTestCase( "Obj.setInternalStatFunction(f), Obj.getInternalStatFunction()", f, Obj.testGetSetInternalStatFunction(f) ); + +// ******************************************** +// Access Internal Final method +// ******************************************** +AddTestCase( "*** Access internal final method of a class ***", 1, 1 ); +AddTestCase( "Obj.setInternalFinNumber(10), Obj.getInternalFinNumber()", 10, Obj.testGetSetInternalFinNumber(10) ); + +// ******************************************** +// Access Private method +// ******************************************** +AddTestCase( "*** Access private method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPrivDate(date), Obj.getPrivDate()", d.getFullYear(), Obj.testGetSetPrivDate(d).getFullYear() ); + +// ******************************************** +// Access Private virtualmethod +// ******************************************** +AddTestCase( "*** Access private virtual method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPrivVirtualDate(date2), Obj.getPrivVirtaulDate()", d2.getFullYear(), Obj.testGetSetPrivVirtualDate(d2).getFullYear() ); + +// ******************************************** +// Access Private Static method +// ******************************************** +AddTestCase( "*** Access private static method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPrivStatString(s), Obj.getPrivStatString", str, Obj.testGetSetPrivStatString(str) ); + +// ******************************************** +// Access Private Final method +// ******************************************** +AddTestCase( "*** Access private final method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPrivFinalString(s), Obj.getPrivFinalString", str, Obj.testGetSetPrivFinalString(str) ); + +// ******************************************** +// Access Public method +// ******************************************** +AddTestCase( "*** Access public method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPubBoolean(b), Obj.getPubBoolean()", true, (Obj.setPubBoolean(true), Obj.getPubBoolean()) ); + +// ******************************************** +// Access Public virtual method +// ******************************************** +AddTestCase( "*** Access public virtual method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPubVirtualBoolean(false), Obj.getPubVirtualBoolean()", false, (Obj.setPubVirtualBoolean(false), Obj.getPubVirtualBoolean()) ); + +// ******************************************** +// Access Public Static method +// ******************************************** +AddTestCase( "*** Access public static method of a class ***", 1, 1 ); +AddTestCase( "Obj..setPubStatObject(ob), Obj.getPubStatObject()", ob, (Obj.setPubStatObject(ob), Obj.getPubStatObject()) ); + +// ******************************************** +// Access Public Final method +// ******************************************** +AddTestCase( "*** Access public final method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPubFinArray(arr), Obj.getPubFinArray()", arr, (Obj.setPubFinArray(arr), Obj.getPubFinArray()) ); + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DefaultDynamicClass/DefaultDynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DefaultDynamicClass/DefaultDynamicClass.as new file mode 100644 index 00000000000..f8dca0980ec --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DefaultDynamicClass/DefaultDynamicClass.as @@ -0,0 +1,266 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DefaultDynamicClassPackage { + dynamic class DefaultDynamicClass { + + var array:Array; // Default property + static var statFunction:Function; // Default Static property + internal var finNumber:Number; // Default Final property + internal static var finStatNumber:Number; // Default Final Static property + + internal var internalArray:Array; // Internal property + internal static var internalStatFunction:Function; // Internal Static property + internal var internalFinNumber:Number; // Internal Final property + internal static var internalFinStatNumber:Number; // Internal Final Static property + + private var privDate:Date; // Private property + private static var privStatString:String; // Private Static property + private var privFinalString:String; // Private Final property + private static var privFinalStaticString:String // Private Final Static property + + public var pubBoolean:Boolean; // Public property + public static var pubStatObject:Object; // Public Static property + public var pubFinArray:Array; // Public Final property + public static var pubFinalStaticNumber:Number // Public Final Static property + + + // ***************** + // Default methods + // ***************** + function getArray() : Array { return array; } + function setArray( a:Array ) { array = a; } + + + // ************************ + // Default virtual methods + // ************************ + virtual function getVirtualArray() : Array { return array; } + virtual function setVirtualArray( a:Array ) { array = a; } + + + // *********************** + // Default Static methods + // *********************** + static function setStatFunction(f:Function) { statFunction = f; } + static function getStatFunction() : Function { return statFunction; } + + + // ********************** + // Default Final methods + // ********************** + final function setFinNumber(n:Number) { finNumber = n; } + final function getFinNumber() : Number { return finNumber; } + + + // ***************** + // Internal methods + // ***************** + internal function getInternalArray() : Array { return internalArray; } + internal function setInternalArray( a:Array ) { internalArray = a; } + + + // ************************* + // Internal virtual methods + // ************************* + internal virtual function getInternalVirtualArray() : Array { return internalArray; } + internal virtual function setInternalVirtualArray( a:Array ) { internalArray = a; } + + + // *********************** + // Internal Static methods + // *********************** + internal static function setInternalStatFunction(f:Function) { DefaultDynamicClass.internalStatFunction = f; } + internal static function getInternalStatFunction() : Function { return DefaultDynamicClass.internalStatFunction; } + + + // ********************** + // Internal Final methods + // ********************** + internal final function setInternalFinNumber(n:Number) { internalFinNumber = n; } + internal final function getInternalFinNumber() : Number { return internalFinNumber; } + + + // ******************* + // Private methods + // ******************* + private function getPrivDate() : Date { return privDate; } + private function setPrivDate( d:Date ) { privDate = d; } + // wrapper function + public function testGetSetPrivDate(d:Date) : Date { + setPrivDate(d); + return getPrivDate(); + } + + + // ******************* + // Private virutal methods + // ******************* + private virtual function getPrivVirtualDate() : Date { return privDate; } + private virtual function setPrivVirtualDate( d:Date ) { privDate = d; } + // wrapper function + public function testGetSetPrivVirtualDate(d:Date) : Date { + setPrivVirtualDate(d); + return getPrivVirtualDate(); + } + + + // ************************** + // Private Static methods + // ************************** + private static function setPrivStatString(s:String) { privStatString = s; } + private static function getPrivStatString() : String { return privStatString; } + // wrapper function + public function testGetSetPrivStatString(s:String) : String { + setPrivStatString(s); + return getPrivStatString(); + } + + + // ************************** + // Private Final methods + // ************************** + private final function setPrivFinalString(s:String) { privFinalString = s; } + private final function getPrivFinalString() : String { return privFinalString; } + // wrapper function + public function testGetSetPrivFinalString(s:String) : String { + setPrivFinalString(s); + return getPrivFinalString(); + } + + + // ******************* + // Public methods + // ******************* + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function getPubBoolean() : Boolean { return pubBoolean; } + + + // ******************* + // Public virtual methods + // ******************* + public virtual function setPubVirtualBoolean( b:Boolean ) { pubBoolean = b; } + public virtual function getPubVirtualBoolean() : Boolean { return pubBoolean; } + + + // ************************** + // Public Static methods + // ************************** + public static function setPubStatObject(o:Object) { DefaultDynamicClass.pubStatObject = o; } + public static function getPubStatObject() : Object { return DefaultDynamicClass.pubStatObject; } + + + // ******************* + // Public Final methods + // ******************* + public final function setPubFinArray(a:Array) { pubFinArray = a; } + public final function getPubFinArray() : Array { return pubFinArray; } + + + } + + public class DefaultDynamicClassAccessor { + private var Obj:DefaultDynamicClass = new DefaultDynamicClass(); + + // Default method + public function testGetSetArray(a:Array) : Array { + Obj.setArray(a); + return Obj.getArray(); + } + // Default virtual method + public function testGetSetVirtualArray(a:Array) : Array { + Obj.setVirtualArray(a); + return Obj.getVirtualArray(); + } + // Default static method + public function testGetSetStatFunction(f:Function) : Function { + DefaultDynamicClass.setStatFunction(f); + return DefaultDynamicClass.getStatFunction(); + } + // Default final method + public function testGetSetFinNumber(n:Number) : Number { + Obj.setFinNumber(n); + return Obj.getFinNumber(); + } + + // internal method + public function testGetSetInternalArray(a:Array) : Array { + Obj.setInternalArray(a); + return Obj.getInternalArray(); + } + // internal virtual method + public function testGetSetInternalVirtualArray(a:Array) : Array { + Obj.setInternalVirtualArray(a); + return Obj.getInternalVirtualArray(); + } + // internal static method + public function testGetSetInternalStatFunction(f:Function) : Function { + DefaultDynamicClass.setInternalStatFunction(f); + return DefaultDynamicClass.getInternalStatFunction(); + } + // internal final method + public function testGetSetInternalFinNumber(n:Number) : Number { + Obj.setInternalFinNumber(n); + return Obj.getInternalFinNumber(); + } + + // private method + public function testGetSetPrivDate(d:Date) : Date { + return Obj.testGetSetPrivDate(d); + } + // private virtualmethod + public function testGetSetPrivVirtualDate(d:Date) : Date { + return Obj.testGetSetPrivVirtualDate(d); + } + // Private Static methods + public function testGetSetPrivStatString(s:String) : String { + return Obj.testGetSetPrivStatString(s); + } + // Private Final methods + public function testGetSetPrivFinalString(s:String) : String { + return Obj.testGetSetPrivFinalString(s); + } + + // Public methods + public function setPubBoolean( b:Boolean ) { Obj.setPubBoolean(b); } + public function getPubBoolean() : Boolean { return Obj.getPubBoolean(); } + // Public virtual methods + public function setPubVirtualBoolean( b:Boolean ) { Obj.setPubVirtualBoolean(b); } + public function getPubVirtualBoolean() : Boolean { return Obj.getPubVirtualBoolean(); } + // Public Static methods + public function setPubStatObject(o:Object) { DefaultDynamicClass.setPubStatObject(o); } + public function getPubStatObject() : Object { return DefaultDynamicClass.getPubStatObject(); } + // Public Final methods + public function setPubFinArray(a:Array) { Obj.setPubFinArray(a); } + public function getPubFinArray() : Array { return Obj.getPubFinArray(); } + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DynamicClass.as new file mode 100644 index 00000000000..40e16144a5d --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DynamicClass.as @@ -0,0 +1,122 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import DynamicClassSame.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Access Class Properties & Methods"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + +var Obj = new DynamicClassAccessor(); + +// Properties + +// Access default property from same package +AddTestCase( "Access default property from same package", "1,2,3", Obj.accDefProp().toString() ); + +// Access internal property from same package +AddTestCase( "Access internal property from same package", 100, Obj.accIntProp() ); + +// Access protected property from same package - NOT LEGAL OUTSIDE DERIVED CLASS +//AddTestCase( "Access protected property from same package", -1, Obj.accProtProp() ); + +// Access public property from same package +AddTestCase( "Access public property from same package", 1, Obj.accPubProp() ); + +// Access private property from same class and package +AddTestCase( "Access private property from same class and package", true, Obj.accPrivProp() ); + +// Access namespace property from same package +AddTestCase( "Access namespace property from same package", "nsProp", Obj.accNSProp() ); + +// Access static public property from same package +AddTestCase( "Access public static property from same package", true, Obj.accPubStatProp() ); + + +// Methods + + +// Access default method from same package +AddTestCase( "Access default method from same package", true, Obj.accDefMethod() ); + +// Access internal method from same package +AddTestCase( "Access internal method from same package", 50, Obj.accIntMethod() ); + +// Access protected method from same package - NOT LEGAL OUTSIDE DERIVED CLASS +//AddTestCase( "Access protected method from same package", 1, Obj.accProtMethod() ); + +// Access public method from same package +AddTestCase( "Access public method from same package", true, Obj.accPubMethod() ); + +// Access private method from same class and package +AddTestCase( "Access private method from same class and package", true, Obj.accPrivMethod() ); + +// Access namespace method from same package +AddTestCase( "Access namespace method from same package", "nsMethod", Obj.accNSMethod() ); + +// Access final public method from same package +AddTestCase( "Access final public method from same package", 1, Obj.accPubFinMethod() ); + +// Access static public method from same package +AddTestCase( "Access static public method from same package", 42, Obj.accPubStatMethod() ); + +// Error cases + +// access private property from same package not same class +var thisError = "no error thrown"; +try{ + Obj.accPrivPropErr(); +} catch (e) { + thisError = e.toString(); +} finally { + AddTestCase( "Access private property from same package not same class", "ReferenceError: Error #1065", + referenceError( thisError ) ); +} + +// access private method from same package not same class +thisError = "no error thrown"; +try{ + Obj.accPrivMethErr(); +} catch (e2) { + thisError = e2.toString(); +} finally { + AddTestCase( "Access private method from same package not same class", "ReferenceError: Error #1065", + referenceError( thisError ) ); +} + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DynamicClass/DynamicClassSame.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DynamicClass/DynamicClassSame.as new file mode 100644 index 00000000000..a7fbf7650ae --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DynamicClass/DynamicClassSame.as @@ -0,0 +1,143 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DynamicClassSame { + + namespace ns; + + dynamic class DynamicClass { + + var array:Array = new Array(1,2,3); // Default property + internal var intNumber:Number = 100; // internal property + protected var protInt:int = -1; // protected property + public var pubUint:uint = 1; // public property + private var privVar:Boolean = true; // private property + public static var pubStatBoolean:Boolean = true; // public static property + ns var nsProp:String = "nsProp"; // namespace property + + // default method + function defaultMethod():Boolean{ return true; } + + // Internal method + internal function internalMethod(n:Number):int { return n; } + + // protected method + protected function protectedMethod():uint { return 1; } + + // public method + public function publicMethod():Boolean { return true; } + + // private method + private function privateMethod():Boolean { return true; } + + // namespace method + ns function nsMethod():String { return "nsMethod"; } + + // public final method + public final function publicFinalMethod():Number { return 1; } + + // public static method + public static function publicStaticMethod():int { return 42; } + + // access private property from same class same package + function accPrivProp():Boolean { return this.privVar; } + + // access private method from same class same package + function accPrivMethod():Boolean { return this.privateMethod(); } + + } + + + + public class DynamicClassAccessor { + + var acc:DynamicClass; + + public function DynamicClassAccessor(){ + acc = new DynamicClass(); + } + + // access default property from same package + public function accDefProp():Array{ return acc.array; } + + // access internal property from same package + public function accIntProp():Number{ return acc.intNumber; } + + // access protected property from same package - NOT LEGAL OUTSIDE DERIVED CLASS + //public function accProtProp():int{ return acc.protInt; } + + // access public property from same package + public function accPubProp():uint { return acc.pubUint; } + + // access private property from same class same package + public function accPrivProp():Boolean { return acc.accPrivProp(); } + + // access namespace property from same package + public function accNSProp():String { return acc.ns::nsProp; } + + // access public static property from same package + public function accPubStatProp():Boolean { return DynamicClass.pubStatBoolean; } + + + // access default method from same package + public function accDefMethod():Boolean { return acc.defaultMethod(); } + + // access internal method from same package + public function accIntMethod():Number { return acc.internalMethod(50); } + + // access protected method from same package - NOT LEGAL OUTSIDE DERIVED CLASS + //public function accProtMethod():uint { return acc.protectedMethod(); } + + // access public method from same package + public function accPubMethod():Boolean { return acc.publicMethod(); } + + // access private method from same class and package + public function accPrivMethod():Boolean { return acc.accPrivMethod(); } + + // access namespace method from same package + public function accNSMethod():String { return acc.ns::nsMethod(); } + + // Access final public method from same package + public function accPubFinMethod():Number { return acc.publicFinalMethod(); } + + // access static public method from same package + public function accPubStatMethod():int { return DynamicClass.publicStaticMethod(); } + + // Error cases + + // access private property from same package not same class + public function accPrivPropErr() { return privProp; } + + // access private method from same pakcage not same class + public function accPrivMethErr() { return privMethod(); } + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DynamicClassHasOwnProperty.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DynamicClassHasOwnProperty.as new file mode 100644 index 00000000000..de76d89a794 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DynamicClassHasOwnProperty.as @@ -0,0 +1,57 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + +import DynamicClassHasOwnPropertyPackage.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Call hasOwnProperty() on a property of a dynamic class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + +var Obj:DynamicClassHasOwnProperty = new DynamicClassHasOwnProperty(); + + +// ******************************************** +// Call hasOwnProperty() +// +// ******************************************** + +AddTestCase( "Obj.hasOwnProperty(\"bar\")", true, Obj.hasOwnProperty("bar") ); + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DynamicClassHasOwnProperty/DynamicClassHasOwnProperty.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DynamicClassHasOwnProperty/DynamicClassHasOwnProperty.as new file mode 100644 index 00000000000..2b6de21503d --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DynamicClassHasOwnProperty/DynamicClassHasOwnProperty.as @@ -0,0 +1,47 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + + package DynamicClassHasOwnPropertyPackage { + + + public dynamic class DynamicClassHasOwnProperty { + + public var bar:Number; + public function testHasOwnProperty(p:String) { + bar = 10; + return this.hasOwnProperty(p); + } + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DynamicClassMeth.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DynamicClassMeth.as new file mode 100644 index 00000000000..a8fa882c478 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DynamicClassMeth.as @@ -0,0 +1,60 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + +import DynamicClassMethPackage.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Add function to Dynamic Class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + +var Obj = new DynamicClassMeth(); + +Obj.foo = function () { return 100;} + + +// ******************************************** +// Access property of type Number +// +// ******************************************** + +AddTestCase( "*** Access function added to a dynamic class ***", 1, 1 ); +AddTestCase( "Obj.foo()", 100, Obj.foo() ); + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DynamicClassMeth/DynamicClassMeth.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DynamicClassMeth/DynamicClassMeth.as new file mode 100644 index 00000000000..ea79f498942 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DynamicClassMeth/DynamicClassMeth.as @@ -0,0 +1,168 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + + package DynamicClassMethPackage { + + + public dynamic class DynamicClassMeth { + + var array:Array; + + private var privDate:Date; + + public var pubBoolean:Boolean; + + static var statFunction:Function; + + private static var privStatString:String; + + public static var pubStatObject:Object; + + internal var finNumber:Number; + + public var pubFinArray:Array; + + internal static var finStatNumber:Number; + + + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function setArray( a:Array ) { array = a; } + + // wrapper function + + public function testGetSetArray(a:Array) : Array { + setArray(a); + return getArray(); + } + + + // ******************* + // private methods + // ******************* + + private function getPrivDate() : Date { return privDate; } + private function setPrivDate( d:Date ) { privDate = d; } + + // wrapper function + + public function testGetSetPrivDate(d:Date) : Date { + setPrivDate(d); + return getPrivDate(); + } + + + + // ******************* + // public methods + // ******************* + + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function getPubBoolean() : Boolean { return pubBoolean; } + + + + // ******************* + // static methods + // ******************* + + static function setStatFunction(f:Function) { statFunction = f; } + static function getStatFunction() { return statFunction; } + + // wrapper function + + public function testGetSetStatFunction(f:Function) : Function { + setStatFunction(f); + return getStatFunction(); + } + + + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatString(s:String) { privStatString = s; } + private static function getPrivStatString() { return privStatString; } + + // wrapper function + + public function testGetSetPrivStatString(s:String) : String { + setPrivStatString(s); + return getPrivStatString(); + } + + + + // ************************** + // public static methods + // ************************** + + public static function setPubStatObject(o:Object) { pubStatObject = o; } + public static function getPubStatObject() { return pubStatObject; } + + + + // ******************* + // final methods + // ******************* + + final function setFinNumber(n:Number) { finNumber = n; } + final function getFinNumber() { return finNumber; } + + // wrapper function + + public function testGetSetFinNumber(n:Number) : Number { + setFinNumber(n); + return getFinNumber(); + } + + + + // ******************* + // public final methods + // ******************* + + public final function setPubFinArray(a:Array) { pubFinArray = a; } + public final function getPubFinArray() { return pubFinArray; } + + + + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DynamicClassProp.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DynamicClassProp.as new file mode 100644 index 00000000000..91883f0744e --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DynamicClassProp.as @@ -0,0 +1,118 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + +import DynamicClassPropPackage.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Add Properties to Dynamic Class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + +var Obj = new DynamicClassProp(); + + +var arr = new Array(1,2,3); + +var d = new Date(0); + +var str = "Test"; + +var ob = new Object(); + + +Obj.prop1 = 100; +Obj.prop2 = "Test"; +Obj.prop3 = true; +Obj.prop4 = arr; +Obj.prop5 = d; +Obj.prop6 = ob; + + +// ******************************************** +// Access property of type Number +// +// ******************************************** + +AddTestCase( "*** Access property of type Number ***", 1, 1 ); +AddTestCase( "Obj.prop1", 100, Obj.prop1 ); + + +// ******************************************** +// Access property of type String +// +// ******************************************** + +AddTestCase( "*** Access property of type String ***", 1, 1 ); +AddTestCase( "Obj.prop2", "Test", Obj.prop2 ); + + +// ******************************************** +// Access property of type Boolean +// +// ******************************************** + +AddTestCase( "*** Access property of type Boolean ***", 1, 1 ); +AddTestCase( "Obj.prop3", true, Obj.prop3 ); + + +// ******************************************** +// Access property of type Array +// +// ******************************************** + +AddTestCase( "*** Access property of type Array ***", 1, 1 ); +AddTestCase( "Obj.prop4", arr, Obj.prop4 ); + +// ******************************************** +// Access property of type Date +// ******************************************** + +AddTestCase( "*** Access property of type Date ***", 1, 1 ); +AddTestCase( "Obj.prop5", d, Obj.prop5 ); + + +// ******************************************** +// Access property of type Object +// ******************************************** + +AddTestCase( "*** Access property of type Object ***", 1, 1 ); +AddTestCase( "Obj.prop6", ob, Obj.prop6 ); + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DynamicClassProp/DynamicClassProp.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DynamicClassProp/DynamicClassProp.as new file mode 100644 index 00000000000..ae7cb00348c --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DynamicClassProp/DynamicClassProp.as @@ -0,0 +1,170 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + + package DynamicClassPropPackage { + + + public dynamic class DynamicClassProp { + + var array:Array; + + private var privDate:Date; + + public var pubBoolean:Boolean; + + static var statFunction:Function; + + private static var privStatString:String; + + public static var pubStatObject:Object; + + internal var finNumber:Number; + + public var pubFinArray:Array; + + internal static var finStatNumber:Number; + + + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function setArray( a:Array ) { array = a; } + + // wrapper function + + public function testGetSetArray(a:Array) : Array { + setArray(a); + return getArray(); + } + + + // ******************* + // private methods + // ******************* + + private function getPrivDate() : Date { return privDate; } + private function setPrivDate( d:Date ) { privDate = d; } + + // wrapper function + + public function testGetSetPrivDate(d:Date) : Date { + setPrivDate(d); + return getPrivDate(); + } + + + + // ******************* + // public methods + // ******************* + + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function getPubBoolean() : Boolean { return pubBoolean; } + + + + // ******************* + // static methods + // ******************* + + static function setStatFunction(f:Function) { statFunction = f; } + static function getStatFunction() { return statFunction; } + + // wrapper function + + public function testGetSetStatFunction(f:Function) : Function { + setStatFunction(f); + return getStatFunction(); + } + + + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatString(s:String) { privStatString = s; } + private static function getPrivStatString() { return privStatString; } + + // wrapper function + + public function testGetSetPrivStatString(s:String) : String { + setPrivStatString(s); + return getPrivStatString(); + } + + + + // ************************** + // public static methods + // ************************** + + public static function setPubStatObject(o:Object) { pubStatObject = o; } + public static function getPubStatObject() { return pubStatObject; } + + + + // ******************* + // final methods + // ******************* + + final function setFinNumber(n:Number) { finNumber = n; } + final function getFinNumber() { return finNumber; } + + // wrapper function + + public function testGetSetFinNumber(n:Number) : Number { + setFinNumber(n); + return getFinNumber(); + } + + + + // ******************* + // public final methods + // ******************* + + public final function setPubFinArray(a:Array) { pubFinArray = a; } + public final function getPubFinArray() { return pubFinArray; } + + + + + + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DynamicClassPrototype.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DynamicClassPrototype.as new file mode 100644 index 00000000000..90664486d54 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DynamicClassPrototype.as @@ -0,0 +1,119 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package Prototyping { + + + +import DynamicClassPrototype.*; + +var SECTION = "Class Prototype"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Testing prototype in dynamic classes"; // Provide ECMA section title or a description +//var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var dynamicObj = new DynamicClass(); + + + +DynamicClass.prototype.array = new Array('a', 'b', 'c'); +AddTestCase( "Try overriding default property through a dynamic class' prototype object", "1,2,3", dynamicObj.accessDefaultProperty().toString() ); + +DynamicClass.prototype.intNumber = 500; +AddTestCase( "Try overriding internal property through a dynamic class' prototype object", "100", dynamicObj.intNumber.toString() ); + +DynamicClass.prototype.protInt = 0; // Note: this works because the protected property is not visible! +AddTestCase( "Try overriding protected property through a dynamic class' prototype object", "0", dynamicObj.protInt.toString() ); + +DynamicClass.prototype.pubUint = 0; +AddTestCase( "Try overriding public property through a dynamic class' prototype object", "1", dynamicObj.pubUint.toString() ); + +DynamicClass.prototype.privVar = false; +AddTestCase( "Try overriding private property through a dynamic class' prototype object", "true", dynamicObj.accPrivProp().toString() ); + +DynamicClass.prototype.pubStat = 200; +AddTestCase( "Try overriding public static property through a dynamic class' prototype object", "100", DynamicClass.pubStat.toString() ); + +DynamicClass.prototype.nsProp = "fakeNS"; +AddTestCase( "Try overriding namespace property through a dynamic class' prototype object", "nsProp", dynamicObj.accNS().toString() ); + +DynamicClass.prototype.DynamicMethod = false; +AddTestCase( "Try overriding Dynamic method through a dynamic class' prototype object", true, dynamicObj.defaultMethod() ); + +DynamicClass.prototype.internalMethod = -1; +AddTestCase( "Try overriding internal method through a dynamic class' prototype object", 1, dynamicObj.internalMethod() ); + +//DynamicClass.prototype.protectedMethod = -1; +//AddTestCase( "Try overriding protected method through a dynamic class' prototype object", 1, dynamicObj.protectedMethod() ); + +DynamicClass.prototype.publicMethod = false; +AddTestCase( "Try overriding public method through a dynamic class' prototype object", true, dynamicObj.publicMethod() ); + +DynamicClass.prototype.privateMethod = false; +AddTestCase( "Try overriding private method through a dynamic class' prototype object", true, dynamicObj.accPrivMethod() ); + +DynamicClass.prototype.nsMethod = -1; +AddTestCase( "Try overriding namespace method through a dynamic class' prototype object", 1, dynamicObj.accNSMethod() ); + +DynamicClass.prototype.publicFinalMethod = -1; +AddTestCase( "Try overriding public final method through a dynamic class' prototype object", 1, dynamicObj.publicFinalMethod() ); + +DynamicClass.prototype.publicStaticMethod = -1; +AddTestCase( "Try overriding public static method through a dynamic class' prototype object", 42, DynamicClass.publicStaticMethod() ); + + +DynamicClass.prototype.newArray = new Array('a', 'b', 'c'); +AddTestCase( "Try adding new property through a dynamic class' prototype object", "a,b,c", dynamicObj.newArray.toString() ); + +DynamicClass.prototype.testFunction = function () {return true}; +AddTestCase("Try adding new method through a dynamic class' prototype object", true, dynamicObj.testFunction()); + +var equivalent:Boolean = (DynamicClass.prototype.constructor == DynamicClass); +AddTestCase("Verify prototype constructor is equivalent to class object", true, equivalent); + + +var thisError10 = "no error thrown"; +var temp:Object = new Object(); +try{ + DynamicClass.prototype = temp; +} catch (e) { + thisError10 = e.toString(); +} finally { + AddTestCase( "Try to write to FinalClass' prototype object", "ReferenceError: Error #1074", + referenceError( thisError10 ) ); +} + +test(); // leave this alone. this executes the test cases and + // displays results. + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DynamicClassPrototype/DynamicClassPrototype.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DynamicClassPrototype/DynamicClassPrototype.as new file mode 100644 index 00000000000..aba79a61095 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DynamicClassPrototype/DynamicClassPrototype.as @@ -0,0 +1,96 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package Prototyping { + + namespace dynamicNS; + + dynamic class DynamicClass { + + var array:Array = new Array(1,2,3); // Default property + internal var intNumber:Number = 100; // internal property + protected var protInt:int = -1; // protected property + public var pubUint:uint = 1; // public property + private var privVar:Boolean = true; // private property + public static var pubStat:Number = 100; // public static property + dynamicNS var nsProp:String = "nsProp"; // namespace property + + // default method + function defaultMethod():Boolean{ return true; } + + // Internal method + internal function internalMethod():int { return 1; } + + // protected method + protected function protectedMethod():uint { return 1; } + + // public method + public function publicMethod():Boolean { return true; } + + // private method + private function privateMethod():Boolean { return true; } + + // namespace method + dynamicNS function nsMethod():Number { return 1; } + + // public final method + public final function publicFinalMethod():Number { return 1; } + + // public static method + public static function publicStaticMethod():int { return 42; } + + // access private property from same class same package + function accPrivProp():Boolean { + return this.privVar; + } + + // access private method from same class same package + function accPrivMethod():Boolean { + return this.privateMethod(); + } + + //accessor for default property + public function accessDefaultProperty():Array{ + return this.array; + } + + //accessor function for ns property + public function accNS():String { + return this.dynamicNS::nsProp; + } + + //accessor function for namespace method + public function accNSMethod():Number{ + return this.dynamicNS::nsMethod(); + } + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DynamicClassSameMethPropName.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DynamicClassSameMethPropName.as new file mode 100644 index 00000000000..f1343ddd05e --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DynamicClassSameMethPropName.as @@ -0,0 +1,68 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + +import DynamicClassSameMethPropNamePackage.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Add function with the same name as a property to Dynamic Class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + +var Obj = new DynamicClassSameMethPropName(); +var thisError = "no exception given"; +try{ + Obj.pubBoolean = function () { return 100;} +} catch (e){ + thisError = e.toString(); +} finally { + AddTestCase( "attempt to assign a function to a boolean property", "no exception given",typeError(thisError) ); + AddTestCase( "get function to a boolean property", true, Obj.pubBoolean ); +} + +thisError = "no exception given"; +try{ + Obj.pubBoolean = 123; +} catch(e2) { + thisError = e2.toString(); +} finally { + AddTestCase( "attempt to assign a number to a boolean property", "no exception given", typeError(thisError)); + AddTestCase( "get number assigned to a boolean property", true, Obj.pubBoolean); +} + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DynamicClassSameMethPropName/DynamicClassSameMethPropName.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DynamicClassSameMethPropName/DynamicClassSameMethPropName.as new file mode 100644 index 00000000000..595e144b847 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/DynamicClassSameMethPropName/DynamicClassSameMethPropName.as @@ -0,0 +1,168 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + + package DynamicClassSameMethPropNamePackage { + + + public dynamic class DynamicClassSameMethPropName { + + var array:Array; + + private var privDate:Date; + + public var pubBoolean:Boolean; + + static var statFunction:Function; + + private static var privStatString:String; + + public static var pubStatObject:Object; + + internal var finNumber:Number; + + public var pubFinArray:Array; + + internal static var finStatNumber:Number; + + + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function setArray( a:Array ) { array = a; } + + // wrapper function + + public function testGetSetArray(a:Array) : Array { + setArray(a); + return getArray(); + } + + + // ******************* + // private methods + // ******************* + + private function getPrivDate() : Date { return privDate; } + private function setPrivDate( d:Date ) { privDate = d; } + + // wrapper function + + public function testGetSetPrivDate(d:Date) : Date { + setPrivDate(d); + return getPrivDate(); + } + + + + // ******************* + // public methods + // ******************* + + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function getPubBoolean() : Boolean { return pubBoolean; } + + + + // ******************* + // static methods + // ******************* + + static function setStatFunction(f:Function) { statFunction = f; } + static function getStatFunction() { return statFunction; } + + // wrapper function + + public function testGetSetStatFunction(f:Function) : Function { + setStatFunction(f); + return getStatFunction(); + } + + + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatString(s:String) { privStatString = s; } + private static function getPrivStatString() { return privStatString; } + + // wrapper function + + public function testGetSetPrivStatString(s:String) : String { + setPrivStatString(s); + return getPrivStatString(); + } + + + + // ************************** + // public static methods + // ************************** + + public static function setPubStatObject(o:Object) { pubStatObject = o; } + public static function getPubStatObject() { return pubStatObject; } + + + + // ******************* + // final methods + // ******************* + + final function setFinNumber(n:Number) { finNumber = n; } + final function getFinNumber() { return finNumber; } + + // wrapper function + + public function testGetSetFinNumber(n:Number) : Number { + setFinNumber(n); + return getFinNumber(); + } + + + + // ******************* + // public final methods + // ******************* + + public final function setPubFinArray(a:Array) { pubFinArray = a; } + public final function getPubFinArray() { return pubFinArray; } + + + + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalClassPrototype.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalClassPrototype.as new file mode 100644 index 00000000000..5e89461b94a --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalClassPrototype.as @@ -0,0 +1,118 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package Prototyping { + + + +import FinalClassPrototype.*; + +var SECTION = "Class Prototype"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Prototype testing for final classes"; // Provide ECMA section title or a description +//var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var finalObj = new FinalClass(); + + +FinalClass.prototype.array = new Array('a', 'b', 'c'); +AddTestCase( "Try overriding default property through a Final Class' prototype object", "1,2,3", finalObj.accessDefaultProperty().toString() ); + +FinalClass.prototype.intNumber = 500; +AddTestCase( "Try overriding internal property through a Final Class' prototype object", "100", finalObj.intNumber.toString() ); + +FinalClass.prototype.protInt = 0; // Note: this works because the protected property is not visible! +AddTestCase( "Try overriding protected property through a Final Class' prototype object", "0", finalObj.protInt.toString() ); + +FinalClass.prototype.pubUint = 0; +AddTestCase( "Try overriding public property through a Final Class' prototype object", "1", finalObj.pubUint.toString() ); + +FinalClass.prototype.privVar = false; +AddTestCase( "Try overriding private property through a Final Class' prototype object", "true", finalObj.accPrivProp().toString() ); + +FinalClass.prototype.pubStat = 200; +AddTestCase( "Try overriding public static property through a Final Class' prototype object", "100", FinalClass.pubStat.toString() ); + +FinalClass.prototype.nsProp = "fakeNS"; +AddTestCase( "Try overriding namespace property through a Final Class' prototype object", "nsProp", finalObj.accNS().toString() ); + +FinalClass.prototype.defaultMethod = false; +AddTestCase( "Try overriding default methodsthrough a Final Class' prototype object", true, finalObj.defaultMethod() ); + +FinalClass.prototype.internalMethod = -1; +AddTestCase( "Try overriding internal method through a Final Class' prototype object", 1, finalObj.internalMethod() ); + +//FinalClass.prototype.protectedMethod = -1; +//AddTestCase( "Try overriding protected method through a Final Class' prototype object", 1, finalObj.protectedMethod() ); + +FinalClass.prototype.publicMethod = false; +AddTestCase( "Try overriding public method through a Final Class' prototype object", true, finalObj.publicMethod() ); + +FinalClass.prototype.privateMethod = false; +AddTestCase( "Try overriding private method through a Final Class' prototype object", true, finalObj.accPrivMethod() ); + +FinalClass.prototype.nsMethod = -1; +AddTestCase( "Try overriding namespace method through a Final Class' prototype object", 1, finalObj.accNSMethod() ); + +FinalClass.prototype.publicFinalMethod = -1; +AddTestCase( "Try overriding public final method through a Final Class' prototype object", 1, finalObj.publicFinalMethod() ); + +FinalClass.prototype.publicStaticMethod = -1; +AddTestCase( "Try overriding public static method through a Final Class' prototype object", 42, FinalClass.publicStaticMethod() ); + + +FinalClass.prototype.newArray = new Array('a', 'b', 'c'); +AddTestCase( "Try adding new property through a final class' prototype object", "a,b,c", finalObj.newArray.toString() ); + +FinalClass.prototype.testFunction = function () {return true}; +AddTestCase("Try adding new method through a final class' prototype object", true, finalObj.testFunction()); + +var equivalent:Boolean = (FinalClass.prototype.constructor == FinalClass); +AddTestCase("Verify prototype constructor is equivalent to class object", true, equivalent); + + +var thisError10 = "no error thrown"; +var temp:Object = new Object(); +try{ + FinalClass.prototype = temp; +} catch (e) { + thisError10 = e.toString(); +} finally { + AddTestCase( "Try to write to FinalClass' prototype object", "ReferenceError: Error #1074", + referenceError( thisError10 ) ); +} + +test(); // leave this alone. this executes the test cases and + // displays results. + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalClassPrototype/FinalClassPrototype.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalClassPrototype/FinalClassPrototype.as new file mode 100644 index 00000000000..e6115210c64 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalClassPrototype/FinalClassPrototype.as @@ -0,0 +1,96 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package Prototyping { + + namespace finalNS; + + final class FinalClass { + + var array:Array = new Array(1,2,3); // Default property + internal var intNumber:Number = 100; // internal property + protected var protInt:int = -1; // protected property + public var pubUint:uint = 1; // public property + private var privVar:Boolean = true; // private property + public static var pubStat:Number = 100; // public static property + finalNS var nsProp:String = "nsProp"; // namespace property + + // default method + function defaultMethod():Boolean{ return true; } + + // Internal method + internal function internalMethod():int { return 1; } + + // protected method + protected function protectedMethod():uint { return 1; } + + // public method + public function publicMethod():Boolean { return true; } + + // private method + private function privateMethod():Boolean { return true; } + + // namespace method + finalNS function nsMethod():Number { return 1; } + + // public final method + public final function publicFinalMethod():Number { return 1; } + + // public static method + public static function publicStaticMethod():int { return 42; } + + // access private property from same class same package + function accPrivProp():Boolean { + return this.privVar; + } + + // access private method from same class same package + function accPrivMethod():Boolean { + return this.privateMethod(); + } + + //accessor for default property + public function accessDefaultProperty():Array{ + return this.array; + } + + //accessor function for ns property + public function accNS():String { + return this.finalNS::nsProp; + } + + //accessor function for namespace method + public function accNSMethod():Number{ + return this.finalNS::nsMethod(); + } + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalDefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalDefaultClass.as new file mode 100644 index 00000000000..2945217b884 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalDefaultClass.as @@ -0,0 +1,153 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + +import FinalDefaultClassPackage.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Access Class Properties & Methods"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + +var arr = new Array(1,2,3); +var arr2 = new Array(3,2,1); +var Obj = new FinalDefaultClassAccessor(); +var d = new Date(0); +var d2 = new Date(1); +var f = new Function(); +var str = "Test"; +var ob = new Object(); + +// ******************************************** +// Access Default method +// ******************************************** +AddTestCase( "*** Access default method of a class ***", 1, 1 ); +AddTestCase( "Obj.setArray(arr), Obj.getArray()", arr, Obj.testGetSetArray(arr) ); + +// ******************************************** +// Access Default virtual method +// ******************************************** +AddTestCase( "*** Access default virtual method of a class ***", 1, 1 ); +AddTestCase( "Obj.setVirtualArray(arr2), Obj.getVirtualArray()", arr2, Obj.testGetSetVirtualArray(arr2) ); + +// ******************************************** +// Access Default Static method +// ******************************************** +AddTestCase( "*** Access static method of a class ***", 1, 1 ); +AddTestCase( "Obj.setStatFunction(f), Obj.getStatFunction()", f, Obj.testGetSetStatFunction(f) ); + +// ******************************************** +// Access Default Final method +// ******************************************** +AddTestCase( "*** Access final method of a class ***", 1, 1 ); +AddTestCase( "Obj.setFinNumber(10), Obj.getFinNumber()", 10, Obj.testGetSetFinNumber(10) ); + +// ******************************************** +// Access Internal method +// ******************************************** +AddTestCase( "*** Access internal method of a class ***", 1, 1 ); +AddTestCase( "Obj.setInternalArray(arr), Obj.getInternalArray()", arr, Obj.testGetSetInternalArray(arr) ); + +// ******************************************** +// Access Internal virtual method +// ******************************************** +AddTestCase( "*** Access internal virtual method of a class ***", 1, 1 ); +AddTestCase( "Obj.setInternalVirtualArray(arr2), Obj.getInternalVirtualArray()", arr2, Obj.testGetSetInternalVirtualArray(arr2) ); + +// ******************************************** +// Access Internal Static method +// ******************************************** +AddTestCase( "*** Access internal static method of a class ***", 1, 1 ); +AddTestCase( "Obj.setInternalStatFunction(f), Obj.getInternalStatFunction()", f, Obj.testGetSetInternalStatFunction(f) ); + +// ******************************************** +// Access Internal Final method +// ******************************************** +AddTestCase( "*** Access internal final method of a class ***", 1, 1 ); +AddTestCase( "Obj.setInternalFinNumber(10), Obj.getInternalFinNumber()", 10, Obj.testGetSetInternalFinNumber(10) ); + +// ******************************************** +// Access Private method +// ******************************************** +AddTestCase( "*** Access private method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPrivDate(date), Obj.getPrivDate()", d.getFullYear(), Obj.testGetSetPrivDate(d).getFullYear() ); + +// ******************************************** +// Access Private virtualmethod +// ******************************************** +AddTestCase( "*** Access private virtual method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPrivVirtualDate(date2), Obj.getPrivVirtaulDate()", d2.getFullYear(), Obj.testGetSetPrivVirtualDate(d2).getFullYear() ); + +// ******************************************** +// Access Private Static method +// ******************************************** +AddTestCase( "*** Access private static method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPrivStatString(s), Obj.getPrivStatString", str, Obj.testGetSetPrivStatString(str) ); + +// ******************************************** +// Access Private Final method +// ******************************************** +AddTestCase( "*** Access private final method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPrivFinalString(s), Obj.getPrivFinalString", str, Obj.testGetSetPrivFinalString(str) ); + +// ******************************************** +// Access Public method +// ******************************************** +AddTestCase( "*** Access public method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPubBoolean(b), Obj.getPubBoolean()", true, (Obj.setPubBoolean(true), Obj.getPubBoolean()) ); + +// ******************************************** +// Access Public virtual method +// ******************************************** +AddTestCase( "*** Access public virtual method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPubVirtualBoolean(false), Obj.getPubVirtualBoolean()", false, (Obj.setPubVirtualBoolean(false), Obj.getPubVirtualBoolean()) ); + +// ******************************************** +// Access Public Static method +// ******************************************** +AddTestCase( "*** Access public static method of a class ***", 1, 1 ); +AddTestCase( "Obj..setPubStatObject(ob), Obj.getPubStatObject()", ob, (Obj.setPubStatObject(ob), Obj.getPubStatObject()) ); + +// ******************************************** +// Access Public Final method +// ******************************************** +AddTestCase( "*** Access public final method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPubFinArray(arr), Obj.getPubFinArray()", arr, (Obj.setPubFinArray(arr), Obj.getPubFinArray()) ); + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalDefaultClass/FinalDefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalDefaultClass/FinalDefaultClass.as new file mode 100644 index 00000000000..ea485fe6049 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalDefaultClass/FinalDefaultClass.as @@ -0,0 +1,266 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package FinalDefaultClassPackage { + final class FinalDefaultClass { + + var array:Array; // Default property + static var statFunction:Function; // Default Static property + internal var finNumber:Number; // Default Final property + internal static var finStatNumber:Number; // Default Final Static property + + internal var internalArray:Array; // Internal property + internal static var internalStatFunction:Function; // Internal Static property + internal var internalFinNumber:Number; // Internal Final property + internal static var internalFinStatNumber:Number; // Internal Final Static property + + private var privDate:Date; // Private property + private static var privStatString:String; // Private Static property + private var privFinalString:String; // Private Final property + private static var privFinalStaticString:String // Private Final Static property + + public var pubBoolean:Boolean; // Public property + public static var pubStatObject:Object; // Public Static property + public var pubFinArray:Array; // Public Final property + public static var pubFinalStaticNumber:Number // Public Final Static property + + + // ***************** + // Default methods + // ***************** + function getArray() : Array { return array; } + function setArray( a:Array ) { array = a; } + + + // ************************ + // Default virtual methods + // ************************ + virtual function getVirtualArray() : Array { return array; } + virtual function setVirtualArray( a:Array ) { array = a; } + + + // *********************** + // Default Static methods + // *********************** + static function setStatFunction(f:Function) { statFunction = f; } + static function getStatFunction() : Function { return statFunction; } + + + // ********************** + // Default Final methods + // ********************** + final function setFinNumber(n:Number) { finNumber = n; } + final function getFinNumber() : Number { return finNumber; } + + + // ***************** + // Internal methods + // ***************** + internal function getInternalArray() : Array { return internalArray; } + internal function setInternalArray( a:Array ) { internalArray = a; } + + + // ************************* + // Internal virtual methods + // ************************* + internal virtual function getInternalVirtualArray() : Array { return internalArray; } + internal virtual function setInternalVirtualArray( a:Array ) { internalArray = a; } + + + // *********************** + // Internal Static methods + // *********************** + internal static function setInternalStatFunction(f:Function) { FinalDefaultClass.internalStatFunction = f; } + internal static function getInternalStatFunction() : Function { return FinalDefaultClass.internalStatFunction; } + + + // ********************** + // Internal Final methods + // ********************** + internal final function setInternalFinNumber(n:Number) { internalFinNumber = n; } + internal final function getInternalFinNumber() : Number { return internalFinNumber; } + + + // ******************* + // Private methods + // ******************* + private function getPrivDate() : Date { return privDate; } + private function setPrivDate( d:Date ) { privDate = d; } + // wrapper function + public function testGetSetPrivDate(d:Date) : Date { + setPrivDate(d); + return getPrivDate(); + } + + + // ******************* + // Private virutal methods + // ******************* + private virtual function getPrivVirtualDate() : Date { return privDate; } + private virtual function setPrivVirtualDate( d:Date ) { privDate = d; } + // wrapper function + public function testGetSetPrivVirtualDate(d:Date) : Date { + setPrivVirtualDate(d); + return getPrivVirtualDate(); + } + + + // ************************** + // Private Static methods + // ************************** + private static function setPrivStatString(s:String) { privStatString = s; } + private static function getPrivStatString() : String { return privStatString; } + // wrapper function + public function testGetSetPrivStatString(s:String) : String { + setPrivStatString(s); + return getPrivStatString(); + } + + + // ************************** + // Private Final methods + // ************************** + private final function setPrivFinalString(s:String) { privFinalString = s; } + private final function getPrivFinalString() : String { return privFinalString; } + // wrapper function + public function testGetSetPrivFinalString(s:String) : String { + setPrivFinalString(s); + return getPrivFinalString(); + } + + + // ******************* + // Public methods + // ******************* + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function getPubBoolean() : Boolean { return pubBoolean; } + + + // ******************* + // Public virtual methods + // ******************* + public virtual function setPubVirtualBoolean( b:Boolean ) { pubBoolean = b; } + public virtual function getPubVirtualBoolean() : Boolean { return pubBoolean; } + + + // ************************** + // Public Static methods + // ************************** + public static function setPubStatObject(o:Object) { FinalDefaultClass.pubStatObject = o; } + public static function getPubStatObject() : Object { return FinalDefaultClass.pubStatObject; } + + + // ******************* + // Public Final methods + // ******************* + public final function setPubFinArray(a:Array) { pubFinArray = a; } + public final function getPubFinArray() : Array { return pubFinArray; } + + } + + public class FinalDefaultClassAccessor { + private var Obj:FinalDefaultClass = new FinalDefaultClass(); + + // Default method + public function testGetSetArray(a:Array) : Array { + Obj.setArray(a); + return Obj.getArray(); + } + // Default virtual method + public function testGetSetVirtualArray(a:Array) : Array { + Obj.setVirtualArray(a); + return Obj.getVirtualArray(); + } + // Default static method + public function testGetSetStatFunction(f:Function) : Function { + FinalDefaultClass.setStatFunction(f); + return FinalDefaultClass.getStatFunction(); + } + // Default final method + public function testGetSetFinNumber(n:Number) : Number { + Obj.setFinNumber(n); + return Obj.getFinNumber(); + } + + // internal method + public function testGetSetInternalArray(a:Array) : Array { + Obj.setInternalArray(a); + return Obj.getInternalArray(); + } + // internal virtual method + public function testGetSetInternalVirtualArray(a:Array) : Array { + Obj.setInternalVirtualArray(a); + return Obj.getInternalVirtualArray(); + } + // internal static method + public function testGetSetInternalStatFunction(f:Function) : Function { + FinalDefaultClass.setInternalStatFunction(f); + return FinalDefaultClass.getInternalStatFunction(); + } + // internal final method + public function testGetSetInternalFinNumber(n:Number) : Number { + Obj.setInternalFinNumber(n); + return Obj.getInternalFinNumber(); + } + + // private method + public function testGetSetPrivDate(d:Date) : Date { + return Obj.testGetSetPrivDate(d); + } + // private virtualmethod + public function testGetSetPrivVirtualDate(d:Date) : Date { + return Obj.testGetSetPrivVirtualDate(d); + } + // Private Static methods + public function testGetSetPrivStatString(s:String) : String { + return Obj.testGetSetPrivStatString(s); + } + // Private Final methods + public function testGetSetPrivFinalString(s:String) : String { + return Obj.testGetSetPrivFinalString(s); + } + + // Public methods + public function setPubBoolean( b:Boolean ) { Obj.setPubBoolean(b); } + public function getPubBoolean() : Boolean { return Obj.getPubBoolean(); } + // Public virtual methods + public function setPubVirtualBoolean( b:Boolean ) { Obj.setPubVirtualBoolean(b); } + public function getPubVirtualBoolean() : Boolean { return Obj.getPubVirtualBoolean(); } + // Public Static methods + public function setPubStatObject(o:Object) { FinalDefaultClass.setPubStatObject(o); } + public function getPubStatObject() : Object { return FinalDefaultClass.getPubStatObject(); } + // Public Final methods + public function setPubFinArray(a:Array) { Obj.setPubFinArray(a); } + public function getPubFinArray() : Array { return Obj.getPubFinArray(); } + + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalDefaultDynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalDefaultDynamicClass.as new file mode 100644 index 00000000000..b8b2b3a30e9 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalDefaultDynamicClass.as @@ -0,0 +1,153 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + +import FinalDefaultDynamicClassPackage.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Access Class Properties & Methods"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + +var arr = new Array(1,2,3); +var arr2 = new Array(3,2,1); +var Obj = new FinalDefaultDynamicClassAccessor(); +var d = new Date(0); +var d2 = new Date(1); +var f = new Function(); +var str = "Test"; +var ob = new Object(); + +// ******************************************** +// Access Default method +// ******************************************** +AddTestCase( "*** Access default method of a class ***", 1, 1 ); +AddTestCase( "Obj.setArray(arr), Obj.getArray()", arr, Obj.testGetSetArray(arr) ); + +// ******************************************** +// Access Default virtual method +// ******************************************** +AddTestCase( "*** Access default virtual method of a class ***", 1, 1 ); +AddTestCase( "Obj.setVirtualArray(arr2), Obj.getVirtualArray()", arr2, Obj.testGetSetVirtualArray(arr2) ); + +// ******************************************** +// Access Default Static method +// ******************************************** +AddTestCase( "*** Access static method of a class ***", 1, 1 ); +AddTestCase( "Obj.setStatFunction(f), Obj.getStatFunction()", f, Obj.testGetSetStatFunction(f) ); + +// ******************************************** +// Access Default Final method +// ******************************************** +AddTestCase( "*** Access final method of a class ***", 1, 1 ); +AddTestCase( "Obj.setFinNumber(10), Obj.getFinNumber()", 10, Obj.testGetSetFinNumber(10) ); + +// ******************************************** +// Access Internal method +// ******************************************** +AddTestCase( "*** Access internal method of a class ***", 1, 1 ); +AddTestCase( "Obj.setInternalArray(arr), Obj.getInternalArray()", arr, Obj.testGetSetInternalArray(arr) ); + +// ******************************************** +// Access Internal virtual method +// ******************************************** +AddTestCase( "*** Access internal virtual method of a class ***", 1, 1 ); +AddTestCase( "Obj.setInternalVirtualArray(arr2), Obj.getInternalVirtualArray()", arr2, Obj.testGetSetInternalVirtualArray(arr2) ); + +// ******************************************** +// Access Internal Static method +// ******************************************** +AddTestCase( "*** Access internal static method of a class ***", 1, 1 ); +AddTestCase( "Obj.setInternalStatFunction(f), Obj.getInternalStatFunction()", f, Obj.testGetSetInternalStatFunction(f) ); + +// ******************************************** +// Access Internal Final method +// ******************************************** +AddTestCase( "*** Access internal final method of a class ***", 1, 1 ); +AddTestCase( "Obj.setInternalFinNumber(10), Obj.getInternalFinNumber()", 10, Obj.testGetSetInternalFinNumber(10) ); + +// ******************************************** +// Access Private method +// ******************************************** +AddTestCase( "*** Access private method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPrivDate(date), Obj.getPrivDate()", d.getFullYear(), Obj.testGetSetPrivDate(d).getFullYear() ); + +// ******************************************** +// Access Private virtualmethod +// ******************************************** +AddTestCase( "*** Access private virtual method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPrivVirtualDate(date2), Obj.getPrivVirtaulDate()", d2.getFullYear(), Obj.testGetSetPrivVirtualDate(d2).getFullYear() ); + +// ******************************************** +// Access Private Static method +// ******************************************** +AddTestCase( "*** Access private static method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPrivStatString(s), Obj.getPrivStatString", str, Obj.testGetSetPrivStatString(str) ); + +// ******************************************** +// Access Private Final method +// ******************************************** +AddTestCase( "*** Access private final method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPrivFinalString(s), Obj.getPrivFinalString", str, Obj.testGetSetPrivFinalString(str) ); + +// ******************************************** +// Access Public method +// ******************************************** +AddTestCase( "*** Access public method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPubBoolean(b), Obj.getPubBoolean()", true, (Obj.setPubBoolean(true), Obj.getPubBoolean()) ); + +// ******************************************** +// Access Public virtual method +// ******************************************** +AddTestCase( "*** Access public virtual method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPubVirtualBoolean(false), Obj.getPubVirtualBoolean()", false, (Obj.setPubVirtualBoolean(false), Obj.getPubVirtualBoolean()) ); + +// ******************************************** +// Access Public Static method +// ******************************************** +AddTestCase( "*** Access public static method of a class ***", 1, 1 ); +AddTestCase( "Obj..setPubStatObject(ob), Obj.getPubStatObject()", ob, (Obj.setPubStatObject(ob), Obj.getPubStatObject()) ); + +// ******************************************** +// Access Public Final method +// ******************************************** +AddTestCase( "*** Access public final method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPubFinArray(arr), Obj.getPubFinArray()", arr, (Obj.setPubFinArray(arr), Obj.getPubFinArray()) ); + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalDefaultDynamicClass/FinalDefaultDynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalDefaultDynamicClass/FinalDefaultDynamicClass.as new file mode 100644 index 00000000000..6d438736d6f --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalDefaultDynamicClass/FinalDefaultDynamicClass.as @@ -0,0 +1,267 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package FinalDefaultDynamicClassPackage { + final dynamic class FinalDefaultDynamicClass { + + var array:Array; // Default property + static var statFunction:Function; // Default Static property + var finNumber:Number; // Default Final property + static var finStatNumber:Number; // Default Final Static property + + internal var internalArray:Array; // Internal property + internal static var internalStatFunction:Function; // Internal Static property + internal var internalFinNumber:Number; // Internal Final property + internal static var internalFinStatNumber:Number; // Internal Final Static property + + private var privDate:Date; // Private property + private static var privStatString:String; // Private Static property + private var privFinalString:String; // Private Final property + private static var privFinalStaticString:String // Private Final Static property + + public var pubBoolean:Boolean; // Public property + public static var pubStatObject:Object; // Public Static property + public var pubFinArray:Array; // Public Final property + public static var pubFinalStaticNumber:Number // Public Final Static property + + + // ***************** + // Default methods + // ***************** + function getArray() : Array { return array; } + function setArray( a:Array ) { array = a; } + + + // ************************ + // Default virtual methods + // ************************ + virtual function getVirtualArray() : Array { return array; } + virtual function setVirtualArray( a:Array ) { array = a; } + + + // *********************** + // Default Static methods + // *********************** + static function setStatFunction(f:Function) { statFunction = f; } + static function getStatFunction() : Function { return statFunction; } + + + // ********************** + // Default Final methods + // ********************** + final function setFinNumber(n:Number) { finNumber = n; } + final function getFinNumber() : Number { return finNumber; } + + + // ***************** + // Internal methods + // ***************** + internal function getInternalArray() : Array { return internalArray; } + internal function setInternalArray( a:Array ) { internalArray = a; } + + + // ************************* + // Internal virtual methods + // ************************* + internal virtual function getInternalVirtualArray() : Array { return internalArray; } + internal virtual function setInternalVirtualArray( a:Array ) { internalArray = a; } + + + // *********************** + // Internal Static methods + // *********************** + internal static function setInternalStatFunction(f:Function) { FinalDefaultDynamicClass.internalStatFunction = f; } + internal static function getInternalStatFunction() : Function { return FinalDefaultDynamicClass.internalStatFunction; } + + + // ********************** + // Internal Final methods + // ********************** + internal final function setInternalFinNumber(n:Number) { internalFinNumber = n; } + internal final function getInternalFinNumber() : Number { return internalFinNumber; } + + + // ******************* + // Private methods + // ******************* + private function getPrivDate() : Date { return privDate; } + private function setPrivDate( d:Date ) { privDate = d; } + // wrapper function + public function testGetSetPrivDate(d:Date) : Date { + setPrivDate(d); + return getPrivDate(); + } + + + // ******************* + // Private virutal methods + // ******************* + private virtual function getPrivVirtualDate() : Date { return privDate; } + private virtual function setPrivVirtualDate( d:Date ) { privDate = d; } + // wrapper function + public function testGetSetPrivVirtualDate(d:Date) : Date { + setPrivVirtualDate(d); + return getPrivVirtualDate(); + } + + + // ************************** + // Private Static methods + // ************************** + private static function setPrivStatString(s:String) { privStatString = s; } + private static function getPrivStatString() : String { return privStatString; } + // wrapper function + public function testGetSetPrivStatString(s:String) : String { + setPrivStatString(s); + return getPrivStatString(); + } + + + // ************************** + // Private Final methods + // ************************** + private final function setPrivFinalString(s:String) { privFinalString = s; } + private final function getPrivFinalString() : String { return privFinalString; } + // wrapper function + public function testGetSetPrivFinalString(s:String) : String { + setPrivFinalString(s); + return getPrivFinalString(); + } + + + // ******************* + // Public methods + // ******************* + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function getPubBoolean() : Boolean { return pubBoolean; } + + + // ******************* + // Public virtual methods + // ******************* + public virtual function setPubVirtualBoolean( b:Boolean ) { pubBoolean = b; } + public virtual function getPubVirtualBoolean() : Boolean { return pubBoolean; } + + + // ************************** + // Public Static methods + // ************************** + public static function setPubStatObject(o:Object) { FinalDefaultDynamicClass.pubStatObject = o; } + public static function getPubStatObject() : Object { return FinalDefaultDynamicClass.pubStatObject; } + + + // ******************* + // Public Final methods + // ******************* + public final function setPubFinArray(a:Array) { pubFinArray = a; } + public final function getPubFinArray() : Array { return pubFinArray; } + + + } + + public class FinalDefaultDynamicClassAccessor { + private var Obj:FinalDefaultDynamicClass = new FinalDefaultDynamicClass(); + + // Default method + public function testGetSetArray(a:Array) : Array { + Obj.setArray(a); + return Obj.getArray(); + } + // Default virtual method + public function testGetSetVirtualArray(a:Array) : Array { + Obj.setVirtualArray(a); + return Obj.getVirtualArray(); + } + // Default static method + public function testGetSetStatFunction(f:Function) : Function { + FinalDefaultDynamicClass.setStatFunction(f); + return FinalDefaultDynamicClass.getStatFunction(); + } + // Default final method + public function testGetSetFinNumber(n:Number) : Number { + Obj.setFinNumber(n); + return Obj.getFinNumber(); + } + + // internal method + public function testGetSetInternalArray(a:Array) : Array { + Obj.setInternalArray(a); + return Obj.getInternalArray(); + } + // internal virtual method + public function testGetSetInternalVirtualArray(a:Array) : Array { + Obj.setInternalVirtualArray(a); + return Obj.getInternalVirtualArray(); + } + // internal static method + public function testGetSetInternalStatFunction(f:Function) : Function { + FinalDefaultDynamicClass.setInternalStatFunction(f); + return FinalDefaultDynamicClass.getInternalStatFunction(); + } + // internal final method + public function testGetSetInternalFinNumber(n:Number) : Number { + Obj.setInternalFinNumber(n); + return Obj.getInternalFinNumber(); + } + + // private method + public function testGetSetPrivDate(d:Date) : Date { + return Obj.testGetSetPrivDate(d); + } + // private virtualmethod + public function testGetSetPrivVirtualDate(d:Date) : Date { + return Obj.testGetSetPrivVirtualDate(d); + } + // Private Static methods + public function testGetSetPrivStatString(s:String) : String { + return Obj.testGetSetPrivStatString(s); + } + // Private Final methods + public function testGetSetPrivFinalString(s:String) : String { + return Obj.testGetSetPrivFinalString(s); + } + + // Public methods + public function setPubBoolean( b:Boolean ) { Obj.setPubBoolean(b); } + public function getPubBoolean() : Boolean { return Obj.getPubBoolean(); } + // Public virtual methods + public function setPubVirtualBoolean( b:Boolean ) { Obj.setPubVirtualBoolean(b); } + public function getPubVirtualBoolean() : Boolean { return Obj.getPubVirtualBoolean(); } + // Public Static methods + public function setPubStatObject(o:Object) { FinalDefaultDynamicClass.setPubStatObject(o); } + public function getPubStatObject() : Object { return FinalDefaultDynamicClass.getPubStatObject(); } + // Public Final methods + public function setPubFinArray(a:Array) { Obj.setPubFinArray(a); } + public function getPubFinArray() : Array { return Obj.getPubFinArray(); } + + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalInternalClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalInternalClass.as new file mode 100644 index 00000000000..396fd5f2cac --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalInternalClass.as @@ -0,0 +1,162 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + +import FinalInternalClassPackage.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Access Class Properties & Methods"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + +var arr = new Array(1,2,3); +var arr2 = new Array(3,2,1); +var Obj = new FinalInternalClassAccessor(); +var d = new Date(0); +var d2 = new Date(1); +var f = new Function(); +var str = "Test"; +var ob = new Object(); + + +// ******************************************** +// Basic Constructor tests +// ******************************************** +AddTestCase( "*** No param constructor test ***", 1, 1 ); +AddTestCase( "new FinalInternalClass(), FinalInternalClass.constructorCount", 2, Obj.testConstructorOne() ); +AddTestCase( "*** No param constructor test ***", 1, 1 ); +AddTestCase( "new FinalInternalClass, FinalInternalClass.constructorCount", 3, Obj.testConstructorOne() ); + +// ******************************************** +// Access Default method +// ******************************************** +AddTestCase( "*** Access default method of a class ***", 1, 1 ); +AddTestCase( "Obj.setArray(arr), Obj.getArray()", arr, Obj.testGetSetArray(arr) ); + +// ******************************************** +// Access Default virtual method +// ******************************************** +AddTestCase( "*** Access default virtual method of a class ***", 1, 1 ); +AddTestCase( "Obj.setVirtualArray(arr2), Obj.getVirtualArray()", arr2, Obj.testGetSetVirtualArray(arr2) ); + +// ******************************************** +// Access Default Static method +// ******************************************** +AddTestCase( "*** Access static method of a class ***", 1, 1 ); +AddTestCase( "Obj.setStatFunction(f), Obj.getStatFunction()", f, Obj.testGetSetStatFunction(f) ); + +// ******************************************** +// Access Default Final method +// ******************************************** +AddTestCase( "*** Access final method of a class ***", 1, 1 ); +AddTestCase( "Obj.setFinNumber(10), Obj.getFinNumber()", 10, Obj.testGetSetFinNumber(10) ); + +// ******************************************** +// Access Internal method +// ******************************************** +AddTestCase( "*** Access internal method of a class ***", 1, 1 ); +AddTestCase( "Obj.setInternalArray(arr), Obj.getInternalArray()", arr, Obj.testGetSetInternalArray(arr) ); + +// ******************************************** +// Access Internal virtual method +// ******************************************** +AddTestCase( "*** Access internal virtual method of a class ***", 1, 1 ); +AddTestCase( "Obj.setInternalVirtualArray(arr2), Obj.getInternalVirtualArray()", arr2, Obj.testGetSetInternalVirtualArray(arr2) ); + +// ******************************************** +// Access Internal Static method +// ******************************************** +AddTestCase( "*** Access internal static method of a class ***", 1, 1 ); +AddTestCase( "Obj.setInternalStatFunction(f), Obj.getInternalStatFunction()", f, Obj.testGetSetInternalStatFunction(f) ); + +// ******************************************** +// Access Internal Final method +// ******************************************** +AddTestCase( "*** Access internal final method of a class ***", 1, 1 ); +AddTestCase( "Obj.setInternalFinNumber(10), Obj.getInternalFinNumber()", 10, Obj.testGetSetInternalFinNumber(10) ); + +// ******************************************** +// Access Private method +// ******************************************** +AddTestCase( "*** Access private method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPrivDate(date), Obj.getPrivDate()", d.getFullYear(), Obj.testGetSetPrivDate(d).getFullYear() ); + +// ******************************************** +// Access Private virtualmethod +// ******************************************** +AddTestCase( "*** Access private virtual method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPrivVirtualDate(date2), Obj.getPrivVirtaulDate()", d2.getFullYear(), Obj.testGetSetPrivVirtualDate(d2).getFullYear() ); + +// ******************************************** +// Access Private Static method +// ******************************************** +AddTestCase( "*** Access private static method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPrivStatString(s), Obj.getPrivStatString", str, Obj.testGetSetPrivStatString(str) ); + +// ******************************************** +// Access Private Final method +// ******************************************** +AddTestCase( "*** Access private final method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPrivFinalString(s), Obj.getPrivFinalString", str, Obj.testGetSetPrivFinalString(str) ); + +// ******************************************** +// Access Public method +// ******************************************** +AddTestCase( "*** Access public method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPubBoolean(b), Obj.getPubBoolean()", true, (Obj.setPubBoolean(true), Obj.getPubBoolean()) ); + +// ******************************************** +// Access Public virtual method +// ******************************************** +AddTestCase( "*** Access public virtual method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPubVirtualBoolean(false), Obj.getPubVirtualBoolean()", false, (Obj.setPubVirtualBoolean(false), Obj.getPubVirtualBoolean()) ); + +// ******************************************** +// Access Public Static method +// ******************************************** +AddTestCase( "*** Access public static method of a class ***", 1, 1 ); +AddTestCase( "Obj..setPubStatObject(ob), Obj.getPubStatObject()", ob, (Obj.setPubStatObject(ob), Obj.getPubStatObject()) ); + +// ******************************************** +// Access Public Final method +// ******************************************** +AddTestCase( "*** Access public final method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPubFinArray(arr), Obj.getPubFinArray()", arr, (Obj.setPubFinArray(arr), Obj.getPubFinArray()) ); + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalInternalClass/FinalInternalClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalInternalClass/FinalInternalClass.as new file mode 100644 index 00000000000..55fe0f5adbc --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalInternalClass/FinalInternalClass.as @@ -0,0 +1,288 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package FinalInternalClassPackage { + final internal class FinalInternalClass { + + var array:Array; // Default property + static var statFunction:Function; // Default Static property + var finNumber:Number; // Default Final property + static var finStatNumber:Number; // Default Final Static property + + internal var internalArray:Array; // Internal property + internal static var internalStatFunction:Function; // Internal Static property + internal var internalFinNumber:Number; // Internal Final property + internal static var internalFinStatNumber:Number; // Internal Final Static property + + private var privDate:Date; // Private property + private static var privStatString:String; // Private Static property + private var privFinalString:String; // Private Final property + private static var privFinalStaticString:String // Private Final Static property + + public var pubBoolean:Boolean; // Public property + public static var pubStatObject:Object; // Public Static property + public var pubFinArray:Array; // Public Final property + public static var pubFinalStaticNumber:Number // Public Final Static property + + // Testing property for constructor testing + public static var constructorCount : int = 0; + + // ***************** + // Constructors + // ***************** + function FinalInternalClass () { + FinalInternalClass.constructorCount ++; + } + + // ***************** + // Default methods + // ***************** + function getArray() : Array { return array; } + function setArray( a:Array ) { array = a; } + + + // ************************ + // Default virtual methods + // ************************ + virtual function getVirtualArray() : Array { return array; } + virtual function setVirtualArray( a:Array ) { array = a; } + + + // *********************** + // Default Static methods + // *********************** + static function setStatFunction(f:Function) { statFunction = f; } + static function getStatFunction() : Function { return statFunction; } + + + // ********************** + // Default Final methods + // ********************** + final function setFinNumber(n:Number) { finNumber = n; } + final function getFinNumber() : Number { return finNumber; } + + + // ***************** + // Internal methods + // ***************** + internal function getInternalArray() : Array { return internalArray; } + internal function setInternalArray( a:Array ) { internalArray = a; } + + + // ************************* + // Internal virtual methods + // ************************* + internal virtual function getInternalVirtualArray() : Array { return internalArray; } + internal virtual function setInternalVirtualArray( a:Array ) { internalArray = a; } + + + // *********************** + // Internal Static methods + // *********************** + internal static function setInternalStatFunction(f:Function) { FinalInternalClass.internalStatFunction = f; } + internal static function getInternalStatFunction() : Function { return FinalInternalClass.internalStatFunction; } + + + // ********************** + // Internal Final methods + // ********************** + internal final function setInternalFinNumber(n:Number) { internalFinNumber = n; } + internal final function getInternalFinNumber() : Number { return internalFinNumber; } + + + // ******************* + // Private methods + // ******************* + private function getPrivDate() : Date { return privDate; } + private function setPrivDate( d:Date ) { privDate = d; } + // wrapper function + public function testGetSetPrivDate(d:Date) : Date { + setPrivDate(d); + return getPrivDate(); + } + + + // ******************* + // Private virutal methods + // ******************* + private virtual function getPrivVirtualDate() : Date { return privDate; } + private virtual function setPrivVirtualDate( d:Date ) { privDate = d; } + // wrapper function + public function testGetSetPrivVirtualDate(d:Date) : Date { + setPrivVirtualDate(d); + return getPrivVirtualDate(); + } + + + // ************************** + // Private Static methods + // ************************** + private static function setPrivStatString(s:String) { privStatString = s; } + private static function getPrivStatString() : String { return privStatString; } + // wrapper function + public function testGetSetPrivStatString(s:String) : String { + setPrivStatString(s); + return getPrivStatString(); + } + + + // ************************** + // Private Final methods + // ************************** + private final function setPrivFinalString(s:String) { privFinalString = s; } + private final function getPrivFinalString() : String { return privFinalString; } + // wrapper function + public function testGetSetPrivFinalString(s:String) : String { + setPrivFinalString(s); + return getPrivFinalString(); + } + + + + // ******************* + // Public methods + // ******************* + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function getPubBoolean() : Boolean { return pubBoolean; } + + + // ******************* + // Public virtual methods + // ******************* + public virtual function setPubVirtualBoolean( b:Boolean ) { pubBoolean = b; } + public virtual function getPubVirtualBoolean() : Boolean { return pubBoolean; } + + + // ************************** + // Public Static methods + // ************************** + public static function setPubStatObject(o:Object) { FinalInternalClass.pubStatObject = o; } + public static function getPubStatObject() : Object { return FinalInternalClass.pubStatObject; } + + + // ******************* + // Public Final methods + // ******************* + public final function setPubFinArray(a:Array) { pubFinArray = a; } + public final function getPubFinArray() : Array { return pubFinArray; } + + + } + + public class FinalInternalClassAccessor { + private var Obj:FinalInternalClass = new FinalInternalClass(); + + // Constructor tests + public function testConstructorOne() : int { + var foo = new FinalInternalClass(); + return FinalInternalClass.constructorCount; + } + public function testConstructorTwo() : int { + var foo = new FinalInternalClass; + return FinalInternalClass.constructorCount; + } + + + // Default method + public function testGetSetArray(a:Array) : Array { + Obj.setArray(a); + return Obj.getArray(); + } + // Default virtual method + public function testGetSetVirtualArray(a:Array) : Array { + Obj.setVirtualArray(a); + return Obj.getVirtualArray(); + } + // Default static method + public function testGetSetStatFunction(f:Function) : Function { + FinalInternalClass.setStatFunction(f); + return FinalInternalClass.getStatFunction(); + } + // Default final method + public function testGetSetFinNumber(n:Number) : Number { + Obj.setFinNumber(n); + return Obj.getFinNumber(); + } + + // internal method + public function testGetSetInternalArray(a:Array) : Array { + Obj.setInternalArray(a); + return Obj.getInternalArray(); + } + // internal virtual method + public function testGetSetInternalVirtualArray(a:Array) : Array { + Obj.setInternalVirtualArray(a); + return Obj.getInternalVirtualArray(); + } + // internal static method + public function testGetSetInternalStatFunction(f:Function) : Function { + FinalInternalClass.setInternalStatFunction(f); + return FinalInternalClass.getInternalStatFunction(); + } + // internal final method + public function testGetSetInternalFinNumber(n:Number) : Number { + Obj.setInternalFinNumber(n); + return Obj.getInternalFinNumber(); + } + + // private method + public function testGetSetPrivDate(d:Date) : Date { + return Obj.testGetSetPrivDate(d); + } + // private virtualmethod + public function testGetSetPrivVirtualDate(d:Date) : Date { + return Obj.testGetSetPrivVirtualDate(d); + } + // Private Static methods + public function testGetSetPrivStatString(s:String) : String { + return Obj.testGetSetPrivStatString(s); + } + // Private Final methods + public function testGetSetPrivFinalString(s:String) : String { + return Obj.testGetSetPrivFinalString(s); + } + + // Public methods + public function setPubBoolean( b:Boolean ) { Obj.setPubBoolean(b); } + public function getPubBoolean() : Boolean { return Obj.getPubBoolean(); } + // Public virtual methods + public function setPubVirtualBoolean( b:Boolean ) { Obj.setPubVirtualBoolean(b); } + public function getPubVirtualBoolean() : Boolean { return Obj.getPubVirtualBoolean(); } + // Public Static methods + public function setPubStatObject(o:Object) { FinalInternalClass.setPubStatObject(o); } + public function getPubStatObject() : Object { return FinalInternalClass.getPubStatObject(); } + // Public Final methods + public function setPubFinArray(a:Array) { Obj.setPubFinArray(a); } + public function getPubFinArray() : Array { return Obj.getPubFinArray(); } + + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalInternalDynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalInternalDynamicClass.as new file mode 100644 index 00000000000..ed339fc5790 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalInternalDynamicClass.as @@ -0,0 +1,152 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + +import FinalInternalDynamicClassPackage.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Access Class Properties & Methods"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + +var arr = new Array(1,2,3); +var arr2 = new Array(3,2,1); +var Obj = new FinalInternalDynamicClassAccessor(); +var d = new Date(0); +var d2 = new Date(1); +var f = new Function(); +var str = "Test"; +var ob = new Object(); + +// ******************************************** +// Access Default method +// ******************************************** +AddTestCase( "*** Access default method of a class ***", 1, 1 ); +AddTestCase( "Obj.setArray(arr), Obj.getArray()", arr, Obj.testGetSetArray(arr) ); + +// ******************************************** +// Access Default virtual method +// ******************************************** +AddTestCase( "*** Access default virtual method of a class ***", 1, 1 ); +AddTestCase( "Obj.setVirtualArray(arr2), Obj.getVirtualArray()", arr2, Obj.testGetSetVirtualArray(arr2) ); + +// ******************************************** +// Access Default Static method +// ******************************************** +AddTestCase( "*** Access static method of a class ***", 1, 1 ); +AddTestCase( "Obj.setStatFunction(f), Obj.getStatFunction()", f, Obj.testGetSetStatFunction(f) ); + +// ******************************************** +// Access Default Final method +// ******************************************** +AddTestCase( "*** Access final method of a class ***", 1, 1 ); +AddTestCase( "Obj.setFinNumber(10), Obj.getFinNumber()", 10, Obj.testGetSetFinNumber(10) ); + +// ******************************************** +// Access Internal method +// ******************************************** +AddTestCase( "*** Access internal method of a class ***", 1, 1 ); +AddTestCase( "Obj.setInternalArray(arr), Obj.getInternalArray()", arr, Obj.testGetSetInternalArray(arr) ); + +// ******************************************** +// Access Internal virtual method +// ******************************************** +AddTestCase( "*** Access internal virtual method of a class ***", 1, 1 ); +AddTestCase( "Obj.setInternalVirtualArray(arr2), Obj.getInternalVirtualArray()", arr2, Obj.testGetSetInternalVirtualArray(arr2) ); + +// ******************************************** +// Access Internal Static method +// ******************************************** +AddTestCase( "*** Access internal static method of a class ***", 1, 1 ); +AddTestCase( "Obj.setInternalStatFunction(f), Obj.getInternalStatFunction()", f, Obj.testGetSetInternalStatFunction(f) ); + +// ******************************************** +// Access Internal Final method +// ******************************************** +AddTestCase( "*** Access internal final method of a class ***", 1, 1 ); +AddTestCase( "Obj.setInternalFinNumber(10), Obj.getInternalFinNumber()", 10, Obj.testGetSetInternalFinNumber(10) ); + +// ******************************************** +// Access Private method +// ******************************************** +AddTestCase( "*** Access private method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPrivDate(date), Obj.getPrivDate()", d.getFullYear(), Obj.testGetSetPrivDate(d).getFullYear() ); + +// ******************************************** +// Access Private virtualmethod +// ******************************************** +AddTestCase( "*** Access private virtual method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPrivVirtualDate(date2), Obj.getPrivVirtaulDate()", d2.getFullYear(), Obj.testGetSetPrivVirtualDate(d2).getFullYear() ); + +// ******************************************** +// Access Private Static method +// ******************************************** +AddTestCase( "*** Access private static method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPrivStatString(s), Obj.getPrivStatString", str, Obj.testGetSetPrivStatString(str) ); + +// ******************************************** +// Access Private Final method +// ******************************************** +AddTestCase( "*** Access private final method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPrivFinalString(s), Obj.getPrivFinalString", str, Obj.testGetSetPrivFinalString(str) ); + +// ******************************************** +// Access Public method +// ******************************************** +AddTestCase( "*** Access public method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPubBoolean(b), Obj.getPubBoolean()", true, (Obj.setPubBoolean(true), Obj.getPubBoolean()) ); + +// ******************************************** +// Access Public virtual method +// ******************************************** +AddTestCase( "*** Access public virtual method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPubVirtualBoolean(false), Obj.getPubVirtualBoolean()", false, (Obj.setPubVirtualBoolean(false), Obj.getPubVirtualBoolean()) ); + +// ******************************************** +// Access Public Static method +// ******************************************** +AddTestCase( "*** Access public static method of a class ***", 1, 1 ); +AddTestCase( "Obj..setPubStatObject(ob), Obj.getPubStatObject()", ob, (Obj.setPubStatObject(ob), Obj.getPubStatObject()) ); + +// ******************************************** +// Access Public Final method +// ******************************************** +AddTestCase( "*** Access public final method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPubFinArray(arr), Obj.getPubFinArray()", arr, (Obj.setPubFinArray(arr), Obj.getPubFinArray()) ); + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalInternalDynamicClass/FinalInternDynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalInternalDynamicClass/FinalInternDynamicClass.as new file mode 100644 index 00000000000..e49c596a19e --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalInternalDynamicClass/FinalInternDynamicClass.as @@ -0,0 +1,268 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package FinalInternalDynamicClassPackage { + final internal dynamic class FinalInternalDynamicClass { + + var array:Array; // Default property + static var statFunction:Function; // Default Static property + var finNumber:Number; // Default property + static var finStatNumber:Number; // Default Final Static property + + internal var internalArray:Array; // Internal property + internal static var internalStatFunction:Function; // Internal Static property + internal var internalFinNumber:Number; // Internal Final property + internal static var internalFinStatNumber:Number; // Internal Final Static property + + private var privDate:Date; // Private property + private static var privStatString:String; // Private Static property + private var privFinalString:String; // Private Final property + private static var privFinalStaticString:String // Private Final Static property + + public var pubBoolean:Boolean; // Public property + public static var pubStatObject:Object; // Public Static property + public var pubFinArray:Array; // Public Final property + public static var pubFinalStaticNumber:Number // Public Final Static property + + + // ***************** + // Default methods + // ***************** + function getArray() : Array { return array; } + function setArray( a:Array ) { array = a; } + + + // ************************ + // Default virtual methods + // ************************ + virtual function getVirtualArray() : Array { return array; } + virtual function setVirtualArray( a:Array ) { array = a; } + + + // *********************** + // Default Static methods + // *********************** + static function setStatFunction(f:Function) { statFunction = f; } + static function getStatFunction() : Function { return statFunction; } + + + // ********************** + // Default Final methods + // ********************** + final function setFinNumber(n:Number) { finNumber = n; } + final function getFinNumber() : Number { return finNumber; } + + + // ***************** + // Internal methods + // ***************** + internal function getInternalArray() : Array { return internalArray; } + internal function setInternalArray( a:Array ) { internalArray = a; } + + + // ************************* + // Internal virtual methods + // ************************* + internal virtual function getInternalVirtualArray() : Array { return internalArray; } + internal virtual function setInternalVirtualArray( a:Array ) { internalArray = a; } + + + // *********************** + // Internal Static methods + // *********************** + internal static function setInternalStatFunction(f:Function) { FinalInternalDynamicClass.internalStatFunction = f; } + internal static function getInternalStatFunction() : Function { return FinalInternalDynamicClass.internalStatFunction; } + + + // ********************** + // Internal Final methods + // ********************** + internal final function setInternalFinNumber(n:Number) { internalFinNumber = n; } + internal final function getInternalFinNumber() : Number { return internalFinNumber; } + + + + // ******************* + // Private methods + // ******************* + private function getPrivDate() : Date { return privDate; } + private function setPrivDate( d:Date ) { privDate = d; } + // wrapper function + public function testGetSetPrivDate(d:Date) : Date { + setPrivDate(d); + return getPrivDate(); + } + + + // ******************* + // Private virutal methods + // ******************* + private virtual function getPrivVirtualDate() : Date { return privDate; } + private virtual function setPrivVirtualDate( d:Date ) { privDate = d; } + // wrapper function + public function testGetSetPrivVirtualDate(d:Date) : Date { + setPrivVirtualDate(d); + return getPrivVirtualDate(); + } + + + // ************************** + // Private Static methods + // ************************** + private static function setPrivStatString(s:String) { privStatString = s; } + private static function getPrivStatString() : String { return privStatString; } + // wrapper function + public function testGetSetPrivStatString(s:String) : String { + setPrivStatString(s); + return getPrivStatString(); + } + + + // ************************** + // Private Final methods + // ************************** + private final function setPrivFinalString(s:String) { privFinalString = s; } + private final function getPrivFinalString() : String { return privFinalString; } + // wrapper function + public function testGetSetPrivFinalString(s:String) : String { + setPrivFinalString(s); + return getPrivFinalString(); + } + + + + // ******************* + // Public methods + // ******************* + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function getPubBoolean() : Boolean { return pubBoolean; } + + + // ******************* + // Public virtual methods + // ******************* + public virtual function setPubVirtualBoolean( b:Boolean ) { pubBoolean = b; } + public virtual function getPubVirtualBoolean() : Boolean { return pubBoolean; } + + + // ************************** + // Public Static methods + // ************************** + public static function setPubStatObject(o:Object) { FinalInternalDynamicClass.pubStatObject = o; } + public static function getPubStatObject() : Object { return FinalInternalDynamicClass.pubStatObject; } + + + // ******************* + // Public Final methods + // ******************* + public final function setPubFinArray(a:Array) { pubFinArray = a; } + public final function getPubFinArray() : Array { return pubFinArray; } + + + } + + public class FinalInternalDynamicClassAccessor { + private var Obj:FinalInternalDynamicClass = new FinalInternalDynamicClass(); + + // Default method + public function testGetSetArray(a:Array) : Array { + Obj.setArray(a); + return Obj.getArray(); + } + // Default virtual method + public function testGetSetVirtualArray(a:Array) : Array { + Obj.setVirtualArray(a); + return Obj.getVirtualArray(); + } + // Default static method + public function testGetSetStatFunction(f:Function) : Function { + FinalInternalDynamicClass.setStatFunction(f); + return FinalInternalDynamicClass.getStatFunction(); + } + // Default final method + public function testGetSetFinNumber(n:Number) : Number { + Obj.setFinNumber(n); + return Obj.getFinNumber(); + } + + // internal method + public function testGetSetInternalArray(a:Array) : Array { + Obj.setInternalArray(a); + return Obj.getInternalArray(); + } + // internal virtual method + public function testGetSetInternalVirtualArray(a:Array) : Array { + Obj.setInternalVirtualArray(a); + return Obj.getInternalVirtualArray(); + } + // internal static method + public function testGetSetInternalStatFunction(f:Function) : Function { + FinalInternalDynamicClass.setInternalStatFunction(f); + return FinalInternalDynamicClass.getInternalStatFunction(); + } + // internal final method + public function testGetSetInternalFinNumber(n:Number) : Number { + Obj.setInternalFinNumber(n); + return Obj.getInternalFinNumber(); + } + + // private method + public function testGetSetPrivDate(d:Date) : Date { + return Obj.testGetSetPrivDate(d); + } + // private virtualmethod + public function testGetSetPrivVirtualDate(d:Date) : Date { + return Obj.testGetSetPrivVirtualDate(d); + } + // Private Static methods + public function testGetSetPrivStatString(s:String) : String { + return Obj.testGetSetPrivStatString(s); + } + // Private Final methods + public function testGetSetPrivFinalString(s:String) : String { + return Obj.testGetSetPrivFinalString(s); + } + + // Public methods + public function setPubBoolean( b:Boolean ) { Obj.setPubBoolean(b); } + public function getPubBoolean() : Boolean { return Obj.getPubBoolean(); } + // Public virtual methods + public function setPubVirtualBoolean( b:Boolean ) { Obj.setPubVirtualBoolean(b); } + public function getPubVirtualBoolean() : Boolean { return Obj.getPubVirtualBoolean(); } + // Public Static methods + public function setPubStatObject(o:Object) { FinalInternalDynamicClass.setPubStatObject(o); } + public function getPubStatObject() : Object { return FinalInternalDynamicClass.getPubStatObject(); } + // Public Final methods + public function setPubFinArray(a:Array) { Obj.setPubFinArray(a); } + public function getPubFinArray() : Array { return Obj.getPubFinArray(); } + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalPublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalPublicClass.as new file mode 100644 index 00000000000..d965d0b19c8 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalPublicClass.as @@ -0,0 +1,182 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + +import FinalPublicClassPackage.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Access Class Properties & Methods"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + +var arr = new Array(1,2,3); +var arr2 = new Array(3,2,1); +var Obj = new FinalPublicClass(); +var d = new Date(0); +var d2 = new Date(1); +var f = new Function(); +var str = "Test"; +var ob = new Object(); + +// ******************************************** +// Access Default method +// ******************************************** +AddTestCase( "*** Access default method of a class ***", 1, 1 ); +AddTestCase( "Obj.setArray(arr), Obj.getArray()", arr, Obj.testGetSetArray(arr) ); + +// ******************************************** +// Access Default virtual method +// ******************************************** +AddTestCase( "*** Access default virtual method of a class ***", 1, 1 ); +AddTestCase( "Obj.setVirtArray(arr), Obj.getVirtArray()", arr2, Obj.testGetSetVirtualArray(arr2) ); + +// ******************************************** +// Access Default Static method +// ******************************************** +AddTestCase( "*** Access static method of a class ***", 1, 1 ); +AddTestCase( "Obj.setStatFunction(f), Obj.getStatFunction()", f, Obj.testGetSetStatFunction(f) ); + +// ******************************************** +// Access Default Final method +// ******************************************** +AddTestCase( "*** Access final method of a class ***", 1, 1 ); +AddTestCase( "Obj.setFinNumber(10), Obj.getFinNumber()", 10, Obj.testGetSetFinNumber(10) ); + +// ******************************************** +// Access Internal method +// ******************************************** +AddTestCase( "*** Access internal method of a class ***", 1, 1 ); +AddTestCase( "Obj.setInternalArray(arr), Obj.getInternalArray()", arr, Obj.testGetSetInternalArray(arr) ); + +// ******************************************** +// Access Internal virtual method +// ******************************************** +AddTestCase( "*** Access internal virtual method of a class ***", 1, 1 ); +AddTestCase( "Obj.setInternalVirtualArray(arr), Obj.getInternalVirtualArray()", arr2, Obj.testGetSetInternalVirtualArray(arr2) ); + + +// ******************************************** +// Access Internal Static method +// ******************************************** +AddTestCase( "*** Access internal static method of a class ***", 1, 1 ); +AddTestCase( "Obj.setInternalStatFunction(f), Obj.getInternalStatFunction()", f, Obj.testGetSetInternalStatFunction(f) ); + + +// ******************************************** +// Access Internal Final method +// ******************************************** +AddTestCase( "*** Access internal final method of a class ***", 1, 1 ); +AddTestCase( "Obj.setInternalFinNumber(10), Obj.getInternalFinNumber()", 10, Obj.testGetSetInternalFinNumber(10) ); + +// ******************************************** +// Access Private method +// ******************************************** +AddTestCase( "*** Access private method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPrivDate(date), Obj.getPrivDate()", d.getFullYear(), Obj.testGetSetPrivDate(d).getFullYear() ); + +// ******************************************** +// Access Private virtual method +// ******************************************** +AddTestCase( "*** Access private virtual method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPrivVirtualDate(date), Obj.getPrivVirtualDate()", d2.getFullYear(), Obj.testGetSetPrivVirtualDate(d2).getFullYear() ); + +// ******************************************** +// Access Private Static method +// ******************************************** +AddTestCase( "*** Access private static method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPrivStatString(s), Obj.getPrivStatString", str, Obj.testGetSetPrivStatString(str) ); + +// ******************************************** +// Access Private Final method +// ******************************************** +AddTestCase( "*** Access private final method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPrivFinalString(s), Obj.getPrivFinalString", str, Obj.testGetSetPrivFinalString(str) ); + +// ******************************************** +// Access Public method +// ******************************************** +AddTestCase( "*** Access public method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPubBoolean(b), Obj.getPubBoolean()", true, (Obj.setPubBoolean(true), Obj.getPubBoolean()) ); + +// ******************************************** +// Access Public virtual method +// ******************************************** +AddTestCase( "*** Access public virtual method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPubVirtualBoolean(b), Obj.getPubVirtualBoolean()", false, (Obj.setPubBoolean(false), Obj.getPubBoolean()) ); + +// ******************************************** +// Access Public Static method +// ******************************************** +AddTestCase( "*** Access public static method of a class ***", 1, 1 ); +AddTestCase( "FinalPublicClass.setPubStatObject(ob), FinalPublicClass.getPubStatObject()", ob, (FinalPublicClass.setPubStatObject(ob), FinalPublicClass.getPubStatObject()) ); + +// ******************************************** +// Access Public Final method +// ******************************************** +AddTestCase( "*** Access public final method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPubFinArray(arr), Obj.getPubFinArray()", arr, (Obj.setPubFinArray(arr), Obj.getPubFinArray()) ); + + + + +// ******************************************** +// Access Public property +// ******************************************** +AddTestCase( "*** Access public property of a class ***", 1, 1 ); +AddTestCase( "Obj.pubBoolean = true, Obj.pubBoolean", true, (Obj.pubBoolean = true, Obj.pubBoolean) ); + +// ******************************************** +// Access Public Static property +// ******************************************** +AddTestCase( "*** Access public satic property of a class ***", 1, 1 ); +AddTestCase( "FinalPublicClass.pubStatObject = ob, FinalPublicClass.pubStatObject", ob, (FinalPublicClass.pubStatObject = ob, FinalPublicClass.pubStatObject) ); + +// ******************************************** +// Access Public Final property +// ******************************************** +AddTestCase( "*** Access public final property of a class ***", 1, 1 ); +AddTestCase( "Obj.pubFinArray = arr, Obj.pubFinArray", arr, (Obj.pubFinArray = arr, Obj.pubFinArray) ); + +// ******************************************** +// Access Public Final Static property +// ******************************************** +AddTestCase( "*** Access public final static property of a class ***", 1, 1 ); +AddTestCase( "FinalPublicClass.pubFinalStaticNumber = 10, FinalPublicClass.pubFinalStaticNumber", 10, (FinalPublicClass.pubFinalStaticNumber = 10, FinalPublicClass.pubFinalStaticNumber) ); + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalPublicClass/FinalPublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalPublicClass/FinalPublicClass.as new file mode 100644 index 00000000000..7e8f7496a6a --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalPublicClass/FinalPublicClass.as @@ -0,0 +1,244 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package FinalPublicClassPackage { + final public class FinalPublicClass { + + var array:Array; // Default property + var finNumber:Number; // Default final property + static var statFunction:Function; // Default Static property + static var finStatNumber:Number; // Default final static property + // TODO: virtual vars are not implemented yet + // virtual var virtArray:Array; + + internal var internalArray:Array; // Internal property + internal var internalFinNumber:Number; // Internal final property + internal static var internalStatFunction:Function; // Internal static property + internal static var internalFinStatNumber:Number; // Internal Final Static property + // TODO: virtual vars are not implemented yet + // internal virtual var internalVirtNumber:Number; // internal virtual property + + private var privDate:Date; // Private property + private static var privStatString:String; // Private Static property + private var privFinalString:String; // Private Final property + private static var privFinalStaticString:String // Private Final Static property + // TODO: virtual vars are not implemented yet + // private virtual privVirtDate:Date; + + public var pubBoolean:Boolean; // Public property + public static var pubStatObject:Object; // Public Static property + public var pubFinArray:Array; // Public Final property + public static var pubFinalStaticNumber:Number // Public Final Static property + // TODO: virtual vars are not implemented yet + // public virtual var pubVirtBoolean:Boolean; + + + + // ***************** + // Default methods + // ***************** + function getArray() : Array { return array; } + function setArray( a:Array ) { array = a; } + // wrapper function + public function testGetSetArray(a:Array) : Array { + setArray(a); + return getArray(); + } + + + // ************************ + // Default virtual methods + // ************************ + // TODO: virtual vars are not implemented yet so this is currently using a normal var + virtual function getVirtualArray() : Array { return array; } + virtual function setVirtualArray( a:Array ) { array = a; } + // wrapper function + public function testGetSetVirtualArray(a:Array) : Array { + setVirtualArray(a); + return getVirtualArray(); + } + + + // *********************** + // Default Static methods + // *********************** + static function setStatFunction(f:Function) { FinalPublicClass.statFunction = f; } + static function getStatFunction() : Function { return FinalPublicClass.statFunction; } + // wrapper function + public function testGetSetStatFunction(f:Function) : Function { + FinalPublicClass.setStatFunction(f); + return FinalPublicClass.getStatFunction(); + } + + + // ********************** + // Default Final methods + // ********************** + final function setFinNumber(n:Number) { finNumber = n; } + final function getFinNumber() { return finNumber; } + // wrapper function + public function testGetSetFinNumber(n:Number) : Number { + setFinNumber(n); + return getFinNumber(); + } + + + // ***************** + // Internal methods + // ***************** + internal function getInternalArray() : Array { return internalArray; } + internal function setInternalArray( a:Array ) { internalArray = a; } + // wrapper function + public function testGetSetInternalArray(a:Array) : Array { + setInternalArray(a); + return getInternalArray(); + } + + + // ************************* + // Internal virtual methods + // ************************ + // TODO: virtual vars are not implemented yet so this is currently using a normal var + internal virtual function getInternalVirtualArray() : Array { return internalArray; } + internal virtual function setInternalVirtualArray( a:Array ) { internalArray = a; } + // wrapper function + public function testGetSetInternalVirtualArray(a:Array) : Array { + setInternalVirtualArray(a); + return getInternalVirtualArray(); + } + + + // *********************** + // Internal Static methods + // *********************** + internal static function setInternalStatFunction(f:Function) { internalStatFunction = f; } + internal static function getInternalStatFunction() { return internalStatFunction; } + // wrapper function + public function testGetSetInternalStatFunction(f:Function) : Function { + setInternalStatFunction(f); + return getInternalStatFunction(); + } + + + + // ********************** + // Internal Final methods + // ********************** + internal final function setInternalFinNumber(n:Number) { internalFinNumber = n; } + internal final function getInternalFinNumber() { return internalFinNumber; } + // wrapper function + public function testGetSetInternalFinNumber(n:Number) : Number { + setInternalFinNumber(n); + return getInternalFinNumber(); + } + + + + // ******************* + // Private methods + // ******************* + private function getPrivDate() : Date { return privDate; } + private function setPrivDate( d:Date ) { privDate = d; } + // wrapper function + public function testGetSetPrivDate(d:Date) : Date { + setPrivDate(d); + return getPrivDate(); + } + + + // ************************ + // Private virtual methods + // *********************** + // TODO: virtual vars are not implemented yet so this is currently using a normal var + private virtual function getPrivVirtualDate() : Date { return privDate; } + private virtual function setPrivVirtualDate( d:Date ) { privDate = d; } + // wrapper function + public function testGetSetPrivVirtualDate(d:Date) : Date { + setPrivVirtualDate(d); + return getPrivVirtualDate(); + } + + + // ************************** + // Private Static methods + // ************************** + private static function setPrivStatString(s:String) { FinalPublicClass.privStatString = s; } + private static function getPrivStatString() { return FinalPublicClass.privStatString; } + // wrapper function + public function testGetSetPrivStatString(s:String) : String { + FinalPublicClass.setPrivStatString(s); + return FinalPublicClass.getPrivStatString(); + } + + + // ************************** + // Private Final methods + // ************************** + private final function setPrivFinalString(s:String) { privFinalString = s; } + private final function getPrivFinalString() { return privFinalString; } + // wrapper function + public function testGetSetPrivFinalString(s:String) : String { + setPrivFinalString(s); + return getPrivFinalString(); + } + + + + // ******************* + // Public methods + // ******************* + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function getPubBoolean() : Boolean { return pubBoolean; } + + + // ************************ + // Public virutal methods + // *********************** + // TODO: virtual vars are not implemented yet so this is currently using a normal var + public virtual function setPubVirtualBoolean( b:Boolean ) { pubBoolean = b; } + public virtual function getPubVirtualBoolean() : Boolean { return pubBoolean; } + + + // ************************** + // Public Static methods + // ************************** + public static function setPubStatObject(o:Object) { FinalPublicClass.pubStatObject = o; } + public static function getPubStatObject() { return FinalPublicClass.pubStatObject; } + + + // ******************* + // Public Final methods + // ******************* + public final function setPubFinArray(a:Array) { pubFinArray = a; } + public final function getPubFinArray() { return pubFinArray; } + + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalPublicDynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalPublicDynamicClass.as new file mode 100644 index 00000000000..ac842e9a540 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalPublicDynamicClass.as @@ -0,0 +1,183 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + +import FinalPublicDynamicClassPackage.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Access Class Properties & Methods"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + +var arr = new Array(1,2,3); +var arr2 = new Array(3,2,1); +var Obj = new FinalPublicDynamicClass(); +var d = new Date(0); +var d2 = new Date(1); +var f = new Function(); +var str = "Test"; +var ob = new Object(); + +// ******************************************** +// Access Default method +// ******************************************** +AddTestCase( "*** Access default method of a class ***", 1, 1 ); +AddTestCase( "Obj.setArray(arr), Obj.getArray()", arr, Obj.testGetSetArray(arr) ); + +// ******************************************** +// Access Default virtual method +// ******************************************** +AddTestCase( "*** Access default virtual method of a class ***", 1, 1 ); +AddTestCase( "Obj.setVirtArray(arr), Obj.getVirtArray()", arr2, Obj.testGetSetVirtualArray(arr2) ); + +// ******************************************** +// Access Default Static method +// ******************************************** +AddTestCase( "*** Access static method of a class ***", 1, 1 ); +AddTestCase( "Obj.setStatFunction(f), Obj.getStatFunction()", f, Obj.testGetSetStatFunction(f) ); + +// ******************************************** +// Access Default Final method +// ******************************************** +AddTestCase( "*** Access final method of a class ***", 1, 1 ); +AddTestCase( "Obj.setFinNumber(10), Obj.getFinNumber()", 10, Obj.testGetSetFinNumber(10) ); + +// ******************************************** +// Access Internal method +// ******************************************** +AddTestCase( "*** Access internal method of a class ***", 1, 1 ); +AddTestCase( "Obj.setInternalArray(arr), Obj.getInternalArray()", arr, Obj.testGetSetInternalArray(arr) ); + +// ******************************************** +// Access Internal virtual method +// ******************************************** +AddTestCase( "*** Access internal virtual method of a class ***", 1, 1 ); +AddTestCase( "Obj.setInternalVirtualArray(arr), Obj.getInternalVirtualArray()", arr2, Obj.testGetSetInternalVirtualArray(arr2) ); + + +// ******************************************** +// Access Internal Static method +// ******************************************** +AddTestCase( "*** Access internal static method of a class ***", 1, 1 ); +AddTestCase( "Obj.setInternalStatFunction(f), Obj.getInternalStatFunction()", f, Obj.testGetSetInternalStatFunction(f) ); + + +// ******************************************** +// Access Internal Final method +// ******************************************** +AddTestCase( "*** Access internal final method of a class ***", 1, 1 ); +AddTestCase( "Obj.setInternalFinNumber(10), Obj.getInternalFinNumber()", 10, Obj.testGetSetInternalFinNumber(10) ); + +// ******************************************** +// Access Private method +// ******************************************** +AddTestCase( "*** Access private method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPrivDate(date), Obj.getPrivDate()", d.getFullYear(), Obj.testGetSetPrivDate(d).getFullYear() ); + +// ******************************************** +// Access Private virtual method +// ******************************************** +AddTestCase( "*** Access private virtual method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPrivVirtualDate(date), Obj.getPrivVirtualDate()", d2.getFullYear(), Obj.testGetSetPrivVirtualDate(d2).getFullYear() ); + +// ******************************************** +// Access Private Static method +// ******************************************** +AddTestCase( "*** Access private static method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPrivStatString(s), Obj.getPrivStatString", str, Obj.testGetSetPrivStatString(str) ); + +// ******************************************** +// Access Private Final method +// ******************************************** +AddTestCase( "*** Access private final method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPrivFinalString(s), Obj.getPrivFinalString", str, Obj.testGetSetPrivFinalString(str) ); + +// ******************************************** +// Access Public method +// ******************************************** +AddTestCase( "*** Access public method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPubBoolean(b), Obj.getPubBoolean()", true, (Obj.setPubBoolean(true), Obj.getPubBoolean()) ); + +// ******************************************** +// Access Public virtual method +// ******************************************** +AddTestCase( "*** Access public virtual method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPubVirtualBoolean(b), Obj.getPubVirtualBoolean()", false, (Obj.setPubBoolean(false), Obj.getPubBoolean()) ); + +// ******************************************** +// Access Public Static method +// ******************************************** +AddTestCase( "*** Access public static method of a class ***", 1, 1 ); +AddTestCase( "FinalPublicDynamicClass.setPubStatObject(ob), FinalPublicDynamicClass.getPubStatObject()", ob, (FinalPublicDynamicClass.setPubStatObject(ob), FinalPublicDynamicClass.getPubStatObject()) ); + +// ******************************************** +// Access Public Final method +// ******************************************** +AddTestCase( "*** Access public final method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPubFinArray(arr), Obj.getPubFinArray()", arr, (Obj.setPubFinArray(arr), Obj.getPubFinArray()) ); + + + + + +// ******************************************** +// Access Public property +// ******************************************** +AddTestCase( "*** Access public property of a class ***", 1, 1 ); +AddTestCase( "Obj.pubBoolean = true, Obj.pubBoolean", true, (Obj.pubBoolean = true, Obj.pubBoolean) ); + +// ******************************************** +// Access Public Static property +// ******************************************** +AddTestCase( "*** Access public satic property of a class ***", 1, 1 ); +AddTestCase( "FinalPublicDynamicClass.pubStatObject = ob, FinalPublicDynamicClass.pubStatObject", ob, (FinalPublicDynamicClass.pubStatObject = ob, FinalPublicDynamicClass.pubStatObject) ); + +// ******************************************** +// Access Public Final property +// ******************************************** +AddTestCase( "*** Access public final property of a class ***", 1, 1 ); +AddTestCase( "Obj.pubFinArray = arr, Obj.pubFinArray", arr, (Obj.pubFinArray = arr, Obj.pubFinArray) ); + +// ******************************************** +// Access Public Final Static property +// ******************************************** +AddTestCase( "*** Access public final static property of a class ***", 1, 1 ); +AddTestCase( "FinalPublicDynamicClass.pubFinalStaticNumber = 10, FinalPublicDynamicClass.pubFinalStaticNumber", 10, (FinalPublicDynamicClass.pubFinalStaticNumber = 10, FinalPublicDynamicClass.pubFinalStaticNumber) ); + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalPublicDynamicClass/FinalPublicDynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalPublicDynamicClass/FinalPublicDynamicClass.as new file mode 100644 index 00000000000..274a5d8fa63 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalPublicDynamicClass/FinalPublicDynamicClass.as @@ -0,0 +1,241 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package FinalPublicDynamicClassPackage { + final public dynamic class FinalPublicDynamicClass { + + var array:Array; // Default property + var finNumber:Number; // Default final property + static var statFunction:Function; // Default Static property + static var finStatNumber:Number; // Default final static property + // TODO: virtual vars are not implemented yet + // virtual var virtArray:Array; + + internal var internalArray:Array; // Internal property + internal var internalFinNumber:Number; // Internal final property + internal static var internalStatFunction:Function; // Internal static property + internal static var internalFinStatNumber:Number; // Internal Final Static property + // TODO: virtual vars are not implemented yet + // internal virtual var internalVirtNumber:Number; // internal virtual property + + private var privDate:Date; // Private property + private static var privStatString:String; // Private Static property + private var privFinalString:String; // Private Final property + private static var privFinalStaticString:String // Private Final Static property + // TODO: virtual vars are not implemented yet + // private virtual privVirtDate:Date; + + public var pubBoolean:Boolean; // Public property + public static var pubStatObject:Object; // Public Static property + public var pubFinArray:Array; // Public Final property + public static var pubFinalStaticNumber:Number // Public Final Static property + // TODO: virtual vars are not implemented yet + // public virtual var pubVirtBoolean:Boolean; + + + + // ***************** + // Default methods + // ***************** + function getArray() : Array { return array; } + function setArray( a:Array ) { array = a; } + // wrapper function + public function testGetSetArray(a:Array) : Array { + setArray(a); + return getArray(); + } + + + // ************************ + // Default virtual methods + // ************************ + // TODO: virtual vars are not implemented yet so this is currently using a normal var + virtual function getVirtualArray() : Array { return array; } + virtual function setVirtualArray( a:Array ) { array = a; } + // wrapper function + public function testGetSetVirtualArray(a:Array) : Array { + setVirtualArray(a); + return getVirtualArray(); + } + + + // *********************** + // Default Static methods + // *********************** + static function setStatFunction(f:Function) { FinalPublicDynamicClass.statFunction = f; } + static function getStatFunction() : Function { return FinalPublicDynamicClass.statFunction; } + // wrapper function + public function testGetSetStatFunction(f:Function) : Function { + FinalPublicDynamicClass.setStatFunction(f); + return FinalPublicDynamicClass.getStatFunction(); + } + + + // ********************** + // Default Final methods + // ********************** + final function setFinNumber(n:Number) { finNumber = n; } + final function getFinNumber() : Number { return finNumber; } + // wrapper function + public function testGetSetFinNumber(n:Number) : Number { + setFinNumber(n); + return getFinNumber(); + } + + + // ***************** + // Internal methods + // ***************** + internal function getInternalArray() : Array { return internalArray; } + internal function setInternalArray( a:Array ) { internalArray = a; } + // wrapper function + public function testGetSetInternalArray(a:Array) : Array { + setInternalArray(a); + return getInternalArray(); + } + + + // ************************* + // Internal virtual methods + // ************************ + // TODO: virtual vars are not implemented yet so this is currently using a normal var + internal virtual function getInternalVirtualArray() : Array { return internalArray; } + internal virtual function setInternalVirtualArray( a:Array ) { internalArray = a; } + // wrapper function + public function testGetSetInternalVirtualArray(a:Array) : Array { + setInternalVirtualArray(a); + return getInternalVirtualArray(); + } + + + // *********************** + // Internal Static methods + // *********************** + internal static function setInternalStatFunction(f:Function) { internalStatFunction = f; } + internal static function getInternalStatFunction() : Function { return internalStatFunction; } + // wrapper function + public function testGetSetInternalStatFunction(f:Function) : Function { + setInternalStatFunction(f); + return getInternalStatFunction(); + } + + + + // ********************** + // Internal Final methods + // ********************** + internal final function setInternalFinNumber(n:Number) { internalFinNumber = n; } + internal final function getInternalFinNumber() : Number { return internalFinNumber; } + // wrapper function + public function testGetSetInternalFinNumber(n:Number) : Number { + setInternalFinNumber(n); + return getInternalFinNumber(); + } + + + // ******************* + // Private methods + // ******************* + private function getPrivDate() : Date { return privDate; } + private function setPrivDate( d:Date ) { privDate = d; } + // wrapper function + public function testGetSetPrivDate(d:Date) : Date { + setPrivDate(d); + return getPrivDate(); + } + + + // ************************ + // Private virtual methods + // *********************** + // TODO: virtual vars are not implemented yet so this is currently using a normal var + private virtual function getPrivVirtualDate() : Date { return privDate; } + private virtual function setPrivVirtualDate( d:Date ) { privDate = d; } + // wrapper function + public function testGetSetPrivVirtualDate(d:Date) : Date { + setPrivVirtualDate(d); + return getPrivVirtualDate(); + } + + + // ************************** + // Private Static methods + // ************************** + private static function setPrivStatString(s:String) { FinalPublicDynamicClass.privStatString = s; } + private static function getPrivStatString() : String { return FinalPublicDynamicClass.privStatString; } + // wrapper function + public function testGetSetPrivStatString(s:String) : String { + FinalPublicDynamicClass.setPrivStatString(s); + return FinalPublicDynamicClass.getPrivStatString(); + } + + + // ************************** + // Private Final methods + // ************************** + private final function setPrivFinalString(s:String) { privFinalString = s; } + private final function getPrivFinalString() : String { return privFinalString; } + // wrapper function + public function testGetSetPrivFinalString(s:String) : String { + setPrivFinalString(s); + return getPrivFinalString(); + } + + + // ******************* + // Public methods + // ******************* + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function getPubBoolean() : Boolean { return pubBoolean; } + + + // ************************ + // Public virutal methods + // *********************** + // TODO: virtual vars are not implemented yet so this is currently using a normal var + public virtual function setPubVirtualBoolean( b:Boolean ) { pubBoolean = b; } + public virtual function getPubVirtualBoolean() : Boolean { return pubBoolean; } + + + // ************************** + // Public Static methods + // ************************** + public static function setPubStatObject(o:Object) { FinalPublicDynamicClass.pubStatObject = o; } + public static function getPubStatObject() : Object { return FinalPublicDynamicClass.pubStatObject; } + + + // ******************* + // Public Final methods + // ******************* + public final function setPubFinArray(a:Array) { pubFinArray = a; } + public final function getPubFinArray() : Array { return pubFinArray; } + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalPublicDynamicClassMethodAndProp.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalPublicDynamicClassMethodAndProp.as new file mode 100644 index 00000000000..ec3710f3806 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalPublicDynamicClassMethodAndProp.as @@ -0,0 +1,152 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + +import FinalPublicDynamicClassMethodAndProp.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Access Class Properties & Methods"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + +var arr = new Array(1,2,3); + +var Obj = new AccFinPubDynClassMAndP(); + +var d = new Date(); + +var f = new Function(); + +var str = "Test"; + +var ob = new Object(); + + +// ******************************************** +// access default method +// +// ******************************************** + +AddTestCase( "*** Access default method of a class ***", 1, 1 ); +AddTestCase( "Obj.setArray(arr), Obj.getArray()", arr, Obj.testGetSetArray(arr) ); + + +// ******************************************** +// access private method +// +// ******************************************** + +// TODO: Need to modify the test to only create the date as Date(0) and just check the year +// AddTestCase( "*** Access private method of a class ***", 1, 1 ); +// AddTestCase( "Obj.setPrivDate(date), Obj.getPrivDate()", d, Obj.testGetSetPrivDate(d) ); + + +// ******************************************** +// access public method +// +// ******************************************** + +AddTestCase( "*** Access public method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPubBoolean(b), Obj.getPubBoolean()", true, (Obj.setPubBoolean(true), Obj.getPubBoolean()) ); + + +// ******************************************** +// access static method +// +// ******************************************** + +AddTestCase( "*** Access static method of a class ***", 1, 1 ); +AddTestCase( "Obj.setStatFunction(f), Obj.getStatFunction()", f, Obj.testGetSetStatFunction(f) ); + +// ******************************************** +// access private static method +// ******************************************** + +AddTestCase( "*** Access private static method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPrivStatString(s), Obj.getPrivStatString", str, Obj.testGetSetPrivStatString(str) ); + + +// ******************************************** +// access public static method +// ******************************************** + +AddTestCase( "*** Access public static method of a class ***", 1, 1 ); +AddTestCase( "AccFinPubDynClassMAndP.setPubStatObject(ob), AccFinPubDynClassMAndP.getPubStatObject()", ob, + (AccFinPubDynClassMAndP.setPubStatObject(ob), AccFinPubDynClassMAndP.getPubStatObject()) ); + + +// ******************************************** +// access final method +// ******************************************** + +AddTestCase( "*** Access final method of a class ***", 1, 1 ); +AddTestCase( "Obj.setFinNumber(10), Obj.getFinNumber()", 10, Obj.testGetSetFinNumber(10) ); + + +// ******************************************** +// access public final method +// ******************************************** + +AddTestCase( "*** Access public final method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPubFinArray(arr), Obj.getPubFinArray()", arr, (Obj.setPubFinArray(arr), Obj.getPubFinArray()) ); + + +// ******************************************** +// access public property +// ******************************************** + +AddTestCase( "*** Access public property of a class ***", 1, 1 ); +AddTestCase( "Obj.pubBoolean = true, Obj.pubBoolean", true, (Obj.pubBoolean = true, Obj.pubBoolean) ); + +// ******************************************** +// access public static property +// ******************************************** + +AddTestCase( "*** Access public satic property of a class ***", 1, 1 ); +AddTestCase( "AccFinPubDynClassMAndP.pubStatObject = ob, AccFinPubDynClassMAndP.pubStatObject", ob, (AccFinPubDynClassMAndP.pubStatObject = ob, AccFinPubDynClassMAndP.pubStatObject) ); + + +// ******************************************** +// access public final property +// ******************************************** + +AddTestCase( "*** Access public final property of a class ***", 1, 1 ); +AddTestCase( "Obj.pubFinArray = arr, Obj.pubFinArray", arr, (Obj.pubFinArray = arr, Obj.pubFinArray) ); + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalPublicDynamicClassMethodAndProp/AccFinPubDynClassMAndP.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalPublicDynamicClassMethodAndProp/AccFinPubDynClassMAndP.as new file mode 100644 index 00000000000..7461d417ddb --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/FinalPublicDynamicClassMethodAndProp/AccFinPubDynClassMAndP.as @@ -0,0 +1,169 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + + package FinalPublicDynamicClassMethodAndProp { + + + final public dynamic class AccFinPubDynClassMAndP { + + var array:Array; + + private var privDate:Date; + + public var pubBoolean:Boolean; + + static var statFunction:Function; + + private static var privStatString:String; + + public static var pubStatObject:Object; + + var finNumber:Number; + + public var pubFinArray:Array; + + static var finStatNumber:Number; + + + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function setArray( a:Array ) { array = a; } + + // wrapper function + + public function testGetSetArray(a:Array) : Array { + setArray(a); + return getArray(); + } + + + // ******************* + // private methods + // ******************* + + private function getPrivDate() : Date { return privDate; } + private function setPrivDate( d:Date ) { privDate = d; } + + // wrapper function + + public function testGetSetPrivDate(d:Date) : Date { + setPrivDate(d); + return getPrivDate(); + } + + + + // ******************* + // public methods + // ******************* + + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function getPubBoolean() : Boolean { return pubBoolean; } + + + + // ******************* + // static methods + // ******************* + + static function setStatFunction(f:Function) { statFunction = f; } + static function getStatFunction() { return statFunction; } + + // wrapper function + + public function testGetSetStatFunction(f:Function) : Function { + setStatFunction(f); + return getStatFunction(); + } + + + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatString(s:String) { privStatString = s; } + private static function getPrivStatString() { return privStatString; } + + // wrapper function + + public function testGetSetPrivStatString(s:String) : String { + setPrivStatString(s); + return getPrivStatString(); + } + + + + // ************************** + // public static methods + // ************************** + + public static function setPubStatObject(o:Object) { pubStatObject = o; } + public static function getPubStatObject() { return pubStatObject; } + + + + // ******************* + // final methods + // ******************* + + final function setFinNumber(n:Number) { finNumber = n; } + final function getFinNumber() { return finNumber; } + + // wrapper function + + public function testGetSetFinNumber(n:Number) : Number { + setFinNumber(n); + return getFinNumber(); + } + + + + // ******************* + // public final methods + // ******************* + + public final function setPubFinArray(a:Array) { pubFinArray = a; } + public final function getPubFinArray() { return pubFinArray; } + + + + + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/IntClassWithStrParamCons.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/IntClassWithStrParamCons.as new file mode 100644 index 00000000000..545e8dc61a2 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/IntClassWithStrParamCons.as @@ -0,0 +1,67 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + +import testInternalClassWithParamCons.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Constructors with parameters of a Dynamic class"; // Provide ECMA section //title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +//var x = "test"; +//var y:Boolean = true; +//var myArray:Array = new Array(4,6,5); +//var pbClCons:publicClassCons = new publicClassCons(); +var WIntCWPC:wrapIntClassWithStrParamCons=new wrapIntClassWithStrParamCons(); +//print (dynWithStrParamCons.myString()); +//print(x); +//print (dynWithStrParamCons.myBoolean()); +//print(y); +//print (dynWithStrParamCons.myarray()); +//print (myArray); +//print(dynWithStrParamCons.myAdd()); + +AddTestCase("calling public Instance method","test",WIntCWPC.wrapmyString()); +AddTestCase("calling public Instance method", true,WIntCWPC.wrapmyBoolean()); + +AddTestCase("Array", WIntCWPC.myArray1(),WIntCWPC.wrapmyarray()); +AddTestCase("Calling public Instance method Add",9,WIntCWPC.wrapmyAdd()); + + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/IntClassWithStrParamCons/IntClassWithStrParamCons.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/IntClassWithStrParamCons/IntClassWithStrParamCons.as new file mode 100644 index 00000000000..66f11294dbc --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/IntClassWithStrParamCons/IntClassWithStrParamCons.as @@ -0,0 +1,125 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package testInternalClassWithParamCons{ + + internal class IntClassWithStrParamCons{ + public var x:String; + public var myarr:Array; + public var myObj:publicClassCons; + + function IntClassWithStrParamCons(a:String,b:Boolean,c:Array,d:publicClassCons,e:DefaultClass) + + { + x=a; + y=b; + myarr=c; + myObj=d; + + } + + + public function myString():String{ + + return x; + } + public function myBoolean():Boolean{ + + return y; + } + public function myarray():Array{ + + return myarr; + } + + public function myAdd():Number{ + return myObj.Add(); + } + + + } + + + + +public class publicClassCons{ + + private var x:Number=4; + private var y:Number=5; + + + public function publicClassCons(){ + } + + public function Add(){ + var z = x+y; + return z; + + + } + } +class DefaultClass{} + +public class wrapIntClassWithStrParamCons{ + var x = "test"; + var y:Boolean = true; + var myArray:Array = new Array(4,6,5); + var pbClCons:publicClassCons = new publicClassCons(); + var MyDefaultClass:DefaultClass; + var ICWSPS:IntClassWithStrParamCons = new IntClassWithStrParamCons(x,y,myArray,pbClCons,MyDefaultClass); + public function myArray1():Array{ + return myArray; + } + + public function wrapmyString():String{ + var w:String = ICWSPS.myString(); + + return w; + } + public function wrapmyBoolean():Boolean{ + var H:Boolean = ICWSPS.myBoolean(); + return H; + } + + public function wrapmyarray():Array{ + var I:Array = ICWSPS.myarray(); + return I; + } + + public function wrapmyAdd():Number{ + var J:Number = ICWSPS.myAdd(); + return J; + } + + } + + + + } diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/InternalClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/InternalClass.as new file mode 100644 index 00000000000..e7aef6b64c6 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/InternalClass.as @@ -0,0 +1,153 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + +import InternalClassPackage.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Access Class Properties & Methods"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + +var arr = new Array(1,2,3); +var arr2 = new Array(3,2,1); +var Obj = new InternalClassAccessor(); +var d = new Date(0); +var d2 = new Date(1); +var f = new Function(); +var str = "Test"; +var ob = new Object(); + +// ******************************************** +// Access Default method +// ******************************************** +AddTestCase( "*** Access default method of a class ***", 1, 1 ); +AddTestCase( "Obj.setArray(arr), Obj.getArray()", arr, Obj.testGetSetArray(arr) ); + +// ******************************************** +// Access Default virtual method +// ******************************************** +AddTestCase( "*** Access default virtual method of a class ***", 1, 1 ); +AddTestCase( "Obj.setVirtualArray(arr2), Obj.getVirtualArray()", arr2, Obj.testGetSetVirtualArray(arr2) ); + +// ******************************************** +// Access Default Static method +// ******************************************** +AddTestCase( "*** Access static method of a class ***", 1, 1 ); +AddTestCase( "Obj.setStatFunction(f), Obj.getStatFunction()", f, Obj.testGetSetStatFunction(f) ); + +// ******************************************** +// Access Default Final method +// ******************************************** +AddTestCase( "*** Access final method of a class ***", 1, 1 ); +AddTestCase( "Obj.setFinNumber(10), Obj.getFinNumber()", 10, Obj.testGetSetFinNumber(10) ); + +// ******************************************** +// Access Internal method +// ******************************************** +AddTestCase( "*** Access internal method of a class ***", 1, 1 ); +AddTestCase( "Obj.setInternalArray(arr), Obj.getInternalArray()", arr, Obj.testGetSetInternalArray(arr) ); + +// ******************************************** +// Access Internal virtual method +// ******************************************** +AddTestCase( "*** Access internal virtual method of a class ***", 1, 1 ); +AddTestCase( "Obj.setInternalVirtualArray(arr2), Obj.getInternalVirtualArray()", arr2, Obj.testGetSetInternalVirtualArray(arr2) ); + +// ******************************************** +// Access Internal Static method +// ******************************************** +AddTestCase( "*** Access internal static method of a class ***", 1, 1 ); +AddTestCase( "Obj.setInternalStatFunction(f), Obj.getInternalStatFunction()", f, Obj.testGetSetInternalStatFunction(f) ); + +// ******************************************** +// Access Internal Final method +// ******************************************** +AddTestCase( "*** Access internal final method of a class ***", 1, 1 ); +AddTestCase( "Obj.setInternalFinNumber(10), Obj.getInternalFinNumber()", 10, Obj.testGetSetInternalFinNumber(10) ); + +// ******************************************** +// Access Private method +// ******************************************** +AddTestCase( "*** Access private method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPrivDate(date), Obj.getPrivDate()", d.getFullYear(), Obj.testGetSetPrivDate(d).getFullYear() ); + +// ******************************************** +// Access Private virtualmethod +// ******************************************** +AddTestCase( "*** Access private virtual method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPrivVirtualDate(date2), Obj.getPrivVirtaulDate()", d2.getFullYear(), Obj.testGetSetPrivVirtualDate(d2).getFullYear() ); + +// ******************************************** +// Access Private Static method +// ******************************************** +AddTestCase( "*** Access private static method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPrivStatString(s), Obj.getPrivStatString", str, Obj.testGetSetPrivStatString(str) ); + +// ******************************************** +// Access Private Final method +// ******************************************** +AddTestCase( "*** Access private final method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPrivFinalString(s), Obj.getPrivFinalString", str, Obj.testGetSetPrivFinalString(str) ); + +// ******************************************** +// Access Public method +// ******************************************** +AddTestCase( "*** Access public method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPubBoolean(b), Obj.getPubBoolean()", true, (Obj.setPubBoolean(true), Obj.getPubBoolean()) ); + +// ******************************************** +// Access Public virtual method +// ******************************************** +AddTestCase( "*** Access public virtual method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPubVirtualBoolean(false), Obj.getPubVirtualBoolean()", false, (Obj.setPubVirtualBoolean(false), Obj.getPubVirtualBoolean()) ); + +// ******************************************** +// Access Public Static method +// ******************************************** +AddTestCase( "*** Access public static method of a class ***", 1, 1 ); +AddTestCase( "Obj..setPubStatObject(ob), Obj.getPubStatObject()", ob, (Obj.setPubStatObject(ob), Obj.getPubStatObject()) ); + +// ******************************************** +// Access Public Final method +// ******************************************** +AddTestCase( "*** Access public final method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPubFinArray(arr), Obj.getPubFinArray()", arr, (Obj.setPubFinArray(arr), Obj.getPubFinArray()) ); + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/InternalClass/InternalClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/InternalClass/InternalClass.as new file mode 100644 index 00000000000..0102b50477f --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/InternalClass/InternalClass.as @@ -0,0 +1,267 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package InternalClassPackage { + internal class InternalClass { + + var array:Array; // Default property + static var statFunction:Function; // Default Static property + var finNumber:Number; // Default Final property + static var finStatNumber:Number; // Default Final Static property + + internal var internalArray:Array; // Internal property + internal static var internalStatFunction:Function; // Internal Static property + internal var internalFinNumber:Number; // Internal Final property + internal static var internalFinStatNumber:Number; // Internal Final Static property + + private var privDate:Date; // Private property + private static var privStatString:String; // Private Static property + private var privFinalString:String; // Private Final property + private static var privFinalStaticString:String // Private Final Static property + + public var pubBoolean:Boolean; // Public property + public static var pubStatObject:Object; // Public Static property + public var pubFinArray:Array; // Public Final property + public static var pubFinalStaticNumber:Number // Public Final Static property + + + // ***************** + // Default methods + // ***************** + function getArray() : Array { return array; } + function setArray( a:Array ) { array = a; } + + + // ************************ + // Default virtual methods + // ************************ + virtual function getVirtualArray() : Array { return array; } + virtual function setVirtualArray( a:Array ) { array = a; } + + + // *********************** + // Default Static methods + // *********************** + static function setStatFunction(f:Function) { statFunction = f; } + static function getStatFunction() : Function { return statFunction; } + + + // ********************** + // Default Final methods + // ********************** + final function setFinNumber(n:Number) { finNumber = n; } + final function getFinNumber() : Number { return finNumber; } + + + // ***************** + // Internal methods + // ***************** + internal function getInternalArray() : Array { return internalArray; } + internal function setInternalArray( a:Array ) { internalArray = a; } + + + // ************************* + // Internal virtual methods + // ************************* + internal virtual function getInternalVirtualArray() : Array { return internalArray; } + internal virtual function setInternalVirtualArray( a:Array ) { internalArray = a; } + + + // *********************** + // Internal Static methods + // *********************** + internal static function setInternalStatFunction(f:Function) { InternalClass.internalStatFunction = f; } + internal static function getInternalStatFunction() : Function { return InternalClass.internalStatFunction; } + + + // ********************** + // Internal Final methods + // ********************** + internal final function setInternalFinNumber(n:Number) { internalFinNumber = n; } + internal final function getInternalFinNumber() : Number { return internalFinNumber; } + + + + // ******************* + // Private methods + // ******************* + private function getPrivDate() : Date { return privDate; } + private function setPrivDate( d:Date ) { privDate = d; } + // wrapper function + public function testGetSetPrivDate(d:Date) : Date { + setPrivDate(d); + return getPrivDate(); + } + + + // ******************* + // Private virutal methods + // ******************* + private virtual function getPrivVirtualDate() : Date { return privDate; } + private virtual function setPrivVirtualDate( d:Date ) { privDate = d; } + // wrapper function + public function testGetSetPrivVirtualDate(d:Date) : Date { + setPrivVirtualDate(d); + return getPrivVirtualDate(); + } + + + // ************************** + // Private Static methods + // ************************** + private static function setPrivStatString(s:String) { privStatString = s; } + private static function getPrivStatString() : String { return privStatString; } + // wrapper function + public function testGetSetPrivStatString(s:String) : String { + setPrivStatString(s); + return getPrivStatString(); + } + + + // ************************** + // Private Final methods + // ************************** + private final function setPrivFinalString(s:String) { privFinalString = s; } + private final function getPrivFinalString() : String { return privFinalString; } + // wrapper function + public function testGetSetPrivFinalString(s:String) : String { + setPrivFinalString(s); + return getPrivFinalString(); + } + + + + // ******************* + // Public methods + // ******************* + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function getPubBoolean() : Boolean { return pubBoolean; } + + + // ******************* + // Public virtual methods + // ******************* + public virtual function setPubVirtualBoolean( b:Boolean ) { pubBoolean = b; } + public virtual function getPubVirtualBoolean() : Boolean { return pubBoolean; } + + + // ************************** + // Public Static methods + // ************************** + public static function setPubStatObject(o:Object) { InternalClass.pubStatObject = o; } + public static function getPubStatObject() : Object { return InternalClass.pubStatObject; } + + + // ******************* + // Public Final methods + // ******************* + public final function setPubFinArray(a:Array) { pubFinArray = a; } + public final function getPubFinArray() : Array { return pubFinArray; } + + } + + public class InternalClassAccessor { + private var Obj:InternalClass = new InternalClass(); + + // Default method + public function testGetSetArray(a:Array) : Array { + Obj.setArray(a); + return Obj.getArray(); + } + // Default virtual method + public function testGetSetVirtualArray(a:Array) : Array { + Obj.setVirtualArray(a); + return Obj.getVirtualArray(); + } + // Default static method + public function testGetSetStatFunction(f:Function) : Function { + InternalClass.setStatFunction(f); + return InternalClass.getStatFunction(); + } + // Default final method + public function testGetSetFinNumber(n:Number) : Number { + Obj.setFinNumber(n); + return Obj.getFinNumber(); + } + + // internal method + public function testGetSetInternalArray(a:Array) : Array { + Obj.setInternalArray(a); + return Obj.getInternalArray(); + } + // internal virtual method + public function testGetSetInternalVirtualArray(a:Array) : Array { + Obj.setInternalVirtualArray(a); + return Obj.getInternalVirtualArray(); + } + // internal static method + public function testGetSetInternalStatFunction(f:Function) : Function { + InternalClass.setInternalStatFunction(f); + return InternalClass.getInternalStatFunction(); + } + // internal final method + public function testGetSetInternalFinNumber(n:Number) : Number { + Obj.setInternalFinNumber(n); + return Obj.getInternalFinNumber(); + } + + // private method + public function testGetSetPrivDate(d:Date) : Date { + return Obj.testGetSetPrivDate(d); + } + // private virtualmethod + public function testGetSetPrivVirtualDate(d:Date) : Date { + return Obj.testGetSetPrivVirtualDate(d); + } + // Private Static methods + public function testGetSetPrivStatString(s:String) : String { + return Obj.testGetSetPrivStatString(s); + } + // Private Final methods + public function testGetSetPrivFinalString(s:String) : String { + return Obj.testGetSetPrivFinalString(s); + } + + // Public methods + public function setPubBoolean( b:Boolean ) { Obj.setPubBoolean(b); } + public function getPubBoolean() : Boolean { return Obj.getPubBoolean(); } + // Public virtual methods + public function setPubVirtualBoolean( b:Boolean ) { Obj.setPubVirtualBoolean(b); } + public function getPubVirtualBoolean() : Boolean { return Obj.getPubVirtualBoolean(); } + // Public Static methods + public function setPubStatObject(o:Object) { InternalClass.setPubStatObject(o); } + public function getPubStatObject() : Object { return InternalClass.getPubStatObject(); } + // Public Final methods + public function setPubFinArray(a:Array) { Obj.setPubFinArray(a); } + public function getPubFinArray() : Array { return Obj.getPubFinArray(); } + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/InternalClassPrototype.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/InternalClassPrototype.as new file mode 100644 index 00000000000..b5b87342946 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/InternalClassPrototype.as @@ -0,0 +1,118 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package Prototyping { + + + +import InternalClassPrototype.*; + +var SECTION = "Class Prototype"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Prototype testing for internal classes"; // Provide ECMA section title or a description +//var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var internalObj = new InternalClass(); + + +InternalClass.prototype.array = new Array('a', 'b', 'c'); +AddTestCase( "Try overriding default property through an Internal Class' prototype object", "1,2,3", internalObj.accessDefaultProperty().toString() ); + +InternalClass.prototype.intNumber = 500; +AddTestCase( "Try overriding internal property through an Internal Class' prototype object", "100", internalObj.intNumber.toString() ); + +InternalClass.prototype.protInt = 0; // Note: this override works because the protected property is not visible! +AddTestCase( "Try overriding protected property through an Internal Class' prototype object", "0", internalObj.protInt.toString() ); + +InternalClass.prototype.pubUint = 0; +AddTestCase( "Try overriding public property through an Internal Class' prototype object", "1", internalObj.pubUint.toString() ); + +InternalClass.prototype.privVar = false; +AddTestCase( "Try overriding private property through an Internal Class' prototype object", "true", internalObj.accPrivProp().toString() ); + +InternalClass.prototype.pubStat = 200; +AddTestCase( "Try overriding public static property through an Internal Class' prototype object", "100", InternalClass.pubStat.toString() ); + +InternalClass.prototype.nsProp = "fakeNS"; +AddTestCase( "Try overriding namespace property through an Internal Class' prototype object", "nsProp", internalObj.accNS().toString() ); + +InternalClass.prototype.defaultMethod = false; +AddTestCase( "Try overriding default methodsthrough an Internal Class' prototype object", true, internalObj.defaultMethod() ); + +InternalClass.prototype.internalMethod = -1; +AddTestCase( "Try overriding internal method through an Internal Class' prototype object", 1, internalObj.internalMethod() ); + +//InternalClass.prototype.protectedMethod = -1; +//AddTestCase( "Try overriding protected method through an Internal Class' prototype object", 1, internalObj.protectedMethod() ); + +InternalClass.prototype.publicMethod = false; +AddTestCase( "Try overriding public method through an Internal Class' prototype object", true, internalObj.publicMethod() ); + +InternalClass.prototype.privateMethod = false; +AddTestCase( "Try overriding private method through an Internal Class' prototype object", true, internalObj.accPrivMethod() ); + +InternalClass.prototype.nsMethod = -1; +AddTestCase( "Try overriding namespace method through an Internal Class' prototype object", 1, internalObj.accNSMethod() ); + +InternalClass.prototype.publicFinalMethod = -1; +AddTestCase( "Try overriding public final method through an Internal Class' prototype object", 1, internalObj.publicFinalMethod() ); + +InternalClass.prototype.publicStaticMethod = -1; +AddTestCase( "Try overriding public static method through an Internal Class' prototype object", 42, InternalClass.publicStaticMethod() ); + + +InternalClass.prototype.newArray = new Array('a', 'b', 'c'); +AddTestCase( "Try adding new property through an internal class' prototype object", "a,b,c", internalObj.newArray.toString() ); + +InternalClass.prototype.testFunction = function () {return true}; +AddTestCase("Try adding new method through an internal class' prototype object", true, internalObj.testFunction()); + +var equivalent:Boolean = (InternalClass.prototype.constructor == InternalClass); +AddTestCase("Verify prototype constructor is equivalent to class object", true, equivalent); + + +var thisError10 = "no error thrown"; +var temp:Object = new Object(); +try{ + InternalClass.prototype = temp; +} catch (e) { + thisError10 = e.toString(); +} finally { + AddTestCase( "Try to write to InternalClass' prototype object", "ReferenceError: Error #1074", + referenceError( thisError10 ) ); +} + +test(); // leave this alone. this executes the test cases and + // displays results. + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/InternalClassPrototype/InternalClassPrototype.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/InternalClassPrototype/InternalClassPrototype.as new file mode 100644 index 00000000000..14edd4ed969 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/InternalClassPrototype/InternalClassPrototype.as @@ -0,0 +1,96 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package Prototyping { + + namespace internalNS; + + internal class InternalClass { + + var array:Array = new Array(1,2,3); // Default property + internal var intNumber:Number = 100; // internal property + protected var protInt:int = -1; // protected property + public var pubUint:uint = 1; // public property + private var privVar:Boolean = true; // private property + public static var pubStat:Number = 100; // public static property + internalNS var nsProp:String = "nsProp"; // namespace property + + // default method + function defaultMethod():Boolean{ return true; } + + // Internal method + internal function internalMethod():int { return 1; } + + // protected method + protected function protectedMethod():uint { return 1; } + + // public method + public function publicMethod():Boolean { return true; } + + // private method + private function privateMethod():Boolean { return true; } + + // namespace method + internalNS function nsMethod():Number { return 1; } + + // public final method + public final function publicFinalMethod():Number { return 1; } + + // public static method + public static function publicStaticMethod():int { return 42; } + + // access private property from same class same package + function accPrivProp():Boolean { + return this.privVar; + } + + // access private method from same class same package + function accPrivMethod():Boolean { + return this.privateMethod(); + } + + //accessor for default property + public function accessDefaultProperty():Array{ + return this.array; + } + + //accessor function for ns property + public function accNS():String { + return this.internalNS::nsProp; + } + + //accessor function for namespace method + public function accNSMethod():Number{ + return this.internalNS::nsMethod(); + } + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/InternalDynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/InternalDynamicClass.as new file mode 100644 index 00000000000..1f877e0f8ca --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/InternalDynamicClass.as @@ -0,0 +1,152 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + +import InternalDynamicClassPackage.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Access Class Properties & Methods"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + +var arr = new Array(1,2,3); +var arr2 = new Array(3,2,1); +var Obj = new InternalDynamicClassAccessor(); +var d = new Date(0); +var d2 = new Date(1); +var f = new Function(); +var str = "Test"; +var ob = new Object(); + +// ******************************************** +// Access Default method +// ******************************************** +AddTestCase( "*** Access default method of a class ***", 1, 1 ); +AddTestCase( "Obj.setArray(arr), Obj.getArray()", arr, Obj.testGetSetArray(arr) ); + +// ******************************************** +// Access Default virtual method +// ******************************************** +AddTestCase( "*** Access default virtual method of a class ***", 1, 1 ); +AddTestCase( "Obj.setVirtualArray(arr2), Obj.getVirtualArray()", arr2, Obj.testGetSetVirtualArray(arr2) ); + +// ******************************************** +// Access Default Static method +// ******************************************** +AddTestCase( "*** Access static method of a class ***", 1, 1 ); +AddTestCase( "Obj.setStatFunction(f), Obj.getStatFunction()", f, Obj.testGetSetStatFunction(f) ); + +// ******************************************** +// Access Default Final method +// ******************************************** +AddTestCase( "*** Access final method of a class ***", 1, 1 ); +AddTestCase( "Obj.setFinNumber(10), Obj.getFinNumber()", 10, Obj.testGetSetFinNumber(10) ); + +// ******************************************** +// Access Internal method +// ******************************************** +AddTestCase( "*** Access internal method of a class ***", 1, 1 ); +AddTestCase( "Obj.setInternalArray(arr), Obj.getInternalArray()", arr, Obj.testGetSetInternalArray(arr) ); + +// ******************************************** +// Access Internal virtual method +// ******************************************** +AddTestCase( "*** Access internal virtual method of a class ***", 1, 1 ); +AddTestCase( "Obj.setInternalVirtualArray(arr2), Obj.getInternalVirtualArray()", arr2, Obj.testGetSetInternalVirtualArray(arr2) ); + +// ******************************************** +// Access Internal Static method +// ******************************************** +AddTestCase( "*** Access internal static method of a class ***", 1, 1 ); +AddTestCase( "Obj.setInternalStatFunction(f), Obj.getInternalStatFunction()", f, Obj.testGetSetInternalStatFunction(f) ); + +// ******************************************** +// Access Internal Final method +// ******************************************** +AddTestCase( "*** Access internal final method of a class ***", 1, 1 ); +AddTestCase( "Obj.setInternalFinNumber(10), Obj.getInternalFinNumber()", 10, Obj.testGetSetInternalFinNumber(10) ); + +// ******************************************** +// Access Private method +// ******************************************** +AddTestCase( "*** Access private method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPrivDate(date), Obj.getPrivDate()", d.getFullYear(), Obj.testGetSetPrivDate(d).getFullYear() ); + +// ******************************************** +// Access Private virtualmethod +// ******************************************** +AddTestCase( "*** Access private virtual method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPrivVirtualDate(date2), Obj.getPrivVirtaulDate()", d2.getFullYear(), Obj.testGetSetPrivVirtualDate(d2).getFullYear() ); + +// ******************************************** +// Access Private Static method +// ******************************************** +AddTestCase( "*** Access private static method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPrivStatString(s), Obj.getPrivStatString", str, Obj.testGetSetPrivStatString(str) ); + +// ******************************************** +// Access Private Final method +// ******************************************** +AddTestCase( "*** Access private final method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPrivFinalString(s), Obj.getPrivFinalString", str, Obj.testGetSetPrivFinalString(str) ); + +// ******************************************** +// Access Public method +// ******************************************** +AddTestCase( "*** Access public method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPubBoolean(b), Obj.getPubBoolean()", true, (Obj.setPubBoolean(true), Obj.getPubBoolean()) ); + +// ******************************************** +// Access Public virtual method +// ******************************************** +AddTestCase( "*** Access public virtual method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPubVirtualBoolean(false), Obj.getPubVirtualBoolean()", false, (Obj.setPubVirtualBoolean(false), Obj.getPubVirtualBoolean()) ); + +// ******************************************** +// Access Public Static method +// ******************************************** +AddTestCase( "*** Access public static method of a class ***", 1, 1 ); +AddTestCase( "Obj..setPubStatObject(ob), Obj.getPubStatObject()", ob, (Obj.setPubStatObject(ob), Obj.getPubStatObject()) ); + +// ******************************************** +// Access Public Final method +// ******************************************** +AddTestCase( "*** Access public final method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPubFinArray(arr), Obj.getPubFinArray()", arr, (Obj.setPubFinArray(arr), Obj.getPubFinArray()) ); + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/InternalDynamicClass/InternalDynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/InternalDynamicClass/InternalDynamicClass.as new file mode 100644 index 00000000000..f703b344e62 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/InternalDynamicClass/InternalDynamicClass.as @@ -0,0 +1,267 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package InternalDynamicClassPackage { + internal dynamic class InternalDynamicClass { + + var array:Array; // Default property + static var statFunction:Function; // Default Static property + var finNumber:Number; // Default Final property + static var finStatNumber:Number; // Default Final Static property + + internal var internalArray:Array; // Internal property + internal static var internalStatFunction:Function; // Internal Static property + internal var internalFinNumber:Number; // Internal Final property + internal static var internalFinStatNumber:Number; // Internal Final Static property + + private var privDate:Date; // Private property + private static var privStatString:String; // Private Static property + private var privFinalString:String; // Private Final property + private static var privFinalStaticString:String // Private Final Static property + + public var pubBoolean:Boolean; // Public property + public static var pubStatObject:Object; // Public Static property + public var pubFinArray:Array; // Public Final property + public static var pubFinalStaticNumber:Number // Public Final Static property + + + // ***************** + // Default methods + // ***************** + function getArray() : Array { return array; } + function setArray( a:Array ) { array = a; } + + + // ************************ + // Default virtual methods + // ************************ + virtual function getVirtualArray() : Array { return array; } + virtual function setVirtualArray( a:Array ) { array = a; } + + + // *********************** + // Default Static methods + // *********************** + static function setStatFunction(f:Function) { statFunction = f; } + static function getStatFunction() : Function { return statFunction; } + + + // ********************** + // Default Final methods + // ********************** + final function setFinNumber(n:Number) { finNumber = n; } + final function getFinNumber() : Number { return finNumber; } + + + // ***************** + // Internal methods + // ***************** + internal function getInternalArray() : Array { return internalArray; } + internal function setInternalArray( a:Array ) { internalArray = a; } + + + // ************************* + // Internal virtual methods + // ************************* + internal virtual function getInternalVirtualArray() : Array { return internalArray; } + internal virtual function setInternalVirtualArray( a:Array ) { internalArray = a; } + + + // *********************** + // Internal Static methods + // *********************** + internal static function setInternalStatFunction(f:Function) { InternalDynamicClass.internalStatFunction = f; } + internal static function getInternalStatFunction() : Function { return InternalDynamicClass.internalStatFunction; } + + + // ********************** + // Internal Final methods + // ********************** + internal final function setInternalFinNumber(n:Number) { internalFinNumber = n; } + internal final function getInternalFinNumber() : Number { return internalFinNumber; } + + + // ******************* + // Private methods + // ******************* + private function getPrivDate() : Date { return privDate; } + private function setPrivDate( d:Date ) { privDate = d; } + // wrapper function + public function testGetSetPrivDate(d:Date) : Date { + setPrivDate(d); + return getPrivDate(); + } + + + // ******************* + // Private virutal methods + // ******************* + private virtual function getPrivVirtualDate() : Date { return privDate; } + private virtual function setPrivVirtualDate( d:Date ) { privDate = d; } + // wrapper function + public function testGetSetPrivVirtualDate(d:Date) : Date { + setPrivVirtualDate(d); + return getPrivVirtualDate(); + } + + + // ************************** + // Private Static methods + // ************************** + private static function setPrivStatString(s:String) { privStatString = s; } + private static function getPrivStatString() : String { return privStatString; } + // wrapper function + public function testGetSetPrivStatString(s:String) : String { + setPrivStatString(s); + return getPrivStatString(); + } + + + // ************************** + // Private Final methods + // ************************** + private final function setPrivFinalString(s:String) { privFinalString = s; } + private final function getPrivFinalString() : String { return privFinalString; } + // wrapper function + public function testGetSetPrivFinalString(s:String) : String { + setPrivFinalString(s); + return getPrivFinalString(); + } + + + // ******************* + // Public methods + // ******************* + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function getPubBoolean() : Boolean { return pubBoolean; } + + + // ******************* + // Public virtual methods + // ******************* + public virtual function setPubVirtualBoolean( b:Boolean ) { pubBoolean = b; } + public virtual function getPubVirtualBoolean() : Boolean { return pubBoolean; } + + + // ************************** + // Public Static methods + // ************************** + public static function setPubStatObject(o:Object) { InternalDynamicClass.pubStatObject = o; } + public static function getPubStatObject() : Object { return InternalDynamicClass.pubStatObject; } + + + // ******************* + // Public Final methods + // ******************* + public final function setPubFinArray(a:Array) { pubFinArray = a; } + public final function getPubFinArray() : Array { return pubFinArray; } + + } + + public class InternalDynamicClassAccessor { + private var Obj:InternalDynamicClass = new InternalDynamicClass(); + + // Default method + public function testGetSetArray(a:Array) : Array { + Obj.setArray(a); + return Obj.getArray(); + } + // Default virtual method + public function testGetSetVirtualArray(a:Array) : Array { + Obj.setVirtualArray(a); + return Obj.getVirtualArray(); + } + // Default static method + public function testGetSetStatFunction(f:Function) : Function { + InternalDynamicClass.setStatFunction(f); + return InternalDynamicClass.getStatFunction(); + } + // Default final method + public function testGetSetFinNumber(n:Number) : Number { + Obj.setFinNumber(n); + return Obj.getFinNumber(); + } + + // internal method + public function testGetSetInternalArray(a:Array) : Array { + Obj.setInternalArray(a); + return Obj.getInternalArray(); + } + // internal virtual method + public function testGetSetInternalVirtualArray(a:Array) : Array { + Obj.setInternalVirtualArray(a); + return Obj.getInternalVirtualArray(); + } + // internal static method + public function testGetSetInternalStatFunction(f:Function) : Function { + InternalDynamicClass.setInternalStatFunction(f); + return InternalDynamicClass.getInternalStatFunction(); + } + // internal final method + public function testGetSetInternalFinNumber(n:Number) : Number { + Obj.setInternalFinNumber(n); + return Obj.getInternalFinNumber(); + } + + + // private method + public function testGetSetPrivDate(d:Date) : Date { + return Obj.testGetSetPrivDate(d); + } + // private virtualmethod + public function testGetSetPrivVirtualDate(d:Date) : Date { + return Obj.testGetSetPrivVirtualDate(d); + } + // Private Static methods + public function testGetSetPrivStatString(s:String) : String { + return Obj.testGetSetPrivStatString(s); + } + // Private Final methods + public function testGetSetPrivFinalString(s:String) : String { + return Obj.testGetSetPrivFinalString(s); + } + + + // Public methods + public function setPubBoolean( b:Boolean ) { Obj.setPubBoolean(b); } + public function getPubBoolean() : Boolean { return Obj.getPubBoolean(); } + // Public virtual methods + public function setPubVirtualBoolean( b:Boolean ) { Obj.setPubVirtualBoolean(b); } + public function getPubVirtualBoolean() : Boolean { return Obj.getPubVirtualBoolean(); } + // Public Static methods + public function setPubStatObject(o:Object) { InternalDynamicClass.setPubStatObject(o); } + public function getPubStatObject() : Object { return InternalDynamicClass.getPubStatObject(); } + // Public Final methods + public function setPubFinArray(a:Array) { Obj.setPubFinArray(a); } + public function getPubFinArray() : Array { return Obj.getPubFinArray(); } + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/PrivateStaticClassMethodAndProp.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/PrivateStaticClassMethodAndProp.as new file mode 100644 index 00000000000..fda0013fc0f --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/PrivateStaticClassMethodAndProp.as @@ -0,0 +1,126 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + +import PrivateStaticClassMethodAndProp.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Access Class Properties & Methods"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + +var arr = new Array(1,2,3); + +var Obj = new AccPrivStatClassMAndP(); + +var d = new Date(); + +var f = new Function(); + +var str = "Test"; + +var ob = new Object(); + + +// ******************************************** +// access default method +// +// ******************************************** + +AddTestCase( "*** Access default method of a static class ***", 1, 1 ); +AddTestCase( "Obj.setArray(arr), Obj.getArray()", arr, Obj.testGetSetArray(arr) ); + + +// ******************************************** +// access private method +// +// ******************************************** + +// TODO: Need to modify the test to only create the date as Date(0) and just check the year +// AddTestCase( "*** Access private method of a static class ***", 1, 1 ); +// AddTestCase( "Obj.setPrivDate(date), Obj.getPrivDate()", d, Obj.testGetSetPrivDate(d) ); + + +// ******************************************** +// access public method +// +// ******************************************** + +AddTestCase( "*** Access public method of a static class ***", 1, 1 ); +AddTestCase( "Obj.setPubBoolean(b), Obj.getPubBoolean()", true, Obj.testGetSetPubBoolean(true) ); + + +// ******************************************** +// access static method +// +// ******************************************** + +AddTestCase( "*** Access static method of a static class ***", 1, 1 ); +AddTestCase( "Obj.setStatFunction(f), Obj.getStatFunction()", f, Obj.testGetSetStatFunction(f) ); + +// ******************************************** +// access private static method +// ******************************************** + +AddTestCase( "*** Access private static method of a static class ***", 1, 1 ); +AddTestCase( "Obj.setPrivStatString(s), Obj.getPrivStatString", str, Obj.testGetSetPrivStatString(str) ); + + +// ******************************************** +// access public static method +// ******************************************** + +AddTestCase( "*** Access public static method of a static class ***", 1, 1 ); +AddTestCase( "Obj.setPubStatObject(ob), Obj.getPubStatObject()", ob, Obj.testGetSetPubStatObject(ob) ); + + +// ******************************************** +// access final method +// ******************************************** + +AddTestCase( "*** Access final method of a static class ***", 1, 1 ); +AddTestCase( "Obj.setFinNumber(10), Obj.getFinNumber()", 10, Obj.testGetSetFinNumber(10) ); + + +// ******************************************** +// access public final method +// ******************************************** + +AddTestCase( "*** Access public final method of a static class ***", 1, 1 ); +AddTestCase( "Obj.setPubFinArray(arr), Obj.getPubFinArray()", arr, Obj.testGetSetPubArray(arr) ); + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/PrivateStaticClassMethodAndProp/AccPrivStatClassMAndP.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/PrivateStaticClassMethodAndProp/AccPrivStatClassMAndP.as new file mode 100644 index 00000000000..f9ea5a769ef --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/PrivateStaticClassMethodAndProp/AccPrivStatClassMAndP.as @@ -0,0 +1,204 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + + package PrivateStaticClassMethodAndProp { + + + public class AccPrivStatClassMAndP { + + + + + var array:Array; + + private var privDate:Date; + + public var pubBoolean:Boolean; + + static var statFunction:Function; + + private static var privStatString:String; + + public static var pubStatObject:Object; + + var finNumber:Number; + + public var pubFinArray:Array; + + static var finStatNumber:Number; + + + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function setArray( a:Array ) { array = a; } + + + + // ******************* + // private methods + // ******************* + + private function getPrivDate() : Date { return privDate; } + private function setPrivDate( d:Date ) { privDate = d; } + + // wrapper function + + public function testGetSetPrivDate(d:Date) : Date { + setPrivDate(d); + return getPrivDate(); + } + + + + // ******************* + // public methods + // ******************* + + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function getPubBoolean() : Boolean { return pubBoolean; } + + + + // ******************* + // static methods + // ******************* + + static function setStatFunction(f:Function) { statFunction = f; } + static function getStatFunction() { return statFunction; } + + + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatString(s:String) { privStatString = s; } + private static function getPrivStatString() { return privStatString; } + + // wrapper function + + public function testGetSetPrivStatString(s:String) : String { + setPrivStatString(s); + return getPrivStatString(); + } + + + + // ************************** + // public static methods + // ************************** + + public static function setPubStatObject(o:Object) { pubStatObject = o; } + public static function getPubStatObject() { return pubStatObject; } + + + + // ******************* + // final methods + // ******************* + + final function setFinNumber(n:Number) { finNumber = n; } + final function getFinNumber() { return finNumber; } + + + + // ******************* + // public final methods + // ******************* + + public final function setPubFinArray(a:Array) { pubFinArray = a; } + public final function getPubFinArray() { return pubFinArray; } + + + + + + + + // wrapper function + + public function testGetSetArray(a:Array) : Array { + setArray(a); + return getArray(); + } + + + // wrapper function + + public function testGetSetPubBoolean(b:Boolean) : Boolean { + setPubBoolean(b); + return getPubBoolean(); + } + + // wrapper function + + public function testGetSetStatFunction(f:Function) : Function { + setStatFunction(f); + return getStatFunction(); + } + + + + // wrapper function + + public function testGetSetPubStatObject(o:Object) : Object { + setPubStatObject(o); + return getPubStatObject(); + } + + // wrapper function + + public function testGetSetFinNumber(n:Number) : Number { + setFinNumber(n); + return getFinNumber(); + } + + // wrapper function + + public function testGetSetPubArray(a:Array) : Array { + setPubFinArray(a); + return getPubFinArray(); + } + + + + + + + } // AccPrivStatClassMAndP + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/PublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/PublicClass.as new file mode 100644 index 00000000000..98a33c637e3 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/PublicClass.as @@ -0,0 +1,193 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + +import PublicClassPackage.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Access Class Properties & Methods"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + +var arr = new Array(1,2,3); +var arr2 = new Array(3,2,1); +var Obj = new PublicClass(); +var d = new Date(0); +var d2 = new Date(1); +var f = new Function(); +var str = "Test"; +var ob = new Object(); +var foo; + + +// ******************************************** +// Basic Constructor tests +// ******************************************** +AddTestCase( "*** No param constructor test ***", 1, 1 ); +AddTestCase( "var foo = new PublicClass(), foo.constructorCount", 2, (foo = new PublicClass(), PublicClass.constructorCount) ); +AddTestCase( "*** No param constructor test ***", 1, 1 ); +AddTestCase( "var foo = new PublicClass, foo.constructorCount", 3, (foo = new PublicClass, PublicClass.constructorCount) ); + +// ******************************************** +// Access Default method +// ******************************************** +AddTestCase( "*** Access default method of a class ***", 1, 1 ); +AddTestCase( "Obj.setArray(arr), Obj.getArray()", arr, Obj.testGetSetArray(arr) ); + +// ******************************************** +// Access Default virtual method +// ******************************************** +AddTestCase( "*** Access default virtual method of a class ***", 1, 1 ); +AddTestCase( "Obj.setVirtArray(arr), Obj.getVirtArray()", arr2, Obj.testGetSetVirtualArray(arr2) ); + +// ******************************************** +// Access Default Static method +// ******************************************** +AddTestCase( "*** Access static method of a class ***", 1, 1 ); +AddTestCase( "Obj.setStatFunction(f), Obj.getStatFunction()", f, Obj.testGetSetStatFunction(f) ); + +// ******************************************** +// Access Default Final method +// ******************************************** +AddTestCase( "*** Access final method of a class ***", 1, 1 ); +AddTestCase( "Obj.setFinNumber(10), Obj.getFinNumber()", 10, Obj.testGetSetFinNumber(10) ); + +// ******************************************** +// Access Internal method +// ******************************************** +AddTestCase( "*** Access internal method of a class ***", 1, 1 ); +AddTestCase( "Obj.setInternalArray(arr), Obj.getInternalArray()", arr, Obj.testGetSetInternalArray(arr) ); + +// ******************************************** +// Access Internal virtual method +// ******************************************** +AddTestCase( "*** Access internal virtual method of a class ***", 1, 1 ); +AddTestCase( "Obj.setInternalVirtualArray(arr), Obj.getInternalVirtualArray()", arr2, Obj.testGetSetInternalVirtualArray(arr2) ); + + +// ******************************************** +// Access Internal Static method +// ******************************************** +AddTestCase( "*** Access internal static method of a class ***", 1, 1 ); +AddTestCase( "Obj.setInternalStatFunction(f), Obj.getInternalStatFunction()", f, Obj.testGetSetInternalStatFunction(f) ); + + +// ******************************************** +// Access Internal Final method +// ******************************************** +AddTestCase( "*** Access internal final method of a class ***", 1, 1 ); +AddTestCase( "Obj.setInternalFinNumber(10), Obj.getInternalFinNumber()", 10, Obj.testGetSetInternalFinNumber(10) ); + +// ******************************************** +// Access Private method +// ******************************************** +AddTestCase( "*** Access private method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPrivDate(date), Obj.getPrivDate()", d.getFullYear(), Obj.testGetSetPrivDate(d).getFullYear() ); + +// ******************************************** +// Access Private virtual method +// ******************************************** +AddTestCase( "*** Access private virtual method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPrivVirtualDate(date), Obj.getPrivVirtualDate()", d2.getFullYear(), Obj.testGetSetPrivVirtualDate(d2).getFullYear() ); + +// ******************************************** +// Access Private Static method +// ******************************************** +AddTestCase( "*** Access private static method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPrivStatString(s), Obj.getPrivStatString", str, Obj.testGetSetPrivStatString(str) ); + +// ******************************************** +// Access Private Final method +// ******************************************** +AddTestCase( "*** Access private final method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPrivFinalString(s), Obj.getPrivFinalString", str, Obj.testGetSetPrivFinalString(str) ); + +// ******************************************** +// Access Public method +// ******************************************** +AddTestCase( "*** Access public method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPubBoolean(b), Obj.getPubBoolean()", true, (Obj.setPubBoolean(true), Obj.getPubBoolean()) ); + +// ******************************************** +// Access Public virtual method +// ******************************************** +AddTestCase( "*** Access public virtual method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPubVirtualBoolean(b), Obj.getPubVirtualBoolean()", false, (Obj.setPubBoolean(false), Obj.getPubBoolean()) ); + +// ******************************************** +// Access Public Static method +// ******************************************** +AddTestCase( "*** Access public static method of a class ***", 1, 1 ); +AddTestCase( "PublicClass.setPubStatObject(ob), PublicClass.getPubStatObject()", ob, (PublicClass.setPubStatObject(ob), PublicClass.getPubStatObject()) ); + +// ******************************************** +// Access Public Final method +// ******************************************** +AddTestCase( "*** Access public final method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPubFinArray(arr), Obj.getPubFinArray()", arr, (Obj.setPubFinArray(arr), Obj.getPubFinArray()) ); + + + + + +// ******************************************** +// Access Public property +// ******************************************** +AddTestCase( "*** Access public property of a class ***", 1, 1 ); +AddTestCase( "Obj.pubBoolean = true, Obj.pubBoolean", true, (Obj.pubBoolean = true, Obj.pubBoolean) ); + +// ******************************************** +// Access Public Static property +// ******************************************** +AddTestCase( "*** Access public satic property of a class ***", 1, 1 ); +AddTestCase( "PublicClass.pubStatObject = ob, PublicClass.pubStatObject", ob, (PublicClass.pubStatObject = ob, PublicClass.pubStatObject) ); + +// ******************************************** +// Access Public Final property +// ******************************************** +AddTestCase( "*** Access public final property of a class ***", 1, 1 ); +AddTestCase( "Obj.pubFinArray = arr, Obj.pubFinArray", arr, (Obj.pubFinArray = arr, Obj.pubFinArray) ); + +// ******************************************** +// Access Public Final Static property +// ******************************************** +AddTestCase( "*** Access public final static property of a class ***", 1, 1 ); +AddTestCase( "PublicClass.pubFinalStaticNumber = 10, PublicClass.pubFinalStaticNumber", 10, (PublicClass.pubFinalStaticNumber = 10, PublicClass.pubFinalStaticNumber) ); + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/PublicClass/PublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/PublicClass/PublicClass.as new file mode 100644 index 00000000000..fd7bf2a4d92 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/PublicClass/PublicClass.as @@ -0,0 +1,254 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package PublicClassPackage { + public class PublicClass { + + var array:Array; // Default property + var finNumber:Number; // Default final property + static var statFunction:Function; // Default Static property + static var finStatNumber:Number; // Default final static property + // TODO: virtual vars are not implemented yet + // virtual var virtArray:Array; + + internal var internalArray:Array; // Internal property + internal var internalFinNumber:Number; // Internal final property + internal static var internalStatFunction:Function; // Internal static property + internal static var internalFinStatNumber:Number; // Internal Final Static property + // TODO: virtual vars are not implemented yet + // internal virtual var internalVirtNumber:Number; // internal virtual property + + private var privDate:Date; // Private property + private static var privStatString:String; // Private Static property + private var privFinalString:String; // Private Final property + private static var privFinalStaticString:String // Private Final Static property + // TODO: virtual vars are not implemented yet + // private virtual privVirtDate:Date; + + public var pubBoolean:Boolean; // Public property + public static var pubStatObject:Object; // Public Static property + public var pubFinArray:Array; // Public Final property + public static var pubFinalStaticNumber:Number // Public Final Static property + // TODO: virtual vars are not implemented yet + // public virtual var pubVirtBoolean:Boolean; + + + // Testing property for constructor testing + public static var constructorCount : int = 0; + + // ***************** + // Constructors + // ***************** + public function PublicClass () { + PublicClass.constructorCount ++; + } + + + // ***************** + // Default methods + // ***************** + function getArray() : Array { return array; } + function setArray( a:Array ) { array = a; } + // wrapper function + public function testGetSetArray(a:Array) : Array { + setArray(a); + return getArray(); + } + + + // ************************ + // Default virtual methods + // ************************ + // TODO: virtual vars are not implemented yet so this is currently using a normal var + virtual function getVirtualArray() : Array { return array; } + virtual function setVirtualArray( a:Array ) { array = a; } + // wrapper function + public function testGetSetVirtualArray(a:Array) : Array { + setVirtualArray(a); + return getVirtualArray(); + } + + + // *********************** + // Default Static methods + // *********************** + static function setStatFunction(f:Function) { PublicClass.statFunction = f; } + static function getStatFunction() : Function { return PublicClass.statFunction; } + // wrapper function + public function testGetSetStatFunction(f:Function) : Function { + PublicClass.setStatFunction(f); + return PublicClass.getStatFunction(); + } + + + // ********************** + // Default Final methods + // ********************** + final function setFinNumber(n:Number) { finNumber = n; } + final function getFinNumber() { return finNumber; } + // wrapper function + public function testGetSetFinNumber(n:Number) : Number { + setFinNumber(n); + return getFinNumber(); + } + + + + // ***************** + // Internal methods + // ***************** + internal function getInternalArray() : Array { return internalArray; } + internal function setInternalArray( a:Array ) { internalArray = a; } + // wrapper function + public function testGetSetInternalArray(a:Array) : Array { + setInternalArray(a); + return getInternalArray(); + } + + + // ************************* + // Internal virtual methods + // ************************ + // TODO: virtual vars are not implemented yet so this is currently using a normal var + internal virtual function getInternalVirtualArray() : Array { return internalArray; } + internal virtual function setInternalVirtualArray( a:Array ) { internalArray = a; } + // wrapper function + public function testGetSetInternalVirtualArray(a:Array) : Array { + setInternalVirtualArray(a); + return getInternalVirtualArray(); + } + + + // *********************** + // Internal Static methods + // *********************** + internal static function setInternalStatFunction(f:Function) { internalStatFunction = f; } + internal static function getInternalStatFunction() { return internalStatFunction; } + // wrapper function + public function testGetSetInternalStatFunction(f:Function) : Function { + setInternalStatFunction(f); + return getInternalStatFunction(); + } + + + + // ********************** + // Internal Final methods + // ********************** + internal final function setInternalFinNumber(n:Number) { internalFinNumber = n; } + internal final function getInternalFinNumber() { return internalFinNumber; } + // wrapper function + public function testGetSetInternalFinNumber(n:Number) : Number { + setInternalFinNumber(n); + return getInternalFinNumber(); + } + + + + // ******************* + // Private methods + // ******************* + private function getPrivDate() : Date { return privDate; } + private function setPrivDate( d:Date ) { privDate = d; } + // wrapper function + public function testGetSetPrivDate(d:Date) : Date { + setPrivDate(d); + return getPrivDate(); + } + + + // ************************ + // Private virtual methods + // *********************** + // TODO: virtual vars are not implemented yet so this is currently using a normal var + private virtual function getPrivVirtualDate() : Date { return privDate; } + private virtual function setPrivVirtualDate( d:Date ) { privDate = d; } + // wrapper function + public function testGetSetPrivVirtualDate(d:Date) : Date { + setPrivVirtualDate(d); + return getPrivVirtualDate(); + } + + + // ************************** + // Private Static methods + // ************************** + private static function setPrivStatString(s:String) { PublicClass.privStatString = s; } + private static function getPrivStatString() { return PublicClass.privStatString; } + // wrapper function + public function testGetSetPrivStatString(s:String) : String { + PublicClass.setPrivStatString(s); + return PublicClass.getPrivStatString(); + } + + + // ************************** + // Private Final methods + // ************************** + private final function setPrivFinalString(s:String) { privFinalString = s; } + private final function getPrivFinalString() { return privFinalString; } + // wrapper function + public function testGetSetPrivFinalString(s:String) : String { + setPrivFinalString(s); + return getPrivFinalString(); + } + + + + // ******************* + // Public methods + // ******************* + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function getPubBoolean() : Boolean { return pubBoolean; } + + + // ************************ + // Public virutal methods + // *********************** + // TODO: virtual vars are not implemented yet so this is currently using a normal var + public virtual function setPubVirtualBoolean( b:Boolean ) { pubBoolean = b; } + public virtual function getPubVirtualBoolean() : Boolean { return pubBoolean; } + + + // ************************** + // Public Static methods + // ************************** + public static function setPubStatObject(o:Object) { PublicClass.pubStatObject = o; } + public static function getPubStatObject() { return PublicClass.pubStatObject; } + + + // ******************* + // Public Final methods + // ******************* + public final function setPubFinArray(a:Array) { pubFinArray = a; } + public final function getPubFinArray() { return pubFinArray; } + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/PublicClassMethodAndProp.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/PublicClassMethodAndProp.as new file mode 100644 index 00000000000..ee018d4cbbb --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/PublicClassMethodAndProp.as @@ -0,0 +1,153 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + +import PublicClassMethodAndProp.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Access Class Properties & Methods"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + +var arr = new Array(1,2,3); + +var Obj = new AccPubClassMAndP(); + +var d = new Date(); + +var f = new Function(); + +var str = "Test"; + +var ob = new Object(); + + +// ******************************************** +// access default method +// +// ******************************************** + +AddTestCase( "*** Access default method of a class ***", 1, 1 ); +AddTestCase( "Obj.setArray(arr), Obj.getArray()", arr, Obj.testGetSetArray(arr) ); + + +// ******************************************** +// access private method +// +// ******************************************** + +// TODO: Need to modify the test to only create the date as Date(0) and just check the year +// AddTestCase( "*** Access private method of a class ***", 1, 1 ); +// AddTestCase( "Obj.setPrivDate(date), Obj.getPrivDate()", d, Obj.testGetSetPrivDate(d) ); + + +// ******************************************** +// access public method +// +// ******************************************** + +AddTestCase( "*** Access public method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPubBoolean(b), Obj.getPubBoolean()", true, (Obj.setPubBoolean(true), Obj.getPubBoolean()) ); + + +// ******************************************** +// access static method +// +// ******************************************** + +AddTestCase( "*** Access static method of a class ***", 1, 1 ); +AddTestCase( "Obj.setStatFunction(f), Obj.getStatFunction()", f, Obj.testGetSetStatFunction(f) ); + +// ******************************************** +// access private static method +// ******************************************** + +AddTestCase( "*** Access private static method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPrivStatString(s), Obj.getPrivStatString", str, Obj.testGetSetPrivStatString(str) ); + + +// ******************************************** +// access public static method +// ******************************************** + +AddTestCase( "*** Access public static method of a class ***", 1, 1 ); +AddTestCase( "AccPubClassMAndP.setPubStatObject(ob), AccPubClassMAndP.getPubStatObject()", ob, + (AccPubClassMAndP.setPubStatObject(ob), AccPubClassMAndP.getPubStatObject()) ); + + +// ******************************************** +// access final method +// ******************************************** + +AddTestCase( "*** Access final method of a class ***", 1, 1 ); +AddTestCase( "Obj.setFinNumber(10), Obj.getFinNumber()", 10, Obj.testGetSetFinNumber(10) ); + + +// ******************************************** +// access public final method +// ******************************************** + +AddTestCase( "*** Access public final method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPubFinArray(arr), Obj.getPubFinArray()", arr, (Obj.setPubFinArray(arr), Obj.getPubFinArray()) ); + + + +// ******************************************** +// access public property +// ******************************************** + +AddTestCase( "*** Access public property of a class ***", 1, 1 ); +AddTestCase( "Obj.pubBoolean = true, Obj.pubBoolean", true, (Obj.pubBoolean = true, Obj.pubBoolean) ); + +// ******************************************** +// access public static property +// ******************************************** + +AddTestCase( "*** Access public satic property of a class ***", 1, 1 ); +AddTestCase( "AccPubClassMAndP.pubStatObject = ob, AccPubClassMAndP.pubStatObject", ob, (AccPubClassMAndP.pubStatObject = ob, AccPubClassMAndP.pubStatObject) ); + + +// ******************************************** +// access public final property +// ******************************************** + +AddTestCase( "*** Access public final property of a class ***", 1, 1 ); +AddTestCase( "Obj.pubFinArray = arr, Obj.pubFinArray", arr, (Obj.pubFinArray = arr, Obj.pubFinArray) ); + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/PublicClassMethodAndProp/AccPubClassMAndP.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/PublicClassMethodAndProp/AccPubClassMAndP.as new file mode 100644 index 00000000000..fd87786f6ee --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/PublicClassMethodAndProp/AccPubClassMAndP.as @@ -0,0 +1,168 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + + package PublicClassMethodAndProp { + + + public class AccPubClassMAndP { + + var array:Array; + + private var privDate:Date; + + public var pubBoolean:Boolean; + + static var statFunction:Function; + + private static var privStatString:String; + + public static var pubStatObject:Object; + + var finNumber:Number; + + public var pubFinArray:Array; + + static var finStatNumber:Number; + + + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function setArray( a:Array ) { array = a; } + + // wrapper function + + public function testGetSetArray(a:Array) : Array { + setArray(a); + return getArray(); + } + + + // ******************* + // private methods + // ******************* + + private function getPrivDate() : Date { return privDate; } + private function setPrivDate( d:Date ) { privDate = d; } + + // wrapper function + + public function testGetSetPrivDate(d:Date) : Date { + setPrivDate(d); + return getPrivDate(); + } + + + + // ******************* + // public methods + // ******************* + + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function getPubBoolean() : Boolean { return pubBoolean; } + + + + // ******************* + // static methods + // ******************* + + static function setStatFunction(f:Function) { statFunction = f; } + static function getStatFunction() { return statFunction; } + + // wrapper function + + public function testGetSetStatFunction(f:Function) : Function { + setStatFunction(f); + return getStatFunction(); + } + + + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatString(s:String) { privStatString = s; } + private static function getPrivStatString() { return privStatString; } + + // wrapper function + + public function testGetSetPrivStatString(s:String) : String { + setPrivStatString(s); + return getPrivStatString(); + } + + + + // ************************** + // public static methods + // ************************** + + public static function setPubStatObject(o:Object) { pubStatObject = o; } + public static function getPubStatObject() { return pubStatObject; } + + + + // ******************* + // final methods + // ******************* + + final function setFinNumber(n:Number) { finNumber = n; } + final function getFinNumber() { return finNumber; } + + // wrapper function + + public function testGetSetFinNumber(n:Number) : Number { + setFinNumber(n); + return getFinNumber(); + } + + + + // ******************* + // public final methods + // ******************* + + public final function setPubFinArray(a:Array) { pubFinArray = a; } + public final function getPubFinArray() { return pubFinArray; } + + + + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/PublicClassPrototype.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/PublicClassPrototype.as new file mode 100644 index 00000000000..629783d2085 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/PublicClassPrototype.as @@ -0,0 +1,118 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package Prototyping { + + + +import PublicClassPrototype.*; + +var SECTION = "Class Prototype"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Testing prototype for public classes"; // Provide ECMA section title or a description +//var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var publicObj = new PublicClass(); + + +PublicClass.prototype.array = new Array('a', 'b', 'c'); +AddTestCase( "Try overriding default property through a public class' prototype object", "1,2,3", publicObj.accessDefaultProperty().toString() ); + +PublicClass.prototype.intNumber = 500; +AddTestCase( "Try overriding internal property through a public class' prototype object", "100", publicObj.intNumber.toString() ); + +PublicClass.prototype.protInt = 0; // Note: this override works because the protected property is not visible! +AddTestCase( "Try overriding protected property through a public class' prototype object", "0", publicObj.protInt.toString() ); + +PublicClass.prototype.pubUint = 0; +AddTestCase( "Try overriding public property through a public class' prototype object", "1", publicObj.pubUint.toString() ); + +PublicClass.prototype.privVar = false; +AddTestCase( "Try overriding private property through a public class' prototype object", "true", publicObj.accPrivProp().toString() ); + +PublicClass.prototype.pubStat = 200; +AddTestCase( "Try overriding public static property through a public class' prototype object", "100", PublicClass.pubStat.toString() ); + +PublicClass.prototype.nsProp = "fakeNS"; +AddTestCase( "Try overriding namespace property through a public class' prototype object", "nsProp", publicObj.accNS().toString() ); + +PublicClass.prototype.defaultMethod = false; +AddTestCase( "Try overriding default methodsthrough a public class' prototype object", true, publicObj.defaultMethod() ); + +PublicClass.prototype.internalMethod = -1; +AddTestCase( "Try overriding internal method through a public class' prototype object", 1, publicObj.internalMethod() ); + +//PublicClass.prototype.protectedMethod = -1; +//AddTestCase( "Try overriding protected method through a public class' prototype object", 1, publicObj.protectedMethod() ); + +PublicClass.prototype.publicMethod = false; +AddTestCase( "Try overriding public method through a public class' prototype object", true, publicObj.publicMethod() ); + +PublicClass.prototype.privateMethod = false; +AddTestCase( "Try overriding private method through a public class' prototype object", true, publicObj.accPrivMethod() ); + +PublicClass.prototype.nsMethod = -1; +AddTestCase( "Try overriding namespace method through a public class' prototype object", 1, publicObj.accNSMethod() ); + +PublicClass.prototype.publicFinalMethod = -1; +AddTestCase( "Try overriding public final method through a public class' prototype object", 1, publicObj.publicFinalMethod() ); + +PublicClass.prototype.publicStaticMethod = -1; +AddTestCase( "Try overriding public static method through a public class' prototype object", 42, PublicClass.publicStaticMethod() ); + + +PublicClass.prototype.newArray = new Array('a', 'b', 'c'); +AddTestCase( "Try adding new property through a public class' prototype object", "a,b,c", publicObj.newArray.toString() ); + +PublicClass.prototype.testFunction = function () {return true}; +AddTestCase("Try adding new method through a public class' prototype object", true, publicObj.testFunction()); + +var equivalent:Boolean = (PublicClass.prototype.constructor == PublicClass); +AddTestCase("Verify prototype constructor is equivalent to class object", true, equivalent); + + +var thisError10 = "no error thrown"; +var temp:Object = new Object(); +try{ + PublicClass.prototype = temp; +} catch (e:ReferenceError) { + thisError10 = e.toString(); +} finally { + AddTestCase( "Try to write to PublicClass' prototype object", "ReferenceError: Error #1074", + referenceError( thisError10 ) ); +} + +test(); // leave this alone. this executes the test cases and + // displays results. + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/PublicClassPrototype/PublicClassPrototype.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/PublicClassPrototype/PublicClassPrototype.as new file mode 100644 index 00000000000..aa020b14329 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/PublicClassPrototype/PublicClassPrototype.as @@ -0,0 +1,96 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package Prototyping { + + namespace publicNS; + + public class PublicClass { + + var array:Array = new Array(1,2,3); // Default property + internal var intNumber:Number = 100; // internal property + protected var protInt:int = -1; // protected property + + public var pubUint:uint = 1; // public property + private var privVar:Boolean = true; // private property + public static var pubStat:Number = 100; // public static property + publicNS var nsProp:String = "nsProp"; // namespace property + + // default method + function defaultMethod():Boolean{ return true; } + + // Internal method + internal function internalMethod():int { return 1; } + + // protected method + protected function protectedMethod():uint { return 1; } + + // public method + public function publicMethod():Boolean { return true; } + + // private method + private function privateMethod():Boolean { return true; } + + // namespace method + publicNS function nsMethod():Number { return 1; } + + // public final method + public final function publicFinalMethod():Number { return 1; } + + // public static method + public static function publicStaticMethod():int { return 42; } + + // access private property from same class same package + public function accPrivProp():Boolean { + return this.privVar; + } + + //accessor function for ns property + public function accNS():String { + return this.publicNS::nsProp; + } + + //accessor function for namespace method + public function accNSMethod():Number{ + return this.publicNS::nsMethod(); + } + + // access private method from same class same package + public function accPrivMethod():Boolean { + return this.privateMethod(); + } + + //accessor for default property + public function accessDefaultProperty():Array{ + return this.array; + } + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/PublicDynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/PublicDynamicClass.as new file mode 100644 index 00000000000..6b2fe43711d --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/PublicDynamicClass.as @@ -0,0 +1,191 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + +import PublicDynamicClassPackage.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Access Class Properties & Methods"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + +var arr = new Array(1,2,3); +var arr2 = new Array(3,2,1); +var Obj = new PublicDynamicClass(); +var d = new Date(0); +var d2 = new Date(1); +var f = new Function(); +var str = "Test"; +var ob = new Object(); +var foo; + +// ******************************************** +// Basic Constructor tests +// ******************************************** +AddTestCase( "*** No param constructor test ***", 1, 1 ); +AddTestCase( "var foo = new PublicDynamicClass(), PublicDynamicClass.constructorCount", 2, (foo = new PublicDynamicClass(), PublicDynamicClass.constructorCount) ); +AddTestCase( "*** No param constructor test ***", 1, 1 ); +AddTestCase( "var foo = new PublicDynamicClass, PublicDynamicClass.constructorCount", 3, (foo = new PublicDynamicClass, PublicDynamicClass.constructorCount) ); + +// ******************************************** +// Access Default method +// ******************************************** +AddTestCase( "*** Access default method of a class ***", 1, 1 ); +AddTestCase( "Obj.setArray(arr), Obj.getArray()", arr, Obj.testGetSetArray(arr) ); + +// ******************************************** +// Access Default virtual method +// ******************************************** +AddTestCase( "*** Access default virtual method of a class ***", 1, 1 ); +AddTestCase( "Obj.setVirtArray(arr), Obj.getVirtArray()", arr2, Obj.testGetSetVirtualArray(arr2) ); + +// ******************************************** +// Access Default Static method +// ******************************************** +AddTestCase( "*** Access static method of a class ***", 1, 1 ); +AddTestCase( "Obj.setStatFunction(f), Obj.getStatFunction()", f, Obj.testGetSetStatFunction(f) ); + +// ******************************************** +// Access Default Final method +// ******************************************** +AddTestCase( "*** Access final method of a class ***", 1, 1 ); +AddTestCase( "Obj.setFinNumber(10), Obj.getFinNumber()", 10, Obj.testGetSetFinNumber(10) ); + +// ******************************************** +// Access Internal method +// ******************************************** +AddTestCase( "*** Access internal method of a class ***", 1, 1 ); +AddTestCase( "Obj.setInternalArray(arr), Obj.getInternalArray()", arr, Obj.testGetSetInternalArray(arr) ); + +// ******************************************** +// Access Internal virtual method +// ******************************************** +AddTestCase( "*** Access internal virtual method of a class ***", 1, 1 ); +AddTestCase( "Obj.setInternalVirtualArray(arr), Obj.getInternalVirtualArray()", arr2, Obj.testGetSetInternalVirtualArray(arr2) ); + + +// ******************************************** +// Access Internal Static method +// ******************************************** +AddTestCase( "*** Access internal static method of a class ***", 1, 1 ); +AddTestCase( "Obj.setInternalStatFunction(f), Obj.getInternalStatFunction()", f, Obj.testGetSetInternalStatFunction(f) ); + + +// ******************************************** +// Access Internal Final method +// ******************************************** +AddTestCase( "*** Access internal final method of a class ***", 1, 1 ); +AddTestCase( "Obj.setInternalFinNumber(10), Obj.getInternalFinNumber()", 10, Obj.testGetSetInternalFinNumber(10) ); + +// ******************************************** +// Access Private method +// ******************************************** +AddTestCase( "*** Access private method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPrivDate(date), Obj.getPrivDate()", d.getFullYear(), Obj.testGetSetPrivDate(d).getFullYear() ); + +// ******************************************** +// Access Private virtual method +// ******************************************** +AddTestCase( "*** Access private virtual method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPrivVirtualDate(date), Obj.getPrivVirtualDate()", d2.getFullYear(), Obj.testGetSetPrivVirtualDate(d2).getFullYear() ); + +// ******************************************** +// Access Private Static method +// ******************************************** +AddTestCase( "*** Access private static method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPrivStatString(s), Obj.getPrivStatString", str, Obj.testGetSetPrivStatString(str) ); + +// ******************************************** +// Access Private Final method +// ******************************************** +AddTestCase( "*** Access private final method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPrivFinalString(s), Obj.getPrivFinalString", str, Obj.testGetSetPrivFinalString(str) ); + +// ******************************************** +// Access Public method +// ******************************************** +AddTestCase( "*** Access public method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPubBoolean(b), Obj.getPubBoolean()", true, (Obj.setPubBoolean(true), Obj.getPubBoolean()) ); + +// ******************************************** +// Access Public virtual method +// ******************************************** +AddTestCase( "*** Access public virtual method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPubVirtualBoolean(b), Obj.getPubVirtualBoolean()", false, (Obj.setPubBoolean(false), Obj.getPubBoolean()) ); + +// ******************************************** +// Access Public Static method +// ******************************************** +AddTestCase( "*** Access public static method of a class ***", 1, 1 ); +AddTestCase( "PublicDynamicClass.setPubStatObject(ob), PublicDynamicClass.getPubStatObject()", ob, (PublicDynamicClass.setPubStatObject(ob), PublicDynamicClass.getPubStatObject()) ); + +// ******************************************** +// Access Public Final method +// ******************************************** +AddTestCase( "*** Access public final method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPubFinArray(arr), Obj.getPubFinArray()", arr, (Obj.setPubFinArray(arr), Obj.getPubFinArray()) ); + + + + +// ******************************************** +// Access Public property +// ******************************************** +AddTestCase( "*** Access public property of a class ***", 1, 1 ); +AddTestCase( "Obj.pubBoolean = true, Obj.pubBoolean", true, (Obj.pubBoolean = true, Obj.pubBoolean) ); + +// ******************************************** +// Access Public Static property +// ******************************************** +AddTestCase( "*** Access public satic property of a class ***", 1, 1 ); +AddTestCase( "PublicDynamicClass.pubStatObject = ob, PublicDynamicClass.pubStatObject", ob, (PublicDynamicClass.pubStatObject = ob, PublicDynamicClass.pubStatObject) ); + +// ******************************************** +// Access Public Final property +// ******************************************** +AddTestCase( "*** Access public final property of a class ***", 1, 1 ); +AddTestCase( "Obj.pubFinArray = arr, Obj.pubFinArray", arr, (Obj.pubFinArray = arr, Obj.pubFinArray) ); + +// ******************************************** +// Access Public Final Static property +// ******************************************** +AddTestCase( "*** Access public final static property of a class ***", 1, 1 ); +AddTestCase( "PublicDynamicClass.pubFinalStaticNumber = 10, PublicDynamicClass.pubFinalStaticNumber", 10, (PublicDynamicClass.pubFinalStaticNumber = 10, PublicDynamicClass.pubFinalStaticNumber) ); + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/PublicDynamicClass/PublicDynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/PublicDynamicClass/PublicDynamicClass.as new file mode 100644 index 00000000000..7352352ce52 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/PublicDynamicClass/PublicDynamicClass.as @@ -0,0 +1,251 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package PublicDynamicClassPackage { + public dynamic class PublicDynamicClass { + + var array:Array; // Default property + var finNumber:Number; // Default final property + static var statFunction:Function; // Default Static property + static var finStatNumber:Number; // Default final static property + // TODO: virtual vars are not implemented yet + // virtual var virtArray:Array; + + internal var internalArray:Array; // Internal property + internal var internalFinNumber:Number; // Internal final property + internal static var internalStatFunction:Function; // Internal static property + internal static var internalFinStatNumber:Number; // Internal Final Static property + // TODO: virtual vars are not implemented yet + // internal virtual var internalVirtNumber:Number; // internal virtual property + + private var privDate:Date; // Private property + private static var privStatString:String; // Private Static property + private var privFinalString:String; // Private Final property + private static var privFinalStaticString:String // Private Final Static property + // TODO: virtual vars are not implemented yet + // private virtual privVirtDate:Date; + + public var pubBoolean:Boolean; // Public property + public static var pubStatObject:Object; // Public Static property + public var pubFinArray:Array; // Public Final property + public static var pubFinalStaticNumber:Number // Public Final Static property + // TODO: virtual vars are not implemented yet + // public virtual var pubVirtBoolean:Boolean; + + // Testing property for constructor testing + public static var constructorCount : int = 0; + + // ***************** + // Constructors + // ***************** + function PublicDynamicClass () { + PublicDynamicClass.constructorCount ++; + } + + + // ***************** + // Default methods + // ***************** + function getArray() : Array { return array; } + function setArray( a:Array ) { array = a; } + // wrapper function + public function testGetSetArray(a:Array) : Array { + setArray(a); + return getArray(); + } + + + // ************************ + // Default virtual methods + // ************************ + // TODO: virtual vars are not implemented yet so this is currently using a normal var + virtual function getVirtualArray() : Array { return array; } + virtual function setVirtualArray( a:Array ) { array = a; } + // wrapper function + public function testGetSetVirtualArray(a:Array) : Array { + setVirtualArray(a); + return getVirtualArray(); + } + + + // *********************** + // Default Static methods + // *********************** + static function setStatFunction(f:Function) { PublicDynamicClass.statFunction = f; } + static function getStatFunction() : Function { return PublicDynamicClass.statFunction; } + // wrapper function + public function testGetSetStatFunction(f:Function) : Function { + PublicDynamicClass.setStatFunction(f); + return PublicDynamicClass.getStatFunction(); + } + + + // ********************** + // Default Final methods + // ********************** + final function setFinNumber(n:Number) { finNumber = n; } + final function getFinNumber() : Number { return finNumber; } + // wrapper function + public function testGetSetFinNumber(n:Number) : Number { + setFinNumber(n); + return getFinNumber(); + } + + + // ***************** + // Internal methods + // ***************** + internal function getInternalArray() : Array { return internalArray; } + internal function setInternalArray( a:Array ) { internalArray = a; } + // wrapper function + public function testGetSetInternalArray(a:Array) : Array { + setInternalArray(a); + return getInternalArray(); + } + + + // ************************* + // Internal virtual methods + // ************************ + // TODO: virtual vars are not implemented yet so this is currently using a normal var + internal virtual function getInternalVirtualArray() : Array { return internalArray; } + internal virtual function setInternalVirtualArray( a:Array ) { internalArray = a; } + // wrapper function + public function testGetSetInternalVirtualArray(a:Array) : Array { + setInternalVirtualArray(a); + return getInternalVirtualArray(); + } + + + // *********************** + // Internal Static methods + // *********************** + internal static function setInternalStatFunction(f:Function) { internalStatFunction = f; } + internal static function getInternalStatFunction() : Function { return internalStatFunction; } + // wrapper function + public function testGetSetInternalStatFunction(f:Function) : Function { + setInternalStatFunction(f); + return getInternalStatFunction(); + } + + + + // ********************** + // Internal Final methods + // ********************** + internal final function setInternalFinNumber(n:Number) { internalFinNumber = n; } + internal final function getInternalFinNumber() : Number { return internalFinNumber; } + // wrapper function + public function testGetSetInternalFinNumber(n:Number) : Number { + setInternalFinNumber(n); + return getInternalFinNumber(); + } + + + // ******************* + // Private methods + // ******************* + private function getPrivDate() : Date { return privDate; } + private function setPrivDate( d:Date ) { privDate = d; } + // wrapper function + public function testGetSetPrivDate(d:Date) : Date { + setPrivDate(d); + return getPrivDate(); + } + + + // ************************ + // Private virtual methods + // *********************** + // TODO: virtual vars are not implemented yet so this is currently using a normal var + private virtual function getPrivVirtualDate() : Date { return privDate; } + private virtual function setPrivVirtualDate( d:Date ) { privDate = d; } + // wrapper function + public function testGetSetPrivVirtualDate(d:Date) : Date { + setPrivVirtualDate(d); + return getPrivVirtualDate(); + } + + + // ************************** + // Private Static methods + // ************************** + private static function setPrivStatString(s:String) { PublicDynamicClass.privStatString = s; } + private static function getPrivStatString() : String { return PublicDynamicClass.privStatString; } + // wrapper function + public function testGetSetPrivStatString(s:String) : String { + PublicDynamicClass.setPrivStatString(s); + return PublicDynamicClass.getPrivStatString(); + } + + + // ************************** + // Private Final methods + // ************************** + private final function setPrivFinalString(s:String) { privFinalString = s; } + private final function getPrivFinalString() : String { return privFinalString; } + // wrapper function + public function testGetSetPrivFinalString(s:String) : String { + setPrivFinalString(s); + return getPrivFinalString(); + } + + + + // ******************* + // Public methods + // ******************* + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function getPubBoolean() : Boolean { return pubBoolean; } + + + // ************************ + // Public virutal methods + // *********************** + // TODO: virtual vars are not implemented yet so this is currently using a normal var + public virtual function setPubVirtualBoolean( b:Boolean ) { pubBoolean = b; } + public virtual function getPubVirtualBoolean() : Boolean { return pubBoolean; } + + + // ************************** + // Public Static methods + // ************************** + public static function setPubStatObject(o:Object) { PublicDynamicClass.pubStatObject = o; } + public static function getPubStatObject() : Object { return PublicDynamicClass.pubStatObject; } + + + // ******************* + // Public Final methods + // ******************* + public final function setPubFinArray(a:Array) { pubFinArray = a; } + public final function getPubFinArray() : Array { return pubFinArray; } + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/PublicStaticFinalDynamicClassMethodAndProp.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/PublicStaticFinalDynamicClassMethodAndProp.as new file mode 100644 index 00000000000..2a7c78e35f0 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/PublicStaticFinalDynamicClassMethodAndProp.as @@ -0,0 +1,151 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + +import PublicStaticFinalDynamicClassMethodAndProp.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Access Class Properties & Methods"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + +var arr = new Array(1,2,3); + +var Obj = new AccPubStatFinDynClassMAndP(); + +var d = new Date(0); + +var f = new Function(); + +var str = "Test"; + +var ob = new Object(); + + +// ******************************************** +// access default method +// +// ******************************************** + +AddTestCase( "*** Access default method of a class ***", 1, 1 ); +AddTestCase( "Obj.setArray(arr), Obj.getArray()", arr, Obj.testGetSetArray(arr) ); + + +// ******************************************** +// access private method +// +// ******************************************** + +AddTestCase( "*** Access private method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPrivDate(date), Obj.getPrivDate()", d.getFullYear(), Obj.testGetSetPrivDate(d).getFullYear() ); + + +// ******************************************** +// access public method +// +// ******************************************** + +AddTestCase( "*** Access public method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPubBoolean(b), Obj.getPubBoolean()", true, (Obj.setPubBoolean(true), Obj.getPubBoolean()) ); + + +// ******************************************** +// access static method +// +// ******************************************** + +AddTestCase( "*** Access static method of a class ***", 1, 1 ); +AddTestCase( "Obj.setStatFunction(f), Obj.getStatFunction()", f, Obj.testGetSetStatFunction(f) ); + +// ******************************************** +// access private static method +// ******************************************** + +AddTestCase( "*** Access private static method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPrivStatString(s), Obj.getPrivStatString", str, Obj.testGetSetPrivStatString(str) ); + + +// ******************************************** +// access public static method +// ******************************************** + +AddTestCase( "*** Access public static method of a class ***", 1, 1 ); +AddTestCase( "AccPubStatFinDynClassMAndP.setPubStatObject(ob), AccPubStatFinDynClassMAndP.getPubStatObject()", ob, + (AccPubStatFinDynClassMAndP.setPubStatObject(ob), AccPubStatFinDynClassMAndP.getPubStatObject()) ); + + +// ******************************************** +// access final method +// ******************************************** + +AddTestCase( "*** Access final method of a class ***", 1, 1 ); +AddTestCase( "Obj.setFinNumber(10), Obj.getFinNumber()", 10, Obj.testGetSetFinNumber(10) ); + + +// ******************************************** +// access public final method +// ******************************************** + +AddTestCase( "*** Access public final method of a class ***", 1, 1 ); +AddTestCase( "Obj.setPubFinArray(arr), Obj.getPubFinArray()", arr, (Obj.setPubFinArray(arr), Obj.getPubFinArray()) ); + + +// ******************************************** +// access public property +// ******************************************** + +AddTestCase( "*** Access public property of a class ***", 1, 1 ); +AddTestCase( "Obj.pubBoolean = true, Obj.pubBoolean", true, (Obj.pubBoolean = true, Obj.pubBoolean) ); + +// ******************************************** +// access public static property +// ******************************************** + +AddTestCase( "*** Access public satic property of a class ***", 1, 1 ); +AddTestCase( "AccPubStatFinDynClassMAndP.pubStatObject = ob, AccPubStatFinDynClassMAndP.pubStatObject", ob, (AccPubStatFinDynClassMAndP.pubStatObject = ob, AccPubStatFinDynClassMAndP.pubStatObject) ); + + +// ******************************************** +// access public final property +// ******************************************** + +AddTestCase( "*** Access public final property of a class ***", 1, 1 ); +AddTestCase( "Obj.pubFinArray = arr, Obj.pubFinArray", arr, (Obj.pubFinArray = arr, Obj.pubFinArray) ); + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/PublicStaticFinalDynamicClassMethodAndProp/AccPubStatFinDynClassMAndP.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/PublicStaticFinalDynamicClassMethodAndProp/AccPubStatFinDynClassMAndP.as new file mode 100644 index 00000000000..7db344c9eef --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/PublicStaticFinalDynamicClassMethodAndProp/AccPubStatFinDynClassMAndP.as @@ -0,0 +1,173 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + + package PublicStaticFinalDynamicClassMethodAndProp { + + + public class AccPubStatFinDynClassMAndP { + + + + var array:Array; + + private var privDate:Date; + + public var pubBoolean:Boolean; + + static var statFunction:Function; + + private static var privStatString:String; + + public static var pubStatObject:Object; + + var finNumber:Number; + + public var pubFinArray:Array; + + static var finStatNumber:Number; + + + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function setArray( a:Array ) { array = a; } + + // wrapper function + + public function testGetSetArray(a:Array) : Array { + setArray(a); + return getArray(); + } + + + // ******************* + // private methods + // ******************* + + private function getPrivDate() : Date { return privDate; } + private function setPrivDate( d:Date ) { privDate = d; } + + // wrapper function + + public function testGetSetPrivDate(d:Date) : Date { + setPrivDate(d); + return getPrivDate(); + } + + + + // ******************* + // public methods + // ******************* + + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function getPubBoolean() : Boolean { return pubBoolean; } + + + + // ******************* + // static methods + // ******************* + + static function setStatFunction(f:Function) { statFunction = f; } + static function getStatFunction() { return statFunction; } + + // wrapper function + + public function testGetSetStatFunction(f:Function) : Function { + setStatFunction(f); + return getStatFunction(); + } + + + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatString(s:String) { privStatString = s; } + private static function getPrivStatString() { return privStatString; } + + // wrapper function + + public function testGetSetPrivStatString(s:String) : String { + setPrivStatString(s); + return getPrivStatString(); + } + + + + // ************************** + // public static methods + // ************************** + + public static function setPubStatObject(o:Object) { pubStatObject = o; } + public static function getPubStatObject() { return pubStatObject; } + + + + // ******************* + // final methods + // ******************* + + final function setFinNumber(n:Number) { finNumber = n; } + final function getFinNumber() { return finNumber; } + + // wrapper function + + public function testGetSetFinNumber(n:Number) : Number { + setFinNumber(n); + return getFinNumber(); + } + + + + // ******************* + // public final methods + // ******************* + + public final function setPubFinArray(a:Array) { pubFinArray = a; } + public final function getPubFinArray() { return pubFinArray; } + + + + + + + + } // AccPubStatFinDynClassMAndP + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/StatClassSameNamePackage.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/StatClassSameNamePackage.as new file mode 100644 index 00000000000..9f3b29a4d82 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/StatClassSameNamePackage.as @@ -0,0 +1,50 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + +import StatClassSameNamePackage.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Access Static Properties & Methods"; // Provide ECMA section title or a description +var BUGNUMBER = "134955"; + +startTest(); // leave this alone + + + +AddTestCase( "Access static property via package/class with same name", "x.x.a", StatClassSameNamePackage.StatClassSameNamePackage.aStatic ); +AddTestCase( "Call static method via package/class with same name", "x.x.f()", StatClassSameNamePackage.StatClassSameNamePackage.fStatic() ); + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/StatClassSameNamePackage/StatClassSameNamePackage.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/StatClassSameNamePackage/StatClassSameNamePackage.as new file mode 100644 index 00000000000..051fdd3a52b --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/StatClassSameNamePackage/StatClassSameNamePackage.as @@ -0,0 +1,39 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +// bug 134955: test access of statics from a class in a package with the same name +package StatClassSameNamePackage { + public class StatClassSameNamePackage { + public static var aStatic : String = "x.x.a"; + public static function fStatic() : String { + return "x.x.f()"; + } + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/StaticClassMethodAndProp.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/StaticClassMethodAndProp.as new file mode 100644 index 00000000000..67d731b8b35 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/StaticClassMethodAndProp.as @@ -0,0 +1,127 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + +import StaticClassMethodAndProp.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Access Class Properties & Methods"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + +var arr = new Array(1,2,3); + +var Obj = new AccStatClassMAndP(); + +var d = new Date(0); + +var f = new Function(); + +var str = "Test"; + +var ob = new Object(); + + +// ******************************************** +// access default method +// +// ******************************************** + +AddTestCase( "*** Access default method of a static class ***", 1, 1 ); +AddTestCase( "Obj.setArray(arr), Obj.getArray()", arr, Obj.testGetSetArray(arr) ); + + +// ******************************************** +// access private method +// +// ******************************************** + +AddTestCase( "*** Access private method of a static class ***", 1, 1 ); +AddTestCase( "Obj.setPrivDate(date), Obj.getPrivDate()", d.getFullYear(), Obj.testGetSetPrivDate(d).getFullYear() ); + + +// ******************************************** +// access public method +// +// ******************************************** + +AddTestCase( "*** Access public method of a static class ***", 1, 1 ); +AddTestCase( "Obj.setPubBoolean(b), Obj.getPubBoolean()", true, Obj.testGetSetPubBoolean(true) ); + + +// ******************************************** +// access static method +// +// ******************************************** + +AddTestCase( "*** Access static method of a static class ***", 1, 1 ); +AddTestCase( "Obj.setStatFunction(f), Obj.getStatFunction()", f, Obj.testGetSetStatFunction(f) ); + +// ******************************************** +// access private static method +// ******************************************** + +AddTestCase( "*** Access private static method of a static class ***", 1, 1 ); +AddTestCase( "Obj.setPrivStatString(s), Obj.getPrivStatString", str, Obj.testGetSetPrivStatString(str) ); + + +// ******************************************** +// access public static method +// ******************************************** + +AddTestCase( "*** Access public static method of a static class ***", 1, 1 ); +AddTestCase( "Obj.setPubStatObject(ob), Obj.getPubStatObject()", ob, Obj.testGetSetPubStatObject(ob) ); + + +// ******************************************** +// access final method +// ******************************************** + +AddTestCase( "*** Access final method of a static class ***", 1, 1 ); +AddTestCase( "Obj.setFinNumber(10), Obj.getFinNumber()", 10, Obj.testGetSetFinNumber(10) ); + + +// ******************************************** +// access public final method +// ******************************************** + +AddTestCase( "*** Access public final method of a static class ***", 1, 1 ); +AddTestCase( "Obj.setPubFinArray(arr), Obj.getPubFinArray()", arr, Obj.testGetSetPubArray(arr) ); + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/StaticClassMethodAndProp/AccStatClassMAndP.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/StaticClassMethodAndProp/AccStatClassMAndP.as new file mode 100644 index 00000000000..76daab33907 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/StaticClassMethodAndProp/AccStatClassMAndP.as @@ -0,0 +1,200 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + + package StaticClassMethodAndProp { + + + public class AccStatClassMAndP { + + + + var array:Array; + + private var privDate:Date; + + public var pubBoolean:Boolean; + + static var statFunction:Function; + + private static var privStatString:String; + + public static var pubStatObject:Object; + + var finNumber:Number; + + public var pubFinArray:Array; + + static var finStatNumber:Number; + + + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function setArray( a:Array ) { array = a; } + + + + // ******************* + // private methods + // ******************* + + private function getPrivDate() : Date { return privDate; } + private function setPrivDate( d:Date ) { privDate = d; } + + // wrapper function + + public function testGetSetPrivDate(d:Date) : Date { + setPrivDate(d); + return getPrivDate(); + } + + + + // ******************* + // public methods + // ******************* + + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function getPubBoolean() : Boolean { return pubBoolean; } + + + + // ******************* + // static methods + // ******************* + + static function setStatFunction(f:Function) { statFunction = f; } + static function getStatFunction() { return statFunction; } + + + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatString(s:String) { privStatString = s; } + private static function getPrivStatString() { return privStatString; } + + // wrapper function + + public function testGetSetPrivStatString(s:String) : String { + setPrivStatString(s); + return getPrivStatString(); + } + + + + // ************************** + // public static methods + // ************************** + + public static function setPubStatObject(o:Object) { pubStatObject = o; } + public static function getPubStatObject() { return pubStatObject; } + + + + // ******************* + // final methods + // ******************* + + final function setFinNumber(n:Number) { finNumber = n; } + final function getFinNumber() { return finNumber; } + + + + // ******************* + // public final methods + // ******************* + + public final function setPubFinArray(a:Array) { pubFinArray = a; } + public final function getPubFinArray() { return pubFinArray; } + + + + + + + // wrapper function + + public function testGetSetArray(a:Array) : Array { + setArray(a); + return getArray(); + } + + + + // wrapper function + + public function testGetSetPubBoolean(b:Boolean) : Boolean { + setPubBoolean(b); + return getPubBoolean(); + } + + // wrapper function + + public function testGetSetStatFunction(f:Function) : Function { + setStatFunction(f); + return getStatFunction(); + } + + + + // wrapper function + + public function testGetSetPubStatObject(o:Object) : Object { + setPubStatObject(o); + return getPubStatObject(); + } + + // wrapper function + + public function testGetSetFinNumber(n:Number) : Number { + setFinNumber(n); + return getFinNumber(); + } + + // wrapper function + + public function testGetSetPubArray(a:Array) : Array { + setPubFinArray(a); + return getPubFinArray(); + } + + + + } // AccStatClassMAndP + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/bug113887.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/bug113887.as new file mode 100644 index 00000000000..4d70c3b1c17 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/bug113887.as @@ -0,0 +1,48 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Class Definition"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + +//----------------------------------------------------------------------------- + +import bug113887.*; + +var eg = new BugTest(); +AddTestCase("static initialization of class directly", "yes", eg.doBasicTest()); +AddTestCase("static initialization of class via method", "yes", eg.doFunctionTest()); + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/bug113887/bug113887.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/bug113887/bug113887.as new file mode 100644 index 00000000000..9860be4e5e4 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/bug113887/bug113887.as @@ -0,0 +1,69 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +// bug 113887: static initialization using the class itself +package bug113887 { + + class A { + static var obj : A = new A(); + var init : String = "no"; + function A() { + init = "yes"; + } + function wasInitialized() : String { + return init; + } + } + + class B { + static function createFoo() : B { + return new B(); + } + static var foo : B = B.createFoo(); + var init : String = "no"; + function B() { + init = "yes"; + } + function wasInitialized() : String { + return init; + } + } + + public class BugTest { + public function doBasicTest() : String { + return A.obj.wasInitialized(); + } + public function doFunctionTest() : String { + return B.foo.wasInitialized(); + } + } + +} + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/dynfinClassCons.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/dynfinClassCons.as new file mode 100644 index 00000000000..bece237965c --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/dynfinClassCons.as @@ -0,0 +1,60 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + +import testdynfinalClassCons.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Constructors of a dynamic class without parameters"; // Provide ECMA section //title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +//var currentDate = new Date(); +var deffinCons:dynfinClassCons = new dynfinClassCons(); +//print (deffinCons.Add()); +//print (DefCons.wrapprivchangeval()); +//print (DefCons.wrapprotmystring()); +//print (DefCons.currentdate()); +//print (DefCons.wrapintmyobject()); +//print (DefCons.mydatatype); + +AddTestCase("calling public Instance method",60,deffinCons.Add()); + + + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/dynfinClassCons/dynfinClassCons.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/dynfinClassCons/dynfinClassCons.as new file mode 100644 index 00000000000..1e1abf73a07 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/dynfinClassCons/dynfinClassCons.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package testdynfinalClassCons{ +/*Test case to test constructor without parameter in a dynamic public class*/ + dynamic public final class dynfinClassCons{ + private var x:Number = 20; + private var y:Number = 40; + public function dynfinClassCons(){ + } + + + public function Add(){ + var z = x+y; + return z; + } + } + } diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/dynfinClassDefCons.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/dynfinClassDefCons.as new file mode 100644 index 00000000000..cc49c349214 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/dynfinClassDefCons.as @@ -0,0 +1,60 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + +import testdynfinalClassDefCons.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Default Constructors of a dynamic class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +//var currentDate = new Date(); +var deffinDefCons = new dynfinClassDefCons(); +//print (deffinDefCons.Add()); +//print (DefCons.wrapprivchangeval()); +//print (DefCons.wrapprotmystring()); +//print (DefCons.currentdate()); +//print (DefCons.wrapintmyobject()); +//print (DefCons.mydatatype); + +AddTestCase("calling public Instance method",60,deffinDefCons.Add()); + + + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/dynfinClassDefCons/dynfinClassDefCons.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/dynfinClassDefCons/dynfinClassDefCons.as new file mode 100644 index 00000000000..bd448787f19 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/dynfinClassDefCons/dynfinClassDefCons.as @@ -0,0 +1,44 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package testdynfinalClassDefCons{ + + dynamic public final class dynfinClassDefCons{ + private var x:Number = 20; + private var y:Number = 40; + + + + public function Add(){ + var z = x+y; + return z; + } + } + } diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/dynfinClassWithMultiStrParamCons.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/dynfinClassWithMultiStrParamCons.as new file mode 100644 index 00000000000..93934c7fefb --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/dynfinClassWithMultiStrParamCons.as @@ -0,0 +1,57 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + +import testdynfinalClassWithMultiStringParamCons.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Constructors with parameters of a Dynamic class"; // Provide ECMA section //title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var x = "test"; +var y = "hello"+"world"; +var dynWithStrParamCons= new dynfinClassWithMultiStrParamCons(x); +var g2=new dynfinClassWithMultiStrParamCons(x+y); +//print(dynWithStrParamCons.myString()); +//print(dynWithStrParamCons.myString2()); +//print(g2.myString()); +AddTestCase("calling public Instance method for testing constructor with single string parameter","test",dynWithStrParamCons.myString()); +AddTestCase("calling public Instance method for testing constructor with concatenated string","helloworld",dynWithStrParamCons.myString2()); +AddTestCase("calling public Instance method for testing constructor with concatenated string","testhelloworld",g2.myString()); + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/dynfinClassWithMultiStrParamCons/dynfinClassWithMultiStrParamCons.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/dynfinClassWithMultiStrParamCons/dynfinClassWithMultiStrParamCons.as new file mode 100644 index 00000000000..edde7144236 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/dynfinClassWithMultiStrParamCons/dynfinClassWithMultiStrParamCons.as @@ -0,0 +1,66 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package testdynfinalClassWithMultiStringParamCons{ + + dynamic final public class dynfinClassWithMultiStrParamCons{ + public var x:String; + + + public function dynfinClassWithMultiStrParamCons(z:String){ + x=z; + } + + + public function myString():String{ + + return x; + } + public function myString2():String{ + var x:String="test2"; + var y:String="test3"; + var g1= new dynfinClassWithMultiStrParamCons("test2"); + var g3=new dynfinClassWithMultiStrParamCons("hello"+ +"world"); + + return g3.myString(); + + + } + + +} + + +} + + + + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/dynfinClassWithParamCons.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/dynfinClassWithParamCons.as new file mode 100644 index 00000000000..d49540977f4 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/dynfinClassWithParamCons.as @@ -0,0 +1,56 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + +import testdynfinalClassWithParamCons.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Constructors with parameters of a dynamic class"; // Provide ECMA section //title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +//var currentDate = new Date(); +var deffinWithParamCons:dynfinClassWithParamCons = new dynfinClassWithParamCons(20,40); +//print (deffinWithParamCons.Add()); + + +AddTestCase("calling public Instance method",60,deffinWithParamCons.Add()); + + + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/dynfinClassWithParamCons/dynfinClassWithParamCons.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/dynfinClassWithParamCons/dynfinClassWithParamCons.as new file mode 100644 index 00000000000..04a4813ee6a --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/dynfinClassWithParamCons/dynfinClassWithParamCons.as @@ -0,0 +1,47 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package testdynfinalClassWithParamCons{ + + dynamic public final class dynfinClassWithParamCons{ + private var x:Number = 0; + private var y:Number = 0; + public function dynfinClassWithParamCons(a:Number,b:Number){ + x=a; + y=b; + } + + + public function Add():Number{ + var z = x+y; + return z; + } + } + } diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/dynfinClassWithStrParamCons.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/dynfinClassWithStrParamCons.as new file mode 100644 index 00000000000..08a1f2690ef --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/dynfinClassWithStrParamCons.as @@ -0,0 +1,87 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + +import testdynfinalClassWithStringParamCons.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Constructors with parameters of a Dynamic class"; // Provide ECMA section //title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var x = "test"; +var y:Boolean = true; +var myArray:Array = new Array(4,6,5); + +/*public class publicClassCons{ + + private var x:Number=4; + private var y:Number=5; + + + public function publicClassCons(){ + } + + public function Add(){ + private var z = x+y; + return z; + + + } +}*/ +import testdynfinalClassWithStringParamCons.publicClassCons; +var pbClCons:publicClassCons = new publicClassCons(); + +var MyDefaultClass:DefaultClass; +var dynWithStrParamCons=new dynfinClassWithStrParamCons(x,y,myArray,pbClCons,MyDefaultClass); +//print (dynWithStrParamCons.myString()); +//print(x); +//print (dynWithStrParamCons.myBoolean()); +//print(y); +//print (dynWithStrParamCons.myarray()); +//print (myArray); +//print(dynWithStrParamCons.myAdd()); + +AddTestCase("calling public Instance method","test",dynWithStrParamCons.myString()); +AddTestCase("calling public Instance method", true,dynWithStrParamCons.myBoolean()); + +AddTestCase("Array", myArray,dynWithStrParamCons.myarray()); +AddTestCase("Calling public Instance method Add",9,dynWithStrParamCons.myAdd()); + + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/dynfinClassWithStrParamCons/dynfinClassWithStrParamCons.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/dynfinClassWithStrParamCons/dynfinClassWithStrParamCons.as new file mode 100644 index 00000000000..40ce8f001bb --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/dynfinClassWithStrParamCons/dynfinClassWithStrParamCons.as @@ -0,0 +1,95 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package testdynfinalClassWithStringParamCons{ + + dynamic public final class dynfinClassWithStrParamCons{ + public var x:String; + public var mybool:Boolean; + public var myarr:Array; + public var myObj:publicClassCons; + var myobj2:DefaultClass; + public function dynfinClassWithStrParamCons(a:String,b:Boolean,c:Array,d:publicClassCons,e:DefaultClass) + + { + x=a; + mybool=b; + myarr=c; + myObj=d; + + } + + + public function myString():String{ + + return x; + } + public function myBoolean():Boolean{ + + return mybool; + } + public function myarray():Array{ + + return myarr; + } + + public function myAdd():Number{ + return myObj.Add(); + } + + + } + + + + +var x = "test"; +var y:Boolean = true; +var myArray:Array = new Array(4,6,5); + +public class publicClassCons{ + + private var M:Number=4; + private var N:Number=5; + + + public function publicClassCons(){ + } + + public function Add(){ + var z = M+N; + return z; + + + } +} + +public class DefaultClass{} + } diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/finClassNoParamCons.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/finClassNoParamCons.as new file mode 100644 index 00000000000..3622ffb9ab4 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/finClassNoParamCons.as @@ -0,0 +1,55 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + +import testfinalClassNoParamCons.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Constructors with no parameters of a final class"; // Provide ECMA section // title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + +var finNoParamCons:finClassNoParamCons = new finClassNoParamCons(); +//print (finNoParamCons.Add()); + +AddTestCase("calling public Instance method",60,finNoParamCons.Add()); + + + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/finClassNoParamCons/finClassNoParamCons.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/finClassNoParamCons/finClassNoParamCons.as new file mode 100644 index 00000000000..d95ff37eee8 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/finClassNoParamCons/finClassNoParamCons.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package testfinalClassNoParamCons{ + + public final class finClassNoParamCons{ + private var x:Number = 20; + private var y:Number = 40; + + public function finClassNoParamCons(){ + } + + public function Add(){ + var z = x+y; + return z; + } + } + } diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/finalClassDefCons.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/finalClassDefCons.as new file mode 100644 index 00000000000..d829f661554 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/finalClassDefCons.as @@ -0,0 +1,55 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + +import testfinalClassDefCons.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Default Constructors of a final class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + +var finDefCons:finalClassDefCons = new finalClassDefCons(); +//print (finDefCons.Add()); + +AddTestCase("calling public Instance method",60,finDefCons.Add()); + + + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/finalClassDefCons/finalClassDefCons.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/finalClassDefCons/finalClassDefCons.as new file mode 100644 index 00000000000..5df710f5d19 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/finalClassDefCons/finalClassDefCons.as @@ -0,0 +1,44 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package testfinalClassDefCons{ + + public final class finalClassDefCons{ + private var x:Number = 20; + private var y:Number = 40; + + + + public function Add(){ + var z = x+y; + return z; + } + } + } diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/finalClassWithParamCons.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/finalClassWithParamCons.as new file mode 100644 index 00000000000..5668a187954 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/finalClassWithParamCons.as @@ -0,0 +1,56 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + +import testfinalClassWithParamCons.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Constructors with parameters of a final class"; // Provide ECMA section // title or a // description +var BUGNUMBER = ""; + +startTest(); // leave this alone + +//print("test"); + +var finalWithParamCons = new finalClassWithParamCons(20,40); +//print (finalWithParamCons.Add()); + + +AddTestCase("calling public Instance method",60,finalWithParamCons.Add()); + + + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/finalClassWithParamCons/finalClassWithParamCons.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/finalClassWithParamCons/finalClassWithParamCons.as new file mode 100644 index 00000000000..cd5899eaeaf --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/finalClassWithParamCons/finalClassWithParamCons.as @@ -0,0 +1,49 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package testfinalClassWithParamCons{ + + public final class finalClassWithParamCons{ + private var x:Number = 0; + private var y:Number = 0; + + public function finalClassWithParamCons(a:Number,b:Number){ + x=a; + y=b; + + } + + + public function Add():Number{ + var z = x+y; + return z; + } + } + } diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/intClassDefCons.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/intClassDefCons.as new file mode 100644 index 00000000000..2bf7a1f0949 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/intClassDefCons.as @@ -0,0 +1,60 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + +import testInternalClassDefCons.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Default Constructors of a Internal class"; // Provide ECMA section title or //a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +//var currentDate = new Date(); +var wrapintDefCons:wrapintClassDefCons = new wrapintClassDefCons(); +//print (wrapintDefCons.getAdd()); +//print (DefCons.wrapprivchangeval()); +//print (DefCons.wrapprotmystring()); +//print (DefCons.currentdate()); +//print (DefCons.wrapintmyobject()); +//print (DefCons.mydatatype); + +AddTestCase("calling public Instance method",60,wrapintDefCons.getAdd()); + + + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/intClassDefCons/intClassDefCons.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/intClassDefCons/intClassDefCons.as new file mode 100644 index 00000000000..8dffc169d1b --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/intClassDefCons/intClassDefCons.as @@ -0,0 +1,55 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package testInternalClassDefCons{ + + internal class intClassDefCons{ + private var x:Number = 20; + private var y:Number = 40; + + + + public function Add(){ + var z = x+y; + return z; + } + } + + + public class wrapintClassDefCons{ + var intDefCons:intClassDefCons=new intClassDefCons(); + + + public function getAdd(){ + var R = intDefCons.Add(); + return R; + } + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/intClassNoParamCons.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/intClassNoParamCons.as new file mode 100644 index 00000000000..783c3ac3eba --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/intClassNoParamCons.as @@ -0,0 +1,55 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + +import testInternalClassNoParamCons.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "No Parameter Constructors of a Internal class"; // Provide ECMA section // title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + +var wrapintNoParamCons:wrapintClassNoParamCons = new wrapintClassNoParamCons(); +//print (wrapintNoParamCons.getAdd()); + +AddTestCase("calling public Instance method",60,wrapintNoParamCons.getAdd()); + + + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/intClassNoParamCons/intClassNoParamCons.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/intClassNoParamCons/intClassNoParamCons.as new file mode 100644 index 00000000000..fb98337b595 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/intClassNoParamCons/intClassNoParamCons.as @@ -0,0 +1,58 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package testInternalClassNoParamCons{ + + internal class intClassNoParamCons{ + private var x:Number = 20; + private var y:Number = 40; + + public function intClassNoParamCons(){ + } + + + + public function Add(){ + var z = x+y; + return z; + } + } + + + public class wrapintClassNoParamCons{ + var intNoParamCons:intClassNoParamCons=new intClassNoParamCons(); + + + public function getAdd(){ + var R = intNoParamCons.Add(); + return R; + } + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/intClassWithParamCons.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/intClassWithParamCons.as new file mode 100644 index 00000000000..42d0b6e4f6e --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/intClassWithParamCons.as @@ -0,0 +1,55 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + +import testInternalClassWithParamCons.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Constructors with parameters of a Internal class"; // Provide ECMA section // title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + +var wrapintWithParamCons:wrapintClassWithParamCons = new wrapintClassWithParamCons(); +//print (wrapintWithParamCons.getAdd()); + +AddTestCase("calling public Instance method",60,wrapintWithParamCons.getAdd()); + + + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/intClassWithParamCons/intClassWithParamCons.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/intClassWithParamCons/intClassWithParamCons.as new file mode 100644 index 00000000000..9b7168488f1 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/intClassWithParamCons/intClassWithParamCons.as @@ -0,0 +1,62 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package testInternalClassWithParamCons{ + + internal class intClassWithParamCons{ + private var x:Number; + private var y:Number; + + public function intClassWithParamCons(a:Number,b:Number){ + x = a; + y = b; + } + + + + public function Add():Number{ + var z = x+y; + return z; + } + } + + + public class wrapintClassWithParamCons{ + + + var intWithParamCons:intClassWithParamCons=new intClassWithParamCons(20,40); + + + public function getAdd(){ + var R = intWithParamCons.Add(); + return R; + } + } + } diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/publicClassConsNoParam.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/publicClassConsNoParam.as new file mode 100644 index 00000000000..e972082eb5f --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/publicClassConsNoParam.as @@ -0,0 +1,56 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + +import publicClassConsNoParamPackage.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Constructors with no parameters of a public class"; // Provide ECMA section //title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + +var NoParamCons:publicClassConsNoParam = new publicClassConsNoParam(); +//print (NoParamCons.Add()); + + +AddTestCase("calling public Instance method",30,NoParamCons.Add()); + + + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/publicClassConsNoParam/publicClassConsNoParam.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/publicClassConsNoParam/publicClassConsNoParam.as new file mode 100644 index 00000000000..2b877b7f8f1 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/publicClassConsNoParam/publicClassConsNoParam.as @@ -0,0 +1,43 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package publicClassConsNoParamPackage{ + public class publicClassConsNoParam{ + private var x:Number=10; + private var y:Number=20; + public function publicClassConsNoParam(){ + } + + public function Add():Number{ + var z:Number=x+y; + return z; + } + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/publicClassDefCons.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/publicClassDefCons.as new file mode 100644 index 00000000000..162652b30ae --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/publicClassDefCons.as @@ -0,0 +1,63 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + +import publicClassConstructors.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Default Constructors of a public class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var currentDate = new Date(0); +var DefCons:publicClassDefCons = new publicClassDefCons(); +//print (DefCons.Add()); +//print (DefCons.wrapprivchangeval()); +//print (DefCons.wrapprotmystring()); +//print (DefCons.currentdate()); +//print (DefCons.wrapintmyobject()); +//print (DefCons.mydatatype); + +AddTestCase("calling public final Instance method",30,DefCons.Add()); +AddTestCase("Calling private Instance method",false,DefCons.wrapprivchangeval()); +AddTestCase("Calling public Instance method",currentDate.toString(),(DefCons.currentdate()).toString()); +AddTestCase("Calling internal Instance method","I am a string",DefCons.wrapintmyobject()); + + + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/publicClassDefCons/publicClassDefCons.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/publicClassDefCons/publicClassDefCons.as new file mode 100644 index 00000000000..4b096c2600d --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/publicClassDefCons/publicClassDefCons.as @@ -0,0 +1,67 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package publicClassConstructors{ +public class publicClassDefCons{ +private var x:Number=10; +private var y:Number=20; +private var s:Boolean=true; +private var mydatatype:String="I am a string"; + +final public function Add():Number{ + var z:Number=x+y; + return z; + } +private function changeval():Boolean{ + return (!s); + } +public function currentdate():Date{ + var today = new Date(0); + return today; + } + +internal function myobject():Object{ + return mydatatype; + } +//wrapper function for internal myobject function +public function wrapintmyobject():Object{ + return myobject(); + } +//wrapper function for private function changeval +public function wrapprivchangeval():Boolean{ +return changeval(); +} + +public static function main():void{ +var DefCons:publicClassDefCons = new publicClassDefCons(); +//print("I am from the main method"+ DefCons.Add()); +} +} +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/publicClassWithParamCons.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/publicClassWithParamCons.as new file mode 100644 index 00000000000..2c1c39cb1b1 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/publicClassWithParamCons.as @@ -0,0 +1,58 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + +import testpublicClassWithParamCons.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "No Parameter Constructors of a Internal class"; // Provide ECMA section // title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var a:Number=20; +var b:Number=0.5; + + +var publicWithParamCons:publicClassWithParamCons = new publicClassWithParamCons(a,b); +//print (publicWithParamCons.Add()); + +AddTestCase("calling public Instance method",20.5,publicWithParamCons.Add()); + + + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/publicClassWithParamCons/publicClassWithParamCons.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/publicClassWithParamCons/publicClassWithParamCons.as new file mode 100644 index 00000000000..4373c6db2cf --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/publicClassWithParamCons/publicClassWithParamCons.as @@ -0,0 +1,55 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package testpublicClassWithParamCons{ + + public class publicClassWithParamCons{ + private var x:Number=0; + private const y:Number; + public function publicClassWithParamCons(a:Number,b:Number){ + x = a; + this.y=b; + } + + + + + public function Add():Number{ + var z:Number = x+y; + return z; + + } + + + } + + + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/testClassInitializers.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/testClassInitializers.as new file mode 100644 index 00000000000..b7226ffbc61 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/testClassInitializers.as @@ -0,0 +1,51 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + +import testpublicClassInitializer.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Class Initializers"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + +var testInit= new testClassInitializersWrap(); +//print(testInit.MyNumber1()); +//print(testInit.MyNumber2()); +//print(); +AddTestCase("Result from for loop",1,testInit.MyNumber1()); +AddTestCase("Result from if else stt",2,testInit.MyNumber2()); +AddTestCase("Result from do loop",2,testInit.MyNumber3()); +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/testClassInitializers/testClassInitializers.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/testClassInitializers/testClassInitializers.as new file mode 100644 index 00000000000..3954cf4ba55 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/testClassInitializers/testClassInitializers.as @@ -0,0 +1,72 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package testpublicClassInitializer{ + +public class testClassInitializers{ + + public static var j:Number=1; + public static var k:Number=0; + public static var l:Number=0; + public static var m:Number=0; + for (j=1;j<2;j++) + { + k=j; + } + if(j>10){ + l=11; + } + else + { + l=j; + } + + +public static var p:Number=10; +public static var q:Number=5; +public static var r:Number=p/q; + +do{ + m=m+1 + }while(m<2); +} +public class testClassInitializersWrap{ +public function MyNumber1():Number{ + return testClassInitializers.k; + } +public function MyNumber2():Number{ + return testClassInitializers.l; + } +public function MyNumber3():Number{ + return testClassInitializers.m; + } + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/testdynfinpublicClassInitializers.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/testdynfinpublicClassInitializers.as new file mode 100644 index 00000000000..2ff73b9f83a --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/testdynfinpublicClassInitializers.as @@ -0,0 +1,51 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + +import testdynfinpublicClassInitializer.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Class Initializers"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + +var testInit= new testdyfinpublicClassInitializersWrap(); +//print(testInit.MyNumber1()); +//print(testInit.MyNumber2()); +//print(); +AddTestCase("Result from for loop",1,testInit.MyNumber1()); +AddTestCase("Result from if else stt",2,testInit.MyNumber2()); +AddTestCase("Result from do loop",2,testInit.MyNumber3()); +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/testdynfinpublicClassInitializers/testdynfinpublicClassInitializers.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/testdynfinpublicClassInitializers/testdynfinpublicClassInitializers.as new file mode 100644 index 00000000000..7b1320fabf4 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/testdynfinpublicClassInitializers/testdynfinpublicClassInitializers.as @@ -0,0 +1,72 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package testdynfinpublicClassInitializer{ + +dynamic final public class testdynfinpublicClassInitializers{ + + public static var j:Number=1; + public static var k:Number=0; + public static var l:Number=0; + public static var m:Number=0; + for (j=1;j<2;j++) + { + k=j; + } + if(j>10){ + l=11; + } + else + { + l=j; + } + + +public static var n:Number=10; +public static var y:Number=5; +public static var z:Number=k/y; + +do{ + m=m+1 + }while(m<2); +} +public class testdyfinpublicClassInitializersWrap{ +public function MyNumber1():Number{ + return testdynfinpublicClassInitializers.k; + } +public function MyNumber2():Number{ + return testdynfinpublicClassInitializers.l; + } +public function MyNumber3():Number{ + return testdynfinpublicClassInitializers.m; + } + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/testinternalClassInitializers.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/testinternalClassInitializers.as new file mode 100644 index 00000000000..44f87a229b8 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/testinternalClassInitializers.as @@ -0,0 +1,51 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + +import testinternalClassInitializer.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Class Initializers"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + +var testInit= new testinternalClassInitializersWrap(); +//print(testInit.MyNumber1()); +//print(testInit.MyNumber2()); +//print(); +AddTestCase("Result from for loop",1,testInit.MyNumber1()); +AddTestCase("Result from if else stt",2,testInit.MyNumber2()); +AddTestCase("Result from do loop",2,testInit.MyNumber3()); +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/testinternalClassInitializers/testinternalClassInitializers.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/testinternalClassInitializers/testinternalClassInitializers.as new file mode 100644 index 00000000000..d8f87c03ef5 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ClassDef/testinternalClassInitializers/testinternalClassInitializers.as @@ -0,0 +1,72 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package testinternalClassInitializer{ + +internal class testinternalClassInitializers{ + + public static var j:Number=1; + public static var k:Number=0; + public static var l:Number=0; + public static var m:Number=0; + for (j=1;j<2;j++) + { + k=j; + } + if(j>10){ + l=11; + } + else + { + l=j; + } + + +public static var n:Number=10; +public static var y:Number=5; +public static var z:Number=k/y; + +do{ + m=m+1 + }while(m<2); +} +public class testinternalClassInitializersWrap{ +public function MyNumber1():Number{ + return testinternalClassInitializers.k; + } +public function MyNumber2():Number{ + return testinternalClassInitializers.l; + } +public function MyNumber3():Number{ + return testinternalClassInitializers.m; + } + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccNSStatMethSubClassMeth.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccNSStatMethSubClassMeth.as new file mode 100644 index 00000000000..d853094402f --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccNSStatMethSubClassMeth.as @@ -0,0 +1,68 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Access static method in a namespace of base class from subclass"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +import StaticPropertyPackage.*; + +var obj = new AccNSStatPropSubClassMeth(); + +// ******************************************** +// Access the static method via BaseClass.foo() +// ******************************************** +AddTestCase( "*** Access the static method via base class ***", 1, 1 ); +AddTestCase( "BaseClass.ns1::echo('hello')", "hello", BaseClass.ns1::echo("hello") ); + +// ******************************************** +// Access the static method via sub class, +// using unadorned "foo()" +// ******************************************** +AddTestCase( "*** Access the static method via sub class using unadorned method name ***", 1, 1 ); +AddTestCase( "obj.callEcho('world')", "world", obj.callEcho("world") ); + +// ******************************************** +// Access the static method via sub class, +// using "BaseClass.foo()" +// ******************************************** +AddTestCase( "*** Access the static method via sub class using adorned method name ***", 1, 1 ); +AddTestCase( "obj.callBaseEcho('elvis')", "elvis", obj.callBaseEcho("elvis") ); + + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccNSStatMethSubClassMeth/AccNSStatMethSubClassMeth.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccNSStatMethSubClassMeth/AccNSStatMethSubClassMeth.as new file mode 100644 index 00000000000..98cd3373d73 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccNSStatMethSubClassMeth/AccNSStatMethSubClassMeth.as @@ -0,0 +1,51 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package StaticPropertyPackage { + + public namespace ns1; + + public class BaseClass { + ns1 static function echo( s:String ) : String { + return s; + } + } + + public class AccNSStatPropSubClassMeth extends BaseClass { + public function callEcho( s:String ) : String { + return ns1::echo(s); + } + + public function callBaseEcho( s:String ) : String { + return BaseClass.ns1::echo(s); + } + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccNSStatPropSubClassMeth.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccNSStatPropSubClassMeth.as new file mode 100644 index 00000000000..76aab66d814 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccNSStatPropSubClassMeth.as @@ -0,0 +1,68 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Access static property in a namespace of base class from subclass"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +import StaticPropertyPackage.*; + +var obj = new AccNSStatPropSubClassMeth(); + +// ******************************************** +// Access the static property via BaseClass.x +// ******************************************** +AddTestCase( "*** Access the static property via base class ***", 1, 1 ); +AddTestCase( "BaseClass.ns1::i = 12, BaseClass.ns1::i", 12, (BaseClass.ns1::i = 12, BaseClass.ns1::i) ); + +// ******************************************** +// Access the static property via sub class, +// using unadorned "x" +// ******************************************** +AddTestCase( "*** Access the static property via sub class using unadorned property name ***", 1, 1 ); +AddTestCase( "obj.getInt()", BaseClass.ns1::i, obj.getInt() ); + +// ******************************************** +// Access the static property via sub class, +// using unadorned "BaseClass.x" +// ******************************************** +AddTestCase( "*** Access the static property via sub class using unadorned property name ***", 1, 1 ); +AddTestCase( "obj.getBaseInt()", BaseClass.ns1::i, obj.getBaseInt() ); + + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccNSStatPropSubClassMeth/AccNSStatPropSubClassMeth.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccNSStatPropSubClassMeth/AccNSStatPropSubClassMeth.as new file mode 100644 index 00000000000..ea1891e5bd7 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccNSStatPropSubClassMeth/AccNSStatPropSubClassMeth.as @@ -0,0 +1,50 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package StaticPropertyPackage { + + public namespace ns1; + + public class BaseClass { + ns1 static var i:int; + } + + public class AccNSStatPropSubClassMeth extends BaseClass { + + public function getInt(): int { + return ns1::i; + } + + public function getBaseInt(): int { + return BaseClass.ns1::i; + } + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatMethIntermediateSubClassMeth.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatMethIntermediateSubClassMeth.as new file mode 100644 index 00000000000..fbf46e51152 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatMethIntermediateSubClassMeth.as @@ -0,0 +1,62 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Access static method of base class from subclass"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +import StaticPropertyPackage.*; + +var obj = new AccStatMethIntermediateSubClassMeth(); + + +// ******************************************** +// Access the static method via sub class, +// using unadorned "foo()" +// ******************************************** +AddTestCase( "*** Access the static method via sub class using unadorned method call ***", 1, 1 ); +AddTestCase( "obj.callEcho('world')", "world", obj.callEcho("world") ); + +// ******************************************** +// Access the static method via sub class, +// using "BaseClass.foo()" +// ******************************************** +AddTestCase( "*** Access the static method via sub class using base class method call ***", 1, 1 ); +AddTestCase( "obj.callBaseEcho('here')", "here", obj.callBaseEcho("here") ); + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatMethIntermediateSubClassMeth/AccStatMethIntermediateSubClassMeth.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatMethIntermediateSubClassMeth/AccStatMethIntermediateSubClassMeth.as new file mode 100644 index 00000000000..1c732519728 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatMethIntermediateSubClassMeth/AccStatMethIntermediateSubClassMeth.as @@ -0,0 +1,54 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package StaticPropertyPackage { + + public class BaseClass { + + internal static function echo(s:String): String { + return s; + } + } + + internal class IntermediateClass extends BaseClass {} + + public class AccStatMethIntermediateSubClassMeth extends IntermediateClass { + + public function callEcho(s:String): String { + return echo(s); + } + + public function callBaseEcho(s:String): String { + return BaseClass.echo(s); + } + + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatMethSubClassMeth.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatMethSubClassMeth.as new file mode 100644 index 00000000000..f2ee62e67e1 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatMethSubClassMeth.as @@ -0,0 +1,74 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Access static method of base class from subclass"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +import StaticPropertyPackage.*; + +var obj = new AccStatMethSubClassMeth(); + +// ******************************************** +// Access the static method via BaseClass.foo() +// ******************************************** +AddTestCase( "*** Access the static method via base class ***", 1, 1 ); +AddTestCase( "BaseClass.echo('hello')", "hello", BaseClass.echo("hello") ); + +// ******************************************** +// Access the static method via sub class, +// using unadorned "foo()" +// ******************************************** +AddTestCase( "*** Access the static method via sub class using unadorned method call ***", 1, 1 ); +AddTestCase( "obj.callEcho('world')", "world", obj.callEcho("world") ); + +// ******************************************** +// Access the static method via sub class, +// using "BaseClass.foo()" +// ******************************************** +AddTestCase( "*** Access the static method via sub class using base class method call ***", 1, 1 ); +AddTestCase( "obj.callBaseEcho('here')", "here", obj.callBaseEcho("here") ); + +// ******************************************** +// Access the static method via sub class using +// subclass.foo() in a method +// ******************************************** +// no longer legal as of d359 +//AddTestCase( "*** Access the static method via sub class using subclass.foo() in a method ***", 1, 1 ); +//AddTestCase( "obj.callSubEcho('there')", "there", obj.callSubEcho("there") ); + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatMethSubClassMeth/AccStatMethSubClassMeth.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatMethSubClassMeth/AccStatMethSubClassMeth.as new file mode 100644 index 00000000000..f0ad4837961 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatMethSubClassMeth/AccStatMethSubClassMeth.as @@ -0,0 +1,57 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package StaticPropertyPackage { + + public class BaseClass { + + public static function echo(s:String): String { + return s; + } + } + + public class AccStatMethSubClassMeth extends BaseClass { + + public function callEcho(s:String): String { + return echo(s); + } + + public function callBaseEcho(s:String): String { + return BaseClass.echo(s); + } + + // not legal to access static via subclass name: + //public function callSubEcho(s:String): String { + // return AccStatMethSubClassMeth.echo(s); + //} + + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatMethSubClassMethSuper.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatMethSubClassMethSuper.as new file mode 100644 index 00000000000..e0ea8fefedd --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatMethSubClassMethSuper.as @@ -0,0 +1,62 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import StaticPropertyPackage.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Access static method of base class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var obj:AccStatMethSubClassMethSuper = new AccStatMethSubClassMethSuper(); + +// ******************************************** +// access static method of base class using super.foo() +// ******************************************** + +var thisError = "no exception thrown"; +try{ + obj.getBaseDate(); +} catch (e1) { + thisError = e1.toString(); +} finally { + AddTestCase( "access static method of base class using 'super.foo()'", + REFERENCEERROR+1070, + referenceError( thisError) ); +} + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatMethSubClassMethSuper/AccStatMethSubClassMethSuper.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatMethSubClassMethSuper/AccStatMethSubClassMethSuper.as new file mode 100644 index 00000000000..7aca7bfec4a --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatMethSubClassMethSuper/AccStatMethSubClassMethSuper.as @@ -0,0 +1,46 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package StaticPropertyPackage { + + class BaseClass { + static var date:Date = new Date(0); + + public static function getDate() : Date { + return date; + } + } + public class AccStatMethSubClassMethSuper extends BaseClass { + + public function getBaseDate() : Date { + return super.getDate(); + } + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatMethSubClassStatMeth.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatMethSubClassStatMeth.as new file mode 100644 index 00000000000..22c43f8b5f7 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatMethSubClassStatMeth.as @@ -0,0 +1,60 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Access static method of base class from subclass static method"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +import StaticPropertyPackage.*; + + +// ******************************************** +// Access the static method via sub class, +// using unadorned "foo()" +// ******************************************** +AddTestCase( "*** Access the static method via sub class using unadorned method call ***", 1, 1 ); +AddTestCase( "AccStatMethSubClassStatMeth.callEcho('world')", "world", AccStatMethSubClassStatMeth.callEcho("world") ); + +// ******************************************** +// Access the static method via sub class, +// using "BaseClass.foo()" +// ******************************************** +AddTestCase( "*** Access the static method via sub class using base class method call ***", 1, 1 ); +AddTestCase( "AccStatMethSubClassStatMeth.callBaseEcho('here')", "here", AccStatMethSubClassStatMeth.callBaseEcho("here") ); + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatMethSubClassStatMeth/AccStatMethSubClassStatMeth.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatMethSubClassStatMeth/AccStatMethSubClassStatMeth.as new file mode 100644 index 00000000000..a539d92ba3e --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatMethSubClassStatMeth/AccStatMethSubClassStatMeth.as @@ -0,0 +1,53 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package StaticPropertyPackage { + + class BaseClass { + + static function echo(s:String): String { + return s; + } + } + + + public class AccStatMethSubClassStatMeth extends BaseClass { + + public static function callEcho(s:String): String { + return echo(s); + } + + public static function callBaseEcho(s:String): String { + return BaseClass.echo(s); + } + + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatPropIntermediateSubClassMeth.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatPropIntermediateSubClassMeth.as new file mode 100644 index 00000000000..48a3e6b13aa --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatPropIntermediateSubClassMeth.as @@ -0,0 +1,71 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Access static property of base class from subclass"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +import StaticPropertyPackage.*; + + + + + +var obj = new AccStatPropIntermediateSubClassMeth(); + +// ******************************************** +// Access the static property via BaseClass.x +// ******************************************** +AddTestCase( "*** Access the static property via base class ***", 1, 1 ); +AddTestCase( "BaseClass.string", "static string", BaseClass.string ); + +// ******************************************** +// Access the static property via sub class, +// using unadorned "x" +// ******************************************** +AddTestCase( "*** Access the static property via sub class using unadorned property name ***", 1, 1 ); +AddTestCase( "obj.getString()", BaseClass.string, obj.getString() ); + +// ******************************************** +// Access the static property via sub class, +// using unadorned "BaseClass.x" +// ******************************************** +AddTestCase( "*** Access the static property via sub class using unadorned property name ***", 1, 1 ); +AddTestCase( "obj.getBaseString()", BaseClass.string, obj.getBaseString() ); + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatPropIntermediateSubClassMeth/AccStatPropIntermediateSubClassMeth.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatPropIntermediateSubClassMeth/AccStatPropIntermediateSubClassMeth.as new file mode 100644 index 00000000000..e1437c29316 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatPropIntermediateSubClassMeth/AccStatPropIntermediateSubClassMeth.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package StaticPropertyPackage { + public class BaseClass { + public static var string:String = "static string"; + + } + + public class IntermediateClass extends BaseClass { + public var foo:String = "foo"; + } + public class AccStatPropIntermediateSubClassMeth extends IntermediateClass { + + public function getString() : String { + return string; + } + + public function getBaseString() : String { + return BaseClass.string; + } + + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatPropSubClassInit.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatPropSubClassInit.as new file mode 100644 index 00000000000..edc6ac6393f --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatPropSubClassInit.as @@ -0,0 +1,65 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Access static property of base class from subclass"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +import StaticProperty.*; + + + + +// ******************************************** +// Check the static property of the sub class +// ******************************************** +AddTestCase( "*** Check the static property of the sub class ***", 1, 1 ); +AddTestCase( "AccStatPropSubClassInit.aStat", "BaseClass.x", AccStatPropSubClassInit.aStat ); +AddTestCase( "AccStatPropSubClassInit.aStat2", "BaseClass.x", AccStatPropSubClassInit.aStat2 ); + + +var obj = new AccStatPropSubClassInit(); +// ******************************************** +// Check the property of the sub class +// ******************************************** +AddTestCase( "*** Check the property of the sub class ***", 1, 1 ); +AddTestCase( "obj.aVar", "BaseClass.x", obj.aVar ); +AddTestCase( "obj.aVar2", "BaseClass.x", obj.aVar2 ); + + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatPropSubClassInit/AccStatPropSubClassInit.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatPropSubClassInit/AccStatPropSubClassInit.as new file mode 100644 index 00000000000..8574b682792 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatPropSubClassInit/AccStatPropSubClassInit.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package StaticProperty { + + class BaseClass { + static var x:String = "BaseClass.x"; + } + + + public class AccStatPropSubClassInit extends BaseClass { + public var aVar : String = BaseClass.x; + public static var aStat : String = BaseClass.x; + + public var aVar2 : String = x; + public static var aStat2 : String = x; + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatPropSubClassMeth.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatPropSubClassMeth.as new file mode 100644 index 00000000000..3b5858140a7 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatPropSubClassMeth.as @@ -0,0 +1,69 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Access static property of base class from subclass"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +import StaticPropertyPackage.*; + + +var obj = new AccStatPropSubClassMeth(); + +// ******************************************** +// Access the static property via BaseClass.x +// ******************************************** +AddTestCase( "*** Access the static property via base class ***", 1, 1 ); +AddTestCase( "BaseClass.boolean", true, BaseClass.boolean ); + +// ******************************************** +// Access the static property via sub class, +// using unadorned "x" +// ******************************************** +AddTestCase( "*** Access the static property via sub class using unadorned property name ***", 1, 1 ); +AddTestCase( "obj.getBoolean()", BaseClass.boolean, obj.getBoolean() ); + +// ******************************************** +// Access the static property via sub class, +// using unadorned "BaseClass.x" +// ******************************************** +AddTestCase( "*** Access the static property via sub class using unadorned property name ***", 1, 1 ); +AddTestCase( "obj.getBaseDate()", BaseClass.date.getFullYear(), obj.getBaseDate().getFullYear() ); + + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatPropSubClassMeth/AccStatPropSubClassMeth.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatPropSubClassMeth/AccStatPropSubClassMeth.as new file mode 100644 index 00000000000..3d42c3c90c1 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatPropSubClassMeth/AccStatPropSubClassMeth.as @@ -0,0 +1,48 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package StaticPropertyPackage { + + public class BaseClass { + static public var boolean:Boolean = true; + static public var date:Date = new Date(0); + } + + public class AccStatPropSubClassMeth extends BaseClass { + + public function getBoolean() : Boolean { + return boolean; + } + + public function getBaseDate() : Date { + return BaseClass.date; + } + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatPropSubClassStatMeth.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatPropSubClassStatMeth.as new file mode 100644 index 00000000000..b67c623cf9b --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatPropSubClassStatMeth.as @@ -0,0 +1,67 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Access static property of base class from subclass"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +import StaticPropertyPackage.*; + + +// ******************************************** +// Access the static property via BaseClass.x +// ******************************************** +AddTestCase( "*** Access the static property via base class ***", 1, 1 ); +AddTestCase( "BaseClass.i = 12, BaseClass.i", 12, (BaseClass.i = 12, BaseClass.i) ); + +// ******************************************** +// Access the static property via sub class, +// using unadorned "x" +// ******************************************** +AddTestCase( "*** Access the static property via sub class using unadorned property name ***", 1, 1 ); +AddTestCase( "AccStatPropSubClassStatMeth.getInt()", BaseClass.i, AccStatPropSubClassStatMeth.getInt() ); + +// ******************************************** +// Access the static property via sub class, +// using unadorned "BaseClass.x" +// ******************************************** +AddTestCase( "*** Access the static property via sub class using unadorned property name ***", 1, 1 ); +AddTestCase( "AccStatPropSubClassStatMeth.getBaseInt()", BaseClass.i, AccStatPropSubClassStatMeth.getBaseInt() ); + + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatPropSubClassStatMeth/AccStatPropSubClassStatMeth.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatPropSubClassStatMeth/AccStatPropSubClassStatMeth.as new file mode 100644 index 00000000000..c9bf23cc29c --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatPropSubClassStatMeth/AccStatPropSubClassStatMeth.as @@ -0,0 +1,48 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package StaticPropertyPackage { + + public class BaseClass { + public static var i:int; + } + + public class AccStatPropSubClassStatMeth extends BaseClass { + + public static function getInt(): int { + return i; + } + + public static function getBaseInt(): int { + return BaseClass.i; + } + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatPropViaSubClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatPropViaSubClass.as new file mode 100644 index 00000000000..7f8e60fbdcf --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatPropViaSubClass.as @@ -0,0 +1,91 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import StaticPropertyPackage.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Access static method of base class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var obj:AccStatPropViaSubClass = new AccStatPropViaSubClass(); + +// ******************************************** +// Try to access a static property (in a namespace) +// of the base class via a reference to the subclass +// ******************************************** +var thisError = "no exception thrown"; +try{ + var date = obj.ns1::date; +} catch (e1) { + thisError = e1.toString(); +} finally { + AddTestCase( "access static property in namespace of base class using subclass", + REFERENCEERROR+1069, + referenceError( thisError) ); +} + +// ******************************************** +// Try to access a static property of the base +// class via a reference to the subclass +// ******************************************** +thisError = "no exception thrown"; +try{ + var str = obj.string; +} catch (e2) { + thisError = e2.toString(); +} finally { + AddTestCase( "access static property of base class using subclass", + REFERENCEERROR+1069, + referenceError( thisError) ); +} + +// ******************************************** +// Try to access the static property of the base +// class from an instance method in the subclass +// using "this.foo" +// ******************************************** +var thisError = "no exception thrown"; +try{ + var str = obj.getString(); +} catch (e3) { + thisError = e3.toString(); +} finally { + AddTestCase( "access static property of base class in subclass with this.foo", + REFERENCEERROR+1069, + referenceError( thisError) ); +} + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatPropViaSubClass/AccStatPropViaSubClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatPropViaSubClass/AccStatPropViaSubClass.as new file mode 100644 index 00000000000..0d330633c43 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatPropViaSubClass/AccStatPropViaSubClass.as @@ -0,0 +1,46 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package StaticPropertyPackage { + + public namespace ns1; + + class BaseClass { + static var string:String = "baseclass"; + ns1 static var date:Date = new Date(0); + } + + public class AccStatPropViaSubClass extends BaseClass { + + public function getString() : String { + return this.string; + } + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatPropViaSubClassWIntermediate.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatPropViaSubClassWIntermediate.as new file mode 100644 index 00000000000..d27cc40909b --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatPropViaSubClassWIntermediate.as @@ -0,0 +1,71 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import StaticPropertyPackage.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Access static property of base class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var obj:AccStatPropViaSubClassWIntermediate = new AccStatPropViaSubClassWIntermediate(); + +// ******************************************** +// Try to access a static property of the base +// class via a reference to the subclass that +// extends an intermediary class +// ******************************************** +var thisError = "no exception thrown"; +try{ + var str = obj.string; +} catch (e1) { + thisError = e1.toString(); +} finally { + AddTestCase( "access static property of base class using sub and intermediate", + REFERENCEERROR+1069, + referenceError( thisError) ); +} + + +// ******************************************** +// Try to access a static property in an instance +// method using an intermeidate base class +// ( C -> B -> A, in C.foo( return B.x)) +// ******************************************** +AddTestCase("*** access static property of base class using sub and intermediate ***", 1, 1); +AddTestCase("obj.getString()", "baseclass", obj.getString()); + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatPropViaSubClassWIntermediate/AccStatPropViaSubClassWIntermediate.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatPropViaSubClassWIntermediate/AccStatPropViaSubClassWIntermediate.as new file mode 100644 index 00000000000..f178c560b54 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/AccStatPropViaSubClassWIntermediate/AccStatPropViaSubClassWIntermediate.as @@ -0,0 +1,46 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package StaticPropertyPackage { + class BaseClass { + static var string:String = "baseclass"; + } + class IntermediateClass extends BaseClass { } + + public class AccStatPropViaSubClassWIntermediate extends IntermediateClass { + + public function getString() : String { + // modified for d359, scorfield, 8/1/05: + //return IntermediateClass.string; + // should be visible without qualification: + return string; + } + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDefaultClass.as new file mode 100644 index 00000000000..02b5304259d --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDefaultClass.as @@ -0,0 +1,267 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DefaultClass{ + + +import DefaultClass.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Dynamic Class Extends Default Class"; // Provide ECMA section title or a description +//var BUGNUMBER = ""; + +startTest(); // leave this alone + + + +// ******************************************* +// access default method from +// outside of class +// ******************************************* + +var DYNEXTDCLASS = new DynExtDefaultClass(); +var arr:Array; +arr = new Array(10, 15, 20, 25, 30); + +AddTestCase( "*** Access Default Method from Default method of sub class ***", 1, 1 ); +AddTestCase( "DYNEXTDCLASS.testSubGetSetArray(arr)", arr, (DYNEXTDCLASS.testSubGetSetArray(arr)) ); + + +// ******************************************** +// access default method from a public +// method of a sub class +// +// ******************************************** +arr = new Array(1, 5); +DYNEXTDCLASS = new DynExtDefaultClass(); +AddTestCase( "DYNEXTDCLASS.pubSubSetArray(arr), DYNEXTDCLASS.pubSubGetArray()", arr, (DYNEXTDCLASS.pubSubSetArray(arr), DYNEXTDCLASS.pubSubGetArray()) ); + + +// ******************************************** +// access default method from a private +// method of a sub class +// +// ******************************************** +arr = new Array(2, 4, 6); +DYNEXTDCLASS = new DynExtDefaultClass(); +AddTestCase( "DYNEXTDCLASS.testPrivSubArray(arr)", arr, DYNEXTDCLASS.testPrivSubArray(arr) ); + +// ******************************************** +// access default method from a final +// method of a sub class +// ******************************************** + +DYNEXTDCLASS = new DynExtDefaultClass(); +AddTestCase( "access 'default' method from 'final' method of sub class", arr, (DYNEXTDCLASS.testFinSubArray(arr)) ); + +// ******************************************** +// access default method from a static +// method of a sub class +// ******************************************** + +DYNEXTDCLASS = new DynExtDefaultClass(); +var thisError10 = "no Exception thrown"; +try{ + DYNEXTDCLASS.testStatSubArray(arr); +} catch (e) { + thisError10 = e.toString(); +} finally { + AddTestCase( "access 'default' method from 'static' method of sub class", + "ReferenceError: Error #1065", + referenceError( thisError10 ) ); +} +// ******************************************** +// access default method from a static +// method of a sub class +// +// ******************************************** +/* +arr = new Array(1, 5); +DYNEXTDCLASS = new DynExtDefaultClass(); +AddTestCase( "*** Access default method from static method of sub class ***", 1, 1 ); +AddTestCase( "DYNEXTDCLASS.testStatSubArray(arr)", arr, (DYNEXTDCLASS.testStatSubArray(arr)) ); +*/ + +// ******************************************** +// access default method from a public +// final method of a sub class +// ******************************************** + +arr = new Array( 1, 2, 3 ); +DYNEXTDCLASS = new DynExtDefaultClass(); +AddTestCase( "access 'default' method from 'public final' method of sub class", arr, + (DYNEXTDCLASS.pubFinSubSetArray(arr), DYNEXTDCLASS.pubFinSubGetArray()) ); + +// ******************************************** +// access default method from a final +// private method of a sub class +// ******************************************** + +arr = new Array( 4, 5 ); +DYNEXTDCLASS = new DynExtDefaultClass(); +AddTestCase( "access 'default' method from 'private final' method of sub class", arr, (DYNEXTDCLASS.testPrivFinSubArray(arr)) ); + +// ******************************************** +// access default method from a private +// method of a sub class +// ******************************************** + +arr = new Array( 6, 7 ); +DYNEXTDCLASS = new DynExtDefaultClass(); +AddTestCase( "access 'default' method from 'private' method of sub class", arr, DYNEXTDCLASS.testPrivSubArray(arr) ); + +// ******************************************** +// access default method from a virtual +// method of a sub class +// ******************************************** + +AddTestCase( "access 'default' method from 'virtual' method of sub class", arr, + DYNEXTDCLASS.testVirtSubArray(arr) ); + +// ******************************************** +// access default method from a virtual +// public method of a sub class +// ******************************************** + +AddTestCase( "access 'default' method from 'public virtual' method of sub class", arr, + (DYNEXTDCLASS.pubVirtSubSetArray(arr), DYNEXTDCLASS.pubVirtSubGetArray()) ); + +// ******************************************** +// access default method from a virtual +// private method of a sub class +// ******************************************** + +AddTestCase( "access 'default' method from 'private virtual' method of sub class", arr, + DYNEXTDCLASS.testPrivVirtSubArray(arr) ); + + + +/* Access properties of parent class */ + +// ******************************************** +// access default property from +// default method in sub class +// ******************************************** + +DYNEXTDCLASS = new DynExtDefaultClass(); +AddTestCase( "access 'default' property from 'default' method of sub class", arr, + (DYNEXTDCLASS.testSubGetSetDPArray(arr)) ); + +// ******************************************** +// access default property from +// final method in sub class +// ******************************************** + +DYNEXTDCLASS = new DynExtDefaultClass(); +AddTestCase( "access 'default' property from 'final' method of sub class", arr, + (DYNEXTDCLASS.testFinSubDPArray(arr)) ); + +// ******************************************** +// access default property from +// virtual method in sub class +// ******************************************** + +DYNEXTDCLASS = new DynExtDefaultClass(); +AddTestCase( "access 'default' property from 'virtual' method of sub class", arr, + (DYNEXTDCLASS.testVirtSubDPArray(arr)) ); + +// ******************************************** +// access default property from +// public method in sub class +// ******************************************** + +DYNEXTDCLASS = new DynExtDefaultClass(); +AddTestCase( "access 'default' property from 'public' method of sub class", arr, + (DYNEXTDCLASS.pubSubSetDPArray(arr), DYNEXTDCLASS.pubSubGetDPArray()) ); + +// ******************************************** +// access default property from +// private method in sub class +// ******************************************** + +DYNEXTDCLASS = new DynExtDefaultClass(); +AddTestCase( "access 'default' property from 'private' method of sub class", arr, + (DYNEXTDCLASS.testPrivSubDPArray(arr)) ); + +// ******************************************** +// access default property from +// public final method in sub class +// ******************************************** + +DYNEXTDCLASS = new DynExtDefaultClass(); +AddTestCase( "access 'default' property from 'public final' method of sub class", arr, + (DYNEXTDCLASS.pubFinSubSetDPArray(arr), DYNEXTDCLASS.pubFinSubGetDPArray()) ); + +// ******************************************** +// access default property from +// public virtual method in sub class +// ******************************************** + +DYNEXTDCLASS = new DynExtDefaultClass(); +AddTestCase( "access 'default' property from 'public virtual' method of sub class", arr, + (DYNEXTDCLASS.pubVirtSubSetDPArray(arr), DYNEXTDCLASS.pubVirtSubGetDPArray()) ); + +// ******************************************** +// access default property from +// private final method in sub class +// ******************************************** + +DYNEXTDCLASS = new DynExtDefaultClass(); +AddTestCase( "access 'default' property from 'private final' method of sub class", arr, + (DYNEXTDCLASS.testPrivFinSubDPArray(arr)) ); + +// ******************************************** +// access default property from +// private virtual method in sub class +// ******************************************** + +DYNEXTDCLASS = new DynExtDefaultClass(); +AddTestCase( "access 'default' property from 'private virtual' method of sub class", arr, + (DYNEXTDCLASS.testPrivVirtSubDPArray(arr)) ); + +// ******************************************** +// Class Prototype Testing +// ******************************************** + +//Add new property to parent through prototype object, verify child inherits it +var child = new DynExtDefaultClass(); +DefaultClassInner.prototype.fakeProp = 100; +AddTestCase("*** Add new property to parent prototype object, verify child class inherits it ***", 100, child.fakeProp); + +//Try overriding parent property through prototype object, verify child object has correct value +DefaultClassInner.prototype.pObj = 2; +child = new DynExtDefaultClass(); +AddTestCase("*** Try overriding parent property through prototype object, verify child object has correct value ***", 1, child.pObj); + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. + } diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDefaultClass/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDefaultClass/DefaultClass.as new file mode 100644 index 00000000000..4f23e27bab1 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDefaultClass/DefaultClass.as @@ -0,0 +1,267 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DefaultClass { + + class DefaultClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + //public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + //For class prototype testing + var pObj:Number = 1; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + } + + public class DefaultClass extends DefaultClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDefaultClass/DynExtDefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDefaultClass/DynExtDefaultClass.as new file mode 100644 index 00000000000..2abc8b31992 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDefaultClass/DynExtDefaultClass.as @@ -0,0 +1,282 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + +package DefaultClass { + + import DefaultClass.*; + + // Commenting out the import statement as this is not allowed by the compiler now + // import Definitions.Classes.DefaultClass; + + // As this is a dynamic class, it will not be seen by the testcase, hence + // creating a wrapper function for this and changing the name for this file. + // DynExtDefaultClass extends DynExtDefaultClassInner + dynamic class DynExtDefaultClassInner extends DefaultClass { + + // ************************************ + // access default method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return this.getArray(); } + function subSetArray(a:Array) { this.setArray(a); } + + // ************************************ + // access default method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return this.getArray(); } + public function pubSubSetArray(a:Array) { this.setArray(a); } + + // this is needed so that the test cases can access this from + // outside the class. This way the test case itself preserved + public function testSubGetSetArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + // ************************************ + // access default method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return this.getArray(); } + private function privSubSetArray(a:Array) { this.setArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + // ************************************ + // access default method of parent + // from final method of sub class + // ************************************ + + final function finGetArray() : Array { return this.getArray(); } + final function finSetArray(a:Array) { this.setArray(a); } + + // this is needed so that the test cases can access this from + // outside the class. This way the test case itself preserved + public function testFinSubArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + // ************************************ + // access default method of parent + // from static method of sub class + // ************************************ + + static function statGetArray() : Array { return getArray(); } + static function statSetArray(a:Array) { setArray(a); } + // this is needed so that the test cases can access this from + // outside the class. This way the test case itself preserved + public function testStatSubArray(a:Array) : Array { + statSetArray(a); + return statGetArray(); + } + + // ************************************ + // access default method of parent + // from public final method of sub class + // ************************************ + + public final function pubFinSubGetArray() : Array { return this.getArray(); } + final public function pubFinSubSetArray(a:Array) { this.setArray(a); } + + // ************************************ + // access default method of parent + // from private final method of sub class + // ************************************ + + private final function privFinSubGetArray() : Array { return this.getArray(); } + final private function privFinSubSetArray(a:Array) { this.setArray(a); } + + public function testPrivFinSubArray(a:Array):Array { + this.privFinSubSetArray(a); + return this.privFinSubGetArray(); + } + + + // ************************************ + // access default method of parent + // from virtual method of sub class + // ************************************ + + virtual function virtSubGetArray() : Array { return this.getArray(); } + virtual function virtSubSetArray(a:Array) { this.setArray(a); } + + public function testVirtSubArray(a:Array) : Array { + this.virtSubSetArray(a); + return this.virtSubGetArray(); + } + + // ************************************ + // access default method of parent + // from public virtual method of sub class + // ************************************ + + virtual public function pubVirtSubGetArray() : Array { return this.getArray(); } + public virtual function pubVirtSubSetArray(a:Array) { this.setArray(a); } + + // ************************************ + // access default method of parent + // from private virtual method of sub class + // ************************************ + + virtual private function privVirtSubGetArray() : Array { return this.getArray(); } + private virtual function privVirtSubSetArray(a:Array) { this.setArray(a); } + + public function testPrivVirtSubArray(a:Array) : Array { + this.privVirtSubSetArray(a); + return this.privVirtSubGetArray(); + } + + + // *************************************** + // access default property from + // default method of sub class + // *************************************** + + function subGetDPArray() : Array { return array; } + function subSetDPArray(a:Array) { array = a; } + + // this is needed so that the test cases can access this from + // outside the class. This way the test case itself preserved + public function testSubGetSetDPArray(a:Array) : Array { + this.subSetDPArray(a); + return this.subGetDPArray(); + } + + // *************************************** + // access default property from + // public method of sub class + // *************************************** + + public function pubSubGetDPArray() : Array { return this.array; } + public function pubSubSetDPArray(a:Array) { this.array = a; } + + // *************************************** + // access default property from + // private method of sub class + // *************************************** + + private function privSubGetDPArray() : Array { return this.array; } + private function privSubSetDPArray(a:Array) { this.array = a; } + + public function testPrivSubDPArray(a:Array) : Array { + this.privSubSetDPArray(a); + return this.privSubGetDPArray(); + } + + + // *************************************** + // access default property from + // final method of sub class + // *************************************** + + final function finSubGetDPArray() : Array { return this.array; } + final function finSubSetDPArray(a:Array) { this.array = a; } + + public function testFinSubDPArray(a:Array) : Array { + this.finSubSetDPArray(a); + return this.finSubGetDPArray(); + } + + // *************************************** + // access default property from + // virtual method of sub class + // *************************************** + + virtual function virtSubGetDPArray() : Array { return array; } + virtual function virtSubSetDPArray(a:Array) { array = a; } + + public function testVirtSubDPArray(a:Array) : Array { + this.virtSubSetDPArray(a); + return this.virtSubGetDPArray(); + } + + // *************************************** + // access default property from + // public virtual method of sub class + // *************************************** + + public virtual function pubVirtSubGetDPArray() : Array { return this.array; } + virtual public function pubVirtSubSetDPArray(a:Array) { this.array = a; } + + // *************************************** + // access default property from + // private final method of sub class + // *************************************** + + private final function privFinSubGetDPArray() : Array { return this.array; } + final private function privFinSubSetDPArray(a:Array) { this.array = a; } + + public function testPrivFinSubDPArray(a:Array):Array { + this.privFinSubSetDPArray(a); + return this.privFinSubGetDPArray(); + } + + // *************************************** + // access default property from + // private virtual method of sub class + // *************************************** + + private virtual function privVirtSubGetDPArray() : Array { return this.array; } + virtual private function privVirtSubSetDPArray(a:Array) { this.array = a; } + + public function testPrivVirtSubDPArray(a:Array):Array { + this.privVirtSubSetDPArray(a); + return this.privVirtSubGetDPArray(); + } + + // *************************************** + // access default property from + // public final method of sub class + // *************************************** + + public final function pubFinSubGetDPArray() : Array { return this.array; } + final public function pubFinSubSetDPArray(a:Array) { this.array = a; } + + + } + + // PUBLIC wrapper function for the dynamic class to be accessed; + // otherwise it will give the error: + // ReferenceError: DynExtDefaultClass is not defined + // at global$init() + public class DynExtDefaultClass extends DynExtDefaultClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDefaultClassFin.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDefaultClassFin.as new file mode 100644 index 00000000000..8d435e21ebf --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDefaultClassFin.as @@ -0,0 +1,166 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + +import DefaultClass.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "final Class Extends Default Class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var EXTDCLASS = new DynExtDefaultClassFin(); +var arr = new Array(10, 15, 20, 25, 30); + +AddTestCase( "*** Access final method from final method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testFinSubArray(arr)", arr, (EXTDCLASS.testFinSubArray(arr))); + + +// ******************************************** +// access final method from a default +// method of a sub class +// +// ******************************************** + +EXTDCLASS = new DynExtDefaultClassFin(); +var arr = new Array(1, 2, 3); +AddTestCase( "*** Access final method from default method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testSubGetSetArray(arr)", arr, (EXTDCLASS.testSubGetSetArray(arr)) ); + + + +// ******************************************** +// access final method from a public +// method of a sub class +// +// ******************************************** + +EXTDCLASS = new DynExtDefaultClassFin(); +var arr = new Array(4, 5, 6); +AddTestCase( "*** Access final method from public method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.pubSubSetArray(arr), EXTDCLASS.pubSubGetArray()", arr, (EXTDCLASS.pubSubSetArray(arr), EXTDCLASS.pubSubGetArray()) ); + + +// ******************************************** +// access final method from a private +// method of a sub class +// +// ******************************************** + +EXTDCLASS = new DynExtDefaultClassFin(); +var arr = new Array(10, 50); +AddTestCase( "*** Access final method from private method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testPrivSubArray(arr)", arr, EXTDCLASS.testPrivSubArray(arr) ); + + +// ******************************************** +// access final method from a final +// method of a sub class +// +// ******************************************** + +EXTDCLASS = new DynExtDefaultClassFin(); +var arr = new Array(4, 5, 6); +AddTestCase( "*** Access final method from public method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testFinSubArray(arr)", arr, (EXTDCLASS.testFinSubArray(arr)) ); + + + +// ******************************************** +// access final method from a virtual +// method of a sub class +// ******************************************** + +AddTestCase( "access 'final' method from 'virtual' method of sub class", arr, + EXTDCLASS.testVirtSubArray(arr) ); + +// ******************************************** +// access final property from outside +// the class +// ******************************************** + +EXTDCLASS = new DynExtDefaultClassFin(); +AddTestCase( "*** Access final from outside the class ***", 1, 1 ); +//AddTestCase( "EXTDCLASS.finArray = arr", arr, (EXTDCLASS.finArray = arr, EXTDCLASS.finArray) ); + +// ******************************************** +// access final property from +// default method in sub class +// ******************************************** + +EXTDCLASS = new DynExtDefaultClassFin(); +var arr = new Array(10, 20, 30); +AddTestCase( "*** Access final property from default method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testSubGetSetDPArray(arr)", arr, (EXTDCLASS.testSubGetSetDPArray(arr)) ); + +// ******************************************** +// access final property from +// public method in sub class +// ******************************************** + +EXTDCLASS = new DynExtDefaultClassFin(); +AddTestCase( "*** Access final property from public method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.pubSubSetDPArray(arr), EXTDCLASS.pubSubGetDPArray()", arr, (EXTDCLASS.pubSubSetDPArray(arr), EXTDCLASS.pubSubGetDPArray()) ); + + +// ******************************************** +// access final property from +// private method in sub class +// ******************************************** + +EXTDCLASS = new DynExtDefaultClassFin(); +AddTestCase( "*** Access final property from private method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testSubPrivDPArray(arr)", arr, (EXTDCLASS.testSubPrivDPArray(arr)) ); + +// ******************************************** +// access final property from +// final method in sub class +// ******************************************** + +EXTDCLASS = new DynExtDefaultClassFin(); +AddTestCase( "*** Access final property from final method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testSubFinDPArray(arr)", arr, (EXTDCLASS.testSubFinDPArray(arr)) ); + +// ******************************************** +// access final property from +// virtual method in sub class +// ******************************************** + +DYNEXTDCLASS = new DynExtDefaultClassFin(); +AddTestCase( "access 'final' property from 'virtual' method of sub class", arr, + (EXTDCLASS.testVirtSubDPArray(arr)) ); + +test(); // leave this alone. this executes the test cases and + // displays results. + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDefaultClassFin/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDefaultClassFin/DefaultClass.as new file mode 100644 index 00000000000..2b3618393b9 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDefaultClassFin/DefaultClass.as @@ -0,0 +1,264 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DefaultClass { + + class DefaultClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + //public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + } + + public class DefaultClass extends DefaultClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDefaultClassFin/DynExtDefaultClassFin.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDefaultClassFin/DynExtDefaultClassFin.as new file mode 100644 index 00000000000..10d4018ffe6 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDefaultClassFin/DynExtDefaultClassFin.as @@ -0,0 +1,195 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + +package DefaultClass { + + import DefaultClass.*; + + dynamic class DynExtDefaultClassFinInner extends DefaultClass { + + // ************************************ + // access final method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return this.getFinArray(); } + function subSetArray(a:Array) { this.setFinArray(a); } + // this is needed so that the test cases can access this from + // outside the class. This way the test case itself preserved + public function testSubGetSetArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + // ************************************ + // access final method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return this.getFinArray(); } + public function pubSubSetArray(a:Array) { this.setFinArray(a); } + + + // ************************************ + // access final method of parent + // from private method of sub class + // ************************************ + + + private function privSubGetArray() : Array { return this.getFinArray(); } + private function privSubSetArray(a:Array) { this.setFinArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + // ************************************ + // access final method of parent + // from final method of sub class + // ************************************ + + final function finSubGetArray() : Array { return this.getFinArray(); } + final function finSubSetArray(a:Array) { this.setFinArray(a); } + // function to test above from test scripts + public function testFinSubArray(a:Array) : Array { + this.finSubSetArray(a); + return this.finSubGetArray(); + } + + // *************************************** + // access final property from + // default method of sub class + // *************************************** + + function subGetDPArray() : Array { return finArray; } + function subSetDPArray(a:Array) { finArray = a; } + + + + // ************************************ + // access final method of parent + // from virtual method of sub class + // ************************************ + + virtual function virtSubGetArray() : Array { return this.getFinArray(); } + virtual function virtSubSetArray(a:Array) { this.setFinArray(a); } + + public function testVirtSubArray(a:Array) : Array { + this.virtSubSetArray(a); + return this.virtSubGetArray(); + } + + + public function pubSubGetDPArray() : Array { return this.finArray; } + public function pubSubSetDPArray(a:Array) { this.finArray = a; } + + + // *************************************** + // access final property from + // private method of sub class + // *************************************** + + // this is needed so that the test cases can access this from + // outside the class. This way the test case itself preserved + public function testSubGetSetDPArray(a:Array) : Array { + this.subSetDPArray(a); + return this.subGetDPArray(); + } + + // *************************************** + // access final property from + // public method of sub class + // *************************************** + + private function privSubGetDPArray() : Array { return this.finArray; } + private function privSubSetDPArray(a:Array) { this.finArray = a; } + + + // this is needed so that the test cases can access this from + // outside the class. This way the test case itself preserved + public function testSubPrivDPArray(a:Array) : Array { + this.privSubSetDPArray(a); + return this.privSubGetDPArray(); + } + + final function finSubGetDPArray() : Array { return finArray; } + final function finSubSetDPArray(a:Array) { finArray = a; } + + + // this is needed so that the test cases can access this from + // outside the class. This way the test case itself preserved + public function testSubFinDPArray(a:Array) : Array { + this.finSubSetDPArray(a); + return this.finSubGetDPArray(); + } + + // *************************************** + // access default property from + // virtual method of sub class + // *************************************** + + virtual function virtSubGetDPArray() : Array { return finArray; } + virtual function virtSubSetDPArray(a:Array) { finArray = a; } + + public function testVirtSubDPArray(a:Array) : Array { + this.virtSubSetDPArray(a); + return this.virtSubGetDPArray(); + } + + + // ****************************************** + // override default method of parent class + // ****************************************** + /* + override function overLoad() { return "This is the sub class"; } + override function pubOverLoad() { return "This is the sub class"; } + override function privOverLoad() { return "This is the sub class"; } + override function statOverLoad() { return "This is the sub class"; } + override function pubStatOverLoad() { return "This is the sub class"; } + override function privStatOverLoad() { return "This is the sub class"; } + + */ + + + } + + // PUBLIC wrapper function for the dynamic class to be accessed; + // otherwise it will give the error: + // ReferenceError: DynExtDefaultClass is not defined + // at global$init() + public class DynExtDefaultClassFin extends DynExtDefaultClassFinInner {} + + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDefaultClassPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDefaultClassPub.as new file mode 100644 index 00000000000..36611a21730 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDefaultClassPub.as @@ -0,0 +1,245 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import DefaultClass.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Public Class Extends Default Class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var EXTDCLASS = new DynExtDefaultClassPub(); +var arr = new Array(10, 15, 20, 25, 30); + +// ******************************************* +// access public method of parent class from +// outside of class +// ******************************************* + +AddTestCase( "*** Access from outside of class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.setPubArray(arr), EXTDCLASS.getPubArray", arr, (EXTDCLASS.setPubArray(arr), EXTDCLASS.getPubArray()) ); + + +// ******************************************** +// access public method from a default +// method of a sub class +// +// ******************************************** + +EXTDCLASS = new DynExtDefaultClassPub(); +AddTestCase( "*** Access public method from default method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testSubArray(arr)", arr, (EXTDCLASS.testSubArray(arr)) ); + + +// ******************************************** +// access public method from a public +// method of a sub class +// +// ******************************************** + +EXTDCLASS = new DynExtDefaultClassPub(); +AddTestCase( "*** Access public method from public method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.pubSubSetArray(arr), EXTDCLASS.pubSubGetArray()", arr, (EXTDCLASS.pubSubSetArray(arr), EXTDCLASS.pubSubGetArray()) ); + + +// ******************************************** +// access public method from a private +// method of a sub class +// +// ******************************************** + +EXTDCLASS = new DynExtDefaultClassPub(); +AddTestCase( "*** Access public method from private method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testPrivSubArray(arr)", arr, EXTDCLASS.testPrivSubArray(arr) ); + + +// ******************************************** +// access public method from a final +// method of a sub class +// +// ******************************************** + +EXTDCLASS = new DynExtDefaultClassPub(); +AddTestCase( "*** Access public method from final method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testFinSubArray(arr)", arr, (EXTDCLASS.testFinSubArray(arr)) ); + +// ******************************************** +// access public method from a final +// method of a sub class +// +// ******************************************** + +EXTDCLASS = new DynExtDefaultClassPub(); +AddTestCase( "*** Access public method from final method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testPubFinSubArray(arr)", arr, (EXTDCLASS.testPubFinSubArray(arr)) ); + +// ******************************************** +// access public method from a final +// method of a sub class +// +// ******************************************** + +EXTDCLASS = new DynExtDefaultClassPub(); +AddTestCase( "*** Access public method from final method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testPrivFinSubArray(arr)", arr, (EXTDCLASS.testPrivFinSubArray(arr)) ); + +// ******************************************** +// access public method from a virtual +// method of a sub class +// +// ******************************************** + +EXTDCLASS = new DynExtDefaultClassPub(); +AddTestCase( "*** Access public method from virtual method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testVirSubArray(arr)", arr, (EXTDCLASS.testVirSubArray(arr)) ); + +// ******************************************** +// access public method from a public virtual +// method of a sub class +// +// ******************************************** + +EXTDCLASS = new DynExtDefaultClassPub(); +AddTestCase( "*** Access public method from public virtual method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testPubVirSubArray(arr)", arr, (EXTDCLASS.testPubVirSubArray(arr)) ); + +// ******************************************** +// access public method from a private virtual +// method of a sub class +// +// ******************************************** + +EXTDCLASS = new DynExtDefaultClassPub(); +AddTestCase( "*** Access public method from private virtual method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testPrivVirSubArray(arr)", arr, (EXTDCLASS.testPrivVirSubArray(arr)) ); + + + +// ******************************************** +// access public property from outside +// the class +// ******************************************** + +EXTDCLASS = new DynExtDefaultClassPub(); +AddTestCase( "*** Access public property from outside the class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.pubArray = arr", arr, (EXTDCLASS.pubArray = arr, EXTDCLASS.pubArray) ); + + +// ******************************************** +// access public property from +// default method in sub class +// ******************************************** + +EXTDCLASS = new DynExtDefaultClassPub(); +AddTestCase( "*** Access public property from default method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testSubDPArray(arr)", arr, (EXTDCLASS.testSubDPArray(arr)) ); + + +// ******************************************** +// access public property from +// public method in sub class +// ******************************************** + +EXTDCLASS = new DynExtDefaultClassPub(); +AddTestCase( "*** Access public property from public method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.pubSubSetDPArray(arr), EXTDCLASS.pubSubGetDPArray()", arr, (EXTDCLASS.pubSubSetDPArray(arr), EXTDCLASS.pubSubGetDPArray()) ); + + +// ******************************************** +// access public property from +// private method in sub class +// ******************************************** + +EXTDCLASS = new DynExtDefaultClassPub(); +AddTestCase( "*** Access public property from private method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testPrivDPArray(arr)", arr, (EXTDCLASS.testPrivDPArray(arr)) ); + + +// ******************************************** +// access public property from +// final method in sub class +// ******************************************** + +EXTDCLASS = new DynExtDefaultClassPub(); +AddTestCase( "*** Access public property from final method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testFinDPArray(arr)", arr, (EXTDCLASS.testFinDPArray(arr)) ); + +// ******************************************** +// access public property from +// public final method in sub class +// ******************************************** + +EXTDCLASS = new DynExtDefaultClassPub(); +AddTestCase( "*** Access public property from public final method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testPubFinDPArray(arr)", arr, (EXTDCLASS.testPubFinDPArray(arr)) ); + +// ******************************************** +// access public property from +// private final method in sub class +// ******************************************** + +EXTDCLASS = new DynExtDefaultClassPub(); +AddTestCase( "*** Access public property from private final method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testPrivFinDPArray(arr)", arr, (EXTDCLASS.testPrivFinDPArray(arr)) ); + +// ******************************************** +// access public property from +// virtual method in sub class +// ******************************************** + +EXTDCLASS = new DynExtDefaultClassPub(); +AddTestCase( "*** Access public property from final method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testVirDPArray(arr)", arr, (EXTDCLASS.testVirDPArray(arr)) ); + +// ******************************************** +// access public property from +// public virtual method in sub class +// ******************************************** + +EXTDCLASS = new DynExtDefaultClassPub(); +AddTestCase( "*** Access public property from public final method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testPubVirDPArray(arr)", arr, (EXTDCLASS.testPubVirDPArray(arr)) ); + +// ******************************************** +// access public property from +// private virtual method in sub class +// ******************************************** + +EXTDCLASS = new DynExtDefaultClassPub(); +AddTestCase( "*** Access public property from private final method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testPrivVirDPArray(arr)", arr, (EXTDCLASS.testPrivVirDPArray(arr)) ); + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDefaultClassPub/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDefaultClassPub/DefaultClass.as new file mode 100644 index 00000000000..2b3618393b9 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDefaultClassPub/DefaultClass.as @@ -0,0 +1,264 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DefaultClass { + + class DefaultClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + //public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + } + + public class DefaultClass extends DefaultClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDefaultClassPub/DynExtDefaultClassPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDefaultClassPub/DynExtDefaultClassPub.as new file mode 100644 index 00000000000..c90b41ef6e4 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDefaultClassPub/DynExtDefaultClassPub.as @@ -0,0 +1,272 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + +package DefaultClass { + + import DefaultClass.* + + dynamic class DynExtDefaultClassPubInner extends DefaultClass { + + // ************************************ + // access public method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return this.getPubArray(); } + function subSetArray(a:Array) { this.setPubArray(a); } + // function to test above from test scripts + public function testSubArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + // ************************************ + // access public method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return this.getPubArray(); } + public function pubSubSetArray(a:Array) { this.setPubArray(a); } + + // ************************************ + // access public method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return this.getPubArray(); } + private function privSubSetArray(a:Array) { this.setPubArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + // ************************************ + // access public method of parent + // from final method of sub class + // ************************************ + + final function finSubGetArray() : Array { return this.getPubArray(); } + final function finSubSetArray(a:Array) { this.setPubArray(a); } + // function to test above from test scripts + public function testFinSubArray(a:Array) : Array { + this.finSubSetArray(a); + return this.finSubGetArray(); + } + + // ************************************ + // access public method of parent + // from public final method of sub class + // ************************************ + + public final function pubFinSubGetArray() : Array { return this.getPubArray(); } + public final function pubFinSubSetArray(a:Array) { this.setPubArray(a); } + // function to test above from test scripts + public function testPubFinSubArray(a:Array) : Array { + this.pubFinSubSetArray(a); + return this.pubFinSubGetArray(); + } + + // ************************************ + // access public method of parent + // from private final method of sub class + // ************************************ + + private final function privFinSubGetArray() : Array { return this.getPubArray(); } + private final function privFinSubSetArray(a:Array) { this.setPubArray(a); } + // function to test above from test scripts + public function testPrivFinSubArray(a:Array) : Array { + this.privFinSubSetArray(a); + return this.privFinSubGetArray(); + } + + // ************************************ + // access public method of parent + // from virtual method of sub class + // ************************************ + + virtual function virSubGetArray() : Array { return this.getPubArray(); } + virtual function virSubSetArray(a:Array) { this.setPubArray(a); } + // function to test above from test scripts + public function testVirSubArray(a:Array) : Array { + this.virSubSetArray(a); + return this.virSubGetArray(); + } + + // ************************************ + // access public method of parent + // from public virtual method of sub class + // ************************************ + + public virtual function pubVirSubGetArray() : Array { return this.getPubArray(); } + public virtual function pubVirSubSetArray(a:Array) { this.setPubArray(a); } + // function to test above from test scripts + public function testPubVirSubArray(a:Array) : Array { + this.pubVirSubSetArray(a); + return this.pubVirSubGetArray(); + } + + // ************************************ + // access public method of parent + // from private virtual method of sub class + // ************************************ + + private virtual function privVirSubGetArray() : Array { return this.getPubArray(); } + private virtual function privVirSubSetArray(a:Array) { this.setPubArray(a); } + // function to test above from test scripts + public function testPrivVirSubArray(a:Array) : Array { + this.pubVirSubSetArray(a); + return this.pubVirSubGetArray(); + } + + // *************************************** + // access public property from + // default method of sub class + // *************************************** + + function subGetDPArray() : Array { return this.pubArray; } + function subSetDPArray(a:Array) { this.pubArray = a; } + // function to test above from test scripts + public function testSubDPArray(a:Array) : Array { + this.subSetDPArray(a); + return this.subGetDPArray(); + } + + // *************************************** + // access public property from + // public method of sub class + // *************************************** + + public function pubSubGetDPArray() : Array { return this.pubArray; } + public function pubSubSetDPArray(a:Array) { this.pubArray = a; } + + // *************************************** + // access public property from + // private method of sub class + // *************************************** + + private function privSubGetDPArray() : Array { return this.pubArray; } + private function privSubSetDPArray(a:Array) { this.pubArray = a; } + // function to test above from test scripts + public function testPrivDPArray(a:Array) : Array { + this.privSubSetDPArray(a); + return this.privSubGetDPArray(); + } + + // *************************************** + // access public property from + // final method of sub class + // *************************************** + + final function finSubGetDPArray() : Array { return this.pubArray; } + final function finSubSetDPArray(a:Array) { this.pubArray = a; } + // function to test above from test scripts + public function testFinDPArray(a:Array) : Array { + this.finSubSetDPArray(a); + return this.finSubGetDPArray(); + } + + // *************************************** + // access public property from + // public final method of sub class + // *************************************** + + public final function pubFinSubGetDPArray() : Array { return this.pubArray; } + public final function pubFinSubSetDPArray(a:Array) { this.pubArray = a; } + // function to test above from test scripts + public function testPubFinDPArray(a:Array) : Array { + this.pubFinSubSetDPArray(a); + return this.pubFinSubGetDPArray(); + } + + // *************************************** + // access public property from + // private final method of sub class + // *************************************** + + private final function privFinSubGetDPArray() : Array { return this.pubArray; } + private final function privFinSubSetDPArray(a:Array) { this.pubArray = a; } + // function to test above from test scripts + public function testPrivFinDPArray(a:Array) : Array { + this.privFinSubSetDPArray(a); + return this.pubFinSubGetDPArray(); + } + + // *************************************** + // access public property from + // virtual method of sub class + // *************************************** + + virtual function virSubGetDPArray() : Array { return this.pubArray; } + virtual function virSubSetDPArray(a:Array) { this.pubArray = a; } + // function to test above from test scripts + public function testVirDPArray(a:Array) : Array { + this.virSubSetDPArray(a); + return this.virSubGetDPArray(); + } + + // *************************************** + // access public property from + // public final method of sub class + // *************************************** + + public virtual function pubVirSubGetDPArray() : Array { return this.pubArray; } + public virtual function pubVirSubSetDPArray(a:Array) { this.pubArray = a; } + // function to test above from test scripts + public function testPubVirDPArray(a:Array) : Array { + this.pubFinSubSetDPArray(a); + return this.pubFinSubGetDPArray(); + } + + // *************************************** + // access public property from + // private final method of sub class + // *************************************** + + private virtual function privVirSubGetDPArray() : Array { return this.pubArray; } + private virtual function privVirSubSetDPArray(a:Array) { this.pubArray = a; } + // function to test above from test scripts + public function testPrivVirDPArray(a:Array) : Array { + this.privFinSubSetDPArray(a); + return this.pubFinSubGetDPArray(); + } + + } + // PUBLIC wrapper function for the dynamic class to be accessed; + // otherwise it will give the error: + // ReferenceError: DynExtDefaultClass is not defined + // at global$init() + public class DynExtDefaultClassPub extends DynExtDefaultClassPubInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDefaultClassPubStat.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDefaultClassPubStat.as new file mode 100644 index 00000000000..b174a4e1ad0 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDefaultClassPubStat.as @@ -0,0 +1,135 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import DefaultClass.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "public static extend Default Class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + +arr = new Array(1, 2, 3); + + +// ******************************************** +// access public static method from a public static +// method of a sub class +// +// ******************************************** + +AddTestCase( "*** Access public static method from public static method of sub class ***", 1, 1 ); +AddTestCase( "DynExtDefaultClassPubStat.pubStatSubSetArray(arr), DynExtDefaultClassPubStat.pubStatSubGetArray()", arr, + (DynExtDefaultClassPubStat.pubStatSubSetArray(arr), DynExtDefaultClassPubStat.pubStatSubGetArray()) ); + +// ******************************************** +// access public static method from a private static +// method of a sub class +// +// ******************************************** + +var EXTDEFAULTCLASS = new DynExtDefaultClassPubStat(); +AddTestCase( "*** Access public static method from private static method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testPrivStatSubArray(arr)", arr, + EXTDCLASS.testPrivStatSubArray(arr) ); + + +// ******************************************** +// access public static property from +// default method in sub class +// ******************************************** + +EXTDCLASS = new DynExtDefaultClassPubStat(); +AddTestCase( "*** Access public static property from default method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testPubStatDefSubArray(arr)", arr, (EXTDCLASS.testPubStatDefSubArray(arr)) ); + + +// ******************************************** +// access public static property from +// public method in sub class +// ******************************************** + +EXTDCLASS = new DynExtDefaultClassPubStat(); +AddTestCase( "*** Access public static property from public method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.pubSubSetDPArray(arr), EXTDCLASS.pubSubGetDPArray()", arr, (EXTDCLASS.pubSubSetDPArray(arr), EXTDCLASS.pubSubGetDPArray()) ); +// ******************************************** +// access public static property from +// private method in sub class +// ******************************************** + +EXTDCLASS = new DynExtDefaultClassPubStat(); +AddTestCase( "*** Access public static property from private method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testPrivStatSubDPArray(arr)", arr, (EXTDCLASS.testPrivStatSubDPArray(arr)) ); + + +// ******************************************** +// access public static property from +// final method in sub class +// ******************************************** + +EXTDCLASS = new DynExtDefaultClassPubStat(); +AddTestCase( "*** Access public static property from final method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testPrivStatFinSubDPArray(arr)", arr, (EXTDCLASS.testPrivStatFinSubDPArray(arr)) ); + +// ******************************************** +// access public static property from +// static method in sub class +// ******************************************** + +AddTestCase( "*** Access public static property from static method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testStatSubDPArray(arr)", arr, + (EXTDCLASS.testStatSubDPArray(arr)) ); +/* +// ******************************************** +// access public static property from +// public static method in sub class +// ******************************************** + +AddTestCase( "*** Access public static property from public static method in sub class ***", 1, 1 ); +AddTestCase( "PubExtDefaultClassPubStat.pubStatSubSetSPArray(arr), PubExtDefaultClassPubStat.pubStatSubGetSPArray()", arr, + (PubExtDefaultClassPubStat.pubStatSubSetSPArray(arr), PubExtDefaultClassPubStat.pubStatSubGetSPArray()) ); + +// ******************************************** +// access public static property from +// private static method in sub class +// ******************************************** + +EXTDCLASS = new DynExtDefaultClassPubStat(); +AddTestCase( "*** Access public static property from private static method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testPrivStatSubPArray(arr)", arr, + EXTDCLASS.testPrivStatSubPArray(arr)); +*/ + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDefaultClassPubStat/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDefaultClassPubStat/DefaultClass.as new file mode 100644 index 00000000000..2b3618393b9 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDefaultClassPubStat/DefaultClass.as @@ -0,0 +1,264 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DefaultClass { + + class DefaultClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + //public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + } + + public class DefaultClass extends DefaultClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDefaultClassPubStat/DynExtDefaultClassPubStat.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDefaultClassPubStat/DynExtDefaultClassPubStat.as new file mode 100644 index 00000000000..02b95702afe --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDefaultClassPubStat/DynExtDefaultClassPubStat.as @@ -0,0 +1,231 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DefaultClass { + + import DefaultClass.* + + + dynamic class DynExtDefaultClassPubStatInner extends DefaultClass { + + // ************************************ + // access public static method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return getPubStatArray(); } + function subSetArray(a:Array) { setPubStatArray(a); } + + // function to test above from test scripts + public function testDefSubArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + + // ************************************ + // access public static method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return getPubStatArray(); } + public function pubSubSetArray(a:Array) { setPubStatArray(a); } + + // ************************************ + // access public static method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return getPubStatArray(); } + private function privSubSetArray(a:Array) { setPubStatArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + // ************************************ + // access public static method of parent + // from final method of sub class + // ************************************ + + final function finSubGetArray() : Array { return getPubStatArray(); } + final function finSubSetArray(a:Array) { setPubStatArray(a); } + + // function to test above from test scripts + public function testFinSubArray(a:Array) : Array { + this.finSubSetArray(a); + return this.finSubGetArray(); + } + + // *************************************** + // access public static method of parent + // from static method of sub class + // *************************************** + + static function statSubGetArray() : Array { return getPubStatArray(); } + static function statSubSetArray(a:Array) { setPubStatArray(a); } + + // function to test above from test scripts + public function testStatSubArray(a:Array) : Array { + this.statSubSetArray(a); + return this.statSubGetArray(); + } + + // *************************************** + // access public static method of parent + // from public static method of sub class + // *************************************** + + public static function pubStatSubGetArray() : Array { return getPubStatArray(); } + public static function pubStatSubSetArray(a:Array) { setPubStatArray(a); } + + // *************************************** + // access public static method of parent + // from private static method of sub class + // *************************************** + + private static function privStatSubGetArray() : Array { return getPubStatArray(); } + private static function privStatSubSetArray(a:Array) { setPubStatArray(a); } + + // public accessor to test asrt + public function testPrivStatSubArray(a:Array) : Array { + privStatSubSetArray(a); + return privStatSubGetArray(); + } + + // *************************************** + // access public static property from + // default method of sub class + // *************************************** + + function subGetDPArray() : Array { return pubStatArray; } + function subSetDPArray(a:Array) { pubStatArray = a; } + + // public accessor to test asrt + public function testPubStatDefSubArray(a:Array) : Array { + subSetDPArray(a); + return subGetDPArray(); + } + + // *************************************** + // access public static property from + // public method of sub class + // *************************************** + + public function pubSubGetDPArray() : Array { return pubStatArray; } + public function pubSubSetDPArray(a:Array) { pubStatArray = a; } + + // *************************************** + // access public static property from + // private method of sub class + // *************************************** + + private function privSubGetDPArray() : Array { return pubStatArray; } + private function privSubSetDPArray(a:Array) { pubStatArray = a; } + // public accessor to test asrt + public function testPrivStatSubDPArray(a:Array) : Array { + privSubSetDPArray(a); + return privSubGetDPArray(); + } + + + // *************************************** + // access public static property from + // final method of sub class + // *************************************** + + final function finSubGetDPArray() : Array { return pubStatArray; } + final function finSubSetDPArray(a:Array) { pubStatArray = a; } + // public accessor to test asrt + public function testPrivStatFinSubDPArray(a:Array) : Array { + finSubSetDPArray(a); + return finSubGetDPArray(); + } + + // *************************************** + // access public static property from + // static method of sub class + // *************************************** + + static function statSubGetSPArray() : Array { return pubStatArray; } + static function statSubSetSPArray(a:Array) { pubStatArray = a; } + // public accessor to test asrt + public function testStatSubDPArray(a:Array) : Array { + statSubSetSPArray(a); + return statSubGetSPArray(); + } + + // *************************************** + // access public static property from + // public static method of sub class + // *************************************** + + public static function pubStatSubGetSPArray() : Array { return pubStatArray; } + public static function pubStatSubSetSPArray(a:Array) { pubStatArray = a; } + + // *************************************** + // access public static property from + // private static method of sub class + // *************************************** + + private static function privStatSubGetSPArray() : Array { return pubStatArray; } + private static function privStatSubSetSPArray(a:Array) { pubStatArray = a; } + + // public accessor for asrt + public function testPrivStatSubPArray(a:Array) : Array { + privStatSubSetSPArray( a ); + return privStatSubGetSPArray(); + } + + } + public class DynExtDefaultClassPubStat extends DynExtDefaultClassPubStatInner{ + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { DefaultClassInner.setPubStatArray(a); } + public static function setPubStatBoolean( b:Boolean ) { DefaultClassInner.setPubStatBoolean(b); } + + public static function getPubStatArray() { return DefaultClassInner.getPubStatArray(); } + + // *************************************** + // access public static method of parent + // from public static method of sub class + // *************************************** + + public static function pubStatSubGetArray() : Array { return DynExtDefaultClassPubStatInner.pubStatSubGetArray(); } + public static function pubStatSubSetArray(a:Array) { DynExtDefaultClassPubStatInner.pubStatSubSetArray(a); } + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDefaultClassStat.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDefaultClassStat.as new file mode 100644 index 00000000000..f1670a53184 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDefaultClassStat.as @@ -0,0 +1,184 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import DefaultClass.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "static extend Default Class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +EXTDCLASS = new DynExtDefaultClassStat(); +arr = new Array(1, 2, 3); + +// ******************************************** +// access static method from a default +// method of a sub class +// +// ******************************************** + +EXTDCLASS = new DynExtDefaultClassStat(); +AddTestCase( "*** Access static method from default method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testSubArray(arr)", arr, (EXTDCLASS.testSubArray(arr)) ); + + +// ******************************************** +// access static method from a public +// method of a sub class +// +// ******************************************** + +EXTDCLASS = new DynExtDefaultClassStat(); +AddTestCase( "*** Access static method from public method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.pubSubSetArray(arr), EXTDCLASS.pubSubGetArray()", arr, (EXTDCLASS.pubSubSetArray(arr), EXTDCLASS.pubSubGetArray()) ); + +// ******************************************** +// access static method from a private +// method of a sub class +// +// ******************************************** + +EXTDCLASS = new DynExtDefaultClassStat(); +AddTestCase( "*** Access static method from private method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testPrivSubArray(arr)", arr, EXTDCLASS.testPrivSubArray(arr) ); + +// ******************************************** +// access static method from a final +// method of a sub class +// +// ******************************************** + +EXTDCLASS = new DynExtDefaultClassStat(); +AddTestCase( "access static method from final method of sub class", arr, (EXTDCLASS.testFinSubArray(arr)) ); + +// ******************************************** +// access static method from a static +// method of a sub class +// +// ******************************************** +/* +AddTestCase( "*** Access static method from static method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testStatSubArray(arr)", arr, + (EXTDCLASS.testStatSubArray(arr)) ); + +// ******************************************** +// access static method from a public static +// method of a sub class +// +// ******************************************** + +AddTestCase( "*** Access static method from public static method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testPubStatSubArray(arr)", arr, + (EXTDCLASS.testPubStatSubArray(arr)) ); +*/ +// ******************************************** +// access static method from a private static +// method of a sub class +// +// ******************************************** + +var EXTDEFAULTCLASS = new DynExtDefaultClassStat(); +AddTestCase( "*** Access static method from private static method of sub class ***", 1, 1 ); +AddTestCase( "EXTDEFAULTCLASS.testPrivStatSubArray(arr)", arr, + EXTDEFAULTCLASS.testPrivStatSubArray(arr) ); + +// ******************************************** +// access static property from +// default method in sub class +// ******************************************** + +EXTDCLASS = new DynExtDefaultClassStat(); +AddTestCase( "*** Access static property from default method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testSubPArray(arr)", arr, (EXTDCLASS.testSubPArray(arr)) ); + + +// ******************************************** +// access static property from +// public method in sub class +// ******************************************** + +EXTDCLASS = new DynExtDefaultClassStat(); +AddTestCase( "*** Access static property from public method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.pubSubSetDPArray(arr), EXTDCLASS.pubSubGetDPArray()", arr, (EXTDCLASS.pubSubSetDPArray(arr), EXTDCLASS.pubSubGetDPArray()) ); + + +// ******************************************** +// access static property from +// private method in sub class +// ******************************************** + +EXTDCLASS = new DynExtDefaultClassStat(); +AddTestCase( "*** Access static property from private method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testPrivSubPArray(arr)", arr, (EXTDCLASS.testPrivSubPArray(arr)) ); + + +// ******************************************** +// access static property from +// static method in sub class +// ******************************************** + +AddTestCase( "*** Access static property from static method in sub class ***", 1, 1 ); +/*AddTestCase( "ExtDefaultClassStat.statSubSetSPArray(arr), ExtDefaultClassStat.statSubGetSPArray()", arr, + (ExtDefaultClassStat.statSubSetSPArray(arr), ExtDefaultClassStat.statSubGetSPArray()) ); +*/ +// ******************************************** +// access static property from +// public static method in sub class +// ******************************************** + +AddTestCase( "*** Access static property from public static method in sub class ***", 1, 1 ); +/*AddTestCase( "ExtDefaultClassStat.pubStatSubSetSPArray(arr), ExtDefaultClassStat.pubStatSubGetSPArray()", arr, + (ExtDefaultClassStat.pubStatSubSetSPArray(arr), ExtDefaultClassStat.pubStatSubGetSPArray()) ); +*/ +// ******************************************** +// access static property from +// private static method in sub class +// ******************************************** + +EXTDCLASS = new DynExtDefaultClassStat(); +AddTestCase( "*** Access static property from private static method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testPrivStatSubPArray(arr)", arr, + EXTDCLASS.testPrivStatSubPArray(arr)); + +// ******************************************** +// access static property from +// final method in sub class +// ******************************************** + +EXTDCLASS = new DynExtDefaultClassStat(); +AddTestCase( "*** Access static property from final method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testFinSubPArray(arr)", arr, (EXTDCLASS.testFinSubPArray(arr)) ); + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDefaultClassStat/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDefaultClassStat/DefaultClass.as new file mode 100644 index 00000000000..2b3618393b9 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDefaultClassStat/DefaultClass.as @@ -0,0 +1,264 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DefaultClass { + + class DefaultClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + //public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + } + + public class DefaultClass extends DefaultClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDefaultClassStat/DynExtDefaultClassStat.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDefaultClassStat/DynExtDefaultClassStat.as new file mode 100644 index 00000000000..746a9958972 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDefaultClassStat/DynExtDefaultClassStat.as @@ -0,0 +1,209 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DefaultClass { + + import DefaultClass.* + + dynamic class DynExtDefaultClassStatInner extends DefaultClass { + + // ************************************ + // access static method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return getStatArray(); } + function subSetArray(a:Array) { setStatArray(a); } + + // function to test above from test scripts + public function testSubArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + + // ************************************ + // access static method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return getStatArray(); } + public function pubSubSetArray(a:Array) { setStatArray(a); } + + // ************************************ + // access static method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return getStatArray(); } + private function privSubSetArray(a:Array) { setStatArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + // ************************************ + // access static method of parent + // from final method of sub class + // ************************************ + + final function finSubGetArray() : Array { return getStatArray(); } + final function finSubSetArray(a:Array) { setStatArray(a); } + // function to test above from test scripts + public function testFinSubArray(a:Array) : Array { + this.finSubSetArray(a); + return this.finSubGetArray(); + } + + + // *************************************** + // access static method of parent + // from static method of sub class + // *************************************** + + static function statSubGetArray() : Array { return getStatArray(); } + static function statSubSetArray(a:Array) { setStatArray(a); } + // function to test above from test scripts + public function testStatSubArray(a:Array) : Array { + this.statSubSetArray(a); + return this.statSubGetArray(); + } + + // *************************************** + // access static method of parent + // from public static method of sub class + // *************************************** + + public static function pubStatSubGetArray() : Array { return getStatArray(); } + public static function pubStatSubSetArray(a:Array) { setStatArray(a); } + // function to test above from test scripts + public function testPubStatSubArray(a:Array) : Array { + pubStatSubSetArray(a); + return this.pubStatSubGetArray(); + } + + // *************************************** + // access static method of parent + // from private static method of sub class + // *************************************** + + private static function privStatSubGetArray() : Array { return getStatArray(); } + private static function privStatSubSetArray(a:Array) { setStatArray(a); } + + // public accessor to test asrt + public function testPrivStatSubArray(a:Array) : Array { + privStatSubSetArray(a); + return privStatSubGetArray(); + } + + // *************************************** + // access static property from + // default method of sub class + // *************************************** + + function subGetDPArray() : Array { return statArray; } + function subSetDPArray(a:Array) { statArray = a; } + // public accessor for asrt + public function testSubPArray(a:Array) : Array { + this.subSetDPArray( a ); + return subGetDPArray(); + } + + // *************************************** + // access static property from + // public method of sub class + // *************************************** + + public function pubSubGetDPArray() : Array { return statArray; } + public function pubSubSetDPArray(a:Array) { statArray = a; } + + // *************************************** + // access static property from + // private method of sub class + // *************************************** + + private function privSubGetDPArray() : Array { return statArray; } + private function privSubSetDPArray(a:Array) { statArray = a; } + // public accessor for asrt + public function testPrivSubPArray(a:Array) : Array { + this.privSubSetDPArray( a ); + return privSubGetDPArray(); + } + + // *************************************** + // access static property from + // final method of sub class + // *************************************** + + final function finSubGetDPArray() : Array { return statArray; } + final function finSubSetDPArray(a:Array) { statArray = a; } + // public accessor for asrt + public function testFinSubPArray(a:Array) : Array { + this.finSubSetDPArray( a ); + return finSubGetDPArray(); + } + + + // *************************************** + // access static property from + // static method of sub class + // *************************************** + + static function statSubGetSPArray() : Array { return statArray; } + static function statSubSetSPArray(a:Array) { statArray = a; } + + // *************************************** + // access static property from + // public static method of sub class + // *************************************** + + public static function pubStatSubGetSPArray() : Array { return statArray; } + public static function pubStatSubSetSPArray(a:Array) { statArray = a; } + + // *************************************** + // access static property from + // private static method of sub class + // *************************************** + + private static function privStatSubGetSPArray() : Array { return statArray; } + private static function privStatSubSetSPArray(a:Array) { statArray = a; } + + // public accessor for asrt + public function testPrivStatSubPArray(a:Array) : Array { + privStatSubSetSPArray( a ); + return privStatSubGetSPArray(); + } + } + + public class DynExtDefaultClassStat extends DynExtDefaultClassStatInner {} +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDynamicClass.as new file mode 100644 index 00000000000..083d53ee1d8 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDynamicClass.as @@ -0,0 +1,42 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import DynamicClass.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "dynamic extend Dynamic Class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDynamicClass/ADynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDynamicClass/ADynamicClass.as new file mode 100644 index 00000000000..6dee1fbd55b --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDynamicClass/ADynamicClass.as @@ -0,0 +1,243 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DynamicClass { + + + dynamic class DynamicClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + // public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // **************** + // constructor + // **************** + + function DynamicClass() { + } + + // ***************** + // default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + } + public class DynamicClass extends DynamicClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDynamicClass/DynExtDynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDynamicClass/DynExtDynamicClass.as new file mode 100644 index 00000000000..19fb9632b83 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDynamicClass/DynExtDynamicClass.as @@ -0,0 +1,143 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DynamicClass { + + import DynamicClass.*; + + dynamic class DynExtDynamicClassInner extends DynamicClass { + + // ************************************ + // access default method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return this.getArray(); } + function subSetArray(a:Array) { this.setArray(a); } + // function to test above from test scripts + public function testSubArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + // ************************************ + // access default method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return this.getArray(); } + public function pubSubSetArray(a:Array) { this.setArray(a); } + + // ************************************ + // access default method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return this.getArray(); } + private function privSubSetArray(a:Array) { this.setArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + // ************************************ + // access default method of parent + // from final method of sub class + // ************************************ + + final function finSubGetArray() : Array { return this.getArray(); } + final function finSubSetArray(a:Array) { this.setArray(a); } + // function to test above from test scripts + public function testFinSubArray(a:Array) : Array { + this.finSubSetArray(a); + return this.finSubGetArray(); + } + + // *************************************** + // access default property from + // default method of sub class + // *************************************** + + function subGetDPArray() : Array { return array; } + function subSetDPArray(a:Array) { array = a; } + // function to test above from test scripts + public function testSubGetDPArray(a:Array) : Array { + this.subSetDPArray(a); + return this.subGetDPArray(); + } + + // *************************************** + // access default property from + // public method of sub class + // *************************************** + + public function pubSubGetDPArray() : Array { return this.array; } + public function pubSubSetDPArray(a:Array) { this.array = a; } + + // *************************************** + // access default property from + // private method of sub class + // *************************************** + + private function privSubGetDPArray() : Array { return this.array; } + private function privSubSetDPArray(a:Array) { this.array = a; } + // function to test above from test scripts + public function testPrivSubGetDPArray(a:Array) : Array { + this.privSubSetDPArray(a); + return this.privSubGetDPArray(); + } + + // *************************************** + // access default property from + // final method of sub class + // *************************************** + + final function finSubGetDPArray() : Array { return array; } + final function finSubSetDPArray(a:Array) { array = a; } + // function to test above from test scripts + public function testFinSubGetDPArray(a:Array) : Array { + this.finSubSetDPArray(a); + return this.finSubGetDPArray(); + } + + + + + } + + // PUBLIC wrapper function for the dynamic class to be accessed; + // otherwise it will give the error: + // ReferenceError: DynExtDefaultClass is not defined + // at global$init() + public class DynExtDynamicClass extends DynExtDynamicClassInner {} +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDynamicClassFin.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDynamicClassFin.as new file mode 100644 index 00000000000..9d84a4e8894 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDynamicClassFin.as @@ -0,0 +1,43 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + +import DynamicClass.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "dynamic class extend dynamic class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDynamicClassFin/ADynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDynamicClassFin/ADynamicClass.as new file mode 100644 index 00000000000..6dee1fbd55b --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDynamicClassFin/ADynamicClass.as @@ -0,0 +1,243 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DynamicClass { + + + dynamic class DynamicClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + // public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // **************** + // constructor + // **************** + + function DynamicClass() { + } + + // ***************** + // default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + } + public class DynamicClass extends DynamicClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDynamicClassFin/DynExtDynamicClassFin.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDynamicClassFin/DynExtDynamicClassFin.as new file mode 100644 index 00000000000..ac3e1df281a --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDynamicClassFin/DynExtDynamicClassFin.as @@ -0,0 +1,174 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DynamicClass { + + import DynamicClass.*; + + dynamic class DynExtDynamicClassFinInner extends DynamicClass { + + // ************************************ + // access final method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return this.getFinArray(); } + function subSetArray(a:Array) { this.setFinArray(a); } + + // function to test above from test scripts + public function testSubArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + // ************************************ + // access final method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return this.getFinArray(); } + public function pubSubSetArray(a:Array) { this.setFinArray(a); } + + // ************************************ + // access final method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return this.getFinArray(); } + private function privSubSetArray(a:Array) { this.setFinArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + // ************************************ + // access final method of parent + // from final method of sub class + // ************************************ + + final function finSubGetArray() : Array { return this.getFinArray(); } + final function finSubSetArray(a:Array) { this.setFinArray(a); } + + // function to test above from test scripts + public function testFinSubArray(a:Array) : Array { + this.finSubSetArray(a); + return this.finSubGetArray(); + } + + // ************************************ + // access final method of parent + // from private final method of sub class + // ************************************ + + private final function finPrivSubGetArray() : Array { return this.getFinArray(); } + private final function finPrivSubSetArray(a:Array) { this.setFinArray(a); } + + // function to test above from test scripts + public function testPrivFinSubArray(a:Array) : Array { + this.finPrivSubSetArray(a); + return this.finPrivSubGetArray(); + } + + virtual function virSubGetArray() : Array { return this.getFinArray(); } + virtual function virSubSetArray(a:Array) { this.setFinArray(a); } + + // function to test above from test scripts + public function testVirSubArray(a:Array) : Array { + this.virSubSetArray(a); + return this.virSubGetArray(); + } + + // *************************************** + // access final property from + // default method of sub class + // *************************************** + + function subGetDPArray() : Array { return finArray; } + function subSetDPArray(a:Array) { finArray = a; } + // function to test above from test scripts + public function testSubGetDPArray(a:Array) : Array { + this.subSetDPArray(a); + return this.subGetDPArray(); + } + + + // *************************************** + // access final property from + // public method of sub class + // *************************************** + + public function pubSubGetDPArray() : Array { return this.finArray; } + public function pubSubSetDPArray(a:Array) { this.finArray = a; } + + // *************************************** + // access final property from + // private method of sub class + // *************************************** + + private function privSubGetDPArray() : Array { return this.finArray; } + private function privSubSetDPArray(a:Array) { this.finArray = a; } + // function to test above from test scripts + public function testPrivSubGetDPArray(a:Array) : Array { + this.finSubSetDPArray(a); + return this.finSubGetDPArray(); + } + + // *************************************** + // access final property from + // final method of sub class + // *************************************** + + final function finSubGetDPArray() : Array { return finArray; } + final function finSubSetDPArray(a:Array) { finArray = a; } + // function to test above from test scripts + public function testFinSubGetDPArray(a:Array) : Array { + this.finSubSetDPArray(a); + return this.finSubGetDPArray(); + } + + // *************************************** + // access final property from + // private virtual method of sub class + // *************************************** + + public virtual function privVirSubGetDPArray() : Array { return finArray; } + public virtual function privVirSubSetDPArray(a:Array) { finArray = a; } + // function to test above from test scripts + public function testPrivVirSubGetDPArray(a:Array) : Array { + this.privVirSubSetDPArray(a); + return this.privVirSubGetDPArray(); + } + + } + public class DynExtDynamicClassFin extends DynExtDynamicClassFinInner {} +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDynamicClassPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDynamicClassPub.as new file mode 100644 index 00000000000..59f7a31bdba --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDynamicClassPub.as @@ -0,0 +1,43 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import DynamicClass.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "public extend Dynamic Class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var EXTDCLASS = new DynExtDynamicClassPub(); + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDynamicClassPub/ADynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDynamicClassPub/ADynamicClass.as new file mode 100644 index 00000000000..6dee1fbd55b --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDynamicClassPub/ADynamicClass.as @@ -0,0 +1,243 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DynamicClass { + + + dynamic class DynamicClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + // public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // **************** + // constructor + // **************** + + function DynamicClass() { + } + + // ***************** + // default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + } + public class DynamicClass extends DynamicClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDynamicClassPub/DynExtDynamicClassPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDynamicClassPub/DynExtDynamicClassPub.as new file mode 100644 index 00000000000..99ff637894e --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDynamicClassPub/DynExtDynamicClassPub.as @@ -0,0 +1,135 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DynamicClass { + + import DynamicClass.*; + + dynamic class DynExtDynamicClassPubInner extends DynamicClass { + + // ************************************ + // access public method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return this.getPubArray(); } + function subSetArray(a:Array) { this.setPubArray(a); } + // function to test above from test scripts + public function testSubArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + // ************************************ + // access public method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return this.getPubArray(); } + public function pubSubSetArray(a:Array) { this.setPubArray(a); } + + // ************************************ + // access public method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return this.getPubArray(); } + private function privSubSetArray(a:Array) { this.setPubArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + // ************************************ + // access public method of parent + // from final method of sub class + // ************************************ + + final function finSubGetArray() : Array { return this.getPubArray(); } + final function finSubSetArray(a:Array) { this.setPubArray(a); } + // function to test above from test scripts + public function testFinSubArray(a:Array) : Array { + this.finSubSetArray(a); + return this.finSubGetArray(); + } + + // *************************************** + // access public property from + // default method of sub class + // *************************************** + + function subGetDPArray() : Array { return pubArray; } + function subSetDPArray(a:Array) { pubArray = a; } + // function to test above from test scripts + public function testSubDPArray(a:Array) : Array { + this.subSetDPArray(a); + return this.subGetDPArray(); + } + + // *************************************** + // access public property from + // public method of sub class + // *************************************** + + public function pubSubGetDPArray() : Array { return this.pubArray; } + public function pubSubSetDPArray(a:Array) { this.pubArray = a; } + + // *************************************** + // access public property from + // private method of sub class + // *************************************** + + private function privSubGetDPArray() : Array { return this.pubArray; } + private function privSubSetDPArray(a:Array) { this.pubArray = a; } + // function to test above from test scripts + public function testPrivSubDPArray(a:Array) : Array { + this.privSubSetDPArray(a); + return this.privSubGetDPArray(); + } + + // *************************************** + // access public property from + // final method of sub class + // *************************************** + + final function finSubGetDPArray() : Array { return pubArray; } + final function finSubSetDPArray(a:Array) { pubArray = a; } + // function to test above from test scripts + public function testFinSubDPArray(a:Array) : Array { + this.finSubSetDPArray(a); + return this.finSubGetDPArray(); + } + + } + public class DynExtDynamicClassPub extends DynExtDynamicClassPubInner {} +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDynamicClassPubStat.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDynamicClassPubStat.as new file mode 100644 index 00000000000..64f43759938 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDynamicClassPubStat.as @@ -0,0 +1,165 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import DynamicClass.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "Clean AS2"; // Version of JavaScript or ECMA +var TITLE = "Extend Dynamic Class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + +arr = new Array(1, 2, 3); + +// ******************************************** +// access public static method from a default +// method of a sub class +// +// ******************************************** + +EXTDCLASS = new DynExtDynamicClassPubStat(); +AddTestCase( "*** Access public static method from default method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testSubArray(arr)", arr, (EXTDCLASS.testSubArray(arr)) ); + + +// ******************************************** +// access public static method from a public +// method of a sub class +// +// ******************************************** + +EXTDCLASS = new DynExtDynamicClassPubStat(); +AddTestCase( "*** Access public static method from public method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.pubSubSetArray(arr), EXTDCLASS.pubSubGetArray()", arr, (EXTDCLASS.pubSubSetArray(arr), EXTDCLASS.pubSubGetArray()) ); + + +// ******************************************** +// access public static method from a private +// method of a sub class +// +// ******************************************** + +EXTDCLASS = new DynExtDynamicClassPubStat(); +AddTestCase( "*** Access public static method from private method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testPrivSubArray(arr)", arr, EXTDCLASS.testPrivSubArray(arr) ); + + +// ******************************************** +// access public static method from a final +// method of a sub class +// +// ******************************************** + +EXTDCLASS = new DynExtDynamicClassPubStat(); +AddTestCase( "*** Access public static method from final method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testFinSubArray(arr)", arr, (EXTDCLASS.testFinSubArray(arr)) ); + +// ******************************************** +// access public static method from a static +// method of a sub class +// +// ******************************************** +/* +AddTestCase( "*** Access public static method from static method of sub class ***", 1, 1 ); +AddTestCase( "PubExtDynamicClassPubStat.statSubSetArray(arr), PubExtDynamicClassPubStat.statSubGetArray()", arr, + (PubExtDynamicClassPubStat.statSubSetArray(arr), PubExtDynamicClassPubStat.statSubGetArray()) ); + + +// ******************************************** +// access public static method from a public static +// method of a sub class +// +// ******************************************** + +AddTestCase( "*** Access public static method from public static method of sub class ***", 1, 1 ); +AddTestCase( "PubExtDynamicClassPubStat.pubStatSubSetArray(arr), PubExtDynamicClassPubStat.pubStatSubGetArray()", arr, + (PubExtDynamicClassPubStat.pubStatSubSetArray(arr), PubExtDynamicClassPubStat.pubStatSubGetArray()) ); + + +// ******************************************** +// access public static method from a private static +// method of a sub class +// +// ******************************************** + +var EXTDEFAULTCLASS = new DynExtDynamicClassPubStat(); +AddTestCase( "*** Access public static method from private static method of sub class ***", 1, 1 ); +AddTestCase( "EXTDEFAULTCLASS.testPrivStatSubArray(arr)", arr, + EXTDEFAULTCLASS.testPrivStatSubArray(arr) ); + +*/ +// ******************************************** +// access public static property from +// default method in sub class +// ******************************************** + +EXTDCLASS = new DynExtDynamicClassPubStat(); +AddTestCase( "*** Access public static property from default method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testSubDPArray(arr)", arr, (EXTDCLASS.testSubDPArray(arr)) ); + + + +// ******************************************** +// access public static property from +// public method in sub class +// ******************************************** + +EXTDCLASS = new DynExtDynamicClassPubStat(); +AddTestCase( "*** Access public static property from public method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.pubSubSetDPArray(arr), EXTDCLASS.pubSubGetDPArray()", arr, (EXTDCLASS.pubSubSetDPArray(arr), EXTDCLASS.pubSubGetDPArray()) ); + + +// ******************************************** +// access public static property from +// private method in sub class +// ******************************************** + +EXTDCLASS = new DynExtDynamicClassPubStat(); +AddTestCase( "*** Access public static property from private method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testPrivSubDPArray(arr)", arr, (EXTDCLASS.testPrivSubDPArray(arr)) ); + + + + +// ******************************************** +// access public static property from +// final method in sub class +// ******************************************** + +EXTDCLASS = new DynExtDynamicClassPubStat(); +AddTestCase( "*** Access public static property from final method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testFinSubPArray(arr)", arr, (EXTDCLASS.testFinSubPArray(arr)) ); + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDynamicClassPubStat/ADynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDynamicClassPubStat/ADynamicClass.as new file mode 100644 index 00000000000..6dee1fbd55b --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDynamicClassPubStat/ADynamicClass.as @@ -0,0 +1,243 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DynamicClass { + + + dynamic class DynamicClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + // public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // **************** + // constructor + // **************** + + function DynamicClass() { + } + + // ***************** + // default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + } + public class DynamicClass extends DynamicClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDynamicClassPubStat/DynExtDynamicClassPubStat.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDynamicClassPubStat/DynExtDynamicClassPubStat.as new file mode 100644 index 00000000000..95f62187c5e --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDynamicClassPubStat/DynExtDynamicClassPubStat.as @@ -0,0 +1,197 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DynamicClass { + + import DynamicClass.*; + + dynamic class DynExtDynamicClassPubStatInner extends DynamicClass { + + // ************************************ + // access public static method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return getPubStatArray(); } + function subSetArray(a:Array) { setPubStatArray(a); } + + // function to test above from test scripts + public function testSubArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + // ************************************ + // access public static method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return getPubStatArray(); } + public function pubSubSetArray(a:Array) { setPubStatArray(a); } + + // ************************************ + // access public static method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return getPubStatArray(); } + private function privSubSetArray(a:Array) { setPubStatArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + // ************************************ + // access public static method of parent + // from final method of sub class + // ************************************ + + final function finSubGetArray() : Array { return getPubStatArray(); } + final function finSubSetArray(a:Array) { setPubStatArray(a); } + + // function to test above from test scripts + public function testFinSubArray(a:Array) : Array { + this.finSubSetArray(a); + return this.finSubGetArray(); + } + + // *************************************** + // access public static method of parent + // from static method of sub class + // *************************************** +/* + static function statSubGetArray() : Array { return getPubStatArray(); } + static function statSubSetArray(a:Array) { setPubStatArray(a); } + + // *************************************** + // access public static method of parent + // from public static method of sub class + // *************************************** + + public static function pubStatSubGetArray() : Array { return getPubStatArray(); } + public static function pubStatSubSetArray(a:Array) { setPubStatArray(a); } + + // *************************************** + // access public static method of parent + // from private static method of sub class + // *************************************** + + private static function privStatSubGetArray() : Array { return getPubStatArray(); } + private static function privStatSubSetArray(a:Array) { setPubStatArray(a); } + + // public accessor to test asrt + public function testPrivStatSubArray(a:Array) : Array { + privStatSubSetArray(a); + return privStatSubGetArray(); + } +*/ + // *************************************** + // access public static property from + // default method of sub class + // *************************************** + + function subGetDPArray() : Array { return pubStatArray; } + function subSetDPArray(a:Array) { pubStatArray = a; } + // function to test above from test scripts + public function testSubDPArray(a:Array) : Array { + this.subSetDPArray(a); + return this.subGetDPArray(); + } + + // *************************************** + // access public static property from + // public method of sub class + // *************************************** + + public function pubSubGetDPArray() : Array { return pubStatArray; } + public function pubSubSetDPArray(a:Array) { pubStatArray = a; } + + // *************************************** + // access public static property from + // private method of sub class + // *************************************** + + private function privSubGetDPArray() : Array { return pubStatArray; } + private function privSubSetDPArray(a:Array) { pubStatArray = a; } + // function to test above from test scripts + public function testPrivSubDPArray(a:Array) : Array { + this.privSubSetDPArray(a); + return this.privSubGetDPArray(); + } + + // *************************************** + // access public static property from + // static method of sub class + // *************************************** +/* + static function statSubGetSPArray() : Array { return pubStatArray; } + static function statSubSetSPArray(a:Array) { pubStatArray = a; } + + // *************************************** + // access public static property from + // public static method of sub class + // *************************************** + + public static function pubStatSubGetSPArray() : Array { return pubStatArray; } + public static function pubStatSubSetSPArray(a:Array) { pubStatArray = a; } + + // *************************************** + // access public static property from + // private static method of sub class + // *************************************** + + private static function privStatSubGetSPArray() : Array { return pubStatArray; } + private static function privStatSubSetSPArray(a:Array) { pubStatArray = a; } + + // public accessor for asrt + public function testPrivStatSubPArray(a:Array) : Array { + privStatSubSetSPArray( a ); + return privStatSubGetSPArray(); + } +*/ + // *************************************** + // access public static property from + // final method of sub class + // *************************************** + + final function finSubGetDPArray() : Array { return pubStatArray; } + final function finSubSetDPArray(a:Array) { pubStatArray = a; } + // public accessor for asrt + public function testFinSubPArray(a:Array) : Array { + this.finSubSetDPArray( a ); + return finSubGetDPArray(); + } + + } + public class DynExtDynamicClassPubStat extends DynExtDynamicClassPubStatInner {} +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDynamicClassStat.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDynamicClassStat.as new file mode 100644 index 00000000000..a89d4f646a4 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDynamicClassStat.as @@ -0,0 +1,225 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import DynamicClass.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "Clean AS2"; // Version of JavaScript or ECMA +var TITLE = "Extend Dynamic Class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + +arr = new Array(1, 2, 3); + +// ******************************************** +// access static method from a default +// method of a sub class +// +// ******************************************** + +EXTDCLASS = new DynExtDynamicClassStat(); +AddTestCase( "*** Access static method from default method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testSubArray(arr)", arr, (EXTDCLASS.testSubArray(arr)) ); + + + +// ******************************************** +// access static method from a public +// method of a sub class +// +// ******************************************** + +EXTDCLASS = new DynExtDynamicClassStat(); +AddTestCase( "*** Access static method from public method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.pubSubSetArray(arr), EXTDCLASS.pubSubGetArray()", arr, (EXTDCLASS.pubSubSetArray(arr), EXTDCLASS.pubSubGetArray()) ); + +// fill in the rest of the cases here + +// ******************************************** +// access static method from a private +// method of a sub class +// +// ******************************************** + +EXTDCLASS = new DynExtDynamicClassStat(); +AddTestCase( "*** Access static method from private method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testPrivSubArray(arr)", arr, EXTDCLASS.testPrivSubArray(arr) ); + + +// ******************************************** +// access static method from a final +// method of a sub class +// +// ******************************************** + +EXTDCLASS = new DynExtDynamicClassStat(); +AddTestCase( "*** Access static method from final method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testFinSubArray(arr)", arr, (EXTDCLASS.testFinSubArray(arr)) ); + + +// ******************************************** +// access static method from a private final +// method of a sub class +// +// ******************************************** + +EXTDCLASS = new DynExtDynamicClassStat(); +AddTestCase( "*** Access static method from private final method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testPrivFinSubArray(arr)", arr, (EXTDCLASS.testPrivFinSubArray(arr)) ); + +// ******************************************** +// access static method from a virtual +// method of a sub class +// +// ******************************************** + +EXTDCLASS = new DynExtDynamicClassStat(); +AddTestCase( "*** Access static method from virtual method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testVirSubArray(arr)", arr, (EXTDCLASS.testVirSubArray(arr)) ); + + +// ******************************************** +// access static method from a static +// method of a sub class +// +// ******************************************** +/* +AddTestCase( "*** Access static method from static method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testStatSubArray(arr)", arr, + (EXTDCLASS.testStatSubArray(arr)) ); + + +// ******************************************** +// access static method from a public static +// method of a sub class +// +// ******************************************** + +AddTestCase( "*** Access static method from public static method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testPubStatSubArray(arr)", arr, + (EXTDCLASS.testPubStatSubArray(arr)) ); + + +// ******************************************** +// access static method from a private static +// method of a sub class +// +// ******************************************** + +var EXTDEFAULTCLASS = new DynExtDynamicClassStat(); +AddTestCase( "*** Access static method from private static method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testPrivStatSubArray(arr)", arr, + EXTDCLASS.testPrivStatSubArray(arr) ); +*/ + +// ******************************************** +// access static property from +// default method in sub class +// ******************************************** + +EXTDCLASS = new DynExtDynamicClassStat(); +AddTestCase( "*** Access static property from default method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testSubDPArray(arr)", arr, (EXTDCLASS.testSubDPArray(arr)) ); + + + +// ******************************************** +// access static property from +// public method in sub class +// ******************************************** + +EXTDCLASS = new DynExtDynamicClassStat(); +AddTestCase( "*** Access static property from public method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.pubSubSetDPArray(arr), EXTDCLASS.pubSubGetDPArray()", arr, (EXTDCLASS.pubSubSetDPArray(arr), EXTDCLASS.pubSubGetDPArray()) ); + + +// ******************************************** +// access static property from +// private method in sub class +// ******************************************** + +EXTDCLASS = new DynExtDynamicClassStat(); +AddTestCase( "*** Access static property from private method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testPrivSubDPArray(arr)", arr, (EXTDCLASS.testSubDPArray(arr)) ); + + +// ******************************************** +// access static property from +// static method in sub class +// ******************************************** +/* +AddTestCase( "*** Access static property from static method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.statSubSetSPArray(arr), EXTDCLASS.statSubGetSPArray()", arr, + (EXTDCLASS.statSubSetSPArray(arr), EXTDCLASS.statSubGetSPArray()) ); + +// ******************************************** +// access static property from +// public static method in sub class +// ******************************************** + +AddTestCase( "*** Access static property from public static method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.pubStatSubSetSPArray(arr), EXTDCLASS.pubStatSubGetSPArray()", arr, + (EXTDCLASS.pubStatSubSetSPArray(arr), EXTDCLASS.pubStatSubGetSPArray()) ); + +// ******************************************** +// access static property from +// private static method in sub class +// ******************************************** + +EXTDCLASS = new DynExtDynamicClassStat(); +AddTestCase( "*** Access static property from private static method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testPrivStatSubPArray(arr)", arr, + EXTDCLASS.testPrivStatSubPArray(arr)); +*/ + +// ******************************************** +// access static property from +// final method in sub class +// ******************************************** + +EXTDCLASS = new DynExtDynamicClassStat(); +AddTestCase( "*** Access static property from final method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testFinSubDPArray(arr)", arr, (EXTDCLASS.testFinSubDPArray(arr)) ); + +// ******************************************** +// access static property from +// public virtual method in sub class +// ******************************************** + +EXTDCLASS = new DynExtDynamicClassStat(); +AddTestCase( "*** Access static property from public virtual method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testPubVirSubDPArray(arr)", arr, (EXTDCLASS.testPubVirSubDPArray(arr)) ); + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDynamicClassStat/ADynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDynamicClassStat/ADynamicClass.as new file mode 100644 index 00000000000..6dee1fbd55b --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDynamicClassStat/ADynamicClass.as @@ -0,0 +1,243 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DynamicClass { + + + dynamic class DynamicClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + // public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // **************** + // constructor + // **************** + + function DynamicClass() { + } + + // ***************** + // default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + } + public class DynamicClass extends DynamicClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDynamicClassStat/DynExtDynamicClassStat.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDynamicClassStat/DynExtDynamicClassStat.as new file mode 100644 index 00000000000..8bcee036101 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtDynamicClassStat/DynExtDynamicClassStat.as @@ -0,0 +1,257 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DynamicClass { + + import DynamicClass.*; + + dynamic class DynExtDynamicClassStatInner extends DynamicClass { + + // ************************************ + // access static method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return getStatArray(); } + function subSetArray(a:Array) { setStatArray(a); } + + // function to test above from test scripts + public function testSubArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + // ************************************ + // access static method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return getStatArray(); } + public function pubSubSetArray(a:Array) { setStatArray(a); } + + // ************************************ + // access static method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return getStatArray(); } + private function privSubSetArray(a:Array) { setStatArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + // ************************************ + // access static method of parent + // from final method of sub class + // ************************************ + + final function finSubGetArray() : Array { return getStatArray(); } + final function finSubSetArray(a:Array) { setStatArray(a); } + + // function to test above from test scripts + public function testFinSubArray(a:Array) : Array { + this.finSubSetArray(a); + return this.finSubGetArray(); + } + + // ************************************ + // access static method of parent + // from private final method of sub class + // ************************************ + + private final function privFinSubGetArray() : Array { return getStatArray(); } + private final function privFinSubSetArray(a:Array) { setStatArray(a); } + + // function to test above from test scripts + public function testPrivFinSubArray(a:Array) : Array { + this.privFinSubSetArray(a); + return this.privFinSubGetArray(); + } + + // ************************************ + // access static method of parent + // from virtual method of sub class + // ************************************ + + virtual function virSubGetArray() : Array { return getStatArray(); } + virtual function virSubSetArray(a:Array) { setStatArray(a); } + + // function to test above from test scripts + public function testVirSubArray(a:Array) : Array { + this.virSubSetArray(a); + return this.virSubGetArray(); + } + + + // *************************************** + // access static method of parent + // from static method of sub class + // *************************************** + + static function statSubGetArray() : Array { return getStatArray(); } + static function statSubSetArray(a:Array) { setStatArray(a); } + // function to test above from test scripts + public function testStatSubArray(a:Array) : Array { + this.statSubSetArray(a); + return this.statSubGetArray(); + } + + // *************************************** + // access static method of parent + // from public static method of sub class + // *************************************** + + public static function pubStatSubGetArray() : Array { return getStatArray(); } + public static function pubStatSubSetArray(a:Array) { setStatArray(a); } + // function to test above from test scripts + public function testPubStatSubArray(a:Array) : Array { + this.pubStatSubSetArray(a); + return this.pubStatSubGetArray(); + } + + // *************************************** + // access static method of parent + // from private static method of sub class + // *************************************** + + private static function privStatSubGetArray() : Array { return getStatArray(); } + private static function privStatSubSetArray(a:Array) { setStatArray(a); } + + // public accessor to test asrt + public function testPrivStatSubArray(a:Array) : Array { + this.privStatSubSetArray(a); + return privStatSubGetArray(); + } + + // *************************************** + // access static property from + // default method of sub class + // *************************************** + + function subGetDPArray() : Array { return statArray; } + function subSetDPArray(a:Array) { statArray = a; } + // public accessor to test asrt + public function testSubDPArray(a:Array) : Array { + this.subSetDPArray(a); + return subGetDPArray(); + } + + + // *************************************** + // access static property from + // public method of sub class + // *************************************** + + public function pubSubGetDPArray() : Array { return statArray; } + public function pubSubSetDPArray(a:Array) { statArray = a; } + + // *************************************** + // access static property from + // private method of sub class + // *************************************** + + private function privSubGetDPArray() : Array { return statArray; } + private function privSubSetDPArray(a:Array) { statArray = a; } + // public accessor to test asrt + public function testPrivSubDPArray(a:Array) : Array { + this.privSubSetDPArray(a); + return privSubGetDPArray(); + } + + // *************************************** + // access static property from + // static method of sub class + // *************************************** + + static function statSubGetSPArray() : Array { return statArray; } + static function statSubSetSPArray(a:Array) { statArray = a; } + // public accessor to test asrt + public function testStatSubDPArray(a:Array) : Array { + this.statSubSetSPArray(a); + return statSubGetSPArray(); + } + + // *************************************** + // access static property from + // public static method of sub class + // *************************************** + + public static function pubStatSubGetSPArray() : Array { return statArray; } + public static function pubStatSubSetSPArray(a:Array) { statArray = a; } + + // *************************************** + // access static property from + // private static method of sub class + // *************************************** + + private static function privStatSubGetSPArray() : Array { return statArray; } + private static function privStatSubSetSPArray(a:Array) { statArray = a; } + + // public accessor for asrt + public function testPrivStatSubPArray(a:Array) : Array { + privStatSubSetSPArray( a ); + return privStatSubGetSPArray(); + } + + // *************************************** + // access static property from + // final method of sub class + // *************************************** + + final function finSubGetDPArray() : Array { return statArray; } + final function finSubSetDPArray(a:Array) { statArray = a; } + + // public accessor for asrt + public function testFinSubDPArray(a:Array) : Array { + this.finSubSetDPArray( a ); + return finSubGetDPArray(); + } + + // *************************************** + // access static property from + // virtual public method of sub class + // *************************************** + + public virtual function pubVirSubGetDPArray() : Array { return statArray; } + public virtual function pubVirSubSetDPArray(a:Array) { statArray = a; } + + // public accessor for asrt + public function testPubVirSubDPArray(a:Array) : Array { + this.pubVirSubSetDPArray( a ); + return pubVirSubGetDPArray(); + } + + } + public class DynExtDynamicClassStat extends DynExtDynamicClassStatInner {} +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtInternalClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtInternalClass.as new file mode 100644 index 00000000000..97f99c58a2a --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtInternalClass.as @@ -0,0 +1,250 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + +import InternalClass.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Dynamic Class Extends Default Class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + +// ******************************************* +// access default method from +// outside of class +// ******************************************* + +var DYNEXTDCLASS = new DynExtInternalClass(); +var arr = new Array(10, 15, 20, 25, 30); + +AddTestCase( "*** Access Default Method from Default method of sub class ***", 1, 1 ); +AddTestCase( "DYNEXTDCLASS.testSubGetSetArray(arr)", arr, (DYNEXTDCLASS.testSubGetSetArray(arr)) ); + + +// ******************************************** +// access default method from a public +// method of a sub class +// +// ******************************************** +var arr = new Array(1, 5); +DYNEXTDCLASS = new DynExtInternalClass(); +AddTestCase( "DYNEXTDCLASS.pubSubSetArray(arr), DYNEXTDCLASS.pubSubGetArray()", arr, (DYNEXTDCLASS.pubSubSetArray(arr), DYNEXTDCLASS.pubSubGetArray()) ); + + +// ******************************************** +// access default method from a private +// method of a sub class +// +// ******************************************** +var arr = new Array(2, 4, 6); +DYNEXTDCLASS = new DynExtInternalClass(); +AddTestCase( "DYNEXTDCLASS.testPrivSubArray(arr)", arr, DYNEXTDCLASS.testPrivSubArray(arr) ); + +// ******************************************** +// access default method from a final +// method of a sub class +// ******************************************** + +DYNEXTDCLASS = new DynExtInternalClass(); +AddTestCase( "access 'default' method from 'final' method of sub class", arr, (DYNEXTDCLASS.testFinSubArray(arr)) ); + +// ******************************************** +// access default method from a static +// method of a sub class +// ******************************************** + +DYNEXTDCLASS = new DynExtInternalClass(); +var thisError = "no Exception thrown"; +try{ + DYNEXTDCLASS.testStatSubArray(arr); +} catch (e) { + thisError = e.toString(); +} finally { + AddTestCase( "access 'default' method from 'static' method of sub class", + "ReferenceError: Error #1065", + referenceError( thisError ) ); +} +// ******************************************** +// access default method from a static +// method of a sub class +// +// ******************************************** +/* +var arr = new Array(1, 5); +DYNEXTDCLASS = new DynExtInternalClass(); +AddTestCase( "*** Access default method from static method of sub class ***", 1, 1 ); +AddTestCase( "DYNEXTDCLASS.testStatSubArray(arr)", arr, (DYNEXTDCLASS.testStatSubArray(arr)) ); +*/ + +// ******************************************** +// access default method from a public +// final method of a sub class +// ******************************************** + +arr = new Array( 1, 2, 3 ); +DYNEXTDCLASS = new DynExtInternalClass(); +AddTestCase( "access 'default' method from 'public final' method of sub class", arr, + (DYNEXTDCLASS.pubFinSubSetArray(arr), DYNEXTDCLASS.pubFinSubGetArray()) ); + +// ******************************************** +// access default method from a final +// private method of a sub class +// ******************************************** + +arr = new Array( 4, 5 ); +DYNEXTDCLASS = new DynExtInternalClass(); +AddTestCase( "access 'default' method from 'private final' method of sub class", arr, (DYNEXTDCLASS.testPrivFinSubArray(arr)) ); + +// ******************************************** +// access default method from a private +// method of a sub class +// ******************************************** + +arr = new Array( 6, 7 ); +DYNEXTDCLASS = new DynExtInternalClass(); +AddTestCase( "access 'default' method from 'private' method of sub class", arr, DYNEXTDCLASS.testPrivSubArray(arr) ); + +// ******************************************** +// access default method from a virtual +// method of a sub class +// ******************************************** + +AddTestCase( "access 'default' method from 'virtual' method of sub class", arr, + DYNEXTDCLASS.testVirtSubArray(arr) ); + +// ******************************************** +// access default method from a virtual +// public method of a sub class +// ******************************************** + +AddTestCase( "access 'default' method from 'public virtual' method of sub class", arr, + (DYNEXTDCLASS.pubVirtSubSetArray(arr), DYNEXTDCLASS.pubVirtSubGetArray()) ); + +// ******************************************** +// access default method from a virtual +// private method of a sub class +// ******************************************** + +AddTestCase( "access 'default' method from 'private virtual' method of sub class", arr, + DYNEXTDCLASS.testPrivVirtSubArray(arr) ); + + + +/* Access properties of parent class */ + +// ******************************************** +// access default property from +// default method in sub class +// ******************************************** + +DYNEXTDCLASS = new DynExtInternalClass(); +AddTestCase( "access 'default' property from 'default' method of sub class", arr, + (DYNEXTDCLASS.testSubGetSetDPArray(arr)) ); + +// ******************************************** +// access default property from +// final method in sub class +// ******************************************** + +DYNEXTDCLASS = new DynExtInternalClass(); +AddTestCase( "access 'default' property from 'final' method of sub class", arr, + (DYNEXTDCLASS.testFinSubDPArray(arr)) ); + +// ******************************************** +// access default property from +// virtual method in sub class +// ******************************************** + +DYNEXTDCLASS = new DynExtInternalClass(); +AddTestCase( "access 'default' property from 'virtual' method of sub class", arr, + (DYNEXTDCLASS.testVirtSubDPArray(arr)) ); + +// ******************************************** +// access default property from +// public method in sub class +// ******************************************** + +DYNEXTDCLASS = new DynExtInternalClass(); +AddTestCase( "access 'default' property from 'public' method of sub class", arr, + (DYNEXTDCLASS.pubSubSetDPArray(arr), DYNEXTDCLASS.pubSubGetDPArray()) ); + +// ******************************************** +// access default property from +// private method in sub class +// ******************************************** + +DYNEXTDCLASS = new DynExtInternalClass(); +AddTestCase( "access 'default' property from 'private' method of sub class", arr, + (DYNEXTDCLASS.testPrivSubDPArray(arr)) ); + +// ******************************************** +// access default property from +// public final method in sub class +// ******************************************** + +DYNEXTDCLASS = new DynExtInternalClass(); +AddTestCase( "access 'default' property from 'public final' method of sub class", arr, + (DYNEXTDCLASS.pubFinSubSetDPArray(arr), DYNEXTDCLASS.pubFinSubGetDPArray()) ); + +// ******************************************** +// access default property from +// public virtual method in sub class +// ******************************************** + +DYNEXTDCLASS = new DynExtInternalClass(); +AddTestCase( "access 'default' property from 'public virtual' method of sub class", arr, + (DYNEXTDCLASS.pubVirtSubSetDPArray(arr), DYNEXTDCLASS.pubVirtSubGetDPArray()) ); + +// ******************************************** +// access default property from +// private final method in sub class +// ******************************************** + +DYNEXTDCLASS = new DynExtInternalClass(); +AddTestCase( "access 'default' property from 'private final' method of sub class", arr, + (DYNEXTDCLASS.testPrivFinSubDPArray(arr)) ); + +// ******************************************** +// access default property from +// private virtual method in sub class +// ******************************************** + +DYNEXTDCLASS = new DynExtInternalClass(); +AddTestCase( "access 'default' property from 'private virtual' method of sub class", arr, + (DYNEXTDCLASS.testPrivVirtSubDPArray(arr)) ); + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtInternalClass/AInternalClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtInternalClass/AInternalClass.as new file mode 100644 index 00000000000..c8526819793 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtInternalClass/AInternalClass.as @@ -0,0 +1,264 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package InternalClass { + + internal class InternalClassInner { + + internal var array:Array; + var boolean:Boolean; + internal var date:Date; + var myFunction:Function; + internal var math:Math; + var number:Number; + internal var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + //public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + internal function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + internal function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + internal function getNumber() : Number { return number; } + function getObject() : Object { return object; } + internal function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + internal function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + internal function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + internal function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + internal function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + } + + public class InternalClass extends InternalClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtInternalClass/DynExtInternalClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtInternalClass/DynExtInternalClass.as new file mode 100644 index 00000000000..5006f5da8d3 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtInternalClass/DynExtInternalClass.as @@ -0,0 +1,282 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + +package InternalClass { + + import InternalClass.*; + + // Commenting out the import statement as this is not allowed by the compiler now + // import Definitions.Classes.InternalClass; + + // As this is a dynamic class, it will not be seen by the testcase, hence + // creating a wrapper function for this and changing the name for this file. + // DynExtInternalClass extends DynExtInternalClassInner + dynamic class DynExtInternalClassInner extends InternalClass { + + // ************************************ + // access default method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return this.getArray(); } + function subSetArray(a:Array) { this.setArray(a); } + + // ************************************ + // access default method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return this.getArray(); } + public function pubSubSetArray(a:Array) { this.setArray(a); } + + // this is needed so that the test cases can access this from + // outside the class. This way the test case itself preserved + public function testSubGetSetArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + // ************************************ + // access default method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return this.getArray(); } + private function privSubSetArray(a:Array) { this.setArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + // ************************************ + // access default method of parent + // from final method of sub class + // ************************************ + + final function finGetArray() : Array { return this.getArray(); } + final function finSetArray(a:Array) { this.setArray(a); } + + // this is needed so that the test cases can access this from + // outside the class. This way the test case itself preserved + public function testFinSubArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + // ************************************ + // access default method of parent + // from static method of sub class + // ************************************ + + static function statGetArray() : Array { return getArray(); } + static function statSetArray(a:Array) { setArray(a); } + // this is needed so that the test cases can access this from + // outside the class. This way the test case itself preserved + public function testStatSubArray(a:Array) : Array { + statSetArray(a); + return statGetArray(); + } + + // ************************************ + // access default method of parent + // from public final method of sub class + // ************************************ + + public final function pubFinSubGetArray() : Array { return this.getArray(); } + final public function pubFinSubSetArray(a:Array) { this.setArray(a); } + + // ************************************ + // access default method of parent + // from private final method of sub class + // ************************************ + + private final function privFinSubGetArray() : Array { return this.getArray(); } + final private function privFinSubSetArray(a:Array) { this.setArray(a); } + + public function testPrivFinSubArray(a:Array):Array { + this.privFinSubSetArray(a); + return this.privFinSubGetArray(); + } + + + // ************************************ + // access default method of parent + // from virtual method of sub class + // ************************************ + + virtual function virtSubGetArray() : Array { return this.getArray(); } + virtual function virtSubSetArray(a:Array) { this.setArray(a); } + + public function testVirtSubArray(a:Array) : Array { + this.virtSubSetArray(a); + return this.virtSubGetArray(); + } + + // ************************************ + // access default method of parent + // from public virtual method of sub class + // ************************************ + + virtual public function pubVirtSubGetArray() : Array { return this.getArray(); } + public virtual function pubVirtSubSetArray(a:Array) { this.setArray(a); } + + // ************************************ + // access default method of parent + // from private virtual method of sub class + // ************************************ + + virtual private function privVirtSubGetArray() : Array { return this.getArray(); } + private virtual function privVirtSubSetArray(a:Array) { this.setArray(a); } + + public function testPrivVirtSubArray(a:Array) : Array { + this.privVirtSubSetArray(a); + return this.privVirtSubGetArray(); + } + + + // *************************************** + // access default property from + // default method of sub class + // *************************************** + + function subGetDPArray() : Array { return array; } + function subSetDPArray(a:Array) { array = a; } + + // this is needed so that the test cases can access this from + // outside the class. This way the test case itself preserved + public function testSubGetSetDPArray(a:Array) : Array { + this.subSetDPArray(a); + return this.subGetDPArray(); + } + + // *************************************** + // access default property from + // public method of sub class + // *************************************** + + public function pubSubGetDPArray() : Array { return this.array; } + public function pubSubSetDPArray(a:Array) { this.array = a; } + + // *************************************** + // access default property from + // private method of sub class + // *************************************** + + private function privSubGetDPArray() : Array { return this.array; } + private function privSubSetDPArray(a:Array) { this.array = a; } + + public function testPrivSubDPArray(a:Array) : Array { + this.privSubSetDPArray(a); + return this.privSubGetDPArray(); + } + + + // *************************************** + // access default property from + // final method of sub class + // *************************************** + + final function finSubGetDPArray() : Array { return this.array; } + final function finSubSetDPArray(a:Array) { this.array = a; } + + public function testFinSubDPArray(a:Array) : Array { + this.finSubSetDPArray(a); + return this.finSubGetDPArray(); + } + + // *************************************** + // access default property from + // virtual method of sub class + // *************************************** + + virtual function virtSubGetDPArray() : Array { return array; } + virtual function virtSubSetDPArray(a:Array) { array = a; } + + public function testVirtSubDPArray(a:Array) : Array { + this.virtSubSetDPArray(a); + return this.virtSubGetDPArray(); + } + + // *************************************** + // access default property from + // public virtual method of sub class + // *************************************** + + public virtual function pubVirtSubGetDPArray() : Array { return this.array; } + virtual public function pubVirtSubSetDPArray(a:Array) { this.array = a; } + + // *************************************** + // access default property from + // private final method of sub class + // *************************************** + + private final function privFinSubGetDPArray() : Array { return this.array; } + final private function privFinSubSetDPArray(a:Array) { this.array = a; } + + public function testPrivFinSubDPArray(a:Array):Array { + this.privFinSubSetDPArray(a); + return this.privFinSubGetDPArray(); + } + + // *************************************** + // access default property from + // private virtual method of sub class + // *************************************** + + private virtual function privVirtSubGetDPArray() : Array { return this.array; } + virtual private function privVirtSubSetDPArray(a:Array) { this.array = a; } + + public function testPrivVirtSubDPArray(a:Array):Array { + this.privVirtSubSetDPArray(a); + return this.privVirtSubGetDPArray(); + } + + // *************************************** + // access default property from + // public final method of sub class + // *************************************** + + public final function pubFinSubGetDPArray() : Array { return this.array; } + final public function pubFinSubSetDPArray(a:Array) { this.array = a; } + + + } + + // PUBLIC wrapper function for the dynamic class to be accessed; + // otherwise it will give the error: + // ReferenceError: DynExtInternalClass is not defined + // at global$init() + public class DynExtInternalClass extends DynExtInternalClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtPublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtPublicClass.as new file mode 100644 index 00000000000..f6e96ca0b6c --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtPublicClass.as @@ -0,0 +1,43 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import PublicClass.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "extend public class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtPublicClass/APublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtPublicClass/APublicClass.as new file mode 100644 index 00000000000..fb5e420c61c --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtPublicClass/APublicClass.as @@ -0,0 +1,262 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + public class PublicClass { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + //public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finMyFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray():Array { return finArray; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtPublicClass/DynExtPublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtPublicClass/DynExtPublicClass.as new file mode 100644 index 00000000000..1bccf7d24e6 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtPublicClass/DynExtPublicClass.as @@ -0,0 +1,139 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + +package PublicClass { + + import PublicClass.*; + + dynamic class DynExtPublicClassInner extends PublicClass { + + // ************************************ + // access default method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return this.getPubArray(); } + function subSetArray(a:Array) { this.setPubArray(a); } + // function to test above from test scripts + public function testSubArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + // ************************************ + // access default method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return this.getPubArray(); } + public function pubSubSetArray(a:Array) { this.setPubArray(a); } + + // ************************************ + // access default method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return this.getPubArray(); } + private function privSubSetArray(a:Array) { this.setPubArray(a); } + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + // ************************************ + // access default method of parent + // from final method of sub class + // ************************************ + + final function finSubGetArray() : Array { return this.getPubArray(); } + final function finSubSetArray(a:Array) { this.setPubArray(a); } + // function to test above from test scripts + public function testFinSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + + + // *************************************** + // access default property from + // default method of sub class + // *************************************** + + function subGetDPArray() : Array { return array; } + function subSetDPArray(a:Array) { array = a; } + // function to test above from test scripts + public function testSubDPArray(a:Array) : Array { + this.subSetDPArray(a); + return this.subGetDPArray(); + } + + // *************************************** + // access default property from + // public method of sub class + // *************************************** + + public function pubSubGetDPArray() : Array { return this.array; } + public function pubSubSetDPArray(a:Array) { this.array = a; } + + // *************************************** + // access default property from + // private method of sub class + // *************************************** + + private function privSubGetDPArray() : Array { return this.array; } + private function privSubSetDPArray(a:Array) { this.array = a; } + // function to test above from test scripts + public function testPrivSubDPArray(a:Array) : Array { + this.privSubSetDPArray(a); + return this.privSubGetDPArray(); + } + + // *************************************** + // access default property from + // final method of sub class + // *************************************** + + final function finSubGetDPArray() : Array { return this.array; } + final function finSubSetDPArray(a:Array) { this.array = a; } + // function to test above from test scripts + public function testFinSubDPArray(a:Array) : Array { + this.finSubSetDPArray(a); + return this.finSubGetDPArray(); + } + + + } + public class DynExtPublicClass extends DynExtPublicClassInner {} +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtPublicClassFin.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtPublicClassFin.as new file mode 100644 index 00000000000..f8363780f01 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtPublicClassFin.as @@ -0,0 +1,42 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import PublicClass.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "dynamic Class Extends Public Class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtPublicClassFin/APublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtPublicClassFin/APublicClass.as new file mode 100644 index 00000000000..fb5e420c61c --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtPublicClassFin/APublicClass.as @@ -0,0 +1,262 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + public class PublicClass { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + //public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finMyFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray():Array { return finArray; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtPublicClassFin/DynExtPublicClassFin.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtPublicClassFin/DynExtPublicClassFin.as new file mode 100644 index 00000000000..dca9689d80e --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtPublicClassFin/DynExtPublicClassFin.as @@ -0,0 +1,234 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + import PublicClass.*; + + dynamic class DynExtPublicClassFinInner extends PublicClass { + + // ************************************ + // access final method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return this.getFinArray(); } + function subSetArray(a:Array) { this.setFinArray(a); } + // function to test above from test scripts + public function testSubArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + // ************************************ + // access final method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return this.getFinArray(); } + public function pubSubSetArray(a:Array) { this.setFinArray(a); } + + // ************************************ + // access final method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return this.getFinArray(); } + private function privSubSetArray(a:Array) { this.setFinArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + // *************************************** + // access static method of parent + // from static method of sub class + // *************************************** + + static function statSubGetArray() : Array { return getStatArray(); } + static function statSubSetArray(a:Array) { setStatArray(a); } + + // *************************************** + // access static method of parent + // from public static method of sub class + // *************************************** + + public static function pubStatSubGetArray() : Array { return getStatArray(); } + public static function pubStatSubSetArray(a:Array) { setStatArray(a); } + + // *************************************** + // access static method of parent + // from private static method of sub class + // *************************************** + + private static function privStatSubGetArray() : Array { return getStatArray(); } + private static function privStatSubSetArray(a:Array) { setStatArray(a); } + + // public accessor to test asrt + public function testPrivStatSubArray(a:Array) : Array { + privStatSubSetArray(a); + return privStatSubGetArray(); + } + + // ************************************ + // access final method of parent + // from final method of sub class + // ************************************ + + final function finSubGetArray() : Array { return this.getFinArray(); } + final function finSubSetArray(a:Array) { this.setFinArray(a); } + // public accessor to test asrt + public function testFinSubArray(a:Array) : Array { + this.finSubSetArray(a); + return finSubGetArray(); + } + + // ************************************ + // access final method of parent + // from public final method of sub class + // ************************************ + + public final function pubFinSubGetArray() : Array { return this.getFinArray(); } + public final function pubFinSubSetArray(a:Array) { this.setFinArray(a); } + + // ************************************ + // access final method of parent + // from public final method of sub class + // ************************************ + + private final function privFinSubGetArray() : Array { return this.getFinArray(); } + private final function privFinSubSetArray(a:Array) { this.setFinArray(a); } + // public accessor to test asrt + public function testPrivFinSubArray(a:Array) : Array { + this.privFinSubSetArray(a); + return privFinSubGetArray(); + } + + // *************************************** + // access final property from + // default method of sub class + // *************************************** + + function subGetDPArray() : Array { return finArray; } + function subSetDPArray(a:Array) { finArray = a; } + // public accessor to test asrt + public function testSubDPArray(a:Array) : Array { + this.subSetDPArray(a); + return subGetDPArray(); + } + + // *************************************** + // access final property from + // public method of sub class + // *************************************** + + public function pubSubGetDPArray() : Array { return this.finArray; } + public function pubSubSetDPArray(a:Array) { this.finArray = a; } + + + // *************************************** + // access final property from + // private method of sub class + // *************************************** + + private function privSubGetDPArray() : Array { return this.finArray; } + private function privSubSetDPArray(a:Array) { this.finArray = a; } + // public accessor to test asrt + public function testPrivSubDPArray(a:Array) : Array { + this.privSubSetDPArray(a); + return privSubGetDPArray(); + } + + // *************************************** + // access final property from + // final method of sub class + // *************************************** + + // *************************************** + // access static property from + // static method of sub class + // *************************************** + + static function statSubGetSPArray() : Array { return statArray; } + static function statSubSetSPArray(a:Array) { statArray = a; } + + // *************************************** + // access static property from + // public static method of sub class + // *************************************** + + public static function pubStatSubGetSPArray() : Array { return statArray; } + public static function pubStatSubSetSPArray(a:Array) { statArray = a; } + + // *************************************** + // access static property from + // private static method of sub class + // *************************************** + + private static function privStatSubGetSPArray() : Array { return statArray; } + private static function privStatSubSetSPArray(a:Array) { statArray = a; } + + + // public accessor for asrt + public function testPrivStatSubPArray(a:Array) : Array { + privStatSubSetSPArray( a ); + return privStatSubGetSPArray(); + } + + final function finSubGetDPArray() : Array { return this.finArray; } + final function finSubSetDPArray(a:Array) { this.finArray = a; } + // public accessor to test asrt + public function testFinSubDPArray(a:Array) : Array { + this.finSubSetDPArray(a); + return finSubGetDPArray(); + } + + virtual function virSubGetDPArray() : Array { return this.finArray; } + virtual function virSubSetDPArray(a:Array) { this.finArray = a; } + // public accessor to test asrt + public function testVirSubDPArray(a:Array) : Array { + this.virSubSetDPArray(a); + return virSubGetDPArray(); + } + + private virtual function virPrivSubGetDPArray() : Array { return this.finArray; } + private virtual function virPrivSubSetDPArray(a:Array) { this.finArray = a; } + // public accessor to test asrt + public function testPrivVirSubDPArray(a:Array) : Array { + this.virPrivSubSetDPArray(a); + return virPrivSubGetDPArray(); + } + + } + public class DynExtPublicClassFin extends DynExtPublicClassFinInner {} +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtPublicClassPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtPublicClassPub.as new file mode 100644 index 00000000000..e7c4dec509e --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtPublicClassPub.as @@ -0,0 +1,134 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import PublicClass.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "dynamic Class Extends Public Class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var DYNEXTDCLASS = new DynExtPublicClassPub(); + + +arr = new Array(1, 2, 3); + +// ******************************************** +// access public method from a default +// method of a sub class +// +// ******************************************** + +DYNEXTDCLASS = new DynExtPublicClassPub(); +AddTestCase( "*** Access public method from default method of sub class ***", 1, 1 ); +AddTestCase( "DYNEXTDCLASS.testSubArray(arr)", arr, (DYNEXTDCLASS.testSubArray(arr)) ); + + + +// ******************************************** +// access public method from a public +// method of a sub class +// +// ******************************************** + +DYNEXTDCLASS = new DynExtPublicClassPub(); +AddTestCase( "*** Access public method from public method of sub class ***", 1, 1 ); +AddTestCase( "DYNEXTDCLASS.pubSubSetArray(arr), DYNEXTDCLASS.pubSubGetArray()", arr, (DYNEXTDCLASS.pubSubSetArray(arr), DYNEXTDCLASS.pubSubGetArray()) ); + + +// ******************************************** +// access public method from a private +// method of a sub class +// +// ******************************************** + +DYNEXTDCLASS = new DynExtPublicClassPub(); +AddTestCase( "*** Access public method from private method of sub class ***", 1, 1 ); +AddTestCase( "DYNEXTDCLASS.testPrivSubArray(arr)", arr, DYNEXTDCLASS.testPrivSubArray(arr) ); + + +// ******************************************** +// access public method from a final +// method of a sub class +// +// ******************************************** + +DYNEXTDCLASS = new DynExtPublicClassPub(); +AddTestCase( "*** Access public method from final method of sub class ***", 1, 1 ); +AddTestCase( "DYNEXTDCLASS.testFinSubArray(arr)", arr, (DYNEXTDCLASS.testFinSubArray(arr)) ); + + +// ******************************************** +// access public property from +// default method in sub class +// ******************************************** + +DYNEXTDCLASS = new DynExtPublicClassPub(); +AddTestCase( "*** Access public property from default method in sub class ***", 1, 1 ); +AddTestCase( "DYNEXTDCLASS.testSubDPArray(arr)", arr, (DYNEXTDCLASS.testSubDPArray(arr)) ); + + +// ******************************************** +// access public property from +// public method in sub class +// ******************************************** + +DYNEXTDCLASS = new DynExtPublicClassPub(); +AddTestCase( "*** Access public property from public method in sub class ***", 1, 1 ); +AddTestCase( "DYNEXTDCLASS.pubSubSetDPArray(arr), DYNEXTDCLASS.pubSubGetDPArray()", arr, (DYNEXTDCLASS.pubSubSetDPArray(arr), DYNEXTDCLASS.pubSubGetDPArray()) ); + + +// ******************************************** +// access public property from +// private method in sub class +// ******************************************** + +DYNEXTDCLASS = new DynExtPublicClassPub(); +AddTestCase( "*** Access public property from private method in sub class ***", 1, 1 ); +AddTestCase( "DYNEXTDCLASS.testPrivSubDPArray(arr)", arr, (DYNEXTDCLASS.testPrivSubDPArray(arr)) ); + + +// ******************************************** +// access public property from +// final method in sub class +// ******************************************** + +DYNEXTDCLASS = new DynExtPublicClassPub(); +AddTestCase( "*** Access public property from final method in sub class ***", 1, 1 ); +AddTestCase( "DYNEXTDCLASS.testFinSubDPArray(arr)", arr, (DYNEXTDCLASS.testFinSubDPArray(arr)) ); + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtPublicClassPub/APublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtPublicClassPub/APublicClass.as new file mode 100644 index 00000000000..fb5e420c61c --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtPublicClassPub/APublicClass.as @@ -0,0 +1,262 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + public class PublicClass { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + //public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finMyFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray():Array { return finArray; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtPublicClassPub/DynExtPublicClassPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtPublicClassPub/DynExtPublicClassPub.as new file mode 100644 index 00000000000..099d037ddcf --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtPublicClassPub/DynExtPublicClassPub.as @@ -0,0 +1,151 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + import PublicClass.*; + + + dynamic class DynExtPublicClassPubInner extends PublicClass { + + // ************************************ + // access public method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return this.getPubArray(); } + function subSetArray(a:Array) { this.setPubArray(a); } + // function to test above from test scripts + public function testSubArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + // ************************************ + // access public method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return this.getPubArray(); } + public function pubSubSetArray(a:Array) { this.setPubArray(a); } + + // ************************************ + // access public method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return this.getPubArray(); } + private function privSubSetArray(a:Array) { this.setPubArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + // ************************************ + // access public method of parent + // from final method of sub class + // ************************************ + + final function finSubGetArray() : Array { return this.getPubArray(); } + final function finSubSetArray(a:Array) { this.setPubArray(a); } + // function to test above from test scripts + public function testFinSubArray(a:Array) : Array { + this.finSubSetArray(a); + return this.finSubGetArray(); + } + + + + // *************************************** + // access public property from + // default method of sub class + // *************************************** + + function subGetDPArray() : Array { return pubArray; } + function subSetDPArray(a:Array) { pubArray = a; } + // function to test above from test scripts + public function testSubDPArray(a:Array) : Array { + this.subSetDPArray(a); + return this.subGetDPArray(); + } + + // *************************************** + // access public property from + // public method of sub class + // *************************************** + + public function pubSubGetDPArray() : Array { return this.pubArray; } + public function pubSubSetDPArray(a:Array) { this.pubArray = a; } + + // *************************************** + // access public property from + // private method of sub class + // *************************************** + + private function privSubGetDPArray() : Array { return this.pubArray; } + private function privSubSetDPArray(a:Array) { this.pubArray = a; } + // function to test above from test scripts + public function testPrivSubDPArray(a:Array) : Array { + this.privSubSetDPArray(a); + return this.privSubGetDPArray(); + } + + // *************************************** + // access public property from + // final method of sub class + // *************************************** + + final function finSubGetDPArray() : Array { return this.pubArray; } + final function finSubSetDPArray(a:Array) { this.pubArray = a; } + // function to test above from test scripts + public function testFinSubDPArray(a:Array) : Array { + this.finSubSetDPArray(a); + return this.finSubGetDPArray(); + } + + + // ****************************************** + // overload default method of parent class + // ****************************************** + /* + override function overLoad() { return "This is the sub class"; } + override function pubOverLoad() { return "This is the sub class"; } + override function privOverLoad() { return "This is the sub class"; } + override function statOverLoad() { return "This is the sub class"; } + override function pubStatOverLoad() { return "This is the sub class"; } + override function privStatOverLoad() { return "This is the sub class"; } + */ + + } + public class DynExtPublicClassPub extends DynExtPublicClassPubInner {} +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtPublicClassPubStat.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtPublicClassPubStat.as new file mode 100644 index 00000000000..8c5049b7176 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtPublicClassPubStat.as @@ -0,0 +1,196 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import PublicClass.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "dynamic Class Extends Public Class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + +arr = new Array(1, 2, 3); + +// ******************************************** +// access public static method from a default +// method of a sub class +// +// ******************************************** + +DYNEXTDCLASS = new DynExtPublicClassPubStat(); +AddTestCase( "*** Access public static method from default method of sub class ***", 1, 1 ); +AddTestCase( "DYNEXTDCLASS.testSubArray(arr)", arr, (DYNEXTDCLASS.testSubArray(arr)) ); + + +// ******************************************** +// access public static method from a public +// method of a sub class +// +// ******************************************** + +DYNEXTDCLASS = new DynExtPublicClassPubStat(); +AddTestCase( "*** Access public static method from public method of sub class ***", 1, 1 ); +AddTestCase( "DYNEXTDCLASS.pubSubSetArray(arr), DYNEXTDCLASS.pubSubGetArray()", arr, (DYNEXTDCLASS.pubSubSetArray(arr), DYNEXTDCLASS.pubSubGetArray()) ); + + +// ******************************************** +// access public static method from a private +// method of a sub class +// +// ******************************************** + +DYNEXTDCLASS = new DynExtPublicClassPubStat(); +AddTestCase( "*** Access public static method from private method of sub class ***", 1, 1 ); +AddTestCase( "DYNEXTDCLASS.testPrivSubArray(arr)", arr, DYNEXTDCLASS.testPrivSubArray(arr) ); + + +// ******************************************** +// access public static method from a final +// method of a sub class +// +// ******************************************** + +DYNEXTDCLASS = new DynExtPublicClassPubStat(); +AddTestCase( "*** Access public static method from final method of sub class ***", 1, 1 ); +AddTestCase( "DYNEXTDCLASS.testFinSubArray(arr)", arr, (DYNEXTDCLASS.testFinSubArray(arr)) ); + +// ******************************************** +// access public static method from a static +// method of a sub class +// +// ******************************************** +/* +AddTestCase( "*** Access public static method from static method of sub class ***", 1, 1 ); +AddTestCase( "DynExtPublicClassPubStat.statSubSetArray(arr), DynExtPublicClassPubStat.statSubGetArray()", arr, + (DynExtPublicClassPubStat.statSubSetArray(arr), DynExtPublicClassPubStat.statSubGetArray()) ); +*/ + +// ******************************************** +// access public static method from a public static +// method of a sub class +// +// ******************************************** + +//AddTestCase( "*** Access public static method from public static method of sub class ***", 1, 1 ); +//AddTestCase( "DynExtPublicClassPubStat.pubStatSubSetArray(arr), DynExtPublicClassPubStat.pubStatSubGetArray()", arr, + // (DynExtPublicClassPubStat.pubStatSubSetArray(arr), DynExtPublicClassPubStat.pubStatSubGetArray()) ); + + +// ******************************************** +// access public static method from a private static +// method of a sub class +// +// ******************************************** + +var EXTDEFAULTCLASS = new DynExtPublicClassPubStat(); +//AddTestCase( "*** Access public static method from private static method of sub class ***", 1, 1 ); +//AddTestCase( "DynExtPublicClassPubStat.testPrivStatSubArray(arr)", arr, +// DynExtPublicClassPubStat.testPrivStatSubArray(arr) ); + + +// ******************************************** +// access public static property from +// default method in sub class +// ******************************************** + +DYNEXTDCLASS = new DynExtPublicClassPubStat(); +//AddTestCase( "*** Access public static property from default method in sub class ***", 1, 1 ); +//AddTestCase( "DYNEXTDCLASS.subSetDPArray(arr), DYNEXTDCLASS.subGetDPArray()", arr, (DYNEXTDCLASS.subSetDPArray(arr), DYNEXTDCLASS.subGetDPArray()) ); + + + +// ******************************************** +// access public static property from +// public method in sub class +// ******************************************** + +DYNEXTDCLASS = new DynExtPublicClassPubStat(); +AddTestCase( "*** Access public static property from public method in sub class ***", 1, 1 ); +AddTestCase( "DYNEXTDCLASS.pubSubSetDPArray(arr), DYNEXTDCLASS.pubSubGetDPArray()", arr, (DYNEXTDCLASS.pubSubSetDPArray(arr), DYNEXTDCLASS.pubSubGetDPArray()) ); + + +// ******************************************** +// access public static property from +// private method in sub class +// ******************************************** + +DYNEXTDCLASS = new DynExtPublicClassPubStat(); +//AddTestCase( "*** Access public static property from private method in sub class ***", 1, 1 ); +//AddTestCase( "DYNEXTDCLASS.privSubSetDPArray(arr), DYNEXTDCLASS.privSubGetDPArray()", arr, (DYNEXTDCLASS.privSubSetDPArray(arr), DYNEXTDCLASS.privSubGetDPArray()) ); + + +// ******************************************** +// access public static property from +// final method in sub class +// ******************************************** + +DYNEXTDCLASS = new DynExtPublicClassPubStat(); +//AddTestCase( "*** Access public static property from final method in sub class ***", 1, 1 ); +//AddTestCase( "DYNEXTDCLASS.finSubSetDPArray(arr), DYNEXTDCLASS.finSubGetDPArray()", arr, (DYNEXTDCLASS.finSubSetDPArray(arr), DYNEXTDCLASS.finSubGetDPArray()) ); + +// ******************************************** +// access public static property from +// static method in sub class +// ******************************************** + +/* +AddTestCase( "*** Access public static property from static method in sub class ***", 1, 1 ); +AddTestCase( "DynExtPublicClassPubStat.statSubSetSPArray(arr), DynExtPublicClassPubStat.statSubGetSPArray()", arr, + (DynExtPublicClassPubStat.statSubSetSPArray(arr), DynExtPublicClassPubStat.statSubGetSPArray()) ); +*/ + +// ******************************************** +// access public static property from +// public static method in sub class +// ******************************************** + +AddTestCase( "*** Access public static property from public static method in sub class ***", 1, 1 ); +AddTestCase( "DynExtPublicClassPubStat.pubStatSubSetSPArray(arr), DynExtPublicClassPubStat.pubStatSubGetSPArray()", arr, + (DynExtPublicClassPubStat.pubStatSubSetSPArray(arr), DynExtPublicClassPubStat.pubStatSubGetSPArray()) ); + +// ******************************************** +// access public static property from +// private static method in sub class +// ******************************************** + +DYNEXTDCLASS = new DynExtPublicClassPubStat(); +AddTestCase( "*** Access public static property from private static method in sub class ***", 1, 1 ); +AddTestCase( "DYNEXTDCLASS.testPrivStatSubPArray(arr)", arr, + DYNEXTDCLASS.testPrivStatSubPArray(arr)); + + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtPublicClassPubStat/APublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtPublicClassPubStat/APublicClass.as new file mode 100644 index 00000000000..fb5e420c61c --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtPublicClassPubStat/APublicClass.as @@ -0,0 +1,262 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + public class PublicClass { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + //public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finMyFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray():Array { return finArray; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtPublicClassPubStat/DynExtPublicClassPubStat.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtPublicClassPubStat/DynExtPublicClassPubStat.as new file mode 100644 index 00000000000..4dfb2369252 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtPublicClassPubStat/DynExtPublicClassPubStat.as @@ -0,0 +1,200 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + import PublicClass.*; + + dynamic class DynExtPublicClassPubStatInner extends PublicClass { + + // ************************************ + // access public static method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return getPubStatArray(); } + function subSetArray(a:Array) { setPubStatArray(a); } + // function to test above from test scripts + public function testSubArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + // ************************************ + // access public static method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return getPubStatArray(); } + public function pubSubSetArray(a:Array) { setPubStatArray(a); } + + // ************************************ + // access public static method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return getPubStatArray(); } + private function privSubSetArray(a:Array) { setPubStatArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + // *************************************** + // access public static method of parent + // from static method of sub class + // *************************************** + + static function statSubGetArray() : Array { return getPubStatArray(); } + static function statSubSetArray(a:Array) { setPubStatArray(a); } + + // *************************************** + // access public static method of parent + // from public static method of sub class + // *************************************** + + public static function pubStatSubGetArray() : Array { return getPubStatArray(); } + public static function pubStatSubSetArray(a:Array) { setPubStatArray(a); } + + // *************************************** + // access public static method of parent + // from private static method of sub class + // *************************************** + + private static function privStatSubGetArray() : Array { return getPubStatArray(); } + private static function privStatSubSetArray(a:Array) { setPubStatArray(a); } + + // public accessor to test asrt + public function testPrivStatSubArray(a:Array) : Array { + privStatSubSetArray(a); + return privStatSubGetArray(); + } + + // *************************************** + // access public static method of parent + // from final method of sub class + // *************************************** + + final function finSubGetArray() : Array { return getPubStatArray(); } + final function finSubSetArray(a:Array) { setPubStatArray(a); } + // public accessor to test asrt + public function testFinSubArray(a:Array) : Array { + finSubSetArray(a); + return finSubGetArray(); + } + + + // *************************************** + // access public static property from + // default method of sub class + // *************************************** + + function subGetDPArray() : Array { return pubStatArray; } + function subSetDPArray(a:Array) { pubStatArray = a; } + + // *************************************** + // access public static property from + // public method of sub class + // *************************************** + + public function pubSubGetDPArray() : Array { return pubStatArray; } + public function pubSubSetDPArray(a:Array) { pubStatArray = a; } + + // *************************************** + // access public static property from + // private method of sub class + // *************************************** + + private function privSubGetDPArray() : Array { return pubStatArray; } + private function privSubSetDPArray(a:Array) { pubStatArray = a; } + + // *************************************** + // access public static property from + // public static method of sub class + // *************************************** + + public static function pubStatSubGetSPArray() : Array { return pubStatArray; } + public static function pubStatSubSetSPArray(a:Array) { pubStatArray = a; } + + // *************************************** + // access public static property from + // private static method of sub class + // *************************************** + + private static function privStatSubGetSPArray() : Array { return pubStatArray; } + private static function privStatSubSetSPArray(a:Array) { pubStatArray = a; } + + // public accessor for asrt + public function testPrivStatSubPArray(a:Array) : Array { + privStatSubSetSPArray( a ); + return privStatSubGetSPArray(); + } + + // *************************************** + // access public static property from + // final method of sub class + // *************************************** + + final function finSubGetDPArray() : Array { return pubStatArray; } + final function finSubSetDPArray(a:Array) { pubStatArray = a; } + + + } + public class DynExtPublicClassPubStat extends DynExtPublicClassPubStatInner { + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { PublicClass.setPubStatArray(a); } + public static function setPubStatBoolean( b:Boolean ) { PublicClass.setPubStatBoolean(b); } + + public static function getPubStatArray() { return PublicClass.getPubStatArray(); } + + // *************************************** + // access public static property from + // public static method of sub class + // *************************************** + + public static function pubStatSubGetSPArray() : Array { return DynExtPublicClassPubStatInner.pubStatSubGetSPArray(); } + public static function pubStatSubSetSPArray(a:Array) { DynExtPublicClassPubStatInner.pubStatSubSetSPArray(a); } + + // *************************************** + // access public static method of parent + // from public static method of sub class + // *************************************** + + public static function pubStatSubGetArray() : Array { return DynExtPublicClassPubStatInner.pubStatSubGetArray(); } + public static function pubStatSubSetArray(a:Array) { DynExtPublicClassPubStatInner.pubStatSubSetArray(a); } + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtPublicClassStat.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtPublicClassStat.as new file mode 100644 index 00000000000..cf8099b529e --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtPublicClassStat.as @@ -0,0 +1,194 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import PublicClass.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "dynamic Class Extends Public Class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +// create a new Array Object, with 3 instances. +arr = new Array(1, 2, 3); + +// ******************************************** +// access static method from a default +// method of a sub class +// +// ******************************************** + +EXTDCLASSS = new DynExtPublicClassStat(); +AddTestCase( "*** Access static method from default method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASSS.testSubArray(arr)", arr, (EXTDCLASSS.testSubArray(arr)) ); + + +// ******************************************** +// access static method from a public +// method of a sub class +// +// ******************************************** + +EXTDCLASSS = new DynExtPublicClassStat(); +AddTestCase( "*** Access static method from public method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASSS.pubSubSetArray(arr), EXTDCLASSS.pubSubGetArray()", arr, (EXTDCLASSS.pubSubSetArray(arr), EXTDCLASSS.pubSubGetArray()) ); + + +// ******************************************** +// access static method from a private +// method of a sub class +// +// ******************************************** + +EXTDCLASSS = new DynExtPublicClassStat(); +AddTestCase( "*** Access static method from private method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASSS.testPrivSubArray(arr)", arr, EXTDCLASSS.testPrivSubArray(arr) ); + + +// ******************************************** +// access static method from a final +// method of a sub class +// +// ******************************************** + +EXTDCLASSS = new DynExtPublicClassStat(); +//AddTestCase( "access static method from final method of sub class", arr, (EXTDCLASSS.testFinSubArray(arr)) ); + +// ******************************************** +// access static method from a static +// method of a sub class +// +// ******************************************** +/* +AddTestCase( "*** Access static method from static method of sub class ***", 1, 1 ); +AddTestCase( "FinExtPublicClassStat.statSubSetArray(arr), FinExtPublicClassStat.statSubGetArray()", arr, + (FinExtPublicClassStat.statSubSetArray(arr), FinExtPublicClassStat.statSubGetArray()) ); + + +// ******************************************** +// access static method from a public static +// method of a sub class +// +// ******************************************** + +AddTestCase( "*** Access static method from public static method of sub class ***", 1, 1 ); +AddTestCase( "FinExtPublicClassStat.pubStatSubSetArray(arr), FinExtPublicClassStat.pubStatSubGetArray()", arr, + (FinExtPublicClassStat.pubStatSubSetArray(arr), FinExtPublicClassStat.pubStatSubGetArray()) ); + + +// ******************************************** +// access static method from a private static +// method of a sub class +// +// ******************************************** + +var EXTDCLASSS = new DynExtPublicClassStat(); +AddTestCase( "*** Access static method from private static method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASSS.testPrivStatSubArray(arr)", arr, + EXTDCLASSS.testPrivStatSubArray(arr) ); +*/ + +// ******************************************** +// access static property from +// default method in sub class +// ******************************************** + +EXTDCLASSS = new DynExtPublicClassStat(); +AddTestCase( "*** Access static property from default method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASSS.testSubDPArray(arr)", arr, (EXTDCLASSS.testSubDPArray(arr)) ); + + + +// ******************************************** +// access static property from +// public method in sub class +// ******************************************** + +EXTDCLASSS = new DynExtPublicClassStat(); +AddTestCase( "*** Access static property from public method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASSS.pubSubSetDPArray(arr), EXTDCLASSS.pubSubGetDPArray()", arr, (EXTDCLASSS.pubSubSetDPArray(arr), EXTDCLASSS.pubSubGetDPArray()) ); + + +// ******************************************** +// access static property from +// private method in sub class +// ******************************************** + +EXTDCLASSS = new DynExtPublicClassStat(); +AddTestCase( "*** Access static property from private method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASSS.testPrivSubDPArray(arr)", arr, (EXTDCLASSS.testPrivSubDPArray(arr)) ); + + +// ******************************************** +// access static property from +// static method in sub class +// ******************************************** +/* +AddTestCase( "*** Access static property from static method in sub class ***", 1, 1 ); +AddTestCase( "FinExtPublicClassStat.statSubSetSPArray(arr), FinExtPublicClassStat.statSubGetSPArray()", arr, + (FinExtPublicClassStat.statSubSetSPArray(arr), FinExtPublicClassStat.statSubGetSPArray()) ); + +// ******************************************** +// access static property from +// public static method in sub class +// ******************************************** + +AddTestCase( "*** Access static property from public static method in sub class ***", 1, 1 ); +AddTestCase( "FinExtPublicClassStat.pubStatSubSetSPArray(arr), FinExtPublicClassStat.pubStatSubGetSPArray()", arr, + (FinExtPublicClassStat.pubStatSubSetSPArray(arr), FinExtPublicClassStat.pubStatSubGetSPArray()) ); + +// ******************************************** +// access static property from +// private static method in sub class +// ******************************************** + +EXTDCLASSS = new DynExtPublicClassStat(); +AddTestCase( "*** Access static property from private static method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASSS.testPrivStatSubPArray(arr)", arr, + EXTDCLASSS.testPrivStatSubPArray(arr)); + +*/ + +// ******************************************** +// access static property from +// final method in sub class +// ******************************************** + +EXTDCLASSS = new DynExtPublicClassStat(); +AddTestCase( "*** Access static property from final method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASSS.testFinSubDPArray(arr)", arr, (EXTDCLASSS.testFinSubDPArray(arr)) ); + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtPublicClassStat/APublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtPublicClassStat/APublicClass.as new file mode 100644 index 00000000000..fb5e420c61c --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtPublicClassStat/APublicClass.as @@ -0,0 +1,262 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + public class PublicClass { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + //public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finMyFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray():Array { return finArray; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtPublicClassStat/DynExtPublicClassStat.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtPublicClassStat/DynExtPublicClassStat.as new file mode 100644 index 00000000000..56eec9cc6d4 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/DynExtPublicClassStat/DynExtPublicClassStat.as @@ -0,0 +1,186 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + import PublicClass.*; + + dynamic class DynExtPublicClassStatInner extends PublicClass { + + // ************************************ + // access static method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return getStatArray(); } + function subSetArray(a:Array) { setStatArray(a); } + // function to test above from test scripts + public function testSubArray(a:Array) : Array { + subSetArray(a); + return subGetArray(); + } + + // ************************************ + // access static method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return getStatArray(); } + public function pubSubSetArray(a:Array) { setStatArray(a); } + + // ************************************ + // access static method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return getStatArray(); } + private function privSubSetArray(a:Array) { setStatArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + privSubSetArray(a); + return privSubGetArray(); + } + + // *************************************** + // access static method of parent + // from static method of sub class + // *************************************** + + static function statSubGetArray() : Array { return getStatArray(); } + static function statSubSetArray(a:Array) { setStatArray(a); } + + // *************************************** + // access static method of parent + // from public static method of sub class + // *************************************** + + public static function pubStatSubGetArray() : Array { return getStatArray(); } + public static function pubStatSubSetArray(a:Array) { setStatArray(a); } + + // *************************************** + // access static method of parent + // from private static method of sub class + // *************************************** + + private static function privStatSubGetArray() : Array { return getStatArray(); } + private static function privStatSubSetArray(a:Array) { setStatArray(a); } + + // public accessor to test asrt + public function testPrivStatSubArray(a:Array) : Array { + privStatSubSetArray(a); + return privStatSubGetArray(); + } + + + + // *************************************** + // access static property from + // default method of sub class + // *************************************** + + function subGetDPArray() : Array { return statArray; } + function subSetDPArray(a:Array) { statArray = a; } + // function to test above from test scripts + public function testSubDPArray(a:Array) : Array { + subSetDPArray(a); + return subGetDPArray(); + } + + + // *************************************** + // access static property from + // public method of sub class + // *************************************** + + public function pubSubGetDPArray() : Array { return statArray; } + public function pubSubSetDPArray(a:Array) { statArray = a; } + + // *************************************** + // access static property from + // private method of sub class + // *************************************** + + private function privSubGetDPArray() : Array { return statArray; } + private function privSubSetDPArray(a:Array) { statArray = a; } + // function to test above from test scripts + public function testPrivSubDPArray(a:Array) : Array { + privSubSetDPArray(a); + return privSubGetDPArray(); + } + + // *************************************** + // access static property from + // static method of sub class + // *************************************** + + static function statSubGetSPArray() : Array { return statArray; } + static function statSubSetSPArray(a:Array) { statArray = a; } + + // *************************************** + // access static property from + // public static method of sub class + // *************************************** + + public static function pubStatSubGetSPArray() : Array { return statArray; } + public static function pubStatSubSetSPArray(a:Array) { statArray = a; } + + // *************************************** + // access static property from + // private static method of sub class + // *************************************** + + private static function privStatSubGetSPArray() : Array { return statArray; } + private static function privStatSubSetSPArray(a:Array) { statArray = a; } + + // public accessor for asrt + public function testPrivStatSubPArray(a:Array) : Array { + privStatSubSetSPArray( a ); + return privStatSubGetSPArray(); + } + + // *************************************** + // access static property from + // final method of sub class + // *************************************** + + final function finSubGetDPArray() : Array { return statArray; } + final function finSubSetDPArray(a:Array) { statArray = a; } + // function to test above from test scripts + public function testFinSubDPArray(a:Array) : Array { + finSubSetDPArray(a); + return finSubGetDPArray(); + } + + + } + public class DynExtPublicClassStat extends DynExtPublicClassStatInner {} +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDefaultClass.as new file mode 100644 index 00000000000..b6a6aed27c8 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDefaultClass.as @@ -0,0 +1,239 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import DefaultClass.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "Clean AS2"; // Version of JavaScript or ECMA +var TITLE = "Extend Default Class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + +// ******************************************** +// access default method from a default +// method of a sub class +// +// ******************************************** + +var arr = new Array(1,2,3); +EXTDCLASS = new ExtDefaultClass(); +AddTestCase( "access 'default' method from 'default' method of sub class", arr, (EXTDCLASS.testSubGetSetArray(arr)) ); + + +// ******************************************** +// access default method from a public +// method of a sub class +// ******************************************** + +arr = new Array( 4, 5, 6 ); +EXTDCLASS = new ExtDefaultClass(); +AddTestCase( "access 'default' method from 'public' method of sub class", arr, + (EXTDCLASS.pubSubSetArray(arr), EXTDCLASS.pubSubGetArray()) ); + +// ******************************************** +// access default method from a final +// method of a sub class +// ******************************************** + +arr = new Array( "one", "two", "three" ); +EXTDCLASS = new ExtDefaultClass(); +AddTestCase( "access 'default' method from 'final' method of sub class", arr, (EXTDCLASS.testFinSubArray(arr)) ); + +// ******************************************** +// access default method from a public +// final method of a sub class +// ******************************************** + +arr = new Array( 8, "two", 9 ); +EXTDCLASS = new ExtDefaultClass(); +AddTestCase( "access 'default' method from 'public final' method of sub class", arr, + (EXTDCLASS.pubFinSubSetArray(arr), EXTDCLASS.pubFinSubGetArray()) ); + +// ******************************************** +// access default method from a final +// private method of a sub class +// ******************************************** + +arr = new Array( "one", "two", "three" ); +EXTDCLASS = new ExtDefaultClass(); +AddTestCase( "access 'default' method from 'private final' method of sub class", arr, (EXTDCLASS.testPrivFinSubArray(arr)) ); + +// ******************************************** +// access default method from a private +// method of a sub class +// ******************************************** + +arr = new Array( 5, 6, 7 ); +EXTDCLASS = new ExtDefaultClass(); +AddTestCase( "access 'default' method from 'private' method of sub class", arr, EXTDCLASS.testPrivSubArray(arr) ); + +// ******************************************** +// access default method from a virtual +// method of a sub class +// ******************************************** + +AddTestCase( "access 'default' method from 'virtual' method of sub class", arr, + EXTDCLASS.testVirtSubArray(arr) ); + +// ******************************************** +// access default method from a virtual +// public method of a sub class +// ******************************************** + +AddTestCase( "access 'default' method from 'public virtual' method of sub class", arr, + (EXTDCLASS.pubVirtSubSetArray(arr), EXTDCLASS.pubVirtSubGetArray()) ); + +// ******************************************** +// access default method from a virtual +// private method of a sub class +// ******************************************** + +AddTestCase( "access 'default' method from 'private virtual' method of sub class", arr, + EXTDCLASS.testPrivVirtSubArray(arr) ); + +// ******************************************** +// access default method from static +// method of sub class +// ******************************************** + +var thisError = "no exception thrown"; +try{ + ExtDefaultClass.pubStatSubGetArray(); +} catch (e1) { + thisError = e1.toString(); +} finally { + AddTestCase( "access 'default' method from 'static' method of the sub class", + TYPEERROR+1006, + typeError( thisError) ); +} + +// ******************************************** +// access default property from +// default method in sub class +// ******************************************** + +EXTDCLASS = new ExtDefaultClass(); +AddTestCase( "access 'default' property from 'default' method of sub class", arr, + (EXTDCLASS.testSubGetSetDPArray(arr)) ); + +// ******************************************** +// access default property from +// final method in sub class +// ******************************************** + +EXTDCLASS = new ExtDefaultClass(); +AddTestCase( "access 'default' property from 'final' method of sub class", arr, + (EXTDCLASS.testFinSubDPArray(arr)) ); + +// ******************************************** +// access default property from +// virtual method in sub class +// ******************************************** + +EXTDCLASS = new ExtDefaultClass(); +AddTestCase( "access 'default' property from 'virtual' method of sub class", arr, + (EXTDCLASS.testVirtSubDPArray(arr)) ); + +// ******************************************** +// access default property from +// public method in sub class +// ******************************************** + +EXTDCLASS = new ExtDefaultClass(); +AddTestCase( "access 'default' property from 'public' method of sub class", arr, + (EXTDCLASS.pubSubSetDPArray(arr), EXTDCLASS.pubSubGetDPArray()) ); + +// ******************************************** +// access default property from +// private method in sub class +// ******************************************** + +EXTDCLASS = new ExtDefaultClass(); +AddTestCase( "access 'default' property from 'private' method of sub class", arr, + (EXTDCLASS.testPrivSubDPArray(arr)) ); + +// ******************************************** +// access default property from +// public final method in sub class +// ******************************************** + +EXTDCLASS = new ExtDefaultClass(); +AddTestCase( "access 'default' property from 'public final' method of sub class", arr, + (EXTDCLASS.pubFinSubSetDPArray(arr), EXTDCLASS.pubFinSubGetDPArray()) ); + +// ******************************************** +// access default property from +// public virtual method in sub class +// ******************************************** + +EXTDCLASS = new ExtDefaultClass(); +AddTestCase( "access 'default' property from 'public virtual' method of sub class", arr, + (EXTDCLASS.pubVirtSubSetDPArray(arr), EXTDCLASS.pubVirtSubGetDPArray()) ); + +// ******************************************** +// access default property from +// private final method in sub class +// ******************************************** + +EXTDCLASS = new ExtDefaultClass(); +AddTestCase( "access 'default' property from 'private final' method of sub class", arr, + (EXTDCLASS.testPrivFinSubDPArray(arr)) ); + +// ******************************************** +// access default property from +// private virtual method in sub class +// ******************************************** + +EXTDCLASS = new ExtDefaultClass(); +AddTestCase( "access 'default' property from 'private virtual' method of sub class", arr, + (EXTDCLASS.testPrivVirtSubDPArray(arr)) ); + +// ******************************************** +// access default property from +// static public method of sub class +// ******************************************** + +thisError = "no error thrown"; +try{ + ExtDefaultClass.pubStatSubGetDPArray(); +} catch(e3) { + thisError = e3.toString(); +} finally { + AddTestCase( "access default property from static public method of sub class", + TYPEERROR+1006, + typeError( thisError ) ); +} + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDefaultClass/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDefaultClass/DefaultClass.as new file mode 100644 index 00000000000..2b3618393b9 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDefaultClass/DefaultClass.as @@ -0,0 +1,264 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DefaultClass { + + class DefaultClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + //public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + } + + public class DefaultClass extends DefaultClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDefaultClass/ExtDefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDefaultClass/ExtDefaultClass.as new file mode 100644 index 00000000000..f01fd3e852f --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDefaultClass/ExtDefaultClass.as @@ -0,0 +1,276 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DefaultClass { + + import DefaultClass.* + + // this is the test case so we can't alter it too much + // change the name of the class to ExtDefaultClassTest + // we'll create a public class ExtDefaultClass that + // extends it for testing runtime + class ExtDefaultClassTest extends DefaultClass { + + // ************************************ + // access default method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return this.getArray(); } + function subSetArray(a:Array) { this.setArray(a); } + + // this is needed so that the test cases can access this from + // outside the class. This way the test case itself preserved + public function testSubGetSetArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + // ************************************ + // access default method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return this.getArray(); } + public function pubSubSetArray(a:Array) { this.setArray(a); } + + // ************************************ + // access default method of parent + // from final method of sub class + // + // final will behave the same as default + // ************************************ + + final function finSubGetArray() : Array { return this.getArray(); } + final function finSubSetArray(a:Array) { this.setArray(a); } + + public function testFinSubArray(a:Array):Array{ + this.finSubSetArray(a); + return this.finSubGetArray(); + } + + // ************************************ + // access default method of parent + // from public final method of sub class + // ************************************ + + public final function pubFinSubGetArray() : Array { return this.getArray(); } + final public function pubFinSubSetArray(a:Array) { this.setArray(a); } + + // ************************************ + // access default method of parent + // from private final method of sub class + // ************************************ + + private final function privFinSubGetArray() : Array { return this.getArray(); } + final private function privFinSubSetArray(a:Array) { this.setArray(a); } + + public function testPrivFinSubArray(a:Array):Array { + this.privFinSubSetArray(a); + return this.privFinSubGetArray(); + } + + + // ************************************ + // access default method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return this.getArray(); } + private function privSubSetArray(a:Array) { this.setArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + // ************************************ + // access default method of parent + // from virtual method of sub class + // ************************************ + + virtual function virtSubGetArray() : Array { return this.getArray(); } + virtual function virtSubSetArray(a:Array) { this.setArray(a); } + + public function testVirtSubArray(a:Array) : Array { + this.virtSubSetArray(a); + return this.virtSubGetArray(); + } + + // ************************************ + // access default method of parent + // from public virtual method of sub class + // ************************************ + + virtual public function pubVirtSubGetArray() : Array { return this.getArray(); } + public virtual function pubVirtSubSetArray(a:Array) { this.setArray(a); } + + // ************************************ + // access default method of parent + // from private virtual method of sub class + // ************************************ + + virtual private function privVirtSubGetArray() : Array { return this.getArray(); } + private virtual function privVirtSubSetArray(a:Array) { this.setArray(a); } + + public function testPrivVirtSubArray(a:Array) : Array { + this.privVirtSubSetArray(a); + return this.privVirtSubGetArray(); + } + + // *************************************** + // access default property from + // static method of sub class + // *************************************** + + static function statSubGetArray():Array{ return getArray(); } + static public function pubStatSubGetArray():Array { return statSubGetArray(); } + + // *************************************** + // access default property from + // default method of sub class + // *************************************** + + function subGetDPArray() : Array { return array; } + function subSetDPArray(a:Array) { array = a; } + + // this is needed so that the test cases can access this from + // outside the class. This way the test case itself preserved + public function testSubGetSetDPArray(a:Array) : Array { + this.subSetDPArray(a); + return this.subGetDPArray(); + } + + // *************************************** + // access default property from + // final method of sub class + // *************************************** + + final function finSubGetDPArray() : Array { return array; } + final function finSubSetDPArray(a:Array) { array = a; } + + public function testFinSubDPArray(a:Array) : Array { + this.finSubSetDPArray(a); + return this.finSubGetDPArray(); + } + + // *************************************** + // access default property from + // virtual method of sub class + // *************************************** + + virtual function virtSubGetDPArray() : Array { return array; } + virtual function virtSubSetDPArray(a:Array) { array = a; } + + public function testVirtSubDPArray(a:Array) : Array { + this.virtSubSetDPArray(a); + return this.virtSubGetDPArray(); + } + + // *************************************** + // access default property from + // public method of sub class + // *************************************** + + public function pubSubGetDPArray() : Array { return this.array; } + public function pubSubSetDPArray(a:Array) { this.array = a; } + + // *************************************** + // access default property from + // private method of sub class + // *************************************** + + private function privSubGetDPArray() : Array { return this.array; } + private function privSubSetDPArray(a:Array) { this.array = a; } + + public function testPrivSubDPArray(a:Array) : Array { + this.privSubSetDPArray(a); + return this.privSubGetDPArray(); + } + + // *************************************** + // access default property from + // public final method of sub class + // *************************************** + + public final function pubFinSubGetDPArray() : Array { return this.array; } + final public function pubFinSubSetDPArray(a:Array) { this.array = a; } + + // *************************************** + // access default property from + // public virtual method of sub class + // *************************************** + + public virtual function pubVirtSubGetDPArray() : Array { return this.array; } + virtual public function pubVirtSubSetDPArray(a:Array) { this.array = a; } + + // *************************************** + // access default property from + // private final method of sub class + // *************************************** + + private final function privFinSubGetDPArray() : Array { return this.array; } + final private function privFinSubSetDPArray(a:Array) { this.array = a; } + + public function testPrivFinSubDPArray(a:Array):Array { + this.privFinSubSetDPArray(a); + return this.privFinSubGetDPArray(); + } + + // *************************************** + // access default property from + // private virtual method of sub class + // *************************************** + + private virtual function privVirtSubGetDPArray() : Array { return this.array; } + virtual private function privVirtSubSetDPArray(a:Array) { this.array = a; } + + public function testPrivVirtSubDPArray(a:Array):Array { + this.privVirtSubSetDPArray(a); + return this.privVirtSubGetDPArray(); + } + + // *************************************** + // access default property from + // public static method of sub class + // *************************************** + + public static function pubStatSubGetDPArray(){ + return array; + } + + } + + // same class as above except public + public class ExtDefaultClass extends ExtDefaultClassTest {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDefaultClassPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDefaultClassPub.as new file mode 100644 index 00000000000..aae73c07dbd --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDefaultClassPub.as @@ -0,0 +1,44 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import DefaultClass.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "Clean AS2"; // Version of JavaScript or ECMA +var TITLE = "Extend Default Class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + +var EXTDCLASS = new ExtDefaultClassPub(); + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDefaultClassPub/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDefaultClassPub/DefaultClass.as new file mode 100644 index 00000000000..2b3618393b9 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDefaultClassPub/DefaultClass.as @@ -0,0 +1,264 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DefaultClass { + + class DefaultClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + //public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + } + + public class DefaultClass extends DefaultClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDefaultClassPub/ExtDefaultClassPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDefaultClassPub/ExtDefaultClassPub.as new file mode 100644 index 00000000000..34b0fd5f9b2 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDefaultClassPub/ExtDefaultClassPub.as @@ -0,0 +1,112 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DefaultClass { + + import DefaultClass.* + + class InnerExtDefaultClassPub extends DefaultClass { + + // ************************************ + // access public method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return this.getPubArray(); } + function subSetArray(a:Array) { this.setPubArray(a); } + + public function testSubArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + + // ************************************ + // access public method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return this.getPubArray(); } + public function pubSubSetArray(a:Array) { this.setPubArray(a); } + + // ************************************ + // access public method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return this.getPubArray(); } + private function privSubSetArray(a:Array) { this.setPubArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + // *************************************** + // access public property from + // default method of sub class + // *************************************** + + function subGetDPArray() : Array { return this.pubArray; } + function subSetDPArray(a:Array) { this.pubArray = a; } + + public function testSubDPArray(a:Array):Array{ + this.subSetDPArray(a); + return this.subGetDPArray(); + } + + + // *************************************** + // access public property from + // public method of sub class + // *************************************** + + public function pubSubGetDPArray() : Array { return this.pubArray; } + public function pubSubSetDPArray(a:Array) { this.pubArray = a; } + + // *************************************** + // access public property from + // private method of sub class + // *************************************** + + private function privSubGetDPArray() : Array { return this.pubArray; } + private function privSubSetDPArray(a:Array) { this.pubArray = a; } + + // function to test above + public function testPrivSubPArray(a:Array):Array{ + this.privSubSetDPArray(a); + return this.privSubGetDPArray(); + } + + } + public class ExtDefaultClassPub extends InnerExtDefaultClassPub {} +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDefaultClassPubStat.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDefaultClassPubStat.as new file mode 100644 index 00000000000..2a4a2920c6a --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDefaultClassPubStat.as @@ -0,0 +1,183 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "Clean AS2"; // Version of JavaScript or ECMA +var TITLE = "Extend Default Class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +import DefaultClass.*; + +arr = new Array(1, 2, 3); + + +AddTestCase( "ExtDefaultClassPubStat.setPubStatArray(arr), ExtDefaultClassPubStat.getPubStatArray())", arr, + (ExtDefaultClassPubStat.setPubStatArray(arr), ExtDefaultClassPubStat.getPubStatArray()) ); + + +// ******************************************** +// access public static method from a default +// method of a sub class +// +// ******************************************** + +EXTDCLASS = new ExtDefaultClassPubStat(); +AddTestCase( "*** Access public static method from default method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testSubArray(arr)", arr, EXTDCLASS.testSubArray(arr) ); + +// fill in the rest of the cases here + +// ******************************************** +// access public static method from a public +// method of a sub class +// +// ******************************************** + +EXTDCLASS = new ExtDefaultClassPubStat(); +AddTestCase( "*** Access public static method from public method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.pubSubSetArray(arr), EXTDCLASS.pubSubGetArray()", arr, (EXTDCLASS.pubSubSetArray(arr), EXTDCLASS.pubSubGetArray()) ); + +// fill in the rest of the cases here + +// ******************************************** +// access public static method from a private +// method of a sub class +// +// ******************************************** + +EXTDCLASS = new ExtDefaultClassPubStat(); +AddTestCase( "*** Access public static method from private method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testPrivSubArray(arr)", arr, EXTDCLASS.testPrivSubArray(arr) ); + +// fill in the rest of the cases here + +// ******************************************** +// access public static method from a static +// method of a sub class +// +// ******************************************** + +AddTestCase( "*** Access public static method from static method of sub class ***", 1, 1 ); +AddTestCase( "ExtDefaultClassPubStat.testStatSubArray(arr)", arr, ExtDefaultClassPubStat.testStatSubArray(arr) ); + +// fill in the rest of the cases here + +// ******************************************** +// access public static method from a public static +// method of a sub class +// +// ******************************************** + +AddTestCase( "*** Access public static method from public static method of sub class ***", 1, 1 ); +AddTestCase( "ExtDefaultClassPubStat.pubStatSubSetArray(arr), ExtDefaultClassPubStat.pubStatSubGetArray()", arr, + (ExtDefaultClassPubStat.pubStatSubSetArray(arr), ExtDefaultClassPubStat.pubStatSubGetArray()) ); + +// fill in the rest of the cases here + +// ******************************************** +// access public static method from a private static +// method of a sub class +// +// ******************************************** + +var EXTDEFAULTCLASS = new ExtDefaultClassPubStat(); +AddTestCase( "*** Access public static method from private static method of sub class ***", 1, 1 ); +AddTestCase( "EXTDEFAULTCLASS.testPrivStatSubArray(arr)", arr, EXTDEFAULTCLASS.testPrivStatSubArray(arr) ); + +// fill in the rest of the cases here + +// ******************************************** +// access public static property from +// default method in sub class +// ******************************************** + +EXTDCLASS = new ExtDefaultClassPubStat(); +AddTestCase( "*** Access public static property from default method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testSubDPArray(arr)", arr, EXTDCLASS.testSubDPArray(arr) ); + +// fill in the rest of the cases here + + +// ******************************************** +// access public static property from +// public method in sub class +// ******************************************** + +EXTDCLASS = new ExtDefaultClassPubStat(); +AddTestCase( "*** Access public static property from public method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.pubSubSetDPArray(arr), EXTDCLASS.pubSubGetDPArray()", arr, (EXTDCLASS.pubSubSetDPArray(arr), EXTDCLASS.pubSubGetDPArray()) ); + +// fill in the rest of the cases here + +// ******************************************** +// access public static property from +// private method in sub class +// ******************************************** + +EXTDCLASS = new ExtDefaultClassPubStat(); +AddTestCase( "*** Access public static property from private method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testPrivSubDPArray(arr)", arr, EXTDCLASS.testPrivSubDPArray(arr) ); + +// fill in the rest of the cases here + +// ******************************************** +// access public static property from +// static method in sub class +// ******************************************** + +AddTestCase( "*** Access public static property from static method in sub class ***", 1, 1 ); +AddTestCase( "ExtDefaultClassPubStat.testStatSubPArray(arr)", arr, ExtDefaultClassPubStat.testStatSubPArray(arr) ); + +// ******************************************** +// access public static property from +// public static method in sub class +// ******************************************** + +AddTestCase( "*** Access public static property from public static method in sub class ***", 1, 1 ); +AddTestCase( "ExtDefaultClassPubStat.pubStatSubSetSPArray(arr), ExtDefaultClassPubStat.pubStatSubGetSPArray()", arr, + (ExtDefaultClassPubStat.pubStatSubSetSPArray(arr), ExtDefaultClassPubStat.pubStatSubGetSPArray()) ); + +// ******************************************** +// access public static property from +// private static method in sub class +// ******************************************** + +EXTDCLASS = new ExtDefaultClassPubStat(); +AddTestCase( "*** Access public static property from private static method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testPrivStatSubPArray(arr)", arr, EXTDCLASS.testPrivStatSubPArray(arr)); + +// fill in the rest of the cases here + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDefaultClassPubStat/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDefaultClassPubStat/DefaultClass.as new file mode 100644 index 00000000000..2b3618393b9 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDefaultClassPubStat/DefaultClass.as @@ -0,0 +1,264 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DefaultClass { + + class DefaultClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + //public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + } + + public class DefaultClass extends DefaultClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDefaultClassPubStat/ExtDefaultClassPubStat.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDefaultClassPubStat/ExtDefaultClassPubStat.as new file mode 100644 index 00000000000..287b25b8802 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDefaultClassPubStat/ExtDefaultClassPubStat.as @@ -0,0 +1,206 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DefaultClass { + + import DefaultClass.* + + class ExtDefaultClassPubStatInner extends DefaultClass { + + // ************************************ + // access public static method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return getPubStatArray(); } + function subSetArray(a:Array) { setPubStatArray(a); } + + public function testSubArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + + // ************************************ + // access public static method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return getPubStatArray(); } + public function pubSubSetArray(a:Array) { setPubStatArray(a); } + + // ************************************ + // access public static method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return getPubStatArray(); } + private function privSubSetArray(a:Array) { setPubStatArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + // *************************************** + // access public static method of parent + // from static method of sub class + // *************************************** + + static function statSubGetArray() : Array { return getPubStatArray(); } + static function statSubSetArray(a:Array) { setPubStatArray(a); } + + public static function testStatSubArray(a:Array) : Array { + statSubSetArray(a); + return statSubGetArray(); + } + + + // *************************************** + // access public static method of parent + // from public static method of sub class + // *************************************** + + public static function pubStatSubGetArray() : Array { return getPubStatArray(); } + public static function pubStatSubSetArray(a:Array) { setPubStatArray(a); } + + // *************************************** + // access public static method of parent + // from private static method of sub class + // *************************************** + + private static function privStatSubGetArray() : Array { return getPubStatArray(); } + private static function privStatSubSetArray(a:Array) { setPubStatArray(a); } + + // public accessor to test asrt + public function testPrivStatSubArray(a:Array) : Array { + privStatSubSetArray(a); + return privStatSubGetArray(); + } + + // *************************************** + // access public static property from + // default method of sub class + // *************************************** + + function subGetDPArray() : Array { return pubStatArray; } + function subSetDPArray(a:Array) { pubStatArray = a; } + + public function testSubDPArray(a:Array) : Array { + subSetDPArray( a ); + return subGetDPArray(); + } + + + // *************************************** + // access public static property from + // public method of sub class + // *************************************** + + public function pubSubGetDPArray() : Array { return pubStatArray; } + public function pubSubSetDPArray(a:Array) { pubStatArray = a; } + + // *************************************** + // access public static property from + // private method of sub class + // *************************************** + + private function privSubGetDPArray() : Array { return pubStatArray; } + private function privSubSetDPArray(a:Array) { pubStatArray = a; } + + public function testPrivSubDPArray(a:Array) : Array { + privSubSetDPArray( a ); + return privSubGetDPArray(); + } + + + // *************************************** + // access public static property from + // static method of sub class + // *************************************** + + static function statSubGetSPArray() : Array { return pubStatArray; } + static function statSubSetSPArray(a:Array) { pubStatArray = a; } + + public static function testStatSubPArray(a:Array) : Array { + statSubSetSPArray( a ); + return statSubGetSPArray(); + } + + + // *************************************** + // access public static property from + // public static method of sub class + // *************************************** + + public static function pubStatSubGetSPArray() : Array { return pubStatArray; } + public static function pubStatSubSetSPArray(a:Array) { pubStatArray = a; } + + // *************************************** + // access public static property from + // private static method of sub class + // *************************************** + + private static function privStatSubGetSPArray() : Array { return pubStatArray; } + private static function privStatSubSetSPArray(a:Array) { pubStatArray = a; } + + // public accessor for asrt + public function testPrivStatSubPArray(a:Array) : Array { + privStatSubSetSPArray( a ); + return privStatSubGetSPArray(); + } + } +public class ExtDefaultClassPubStat extends ExtDefaultClassPubStatInner { + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { DefaultClassInner.setPubStatArray(a); } + public static function setPubStatBoolean( b:Boolean ) { DefaultClassInner.setPubStatBoolean(b); } + + public static function getPubStatArray() { return DefaultClassInner.getPubStatArray(); } + + // *************************************** + // access public static method of parent + // from public static method of sub class + // *************************************** + + public static function pubStatSubGetArray() : Array { return ExtDefaultClassPubStatInner.pubStatSubGetArray(); } + public static function pubStatSubSetArray(a:Array) { ExtDefaultClassPubStatInner.pubStatSubSetArray(a); } + + public static function testStatSubArray(a:Array) : Array { return ExtDefaultClassPubStatInner.testStatSubArray(a); } + public static function testStatSubPArray(a:Array) : Array { return ExtDefaultClassPubStatInner.testStatSubPArray(a); } + + public static function pubStatSubGetSPArray() : Array { return ExtDefaultClassPubStatInner.pubStatSubGetSPArray(); } + public static function pubStatSubSetSPArray(a:Array) { ExtDefaultClassPubStatInner.pubStatSubSetSPArray(a); } +} +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDefaultClassStat.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDefaultClassStat.as new file mode 100644 index 00000000000..6c5c7d914eb --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDefaultClassStat.as @@ -0,0 +1,179 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "Clean AS2"; // Version of JavaScript or ECMA +var TITLE = "Extend Default Class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +import DefaultClass.*; + +arr = new Array(1, 2, 3); + + +// ******************************************** +// access static method from a default +// method of a sub class +// +// ******************************************** + +EXTDCLASS = new ExtDefaultClassStat(); +AddTestCase( "*** Access static method from default method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testSubArray(arr)", arr, EXTDCLASS.testSubArray(arr) ); + +// fill in the rest of the cases here + + +// ******************************************** +// access static method from a public +// method of a sub class +// +// ******************************************** + +EXTDCLASS = new ExtDefaultClassStat(); +AddTestCase( "*** Access static method from public method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.pubSubSetArray(arr), EXTDCLASS.pubSubGetArray()", arr, (EXTDCLASS.pubSubSetArray(arr), EXTDCLASS.pubSubGetArray()) ); + +// fill in the rest of the cases here + +// ******************************************** +// access static method from a private +// method of a sub class +// +// ******************************************** + +EXTDCLASS = new ExtDefaultClassStat(); +AddTestCase( "*** Access static method from private method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testPrivSubArray(arr)", arr, EXTDCLASS.testPrivSubArray(arr) ); + +// fill in the rest of the cases here + +// ******************************************** +// access static method from a static +// method of a sub class +// +// ******************************************** + +AddTestCase( "*** Access static method from static method of sub class ***", 1, 1 ); +AddTestCase( "ExtDefaultClassStat.testStatSubArray(arr)", arr, ExtDefaultClassStat.testStatSubArray(arr) ); + +// fill in the rest of the cases here + +// ******************************************** +// access static method from a public static +// method of a sub class +// +// ******************************************** + +AddTestCase( "*** Access static method from public static method of sub class ***", 1, 1 ); +AddTestCase( "ExtDefaultClassStat.pubStatSubSetArray(arr), ExtDefaultClassStat.pubStatSubGetArray()", arr, + (ExtDefaultClassStat.pubStatSubSetArray(arr), ExtDefaultClassStat.pubStatSubGetArray()) ); + +// fill in the rest of the cases here + +// ******************************************** +// access static method from a private static +// method of a sub class +// +// ******************************************** + +AddTestCase( "*** Access static method from private static method of sub class ***", 1, 1 ); +AddTestCase( "ExtDefaultClassStat.testPrivStatSubArray(arr)", arr, ExtDefaultClassStat.testPrivStatSubArray(arr) ); + +// fill in the rest of the cases here + +// ******************************************** +// access static property from +// default method in sub class +// ******************************************** + +EXTDCLASS = new ExtDefaultClassStat(); +AddTestCase( "*** Access static property from default method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testSubDPArray(arr)", arr, EXTDCLASS.testSubDPArray(arr) ); + +// fill in the rest of the cases here + + +// ******************************************** +// access static property from +// public method in sub class +// ******************************************** + +EXTDCLASS = new ExtDefaultClassStat(); +AddTestCase( "*** Access static property from public method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.pubSubSetDPArray(arr), EXTDCLASS.pubSubGetDPArray()", arr, (EXTDCLASS.pubSubSetDPArray(arr), EXTDCLASS.pubSubGetDPArray()) ); + +// fill in the rest of the cases here + +// ******************************************** +// access static property from +// private method in sub class +// ******************************************** + +EXTDCLASS = new ExtDefaultClassStat(); +AddTestCase( "*** Access static property from private method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testPrivSubDPArray(arr)", arr, EXTDCLASS.testPrivSubDPArray(arr) ); + +// fill in the rest of the cases here + +// ******************************************** +// access static property from +// static method in sub class +// ******************************************** + +AddTestCase( "*** Access static property from static method in sub class ***", 1, 1 ); +AddTestCase( "ExtDefaultClassStat.testStatSubPArray(arr)", arr, ExtDefaultClassStat.testStatSubPArray(arr) ); + +// ******************************************** +// access static property from +// public static method in sub class +// ******************************************** + +AddTestCase( "*** Access static property from public static method in sub class ***", 1, 1 ); +AddTestCase( "ExtDefaultClassStat.pubStatSubSetSPArray(arr), ExtDefaultClassStat.pubStatSubGetSPArray()", arr, + (ExtDefaultClassStat.pubStatSubSetSPArray(arr), ExtDefaultClassStat.pubStatSubGetSPArray()) ); + +// ******************************************** +// access static property from +// private static method in sub class +// ******************************************** + +EXTDCLASS = new ExtDefaultClassStat(); +AddTestCase( "*** Access static property from private static method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testPrivStatSubPArray(arr)", arr, EXTDCLASS.testPrivStatSubPArray(arr)); + +// fill in the rest of the cases here + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDefaultClassStat/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDefaultClassStat/DefaultClass.as new file mode 100644 index 00000000000..2b3618393b9 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDefaultClassStat/DefaultClass.as @@ -0,0 +1,264 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DefaultClass { + + class DefaultClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + //public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + } + + public class DefaultClass extends DefaultClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDefaultClassStat/ExtDefaultClassStat.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDefaultClassStat/ExtDefaultClassStat.as new file mode 100644 index 00000000000..4abe9ee4584 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDefaultClassStat/ExtDefaultClassStat.as @@ -0,0 +1,191 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DefaultClass { + + import DefaultClass.* + + class ExtDefaultClassStatInner extends DefaultClass { + + // ************************************ + // access static method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return getStatArray(); } + function subSetArray(a:Array) { setStatArray(a); } + + public function testSubArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + + // ************************************ + // access static method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return getStatArray(); } + public function pubSubSetArray(a:Array) { setStatArray(a); } + + // ************************************ + // access static method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return getStatArray(); } + private function privSubSetArray(a:Array) { setStatArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + // *************************************** + // access static method of parent + // from static method of sub class + // *************************************** + + static function statSubGetArray() : Array { return getStatArray(); } + static function statSubSetArray(a:Array) { setStatArray(a); } + + public static function testStatSubArray(a:Array) : Array { + statSubSetArray(a); + return statSubGetArray(); + } + + + // *************************************** + // access static method of parent + // from public static method of sub class + // *************************************** + + public static function pubStatSubGetArray() : Array { return getStatArray(); } + public static function pubStatSubSetArray(a:Array) { setStatArray(a); } + + // *************************************** + // access static method of parent + // from private static method of sub class + // *************************************** + + private static function privStatSubGetArray() : Array { return getStatArray(); } + private static function privStatSubSetArray(a:Array) { setStatArray(a); } + + // public accessor to test asrt + public static function testPrivStatSubArray(a:Array) : Array { + privStatSubSetArray(a); + return privStatSubGetArray(); + } + + // *************************************** + // access static property from + // default method of sub class + // *************************************** + + function subGetDPArray() : Array { return statArray; } + function subSetDPArray(a:Array) { statArray = a; } + + public function testSubDPArray(a:Array) : Array { + subSetDPArray( a ); + return subGetDPArray(); + } + + + // *************************************** + // access static property from + // public method of sub class + // *************************************** + + public function pubSubGetDPArray() : Array { return statArray; } + public function pubSubSetDPArray(a:Array) { statArray = a; } + + // *************************************** + // access static property from + // private method of sub class + // *************************************** + + private function privSubGetDPArray() : Array { return statArray; } + private function privSubSetDPArray(a:Array) { statArray = a; } + + public function testPrivSubDPArray(a:Array) : Array { + privSubSetDPArray( a ); + return privSubGetDPArray(); + } + + + // *************************************** + // access static property from + // static method of sub class + // *************************************** + + static function statSubGetSPArray() : Array { return statArray; } + static function statSubSetSPArray(a:Array) { statArray = a; } + + public static function testStatSubPArray(a:Array) : Array { + statSubSetSPArray( a ); + return statSubGetSPArray(); + } + + + // *************************************** + // access static property from + // public static method of sub class + // *************************************** + + public static function pubStatSubGetSPArray() : Array { return statArray; } + public static function pubStatSubSetSPArray(a:Array) { statArray = a; } + + // *************************************** + // access static property from + // private static method of sub class + // *************************************** + + private static function privStatSubGetSPArray() : Array { return statArray; } + private static function privStatSubSetSPArray(a:Array) { statArray = a; } + + // public accessor for asrt + public function testPrivStatSubPArray(a:Array) : Array { + privStatSubSetSPArray( a ); + return privStatSubGetSPArray(); + } + } +public class ExtDefaultClassStat extends ExtDefaultClassStatInner { + public static function pubStatSubGetArray() : Array { return ExtDefaultClassStatInner.pubStatSubGetArray(); } + public static function pubStatSubSetArray(a:Array) { ExtDefaultClassStatInner.pubStatSubSetArray(a); } + public static function pubStatSubGetSPArray() : Array { return ExtDefaultClassStatInner.pubStatSubGetSPArray(); } + public static function pubStatSubSetSPArray(a:Array) { ExtDefaultClassStatInner.pubStatSubSetSPArray(a); } + public static function testStatSubArray(a:Array) : Array { return ExtDefaultClassStatInner.testStatSubArray(a); } + public static function testStatSubPArray(a:Array) : Array { return ExtDefaultClassStatInner.testStatSubPArray(a); } + public static function testPrivStatSubArray(a:Array) : Array { return ExtDefaultClassStatInner.testPrivStatSubArray(a); } +} +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDefaultProtClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDefaultProtClass.as new file mode 100644 index 00000000000..4f68f59faba --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDefaultProtClass.as @@ -0,0 +1,239 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import DefaultProtClass.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Extend Default Class With Protected Variables/Methods"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + +// ******************************************** +// access protected method from a default +// method of a sub class +// +// ******************************************** + +var arr = new Array(1,2,3); +EXTDCLASS = new ExtDefaultProtClass(); +AddTestCase( "access 'protected' method from 'default' method of sub class", arr, (EXTDCLASS.testSubGetSetArray(arr)) ); + + +// ******************************************** +// access protected method from a public +// method of a sub class +// ******************************************** + +arr = new Array( 4, 5, 6 ); +EXTDCLASS = new ExtDefaultProtClass(); +AddTestCase( "access 'protected' method from 'public' method of sub class", arr, + (EXTDCLASS.pubSubSetArray(arr), EXTDCLASS.pubSubGetArray()) ); + +// ******************************************** +// access protected method from a final +// method of a sub class +// ******************************************** + +arr = new Array( "one", "two", "three" ); +EXTDCLASS = new ExtDefaultProtClass(); +AddTestCase( "access 'protected' method from 'final' method of sub class", arr, (EXTDCLASS.testFinSubArray(arr)) ); + +// ******************************************** +// access protected method from a public +// final method of a sub class +// ******************************************** + +arr = new Array( 8, "two", 9 ); +EXTDCLASS = new ExtDefaultProtClass(); +AddTestCase( "access 'protected' method from 'public final' method of sub class", arr, + (EXTDCLASS.pubFinSubSetArray(arr), EXTDCLASS.pubFinSubGetArray()) ); + +// ******************************************** +// access protected method from a final +// private method of a sub class +// ******************************************** + +arr = new Array( "one", "two", "three" ); +EXTDCLASS = new ExtDefaultProtClass(); +AddTestCase( "access 'protected' method from 'private final' method of sub class", arr, (EXTDCLASS.testPrivFinSubArray(arr)) ); + +// ******************************************** +// access protected method from a private +// method of a sub class +// ******************************************** + +arr = new Array( 5, 6, 7 ); +EXTDCLASS = new ExtDefaultProtClass(); +AddTestCase( "access 'protected' method from 'private' method of sub class", arr, EXTDCLASS.testPrivSubArray(arr) ); + +// ******************************************** +// access protected method from a virtual +// method of a sub class +// ******************************************** + +AddTestCase( "access 'protected' method from 'virtual' method of sub class", arr, + EXTDCLASS.testVirtSubArray(arr) ); + +// ******************************************** +// access protected method from a virtual +// public method of a sub class +// ******************************************** + +AddTestCase( "access 'protected' method from 'public virtual' method of sub class", arr, + (EXTDCLASS.pubVirtSubSetArray(arr), EXTDCLASS.pubVirtSubGetArray()) ); + +// ******************************************** +// access protected method from a virtual +// private method of a sub class +// ******************************************** + +AddTestCase( "access 'protected' method from 'private virtual' method of sub class", arr, + EXTDCLASS.testPrivVirtSubArray(arr) ); + +// ******************************************** +// access protected method from static +// method of sub class +// ******************************************** + +var thisError = "no exception thrown"; +try{ + ExtDefaultProtClass.pubStatSubGetArray(); +} catch (e1) { + thisError = e1.toString(); +} finally { + AddTestCase( "access 'protected' method from 'static' method of the sub class", + TYPEERROR+1006, + typeError( thisError) ); +} + +// ******************************************** +// access protected property from +// default method in sub class +// ******************************************** + +EXTDCLASS = new ExtDefaultProtClass(); +AddTestCase( "access 'protected' property from 'default' method of sub class", arr, + (EXTDCLASS.testSubGetSetDPArray(arr)) ); + +// ******************************************** +// access protected property from +// final method in sub class +// ******************************************** + +EXTDCLASS = new ExtDefaultProtClass(); +AddTestCase( "access 'protected' property from 'final' method of sub class", arr, + (EXTDCLASS.testFinSubDPArray(arr)) ); + +// ******************************************** +// access protected property from +// virtual method in sub class +// ******************************************** + +EXTDCLASS = new ExtDefaultProtClass(); +AddTestCase( "access 'protected' property from 'virtual' method of sub class", arr, + (EXTDCLASS.testVirtSubDPArray(arr)) ); + +// ******************************************** +// access protected property from +// public method in sub class +// ******************************************** + +EXTDCLASS = new ExtDefaultProtClass(); +AddTestCase( "access 'protected' property from 'public' method of sub class", arr, + (EXTDCLASS.pubSubSetDPArray(arr), EXTDCLASS.pubSubGetDPArray()) ); + +// ******************************************** +// access protected property from +// private method in sub class +// ******************************************** + +EXTDCLASS = new ExtDefaultProtClass(); +AddTestCase( "access 'protected' property from 'private' method of sub class", arr, + (EXTDCLASS.testPrivSubDPArray(arr)) ); + +// ******************************************** +// access protected property from +// public final method in sub class +// ******************************************** + +EXTDCLASS = new ExtDefaultProtClass(); +AddTestCase( "access 'protected' property from 'public final' method of sub class", arr, + (EXTDCLASS.pubFinSubSetDPArray(arr), EXTDCLASS.pubFinSubGetDPArray()) ); + +// ******************************************** +// access protected property from +// public virtual method in sub class +// ******************************************** + +EXTDCLASS = new ExtDefaultProtClass(); +AddTestCase( "access 'protected' property from 'public virtual' method of sub class", arr, + (EXTDCLASS.pubVirtSubSetDPArray(arr), EXTDCLASS.pubVirtSubGetDPArray()) ); + +// ******************************************** +// access protected property from +// private final method in sub class +// ******************************************** + +EXTDCLASS = new ExtDefaultProtClass(); +AddTestCase( "access 'protected' property from 'private final' method of sub class", arr, + (EXTDCLASS.testPrivFinSubDPArray(arr)) ); + +// ******************************************** +// access protected property from +// private virtual method in sub class +// ******************************************** + +EXTDCLASS = new ExtDefaultProtClass(); +AddTestCase( "access 'protected' property from 'private virtual' method of sub class", arr, + (EXTDCLASS.testPrivVirtSubDPArray(arr)) ); + +// ******************************************** +// access protected property from +// static public method of sub class +// ******************************************** + +thisError = "no error thrown"; +try{ + ExtDefaultProtClass.pubStatSubGetDPArray(); +} catch(e3) { + thisError = e3.toString(); +} finally { + AddTestCase( "access protected property from static public method of sub class", + TYPEERROR+1006, + typeError( thisError ) ); +} + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDefaultProtClass/DefaultProtClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDefaultProtClass/DefaultProtClass.as new file mode 100644 index 00000000000..e095649ff05 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDefaultProtClass/DefaultProtClass.as @@ -0,0 +1,112 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DefaultProtClass { + + class DefaultProtClassInner { + + protected var protArray:Array; + protected var protBoolean:Boolean; + protected var protDate:Date; + protected var protFunction:Function; + protected var protMath:Math; + protected var protNumber:Number; + protected var protObject:Object; + protected var protString:String; + //protected var protSimple:Simple; + + protected static var protStatArray:Array; + protected static var protStatBoolean:Boolean; + protected static var protStatDate:Date; + protected static var protStatFunction:Function; + protected static var protStatMath:Math; + protected static var protStatNumber:Number; + protected static var protStatObject:Object; + protected static var protStatString:String; + //protected static var protStatSimple:Simple; + + // ***************************** + // to be overloaded + // ***************************** + + protected var protOverLoadVar; + protected static var protStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClassProt() { + } + + // ******************* + // protected methods + // ******************* + + protected function setProtArray( a:Array ) { protArray = a; } + protected function setProtBoolean( b:Boolean ) { protBoolean = b; } + protected function setProtDate( d:Date ) { protDate = d; } + protected function setProtFunction( f:Function ) { protFunction = f; } + protected function setProtMath( m:Math ) { protMath = m; } + protected function setProtNumber( n:Number ) { protNumber = n; } + protected function setProtObject( o:Object ) { protObject = o; } + protected function setProtString( s:String ) { protString = s; } + //protected function setProtSimple( s:Simple ) { protSimple = s; } + + protected function getProtArray() : Array { return this.protArray; } + protected function getProtBoolean() : Boolean { return this.protBoolean; } + protected function getProtDate() : Date { return this.protDate; } + protected function getProtFunction() : Function { return this.protFunction; } + protected function getProtMath() : Math { return this.protMath; } + protected function getProtNumber() : Number { return this.protNumber; } + protected function getProtObject() : Object { return this.protObject; } + protected function getProtString() : String { return this.protString; } + //protected function getProtSimple() : Simple { return this.protSimple; } + + // ************************** + // protected static methods + // ************************** + + protected static function setProtStatArray(a:Array) { protStatArray=a; } + protected static function setProtStatBoolean( b:Boolean ) { protStatBoolean = b; } + + protected static function getProtStatArray() { return protStatArray; } + + // *************************** + // to be overloaded + // *************************** + + protected function protOverLoad() { return "This is the parent class"; } + protected static function protStatOverLoad() { return "This is the parent class"; } + } + + public class DefaultProtClass extends DefaultProtClassInner { } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDefaultProtClass/ExtDefaultProtClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDefaultProtClass/ExtDefaultProtClass.as new file mode 100644 index 00000000000..909eb79cad6 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDefaultProtClass/ExtDefaultProtClass.as @@ -0,0 +1,276 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DefaultProtClass { + + import DefaultProtClass.* + + // this is the test case so we can't alter it too much + // change the name of the class to ExtDefaultProtClassTest + // we'll create a public class ExtDefaultProtClass that + // extends it for testing runtime + class ExtDefaultProtClassTest extends DefaultProtClass { + + // ************************************ + // access protected method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return this.getProtArray(); } + function subSetArray(a:Array) { this.setProtArray(a); } + + // this is needed so that the test cases can access this from + // outside the class. This way the test case itself preserved + public function testSubGetSetArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + // ************************************ + // access protected method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return this.getProtArray(); } + public function pubSubSetArray(a:Array) { this.setProtArray(a); } + + // ************************************ + // access protected method of parent + // from final method of sub class + // + // final will behave the same as default + // ************************************ + + final function finSubGetArray() : Array { return this.getProtArray(); } + final function finSubSetArray(a:Array) { this.setProtArray(a); } + + public function testFinSubArray(a:Array):Array{ + this.finSubSetArray(a); + return this.finSubGetArray(); + } + + // ************************************ + // access protected method of parent + // from public final method of sub class + // ************************************ + + public final function pubFinSubGetArray() : Array { return this.getProtArray(); } + final public function pubFinSubSetArray(a:Array) { this.setProtArray(a); } + + // ************************************ + // access protected method of parent + // from private final method of sub class + // ************************************ + + private final function privFinSubGetArray() : Array { return this.getProtArray(); } + final private function privFinSubSetArray(a:Array) { this.setProtArray(a); } + + public function testPrivFinSubArray(a:Array):Array { + this.privFinSubSetArray(a); + return this.privFinSubGetArray(); + } + + + // ************************************ + // access protected method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return this.getProtArray(); } + private function privSubSetArray(a:Array) { this.setProtArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + // ************************************ + // access protected method of parent + // from virtual method of sub class + // ************************************ + + virtual function virtSubGetArray() : Array { return this.getProtArray(); } + virtual function virtSubSetArray(a:Array) { this.setProtArray(a); } + + public function testVirtSubArray(a:Array) : Array { + this.virtSubSetArray(a); + return this.virtSubGetArray(); + } + + // ************************************ + // access protected method of parent + // from public virtual method of sub class + // ************************************ + + virtual public function pubVirtSubGetArray() : Array { return this.getProtArray(); } + public virtual function pubVirtSubSetArray(a:Array) { this.setProtArray(a); } + + // ************************************ + // access protected method of parent + // from private virtual method of sub class + // ************************************ + + virtual private function privVirtSubGetArray() : Array { return this.getProtArray(); } + private virtual function privVirtSubSetArray(a:Array) { this.setProtArray(a); } + + public function testPrivVirtSubArray(a:Array) : Array { + this.privVirtSubSetArray(a); + return this.privVirtSubGetArray(); + } + + // *************************************** + // access protected property from + // static method of sub class + // *************************************** + + static function statSubGetArray():Array{ return getProtArray(); } + static public function pubStatSubGetArray():Array { return statSubGetArray(); } + + // *************************************** + // access protected property from + // default method of sub class + // *************************************** + + function subGetDPArray() : Array { return protArray; } + function subSetDPArray(a:Array) { protArray = a; } + + // this is needed so that the test cases can access this from + // outside the class. This way the test case itself preserved + public function testSubGetSetDPArray(a:Array) : Array { + this.subSetDPArray(a); + return this.subGetDPArray(); + } + + // *************************************** + // access protected property from + // final method of sub class + // *************************************** + + final function finSubGetDPArray() : Array { return protArray; } + final function finSubSetDPArray(a:Array) { protArray = a; } + + public function testFinSubDPArray(a:Array) : Array { + this.finSubSetDPArray(a); + return this.finSubGetDPArray(); + } + + // *************************************** + // access protected property from + // virtual method of sub class + // *************************************** + + virtual function virtSubGetDPArray() : Array { return protArray; } + virtual function virtSubSetDPArray(a:Array) { protArray = a; } + + public function testVirtSubDPArray(a:Array) : Array { + this.virtSubSetDPArray(a); + return this.virtSubGetDPArray(); + } + + // *************************************** + // access protected property from + // public method of sub class + // *************************************** + + public function pubSubGetDPArray() : Array { return this.protArray; } + public function pubSubSetDPArray(a:Array) { this.protArray = a; } + + // *************************************** + // access protected property from + // private method of sub class + // *************************************** + + private function privSubGetDPArray() : Array { return this.protArray; } + private function privSubSetDPArray(a:Array) { this.protArray = a; } + + public function testPrivSubDPArray(a:Array) : Array { + this.privSubSetDPArray(a); + return this.privSubGetDPArray(); + } + + // *************************************** + // access protected property from + // public final method of sub class + // *************************************** + + public final function pubFinSubGetDPArray() : Array { return this.protArray; } + final public function pubFinSubSetDPArray(a:Array) { this.protArray = a; } + + // *************************************** + // access protected property from + // public virtual method of sub class + // *************************************** + + public virtual function pubVirtSubGetDPArray() : Array { return this.protArray; } + virtual public function pubVirtSubSetDPArray(a:Array) { this.protArray = a; } + + // *************************************** + // access protected property from + // private final method of sub class + // *************************************** + + private final function privFinSubGetDPArray() : Array { return this.protArray; } + final private function privFinSubSetDPArray(a:Array) { this.protArray = a; } + + public function testPrivFinSubDPArray(a:Array):Array { + this.privFinSubSetDPArray(a); + return this.privFinSubGetDPArray(); + } + + // *************************************** + // access protected property from + // private virtual method of sub class + // *************************************** + + private virtual function privVirtSubGetDPArray() : Array { return this.protArray; } + virtual private function privVirtSubSetDPArray(a:Array) { this.protArray = a; } + + public function testPrivVirtSubDPArray(a:Array):Array { + this.privVirtSubSetDPArray(a); + return this.privVirtSubGetDPArray(); + } + + // *************************************** + // access protected property from + // public static method of sub class + // *************************************** + + public static function pubStatSubGetDPArray(){ + return protArray; + } + + } + + // same class as above except public + public class ExtDefaultProtClass extends ExtDefaultProtClassTest {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDynamicClass.as new file mode 100644 index 00000000000..bee45e379cb --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDynamicClass.as @@ -0,0 +1,42 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "Clean AS2"; // Version of JavaScript or ECMA +var TITLE = "Extend Dynamic Class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +import DynamicClass.*; + + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDynamicClass/DynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDynamicClass/DynamicClass.as new file mode 100644 index 00000000000..6dee1fbd55b --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDynamicClass/DynamicClass.as @@ -0,0 +1,243 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DynamicClass { + + + dynamic class DynamicClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + // public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // **************** + // constructor + // **************** + + function DynamicClass() { + } + + // ***************** + // default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + } + public class DynamicClass extends DynamicClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDynamicClass/ExtDynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDynamicClass/ExtDynamicClass.as new file mode 100644 index 00000000000..205bd83b709 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDynamicClass/ExtDynamicClass.as @@ -0,0 +1,113 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DynamicClass { + + import DynamicClass.*; + + class ExtDynamicClassInner extends DynamicClass { + + // ************************************ + // access default method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return this.getArray(); } + function subSetArray(a:Array) { this.setArray(a); } + + public function testSubSetArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + + // ************************************ + // access default method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return this.getArray(); } + public function pubSubSetArray(a:Array) { this.setArray(a); } + + // ************************************ + // access default method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return this.getArray(); } + private function privSubSetArray(a:Array) { this.setArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + // *************************************** + // access default property from + // default method of sub class + // *************************************** + + function subGetDPArray() : Array { return array; } + function subSetDPArray(a:Array) { array = a; } + + public function testSubSetDPArray(a:Array) : Array { + this.subSetDPArray(a); + return this.subGetDPArray(); + } + + + // *************************************** + // access default property from + // public method of sub class + // *************************************** + + public function pubSubGetDPArray() : Array { return this.array; } + public function pubSubSetDPArray(a:Array) { this.array = a; } + + // *************************************** + // access default property from + // private method of sub class + // *************************************** + + private function privSubGetDPArray() : Array { return this.array; } + private function privSubSetDPArray(a:Array) { this.array = a; } + + public function testPrivSubSetDPArray(a:Array) : Array { + this.privSubSetDPArray(a); + return this.privSubGetDPArray(); + } + + + } +public class ExtDynamicClass extends ExtDynamicClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDynamicClassPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDynamicClassPub.as new file mode 100644 index 00000000000..59576124241 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDynamicClassPub.as @@ -0,0 +1,43 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "Clean AS2"; // Version of JavaScript or ECMA +var TITLE = "Extend Default Class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +import DynamicClass.*; + +var EXTDCLASS = new ExtDynamicClassPub(); + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDynamicClassPub/DynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDynamicClassPub/DynamicClass.as new file mode 100644 index 00000000000..6dee1fbd55b --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDynamicClassPub/DynamicClass.as @@ -0,0 +1,243 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DynamicClass { + + + dynamic class DynamicClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + // public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // **************** + // constructor + // **************** + + function DynamicClass() { + } + + // ***************** + // default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + } + public class DynamicClass extends DynamicClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDynamicClassPub/ExtDynamicClassPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDynamicClassPub/ExtDynamicClassPub.as new file mode 100644 index 00000000000..c58303d51f7 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDynamicClassPub/ExtDynamicClassPub.as @@ -0,0 +1,113 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DynamicClass { + + import DynamicClass.*; + + class ExtDynamicClassPubInner extends DynamicClass { + + // ************************************ + // access public method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return this.getPubArray(); } + function subSetArray(a:Array) { this.setPubArray(a); } + + public function testSubSetArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + + // ************************************ + // access public method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return this.getPubArray(); } + public function pubSubSetArray(a:Array) { this.setPubArray(a); } + + // ************************************ + // access public method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return this.getPubArray(); } + private function privSubSetArray(a:Array) { this.setPubArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + // *************************************** + // access public property from + // default method of sub class + // *************************************** + + function subGetDPArray() : Array { return pubArray; } + function subSetDPArray(a:Array) { pubArray = a; } + + public function testSubSetDPArray(a:Array) : Array { + this.subSetDPArray(a); + return this.subGetDPArray(); + } + + + // *************************************** + // access public property from + // public method of sub class + // *************************************** + + public function pubSubGetDPArray() : Array { return this.pubArray; } + public function pubSubSetDPArray(a:Array) { this.pubArray = a; } + + // *************************************** + // access public property from + // private method of sub class + // *************************************** + + private function privSubGetDPArray() : Array { return this.pubArray; } + private function privSubSetDPArray(a:Array) { this.pubArray = a; } + + public function testPrivSubSetDPArray(a:Array) : Array { + this.privSubSetDPArray(a); + return this.privSubGetDPArray(); + } + + + } +public class ExtDynamicClassPub extends ExtDynamicClassPubInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDynamicClassPubStat.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDynamicClassPubStat.as new file mode 100644 index 00000000000..bd1b4cbf81a --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDynamicClassPubStat.as @@ -0,0 +1,43 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "Clean AS2"; // Version of JavaScript or ECMA +var TITLE = "Extend Dynamic Class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +import DynamicClass.*; + +arr = new Array(1, 2, 3); + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDynamicClassPubStat/DynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDynamicClassPubStat/DynamicClass.as new file mode 100644 index 00000000000..6dee1fbd55b --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDynamicClassPubStat/DynamicClass.as @@ -0,0 +1,243 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DynamicClass { + + + dynamic class DynamicClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + // public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // **************** + // constructor + // **************** + + function DynamicClass() { + } + + // ***************** + // default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + } + public class DynamicClass extends DynamicClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDynamicClassPubStat/ExtDynamicClassPubStat.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDynamicClassPubStat/ExtDynamicClassPubStat.as new file mode 100644 index 00000000000..396b3d8dae5 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDynamicClassPubStat/ExtDynamicClassPubStat.as @@ -0,0 +1,198 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DynamicClass { + + import DynamicClass.*; + + class ExtDynamicClassPubStatInner extends DynamicClass { + + // ************************************ + // access public static method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return getPubStatArray(); } + function subSetArray(a:Array) { setPubStatArray(a); } + + public function testSubSetArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + + // ************************************ + // access public static method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return getPubStatArray(); } + public function pubSubSetArray(a:Array) { setPubStatArray(a); } + + // ************************************ + // access public static method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return getPubStatArray(); } + private function privSubSetArray(a:Array) { setPubStatArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + // *************************************** + // access public static method of parent + // from static method of sub class + // *************************************** + + static function statSubGetArray() : Array { return getPubStatArray(); } + static function statSubSetArray(a:Array) { setPubStatArray(a); } + + public static function testStatSubSetArray(a:Array) : Array { + statSubSetArray(a); + return statSubGetArray(); + } + + + // *************************************** + // access public static method of parent + // from public static method of sub class + // *************************************** + + public static function pubStatSubGetArray() : Array { return getPubStatArray(); } + public static function pubStatSubSetArray(a:Array) { setPubStatArray(a); } + + // *************************************** + // access public static method of parent + // from private static method of sub class + // *************************************** + + private static function privStatSubGetArray() : Array { return getPubStatArray(); } + private static function privStatSubSetArray(a:Array) { setPubStatArray(a); } + + // public accessor to test asrt + public function testPrivStatSubArray(a:Array) : Array { + privStatSubSetArray(a); + return privStatSubGetArray(); + } + + // *************************************** + // access public static property from + // default method of sub class + // *************************************** + + function subGetDPArray() : Array { return pubStatArray; } + function subSetDPArray(a:Array) { pubStatArray = a; } + + public function testSubSetDPArray(a:Array) : Array { + this.subSetDPArray(a); + return this.subGetDPArray(); + } + + + // *************************************** + // access public static property from + // public method of sub class + // *************************************** + + public function pubSubGetDPArray() : Array { return pubStatArray; } + public function pubSubSetDPArray(a:Array) { pubStatArray = a; } + + // *************************************** + // access public static property from + // private method of sub class + // *************************************** + + private function privSubGetDPArray() : Array { return pubStatArray; } + private function privSubSetDPArray(a:Array) { pubStatArray = a; } + + + public function testPrivSubSetDPArray(a:Array) : Array { + this.privSubSetDPArray(a); + return this.privSubGetDPArray(); + } + + + // *************************************** + // access public static property from + // static method of sub class + // *************************************** + + static function statSubGetSPArray() : Array { return pubStatArray; } + static function statSubSetSPArray(a:Array) { pubStatArray = a; } + + public static function testStatSubSetDPArray(a:Array) : Array { + statSubSetSPArray(a); + return statSubGetSPArray(); + } + + + // *************************************** + // access public static property from + // public static method of sub class + // *************************************** + + public static function pubStatSubGetSPArray() : Array { return pubStatArray; } + public static function pubStatSubSetSPArray(a:Array) { pubStatArray = a; } + + // *************************************** + // access public static property from + // private static method of sub class + // *************************************** + + private static function privStatSubGetSPArray() : Array { return pubStatArray; } + private static function privStatSubSetSPArray(a:Array) { pubStatArray = a; } + + // public accessor for asrt + public function testPrivStatSubPArray(a:Array) : Array { + privStatSubSetSPArray( a ); + return privStatSubGetSPArray(); + } + } +public class ExtDynamicClassPubStat extends ExtDynamicClassPubStatInner { + static function setStatArray(a:Array) { DynamicClassInner.setStatArray(a); } + static function setStatBoolean( b:Boolean ) { DynamicClassInner.setStatBoolean(b); } + static function getStatArray() { return DynamicClassInner.getStatArray(); } + public static function setPubStatArray(a:Array) { DynamicClassInner.setPubStatArray(a); } + public static function setPubStatBoolean( b:Boolean ) { DynamicClassInner.setPubStatBoolean(b); } + public static function getPubStatArray() { return DynamicClassInner.getPubStatArray(); } + public static function testStatSubSetArray(a:Array) : Array { return ExtDynamicClassPubStatInner.testStatSubSetArray(a); } + public static function pubStatSubGetArray() : Array { return ExtDynamicClassPubStatInner.pubStatSubGetArray(); } + public static function pubStatSubSetArray(a:Array) { ExtDynamicClassPubStatInner.pubStatSubSetArray(a); } + public static function testStatSubSetDPArray(a:Array) : Array { return ExtDynamicClassPubStatInner.testStatSubSetDPArray(a); } + public static function pubStatSubGetSPArray() : Array { return ExtDynamicClassPubStatInner.pubStatSubGetSPArray(); } + public static function pubStatSubSetSPArray(a:Array) { ExtDynamicClassPubStatInner.pubStatSubSetSPArray(a); } +} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDynamicClassStat.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDynamicClassStat.as new file mode 100644 index 00000000000..3811597ac7e --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDynamicClassStat.as @@ -0,0 +1,185 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "Clean AS2"; // Version of JavaScript or ECMA +var TITLE = "Extend Dynamic Class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +import DynamicClass.*; + +arr = new Array(1, 2, 3); + + + +// ******************************************** +// access static method from a default +// method of a sub class +// +// ******************************************** + +EXTDCLASS = new ExtDynamicClassStat(); +AddTestCase( "*** Access static method from default method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testSubSetArray(arr)", arr, EXTDCLASS.testSubSetArray(arr) ); + +// fill in the rest of the cases here + + +// ******************************************** +// access static method from a public +// method of a sub class +// +// ******************************************** + +EXTDCLASS = new ExtDynamicClassStat(); +AddTestCase( "*** Access static method from public method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.pubSubSetArray(arr), EXTDCLASS.pubSubGetArray()", arr, (EXTDCLASS.pubSubSetArray(arr), EXTDCLASS.pubSubGetArray()) ); + +// fill in the rest of the cases here + +// ******************************************** +// access static method from a private +// method of a sub class +// +// ******************************************** + +EXTDCLASS = new ExtDynamicClassStat(); +AddTestCase( "*** Access static method from private method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testPrivSubArray(arr)", arr, EXTDCLASS.testPrivSubArray(arr) ); + +// fill in the rest of the cases here + +// ******************************************** +// access static method from a static +// method of a sub class +// +// ******************************************** + +EXTDCLASS = new ExtDynamicClassStat(); +AddTestCase( "*** Access static method from static method of sub class ***", 1, 1 ); +AddTestCase( "ExtDynamicClassStat.testStatSubSetArray(arr)", arr, EXTDCLASS.testStatSubSetArray(arr) ); + +// fill in the rest of the cases here + +// ******************************************** +// access static method from a public static +// method of a sub class +// +// ******************************************** + +EXTDCLASS = new ExtDynamicClassStat(); +AddTestCase( "*** Access static method from public static method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.pubStatSubSetArray(arr), EXTDCLASS.pubStatSubGetArray()", arr, + EXTDCLASS.testPubStatSubGetSetArray(arr) ); + +// fill in the rest of the cases here + +// ******************************************** +// access static method from a private static +// method of a sub class +// +// ******************************************** + +var EXTDEFAULTCLASS = new ExtDynamicClassStat(); +AddTestCase( "*** Access static method from private static method of sub class ***", 1, 1 ); +AddTestCase( "EXTDEFAULTCLASS.testPrivStatSubArray(arr)", arr, EXTDEFAULTCLASS.testPrivStatSubArray(arr) ); + +// fill in the rest of the cases here + +// ******************************************** +// access static property from +// default method in sub class +// ******************************************** + +EXTDCLASS = new ExtDynamicClassStat(); +AddTestCase( "*** Access static property from default method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testSubSetDPArray(arr)", arr, EXTDCLASS.testSubSetDPArray(arr) ); + +// fill in the rest of the cases here + + +// ******************************************** +// access static property from +// public method in sub class +// ******************************************** + +EXTDCLASS = new ExtDynamicClassStat(); +AddTestCase( "*** Access static property from public method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.pubSubSetDPArray(arr), EXTDCLASS.pubSubGetDPArray()", arr, (EXTDCLASS.pubSubSetDPArray(arr), EXTDCLASS.pubSubGetDPArray()) ); + +// fill in the rest of the cases here + +// ******************************************** +// access static property from +// private method in sub class +// ******************************************** + +EXTDCLASS = new ExtDynamicClassStat(); +AddTestCase( "*** Access static property from private method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testPrivSubSetDPArray(arr)", arr, EXTDCLASS.testPrivSubSetDPArray(arr) ); + +// fill in the rest of the cases here + +// ******************************************** +// access static property from +// static method in sub class +// ******************************************** + +EXTDCLASS = new ExtDynamicClassStat(); +AddTestCase( "*** Access static property from static method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testStatSubSetDPArray(arr)", arr, EXTDCLASS.testStatSubSetDPArray(arr) ); + +// ******************************************** +// access static property from +// public static method in sub class +// ******************************************** + +EXTDCLASS = new ExtDynamicClassStat(); +AddTestCase( "*** Access static property from public static method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.pubStatSubSetSPArray(arr), EXTDCLASS.pubStatSubGetSPArray()", arr, + EXTDCLASS.testPubStatSubGetSetSPArray(arr) ); + +// ******************************************** +// access static property from +// private static method in sub class +// ******************************************** + +EXTDCLASS = new ExtDynamicClassStat(); +AddTestCase( "*** Access static property from private static method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testPrivStatSubPArray(arr)", arr, EXTDCLASS.testPrivStatSubPArray(arr)); + +// fill in the rest of the cases here + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDynamicClassStat/DynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDynamicClassStat/DynamicClass.as new file mode 100644 index 00000000000..6dee1fbd55b --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDynamicClassStat/DynamicClass.as @@ -0,0 +1,243 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DynamicClass { + + + dynamic class DynamicClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + // public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // **************** + // constructor + // **************** + + function DynamicClass() { + } + + // ***************** + // default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + } + public class DynamicClass extends DynamicClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDynamicClassStat/ExtDynamicClassStat.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDynamicClassStat/ExtDynamicClassStat.as new file mode 100644 index 00000000000..00f79dc40e9 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtDynamicClassStat/ExtDynamicClassStat.as @@ -0,0 +1,197 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DynamicClass { + + import DynamicClass.*; + + class ExtDynamicClassStatInner extends DynamicClass { + + // ************************************ + // access static method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return getStatArray(); } + function subSetArray(a:Array) { setStatArray(a); } + + public function testSubSetArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + + // ************************************ + // access static method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return getStatArray(); } + public function pubSubSetArray(a:Array) { setStatArray(a); } + + // ************************************ + // access static method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return getStatArray(); } + private function privSubSetArray(a:Array) { setStatArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + // *************************************** + // access static method of parent + // from static method of sub class + // *************************************** + + static function statSubGetArray() : Array { return getStatArray(); } + static function statSubSetArray(a:Array) { setStatArray(a); } + + //public static function testStatSubSetArray(a:Array) : Array { + public function testStatSubSetArray(a:Array) : Array { + statSubSetArray(a); + return statSubGetArray(); + } + + + // *************************************** + // access static method of parent + // from public static method of sub class + // *************************************** + + public static function pubStatSubGetArray() : Array { return getStatArray(); } + public static function pubStatSubSetArray(a:Array) { setStatArray(a); } + + public function testPubStatSubGetSetArray(a:Array):Array { + pubStatSubSetArray(a); + return pubStatSubGetArray(); + } + + // *************************************** + // access static method of parent + // from private static method of sub class + // *************************************** + + private static function privStatSubGetArray() : Array { return getStatArray(); } + private static function privStatSubSetArray(a:Array) { setStatArray(a); } + + // public accessor to test asrt + public function testPrivStatSubArray(a:Array) : Array { + privStatSubSetArray(a); + return privStatSubGetArray(); + } + + // *************************************** + // access static property from + // default method of sub class + // *************************************** + + function subGetDPArray() : Array { return statArray; } + function subSetDPArray(a:Array) { statArray = a; } + + + public function testSubSetDPArray(a:Array) : Array { + this.subSetDPArray(a); + return this.subGetDPArray(); + } + + + // *************************************** + // access static property from + // public method of sub class + // *************************************** + + public function pubSubGetDPArray() : Array { return statArray; } + public function pubSubSetDPArray(a:Array) { statArray = a; } + + // *************************************** + // access static property from + // private method of sub class + // *************************************** + + private function privSubGetDPArray() : Array { return statArray; } + private function privSubSetDPArray(a:Array) { statArray = a; } + + public function testPrivSubSetDPArray(a:Array) : Array { + this.privSubSetDPArray(a); + return this.privSubGetDPArray(); + } + + + // *************************************** + // access static property from + // static method of sub class + // *************************************** + + static function statSubGetSPArray() : Array { return statArray; } + static function statSubSetSPArray(a:Array) { statArray = a; } + + public function testStatSubSetDPArray(a:Array) : Array { + //public static function testStatSubSetDPArray(a:Array) : Array { + statSubSetSPArray(a); + return statSubGetSPArray(); + } + + + // *************************************** + // access static property from + // public static method of sub class + // *************************************** + + public static function pubStatSubGetSPArray() : Array { return statArray; } + public static function pubStatSubSetSPArray(a:Array) { statArray = a; } + + public function testPubStatSubGetSetSPArray(a:Array):Array{ + pubStatSubSetSPArray(a); + return pubStatSubGetSPArray(); + } + + // *************************************** + // access static property from + // private static method of sub class + // *************************************** + + private static function privStatSubGetSPArray() : Array { return statArray; } + private static function privStatSubSetSPArray(a:Array) { statArray = a; } + + // public accessor for asrt + public function testPrivStatSubPArray(a:Array) : Array { + privStatSubSetSPArray( a ); + return privStatSubGetSPArray(); + } + } +public class ExtDynamicClassStat extends ExtDynamicClassStatInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtError.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtError.as new file mode 100644 index 00000000000..1be389dcbf6 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtError.as @@ -0,0 +1,136 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + +import ExtError.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "extend Error"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var error = new CustError(); +var ee = new CustEvalError(); +var te = new CustTypeError(); +var re = new CustReferenceError(); +var ra = new CustRangeError(); + +AddTestCase( "var error = new CustError()", "Error", error.toString() ); +AddTestCase( "var ee = new CustEvalError()", "EvalError", ee.toString() ); +AddTestCase( "var te = new CustTypeError()", "TypeError", te.toString() ); +AddTestCase( "var re = new CustReferenceError()", "ReferenceError", re.toString() ); +AddTestCase( "var ra = new CustRangeError()", "RangeError", ra.toString() ); + +AddTestCase( "typeof new CustError()", "object", typeof new CustError() ); +AddTestCase( "typeof new CustEvalError()", "object", typeof new CustEvalError() ); +AddTestCase( "typeof new CustTypeError()", "object", typeof new CustTypeError() ); +AddTestCase( "typeof new CustReferenceError()", "object", typeof new CustReferenceError() ); +AddTestCase( "typeof new CustRangeError()", "object", typeof new CustRangeError() ); + + +// dynamic Cust Error Cases + +error = new CustError2(); +ee = new CustEvalError2(); +te = new CustTypeError2(); +re = new CustReferenceError2(); +ra = new CustRangeError2(); + +AddTestCase( "var error = new CustError2()", "Error", error.toString() ); +AddTestCase( "var ee = new CustEvalError2()", "EvalError", ee.toString() ); +AddTestCase( "var te = new CustTypeError2()", "TypeError", te.toString() ); +AddTestCase( "var re = new CustReferenceError2()", "ReferenceError", re.toString() ); +AddTestCase( "var ra = new CustRangeError2()", "RangeError", ra.toString() ); + +error = new CustError2("test"); +ee = new CustEvalError2("eval error"); +te = new CustTypeError2("type error"); +re = new CustReferenceError2("reference error"); +ra = new CustRangeError2("range error"); + +AddTestCase( "var error = new CustError2('test')", "Error: test", error.toString() ); +AddTestCase( "var ee = new CustEvalError2('eval error')", "EvalError: eval error", ee.toString() ); +AddTestCase( "var te = new CustTypeError2('type error')", "TypeError: type error", te.toString() ); +AddTestCase( "var re = new CustReferenceError2('reference error')", "ReferenceError: reference error", re.toString() ); +AddTestCase( "var ra = new CustRangeError2('range error')", "RangeError: range error", ra.toString() ); + +AddTestCase( "typeof new CustError2()", "object", typeof new CustError2() ); +AddTestCase( "typeof new CustEvalError2()", "object", typeof new CustEvalError2() ); +AddTestCase( "typeof new CustTypeError2()", "object", typeof new CustTypeError2() ); +AddTestCase( "typeof new CustReferenceError2()", "object", typeof new CustReferenceError2() ); +AddTestCase( "typeof new CustRangeError2()", "object", typeof new CustRangeError2() ); + +AddTestCase( "typeof new CustError2('test')", "object", typeof new CustError2('test') ); +AddTestCase( "typeof new CustEvalError2('test')", "object", typeof new CustEvalError2('test') ); +AddTestCase( "typeof new CustTypeError2('test')", "object", typeof new CustTypeError2('test') ); +AddTestCase( "typeof new CustReferenceError2('test')", "object", typeof new CustReferenceError2('test') ); +AddTestCase( "typeof new CustRangeError2('test')", "object", typeof new CustRangeError2('test') ); + + +AddTestCase( "(err = new CustError2(), err.getClass = Object.prototype.toString, err.getClass() )", + "[object CustError2]", + (err = new CustError2(), err.getClass = Object.prototype.toString, err.getClass() ) ); +AddTestCase( "(err = new CustEvalError2(), err.getClass = Object.prototype.toString, err.getClass() )", + "[object CustEvalError2]", + (err = new CustEvalError2(), err.getClass = Object.prototype.toString, err.getClass() ) ); +AddTestCase( "(err = new CustTypeError2(), err.getClass = Object.prototype.toString, err.getClass() )", + "[object CustTypeError2]", + (err = new CustTypeError2(), err.getClass = Object.prototype.toString, err.getClass() ) ); +AddTestCase( "(err = new CustReferenceError2(), err.getClass = Object.prototype.toString, err.getClass() )", + "[object CustReferenceError2]", + (err = new CustReferenceError2(), err.getClass = Object.prototype.toString, err.getClass() ) ); +AddTestCase( "(err = new CustRangeError2(), err.getClass = Object.prototype.toString, err.getClass() )", + "[object CustRangeError2]", + (err = new CustRangeError2(), err.getClass = Object.prototype.toString, err.getClass() ) ); + +AddTestCase( "(err = new CustError2('test'), err.getClass = Object.prototype.toString, err.getClass() )", + "[object CustError2]", + (err = new CustError2('test'), err.getClass = Object.prototype.toString, err.getClass() ) ); +AddTestCase( "(err = new CustEvalError2('test'), err.getClass = Object.prototype.toString, err.getClass() )", + "[object CustEvalError2]", + (err = new CustEvalError2('test'), err.getClass = Object.prototype.toString, err.getClass() ) ); +AddTestCase( "(err = new CustTypeError2('test'), err.getClass = Object.prototype.toString, err.getClass() )", + "[object CustTypeError2]", + (err = new CustTypeError2('test'), err.getClass = Object.prototype.toString, err.getClass() ) ); +AddTestCase( "(err = new CustReferenceError2('test'), err.getClass = Object.prototype.toString, err.getClass() )", + "[object CustReferenceError2]", + (err = new CustReferenceError2('test'), err.getClass = Object.prototype.toString, err.getClass() ) ); +AddTestCase( "(err = new CustRangeError2('test'), err.getClass = Object.prototype.toString, err.getClass() )", + "[object CustRangeError2]", + (err = new CustRangeError2('test'), err.getClass = Object.prototype.toString, err.getClass() ) ); + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtError/CustError.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtError/CustError.as new file mode 100644 index 00000000000..bf4c2ad94f6 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtError/CustError.as @@ -0,0 +1,37 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package ExtError{ + + public class CustError extends Error{} + +} + + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtError/CustError2.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtError/CustError2.as new file mode 100644 index 00000000000..85f7929f59b --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtError/CustError2.as @@ -0,0 +1,41 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package ExtError{ + + public dynamic class CustError2 extends Error{ + public function CustError2(message=""){ + this.message = message; + } + } + +} + + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtError/CustEvalError.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtError/CustEvalError.as new file mode 100644 index 00000000000..d1d11250dca --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtError/CustEvalError.as @@ -0,0 +1,37 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package ExtError{ + + public class CustEvalError extends EvalError{} + +} + + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtError/CustEvalError2.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtError/CustEvalError2.as new file mode 100644 index 00000000000..0a14b35a7c0 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtError/CustEvalError2.as @@ -0,0 +1,41 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package ExtError{ + + public dynamic class CustEvalError2 extends EvalError{ + public function CustEvalError2(message=""){ + this.message = message; + } + } + +} + + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtError/CustRangeError.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtError/CustRangeError.as new file mode 100644 index 00000000000..982b30dba2b --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtError/CustRangeError.as @@ -0,0 +1,37 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package ExtError{ + + public class CustRangeError extends RangeError{} + +} + + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtError/CustRangeError2.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtError/CustRangeError2.as new file mode 100644 index 00000000000..2cb212a65a9 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtError/CustRangeError2.as @@ -0,0 +1,41 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package ExtError{ + + public dynamic class CustRangeError2 extends RangeError{ + public function CustRangeError2(message=""){ + this.message = message; + } + } + +} + + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtError/CustReferenceError.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtError/CustReferenceError.as new file mode 100644 index 00000000000..10cf07c8187 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtError/CustReferenceError.as @@ -0,0 +1,37 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package ExtError{ + + public class CustReferenceError extends ReferenceError{} + +} + + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtError/CustReferenceError2.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtError/CustReferenceError2.as new file mode 100644 index 00000000000..c4b4ea20eb2 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtError/CustReferenceError2.as @@ -0,0 +1,41 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package ExtError{ + + public dynamic class CustReferenceError2 extends ReferenceError{ + public function CustReferenceError2(message=""){ + this.message = message; + } + } + +} + + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtError/CustTypeError.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtError/CustTypeError.as new file mode 100644 index 00000000000..f3a1a877982 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtError/CustTypeError.as @@ -0,0 +1,37 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package ExtError{ + + public class CustTypeError extends TypeError{} + +} + + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtError/CustTypeError2.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtError/CustTypeError2.as new file mode 100644 index 00000000000..bf1c8a313c0 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtError/CustTypeError2.as @@ -0,0 +1,41 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package ExtError{ + + public dynamic class CustTypeError2 extends TypeError{ + public function CustTypeError2(message=""){ + this.message = message; + } + } + +} + + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtInternalClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtInternalClass.as new file mode 100644 index 00000000000..47df81c4e6e --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtInternalClass.as @@ -0,0 +1,239 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import InternalClass.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "Clean AS2"; // Version of JavaScript or ECMA +var TITLE = "Extend Default Class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + +// ******************************************** +// access default method from a default +// method of a sub class +// +// ******************************************** + +var arr = new Array(1,2,3); +EXTDCLASS = new ExtInternalClass(); +AddTestCase( "access 'default' method from 'default' method of sub class", arr, (EXTDCLASS.testSubGetSetArray(arr)) ); + + +// ******************************************** +// access default method from a public +// method of a sub class +// ******************************************** + +arr = new Array( 4, 5, 6 ); +EXTDCLASS = new ExtInternalClass(); +AddTestCase( "access 'default' method from 'public' method of sub class", arr, + (EXTDCLASS.pubSubSetArray(arr), EXTDCLASS.pubSubGetArray()) ); + +// ******************************************** +// access default method from a final +// method of a sub class +// ******************************************** + +arr = new Array( "one", "two", "three" ); +EXTDCLASS = new ExtInternalClass(); +AddTestCase( "access 'default' method from 'final' method of sub class", arr, (EXTDCLASS.testFinSubArray(arr)) ); + +// ******************************************** +// access default method from a public +// final method of a sub class +// ******************************************** + +arr = new Array( 8, "two", 9 ); +EXTDCLASS = new ExtInternalClass(); +AddTestCase( "access 'default' method from 'public final' method of sub class", arr, + (EXTDCLASS.pubFinSubSetArray(arr), EXTDCLASS.pubFinSubGetArray()) ); + +// ******************************************** +// access default method from a final +// private method of a sub class +// ******************************************** + +arr = new Array( "one", "two", "three" ); +EXTDCLASS = new ExtInternalClass(); +AddTestCase( "access 'default' method from 'private final' method of sub class", arr, (EXTDCLASS.testPrivFinSubArray(arr)) ); + +// ******************************************** +// access default method from a private +// method of a sub class +// ******************************************** + +arr = new Array( 5, 6, 7 ); +EXTDCLASS = new ExtInternalClass(); +AddTestCase( "access 'default' method from 'private' method of sub class", arr, EXTDCLASS.testPrivSubArray(arr) ); + +// ******************************************** +// access default method from a virtual +// method of a sub class +// ******************************************** + +AddTestCase( "access 'default' method from 'virtual' method of sub class", arr, + EXTDCLASS.testVirtSubArray(arr) ); + +// ******************************************** +// access default method from a virtual +// public method of a sub class +// ******************************************** + +AddTestCase( "access 'default' method from 'public virtual' method of sub class", arr, + (EXTDCLASS.pubVirtSubSetArray(arr), EXTDCLASS.pubVirtSubGetArray()) ); + +// ******************************************** +// access default method from a virtual +// private method of a sub class +// ******************************************** + +AddTestCase( "access 'default' method from 'private virtual' method of sub class", arr, + EXTDCLASS.testPrivVirtSubArray(arr) ); + +// ******************************************** +// access default method from static +// method of sub class +// ******************************************** + +var thisError = "no exception thrown"; +try{ + ExtInternalClass.pubStatSubGetArray(); +} catch (e1) { + thisError = e1.toString(); +} finally { + AddTestCase( "access 'default' method from 'static' method of the sub class", + TYPEERROR+1006, + typeError( thisError) ); +} + +// ******************************************** +// access default property from +// default method in sub class +// ******************************************** + +EXTDCLASS = new ExtInternalClass(); +AddTestCase( "access 'default' property from 'default' method of sub class", arr, + (EXTDCLASS.testSubGetSetDPArray(arr)) ); + +// ******************************************** +// access default property from +// final method in sub class +// ******************************************** + +EXTDCLASS = new ExtInternalClass(); +AddTestCase( "access 'default' property from 'final' method of sub class", arr, + (EXTDCLASS.testFinSubDPArray(arr)) ); + +// ******************************************** +// access default property from +// virtual method in sub class +// ******************************************** + +EXTDCLASS = new ExtInternalClass(); +AddTestCase( "access 'default' property from 'virtual' method of sub class", arr, + (EXTDCLASS.testVirtSubDPArray(arr)) ); + +// ******************************************** +// access default property from +// public method in sub class +// ******************************************** + +EXTDCLASS = new ExtInternalClass(); +AddTestCase( "access 'default' property from 'public' method of sub class", arr, + (EXTDCLASS.pubSubSetDPArray(arr), EXTDCLASS.pubSubGetDPArray()) ); + +// ******************************************** +// access default property from +// private method in sub class +// ******************************************** + +EXTDCLASS = new ExtInternalClass(); +AddTestCase( "access 'default' property from 'private' method of sub class", arr, + (EXTDCLASS.testPrivSubDPArray(arr)) ); + +// ******************************************** +// access default property from +// public final method in sub class +// ******************************************** + +EXTDCLASS = new ExtInternalClass(); +AddTestCase( "access 'default' property from 'public final' method of sub class", arr, + (EXTDCLASS.pubFinSubSetDPArray(arr), EXTDCLASS.pubFinSubGetDPArray()) ); + +// ******************************************** +// access default property from +// public virtual method in sub class +// ******************************************** + +EXTDCLASS = new ExtInternalClass(); +AddTestCase( "access 'default' property from 'public virtual' method of sub class", arr, + (EXTDCLASS.pubVirtSubSetDPArray(arr), EXTDCLASS.pubVirtSubGetDPArray()) ); + +// ******************************************** +// access default property from +// private final method in sub class +// ******************************************** + +EXTDCLASS = new ExtInternalClass(); +AddTestCase( "access 'default' property from 'private final' method of sub class", arr, + (EXTDCLASS.testPrivFinSubDPArray(arr)) ); + +// ******************************************** +// access default property from +// private virtual method in sub class +// ******************************************** + +EXTDCLASS = new ExtInternalClass(); +AddTestCase( "access 'default' property from 'private virtual' method of sub class", arr, + (EXTDCLASS.testPrivVirtSubDPArray(arr)) ); + +// ******************************************** +// access default property from +// static public method of sub class +// ******************************************** + +thisError = "no error thrown"; +try{ + ExtInternalClass.pubStatSubGetDPArray(); +} catch(e3) { + thisError = e3.toString(); +} finally { + AddTestCase( "access default property from static public method of sub class", + TYPEERROR+1006, + typeError( thisError ) ); +} + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtInternalClass/AInternalClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtInternalClass/AInternalClass.as new file mode 100644 index 00000000000..c8526819793 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtInternalClass/AInternalClass.as @@ -0,0 +1,264 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package InternalClass { + + internal class InternalClassInner { + + internal var array:Array; + var boolean:Boolean; + internal var date:Date; + var myFunction:Function; + internal var math:Math; + var number:Number; + internal var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + //public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + internal function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + internal function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + internal function getNumber() : Number { return number; } + function getObject() : Object { return object; } + internal function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + internal function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + internal function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + internal function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + internal function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + } + + public class InternalClass extends InternalClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtInternalClass/ExtInternalClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtInternalClass/ExtInternalClass.as new file mode 100644 index 00000000000..546a6f9aab3 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtInternalClass/ExtInternalClass.as @@ -0,0 +1,276 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package InternalClass { + + import InternalClass.* + + // this is the test case so we can't alter it too much + // change the name of the class to ExtInternalClassTest + // we'll create a public class ExtInternalClass that + // extends it for testing runtime + class ExtInternalClassTest extends InternalClass { + + // ************************************ + // access default method of parent + // from default method of sub class + // ************************************ + + internal function subGetArray() : Array { return this.getArray(); } + function subSetArray(a:Array) { this.setArray(a); } + + // this is needed so that the test cases can access this from + // outside the class. This way the test case itself preserved + public function testSubGetSetArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + // ************************************ + // access default method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return this.getArray(); } + public function pubSubSetArray(a:Array) { this.setArray(a); } + + // ************************************ + // access default method of parent + // from final method of sub class + // + // final will behave the same as default + // ************************************ + + final function finSubGetArray() : Array { return this.getArray(); } + internal final function finSubSetArray(a:Array) { this.setArray(a); } + + public function testFinSubArray(a:Array):Array{ + this.finSubSetArray(a); + return this.finSubGetArray(); + } + + // ************************************ + // access default method of parent + // from public final method of sub class + // ************************************ + + public final function pubFinSubGetArray() : Array { return this.getArray(); } + final public function pubFinSubSetArray(a:Array) { this.setArray(a); } + + // ************************************ + // access default method of parent + // from private final method of sub class + // ************************************ + + private final function privFinSubGetArray() : Array { return this.getArray(); } + final private function privFinSubSetArray(a:Array) { this.setArray(a); } + + public function testPrivFinSubArray(a:Array):Array { + this.privFinSubSetArray(a); + return this.privFinSubGetArray(); + } + + + // ************************************ + // access default method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return this.getArray(); } + private function privSubSetArray(a:Array) { this.setArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + // ************************************ + // access default method of parent + // from virtual method of sub class + // ************************************ + + internal virtual function virtSubGetArray() : Array { return this.getArray(); } + virtual function virtSubSetArray(a:Array) { this.setArray(a); } + + public function testVirtSubArray(a:Array) : Array { + this.virtSubSetArray(a); + return this.virtSubGetArray(); + } + + // ************************************ + // access default method of parent + // from public virtual method of sub class + // ************************************ + + virtual public function pubVirtSubGetArray() : Array { return this.getArray(); } + public virtual function pubVirtSubSetArray(a:Array) { this.setArray(a); } + + // ************************************ + // access default method of parent + // from private virtual method of sub class + // ************************************ + + virtual private function privVirtSubGetArray() : Array { return this.getArray(); } + private virtual function privVirtSubSetArray(a:Array) { this.setArray(a); } + + public function testPrivVirtSubArray(a:Array) : Array { + this.privVirtSubSetArray(a); + return this.privVirtSubGetArray(); + } + + // *************************************** + // access default property from + // static method of sub class + // *************************************** + + static function statSubGetArray():Array{ return getArray(); } + static public function pubStatSubGetArray():Array { return statSubGetArray(); } + + // *************************************** + // access default property from + // default method of sub class + // *************************************** + + function subGetDPArray() : Array { return array; } + function subSetDPArray(a:Array) { array = a; } + + // this is needed so that the test cases can access this from + // outside the class. This way the test case itself preserved + public function testSubGetSetDPArray(a:Array) : Array { + this.subSetDPArray(a); + return this.subGetDPArray(); + } + + // *************************************** + // access default property from + // final method of sub class + // *************************************** + + final function finSubGetDPArray() : Array { return array; } + internal final function finSubSetDPArray(a:Array) { array = a; } + + public function testFinSubDPArray(a:Array) : Array { + this.finSubSetDPArray(a); + return this.finSubGetDPArray(); + } + + // *************************************** + // access default property from + // virtual method of sub class + // *************************************** + + internal virtual function virtSubGetDPArray() : Array { return array; } + virtual function virtSubSetDPArray(a:Array) { array = a; } + + public function testVirtSubDPArray(a:Array) : Array { + this.virtSubSetDPArray(a); + return this.virtSubGetDPArray(); + } + + // *************************************** + // access default property from + // public method of sub class + // *************************************** + + public function pubSubGetDPArray() : Array { return this.array; } + public function pubSubSetDPArray(a:Array) { this.array = a; } + + // *************************************** + // access default property from + // private method of sub class + // *************************************** + + private function privSubGetDPArray() : Array { return this.array; } + private function privSubSetDPArray(a:Array) { this.array = a; } + + public function testPrivSubDPArray(a:Array) : Array { + this.privSubSetDPArray(a); + return this.privSubGetDPArray(); + } + + // *************************************** + // access default property from + // public final method of sub class + // *************************************** + + public final function pubFinSubGetDPArray() : Array { return this.array; } + final public function pubFinSubSetDPArray(a:Array) { this.array = a; } + + // *************************************** + // access default property from + // public virtual method of sub class + // *************************************** + + public virtual function pubVirtSubGetDPArray() : Array { return this.array; } + virtual public function pubVirtSubSetDPArray(a:Array) { this.array = a; } + + // *************************************** + // access default property from + // private final method of sub class + // *************************************** + + private final function privFinSubGetDPArray() : Array { return this.array; } + final private function privFinSubSetDPArray(a:Array) { this.array = a; } + + public function testPrivFinSubDPArray(a:Array):Array { + this.privFinSubSetDPArray(a); + return this.privFinSubGetDPArray(); + } + + // *************************************** + // access default property from + // private virtual method of sub class + // *************************************** + + private virtual function privVirtSubGetDPArray() : Array { return this.array; } + virtual private function privVirtSubSetDPArray(a:Array) { this.array = a; } + + public function testPrivVirtSubDPArray(a:Array):Array { + this.privVirtSubSetDPArray(a); + return this.privVirtSubGetDPArray(); + } + + // *************************************** + // access default property from + // public static method of sub class + // *************************************** + + public static function pubStatSubGetDPArray(){ + return array; + } + + } + + // same class as above except public + public class ExtInternalClass extends ExtInternalClassTest {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtPublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtPublicClass.as new file mode 100644 index 00000000000..6ad7decd123 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtPublicClass.as @@ -0,0 +1,113 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "extend public class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +import PublicClass.*; + + + +// ******************************************** +// access default method from a default +// method of a sub class +// +// ******************************************** + +var arr = new Array(1, 2, 3); + +EXTDCLASS = new ExtPublicClass(); +AddTestCase( "EXTDCLASS.testSubGetSetArray(arr)", arr, EXTDCLASS.testSubGetSetArray(arr) ); + + +// ******************************************** +// access default method from a public +// method of a sub class +// +// ******************************************** + +EXTDCLASS = new ExtPublicClass(); +AddTestCase( "EXTDCLASS.pubSubSetArray(arr), EXTDCLASS.pubSubGetArray()", arr, (EXTDCLASS.pubSubSetArray(arr), EXTDCLASS.pubSubGetArray()) ); + +// ******************************************** +// access default method from a private +// method of a sub class +// +// ******************************************** + +EXTDCLASS = new ExtPublicClass(); +AddTestCase( "EXTDCLASS.testPrivSubArray(arr)", arr, EXTDCLASS.testPrivSubArray(arr) ); + + +// ******************************************** +// access default property from +// default method in sub class +// ******************************************** + +EXTDCLASS = new ExtPublicClass(); +AddTestCase( "EXTDCLASS.testSubGetSetDPArray(arr)", arr, EXTDCLASS.testSubGetSetDPArray(arr) ); + + +// ******************************************** +// access default property from +// ******************************************** + +EXTDCLASS = new ExtPublicClass(); +AddTestCase( "EXTDCLASS.pubSubSetDPArray(arr), EXTDCLASS.pubSubGetDPArray()", arr, (EXTDCLASS.pubSubSetDPArray(arr), EXTDCLASS.pubSubGetDPArray()) ); + + + +// ******************************************** +// access default property from +// private method in sub class +// ******************************************** + +EXTDCLASS = new ExtPublicClass(); +AddTestCase( "EXTDCLASS.testPrivSubDPArray(arr)", arr, EXTDCLASS.testPrivSubDPArray(arr) ); + +var thisError = "no Exception thrown!"; +try{ + ExtPublicClass.pubStatSubGetDPArray(); +} catch (e){ + thisError = e.toString(); +} finally { + AddTestCase( "access default property from public static method of sub class", + TYPEERROR+1006, + typeError( thisError ) ); +} + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtPublicClass/ExtPublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtPublicClass/ExtPublicClass.as new file mode 100644 index 00000000000..26d95d7a132 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtPublicClass/ExtPublicClass.as @@ -0,0 +1,344 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + +package PublicClass { + + + public class PublicClass { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + //public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finMyFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray():Array { return finArray; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + + } + + class ExtPublicClassInner extends PublicClass { + + // ************************************ + // access default method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return this.getArray(); } + function subSetArray(a:Array) { this.setArray(a); } + + public function testSubGetSetArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + + // ************************************ + // access default method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return this.getArray(); } + public function pubSubSetArray(a:Array) { this.setArray(a); } + + // ************************************ + // access default method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return this.getArray(); } + private function privSubSetArray(a:Array) { this.setArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + // *************************************** + // access default property from + // default method of sub class + // *************************************** + + function subGetDPArray() : Array { return array; } + function subSetDPArray(a:Array) { array = a; } + + public function testSubGetSetDPArray(a:Array) : Array { + this.subSetDPArray(a); + return this.subGetDPArray(); + } + + + // *************************************** + // access default property from + // public method of sub class + // *************************************** + + public function pubSubGetDPArray() : Array { return this.array; } + public function pubSubSetDPArray(a:Array) { this.array = a; } + + // *************************************** + // access default property from + // private method of sub class + // *************************************** + + private function privSubGetDPArray() : Array { return this.array; } + private function privSubSetDPArray(a:Array) { this.array = a; } + + public function testPrivSubDPArray(a:Array) : Array { + this.privSubSetDPArray(a); + return this.privSubGetDPArray(); + } + + // access default property from public static sub method + public static function pubStatSubGetDPArray() { return array; } + + } + +public class ExtPublicClass extends ExtPublicClassInner {} +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtPublicClassFin.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtPublicClassFin.as new file mode 100644 index 00000000000..05afaaa3b58 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtPublicClassFin.as @@ -0,0 +1,42 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import PublicClass.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Extend Public Class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtPublicClassFin/APublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtPublicClassFin/APublicClass.as new file mode 100644 index 00000000000..fb5e420c61c --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtPublicClassFin/APublicClass.as @@ -0,0 +1,262 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + public class PublicClass { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + //public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finMyFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray():Array { return finArray; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtPublicClassFin/ExtPublicClassFin.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtPublicClassFin/ExtPublicClassFin.as new file mode 100644 index 00000000000..33cc693ffe8 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtPublicClassFin/ExtPublicClassFin.as @@ -0,0 +1,135 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + import PublicClass.*; + + class ExtPublicClassFinInner extends PublicClass { + + // ************************************ + // access final method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return this.getFinArray(); } + function subSetArray(a:Array) { this.setFinArray(a); } + + public function testSubGetArray(arr:Array):Array { + this.subSetArray(arr); + return subGetArray(); + } + + // ************************************ + // access final method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return this.getFinArray(); } + public function pubSubSetArray(a:Array) { this.setFinArray(a); } + + // ************************************ + // access final method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return this.getFinArray(); } + private function privSubSetArray(a:Array) { this.setFinArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + // ************************************ + // access final method of parent + // from final method of sub class + // ************************************ + + final function finSubGetArray() : Array { return this.getFinArray(); } + final function finSubSetArray(a:Array) { this.setFinArray(a); } + + public function testFinSubArray(a:Array):Array { + this.finSubSetArray(a); + return this.finSubGetArray(); + } + + // *************************************** + // access final method from public static method + // of the sub class + // *************************************** + + public static function pubStatSubGetArray():Array { return getFinArray(); } + + // *************************************** + // access final property from + // default method of sub class + // *************************************** + + function subGetDPArray() : Array { return finArray; } + function subSetDPArray(a:Array) { finArray = a; } + + public function testSubDPArray(a:Array):Array { + this.subSetDPArray(a); + return this.subGetDPArray(); + } + + // *************************************** + // access final property from + // public method of sub class + // *************************************** + + public function pubSubGetDPArray() : Array { return this.finArray; } + public function pubSubSetDPArray(a:Array) { this.finArray = a; } + + // *************************************** + // access final property from + // private method of sub class + // *************************************** + + private function privSubGetDPArray() : Array { return this.finArray; } + private function privSubSetDPArray(a:Array) { this.finArray = a; } + + // *************************************** + // access final property from + // final method of sub class + // *************************************** + + public final function finSubGetDPArray() : Array { return pubFinArray; } + public final function finSubSetDPArray(a:Array) { pubFinArray = a; } + + // access final property from public static method + public static function pubStatSubGetFPArray():Array { return finArray; } + + } + public class ExtPublicClassFin extends ExtPublicClassFinInner {} +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtPublicClassPriv.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtPublicClassPriv.as new file mode 100644 index 00000000000..ed5d2e6b8f8 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtPublicClassPriv.as @@ -0,0 +1,159 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "extend public class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +import PublicClass.*; + +// ******************************************** +// access private method from a default +// method of a sub class +// +// ******************************************** + +var arr = new Array(1, 2, 3); + +EXTDCLASS = new ExtPublicClass(); +var thisError = "no exception thrown!"; +try { + EXTDCLASS.testSubGetSetArray(arr); +} catch (e1) { + thisError = e1.toString(); +} finally { + AddTestCase( "Access private method from a default method of a sub class", + REFERENCEERROR+1069, + referenceError( thisError ) ); +} + + +// ******************************************** +// access private method from a public +// method of a sub class +// +// ******************************************** + +EXTDCLASS = new ExtPublicClass(); +thisError = "no exception thrown!"; +try { + EXTDCLASS.pubSubSetArray(arr); +} catch (e2) { + thisError = e2.toString(); +} finally { + AddTestCase( "Access private method from a public method of a sub class", + REFERENCEERROR+1069, + referenceError( thisError ) ); +} + + + +// ******************************************** +// access private method from a private +// method of a sub class +// +// ******************************************** + +EXTDCLASS = new ExtPublicClass(); +thisError = "no exception thrown!"; +try { + EXTDCLASS.testPrivSubArray(arr); +} catch (e3) { + thisError = e3.toString(); +} finally { + AddTestCase( "Access private method from a private method of a sub class", + REFERENCEERROR+1069, + referenceError( thisError ) ); +} + + + +// ******************************************** +// access private property from +// default method in sub class +// ******************************************** + +EXTDCLASS = new ExtPublicClass(); +thisError = "no exception thrown!"; +try { + EXTDCLASS.testSubGetSetDPArray(arr); +} catch (e4) { + thisError = e4.toString(); +} finally { + AddTestCase( "Access private method from a public method of a sub class", + REFERENCEERROR+1069, + referenceError( thisError ) ); +} + + + +// ******************************************** +// access private property from +// ******************************************** + +EXTDCLASS = new ExtPublicClass(); +thisError = "no exception thrown!"; +try { + EXTDCLASS.pubSubGetDPArray(); +} catch (e5) { + thisError = e5.toString(); +} finally { + AddTestCase( "Access private method from a public method of a sub class", + REFERENCEERROR+1069, + referenceError( thisError ) ); +} + + + +// ******************************************** +// access private property from +// private method in sub class +// ******************************************** + +EXTDCLASS = new ExtPublicClass(); + +thisError = "no Exception thrown!"; +try{ + ExtPublicClass.pubStatSubGetDPArray(); +} catch (e10){ + thisError = e10.toString(); +} finally { + AddTestCase( "access private property from public static method of sub class", + TYPEERROR+1006, + typeError( thisError ) ); +} + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtPublicClassPriv/APublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtPublicClassPriv/APublicClass.as new file mode 100644 index 00000000000..fb5e420c61c --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtPublicClassPriv/APublicClass.as @@ -0,0 +1,262 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + public class PublicClass { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + //public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finMyFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray():Array { return finArray; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtPublicClassPriv/ExtPublicClassPriv.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtPublicClassPriv/ExtPublicClassPriv.as new file mode 100644 index 00000000000..584bd8796eb --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtPublicClassPriv/ExtPublicClassPriv.as @@ -0,0 +1,118 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + +package PublicClass { + + import PublicClass.*; + + class ExtPublicClassInner extends PublicClass { + + // ************************************ + // access private method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return this.getPrivArray(); } + function subSetArray(a:Array) { this.setPrivArray(a); } + + public function testSubGetSetArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + + // ************************************ + // access private method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return this.getPrivArray(); } + public function pubSubSetArray(a:Array) { this.setPrivArray(a); } + + // ************************************ + // access private method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return this.getPrivArray(); } + private function privSubSetArray(a:Array) { this.setPrivArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + // *************************************** + // access private property from + // default method of sub class + // *************************************** + + function subGetDPArray() : Array { return this.privArray; } + function subSetDPArray(a:Array) { this.privArray = a; } + + public function testSubGetSetDPArray(a:Array) : Array { + //this.subSetDPArray(a); + return this.subGetDPArray(); + } + + + // *************************************** + // access private property from + // public method of sub class + // *************************************** + + public function pubSubGetDPArray() : Array { return this.privArray; } + public function pubSubSetDPArray(a:Array) { this.privArray = a; } + + // *************************************** + // access private property from + // private method of sub class + // *************************************** + + private function privSubGetDPArray() : Array { return this.privArray; } + private function privSubSetDPArray(a:Array) { this.privArray = a; } + + public function testPrivSubDPArray(a:Array) : Array { + this.privSubSetDPArray(a); + return this.privSubGetDPArray(); + } + + // *************************************** + // access private property from public static sub method + // *************************************** + public static function pubStatSubGetDPArray() { return privArray; } + + } + +public class ExtPublicClass extends ExtPublicClassInner {} +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtPublicClassPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtPublicClassPub.as new file mode 100644 index 00000000000..9308ec7a8d7 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtPublicClassPub.as @@ -0,0 +1,44 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import PublicClass.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "Clean AS2"; // Version of JavaScript or ECMA +var TITLE = "Extend Default Class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + +var EXTDCLASS = new ExtPublicClassPub(); + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtPublicClassPub/APublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtPublicClassPub/APublicClass.as new file mode 100644 index 00000000000..fb5e420c61c --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtPublicClassPub/APublicClass.as @@ -0,0 +1,262 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + public class PublicClass { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + //public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finMyFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray():Array { return finArray; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtPublicClassPub/ExtPublicClassPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtPublicClassPub/ExtPublicClassPub.as new file mode 100644 index 00000000000..bf4de7bb24c --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtPublicClassPub/ExtPublicClassPub.as @@ -0,0 +1,119 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + import PublicClass.*; + + class ExtPublicClassPubInner extends PublicClass { + + // ************************************ + // access public method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return this.getPubArray(); } + function subSetArray(a:Array) { this.setPubArray(a); } + + public function testSubArray(a:Array):Array{ + this.subSetArray(a); + return this.subGetArray(); + } + + // ************************************ + // access public method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return this.getPubArray(); } + public function pubSubSetArray(a:Array) { this.setPubArray(a); } + + // ************************************ + // access public method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return this.getPubArray(); } + private function privSubSetArray(a:Array) { this.setPubArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + // *************************************** + // access public method of parent + // from public static method of sub class + // *************************************** + + public static function pubStatSubGetArray():Array{ return getPubArray(); } + + // *************************************** + // access public property from + // default method of sub class + // *************************************** + + function subGetDPArray() : Array { return this.pubArray; } + function subSetDPArray(a:Array) { this.pubArray = a; } + + public function testSubDPArray(a:Array):Array{ + this.subSetDPArray(a); + return this.subGetDPArray(); + } + + // *************************************** + // access public property from + // public method of sub class + // *************************************** + + public function pubSubGetDPArray() : Array { return this.pubArray; } + public function pubSubSetDPArray(a:Array) { this.pubArray = a; } + + // *************************************** + // access public property from + // private method of sub class + // *************************************** + + private function privSubGetDPArray() : Array { return this.pubArray; } + private function privSubSetDPArray(a:Array) { this.pubArray = a; } + + // *************************************** + // access public property from + // public static method of sub class + // *************************************** + + public static function pubStatSubGetDPArray():Array{ return pubArray; } + + } + + public class ExtPublicClassPub extends ExtPublicClassPubInner {} +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtPublicClassStat.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtPublicClassStat.as new file mode 100644 index 00000000000..c6d6959fc5a --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtPublicClassStat.as @@ -0,0 +1,199 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import PublicClass.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Extend Public Class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + +arr = new Array(1, 2, 3); + + +// ******************************************** +// access static method from a default +// method of a sub class +// +// ******************************************** + +EXTDCLASS = new ExtPublicClassStat(); +AddTestCase( "*** Access static method from default method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testSubArray(arr)", arr, EXTDCLASS.testSubArray(arr) ); + +// fill in the rest of the cases here + + +// ******************************************** +// access static method from a public +// method of a sub class +// +// ******************************************** + +EXTDCLASS = new ExtPublicClassStat(); +AddTestCase( "*** Access static method from public method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.pubSubSetArray(arr), EXTDCLASS.pubSubGetArray()", arr, (EXTDCLASS.pubSubSetArray(arr), EXTDCLASS.pubSubGetArray()) ); + +// fill in the rest of the cases here + +// ******************************************** +// access static method from a private +// method of a sub class +// +// ******************************************** + +EXTDCLASS = new ExtPublicClassStat(); +AddTestCase( "*** Access static method from private method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testPrivSubArray(arr)", arr, EXTDCLASS.testPrivSubArray(arr) ); + +// fill in the rest of the cases here + +// ******************************************** +// access static method from a static +// method of a sub class +// +// ******************************************** + +AddTestCase( "*** Access static method from static method of sub class ***", 1, 1 ); +AddTestCase( "ExtPublicClassStat.testStatSubArray(arr)", arr, ExtPublicClassStat.testStatSubArray(arr) ); + +// fill in the rest of the cases here + +// ******************************************** +// access static method from a public static +// method of a sub class +// +// ******************************************** + +AddTestCase( "*** Access static method from public static method of sub class ***", 1, 1 ); +AddTestCase( "ExtPublicClassStat.pubStatSubSetArray(arr), ExtPublicClassStat.pubStatSubGetArray()", arr, + (ExtPublicClassStat.pubStatSubSetArray(arr), ExtPublicClassStat.pubStatSubGetArray()) ); + +// fill in the rest of the cases here + +// ******************************************** +// access static method from a private static +// method of a sub class +// +// ******************************************** + +var EXTDEFAULTCLASS = new ExtPublicClassStat(); +AddTestCase( "*** Access static method from private static method of sub class ***", 1, 1 ); +AddTestCase( "EXTDEFAULTCLASS.testPrivStatSubArray(arr)", arr, EXTDEFAULTCLASS.testPrivStatSubArray(arr) ); + +// fill in the rest of the cases here + +// ******************************************** +// access static method from final +// method of a sub class +// ******************************************** + +EXTDCLASS = new ExtPublicClassStat(); +AddTestCase( "*** Access static method from final method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testFinalSubArray(arr)", arr, EXTDCLASS.testFinalSubArray(arr) ); + +// ******************************************** +// access static property from +// default method in sub class +// ******************************************** + +EXTDCLASS = new ExtPublicClassStat(); +AddTestCase( "*** Access static property from default method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testSubDPArray(arr)", arr, EXTDCLASS.testSubDPArray(arr) ); + +// fill in the rest of the cases here + + +// ******************************************** +// access static property from +// public method in sub class +// ******************************************** + +EXTDCLASS = new ExtPublicClassStat(); +AddTestCase( "*** Access static property from public method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.pubSubSetDPArray(arr), EXTDCLASS.pubSubGetDPArray()", arr, (EXTDCLASS.pubSubSetDPArray(arr), EXTDCLASS.pubSubGetDPArray()) ); + +// fill in the rest of the cases here + +// ******************************************** +// access static property from +// private method in sub class +// ******************************************** + +EXTDCLASS = new ExtPublicClassStat(); +AddTestCase( "*** Access static property from private method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testPrivSubDPArray(arr)", arr, EXTDCLASS.testPrivSubDPArray(arr) ); + +// fill in the rest of the cases here + +// ******************************************** +// access static property from +// static method in sub class +// ******************************************** + +AddTestCase( "*** Access static property from static method in sub class ***", 1, 1 ); +AddTestCase( "ExtPublicClassStat.testStatSubPArray(arr)", arr, ExtPublicClassStat.testStatSubPArray(arr) ); + +// ******************************************** +// access static property from +// public static method in sub class +// ******************************************** + +AddTestCase( "*** Access static property from public static method in sub class ***", 1, 1 ); +AddTestCase( "ExtPublicClassStat.pubStatSubSetSPArray(arr), ExtPublicClassStat.pubStatSubGetSPArray()", arr, + (ExtPublicClassStat.pubStatSubSetSPArray(arr), ExtPublicClassStat.pubStatSubGetSPArray()) ); + +// ******************************************** +// access static property from +// private static method in sub class +// ******************************************** + +EXTDCLASS = new ExtPublicClassStat(); +AddTestCase( "*** Access static property from private static method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testPrivStatSubPArray(arr)", arr, EXTDCLASS.testPrivStatSubPArray(arr)); + +// fill in the rest of the cases here + +// ******************************************** +// access static property from +// final method in sub class +// ******************************************** + +EXTDCLASS = new ExtPublicClassStat(); +AddTestCase( "*** Access static property from final method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testStatSubPArray(arr)", arr, EXTDCLASS.testStatSubPArray(arr) ); + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtPublicClassStat/APublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtPublicClassStat/APublicClass.as new file mode 100644 index 00000000000..fb5e420c61c --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtPublicClassStat/APublicClass.as @@ -0,0 +1,262 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + public class PublicClass { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + //public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finMyFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray():Array { return finArray; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtPublicClassStat/ExtPublicClassStat.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtPublicClassStat/ExtPublicClassStat.as new file mode 100644 index 00000000000..2a488442eb0 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/ExtPublicClassStat/ExtPublicClassStat.as @@ -0,0 +1,220 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + +package PublicClass { + + import PublicClass.*; + + class ExtPublicClassStatInner extends PublicClass { + + // ************************************ + // access static method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return getStatArray(); } + function subSetArray(a:Array) { setStatArray(a); } + + public function testSubArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + + // ************************************ + // access static method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return getStatArray(); } + public function pubSubSetArray(a:Array) { setStatArray(a); } + + // ************************************ + // access static method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return getStatArray(); } + private function privSubSetArray(a:Array) { setStatArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + // *************************************** + // access static method of parent + // from static method of sub class + // *************************************** + + static function statSubGetArray() : Array { return getStatArray(); } + static function statSubSetArray(a:Array) { setStatArray(a); } + + public static function testStatSubArray(a:Array) : Array { + statSubSetArray(a); + return statSubGetArray(); + } + + + // *************************************** + // access static method of parent + // from public static method of sub class + // *************************************** + + public static function pubStatSubGetArray() : Array { return getStatArray(); } + public static function pubStatSubSetArray(a:Array) { setStatArray(a); } + + // *************************************** + // access static method of parent + // from private static method of sub class + // *************************************** + + private static function privStatSubGetArray() : Array { return getStatArray(); } + private static function privStatSubSetArray(a:Array) { setStatArray(a); } + + // public accessor to test asrt + public function testPrivStatSubArray(a:Array) : Array { + privStatSubSetArray(a); + return privStatSubGetArray(); + } + + // *************************************** + // access static method of parent + // from final method of sub class + // *************************************** + + final function finStatSubGetArray() : Array { return getStatArray(); } + final function finStatSubSetArray(a:Array) { setStatArray(a); } + + public function testFinalSubArray(a:Array) : Array { + finStatSubSetArray(a); + return finStatSubGetArray(); + } + + + // *************************************** + // access static property from + // default method of sub class + // *************************************** + + function subGetDPArray() : Array { return statArray; } + function subSetDPArray(a:Array) { statArray = a; } + + public function testSubDPArray(a:Array) : Array { + subSetDPArray( a ); + return subGetDPArray(); + } + + + // *************************************** + // access static property from + // public method of sub class + // *************************************** + + public function pubSubGetDPArray() : Array { return statArray; } + public function pubSubSetDPArray(a:Array) { statArray = a; } + + // *************************************** + // access static property from + // private method of sub class + // *************************************** + + private function privSubGetDPArray() : Array { return statArray; } + private function privSubSetDPArray(a:Array) { statArray = a; } + + public function testPrivSubDPArray(a:Array) : Array { + privSubSetDPArray( a ); + return privSubGetDPArray(); + } + + + // *************************************** + // access static property from + // static method of sub class + // *************************************** + + static function statSubGetSPArray() : Array { return statArray; } + static function statSubSetSPArray(a:Array) { statArray = a; } + + public static function testStatSubPArray(a:Array) : Array { + statSubSetSPArray( a ); + return statSubGetSPArray(); + } + + + // *************************************** + // access static property from + // public static method of sub class + // *************************************** + + public static function pubStatSubGetSPArray() : Array { return statArray; } + public static function pubStatSubSetSPArray(a:Array) { statArray = a; } + + // *************************************** + // access static property from + // private static method of sub class + // *************************************** + + private static function privStatSubGetSPArray() : Array { return statArray; } + private static function privStatSubSetSPArray(a:Array) { statArray = a; } + + // public accessor for asrt + public function testPrivStatSubPArray(a:Array) : Array { + privStatSubSetSPArray( a ); + return privStatSubGetSPArray(); + } + + // *************************************** + // access static property from + // final method of sub class + // *************************************** + + final function finStatSubGetSPArray() : Array { return statArray; } + final function finStatSubSetSPArray(a:Array) { statArray = a; } + + public function testStatSubPArray(a:Array) : Array { + finStatSubSetSPArray( a ); + return finStatSubGetSPArray(); + } + + } + +public class ExtPublicClassStat extends ExtPublicClassStatInner { + public static function testStatSubArray(a:Array) : Array { return ExtPublicClassStatInner.testStatSubArray(a); } + public static function pubStatSubGetArray() : Array { return ExtPublicClassStatInner.pubStatSubGetArray(); } + public static function pubStatSubSetArray(a:Array) { ExtPublicClassStatInner.pubStatSubSetArray(a); } + public static function testStatSubPArray(a:Array) : Array { return ExtPublicClassStatInner.testStatSubPArray(a); } + public static function pubStatSubGetSPArray() : Array { return ExtPublicClassStatInner.pubStatSubGetSPArray(); } + public static function pubStatSubSetSPArray(a:Array) { ExtPublicClassStatInner.pubStatSubSetSPArray(a); } +} +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDefaultClass.as new file mode 100644 index 00000000000..733dee52550 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDefaultClass.as @@ -0,0 +1,185 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import DefaultClass.*; + + +var SECTION = "Definitions\Ext"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Final Class Extends Default Class Default Methods"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +// Can't create an instance because it's not public +// Hence commenting out the lines where the class is initialized. +// var EXTDCLASS = new FinExtDefaultClassPub(); + + +// Create an array variable which will define the test array to be used +// for the given output. +var arr = new Array(1, 2, 3); + + +// access default method from a default method of a sub class +AddTestCase( "*** Access default method from default method of sub class ***", 1, 1 ); +AddTestCase( "subSetArray( arr ), subGetArray()", arr, ( subSetArray( arr ), subGetArray() ) ); + + +// access default method from a dynamic method of a sub class +AddTestCase( "*** Acess default method from dynamic method of sub class ***", 1, 1 ); +AddTestCase( "dynSubSetArray( arr ), dynSubGetArray()", arr, ( dynSubSetArray( arr ), dynSubGetArray()) ); + + +// access default method from a public method of a sub class +AddTestCase( "*** Access default method from public method of sub class ***", 1, 1 ); +AddTestCase( "pubSubSetArray( arr ), pubSubGetArray()", arr, ( pubSubSetArray( arr ), pubSubGetArray()) ); + + +// access default method from a private method of a sub class +AddTestCase( "*** Access default method from private method of sub class ***", 1, 1 ); +AddTestCase( "testPrivSubArray( arr )", arr, testPrivSubArray( arr ) ); + + +// access default method from a static method of a sub class +AddTestCase( "*** Access default method from static method of sub class ***", 1, 1 ); +AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 ); +// AddTestCase( "statSubSetArray( arr ), statSubGetArray()", arr, ( statSubSetArray( arr ), statSubGetArray() ) ); + + +// access default method from a final method of a sub class +AddTestCase( "*** Access default method from final method of sub class ***", 1, 1 ); +AddTestCase( "finSubSetArray( arr ), finSubGetArray()", arr, ( finSubSetArray( arr ), finSubGetArray() ) ); + + +// access default method from a virtual method of a sub class +AddTestCase( "*** Access default method from virtual method of sub class ***", 1, 1 ); +AddTestCase( "virSubSetArray( arr ), virSubSetArray()", arr, ( virSubSetArray( arr ), virSubGetArray() ) ); + + +// access default method from a public dynamic method of a sub class +AddTestCase( "*** Acess default method from public dynamic method of sub class ***", 1, 1 ); +AddTestCase( "pubDynSubSetArray( arr ), pubDynSubGetArray()", arr, ( pubDynSubSetArray( arr ), pubDynSubGetArray()) ); + + +// access default method from a public static method of a sub class +AddTestCase( "*** Access default method from public static method of sub class ***", 1, 1 ); +AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 ); +// AddTestCase( "pubStatSubSetArray( arr ), pubStatSubGetArray()", arr, ( pubStatSubSetArray( arr ), pubStatSubGetArray() ) ); + + +// access default method from a public final method of a sub class +AddTestCase( "*** Access default method from public final method of sub class ***", 1, 1 ); +AddTestCase( "pubFinSubSetArray( arr ), pubFinSubGetArray()", arr, ( pubFinSubSetArray( arr ), pubFinSubGetArray() ) ); + + +// access default method from a public virtual method of a sub class +AddTestCase( "*** Access default method from public virtual method of sub class ***", 1, 1 ); +AddTestCase( "pubVirSubSetArray( arr ), pubVirSubSetArray()", arr, ( pubVirSubSetArray( arr ), pubVirSubGetArray() ) ); + + +// access default method from a final private method of a sub class +AddTestCase( "*** Access default method from final private method of sub class ***", 1, 1 ); +AddTestCase( "testPrivFinSubArray( arr )", arr, testPrivFinSubArray( arr ) ); + + +// access default method from a final static method of a sub class +AddTestCase( "*** Access default method from final static method of sub class ***", 1, 1 ); +AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 ); +// AddTestCase( "finStatSubSetArray( arr ), finStatSubGetArray()", arr, ( finStatSubSetArray( arr ), finStatSubGetArray() ) ); + + +// access default method from a private static method of a sub class +AddTestCase( "*** Access default method from private static method of sub class ***", 1, 1 ); +AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 ); +// AddTestCase( "testPrivStatSubArray( arr )", arr, testPrivStatSubArray( arr ) ); + + +// access default method from a private virtual method of a sub class +AddTestCase( "*** Access default method from private virtual method of sub class ***", 1, 1 ); +AddTestCase( "testPrivVirSubArray( arr )", arr, testPrivVirSubArray( arr ) ); + + + +// access default property from outside the class +AddTestCase( "*** Access default property from outside the class ***", 1, 1 ); +AddTestCase( "array = arr", arr, (array = arr, array) ); + + +// access default property from a default method of a sub class +AddTestCase( "*** Access default property from default method of sub class ***", 1, 1 ); +AddTestCase( "subSetDPArray( arr ), subGetDPArray()", arr, ( subSetDPArray( arr ), subGetDPArray() ) ); + + +// access default property from a dynamic method of a sub class +AddTestCase( "*** Access default property from dynamic method of sub class ***", 1, 1 ); +AddTestCase( "dynSubSetDPArray( arr ), dynSubGetDPArray()", arr, ( dynSubSetDPArray( arr ), dynSubGetDPArray() ) ); + + +// access default property from a public method of a sub class +AddTestCase( "*** Access default property from public method of sub class ***", 1, 1 ); +AddTestCase( "pubSubSetDPArray( arr ), pubSubGetDPArray()", arr, ( pubSubSetDPArray( arr ), pubSubGetDPArray() ) ); + + +// access default property from a private method of a sub class +AddTestCase( "*** Access default property from private method of sub class ***", 1, 1 ); +AddTestCase( "testPrivSubDPArray( arr )", arr, testPrivSubDPArray( arr ) ); + + +// access default property from a static method of a sub class +AddTestCase( "*** Access default property from static method of sub class ***", 1, 1 ); +AddTestCase( "statSubSetDPArray( arr ), statSubGetDPArray()", arr, ( statSubSetDPArray( arr ), statSubGetDPArray() ) ); + + +// access default property from a final method of a sub class +AddTestCase( "*** Access default property from final method of sub class ***", 1, 1 ); +AddTestCase( "finSubSetDPArray( arr ), finSubGetDPArray()", arr, ( finSubSetDPArray( arr ), finSubGetDPArray() ) ); + + +// access default property from a private virtual method of a sub class +AddTestCase( "*** Access default property from private virtual method of sub class ***", 1, 1 ); +AddTestCase( "virSubSetDPArray( arr ), virSubGetDPArray()", arr, ( virSubSetDPArray( arr ), virSubGetDPArray() ) ); + + +// access default property from a public static method of a sub class +AddTestCase( "*** Access default property from public static method of sub class ***", 1, 1 ); +AddTestCase( "pubStatSubSetDPArray( arr ), pubStatSubGetDPArray()", arr, ( pubStatSubSetDPArray( arr ), pubStatSubGetDPArray() ) ); + + +// access default property from a private static method of a sub class +AddTestCase( "*** Access default property from private static method of sub class ***", 1, 1 ); +AddTestCase( "testPrivStatSubDPArray( arr )", arr, testPrivStatSubDPArray( arr ) ); + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDefaultClass/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDefaultClass/DefaultClass.as new file mode 100644 index 00000000000..2b3618393b9 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDefaultClass/DefaultClass.as @@ -0,0 +1,264 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DefaultClass { + + class DefaultClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + //public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + } + + public class DefaultClass extends DefaultClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDefaultClass/FinExtDefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDefaultClass/FinExtDefaultClass.as new file mode 100644 index 00000000000..08ea92c20b1 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDefaultClass/FinExtDefaultClass.as @@ -0,0 +1,425 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +// This statement should be inside the package definition. NOT HERE. +// import Definitions.Classes.DefaultClass; + +// The package definition has been changed, and now all the packages will be under the +// folder Definitions.Classes, and only this will be used and not the subfolders within. +// This means that we cannot import a single Class file as was required to be done earlier. +// All the files in the package folder will be compiled and used. + +// IMPORTANT: This might change later, hence only commenting out the import lines +// and not deleting them. This also creates a problem that the compiled file +// might become too big to handle. +package DefaultClass { + + import DefaultClass.*; + + // Commenting out the import statement as this is not allowed by the compiler now + // import Definitions.Classes.DefaultClass; + + // As this is a final class, it will not be seen by the testcase, hence + // creating a wrapper function for this and changing the name for this file. + // FinExtDefaultClass extends FinExtDefaultClassInner + + final class FinExtDefaultClass extends DefaultClass { + + // access default method of parent from default method of sub class + function subSetArray( a:Array ) { setArray( a ); } + function subGetArray() : Array { return getArray(); } + + + // access default method of parent from dynamic method of sub class + // mt: dynamic methods are not supported + function dynSubSetArray( a:Array ) { setArray( a ); } + function dynSubGetArray() : Array { return getArray(); } + + + // access default method of parent from public method of sub class + public function pubSubSetArray( a:Array ) { setArray( a ); } + public function pubSubGetArray() : Array { return getArray(); } + + + // access default method of parent from static method of sub class + // This is an error case as a static method cannot access any other + // method except a static method and will be addressed in a seperate + // file in the Error folder. + // static function statSubSetArray( a:Array ) { setArray( a ); } + // static function statSubGetArray() : Array { return getArray(); } + + + // access default method of parent from final method of sub class + final function finSubSetArray( a:Array ) { setArray( a ); } + final function finSubGetArray() : Array { return getArray(); } + + + // access default method of parent from virtual method of sub class + virtual function virSubSetArray( a:Array ) { setArray( a ); } + virtual function virSubGetArray() : Array { return getArray(); } + + + // access default method of parent from private method of sub class + private function privSubSetArray( a:Array ) { setArray( a ); } + private function privSubGetArray() : Array { return getArray(); } + + // function to test above using a public function within the class + // this function will be accessible to an object of the class. + public function testPrivSubArray( a:Array ) : Array { + this.privSubSetArray( a ); + return this.privSubGetArray(); + } + + + + // access default method of parent from public dynamic method of sub class + // dynamic methods are not supported + public function pubDynSubSetArray( a:Array ) { setArray( a ); } + public function pubDynSubGetArray() : Array { return getArray(); } + + + // access default method of parent from public static method of sub class + // This is an error case as a static method cannot access any other + // method except a static method and will be addressed in a seperate + // file in the Error folder. + // public static function pubStatSubSetArray( a:Array ) { setArray( a ); } + // public static function pubStatSubGetArray() : Array { return getArray(); } + + + // access default method of parent from public final method of sub class + public final function pubFinSubSetArray( a:Array ) { setArray( a ); } + final public function pubFinSubGetArray() : Array { return getArray(); } + + + // access default method of parent from public virtual method of sub class + public virtual function pubVirSubSetArray( a:Array ) { setArray( a ); } + virtual public function pubVirSubGetArray() : Array { return getArray(); } + + + // access default method of parent from dynamic static method of sub class + // This is an error case as a static method cannot access any other + // method except a static method and will be addressed in a seperate + // file in the Error folder. + // dynamic static function dynStatSubSetArray( a:Array ) { setArray( a ); } + // dynamic static function dynStatSubGetArray() : Array { return getArray(); } + + + // access default method of parent from dynamic final method of sub class + final function dynFinSubSetArray( a:Array ) { setArray( a ); } + final function dynFinSubGetArray() : Array { return getArray(); } + + + // access default method of parent from dynamic virtual method of sub class + virtual function dynVirSubSetArray( a:Array ) { setArray( a ); } + virtual function dynVirSubGetArray() : Array { return getArray(); } + + + // access default method of parent from dynamic private method of sub class + private function dynPrivSubSetArray( a:Array ) { setArray( a ); } + private function dynPrivSubGetArray() : Array { return getArray(); } + + // function to test above from test scripts + public function testPrivDynSubArray( a:Array ) : Array { + this.dynPrivSubSetArray( a ); + return this.dynPrivSubGetArray(); + } + + + // access default method of parent from final static method of sub class + // This is an error case as a static method cannot access any other + // method except a static method and will be addressed in a seperate + // file in the Error folder. + // final static function finStatSubSetArray( a:Array ) { setArray( a ); } + // static final function finStatSubGetArray() : Array { return getArray(); } + + + // access default method of parent from final virtual method of sub class + // This is an invalid case and compiler should report that a function cannot + // be both final and virtual. + // This case will be moved to the negative test cases - Error folder. + // final virtual function finVirSubSetArray( a:Array ) { setArray( a ); } + // virtual final function finVirSubGetArray() : Array { return getArray(); } + + + // access default method of parent from final private method of sub class + final private function finPrivSubSetArray( a:Array ) { setArray( a ); } + private final function finPrivSubGetArray() : Array { return getArray(); } + + // function to test above from test scripts + public function testPrivFinSubArray( a:Array ) : Array { + this.finPrivSubSetArray( a ); + return this.finPrivSubGetArray(); + } + + + // access default method of parent from private static method of sub class + // This is an error case as a static method cannot access any other + // method except a static method and will be addressed in a seperate + // file in the Error folder. + private static function privStatSubSetArray( a:Array ) { setArray( a ); } + static private function privStatSubGetArray() : Array { return getArray(); } + + // function to test above from test scripts + public function testPrivStatSubArray( a:Array ) : Array { + this.privStatSubSetArray( a ); + return this.privStatSubGetArray(); + } + + + // access default method of parent from private virtual method of sub class + private virtual function privVirSubSetArray( a:Array ) { setArray( a ); } + virtual private function privVirSubGetArray() : Array { return getArray(); } + + // function to test above from test scripts + public function testPrivVirSubArray( a:Array ) : Array { + this.privVirSubSetArray( a ); + return this.privVirSubGetArray(); + } + + // access default method of parent from virtual static method of sub class + // This is an invalid case as a function cannot be both virtual and static. + // This test case will be moved to the Error folder as a negative test case. + // virtual static function virStatSubSetArray( a:Array ) { setArray( a ); } + // static virtual function virStatSubGetArray() : Array { return getArray(); } + + + + // access default property from default method of sub class + function subSetDPArray( a:Array ) { array = a; } + function subGetDPArray() : Array { return array; } + + + // access default property from dynamic method of sub class. + function dynSubSetDPArray( a:Array ) { array = a; } + function dynSubGetDPArray() : Array { return array; } + + + // access default property from public method of sub class + public function pubSubSetDPArray( a:Array ) { array = a; } + public function pubSubGetDPArray() : Array { return array; } + + + // access default property from private method of sub class + private function privSubSetDPArray( a:Array ) { array = a; } + private function privSubGetDPArray() : Array { return array; } + + // public accessor for the above given private functions, + // so that these can be accessed from an object of the class + public function testPrivSubDPArray( a:Array ) : Array { + privSubSetDPArray( a ); + return privSubGetDPArray(); + } + + + // access default property from static method of sub class + static function statSubSetDPArray( a:Array ) { array = a; } + static function statSubGetDPArray() : Array { return array; } + + + // access default property from final method of sub class + final function finSubSetDPArray( a:Array ) { array = a; } + final function finSubGetDPArray() : Array { return array; } + + + // access default property from virtual method of sub class + virtual function virSubSetDPArray( a:Array ) { array = a; } + virtual function virSubGetDPArray() : Array { return array; } + + + // access default property from public static method of sub class + public static function pubStatSubSetDPArray( a:Array ) { array = a; } + public static function pubStatSubGetDPArray() : Array { return array; } + + + // access default property from private static method of sub class + private static function privStatSubSetDPArray( a:Array ) { array = a; } + private static function privStatSubGetDPArray() : Array { return array; } + + // public accessor for the above given private functions, + // so that these can be accessed from an object of the class + public function testPrivStatSubDPArray( a:Array ) : Array { + privStatSubSetDPArray( a ); + return privStatSubGetDPArray(); + } + + } + + + // Create an instance of the final class in the package. + // This object will be used for accessing the methods created + // within the sub class given above. + var EXTDCLASS = new FinExtDefaultClass(); + + // Create a series of public functions that call the methods. + // The same names can be used as used in the class; because we are now + // outside of the class definition. + + // The default method of the sub class. + public function subSetArray( a:Array ) { EXTDCLASS.subSetArray( a ); } + public function subGetArray() : Array { return EXTDCLASS.subGetArray(); } + + + // The dynamic method of the sub class. + public function dynSubSetArray( a:Array ) { EXTDCLASS.dynSubSetArray( a ); } + public function dynSubGetArray() : Array { return EXTDCLASS.dynSubGetArray(); } + + + // The public method of the sub class. + public function pubSubSetArray( a:Array ) { EXTDCLASS.pubSubSetArray( a ); } + public function pubSubGetArray() : Array { return EXTDCLASS.pubSubGetArray(); } + + + // The private method of the sub class. Only one is used as we need to call only the + // test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivSubArray( a:Array ) : Array { return EXTDCLASS.testPrivSubArray( a ); } + + + // The static method of the sub class. + // This case is a negative case and will be put in the Error folder. + // public function statSubSetArray( a:Array ) { FinClassExtDefaultClass.statSubSetArray( a ); } + // public function statSubGetArray() : Array { return FinClassExtDefaultClass.statSubGetArray(); } + + // The STATIC class cannot be accessed by an object of the class, but has to be accessed + // by the class name itself. Bug filed for this: 108206 + // public function statSubSetArray( a:Array ) { EXTDCLASS.statSubSetArray( a ); } + // public function statSubGetArray() : Array { return EXTDCLASS.statSubGetArray(); } + + + // The final method of the sub class. + public function finSubSetArray( a : Array ) { EXTDCLASS.finSubSetArray( a ); } + public function finSubGetArray() : Array { return EXTDCLASS.finSubGetArray(); } + + + // The virtual method of the sub class. + public function virSubSetArray( a : Array ) { EXTDCLASS.virSubSetArray( a ); } + public function virSubGetArray() : Array { return EXTDCLASS.virSubGetArray(); } + + + + // The public dynamic method of the sub class. + public function pubDynSubSetArray( a:Array ) { EXTDCLASS.dynSubSetArray( a ); } + public function pubDynSubGetArray() : Array { return EXTDCLASS.pubDynSubGetArray(); } + + + // The public final method of the sub class. + public function pubFinSubSetArray( a : Array ) { EXTDCLASS.pubFinSubSetArray( a ); } + public function pubFinSubGetArray() : Array { return EXTDCLASS.pubFinSubGetArray(); } + + + // The public virtual method of the sub class. + public function pubVirSubSetArray( a : Array ) { EXTDCLASS.pubVirSubSetArray( a ); } + public function pubVirSubGetArray() : Array { return EXTDCLASS.pubVirSubGetArray(); } + + + + // The dynamic private method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivDynSubArray( a:Array ) : Array { return EXTDCLASS.testPrivDynSubArray( a ); } + + + // The dynamic final method of the sub class. + public function dynFinSubSetArray( a : Array ) { EXTDCLASS.dynFinSubSetArray( a ); } + public function dynFinSubGetArray() : Array { return EXTDCLASS.dynFinSubGetArray(); } + + + // The dynamic virtual method of the sub class. + public function dynVirSubSetArray( a : Array ) { EXTDCLASS.dynVirSubSetArray( a ); } + public function dynVirSubGetArray() : Array { return EXTDCLASS.dynVirSubGetArray(); } + + + + // The final private method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivFinSubArray( a:Array ) : Array { return EXTDCLASS.testPrivFinSubArray( a ); } + + + + // The private static method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + // This case is a negative case and will be put in the Error folder. + public function testPrivStatSubArray( a:Array ) : Array { return EXTDCLASS.testPrivStatSubArray( a ); } + + + + // The private virtual method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivVirSubArray( a:Array ) : Array { return EXTDCLASS.testPrivVirSubArray( a ); } + + + // The default property being accessed by the different method attributes. + // The default method attribute. + public function subSetDPArray( a:Array ) { EXTDCLASS.subSetDPArray(a); } + public function subGetDPArray() : Array { return EXTDCLASS.subGetDPArray(); } + + + // The dynamic method attribute. + public function dynSubSetDPArray( a:Array ) { EXTDCLASS.dynSubSetDPArray(a); } + public function dynSubGetDPArray() : Array { return EXTDCLASS.dynSubGetDPArray(); } + + + // The public method attribute. + public function pubSubSetDPArray( a:Array ) { EXTDCLASS.pubSubSetDPArray(a); } + public function pubSubGetDPArray() : Array { return EXTDCLASS.pubSubGetDPArray(); } + + + // The private method attribute. + public function testPrivSubDPArray( a:Array ):Array { return EXTDCLASS.testPrivSubDPArray(a) } + + + // the static method attribute. + public function statSubSetDPArray( a:Array ) { FinExtDefaultClass.statSubSetDPArray(a); } + public function statSubGetDPArray() : Array { return FinExtDefaultClass.statSubGetDPArray(); } + + + // the final method attribute. + public function finSubSetDPArray( a:Array ) { EXTDCLASS.finSubSetDPArray(a); } + public function finSubGetDPArray() : Array { return EXTDCLASS.finSubGetDPArray(); } + + + // the virtual method attribute. + public function virSubSetDPArray( a:Array ) { EXTDCLASS.virSubSetDPArray(a); } + public function virSubGetDPArray() : Array { return EXTDCLASS.virSubGetDPArray(); } + + + // the public static method attrbute. + public function pubStatSubSetDPArray( a:Array ) { FinExtDefaultClass.pubStatSubSetDPArray(a); } + public function pubStatSubGetDPArray() : Array { return FinExtDefaultClass.pubStatSubGetDPArray(); } + + + // the private static method attribute + public function testPrivStatSubDPArray( a:Array ) : Array { return EXTDCLASS.testPrivStatSubDPArray(a); } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDefaultClassFin.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDefaultClassFin.as new file mode 100644 index 00000000000..e49ddefd028 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDefaultClassFin.as @@ -0,0 +1,191 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import DefaultClass.*; + + +var SECTION = "Definitions\Ext"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Final Class Extends Default Class Final Methods"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +// Can't create an instance because it's not public +// Hence commenting out the lines where the class is initialized. +// var EXTDCLASS = new FinExtDefaultClassPub(); + + +// Create an array variable which will define the test array to be used +// for the given output. +var arr = new Array(1, 2, 3); + + +// access final method from a default method of a sub class +AddTestCase( "*** Access default method from default method of sub class ***", 1, 1 ); +AddTestCase( "subSetArray( arr ), subGetArray()", arr, ( subSetArray( arr ), subGetArray() ) ); + + +// access final method from a dynamic method of a sub class +AddTestCase( "*** Acess default method from dynamic method of sub class ***", 1, 1 ); +AddTestCase( "dynSubSetArray( arr ), dynSubGetArray()", arr, ( dynSubSetArray( arr ), dynSubGetArray()) ); + + +// access final method from a public method of a sub class +AddTestCase( "*** Access default method from public method of sub class ***", 1, 1 ); +AddTestCase( "pubSubSetArray( arr ), pubSubGetArray()", arr, ( pubSubSetArray( arr ), pubSubGetArray()) ); + + +// access final method from a private method of a sub class +AddTestCase( "*** Access default method from private method of sub class ***", 1, 1 ); +AddTestCase( "testPrivSubArray( arr )", arr, testPrivSubArray( arr ) ); + + +// access final method from a static method of a sub class +AddTestCase( "*** Access default method from static method of sub class ***", 1, 1 ); +AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 ); +// AddTestCase( "statSubSetArray( arr ), statSubGetArray()", arr, ( statSubSetArray( arr ), statSubGetArray() ) ); + + +// access final method from a final method of a sub class +AddTestCase( "*** Access default method from final method of sub class ***", 1, 1 ); +AddTestCase( "finSubSetArray( arr ), finSubGetArray()", arr, ( finSubSetArray( arr ), finSubGetArray() ) ); + + +// access final method from a virtual method of a sub class +AddTestCase( "*** Access default method from virtual method of sub class ***", 1, 1 ); +AddTestCase( "virSubSetArray( arr ), virSubSetArray()", arr, ( virSubSetArray( arr ), virSubGetArray() ) ); + + +// access final method from a public dynamic method of a sub class +AddTestCase( "*** Acess default method from public dynamic method of sub class ***", 1, 1 ); +AddTestCase( "pubDynSubSetArray( arr ), pubDynSubGetArray()", arr, ( pubDynSubSetArray( arr ), pubDynSubGetArray()) ); + + +// access final method from a public static method of a sub class +AddTestCase( "*** Access default method from public static method of sub class ***", 1, 1 ); +AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 ); +// AddTestCase( "pubStatSubSetArray( arr ), pubStatSubGetArray()", arr, ( pubStatSubSetArray( arr ), pubStatSubGetArray() ) ); + + +// access final method from a public final method of a sub class +AddTestCase( "*** Access default method from public final method of sub class ***", 1, 1 ); +AddTestCase( "pubFinSubSetArray( arr ), pubFinSubGetArray()", arr, ( pubFinSubSetArray( arr ), pubFinSubGetArray() ) ); + + +// access final method from a public virtual method of a sub class +AddTestCase( "*** Access default method from public virtual method of sub class ***", 1, 1 ); +AddTestCase( "pubVirSubSetArray( arr ), pubVirSubSetArray()", arr, ( pubVirSubSetArray( arr ), pubVirSubGetArray() ) ); + + +// access final method from a final private method of a sub class +AddTestCase( "*** Access default method from final private method of sub class ***", 1, 1 ); +AddTestCase( "testPrivFinSubArray( arr )", arr, testPrivFinSubArray( arr ) ); + + +// access final method from a final static method of a sub class +AddTestCase( "*** Access default method from final static method of sub class ***", 1, 1 ); +AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 ); +// AddTestCase( "finStatSubSetArray( arr ), finStatSubGetArray()", arr, ( finStatSubSetArray( arr ), finStatSubGetArray() ) ); + + +// access final method from a private static method of a sub class +AddTestCase( "*** Access default method from private static method of sub class ***", 1, 1 ); +AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 ); +// AddTestCase( "testPrivStatSubArray( arr )", arr, testPrivStatSubArray( arr ) ); + + +// access final method from a private virtual method of a sub class +AddTestCase( "*** Access default method from private virtual method of sub class ***", 1, 1 ); +AddTestCase( "testPrivVirSubArray( arr )", arr, testPrivVirSubArray( arr ) ); + + +// access final property from outside the class +AddTestCase( "*** Access final from outside the class ***", 1, 1 ); +AddTestCase( "finArray = arr", arr, (finArray = arr, finArray) ); + + +// fill in the rest of the cases here + +// access final property from outside the class +AddTestCase( "*** Access default property from outside the class ***", 1, 1 ); +AddTestCase( "array = arr", arr, (array = arr, array) ); + + +// access final property from a default method of a sub class +AddTestCase( "*** Access default property from default method of sub class ***", 1, 1 ); +AddTestCase( "subSetDPArray( arr ), subGetDPArray()", arr, ( subSetDPArray( arr ), subGetDPArray() ) ); + + +// access final property from a dynamic method of a sub class +AddTestCase( "*** Access default property from dynamic method of sub class ***", 1, 1 ); +AddTestCase( "dynSubSetDPArray( arr ), dynSubGetDPArray()", arr, ( dynSubSetDPArray( arr ), dynSubGetDPArray() ) ); + + +// access final property from a public method of a sub class +AddTestCase( "*** Access default property from public method of sub class ***", 1, 1 ); +AddTestCase( "pubSubSetDPArray( arr ), pubSubGetDPArray()", arr, ( pubSubSetDPArray( arr ), pubSubGetDPArray() ) ); + + +// access final property from a private method of a sub class +AddTestCase( "*** Access default property from private method of sub class ***", 1, 1 ); +AddTestCase( "testPrivSubDPArray( arr )", arr, testPrivSubDPArray( arr ) ); + + +// access final property from a static method of a sub class +AddTestCase( "*** Access default property from static method of sub class ***", 1, 1 ); +AddTestCase( "statSubSetDPArray( arr ), statSubGetDPArray()", arr, ( statSubSetDPArray( arr ), statSubGetDPArray() ) ); + + +// access final property from a final method of a sub class +AddTestCase( "*** Access default property from final method of sub class ***", 1, 1 ); +AddTestCase( "finSubSetDPArray( arr ), finSubGetDPArray()", arr, ( finSubSetDPArray( arr ), finSubGetDPArray() ) ); + + +// access final property from a private virtual method of a sub class +AddTestCase( "*** Access default property from private virtual method of sub class ***", 1, 1 ); +AddTestCase( "virSubSetDPArray( arr ), virSubGetDPArray()", arr, ( virSubSetDPArray( arr ), virSubGetDPArray() ) ); + + +// access final property from a public static method of a sub class +AddTestCase( "*** Access default property from public static method of sub class ***", 1, 1 ); +AddTestCase( "pubStatSubSetDPArray( arr ), pubStatSubGetDPArray()", arr, ( pubStatSubSetDPArray( arr ), pubStatSubGetDPArray() ) ); + + +// access final property from a private static method of a sub class +AddTestCase( "*** Access default property from private static method of sub class ***", 1, 1 ); +AddTestCase( "testPrivStatSubDPArray( arr )", arr, testPrivStatSubDPArray( arr ) ); + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDefaultClassFin/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDefaultClassFin/DefaultClass.as new file mode 100644 index 00000000000..2b3618393b9 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDefaultClassFin/DefaultClass.as @@ -0,0 +1,264 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DefaultClass { + + class DefaultClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + //public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + } + + public class DefaultClass extends DefaultClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDefaultClassFin/FinExtDefaultClassFin.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDefaultClassFin/FinExtDefaultClassFin.as new file mode 100644 index 00000000000..b33209f8ce3 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDefaultClassFin/FinExtDefaultClassFin.as @@ -0,0 +1,422 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +// The package definition has been changed, and now all the packages will be under the +// folder Definitions.Classes, and only this will be used and not the subfolders within. +// This means that we cannot import a single Class file as was required to be done earlier. +// All the files in the package folder will be compiled and used. + +// IMPORTANT: This might change later, hence only commenting out the import lines +// and not deleting them. This also creates a problem that the compiled file +// might become too big to handle. +package DefaultClass { + + import DefaultClass.*; + + // Commenting out the import statement as this is not allowed by the compiler now + // import Definitions.Classes.DefaultClass; + + // As this is a final class, it will not be seen by the testcase, hence + // creating a wrapper function for this and changing the name for this file. + // FinExtDefaultClassFin extends FinExtDefaultClassFinInner + + final class FinExtDefaultClassFin extends DefaultClass { + + // access final method of parent from default method of sub class + function subSetArray( a:Array ) { setFinArray( a ); } + function subGetArray() : Array { return getFinArray(); } + + + // access final method of parent from dynamic method of sub class + function dynSubSetArray( a:Array ) { setFinArray( a ); } + function dynSubGetArray() : Array { return getFinArray(); } + + + // access final method of parent from public method of sub class + public function pubSubSetArray( a:Array ) { setFinArray( a ); } + public function pubSubGetArray() : Array { return getFinArray(); } + + + // access final method of parent from static method of sub class + // This is an error case as a static method cannot access any other + // method except a static method and will be addressed in a seperate + // file in the Error folder. + // static function statSubSetArray( a:Array ) { setFinArray( a ); } + // static function statSubGetArray() : Array { return getFinArray(); } + + + // access final method of parent from final method of sub class + final function finSubSetArray( a:Array ) { setFinArray( a ); } + final function finSubGetArray() : Array { return getFinArray(); } + + + // access final method of parent from virtual method of sub class + virtual function virSubSetArray( a:Array ) { setFinArray( a ); } + virtual function virSubGetArray() : Array { return getFinArray(); } + + + // access final method of parent from private method of sub class + private function privSubSetArray( a:Array ) { setFinArray( a ); } + private function privSubGetArray() : Array { return getFinArray(); } + + // function to test above using a public function within the class + // this function will be accessible to an object of the class. + public function testPrivSubArray( a:Array ) : Array { + this.privSubSetArray( a ); + return this.privSubGetArray(); + } + + + + // access final method of parent from public dynamic method of sub class + public function pubDynSubSetArray( a:Array ) { setFinArray( a ); } + public function pubDynSubGetArray() : Array { return getFinArray(); } + + + // access final method of parent from public static method of sub class + // This is an error case as a static method cannot access any other + // method except a static method and will be addressed in a seperate + // file in the Error folder. + // public static function pubStatSubSetArray( a:Array ) { setFinArray( a ); } + // public static function pubStatSubGetArray() : Array { return getFinArray(); } + + + // access final method of parent from public final method of sub class + public final function pubFinSubSetArray( a:Array ) { setFinArray( a ); } + final public function pubFinSubGetArray() : Array { return getFinArray(); } + + + // access final method of parent from public virtual method of sub class + public virtual function pubVirSubSetArray( a:Array ) { setFinArray( a ); } + virtual public function pubVirSubGetArray() : Array { return getFinArray(); } + + + // access final method of parent from dynamic static method of sub class + // This is an error case as a static method cannot access any other + // method except a static method and will be addressed in a seperate + // file in the Error folder. + // dynamic static function dynStatSubSetArray( a:Array ) { setFinArray( a ); } + // dynamic static function dynStatSubGetArray() : Array { return getFinArray(); } + + + // access final method of parent from dynamic final method of sub class + final function dynFinSubSetArray( a:Array ) { setFinArray( a ); } + final function dynFinSubGetArray() : Array { return getFinArray(); } + + + // access final method of parent from dynamic virtual method of sub class + virtual function dynVirSubSetArray( a:Array ) { setFinArray( a ); } + virtual function dynVirSubGetArray() : Array { return getFinArray(); } + + + // access final method of parent from dynamic private method of sub class + private function dynPrivSubSetArray( a:Array ) { setFinArray( a ); } + private function dynPrivSubGetArray() : Array { return getFinArray(); } + + // function to test above from test scripts + public function testPrivDynSubArray( a:Array ) : Array { + this.dynPrivSubSetArray( a ); + return this.dynPrivSubGetArray(); + } + + + // access final method of parent from final static method of sub class + // This is an error case as a static method cannot access any other + // method except a static method and will be addressed in a seperate + // file in the Error folder. + // final static function finStatSubSetArray( a:Array ) { setFinArray( a ); } + // static final function finStatSubGetArray() : Array { return getFinArray(); } + + + // access final method of parent from final virtual method of sub class + // This is an invalid case and compiler should report that a function cannot + // be both final and virtual. + // This case will be moved to the negative test cases - Error folder. + // final virtual function finVirSubSetArray( a:Array ) { setFinArray( a ); } + // virtual final function finVirSubGetArray() : Array { return getFinArray(); } + + + // access final method of parent from final private method of sub class + final private function finPrivSubSetArray( a:Array ) { setFinArray( a ); } + private final function finPrivSubGetArray() : Array { return getFinArray(); } + + // function to test above from test scripts + public function testPrivFinSubArray( a:Array ) : Array { + this.finPrivSubSetArray( a ); + return this.finPrivSubGetArray(); + } + + + // access final method of parent from private static method of sub class + // This is an error case as a static method cannot access any other + // method except a static method and will be addressed in a seperate + // file in the Error folder. + private static function privStatSubSetArray( a:Array ) { setFinArray( a ); } + static private function privStatSubGetArray() : Array { return getFinArray(); } + + // function to test above from test scripts + public function testPrivStatSubArray( a:Array ) : Array { + this.privStatSubSetArray( a ); + return this.privStatSubGetArray(); + } + + + // access final method of parent from private virtual method of sub class + private virtual function privVirSubSetArray( a:Array ) { setFinArray( a ); } + virtual private function privVirSubGetArray() : Array { return getFinArray(); } + + // function to test above from test scripts + public function testPrivVirSubArray( a:Array ) : Array { + this.privVirSubSetArray( a ); + return this.privVirSubGetArray(); + } + + + + // access final method of parent from virtual static method of sub class + // This is an invalid case as a function cannot be both virtual and static. + // This test case will be moved to the Error folder as a negative test case. + // virtual static function virStatSubSetArray( a:Array ) { setFinArray( a ); } + // static virtual function virStatSubGetArray() : Array { return getFinArray(); } + + + + + // access final property from default method of sub class + function subSetDPArray( a:Array ) { finArray = a; } + function subGetDPArray() : Array { return finArray; } + + + // access final property from dynamic method of sub class. + function dynSubSetDPArray( a:Array ) { finArray = a; } + function dynSubGetDPArray() : Array { return finArray; } + + + // access final property from public method of sub class + public function pubSubSetDPArray( a:Array ) { finArray = a; } + public function pubSubGetDPArray() : Array { return finArray; } + + + // access final property from private method of sub class + private function privSubSetDPArray( a:Array ) { finArray = a; } + private function privSubGetDPArray() : Array { return finArray; } + + // public accessor for the above given private functions, + // so that these can be accessed from an object of the class + public function testPrivSubDPArray( a:Array ) : Array { + privSubSetDPArray( a ); + return privSubGetDPArray(); + } + + + // access final property from static method of sub class + static function statSubSetDPArray( a:Array ) { finArray = a; } + static function statSubGetDPArray() : Array { return finArray; } + + + // access final property from final method of sub class + final function finSubSetDPArray( a:Array ) { finArray = a; } + final function finSubGetDPArray() : Array { return finArray; } + + + // access final property from virtual method of sub class + virtual function virSubSetDPArray( a:Array ) { finArray = a; } + virtual function virSubGetDPArray() : Array { return finArray; } + + + // access final property from public static method of sub class + public static function pubStatSubSetDPArray( a:Array ) { finArray = a; } + public static function pubStatSubGetDPArray() : Array { return finArray; } + + + // access final property from private static method of sub class + private static function privStatSubSetDPArray( a:Array ) { finArray = a; } + private static function privStatSubGetDPArray() : Array { return finArray; } + + // public accessor for the above given private functions, + // so that these can be accessed from an object of the class + public function testPrivStatSubDPArray( a:Array ) : Array { + privStatSubSetDPArray( a ); + return privStatSubGetDPArray(); + } + + } + + + // Create an instance of the final class in the package. + // This object will be used for accessing the methods created + // within the sub class given above. + var EXTDCLASS = new FinExtDefaultClassFin(); + + // Create a series of public functions that call the methods. + // The same names can be used as used in the class; because we are now + // outside of the class definition. + + // The default method of the sub class. + public function subSetArray( a:Array ) { EXTDCLASS.subSetArray( a ); } + public function subGetArray() : Array { return EXTDCLASS.subGetArray(); } + + + // The dynamic method of the sub class. + public function dynSubSetArray( a:Array ) { EXTDCLASS.dynSubSetArray( a ); } + public function dynSubGetArray() : Array { return EXTDCLASS.dynSubGetArray(); } + + + // The public method of the sub class. + public function pubSubSetArray( a:Array ) { EXTDCLASS.pubSubSetArray( a ); } + public function pubSubGetArray() : Array { return EXTDCLASS.pubSubGetArray(); } + + + // The private method of the sub class. Only one is used as we need to call only the + // test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivSubArray( a:Array ) : Array { return EXTDCLASS.testPrivSubArray( a ); } + + + // The static method of the sub class. + // This case is a negative case and will be put in the Error folder. + // public function statSubSetArray( a:Array ) { FinClassExtDefaultClass.statSubSetArray( a ); } + // public function statSubGetArray() : Array { return FinClassExtDefaultClass.statSubGetArray(); } + + // The STATIC class cannot be accessed by an object of the class, but has to be accessed + // by the class name itself. Bug filed for this: 108206 + // public function statSubSetArray( a:Array ) { EXTDCLASS.statSubSetArray( a ); } + // public function statSubGetArray() : Array { return EXTDCLASS.statSubGetArray(); } + + + // The final method of the sub class. + public function finSubSetArray( a : Array ) { EXTDCLASS.finSubSetArray( a ); } + public function finSubGetArray() : Array { return EXTDCLASS.finSubGetArray(); } + + + // The virtual method of the sub class. + public function virSubSetArray( a : Array ) { EXTDCLASS.virSubSetArray( a ); } + public function virSubGetArray() : Array { return EXTDCLASS.virSubGetArray(); } + + + + // The public dynamic method of the sub class. + public function pubDynSubSetArray( a:Array ) { EXTDCLASS.dynSubSetArray( a ); } + public function pubDynSubGetArray() : Array { return EXTDCLASS.pubDynSubGetArray(); } + + + // The public final method of the sub class. + public function pubFinSubSetArray( a : Array ) { EXTDCLASS.pubFinSubSetArray( a ); } + public function pubFinSubGetArray() : Array { return EXTDCLASS.pubFinSubGetArray(); } + + + // The public virtual method of the sub class. + public function pubVirSubSetArray( a : Array ) { EXTDCLASS.pubVirSubSetArray( a ); } + public function pubVirSubGetArray() : Array { return EXTDCLASS.pubVirSubGetArray(); } + + + + // The dynamic private method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivDynSubArray( a:Array ) : Array { return EXTDCLASS.testPrivDynSubArray( a ); } + + + // The dynamic final method of the sub class. + public function dynFinSubSetArray( a : Array ) { EXTDCLASS.dynFinSubSetArray( a ); } + public function dynFinSubGetArray() : Array { return EXTDCLASS.dynFinSubGetArray(); } + + + // The dynamic virtual method of the sub class. + public function dynVirSubSetArray( a : Array ) { EXTDCLASS.dynVirSubSetArray( a ); } + public function dynVirSubGetArray() : Array { return EXTDCLASS.dynVirSubGetArray(); } + + + + // The final private method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivFinSubArray( a:Array ) : Array { return EXTDCLASS.testPrivFinSubArray( a ); } + + + + // The private static method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + // This case is a negative case and will be put in the Error folder. + public function testPrivStatSubArray( a:Array ) : Array { return EXTDCLASS.testPrivStatSubArray( a ); } + + + + // The private virtual method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivVirSubArray( a:Array ) : Array { return EXTDCLASS.testPrivVirSubArray( a ); } + + + // The default property being accessed by the different method attributes. + // The default method attribute. + public function subSetDPArray( a:Array ) { EXTDCLASS.subSetDPArray(a); } + public function subGetDPArray() : Array { return EXTDCLASS.subGetDPArray(); } + + + // The dynamic method attribute. + public function dynSubSetDPArray( a:Array ) { EXTDCLASS.dynSubSetDPArray(a); } + public function dynSubGetDPArray() : Array { return EXTDCLASS.dynSubGetDPArray(); } + + + // The public method attribute. + public function pubSubSetDPArray( a:Array ) { EXTDCLASS.pubSubSetDPArray(a); } + public function pubSubGetDPArray() : Array { return EXTDCLASS.pubSubGetDPArray(); } + + + // The private method attribute. + public function testPrivSubDPArray( a:Array ):Array { return EXTDCLASS.testPrivSubDPArray(a) } + + // the static method attribute. + public function statSubSetDPArray( a:Array ) { FinExtDefaultClassFin.statSubSetDPArray(a); } + public function statSubGetDPArray() : Array { return FinExtDefaultClassFin.statSubGetDPArray(); } + + + // the final method attribute. + public function finSubSetDPArray( a:Array ) { EXTDCLASS.finSubSetDPArray(a); } + public function finSubGetDPArray() : Array { return EXTDCLASS.finSubGetDPArray(); } + + + // the virtual method attribute. + public function virSubSetDPArray( a:Array ) { EXTDCLASS.virSubSetDPArray(a); } + public function virSubGetDPArray() : Array { return EXTDCLASS.virSubGetDPArray(); } + + + // the public static method attrbute. + public function pubStatSubSetDPArray( a:Array ) { FinExtDefaultClassFin.pubStatSubSetDPArray(a); } + public function pubStatSubGetDPArray() : Array { return FinExtDefaultClassFin.pubStatSubGetDPArray(); } + + + // the private static method attribute + public function testPrivStatSubDPArray( a:Array ) : Array { return EXTDCLASS.testPrivStatSubDPArray(a); } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDefaultClassPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDefaultClassPub.as new file mode 100644 index 00000000000..eec44c0931f --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDefaultClassPub.as @@ -0,0 +1,190 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import DefaultClass.*; + + +var SECTION = "Definitions\Ext"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Final Class Extends Default Class Public Methods"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +// Can't create an instance because it's not public +// Hence commenting out the lines where the class is initialized. +// var EXTDCLASS = new FinExtDefaultClassPub(); + +// Create an array variable which will define the test array to be used +// for the given output. +var arr = new Array(1, 2, 3); + + +// access default method from a default method of a sub class +AddTestCase( "*** Access default method from default method of sub class ***", 1, 1 ); +AddTestCase( "subSetArray( arr ), subGetArray()", arr, ( subSetArray( arr ), subGetArray() ) ); + + +// access default method from a dynamic method of a sub class +AddTestCase( "*** Acess default method from dynamic method of sub class ***", 1, 1 ); +AddTestCase( "dynSubSetArray( arr ), dynSubGetArray()", arr, ( dynSubSetArray( arr ), dynSubGetArray()) ); + + +// access default method from a public method of a sub class +AddTestCase( "*** Access default method from public method of sub class ***", 1, 1 ); +AddTestCase( "pubSubSetArray( arr ), pubSubGetArray()", arr, ( pubSubSetArray( arr ), pubSubGetArray()) ); + + +// access default method from a private method of a sub class +AddTestCase( "*** Access default method from private method of sub class ***", 1, 1 ); +AddTestCase( "testPrivSubArray( arr )", arr, testPrivSubArray( arr ) ); + + +// access default method from a static method of a sub class +AddTestCase( "*** Access default method from static method of sub class ***", 1, 1 ); +AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 ); +// AddTestCase( "statSubSetArray( arr ), statSubGetArray()", arr, ( statSubSetArray( arr ), statSubGetArray() ) ); + + +// access default method from a final method of a sub class +AddTestCase( "*** Access default method from final method of sub class ***", 1, 1 ); +AddTestCase( "finSubSetArray( arr ), finSubGetArray()", arr, ( finSubSetArray( arr ), finSubGetArray() ) ); + + +// access default method from a virtual method of a sub class +AddTestCase( "*** Access default method from virtual method of sub class ***", 1, 1 ); +AddTestCase( "virSubSetArray( arr ), virSubSetArray()", arr, ( virSubSetArray( arr ), virSubGetArray() ) ); + + +// access default method from a public dynamic method of a sub class +AddTestCase( "*** Acess default method from public dynamic method of sub class ***", 1, 1 ); +AddTestCase( "pubDynSubSetArray( arr ), pubDynSubGetArray()", arr, ( pubDynSubSetArray( arr ), pubDynSubGetArray()) ); + + +// access default method from a public static method of a sub class +AddTestCase( "*** Access default method from public static method of sub class ***", 1, 1 ); +AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 ); +// AddTestCase( "pubStatSubSetArray( arr ), pubStatSubGetArray()", arr, ( pubStatSubSetArray( arr ), pubStatSubGetArray() ) ); + + +// access default method from a public final method of a sub class +AddTestCase( "*** Access default method from public final method of sub class ***", 1, 1 ); +AddTestCase( "pubFinSubSetArray( arr ), pubFinSubGetArray()", arr, ( pubFinSubSetArray( arr ), pubFinSubGetArray() ) ); + + +// access default method from a public virtual method of a sub class +AddTestCase( "*** Access default method from public virtual method of sub class ***", 1, 1 ); +AddTestCase( "pubVirSubSetArray( arr ), pubVirSubSetArray()", arr, ( pubVirSubSetArray( arr ), pubVirSubGetArray() ) ); + + +// access default method from a final private method of a sub class +AddTestCase( "*** Access default method from final private method of sub class ***", 1, 1 ); +AddTestCase( "testPrivFinSubArray( arr )", arr, testPrivFinSubArray( arr ) ); + + +// access default method from a final static method of a sub class +AddTestCase( "*** Access default method from final static method of sub class ***", 1, 1 ); +AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 ); +// AddTestCase( "finStatSubSetArray( arr ), finStatSubGetArray()", arr, ( finStatSubSetArray( arr ), finStatSubGetArray() ) ); + + +// access default method from a private static method of a sub class +AddTestCase( "*** Access default method from private static method of sub class ***", 1, 1 ); +AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 ); +// AddTestCase( "testPrivStatSubArray( arr )", arr, testPrivStatSubArray( arr ) ); + + +// access default method from a private virtual method of a sub class +AddTestCase( "*** Access default method from private virtual method of sub class ***", 1, 1 ); +AddTestCase( "testPrivVirSubArray( arr )", arr, testPrivVirSubArray( arr ) ); + + +// access public property from outside the class +AddTestCase( "*** Access public property from outside the class ***", 1, 1 ); +AddTestCase( "pubArray = arr", arr, (pubArray = arr, pubArray) ); + + +// fill in the rest of the cases here + +// access public property from outside the class +AddTestCase( "*** Access default property from outside the class ***", 1, 1 ); +AddTestCase( "array = arr", arr, (array = arr, array) ); + + +// access public property from a default method of a sub class +AddTestCase( "*** Access default property from default method of sub class ***", 1, 1 ); +AddTestCase( "subSetDPArray( arr ), subGetDPArray()", arr, ( subSetDPArray( arr ), subGetDPArray() ) ); + + +// access public property from a dynamic method of a sub class +AddTestCase( "*** Access default property from dynamic method of sub class ***", 1, 1 ); +AddTestCase( "dynSubSetDPArray( arr ), dynSubGetDPArray()", arr, ( dynSubSetDPArray( arr ), dynSubGetDPArray() ) ); + + +// access public property from a public method of a sub class +AddTestCase( "*** Access default property from public method of sub class ***", 1, 1 ); +AddTestCase( "pubSubSetDPArray( arr ), pubSubGetDPArray()", arr, ( pubSubSetDPArray( arr ), pubSubGetDPArray() ) ); + + +// access public property from a private method of a sub class +AddTestCase( "*** Access default property from private method of sub class ***", 1, 1 ); +AddTestCase( "testPrivSubDPArray( arr )", arr, testPrivSubDPArray( arr ) ); + + +// access public property from a static method of a sub class +AddTestCase( "*** Access default property from static method of sub class ***", 1, 1 ); +AddTestCase( "statSubSetDPArray( arr ), statSubGetDPArray()", arr, ( statSubSetDPArray( arr ), statSubGetDPArray() ) ); + + +// access public property from a final method of a sub class +AddTestCase( "*** Access default property from final method of sub class ***", 1, 1 ); +AddTestCase( "finSubSetDPArray( arr ), finSubGetDPArray()", arr, ( finSubSetDPArray( arr ), finSubGetDPArray() ) ); + + +// access public property from a private virtual method of a sub class +AddTestCase( "*** Access default property from private virtual method of sub class ***", 1, 1 ); +AddTestCase( "virSubSetDPArray( arr ), virSubGetDPArray()", arr, ( virSubSetDPArray( arr ), virSubGetDPArray() ) ); + + +// access public property from a public static method of a sub class +AddTestCase( "*** Access default property from public static method of sub class ***", 1, 1 ); +AddTestCase( "pubStatSubSetDPArray( arr ), pubStatSubGetDPArray()", arr, ( pubStatSubSetDPArray( arr ), pubStatSubGetDPArray() ) ); + + +// access public property from a private static method of a sub class +AddTestCase( "*** Access default property from private static method of sub class ***", 1, 1 ); +AddTestCase( "testPrivStatSubDPArray( arr )", arr, testPrivStatSubDPArray( arr ) ); + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDefaultClassPub/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDefaultClassPub/DefaultClass.as new file mode 100644 index 00000000000..2b3618393b9 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDefaultClassPub/DefaultClass.as @@ -0,0 +1,264 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DefaultClass { + + class DefaultClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + //public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + } + + public class DefaultClass extends DefaultClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDefaultClassPub/FinExtDefaultClassPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDefaultClassPub/FinExtDefaultClassPub.as new file mode 100644 index 00000000000..ce31714bbe8 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDefaultClassPub/FinExtDefaultClassPub.as @@ -0,0 +1,422 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +// The package definition has been changed, and now all the packages will be under the +// folder Definitions.Classes, and only this will be used and not the subfolders within. +// This means that we cannot import a single Class file as was required to be done earlier. +// All the files in the package folder will be compiled and used. + +// IMPORTANT: This might change later, hence only commenting out the import lines +// and not deleting them. This also creates a problem that the compiled file +// might become too big to handle. +package DefaultClass{ + + import DefaultClass.*; + + // Commenting out the import statement as this is not allowed by the compiler now + // import Definitions.Classes.DefaultClass; + + // As this is a final class, it will not be seen by the testcase, hence + // creating a wrapper function for this and changing the name for this file. + // FinExtDefaultClassPub extends FinExtDefaultClassPubInner + + final class FinExtDefaultClassPub extends DefaultClass { + + // access public method of parent from default method of sub class + function subSetArray( a:Array ) { setPubArray( a ); } + function subGetArray() : Array { return getPubArray(); } + + + // access public method of parent from dynamic method of sub class + function dynSubSetArray( a:Array ) { setPubArray( a ); } + function dynSubGetArray() : Array { return getPubArray(); } + + + // access public method of parent from public method of sub class + public function pubSubSetArray( a:Array ) { setPubArray( a ); } + public function pubSubGetArray() : Array { return getPubArray(); } + + + // access public method of parent from static method of sub class + // This is an error case as a static method cannot access any other + // method except a static method and will be addressed in a seperate + // file in the Error folder. + // static function statSubSetArray( a:Array ) { setPubArray( a ); } + // static function statSubGetArray() : Array { return getPubArray(); } + + + // access public method of parent from final method of sub class + final function finSubSetArray( a:Array ) { setPubArray( a ); } + final function finSubGetArray() : Array { return getPubArray(); } + + + // access public method of parent from virtual method of sub class + virtual function virSubSetArray( a:Array ) { setPubArray( a ); } + virtual function virSubGetArray() : Array { return getPubArray(); } + + + // access public method of parent from private method of sub class + private function privSubSetArray( a:Array ) { setPubArray( a ); } + private function privSubGetArray() : Array { return getPubArray(); } + + // function to test above using a public function within the class + // this function will be accessible to an object of the class. + public function testPrivSubArray( a:Array ) : Array { + this.privSubSetArray( a ); + return this.privSubGetArray(); + } + + + + // access public method of parent from public dynamic method of sub class + public function pubDynSubSetArray( a:Array ) { setPubArray( a ); } + public function pubDynSubGetArray() : Array { return getPubArray(); } + + + // access public method of parent from public static method of sub class + // This is an error case as a static method cannot access any other + // method except a static method and will be addressed in a seperate + // file in the Error folder. + // public static function pubStatSubSetArray( a:Array ) { setPubArray( a ); } + // public static function pubStatSubGetArray() : Array { return getPubArray(); } + + + // access public method of parent from public final method of sub class + public final function pubFinSubSetArray( a:Array ) { setPubArray( a ); } + final public function pubFinSubGetArray() : Array { return getPubArray(); } + + + // access public method of parent from public virtual method of sub class + public virtual function pubVirSubSetArray( a:Array ) { setPubArray( a ); } + virtual public function pubVirSubGetArray() : Array { return getPubArray(); } + + + // access public method of parent from dynamic static method of sub class + // This is an error case as a static method cannot access any other + // method except a static method and will be addressed in a seperate + // file in the Error folder. + // dynamic static function dynStatSubSetArray( a:Array ) { setPubArray( a ); } + // dynamic static function dynStatSubGetArray() : Array { return getPubArray(); } + + + // access public method of parent from dynamic final method of sub class + final function dynFinSubSetArray( a:Array ) { setPubArray( a ); } + final function dynFinSubGetArray() : Array { return getPubArray(); } + + + // access public method of parent from dynamic virtual method of sub class + virtual function dynVirSubSetArray( a:Array ) { setPubArray( a ); } + virtual function dynVirSubGetArray() : Array { return getPubArray(); } + + + // access public method of parent from dynamic private method of sub class + private function dynPrivSubSetArray( a:Array ) { setPubArray( a ); } + private function dynPrivSubGetArray() : Array { return getPubArray(); } + + // function to test above from test scripts + public function testPrivDynSubArray( a:Array ) : Array { + this.dynPrivSubSetArray( a ); + return this.dynPrivSubGetArray(); + } + + + // access public method of parent from final static method of sub class + // This is an error case as a static method cannot access any other + // method except a static method and will be addressed in a seperate + // file in the Error folder. + // final static function finStatSubSetArray( a:Array ) { setPubArray( a ); } + // static final function finStatSubGetArray() : Array { return getPubArray(); } + + + // access public method of parent from final virtual method of sub class + // This is an invalid case and compiler should report that a function cannot + // be both final and virtual. + // This case will be moved to the negative test cases - Error folder. + // final virtual function finVirSubSetArray( a:Array ) { setPubArray( a ); } + // virtual final function finVirSubGetArray() : Array { return getPubArray(); } + + + // access public method of parent from final private method of sub class + final private function finPrivSubSetArray( a:Array ) { setPubArray( a ); } + private final function finPrivSubGetArray() : Array { return getPubArray(); } + + // function to test above from test scripts + public function testPrivFinSubArray( a:Array ) : Array { + this.finPrivSubSetArray( a ); + return this.finPrivSubGetArray(); + } + + + // access public method of parent from private static method of sub class + // This is an error case as a static method cannot access any other + // method except a static method and will be addressed in a seperate + // file in the Error folder. + private static function privStatSubSetArray( a:Array ) { setPubArray( a ); } + static private function privStatSubGetArray() : Array { return getPubArray(); } + + // function to test above from test scripts + public function testPrivStatSubArray( a:Array ) : Array { + this.privStatSubSetArray( a ); + return this.privStatSubGetArray(); + } + + + // access public method of parent from private virtual method of sub class + private virtual function privVirSubSetArray( a:Array ) { setPubArray( a ); } + virtual private function privVirSubGetArray() : Array { return getPubArray(); } + + // function to test above from test scripts + public function testPrivVirSubArray( a:Array ) : Array { + this.privVirSubSetArray( a ); + return this.privVirSubGetArray(); + } + + + + // access public method of parent from virtual static method of sub class + // This is an invalid case as a function cannot be both virtual and static. + // This test case will be moved to the Error folder as a negative test case. + // virtual static function virStatSubSetArray( a:Array ) { setPubArray( a ); } + // static virtual function virStatSubGetArray() : Array { return getPubArray(); } + + + + // access default property from default method of sub class + function subSetDPArray( a:Array ) { pubArray = a; } + function subGetDPArray() : Array { return pubArray; } + + + // access default property from dynamic method of sub class. + function dynSubSetDPArray( a:Array ) { pubArray = a; } + function dynSubGetDPArray() : Array { return pubArray; } + + + // access default property from public method of sub class + public function pubSubSetDPArray( a:Array ) { pubArray = a; } + public function pubSubGetDPArray() : Array { return pubArray; } + + + // access default property from private method of sub class + private function privSubSetDPArray( a:Array ) { pubArray = a; } + private function privSubGetDPArray() : Array { return pubArray; } + + // public accessor for the above given private functions, + // so that these can be accessed from an object of the class + public function testPrivSubDPArray( a:Array ) : Array { + privSubSetDPArray( a ); + return privSubGetDPArray(); + } + + + // access default property from static method of sub class + static function statSubSetDPArray( a:Array ) { pubArray = a; } + static function statSubGetDPArray() : Array { return pubArray; } + + + // access default property from final method of sub class + final function finSubSetDPArray( a:Array ) { pubArray = a; } + final function finSubGetDPArray() : Array { return pubArray; } + + + // access default property from virtual method of sub class + virtual function virSubSetDPArray( a:Array ) { pubArray = a; } + virtual function virSubGetDPArray() : Array { return pubArray; } + + + // access default property from public static method of sub class + public static function pubStatSubSetDPArray( a:Array ) { pubArray = a; } + public static function pubStatSubGetDPArray() : Array { return pubArray; } + + + // access default property from private static method of sub class + private static function privStatSubSetDPArray( a:Array ) { pubArray = a; } + private static function privStatSubGetDPArray() : Array { return pubArray; } + + // public accessor for the above given private functions, + // so that these can be accessed from an object of the class + public function testPrivStatSubDPArray( a:Array ) : Array { + privStatSubSetDPArray( a ); + return privStatSubGetDPArray(); + } + + } + + + + // Create an instance of the final class in the package. + // This object will be used for accessing the methods created + // within the sub class given above. + var EXTDCLASS = new FinExtDefaultClassPub(); + + // Create a series of public functions that call the methods. + // The same names can be used as used in the class; because we are now + // outside of the class definition. + + // The default method of the sub class. + public function subSetArray( a:Array ) { EXTDCLASS.subSetArray( a ); } + public function subGetArray() : Array { return EXTDCLASS.subGetArray(); } + + + // The dynamic method of the sub class. + public function dynSubSetArray( a:Array ) { EXTDCLASS.dynSubSetArray( a ); } + public function dynSubGetArray() : Array { return EXTDCLASS.dynSubGetArray(); } + + + // The public method of the sub class. + public function pubSubSetArray( a:Array ) { EXTDCLASS.pubSubSetArray( a ); } + public function pubSubGetArray() : Array { return EXTDCLASS.pubSubGetArray(); } + + + // The private method of the sub class. Only one is used as we need to call only the + // test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivSubArray( a:Array ) : Array { return EXTDCLASS.testPrivSubArray( a ); } + + + // The static method of the sub class. + // This case is a negative case and will be put in the Error folder. + // public function statSubSetArray( a:Array ) { FinClassExtDefaultClass.statSubSetArray( a ); } + // public function statSubGetArray() : Array { return FinClassExtDefaultClass.statSubGetArray(); } + + // The STATIC class cannot be accessed by an object of the class, but has to be accessed + // by the class name itself. Bug filed for this: 108206 + // public function statSubSetArray( a:Array ) { EXTDCLASS.statSubSetArray( a ); } + // public function statSubGetArray() : Array { return EXTDCLASS.statSubGetArray(); } + + + // The final method of the sub class. + public function finSubSetArray( a : Array ) { EXTDCLASS.finSubSetArray( a ); } + public function finSubGetArray() : Array { return EXTDCLASS.finSubGetArray(); } + + + // The virtual method of the sub class. + public function virSubSetArray( a : Array ) { EXTDCLASS.virSubSetArray( a ); } + public function virSubGetArray() : Array { return EXTDCLASS.virSubGetArray(); } + + + + // The public dynamic method of the sub class. + public function pubDynSubSetArray( a:Array ) { EXTDCLASS.dynSubSetArray( a ); } + public function pubDynSubGetArray() : Array { return EXTDCLASS.pubDynSubGetArray(); } + + + // The public final method of the sub class. + public function pubFinSubSetArray( a : Array ) { EXTDCLASS.pubFinSubSetArray( a ); } + public function pubFinSubGetArray() : Array { return EXTDCLASS.pubFinSubGetArray(); } + + + // The public virtual method of the sub class. + public function pubVirSubSetArray( a : Array ) { EXTDCLASS.pubVirSubSetArray( a ); } + public function pubVirSubGetArray() : Array { return EXTDCLASS.pubVirSubGetArray(); } + + + + // The dynamic private method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivDynSubArray( a:Array ) : Array { return EXTDCLASS.testPrivDynSubArray( a ); } + + + // The dynamic final method of the sub class. + public function dynFinSubSetArray( a : Array ) { EXTDCLASS.dynFinSubSetArray( a ); } + public function dynFinSubGetArray() : Array { return EXTDCLASS.dynFinSubGetArray(); } + + + // The dynamic virtual method of the sub class. + public function dynVirSubSetArray( a : Array ) { EXTDCLASS.dynVirSubSetArray( a ); } + public function dynVirSubGetArray() : Array { return EXTDCLASS.dynVirSubGetArray(); } + + + + // The final private method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivFinSubArray( a:Array ) : Array { return EXTDCLASS.testPrivFinSubArray( a ); } + + + + // The private static method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + // This case is a negative case and will be put in the Error folder. + public function testPrivStatSubArray( a:Array ) : Array { return EXTDCLASS.testPrivStatSubArray( a ); } + + + + // The private virtual method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivVirSubArray( a:Array ) : Array { return EXTDCLASS.testPrivVirSubArray( a ); } + + + // The default property being accessed by the different method attributes. + // The default method attribute. + public function subSetDPArray( a:Array ) { EXTDCLASS.subSetDPArray(a); } + public function subGetDPArray() : Array { return EXTDCLASS.subGetDPArray(); } + + + // The dynamic method attribute. + public function dynSubSetDPArray( a:Array ) { EXTDCLASS.dynSubSetDPArray(a); } + public function dynSubGetDPArray() : Array { return EXTDCLASS.dynSubGetDPArray(); } + + + // The public method attribute. + public function pubSubSetDPArray( a:Array ) { EXTDCLASS.pubSubSetDPArray(a); } + public function pubSubGetDPArray() : Array { return EXTDCLASS.pubSubGetDPArray(); } + + + // The private method attribute. + public function testPrivSubDPArray( a:Array ):Array { return EXTDCLASS.testPrivSubDPArray(a) } + + // the static method attribute. + public function statSubSetDPArray( a:Array ) { FinExtDefaultClassPub.statSubSetDPArray(a); } + public function statSubGetDPArray() : Array { return FinExtDefaultClassPub.statSubGetDPArray(); } + + + // the final method attribute. + public function finSubSetDPArray( a:Array ) { EXTDCLASS.finSubSetDPArray(a); } + public function finSubGetDPArray() : Array { return EXTDCLASS.finSubGetDPArray(); } + + + // the virtual method attribute. + public function virSubSetDPArray( a:Array ) { EXTDCLASS.virSubSetDPArray(a); } + public function virSubGetDPArray() : Array { return EXTDCLASS.virSubGetDPArray(); } + + + // the public static method attrbute. + public function pubStatSubSetDPArray( a:Array ) { FinExtDefaultClassPub.pubStatSubSetDPArray(a); } + public function pubStatSubGetDPArray() : Array { return FinExtDefaultClassPub.pubStatSubGetDPArray(); } + + + // the private static method attribute + public function testPrivStatSubDPArray( a:Array ) : Array { return EXTDCLASS.testPrivStatSubDPArray(a); } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDefaultClassPubStat.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDefaultClassPubStat.as new file mode 100644 index 00000000000..fe346505965 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDefaultClassPubStat.as @@ -0,0 +1,186 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import DefaultClass.*; + + + +var SECTION = "Definitions\Ext"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Final Class Extends Default Class Public Static Methods"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +// Can't create an instance because it's not public +// Hence commenting out the lines where the class is initialized. +// var EXTDCLASS = new FinExtDefaultClassPub(); + + +// Create an array variable which will define the test array to be used +// for the given output. +var arr = new Array(1, 2, 3); + + +// access default method from a default method of a sub class +AddTestCase( "*** Access default method from default method of sub class ***", 1, 1 ); +AddTestCase( "subSetArray( arr ), subGetArray()", arr, ( subSetArray( arr ), subGetArray() ) ); + + +// access default method from a dynamic method of a sub class +AddTestCase( "*** Acess default method from dynamic method of sub class ***", 1, 1 ); +AddTestCase( "dynSubSetArray( arr ), dynSubGetArray()", arr, ( dynSubSetArray( arr ), dynSubGetArray()) ); + + +// access default method from a public method of a sub class +AddTestCase( "*** Access default method from public method of sub class ***", 1, 1 ); +AddTestCase( "pubSubSetArray( arr ), pubSubGetArray()", arr, ( pubSubSetArray( arr ), pubSubGetArray()) ); + + +// access default method from a private method of a sub class +AddTestCase( "*** Access default method from private method of sub class ***", 1, 1 ); +AddTestCase( "testPrivSubArray( arr )", arr, testPrivSubArray( arr ) ); + + +// access default method from a static method of a sub class +AddTestCase( "*** Access default method from static method of sub class ***", 1, 1 ); +AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 ); +// AddTestCase( "statSubSetArray( arr ), statSubGetArray()", arr, ( statSubSetArray( arr ), statSubGetArray() ) ); + + +// access default method from a final method of a sub class +AddTestCase( "*** Access default method from final method of sub class ***", 1, 1 ); +AddTestCase( "finSubSetArray( arr ), finSubGetArray()", arr, ( finSubSetArray( arr ), finSubGetArray() ) ); + + +// access default method from a virtual method of a sub class +AddTestCase( "*** Access default method from virtual method of sub class ***", 1, 1 ); +AddTestCase( "virSubSetArray( arr ), virSubSetArray()", arr, ( virSubSetArray( arr ), virSubGetArray() ) ); + + +// access default method from a public dynamic method of a sub class +AddTestCase( "*** Acess default method from public dynamic method of sub class ***", 1, 1 ); +AddTestCase( "pubDynSubSetArray( arr ), pubDynSubGetArray()", arr, ( pubDynSubSetArray( arr ), pubDynSubGetArray()) ); + + +// access default method from a public static method of a sub class +AddTestCase( "*** Access default method from public static method of sub class ***", 1, 1 ); +AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 ); +// AddTestCase( "pubStatSubSetArray( arr ), pubStatSubGetArray()", arr, ( pubStatSubSetArray( arr ), pubStatSubGetArray() ) ); + + +// access default method from a public final method of a sub class +AddTestCase( "*** Access default method from public final method of sub class ***", 1, 1 ); +AddTestCase( "pubFinSubSetArray( arr ), pubFinSubGetArray()", arr, ( pubFinSubSetArray( arr ), pubFinSubGetArray() ) ); + + +// access default method from a public virtual method of a sub class +AddTestCase( "*** Access default method from public virtual method of sub class ***", 1, 1 ); +AddTestCase( "pubVirSubSetArray( arr ), pubVirSubSetArray()", arr, ( pubVirSubSetArray( arr ), pubVirSubGetArray() ) ); + + +// access default method from a final private method of a sub class +AddTestCase( "*** Access default method from final private method of sub class ***", 1, 1 ); +AddTestCase( "testPrivFinSubArray( arr )", arr, testPrivFinSubArray( arr ) ); + + +// access default method from a final static method of a sub class +AddTestCase( "*** Access default method from final static method of sub class ***", 1, 1 ); +AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 ); +// AddTestCase( "finStatSubSetArray( arr ), finStatSubGetArray()", arr, ( finStatSubSetArray( arr ), finStatSubGetArray() ) ); + + +// access default method from a private static method of a sub class +AddTestCase( "*** Access default method from private static method of sub class ***", 1, 1 ); +AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 ); +// AddTestCase( "testPrivStatSubArray( arr )", arr, testPrivStatSubArray( arr ) ); + + +// access default method from a private virtual method of a sub class +AddTestCase( "*** Access default method from private virtual method of sub class ***", 1, 1 ); +AddTestCase( "testPrivVirSubArray( arr )", arr, testPrivVirSubArray( arr ) ); + + + +// access public static property from outside the class +AddTestCase( "*** Access default property from outside the class ***", 1, 1 ); +AddTestCase( "array = arr", arr, (array = arr, array) ); + + +// access public static property from a default method of a sub class +AddTestCase( "*** Access default property from default method of sub class ***", 1, 1 ); +AddTestCase( "subSetDPArray( arr ), subGetDPArray()", arr, ( subSetDPArray( arr ), subGetDPArray() ) ); + + +// access public static property from a dynamic method of a sub class +AddTestCase( "*** Access default property from dynamic method of sub class ***", 1, 1 ); +AddTestCase( "dynSubSetDPArray( arr ), dynSubGetDPArray()", arr, ( dynSubSetDPArray( arr ), dynSubGetDPArray() ) ); + + +// access public static property from a public method of a sub class +AddTestCase( "*** Access default property from public method of sub class ***", 1, 1 ); +AddTestCase( "pubSubSetDPArray( arr ), pubSubGetDPArray()", arr, ( pubSubSetDPArray( arr ), pubSubGetDPArray() ) ); + + +// access public static property from a private method of a sub class +AddTestCase( "*** Access default property from private method of sub class ***", 1, 1 ); +AddTestCase( "testPrivSubDPArray( arr )", arr, testPrivSubDPArray( arr ) ); + + +// access public static property from a static method of a sub class +AddTestCase( "*** Access default property from static method of sub class ***", 1, 1 ); +AddTestCase( "statSubSetDPArray( arr ), statSubGetDPArray()", arr, ( statSubSetDPArray( arr ), statSubGetDPArray() ) ); + + +// access public static property from a final method of a sub class +AddTestCase( "*** Access default property from final method of sub class ***", 1, 1 ); +AddTestCase( "finSubSetDPArray( arr ), finSubGetDPArray()", arr, ( finSubSetDPArray( arr ), finSubGetDPArray() ) ); + + +// access public static property from a private virtual method of a sub class +AddTestCase( "*** Access default property from private virtual method of sub class ***", 1, 1 ); +AddTestCase( "virSubSetDPArray( arr ), virSubGetDPArray()", arr, ( virSubSetDPArray( arr ), virSubGetDPArray() ) ); + + +// access public static property from a public static method of a sub class +AddTestCase( "*** Access default property from public static method of sub class ***", 1, 1 ); +AddTestCase( "pubStatSubSetDPArray( arr ), pubStatSubGetDPArray()", arr, ( pubStatSubSetDPArray( arr ), pubStatSubGetDPArray() ) ); + + +// access public static property from a private static method of a sub class +AddTestCase( "*** Access default property from private static method of sub class ***", 1, 1 ); +AddTestCase( "testPrivStatSubDPArray( arr )", arr, testPrivStatSubDPArray( arr ) ); + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDefaultClassPubStat/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDefaultClassPubStat/DefaultClass.as new file mode 100644 index 00000000000..2b3618393b9 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDefaultClassPubStat/DefaultClass.as @@ -0,0 +1,264 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DefaultClass { + + class DefaultClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + //public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + } + + public class DefaultClass extends DefaultClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDefaultClassPubStat/FinExtDefaultClassPubStat.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDefaultClassPubStat/FinExtDefaultClassPubStat.as new file mode 100644 index 00000000000..4a96aa1327a --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDefaultClassPubStat/FinExtDefaultClassPubStat.as @@ -0,0 +1,404 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +// The package definition has been changed, and now all the packages will be under the +// folder Definitions.Classes, and only this will be used and not the subfolders within. +// This means that we cannot import a single Class file as was required to be done earlier. +// All the files in the package folder will be compiled and used. + +// IMPORTANT: This might change later, hence only commenting out the import lines +// and not deleting them. This also creates a problem that the compiled file +// might become too big to handle. +package DefaultClass { + + import DefaultClass.*; + + // Commenting out the import statement as this is not allowed by the compiler now + // import Definitions.Classes.DefaultClass; + + // As this is a final class, it will not be seen by the testcase, hence + // creating a wrapper function for this and changing the name for this file. + // FinExtDefaultClassPubStat extends FinExtDefaultClassPubStatInner + + final class FinExtDefaultClassPubStat extends DefaultClass { + + // access public static method of parent from default method of sub class + function subSetArray( a:Array ) { setPubStatArray( a ); } + function subGetArray() : Array { return getPubStatArray(); } + + + // access public static method of parent from dynamic method of sub class + function dynSubSetArray( a:Array ) { setPubStatArray( a ); } + function dynSubGetArray() : Array { return getPubStatArray(); } + + + // access public static method of parent from public method of sub class + public function pubSubSetArray( a:Array ) { setPubStatArray( a ); } + public function pubSubGetArray() : Array { return getPubStatArray(); } + + + // access public static method of parent from static method of sub class + static function statSubSetArray( a:Array ) { setPubStatArray( a ); } + static function statSubGetArray() : Array { return getPubStatArray(); } + + + // access public static method of parent from final method of sub class + final function finSubSetArray( a:Array ) { setPubStatArray( a ); } + final function finSubGetArray() : Array { return getPubStatArray(); } + + + // access public static method of parent from virtual method of sub class + virtual function virSubSetArray( a:Array ) { setPubStatArray( a ); } + virtual function virSubGetArray() : Array { return getPubStatArray(); } + + + // access public static method of parent from private method of sub class + private function privSubSetArray( a:Array ) { setPubStatArray( a ); } + private function privSubGetArray() : Array { return getPubStatArray(); } + + // function to test above using a public function within the class + // this function will be accessible to an object of the class. + public function testPrivSubArray( a:Array ) : Array { + this.privSubSetArray( a ); + return this.privSubGetArray(); + } + + + + // access public static method of parent from public dynamic method of sub class + public function pubDynSubSetArray( a:Array ) { setPubStatArray( a ); } + public function pubDynSubGetArray() : Array { return getPubStatArray(); } + + + // access public static method of parent from public static method of sub class + public static function pubStatSubSetArray( a:Array ) { setPubStatArray( a ); } + public static function pubStatSubGetArray() : Array { return getPubStatArray(); } + + + // access public static method of parent from public final method of sub class + public final function pubFinSubSetArray( a:Array ) { setPubStatArray( a ); } + final public function pubFinSubGetArray() : Array { return getPubStatArray(); } + + + // access public static method of parent from public virtual method of sub class + public virtual function pubVirSubSetArray( a:Array ) { setPubStatArray( a ); } + virtual public function pubVirSubGetArray() : Array { return getPubStatArray(); } + + + // access public static method of parent from dynamic static method of sub class + static function dynStatSubSetArray( a:Array ) { setPubStatArray( a ); } + static function dynStatSubGetArray() : Array { return getPubStatArray(); } + + + // access public static method of parent from dynamic final method of sub class + final function dynFinSubSetArray( a:Array ) { setPubStatArray( a ); } + final function dynFinSubGetArray() : Array { return getPubStatArray(); } + + + // access public static method of parent from dynamic virtual method of sub class + virtual function dynVirSubSetArray( a:Array ) { setPubStatArray( a ); } + virtual function dynVirSubGetArray() : Array { return getPubStatArray(); } + + + // access public static method of parent from dynamic private method of sub class + private function dynPrivSubSetArray( a:Array ) { setPubStatArray( a ); } + private function dynPrivSubGetArray() : Array { return getPubStatArray(); } + + // function to test above from test scripts + public function testPrivDynSubArray( a:Array ) : Array { + this.dynPrivSubSetArray( a ); + return this.dynPrivSubGetArray(); + } + + + // access public static method of parent from final static method of sub class + static function finStatSubSetArray( a:Array ) { setPubStatArray( a ); } + static function finStatSubGetArray() : Array { return getPubStatArray(); } + + + // access public static method of parent from final virtual method of sub class + // This is an invalid case and compiler should report that a function cannot + // be both final and virtual. + // This case will be moved to the negative test cases - Error folder. + // final virtual function finVirSubSetArray( a:Array ) { setPubStatArray( a ); } + // virtual final function finVirSubGetArray() : Array { return getPubStatArray(); } + + + // access public static method of parent from final private method of sub class + final private function finPrivSubSetArray( a:Array ) { setPubStatArray( a ); } + private final function finPrivSubGetArray() : Array { return getPubStatArray(); } + + // function to test above from test scripts + public function testPrivFinSubArray( a:Array ) : Array { + this.finPrivSubSetArray( a ); + return this.finPrivSubGetArray(); + } + + + // access public static method of parent from private static method of sub class + private static function privStatSubSetArray( a:Array ) { setPubStatArray( a ); } + static private function privStatSubGetArray() : Array { return getPubStatArray(); } + + // function to test above from test scripts + public function testPrivStatSubArray( a:Array ) : Array { + this.privStatSubSetArray( a ); + return this.privStatSubGetArray(); + } + + + // access public static method of parent from private virtual method of sub class + private virtual function privVirSubSetArray( a:Array ) { setPubStatArray( a ); } + virtual private function privVirSubGetArray() : Array { return getPubStatArray(); } + + // function to test above from test scripts + public function testPrivVirSubArray( a:Array ) : Array { + this.privVirSubSetArray( a ); + return this.privVirSubGetArray(); + } + + + + // access public static method of parent from virtual static method of sub class + // This is an invalid case as a function cannot be both virtual and static. + // This test case will be moved to the Error folder as a negative test case. + // virtual static function virStatSubSetArray( a:Array ) { setPubStatArray( a ); } + // static virtual function virStatSubGetArray() : Array { return getPubStatArray(); } + + + + // access public static property from default method of sub class + function subSetDPArray( a:Array ) { pubStatArray = a; } + function subGetDPArray() : Array { return pubStatArray; } + + + // access public static property from dynamic method of sub class. + function dynSubSetDPArray( a:Array ) { pubStatArray = a; } + function dynSubGetDPArray() : Array { return pubStatArray; } + + + // access public static property from public method of sub class + public function pubSubSetDPArray( a:Array ) { pubStatArray = a; } + public function pubSubGetDPArray() : Array { return pubStatArray; } + + + // access public static property from private method of sub class + private function privSubSetDPArray( a:Array ) { pubStatArray = a; } + private function privSubGetDPArray() : Array { return pubStatArray; } + + // public accessor for the above given private functions, + // so that these can be accessed from an object of the class + public function testPrivSubDPArray( a:Array ) : Array { + privSubSetDPArray( a ); + return privSubGetDPArray(); + } + + + // access public static property from static method of sub class + static function statSubSetDPArray( a:Array ) { pubStatArray = a; } + static function statSubGetDPArray() : Array { return pubStatArray; } + + + // access public static property from final method of sub class + final function finSubSetDPArray( a:Array ) { pubStatArray = a; } + final function finSubGetDPArray() : Array { return pubStatArray; } + + + // access public static property from virtual method of sub class + virtual function virSubSetDPArray( a:Array ) { pubStatArray = a; } + virtual function virSubGetDPArray() : Array { return pubStatArray; } + + + // access public static property from public static method of sub class + public static function pubStatSubSetDPArray( a:Array ) { pubStatArray = a; } + public static function pubStatSubGetDPArray() : Array { return pubStatArray; } + + + // access public static property from private static method of sub class + private static function privStatSubSetDPArray( a:Array ) { pubStatArray = a; } + private static function privStatSubGetDPArray() : Array { return pubStatArray; } + + // public accessor for the above given private functions, + // so that these can be accessed from an object of the class + public function testPrivStatSubDPArray( a:Array ) : Array { + privStatSubSetDPArray( a ); + return privStatSubGetDPArray(); + } + } + + // Create an instance of the final class in the package. + // This object will be used for accessing the methods created + // within the sub class given above. + var EXTDCLASS = new FinExtDefaultClassPubStat(); + + // Create a series of public functions that call the methods. + // The same names can be used as used in the class; because we are now + // outside of the class definition. + + // The default method of the sub class. + public function subSetArray( a:Array ) { EXTDCLASS.subSetArray( a ); } + public function subGetArray() : Array { return EXTDCLASS.subGetArray(); } + + + // The dynamic method of the sub class. + public function dynSubSetArray( a:Array ) { EXTDCLASS.dynSubSetArray( a ); } + public function dynSubGetArray() : Array { return EXTDCLASS.dynSubGetArray(); } + + + // The public method of the sub class. + public function pubSubSetArray( a:Array ) { EXTDCLASS.pubSubSetArray( a ); } + public function pubSubGetArray() : Array { return EXTDCLASS.pubSubGetArray(); } + + + // The private method of the sub class. Only one is used as we need to call only the + // test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivSubArray( a:Array ) : Array { return EXTDCLASS.testPrivSubArray( a ); } + + + // The static method of the sub class. + public function statSubSetArray( a:Array ) { FinClassExtDefaultClass.statSubSetArray( a ); } + public function statSubGetArray() : Array { return FinClassExtDefaultClass.statSubGetArray(); } + + // The STATIC class cannot be accessed by an object of the class, but has to be accessed + // by the class name itself. Bug filed for this: 108206 + // public function statSubSetArray( a:Array ) { EXTDCLASS.statSubSetArray( a ); } + // public function statSubGetArray() : Array { return EXTDCLASS.statSubGetArray(); } + + + // The final method of the sub class. + public function finSubSetArray( a : Array ) { EXTDCLASS.finSubSetArray( a ); } + public function finSubGetArray() : Array { return EXTDCLASS.finSubGetArray(); } + + + // The virtual method of the sub class. + public function virSubSetArray( a : Array ) { EXTDCLASS.virSubSetArray( a ); } + public function virSubGetArray() : Array { return EXTDCLASS.virSubGetArray(); } + + + + // The public dynamic method of the sub class. + public function pubDynSubSetArray( a:Array ) { EXTDCLASS.dynSubSetArray( a ); } + public function pubDynSubGetArray() : Array { return EXTDCLASS.pubDynSubGetArray(); } + + + // The public final method of the sub class. + public function pubFinSubSetArray( a : Array ) { EXTDCLASS.pubFinSubSetArray( a ); } + public function pubFinSubGetArray() : Array { return EXTDCLASS.pubFinSubGetArray(); } + + + // The public virtual method of the sub class. + public function pubVirSubSetArray( a : Array ) { EXTDCLASS.pubVirSubSetArray( a ); } + public function pubVirSubGetArray() : Array { return EXTDCLASS.pubVirSubGetArray(); } + + + + // The dynamic private method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivDynSubArray( a:Array ) : Array { return EXTDCLASS.testPrivDynSubArray( a ); } + + + // The dynamic final method of the sub class. + public function dynFinSubSetArray( a : Array ) { EXTDCLASS.dynFinSubSetArray( a ); } + public function dynFinSubGetArray() : Array { return EXTDCLASS.dynFinSubGetArray(); } + + + // The dynamic virtual method of the sub class. + public function dynVirSubSetArray( a : Array ) { EXTDCLASS.dynVirSubSetArray( a ); } + public function dynVirSubGetArray() : Array { return EXTDCLASS.dynVirSubGetArray(); } + + + + // The final private method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivFinSubArray( a:Array ) : Array { return EXTDCLASS.testPrivFinSubArray( a ); } + + + + // The private static method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + // This case is a negative case and will be put in the Error folder. + public function testPrivStatSubArray( a:Array ) : Array { return EXTDCLASS.testPrivStatSubArray( a ); } + + + + // The private virtual method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivVirSubArray( a:Array ) : Array { return EXTDCLASS.testPrivVirSubArray( a ); } + + + // The default property being accessed by the different method attributes. + // The default method attribute. + public function subSetDPArray( a:Array ) { EXTDCLASS.subSetDPArray(a); } + public function subGetDPArray() : Array { return EXTDCLASS.subGetDPArray(); } + + + // The dynamic method attribute. + public function dynSubSetDPArray( a:Array ) { EXTDCLASS.dynSubSetDPArray(a); } + public function dynSubGetDPArray() : Array { return EXTDCLASS.dynSubGetDPArray(); } + + + // The public method attribute. + public function pubSubSetDPArray( a:Array ) { EXTDCLASS.pubSubSetDPArray(a); } + public function pubSubGetDPArray() : Array { return EXTDCLASS.pubSubGetDPArray(); } + + + // The private method attribute. + public function testPrivSubDPArray( a:Array ):Array { return EXTDCLASS.testPrivSubDPArray(a) } + + // the static method attribute. + public function statSubSetDPArray( a:Array ) { FinExtDefaultClassPubStat.statSubSetDPArray(a); } + public function statSubGetDPArray() : Array { return FinExtDefaultClassPubStat.statSubGetDPArray(); } + + + // the final method attribute. + public function finSubSetDPArray( a:Array ) { EXTDCLASS.finSubSetDPArray(a); } + public function finSubGetDPArray() : Array { return EXTDCLASS.finSubGetDPArray(); } + + + // the virtual method attribute. + public function virSubSetDPArray( a:Array ) { EXTDCLASS.virSubSetDPArray(a); } + public function virSubGetDPArray() : Array { return EXTDCLASS.virSubGetDPArray(); } + + + // the public static method attrbute. + public function pubStatSubSetDPArray( a:Array ) { FinExtDefaultClassPubStat.pubStatSubSetDPArray(a); } + public function pubStatSubGetDPArray() : Array { return FinExtDefaultClassPubStat.pubStatSubGetDPArray(); } + + + // the private static method attribute + public function testPrivStatSubDPArray( a:Array ) : Array { return EXTDCLASS.testPrivStatSubDPArray(a); } + + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDefaultClassStat.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDefaultClassStat.as new file mode 100644 index 00000000000..14962f8ed40 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDefaultClassStat.as @@ -0,0 +1,187 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import DefaultClass.*; + + + +var SECTION = "Definitions\Ext"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Final Class Extends Default Class Static Methods"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +// Can't create an instance because it's not public +// Hence commenting out the lines where the class is initialized. +// var EXTDCLASS = new FinExtDefaultClassPub(); + + +// Create an array variable which will define the test array to be used +// for the given output. +var arr = new Array(1, 2, 3); + + +// access default method from a default method of a sub class +AddTestCase( "*** Access default method from default method of sub class ***", 1, 1 ); +AddTestCase( "subSetArray( arr ), subGetArray()", arr, ( subSetArray( arr ), subGetArray() ) ); + + +// access default method from a dynamic method of a sub class +AddTestCase( "*** Acess default method from dynamic method of sub class ***", 1, 1 ); +AddTestCase( "dynSubSetArray( arr ), dynSubGetArray()", arr, ( dynSubSetArray( arr ), dynSubGetArray()) ); + + +// access default method from a public method of a sub class +AddTestCase( "*** Access default method from public method of sub class ***", 1, 1 ); +AddTestCase( "pubSubSetArray( arr ), pubSubGetArray()", arr, ( pubSubSetArray( arr ), pubSubGetArray()) ); + + +// access default method from a private method of a sub class +AddTestCase( "*** Access default method from private method of sub class ***", 1, 1 ); +AddTestCase( "testPrivSubArray( arr )", arr, testPrivSubArray( arr ) ); + + +// access default method from a static method of a sub class +AddTestCase( "*** Access default method from static method of sub class ***", 1, 1 ); +AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 ); +// AddTestCase( "statSubSetArray( arr ), statSubGetArray()", arr, ( statSubSetArray( arr ), statSubGetArray() ) ); + + +// access default method from a final method of a sub class +AddTestCase( "*** Access default method from final method of sub class ***", 1, 1 ); +AddTestCase( "finSubSetArray( arr ), finSubGetArray()", arr, ( finSubSetArray( arr ), finSubGetArray() ) ); + + +// access default method from a virtual method of a sub class +AddTestCase( "*** Access default method from virtual method of sub class ***", 1, 1 ); +AddTestCase( "virSubSetArray( arr ), virSubSetArray()", arr, ( virSubSetArray( arr ), virSubGetArray() ) ); + + +// access default method from a public dynamic method of a sub class +AddTestCase( "*** Acess default method from public dynamic method of sub class ***", 1, 1 ); +AddTestCase( "pubDynSubSetArray( arr ), pubDynSubGetArray()", arr, ( pubDynSubSetArray( arr ), pubDynSubGetArray()) ); + + +// access default method from a public static method of a sub class +AddTestCase( "*** Access default method from public static method of sub class ***", 1, 1 ); +AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 ); +// AddTestCase( "pubStatSubSetArray( arr ), pubStatSubGetArray()", arr, ( pubStatSubSetArray( arr ), pubStatSubGetArray() ) ); + + +// access default method from a public final method of a sub class +AddTestCase( "*** Access default method from public final method of sub class ***", 1, 1 ); +AddTestCase( "pubFinSubSetArray( arr ), pubFinSubGetArray()", arr, ( pubFinSubSetArray( arr ), pubFinSubGetArray() ) ); + + +// access default method from a public virtual method of a sub class +AddTestCase( "*** Access default method from public virtual method of sub class ***", 1, 1 ); +AddTestCase( "pubVirSubSetArray( arr ), pubVirSubSetArray()", arr, ( pubVirSubSetArray( arr ), pubVirSubGetArray() ) ); + + +// access default method from a final private method of a sub class +AddTestCase( "*** Access default method from final private method of sub class ***", 1, 1 ); +AddTestCase( "testPrivFinSubArray( arr )", arr, testPrivFinSubArray( arr ) ); + + +// access default method from a final static method of a sub class +AddTestCase( "*** Access default method from final static method of sub class ***", 1, 1 ); +AddTestCase( "finStatSubSetArray( arr ), finStatSubGetArray()", arr, ( finStatSubSetArray( arr ), finStatSubGetArray() ) ); + + +// access default method from a private static method of a sub class +AddTestCase( "*** Access default method from private static method of sub class ***", 1, 1 ); +AddTestCase( "*** Cannot Access a private static method, giving: Call attempted on an object that is not a function. ***", 1, 1 ); +// AddTestCase( "testPrivStatSubArray( arr )", arr, testPrivStatSubArray( arr ) ); + + +// access default method from a private virtual method of a sub class +AddTestCase( "*** Access default method from private virtual method of sub class ***", 1, 1 ); +AddTestCase( "testPrivVirSubArray( arr )", arr, testPrivVirSubArray( arr ) ); + + + +// fill in the rest of the cases here + +// access static property from outside the class +AddTestCase( "*** Access default property from outside the class ***", 1, 1 ); +AddTestCase( "array = arr", arr, (array = arr, array) ); + + +// access static property from a default method of a sub class +AddTestCase( "*** Access default property from default method of sub class ***", 1, 1 ); +AddTestCase( "subSetDPArray( arr ), subGetDPArray()", arr, ( subSetDPArray( arr ), subGetDPArray() ) ); + + +// access static property from a dynamic method of a sub class +AddTestCase( "*** Access default property from dynamic method of sub class ***", 1, 1 ); +AddTestCase( "dynSubSetDPArray( arr ), dynSubGetDPArray()", arr, ( dynSubSetDPArray( arr ), dynSubGetDPArray() ) ); + + +// access static property from a public method of a sub class +AddTestCase( "*** Access default property from public method of sub class ***", 1, 1 ); +AddTestCase( "pubSubSetDPArray( arr ), pubSubGetDPArray()", arr, ( pubSubSetDPArray( arr ), pubSubGetDPArray() ) ); + + +// access static property from a private method of a sub class +AddTestCase( "*** Access default property from private method of sub class ***", 1, 1 ); +AddTestCase( "testPrivSubDPArray( arr )", arr, testPrivSubDPArray( arr ) ); + + +// access static property from a static method of a sub class +AddTestCase( "*** Access default property from static method of sub class ***", 1, 1 ); +AddTestCase( "statSubSetDPArray( arr ), statSubGetDPArray()", arr, ( statSubSetDPArray( arr ), statSubGetDPArray() ) ); + + +// access static property from a final method of a sub class +AddTestCase( "*** Access default property from final method of sub class ***", 1, 1 ); +AddTestCase( "finSubSetDPArray( arr ), finSubGetDPArray()", arr, ( finSubSetDPArray( arr ), finSubGetDPArray() ) ); + + +// access static property from a private virtual method of a sub class +AddTestCase( "*** Access default property from private virtual method of sub class ***", 1, 1 ); +AddTestCase( "virSubSetDPArray( arr ), virSubGetDPArray()", arr, ( virSubSetDPArray( arr ), virSubGetDPArray() ) ); + + +// access static property from a public static method of a sub class +AddTestCase( "*** Access default property from public static method of sub class ***", 1, 1 ); +AddTestCase( "pubStatSubSetDPArray( arr ), pubStatSubGetDPArray()", arr, ( pubStatSubSetDPArray( arr ), pubStatSubGetDPArray() ) ); + + +// access static property from a private static method of a sub class +AddTestCase( "*** Access default property from private static method of sub class ***", 1, 1 ); +AddTestCase( "testPrivStatSubDPArray( arr )", arr, testPrivStatSubDPArray( arr ) ); + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDefaultClassStat/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDefaultClassStat/DefaultClass.as new file mode 100644 index 00000000000..2b3618393b9 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDefaultClassStat/DefaultClass.as @@ -0,0 +1,264 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DefaultClass { + + class DefaultClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + //public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + } + + public class DefaultClass extends DefaultClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDefaultClassStat/FinExtDefaultClassStat.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDefaultClassStat/FinExtDefaultClassStat.as new file mode 100644 index 00000000000..40c338e2db8 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDefaultClassStat/FinExtDefaultClassStat.as @@ -0,0 +1,418 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +// The package definition has been changed, and now all the packages will be under the +// folder Definitions.Classes, and only this will be used and not the subfolders within. +// This means that we cannot import a single Class file as was required to be done earlier. +// All the files in the package folder will be compiled and used. + +// IMPORTANT: This might change later, hence only commenting out the import lines +// and not deleting them. This also creates a problem that the compiled file +// might become too big to handle. +package DefaultClass { + + import DefaultClass.*; + + // Commenting out the import statement as this is not allowed by the compiler now + // import Definitions.Classes.DefaultClass; + + // As this is a final class, it will not be seen by the testcase, hence + // creating a wrapper function for this and changing the name for this file. + // FinExtDefaultClassStat extends FinExtDefaultClassStatInner + + final class FinExtDefaultClassStat extends DefaultClass { + + // access static method of parent from default method of sub class + function subSetArray( a:Array ) { setStatArray( a ); } + function subGetArray() : Array { return getStatArray(); } + + + // access static method of parent from dynamic method of sub class + function dynSubSetArray( a:Array ) { setStatArray( a ); } + function dynSubGetArray() : Array { return getStatArray(); } + + + // access static method of parent from public method of sub class + public function pubSubSetArray( a:Array ) { setStatArray( a ); } + public function pubSubGetArray() : Array { return getStatArray(); } + + + // access static method of parent from static method of sub class + static function statSubSetArray( a:Array ) { setStatArray( a ); } + static function statSubGetArray() : Array { return getStatArray(); } + + + // access static method of parent from final method of sub class + final function finSubSetArray( a:Array ) { setStatArray( a ); } + final function finSubGetArray() : Array { return getStatArray(); } + + + // access static method of parent from virtual method of sub class + virtual function virSubSetArray( a:Array ) { setStatArray( a ); } + virtual function virSubGetArray() : Array { return getStatArray(); } + + + // access static method of parent from private method of sub class + private function privSubSetArray( a:Array ) { setStatArray( a ); } + private function privSubGetArray() : Array { return getStatArray(); } + + // function to test above using a public function within the class + // this function will be accessible to an object of the class. + public function testPrivSubArray( a:Array ) : Array { + this.privSubSetArray( a ); + return this.privSubGetArray(); + } + + + + // access static method of parent from public dynamic method of sub class + public function pubDynSubSetArray( a:Array ) { setStatArray( a ); } + public function pubDynSubGetArray() : Array { return getStatArray(); } + + + // access static method of parent from public static method of sub class + public static function pubStatSubSetArray( a:Array ) { setStatArray( a ); } + public static function pubStatSubGetArray() : Array { return getStatArray(); } + + + // access static method of parent from public final method of sub class + public final function pubFinSubSetArray( a:Array ) { setStatArray( a ); } + final public function pubFinSubGetArray() : Array { return getStatArray(); } + + + // access static method of parent from public virtual method of sub class + public virtual function pubVirSubSetArray( a:Array ) { setStatArray( a ); } + virtual public function pubVirSubGetArray() : Array { return getStatArray(); } + + + // access static method of parent from dynamic static method of sub class + static function dynStatSubSetArray( a:Array ) { setStatArray( a ); } + static function dynStatSubGetArray() : Array { return getStatArray(); } + + + // access static method of parent from dynamic final method of sub class + final function dynFinSubSetArray( a:Array ) { setStatArray( a ); } + final function dynFinSubGetArray() : Array { return getStatArray(); } + + + // access static method of parent from dynamic virtual method of sub class + virtual function dynVirSubSetArray( a:Array ) { setStatArray( a ); } + virtual function dynVirSubGetArray() : Array { return getStatArray(); } + + + // access static method of parent from dynamic private method of sub class + private function dynPrivSubSetArray( a:Array ) { setStatArray( a ); } + private function dynPrivSubGetArray() : Array { return getStatArray(); } + + // function to test above from test scripts + public function testPrivDynSubArray( a:Array ) : Array { + this.dynPrivSubSetArray( a ); + return this.dynPrivSubGetArray(); + } + + + // access static method of parent from final static method of sub class + static function finStatSubSetArray( a:Array ) { setStatArray( a ); } + static function finStatSubGetArray() : Array { return getStatArray(); } + + + // access static method of parent from final virtual method of sub class + // This is an invalid case and compiler should report that a function cannot + // be both final and virtual. + // This case will be moved to the negative test cases - Error folder. + // final virtual function finVirSubSetArray( a:Array ) { setStatArray( a ); } + // virtual final function finVirSubGetArray() : Array { return getStatArray(); } + + + // access static method of parent from final private method of sub class + final private function finPrivSubSetArray( a:Array ) { setStatArray( a ); } + private final function finPrivSubGetArray() : Array { return getStatArray(); } + + // function to test above from test scripts + public function testPrivFinSubArray( a:Array ) : Array { + this.finPrivSubSetArray( a ); + return this.finPrivSubGetArray(); + } + + + // access static method of parent from private static method of sub class + private static function privStatSubSetArray( a:Array ) { setStatArray( a ); } + static private function privStatSubGetArray() : Array { return getStatArray(); } + + // function to test above from test scripts + public function testPrivStatSubArray( a:Array ) : Array { + this.privStatSubSetArray( a ); + return this.privStatSubGetArray(); + } + + + // access static method of parent from private virtual method of sub class + private virtual function privVirSubSetArray( a:Array ) { setStatArray( a ); } + virtual private function privVirSubGetArray() : Array { return getStatArray(); } + + // function to test above from test scripts + public function testPrivVirSubArray( a:Array ) : Array { + this.privVirSubSetArray( a ); + return this.privVirSubGetArray(); + } + + + + // access static method of parent from virtual static method of sub class + // This is an invalid case as a function cannot be both virtual and static. + // This test case will be moved to the Error folder as a negative test case. + // virtual static function virStatSubSetArray( a:Array ) { setStatArray( a ); } + // static virtual function virStatSubGetArray() : Array { return getStatArray(); } + + + + + + // access static property from default method of sub class + function subSetDPArray( a:Array ) { statArray = a; } + function subGetDPArray() : Array { return statArray; } + + + // access static property from dynamic method of sub class. + function dynSubSetDPArray( a:Array ) { statArray = a; } + function dynSubGetDPArray() : Array { return statArray; } + + + // access static property from public method of sub class + public function pubSubSetDPArray( a:Array ) { statArray = a; } + public function pubSubGetDPArray() : Array { return statArray; } + + + // access static property from private method of sub class + private function privSubSetDPArray( a:Array ) { statArray = a; } + private function privSubGetDPArray() : Array { return statArray; } + + // public accessor for the above given private functions, + // so that these can be accessed from an object of the class + public function testPrivSubDPArray( a:Array ) : Array { + privSubSetDPArray( a ); + return privSubGetDPArray(); + } + + + // access static property from static method of sub class + static function statSubSetDPArray( a:Array ) { statArray = a; } + static function statSubGetDPArray() : Array { return statArray; } + + + // access static property from final method of sub class + final function finSubSetDPArray( a:Array ) { statArray = a; } + final function finSubGetDPArray() : Array { return statArray; } + + + // access static property from virtual method of sub class + virtual function virSubSetDPArray( a:Array ) { statArray = a; } + virtual function virSubGetDPArray() : Array { return statArray; } + + + // access static property from public static method of sub class + public static function pubStatSubSetDPArray( a:Array ) { statArray = a; } + public static function pubStatSubGetDPArray() : Array { return statArray; } + + + // access static property from private static method of sub class + private static function privStatSubSetDPArray( a:Array ) { statArray = a; } + private static function privStatSubGetDPArray() : Array { return statArray; } + + // public accessor for the above given private functions, + // so that these can be accessed from an object of the class + public function testPrivStatSubDPArray( a:Array ) : Array { + privStatSubSetDPArray( a ); + return privStatSubGetDPArray(); + } + + } + + + + // Create an instance of the final class in the package. + // This object will be used for accessing the methods created + // within the sub class given above. + var EXTDCLASS = new FinExtDefaultClassStat(); + + // Create a series of public functions that call the methods. + // The same names can be used as used in the class; because we are now + // outside of the class definition. + + // The default method of the sub class. + public function subSetArray( a:Array ) { EXTDCLASS.subSetArray( a ); } + public function subGetArray() : Array { return EXTDCLASS.subGetArray(); } + + + // The dynamic method of the sub class. + public function dynSubSetArray( a:Array ) { EXTDCLASS.dynSubSetArray( a ); } + public function dynSubGetArray() : Array { return EXTDCLASS.dynSubGetArray(); } + + + // The public method of the sub class. + public function pubSubSetArray( a:Array ) { EXTDCLASS.pubSubSetArray( a ); } + public function pubSubGetArray() : Array { return EXTDCLASS.pubSubGetArray(); } + + + // The private method of the sub class. Only one is used as we need to call only the + // test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivSubArray( a:Array ) : Array { return EXTDCLASS.testPrivSubArray( a ); } + + + // The static method of the sub class. + public function statSubSetArray( a:Array ) { FinClassExtDefaultClass.statSubSetArray( a ); } + public function statSubGetArray() : Array { return FinClassExtDefaultClass.statSubGetArray(); } + + // The STATIC class cannot be accessed by an object of the class, but has to be accessed + // by the class name itself. Bug filed for this: 108206 + // public function statSubSetArray( a:Array ) { EXTDCLASS.statSubSetArray( a ); } + // public function statSubGetArray() : Array { return EXTDCLASS.statSubGetArray(); } + + + // The final method of the sub class. + public function finSubSetArray( a : Array ) { EXTDCLASS.finSubSetArray( a ); } + public function finSubGetArray() : Array { return EXTDCLASS.finSubGetArray(); } + + + // The virtual method of the sub class. + public function virSubSetArray( a : Array ) { EXTDCLASS.virSubSetArray( a ); } + public function virSubGetArray() : Array { return EXTDCLASS.virSubGetArray(); } + + + + // The public dynamic method of the sub class. + public function pubDynSubSetArray( a:Array ) { EXTDCLASS.dynSubSetArray( a ); } + public function pubDynSubGetArray() : Array { return EXTDCLASS.pubDynSubGetArray(); } + + + // The public final method of the sub class. + public function pubFinSubSetArray( a : Array ) { EXTDCLASS.pubFinSubSetArray( a ); } + public function pubFinSubGetArray() : Array { return EXTDCLASS.pubFinSubGetArray(); } + + + // The public virtual method of the sub class. + public function pubVirSubSetArray( a : Array ) { EXTDCLASS.pubVirSubSetArray( a ); } + public function pubVirSubGetArray() : Array { return EXTDCLASS.pubVirSubGetArray(); } + + + + // The dynamic private method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivDynSubArray( a:Array ) : Array { return EXTDCLASS.testPrivDynSubArray( a ); } + + + // The dynamic final method of the sub class. + public function dynFinSubSetArray( a : Array ) { EXTDCLASS.dynFinSubSetArray( a ); } + public function dynFinSubGetArray() : Array { return EXTDCLASS.dynFinSubGetArray(); } + + + // The dynamic virtual method of the sub class. + public function dynVirSubSetArray( a : Array ) { EXTDCLASS.dynVirSubSetArray( a ); } + public function dynVirSubGetArray() : Array { return EXTDCLASS.dynVirSubGetArray(); } + + + + // The final private method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivFinSubArray( a:Array ) : Array { return EXTDCLASS.testPrivFinSubArray( a ); } + + + + // The private static method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + // This case is a negative case and will be put in the Error folder. + public function testPrivStatSubArray( a:Array ) : Array { return FinExtDefaultClassStat.testPrivStatSubArray( a ); } + + + // The final static method of the sub class. + public function finStatSubSetArray( a : Array ) { FinExtDefaultClassStat.finStatSubSetArray( a ); } + public function finStatSubGetArray() : Array { return FinExtDefaultClassStat.finStatSubGetArray(); } + + // The STATIC class cannot be accessed by an object of the class, but has to be accessed + // by the class name itself. Bug filed for this: 108206 + // public function finStatSubSetArray( a:Array ) { EXTDCLASS.finStatSubSetArray( a ); } + // public function finStatSubGetArray() : Array { return EXTDCLASS.finStatSubGetArray(); } + + + + // The private virtual method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivVirSubArray( a:Array ) : Array { return EXTDCLASS.testPrivVirSubArray( a ); } + + + // The default property being accessed by the different method attributes. + // The default method attribute. + public function subSetDPArray( a:Array ) { EXTDCLASS.subSetDPArray(a); } + public function subGetDPArray() : Array { return EXTDCLASS.subGetDPArray(); } + + + // The dynamic method attribute. + public function dynSubSetDPArray( a:Array ) { EXTDCLASS.dynSubSetDPArray(a); } + public function dynSubGetDPArray() : Array { return EXTDCLASS.dynSubGetDPArray(); } + + + // The public method attribute. + public function pubSubSetDPArray( a:Array ) { EXTDCLASS.pubSubSetDPArray(a); } + public function pubSubGetDPArray() : Array { return EXTDCLASS.pubSubGetDPArray(); } + + + // The private method attribute. + public function testPrivSubDPArray( a:Array ):Array { return EXTDCLASS.testPrivSubDPArray(a) } + + // the static method attribute. + public function statSubSetDPArray( a:Array ) { FinExtDefaultClassStat.statSubSetDPArray(a); } + public function statSubGetDPArray() : Array { return FinExtDefaultClassStat.statSubGetDPArray(); } + + + // the final method attribute. + public function finSubSetDPArray( a:Array ) { EXTDCLASS.finSubSetDPArray(a); } + public function finSubGetDPArray() : Array { return EXTDCLASS.finSubGetDPArray(); } + + + // the virtual method attribute. + public function virSubSetDPArray( a:Array ) { EXTDCLASS.virSubSetDPArray(a); } + public function virSubGetDPArray() : Array { return EXTDCLASS.virSubGetDPArray(); } + + + // the public static method attrbute. + public function pubStatSubSetDPArray( a:Array ) { FinExtDefaultClassStat.pubStatSubSetDPArray(a); } + public function pubStatSubGetDPArray() : Array { return FinExtDefaultClassStat.pubStatSubGetDPArray(); } + + + // the private static method attribute + public function testPrivStatSubDPArray( a:Array ) : Array { return EXTDCLASS.testPrivStatSubDPArray(a); } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDynamicClass.as new file mode 100644 index 00000000000..1f7cc051d1d --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDynamicClass.as @@ -0,0 +1,209 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DynamicClass{ + +import DynamicClass.*; + + + +var SECTION = "Definitions\Ext"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Final Class Extends Dynamic Class Default Methods"; // Provide ECMA section title or a description +//var BUGNUMBER = ""; + +startTest(); // leave this alone + + + + +// Can't create an instance because it's not public +// Hence commenting out the lines where the class is initialized. +// var EXTDCLASS = new FinExtDynamicClass(); + + +// Create an array variable which will define the test array to be used +// for the given output. +var arr = new Array(1, 2, 3); + + +// access default method from outside of the class +AddTestCase( "*** Access the default method from outside of the class ***", 1, 1 ); +//AddTestCase( "setArray(arr), getArray()", arr, ( setArray( arr ), getArray() ) ); + + +// access default method from a default method of a sub class +AddTestCase( "*** Access default method from default method of sub class ***", 1, 1 ); +AddTestCase( "subSetArray( arr ), subGetArray()", arr, ( subSetArray( arr ), subGetArray() ) ); + + +// access default method from a dynamic method of a sub class +AddTestCase( "*** Acess default method from dynamic method of sub class ***", 1, 1 ); +AddTestCase( "dynSubSetArray( arr ), dynSubGetArray()", arr, ( dynSubSetArray( arr ), dynSubGetArray()) ); + + +// access default method from a public method of a sub class +AddTestCase( "*** Access default method from public method of sub class ***", 1, 1 ); +AddTestCase( "pubSubSetArray( arr ), pubSubGetArray()", arr, ( pubSubSetArray( arr ), pubSubGetArray()) ); + + +// access default method from a private method of a sub class +AddTestCase( "*** Access default method from private method of sub class ***", 1, 1 ); +AddTestCase( "testPrivSubArray( arr )", arr, testPrivSubArray( arr ) ); + + +// access default method from a static method of a sub class +AddTestCase( "*** Access default method from static method of sub class ***", 1, 1 ); +AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 ); +// AddTestCase( "statSubSetArray( arr ), statSubGetArray()", arr, ( statSubSetArray( arr ), statSubGetArray() ) ); + + +// access default method from a final method of a sub class +AddTestCase( "*** Access default method from final method of sub class ***", 1, 1 ); +AddTestCase( "finSubSetArray( arr ), finSubGetArray()", arr, ( finSubSetArray( arr ), finSubGetArray() ) ); + + +// access default method from a virtual method of a sub class +AddTestCase( "*** Access default method from virtual method of sub class ***", 1, 1 ); +AddTestCase( "virSubSetArray( arr ), virSubSetArray()", arr, ( virSubSetArray( arr ), virSubGetArray() ) ); + + +// access default method from a public dynamic method of a sub class +AddTestCase( "*** Acess default method from public dynamic method of sub class ***", 1, 1 ); +AddTestCase( "pubDynSubSetArray( arr ), pubDynSubGetArray()", arr, ( pubDynSubSetArray( arr ), pubDynSubGetArray()) ); + + +// access default method from a public static method of a sub class +AddTestCase( "*** Access default method from public static method of sub class ***", 1, 1 ); +AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 ); +// AddTestCase( "pubStatSubSetArray( arr ), pubStatSubGetArray()", arr, ( pubStatSubSetArray( arr ), pubStatSubGetArray() ) ); + + +// access default method from a public final method of a sub class +AddTestCase( "*** Access default method from public final method of sub class ***", 1, 1 ); +AddTestCase( "pubFinSubSetArray( arr ), pubFinSubGetArray()", arr, ( pubFinSubSetArray( arr ), pubFinSubGetArray() ) ); + + +// access default method from a public virtual method of a sub class +AddTestCase( "*** Access default method from public virtual method of sub class ***", 1, 1 ); +AddTestCase( "pubVirSubSetArray( arr ), pubVirSubSetArray()", arr, ( pubVirSubSetArray( arr ), pubVirSubGetArray() ) ); + + +// access default method from a final private method of a sub class +AddTestCase( "*** Access default method from final private method of sub class ***", 1, 1 ); +AddTestCase( "testPrivFinSubArray( arr )", arr, testPrivFinSubArray( arr ) ); + + +// access default method from a final static method of a sub class +AddTestCase( "*** Access default method from final static method of sub class ***", 1, 1 ); +AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 ); +// AddTestCase( "finStatSubSetArray( arr ), finStatSubGetArray()", arr, ( finStatSubSetArray( arr ), finStatSubGetArray() ) ); + + +// access default method from a private static method of a sub class +AddTestCase( "*** Access default method from private static method of sub class ***", 1, 1 ); +AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 ); +// AddTestCase( "testPrivStatSubArray( arr )", arr, testPrivStatSubArray( arr ) ); + + +// access default method from a private virtual method of a sub class +AddTestCase( "*** Access default method from private virtual method of sub class ***", 1, 1 ); +AddTestCase( "testPrivVirSubArray( arr )", arr, testPrivVirSubArray( arr ) ); + + + +// access default property from outside the class +AddTestCase( "*** Access default property from outside the class ***", 1, 1 ); +AddTestCase( "array = arr", arr, (array = arr, array) ); + + +// access default property from a default method of a sub class +AddTestCase( "*** Access default property from default method of sub class ***", 1, 1 ); +AddTestCase( "subSetDPArray( arr ), subGetDPArray()", arr, ( subSetDPArray( arr ), subGetDPArray() ) ); + + +// access default property from a dynamic method of a sub class +AddTestCase( "*** Access default property from dynamic method of sub class ***", 1, 1 ); +AddTestCase( "dynSubSetDPArray( arr ), dynSubGetDPArray()", arr, ( dynSubSetDPArray( arr ), dynSubGetDPArray() ) ); + + +// access default property from a public method of a sub class +AddTestCase( "*** Access default property from public method of sub class ***", 1, 1 ); +AddTestCase( "pubSubSetDPArray( arr ), pubSubGetDPArray()", arr, ( pubSubSetDPArray( arr ), pubSubGetDPArray() ) ); + + +// access default property from a private method of a sub class +AddTestCase( "*** Access default property from private method of sub class ***", 1, 1 ); +AddTestCase( "testPrivSubDPArray( arr )", arr, testPrivSubDPArray( arr ) ); + + +// access default property from a static method of a sub class +AddTestCase( "*** Access default property from static method of sub class ***", 1, 1 ); +AddTestCase( "statSubSetDPArray( arr ), statSubGetDPArray()", arr, ( statSubSetDPArray( arr ), statSubGetDPArray() ) ); + + +// access default property from a final method of a sub class +AddTestCase( "*** Access default property from final method of sub class ***", 1, 1 ); +AddTestCase( "finSubSetDPArray( arr ), finSubGetDPArray()", arr, ( finSubSetDPArray( arr ), finSubGetDPArray() ) ); + + +// access default property from a private virtual method of a sub class +AddTestCase( "*** Access default property from private virtual method of sub class ***", 1, 1 ); +AddTestCase( "virSubSetDPArray( arr ), virSubGetDPArray()", arr, ( virSubSetDPArray( arr ), virSubGetDPArray() ) ); + + +// access default property from a public static method of a sub class +AddTestCase( "*** Access default property from public static method of sub class ***", 1, 1 ); +AddTestCase( "pubStatSubSetDPArray( arr ), pubStatSubGetDPArray()", arr, ( pubStatSubSetDPArray( arr ), pubStatSubGetDPArray() ) ); + + +// access default property from a private static method of a sub class +AddTestCase( "*** Access default property from private static method of sub class ***", 1, 1 ); +AddTestCase( "testPrivStatSubDPArray( arr )", arr, testPrivStatSubDPArray( arr ) ); + + +// ******************************************** +// Class Prototype Testing +// ******************************************** + +//Add new property to parent through prototype object, verify child inherits it +var child = new FinExtDynamicClass(); +DynamicClassInner.prototype.fakeProp = 100; +AddTestCase("*** Add new property to parent prototype object, verify child class inherits it ***", 100, child.fakeProp); + +//Try overriding parent property through prototype object, verify child object has correct value +DynamicClassInner.prototype.pObj = 2; +child = new FinExtDynamicClass(); +AddTestCase("*** Try overriding parent property through prototype object, verify child object has correct value ***", 1, child.pObj); + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDynamicClass/DynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDynamicClass/DynamicClass.as new file mode 100644 index 00000000000..56bf5c6db99 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDynamicClass/DynamicClass.as @@ -0,0 +1,246 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DynamicClass { + + + dynamic class DynamicClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + // public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + //For class prototype testing + var pObj:Number = 1; + + // **************** + // constructor + // **************** + + function DynamicClass() { + } + + // ***************** + // default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + } + public class DynamicClass extends DynamicClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDynamicClass/FinExtDynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDynamicClass/FinExtDynamicClass.as new file mode 100644 index 00000000000..8c96add7295 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDynamicClass/FinExtDynamicClass.as @@ -0,0 +1,418 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +// The package definition has been changed, and now all the packages will be under the +// folder Definitions.Classes, and only this will be used and not the subfolders within. +// This means that we cannot import a single Class file as was required to be done earlier. +// All the files in the package folder will be compiled and used. + +// IMPORTANT: This might change later, hence only commenting out the import lines +// and not deleting them. This also creates a problem that the compiled file +// might become too big to handle. +package DynamicClass { + + import DynamicClass.*; + + // Commenting out the import statement as this is not allowed by the compiler now + // import Definitions.Classes.DynamicClass; + + // As this is a final class, it will not be seen by the testcase, hence + // creating a wrapper function for this and changing the name for this file. + // FinExtDynamicClass extends FinExtDynamicClassInner + + final class FinExtDynamicClass extends DynamicClass { + + // access default method of parent from default method of sub class + function subSetArray( a:Array ) { setArray( a ); } + function subGetArray() : Array { return getArray(); } + + + // access default method of parent from dynamic method of sub class + function dynSubSetArray( a:Array ) { setArray( a ); } + function dynSubGetArray() : Array { return getArray(); } + + + // access default method of parent from public method of sub class + public function pubSubSetArray( a:Array ) { setArray( a ); } + public function pubSubGetArray() : Array { return getArray(); } + + + // access default method of parent from static method of sub class + // This is an error case as a static method cannot access any other + // method except a static method and will be addressed in a seperate + // file in the Error folder. + // static function statSubSetArray( a:Array ) { setArray( a ); } + // static function statSubGetArray() : Array { return getArray(); } + + + // access default method of parent from final method of sub class + final function finSubSetArray( a:Array ) { setArray( a ); } + final function finSubGetArray() : Array { return getArray(); } + + + // access default method of parent from virtual method of sub class + virtual function virSubSetArray( a:Array ) { setArray( a ); } + virtual function virSubGetArray() : Array { return getArray(); } + + + // access default method of parent from private method of sub class + private function privSubSetArray( a:Array ) { setArray( a ); } + private function privSubGetArray() : Array { return getArray(); } + + // function to test above using a public function within the class + // this function will be accessible to an object of the class. + public function testPrivSubArray( a:Array ) : Array { + this.privSubSetArray( a ); + return this.privSubGetArray(); + } + + + + // access default method of parent from public dynamic method of sub class + public function pubDynSubSetArray( a:Array ) { setArray( a ); } + public function pubDynSubGetArray() : Array { return getArray(); } + + + // access default method of parent from public static method of sub class + // This is an error case as a static method cannot access any other + // method except a static method and will be addressed in a seperate + // file in the Error folder. + // public static function pubStatSubSetArray( a:Array ) { setArray( a ); } + // public static function pubStatSubGetArray() : Array { return getArray(); } + + + // access default method of parent from public final method of sub class + public final function pubFinSubSetArray( a:Array ) { setArray( a ); } + final public function pubFinSubGetArray() : Array { return getArray(); } + + + // access default method of parent from public virtual method of sub class + public virtual function pubVirSubSetArray( a:Array ) { setArray( a ); } + virtual public function pubVirSubGetArray() : Array { return getArray(); } + + + // access default method of parent from dynamic static method of sub class + // This is an error case as a static method cannot access any other + // method except a static method and will be addressed in a seperate + // file in the Error folder. + // dynamic static function dynStatSubSetArray( a:Array ) { setArray( a ); } + // dynamic static function dynStatSubGetArray() : Array { return getArray(); } + + + // access default method of parent from dynamic final method of sub class + final function dynFinSubSetArray( a:Array ) { setArray( a ); } + final function dynFinSubGetArray() : Array { return getArray(); } + + + // access default method of parent from dynamic virtual method of sub class + virtual function dynVirSubSetArray( a:Array ) { setArray( a ); } + virtual function dynVirSubGetArray() : Array { return getArray(); } + + + // access default method of parent from dynamic private method of sub class + private function dynPrivSubSetArray( a:Array ) { setArray( a ); } + private function dynPrivSubGetArray() : Array { return getArray(); } + + // function to test above from test scripts + public function testPrivDynSubArray( a:Array ) : Array { + this.dynPrivSubSetArray( a ); + return this.dynPrivSubGetArray(); + } + + + // access default method of parent from final static method of sub class + // This is an error case as a static method cannot access any other + // method except a static method and will be addressed in a seperate + // file in the Error folder. + // final static function finStatSubSetArray( a:Array ) { setArray( a ); } + // static final function finStatSubGetArray() : Array { return getArray(); } + + + // access default method of parent from final virtual method of sub class + // This is an invalid case and compiler should report that a function cannot + // be both final and virtual. + // This case will be moved to the negative test cases - Error folder. + // final virtual function finVirSubSetArray( a:Array ) { setArray( a ); } + // virtual final function finVirSubGetArray() : Array { return getArray(); } + + + // access default method of parent from final private method of sub class + final private function finPrivSubSetArray( a:Array ) { setArray( a ); } + private final function finPrivSubGetArray() : Array { return getArray(); } + + // function to test above from test scripts + public function testPrivFinSubArray( a:Array ) : Array { + this.finPrivSubSetArray( a ); + return this.finPrivSubGetArray(); + } + + + // access default method of parent from private static method of sub class + // This is an error case as a static method cannot access any other + // method except a static method and will be addressed in a seperate + // file in the Error folder. + private static function privStatSubSetArray( a:Array ) { setArray( a ); } + static private function privStatSubGetArray() : Array { return getArray(); } + + // function to test above from test scripts + public function testPrivStatSubArray( a:Array ) : Array { + this.privStatSubSetArray( a ); + return this.privStatSubGetArray(); + } + + + // access default method of parent from private virtual method of sub class + private virtual function privVirSubSetArray( a:Array ) { setArray( a ); } + virtual private function privVirSubGetArray() : Array { return getArray(); } + + // function to test above from test scripts + public function testPrivVirSubArray( a:Array ) : Array { + this.privVirSubSetArray( a ); + return this.privVirSubGetArray(); + } + + // access default method of parent from virtual static method of sub class + // This is an invalid case as a function cannot be both virtual and static. + // This test case will be moved to the Error folder as a negative test case. + // virtual static function virStatSubSetArray( a:Array ) { setArray( a ); } + // static virtual function virStatSubGetArray() : Array { return getArray(); } + + + + // access default property from default method of sub class + function subSetDPArray( a:Array ) { array = a; } + function subGetDPArray() : Array { return array; } + + + // access default property from dynamic method of sub class. + function dynSubSetDPArray( a:Array ) { array = a; } + function dynSubGetDPArray() : Array { return array; } + + + // access default property from public method of sub class + public function pubSubSetDPArray( a:Array ) { array = a; } + public function pubSubGetDPArray() : Array { return array; } + + + // access default property from private method of sub class + private function privSubSetDPArray( a:Array ) { array = a; } + private function privSubGetDPArray() : Array { return array; } + + // public accessor for the above given private functions, + // so that these can be accessed from an object of the class + public function testPrivSubDPArray( a:Array ) : Array { + privSubSetDPArray( a ); + return privSubGetDPArray(); + } + + + // access default property from static method of sub class + static function statSubSetDPArray( a:Array ) { array = a; } + static function statSubGetDPArray() : Array { return array; } + + + // access default property from final method of sub class + final function finSubSetDPArray( a:Array ) { array = a; } + final function finSubGetDPArray() : Array { return array; } + + + // access default property from virtual method of sub class + virtual function virSubSetDPArray( a:Array ) { array = a; } + virtual function virSubGetDPArray() : Array { return array; } + + + // access default property from public static method of sub class + public static function pubStatSubSetDPArray( a:Array ) { array = a; } + public static function pubStatSubGetDPArray() : Array { return array; } + + + // access default property from private static method of sub class + private static function privStatSubSetDPArray( a:Array ) { array = a; } + private static function privStatSubGetDPArray() : Array { return array; } + + // public accessor for the above given private functions, + // so that these can be accessed from an object of the class + public function testPrivStatSubDPArray( a:Array ) : Array { + privStatSubSetDPArray( a ); + return privStatSubGetDPArray(); + } + + } + + // Create an instance of the final class in the package. + // This object will be used for accessing the methods created + // within the sub class given above. + var EXTDCLASS = new FinExtDynamicClass(); + + // Create a series of public functions that call the methods. + // The same names can be used as used in the class; because we are now + // outside of the class definition. + + // The default method of the sub class. + public function subSetArray( a:Array ) { EXTDCLASS.subSetArray( a ); } + public function subGetArray() : Array { return EXTDCLASS.subGetArray(); } + + + // The dynamic method of the sub class. + public function dynSubSetArray( a:Array ) { EXTDCLASS.dynSubSetArray( a ); } + public function dynSubGetArray() : Array { return EXTDCLASS.dynSubGetArray(); } + + + // The public method of the sub class. + public function pubSubSetArray( a:Array ) { EXTDCLASS.pubSubSetArray( a ); } + public function pubSubGetArray() : Array { return EXTDCLASS.pubSubGetArray(); } + + + // The private method of the sub class. Only one is used as we need to call only the + // test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivSubArray( a:Array ) : Array { return EXTDCLASS.testPrivSubArray( a ); } + + + // The static method of the sub class. + // This case is a negative case and will be put in the Error folder. + // public function statSubSetArray( a:Array ) { FinClassExtDefaultClass.statSubSetArray( a ); } + // public function statSubGetArray() : Array { return FinClassExtDefaultClass.statSubGetArray(); } + + // The STATIC class cannot be accessed by an object of the class, but has to be accessed + // by the class name itself. Bug filed for this: 108206 + // public function statSubSetArray( a:Array ) { EXTDCLASS.statSubSetArray( a ); } + // public function statSubGetArray() : Array { return EXTDCLASS.statSubGetArray(); } + + + // The final method of the sub class. + public function finSubSetArray( a : Array ) { EXTDCLASS.finSubSetArray( a ); } + public function finSubGetArray() : Array { return EXTDCLASS.finSubGetArray(); } + + + // The virtual method of the sub class. + public function virSubSetArray( a : Array ) { EXTDCLASS.virSubSetArray( a ); } + public function virSubGetArray() : Array { return EXTDCLASS.virSubGetArray(); } + + + + // The public dynamic method of the sub class. + public function pubDynSubSetArray( a:Array ) { EXTDCLASS.dynSubSetArray( a ); } + public function pubDynSubGetArray() : Array { return EXTDCLASS.pubDynSubGetArray(); } + + + // The public final method of the sub class. + public function pubFinSubSetArray( a : Array ) { EXTDCLASS.pubFinSubSetArray( a ); } + public function pubFinSubGetArray() : Array { return EXTDCLASS.pubFinSubGetArray(); } + + + // The public virtual method of the sub class. + public function pubVirSubSetArray( a : Array ) { EXTDCLASS.pubVirSubSetArray( a ); } + public function pubVirSubGetArray() : Array { return EXTDCLASS.pubVirSubGetArray(); } + + + + // The dynamic private method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivDynSubArray( a:Array ) : Array { return EXTDCLASS.testPrivDynSubArray( a ); } + + + // The dynamic final method of the sub class. + public function dynFinSubSetArray( a : Array ) { EXTDCLASS.dynFinSubSetArray( a ); } + public function dynFinSubGetArray() : Array { return EXTDCLASS.dynFinSubGetArray(); } + + + // The dynamic virtual method of the sub class. + public function dynVirSubSetArray( a : Array ) { EXTDCLASS.dynVirSubSetArray( a ); } + public function dynVirSubGetArray() : Array { return EXTDCLASS.dynVirSubGetArray(); } + + + + // The final private method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivFinSubArray( a:Array ) : Array { return EXTDCLASS.testPrivFinSubArray( a ); } + + + + // The private static method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + // This case is a negative case and will be put in the Error folder. + public function testPrivStatSubArray( a:Array ) : Array { return EXTDCLASS.testPrivStatSubArray( a ); } + + + + // The private virtual method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivVirSubArray( a:Array ) : Array { return EXTDCLASS.testPrivVirSubArray( a ); } + + + // The default property being accessed by the different method attributes. + // The default method attribute. + public function subSetDPArray( a:Array ) { EXTDCLASS.subSetDPArray(a); } + public function subGetDPArray() : Array { return EXTDCLASS.subGetDPArray(); } + + + // The dynamic method attribute. + public function dynSubSetDPArray( a:Array ) { EXTDCLASS.dynSubSetDPArray(a); } + public function dynSubGetDPArray() : Array { return EXTDCLASS.dynSubGetDPArray(); } + + + // The public method attribute. + public function pubSubSetDPArray( a:Array ) { EXTDCLASS.pubSubSetDPArray(a); } + public function pubSubGetDPArray() : Array { return EXTDCLASS.pubSubGetDPArray(); } + + + // The private method attribute. + public function testPrivSubDPArray( a:Array ):Array { return EXTDCLASS.testPrivSubDPArray(a) } + + // the static method attribute. + public function statSubSetDPArray( a:Array ) { FinExtDynamicClass.statSubSetDPArray(a); } + public function statSubGetDPArray() : Array { return FinExtDynamicClass.statSubGetDPArray(); } + + + // the final method attribute. + public function finSubSetDPArray( a:Array ) { EXTDCLASS.finSubSetDPArray(a); } + public function finSubGetDPArray() : Array { return EXTDCLASS.finSubGetDPArray(); } + + + // the virtual method attribute. + public function virSubSetDPArray( a:Array ) { EXTDCLASS.virSubSetDPArray(a); } + public function virSubGetDPArray() : Array { return EXTDCLASS.virSubGetDPArray(); } + + + // the public static method attrbute. + public function pubStatSubSetDPArray( a:Array ) { FinExtDynamicClass.pubStatSubSetDPArray(a); } + public function pubStatSubGetDPArray() : Array { return FinExtDynamicClass.pubStatSubGetDPArray(); } + + + // the private static method attribute + public function testPrivStatSubDPArray( a:Array ) : Array { return EXTDCLASS.testPrivStatSubDPArray(a); } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDynamicClassFin.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDynamicClassFin.as new file mode 100644 index 00000000000..dc5bcd6dd6d --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDynamicClassFin.as @@ -0,0 +1,191 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import DynamicClass.*; + + +var SECTION = "Definitions\Ext"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Final Class Extends Dynamic Class Final Methods"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + +// Can't create an instance because it's not public +// Hence commenting out the lines where the class is initialized. +// var EXTDCLASS = new FinExtDynamicClass(); + + +// Create an array variable which will define the test array to be used +// for the given output. +var arr = new Array(1, 2, 3); + + +// access final method from outside of class +AddTestCase( "*** Access final method from outside of the class ***", 1, 1 ); +// AddTestCase( "finSetArray(arr), finSetArray()", arr, ( finSetArray( arr ), finSetArray() ) ); + + +// access final method from a default method of a sub class +AddTestCase( "*** Access default method from default method of sub class ***", 1, 1 ); +AddTestCase( "subSetArray( arr ), subGetArray()", arr, ( subSetArray( arr ), subGetArray() ) ); + + +// access final method from a dynamic method of a sub class +AddTestCase( "*** Acess default method from dynamic method of sub class ***", 1, 1 ); +AddTestCase( "dynSubSetArray( arr ), dynSubGetArray()", arr, ( dynSubSetArray( arr ), dynSubGetArray()) ); + + +// access final method from a public method of a sub class +AddTestCase( "*** Access default method from public method of sub class ***", 1, 1 ); +AddTestCase( "pubSubSetArray( arr ), pubSubGetArray()", arr, ( pubSubSetArray( arr ), pubSubGetArray()) ); + + +// access final method from a private method of a sub class +AddTestCase( "*** Access default method from private method of sub class ***", 1, 1 ); +AddTestCase( "testPrivSubArray( arr )", arr, testPrivSubArray( arr ) ); + + +// access final method from a static method of a sub class +AddTestCase( "*** Access default method from static method of sub class ***", 1, 1 ); +AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 ); +// AddTestCase( "statSubSetArray( arr ), statSubGetArray()", arr, ( statSubSetArray( arr ), statSubGetArray() ) ); + + +// access final method from a final method of a sub class +AddTestCase( "*** Access default method from final method of sub class ***", 1, 1 ); +AddTestCase( "finSubSetArray( arr ), finSubGetArray()", arr, ( finSubSetArray( arr ), finSubGetArray() ) ); + + +// access final method from a virtual method of a sub class +AddTestCase( "*** Access default method from virtual method of sub class ***", 1, 1 ); +AddTestCase( "virSubSetArray( arr ), virSubSetArray()", arr, ( virSubSetArray( arr ), virSubGetArray() ) ); + + +// access final method from a public dynamic method of a sub class +AddTestCase( "*** Acess default method from public dynamic method of sub class ***", 1, 1 ); +AddTestCase( "pubDynSubSetArray( arr ), pubDynSubGetArray()", arr, ( pubDynSubSetArray( arr ), pubDynSubGetArray()) ); + + +// access final method from a public static method of a sub class +AddTestCase( "*** Access default method from public static method of sub class ***", 1, 1 ); +AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 ); +// AddTestCase( "pubStatSubSetArray( arr ), pubStatSubGetArray()", arr, ( pubStatSubSetArray( arr ), pubStatSubGetArray() ) ); + + +// access final method from a public final method of a sub class +AddTestCase( "*** Access default method from public final method of sub class ***", 1, 1 ); +AddTestCase( "pubFinSubSetArray( arr ), pubFinSubGetArray()", arr, ( pubFinSubSetArray( arr ), pubFinSubGetArray() ) ); + + +// access final method from a public virtual method of a sub class +AddTestCase( "*** Access default method from public virtual method of sub class ***", 1, 1 ); +AddTestCase( "pubVirSubSetArray( arr ), pubVirSubSetArray()", arr, ( pubVirSubSetArray( arr ), pubVirSubGetArray() ) ); + + +// access final method from a final private method of a sub class +AddTestCase( "*** Access default method from final private method of sub class ***", 1, 1 ); +AddTestCase( "testPrivFinSubArray( arr )", arr, testPrivFinSubArray( arr ) ); + + +// access final method from a final static method of a sub class +AddTestCase( "*** Access default method from final static method of sub class ***", 1, 1 ); +AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 ); +// AddTestCase( "finStatSubSetArray( arr ), finStatSubGetArray()", arr, ( finStatSubSetArray( arr ), finStatSubGetArray() ) ); + + +// access final method from a private static method of a sub class +AddTestCase( "*** Access default method from private static method of sub class ***", 1, 1 ); +AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 ); +// AddTestCase( "testPrivStatSubArray( arr )", arr, testPrivStatSubArray( arr ) ); + + +// access final method from a private virtual method of a sub class +AddTestCase( "*** Access default method from private virtual method of sub class ***", 1, 1 ); +AddTestCase( "testPrivVirSubArray( arr )", arr, testPrivVirSubArray( arr ) ); + + + +// access final property from outside the class +AddTestCase( "*** Access default property from outside the class ***", 1, 1 ); +AddTestCase( "array = arr", arr, (array = arr, array) ); + + +// access final property from a default method of a sub class +AddTestCase( "*** Access default property from default method of sub class ***", 1, 1 ); +AddTestCase( "subSetDPArray( arr ), subGetDPArray()", arr, ( subSetDPArray( arr ), subGetDPArray() ) ); + + +// access final property from a dynamic method of a sub class +AddTestCase( "*** Access default property from dynamic method of sub class ***", 1, 1 ); +AddTestCase( "dynSubSetDPArray( arr ), dynSubGetDPArray()", arr, ( dynSubSetDPArray( arr ), dynSubGetDPArray() ) ); + + +// access final property from a public method of a sub class +AddTestCase( "*** Access default property from public method of sub class ***", 1, 1 ); +AddTestCase( "pubSubSetDPArray( arr ), pubSubGetDPArray()", arr, ( pubSubSetDPArray( arr ), pubSubGetDPArray() ) ); + + +// access final property from a private method of a sub class +AddTestCase( "*** Access default property from private method of sub class ***", 1, 1 ); +AddTestCase( "testPrivSubDPArray( arr )", arr, testPrivSubDPArray( arr ) ); + + +// access final property from a static method of a sub class +AddTestCase( "*** Access default property from static method of sub class ***", 1, 1 ); +AddTestCase( "statSubSetDPArray( arr ), statSubGetDPArray()", arr, ( statSubSetDPArray( arr ), statSubGetDPArray() ) ); + + +// access final property from a final method of a sub class +AddTestCase( "*** Access default property from final method of sub class ***", 1, 1 ); +AddTestCase( "finSubSetDPArray( arr ), finSubGetDPArray()", arr, ( finSubSetDPArray( arr ), finSubGetDPArray() ) ); + + +// access final property from a private virtual method of a sub class +AddTestCase( "*** Access default property from private virtual method of sub class ***", 1, 1 ); +AddTestCase( "virSubSetDPArray( arr ), virSubGetDPArray()", arr, ( virSubSetDPArray( arr ), virSubGetDPArray() ) ); + + +// access final property from a public static method of a sub class +AddTestCase( "*** Access default property from public static method of sub class ***", 1, 1 ); +AddTestCase( "pubStatSubSetDPArray( arr ), pubStatSubGetDPArray()", arr, ( pubStatSubSetDPArray( arr ), pubStatSubGetDPArray() ) ); + + +// access final property from a private static method of a sub class +AddTestCase( "*** Access default property from private static method of sub class ***", 1, 1 ); +AddTestCase( "testPrivStatSubDPArray( arr )", arr, testPrivStatSubDPArray( arr ) ); + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDynamicClassFin/DynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDynamicClassFin/DynamicClass.as new file mode 100644 index 00000000000..6dee1fbd55b --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDynamicClassFin/DynamicClass.as @@ -0,0 +1,243 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DynamicClass { + + + dynamic class DynamicClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + // public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // **************** + // constructor + // **************** + + function DynamicClass() { + } + + // ***************** + // default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + } + public class DynamicClass extends DynamicClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDynamicClassFin/FinExtDynamicClassFin.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDynamicClassFin/FinExtDynamicClassFin.as new file mode 100644 index 00000000000..526d9fa2fb2 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDynamicClassFin/FinExtDynamicClassFin.as @@ -0,0 +1,423 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +// The package definition has been changed, and now all the packages will be under the +// folder Definitions.Classes, and only this will be used and not the subfolders within. +// This means that we cannot import a single Class file as was required to be done earlier. +// All the files in the package folder will be compiled and used. + +// IMPORTANT: This might change later, hence only commenting out the import lines +// and not deleting them. This also creates a problem that the compiled file +// might become too big to handle. +package DynamicClass { + + import DynamicClass.*; + + // Commenting out the import statement as this is not allowed by the compiler now + // import Definitions.Classes.DynamicClass; + + // As this is a final class, it will not be seen by the testcase, hence + // creating a wrapper function for this and changing the name for this file. + // FinExtDynamicClassFin extends FinExtDynamicClassFinInner + + + final class FinExtDynamicClassFin extends DynamicClass { + + // access final method of parent from default method of sub class + function subSetArray( a:Array ) { setFinArray( a ); } + function subGetArray() : Array { return getFinArray(); } + + + // access final method of parent from dynamic method of sub class + function dynSubSetArray( a:Array ) { setFinArray( a ); } + function dynSubGetArray() : Array { return getFinArray(); } + + + // access final method of parent from public method of sub class + public function pubSubSetArray( a:Array ) { setFinArray( a ); } + public function pubSubGetArray() : Array { return getFinArray(); } + + + // access final method of parent from static method of sub class + // This is an error case as a static method cannot access any other + // method except a static method and will be addressed in a seperate + // file in the Error folder. + // static function statSubSetArray( a:Array ) { setFinArray( a ); } + // static function statSubGetArray() : Array { return getFinArray(); } + + + // access final method of parent from final method of sub class + final function finSubSetArray( a:Array ) { setFinArray( a ); } + final function finSubGetArray() : Array { return getFinArray(); } + + + // access final method of parent from virtual method of sub class + virtual function virSubSetArray( a:Array ) { setFinArray( a ); } + virtual function virSubGetArray() : Array { return getFinArray(); } + + + // access final method of parent from private method of sub class + private function privSubSetArray( a:Array ) { setFinArray( a ); } + private function privSubGetArray() : Array { return getFinArray(); } + + // function to test above using a public function within the class + // this function will be accessible to an object of the class. + public function testPrivSubArray( a:Array ) : Array { + this.privSubSetArray( a ); + return this.privSubGetArray(); + } + + + + // access final method of parent from public dynamic method of sub class + public function pubDynSubSetArray( a:Array ) { setFinArray( a ); } + public function pubDynSubGetArray() : Array { return getFinArray(); } + + + // access final method of parent from public static method of sub class + // This is an error case as a static method cannot access any other + // method except a static method and will be addressed in a seperate + // file in the Error folder. + // public static function pubStatSubSetArray( a:Array ) { setFinArray( a ); } + // public static function pubStatSubGetArray() : Array { return getFinArray(); } + + + // access final method of parent from public final method of sub class + public final function pubFinSubSetArray( a:Array ) { setFinArray( a ); } + final public function pubFinSubGetArray() : Array { return getFinArray(); } + + + // access final method of parent from public virtual method of sub class + public virtual function pubVirSubSetArray( a:Array ) { setFinArray( a ); } + virtual public function pubVirSubGetArray() : Array { return getFinArray(); } + + + // access final method of parent from dynamic static method of sub class + // This is an error case as a static method cannot access any other + // method except a static method and will be addressed in a seperate + // file in the Error folder. + // dynamic static function dynStatSubSetArray( a:Array ) { setFinArray( a ); } + // dynamic static function dynStatSubGetArray() : Array { return getFinArray(); } + + + // access final method of parent from dynamic final method of sub class + final function dynFinSubSetArray( a:Array ) { setFinArray( a ); } + final function dynFinSubGetArray() : Array { return getFinArray(); } + + + // access final method of parent from dynamic virtual method of sub class + virtual function dynVirSubSetArray( a:Array ) { setFinArray( a ); } + virtual function dynVirSubGetArray() : Array { return getFinArray(); } + + + // access final method of parent from dynamic private method of sub class + private function dynPrivSubSetArray( a:Array ) { setFinArray( a ); } + private function dynPrivSubGetArray() : Array { return getFinArray(); } + + // function to test above from test scripts + public function testPrivDynSubArray( a:Array ) : Array { + this.dynPrivSubSetArray( a ); + return this.dynPrivSubGetArray(); + } + + + // access final method of parent from final static method of sub class + // This is an error case as a static method cannot access any other + // method except a static method and will be addressed in a seperate + // file in the Error folder. + // final static function finStatSubSetArray( a:Array ) { setFinArray( a ); } + // static final function finStatSubGetArray() : Array { return getFinArray(); } + + + // access final method of parent from final virtual method of sub class + // This is an invalid case and compiler should report that a function cannot + // be both final and virtual. + // This case will be moved to the negative test cases - Error folder. + // final virtual function finVirSubSetArray( a:Array ) { setFinArray( a ); } + // virtual final function finVirSubGetArray() : Array { return getFinArray(); } + + + // access final method of parent from final private method of sub class + final private function finPrivSubSetArray( a:Array ) { setFinArray( a ); } + private final function finPrivSubGetArray() : Array { return getFinArray(); } + + // function to test above from test scripts + public function testPrivFinSubArray( a:Array ) : Array { + this.finPrivSubSetArray( a ); + return this.finPrivSubGetArray(); + } + + + // access final method of parent from private static method of sub class + // This is an error case as a static method cannot access any other + // method except a static method and will be addressed in a seperate + // file in the Error folder. + private static function privStatSubSetArray( a:Array ) { setFinArray( a ); } + static private function privStatSubGetArray() : Array { return getFinArray(); } + + // function to test above from test scripts + public function testPrivStatSubArray( a:Array ) : Array { + this.privStatSubSetArray( a ); + return this.privStatSubGetArray(); + } + + + // access final method of parent from private virtual method of sub class + private virtual function privVirSubSetArray( a:Array ) { setFinArray( a ); } + virtual private function privVirSubGetArray() : Array { return getFinArray(); } + + // function to test above from test scripts + public function testPrivVirSubArray( a:Array ) : Array { + this.privVirSubSetArray( a ); + return this.privVirSubGetArray(); + } + + + + // access final method of parent from virtual static method of sub class + // This is an invalid case as a function cannot be both virtual and static. + // This test case will be moved to the Error folder as a negative test case. + // virtual static function virStatSubSetArray( a:Array ) { setFinArray( a ); } + // static virtual function virStatSubGetArray() : Array { return getFinArray(); } + + + + + // access final property from default method of sub class + function subSetDPArray( a:Array ) { finArray = a; } + function subGetDPArray() : Array { return finArray; } + + + // access final property from dynamic method of sub class. + function dynSubSetDPArray( a:Array ) { finArray = a; } + function dynSubGetDPArray() : Array { return finArray; } + + + // access final property from public method of sub class + public function pubSubSetDPArray( a:Array ) { finArray = a; } + public function pubSubGetDPArray() : Array { return finArray; } + + + // access final property from private method of sub class + private function privSubSetDPArray( a:Array ) { finArray = a; } + private function privSubGetDPArray() : Array { return finArray; } + + // public accessor for the above given private functions, + // so that these can be accessed from an object of the class + public function testPrivSubDPArray( a:Array ) : Array { + privSubSetDPArray( a ); + return privSubGetDPArray(); + } + + + // access final property from static method of sub class + static function statSubSetDPArray( a:Array ) { finArray = a; } + static function statSubGetDPArray() : Array { return finArray; } + + + // access final property from final method of sub class + final function finSubSetDPArray( a:Array ) { finArray = a; } + final function finSubGetDPArray() : Array { return finArray; } + + + // access final property from virtual method of sub class + virtual function virSubSetDPArray( a:Array ) { finArray = a; } + virtual function virSubGetDPArray() : Array { return finArray; } + + + // access final property from public static method of sub class + public static function pubStatSubSetDPArray( a:Array ) { finArray = a; } + public static function pubStatSubGetDPArray() : Array { return finArray; } + + + // access final property from private static method of sub class + private static function privStatSubSetDPArray( a:Array ) { finArray = a; } + private static function privStatSubGetDPArray() : Array { return finArray; } + + // public accessor for the above given private functions, + // so that these can be accessed from an object of the class + public function testPrivStatSubDPArray( a:Array ) : Array { + privStatSubSetDPArray( a ); + return privStatSubGetDPArray(); + } + + } + + + // Create an instance of the final class in the package. + // This object will be used for accessing the methods created + // within the sub class given above. + var EXTDCLASS = new FinExtDynamicClassFin(); + + // Create a series of public functions that call the methods. + // The same names can be used as used in the class; because we are now + // outside of the class definition. + + // The default method of the sub class. + public function subSetArray( a:Array ) { EXTDCLASS.subSetArray( a ); } + public function subGetArray() : Array { return EXTDCLASS.subGetArray(); } + + + // The dynamic method of the sub class. + public function dynSubSetArray( a:Array ) { EXTDCLASS.dynSubSetArray( a ); } + public function dynSubGetArray() : Array { return EXTDCLASS.dynSubGetArray(); } + + + // The public method of the sub class. + public function pubSubSetArray( a:Array ) { EXTDCLASS.pubSubSetArray( a ); } + public function pubSubGetArray() : Array { return EXTDCLASS.pubSubGetArray(); } + + + // The private method of the sub class. Only one is used as we need to call only the + // test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivSubArray( a:Array ) : Array { return EXTDCLASS.testPrivSubArray( a ); } + + + // The static method of the sub class. + // This case is a negative case and will be put in the Error folder. + // public function statSubSetArray( a:Array ) { FinClassExtDefaultClass.statSubSetArray( a ); } + // public function statSubGetArray() : Array { return FinClassExtDefaultClass.statSubGetArray(); } + + // The STATIC class cannot be accessed by an object of the class, but has to be accessed + // by the class name itself. Bug filed for this: 108206 + // public function statSubSetArray( a:Array ) { EXTDCLASS.statSubSetArray( a ); } + // public function statSubGetArray() : Array { return EXTDCLASS.statSubGetArray(); } + + + // The final method of the sub class. + public function finSubSetArray( a : Array ) { EXTDCLASS.finSubSetArray( a ); } + public function finSubGetArray() : Array { return EXTDCLASS.finSubGetArray(); } + + + // The virtual method of the sub class. + public function virSubSetArray( a : Array ) { EXTDCLASS.virSubSetArray( a ); } + public function virSubGetArray() : Array { return EXTDCLASS.virSubGetArray(); } + + + + // The public dynamic method of the sub class. + public function pubDynSubSetArray( a:Array ) { EXTDCLASS.dynSubSetArray( a ); } + public function pubDynSubGetArray() : Array { return EXTDCLASS.pubDynSubGetArray(); } + + + // The public final method of the sub class. + public function pubFinSubSetArray( a : Array ) { EXTDCLASS.pubFinSubSetArray( a ); } + public function pubFinSubGetArray() : Array { return EXTDCLASS.pubFinSubGetArray(); } + + + // The public virtual method of the sub class. + public function pubVirSubSetArray( a : Array ) { EXTDCLASS.pubVirSubSetArray( a ); } + public function pubVirSubGetArray() : Array { return EXTDCLASS.pubVirSubGetArray(); } + + + + // The dynamic private method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivDynSubArray( a:Array ) : Array { return EXTDCLASS.testPrivDynSubArray( a ); } + + + // The dynamic final method of the sub class. + public function dynFinSubSetArray( a : Array ) { EXTDCLASS.dynFinSubSetArray( a ); } + public function dynFinSubGetArray() : Array { return EXTDCLASS.dynFinSubGetArray(); } + + + // The dynamic virtual method of the sub class. + public function dynVirSubSetArray( a : Array ) { EXTDCLASS.dynVirSubSetArray( a ); } + public function dynVirSubGetArray() : Array { return EXTDCLASS.dynVirSubGetArray(); } + + + + // The final private method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivFinSubArray( a:Array ) : Array { return EXTDCLASS.testPrivFinSubArray( a ); } + + + + // The private static method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + // This case is a negative case and will be put in the Error folder. + public function testPrivStatSubArray( a:Array ) : Array { return EXTDCLASS.testPrivStatSubArray( a ); } + + + + // The private virtual method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivVirSubArray( a:Array ) : Array { return EXTDCLASS.testPrivVirSubArray( a ); } + + + // The default property being accessed by the different method attributes. + // The default method attribute. + public function subSetDPArray( a:Array ) { EXTDCLASS.subSetDPArray(a); } + public function subGetDPArray() : Array { return EXTDCLASS.subGetDPArray(); } + + + // The dynamic method attribute. + public function dynSubSetDPArray( a:Array ) { EXTDCLASS.dynSubSetDPArray(a); } + public function dynSubGetDPArray() : Array { return EXTDCLASS.dynSubGetDPArray(); } + + + // The public method attribute. + public function pubSubSetDPArray( a:Array ) { EXTDCLASS.pubSubSetDPArray(a); } + public function pubSubGetDPArray() : Array { return EXTDCLASS.pubSubGetDPArray(); } + + + // The private method attribute. + public function testPrivSubDPArray( a:Array ):Array { return EXTDCLASS.testPrivSubDPArray(a) } + + // the static method attribute. + public function statSubSetDPArray( a:Array ) { FinExtDynamicClassFin.statSubSetDPArray(a); } + public function statSubGetDPArray() : Array { return FinExtDynamicClassFin.statSubGetDPArray(); } + + + // the final method attribute. + public function finSubSetDPArray( a:Array ) { EXTDCLASS.finSubSetDPArray(a); } + public function finSubGetDPArray() : Array { return EXTDCLASS.finSubGetDPArray(); } + + + // the virtual method attribute. + public function virSubSetDPArray( a:Array ) { EXTDCLASS.virSubSetDPArray(a); } + public function virSubGetDPArray() : Array { return EXTDCLASS.virSubGetDPArray(); } + + + // the public static method attrbute. + public function pubStatSubSetDPArray( a:Array ) { FinExtDynamicClassFin.pubStatSubSetDPArray(a); } + public function pubStatSubGetDPArray() : Array { return FinExtDynamicClassFin.pubStatSubGetDPArray(); } + + + // the private static method attribute + public function testPrivStatSubDPArray( a:Array ) : Array { return EXTDCLASS.testPrivStatSubDPArray(a); } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDynamicClassPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDynamicClassPub.as new file mode 100644 index 00000000000..e7a552c270f --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDynamicClassPub.as @@ -0,0 +1,191 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import DynamicClass.*; + + +var SECTION = "Definitions\Ext"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Final Class Extends Dynamic Class Public Methods"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + +// Can't create an instance because it's not public +// Hence commenting out the lines where the class is initialized. +// var EXTDCLASS = new FinExtDynamicClass(); + + +// Create an array variable which will define the test array to be used +// for the given output. +var arr = new Array(1, 2, 3); + + +// access public method of parent class from outside of class +AddTestCase( "*** Access public method of parent class from outside of class ***", 1, 1 ); +// AddTestCase( "setPubArray(arr), pubArray", arr, ( setPubArray( arr ), pubArray() ) ); + + +// access public method from a default method of a sub class +AddTestCase( "*** Access default method from default method of sub class ***", 1, 1 ); +AddTestCase( "subSetArray( arr ), subGetArray()", arr, ( subSetArray( arr ), subGetArray() ) ); + + +// access public method from a dynamic method of a sub class +AddTestCase( "*** Acess default method from dynamic method of sub class ***", 1, 1 ); +AddTestCase( "dynSubSetArray( arr ), dynSubGetArray()", arr, ( dynSubSetArray( arr ), dynSubGetArray()) ); + + +// access public method from a public method of a sub class +AddTestCase( "*** Access default method from public method of sub class ***", 1, 1 ); +AddTestCase( "pubSubSetArray( arr ), pubSubGetArray()", arr, ( pubSubSetArray( arr ), pubSubGetArray()) ); + + +// access public method from a private method of a sub class +AddTestCase( "*** Access default method from private method of sub class ***", 1, 1 ); +AddTestCase( "testPrivSubArray( arr )", arr, testPrivSubArray( arr ) ); + + +// access public method from a static method of a sub class +AddTestCase( "*** Access default method from static method of sub class ***", 1, 1 ); +AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 ); +// AddTestCase( "statSubSetArray( arr ), statSubGetArray()", arr, ( statSubSetArray( arr ), statSubGetArray() ) ); + + +// access public method from a final method of a sub class +AddTestCase( "*** Access default method from final method of sub class ***", 1, 1 ); +AddTestCase( "finSubSetArray( arr ), finSubGetArray()", arr, ( finSubSetArray( arr ), finSubGetArray() ) ); + + +// access public method from a virtual method of a sub class +AddTestCase( "*** Access default method from virtual method of sub class ***", 1, 1 ); +AddTestCase( "virSubSetArray( arr ), virSubSetArray()", arr, ( virSubSetArray( arr ), virSubGetArray() ) ); + + +// access public method from a public dynamic method of a sub class +AddTestCase( "*** Acess default method from public dynamic method of sub class ***", 1, 1 ); +AddTestCase( "pubDynSubSetArray( arr ), pubDynSubGetArray()", arr, ( pubDynSubSetArray( arr ), pubDynSubGetArray()) ); + + +// access public method from a public static method of a sub class +AddTestCase( "*** Access default method from public static method of sub class ***", 1, 1 ); +AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 ); +// AddTestCase( "pubStatSubSetArray( arr ), pubStatSubGetArray()", arr, ( pubStatSubSetArray( arr ), pubStatSubGetArray() ) ); + + +// access public method from a public final method of a sub class +AddTestCase( "*** Access default method from public final method of sub class ***", 1, 1 ); +AddTestCase( "pubFinSubSetArray( arr ), pubFinSubGetArray()", arr, ( pubFinSubSetArray( arr ), pubFinSubGetArray() ) ); + + +// access public method from a public virtual method of a sub class +AddTestCase( "*** Access default method from public virtual method of sub class ***", 1, 1 ); +AddTestCase( "pubVirSubSetArray( arr ), pubVirSubSetArray()", arr, ( pubVirSubSetArray( arr ), pubVirSubGetArray() ) ); + + +// access public method from a final private method of a sub class +AddTestCase( "*** Access default method from final private method of sub class ***", 1, 1 ); +AddTestCase( "testPrivFinSubArray( arr )", arr, testPrivFinSubArray( arr ) ); + + +// access public method from a final static method of a sub class +AddTestCase( "*** Access default method from final static method of sub class ***", 1, 1 ); +AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 ); +// AddTestCase( "finStatSubSetArray( arr ), finStatSubGetArray()", arr, ( finStatSubSetArray( arr ), finStatSubGetArray() ) ); + + +// access public method from a private static method of a sub class +AddTestCase( "*** Access default method from private static method of sub class ***", 1, 1 ); +AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 ); +// AddTestCase( "testPrivStatSubArray( arr )", arr, testPrivStatSubArray( arr ) ); + + +// access public method from a private virtual method of a sub class +AddTestCase( "*** Access default method from private virtual method of sub class ***", 1, 1 ); +AddTestCase( "testPrivVirSubArray( arr )", arr, testPrivVirSubArray( arr ) ); + + + +// access public property from outside the class +AddTestCase( "*** Access default property from outside the class ***", 1, 1 ); +AddTestCase( "array = arr", arr, (array = arr, array) ); + + +// access public property from a default method of a sub class +AddTestCase( "*** Access default property from default method of sub class ***", 1, 1 ); +AddTestCase( "subSetDPArray( arr ), subGetDPArray()", arr, ( subSetDPArray( arr ), subGetDPArray() ) ); + + +// access public property from a dynamic method of a sub class +AddTestCase( "*** Access default property from dynamic method of sub class ***", 1, 1 ); +AddTestCase( "dynSubSetDPArray( arr ), dynSubGetDPArray()", arr, ( dynSubSetDPArray( arr ), dynSubGetDPArray() ) ); + + +// access public property from a public method of a sub class +AddTestCase( "*** Access default property from public method of sub class ***", 1, 1 ); +AddTestCase( "pubSubSetDPArray( arr ), pubSubGetDPArray()", arr, ( pubSubSetDPArray( arr ), pubSubGetDPArray() ) ); + + +// access public property from a private method of a sub class +AddTestCase( "*** Access default property from private method of sub class ***", 1, 1 ); +AddTestCase( "testPrivSubDPArray( arr )", arr, testPrivSubDPArray( arr ) ); + + +// access public property from a static method of a sub class +AddTestCase( "*** Access default property from static method of sub class ***", 1, 1 ); +AddTestCase( "statSubSetDPArray( arr ), statSubGetDPArray()", arr, ( statSubSetDPArray( arr ), statSubGetDPArray() ) ); + + +// access public property from a final method of a sub class +AddTestCase( "*** Access default property from final method of sub class ***", 1, 1 ); +AddTestCase( "finSubSetDPArray( arr ), finSubGetDPArray()", arr, ( finSubSetDPArray( arr ), finSubGetDPArray() ) ); + + +// access public property from a private virtual method of a sub class +AddTestCase( "*** Access default property from private virtual method of sub class ***", 1, 1 ); +AddTestCase( "virSubSetDPArray( arr ), virSubGetDPArray()", arr, ( virSubSetDPArray( arr ), virSubGetDPArray() ) ); + + +// access public property from a public static method of a sub class +AddTestCase( "*** Access default property from public static method of sub class ***", 1, 1 ); +AddTestCase( "pubStatSubSetDPArray( arr ), pubStatSubGetDPArray()", arr, ( pubStatSubSetDPArray( arr ), pubStatSubGetDPArray() ) ); + + +// access public property from a private static method of a sub class +AddTestCase( "*** Access default property from private static method of sub class ***", 1, 1 ); +AddTestCase( "testPrivStatSubDPArray( arr )", arr, testPrivStatSubDPArray( arr ) ); + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDynamicClassPub/DynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDynamicClassPub/DynamicClass.as new file mode 100644 index 00000000000..6dee1fbd55b --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDynamicClassPub/DynamicClass.as @@ -0,0 +1,243 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DynamicClass { + + + dynamic class DynamicClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + // public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // **************** + // constructor + // **************** + + function DynamicClass() { + } + + // ***************** + // default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + } + public class DynamicClass extends DynamicClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDynamicClassPub/FinExtDynamicClassPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDynamicClassPub/FinExtDynamicClassPub.as new file mode 100644 index 00000000000..846da7a6425 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDynamicClassPub/FinExtDynamicClassPub.as @@ -0,0 +1,422 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +// The package definition has been changed, and now all the packages will be under the +// folder Definitions.Classes, and only this will be used and not the subfolders within. +// This means that we cannot import a single Class file as was required to be done earlier. +// All the files in the package folder will be compiled and used. + +// IMPORTANT: This might change later, hence only commenting out the import lines +// and not deleting them. This also creates a problem that the compiled file +// might become too big to handle. +package DynamicClass { + + import DynamicClass.*; + + // Commenting out the import statement as this is not allowed by the compiler now + // import Definitions.Classes.DynamicClass; + + // As this is a final class, it will not be seen by the testcase, hence + // creating a wrapper function for this and changing the name for this file. + // FinExtDynamicClassPub extends FinExtDynamicClassPubInner + + final class FinExtDynamicClassPub extends DynamicClass { + + // access public method of parent from default method of sub class + function subSetArray( a:Array ) { setPubArray( a ); } + function subGetArray() : Array { return getPubArray(); } + + + // access public method of parent from dynamic method of sub class + function dynSubSetArray( a:Array ) { setPubArray( a ); } + function dynSubGetArray() : Array { return getPubArray(); } + + + // access public method of parent from public method of sub class + public function pubSubSetArray( a:Array ) { setPubArray( a ); } + public function pubSubGetArray() : Array { return getPubArray(); } + + + // access public method of parent from static method of sub class + // This is an error case as a static method cannot access any other + // method except a static method and will be addressed in a seperate + // file in the Error folder. + // static function statSubSetArray( a:Array ) { setPubArray( a ); } + // static function statSubGetArray() : Array { return getPubArray(); } + + + // access public method of parent from final method of sub class + final function finSubSetArray( a:Array ) { setPubArray( a ); } + final function finSubGetArray() : Array { return getPubArray(); } + + + // access public method of parent from virtual method of sub class + virtual function virSubSetArray( a:Array ) { setPubArray( a ); } + virtual function virSubGetArray() : Array { return getPubArray(); } + + + // access public method of parent from private method of sub class + private function privSubSetArray( a:Array ) { setPubArray( a ); } + private function privSubGetArray() : Array { return getPubArray(); } + + // function to test above using a public function within the class + // this function will be accessible to an object of the class. + public function testPrivSubArray( a:Array ) : Array { + this.privSubSetArray( a ); + return this.privSubGetArray(); + } + + + + // access public method of parent from public dynamic method of sub class + public function pubDynSubSetArray( a:Array ) { setPubArray( a ); } + public function pubDynSubGetArray() : Array { return getPubArray(); } + + + // access public method of parent from public static method of sub class + // This is an error case as a static method cannot access any other + // method except a static method and will be addressed in a seperate + // file in the Error folder. + // public static function pubStatSubSetArray( a:Array ) { setPubArray( a ); } + // public static function pubStatSubGetArray() : Array { return getPubArray(); } + + + // access public method of parent from public final method of sub class + public final function pubFinSubSetArray( a:Array ) { setPubArray( a ); } + final public function pubFinSubGetArray() : Array { return getPubArray(); } + + + // access public method of parent from public virtual method of sub class + public virtual function pubVirSubSetArray( a:Array ) { setPubArray( a ); } + virtual public function pubVirSubGetArray() : Array { return getPubArray(); } + + + // access public method of parent from dynamic static method of sub class + // This is an error case as a static method cannot access any other + // method except a static method and will be addressed in a seperate + // file in the Error folder. + // dynamic static function dynStatSubSetArray( a:Array ) { setPubArray( a ); } + // dynamic static function dynStatSubGetArray() : Array { return getPubArray(); } + + + // access public method of parent from dynamic final method of sub class + final function dynFinSubSetArray( a:Array ) { setPubArray( a ); } + final function dynFinSubGetArray() : Array { return getPubArray(); } + + + // access public method of parent from dynamic virtual method of sub class + virtual function dynVirSubSetArray( a:Array ) { setPubArray( a ); } + virtual function dynVirSubGetArray() : Array { return getPubArray(); } + + + // access public method of parent from dynamic private method of sub class + private function dynPrivSubSetArray( a:Array ) { setPubArray( a ); } + private function dynPrivSubGetArray() : Array { return getPubArray(); } + + // function to test above from test scripts + public function testPrivDynSubArray( a:Array ) : Array { + this.dynPrivSubSetArray( a ); + return this.dynPrivSubGetArray(); + } + + + // access public method of parent from final static method of sub class + // This is an error case as a static method cannot access any other + // method except a static method and will be addressed in a seperate + // file in the Error folder. + // final static function finStatSubSetArray( a:Array ) { setPubArray( a ); } + // static final function finStatSubGetArray() : Array { return getPubArray(); } + + + // access public method of parent from final virtual method of sub class + // This is an invalid case and compiler should report that a function cannot + // be both final and virtual. + // This case will be moved to the negative test cases - Error folder. + // final virtual function finVirSubSetArray( a:Array ) { setPubArray( a ); } + // virtual final function finVirSubGetArray() : Array { return getPubArray(); } + + + // access public method of parent from final private method of sub class + final private function finPrivSubSetArray( a:Array ) { setPubArray( a ); } + private final function finPrivSubGetArray() : Array { return getPubArray(); } + + // function to test above from test scripts + public function testPrivFinSubArray( a:Array ) : Array { + this.finPrivSubSetArray( a ); + return this.finPrivSubGetArray(); + } + + + // access public method of parent from private static method of sub class + // This is an error case as a static method cannot access any other + // method except a static method and will be addressed in a seperate + // file in the Error folder. + private static function privStatSubSetArray( a:Array ) { setPubArray( a ); } + static private function privStatSubGetArray() : Array { return getPubArray(); } + + // function to test above from test scripts + public function testPrivStatSubArray( a:Array ) : Array { + this.privStatSubSetArray( a ); + return this.privStatSubGetArray(); + } + + + // access public method of parent from private virtual method of sub class + private virtual function privVirSubSetArray( a:Array ) { setPubArray( a ); } + virtual private function privVirSubGetArray() : Array { return getPubArray(); } + + // function to test above from test scripts + public function testPrivVirSubArray( a:Array ) : Array { + this.privVirSubSetArray( a ); + return this.privVirSubGetArray(); + } + + + + // access public method of parent from virtual static method of sub class + // This is an invalid case as a function cannot be both virtual and static. + // This test case will be moved to the Error folder as a negative test case. + // virtual static function virStatSubSetArray( a:Array ) { setPubArray( a ); } + // static virtual function virStatSubGetArray() : Array { return getPubArray(); } + + + + // access default property from default method of sub class + function subSetDPArray( a:Array ) { pubArray = a; } + function subGetDPArray() : Array { return pubArray; } + + + // access default property from dynamic method of sub class. + function dynSubSetDPArray( a:Array ) { pubArray = a; } + function dynSubGetDPArray() : Array { return pubArray; } + + + // access default property from public method of sub class + public function pubSubSetDPArray( a:Array ) { pubArray = a; } + public function pubSubGetDPArray() : Array { return pubArray; } + + + // access default property from private method of sub class + private function privSubSetDPArray( a:Array ) { pubArray = a; } + private function privSubGetDPArray() : Array { return pubArray; } + + // public accessor for the above given private functions, + // so that these can be accessed from an object of the class + public function testPrivSubDPArray( a:Array ) : Array { + privSubSetDPArray( a ); + return privSubGetDPArray(); + } + + + // access default property from static method of sub class + static function statSubSetDPArray( a:Array ) { pubArray = a; } + static function statSubGetDPArray() : Array { return pubArray; } + + + // access default property from final method of sub class + final function finSubSetDPArray( a:Array ) { pubArray = a; } + final function finSubGetDPArray() : Array { return pubArray; } + + + // access default property from virtual method of sub class + virtual function virSubSetDPArray( a:Array ) { pubArray = a; } + virtual function virSubGetDPArray() : Array { return pubArray; } + + + // access default property from public static method of sub class + public static function pubStatSubSetDPArray( a:Array ) { pubArray = a; } + public static function pubStatSubGetDPArray() : Array { return pubArray; } + + + // access default property from private static method of sub class + private static function privStatSubSetDPArray( a:Array ) { pubArray = a; } + private static function privStatSubGetDPArray() : Array { return pubArray; } + + // public accessor for the above given private functions, + // so that these can be accessed from an object of the class + public function testPrivStatSubDPArray( a:Array ) : Array { + privStatSubSetDPArray( a ); + return privStatSubGetDPArray(); + } + + } + + + + // Create an instance of the final class in the package. + // This object will be used for accessing the methods created + // within the sub class given above. + var EXTDCLASS = new FinExtDynamicClassPub(); + + // Create a series of public functions that call the methods. + // The same names can be used as used in the class; because we are now + // outside of the class definition. + + // The default method of the sub class. + public function subSetArray( a:Array ) { EXTDCLASS.subSetArray( a ); } + public function subGetArray() : Array { return EXTDCLASS.subGetArray(); } + + + // The dynamic method of the sub class. + public function dynSubSetArray( a:Array ) { EXTDCLASS.dynSubSetArray( a ); } + public function dynSubGetArray() : Array { return EXTDCLASS.dynSubGetArray(); } + + + // The public method of the sub class. + public function pubSubSetArray( a:Array ) { EXTDCLASS.pubSubSetArray( a ); } + public function pubSubGetArray() : Array { return EXTDCLASS.pubSubGetArray(); } + + + // The private method of the sub class. Only one is used as we need to call only the + // test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivSubArray( a:Array ) : Array { return EXTDCLASS.testPrivSubArray( a ); } + + + // The static method of the sub class. + // This case is a negative case and will be put in the Error folder. + // public function statSubSetArray( a:Array ) { FinClassExtDefaultClass.statSubSetArray( a ); } + // public function statSubGetArray() : Array { return FinClassExtDefaultClass.statSubGetArray(); } + + // The STATIC class cannot be accessed by an object of the class, but has to be accessed + // by the class name itself. Bug filed for this: 108206 + // public function statSubSetArray( a:Array ) { EXTDCLASS.statSubSetArray( a ); } + // public function statSubGetArray() : Array { return EXTDCLASS.statSubGetArray(); } + + + // The final method of the sub class. + public function finSubSetArray( a : Array ) { EXTDCLASS.finSubSetArray( a ); } + public function finSubGetArray() : Array { return EXTDCLASS.finSubGetArray(); } + + + // The virtual method of the sub class. + public function virSubSetArray( a : Array ) { EXTDCLASS.virSubSetArray( a ); } + public function virSubGetArray() : Array { return EXTDCLASS.virSubGetArray(); } + + + + // The public dynamic method of the sub class. + public function pubDynSubSetArray( a:Array ) { EXTDCLASS.dynSubSetArray( a ); } + public function pubDynSubGetArray() : Array { return EXTDCLASS.pubDynSubGetArray(); } + + + // The public final method of the sub class. + public function pubFinSubSetArray( a : Array ) { EXTDCLASS.pubFinSubSetArray( a ); } + public function pubFinSubGetArray() : Array { return EXTDCLASS.pubFinSubGetArray(); } + + + // The public virtual method of the sub class. + public function pubVirSubSetArray( a : Array ) { EXTDCLASS.pubVirSubSetArray( a ); } + public function pubVirSubGetArray() : Array { return EXTDCLASS.pubVirSubGetArray(); } + + + + // The dynamic private method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivDynSubArray( a:Array ) : Array { return EXTDCLASS.testPrivDynSubArray( a ); } + + + // The dynamic final method of the sub class. + public function dynFinSubSetArray( a : Array ) { EXTDCLASS.dynFinSubSetArray( a ); } + public function dynFinSubGetArray() : Array { return EXTDCLASS.dynFinSubGetArray(); } + + + // The dynamic virtual method of the sub class. + public function dynVirSubSetArray( a : Array ) { EXTDCLASS.dynVirSubSetArray( a ); } + public function dynVirSubGetArray() : Array { return EXTDCLASS.dynVirSubGetArray(); } + + + + // The final private method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivFinSubArray( a:Array ) : Array { return EXTDCLASS.testPrivFinSubArray( a ); } + + + + // The private static method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + // This case is a negative case and will be put in the Error folder. + public function testPrivStatSubArray( a:Array ) : Array { return EXTDCLASS.testPrivStatSubArray( a ); } + + + + // The private virtual method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivVirSubArray( a:Array ) : Array { return EXTDCLASS.testPrivVirSubArray( a ); } + + + // The default property being accessed by the different method attributes. + // The default method attribute. + public function subSetDPArray( a:Array ) { EXTDCLASS.subSetDPArray(a); } + public function subGetDPArray() : Array { return EXTDCLASS.subGetDPArray(); } + + + // The dynamic method attribute. + public function dynSubSetDPArray( a:Array ) { EXTDCLASS.dynSubSetDPArray(a); } + public function dynSubGetDPArray() : Array { return EXTDCLASS.dynSubGetDPArray(); } + + + // The public method attribute. + public function pubSubSetDPArray( a:Array ) { EXTDCLASS.pubSubSetDPArray(a); } + public function pubSubGetDPArray() : Array { return EXTDCLASS.pubSubGetDPArray(); } + + + // The private method attribute. + public function testPrivSubDPArray( a:Array ):Array { return EXTDCLASS.testPrivSubDPArray(a) } + + // the static method attribute. + public function statSubSetDPArray( a:Array ) { FinExtDynamicClassPub.statSubSetDPArray(a); } + public function statSubGetDPArray() : Array { return FinExtDynamicClassPub.statSubGetDPArray(); } + + + // the final method attribute. + public function finSubSetDPArray( a:Array ) { EXTDCLASS.finSubSetDPArray(a); } + public function finSubGetDPArray() : Array { return EXTDCLASS.finSubGetDPArray(); } + + + // the virtual method attribute. + public function virSubSetDPArray( a:Array ) { EXTDCLASS.virSubSetDPArray(a); } + public function virSubGetDPArray() : Array { return EXTDCLASS.virSubGetDPArray(); } + + + // the public static method attrbute. + public function pubStatSubSetDPArray( a:Array ) { FinExtDynamicClassPub.pubStatSubSetDPArray(a); } + public function pubStatSubGetDPArray() : Array { return FinExtDynamicClassPub.pubStatSubGetDPArray(); } + + + // the private static method attribute + public function testPrivStatSubDPArray( a:Array ) : Array { return EXTDCLASS.testPrivStatSubDPArray(a); } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDynamicClassPubStat.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDynamicClassPubStat.as new file mode 100644 index 00000000000..88a2d00dfe5 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDynamicClassPubStat.as @@ -0,0 +1,191 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import DynamicClass.*; + + +var SECTION = "Definitions\Ext"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Final Class Extends Dynamic Class Public Static Methods"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + +// Can't create an instance because it's not public +// Hence commenting out the lines where the class is initialized. +// var EXTDCLASS = new FinExtDynamicClass(); + + +// Create an array variable which will define the test array to be used +// for the given output. +var arr = new Array(1, 2, 3); + + +// access public static method of parent class from outside of class +AddTestCase( "*** Access public static methods of parent class from outside of class ***", 1, 1 ); +// AddTestCase( "setPubStatArray(arr), pubStatArray", arr, ( setPubStatArray( arr ), getPubStatArray() ) ); + + +// access final method from a default method of a sub class +AddTestCase( "*** Access default method from default method of sub class ***", 1, 1 ); +AddTestCase( "subSetArray( arr ), subGetArray()", arr, ( subSetArray( arr ), subGetArray() ) ); + + +// access final method from a dynamic method of a sub class +AddTestCase( "*** Acess default method from dynamic method of sub class ***", 1, 1 ); +AddTestCase( "dynSubSetArray( arr ), dynSubGetArray()", arr, ( dynSubSetArray( arr ), dynSubGetArray()) ); + + +// access final method from a public method of a sub class +AddTestCase( "*** Access default method from public method of sub class ***", 1, 1 ); +AddTestCase( "pubSubSetArray( arr ), pubSubGetArray()", arr, ( pubSubSetArray( arr ), pubSubGetArray()) ); + + +// access final method from a private method of a sub class +AddTestCase( "*** Access default method from private method of sub class ***", 1, 1 ); +AddTestCase( "testPrivSubArray( arr )", arr, testPrivSubArray( arr ) ); + + +// access final method from a static method of a sub class +AddTestCase( "*** Access default method from static method of sub class ***", 1, 1 ); +AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 ); +// AddTestCase( "statSubSetArray( arr ), statSubGetArray()", arr, ( statSubSetArray( arr ), statSubGetArray() ) ); + + +// access final method from a final method of a sub class +AddTestCase( "*** Access default method from final method of sub class ***", 1, 1 ); +AddTestCase( "finSubSetArray( arr ), finSubGetArray()", arr, ( finSubSetArray( arr ), finSubGetArray() ) ); + + +// access final method from a virtual method of a sub class +AddTestCase( "*** Access default method from virtual method of sub class ***", 1, 1 ); +AddTestCase( "virSubSetArray( arr ), virSubSetArray()", arr, ( virSubSetArray( arr ), virSubGetArray() ) ); + + +// access final method from a public dynamic method of a sub class +AddTestCase( "*** Acess default method from public dynamic method of sub class ***", 1, 1 ); +AddTestCase( "pubDynSubSetArray( arr ), pubDynSubGetArray()", arr, ( pubDynSubSetArray( arr ), pubDynSubGetArray()) ); + + +// access final method from a public static method of a sub class +AddTestCase( "*** Access default method from public static method of sub class ***", 1, 1 ); +AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 ); +// AddTestCase( "pubStatSubSetArray( arr ), pubStatSubGetArray()", arr, ( pubStatSubSetArray( arr ), pubStatSubGetArray() ) ); + + +// access final method from a public final method of a sub class +AddTestCase( "*** Access default method from public final method of sub class ***", 1, 1 ); +AddTestCase( "pubFinSubSetArray( arr ), pubFinSubGetArray()", arr, ( pubFinSubSetArray( arr ), pubFinSubGetArray() ) ); + + +// access final method from a public virtual method of a sub class +AddTestCase( "*** Access default method from public virtual method of sub class ***", 1, 1 ); +AddTestCase( "pubVirSubSetArray( arr ), pubVirSubSetArray()", arr, ( pubVirSubSetArray( arr ), pubVirSubGetArray() ) ); + + +// access final method from a final private method of a sub class +AddTestCase( "*** Access default method from final private method of sub class ***", 1, 1 ); +AddTestCase( "testPrivFinSubArray( arr )", arr, testPrivFinSubArray( arr ) ); + + +// access final method from a final static method of a sub class +AddTestCase( "*** Access default method from final static method of sub class ***", 1, 1 ); +AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 ); +// AddTestCase( "finStatSubSetArray( arr ), finStatSubGetArray()", arr, ( finStatSubSetArray( arr ), finStatSubGetArray() ) ); + + +// access final method from a private static method of a sub class +AddTestCase( "*** Access default method from private static method of sub class ***", 1, 1 ); +AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 ); +// AddTestCase( "testPrivStatSubArray( arr )", arr, testPrivStatSubArray( arr ) ); + + +// access final method from a private virtual method of a sub class +AddTestCase( "*** Access default method from private virtual method of sub class ***", 1, 1 ); +AddTestCase( "testPrivVirSubArray( arr )", arr, testPrivVirSubArray( arr ) ); + + + +// access final property from outside the class +AddTestCase( "*** Access default property from outside the class ***", 1, 1 ); +AddTestCase( "array = arr", arr, (array = arr, array) ); + + +// access final property from a default method of a sub class +AddTestCase( "*** Access default property from default method of sub class ***", 1, 1 ); +AddTestCase( "subSetDPArray( arr ), subGetDPArray()", arr, ( subSetDPArray( arr ), subGetDPArray() ) ); + + +// access final property from a dynamic method of a sub class +AddTestCase( "*** Access default property from dynamic method of sub class ***", 1, 1 ); +AddTestCase( "dynSubSetDPArray( arr ), dynSubGetDPArray()", arr, ( dynSubSetDPArray( arr ), dynSubGetDPArray() ) ); + + +// access final property from a public method of a sub class +AddTestCase( "*** Access default property from public method of sub class ***", 1, 1 ); +AddTestCase( "pubSubSetDPArray( arr ), pubSubGetDPArray()", arr, ( pubSubSetDPArray( arr ), pubSubGetDPArray() ) ); + + +// access final property from a private method of a sub class +AddTestCase( "*** Access default property from private method of sub class ***", 1, 1 ); +AddTestCase( "testPrivSubDPArray( arr )", arr, testPrivSubDPArray( arr ) ); + + +// access final property from a static method of a sub class +AddTestCase( "*** Access default property from static method of sub class ***", 1, 1 ); +AddTestCase( "statSubSetDPArray( arr ), statSubGetDPArray()", arr, ( statSubSetDPArray( arr ), statSubGetDPArray() ) ); + + +// access final property from a final method of a sub class +AddTestCase( "*** Access default property from final method of sub class ***", 1, 1 ); +AddTestCase( "finSubSetDPArray( arr ), finSubGetDPArray()", arr, ( finSubSetDPArray( arr ), finSubGetDPArray() ) ); + + +// access final property from a private virtual method of a sub class +AddTestCase( "*** Access default property from private virtual method of sub class ***", 1, 1 ); +AddTestCase( "virSubSetDPArray( arr ), virSubGetDPArray()", arr, ( virSubSetDPArray( arr ), virSubGetDPArray() ) ); + + +// access final property from a public static method of a sub class +AddTestCase( "*** Access default property from public static method of sub class ***", 1, 1 ); +AddTestCase( "pubStatSubSetDPArray( arr ), pubStatSubGetDPArray()", arr, ( pubStatSubSetDPArray( arr ), pubStatSubGetDPArray() ) ); + + +// access final property from a private static method of a sub class +AddTestCase( "*** Access default property from private static method of sub class ***", 1, 1 ); +AddTestCase( "testPrivStatSubDPArray( arr )", arr, testPrivStatSubDPArray( arr ) ); + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDynamicClassPubStat/DynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDynamicClassPubStat/DynamicClass.as new file mode 100644 index 00000000000..6dee1fbd55b --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDynamicClassPubStat/DynamicClass.as @@ -0,0 +1,243 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DynamicClass { + + + dynamic class DynamicClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + // public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // **************** + // constructor + // **************** + + function DynamicClass() { + } + + // ***************** + // default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + } + public class DynamicClass extends DynamicClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDynamicClassPubStat/FinExtDynamicClassPubStat.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDynamicClassPubStat/FinExtDynamicClassPubStat.as new file mode 100644 index 00000000000..dad3d459098 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDynamicClassPubStat/FinExtDynamicClassPubStat.as @@ -0,0 +1,405 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +// The package definition has been changed, and now all the packages will be under the +// folder Definitions.Classes, and only this will be used and not the subfolders within. +// This means that we cannot import a single Class file as was required to be done earlier. +// All the files in the package folder will be compiled and used. + +// IMPORTANT: This might change later, hence only commenting out the import lines +// and not deleting them. This also creates a problem that the compiled file +// might become too big to handle. +package DynamicClass { + + import DynamicClass.*; + + // Commenting out the import statement as this is not allowed by the compiler now + // import Definitions.Classes.DynamicClass; + + // As this is a final class, it will not be seen by the testcase, hence + // creating a wrapper function for this and changing the name for this file. + // FinExtDynamicClassPubStat extends FinExtDynamicClassPubStatInner + + + final class FinExtDynamicClassPubStat extends DynamicClass { + + // access public static method of parent from default method of sub class + function subSetArray( a:Array ) { setPubStatArray( a ); } + function subGetArray() : Array { return getPubStatArray(); } + + + // access public static method of parent from dynamic method of sub class + function dynSubSetArray( a:Array ) { setPubStatArray( a ); } + function dynSubGetArray() : Array { return getPubStatArray(); } + + + // access public static method of parent from public method of sub class + public function pubSubSetArray( a:Array ) { setPubStatArray( a ); } + public function pubSubGetArray() : Array { return getPubStatArray(); } + + + // access public static method of parent from static method of sub class + static function statSubSetArray( a:Array ) { setPubStatArray( a ); } + static function statSubGetArray() : Array { return getPubStatArray(); } + + + // access public static method of parent from final method of sub class + final function finSubSetArray( a:Array ) { setPubStatArray( a ); } + final function finSubGetArray() : Array { return getPubStatArray(); } + + + // access public static method of parent from virtual method of sub class + virtual function virSubSetArray( a:Array ) { setPubStatArray( a ); } + virtual function virSubGetArray() : Array { return getPubStatArray(); } + + + // access public static method of parent from private method of sub class + private function privSubSetArray( a:Array ) { setPubStatArray( a ); } + private function privSubGetArray() : Array { return getPubStatArray(); } + + // function to test above using a public function within the class + // this function will be accessible to an object of the class. + public function testPrivSubArray( a:Array ) : Array { + this.privSubSetArray( a ); + return this.privSubGetArray(); + } + + + + // access public static method of parent from public dynamic method of sub class + public function pubDynSubSetArray( a:Array ) { setPubStatArray( a ); } + public function pubDynSubGetArray() : Array { return getPubStatArray(); } + + + // access public static method of parent from public static method of sub class + public static function pubStatSubSetArray( a:Array ) { setPubStatArray( a ); } + public static function pubStatSubGetArray() : Array { return getPubStatArray(); } + + + // access public static method of parent from public final method of sub class + public final function pubFinSubSetArray( a:Array ) { setPubStatArray( a ); } + final public function pubFinSubGetArray() : Array { return getPubStatArray(); } + + + // access public static method of parent from public virtual method of sub class + public virtual function pubVirSubSetArray( a:Array ) { setPubStatArray( a ); } + virtual public function pubVirSubGetArray() : Array { return getPubStatArray(); } + + + // access public static method of parent from dynamic static method of sub class + static function dynStatSubSetArray( a:Array ) { setPubStatArray( a ); } + static function dynStatSubGetArray() : Array { return getPubStatArray(); } + + + // access public static method of parent from dynamic final method of sub class + final function dynFinSubSetArray( a:Array ) { setPubStatArray( a ); } + final function dynFinSubGetArray() : Array { return getPubStatArray(); } + + + // access public static method of parent from dynamic virtual method of sub class + virtual function dynVirSubSetArray( a:Array ) { setPubStatArray( a ); } + virtual function dynVirSubGetArray() : Array { return getPubStatArray(); } + + + // access public static method of parent from dynamic private method of sub class + private function dynPrivSubSetArray( a:Array ) { setPubStatArray( a ); } + private function dynPrivSubGetArray() : Array { return getPubStatArray(); } + + // function to test above from test scripts + public function testPrivDynSubArray( a:Array ) : Array { + this.dynPrivSubSetArray( a ); + return this.dynPrivSubGetArray(); + } + + + // access public static method of parent from static method of sub class + static function finStatSubSetArray( a:Array ) { setPubStatArray( a ); } + static function finStatSubGetArray() : Array { return getPubStatArray(); } + + + // access public static method of parent from final virtual method of sub class + // This is an invalid case and compiler should report that a function cannot + // be both final and virtual. + // This case will be moved to the negative test cases - Error folder. + // final virtual function finVirSubSetArray( a:Array ) { setPubStatArray( a ); } + // virtual final function finVirSubGetArray() : Array { return getPubStatArray(); } + + + // access public static method of parent from final private method of sub class + final private function finPrivSubSetArray( a:Array ) { setPubStatArray( a ); } + private final function finPrivSubGetArray() : Array { return getPubStatArray(); } + + // function to test above from test scripts + public function testPrivFinSubArray( a:Array ) : Array { + this.finPrivSubSetArray( a ); + return this.finPrivSubGetArray(); + } + + + // access public static method of parent from private static method of sub class + private static function privStatSubSetArray( a:Array ) { setPubStatArray( a ); } + static private function privStatSubGetArray() : Array { return getPubStatArray(); } + + // function to test above from test scripts + public function testPrivStatSubArray( a:Array ) : Array { + this.privStatSubSetArray( a ); + return this.privStatSubGetArray(); + } + + + // access public static method of parent from private virtual method of sub class + private virtual function privVirSubSetArray( a:Array ) { setPubStatArray( a ); } + virtual private function privVirSubGetArray() : Array { return getPubStatArray(); } + + // function to test above from test scripts + public function testPrivVirSubArray( a:Array ) : Array { + this.privVirSubSetArray( a ); + return this.privVirSubGetArray(); + } + + + + // access public static method of parent from virtual static method of sub class + // This is an invalid case as a function cannot be both virtual and static. + // This test case will be moved to the Error folder as a negative test case. + // virtual static function virStatSubSetArray( a:Array ) { setPubStatArray( a ); } + // static virtual function virStatSubGetArray() : Array { return getPubStatArray(); } + + + + // access public static property from default method of sub class + function subSetDPArray( a:Array ) { pubStatArray = a; } + function subGetDPArray() : Array { return pubStatArray; } + + + // access public static property from dynamic method of sub class. + function dynSubSetDPArray( a:Array ) { pubStatArray = a; } + function dynSubGetDPArray() : Array { return pubStatArray; } + + + // access public static property from public method of sub class + public function pubSubSetDPArray( a:Array ) { pubStatArray = a; } + public function pubSubGetDPArray() : Array { return pubStatArray; } + + + // access public static property from private method of sub class + private function privSubSetDPArray( a:Array ) { pubStatArray = a; } + private function privSubGetDPArray() : Array { return pubStatArray; } + + // public accessor for the above given private functions, + // so that these can be accessed from an object of the class + public function testPrivSubDPArray( a:Array ) : Array { + privSubSetDPArray( a ); + return privSubGetDPArray(); + } + + + // access public static property from static method of sub class + static function statSubSetDPArray( a:Array ) { pubStatArray = a; } + static function statSubGetDPArray() : Array { return pubStatArray; } + + + // access public static property from final method of sub class + final function finSubSetDPArray( a:Array ) { pubStatArray = a; } + final function finSubGetDPArray() : Array { return pubStatArray; } + + + // access public static property from virtual method of sub class + virtual function virSubSetDPArray( a:Array ) { pubStatArray = a; } + virtual function virSubGetDPArray() : Array { return pubStatArray; } + + + // access public static property from public static method of sub class + public static function pubStatSubSetDPArray( a:Array ) { pubStatArray = a; } + public static function pubStatSubGetDPArray() : Array { return pubStatArray; } + + + // access public static property from private static method of sub class + private static function privStatSubSetDPArray( a:Array ) { pubStatArray = a; } + private static function privStatSubGetDPArray() : Array { return pubStatArray; } + + // public accessor for the above given private functions, + // so that these can be accessed from an object of the class + public function testPrivStatSubDPArray( a:Array ) : Array { + privStatSubSetDPArray( a ); + return privStatSubGetDPArray(); + } + } + + // Create an instance of the final class in the package. + // This object will be used for accessing the methods created + // within the sub class given above. + var EXTDCLASS = new FinExtDynamicClassPubStat(); + + // Create a series of public functions that call the methods. + // The same names can be used as used in the class; because we are now + // outside of the class definition. + + // The default method of the sub class. + public function subSetArray( a:Array ) { EXTDCLASS.subSetArray( a ); } + public function subGetArray() : Array { return EXTDCLASS.subGetArray(); } + + + // The dynamic method of the sub class. + public function dynSubSetArray( a:Array ) { EXTDCLASS.dynSubSetArray( a ); } + public function dynSubGetArray() : Array { return EXTDCLASS.dynSubGetArray(); } + + + // The public method of the sub class. + public function pubSubSetArray( a:Array ) { EXTDCLASS.pubSubSetArray( a ); } + public function pubSubGetArray() : Array { return EXTDCLASS.pubSubGetArray(); } + + + // The private method of the sub class. Only one is used as we need to call only the + // test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivSubArray( a:Array ) : Array { return EXTDCLASS.testPrivSubArray( a ); } + + + // The static method of the sub class. + public function statSubSetArray( a:Array ) { FinExtDynamicClassPubStat.statSubSetArray( a ); } + public function statSubGetArray() : Array { return FinExtDynamicClassPubStat.statSubGetArray(); } + + // The STATIC class cannot be accessed by an object of the class, but has to be accessed + // by the class name itself. Bug filed for this: 108206 + // public function statSubSetArray( a:Array ) { EXTDCLASS.statSubSetArray( a ); } + // public function statSubGetArray() : Array { return EXTDCLASS.statSubGetArray(); } + + + // The final method of the sub class. + public function finSubSetArray( a : Array ) { EXTDCLASS.finSubSetArray( a ); } + public function finSubGetArray() : Array { return EXTDCLASS.finSubGetArray(); } + + + // The virtual method of the sub class. + public function virSubSetArray( a : Array ) { EXTDCLASS.virSubSetArray( a ); } + public function virSubGetArray() : Array { return EXTDCLASS.virSubGetArray(); } + + + + // The public dynamic method of the sub class. + public function pubDynSubSetArray( a:Array ) { EXTDCLASS.dynSubSetArray( a ); } + public function pubDynSubGetArray() : Array { return EXTDCLASS.pubDynSubGetArray(); } + + + // The public final method of the sub class. + public function pubFinSubSetArray( a : Array ) { EXTDCLASS.pubFinSubSetArray( a ); } + public function pubFinSubGetArray() : Array { return EXTDCLASS.pubFinSubGetArray(); } + + + // The public virtual method of the sub class. + public function pubVirSubSetArray( a : Array ) { EXTDCLASS.pubVirSubSetArray( a ); } + public function pubVirSubGetArray() : Array { return EXTDCLASS.pubVirSubGetArray(); } + + + + // The dynamic private method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivDynSubArray( a:Array ) : Array { return EXTDCLASS.testPrivDynSubArray( a ); } + + + // The dynamic final method of the sub class. + public function dynFinSubSetArray( a : Array ) { EXTDCLASS.dynFinSubSetArray( a ); } + public function dynFinSubGetArray() : Array { return EXTDCLASS.dynFinSubGetArray(); } + + + // The dynamic virtual method of the sub class. + public function dynVirSubSetArray( a : Array ) { EXTDCLASS.dynVirSubSetArray( a ); } + public function dynVirSubGetArray() : Array { return EXTDCLASS.dynVirSubGetArray(); } + + + + // The final private method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivFinSubArray( a:Array ) : Array { return EXTDCLASS.testPrivFinSubArray( a ); } + + + + // The private static method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + // This case is a negative case and will be put in the Error folder. + public function testPrivStatSubArray( a:Array ) : Array { return EXTDCLASS.testPrivStatSubArray( a ); } + + + + // The private virtual method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivVirSubArray( a:Array ) : Array { return EXTDCLASS.testPrivVirSubArray( a ); } + + + // The default property being accessed by the different method attributes. + // The default method attribute. + public function subSetDPArray( a:Array ) { EXTDCLASS.subSetDPArray(a); } + public function subGetDPArray() : Array { return EXTDCLASS.subGetDPArray(); } + + + // The dynamic method attribute. + public function dynSubSetDPArray( a:Array ) { EXTDCLASS.dynSubSetDPArray(a); } + public function dynSubGetDPArray() : Array { return EXTDCLASS.dynSubGetDPArray(); } + + + // The public method attribute. + public function pubSubSetDPArray( a:Array ) { EXTDCLASS.pubSubSetDPArray(a); } + public function pubSubGetDPArray() : Array { return EXTDCLASS.pubSubGetDPArray(); } + + + // The private method attribute. + public function testPrivSubDPArray( a:Array ):Array { return EXTDCLASS.testPrivSubDPArray(a) } + + // the static method attribute. + public function statSubSetDPArray( a:Array ) { FinExtDynamicClassPubStat.statSubSetDPArray(a); } + public function statSubGetDPArray() : Array { return FinExtDynamicClassPubStat.statSubGetDPArray(); } + + + // the final method attribute. + public function finSubSetDPArray( a:Array ) { EXTDCLASS.finSubSetDPArray(a); } + public function finSubGetDPArray() : Array { return EXTDCLASS.finSubGetDPArray(); } + + + // the virtual method attribute. + public function virSubSetDPArray( a:Array ) { EXTDCLASS.virSubSetDPArray(a); } + public function virSubGetDPArray() : Array { return EXTDCLASS.virSubGetDPArray(); } + + + // the public static method attrbute. + public function pubStatSubSetDPArray( a:Array ) { FinExtDynamicClassPubStat.pubStatSubSetDPArray(a); } + public function pubStatSubGetDPArray() : Array { return FinExtDynamicClassPubStat.pubStatSubGetDPArray(); } + + + // the private static method attribute + public function testPrivStatSubDPArray( a:Array ) : Array { return EXTDCLASS.testPrivStatSubDPArray(a); } + + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDynamicClassStat.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDynamicClassStat.as new file mode 100644 index 00000000000..0e0f36df78a --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDynamicClassStat.as @@ -0,0 +1,191 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import DynamicClass.*; + + +var SECTION = "Definitions\Ext"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Final Class Extends Dynamic Class Static Methods"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + +// Can't create an instance because it's not public +// Hence commenting out the lines where the class is initialized. +// var EXTDCLASS = new FinExtDynamicClass(); + + +// Create an array variable which will define the test array to be used +// for the given output. +var arr = new Array(1, 2, 3); + + +// access static method of parent class from outside of class +AddTestCase( "*** Access static method of parent class from outside of class ***", 1, 1 ); +// AddTestCase( "setStatArray(arr), getStatArray()", arr, ( setStatArray( arr ), getStatArray() ) ); + + +// access static method from a default method of a sub class +AddTestCase( "*** Access default method from default method of sub class ***", 1, 1 ); +AddTestCase( "subSetArray( arr ), subGetArray()", arr, ( subSetArray( arr ), subGetArray() ) ); + + +// access static method from a dynamic method of a sub class +AddTestCase( "*** Acess default method from dynamic method of sub class ***", 1, 1 ); +AddTestCase( "dynSubSetArray( arr ), dynSubGetArray()", arr, ( dynSubSetArray( arr ), dynSubGetArray()) ); + + +// access static method from a public method of a sub class +AddTestCase( "*** Access default method from public method of sub class ***", 1, 1 ); +AddTestCase( "pubSubSetArray( arr ), pubSubGetArray()", arr, ( pubSubSetArray( arr ), pubSubGetArray()) ); + + +// access static method from a private method of a sub class +AddTestCase( "*** Access default method from private method of sub class ***", 1, 1 ); +AddTestCase( "testPrivSubArray( arr )", arr, testPrivSubArray( arr ) ); + + +// access static method from a static method of a sub class +AddTestCase( "*** Access default method from static method of sub class ***", 1, 1 ); +AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 ); +// AddTestCase( "statSubSetArray( arr ), statSubGetArray()", arr, ( statSubSetArray( arr ), statSubGetArray() ) ); + + +// access static method from a final method of a sub class +AddTestCase( "*** Access default method from final method of sub class ***", 1, 1 ); +AddTestCase( "finSubSetArray( arr ), finSubGetArray()", arr, ( finSubSetArray( arr ), finSubGetArray() ) ); + + +// access static method from a virtual method of a sub class +AddTestCase( "*** Access default method from virtual method of sub class ***", 1, 1 ); +AddTestCase( "virSubSetArray( arr ), virSubSetArray()", arr, ( virSubSetArray( arr ), virSubGetArray() ) ); + + +// access static method from a public dynamic method of a sub class +AddTestCase( "*** Acess default method from public dynamic method of sub class ***", 1, 1 ); +AddTestCase( "pubDynSubSetArray( arr ), pubDynSubGetArray()", arr, ( pubDynSubSetArray( arr ), pubDynSubGetArray()) ); + + +// access static method from a public static method of a sub class +AddTestCase( "*** Access default method from public static method of sub class ***", 1, 1 ); +AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 ); +// AddTestCase( "pubStatSubSetArray( arr ), pubStatSubGetArray()", arr, ( pubStatSubSetArray( arr ), pubStatSubGetArray() ) ); + + +// access static method from a public final method of a sub class +AddTestCase( "*** Access default method from public final method of sub class ***", 1, 1 ); +AddTestCase( "pubFinSubSetArray( arr ), pubFinSubGetArray()", arr, ( pubFinSubSetArray( arr ), pubFinSubGetArray() ) ); + + +// access static method from a public virtual method of a sub class +AddTestCase( "*** Access default method from public virtual method of sub class ***", 1, 1 ); +AddTestCase( "pubVirSubSetArray( arr ), pubVirSubSetArray()", arr, ( pubVirSubSetArray( arr ), pubVirSubGetArray() ) ); + + +// access static method from a final private method of a sub class +AddTestCase( "*** Access default method from final private method of sub class ***", 1, 1 ); +AddTestCase( "testPrivFinSubArray( arr )", arr, testPrivFinSubArray( arr ) ); + + +// access static method from a final static method of a sub class +AddTestCase( "*** Access default method from final static method of sub class ***", 1, 1 ); +AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 ); +// AddTestCase( "finStatSubSetArray( arr ), finStatSubGetArray()", arr, ( finStatSubSetArray( arr ), finStatSubGetArray() ) ); + + +// access static method from a private static method of a sub class +AddTestCase( "*** Access default method from private static method of sub class ***", 1, 1 ); +AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 ); +// AddTestCase( "testPrivStatSubArray( arr )", arr, testPrivStatSubArray( arr ) ); + + +// access static method from a private virtual method of a sub class +AddTestCase( "*** Access default method from private virtual method of sub class ***", 1, 1 ); +AddTestCase( "testPrivVirSubArray( arr )", arr, testPrivVirSubArray( arr ) ); + + + +// access static property from outside the class +AddTestCase( "*** Access default property from outside the class ***", 1, 1 ); +AddTestCase( "array = arr", arr, (array = arr, array) ); + + +// access static property from a default method of a sub class +AddTestCase( "*** Access default property from default method of sub class ***", 1, 1 ); +AddTestCase( "subSetDPArray( arr ), subGetDPArray()", arr, ( subSetDPArray( arr ), subGetDPArray() ) ); + + +// access static property from a dynamic method of a sub class +AddTestCase( "*** Access default property from dynamic method of sub class ***", 1, 1 ); +AddTestCase( "dynSubSetDPArray( arr ), dynSubGetDPArray()", arr, ( dynSubSetDPArray( arr ), dynSubGetDPArray() ) ); + + +// access static property from a public method of a sub class +AddTestCase( "*** Access default property from public method of sub class ***", 1, 1 ); +AddTestCase( "pubSubSetDPArray( arr ), pubSubGetDPArray()", arr, ( pubSubSetDPArray( arr ), pubSubGetDPArray() ) ); + + +// access static property from a private method of a sub class +AddTestCase( "*** Access default property from private method of sub class ***", 1, 1 ); +AddTestCase( "testPrivSubDPArray( arr )", arr, testPrivSubDPArray( arr ) ); + + +// access static property from a static method of a sub class +AddTestCase( "*** Access default property from static method of sub class ***", 1, 1 ); +AddTestCase( "statSubSetDPArray( arr ), statSubGetDPArray()", arr, ( statSubSetDPArray( arr ), statSubGetDPArray() ) ); + + +// access static property from a final method of a sub class +AddTestCase( "*** Access default property from final method of sub class ***", 1, 1 ); +AddTestCase( "finSubSetDPArray( arr ), finSubGetDPArray()", arr, ( finSubSetDPArray( arr ), finSubGetDPArray() ) ); + + +// access static property from a private virtual method of a sub class +AddTestCase( "*** Access default property from private virtual method of sub class ***", 1, 1 ); +AddTestCase( "virSubSetDPArray( arr ), virSubGetDPArray()", arr, ( virSubSetDPArray( arr ), virSubGetDPArray() ) ); + + +// access static property from a public static method of a sub class +AddTestCase( "*** Access default property from public static method of sub class ***", 1, 1 ); +AddTestCase( "pubStatSubSetDPArray( arr ), pubStatSubGetDPArray()", arr, ( pubStatSubSetDPArray( arr ), pubStatSubGetDPArray() ) ); + + +// access static property from a private static method of a sub class +AddTestCase( "*** Access default property from private static method of sub class ***", 1, 1 ); +AddTestCase( "testPrivStatSubDPArray( arr )", arr, testPrivStatSubDPArray( arr ) ); + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDynamicClassStat/DynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDynamicClassStat/DynamicClass.as new file mode 100644 index 00000000000..6dee1fbd55b --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDynamicClassStat/DynamicClass.as @@ -0,0 +1,243 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DynamicClass { + + + dynamic class DynamicClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + // public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // **************** + // constructor + // **************** + + function DynamicClass() { + } + + // ***************** + // default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + } + public class DynamicClass extends DynamicClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDynamicClassStat/FinExtDynamicClassStat.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDynamicClassStat/FinExtDynamicClassStat.as new file mode 100644 index 00000000000..91489b0d838 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtDynamicClassStat/FinExtDynamicClassStat.as @@ -0,0 +1,419 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +// The package definition has been changed, and now all the packages will be under the +// folder Definitions.Classes, and only this will be used and not the subfolders within. +// This means that we cannot import a single Class file as was required to be done earlier. +// All the files in the package folder will be compiled and used. + +// IMPORTANT: This might change later, hence only commenting out the import lines +// and not deleting them. This also creates a problem that the compiled file +// might become too big to handle. +package DynamicClass { + + import DynamicClass.*; + + // Commenting out the import statement as this is not allowed by the compiler now + // import Definitions.Classes.DynamicClass; + + // As this is a final class, it will not be seen by the testcase, hence + // creating a wrapper function for this and changing the name for this file. + // FinExtDynamicClassStat extends FinExtDynamicClassStatInner + + + final class FinExtDynamicClassStat extends DynamicClass { + + // access static method of parent from default method of sub class + function subSetArray( a:Array ) { setStatArray( a ); } + function subGetArray() : Array { return getStatArray(); } + + + // access static method of parent from dynamic method of sub class + function dynSubSetArray( a:Array ) { setStatArray( a ); } + function dynSubGetArray() : Array { return getStatArray(); } + + + // access static method of parent from public method of sub class + public function pubSubSetArray( a:Array ) { setStatArray( a ); } + public function pubSubGetArray() : Array { return getStatArray(); } + + + // access static method of parent from static method of sub class + static function statSubSetArray( a:Array ) { setStatArray( a ); } + static function statSubGetArray() : Array { return getStatArray(); } + + + // access static method of parent from final method of sub class + final function finSubSetArray( a:Array ) { setStatArray( a ); } + final function finSubGetArray() : Array { return getStatArray(); } + + + // access static method of parent from virtual method of sub class + virtual function virSubSetArray( a:Array ) { setStatArray( a ); } + virtual function virSubGetArray() : Array { return getStatArray(); } + + + // access static method of parent from private method of sub class + private function privSubSetArray( a:Array ) { setStatArray( a ); } + private function privSubGetArray() : Array { return getStatArray(); } + + // function to test above using a public function within the class + // this function will be accessible to an object of the class. + public function testPrivSubArray( a:Array ) : Array { + this.privSubSetArray( a ); + return this.privSubGetArray(); + } + + + + // access static method of parent from public dynamic method of sub class + public function pubDynSubSetArray( a:Array ) { setStatArray( a ); } + public function pubDynSubGetArray() : Array { return getStatArray(); } + + + // access static method of parent from public static method of sub class + public static function pubStatSubSetArray( a:Array ) { setStatArray( a ); } + public static function pubStatSubGetArray() : Array { return getStatArray(); } + + + // access static method of parent from public final method of sub class + public final function pubFinSubSetArray( a:Array ) { setStatArray( a ); } + final public function pubFinSubGetArray() : Array { return getStatArray(); } + + + // access static method of parent from public virtual method of sub class + public virtual function pubVirSubSetArray( a:Array ) { setStatArray( a ); } + virtual public function pubVirSubGetArray() : Array { return getStatArray(); } + + + // access static method of parent from dynamic static method of sub class + static function dynStatSubSetArray( a:Array ) { setStatArray( a ); } + static function dynStatSubGetArray() : Array { return getStatArray(); } + + + // access static method of parent from dynamic final method of sub class + final function dynFinSubSetArray( a:Array ) { setStatArray( a ); } + final function dynFinSubGetArray() : Array { return getStatArray(); } + + + // access static method of parent from dynamic virtual method of sub class + virtual function dynVirSubSetArray( a:Array ) { setStatArray( a ); } + virtual function dynVirSubGetArray() : Array { return getStatArray(); } + + + // access static method of parent from dynamic private method of sub class + private function dynPrivSubSetArray( a:Array ) { setStatArray( a ); } + private function dynPrivSubGetArray() : Array { return getStatArray(); } + + // function to test above from test scripts + public function testPrivDynSubArray( a:Array ) : Array { + this.dynPrivSubSetArray( a ); + return this.dynPrivSubGetArray(); + } + + + // access static method of parent from final static method of sub class + static function finStatSubSetArray( a:Array ) { setStatArray( a ); } + static function finStatSubGetArray() : Array { return getStatArray(); } + + + // access static method of parent from final virtual method of sub class + // This is an invalid case and compiler should report that a function cannot + // be both final and virtual. + // This case will be moved to the negative test cases - Error folder. + // final virtual function finVirSubSetArray( a:Array ) { setStatArray( a ); } + // virtual final function finVirSubGetArray() : Array { return getStatArray(); } + + + // access static method of parent from final private method of sub class + final private function finPrivSubSetArray( a:Array ) { setStatArray( a ); } + private final function finPrivSubGetArray() : Array { return getStatArray(); } + + // function to test above from test scripts + public function testPrivFinSubArray( a:Array ) : Array { + this.finPrivSubSetArray( a ); + return this.finPrivSubGetArray(); + } + + + // access static method of parent from private static method of sub class + private static function privStatSubSetArray( a:Array ) { setStatArray( a ); } + static private function privStatSubGetArray() : Array { return getStatArray(); } + + // function to test above from test scripts + public function testPrivStatSubArray( a:Array ) : Array { + this.privStatSubSetArray( a ); + return this.privStatSubGetArray(); + } + + + // access static method of parent from private virtual method of sub class + private virtual function privVirSubSetArray( a:Array ) { setStatArray( a ); } + virtual private function privVirSubGetArray() : Array { return getStatArray(); } + + // function to test above from test scripts + public function testPrivVirSubArray( a:Array ) : Array { + this.privVirSubSetArray( a ); + return this.privVirSubGetArray(); + } + + + + // access static method of parent from virtual static method of sub class + // This is an invalid case as a function cannot be both virtual and static. + // This test case will be moved to the Error folder as a negative test case. + // virtual static function virStatSubSetArray( a:Array ) { setStatArray( a ); } + // static virtual function virStatSubGetArray() : Array { return getStatArray(); } + + + + + + // access static property from default method of sub class + function subSetDPArray( a:Array ) { statArray = a; } + function subGetDPArray() : Array { return statArray; } + + + // access static property from dynamic method of sub class. + function dynSubSetDPArray( a:Array ) { statArray = a; } + function dynSubGetDPArray() : Array { return statArray; } + + + // access static property from public method of sub class + public function pubSubSetDPArray( a:Array ) { statArray = a; } + public function pubSubGetDPArray() : Array { return statArray; } + + + // access static property from private method of sub class + private function privSubSetDPArray( a:Array ) { statArray = a; } + private function privSubGetDPArray() : Array { return statArray; } + + // public accessor for the above given private functions, + // so that these can be accessed from an object of the class + public function testPrivSubDPArray( a:Array ) : Array { + privSubSetDPArray( a ); + return privSubGetDPArray(); + } + + + // access static property from static method of sub class + static function statSubSetDPArray( a:Array ) { statArray = a; } + static function statSubGetDPArray() : Array { return statArray; } + + + // access static property from final method of sub class + final function finSubSetDPArray( a:Array ) { statArray = a; } + final function finSubGetDPArray() : Array { return statArray; } + + + // access static property from virtual method of sub class + virtual function virSubSetDPArray( a:Array ) { statArray = a; } + virtual function virSubGetDPArray() : Array { return statArray; } + + + // access static property from public static method of sub class + public static function pubStatSubSetDPArray( a:Array ) { statArray = a; } + public static function pubStatSubGetDPArray() : Array { return statArray; } + + + // access static property from private static method of sub class + private static function privStatSubSetDPArray( a:Array ) { statArray = a; } + private static function privStatSubGetDPArray() : Array { return statArray; } + + // public accessor for the above given private functions, + // so that these can be accessed from an object of the class + public function testPrivStatSubDPArray( a:Array ) : Array { + privStatSubSetDPArray( a ); + return privStatSubGetDPArray(); + } + + } + + + + // Create an instance of the final class in the package. + // This object will be used for accessing the methods created + // within the sub class given above. + var EXTDCLASS = new FinExtDynamicClassStat(); + + // Create a series of public functions that call the methods. + // The same names can be used as used in the class; because we are now + // outside of the class definition. + + // The default method of the sub class. + public function subSetArray( a:Array ) { EXTDCLASS.subSetArray( a ); } + public function subGetArray() : Array { return EXTDCLASS.subGetArray(); } + + + // The dynamic method of the sub class. + public function dynSubSetArray( a:Array ) { EXTDCLASS.dynSubSetArray( a ); } + public function dynSubGetArray() : Array { return EXTDCLASS.dynSubGetArray(); } + + + // The public method of the sub class. + public function pubSubSetArray( a:Array ) { EXTDCLASS.pubSubSetArray( a ); } + public function pubSubGetArray() : Array { return EXTDCLASS.pubSubGetArray(); } + + + // The private method of the sub class. Only one is used as we need to call only the + // test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivSubArray( a:Array ) : Array { return EXTDCLASS.testPrivSubArray( a ); } + + + // The static method of the sub class. + public function statSubSetArray( a:Array ) { FinExtDynamicClassStat.statSubSetArray( a ); } + public function statSubGetArray() : Array { return FinExtDynamicClassStat.statSubGetArray(); } + + // The STATIC class cannot be accessed by an object of the class, but has to be accessed + // by the class name itself. Bug filed for this: 108206 + // public function statSubSetArray( a:Array ) { EXTDCLASS.statSubSetArray( a ); } + // public function statSubGetArray() : Array { return EXTDCLASS.statSubGetArray(); } + + + // The final method of the sub class. + public function finSubSetArray( a : Array ) { EXTDCLASS.finSubSetArray( a ); } + public function finSubGetArray() : Array { return EXTDCLASS.finSubGetArray(); } + + + // The virtual method of the sub class. + public function virSubSetArray( a : Array ) { EXTDCLASS.virSubSetArray( a ); } + public function virSubGetArray() : Array { return EXTDCLASS.virSubGetArray(); } + + + + // The public dynamic method of the sub class. + public function pubDynSubSetArray( a:Array ) { EXTDCLASS.dynSubSetArray( a ); } + public function pubDynSubGetArray() : Array { return EXTDCLASS.pubDynSubGetArray(); } + + + // The public final method of the sub class. + public function pubFinSubSetArray( a : Array ) { EXTDCLASS.pubFinSubSetArray( a ); } + public function pubFinSubGetArray() : Array { return EXTDCLASS.pubFinSubGetArray(); } + + + // The public virtual method of the sub class. + public function pubVirSubSetArray( a : Array ) { EXTDCLASS.pubVirSubSetArray( a ); } + public function pubVirSubGetArray() : Array { return EXTDCLASS.pubVirSubGetArray(); } + + + + // The dynamic private method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivDynSubArray( a:Array ) : Array { return EXTDCLASS.testPrivDynSubArray( a ); } + + + // The dynamic final method of the sub class. + public function dynFinSubSetArray( a : Array ) { EXTDCLASS.dynFinSubSetArray( a ); } + public function dynFinSubGetArray() : Array { return EXTDCLASS.dynFinSubGetArray(); } + + + // The dynamic virtual method of the sub class. + public function dynVirSubSetArray( a : Array ) { EXTDCLASS.dynVirSubSetArray( a ); } + public function dynVirSubGetArray() : Array { return EXTDCLASS.dynVirSubGetArray(); } + + + + // The final private method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivFinSubArray( a:Array ) : Array { return EXTDCLASS.testPrivFinSubArray( a ); } + + + + // The private static method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + // This case is a negative case and will be put in the Error folder. + public function testPrivStatSubArray( a:Array ) : Array { return FinExtDynamicClassStat.testPrivStatSubArray( a ); } + + + // The static method of the sub class. + public function finStatSubSetArray( a : Array ) { FinExtDynamicClassStat.finStatSubSetArray( a ); } + public function finStatSubGetArray() : Array { return FinExtDynamicClassStat.finStatSubGetArray(); } + + // The STATIC class cannot be accessed by an object of the class, but has to be accessed + // by the class name itself. Bug filed for this: 108206 + // public function finStatSubSetArray( a:Array ) { EXTDCLASS.finStatSubSetArray( a ); } + // public function finStatSubGetArray() : Array { return EXTDCLASS.finStatSubGetArray(); } + + + + // The private virtual method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivVirSubArray( a:Array ) : Array { return EXTDCLASS.testPrivVirSubArray( a ); } + + + // The default property being accessed by the different method attributes. + // The default method attribute. + public function subSetDPArray( a:Array ) { EXTDCLASS.subSetDPArray(a); } + public function subGetDPArray() : Array { return EXTDCLASS.subGetDPArray(); } + + + // The dynamic method attribute. + public function dynSubSetDPArray( a:Array ) { EXTDCLASS.dynSubSetDPArray(a); } + public function dynSubGetDPArray() : Array { return EXTDCLASS.dynSubGetDPArray(); } + + + // The public method attribute. + public function pubSubSetDPArray( a:Array ) { EXTDCLASS.pubSubSetDPArray(a); } + public function pubSubGetDPArray() : Array { return EXTDCLASS.pubSubGetDPArray(); } + + + // The private method attribute. + public function testPrivSubDPArray( a:Array ):Array { return EXTDCLASS.testPrivSubDPArray(a) } + + // the static method attribute. + public function statSubSetDPArray( a:Array ) { FinExtDynamicClassStat.statSubSetDPArray(a); } + public function statSubGetDPArray() : Array { return FinExtDynamicClassStat.statSubGetDPArray(); } + + + // the final method attribute. + public function finSubSetDPArray( a:Array ) { EXTDCLASS.finSubSetDPArray(a); } + public function finSubGetDPArray() : Array { return EXTDCLASS.finSubGetDPArray(); } + + + // the virtual method attribute. + public function virSubSetDPArray( a:Array ) { EXTDCLASS.virSubSetDPArray(a); } + public function virSubGetDPArray() : Array { return EXTDCLASS.virSubGetDPArray(); } + + + // the public static method attrbute. + public function pubStatSubSetDPArray( a:Array ) { FinExtDynamicClassStat.pubStatSubSetDPArray(a); } + public function pubStatSubGetDPArray() : Array { return FinExtDynamicClassStat.pubStatSubGetDPArray(); } + + + // the private static method attribute + public function testPrivStatSubDPArray( a:Array ) : Array { return EXTDCLASS.testPrivStatSubDPArray(a); } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtInternalClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtInternalClass.as new file mode 100644 index 00000000000..f64f7fa41b9 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtInternalClass.as @@ -0,0 +1,185 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import InternalClass.*; + + +var SECTION = "Definitions\Ext"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Final Class Extends Default Class Default Methods"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +// Can't create an instance because it's not public +// Hence commenting out the lines where the class is initialized. +// var EXTDCLASS = new FinExtInternalClassPub(); + + +// Create an array variable which will define the test array to be used +// for the given output. +var arr = new Array(1, 2, 3); + + +// access default method from a default method of a sub class +AddTestCase( "*** Access default method from default method of sub class ***", 1, 1 ); +AddTestCase( "subSetArray( arr ), subGetArray()", arr, ( subSetArray( arr ), subGetArray() ) ); + + +// access default method from a dynamic method of a sub class +AddTestCase( "*** Acess default method from dynamic method of sub class ***", 1, 1 ); +AddTestCase( "dynSubSetArray( arr ), dynSubGetArray()", arr, ( dynSubSetArray( arr ), dynSubGetArray()) ); + + +// access default method from a public method of a sub class +AddTestCase( "*** Access default method from public method of sub class ***", 1, 1 ); +AddTestCase( "pubSubSetArray( arr ), pubSubGetArray()", arr, ( pubSubSetArray( arr ), pubSubGetArray()) ); + + +// access default method from a private method of a sub class +AddTestCase( "*** Access default method from private method of sub class ***", 1, 1 ); +AddTestCase( "testPrivSubArray( arr )", arr, testPrivSubArray( arr ) ); + + +// access default method from a static method of a sub class +AddTestCase( "*** Access default method from static method of sub class ***", 1, 1 ); +AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 ); +// AddTestCase( "statSubSetArray( arr ), statSubGetArray()", arr, ( statSubSetArray( arr ), statSubGetArray() ) ); + + +// access default method from a final method of a sub class +AddTestCase( "*** Access default method from final method of sub class ***", 1, 1 ); +AddTestCase( "finSubSetArray( arr ), finSubGetArray()", arr, ( finSubSetArray( arr ), finSubGetArray() ) ); + + +// access default method from a virtual method of a sub class +AddTestCase( "*** Access default method from virtual method of sub class ***", 1, 1 ); +AddTestCase( "virSubSetArray( arr ), virSubSetArray()", arr, ( virSubSetArray( arr ), virSubGetArray() ) ); + + +// access default method from a public dynamic method of a sub class +AddTestCase( "*** Acess default method from public dynamic method of sub class ***", 1, 1 ); +AddTestCase( "pubDynSubSetArray( arr ), pubDynSubGetArray()", arr, ( pubDynSubSetArray( arr ), pubDynSubGetArray()) ); + + +// access default method from a public static method of a sub class +AddTestCase( "*** Access default method from public static method of sub class ***", 1, 1 ); +AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 ); +// AddTestCase( "pubStatSubSetArray( arr ), pubStatSubGetArray()", arr, ( pubStatSubSetArray( arr ), pubStatSubGetArray() ) ); + + +// access default method from a public final method of a sub class +AddTestCase( "*** Access default method from public final method of sub class ***", 1, 1 ); +AddTestCase( "pubFinSubSetArray( arr ), pubFinSubGetArray()", arr, ( pubFinSubSetArray( arr ), pubFinSubGetArray() ) ); + + +// access default method from a public virtual method of a sub class +AddTestCase( "*** Access default method from public virtual method of sub class ***", 1, 1 ); +AddTestCase( "pubVirSubSetArray( arr ), pubVirSubSetArray()", arr, ( pubVirSubSetArray( arr ), pubVirSubGetArray() ) ); + + +// access default method from a final private method of a sub class +AddTestCase( "*** Access default method from final private method of sub class ***", 1, 1 ); +AddTestCase( "testPrivFinSubArray( arr )", arr, testPrivFinSubArray( arr ) ); + + +// access default method from a final static method of a sub class +AddTestCase( "*** Access default method from final static method of sub class ***", 1, 1 ); +AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 ); +// AddTestCase( "finStatSubSetArray( arr ), finStatSubGetArray()", arr, ( finStatSubSetArray( arr ), finStatSubGetArray() ) ); + + +// access default method from a private static method of a sub class +AddTestCase( "*** Access default method from private static method of sub class ***", 1, 1 ); +AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 ); +// AddTestCase( "testPrivStatSubArray( arr )", arr, testPrivStatSubArray( arr ) ); + + +// access default method from a private virtual method of a sub class +AddTestCase( "*** Access default method from private virtual method of sub class ***", 1, 1 ); +AddTestCase( "testPrivVirSubArray( arr )", arr, testPrivVirSubArray( arr ) ); + + + +// access default property from outside the class +AddTestCase( "*** Access default property from outside the class ***", 1, 1 ); +AddTestCase( "array = arr", arr, (array = arr, array) ); + + +// access default property from a default method of a sub class +AddTestCase( "*** Access default property from default method of sub class ***", 1, 1 ); +AddTestCase( "subSetDPArray( arr ), subGetDPArray()", arr, ( subSetDPArray( arr ), subGetDPArray() ) ); + + +// access default property from a dynamic method of a sub class +AddTestCase( "*** Access default property from dynamic method of sub class ***", 1, 1 ); +AddTestCase( "dynSubSetDPArray( arr ), dynSubGetDPArray()", arr, ( dynSubSetDPArray( arr ), dynSubGetDPArray() ) ); + + +// access default property from a public method of a sub class +AddTestCase( "*** Access default property from public method of sub class ***", 1, 1 ); +AddTestCase( "pubSubSetDPArray( arr ), pubSubGetDPArray()", arr, ( pubSubSetDPArray( arr ), pubSubGetDPArray() ) ); + + +// access default property from a private method of a sub class +AddTestCase( "*** Access default property from private method of sub class ***", 1, 1 ); +AddTestCase( "testPrivSubDPArray( arr )", arr, testPrivSubDPArray( arr ) ); + + +// access default property from a static method of a sub class +AddTestCase( "*** Access default property from static method of sub class ***", 1, 1 ); +AddTestCase( "statSubSetDPArray( arr ), statSubGetDPArray()", arr, ( statSubSetDPArray( arr ), statSubGetDPArray() ) ); + + +// access default property from a final method of a sub class +AddTestCase( "*** Access default property from final method of sub class ***", 1, 1 ); +AddTestCase( "finSubSetDPArray( arr ), finSubGetDPArray()", arr, ( finSubSetDPArray( arr ), finSubGetDPArray() ) ); + + +// access default property from a private virtual method of a sub class +AddTestCase( "*** Access default property from private virtual method of sub class ***", 1, 1 ); +AddTestCase( "virSubSetDPArray( arr ), virSubGetDPArray()", arr, ( virSubSetDPArray( arr ), virSubGetDPArray() ) ); + + +// access default property from a public static method of a sub class +AddTestCase( "*** Access default property from public static method of sub class ***", 1, 1 ); +AddTestCase( "pubStatSubSetDPArray( arr ), pubStatSubGetDPArray()", arr, ( pubStatSubSetDPArray( arr ), pubStatSubGetDPArray() ) ); + + +// access default property from a private static method of a sub class +AddTestCase( "*** Access default property from private static method of sub class ***", 1, 1 ); +AddTestCase( "testPrivStatSubDPArray( arr )", arr, testPrivStatSubDPArray( arr ) ); + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtInternalClass/AInternalClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtInternalClass/AInternalClass.as new file mode 100644 index 00000000000..c8526819793 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtInternalClass/AInternalClass.as @@ -0,0 +1,264 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package InternalClass { + + internal class InternalClassInner { + + internal var array:Array; + var boolean:Boolean; + internal var date:Date; + var myFunction:Function; + internal var math:Math; + var number:Number; + internal var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + //public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + internal function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + internal function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + internal function getNumber() : Number { return number; } + function getObject() : Object { return object; } + internal function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + internal function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + internal function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + internal function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + internal function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + } + + public class InternalClass extends InternalClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtInternalClass/FinExtInternalClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtInternalClass/FinExtInternalClass.as new file mode 100644 index 00000000000..be956ed84b9 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtInternalClass/FinExtInternalClass.as @@ -0,0 +1,424 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +// This statement should be inside the package definition. NOT HERE. +// import Definitions.Classes.InternalClass; + +// The package definition has been changed, and now all the packages will be under the +// folder Definitions.Classes, and only this will be used and not the subfolders within. +// This means that we cannot import a single Class file as was required to be done earlier. +// All the files in the package folder will be compiled and used. + +// IMPORTANT: This might change later, hence only commenting out the import lines +// and not deleting them. This also creates a problem that the compiled file +// might become too big to handle. +package InternalClass { + + import InternalClass.*; + + // Commenting out the import statement as this is not allowed by the compiler now + // import Definitions.Classes.InternalClass; + + // As this is a final class, it will not be seen by the testcase, hence + // creating a wrapper function for this and changing the name for this file. + // FinExtInternalClass extends FinExtInternalClassInner + + final class FinExtInternalClass extends InternalClass { + + // access default method of parent from default method of sub class + function subSetArray( a:Array ) { setArray( a ); } + function subGetArray() : Array { return getArray(); } + + + // access default method of parent from dynamic method of sub class + // mt: dynamic methods are not supported + function dynSubSetArray( a:Array ) { setArray( a ); } + function dynSubGetArray() : Array { return getArray(); } + + + // access default method of parent from public method of sub class + public function pubSubSetArray( a:Array ) { setArray( a ); } + public function pubSubGetArray() : Array { return getArray(); } + + + // access default method of parent from static method of sub class + // This is an error case as a static method cannot access any other + // method except a static method and will be addressed in a seperate + // file in the Error folder. + // static function statSubSetArray( a:Array ) { setArray( a ); } + // static function statSubGetArray() : Array { return getArray(); } + + + // access default method of parent from final method of sub class + final function finSubSetArray( a:Array ) { setArray( a ); } + final function finSubGetArray() : Array { return getArray(); } + + + // access default method of parent from virtual method of sub class + virtual function virSubSetArray( a:Array ) { setArray( a ); } + virtual function virSubGetArray() : Array { return getArray(); } + + + // access default method of parent from private method of sub class + private function privSubSetArray( a:Array ) { setArray( a ); } + private function privSubGetArray() : Array { return getArray(); } + + // function to test above using a public function within the class + // this function will be accessible to an object of the class. + public function testPrivSubArray( a:Array ) : Array { + this.privSubSetArray( a ); + return this.privSubGetArray(); + } + + + + // access default method of parent from public dynamic method of sub class + // dynamic methods are not supported + public function pubDynSubSetArray( a:Array ) { setArray( a ); } + public function pubDynSubGetArray() : Array { return getArray(); } + + + // access default method of parent from public static method of sub class + // This is an error case as a static method cannot access any other + // method except a static method and will be addressed in a seperate + // file in the Error folder. + // public static function pubStatSubSetArray( a:Array ) { setArray( a ); } + // public static function pubStatSubGetArray() : Array { return getArray(); } + + + // access default method of parent from public final method of sub class + public final function pubFinSubSetArray( a:Array ) { setArray( a ); } + final public function pubFinSubGetArray() : Array { return getArray(); } + + + // access default method of parent from public virtual method of sub class + public virtual function pubVirSubSetArray( a:Array ) { setArray( a ); } + virtual public function pubVirSubGetArray() : Array { return getArray(); } + + + // access default method of parent from dynamic static method of sub class + // This is an error case as a static method cannot access any other + // method except a static method and will be addressed in a seperate + // file in the Error folder. + // dynamic static function dynStatSubSetArray( a:Array ) { setArray( a ); } + // dynamic static function dynStatSubGetArray() : Array { return getArray(); } + + + // access default method of parent from dynamic final method of sub class + final function dynFinSubSetArray( a:Array ) { setArray( a ); } + final function dynFinSubGetArray() : Array { return getArray(); } + + + // access default method of parent from dynamic virtual method of sub class + virtual function dynVirSubSetArray( a:Array ) { setArray( a ); } + virtual function dynVirSubGetArray() : Array { return getArray(); } + + + // access default method of parent from dynamic private method of sub class + private function dynPrivSubSetArray( a:Array ) { setArray( a ); } + private function dynPrivSubGetArray() : Array { return getArray(); } + + // function to test above from test scripts + public function testPrivDynSubArray( a:Array ) : Array { + this.dynPrivSubSetArray( a ); + return this.dynPrivSubGetArray(); + } + + + // access default method of parent from final static method of sub class + // This is an error case as a static method cannot access any other + // method except a static method and will be addressed in a seperate + // file in the Error folder. + // final static function finStatSubSetArray( a:Array ) { setArray( a ); } + // static final function finStatSubGetArray() : Array { return getArray(); } + + + // access default method of parent from final virtual method of sub class + // This is an invalid case and compiler should report that a function cannot + // be both final and virtual. + // This case will be moved to the negative test cases - Error folder. + // final virtual function finVirSubSetArray( a:Array ) { setArray( a ); } + // virtual final function finVirSubGetArray() : Array { return getArray(); } + + + // access default method of parent from final private method of sub class + final private function finPrivSubSetArray( a:Array ) { setArray( a ); } + private final function finPrivSubGetArray() : Array { return getArray(); } + + // function to test above from test scripts + public function testPrivFinSubArray( a:Array ) : Array { + this.finPrivSubSetArray( a ); + return this.finPrivSubGetArray(); + } + + + // access default method of parent from private static method of sub class + // This is an error case as a static method cannot access any other + // method except a static method and will be addressed in a seperate + // file in the Error folder. + private static function privStatSubSetArray( a:Array ) { setArray( a ); } + static private function privStatSubGetArray() : Array { return getArray(); } + + // function to test above from test scripts + public function testPrivStatSubArray( a:Array ) : Array { + this.privStatSubSetArray( a ); + return this.privStatSubGetArray(); + } + + + // access default method of parent from private virtual method of sub class + private virtual function privVirSubSetArray( a:Array ) { setArray( a ); } + virtual private function privVirSubGetArray() : Array { return getArray(); } + + // function to test above from test scripts + public function testPrivVirSubArray( a:Array ) : Array { + this.privVirSubSetArray( a ); + return this.privVirSubGetArray(); + } + + // access default method of parent from virtual static method of sub class + // This is an invalid case as a function cannot be both virtual and static. + // This test case will be moved to the Error folder as a negative test case. + // virtual static function virStatSubSetArray( a:Array ) { setArray( a ); } + // static virtual function virStatSubGetArray() : Array { return getArray(); } + + + + // access default property from default method of sub class + function subSetDPArray( a:Array ) { array = a; } + function subGetDPArray() : Array { return array; } + + + // access default property from dynamic method of sub class. + function dynSubSetDPArray( a:Array ) { array = a; } + function dynSubGetDPArray() : Array { return array; } + + + // access default property from public method of sub class + public function pubSubSetDPArray( a:Array ) { array = a; } + public function pubSubGetDPArray() : Array { return array; } + + + // access default property from private method of sub class + private function privSubSetDPArray( a:Array ) { array = a; } + private function privSubGetDPArray() : Array { return array; } + + // public accessor for the above given private functions, + // so that these can be accessed from an object of the class + public function testPrivSubDPArray( a:Array ) : Array { + privSubSetDPArray( a ); + return privSubGetDPArray(); + } + + + // access default property from static method of sub class + static function statSubSetDPArray( a:Array ) { array = a; } + static function statSubGetDPArray() : Array { return array; } + + + // access default property from final method of sub class + final function finSubSetDPArray( a:Array ) { array = a; } + final function finSubGetDPArray() : Array { return array; } + + + // access default property from virtual method of sub class + virtual function virSubSetDPArray( a:Array ) { array = a; } + virtual function virSubGetDPArray() : Array { return array; } + + + // access default property from public static method of sub class + public static function pubStatSubSetDPArray( a:Array ) { array = a; } + public static function pubStatSubGetDPArray() : Array { return array; } + + + // access default property from private static method of sub class + private static function privStatSubSetDPArray( a:Array ) { array = a; } + private static function privStatSubGetDPArray() : Array { return array; } + + // public accessor for the above given private functions, + // so that these can be accessed from an object of the class + public function testPrivStatSubDPArray( a:Array ) : Array { + privStatSubSetDPArray( a ); + return privStatSubGetDPArray(); + } + + } + + + // Create an instance of the final class in the package. + // This object will be used for accessing the methods created + // within the sub class given above. + var EXTDCLASS = new FinExtInternalClass(); + + // Create a series of public functions that call the methods. + // The same names can be used as used in the class; because we are now + // outside of the class definition. + + // The default method of the sub class. + public function subSetArray( a:Array ) { EXTDCLASS.subSetArray( a ); } + public function subGetArray() : Array { return EXTDCLASS.subGetArray(); } + + + // The dynamic method of the sub class. + public function dynSubSetArray( a:Array ) { EXTDCLASS.dynSubSetArray( a ); } + public function dynSubGetArray() : Array { return EXTDCLASS.dynSubGetArray(); } + + + // The public method of the sub class. + public function pubSubSetArray( a:Array ) { EXTDCLASS.pubSubSetArray( a ); } + public function pubSubGetArray() : Array { return EXTDCLASS.pubSubGetArray(); } + + + // The private method of the sub class. Only one is used as we need to call only the + // test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivSubArray( a:Array ) : Array { return EXTDCLASS.testPrivSubArray( a ); } + + + // The static method of the sub class. + // This case is a negative case and will be put in the Error folder. + // public function statSubSetArray( a:Array ) { FinClassExtInternalClass.statSubSetArray( a ); } + // public function statSubGetArray() : Array { return FinClassExtInternalClass.statSubGetArray(); } + + // The STATIC class cannot be accessed by an object of the class, but has to be accessed + // by the class name itself. Bug filed for this: 108206 + // public function statSubSetArray( a:Array ) { EXTDCLASS.statSubSetArray( a ); } + // public function statSubGetArray() : Array { return EXTDCLASS.statSubGetArray(); } + + + // The final method of the sub class. + public function finSubSetArray( a : Array ) { EXTDCLASS.finSubSetArray( a ); } + public function finSubGetArray() : Array { return EXTDCLASS.finSubGetArray(); } + + + // The virtual method of the sub class. + public function virSubSetArray( a : Array ) { EXTDCLASS.virSubSetArray( a ); } + public function virSubGetArray() : Array { return EXTDCLASS.virSubGetArray(); } + + + + // The public dynamic method of the sub class. + public function pubDynSubSetArray( a:Array ) { EXTDCLASS.dynSubSetArray( a ); } + public function pubDynSubGetArray() : Array { return EXTDCLASS.pubDynSubGetArray(); } + + + // The public final method of the sub class. + public function pubFinSubSetArray( a : Array ) { EXTDCLASS.pubFinSubSetArray( a ); } + public function pubFinSubGetArray() : Array { return EXTDCLASS.pubFinSubGetArray(); } + + + // The public virtual method of the sub class. + public function pubVirSubSetArray( a : Array ) { EXTDCLASS.pubVirSubSetArray( a ); } + public function pubVirSubGetArray() : Array { return EXTDCLASS.pubVirSubGetArray(); } + + + + // The dynamic private method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivDynSubArray( a:Array ) : Array { return EXTDCLASS.testPrivDynSubArray( a ); } + + + // The dynamic final method of the sub class. + public function dynFinSubSetArray( a : Array ) { EXTDCLASS.dynFinSubSetArray( a ); } + public function dynFinSubGetArray() : Array { return EXTDCLASS.dynFinSubGetArray(); } + + + // The dynamic virtual method of the sub class. + public function dynVirSubSetArray( a : Array ) { EXTDCLASS.dynVirSubSetArray( a ); } + public function dynVirSubGetArray() : Array { return EXTDCLASS.dynVirSubGetArray(); } + + + + // The final private method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivFinSubArray( a:Array ) : Array { return EXTDCLASS.testPrivFinSubArray( a ); } + + + + // The private static method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + // This case is a negative case and will be put in the Error folder. + public function testPrivStatSubArray( a:Array ) : Array { return EXTDCLASS.testPrivStatSubArray( a ); } + + + + // The private virtual method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivVirSubArray( a:Array ) : Array { return EXTDCLASS.testPrivVirSubArray( a ); } + + + // The default property being accessed by the different method attributes. + // The default method attribute. + public function subSetDPArray( a:Array ) { EXTDCLASS.subSetDPArray(a); } + public function subGetDPArray() : Array { return EXTDCLASS.subGetDPArray(); } + + + // The dynamic method attribute. + public function dynSubSetDPArray( a:Array ) { EXTDCLASS.dynSubSetDPArray(a); } + public function dynSubGetDPArray() : Array { return EXTDCLASS.dynSubGetDPArray(); } + + + // The public method attribute. + public function pubSubSetDPArray( a:Array ) { EXTDCLASS.pubSubSetDPArray(a); } + public function pubSubGetDPArray() : Array { return EXTDCLASS.pubSubGetDPArray(); } + + + // The private method attribute. + public function testPrivSubDPArray( a:Array ):Array { return EXTDCLASS.testPrivSubDPArray(a) } + + // the static method attribute. + public function statSubSetDPArray( a:Array ) { FinExtInternalClass.statSubSetDPArray(a); } + public function statSubGetDPArray() : Array { return FinExtInternalClass.statSubGetDPArray(); } + + + // the final method attribute. + public function finSubSetDPArray( a:Array ) { EXTDCLASS.finSubSetDPArray(a); } + public function finSubGetDPArray() : Array { return EXTDCLASS.finSubGetDPArray(); } + + + // the virtual method attribute. + public function virSubSetDPArray( a:Array ) { EXTDCLASS.virSubSetDPArray(a); } + public function virSubGetDPArray() : Array { return EXTDCLASS.virSubGetDPArray(); } + + + // the public static method attrbute. + public function pubStatSubSetDPArray( a:Array ) { FinExtInternalClass.pubStatSubSetDPArray(a); } + public function pubStatSubGetDPArray() : Array { return FinExtInternalClass.pubStatSubGetDPArray(); } + + + // the private static method attribute + public function testPrivStatSubDPArray( a:Array ) : Array { return EXTDCLASS.testPrivStatSubDPArray(a); } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtPublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtPublicClass.as new file mode 100644 index 00000000000..e70d8ee7740 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtPublicClass.as @@ -0,0 +1,185 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import PublicClass.*; + + +var SECTION = "Definitions\Ext"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Final Class Extends Public Class Default Methods"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +// Can't create an instance because it's not public +// Hence commenting out the lines where the class is initialized. +// var EXTDCLASS = new FinExtPublicClass(); + + +// Create an array variable which will define the test array to be used +// for the given output. +var arr = new Array(1, 2, 3); + + +// access default method from a default method of a sub class +AddTestCase( "*** Access default method from default method of sub class ***", 1, 1 ); +// AddTestCase( "subSetArray( arr ), subGetArray()", arr, ( subSetArray( arr ), subGetArray() ) ); + + +// access default method from a dynamic method of a sub class +AddTestCase( "*** Acess default method from dynamic method of sub class ***", 1, 1 ); +AddTestCase( "dynSubSetArray( arr ), dynSubGetArray()", arr, ( dynSubSetArray( arr ), dynSubGetArray()) ); + + +// access default method from a public method of a sub class +AddTestCase( "*** Access default method from public method of sub class ***", 1, 1 ); +AddTestCase( "pubSubSetArray( arr ), pubSubGetArray()", arr, ( pubSubSetArray( arr ), pubSubGetArray()) ); + + +// access default method from a private method of a sub class +AddTestCase( "*** Access default method from private method of sub class ***", 1, 1 ); +AddTestCase( "testPrivSubArray( arr )", arr, testPrivSubArray( arr ) ); + + +// access default method from a static method of a sub class +AddTestCase( "*** Access default method from static method of sub class ***", 1, 1 ); +AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 ); +// AddTestCase( "statSubSetArray( arr ), statSubGetArray()", arr, ( statSubSetArray( arr ), statSubGetArray() ) ); + + +// access default method from a final method of a sub class +AddTestCase( "*** Access default method from final method of sub class ***", 1, 1 ); +AddTestCase( "finSubSetArray( arr ), finSubGetArray()", arr, ( finSubSetArray( arr ), finSubGetArray() ) ); + + +// access default method from a virtual method of a sub class +AddTestCase( "*** Access default method from virtual method of sub class ***", 1, 1 ); +AddTestCase( "virSubSetArray( arr ), virSubSetArray()", arr, ( virSubSetArray( arr ), virSubGetArray() ) ); + + +// access default method from a public dynamic method of a sub class +AddTestCase( "*** Acess default method from public dynamic method of sub class ***", 1, 1 ); +AddTestCase( "pubDynSubSetArray( arr ), pubDynSubGetArray()", arr, ( pubDynSubSetArray( arr ), pubDynSubGetArray()) ); + + +// access default method from a public static method of a sub class +AddTestCase( "*** Access default method from public static method of sub class ***", 1, 1 ); +AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 ); +// AddTestCase( "pubStatSubSetArray( arr ), pubStatSubGetArray()", arr, ( pubStatSubSetArray( arr ), pubStatSubGetArray() ) ); + + +// access default method from a public final method of a sub class +AddTestCase( "*** Access default method from public final method of sub class ***", 1, 1 ); +AddTestCase( "pubFinSubSetArray( arr ), pubFinSubGetArray()", arr, ( pubFinSubSetArray( arr ), pubFinSubGetArray() ) ); + + +// access default method from a public virtual method of a sub class +AddTestCase( "*** Access default method from public virtual method of sub class ***", 1, 1 ); +AddTestCase( "pubVirSubSetArray( arr ), pubVirSubSetArray()", arr, ( pubVirSubSetArray( arr ), pubVirSubGetArray() ) ); + + +// access default method from a final private method of a sub class +AddTestCase( "*** Access default method from final private method of sub class ***", 1, 1 ); +AddTestCase( "testPrivFinSubArray( arr )", arr, testPrivFinSubArray( arr ) ); + + +// access default method from a final static method of a sub class +AddTestCase( "*** Access default method from final static method of sub class ***", 1, 1 ); +AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 ); +// AddTestCase( "finStatSubSetArray( arr ), finStatSubGetArray()", arr, ( finStatSubSetArray( arr ), finStatSubGetArray() ) ); + + +// access default method from a private static method of a sub class +AddTestCase( "*** Access default method from private static method of sub class ***", 1, 1 ); +AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 ); +// AddTestCase( "testPrivStatSubArray( arr )", arr, testPrivStatSubArray( arr ) ); + + +// access default method from a private virtual method of a sub class +AddTestCase( "*** Access default method from private virtual method of sub class ***", 1, 1 ); +AddTestCase( "testPrivVirSubArray( arr )", arr, testPrivVirSubArray( arr ) ); + + + +// access default property from outside the class +AddTestCase( "*** Access default property from outside the class ***", 1, 1 ); +AddTestCase( "array = arr", arr, (array = arr, array) ); + + +// access default property from a default method of a sub class +AddTestCase( "*** Access default property from default method of sub class ***", 1, 1 ); +AddTestCase( "subSetDPArray( arr ), subGetDPArray()", arr, ( subSetDPArray( arr ), subGetDPArray() ) ); + + +// access default property from a dynamic method of a sub class +AddTestCase( "*** Access default property from dynamic method of sub class ***", 1, 1 ); +AddTestCase( "dynSubSetDPArray( arr ), dynSubGetDPArray()", arr, ( dynSubSetDPArray( arr ), dynSubGetDPArray() ) ); + + +// access default property from a public method of a sub class +AddTestCase( "*** Access default property from public method of sub class ***", 1, 1 ); +AddTestCase( "pubSubSetDPArray( arr ), pubSubGetDPArray()", arr, ( pubSubSetDPArray( arr ), pubSubGetDPArray() ) ); + + +// access default property from a private method of a sub class +AddTestCase( "*** Access default property from private method of sub class ***", 1, 1 ); +AddTestCase( "testPrivSubDPArray( arr )", arr, testPrivSubDPArray( arr ) ); + + +// access default property from a static method of a sub class +AddTestCase( "*** Access default property from static method of sub class ***", 1, 1 ); +AddTestCase( "statSubSetDPArray( arr ), statSubGetDPArray()", arr, ( statSubSetDPArray( arr ), statSubGetDPArray() ) ); + + +// access default property from a final method of a sub class +AddTestCase( "*** Access default property from final method of sub class ***", 1, 1 ); +AddTestCase( "finSubSetDPArray( arr ), finSubGetDPArray()", arr, ( finSubSetDPArray( arr ), finSubGetDPArray() ) ); + + +// access default property from a private virtual method of a sub class +AddTestCase( "*** Access default property from private virtual method of sub class ***", 1, 1 ); +AddTestCase( "virSubSetDPArray( arr ), virSubGetDPArray()", arr, ( virSubSetDPArray( arr ), virSubGetDPArray() ) ); + + +// access default property from a public static method of a sub class +AddTestCase( "*** Access default property from public static method of sub class ***", 1, 1 ); +AddTestCase( "pubStatSubSetDPArray( arr ), pubStatSubGetDPArray()", arr, ( pubStatSubSetDPArray( arr ), pubStatSubGetDPArray() ) ); + + +// access default property from a private static method of a sub class +AddTestCase( "*** Access default property from private static method of sub class ***", 1, 1 ); +AddTestCase( "testPrivStatSubDPArray( arr )", arr, testPrivStatSubDPArray( arr ) ); + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtPublicClass/APublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtPublicClass/APublicClass.as new file mode 100644 index 00000000000..fb5e420c61c --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtPublicClass/APublicClass.as @@ -0,0 +1,262 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + public class PublicClass { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + //public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finMyFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray():Array { return finArray; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtPublicClass/FinExtPublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtPublicClass/FinExtPublicClass.as new file mode 100644 index 00000000000..7292642a172 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtPublicClass/FinExtPublicClass.as @@ -0,0 +1,407 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + import PublicClass.*; + + final class FinExtPublicClass extends PublicClass { + + // access default method of parent from default method of sub class + function subSetArray( a:Array ) { setArray( a ); } + function subGetArray() : Array { return getArray(); } + + + // access default method of parent from dynamic method of sub class + function dynSubSetArray( a:Array ) { setArray( a ); } + function dynSubGetArray() : Array { return getArray(); } + + + // access default method of parent from public method of sub class + public function pubSubSetArray( a:Array ) { setArray( a ); } + public function pubSubGetArray() : Array { return getArray(); } + + + // access default method of parent from static method of sub class + // This is an error case as a static method cannot access any other + // method except a static method and will be addressed in a seperate + // file in the Error folder. + // static function statSubSetArray( a:Array ) { setArray( a ); } + // static function statSubGetArray() : Array { return getArray(); } + + + // access default method of parent from final method of sub class + final function finSubSetArray( a:Array ) { setArray( a ); } + final function finSubGetArray() : Array { return getArray(); } + + + // access default method of parent from virtual method of sub class + virtual function virSubSetArray( a:Array ) { setArray( a ); } + virtual function virSubGetArray() : Array { return getArray(); } + + + // access default method of parent from private method of sub class + private function privSubSetArray( a:Array ) { setArray( a ); } + private function privSubGetArray() : Array { return getArray(); } + + // function to test above using a public function within the class + // this function will be accessible to an object of the class. + public function testPrivSubArray( a:Array ) : Array { + this.privSubSetArray( a ); + return this.privSubGetArray(); + } + + + + // access default method of parent from public dynamic method of sub class + public function pubDynSubSetArray( a:Array ) { setArray( a ); } + public function pubDynSubGetArray() : Array { return getArray(); } + + + // access default method of parent from public static method of sub class + // This is an error case as a static method cannot access any other + // method except a static method and will be addressed in a seperate + // file in the Error folder. + // public static function pubStatSubSetArray( a:Array ) { setArray( a ); } + // public static function pubStatSubGetArray() : Array { return getArray(); } + + + // access default method of parent from public final method of sub class + public final function pubFinSubSetArray( a:Array ) { setArray( a ); } + final public function pubFinSubGetArray() : Array { return getArray(); } + + + // access default method of parent from public virtual method of sub class + public virtual function pubVirSubSetArray( a:Array ) { setArray( a ); } + virtual public function pubVirSubGetArray() : Array { return getArray(); } + + + // access default method of parent from dynamic static method of sub class + // This is an error case as a static method cannot access any other + // method except a static method and will be addressed in a seperate + // file in the Error folder. + // dynamic static function dynStatSubSetArray( a:Array ) { setArray( a ); } + // dynamic static function dynStatSubGetArray() : Array { return getArray(); } + + + // access default method of parent from dynamic final method of sub class + final function dynFinSubSetArray( a:Array ) { setArray( a ); } + final function dynFinSubGetArray() : Array { return getArray(); } + + + // access default method of parent from dynamic virtual method of sub class + virtual function dynVirSubSetArray( a:Array ) { setArray( a ); } + virtual function dynVirSubGetArray() : Array { return getArray(); } + + + // access default method of parent from dynamic private method of sub class + private function dynPrivSubSetArray( a:Array ) { setArray( a ); } + private function dynPrivSubGetArray() : Array { return getArray(); } + + // function to test above from test scripts + public function testPrivDynSubArray( a:Array ) : Array { + this.dynPrivSubSetArray( a ); + return this.dynPrivSubGetArray(); + } + + + // access default method of parent from final static method of sub class + // This is an error case as a static method cannot access any other + // method except a static method and will be addressed in a seperate + // file in the Error folder. + // final static function finStatSubSetArray( a:Array ) { setArray( a ); } + // static final function finStatSubGetArray() : Array { return getArray(); } + + + // access default method of parent from final virtual method of sub class + // This is an invalid case and compiler should report that a function cannot + // be both final and virtual. + // This case will be moved to the negative test cases - Error folder. + // final virtual function finVirSubSetArray( a:Array ) { setArray( a ); } + // virtual final function finVirSubGetArray() : Array { return getArray(); } + + + // access default method of parent from final private method of sub class + final private function finPrivSubSetArray( a:Array ) { setArray( a ); } + private final function finPrivSubGetArray() : Array { return getArray(); } + + // function to test above from test scripts + public function testPrivFinSubArray( a:Array ) : Array { + this.finPrivSubSetArray( a ); + return this.finPrivSubGetArray(); + } + + + // access default method of parent from private static method of sub class + // This is an error case as a static method cannot access any other + // method except a static method and will be addressed in a seperate + // file in the Error folder. + private static function privStatSubSetArray( a:Array ) { setArray( a ); } + static private function privStatSubGetArray() : Array { return getArray(); } + + // function to test above from test scripts + public function testPrivStatSubArray( a:Array ) : Array { + this.privStatSubSetArray( a ); + return this.privStatSubGetArray(); + } + + + // access default method of parent from private virtual method of sub class + private virtual function privVirSubSetArray( a:Array ) { setArray( a ); } + virtual private function privVirSubGetArray() : Array { return getArray(); } + + // function to test above from test scripts + public function testPrivVirSubArray( a:Array ) : Array { + this.privVirSubSetArray( a ); + return this.privVirSubGetArray(); + } + + // access default method of parent from virtual static method of sub class + // This is an invalid case as a function cannot be both virtual and static. + // This test case will be moved to the Error folder as a negative test case. + // virtual static function virStatSubSetArray( a:Array ) { setArray( a ); } + // static virtual function virStatSubGetArray() : Array { return getArray(); } + + + + // access default property from default method of sub class + function subSetDPArray( a:Array ) { array = a; } + function subGetDPArray() : Array { return array; } + + + // access default property from dynamic method of sub class. + function dynSubSetDPArray( a:Array ) { array = a; } + function dynSubGetDPArray() : Array { return array; } + + + // access default property from public method of sub class + public function pubSubSetDPArray( a:Array ) { array = a; } + public function pubSubGetDPArray() : Array { return array; } + + + // access default property from private method of sub class + private function privSubSetDPArray( a:Array ) { array = a; } + private function privSubGetDPArray() : Array { return array; } + + // public accessor for the above given private functions, + // so that these can be accessed from an object of the class + public function testPrivSubDPArray( a:Array ) : Array { + privSubSetDPArray( a ); + return privSubGetDPArray(); + } + + + // access default property from static method of sub class + static function statSubSetDPArray( a:Array ) { array = a; } + static function statSubGetDPArray() : Array { return array; } + + + // access default property from final method of sub class + final function finSubSetDPArray( a:Array ) { array = a; } + final function finSubGetDPArray() : Array { return array; } + + + // access default property from virtual method of sub class + virtual function virSubSetDPArray( a:Array ) { array = a; } + virtual function virSubGetDPArray() : Array { return array; } + + + // access default property from public static method of sub class + public static function pubStatSubSetDPArray( a:Array ) { array = a; } + public static function pubStatSubGetDPArray() : Array { return array; } + + + // access default property from private static method of sub class + private static function privStatSubSetDPArray( a:Array ) { array = a; } + private static function privStatSubGetDPArray() : Array { return array; } + + // public accessor for the above given private functions, + // so that these can be accessed from an object of the class + public function testPrivStatSubDPArray( a:Array ) : Array { + privStatSubSetDPArray( a ); + return privStatSubGetDPArray(); + } + + } + + + // Create an instance of the final class in the package. + // This object will be used for accessing the methods created + // within the sub class given above. + var EXTDCLASS = new FinExtPublicClass(); + + // Create a series of public functions that call the methods. + // The same names can be used as used in the class; because we are now + // outside of the class definition. + + // The default method of the sub class. + public function subSetArray( a:Array ) { EXTDCLASS.subSetArray( a ); } + public function subGetArray() : Array { return EXTDCLASS.subGetArray(); } + + + // The dynamic method of the sub class. + public function dynSubSetArray( a:Array ) { EXTDCLASS.dynSubSetArray( a ); } + public function dynSubGetArray() : Array { return EXTDCLASS.dynSubGetArray(); } + + + // The public method of the sub class. + public function pubSubSetArray( a:Array ) { EXTDCLASS.pubSubSetArray( a ); } + public function pubSubGetArray() : Array { return EXTDCLASS.pubSubGetArray(); } + + + // The private method of the sub class. Only one is used as we need to call only the + // test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivSubArray( a:Array ) : Array { return EXTDCLASS.testPrivSubArray( a ); } + + + // The static method of the sub class. + // This case is a negative case and will be put in the Error folder. + // public function statSubSetArray( a:Array ) { FinClassExtDefaultClass.statSubSetArray( a ); } + // public function statSubGetArray() : Array { return FinClassExtDefaultClass.statSubGetArray(); } + + // The STATIC class cannot be accessed by an object of the class, but has to be accessed + // by the class name itself. Bug filed for this: 108206 + // public function statSubSetArray( a:Array ) { EXTDCLASS.statSubSetArray( a ); } + // public function statSubGetArray() : Array { return EXTDCLASS.statSubGetArray(); } + + + // The final method of the sub class. + public function finSubSetArray( a : Array ) { EXTDCLASS.finSubSetArray( a ); } + public function finSubGetArray() : Array { return EXTDCLASS.finSubGetArray(); } + + + // The virtual method of the sub class. + public function virSubSetArray( a : Array ) { EXTDCLASS.virSubSetArray( a ); } + public function virSubGetArray() : Array { return EXTDCLASS.virSubGetArray(); } + + + + // The public dynamic method of the sub class. + public function pubDynSubSetArray( a:Array ) { EXTDCLASS.dynSubSetArray( a ); } + public function pubDynSubGetArray() : Array { return EXTDCLASS.pubDynSubGetArray(); } + + + // The public final method of the sub class. + public function pubFinSubSetArray( a : Array ) { EXTDCLASS.pubFinSubSetArray( a ); } + public function pubFinSubGetArray() : Array { return EXTDCLASS.pubFinSubGetArray(); } + + + // The public virtual method of the sub class. + public function pubVirSubSetArray( a : Array ) { EXTDCLASS.pubVirSubSetArray( a ); } + public function pubVirSubGetArray() : Array { return EXTDCLASS.pubVirSubGetArray(); } + + + + // The dynamic private method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivDynSubArray( a:Array ) : Array { return EXTDCLASS.testPrivDynSubArray( a ); } + + + // The dynamic final method of the sub class. + public function dynFinSubSetArray( a : Array ) { EXTDCLASS.dynFinSubSetArray( a ); } + public function dynFinSubGetArray() : Array { return EXTDCLASS.dynFinSubGetArray(); } + + + // The dynamic virtual method of the sub class. + public function dynVirSubSetArray( a : Array ) { EXTDCLASS.dynVirSubSetArray( a ); } + public function dynVirSubGetArray() : Array { return EXTDCLASS.dynVirSubGetArray(); } + + + + // The final private method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivFinSubArray( a:Array ) : Array { return EXTDCLASS.testPrivFinSubArray( a ); } + + + + // The private static method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + // This case is a negative case and will be put in the Error folder. + public function testPrivStatSubArray( a:Array ) : Array { return EXTDCLASS.testPrivStatSubArray( a ); } + + + + // The private virtual method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivVirSubArray( a:Array ) : Array { return EXTDCLASS.testPrivVirSubArray( a ); } + + + // The default property being accessed by the different method attributes. + // The default method attribute. + public function subSetDPArray( a:Array ) { EXTDCLASS.subSetDPArray(a); } + public function subGetDPArray() : Array { return EXTDCLASS.subGetDPArray(); } + + + // The dynamic method attribute. + public function dynSubSetDPArray( a:Array ) { EXTDCLASS.dynSubSetDPArray(a); } + public function dynSubGetDPArray() : Array { return EXTDCLASS.dynSubGetDPArray(); } + + + // The public method attribute. + public function pubSubSetDPArray( a:Array ) { EXTDCLASS.pubSubSetDPArray(a); } + public function pubSubGetDPArray() : Array { return EXTDCLASS.pubSubGetDPArray(); } + + + // The private method attribute. + public function testPrivSubDPArray( a:Array ):Array { return EXTDCLASS.testPrivSubDPArray(a) } + + // the static method attribute. + public function statSubSetDPArray( a:Array ) { FinExtPublicClass.statSubSetDPArray(a); } + public function statSubGetDPArray() : Array { return FinExtPublicClass.statSubGetDPArray(); } + + + // the final method attribute. + public function finSubSetDPArray( a:Array ) { EXTDCLASS.finSubSetDPArray(a); } + public function finSubGetDPArray() : Array { return EXTDCLASS.finSubGetDPArray(); } + + + // the virtual method attribute. + public function virSubSetDPArray( a:Array ) { EXTDCLASS.virSubSetDPArray(a); } + public function virSubGetDPArray() : Array { return EXTDCLASS.virSubGetDPArray(); } + + + // the public static method attrbute. + public function pubStatSubSetDPArray( a:Array ) { FinExtPublicClass.pubStatSubSetDPArray(a); } + public function pubStatSubGetDPArray() : Array { return FinExtPublicClass.pubStatSubGetDPArray(); } + + + // the private static method attribute + public function testPrivStatSubDPArray( a:Array ) : Array { return EXTDCLASS.testPrivStatSubDPArray(a); } + + } + +//public class FinExtPublicClass extends FinExtPublicClassInner {} + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtPublicClassFin.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtPublicClassFin.as new file mode 100644 index 00000000000..40696b42693 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtPublicClassFin.as @@ -0,0 +1,192 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import PublicClass.*; + + +var SECTION = "Definitions\Ext"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Final Class Extends Public Class Final Methods"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + +// Can't create an instance because it's not public +// Hence commenting out the lines where the class is initialized. +// var EXTDCLASS = new FinExtDefaultClassPub(); + + +// Create an array variable which will define the test array to be used +// for the given output. +var arr = new Array(1, 2, 3); + + +// access final method from a default method of a sub class +AddTestCase( "*** Access default method from default method of sub class ***", 1, 1 ); +AddTestCase( "subSetArray( arr ), subGetArray()", arr, ( subSetArray( arr ), subGetArray() ) ); + + +// access final method from a dynamic method of a sub class +AddTestCase( "*** Acess default method from dynamic method of sub class ***", 1, 1 ); +AddTestCase( "dynSubSetArray( arr ), dynSubGetArray()", arr, ( dynSubSetArray( arr ), dynSubGetArray()) ); + + +// access final method from a public method of a sub class +AddTestCase( "*** Access default method from public method of sub class ***", 1, 1 ); +AddTestCase( "pubSubSetArray( arr ), pubSubGetArray()", arr, ( pubSubSetArray( arr ), pubSubGetArray()) ); + + +// access final method from a private method of a sub class +AddTestCase( "*** Access default method from private method of sub class ***", 1, 1 ); +AddTestCase( "testPrivSubArray( arr )", arr, testPrivSubArray( arr ) ); + + +// access final method from a static method of a sub class +AddTestCase( "*** Access default method from static method of sub class ***", 1, 1 ); +AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 ); +// AddTestCase( "statSubSetArray( arr ), statSubGetArray()", arr, ( statSubSetArray( arr ), statSubGetArray() ) ); + + +// access final method from a final method of a sub class +AddTestCase( "*** Access default method from final method of sub class ***", 1, 1 ); +AddTestCase( "finSubSetArray( arr ), finSubGetArray()", arr, ( finSubSetArray( arr ), finSubGetArray() ) ); + + +// access final method from a virtual method of a sub class +AddTestCase( "*** Access default method from virtual method of sub class ***", 1, 1 ); +AddTestCase( "virSubSetArray( arr ), virSubSetArray()", arr, ( virSubSetArray( arr ), virSubGetArray() ) ); + + +// access final method from a public dynamic method of a sub class +AddTestCase( "*** Acess default method from public dynamic method of sub class ***", 1, 1 ); +AddTestCase( "pubDynSubSetArray( arr ), pubDynSubGetArray()", arr, ( pubDynSubSetArray( arr ), pubDynSubGetArray()) ); + + +// access final method from a public static method of a sub class +AddTestCase( "*** Access default method from public static method of sub class ***", 1, 1 ); +AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 ); +// AddTestCase( "pubStatSubSetArray( arr ), pubStatSubGetArray()", arr, ( pubStatSubSetArray( arr ), pubStatSubGetArray() ) ); + + +// access final method from a public final method of a sub class +AddTestCase( "*** Access default method from public final method of sub class ***", 1, 1 ); +AddTestCase( "pubFinSubSetArray( arr ), pubFinSubGetArray()", arr, ( pubFinSubSetArray( arr ), pubFinSubGetArray() ) ); + + +// access final method from a public virtual method of a sub class +AddTestCase( "*** Access default method from public virtual method of sub class ***", 1, 1 ); +AddTestCase( "pubVirSubSetArray( arr ), pubVirSubSetArray()", arr, ( pubVirSubSetArray( arr ), pubVirSubGetArray() ) ); + + +// access final method from a final private method of a sub class +AddTestCase( "*** Access default method from final private method of sub class ***", 1, 1 ); +AddTestCase( "testPrivFinSubArray( arr )", arr, testPrivFinSubArray( arr ) ); + + +// access final method from a final static method of a sub class +AddTestCase( "*** Access default method from final static method of sub class ***", 1, 1 ); +AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 ); +// AddTestCase( "finStatSubSetArray( arr ), finStatSubGetArray()", arr, ( finStatSubSetArray( arr ), finStatSubGetArray() ) ); + + +// access final method from a private static method of a sub class +AddTestCase( "*** Access default method from private static method of sub class ***", 1, 1 ); +AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 ); +// AddTestCase( "testPrivStatSubArray( arr )", arr, testPrivStatSubArray( arr ) ); + + +// access final method from a private virtual method of a sub class +AddTestCase( "*** Access default method from private virtual method of sub class ***", 1, 1 ); +AddTestCase( "testPrivVirSubArray( arr )", arr, testPrivVirSubArray( arr ) ); + + +// access final property from outside the class +AddTestCase( "*** Access final from outside the class ***", 1, 1 ); +AddTestCase( "finArray = arr", arr, (finArray = arr, finArray) ); + + +// fill in the rest of the cases here + +// access final property from outside the class +AddTestCase( "*** Access default property from outside the class ***", 1, 1 ); +AddTestCase( "array = arr", arr, (array = arr, array) ); + + +// access final property from a default method of a sub class +AddTestCase( "*** Access default property from default method of sub class ***", 1, 1 ); +AddTestCase( "subSetDPArray( arr ), subGetDPArray()", arr, ( subSetDPArray( arr ), subGetDPArray() ) ); + + +// access final property from a dynamic method of a sub class +AddTestCase( "*** Access default property from dynamic method of sub class ***", 1, 1 ); +AddTestCase( "dynSubSetDPArray( arr ), dynSubGetDPArray()", arr, ( dynSubSetDPArray( arr ), dynSubGetDPArray() ) ); + + +// access final property from a public method of a sub class +AddTestCase( "*** Access default property from public method of sub class ***", 1, 1 ); +AddTestCase( "pubSubSetDPArray( arr ), pubSubGetDPArray()", arr, ( pubSubSetDPArray( arr ), pubSubGetDPArray() ) ); + + +// access final property from a private method of a sub class +AddTestCase( "*** Access default property from private method of sub class ***", 1, 1 ); +AddTestCase( "testPrivSubDPArray( arr )", arr, testPrivSubDPArray( arr ) ); + + +// access final property from a static method of a sub class +AddTestCase( "*** Access default property from static method of sub class ***", 1, 1 ); +AddTestCase( "statSubSetDPArray( arr ), statSubGetDPArray()", arr, ( statSubSetDPArray( arr ), statSubGetDPArray() ) ); + + +// access final property from a final method of a sub class +AddTestCase( "*** Access default property from final method of sub class ***", 1, 1 ); +AddTestCase( "finSubSetDPArray( arr ), finSubGetDPArray()", arr, ( finSubSetDPArray( arr ), finSubGetDPArray() ) ); + + +// access final property from a private virtual method of a sub class +AddTestCase( "*** Access default property from private virtual method of sub class ***", 1, 1 ); +AddTestCase( "virSubSetDPArray( arr ), virSubGetDPArray()", arr, ( virSubSetDPArray( arr ), virSubGetDPArray() ) ); + + +// access final property from a public static method of a sub class +AddTestCase( "*** Access default property from public static method of sub class ***", 1, 1 ); +AddTestCase( "pubStatSubSetDPArray( arr ), pubStatSubGetDPArray()", arr, ( pubStatSubSetDPArray( arr ), pubStatSubGetDPArray() ) ); + + +// access final property from a private static method of a sub class +AddTestCase( "*** Access default property from private static method of sub class ***", 1, 1 ); +AddTestCase( "testPrivStatSubDPArray( arr )", arr, testPrivStatSubDPArray( arr ) ); + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtPublicClassFin/APublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtPublicClassFin/APublicClass.as new file mode 100644 index 00000000000..fb5e420c61c --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtPublicClassFin/APublicClass.as @@ -0,0 +1,262 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + public class PublicClass { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + //public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finMyFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray():Array { return finArray; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtPublicClassFin/FinExtPublicClassFin.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtPublicClassFin/FinExtPublicClassFin.as new file mode 100644 index 00000000000..3d62dc134aa --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtPublicClassFin/FinExtPublicClassFin.as @@ -0,0 +1,410 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + import PublicClass.*; + + final class FinExtPublicClassFin extends PublicClass { + + // access final method of parent from default method of sub class + function subSetArray( a:Array ) { setFinArray( a ); } + function subGetArray() : Array { return getFinArray(); } + + + // access final method of parent from dynamic method of sub class + function dynSubSetArray( a:Array ) { setFinArray( a ); } + function dynSubGetArray() : Array { return getFinArray(); } + + + // access final method of parent from public method of sub class + public function pubSubSetArray( a:Array ) { setFinArray( a ); } + public function pubSubGetArray() : Array { return getFinArray(); } + + + // access final method of parent from static method of sub class + // This is an error case as a static method cannot access any other + // method except a static method and will be addressed in a seperate + // file in the Error folder. + // static function statSubSetArray( a:Array ) { setFinArray( a ); } + // static function statSubGetArray() : Array { return getFinArray(); } + + + // access final method of parent from final method of sub class + final function finSubSetArray( a:Array ) { setFinArray( a ); } + final function finSubGetArray() : Array { return getFinArray(); } + + + // access final method of parent from virtual method of sub class + virtual function virSubSetArray( a:Array ) { setFinArray( a ); } + virtual function virSubGetArray() : Array { return getFinArray(); } + + + // access final method of parent from private method of sub class + private function privSubSetArray( a:Array ) { setFinArray( a ); } + private function privSubGetArray() : Array { return getFinArray(); } + + // function to test above using a public function within the class + // this function will be accessible to an object of the class. + public function testPrivSubArray( a:Array ) : Array { + this.privSubSetArray( a ); + return this.privSubGetArray(); + } + + + + // access final method of parent from public dynamic method of sub class + public function pubDynSubSetArray( a:Array ) { setFinArray( a ); } + public function pubDynSubGetArray() : Array { return getFinArray(); } + + + // access final method of parent from public static method of sub class + // This is an error case as a static method cannot access any other + // method except a static method and will be addressed in a seperate + // file in the Error folder. + // public static function pubStatSubSetArray( a:Array ) { setFinArray( a ); } + // public static function pubStatSubGetArray() : Array { return getFinArray(); } + + + // access final method of parent from public final method of sub class + public final function pubFinSubSetArray( a:Array ) { setFinArray( a ); } + final public function pubFinSubGetArray() : Array { return getFinArray(); } + + + // access final method of parent from public virtual method of sub class + public virtual function pubVirSubSetArray( a:Array ) { setFinArray( a ); } + virtual public function pubVirSubGetArray() : Array { return getFinArray(); } + + + // access final method of parent from dynamic static method of sub class + // This is an error case as a static method cannot access any other + // method except a static method and will be addressed in a seperate + // file in the Error folder. + // dynamic static function dynStatSubSetArray( a:Array ) { setFinArray( a ); } + // dynamic static function dynStatSubGetArray() : Array { return getFinArray(); } + + + // access final method of parent from dynamic final method of sub class + final function dynFinSubSetArray( a:Array ) { setFinArray( a ); } + final function dynFinSubGetArray() : Array { return getFinArray(); } + + + // access final method of parent from dynamic virtual method of sub class + virtual function dynVirSubSetArray( a:Array ) { setFinArray( a ); } + virtual function dynVirSubGetArray() : Array { return getFinArray(); } + + + // access final method of parent from dynamic private method of sub class + private function dynPrivSubSetArray( a:Array ) { setFinArray( a ); } + private function dynPrivSubGetArray() : Array { return getFinArray(); } + + // function to test above from test scripts + public function testPrivDynSubArray( a:Array ) : Array { + this.dynPrivSubSetArray( a ); + return this.dynPrivSubGetArray(); + } + + + // access final method of parent from final static method of sub class + // This is an error case as a static method cannot access any other + // method except a static method and will be addressed in a seperate + // file in the Error folder. + // final static function finStatSubSetArray( a:Array ) { setFinArray( a ); } + // static final function finStatSubGetArray() : Array { return getFinArray(); } + + + // access final method of parent from final virtual method of sub class + // This is an invalid case and compiler should report that a function cannot + // be both final and virtual. + // This case will be moved to the negative test cases - Error folder. + // final virtual function finVirSubSetArray( a:Array ) { setFinArray( a ); } + // virtual final function finVirSubGetArray() : Array { return getFinArray(); } + + + // access final method of parent from final private method of sub class + final private function finPrivSubSetArray( a:Array ) { setFinArray( a ); } + private final function finPrivSubGetArray() : Array { return getFinArray(); } + + // function to test above from test scripts + public function testPrivFinSubArray( a:Array ) : Array { + this.finPrivSubSetArray( a ); + return this.finPrivSubGetArray(); + } + + + // access final method of parent from private static method of sub class + // This is an error case as a static method cannot access any other + // method except a static method and will be addressed in a seperate + // file in the Error folder. + private static function privStatSubSetArray( a:Array ) { setFinArray( a ); } + static private function privStatSubGetArray() : Array { return getFinArray(); } + + // function to test above from test scripts + public function testPrivStatSubArray( a:Array ) : Array { + this.privStatSubSetArray( a ); + return this.privStatSubGetArray(); + } + + + // access final method of parent from private virtual method of sub class + private virtual function privVirSubSetArray( a:Array ) { setFinArray( a ); } + virtual private function privVirSubGetArray() : Array { return getFinArray(); } + + // function to test above from test scripts + public function testPrivVirSubArray( a:Array ) : Array { + this.privVirSubSetArray( a ); + return this.privVirSubGetArray(); + } + + + + // access final method of parent from virtual static method of sub class + // This is an invalid case as a function cannot be both virtual and static. + // This test case will be moved to the Error folder as a negative test case. + // virtual static function virStatSubSetArray( a:Array ) { setFinArray( a ); } + // static virtual function virStatSubGetArray() : Array { return getFinArray(); } + + + + + // access final property from default method of sub class + function subSetDPArray( a:Array ) { finArray = a; } + function subGetDPArray() : Array { return finArray; } + + + // access final property from dynamic method of sub class. + function dynSubSetDPArray( a:Array ) { finArray = a; } + function dynSubGetDPArray() : Array { return finArray; } + + + // access final property from public method of sub class + public function pubSubSetDPArray( a:Array ) { finArray = a; } + public function pubSubGetDPArray() : Array { return finArray; } + + + // access final property from private method of sub class + private function privSubSetDPArray( a:Array ) { finArray = a; } + private function privSubGetDPArray() : Array { return finArray; } + + // public accessor for the above given private functions, + // so that these can be accessed from an object of the class + public function testPrivSubDPArray( a:Array ) : Array { + privSubSetDPArray( a ); + return privSubGetDPArray(); + } + + + // access final property from static method of sub class + static function statSubSetDPArray( a:Array ) { finArray = a; } + static function statSubGetDPArray() : Array { return finArray; } + + + // access final property from final method of sub class + final function finSubSetDPArray( a:Array ) { finArray = a; } + final function finSubGetDPArray() : Array { return finArray; } + + + // access final property from virtual method of sub class + virtual function virSubSetDPArray( a:Array ) { finArray = a; } + virtual function virSubGetDPArray() : Array { return finArray; } + + + // access final property from public static method of sub class + public static function pubStatSubSetDPArray( a:Array ) { finArray = a; } + public static function pubStatSubGetDPArray() : Array { return finArray; } + + + // access final property from private static method of sub class + private static function privStatSubSetDPArray( a:Array ) { finArray = a; } + private static function privStatSubGetDPArray() : Array { return finArray; } + + // public accessor for the above given private functions, + // so that these can be accessed from an object of the class + public function testPrivStatSubDPArray( a:Array ) : Array { + privStatSubSetDPArray( a ); + return privStatSubGetDPArray(); + } + + } + + + // Create an instance of the final class in the package. + // This object will be used for accessing the methods created + // within the sub class given above. + var EXTDCLASS = new FinExtPublicClassFin(); + + // Create a series of public functions that call the methods. + // The same names can be used as used in the class; because we are now + // outside of the class definition. + + // The default method of the sub class. + public function subSetArray( a:Array ) { EXTDCLASS.subSetArray( a ); } + public function subGetArray() : Array { return EXTDCLASS.subGetArray(); } + + + // The dynamic method of the sub class. + public function dynSubSetArray( a:Array ) { EXTDCLASS.dynSubSetArray( a ); } + public function dynSubGetArray() : Array { return EXTDCLASS.dynSubGetArray(); } + + + // The public method of the sub class. + public function pubSubSetArray( a:Array ) { EXTDCLASS.pubSubSetArray( a ); } + public function pubSubGetArray() : Array { return EXTDCLASS.pubSubGetArray(); } + + + // The private method of the sub class. Only one is used as we need to call only the + // test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivSubArray( a:Array ) : Array { return EXTDCLASS.testPrivSubArray( a ); } + + + // The static method of the sub class. + // This case is a negative case and will be put in the Error folder. + // public function statSubSetArray( a:Array ) { FinClassExtDefaultClass.statSubSetArray( a ); } + // public function statSubGetArray() : Array { return FinClassExtDefaultClass.statSubGetArray(); } + + // The STATIC class cannot be accessed by an object of the class, but has to be accessed + // by the class name itself. Bug filed for this: 108206 + // public function statSubSetArray( a:Array ) { EXTDCLASS.statSubSetArray( a ); } + // public function statSubGetArray() : Array { return EXTDCLASS.statSubGetArray(); } + + + // The final method of the sub class. + public function finSubSetArray( a : Array ) { EXTDCLASS.finSubSetArray( a ); } + public function finSubGetArray() : Array { return EXTDCLASS.finSubGetArray(); } + + + // The virtual method of the sub class. + public function virSubSetArray( a : Array ) { EXTDCLASS.virSubSetArray( a ); } + public function virSubGetArray() : Array { return EXTDCLASS.virSubGetArray(); } + + + + // The public dynamic method of the sub class. + public function pubDynSubSetArray( a:Array ) { EXTDCLASS.dynSubSetArray( a ); } + public function pubDynSubGetArray() : Array { return EXTDCLASS.pubDynSubGetArray(); } + + + // The public final method of the sub class. + public function pubFinSubSetArray( a : Array ) { EXTDCLASS.pubFinSubSetArray( a ); } + public function pubFinSubGetArray() : Array { return EXTDCLASS.pubFinSubGetArray(); } + + + // The public virtual method of the sub class. + public function pubVirSubSetArray( a : Array ) { EXTDCLASS.pubVirSubSetArray( a ); } + public function pubVirSubGetArray() : Array { return EXTDCLASS.pubVirSubGetArray(); } + + + + // The dynamic private method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivDynSubArray( a:Array ) : Array { return EXTDCLASS.testPrivDynSubArray( a ); } + + + // The dynamic final method of the sub class. + public function dynFinSubSetArray( a : Array ) { EXTDCLASS.dynFinSubSetArray( a ); } + public function dynFinSubGetArray() : Array { return EXTDCLASS.dynFinSubGetArray(); } + + + // The dynamic virtual method of the sub class. + public function dynVirSubSetArray( a : Array ) { EXTDCLASS.dynVirSubSetArray( a ); } + public function dynVirSubGetArray() : Array { return EXTDCLASS.dynVirSubGetArray(); } + + + + // The final private method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivFinSubArray( a:Array ) : Array { return EXTDCLASS.testPrivFinSubArray( a ); } + + + + // The private static method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + // This case is a negative case and will be put in the Error folder. + public function testPrivStatSubArray( a:Array ) : Array { return EXTDCLASS.testPrivStatSubArray( a ); } + + + + // The private virtual method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivVirSubArray( a:Array ) : Array { return EXTDCLASS.testPrivVirSubArray( a ); } + + + // The default property being accessed by the different method attributes. + // The default method attribute. + public function subSetDPArray( a:Array ) { EXTDCLASS.subSetDPArray(a); } + public function subGetDPArray() : Array { return EXTDCLASS.subGetDPArray(); } + + + // The dynamic method attribute. + public function dynSubSetDPArray( a:Array ) { EXTDCLASS.dynSubSetDPArray(a); } + public function dynSubGetDPArray() : Array { return EXTDCLASS.dynSubGetDPArray(); } + + + // The public method attribute. + public function pubSubSetDPArray( a:Array ) { EXTDCLASS.pubSubSetDPArray(a); } + public function pubSubGetDPArray() : Array { return EXTDCLASS.pubSubGetDPArray(); } + + + // The private method attribute. + public function testPrivSubDPArray( a:Array ):Array { return EXTDCLASS.testPrivSubDPArray(a) } + + // the static method attribute. + public function statSubSetDPArray( a:Array ) { FinExtPublicClassFin.statSubSetDPArray(a); } + public function statSubGetDPArray() : Array { return FinExtPublicClassFin.statSubGetDPArray(); } + + + // the final method attribute. + public function finSubSetDPArray( a:Array ) { EXTDCLASS.finSubSetDPArray(a); } + public function finSubGetDPArray() : Array { return EXTDCLASS.finSubGetDPArray(); } + + + // the virtual method attribute. + public function virSubSetDPArray( a:Array ) { EXTDCLASS.virSubSetDPArray(a); } + public function virSubGetDPArray() : Array { return EXTDCLASS.virSubGetDPArray(); } + + + // the public static method attrbute. + public function pubStatSubSetDPArray( a:Array ) { FinExtPublicClassFin.pubStatSubSetDPArray(a); } + public function pubStatSubGetDPArray() : Array { return FinExtPublicClassFin.pubStatSubGetDPArray(); } + + + // the private static method attribute + public function testPrivStatSubDPArray( a:Array ) : Array { return EXTDCLASS.testPrivStatSubDPArray(a); } + + } + + + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtPublicClassPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtPublicClassPub.as new file mode 100644 index 00000000000..015f73043f5 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtPublicClassPub.as @@ -0,0 +1,191 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import PublicClass.*; + + + +var SECTION = "Definitions\Ext"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Final Class Extends Public Class Public Methods"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +// Can't create an instance because it's not public +// Hence commenting out the lines where the class is initialized. +// var EXTDCLASS = new FinExtDefaultClassPub(); + +// Create an array variable which will define the test array to be used +// for the given output. +var arr = new Array(1, 2, 3); + + +// access default method from a default method of a sub class +AddTestCase( "*** Access default method from default method of sub class ***", 1, 1 ); +AddTestCase( "subSetArray( arr ), subGetArray()", arr, ( subSetArray( arr ), subGetArray() ) ); + + +// access default method from a dynamic method of a sub class +AddTestCase( "*** Acess default method from dynamic method of sub class ***", 1, 1 ); +AddTestCase( "dynSubSetArray( arr ), dynSubGetArray()", arr, ( dynSubSetArray( arr ), dynSubGetArray()) ); + + +// access default method from a public method of a sub class +AddTestCase( "*** Access default method from public method of sub class ***", 1, 1 ); +AddTestCase( "pubSubSetArray( arr ), pubSubGetArray()", arr, ( pubSubSetArray( arr ), pubSubGetArray()) ); + + +// access default method from a private method of a sub class +AddTestCase( "*** Access default method from private method of sub class ***", 1, 1 ); +AddTestCase( "testPrivSubArray( arr )", arr, testPrivSubArray( arr ) ); + + +// access default method from a static method of a sub class +AddTestCase( "*** Access default method from static method of sub class ***", 1, 1 ); +AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 ); +// AddTestCase( "statSubSetArray( arr ), statSubGetArray()", arr, ( statSubSetArray( arr ), statSubGetArray() ) ); + + +// access default method from a final method of a sub class +AddTestCase( "*** Access default method from final method of sub class ***", 1, 1 ); +AddTestCase( "finSubSetArray( arr ), finSubGetArray()", arr, ( finSubSetArray( arr ), finSubGetArray() ) ); + + +// access default method from a virtual method of a sub class +AddTestCase( "*** Access default method from virtual method of sub class ***", 1, 1 ); +AddTestCase( "virSubSetArray( arr ), virSubSetArray()", arr, ( virSubSetArray( arr ), virSubGetArray() ) ); + + +// access default method from a public dynamic method of a sub class +AddTestCase( "*** Acess default method from public dynamic method of sub class ***", 1, 1 ); +AddTestCase( "pubDynSubSetArray( arr ), pubDynSubGetArray()", arr, ( pubDynSubSetArray( arr ), pubDynSubGetArray()) ); + + +// access default method from a public static method of a sub class +AddTestCase( "*** Access default method from public static method of sub class ***", 1, 1 ); +AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 ); +// AddTestCase( "pubStatSubSetArray( arr ), pubStatSubGetArray()", arr, ( pubStatSubSetArray( arr ), pubStatSubGetArray() ) ); + + +// access default method from a public final method of a sub class +AddTestCase( "*** Access default method from public final method of sub class ***", 1, 1 ); +AddTestCase( "pubFinSubSetArray( arr ), pubFinSubGetArray()", arr, ( pubFinSubSetArray( arr ), pubFinSubGetArray() ) ); + + +// access default method from a public virtual method of a sub class +AddTestCase( "*** Access default method from public virtual method of sub class ***", 1, 1 ); +AddTestCase( "pubVirSubSetArray( arr ), pubVirSubSetArray()", arr, ( pubVirSubSetArray( arr ), pubVirSubGetArray() ) ); + + +// access default method from a final private method of a sub class +AddTestCase( "*** Access default method from final private method of sub class ***", 1, 1 ); +AddTestCase( "testPrivFinSubArray( arr )", arr, testPrivFinSubArray( arr ) ); + + +// access default method from a final static method of a sub class +AddTestCase( "*** Access default method from final static method of sub class ***", 1, 1 ); +AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 ); +// AddTestCase( "finStatSubSetArray( arr ), finStatSubGetArray()", arr, ( finStatSubSetArray( arr ), finStatSubGetArray() ) ); + + +// access default method from a private static method of a sub class +AddTestCase( "*** Access default method from private static method of sub class ***", 1, 1 ); +AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 ); +// AddTestCase( "testPrivStatSubArray( arr )", arr, testPrivStatSubArray( arr ) ); + + +// access default method from a private virtual method of a sub class +AddTestCase( "*** Access default method from private virtual method of sub class ***", 1, 1 ); +AddTestCase( "testPrivVirSubArray( arr )", arr, testPrivVirSubArray( arr ) ); + + +// access public property from outside the class +AddTestCase( "*** Access public property from outside the class ***", 1, 1 ); +AddTestCase( "pubArray = arr", arr, (pubArray = arr, pubArray) ); + + +// fill in the rest of the cases here + +// access public property from outside the class +AddTestCase( "*** Access default property from outside the class ***", 1, 1 ); +AddTestCase( "array = arr", arr, (array = arr, array) ); + + +// access public property from a default method of a sub class +AddTestCase( "*** Access default property from default method of sub class ***", 1, 1 ); +AddTestCase( "subSetDPArray( arr ), subGetDPArray()", arr, ( subSetDPArray( arr ), subGetDPArray() ) ); + + +// access public property from a dynamic method of a sub class +AddTestCase( "*** Access default property from dynamic method of sub class ***", 1, 1 ); +AddTestCase( "dynSubSetDPArray( arr ), dynSubGetDPArray()", arr, ( dynSubSetDPArray( arr ), dynSubGetDPArray() ) ); + + +// access public property from a public method of a sub class +AddTestCase( "*** Access default property from public method of sub class ***", 1, 1 ); +AddTestCase( "pubSubSetDPArray( arr ), pubSubGetDPArray()", arr, ( pubSubSetDPArray( arr ), pubSubGetDPArray() ) ); + + +// access public property from a private method of a sub class +AddTestCase( "*** Access default property from private method of sub class ***", 1, 1 ); +AddTestCase( "testPrivSubDPArray( arr )", arr, testPrivSubDPArray( arr ) ); + + +// access public property from a static method of a sub class +AddTestCase( "*** Access default property from static method of sub class ***", 1, 1 ); +AddTestCase( "statSubSetDPArray( arr ), statSubGetDPArray()", arr, ( statSubSetDPArray( arr ), statSubGetDPArray() ) ); + + +// access public property from a final method of a sub class +AddTestCase( "*** Access default property from final method of sub class ***", 1, 1 ); +AddTestCase( "finSubSetDPArray( arr ), finSubGetDPArray()", arr, ( finSubSetDPArray( arr ), finSubGetDPArray() ) ); + + +// access public property from a private virtual method of a sub class +AddTestCase( "*** Access default property from private virtual method of sub class ***", 1, 1 ); +AddTestCase( "virSubSetDPArray( arr ), virSubGetDPArray()", arr, ( virSubSetDPArray( arr ), virSubGetDPArray() ) ); + + +// access public property from a public static method of a sub class +AddTestCase( "*** Access default property from public static method of sub class ***", 1, 1 ); +AddTestCase( "pubStatSubSetDPArray( arr ), pubStatSubGetDPArray()", arr, ( pubStatSubSetDPArray( arr ), pubStatSubGetDPArray() ) ); + + +// access public property from a private static method of a sub class +AddTestCase( "*** Access default property from private static method of sub class ***", 1, 1 ); +AddTestCase( "testPrivStatSubDPArray( arr )", arr, testPrivStatSubDPArray( arr ) ); + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtPublicClassPub/APublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtPublicClassPub/APublicClass.as new file mode 100644 index 00000000000..fb5e420c61c --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtPublicClassPub/APublicClass.as @@ -0,0 +1,262 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + public class PublicClass { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + //public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finMyFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray():Array { return finArray; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtPublicClassPub/FinExtPublicClassPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtPublicClassPub/FinExtPublicClassPub.as new file mode 100644 index 00000000000..5db265d02c0 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtPublicClassPub/FinExtPublicClassPub.as @@ -0,0 +1,409 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + import PublicClass.*; + + final class FinExtPublicClassPub extends PublicClass { + + // access public method of parent from default method of sub class + function subSetArray( a:Array ) { setPubArray( a ); } + function subGetArray() : Array { return getPubArray(); } + + + // access public method of parent from dynamic method of sub class + function dynSubSetArray( a:Array ) { setPubArray( a ); } + function dynSubGetArray() : Array { return getPubArray(); } + + + // access public method of parent from public method of sub class + public function pubSubSetArray( a:Array ) { setPubArray( a ); } + public function pubSubGetArray() : Array { return getPubArray(); } + + + // access public method of parent from static method of sub class + // This is an error case as a static method cannot access any other + // method except a static method and will be addressed in a seperate + // file in the Error folder. + // static function statSubSetArray( a:Array ) { setPubArray( a ); } + // static function statSubGetArray() : Array { return getPubArray(); } + + + // access public method of parent from final method of sub class + final function finSubSetArray( a:Array ) { setPubArray( a ); } + final function finSubGetArray() : Array { return getPubArray(); } + + + // access public method of parent from virtual method of sub class + virtual function virSubSetArray( a:Array ) { setPubArray( a ); } + virtual function virSubGetArray() : Array { return getPubArray(); } + + + // access public method of parent from private method of sub class + private function privSubSetArray( a:Array ) { setPubArray( a ); } + private function privSubGetArray() : Array { return getPubArray(); } + + // function to test above using a public function within the class + // this function will be accessible to an object of the class. + public function testPrivSubArray( a:Array ) : Array { + this.privSubSetArray( a ); + return this.privSubGetArray(); + } + + + + // access public method of parent from public dynamic method of sub class + public function pubDynSubSetArray( a:Array ) { setPubArray( a ); } + public function pubDynSubGetArray() : Array { return getPubArray(); } + + + // access public method of parent from public static method of sub class + // This is an error case as a static method cannot access any other + // method except a static method and will be addressed in a seperate + // file in the Error folder. + // public static function pubStatSubSetArray( a:Array ) { setPubArray( a ); } + // public static function pubStatSubGetArray() : Array { return getPubArray(); } + + + // access public method of parent from public final method of sub class + public final function pubFinSubSetArray( a:Array ) { setPubArray( a ); } + final public function pubFinSubGetArray() : Array { return getPubArray(); } + + + // access public method of parent from public virtual method of sub class + public virtual function pubVirSubSetArray( a:Array ) { setPubArray( a ); } + virtual public function pubVirSubGetArray() : Array { return getPubArray(); } + + + // access public method of parent from dynamic static method of sub class + // This is an error case as a static method cannot access any other + // method except a static method and will be addressed in a seperate + // file in the Error folder. + // dynamic static function dynStatSubSetArray( a:Array ) { setPubArray( a ); } + // dynamic static function dynStatSubGetArray() : Array { return getPubArray(); } + + + // access public method of parent from dynamic final method of sub class + final function dynFinSubSetArray( a:Array ) { setPubArray( a ); } + final function dynFinSubGetArray() : Array { return getPubArray(); } + + + // access public method of parent from dynamic virtual method of sub class + virtual function dynVirSubSetArray( a:Array ) { setPubArray( a ); } + virtual function dynVirSubGetArray() : Array { return getPubArray(); } + + + // access public method of parent from dynamic private method of sub class + private function dynPrivSubSetArray( a:Array ) { setPubArray( a ); } + private function dynPrivSubGetArray() : Array { return getPubArray(); } + + // function to test above from test scripts + public function testPrivDynSubArray( a:Array ) : Array { + this.dynPrivSubSetArray( a ); + return this.dynPrivSubGetArray(); + } + + + // access public method of parent from final static method of sub class + // This is an error case as a static method cannot access any other + // method except a static method and will be addressed in a seperate + // file in the Error folder. + // final static function finStatSubSetArray( a:Array ) { setPubArray( a ); } + // static final function finStatSubGetArray() : Array { return getPubArray(); } + + + // access public method of parent from final virtual method of sub class + // This is an invalid case and compiler should report that a function cannot + // be both final and virtual. + // This case will be moved to the negative test cases - Error folder. + // final virtual function finVirSubSetArray( a:Array ) { setPubArray( a ); } + // virtual final function finVirSubGetArray() : Array { return getPubArray(); } + + + // access public method of parent from final private method of sub class + final private function finPrivSubSetArray( a:Array ) { setPubArray( a ); } + private final function finPrivSubGetArray() : Array { return getPubArray(); } + + // function to test above from test scripts + public function testPrivFinSubArray( a:Array ) : Array { + this.finPrivSubSetArray( a ); + return this.finPrivSubGetArray(); + } + + + // access public method of parent from private static method of sub class + // This is an error case as a static method cannot access any other + // method except a static method and will be addressed in a seperate + // file in the Error folder. + private static function privStatSubSetArray( a:Array ) { setPubArray( a ); } + static private function privStatSubGetArray() : Array { return getPubArray(); } + + // function to test above from test scripts + public function testPrivStatSubArray( a:Array ) : Array { + this.privStatSubSetArray( a ); + return this.privStatSubGetArray(); + } + + + // access public method of parent from private virtual method of sub class + private virtual function privVirSubSetArray( a:Array ) { setPubArray( a ); } + virtual private function privVirSubGetArray() : Array { return getPubArray(); } + + // function to test above from test scripts + public function testPrivVirSubArray( a:Array ) : Array { + this.privVirSubSetArray( a ); + return this.privVirSubGetArray(); + } + + + + // access public method of parent from virtual static method of sub class + // This is an invalid case as a function cannot be both virtual and static. + // This test case will be moved to the Error folder as a negative test case. + // virtual static function virStatSubSetArray( a:Array ) { setPubArray( a ); } + // static virtual function virStatSubGetArray() : Array { return getPubArray(); } + + + + // access default property from default method of sub class + function subSetDPArray( a:Array ) { pubArray = a; } + function subGetDPArray() : Array { return pubArray; } + + + // access default property from dynamic method of sub class. + function dynSubSetDPArray( a:Array ) { pubArray = a; } + function dynSubGetDPArray() : Array { return pubArray; } + + + // access default property from public method of sub class + public function pubSubSetDPArray( a:Array ) { pubArray = a; } + public function pubSubGetDPArray() : Array { return pubArray; } + + + // access default property from private method of sub class + private function privSubSetDPArray( a:Array ) { pubArray = a; } + private function privSubGetDPArray() : Array { return pubArray; } + + // public accessor for the above given private functions, + // so that these can be accessed from an object of the class + public function testPrivSubDPArray( a:Array ) : Array { + privSubSetDPArray( a ); + return privSubGetDPArray(); + } + + + // access default property from static method of sub class + static function statSubSetDPArray( a:Array ) { pubArray = a; } + static function statSubGetDPArray() : Array { return pubArray; } + + + // access default property from final method of sub class + final function finSubSetDPArray( a:Array ) { pubArray = a; } + final function finSubGetDPArray() : Array { return pubArray; } + + + // access default property from virtual method of sub class + virtual function virSubSetDPArray( a:Array ) { pubArray = a; } + virtual function virSubGetDPArray() : Array { return pubArray; } + + + // access default property from public static method of sub class + public static function pubStatSubSetDPArray( a:Array ) { pubArray = a; } + public static function pubStatSubGetDPArray() : Array { return pubArray; } + + + // access default property from private static method of sub class + private static function privStatSubSetDPArray( a:Array ) { pubArray = a; } + private static function privStatSubGetDPArray() : Array { return pubArray; } + + // public accessor for the above given private functions, + // so that these can be accessed from an object of the class + public function testPrivStatSubDPArray( a:Array ) : Array { + privStatSubSetDPArray( a ); + return privStatSubGetDPArray(); + } + + } + + + + // Create an instance of the final class in the package. + // This object will be used for accessing the methods created + // within the sub class given above. + var EXTDCLASS = new FinExtPublicClassPub(); + + // Create a series of public functions that call the methods. + // The same names can be used as used in the class; because we are now + // outside of the class definition. + + // The default method of the sub class. + public function subSetArray( a:Array ) { EXTDCLASS.subSetArray( a ); } + public function subGetArray() : Array { return EXTDCLASS.subGetArray(); } + + + // The dynamic method of the sub class. + public function dynSubSetArray( a:Array ) { EXTDCLASS.dynSubSetArray( a ); } + public function dynSubGetArray() : Array { return EXTDCLASS.dynSubGetArray(); } + + + // The public method of the sub class. + public function pubSubSetArray( a:Array ) { EXTDCLASS.pubSubSetArray( a ); } + public function pubSubGetArray() : Array { return EXTDCLASS.pubSubGetArray(); } + + + // The private method of the sub class. Only one is used as we need to call only the + // test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivSubArray( a:Array ) : Array { return EXTDCLASS.testPrivSubArray( a ); } + + + // The static method of the sub class. + // This case is a negative case and will be put in the Error folder. + // public function statSubSetArray( a:Array ) { FinClassExtDefaultClass.statSubSetArray( a ); } + // public function statSubGetArray() : Array { return FinClassExtDefaultClass.statSubGetArray(); } + + // The STATIC class cannot be accessed by an object of the class, but has to be accessed + // by the class name itself. Bug filed for this: 108206 + // public function statSubSetArray( a:Array ) { EXTDCLASS.statSubSetArray( a ); } + // public function statSubGetArray() : Array { return EXTDCLASS.statSubGetArray(); } + + + // The final method of the sub class. + public function finSubSetArray( a : Array ) { EXTDCLASS.finSubSetArray( a ); } + public function finSubGetArray() : Array { return EXTDCLASS.finSubGetArray(); } + + + // The virtual method of the sub class. + public function virSubSetArray( a : Array ) { EXTDCLASS.virSubSetArray( a ); } + public function virSubGetArray() : Array { return EXTDCLASS.virSubGetArray(); } + + + + // The public dynamic method of the sub class. + public function pubDynSubSetArray( a:Array ) { EXTDCLASS.dynSubSetArray( a ); } + public function pubDynSubGetArray() : Array { return EXTDCLASS.pubDynSubGetArray(); } + + + // The public final method of the sub class. + public function pubFinSubSetArray( a : Array ) { EXTDCLASS.pubFinSubSetArray( a ); } + public function pubFinSubGetArray() : Array { return EXTDCLASS.pubFinSubGetArray(); } + + + // The public virtual method of the sub class. + public function pubVirSubSetArray( a : Array ) { EXTDCLASS.pubVirSubSetArray( a ); } + public function pubVirSubGetArray() : Array { return EXTDCLASS.pubVirSubGetArray(); } + + + + // The dynamic private method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivDynSubArray( a:Array ) : Array { return EXTDCLASS.testPrivDynSubArray( a ); } + + + // The dynamic final method of the sub class. + public function dynFinSubSetArray( a : Array ) { EXTDCLASS.dynFinSubSetArray( a ); } + public function dynFinSubGetArray() : Array { return EXTDCLASS.dynFinSubGetArray(); } + + + // The dynamic virtual method of the sub class. + public function dynVirSubSetArray( a : Array ) { EXTDCLASS.dynVirSubSetArray( a ); } + public function dynVirSubGetArray() : Array { return EXTDCLASS.dynVirSubGetArray(); } + + + + // The final private method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivFinSubArray( a:Array ) : Array { return EXTDCLASS.testPrivFinSubArray( a ); } + + + + // The private static method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + // This case is a negative case and will be put in the Error folder. + public function testPrivStatSubArray( a:Array ) : Array { return EXTDCLASS.testPrivStatSubArray( a ); } + + + + // The private virtual method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivVirSubArray( a:Array ) : Array { return EXTDCLASS.testPrivVirSubArray( a ); } + + + // The default property being accessed by the different method attributes. + // The default method attribute. + public function subSetDPArray( a:Array ) { EXTDCLASS.subSetDPArray(a); } + public function subGetDPArray() : Array { return EXTDCLASS.subGetDPArray(); } + + + // The dynamic method attribute. + public function dynSubSetDPArray( a:Array ) { EXTDCLASS.dynSubSetDPArray(a); } + public function dynSubGetDPArray() : Array { return EXTDCLASS.dynSubGetDPArray(); } + + + // The public method attribute. + public function pubSubSetDPArray( a:Array ) { EXTDCLASS.pubSubSetDPArray(a); } + public function pubSubGetDPArray() : Array { return EXTDCLASS.pubSubGetDPArray(); } + + + // The private method attribute. + public function testPrivSubDPArray( a:Array ):Array { return EXTDCLASS.testPrivSubDPArray(a) } + + // the static method attribute. + public function statSubSetDPArray( a:Array ) { FinExtPublicClassPub.statSubSetDPArray(a); } + public function statSubGetDPArray() : Array { return FinExtPublicClassPub.statSubGetDPArray(); } + + + // the final method attribute. + public function finSubSetDPArray( a:Array ) { EXTDCLASS.finSubSetDPArray(a); } + public function finSubGetDPArray() : Array { return EXTDCLASS.finSubGetDPArray(); } + + + // the virtual method attribute. + public function virSubSetDPArray( a:Array ) { EXTDCLASS.virSubSetDPArray(a); } + public function virSubGetDPArray() : Array { return EXTDCLASS.virSubGetDPArray(); } + + + // the public static method attrbute. + public function pubStatSubSetDPArray( a:Array ) { FinExtPublicClassPub.pubStatSubSetDPArray(a); } + public function pubStatSubGetDPArray() : Array { return FinExtPublicClassPub.pubStatSubGetDPArray(); } + + + // the private static method attribute + public function testPrivStatSubDPArray( a:Array ) : Array { return EXTDCLASS.testPrivStatSubDPArray(a); } + + } + + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtPublicClassPubStat.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtPublicClassPubStat.as new file mode 100644 index 00000000000..a4ebfedabfd --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtPublicClassPubStat.as @@ -0,0 +1,186 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import PublicClass.*; + + +var SECTION = "Definitions\Ext"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Final Class Extends Public Class Public Static Methods"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + +// Can't create an instance because it's not public +// Hence commenting out the lines where the class is initialized. +// var EXTDCLASS = new FinExtDefaultClassPub(); + + +// Create an array variable which will define the test array to be used +// for the given output. +var arr = new Array(1, 2, 3); + + +// access default method from a default method of a sub class +AddTestCase( "*** Access default method from default method of sub class ***", 1, 1 ); +AddTestCase( "subSetArray( arr ), subGetArray()", arr, ( subSetArray( arr ), subGetArray() ) ); + + +// access default method from a dynamic method of a sub class +AddTestCase( "*** Acess default method from dynamic method of sub class ***", 1, 1 ); +AddTestCase( "dynSubSetArray( arr ), dynSubGetArray()", arr, ( dynSubSetArray( arr ), dynSubGetArray()) ); + + +// access default method from a public method of a sub class +AddTestCase( "*** Access default method from public method of sub class ***", 1, 1 ); +AddTestCase( "pubSubSetArray( arr ), pubSubGetArray()", arr, ( pubSubSetArray( arr ), pubSubGetArray()) ); + + +// access default method from a private method of a sub class +AddTestCase( "*** Access default method from private method of sub class ***", 1, 1 ); +AddTestCase( "testPrivSubArray( arr )", arr, testPrivSubArray( arr ) ); + + +// access default method from a static method of a sub class +AddTestCase( "*** Access default method from static method of sub class ***", 1, 1 ); +AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 ); +// AddTestCase( "statSubSetArray( arr ), statSubGetArray()", arr, ( statSubSetArray( arr ), statSubGetArray() ) ); + + +// access default method from a final method of a sub class +AddTestCase( "*** Access default method from final method of sub class ***", 1, 1 ); +AddTestCase( "finSubSetArray( arr ), finSubGetArray()", arr, ( finSubSetArray( arr ), finSubGetArray() ) ); + + +// access default method from a virtual method of a sub class +AddTestCase( "*** Access default method from virtual method of sub class ***", 1, 1 ); +AddTestCase( "virSubSetArray( arr ), virSubSetArray()", arr, ( virSubSetArray( arr ), virSubGetArray() ) ); + + +// access default method from a public dynamic method of a sub class +AddTestCase( "*** Acess default method from public dynamic method of sub class ***", 1, 1 ); +AddTestCase( "pubDynSubSetArray( arr ), pubDynSubGetArray()", arr, ( pubDynSubSetArray( arr ), pubDynSubGetArray()) ); + + +// access default method from a public static method of a sub class +AddTestCase( "*** Access default method from public static method of sub class ***", 1, 1 ); +AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 ); +// AddTestCase( "pubStatSubSetArray( arr ), pubStatSubGetArray()", arr, ( pubStatSubSetArray( arr ), pubStatSubGetArray() ) ); + + +// access default method from a public final method of a sub class +AddTestCase( "*** Access default method from public final method of sub class ***", 1, 1 ); +AddTestCase( "pubFinSubSetArray( arr ), pubFinSubGetArray()", arr, ( pubFinSubSetArray( arr ), pubFinSubGetArray() ) ); + + +// access default method from a public virtual method of a sub class +AddTestCase( "*** Access default method from public virtual method of sub class ***", 1, 1 ); +AddTestCase( "pubVirSubSetArray( arr ), pubVirSubSetArray()", arr, ( pubVirSubSetArray( arr ), pubVirSubGetArray() ) ); + + +// access default method from a final private method of a sub class +AddTestCase( "*** Access default method from final private method of sub class ***", 1, 1 ); +AddTestCase( "testPrivFinSubArray( arr )", arr, testPrivFinSubArray( arr ) ); + + +// access default method from a final static method of a sub class +AddTestCase( "*** Access default method from final static method of sub class ***", 1, 1 ); +AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 ); +// AddTestCase( "finStatSubSetArray( arr ), finStatSubGetArray()", arr, ( finStatSubSetArray( arr ), finStatSubGetArray() ) ); + + +// access default method from a private static method of a sub class +AddTestCase( "*** Access default method from private static method of sub class ***", 1, 1 ); +AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 ); +// AddTestCase( "testPrivStatSubArray( arr )", arr, testPrivStatSubArray( arr ) ); + + +// access default method from a private virtual method of a sub class +AddTestCase( "*** Access default method from private virtual method of sub class ***", 1, 1 ); +AddTestCase( "testPrivVirSubArray( arr )", arr, testPrivVirSubArray( arr ) ); + + + +// access public static property from outside the class +AddTestCase( "*** Access default property from outside the class ***", 1, 1 ); +AddTestCase( "array = arr", arr, (array = arr, array) ); + + +// access public static property from a default method of a sub class +AddTestCase( "*** Access default property from default method of sub class ***", 1, 1 ); +AddTestCase( "subSetDPArray( arr ), subGetDPArray()", arr, ( subSetDPArray( arr ), subGetDPArray() ) ); + + +// access public static property from a dynamic method of a sub class +AddTestCase( "*** Access default property from dynamic method of sub class ***", 1, 1 ); +AddTestCase( "dynSubSetDPArray( arr ), dynSubGetDPArray()", arr, ( dynSubSetDPArray( arr ), dynSubGetDPArray() ) ); + + +// access public static property from a public method of a sub class +AddTestCase( "*** Access default property from public method of sub class ***", 1, 1 ); +AddTestCase( "pubSubSetDPArray( arr ), pubSubGetDPArray()", arr, ( pubSubSetDPArray( arr ), pubSubGetDPArray() ) ); + + +// access public static property from a private method of a sub class +AddTestCase( "*** Access default property from private method of sub class ***", 1, 1 ); +AddTestCase( "testPrivSubDPArray( arr )", arr, testPrivSubDPArray( arr ) ); + + +// access public static property from a static method of a sub class +AddTestCase( "*** Access default property from static method of sub class ***", 1, 1 ); +AddTestCase( "statSubSetDPArray( arr ), statSubGetDPArray()", arr, ( statSubSetDPArray( arr ), statSubGetDPArray() ) ); + + +// access public static property from a final method of a sub class +AddTestCase( "*** Access default property from final method of sub class ***", 1, 1 ); +AddTestCase( "finSubSetDPArray( arr ), finSubGetDPArray()", arr, ( finSubSetDPArray( arr ), finSubGetDPArray() ) ); + + +// access public static property from a private virtual method of a sub class +AddTestCase( "*** Access default property from private virtual method of sub class ***", 1, 1 ); +AddTestCase( "virSubSetDPArray( arr ), virSubGetDPArray()", arr, ( virSubSetDPArray( arr ), virSubGetDPArray() ) ); + + +// access public static property from a public static method of a sub class +AddTestCase( "*** Access default property from public static method of sub class ***", 1, 1 ); +AddTestCase( "pubStatSubSetDPArray( arr ), pubStatSubGetDPArray()", arr, ( pubStatSubSetDPArray( arr ), pubStatSubGetDPArray() ) ); + + +// access public static property from a private static method of a sub class +AddTestCase( "*** Access default property from private static method of sub class ***", 1, 1 ); +AddTestCase( "testPrivStatSubDPArray( arr )", arr, testPrivStatSubDPArray( arr ) ); + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtPublicClassPubStat/APublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtPublicClassPubStat/APublicClass.as new file mode 100644 index 00000000000..fb5e420c61c --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtPublicClassPubStat/APublicClass.as @@ -0,0 +1,262 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + public class PublicClass { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + //public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finMyFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray():Array { return finArray; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtPublicClassPubStat/FinExtPublicClassPubStat.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtPublicClassPubStat/FinExtPublicClassPubStat.as new file mode 100644 index 00000000000..af77276695f --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtPublicClassPubStat/FinExtPublicClassPubStat.as @@ -0,0 +1,390 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + import PublicClass.*; + + final class FinExtPublicClassPubStat extends PublicClass { + + // access public static method of parent from default method of sub class + function subSetArray( a:Array ) { setPubStatArray( a ); } + function subGetArray() : Array { return getPubStatArray(); } + + + // access public static method of parent from dynamic method of sub class + function dynSubSetArray( a:Array ) { setPubStatArray( a ); } + function dynSubGetArray() : Array { return getPubStatArray(); } + + + // access public static method of parent from public method of sub class + public function pubSubSetArray( a:Array ) { setPubStatArray( a ); } + public function pubSubGetArray() : Array { return getPubStatArray(); } + + + // access public static method of parent from static method of sub class + static function statSubSetArray( a:Array ) { setPubStatArray( a ); } + static function statSubGetArray() : Array { return getPubStatArray(); } + + + // access public static method of parent from final method of sub class + final function finSubSetArray( a:Array ) { setPubStatArray( a ); } + final function finSubGetArray() : Array { return getPubStatArray(); } + + + // access public static method of parent from virtual method of sub class + virtual function virSubSetArray( a:Array ) { setPubStatArray( a ); } + virtual function virSubGetArray() : Array { return getPubStatArray(); } + + + // access public static method of parent from private method of sub class + private function privSubSetArray( a:Array ) { setPubStatArray( a ); } + private function privSubGetArray() : Array { return getPubStatArray(); } + + // function to test above using a public function within the class + // this function will be accessible to an object of the class. + public function testPrivSubArray( a:Array ) : Array { + this.privSubSetArray( a ); + return this.privSubGetArray(); + } + + + + // access public static method of parent from public dynamic method of sub class + public function pubDynSubSetArray( a:Array ) { setPubStatArray( a ); } + public function pubDynSubGetArray() : Array { return getPubStatArray(); } + + + // access public static method of parent from public static method of sub class + public static function pubStatSubSetArray( a:Array ) { setPubStatArray( a ); } + public static function pubStatSubGetArray() : Array { return getPubStatArray(); } + + + // access public static method of parent from public final method of sub class + public final function pubFinSubSetArray( a:Array ) { setPubStatArray( a ); } + final public function pubFinSubGetArray() : Array { return getPubStatArray(); } + + + // access public static method of parent from public virtual method of sub class + public virtual function pubVirSubSetArray( a:Array ) { setPubStatArray( a ); } + virtual public function pubVirSubGetArray() : Array { return getPubStatArray(); } + + + // access public static method of parent from dynamic static method of sub class + static function dynStatSubSetArray( a:Array ) { setPubStatArray( a ); } + static function dynStatSubGetArray() : Array { return getPubStatArray(); } + + + // access public static method of parent from dynamic final method of sub class + final function dynFinSubSetArray( a:Array ) { setPubStatArray( a ); } + final function dynFinSubGetArray() : Array { return getPubStatArray(); } + + + // access public static method of parent from dynamic virtual method of sub class + virtual function dynVirSubSetArray( a:Array ) { setPubStatArray( a ); } + virtual function dynVirSubGetArray() : Array { return getPubStatArray(); } + + + // access public static method of parent from dynamic private method of sub class + private function dynPrivSubSetArray( a:Array ) { setPubStatArray( a ); } + private function dynPrivSubGetArray() : Array { return getPubStatArray(); } + + // function to test above from test scripts + public function testPrivDynSubArray( a:Array ) : Array { + this.dynPrivSubSetArray( a ); + return this.dynPrivSubGetArray(); + } + + + // access public static method of parent from static method of sub class + static function finStatSubSetArray( a:Array ) { setPubStatArray( a ); } + static function finStatSubGetArray() : Array { return getPubStatArray(); } + + + // access public static method of parent from final virtual method of sub class + // This is an invalid case and compiler should report that a function cannot + // be both final and virtual. + // This case will be moved to the negative test cases - Error folder. + // final virtual function finVirSubSetArray( a:Array ) { setPubStatArray( a ); } + // virtual final function finVirSubGetArray() : Array { return getPubStatArray(); } + + + // access public static method of parent from final private method of sub class + final private function finPrivSubSetArray( a:Array ) { setPubStatArray( a ); } + private final function finPrivSubGetArray() : Array { return getPubStatArray(); } + + // function to test above from test scripts + public function testPrivFinSubArray( a:Array ) : Array { + this.finPrivSubSetArray( a ); + return this.finPrivSubGetArray(); + } + + + // access public static method of parent from private static method of sub class + private static function privStatSubSetArray( a:Array ) { setPubStatArray( a ); } + static private function privStatSubGetArray() : Array { return getPubStatArray(); } + + // function to test above from test scripts + public function testPrivStatSubArray( a:Array ) : Array { + this.privStatSubSetArray( a ); + return this.privStatSubGetArray(); + } + + + // access public static method of parent from private virtual method of sub class + private virtual function privVirSubSetArray( a:Array ) { setPubStatArray( a ); } + virtual private function privVirSubGetArray() : Array { return getPubStatArray(); } + + // function to test above from test scripts + public function testPrivVirSubArray( a:Array ) : Array { + this.privVirSubSetArray( a ); + return this.privVirSubGetArray(); + } + + + + // access public static method of parent from virtual static method of sub class + // This is an invalid case as a function cannot be both virtual and static. + // This test case will be moved to the Error folder as a negative test case. + // virtual static function virStatSubSetArray( a:Array ) { setPubStatArray( a ); } + // static virtual function virStatSubGetArray() : Array { return getPubStatArray(); } + + + + // access public static property from default method of sub class + function subSetDPArray( a:Array ) { pubStatArray = a; } + function subGetDPArray() : Array { return pubStatArray; } + + + // access public static property from dynamic method of sub class. + function dynSubSetDPArray( a:Array ) { pubStatArray = a; } + function dynSubGetDPArray() : Array { return pubStatArray; } + + + // access public static property from public method of sub class + public function pubSubSetDPArray( a:Array ) { pubStatArray = a; } + public function pubSubGetDPArray() : Array { return pubStatArray; } + + + // access public static property from private method of sub class + private function privSubSetDPArray( a:Array ) { pubStatArray = a; } + private function privSubGetDPArray() : Array { return pubStatArray; } + + // public accessor for the above given private functions, + // so that these can be accessed from an object of the class + public function testPrivSubDPArray( a:Array ) : Array { + privSubSetDPArray( a ); + return privSubGetDPArray(); + } + + + // access public static property from static method of sub class + static function statSubSetDPArray( a:Array ) { pubStatArray = a; } + static function statSubGetDPArray() : Array { return pubStatArray; } + + + // access public static property from final method of sub class + final function finSubSetDPArray( a:Array ) { pubStatArray = a; } + final function finSubGetDPArray() : Array { return pubStatArray; } + + + // access public static property from virtual method of sub class + virtual function virSubSetDPArray( a:Array ) { pubStatArray = a; } + virtual function virSubGetDPArray() : Array { return pubStatArray; } + + + // access public static property from public static method of sub class + public static function pubStatSubSetDPArray( a:Array ) { pubStatArray = a; } + public static function pubStatSubGetDPArray() : Array { return pubStatArray; } + + + // access public static property from private static method of sub class + private static function privStatSubSetDPArray( a:Array ) { pubStatArray = a; } + private static function privStatSubGetDPArray() : Array { return pubStatArray; } + + // public accessor for the above given private functions, + // so that these can be accessed from an object of the class + public function testPrivStatSubDPArray( a:Array ) : Array { + privStatSubSetDPArray( a ); + return privStatSubGetDPArray(); + } + } + + // Create an instance of the final class in the package. + // This object will be used for accessing the methods created + // within the sub class given above. + var EXTDCLASS = new FinExtPublicClassPubStat(); + + // Create a series of public functions that call the methods. + // The same names can be used as used in the class; because we are now + // outside of the class definition. + + // The default method of the sub class. + public function subSetArray( a:Array ) { EXTDCLASS.subSetArray( a ); } + public function subGetArray() : Array { return EXTDCLASS.subGetArray(); } + + + // The dynamic method of the sub class. + public function dynSubSetArray( a:Array ) { EXTDCLASS.dynSubSetArray( a ); } + public function dynSubGetArray() : Array { return EXTDCLASS.dynSubGetArray(); } + + + // The public method of the sub class. + public function pubSubSetArray( a:Array ) { EXTDCLASS.pubSubSetArray( a ); } + public function pubSubGetArray() : Array { return EXTDCLASS.pubSubGetArray(); } + + + // The private method of the sub class. Only one is used as we need to call only the + // test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivSubArray( a:Array ) : Array { return EXTDCLASS.testPrivSubArray( a ); } + + + // The static method of the sub class. + public function statSubSetArray( a:Array ) { FinExtPublicClassPubStat.statSubSetArray( a ); } + public function statSubGetArray() : Array { return FinExtPublicClassPubStat.statSubGetArray(); } + + // The STATIC class cannot be accessed by an object of the class, but has to be accessed + // by the class name itself. Bug filed for this: 108206 + // public function statSubSetArray( a:Array ) { EXTDCLASS.statSubSetArray( a ); } + // public function statSubGetArray() : Array { return EXTDCLASS.statSubGetArray(); } + + + // The final method of the sub class. + public function finSubSetArray( a : Array ) { EXTDCLASS.finSubSetArray( a ); } + public function finSubGetArray() : Array { return EXTDCLASS.finSubGetArray(); } + + + // The virtual method of the sub class. + public function virSubSetArray( a : Array ) { EXTDCLASS.virSubSetArray( a ); } + public function virSubGetArray() : Array { return EXTDCLASS.virSubGetArray(); } + + + + // The public dynamic method of the sub class. + public function pubDynSubSetArray( a:Array ) { EXTDCLASS.dynSubSetArray( a ); } + public function pubDynSubGetArray() : Array { return EXTDCLASS.pubDynSubGetArray(); } + + + // The public final method of the sub class. + public function pubFinSubSetArray( a : Array ) { EXTDCLASS.pubFinSubSetArray( a ); } + public function pubFinSubGetArray() : Array { return EXTDCLASS.pubFinSubGetArray(); } + + + // The public virtual method of the sub class. + public function pubVirSubSetArray( a : Array ) { EXTDCLASS.pubVirSubSetArray( a ); } + public function pubVirSubGetArray() : Array { return EXTDCLASS.pubVirSubGetArray(); } + + + + // The dynamic private method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivDynSubArray( a:Array ) : Array { return EXTDCLASS.testPrivDynSubArray( a ); } + + + // The dynamic final method of the sub class. + public function dynFinSubSetArray( a : Array ) { EXTDCLASS.dynFinSubSetArray( a ); } + public function dynFinSubGetArray() : Array { return EXTDCLASS.dynFinSubGetArray(); } + + + // The dynamic virtual method of the sub class. + public function dynVirSubSetArray( a : Array ) { EXTDCLASS.dynVirSubSetArray( a ); } + public function dynVirSubGetArray() : Array { return EXTDCLASS.dynVirSubGetArray(); } + + + + // The final private method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivFinSubArray( a:Array ) : Array { return EXTDCLASS.testPrivFinSubArray( a ); } + + + + // The private static method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + // This case is a negative case and will be put in the Error folder. + public function testPrivStatSubArray( a:Array ) : Array { return EXTDCLASS.testPrivStatSubArray( a ); } + + + + // The private virtual method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivVirSubArray( a:Array ) : Array { return EXTDCLASS.testPrivVirSubArray( a ); } + + + // The default property being accessed by the different method attributes. + // The default method attribute. + public function subSetDPArray( a:Array ) { EXTDCLASS.subSetDPArray(a); } + public function subGetDPArray() : Array { return EXTDCLASS.subGetDPArray(); } + + + // The dynamic method attribute. + public function dynSubSetDPArray( a:Array ) { EXTDCLASS.dynSubSetDPArray(a); } + public function dynSubGetDPArray() : Array { return EXTDCLASS.dynSubGetDPArray(); } + + + // The public method attribute. + public function pubSubSetDPArray( a:Array ) { EXTDCLASS.pubSubSetDPArray(a); } + public function pubSubGetDPArray() : Array { return EXTDCLASS.pubSubGetDPArray(); } + + + // The private method attribute. + public function testPrivSubDPArray( a:Array ):Array { return EXTDCLASS.testPrivSubDPArray(a) } + + // the static method attribute. + public function statSubSetDPArray( a:Array ) { FinExtPublicClassPubStat.statSubSetDPArray(a); } + public function statSubGetDPArray() : Array { return FinExtPublicClassPubStat.statSubGetDPArray(); } + + + // the final method attribute. + public function finSubSetDPArray( a:Array ) { EXTDCLASS.finSubSetDPArray(a); } + public function finSubGetDPArray() : Array { return EXTDCLASS.finSubGetDPArray(); } + + + // the virtual method attribute. + public function virSubSetDPArray( a:Array ) { EXTDCLASS.virSubSetDPArray(a); } + public function virSubGetDPArray() : Array { return EXTDCLASS.virSubGetDPArray(); } + + + // the public static method attrbute. + public function pubStatSubSetDPArray( a:Array ) { FinExtPublicClassPubStat.pubStatSubSetDPArray(a); } + public function pubStatSubGetDPArray() : Array { return FinExtPublicClassPubStat.pubStatSubGetDPArray(); } + + + // the private static method attribute + public function testPrivStatSubDPArray( a:Array ) : Array { return EXTDCLASS.testPrivStatSubDPArray(a); } + + + } + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtPublicClassStat.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtPublicClassStat.as new file mode 100644 index 00000000000..cbc87b956a7 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtPublicClassStat.as @@ -0,0 +1,187 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import PublicClass.*; + + +var SECTION = "Definitions\Ext"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Final Class Extends Public Class Static Methods"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + +// Can't create an instance because it's not public +// Hence commenting out the lines where the class is initialized. +// var EXTDCLASS = new FinExtDefaultClassPub(); + + +// Create an array variable which will define the test array to be used +// for the given output. +var arr = new Array(1, 2, 3); + + +// access default method from a default method of a sub class +AddTestCase( "*** Access default method from default method of sub class ***", 1, 1 ); +AddTestCase( "subSetArray( arr ), subGetArray()", arr, ( subSetArray( arr ), subGetArray() ) ); + + +// access default method from a dynamic method of a sub class +AddTestCase( "*** Acess default method from dynamic method of sub class ***", 1, 1 ); +AddTestCase( "dynSubSetArray( arr ), dynSubGetArray()", arr, ( dynSubSetArray( arr ), dynSubGetArray()) ); + + +// access default method from a public method of a sub class +AddTestCase( "*** Access default method from public method of sub class ***", 1, 1 ); +AddTestCase( "pubSubSetArray( arr ), pubSubGetArray()", arr, ( pubSubSetArray( arr ), pubSubGetArray()) ); + + +// access default method from a private method of a sub class +AddTestCase( "*** Access default method from private method of sub class ***", 1, 1 ); +AddTestCase( "testPrivSubArray( arr )", arr, testPrivSubArray( arr ) ); + + +// access default method from a static method of a sub class +AddTestCase( "*** Access default method from static method of sub class ***", 1, 1 ); +AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 ); +// AddTestCase( "statSubSetArray( arr ), statSubGetArray()", arr, ( statSubSetArray( arr ), statSubGetArray() ) ); + + +// access default method from a final method of a sub class +AddTestCase( "*** Access default method from final method of sub class ***", 1, 1 ); +AddTestCase( "finSubSetArray( arr ), finSubGetArray()", arr, ( finSubSetArray( arr ), finSubGetArray() ) ); + + +// access default method from a virtual method of a sub class +AddTestCase( "*** Access default method from virtual method of sub class ***", 1, 1 ); +AddTestCase( "virSubSetArray( arr ), virSubSetArray()", arr, ( virSubSetArray( arr ), virSubGetArray() ) ); + + +// access default method from a public dynamic method of a sub class +AddTestCase( "*** Acess default method from public dynamic method of sub class ***", 1, 1 ); +AddTestCase( "pubDynSubSetArray( arr ), pubDynSubGetArray()", arr, ( pubDynSubSetArray( arr ), pubDynSubGetArray()) ); + + +// access default method from a public static method of a sub class +AddTestCase( "*** Access default method from public static method of sub class ***", 1, 1 ); +AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 ); +// AddTestCase( "pubStatSubSetArray( arr ), pubStatSubGetArray()", arr, ( pubStatSubSetArray( arr ), pubStatSubGetArray() ) ); + + +// access default method from a public final method of a sub class +AddTestCase( "*** Access default method from public final method of sub class ***", 1, 1 ); +AddTestCase( "pubFinSubSetArray( arr ), pubFinSubGetArray()", arr, ( pubFinSubSetArray( arr ), pubFinSubGetArray() ) ); + + +// access default method from a public virtual method of a sub class +AddTestCase( "*** Access default method from public virtual method of sub class ***", 1, 1 ); +AddTestCase( "pubVirSubSetArray( arr ), pubVirSubSetArray()", arr, ( pubVirSubSetArray( arr ), pubVirSubGetArray() ) ); + + +// access default method from a final private method of a sub class +AddTestCase( "*** Access default method from final private method of sub class ***", 1, 1 ); +AddTestCase( "testPrivFinSubArray( arr )", arr, testPrivFinSubArray( arr ) ); + + +// access default method from a final static method of a sub class +AddTestCase( "*** Access default method from final static method of sub class ***", 1, 1 ); +AddTestCase( "finStatSubSetArray( arr ), finStatSubGetArray()", arr, ( finStatSubSetArray( arr ), finStatSubGetArray() ) ); + + +// access default method from a private static method of a sub class +AddTestCase( "*** Access default method from private static method of sub class ***", 1, 1 ); +AddTestCase( "*** Cannot Access a private static method, giving: Call attempted on an object that is not a function. ***", 1, 1 ); +// AddTestCase( "testPrivStatSubArray( arr )", arr, testPrivStatSubArray( arr ) ); + + +// access default method from a private virtual method of a sub class +AddTestCase( "*** Access default method from private virtual method of sub class ***", 1, 1 ); +AddTestCase( "testPrivVirSubArray( arr )", arr, testPrivVirSubArray( arr ) ); + + + +// fill in the rest of the cases here + +// access static property from outside the class +AddTestCase( "*** Access default property from outside the class ***", 1, 1 ); +AddTestCase( "array = arr", arr, (array = arr, array) ); + + +// access static property from a default method of a sub class +AddTestCase( "*** Access default property from default method of sub class ***", 1, 1 ); +AddTestCase( "subSetDPArray( arr ), subGetDPArray()", arr, ( subSetDPArray( arr ), subGetDPArray() ) ); + + +// access static property from a dynamic method of a sub class +AddTestCase( "*** Access default property from dynamic method of sub class ***", 1, 1 ); +AddTestCase( "dynSubSetDPArray( arr ), dynSubGetDPArray()", arr, ( dynSubSetDPArray( arr ), dynSubGetDPArray() ) ); + + +// access static property from a public method of a sub class +AddTestCase( "*** Access default property from public method of sub class ***", 1, 1 ); +AddTestCase( "pubSubSetDPArray( arr ), pubSubGetDPArray()", arr, ( pubSubSetDPArray( arr ), pubSubGetDPArray() ) ); + + +// access static property from a private method of a sub class +AddTestCase( "*** Access default property from private method of sub class ***", 1, 1 ); +AddTestCase( "testPrivSubDPArray( arr )", arr, testPrivSubDPArray( arr ) ); + + +// access static property from a static method of a sub class +AddTestCase( "*** Access default property from static method of sub class ***", 1, 1 ); +AddTestCase( "statSubSetDPArray( arr ), statSubGetDPArray()", arr, ( statSubSetDPArray( arr ), statSubGetDPArray() ) ); + + +// access static property from a final method of a sub class +AddTestCase( "*** Access default property from final method of sub class ***", 1, 1 ); +AddTestCase( "finSubSetDPArray( arr ), finSubGetDPArray()", arr, ( finSubSetDPArray( arr ), finSubGetDPArray() ) ); + + +// access static property from a private virtual method of a sub class +AddTestCase( "*** Access default property from private virtual method of sub class ***", 1, 1 ); +AddTestCase( "virSubSetDPArray( arr ), virSubGetDPArray()", arr, ( virSubSetDPArray( arr ), virSubGetDPArray() ) ); + + +// access static property from a public static method of a sub class +AddTestCase( "*** Access default property from public static method of sub class ***", 1, 1 ); +AddTestCase( "pubStatSubSetDPArray( arr ), pubStatSubGetDPArray()", arr, ( pubStatSubSetDPArray( arr ), pubStatSubGetDPArray() ) ); + + +// access static property from a private static method of a sub class +AddTestCase( "*** Access default property from private static method of sub class ***", 1, 1 ); +AddTestCase( "testPrivStatSubDPArray( arr )", arr, testPrivStatSubDPArray( arr ) ); + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtPublicClassStat/APublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtPublicClassStat/APublicClass.as new file mode 100644 index 00000000000..fb5e420c61c --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtPublicClassStat/APublicClass.as @@ -0,0 +1,262 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + public class PublicClass { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + //public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finMyFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray():Array { return finArray; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtPublicClassStat/FinExtPublicClassStat.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtPublicClassStat/FinExtPublicClassStat.as new file mode 100644 index 00000000000..4f5f0343d55 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/FinExtPublicClassStat/FinExtPublicClassStat.as @@ -0,0 +1,405 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + import PublicClass.*; + + final class FinExtPublicClassStat extends PublicClass { + + // access static method of parent from default method of sub class + function subSetArray( a:Array ) { setStatArray( a ); } + function subGetArray() : Array { return getStatArray(); } + + + // access static method of parent from dynamic method of sub class + function dynSubSetArray( a:Array ) { setStatArray( a ); } + function dynSubGetArray() : Array { return getStatArray(); } + + + // access static method of parent from public method of sub class + public function pubSubSetArray( a:Array ) { setStatArray( a ); } + public function pubSubGetArray() : Array { return getStatArray(); } + + + // access static method of parent from static method of sub class + static function statSubSetArray( a:Array ) { setStatArray( a ); } + static function statSubGetArray() : Array { return getStatArray(); } + + + // access static method of parent from final method of sub class + final function finSubSetArray( a:Array ) { setStatArray( a ); } + final function finSubGetArray() : Array { return getStatArray(); } + + + // access static method of parent from virtual method of sub class + virtual function virSubSetArray( a:Array ) { setStatArray( a ); } + virtual function virSubGetArray() : Array { return getStatArray(); } + + + // access static method of parent from private method of sub class + private function privSubSetArray( a:Array ) { setStatArray( a ); } + private function privSubGetArray() : Array { return getStatArray(); } + + // function to test above using a public function within the class + // this function will be accessible to an object of the class. + public function testPrivSubArray( a:Array ) : Array { + this.privSubSetArray( a ); + return this.privSubGetArray(); + } + + + + // access static method of parent from public dynamic method of sub class + public function pubDynSubSetArray( a:Array ) { setStatArray( a ); } + public function pubDynSubGetArray() : Array { return getStatArray(); } + + + // access static method of parent from public static method of sub class + public static function pubStatSubSetArray( a:Array ) { setStatArray( a ); } + public static function pubStatSubGetArray() : Array { return getStatArray(); } + + + // access static method of parent from public final method of sub class + public final function pubFinSubSetArray( a:Array ) { setStatArray( a ); } + final public function pubFinSubGetArray() : Array { return getStatArray(); } + + + // access static method of parent from public virtual method of sub class + public virtual function pubVirSubSetArray( a:Array ) { setStatArray( a ); } + virtual public function pubVirSubGetArray() : Array { return getStatArray(); } + + + // access static method of parent from dynamic static method of sub class + static function dynStatSubSetArray( a:Array ) { setStatArray( a ); } + static function dynStatSubGetArray() : Array { return getStatArray(); } + + + // access static method of parent from dynamic final method of sub class + final function dynFinSubSetArray( a:Array ) { setStatArray( a ); } + final function dynFinSubGetArray() : Array { return getStatArray(); } + + + // access static method of parent from dynamic virtual method of sub class + virtual function dynVirSubSetArray( a:Array ) { setStatArray( a ); } + virtual function dynVirSubGetArray() : Array { return getStatArray(); } + + + // access static method of parent from dynamic private method of sub class + private function dynPrivSubSetArray( a:Array ) { setStatArray( a ); } + private function dynPrivSubGetArray() : Array { return getStatArray(); } + + // function to test above from test scripts + public function testPrivDynSubArray( a:Array ) : Array { + this.dynPrivSubSetArray( a ); + return this.dynPrivSubGetArray(); + } + + + // access static method of parent from static method of sub class + static function finStatSubSetArray( a:Array ) { setStatArray( a ); } + static function finStatSubGetArray() : Array { return getStatArray(); } + + + // access static method of parent from final virtual method of sub class + // This is an invalid case and compiler should report that a function cannot + // be both final and virtual. + // This case will be moved to the negative test cases - Error folder. + // final virtual function finVirSubSetArray( a:Array ) { setStatArray( a ); } + // virtual final function finVirSubGetArray() : Array { return getStatArray(); } + + + // access static method of parent from final private method of sub class + final private function finPrivSubSetArray( a:Array ) { setStatArray( a ); } + private final function finPrivSubGetArray() : Array { return getStatArray(); } + + // function to test above from test scripts + public function testPrivFinSubArray( a:Array ) : Array { + this.finPrivSubSetArray( a ); + return this.finPrivSubGetArray(); + } + + + // access static method of parent from private static method of sub class + private static function privStatSubSetArray( a:Array ) { setStatArray( a ); } + static private function privStatSubGetArray() : Array { return getStatArray(); } + + // function to test above from test scripts + public function testPrivStatSubArray( a:Array ) : Array { + this.privStatSubSetArray( a ); + return this.privStatSubGetArray(); + } + + + // access static method of parent from private virtual method of sub class + private virtual function privVirSubSetArray( a:Array ) { setStatArray( a ); } + virtual private function privVirSubGetArray() : Array { return getStatArray(); } + + // function to test above from test scripts + public function testPrivVirSubArray( a:Array ) : Array { + this.privVirSubSetArray( a ); + return this.privVirSubGetArray(); + } + + + + // access static method of parent from virtual static method of sub class + // This is an invalid case as a function cannot be both virtual and static. + // This test case will be moved to the Error folder as a negative test case. + // virtual static function virStatSubSetArray( a:Array ) { setStatArray( a ); } + // static virtual function virStatSubGetArray() : Array { return getStatArray(); } + + + + + + // access static property from default method of sub class + function subSetDPArray( a:Array ) { statArray = a; } + function subGetDPArray() : Array { return statArray; } + + + // access static property from dynamic method of sub class. + function dynSubSetDPArray( a:Array ) { statArray = a; } + function dynSubGetDPArray() : Array { return statArray; } + + + // access static property from public method of sub class + public function pubSubSetDPArray( a:Array ) { statArray = a; } + public function pubSubGetDPArray() : Array { return statArray; } + + + // access static property from private method of sub class + private function privSubSetDPArray( a:Array ) { statArray = a; } + private function privSubGetDPArray() : Array { return statArray; } + + // public accessor for the above given private functions, + // so that these can be accessed from an object of the class + public function testPrivSubDPArray( a:Array ) : Array { + privSubSetDPArray( a ); + return privSubGetDPArray(); + } + + + // access static property from static method of sub class + static function statSubSetDPArray( a:Array ) { statArray = a; } + static function statSubGetDPArray() : Array { return statArray; } + + + // access static property from final method of sub class + final function finSubSetDPArray( a:Array ) { statArray = a; } + final function finSubGetDPArray() : Array { return statArray; } + + + // access static property from virtual method of sub class + virtual function virSubSetDPArray( a:Array ) { statArray = a; } + virtual function virSubGetDPArray() : Array { return statArray; } + + + // access static property from public static method of sub class + public static function pubStatSubSetDPArray( a:Array ) { statArray = a; } + public static function pubStatSubGetDPArray() : Array { return statArray; } + + + // access static property from private static method of sub class + private static function privStatSubSetDPArray( a:Array ) { statArray = a; } + private static function privStatSubGetDPArray() : Array { return statArray; } + + // public accessor for the above given private functions, + // so that these can be accessed from an object of the class + public function testPrivStatSubDPArray( a:Array ) : Array { + privStatSubSetDPArray( a ); + return privStatSubGetDPArray(); + } + + } + + + + // Create an instance of the final class in the package. + // This object will be used for accessing the methods created + // within the sub class given above. + var EXTDCLASS = new FinExtPublicClassStat(); + + // Create a series of public functions that call the methods. + // The same names can be used as used in the class; because we are now + // outside of the class definition. + + // The default method of the sub class. + public function subSetArray( a:Array ) { EXTDCLASS.subSetArray( a ); } + public function subGetArray() : Array { return EXTDCLASS.subGetArray(); } + + + // The dynamic method of the sub class. + public function dynSubSetArray( a:Array ) { EXTDCLASS.dynSubSetArray( a ); } + public function dynSubGetArray() : Array { return EXTDCLASS.dynSubGetArray(); } + + + // The public method of the sub class. + public function pubSubSetArray( a:Array ) { EXTDCLASS.pubSubSetArray( a ); } + public function pubSubGetArray() : Array { return EXTDCLASS.pubSubGetArray(); } + + + // The private method of the sub class. Only one is used as we need to call only the + // test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivSubArray( a:Array ) : Array { return EXTDCLASS.testPrivSubArray( a ); } + + + // The static method of the sub class. + public function statSubSetArray( a:Array ) { FinExtPublicClassStat.statSubSetArray( a ); } + public function statSubGetArray() : Array { return FinExtPublicClassStat.statSubGetArray(); } + + // The STATIC class cannot be accessed by an object of the class, but has to be accessed + // by the class name itself. Bug filed for this: 108206 + // public function statSubSetArray( a:Array ) { EXTDCLASS.statSubSetArray( a ); } + // public function statSubGetArray() : Array { return EXTDCLASS.statSubGetArray(); } + + + // The final method of the sub class. + public function finSubSetArray( a : Array ) { EXTDCLASS.finSubSetArray( a ); } + public function finSubGetArray() : Array { return EXTDCLASS.finSubGetArray(); } + + + // The virtual method of the sub class. + public function virSubSetArray( a : Array ) { EXTDCLASS.virSubSetArray( a ); } + public function virSubGetArray() : Array { return EXTDCLASS.virSubGetArray(); } + + + + // The public dynamic method of the sub class. + public function pubDynSubSetArray( a:Array ) { EXTDCLASS.dynSubSetArray( a ); } + public function pubDynSubGetArray() : Array { return EXTDCLASS.pubDynSubGetArray(); } + + + // The public final method of the sub class. + public function pubFinSubSetArray( a : Array ) { EXTDCLASS.pubFinSubSetArray( a ); } + public function pubFinSubGetArray() : Array { return EXTDCLASS.pubFinSubGetArray(); } + + + // The public virtual method of the sub class. + public function pubVirSubSetArray( a : Array ) { EXTDCLASS.pubVirSubSetArray( a ); } + public function pubVirSubGetArray() : Array { return EXTDCLASS.pubVirSubGetArray(); } + + + + // The dynamic private method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivDynSubArray( a:Array ) : Array { return EXTDCLASS.testPrivDynSubArray( a ); } + + + // The dynamic final method of the sub class. + public function dynFinSubSetArray( a : Array ) { EXTDCLASS.dynFinSubSetArray( a ); } + public function dynFinSubGetArray() : Array { return EXTDCLASS.dynFinSubGetArray(); } + + + // The dynamic virtual method of the sub class. + public function dynVirSubSetArray( a : Array ) { EXTDCLASS.dynVirSubSetArray( a ); } + public function dynVirSubGetArray() : Array { return EXTDCLASS.dynVirSubGetArray(); } + + + + // The final private method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivFinSubArray( a:Array ) : Array { return EXTDCLASS.testPrivFinSubArray( a ); } + + + + // The private static method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + // This case is a negative case and will be put in the Error folder. + public function testPrivStatSubArray( a:Array ) : Array { return FinExtPublicClassStat.testPrivStatSubArray( a ); } + + + // The static method of the sub class. + public function finStatSubSetArray( a : Array ) { FinExtPublicClassStat.finStatSubSetArray( a ); } + public function finStatSubGetArray() : Array { return FinExtPublicClassStat.finStatSubGetArray(); } + + // The STATIC class cannot be accessed by an object of the class, but has to be accessed + // by the class name itself. Bug filed for this: 108206 + // public function finStatSubSetArray( a:Array ) { EXTDCLASS.finStatSubSetArray( a ); } + // public function finStatSubGetArray() : Array { return EXTDCLASS.finStatSubGetArray(); } + + + + // The private virtual method of the sub class. Only one is used as we need to call only + // the test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivVirSubArray( a:Array ) : Array { return EXTDCLASS.testPrivVirSubArray( a ); } + + + // The default property being accessed by the different method attributes. + // The default method attribute. + public function subSetDPArray( a:Array ) { EXTDCLASS.subSetDPArray(a); } + public function subGetDPArray() : Array { return EXTDCLASS.subGetDPArray(); } + + + // The dynamic method attribute. + public function dynSubSetDPArray( a:Array ) { EXTDCLASS.dynSubSetDPArray(a); } + public function dynSubGetDPArray() : Array { return EXTDCLASS.dynSubGetDPArray(); } + + + // The public method attribute. + public function pubSubSetDPArray( a:Array ) { EXTDCLASS.pubSubSetDPArray(a); } + public function pubSubGetDPArray() : Array { return EXTDCLASS.pubSubGetDPArray(); } + + + // The private method attribute. + public function testPrivSubDPArray( a:Array ):Array { return EXTDCLASS.testPrivSubDPArray(a) } + + // the static method attribute. + public function statSubSetDPArray( a:Array ) { FinExtPublicClassStat.statSubSetDPArray(a); } + public function statSubGetDPArray() : Array { return FinExtPublicClassStat.statSubGetDPArray(); } + + + // the final method attribute. + public function finSubSetDPArray( a:Array ) { EXTDCLASS.finSubSetDPArray(a); } + public function finSubGetDPArray() : Array { return EXTDCLASS.finSubGetDPArray(); } + + + // the virtual method attribute. + public function virSubSetDPArray( a:Array ) { EXTDCLASS.virSubSetDPArray(a); } + public function virSubGetDPArray() : Array { return EXTDCLASS.virSubGetDPArray(); } + + + // the public static method attrbute. + public function pubStatSubSetDPArray( a:Array ) { FinExtPublicClassStat.pubStatSubSetDPArray(a); } + public function pubStatSubGetDPArray() : Array { return FinExtPublicClassStat.pubStatSubGetDPArray(); } + + + // the private static method attribute + public function testPrivStatSubDPArray( a:Array ) : Array { return EXTDCLASS.testPrivStatSubDPArray(a); } + + } + + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/IntExtDefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/IntExtDefaultClass.as new file mode 100644 index 00000000000..6ef997141ec --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/IntExtDefaultClass.as @@ -0,0 +1,256 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DefaultClass{ + +//import DefaultClass.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "Clean AS2"; // Version of JavaScript or ECMA +var TITLE = "Extend Default Class"; // Provide ECMA section title or a description +//var BUGNUMBER = ""; + +startTest(); // leave this alone + + + +// ******************************************** +// access default method from a default +// method of a sub class +// +// ******************************************** + +var arr = new Array(1,2,3); +EXTDCLASS = new IntExtDefaultClass(); +AddTestCase( "access 'default' method from 'default' method of sub class", arr, (EXTDCLASS.testSubGetSetArray(arr)) ); + + +// ******************************************** +// access default method from a public +// method of a sub class +// ******************************************** + +arr = new Array( 4, 5, 6 ); +EXTDCLASS = new IntExtDefaultClass(); +AddTestCase( "access 'default' method from 'public' method of sub class", arr, + (EXTDCLASS.pubSubSetArray(arr), EXTDCLASS.pubSubGetArray()) ); + +// ******************************************** +// access default method from a final +// method of a sub class +// ******************************************** + +arr = new Array( "one", "two", "three" ); +EXTDCLASS = new IntExtDefaultClass(); +AddTestCase( "access 'default' method from 'final' method of sub class", arr, (EXTDCLASS.testFinSubArray(arr)) ); + +// ******************************************** +// access default method from a public +// final method of a sub class +// ******************************************** + +arr = new Array( 8, "two", 9 ); +EXTDCLASS = new IntExtDefaultClass(); +AddTestCase( "access 'default' method from 'public final' method of sub class", arr, + (EXTDCLASS.pubFinSubSetArray(arr), EXTDCLASS.pubFinSubGetArray()) ); + +// ******************************************** +// access default method from a final +// private method of a sub class +// ******************************************** + +arr = new Array( "one", "two", "three" ); +EXTDCLASS = new IntExtDefaultClass(); +AddTestCase( "access 'default' method from 'private final' method of sub class", arr, (EXTDCLASS.testPrivFinSubArray(arr)) ); + +// ******************************************** +// access default method from a private +// method of a sub class +// ******************************************** + +arr = new Array( 5, 6, 7 ); +EXTDCLASS = new IntExtDefaultClass(); +AddTestCase( "access 'default' method from 'private' method of sub class", arr, EXTDCLASS.testPrivSubArray(arr) ); + +// ******************************************** +// access default method from a virtual +// method of a sub class +// ******************************************** + +AddTestCase( "access 'default' method from 'virtual' method of sub class", arr, + EXTDCLASS.testVirtSubArray(arr) ); + +// ******************************************** +// access default method from a virtual +// public method of a sub class +// ******************************************** + +AddTestCase( "access 'default' method from 'public virtual' method of sub class", arr, + (EXTDCLASS.pubVirtSubSetArray(arr), EXTDCLASS.pubVirtSubGetArray()) ); + +// ******************************************** +// access default method from a virtual +// private method of a sub class +// ******************************************** + +AddTestCase( "access 'default' method from 'private virtual' method of sub class", arr, + EXTDCLASS.testPrivVirtSubArray(arr) ); + +// ******************************************** +// access default method from static +// method of sub class +// ******************************************** + +public var thisError10 = "no exception thrown"; +try{ + IntExtDefaultClass.pubStatSubGetArray(); +} catch (e1) { + thisError = e1.toString(); +} finally { + AddTestCase( "access 'default' method from 'static' method of the sub class", + TYPEERROR+1006, + typeError( thisError) ); +} + +// ******************************************** +// access default property from +// default method in sub class +// ******************************************** + +EXTDCLASS = new IntExtDefaultClass(); +AddTestCase( "access 'default' property from 'default' method of sub class", arr, + (EXTDCLASS.testSubGetSetDPArray(arr)) ); + +// ******************************************** +// access default property from +// final method in sub class +// ******************************************** + +EXTDCLASS = new IntExtDefaultClass(); +AddTestCase( "access 'default' property from 'final' method of sub class", arr, + (EXTDCLASS.testFinSubDPArray(arr)) ); + +// ******************************************** +// access default property from +// virtual method in sub class +// ******************************************** + +EXTDCLASS = new IntExtDefaultClass(); +AddTestCase( "access 'default' property from 'virtual' method of sub class", arr, + (EXTDCLASS.testVirtSubDPArray(arr)) ); + +// ******************************************** +// access default property from +// public method in sub class +// ******************************************** + +EXTDCLASS = new IntExtDefaultClass(); +AddTestCase( "access 'default' property from 'public' method of sub class", arr, + (EXTDCLASS.pubSubSetDPArray(arr), EXTDCLASS.pubSubGetDPArray()) ); + +// ******************************************** +// access default property from +// private method in sub class +// ******************************************** + +EXTDCLASS = new IntExtDefaultClass(); +AddTestCase( "access 'default' property from 'private' method of sub class", arr, + (EXTDCLASS.testPrivSubDPArray(arr)) ); + +// ******************************************** +// access default property from +// public final method in sub class +// ******************************************** + +EXTDCLASS = new IntExtDefaultClass(); +AddTestCase( "access 'default' property from 'public final' method of sub class", arr, + (EXTDCLASS.pubFinSubSetDPArray(arr), EXTDCLASS.pubFinSubGetDPArray()) ); + +// ******************************************** +// access default property from +// public virtual method in sub class +// ******************************************** + +EXTDCLASS = new IntExtDefaultClass(); +AddTestCase( "access 'default' property from 'public virtual' method of sub class", arr, + (EXTDCLASS.pubVirtSubSetDPArray(arr), EXTDCLASS.pubVirtSubGetDPArray()) ); + +// ******************************************** +// access default property from +// private final method in sub class +// ******************************************** + +EXTDCLASS = new IntExtDefaultClass(); +AddTestCase( "access 'default' property from 'private final' method of sub class", arr, + (EXTDCLASS.testPrivFinSubDPArray(arr)) ); + +// ******************************************** +// access default property from +// private virtual method in sub class +// ******************************************** + +EXTDCLASS = new IntExtDefaultClass(); +AddTestCase( "access 'default' property from 'private virtual' method of sub class", arr, + (EXTDCLASS.testPrivVirtSubDPArray(arr)) ); + +// ******************************************** +// Class Prototype Testing +// ******************************************** + +//Add new property to parent through prototype object, verify child inherits it +var child = new IntExtDefaultClassTest(); +DefaultClassInner.prototype.fakeProp = 100; +AddTestCase("*** Add new property to parent prototype object, verify child class inherits it ***", 100, child.fakeProp); + +//Try overriding parent property through prototype object, verify child object has correct value +DefaultClassInner.prototype.pObj = 2; +child = new IntExtDefaultClassTest(); +AddTestCase("*** Try overriding parent property through prototype object, verify child object has correct value ***", 1, child.pObj); + +// ******************************************** +// access default property from +// static public method of sub class +// ******************************************** + +thisError10 = "no error thrown"; +try{ + IntExtDefaultClass.pubStatSubGetDPArray(); +} catch(e3) { + thisError = e3.toString(); +} finally { + AddTestCase( "access default property from static public method of sub class", + TYPEERROR+1006, + typeError( thisError ) ); +} + +test(); // leave this alone. this executes the test cases and + // displays results. + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/IntExtDefaultClass/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/IntExtDefaultClass/DefaultClass.as new file mode 100644 index 00000000000..1429e4429c9 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/IntExtDefaultClass/DefaultClass.as @@ -0,0 +1,267 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DefaultClass { + + class DefaultClassInner { + + internal var array:Array; + var boolean:Boolean; + internal var date:Date; + var myFunction:Function; + internal var math:Math; + var number:Number; + internal var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + //public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + //For class prototype testing + var pObj:Number = 1; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + internal function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + internal function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + internal function getNumber() : Number { return number; } + function getObject() : Object { return object; } + internal function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + internal function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + internal function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + internal function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + internal function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + } + + public class DefaultClass extends DefaultClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/IntExtDefaultClass/IntExtDefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/IntExtDefaultClass/IntExtDefaultClass.as new file mode 100644 index 00000000000..ba14f68b604 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/IntExtDefaultClass/IntExtDefaultClass.as @@ -0,0 +1,276 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DefaultClass { + + import DefaultClass.* + + // this is the test case so we can't alter it too much + // change the name of the class to ExtDefaultClassTest + // we'll create a public class ExtDefaultClass that + // extends it for testing runtime + internal class IntExtDefaultClassTest extends DefaultClass { + + // ************************************ + // access default method of parent + // from default method of sub class + // ************************************ + + internal function subGetArray() : Array { return this.getArray(); } + function subSetArray(a:Array) { this.setArray(a); } + + // this is needed so that the test cases can access this from + // outside the class. This way the test case itself preserved + public function testSubGetSetArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + // ************************************ + // access default method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return this.getArray(); } + public function pubSubSetArray(a:Array) { this.setArray(a); } + + // ************************************ + // access default method of parent + // from final method of sub class + // + // final will behave the same as default + // ************************************ + + internal final function finSubGetArray() : Array { return this.getArray(); } + final function finSubSetArray(a:Array) { this.setArray(a); } + + public function testFinSubArray(a:Array):Array{ + this.finSubSetArray(a); + return this.finSubGetArray(); + } + + // ************************************ + // access default method of parent + // from public final method of sub class + // ************************************ + + public final function pubFinSubGetArray() : Array { return this.getArray(); } + final public function pubFinSubSetArray(a:Array) { this.setArray(a); } + + // ************************************ + // access default method of parent + // from private final method of sub class + // ************************************ + + private final function privFinSubGetArray() : Array { return this.getArray(); } + final private function privFinSubSetArray(a:Array) { this.setArray(a); } + + public function testPrivFinSubArray(a:Array):Array { + this.privFinSubSetArray(a); + return this.privFinSubGetArray(); + } + + + // ************************************ + // access default method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return this.getArray(); } + private function privSubSetArray(a:Array) { this.setArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + // ************************************ + // access default method of parent + // from virtual method of sub class + // ************************************ + + internal virtual function virtSubGetArray() : Array { return this.getArray(); } + virtual function virtSubSetArray(a:Array) { this.setArray(a); } + + public function testVirtSubArray(a:Array) : Array { + this.virtSubSetArray(a); + return this.virtSubGetArray(); + } + + // ************************************ + // access default method of parent + // from public virtual method of sub class + // ************************************ + + virtual public function pubVirtSubGetArray() : Array { return this.getArray(); } + public virtual function pubVirtSubSetArray(a:Array) { this.setArray(a); } + + // ************************************ + // access default method of parent + // from private virtual method of sub class + // ************************************ + + virtual private function privVirtSubGetArray() : Array { return this.getArray(); } + private virtual function privVirtSubSetArray(a:Array) { this.setArray(a); } + + public function testPrivVirtSubArray(a:Array) : Array { + this.privVirtSubSetArray(a); + return this.privVirtSubGetArray(); + } + + // *************************************** + // access default property from + // static method of sub class + // *************************************** + + internal static function statSubGetArray():Array{ return getArray(); } + static public function pubStatSubGetArray():Array { return statSubGetArray(); } + + // *************************************** + // access default property from + // default method of sub class + // *************************************** + + internal function subGetDPArray() : Array { return array; } + function subSetDPArray(a:Array) { array = a; } + + // this is needed so that the test cases can access this from + // outside the class. This way the test case itself preserved + public function testSubGetSetDPArray(a:Array) : Array { + this.subSetDPArray(a); + return this.subGetDPArray(); + } + + // *************************************** + // access default property from + // final method of sub class + // *************************************** + + internal final function finSubGetDPArray() : Array { return array; } + final function finSubSetDPArray(a:Array) { array = a; } + + public function testFinSubDPArray(a:Array) : Array { + this.finSubSetDPArray(a); + return this.finSubGetDPArray(); + } + + // *************************************** + // access default property from + // virtual method of sub class + // *************************************** + + internal virtual function virtSubGetDPArray() : Array { return array; } + virtual function virtSubSetDPArray(a:Array) { array = a; } + + public function testVirtSubDPArray(a:Array) : Array { + this.virtSubSetDPArray(a); + return this.virtSubGetDPArray(); + } + + // *************************************** + // access default property from + // public method of sub class + // *************************************** + + public function pubSubGetDPArray() : Array { return this.array; } + public function pubSubSetDPArray(a:Array) { this.array = a; } + + // *************************************** + // access default property from + // private method of sub class + // *************************************** + + private function privSubGetDPArray() : Array { return this.array; } + private function privSubSetDPArray(a:Array) { this.array = a; } + + public function testPrivSubDPArray(a:Array) : Array { + this.privSubSetDPArray(a); + return this.privSubGetDPArray(); + } + + // *************************************** + // access default property from + // public final method of sub class + // *************************************** + + public final function pubFinSubGetDPArray() : Array { return this.array; } + final public function pubFinSubSetDPArray(a:Array) { this.array = a; } + + // *************************************** + // access default property from + // public virtual method of sub class + // *************************************** + + public virtual function pubVirtSubGetDPArray() : Array { return this.array; } + virtual public function pubVirtSubSetDPArray(a:Array) { this.array = a; } + + // *************************************** + // access default property from + // private final method of sub class + // *************************************** + + private final function privFinSubGetDPArray() : Array { return this.array; } + final private function privFinSubSetDPArray(a:Array) { this.array = a; } + + public function testPrivFinSubDPArray(a:Array):Array { + this.privFinSubSetDPArray(a); + return this.privFinSubGetDPArray(); + } + + // *************************************** + // access default property from + // private virtual method of sub class + // *************************************** + + private virtual function privVirtSubGetDPArray() : Array { return this.array; } + virtual private function privVirtSubSetDPArray(a:Array) { this.array = a; } + + public function testPrivVirtSubDPArray(a:Array):Array { + this.privVirtSubSetDPArray(a); + return this.privVirtSubGetDPArray(); + } + + // *************************************** + // access default property from + // public static method of sub class + // *************************************** + + public static function pubStatSubGetDPArray(){ + return array; + } + + } + + // same class as above except public + public class IntExtDefaultClass extends IntExtDefaultClassTest {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/IntExtDynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/IntExtDynamicClass.as new file mode 100644 index 00000000000..559313f90ac --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/IntExtDynamicClass.as @@ -0,0 +1,239 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import DynamicClass.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "Clean AS2"; // Version of JavaScript or ECMA +var TITLE = "Extend Default Class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + +// ******************************************** +// access default method from a default +// method of a sub class +// +// ******************************************** + +var arr = new Array(1,2,3); +EXTDCLASS = new IntExtDynamicClass(); +AddTestCase( "access 'default' method from 'default' method of sub class", arr, (EXTDCLASS.testSubGetSetArray(arr)) ); + + +// ******************************************** +// access default method from a public +// method of a sub class +// ******************************************** + +arr = new Array( 4, 5, 6 ); +EXTDCLASS = new IntExtDynamicClass(); +AddTestCase( "access 'default' method from 'public' method of sub class", arr, + (EXTDCLASS.pubSubSetArray(arr), EXTDCLASS.pubSubGetArray()) ); + +// ******************************************** +// access default method from a final +// method of a sub class +// ******************************************** + +arr = new Array( "one", "two", "three" ); +EXTDCLASS = new IntExtDynamicClass(); +AddTestCase( "access 'default' method from 'final' method of sub class", arr, (EXTDCLASS.testFinSubArray(arr)) ); + +// ******************************************** +// access default method from a public +// final method of a sub class +// ******************************************** + +arr = new Array( 8, "two", 9 ); +EXTDCLASS = new IntExtDynamicClass(); +AddTestCase( "access 'default' method from 'public final' method of sub class", arr, + (EXTDCLASS.pubFinSubSetArray(arr), EXTDCLASS.pubFinSubGetArray()) ); + +// ******************************************** +// access default method from a final +// private method of a sub class +// ******************************************** + +arr = new Array( "one", "two", "three" ); +EXTDCLASS = new IntExtDynamicClass(); +AddTestCase( "access 'default' method from 'private final' method of sub class", arr, (EXTDCLASS.testPrivFinSubArray(arr)) ); + +// ******************************************** +// access default method from a private +// method of a sub class +// ******************************************** + +arr = new Array( 5, 6, 7 ); +EXTDCLASS = new IntExtDynamicClass(); +AddTestCase( "access 'default' method from 'private' method of sub class", arr, EXTDCLASS.testPrivSubArray(arr) ); + +// ******************************************** +// access default method from a virtual +// method of a sub class +// ******************************************** + +AddTestCase( "access 'default' method from 'virtual' method of sub class", arr, + EXTDCLASS.testVirtSubArray(arr) ); + +// ******************************************** +// access default method from a virtual +// public method of a sub class +// ******************************************** + +AddTestCase( "access 'default' method from 'public virtual' method of sub class", arr, + (EXTDCLASS.pubVirtSubSetArray(arr), EXTDCLASS.pubVirtSubGetArray()) ); + +// ******************************************** +// access default method from a virtual +// private method of a sub class +// ******************************************** + +AddTestCase( "access 'default' method from 'private virtual' method of sub class", arr, + EXTDCLASS.testPrivVirtSubArray(arr) ); + +// ******************************************** +// access default method from static +// method of sub class +// ******************************************** + +var thisError = "no exception thrown"; +try{ + IntExtDynamicClass.pubStatSubGetArray(); +} catch (e1) { + thisError = e1.toString(); +} finally { + AddTestCase( "access 'default' method from 'static' method of the sub class", + TYPEERROR+1006, + typeError( thisError) ); +} + +// ******************************************** +// access default property from +// default method in sub class +// ******************************************** + +EXTDCLASS = new IntExtDynamicClass(); +AddTestCase( "access 'default' property from 'default' method of sub class", arr, + (EXTDCLASS.testSubGetSetDPArray(arr)) ); + +// ******************************************** +// access default property from +// final method in sub class +// ******************************************** + +EXTDCLASS = new IntExtDynamicClass(); +AddTestCase( "access 'default' property from 'final' method of sub class", arr, + (EXTDCLASS.testFinSubDPArray(arr)) ); + +// ******************************************** +// access default property from +// virtual method in sub class +// ******************************************** + +EXTDCLASS = new IntExtDynamicClass(); +AddTestCase( "access 'default' property from 'virtual' method of sub class", arr, + (EXTDCLASS.testVirtSubDPArray(arr)) ); + +// ******************************************** +// access default property from +// public method in sub class +// ******************************************** + +EXTDCLASS = new IntExtDynamicClass(); +AddTestCase( "access 'default' property from 'public' method of sub class", arr, + (EXTDCLASS.pubSubSetDPArray(arr), EXTDCLASS.pubSubGetDPArray()) ); + +// ******************************************** +// access default property from +// private method in sub class +// ******************************************** + +EXTDCLASS = new IntExtDynamicClass(); +AddTestCase( "access 'default' property from 'private' method of sub class", arr, + (EXTDCLASS.testPrivSubDPArray(arr)) ); + +// ******************************************** +// access default property from +// public final method in sub class +// ******************************************** + +EXTDCLASS = new IntExtDynamicClass(); +AddTestCase( "access 'default' property from 'public final' method of sub class", arr, + (EXTDCLASS.pubFinSubSetDPArray(arr), EXTDCLASS.pubFinSubGetDPArray()) ); + +// ******************************************** +// access default property from +// public virtual method in sub class +// ******************************************** + +EXTDCLASS = new IntExtDynamicClass(); +AddTestCase( "access 'default' property from 'public virtual' method of sub class", arr, + (EXTDCLASS.pubVirtSubSetDPArray(arr), EXTDCLASS.pubVirtSubGetDPArray()) ); + +// ******************************************** +// access default property from +// private final method in sub class +// ******************************************** + +EXTDCLASS = new IntExtDynamicClass(); +AddTestCase( "access 'default' property from 'private final' method of sub class", arr, + (EXTDCLASS.testPrivFinSubDPArray(arr)) ); + +// ******************************************** +// access default property from +// private virtual method in sub class +// ******************************************** + +EXTDCLASS = new IntExtDynamicClass(); +AddTestCase( "access 'default' property from 'private virtual' method of sub class", arr, + (EXTDCLASS.testPrivVirtSubDPArray(arr)) ); + +// ******************************************** +// access default property from +// static public method of sub class +// ******************************************** + +thisError = "no error thrown"; +try{ + IntExtDynamicClass.pubStatSubGetDPArray(); +} catch(e3) { + thisError = e3.toString(); +} finally { + AddTestCase( "access default property from static public method of sub class", + TYPEERROR+1006, + typeError( thisError ) ); +} + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/IntExtDynamicClass/DynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/IntExtDynamicClass/DynamicClass.as new file mode 100644 index 00000000000..6dee1fbd55b --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/IntExtDynamicClass/DynamicClass.as @@ -0,0 +1,243 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DynamicClass { + + + dynamic class DynamicClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + // public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // **************** + // constructor + // **************** + + function DynamicClass() { + } + + // ***************** + // default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + } + public class DynamicClass extends DynamicClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/IntExtDynamicClass/IntExtDynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/IntExtDynamicClass/IntExtDynamicClass.as new file mode 100644 index 00000000000..a5b77569897 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/IntExtDynamicClass/IntExtDynamicClass.as @@ -0,0 +1,276 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DynamicClass { + + import DynamicClass.* + + // this is the test case so we can't alter it too much + // change the name of the class to ExtDynamicClassTest + // we'll create a public class ExtDynamicClass that + // extends it for testing runtime + internal class IntExtDynamicClassTest extends DynamicClass { + + // ************************************ + // access default method of parent + // from default method of sub class + // ************************************ + + internal function subGetArray() : Array { return this.getArray(); } + function subSetArray(a:Array) { this.setArray(a); } + + // this is needed so that the test cases can access this from + // outside the class. This way the test case itself preserved + public function testSubGetSetArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + // ************************************ + // access default method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return this.getArray(); } + public function pubSubSetArray(a:Array) { this.setArray(a); } + + // ************************************ + // access default method of parent + // from final method of sub class + // + // final will behave the same as default + // ************************************ + + internal final function finSubGetArray() : Array { return this.getArray(); } + final function finSubSetArray(a:Array) { this.setArray(a); } + + public function testFinSubArray(a:Array):Array{ + this.finSubSetArray(a); + return this.finSubGetArray(); + } + + // ************************************ + // access default method of parent + // from public final method of sub class + // ************************************ + + public final function pubFinSubGetArray() : Array { return this.getArray(); } + final public function pubFinSubSetArray(a:Array) { this.setArray(a); } + + // ************************************ + // access default method of parent + // from private final method of sub class + // ************************************ + + private final function privFinSubGetArray() : Array { return this.getArray(); } + final private function privFinSubSetArray(a:Array) { this.setArray(a); } + + public function testPrivFinSubArray(a:Array):Array { + this.privFinSubSetArray(a); + return this.privFinSubGetArray(); + } + + + // ************************************ + // access default method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return this.getArray(); } + private function privSubSetArray(a:Array) { this.setArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + // ************************************ + // access default method of parent + // from virtual method of sub class + // ************************************ + + internal virtual function virtSubGetArray() : Array { return this.getArray(); } + virtual function virtSubSetArray(a:Array) { this.setArray(a); } + + public function testVirtSubArray(a:Array) : Array { + this.virtSubSetArray(a); + return this.virtSubGetArray(); + } + + // ************************************ + // access default method of parent + // from public virtual method of sub class + // ************************************ + + virtual public function pubVirtSubGetArray() : Array { return this.getArray(); } + public virtual function pubVirtSubSetArray(a:Array) { this.setArray(a); } + + // ************************************ + // access default method of parent + // from private virtual method of sub class + // ************************************ + + virtual private function privVirtSubGetArray() : Array { return this.getArray(); } + private virtual function privVirtSubSetArray(a:Array) { this.setArray(a); } + + public function testPrivVirtSubArray(a:Array) : Array { + this.privVirtSubSetArray(a); + return this.privVirtSubGetArray(); + } + + // *************************************** + // access default property from + // static method of sub class + // *************************************** + + internal static function statSubGetArray():Array{ return getArray(); } + static public function pubStatSubGetArray():Array { return statSubGetArray(); } + + // *************************************** + // access default property from + // default method of sub class + // *************************************** + + internal function subGetDPArray() : Array { return array; } + function subSetDPArray(a:Array) { array = a; } + + // this is needed so that the test cases can access this from + // outside the class. This way the test case itself preserved + public function testSubGetSetDPArray(a:Array) : Array { + this.subSetDPArray(a); + return this.subGetDPArray(); + } + + // *************************************** + // access default property from + // final method of sub class + // *************************************** + + internal final function finSubGetDPArray() : Array { return array; } + final function finSubSetDPArray(a:Array) { array = a; } + + public function testFinSubDPArray(a:Array) : Array { + this.finSubSetDPArray(a); + return this.finSubGetDPArray(); + } + + // *************************************** + // access default property from + // virtual method of sub class + // *************************************** + + internal virtual function virtSubGetDPArray() : Array { return array; } + virtual function virtSubSetDPArray(a:Array) { array = a; } + + public function testVirtSubDPArray(a:Array) : Array { + this.virtSubSetDPArray(a); + return this.virtSubGetDPArray(); + } + + // *************************************** + // access default property from + // public method of sub class + // *************************************** + + public function pubSubGetDPArray() : Array { return this.array; } + public function pubSubSetDPArray(a:Array) { this.array = a; } + + // *************************************** + // access default property from + // private method of sub class + // *************************************** + + private function privSubGetDPArray() : Array { return this.array; } + private function privSubSetDPArray(a:Array) { this.array = a; } + + public function testPrivSubDPArray(a:Array) : Array { + this.privSubSetDPArray(a); + return this.privSubGetDPArray(); + } + + // *************************************** + // access default property from + // public final method of sub class + // *************************************** + + public final function pubFinSubGetDPArray() : Array { return this.array; } + final public function pubFinSubSetDPArray(a:Array) { this.array = a; } + + // *************************************** + // access default property from + // public virtual method of sub class + // *************************************** + + public virtual function pubVirtSubGetDPArray() : Array { return this.array; } + virtual public function pubVirtSubSetDPArray(a:Array) { this.array = a; } + + // *************************************** + // access default property from + // private final method of sub class + // *************************************** + + private final function privFinSubGetDPArray() : Array { return this.array; } + final private function privFinSubSetDPArray(a:Array) { this.array = a; } + + public function testPrivFinSubDPArray(a:Array):Array { + this.privFinSubSetDPArray(a); + return this.privFinSubGetDPArray(); + } + + // *************************************** + // access default property from + // private virtual method of sub class + // *************************************** + + private virtual function privVirtSubGetDPArray() : Array { return this.array; } + virtual private function privVirtSubSetDPArray(a:Array) { this.array = a; } + + public function testPrivVirtSubDPArray(a:Array):Array { + this.privVirtSubSetDPArray(a); + return this.privVirtSubGetDPArray(); + } + + // *************************************** + // access default property from + // public static method of sub class + // *************************************** + + public static function pubStatSubGetDPArray(){ + return array; + } + + } + + // same class as above except public + public class IntExtDynamicClass extends IntExtDynamicClassTest {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/IntExtInternalClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/IntExtInternalClass.as new file mode 100644 index 00000000000..6496888f401 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/IntExtInternalClass.as @@ -0,0 +1,239 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import InternalClass.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "Clean AS2"; // Version of JavaScript or ECMA +var TITLE = "Extend Default Class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + +// ******************************************** +// access default method from a default +// method of a sub class +// +// ******************************************** + +var arr = new Array(1,2,3); +EXTDCLASS = new IntExtInternalClass(); +AddTestCase( "access 'default' method from 'default' method of sub class", arr, (EXTDCLASS.testSubGetSetArray(arr)) ); + + +// ******************************************** +// access default method from a public +// method of a sub class +// ******************************************** + +arr = new Array( 4, 5, 6 ); +EXTDCLASS = new IntExtInternalClass(); +AddTestCase( "access 'default' method from 'public' method of sub class", arr, + (EXTDCLASS.pubSubSetArray(arr), EXTDCLASS.pubSubGetArray()) ); + +// ******************************************** +// access default method from a final +// method of a sub class +// ******************************************** + +arr = new Array( "one", "two", "three" ); +EXTDCLASS = new IntExtInternalClass(); +AddTestCase( "access 'default' method from 'final' method of sub class", arr, (EXTDCLASS.testFinSubArray(arr)) ); + +// ******************************************** +// access default method from a public +// final method of a sub class +// ******************************************** + +arr = new Array( 8, "two", 9 ); +EXTDCLASS = new IntExtInternalClass(); +AddTestCase( "access 'default' method from 'public final' method of sub class", arr, + (EXTDCLASS.pubFinSubSetArray(arr), EXTDCLASS.pubFinSubGetArray()) ); + +// ******************************************** +// access default method from a final +// private method of a sub class +// ******************************************** + +arr = new Array( "one", "two", "three" ); +EXTDCLASS = new IntExtInternalClass(); +AddTestCase( "access 'default' method from 'private final' method of sub class", arr, (EXTDCLASS.testPrivFinSubArray(arr)) ); + +// ******************************************** +// access default method from a private +// method of a sub class +// ******************************************** + +arr = new Array( 5, 6, 7 ); +EXTDCLASS = new IntExtInternalClass(); +AddTestCase( "access 'default' method from 'private' method of sub class", arr, EXTDCLASS.testPrivSubArray(arr) ); + +// ******************************************** +// access default method from a virtual +// method of a sub class +// ******************************************** + +AddTestCase( "access 'default' method from 'virtual' method of sub class", arr, + EXTDCLASS.testVirtSubArray(arr) ); + +// ******************************************** +// access default method from a virtual +// public method of a sub class +// ******************************************** + +AddTestCase( "access 'default' method from 'public virtual' method of sub class", arr, + (EXTDCLASS.pubVirtSubSetArray(arr), EXTDCLASS.pubVirtSubGetArray()) ); + +// ******************************************** +// access default method from a virtual +// private method of a sub class +// ******************************************** + +AddTestCase( "access 'default' method from 'private virtual' method of sub class", arr, + EXTDCLASS.testPrivVirtSubArray(arr) ); + +// ******************************************** +// access default method from static +// method of sub class +// ******************************************** + +var thisError = "no exception thrown"; +try{ + IntExtInternalClass.pubStatSubGetArray(); +} catch (e1) { + thisError = e1.toString(); +} finally { + AddTestCase( "access 'default' method from 'static' method of the sub class", + TYPEERROR+1006, + typeError( thisError) ); +} + +// ******************************************** +// access default property from +// default method in sub class +// ******************************************** + +EXTDCLASS = new IntExtInternalClass(); +AddTestCase( "access 'default' property from 'default' method of sub class", arr, + (EXTDCLASS.testSubGetSetDPArray(arr)) ); + +// ******************************************** +// access default property from +// final method in sub class +// ******************************************** + +EXTDCLASS = new IntExtInternalClass(); +AddTestCase( "access 'default' property from 'final' method of sub class", arr, + (EXTDCLASS.testFinSubDPArray(arr)) ); + +// ******************************************** +// access default property from +// virtual method in sub class +// ******************************************** + +EXTDCLASS = new IntExtInternalClass(); +AddTestCase( "access 'default' property from 'virtual' method of sub class", arr, + (EXTDCLASS.testVirtSubDPArray(arr)) ); + +// ******************************************** +// access default property from +// public method in sub class +// ******************************************** + +EXTDCLASS = new IntExtInternalClass(); +AddTestCase( "access 'default' property from 'public' method of sub class", arr, + (EXTDCLASS.pubSubSetDPArray(arr), EXTDCLASS.pubSubGetDPArray()) ); + +// ******************************************** +// access default property from +// private method in sub class +// ******************************************** + +EXTDCLASS = new IntExtInternalClass(); +AddTestCase( "access 'default' property from 'private' method of sub class", arr, + (EXTDCLASS.testPrivSubDPArray(arr)) ); + +// ******************************************** +// access default property from +// public final method in sub class +// ******************************************** + +EXTDCLASS = new IntExtInternalClass(); +AddTestCase( "access 'default' property from 'public final' method of sub class", arr, + (EXTDCLASS.pubFinSubSetDPArray(arr), EXTDCLASS.pubFinSubGetDPArray()) ); + +// ******************************************** +// access default property from +// public virtual method in sub class +// ******************************************** + +EXTDCLASS = new IntExtInternalClass(); +AddTestCase( "access 'default' property from 'public virtual' method of sub class", arr, + (EXTDCLASS.pubVirtSubSetDPArray(arr), EXTDCLASS.pubVirtSubGetDPArray()) ); + +// ******************************************** +// access default property from +// private final method in sub class +// ******************************************** + +EXTDCLASS = new IntExtInternalClass(); +AddTestCase( "access 'default' property from 'private final' method of sub class", arr, + (EXTDCLASS.testPrivFinSubDPArray(arr)) ); + +// ******************************************** +// access default property from +// private virtual method in sub class +// ******************************************** + +EXTDCLASS = new IntExtInternalClass(); +AddTestCase( "access 'default' property from 'private virtual' method of sub class", arr, + (EXTDCLASS.testPrivVirtSubDPArray(arr)) ); + +// ******************************************** +// access default property from +// static public method of sub class +// ******************************************** + +thisError = "no error thrown"; +try{ + IntExtInternalClass.pubStatSubGetDPArray(); +} catch(e3) { + thisError = e3.toString(); +} finally { + AddTestCase( "access default property from static public method of sub class", + TYPEERROR+1006, + typeError( thisError ) ); +} + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/IntExtInternalClass/IntExtInternalClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/IntExtInternalClass/IntExtInternalClass.as new file mode 100644 index 00000000000..ead7ce8b371 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/IntExtInternalClass/IntExtInternalClass.as @@ -0,0 +1,508 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package InternalClass { + + + + internal class InternalClass { + + internal var array:Array; + var boolean:Boolean; + internal var date:Date; + var myFunction:Function; + internal var math:Math; + var number:Number; + internal var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + //public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + internal function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + internal function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + internal function getNumber() : Number { return number; } + function getObject() : Object { return object; } + internal function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + internal function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + internal function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + internal function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + internal function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + } + + + + + // this is the test case so we can't alter it too much + // change the name of the class to ExtInternalClassTest + // we'll create a public class ExtInternalClass that + // extends it for testing runtime + internal class IntExtInternalClassTest extends InternalClass { + + // ************************************ + // access default method of parent + // from default method of sub class + // ************************************ + + internal function subGetArray() : Array { return this.getArray(); } + function subSetArray(a:Array) { this.setArray(a); } + + // this is needed so that the test cases can access this from + // outside the class. This way the test case itself preserved + public function testSubGetSetArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + // ************************************ + // access default method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return this.getArray(); } + public function pubSubSetArray(a:Array) { this.setArray(a); } + + // ************************************ + // access default method of parent + // from final method of sub class + // + // final will behave the same as default + // ************************************ + + internal final function finSubGetArray() : Array { return this.getArray(); } + final function finSubSetArray(a:Array) { this.setArray(a); } + + public function testFinSubArray(a:Array):Array{ + this.finSubSetArray(a); + return this.finSubGetArray(); + } + + // ************************************ + // access default method of parent + // from public final method of sub class + // ************************************ + + public final function pubFinSubGetArray() : Array { return this.getArray(); } + final public function pubFinSubSetArray(a:Array) { this.setArray(a); } + + // ************************************ + // access default method of parent + // from private final method of sub class + // ************************************ + + private final function privFinSubGetArray() : Array { return this.getArray(); } + final private function privFinSubSetArray(a:Array) { this.setArray(a); } + + public function testPrivFinSubArray(a:Array):Array { + this.privFinSubSetArray(a); + return this.privFinSubGetArray(); + } + + + // ************************************ + // access default method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return this.getArray(); } + private function privSubSetArray(a:Array) { this.setArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + // ************************************ + // access default method of parent + // from virtual method of sub class + // ************************************ + + internal virtual function virtSubGetArray() : Array { return this.getArray(); } + virtual function virtSubSetArray(a:Array) { this.setArray(a); } + + public function testVirtSubArray(a:Array) : Array { + this.virtSubSetArray(a); + return this.virtSubGetArray(); + } + + // ************************************ + // access default method of parent + // from public virtual method of sub class + // ************************************ + + virtual public function pubVirtSubGetArray() : Array { return this.getArray(); } + public virtual function pubVirtSubSetArray(a:Array) { this.setArray(a); } + + // ************************************ + // access default method of parent + // from private virtual method of sub class + // ************************************ + + virtual private function privVirtSubGetArray() : Array { return this.getArray(); } + private virtual function privVirtSubSetArray(a:Array) { this.setArray(a); } + + public function testPrivVirtSubArray(a:Array) : Array { + this.privVirtSubSetArray(a); + return this.privVirtSubGetArray(); + } + + // *************************************** + // access default property from + // static method of sub class + // *************************************** + + internal static function statSubGetArray():Array{ return getArray(); } + static public function pubStatSubGetArray():Array { return statSubGetArray(); } + + // *************************************** + // access default property from + // default method of sub class + // *************************************** + + internal function subGetDPArray() : Array { return array; } + function subSetDPArray(a:Array) { array = a; } + + // this is needed so that the test cases can access this from + // outside the class. This way the test case itself preserved + public function testSubGetSetDPArray(a:Array) : Array { + this.subSetDPArray(a); + return this.subGetDPArray(); + } + + // *************************************** + // access default property from + // final method of sub class + // *************************************** + + internal final function finSubGetDPArray() : Array { return array; } + final function finSubSetDPArray(a:Array) { array = a; } + + public function testFinSubDPArray(a:Array) : Array { + this.finSubSetDPArray(a); + return this.finSubGetDPArray(); + } + + // *************************************** + // access default property from + // virtual method of sub class + // *************************************** + + internal virtual function virtSubGetDPArray() : Array { return array; } + virtual function virtSubSetDPArray(a:Array) { array = a; } + + public function testVirtSubDPArray(a:Array) : Array { + this.virtSubSetDPArray(a); + return this.virtSubGetDPArray(); + } + + // *************************************** + // access default property from + // public method of sub class + // *************************************** + + public function pubSubGetDPArray() : Array { return this.array; } + public function pubSubSetDPArray(a:Array) { this.array = a; } + + // *************************************** + // access default property from + // private method of sub class + // *************************************** + + private function privSubGetDPArray() : Array { return this.array; } + private function privSubSetDPArray(a:Array) { this.array = a; } + + public function testPrivSubDPArray(a:Array) : Array { + this.privSubSetDPArray(a); + return this.privSubGetDPArray(); + } + + // *************************************** + // access default property from + // public final method of sub class + // *************************************** + + public final function pubFinSubGetDPArray() : Array { return this.array; } + final public function pubFinSubSetDPArray(a:Array) { this.array = a; } + + // *************************************** + // access default property from + // public virtual method of sub class + // *************************************** + + public virtual function pubVirtSubGetDPArray() : Array { return this.array; } + virtual public function pubVirtSubSetDPArray(a:Array) { this.array = a; } + + // *************************************** + // access default property from + // private final method of sub class + // *************************************** + + private final function privFinSubGetDPArray() : Array { return this.array; } + final private function privFinSubSetDPArray(a:Array) { this.array = a; } + + public function testPrivFinSubDPArray(a:Array):Array { + this.privFinSubSetDPArray(a); + return this.privFinSubGetDPArray(); + } + + // *************************************** + // access default property from + // private virtual method of sub class + // *************************************** + + private virtual function privVirtSubGetDPArray() : Array { return this.array; } + virtual private function privVirtSubSetDPArray(a:Array) { this.array = a; } + + public function testPrivVirtSubDPArray(a:Array):Array { + this.privVirtSubSetDPArray(a); + return this.privVirtSubGetDPArray(); + } + + // *************************************** + // access default property from + // public static method of sub class + // *************************************** + + public static function pubStatSubGetDPArray(){ + return array; + } + + } + + // same class as above except public + public class IntExtInternalClass extends IntExtInternalClassTest {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/IntExtPublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/IntExtPublicClass.as new file mode 100644 index 00000000000..c3d6830af6b --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/IntExtPublicClass.as @@ -0,0 +1,239 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import PublicClass.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "Clean AS2"; // Version of JavaScript or ECMA +var TITLE = "Extend Default Class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + +// ******************************************** +// access default method from a default +// method of a sub class +// +// ******************************************** + +var arr = new Array(1,2,3); +EXTDCLASS = new IntExtPublicClass(); +AddTestCase( "access 'default' method from 'default' method of sub class", arr, (EXTDCLASS.testSubGetSetArray(arr)) ); + + +// ******************************************** +// access default method from a public +// method of a sub class +// ******************************************** + +arr = new Array( 4, 5, 6 ); +EXTDCLASS = new IntExtPublicClass(); +AddTestCase( "access 'default' method from 'public' method of sub class", arr, + (EXTDCLASS.pubSubSetArray(arr), EXTDCLASS.pubSubGetArray()) ); + +// ******************************************** +// access default method from a final +// method of a sub class +// ******************************************** + +arr = new Array( "one", "two", "three" ); +EXTDCLASS = new IntExtPublicClass(); +AddTestCase( "access 'default' method from 'final' method of sub class", arr, (EXTDCLASS.testFinSubArray(arr)) ); + +// ******************************************** +// access default method from a public +// final method of a sub class +// ******************************************** + +arr = new Array( 8, "two", 9 ); +EXTDCLASS = new IntExtPublicClass(); +AddTestCase( "access 'default' method from 'public final' method of sub class", arr, + (EXTDCLASS.pubFinSubSetArray(arr), EXTDCLASS.pubFinSubGetArray()) ); + +// ******************************************** +// access default method from a final +// private method of a sub class +// ******************************************** + +arr = new Array( "one", "two", "three" ); +EXTDCLASS = new IntExtPublicClass(); +AddTestCase( "access 'default' method from 'private final' method of sub class", arr, (EXTDCLASS.testPrivFinSubArray(arr)) ); + +// ******************************************** +// access default method from a private +// method of a sub class +// ******************************************** + +arr = new Array( 5, 6, 7 ); +EXTDCLASS = new IntExtPublicClass(); +AddTestCase( "access 'default' method from 'private' method of sub class", arr, EXTDCLASS.testPrivSubArray(arr) ); + +// ******************************************** +// access default method from a virtual +// method of a sub class +// ******************************************** + +AddTestCase( "access 'default' method from 'virtual' method of sub class", arr, + EXTDCLASS.testVirtSubArray(arr) ); + +// ******************************************** +// access default method from a virtual +// public method of a sub class +// ******************************************** + +AddTestCase( "access 'default' method from 'public virtual' method of sub class", arr, + (EXTDCLASS.pubVirtSubSetArray(arr), EXTDCLASS.pubVirtSubGetArray()) ); + +// ******************************************** +// access default method from a virtual +// private method of a sub class +// ******************************************** + +AddTestCase( "access 'default' method from 'private virtual' method of sub class", arr, + EXTDCLASS.testPrivVirtSubArray(arr) ); + +// ******************************************** +// access default method from static +// method of sub class +// ******************************************** + +var thisError = "no exception thrown"; +try{ + IntExtPublicClass.pubStatSubGetArray(); +} catch (e1) { + thisError = e1.toString(); +} finally { + AddTestCase( "access 'default' method from 'static' method of the sub class", + TYPEERROR+1006, + typeError( thisError) ); +} + +// ******************************************** +// access default property from +// default method in sub class +// ******************************************** + +EXTDCLASS = new IntExtPublicClass(); +AddTestCase( "access 'default' property from 'default' method of sub class", arr, + (EXTDCLASS.testSubGetSetDPArray(arr)) ); + +// ******************************************** +// access default property from +// final method in sub class +// ******************************************** + +EXTDCLASS = new IntExtPublicClass(); +AddTestCase( "access 'default' property from 'final' method of sub class", arr, + (EXTDCLASS.testFinSubDPArray(arr)) ); + +// ******************************************** +// access default property from +// virtual method in sub class +// ******************************************** + +EXTDCLASS = new IntExtPublicClass(); +AddTestCase( "access 'default' property from 'virtual' method of sub class", arr, + (EXTDCLASS.testVirtSubDPArray(arr)) ); + +// ******************************************** +// access default property from +// public method in sub class +// ******************************************** + +EXTDCLASS = new IntExtPublicClass(); +AddTestCase( "access 'default' property from 'public' method of sub class", arr, + (EXTDCLASS.pubSubSetDPArray(arr), EXTDCLASS.pubSubGetDPArray()) ); + +// ******************************************** +// access default property from +// private method in sub class +// ******************************************** + +EXTDCLASS = new IntExtPublicClass(); +AddTestCase( "access 'default' property from 'private' method of sub class", arr, + (EXTDCLASS.testPrivSubDPArray(arr)) ); + +// ******************************************** +// access default property from +// public final method in sub class +// ******************************************** + +EXTDCLASS = new IntExtPublicClass(); +AddTestCase( "access 'default' property from 'public final' method of sub class", arr, + (EXTDCLASS.pubFinSubSetDPArray(arr), EXTDCLASS.pubFinSubGetDPArray()) ); + +// ******************************************** +// access default property from +// public virtual method in sub class +// ******************************************** + +EXTDCLASS = new IntExtPublicClass(); +AddTestCase( "access 'default' property from 'public virtual' method of sub class", arr, + (EXTDCLASS.pubVirtSubSetDPArray(arr), EXTDCLASS.pubVirtSubGetDPArray()) ); + +// ******************************************** +// access default property from +// private final method in sub class +// ******************************************** + +EXTDCLASS = new IntExtPublicClass(); +AddTestCase( "access 'default' property from 'private final' method of sub class", arr, + (EXTDCLASS.testPrivFinSubDPArray(arr)) ); + +// ******************************************** +// access default property from +// private virtual method in sub class +// ******************************************** + +EXTDCLASS = new IntExtPublicClass(); +AddTestCase( "access 'default' property from 'private virtual' method of sub class", arr, + (EXTDCLASS.testPrivVirtSubDPArray(arr)) ); + +// ******************************************** +// access default property from +// static public method of sub class +// ******************************************** + +thisError = "no error thrown"; +try{ + IntExtPublicClass.pubStatSubGetDPArray(); +} catch(e3) { + thisError = e3.toString(); +} finally { + AddTestCase( "access default property from static public method of sub class", + TYPEERROR+1006, + typeError( thisError ) ); +} + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/IntExtPublicClass/IntExtPublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/IntExtPublicClass/IntExtPublicClass.as new file mode 100644 index 00000000000..06c9810695a --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/IntExtPublicClass/IntExtPublicClass.as @@ -0,0 +1,505 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + + + public class PublicClass { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + //public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finMyFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray():Array { return finArray; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + + } + + // this is the test case so we can't alter it too much + // change the name of the class to ExtPublicClassTest + // we'll create a public class ExtPublicClass that + // extends it for testing runtime + internal class IntExtPublicClassTest extends PublicClass { + + // ************************************ + // access default method of parent + // from default method of sub class + // ************************************ + + internal function subGetArray() : Array { return this.getArray(); } + function subSetArray(a:Array) { this.setArray(a); } + + // this is needed so that the test cases can access this from + // outside the class. This way the test case itself preserved + public function testSubGetSetArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + // ************************************ + // access default method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return this.getArray(); } + public function pubSubSetArray(a:Array) { this.setArray(a); } + + // ************************************ + // access default method of parent + // from final method of sub class + // + // final will behave the same as default + // ************************************ + + internal final function finSubGetArray() : Array { return this.getArray(); } + final function finSubSetArray(a:Array) { this.setArray(a); } + + public function testFinSubArray(a:Array):Array{ + this.finSubSetArray(a); + return this.finSubGetArray(); + } + + // ************************************ + // access default method of parent + // from public final method of sub class + // ************************************ + + public final function pubFinSubGetArray() : Array { return this.getArray(); } + final public function pubFinSubSetArray(a:Array) { this.setArray(a); } + + // ************************************ + // access default method of parent + // from private final method of sub class + // ************************************ + + private final function privFinSubGetArray() : Array { return this.getArray(); } + final private function privFinSubSetArray(a:Array) { this.setArray(a); } + + public function testPrivFinSubArray(a:Array):Array { + this.privFinSubSetArray(a); + return this.privFinSubGetArray(); + } + + + // ************************************ + // access default method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return this.getArray(); } + private function privSubSetArray(a:Array) { this.setArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + // ************************************ + // access default method of parent + // from virtual method of sub class + // ************************************ + + internal virtual function virtSubGetArray() : Array { return this.getArray(); } + virtual function virtSubSetArray(a:Array) { this.setArray(a); } + + public function testVirtSubArray(a:Array) : Array { + this.virtSubSetArray(a); + return this.virtSubGetArray(); + } + + // ************************************ + // access default method of parent + // from public virtual method of sub class + // ************************************ + + virtual public function pubVirtSubGetArray() : Array { return this.getArray(); } + public virtual function pubVirtSubSetArray(a:Array) { this.setArray(a); } + + // ************************************ + // access default method of parent + // from private virtual method of sub class + // ************************************ + + virtual private function privVirtSubGetArray() : Array { return this.getArray(); } + private virtual function privVirtSubSetArray(a:Array) { this.setArray(a); } + + public function testPrivVirtSubArray(a:Array) : Array { + this.privVirtSubSetArray(a); + return this.privVirtSubGetArray(); + } + + // *************************************** + // access default property from + // static method of sub class + // *************************************** + + internal static function statSubGetArray():Array{ return getArray(); } + static public function pubStatSubGetArray():Array { return statSubGetArray(); } + + // *************************************** + // access default property from + // default method of sub class + // *************************************** + + internal function subGetDPArray() : Array { return array; } + function subSetDPArray(a:Array) { array = a; } + + // this is needed so that the test cases can access this from + // outside the class. This way the test case itself preserved + public function testSubGetSetDPArray(a:Array) : Array { + this.subSetDPArray(a); + return this.subGetDPArray(); + } + + // *************************************** + // access default property from + // final method of sub class + // *************************************** + + internal final function finSubGetDPArray() : Array { return array; } + final function finSubSetDPArray(a:Array) { array = a; } + + public function testFinSubDPArray(a:Array) : Array { + this.finSubSetDPArray(a); + return this.finSubGetDPArray(); + } + + // *************************************** + // access default property from + // virtual method of sub class + // *************************************** + + internal virtual function virtSubGetDPArray() : Array { return array; } + virtual function virtSubSetDPArray(a:Array) { array = a; } + + public function testVirtSubDPArray(a:Array) : Array { + this.virtSubSetDPArray(a); + return this.virtSubGetDPArray(); + } + + // *************************************** + // access default property from + // public method of sub class + // *************************************** + + public function pubSubGetDPArray() : Array { return this.array; } + public function pubSubSetDPArray(a:Array) { this.array = a; } + + // *************************************** + // access default property from + // private method of sub class + // *************************************** + + private function privSubGetDPArray() : Array { return this.array; } + private function privSubSetDPArray(a:Array) { this.array = a; } + + public function testPrivSubDPArray(a:Array) : Array { + this.privSubSetDPArray(a); + return this.privSubGetDPArray(); + } + + // *************************************** + // access default property from + // public final method of sub class + // *************************************** + + public final function pubFinSubGetDPArray() : Array { return this.array; } + final public function pubFinSubSetDPArray(a:Array) { this.array = a; } + + // *************************************** + // access default property from + // public virtual method of sub class + // *************************************** + + public virtual function pubVirtSubGetDPArray() : Array { return this.array; } + virtual public function pubVirtSubSetDPArray(a:Array) { this.array = a; } + + // *************************************** + // access default property from + // private final method of sub class + // *************************************** + + private final function privFinSubGetDPArray() : Array { return this.array; } + final private function privFinSubSetDPArray(a:Array) { this.array = a; } + + public function testPrivFinSubDPArray(a:Array):Array { + this.privFinSubSetDPArray(a); + return this.privFinSubGetDPArray(); + } + + // *************************************** + // access default property from + // private virtual method of sub class + // *************************************** + + private virtual function privVirtSubGetDPArray() : Array { return this.array; } + virtual private function privVirtSubSetDPArray(a:Array) { this.array = a; } + + public function testPrivVirtSubDPArray(a:Array):Array { + this.privVirtSubSetDPArray(a); + return this.privVirtSubGetDPArray(); + } + + // *************************************** + // access default property from + // public static method of sub class + // *************************************** + + public static function pubStatSubGetDPArray(){ + return array; + } + + } + + // same class as above except public + public class IntExtPublicClass extends IntExtPublicClassTest {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDefaultClass.as new file mode 100644 index 00000000000..1174ae67c2b --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDefaultClass.as @@ -0,0 +1,177 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DefaultClass{ +import DefaultClass.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Extend Default Class"; // Provide ECMA section title or a description +//var BUGNUMBER = ""; + +startTest(); // leave this alone + + +// ************************************ +// public class extends class +// ************************************ + +var arr = new Array(1,2,3); + +// ******************************************** +// access default method from outside of class +// ******************************************** + +// this should give a compiler error +PUBEXTDCLASS = new PubExtDefaultClass(); + +//We cannot access the default method from outside the class +//AddTestCase( "PUBEXTDCLASS.setArray(arr), PUBEXTDCLASS.getArray()", arr, (PUBEXTDCLASS.setArray(arr), PUBEXTDCLASS.getArray()) ); + + +// ******************************************** +// access default method from a default +// method of a sub class +// +// ******************************************** + +PUBEXTDCLASS = new PubExtDefaultClass(); +AddTestCase( "*** Access default method from default method of sub class ***", 1, 1 ); +AddTestCase( "PUBEXTDCLASS.subSetArray(arr), PUBEXTDCLASS.subGetArray()", arr, PUBEXTDCLASS.testSubGetSetArray(arr) ); + +// fill in the rest of the cases here + + +// ******************************************** +// access default method from a public +// method of a sub class +// +// ******************************************** + +PUBEXTDCLASS = new PubExtDefaultClass(); +AddTestCase( "*** Access default method from public method of sub class ***", 1, 1 ); +AddTestCase( "PUBEXTDCLASS.pubSubSetArray(arr), PUBEXTDCLASS.pubSubGetArray()", arr, (PUBEXTDCLASS.pubSubSetArray(arr), PUBEXTDCLASS.pubSubGetArray()) ); + +// fill in the rest of the cases here + +// ******************************************** +// access default method from a private +// method of a sub class +// +// ******************************************** + +PUBEXTDCLASS = new PubExtDefaultClass(); +AddTestCase( "*** Access default method from private method of sub class ***", 1, 1 ); +AddTestCase( "PUBEXTDCLASS.testPrivSubArray(arr)", arr, PUBEXTDCLASS.testPrivSubArray(arr) ); + +// fill in the rest of the cases here + +// ******************************************** +// access default method from a final +// method of a sub class +// +// ******************************************** + +PUBEXTDCLASS = new PubExtDefaultClass(); +AddTestCase( "*** Access default method from default method of sub class ***", 1, 1 ); +AddTestCase( "PUBEXTDCLASS.finSubSetArray(arr), PUBEXTDCLASS.finSubGetArray()", arr, PUBEXTDCLASS.testFinSubArray(arr) ); + +// ******************************************** +// access default property from outside +// the class +// ******************************************** + +PUBEXTDCLASS = new PubExtDefaultClass(); +AddTestCase( "*** Access default property from outside the class ***", 1, 1 ); +//AddTestCase( "PUBEXTDCLASS.array = arr", arr, (PUBEXTDCLASS.array = arr, PUBEXTDCLASS.array) ); + +// fill in the rest of the cases here + +// ******************************************** +// access default property from +// default method in sub class +// ******************************************** + +PUBEXTDCLASS = new PubExtDefaultClass(); +AddTestCase( "*** Access default property from method in sub class ***", 1, 1 ); +AddTestCase( "PUBEXTDCLASS.subSetDPArray(arr), PUBEXTDCLASS.subGetDPArray()", arr, PUBEXTDCLASS.testSubGetSetDPArray(arr) ); + +// fill in the rest of the cases here + +// ******************************************** +// access default property from +// public method in sub class +// ******************************************** + +PUBEXTDCLASS = new PubExtDefaultClass(); +AddTestCase( "*** Access default property from public method in sub class ***", 1, 1 ); +AddTestCase( "PUBEXTDCLASS.pubSubSetDPArray(arr), PUBEXTDCLASS.pubSubGetDPArray()", arr, (PUBEXTDCLASS.pubSubSetDPArray(arr), PUBEXTDCLASS.pubSubGetDPArray()) ); + +// fill in the rest of the cases here + +// ******************************************** +// access default property from +// private method in sub class +// ******************************************** + +PUBEXTDCLASS = new PubExtDefaultClass(); +AddTestCase( "*** Access default property from private method in sub class ***", 1, 1 ); +AddTestCase( "PUBEXTDCLASS.privSubSetDPArray(arr), PUBEXTDCLASS.privSubGetDPArray()", arr, PUBEXTDCLASS.testPrivSubDPArray(arr) ); + +// fill in the rest of the cases here + +// ******************************************** +// access default property from +// final method in sub class +// ******************************************** + +PUBEXTDCLASS = new PubExtDefaultClass(); +AddTestCase( "*** Access default property from final method in sub class ***", 1, 1 ); +AddTestCase( "PUBEXTDCLASS.finSubSetDPArray(arr), PUBEXTDCLASS.finSubGetDPArray()", arr, PUBEXTDCLASS.testFinSubDPArray(arr) ); + + +// ******************************************** +// Class Prototype Testing +// ******************************************** + +//Add new property to parent through prototype object, verify child inherits it +var child = new PubExtDefaultClass(); +DefaultClassInner.prototype.fakeProp = 100; +AddTestCase("*** Add new property to parent prototype object, verify child class inherits it ***", 100, child.fakeProp); + +//Try overriding parent property through prototype object, verify child object has correct value +DefaultClassInner.prototype.pObj = 2; +child = new PubExtDefaultClass(); +AddTestCase("*** Try overriding parent property through prototype object, verify child object has correct value ***", 1, child.pObj); + +test(); // leave this alone. this executes the test cases and + // displays results. + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDefaultClass/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDefaultClass/DefaultClass.as new file mode 100644 index 00000000000..88e805565bd --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDefaultClass/DefaultClass.as @@ -0,0 +1,267 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DefaultClass { + + class DefaultClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + //public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + //For class prototype testing + var pObj:Number = 1; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + } + + public class DefaultClass extends DefaultClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDefaultClass/PubExtDefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDefaultClass/PubExtDefaultClass.as new file mode 100644 index 00000000000..7414378021b --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDefaultClass/PubExtDefaultClass.as @@ -0,0 +1,140 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + +package DefaultClass { + + import DefaultClass.*; + + public class PubExtDefaultClass extends DefaultClass { + + // ************************************ + // access default method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return this.getArray(); } + function subSetArray(a:Array) { this.setArray(a); } + + + // ************************************ + // access default method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return this.getArray(); } + public function pubSubSetArray(a:Array) { this.setArray(a); } + + // this is needed so that the test cases can access this from + // outside the class. This way the test case itself preserved + public function testSubGetSetArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + // ************************************ + // access default method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return this.getArray(); } + private function privSubSetArray(a:Array) { this.setArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + // ************************************ + // access default method of parent + // from final method of sub class + // ************************************ + + final function finSubGetArray() : Array { return this.getArray(); } + final function finSubSetArray(a:Array) { this.setArray(a); } + + public function testFinSubArray(a:Array):Array{ + this.finSubSetArray(a); + return this.finSubGetArray(); + } + + // *************************************** + // access default property from + // default method of sub class + // *************************************** + + function subGetDPArray() : Array { return array; } + function subSetDPArray(a:Array) { array = a; } + + public function testSubGetSetDPArray(a:Array) : Array { + this.subSetDPArray(a); + return this.subGetDPArray(); + } + + // *************************************** + // access default property from + // public method of sub class + // *************************************** + + public function pubSubGetDPArray() : Array { return this.array; } + public function pubSubSetDPArray(a:Array) { this.array = a; } + + // *************************************** + // access default property from + // private method of sub class + // *************************************** + + private function privSubGetDPArray() : Array { return this.array; } + private function privSubSetDPArray(a:Array) { this.array = a; } + + public function testPrivSubDPArray(a:Array) : Array { + this.privSubSetDPArray(a); + return this.privSubGetDPArray(); + } + + + // *************************************** + // access default property from + // final method of sub class + // *************************************** + + final function finSubGetDPArray() : Array { return array; } + final function finSubSetDPArray(a:Array) { array = a; } + + public function testFinSubDPArray(a:Array):Array { + this.finSubSetDPArray(a); + return this.finSubGetDPArray(); + } + + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDefaultClassFin.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDefaultClassFin.as new file mode 100644 index 00000000000..927bd9796d0 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDefaultClassFin.as @@ -0,0 +1,142 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +// import statements must be first +import DefaultClass.*; + + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "public class extend class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + + +// ******************************************** +// access final method from a default +// method of a sub class +// +// ******************************************** + +var arr = new Array(1,2,3); +EXTDCLASS = new PubExtDefaultClassFin(); +AddTestCase( "*** Access final method from default method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.subSetArray(arr), EXTDCLASS.subGetArray()", arr, EXTDCLASS.testSubGetSetArray(arr) ); + +// fill in the rest of the cases here + + +// ******************************************** +// access final method from a public +// method of a sub class +// +// ******************************************** + +EXTDCLASS = new PubExtDefaultClassFin(); +AddTestCase( "*** Access final method from public method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.pubSubSetArray(arr), EXTDCLASS.pubSubGetArray()", arr, (EXTDCLASS.pubSubSetArray(arr), EXTDCLASS.pubSubGetArray()) ); + +// fill in the rest of the cases here + +// ******************************************** +// access final method from a private +// method of a sub class +// +// ******************************************** + +EXTDCLASS = new PubExtDefaultClassFin(); +AddTestCase( "*** Access final method from private method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testPrivSubArray(arr)", arr, EXTDCLASS.testPrivSubArray(arr) ); + +// fill in the rest of the cases here + +// ******************************************** +// access final method from a final +// method of a sub class +// +// ******************************************** + +EXTDCLASS = new PubExtDefaultClassFin(); +AddTestCase( "*** Access final method from final method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.finSubSetArray(arr), EXTDCLASS.finSubGetArray()", arr, EXTDCLASS.testFinSubArray(arr) ); + + +// fill in the rest of the cases here + +// ******************************************** +// access final property from +// default method in sub class +// ******************************************** + +EXTDCLASS = new PubExtDefaultClassFin(); +AddTestCase( "*** Access final property from method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.subSetDPArray(arr), EXTDCLASS.subGetDPArray()", arr, EXTDCLASS.testSubGetSetDPArray(arr) ); + +// fill in the rest of the cases here + +// ******************************************** +// access final property from +// public method in sub class +// ******************************************** + +EXTDCLASS = new PubExtDefaultClassFin(); +AddTestCase( "*** Access final property from public method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.pubSubSetDPArray(arr), EXTDCLASS.pubSubGetDPArray()", arr, (EXTDCLASS.pubSubSetDPArray(arr), EXTDCLASS.pubSubGetDPArray()) ); + +// fill in the rest of the cases here + +// ******************************************** +// access final property from +// private method in sub class +// ******************************************** + +EXTDCLASS = new PubExtDefaultClassFin(); +AddTestCase( "*** Access final property from private method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.privSubSetDPArray(arr), EXTDCLASS.privSubGetDPArray()", arr, EXTDCLASS.testPrivSubDPArray(arr) ); + +// fill in the rest of the cases here + + +// ******************************************** +// access final property from +// final method in sub class +// ******************************************** + +EXTDCLASS = new PubExtDefaultClassFin(); +AddTestCase( "*** Access final property from final method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.finSubSetDPArray(arr), EXTDCLASS.finSubGetDPArray()", arr, EXTDCLASS.testFinSubDPArray(arr) ); + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDefaultClassFin/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDefaultClassFin/DefaultClass.as new file mode 100644 index 00000000000..2b3618393b9 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDefaultClassFin/DefaultClass.as @@ -0,0 +1,264 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DefaultClass { + + class DefaultClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + //public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + } + + public class DefaultClass extends DefaultClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDefaultClassFin/PubExtDefaultClassFin.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDefaultClassFin/PubExtDefaultClassFin.as new file mode 100644 index 00000000000..e2df14d7f37 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDefaultClassFin/PubExtDefaultClassFin.as @@ -0,0 +1,142 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DefaultClass { + + + import DefaultClass.*; + + public class PubExtDefaultClassFin extends DefaultClass { + + // ************************************ + // access final method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return this.getFinArray(); } + function subSetArray(a:Array) { this.setFinArray(a); } + + // this is needed so that the test cases can access this from + // outside the class. This way the test case itself preserved + public function testSubGetSetArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + + // ************************************ + // access final method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return this.getFinArray(); } + public function pubSubSetArray(a:Array) { this.setFinArray(a); } + + // ************************************ + // access final method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return this.getFinArray(); } + private function privSubSetArray(a:Array) { this.setFinArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + // ************************************ + // access final method of parent + // from final method of sub class + // ************************************ + + final function finSubGetArray() : Array { return this.getFinArray(); } + final function finSubSetArray(a:Array) { this.setFinArray(a); } + + public function testFinSubArray(a:Array):Array{ + this.finSubSetArray(a); + return this.finSubGetArray(); + } + + + // *************************************** + // access final property from + // default method of sub class + // *************************************** + + function subGetDPArray() : Array { return finArray; } + function subSetDPArray(a:Array) { finArray = a; } + + public function testSubGetSetDPArray(a:Array) : Array { + this.subSetDPArray(a); + return this.subGetDPArray(); + } + + + // *************************************** + // access final property from + // public method of sub class + // *************************************** + + public function pubSubGetDPArray() : Array { return this.finArray; } + public function pubSubSetDPArray(a:Array) { this.finArray = a; } + + // *************************************** + // access final property from + // private method of sub class + // *************************************** + + private function privSubGetDPArray() : Array { return this.finArray; } + private function privSubSetDPArray(a:Array) { this.finArray = a; } + + public function testPrivSubDPArray(a:Array) : Array { + this.privSubSetDPArray(a); + return this.privSubGetDPArray(); + } + + + // *************************************** + // access final property from + // final method of sub class + // *************************************** + + final function finSubGetDPArray() : Array { return finArray; } + final function finSubSetDPArray(a:Array) { finArray = a; } + + public function testFinSubDPArray(a:Array):Array { + this.finSubSetDPArray(a); + return this.finSubGetDPArray(); + } + + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDefaultClassPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDefaultClassPub.as new file mode 100644 index 00000000000..5df708eabae --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDefaultClassPub.as @@ -0,0 +1,43 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import DefaultClass.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "public class extend Class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var EXTDCLASS = new PubExtDefaultClassPub(); + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDefaultClassPub/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDefaultClassPub/DefaultClass.as new file mode 100644 index 00000000000..2b3618393b9 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDefaultClassPub/DefaultClass.as @@ -0,0 +1,264 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DefaultClass { + + class DefaultClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + //public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + } + + public class DefaultClass extends DefaultClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDefaultClassPub/PubExtDefaultClassPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDefaultClassPub/PubExtDefaultClassPub.as new file mode 100644 index 00000000000..9e89fd1628d --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDefaultClassPub/PubExtDefaultClassPub.as @@ -0,0 +1,139 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DefaultClass { + + + import DefaultClass.*; + + public class PubExtDefaultClassPub extends DefaultClass { + + // ************************************ + // access public method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return this.getPubArray(); } + function subSetArray(a:Array) { this.setPubArray(a); } + + public function testSubGetSetArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + + // ************************************ + // access public method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return this.getPubArray(); } + public function pubSubSetArray(a:Array) { this.setPubArray(a); } + + // ************************************ + // access public method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return this.getPubArray(); } + private function privSubSetArray(a:Array) { this.setPubArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + // ************************************ + // access public method of parent + // from final method of sub class + // ************************************ + + final function finSubGetArray() : Array { return this.getPubArray(); } + final function finSubSetArray(a:Array) { this.setPubArray(a); } + + public function testFinSubArray(a:Array):Array{ + this.finSubSetArray(a); + return this.finSubGetArray(); + } + + + // *************************************** + // access public property from + // default method of sub class + // *************************************** + + function subGetDPArray() : Array { return this.pubArray; } + function subSetDPArray(a:Array) { this.pubArray = a; } + + public function testSubGetSetDPArray(a:Array) : Array { + this.subSetDPArray(a); + return this.subGetDPArray(); + } + + + // *************************************** + // access public property from + // public method of sub class + // *************************************** + + public function pubSubGetDPArray() : Array { return this.pubArray; } + public function pubSubSetDPArray(a:Array) { this.pubArray = a; } + + // *************************************** + // access public property from + // private method of sub class + // *************************************** + + private function privSubGetDPArray() : Array { return this.pubArray; } + private function privSubSetDPArray(a:Array) { this.pubArray = a; } + + public function testPrivSubDPArray(a:Array) : Array { + this.privSubSetDPArray(a); + return this.privSubGetDPArray(); + } + + + // *************************************** + // access public property from + // final method of sub class + // *************************************** + + final function finSubGetDPArray() : Array { return this.pubArray; } + final function finSubSetDPArray(a:Array) { this.pubArray = a; } + + public function testFinSubDPArray(a:Array):Array { + this.finSubSetDPArray(a); + return this.finSubGetDPArray(); + } + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDefaultClassPubStat.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDefaultClassPubStat.as new file mode 100644 index 00000000000..1c4c9ce2c2b --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDefaultClassPubStat.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +// imports must be first statments +import DefaultClass.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "public extend Default Class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + +arr = new Array(1, 2, 3); + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDefaultClassPubStat/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDefaultClassPubStat/DefaultClass.as new file mode 100644 index 00000000000..2b3618393b9 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDefaultClassPubStat/DefaultClass.as @@ -0,0 +1,264 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DefaultClass { + + class DefaultClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + //public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + } + + public class DefaultClass extends DefaultClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDefaultClassPubStat/PubExtDefaultClassPubStat.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDefaultClassPubStat/PubExtDefaultClassPubStat.as new file mode 100644 index 00000000000..131373d76ee --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDefaultClassPubStat/PubExtDefaultClassPubStat.as @@ -0,0 +1,212 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DefaultClass { + + + import DefaultClass.*; + + public class PubExtDefaultClassPubStat extends DefaultClass { + + // ************************************ + // access public static method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return getPubStatArray(); } + function subSetArray(a:Array) { setPubStatArray(a); } + + public function testSubGetSetArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + + // ************************************ + // access public static method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return getPubStatArray(); } + public function pubSubSetArray(a:Array) { setPubStatArray(a); } + + // ************************************ + // access public static method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return getPubStatArray(); } + private function privSubSetArray(a:Array) { setPubStatArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + // ************************************ + // access public static method of parent + // from final method of sub class + // ************************************ + + final function finSubGetArray() : Array { return getPubStatArray(); } + final function finSubSetArray(a:Array) { setPubStatArray(a); } + + public function testFinSubArray(a:Array):Array { + this.finSubSetArray(a); + return this.finSubGetArray(); + } + + + // *************************************** + // access public static method of parent + // from static method of sub class + // *************************************** + + static function statSubGetArray() : Array { return getPubStatArray(); } + static function statSubSetArray(a:Array) { setPubStatArray(a); } + + public static function testStatSubArray(a:Array):Array { + statSubSetArray(a); + return statSubGetArray(); + } + + + // *************************************** + // access public static method of parent + // from public static method of sub class + // *************************************** + + public static function pubStatSubGetArray() : Array { return getPubStatArray(); } + public static function pubStatSubSetArray(a:Array) { setPubStatArray(a); } + + // *************************************** + // access public static method of parent + // from private static method of sub class + // *************************************** + + private static function privStatSubGetArray() : Array { return getPubStatArray(); } + private static function privStatSubSetArray(a:Array) { setPubStatArray(a); } + + // public accessor to test asrt + public static function testPrivStatSubArray(a:Array) : Array { + privStatSubSetArray(a); + return privStatSubGetArray(); + } + + // *************************************** + // access public static property from + // default method of sub class + // *************************************** + + function subGetDPArray() : Array { return pubStatArray; } + function subSetDPArray(a:Array) { pubStatArray = a; } + + public function testSubGetSetDPArray(a:Array) : Array { + this.subSetDPArray(a); + return this.subGetDPArray(); + } + + + // *************************************** + // access public static property from + // public method of sub class + // *************************************** + + public function pubSubGetDPArray() : Array { return pubStatArray; } + public function pubSubSetDPArray(a:Array) { pubStatArray = a; } + + // *************************************** + // access public static property from + // private method of sub class + // *************************************** + + private function privSubGetDPArray() : Array { return pubStatArray; } + private function privSubSetDPArray(a:Array) { pubStatArray = a; } + + public function testPrivSubDPArray(a:Array) : Array { + this.privSubSetDPArray(a); + return this.privSubGetDPArray(); + } + + + // *************************************** + // access public static property from + // final method of sub class + // *************************************** + + final function finSubGetDPArray() : Array { return pubStatArray; } + final function finSubSetDPArray(a:Array) { pubStatArray = a; } + + public function testFinSubDPArray(a:Array):Array { + this.finSubSetDPArray(a); + return this.finSubGetDPArray(); + } + + + // *************************************** + // access public static property from + // static method of sub class + // *************************************** + + static function statSubGetSPArray() : Array { return pubStatArray; } + static function statSubSetSPArray(a:Array) { pubStatArray = a; } + + public static function testStatSubSPArray(a:Array):Array { + statSubSetSPArray(a); + return statSubGetSPArray(); + } + + + // *************************************** + // access public static property from + // public static method of sub class + // *************************************** + + public static function pubStatSubGetSPArray() : Array { return pubStatArray; } + public static function pubStatSubSetSPArray(a:Array) { pubStatArray = a; } + + // *************************************** + // access public static property from + // private static method of sub class + // *************************************** + + private static function privStatSubGetSPArray() : Array { return pubStatArray; } + private static function privStatSubSetSPArray(a:Array) { pubStatArray = a; } + + // public accessor for asrt + public static function testPrivStatSubPArray(a:Array) : Array { + privStatSubSetSPArray( a ); + return privStatSubGetSPArray(); + } + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDefaultClassStat.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDefaultClassStat.as new file mode 100644 index 00000000000..fadd7921a67 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDefaultClassStat.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +// imports must be first statement +import DefaultClass.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "public extend Default Class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + +arr = new Array(1, 2, 3); + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDefaultClassStat/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDefaultClassStat/DefaultClass.as new file mode 100644 index 00000000000..2b3618393b9 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDefaultClassStat/DefaultClass.as @@ -0,0 +1,264 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DefaultClass { + + class DefaultClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + //public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + } + + public class DefaultClass extends DefaultClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDefaultClassStat/PubExtDefaultClassStat.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDefaultClassStat/PubExtDefaultClassStat.as new file mode 100644 index 00000000000..7af0ac61776 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDefaultClassStat/PubExtDefaultClassStat.as @@ -0,0 +1,211 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DefaultClass { + + + import DefaultClass.*; + + public class PubExtDefaultClassStat extends DefaultClass { + + // ************************************ + // access static method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return getStatArray(); } + function subSetArray(a:Array) { setStatArray(a); } + + public function testSubGetSetArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + + // ************************************ + // access static method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return getStatArray(); } + public function pubSubSetArray(a:Array) { setStatArray(a); } + + // ************************************ + // access static method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return getStatArray(); } + private function privSubSetArray(a:Array) { setStatArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + // ************************************ + // access static method of parent + // from final method of sub class + // ************************************ + + final function finSubGetArray() : Array { return getStatArray(); } + final function finSubSetArray(a:Array) { setStatArray(a); } + + public function testFinSubArray(a:Array) : Array { + this.finSubSetArray(a); + return this.finSubGetArray(); + } + + + // *************************************** + // access static method of parent + // from static method of sub class + // *************************************** + + static function statSubGetArray() : Array { return getStatArray(); } + static function statSubSetArray(a:Array) { setStatArray(a); } + + public static function testStatSubArray(a:Array) : Array { + statSubSetArray(a); + return statSubGetArray(); + } + + + // *************************************** + // access static method of parent + // from public static method of sub class + // *************************************** + + public static function pubStatSubGetArray() : Array { return getStatArray(); } + public static function pubStatSubSetArray(a:Array) { setStatArray(a); } + + // *************************************** + // access static method of parent + // from private static method of sub class + // *************************************** + + private static function privStatSubGetArray() : Array { return getStatArray(); } + private static function privStatSubSetArray(a:Array) { setStatArray(a); } + + // public accessor to test asrt + public function testPrivStatSubArray(a:Array) : Array { + privStatSubSetArray(a); + return privStatSubGetArray(); + } + + // *************************************** + // access static property from + // default method of sub class + // *************************************** + + function subGetDPArray() : Array { return statArray; } + function subSetDPArray(a:Array) { statArray = a; } + + public function testSubGetSetDPArray(a:Array) : Array { + this.subSetDPArray(a); + return this.subGetDPArray(); + } + + + // *************************************** + // access static property from + // public method of sub class + // *************************************** + + public function pubSubGetDPArray() : Array { return statArray; } + public function pubSubSetDPArray(a:Array) { statArray = a; } + + // *************************************** + // access static property from + // private method of sub class + // *************************************** + + private function privSubGetDPArray() : Array { return statArray; } + private function privSubSetDPArray(a:Array) { statArray = a; } + + public function testPrivSubDPArray(a:Array) : Array { + this.privSubSetDPArray(a); + return this.privSubGetDPArray(); + } + + + // *************************************** + // access static property from + // final method of sub class + // *************************************** + + final function finSubGetDPArray() : Array { return statArray; } + final function finSubSetDPArray(a:Array) { statArray = a; } + + public function testFinSubDPArray(a:Array) : Array { + this.finSubSetDPArray(a); + return this.finSubGetDPArray(); + } + + + // *************************************** + // access static property from + // static method of sub class + // *************************************** + + static function statSubGetSPArray() : Array { return statArray; } + static function statSubSetSPArray(a:Array) { statArray = a; } + + public static function testStatSubPArray(a:Array) : Array { + statSubSetSPArray( a ); + return statSubGetSPArray(); + } + + + // *************************************** + // access static property from + // public static method of sub class + // *************************************** + + public static function pubStatSubGetSPArray() : Array { return statArray; } + public static function pubStatSubSetSPArray(a:Array) { statArray = a; } + + // *************************************** + // access static property from + // private static method of sub class + // *************************************** + + private static function privStatSubGetSPArray() : Array { return statArray; } + private static function privStatSubSetSPArray(a:Array) { statArray = a; } + + // public accessor for asrt + public function testPrivStatSubPArray(a:Array) : Array { + privStatSubSetSPArray( a ); + return privStatSubGetSPArray(); + } + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDynamicClass.as new file mode 100644 index 00000000000..8ab846f3ea2 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDynamicClass.as @@ -0,0 +1,42 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import DynamicClass.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "public extend Dynamic Class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDynamicClass/DynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDynamicClass/DynamicClass.as new file mode 100644 index 00000000000..6dee1fbd55b --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDynamicClass/DynamicClass.as @@ -0,0 +1,243 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DynamicClass { + + + dynamic class DynamicClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + // public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // **************** + // constructor + // **************** + + function DynamicClass() { + } + + // ***************** + // default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + } + public class DynamicClass extends DynamicClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDynamicClass/PubExtDynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDynamicClass/PubExtDynamicClass.as new file mode 100644 index 00000000000..d27dde8aa71 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDynamicClass/PubExtDynamicClass.as @@ -0,0 +1,139 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DynamicClass { + + import DynamicClass.*; + + public class PubExtDynamicClass extends DynamicClass { + + // ************************************ + // access default method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return this.getArray(); } + function subSetArray(a:Array) { this.setArray(a); } + + public function testSubGetSetArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + + // ************************************ + // access default method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return this.getArray(); } + public function pubSubSetArray(a:Array) { this.setArray(a); } + + // ************************************ + // access default method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return this.getArray(); } + private function privSubSetArray(a:Array) { this.setArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + // ************************************ + // access default method of parent + // from final method of sub class + // ************************************ + + final function finSubGetArray() : Array { return this.getArray(); } + final function finSubSetArray(a:Array) { this.setArray(a); } + + public function testFinSubArray(a:Array):Array{ + this.finSubSetArray(a); + return this.finSubGetArray(); + } + + + // *************************************** + // access default property from + // default method of sub class + // *************************************** + + function subGetDPArray() : Array { return array; } + function subSetDPArray(a:Array) { array = a; } + + public function testSubGetSetDPArray(a:Array) : Array { + this.subSetDPArray(a); + return this.subGetDPArray(); + } + + + // *************************************** + // access default property from + // public method of sub class + // *************************************** + + public function pubSubGetDPArray() : Array { return this.array; } + public function pubSubSetDPArray(a:Array) { this.array = a; } + + // *************************************** + // access default property from + // private method of sub class + // *************************************** + + private function privSubGetDPArray() : Array { return this.array; } + private function privSubSetDPArray(a:Array) { this.array = a; } + + public function testPrivSubDPArray(a:Array) : Array { + this.privSubSetDPArray(a); + return this.privSubGetDPArray(); + } + + + // *************************************** + // access default property from + // final method of sub class + // *************************************** + + final function finSubGetDPArray() : Array { return array; } + final function finSubSetDPArray(a:Array) { array = a; } + + public function testFinSubDPArray(a:Array):Array { + this.finSubSetDPArray(a); + return this.finSubGetDPArray(); + } + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDynamicClassFin.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDynamicClassFin.as new file mode 100644 index 00000000000..b8a6f054e40 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDynamicClassFin.as @@ -0,0 +1,42 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import DynamicClass.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "public class extend class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDynamicClassFin/DynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDynamicClassFin/DynamicClass.as new file mode 100644 index 00000000000..6dee1fbd55b --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDynamicClassFin/DynamicClass.as @@ -0,0 +1,243 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DynamicClass { + + + dynamic class DynamicClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + // public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // **************** + // constructor + // **************** + + function DynamicClass() { + } + + // ***************** + // default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + } + public class DynamicClass extends DynamicClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDynamicClassFin/PubExtDynamicClassFin.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDynamicClassFin/PubExtDynamicClassFin.as new file mode 100644 index 00000000000..67fd56df240 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDynamicClassFin/PubExtDynamicClassFin.as @@ -0,0 +1,140 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DynamicClass { + + import DynamicClass.*; + + public class PubExtDynamicClassFin extends DynamicClass { + + // ************************************ + // access final method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return this.getFinArray(); } + function subSetArray(a:Array) { this.setFinArray(a); } + + public function testSubGetSetArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + + // ************************************ + // access final method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return this.getFinArray(); } + public function pubSubSetArray(a:Array) { this.setFinArray(a); } + + // ************************************ + // access final method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return this.getFinArray(); } + private function privSubSetArray(a:Array) { this.setFinArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + // ************************************ + // access final method of parent + // from final method of sub class + // ************************************ + + final function finSubGetArray() : Array { return this.getFinArray(); } + final function finSubSetArray(a:Array) { this.setFinArray(a); } + + public function testFinSubArray(a:Array):Array{ + this.finSubSetArray(a); + return this.finSubGetArray(); + } + + + // *************************************** + // access final property from + // default method of sub class + // *************************************** + + function subGetDPArray() : Array { return finArray; } + function subSetDPArray(a:Array) { finArray = a; } + + public function testSubGetSetDPArray(a:Array) : Array { + this.subSetDPArray(a); + return this.subGetDPArray(); + } + + + // *************************************** + // access final property from + // public method of sub class + // *************************************** + + public function pubSubGetDPArray() : Array { return this.finArray; } + public function pubSubSetDPArray(a:Array) { this.finArray = a; } + + // *************************************** + // access final property from + // private method of sub class + // *************************************** + + private function privSubGetDPArray() : Array { return this.finArray; } + private function privSubSetDPArray(a:Array) { this.finArray = a; } + + public function testPrivSubDPArray(a:Array) : Array { + this.privSubSetDPArray(a); + return this.privSubGetDPArray(); + } + + + // *************************************** + // access final property from + // final method of sub class + // *************************************** + + final function finSubGetDPArray() : Array { return finArray; } + final function finSubSetDPArray(a:Array) { finArray = a; } + + public function testFinSubDPArray(a:Array):Array { + this.finSubSetDPArray(a); + return this.finSubGetDPArray(); + } + + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDynamicClassPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDynamicClassPub.as new file mode 100644 index 00000000000..4725db1df91 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDynamicClassPub.as @@ -0,0 +1,43 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import DynamicClass.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "public extend Default Class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var EXTDCLASS = new PubExtDynamicClassPub(); + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDynamicClassPub/DynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDynamicClassPub/DynamicClass.as new file mode 100644 index 00000000000..6dee1fbd55b --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDynamicClassPub/DynamicClass.as @@ -0,0 +1,243 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DynamicClass { + + + dynamic class DynamicClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + // public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // **************** + // constructor + // **************** + + function DynamicClass() { + } + + // ***************** + // default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + } + public class DynamicClass extends DynamicClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDynamicClassPub/PubExtDynamicClassPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDynamicClassPub/PubExtDynamicClassPub.as new file mode 100644 index 00000000000..99b1fb3bd36 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDynamicClassPub/PubExtDynamicClassPub.as @@ -0,0 +1,138 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DynamicClass { + + import DynamicClass.*; + + public class PubExtDynamicClassPub extends DynamicClass { + + // ************************************ + // access public method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return this.getPubArray(); } + function subSetArray(a:Array) { this.setPubArray(a); } + + public function testSubGetSetArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + + // ************************************ + // access public method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return this.getPubArray(); } + public function pubSubSetArray(a:Array) { this.setPubArray(a); } + + // ************************************ + // access public method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return this.getPubArray(); } + private function privSubSetArray(a:Array) { this.setPubArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + // ************************************ + // access public method of parent + // from final method of sub class + // ************************************ + + final function finSubGetArray() : Array { return this.getPubArray(); } + final function finSubSetArray(a:Array) { this.setPubArray(a); } + + public function testFinSubArray(a:Array):Array{ + this.finSubSetArray(a); + return this.finSubGetArray(); + } + + + // *************************************** + // access public property from + // default method of sub class + // *************************************** + + function subGetDPArray() : Array { return pubArray; } + function subSetDPArray(a:Array) { pubArray = a; } + + public function testSubGetSetDPArray(a:Array) : Array { + this.subSetDPArray(a); + return this.subGetDPArray(); + } + + + // *************************************** + // access public property from + // public method of sub class + // *************************************** + + public function pubSubGetDPArray() : Array { return this.pubArray; } + public function pubSubSetDPArray(a:Array) { this.pubArray = a; } + + // *************************************** + // access public property from + // private method of sub class + // *************************************** + + private function privSubGetDPArray() : Array { return this.pubArray; } + private function privSubSetDPArray(a:Array) { this.pubArray = a; } + + public function testPrivSubDPArray(a:Array) : Array { + this.privSubSetDPArray(a); + return this.privSubGetDPArray(); + } + + + // *************************************** + // access public property from + // final method of sub class + // *************************************** + + final function finSubGetDPArray() : Array { return pubArray; } + final function finSubSetDPArray(a:Array) { pubArray = a; } + + public function testFinSubDPArray(a:Array):Array { + this.finSubSetDPArray(a); + return this.finSubGetDPArray(); + } + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDynamicClassPubStat.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDynamicClassPubStat.as new file mode 100644 index 00000000000..853f410cd92 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDynamicClassPubStat.as @@ -0,0 +1,44 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import DynamicClass.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "Clean AS2"; // Version of JavaScript or ECMA +var TITLE = "Extend Dynamic Class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + +arr = new Array(1, 2, 3); + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDynamicClassPubStat/DynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDynamicClassPubStat/DynamicClass.as new file mode 100644 index 00000000000..6dee1fbd55b --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDynamicClassPubStat/DynamicClass.as @@ -0,0 +1,243 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DynamicClass { + + + dynamic class DynamicClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + // public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // **************** + // constructor + // **************** + + function DynamicClass() { + } + + // ***************** + // default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + } + public class DynamicClass extends DynamicClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDynamicClassPubStat/PubExtDynamicClassPubStat.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDynamicClassPubStat/PubExtDynamicClassPubStat.as new file mode 100644 index 00000000000..30d14d8b307 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDynamicClassPubStat/PubExtDynamicClassPubStat.as @@ -0,0 +1,212 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DynamicClass { + + import DynamicClass.*; + + public class PubExtDynamicClassPubStat extends DynamicClass { + + // ************************************ + // access public static method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return getPubStatArray(); } + function subSetArray(a:Array) { setPubStatArray(a); } + + + public function testSubGetSetArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + + // ************************************ + // access public static method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return getPubStatArray(); } + public function pubSubSetArray(a:Array) { setPubStatArray(a); } + + // ************************************ + // access public static method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return getPubStatArray(); } + private function privSubSetArray(a:Array) { setPubStatArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + // ************************************ + // access public static method of parent + // from final method of sub class + // ************************************ + + final function finSubGetArray() : Array { return getPubStatArray(); } + final function finSubSetArray(a:Array) { setPubStatArray(a); } + + public function testFinSubArray(a:Array):Array{ + this.finSubSetArray(a); + return this.finSubGetArray(); + } + + + // *************************************** + // access public static method of parent + // from static method of sub class + // *************************************** + + static function statSubGetArray() : Array { return getPubStatArray(); } + static function statSubSetArray(a:Array) { setPubStatArray(a); } + + public static function testStatSubArray(a:Array) : Array { + statSubSetArray(a); + return statSubGetArray(); + } + + + // *************************************** + // access public static method of parent + // from public static method of sub class + // *************************************** + + public static function pubStatSubGetArray() : Array { return getPubStatArray(); } + public static function pubStatSubSetArray(a:Array) { setPubStatArray(a); } + + // *************************************** + // access public static method of parent + // from private static method of sub class + // *************************************** + + private static function privStatSubGetArray() : Array { return getPubStatArray(); } + private static function privStatSubSetArray(a:Array) { setPubStatArray(a); } + + // public accessor to test asrt + public function testPrivStatSubArray(a:Array) : Array { + privStatSubSetArray(a); + return privStatSubGetArray(); + } + + // *************************************** + // access public static property from + // default method of sub class + // *************************************** + + function subGetDPArray() : Array { return pubStatArray; } + function subSetDPArray(a:Array) { pubStatArray = a; } + + public function testSubGetSetDPArray(a:Array) : Array { + this.subSetDPArray(a); + return this.subGetDPArray(); + } + + + // *************************************** + // access public static property from + // public method of sub class + // *************************************** + + public function pubSubGetDPArray() : Array { return pubStatArray; } + public function pubSubSetDPArray(a:Array) { pubStatArray = a; } + + // *************************************** + // access public static property from + // private method of sub class + // *************************************** + + private function privSubGetDPArray() : Array { return pubStatArray; } + private function privSubSetDPArray(a:Array) { pubStatArray = a; } + + public function testPrivSubDPArray(a:Array) : Array { + this.privSubSetDPArray(a); + return this.privSubGetDPArray(); + } + + + // *************************************** + // access public static property from + // static method of sub class + // *************************************** + + static function statSubGetSPArray() : Array { return pubStatArray; } + static function statSubSetSPArray(a:Array) { pubStatArray = a; } + + public static function testStatSubPArray(a:Array) : Array { + statSubSetSPArray( a ); + return statSubGetSPArray(); + } + + + // *************************************** + // access public static property from + // public static method of sub class + // *************************************** + + public static function pubStatSubGetSPArray() : Array { return pubStatArray; } + public static function pubStatSubSetSPArray(a:Array) { pubStatArray = a; } + + // *************************************** + // access public static property from + // private static method of sub class + // *************************************** + + private static function privStatSubGetSPArray() : Array { return pubStatArray; } + private static function privStatSubSetSPArray(a:Array) { pubStatArray = a; } + + // public accessor for asrt + public function testPrivStatSubPArray(a:Array) : Array { + privStatSubSetSPArray( a ); + return privStatSubGetSPArray(); + } + + // *************************************** + // access public static property from + // final method of sub class + // *************************************** + + final function finSubGetDPArray() : Array { return pubStatArray; } + final function finSubSetDPArray(a:Array) { pubStatArray = a; } + + public function testFinSubDPArray(a:Array):Array { + this.finSubSetDPArray(a); + return this.finSubGetDPArray(); + } + + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDynamicClassStat.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDynamicClassStat.as new file mode 100644 index 00000000000..853f410cd92 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDynamicClassStat.as @@ -0,0 +1,44 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import DynamicClass.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "Clean AS2"; // Version of JavaScript or ECMA +var TITLE = "Extend Dynamic Class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + +arr = new Array(1, 2, 3); + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDynamicClassStat/DynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDynamicClassStat/DynamicClass.as new file mode 100644 index 00000000000..6dee1fbd55b --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDynamicClassStat/DynamicClass.as @@ -0,0 +1,243 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DynamicClass { + + + dynamic class DynamicClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + // public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // **************** + // constructor + // **************** + + function DynamicClass() { + } + + // ***************** + // default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + } + public class DynamicClass extends DynamicClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDynamicClassStat/PubExtDynamicClassStat.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDynamicClassStat/PubExtDynamicClassStat.as new file mode 100644 index 00000000000..20e3e7454a9 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtDynamicClassStat/PubExtDynamicClassStat.as @@ -0,0 +1,210 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DynamicClass { + + import DynamicClass.*; + + public class PubExtDynamicClassStat extends DynamicClass { + + // ************************************ + // access static method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return getStatArray(); } + function subSetArray(a:Array) { setStatArray(a); } + + public function testSubGetSetArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + + // ************************************ + // access static method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return getStatArray(); } + public function pubSubSetArray(a:Array) { setStatArray(a); } + + // ************************************ + // access static method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return getStatArray(); } + private function privSubSetArray(a:Array) { setStatArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + // ************************************ + // access static method of parent + // from final method of sub class + // ************************************ + + final function finSubGetArray() : Array { return getStatArray(); } + final function finSubSetArray(a:Array) { setStatArray(a); } + + public function testFinSubArray(a:Array):Array{ + this.finSubSetArray(a); + return this.finSubGetArray(); + } + + + // *************************************** + // access static method of parent + // from static method of sub class + // *************************************** + + static function statSubGetArray() : Array { return getStatArray(); } + static function statSubSetArray(a:Array) { setStatArray(a); } + + public static function testStatSubArray(a:Array) : Array { + statSubSetArray(a); + return statSubGetArray(); + } + + + // *************************************** + // access static method of parent + // from public static method of sub class + // *************************************** + + public static function pubStatSubGetArray() : Array { return getStatArray(); } + public static function pubStatSubSetArray(a:Array) { setStatArray(a); } + + // *************************************** + // access static method of parent + // from private static method of sub class + // *************************************** + + private static function privStatSubGetArray() : Array { return getStatArray(); } + private static function privStatSubSetArray(a:Array) { setStatArray(a); } + + // public accessor to test asrt + public function testPrivStatSubArray(a:Array) : Array { + privStatSubSetArray(a); + return privStatSubGetArray(); + } + + // *************************************** + // access static property from + // default method of sub class + // *************************************** + + function subGetDPArray() : Array { return statArray; } + function subSetDPArray(a:Array) { statArray = a; } + + public function testSubGetSetDPArray(a:Array) : Array { + this.subSetDPArray(a); + return this.subGetDPArray(); + } + + + // *************************************** + // access static property from + // public method of sub class + // *************************************** + + public function pubSubGetDPArray() : Array { return statArray; } + public function pubSubSetDPArray(a:Array) { statArray = a; } + + // *************************************** + // access static property from + // private method of sub class + // *************************************** + + private function privSubGetDPArray() : Array { return statArray; } + private function privSubSetDPArray(a:Array) { statArray = a; } + + public function testPrivSubDPArray(a:Array) : Array { + this.privSubSetDPArray(a); + return this.privSubGetDPArray(); + } + + + // *************************************** + // access static property from + // static method of sub class + // *************************************** + + static function statSubGetSPArray() : Array { return statArray; } + static function statSubSetSPArray(a:Array) { statArray = a; } + + public static function testStatSubPArray(a:Array) : Array { + statSubSetSPArray( a ); + return statSubGetSPArray(); + } + + + // *************************************** + // access static property from + // public static method of sub class + // *************************************** + + public static function pubStatSubGetSPArray() : Array { return statArray; } + public static function pubStatSubSetSPArray(a:Array) { statArray = a; } + + // *************************************** + // access static property from + // private static method of sub class + // *************************************** + + private static function privStatSubGetSPArray() : Array { return statArray; } + private static function privStatSubSetSPArray(a:Array) { statArray = a; } + + // public accessor for asrt + public function testPrivStatSubPArray(a:Array) : Array { + privStatSubSetSPArray( a ); + return privStatSubGetSPArray(); + } + + // *************************************** + // access static property from + // final method of sub class + // *************************************** + + final function finSubGetDPArray() : Array { return statArray; } + final function finSubSetDPArray(a:Array) { statArray = a; } + + public function testFinSubDPArray(a:Array):Array { + this.finSubSetDPArray(a); + return this.finSubGetDPArray(); + } + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtInternalClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtInternalClass.as new file mode 100644 index 00000000000..45a24a17e96 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtInternalClass.as @@ -0,0 +1,162 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import InternalClass.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Extend Default Class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +// ************************************ +// public class extends class +// ************************************ + +var arr = new Array(1,2,3); + +// ******************************************** +// access default method from outside of class +// ******************************************** + +// this should give a compiler error +PUBEXTDCLASS = new PubExtInternalClass(); + +//We cannot access the default method from outside the class +//AddTestCase( "PUBEXTDCLASS.setArray(arr), PUBEXTDCLASS.getArray()", arr, (PUBEXTDCLASS.setArray(arr), PUBEXTDCLASS.getArray()) ); + + +// ******************************************** +// access default method from a default +// method of a sub class +// +// ******************************************** + +PUBEXTDCLASS = new PubExtInternalClass(); +AddTestCase( "*** Access default method from default method of sub class ***", 1, 1 ); +AddTestCase( "PUBEXTDCLASS.subSetArray(arr), PUBEXTDCLASS.subGetArray()", arr, PUBEXTDCLASS.testSubGetSetArray(arr) ); + +// fill in the rest of the cases here + + +// ******************************************** +// access default method from a public +// method of a sub class +// +// ******************************************** + +PUBEXTDCLASS = new PubExtInternalClass(); +AddTestCase( "*** Access default method from public method of sub class ***", 1, 1 ); +AddTestCase( "PUBEXTDCLASS.pubSubSetArray(arr), PUBEXTDCLASS.pubSubGetArray()", arr, (PUBEXTDCLASS.pubSubSetArray(arr), PUBEXTDCLASS.pubSubGetArray()) ); + +// fill in the rest of the cases here + +// ******************************************** +// access default method from a private +// method of a sub class +// +// ******************************************** + +PUBEXTDCLASS = new PubExtInternalClass(); +AddTestCase( "*** Access default method from private method of sub class ***", 1, 1 ); +AddTestCase( "PUBEXTDCLASS.testPrivSubArray(arr)", arr, PUBEXTDCLASS.testPrivSubArray(arr) ); + +// fill in the rest of the cases here + +// ******************************************** +// access default method from a final +// method of a sub class +// +// ******************************************** + +PUBEXTDCLASS = new PubExtInternalClass(); +AddTestCase( "*** Access default method from default method of sub class ***", 1, 1 ); +AddTestCase( "PUBEXTDCLASS.finSubSetArray(arr), PUBEXTDCLASS.finSubGetArray()", arr, PUBEXTDCLASS.testFinSubArray(arr) ); + +// ******************************************** +// access default property from outside +// the class +// ******************************************** + +PUBEXTDCLASS = new PubExtInternalClass(); +AddTestCase( "*** Access default property from outside the class ***", 1, 1 ); +//AddTestCase( "PUBEXTDCLASS.array = arr", arr, (PUBEXTDCLASS.array = arr, PUBEXTDCLASS.array) ); + +// fill in the rest of the cases here + +// ******************************************** +// access default property from +// default method in sub class +// ******************************************** + +PUBEXTDCLASS = new PubExtInternalClass(); +AddTestCase( "*** Access default property from method in sub class ***", 1, 1 ); +AddTestCase( "PUBEXTDCLASS.subSetDPArray(arr), PUBEXTDCLASS.subGetDPArray()", arr, PUBEXTDCLASS.testSubGetSetDPArray(arr) ); + +// fill in the rest of the cases here + +// ******************************************** +// access default property from +// public method in sub class +// ******************************************** + +PUBEXTDCLASS = new PubExtInternalClass(); +AddTestCase( "*** Access default property from public method in sub class ***", 1, 1 ); +AddTestCase( "PUBEXTDCLASS.pubSubSetDPArray(arr), PUBEXTDCLASS.pubSubGetDPArray()", arr, (PUBEXTDCLASS.pubSubSetDPArray(arr), PUBEXTDCLASS.pubSubGetDPArray()) ); + +// fill in the rest of the cases here + +// ******************************************** +// access default property from +// private method in sub class +// ******************************************** + +PUBEXTDCLASS = new PubExtInternalClass(); +AddTestCase( "*** Access default property from private method in sub class ***", 1, 1 ); +AddTestCase( "PUBEXTDCLASS.privSubSetDPArray(arr), PUBEXTDCLASS.privSubGetDPArray()", arr, PUBEXTDCLASS.testPrivSubDPArray(arr) ); + +// fill in the rest of the cases here + +// ******************************************** +// access default property from +// final method in sub class +// ******************************************** + +PUBEXTDCLASS = new PubExtInternalClass(); +AddTestCase( "*** Access default property from final method in sub class ***", 1, 1 ); +AddTestCase( "PUBEXTDCLASS.finSubSetDPArray(arr), PUBEXTDCLASS.finSubGetDPArray()", arr, PUBEXTDCLASS.testFinSubDPArray(arr) ); + + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtInternalClass/InternalClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtInternalClass/InternalClass.as new file mode 100644 index 00000000000..c8526819793 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtInternalClass/InternalClass.as @@ -0,0 +1,264 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package InternalClass { + + internal class InternalClassInner { + + internal var array:Array; + var boolean:Boolean; + internal var date:Date; + var myFunction:Function; + internal var math:Math; + var number:Number; + internal var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + //public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + internal function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + internal function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + internal function getNumber() : Number { return number; } + function getObject() : Object { return object; } + internal function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + internal function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + internal function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + internal function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + internal function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + } + + public class InternalClass extends InternalClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtInternalClass/PubExtInternalClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtInternalClass/PubExtInternalClass.as new file mode 100644 index 00000000000..90689e8f416 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtInternalClass/PubExtInternalClass.as @@ -0,0 +1,140 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + +package InternalClass { + + import InternalClass.*; + + public class PubExtInternalClass extends InternalClass { + + // ************************************ + // access default method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return this.getArray(); } + function subSetArray(a:Array) { this.setArray(a); } + + + // ************************************ + // access default method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return this.getArray(); } + public function pubSubSetArray(a:Array) { this.setArray(a); } + + // this is needed so that the test cases can access this from + // outside the class. This way the test case itself preserved + public function testSubGetSetArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + // ************************************ + // access default method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return this.getArray(); } + private function privSubSetArray(a:Array) { this.setArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + // ************************************ + // access default method of parent + // from final method of sub class + // ************************************ + + final function finSubGetArray() : Array { return this.getArray(); } + final function finSubSetArray(a:Array) { this.setArray(a); } + + public function testFinSubArray(a:Array):Array{ + this.finSubSetArray(a); + return this.finSubGetArray(); + } + + // *************************************** + // access default property from + // default method of sub class + // *************************************** + + function subGetDPArray() : Array { return array; } + function subSetDPArray(a:Array) { array = a; } + + public function testSubGetSetDPArray(a:Array) : Array { + this.subSetDPArray(a); + return this.subGetDPArray(); + } + + // *************************************** + // access default property from + // public method of sub class + // *************************************** + + public function pubSubGetDPArray() : Array { return this.array; } + public function pubSubSetDPArray(a:Array) { this.array = a; } + + // *************************************** + // access default property from + // private method of sub class + // *************************************** + + private function privSubGetDPArray() : Array { return this.array; } + private function privSubSetDPArray(a:Array) { this.array = a; } + + public function testPrivSubDPArray(a:Array) : Array { + this.privSubSetDPArray(a); + return this.privSubGetDPArray(); + } + + + // *************************************** + // access default property from + // final method of sub class + // *************************************** + + final function finSubGetDPArray() : Array { return array; } + final function finSubSetDPArray(a:Array) { array = a; } + + public function testFinSubDPArray(a:Array):Array { + this.finSubSetDPArray(a); + return this.finSubGetDPArray(); + } + + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtPublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtPublicClass.as new file mode 100644 index 00000000000..f744e282dff --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtPublicClass.as @@ -0,0 +1,119 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "extend public class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +import PublicClass.*; + + + +// ******************************************** +// access default method from a default +// method of a sub class +// +// ******************************************** + +var arr = new Array(1, 2, 3); + +PUBEXTDCLASS = new PubExtPublicClass(); +AddTestCase( "*** Access default method from default method of sub class ***", 1, 1 ); +AddTestCase( "PUBEXTDCLASS.testSubGetSetArray(arr)", arr, PUBEXTDCLASS.testSubGetSetArray(arr) ); + +// fill in the rest of the cases here + + +// ******************************************** +// access default method from a public +// method of a sub class +// +// ******************************************** + +PUBEXTDCLASS = new PubExtPublicClass(); +AddTestCase( "*** Access default method from public method of sub class ***", 1, 1 ); +AddTestCase( "PUBEXTDCLASS.pubSubSetArray(arr), PUBEXTDCLASS.pubSubGetArray()", arr, (PUBEXTDCLASS.pubSubSetArray(arr), PUBEXTDCLASS.pubSubGetArray()) ); + +// fill in the rest of the cases here + +// ******************************************** +// access default method from a private +// method of a sub class +// +// ******************************************** + +PUBEXTDCLASS = new PubExtPublicClass(); +AddTestCase( "*** Access default method from private method of sub class ***", 1, 1 ); +AddTestCase( "PUBEXTDCLASS.testPrivSubArray(arr)", arr, PUBEXTDCLASS.testPrivSubArray(arr) ); + +// fill in the rest of the cases here + + +// ******************************************** +// access default property from +// default method in sub class +// ******************************************** + +PUBEXTDCLASS = new PubExtPublicClass(); +AddTestCase( "*** Access default property from method in sub class ***", 1, 1 ); +AddTestCase( "PUBEXTDCLASS.testSubGetSetDPArray(arr)", arr, PUBEXTDCLASS.testSubGetSetDPArray(arr) ); + +// fill in the rest of the cases here + +// ******************************************** +// access default property from +// public method in sub class +// ******************************************** + +PUBEXTDCLASS = new PubExtPublicClass(); +AddTestCase( "*** Access default property from public method in sub class ***", 1, 1 ); +AddTestCase( "PUBEXTDCLASS.pubSubSetDPArray(arr), PUBEXTDCLASS.pubSubGetDPArray()", arr, (PUBEXTDCLASS.pubSubSetDPArray(arr), PUBEXTDCLASS.pubSubGetDPArray()) ); + +// fill in the rest of the cases here + +// ******************************************** +// access default property from +// private method in sub class +// ******************************************** + +PUBEXTDCLASS = new PubExtPublicClass(); +AddTestCase( "*** Access default property from private method in sub class ***", 1, 1 ); +AddTestCase( "PUBEXTDCLASS.testPrivSubDPArray(arr)", arr, PUBEXTDCLASS.testPrivSubDPArray(arr) ); + +// fill in the rest of the cases here + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtPublicClass/APublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtPublicClass/APublicClass.as new file mode 100644 index 00000000000..fb5e420c61c --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtPublicClass/APublicClass.as @@ -0,0 +1,262 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + public class PublicClass { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + //public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finMyFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray():Array { return finArray; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtPublicClass/PubExtPublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtPublicClass/PubExtPublicClass.as new file mode 100644 index 00000000000..45d9fda636a --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtPublicClass/PubExtPublicClass.as @@ -0,0 +1,113 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + +package PublicClass { + + import PublicClass.*; + + public class PubExtPublicClass extends PublicClass { + + // ************************************ + // access default method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return this.getArray(); } + function subSetArray(a:Array) { this.setArray(a); } + + public function testSubGetSetArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + + // ************************************ + // access default method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return this.getArray(); } + public function pubSubSetArray(a:Array) { this.setArray(a); } + + // ************************************ + // access default method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return this.getArray(); } + private function privSubSetArray(a:Array) { this.setArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + // *************************************** + // access default property from + // default method of sub class + // *************************************** + + function subGetDPArray() : Array { return array; } + function subSetDPArray(a:Array) { array = a; } + + public function testSubGetSetDPArray(a:Array) : Array { + this.subSetDPArray(a); + return this.subGetDPArray(); + } + + + // *************************************** + // access default property from + // public method of sub class + // *************************************** + + public function pubSubGetDPArray() : Array { return this.array; } + public function pubSubSetDPArray(a:Array) { this.array = a; } + + // *************************************** + // access default property from + // private method of sub class + // *************************************** + + private function privSubGetDPArray() : Array { return this.array; } + private function privSubSetDPArray(a:Array) { this.array = a; } + + public function testPrivSubDPArray(a:Array) : Array { + this.privSubSetDPArray(a); + return this.privSubGetDPArray(); + } + + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtPublicClassFin.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtPublicClassFin.as new file mode 100644 index 00000000000..67821b53662 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtPublicClassFin.as @@ -0,0 +1,138 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import PublicClass.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Extend Public Class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + +// ******************************************** +// access final method from a default +// method of a sub class +// +// ******************************************** + +var arr = [1,2,3]; + +PUBEXTDCLASS = new PubExtPublicClassFin(); +AddTestCase( "*** Access final method from default method of sub class ***", 1, 1 ); +AddTestCase( "PUBEXTDCLASS.testSubSetArray(arr)", arr, PUBEXTDCLASS.testSubSetArray(arr) ); + +// fill in the rest of the cases here + + +// ******************************************** +// access final method from a public +// method of a sub class +// +// ******************************************** + +PUBEXTDCLASS = new PubExtPublicClassFin(); +AddTestCase( "*** Access final method from public method of sub class ***", 1, 1 ); +AddTestCase( "PUBEXTDCLASS.pubSubSetArray(arr), PUBEXTDCLASS.pubSubGetArray()", arr, (PUBEXTDCLASS.pubSubSetArray(arr), PUBEXTDCLASS.pubSubGetArray()) ); + +// fill in the rest of the cases here + +// ******************************************** +// access final method from a private +// method of a sub class +// +// ******************************************** + +PUBEXTDCLASS = new PubExtPublicClassFin(); +AddTestCase( "*** Access final method from private method of sub class ***", 1, 1 ); +AddTestCase( "PUBEXTDCLASS.testPrivSubArray(arr)", arr, PUBEXTDCLASS.testPrivSubArray(arr) ); + +// fill in the rest of the cases here + +// ******************************************** +// access final method from a final +// method of a sub class +// +// ******************************************** + +PUBEXTDCLASS = new PubExtPublicClassFin(); +AddTestCase( "*** Access final method from final method of sub class ***", 1, 1 ); +AddTestCase( "PUBEXTDCLASS.testFinSubSetArray(arr)", arr, PUBEXTDCLASS.testFinSubSetArray(arr) ); + + + +// ******************************************** +// access final property from +// default method in sub class +// ******************************************** + +PUBEXTDCLASS = new PubExtPublicClassFin(); +AddTestCase( "*** Access final property from method in sub class ***", 1, 1 ); +AddTestCase( "PUBEXTDCLASS.testSubSetDPArray(arr)", arr, PUBEXTDCLASS.testSubSetDPArray(arr) ); + +// fill in the rest of the cases here + +// ******************************************** +// access final property from +// public method in sub class +// ******************************************** + +PUBEXTDCLASS = new PubExtPublicClassFin(); +AddTestCase( "*** Access final property from public method in sub class ***", 1, 1 ); +AddTestCase( "PUBEXTDCLASS.pubSubSetDPArray(arr), PUBEXTDCLASS.pubSubGetDPArray()", arr, (PUBEXTDCLASS.pubSubSetDPArray(arr), PUBEXTDCLASS.pubSubGetDPArray()) ); + +// fill in the rest of the cases here + +// ******************************************** +// access final property from +// private method in sub class +// ******************************************** + +PUBEXTDCLASS = new PubExtPublicClassFin(); +AddTestCase( "*** Access final property from private method in sub class ***", 1, 1 ); +AddTestCase( "PUBEXTDCLASS.testPrivSubSetDPArray(arr)", arr, PUBEXTDCLASS.testPrivSubSetDPArray(arr) ); + + + +// ******************************************** +// access final property from +// final method in sub class +// ******************************************** + +PUBEXTDCLASS = new PubExtPublicClassFin(); +AddTestCase( "*** Access final property from final method in sub class ***", 1, 1 ); +AddTestCase( "PUBEXTDCLASS.testFinSubSetDPArray(arr)", arr, PUBEXTDCLASS.testFinSubSetDPArray(arr) ); + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtPublicClassFin/APublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtPublicClassFin/APublicClass.as new file mode 100644 index 00000000000..fb5e420c61c --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtPublicClassFin/APublicClass.as @@ -0,0 +1,262 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + public class PublicClass { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + //public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finMyFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray():Array { return finArray; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtPublicClassFin/PubExtPublicClassFin.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtPublicClassFin/PubExtPublicClassFin.as new file mode 100644 index 00000000000..4d498257f2d --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtPublicClassFin/PubExtPublicClassFin.as @@ -0,0 +1,139 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + import PublicClass.*; + + public class PubExtPublicClassFin extends PublicClass { + + // ************************************ + // access final method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return this.getFinArray(); } + function subSetArray(a:Array) { this.setFinArray(a); } + + public function testSubSetArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + + // ************************************ + // access final method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return this.getFinArray(); } + public function pubSubSetArray(a:Array) { this.setFinArray(a); } + + // ************************************ + // access final method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return this.getFinArray(); } + private function privSubSetArray(a:Array) { this.setFinArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + // ************************************ + // access final method of parent + // from final method of sub class + // ************************************ + + final function finSubGetArray() : Array { return this.getFinArray(); } + final function finSubSetArray(a:Array) { this.setFinArray(a); } + + public function testFinSubSetArray(a:Array) : Array { + this.finSubSetArray(a); + return this.finSubGetArray(); + } + + + // *************************************** + // access final property from + // default method of sub class + // *************************************** + + function subGetDPArray() : Array { return finArray; } + function subSetDPArray(a:Array) { finArray = a; } + + public function testSubSetDPArray(a:Array) : Array { + this.subSetDPArray(a); + return this.subGetDPArray(); + } + + + // *************************************** + // access final property from + // public method of sub class + // *************************************** + + public function pubSubGetDPArray() : Array { return this.finArray; } + public function pubSubSetDPArray(a:Array) { this.finArray = a; } + + // *************************************** + // access final property from + // private method of sub class + // *************************************** + + private function privSubGetDPArray() : Array { return this.finArray; } + private function privSubSetDPArray(a:Array) { this.finArray = a; } + + public function testPrivSubSetDPArray(a:Array) : Array { + this.privSubSetDPArray(a); + return this.privSubGetDPArray(); + } + + + // *************************************** + // access final property from + // final method of sub class + // *************************************** + + final function finSubGetDPArray() : Array { return finArray; } + final function finSubSetDPArray(a:Array) { finArray = a; } + + public function testFinSubSetDPArray(a:Array) : Array { + this.finSubSetDPArray(a); + return this.finSubGetDPArray(); + } + + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtPublicClassStat.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtPublicClassStat.as new file mode 100644 index 00000000000..a0c5228f782 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtPublicClassStat.as @@ -0,0 +1,190 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import PublicClass.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "dynamic Class Extends Public Class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +// create a new Array Object, with 3 instances. +arr = new Array(1, 2, 3); + +// ******************************************** +// access static method from a default +// method of a sub class +// +// ******************************************** + +PUBEXTDCLASSS = new PubExtPublicClassStat(); +AddTestCase( "*** Access static method from default method of sub class ***", 1, 1 ); +AddTestCase( "PUBEXTDCLASSS.testSubArray(arr)", arr, (PUBEXTDCLASSS.testSubArray(arr)) ); + + +// ******************************************** +// access static method from a public +// method of a sub class +// +// ******************************************** + +PUBEXTDCLASSS = new PubExtPublicClassStat(); +AddTestCase( "*** Access static method from public method of sub class ***", 1, 1 ); +AddTestCase( "PUBEXTDCLASSS.pubSubSetArray(arr), PUBEXTDCLASSS.pubSubGetArray()", arr, (PUBEXTDCLASSS.pubSubSetArray(arr), PUBEXTDCLASSS.pubSubGetArray()) ); + + +// ******************************************** +// access static method from a private +// method of a sub class +// +// ******************************************** + +PUBEXTDCLASSS = new PubExtPublicClassStat(); +AddTestCase( "*** Access static method from private method of sub class ***", 1, 1 ); +AddTestCase( "PUBEXTDCLASSS.testPrivSubArray(arr)", arr, PUBEXTDCLASSS.testPrivSubArray(arr) ); + + +// ******************************************** +// access static method from a final +// method of a sub class +// +// ******************************************** + +PUBEXTDCLASSS = new PubExtPublicClassStat(); +AddTestCase( "PUBEXTDCLASSS.testFinSubArray(arr)", arr, PUBEXTDCLASSS.testFinSubArray(arr) ); + +// ******************************************** +// access static method from a static +// method of a sub class +// +// ******************************************** + +AddTestCase( "*** Access static method from static method of sub class ***", 1, 1 ); +AddTestCase( "PubExtPublicClassStat.testStatSubArray(arr)", arr, PubExtPublicClassStat.testStatSubArray(arr) ); + + +// ******************************************** +// access static method from a public static +// method of a sub class +// +// ******************************************** + +AddTestCase( "*** Access static method from public static method of sub class ***", 1, 1 ); +AddTestCase( "PubExtPublicClassStat.pubStatSubSetArray(arr), PubExtPublicClassStat.pubStatSubGetArray()", arr, + (PubExtPublicClassStat.pubStatSubSetArray(arr), PubExtPublicClassStat.pubStatSubGetArray()) ); + + +// ******************************************** +// access static method from a private static +// method of a sub class +// +// ******************************************** + +//var PUBEXTDCLASSS = new PubExtPublicClassStat(); +AddTestCase( "*** Access static method from private static method of sub class ***", 1, 1 ); +AddTestCase( "PubExtPublicClassStat.testPrivStatSubArray(arr)", arr, PubExtPublicClassStat.testPrivStatSubArray(arr) ); + + +// ******************************************** +// access static property from +// default method in sub class +// ******************************************** + +PUBEXTDCLASSS = new PubExtPublicClassStat(); +AddTestCase( "*** Access static property from default method in sub class ***", 1, 1 ); +AddTestCase( "PUBEXTDCLASSS.testSubDPArray(arr)", arr, PUBEXTDCLASSS.testSubDPArray(arr) ); + + + +// ******************************************** +// access static property from +// public method in sub class +// ******************************************** + +PUBEXTDCLASSS = new PubExtPublicClassStat(); +AddTestCase( "*** Access static property from public method in sub class ***", 1, 1 ); +AddTestCase( "PUBEXTDCLASSS.pubSubSetDPArray(arr), PUBEXTDCLASSS.pubSubGetDPArray()", arr, (PUBEXTDCLASSS.pubSubSetDPArray(arr), PUBEXTDCLASSS.pubSubGetDPArray()) ); + + +// ******************************************** +// access static property from +// private method in sub class +// ******************************************** + +PUBEXTDCLASSS = new PubExtPublicClassStat(); +AddTestCase( "*** Access static property from private method in sub class ***", 1, 1 ); +AddTestCase( "PUBEXTDCLASSS.testPrivSubDPArray(arr)", arr, PUBEXTDCLASSS.testPrivSubDPArray(arr) ); + + +// ******************************************** +// access static property from +// static method in sub class +// ******************************************** + +AddTestCase( "*** Access static property from static method in sub class ***", 1, 1 ); +AddTestCase( "PubExtPublicClassStat.testStatSubPArray(arr)", arr, PubExtPublicClassStat.testStatSubPArray(arr) ); + +// ******************************************** +// access static property from +// public static method in sub class +// ******************************************** + +AddTestCase( "*** Access static property from public static method in sub class ***", 1, 1 ); +AddTestCase( "PubExtPublicClassStat.pubStatSubSetSPArray(arr), PubExtPublicClassStat.pubStatSubGetSPArray()", arr, + (PubExtPublicClassStat.pubStatSubSetSPArray(arr), PubExtPublicClassStat.pubStatSubGetSPArray()) ); + +// ******************************************** +// access static property from +// private static method in sub class +// ******************************************** + +PUBEXTDCLASSS = new PubExtPublicClassStat(); +AddTestCase( "*** Access static property from private static method in sub class ***", 1, 1 ); +AddTestCase( "PUBEXTDCLASSS.testPrivStatSubPArray(arr)", arr, PUBEXTDCLASSS.testPrivStatSubPArray(arr)); + + + +// ******************************************** +// access static property from +// final method in sub class +// ******************************************** + +PUBEXTDCLASSS = new PubExtPublicClassStat(); +AddTestCase( "*** Access static property from final method in sub class ***", 1, 1 ); +AddTestCase( "PUBEXTDCLASSS.testFinSubDPArray(arr)", arr, PUBEXTDCLASSS.testFinSubDPArray(arr) ); + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtPublicClassStat/APublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtPublicClassStat/APublicClass.as new file mode 100644 index 00000000000..fb5e420c61c --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtPublicClassStat/APublicClass.as @@ -0,0 +1,262 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + public class PublicClass { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + //public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finMyFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray():Array { return finArray; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtPublicClassStat/PubExtPublicClassStat.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtPublicClassStat/PubExtPublicClassStat.as new file mode 100644 index 00000000000..8ea5a87421a --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubExtPublicClassStat/PubExtPublicClassStat.as @@ -0,0 +1,214 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + import PublicClass.*; + + public class PubExtPublicClassStat extends PublicClass { + + // ************************************ + // access static method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return getStatArray(); } + function subSetArray(a:Array) { setStatArray(a); } + + // function to test above from test scripts + public function testSubArray(a:Array) : Array { + subSetArray(a); + return subGetArray(); + } + + // ************************************ + // access static method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return getStatArray(); } + public function pubSubSetArray(a:Array) { setStatArray(a); } + + // ************************************ + // access static method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return getStatArray(); } + private function privSubSetArray(a:Array) { setStatArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + privSubSetArray(a); + return privSubGetArray(); + } + + // *************************************** + // access static method of parent + // from final method of sub class + // *************************************** + + final function finStatSubGetArray() : Array { return getStatArray(); } + final function finStatSubSetArray(a:Array) { setStatArray(a); } + + public function testFinSubArray(a:Array) : Array { + finStatSubSetArray(a); + return finStatSubGetArray(); + } + + + // *************************************** + // access static method of parent + // from static method of sub class + // *************************************** + + static function statSubGetArray() : Array { return getStatArray(); } + static function statSubSetArray(a:Array) { setStatArray(a); } + + public static function testStatSubArray(a:Array) : Array { + statSubSetArray(a); + return statSubGetArray(); + } + + + // *************************************** + // access static method of parent + // from public static method of sub class + // *************************************** + + public static function pubStatSubGetArray() : Array { return getStatArray(); } + public static function pubStatSubSetArray(a:Array) { setStatArray(a); } + + // *************************************** + // access static method of parent + // from private static method of sub class + // *************************************** + + private static function privStatSubGetArray() : Array { return getStatArray(); } + private static function privStatSubSetArray(a:Array) { setStatArray(a); } + + // public accessor to test asrt + public static function testPrivStatSubArray(a:Array) : Array { + privStatSubSetArray(a); + return privStatSubGetArray(); + } + + + + // *************************************** + // access static property from + // default method of sub class + // *************************************** + + function subGetDPArray() : Array { return statArray; } + function subSetDPArray(a:Array) { statArray = a; } + // function to test above from test scripts + public function testSubDPArray(a:Array) : Array { + subSetDPArray(a); + return subGetDPArray(); + } + + + // *************************************** + // access static property from + // public method of sub class + // *************************************** + + public function pubSubGetDPArray() : Array { return statArray; } + public function pubSubSetDPArray(a:Array) { statArray = a; } + + // *************************************** + // access static property from + // private method of sub class + // *************************************** + + private function privSubGetDPArray() : Array { return statArray; } + private function privSubSetDPArray(a:Array) { statArray = a; } + // function to test above from test scripts + public function testPrivSubDPArray(a:Array) : Array { + privSubSetDPArray(a); + return privSubGetDPArray(); + } + + // *************************************** + // access static property from + // static method of sub class + // *************************************** + + static function statSubGetSPArray() : Array { return statArray; } + static function statSubSetSPArray(a:Array) { statArray = a; } + + public static function testStatSubPArray(a:Array) : Array { + statSubSetSPArray( a ); + return statSubGetSPArray(); + } + + + // *************************************** + // access static property from + // public static method of sub class + // *************************************** + + public static function pubStatSubGetSPArray() : Array { return statArray; } + public static function pubStatSubSetSPArray(a:Array) { statArray = a; } + + // *************************************** + // access static property from + // private static method of sub class + // *************************************** + + private static function privStatSubGetSPArray() : Array { return statArray; } + private static function privStatSubSetSPArray(a:Array) { statArray = a; } + + // public accessor for asrt + public function testPrivStatSubPArray(a:Array) : Array { + privStatSubSetSPArray( a ); + return privStatSubGetSPArray(); + } + + // *************************************** + // access static property from + // final method of sub class + // *************************************** + + final function finSubGetDPArray() : Array { return statArray; } + final function finSubSetDPArray(a:Array) { statArray = a; } + // function to test above from test scripts + + public function testFinSubDPArray(a:Array) : Array { + finSubSetDPArray(a); + return finSubGetDPArray(); + } + + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubFinExtDefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubFinExtDefaultClass.as new file mode 100644 index 00000000000..470846ede02 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubFinExtDefaultClass.as @@ -0,0 +1,236 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + +import DefaultClass.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Public Final Class Extends Default Class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +// ******************************************* +// access default method from +// outside of class +// ******************************************* + +var DYNEXTDCLASS = new PubFinExtDefaultClass(); +var arr = new Array(10, 15, 20, 25, 30); + +AddTestCase( "*** Access Default Method from Default method of sub class ***", 1, 1 ); +AddTestCase( "DYNEXTDCLASS.testSubGetSetArray(arr)", arr, (DYNEXTDCLASS.testSubGetSetArray(arr)) ); + + +// ******************************************** +// access default method from a public +// method of a sub class +// +// ******************************************** +var arr = new Array(1, 5); +DYNEXTDCLASS = new PubFinExtDefaultClass(); +AddTestCase( "*** Access default method from public method of sub class ***", 1, 1 ); +AddTestCase( "DYNEXTDCLASS.pubSubSetArray(arr), DYNEXTDCLASS.pubSubGetArray()", arr, (DYNEXTDCLASS.pubSubSetArray(arr), DYNEXTDCLASS.pubSubGetArray()) ); + + +// ******************************************** +// access default method from a private +// method of a sub class +// +// ******************************************** +var arr = new Array(2, 4, 6); +DYNEXTDCLASS = new PubFinExtDefaultClass(); +AddTestCase( "*** Access default method from private method of sub class ***", 1, 1 ); +AddTestCase( "DYNEXTDCLASS.testPrivSubArray(arr)", arr, DYNEXTDCLASS.testPrivSubArray(arr) ); + +// ******************************************** +// access default method from a final +// method of a sub class +// +// ******************************************** + +DYNEXTDCLASS = new PubFinExtDefaultClass(); +AddTestCase( "access 'default' method from 'final' method of sub class", arr, (DYNEXTDCLASS.testFinSubArray(arr)) ); + +// ******************************************** +// access default method from a static +// method of a sub class +// +// ******************************************** +/* +var arr = new Array(1, 5); +DYNEXTDCLASS = new PubFinExtDefaultClass(); +AddTestCase( "*** Access default method from static method of sub class ***", 1, 1 ); +AddTestCase( "DYNEXTDCLASS.testStatSubArray(arr)", arr, (DYNEXTDCLASS.testStatSubArray(arr)) ); +*/ + +// ******************************************** +// access default method from a public +// final method of a sub class +// ******************************************** + +arr = new Array( 1, 2, 3 ); +DYNEXTDCLASS = new PubFinExtDefaultClass(); +AddTestCase( "access 'default' method from 'public final' method of sub class", arr, + (DYNEXTDCLASS.pubFinSubSetArray(arr), DYNEXTDCLASS.pubFinSubGetArray()) ); + +// ******************************************** +// access default method from a final +// private method of a sub class +// ******************************************** + +arr = new Array( 4, 5 ); +DYNEXTDCLASS = new PubFinExtDefaultClass(); +AddTestCase( "access 'default' method from 'private final' method of sub class", arr, (DYNEXTDCLASS.testPrivFinSubArray(arr)) ); + +// ******************************************** +// access default method from a private +// method of a sub class +// ******************************************** + +arr = new Array( 6, 7 ); +DYNEXTDCLASS = new PubFinExtDefaultClass(); +AddTestCase( "access 'default' method from 'private' method of sub class", arr, DYNEXTDCLASS.testPrivSubArray(arr) ); + +// ******************************************** +// access default method from a virtual +// method of a sub class +// ******************************************** + +AddTestCase( "access 'default' method from 'virtual' method of sub class", arr, + DYNEXTDCLASS.testVirtSubArray(arr) ); + +// ******************************************** +// access default method from a virtual +// public method of a sub class +// ******************************************** + +AddTestCase( "access 'default' method from 'public virtual' method of sub class", arr, + (DYNEXTDCLASS.pubVirtSubSetArray(arr), DYNEXTDCLASS.pubVirtSubGetArray()) ); + +// ******************************************** +// access default method from a virtual +// private method of a sub class +// ******************************************** + +AddTestCase( "access 'default' method from 'private virtual' method of sub class", arr, + DYNEXTDCLASS.testPrivVirtSubArray(arr) ); + + + +/* Access properties of parent class */ + +// ******************************************** +// access default property from +// default method in sub class +// ******************************************** + +DYNEXTDCLASS = new PubFinExtDefaultClass(); +AddTestCase( "access 'default' property from 'default' method of sub class", arr, + (DYNEXTDCLASS.testSubGetSetDPArray(arr)) ); + +// ******************************************** +// access default property from +// final method in sub class +// ******************************************** + +DYNEXTDCLASS = new PubFinExtDefaultClass(); +AddTestCase( "access 'default' property from 'final' method of sub class", arr, + (DYNEXTDCLASS.testFinSubDPArray(arr)) ); + +// ******************************************** +// access default property from +// virtual method in sub class +// ******************************************** + +DYNEXTDCLASS = new PubFinExtDefaultClass(); +AddTestCase( "access 'default' property from 'virtual' method of sub class", arr, + (DYNEXTDCLASS.testVirtSubDPArray(arr)) ); + +// ******************************************** +// access default property from +// public method in sub class +// ******************************************** + +DYNEXTDCLASS = new PubFinExtDefaultClass(); +AddTestCase( "access 'default' property from 'public' method of sub class", arr, + (DYNEXTDCLASS.pubSubSetDPArray(arr), DYNEXTDCLASS.pubSubGetDPArray()) ); + +// ******************************************** +// access default property from +// private method in sub class +// ******************************************** + +DYNEXTDCLASS = new PubFinExtDefaultClass(); +AddTestCase( "access 'default' property from 'private' method of sub class", arr, + (DYNEXTDCLASS.testPrivSubDPArray(arr)) ); + +// ******************************************** +// access default property from +// public final method in sub class +// ******************************************** + +DYNEXTDCLASS = new PubFinExtDefaultClass(); +AddTestCase( "access 'default' property from 'public final' method of sub class", arr, + (DYNEXTDCLASS.pubFinSubSetDPArray(arr), DYNEXTDCLASS.pubFinSubGetDPArray()) ); + +// ******************************************** +// access default property from +// public virtual method in sub class +// ******************************************** + +DYNEXTDCLASS = new PubFinExtDefaultClass(); +AddTestCase( "access 'default' property from 'public virtual' method of sub class", arr, + (DYNEXTDCLASS.pubVirtSubSetDPArray(arr), DYNEXTDCLASS.pubVirtSubGetDPArray()) ); + +// ******************************************** +// access default property from +// private final method in sub class +// ******************************************** + +DYNEXTDCLASS = new PubFinExtDefaultClass(); +AddTestCase( "access 'default' property from 'private final' method of sub class", arr, + (DYNEXTDCLASS.testPrivFinSubDPArray(arr)) ); + +// ******************************************** +// access default property from +// private virtual method in sub class +// ******************************************** + +DYNEXTDCLASS = new PubFinExtDefaultClass(); +AddTestCase( "access 'default' property from 'private virtual' method of sub class", arr, + (DYNEXTDCLASS.testPrivVirtSubDPArray(arr)) ); + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubFinExtDefaultClass/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubFinExtDefaultClass/DefaultClass.as new file mode 100644 index 00000000000..2b3618393b9 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubFinExtDefaultClass/DefaultClass.as @@ -0,0 +1,264 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DefaultClass { + + class DefaultClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + //public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + } + + public class DefaultClass extends DefaultClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubFinExtDefaultClass/PubFinExtDefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubFinExtDefaultClass/PubFinExtDefaultClass.as new file mode 100644 index 00000000000..ce46cf10221 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Ext/PubFinExtDefaultClass/PubFinExtDefaultClass.as @@ -0,0 +1,271 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + +package DefaultClass { + + import DefaultClass.* + + public final class PubFinExtDefaultClass extends DefaultClass { + + // ************************************ + // access default method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return this.getArray(); } + function subSetArray(a:Array) { this.setArray(a); } + + // ************************************ + // access default method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return this.getArray(); } + public function pubSubSetArray(a:Array) { this.setArray(a); } + + // this is needed so that the test cases can access this from + // outside the class. This way the test case itself preserved + public function testSubGetSetArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + // ************************************ + // access default method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return this.getArray(); } + private function privSubSetArray(a:Array) { this.setArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + // ************************************ + // access default method of parent + // from final method of sub class + // ************************************ + + final function finGetArray() : Array { return this.getArray(); } + final function finSetArray(a:Array) { this.setArray(a); } + + // this is needed so that the test cases can access this from + // outside the class. This way the test case itself preserved + public function testFinSubArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + // ************************************ + // access default method of parent + // from static method of sub class + // ************************************ + + static function statGetArray() : Array { return getArray(); } + static function statSetArray(a:Array) { setArray(a); } + // this is needed so that the test cases can access this from + // outside the class. This way the test case itself preserved + public function testStatSubArray(a:Array) : Array { + this.statSetArray(a); + return this.statGetArray(); + } + + // ************************************ + // access default method of parent + // from public final method of sub class + // ************************************ + + public final function pubFinSubGetArray() : Array { return this.getArray(); } + final public function pubFinSubSetArray(a:Array) { this.setArray(a); } + + // ************************************ + // access default method of parent + // from private final method of sub class + // ************************************ + + private final function privFinSubGetArray() : Array { return this.getArray(); } + final private function privFinSubSetArray(a:Array) { this.setArray(a); } + + public function testPrivFinSubArray(a:Array):Array { + this.privFinSubSetArray(a); + return this.privFinSubGetArray(); + } + + + // ************************************ + // access default method of parent + // from virtual method of sub class + // ************************************ + + virtual function virtSubGetArray() : Array { return this.getArray(); } + virtual function virtSubSetArray(a:Array) { this.setArray(a); } + + public function testVirtSubArray(a:Array) : Array { + this.virtSubSetArray(a); + return this.virtSubGetArray(); + } + + // ************************************ + // access default method of parent + // from public virtual method of sub class + // ************************************ + + virtual public function pubVirtSubGetArray() : Array { return this.getArray(); } + public virtual function pubVirtSubSetArray(a:Array) { this.setArray(a); } + + // ************************************ + // access default method of parent + // from private virtual method of sub class + // ************************************ + + virtual private function privVirtSubGetArray() : Array { return this.getArray(); } + private virtual function privVirtSubSetArray(a:Array) { this.setArray(a); } + + public function testPrivVirtSubArray(a:Array) : Array { + this.privVirtSubSetArray(a); + return this.privVirtSubGetArray(); + } + + + // *************************************** + // access default property from + // default method of sub class + // *************************************** + + function subGetDPArray() : Array { return array; } + function subSetDPArray(a:Array) { array = a; } + + // this is needed so that the test cases can access this from + // outside the class. This way the test case itself preserved + public function testSubGetSetDPArray(a:Array) : Array { + this.subSetDPArray(a); + return this.subGetDPArray(); + } + + // *************************************** + // access default property from + // public method of sub class + // *************************************** + + public function pubSubGetDPArray() : Array { return array; } + public function pubSubSetDPArray(a:Array) { array = a; } + + // *************************************** + // access default property from + // private method of sub class + // *************************************** + + private function privSubGetDPArray() : Array { return array; } + private function privSubSetDPArray(a:Array) { array = a; } + + public function testPrivSubDPArray(a:Array) : Array { + this.privSubSetDPArray(a); + return this.privSubGetDPArray(); + } + + + // *************************************** + // access default property from + // final method of sub class + // *************************************** + + final function finSubGetDPArray() : Array { return array; } + final function finSubSetDPArray(a:Array) { array = a; } + + public function testFinSubDPArray(a:Array) : Array { + this.finSubSetDPArray(a); + return this.finSubGetDPArray(); + } + + // *************************************** + // access default property from + // virtual method of sub class + // *************************************** + + virtual function virtSubGetDPArray() : Array { return array; } + virtual function virtSubSetDPArray(a:Array) { array = a; } + + public function testVirtSubDPArray(a:Array) : Array { + this.virtSubSetDPArray(a); + return this.virtSubGetDPArray(); + } + + // *************************************** + // access default property from + // public virtual method of sub class + // *************************************** + + public virtual function pubVirtSubGetDPArray() : Array { return array; } + virtual public function pubVirtSubSetDPArray(a:Array) { array = a; } + + // *************************************** + // access default property from + // private final method of sub class + // *************************************** + + private final function privFinSubGetDPArray() : Array { return array; } + final private function privFinSubSetDPArray(a:Array) { array = a; } + + public function testPrivFinSubDPArray(a:Array):Array { + this.privFinSubSetDPArray(a); + return this.privFinSubGetDPArray(); + } + + // *************************************** + // access default property from + // private virtual method of sub class + // *************************************** + + private virtual function privVirtSubGetDPArray() : Array { return array; } + virtual private function privVirtSubSetDPArray(a:Array) { array = a; } + + public function testPrivVirtSubDPArray(a:Array):Array { + this.privVirtSubSetDPArray(a); + return this.privVirtSubGetDPArray(); + } + + // *************************************** + // access default property from + // public final method of sub class + // *************************************** + + public final function pubFinSubGetDPArray() : Array { return array; } + final public function pubFinSubSetDPArray(a:Array) { array = a; } + + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtDefClassImpDefInt.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtDefClassImpDefInt.as new file mode 100644 index 00000000000..b8acc2274ff --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtDefClassImpDefInt.as @@ -0,0 +1,61 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import DefClassImpDefInt.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Default class implements default interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new DefaultsubClassAccessor(); +//use namespace ns; + +//Default sub class extends super class that implements a default interface with a default //method +AddTestCase("Default sub class extends Default class that implements a default interface with a default method", "PASSED", obj.accdeffunc()); +AddTestCase("Default sub class extends Default class that implements a default interface with a default method", 10, obj.accdeffunc2()); +AddTestCase("Default sub class extends Default class that implements a default interface with a default method", 20, obj.accdeffunc3()); +AddTestCase("Default sub class extends Default class that implements a default interface with a default method", "PASSED", obj.accsupdeffunc()); + +//Default sub class extends default super class that implements a default interface with a //public method +AddTestCase("Default sub class extends Default class that implements a default interface with a public method", false, obj.pubFunc()); + +//Default class implements a default interface with a namespace method +AddTestCase("Default sub class extends Default class that implements a default interface with a method with namespace qualifier", 4, obj.accnsFunc()); + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtDefClassImpDefInt/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtDefClassImpDefInt/DefaultClass.as new file mode 100644 index 00000000000..836d712cc87 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtDefClassImpDefInt/DefaultClass.as @@ -0,0 +1,70 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Default Class DefaultClass + * Class methods + * + */ + +package DefClassImpDefInt{ +use namespace ns; + + class DefaultClass implements DefaultInt{ + + + public function deffunc():String{ + return"PASSED"; + } + + public function deffunc2():Number{ + var a:Number; + a=10; + return a; + } + public function deffunc3():int{ + var b:int; + b=20; + return b; + } + public function pubFunc():Boolean{ //Public method + return true; + } + + ns function nsFunc(a="test"):int{ //Namespace method + return a.length; + } + + + } + + + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtDefClassImpDefInt/DefaultInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtDefClassImpDefInt/DefaultInterface.as new file mode 100644 index 00000000000..350c4095880 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtDefClassImpDefInt/DefaultInterface.as @@ -0,0 +1,50 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Default Interface DefaultInterface + * Interface methods + * + */ + + +package DefClassImpDefInt{ //package name + + namespace ns; + //namespace + + interface DefaultInt{ + + function deffunc():String; //Default attribute method + function deffunc2():Number; + function deffunc3():int; + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtDefClassImpDefInt/DefaultsubClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtDefClassImpDefInt/DefaultsubClass.as new file mode 100644 index 00000000000..36f66d62c96 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtDefClassImpDefInt/DefaultsubClass.as @@ -0,0 +1,74 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Default Class DefaultClass + * Class methods + * + */ + +package DefClassImpDefInt{ +use namespace ns; + + class DefaultsubClass extends DefaultClass{ + + + + + + override public function pubFunc():Boolean{//Public method + + + return !true; + } + + ns override function nsFunc(a="test"):int{ //Namespace method + return a.length; + } + + } + + public class DefaultsubClassAccessor extends DefaultsubClass{ + + var DefSubClass = new DefaultsubClass(); + var DefSupClass = new DefaultClass(); + var i:DefaultInt = DefSupClass; + //var k = new DefaultClassAccessor(); + public function accdeffunc(){return DefSubClass.deffunc();} + // access default function deffunc + public function accdeffunc2(){return i.deffunc2();} + public function accdeffunc3(){return DefSupClass.DefaultInt::deffunc3();} + public function accsupdeffunc(){return DefSupClass.deffunc();} + + public function accnsFunc(a="test"){return ns::nsFunc(a);} + // access default function nsFunc + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtDefClassImpIntInt.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtDefClassImpIntInt.as new file mode 100644 index 00000000000..752ba3222f8 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtDefClassImpIntInt.as @@ -0,0 +1,63 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import DefClassImpInternalInt.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Default class implements internal interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new DefaultsubClassAccessor(); +//use namespace ns; + +//Default sub class extends Default Class that implements a internal interface with a //default method +AddTestCase("Default sub class extends a default class that implements an internal interface with a default method", "PASSED", obj.accdeffunc()); +AddTestCase("Default sub class extends a default class that implements an internal interface with a default method", 10, obj.retaccdeffunc2()); +AddTestCase("Default sub class extends a default class that implements an internal interface with a default method", 20, obj.retaccdeffunc3()); + +//Default sub class extends Default class implements a default interface with a public //method +AddTestCase("Default sub class extends a default class that implements an internal interface with a default method calling super method", "PASSED", obj.accsupdeffunc()); + +//Default sub class extends Default class implements a default interface with a public //method +AddTestCase("Default sub class extends a default class that implements an internal interface with a public method", false, obj.pubFunc()); + +//Default class implements a default interface with a namespace method +AddTestCase("Default sub class extends a default class that implements an internal interface with a default method", 4, obj.accnsFunc()); + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtDefClassImpIntInt/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtDefClassImpIntInt/DefaultClass.as new file mode 100644 index 00000000000..deb4a318020 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtDefClassImpIntInt/DefaultClass.as @@ -0,0 +1,81 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Default Class DefaultClass + * Class methods + * + */ + +package DefClassImpInternalInt{ +use namespace ns; + + class DefaultClass implements InternalInt{ + + + public function deffunc():String{ //Default method + return"PASSED"; + } + public function deffunc2():Number{ // + var a:Number; + a=10; + return a; + } + public function deffunc3():int{ + var b:int; + b=20; + return b; + } + + + public function pubFunc():Boolean{ //Public method + return true; + } + + ns function nsFunc(a="test"):int{ //Namespace method + return a.length; + } + + } + + public class DefaultClassAccessor{ + + var B = new DefaultClass(); + var i:InternalInt=B; + public function accdeffunc(){return deffunc();} + // access default function deffunc + public function accdeffunc2():Number{return i.deffunc2();} + public function accdeffunc3():int{return B.InternalInt::deffunc3();} + + public function accnsFunc(a="test"){return ns::nsFunc(a);} + // access default function nsFunc + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtDefClassImpIntInt/DefaultsubClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtDefClassImpIntInt/DefaultsubClass.as new file mode 100644 index 00000000000..339a53f4ef4 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtDefClassImpIntInt/DefaultsubClass.as @@ -0,0 +1,75 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Default sub Class extends DefaultClass + * Class methods + * + */ + +package DefClassImpInternalInt{ +use namespace ns; + + class DefaultsubClass extends DefaultClass{ + + + + + + override public function pubFunc():Boolean{//Public method + + + return !true; + } + + ns override function nsFunc(a="test"):int{ //Namespace method + return a.length; + } + + } + + public class DefaultsubClassAccessor extends DefaultsubClass{ + //var pubsupacc = new DefaultClassAccesor(); + var DefSubClass = new DefaultsubClass(); + var DefSupClass = new DefaultClass(); + //var i:DefaultInt=DefSupClass; + var k = new DefaultClassAccessor(); + public function accdeffunc(){return DefSubClass.deffunc();} + // access default function deffunc + public function retaccdeffunc2(){return k.accdeffunc2();} + public function retaccdeffunc3(){return k.accdeffunc3();} + public function accsupdeffunc(){return DefSupClass.deffunc();} + public function accpubfunc(){return pubFunc();} + + public function accnsFunc(a="test"){return ns::nsFunc(a);} + // access default function nsFunc + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtDefClassImpIntInt/InternalInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtDefClassImpIntInt/InternalInterface.as new file mode 100644 index 00000000000..ee8eab28b4a --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtDefClassImpIntInt/InternalInterface.as @@ -0,0 +1,55 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Internal Interface InternalInterface + * Interface methods + * + */ + + +package DefClassImpInternalInt{ //package name + + namespace ns; + //namespace + + internal interface InternalInt{ + + function deffunc():String; //interface namespace method + + function deffunc2():Number; //interface namespace method + function deffunc3():int; //interface namespace method + + + + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtDefClassImpPubInt.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtDefClassImpPubInt.as new file mode 100644 index 00000000000..235d17df665 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtDefClassImpPubInt.as @@ -0,0 +1,61 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import DefClassImpPublicInt.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Default class implements public interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new DefaultsubClassAccessor(); +//use namespace ns; + +//Default sub class extends Default class that implements a default interface with a default //method +AddTestCase("Default class implements an public interface with a default method", "PASSED", obj.accdeffunc()); +//AddTestCase("Default class implements an public interface with a default method", 10, obj.accdeffunc2()); +AddTestCase("Default class implements an public interface with a default method", 20, obj.accdeffunc3()); +AddTestCase("Default sub class extends Default class that implements a public interface with a default method", "PASSED", obj.accsupdeffunc()); + +//Default sub class extends Default class that implements a default interface with a public //method +AddTestCase("Default sub class extends Default class that implements a public interface with a public method", false, obj.pubFunc()); + +//Default sub class extendsDefault class implements a default interface with a namespace //method +AddTestCase("Default sub class extends Default class that implements an public interface with a namespace method", 4, obj.accnsFunc()); + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtDefClassImpPubInt/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtDefClassImpPubInt/DefaultClass.as new file mode 100644 index 00000000000..2fcebd176c4 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtDefClassImpPubInt/DefaultClass.as @@ -0,0 +1,69 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Default Class DefaultClass + * Class methods + * + */ + +package DefClassImpPublicInt{ +use namespace ns; + + class DefaultClass implements PublicInt{ + + + public function deffunc():String{ //Default method + return"PASSED"; + } + /*PublicInt function deffunc2():Number{ + var a:Number; + a=10; + return a; + }*/ + public function deffunc3():int{ + var b:int; + b=20; + return b; + } + + public function pubFunc():Boolean{ //Public method + return true; + } + + ns function nsFunc(a="test"):int{ //Namespace method + return a.length; + } + + } + + + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtDefClassImpPubInt/DefaultsubClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtDefClassImpPubInt/DefaultsubClass.as new file mode 100644 index 00000000000..70a5cf842ce --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtDefClassImpPubInt/DefaultsubClass.as @@ -0,0 +1,73 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Default Class DefaultClass + * Class methods + * + */ + +package DefClassImpPublicInt{ +use namespace ns; + + class DefaultsubClass extends DefaultClass{ + + + + + + override public function pubFunc():Boolean{//Public method + + + return !true; + } + + ns override function nsFunc(a="test"):int{ //Namespace method + return a.length; + } + + } + + public class DefaultsubClassAccessor extends DefaultsubClass{ + + var DefSubClass = new DefaultsubClass(); + var DefSupClass = new DefaultClass(); + var i:PublicInt = DefSupClass; + public function accdeffunc(){return DefSubClass.deffunc();} + // access default function deffunc + public function accdeffunc2(){return i.deffunc2();} + public function accdeffunc3(){return DefSupClass.PublicInt::deffunc3();} + public function accsupdeffunc(){return DefSupClass.deffunc();} + + public function accnsFunc(a="test"){return ns::nsFunc(a);} + // access default function nsFunc + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtDefClassImpPubInt/PublicInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtDefClassImpPubInt/PublicInterface.as new file mode 100644 index 00000000000..89a107b01e3 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtDefClassImpPubInt/PublicInterface.as @@ -0,0 +1,50 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Public Interface PublicInterface + * Interface methods + * + */ + + +package DefClassImpPublicInt{ //package name + + namespace ns; + //namespace + + public interface PublicInt{ + + function deffunc():String; //Default attribute //function deffunc2():Number; + function deffunc3():int; + + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtIntClassImpIntInt.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtIntClassImpIntInt.as new file mode 100644 index 00000000000..9fae79a16a1 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtIntClassImpIntInt.as @@ -0,0 +1,60 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import IntClassImpInternalInt.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Default class implements internal interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new DefsubExtIntClassImpIntInt(); + + + + + +//Default sub class extends internal class implements a default interface with a public //method +AddTestCase("Default sub class extends a internal class that implements an internal interface with a public method", true, obj.pubFunc()); +AddTestCase("Default sub class extends a internal class that implements an internal interface with a public method", 10, obj.accdeffunc2()); +AddTestCase("Default sub class extends a internal class that implements an internal interface with a public method", 20, obj.accdeffunc3()); + +//Default class implements a internal interface with a namespace method +AddTestCase("Default sub class extends a internal class that implements an internal interface with a namespace method", 4, obj.accnsFunc()); + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtIntClassImpIntInt/DefsubExtIntClassImpIntInt.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtIntClassImpIntInt/DefsubExtIntClassImpIntInt.as new file mode 100644 index 00000000000..903569ad6d3 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtIntClassImpIntInt/DefsubExtIntClassImpIntInt.as @@ -0,0 +1,103 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Default Class DefaultClass + * Class methods + * + */ + +package IntClassImpInternalInt{ +namespace ns; + + + + + internal interface InternalInt{ + + function pubFunc():Boolean; //attribute method + function deffunc2():Number; //interface namespace method + function deffunc3():int; //interface namespace method + + } + + internal class InternalClass implements InternalInt{ + + public function deffunc2():Number{ + var a:Number; + a=10; + return a; + } + public function deffunc3():int{ + var b:int; + b=20; + return b; + } + + + public function pubFunc():Boolean{ //Public method + return true; + } + + ns function nsFunc(a="test"):int{ //Namespace method + return a.length; + } + + } + +class DefaultsubClass extends InternalClass{ + + + + + + + ns override function nsFunc(a="pass"):int{ //Namespace method + return a.length; + } + + } + + public class DefsubExtIntClassImpIntInt extends DefaultsubClass{ + //var pubsupacc = new DefaultClassAccesor(); + var DefSubClass = new DefaultsubClass(); + var DefSupClass = new InternalClass(); + var i:InternalInt=DefSupClass; + public function accdeffunc2():Number{return i.deffunc2();} + public function accdeffunc3():int{return DefSupClass.InternalInt::deffunc3();} + public function accpubfunc(){return pubFunc();} + + public function accnsFunc(a="test"){return ns::nsFunc(a);} + // access default function nsFunc + } + + + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtPubClassImpIntInt.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtPubClassImpIntInt.as new file mode 100644 index 00000000000..3861879d5d4 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtPubClassImpIntInt.as @@ -0,0 +1,61 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import PubClassImpInternalInt.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Default class implements internal interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new DefaultsubClassAccessor(); +//use namespace ns; + +//Default sub class extends Default Class that implements a internal interface with a //default method +AddTestCase("Default sub class extends a default class that implements an internal interface with a default method", "reallyPASSED", obj.accdeffunc()); +AddTestCase("Default sub class extends a default class that implements an internal interface with a default method", 20, obj.accdeffunc3()); +//Default sub class extends Default class implements a default interface with a public //method +AddTestCase("Default sub class extends a default class that implements an internal interface with a default method calling super method", "PASSED", obj.accsupdeffunc()); + +//Default sub class extends Default class implements a default interface with a public //method +AddTestCase("Default sub class extends a default class that implements an internal interface with a public method", false, obj.pubFunc()); + +//Default class implements a default interface with a namespace method +AddTestCase("Default sub class extends a default class that implements an internal interface with a default method", 4, obj.accnsFunc()); + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtPubClassImpIntInt/DefaultsubClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtPubClassImpIntInt/DefaultsubClass.as new file mode 100644 index 00000000000..52af0826ae6 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtPubClassImpIntInt/DefaultsubClass.as @@ -0,0 +1,41 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Default sub Class extends DefaultClass + * Class methods + * + */ + +package PubClassImpInternalInt{ +use namespace ns; + + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtPubClassImpIntInt/InternalInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtPubClassImpIntInt/InternalInterface.as new file mode 100644 index 00000000000..9d128d73517 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtPubClassImpIntInt/InternalInterface.as @@ -0,0 +1,44 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Internal Interface InternalInterface + * Interface methods + * + */ + + +package PubClassImpInternalInt{ //package name + + namespace ns; + //namespace + + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtPubClassImpIntInt/PublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtPubClassImpIntInt/PublicClass.as new file mode 100644 index 00000000000..546e0ea93cf --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DefsubExtPubClassImpIntInt/PublicClass.as @@ -0,0 +1,109 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Default Class DefaultClass + * Class methods + * + */ + +package PubClassImpInternalInt{ +use namespace ns; + internal interface InternalInt{ + + function deffunc():String; //Default //function deffunc2():Number; //interface namespace method + function deffunc3():int; //interface namespace method //attribute method + + + } + + public class PublicClass implements InternalInt{ + + + public function deffunc():String{ //Default method + return"PASSED"; + } + /*InternalInt function deffunc2():Number{ //Interface Namespace method var a:Number; + a=10; + return a; + }*/ + public function deffunc3():int{ //Interface Namespace method var b:int; + b=20; + return b; + } + + + public function pubFunc():Boolean{ //Public method + return true; + } + + ns function nsFunc(a="test"):int{ //Namespace method + return a.length; + } + + } + class DefaultsubClass extends PublicClass{ + + + override public function deffunc():String{ //Default method + return "really"+"PASSED"; + } + + + override public function pubFunc():Boolean{//Public method + + + return !true; + } + + ns override function nsFunc(a="test"):int{ //Namespace method + return a.length; + } + + } + + public class DefaultsubClassAccessor extends DefaultsubClass{ + //var pubsupacc = new DefaultClassAccesor(); + var DefSubClass = new DefaultsubClass(); + var DefSupClass = new PublicClass(); + var i:InternalInt = DefSupClass; + public function accdeffunc(){return DefSubClass.deffunc();} + // access default function deffunc + //public function accdeffunc2(){return i.deffunc2();} + public function accdeffunc3(){return DefSupClass.InternalInt::deffunc3();} + public function accsupdeffunc(){return DefSupClass.deffunc();} + public function accpubfunc(){return pubFunc();} + + public function accnsFunc(a="test"){return ns::nsFunc(a);} + // access default function nsFunc + } + + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDefaultImplDefDefPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDefaultImplDefDefPub.as new file mode 100644 index 00000000000..825de57828f --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDefaultImplDefDefPub.as @@ -0,0 +1,82 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "Clean AS2"; // Version of JavaScript or ECMA +var TITLE = "Extend Default Class Implement Default interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +import DefaultClass.*; + +var THISTEST = new DynExtDefaultImplDefDefPub(); +//var i:DefaultInt = THISTEST; +//var j:DefaultIntDef=THISTEST; +// ******************************************* +// define default method from interface as a +// public method in the sub class +// ******************************************* + +//This should throw an error message + +//AddTestCase( "*** default() method implemented interface ***", 1, 1 ); +AddTestCase( "THISTEST.setBoolean(false), THISTEST.iGetBoolean()", false, (THISTEST.iGetBooleanacc1()) ); +AddTestCase( "THISTEST.setBoolean(true), THISTEST.iGetBoolean()", false, (THISTEST.iGetBooleanacc2()) ); + +// ******************************************* +// define public method from interface as a +// public method in the sub class +// ******************************************* + +AddTestCase( "*** public method implemented interface ***", 1, 1 ); +AddTestCase( "THISTEST.setPubBoolean(false), THISTEST.iGetPubBoolean()", false, (THISTEST.setPubBoolean(false), THISTEST.iGetPubBoolean()) ); +AddTestCase( "THISTEST.setPubBoolean(true), THISTEST.iGetPubBoolean()", true, (THISTEST.setPubBoolean(true), THISTEST.iGetPubBoolean()) ); + +// ******************************************* +// define default method from interface 2 as a +// public method in the sub class +// ******************************************* + +//This should throw an error message + +//AddTestCase( "*** default() method implemented interface 2 ***", 1, 1 ); +AddTestCase( "THISTEST.setNumber(420), THISTEST.iGetNumber()", 20,(THISTEST.iGetNumberacc1()) ); +AddTestCase( "THISTEST.setNumber(420), THISTEST.iGetNumber()", 20,(THISTEST.iGetNumberacc2()) ); +// ******************************************* +// define public method from interface 2 as a +// public method in the sub class +// ******************************************* + +AddTestCase( "*** public method implemented interface 2 ***", 1, 1 ); +AddTestCase( "THISTEST.setPubNumber(14), THISTEST.iGetPubNumber()", 14, (THISTEST.setPubNumber(14), THISTEST.iGetPubNumber()) ); + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDefaultImplDefDefPub/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDefaultImplDefDefPub/DefaultClass.as new file mode 100644 index 00000000000..68d3d9dd4c3 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDefaultImplDefDefPub/DefaultClass.as @@ -0,0 +1,251 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DefaultClass { + + class DefaultClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + + internal var finArray:Array; + internal var finBoolean:Boolean; + internal var finDate:Date; + internal var finFunction:Function; + internal var finMath:Math; + internal var finNumber:Number; + internal var finObject:Object; + internal var finString:String; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { + number = n; + } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + } + + public class DefaultClass extends DefaultClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDefaultImplDefDefPub/DefaultInt.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDefaultImplDefDefPub/DefaultInt.as new file mode 100644 index 00000000000..f355baaed50 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDefaultImplDefDefPub/DefaultInt.as @@ -0,0 +1,40 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DefaultClass { + + interface DefaultInt { + + function iGetNumber():Number + function iGetBoolean():Boolean + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDefaultImplDefDefPub/DefaultIntDef.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDefaultImplDefDefPub/DefaultIntDef.as new file mode 100644 index 00000000000..7396fed24a1 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDefaultImplDefDefPub/DefaultIntDef.as @@ -0,0 +1,41 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DefaultClass { + + interface DefaultIntDef { + + function iGetBoolean() : Boolean + function iGetNumber():Number; + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDefaultImplDefDefPub/DynExtDefaultImplDefDefPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDefaultImplDefDefPub/DynExtDefaultImplDefDefPub.as new file mode 100644 index 00000000000..c830297918a --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDefaultImplDefDefPub/DynExtDefaultImplDefDefPub.as @@ -0,0 +1,126 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DefaultClass { + +import DefaultClass.*; + +dynamic class DynExtDefImplDefDefPubInner extends DefaultClass implements DefaultIntDef, DefaultInt { + + // **************************************** + // define a default definition from + // default interface as a default method + // **************************************** + + public function iGetBoolean() : Boolean { return false; } + //function iGetBoolean() : Boolean { return true; } + + // **************************************** + // define a public defintion from + // default interface as a default method + // **************************************** + + public function iGetPubBoolean() : Boolean { return this.pubBoolean; } + + // **************************************** + // define a default definition from + // default interface 2 as a default method + // **************************************** + + public function iGetNumber() : Number { return 20; } + //function iGetNumber() : Number { return 420; } + // **************************************** + // define a public defintion from + // default interface 2 as a default method + // **************************************** + + public function iGetPubNumber() : Number { return this.pubNumber; } + + // ************************************ + // access public method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return this.getPubArray(); } + function subSetArray(a:Array) { this.setPubArray(a); } + + public function testGetSubArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + + // ************************************ + // access public method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return this.getPubArray(); } + public function pubSubSetArray(a:Array) { this.setPubArray(a); } + + // ************************************ + // access public method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return this.getPubArray(); } + private function privSubSetArray(a:Array) { this.setPubArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + + + } +public class DynExtDefaultImplDefDefPub extends DynExtDefImplDefDefPubInner { + var THISTEST1 = new DynExtDefImplDefDefPubInner(); +var i:DefaultInt = THISTEST1; +var j:DefaultIntDef=THISTEST1; + public function iGetBooleanacc1(){ + return i.iGetBoolean(); + } + public function iGetBooleanacc2(){ + return j.iGetBoolean(); + } + public function iGetNumberacc1(){ + return THISTEST1.DefaultInt::iGetNumber(); + } + public function iGetNumberacc2(){ + return THISTEST1.DefaultIntDef::iGetNumber(); + } + + + +} +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDefaultImplDefPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDefaultImplDefPub.as new file mode 100644 index 00000000000..7cb52dc6403 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDefaultImplDefPub.as @@ -0,0 +1,54 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "Clean AS2"; // Version of JavaScript or ECMA +var TITLE = "Extend Default Class Implement Default interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +import DefaultClass.*; + +var THISTEST = new DynExtDefaultImplDefPub(); + + +// ******************************************* +// define public method from interface as a +// public method in the sub class +// ******************************************* + +AddTestCase( "*** public method implemented interface ***", 1, 1 ); +AddTestCase( "THISTEST.setPubBoolean(false), THISTEST.iGetPubBoolean()", false, (THISTEST.setPubBoolean(false), THISTEST.iGetPubBoolean()) ); +AddTestCase( "THISTEST.setPubBoolean(true), THISTEST.iGetPubBoolean()", true, (THISTEST.setPubBoolean(true), THISTEST.iGetPubBoolean()) ); + + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDefaultImplDefPub/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDefaultImplDefPub/DefaultClass.as new file mode 100644 index 00000000000..68d3d9dd4c3 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDefaultImplDefPub/DefaultClass.as @@ -0,0 +1,251 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DefaultClass { + + class DefaultClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + + internal var finArray:Array; + internal var finBoolean:Boolean; + internal var finDate:Date; + internal var finFunction:Function; + internal var finMath:Math; + internal var finNumber:Number; + internal var finObject:Object; + internal var finString:String; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { + number = n; + } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + } + + public class DefaultClass extends DefaultClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDefaultImplDefPub/DefaultIntDef.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDefaultImplDefPub/DefaultIntDef.as new file mode 100644 index 00000000000..f80398a4f9f --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDefaultImplDefPub/DefaultIntDef.as @@ -0,0 +1,41 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DefaultClass { + + interface DefaultIntDef { + + function iGetBoolean() : Boolean + + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDefaultImplDefPub/DynExtDefaultImplDefPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDefaultImplDefPub/DynExtDefaultImplDefPub.as new file mode 100644 index 00000000000..679d0857080 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDefaultImplDefPub/DynExtDefaultImplDefPub.as @@ -0,0 +1,94 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DefaultClass { + +import DefaultClass.*; + +dynamic class DynExtDefImplDefPubInner extends DefaultClass implements DefaultIntDef { + + // **************************************** + // define a default definition from + // default interface as a public method + // **************************************** + + public function iGetBoolean() : Boolean { return this.boolean; } + + public function testIGetBoolean() : Boolean { return iGetBoolean(); } + + // **************************************** + // define a public defintion from + // default interface as a default method + // **************************************** + + public function iGetPubBoolean() : Boolean { return this.pubBoolean; } + + // ************************************ + // access public method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return this.getPubArray(); } + function subSetArray(a:Array) { this.setPubArray(a); } + + public function testGetSubArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + + // ************************************ + // access public method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return this.getPubArray(); } + public function pubSubSetArray(a:Array) { this.setPubArray(a); } + + // ************************************ + // access public method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return this.getPubArray(); } + private function privSubSetArray(a:Array) { this.setPubArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + + + + } +public class DynExtDefaultImplDefPub extends DynExtDefImplDefPubInner {} +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDefaultImplDefPubStat.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDefaultImplDefPubStat.as new file mode 100644 index 00000000000..96eb35e2ced --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDefaultImplDefPubStat.as @@ -0,0 +1,145 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "Clean AS2"; // Version of JavaScript or ECMA +var TITLE = "Extend Default Class Implement Default Interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +import DefaultClass.*; + +arr = new Array(1, 2, 3); + +THISTEST = new DynExtDefaultImplDefPubStat(); +// ******************************************* +// define public method from interface as a +// public method in the sub class +// ******************************************* + +AddTestCase( "*** public method implemented interface ***", 1, 1 ); +AddTestCase( "THISTEST.setPubBoolean(false), THISTEST.iGetPubBoolean()", false, (THISTEST.setPubBoolean(false), THISTEST.iGetPubBoolean()) ); +AddTestCase( "THISTEST.setPubBoolean(true), THISTEST.iGetPubBoolean()", true, (THISTEST.setPubBoolean(true), THISTEST.iGetPubBoolean()) ); + + + +// ******************************************** +// access public static method from a public static +// method of a sub class +// +// ******************************************** + +AddTestCase( "*** Access public static method from public static method of sub class ***", 1, 1 ); +AddTestCase( "DynExtDefaultImplDefPubStat.pubStatSubSetArray(arr), DynExtDefaultImplDefPubStat.pubStatSubGetArray()", arr, + (DynExtDefaultImplDefPubStat.pubStatSubSetArray(arr), DynExtDefaultImplDefPubStat.pubStatSubGetArray()) ); + +// ******************************************** +// access public static method from a private static +// method of a sub class +// +// ******************************************** + +var EXTDEFAULTCLASS = new DynExtDefaultImplDefPubStat(); +AddTestCase( "*** Access public static method from private static method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testPrivStatSubArray(arr)", arr, + EXTDCLASS.testPrivStatSubArray(arr) ); + + +// ******************************************** +// access public static property from +// default method in sub class +// ******************************************** + +EXTDCLASS = new DynExtDefaultImplDefPubStat(); +AddTestCase( "*** Access public static property from default method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testPubStatDefSubArray(arr)", arr, (EXTDCLASS.testPubStatDefSubArray(arr)) ); + + +// ******************************************** +// access public static property from +// public method in sub class +// ******************************************** + +EXTDCLASS = new DynExtDefaultImplDefPubStat(); +AddTestCase( "*** Access public static property from public method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.pubSubSetDPArray(arr), EXTDCLASS.pubSubGetDPArray()", arr, (EXTDCLASS.pubSubSetDPArray(arr), EXTDCLASS.pubSubGetDPArray()) ); +// ******************************************** +// access public static property from +// private method in sub class +// ******************************************** + +EXTDCLASS = new DynExtDefaultImplDefPubStat(); +AddTestCase( "*** Access public static property from private method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testPrivStatSubDPArray(arr)", arr, (EXTDCLASS.testPrivStatSubDPArray(arr)) ); + + +// ******************************************** +// access public static property from +// final method in sub class +// ******************************************** + +EXTDCLASS = new DynExtDefaultImplDefPubStat(); +AddTestCase( "*** Access public static property from final method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testPrivStatFinSubDPArray(arr)", arr, (EXTDCLASS.testPrivStatFinSubDPArray(arr)) ); + +// ******************************************** +// access public static property from +// static method in sub class +// ******************************************** + +AddTestCase( "*** Access public static property from static method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testStatSubDPArray(arr)", arr, + (EXTDCLASS.testStatSubDPArray(arr)) ); +/* +// ******************************************** +// access public static property from +// public static method in sub class +// ******************************************** + +AddTestCase( "*** Access public static property from public static method in sub class ***", 1, 1 ); +AddTestCase( "PubExtDefaultClassPubStat.pubStatSubSetSPArray(arr), PubExtDefaultClassPubStat.pubStatSubGetSPArray()", arr, + (PubExtDefaultClassPubStat.pubStatSubSetSPArray(arr), PubExtDefaultClassPubStat.pubStatSubGetSPArray()) ); + +// ******************************************** +// access public static property from +// private static method in sub class +// ******************************************** + +EXTDCLASS = new DynExtDefaultImplDefPubStat(); +AddTestCase( "*** Access public static property from private static method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testPrivStatSubPArray(arr)", arr, + EXTDCLASS.testPrivStatSubPArray(arr)); +*/ + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDefaultImplDefPubStat/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDefaultImplDefPubStat/DefaultClass.as new file mode 100644 index 00000000000..68d3d9dd4c3 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDefaultImplDefPubStat/DefaultClass.as @@ -0,0 +1,251 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DefaultClass { + + class DefaultClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + + internal var finArray:Array; + internal var finBoolean:Boolean; + internal var finDate:Date; + internal var finFunction:Function; + internal var finMath:Math; + internal var finNumber:Number; + internal var finObject:Object; + internal var finString:String; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { + number = n; + } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + } + + public class DefaultClass extends DefaultClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDefaultImplDefPubStat/DefaultIntDef.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDefaultImplDefPubStat/DefaultIntDef.as new file mode 100644 index 00000000000..55d36a7ffc8 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDefaultImplDefPubStat/DefaultIntDef.as @@ -0,0 +1,40 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DefaultClass { + + interface DefaultIntDef { + + function iGetBoolean() : Boolean + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDefaultImplDefPubStat/DynExtDefaultImplDefPubStat.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDefaultImplDefPubStat/DynExtDefaultImplDefPubStat.as new file mode 100644 index 00000000000..24c2441f3cd --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDefaultImplDefPubStat/DynExtDefaultImplDefPubStat.as @@ -0,0 +1,246 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DefaultClass { + +import DefaultClass.*; + +dynamic class DynExtDefImplDefPubStatInner extends DefaultClass implements DefaultIntDef { + + + // **************************************** + // define a default definition from + // default interface as a default method + // **************************************** + + public function iGetBoolean() : Boolean { return boolean; } + + // **************************************** + // define a public defintion from + // default interface as a default method + // **************************************** + + public function iGetPubBoolean() : Boolean { return pubBoolean; } + + + + // ************************************ + // access public static method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return getPubStatArray(); } + function subSetArray(a:Array) { setPubStatArray(a); } + + // function to test above from test scripts + public function testDefSubArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + + // ************************************ + // access public static method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return getPubStatArray(); } + public function pubSubSetArray(a:Array) { setPubStatArray(a); } + + // ************************************ + // access public static method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return getPubStatArray(); } + private function privSubSetArray(a:Array) { setPubStatArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + // ************************************ + // access public static method of parent + // from final method of sub class + // ************************************ + + final function finSubGetArray() : Array { return getPubStatArray(); } + final function finSubSetArray(a:Array) { setPubStatArray(a); } + + // function to test above from test scripts + public function testFinSubArray(a:Array) : Array { + this.finSubSetArray(a); + return this.finSubGetArray(); + } + + // *************************************** + // access public static method of parent + // from static method of sub class + // *************************************** + + static function statSubGetArray() : Array { return getPubStatArray(); } + static function statSubSetArray(a:Array) { setPubStatArray(a); } + + // function to test above from test scripts + public function testStatSubArray(a:Array) : Array { + this.statSubSetArray(a); + return this.statSubGetArray(); + } + + // *************************************** + // access public static method of parent + // from public static method of sub class + // *************************************** + + public static function pubStatSubGetArray() : Array { return getPubStatArray(); } + public static function pubStatSubSetArray(a:Array) { setPubStatArray(a); } + + // *************************************** + // access public static method of parent + // from private static method of sub class + // *************************************** + + private static function privStatSubGetArray() : Array { return getPubStatArray(); } + private static function privStatSubSetArray(a:Array) { setPubStatArray(a); } + + // public accessor to test asrt + public function testPrivStatSubArray(a:Array) : Array { + privStatSubSetArray(a); + return privStatSubGetArray(); + } + + // *************************************** + // access public static property from + // default method of sub class + // *************************************** + + function subGetDPArray() : Array { return pubStatArray; } + function subSetDPArray(a:Array) { pubStatArray = a; } + + // public accessor to test asrt + public function testPubStatDefSubArray(a:Array) : Array { + subSetDPArray(a); + return subGetDPArray(); + } + + // *************************************** + // access public static property from + // public method of sub class + // *************************************** + + public function pubSubGetDPArray() : Array { return pubStatArray; } + public function pubSubSetDPArray(a:Array) { pubStatArray = a; } + + // *************************************** + // access public static property from + // private method of sub class + // *************************************** + + private function privSubGetDPArray() : Array { return pubStatArray; } + private function privSubSetDPArray(a:Array) { pubStatArray = a; } + // public accessor to test asrt + public function testPrivStatSubDPArray(a:Array) : Array { + privSubSetDPArray(a); + return privSubGetDPArray(); + } + + + // *************************************** + // access public static property from + // final method of sub class + // *************************************** + + final function finSubGetDPArray() : Array { return pubStatArray; } + final function finSubSetDPArray(a:Array) { pubStatArray = a; } + // public accessor to test asrt + public function testPrivStatFinSubDPArray(a:Array) : Array { + finSubSetDPArray(a); + return finSubGetDPArray(); + } + + // *************************************** + // access public static property from + // static method of sub class + // *************************************** + + static function statSubGetSPArray() : Array { return pubStatArray; } + static function statSubSetSPArray(a:Array) { pubStatArray = a; } + // public accessor to test asrt + public function testStatSubDPArray(a:Array) : Array { + statSubSetSPArray(a); + return statSubGetSPArray(); + } + + // *************************************** + // access public static property from + // public static method of sub class + // *************************************** + + public static function pubStatSubGetSPArray() : Array { return pubStatArray; } + public static function pubStatSubSetSPArray(a:Array) { pubStatArray = a; } + + // *************************************** + // access public static property from + // private static method of sub class + // *************************************** + + private static function privStatSubGetSPArray() : Array { return pubStatArray; } + private static function privStatSubSetSPArray(a:Array) { pubStatArray = a; } + + // public accessor for asrt + public function testPrivStatSubPArray(a:Array) : Array { + privStatSubSetSPArray( a ); + return privStatSubGetSPArray(); + } + + } + public class DynExtDefaultImplDefPubStat extends DynExtDefImplDefPubStatInner{ + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { DefaultClassInner.setPubStatArray(a); } + public static function setPubStatBoolean( b:Boolean ) { DefaultClassInner.setPubStatBoolean(b); } + + public static function getPubStatArray() { return DefaultClassInner.getPubStatArray(); } + + // *************************************** + // access public static method of parent + // from public static method of sub class + // *************************************** + + public static function pubStatSubGetArray() : Array { return DynExtDefImplDefPubStatInner.pubStatSubGetArray(); } + public static function pubStatSubSetArray(a:Array) { DynExtDefImplDefPubStatInner.pubStatSubSetArray(a); } + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDynamicImplDefDef.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDynamicImplDefDef.as new file mode 100644 index 00000000000..98d4af8d66a --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDynamicImplDefDef.as @@ -0,0 +1,165 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "Clean AS2"; // Version of JavaScript or ECMA +var TITLE = "Extend DynamicClass Implement 2 Default Interfaces"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +import DynamicClass.*; + +var THISTEST = new DynExtDynamicImplDefDef(); + + +// ******************************************* +// define default method from interface as a +// default method in the sub class + +// ******************************************* +/*AddTestCase( "THISTEST.setBoolean(false), THISTEST.iGetBoolean()", true, (THISTEST.iGetBooleanacc1()) ); +AddTestCase( "THISTEST.setBoolean(true), THISTEST.iGetBoolean()", false, (THISTEST.iGetBooleanacc2()) );*/ + + +AddTestCase( "*** default() method implemented interface ***", 1, 1 ); +AddTestCase( "THISTEST.testGetSetBoolean(false)", false, THISTEST.testGetSetBoolean(false) ); +AddTestCase( "THISTEST.testGetSetBoolean(true)", true, THISTEST.testGetSetBoolean(true) ); + +// ******************************************* +// define public method from interface as a +// default method in the sub class +// ******************************************* + +//Should give an error + +AddTestCase( "*** public method implemented interface ***", 1, 1 ); +AddTestCase( "THISTEST.testPubGetSetBoolean(false)", false, THISTEST.testPubGetSetBoolean(false) ); +AddTestCase( "THISTEST.testPubGetSetBoolean(true)", true, THISTEST.testPubGetSetBoolean(true) ); + +// ******************************************* +// define default method from interface 2 as a +// default method in the sub class +// ******************************************* +/*AddTestCase( "THISTEST.setNumber(420), THISTEST.iGetNumber()", 20,(THISTEST.iGetNumberacc1()) ); +AddTestCase( "THISTEST.setNumber(420), THISTEST.iGetNumber()", 420,(THISTEST.iGetNumberacc2()) );*/ +AddTestCase( "*** default() method implemented interface 2 ***", 1, 1 ); +AddTestCase( "THISTEST.testGetSetNumber(420)", 420, THISTEST.testGetSetNumber(420) ); + +// ******************************************* +// define public method from interface 2 as a +// default method in the sub class +// ******************************************* + +//Should give an error + +AddTestCase( "*** public method implemented interface 2 ***", 1, 1 ); +AddTestCase( "THISTEST.testPubGetSetNumber(14)", 14, THISTEST.testPubGetSetNumber(14) ); + + + +// ******************************************** +// access default method from a default +// method of a sub class +// +// ******************************************** + +var arr = new Array(1, 2, 3); + +EXTDCLASS = new DynExtDynamicImplDefDef(); +AddTestCase( "*** Access default method from default method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testGetSubArray(arr)", arr, EXTDCLASS.testGetSubArray(arr) ); + +// fill in the rest of the cases here + + +// ******************************************** +// access default method from a public +// method of a sub class +// +// ******************************************** + +EXTDCLASS = new DynExtDynamicImplDefDef(); +AddTestCase( "*** Access default method from public method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.pubSubSetArray(arr), EXTDCLASS.pubSubGetArray()", arr, (EXTDCLASS.pubSubSetArray(arr), EXTDCLASS.pubSubGetArray()) ); + +// fill in the rest of the cases here + +// ******************************************** +// access default method from a private +// method of a sub class +// +// ******************************************** + +EXTDCLASS = new DynExtDynamicImplDefDef(); +AddTestCase( "*** Access default method from private method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testPrivSubArray(arr)", arr, EXTDCLASS.testPrivSubArray(arr) ); + +// fill in the rest of the cases here + + +// ******************************************** +// access default property from +// default method in sub class +// ******************************************** + +EXTDCLASS = new DynExtDynamicImplDefDef(); +AddTestCase( "*** Access default property from method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testSubGetDPArray(arr)", arr, EXTDCLASS.testSubGetDPArray(arr) ); + +// fill in the rest of the cases here + +// ******************************************** +// access default property from +// public method in sub class +// ******************************************** + +EXTDCLASS = new DynExtDynamicImplDefDef(); +AddTestCase( "*** Access default property from public method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.pubSubSetDPArray(arr), EXTDCLASS.pubSubGetDPArray()", arr, (EXTDCLASS.pubSubSetDPArray(arr), EXTDCLASS.pubSubGetDPArray()) ); + +// fill in the rest of the cases here + +// ******************************************** +// access default property from +// private method in sub class +// ******************************************** + +EXTDCLASS = new DynExtDynamicImplDefDef(); +AddTestCase( "*** Access default property from private method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testPrivSubGetDPArray(arr)", arr, EXTDCLASS.testPrivSubGetDPArray(arr) ); + +// fill in the rest of the cases here + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDynamicImplDefDef/ADynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDynamicImplDefDef/ADynamicClass.as new file mode 100644 index 00000000000..58ed6f47bac --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDynamicImplDefDef/ADynamicClass.as @@ -0,0 +1,230 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DynamicClass { + + + dynamic class DynamicClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + + internal var finArray:Array; + internal var finBoolean:Boolean; + internal var finDate:Date; + internal var finFunction:Function; + internal var finMath:Math; + internal var finNumber:Number; + internal var finObject:Object; + internal var finString:String; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + + // **************** + // constructor + // **************** + + function DynamicClass() { + } + + // ***************** + // default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + } + public class DynamicClass extends DynamicClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDynamicImplDefDef/DefaultInt.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDynamicImplDefDef/DefaultInt.as new file mode 100644 index 00000000000..12af70146e7 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDynamicImplDefDef/DefaultInt.as @@ -0,0 +1,40 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DynamicClass { + + interface DefaultInt { + + function iGetNumber():Number + // function iGetBoolean():Boolean + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDynamicImplDefDef/DefaultIntDef.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDynamicImplDefDef/DefaultIntDef.as new file mode 100644 index 00000000000..a40d8dbb2af --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDynamicImplDefDef/DefaultIntDef.as @@ -0,0 +1,41 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DynamicClass { + + interface DefaultIntDef { + + function iGetBoolean() : Boolean + //function iGetNumber():Number; + //function iGetNumber1():Number; + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDynamicImplDefDef/DynExtDynamicImplDefDef.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDynamicImplDefDef/DynExtDynamicImplDefDef.as new file mode 100644 index 00000000000..df59c4b2462 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDynamicImplDefDef/DynExtDynamicImplDefDef.as @@ -0,0 +1,169 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DynamicClass { + +import DynamicClass.*; + +dynamic class DynExtDynImplDefDefInner extends DynamicClass implements DefaultIntDef, DefaultInt { + + // **************************************** + // define a default definition from + // default interface as a default method + // **************************************** + + public function iGetBoolean() : Boolean { return this.boolean; } + + public function testGetSetBoolean( flag:Boolean ) : Boolean { + + setBoolean(flag); + return iGetBoolean(); + } + + + // **************************************** + // define a public defintion from + // default interface as a default method + // **************************************** + + public function iGetPubBoolean() : Boolean { return this.pubBoolean; } + + public function testPubGetSetBoolean( flag:Boolean ) : Boolean { + + setPubBoolean(flag); + return iGetPubBoolean(); + } + + + // **************************************** + // define a default defintion from + // default interface 2 as a default method + // **************************************** + + public function iGetNumber() : Number { return this.number; } + + public function testGetSetNumber( num:Number ) : Number { + + setNumber(num); + return iGetNumber(); + } + + + // **************************************** + // define a public definition from + // default interface 2 as a default method + // **************************************** + + public function iGetPubNumber() : Number { return this.pubNumber; } + + public function testPubGetSetNumber( num:Number ) : Number { + + setPubNumber(num); + return iGetPubNumber(); + } + + + // ************************************ + // access default method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return this.getArray(); } + function subSetArray(a:Array) { this.setArray(a); } + + public function testGetSubArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + + // ************************************ + // access default method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return this.getArray(); } + public function pubSubSetArray(a:Array) { this.setArray(a); } + + // ************************************ + // access default method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return this.getArray(); } + private function privSubSetArray(a:Array) { this.setArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + // *************************************** + // access default property from + // default method of sub class + // *************************************** + + function subGetDPArray() : Array { return array; } + function subSetDPArray(a:Array) { array = a; } + + public function testSubGetDPArray(a:Array) : Array { + this.subSetDPArray(a); + return this.subGetDPArray(); + } + + + // *************************************** + // access default property from + // public method of sub class + // *************************************** + + public function pubSubGetDPArray() : Array { return this.array; } + public function pubSubSetDPArray(a:Array) { this.array = a; } + + // *************************************** + // access default property from + // private method of sub class + // *************************************** + + private function privSubGetDPArray() : Array { return this.array; } + private function privSubSetDPArray(a:Array) { this.array = a; } + + public function testPrivSubGetDPArray(a:Array) : Array { + this.privSubSetDPArray(a); + return this.privSubGetDPArray(); + } + } + +public class DynExtDynamicImplDefDef extends DynExtDynImplDefDefInner {} + + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDynamicImplDefDefPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDynamicImplDefDefPub.as new file mode 100644 index 00000000000..f0c5fd32b0a --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDynamicImplDefDefPub.as @@ -0,0 +1,81 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "Clean AS2"; // Version of JavaScript or ECMA +var TITLE = "Extend Dynamic Class Implement Default interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +import DynamicClass.*; + +var THISTEST = new DynExtDynamicImplDefDefPub(); + +// ******************************************* +// define default method from interface as a +// public method in the sub class +// ******************************************* + +// Should give an error + +AddTestCase( "*** default() method implemented interface ***", 1, 1 ); +AddTestCase( "THISTEST.testGetBoolean(false)", false, THISTEST.testGetBoolean(false) ); +AddTestCase( "THISTEST.testGetBoolean(true)", true, THISTEST.testGetBoolean(true) ); + +// ******************************************* +// define public method from interface as a +// public method in the sub class +// ******************************************* + +AddTestCase( "*** public method implemented interface ***", 1, 1 ); +AddTestCase( "THISTEST.testGetPubBoolean(false)", false, THISTEST.testGetPubBoolean(false) ); +AddTestCase( "THISTEST.testGetPubBoolean(true)", true, THISTEST.testGetPubBoolean(true) ); + +// ******************************************* +// define default method from interface 2 as a +// public method in the sub class +// ******************************************* + +//Should give an error + +AddTestCase( "*** default() method implemented interface 2 ***", 1, 1 ); +AddTestCase( "THISTEST.testGetSetNumber(420)", 420, THISTEST.testGetSetNumber(420) ); + +// ******************************************* +// define public method from interface 2 as a +// public method in the sub class +// ******************************************* + +AddTestCase( "*** public method implemented interface 2 ***", 1, 1 ); +AddTestCase( "THISTEST.setPubNumber(14), THISTEST.iGetPubNumber()", 14, (THISTEST.setPubNumber(14), THISTEST.iGetPubNumber()) ); + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDynamicImplDefDefPub/ADynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDynamicImplDefDefPub/ADynamicClass.as new file mode 100644 index 00000000000..58ed6f47bac --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDynamicImplDefDefPub/ADynamicClass.as @@ -0,0 +1,230 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DynamicClass { + + + dynamic class DynamicClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + + internal var finArray:Array; + internal var finBoolean:Boolean; + internal var finDate:Date; + internal var finFunction:Function; + internal var finMath:Math; + internal var finNumber:Number; + internal var finObject:Object; + internal var finString:String; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + + // **************** + // constructor + // **************** + + function DynamicClass() { + } + + // ***************** + // default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + } + public class DynamicClass extends DynamicClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDynamicImplDefDefPub/DefaultInt.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDynamicImplDefDefPub/DefaultInt.as new file mode 100644 index 00000000000..1258f841a7a --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDynamicImplDefDefPub/DefaultInt.as @@ -0,0 +1,40 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DynamicClass { + + interface DefaultInt { + + function iGetNumber():Number + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDynamicImplDefDefPub/DefaultIntDef.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDynamicImplDefDefPub/DefaultIntDef.as new file mode 100644 index 00000000000..82833f997d8 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDynamicImplDefDefPub/DefaultIntDef.as @@ -0,0 +1,41 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DynamicClass { + + interface DefaultIntDef { + + function iGetBoolean() : Boolean + + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDynamicImplDefDefPub/DynExtDynamicImplDefDefPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDynamicImplDefDefPub/DynExtDynamicImplDefDefPub.as new file mode 100644 index 00000000000..dfcd21c91ef --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDynamicImplDefDefPub/DynExtDynamicImplDefDefPub.as @@ -0,0 +1,127 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DynamicClass { + +import DynamicClass.*; + +dynamic class DynExtDynImplDefDefPubInner extends DynamicClass implements DefaultIntDef, DefaultInt { + + // **************************************** + // define a default definition from + // default interface as a default method + // **************************************** + + public function iGetBoolean() : Boolean { return this.boolean; } + + public function testGetBoolean(flag:Boolean):Boolean { + + setBoolean(flag); + return iGetBoolean(); + } + + + // **************************************** + // define a public defintion from + // default interface as a default method + // **************************************** + + public function iGetPubBoolean() : Boolean { return this.pubBoolean; } + + public function testGetPubBoolean(flag:Boolean):Boolean { + + setPubBoolean(flag); + return iGetPubBoolean(); + } + + + // **************************************** + // define a default definition from + // default interface 2 as a public method + // **************************************** + + public function iGetNumber() : Number { return this.number; } + + public function testGetSetNumber( num:Number ) : Number { + + setNumber(num); + return iGetNumber(); + } + + + // **************************************** + // define a public defintion from + // default interface 2 as a default method + // **************************************** + + public function iGetPubNumber() : Number { return this.pubNumber; } + + // ************************************ + // access public method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return this.getPubArray(); } + function subSetArray(a:Array) { this.setPubArray(a); } + + public function testGetSubArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + + // ************************************ + // access public method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return this.getPubArray(); } + public function pubSubSetArray(a:Array) { this.setPubArray(a); } + + // ************************************ + // access public method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return this.getPubArray(); } + private function privSubSetArray(a:Array) { this.setPubArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + + } + +public class DynExtDynamicImplDefDefPub extends DynExtDynImplDefDefPubInner {} +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDynamicImplDefPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDynamicImplDefPub.as new file mode 100644 index 00000000000..2294f29285f --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDynamicImplDefPub.as @@ -0,0 +1,63 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "Clean AS2"; // Version of JavaScript or ECMA +var TITLE = "Extend Default Class Implement Default interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +import DynamicClass.*; + +var THISTEST = new DynExtDynamicImplDefPub(); + +// ******************************************* +// define default method from interface as a +// public method in the sub class +// ******************************************* + +//Should give an error + +AddTestCase( "*** default() method implemented interface ***", 1, 1 ); +AddTestCase( "THISTEST.testGetSetBoolean(false)", false, THISTEST.testGetSetBoolean(false) ); +AddTestCase( "THISTEST.testGetSetBoolean(true)", true, THISTEST.testGetSetBoolean(true) ); + +// ******************************************* +// define public method from interface as a +// public method in the sub class +// ******************************************* + +AddTestCase( "*** public method implemented interface ***", 1, 1 ); +AddTestCase( "THISTEST.testPubGetSetBoolean(false)", false, THISTEST.testPubGetSetBoolean(false) ); +AddTestCase( "THISTEST.testPubGetSetBoolean(true)", true, THISTEST.testPubGetSetBoolean(true) ); + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDynamicImplDefPub/ADynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDynamicImplDefPub/ADynamicClass.as new file mode 100644 index 00000000000..58ed6f47bac --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDynamicImplDefPub/ADynamicClass.as @@ -0,0 +1,230 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DynamicClass { + + + dynamic class DynamicClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + + internal var finArray:Array; + internal var finBoolean:Boolean; + internal var finDate:Date; + internal var finFunction:Function; + internal var finMath:Math; + internal var finNumber:Number; + internal var finObject:Object; + internal var finString:String; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + + // **************** + // constructor + // **************** + + function DynamicClass() { + } + + // ***************** + // default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + } + public class DynamicClass extends DynamicClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDynamicImplDefPub/DefaultIntDef.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDynamicImplDefPub/DefaultIntDef.as new file mode 100644 index 00000000000..82833f997d8 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDynamicImplDefPub/DefaultIntDef.as @@ -0,0 +1,41 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DynamicClass { + + interface DefaultIntDef { + + function iGetBoolean() : Boolean + + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDynamicImplDefPub/DynExtDynamicImplDefPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDynamicImplDefPub/DynExtDynamicImplDefPub.as new file mode 100644 index 00000000000..11582b0b64e --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynExtDynamicImplDefPub/DynExtDynamicImplDefPub.as @@ -0,0 +1,107 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DynamicClass { + +import DynamicClass.*; + +dynamic class DynExtDynImplDefPubInner extends DynamicClass implements DefaultIntDef { + + // **************************************** + // define a default definition from + // default interface as a default method + // **************************************** + + public function iGetBoolean() : Boolean { return this.boolean; } + + public function testGetSetBoolean( flag:Boolean ) : Boolean { + + setBoolean(flag); + return iGetBoolean(); + } + + + // **************************************** + // define a public defintion from + // default interface as a default method + // **************************************** + + public function iGetPubBoolean() : Boolean { return this.pubBoolean; } + + public function testPubGetSetBoolean( flag:Boolean ) : Boolean { + + setPubBoolean(flag); + return iGetPubBoolean(); + } + + + // ************************************ + // access public method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return this.getPubArray(); } + function subSetArray(a:Array) { this.setPubArray(a); } + + public function testGetSubArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + + // ************************************ + // access public method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return this.getPubArray(); } + public function pubSubSetArray(a:Array) { this.setPubArray(a); } + + // ************************************ + // access public method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return this.getPubArray(); } + private function privSubSetArray(a:Array) { this.setPubArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + + + } + +public class DynExtDynamicImplDefPub extends DynExtDynImplDefPubInner {} +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynFinPubClassExtDynIntClassImpIntIntExtPubPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynFinPubClassExtDynIntClassImpIntIntExtPubPub.as new file mode 100644 index 00000000000..d9c6515a235 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynFinPubClassExtDynIntClassImpIntIntExtPubPub.as @@ -0,0 +1,102 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import DynFinPubClassExtDynIntClassImpIntIntExtPubPub.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Public class implements public interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new PublicSubClass(); +var obj2 = new InternalInterfaceAccessor(); +//use namespace ns; +var PubInt:PublicInt=obj; + +var PubInt2:PublicInt2=obj; +//print(PubInt3.MyString()); +//print(obj.MyNegInteger()); +//var PubInt3:PublicInt3=obj; +var dateObj:Date = new Date(0); +/*print(PubInt.MyString()); +print(PubInt5.MyString()); +print(PubInt2.MyNegInteger()); +print(PubInt6.MyNegInteger()); +print(PubInt3.MyString()); +print(PubInt7.MyString()); +print(PubInt3.MyNegInteger()); +print(PubInt7.MyNegInteger()); +print(PubInt3.MyUnsignedInteger()); +print(PubInt7.MyUnsignedInteger()); +print(obj.MyString()); +print(obj2.MyString()); +//print(obj.MyNegInteger()); +//print(obj2.MyNegInteger()); +print(obj.MyUnsignedInteger()); +print(obj2.MyUnsignedInteger()); +print(obj.PublicInt2::MyString()); +print(obj2.PublicInt2::MyString()); +print(PubInt3.MyNegativeInteger()); +print(PubInt7.MyNegativeInteger()); +print(obj.PublicInt3::MyNegativeInteger()); +print(obj2.PublicInt3::MyNegativeInteger());*/ +//print(obj.MySuperBoolean()); +//Public Class extends Public class implements a public interface which extends two //interfaces + +thisError="no error" +try{ + obj2.MyNegInteger(); + }catch(e2){ + thisError=e2.toString(); + }finally{ + AddTestCase("Calling a method in interface namespace through an instance of a class should throw an error","ReferenceError: Error #1069", referenceError(thisError)); + } +AddTestCase("Calling a method in public namespace in the public interface implemented by the subclass through the subclass","Hi!", PubInt.MyString()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",-100, obj2.RetMyNegInteger2()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",-100, obj2.RetMyNegInteger()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",100, obj2.RetMyUnsignedInteger()); +AddTestCase("Calling a method in public namespace in the public interface implemented by the subclass through the subclass","Hi!", obj.MyString()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",100, obj.MyUnsignedInteger()); +AddTestCase("Calling a method in public namespace in the public interface implemented by the subclass through the subclass","Hi!", obj.PublicInt2::MyString()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",-100000, obj.MyNegativeInteger()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",-100000, obj2.RetMyNegativeInteger()); +AddTestCase("Calling a public method in superclass extended by the subclass through the subclass",true, obj.RetMySuperBoolean()); +AddTestCase("Calling an internal method in superclass extended by the subclass through the subclass",10, obj.RetMySuperNumber()); +AddTestCase("Calling a public static method in superclass extended bythe subclass through the subclass",dateObj.toString(), obj.RetMySuperStaticDate()+""); + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynFinPubClassExtDynIntClassImpIntIntExtPubPub/PublicSubClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynFinPubClassExtDynIntClassImpIntIntExtPubPub/PublicSubClass.as new file mode 100644 index 00000000000..da8e8e80055 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynFinPubClassExtDynIntClassImpIntIntExtPubPub/PublicSubClass.as @@ -0,0 +1,93 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DynFinPubClassExtDynIntClassImpIntIntExtPubPub{ + public interface PublicInt{ + function MyString():String; + } + public interface PublicInt2{ + function MyString():String; + function MyNegInteger():int; + } + internal interface PublicInt3 extends PublicInt,PublicInt2{ + function MyUnsignedInteger():uint; + function MyNegativeInteger():int; + } + dynamic internal class InternalSuperClass{ + public function MySuperBoolean():Boolean{return true;} + internal function MySuperNumber():Number{return 10;} + public static function MySuperStaticDate():Date {return new Date(0);} + + + } + + dynamic final public class PublicSubClass extends InternalSuperClass implements PublicInt3{ + + public function MyString():String{ + return "Hi!"; + } + + public function MyNegInteger():int{ + var a:int = -100; + return a; + } + public function MyUnsignedInteger():uint{ + var postint:uint =100; + return postint; + } + public function MyNegativeInteger():int{ + var negint:int = -100000; + return negint; + } + public function RetMySuperNumber():Number{return MySuperNumber();} + public function RetMySuperBoolean():Boolean{return MySuperBoolean();} + public function RetMySuperStaticDate():Date{return MySuperStaticDate();} + } + + public class InternalInterfaceAccessor{ + var k = new PublicSubClass(); + + var PubInt3:PublicInt3 = k; + var PubInttwo:PublicInt2=k; + public function RetMyNegInteger():int{ + return PubInt3.MyNegInteger(); + } + public function RetMyNegInteger2():int{ + return PubInttwo.MyNegInteger(); + } + public function RetMyUnsignedInteger():uint{ + return PubInt3.MyUnsignedInteger(); + } + public function RetMyNegativeInteger():int{ + return k.PublicInt3::MyNegativeInteger()} + } + } + + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynFinPubClassExtIntClassImpIntIntExtPubPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynFinPubClassExtIntClassImpIntIntExtPubPub.as new file mode 100644 index 00000000000..cbd2b305dc5 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynFinPubClassExtIntClassImpIntIntExtPubPub.as @@ -0,0 +1,101 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import DynFinPubClassExtIntClassImpIntIntExtPubPub.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Public class implements public interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new PublicSubClass(); +var obj2 = new InternalInterfaceAccessor(); +//use namespace ns; +var PubInt:PublicInt=obj; + +var PubInt2:PublicInt2=obj; + +//var PubInt3:PublicInt3=obj; +var dateObj:Date = new Date(0); +/*print(PubInt.MyString()); +print(PubInt5.MyString()); +print(PubInt2.MyNegInteger()); +print(PubInt6.MyNegInteger()); +//print(PubInt3.MyString()); +//print(PubInt7.MyString()); +print(PubInt3.MyNegInteger()); +print(PubInt7.MyNegInteger()); +print(PubInt3.MyUnsignedInteger()); +print(PubInt7.MyUnsignedInteger()); +print(obj.MyString()); +print(obj2.MyString()); +//print(obj.MyNegInteger()); +//print(obj2.MyNegInteger()); +print(obj.MyUnsignedInteger()); +print(obj2.MyUnsignedInteger()); +print(obj.PublicInt2::MyString()); +print(obj2.PublicInt2::MyString()); +print(PubInt3.MyNegativeInteger()); +print(PubInt7.MyNegativeInteger()); +print(obj.PublicInt3::MyNegativeInteger()); +print(obj2.PublicInt3::MyNegativeInteger());*/ +//print(obj.MySuperBoolean()); +//Public Class extends Public class implements a public interface which extends two //interfaces + +thisError="no error" +try{ + obj2.MyNegInteger(); + }catch(e2){ + thisError=e2.toString(); + }finally{ + AddTestCase("Calling a method in interface namespace through an instance of a class should throw an error","ReferenceError: Error #1069", referenceError(thisError)); + } +AddTestCase("Calling a method in public namespace in the public interface implemented by the subclass through the subclass","Hi!", PubInt.MyString()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",-100, obj2.RetMyNegInteger2()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",-100, obj2.RetMyNegInteger()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",100, obj2.RetMyUnsignedInteger()); +AddTestCase("Calling a method in public namespace in the public interface implemented by the subclass through the subclass","Hi!", obj.MyString()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",100, obj.MyUnsignedInteger()); +AddTestCase("Calling a method in public namespace in the public interface implemented by the subclass through the subclass","Hi!", obj.PublicInt2::MyString()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",-100000, obj.MyNegativeInteger()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",-100000, obj2.RetMyNegativeInteger()); +AddTestCase("Calling a public method in superclass extended by the subclass through the subclass",true, obj.RetMySuperBoolean()); +AddTestCase("Calling an internal method in superclass extended by the subclass through the subclass",10, obj.RetMySuperNumber()); +AddTestCase("Calling a public static method in superclass extended bythe subclass through the subclass",dateObj.toString(), obj.RetMySuperStaticDate()+""); + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynFinPubClassExtIntClassImpIntIntExtPubPub/PublicSubClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynFinPubClassExtIntClassImpIntIntExtPubPub/PublicSubClass.as new file mode 100644 index 00000000000..d13ae96c5df --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/DynFinPubClassExtIntClassImpIntIntExtPubPub/PublicSubClass.as @@ -0,0 +1,93 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DynFinPubClassExtIntClassImpIntIntExtPubPub{ + public interface PublicInt{ + function MyString():String; + } + public interface PublicInt2{ + function MyString():String; + function MyNegInteger():int; + } + internal interface PublicInt3 extends PublicInt,PublicInt2{ + function MyUnsignedInteger():uint; + function MyNegativeInteger():int; + } + internal class InternalSuperClass{ + public function MySuperBoolean():Boolean{return true;} + internal function MySuperNumber():Number{return 10;} + public static function MySuperStaticDate():Date {return new Date(0);} + + + } + + dynamic final public class PublicSubClass extends InternalSuperClass implements PublicInt3{ + + public function MyString():String{ + return "Hi!"; + } + + public function MyNegInteger():int{ + var a:int = -100; + return a; + } + public function MyUnsignedInteger():uint{ + var postint:uint =100; + return postint; + } + public function MyNegativeInteger():int{ + var negint:int = -100000; + return negint; + } + public function RetMySuperNumber():Number{return MySuperNumber();} + public function RetMySuperBoolean():Boolean{return MySuperBoolean();} + public function RetMySuperStaticDate():Date{return MySuperStaticDate();} + } + + public class InternalInterfaceAccessor{ + var k = new PublicSubClass(); + + var PubInt3:PublicInt3 = k; + var PubInttwo:PublicInt2=k; + public function RetMyNegInteger():int{ + return PubInt3.MyNegInteger(); + } + public function RetMyNegInteger2():int{ + return PubInttwo.MyNegInteger(); + } + public function RetMyUnsignedInteger():uint{ + return PubInt3.MyUnsignedInteger(); + } + public function RetMyNegativeInteger():int{ + return k.PublicInt3::MyNegativeInteger()} + } + } + + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefImplDefDefPrivStatErr1.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefImplDefDefPrivStatErr1.as new file mode 100644 index 00000000000..a8c9c5323ce --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefImplDefDefPrivStatErr1.as @@ -0,0 +1,57 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +class DefaultClass { + private static function baseClass() { + } +} + +var SECTION = "RTE"; +var VERSION = "AS3"; +var TITLE = "accessing private static method outside of the class"; +var BUGNUMBER = ""; + +startTest(); + +var out = new DefaultClass(); +var error = "no error thrown"; + +try { + out.baseClass(); +} catch (e) { + error = e.toString(); +} + +AddTestCase("accessing private static method outside of the class, RTE #1069", + "ReferenceError: Error #1069", + error); + +test(); diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefImplDefDefPubStatErr1.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefImplDefDefPubStatErr1.as new file mode 100644 index 00000000000..cdc44f5ffd3 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefImplDefDefPubStatErr1.as @@ -0,0 +1,61 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +class DefaultClass { + public static function baseClass() { + // print("base is invoked"); + } +} + +var SECTION = "RTE"; +var VERSION = "AS3"; +var TITLE = "accessing public static method outside of the class"; +var BUGNUMBER = ""; + +startTest(); + +var out = new DefaultClass(); + +var error = "no error thrown"; + +try { + out.baseClass(); +} catch (e) { + error = e.toString(); +} + +AddTestCase("accessing public static method outside of the class, RTE #1069", + "ReferenceError: Error #1069", + error); + // print( "FAILED, should give run time error : accessing public static method outside of the class" ); + +test(); + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefaultImplDefDef.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefaultImplDefDef.as new file mode 100644 index 00000000000..fa623af2561 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefaultImplDefDef.as @@ -0,0 +1,79 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "Clean AS2"; // Version of JavaScript or ECMA +var TITLE = "Extend Default Class Implement 2 Default Interfaces"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +import DefaultClass.*; + +var THISTEST = new ExtDefaultImplDefDef(); + + +// ******************************************* +// define default method from interface as a +// default method in the sub class +// ******************************************* + +AddTestCase( "*** default() method implemented interface ***", 1, 1 ); +AddTestCase( "THISTEST.testGetSetBoolean(false)", false, THISTEST.testGetSetBoolean(false) ); +AddTestCase( "THISTEST.testGetSetBoolean(true)", true, THISTEST.testGetSetBoolean(true) ); + +// ******************************************* +// define public method from interface as a +// public method in the sub class +// ******************************************* + +AddTestCase( "*** public method implemented interface ***", 1, 1 ); +AddTestCase( "THISTEST.setPubBoolean(false), THISTEST.iGetPubBoolean()", false, (THISTEST.setPubBoolean(false), THISTEST.iGetPubBoolean()) ); +AddTestCase( "THISTEST.setPubBoolean(true), THISTEST.iGetPubBoolean()", true, (THISTEST.setPubBoolean(true), THISTEST.iGetPubBoolean()) ); + +// ******************************************* +// define default method from interface 2 as a +// default method in the sub class +// ******************************************* + +AddTestCase( "*** default() method implemented interface 2 ***", 1, 1 ); +AddTestCase( "THISTEST.testGetSetNumber(420)", 420, THISTEST.testGetSetNumber(420) ); + +// ******************************************* +// define public method from interface 2 as a +// public method in the sub class +// ******************************************* + +AddTestCase( "*** public method implemented interface 2 ***", 1, 1 ); +AddTestCase( "THISTEST.setPubNumber(14), THISTEST.iGetPubNumber()", 14, (THISTEST.setPubNumber(14), THISTEST.iGetPubNumber()) ); +AddTestCase( "THISTEST.setPubNumber(14), THISTEST.iGetPubNumber()", 14, (THISTEST.setPubNumber(14), THISTEST.iiGetNumber1()) ); +AddTestCase( "THISTEST.setPubNumber(14), THISTEST.iGetPubNumber()", 14, (THISTEST.setPubNumber(14), THISTEST.jiGetNumber1()) ); diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefaultImplDefDef/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefaultImplDefDef/DefaultClass.as new file mode 100644 index 00000000000..68d3d9dd4c3 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefaultImplDefDef/DefaultClass.as @@ -0,0 +1,251 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DefaultClass { + + class DefaultClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + + internal var finArray:Array; + internal var finBoolean:Boolean; + internal var finDate:Date; + internal var finFunction:Function; + internal var finMath:Math; + internal var finNumber:Number; + internal var finObject:Object; + internal var finString:String; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { + number = n; + } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + } + + public class DefaultClass extends DefaultClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefaultImplDefDef/DefaultInt.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefaultImplDefDef/DefaultInt.as new file mode 100644 index 00000000000..d0925bd3395 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefaultImplDefDef/DefaultInt.as @@ -0,0 +1,39 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DefaultClass { + + interface DefaultInt { + + function iGetNumber():Number + function iGetNumber1():Number; + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefaultImplDefDef/DefaultIntDef.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefaultImplDefDef/DefaultIntDef.as new file mode 100644 index 00000000000..205b5e33324 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefaultImplDefDef/DefaultIntDef.as @@ -0,0 +1,41 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DefaultClass { + + interface DefaultIntDef { + + function iGetBoolean() : Boolean + function iGetNumber1() : Number; + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefaultImplDefDef/ExtDefaultImplDefDef.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefaultImplDefDef/ExtDefaultImplDefDef.as new file mode 100644 index 00000000000..42cd0547f97 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefaultImplDefDef/ExtDefaultImplDefDef.as @@ -0,0 +1,163 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DefaultClass { + +import DefaultClass.*; + +class ExtDefImplDefDefInner extends DefaultClass implements DefaultIntDef, DefaultInt { + + // **************************************** + // define a default definition from + // default interface as a default method + // **************************************** + + public function iGetBoolean() : Boolean { return boolean; } + public function iGetNumber1() : Number { return 14; } + public function testGetSetBoolean( flag:Boolean ) : Boolean { + + setBoolean(flag); + return iGetBoolean(); + } + + + // **************************************** + // define a public defintion from + // default interface as a public method + // **************************************** + + public function iGetPubBoolean() : Boolean { return pubBoolean; } + + + // **************************************** + // define a default defintion from + // default interface 2 as a default method + // **************************************** + + public function iGetNumber() : Number { return number; } + public function testGetSetNumber( num:Number ) : Number { + + setNumber(num); + return iGetNumber(); + } + + + // **************************************** + // define a public definition from + // default interface 2 as a public method + // **************************************** + + public function iGetPubNumber() : Number { return pubNumber; } + + + // ************************************ + // access default method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return this.getArray(); } + function subSetArray(a:Array) { this.setArray(a); } + + public function testGetSubArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + + // ************************************ + // access default method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return this.getArray(); } + public function pubSubSetArray(a:Array) { this.setArray(a); } + + // ************************************ + // access default method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return this.getArray(); } + private function privSubSetArray(a:Array) { this.setArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + // *************************************** + // access default property from + // default method of sub class + // *************************************** + + function subGetDPArray() : Array { return array; } + function subSetDPArray(a:Array) { array = a; } + + public function testSubGetDPArray(a:Array) : Array { + this.subSetDPArray(a); + return this.subGetDPArray(); + } + + + // *************************************** + // access default property from + // public method of sub class + // *************************************** + + public function pubSubGetDPArray() : Array { return this.array; } + public function pubSubSetDPArray(a:Array) { this.array = a; } + + // *************************************** + // access default property from + // private method of sub class + // *************************************** + + private function privSubGetDPArray() : Array { return this.array; } + private function privSubSetDPArray(a:Array) { this.array = a; } + + public function testPrivSubGetDPArray(a:Array) : Array { + this.privSubSetDPArray(a); + return this.privSubGetDPArray(); + } + + } +public class ExtDefaultImplDefDef extends ExtDefImplDefDefInner { +var s = new ExtDefImplDefDefInner(); +var i:DefaultIntDef=s; +var j:DefaultInt=s; + +public function iiGetNumber1():Number{return i.iGetNumber1();} +public function jiGetNumber1():Number{return s.DefaultInt::iGetNumber1();} + + +} +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefaultImplDefDefPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefaultImplDefDefPub.as new file mode 100644 index 00000000000..7b5c85759d9 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefaultImplDefDefPub.as @@ -0,0 +1,61 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "Clean AS2"; // Version of JavaScript or ECMA +var TITLE = "Extend Default Class Implement Default interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +import DefaultClass.*; + +var THISTEST = new ExtDefaultImplDefDefPub(); + +// ******************************************* +// define public method from interface as a +// public method in the sub class +// ******************************************* + +AddTestCase( "*** public method implemented interface ***", 1, 1 ); +AddTestCase( "THISTEST.setPubBoolean(false), THISTEST.iGetPubBoolean()", false, (THISTEST.setPubBoolean(false), THISTEST.iGetPubBoolean()) ); +AddTestCase( "THISTEST.setPubBoolean(true), THISTEST.iGetPubBoolean()", true, (THISTEST.setPubBoolean(true), THISTEST.iGetPubBoolean()) ); + + +// ******************************************* +// define public method from interface 2 as a +// public method in the sub class +// ******************************************* + +AddTestCase( "*** public method implemented interface 2 ***", 1, 1 ); +AddTestCase( "THISTEST.setPubNumber(14), THISTEST.iGetPubNumber()", 14, (THISTEST.setPubNumber(14), THISTEST.iGetPubNumber()) ); + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefaultImplDefDefPub/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefaultImplDefDefPub/DefaultClass.as new file mode 100644 index 00000000000..68d3d9dd4c3 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefaultImplDefDefPub/DefaultClass.as @@ -0,0 +1,251 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DefaultClass { + + class DefaultClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + + internal var finArray:Array; + internal var finBoolean:Boolean; + internal var finDate:Date; + internal var finFunction:Function; + internal var finMath:Math; + internal var finNumber:Number; + internal var finObject:Object; + internal var finString:String; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { + number = n; + } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + } + + public class DefaultClass extends DefaultClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefaultImplDefDefPub/DefaultInt.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefaultImplDefDefPub/DefaultInt.as new file mode 100644 index 00000000000..be9f1422b63 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefaultImplDefDefPub/DefaultInt.as @@ -0,0 +1,41 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DefaultClass { + + interface DefaultInt { + + function iGetNumber():Number + + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefaultImplDefDefPub/DefaultIntDef.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefaultImplDefDefPub/DefaultIntDef.as new file mode 100644 index 00000000000..4992615f69a --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefaultImplDefDefPub/DefaultIntDef.as @@ -0,0 +1,41 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DefaultClass { + + interface DefaultIntDef { + + function iGetBoolean() : Boolean + // public function iGetPubBoolean() : Boolean + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefaultImplDefDefPub/ExtDefaultImplDefDefPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefaultImplDefDefPub/ExtDefaultImplDefDefPub.as new file mode 100644 index 00000000000..f227dbf0758 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefaultImplDefDefPub/ExtDefaultImplDefDefPub.as @@ -0,0 +1,105 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DefaultClass { + +import DefaultClass.*; + +class ExtDefImplDefDefPubInner extends DefaultClass implements DefaultIntDef, DefaultInt { + + // **************************************** + // define a default definition from + // default interface as a default method + // **************************************** + + public function iGetBoolean() : Boolean { return boolean; } + + // **************************************** + // define a public defintion from + // default interface as a default method + // **************************************** + + public function iGetPubBoolean() : Boolean { return pubBoolean; } + + // **************************************** + // define a default definition from + // default interface 2 as a default method + // **************************************** + + public function iGetNumber() : Number { return number; } + + // **************************************** + // define a public defintion from + // default interface 2 as a default method + // **************************************** + + public function iGetPubNumber() : Number { return pubNumber; } + + // ************************************ + // access public method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return this.getPubArray(); } + function subSetArray(a:Array) { this.setPubArray(a); } + + public function testGetSubArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + + // ************************************ + // access public method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return this.getPubArray(); } + public function pubSubSetArray(a:Array) { this.setPubArray(a); } + + // ************************************ + // access public method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return this.getPubArray(); } + private function privSubSetArray(a:Array) { this.setPubArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + + } +public class ExtDefaultImplDefDefPub extends ExtDefImplDefDefPubInner {} +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefaultImplDefPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefaultImplDefPub.as new file mode 100644 index 00000000000..8b73caac779 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefaultImplDefPub.as @@ -0,0 +1,54 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "Clean AS2"; // Version of JavaScript or ECMA +var TITLE = "Extend Default Class Implement Default interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +import DefaultClass.*; + +var THISTEST = new ExtDefaultImplDefPub(); + + +// ******************************************* +// define public method from interface as a +// public method in the sub class +// ******************************************* + +AddTestCase( "*** public method implemented interface ***", 1, 1 ); +AddTestCase( "THISTEST.setPubBoolean(false), THISTEST.iGetPubBoolean()", false, (THISTEST.setPubBoolean(false), THISTEST.iGetPubBoolean()) ); +AddTestCase( "THISTEST.setPubBoolean(true), THISTEST.iGetPubBoolean()", true, (THISTEST.setPubBoolean(true), THISTEST.iGetPubBoolean()) ); + + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefaultImplDefPub/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefaultImplDefPub/DefaultClass.as new file mode 100644 index 00000000000..a8dc2359d17 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefaultImplDefPub/DefaultClass.as @@ -0,0 +1,152 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DefaultClass { + + class DefaultClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + + internal var finArray:Array; + internal var finBoolean:Boolean; + internal var finDate:Date; + internal var finFunction:Function; + internal var finMath:Math; + internal var finNumber:Number; + internal var finObject:Object; + internal var finString:String; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + } + + public class DefaultClass extends DefaultClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefaultImplDefPub/DefaultIntDef.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefaultImplDefPub/DefaultIntDef.as new file mode 100644 index 00000000000..162fa403744 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefaultImplDefPub/DefaultIntDef.as @@ -0,0 +1,40 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DefaultClass { + + interface DefaultIntDef { + + function iGetBoolean() : Boolean + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefaultImplDefPub/ExtDefaultImplDefPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefaultImplDefPub/ExtDefaultImplDefPub.as new file mode 100644 index 00000000000..883aff439ac --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDefaultImplDefPub/ExtDefaultImplDefPub.as @@ -0,0 +1,93 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DefaultClass { + +import DefaultClass.*; + +class ExtDefImplDefPubInner extends DefaultClass implements DefaultIntDef { + + // **************************************** + // define a default definition from + // default interface as a public method + // **************************************** + + public function iGetBoolean():Boolean { return boolean; } + + public function testIGetBoolean():Boolean { return this.iGetBoolean(); } + + // **************************************** + // define a public defintion from + // default interface as a default method + // **************************************** + + public function iGetPubBoolean() : Boolean { return this.pubBoolean; } + + // ************************************ + // access public method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return this.getPubArray(); } + function subSetArray(a:Array) { this.setPubArray(a); } + + public function testGetSubArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + + // ************************************ + // access public method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return this.getPubArray(); } + public function pubSubSetArray(a:Array) { this.setPubArray(a); } + + // ************************************ + // access public method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return this.getPubArray(); } + private function privSubSetArray(a:Array) { this.setPubArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + + + } +public class ExtDefaultImplDefPub extends ExtDefImplDefPubInner {} +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDynamicImplDefDefPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDynamicImplDefDefPub.as new file mode 100644 index 00000000000..eea2158fe46 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDynamicImplDefDefPub.as @@ -0,0 +1,79 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "Clean AS2"; // Version of JavaScript or ECMA +var TITLE = "Extend Dynamic Class Implement Default interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +import DynamicClass.*; + +var THISTEST = new ExtDynamicImplDefDefPub(); + +// ******************************************* +// define default method from interface as a +// public method in the sub class +// ******************************************* + + +AddTestCase( "*** default() method implemented interface ***", 1, 1 ); +AddTestCase( "THISTEST.testGetBoolean(false)", false, THISTEST.testGetBoolean(false) ); +AddTestCase( "THISTEST.testGetBoolean(true)", true, THISTEST.testGetBoolean(true) ); + +// ******************************************* +// define public method from interface as a +// public method in the sub class +// ******************************************* + +AddTestCase( "*** public method implemented interface ***", 1, 1 ); +AddTestCase( "THISTEST.testGetPubBoolean(false)", false, THISTEST.testGetPubBoolean(false) ); +AddTestCase( "THISTEST.testGetPubBoolean(true)", true, THISTEST.testGetPubBoolean(true) ); + +// ******************************************* +// define default method from interface 2 as a +// public method in the sub class +// ******************************************* + + +AddTestCase( "*** default() method implemented interface 2 ***", 1, 1 ); +AddTestCase( "THISTEST.testGetSetNumber(420)", 420, THISTEST.testGetSetNumber(420) ); + +// ******************************************* +// define public method from interface 2 as a +// public method in the sub class +// ******************************************* + +AddTestCase( "*** public method implemented interface 2 ***", 1, 1 ); +AddTestCase( "THISTEST.setPubNumber(14), THISTEST.iGetPubNumber()", 14, (THISTEST.setPubNumber(14), THISTEST.iGetPubNumber()) ); + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDynamicImplDefDefPub/DefaultInt.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDynamicImplDefDefPub/DefaultInt.as new file mode 100644 index 00000000000..627fd4b182b --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDynamicImplDefDefPub/DefaultInt.as @@ -0,0 +1,41 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DynamicClass { + + interface DefaultInt { + + function iGetNumber():Number +// public function iGetPubNumber(): Number + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDynamicImplDefDefPub/DefaultIntDef.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDynamicImplDefDefPub/DefaultIntDef.as new file mode 100644 index 00000000000..fcde2c29dea --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDynamicImplDefDefPub/DefaultIntDef.as @@ -0,0 +1,41 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DynamicClass { + + interface DefaultIntDef { + + function iGetBoolean() : Boolean + + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDynamicImplDefDefPub/DynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDynamicImplDefDefPub/DynamicClass.as new file mode 100644 index 00000000000..58ed6f47bac --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDynamicImplDefDefPub/DynamicClass.as @@ -0,0 +1,230 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DynamicClass { + + + dynamic class DynamicClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + + internal var finArray:Array; + internal var finBoolean:Boolean; + internal var finDate:Date; + internal var finFunction:Function; + internal var finMath:Math; + internal var finNumber:Number; + internal var finObject:Object; + internal var finString:String; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + + // **************** + // constructor + // **************** + + function DynamicClass() { + } + + // ***************** + // default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + } + public class DynamicClass extends DynamicClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDynamicImplDefDefPub/ExtDynamicImplDefDefPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDynamicImplDefDefPub/ExtDynamicImplDefDefPub.as new file mode 100644 index 00000000000..b296c645571 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDynamicImplDefDefPub/ExtDynamicImplDefDefPub.as @@ -0,0 +1,127 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DynamicClass { + +import DynamicClass.*; + +class ExtDynImplDefDefPubInner extends DynamicClass implements DefaultIntDef, DefaultInt { + + // **************************************** + // define a default definition from + // default interface as a default method + // **************************************** + + public function iGetBoolean() : Boolean { return boolean; } + + public function testGetBoolean(flag:Boolean):Boolean { + + setBoolean(flag); + return iGetBoolean(); + } + + + // **************************************** + // define a public defintion from + // default interface as a default method + // **************************************** + + public function iGetPubBoolean() : Boolean { return pubBoolean; } + + public function testGetPubBoolean(flag:Boolean):Boolean { + + setPubBoolean(flag); + return iGetPubBoolean(); + } + + + // **************************************** + // define a default definition from + // default interface 2 as a public method + // **************************************** + + public function iGetNumber() : Number { return number; } + + public function testGetSetNumber( num:Number ) : Number { + + setNumber(num); + return iGetNumber(); + } + + + // **************************************** + // define a public defintion from + // default interface 2 as a default method + // **************************************** + + public function iGetPubNumber() : Number { return pubNumber; } + + // ************************************ + // access public method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return this.getPubArray(); } + function subSetArray(a:Array) { this.setPubArray(a); } + + public function testGetSubArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + + // ************************************ + // access public method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return this.getPubArray(); } + public function pubSubSetArray(a:Array) { this.setPubArray(a); } + + // ************************************ + // access public method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return this.getPubArray(); } + private function privSubSetArray(a:Array) { this.setPubArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + + } + +public class ExtDynamicImplDefDefPub extends ExtDynImplDefDefPubInner {} +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDynamicImplDefDefStat.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDynamicImplDefDefStat.as new file mode 100644 index 00000000000..4e7f956a6a1 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDynamicImplDefDefStat.as @@ -0,0 +1,222 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "Clean AS2"; // Version of JavaScript or ECMA +var TITLE = "Extend Dynamic Class Implement 2 Default Interfaces"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +import DynamicClass.*; + +arr = new Array(1, 2, 3); + +THISTEST = new ExtDynamicImplDefDefStat(); + +// ******************************************* +// define default method from interface as a +// public method in the sub class +// ******************************************* + + +AddTestCase( "*** default() method implemented interface ***", 1, 1 ); +AddTestCase( "THISTEST.testGetBoolean(false)", false, THISTEST.testGetBoolean(false) ); +AddTestCase( "THISTEST.testGetBoolean(true)", true, THISTEST.testGetBoolean(true) ); + +// ******************************************* +// define public method from interface as a +// public method in the sub class +// ******************************************* + +AddTestCase( "*** public method implemented interface ***", 1, 1 ); +AddTestCase( "THISTEST.testGetPubBoolean(false)", false, THISTEST.testGetPubBoolean(false) ); +AddTestCase( "THISTEST.testGetPubBoolean(true)", true, THISTEST.testGetPubBoolean(true) ); + +// ******************************************* +// define default method from interface 2 as a +// public method in the sub class +// ******************************************* + + +AddTestCase( "*** default() method implemented interface 2 ***", 1, 1 ); +AddTestCase( "THISTEST.testGetSetNumber(420)", 420, THISTEST.testGetSetNumber(420) ); + +// ******************************************* +// define public method from interface 2 as a +// public method in the sub class +// ******************************************* + +AddTestCase( "*** public method implemented interface 2 ***", 1, 1 ); +AddTestCase( "THISTEST.setPubNumber(14), THISTEST.iGetPubNumber()", 14, (THISTEST.setPubNumber(14), THISTEST.iGetPubNumber()) ); + +// ******************************************** +// access static method from a default +// method of a sub class +// +// ******************************************** + +EXTDCLASS = new ExtDynamicImplDefDefStat(); +AddTestCase( "*** Access static method from default method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testSubSetArray(arr)", arr, EXTDCLASS.testSubSetArray(arr) ); + +// fill in the rest of the cases here + + +// ******************************************** +// access static method from a public +// method of a sub class +// +// ******************************************** + +EXTDCLASS = new ExtDynamicImplDefDefStat(); +AddTestCase( "*** Access static method from public method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.pubSubSetArray(arr), EXTDCLASS.pubSubGetArray()", arr, (EXTDCLASS.pubSubSetArray(arr), EXTDCLASS.pubSubGetArray()) ); + +// fill in the rest of the cases here + +// ******************************************** +// access static method from a private +// method of a sub class +// +// ******************************************** + +EXTDCLASS = new ExtDynamicImplDefDefStat(); +AddTestCase( "*** Access static method from private method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testPrivSubArray(arr)", arr, EXTDCLASS.testPrivSubArray(arr) ); + +// fill in the rest of the cases here + +// ******************************************** +// access static method from a static +// method of a sub class +// +// ******************************************** + +EXTDCLASS = new ExtDynamicImplDefDefStat(); +AddTestCase( "*** Access static method from static method of sub class ***", 1, 1 ); +AddTestCase( "ExtDynamicClassStat.testStatSubSetArray(arr)", arr, EXTDCLASS.testStatSubSetArray(arr) ); + +// fill in the rest of the cases here + +// ******************************************** +// access static method from a public static +// method of a sub class +// +// ******************************************** + +EXTDCLASS = new ExtDynamicImplDefDefStat(); +AddTestCase( "*** Access static method from public static method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.pubStatSubSetArray(arr), EXTDCLASS.pubStatSubGetArray()", arr, + EXTDCLASS.testPubStatSubGetSetArray(arr) ); + +// fill in the rest of the cases here + +// ******************************************** +// access static method from a private static +// method of a sub class +// +// ******************************************** + +var EXTDEFAULTCLASS = new ExtDynamicImplDefDefStat(); +AddTestCase( "*** Access static method from private static method of sub class ***", 1, 1 ); +AddTestCase( "EXTDEFAULTCLASS.testPrivStatSubArray(arr)", arr, EXTDEFAULTCLASS.testPrivStatSubArray(arr) ); + +// fill in the rest of the cases here + +// ******************************************** +// access static property from +// default method in sub class +// ******************************************** + +EXTDCLASS = new ExtDynamicImplDefDefStat(); +AddTestCase( "*** Access static property from default method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testSubSetDPArray(arr)", arr, EXTDCLASS.testSubSetDPArray(arr) ); + +// fill in the rest of the cases here + + +// ******************************************** +// access static property from +// public method in sub class +// ******************************************** + +EXTDCLASS = new ExtDynamicImplDefDefStat(); +AddTestCase( "*** Access static property from public method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.pubSubSetDPArray(arr), EXTDCLASS.pubSubGetDPArray()", arr, (EXTDCLASS.pubSubSetDPArray(arr), EXTDCLASS.pubSubGetDPArray()) ); + +// fill in the rest of the cases here + +// ******************************************** +// access static property from +// private method in sub class +// ******************************************** + +EXTDCLASS = new ExtDynamicImplDefDefStat(); +AddTestCase( "*** Access static property from private method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testPrivSubSetDPArray(arr)", arr, EXTDCLASS.testPrivSubSetDPArray(arr) ); + +// fill in the rest of the cases here + +// ******************************************** +// access static property from +// static method in sub class +// ******************************************** + +EXTDCLASS = new ExtDynamicImplDefDefStat(); +AddTestCase( "*** Access static property from static method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testStatSubSetDPArray(arr)", arr, EXTDCLASS.testStatSubSetDPArray(arr) ); + +// ******************************************** +// access static property from +// public static method in sub class +// ******************************************** + +EXTDCLASS = new ExtDynamicImplDefDefStat(); +AddTestCase( "*** Access static property from public static method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.pubStatSubSetSPArray(arr), EXTDCLASS.pubStatSubGetSPArray()", arr, + EXTDCLASS.testPubStatSubGetSetSPArray(arr) ); + +// ******************************************** +// access static property from +// private static method in sub class +// ******************************************** + +EXTDCLASS = new ExtDynamicImplDefDefStat(); +AddTestCase( "*** Access static property from private static method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testPrivStatSubPArray(arr)", arr, EXTDCLASS.testPrivStatSubPArray(arr)); + +// fill in the rest of the cases here + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDynamicImplDefDefStat/DefaultInt.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDynamicImplDefDefStat/DefaultInt.as new file mode 100644 index 00000000000..1258f841a7a --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDynamicImplDefDefStat/DefaultInt.as @@ -0,0 +1,40 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DynamicClass { + + interface DefaultInt { + + function iGetNumber():Number + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDynamicImplDefDefStat/DefaultIntDef.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDynamicImplDefDefStat/DefaultIntDef.as new file mode 100644 index 00000000000..fcde2c29dea --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDynamicImplDefDefStat/DefaultIntDef.as @@ -0,0 +1,41 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DynamicClass { + + interface DefaultIntDef { + + function iGetBoolean() : Boolean + + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDynamicImplDefDefStat/DynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDynamicImplDefDefStat/DynamicClass.as new file mode 100644 index 00000000000..6dee1fbd55b --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDynamicImplDefDefStat/DynamicClass.as @@ -0,0 +1,243 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DynamicClass { + + + dynamic class DynamicClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + // public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // **************** + // constructor + // **************** + + function DynamicClass() { + } + + // ***************** + // default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + } + public class DynamicClass extends DynamicClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDynamicImplDefDefStat/ExtDynamicImplDefDefStat.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDynamicImplDefDefStat/ExtDynamicImplDefDefStat.as new file mode 100644 index 00000000000..25bee27d8b0 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDynamicImplDefDefStat/ExtDynamicImplDefDefStat.as @@ -0,0 +1,248 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DynamicClass { + +import DynamicClass.*; + +class ExtDynImplDefDefStatInner extends DynamicClass implements DefaultIntDef, DefaultInt { + // **************************************** + // define a default definition from + // default interface as a default method + // **************************************** + + public function iGetBoolean() : Boolean { return boolean; } + + public function testGetBoolean(flag:Boolean):Boolean { + + setBoolean(flag); + return iGetBoolean(); + } + + + // **************************************** + // define a public defintion from + // default interface as a default method + // **************************************** + + public function iGetPubBoolean() : Boolean { return pubBoolean; } + + public function testGetPubBoolean(flag:Boolean):Boolean { + + setPubBoolean(flag); + return iGetPubBoolean(); + } + + + // **************************************** + // define a default definition from + // default interface 2 as a public method + // **************************************** + + public function iGetNumber() : Number { return number; } + + public function testGetSetNumber( num:Number ) : Number { + + setNumber(num); + return iGetNumber(); + } + + + // **************************************** + // define a public defintion from + // default interface 2 as a default method + // **************************************** + + public function iGetPubNumber() : Number { return pubNumber; } + + + + + // ************************************ + // access static method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return getStatArray(); } + function subSetArray(a:Array) { setStatArray(a); } + + public function testSubSetArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + + // ************************************ + // access static method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return getStatArray(); } + public function pubSubSetArray(a:Array) { setStatArray(a); } + + // ************************************ + // access static method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return getStatArray(); } + private function privSubSetArray(a:Array) { setStatArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + // *************************************** + // access static method of parent + // from static method of sub class + // *************************************** + + static function statSubGetArray() : Array { return getStatArray(); } + static function statSubSetArray(a:Array) { setStatArray(a); } + + //public static function testStatSubSetArray(a:Array) : Array { + public function testStatSubSetArray(a:Array) : Array { + statSubSetArray(a); + return statSubGetArray(); + } + + + // *************************************** + // access static method of parent + // from public static method of sub class + // *************************************** + + public static function pubStatSubGetArray() : Array { return getStatArray(); } + public static function pubStatSubSetArray(a:Array) { setStatArray(a); } + + public function testPubStatSubGetSetArray(a:Array):Array { + pubStatSubSetArray(a); + return pubStatSubGetArray(); + } + + // *************************************** + // access static method of parent + // from private static method of sub class + // *************************************** + + private static function privStatSubGetArray() : Array { return getStatArray(); } + private static function privStatSubSetArray(a:Array) { setStatArray(a); } + + // public accessor to test asrt + public function testPrivStatSubArray(a:Array) : Array { + privStatSubSetArray(a); + return privStatSubGetArray(); + } + + // *************************************** + // access static property from + // default method of sub class + // *************************************** + + function subGetDPArray() : Array { return statArray; } + function subSetDPArray(a:Array) { statArray = a; } + + + public function testSubSetDPArray(a:Array) : Array { + this.subSetDPArray(a); + return this.subGetDPArray(); + } + + + // *************************************** + // access static property from + // public method of sub class + // *************************************** + + public function pubSubGetDPArray() : Array { return statArray; } + public function pubSubSetDPArray(a:Array) { statArray = a; } + + // *************************************** + // access static property from + // private method of sub class + // *************************************** + + private function privSubGetDPArray() : Array { return statArray; } + private function privSubSetDPArray(a:Array) { statArray = a; } + + public function testPrivSubSetDPArray(a:Array) : Array { + this.privSubSetDPArray(a); + return this.privSubGetDPArray(); + } + + + // *************************************** + // access static property from + // static method of sub class + // *************************************** + + static function statSubGetSPArray() : Array { return statArray; } + static function statSubSetSPArray(a:Array) { statArray = a; } + + public function testStatSubSetDPArray(a:Array) : Array { + //public static function testStatSubSetDPArray(a:Array) : Array { + statSubSetSPArray(a); + return statSubGetSPArray(); + } + + + // *************************************** + // access static property from + // public static method of sub class + // *************************************** + + public static function pubStatSubGetSPArray() : Array { return statArray; } + public static function pubStatSubSetSPArray(a:Array) { statArray = a; } + + public function testPubStatSubGetSetSPArray(a:Array):Array{ + pubStatSubSetSPArray(a); + return pubStatSubGetSPArray(); + } + + // *************************************** + // access static property from + // private static method of sub class + // *************************************** + + private static function privStatSubGetSPArray() : Array { return statArray; } + private static function privStatSubSetSPArray(a:Array) { statArray = a; } + + // public accessor for asrt + public function testPrivStatSubPArray(a:Array) : Array { + privStatSubSetSPArray( a ); + return privStatSubGetSPArray(); + } + } + +public class ExtDynamicImplDefDefStat extends ExtDynImplDefDefStatInner {} +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDynamicImplDefPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDynamicImplDefPub.as new file mode 100644 index 00000000000..9260ce0df24 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDynamicImplDefPub.as @@ -0,0 +1,61 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "Clean AS2"; // Version of JavaScript or ECMA +var TITLE = "Extend Default Class Implement Default interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +import DynamicClass.*; + +var THISTEST = new ExtDynamicImplDefPub(); + + // ******************************************* +// define default method from interface as a +// default method in the sub class +// ******************************************* + +AddTestCase( "*** default() method implemented interface ***", 1, 1 ); +AddTestCase( "THISTEST.testGetSetBoolean(false)", false, THISTEST.testGetSetBoolean(false) ); +AddTestCase( "THISTEST.testGetSetBoolean(true)", true, THISTEST.testGetSetBoolean(true) ); + +// ******************************************* +// define public method from interface as a +// public method in the sub class +// ******************************************* + +AddTestCase( "*** public method implemented interface ***", 1, 1 ); +AddTestCase( "THISTEST.setPubBoolean(false), THISTEST.iGetPubBoolean()", false, (THISTEST.setPubBoolean(false), THISTEST.iGetPubBoolean()) ); +AddTestCase( "THISTEST.setPubBoolean(true), THISTEST.iGetPubBoolean()", true, (THISTEST.setPubBoolean(true), THISTEST.iGetPubBoolean()) ); + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDynamicImplDefPub/DefaultIntDef.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDynamicImplDefPub/DefaultIntDef.as new file mode 100644 index 00000000000..82833f997d8 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDynamicImplDefPub/DefaultIntDef.as @@ -0,0 +1,41 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DynamicClass { + + interface DefaultIntDef { + + function iGetBoolean() : Boolean + + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDynamicImplDefPub/DynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDynamicImplDefPub/DynamicClass.as new file mode 100644 index 00000000000..58ed6f47bac --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDynamicImplDefPub/DynamicClass.as @@ -0,0 +1,230 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DynamicClass { + + + dynamic class DynamicClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + + internal var finArray:Array; + internal var finBoolean:Boolean; + internal var finDate:Date; + internal var finFunction:Function; + internal var finMath:Math; + internal var finNumber:Number; + internal var finObject:Object; + internal var finString:String; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + + // **************** + // constructor + // **************** + + function DynamicClass() { + } + + // ***************** + // default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + } + public class DynamicClass extends DynamicClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDynamicImplDefPub/ExtDynamicImplDefPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDynamicImplDefPub/ExtDynamicImplDefPub.as new file mode 100644 index 00000000000..c470c3248fb --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/ExtDynamicImplDefPub/ExtDynamicImplDefPub.as @@ -0,0 +1,100 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DynamicClass { + +import DynamicClass.*; + +class ExtDynImplDefPubInner extends DynamicClass implements DefaultIntDef { + + // **************************************** + // define a default definition from + // default interface as a default method + // **************************************** + + public function iGetBoolean() : Boolean { return this.boolean; } + + public function testGetSetBoolean( flag:Boolean ) : Boolean { + + setBoolean(flag); + return iGetBoolean(); + } + + + // **************************************** + // define a public defintion from + // default interface as a public method + // **************************************** + + public function iGetPubBoolean() : Boolean { return this.pubBoolean; } + + + // ************************************ + // access public method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return this.getPubArray(); } + function subSetArray(a:Array) { this.setPubArray(a); } + + public function testGetSubArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + + // ************************************ + // access public method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return this.getPubArray(); } + public function pubSubSetArray(a:Array) { this.setPubArray(a); } + + // ************************************ + // access public method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return this.getPubArray(); } + private function privSubSetArray(a:Array) { this.setPubArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + + } + +public class ExtDynamicImplDefPub extends ExtDynImplDefPubInner {} +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDefaultImplDefDefPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDefaultImplDefDefPub.as new file mode 100644 index 00000000000..3e797d4f9b4 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDefaultImplDefDefPub.as @@ -0,0 +1,51 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "Clean AS2"; // Version of JavaScript or ECMA +var TITLE = "Extend Default Class Implement Default interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +import DefaultClass.*; + +var obj = new accFinExtDefaultImplDefDefPub(); + +AddTestCase( "*** public method implemented interface ***", 1, 1 ); +AddTestCase( "iGetPubBoolean", false, obj.acciGetPubBoolean() ); +AddTestCase( "iGetBoolean", false, obj.acciiGetBoolean() ); +AddTestCase( "iGetBoolean", false, obj.accjiGetBoolean() ); +AddTestCase( "*** public method implemented interface ***", 2, 2 ); +AddTestCase( "iGetPubNumber", 5 , obj.acciGetPubNumber() ); +AddTestCase( "iGetNumber", 5 , obj.acciiGetNumber() ); +AddTestCase( "iGetNumber", 5 , obj.accjiGetNumber() ); diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDefaultImplDefDefPub/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDefaultImplDefDefPub/DefaultClass.as new file mode 100644 index 00000000000..68d3d9dd4c3 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDefaultImplDefDefPub/DefaultClass.as @@ -0,0 +1,251 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DefaultClass { + + class DefaultClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + + internal var finArray:Array; + internal var finBoolean:Boolean; + internal var finDate:Date; + internal var finFunction:Function; + internal var finMath:Math; + internal var finNumber:Number; + internal var finObject:Object; + internal var finString:String; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { + number = n; + } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + } + + public class DefaultClass extends DefaultClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDefaultImplDefDefPub/DefaultInt.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDefaultImplDefDefPub/DefaultInt.as new file mode 100644 index 00000000000..75d3d6287ff --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDefaultImplDefDefPub/DefaultInt.as @@ -0,0 +1,40 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DefaultClass { + + interface DefaultInt { + + function iGetNumber():Number + function iGetBoolean(): Boolean + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDefaultImplDefDefPub/DefaultIntDef.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDefaultImplDefDefPub/DefaultIntDef.as new file mode 100644 index 00000000000..e436ecf69fe --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDefaultImplDefDefPub/DefaultIntDef.as @@ -0,0 +1,40 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DefaultClass { + + interface DefaultIntDef { + + function iGetBoolean() : Boolean + function iGetNumber():Number; + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDefaultImplDefDefPub/FinExtDefaultImplDefDefPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDefaultImplDefDefPub/FinExtDefaultImplDefDefPub.as new file mode 100644 index 00000000000..05a025eaf22 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDefaultImplDefDefPub/FinExtDefaultImplDefDefPub.as @@ -0,0 +1,172 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DefaultClass { + +import DefaultClass.*; + +final class FinExtDefaultImplDefDefPub extends DefaultClass implements DefaultIntDef, DefaultInt { + + // **************************************** + // define a default definition from + // default interface as a default method + // **************************************** + + public function iGetBoolean() : Boolean { return this.boolean; } + + // **************************************** + // define a public defintion from + // default interface as a default method + // **************************************** + + public function iGetPubBoolean(): Boolean {return false;} + + // **************************************** + // define a default definition from + // default interface 2 as a default method + // **************************************** + + public function iGetNumber() : Number { return 5; } + + // **************************************** + // define a public defintion from + // default interface 2 as a default method + // **************************************** + + public function iGetPubNumber() : Number { return 5; } + + // ************************************ + // access public method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return this.getPubArray(); } + function subSetArray(a:Array) { this.setPubArray(a); } + + public function testGetSubArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + + // ************************************ + // access public method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return this.getPubArray(); } + public function pubSubSetArray(a:Array) { this.setPubArray(a); } + + // ************************************ + // access public method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return this.getPubArray(); } + private function privSubSetArray(a:Array) { this.setPubArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + // ************************************ + // access public method of parent + // from final method of sub class + // ************************************ + + final function finSubGetArray() : Array { return this.getPubArray(); } + final function finSubSetArray(a:Array) { this.setPubArray(a); } + + // function to test above from test scripts + public function testFinSubArray(a:Array) : Array { + this.finSubSetArray(a); + return this.finSubGetArray(); + } + } + + // Create an instance of the final class in the package. + // This object will be used for accessing the methods created + // within the sub class given above. + var FINEXTDCLASS = new FinExtDefaultImplDefDefPub(); + + // Create a series of public functions that call the methods. + // The same names can be used as used in the class; because we are now + // outside of the class definition. + + // The default method of the sub class. + public function setPubArray( a:Array ) { return FINEXTDCLASS.setPubArray( a ); } + public function setPubBoolean( a:Boolean ) { return FINEXTDCLASS.setPubBoolean( a ); } + public function setPubDate( a:Date ) { return FINEXTDCLASS.setPubDate( a ); } + public function setPubFunction( a:Function ) { return FINEXTDCLASS.setPubFunction( a ); } + public function setPubNumber( a:Number ) { return FINEXTDCLASS.setPubNumber( a ); } + public function setPubString( a:String ) { return FINEXTDCLASS.setPubString( a ); } + public function setPubObject( a:Object ) { return FINEXTDCLASS.setPubObject( a ); } + + // The dynamic method of the sub class. + public function testGetSetBoolean( a:Array ) { FINEXTDCLASS.testGetSetBoolean( a ); } + public function testPubGetSetBoolean( a:Array ) { FINEXTDCLASS.testPubGetSetBoolean( a ); } + + + // The public method of the sub class. + public function testGetSubArray( a:Array ) { return FINEXTDCLASS.testGetSubArray( a ); } + public function pubSubSetArray( a:Array ) { return FINEXTDCLASS.pubSubSetArray( a ); } + public function pubSubGetArray() { return FINEXTDCLASS.pubSubGetArray( ); } + + // The private method of the sub class. Only one is used as we need to call only the + // test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivSubArray( a:Array ) : Array { return FINEXTDCLASS.testPrivSubArray( a ); } + + // The default property being accessed by the different method attributes. + // The default method attribute. + public function pubSubSetDPArray( a:Array ) { return FINEXTDCLASS.pubSubSetDPArray(a); } + public function testSubGetDPArray(a:Array) : Array { return FINEXTDCLASS.testSubGetDPArray(a); } + + + // the private static method attribute + public function testPrivSubGetDPArray(a:Array) : Array { return FINEXTDCLASS.testPrivSubGetDPArray(a); } + +public class accFinExtDefaultImplDefDefPub{ + private var obj:FinExtDefaultImplDefDefPub = new FinExtDefaultImplDefDefPub(); + var i:DefaultInt = obj; + var j:DefaultIntDef=obj; + public function acciGetPubBoolean() : Boolean {return obj.iGetPubBoolean();} + public function acciGetPubNumber() : Number { return obj.iGetPubNumber(); } + public function acciiGetBoolean():Boolean{return i.iGetBoolean();} + public function acciiGetNumber():Number{return i.iGetNumber();} + public function accjiGetBoolean():Boolean {return obj.DefaultIntDef::iGetBoolean();} + public function accjiGetNumber():Number{return obj.DefaultIntDef::iGetNumber();} +} + + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDefaultImplDefPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDefaultImplDefPub.as new file mode 100644 index 00000000000..72aa7734bde --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDefaultImplDefPub.as @@ -0,0 +1,46 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "Clean AS2"; // Version of JavaScript or ECMA +var TITLE = "Extend Default Class Implement Default interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +import DefaultClass.*; + +var obj = new accFinExtDefaultImplDefPub(); + +AddTestCase( "*** public method implemented interface ***", 1, 1 ); +AddTestCase( "iGetPubBoolean(false)", false, obj.acciGetPubBoolean() ); + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDefaultImplDefPub/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDefaultImplDefPub/DefaultClass.as new file mode 100644 index 00000000000..68d3d9dd4c3 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDefaultImplDefPub/DefaultClass.as @@ -0,0 +1,251 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DefaultClass { + + class DefaultClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + + internal var finArray:Array; + internal var finBoolean:Boolean; + internal var finDate:Date; + internal var finFunction:Function; + internal var finMath:Math; + internal var finNumber:Number; + internal var finObject:Object; + internal var finString:String; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { + number = n; + } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + } + + public class DefaultClass extends DefaultClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDefaultImplDefPub/DefaultIntDef.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDefaultImplDefPub/DefaultIntDef.as new file mode 100644 index 00000000000..162fa403744 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDefaultImplDefPub/DefaultIntDef.as @@ -0,0 +1,40 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DefaultClass { + + interface DefaultIntDef { + + function iGetBoolean() : Boolean + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDefaultImplDefPub/FinExtDefaultImplDefPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDefaultImplDefPub/FinExtDefaultImplDefPub.as new file mode 100644 index 00000000000..ade17b103e1 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDefaultImplDefPub/FinExtDefaultImplDefPub.as @@ -0,0 +1,189 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DefaultClass { + +import DefaultClass.*; + +final class FinExtDefaultImplDefPub extends DefaultClass implements DefaultIntDef { + + public function iGetBoolean() : Boolean{} + public function iGetPubBoolean(): Boolean {return false;} + + // ************************************ + // access public method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return this.getPubArray(); } + function subSetArray(a:Array) { this.setPubArray(a); } + + public function testGetSubArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + + // ************************************ + // access public method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return this.getPubArray(); } + public function pubSubSetArray(a:Array) { this.setPubArray(a); } + + // ************************************ + // access public method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return this.getPubArray(); } + private function privSubSetArray(a:Array) { this.setPubArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + + // ************************************ + // access public method of parent + // from final method of sub class + // ************************************ + + final function finSubGetArray() : Array { return this.getPubArray(); } + final function finSubSetArray(a:Array) { this.setPubArray(a); } + + // function to test above from test scripts + public function testFinSubArray(a:Array) : Array { + this.finSubSetArray(a); + return this.finSubGetArray(); + } + + // *************************************** + // access public property from + // default method of sub class + // *************************************** + + function subGetDPArray() : Array { return pubArray; } + function subSetDPArray(a:Array) { pubArray = a; } + + public function testSubGetDPArray(a:Array) : Array { + this.subSetDPArray(a); + return this.subGetDPArray(); + } + + + // *************************************** + // access public property from + // public method of sub class + // *************************************** + + public function pubSubGetDPArray() : Array { return this.pubArray; } + public function pubSubSetDPArray(a:Array) { this.pubArray = a; } + + public function testPubSubGetDPArray(a:Array):Array { + this.pubSubSetDPArray(a); + return this.pubSubGetDPArray(); + } + + // *************************************** + // access public property from + // private method of sub class + // *************************************** + + private function privSubGetDPArray() : Array { return this.pubArray; } + private function privSubSetDPArray(a:Array) { this.pubArray = a; } + + public function testPrivSubGetDPArray(a:Array) : Array { + this.privSubSetDPArray(a); + return this.privSubGetDPArray(); + } + + + } + + // Create an instance of the final class in the package. + // This object will be used for accessing the methods created + // within the sub class given above. + var FINEXTDCLASS = new FinExtDefaultImplDefPub(); + + // Create a series of public functions that call the methods. + // The same names can be used as used in the class; because we are now + // outside of the class definition. + + // public function iGetPubBoolean() : Boolean {return FINEXTDCLASS.iGetPubBoolean();} + // The default method of the sub class. + public function setPubArray( a:Array ) { return FINEXTDCLASS.setPubArray( a ); } + public function setPubBoolean( a:Boolean ) { return FINEXTDCLASS.setPubBoolean( a ); } + public function setPubDate( a:Date ) { return FINEXTDCLASS.setPubDate( a ); } + public function setPubFunction( a:Function ) { return FINEXTDCLASS.setPubFunction( a ); } + public function setPubNumber( a:Number ) { return FINEXTDCLASS.setPubNumber( a ); } + public function setPubString( a:String ) { return FINEXTDCLASS.setPubString( a ); } + public function setPubObject( a:Object ) { return FINEXTDCLASS.setPubObject( a ); } + + // The dynamic method of the sub class. + public function testGetSetBoolean( a:Array ) { FINEXTDCLASS.testGetSetBoolean( a ); } + public function testPubGetSetBoolean( a:Array ) { FINEXTDCLASS.testPubGetSetBoolean( a ); } + + + // The public method of the sub class. + public function testGetSubArray( a:Array ) { return FINEXTDCLASS.testGetSubArray( a ); } + public function pubSubSetArray( a:Array ) { return FINEXTDCLASS.pubSubSetArray( a ); } + public function pubSubGetArray() { return FINEXTDCLASS.pubSubGetArray( ); } + + // The private method of the sub class. Only one is used as we need to call only the + // test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivSubArray( a:Array ) : Array { return FINEXTDCLASS.testPrivSubArray( a ); } + + // The default property being accessed by the different method attributes. + // The default method attribute. + public function pubSubSetDPArray( a:Array ) { return FINEXTDCLASS.pubSubSetDPArray(a); } + + public function testSubGetDPArray(a:Array) : Array { return FINEXTDCLASS.testSubGetDPArray(a); } + + + public function testPubSubGetDPArray(a:Array) : Array { return FINEXTDCLASS.testPubSubGetDPArray(a); } + + + // the private static method attribute + public function testPrivSubGetDPArray(a:Array) : Array { return FINEXTDCLASS.testPrivSubGetDPArray(a); } + + +public class accFinExtDefaultImplDefPub{ + private var obj:FinExtDefaultImplDefPub = new FinExtDefaultImplDefPub(); + + public function acciGetPubBoolean() : Boolean {return obj.iGetPubBoolean();} +} + + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDefaultImplDefStat.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDefaultImplDefStat.as new file mode 100644 index 00000000000..88271f50806 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDefaultImplDefStat.as @@ -0,0 +1,46 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "Clean AS2"; // Version of JavaScript or ECMA +var TITLE = "Extend Default Class Implement Default Interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +import DefaultClass.*; + +var obj = new accFinExtDefaultImplDefStat(); + +AddTestCase( "*** public method implemented interface ***", 1, 1 ); +AddTestCase( "iGetPubBoolean(false)", false, obj.acciGetPubBoolean() ); + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDefaultImplDefStat/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDefaultImplDefStat/DefaultClass.as new file mode 100644 index 00000000000..68d3d9dd4c3 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDefaultImplDefStat/DefaultClass.as @@ -0,0 +1,251 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DefaultClass { + + class DefaultClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + + internal var finArray:Array; + internal var finBoolean:Boolean; + internal var finDate:Date; + internal var finFunction:Function; + internal var finMath:Math; + internal var finNumber:Number; + internal var finObject:Object; + internal var finString:String; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { + number = n; + } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + } + + public class DefaultClass extends DefaultClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDefaultImplDefStat/DefaultIntDef.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDefaultImplDefStat/DefaultIntDef.as new file mode 100644 index 00000000000..8eccc202a84 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDefaultImplDefStat/DefaultIntDef.as @@ -0,0 +1,41 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DefaultClass { + + interface DefaultIntDef { + + function iGetBoolean() : Boolean +// public function iGetPubBoolean() : Boolean + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDefaultImplDefStat/FinExtDefaultImplDefStat.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDefaultImplDefStat/FinExtDefaultImplDefStat.as new file mode 100644 index 00000000000..17f3ca2cef9 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDefaultImplDefStat/FinExtDefaultImplDefStat.as @@ -0,0 +1,260 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DefaultClass { + +import DefaultClass.*; + +final class FinExtDefaultImplDefStat extends DefaultClass implements DefaultIntDef { + + + + public function iGetBoolean() : Boolean { return this.boolean; } + public function iGetPubBoolean(): Boolean {return false;} + + // ************************************ + // access static method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return getStatArray(); } + function subSetArray(a:Array) { setStatArray(a); } + + public function testSubSetArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + + // ************************************ + // access static method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return getStatArray(); } + public function pubSubSetArray(a:Array) { setStatArray(a); } + + // ************************************ + // access static method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return getStatArray(); } + private function privSubSetArray(a:Array) { setStatArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + // *************************************** + // access static method of parent + // from static method of sub class + // *************************************** + + static function statSubGetArray() : Array { return getStatArray(); } + static function statSubSetArray(a:Array) { setStatArray(a); } + + public static function testStatSubArray(a:Array) : Array { + statSubSetArray(a); + return statSubGetArray(); + } + + + // *************************************** + // access static method of parent + // from public static method of sub class + // *************************************** + + public static function pubStatSubGetArray() : Array { return getStatArray(); } + public static function pubStatSubSetArray(a:Array) { setStatArray(a); } + + // *************************************** + // access static method of parent + // from private static method of sub class + // *************************************** + + private static function privStatSubGetArray() : Array { return getStatArray(); } + private static function privStatSubSetArray(a:Array) { setStatArray(a); } + + // function to test above test case + public function testPrivStatSubArray(a:Array) : Array { + privStatSubSetArray(a); + return privStatSubGetArray(); + } + + // *************************************** + // access static property from + // default method of sub class + // *************************************** + + function subGetDPArray() : Array { return statArray; } + function subSetDPArray(a:Array) { statArray = a; } + + public function testSubSetDPArray(a:Array) : Array { + subSetDPArray(a); + return subGetDPArray(); + } + + + // *************************************** + // access static property from + // public method of sub class + // *************************************** + + public function pubSubGetDPArray() : Array { return statArray; } + public function pubSubSetDPArray(a:Array) { statArray = a; } + + // *************************************** + // access static property from + // private method of sub class + // *************************************** + + private function privSubGetDPArray() : Array { return statArray; } + private function privSubSetDPArray(a:Array) { statArray = a; } + + public function testPrivSubSetDPArray(a:Array) : Array { + privSubSetDPArray(a); + return privSubGetDPArray(); + } + + public function testGetSubArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + + // *************************************** + // access static property from + // static method of sub class + // *************************************** + + static function statSubGetDPArray() : Array { return statArray; } + static function statSubSetDPArray(a:Array) { statArray = a; } + + public static function testStatSetDPArray(a:Array) : Array { + statSubSetDPArray(a); + return statSubGetDPArray(); + } + + + // *************************************** + // access static property from + // public static method of sub class + // *************************************** + + + public function testSubGetDPArray(a:Array) : Array { + this.subSetDPArray(a); + return this.subGetDPArray(); + } + + public static function pubStatSubGetDPArray() : Array { return statArray; } + public static function pubStatSubSetDPArray(a:Array) { statArray = a; } + + // *************************************** + // access static property from + // private static method of sub class + // *************************************** + + private static function privStatSubGetDPArray() : Array { return statArray; } + private static function privStatSubSetDPArray(a:Array) { statArray = a; } + + // function to test above + + public function testPrivStatSubDPArray(a:Array) { + statArray = a; + return statArray; + } + + public function testPubSubGetDPArray(a:Array) : Array { + this.pubSubSetDPArray(a); + return this.pubSubGetDPArray(); + } + + public function testPrivSubGetDPArray(a:Array) : Array { + this.privSubSetDPArray(a); + return this.privSubGetDPArray(); + } + } + + // Create an instance of the final class in the package. + // This object will be used for accessing the methods created + // within the sub class given above. + var FINEXTDCLASS = new FinExtDefaultImplDefStat(); + + // Create a series of public functions that call the methods. + // The same names can be used as used in the class; because we are now + // outside of the class definition. + + // The default method of the sub class. + public function setPubArray( a:Array ) { return FINEXTDCLASS.setPubArray( a ); } + public function setPubBoolean( a:Boolean ) { return FINEXTDCLASS.setPubBoolean( a ); } + public function setPubDate( a:Date ) { return FINEXTDCLASS.setPubDate( a ); } + public function setPubFunction( a:Function ) { return FINEXTDCLASS.setPubFunction( a ); } + public function setPubNumber( a:Number ) { return FINEXTDCLASS.setPubNumber( a ); } + public function setPubString( a:String ) { return FINEXTDCLASS.setPubString( a ); } + public function setPubObject( a:Object ) { return FINEXTDCLASS.setPubObject( a ); } + + // The dynamic method of the sub class. + public function testGetSetBoolean( a:Array ) { FINEXTDCLASS.testGetSetBoolean( a ); } + public function testPubGetSetBoolean( a:Array ) { FINEXTDCLASS.testPubGetSetBoolean( a ); } + + + // The public method of the sub class. + public function testGetSubArray( a:Array ) { return FINEXTDCLASS.testGetSubArray( a ); } + public function pubSubSetArray( a:Array ) { return FINEXTDCLASS.pubSubSetArray( a ); } + public function pubSubGetArray() { return FINEXTDCLASS.pubSubGetArray( ); } + + // The private method of the sub class. Only one is used as we need to call only the + // test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivSubArray( a:Array ) : Array { return FINEXTDCLASS.testPrivSubArray( a ); } + + // The default property being accessed by the different method attributes. + // The default method attribute. + public function pubSubSetDPArray( a:Array ) { return FINEXTDCLASS.pubSubSetDPArray(a); } + public function testSubGetDPArray(a:Array) : Array { return FINEXTDCLASS.testSubGetDPArray(a); } + public function testPubSubGetDPArray(a:Array) : Array { return FINEXTDCLASS.testPubSubGetDPArray(a); } + + + // the private static method attribute + public function testPrivSubGetDPArray(a:Array) : Array { return FINEXTDCLASS.testPrivSubGetDPArray(a); } + + +public class accFinExtDefaultImplDefStat{ + private var obj:FinExtDefaultImplDefStat = new FinExtDefaultImplDefStat(); + + public function acciGetPubBoolean() : Boolean {return obj.iGetPubBoolean();} +} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDynamicImplDefDefPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDynamicImplDefDefPub.as new file mode 100644 index 00000000000..e357d0598a2 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDynamicImplDefDefPub.as @@ -0,0 +1,50 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "Clean AS2"; // Version of JavaScript or ECMA +var TITLE = "Extend Dynamic Class Implement Default interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +import DynamicClass.*; + +var obj = new accFinExtDynamicImplDefDefPub(); + +AddTestCase( "*** public method implemented interface ***", 1, 1 ); +AddTestCase( "iGetPubBoolean", false, obj.acciGetPubBoolean() ); + +AddTestCase( "*** public method implemented interface ***", 2, 2 ); +AddTestCase( "iGetPubNumber", 5 , obj.acciGetPubNumber() ); +AddTestCase( "iiGetNumber", 5 , obj.acciiGetNumber1() ); +AddTestCase( "jiGetNumber", 5 , obj.accjiGetNumber1() ); diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDynamicImplDefDefPub/DefaultInt.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDynamicImplDefDefPub/DefaultInt.as new file mode 100644 index 00000000000..e745ffb889f --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDynamicImplDefDefPub/DefaultInt.as @@ -0,0 +1,40 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DynamicClass { + + interface DefaultInt { + + function iGetNumber():Number + function iGetNumber1(): Number + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDynamicImplDefDefPub/DefaultIntDef.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDynamicImplDefDefPub/DefaultIntDef.as new file mode 100644 index 00000000000..536dec674c3 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDynamicImplDefDefPub/DefaultIntDef.as @@ -0,0 +1,41 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DynamicClass { + + interface DefaultIntDef { + + function iGetBoolean() : Boolean + + function iGetNumber1(): Number; + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDynamicImplDefDefPub/DynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDynamicImplDefDefPub/DynamicClass.as new file mode 100644 index 00000000000..58ed6f47bac --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDynamicImplDefDefPub/DynamicClass.as @@ -0,0 +1,230 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DynamicClass { + + + dynamic class DynamicClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + + internal var finArray:Array; + internal var finBoolean:Boolean; + internal var finDate:Date; + internal var finFunction:Function; + internal var finMath:Math; + internal var finNumber:Number; + internal var finObject:Object; + internal var finString:String; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + + // **************** + // constructor + // **************** + + function DynamicClass() { + } + + // ***************** + // default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + } + public class DynamicClass extends DynamicClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDynamicImplDefDefPub/FinExtDynamicImplDefDefPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDynamicImplDefDefPub/FinExtDynamicImplDefDefPub.as new file mode 100644 index 00000000000..fc9b9574234 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDynamicImplDefDefPub/FinExtDynamicImplDefDefPub.as @@ -0,0 +1,173 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DynamicClass { + +import DynamicClass.*; + +final class FinExtDynamicImplDefDefPub extends DynamicClass implements DefaultIntDef, DefaultInt { + + // **************************************** + // define a default definition from + // default interface as a default method + // **************************************** + + public function iGetBoolean() : Boolean { return this.boolean; } + public function iGetNumber1() : Number { return 5; } + public function testGetBoolean(flag:Boolean):Boolean { + + setBoolean(flag); + return iGetBoolean(); + } + + + // **************************************** + // define a public defintion from + // default interface as a default method + // **************************************** + + public function iGetPubBoolean(): Boolean {return false;} + + + // **************************************** + // define a default definition from + // default interface 2 as a public method + // **************************************** + + public function iGetNumber() : Number { return this.number; } + + public function testGetSetNumber( num:Number ) : Number { + + setNumber(num); + return iGetNumber(); + } + + + // **************************************** + // define a public defintion from + // default interface 2 as a default method + // **************************************** + + + public function iGetPubNumber() : Number { return 5; } + + // ************************************ + // access public method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return this.getPubArray(); } + function subSetArray(a:Array) { this.setPubArray(a); } + + public function testGetSubArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + + // ************************************ + // access public method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return this.getPubArray(); } + public function pubSubSetArray(a:Array) { this.setPubArray(a); } + + // ************************************ + // access public method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return this.getPubArray(); } + private function privSubSetArray(a:Array) { this.setPubArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + } + + // Create an instance of the final class in the package. + // This object will be used for accessing the methods created + // within the sub class given above. + var FINEXTDCLASS = new FinExtDynamicImplDefDefPub(); + + // Create a series of public functions that call the methods. + // The same names can be used as used in the class; because we are now + // outside of the class definition. + + // The default method of the sub class. + public function setPubArray( a:Array ) { return FINEXTDCLASS.setPubArray( a ); } + public function setPubBoolean( a:Boolean ) { return FINEXTDCLASS.setPubBoolean( a ); } + public function setPubDate( a:Date ) { return FINEXTDCLASS.setPubDate( a ); } + public function setPubFunction( a:Function ) { return FINEXTDCLASS.setPubFunction( a ); } + public function setPubNumber( a:Number ) { return FINEXTDCLASS.setPubNumber( a ); } + public function setPubString( a:String ) { return FINEXTDCLASS.setPubString( a ); } + public function setPubObject( a:Object ) { return FINEXTDCLASS.setPubObject( a ); } + + // The dynamic method of the sub class. + public function testGetSetBoolean( a:Array ) { FINEXTDCLASS.testGetSetBoolean( a ); } + public function testPubGetSetBoolean( a:Array ) { FINEXTDCLASS.testPubGetSetBoolean( a ); } + + + // The public method of the sub class. + public function testGetSubArray( a:Array ) { return FINEXTDCLASS.testGetSubArray( a ); } + public function pubSubSetArray( a:Array ) { return FINEXTDCLASS.pubSubSetArray( a ); } + public function pubSubGetArray() { return FINEXTDCLASS.pubSubGetArray( ); } + + // The private method of the sub class. Only one is used as we need to call only the + // test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivSubArray( a:Array ) : Array { return FINEXTDCLASS.testPrivSubArray( a ); } + + // The default property being accessed by the different method attributes. + // The default method attribute. + public function pubSubSetDPArray( a:Array ) { return FINEXTDCLASS.pubSubSetDPArray(a); } + public function testSubGetDPArray(a:Array) : Array { return FINEXTDCLASS.testSubGetDPArray(a); } + + + // the private static method attribute + public function testPrivSubGetDPArray(a:Array) : Array { return FINEXTDCLASS.testPrivSubGetDPArray(a); } + +public class accFinExtDynamicImplDefDefPub{ + private var obj:FinExtDynamicImplDefDefPub = new FinExtDynamicImplDefDefPub(); + var i:DefaultInt=obj; + var j:DefaultIntDef=obj; + public function acciGetPubBoolean() : Boolean {return obj.iGetPubBoolean();} + public function acciGetPubNumber() : Number { return obj.iGetPubNumber(); } + public function acciiGetNumber1(): Number{ return i.iGetNumber1();} + public function accjiGetNumber1(): Number{ return obj.DefaultIntDef::iGetNumber1();} + +} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDynamicImplDefPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDynamicImplDefPub.as new file mode 100644 index 00000000000..6fd0e77fdf4 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDynamicImplDefPub.as @@ -0,0 +1,46 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "Clean AS2"; // Version of JavaScript or ECMA +var TITLE = "Extend Default Class Implement Default interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +import DynamicClass.*; + +var obj = new accFinExtDynamicImplDefPub(); + +AddTestCase( "*** public method implemented interface ***", 1, 1 ); +AddTestCase( "iGetPubBoolean(false)", false, obj.acciGetPubBoolean() ); + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDynamicImplDefPub/DefaultIntDef.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDynamicImplDefPub/DefaultIntDef.as new file mode 100644 index 00000000000..fd5b160aaf4 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDynamicImplDefPub/DefaultIntDef.as @@ -0,0 +1,41 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DynamicClass { + + interface DefaultIntDef { + + function iGetBoolean() : Boolean + // public function iGetPubBoolean() : Boolean + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDynamicImplDefPub/DynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDynamicImplDefPub/DynamicClass.as new file mode 100644 index 00000000000..58ed6f47bac --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDynamicImplDefPub/DynamicClass.as @@ -0,0 +1,230 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DynamicClass { + + + dynamic class DynamicClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + + internal var finArray:Array; + internal var finBoolean:Boolean; + internal var finDate:Date; + internal var finFunction:Function; + internal var finMath:Math; + internal var finNumber:Number; + internal var finObject:Object; + internal var finString:String; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + + // **************** + // constructor + // **************** + + function DynamicClass() { + } + + // ***************** + // default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + } + public class DynamicClass extends DynamicClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDynamicImplDefPub/FinExtDynamicImplDefPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDynamicImplDefPub/FinExtDynamicImplDefPub.as new file mode 100644 index 00000000000..66c3a205d6f --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDynamicImplDefPub/FinExtDynamicImplDefPub.as @@ -0,0 +1,145 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DynamicClass { + +import DynamicClass.*; + +final class FinExtDynamicImplDefPub extends DynamicClass implements DefaultIntDef { + + // **************************************** + // define a default definition from + // default interface as a default method + // **************************************** + + public function iGetBoolean() : Boolean { return this.boolean; } + + public function testGetSetBoolean( flag:Boolean ) : Boolean { + + setBoolean(flag); + return iGetBoolean(); + } + + + // **************************************** + // define a public defintion from + // default interface as a default method + // **************************************** + + public function iGetPubBoolean(): Boolean {return false;} + + + // ************************************ + // access public method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return this.getPubArray(); } + function subSetArray(a:Array) { this.setPubArray(a); } + + public function testGetSubArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + + // ************************************ + // access public method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return this.getPubArray(); } + public function pubSubSetArray(a:Array) { this.setPubArray(a); } + + // ************************************ + // access public method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return this.getPubArray(); } + private function privSubSetArray(a:Array) { this.setPubArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + } + // Create an instance of the final class in the package. + // This object will be used for accessing the methods created + // within the sub class given above. + var FINEXTDCLASS = new FinExtDynamicImplDefPub(); + + // Create a series of public functions that call the methods. + // The same names can be used as used in the class; because we are now + // outside of the class definition. + + // The default method of the sub class. + public function setPubArray( a:Array ) { return FINEXTDCLASS.setPubArray( a ); } + public function setPubBoolean( a:Boolean ) { return FINEXTDCLASS.setPubBoolean( a ); } + public function setPubDate( a:Date ) { return FINEXTDCLASS.setPubDate( a ); } + public function setPubFunction( a:Function ) { return FINEXTDCLASS.setPubFunction( a ); } + public function setPubNumber( a:Number ) { return FINEXTDCLASS.setPubNumber( a ); } + public function setPubString( a:String ) { return FINEXTDCLASS.setPubString( a ); } + public function setPubObject( a:Object ) { return FINEXTDCLASS.setPubObject( a ); } + + // The dynamic method of the sub class. + public function testGetSetBoolean( a:Array ) { FINEXTDCLASS.testGetSetBoolean( a ); } + public function testPubGetSetBoolean( a:Array ) { FINEXTDCLASS.testPubGetSetBoolean( a ); } + + + // The public method of the sub class. + public function testGetSubArray( a:Array ) { return FINEXTDCLASS.testGetSubArray( a ); } + public function pubSubSetArray( a:Array ) { return FINEXTDCLASS.pubSubSetArray( a ); } + public function pubSubGetArray() { return FINEXTDCLASS.pubSubGetArray( ); } + + // The private method of the sub class. Only one is used as we need to call only the + // test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivSubArray( a:Array ) : Array { return FINEXTDCLASS.testPrivSubArray( a ); } + + // The default property being accessed by the different method attributes. + // The default method attribute. + public function pubSubSetDPArray( a:Array ) { return FINEXTDCLASS.pubSubSetDPArray(a); } + public function testSubGetDPArray(a:Array) : Array { return FINEXTDCLASS.testSubGetDPArray(a); } + + + // the private static method attribute + public function testPrivSubGetDPArray(a:Array) : Array { return FINEXTDCLASS.testPrivSubGetDPArray(a); } + +public class accFinExtDynamicImplDefPub{ + private var obj:FinExtDynamicImplDefPub = new FinExtDynamicImplDefPub(); + + public function acciGetPubBoolean() : Boolean {return obj.iGetPubBoolean();} +} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDynamicImplDefPubStat.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDynamicImplDefPubStat.as new file mode 100644 index 00000000000..a60167ffd80 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDynamicImplDefPubStat.as @@ -0,0 +1,47 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "Clean AS2"; // Version of JavaScript or ECMA +var TITLE = "Extend Dynamic Class Implement Default Interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +import DynamicClass.*; + +var obj = new accFinExtDynamicImplDefPubStat(); + +AddTestCase( "*** public method implemented interface ***", 1, 1 ); +AddTestCase( "iGetPubBoolean(false)", false, obj.acciGetPubBoolean() ); + + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDynamicImplDefPubStat/DefaultInt.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDynamicImplDefPubStat/DefaultInt.as new file mode 100644 index 00000000000..dd49e107cbd --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDynamicImplDefPubStat/DefaultInt.as @@ -0,0 +1,40 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DynamicClass { + + interface DefaultInt { + + function iGetBoolean() : Boolean + // public function iGetPubBoolean() : Boolean + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDynamicImplDefPubStat/DefaultIntDef.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDynamicImplDefPubStat/DefaultIntDef.as new file mode 100644 index 00000000000..fd5b160aaf4 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDynamicImplDefPubStat/DefaultIntDef.as @@ -0,0 +1,41 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DynamicClass { + + interface DefaultIntDef { + + function iGetBoolean() : Boolean + // public function iGetPubBoolean() : Boolean + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDynamicImplDefPubStat/DynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDynamicImplDefPubStat/DynamicClass.as new file mode 100644 index 00000000000..58ed6f47bac --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDynamicImplDefPubStat/DynamicClass.as @@ -0,0 +1,230 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DynamicClass { + + + dynamic class DynamicClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + + internal var finArray:Array; + internal var finBoolean:Boolean; + internal var finDate:Date; + internal var finFunction:Function; + internal var finMath:Math; + internal var finNumber:Number; + internal var finObject:Object; + internal var finString:String; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + + // **************** + // constructor + // **************** + + function DynamicClass() { + } + + // ***************** + // default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + } + public class DynamicClass extends DynamicClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDynamicImplDefPubStat/FinExtDynamicImplDefPubStat.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDynamicImplDefPubStat/FinExtDynamicImplDefPubStat.as new file mode 100644 index 00000000000..a25300991df --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtDynamicImplDefPubStat/FinExtDynamicImplDefPubStat.as @@ -0,0 +1,253 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DynamicClass { + +import DynamicClass.*; + +final class FinExtDynamicImplDefPubStat extends DynamicClass implements DefaultIntDef { + + + public function iGetBoolean() : Boolean { return this.boolean; } + public function iGetPubBoolean(): Boolean {return false;} + + // ************************************ + // access public static method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return getPubStatArray(); } + function subSetArray(a:Array) { setPubStatArray(a); } + + public function testGetSubArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + + // ************************************ + // access public static method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return getPubStatArray(); } + public function pubSubSetArray(a:Array) { setPubStatArray(a); } + + // ************************************ + // access public static method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return getPubStatArray(); } + private function privSubSetArray(a:Array) { setPubStatArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + // *************************************** + // access public static method of parent + // from static method of sub class + // *************************************** + + static function statSubGetArray() : Array { return getPubStatArray(); } + static function statSubSetArray(a:Array) { setPubStatArray(a); } + + public static function testStatSubArray(a:Array) : Array { + statSubSetArray(a); + return statSubGetArray(); + } + + + // *************************************** + // access public static method of parent + // from public static method of sub class + // *************************************** + + public static function pubStatSubGetArray() : Array { return getPubStatArray(); } + public static function pubStatSubSetArray(a:Array) { setPubStatArray(a); } + + // *************************************** + // access public static method of parent + // from private static method of sub class + // *************************************** + + private static function privStatSubGetArray() : Array { return getPubStatArray(); } + private static function privStatSubSetArray(a:Array) { setPubStatArray(a); } + + // function to test above test case + public function testPrivStatSubArray(a:Array) : Array { + privStatSubSetArray(a); + return privStatSubGetArray(); + } + + // *************************************** + // access public static property from + // default method of sub class + // *************************************** + + function subGetDPArray() : Array { return pubStatArray; } + function subSetDPArray(a:Array) { pubStatArray = a; } + + public function testSubDPArray(a:Array):Array { + subSetDPArray(a); + return subGetDPArray(); + } + + public function testSubGetDPArray(a:Array) : Array { + this.subSetDPArray(a); + return this.subGetDPArray(); + } + + // *************************************** + // access public static property from + // public method of sub class + // *************************************** + + public function pubSubGetDPArray() : Array { return pubStatArray; } + public function pubSubSetDPArray(a:Array) { pubStatArray = a; } + + public function testPubSubDPArray(a:Array):Array { + pubSubSetDPArray(a); + return pubSubGetDPArray(); + } + + // *************************************** + // access public static property from + // private method of sub class + // *************************************** + + private function privSubGetDPArray() : Array { return pubStatArray; } + private function privSubSetDPArray(a:Array) { pubStatArray = a; } + + public function testPrivSubDPArray(a:Array):Array { + privSubSetDPArray(a); + return privSubGetDPArray(); + } + + + // *************************************** + // access public static property from + // static method of sub class + // *************************************** + + static function statSubGetDPArray() : Array { return pubStatArray; } + static function statSubSetDPArray(a:Array) { pubStatArray = a; } + + public static function testStatSubDPArray(a:Array):Array { + statSubSetDPArray(a); + return statSubGetDPArray(); + } + + + // *************************************** + // access public static property from + // public static method of sub class + // *************************************** + + public static function pubStatSubGetDPArray() : Array { return pubStatArray; } + public static function pubStatSubSetDPArray(a:Array) { pubStatArray = a; } + + // *************************************** + // access public static property from + // private static method of sub class + // *************************************** + + private static function privStatSubGetDPArray() : Array { return pubStatArray; } + private static function privStatSubSetDPArray(a:Array) { pubStatArray = a; } + + // function to test above + + public function testPrivStatSubDPArray(a:Array) { + statArray = a; + return statArray; + } + + public function testPubSubGetDPArray(a:Array) : Array { + this.pubSubSetDPArray(a); + return this.pubSubGetDPArray(); + } + public function testPrivSubGetDPArray(a:Array) : Array { + this.privSubSetDPArray(a); + return this.privSubGetDPArray(); + } + } + // Create an instance of the final class in the package. + // This object will be used for accessing the methods created + // within the sub class given above. + var FINEXTDCLASS = new FinExtDynamicImplDefPubStat(); + + // Create a series of public functions that call the methods. + // The same names can be used as used in the class; because we are now + // outside of the class definition. + + // The default method of the sub class. + public function setPubArray( a:Array ) { return FINEXTDCLASS.setPubArray( a ); } + public function setPubBoolean( a:Boolean ) { return FINEXTDCLASS.setPubBoolean( a ); } + public function setPubDate( a:Date ) { return FINEXTDCLASS.setPubDate( a ); } + public function setPubFunction( a:Function ) { return FINEXTDCLASS.setPubFunction( a ); } + public function setPubNumber( a:Number ) { return FINEXTDCLASS.setPubNumber( a ); } + public function setPubString( a:String ) { return FINEXTDCLASS.setPubString( a ); } + public function setPubObject( a:Object ) { return FINEXTDCLASS.setPubObject( a ); } + + // The dynamic method of the sub class. + public function testGetSetBoolean( a:Array ) { FINEXTDCLASS.testGetSetBoolean( a ); } + public function testPubGetSetBoolean( a:Array ) { FINEXTDCLASS.testPubGetSetBoolean( a ); } + + + // The public method of the sub class. + public function testGetSubArray( a:Array ) { return FINEXTDCLASS.testGetSubArray( a ); } + public function pubSubSetArray( a:Array ) { return FINEXTDCLASS.pubSubSetArray( a ); } + public function pubSubGetArray() { return FINEXTDCLASS.pubSubGetArray( ); } + + // The private method of the sub class. Only one is used as we need to call only the + // test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivSubArray( a:Array ) : Array { return FINEXTDCLASS.testPrivSubArray( a ); } + + // The default property being accessed by the different method attributes. + // The default method attribute. + public function pubSubSetDPArray( a:Array ) { return FINEXTDCLASS.pubSubSetDPArray(a); } + public function testSubGetDPArray(a:Array) : Array { return FINEXTDCLASS.testSubGetDPArray(a); } + public function testPubSubGetDPArray(a:Array) : Array { return FINEXTDCLASS.testPubSubGetDPArray(a); } + + // the private static method attribute + public function testPrivSubGetDPArray(a:Array) : Array { return FINEXTDCLASS.testPrivSubGetDPArray(a); } + +public class accFinExtDynamicImplDefPubStat{ + private var obj:FinExtDynamicImplDefPubStat = new FinExtDynamicImplDefPubStat(); + + public function acciGetPubBoolean() : Boolean {return obj.iGetPubBoolean();} +} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtPublicImplDef.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtPublicImplDef.as new file mode 100644 index 00000000000..55e7ba5d612 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtPublicImplDef.as @@ -0,0 +1,46 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "Clean AS2"; // Version of JavaScript or ECMA +var TITLE = "Extend Public Class Implement Default Interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +import PublicClass.*; + +var obj = new accFinExtPublicImplDef(); + +AddTestCase( "*** public method implemented interface ***", 1, 1 ); +AddTestCase( "iGetPubBoolean(false)", false, obj.acciGetPubBoolean() ); + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtPublicImplDef/APublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtPublicImplDef/APublicClass.as new file mode 100644 index 00000000000..41d0f1e959a --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtPublicImplDef/APublicClass.as @@ -0,0 +1,249 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + public class PublicClass { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + + internal var finArray:Array; + internal var finBoolean:Boolean; + internal var finDate:Date; + internal var finMyFunction:Function; + internal var finMath:Math; + internal var finNumber:Number; + internal var finObject:Object; + internal var finString:String; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray():Array { return finArray; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtPublicImplDef/DefaultIntDef.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtPublicImplDef/DefaultIntDef.as new file mode 100644 index 00000000000..36f5e709317 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtPublicImplDef/DefaultIntDef.as @@ -0,0 +1,41 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + interface DefaultIntDef { + + function iGetBoolean() : Boolean + // public function iGetPubBoolean() : Boolean + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtPublicImplDef/FinExtPublicImplDef.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtPublicImplDef/FinExtPublicImplDef.as new file mode 100644 index 00000000000..5d1e6172228 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtPublicImplDef/FinExtPublicImplDef.as @@ -0,0 +1,224 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + +import PublicClass.*; + +final class FinExtPublicImplDef extends PublicClass implements DefaultIntDef { + + // **************************************** + // define a default definition from + // default interface as a default method + // **************************************** + + public function iGetBoolean() : Boolean { return this.boolean; } + + public function testGetSetBoolean( flag:Boolean ) : Boolean { + + setBoolean(flag); + return iGetBoolean(); + } + + + // **************************************** + // define a public defintion from + // default interface as a default method + // **************************************** + + public function iGetPubBoolean(): Boolean {return false;} + + + // **************************************** + // define a default defintion from + // default interface 2 as a default method + // **************************************** + + function iGetNumber() : Number { return this.number; } + + public function testGetSetNumber( num:Number ) : Number { + + setNumber(num); + return iGetNumber(); + } + + + // **************************************** + // define a public definition from + // default interface 2 as a default method + // **************************************** + + public function iGetPubNumber() : Number { return this.pubNumber; } + + public function testPubGetSetNumber( num:Number ) : Number { + + setPubNumber(num); + return iGetPubNumber(); + } + + + // ************************************ + // access default method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return this.getArray(); } + function subSetArray(a:Array) { this.setArray(a); } + + public function testGetSubArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + + // ************************************ + // access default method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return this.getArray(); } + public function pubSubSetArray(a:Array) { this.setArray(a); } + + // ************************************ + // access default method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return this.getArray(); } + private function privSubSetArray(a:Array) { this.setArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + // ************************************ + // access default method of parent + // from final method of sub class + // ************************************ + + final function finSubGetArray() : Array { return this.getArray(); } + final function finSubSetArray(a:Array) { this.setArray(a); } + + // function to test above from test scripts + public function testFinSubArray(a:Array) : Array { + this.finSubSetArray(a); + return this.finSubGetArray(); + } + + + + // *************************************** + // access default property from + // default method of sub class + // *************************************** + + function subGetDPArray() : Array { return array; } + function subSetDPArray(a:Array) { array = a; } + + public function testSubGetDPArray(a:Array) : Array { + this.subSetDPArray(a); + return this.subGetDPArray(); + } + + + // *************************************** + // access default property from + // public method of sub class + // *************************************** + + public function pubSubGetDPArray() : Array { return this.array; } + public function pubSubSetDPArray(a:Array) { this.array = a; } + + // *************************************** + // access default property from + // private method of sub class + // *************************************** + + private function privSubGetDPArray() : Array { return this.array; } + private function privSubSetDPArray(a:Array) { this.array = a; } + + public function testPrivSubGetDPArray(a:Array) : Array { + this.privSubSetDPArray(a); + return this.privSubGetDPArray(); + } + } + + // Create an instance of the final class in the package. + // This object will be used for accessing the methods created + // within the sub class given above. + var FINEXTDCLASS = new FinExtPublicImplDef(); + + // Create a series of public functions that call the methods. + // The same names can be used as used in the class; because we are now + // outside of the class definition. + + // The default method of the sub class. + public function setPubArray( a:Array ) { return FINEXTDCLASS.setPubArray( a ); } + public function setPubBoolean( a:Boolean ) { return FINEXTDCLASS.setPubBoolean( a ); } + public function setPubDate( a:Date ) { return FINEXTDCLASS.setPubDate( a ); } + public function setPubFunction( a:Function ) { return FINEXTDCLASS.setPubFunction( a ); } + public function setPubNumber( a:Number ) { return FINEXTDCLASS.setPubNumber( a ); } + public function setPubString( a:String ) { return FINEXTDCLASS.setPubString( a ); } + public function setPubObject( a:Object ) { return FINEXTDCLASS.setPubObject( a ); } + + // The dynamic method of the sub class. + public function testGetSetBoolean( a:Array ) { FINEXTDCLASS.testGetSetBoolean( a ); } + public function testPubGetSetBoolean( a:Array ) { FINEXTDCLASS.testPubGetSetBoolean( a ); } + + + // The public method of the sub class. + public function testGetSubArray( a:Array ) { return FINEXTDCLASS.testGetSubArray( a ); } + public function pubSubSetArray( a:Array ) { return FINEXTDCLASS.pubSubSetArray( a ); } + public function pubSubGetArray() { return FINEXTDCLASS.pubSubGetArray( ); } + + // The private method of the sub class. Only one is used as we need to call only the + // test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivSubArray( a:Array ) : Array { return FINEXTDCLASS.testPrivSubArray( a ); } + + // The default property being accessed by the different method attributes. + // The default method attribute. + public function pubSubSetDPArray( a:Array ) { return FINEXTDCLASS.pubSubSetDPArray(a); } + public function testSubGetDPArray(a:Array) : Array { return FINEXTDCLASS.testSubGetDPArray(a); } + + + // the private static method attribute + public function testPrivSubGetDPArray(a:Array) : Array { return FINEXTDCLASS.testPrivSubGetDPArray(a); } + +public class accFinExtPublicImplDef{ + private var obj:FinExtPublicImplDef = new FinExtPublicImplDef(); + + public function acciGetPubBoolean() : Boolean {return obj.iGetPubBoolean();} +} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtPublicImplDefDefPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtPublicImplDefDefPub.as new file mode 100644 index 00000000000..1a70cb4f063 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtPublicImplDefDefPub.as @@ -0,0 +1,50 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "Clean AS2"; // Version of JavaScript or ECMA +var TITLE = "Extend Public Class Implement Default interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +import PublicClass.*; + +var obj = new accFinExtPublicImplDefDefPub(); + +AddTestCase( "*** public method implemented interface ***", 1, 1 ); +AddTestCase( "iGetPubBoolean", false, obj.acciGetPubBoolean() ); + +AddTestCase( "*** public method implemented interface ***", 2, 2 ); +AddTestCase( "iGetPubNumber", 5 , obj.acciGetPubNumber() ); +AddTestCase( "iiGetNumber1", 5 , obj.acciiGetNumber1() ); +AddTestCase( "jiGetNumber1", 5 , obj.accjiGetNumber1() ); diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtPublicImplDefDefPub/APublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtPublicImplDefDefPub/APublicClass.as new file mode 100644 index 00000000000..41d0f1e959a --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtPublicImplDefDefPub/APublicClass.as @@ -0,0 +1,249 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + public class PublicClass { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + + internal var finArray:Array; + internal var finBoolean:Boolean; + internal var finDate:Date; + internal var finMyFunction:Function; + internal var finMath:Math; + internal var finNumber:Number; + internal var finObject:Object; + internal var finString:String; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray():Array { return finArray; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtPublicImplDefDefPub/DefaultInt.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtPublicImplDefDefPub/DefaultInt.as new file mode 100644 index 00000000000..58891c2525e --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtPublicImplDefDefPub/DefaultInt.as @@ -0,0 +1,40 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + interface DefaultInt { + + function iGetNumber():Number + function iGetNumber1(): Number + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtPublicImplDefDefPub/DefaultIntDef.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtPublicImplDefDefPub/DefaultIntDef.as new file mode 100644 index 00000000000..d8724377f02 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtPublicImplDefDefPub/DefaultIntDef.as @@ -0,0 +1,41 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + interface DefaultIntDef { + + function iGetBoolean() : Boolean + function iGetNumber1() : Number; + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtPublicImplDefDefPub/FinExtPublicImplDefDefPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtPublicImplDefDefPub/FinExtPublicImplDefDefPub.as new file mode 100644 index 00000000000..81fd8d0a018 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtPublicImplDefDefPub/FinExtPublicImplDefDefPub.as @@ -0,0 +1,173 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + +import PublicClass.*; + +final class FinExtPublicImplDefDefPub extends PublicClass implements DefaultIntDef, DefaultInt { + + // **************************************** + // define a default definition from + // default interface as a default method + // **************************************** + + public function iGetBoolean() : Boolean { return this.boolean; } + public function iGetNumber1() : Number { return 5; } + public function testGetBoolean(flag:Boolean):Boolean { + + setBoolean(flag); + return iGetBoolean(); + } + + + // **************************************** + // define a public defintion from + // default interface as a default method + // **************************************** + + public function iGetPubBoolean(): Boolean {return false;} + + + // **************************************** + // define a default definition from + // default interface 2 as a public method + // **************************************** + + public function iGetNumber() : Number { return this.number; } + + public function testGetSetNumber( num:Number ) : Number { + + setNumber(num); + return iGetNumber(); + } + + + // **************************************** + // define a public defintion from + // default interface 2 as a default method + // **************************************** + + public function iGetPubNumber() : Number { return 5; } + + // ************************************ + // access public method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return this.getPubArray(); } + function subSetArray(a:Array) { this.setPubArray(a); } + + public function testGetSubArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + + // ************************************ + // access public method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return this.getPubArray(); } + public function pubSubSetArray(a:Array) { this.setPubArray(a); } + + // ************************************ + // access public method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return this.getPubArray(); } + private function privSubSetArray(a:Array) { this.setPubArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + + } + + // Create an instance of the final class in the package. + // This object will be used for accessing the methods created + // within the sub class given above. + var FINEXTDCLASS = new FinExtPublicImplDefDefPub(); + + // Create a series of public functions that call the methods. + // The same names can be used as used in the class; because we are now + // outside of the class definition. + + // The default method of the sub class. + public function setPubArray( a:Array ) { return FINEXTDCLASS.setPubArray( a ); } + public function setPubBoolean( a:Boolean ) { return FINEXTDCLASS.setPubBoolean( a ); } + public function setPubDate( a:Date ) { return FINEXTDCLASS.setPubDate( a ); } + public function setPubFunction( a:Function ) { return FINEXTDCLASS.setPubFunction( a ); } + public function setPubNumber( a:Number ) { return FINEXTDCLASS.setPubNumber( a ); } + public function setPubString( a:String ) { return FINEXTDCLASS.setPubString( a ); } + public function setPubObject( a:Object ) { return FINEXTDCLASS.setPubObject( a ); } + + // The dynamic method of the sub class. + public function testGetSetBoolean( a:Array ) { FINEXTDCLASS.testGetSetBoolean( a ); } + public function testPubGetSetBoolean( a:Array ) { FINEXTDCLASS.testPubGetSetBoolean( a ); } + + + // The public method of the sub class. + public function testGetSubArray( a:Array ) { return FINEXTDCLASS.testGetSubArray( a ); } + public function pubSubSetArray( a:Array ) { return FINEXTDCLASS.pubSubSetArray( a ); } + public function pubSubGetArray() { return FINEXTDCLASS.pubSubGetArray( ); } + + // The private method of the sub class. Only one is used as we need to call only the + // test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivSubArray( a:Array ) : Array { return FINEXTDCLASS.testPrivSubArray( a ); } + + // The default property being accessed by the different method attributes. + // The default method attribute. + public function pubSubSetDPArray( a:Array ) { return FINEXTDCLASS.pubSubSetDPArray(a); } + public function testSubGetDPArray(a:Array) : Array { return FINEXTDCLASS.testSubGetDPArray(a); } + + + // the private static method attribute + public function testPrivSubGetDPArray(a:Array) : Array { return FINEXTDCLASS.testPrivSubGetDPArray(a); } + +public class accFinExtPublicImplDefDefPub{ + private var obj:FinExtPublicImplDefDefPub = new FinExtPublicImplDefDefPub(); + var i:DefaultInt=obj; + var j:DefaultIntDef=obj; + public function acciGetPubBoolean() : Boolean {return obj.iGetPubBoolean();} + public function acciGetPubNumber() : Number { return obj.iGetPubNumber(); } + public function acciiGetNumber1() : Number { return i.iGetNumber1(); } + public function accjiGetNumber1() : Number { return obj.DefaultIntDef::iGetNumber1(); } + +} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtPublicImplDefPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtPublicImplDefPub.as new file mode 100644 index 00000000000..e203165816e --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtPublicImplDefPub.as @@ -0,0 +1,47 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "Clean AS2"; // Version of JavaScript or ECMA +var TITLE = "Extend Public Class Implement Default interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +import PublicClass.*; + +var obj = new accFinExtPublicImplDefPub(); + +AddTestCase( "*** public method implemented interface ***", 1, 1 ); +AddTestCase( "iGetPubBoolean(false)", false, obj.acciGetPubBoolean() ); + + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtPublicImplDefPub/APublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtPublicImplDefPub/APublicClass.as new file mode 100644 index 00000000000..41d0f1e959a --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtPublicImplDefPub/APublicClass.as @@ -0,0 +1,249 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + public class PublicClass { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + + internal var finArray:Array; + internal var finBoolean:Boolean; + internal var finDate:Date; + internal var finMyFunction:Function; + internal var finMath:Math; + internal var finNumber:Number; + internal var finObject:Object; + internal var finString:String; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray():Array { return finArray; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtPublicImplDefPub/DefaultIntDef.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtPublicImplDefPub/DefaultIntDef.as new file mode 100644 index 00000000000..36f5e709317 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtPublicImplDefPub/DefaultIntDef.as @@ -0,0 +1,41 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + interface DefaultIntDef { + + function iGetBoolean() : Boolean + // public function iGetPubBoolean() : Boolean + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtPublicImplDefPub/FinExtPublicImplDefPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtPublicImplDefPub/FinExtPublicImplDefPub.as new file mode 100644 index 00000000000..d1344354c3c --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/FinExtPublicImplDefPub/FinExtPublicImplDefPub.as @@ -0,0 +1,146 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + +import PublicClass.*; + +final class FinExtPublicImplDefPub extends PublicClass implements DefaultIntDef { + + // **************************************** + // define a default definition from + // default interface as a default method + // **************************************** + + public function iGetBoolean() : Boolean { return this.boolean; } + + public function testGetSetBoolean( flag:Boolean ) : Boolean { + + setBoolean(flag); + return iGetBoolean(); + } + + + // **************************************** + // define a public defintion from + // default interface as a default method + // **************************************** + + public function iGetPubBoolean(): Boolean {return false;} + + // ************************************ + // access public method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return this.getPubArray(); } + function subSetArray(a:Array) { this.setPubArray(a); } + + public function testGetSubArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + + // ************************************ + // access public method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return this.getPubArray(); } + public function pubSubSetArray(a:Array) { this.setPubArray(a); } + + // ************************************ + // access public method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return this.getPubArray(); } + private function privSubSetArray(a:Array) { this.setPubArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + + } + // Create an instance of the final class in the package. + // This object will be used for accessing the methods created + // within the sub class given above. + var FINEXTDCLASS = new FinExtPublicImplDefPub(); + + // Create a series of public functions that call the methods. + // The same names can be used as used in the class; because we are now + // outside of the class definition. + + // The default method of the sub class. + public function setPubArray( a:Array ) { return FINEXTDCLASS.setPubArray( a ); } + public function setPubBoolean( a:Boolean ) { return FINEXTDCLASS.setPubBoolean( a ); } + public function setPubDate( a:Date ) { return FINEXTDCLASS.setPubDate( a ); } + public function setPubFunction( a:Function ) { return FINEXTDCLASS.setPubFunction( a ); } + public function setPubNumber( a:Number ) { return FINEXTDCLASS.setPubNumber( a ); } + public function setPubString( a:String ) { return FINEXTDCLASS.setPubString( a ); } + public function setPubObject( a:Object ) { return FINEXTDCLASS.setPubObject( a ); } + + // The dynamic method of the sub class. + public function testGetSetBoolean( a:Array ) { FINEXTDCLASS.testGetSetBoolean( a ); } + public function testPubGetSetBoolean( a:Array ) { FINEXTDCLASS.testPubGetSetBoolean( a ); } + + + // The public method of the sub class. + public function testGetSubArray( a:Array ) { return FINEXTDCLASS.testGetSubArray( a ); } + public function pubSubSetArray( a:Array ) { return FINEXTDCLASS.pubSubSetArray( a ); } + public function pubSubGetArray() { return FINEXTDCLASS.pubSubGetArray( ); } + + // The private method of the sub class. Only one is used as we need to call only the + // test function, which in turn calls the actual private methods, as within the class + // we can access the private methods; but not outside of the class. + public function testPrivSubArray( a:Array ) : Array { return FINEXTDCLASS.testPrivSubArray( a ); } + + // The default property being accessed by the different method attributes. + // The default method attribute. + public function pubSubSetDPArray( a:Array ) { return FINEXTDCLASS.pubSubSetDPArray(a); } + public function testSubGetDPArray(a:Array) : Array { return FINEXTDCLASS.testSubGetDPArray(a); } + + + // the private static method attribute + public function testPrivSubGetDPArray(a:Array) : Array { return FINEXTDCLASS.testPrivSubGetDPArray(a); } + + +public class accFinExtPublicImplDefPub{ + private var obj:FinExtPublicImplDefPub = new FinExtPublicImplDefPub(); + + public function acciGetPubBoolean() : Boolean {return obj.iGetPubBoolean();} +} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/IntClassExtIntClassImpIntIntExtIntPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/IntClassExtIntClassImpIntIntExtIntPub.as new file mode 100644 index 00000000000..65241b11756 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/IntClassExtIntClassImpIntIntExtIntPub.as @@ -0,0 +1,92 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import IntClassExtIntClassImpIntIntExtIntPub.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Public class implements public interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new InternalSubClassAccessor(); +var obj2 = new InternalInterfaceAccessor(); +//use namespace ns; +var PubInt=obj; + +var PubInt2:PublicInt2=obj; + +//var PubInt3:PublicInt3=obj; +var dateObj:Date = new Date(0); +/*print(PubInt.MyString()); +print(PubInt5.MyString()); +print(PubInt2.MyNegInteger()); +print(PubInt6.MyNegInteger()); +//print(PubInt3.MyString()); +//print(PubInt7.MyString()); +print(PubInt3.MyNegInteger()); +print(PubInt7.MyNegInteger()); +print(PubInt3.MyUnsignedInteger()); +print(PubInt7.MyUnsignedInteger()); +print(obj.MyString()); +print(obj2.MyString()); +//print(obj.MyNegInteger()); +//print(obj2.MyNegInteger()); +print(obj.MyUnsignedInteger()); +print(obj2.MyUnsignedInteger()); +print(obj.PublicInt2::MyString()); +print(obj2.PublicInt2::MyString()); +print(PubInt3.MyNegativeInteger()); +print(PubInt7.MyNegativeInteger()); +print(obj.PublicInt3::MyNegativeInteger()); +print(obj2.PublicInt3::MyNegativeInteger());*/ +//print(obj.MySuperBoolean()); +//Public Class extends Public class implements a public interface which extends two interfaces +AddTestCase("Calling a method in public namespace in the public interface implemented by the subclass through the subclass","Hi!", PubInt.MyString()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",-100, obj2.RetMyNegInteger2()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",-100, obj2.RetMyNegInteger()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",100, obj2.RetMyUnsignedInteger()); +AddTestCase("Calling a method in public namespace in the public interface implemented by the subclass through the subclass","Hi!", obj.MyString()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",100, obj.MyUnsignedInteger()); +AddTestCase("Calling a method in public namespace in the public interface implemented by the subclass through the subclass","Hi!", obj.PublicInt2::MyString()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",-100000, obj.MyNegativeInteger()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",-100000, obj2.RetMyNegativeInteger()); +AddTestCase("Calling a public method in superclass extended by the subclass through the subclass",true, obj.RetMySuperBoolean()); +AddTestCase("Calling an internal method in superclass extended by the subclass through the subclass",10, obj.RetMySuperNumber()); +AddTestCase("Calling a public static method in superclass extended bythe subclass through the subclass",dateObj.toString(), obj.RetMySuperStaticDate()+""); + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/IntClassExtIntClassImpIntIntExtIntPub/InternalSubClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/IntClassExtIntClassImpIntIntExtIntPub/InternalSubClass.as new file mode 100644 index 00000000000..13deed39be3 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/IntClassExtIntClassImpIntIntExtIntPub/InternalSubClass.as @@ -0,0 +1,96 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package IntClassExtIntClassImpIntIntExtIntPub{ + internal interface PublicInt{ + function MyString():String; + } + public interface PublicInt2{ + function MyString():String; + function MyNegInteger():int; + } + internal interface PublicInt3 extends PublicInt,PublicInt2{ + function MyUnsignedInteger():uint; + function MyNegativeInteger():int; + } + internal class InternalSuperClass{ + public function MySuperBoolean():Boolean{return true;} + internal function MySuperNumber():Number{return 10;} + public static function MySuperStaticDate():Date {return new Date(0);} + + + } + + internal class InternalSubClass extends InternalSuperClass implements PublicInt3{ + + public function MyString():String{ + return "Hi!"; + } + + public function MyNegInteger():int{ + var a:int = -100; + return a; + } + public function MyUnsignedInteger():uint{ + var postint:uint =100; + return postint; + } + public function MyNegativeInteger():int{ + var negint:int = -100000; + return negint; + } + public function RetMySuperNumber():Number{return MySuperNumber();} + public function RetMySuperBoolean():Boolean{return MySuperBoolean();} + public function RetMySuperStaticDate():Date{return MySuperStaticDate();} + + + } + + public class InternalInterfaceAccessor{ + var k = new InternalSubClass(); + + var PubInt3:PublicInt3 = k; + var PubInttwo:PublicInt2=k; + public function RetMyNegInteger():int{ + return PubInt3.MyNegInteger(); + } + public function RetMyNegInteger2():int{ + return PubInttwo.MyNegInteger(); + } + public function RetMyUnsignedInteger():uint{ + return PubInt3.MyUnsignedInteger(); + } + public function RetMyNegativeInteger():int{ + return k.PublicInt3::MyNegativeInteger()} + } + public class InternalSubClassAccessor extends InternalSubClass{} + } + + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/IntClassExtPubClassImpPubIntExtPubPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/IntClassExtPubClassImpPubIntExtPubPub.as new file mode 100644 index 00000000000..40d1919497b --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/IntClassExtPubClassImpPubIntExtPubPub.as @@ -0,0 +1,93 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import IntClassExtPubClassImpPubIntExtPubPub.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Public class implements public interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new InternalSubClassAccessor(); + +//use namespace ns; +var PubInt:PublicInt=obj; + +var PubInt2:PublicInt2=obj; + +var PubInt3:PublicInt3=obj; +var dateObj:Date = new Date(0); +/*print(PubInt.MyString()); +print(PubInt5.MyString()); +print(PubInt2.MyNegInteger()); +print(PubInt6.MyNegInteger()); +//print(PubInt3.MyString()); +//print(PubInt7.MyString()); +print(PubInt3.MyNegInteger()); +print(PubInt7.MyNegInteger()); +print(PubInt3.MyUnsignedInteger()); +print(PubInt7.MyUnsignedInteger()); +print(obj.MyString()); +print(obj2.MyString()); +//print(obj.MyNegInteger()); +//print(obj2.MyNegInteger()); +print(obj.MyUnsignedInteger()); +print(obj2.MyUnsignedInteger()); +print(obj.PublicInt2::MyString()); +print(obj2.PublicInt2::MyString()); +print(PubInt3.MyNegativeInteger()); +print(PubInt7.MyNegativeInteger()); +print(obj.PublicInt3::MyNegativeInteger()); +print(obj2.PublicInt3::MyNegativeInteger());*/ +//print(obj.MySuperBoolean()); +//Public Class extends Public class implements a public interface which extends two //interfaces + +AddTestCase("Calling a method in public namespace in the public interface implemented by the subclass through the subclass","Hi!", PubInt.MyString()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",-100, PubInt2.MyNegInteger()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",-100, PubInt3.MyNegInteger()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",100, PubInt3.MyUnsignedInteger()); +AddTestCase("Calling a method in public namespace in the public interface implemented by the subclass through the subclass","Hi!", obj.MyString()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",100, obj.MyUnsignedInteger()); +AddTestCase("Calling a method in public namespace in the public interface implemented by the subclass through the subclass","Hi!", obj.PublicInt2::MyString()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",-100000, PubInt3.MyNegativeInteger()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",-100000, obj.PublicInt3::MyNegativeInteger()); +AddTestCase("Calling a public method in superclass extended by the subclass through the subclass",true, obj.MySuperBoolean()); +AddTestCase("Calling an internal method in superclass extended by the subclass through the subclass",10, obj.RetMySuperNumber()); +AddTestCase("Calling a public static method in superclass extended bythe subclass through the subclass",dateObj.toString(), PublicSuperClass.MySuperStaticDate()+""); + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/IntClassExtPubClassImpPubIntExtPubPub/InternalSubClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/IntClassExtPubClassImpPubIntExtPubPub/InternalSubClass.as new file mode 100644 index 00000000000..9d2096b58ea --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/IntClassExtPubClassImpPubIntExtPubPub/InternalSubClass.as @@ -0,0 +1,78 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package IntClassExtPubClassImpPubIntExtPubPub{ + public interface PublicInt{ + function MyString():String; + } + public interface PublicInt2{ + function MyString():String; + function MyNegInteger():int; + } + public interface PublicInt3 extends PublicInt,PublicInt2{ + function MyUnsignedInteger():uint; + function MyNegativeInteger():int; + } + public class PublicSuperClass{ + public function MySuperBoolean():Boolean{return true;} + internal function MySuperNumber():Number{return 10;} + public static function MySuperStaticDate():Date {return new Date(0);} + + + } + + internal class InternalSubClass extends PublicSuperClass implements PublicInt3{ + var s = new PublicSuperClass(); + public function MyString():String{ + return "Hi!"; + } + + public function MyNegInteger():int{ + var a:int = -100; + return a; + } + public function MyUnsignedInteger():uint{ + var postint:uint =100; + return postint; + } + public function MyNegativeInteger():int{ + var negint:int = -100000; + return negint; + } + public function RetMySuperNumber():Number{return MySuperNumber();} + + } + + public class InternalSubClassAccessor extends InternalSubClass{} + + + } + + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/IntsubExtIntClassImpDefInt.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/IntsubExtIntClassImpDefInt.as new file mode 100644 index 00000000000..3003b11d473 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/IntsubExtIntClassImpDefInt.as @@ -0,0 +1,57 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import InternalClassImpDefInt.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Internal class implements default interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new InternalClassAccesor(); + +//Internal sub class external Internal class implements a default interface with a default //method +//AddTestCase("Internal class implements a default interface with a default method", //"PASSED", obj.accdeffunc()); + +//Internal class implements a default interface with a public method +AddTestCase("Internal class implements a default interface with a public method", true, obj.pubFunc()); + +//Internal class implements a default interface with a namespace method +AddTestCase("Internal class implements a default interface with a namespace method", 4, obj.accnsFunc()); + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/IntsubExtIntClassImpDefInt/DefaultInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/IntsubExtIntClassImpDefInt/DefaultInterface.as new file mode 100644 index 00000000000..fef58fec351 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/IntsubExtIntClassImpDefInt/DefaultInterface.as @@ -0,0 +1,51 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Default Interface DefaultInterface + * Interface methods + * + */ + + +package InternalClassImpDefInt{ //package name + + namespace ns; + //namespace + + interface DefaultInt{ + + function deffunc():String; //Default attribute //method + +// public function pubFunc():Boolean; //Public attribute method + + //ns function nsFunc(a="test"):int; //Namespace attribute method + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/IntsubExtIntClassImpDefInt/InternalClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/IntsubExtIntClassImpDefInt/InternalClass.as new file mode 100644 index 00000000000..3739c056899 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/IntsubExtIntClassImpDefInt/InternalClass.as @@ -0,0 +1,66 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Internal Class InternalClass + * Class methods + * + */ + +package InternalClassImpDefInt{ +use namespace ns; + + internal class InternalClass implements DefaultInt{ + + public function deffunc():String{ //Default method + return"PASSED"; + } + + public function pubFunc():Boolean{ //Public method + return true; + } + + ns function nsFunc(a="test"):int{ //Namespace method + return a.length; + } + + } + + + public class InternalClassAccesor extends InternalClass{ + + public function accdeffunc(){return deffunc();} + // access default function deffunc + + public function accnsFunc(a="test"){return ns::nsFunc(a);} + // access default function nsFunc + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/IntsubExtIntClassImpDefInt/InternalsubClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/IntsubExtIntClassImpDefInt/InternalsubClass.as new file mode 100644 index 00000000000..d3dfa2604df --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/IntsubExtIntClassImpDefInt/InternalsubClass.as @@ -0,0 +1,72 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Default Class DefaultClass + * Class methods + * + */ + +package InternalClassImpDefInt{ +use namespace ns; + + class InternalsubClass extends InternalClass{ + + + // function deffunc():String{ //Default method + // return "really"+"PASSED"; + //} + + + override public function pubFunc():Boolean{//Public method + + + return !true; + } + + ns override function nsFunc(a="test"):int{ //Namespace method + return a.length; + } + + } + + public class InternalsubClassAccessor extends InternalsubClass{ + + var IntSubClass = new InternalsubClass(); + var IntSupClass = new InternalClass(); + //public function accdeffunc(){return IntSubClass.deffunc();} + // access default function deffunc + //public function accsupdeffunc(){return IntSupClass.deffunc();} + + public function accnsFunc(a="test"){return ns::nsFunc(a);} + // access default function nsFunc + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/IntsubExtIntClassImpIntInt.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/IntsubExtIntClassImpIntInt.as new file mode 100644 index 00000000000..bcb7c0bc024 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/IntsubExtIntClassImpIntInt.as @@ -0,0 +1,55 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import InternalClassImpInternalInt.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Internal class implements default interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new IntsubExtIntClassImpIntInt(); + + +//Internal class extends Internal class that implements a internal interface with a public //method +AddTestCase("Internal class extends Internal class that implements a internal interface with a public method", true, obj.pubFunc()); + +//Internal class extends internal class that implements a internal interface with a //namespace //method +AddTestCase("Internal class extends internal class that implements a internal interface with a namespace method", 4, obj.accnsFunc()); + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/IntsubExtIntClassImpIntInt/IntsubExtIntClassImpIntInt.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/IntsubExtIntClassImpIntInt/IntsubExtIntClassImpIntInt.as new file mode 100644 index 00000000000..80592864937 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/IntsubExtIntClassImpIntInt/IntsubExtIntClassImpIntInt.as @@ -0,0 +1,91 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Internal Class InternalClass + * Class methods + * + */ + +package InternalClassImpInternalInt{ + + namespace ns; + + + internal interface InternalInt{ + + + + function pubFunc():Boolean; // attribute method + +// ns function nsFunc(a="test"):int; //Namespace attribute method + } + + + + internal class InternalClass implements InternalInt{ + + + + public function pubFunc():Boolean{ //Public method + return true; + } + + ns function nsFunc(a="test"):int{ //Namespace method + return a.length; + } + + } + + + class InternalsubClass extends InternalClass{ + + + + + + + + ns override function nsFunc(a="test"):int{ //Namespace method + return a.length; + } + + } + + public class IntsubExtIntClassImpIntInt extends InternalsubClass{ + + public function accnsFunc(a="test"){return ns::nsFunc(a);} + // access default function nsFunc + } + + + + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/IntsubExtIntClassImpPubInt.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/IntsubExtIntClassImpPubInt.as new file mode 100644 index 00000000000..f50b3b943a6 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/IntsubExtIntClassImpPubInt.as @@ -0,0 +1,57 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import InternalClassImpPublicInt.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Internal class implements public interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new IntsubExtIntClassImpPubInt(); + +//Internal class implements a public interface with a default method +//AddTestCase("Internal class implements a public interface with a default method", //"PASSED", obj.accdeffunc()); + +//Internal sub class extends Internal class that implements a public interface with a public //method +AddTestCase("Internal sub class extends Internal class that implements a public interface with a public method", true, obj.pubFunc()); + +//Internal sub class extends Internal class that implements a public interface with a //namespace method +AddTestCase("Internal class extends Internal class that implements a public interface with a namespace method", 4, obj.accnsFunc()); + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/IntsubExtIntClassImpPubInt/IntsubExtIntClassImpPubInt.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/IntsubExtIntClassImpPubInt/IntsubExtIntClassImpPubInt.as new file mode 100644 index 00000000000..5d519d2b97f --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/IntsubExtIntClassImpPubInt/IntsubExtIntClassImpPubInt.as @@ -0,0 +1,87 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Internal Class InternalClass + * Class methods + * + */ + +package InternalClassImpPublicInt{ +namespace ns; + + + public interface PublicInt{ + + + function pubFunc():Boolean; //attribute method + +// ns function nsFunc(a="test"):int; //Namespace attribute method + } + + internal class InternalClass implements PublicInt{ + + + public function pubFunc():Boolean{ //Public method + return true; + } + + ns function nsFunc(a="test"):int{ //Namespace method + return a.length; + } + + } + + + + class InternalsubClass extends InternalClass{ + + + + + + + + ns override function nsFunc(a="test"):int{ //Namespace method + return a.length; + } + + } + + public class IntsubExtIntClassImpPubInt extends InternalsubClass{ + + + + public function accnsFunc(a="test"){return ns::nsFunc(a);} + // access default function nsFunc + } + + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtIntClassImpIntIntExtIntPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtIntClassImpIntIntExtIntPub.as new file mode 100644 index 00000000000..f9296078d99 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtIntClassImpIntIntExtIntPub.as @@ -0,0 +1,101 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import PubClassExtIntClassImpIntIntExtIntPub.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Public class implements public interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new PublicSubClass(); +var obj2 = new InternalInterfaceAccessor(); +//use namespace ns; +var PubInt=obj; + +var PubInt2:PublicInt2=obj; + +//var PubInt3:PublicInt3=obj; +var dateObj:Date = new Date(0); +/*print(PubInt.MyString()); +print(PubInt5.MyString()); +print(PubInt2.MyNegInteger()); +print(PubInt6.MyNegInteger()); +//print(PubInt3.MyString()); +//print(PubInt7.MyString()); +print(PubInt3.MyNegInteger()); +print(PubInt7.MyNegInteger()); +print(PubInt3.MyUnsignedInteger()); +print(PubInt7.MyUnsignedInteger()); +print(obj.MyString()); +print(obj2.MyString()); +//print(obj.MyNegInteger()); +//print(obj2.MyNegInteger()); +print(obj.MyUnsignedInteger()); +print(obj2.MyUnsignedInteger()); +print(obj.PublicInt2::MyString()); +print(obj2.PublicInt2::MyString()); +print(PubInt3.MyNegativeInteger()); +print(PubInt7.MyNegativeInteger()); +print(obj.PublicInt3::MyNegativeInteger()); +print(obj2.PublicInt3::MyNegativeInteger());*/ +//print(obj.MySuperBoolean()); +//Public Class extends Public class implements a public interface which extends two //interfaces + +thisError="no error" +try{ + obj2.MyNegInteger(); + }catch(e2){ + thisError=e2.toString(); + }finally{ + AddTestCase("Calling a method in interface namespace through an instance of a class should throw an error","ReferenceError: Error #1069", referenceError(thisError)); + } +AddTestCase("Calling a method in public namespace in the public interface implemented by the subclass through the subclass","Hi!", PubInt.MyString()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",-100, obj2.RetMyNegInteger2()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",-100, obj2.RetMyNegInteger()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",100, obj2.RetMyUnsignedInteger()); +AddTestCase("Calling a method in public namespace in the public interface implemented by the subclass through the subclass","Hi!", obj.MyString()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",100, obj.MyUnsignedInteger()); +AddTestCase("Calling a method in public namespace in the public interface implemented by the subclass through the subclass","Hi!", obj.PublicInt2::MyString()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",-100000, obj.MyNegativeInteger()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",-100000, obj2.RetMyNegativeInteger()); +AddTestCase("Calling a public method in superclass extended by the subclass through the subclass",true, obj.RetMySuperBoolean()); +AddTestCase("Calling an internal method in superclass extended by the subclass through the subclass",10, obj.RetMySuperNumber()); +AddTestCase("Calling a public static method in superclass extended bythe subclass through the subclass",dateObj.toString(), obj.RetMySuperStaticDate()+""); + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtIntClassImpIntIntExtIntPub/PublicSubClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtIntClassImpIntIntExtIntPub/PublicSubClass.as new file mode 100644 index 00000000000..685e2861b43 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtIntClassImpIntIntExtIntPub/PublicSubClass.as @@ -0,0 +1,95 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package PubClassExtIntClassImpIntIntExtIntPub{ + internal interface PublicInt{ + function MyString():String; + } + public interface PublicInt2{ + function MyString():String; + function MyNegInteger():int; + } + internal interface PublicInt3 extends PublicInt,PublicInt2{ + function MyUnsignedInteger():uint; + function MyNegativeInteger():int; + } + internal class InternalSuperClass{ + public function MySuperBoolean():Boolean{return true;} + internal function MySuperNumber():Number{return 10;} + public static function MySuperStaticDate():Date {return new Date(0);} + + + } + + public class PublicSubClass extends InternalSuperClass implements PublicInt3{ + + public function MyString():String{ + return "Hi!"; + } + + public function MyNegInteger():int{ + var a:int = -100; + return a; + } + public function MyUnsignedInteger():uint{ + var postint:uint =100; + return postint; + } + public function MyNegativeInteger():int{ + var negint:int = -100000; + return negint; + } + public function RetMySuperNumber():Number{return MySuperNumber();} + public function RetMySuperBoolean():Boolean{return MySuperBoolean();} + public function RetMySuperStaticDate():Date{return MySuperStaticDate();} + + + } + + public class InternalInterfaceAccessor{ + var k = new PublicSubClass(); + + var PubInt3:PublicInt3 = k; + var PubInttwo:PublicInt2=k; + public function RetMyNegInteger():int{ + return PubInt3.MyNegInteger(); + } + public function RetMyNegInteger2():int{ + return PubInttwo.MyNegInteger(); + } + public function RetMyUnsignedInteger():uint{ + return PubInt3.MyUnsignedInteger(); + } + public function RetMyNegativeInteger():int{ + return k.PublicInt3::MyNegativeInteger()} + } + } + + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtIntClassImpIntIntExtPubPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtIntClassImpIntIntExtPubPub.as new file mode 100644 index 00000000000..a258304e33f --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtIntClassImpIntIntExtPubPub.as @@ -0,0 +1,101 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import PubClassExtIntClassImpIntIntExtPubPub.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Public class implements public interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new PublicSubClass(); +var obj2 = new InternalInterfaceAccessor(); +//use namespace ns; +var PubInt:PublicInt=obj; + +var PubInt2:PublicInt2=obj; + +//var PubInt3:PublicInt3=obj; +var dateObj:Date = new Date(0); +/*print(PubInt.MyString()); +print(PubInt5.MyString()); +print(PubInt2.MyNegInteger()); +print(PubInt6.MyNegInteger()); +//print(PubInt3.MyString()); +//print(PubInt7.MyString()); +print(PubInt3.MyNegInteger()); +print(PubInt7.MyNegInteger()); +print(PubInt3.MyUnsignedInteger()); +print(PubInt7.MyUnsignedInteger()); +print(obj.MyString()); +print(obj2.MyString()); +//print(obj.MyNegInteger()); +//print(obj2.MyNegInteger()); +print(obj.MyUnsignedInteger()); +print(obj2.MyUnsignedInteger()); +print(obj.PublicInt2::MyString()); +print(obj2.PublicInt2::MyString()); +print(PubInt3.MyNegativeInteger()); +print(PubInt7.MyNegativeInteger()); +print(obj.PublicInt3::MyNegativeInteger()); +print(obj2.PublicInt3::MyNegativeInteger());*/ +//print(obj.MySuperBoolean()); +//Public Class extends Public class implements a public interface which extends two //interfaces + +thisError="no error" +try{ + obj2.MyNegInteger(); + }catch(e2){ + thisError=e2.toString(); + }finally{ + AddTestCase("Calling a method in interface namespace through an instance of a class should throw an error","ReferenceError: Error #1069", referenceError(thisError)); + } +AddTestCase("Calling a method in public namespace in the public interface implemented by the subclass through the subclass","Hi!", PubInt.MyString()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",-100, obj2.RetMyNegInteger2()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",-100, obj2.RetMyNegInteger()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",100, obj2.RetMyUnsignedInteger()); +AddTestCase("Calling a method in public namespace in the public interface implemented by the subclass through the subclass","Hi!", obj.MyString()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",100, obj.MyUnsignedInteger()); +AddTestCase("Calling a method in public namespace in the public interface implemented by the subclass through the subclass","Hi!", obj.PublicInt2::MyString()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",-100000, obj.MyNegativeInteger()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",-100000, obj2.RetMyNegativeInteger()); +AddTestCase("Calling a public method in superclass extended by the subclass through the subclass",true, obj.RetMySuperBoolean()); +AddTestCase("Calling an internal method in superclass extended by the subclass through the subclass",10, obj.RetMySuperNumber()); +AddTestCase("Calling a public static method in superclass extended bythe subclass through the subclass",dateObj.toString(), obj.RetMySuperStaticDate()+""); + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtIntClassImpIntIntExtPubPub/PublicSubClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtIntClassImpIntIntExtPubPub/PublicSubClass.as new file mode 100644 index 00000000000..a61f3357832 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtIntClassImpIntIntExtPubPub/PublicSubClass.as @@ -0,0 +1,93 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package PubClassExtIntClassImpIntIntExtPubPub{ + public interface PublicInt{ + function MyString():String; + } + public interface PublicInt2{ + function MyString():String; + function MyNegInteger():int; + } + internal interface PublicInt3 extends PublicInt,PublicInt2{ + function MyUnsignedInteger():uint; + function MyNegativeInteger():int; + } + internal class InternalSuperClass{ + public function MySuperBoolean():Boolean{return true;} + internal function MySuperNumber():Number{return 10;} + public static function MySuperStaticDate():Date {return new Date(0);} + + + } + + public class PublicSubClass extends InternalSuperClass implements PublicInt3{ + + public function MyString():String{ + return "Hi!"; + } + + public function MyNegInteger():int{ + var a:int = -100; + return a; + } + public function MyUnsignedInteger():uint{ + var postint:uint =100; + return postint; + } + public function MyNegativeInteger():int{ + var negint:int = -100000; + return negint; + } + public function RetMySuperNumber():Number{return MySuperNumber();} + public function RetMySuperBoolean():Boolean{return MySuperBoolean();} + public function RetMySuperStaticDate():Date{return MySuperStaticDate();} + } + + public class InternalInterfaceAccessor{ + var k = new PublicSubClass(); + + var PubInt3:PublicInt3 = k; + var PubInttwo:PublicInt2=k; + public function RetMyNegInteger():int{ + return PubInt3.MyNegInteger(); + } + public function RetMyNegInteger2():int{ + return PubInttwo.MyNegInteger(); + } + public function RetMyUnsignedInteger():uint{ + return PubInt3.MyUnsignedInteger(); + } + public function RetMyNegativeInteger():int{ + return k.PublicInt3::MyNegativeInteger()} + } + } + + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtIntClassImpPubIntExtPubPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtIntClassImpPubIntExtPubPub.as new file mode 100644 index 00000000000..bce8498e315 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtIntClassImpPubIntExtPubPub.as @@ -0,0 +1,93 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import PubClassExtIntClassImpPubIntExtPubPub.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Public class implements public interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new PublicSubClass(); + +//use namespace ns; +var PubInt:PublicInt=obj; + +var PubInt2:PublicInt2=obj; + +var PubInt3:PublicInt3=obj; +var dateObj:Date = new Date(0); +/*print(PubInt.MyString()); +print(PubInt5.MyString()); +print(PubInt2.MyNegInteger()); +print(PubInt6.MyNegInteger()); +//print(PubInt3.MyString()); +//print(PubInt7.MyString()); +print(PubInt3.MyNegInteger()); +print(PubInt7.MyNegInteger()); +print(PubInt3.MyUnsignedInteger()); +print(PubInt7.MyUnsignedInteger()); +print(obj.MyString()); +print(obj2.MyString()); +//print(obj.MyNegInteger()); +//print(obj2.MyNegInteger()); +print(obj.MyUnsignedInteger()); +print(obj2.MyUnsignedInteger()); +print(obj.PublicInt2::MyString()); +print(obj2.PublicInt2::MyString()); +print(PubInt3.MyNegativeInteger()); +print(PubInt7.MyNegativeInteger()); +print(obj.PublicInt3::MyNegativeInteger()); +print(obj2.PublicInt3::MyNegativeInteger());*/ +//print(obj.MySuperBoolean()); +//Public Class extends Public class implements a public interface which extends two //interfaces + +AddTestCase("Calling a method in public namespace in the public interface implemented by the subclass through the subclass","Good Morning!", PubInt.MyString()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",-100, PubInt2.MyNegInteger()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",-100, PubInt3.MyNegInteger()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",100, PubInt3.MyUnsignedInteger()); +AddTestCase("Calling a method in public namespace in the public interface implemented by the subclass through the subclass","Good Morning!", obj.MyString()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",100, obj.MyUnsignedInteger()); +AddTestCase("Calling a method in public namespace in the public interface implemented by the subclass through the subclass","Good Morning!", obj.PublicInt2::MyString()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",-100000, PubInt3.MyNegativeInteger()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",-100000, obj.PublicInt3::MyNegativeInteger()); +AddTestCase("Calling a public method in superclass extended by the subclass through the subclass",true, obj.RetMySuperBoolean()); +AddTestCase("Calling an internal method in superclass extended by the subclass through the subclass",10, obj.RetMySuperNumber()); +AddTestCase("Calling a public static method in superclass extended bythe subclass through the subclass",dateObj.toString(), obj.RetMySuperStaticDate()+""); + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtIntClassImpPubIntExtPubPub/PublicSubClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtIntClassImpPubIntExtPubPub/PublicSubClass.as new file mode 100644 index 00000000000..eddcd6b8c05 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtIntClassImpPubIntExtPubPub/PublicSubClass.as @@ -0,0 +1,78 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package PubClassExtIntClassImpPubIntExtPubPub{ + public interface PublicInt{ + function MyString():String; + } + public interface PublicInt2{ + function MyString():String; + function MyNegInteger():int; + } + public interface PublicInt3 extends PublicInt,PublicInt2{ + function MyUnsignedInteger():uint; + function MyNegativeInteger():int; + } + internal class PublicSuperClass{ + public function MySuperBoolean():Boolean{return true;} + internal function MySuperNumber():Number{return 10;} + public static function MySuperStaticDate():Date {return new Date(0);} + + + } + + public class PublicSubClass extends PublicSuperClass implements PublicInt3{ + var s = new PublicSuperClass(); + + public function MyString():String{ + return "Good Morning!"; + } + public function MyNegInteger():int{ + var a:int = -100; + return a; + } + public function MyUnsignedInteger():uint{ + var postint:uint =100; + return postint; + } + public function MyNegativeInteger():int{ + var negint:int = -100000; + return negint; + } + public function RetMySuperNumber():Number{return MySuperNumber();} + public function RetMySuperBoolean():Boolean{return MySuperBoolean();} + public function RetMySuperStaticDate():Date{return MySuperStaticDate();} + + } + + + } + + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtPubClassImpIntIntExtIntPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtPubClassImpIntIntExtIntPub.as new file mode 100644 index 00000000000..25e870341db --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtPubClassImpIntIntExtIntPub.as @@ -0,0 +1,101 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import PubClassExtPubClassImpIntIntExtIntPub.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Public class implements public interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new PublicSubClass(); +var obj2 = new InternalInterfaceAccessor(); +//use namespace ns; +var PubInt=obj; + +var PubInt2:PublicInt2=obj; + +//var PubInt3:PublicInt3=obj; +var dateObj:Date = new Date(0); +/*print(PubInt.MyString()); +print(PubInt5.MyString()); +print(PubInt2.MyNegInteger()); +print(PubInt6.MyNegInteger()); +//print(PubInt3.MyString()); +//print(PubInt7.MyString()); +print(PubInt3.MyNegInteger()); +print(PubInt7.MyNegInteger()); +print(PubInt3.MyUnsignedInteger()); +print(PubInt7.MyUnsignedInteger()); +print(obj.MyString()); +print(obj2.MyString()); +//print(obj.MyNegInteger()); +//print(obj2.MyNegInteger()); +print(obj.MyUnsignedInteger()); +print(obj2.MyUnsignedInteger()); +print(obj.PublicInt2::MyString()); +print(obj2.PublicInt2::MyString()); +print(PubInt3.MyNegativeInteger()); +print(PubInt7.MyNegativeInteger()); +print(obj.PublicInt3::MyNegativeInteger()); +print(obj2.PublicInt3::MyNegativeInteger());*/ +//print(obj.MySuperBoolean()); +//Public Class extends Public class implements a public interface which extends two //interfaces + +thisError="no error" +try{ + obj2.MyNegInteger(); + }catch(e2){ + thisError=e2.toString(); + }finally{ + AddTestCase("Calling a method in interface namespace through an instance of a class should throw an error","ReferenceError: Error #1069", referenceError(thisError)); + } +AddTestCase("Calling a method in public namespace in the public interface implemented by the subclass through the subclass","Hi!", PubInt.MyString()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",-100, obj2.RetMyNegInteger2()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",-100, obj2.RetMyNegInteger()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",100, obj2.RetMyUnsignedInteger()); +AddTestCase("Calling a method in public namespace in the public interface implemented by the subclass through the subclass","Hi!", obj.MyString()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",100, obj.MyUnsignedInteger()); +AddTestCase("Calling a method in public namespace in the public interface implemented by the subclass through the subclass","Hi!", obj.PublicInt2::MyString()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",-100000, obj.MyNegativeInteger()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",-100000, obj2.RetMyNegativeInteger()); +AddTestCase("Calling a public method in superclass extended by the subclass through the subclass",true, obj.MySuperBoolean()); +AddTestCase("Calling an internal method in superclass extended by the subclass through the subclass",10, obj.RetMySuperNumber()); +AddTestCase("Calling a public static method in superclass extended bythe subclass through the subclass",dateObj.toString(), PublicSuperClass.MySuperStaticDate()+""); + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtPubClassImpIntIntExtIntPub/PublicSubClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtPubClassImpIntIntExtIntPub/PublicSubClass.as new file mode 100644 index 00000000000..56cbe0311c2 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtPubClassImpIntIntExtIntPub/PublicSubClass.as @@ -0,0 +1,92 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package PubClassExtPubClassImpIntIntExtIntPub{ + internal interface PublicInt{ + function MyString():String; + } + public interface PublicInt2{ + function MyString():String; + function MyNegInteger():int; + } + internal interface PublicInt3 extends PublicInt,PublicInt2{ + function MyUnsignedInteger():uint; + function MyNegativeInteger():int; + } + public class PublicSuperClass{ + public function MySuperBoolean():Boolean{return true;} + internal function MySuperNumber():Number{return 10;} + public static function MySuperStaticDate():Date {return new Date(0);} + + + } + + public class PublicSubClass extends PublicSuperClass implements PublicInt3{ + + public function MyString():String{ + return "Hi!"; + } + + public function MyNegInteger():int{ + var a:int = -100; + return a; + } + public function MyUnsignedInteger():uint{ + var postint:uint =100; + return postint; + } + public function MyNegativeInteger():int{ + var negint:int = -100000; + return negint; + } + public function RetMySuperNumber():Number{return MySuperNumber();} + + } + + public class InternalInterfaceAccessor{ + var k = new PublicSubClass(); + + var PubInt3:PublicInt3 = k; + var PubInttwo:PublicInt2=k; + public function RetMyNegInteger():int{ + return PubInt3.MyNegInteger(); + } + public function RetMyNegInteger2():int{ + return PubInttwo.MyNegInteger(); + } + public function RetMyUnsignedInteger():uint{ + return PubInt3.MyUnsignedInteger(); + } + public function RetMyNegativeInteger():int{ + return k.PublicInt3::MyNegativeInteger()} + } + } + + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtPubClassImpIntIntExtPubPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtPubClassImpIntIntExtPubPub.as new file mode 100644 index 00000000000..827dab70f8a --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtPubClassImpIntIntExtPubPub.as @@ -0,0 +1,101 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import PubClassExtPubClassImpIntIntExtPubPub.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Public class implements public interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new PublicSubClass(); +var obj2 = new InternalInterfaceAccessor(); +//use namespace ns; +var PubInt:PublicInt=obj; + +var PubInt2:PublicInt2=obj; + +//var PubInt3:PublicInt3=obj; +var dateObj:Date = new Date(0); +/*print(PubInt.MyString()); +print(PubInt5.MyString()); +print(PubInt2.MyNegInteger()); +print(PubInt6.MyNegInteger()); +//print(PubInt3.MyString()); +//print(PubInt7.MyString()); +print(PubInt3.MyNegInteger()); +print(PubInt7.MyNegInteger()); +print(PubInt3.MyUnsignedInteger()); +print(PubInt7.MyUnsignedInteger()); +print(obj.MyString()); +print(obj2.MyString()); +//print(obj.MyNegInteger()); +//print(obj2.MyNegInteger()); +print(obj.MyUnsignedInteger()); +print(obj2.MyUnsignedInteger()); +print(obj.PublicInt2::MyString()); +print(obj2.PublicInt2::MyString()); +print(PubInt3.MyNegativeInteger()); +print(PubInt7.MyNegativeInteger()); +print(obj.PublicInt3::MyNegativeInteger()); +print(obj2.PublicInt3::MyNegativeInteger());*/ +//print(obj.MySuperBoolean()); +//Public Class extends Public class implements a public interface which extends two //interfaces + +thisError="no error" +try{ + obj2.MyNegInteger(); + }catch(e2){ + thisError=e2.toString(); + }finally{ + AddTestCase("Calling a method in interface namespace through an instance of a class should throw an error","ReferenceError: Error #1069", referenceError(thisError)); + } +AddTestCase("Calling a method in public namespace in the public interface implemented by the subclass through the subclass","Hi!", PubInt.MyString()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",-100, obj2.RetMyNegInteger2()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",-100, obj2.RetMyNegInteger()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",100, obj2.RetMyUnsignedInteger()); +AddTestCase("Calling a method in public namespace in the public interface implemented by the subclass through the subclass","Hi!", obj.MyString()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",100, obj.MyUnsignedInteger()); +AddTestCase("Calling a method in public namespace in the public interface implemented by the subclass through the subclass","Hi!", obj.PublicInt2::MyString()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",-100000, obj.MyNegativeInteger()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",-100000, obj2.RetMyNegativeInteger()); +AddTestCase("Calling a public method in superclass extended by the subclass through the subclass",true, obj.MySuperBoolean()); +AddTestCase("Calling an internal method in superclass extended by the subclass through the subclass",10, obj.RetMySuperNumber()); +AddTestCase("Calling a public static method in superclass extended bythe subclass through the subclass",dateObj.toString(), PublicSuperClass.MySuperStaticDate()+""); + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtPubClassImpIntIntExtPubPub/PublicSubClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtPubClassImpIntIntExtPubPub/PublicSubClass.as new file mode 100644 index 00000000000..9de9b1f74ee --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtPubClassImpIntIntExtPubPub/PublicSubClass.as @@ -0,0 +1,92 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package PubClassExtPubClassImpIntIntExtPubPub{ + public interface PublicInt{ + function MyString():String; + } + public interface PublicInt2{ + function MyString():String; + function MyNegInteger():int; + } + internal interface PublicInt3 extends PublicInt,PublicInt2{ + function MyUnsignedInteger():uint; + function MyNegativeInteger():int; + } + public class PublicSuperClass{ + public function MySuperBoolean():Boolean{return true;} + internal function MySuperNumber():Number{return 10;} + public static function MySuperStaticDate():Date {return new Date(0);} + + + } + + public class PublicSubClass extends PublicSuperClass implements PublicInt3{ + + public function MyString():String{ + return "Hi!"; + } + + public function MyNegInteger():int{ + var a:int = -100; + return a; + } + public function MyUnsignedInteger():uint{ + var postint:uint =100; + return postint; + } + public function MyNegativeInteger():int{ + var negint:int = -100000; + return negint; + } + public function RetMySuperNumber():Number{return MySuperNumber();} + + } + + public class InternalInterfaceAccessor{ + var k = new PublicSubClass(); + + var PubInt3:PublicInt3 = k; + var PubInttwo:PublicInt2=k; + public function RetMyNegInteger():int{ + return PubInt3.MyNegInteger(); + } + public function RetMyNegInteger2():int{ + return PubInttwo.MyNegInteger(); + } + public function RetMyUnsignedInteger():uint{ + return PubInt3.MyUnsignedInteger(); + } + public function RetMyNegativeInteger():int{ + return k.PublicInt3::MyNegativeInteger()} + } + } + + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtPubClassImpPubIntExtIntPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtPubClassImpPubIntExtIntPub.as new file mode 100644 index 00000000000..0b4257540af --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtPubClassImpPubIntExtIntPub.as @@ -0,0 +1,93 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import PubClassExtPubClassImpPubIntExtIntPub.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Public class implements public interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new PublicSubClass(); + +//use namespace ns; +var PubInt=obj; + +var PubInt2:PublicInt2=obj; + +var PubInt3:PublicInt3=obj; +var dateObj:Date = new Date(0); +/*print(PubInt.MyString()); +print(PubInt5.MyString()); +print(PubInt2.MyNegInteger()); +print(PubInt6.MyNegInteger()); +//print(PubInt3.MyString()); +//print(PubInt7.MyString()); +print(PubInt3.MyNegInteger()); +print(PubInt7.MyNegInteger()); +print(PubInt3.MyUnsignedInteger()); +print(PubInt7.MyUnsignedInteger()); +print(obj.MyString()); +print(obj2.MyString()); +//print(obj.MyNegInteger()); +//print(obj2.MyNegInteger()); +print(obj.MyUnsignedInteger()); +print(obj2.MyUnsignedInteger()); +print(obj.PublicInt2::MyString()); +print(obj2.PublicInt2::MyString()); +print(PubInt3.MyNegativeInteger()); +print(PubInt7.MyNegativeInteger()); +print(obj.PublicInt3::MyNegativeInteger()); +print(obj2.PublicInt3::MyNegativeInteger());*/ +//print(obj.MySuperBoolean()); +//Public Class extends Public class implements a public interface which extends two //interfaces + +AddTestCase("Calling a method in public namespace in the public interface implemented by the subclass through the subclass","Hi!", PubInt.MyString()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",-100, PubInt2.MyNegInteger()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",-100, PubInt3.MyNegInteger()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",100, PubInt3.MyUnsignedInteger()); +AddTestCase("Calling a method in public namespace in the public interface implemented by the subclass through the subclass","Hi!", obj.MyString()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",100, obj.MyUnsignedInteger()); +AddTestCase("Calling a method in public namespace in the public interface implemented by the subclass through the subclass","Hi!", obj.PublicInt2::MyString()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",-100000, PubInt3.MyNegativeInteger()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",-100000, obj.PublicInt3::MyNegativeInteger()); +AddTestCase("Calling a public method in superclass extended by the subclass through the subclass",true, obj.MySuperBoolean()); +AddTestCase("Calling an internal method in superclass extended by the subclass through the subclass",10, obj.RetMySuperNumber()); +AddTestCase("Calling a public static method in superclass extended bythe subclass through the subclass",dateObj.toString(), PublicSuperClass.MySuperStaticDate()+""); + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtPubClassImpPubIntExtIntPub/PublicSubClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtPubClassImpPubIntExtIntPub/PublicSubClass.as new file mode 100644 index 00000000000..c2fb7541baa --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtPubClassImpPubIntExtIntPub/PublicSubClass.as @@ -0,0 +1,76 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package PubClassExtPubClassImpPubIntExtIntPub{ + internal interface PublicInt{ + function MyString():String; + } + public interface PublicInt2{ + function MyString():String; + function MyNegInteger():int; + } + public interface PublicInt3 extends PublicInt,PublicInt2{ + function MyUnsignedInteger():uint; + function MyNegativeInteger():int; + } + public class PublicSuperClass{ + public function MySuperBoolean():Boolean{return true;} + internal function MySuperNumber():Number{return 10;} + public static function MySuperStaticDate():Date {return new Date(0);} + + + } + + public class PublicSubClass extends PublicSuperClass implements PublicInt3{ + var s = new PublicSuperClass(); + public function MyString():String{ + return "Hi!"; + } + + public function MyNegInteger():int{ + var a:int = -100; + return a; + } + public function MyUnsignedInteger():uint{ + var postint:uint =100; + return postint; + } + public function MyNegativeInteger():int{ + var negint:int = -100000; + return negint; + } + public function RetMySuperNumber():Number{return MySuperNumber();} + + } + + + } + + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtPubClassImpPubIntExtPubPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtPubClassImpPubIntExtPubPub.as new file mode 100644 index 00000000000..1dc71a641a6 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtPubClassImpPubIntExtPubPub.as @@ -0,0 +1,97 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import PubClassExtPubClassImpPubIntExtPubPub.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Public class implements public interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new PublicSuperClass(); +var obj2 = new PublicSubClass(); +//use namespace ns; +var PubInt:PublicInt=obj; +var PubInt5:PublicInt=obj2; +var PubInt2:PublicInt2=obj; +var PubInt6:PublicInt2=obj2; +var PubInt3:PublicInt3=obj; +var PubInt7:PublicInt3=obj2; +/*print(PubInt.MyString()); +print(PubInt5.MyString()); +print(PubInt2.MyNegInteger()); +print(PubInt6.MyNegInteger()); +//print(PubInt3.MyString()); +//print(PubInt7.MyString()); +print(PubInt3.MyNegInteger()); +print(PubInt7.MyNegInteger()); +print(PubInt3.MyUnsignedInteger()); +print(PubInt7.MyUnsignedInteger()); +print(obj.MyString()); +print(obj2.MyString()); +//print(obj.MyNegInteger()); +//print(obj2.MyNegInteger()); +print(obj.MyUnsignedInteger()); +print(obj2.MyUnsignedInteger()); +print(obj.PublicInt2::MyString()); +print(obj2.PublicInt2::MyString()); +print(PubInt3.MyNegativeInteger()); +print(PubInt7.MyNegativeInteger()); +print(obj.PublicInt3::MyNegativeInteger()); +print(obj2.PublicInt3::MyNegativeInteger());*/ +//Public Class extends Public class implements a public interface which extends two //interfaces + +AddTestCase("Calling a method in public namespace in the public interface implemented by the superclass through the superclass","Hi!", PubInt.MyString()); +AddTestCase("Calling a method in public namespace in the public interface implemented by the superclass through the subclass","Hi!", PubInt5.MyString()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the superclass through the superclass",-100, PubInt2.MyNegInteger()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the superclass through the subclass",-100, PubInt6.MyNegInteger()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the superclass through the superclass",-100, PubInt3.MyNegInteger()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the superclass through the subclass",-100, PubInt7.MyNegInteger()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the superclass through the superclass",100, PubInt3.MyUnsignedInteger()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the superclass through the subclass",100, PubInt7.MyUnsignedInteger()); +AddTestCase("Calling a method in public namespace in the public interface implemented by the superclass through the superclass","Hi!", obj.MyString()); +AddTestCase("Calling a method in public namespace in the public interface implemented by the superclass through the subclass","Hi!", obj2.MyString()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the superclass through the superclass",100, obj.MyUnsignedInteger()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the superclass through the subclass",100, obj2.MyUnsignedInteger()); +AddTestCase("Calling a method in public namespace in the public interface implemented by the superclass through the superclass","Hi!", obj.PublicInt2::MyString()); +AddTestCase("Calling a method in public namespace in the public interface implemented by the superclass through the subclass","Hi!", obj2.PublicInt2::MyString()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the superclass through the superclass",-100000, PubInt3.MyNegativeInteger()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the superclass through the subclass",-100000, PubInt7.MyNegativeInteger()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the superclass through the superclass",-100000, obj.PublicInt3::MyNegativeInteger()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the superclass through the subclass",-100000, obj2.PublicInt3::MyNegativeInteger()); +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtPubClassImpPubIntExtPubPub/PublicSuperClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtPubClassImpPubIntExtPubPub/PublicSuperClass.as new file mode 100644 index 00000000000..9c843cb2e88 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtPubClassImpPubIntExtPubPub/PublicSuperClass.as @@ -0,0 +1,68 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package PubClassExtPubClassImpPubIntExtPubPub{ + public interface PublicInt{ + function MyString():String; + } + public interface PublicInt2{ + function MyString():String; + function MyNegInteger():int; + } + public interface PublicInt3 extends PublicInt,PublicInt2{ + function MyUnsignedInteger():uint; + function MyNegativeInteger():int; + } + + public class PublicSuperClass implements PublicInt3{ + + public function MyString():String{ + return "Hi!"; + } + + public function MyNegInteger():int{ + var a:int = -100; + return a; + } + public function MyUnsignedInteger():uint{ + var postint:uint =100; + return postint; + } + public function MyNegativeInteger():int{ + var negint:int = -100000; + return negint; + } + + } + + public class PublicSubClass extends PublicSuperClass{} + } + + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtPubClassImpPubIntExtPubPub2.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtPubClassImpPubIntExtPubPub2.as new file mode 100644 index 00000000000..9657e90b97d --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtPubClassImpPubIntExtPubPub2.as @@ -0,0 +1,94 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import PubClassExtPubClassImpPubIntExtPubPub2.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Public class implements public interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new PublicSubClass(); + +//use namespace ns; +var PubInt:PublicInt=obj; + +var PubInt2:PublicInt2=obj; + +var PubInt3:PublicInt3=obj; +var dateObj:Date = new Date(0); +//print(obj.MyNegInteger()); +/*print(PubInt.MyString()); +print(PubInt5.MyString()); +print(PubInt2.MyNegInteger()); +print(PubInt6.MyNegInteger()); +//print(PubInt3.MyString()); +//print(PubInt7.MyString()); +print(PubInt3.MyNegInteger()); +print(PubInt7.MyNegInteger()); +print(PubInt3.MyUnsignedInteger()); +print(PubInt7.MyUnsignedInteger()); +print(obj.MyString()); +print(obj2.MyString()); +//print(obj.MyNegInteger()); +//print(obj2.MyNegInteger()); +print(obj.MyUnsignedInteger()); +print(obj2.MyUnsignedInteger()); +print(obj.PublicInt2::MyString()); +print(obj2.PublicInt2::MyString()); +print(PubInt3.MyNegativeInteger()); +print(PubInt7.MyNegativeInteger()); +print(obj.PublicInt3::MyNegativeInteger()); +print(obj2.PublicInt3::MyNegativeInteger());*/ +//print(obj.MySuperBoolean()); +//Public Class extends Public class implements a public interface which extends two //interfaces + +AddTestCase("Calling a method in public namespace in the public interface implemented by the subclass through the subclass","Hi!", PubInt.MyString()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",-100, PubInt2.MyNegInteger()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",-100, PubInt3.MyNegInteger()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",100, PubInt3.MyUnsignedInteger()); +AddTestCase("Calling a method in public namespace in the public interface implemented by the subclass through the subclass","Hi!", obj.MyString()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",100, obj.MyUnsignedInteger()); +AddTestCase("Calling a method in public namespace in the public interface implemented by the subclass through the subclass","Hi!", obj.PublicInt2::MyString()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",-100000, PubInt3.MyNegativeInteger()); +AddTestCase("Calling a method in interface namespace in the public interface implemented by the subclass through the subclass",-100000, obj.PublicInt3::MyNegativeInteger()); +AddTestCase("Calling a public method in superclass extended by the subclass through the subclass",true, obj.MySuperBoolean()); +AddTestCase("Calling an internal method in superclass extended by the subclass through the subclass",10, obj.RetMySuperNumber()); +AddTestCase("Calling a public static method in superclass extended bythe subclass through the subclass",dateObj.toString(), PublicSuperClass.MySuperStaticDate()+""); + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtPubClassImpPubIntExtPubPub2/PublicSubClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtPubClassImpPubIntExtPubPub2/PublicSubClass.as new file mode 100644 index 00000000000..67cb1731b04 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubClassExtPubClassImpPubIntExtPubPub2/PublicSubClass.as @@ -0,0 +1,76 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package PubClassExtPubClassImpPubIntExtPubPub2{ + public interface PublicInt{ + function MyString():String; + } + public interface PublicInt2{ + function MyString():String; + function MyNegInteger():int; + } + public interface PublicInt3 extends PublicInt,PublicInt2{ + function MyUnsignedInteger():uint; + function MyNegativeInteger():int; + } + public class PublicSuperClass{ + public function MySuperBoolean():Boolean{return true;} + internal function MySuperNumber():Number{return 10;} + public static function MySuperStaticDate():Date {return new Date(0);} + + + } + + public class PublicSubClass extends PublicSuperClass implements PublicInt3{ + var s = new PublicSuperClass(); + public function MyString():String{ + return "Hi!"; + } + + public function MyNegInteger():int{ + var a:int = -100; + return a; + } + public function MyUnsignedInteger():uint{ + var postint:uint =100; + return postint; + } + public function MyNegativeInteger():int{ + var negint:int = -100000; + return negint; + } + public function RetMySuperNumber():Number{return MySuperNumber();} + + } + + + } + + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDefaultImplDefDefPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDefaultImplDefDefPub.as new file mode 100644 index 00000000000..516afe8dbc0 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDefaultImplDefDefPub.as @@ -0,0 +1,79 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "Clean AS2"; // Version of JavaScript or ECMA +var TITLE = "Extend Default Class Implement Default interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +import DefaultClass.*; + +var PUBEXTDEFIMPLDEFDEFPUB = new PubExtDefaultImplDefDefPub(); + +// ******************************************* +// define default method from interface as a +// public method in the sub class +// ******************************************* +//var i:DefaultInt=PUBEXTDEFIMPLDEFDEFPUB; +//var j:DefaultIntDef=PUBEXTDEFIMPLDEFDEFPUB; +var k = new PubExtDefaultImplDefDefPubAccessor(); +//AddTestCase( "*** default() method implemented interface ***", 1, 1 ); +//AddTestCase( "PUBEXTDEFIMPLDEFDEFPUB.setBoolean(false), PUBEXTDEFIMPLDEFDEFPUB.iiGetBoolean()", false, k.acciiGetBoolean() ); +//AddTestCase( "PUBEXTDEFIMPLDEFDEFPUB.setBoolean(true), PUBEXTDEFIMPLDEFDEFPUB.jiGetBoolean()", true, k.accjiGetBoolean()); + +// ******************************************* +// define public method from interface as a +// public method in the sub class +// ******************************************* + +AddTestCase( "*** public method implemented interface ***", 1, 1 ); +AddTestCase( "PUBEXTDEFIMPLDEFDEFPUB.setPubBoolean(false), PUBEXTDEFIMPLDEFDEFPUB.iGetPubBoolean()", false, (PUBEXTDEFIMPLDEFDEFPUB.setPubBoolean(false), PUBEXTDEFIMPLDEFDEFPUB.iGetPubBoolean()) ); +AddTestCase( "PUBEXTDEFIMPLDEFDEFPUB.setPubBoolean(true), PUBEXTDEFIMPLDEFDEFPUB.iGetPubBoolean()", true, (PUBEXTDEFIMPLDEFDEFPUB.setPubBoolean(true), PUBEXTDEFIMPLDEFDEFPUB.iGetPubBoolean()) ); + +// ******************************************* +// define default method from interface 2 as a +// public method in the sub class +// ******************************************* + +//AddTestCase( "*** default() method implemented interface 2 ***", 1, 1 ); +AddTestCase( "PUBEXTDEFIMPLDEFDEFPUB.setNumber(420), PUBEXTDEFIMPLDEFDEFPUB.iiGetNumber()", 420, k.acciiGetNumber() ); +AddTestCase( "PUBEXTDEFIMPLDEFDEFPUB.setNumber(420), PUBEXTDEFIMPLDEFDEFPUB.jiGetNumber()", 420, k.accjiGetNumber() ); +// ******************************************* +// define public method from interface 2 as a +// public method in the sub class +// ******************************************* + +AddTestCase( "*** public method implemented interface 2 ***", 1, 1 ); +AddTestCase( "PUBEXTDEFIMPLDEFDEFPUB.setPubNumber(14), PUBEXTDEFIMPLDEFDEFPUB.iGetPubNumber()", 14, (PUBEXTDEFIMPLDEFDEFPUB.setPubNumber(14), PUBEXTDEFIMPLDEFDEFPUB.iGetPubNumber()) ); + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDefaultImplDefDefPub/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDefaultImplDefDefPub/DefaultClass.as new file mode 100644 index 00000000000..68d3d9dd4c3 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDefaultImplDefDefPub/DefaultClass.as @@ -0,0 +1,251 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DefaultClass { + + class DefaultClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + + internal var finArray:Array; + internal var finBoolean:Boolean; + internal var finDate:Date; + internal var finFunction:Function; + internal var finMath:Math; + internal var finNumber:Number; + internal var finObject:Object; + internal var finString:String; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { + number = n; + } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + } + + public class DefaultClass extends DefaultClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDefaultImplDefDefPub/DefaultInt.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDefaultImplDefDefPub/DefaultInt.as new file mode 100644 index 00000000000..cfb2a138c14 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDefaultImplDefDefPub/DefaultInt.as @@ -0,0 +1,40 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DefaultClass { + + interface DefaultInt { + + function iGetNumber():Number + function iGetBoolean(): Boolean + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDefaultImplDefDefPub/DefaultIntDef.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDefaultImplDefDefPub/DefaultIntDef.as new file mode 100644 index 00000000000..0dc1a5d7f78 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDefaultImplDefDefPub/DefaultIntDef.as @@ -0,0 +1,41 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DefaultClass { + + interface DefaultIntDef { + + function iGetBoolean() : Boolean + function iGetNumber() : Number + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDefaultImplDefDefPub/PubExtDefaultImplDefDefPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDefaultImplDefDefPub/PubExtDefaultImplDefDefPub.as new file mode 100644 index 00000000000..27fd41b010d --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDefaultImplDefDefPub/PubExtDefaultImplDefDefPub.as @@ -0,0 +1,130 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DefaultClass { + +import DefaultClass.*; + +public class PubExtDefaultImplDefDefPub extends DefaultClass implements DefaultIntDef, DefaultInt { + + // **************************************** + // define a default definition from + // default interface as a default method + // **************************************** + + public function iGetBoolean() : Boolean { return true; } + + // **************************************** + // define a public defintion from + // default interface as a default method + // **************************************** + + public function iGetPubBoolean() : Boolean { return this.pubBoolean; } + + // **************************************** + // define a default definition from + // default interface 2 as a default method + // **************************************** + + public function iGetNumber() : Number { return 420; } + + // **************************************** + // define a public defintion from + // default interface 2 as a default method + // **************************************** + + public function iGetPubNumber() : Number { return this.pubNumber; } + + // ************************************ + // access public method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return this.getPubArray(); } + function subSetArray(a:Array) { this.setPubArray(a); } + + public function testGetSubArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + + // ************************************ + // access public method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return this.getPubArray(); } + public function pubSubSetArray(a:Array) { this.setPubArray(a); } + + // ************************************ + // access public method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return this.getPubArray(); } + private function privSubSetArray(a:Array) { this.setPubArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + // ************************************ + // access public method of parent + // from final method of sub class + // ************************************ + + final function finSubGetArray() : Array { return this.getPubArray(); } + final function finSubSetArray(a:Array) { this.setPubArray(a); } + + // function to test above from test scripts + public function testFinSubArray(a:Array) : Array { + this.finSubSetArray(a); + return this.finSubGetArray(); + } + + + + } + +public class PubExtDefaultImplDefDefPubAccessor{ +var s = new PubExtDefaultImplDefDefPub(); +var i:DefaultInt=s; +var j:DefaultIntDef=s; + +public function acciiGetBoolean():Boolean{return i.iGetBoolean();} +public function acciiGetNumber():Number{return i.iGetNumber();} +public function accjiGetBoolean():Boolean{return s.DefaultIntDef::iGetBoolean();} +public function accjiGetNumber():Number{return s.DefaultIntDef::iGetNumber();} +} +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDefaultImplDefDefPubStat.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDefaultImplDefDefPubStat.as new file mode 100644 index 00000000000..9bcca04abf9 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDefaultImplDefDefPubStat.as @@ -0,0 +1,64 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "Clean AS2"; // Version of JavaScript or ECMA +var TITLE = "Extend Default Class Implement 2 Default Interfaces"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +import DefaultClass.*; + +arr = new Array(1, 2, 3); + +var THISTEST = new PubExtDefaultImplDefDefPubStat(); + +// ******************************************* +// define public method from interface as a +// public method in the sub class +// ******************************************* + +AddTestCase( "*** public method implemented interface ***", 1, 1 ); +AddTestCase( "THISTEST.setPubBoolean(false), THISTEST.iGetPubBoolean()", false, (THISTEST.setPubBoolean(false), THISTEST.iGetPubBoolean()) ); +AddTestCase( "THISTEST.setPubBoolean(true), THISTEST.iGetPubBoolean()", true, (THISTEST.setPubBoolean(true), THISTEST.iGetPubBoolean()) ); + + +// ******************************************* +// define public method from interface 2 as a +// public method in the sub class +// ******************************************* + +AddTestCase( "*** public method implemented interface 2 ***", 1, 1 ); +AddTestCase( "THISTEST.setPubNumber(14), THISTEST.iGetPubNumber()", 14, (THISTEST.setPubNumber(14), THISTEST.iGetPubNumber()) ); + + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDefaultImplDefDefPubStat/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDefaultImplDefDefPubStat/DefaultClass.as new file mode 100644 index 00000000000..62a20ba15b0 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDefaultImplDefDefPubStat/DefaultClass.as @@ -0,0 +1,264 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DefaultClass { + + class DefaultClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + //public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + var finArray:Array; + var finBoolean:Boolean; + var finDate:Date; + var finFunction:Function; + var finMath:Math; + var finNumber:Number; + var finObject:Object; + var finString:String; + //var finSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + } + + public class DefaultClass extends DefaultClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDefaultImplDefDefPubStat/DefaultInt.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDefaultImplDefDefPubStat/DefaultInt.as new file mode 100644 index 00000000000..71ad46df7d9 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDefaultImplDefDefPubStat/DefaultInt.as @@ -0,0 +1,40 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DefaultClass { + + interface DefaultInt { + + function iGetBoolean() : Boolean + //public function iGetPubBoolean() : Boolean + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDefaultImplDefDefPubStat/DefaultIntDef.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDefaultImplDefDefPubStat/DefaultIntDef.as new file mode 100644 index 00000000000..4992615f69a --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDefaultImplDefDefPubStat/DefaultIntDef.as @@ -0,0 +1,41 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DefaultClass { + + interface DefaultIntDef { + + function iGetBoolean() : Boolean + // public function iGetPubBoolean() : Boolean + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDefaultImplDefDefPubStat/PubExtDefaultImplDefDefPubStat.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDefaultImplDefDefPubStat/PubExtDefaultImplDefDefPubStat.as new file mode 100644 index 00000000000..e1dd33a0c0c --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDefaultImplDefDefPubStat/PubExtDefaultImplDefDefPubStat.as @@ -0,0 +1,239 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DefaultClass { + +import DefaultClass.*; + +public class PubExtDefaultImplDefDefPubStat extends DefaultClass implements DefaultIntDef, DefaultInt { + + +// **************************************** + // define a default definition from + // default interface as a default method + // **************************************** + + public function iGetBoolean() : Boolean { return boolean; } + + // **************************************** + // define a public defintion from + // default interface as a default method + // **************************************** + + public function iGetPubBoolean() : Boolean { return pubBoolean; } + + // **************************************** + // define a default definition from + // default interface 2 as a default method + // **************************************** + + public function iGetNumber() : Number { return number; } + + // **************************************** + // define a public defintion from + // default interface 2 as a default method + // **************************************** + + public function iGetPubNumber() : Number { return pubNumber; } + + // ************************************ + // access public static method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return getPubStatArray(); } + function subSetArray(a:Array) { setPubStatArray(a); } + + public function testSubGetSetArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + + // ************************************ + // access public static method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return getPubStatArray(); } + public function pubSubSetArray(a:Array) { setPubStatArray(a); } + + // ************************************ + // access public static method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return getPubStatArray(); } + private function privSubSetArray(a:Array) { setPubStatArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + // ************************************ + // access public static method of parent + // from final method of sub class + // ************************************ + + final function finSubGetArray() : Array { return getPubStatArray(); } + final function finSubSetArray(a:Array) { setPubStatArray(a); } + + public function testFinSubArray(a:Array):Array { + this.finSubSetArray(a); + return this.finSubGetArray(); + } + + + // *************************************** + // access public static method of parent + // from static method of sub class + // *************************************** + + static function statSubGetArray() : Array { return getPubStatArray(); } + static function statSubSetArray(a:Array) { setPubStatArray(a); } + + public static function testStatSubArray(a:Array):Array { + statSubSetArray(a); + return statSubGetArray(); + } + + + // *************************************** + // access public static method of parent + // from public static method of sub class + // *************************************** + + public static function pubStatSubGetArray() : Array { return getPubStatArray(); } + public static function pubStatSubSetArray(a:Array) { setPubStatArray(a); } + + // *************************************** + // access public static method of parent + // from private static method of sub class + // *************************************** + + private static function privStatSubGetArray() : Array { return getPubStatArray(); } + private static function privStatSubSetArray(a:Array) { setPubStatArray(a); } + + // public accessor to test asrt + public static function testPrivStatSubArray(a:Array) : Array { + privStatSubSetArray(a); + return privStatSubGetArray(); + } + + // *************************************** + // access public static property from + // default method of sub class + // *************************************** + + function subGetDPArray() : Array { return pubStatArray; } + function subSetDPArray(a:Array) { pubStatArray = a; } + + public function testSubGetSetDPArray(a:Array) : Array { + this.subSetDPArray(a); + return this.subGetDPArray(); + } + + + // *************************************** + // access public static property from + // public method of sub class + // *************************************** + + public function pubSubGetDPArray() : Array { return pubStatArray; } + public function pubSubSetDPArray(a:Array) { pubStatArray = a; } + + // *************************************** + // access public static property from + // private method of sub class + // *************************************** + + private function privSubGetDPArray() : Array { return pubStatArray; } + private function privSubSetDPArray(a:Array) { pubStatArray = a; } + + public function testPrivSubDPArray(a:Array) : Array { + this.privSubSetDPArray(a); + return this.privSubGetDPArray(); + } + + + // *************************************** + // access public static property from + // final method of sub class + // *************************************** + + final function finSubGetDPArray() : Array { return pubStatArray; } + final function finSubSetDPArray(a:Array) { pubStatArray = a; } + + public function testFinSubDPArray(a:Array):Array { + this.finSubSetDPArray(a); + return this.finSubGetDPArray(); + } + + + // *************************************** + // access public static property from + // static method of sub class + // *************************************** + + static function statSubGetSPArray() : Array { return pubStatArray; } + static function statSubSetSPArray(a:Array) { pubStatArray = a; } + + public static function testStatSubSPArray(a:Array):Array { + statSubSetSPArray(a); + return statSubGetSPArray(); + } + + + // *************************************** + // access public static property from + // public static method of sub class + // *************************************** + + public static function pubStatSubGetSPArray() : Array { return pubStatArray; } + public static function pubStatSubSetSPArray(a:Array) { pubStatArray = a; } + + // *************************************** + // access public static property from + // private static method of sub class + // *************************************** + + private static function privStatSubGetSPArray() : Array { return pubStatArray; } + private static function privStatSubSetSPArray(a:Array) { pubStatArray = a; } + + // public accessor for asrt + public static function testPrivStatSubPArray(a:Array) : Array { + privStatSubSetSPArray( a ); + return privStatSubGetSPArray(); + } + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDefaultImplDefPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDefaultImplDefPub.as new file mode 100644 index 00000000000..4dad3018718 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDefaultImplDefPub.as @@ -0,0 +1,54 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "Clean AS2"; // Version of JavaScript or ECMA +var TITLE = "Extend Default Class Implement Default interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +import DefaultClass.*; + +var PUBEXTDEFIMPLDEFPUB = new PubExtDefaultImplDefPub(); + + +// ******************************************* +// define public method from interface as a +// public method in the sub class +// ******************************************* + +AddTestCase( "*** public method implemented interface ***", 1, 1 ); +AddTestCase( "PUBEXTDEFIMPLDEFPUB.setPubBoolean(false), PUBEXTDEFIMPLDEFPUB.iGetPubBoolean()", false, (PUBEXTDEFIMPLDEFPUB.setPubBoolean(false), PUBEXTDEFIMPLDEFPUB.iGetPubBoolean()) ); +AddTestCase( "PUBEXTDEFIMPLDEFPUB.setPubBoolean(true), PUBEXTDEFIMPLDEFPUB.iGetPubBoolean()", true, (PUBEXTDEFIMPLDEFPUB.setPubBoolean(true), PUBEXTDEFIMPLDEFPUB.iGetPubBoolean()) ); + + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDefaultImplDefPub/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDefaultImplDefPub/DefaultClass.as new file mode 100644 index 00000000000..68d3d9dd4c3 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDefaultImplDefPub/DefaultClass.as @@ -0,0 +1,251 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DefaultClass { + + class DefaultClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + + internal var finArray:Array; + internal var finBoolean:Boolean; + internal var finDate:Date; + internal var finFunction:Function; + internal var finMath:Math; + internal var finNumber:Number; + internal var finObject:Object; + internal var finString:String; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { + number = n; + } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + } + + public class DefaultClass extends DefaultClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDefaultImplDefPub/DefaultIntDef.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDefaultImplDefPub/DefaultIntDef.as new file mode 100644 index 00000000000..8eccc202a84 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDefaultImplDefPub/DefaultIntDef.as @@ -0,0 +1,41 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DefaultClass { + + interface DefaultIntDef { + + function iGetBoolean() : Boolean +// public function iGetPubBoolean() : Boolean + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDefaultImplDefPub/PubExtDefaultImplDefPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDefaultImplDefPub/PubExtDefaultImplDefPub.as new file mode 100644 index 00000000000..8f354dd9558 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDefaultImplDefPub/PubExtDefaultImplDefPub.as @@ -0,0 +1,106 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DefaultClass { + +import DefaultClass.*; + +public class PubExtDefaultImplDefPub extends DefaultClass implements DefaultIntDef { + + // **************************************** + // define a default definition from + // default interface as a public method + // **************************************** + + public function iGetBoolean() : Boolean { return this.boolean; } + + public function testIGetBoolean() : Boolean { return iGetBoolean(); } + + // **************************************** + // define a public defintion from + // default interface as a default method + // **************************************** + + public function iGetPubBoolean() : Boolean { return this.pubBoolean; } + + // ************************************ + // access public method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return this.getPubArray(); } + function subSetArray(a:Array) { this.setPubArray(a); } + + public function testGetSubArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + + // ************************************ + // access public method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return this.getPubArray(); } + public function pubSubSetArray(a:Array) { this.setPubArray(a); } + + // ************************************ + // access public method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return this.getPubArray(); } + private function privSubSetArray(a:Array) { this.setPubArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + + // ************************************ + // access public method of parent + // from final method of sub class + // ************************************ + + final function finSubGetArray() : Array { return this.getPubArray(); } + final function finSubSetArray(a:Array) { this.setPubArray(a); } + + // function to test above from test scripts + public function testFinSubArray(a:Array) : Array { + this.finSubSetArray(a); + return this.finSubGetArray(); + } + + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDynamicImplDefDefPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDynamicImplDefDefPub.as new file mode 100644 index 00000000000..9a28bf77356 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDynamicImplDefDefPub.as @@ -0,0 +1,81 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "Clean AS2"; // Version of JavaScript or ECMA +var TITLE = "Extend Dynamic Class Implement Default interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +import DynamicClass.*; + +var PUBEXTDYNIMPLDEFDEFPUB = new PubExtDynamicImplDefDefPub(); + +// ******************************************* +// define default method from interface as a +// public method in the sub class +// ******************************************* + +// Should give an error + +AddTestCase( "*** default() method implemented interface ***", 1, 1 ); +AddTestCase( "PUBEXTDYNIMPLDEFDEFPUB.testGetBoolean(false)", false, PUBEXTDYNIMPLDEFDEFPUB.testGetBoolean(false) ); +AddTestCase( "PUBEXTDYNIMPLDEFDEFPUB.testGetBoolean(true)", true, PUBEXTDYNIMPLDEFDEFPUB.testGetBoolean(true) ); + +// ******************************************* +// define public method from interface as a +// public method in the sub class +// ******************************************* + +AddTestCase( "*** public method implemented interface ***", 1, 1 ); +AddTestCase( "PUBEXTDYNIMPLDEFDEFPUB.testGetPubBoolean(false)", false, PUBEXTDYNIMPLDEFDEFPUB.testGetPubBoolean(false) ); +AddTestCase( "PUBEXTDYNIMPLDEFDEFPUB.testGetPubBoolean(true)", true, PUBEXTDYNIMPLDEFDEFPUB.testGetPubBoolean(true) ); + +// ******************************************* +// define default method from interface 2 as a +// public method in the sub class +// ******************************************* + +//Should give an error + +AddTestCase( "*** default() method implemented interface 2 ***", 1, 1 ); +AddTestCase( "PUBEXTDYNIMPLDEFDEFPUB.testGetSetNumber(420)", 420, PUBEXTDYNIMPLDEFDEFPUB.testGetSetNumber(420) ); + +// ******************************************* +// define public method from interface 2 as a +// public method in the sub class +// ******************************************* + +AddTestCase( "*** public method implemented interface 2 ***", 1, 1 ); +AddTestCase( "PUBEXTDYNIMPLDEFDEFPUB.setPubNumber(14), PUBEXTDYNIMPLDEFDEFPUB.iGetPubNumber()", 14, (PUBEXTDYNIMPLDEFDEFPUB.setPubNumber(14), PUBEXTDYNIMPLDEFDEFPUB.iGetPubNumber()) ); + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDynamicImplDefDefPub/DefaultInt.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDynamicImplDefDefPub/DefaultInt.as new file mode 100644 index 00000000000..b9936dadbe9 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDynamicImplDefDefPub/DefaultInt.as @@ -0,0 +1,40 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DynamicClass { + + interface DefaultInt { + + function iGetNumber():Number + // public function iGetPubNumber(): Number + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDynamicImplDefDefPub/DefaultIntDef.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDynamicImplDefDefPub/DefaultIntDef.as new file mode 100644 index 00000000000..fd5b160aaf4 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDynamicImplDefDefPub/DefaultIntDef.as @@ -0,0 +1,41 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DynamicClass { + + interface DefaultIntDef { + + function iGetBoolean() : Boolean + // public function iGetPubBoolean() : Boolean + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDynamicImplDefDefPub/DynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDynamicImplDefDefPub/DynamicClass.as new file mode 100644 index 00000000000..58ed6f47bac --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDynamicImplDefDefPub/DynamicClass.as @@ -0,0 +1,230 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DynamicClass { + + + dynamic class DynamicClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + + internal var finArray:Array; + internal var finBoolean:Boolean; + internal var finDate:Date; + internal var finFunction:Function; + internal var finMath:Math; + internal var finNumber:Number; + internal var finObject:Object; + internal var finString:String; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + + // **************** + // constructor + // **************** + + function DynamicClass() { + } + + // ***************** + // default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + } + public class DynamicClass extends DynamicClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDynamicImplDefDefPub/PubExtDynamicImplDefDefPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDynamicImplDefDefPub/PubExtDynamicImplDefDefPub.as new file mode 100644 index 00000000000..1d9629abd72 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDynamicImplDefDefPub/PubExtDynamicImplDefDefPub.as @@ -0,0 +1,124 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DynamicClass { + +import DynamicClass.*; + +public class PubExtDynamicImplDefDefPub extends DynamicClass implements DefaultIntDef, DefaultInt { + + // **************************************** + // define a default definition from + // default interface as a default method + // **************************************** + + public function iGetBoolean() : Boolean { return this.boolean; } + + public function testGetBoolean(flag:Boolean):Boolean { + + setBoolean(flag); + return iGetBoolean(); + } + + + // **************************************** + // define a public defintion from + // default interface as a default method + // **************************************** + + public function iGetPubBoolean() : Boolean { return this.pubBoolean; } + + public function testGetPubBoolean(flag:Boolean):Boolean { + + setPubBoolean(flag); + return iGetPubBoolean(); + } + + + // **************************************** + // define a default definition from + // default interface 2 as a public method + // **************************************** + + public function iGetNumber() : Number { return this.number; } + + public function testGetSetNumber( num:Number ) : Number { + + setNumber(num); + return iGetNumber(); + } + + + // **************************************** + // define a public defintion from + // default interface 2 as a default method + // **************************************** + + public function iGetPubNumber() : Number { return this.pubNumber; } + + // ************************************ + // access public method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return this.getPubArray(); } + function subSetArray(a:Array) { this.setPubArray(a); } + + public function testGetSubArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + + // ************************************ + // access public method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return this.getPubArray(); } + public function pubSubSetArray(a:Array) { this.setPubArray(a); } + + // ************************************ + // access public method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return this.getPubArray(); } + private function privSubSetArray(a:Array) { this.setPubArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDynamicImplDefPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDynamicImplDefPub.as new file mode 100644 index 00000000000..1e830ab2018 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDynamicImplDefPub.as @@ -0,0 +1,63 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "Clean AS2"; // Version of JavaScript or ECMA +var TITLE = "Extend Default Class Implement Default interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +import DynamicClass.*; + +var PUBEXTDYNIMPLDEFPUB = new PubExtDynamicImplDefPub(); + +// ******************************************* +// define default method from interface as a +// public method in the sub class +// ******************************************* + +//Should give an error + +AddTestCase( "*** default() method implemented interface ***", 1, 1 ); +AddTestCase( "PUBEXTDYNIMPLDEFPUB.testGetSetBoolean(false)", false, PUBEXTDYNIMPLDEFPUB.testGetSetBoolean(false) ); +AddTestCase( "PUBEXTDYNIMPLDEFPUB.testGetSetBoolean(true)", true, PUBEXTDYNIMPLDEFPUB.testGetSetBoolean(true) ); + +// ******************************************* +// define public method from interface as a +// public method in the sub class +// ******************************************* + +AddTestCase( "*** public method implemented interface ***", 1, 1 ); +AddTestCase( "PUBEXTDYNIMPLDEFPUB.testPubGetSetBoolean(false)", false, PUBEXTDYNIMPLDEFPUB.testPubGetSetBoolean(false) ); +AddTestCase( "PUBEXTDYNIMPLDEFPUB.testPubGetSetBoolean(true)", true, PUBEXTDYNIMPLDEFPUB.testPubGetSetBoolean(true) ); + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDynamicImplDefPub/DefaultIntDef.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDynamicImplDefPub/DefaultIntDef.as new file mode 100644 index 00000000000..fd5b160aaf4 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDynamicImplDefPub/DefaultIntDef.as @@ -0,0 +1,41 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DynamicClass { + + interface DefaultIntDef { + + function iGetBoolean() : Boolean + // public function iGetPubBoolean() : Boolean + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDynamicImplDefPub/DynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDynamicImplDefPub/DynamicClass.as new file mode 100644 index 00000000000..58ed6f47bac --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDynamicImplDefPub/DynamicClass.as @@ -0,0 +1,230 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DynamicClass { + + + dynamic class DynamicClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + + internal var finArray:Array; + internal var finBoolean:Boolean; + internal var finDate:Date; + internal var finFunction:Function; + internal var finMath:Math; + internal var finNumber:Number; + internal var finObject:Object; + internal var finString:String; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + + // **************** + // constructor + // **************** + + function DynamicClass() { + } + + // ***************** + // default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + } + public class DynamicClass extends DynamicClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDynamicImplDefPub/PubExtDynamicImplDefPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDynamicImplDefPub/PubExtDynamicImplDefPub.as new file mode 100644 index 00000000000..1f8df3500c5 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDynamicImplDefPub/PubExtDynamicImplDefPub.as @@ -0,0 +1,106 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DynamicClass { + +import DynamicClass.*; + +public class PubExtDynamicImplDefPub extends DynamicClass implements DefaultIntDef { + + // **************************************** + // define a default definition from + // default interface as a default method + // **************************************** + + public function iGetBoolean() : Boolean { return this.boolean; } + + public function testGetSetBoolean( flag:Boolean ) : Boolean { + + setBoolean(flag); + return iGetBoolean(); + } + + + // **************************************** + // define a public defintion from + // default interface as a default method + // **************************************** + + public function iGetPubBoolean() : Boolean { return this.pubBoolean; } + + public function testPubGetSetBoolean( flag:Boolean ) : Boolean { + + setPubBoolean(flag); + return iGetPubBoolean(); + } + + + // ************************************ + // access public method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return this.getPubArray(); } + function subSetArray(a:Array) { this.setPubArray(a); } + + public function testGetSubArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + + // ************************************ + // access public method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return this.getPubArray(); } + public function pubSubSetArray(a:Array) { this.setPubArray(a); } + + // ************************************ + // access public method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return this.getPubArray(); } + private function privSubSetArray(a:Array) { this.setPubArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDynamicImplDefStat.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDynamicImplDefStat.as new file mode 100644 index 00000000000..ce33c067621 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDynamicImplDefStat.as @@ -0,0 +1,169 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "Clean AS2"; // Version of JavaScript or ECMA +var TITLE = "Extend Dynamic Class Implement Default Interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +import DynamicClass.*; + +arr = new Array(1, 2, 3); + + +// ******************************************** +// access static method from a default +// method of a sub class +// +// ******************************************** + +EXTDCLASS = new PubExtDynamicImplDefStat(); +AddTestCase( "*** Access static method from default method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testSubSetArray(arr)", arr, EXTDCLASS.testSubSetArray(arr) ); + +// fill in the rest of the cases here + + +// ******************************************** +// access static method from a public +// method of a sub class +// +// ******************************************** + +EXTDCLASS = new PubExtDynamicImplDefStat(); +AddTestCase( "*** Access static method from public method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.pubSubSetArray(arr), EXTDCLASS.pubSubGetArray()", arr, (EXTDCLASS.pubSubSetArray(arr), EXTDCLASS.pubSubGetArray()) ); + +// fill in the rest of the cases here + +// ******************************************** +// access static method from a private +// method of a sub class +// +// ******************************************** + +EXTDCLASS = new PubExtDynamicImplDefStat(); +AddTestCase( "*** Access static method from private method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testPrivSubArray(arr)", arr, EXTDCLASS.testPrivSubArray(arr) ); + +// fill in the rest of the cases here + +// ******************************************** +// access static method from a static +// method of a sub class +// ******************************************** + +AddTestCase( "*** Access static method from static method of sub class ***", 1, 1 ); +AddTestCase( "PubExtDynamicImplDefStat.testStatSubArray(arr)", arr, PubExtDynamicImplDefStat.testStatSubArray(arr) ); + +// ******************************************** +// access static method from a public static +// method of a sub class +// ******************************************** + +AddTestCase( "*** Access static method from public static method of sub class ***", 1, 1 ); +AddTestCase( "PubExtDynamicImplDefStat.pubStatSubSetArray(arr), PubExtDynamicImplDefStat.pubStatSubGetArray()", arr, + (PubExtDynamicImplDefStat.pubStatSubSetArray(arr), PubExtDynamicImplDefStat.pubStatSubGetArray()) ); + +// ******************************************** +// access static method from a private static +// method of a sub class +// ******************************************** + +EXTDCLASS = new PubExtDynamicImplDefStat(); +AddTestCase( "*** Access static method from private static method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testPrivStatSubArray(arr)", arr, EXTDCLASS.testPrivStatSubArray(arr) ); + + +// ******************************************** +// access static property from +// default method in sub class +// ******************************************** + +EXTDCLASS = new PubExtDynamicImplDefStat(); +AddTestCase( "*** Access default property from method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testSubSetDPArray(arr)", arr, EXTDCLASS.testSubSetDPArray(arr) ); + +// fill in the rest of the cases here + +// ******************************************** +// access static property from +// public method in sub class +// ******************************************** + +EXTDCLASS = new PubExtDynamicImplDefStat(); +AddTestCase( "*** Access default property from public method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.pubSubSetDPArray(arr), EXTDCLASS.pubSubGetDPArray()", arr, (EXTDCLASS.pubSubSetDPArray(arr), EXTDCLASS.pubSubGetDPArray()) ); + +// fill in the rest of the cases here + +// ******************************************** +// access static property from +// private method in sub class +// ******************************************** + +EXTDCLASS = new PubExtDynamicImplDefStat(); +AddTestCase( "*** Access default property from private method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testPrivSubSetDPArray(arr)", arr, EXTDCLASS.testPrivSubSetDPArray(arr) ); + +// fill in the rest of the cases here + +// ******************************************** +// access static property from a static +// method of a sub class +// ******************************************** + +AddTestCase( "*** Access static property from static method of sub class ***", 1, 1 ); +AddTestCase( "PubExtDynamicImplDefStat.testStatSetDPArray(arr)", arr, PubExtDynamicImplDefStat.testStatSetDPArray(arr) ); + +// ******************************************** +// access static property from a public static +// method of a sub class +// ******************************************** + +AddTestCase( "*** Access static property from public static method of sub class ***", 1, 1 ); +AddTestCase( "PubExtDynamicImplDefStat.pubStatSubSetDPArray(arr), PubExtDynamicImplDefStat.pubStatSubGetDPArray()", arr, + (PubExtDynamicImplDefStat.pubStatSubSetDPArray(arr), PubExtDynamicImplDefStat.pubStatSubGetDPArray()) ); + +// ******************************************** +// access static property from a private static +// method of a sub class +// ******************************************** + +EXTDCLASS = new PubExtDynamicImplDefStat(); +AddTestCase( "*** Access static property from static method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testPrivStatSubDPArray(arr)", arr, EXTDCLASS.testPrivStatSubDPArray(arr) ); + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDynamicImplDefStat/DefaultInt.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDynamicImplDefStat/DefaultInt.as new file mode 100644 index 00000000000..e017c373ad2 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDynamicImplDefStat/DefaultInt.as @@ -0,0 +1,40 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DynamicClass { + + interface DefaultInt { + + function iGetBoolean() : Boolean + // public function iGetPubBoolean() : Boolean + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDynamicImplDefStat/DefaultIntDef.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDynamicImplDefStat/DefaultIntDef.as new file mode 100644 index 00000000000..a29fc7f668b --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDynamicImplDefStat/DefaultIntDef.as @@ -0,0 +1,41 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DynamicClass { + + interface DefaultIntDef { + + function iGetBoolean() : Boolean +// public function iGetPubBoolean() : Boolean + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDynamicImplDefStat/DynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDynamicImplDefStat/DynamicClass.as new file mode 100644 index 00000000000..58ed6f47bac --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDynamicImplDefStat/DynamicClass.as @@ -0,0 +1,230 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DynamicClass { + + + dynamic class DynamicClassInner { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + + internal var finArray:Array; + internal var finBoolean:Boolean; + internal var finDate:Date; + internal var finFunction:Function; + internal var finMath:Math; + internal var finNumber:Number; + internal var finObject:Object; + internal var finString:String; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + + // **************** + // constructor + // **************** + + function DynamicClass() { + } + + // ***************** + // default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray() { return finArray; } + + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + } + public class DynamicClass extends DynamicClassInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDynamicImplDefStat/PubExtDynamicImplDefStat.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDynamicImplDefStat/PubExtDynamicImplDefStat.as new file mode 100644 index 00000000000..20884cdd4cb --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtDynamicImplDefStat/PubExtDynamicImplDefStat.as @@ -0,0 +1,192 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DynamicClass { + +import DynamicClass.*; + +public class PubExtDynamicImplDefStat extends DynamicClass implements DefaultIntDef { + + // ******************************************************************* + // defining as static causes compiler error( tested in another file ) + // still need to define the interface methods to make the rest of the + // tests work + // ******************************************************************* + + public function iGetBoolean() : Boolean { return this.boolean; } + public function iGetPubBoolean() : Boolean { return this.pubBoolean; } + + // ************************************ + // access static method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return getStatArray(); } + function subSetArray(a:Array) { setStatArray(a); } + + public function testSubSetArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + + // ************************************ + // access static method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return getStatArray(); } + public function pubSubSetArray(a:Array) { setStatArray(a); } + + // ************************************ + // access static method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return getStatArray(); } + private function privSubSetArray(a:Array) { setStatArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + // *************************************** + // access static method of parent + // from static method of sub class + // *************************************** + + static function statSubGetArray() : Array { return getStatArray(); } + static function statSubSetArray(a:Array) { setStatArray(a); } + + public static function testStatSubArray(a:Array) : Array { + statSubSetArray(a); + return statSubGetArray(); + } + + + // *************************************** + // access static method of parent + // from public static method of sub class + // *************************************** + + public static function pubStatSubGetArray() : Array { return getStatArray(); } + public static function pubStatSubSetArray(a:Array) { setStatArray(a); } + + // *************************************** + // access static method of parent + // from private static method of sub class + // *************************************** + + private static function privStatSubGetArray() : Array { return getStatArray(); } + private static function privStatSubSetArray(a:Array) { setStatArray(a); } + + // function to test above test case + public function testPrivStatSubArray(a:Array) : Array { + privStatSubSetArray(a); + return privStatSubGetArray(); + } + + // *************************************** + // access static property from + // default method of sub class + // *************************************** + + function subGetDPArray() : Array { return statArray; } + function subSetDPArray(a:Array) { statArray = a; } + + public function testSubSetDPArray(a:Array) : Array { + subSetDPArray(a); + return subGetDPArray(); + } + + + // *************************************** + // access static property from + // public method of sub class + // *************************************** + + public function pubSubGetDPArray() : Array { return statArray; } + public function pubSubSetDPArray(a:Array) { statArray = a; } + + // *************************************** + // access static property from + // private method of sub class + // *************************************** + + private function privSubGetDPArray() : Array { return statArray; } + private function privSubSetDPArray(a:Array) { statArray = a; } + + public function testPrivSubSetDPArray(a:Array) : Array { + privSubSetDPArray(a); + return privSubGetDPArray(); + } + + + // *************************************** + // access static property from + // static method of sub class + // *************************************** + + static function statSubGetDPArray() : Array { return statArray; } + static function statSubSetDPArray(a:Array) { statArray = a; } + + public static function testStatSetDPArray(a:Array) : Array { + statSubSetDPArray(a); + return statSubGetDPArray(); + } + + + // *************************************** + // access static property from + // public static method of sub class + // *************************************** + + public static function pubStatSubGetDPArray() : Array { return statArray; } + public static function pubStatSubSetDPArray(a:Array) { statArray = a; } + + // *************************************** + // access static property from + // private static method of sub class + // *************************************** + + private static function privStatSubGetDPArray() : Array { return statArray; } + private static function privStatSubSetDPArray(a:Array) { statArray = a; } + + // function to test above + + public function testPrivStatSubDPArray(a:Array) { + statArray = a; + return statArray; + } + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtPublicImplDefDef.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtPublicImplDefDef.as new file mode 100644 index 00000000000..933c3d71d4d --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtPublicImplDefDef.as @@ -0,0 +1,166 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "Clean AS2"; // Version of JavaScript or ECMA +var TITLE = "Extend PublicClass Implement 2 Default Interfaces"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +import PublicClass.*; + +var PUBEXTDYNIMPLDEFDEF = new PubExtPublicImplDefDef(); + + +// ******************************************* +// define default method from interface as a +// default method in the sub class +// ******************************************* + +AddTestCase( "*** default() method implemented interface ***", 1, 1 ); +AddTestCase( "PUBEXTDYNIMPLDEFDEF.testGetSetBoolean(false)", false, PUBEXTDYNIMPLDEFDEF.testGetSetBoolean(false) ); +AddTestCase( "PUBEXTDYNIMPLDEFDEF.testGetSetBoolean(true)", true, PUBEXTDYNIMPLDEFDEF.testGetSetBoolean(true) ); + +// ******************************************* +// define public method from interface as a +// default method in the sub class +// ******************************************* + +//Should give an error + +AddTestCase( "*** public method implemented interface ***", 1, 1 ); +AddTestCase( "PUBEXTDYNIMPLDEFDEF.testPubGetSetBoolean(false)", false, PUBEXTDYNIMPLDEFDEF.testPubGetSetBoolean(false) ); +AddTestCase( "PUBEXTDYNIMPLDEFDEF.testPubGetSetBoolean(true)", true, PUBEXTDYNIMPLDEFDEF.testPubGetSetBoolean(true) ); + +// ******************************************* +// define default method from interface 2 as a +// default method in the sub class +// ******************************************* + +AddTestCase( "*** default() method implemented interface 2 ***", 1, 1 ); +AddTestCase( "PUBEXTDYNIMPLDEFDEF.testGetSetNumber(420)", 420, PUBEXTDYNIMPLDEFDEF.testGetSetNumber(420) ); + +// ******************************************* +// define public method from interface 2 as a +// default method in the sub class +// ******************************************* + +//Should give an error + +AddTestCase( "*** public method implemented interface 2 ***", 1, 1 ); +AddTestCase( "PUBEXTDYNIMPLDEFDEF.testPubGetSetNumber(14)", 14, PUBEXTDYNIMPLDEFDEF.testPubGetSetNumber(14) ); + + + +// ******************************************** +// access default method from a default +// method of a sub class +// +// ******************************************** + +var arr = new Array(1, 2, 3); + +EXTDCLASS = new PubExtPublicImplDefDef(); +AddTestCase( "*** Access default method from default method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testGetSubArray(arr)", arr, EXTDCLASS.testGetSubArray(arr) ); + + + +// ******************************************** +// access default method from a public +// method of a sub class +// +// ******************************************** + +EXTDCLASS = new PubExtPublicImplDefDef(); +AddTestCase( "*** Access default method from public method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.pubSubSetArray(arr), EXTDCLASS.pubSubGetArray()", arr, (EXTDCLASS.pubSubSetArray(arr), EXTDCLASS.pubSubGetArray()) ); + + +// ******************************************** +// access default method from a private +// method of a sub class +// +// ******************************************** + +EXTDCLASS = new PubExtPublicImplDefDef(); +AddTestCase( "*** Access default method from private method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testPrivSubArray(arr)", arr, EXTDCLASS.testPrivSubArray(arr) ); + + +// ******************************************** +// access default method from a final +// method of a sub class +// +// ******************************************** + +EXTDCLASS = new PubExtPublicImplDefDef(); +AddTestCase( "*** Access default method from final method of sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testFinSubArray(arr)", arr, EXTDCLASS.testFinSubArray(arr) ); + + +// ******************************************** +// access default property from +// default method in sub class +// ******************************************** + +EXTDCLASS = new PubExtPublicImplDefDef(); +AddTestCase( "*** Access default property from method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testSubGetDPArray(arr)", arr, EXTDCLASS.testSubGetDPArray(arr) ); + + +// ******************************************** +// access default property from +// public method in sub class +// ******************************************** + +EXTDCLASS = new PubExtPublicImplDefDef(); +AddTestCase( "*** Access default property from public method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.pubSubSetDPArray(arr), EXTDCLASS.pubSubGetDPArray()", arr, (EXTDCLASS.pubSubSetDPArray(arr), EXTDCLASS.pubSubGetDPArray()) ); + +// fill in the rest of the cases here + +// ******************************************** +// access default property from +// private method in sub class +// ******************************************** + +EXTDCLASS = new PubExtPublicImplDefDef(); +AddTestCase( "*** Access default property from private method in sub class ***", 1, 1 ); +AddTestCase( "EXTDCLASS.testPrivSubGetDPArray(arr)", arr, EXTDCLASS.testPrivSubGetDPArray(arr) ); + +// fill in the rest of the cases here + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtPublicImplDefDef/APublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtPublicImplDefDef/APublicClass.as new file mode 100644 index 00000000000..41d0f1e959a --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtPublicImplDefDef/APublicClass.as @@ -0,0 +1,249 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + public class PublicClass { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + + internal var finArray:Array; + internal var finBoolean:Boolean; + internal var finDate:Date; + internal var finMyFunction:Function; + internal var finMath:Math; + internal var finNumber:Number; + internal var finObject:Object; + internal var finString:String; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray():Array { return finArray; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtPublicImplDefDef/DefaultInt.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtPublicImplDefDef/DefaultInt.as new file mode 100644 index 00000000000..d12ed06f3ce --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtPublicImplDefDef/DefaultInt.as @@ -0,0 +1,41 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + interface DefaultInt { + + + function iGetNumber():Number + // public function iGetPubNumber(): Number + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtPublicImplDefDef/DefaultIntDef.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtPublicImplDefDef/DefaultIntDef.as new file mode 100644 index 00000000000..a5c4c154d86 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtPublicImplDefDef/DefaultIntDef.as @@ -0,0 +1,41 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + interface DefaultIntDef { + + function iGetBoolean() : Boolean + // public function iGetPubBoolean() : Boolean + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtPublicImplDefDef/PubExtPublicImplDefDef.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtPublicImplDefDef/PubExtPublicImplDefDef.as new file mode 100644 index 00000000000..715ce69220d --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtPublicImplDefDef/PubExtPublicImplDefDef.as @@ -0,0 +1,183 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + +import PublicClass.*; + +public class PubExtPublicImplDefDef extends PublicClass implements DefaultIntDef, DefaultInt { + + // **************************************** + // define a default definition from + // default interface as a default method + // **************************************** + + public function iGetBoolean() : Boolean { return this.boolean; } + + public function testGetSetBoolean( flag:Boolean ) : Boolean { + + setBoolean(flag); + return iGetBoolean(); + } + + + // **************************************** + // define a public defintion from + // default interface as a default method + // **************************************** + + public function iGetPubBoolean() : Boolean { return this.pubBoolean; } + + public function testPubGetSetBoolean( flag:Boolean ) : Boolean { + + setPubBoolean(flag); + return iGetPubBoolean(); + } + + + // **************************************** + // define a default defintion from + // default interface 2 as a default method + // **************************************** + + public function iGetNumber() : Number { return this.number; } + + public function testGetSetNumber( num:Number ) : Number { + + setNumber(num); + return iGetNumber(); + } + + + // **************************************** + // define a public definition from + // default interface 2 as a default method + // **************************************** + + public function iGetPubNumber() : Number { return this.pubNumber; } + + public function testPubGetSetNumber( num:Number ) : Number { + + setPubNumber(num); + return iGetPubNumber(); + } + + + // ************************************ + // access default method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return this.getArray(); } + function subSetArray(a:Array) { this.setArray(a); } + + public function testGetSubArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + + // ************************************ + // access default method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return this.getArray(); } + public function pubSubSetArray(a:Array) { this.setArray(a); } + + // ************************************ + // access default method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return this.getArray(); } + private function privSubSetArray(a:Array) { this.setArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + // ************************************ + // access default method of parent + // from final method of sub class + // ************************************ + + final function finSubGetArray() : Array { return this.getArray(); } + final function finSubSetArray(a:Array) { this.setArray(a); } + + // function to test above from test scripts + public function testFinSubArray(a:Array) : Array { + this.finSubSetArray(a); + return this.finSubGetArray(); + } + + + + // *************************************** + // access default property from + // default method of sub class + // *************************************** + + function subGetDPArray() : Array { return array; } + function subSetDPArray(a:Array) { array = a; } + + public function testSubGetDPArray(a:Array) : Array { + this.subSetDPArray(a); + return this.subGetDPArray(); + } + + + // *************************************** + // access default property from + // public method of sub class + // *************************************** + + public function pubSubGetDPArray() : Array { return this.array; } + public function pubSubSetDPArray(a:Array) { this.array = a; } + + // *************************************** + // access default property from + // private method of sub class + // *************************************** + + private function privSubGetDPArray() : Array { return this.array; } + private function privSubSetDPArray(a:Array) { this.array = a; } + + public function testPrivSubGetDPArray(a:Array) : Array { + this.privSubSetDPArray(a); + return this.privSubGetDPArray(); + } + } + + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtPublicImplDefDefPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtPublicImplDefDefPub.as new file mode 100644 index 00000000000..32c9f12b7b4 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtPublicImplDefDefPub.as @@ -0,0 +1,81 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "Clean AS2"; // Version of JavaScript or ECMA +var TITLE = "Extend Public Class Implement Default interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +import PublicClass.*; + +var PUBEXTDYNIMPLDEFDEFPUB = new PubExtPublicImplDefDefPub(); + +// ******************************************* +// define default method from interface as a +// public method in the sub class +// ******************************************* + +// Should give an error + +AddTestCase( "*** default() method implemented interface ***", 1, 1 ); +AddTestCase( "PUBEXTDYNIMPLDEFDEFPUB.testGetBoolean(false)", false, PUBEXTDYNIMPLDEFDEFPUB.testGetBoolean(false) ); +AddTestCase( "PUBEXTDYNIMPLDEFDEFPUB.testGetBoolean(true)", true, PUBEXTDYNIMPLDEFDEFPUB.testGetBoolean(true) ); + +// ******************************************* +// define public method from interface as a +// public method in the sub class +// ******************************************* + +AddTestCase( "*** public method implemented interface ***", 1, 1 ); +AddTestCase( "PUBEXTDYNIMPLDEFDEFPUB.testGetPubBoolean(false)", false, PUBEXTDYNIMPLDEFDEFPUB.testGetPubBoolean(false) ); +AddTestCase( "PUBEXTDYNIMPLDEFDEFPUB.testGetPubBoolean(true)", true, PUBEXTDYNIMPLDEFDEFPUB.testGetPubBoolean(true) ); + +// ******************************************* +// define default method from interface 2 as a +// public method in the sub class +// ******************************************* + +//Should give an error + +AddTestCase( "*** default() method implemented interface 2 ***", 1, 1 ); +AddTestCase( "PUBEXTDYNIMPLDEFDEFPUB.testGetSetNumber(420)", 420, PUBEXTDYNIMPLDEFDEFPUB.testGetSetNumber(420) ); + +// ******************************************* +// define public method from interface 2 as a +// public method in the sub class +// ******************************************* + +AddTestCase( "*** public method implemented interface 2 ***", 1, 1 ); +AddTestCase( "PUBEXTDYNIMPLDEFDEFPUB.setPubNumber(14), PUBEXTDYNIMPLDEFDEFPUB.iGetPubNumber()", 14, (PUBEXTDYNIMPLDEFDEFPUB.setPubNumber(14), PUBEXTDYNIMPLDEFDEFPUB.iGetPubNumber()) ); + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtPublicImplDefDefPub/APublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtPublicImplDefDefPub/APublicClass.as new file mode 100644 index 00000000000..41d0f1e959a --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtPublicImplDefDefPub/APublicClass.as @@ -0,0 +1,249 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + public class PublicClass { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + + internal var finArray:Array; + internal var finBoolean:Boolean; + internal var finDate:Date; + internal var finMyFunction:Function; + internal var finMath:Math; + internal var finNumber:Number; + internal var finObject:Object; + internal var finString:String; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray():Array { return finArray; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtPublicImplDefDefPub/DefaultInt.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtPublicImplDefDefPub/DefaultInt.as new file mode 100644 index 00000000000..015c5e249bf --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtPublicImplDefDefPub/DefaultInt.as @@ -0,0 +1,40 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + interface DefaultInt { + + function iGetNumber():Number + // public function iGetPubNumber(): Number + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtPublicImplDefDefPub/DefaultIntDef.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtPublicImplDefDefPub/DefaultIntDef.as new file mode 100644 index 00000000000..a5c4c154d86 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtPublicImplDefDefPub/DefaultIntDef.as @@ -0,0 +1,41 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + interface DefaultIntDef { + + function iGetBoolean() : Boolean + // public function iGetPubBoolean() : Boolean + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtPublicImplDefDefPub/PubExtPublicImplDefDefPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtPublicImplDefDefPub/PubExtPublicImplDefDefPub.as new file mode 100644 index 00000000000..108ea015c85 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtPublicImplDefDefPub/PubExtPublicImplDefDefPub.as @@ -0,0 +1,125 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + +import PublicClass.*; + +public class PubExtPublicImplDefDefPub extends PublicClass implements DefaultIntDef, DefaultInt { + + // **************************************** + // define a default definition from + // default interface as a default method + // **************************************** + + public function iGetBoolean() : Boolean { return this.boolean; } + + public function testGetBoolean(flag:Boolean):Boolean { + + setBoolean(flag); + return iGetBoolean(); + } + + + // **************************************** + // define a public defintion from + // default interface as a default method + // **************************************** + + public function iGetPubBoolean() : Boolean { return this.pubBoolean; } + + public function testGetPubBoolean(flag:Boolean):Boolean { + + setPubBoolean(flag); + return iGetPubBoolean(); + } + + + // **************************************** + // define a default definition from + // default interface 2 as a public method + // **************************************** + + public function iGetNumber() : Number { return this.number; } + + public function testGetSetNumber( num:Number ) : Number { + + setNumber(num); + return iGetNumber(); + } + + + // **************************************** + // define a public defintion from + // default interface 2 as a default method + // **************************************** + + public function iGetPubNumber() : Number { return this.pubNumber; } + + // ************************************ + // access public method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return this.getPubArray(); } + function subSetArray(a:Array) { this.setPubArray(a); } + + public function testGetSubArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + + // ************************************ + // access public method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return this.getPubArray(); } + public function pubSubSetArray(a:Array) { this.setPubArray(a); } + + // ************************************ + // access public method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return this.getPubArray(); } + private function privSubSetArray(a:Array) { this.setPubArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtPublicImplDefPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtPublicImplDefPub.as new file mode 100644 index 00000000000..643b287d170 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtPublicImplDefPub.as @@ -0,0 +1,63 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "Clean AS2"; // Version of JavaScript or ECMA +var TITLE = "Extend Public Class Implement Default interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +import PublicClass.*; + +var PUBEXTDYNIMPLDEFPUB = new PubExtPublicImplDefPub(); + +// ******************************************* +// define default method from interface as a +// public method in the sub class +// ******************************************* + +//Should give an error + +AddTestCase( "*** default() method implemented interface ***", 1, 1 ); +AddTestCase( "PUBEXTDYNIMPLDEFPUB.testGetSetBoolean(false)", false, PUBEXTDYNIMPLDEFPUB.testGetSetBoolean(false) ); +AddTestCase( "PUBEXTDYNIMPLDEFPUB.testGetSetBoolean(true)", true, PUBEXTDYNIMPLDEFPUB.testGetSetBoolean(true) ); + +// ******************************************* +// define public method from interface as a +// public method in the sub class +// ******************************************* + +AddTestCase( "*** public method implemented interface ***", 1, 1 ); +AddTestCase( "PUBEXTDYNIMPLDEFPUB.testPubGetSetBoolean(false)", false, PUBEXTDYNIMPLDEFPUB.testPubGetSetBoolean(false) ); +AddTestCase( "PUBEXTDYNIMPLDEFPUB.testPubGetSetBoolean(true)", true, PUBEXTDYNIMPLDEFPUB.testPubGetSetBoolean(true) ); + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtPublicImplDefPub/APublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtPublicImplDefPub/APublicClass.as new file mode 100644 index 00000000000..41d0f1e959a --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtPublicImplDefPub/APublicClass.as @@ -0,0 +1,249 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + public class PublicClass { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + + internal var finArray:Array; + internal var finBoolean:Boolean; + internal var finDate:Date; + internal var finMyFunction:Function; + internal var finMath:Math; + internal var finNumber:Number; + internal var finObject:Object; + internal var finString:String; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + + // ******************* + // final methods + // ******************* + + final function setFinArray(a:Array) { finArray=a; } + final function getFinArray():Array { return finArray; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtPublicImplDefPub/DefaultIntDef.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtPublicImplDefPub/DefaultIntDef.as new file mode 100644 index 00000000000..a5c4c154d86 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtPublicImplDefPub/DefaultIntDef.as @@ -0,0 +1,41 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + interface DefaultIntDef { + + function iGetBoolean() : Boolean + // public function iGetPubBoolean() : Boolean + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtPublicImplDefPub/PubExtPublicImplDefPub.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtPublicImplDefPub/PubExtPublicImplDefPub.as new file mode 100644 index 00000000000..3602aa24091 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubExtPublicImplDefPub/PubExtPublicImplDefPub.as @@ -0,0 +1,104 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + +import PublicClass.*; + +public class PubExtPublicImplDefPub extends PublicClass implements DefaultIntDef { + + // **************************************** + // define a default definition from + // default interface as a default method + // **************************************** + + public function iGetBoolean() : Boolean { return this.boolean; } + + public function testGetSetBoolean( flag:Boolean ) : Boolean { + + setBoolean(flag); + return iGetBoolean(); + } + + + // **************************************** + // define a public defintion from + // default interface as a default method + // **************************************** + + public function iGetPubBoolean() : Boolean { return this.pubBoolean; } + + public function testPubGetSetBoolean( flag:Boolean ) : Boolean { + + setPubBoolean(flag); + return iGetPubBoolean(); + } + + + // ************************************ + // access public method of parent + // from default method of sub class + // ************************************ + + function subGetArray() : Array { return this.getPubArray(); } + function subSetArray(a:Array) { this.setPubArray(a); } + + public function testGetSubArray(a:Array) : Array { + this.subSetArray(a); + return this.subGetArray(); + } + + + // ************************************ + // access public method of parent + // from public method of sub class + // ************************************ + + public function pubSubGetArray() : Array { return this.getPubArray(); } + public function pubSubSetArray(a:Array) { this.setPubArray(a); } + + // ************************************ + // access public method of parent + // from private method of sub class + // ************************************ + + private function privSubGetArray() : Array { return this.getPubArray(); } + private function privSubSetArray(a:Array) { this.setPubArray(a); } + + // function to test above from test scripts + public function testPrivSubArray(a:Array) : Array { + this.privSubSetArray(a); + return this.privSubGetArray(); + } + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtIntClassImpDefaultInt.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtIntClassImpDefaultInt.as new file mode 100644 index 00000000000..24efc992511 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtIntClassImpDefaultInt.as @@ -0,0 +1,57 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import InternalClassImpDefInt.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Internal class implements default interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new PublicsubClass(); + +//Public sub class extends Internal class implements a default interface with a default //method +//AddTestCase("Public class extends Internal class implements a default interface with a default method", //"PASSED", obj.accdeffunc()); + +//Public class extends Internal class implements a default interface with a public method +AddTestCase("Public class extends Internal class implements a default interface with a public method", false, obj.pubFunc()); + +//public class extends Internal class implements a default interface with a namespace method +AddTestCase("Public class extends Internal class implements a default interface with a namespace method", 4, obj.accnsFunc()); + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtIntClassImpDefaultInt/DefaultInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtIntClassImpDefaultInt/DefaultInterface.as new file mode 100644 index 00000000000..2d304ba4ee1 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtIntClassImpDefaultInt/DefaultInterface.as @@ -0,0 +1,51 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Default Interface DefaultInterface + * Interface methods + * + */ + + +package InternalClassImpDefInt{ //package name + + namespace ns; + //namespace + + interface DefaultInt{ + + function deffunc():String; //Default attribute //method + + // public function pubFunc():Boolean; //Public attribute method + + // ns function nsFunc(a="test"):int; //Namespace attribute method + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtIntClassImpDefaultInt/InternalClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtIntClassImpDefaultInt/InternalClass.as new file mode 100644 index 00000000000..4033dbef740 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtIntClassImpDefaultInt/InternalClass.as @@ -0,0 +1,66 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Internal Class InternalClass + * Class methods + * + */ + +package InternalClassImpDefInt{ +use namespace ns; + + internal class InternalClass implements DefaultInt{ + + public function deffunc():String{ //Default method + return"PASSED"; + } + + public function pubFunc():Boolean{ //Public method + return true; + } + + ns function nsFunc(a="test"):int{ //Namespace method + return a.length; + } + + } + + + public class InternalClassAccesor extends InternalClass{ + //use namespace ns; + public function accdeffunc(){return deffunc();} + // access default function deffunc + + public function accnsFunc(a="test"){return ns::nsFunc(a);} + // access default function nsFunc + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtIntClassImpDefaultInt/PublicsubClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtIntClassImpDefaultInt/PublicsubClass.as new file mode 100644 index 00000000000..8d3d10c9f8d --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtIntClassImpDefaultInt/PublicsubClass.as @@ -0,0 +1,63 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Default Class DefaultClass + * Class methods + * + */ + +package InternalClassImpDefInt{ +//import InternalClassImpDefInt.* +use namespace ns; + + public class PublicsubClass extends InternalClass{ + + + //override public function getdeffunc():String{return deffunc();} + // access default function deffunc + + + override public function pubFunc():Boolean{ //Public method + return !true; + } + + override ns function nsFunc(a="test"):int{ //Namespace method + return ((a.length)+1)-1; + } + public function accnsFunc():int{ + return ns::nsFunc(); + } + + } + + + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtPubClassImpDefInt.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtPubClassImpDefInt.as new file mode 100644 index 00000000000..e4489c08e9e --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtPubClassImpDefInt.as @@ -0,0 +1,58 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import PublicClassImpDefInt.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Public class implements default interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new PublicsubClass(); +//use namespace ns; + +//Public class extends Public class implements a default interface with a default method +//AddTestCase("Public class implements a default interface with a default method", "PASSED", //obj.getdeffunc()); + +//Public sub class extends Public class implements a default interface with a public method +AddTestCase("Public sub class extends Public class implements a default interface with a public method", false, obj.pubFunc()); + +//Public class extends Public class implements a default interface with a namespace method +AddTestCase("Public class implements a default interface with a namespace method", 4, obj.getnsFunc()); + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtPubClassImpDefInt/DefaultInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtPubClassImpDefInt/DefaultInterface.as new file mode 100644 index 00000000000..6b6c905f4fa --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtPubClassImpDefInt/DefaultInterface.as @@ -0,0 +1,51 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Default Interface DefaultInterface + * Interface methods + * + */ + + +package PublicClassImpDefInt{ //package name + + namespace ns; + //namespace + + interface DefaultInt{ + + function deffunc():String; //Default attribute method + + // public function pubFunc():Boolean; //Public attribute method + + // ns function nsFunc(a="test"):int; //Namespace attribute method + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtPubClassImpDefInt/PublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtPubClassImpDefInt/PublicClass.as new file mode 100644 index 00000000000..46d41e48d1e --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtPubClassImpDefInt/PublicClass.as @@ -0,0 +1,63 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Public Class PublicClass + * Class methods + * + */ + +package PublicClassImpDefInt{ + +use namespace ns; + + public class PublicClass implements DefaultInt{ + + public function deffunc():String{ //Default method + return"PASSED"; + } + + public function getdeffunc():String{return deffunc();} + // access default function deffunc + + + public function pubFunc():Boolean{ //Public method + return true; + } + + ns function nsFunc(a="test"):int{ //Namespace method + return a.length; + } + + public function getnsFunc(a="test"):int{return ns::nsFunc(a);} + // access default function nsFunc + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtPubClassImpDefInt/PublicsubClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtPubClassImpDefInt/PublicsubClass.as new file mode 100644 index 00000000000..b9cb1fce975 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtPubClassImpDefInt/PublicsubClass.as @@ -0,0 +1,59 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Default Class DefaultClass + * Class methods + * + */ + +package PublicClassImpDefInt{ +use namespace ns; + + public class PublicsubClass extends PublicClass{ + + + //override public function getdeffunc():String{return deffunc();} + // access default function deffunc + + + override public function pubFunc():Boolean{ //Public method + return !true; + } + + override ns function nsFunc(a="test"):int{ //Namespace method + return a.length; + } + + } + + + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtPubClassImpIntInt.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtPubClassImpIntInt.as new file mode 100644 index 00000000000..76a091491da --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtPubClassImpIntInt.as @@ -0,0 +1,58 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import PublicClassImpInternalInt.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Public class implements internal interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new PublicsubClass(); +//use namespace ns; + +//Public class extends Public class implements an internal interface with a default method +//AddTestCase("Public class extends Public class implements an internal interface with a //default method", "PASSED", obj.getdeffunc()); + +//Public class extends Public class implements an internal interface with a public method +AddTestCase("Public class extends Public class implements an internal interface with a public method", false, obj.pubFunc()); + +//Public class extends Public class implements an internal interface with a namespace method +AddTestCase("Public class extends Public class implements an internal interface with a namespace method", 4, obj.getnsFunc()); + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtPubClassImpIntInt/InternalInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtPubClassImpIntInt/InternalInterface.as new file mode 100644 index 00000000000..5fb5bcc695e --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtPubClassImpIntInt/InternalInterface.as @@ -0,0 +1,51 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Internal Interface InternalInterface + * Interface methods + * + */ + + +package PublicClassImpInternalInt{ //package name + + namespace ns; + //namespace + + internal interface InternalInt{ + + function deffunc():String; //Default attribute method + + // public function pubFunc():Boolean; //Public attribute method + + // ns function nsFunc(a="test"):int; //Namespace attribute method + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtPubClassImpIntInt/PublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtPubClassImpIntInt/PublicClass.as new file mode 100644 index 00000000000..c1511978b1a --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtPubClassImpIntInt/PublicClass.as @@ -0,0 +1,64 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Public Class PublicClass + * Class methods + * + */ + +package PublicClassImpInternalInt{ + +use namespace ns; + + public class PublicClass implements InternalInt{ + + public function deffunc():String{ //Default method + return"PASSED"; + } + + public function getdeffunc():String{return deffunc();} + // access default function deffunc + + + public function pubFunc():Boolean{ //Public method + return true; + } + + ns function nsFunc(a="test"):int{ //Namespace method + return a.length; + } + + public function getnsFunc(a="test"):int{return ns::nsFunc(a);} + // access default function nsFunc + + } + public class PublicClassAccessor extends PublicClass{} +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtPubClassImpIntInt/PublicsubClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtPubClassImpIntInt/PublicsubClass.as new file mode 100644 index 00000000000..8ac1d4b6f24 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtPubClassImpIntInt/PublicsubClass.as @@ -0,0 +1,59 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Default Class DefaultClass + * Class methods + * + */ + +package PublicClassImpInternalInt{ +use namespace ns; + + public class PublicsubClass extends PublicClassAccessor{ + + + //override public function getdeffunc():String{return deffunc();} + // access default function deffunc + + + override public function pubFunc():Boolean{ //Public method + return !true; + } + + override ns function nsFunc(a="test"):int{ //Namespace method + return a.length; + } + + } + + + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtPubClassImpPubInt.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtPubClassImpPubInt.as new file mode 100644 index 00000000000..b81fe9c2401 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtPubClassImpPubInt.as @@ -0,0 +1,58 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import PublicClassImpPublicInt.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Public class implements public interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new PublicsubClass(); +//use namespace ns; + +//Public Class extends Public class implements a public interface with a default method +//AddTestCase("Public class extends Public class implements a public interface with a //default //method", "PASSED", obj.getdeffunc()); + +//Public Class extends Public class implements a public interface with a public method +AddTestCase("Public class extends Public class implements a public interface with a public method", false, obj.pubFunc()); + +//Public Class extends Public class implements a public interface with a namespace method +AddTestCase("Public class extends Public class implements a public interface with a namespace method", 4, obj.getnsFunc()); + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtPubClassImpPubInt/PublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtPubClassImpPubInt/PublicClass.as new file mode 100644 index 00000000000..bef42448fc3 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtPubClassImpPubInt/PublicClass.as @@ -0,0 +1,63 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Public Class PublicClass + * Class methods + * + */ + +package PublicClassImpPublicInt{ + +use namespace ns; + + public class PublicClass implements PublicInt{ + + public function deffunc():String{ //Default method + return"PASSED"; + } + + public function getdeffunc():String{return deffunc();} + // access default function deffunc + + + public function pubFunc():Boolean{ //Public method + return true; + } + + ns function nsFunc(a="test"):int{ //Namespace method + return a.length; + } + + public function getnsFunc(a="test"):int{return ns::nsFunc(a);} + // access default function nsFunc + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtPubClassImpPubInt/PublicInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtPubClassImpPubInt/PublicInterface.as new file mode 100644 index 00000000000..236b334f443 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtPubClassImpPubInt/PublicInterface.as @@ -0,0 +1,51 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Public Interface PublicInterface + * Interface methods + * + */ + + +package PublicClassImpPublicInt{ //package name + + namespace ns; + //namespace + + public interface PublicInt{ + + function deffunc():String; //Default attribute method + + // public function pubFunc():Boolean; //Public attribute method + + // ns function nsFunc(a="test"):int; //Namespace attribute method + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtPubClassImpPubInt/PublicsubClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtPubClassImpPubInt/PublicsubClass.as new file mode 100644 index 00000000000..e93ce4b34e2 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/ExtImpl/PubSubExtPubClassImpPubInt/PublicsubClass.as @@ -0,0 +1,59 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Default Class DefaultClass + * Class methods + * + */ + +package PublicClassImpPublicInt{ +use namespace ns; + + public class PublicsubClass extends PublicClass{ + + + //override public function getdeffunc():String{return deffunc();} + // access default function deffunc + + + override public function pubFunc():Boolean{ //Public method + return !true; + } + + override ns function nsFunc(a="test"):int{ //Namespace method + return a.length; + } + + } + + + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefInt.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefInt.as new file mode 100644 index 00000000000..e50ab928ac6 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefInt.as @@ -0,0 +1,51 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import DefClassImpDefInt.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Default class implements default interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj:DefaultClassAccesor = new DefaultClassAccesor(); + +//Default class implements a default interface with a public method +AddTestCase("Default class implements a default interface with a public method", "PASSED", obj.deffunc()); + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefInt/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefInt/DefaultClass.as new file mode 100644 index 00000000000..b7e6dd6e3a1 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefInt/DefaultClass.as @@ -0,0 +1,55 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Default Class DefaultClass + * Class methods + * + */ + +package DefClassImpDefInt{ + + + class DefaultClass implements DefaultInt{ + + + public function deffunc():String{ + return"PASSED"; + } + + + } + + public class DefaultClassAccesor extends DefaultClass{ + + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefInt/DefaultInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefInt/DefaultInterface.as new file mode 100644 index 00000000000..8f369e1f4eb --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefInt/DefaultInterface.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Default Interface DefaultInterface + * Interface methods + * + */ + + +package DefClassImpDefInt{ //package name + + interface DefaultInt{ + + function deffunc():String; + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefIntInt.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefIntInt.as new file mode 100644 index 00000000000..8a6135bc9f5 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefIntInt.as @@ -0,0 +1,51 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import DefClassImpDefIntInt.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Default class implements two default interfaces"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj:DefaultClassAccesor = new DefaultClassAccesor(); + +//Default class implements two default interfaces with a public method +AddTestCase("Default class implements two default interfaces with a public method", "PASSED", obj.deffunc()); + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefIntInt/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefIntInt/DefaultClass.as new file mode 100644 index 00000000000..c525cd5c73e --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefIntInt/DefaultClass.as @@ -0,0 +1,55 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Default Class DefaultClass + * Class methods + * + */ + +package DefClassImpDefIntInt{ + + + class DefaultClass implements DefaultInt, DefaultInt_S{ + + + public function deffunc():String{ + return"PASSED"; + } + + + } + + public class DefaultClassAccesor extends DefaultClass{ + + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefIntInt/DefaultInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefIntInt/DefaultInterface.as new file mode 100644 index 00000000000..f74d7cb3745 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefIntInt/DefaultInterface.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Default Interface DefaultInterface + * Interface methods + * + */ + + +package DefClassImpDefIntInt{ //package name + + interface DefaultInt{ + + function deffunc():String; + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefIntInt/DefaultInterface_S.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefIntInt/DefaultInterface_S.as new file mode 100644 index 00000000000..ae62e14f5bf --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefIntInt/DefaultInterface_S.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Default Interface DefaultInterface + * Interface methods + * + */ + + +package DefClassImpDefIntInt{ //package name + + interface DefaultInt_S{ + + function deffunc():String; + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefIntIntname.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefIntIntname.as new file mode 100644 index 00000000000..76e69f5a84c --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefIntIntname.as @@ -0,0 +1,54 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import DefClassImpDefIntIntname.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Default class implements two default interfaces"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + + +var obj:DefaultClassAccesor = new DefaultClassAccesor(); +//Default class implements the first default interface with an interface name method +AddTestCase("Default class implements the first default interface with an interface name method", "PASSED", obj.accdeffunc()); +//Default class implements the second default interface with an interface name method +AddTestCase("Default class implements the second default interface with an interface name method", "PASSED", obj.accdeffunc_s()); + + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefIntIntname/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefIntIntname/DefaultClass.as new file mode 100644 index 00000000000..a6ab372a0e6 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefIntIntname/DefaultClass.as @@ -0,0 +1,57 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Default Class DefaultClass + * Class methods + * + */ + +package DefClassImpDefIntIntname{ + + class DefaultClass implements DefaultInt, DefaultInt_S{ + + + public function deffunc():String{ + return"PASSED"; + } + + } + + public class DefaultClassAccesor{ + + var c:DefaultClass = new DefaultClass(); + public function accdeffunc(){return c.DefaultInt::deffunc();} + public function accdeffunc_s(){return c.DefaultInt_S::deffunc();} + + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefIntIntname/DefaultInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefIntIntname/DefaultInterface.as new file mode 100644 index 00000000000..bfc17857151 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefIntIntname/DefaultInterface.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Default Interface DefaultInterface + * Interface methods + * + */ + + +package DefClassImpDefIntIntname{ //package name + + interface DefaultInt{ + + function deffunc():String; + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefIntIntname/DefaultInterface_S.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefIntIntname/DefaultInterface_S.as new file mode 100644 index 00000000000..537c51830e7 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefIntIntname/DefaultInterface_S.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Default Interface DefaultInterface + * Interface methods + * + */ + + +package DefClassImpDefIntIntname{ + + interface DefaultInt_S{ + + function deffunc():String; + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefIntname.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefIntname.as new file mode 100644 index 00000000000..b3eef57abbe --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefIntname.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import DefClassImpDefIntname.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Default class implements default interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + + +var obj:DefaultClassAccesor = new DefaultClassAccesor(); +//Default class implements a default interface with an interface name method +AddTestCase("Default class implements a default interface with an interface name method", "PASSED", obj.accdeffunc()); + + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefIntname/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefIntname/DefaultClass.as new file mode 100644 index 00000000000..d6c022ade52 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefIntname/DefaultClass.as @@ -0,0 +1,59 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Default Class DefaultClass + * Class methods + * + */ + +package DefClassImpDefIntname{ + + class DefaultClass implements DefaultInt{ + + + public function deffunc():String{ + return"PASSED"; + } + + + } + + public class DefaultClassAccesor{ + + var c:DefaultClass = new DefaultClass(); + var i:DefaultInt = c; + public function accdeffunc(){return i.deffunc();} + // access default function deffunc + + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefIntname/DefaultInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefIntname/DefaultInterface.as new file mode 100644 index 00000000000..62e463bde96 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefIntname/DefaultInterface.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Default Interface DefaultInterface + * Interface methods + * + */ + + +package DefClassImpDefIntname{ //package name + + interface DefaultInt{ + + function deffunc():String; + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefIntpubname.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefIntpubname.as new file mode 100644 index 00000000000..1ef94c028f1 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefIntpubname.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import DefClassImpDefIntpubname.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Default class implements default interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj:DefaultClassAccesor = new DefaultClassAccesor(); + +//Default class implements a default interface with a public interface name method +AddTestCase("Default class implements a default interface with a public interface name method", "PASSED", obj.accdeffunc()); + + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefIntpubname/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefIntpubname/DefaultClass.as new file mode 100644 index 00000000000..e2c39d8c4f3 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefIntpubname/DefaultClass.as @@ -0,0 +1,56 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Default Class DefaultClass + * Class methods + * + */ + +package DefClassImpDefIntpubname{ + + + class DefaultClass implements DefaultInt{ + public function deffunc():String{ //Default method + return"PASSED"; + } + + + } + + public class DefaultClassAccesor{ + var c:DefaultClass = new DefaultClass(); + public function accdeffunc(){return c.deffunc();} + // access default function deffunc + + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefIntpubname/DefaultInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefIntpubname/DefaultInterface.as new file mode 100644 index 00000000000..1527fc74cf6 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpDefIntpubname/DefaultInterface.as @@ -0,0 +1,48 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Default Interface DefaultInterface + * Interface methods + * + */ + + +package DefClassImpDefIntpubname{ //package name + + + + interface DefaultInt{ + + function deffunc():String; + + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalInt.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalInt.as new file mode 100644 index 00000000000..b83714a0ca6 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalInt.as @@ -0,0 +1,51 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import DefClassImpInternalInt.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Default class implements internal interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj:DefaultClassAccesor = new DefaultClassAccesor(); + +//Default class implements a default interface with a default method +AddTestCase("Default class implements an internal interface with a public method", "PASSED", obj.deffunc()); + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalInt/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalInt/DefaultClass.as new file mode 100644 index 00000000000..2c75ecf4160 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalInt/DefaultClass.as @@ -0,0 +1,51 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Default Class DefaultClass + * Class methods + * + */ + +package DefClassImpInternalInt{ + class DefaultClass implements InternalInt{ + + + public function deffunc():String{ + return"PASSED"; + } + + } + + public class DefaultClassAccesor extends DefaultClass{ + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalInt/InternalInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalInt/InternalInterface.as new file mode 100644 index 00000000000..ecd5aedb13c --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalInt/InternalInterface.as @@ -0,0 +1,46 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Internal Interface InternalInterface + * Interface methods + * + */ + + +package DefClassImpInternalInt{ //package name + + + internal interface InternalInt{ + + function deffunc():String; + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalIntInt.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalIntInt.as new file mode 100644 index 00000000000..232211e2151 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalIntInt.as @@ -0,0 +1,51 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import DefClassImpInternalIntInt.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Default class implements two internal interfaces"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj:DefaultClassAccesor = new DefaultClassAccesor(); + +//Default class implements two internal interfaces with a public method +AddTestCase("Default class implements two internal interfaces with a public method", "PASSED", obj.deffunc()); + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalIntInt/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalIntInt/DefaultClass.as new file mode 100644 index 00000000000..8212e18264a --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalIntInt/DefaultClass.as @@ -0,0 +1,55 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Default Class DefaultClass + * Class methods + * + */ + +package DefClassImpInternalIntInt{ + + + class DefaultClass implements InternalInt, InternalInt_S{ + + + public function deffunc():String{ + return"PASSED"; + } + + + } + + public class DefaultClassAccesor extends DefaultClass{ + + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalIntInt/DefaultInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalIntInt/DefaultInterface.as new file mode 100644 index 00000000000..808f2d57342 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalIntInt/DefaultInterface.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Default Interface DefaultInterface + * Interface methods + * + */ + + +package DefClassImpInternalIntInt{ //package name + + internal interface InternalInt{ + + function deffunc():String; + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalIntInt/DefaultInterface_S.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalIntInt/DefaultInterface_S.as new file mode 100644 index 00000000000..0b498956ac3 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalIntInt/DefaultInterface_S.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Default Interface DefaultInterface + * Interface methods + * + */ + + +package DefClassImpInternalIntInt{ //package name + + internal interface InternalInt_S{ + + function deffunc():String; + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalIntIntname.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalIntIntname.as new file mode 100644 index 00000000000..3742adc1a13 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalIntIntname.as @@ -0,0 +1,54 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import DefClassImpInternalIntIntname.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Default class implements two default interfaces"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + + +var obj:DefaultClassAccesor = new DefaultClassAccesor(); +//Default class implements the first internal interface with an interface name method +AddTestCase("Default class implements the first internal interface with an interface name method", "PASSED", obj.accdeffunc()); +//Default class implements the second internal interface with an interface name method +AddTestCase("Default class implements the second internal interface with an interface name method", "PASSED", obj.accdeffunc_s()); + + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalIntIntname/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalIntIntname/DefaultClass.as new file mode 100644 index 00000000000..550ae72d1a9 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalIntIntname/DefaultClass.as @@ -0,0 +1,61 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Default Class DefaultClass + * Class methods + * + */ + +package DefClassImpInternalIntIntname{ + + class DefaultClass implements InternalInt, InternalInt_S{ + + + public function deffunc():String{ + return"PASSED"; + } + + /*InternalInt_S function deffunc():String{ + return"PASSED"; + }*/ + + } + + public class DefaultClassAccesor{ + + var c:DefaultClass = new DefaultClass(); + public function accdeffunc(){return c.InternalInt::deffunc();} + public function accdeffunc_s(){return c.InternalInt_S::deffunc();} + + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalIntIntname/InternalInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalIntIntname/InternalInterface.as new file mode 100644 index 00000000000..2eb812f6504 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalIntIntname/InternalInterface.as @@ -0,0 +1,46 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Internal Interface InternalInterface + * Interface methods + * + */ + + +package DefClassImpInternalIntIntname{ + + + internal interface InternalInt{ + + function deffunc():String; + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalIntIntname/InternalInterface_S.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalIntIntname/InternalInterface_S.as new file mode 100644 index 00000000000..9e094a0a4f4 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalIntIntname/InternalInterface_S.as @@ -0,0 +1,46 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Internal Interface InternalInterface + * Interface methods + * + */ + + +package DefClassImpInternalIntIntname{ + + + internal interface InternalInt_S{ + + function deffunc():String; + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalIntname.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalIntname.as new file mode 100644 index 00000000000..8249ef580ec --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalIntname.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import DefClassImpInternalIntname.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Default class implements internal interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + + +var obj:DefaultClassAccesor = new DefaultClassAccesor(); + +//Default class implements a default interface with a default method +AddTestCase("Default class implements an internal interface with a public method", "PASSED", obj.accdeffunc()); + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalIntname/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalIntname/DefaultClass.as new file mode 100644 index 00000000000..41188bb9243 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalIntname/DefaultClass.as @@ -0,0 +1,58 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Default Class DefaultClass + * Class methods + * + */ + +package DefClassImpInternalIntname{ + + class DefaultClass implements InternalInt{ + + + public function deffunc():String{ + return"PASSED"; + } + + } + + public class DefaultClassAccesor{ + + var c:DefaultClass = new DefaultClass(); + var i:InternalInt = c; + public function accdeffunc(){return i.deffunc();} + // access default function deffunc + + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalIntname/InternalInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalIntname/InternalInterface.as new file mode 100644 index 00000000000..f70df9e3939 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalIntname/InternalInterface.as @@ -0,0 +1,51 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Internal Interface InternalInterface + * Interface methods + * + */ + + +package DefClassImpInternalIntname{ //package name + + //namespace ns; + //namespace + + internal interface InternalInt{ + + function deffunc():String; + + //public function pubFunc():Boolean; //Public attribute method + + // ns function nsFunc(a="test"):int; //Namespace attribute method + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalIntpubname.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalIntpubname.as new file mode 100644 index 00000000000..b55c31d410e --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalIntpubname.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import DefClassImpInternalIntpubname.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Default class implements internal interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj:DefaultClassAccesor = new DefaultClassAccesor(); + + +//Default class implements a default interface with a public interface name method +AddTestCase("Default class implements an internal interface with a public interface name method", "PASSED", obj.accdeffunc()); + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalIntpubname/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalIntpubname/DefaultClass.as new file mode 100644 index 00000000000..aedfa95e161 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalIntpubname/DefaultClass.as @@ -0,0 +1,53 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Default Class DefaultClass + * Class methods + * + */ + +package DefClassImpInternalIntpubname{ + + class DefaultClass implements InternalInt{ + + + public function deffunc():String{ + return"PASSED"; + } + } + + public class DefaultClassAccesor{ + var c:DefaultClass = new DefaultClass(); + public function accdeffunc(){return c.deffunc();} + // access default function deffunc + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalIntpubname/InternalInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalIntpubname/InternalInterface.as new file mode 100644 index 00000000000..e6de90dde0c --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpInternalIntpubname/InternalInterface.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Internal Interface InternalInterface + * Interface methods + * + */ + + +package DefClassImpInternalIntpubname{ //package name + + internal interface InternalInt{ + + function deffunc():String; //Default attribute method + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicInt.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicInt.as new file mode 100644 index 00000000000..12e1af415a7 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicInt.as @@ -0,0 +1,56 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import DefClassImpPublicInt.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Default class implements public interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + + +var obj:DefaultClassAccesor = new DefaultClassAccesor(); + + +//Default class implements a default interface with a public method +AddTestCase("Default class implements a public interface with a public method", "PASSED",obj.deffunc()); + + +//////////////////////////////////////////////////////////////// + +//} + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicInt/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicInt/DefaultClass.as new file mode 100644 index 00000000000..eb4b40edbcc --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicInt/DefaultClass.as @@ -0,0 +1,51 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Default Class DefaultClass + * Class methods + * + */ + +package DefClassImpPublicInt{ + + class DefaultClass implements PublicInt{ + + + public function deffunc():String{ + return"PASSED"; + } + } + + public class DefaultClassAccesor extends DefaultClass{ + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicInt/PublicInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicInt/PublicInterface.as new file mode 100644 index 00000000000..d10868f016a --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicInt/PublicInterface.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Public Interface PublicInterface + * Interface methods + * + */ + + +package DefClassImpPublicInt{ //package name + + public interface PublicInt{ + + function deffunc():String; + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicIntInt.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicIntInt.as new file mode 100644 index 00000000000..bfe430c80b0 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicIntInt.as @@ -0,0 +1,56 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import DefClassImpPublicIntInt.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Default class implements public interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + + +var obj:DefaultClassAccesor = new DefaultClassAccesor(); + + +//Default class implement two public interface with a public method +AddTestCase("Default class implement two public interface with a public method", "PASSED",obj.deffunc()); + + +//////////////////////////////////////////////////////////////// + +//} + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicIntInt/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicIntInt/DefaultClass.as new file mode 100644 index 00000000000..539b960b136 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicIntInt/DefaultClass.as @@ -0,0 +1,51 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Default Class DefaultClass + * Class methods + * + */ + +package DefClassImpPublicIntInt{ + + class DefaultClass implements PublicInt, PublicInt_S{ + + + public function deffunc():String{ + return"PASSED"; + } + } + + public class DefaultClassAccesor extends DefaultClass{ + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicIntInt/PublicInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicIntInt/PublicInterface.as new file mode 100644 index 00000000000..5f037f49ed5 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicIntInt/PublicInterface.as @@ -0,0 +1,44 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Public Interface PublicInterface + * Interface methods + * + */ + + +package DefClassImpPublicIntInt{ + public interface PublicInt{ + + function deffunc():String; + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicIntInt/PublicInterface_S.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicIntInt/PublicInterface_S.as new file mode 100644 index 00000000000..af7bf33e33e --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicIntInt/PublicInterface_S.as @@ -0,0 +1,44 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Public Interface PublicInterface + * Interface methods + * + */ + + +package DefClassImpPublicIntInt{ + public interface PublicInt_S{ + + function deffunc():String; + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicIntIntname.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicIntIntname.as new file mode 100644 index 00000000000..d91bc78bda1 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicIntIntname.as @@ -0,0 +1,54 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import DefClassImpPublicIntIntname.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Default class implements two default interfaces"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + + +var obj:DefaultClassAccesor = new DefaultClassAccesor(); +//Default class implements the first public interface with an interface name method +AddTestCase("Default class implements the first public interface with an interface name method", "PASSED", obj.accdeffunc()); +//Default class implements the second public interface with an interface name method +AddTestCase("Default class implements the second public interface with an interface name method", "PASSED", obj.accdeffunc_s()); + + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicIntIntname/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicIntIntname/DefaultClass.as new file mode 100644 index 00000000000..e3475c6e9af --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicIntIntname/DefaultClass.as @@ -0,0 +1,57 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Default Class DefaultClass + * Class methods + * + */ + +package DefClassImpPublicIntIntname{ + + class DefaultClass implements PublicInt,PublicInt_S{ + + + public function deffunc():String{ + return"PASSED"; + } + /*PublicInt_S function deffunc():String{ + return"PASSED"; + }*/ + } + + public class DefaultClassAccesor{ + var c:DefaultClass = new DefaultClass(); + public function accdeffunc(){return c.PublicInt::deffunc();} + public function accdeffunc_s(){return c.PublicInt_S::deffunc();} + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicIntIntname/PublicInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicIntIntname/PublicInterface.as new file mode 100644 index 00000000000..53e0238224b --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicIntIntname/PublicInterface.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Public Interface PublicInterface + * Interface methods + * + */ + + +package DefClassImpPublicIntIntname{ + + public interface PublicInt{ + + function deffunc():String; + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicIntIntname/PublicInterface_S.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicIntIntname/PublicInterface_S.as new file mode 100644 index 00000000000..02a3dcd3113 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicIntIntname/PublicInterface_S.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Public Interface PublicInterface + * Interface methods + * + */ + + +package DefClassImpPublicIntIntname{ + + public interface PublicInt_S{ + + function deffunc():String; + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicIntname.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicIntname.as new file mode 100644 index 00000000000..4abc848f1ee --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicIntname.as @@ -0,0 +1,56 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import DefClassImpPublicIntname.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Default class implements public interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + + +var obj:DefaultClassAccesor = new DefaultClassAccesor(); + + +//Default class implements a default interface with an interface name method +AddTestCase("Default class implements a public interface with an interface name method", "PASSED",obj.accdeffunc()); + + +//////////////////////////////////////////////////////////////// + +//} + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicIntname/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicIntname/DefaultClass.as new file mode 100644 index 00000000000..069d997cfb0 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicIntname/DefaultClass.as @@ -0,0 +1,54 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Default Class DefaultClass + * Class methods + * + */ + +package DefClassImpPublicIntname{ + + class DefaultClass implements PublicInt{ + + + public function deffunc():String{ + return"PASSED"; + } + } + + public class DefaultClassAccesor{ + var c:DefaultClass = new DefaultClass(); + var i:PublicInt = c; + public function accdeffunc(){return i.deffunc();} + // access default function deffunc + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicIntname/PublicInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicIntname/PublicInterface.as new file mode 100644 index 00000000000..26a2a30e23f --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicIntname/PublicInterface.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Public Interface PublicInterface + * Interface methods + * + */ + + +package DefClassImpPublicIntname{ //package name + + public interface PublicInt{ + + function deffunc():String; + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicIntpubname.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicIntpubname.as new file mode 100644 index 00000000000..0349a6810ae --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicIntpubname.as @@ -0,0 +1,54 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import DefClassImpPublicIntpubname.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Default class implements public interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + + +var obj:DefaultClassAccesor = new DefaultClassAccesor(); + +//Default class implements a default interface with a public name interface method +AddTestCase("Default class implements a public interface with a public name interface method", "PASSED",obj.accdeffunc()); + +//////////////////////////////////////////////////////////////// + +//} + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicIntpubname/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicIntpubname/DefaultClass.as new file mode 100644 index 00000000000..10e7977de75 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicIntpubname/DefaultClass.as @@ -0,0 +1,53 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Default Class DefaultClass + * Class methods + * + */ + +package DefClassImpPublicIntpubname{ + class DefaultClass implements PublicInt{ + + + public function deffunc():String{ + return"PASSED"; + } + } + + public class DefaultClassAccesor{ + var c:DefaultClass = new DefaultClass(); + var i:PublicInt = c; + public function accdeffunc(){return i.deffunc();} + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicIntpubname/PublicInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicIntpubname/PublicInterface.as new file mode 100644 index 00000000000..f601da23ea4 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DefClassImpPublicIntpubname/PublicInterface.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Public Interface PublicInterface + * Interface methods + * + */ + + +package DefClassImpPublicIntpubname{ //package name + + public interface PublicInt{ + + function deffunc():String; + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpDefInt.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpDefInt.as new file mode 100644 index 00000000000..58063cd12dd --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpDefInt.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import DynamicClassImpDefInt.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Dynamic class implements default interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new DynamicClassAccessor(); + +//Dynamic class implements a default interface with a public method +AddTestCase("Dynamic class implements a default interface with a public method", "PASSED", obj.accdeffunc()); + + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpDefInt/DefaultInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpDefInt/DefaultInterface.as new file mode 100644 index 00000000000..3847b952588 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpDefInt/DefaultInterface.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Default Interface DefaultInterface + * Interface methods + * + */ + + +package DynamicClassImpDefInt{ + + interface DefaultInt{ + + function deffunc():String; + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpDefInt/DynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpDefInt/DynamicClass.as new file mode 100644 index 00000000000..a882c158485 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpDefInt/DynamicClass.as @@ -0,0 +1,59 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Dynamic Class DynamicClass + * Class methods + * + */ + +package DynamicClassImpDefInt{ + + dynamic class DynamicClass implements DefaultInt{ + + + public function deffunc():String{ + return"PASSED"; + } + + } + + public class DynamicClassAccessor{ + + var acc:DynamicClass; + + public function DynamicClassAccessor(){ + acc = new DynamicClass(); + } + + public function accdeffunc():String{return acc.deffunc();} + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpDefIntname.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpDefIntname.as new file mode 100644 index 00000000000..779d2658118 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpDefIntname.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import DynamicClassImpDefIntname.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Dynamic class implements default interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new DynamicClassAccessor(); + +//Dynamic class implements a default interface with an interface name method +AddTestCase("Dynamic class implements a default interface with an interface name method", "PASSED", obj.accdeffunc()); + + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpDefIntname/DefaultInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpDefIntname/DefaultInterface.as new file mode 100644 index 00000000000..7352b6ec6a7 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpDefIntname/DefaultInterface.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Default Interface DefaultInterface + * Interface methods + * + */ + + +package DynamicClassImpDefIntname{ + + interface DefaultInt{ + + function deffunc():String; + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpDefIntname/DynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpDefIntname/DynamicClass.as new file mode 100644 index 00000000000..fe050fe36ba --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpDefIntname/DynamicClass.as @@ -0,0 +1,55 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Dynamic Class DynamicClass + * Class methods + * + */ + +package DynamicClassImpDefIntname{ + + class DynamicClass implements DefaultInt{ + public function deffunc():String{ + return"PASSED"; + } + + } + + public class DynamicClassAccessor{ + var acc:DynamicClass= new DynamicClass(); + var i:DefaultInt=acc; + + + public function accdeffunc():String{return i.deffunc();} + + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpDefIntpubname.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpDefIntpubname.as new file mode 100644 index 00000000000..6ae46821b05 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpDefIntpubname.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import DynamicClassImpDefIntpubname.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Dynamic class implements default interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new DynamicClassAccessor(); + +//Dynamic class implements a default interface with a public interface name method +AddTestCase("Dynamic class implements a default interface with a public interface name method", "PASSED", obj.accdeffunc()); + + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpDefIntpubname/DefaultInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpDefIntpubname/DefaultInterface.as new file mode 100644 index 00000000000..7c3fa7a96c5 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpDefIntpubname/DefaultInterface.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Default Interface DefaultInterface + * Interface methods + * + */ + + +package DynamicClassImpDefIntpubname{ + + interface DefaultInt{ + + function deffunc():String; + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpDefIntpubname/DynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpDefIntpubname/DynamicClass.as new file mode 100644 index 00000000000..44caf1822d1 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpDefIntpubname/DynamicClass.as @@ -0,0 +1,55 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Dynamic Class DynamicClass + * Class methods + * + */ + +package DynamicClassImpDefIntpubname{ + + dynamic class DynamicClass implements DefaultInt{ + + + public function deffunc():String{ + return"PASSED"; + } + + } + + public class DynamicClassAccessor{ + + var acc:DynamicClass = new DynamicClass(); + + public function accdeffunc():String{return acc.deffunc();} + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpInternalInt.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpInternalInt.as new file mode 100644 index 00000000000..53b89dc4149 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpInternalInt.as @@ -0,0 +1,51 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import DynamicClassImpInternalInt.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Dynamic class implements internal interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new DynamicClassAccessor(); + +//Dynamic class implements an internal interface with a public method +AddTestCase("Dynamic class implements an internal interface with a public method", "PASSED", obj.accdeffunc()); + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpInternalInt/DynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpInternalInt/DynamicClass.as new file mode 100644 index 00000000000..d0e1014d02b --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpInternalInt/DynamicClass.as @@ -0,0 +1,63 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Dynamic Class DynamicClass + * Class methods + * + */ + +package DynamicClassImpInternalInt{ + //namespace ns; + //use namespace ns; + + dynamic class DynamicClass implements InternalInt{ + + public function deffunc():String + { + return"PASSED"; + } + + } + + public class DynamicClassAccessor + { + var acc:DynamicClass; + + public function DynamicClassAccessor() + { + acc = new DynamicClass(); + } + + public function accdeffunc():String{ + return acc.deffunc() + } + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpInternalInt/InternalInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpInternalInt/InternalInterface.as new file mode 100644 index 00000000000..5cd917fa3ad --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpInternalInt/InternalInterface.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Internal Interface InternalInterface + * Interface methods + * + */ + + +package DynamicClassImpInternalInt{ + + internal interface InternalInt{ + + function deffunc():String; + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpInternalIntname.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpInternalIntname.as new file mode 100644 index 00000000000..d941312c558 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpInternalIntname.as @@ -0,0 +1,51 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import DynamicClassImpInternalIntname.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Dynamic class implements internal interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new DynamicClassAccessor(); + +//Dynamic class implements an internal interface with a public method +AddTestCase("Dynamic class implements an internal interface with a public method", "PASSED", obj.accdeffunc()); + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpInternalIntname/DynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpInternalIntname/DynamicClass.as new file mode 100644 index 00000000000..139d09f755f --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpInternalIntname/DynamicClass.as @@ -0,0 +1,60 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Dynamic Class DynamicClass + * Class methods + * + */ + +package DynamicClassImpInternalIntname{ + + dynamic class DynamicClass implements InternalInt{ + + + public function deffunc():String{ + return"PASSED"; + } + + } + + public class DynamicClassAccessor{ + + var acc:DynamicClass; + var i:InternalInt; + + public function DynamicClassAccessor(){ + acc = new DynamicClass(); + i=acc; + } + + public function accdeffunc():String{return i.deffunc();} + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpInternalIntname/InternalInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpInternalIntname/InternalInterface.as new file mode 100644 index 00000000000..af23de73f2f --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpInternalIntname/InternalInterface.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Internal Interface InternalInterface + * Interface methods + * + */ + + +package DynamicClassImpInternalIntname{ + + internal interface InternalInt{ + + function deffunc():String; + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpInternalIntpubname.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpInternalIntpubname.as new file mode 100644 index 00000000000..6b58e03168e --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpInternalIntpubname.as @@ -0,0 +1,51 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import DynamicClassImpInternalIntpubname.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Dynamic class implements internal interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new DynamicClassAccessor(); + +//Dynamic class implements an internal interface with a public interface name method +AddTestCase("Dynamic class implements an internal interface with a public interface name method", "PASSED", obj.accdeffunc()); + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpInternalIntpubname/DynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpInternalIntpubname/DynamicClass.as new file mode 100644 index 00000000000..58365a28c5c --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpInternalIntpubname/DynamicClass.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Dynamic Class DynamicClass + * Class methods + * + */ + +package DynamicClassImpInternalIntpubname{ + dynamic class DynamicClass implements InternalInt{ + + public function deffunc():String{ + return"PASSED"; + } + + } + + public class DynamicClassAccessor{ + + var acc:DynamicClass = new DynamicClass(); + + public function accdeffunc():String{return acc.deffunc();} + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpInternalIntpubname/InternalInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpInternalIntpubname/InternalInterface.as new file mode 100644 index 00000000000..f0f32280e7a --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpInternalIntpubname/InternalInterface.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Internal Interface InternalInterface + * Interface methods + * + */ + + +package DynamicClassImpInternalIntpubname{ + + internal interface InternalInt{ + + function deffunc():String; + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpPublicInt.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpPublicInt.as new file mode 100644 index 00000000000..b0cce836753 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpPublicInt.as @@ -0,0 +1,51 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import DynamicClassImpPublicInt.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Dynamic class implements public interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new DynamicClassAccessor(); + +//Dynamic class implements a public interface with a public interface name method +AddTestCase("Dynamic class implements a public interface with a public interface name method", "PASSED", obj.accdeffunc()); + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpPublicInt/DynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpPublicInt/DynamicClass.as new file mode 100644 index 00000000000..6d211359a0f --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpPublicInt/DynamicClass.as @@ -0,0 +1,60 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Dynamic Class DynamicClass + * Class methods + * + */ + +package DynamicClassImpPublicInt{ + + dynamic class DynamicClass implements PublicInt{ + + + public function deffunc():String{ + return"PASSED"; + } + + + } + + public class DynamicClassAccessor{ + + var acc:DynamicClass; + + public function DynamicClassAccessor(){ + acc = new DynamicClass(); + } + + public function accdeffunc():String{return acc.deffunc();} + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpPublicInt/PublicInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpPublicInt/PublicInterface.as new file mode 100644 index 00000000000..907208b3278 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpPublicInt/PublicInterface.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Public Interface InternalInterface + * Public methods + * + */ + + +package DynamicClassImpPublicInt{ + + public interface PublicInt{ + + function deffunc():String; + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpPublicIntname.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpPublicIntname.as new file mode 100644 index 00000000000..6400f9aad64 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpPublicIntname.as @@ -0,0 +1,51 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import DynamicClassImpPublicIntname.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Dynamic class implements public interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new DynamicClassAccessor(); + +//Dynamic class implements a public interface with an interface name method +AddTestCase("Dynamic class implements a public interface with an interface name method", "PASSED", obj.accdeffunc()); + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpPublicIntname/DynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpPublicIntname/DynamicClass.as new file mode 100644 index 00000000000..e23e935cf02 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpPublicIntname/DynamicClass.as @@ -0,0 +1,62 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Dynamic Class DynamicClass + * Class methods + * + */ + +package DynamicClassImpPublicIntname{ + + dynamic class DynamicClass implements PublicInt{ + + + public function deffunc():String{ + return"PASSED"; + } + + + } + + public class DynamicClassAccessor{ + + var acc:DynamicClass; + var i:PublicInt; + + public function DynamicClassAccessor(){ + acc = new DynamicClass(); + i=acc; + } + + public function accdeffunc():String{return i.deffunc();} + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpPublicIntname/PublicInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpPublicIntname/PublicInterface.as new file mode 100644 index 00000000000..92048e9a105 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpPublicIntname/PublicInterface.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Public Interface InternalInterface + * Public methods + * + */ + + +package DynamicClassImpPublicIntname{ + + public interface PublicInt{ + + function deffunc():String; + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpPublicIntpubname.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpPublicIntpubname.as new file mode 100644 index 00000000000..3f71bb0170e --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpPublicIntpubname.as @@ -0,0 +1,51 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import DynamicClassImpPublicIntpubname.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Dynamic class implements public interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new DynamicClassAccessor(); + +//Dynamic class implements a public interface with a public interface name method +AddTestCase("Dynamic class implements a public interface with a public interface name method", "PASSED", obj.accdeffunc()); + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpPublicIntpubname/DynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpPublicIntpubname/DynamicClass.as new file mode 100644 index 00000000000..7a7e2516e79 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpPublicIntpubname/DynamicClass.as @@ -0,0 +1,60 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Dynamic Class DynamicClass + * Class methods + * + */ + +package DynamicClassImpPublicIntpubname{ + + dynamic class DynamicClass implements PublicInt{ + + + public function deffunc():String{ + return"PASSED"; + } + + + } + + public class DynamicClassAccessor{ + + var acc:DynamicClass; + + public function DynamicClassAccessor(){ + acc = new DynamicClass(); + } + + public function accdeffunc():String{return acc.deffunc();} + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpPublicIntpubname/PublicInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpPublicIntpubname/PublicInterface.as new file mode 100644 index 00000000000..badcb8b0aa0 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/DynamicClassImpPublicIntpubname/PublicInterface.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Public Interface InternalInterface + * Public methods + * + */ + + +package DynamicClassImpPublicIntpubname{ + + public interface PublicInt{ + + function deffunc():String; + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefInt.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefInt.as new file mode 100644 index 00000000000..3551ff9e01d --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefInt.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import FinalClassImpDefInt.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Final class implements default interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new ClassGet(); + +//Final class implements a default interface with a public method +AddTestCase("Final class implements a default interface with a public method", "PASSED", obj.accdeffunc()); + + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefInt/DefaultInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefInt/DefaultInterface.as new file mode 100644 index 00000000000..8a422455950 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefInt/DefaultInterface.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Default Interface DefaultInterface + * Interface methods + * + */ + + +package FinalClassImpDefInt{ + + interface DefaultInt{ + + function deffunc():String; + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefInt/FinalClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefInt/FinalClass.as new file mode 100644 index 00000000000..3a45aea2f37 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefInt/FinalClass.as @@ -0,0 +1,53 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Final Class FinalClass + * Class methods + * + */ + +package FinalClassImpDefInt{ + + final class FinalClass implements DefaultInt{ + + public function deffunc():String{ + return"PASSED"; + } + + } + +public class ClassGet { + private var obj:FinalClass = new FinalClass(); + + public function accdeffunc():String{return obj.deffunc();} + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefIntInt.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefIntInt.as new file mode 100644 index 00000000000..9b4fa9a7277 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefIntInt.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import FinalClassImpDefIntInt.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Final class implements default interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new ClassGet(); + +//Final class implements two default interfaces with a public method +AddTestCase("Final class implements two default interfaces with a public method", "PASSED", obj.accdeffunc()); + + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefIntInt/DefaultInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefIntInt/DefaultInterface.as new file mode 100644 index 00000000000..60d1bfb0588 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefIntInt/DefaultInterface.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Default Interface DefaultInterface + * Interface methods + * + */ + + +package FinalClassImpDefIntInt{ + + interface DefaultInt{ + + function deffunc():String; + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefIntInt/DefaultInterface_S.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefIntInt/DefaultInterface_S.as new file mode 100644 index 00000000000..927ebe9d1ff --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefIntInt/DefaultInterface_S.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Default Interface DefaultInterface + * Interface methods + * + */ + + +package FinalClassImpDefIntInt{ + + interface DefaultInt_S{ + + function deffunc():String; + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefIntInt/FinalClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefIntInt/FinalClass.as new file mode 100644 index 00000000000..cc818644d1c --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefIntInt/FinalClass.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Final Class FinalClass + * Class methods + * + */ + +package FinalClassImpDefIntInt{ + + final class FinalClass implements DefaultInt, DefaultInt_S{ + + public function deffunc():String{ + return"PASSED"; + } + + } + +public class ClassGet { + private var obj:FinalClass = new FinalClass(); + public function accdeffunc():String{return obj.deffunc();} + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefIntIntname.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefIntIntname.as new file mode 100644 index 00000000000..12bc572cf60 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefIntIntname.as @@ -0,0 +1,54 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import FinalClassImpDefIntIntname.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Final class implements default interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new ClassGet(); + +//Final class implements the first default interface with an interface name method +AddTestCase("Final class implements the first default interface with an interface name method", "PASSED", obj.accdeffunc()); +//Final class implements the second default interface with an interface name method +AddTestCase("Final class implements the second default interface with an interface name method", "PASSED", obj.accdeffunc_s()); + + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefIntIntname/DefaultInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefIntIntname/DefaultInterface.as new file mode 100644 index 00000000000..e46bbd30a22 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefIntIntname/DefaultInterface.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Default Interface DefaultInterface + * Interface methods + * + */ + + +package FinalClassImpDefIntIntname{ + + interface DefaultInt{ + + function deffunc():String; + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefIntIntname/DefaultInterface_S.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefIntIntname/DefaultInterface_S.as new file mode 100644 index 00000000000..1845350faf9 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefIntIntname/DefaultInterface_S.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Default Interface DefaultInterface + * Interface methods + * + */ + + +package FinalClassImpDefIntIntname{ + + interface DefaultInt_S{ + + function deffunc():String; + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefIntIntname/FinalClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefIntIntname/FinalClass.as new file mode 100644 index 00000000000..4eaab2793e3 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefIntIntname/FinalClass.as @@ -0,0 +1,59 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Final Class FinalClass + * Class methods + * + */ + +package FinalClassImpDefIntIntname{ + + final class FinalClass implements DefaultInt, DefaultInt_S{ + + public function deffunc():String{ + return"PASSED"; + } + /*DefaultInt_S function deffunc():String{ + return"PASSED"; + }*/ + + } + +public class ClassGet { + + private var obj:FinalClass = new FinalClass(); + var i:DefaultInt = obj; + var i_s:DefaultInt_S = obj; + public function accdeffunc(){return i.deffunc();} + public function accdeffunc_s(){return i_s.deffunc();} + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefIntname.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefIntname.as new file mode 100644 index 00000000000..034b69c0c13 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefIntname.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import FinalClassImpDefIntname.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Final class implements default interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new ClassGet(); + +//Final class implements a default interface with an interface name method +AddTestCase("Final class implements a default interface with an interface name method", "PASSED", obj.accdeffunc()); + + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefIntname/DefaultInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefIntname/DefaultInterface.as new file mode 100644 index 00000000000..30941832f86 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefIntname/DefaultInterface.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Default Interface DefaultInterface + * Interface methods + * + */ + + +package FinalClassImpDefIntname{ + + interface DefaultInt{ + + function deffunc():String; + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefIntname/FinalClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefIntname/FinalClass.as new file mode 100644 index 00000000000..cd6862ae923 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefIntname/FinalClass.as @@ -0,0 +1,54 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Final Class FinalClass + * Class methods + * + */ + +package FinalClassImpDefIntname{ + + final class FinalClass implements DefaultInt{ + + public function deffunc():String{ + return"PASSED"; + } + + } + +public class ClassGet { + + private var obj:FinalClass = new FinalClass(); + var i:DefaultInt = obj; + public function accdeffunc(){return i.deffunc();} + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefIntpubname.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefIntpubname.as new file mode 100644 index 00000000000..d2f5980b7cd --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefIntpubname.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import FinalClassImpDefIntpubname.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Final class implements default interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new ClassGet(); + +//Final class implements a default interface with a public interface name method +AddTestCase("Final class implements a default interface with a public interface name method", "PASSED", obj.accdeffunc()); + + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefIntpubname/DefaultInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefIntpubname/DefaultInterface.as new file mode 100644 index 00000000000..9cc96a710fe --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefIntpubname/DefaultInterface.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Default Interface DefaultInterface + * Interface methods + * + */ + + +package FinalClassImpDefIntpubname{ + + interface DefaultInt{ + + function deffunc():String; + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefIntpubname/FinalClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefIntpubname/FinalClass.as new file mode 100644 index 00000000000..cc6e6321bd9 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpDefIntpubname/FinalClass.as @@ -0,0 +1,53 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Final Class FinalClass + * Class methods + * + */ + +package FinalClassImpDefIntpubname{ + + final class FinalClass implements DefaultInt{ + + public function deffunc():String{ + return"PASSED"; + } + + } + +public class ClassGet { + + private var obj:FinalClass = new FinalClass(); + public function accdeffunc(){return obj.deffunc();} + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalInt.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalInt.as new file mode 100644 index 00000000000..42b16db575a --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalInt.as @@ -0,0 +1,51 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import FinalClassImpInternalInt.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Final class implements internal interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new ClassGet(); + +//Final class implements an internal interface with a public method +AddTestCase("Final class implements an internal interface with a public method", "PASSED", obj.accdeffunc()); + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalInt/FinalClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalInt/FinalClass.as new file mode 100644 index 00000000000..7843e5cdb86 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalInt/FinalClass.as @@ -0,0 +1,54 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Final Class FinalClass + * Class methods + * + */ + +package FinalClassImpInternalInt{ + + final class FinalClass implements InternalInt{ + + public function deffunc():String{ + return"PASSED"; + } + + } + +public class ClassGet { + private var obj:FinalClass = new FinalClass(); + + public function accdeffunc():String{return obj.deffunc();} + // access default function deffunc + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalInt/InternalInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalInt/InternalInterface.as new file mode 100644 index 00000000000..b03368fc181 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalInt/InternalInterface.as @@ -0,0 +1,44 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Internal Interface InternalInterface + * Interface methods + * + */ + + +package FinalClassImpInternalInt{ + + internal interface InternalInt{ + + function deffunc():String; + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalIntInt.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalIntInt.as new file mode 100644 index 00000000000..bd4f429565a --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalIntInt.as @@ -0,0 +1,51 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import FinalClassImpInternalIntInt.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Final class implements internal interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new ClassGet(); + +//Final class implements two internal interfaces with a public method +AddTestCase("Final class implements two internal interfaces with a public method", "PASSED", obj.accdeffunc()); + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalIntInt/FinalClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalIntInt/FinalClass.as new file mode 100644 index 00000000000..bc6e9bef380 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalIntInt/FinalClass.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Final Class FinalClass + * Class methods + * + */ + +package FinalClassImpInternalIntInt{ + + final class FinalClass implements InternalInt, InternalInt_S { + + public function deffunc():String{ + return"PASSED"; + } + + } + +public class ClassGet { + private var obj:FinalClass = new FinalClass(); + public function accdeffunc():String { return obj.deffunc();} + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalIntInt/InternalInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalIntInt/InternalInterface.as new file mode 100644 index 00000000000..f32b9cee913 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalIntInt/InternalInterface.as @@ -0,0 +1,43 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Internal Interface InternalInterface + * Interface methods + * + */ + +package FinalClassImpInternalIntInt{ + + internal interface InternalInt{ + + function deffunc():String; + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalIntInt/InternalInterface_S.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalIntInt/InternalInterface_S.as new file mode 100644 index 00000000000..d8564842105 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalIntInt/InternalInterface_S.as @@ -0,0 +1,43 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Internal Interface InternalInterface + * Interface methods + * + */ + +package FinalClassImpInternalIntInt{ + + internal interface InternalInt_S{ + + function deffunc():String; + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalIntIntname.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalIntIntname.as new file mode 100644 index 00000000000..ae62b3ea608 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalIntIntname.as @@ -0,0 +1,53 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import FinalClassImpInternalIntIntname.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Final class implements internal interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new ClassGet(); + +//Final class implements the first internal interface with an interface name method +AddTestCase("Final class implements the first internal interface with an interface name method", "PASSED", obj.accdeffunc()); +//Final class implements the second internal interface with an interface name method +AddTestCase("Final class implements the second internal interface with an interface name method", "PASSED", obj.accdeffunc_s()); + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalIntIntname/FinalClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalIntIntname/FinalClass.as new file mode 100644 index 00000000000..fd1299f4a9f --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalIntIntname/FinalClass.as @@ -0,0 +1,57 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Final Class FinalClass + * Class methods + * + */ + +package FinalClassImpInternalIntIntname{ + + final class FinalClass implements InternalInt, InternalInt_S{ + + public function deffunc():String{ + return"PASSED"; + } + /* InternalInt_S function deffunc():String{ + return"PASSED"; + }*/ + + } + +public class ClassGet { + private var obj:FinalClass = new FinalClass(); + + public function accdeffunc():String{return obj.InternalInt::deffunc();} + public function accdeffunc_s():String{return obj.InternalInt_S::deffunc();} + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalIntIntname/InternalInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalIntIntname/InternalInterface.as new file mode 100644 index 00000000000..f0d4a535895 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalIntIntname/InternalInterface.as @@ -0,0 +1,44 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Internal Interface InternalInterface + * Interface methods + * + */ + + +package FinalClassImpInternalIntIntname{ + + internal interface InternalInt{ + + function deffunc():String; + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalIntIntname/InternalInterface_S.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalIntIntname/InternalInterface_S.as new file mode 100644 index 00000000000..3e9195cc64d --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalIntIntname/InternalInterface_S.as @@ -0,0 +1,44 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Internal Interface InternalInterface + * Interface methods + * + */ + + +package FinalClassImpInternalIntIntname{ + + internal interface InternalInt_S{ + + function deffunc():String; + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalIntname.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalIntname.as new file mode 100644 index 00000000000..bcbbc0b3654 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalIntname.as @@ -0,0 +1,51 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import FinalClassImpInternalIntname.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Final class implements internal interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new ClassGet(); + +//Final class implements an internal interface with an interface name method +AddTestCase("Final class implements an internal interface with an interface name method", "PASSED", obj.accdeffunc()); + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalIntname/FinalClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalIntname/FinalClass.as new file mode 100644 index 00000000000..d1d31896a36 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalIntname/FinalClass.as @@ -0,0 +1,53 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Final Class FinalClass + * Class methods + * + */ + +package FinalClassImpInternalIntname{ + + final class FinalClass implements InternalInt{ + + public function deffunc():String{ + return"PASSED"; + } + + } + +public class ClassGet { + private var obj:FinalClass = new FinalClass(); + var i:InternalInt = obj; + public function accdeffunc():String{return i.deffunc();} + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalIntname/InternalInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalIntname/InternalInterface.as new file mode 100644 index 00000000000..682d0cc8c29 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalIntname/InternalInterface.as @@ -0,0 +1,44 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Internal Interface InternalInterface + * Interface methods + * + */ + + +package FinalClassImpInternalIntname{ + + internal interface InternalInt{ + + function deffunc():String; + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalIntpubname.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalIntpubname.as new file mode 100644 index 00000000000..cf4a4fdb7af --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalIntpubname.as @@ -0,0 +1,51 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import FinalClassImpInternalIntpubname.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Final class implements internal interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new ClassGet(); + +//Final class implements an internal interface with a public interface name method +AddTestCase("Final class implements an internal interface with a public interface name method", "PASSED", obj.accdeffunc()); + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalIntpubname/FinalClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalIntpubname/FinalClass.as new file mode 100644 index 00000000000..8cf2149b1a5 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalIntpubname/FinalClass.as @@ -0,0 +1,54 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Final Class FinalClass + * Class methods + * + */ + +package FinalClassImpInternalIntpubname{ + + final class FinalClass implements InternalInt{ + + public function deffunc():String{ + return"PASSED"; + } + + } + +public class ClassGet { + private var obj:FinalClass = new FinalClass(); + + public function accdeffunc():String{return obj.deffunc();} + // access default function deffunc + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalIntpubname/InternalInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalIntpubname/InternalInterface.as new file mode 100644 index 00000000000..792a925292c --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpInternalIntpubname/InternalInterface.as @@ -0,0 +1,44 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Internal Interface InternalInterface + * Interface methods + * + */ + + +package FinalClassImpInternalIntpubname{ + + internal interface InternalInt{ + + function deffunc():String; + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicInt.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicInt.as new file mode 100644 index 00000000000..ba20ba01ce6 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicInt.as @@ -0,0 +1,50 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import FinalClassImpPublicInt.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Final class implements public interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new ClassGet(); +//Final class implements a public interface with a public method +AddTestCase("Final class implements a public interface with a public method", "PASSED", obj.accdeffunc()); + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicInt/FinalClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicInt/FinalClass.as new file mode 100644 index 00000000000..840d53fa067 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicInt/FinalClass.as @@ -0,0 +1,54 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Final Class FinalClass + * Class methods + * + */ + +package FinalClassImpPublicInt{ + + final class FinalClass implements PublicInt{ + + public function deffunc():String{ + return"PASSED"; + } + + } + +public class ClassGet { + private var obj:FinalClass = new FinalClass(); + + public function accdeffunc():String{return obj.deffunc();} + // access default function deffunc + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicInt/PublicInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicInt/PublicInterface.as new file mode 100644 index 00000000000..13c3d4f2d40 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicInt/PublicInterface.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Internal Interface InternalInterface + * Interface methods + * + */ + + +package FinalClassImpPublicInt{ + + public interface PublicInt{ + + function deffunc():String; + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicIntInt.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicIntInt.as new file mode 100644 index 00000000000..c9b02a80db4 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicIntInt.as @@ -0,0 +1,50 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import FinalClassImpPublicIntInt.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Final class implements public interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new ClassGet(); +//Final class implements two public interfaces with a public method +AddTestCase("Final class implements two public interfaces with a public method", "PASSED", obj.accdeffunc()); + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicIntInt/FinalClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicIntInt/FinalClass.as new file mode 100644 index 00000000000..a0136868e57 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicIntInt/FinalClass.as @@ -0,0 +1,54 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Final Class FinalClass + * Class methods + * + */ + +package FinalClassImpPublicIntInt{ + + final class FinalClass implements PublicInt, PublicInt_S{ + + public function deffunc():String{ + return"PASSED"; + } + + } + +public class ClassGet { + private var obj:FinalClass = new FinalClass(); + + public function accdeffunc():String{return obj.deffunc();} + // access default function deffunc + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicIntInt/PublicInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicIntInt/PublicInterface.as new file mode 100644 index 00000000000..24424d521ac --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicIntInt/PublicInterface.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Internal Interface InternalInterface + * Interface methods + * + */ + + +package FinalClassImpPublicIntInt{ + + public interface PublicInt{ + + function deffunc():String; + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicIntInt/PublicInterface_S.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicIntInt/PublicInterface_S.as new file mode 100644 index 00000000000..c23861415c8 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicIntInt/PublicInterface_S.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Internal Interface InternalInterface + * Interface methods + * + */ + + +package FinalClassImpPublicIntInt{ + + public interface PublicInt_S{ + + function deffunc():String; + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicIntIntname.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicIntIntname.as new file mode 100644 index 00000000000..96acfa73a75 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicIntIntname.as @@ -0,0 +1,53 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import FinalClassImpPublicIntIntname.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Final class implements public interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new ClassGet(); +//Final class implements the first public interface with an interface name method +AddTestCase("Final class implements the first public interface with an interface name method", "PASSED", obj.accdeffunc()); +//Final class implements the second public interface with an interface name method +AddTestCase("Final class implements the second public interface with an interface name method", "PASSED", obj.accdeffunc_s()); + + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicIntIntname/FinalClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicIntIntname/FinalClass.as new file mode 100644 index 00000000000..517329ad829 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicIntIntname/FinalClass.as @@ -0,0 +1,60 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Final Class FinalClass + * Class methods + * + */ + +package FinalClassImpPublicIntIntname{ + + final class FinalClass implements PublicInt, PublicInt_S{ + + public function deffunc():String{ + return"PASSED"; + } + /*PublicInt_S function deffunc():String{ + return"PASSED"; + }*/ + + } + +public class ClassGet { + private var obj:FinalClass = new FinalClass(); + var i:PublicInt = obj; + var i_s:PublicInt_S = obj; + + public function accdeffunc():String{return i.deffunc();} + public function accdeffunc_s():String{return i_s.deffunc();} + // access default function deffunc + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicIntIntname/PublicInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicIntIntname/PublicInterface.as new file mode 100644 index 00000000000..d3fd9a30d9d --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicIntIntname/PublicInterface.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Internal Interface InternalInterface + * Interface methods + * + */ + + +package FinalClassImpPublicIntIntname{ + + public interface PublicInt{ + + function deffunc():String; + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicIntIntname/PublicInterface_S.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicIntIntname/PublicInterface_S.as new file mode 100644 index 00000000000..bdc2bd7d2ff --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicIntIntname/PublicInterface_S.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Internal Interface InternalInterface + * Interface methods + * + */ + + +package FinalClassImpPublicIntIntname{ + + public interface PublicInt_S{ + + function deffunc():String; + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicIntname.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicIntname.as new file mode 100644 index 00000000000..533f38f927c --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicIntname.as @@ -0,0 +1,50 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import FinalClassImpPublicIntname.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Final class implements public interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new ClassGet(); +//Final class implements a public interface with an interface name method +AddTestCase("Final class implements a public interface with an interface name method", "PASSED", obj.accdeffunc()); + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicIntname/FinalClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicIntname/FinalClass.as new file mode 100644 index 00000000000..2b54cc374b5 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicIntname/FinalClass.as @@ -0,0 +1,55 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Final Class FinalClass + * Class methods + * + */ + +package FinalClassImpPublicIntname{ + + final class FinalClass implements PublicInt{ + + public function deffunc():String{ + return"PASSED"; + } + + } + +public class ClassGet { + private var obj:FinalClass = new FinalClass(); + var i:PublicInt = obj; + + public function accdeffunc():String{return i.deffunc();} + // access default function deffunc + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicIntname/PublicInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicIntname/PublicInterface.as new file mode 100644 index 00000000000..2dcd9669751 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicIntname/PublicInterface.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Internal Interface InternalInterface + * Interface methods + * + */ + + +package FinalClassImpPublicIntname{ + + public interface PublicInt{ + + function deffunc():String; + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicIntpubname.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicIntpubname.as new file mode 100644 index 00000000000..89843876c39 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicIntpubname.as @@ -0,0 +1,50 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import FinalClassImpPublicIntpubname.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Final class implements public interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new ClassGet(); +//Final class implements a public interface with a public interface name method +AddTestCase("Final class implements a public interface with a public interface name method", "PASSED", obj.accdeffunc()); + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicIntpubname/FinalClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicIntpubname/FinalClass.as new file mode 100644 index 00000000000..0e1ced98b9c --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicIntpubname/FinalClass.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Final Class FinalClass + * Class methods + * + */ + +package FinalClassImpPublicIntpubname{ + + final class FinalClass implements PublicInt{ + + public function deffunc():String{ + return"PASSED"; + } + + } + +public class ClassGet { + private var obj:FinalClass = new FinalClass(); + public function accdeffunc():String{return obj.deffunc();} + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicIntpubname/PublicInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicIntpubname/PublicInterface.as new file mode 100644 index 00000000000..aed92047060 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/FinalClassImpPublicIntpubname/PublicInterface.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Internal Interface InternalInterface + * Interface methods + * + */ + + +package FinalClassImpPublicIntpubname{ + + public interface PublicInt{ + + function deffunc():String; + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpDefInt.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpDefInt.as new file mode 100644 index 00000000000..3e4a01ebf4b --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpDefInt.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import InternalClassImpDefInt.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Internal class implements default interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new InternalClassAccesor(); + +//Internal class implements a default interface with a public method +AddTestCase("Internal class implements a default interface with a public method", "PASSED", obj.accdeffunc()); + + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpDefInt/DefaultInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpDefInt/DefaultInterface.as new file mode 100644 index 00000000000..d2dbe9a98f0 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpDefInt/DefaultInterface.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Default Interface DefaultInterface + * Interface methods + * + */ + + +package InternalClassImpDefInt{ //package name + + interface DefaultInt{ + + function deffunc():String; + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpDefInt/InternalClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpDefInt/InternalClass.as new file mode 100644 index 00000000000..7b379c7c6c3 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpDefInt/InternalClass.as @@ -0,0 +1,54 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Internal Class InternalClass + * Class methods + * + */ + +package InternalClassImpDefInt{ + + internal class InternalClass implements DefaultInt{ + + public function deffunc():String{ + return"PASSED"; + } + + } + + + public class InternalClassAccesor extends InternalClass{ + + public function accdeffunc(){return deffunc();} + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpDefIntname.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpDefIntname.as new file mode 100644 index 00000000000..060ebc282a5 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpDefIntname.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import InternalClassImpDefIntname.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Internal class implements default interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new InternalClassAccesor(); + +//Internal class implements a default interface with an interface name method +AddTestCase("Internal class implements a default interface with an interface name method", "PASSED", obj.accdeffunc()); + + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpDefIntname/DefaultInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpDefIntname/DefaultInterface.as new file mode 100644 index 00000000000..1f882a5f3df --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpDefIntname/DefaultInterface.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Default Interface DefaultInterface + * Interface methods + * + */ + + +package InternalClassImpDefIntname{ //package name + + interface DefaultInt{ + + function deffunc():String; + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpDefIntname/InternalClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpDefIntname/InternalClass.as new file mode 100644 index 00000000000..f4d76362348 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpDefIntname/InternalClass.as @@ -0,0 +1,55 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Internal Class InternalClass + * Class methods + * + */ + +package InternalClassImpDefIntname{ + + internal class InternalClass implements DefaultInt{ + + public function deffunc():String{ + return"PASSED"; + } + + } + + + public class InternalClassAccesor{ + var c:InternalClass = new InternalClass(); + var i:DefaultInt = c; + public function accdeffunc(){return i.deffunc();} + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpDefIntpubname.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpDefIntpubname.as new file mode 100644 index 00000000000..9aaf83dce07 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpDefIntpubname.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import InternalClassImpDefIntpubname.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Internal class implements default interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new InternalClassAccesor(); + +//Internal class implements a default interface with a public interface name method +AddTestCase("Internal class implements a default interface with a public interface name method", "PASSED", obj.accdeffunc()); + + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpDefIntpubname/DefaultInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpDefIntpubname/DefaultInterface.as new file mode 100644 index 00000000000..4ebc81236de --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpDefIntpubname/DefaultInterface.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Default Interface DefaultInterface + * Interface methods + * + */ + + +package InternalClassImpDefIntpubname{ //package name + + interface DefaultInt{ + + function deffunc():String; + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpDefIntpubname/InternalClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpDefIntpubname/InternalClass.as new file mode 100644 index 00000000000..19d43ed3d8a --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpDefIntpubname/InternalClass.as @@ -0,0 +1,54 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Internal Class InternalClass + * Class methods + * + */ + +package InternalClassImpDefIntpubname{ + + internal class InternalClass implements DefaultInt{ + + public function deffunc():String{ + return"PASSED"; + } + + } + + + public class InternalClassAccesor extends InternalClass{ + + public function accdeffunc(){return deffunc();} + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpInternalInt.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpInternalInt.as new file mode 100644 index 00000000000..47e41fdf929 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpInternalInt.as @@ -0,0 +1,53 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import InternalClassImpInternalInt.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Internal class implements internal interface"; +// Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new InternalClassAccesor(); + +//Internal class implements a internalinterface with a public method +AddTestCase("Internal class implements an internal interface with a public method", "PASSED", obj.accdeffunc()); + + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpInternalInt/InternalClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpInternalInt/InternalClass.as new file mode 100644 index 00000000000..79a70ea2d63 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpInternalInt/InternalClass.as @@ -0,0 +1,55 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Internal Class InternalClass + * Class methods + * + */ + +package InternalClassImpInternalInt{ + + + internal class InternalClass implements InternalInt{ + + public function deffunc():String{ + return"PASSED"; + } + + } + + + public class InternalClassAccesor extends InternalClass{ + + public function accdeffunc(){return deffunc();} + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpInternalInt/InternalInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpInternalInt/InternalInterface.as new file mode 100644 index 00000000000..196d218a153 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpInternalInt/InternalInterface.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Internal Interface InternalInterface + * Interface methods + * + */ + + +package InternalClassImpInternalInt{ + + internal interface InternalInt{ + + function deffunc():String; + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpInternalIntname.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpInternalIntname.as new file mode 100644 index 00000000000..9b7928d9f54 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpInternalIntname.as @@ -0,0 +1,53 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import InternalClassImpInternalIntname.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Internal class implements internal interface"; +// Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new InternalClassAccesor(); + +//Internal class implements a internalinterface with an interface name method +AddTestCase("Internal class implements an internal interface with an interface name method", "PASSED", obj.accdeffunc()); + + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpInternalIntname/InternalClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpInternalIntname/InternalClass.as new file mode 100644 index 00000000000..7595c543967 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpInternalIntname/InternalClass.as @@ -0,0 +1,58 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Internal Class InternalClass + * Class methods + * + */ + +package InternalClassImpInternalIntname{ + + + internal class InternalClass implements InternalInt{ + + public function deffunc():String{ + return"PASSED"; + } + + } + + + public class InternalClassAccesor extends InternalClass{ + + + var c:InternalClass = new InternalClass(); + var i:InternalInt = c; + public function accdeffunc(){return i.deffunc();} + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpInternalIntname/InternalInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpInternalIntname/InternalInterface.as new file mode 100644 index 00000000000..7b2202c9fba --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpInternalIntname/InternalInterface.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Internal Interface InternalInterface + * Interface methods + * + */ + + +package InternalClassImpInternalIntname{ + + internal interface InternalInt{ + + function deffunc():String; + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpInternalIntpubname.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpInternalIntpubname.as new file mode 100644 index 00000000000..963d461d85c --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpInternalIntpubname.as @@ -0,0 +1,53 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import InternalClassImpInternalIntpubname.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Internal class implements internal interface"; +// Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new InternalClassAccesor(); + +//Internal class implements a internalinterface with a public interface name method +AddTestCase("Internal class implements an internal interface with a public interface name method", "PASSED", obj.accdeffunc()); + + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpInternalIntpubname/InternalClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpInternalIntpubname/InternalClass.as new file mode 100644 index 00000000000..ac9094bd8e3 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpInternalIntpubname/InternalClass.as @@ -0,0 +1,55 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Internal Class InternalClass + * Class methods + * + */ + +package InternalClassImpInternalIntpubname{ + + + internal class InternalClass implements InternalInt{ + + public function deffunc():String{ + return"PASSED"; + } + + } + + + public class InternalClassAccesor extends InternalClass{ + + public function accdeffunc(){return deffunc();} + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpInternalIntpubname/InternalInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpInternalIntpubname/InternalInterface.as new file mode 100644 index 00000000000..1ae7fb36e4f --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/InternalClassImpInternalIntpubname/InternalInterface.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Internal Interface InternalInterface + * Interface methods + * + */ + + +package InternalClassImpInternalIntpubname{ + + internal interface InternalInt{ + + function deffunc():String; + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefInt.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefInt.as new file mode 100644 index 00000000000..e908bd209be --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefInt.as @@ -0,0 +1,51 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import PublicClassImpDefInt.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Public class implements default interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new PublicClass(); + +//Public class implements a default interface with a public method +AddTestCase("Public class implements a default interface with a public method", "PASSED", obj.deffunc()); + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefInt/DefaultInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefInt/DefaultInterface.as new file mode 100644 index 00000000000..8c4529eea3d --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefInt/DefaultInterface.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Default Interface DefaultInterface + * Interface methods + * + */ + + +package PublicClassImpDefInt{ //package name + + interface DefaultInt{ + + function deffunc():String; + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefInt/PublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefInt/PublicClass.as new file mode 100644 index 00000000000..392715fab91 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefInt/PublicClass.as @@ -0,0 +1,46 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Public Class PublicClass + * Class methods + * + */ + +package PublicClassImpDefInt{ + + public class PublicClass implements DefaultInt{ + + public function deffunc():String{ + return"PASSED"; + } + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefIntInt.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefIntInt.as new file mode 100644 index 00000000000..4d1475d08bd --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefIntInt.as @@ -0,0 +1,51 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import PublicClassImpDefIntInt.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Public class implements default interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new PublicClass(); + +//Public class implements two default interfaces with a public method +AddTestCase("Public class implements two default interfaces with a public method", "PASSED", obj.deffunc()); + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefIntInt/DefaultInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefIntInt/DefaultInterface.as new file mode 100644 index 00000000000..51681ae0c29 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefIntInt/DefaultInterface.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Default Interface DefaultInterface + * Interface methods + * + */ + + +package PublicClassImpDefIntInt{ + + interface DefaultInt{ + + function deffunc():String; + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefIntInt/DefaultInterface_S.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefIntInt/DefaultInterface_S.as new file mode 100644 index 00000000000..241f104d183 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefIntInt/DefaultInterface_S.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Default Interface DefaultInterface + * Interface methods + * + */ + + +package PublicClassImpDefIntInt{ + + interface DefaultInt_S{ + + function deffunc():String; + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefIntInt/PublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefIntInt/PublicClass.as new file mode 100644 index 00000000000..f59983404be --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefIntInt/PublicClass.as @@ -0,0 +1,46 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Public Class PublicClass + * Class methods + * + */ + +package PublicClassImpDefIntInt{ + + public class PublicClass implements DefaultInt, DefaultInt_S{ + + public function deffunc():String{ + return"PASSED"; + } + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefIntIntname.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefIntIntname.as new file mode 100644 index 00000000000..dd5db7b5bd3 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefIntIntname.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import PublicClassImpDefIntIntname.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Public class implements default interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var c:PublicClass = new PublicClass(); + +//Public class implements a default interface with an interface name method +AddTestCase("Public class implements the first default interface with an interface name method", "PASSED", c.accdeffunc()); +AddTestCase("Public class implements the second default interface with an interface name method", "PASSED", c.accdeffunc_s()); + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefIntIntname/DefaultInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefIntIntname/DefaultInterface.as new file mode 100644 index 00000000000..b664a39f345 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefIntIntname/DefaultInterface.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Default Interface DefaultInterface + * Interface methods + * + */ + + +package PublicClassImpDefIntIntname{ + + interface DefaultInt{ + + function deffunc():String; + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefIntIntname/DefaultInterface_S.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefIntIntname/DefaultInterface_S.as new file mode 100644 index 00000000000..f9a959a33f1 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefIntIntname/DefaultInterface_S.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Default Interface DefaultInterface + * Interface methods + * + */ + + +package PublicClassImpDefIntIntname{ + + interface DefaultInt_S{ + + function deffunc():String; + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefIntIntname/PublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefIntIntname/PublicClass.as new file mode 100644 index 00000000000..a06764aafd0 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefIntIntname/PublicClass.as @@ -0,0 +1,54 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Public Class PublicClass + * Class methods + * + */ + +package PublicClassImpDefIntIntname{ + + public class PublicClass implements DefaultInt, DefaultInt_S{ + + public function deffunc():String{ + return"PASSED" + } + /*DefaultInt_S function deffunc():String{ + return"PASSED" + }*/ + + public function accdeffunc(){return DefaultInt::deffunc();} + public function accdeffunc_s(){return DefaultInt_S::deffunc();} + // access default function deffunc + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefIntname.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefIntname.as new file mode 100644 index 00000000000..fb3296e7cc2 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefIntname.as @@ -0,0 +1,51 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import PublicClassImpDefIntname.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Public class implements default interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var c:PublicClass = new PublicClass(); + +//Public class implements a default interface with an interface name method +AddTestCase("Public class implements a default interface with an interface name method", "PASSED", c.accdeffunc()); + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefIntname/DefaultInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefIntname/DefaultInterface.as new file mode 100644 index 00000000000..8b2e18e7e12 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefIntname/DefaultInterface.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Default Interface DefaultInterface + * Interface methods + * + */ + + +package PublicClassImpDefIntname{ + + interface DefaultInt{ + + function deffunc():String; + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefIntname/PublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefIntname/PublicClass.as new file mode 100644 index 00000000000..8c595e3f408 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefIntname/PublicClass.as @@ -0,0 +1,51 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Public Class PublicClass + * Class methods + * + */ + +package PublicClassImpDefIntname{ + + public class PublicClass implements DefaultInt{ + + public function deffunc():String{ + return"PASSED" + } + + + public function accdeffunc(){return DefaultInt::deffunc();} + // access default function deffunc + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefIntpubname.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefIntpubname.as new file mode 100644 index 00000000000..92eadc05cd4 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefIntpubname.as @@ -0,0 +1,51 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import PublicClassImpDefIntpubname.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Public class implements default interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new PublicClass(); + +//Public class implements a default interface with a public interface name method +AddTestCase("Public class implements a default interface with a public interface name method", "PASSED", obj.deffunc()); + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefIntpubname/DefaultInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefIntpubname/DefaultInterface.as new file mode 100644 index 00000000000..8ef32638a35 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefIntpubname/DefaultInterface.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Default Interface DefaultInterface + * Interface methods + * + */ + + +package PublicClassImpDefIntpubname{ + + interface DefaultInt{ + + function deffunc():String; + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefIntpubname/PublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefIntpubname/PublicClass.as new file mode 100644 index 00000000000..e0a821bfae5 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpDefIntpubname/PublicClass.as @@ -0,0 +1,46 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Public Class PublicClass + * Class methods + * + */ + +package PublicClassImpDefIntpubname{ + + public class PublicClass implements DefaultInt{ + + public function deffunc():String{ + return"PASSED"; + } + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalInt.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalInt.as new file mode 100644 index 00000000000..29a67a32433 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalInt.as @@ -0,0 +1,51 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import PublicClassImpInternalInt.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Public class implements internal interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new PublicClass(); + +//Public class implements an internal interface with a public method +AddTestCase("Public class implements an internal interface with a public method", "PASSED", obj.deffunc()); + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalInt/InternalInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalInt/InternalInterface.as new file mode 100644 index 00000000000..42d8df231ec --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalInt/InternalInterface.as @@ -0,0 +1,44 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Internal Interface InternalInterface + * Interface methods + * + * +*/ + +package PublicClassImpInternalInt{ + + internal interface InternalInt{ + + function deffunc():String; + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalInt/PublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalInt/PublicClass.as new file mode 100644 index 00000000000..ecb103c26e8 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalInt/PublicClass.as @@ -0,0 +1,48 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Public Class PublicClass + * Class methods + * + */ + +package PublicClassImpInternalInt{ + + + public class PublicClass implements InternalInt{ + + public function deffunc():String{ + return"PASSED"; + } + + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalIntInt.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalIntInt.as new file mode 100644 index 00000000000..654714ae307 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalIntInt.as @@ -0,0 +1,51 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import PublicClassImpInternalIntInt.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Public class implements internal interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new PublicClass(); + +//Public class implements two internal interfaces with a public method +AddTestCase("Public class implements two internal interfaces with a public method", "PASSED", obj.deffunc()); + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalIntInt/InternalInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalIntInt/InternalInterface.as new file mode 100644 index 00000000000..edd5fe4d1a8 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalIntInt/InternalInterface.as @@ -0,0 +1,44 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Internal Interface InternalInterface + * Interface methods + * + * +*/ + +package PublicClassImpInternalIntInt{ + + internal interface InternalInt{ + + function deffunc():String; + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalIntInt/InternalInterface_S.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalIntInt/InternalInterface_S.as new file mode 100644 index 00000000000..8a8ea539859 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalIntInt/InternalInterface_S.as @@ -0,0 +1,44 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Internal Interface InternalInterface + * Interface methods + * + * +*/ + +package PublicClassImpInternalIntInt{ + + internal interface InternalInt_S{ + + function deffunc():String; + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalIntInt/PublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalIntInt/PublicClass.as new file mode 100644 index 00000000000..2fa5dabc6ad --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalIntInt/PublicClass.as @@ -0,0 +1,48 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Public Class PublicClass + * Class methods + * + */ + +package PublicClassImpInternalIntInt{ + + + public class PublicClass implements InternalInt, InternalInt_S{ + + public function deffunc():String{ + return"PASSED"; + } + + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalIntIntname.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalIntIntname.as new file mode 100644 index 00000000000..1615efc1502 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalIntIntname.as @@ -0,0 +1,53 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import PublicClassImpInternalIntIntname.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Public class implements internal interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var c:PublicClass = new PublicClass(); + +//Public class implements the first default interface with an interface name method +AddTestCase("Public class implements the first default interface with an interface name method", "PASSED", c.accdeffunc()); +//Public class implements the second default interface with an interface name method +AddTestCase("Public class implements the second default interface with an interface name method", "PASSED", c.accdeffunc_s()); + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalIntIntname/InternalInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalIntIntname/InternalInterface.as new file mode 100644 index 00000000000..a73e24c6307 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalIntIntname/InternalInterface.as @@ -0,0 +1,44 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Internal Interface InternalInterface + * Interface methods + * + * +*/ + +package PublicClassImpInternalIntIntname{ + + internal interface InternalInt{ + + function deffunc():String; + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalIntIntname/InternalInterface_S.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalIntIntname/InternalInterface_S.as new file mode 100644 index 00000000000..20bf2b4b5c7 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalIntIntname/InternalInterface_S.as @@ -0,0 +1,44 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Internal Interface InternalInterface + * Interface methods + * + * +*/ + +package PublicClassImpInternalIntIntname{ + + internal interface InternalInt_S{ + + function deffunc():String; + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalIntIntname/PublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalIntIntname/PublicClass.as new file mode 100644 index 00000000000..b2fab27238a --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalIntIntname/PublicClass.as @@ -0,0 +1,54 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Public Class PublicClass + * Class methods + * + */ + +package PublicClassImpInternalIntIntname{ + + + public class PublicClass implements InternalInt, InternalInt_S{ + + public function deffunc():String{ + return"PASSED"; + } + /*InternalInt_S function deffunc():String{ + return"PASSED"; + }*/ + + + public function accdeffunc(){return InternalInt::deffunc();} + public function accdeffunc_s(){return InternalInt_S::deffunc();} + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalIntname.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalIntname.as new file mode 100644 index 00000000000..3545aa94379 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalIntname.as @@ -0,0 +1,51 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import PublicClassImpInternalIntname.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Public class implements internal interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var c:PublicClass = new PublicClass(); + +//Public class implements a default interface with an interface name method +AddTestCase("Public class implements a default interface with an interface name method", "PASSED", c.accdeffunc()); + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalIntname/InternalInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalIntname/InternalInterface.as new file mode 100644 index 00000000000..52188e76f0d --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalIntname/InternalInterface.as @@ -0,0 +1,44 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Internal Interface InternalInterface + * Interface methods + * + * +*/ + +package PublicClassImpInternalIntname{ + + internal interface InternalInt{ + + function deffunc():String; + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalIntname/PublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalIntname/PublicClass.as new file mode 100644 index 00000000000..4d998613ec0 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalIntname/PublicClass.as @@ -0,0 +1,50 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Public Class PublicClass + * Class methods + * + */ + +package PublicClassImpInternalIntname{ + + + public class PublicClass implements InternalInt{ + + public function deffunc():String{ + return"PASSED"; + } + + + public function accdeffunc(){return InternalInt::deffunc();} + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalIntpubname.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalIntpubname.as new file mode 100644 index 00000000000..28054c15d97 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalIntpubname.as @@ -0,0 +1,51 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import PublicClassImpInternalIntpubname.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Public class implements internal interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new PublicClass(); + +//Public class implements an internal interface with a public method +AddTestCase("Public class implements an internal interface with a public method", "PASSED", obj.deffunc()); + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalIntpubname/InternalInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalIntpubname/InternalInterface.as new file mode 100644 index 00000000000..86c8fa29f33 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalIntpubname/InternalInterface.as @@ -0,0 +1,44 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Internal Interface InternalInterface + * Interface methods + * + * +*/ + +package PublicClassImpInternalIntpubname{ + + internal interface InternalInt{ + + function deffunc():String; + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalIntpubname/PublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalIntpubname/PublicClass.as new file mode 100644 index 00000000000..a8af40b2129 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpInternalIntpubname/PublicClass.as @@ -0,0 +1,48 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Public Class PublicClass + * Class methods + * + */ + +package PublicClassImpInternalIntpubname{ + + + public class PublicClass implements InternalInt{ + + public function deffunc():String{ + return"PASSED"; + } + + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicInt.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicInt.as new file mode 100644 index 00000000000..c9de229e011 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicInt.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import PublicClassImpPublicInt.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Public class implements public interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new PublicClass(); + +//Public class implements a public interface with a public method +AddTestCase("Public class implements a public interface with a public method", "PASSED", obj.deffunc()); + + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicInt/PublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicInt/PublicClass.as new file mode 100644 index 00000000000..56bf6f77399 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicInt/PublicClass.as @@ -0,0 +1,47 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Public Class PublicClass + * Class methods + * + */ + +package PublicClassImpPublicInt{ + + public class PublicClass implements PublicInt{ + + public function deffunc():String{ + return"PASSED"; + } + + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicInt/PublicInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicInt/PublicInterface.as new file mode 100644 index 00000000000..0c7f518e78b --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicInt/PublicInterface.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Public Interface PublicInterface + * Interface methods + * + */ + + +package PublicClassImpPublicInt{ + + public interface PublicInt{ + + function deffunc():String; + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicIntInt.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicIntInt.as new file mode 100644 index 00000000000..4c83c1480ea --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicIntInt.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import PublicClassImpPublicIntInt.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Public class implements public interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new PublicClass(); + +//Public class implements two public interfaces with a public method +AddTestCase("Public class implements two public interfaces with a public method", "PASSED", obj.deffunc()); + + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicIntInt/PublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicIntInt/PublicClass.as new file mode 100644 index 00000000000..f44c057ce82 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicIntInt/PublicClass.as @@ -0,0 +1,47 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Public Class PublicClass + * Class methods + * + */ + +package PublicClassImpPublicIntInt{ + + public class PublicClass implements PublicInt, PublicInt_S{ + + public function deffunc():String{ + return"PASSED"; + } + + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicIntInt/PublicInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicIntInt/PublicInterface.as new file mode 100644 index 00000000000..4d4f4b543b7 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicIntInt/PublicInterface.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Public Interface PublicInterface + * Interface methods + * + */ + + +package PublicClassImpPublicIntInt{ + + public interface PublicInt{ + + function deffunc():String; + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicIntInt/PublicInterface_S.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicIntInt/PublicInterface_S.as new file mode 100644 index 00000000000..6d3a60becab --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicIntInt/PublicInterface_S.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Public Interface PublicInterface + * Interface methods + * + */ + + +package PublicClassImpPublicIntInt{ + + public interface PublicInt_S{ + + function deffunc():String; + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicIntIntname.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicIntIntname.as new file mode 100644 index 00000000000..dd865c7f9c6 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicIntIntname.as @@ -0,0 +1,54 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import PublicClassImpPublicIntIntname.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Public class implements public interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new PublicClass(); + +//Public class implements the first public interface with an interface name method +AddTestCase("Public class implements the first public interface with an interface name method", "PASSED", obj.accdeffunc()); +//Public class implements the second public interface with an interface name method +AddTestCase("Public class implements the second public interface with an interface name method", "PASSED", obj.accdeffunc()); + + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicIntIntname/PublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicIntIntname/PublicClass.as new file mode 100644 index 00000000000..ba203373c97 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicIntIntname/PublicClass.as @@ -0,0 +1,51 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Public Class PublicClass + * Class methods + * + */ + +package PublicClassImpPublicIntIntname{ + + public class PublicClass implements PublicInt, PublicInt_S{ + + public function deffunc():String{ + return"PASSED"; + } + /*PublicInt_S function deffunc():String{ + return"PASSED"; + }*/ + public function accdeffunc(){return PublicInt::deffunc();} + public function accdeffunc_s(){return PublicInt_S::deffunc();} + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicIntIntname/PublicInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicIntIntname/PublicInterface.as new file mode 100644 index 00000000000..c45d3088d03 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicIntIntname/PublicInterface.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Public Interface PublicInterface + * Interface methods + * + */ + + +package PublicClassImpPublicIntIntname{ + + public interface PublicInt{ + + function deffunc():String; + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicIntIntname/PublicInterface_S.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicIntIntname/PublicInterface_S.as new file mode 100644 index 00000000000..6253df9436e --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicIntIntname/PublicInterface_S.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Public Interface PublicInterface + * Interface methods + * + */ + + +package PublicClassImpPublicIntIntname{ + + public interface PublicInt_S{ + + function deffunc():String; + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicIntname.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicIntname.as new file mode 100644 index 00000000000..453a2d1f9d1 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicIntname.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import PublicClassImpPublicIntname.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Public class implements public interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new PublicClass(); + +//Public class implements a public interface with an interface name method +AddTestCase("Public class implements a public interface with an interface name method", "PASSED", obj.accdeffunc()); + + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicIntname/PublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicIntname/PublicClass.as new file mode 100644 index 00000000000..0c454085e46 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicIntname/PublicClass.as @@ -0,0 +1,47 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Public Class PublicClass + * Class methods + * + */ + +package PublicClassImpPublicIntname{ + + public class PublicClass implements PublicInt{ + + public function deffunc():String{ + return"PASSED"; + } + public function accdeffunc(){return PublicInt::deffunc();} + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicIntname/PublicInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicIntname/PublicInterface.as new file mode 100644 index 00000000000..dc730a30029 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicIntname/PublicInterface.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Public Interface PublicInterface + * Interface methods + * + */ + + +package PublicClassImpPublicIntname{ + + public interface PublicInt{ + + function deffunc():String; + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicIntpubname.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicIntpubname.as new file mode 100644 index 00000000000..e2ad21e03bf --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicIntpubname.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +import PublicClassImpPublicIntpubname.*; +var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Public class implements public interface"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +var obj = new PublicClass(); + +//Public class implements a public interface with a public interface name method +AddTestCase("Public class implements a public interface with a public interface name method", "PASSED", obj.deffunc()); + + +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicIntpubname/PublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicIntpubname/PublicClass.as new file mode 100644 index 00000000000..37dcdb79fea --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicIntpubname/PublicClass.as @@ -0,0 +1,47 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Public Class PublicClass + * Class methods + * + */ + +package PublicClassImpPublicIntpubname{ + + public class PublicClass implements PublicInt{ + + public function deffunc():String{ + return"PASSED"; + } + + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicIntpubname/PublicInterface.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicIntpubname/PublicInterface.as new file mode 100644 index 00000000000..a8522ad0228 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Impl/PublicClassImpPublicIntpubname/PublicInterface.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * Public Interface PublicInterface + * Interface methods + * + */ + + +package PublicClassImpPublicIntpubname{ + + public interface PublicInt{ + + function deffunc():String; + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/AddMCToDynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/AddMCToDynamicClass.as new file mode 100644 index 00000000000..cb7d9aa9e76 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/AddMCToDynamicClass.as @@ -0,0 +1,67 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import MCPackage.*; + + +var SECTION = "Method Closures"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Extract method and add to dynamic class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + + +var obj:SomeClass = new SomeClass(); +obj.string = "this is my value"; + +// ***************************** +// Extract a public method +// ***************************** +var mc : Function = obj.getString; +AddTestCase( "obj.getString() == mc()", obj.getString(), mc() ); + + + +// ***************************** +// Add the MC to a dynamic class +// ***************************** +var dyn:DynamicClass = new DynamicClass(); +dyn.foo = mc; +AddTestCase( "*** add the method closure to a dynamic object ***", 1, 1 ); +AddTestCase( "dyn.foo()", obj.getString(), dyn.foo() ); + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/AddMCToDynamicClass/DynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/AddMCToDynamicClass/DynamicClass.as new file mode 100644 index 00000000000..cb29267d640 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/AddMCToDynamicClass/DynamicClass.as @@ -0,0 +1,35 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package MCPackage { + public dynamic class DynamicClass { + public var string:String = "ERROR if you see this"; + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/AddMCToDynamicClass/SomeClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/AddMCToDynamicClass/SomeClass.as new file mode 100644 index 00000000000..375b2c01e6d --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/AddMCToDynamicClass/SomeClass.as @@ -0,0 +1,39 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package MCPackage { + public class SomeClass { + public var string:String; + + public function getString() : String { + return this.string; + } + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/DefClassExtractMeth.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/DefClassExtractMeth.as new file mode 100644 index 00000000000..1941ff5c1fa --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/DefClassExtractMeth.as @@ -0,0 +1,59 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import ExtractMethPackage.*; + + +var SECTION = "Method Closures"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Extract methods from a default class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + + +var obj:DefClassExtracMeth = new DefClassExtracMeth(); + +// ***************************** +// Extract a public method +// ***************************** +var mc : Function = obj.pubGetX; +AddTestCase( "*** extract a public function from a default class", 1, 1 ); +AddTestCase( "obj.pubGetX() == mc()", obj.pubGetX(), mc() ); + + + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/DefClassExtractMeth/ADefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/DefClassExtractMeth/ADefaultClass.as new file mode 100644 index 00000000000..1beaf33b5cd --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/DefClassExtractMeth/ADefaultClass.as @@ -0,0 +1,46 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package ExtractMethPackage { + class DefaultClass { + var x:String = "here"; + static var xStat = "i'm here"; + + public function pubGetX():String { + return this.x; + } + + public static function statGetX():String { + return xStat; + } + + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/DefClassExtractMeth/DefClassExtractMeth.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/DefClassExtractMeth/DefClassExtractMeth.as new file mode 100644 index 00000000000..401c82a916f --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/DefClassExtractMeth/DefClassExtractMeth.as @@ -0,0 +1,33 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package ExtractMethPackage { + public class DefClassExtracMeth extends DefaultClass {} +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/FinClassExtractMeth.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/FinClassExtractMeth.as new file mode 100644 index 00000000000..437f5718802 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/FinClassExtractMeth.as @@ -0,0 +1,65 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import ExtractMethPackage.*; + + +var SECTION = "Method Closures"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Extract methods from a final class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + + +var obj:FinClassExtractMeth = new FinClassExtractMeth(); + +// ***************************** +// Extract a public method +// ***************************** +var mc : Function = obj.pubGetX; +AddTestCase( "*** extract a public function from a public class", 1, 1 ); +AddTestCase( "obj.pubGetX() == mc()", obj.pubGetX(), mc() ); + + +// ***************************** +// Extract a static method +// ***************************** +var mc2 : Function = FinClassExtractMeth.statGetX; +AddTestCase( "*** extract a static function from a public class", 1, 1 ); +AddTestCase( "FinClassExtractMeth.statGetX() == mc2()", FinClassExtractMeth.statGetX(), mc2() ); + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/FinClassExtractMeth/FinClassExtractMeth.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/FinClassExtractMeth/FinClassExtractMeth.as new file mode 100644 index 00000000000..44154d676cf --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/FinClassExtractMeth/FinClassExtractMeth.as @@ -0,0 +1,46 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package ExtractMethPackage { + final public class FinClassExtractMeth { + var x:String = "here"; + static var xStat = "i'm here"; + + public function pubGetX():String { + return this.x; + } + + public static function statGetX():String { + return xStat; + } + + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/GetMCFromDynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/GetMCFromDynamicClass.as new file mode 100644 index 00000000000..5d1c663ce1c --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/GetMCFromDynamicClass.as @@ -0,0 +1,71 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import MCPackage.*; + + +var SECTION = "Method Closures"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Extract method from a dynamic class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + + +var obj:DynamicClass = new DynamicClass(); + +// ***************************** +// Add the function to a dynamic class +// ***************************** +obj.getDate = function():Date { return this.date; } +AddTestCase( "*** add the method to a dynamic object ***", 1, 1 ); +AddTestCase( "obj.getDate()", 1969, obj.getDate().getFullYear() ); + + +// ***************************** +// Extract the method from dynamic class +// Trying to extract a new method from a dynamic class +// should not work, bug #135844 +// ***************************** +var mc : Function = obj.getDate; +AddTestCase( "*** try to extract the new method ***", 1, 1 ); +AddTestCase( "obj.getDate() == mc()", null, mc() ); + + + + + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/GetMCFromDynamicClass/DynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/GetMCFromDynamicClass/DynamicClass.as new file mode 100644 index 00000000000..362c3c03b0e --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/GetMCFromDynamicClass/DynamicClass.as @@ -0,0 +1,35 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package MCPackage { + public dynamic class DynamicClass { + public var date:Date = new Date(0); + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/GetMCFromNamespace.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/GetMCFromNamespace.as new file mode 100644 index 00000000000..bd772ac8154 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/GetMCFromNamespace.as @@ -0,0 +1,70 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import MCPackage.*; + + +var SECTION = "Method Closures"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Extract method from a namespace"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + + +var obj:GetMCFromNamespace = new GetMCFromNamespace(); + +use namespace ns1; +// ***************************** +// Make sure that we can access the method +// ***************************** +AddTestCase( "*** Make sure that we can access the method ***", 1, 1 ); +AddTestCase( "obj.getX()", 12, obj.getX() ); + + +// ***************************** +// Get the method closure and compare to original +// ***************************** +var mc : Function = obj.getX; +AddTestCase( "*** Get the method closure and compare to original ***", 1, 1 ); +AddTestCase( "obj.getX() == mc()", obj.getX(), mc() ); + + + + + + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/GetMCFromNamespace/GetMCFromNamespace.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/GetMCFromNamespace/GetMCFromNamespace.as new file mode 100644 index 00000000000..6462d3665b9 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/GetMCFromNamespace/GetMCFromNamespace.as @@ -0,0 +1,41 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package MCPackage { + public namespace ns1; + + public class GetMCFromNamespace { + var x:int = 12; + + ns1 function getX() : int { + return this.x; + } + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/GetMCFromOverRideMethod.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/GetMCFromOverRideMethod.as new file mode 100644 index 00000000000..e978e85991d --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/GetMCFromOverRideMethod.as @@ -0,0 +1,68 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import MCPackage.*; + + +var SECTION = "Method Closures"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Extract an overridedn method from a class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + +var base:BaseClass = new BaseClass(); +var obj:GetMCFromOverRideMethod = new GetMCFromOverRideMethod(); + +// ***************************** +// Make sure that we can access +// the base and override method +// ***************************** +AddTestCase( "*** Make sure that we can access the method ***", 1, 1 ); +AddTestCase( "base.addition(1, 3)", 4, base.addition(1, 3) ); +AddTestCase( "obj.addition(1, 3)", 3, obj.addition(1, 3) ); + + +// ***************************** +// Get the method closure and compare to original +// ***************************** +var mc : Function = obj.addition; +AddTestCase( "*** Get the method closure and compare to original ***", 1, 1 ); +AddTestCase( "obj.addition(2, 3) == mc(2, 3)", obj.addition(2, 3), mc(2, 3) ); + + + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/GetMCFromOverRideMethod/BaseClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/GetMCFromOverRideMethod/BaseClass.as new file mode 100644 index 00000000000..38bccfa432e --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/GetMCFromOverRideMethod/BaseClass.as @@ -0,0 +1,37 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package MCPackage { + public class BaseClass { + public function addition(i:int, x:int) : int { + return i + x; + } + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/GetMCFromOverRideMethod/GetMCFromOverRideMethod.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/GetMCFromOverRideMethod/GetMCFromOverRideMethod.as new file mode 100644 index 00000000000..b8542db8f36 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/GetMCFromOverRideMethod/GetMCFromOverRideMethod.as @@ -0,0 +1,37 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package MCPackage { + public class GetMCFromOverRideMethod extends BaseClass { + override public function addition(i:int, x:int) : int { + return i + x - 1; + } + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/GetMCFromSuperClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/GetMCFromSuperClass.as new file mode 100644 index 00000000000..71a08ec1040 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/GetMCFromSuperClass.as @@ -0,0 +1,67 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import MCPackage.*; + + +var SECTION = "Method Closures"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Extract an overridedn method from a class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + + +var obj:GetMCFromSuperClass = new GetMCFromSuperClass(); + +// ***************************** +// Make sure that we can access +// the super method +// ***************************** +AddTestCase( "*** Make sure that we can access the method ***", 1, 1 ); +AddTestCase( "obj.echo('bonjour')", "bonjour", obj.echo("bonjour") ); + + +// ***************************** +// Get the method closure and compare to original +// ***************************** +var mc : Function = obj.echo; +AddTestCase( "*** Get the method closure and compare to original ***", 1, 1 ); +AddTestCase( "obj.echo('foobar') == mc('foobar')", obj.echo("foobar"), mc("foobar") ); + + + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/GetMCFromSuperClass/BaseClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/GetMCFromSuperClass/BaseClass.as new file mode 100644 index 00000000000..fcf4b356b66 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/GetMCFromSuperClass/BaseClass.as @@ -0,0 +1,37 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package MCPackage { + public class BaseClass { + public function echo( s:String ) : String { + return s; + } + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/GetMCFromSuperClass/GetMCFromSuperClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/GetMCFromSuperClass/GetMCFromSuperClass.as new file mode 100644 index 00000000000..85c9f0060d4 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/GetMCFromSuperClass/GetMCFromSuperClass.as @@ -0,0 +1,33 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package MCPackage { + public class GetMCFromSuperClass extends BaseClass {} +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/IntClassExtractMeth.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/IntClassExtractMeth.as new file mode 100644 index 00000000000..960f1b3224f --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/IntClassExtractMeth.as @@ -0,0 +1,60 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import ExtractMethPackage.*; + + +var SECTION = "Method Closures"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Extract methods from an internal class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + + +var obj:IntClassExtracMeth = new IntClassExtracMeth(); + +// ***************************** +// Extract a public method +// ***************************** +var mc : Function = obj.pubGetX; +AddTestCase( "*** extract a public function from an internal class", 1, 1 ); +AddTestCase( "obj.pubGetX() == mc()", obj.pubGetX(), mc() ); + + + + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/IntClassExtractMeth/AInternalClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/IntClassExtractMeth/AInternalClass.as new file mode 100644 index 00000000000..f200e3f8e1b --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/IntClassExtractMeth/AInternalClass.as @@ -0,0 +1,46 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package ExtractMethPackage { + internal class InternalClass { + var x:String = "here"; + static var xStat = "i'm here"; + + public function pubGetX():String { + return this.x; + } + + public static function statGetX():String { + return xStat; + } + + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/IntClassExtractMeth/IntClassExtractMeth.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/IntClassExtractMeth/IntClassExtractMeth.as new file mode 100644 index 00000000000..e2a63752e30 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/IntClassExtractMeth/IntClassExtractMeth.as @@ -0,0 +1,33 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package ExtractMethPackage { + public class IntClassExtracMeth extends InternalClass {} +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/PubClassExtractMeth.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/PubClassExtractMeth.as new file mode 100644 index 00000000000..fd3f11e0128 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/PubClassExtractMeth.as @@ -0,0 +1,65 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import ExtractMethPackage.*; + + +var SECTION = "Method Closures"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Extract methods from a public class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + + +var obj:PubClassExtractMeth = new PubClassExtractMeth(); + +// ***************************** +// Extract a public method +// ***************************** +var mc : Function = obj.pubGetX; +AddTestCase( "*** extract a public function from a public class", 1, 1 ); +AddTestCase( "obj.pubGetX() == mc()", obj.pubGetX(), mc() ); + + +// ***************************** +// Extract a static method +// ***************************** +var mc2 : Function = PubClassExtractMeth.statGetX; +AddTestCase( "*** extract a static function from a public class", 1, 1 ); +AddTestCase( "PubClassExtractMeth.statGetX() == mc2()", PubClassExtractMeth.statGetX(), mc2() ); + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/PubClassExtractMeth/PubClassExtractMeth.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/PubClassExtractMeth/PubClassExtractMeth.as new file mode 100644 index 00000000000..194dbe05e47 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/MethodClosures/PubClassExtractMeth/PubClassExtractMeth.as @@ -0,0 +1,46 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package ExtractMethPackage { + public class PubClassExtractMeth { + var x:String = "here"; + static var xStat = "i'm here"; + + public function pubGetX():String { + return this.x; + } + + public static function statGetX():String { + return xStat; + } + + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtDefaultOverRideDefault.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtDefaultOverRideDefault.as new file mode 100644 index 00000000000..273ba8989b2 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtDefaultOverRideDefault.as @@ -0,0 +1,53 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import DefaultClass.*; + + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Override default function in dynamic class extending default class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var CLASSDEFN = new DynExtDefaultOverRideDefault(); +var booleanValue:Boolean = true; +var abc:Boolean; + +AddTestCase( "*** Default Methods and Default properites ***", 1, 1 ); +AddTestCase( "CLASSDEFN.setGetArray([test])", ["override","worked","test"].toString(), ( CLASSDEFN.setGetArray(["test"]).toString()) ); + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtDefaultOverRideDefault/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtDefaultOverRideDefault/DefaultClass.as new file mode 100644 index 00000000000..ed84f940f4a --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtDefaultOverRideDefault/DefaultClass.as @@ -0,0 +1,287 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DefaultClass { + + class DefaultClass { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + //public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ***************** + // virtual methods + // ***************** + virtual function getVirtualArray() : Array { return array; } + virtual function getVirtualBoolean() : Boolean { return boolean; } + virtual function getVirtualDate() : Date { return date; } + virtual function getVirtualFunction() : Function { return myFunction; } + virtual function getVirtualMath() : Math { return math; } + virtual function getVirtualNumber() : Number { return number; } + virtual function getVirtualObject() : Object { return object; } + virtual function getVirtualString() : String { return string; } + virtual function setVirtualArray( a:Array ) { array = a; } + virtual function setVirtualBoolean( b:Boolean ) { boolean = b; } + virtual function setVirtualDate( d:Date ) { date = d; } + virtual function setVirtualFunction( f:Function ) { myFunction = f; } + virtual function setVirtualMath( m:Math ) { math = m; } + virtual function setVirtualNumber( n:Number ) { number = n; } + virtual function setVirtualObject( o:Object ) { object = o; } + virtual function setVirtualString( s:String ) { string = s; } + + virtual function setVirtualAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + } + + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtDefaultOverRideDefault/DynExtDefaultOverRideDefault.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtDefaultOverRideDefault/DynExtDefaultOverRideDefault.as new file mode 100644 index 00000000000..eb70768ff9e --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtDefaultOverRideDefault/DynExtDefaultOverRideDefault.as @@ -0,0 +1,65 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DefaultClass { + + import DefaultClass.*; + + dynamic class DynExtDefaultOverRideDefaultInner extends DefaultClass { + + // ********************************* + // override a default method + // with a default method in subclass + // ********************************* + + override function setArray( newArray:Array) { + a = ["override","worked"]; + a.push(newArray); + } + + override function getArray() : Array{ + return a; + } + + // public accessor to work outside of package + public function setGetArray(arr:Array) : Array { + setArray(arr); + return getArray(); + } + + + + } + + public class DynExtDefaultOverRideDefault extends DynExtDefaultOverRideDefaultInner {} + + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtDefaultOverRidePublic.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtDefaultOverRidePublic.as new file mode 100644 index 00000000000..ab66ce75134 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtDefaultOverRidePublic.as @@ -0,0 +1,56 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import DefaultClass.*; + + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Override public function in dynamic class extending default class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var CLASSDEFN = new DynExtDefaultOverRidePublic(); + +AddTestCase( "CLASSDEFN.setPubBoolean(true); CLASSDEFN.orSetCalled", true, ( CLASSDEFN.setPubBoolean(true), CLASSDEFN.orSetCalled ) ); +AddTestCase( "CLASSDEFN.getPubBoolean();", true, CLASSDEFN.getPubBoolean() ); +AddTestCase( "CLASSDEFN.orGetCalled", true, CLASSDEFN.orGetCalled ); +CLASSDEFN.orGetCalled=false; +AddTestCase( "CLASSDEFN.setPubBoolean(false); CLASSDEFN.orSetCalled", true, ( CLASSDEFN.setPubBoolean(false), CLASSDEFN.orSetCalled ) ); +AddTestCase( "CLASSDEFN.getPubBoolean();", false, CLASSDEFN.getPubBoolean() ); +AddTestCase( "CLASSDEFN.orGetCalled", true, CLASSDEFN.orGetCalled ); + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtDefaultOverRidePublic/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtDefaultOverRidePublic/DefaultClass.as new file mode 100644 index 00000000000..1ea6c803a15 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtDefaultOverRidePublic/DefaultClass.as @@ -0,0 +1,286 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DefaultClass { + + class DefaultClass { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + //public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ***************** + // virtual methods + // ***************** + virtual function getVirtualArray() : Array { return array; } + virtual function getVirtualBoolean() : Boolean { return boolean; } + virtual function getVirtualDate() : Date { return date; } + virtual function getVirtualFunction() : Function { return myFunction; } + virtual function getVirtualMath() : Math { return math; } + virtual function getVirtualNumber() : Number { return number; } + virtual function getVirtualObject() : Object { return object; } + virtual function getVirtualString() : String { return string; } + virtual function setVirtualArray( a:Array ) { array = a; } + virtual function setVirtualBoolean( b:Boolean ) { boolean = b; } + virtual function setVirtualDate( d:Date ) { date = d; } + virtual function setVirtualFunction( f:Function ) { myFunction = f; } + virtual function setVirtualMath( m:Math ) { math = m; } + virtual function setVirtualNumber( n:Number ) { number = n; } + virtual function setVirtualObject( o:Object ) { object = o; } + virtual function setVirtualString( s:String ) { string = s; } + + virtual function setVirtualAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtDefaultOverRidePublic/DynExtDefaultOverRidePublic.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtDefaultOverRidePublic/DynExtDefaultOverRidePublic.as new file mode 100644 index 00000000000..61568478447 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtDefaultOverRidePublic/DynExtDefaultOverRidePublic.as @@ -0,0 +1,61 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DefaultClass { + + import DefaultClass.*; + + dynamic class DynExtDefaultOverRidePublicInner extends DefaultClass { + + public var orSetCalled = false; + public var orGetCalled = false; + + + // ******************************* + // override a public method + // with a public method + // ******************************* + + override public function setPubBoolean( b:Boolean ) { + orSetCalled = true; + boolean = b; + } + + override public function getPubBoolean(): Boolean { + orGetCalled = true; + return this.boolean; + } + + } + + //public wrapper + public dynamic class DynExtDefaultOverRidePublic extends DynExtDefaultOverRidePublicInner {} +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtDefaultOverRideVirtual.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtDefaultOverRideVirtual.as new file mode 100644 index 00000000000..20176eae2b2 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtDefaultOverRideVirtual.as @@ -0,0 +1,57 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import DefaultClass.*; + + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Override virtual function in dynamic class extending default class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var CLASSDEFN = new DynExtDefaultOverRideVirtual(); + +AddTestCase( "CLASSDEFN.callSuper( 'super' )", "super", CLASSDEFN.callSuper( "super" )); +AddTestCase( "CLASSDEFN.orSet", false, CLASSDEFN.orSet ); +AddTestCase( "CLASSDEFN.orGet", false, CLASSDEFN.orGet ); + +AddTestCase( "CLASSDEFN.setGetString('foobar')", "override: foobar", ( CLASSDEFN.setGetString("foobar")) ); +AddTestCase( "CLASSDEFN.orSet", true, CLASSDEFN.orSet ); +AddTestCase( "CLASSDEFN.orGet", true, CLASSDEFN.orGet ); + + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtDefaultOverRideVirtual/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtDefaultOverRideVirtual/DefaultClass.as new file mode 100644 index 00000000000..1ea6c803a15 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtDefaultOverRideVirtual/DefaultClass.as @@ -0,0 +1,286 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DefaultClass { + + class DefaultClass { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + //public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ***************** + // virtual methods + // ***************** + virtual function getVirtualArray() : Array { return array; } + virtual function getVirtualBoolean() : Boolean { return boolean; } + virtual function getVirtualDate() : Date { return date; } + virtual function getVirtualFunction() : Function { return myFunction; } + virtual function getVirtualMath() : Math { return math; } + virtual function getVirtualNumber() : Number { return number; } + virtual function getVirtualObject() : Object { return object; } + virtual function getVirtualString() : String { return string; } + virtual function setVirtualArray( a:Array ) { array = a; } + virtual function setVirtualBoolean( b:Boolean ) { boolean = b; } + virtual function setVirtualDate( d:Date ) { date = d; } + virtual function setVirtualFunction( f:Function ) { myFunction = f; } + virtual function setVirtualMath( m:Math ) { math = m; } + virtual function setVirtualNumber( n:Number ) { number = n; } + virtual function setVirtualObject( o:Object ) { object = o; } + virtual function setVirtualString( s:String ) { string = s; } + + virtual function setVirtualAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtDefaultOverRideVirtual/DynExtDefaultOverRideVirtual.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtDefaultOverRideVirtual/DynExtDefaultOverRideVirtual.as new file mode 100644 index 00000000000..80b8e3231bd --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtDefaultOverRideVirtual/DynExtDefaultOverRideVirtual.as @@ -0,0 +1,74 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DefaultClass { + + import DefaultClass.*; + + dynamic class DynExtDefaultOverRideVirtualInner extends DefaultClass { + + public var orSet = false; + public var orGet = false; + + // ********************************* + // override a virtual method + // with a default method in subclass + // ********************************* + + override virtual function setVirtualString( newString:String ) { + orSet = true; + string = "override: " + newString; + } + + override virtual function getVirtualString() : String{ + orGet = true; + return string; + } + + // public accessor to work outside of package + public function setGetString( newString:String ) : String { + setVirtualString(newString); + return getVirtualString(); + } + + public function callSuper( input:String ) : String { + super.setVirtualString(input); + return super.getVirtualString(); + } + + + + } + + public class DynExtDefaultOverRideVirtual extends DynExtDefaultOverRideVirtualInner {} + + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtDynamicOverRideDefault.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtDynamicOverRideDefault.as new file mode 100644 index 00000000000..2a894be15f5 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtDynamicOverRideDefault.as @@ -0,0 +1,53 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import DynamicClass.*; + + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Override default function in dynamic class extending dynamic class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var CLASSDEFN = new DynExtDynamicOverRideDefault(); +var booleanValue:Boolean = true; + +AddTestCase( "CLASSDEFN.setGetBoolean( booleanValue )", booleanValue, CLASSDEFN.setGetBoolean(booleanValue)); +AddTestCase( "CLASSDEFN.orSet", true, CLASSDEFN.orSet ); +AddTestCase( "CLASSDEFN.orGet", true, CLASSDEFN.orGet ); + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtDynamicOverRideDefault/ADynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtDynamicOverRideDefault/ADynamicClass.as new file mode 100644 index 00000000000..949845a8593 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtDynamicOverRideDefault/ADynamicClass.as @@ -0,0 +1,212 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DynamicClass { + + + dynamic class DynamicClass { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + + // **************** + // constructor + // **************** + + function DynamicClass() { + } + + // ***************** + // default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtDynamicOverRideDefault/DynExtDynamicOverRideDefault.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtDynamicOverRideDefault/DynExtDynamicOverRideDefault.as new file mode 100644 index 00000000000..014793a82bf --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtDynamicOverRideDefault/DynExtDynamicOverRideDefault.as @@ -0,0 +1,64 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DynamicClass { + + import DynamicClass.*; + + dynamic class DynExtDynamicOverRideDefaultInner extends DynamicClass { + + public var orSet = false; + public var orGet = false; + + // ********************************* + // override a default method + // with a default method in subclass + // ********************************* + + override function setBoolean( b:Boolean ) { + orSet = true; + this.boolean = b; + } + + override function getBoolean() : Boolean { + orGet = true; + return this.boolean; + } + + public function setGetBoolean(b:Boolean):Boolean { + this.setBoolean(b); + return this.getBoolean(); + } + + } + + public class DynExtDynamicOverRideDefault extends DynExtDynamicOverRideDefaultInner {} +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtDynamicOverRidePublic.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtDynamicOverRidePublic.as new file mode 100644 index 00000000000..2f9292d5290 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtDynamicOverRidePublic.as @@ -0,0 +1,53 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import DynamicClass.*; + + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Override public function in dynamic class extending dynamic class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var CLASSDEFN = new DynExtDynamicOverRidePublic(); +var booleanValue:Boolean = true; + +AddTestCase( "CLASSDEFN.setPubBoolean( booleanValue ); CLASSDEFN.getPubBoolean()", booleanValue, ( CLASSDEFN.setPubBoolean( booleanValue ), CLASSDEFN.getPubBoolean() ) ); +AddTestCase( "CLASSDEFN.orSet", true, CLASSDEFN.orSet ); +AddTestCase( "CLASSDEFN.orGet", true, CLASSDEFN.orGet ); + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtDynamicOverRidePublic/ADynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtDynamicOverRidePublic/ADynamicClass.as new file mode 100644 index 00000000000..d1d669741ef --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtDynamicOverRidePublic/ADynamicClass.as @@ -0,0 +1,210 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DynamicClass { + + + dynamic class DynamicClass { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + + // **************** + // constructor + // **************** + + function DynamicClass() { + } + + // ***************** + // default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtDynamicOverRidePublic/DynExtDynamicOverRidePublic.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtDynamicOverRidePublic/DynExtDynamicOverRidePublic.as new file mode 100644 index 00000000000..bc088a960bc --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtDynamicOverRidePublic/DynExtDynamicOverRidePublic.as @@ -0,0 +1,59 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DynamicClass { + + import DynamicClass.*; + + dynamic class DynExtDynamicOverRidePublicInner extends DynamicClass { + + public var orSet = false; + public var orGet = false; + + // ******************************* + // override a public method + // with a public method + // ******************************* + + override public function getPubBoolean(): Boolean { + orGet = true; + return this.boolean; + } + + override public function setPubBoolean( b:Boolean ) { + orSet = true; + this.boolean = b; + } + + } + public class DynExtDynamicOverRidePublic extends DynExtDynamicOverRidePublicInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtInternalOverRidePublic.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtInternalOverRidePublic.as new file mode 100644 index 00000000000..16328363132 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtInternalOverRidePublic.as @@ -0,0 +1,53 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import InternalClassPackage.*; + + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Override public function in dynamic class extending internal class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var CLASSDEFN = new DynExtInternalOverRidePublic(); +var booleanValue:Boolean = true; + +AddTestCase( "CLASSDEFN.setBoolean( booleanValue ); CLASSDEFN.getBoolean()", booleanValue, ( CLASSDEFN.setBoolean( booleanValue ), CLASSDEFN.getBoolean() ) ); +AddTestCase( "CLASSDEFN.orSet", true, CLASSDEFN.orSet ); +AddTestCase( "CLASSDEFN.orGet", true, CLASSDEFN.orGet ); + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtInternalOverRidePublic/AInternalClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtInternalOverRidePublic/AInternalClass.as new file mode 100644 index 00000000000..de1e9e01fad --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtInternalOverRidePublic/AInternalClass.as @@ -0,0 +1,70 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package InternalClassPackage { + class InternalClass { + internal var array:Array; + internal var boolean:Boolean; + internal var date:Date; + internal var myFunction:Function; + internal var math:Math; + internal var number:Number; + internal var object:Object; + internal var string:String; + + // **************** + // constructor + // **************** + function InternalClass() {} + + // ***************** + // public methods + // ***************** + public function getArray() : Array { return array; } + public function getBoolean() : Boolean { return boolean; } + public function getDate() : Date { return date; } + public function getFunction() : Function { return myFunction; } + public function getMath() : Math { return math; } + public function getNumber() : Number { return number; } + public function getObject() : Object { return object; } + public function getString() : String { return string; } + + public function setArray( a:Array ) { array = a; } + public function setBoolean( b:Boolean ) { boolean = b; } + public function setDate( d:Date ) { date = d; } + public function setFunction( f:Function ) { myFunction = f; } + public function setMath( m:Math ) { math = m; } + public function setNumber( n:Number ) { number = n; } + public function setObject( o:Object ) { object = o; } + public function setString( s:String ) { string = s; } + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtInternalOverRidePublic/DynExtInternalOverRidePublic.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtInternalOverRidePublic/DynExtInternalOverRidePublic.as new file mode 100644 index 00000000000..c118a306511 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtInternalOverRidePublic/DynExtInternalOverRidePublic.as @@ -0,0 +1,59 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package InternalClassPackage { + + import InternalClassPackage.*; + + dynamic class DynExtInternalOverRidePublicInner extends InternalClass { + + public var orSet = false; + public var orGet = false; + + // ******************************* + // override a public method + // with a public method + // ******************************* + + override public function getBoolean(): Boolean { + orGet = true; + return this.boolean; + } + + override public function setBoolean( b:Boolean ) { + orSet = true; + this.boolean = b; + } + + } + public class DynExtInternalOverRidePublic extends DynExtInternalOverRidePublicInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtPublicOverRideDefault.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtPublicOverRideDefault.as new file mode 100644 index 00000000000..2578437e65e --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtPublicOverRideDefault.as @@ -0,0 +1,55 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import PublicClass.*; + + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Override default function in dynamic class extending public class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var CLASSDEFN = new DynExtPublicOverRideDefault(); +var booleanValue:Boolean = true; + +AddTestCase( "CLASSDEFN.superSetBoolean(booleanValue); CLASSDEFN.superGetBoolean()", booleanValue, (CLASSDEFN.superSetBoolean(booleanValue), CLASSDEFN.superGetBoolean())); +AddTestCase( "CLASSDEFN.orSet", false, CLASSDEFN.orSet ); +AddTestCase( "CLASSDEFN.orGet", false, CLASSDEFN.orGet ); +AddTestCase( "CLASSDEFN.setBoolean( booleanValue ); CLASSDEFN.getBoolean()", booleanValue, CLASSDEFN.setGetBoolean( booleanValue )); +AddTestCase( "CLASSDEFN.orSet", true, CLASSDEFN.orSet ); +AddTestCase( "CLASSDEFN.orGet", true, CLASSDEFN.orGet ); + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtPublicOverRideDefault/APublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtPublicOverRideDefault/APublicClass.as new file mode 100644 index 00000000000..16233e996e8 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtPublicOverRideDefault/APublicClass.as @@ -0,0 +1,272 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + public class PublicClass { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function PublicClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + } + + // ***************** + // virtual methods + // ***************** + virtual function getVirtualArray() : Array { return array; } + virtual function getVirtualBoolean() : Boolean { return boolean; } + virtual function getVirtualDate() : Date { return date; } + virtual function getVirtualFunction() : Function { return myFunction; } + virtual function getVirtualMath() : Math { return math; } + virtual function getVirtualNumber() : Number { return number; } + virtual function getVirtualObject() : Object { return object; } + virtual function getVirtualString() : String { return string; } + virtual function setVirtualArray( a:Array ) { array = a; } + virtual function setVirtualBoolean( b:Boolean ) { boolean = b; } + virtual function setVirtualDate( d:Date ) { date = d; } + virtual function setVirtualFunction( f:Function ) { myFunction = f; } + virtual function setVirtualMath( m:Math ) { math = m; } + virtual function setVirtualNumber( n:Number ) { number = n; } + virtual function setVirtualObject( o:Object ) { object = o; } + virtual function setVirtualString( s:String ) { string = s; } + + virtual function setVirtualAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtPublicOverRideDefault/DynExtPublicOverRideDefault.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtPublicOverRideDefault/DynExtPublicOverRideDefault.as new file mode 100644 index 00000000000..4dcb273eed2 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtPublicOverRideDefault/DynExtPublicOverRideDefault.as @@ -0,0 +1,71 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + import PublicClass.*; + + dynamic class DynExtPublicOverRideDefaultInner extends PublicClass { + + public var orSet = false; + public var orGet = false; + + // ********************************* + // override a default method + // with a default method in subclass + // ********************************* + + override function setBoolean( b:Boolean ) { + orSet = true; + this.boolean = b; + } + + override function getBoolean() : Boolean { + orGet = true; + return this.boolean; + } + + public function setGetBoolean(b:Boolean):Boolean { + this.setBoolean(b); + return this.getBoolean(); + } + + public function superSetBoolean (b:Boolean){ + super.setBoolean(true); + } + + public function superGetBoolean (){ + return super.getBoolean(); + } + } + + public class DynExtPublicOverRideDefault extends DynExtPublicOverRideDefaultInner {} +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtPublicOverRidePublic.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtPublicOverRidePublic.as new file mode 100644 index 00000000000..4f5cdc0491f --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtPublicOverRidePublic.as @@ -0,0 +1,56 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import PublicClass.*; + + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Override public function in dynamic class extending public class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var CLASSDEFN = new DynExtPublicOverRidePublic(); +var booleanValue:Boolean = true; + +AddTestCase( "CLASSDEFN.callSuper(booleanValue)", booleanValue, CLASSDEFN.callSuper(booleanValue) ); +AddTestCase( "CLASSDEFN.orSet", false, CLASSDEFN.orSet ); +AddTestCase( "CLASSDEFN.orGet", false, CLASSDEFN.orGet ); +AddTestCase( "CLASSDEFN.setPubBoolean( booleanValue ); CLASSDEFN.getPubBoolean()", booleanValue, ( CLASSDEFN.setPubBoolean( booleanValue ), CLASSDEFN.getPubBoolean() ) ); +AddTestCase( "CLASSDEFN.orSet", true, CLASSDEFN.orSet ); +AddTestCase( "CLASSDEFN.orGet", true, CLASSDEFN.orGet ); + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtPublicOverRidePublic/APublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtPublicOverRidePublic/APublicClass.as new file mode 100644 index 00000000000..200dd65f41b --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtPublicOverRidePublic/APublicClass.as @@ -0,0 +1,271 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + public class PublicClass { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function PublicClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + } + + // ***************** + // virtual methods + // ***************** + virtual function getVirtualArray() : Array { return array; } + virtual function getVirtualBoolean() : Boolean { return boolean; } + virtual function getVirtualDate() : Date { return date; } + virtual function getVirtualFunction() : Function { return myFunction; } + virtual function getVirtualMath() : Math { return math; } + virtual function getVirtualNumber() : Number { return number; } + virtual function getVirtualObject() : Object { return object; } + virtual function getVirtualString() : String { return string; } + virtual function setVirtualArray( a:Array ) { array = a; } + virtual function setVirtualBoolean( b:Boolean ) { boolean = b; } + virtual function setVirtualDate( d:Date ) { date = d; } + virtual function setVirtualFunction( f:Function ) { myFunction = f; } + virtual function setVirtualMath( m:Math ) { math = m; } + virtual function setVirtualNumber( n:Number ) { number = n; } + virtual function setVirtualObject( o:Object ) { object = o; } + virtual function setVirtualString( s:String ) { string = s; } + + virtual function setVirtualAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtPublicOverRidePublic/DynExtPublicOverRidePublic.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtPublicOverRidePublic/DynExtPublicOverRidePublic.as new file mode 100644 index 00000000000..f9c647d5832 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/DynExtPublicOverRidePublic/DynExtPublicOverRidePublic.as @@ -0,0 +1,63 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + import PublicClass.*; + + dynamic class DynExtPublicOverRidePublicInner extends PublicClass { + + public var orSet = false; + public var orGet = false; + + // ******************************* + // override a public method + // with a public method + // ******************************* + + override public function getPubBoolean(): Boolean { + orGet = true; + return this.boolean; + } + + override public function setPubBoolean( b:Boolean ) { + orSet = true; + this.boolean = b; + } + + public function callSuper(b:Boolean):Boolean { + super.setPubBoolean(b); + return super.getPubBoolean(); + } + } + + public class DynExtPublicOverRidePublic extends DynExtPublicOverRidePublicInner {} +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtDefaultOverRideDefault.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtDefaultOverRideDefault.as new file mode 100644 index 00000000000..8caffe61b47 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtDefaultOverRideDefault.as @@ -0,0 +1,51 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import DefaultClass.*; + + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Override default function in default class extending default class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var CLASSDEFN = new ExtDefaultOverRideDefault(); + +AddTestCase( "*** Default Methods and Default properites ***", 1, 1 ); +AddTestCase( "CLASSDEFN.setGetArray([test])", ["override","worked","test"].toString(), ( CLASSDEFN.setGetArray(["test"]).toString()) ); + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtDefaultOverRideDefault/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtDefaultOverRideDefault/DefaultClass.as new file mode 100644 index 00000000000..b95b8df3354 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtDefaultOverRideDefault/DefaultClass.as @@ -0,0 +1,286 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DefaultClass { + + class DefaultClass { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + //public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ***************** + // virtual methods + // ***************** + virtual function getVirtualArray() : Array { return array; } + virtual function getVirtualBoolean() : Boolean { return boolean; } + virtual function getVirtualDate() : Date { return date; } + virtual function getVirtualFunction() : Function { return myFunction; } + virtual function getVirtualMath() : Math { return math; } + virtual function getVirtualNumber() : Number { return number; } + virtual function getVirtualObject() : Object { return object; } + virtual function getVirtualString() : String { return string; } + virtual function setVirtualArray( a:Array ) { array = a; } + virtual function setVirtualBoolean( b:Boolean ) { boolean = b; } + virtual function setVirtualDate( d:Date ) { date = d; } + virtual function setVirtualFunction( f:Function ) { myFunction = f; } + virtual function setVirtualMath( m:Math ) { math = m; } + virtual function setVirtualNumber( n:Number ) { number = n; } + virtual function setVirtualObject( o:Object ) { object = o; } + virtual function setVirtualString( s:String ) { string = s; } + + virtual function setVirtualAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + } + + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtDefaultOverRideDefault/ExtDefaultOverRideDefault.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtDefaultOverRideDefault/ExtDefaultOverRideDefault.as new file mode 100644 index 00000000000..9f7e272b3f7 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtDefaultOverRideDefault/ExtDefaultOverRideDefault.as @@ -0,0 +1,65 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DefaultClass { + + import DefaultClass.*; + + class ExtDefaultOverRideDefaultInner extends DefaultClass { + + // ********************************* + // override a default method + // with a default method in subclass + // ********************************* + + override function setArray( newArray:Array) { + a = ["override","worked"]; + a.push(newArray); + } + + override function getArray() : Array{ + return a; + } + + // public accessor to work outside of package + public function setGetArray(arr:Array) : Array { + setArray(arr); + return getArray(); + } + + + + } + + public class ExtDefaultOverRideDefault extends ExtDefaultOverRideDefaultInner {} + + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtDefaultOverRideInternal.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtDefaultOverRideInternal.as new file mode 100644 index 00000000000..04f637ba23e --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtDefaultOverRideInternal.as @@ -0,0 +1,51 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import DefaultClass.*; + + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Override default function in default class extending default class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var CLASSDEFN = new ExtDefaultOverRideInternal(); + +AddTestCase( "*** Default Methods and Default properites ***", 1, 1 ); +AddTestCase( "CLASSDEFN.setGetArray([test])", ["override","worked","test"].toString(), ( CLASSDEFN.setGetArray(["test"]).toString()) ); + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtDefaultOverRideInternal/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtDefaultOverRideInternal/DefaultClass.as new file mode 100644 index 00000000000..649d6f2a712 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtDefaultOverRideInternal/DefaultClass.as @@ -0,0 +1,70 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DefaultClass { + class DefaultClass { + internal var array:Array; + internal var boolean:Boolean; + internal var date:Date; + internal var myFunction:Function; + internal var math:Math; + internal var number:Number; + internal var object:Object; + internal var string:String; + + // **************** + // constructor + // **************** + function DefaultClass() {} + + // ***************** + // internal methods + // ***************** + internal function getArray() : Array { return array; } + internal function getBoolean() : Boolean { return boolean; } + internal function getDate() : Date { return date; } + internal function getFunction() : Function { return myFunction; } + internal function getMath() : Math { return math; } + internal function getNumber() : Number { return number; } + internal function getObject() : Object { return object; } + internal function getString() : String { return string; } + + internal function setArray( a:Array ) { array = a; } + internal function setBoolean( b:Boolean ) { boolean = b; } + internal function setDate( d:Date ) { date = d; } + internal function setFunction( f:Function ) { myFunction = f; } + internal function setMath( m:Math ) { math = m; } + internal function setNumber( n:Number ) { number = n; } + internal function setObject( o:Object ) { object = o; } + internal function setString( s:String ) { string = s; } + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtDefaultOverRideInternal/ExtDefaultOverRideInternal.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtDefaultOverRideInternal/ExtDefaultOverRideInternal.as new file mode 100644 index 00000000000..1e07f4a919d --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtDefaultOverRideInternal/ExtDefaultOverRideInternal.as @@ -0,0 +1,63 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DefaultClass { + + import DefaultClass.*; + + class ExtDefaultOverRideInternalInner extends DefaultClass { + + // ********************************* + // override a internal method + // ********************************* + override internal function setArray( a:Array ) { + array = ["override","worked"]; + array.push(a); + } + + override internal function getArray() : Array{ + return array; + } + + // public accessor to work outside of package + public function setGetArray(arr:Array) : Array { + setArray(arr); + return getArray(); + } + + + + } + + public class ExtDefaultOverRideInternal extends ExtDefaultOverRideInternalInner {} + + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtDefaultOverRidePublic.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtDefaultOverRidePublic.as new file mode 100644 index 00000000000..82213db1572 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtDefaultOverRidePublic.as @@ -0,0 +1,57 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import DefaultClass.*; + + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Override public function in default class extending default class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var CLASSDEFN = new ExtDefaultOverRidePublic(); +var myString = "teststring"; + +AddTestCase( "CLASSDEFN.setPubString(myString); CLASSDEFN.orSetString", "PASSED", (CLASSDEFN.setPubString(myString), CLASSDEFN.orSetString ) ); +AddTestCase( "CLASSDEFN.getPubString()" , "override_teststring_override", CLASSDEFN.getPubString() ); +AddTestCase( "CLASSDEFN.orGetString" , "PASSED", CLASSDEFN.orGetString ); + + +AddTestCase( "CLASSDEFN.setPubString(null); CLASSDEFN.getPubString()", "override_null_override", (CLASSDEFN.setPubString(null), CLASSDEFN.getPubString()) ); +AddTestCase( "CLASSDEFN.setPubString(undefined); CLASSDEFN.getPubString()", "override_null_override", (CLASSDEFN.setPubString(undefined), CLASSDEFN.getPubString()) ); + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtDefaultOverRidePublic/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtDefaultOverRidePublic/DefaultClass.as new file mode 100644 index 00000000000..46342fa3579 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtDefaultOverRidePublic/DefaultClass.as @@ -0,0 +1,287 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DefaultClass { + + class DefaultClass { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + //public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ***************** + // virtual methods + // ***************** + virtual function getVirtualArray() : Array { return array; } + virtual function getVirtualBoolean() : Boolean { return boolean; } + virtual function getVirtualDate() : Date { return date; } + virtual function getVirtualFunction() : Function { return myFunction; } + virtual function getVirtualMath() : Math { return math; } + virtual function getVirtualNumber() : Number { return number; } + virtual function getVirtualObject() : Object { return object; } + virtual function getVirtualString() : String { return string; } + virtual function setVirtualArray( a:Array ) { array = a; } + virtual function setVirtualBoolean( b:Boolean ) { boolean = b; } + virtual function setVirtualDate( d:Date ) { date = d; } + virtual function setVirtualFunction( f:Function ) { myFunction = f; } + virtual function setVirtualMath( m:Math ) { math = m; } + virtual function setVirtualNumber( n:Number ) { number = n; } + virtual function setVirtualObject( o:Object ) { object = o; } + virtual function setVirtualString( s:String ) { string = s; } + + virtual function setVirtualAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + } + + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtDefaultOverRidePublic/ExtDefaultOverRidePublic.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtDefaultOverRidePublic/ExtDefaultOverRidePublic.as new file mode 100644 index 00000000000..855c10f8e94 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtDefaultOverRidePublic/ExtDefaultOverRidePublic.as @@ -0,0 +1,62 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DefaultClass { + + import DefaultClass.*; + + class ExtDefaultOverRidePublicInner extends DefaultClass { + + public var orSetString = "FAILED"; + public var orGetString = "FAILED"; + + // ******************************* + // override a public method + // with a public method + // ******************************* + + override public function getPubString(): String { + orGetString = "PASSED"; + return this.string+"_override"; + } + + override public function setPubString(s:String) { + + string = "override_"+s; + + + orSetString = "PASSED"; + } + + } + + public class ExtDefaultOverRidePublic extends ExtDefaultOverRidePublicInner {} +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtDynamicOverRideDefault.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtDynamicOverRideDefault.as new file mode 100644 index 00000000000..f33653ab0ab --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtDynamicOverRideDefault.as @@ -0,0 +1,53 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import DynamicClass.*; + + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Override default function in default class extending dynamic class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var CLASSDEFN = new ExtDynamicOverRideDefault(); +var booleanValue:Boolean = true; + +AddTestCase( "CLASSDEFN.setGetBoolean(booleanValue)", booleanValue, CLASSDEFN.setGetBoolean(booleanValue)); +AddTestCase( "CLASSDEFN.orSet", true, CLASSDEFN.orSet ); +AddTestCase( "CLASSDEFN.orGet", true, CLASSDEFN.orGet ); + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtDynamicOverRideDefault/DynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtDynamicOverRideDefault/DynamicClass.as new file mode 100644 index 00000000000..d1d669741ef --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtDynamicOverRideDefault/DynamicClass.as @@ -0,0 +1,210 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DynamicClass { + + + dynamic class DynamicClass { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + + // **************** + // constructor + // **************** + + function DynamicClass() { + } + + // ***************** + // default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtDynamicOverRideDefault/ExtDynamicOverRideDefault.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtDynamicOverRideDefault/ExtDynamicOverRideDefault.as new file mode 100644 index 00000000000..ad476899468 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtDynamicOverRideDefault/ExtDynamicOverRideDefault.as @@ -0,0 +1,64 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DynamicClass { + + import DynamicClass.*; + + class ExtDynamicOverRideDefaultInner extends DynamicClass { + + public var orSet = false; + public var orGet = false; + + // ********************************* + // override a default method + // with a default method in subclass + // ********************************* + + override function setBoolean( b:Boolean ) { + orSet = true; + this.boolean = b; + } + + override function getBoolean() : Boolean { + orGet = true; + return this.boolean; + } + + public function setGetBoolean(b:Boolean):Boolean { + this.setBoolean(b); + return this.getBoolean(); + } + } + + public class ExtDynamicOverRideDefault extends ExtDynamicOverRideDefaultInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtDynamicOverRidePublic.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtDynamicOverRidePublic.as new file mode 100644 index 00000000000..b6842b66755 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtDynamicOverRidePublic.as @@ -0,0 +1,53 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import DynamicClass.*; + + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Override public function in default class extending dynamic class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var CLASSDEFN = new ExtDynamicOverRidePublic(); +var booleanValue:Boolean = true; + +AddTestCase( "CLASSDEFN.setPubBoolean( booleanValue ); CLASSDEFN.getPubBoolean()", booleanValue, ( CLASSDEFN.setPubBoolean( booleanValue ), CLASSDEFN.getPubBoolean() ) ); +AddTestCase( "CLASSDEFN.orSet", true, CLASSDEFN.orSet ); +AddTestCase( "CLASSDEFN.orGet", true, CLASSDEFN.orGet ); + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtDynamicOverRidePublic/DynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtDynamicOverRidePublic/DynamicClass.as new file mode 100644 index 00000000000..9f9d4fb502b --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtDynamicOverRidePublic/DynamicClass.as @@ -0,0 +1,209 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DynamicClass { + + + dynamic class DynamicClass { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + + // **************** + // constructor + // **************** + + function DynamicClass() { + } + + // ***************** + // default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtDynamicOverRidePublic/ExtDynamicOverRidePublic.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtDynamicOverRidePublic/ExtDynamicOverRidePublic.as new file mode 100644 index 00000000000..8eb8109fd7b --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtDynamicOverRidePublic/ExtDynamicOverRidePublic.as @@ -0,0 +1,59 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DynamicClass { + + import DynamicClass.*; + + class ExtDynamicOverRidePublicInner extends DynamicClass { + + public var orSet = false; + public var orGet = false; + + // ******************************* + // override a public method + // with a public method + // ******************************* + + override public function getPubBoolean(): Boolean { + orGet = true; + return this.boolean; + } + + override public function setPubBoolean( b:Boolean ) { + orSet = true; + this.boolean = b; + } + + } + + public class ExtDynamicOverRidePublic extends ExtDynamicOverRidePublicInner {} +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtInternalOverRideInternal.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtInternalOverRideInternal.as new file mode 100644 index 00000000000..7d6431d0f79 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtInternalOverRideInternal.as @@ -0,0 +1,51 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import InternalClassPackage.*; + + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Override internal function in internal class extending default class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var CLASSDEFN = new ExtInternalOverRideInternal(); + +AddTestCase( "*** Default Methods and Default properites ***", 1, 1 ); +AddTestCase( "CLASSDEFN.setGetArray([test])", ["override","worked","test"].toString(), ( CLASSDEFN.setGetArray(["test"]).toString()) ); + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtInternalOverRideInternal/AInternalClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtInternalOverRideInternal/AInternalClass.as new file mode 100644 index 00000000000..e4dd11b01e3 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtInternalOverRideInternal/AInternalClass.as @@ -0,0 +1,70 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package InternalClassPackage { + class InternalClass { + internal var array:Array; + internal var boolean:Boolean; + internal var date:Date; + internal var myFunction:Function; + internal var math:Math; + internal var number:Number; + internal var object:Object; + internal var string:String; + + // **************** + // constructor + // **************** + function InternalClass() {} + + // ***************** + // internal methods + // ***************** + internal function getArray() : Array { return array; } + internal function getBoolean() : Boolean { return boolean; } + internal function getDate() : Date { return date; } + internal function getFunction() : Function { return myFunction; } + internal function getMath() : Math { return math; } + internal function getNumber() : Number { return number; } + internal function getObject() : Object { return object; } + internal function getString() : String { return string; } + + internal function setArray( a:Array ) { array = a; } + internal function setBoolean( b:Boolean ) { boolean = b; } + internal function setDate( d:Date ) { date = d; } + internal function setFunction( f:Function ) { myFunction = f; } + internal function setMath( m:Math ) { math = m; } + internal function setNumber( n:Number ) { number = n; } + internal function setObject( o:Object ) { object = o; } + internal function setString( s:String ) { string = s; } + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtInternalOverRideInternal/ExtInternalOverRideInternal.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtInternalOverRideInternal/ExtInternalOverRideInternal.as new file mode 100644 index 00000000000..a120e540f0e --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtInternalOverRideInternal/ExtInternalOverRideInternal.as @@ -0,0 +1,63 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package InternalClassPackage { + + import InternalClassPackage.*; + + class ExtInternalOverRideInternalInner extends InternalClass { + + // ********************************* + // override a internal method + // ********************************* + override internal function setArray( a:Array ) { + array = ["override","worked"]; + array.push(a); + } + + override internal function getArray() : Array{ + return array; + } + + // public accessor to work outside of package + public function setGetArray(arr:Array) : Array { + setArray(arr); + return getArray(); + } + + + + } + + public class ExtInternalOverRideInternal extends ExtInternalOverRideInternalInner {} + + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtPublicOverRideDefault.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtPublicOverRideDefault.as new file mode 100644 index 00000000000..9823236d688 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtPublicOverRideDefault.as @@ -0,0 +1,56 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import PublicClass.*; + + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Override default function in default class extending public class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var CLASSDEFN = new ExtPublicOverRideDefault(); +var booleanValue:Boolean = true; + +AddTestCase( "CLASSDEFN.callSuper(booleanValue)", booleanValue, CLASSDEFN.callSuper(booleanValue) ); +AddTestCase( "CLASSDEFN.orSet", false, CLASSDEFN.orSet ); +AddTestCase( "CLASSDEFN.orGet", false, CLASSDEFN.orGet ); +AddTestCase( "CLASSDEFN.setGetBoolean( booleanValue )", booleanValue, CLASSDEFN.setGetBoolean(booleanValue) ); +AddTestCase( "CLASSDEFN.orSet", true, CLASSDEFN.orSet ); +AddTestCase( "CLASSDEFN.orGet", true, CLASSDEFN.orGet ); + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtPublicOverRideDefault/APublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtPublicOverRideDefault/APublicClass.as new file mode 100644 index 00000000000..314f6f31fba --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtPublicOverRideDefault/APublicClass.as @@ -0,0 +1,270 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + public class PublicClass { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function PublicClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + } + + // ***************** + // virtual methods + // ***************** + virtual function getVirtualArray() : Array { return array; } + virtual function getVirtualBoolean() : Boolean { return boolean; } + virtual function getVirtualDate() : Date { return date; } + virtual function getVirtualFunction() : Function { return myFunction; } + virtual function getVirtualMath() : Math { return math; } + virtual function getVirtualNumber() : Number { return number; } + virtual function getVirtualObject() : Object { return object; } + virtual function getVirtualString() : String { return string; } + virtual function setVirtualArray( a:Array ) { array = a; } + virtual function setVirtualBoolean( b:Boolean ) { boolean = b; } + virtual function setVirtualDate( d:Date ) { date = d; } + virtual function setVirtualFunction( f:Function ) { myFunction = f; } + virtual function setVirtualMath( m:Math ) { math = m; } + virtual function setVirtualNumber( n:Number ) { number = n; } + virtual function setVirtualObject( o:Object ) { object = o; } + virtual function setVirtualString( s:String ) { string = s; } + + virtual function setVirtualAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtPublicOverRideDefault/ExtPublicOverRideDefault.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtPublicOverRideDefault/ExtPublicOverRideDefault.as new file mode 100644 index 00000000000..51f495bf86e --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtPublicOverRideDefault/ExtPublicOverRideDefault.as @@ -0,0 +1,68 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + import PublicClass.*; + + class ExtPublicOverRideDefaultInner extends PublicClass { + + public var orSet = false; + public var orGet = false; + + // ********************************* + // override a default method + // with a default method in subclass + // ********************************* + + override function setBoolean( b:Boolean ) { + orSet = true; + this.boolean = b; + } + + override function getBoolean() : Boolean { + orGet = true; + return this.boolean + } + + public function setGetBoolean(b:Boolean):Boolean { + this.setBoolean(b); + return this.getBoolean(); + } + + public function callSuper(b:Boolean):Boolean { + super.setBoolean(b); + return super.getBoolean(); + } + } + + public class ExtPublicOverRideDefault extends ExtPublicOverRideDefaultInner {} +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtPublicOverRideProtected.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtPublicOverRideProtected.as new file mode 100644 index 00000000000..59695ec15a5 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtPublicOverRideProtected.as @@ -0,0 +1,53 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import PublicClassPackage.*; + + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Override protected function in default class extending public class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var CLASSDEFN = new ExtPublicOverRideProtected(); +var booleanValue:Boolean = true; + +AddTestCase( "CLASSDEFN.setGetBoolean(booleanValue)", booleanValue, CLASSDEFN.setGetBoolean(booleanValue)); +AddTestCase( "CLASSDEFN.orSet", true, CLASSDEFN.orSet ); +AddTestCase( "CLASSDEFN.orGet", true, CLASSDEFN.orGet ); + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtPublicOverRideProtected/APublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtPublicOverRideProtected/APublicClass.as new file mode 100644 index 00000000000..80b181e84cf --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtPublicOverRideProtected/APublicClass.as @@ -0,0 +1,75 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClassPackage { + + public class PublicClass { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + + + // **************** + // constructor + // **************** + + function PublicClass() { + } + + // ***************** + // protected methods + // ***************** + protected function getArray() : Array { return array; } + protected function getBoolean() : Boolean { return boolean; } + protected function getDate() : Date { return date; } + protected function getFunction() : Function { return myFunction; } + protected function getMath() : Math { return math; } + protected function getNumber() : Number { return number; } + protected function getObject() : Object { return object; } + protected function getString() : String { return string; } + + protected function setArray( a:Array ) { array = a; } + protected function setBoolean( b:Boolean ) { boolean = b; } + protected function setDate( d:Date ) { date = d; } + protected function setFunction( f:Function ) { myFunction = f; } + protected function setMath( m:Math ) { math = m; } + protected function setNumber( n:Number ) { number = n; } + protected function setObject( o:Object ) { object = o; } + protected function setString( s:String ) { string = s; } + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtPublicOverRideProtected/ExtPublicOverRideProtected.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtPublicOverRideProtected/ExtPublicOverRideProtected.as new file mode 100644 index 00000000000..097e3263b1f --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtPublicOverRideProtected/ExtPublicOverRideProtected.as @@ -0,0 +1,66 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClassPackage { + + import PublicClassPackage.*; + + class ExtPublicOverRideProtectedInner extends PublicClass { + + public var orSet = false; + public var orGet = false; + + // ********************************* + // override a protected method + // ********************************* + + override protected function setBoolean( b:Boolean ) { + orSet = true; + this.boolean = b; + } + + override protected function getBoolean() : Boolean { + orGet = true; + return this.boolean; + } + + public function setGetBoolean(b:Boolean):Boolean { + this.setBoolean(b); + return this.getBoolean(); + } + + + } + + public class ExtPublicOverRideProtected extends ExtPublicOverRideProtectedInner {} + + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtPublicOverRidePublic.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtPublicOverRidePublic.as new file mode 100644 index 00000000000..194aa1253a8 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtPublicOverRidePublic.as @@ -0,0 +1,56 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import PublicClass.*; + + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Override public function in default class extending public class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var CLASSDEFN = new ExtPublicOverRidePublic(); +var booleanValue:Boolean = true; + +AddTestCase( "CLASSDEFN.callSuper( booleanValue )", booleanValue, CLASSDEFN.callSuper( booleanValue )); +AddTestCase( "CLASSDEFN.orSet", false, CLASSDEFN.orSet ); +AddTestCase( "CLASSDEFN.orGet", false, CLASSDEFN.orGet ); +AddTestCase( "CLASSDEFN.setPubBoolean( booleanValue ); CLASSDEFN.getPubBoolean()", booleanValue, ( CLASSDEFN.setPubBoolean( booleanValue ), CLASSDEFN.getPubBoolean() ) ); +AddTestCase( "CLASSDEFN.orSet", true, CLASSDEFN.orSet ); +AddTestCase( "CLASSDEFN.orGet", true, CLASSDEFN.orGet ); + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtPublicOverRidePublic/APublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtPublicOverRidePublic/APublicClass.as new file mode 100644 index 00000000000..314f6f31fba --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtPublicOverRidePublic/APublicClass.as @@ -0,0 +1,270 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + public class PublicClass { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function PublicClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + } + + // ***************** + // virtual methods + // ***************** + virtual function getVirtualArray() : Array { return array; } + virtual function getVirtualBoolean() : Boolean { return boolean; } + virtual function getVirtualDate() : Date { return date; } + virtual function getVirtualFunction() : Function { return myFunction; } + virtual function getVirtualMath() : Math { return math; } + virtual function getVirtualNumber() : Number { return number; } + virtual function getVirtualObject() : Object { return object; } + virtual function getVirtualString() : String { return string; } + virtual function setVirtualArray( a:Array ) { array = a; } + virtual function setVirtualBoolean( b:Boolean ) { boolean = b; } + virtual function setVirtualDate( d:Date ) { date = d; } + virtual function setVirtualFunction( f:Function ) { myFunction = f; } + virtual function setVirtualMath( m:Math ) { math = m; } + virtual function setVirtualNumber( n:Number ) { number = n; } + virtual function setVirtualObject( o:Object ) { object = o; } + virtual function setVirtualString( s:String ) { string = s; } + + virtual function setVirtualAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtPublicOverRidePublic/ExtPublicOverRidePublic.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtPublicOverRidePublic/ExtPublicOverRidePublic.as new file mode 100644 index 00000000000..7cb310fd308 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtPublicOverRidePublic/ExtPublicOverRidePublic.as @@ -0,0 +1,63 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + import PublicClass.*; + + class ExtPublicOverRidePublicInner extends PublicClass { + + public var orSet = false; + public var orGet = false; + + // ******************************* + // override a public method + // with a public method + // ******************************* + + override public function getPubBoolean(): Boolean { + orGet = true; + return this.boolean; + } + + override public function setPubBoolean( b:Boolean ) { + orSet = true; + this.boolean = b; + } + + public function callSuper(b:Boolean):Boolean { + super.setPubBoolean(b); + return super.getPubBoolean(); + } + } + + public class ExtPublicOverRidePublic extends ExtPublicOverRidePublicInner {} +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtPublicOverRideVirtual.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtPublicOverRideVirtual.as new file mode 100644 index 00000000000..7679c19a483 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtPublicOverRideVirtual.as @@ -0,0 +1,58 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import PublicClass.*; + + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Override virtual function in default class extending public class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var CLASSDEFN = new ExtPublicOverRideVirtual(); +var booleanValue:Boolean = true; + + +AddTestCase( "CLASSDEFN.callSuper( booleanValue )", booleanValue, CLASSDEFN.callSuper( booleanValue )); +AddTestCase( "CLASSDEFN.orSet", false, CLASSDEFN.orSet ); +AddTestCase( "CLASSDEFN.orGet", false, CLASSDEFN.orGet ); + +AddTestCase( "CLASSDEFN.getSetVirtualBoolean( booleanValue )", booleanValue, CLASSDEFN.getSetVirtualBoolean( booleanValue ) ); +AddTestCase( "CLASSDEFN.orSet", true, CLASSDEFN.orSet ); +AddTestCase( "CLASSDEFN.orGet", true, CLASSDEFN.orGet ); + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtPublicOverRideVirtual/APublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtPublicOverRideVirtual/APublicClass.as new file mode 100644 index 00000000000..314f6f31fba --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtPublicOverRideVirtual/APublicClass.as @@ -0,0 +1,270 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + public class PublicClass { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function PublicClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + } + + // ***************** + // virtual methods + // ***************** + virtual function getVirtualArray() : Array { return array; } + virtual function getVirtualBoolean() : Boolean { return boolean; } + virtual function getVirtualDate() : Date { return date; } + virtual function getVirtualFunction() : Function { return myFunction; } + virtual function getVirtualMath() : Math { return math; } + virtual function getVirtualNumber() : Number { return number; } + virtual function getVirtualObject() : Object { return object; } + virtual function getVirtualString() : String { return string; } + virtual function setVirtualArray( a:Array ) { array = a; } + virtual function setVirtualBoolean( b:Boolean ) { boolean = b; } + virtual function setVirtualDate( d:Date ) { date = d; } + virtual function setVirtualFunction( f:Function ) { myFunction = f; } + virtual function setVirtualMath( m:Math ) { math = m; } + virtual function setVirtualNumber( n:Number ) { number = n; } + virtual function setVirtualObject( o:Object ) { object = o; } + virtual function setVirtualString( s:String ) { string = s; } + + virtual function setVirtualAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtPublicOverRideVirtual/ExtPublicOverRideVirtual.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtPublicOverRideVirtual/ExtPublicOverRideVirtual.as new file mode 100644 index 00000000000..d039a39dfde --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/ExtPublicOverRideVirtual/ExtPublicOverRideVirtual.as @@ -0,0 +1,68 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + import PublicClass.*; + + class ExtPublicOverRideVirtualInner extends PublicClass { + + public var orSet = false; + public var orGet = false; + + // ******************************* + // override a public method + // with a public method + // ******************************* + + override virtual function getVirtualBoolean(): Boolean { + orGet = true; + return this.boolean; + } + + override virtual function setVirtualBoolean( b:Boolean ) { + orSet = true; + this.boolean = b; + } + + public function getSetVirtualBoolean( b:Boolean ) : Boolean { + setVirtualBoolean(b); + return getVirtualBoolean(); + } + + public function callSuper(b:Boolean):Boolean { + super.setVirtualBoolean(b); + return super.getVirtualBoolean(); + } + } + + public class ExtPublicOverRideVirtual extends ExtPublicOverRideVirtualInner {} +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtDefaultOverRideDefault.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtDefaultOverRideDefault.as new file mode 100644 index 00000000000..fa9d90813da --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtDefaultOverRideDefault.as @@ -0,0 +1,53 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import DefaultClass.*; + + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Override default function in final class extending default class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var CLASSDEFN = new FinExtDefaultOverRideDefault(); +var myNum = 55; + +AddTestCase( "CLASSDEFN.setGetNumber(myNum)", 75, CLASSDEFN.setGetNumber(myNum) ); +AddTestCase( "CLASSDEFN.orSet", "PASSED", CLASSDEFN.orSet ); +AddTestCase( "CLASSDEFN.orGet", "PASSED", CLASSDEFN.orGet ); + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtDefaultOverRideDefault/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtDefaultOverRideDefault/DefaultClass.as new file mode 100644 index 00000000000..b95b8df3354 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtDefaultOverRideDefault/DefaultClass.as @@ -0,0 +1,286 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DefaultClass { + + class DefaultClass { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + //public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ***************** + // virtual methods + // ***************** + virtual function getVirtualArray() : Array { return array; } + virtual function getVirtualBoolean() : Boolean { return boolean; } + virtual function getVirtualDate() : Date { return date; } + virtual function getVirtualFunction() : Function { return myFunction; } + virtual function getVirtualMath() : Math { return math; } + virtual function getVirtualNumber() : Number { return number; } + virtual function getVirtualObject() : Object { return object; } + virtual function getVirtualString() : String { return string; } + virtual function setVirtualArray( a:Array ) { array = a; } + virtual function setVirtualBoolean( b:Boolean ) { boolean = b; } + virtual function setVirtualDate( d:Date ) { date = d; } + virtual function setVirtualFunction( f:Function ) { myFunction = f; } + virtual function setVirtualMath( m:Math ) { math = m; } + virtual function setVirtualNumber( n:Number ) { number = n; } + virtual function setVirtualObject( o:Object ) { object = o; } + virtual function setVirtualString( s:String ) { string = s; } + + virtual function setVirtualAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + } + + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtDefaultOverRideDefault/FinExtDefaultOverRideDefault.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtDefaultOverRideDefault/FinExtDefaultOverRideDefault.as new file mode 100644 index 00000000000..7abf260040a --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtDefaultOverRideDefault/FinExtDefaultOverRideDefault.as @@ -0,0 +1,64 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DefaultClass { + + import DefaultClass.*; + + public final class FinExtDefaultOverRideDefault extends DefaultClass { + + public var orSet = "FAILED"; + public var orGet = "FAILED"; + + // ********************************* + // override a default method + // with a default method in subclass + // ********************************* + + override function setNumber(n:Number) { + orSet = "PASSED"; + this.number = n+10; + } + + override function getNumber() : Number { + orGet = "PASSED"; + return number+10; + } + + // public access method + public function setGetNumber(n:Number):Number { + this.setNumber(n); + return getNumber(); + } + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtDefaultOverRidePublic.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtDefaultOverRidePublic.as new file mode 100644 index 00000000000..5a705883b1c --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtDefaultOverRidePublic.as @@ -0,0 +1,53 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import DefaultClass.*; + + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Override public function in final class extending default class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var CLASSDEFN = new FinExtDefaultOverRidePublic(); +var booleanValue:Boolean = true; + +AddTestCase( "CLASSDEFN.setPubBoolean( booleanValue ); CLASSDEFN.getPubBoolean()", booleanValue, ( CLASSDEFN.setPubBoolean( booleanValue ), CLASSDEFN.getPubBoolean() ) ); +AddTestCase( "CLASSDEFN.orSet", true, CLASSDEFN.orSet ); +AddTestCase( "CLASSDEFN.orGet", true, CLASSDEFN.orGet ); + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtDefaultOverRidePublic/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtDefaultOverRidePublic/DefaultClass.as new file mode 100644 index 00000000000..e687641417d --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtDefaultOverRidePublic/DefaultClass.as @@ -0,0 +1,285 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DefaultClass { + + class DefaultClass { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + //public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ***************** + // virtual methods + // ***************** + virtual function getVirtualArray() : Array { return array; } + virtual function getVirtualBoolean() : Boolean { return boolean; } + virtual function getVirtualDate() : Date { return date; } + virtual function getVirtualFunction() : Function { return myFunction; } + virtual function getVirtualMath() : Math { return math; } + virtual function getVirtualNumber() : Number { return number; } + virtual function getVirtualObject() : Object { return object; } + virtual function getVirtualString() : String { return string; } + virtual function setVirtualArray( a:Array ) { array = a; } + virtual function setVirtualBoolean( b:Boolean ) { boolean = b; } + virtual function setVirtualDate( d:Date ) { date = d; } + virtual function setVirtualFunction( f:Function ) { myFunction = f; } + virtual function setVirtualMath( m:Math ) { math = m; } + virtual function setVirtualNumber( n:Number ) { number = n; } + virtual function setVirtualObject( o:Object ) { object = o; } + virtual function setVirtualString( s:String ) { string = s; } + + virtual function setVirtualAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + } + + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtDefaultOverRidePublic/FinExtDefaultOverRidePublic.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtDefaultOverRidePublic/FinExtDefaultOverRidePublic.as new file mode 100644 index 00000000000..bec88815a99 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtDefaultOverRidePublic/FinExtDefaultOverRidePublic.as @@ -0,0 +1,58 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DefaultClass { + + import DefaultClass.*; + + public final class FinExtDefaultOverRidePublic extends DefaultClass { + + public var orSet = false; + public var orGet = false; + + // ******************************* + // override a public method + // with a public method + // ******************************* + + override public function getPubBoolean(): Boolean { + orGet = true; + return this.boolean; + } + + override public function setPubBoolean( b:Boolean ) { + orSet = true; + boolean = b; + } + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtDynamicOverRideDefault.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtDynamicOverRideDefault.as new file mode 100644 index 00000000000..671d29276c6 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtDynamicOverRideDefault.as @@ -0,0 +1,54 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import DynamicClass.*; + + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Override default function in final class extending dynamic class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var CLASSDEFN = new FinExtDynamicOverRideDefault(); +var booleanValue:Boolean = true; + +AddTestCase( "CLASSDEFN.setGetBoolean(booleanValue);", booleanValue, CLASSDEFN.setGetBoolean(booleanValue) ); +AddTestCase( "CLASSDEFN.orSet", true, CLASSDEFN.orSet ); +AddTestCase( "CLASSDEFN.orGet", true, CLASSDEFN.orGet ); + + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtDynamicOverRideDefault/DynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtDynamicOverRideDefault/DynamicClass.as new file mode 100644 index 00000000000..9f9d4fb502b --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtDynamicOverRideDefault/DynamicClass.as @@ -0,0 +1,209 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DynamicClass { + + + dynamic class DynamicClass { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + + // **************** + // constructor + // **************** + + function DynamicClass() { + } + + // ***************** + // default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtDynamicOverRideDefault/FinExtDynamicOverRideDefault.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtDynamicOverRideDefault/FinExtDynamicOverRideDefault.as new file mode 100644 index 00000000000..e7e7020c8b1 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtDynamicOverRideDefault/FinExtDynamicOverRideDefault.as @@ -0,0 +1,62 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DynamicClass { + + import DynamicClass.*; + + public final class FinExtDynamicOverRideDefault extends DynamicClass { + + public var orSet = false; + public var orGet = false; + + // ********************************* + // override a default method + // with a default method in subclass + // ********************************* + + override function setBoolean( b:Boolean ) { + orSet = true; + this.boolean = b; + } + + override function getBoolean() : Boolean { + orGet = true; + return this.boolean + } + + public function setGetBoolean(b:Boolean):Boolean { + this.setBoolean(b); + return this.getBoolean(); + } + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtDynamicOverRidePublic.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtDynamicOverRidePublic.as new file mode 100644 index 00000000000..7b038f233f8 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtDynamicOverRidePublic.as @@ -0,0 +1,53 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import DynamicClass.*; + + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Override public function in final class extending dynamic class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var CLASSDEFN = new FinExtDynamicOverRidePublic(); +var booleanValue:Boolean = true; + +AddTestCase( "CLASSDEFN.setPubBoolean( booleanValue ); CLASSDEFN.getPubBoolean()", booleanValue, ( CLASSDEFN.setPubBoolean( booleanValue ), CLASSDEFN.getPubBoolean() ) ); +AddTestCase( "CLASSDEFN.orSet", true, CLASSDEFN.orSet ); +AddTestCase( "CLASSDEFN.orGet", true, CLASSDEFN.orGet ); + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtDynamicOverRidePublic/DynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtDynamicOverRidePublic/DynamicClass.as new file mode 100644 index 00000000000..d1d669741ef --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtDynamicOverRidePublic/DynamicClass.as @@ -0,0 +1,210 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DynamicClass { + + + dynamic class DynamicClass { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + + // **************** + // constructor + // **************** + + function DynamicClass() { + } + + // ***************** + // default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtDynamicOverRidePublic/FinExtDynamicOverRidePublic.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtDynamicOverRidePublic/FinExtDynamicOverRidePublic.as new file mode 100644 index 00000000000..704d7967b1d --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtDynamicOverRidePublic/FinExtDynamicOverRidePublic.as @@ -0,0 +1,58 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DynamicClass { + + import DynamicClass.*; + + public final class FinExtDynamicOverRidePublic extends DynamicClass { + + public var orSet = false; + public var orGet = false; + + // ******************************* + // override a public method + // with a public method + // ******************************* + + override public function getPubBoolean(): Boolean { + orGet = true; + return this.boolean; + } + + override public function setPubBoolean( b:Boolean ) { + orSet = true; + this.boolean = b; + } + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtPublicOverRideDefault.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtPublicOverRideDefault.as new file mode 100644 index 00000000000..538ef52afc4 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtPublicOverRideDefault.as @@ -0,0 +1,56 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import PublicClass.*; + + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Override default function in final class extending public class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var CLASSDEFN = new FinExtPublicOverRideDefault(); +var booleanValue:Boolean = true; + +AddTestCase( "CLASSDEFN.callSuper( booleanValue )", booleanValue, CLASSDEFN.callSuper( booleanValue ) ); +AddTestCase( "CLASSDEFN.orSet", false, CLASSDEFN.orSet ); +AddTestCase( "CLASSDEFN.orGet", false, CLASSDEFN.orGet ); +AddTestCase( "CLASSDEFN.setGetBoolean( booleanValue )", booleanValue, CLASSDEFN.setGetBoolean( booleanValue ) ); +AddTestCase( "CLASSDEFN.orSet", true, CLASSDEFN.orSet ); +AddTestCase( "CLASSDEFN.orGet", true, CLASSDEFN.orGet ); + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtPublicOverRideDefault/APublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtPublicOverRideDefault/APublicClass.as new file mode 100644 index 00000000000..a3c7f8ea335 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtPublicOverRideDefault/APublicClass.as @@ -0,0 +1,270 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + public class PublicClass { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function PublicClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + } + + // ***************** + // virtual methods + // ***************** + virtual function getVirtualArray() : Array { return array; } + virtual function getVirtualBoolean() : Boolean { return boolean; } + virtual function getVirtualDate() : Date { return date; } + virtual function getVirtualFunction() : Function { return myFunction; } + virtual function getVirtualMath() : Math { return math; } + virtual function getVirtualNumber() : Number { return number; } + virtual function getVirtualObject() : Object { return object; } + virtual function getVirtualString() : String { return string; } + virtual function setVirtualArray( a:Array ) { array = a; } + virtual function setVirtualBoolean( b:Boolean ) { boolean = b; } + virtual function setVirtualDate( d:Date ) { date = d; } + virtual function setVirtualFunction( f:Function ) { myFunction = f; } + virtual function setVirtualMath( m:Math ) { math = m; } + virtual function setVirtualNumber( n:Number ) { number = n; } + virtual function setVirtualObject( o:Object ) { object = o; } + virtual function setVirtualString( s:String ) { string = s; } + + virtual function setVirtualAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtPublicOverRideDefault/FinExtPublicOverRideDefault.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtPublicOverRideDefault/FinExtPublicOverRideDefault.as new file mode 100644 index 00000000000..04ec471d50e --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtPublicOverRideDefault/FinExtPublicOverRideDefault.as @@ -0,0 +1,66 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + import PublicClass.*; + + public final class FinExtPublicOverRideDefault extends PublicClass { + + public var orSet = false; + public var orGet = false; + + // ********************************* + // override a default method + // with a default method in subclass + // ********************************* + + override function setBoolean( b:Boolean ) { + orSet = true; + this.boolean = b; + } + + override function getBoolean() : Boolean { + orGet = true; + return this.boolean + } + + public function setGetBoolean(b:Boolean):Boolean { + this.setBoolean(b); + return this.getBoolean(); + } + + public function callSuper(b:Boolean):Boolean { + super.setBoolean(b); + return super.getBoolean(); + } + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtPublicOverRidePublic.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtPublicOverRidePublic.as new file mode 100644 index 00000000000..6b4f64ac413 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtPublicOverRidePublic.as @@ -0,0 +1,55 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import PublicClass.*; + + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Override public function in final class extending public class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var CLASSDEFN = new FinExtPublicOverRidePublic(); +var booleanValue:Boolean = true; + +AddTestCase( "CLASSDEFN.callSuper(booleanValue)", booleanValue, CLASSDEFN.callSuper(booleanValue) ); +AddTestCase( "CLASSDEFN.orSet", false, CLASSDEFN.orSet ); +AddTestCase( "CLASSDEFN.orGet", false, CLASSDEFN.orGet ); +AddTestCase( "CLASSDEFN.setPubBoolean( booleanValue ); CLASSDEFN.getPubBoolean()", booleanValue, ( CLASSDEFN.setPubBoolean( booleanValue ), CLASSDEFN.getPubBoolean() ) ); +AddTestCase( "CLASSDEFN.orSet", true, CLASSDEFN.orSet ); +AddTestCase( "CLASSDEFN.orGet", true, CLASSDEFN.orGet ); + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtPublicOverRidePublic/APublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtPublicOverRidePublic/APublicClass.as new file mode 100644 index 00000000000..5fc93d49d59 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtPublicOverRidePublic/APublicClass.as @@ -0,0 +1,271 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + public class PublicClass { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function PublicClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + } + + // ***************** + // virtual methods + // ***************** + virtual function getVirtualArray() : Array { return array; } + virtual function getVirtualBoolean() : Boolean { return boolean; } + virtual function getVirtualDate() : Date { return date; } + virtual function getVirtualFunction() : Function { return myFunction; } + virtual function getVirtualMath() : Math { return math; } + virtual function getVirtualNumber() : Number { return number; } + virtual function getVirtualObject() : Object { return object; } + virtual function getVirtualString() : String { return string; } + virtual function setVirtualArray( a:Array ) { array = a; } + virtual function setVirtualBoolean( b:Boolean ) { boolean = b; } + virtual function setVirtualDate( d:Date ) { date = d; } + virtual function setVirtualFunction( f:Function ) { myFunction = f; } + virtual function setVirtualMath( m:Math ) { math = m; } + virtual function setVirtualNumber( n:Number ) { number = n; } + virtual function setVirtualObject( o:Object ) { object = o; } + virtual function setVirtualString( s:String ) { string = s; } + + virtual function setVirtualAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtPublicOverRidePublic/FinExtPublicOverRidePublic.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtPublicOverRidePublic/FinExtPublicOverRidePublic.as new file mode 100644 index 00000000000..e9816a81431 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/FinExtPublicOverRidePublic/FinExtPublicOverRidePublic.as @@ -0,0 +1,61 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + import PublicClass.*; + + public final class FinExtPublicOverRidePublic extends PublicClass { + + public var orSet = false; + public var orGet = false; + + // ******************************* + // override a public method + // with a public method + // ******************************* + + override public function getPubBoolean(): Boolean { + orGet = true; + return this.boolean; + } + + override public function setPubBoolean( b:Boolean ) { + orSet = true; + this.boolean = b; + } + + public function callSuper(b:Boolean):Boolean { + super.setPubBoolean(b); + return super.getPubBoolean(); + } + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/IntExtDefaultOverRideProtected.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/IntExtDefaultOverRideProtected.as new file mode 100644 index 00000000000..e554b6f71ff --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/IntExtDefaultOverRideProtected.as @@ -0,0 +1,55 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import DefaultClassPackage.*; + + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Override protected function in internal class extending default class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var CLASSDEFN = new IntExtDefaultOverRideProtected(); +var d:Date = new Date(0); + +AddTestCase( "CLASSDEFN.orSet", false, CLASSDEFN.orSet ); +AddTestCase( "CLASSDEFN.orGet", false, CLASSDEFN.orGet ); +AddTestCase( "CLASSDEFN.setGetDate(d).getFullYear()", d.getFullYear(), CLASSDEFN.setGetDate(d).getFullYear()); +AddTestCase( "CLASSDEFN.orSet", true, CLASSDEFN.orSet ); +AddTestCase( "CLASSDEFN.orGet", true, CLASSDEFN.orGet ); + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/IntExtDefaultOverRideProtected/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/IntExtDefaultOverRideProtected/DefaultClass.as new file mode 100644 index 00000000000..6ca88c6d979 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/IntExtDefaultOverRideProtected/DefaultClass.as @@ -0,0 +1,48 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DefaultClassPackage { + class DefaultClass { + var date:Date; + + // **************** + // constructor + // **************** + function DefaultClass() {} + + // ***************** + // protected methods + // ***************** + protected function getDate() : Date { return date; } + protected function setDate( d:Date ) { date = d; } + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/IntExtDefaultOverRideProtected/IntExtDefaultOverRideProtected.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/IntExtDefaultOverRideProtected/IntExtDefaultOverRideProtected.as new file mode 100644 index 00000000000..37f5f435062 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/IntExtDefaultOverRideProtected/IntExtDefaultOverRideProtected.as @@ -0,0 +1,58 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DefaultClassPackage { + internal class IntExtDefaultOverRideProtectedInner extends DefaultClass { + public var orSet:Boolean = false; + public var orGet:Boolean = false; + + + // ***************** + // protected methods + // ***************** + override protected function getDate() : Date { + orGet = true; + return date; + } + override protected function setDate( d:Date ) { + orSet = true; + date = d; + } + + public function setGetDate( d:Date ) : Date { + setDate(d); + return getDate(); + } + + } + + public class IntExtDefaultOverRideProtected extends IntExtDefaultOverRideProtectedInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/IntExtDynamicOverRidePublic.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/IntExtDynamicOverRidePublic.as new file mode 100644 index 00000000000..589fb121e4b --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/IntExtDynamicOverRidePublic.as @@ -0,0 +1,55 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import DynamicClassPackage.*; + + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Override public function in internal class extending dynamic class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var CLASSDEFN = new IntExtDynamicOverRidePublic(); +var d:Date = new Date(0); + +AddTestCase( "CLASSDEFN.orSet", false, CLASSDEFN.orSet ); +AddTestCase( "CLASSDEFN.orGet", false, CLASSDEFN.orGet ); +AddTestCase( "CLASSDEFN.setGetDate(d).getFullYear()", d.getFullYear(), CLASSDEFN.setGetDate(d).getFullYear()); +AddTestCase( "CLASSDEFN.orSet", true, CLASSDEFN.orSet ); +AddTestCase( "CLASSDEFN.orGet", true, CLASSDEFN.orGet ); + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/IntExtDynamicOverRidePublic/DynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/IntExtDynamicOverRidePublic/DynamicClass.as new file mode 100644 index 00000000000..4512fb8cee6 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/IntExtDynamicOverRidePublic/DynamicClass.as @@ -0,0 +1,49 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DynamicClassPackage { + dynamic class DynamicClass { + + var date:Date; + + // **************** + // constructor + // **************** + function DynamicClass() { + } + + // ***************** + // public methods + // ***************** + public function getDate() : Date { return date; } + public function setDate( d:Date ) { date = d; } + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/IntExtDynamicOverRidePublic/IntExtDynamicOverRidePublic.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/IntExtDynamicOverRidePublic/IntExtDynamicOverRidePublic.as new file mode 100644 index 00000000000..0868d2e4b09 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/IntExtDynamicOverRidePublic/IntExtDynamicOverRidePublic.as @@ -0,0 +1,58 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DynamicClassPackage { + internal class IntExtDynamicOverRidePublicInner extends DynamicClass { + public var orSet:Boolean = false; + public var orGet:Boolean = false; + + + // ***************** + // public methods + // ***************** + override public function getDate() : Date { + orGet = true; + return date; + } + override public function setDate( d:Date ) { + orSet = true; + date = d; + } + + public function setGetDate( d:Date ) : Date { + setDate(d); + return getDate(); + } + + } + + public class IntExtDynamicOverRidePublic extends IntExtDynamicOverRidePublicInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/IntExtInternalOverRidePublic.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/IntExtInternalOverRidePublic.as new file mode 100644 index 00000000000..1bd55698e39 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/IntExtInternalOverRidePublic.as @@ -0,0 +1,55 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import InternalClassPackage.*; + + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Override public function in internal class extending internal class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var CLASSDEFN = new IntExtInternalOverRidePublic(); +var d:Date = new Date(0); + +AddTestCase( "CLASSDEFN.orSet", false, CLASSDEFN.orSet ); +AddTestCase( "CLASSDEFN.orGet", false, CLASSDEFN.orGet ); +AddTestCase( "CLASSDEFN.setGetDate(d).getFullYear()", d.getFullYear(), CLASSDEFN.setGetDate(d).getFullYear()); +AddTestCase( "CLASSDEFN.orSet", true, CLASSDEFN.orSet ); +AddTestCase( "CLASSDEFN.orGet", true, CLASSDEFN.orGet ); + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/IntExtInternalOverRidePublic/AInternalClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/IntExtInternalOverRidePublic/AInternalClass.as new file mode 100644 index 00000000000..476e6a86820 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/IntExtInternalOverRidePublic/AInternalClass.as @@ -0,0 +1,49 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package InternalClassPackage { + internal class InternalClass { + + var date:Date; + + // **************** + // constructor + // **************** + function InternalClass() { + } + + // ***************** + // public methods + // ***************** + public function getDate() : Date { return date; } + public function setDate( d:Date ) { date = d; } + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/IntExtInternalOverRidePublic/IntExtInternalOverRidePublic.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/IntExtInternalOverRidePublic/IntExtInternalOverRidePublic.as new file mode 100644 index 00000000000..4219e5d0da3 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/IntExtInternalOverRidePublic/IntExtInternalOverRidePublic.as @@ -0,0 +1,58 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package InternalClassPackage { + internal class IntExtInternalOverRidePublicInner extends InternalClass { + public var orSet:Boolean = false; + public var orGet:Boolean = false; + + + // ***************** + // public methods + // ***************** + override public function getDate() : Date { + orGet = true; + return date; + } + override public function setDate( d:Date ) { + orSet = true; + date = d; + } + + public function setGetDate( d:Date ) : Date { + setDate(d); + return getDate(); + } + + } + + public class IntExtInternalOverRidePublic extends IntExtInternalOverRidePublicInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/IntExtPublicOverRideInternal.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/IntExtPublicOverRideInternal.as new file mode 100644 index 00000000000..409b0acca64 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/IntExtPublicOverRideInternal.as @@ -0,0 +1,55 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import PublicClassPackage.*; + + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Override internal function in internal class extending public class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var CLASSDEFN = new IntExtPublicOverRideInternal(); +var d:Date = new Date(0); + +AddTestCase( "CLASSDEFN.orSet", false, CLASSDEFN.orSet ); +AddTestCase( "CLASSDEFN.orGet", false, CLASSDEFN.orGet ); +AddTestCase( "CLASSDEFN.setGetDate(d).getFullYear()", d.getFullYear(), CLASSDEFN.setGetDate(d).getFullYear()); +AddTestCase( "CLASSDEFN.orSet", true, CLASSDEFN.orSet ); +AddTestCase( "CLASSDEFN.orGet", true, CLASSDEFN.orGet ); + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/IntExtPublicOverRideInternal/APublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/IntExtPublicOverRideInternal/APublicClass.as new file mode 100644 index 00000000000..c4236d1b38d --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/IntExtPublicOverRideInternal/APublicClass.as @@ -0,0 +1,49 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package PublicClassPackage { + public class PublicClass { + + var date:Date; + + // **************** + // constructor + // **************** + function PublicClass() { + } + + // ***************** + // internal methods + // ***************** + internal function getDate() : Date { return date; } + internal function setDate( d:Date ) { date = d; } + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/IntExtPublicOverRideInternal/IntExtPublicOverRideInternal.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/IntExtPublicOverRideInternal/IntExtPublicOverRideInternal.as new file mode 100644 index 00000000000..6f94468fe3f --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/IntExtPublicOverRideInternal/IntExtPublicOverRideInternal.as @@ -0,0 +1,58 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package PublicClassPackage { + internal class IntExtPublicOverRideInternalInner extends PublicClass { + public var orSet:Boolean = false; + public var orGet:Boolean = false; + + + // ***************** + // internal methods + // ***************** + override internal function getDate() : Date { + orGet = true; + return date; + } + override internal function setDate( d:Date ) { + orSet = true; + date = d; + } + + public function setGetDate( d:Date ) : Date { + setDate(d); + return getDate(); + } + + } + + public class IntExtPublicOverRideInternal extends IntExtPublicOverRideInternalInner {} + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/MethodInNamespace.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/MethodInNamespace.as new file mode 100644 index 00000000000..619df8baf8b --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/MethodInNamespace.as @@ -0,0 +1,57 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import MethodInNamespace.*; + + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Override a method defined in a namespace"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + + +var obj = new MethodInNamespace(); + +AddTestCase( "obj.i = 12, obj.i", 12, (obj.i = 12, obj.i) ); +AddTestCase( "obj.ns1::getI()", 17, obj.ns1::getI() ); +AddTestCase( "obj.ns2::getI()", 14, obj.ns2::getI() ); + + + + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/MethodInNamespace/BaseClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/MethodInNamespace/BaseClass.as new file mode 100644 index 00000000000..d6e0ab08224 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/MethodInNamespace/BaseClass.as @@ -0,0 +1,47 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package MethodInNamespace { + public namespace ns1; + public namespace ns2; + + public class BaseClass { + public var i:int; + + ns1 function getI() : int { + return i; + } + + ns2 function getI() : int { + return i + 2; + } + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/MethodInNamespace/MethodInNamespace.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/MethodInNamespace/MethodInNamespace.as new file mode 100644 index 00000000000..c0211b1ba89 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/MethodInNamespace/MethodInNamespace.as @@ -0,0 +1,41 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package MethodInNamespace { + + public class MethodInNamespace extends BaseClass { + + override ns1 function getI() : int { + return i + 5; + } + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/OverrideGetterSetter.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/OverrideGetterSetter.as new file mode 100644 index 00000000000..936d33b4f23 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/OverrideGetterSetter.as @@ -0,0 +1,54 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import GetterSetter.*; + + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Override getter/setter functions"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var CLASSDEFN = new OverrideGetterSetter(); + + +AddTestCase( "OverrideGetterSetter.string = 'new value'", "new value", (CLASSDEFN.string = "new value", CLASSDEFN.string) ); +AddTestCase( "CLASSDEFN.orSet", true, CLASSDEFN.orSet ); +AddTestCase( "CLASSDEFN.orGet", true, CLASSDEFN.orGet ); + + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/OverrideGetterSetter/BaseClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/OverrideGetterSetter/BaseClass.as new file mode 100644 index 00000000000..457fe8541c8 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/OverrideGetterSetter/BaseClass.as @@ -0,0 +1,42 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package GetterSetter { + + public class BaseClass { + private var _string:String; + + public function get string() : String { return _string; } + public function set string( s:String ) { _string=s; } + + } + + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/OverrideGetterSetter/OverrideGetterSetter.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/OverrideGetterSetter/OverrideGetterSetter.as new file mode 100644 index 00000000000..b5a21a8de80 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/OverrideGetterSetter/OverrideGetterSetter.as @@ -0,0 +1,51 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package GetterSetter { + + public class OverrideGetterSetter extends BaseClass { + public var orGet:Boolean = false; + public var orSet:Boolean = false; + + override public function get string() : String { + orGet = true; + return _string; + } + + override public function set string( s:String ) { + orSet = true; + _string=s; + } + + + } + + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/OverrideMethAtRuntimeErr.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/OverrideMethAtRuntimeErr.as new file mode 100644 index 00000000000..c7c61a0b0eb --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/OverrideMethAtRuntimeErr.as @@ -0,0 +1,59 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +class BaseClass { + public function foo(){} +} + +dynamic class OverrideMethAtRuntimeErr extends BaseClass {} + +var SECTION = "test"; +var VERSION = "AS3"; +var TITLE = "Override Method at runtime error"; +var BUGNUMBER = ""; + +startTest(); + +var obj:OverrideMethAtRuntimeErr = new OverrideMethAtRuntimeErr; + +var error = "no error thrown"; + +try { + obj.foo = function () { return "here"; } +} catch (e) { + error = e.toString(); +} + +AddTestCase("Override Method At Runtime", + "ReferenceError: Error #1037", + error); + +test(); + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/OverrideNoParamType.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/OverrideNoParamType.as new file mode 100644 index 00000000000..b79cda1f35b --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/OverrideNoParamType.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import MyPackage.*; + + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Override method with no param type"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var CLASSDEFN = new OverrideNoParamType(); + + +AddTestCase( "CLASSDEFN.echo('hello')", "[override] echo: hello", CLASSDEFN.echo("hello") ); + + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/OverrideNoParamType/BaseClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/OverrideNoParamType/BaseClass.as new file mode 100644 index 00000000000..0571f4884b2 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/OverrideNoParamType/BaseClass.as @@ -0,0 +1,37 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package MyPackage { + public class BaseClass { + public function echo(s) : String { + return "echo: " + s; + } + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/OverrideNoParamType/OverrideNoParamType.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/OverrideNoParamType/OverrideNoParamType.as new file mode 100644 index 00000000000..db32c09dc57 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/OverrideNoParamType/OverrideNoParamType.as @@ -0,0 +1,37 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package MyPackage { + public class OverrideNoParamType extends BaseClass { + override public function echo(s) : String { + return "[override] " + super.echo(s); + } + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/OverrideWithOptionalParams.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/OverrideWithOptionalParams.as new file mode 100644 index 00000000000..f04b166c704 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/OverrideWithOptionalParams.as @@ -0,0 +1,67 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import OptionalParams.*; + + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Override a method defined in a namespace"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + +var base = new BaseClass(); +var obj = new OverrideWithOptionalParams(); + +AddTestCase( "base.setInt(), base.i", 0, ( base.setInt(), base.i ) ); +AddTestCase( "base.setInt(3), base.i", 3, ( base.setInt(3), base.i ) ); +AddTestCase( "base.setString(), base.s", "default", ( base.setString(), base.s ) ); +AddTestCase( "base.setString('here'), base.s", "here", ( base.setString("here"), base.s ) ); +AddTestCase( "base.setAll(), base.i base.s", "0default", ( base.setAll(), (base.i + base.s) ) ); +AddTestCase( "base.setAll(6, 'here'), base.i base.s", "6here", ( base.setAll(6, "here"), (base.i + base.s) ) ); + +AddTestCase( "obj.setInt(), obj.i", 1, ( obj.setInt(), obj.i ) ); +AddTestCase( "obj.setInt(3), obj.i", 3, ( obj.setInt(3), obj.i ) ); +AddTestCase( "obj.setString(), obj.s", "override", ( obj.setString(), obj.s ) ); +AddTestCase( "obj.setString('here'), obj.s", "here", ( obj.setString("here"), obj.s ) ); +AddTestCase( "obj.setAll(), obj.i obj.s", "1override", ( obj.setAll(), (obj.i + obj.s) ) ); +AddTestCase( "obj.setAll(6, 'here'), obj.i obj.s", "6here", ( obj.setAll(6, "here"), (obj.i + obj.s) ) ); + + + + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/OverrideWithOptionalParams/BaseClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/OverrideWithOptionalParams/BaseClass.as new file mode 100644 index 00000000000..ea0f6332b02 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/OverrideWithOptionalParams/BaseClass.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package OptionalParams { + + public class BaseClass { + public var i:int; + public var s:String; + + public function setInt( input:int = 0 ) { + i = input; + } + + public function setString( string:String = "default" ) { + s = string; + } + + public function setAll( input:int = 0, string:String = "default" ) { + i = input; + s = string; + } + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/OverrideWithOptionalParams/OverrideWithOptionalParams.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/OverrideWithOptionalParams/OverrideWithOptionalParams.as new file mode 100644 index 00000000000..dd2d3744f79 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/OverrideWithOptionalParams/OverrideWithOptionalParams.as @@ -0,0 +1,50 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package OptionalParams { + + public class OverrideWithOptionalParams extends BaseClass { + + override public function setInt( input:int = 1 ) { + i = input; + } + + override public function setString( string:String = "override" ) { + s = string; + } + + override public function setAll( input:int = 1, string:String = "override" ) { + i = input; + s = string; + } + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtDefaultOverRideDefault.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtDefaultOverRideDefault.as new file mode 100644 index 00000000000..86473431a06 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtDefaultOverRideDefault.as @@ -0,0 +1,53 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import DefaultClass.*; + + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Override default function in public class extending default class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var CLASSDEFN = new PubExtDefaultOverRideDefault(); +var booleanValue:Boolean = true; + +AddTestCase( "CLASSDEFN.setBoolean( booleanValue ); CLASSDEFN.getBoolean()", booleanValue, CLASSDEFN.setGetBoolean( booleanValue ) ); +AddTestCase( "CLASSDEFN.orSet", true, CLASSDEFN.orSet ); +AddTestCase( "CLASSDEFN.orGet", true, CLASSDEFN.orGet ); + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtDefaultOverRideDefault/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtDefaultOverRideDefault/DefaultClass.as new file mode 100644 index 00000000000..e687641417d --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtDefaultOverRideDefault/DefaultClass.as @@ -0,0 +1,285 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DefaultClass { + + class DefaultClass { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + //public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ***************** + // virtual methods + // ***************** + virtual function getVirtualArray() : Array { return array; } + virtual function getVirtualBoolean() : Boolean { return boolean; } + virtual function getVirtualDate() : Date { return date; } + virtual function getVirtualFunction() : Function { return myFunction; } + virtual function getVirtualMath() : Math { return math; } + virtual function getVirtualNumber() : Number { return number; } + virtual function getVirtualObject() : Object { return object; } + virtual function getVirtualString() : String { return string; } + virtual function setVirtualArray( a:Array ) { array = a; } + virtual function setVirtualBoolean( b:Boolean ) { boolean = b; } + virtual function setVirtualDate( d:Date ) { date = d; } + virtual function setVirtualFunction( f:Function ) { myFunction = f; } + virtual function setVirtualMath( m:Math ) { math = m; } + virtual function setVirtualNumber( n:Number ) { number = n; } + virtual function setVirtualObject( o:Object ) { object = o; } + virtual function setVirtualString( s:String ) { string = s; } + + virtual function setVirtualAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + } + + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtDefaultOverRideDefault/PubExtDefaultOverRideDefault.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtDefaultOverRideDefault/PubExtDefaultOverRideDefault.as new file mode 100644 index 00000000000..9730f9bbf6f --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtDefaultOverRideDefault/PubExtDefaultOverRideDefault.as @@ -0,0 +1,62 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DefaultClass { + + import DefaultClass.*; + + public class PubExtDefaultOverRideDefault extends DefaultClass { + + public var orSet = false; + public var orGet = false; + + // ********************************* + // override a default method + // with a default method in subclass + // ********************************* + + override function setBoolean( b:Boolean ) { + orSet = true; + boolean = b; + } + + override function getBoolean() : Boolean { + orGet = true; + return boolean; + } + + public function setGetBoolean(b:Boolean):Boolean{ + this.setBoolean(b); + return this.getBoolean(); + } + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtDefaultOverRideInternal.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtDefaultOverRideInternal.as new file mode 100644 index 00000000000..a30b27aa7bd --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtDefaultOverRideInternal.as @@ -0,0 +1,54 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import DefaultClassPackage.*; + + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Override internal function in public class extending default class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var CLASSDEFN = new PubExtDefaultOverRideInternal(); +var booleanValue:Boolean = true; + +AddTestCase( "CLASSDEFN.orSet", false, CLASSDEFN.orSet ); +AddTestCase( "CLASSDEFN.orGet", false, CLASSDEFN.orGet ); +AddTestCase( "CLASSDEFN.setGetBoolean(booleanValue)", booleanValue, CLASSDEFN.setGetBoolean(booleanValue)); +AddTestCase( "CLASSDEFN.orSet", true, CLASSDEFN.orSet ); +AddTestCase( "CLASSDEFN.orGet", true, CLASSDEFN.orGet ); + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtDefaultOverRideInternal/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtDefaultOverRideInternal/DefaultClass.as new file mode 100644 index 00000000000..f3dee1844ac --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtDefaultOverRideInternal/DefaultClass.as @@ -0,0 +1,70 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DefaultClassPackage { + class DefaultClass { + internal var array:Array; + internal var boolean:Boolean; + internal var date:Date; + internal var myFunction:Function; + internal var math:Math; + internal var number:Number; + internal var object:Object; + internal var string:String; + + // **************** + // constructor + // **************** + function DefaultClass() {} + + // ***************** + // internal methods + // ***************** + internal function getArray() : Array { return array; } + internal function getBoolean() : Boolean { return boolean; } + internal function getDate() : Date { return date; } + internal function getFunction() : Function { return myFunction; } + internal function getMath() : Math { return math; } + internal function getNumber() : Number { return number; } + internal function getObject() : Object { return object; } + internal function getString() : String { return string; } + + internal function setArray( a:Array ) { array = a; } + internal function setBoolean( b:Boolean ) { boolean = b; } + internal function setDate( d:Date ) { date = d; } + internal function setFunction( f:Function ) { myFunction = f; } + internal function setMath( m:Math ) { math = m; } + internal function setNumber( n:Number ) { number = n; } + internal function setObject( o:Object ) { object = o; } + internal function setString( s:String ) { string = s; } + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtDefaultOverRideInternal/PubExtDefaultOverRideInternal.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtDefaultOverRideInternal/PubExtDefaultOverRideInternal.as new file mode 100644 index 00000000000..4274a136a5f --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtDefaultOverRideInternal/PubExtDefaultOverRideInternal.as @@ -0,0 +1,61 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DefaultClassPackage { + + import DefaultClassPackage.*; + + public class PubExtDefaultOverRideInternal extends DefaultClass { + + public var orSet = false; + public var orGet = false; + + // ******************************* + // override a public method + // with a public method + // ******************************* + + override internal function getBoolean(): Boolean { + orGet = true; + return this.boolean; + } + + override internal function setBoolean( b:Boolean ) { + orSet = true; + this.boolean = b; + } + + public function setGetBoolean(b:Boolean):Boolean { + this.setBoolean(b); + return this.getBoolean(); + } + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtDefaultOverRidePublic.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtDefaultOverRidePublic.as new file mode 100644 index 00000000000..d69e690f5c2 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtDefaultOverRidePublic.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import DefaultClass.*; + + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Override public function in public class extending default class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var CLASSDEFN = new PubExtDefaultOverRidePublic(); +var booleanValue:Boolean = true; + +AddTestCase( "CLASSDEFN.setPubBoolean( booleanValue ); CLASSDEFN.getPubBoolean()", booleanValue, ( CLASSDEFN.setPubBoolean( booleanValue ), CLASSDEFN.getPubBoolean() ) ); +AddTestCase( "CLASSDEFN.orSet", true, CLASSDEFN.orSet ); +AddTestCase( "CLASSDEFN.orGet", true, CLASSDEFN.orGet ); + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtDefaultOverRidePublic/DefaultClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtDefaultOverRidePublic/DefaultClass.as new file mode 100644 index 00000000000..e687641417d --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtDefaultOverRidePublic/DefaultClass.as @@ -0,0 +1,285 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DefaultClass { + + class DefaultClass { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + //var simple:Simple; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + //public var pubSimple:Simple; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + //private var privSimple:Simple; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + //static var statSimple:Simple; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + //public static var pubStatSimple:Simple; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + //private static var privStatSimple:Simple; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function DefaultClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + //function getSimple() : Simple { return simple; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + //function setSimple( s:Simple ) { simple = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + //si:Simple ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + //simple = si; + } + + // ***************** + // virtual methods + // ***************** + virtual function getVirtualArray() : Array { return array; } + virtual function getVirtualBoolean() : Boolean { return boolean; } + virtual function getVirtualDate() : Date { return date; } + virtual function getVirtualFunction() : Function { return myFunction; } + virtual function getVirtualMath() : Math { return math; } + virtual function getVirtualNumber() : Number { return number; } + virtual function getVirtualObject() : Object { return object; } + virtual function getVirtualString() : String { return string; } + virtual function setVirtualArray( a:Array ) { array = a; } + virtual function setVirtualBoolean( b:Boolean ) { boolean = b; } + virtual function setVirtualDate( d:Date ) { date = d; } + virtual function setVirtualFunction( f:Function ) { myFunction = f; } + virtual function setVirtualMath( m:Math ) { math = m; } + virtual function setVirtualNumber( n:Number ) { number = n; } + virtual function setVirtualObject( o:Object ) { object = o; } + virtual function setVirtualString( s:String ) { string = s; } + + virtual function setVirtualAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + //public function setPubSimple( s:Simple ) { pubSimple = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + //public function getPubSimple() : Simple { return this.pubSimple; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + //private function getPrivSimple() : Simple { return privSimple; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + //private function setPrivSimple( s:Simple ) { privSimple = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + } + + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtDefaultOverRidePublic/PubExtDefaultOverRidePublic.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtDefaultOverRidePublic/PubExtDefaultOverRidePublic.as new file mode 100644 index 00000000000..24a454fff61 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtDefaultOverRidePublic/PubExtDefaultOverRidePublic.as @@ -0,0 +1,56 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DefaultClass { + + import DefaultClass.*; + + public class PubExtDefaultOverRidePublic extends DefaultClass { + + public var orSet = false; + public var orGet = false; + + // ******************************* + // override a public method + // with a public method + // ******************************* + + override public function getPubBoolean(): Boolean { + orGet = true; + return this.boolean; + } + + override public function setPubBoolean( b:Boolean ) { + orSet = true; + this.boolean = b; + } + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtDynamicOverRideDefault.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtDynamicOverRideDefault.as new file mode 100644 index 00000000000..e5a1f119b28 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtDynamicOverRideDefault.as @@ -0,0 +1,53 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import DynamicClass.*; + + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Override default function in public class extending dynamic class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var CLASSDEFN = new PubExtDynamicOverRideDefault(); +var booleanValue:Boolean = true; + +AddTestCase( "CLASSDEFN.setGetBoolean(booleanValue)",booleanValue,CLASSDEFN.setGetBoolean(booleanValue) ); +AddTestCase( "CLASSDEFN.orSet", true, CLASSDEFN.orSet ); +AddTestCase( "CLASSDEFN.orGet", true, CLASSDEFN.orGet ); + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtDynamicOverRideDefault/DynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtDynamicOverRideDefault/DynamicClass.as new file mode 100644 index 00000000000..d1d669741ef --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtDynamicOverRideDefault/DynamicClass.as @@ -0,0 +1,210 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DynamicClass { + + + dynamic class DynamicClass { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + + // **************** + // constructor + // **************** + + function DynamicClass() { + } + + // ***************** + // default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtDynamicOverRideDefault/PubExtDynamicOverRideDefault.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtDynamicOverRideDefault/PubExtDynamicOverRideDefault.as new file mode 100644 index 00000000000..23bd65cf944 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtDynamicOverRideDefault/PubExtDynamicOverRideDefault.as @@ -0,0 +1,62 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DynamicClass { + + import DynamicClass.*; + + public class PubExtDynamicOverRideDefault extends DynamicClass { + + public var orSet = false; + public var orGet = false; + + // ********************************* + // override a default method + // with a default method in subclass + // ********************************* + + override function setBoolean( b:Boolean ) { + orSet = true; + this.boolean = b; + } + + override function getBoolean() : Boolean { + orGet = true; + return this.boolean; + } + + public function setGetBoolean(b:Boolean):Boolean { + this.setBoolean(b); + return this.getBoolean(); + } + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtDynamicOverRidePublic.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtDynamicOverRidePublic.as new file mode 100644 index 00000000000..61191c9073e --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtDynamicOverRidePublic.as @@ -0,0 +1,53 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import DynamicClass.*; + + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Override public function in public class extending dynamic class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var CLASSDEFN = new PubExtDynamicOverRidePublic(); +var booleanValue:Boolean = true; + +AddTestCase( "CLASSDEFN.setPubBoolean( booleanValue ); CLASSDEFN.getPubBoolean()", booleanValue, ( CLASSDEFN.setPubBoolean( booleanValue ), CLASSDEFN.getPubBoolean() ) ); +AddTestCase( "CLASSDEFN.orSet", true, CLASSDEFN.orSet ); +AddTestCase( "CLASSDEFN.orGet", true, CLASSDEFN.orGet ); + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtDynamicOverRidePublic/DynamicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtDynamicOverRidePublic/DynamicClass.as new file mode 100644 index 00000000000..d1d669741ef --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtDynamicOverRidePublic/DynamicClass.as @@ -0,0 +1,210 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package DynamicClass { + + + dynamic class DynamicClass { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + + // **************** + // constructor + // **************** + + function DynamicClass() { + } + + // ***************** + // default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtDynamicOverRidePublic/PubExtDynamicOverRidePublic.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtDynamicOverRidePublic/PubExtDynamicOverRidePublic.as new file mode 100644 index 00000000000..132163470ba --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtDynamicOverRidePublic/PubExtDynamicOverRidePublic.as @@ -0,0 +1,58 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package DynamicClass { + + import DynamicClass.*; + + public class PubExtDynamicOverRidePublic extends DynamicClass { + + public var orSet = false; + public var orGet = false; + + // ******************************* + // override a public method + // with a public method + // ******************************* + + override public function getPubBoolean(): Boolean { + orGet = true; + return this.boolean; + } + + override public function setPubBoolean( b:Boolean ) { + orSet = true; + this.boolean = b; + } + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtInternalOverRidePublic.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtInternalOverRidePublic.as new file mode 100644 index 00000000000..e4b912536bc --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtInternalOverRidePublic.as @@ -0,0 +1,51 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import InternalClassPackage.*; + + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Override public function in public class extending internal class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var CLASSDEFN = new PubExtInternalOverRidePublic(); + +AddTestCase( "*** Default Methods and Default properites ***", 1, 1 ); +AddTestCase( "CLASSDEFN.setArray(['test']), CLASSDEFN.getArray()", ["override","worked","test"].toString(), ( CLASSDEFN.setArray(["test"]), CLASSDEFN.getArray().toString() ) ); + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtInternalOverRidePublic/InternalClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtInternalOverRidePublic/InternalClass.as new file mode 100644 index 00000000000..de1e9e01fad --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtInternalOverRidePublic/InternalClass.as @@ -0,0 +1,70 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package InternalClassPackage { + class InternalClass { + internal var array:Array; + internal var boolean:Boolean; + internal var date:Date; + internal var myFunction:Function; + internal var math:Math; + internal var number:Number; + internal var object:Object; + internal var string:String; + + // **************** + // constructor + // **************** + function InternalClass() {} + + // ***************** + // public methods + // ***************** + public function getArray() : Array { return array; } + public function getBoolean() : Boolean { return boolean; } + public function getDate() : Date { return date; } + public function getFunction() : Function { return myFunction; } + public function getMath() : Math { return math; } + public function getNumber() : Number { return number; } + public function getObject() : Object { return object; } + public function getString() : String { return string; } + + public function setArray( a:Array ) { array = a; } + public function setBoolean( b:Boolean ) { boolean = b; } + public function setDate( d:Date ) { date = d; } + public function setFunction( f:Function ) { myFunction = f; } + public function setMath( m:Math ) { math = m; } + public function setNumber( n:Number ) { number = n; } + public function setObject( o:Object ) { object = o; } + public function setString( s:String ) { string = s; } + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtInternalOverRidePublic/PubExtInternalOverRidePublic.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtInternalOverRidePublic/PubExtInternalOverRidePublic.as new file mode 100644 index 00000000000..d6c8b00fffe --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtInternalOverRidePublic/PubExtInternalOverRidePublic.as @@ -0,0 +1,54 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package InternalClassPackage { + + import InternalClassPackage.*; + + public class PubExtInternalOverRidePublic extends InternalClass { + + // ********************************* + // override a internal method + // ********************************* + override public function setArray( a:Array ) { + array = ["override","worked"]; + array.push(a); + } + + override public function getArray() : Array{ + return array; + } + + + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtPublicOverRideDefault.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtPublicOverRideDefault.as new file mode 100644 index 00000000000..22846ee1775 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtPublicOverRideDefault.as @@ -0,0 +1,56 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import PublicClass.*; + + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Override default function in public class extending public class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var CLASSDEFN = new PubExtPublicOverRideDefault(); +var booleanValue:Boolean = true; + +AddTestCase( "CLASSDEFN.callSuper( booleanValue )", booleanValue, CLASSDEFN.callSuper(booleanValue) ); +AddTestCase( "CLASSDEFN.orSet", false, CLASSDEFN.orSet ); +AddTestCase( "CLASSDEFN.orGet", false, CLASSDEFN.orGet ); +AddTestCase( "CLASSDEFN.setGetBoolean( booleanValue )", booleanValue, CLASSDEFN.setGetBoolean(booleanValue) ); +AddTestCase( "CLASSDEFN.orSet", true, CLASSDEFN.orSet ); +AddTestCase( "CLASSDEFN.orGet", true, CLASSDEFN.orGet ); + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtPublicOverRideDefault/APublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtPublicOverRideDefault/APublicClass.as new file mode 100644 index 00000000000..5fc93d49d59 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtPublicOverRideDefault/APublicClass.as @@ -0,0 +1,271 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + public class PublicClass { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function PublicClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + } + + // ***************** + // virtual methods + // ***************** + virtual function getVirtualArray() : Array { return array; } + virtual function getVirtualBoolean() : Boolean { return boolean; } + virtual function getVirtualDate() : Date { return date; } + virtual function getVirtualFunction() : Function { return myFunction; } + virtual function getVirtualMath() : Math { return math; } + virtual function getVirtualNumber() : Number { return number; } + virtual function getVirtualObject() : Object { return object; } + virtual function getVirtualString() : String { return string; } + virtual function setVirtualArray( a:Array ) { array = a; } + virtual function setVirtualBoolean( b:Boolean ) { boolean = b; } + virtual function setVirtualDate( d:Date ) { date = d; } + virtual function setVirtualFunction( f:Function ) { myFunction = f; } + virtual function setVirtualMath( m:Math ) { math = m; } + virtual function setVirtualNumber( n:Number ) { number = n; } + virtual function setVirtualObject( o:Object ) { object = o; } + virtual function setVirtualString( s:String ) { string = s; } + + virtual function setVirtualAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtPublicOverRideDefault/PubExtPublicOverRideDefault.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtPublicOverRideDefault/PubExtPublicOverRideDefault.as new file mode 100644 index 00000000000..6400f77362f --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtPublicOverRideDefault/PubExtPublicOverRideDefault.as @@ -0,0 +1,66 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + import PublicClass.*; + + public class PubExtPublicOverRideDefault extends PublicClass { + + public var orSet = false; + public var orGet = false; + + // ********************************* + // override a default method + // with a default method in subclass + // ********************************* + + override function setBoolean( b:Boolean ) { + orSet = true; + this.boolean = b; + } + + override function getBoolean() : Boolean { + orGet = true; + return this.boolean; + } + + public function setGetBoolean(b:Boolean):Boolean { + this.setBoolean(b); + return this.getBoolean(); + } + + public function callSuper(b:Boolean):Boolean { + super.setBoolean(b); + return super.getBoolean(); + } + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtPublicOverRidePublic.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtPublicOverRidePublic.as new file mode 100644 index 00000000000..7650bd50097 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtPublicOverRidePublic.as @@ -0,0 +1,56 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import PublicClass.*; + + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Override public function in public class extending public class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var CLASSDEFN = new PubExtPublicOverRidePublic(); +var booleanValue:Boolean = true; + +AddTestCase( "CLASSDEFN.callSuper(booleanValue)", booleanValue, CLASSDEFN.callSuper(booleanValue) ); +AddTestCase( "CLASSDEFN.orSet", false, CLASSDEFN.orSet ); +AddTestCase( "CLASSDEFN.orGet", false, CLASSDEFN.orGet ); +AddTestCase( "CLASSDEFN.setPubBoolean( booleanValue ); CLASSDEFN.getPubBoolean()", booleanValue, ( CLASSDEFN.setPubBoolean( booleanValue ), CLASSDEFN.getPubBoolean() ) ); +AddTestCase( "CLASSDEFN.orSet", true, CLASSDEFN.orSet ); +AddTestCase( "CLASSDEFN.orGet", true, CLASSDEFN.orGet ); + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtPublicOverRidePublic/APublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtPublicOverRidePublic/APublicClass.as new file mode 100644 index 00000000000..5fc93d49d59 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtPublicOverRidePublic/APublicClass.as @@ -0,0 +1,271 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + public class PublicClass { + + var array:Array; + var boolean:Boolean; + var date:Date; + var myFunction:Function; + var math:Math; + var number:Number; + var object:Object; + var string:String; + + public var pubArray:Array; + public var pubBoolean:Boolean; + public var pubDate:Date; + public var pubFunction:Function; + public var pubMath:Math; + public var pubNumber:Number; + public var pubObject:Object; + public var pubString:String; + + private var privArray:Array; + private var privBoolean:Boolean; + private var privDate:Date; + private var privFunction:Function; + private var privMath:Math; + private var privNumber:Number; + private var privObject:Object; + private var privString:String; + + static var statArray:Array; + static var statBoolean:Boolean; + static var statDate:Date; + static var statFunction:Function; + static var statMath:Math; + static var statNumber:Number; + static var statObject:Object; + static var statString:String; + + public static var pubStatArray:Array; + public static var pubStatBoolean:Boolean; + public static var pubStatDate:Date; + public static var pubStatFunction:Function; + public static var pubStatMath:Math; + public static var pubStatNumber:Number; + public static var pubStatObject:Object; + public static var pubStatString:String; + + private static var privStatArray:Array; + private static var privStatBoolean:Boolean; + private static var privStatDate:Date; + private static var privStatFunction:Function; + private static var privStatMath:Math; + private static var privStatNumber:Number; + private static var privStatObject:Object; + private static var privStatString:String; + + // ***************************** + // to be overloaded + // ***************************** + + var overLoadVar; + public var pubOverLoadVar; + private var privOverLoadVar; + static var statOverLoadVar; + public static var pubStatOverLoadVar; + private static var privStatOverLoadVar; + + // **************** + // constructor + // **************** + + function PublicClass() { + } + + // ***************** + // Default methods + // ***************** + + function getArray() : Array { return array; } + function getBoolean() : Boolean { return boolean; } + function getDate() : Date { return date; } + function getFunction() : Function { return myFunction; } + function getMath() : Math { return math; } + function getNumber() : Number { return number; } + function getObject() : Object { return object; } + function getString() : String { return string; } + + function setArray( a:Array ) { array = a; } + function setBoolean( b:Boolean ) { boolean = b; } + function setDate( d:Date ) { date = d; } + function setFunction( f:Function ) { myFunction = f; } + function setMath( m:Math ) { math = m; } + function setNumber( n:Number ) { number = n; } + function setObject( o:Object ) { object = o; } + function setString( s:String ) { string = s; } + + function setAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + } + + // ***************** + // virtual methods + // ***************** + virtual function getVirtualArray() : Array { return array; } + virtual function getVirtualBoolean() : Boolean { return boolean; } + virtual function getVirtualDate() : Date { return date; } + virtual function getVirtualFunction() : Function { return myFunction; } + virtual function getVirtualMath() : Math { return math; } + virtual function getVirtualNumber() : Number { return number; } + virtual function getVirtualObject() : Object { return object; } + virtual function getVirtualString() : String { return string; } + virtual function setVirtualArray( a:Array ) { array = a; } + virtual function setVirtualBoolean( b:Boolean ) { boolean = b; } + virtual function setVirtualDate( d:Date ) { date = d; } + virtual function setVirtualFunction( f:Function ) { myFunction = f; } + virtual function setVirtualMath( m:Math ) { math = m; } + virtual function setVirtualNumber( n:Number ) { number = n; } + virtual function setVirtualObject( o:Object ) { object = o; } + virtual function setVirtualString( s:String ) { string = s; } + + virtual function setVirtualAll( a:Array, + b:Boolean, + d:Date, + f:Function, + m:Math, + n:Number, + o:Object, + s:String + ) { + array = a; + boolean = b; + date = d; + myFunction = f; + math = m; + number = n; + object = o; + string = s; + } + + // ******************* + // public methods + // ******************* + + public function setPubArray( a:Array ) { pubArray = a; } + public function setPubBoolean( b:Boolean ) { pubBoolean = b; } + public function setPubDate( d:Date ) { pubDate = d; } + public function setPubFunction( f:Function ) { pubFunction = f; } + public function setPubMath( m:Math ) { pubMath = m; } + public function setPubNumber( n:Number ) { pubNumber = n; } + public function setPubObject( o:Object ) { pubObject = o; } + public function setPubString( s:String ) { pubString = s; } + + public function getPubArray() : Array { return this.pubArray; } + public function getPubBoolean() : Boolean { return this.pubBoolean; } + public function getPubDate() : Date { return this.pubDate; } + public function getPubFunction() : Function { return this.pubFunction; } + public function getPubMath() : Math { return this.pubMath; } + public function getPubNumber() : Number { return this.pubNumber; } + public function getPubObject() : Object { return this.pubObject; } + public function getPubString() : String { return this.pubString; } + + // ******************* + // private methods + // ******************* + + private function getPrivArray() : Array { return privArray; } + private function getPrivBoolean() : Boolean { return privBoolean; } + private function getPrivDate() : Date { return privDate; } + private function getPrivFunction() : Function { return privFunction; } + private function getPrivMath() : Math { return privMath; } + private function getPrivNumber() : Number { return privNumber; } + private function getPrivObject() : Object { return privObject; } + private function getPrivString() : String { return privString; } + + private function setPrivArray( a:Array ) { privArray = a; } + private function setPrivBoolean( b:Boolean ) { privBoolean = b; } + private function setPrivDate( d:Date ) { privDate = d; } + private function setPrivFunction( f:Function ) { privFunction = f; } + private function setPrivMath( m:Math ) { privMath = m; } + private function setPrivNumber( n:Number ) { privNumber = n; } + private function setPrivObject( o:Object ) { privObject = o; } + private function setPrivString( s:String ) { privString = s; } + + + // ******************* + // static methods + // ******************* + + static function setStatArray(a:Array) { statArray=a; } + static function setStatBoolean( b:Boolean ) { statBoolean = b; } + + static function getStatArray() { return statArray; } + + // ************************** + // public static methods + // ************************** + + public static function setPubStatArray(a:Array) { pubStatArray=a; } + public static function setPubStatBoolean( b:Boolean ) { pubStatBoolean = b; } + + public static function getPubStatArray() { return pubStatArray; } + + // ************************** + // private static methods + // ************************** + + private static function setPrivStatArray(a:Array) { privStatArray=a; } + private static function setPrivStatBoolean( b:Boolean ) { privStatBoolean = b; } + + private static function getPrivStatArray() { return privStatArray; } + + // *************************** + // to be overloaded + // *************************** + + function overLoad() { return "This is the parent class"; } + public function pubOverLoad() { return "This is the parent class"; } + private function privOverLoad() { return "This is the parent class"; } + static function statOverLoad() { return "This is the parent class"; } + public static function pubStatOverLoad() { return "This is the parent class"; } + private static function privStatOverLoad() { return "This is the parent class"; } + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtPublicOverRidePublic/PubExtPublicOverRidePublic.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtPublicOverRidePublic/PubExtPublicOverRidePublic.as new file mode 100644 index 00000000000..6ef94bb7f63 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/PubExtPublicOverRidePublic/PubExtPublicOverRidePublic.as @@ -0,0 +1,61 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +package PublicClass { + + import PublicClass.*; + + public class PubExtPublicOverRidePublic extends PublicClass { + + public var orSet = false; + public var orGet = false; + + // ******************************* + // override a public method + // with a public method + // ******************************* + + override public function getPubBoolean(): Boolean { + orGet = true; + return this.boolean; + } + + override public function setPubBoolean( b:Boolean ) { + orSet = true; + this.boolean = b; + } + + public function callSuper(b:Boolean):Boolean { + super.setPubBoolean(b); + return super.getPubBoolean(); + } + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/SuperDifferentMethod.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/SuperDifferentMethod.as new file mode 100644 index 00000000000..1df1c24c9a5 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/SuperDifferentMethod.as @@ -0,0 +1,56 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import SuperDifferentMethod.*; + + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Call super.differentMeth() from the override method"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + + +var obj = new SuperDifferentMethod(); + +AddTestCase( "obj.echo()", "foo() from BaseClass", obj.echo() ); +AddTestCase( "obj.callFoo()", "foo() from BaseClass", obj.callFoo() ); + + + + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/SuperDifferentMethod/BaseClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/SuperDifferentMethod/BaseClass.as new file mode 100644 index 00000000000..2a91d6d971a --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/SuperDifferentMethod/BaseClass.as @@ -0,0 +1,41 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package SuperDifferentMethod { + public class BaseClass { + public function echo() : String { + return "echo() from BaseClass"; + } + + public function foo() : String { + return "foo() from BaseClass"; + } + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/SuperDifferentMethod/SuperDifferentMethod.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/SuperDifferentMethod/SuperDifferentMethod.as new file mode 100644 index 00000000000..1882c653913 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/SuperDifferentMethod/SuperDifferentMethod.as @@ -0,0 +1,43 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package SuperDifferentMethod { + public class SuperDifferentMethod extends BaseClass { + override public function echo() : String { + return super.foo(); + } + + public function callFoo() : String { + return foo(); + } + + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/SuperDifferentNamespace.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/SuperDifferentNamespace.as new file mode 100644 index 00000000000..c75d2cfc5de --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/SuperDifferentNamespace.as @@ -0,0 +1,56 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import SuperDifferentNamespace.*; + + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Call super from the same namespace override method"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + + +var obj = new SuperDifferentNamespace(); +use namespace ns1; + +AddTestCase( "obj.echo()", "echo() from BaseClass.ns2 override", obj.echo() ); + + + + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/SuperDifferentNamespace/BaseClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/SuperDifferentNamespace/BaseClass.as new file mode 100644 index 00000000000..9e575efadd0 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/SuperDifferentNamespace/BaseClass.as @@ -0,0 +1,40 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package SuperDifferentNamespace { + public namespace ns1; + public namespace ns2; + + public class BaseClass { + ns1 function echo() : String { return "echo() from BaseClass.ns1"; } + + ns2 function echo() : String { return "echo() from BaseClass.ns2"; } + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/SuperDifferentNamespace/SuperDifferentNamespace.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/SuperDifferentNamespace/SuperDifferentNamespace.as new file mode 100644 index 00000000000..552a60076cb --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/SuperDifferentNamespace/SuperDifferentNamespace.as @@ -0,0 +1,39 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package SuperDifferentNamespace { + public class SuperDifferentNamespace extends BaseClass { + + override ns1 function echo() : String { + return super.ns2::echo() + " override"; + } + + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/SuperRTError.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/SuperRTError.as new file mode 100644 index 00000000000..00ddc5bde30 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/SuperRTError.as @@ -0,0 +1,65 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import errors.*; + + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Call a super method without specifying namespace"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + + +var obj = new SuperInNamespace(); + +var thisError = "no exception thrown"; +try{ + trace( obj.ns1::foo() ); +} catch (e1) { + thisError = e1.toString(); +} finally { + AddTestCase( "Call a super method without specifying namespace", + REFERENCEERROR+1070, + referenceError( thisError) ); +} + + + + + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/SuperRTError/BaseClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/SuperRTError/BaseClass.as new file mode 100644 index 00000000000..008e464451f --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/SuperRTError/BaseClass.as @@ -0,0 +1,39 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package errors { + public namespace ns1; + public namespace ns2; + + class BaseClass { + ns1 function foo(): String { return "A.ns1::foo()"; } + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/SuperRTError/SuperInNamespaceErr.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/SuperRTError/SuperInNamespaceErr.as new file mode 100644 index 00000000000..cc5954a8210 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/SuperRTError/SuperInNamespaceErr.as @@ -0,0 +1,40 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package errors { + + + public class SuperInNamespace extends BaseClass { + override ns1 function foo(): String { + return super.foo() + " override"; + } + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/SuperSameMethod.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/SuperSameMethod.as new file mode 100644 index 00000000000..29b13ea274e --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/SuperSameMethod.as @@ -0,0 +1,55 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import SuperSameMethod.*; + + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Call super from the override method"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + + +var obj = new SuperSameMethod(); + +AddTestCase( "obj.echo()", "echo() from BaseClass override", obj.echo() ); + + + + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/SuperSameMethod/BaseClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/SuperSameMethod/BaseClass.as new file mode 100644 index 00000000000..332a237d922 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/SuperSameMethod/BaseClass.as @@ -0,0 +1,35 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package SuperSameMethod { + public class BaseClass { + public function echo() : String { return "echo() from BaseClass"; } + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/SuperSameMethod/SuperSameMethod.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/SuperSameMethod/SuperSameMethod.as new file mode 100644 index 00000000000..c73300c6d98 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/SuperSameMethod/SuperSameMethod.as @@ -0,0 +1,37 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package SuperSameMethod { + public class SuperSameMethod extends BaseClass { + override public function echo() : String { + return super.echo() + " override"; + } + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/SuperSameNamespace.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/SuperSameNamespace.as new file mode 100644 index 00000000000..60204138a1f --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/SuperSameNamespace.as @@ -0,0 +1,56 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import SuperSameNamespace.*; + + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS 3.0"; // Version of JavaScript or ECMA +var TITLE = "Call super from the same namespace override method"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + + +var obj = new SuperSameNamespace(); +use namespace ns1; + +AddTestCase( "obj.echo()", "echo() from BaseClass override", obj.echo() ); + + + + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/SuperSameNamespace/BaseClass.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/SuperSameNamespace/BaseClass.as new file mode 100644 index 00000000000..dbb8d2ca5c3 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/SuperSameNamespace/BaseClass.as @@ -0,0 +1,37 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package SuperSameNamespace { + public namespace ns1; + + public class BaseClass { + ns1 function echo() : String { return "echo() from BaseClass"; } + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/SuperSameNamespace/SuperSameNamespace.as b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/SuperSameNamespace/SuperSameNamespace.as new file mode 100644 index 00000000000..25148b485f7 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Classes/Override/SuperSameNamespace/SuperSameNamespace.as @@ -0,0 +1,37 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package SuperSameNamespace { + public class SuperSameNamespace extends BaseClass { + override ns1 function echo() : String { + return super.ns1::echo() + " override"; + } + } +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionBody.as b/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionBody.as new file mode 100644 index 00000000000..40742ccabf6 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionBody.as @@ -0,0 +1,100 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import EmptyFunctionBody.*; + +class EmptyFunctionBodyClass { + function EmptyFunctionBodyClass() {} + function noReturnNoParams() { return "noReturnNoParams"; } + function noReturnParams(s:String, b:Boolean) { return s; } + function noReturnCustomParam(c:Custom) { return new Custom(); } + function returnNoParams():String { return "returnNoParams"; } + function returnParams(s:String, b:Boolean):String { return s; } + function returnCustomNoParams():Custom { return new Custom(); } +} + +function noReturnNoParamsNoPackage() { return "noReturnNoParams"; } +function noReturnParamsNoPackage(s:String, b:Boolean) { return s; } +function noReturnCustomParamNoPackage(c:Custom) { return new Custom(); } +function returnNoParamsNoPackage():String { return "returnNoParams"; } +function returnParamsNoPackage(s:String, b:Boolean):String { return s; } +function returnCustomNoParamsNoPackage():Custom { return new Custom(); } + + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Function Body Parameter/Result Type"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + +var TESTOBJ; +var s:String = new String("this is a test"); +var b:Boolean = new Boolean(true); +var c:Custom = new Custom(); + +// inside class inside package +TESTOBJ = new TestObj(); +AddTestCase( "TESTOBJ.noReturnNoParams()", "noReturnNoParams", TESTOBJ.noReturnNoParams() ); +AddTestCase( "TESTOBJ.noReturnParams(s,b)", "this is a test", TESTOBJ.noReturnParams(s,b) ); +//Function returns a new Custom object therefore must be compared using strings. +AddTestCase( "TESTOBJ.noReturnCustomParams(c)", "[object Custom]", String(TESTOBJ.noReturnCustomParam(c)) ); +AddTestCase( "TESTOBJ.returnNoParams()", "returnNoParams", TESTOBJ.returnNoParams() ); +AddTestCase( "TESTOBJ.returnParams(s,b)", "this is a test", TESTOBJ.returnParams(s,b) ); +AddTestCase( "TESTOBJ.returnCustomNoParams()", "[object Custom]", String(TESTOBJ.returnCustomNoParams()) ); + +// inside package outside of class +AddTestCase( "noReturnNoParams()", "noReturnNoParams", noReturnNoParams() ); +AddTestCase( "noReturnParams(s,b)", "this is a test", noReturnParams(s,b) ); +AddTestCase( "noReturnCustomParams()", "[object Custom]", String(noReturnCustomParam(c)) ); +AddTestCase( "returnNoParams()", "returnNoParams", returnNoParams() ); +AddTestCase( "returnParams(s,b)", "this is a test", returnParams(s,b) ); +AddTestCase( "returnCustomNoParams()", "[object Custom]", String(returnCustomNoParams()) ); + +// outside package inside class +TESTOBJ = new EmptyFunctionBodyClass(); +AddTestCase( "TESTOBJ.noReturnNoParams()", "noReturnNoParams", TESTOBJ.noReturnNoParams() ); +AddTestCase( "TESTOBJ.noReturnParams(s,b)", "this is a test", TESTOBJ.noReturnParams(s,b) ); +AddTestCase( "TESTOBJ.noReturnCustomParams()", "[object Custom]", String(TESTOBJ.noReturnCustomParam(c)) ); +AddTestCase( "TESTOBJ.returnNoParams()", "returnNoParams", TESTOBJ.returnNoParams() ); +AddTestCase( "TESTOBJ.returnParams(s,b)", "this is a test", TESTOBJ.returnParams(s,b) ); +AddTestCase( "TESTOBJ.returnCustomNoParams()", "[object Custom]", String(TESTOBJ.returnCustomNoParams()) ); + +// outside package and outside class +AddTestCase( "noReturnNoParamsNoPackage()", "noReturnNoParams", noReturnNoParamsNoPackage() ); +AddTestCase( "noReturnParamsNoPackage(s,b)", "this is a test", noReturnParamsNoPackage(s,b) ); +AddTestCase( "noReturnCustomParamsNoPackage()", "[object Custom]", String(noReturnCustomParamNoPackage(c)) ); +AddTestCase( "returnNoParamsNoPackage()", "returnNoParams", returnNoParamsNoPackage() ); +AddTestCase( "returnParamsNoPackage(s,b)", "this is a test", returnParamsNoPackage(s,b) ); +AddTestCase( "returnCustomNoParamsNoPackage()", "[object Custom]", String(returnCustomNoParamsNoPackage()) ); + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionBody/Custom.as b/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionBody/Custom.as new file mode 100644 index 00000000000..27f06cd38cb --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionBody/Custom.as @@ -0,0 +1,34 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package EmptyFunctionBody { + public class Custom {} +} + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionBody/TestObj.as b/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionBody/TestObj.as new file mode 100644 index 00000000000..91e89b0ee59 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionBody/TestObj.as @@ -0,0 +1,53 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package EmptyFunctionBody { + + // due to bug 106878, the base class definition must be first + class TestObjInner{ + function noReturnNoParamsInner() { return "noReturnNoParams"; } + function noReturnParamsInner(s:String, b:Boolean) { return s; } + function noReturnCustomParamInner(c:Custom) { return new Custom(); } + function returnNoParamsInner():String { return "returnNoParams"; } + function returnParamsInner(s:String, b:Boolean):String { return s; } + function returnCustomNoParamsInner():Custom { return new Custom(); } + } + + public class TestObj extends TestObjInner { + public function noReturnNoParams() { return noReturnNoParamsInner(); } + public function noReturnParams(s:String, b:Boolean) { return noReturnParamsInner(s,b); } + public function noReturnCustomParam(c:Custom) { return noReturnCustomParamInner(c); } + public function returnNoParams():String { return returnNoParamsInner(); } + public function returnParams(s:String, b:Boolean):String { return returnParamsInner(s,b); } + public function returnCustomNoParams():Custom { return returnCustomNoParamsInner(); } + } + +} + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionBody/noReturnCustomParam.as b/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionBody/noReturnCustomParam.as new file mode 100644 index 00000000000..603f7e0a073 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionBody/noReturnCustomParam.as @@ -0,0 +1,35 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package EmptyFunctionBody { + function noReturnCustomParamInner(c:Custom) { return new Custom(); } + public function noReturnCustomParam(c:Custom) { return noReturnCustomParamInner(c); } +} + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionBody/noReturnNoParams.as b/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionBody/noReturnNoParams.as new file mode 100644 index 00000000000..1471887a569 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionBody/noReturnNoParams.as @@ -0,0 +1,35 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package EmptyFunctionBody { + function noReturnNoParamsInner() { return "noReturnNoParams"; } + public function noReturnNoParams() { return noReturnNoParamsInner(); } +} + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionBody/noReturnParams.as b/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionBody/noReturnParams.as new file mode 100644 index 00000000000..c5725c7a33b --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionBody/noReturnParams.as @@ -0,0 +1,35 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package EmptyFunctionBody { + function noReturnParamsInner(s:String, b:Boolean) { return s; } + public function noReturnParams(s:String, b:Boolean) { return noReturnParamsInner(s,b); } +} + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionBody/returnCustomNoParams.as b/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionBody/returnCustomNoParams.as new file mode 100644 index 00000000000..0aa584dc447 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionBody/returnCustomNoParams.as @@ -0,0 +1,36 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package EmptyFunctionBody { + + function returnCustomNoParamsInner():Custom { return new Custom(); } + public function returnCustomNoParams():Custom { return returnCustomNoParamsInner(); } +} + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionBody/returnNoParams.as b/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionBody/returnNoParams.as new file mode 100644 index 00000000000..9ce2b974dce --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionBody/returnNoParams.as @@ -0,0 +1,35 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package EmptyFunctionBody { + function returnNoParamsInner():String { return "returnNoParams"; } + public function returnNoParams():String { return returnNoParamsInner(); } +} + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionBody/returnParams.as b/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionBody/returnParams.as new file mode 100644 index 00000000000..fa548330c42 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionBody/returnParams.as @@ -0,0 +1,35 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package EmptyFunctionBody { + function returnParamsInner(s:String, b:Boolean):String { return s; } + public function returnParams(s:String, b:Boolean):String { return returnParamsInner(s,b); } +} + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionName.as b/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionName.as new file mode 100644 index 00000000000..e57582907b3 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionName.as @@ -0,0 +1,144 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import EmptyFunctionName.*; + +class EmptyFunctionNameClass { + // constructor + function EmptyFunctionNameClass() { res = "EmptyName"; } + + // not the constructor but looks like it + function emptyFunctionNameClass() { return "not the constructor" } + + function a1 () { return "a1"; } + function a_1 () { return "a_1"; } + function _a1 () { return "_a1"; } + function __a1 () { return "__a1"; } + function _a1_ () { return "_a1_"; } + function __a1__ () { return "__a1__"; } + function $a1 () { return "$a1"; } + function a$1 () { return "a$1"; } + function a1$ () { return "a1$"; } + function A1 () { return "A1"; } + function cases () { return "cases"; } + function Cases () { return "Cases"; } + function abcdefghijklmnopqrstuvwxyz0123456789$_ () { return "all"; } +} + +function b1 () { return "b1"; } +function b_1 () { return "b_1"; } +function _b1 () { return "_b1"; } +function __b1 () { return "__b1"; } +function _b1_ () { return "_b1_"; } +function __b1__ () { return "__b1__"; } +function $b1 () { return "$b1"; } +function b$1 () { return "b$1"; } +function b1$ () { return "b1$"; } +function B1 () { return "B1"; } +function bcases () { return "bcases"; } +function BCases () { return "BCases"; } +function abbcdefghijklmnopqrstuvwxyz0123456789$_ () { return "ball"; } + + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Function Names"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + +var TESTOBJ; + +// inside class inside package +TESTOBJ = new TestNameObj(); +AddTestCase( "inside class inside package function Name a1()", "a1", TESTOBJ.puba1() ); +AddTestCase( "inside class inside package function Name a_1()", "a_1", TESTOBJ.puba_1() ); +AddTestCase( "inside class inside package function Name _a1()", "_a1", TESTOBJ.pub_a1() ); +AddTestCase( "inside class inside package function Name __a1()", "__a1", TESTOBJ.pub__a1() ); +AddTestCase( "inside class inside package function Name _a1_()", "_a1_", TESTOBJ.pub_a1_() ); +AddTestCase( "inside class inside package function Name __a1__()", "__a1__", TESTOBJ.pub__a1__() ); +AddTestCase( "inside class inside package function Name $a1()", "$a1", TESTOBJ.pub$a1() ); +AddTestCase( "inside class inside package function Name a$1()", "a$1", TESTOBJ.puba$1() ); +AddTestCase( "inside class inside package function Name a1$()", "a1$", TESTOBJ.puba1$() ); +AddTestCase( "inside class inside package function Name A1()", "A1", TESTOBJ.pubA1() ); +AddTestCase( "inside class inside package function Name cases()", "cases", TESTOBJ.pubcases() ); +AddTestCase( "inside class inside package function Name Cases()", "Cases", TESTOBJ.pubCases() ); +AddTestCase( "inside class inside package function Name all()", "all", TESTOBJ.puball() ); +AddTestCase( "inside class inside package function Name constructor different case", "not the constructor", TESTOBJ.pubTestConst() ); + +// outside class inside package +AddTestCase( "outside class inside package a1()", "a1", puba1() ); +AddTestCase( "outside class inside package a_1()", "a_1", puba_1() ); +AddTestCase( "outside class inside package function Name _a1()", "_a1", pub_a1() ); +AddTestCase( "outside class inside package function Name __a1()", "__a1", pub__a1() ); +AddTestCase( "outside class inside package function Name _a1_()", "_a1_", pub_a1_() ); +AddTestCase( "outside class inside package function Name __a1__()", "__a1__", pub__a1__() ); +AddTestCase( "outside class inside package function Name $a1()", "$a1", pub$a1() ); +AddTestCase( "outside class inside package function Name a$1()", "a$1", puba$1() ); +AddTestCase( "outside class inside package function Name a1$()", "a1$", puba1$() ); +AddTestCase( "outside class inside package function Name C1()", "C1", pubC1() ); +AddTestCase( "outside class inside package function Name cases()", "cases", pubcases() ); + +// inside class outside package +TESTOBJ = new EmptyFunctionNameClass(); +AddTestCase( "inside class outside package function Name a1()", "a1", TESTOBJ.a1() ); +AddTestCase( "inside class outside package function Name a_1()", "a_1", TESTOBJ.a_1() ); +AddTestCase( "inside class outside package function Name _a1()", "_a1", TESTOBJ._a1() ); +AddTestCase( "inside class outside package function Name __a1()", "__a1", TESTOBJ.__a1() ); +AddTestCase( "inside class outside package function Name _a1_()", "_a1_", TESTOBJ._a1_() ); +AddTestCase( "inside class outside package function Name __a1__()", "__a1__", TESTOBJ.__a1__() ); +AddTestCase( "inside class outside package function Name $a1()", "$a1", TESTOBJ.$a1() ); +AddTestCase( "inside class outside package function Name a$1()", "a$1", TESTOBJ.a$1() ); +AddTestCase( "inside class outside package function Name a1$()", "a1$", TESTOBJ.a1$() ); +AddTestCase( "inside class outside package function Name A1()", "A1", TESTOBJ.A1() ); +AddTestCase( "inside class outside package function Name cases()", "cases", TESTOBJ.cases() ); +AddTestCase( "inside class outside package function Name Cases()", "Cases", TESTOBJ.Cases() ); +AddTestCase( "inside class outside package function Name all()", "all", TESTOBJ.abcdefghijklmnopqrstuvwxyz0123456789$_() ); +AddTestCase( "inside class outside package function Name constructor different case", "not the constructor", TESTOBJ.emptyFunctionNameClass() ); + +// outside class outside package +AddTestCase( "outside class outside package b1()", "b1", b1() ); +AddTestCase( "outside class outside package b_1()", "b_1", b_1() ); +AddTestCase( "outside class outside package function Name _b1()", "_b1", _b1() ); +AddTestCase( "outside class outside package function Name __b1()", "__b1", __b1() ); +AddTestCase( "outside class outside package function Name _b1_()", "_b1_", _b1_() ); +AddTestCase( "outside class outside package function Name __b1__()", "__b1__", __b1__() ); +AddTestCase( "outside class outside package function Name $b1()", "$b1", $b1() ); +AddTestCase( "outside class outside package function Name b$1()", "b$1", b$1() ); +AddTestCase( "outside class outside package function Name b1$()", "b1$", b1$() ); +AddTestCase( "outside class outside package function Name B1()", "B1", B1() ); +AddTestCase( "outside class outside package function Name bcases()", "bcases", bcases() ); +AddTestCase( "outside class outside package function Name BCases()", "BCases", BCases() ); +AddTestCase( "outside class outside package function Name ball()", "ball", abbcdefghijklmnopqrstuvwxyz0123456789$_() ); + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionName/TestNameObj.as b/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionName/TestNameObj.as new file mode 100644 index 00000000000..3a2b488842f --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionName/TestNameObj.as @@ -0,0 +1,76 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package EmptyFunctionName { + + // due to bug 106878, the base class definition must be first + class TestNameObjInner { + + // constructor + function TestNameObjInner() { res = "EmptyName"; } + + // not the constructor but looks like it + function testNameObjInner() { return "not the constructor" } + + function a1 () { return "a1"; } + function a_1 () { return "a_1"; } + function _a1 () { return "_a1"; } + function __a1 () { return "__a1"; } + function _a1_ () { return "_a1_"; } + function __a1__ () { return "__a1__"; } + function $a1 () { return "$a1"; } + function a$1 () { return "a$1"; } + function a1$ () { return "a1$"; } + function A1 () { return "A1"; } + function cases () { return "cases"; } + function Cases () { return "Cases"; } + function abcdefghijklmnopqrstuvwxyz0123456789$_ () { return "all"; } + } + + + public class TestNameObj extends TestNameObjInner { + public function pubTestConst() { return testNameObjInner(); } + public function puba1 () { return a1(); } + public function puba_1 () { return a_1(); } + public function pub_a1 () { return _a1(); } + public function pub__a1 () { return __a1(); } + public function pub_a1_ () { return _a1_(); } + public function pub__a1__ () { return __a1__(); } + public function pub$a1 () { return $a1(); } + public function puba$1 () { return a$1(); } + public function puba1$ () { return a1$(); } + public function pubA1 () { return A1(); } + public function pubcases () { return cases(); } + public function pubCases () { return Cases(); } + public function puball () { return abcdefghijklmnopqrstuvwxyz0123456789$_(); } + } + +} + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionName/pub$a1.as b/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionName/pub$a1.as new file mode 100644 index 00000000000..624172b0246 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionName/pub$a1.as @@ -0,0 +1,35 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package EmptyFunctionName { + function $a1 () { return "$a1"; } + public function pub$a1 () { return $a1(); } +} + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionName/pubC1.as b/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionName/pubC1.as new file mode 100644 index 00000000000..37cfe9c4708 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionName/pubC1.as @@ -0,0 +1,35 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package EmptyFunctionName { + function C1 () { return "C1"; } + public function pubC1 () { return C1(); } +} + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionName/pub__a1.as b/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionName/pub__a1.as new file mode 100644 index 00000000000..b0a588054d4 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionName/pub__a1.as @@ -0,0 +1,35 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package EmptyFunctionName { + function __a1 () { return "__a1"; } + public function pub__a1 () { return __a1(); } +} + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionName/pub__a1__.as b/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionName/pub__a1__.as new file mode 100644 index 00000000000..3f794778741 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionName/pub__a1__.as @@ -0,0 +1,35 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package EmptyFunctionName { + function __a1__ () { return "__a1__"; } + public function pub__a1__ () { return __a1__(); } +} + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionName/pub_a1.as b/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionName/pub_a1.as new file mode 100644 index 00000000000..22876288356 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionName/pub_a1.as @@ -0,0 +1,35 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package EmptyFunctionName { + function _a1 () { return "_a1"; } + public function pub_a1 () { return _a1(); } +} + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionName/pub_a1_.as b/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionName/pub_a1_.as new file mode 100644 index 00000000000..0e969f6bd1c --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionName/pub_a1_.as @@ -0,0 +1,35 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package EmptyFunctionName { + function _a1_ () { return "_a1_"; } + public function pub_a1_ () { return _a1_(); } +} + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionName/puba$1.as b/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionName/puba$1.as new file mode 100644 index 00000000000..7bba917ce62 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionName/puba$1.as @@ -0,0 +1,35 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package EmptyFunctionName { + function a$1 () { return "a$1"; } + public function puba$1 () { return a$1(); } +} + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionName/puba1$.as b/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionName/puba1$.as new file mode 100644 index 00000000000..a3126fab7cf --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionName/puba1$.as @@ -0,0 +1,35 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package EmptyFunctionName { + function a1$ () { return "a1$"; } + public function puba1$ () { return a1$(); } +} + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionName/puba1.as b/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionName/puba1.as new file mode 100644 index 00000000000..ce99619d2ab --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionName/puba1.as @@ -0,0 +1,35 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package EmptyFunctionName { + function a1 () { return "a1"; } + public function puba1 () { return a1(); } +} + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionName/puba_1.as b/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionName/puba_1.as new file mode 100644 index 00000000000..1a448ab5908 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionName/puba_1.as @@ -0,0 +1,35 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package EmptyFunctionName { + function a_1 () { return "a_1"; } + public function puba_1 () { return a_1(); } +} + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionName/pubcases.as b/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionName/pubcases.as new file mode 100644 index 00000000000..2231901dc9c --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/EmptyFunctionName/pubcases.as @@ -0,0 +1,39 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package EmptyFunctionName { + function cases () { return "cases"; } + function Cases () { return "Cases"; } + + public function pubcases () { + return cases(); + } +} + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionBody.as b/mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionBody.as new file mode 100644 index 00000000000..b5319e75b55 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionBody.as @@ -0,0 +1,75 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import FinalFunctionBody.*; + +class FinalFunctionBodyClass { + final function noReturnNoParams() { return "noReturnNoParams"; } + final function noReturnParams(s:String, b:Boolean) { return s; } + final function noReturnCustomParam(c:Custom) { return new Custom(); } + final function returnNoParams():String { return "returnNoParams"; } + final function returnParams(s:String, b:Boolean):String { return s; } + final function returnCustomNoParams():Custom { return new Custom(); } +} + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Function Body Parameter/Result Type"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + +var TESTOBJ; +var s:String = new String("this is a test"); +var b:Boolean = new Boolean(true); +var c:Custom = new Custom(); + +// inside class inside package +TESTOBJ = new TestObj(); +AddTestCase( "TESTOBJ.noReturnNoParams()", "noReturnNoParams", TESTOBJ.noReturnNoParams() ); +AddTestCase( "TESTOBJ.noReturnParams(s,b)", "this is a test", TESTOBJ.noReturnParams(s,b) ); +AddTestCase( "TESTOBJ.noReturnCustomParams()", "[object Custom]", String(TESTOBJ.noReturnCustomParam(c)) ); +AddTestCase( "TESTOBJ.returnNoParams()", "returnNoParams", TESTOBJ.returnNoParams() ); +AddTestCase( "TESTOBJ.returnParams(s,b)", "this is a test", TESTOBJ.returnParams(s,b) ); +AddTestCase( "TESTOBJ.returnCustomNoParams()", "[object Custom]", String(TESTOBJ.returnCustomNoParams()) ); + +// outside package inside class +TESTOBJ = new FinalFunctionBodyClass(); +AddTestCase( "TESTOBJ.noReturnNoParams()", "noReturnNoParams", TESTOBJ.noReturnNoParams() ); +AddTestCase( "TESTOBJ.noReturnParams(s,b)", "this is a test", TESTOBJ.noReturnParams(s,b) ); +AddTestCase( "TESTOBJ.noReturnCustomParams()", "[object Custom]", String(TESTOBJ.noReturnCustomParam(c)) ); +AddTestCase( "TESTOBJ.returnNoParams()", "returnNoParams", TESTOBJ.returnNoParams() ); +AddTestCase( "TESTOBJ.returnParams(s,b)", "this is a test", TESTOBJ.returnParams(s,b) ); +AddTestCase( "TESTOBJ.returnCustomNoParams()", "[object Custom]", String(TESTOBJ.returnCustomNoParams()) ); + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionBody/Custom.as b/mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionBody/Custom.as new file mode 100644 index 00000000000..ef540159726 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionBody/Custom.as @@ -0,0 +1,34 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package FinalFunctionBody { + public class Custom {} +} + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionBody/TestObj.as b/mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionBody/TestObj.as new file mode 100644 index 00000000000..87f2c9c69fb --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionBody/TestObj.as @@ -0,0 +1,53 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package FinalFunctionBody { + + // due to bug 106878, the base class definition must be first + class TestObjInner{ + final function noReturnNoParamsInner() { return "noReturnNoParams"; } + final function noReturnParamsInner(s:String, b:Boolean) { return s; } + final function noReturnCustomParamInner(c:Custom) { return new Custom(); } + final function returnNoParamsInner():String { return "returnNoParams"; } + final function returnParamsInner(s:String, b:Boolean):String { return s; } + final function returnCustomNoParamsInner():Custom { return new Custom(); } + } + + public class TestObj extends TestObjInner { + public function noReturnNoParams() { return noReturnNoParamsInner(); } + public function noReturnParams(s:String, b:Boolean) { return noReturnParamsInner(s,b); } + public function noReturnCustomParam(c:Custom) { return noReturnCustomParamInner(c); } + public function returnNoParams():String { return returnNoParamsInner(); } + public function returnParams(s:String, b:Boolean):String { return returnParamsInner(s,b); } + public function returnCustomNoParams():Custom { return returnCustomNoParamsInner(); } + } + +} + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionName.as b/mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionName.as new file mode 100644 index 00000000000..03730daea0b --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionName.as @@ -0,0 +1,101 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import FinalFunctionName.*; + +class FinalFunctionNameClass { + // constructor + function TestNameObjNoPackage() { res = "EmptyName"; } + + // not the constructor but looks like it + function testNameObjNoPackage() { return "not the constructor" } + + final function a1 () { return "a1"; } + final function a_1 () { return "a_1"; } + final function _a1 () { return "_a1"; } + final function __a1 () { return "__a1"; } + final function _a1_ () { return "_a1_"; } + final function __a1__ () { return "__a1__"; } + final function $a1 () { return "$a1"; } + final function a$1 () { return "a$1"; } + final function a1$ () { return "a1$"; } + final function A1 () { return "A1"; } + final function cases () { return "cases"; } + final function Cases () { return "Cases"; } + final function abcdefghijklmnopqrstuvwxyz0123456789$_ () { return "all"; } +} + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Function Names"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + +var TESTOBJ; + +// inside class inside package +TESTOBJ = new TestNameObj(); +AddTestCase( "inside class inside package function Name a1()", "a1", TESTOBJ.puba1() ); +AddTestCase( "inside class inside package function Name a_1()", "a_1", TESTOBJ.puba_1() ); +AddTestCase( "inside class inside package function Name _a1()", "_a1", TESTOBJ.pub_a1() ); +AddTestCase( "inside class inside package function Name __a1()", "__a1", TESTOBJ.pub__a1() ); +AddTestCase( "inside class inside package function Name _a1_()", "_a1_", TESTOBJ.pub_a1_() ); +AddTestCase( "inside class inside package function Name __a1__()", "__a1__", TESTOBJ.pub__a1__() ); +AddTestCase( "inside class inside package function Name $a1()", "$a1", TESTOBJ.pub$a1() ); +AddTestCase( "inside class inside package function Name a$1()", "a$1", TESTOBJ.puba$1() ); +AddTestCase( "inside class inside package function Name a1$()", "a1$", TESTOBJ.puba1$() ); +AddTestCase( "inside class inside package function Name A1()", "A1", TESTOBJ.pubA1() ); +AddTestCase( "inside class inside package function Name cases()", "cases", TESTOBJ.pubcases() ); +AddTestCase( "inside class inside package function Name Cases()", "Cases", TESTOBJ.pubCases() ); +AddTestCase( "inside class inside package function Name all()", "all", TESTOBJ.puball() ); +AddTestCase( "inside class inside package function Name constructor different case", "not the constructor", TESTOBJ.pubTestConst() ); + +// inside class outside package +TESTOBJ = new FinalFunctionNameClass(); +AddTestCase( "inside class outside package function Name a1()", "a1", TESTOBJ.a1() ); +AddTestCase( "inside class outside package function Name a_1()", "a_1", TESTOBJ.a_1() ); +AddTestCase( "inside class outside package function Name _a1()", "_a1", TESTOBJ._a1() ); +AddTestCase( "inside class outside package function Name __a1()", "__a1", TESTOBJ.__a1() ); +AddTestCase( "inside class outside package function Name _a1_()", "_a1_", TESTOBJ._a1_() ); +AddTestCase( "inside class outside package function Name __a1__()", "__a1__", TESTOBJ.__a1__() ); +AddTestCase( "inside class outside package function Name $a1()", "$a1", TESTOBJ.$a1() ); +AddTestCase( "inside class outside package function Name a$1()", "a$1", TESTOBJ.a$1() ); +AddTestCase( "inside class outside package function Name a1$()", "a1$", TESTOBJ.a1$() ); +AddTestCase( "inside class outside package function Name A1()", "A1", TESTOBJ.A1() ); +AddTestCase( "inside class outside package function Name cases()", "cases", TESTOBJ.cases() ); +AddTestCase( "inside class outside package function Name Cases()", "Cases", TESTOBJ.Cases() ); +AddTestCase( "inside class outside package function Name all()", "all", TESTOBJ.abcdefghijklmnopqrstuvwxyz0123456789$_() ); +AddTestCase( "inside class outside package function Name constructor different case", "not the constructor", TESTOBJ.testNameObjNoPackage() ); + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionName/TestNameObj.as b/mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionName/TestNameObj.as new file mode 100644 index 00000000000..cd557d15f30 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionName/TestNameObj.as @@ -0,0 +1,76 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package FinalFunctionName { + + // due to bug 106878, the base class definition must be first + class TestNameObjInner { + + // constructor + function TestNameObjInner() { res = "EmptyName"; } + + // not the constructor but looks like it + final function testNameObjInner() { return "not the constructor" } + + final function a1 () { return "a1"; } + final function a_1 () { return "a_1"; } + final function _a1 () { return "_a1"; } + final function __a1 () { return "__a1"; } + final function _a1_ () { return "_a1_"; } + final function __a1__ () { return "__a1__"; } + final function $a1 () { return "$a1"; } + final function a$1 () { return "a$1"; } + final function a1$ () { return "a1$"; } + final function A1 () { return "A1"; } + final function cases () { return "cases"; } + final function Cases () { return "Cases"; } + final function abcdefghijklmnopqrstuvwxyz0123456789$_ () { return "all"; } + } + + + public class TestNameObj extends TestNameObjInner { + public function pubTestConst() { return testNameObjInner(); } + public function puba1 () { return a1(); } + public function puba_1 () { return a_1(); } + public function pub_a1 () { return _a1(); } + public function pub__a1 () { return __a1(); } + public function pub_a1_ () { return _a1_(); } + public function pub__a1__ () { return __a1__(); } + public function pub$a1 () { return $a1(); } + public function puba$1 () { return a$1(); } + public function puba1$ () { return a1$(); } + public function pubA1 () { return A1(); } + public function pubcases () { return cases(); } + public function pubCases () { return Cases(); } + public function puball () { return abcdefghijklmnopqrstuvwxyz0123456789$_(); } + } + +} + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionName/pub$a1.as b/mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionName/pub$a1.as new file mode 100644 index 00000000000..7997e5961ce --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionName/pub$a1.as @@ -0,0 +1,35 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package FinalFunctionName { + function $a1 () { return "$a1"; } + public function pub$a1 () { return $a1(); } +} + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionName/pubC1.as b/mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionName/pubC1.as new file mode 100644 index 00000000000..1c8ee3f7ef9 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionName/pubC1.as @@ -0,0 +1,35 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package FinalFunctionName { + function C1 () { return "C1"; } + public function pubC1 () { return C1(); } +} + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionName/pub__a1.as b/mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionName/pub__a1.as new file mode 100644 index 00000000000..9705ed0ac70 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionName/pub__a1.as @@ -0,0 +1,35 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package FinalFunctionName { + function __a1 () { return "__a1"; } + public function pub__a1 () { return __a1(); } +} + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionName/pub__a1__.as b/mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionName/pub__a1__.as new file mode 100644 index 00000000000..af0aed6d650 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionName/pub__a1__.as @@ -0,0 +1,35 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package FinalFunctionName { + function __a1__ () { return "__a1__"; } + public function pub__a1__ () { return __a1__(); } +} + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionName/pub_a1.as b/mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionName/pub_a1.as new file mode 100644 index 00000000000..abc85b8b4fb --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionName/pub_a1.as @@ -0,0 +1,35 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package FinalFunctionName { + function _a1 () { return "_a1"; } + public function pub_a1 () { return _a1(); } +} + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionName/pub_a1_.as b/mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionName/pub_a1_.as new file mode 100644 index 00000000000..aaf02664704 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionName/pub_a1_.as @@ -0,0 +1,35 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package FinalFunctionName { + function _a1_ () { return "_a1_"; } + public function pub_a1_ () { return _a1_(); } +} + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionName/puba$1.as b/mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionName/puba$1.as new file mode 100644 index 00000000000..0cba5c0a9a5 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionName/puba$1.as @@ -0,0 +1,35 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package FinalFunctionName { + function a$1 () { return "a$1"; } + public function puba$1 () { return a$1(); } +} + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionName/puba1$.as b/mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionName/puba1$.as new file mode 100644 index 00000000000..30576d4f8f7 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionName/puba1$.as @@ -0,0 +1,35 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package FinalFunctionName { + function a1$ () { return "a1$"; } + public function puba1$ () { return a1$(); } +} + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionName/puba1.as b/mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionName/puba1.as new file mode 100644 index 00000000000..05c2dacfa50 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionName/puba1.as @@ -0,0 +1,35 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package FinalFunctionName { + function a1 () { return "a1"; } + public function puba1 () { return a1(); } +} + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionName/puba_1.as b/mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionName/puba_1.as new file mode 100644 index 00000000000..a7d283b48c5 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionName/puba_1.as @@ -0,0 +1,35 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package FinalFunctionName { + function a_1 () { return "a_1"; } + public function puba_1 () { return a_1(); } +} + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionName/pubcases.as b/mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionName/pubcases.as new file mode 100644 index 00000000000..5e593fc3165 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/FinalFunctionName/pubcases.as @@ -0,0 +1,39 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package FinalFunctionName { + function cases () { return "cases"; } + function Cases () { return "Cases"; } + + public function pubcases () { + return cases(); + } +} + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/MultiOptArgFunction.as b/mozilla/js/tamarin/test/as3/Definitions/Function/MultiOptArgFunction.as new file mode 100644 index 00000000000..a723e674cdc --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/MultiOptArgFunction.as @@ -0,0 +1,190 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import MultiOptArgFunction.* + +class MultiOptArgFunctionClass { + function returnArguments(s:String = "Str3", b:Boolean = true, n:Number = 30) { + str = s; + bool = b; + num = n; + } +} + +function returnArgumentsNoPackage(s:String = "Str4", b:Boolean = false, n:Number = 40) { + str = s; + bool = b; + num = n; +} + + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Function Body Parameter/Result Type"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var TESTOBJ = new TestObj(); +var TESTOBJ1 = new MultiOptArgFunctionClass(); + +var success = false; +TESTOBJ.returnArguments("String1"); + +if(str == "String1" && bool == true && num == 10) +{ success = true;} +else +{ success = false;} + +AddTestCase( "TESTOBJ.returnArguments('String1');", true, success ); + + +success = false; +TESTOBJ.returnArguments("String1",false); + +if(str == "String1" && bool == false && num == 10) +{ success = true;} +else +{ success = false;} + +AddTestCase( "TESTOBJ.returnArguments('String1',false)", true, success ); + + +success = false; +TESTOBJ.returnArguments("String1",false,100); + +if(str == "String1" && bool == false && num == 100) +{ success = true;} +else +{success = false;} + +AddTestCase( "TESTOBJ.returnArguments('String1',false,100);", true, success ); + + +success = false; +returnArguments("String2"); + +if(str == "String2" && bool == false && num == 20) +{success = true;} +else +{success = false;} + +AddTestCase( "returnArguments('String2')", true, success ); + + +success = false; +returnArguments("String2",true); + +if(str == "String2" && bool == true && num == 20) +{success = true;} +else +{success = false;} + +AddTestCase( "returnArguments('String2',true)", true, success ); + +success = false; +returnArguments("String2",true,100); + +if(str == "String2" && bool == true && num == 100) +{success = true;} +else +{success = false;} + +AddTestCase( "returnArguments('String2',true,100)", true, success ); + +success = false; +TESTOBJ1.returnArguments("String3"); + +if(str == "String3" && bool == true && num == 30) +{success = true;} +else +{success = false;} + +AddTestCase( "TESTOBJ1.returnArguments('String3')", true, success ); + + +success = false; +TESTOBJ1.returnArguments("String3",false); + +if(str == "String3" && bool == false && num == 30) +{success = true;} +else +{success = false;} + +AddTestCase( "TESTOBJ1.returnArguments('String3',false)", true, success ); + +success = false; +TESTOBJ1.returnArguments("String3",false,300); + +if(str == "String3" && bool == false && num == 300) +{success = true;} +else +{success = false;} + +AddTestCase( "TESTOBJ1.returnArguments('String3',false,300)", true, success ); + + +success = false; +returnArgumentsNoPackage("String4"); + +if(str == "String4" && bool == false && num == 40) +{success = true;} +else +{success = false;} + +AddTestCase( "returnArgumentsNoPackage('String4')", true, success ); + + +success = false; +returnArgumentsNoPackage("String4",true); + +if(str == "String4" && bool == true && num == 40) +{success = true;} +else +{success = false;} + +AddTestCase( "returnArgumentsNoPackage('String4',true)", true, success ); + + +success = false; +returnArgumentsNoPackage("String4",true,400); + +if(str == "String4" && bool == true && num == 400) +{success = true;} +else +{success = false;} + +AddTestCase( "returnArgumentsNoPackage('String4',true,400)", true, success ); + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/MultiOptArgFunction/Boolean.as b/mozilla/js/tamarin/test/as3/Definitions/Function/MultiOptArgFunction/Boolean.as new file mode 100644 index 00000000000..0b068eb9db5 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/MultiOptArgFunction/Boolean.as @@ -0,0 +1,35 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package MultiOptArgFunction { + + public var bool:Boolean = new Boolean(false); +} + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/MultiOptArgFunction/Number.as b/mozilla/js/tamarin/test/as3/Definitions/Function/MultiOptArgFunction/Number.as new file mode 100644 index 00000000000..aa7bb5ca12f --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/MultiOptArgFunction/Number.as @@ -0,0 +1,35 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package MultiOptArgFunction { + + public var num:Number = 1000; +} + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/MultiOptArgFunction/String.as b/mozilla/js/tamarin/test/as3/Definitions/Function/MultiOptArgFunction/String.as new file mode 100644 index 00000000000..474f80236b0 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/MultiOptArgFunction/String.as @@ -0,0 +1,36 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package MultiOptArgFunction { + + public var str:String = new String(""); + +} + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/MultiOptArgFunction/TestObj.as b/mozilla/js/tamarin/test/as3/Definitions/Function/MultiOptArgFunction/TestObj.as new file mode 100644 index 00000000000..c324863dc14 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/MultiOptArgFunction/TestObj.as @@ -0,0 +1,44 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package MultiOptArgFunction { + + public class TestObj{ + + public function returnArguments(s:String = "Str1", b:Boolean = true, n:Number = 10) { + str = s; + bool = b; + num = n; + } + + } + +} + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/MultiOptArgFunction/returnArguments.as b/mozilla/js/tamarin/test/as3/Definitions/Function/MultiOptArgFunction/returnArguments.as new file mode 100644 index 00000000000..d9fba70d8b1 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/MultiOptArgFunction/returnArguments.as @@ -0,0 +1,41 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package MultiOptArgFunction { + + public function returnArguments(s:String = "Str2", b:Boolean = false, n:Number = 20) { + + str = s; + bool = b; + num = n; + } + +} + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/MultipleExtraArgFunction1.as b/mozilla/js/tamarin/test/as3/Definitions/Function/MultipleExtraArgFunction1.as new file mode 100644 index 00000000000..741c7a22a54 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/MultipleExtraArgFunction1.as @@ -0,0 +1,61 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import MultipleExtraArgFunction1.* + +function returnRestNoPackage(... rest):Number { return rest.length; } + + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Optional Argument test"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + +var TESTOBJ = new TestObj(); +var TESTOBJ1 = new MultipleExtraArgFunction1(); + +// inside class inside package +AddTestCase( "TESTOBJ.returnRest()", 6, TESTOBJ.returnRest(10,false,"hello",new Object(), [123],[345]) ); + +// inside package outside of class +AddTestCase( "returnRest()", 7, returnRest([10,11,12],false,"hello",new Object(), [123],[345],"hello") ); + +// outside package inside class +AddTestCase( "TESTOBJ1.returnRest()", 6, TESTOBJ1.returnRest(10,new Object(),"hello",new Object(), [123],[345]) ); + +// outside package and outside class +AddTestCase( "returnRestNoPackage()", 6, returnRestNoPackage(10,"str2","hello",new Object(), [123],[345]) ); + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/MultipleExtraArgFunction1/MultipleExtraArgFunction1Class.as b/mozilla/js/tamarin/test/as3/Definitions/Function/MultipleExtraArgFunction1/MultipleExtraArgFunction1Class.as new file mode 100644 index 00000000000..96be4d6fd3a --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/MultipleExtraArgFunction1/MultipleExtraArgFunction1Class.as @@ -0,0 +1,36 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +class MultipleExtraArgFunction1{ + + function returnRest(... rest):Number { return rest.length; } + +} + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/MultipleExtraArgFunction1/TestObj.as b/mozilla/js/tamarin/test/as3/Definitions/Function/MultipleExtraArgFunction1/TestObj.as new file mode 100644 index 00000000000..530c7849399 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/MultipleExtraArgFunction1/TestObj.as @@ -0,0 +1,42 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package MultipleExtraArgFunction1 { + + class TestObjInner{ + + public function returnRest(... rest):Number { return rest.length; } + + } + + public class TestObj extends TestObjInner {} + +} + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/MultipleExtraArgFunction1/returnRest.as b/mozilla/js/tamarin/test/as3/Definitions/Function/MultipleExtraArgFunction1/returnRest.as new file mode 100644 index 00000000000..ec5fb7f4eab --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/MultipleExtraArgFunction1/returnRest.as @@ -0,0 +1,36 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package MultipleExtraArgFunction1 { + + public function returnRest(... rest):Number { return rest.length; } + +} + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/MultipleExtraArgFunction2.as b/mozilla/js/tamarin/test/as3/Definitions/Function/MultipleExtraArgFunction2.as new file mode 100644 index 00000000000..82db223a6ec --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/MultipleExtraArgFunction2.as @@ -0,0 +1,65 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import MultipleExtraArgFunction2.* + +function returnRestNoPackage(str:String,n:Number,obj:Object,... rest):Number { + var count = rest.length; + var a:int = 0; + return count; +} + + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Optional Argument test"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + +var TESTOBJ = new TestObj(); +var TESTOBJ1 = new MultipleExtraArgFunction2(); + +// inside class inside package +AddTestCase( "TESTOBJ.returnRest()", 6, TESTOBJ.returnRest([20,30],40,10,false,"hello",new Object(), [123],[345]) ); + +// inside package outside of class +AddTestCase( "returnRest()", 7, returnRest("Str",[1,2,3],[10,11,12],false,"hello",new Object(), [123],[345],"hello") ); + +// outside package inside class +AddTestCase( "TESTOBJ1.returnRest()", 6, TESTOBJ1.returnRest(new Object(),[1,2,3],10,new Object(),"hello",new Object(), [123],[345]) ); + +// outside package and outside class +AddTestCase( "returnRestNoPackage()", 6, returnRestNoPackage("Str",1000,new Object(),10,"str2","hello",new Object(), [123],[345]) ); + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/MultipleExtraArgFunction2/MultipleExtraArgFunction2Class.as b/mozilla/js/tamarin/test/as3/Definitions/Function/MultipleExtraArgFunction2/MultipleExtraArgFunction2Class.as new file mode 100644 index 00000000000..cd6425744f5 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/MultipleExtraArgFunction2/MultipleExtraArgFunction2Class.as @@ -0,0 +1,49 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +class MultipleExtraArgFunction2{ + + function returnRest(obj:Object,arr:Array,... rest):Number { + + var count = rest.length; + var a:int = 0; + + //print("Output from 3rd test case"); + + for( a = 0; a 0 ){ + for( var i:int = 0; i < cust.length; i++ ){ + AddTestCase( "myRest2( a:Array, ... cust)", resArray[i], cust[i] ); + } + return true; + } else { + return false; + } +} + +if( !myRest2( new Array(),foo, new Array().toString(),-1,2,"3",true,undefined,null,Number.NaN )){ + AddTestCase("ERROR", 0, 1); +} + + +test(); + + + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/StaticFunctionBody.as b/mozilla/js/tamarin/test/as3/Definitions/Function/StaticFunctionBody.as new file mode 100644 index 00000000000..401ce933474 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/StaticFunctionBody.as @@ -0,0 +1,74 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import StaticFunctionBody.*; + +class TestObjNoPackage{ + static function noReturnNoParams() { return "noReturnNoParams"; } + static function noReturnParams(s:String, b:Boolean) { return s; } + static function noReturnCustomParam(c:Custom) { return new Custom(); } + static function returnNoParams():String { return "returnNoParams"; } + static function returnParams(s:String, b:Boolean):String { return s; } + static function returnCustomNoParams():Custom { return new Custom(); } +} + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Function Body Parameter/Result Type"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + +var TESTOBJ; +var s:String = new String("this is a test"); +var b:Boolean = new Boolean(true); +var c:Custom = new Custom(); + +// inside class inside package +TESTOBJ = new TestObj(); +AddTestCase( "TESTOBJ.noReturnNoParams()", "noReturnNoParams", TESTOBJ.noReturnNoParams() ); +AddTestCase( "TESTOBJ.noReturnParams(s,b)", "this is a test", TESTOBJ.noReturnParams(s,b) ); +AddTestCase( "TESTOBJ.noReturnCustomParams()", "[object Custom]", String(TESTOBJ.noReturnCustomParam(c)) ); +AddTestCase( "TESTOBJ.returnNoParams()", "returnNoParams", TESTOBJ.returnNoParams() ); +AddTestCase( "TESTOBJ.returnParams(s,b)", "this is a test", TESTOBJ.returnParams(s,b) ); +AddTestCase( "TESTOBJ.returnCustomNoParams()", "[object Custom]", String(TESTOBJ.returnCustomNoParams()) ); + +// outside package inside class +AddTestCase( "TESTOBJ.noReturnNoParams()", "noReturnNoParams", TestObjNoPackage.noReturnNoParams() ); +AddTestCase( "TESTOBJ.noReturnParams(s,b)", "this is a test", TestObjNoPackage.noReturnParams(s,b) ); +AddTestCase( "TESTOBJ.noReturnCustomParams()", "[object Custom]", String(TestObjNoPackage.noReturnCustomParam(c)) ); +AddTestCase( "TESTOBJ.returnNoParams()", "returnNoParams", TestObjNoPackage.returnNoParams() ); +AddTestCase( "TESTOBJ.returnParams(s,b)", "this is a test", TestObjNoPackage.returnParams(s,b) ); +AddTestCase( "TESTOBJ.returnCustomNoParams()", "[object Custom]", String(TestObjNoPackage.returnCustomNoParams()) ); + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/StaticFunctionBody/Custom.as b/mozilla/js/tamarin/test/as3/Definitions/Function/StaticFunctionBody/Custom.as new file mode 100644 index 00000000000..3a6c9925cf9 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/StaticFunctionBody/Custom.as @@ -0,0 +1,34 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package StaticFunctionBody { + public class Custom {} +} + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/StaticFunctionBody/TestObj.as b/mozilla/js/tamarin/test/as3/Definitions/Function/StaticFunctionBody/TestObj.as new file mode 100644 index 00000000000..21cdeab0602 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/StaticFunctionBody/TestObj.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package StaticFunctionBody { + + class TestObjInner{ + static function noReturnNoParamsInner() { return "noReturnNoParams"; } + static function noReturnParamsInner(s:String, b:Boolean) { return s; } + static function noReturnCustomParamInner(c:Custom) { return new Custom(); } + static function returnNoParamsInner():String { return "returnNoParams"; } + static function returnParamsInner(s:String, b:Boolean):String { return s; } + static function returnCustomNoParamsInner():Custom { return new Custom(); } + } + + public class TestObj extends TestObjInner { + public function noReturnNoParams() { return noReturnNoParamsInner(); } + public function noReturnParams(s:String, b:Boolean) { return noReturnParamsInner(s,b); } + public function noReturnCustomParam(c:Custom) { return noReturnCustomParamInner(c); } + public function returnNoParams():String { return returnNoParamsInner(); } + public function returnParams(s:String, b:Boolean):String { return returnParamsInner(s,b); } + public function returnCustomNoParams():Custom { return returnCustomNoParamsInner(); } + } + +} + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/StaticFunctionName.as b/mozilla/js/tamarin/test/as3/Definitions/Function/StaticFunctionName.as new file mode 100644 index 00000000000..789e738412d --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/StaticFunctionName.as @@ -0,0 +1,97 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import StaticFunctionName.*; + +class TestNameObjNoPackage { + // constructor + function TestNameObjNoPackage() { res = "EmptyName"; } + + // not the constructor but looks like it + function testNameObjNoPackage() { return "not the constructor" } + + static function a1 () { return "a1"; } + static function a_1 () { return "a_1"; } + static function _a1 () { return "_a1"; } + static function __a1 () { return "__a1"; } + static function _a1_ () { return "_a1_"; } + static function __a1__ () { return "__a1__"; } + static function $a1 () { return "$a1"; } + static function a$1 () { return "a$1"; } + static function a1$ () { return "a1$"; } + static function A1 () { return "A1"; } + static function cases () { return "cases"; } + static function Cases () { return "Cases"; } + static function abcdefghijklmnopqrstuvwxyz0123456789$_ () { return "all"; } +} + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Function Names"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + +var TESTOBJ = new TestNameObj(); + +// inside class inside package +AddTestCase( "inside class inside package function Name a1()", "a1", TESTOBJ.puba1() ); +AddTestCase( "inside class inside package function Name a_1()", "a_1", TESTOBJ.puba_1() ); +AddTestCase( "inside class inside package function Name _a1()", "_a1", TESTOBJ.pub_a1() ); +AddTestCase( "inside class inside package function Name __a1()", "__a1", TESTOBJ.pub__a1() ); +AddTestCase( "inside class inside package function Name _a1_()", "_a1_", TESTOBJ.pub_a1_() ); +AddTestCase( "inside class inside package function Name __a1__()", "__a1__", TESTOBJ.pub__a1__() ); +AddTestCase( "inside class inside package function Name $a1()", "$a1", TESTOBJ.pub$a1() ); +AddTestCase( "inside class inside package function Name a$1()", "a$1", TESTOBJ.puba$1() ); +AddTestCase( "inside class inside package function Name a1$()", "a1$", TESTOBJ.puba1$() ); +AddTestCase( "inside class inside package function Name A1()", "A1", TESTOBJ.pubA1() ); +AddTestCase( "inside class inside package function Name cases()", "cases", TESTOBJ.pubcases() ); +AddTestCase( "inside class inside package function Name Cases()", "Cases", TESTOBJ.pubCases() ); +AddTestCase( "inside class inside package function Name all()", "all", TESTOBJ.puball() ); + +// inside class outside package +AddTestCase( "inside class outside package function Name a1()", "a1", TestNameObjNoPackage.a1() ); +AddTestCase( "inside class outside package function Name a_1()", "a_1", TestNameObjNoPackage.a_1() ); +AddTestCase( "inside class outside package function Name _a1()", "_a1", TestNameObjNoPackage._a1() ); +AddTestCase( "inside class outside package function Name __a1()", "__a1", TestNameObjNoPackage.__a1() ); +AddTestCase( "inside class outside package function Name _a1_()", "_a1_", TestNameObjNoPackage._a1_() ); +AddTestCase( "inside class outside package function Name __a1__()", "__a1__", TestNameObjNoPackage.__a1__() ); +AddTestCase( "inside class outside package function Name $a1()", "$a1", TestNameObjNoPackage.$a1() ); +AddTestCase( "inside class outside package function Name a$1()", "a$1", TestNameObjNoPackage.a$1() ); +AddTestCase( "inside class outside package function Name a1$()", "a1$", TestNameObjNoPackage.a1$() ); +AddTestCase( "inside class outside package function Name A1()", "A1", TestNameObjNoPackage.A1() ); +AddTestCase( "inside class outside package function Name cases()", "cases", TestNameObjNoPackage.cases() ); +AddTestCase( "inside class outside package function Name Cases()", "Cases", TestNameObjNoPackage.Cases() ); +AddTestCase( "inside class outside package function Name all()", "all", TestNameObjNoPackage.abcdefghijklmnopqrstuvwxyz0123456789$_() ); + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/StaticFunctionName/TestNameObj.as b/mozilla/js/tamarin/test/as3/Definitions/Function/StaticFunctionName/TestNameObj.as new file mode 100644 index 00000000000..43f6d39f4b7 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/StaticFunctionName/TestNameObj.as @@ -0,0 +1,74 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package StaticFunctionName { + + class TestNameObjInner { + + // constructor + function TestNameObjInner() { res = "EmptyName"; } + + // not the constructor but looks like it + function testNameObjInner() { return "not the constructor" } + + static function a1 () { return "a1"; } + static function a_1 () { return "a_1"; } + static function _a1 () { return "_a1"; } + static function __a1 () { return "__a1"; } + static function _a1_ () { return "_a1_"; } + static function __a1__ () { return "__a1__"; } + static function $a1 () { return "$a1"; } + static function a$1 () { return "a$1"; } + static function a1$ () { return "a1$"; } + static function A1 () { return "A1"; } + static function cases () { return "cases"; } + static function Cases () { return "Cases"; } + static function abcdefghijklmnopqrstuvwxyz0123456789$_ () { return "all"; } + } + + public class TestNameObj extends TestNameObjInner { + public function pubTestConst() { return testNameObjInner(); } + public function puba1 () { return a1(); } + public function puba_1 () { return a_1(); } + public function pub_a1 () { return _a1(); } + public function pub__a1 () { return __a1(); } + public function pub_a1_ () { return _a1_(); } + public function pub__a1__ () { return __a1__(); } + public function pub$a1 () { return $a1(); } + public function puba$1 () { return a$1(); } + public function puba1$ () { return a1$(); } + public function pubA1 () { return A1(); } + public function pubcases () { return cases(); } + public function pubCases () { return Cases(); } + public function puball () { return abcdefghijklmnopqrstuvwxyz0123456789$_(); } + } + +} + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/StaticPrivateFunctionName.as b/mozilla/js/tamarin/test/as3/Definitions/Function/StaticPrivateFunctionName.as new file mode 100644 index 00000000000..038b0315c9d --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/StaticPrivateFunctionName.as @@ -0,0 +1,60 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import StaticPrivateFunctionName.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Function Names"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + +var TESTOBJ = new TestNameObj(); + +// inside class inside package +AddTestCase( "inside class inside package function Name a1()", "a1", TESTOBJ.puba1() ); +AddTestCase( "inside class inside package function Name a_1()", "a_1", TESTOBJ.puba_1() ); +AddTestCase( "inside class inside package function Name _a1()", "_a1", TESTOBJ.pub_a1() ); +AddTestCase( "inside class inside package function Name __a1()", "__a1", TESTOBJ.pub__a1() ); +AddTestCase( "inside class inside package function Name _a1_()", "_a1_", TESTOBJ.pub_a1_() ); +AddTestCase( "inside class inside package function Name __a1__()", "__a1__", TESTOBJ.pub__a1__() ); +AddTestCase( "inside class inside package function Name $a1()", "$a1", TESTOBJ.pub$a1() ); +AddTestCase( "inside class inside package function Name a$1()", "a$1", TESTOBJ.puba$1() ); +AddTestCase( "inside class inside package function Name a1$()", "a1$", TESTOBJ.puba1$() ); +AddTestCase( "inside class inside package function Name A1()", "A1", TESTOBJ.pubA1() ); +AddTestCase( "inside class inside package function Name cases()", "cases", TESTOBJ.pubcases() ); +AddTestCase( "inside class inside package function Name Cases()", "Cases", TESTOBJ.pubCases() ); +AddTestCase( "inside class inside package function Name all()", "all", TESTOBJ.puball() ); + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/StaticPrivateFunctionName/TestNameObj.as b/mozilla/js/tamarin/test/as3/Definitions/Function/StaticPrivateFunctionName/TestNameObj.as new file mode 100644 index 00000000000..d43382f4b34 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/StaticPrivateFunctionName/TestNameObj.as @@ -0,0 +1,72 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package StaticPrivateFunctionName { + + public class TestNameObj { + + // constructor + function TestNameObj() { res = "EmptyName"; } + + // not the constructor but looks like it + function testNameObjInner() { return "not the constructor" } + + static private function a1 () { return "a1"; } + static private function a_1 () { return "a_1"; } + static private function _a1 () { return "_a1"; } + static private function __a1 () { return "__a1"; } + static private function _a1_ () { return "_a1_"; } + static private function __a1__ () { return "__a1__"; } + static private function $a1 () { return "$a1"; } + static private function a$1 () { return "a$1"; } + static private function a1$ () { return "a1$"; } + static private function A1 () { return "A1"; } + static private function cases () { return "cases"; } + static private function Cases () { return "Cases"; } + static private function abcdefghijklmnopqrstuvwxyz0123456789$_ () { return "all"; } + + public function pubTestConst() { return testNameObjInner(); } + public function puba1 () { return a1(); } + public function puba_1 () { return a_1(); } + public function pub_a1 () { return _a1(); } + public function pub__a1 () { return __a1(); } + public function pub_a1_ () { return _a1_(); } + public function pub__a1__ () { return __a1__(); } + public function pub$a1 () { return $a1(); } + public function puba$1 () { return a$1(); } + public function puba1$ () { return a1$(); } + public function pubA1 () { return A1(); } + public function pubcases () { return cases(); } + public function pubCases () { return Cases(); } + public function puball () { return abcdefghijklmnopqrstuvwxyz0123456789$_(); } + } + +} + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/StaticPublicFunctionName.as b/mozilla/js/tamarin/test/as3/Definitions/Function/StaticPublicFunctionName.as new file mode 100644 index 00000000000..48a4c6f9c61 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/StaticPublicFunctionName.as @@ -0,0 +1,62 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import StaticPublicFunctionName.*; + + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Function Names"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var TESTOBJ = new TestNameObj(); + +// inside class inside package +AddTestCase( "inside class inside package function Name a1()", "a1", TESTOBJ.puba1() ); +AddTestCase( "inside class inside package function Name a_1()", "a_1", TESTOBJ.puba_1() ); +AddTestCase( "inside class inside package function Name _a1()", "_a1", TESTOBJ.pub_a1() ); +AddTestCase( "inside class inside package function Name __a1()", "__a1", TESTOBJ.pub__a1() ); +AddTestCase( "inside class inside package function Name _a1_()", "_a1_", TESTOBJ.pub_a1_() ); +AddTestCase( "inside class inside package function Name __a1__()", "__a1__", TESTOBJ.pub__a1__() ); +AddTestCase( "inside class inside package function Name $a1()", "$a1", TESTOBJ.pub$a1() ); +AddTestCase( "inside class inside package function Name a$1()", "a$1", TESTOBJ.puba$1() ); +AddTestCase( "inside class inside package function Name a1$()", "a1$", TESTOBJ.puba1$() ); +AddTestCase( "inside class inside package function Name A1()", "A1", TESTOBJ.pubA1() ); +AddTestCase( "inside class inside package function Name cases()", "cases", TESTOBJ.pubcases() ); +AddTestCase( "inside class inside package function Name Cases()", "Cases", TESTOBJ.pubCases() ); +AddTestCase( "inside class inside package function Name all()", "all", TESTOBJ.puball() ); + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/StaticPublicFunctionName/TestNameObj.as b/mozilla/js/tamarin/test/as3/Definitions/Function/StaticPublicFunctionName/TestNameObj.as new file mode 100644 index 00000000000..2d4b22a987b --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/StaticPublicFunctionName/TestNameObj.as @@ -0,0 +1,74 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package StaticPublicFunctionName { + + class TestNameObjInner { + + // constructor + function TestNameObjInner() { res = "EmptyName"; } + + // not the constructor but looks like it + function testNameObjInner() { return "not the constructor" } + + static public function a1 () { return "a1"; } + static public function a_1 () { return "a_1"; } + static public function _a1 () { return "_a1"; } + static public function __a1 () { return "__a1"; } + static public function _a1_ () { return "_a1_"; } + static public function __a1__ () { return "__a1__"; } + static public function $a1 () { return "$a1"; } + static public function a$1 () { return "a$1"; } + static public function a1$ () { return "a1$"; } + static public function A1 () { return "A1"; } + static public function cases () { return "cases"; } + static public function Cases () { return "Cases"; } + static public function abcdefghijklmnopqrstuvwxyz0123456789$_ () { return "all"; } + } + + public class TestNameObj extends TestNameObjInner { + public function pubTestConst() { return testNameObjInner(); } + public function puba1 () { return a1(); } + public function puba_1 () { return a_1(); } + public function pub_a1 () { return _a1(); } + public function pub__a1 () { return __a1(); } + public function pub_a1_ () { return _a1_(); } + public function pub__a1__ () { return __a1__(); } + public function pub$a1 () { return $a1(); } + public function puba$1 () { return a$1(); } + public function puba1$ () { return a1$(); } + public function pubA1 () { return A1(); } + public function pubcases () { return cases(); } + public function pubCases () { return Cases(); } + public function puball () { return abcdefghijklmnopqrstuvwxyz0123456789$_(); } + } + +} + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/ThreeOptArgFunction.as b/mozilla/js/tamarin/test/as3/Definitions/Function/ThreeOptArgFunction.as new file mode 100644 index 00000000000..376fd102c89 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/ThreeOptArgFunction.as @@ -0,0 +1,105 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import ThreeOptArgFunction.* + +class ThreeOptArgFunctionClass { + function returnArguments(s:String = "Str3", b:Boolean = true, n:Number = 30) { + str = s; + bool = b; + num = n; + } +} + +function returnArgumentsNoPackage(s:String = "Str4", b:Boolean = false, n:Number = 40) { + + str = s; + bool = b; + num = n; +} + + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Function Body Parameter/Result Type"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + +var TESTOBJ = new TestObj(); +var TESTOBJ1 = new ThreeOptArgFunctionClass(); + +var success = false; +TESTOBJ.returnArguments(); + +if(str == "Str1" && bool == true && num == 10) +{ success = true;} +else +{ success = false;} + +AddTestCase( "TESTOBJ.returnArguments();", true, success ); + + +success = false; +returnArguments(); + +if(str == "Str2" && bool == false && num == 20) +{ success = true;} +else +{ success = false;} + +AddTestCase( "returnArguments();", true, success ); + + +success = false; +TESTOBJ1.returnArguments(); + +if(str == "Str3" && bool == true && num == 30) +{ success = true;} +else +{ success = false;} + +AddTestCase( "TESTOBJ1.returnArguments();", true, success ); + + +success = false; +returnArgumentsNoPackage(); + +if(str == "Str4" && bool == false && num == 40) +{ success = true;} +else +{ success = false;} + +AddTestCase( "returnArgumentsNoPackage();", true, success ); + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/ThreeOptArgFunction/Boolean.as b/mozilla/js/tamarin/test/as3/Definitions/Function/ThreeOptArgFunction/Boolean.as new file mode 100644 index 00000000000..14e6b0210d5 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/ThreeOptArgFunction/Boolean.as @@ -0,0 +1,35 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package ThreeOptArgFunction { + + public var bool:Boolean = new Boolean(false); +} + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/ThreeOptArgFunction/Number.as b/mozilla/js/tamarin/test/as3/Definitions/Function/ThreeOptArgFunction/Number.as new file mode 100644 index 00000000000..988c4bfea31 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/ThreeOptArgFunction/Number.as @@ -0,0 +1,35 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package NumberOptArgFunction { + + public var num:Number = 1000; +} + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/ThreeOptArgFunction/String.as b/mozilla/js/tamarin/test/as3/Definitions/Function/ThreeOptArgFunction/String.as new file mode 100644 index 00000000000..46abba3341a --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/ThreeOptArgFunction/String.as @@ -0,0 +1,36 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package ThreeOptArgFunction { + + public var str:String = new String(""); + +} + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/ThreeOptArgFunction/TestObj.as b/mozilla/js/tamarin/test/as3/Definitions/Function/ThreeOptArgFunction/TestObj.as new file mode 100644 index 00000000000..398eae8ab3d --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/ThreeOptArgFunction/TestObj.as @@ -0,0 +1,50 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package ThreeOptArgFunction { + + class TestObjInner{ + + function returnArgumentsInner(s:String = "Str1", b:Boolean = true, n:Number = 10, ... rest) { + str = s; + bool = b; + num = n; + } + + } + + public class TestObj extends TestObjInner { + + public function returnArguments() { returnArgumentsInner("Str1", true, 10, 12); } + + } + +} + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/ThreeOptArgFunction/returnArguments.as b/mozilla/js/tamarin/test/as3/Definitions/Function/ThreeOptArgFunction/returnArguments.as new file mode 100644 index 00000000000..ee51fd085ab --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/ThreeOptArgFunction/returnArguments.as @@ -0,0 +1,44 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package ThreeOptArgFunction { + + function returnArgumentsInner(s:String = "Str2", b:Boolean = false, n:Number = 20, ... rest) { + + str = s; + bool = b; + num = n; + } + + + public function returnArguments() { returnArgumentsInner("Str2",false,20,true); } + +} + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/VirtualFunctionBody.as b/mozilla/js/tamarin/test/as3/Definitions/Function/VirtualFunctionBody.as new file mode 100644 index 00000000000..27b311e7d4e --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/VirtualFunctionBody.as @@ -0,0 +1,74 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import VirtualFunctionBody.*; + +class VirtualFunctionBodyClass{ + virtual function noReturnNoParams() { return "noReturnNoParams"; } + virtual function noReturnParams(s:String, b:Boolean) { return s; } + virtual function noReturnCustomParam(c:Custom) { return new Custom(); } + virtual function returnNoParams():String { return "returnNoParams"; } + virtual function returnParams(s:String, b:Boolean):String { return s; } + virtual function returnCustomNoParams():Custom { return new Custom(); } +} + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Function Body Parameter/Result Type"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + +var TESTOBJ; +var s:String = new String("this is a test"); +var b:Boolean = new Boolean(true); +var c:Custom = new Custom(); + +// inside class inside package +TESTOBJ = new TestObj(); +AddTestCase( "TESTOBJ.noReturnNoParams()", "noReturnNoParams", TESTOBJ.noReturnNoParams() ); +AddTestCase( "TESTOBJ.noReturnParams(s,b)", "this is a test", TESTOBJ.noReturnParams(s,b) ); +AddTestCase( "TESTOBJ.noReturnCustomParams()", "[object Custom]", String(TESTOBJ.noReturnCustomParam(c)) ); +AddTestCase( "TESTOBJ.returnNoParams()", "returnNoParams", TESTOBJ.returnNoParams() ); +AddTestCase( "TESTOBJ.returnParams(s,b)", "this is a test", TESTOBJ.returnParams(s,b) ); +AddTestCase( "TESTOBJ.returnCustomNoParams()", "[object Custom]", String(TESTOBJ.returnCustomNoParams()) ); + +// outside package inside class +TESTOBJ = new VirtualFunctionBodyClass(); +AddTestCase( "TESTOBJ.noReturnNoParams()", "noReturnNoParams", TESTOBJ.noReturnNoParams() ); +AddTestCase( "TESTOBJ.noReturnParams(s,b)", "this is a test", TESTOBJ.noReturnParams(s,b) ); +AddTestCase( "TESTOBJ.noReturnCustomParams()", "[object Custom]", String(TESTOBJ.noReturnCustomParam(c)) ); +AddTestCase( "TESTOBJ.returnNoParams()", "returnNoParams", TESTOBJ.returnNoParams() ); +AddTestCase( "TESTOBJ.returnParams(s,b)", "this is a test", TESTOBJ.returnParams(s,b) ); +AddTestCase( "TESTOBJ.returnCustomNoParams()", "[object Custom]", String(TESTOBJ.returnCustomNoParams()) ); + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/VirtualFunctionBody/Custom.as b/mozilla/js/tamarin/test/as3/Definitions/Function/VirtualFunctionBody/Custom.as new file mode 100644 index 00000000000..6774879d89e --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/VirtualFunctionBody/Custom.as @@ -0,0 +1,34 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package VirtualFunctionBody { + public class Custom {} +} + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/VirtualFunctionBody/TestObj.as b/mozilla/js/tamarin/test/as3/Definitions/Function/VirtualFunctionBody/TestObj.as new file mode 100644 index 00000000000..d1ec3bb5067 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/VirtualFunctionBody/TestObj.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package VirtualFunctionBody { + + class TestObjInner{ + virtual function noReturnNoParamsInner() { return "noReturnNoParams"; } + virtual function noReturnParamsInner(s:String, b:Boolean) { return s; } + virtual function noReturnCustomParamInner(c:Custom) { return new Custom(); } + virtual function returnNoParamsInner():String { return "returnNoParams"; } + virtual function returnParamsInner(s:String, b:Boolean):String { return s; } + virtual function returnCustomNoParamsInner():Custom { return new Custom(); } + } + + public class TestObj extends TestObjInner { + public function noReturnNoParams() { return noReturnNoParamsInner(); } + public function noReturnParams(s:String, b:Boolean) { return noReturnParamsInner(s,b); } + public function noReturnCustomParam(c:Custom) { return noReturnCustomParamInner(c); } + public function returnNoParams():String { return returnNoParamsInner(); } + public function returnParams(s:String, b:Boolean):String { return returnParamsInner(s,b); } + public function returnCustomNoParams():Custom { return returnCustomNoParamsInner(); } + } + +} + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/VirtualFunctionName.as b/mozilla/js/tamarin/test/as3/Definitions/Function/VirtualFunctionName.as new file mode 100644 index 00000000000..11392fc63da --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/VirtualFunctionName.as @@ -0,0 +1,101 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import VirtualFunctionName.*; + +class VirtualFunctionNameClass { + // constructor + function TestNameObjNoPackage() { res = "EmptyName"; } + + // not the constructor but looks like it + function testNameObjNoPackage() { return "not the constructor" } + + virtual function a1 () { return "a1"; } + virtual function a_1 () { return "a_1"; } + virtual function _a1 () { return "_a1"; } + virtual function __a1 () { return "__a1"; } + virtual function _a1_ () { return "_a1_"; } + virtual function __a1__ () { return "__a1__"; } + virtual function $a1 () { return "$a1"; } + virtual function a$1 () { return "a$1"; } + virtual function a1$ () { return "a1$"; } + virtual function A1 () { return "A1"; } + virtual function cases () { return "cases"; } + virtual function Cases () { return "Cases"; } + virtual function abcdefghijklmnopqrstuvwxyz0123456789$_ () { return "all"; } +} + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Function Names"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + +var TESTOBJ; + +// inside class inside package +TESTOBJ = new TestNameObj(); +AddTestCase( "inside class inside package function Name a1()", "a1", TESTOBJ.puba1() ); +AddTestCase( "inside class inside package function Name a_1()", "a_1", TESTOBJ.puba_1() ); +AddTestCase( "inside class inside package function Name _a1()", "_a1", TESTOBJ.pub_a1() ); +AddTestCase( "inside class inside package function Name __a1()", "__a1", TESTOBJ.pub__a1() ); +AddTestCase( "inside class inside package function Name _a1_()", "_a1_", TESTOBJ.pub_a1_() ); +AddTestCase( "inside class inside package function Name __a1__()", "__a1__", TESTOBJ.pub__a1__() ); +AddTestCase( "inside class inside package function Name $a1()", "$a1", TESTOBJ.pub$a1() ); +AddTestCase( "inside class inside package function Name a$1()", "a$1", TESTOBJ.puba$1() ); +AddTestCase( "inside class inside package function Name a1$()", "a1$", TESTOBJ.puba1$() ); +AddTestCase( "inside class inside package function Name A1()", "A1", TESTOBJ.pubA1() ); +AddTestCase( "inside class inside package function Name cases()", "cases", TESTOBJ.pubcases() ); +AddTestCase( "inside class inside package function Name Cases()", "Cases", TESTOBJ.pubCases() ); +AddTestCase( "inside class inside package function Name all()", "all", TESTOBJ.puball() ); +AddTestCase( "inside class inside package function Name constructor different case", "not the constructor", TESTOBJ.pubTestConst() ); + +// inside class outside package +TESTOBJ = new VirtualFunctionNameClass(); +AddTestCase( "inside class outside package function Name a1()", "a1", TESTOBJ.a1() ); +AddTestCase( "inside class outside package function Name a_1()", "a_1", TESTOBJ.a_1() ); +AddTestCase( "inside class outside package function Name _a1()", "_a1", TESTOBJ._a1() ); +AddTestCase( "inside class outside package function Name __a1()", "__a1", TESTOBJ.__a1() ); +AddTestCase( "inside class outside package function Name _a1_()", "_a1_", TESTOBJ._a1_() ); +AddTestCase( "inside class outside package function Name __a1__()", "__a1__", TESTOBJ.__a1__() ); +AddTestCase( "inside class outside package function Name $a1()", "$a1", TESTOBJ.$a1() ); +AddTestCase( "inside class outside package function Name a$1()", "a$1", TESTOBJ.a$1() ); +AddTestCase( "inside class outside package function Name a1$()", "a1$", TESTOBJ.a1$() ); +AddTestCase( "inside class outside package function Name A1()", "A1", TESTOBJ.A1() ); +AddTestCase( "inside class outside package function Name cases()", "cases", TESTOBJ.cases() ); +AddTestCase( "inside class outside package function Name Cases()", "Cases", TESTOBJ.Cases() ); +AddTestCase( "inside class outside package function Name all()", "all", TESTOBJ.abcdefghijklmnopqrstuvwxyz0123456789$_() ); +AddTestCase( "inside class outside package function Name constructor different case", "not the constructor", TESTOBJ.testNameObjNoPackage() ); + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/VirtualFunctionName/TestNameObj.as b/mozilla/js/tamarin/test/as3/Definitions/Function/VirtualFunctionName/TestNameObj.as new file mode 100644 index 00000000000..07d230df5eb --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/VirtualFunctionName/TestNameObj.as @@ -0,0 +1,74 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package VirtualFunctionName { + + class TestNameObjInner { + + // constructor + function TestNameObjInner() { res = "EmptyName"; } + + // not the constructor but looks like it + function testNameObjInner() { return "not the constructor" } + + virtual function a1 () { return "a1"; } + virtual function a_1 () { return "a_1"; } + virtual function _a1 () { return "_a1"; } + virtual function __a1 () { return "__a1"; } + virtual function _a1_ () { return "_a1_"; } + virtual function __a1__ () { return "__a1__"; } + virtual function $a1 () { return "$a1"; } + virtual function a$1 () { return "a$1"; } + virtual function a1$ () { return "a1$"; } + virtual function A1 () { return "A1"; } + virtual function cases () { return "cases"; } + virtual function Cases () { return "Cases"; } + virtual function abcdefghijklmnopqrstuvwxyz0123456789$_ () { return "all"; } + } + + public class TestNameObj extends TestNameObjInner { + public function pubTestConst() { return testNameObjInner(); } + public function puba1 () { return a1(); } + public function puba_1 () { return a_1(); } + public function pub_a1 () { return _a1(); } + public function pub__a1 () { return __a1(); } + public function pub_a1_ () { return _a1_(); } + public function pub__a1__ () { return __a1__(); } + public function pub$a1 () { return $a1(); } + public function puba$1 () { return a$1(); } + public function puba1$ () { return a1$(); } + public function pubA1 () { return A1(); } + public function pubcases () { return cases(); } + public function pubCases () { return Cases(); } + public function puball () { return abcdefghijklmnopqrstuvwxyz0123456789$_(); } + } + +} + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/VoidEvaluation.as b/mozilla/js/tamarin/test/as3/Definitions/Function/VoidEvaluation.as new file mode 100644 index 00000000000..36eddf60c49 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/VoidEvaluation.as @@ -0,0 +1,59 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import voidEvaluation.* + + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Function Return Type"; // Provide ECMA section title or a description +var BUGNUMBER = "108487"; + +startTest(); // leave this alone + +var TESTOBJ = new TestObj(); + +var result = "exception"; +try { + TESTOBJ.g(); + result = "no exception"; +} catch (e1) { + result = e1.toString(); +} + +AddTestCase("Assign function that returns void", "no exception", result); + +AddTestCase("Test for g being called", "hello from g", TESTOBJ.varG); + +AddTestCase("Test for f being called", "hello from f", TESTOBJ.varF); + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/VoidEvaluation/TestObj.as b/mozilla/js/tamarin/test/as3/Definitions/Function/VoidEvaluation/TestObj.as new file mode 100644 index 00000000000..517fa3830f7 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/VoidEvaluation/TestObj.as @@ -0,0 +1,50 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package voidEvaluation { + + public class TestObj + { + public var varF:String = "not set"; + public var varG:String = "not set"; + + public function f():void + { + varF = "hello from f"; + } + + public function g():void + { + varG = "hello from g"; + return f(); + } + } + +} diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/bug152222.as b/mozilla/js/tamarin/test/as3/Definitions/Function/bug152222.as new file mode 100644 index 00000000000..8dbec8354ca --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/bug152222.as @@ -0,0 +1,50 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +var CODE = 1006; // _ is not a function. + +//----------------------------------------------------------- +startTest(); +//----------------------------------------------------------- + +var expected = "Error #" + CODE; +var result = "no error"; +try { + var x:Number = 0; + x.toString()(); +} catch (err) { + result = grabError(err, err.toString()); +} finally { + AddTestCase("Runtime Error", expected, result); +} + +//----------------------------------------------------------- +test(); +//----------------------------------------------------------- diff --git a/mozilla/js/tamarin/test/as3/Definitions/Function/functionReturnTypes.as b/mozilla/js/tamarin/test/as3/Definitions/Function/functionReturnTypes.as new file mode 100644 index 00000000000..4a07b58c3fb --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Function/functionReturnTypes.as @@ -0,0 +1,430 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Function"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "ReturnTypes"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + +//vars, functions and classes to be used by the test +import functionReturnTypes.*; + +var myClassA:TestClassA = new TestClassA(); // class TestClassA {} +var myClassB:TestClassB = new TestClassB(); // class TestClassB extends TestClassA {} +var myClassC:TestClassC = new TestClassC(); // class TestClassC extends TestClassB implements TestInterface {} + // interface TestInterface {} +function emptyFunction() {}; +var emptyObject:Object = new Object(); +var myDate:Date = new Date(1977,8,24); + + +var valueArr:Array = [{},"string","10",null,undefined,true,false,0,1,-1,1.23,-1.23,NaN,Infinity,emptyFunction,emptyObject, + myClassA, myClassB,myClassC,myDate,Number.MAX_VALUE,Number.MIN_VALUE,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY, + uint.MAX_VALUE,uint.MIN_VALUE,int.MAX_VALUE,int.MIN_VALUE,""]; + +// The valueDescArr array has the string representations of the valueArr values. +// This is due to the fact that some values (objects) do not resolve to strings. +var valueDescArr:Array = ["{}",'"string"','"10"',"null","undefined","true","false","0","1","-1","1.23","-1.23","NaN","Infinity","emptyFunction", + "emptyObject","myClassA","myClassB","myClassC","myDate","Number.MAX_VALUE",'Number.MIN_VALUE','Number.NEGATIVE_INFINITY', + 'Number.POSITIVE_INFINITY','uint.MAX_VALUE','uint.MIN_VALUE','int.MAX_VALUE','int.MIN_VALUE','"" (empty string)']; + + +var typeArr:Array =[String,Number,int,uint,Boolean,Object,Function,TestClassA,TestClassB,TestClassC,Date]; +var typeDescArr:Array = ["String","Number","int","uint","Boolean","Object","Function","TestClassA","TestClassB","TestClassC","Date"]; + + + +function returnArg(arg) {return arg;} + +var funcArr:Array = new Array(); + +funcArr[0] = function (arg):String {return arg;} +funcArr[1] = function (arg):Number {return arg;} +funcArr[2] = function (arg):int {return arg;} +funcArr[3] = function (arg):uint {return arg;} +funcArr[4] = function (arg):Boolean {return arg;} +funcArr[5] = function (arg):Object {return arg;} +funcArr[6] = function (arg):Function {return arg;} +funcArr[7] = function (arg):TestClassA {return arg;} +funcArr[8] = function (arg):TestClassB {return arg;} +funcArr[9] = function (arg):TestClassC {return arg;} +funcArr[10] = function (arg):Date {return arg;} + +var result; +var resultArr:Array = new Array(); +populateResults(); + +var resultCounter = 0; +//Error cases that try to return an incorrect return type. +for (var i=0; i defined inside class", 1, 1); + +AddTestCase( "var Identifier = ", "id", (VARDEFEMPTY.setid("id"), VARDEFEMPTY.getid())); +AddTestCase( "var Identifier : TypeExpression = ", true, (VARDEFEMPTY.setidTypeExpr(true), + VARDEFEMPTY.getidTypeExpr())); +AddTestCase( "var Identifier = AssignmentExpression", true, VARDEFEMPTY.getidAssignExpr()); +AddTestCase( "var Identifier : TypeExpression = AssignmentExpression", true, VARDEFEMPTY.getidTypeExprAssignExpr()); +AddTestCase( "var VariableBindingList, Identifier = [1]", true, (VARDEFEMPTY.setid1(true), + VARDEFEMPTY.getid1())); +AddTestCase( "var VariableBindingList, Identifier = [2]", true, (VARDEFEMPTY.setid2(true), + VARDEFEMPTY.getid2())); +AddTestCase( "var VariableBindingList, Identifier = [3]", true, (VARDEFEMPTY.setid3(true), + VARDEFEMPTY.getid3())); +AddTestCase( "var VariableBindingList, Identifier : TypeExpression = [1]", true, (VARDEFEMPTY.setid1TypeExpr(true), + VARDEFEMPTY.getid1TypeExpr())); +AddTestCase( "var VariableBindingList, Identifier : TypeExpression = [2]", true, (VARDEFEMPTY.setid2TypeExpr(true), + VARDEFEMPTY.getid2TypeExpr())); +AddTestCase( "var VariableBindingList, Identifier : TypeExpression = [3]", true, (VARDEFEMPTY.setid3TypeExpr(true), + VARDEFEMPTY.getid3TypeExpr())); +AddTestCase( "var VariableBindingList, Identifier = AssignmentExpression [1]", true, VARDEFEMPTY.getid1AssignExpr()); +AddTestCase( "var VariableBindingList, Identifier = AssignmentExpression [2]", false, VARDEFEMPTY.getid2AssignExpr()); +AddTestCase( "var VariableBindingList, Identifier = AssignmentExpression [3]", true, VARDEFEMPTY.getid3AssignExpr()); +AddTestCase( "var VariableBindingList, Identifier = AssignmentExpression [4]", undefined, VARDEFEMPTY.getid1AssignExprB()); +AddTestCase( "var VariableBindingList, Identifier = AssignmentExpression [5]", undefined, VARDEFEMPTY.getid2AssignExprB()); +AddTestCase( "var VariableBindingList, Identifier = AssignmentExpression [6]", true, VARDEFEMPTY.getid3AssignExprB()); +AddTestCase( "var VariableBindingList, Identifier : TypeExpression = AssignmentExpression [1]", true, VARDEFEMPTY.getid1TypeExprAssignExpr()); +AddTestCase( "var VariableBindingList, Identifier : TypeExpression = AssignmentExpression [2]", false, VARDEFEMPTY.getid2TypeExprAssignExpr()); +AddTestCase( "var VariableBindingList, Identifier : TypeExpression = AssignmentExpression [3]", true, VARDEFEMPTY.getid3TypeExprAssignExpr()); +AddTestCase( "var VariableBindingList, Identifier : TypeExpression = AssignmentExpression [4]", false, VARDEFEMPTY.getid1TypeExprAssignExprB()); +AddTestCase( "var VariableBindingList, Identifier : TypeExpression = AssignmentExpression [5]", false, VARDEFEMPTY.getid2TypeExprAssignExprB()); +AddTestCase( "var VariableBindingList, Identifier : TypeExpression = AssignmentExpression [6]", true, VARDEFEMPTY.getid3TypeExprAssignExprB()); +AddTestCase( "var Identifier, Identifier : TypeExpression = [1]", true, (VARDEFEMPTY.setidA(true), + VARDEFEMPTY.getidA())); +AddTestCase( "var Identifier, Identifier : TypeExpression = [2]", true, (VARDEFEMPTY.setidB(true), + VARDEFEMPTY.getidB())); +AddTestCase( "var Identifier, Identifier : TypeExpression = AssignmentExpression [1]", false, VARDEFEMPTY.getidAAssign() ) +AddTestCase( "var Identifier, Identifier : TypeExpression = AssignmentExpression [2]", true, VARDEFEMPTY.getidBAssign() ) +AddTestCase( "var Identifier, Identifier : TypeExpression = AssignmentExpression [3]", undefined, VARDEFEMPTY.getidAAssignB() ) +AddTestCase( "var Identifier, Identifier : TypeExpression = AssignmentExpression [4]", true, VARDEFEMPTY.getidBAssignB() ) +var arr = new Array(1,2,3); +AddTestCase( "var Identifier : TypeExpressionA, Identifier : TypeExpressionB = [1]", arr, (VARDEFEMPTY.setidTypeExprA(arr), + VARDEFEMPTY.getidTypeExprA()) ); +AddTestCase( "var Identifier : TypeExpressionA, Identifier : TypeExpressionB = [2]", false, (VARDEFEMPTY.setidTypeExprB(false), + VARDEFEMPTY.getidTypeExprB()) ); +AddTestCase( "var Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [1]", arr.toString(), VARDEFEMPTY.getidTypeExprAAssign().toString()) +AddTestCase( "var Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [2]", true, VARDEFEMPTY.getidTypeExprBAssign() ) +AddTestCase( "var Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [3]", null, VARDEFEMPTY.getidTypeExprAAssignB()) +AddTestCase( "var Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [4]", true, VARDEFEMPTY.getidTypeExprBAssignB() ) +AddTestCase( "var Identifier, Identifier : TypeExpressionA, Identifier : TypeExpressionB = [1]", true, (VARDEFEMPTY.setidId(true), + VARDEFEMPTY.getidId()) ); +AddTestCase( "var Identifier, Identifier : TypeExpressionA, Identifier : TypeExpressionB = [2]", arr, (VARDEFEMPTY.setidIdTypeExprA(arr), + VARDEFEMPTY.getidIdTypeExprA()) ); +AddTestCase( "var Identifier, Identifier : TypeExpressionA, Identifier : TypeExpressionB = [3]", false, (VARDEFEMPTY.setidIdTypeExprB(false), + VARDEFEMPTY.getidIdTypeExprB()) ); +AddTestCase( "var Identififer, Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [1]", false, VARDEFEMPTY.getidIdAssign()); + +AddTestCase( "var Identififer, Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [2]", arr.toString(), VARDEFEMPTY.getidIdTypeExprAAssign()+""); +AddTestCase( "var Identififer, Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [3]", true, VARDEFEMPTY.getidIdTypeExprBAssign()); +AddTestCase( "var Identififer, Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [4]", undefined, VARDEFEMPTY.getidIdAssignB()); +AddTestCase( "var Identififer, Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [5]", null, VARDEFEMPTY.getidIdTypeExprAAssignB()); +AddTestCase( "var Identififer, Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [6]", true, VARDEFEMPTY.getidIdTypeExprBAssignB()); + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Variable/VarDefEmpty/VarDefEmpty.as b/mozilla/js/tamarin/test/as3/Definitions/Variable/VarDefEmpty/VarDefEmpty.as new file mode 100644 index 00000000000..7f851e1cbf4 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Variable/VarDefEmpty/VarDefEmpty.as @@ -0,0 +1,152 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package VarDefEmpty { + + public class VarDefEmpty { + + // var Identifier = + var id; + + // var Identifier : TypeExpression = + var idTypeExpr : Boolean; + + // var Identifier = AssignmentExpression + var idAssignExpr = true; + + // var Identifier : TypeExpression = AssignmentExpression + var idTypeExprAssignExpr : Boolean = true; + + // var VariableBindingList, Identifier = + var id1, id2, id3; + + // var VariableBindingList, Identifier : TypeExpression = + var id1TypeExpr:Boolean, id2TypeExpr:Boolean, id3TypeExpr:Boolean; + + // var VariableBindingList, Identifier = AssignmentExpression + var id1AssignExpr = true, id2AssignExpr = false, id3AssignExpr = true; + var id1AssignExprB, id2AssignExprB, id3AssignExprB = true; + + // var VariableBindingList, Identifier : TypeExpression = AssignmentExpression + var id1TypeExprAssignExpr:Boolean = true, id2TypeExprAssignExpr:Boolean = false, id3TypeExprAssignExpr:Boolean = true; + var id1TypeExprAssignExprB:Boolean, id2TypeExprAssignExprB:Boolean, id3TypeExprAssignExprB:Boolean = true; + + // var Identifier, Identifier : TypeExpression + var idA, idB:Boolean; + + // var Identifier, Identifier : TypeExpression = AssignmentExpression + var idAAssign = false, idBAssign:Boolean = true; + var idAAssignB, idBAssignB:Boolean = true; + + // var Identifier : TypeExpressionA, Identifier : TypeExpressionB = + var idTypeExprA:Array, idTypeExprB:Boolean; + + // var Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression + var idTypeExprAAssign : Array = new Array(1,2,3), idTypeExprBAssign : Boolean = true; + var idTypeExprAAssignB : Array, idTypeExprBAssignB : Boolean = true; + + // var Identifier, Identifier:TypeExpressionA, Identifier:TypeExpressionB = + var idId, idIdTypeExprA:Array, idIdTypeExprB:Boolean; + + // var Identifier, Identifier:TypeExpressionA, Identifier:TypeExpressionB = AssignmentExpression + var idIdAssign = false,idIdTypeExprAAssign:Array = new Array(1,2,3), idIdTypeExprBAssign:Boolean = true + + var idIdAssignB, idIdTypeExprAAssignB:Array,idIdTypeExprBAssignB:Boolean = true; + + // ***************************************************************************************** + // access methods - only used for runtime testing + // ***************************************************************************************** + + public function getid() { return id; } + public function setid(x) { id = x; } + public function getidTypeExpr():Boolean { return idTypeExpr; } + public function setidTypeExpr(x:Boolean) { idTypeExpr = x; } + public function getidAssignExpr() { return idAssignExpr; } + public function setidAssignExpr(x) { idAssignExpr = x; } + public function getidTypeExprAssignExpr():Boolean { return idTypeExprAssignExpr; } + public function setidTypeExprAssignExpr(x:Boolean) { idTypeExprAssignExpr = x; } + public function getid1() { return id1; } + public function setid1(x) { id1 = x; } + public function getid2() { return id2; } + public function setid2(x) { id2 = x; } + public function getid3() { return id3; } + public function setid3(x) { id3 = x; } + public function getid1TypeExpr():Boolean { return id1TypeExpr; } + public function setid1TypeExpr(x:Boolean) { id1TypeExpr = x; } + public function getid2TypeExpr():Boolean { return id2TypeExpr; } + public function setid2TypeExpr(x:Boolean) { id2TypeExpr = x; } + public function getid3TypeExpr():Boolean { return id3TypeExpr; } + public function setid3TypeExpr(x:Boolean) { id3TypeExpr = x; } + public function getid1AssignExpr() { return id1AssignExpr; } + public function getid2AssignExpr() { return id2AssignExpr; } + public function getid3AssignExpr() { return id3AssignExpr; } + public function getid1AssignExprB() { return id1AssignExprB; } + public function getid2AssignExprB() { return id2AssignExprB; } + public function getid3AssignExprB() { return id3AssignExprB; } + public function getid1TypeExprAssignExpr():Boolean { return id1TypeExprAssignExpr; } + public function getid2TypeExprAssignExpr():Boolean { return id2TypeExprAssignExpr; } + public function getid3TypeExprAssignExpr():Boolean { return id3TypeExprAssignExpr; } + public function getid1TypeExprAssignExprB():Boolean { return id1TypeExprAssignExprB; } + public function getid2TypeExprAssignExprB():Boolean { return id2TypeExprAssignExprB; } + public function getid3TypeExprAssignExprB():Boolean { return id3TypeExprAssignExprB; } + public function getidA() { return idA; } + public function setidA(x) { idA = x; } + public function getidB():Boolean { return idB; } + public function setidB(x:Boolean) { idB = x; } + public function getidAAssign() { return idAAssign; } + public function getidBAssign():Boolean { return idBAssign; } + public function getidAAssignB() { return idAAssignB; } + public function getidBAssignB():Boolean { return idBAssignB; } + public function getidTypeExprA() : Array { return idTypeExprA; } + public function setidTypeExprA(x:Array) { idTypeExprA = x; } + public function getidTypeExprB() : Boolean { return idTypeExprB; } + public function setidTypeExprB(x:Boolean) { idTypeExprB = x; } + public function getidTypeExprAAssign() : Array { return idTypeExprAAssign; } + public function getidTypeExprBAssign() : Boolean { return idTypeExprBAssign; } + public function getidTypeExprAAssignB() : Array { return idTypeExprAAssignB; } + public function getidTypeExprBAssignB() : Boolean { return idTypeExprBAssignB; } + public function getidId() { return idId; } + public function setidId(x) { idId = x; } + public function getidIdTypeExprA() : Array { return idIdTypeExprA; } + public function setidIdTypeExprA(x:Array) { idIdTypeExprA = x; } + public function getidIdTypeExprB() : Boolean{ return idIdTypeExprB; } + public function setidIdTypeExprB(x:Boolean) { idIdTypeExprB = x; } + public function getidIdAssign() { return idIdAssign; } + public function getidIdTypeExprAAssign() : Array { return idIdTypeExprAAssign; } + + public function getidIdTypeExprBAssign() : Boolean{ return idIdTypeExprBAssign; } + public function getidIdAssignB() { return idIdAssignB; } + public function getidIdTypeExprAAssignB() : Array { return idIdTypeExprAAssignB; } + public function getidIdTypeExprBAssignB() : Boolean{ return idIdTypeExprBAssignB; } + + } +} + + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Variable/VarDefOutside.as b/mozilla/js/tamarin/test/as3/Definitions/Variable/VarDefOutside.as new file mode 100644 index 00000000000..031193cda55 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Variable/VarDefOutside.as @@ -0,0 +1,151 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "Clean AS2"; // Version of JavaScript or ECMA +var TITLE = "Variable"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + // var Identifier = + var id; + + // var Identifier : TypeExpression = + var idTypeExpr : Boolean; + + // var Identifier = AssignmentExpression + var idAssignExpr = true; + + // var Identifier : TypeExpression = AssignmentExpression + var idTypeExprAssignExpr : Boolean = true; + + // var VariableBindingList, Identifier = + var id1, id2, id3; + + // var VariableBindingList, Identifier : TypeExpression = + var id1TypeExpr:Boolean, id2TypeExpr:Boolean, id3TypeExpr:Boolean; + + // var VariableBindingList, Identifier = AssignmentExpression + // Bug 117477 + //var id1AssignExpr = true, id2AssignExpr = false, id3AssignExpr = true; + var id1AssignExprB, id2AssignExprB, id3AssignExprB = true; + + // var VariableBindingList, Identifier : TypeExpression = AssignmentExpression + // Bug 117477 + //var id1TypeExprAssignExpr:Boolean = true, id2TypeExprAssignExpr:Boolean = false, id3TypeExprAssignExpr:Boolean = true; + var id1TypeExprAssignExprB:Boolean, id2TypeExprAssignExprB:Boolean, id3TypeExprAssignExprB:Boolean = true; + + // var Identifier, Identifier : TypeExpression + var idA, idB:Boolean; + + // var Identifier, Identifier : TypeExpression = AssignmentExpression + // Bug 117477 + //var idAAssign = false, idBAssign:Boolean = true; + //var idAAssignB, idBAssignB:Boolean = true; + + // var Identifier : TypeExpressionA, Identifier : TypeExpressionB = + var idTypeExprA:Array, idTypeExprB:Boolean; + + // var Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression + // Bug 117477 + //var idTypeExprAAssign : Array = new Array(1,2,3), idTypeExprBAssign : Boolean = true; + //var idTypeExprAAssignB : Array, idTypeExprBAssignB : Boolean = true; + + // var Identifier, Identifier:TypeExpressionA, Identifier:TypeExpressionB = + var idId, idIdTypeExprA:Array, idIdTypeExprB:Boolean; + + // var Identifier, Identifier:TypeExpressionA, Identifier:TypeExpressionB = AssignmentExpression + // Bug 117477 + //var idIdAssign = false, idIdTypeExprAAssign:Array = new Array(1,2,3), idIdTypeExprBAssign:Boolean = true; + //var idIdAssignB, idIdTypeExprAAssignB:Array, idIdTypeExprBAssignB:Boolean = true; + +AddTestCase( "Variable Definition defined inside class", 1, 1); + +AddTestCase( "var Identifier = ", "id", (id = "id", id)); +AddTestCase( "var Identifier : TypeExpression = ", true, (idTypeExpr = true, idTypeExpr )); +AddTestCase( "var Identifier = AssignmentExpression", true, idAssignExpr); +AddTestCase( "var Identifier : TypeExpression = AssignmentExpression", true, idTypeExprAssignExpr); +AddTestCase( "var VariableBindingList, Identifier = [1]", true, (id1 = true, id1)); +AddTestCase( "var VariableBindingList, Identifier = [2]", true, (id2 = true, id2)); +AddTestCase( "var VariableBindingList, Identifier = [3]", true, (id3 = true, id3)); +//AddTestCase( "var VariableBindingList, Identifier : TypeExpression = [1]", true, (id1TypeExpr = true, +// id1TypeExpr)); +AddTestCase( "var VariableBindingList, Identifier : TypeExpression = [2]", true, (id2TypeExpr = true, + id2TypeExpr)); +AddTestCase( "var VariableBindingList, Identifier : TypeExpression = [3]", true, (id3TypeExpr = true, + id3TypeExpr)); +//AddTestCase( "var VariableBindingList, Identifier = AssignmentExpression [1]", true, id1AssignExpr); +//AddTestCase( "var VariableBindingList, Identifier = AssignmentExpression [2]", false, id2AssignExpr); +//AddTestCase( "var VariableBindingList, Identifier = AssignmentExpression [3]", true, id3AssignExpr); +AddTestCase( "var VariableBindingList, Identifier = AssignmentExpression [4]", undefined, id1AssignExprB); +AddTestCase( "var VariableBindingList, Identifier = AssignmentExpression [5]", undefined, id2AssignExprB); +AddTestCase( "var VariableBindingList, Identifier = AssignmentExpression [6]", true, id3AssignExprB); +//AddTestCase( "var VariableBindingList, Identifier : TypeExpression = AssignmentExpression [1]", true, id1TypeExprAssignExpr); +//AddTestCase( "var VariableBindingList, Identifier : TypeExpression = AssignmentExpression [2]", false, id2TypeExprAssignExpr); +//AddTestCase( "var VariableBindingList, Identifier : TypeExpression = AssignmentExpression [3]", true, id3TypeExprAssignExpr); +AddTestCase( "var VariableBindingList, Identifier : TypeExpression = AssignmentExpression [4]", false, id1TypeExprAssignExprB); +AddTestCase( "var VariableBindingList, Identifier : TypeExpression = AssignmentExpression [5]", false, id2TypeExprAssignExprB); +AddTestCase( "var VariableBindingList, Identifier : TypeExpression = AssignmentExpression [6]", true, id3TypeExprAssignExprB); +AddTestCase( "var Identifier, Identifier : TypeExpression = [1]", true, (idA = true, + idA)); +AddTestCase( "var Identifier, Identifier : TypeExpression = [2]", true, (idB = true, + idB)); +//AddTestCase( "var Identifier, Identifier : TypeExpression = AssignmentExpression [1]", false, idAAssign ); +//AddTestCase( "var Identifier, Identifier : TypeExpression = AssignmentExpression [2]", true, idBAssign ); +//AddTestCase( "var Identifier, Identifier : TypeExpression = AssignmentExpression [3]", undefined, idAAssignB ); +//AddTestCase( "var Identifier, Identifier : TypeExpression = AssignmentExpression [4]", true, idBAssignB ); +var arr = new Array(1,2,3); +AddTestCase( "var Identifier : TypeExpressionA, Identifier : TypeExpressionB = [1]", arr, (idTypeExprA = arr, + idTypeExprA )); +AddTestCase( "var Identifier : TypeExpressionA, Identifier : TypeExpressionB = [2]", false, (idTypeExprB = false, + idTypeExprB)); +//AddTestCase( "var Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [1]", arr.toString(), idTypeExprAAssign.toString()) +//AddTestCase( "var Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [2]", true, idTypeExprBAssign ) +//AddTestCase( "var Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [3]", undefined, idTypeExprAAssignB) +//AddTestCase( "var Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [4]", true, idTypeExprBAssignB ) +/*AddTestCase( "var Identifier, Identifier : TypeExpressionA, Identifier : TypeExpressionB = [1]", true, (idId = true, + idId) ); +AddTestCase( "var Identifier, Identifier : TypeExpressionA, Identifier : TypeExpressionB = [2]", arr, (idIdTypeExprA = arr, + idIdTypeExprA) ); +AddTestCase( "var Identifier, Identifier : TypeExpressionA, Identifier : TypeExpressionB = [3]", false, (idIdTypeExprB = false, + idIdTypeExprB) ); +AddTestCase( "var Identififer, Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [1]", false, idIdAssign); +AddTestCase( "var Identififer, Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [2]", arr.toString(), idIdTypeExprAAssign.toString()); +AddTestCase( "var Identififer, Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [3]", true, idIdTypeExprBAssign); +AddTestCase( "var Identififer, Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [4]", undefined, idIdAssignB); +AddTestCase( "var Identififer, Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [5]", undefined, idIdTypeExprAAssignB); +AddTestCase( "var Identififer, Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [6]", true, idIdTypeExprBAssignB); +*/ + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Variable/VarDefOutsideNoVar.as b/mozilla/js/tamarin/test/as3/Definitions/Variable/VarDefOutsideNoVar.as new file mode 100644 index 00000000000..867585409b2 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Variable/VarDefOutsideNoVar.as @@ -0,0 +1,71 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "Clean AS2"; // Version of JavaScript or ECMA +var TITLE = "Variable"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + // Identifier = + //id; // runtime error + + // Identifier = AssignmentExpression + idAssignExpr = true; + + // VariableBindingList, Identifier = + //id1, id2, id3; // runtime errors + + // var VariableBindingList, Identifier = AssignmentExpression + id1AssignExpr = true, id2AssignExpr = false, id3AssignExpr = true; + //id1AssignExprB, id2AssignExprB, id3AssignExprB = true; // runtime errors + + + +AddTestCase( "Variable Definition defined inside class", 1, 1); + +AddTestCase( "var Identifier = ", "id", (id = "id", id)); +AddTestCase( "var Identifier = AssignmentExpression", true, idAssignExpr); +AddTestCase( "var VariableBindingList, Identifier = [1]", true, (id1 = true, id1)); +AddTestCase( "var VariableBindingList, Identifier = [2]", true, (id2 = true, id2)); +AddTestCase( "var VariableBindingList, Identifier = [3]", true, (id3 = true, id3)); +AddTestCase( "var VariableBindingList, Identifier = AssignmentExpression [1]", true, id1AssignExpr); +AddTestCase( "var VariableBindingList, Identifier = AssignmentExpression [2]", false, id2AssignExpr); +AddTestCase( "var VariableBindingList, Identifier = AssignmentExpression [3]", true, id3AssignExpr); +//AddTestCase( "var VariableBindingList, Identifier = AssignmentExpression [4]", undefined, id1AssignExprB); +//AddTestCase( "var VariableBindingList, Identifier = AssignmentExpression [5]", undefined, id2AssignExprB); +//AddTestCase( "var VariableBindingList, Identifier = AssignmentExpression [6]", true, id3AssignExprB); + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Variable/VarDefPrivate.as b/mozilla/js/tamarin/test/as3/Definitions/Variable/VarDefPrivate.as new file mode 100644 index 00000000000..75a6fb28611 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Variable/VarDefPrivate.as @@ -0,0 +1,119 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "Clean AS2"; // Version of JavaScript or ECMA +var TITLE = "Private Variable Definition"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +import VarDefPrivate.*; + + +var VARDEFEMPTY = new VarDefPrivate(); +AddTestCase( "Private Variable Definition defined inside class", 1, 1); + +AddTestCase( "var Identifier = ", "id", (VARDEFEMPTY.setid("id"), VARDEFEMPTY.getid())); +AddTestCase( "var Identifier : TypeExpression = ", true, (VARDEFEMPTY.setidTypeExpr(true), + VARDEFEMPTY.getidTypeExpr())); +AddTestCase( "var Identifier = AssignmentExpression", true, VARDEFEMPTY.getidAssignExpr()); +AddTestCase( "var Identifier : TypeExpression = AssignmentExpression", true, VARDEFEMPTY.getidTypeExprAssignExpr()); +AddTestCase( "var VariableBindingList, Identifier = [1]", true, (VARDEFEMPTY.setid1(true), + VARDEFEMPTY.getid1())); +AddTestCase( "var VariableBindingList, Identifier = [2]", true, (VARDEFEMPTY.setid2(true), + VARDEFEMPTY.getid2())); +AddTestCase( "var VariableBindingList, Identifier = [3]", true, (VARDEFEMPTY.setid3(true), + VARDEFEMPTY.getid3())); +AddTestCase( "var VariableBindingList, Identifier : TypeExpression = [1]", true, (VARDEFEMPTY.setid1TypeExpr(true), + VARDEFEMPTY.getid1TypeExpr())); +AddTestCase( "var VariableBindingList, Identifier : TypeExpression = [2]", true, (VARDEFEMPTY.setid2TypeExpr(true), + VARDEFEMPTY.getid2TypeExpr())); +AddTestCase( "var VariableBindingList, Identifier : TypeExpression = [3]", true, (VARDEFEMPTY.setid3TypeExpr(true), + VARDEFEMPTY.getid3TypeExpr())); +AddTestCase( "var VariableBindingList, Identifier = AssignmentExpression [1]", true, VARDEFEMPTY.getid1AssignExpr()); +AddTestCase( "var VariableBindingList, Identifier = AssignmentExpression [2]", false, VARDEFEMPTY.getid2AssignExpr()); +AddTestCase( "var VariableBindingList, Identifier = AssignmentExpression [3]", true, VARDEFEMPTY.getid3AssignExpr()); +AddTestCase( "var VariableBindingList, Identifier = AssignmentExpression [4]", undefined, VARDEFEMPTY.getid1AssignExprB()); +AddTestCase( "var VariableBindingList, Identifier = AssignmentExpression [5]", undefined, VARDEFEMPTY.getid2AssignExprB()); +AddTestCase( "var VariableBindingList, Identifier = AssignmentExpression [6]", true, VARDEFEMPTY.getid3AssignExprB()); +AddTestCase( "var VariableBindingList, Identifier : TypeExpression = AssignmentExpression [1]", true, VARDEFEMPTY.getid1TypeExprAssignExpr()); +AddTestCase( "var VariableBindingList, Identifier : TypeExpression = AssignmentExpression [2]", false, VARDEFEMPTY.getid2TypeExprAssignExpr()); +AddTestCase( "var VariableBindingList, Identifier : TypeExpression = AssignmentExpression [3]", true, VARDEFEMPTY.getid3TypeExprAssignExpr()); +AddTestCase( "var VariableBindingList, Identifier : TypeExpression = AssignmentExpression [4]", false, VARDEFEMPTY.getid1TypeExprAssignExprB()); +AddTestCase( "var VariableBindingList, Identifier : TypeExpression = AssignmentExpression [5]", false, VARDEFEMPTY.getid2TypeExprAssignExprB()); +AddTestCase( "var VariableBindingList, Identifier : TypeExpression = AssignmentExpression [6]", true, VARDEFEMPTY.getid3TypeExprAssignExprB()); +AddTestCase( "var Identifier, Identifier : TypeExpression = [1]", true, (VARDEFEMPTY.setidA(true), + VARDEFEMPTY.getidA())); +AddTestCase( "var Identifier, Identifier : TypeExpression = [2]", true, (VARDEFEMPTY.setidB(true), + VARDEFEMPTY.getidB())); +AddTestCase( "var Identifier, Identifier : TypeExpression = AssignmentExpression [1]", false, VARDEFEMPTY.getidAAssign() ) +AddTestCase( "var Identifier, Identifier : TypeExpression = AssignmentExpression [2]", true, VARDEFEMPTY.getidBAssign() ) +AddTestCase( "var Identifier, Identifier : TypeExpression = AssignmentExpression [3]", undefined, VARDEFEMPTY.getidAAssignB() ) +AddTestCase( "var Identifier, Identifier : TypeExpression = AssignmentExpression [4]", true, VARDEFEMPTY.getidBAssignB() ) +var arr = new Array(1,2,3); +AddTestCase( "var Identifier : TypeExpressionA, Identifier : TypeExpressionB = [1]", arr, (VARDEFEMPTY.setidTypeExprA(arr), + VARDEFEMPTY.getidTypeExprA()) ); +AddTestCase( "var Identifier : TypeExpressionA, Identifier : TypeExpressionB = [2]", false, (VARDEFEMPTY.setidTypeExprB(false), + VARDEFEMPTY.getidTypeExprB()) ); +AddTestCase( "var Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [1]", arr.toString(), VARDEFEMPTY.getidTypeExprAAssign().toString()) +AddTestCase( "var Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [2]", true, VARDEFEMPTY.getidTypeExprBAssign() ) +AddTestCase( "var Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [3]", null, VARDEFEMPTY.getidTypeExprAAssignB()) +AddTestCase( "var Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [4]", true, VARDEFEMPTY.getidTypeExprBAssignB() ) +AddTestCase( "var Identifier, Identifier : TypeExpressionA, Identifier : TypeExpressionB = [1]", true, (VARDEFEMPTY.setidId(true), + VARDEFEMPTY.getidId()) ); +AddTestCase( "var Identifier, Identifier : TypeExpressionA, Identifier : TypeExpressionB = [2]", arr, (VARDEFEMPTY.setidIdTypeExprA(arr), + VARDEFEMPTY.getidIdTypeExprA()) ); +AddTestCase( "var Identifier, Identifier : TypeExpressionA, Identifier : TypeExpressionB = [3]", false, (VARDEFEMPTY.setidIdTypeExprB(false), + VARDEFEMPTY.getidIdTypeExprB()) ); +AddTestCase( "var Identififer, Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [1]", false, VARDEFEMPTY.getidIdAssign()); +/*thisError="no error"; +try{ + VARDEFEMPTY.getidIdTypeExprAAssign().toString(); +}catch(e:TypeError){ + thisError=e.toString(); +}finally{ + AddTestCase( "var Identififer, Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [2]","TypeError: Error #1055" , typeError(thisError)); +}*/ +AddTestCase( "var Identififer, Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [2]", arr.toString(), VARDEFEMPTY.getidIdTypeExprAAssign().toString()); +AddTestCase( "var Identififer, Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [3]", true, VARDEFEMPTY.getidIdTypeExprBAssign()); +AddTestCase( "var Identififer, Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [4]", undefined, VARDEFEMPTY.getidIdAssignB()); +AddTestCase( "var Identififer, Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [5]", null, VARDEFEMPTY.getidIdTypeExprAAssignB()); +AddTestCase( "var Identififer, Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [6]", true, VARDEFEMPTY.getidIdTypeExprBAssignB()); + + + + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Variable/VarDefPrivate/VarDefPrivate.as b/mozilla/js/tamarin/test/as3/Definitions/Variable/VarDefPrivate/VarDefPrivate.as new file mode 100644 index 00000000000..194bcca9bbb --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Variable/VarDefPrivate/VarDefPrivate.as @@ -0,0 +1,148 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package VarDefPrivate { + public class VarDefPrivate { + + // var Identifier = + private var id; + + // var Identifier : TypeExpression = + private var idTypeExpr : Boolean; + + // var Identifier = AssignmentExpression + private var idAssignExpr = true; + + // var Identifier : TypeExpression = AssignmentExpression + private var idTypeExprAssignExpr : Boolean = true; + + // var VariableBindingList, Identifier = + private var id1, id2, id3; + + // var VariableBindingList, Identifier : TypeExpression = + private var id1TypeExpr:Boolean, id2TypeExpr:Boolean, id3TypeExpr:Boolean; + + // var VariableBindingList, Identifier = AssignmentExpression + private var id1AssignExpr = true, id2AssignExpr = false, id3AssignExpr = true; + private var id1AssignExprB, id2AssignExprB, id3AssignExprB = true; + + // var VariableBindingList, Identifier : TypeExpression = AssignmentExpression + private var id1TypeExprAssignExpr:Boolean = true, id2TypeExprAssignExpr:Boolean = false, id3TypeExprAssignExpr:Boolean = true; + private var id1TypeExprAssignExprB:Boolean, id2TypeExprAssignExprB:Boolean, id3TypeExprAssignExprB:Boolean = true; + + // var Identifier, Identifier : TypeExpression + private var idA, idB:Boolean; + + // var Identifier, Identifier : TypeExpression = AssignmentExpression + private var idAAssign = false, idBAssign:Boolean = true; + private var idAAssignB, idBAssignB:Boolean = true; + + // var Identifier : TypeExpressionA, Identifier : TypeExpressionB = + private var idTypeExprA:Array, idTypeExprB:Boolean; + + // var Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression + private var idTypeExprAAssign : Array = new Array(1,2,3), idTypeExprBAssign : Boolean = true; + private var idTypeExprAAssignB : Array, idTypeExprBAssignB : Boolean = true; + + // var Identifier, Identifier:TypeExpressionA, Identifier:TypeExpressionB = + private var idId, idIdTypeExprA:Array, idIdTypeExprB:Boolean; + + // var Identifier, Identifier:TypeExpressionA, Identifier:TypeExpressionB = AssignmentExpression + private var idIdAssign = false, idIdTypeExprAAssign:Array = new Array(1,2,3), idIdTypeExprBAssign:Boolean = true; + private var idIdAssignB, idIdTypeExprAAssignB:Array, idIdTypeExprBAssignB:Boolean = true; + + // ***************************************************************************************** + // access methods - only used for runtime testing + // ***************************************************************************************** + + public function getid() { return id; } + public function setid(x) { id = x; } + public function getidTypeExpr():Boolean { return idTypeExpr; } + public function setidTypeExpr(x:Boolean) { idTypeExpr = x; } + public function getidAssignExpr() { return idAssignExpr; } + public function setidAssignExpr(x) { idAssignExpr = x; } + public function getidTypeExprAssignExpr():Boolean { return idTypeExprAssignExpr; } + public function setidTypeExprAssignExpr(x:Boolean) { idTypeExprAssignExpr = x; } + public function getid1() { return id1; } + public function setid1(x) { id1 = x; } + public function getid2() { return id2; } + public function setid2(x) { id2 = x; } + public function getid3() { return id3; } + public function setid3(x) { id3 = x; } + public function getid1TypeExpr():Boolean { return id1TypeExpr; } + public function setid1TypeExpr(x:Boolean) { id1TypeExpr = x; } + public function getid2TypeExpr():Boolean { return id2TypeExpr; } + public function setid2TypeExpr(x:Boolean) { id2TypeExpr = x; } + public function getid3TypeExpr():Boolean { return id3TypeExpr; } + public function setid3TypeExpr(x:Boolean) { id3TypeExpr = x; } + public function getid1AssignExpr() { return id1AssignExpr; } + public function getid2AssignExpr() { return id2AssignExpr; } + public function getid3AssignExpr() { return id3AssignExpr; } + public function getid1AssignExprB() { return id1AssignExprB; } + public function getid2AssignExprB() { return id2AssignExprB; } + public function getid3AssignExprB() { return id3AssignExprB; } + public function getid1TypeExprAssignExpr():Boolean { return id1TypeExprAssignExpr; } + public function getid2TypeExprAssignExpr():Boolean { return id2TypeExprAssignExpr; } + public function getid3TypeExprAssignExpr():Boolean { return id3TypeExprAssignExpr; } + public function getid1TypeExprAssignExprB():Boolean { return id1TypeExprAssignExprB; } + public function getid2TypeExprAssignExprB():Boolean { return id2TypeExprAssignExprB; } + public function getid3TypeExprAssignExprB():Boolean { return id3TypeExprAssignExprB; } + public function getidA() { return idA; } + public function setidA(x) { idA = x; } + public function getidB():Boolean { return idB; } + public function setidB(x:Boolean) { idB = x; } + public function getidAAssign() { return idAAssign; } + public function getidBAssign():Boolean { return idBAssign; } + public function getidAAssignB() { return idAAssignB; } + public function getidBAssignB():Boolean { return idBAssignB; } + public function getidTypeExprA() : Array { return idTypeExprA; } + public function setidTypeExprA(x:Array) { idTypeExprA = x; } + public function getidTypeExprB() : Boolean { return idTypeExprB; } + public function setidTypeExprB(x:Boolean) { idTypeExprB = x; } + public function getidTypeExprAAssign() : Array { return idTypeExprAAssign; } + public function getidTypeExprBAssign() : Boolean { return idTypeExprBAssign; } + public function getidTypeExprAAssignB() : Array { return idTypeExprAAssignB; } + public function getidTypeExprBAssignB() : Boolean { return idTypeExprBAssignB; } + public function getidId() { return idId; } + public function setidId(x) { idId = x; } + public function getidIdTypeExprA() : Array { return idIdTypeExprA; } + public function setidIdTypeExprA(x:Array) { idIdTypeExprA = x; } + public function getidIdTypeExprB() : Boolean{ return idIdTypeExprB; } + public function setidIdTypeExprB(x:Boolean) { idIdTypeExprB = x; } + public function getidIdAssign() { return idIdAssign; } + public function getidIdTypeExprAAssign() : Array { return idIdTypeExprAAssign; } + public function getidIdTypeExprBAssign() : Boolean{ return idIdTypeExprBAssign; } + public function getidIdAssignB() { return idIdAssignB; } + public function getidIdTypeExprAAssignB() : Array { return idIdTypeExprAAssignB; } + public function getidIdTypeExprBAssignB() : Boolean{ return idIdTypeExprBAssignB; } + + } +} + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Variable/VarDefPrivateStatic.as b/mozilla/js/tamarin/test/as3/Definitions/Variable/VarDefPrivateStatic.as new file mode 100644 index 00000000000..07f787533fc --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Variable/VarDefPrivateStatic.as @@ -0,0 +1,108 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "Clean AS2"; // Version of JavaScript or ECMA +var TITLE = "Private Static Variable Definition"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +import VarDefPrivateStatic.*; + +var VARDEFEMPTY = new VarDefPrivateStaticClass(); +AddTestCase( "Private Static Variable Definition defined inside class", 1, 1); + +AddTestCase( "var Identifier = ", "id", (VARDEFEMPTY.setid("id"), VARDEFEMPTY.getid())); +AddTestCase( "var Identifier : TypeExpression = ", true, (VARDEFEMPTY.setidTypeExpr(true), + VARDEFEMPTY.getidTypeExpr())); +AddTestCase( "var Identifier = AssignmentExpression", true, VARDEFEMPTY.getidAssignExpr()); +AddTestCase( "var Identifier : TypeExpression = AssignmentExpression", true, VARDEFEMPTY.getidTypeExprAssignExpr()); +AddTestCase( "var VariableBindingList, Identifier = [1]", true, (VARDEFEMPTY.setid1(true), + VARDEFEMPTY.getid1())); +AddTestCase( "var VariableBindingList, Identifier = [2]", true, (VARDEFEMPTY.setid2(true), + VARDEFEMPTY.getid2())); +AddTestCase( "var VariableBindingList, Identifier = [3]", true, (VARDEFEMPTY.setid3(true), + VARDEFEMPTY.getid3())); +AddTestCase( "var VariableBindingList, Identifier : TypeExpression = [1]", true, (VARDEFEMPTY.setid1TypeExpr(true), + VARDEFEMPTY.getid1TypeExpr())); +AddTestCase( "var VariableBindingList, Identifier : TypeExpression = [2]", true, (VARDEFEMPTY.setid2TypeExpr(true), + VARDEFEMPTY.getid2TypeExpr())); +AddTestCase( "var VariableBindingList, Identifier : TypeExpression = [3]", true, (VARDEFEMPTY.setid3TypeExpr(true), + VARDEFEMPTY.getid3TypeExpr())); +AddTestCase( "var VariableBindingList, Identifier = AssignmentExpression [1]", true, VARDEFEMPTY.getid1AssignExpr()); +AddTestCase( "var VariableBindingList, Identifier = AssignmentExpression [2]", false, VARDEFEMPTY.getid2AssignExpr()); +AddTestCase( "var VariableBindingList, Identifier = AssignmentExpression [3]", true, VARDEFEMPTY.getid3AssignExpr()); +AddTestCase( "var VariableBindingList, Identifier = AssignmentExpression [4]", undefined, VARDEFEMPTY.getid1AssignExprB()); +AddTestCase( "var VariableBindingList, Identifier = AssignmentExpression [5]", undefined, VARDEFEMPTY.getid2AssignExprB()); +AddTestCase( "var VariableBindingList, Identifier = AssignmentExpression [6]", true, VARDEFEMPTY.getid3AssignExprB()); +AddTestCase( "var VariableBindingList, Identifier : TypeExpression = AssignmentExpression [1]", true, VARDEFEMPTY.getid1TypeExprAssignExpr()); +AddTestCase( "var VariableBindingList, Identifier : TypeExpression = AssignmentExpression [2]", false, VARDEFEMPTY.getid2TypeExprAssignExpr()); +AddTestCase( "var VariableBindingList, Identifier : TypeExpression = AssignmentExpression [3]", true, VARDEFEMPTY.getid3TypeExprAssignExpr()); +AddTestCase( "var VariableBindingList, Identifier : TypeExpression = AssignmentExpression [4]", false, VARDEFEMPTY.getid1TypeExprAssignExprB()); +AddTestCase( "var VariableBindingList, Identifier : TypeExpression = AssignmentExpression [5]", false, VARDEFEMPTY.getid2TypeExprAssignExprB()); +AddTestCase( "var VariableBindingList, Identifier : TypeExpression = AssignmentExpression [6]", true, VARDEFEMPTY.getid3TypeExprAssignExprB()); +AddTestCase( "var Identifier, Identifier : TypeExpression = [1]", true, (VARDEFEMPTY.setidA(true), + VARDEFEMPTY.getidA())); +AddTestCase( "var Identifier, Identifier : TypeExpression = [2]", true, (VARDEFEMPTY.setidB(true), + VARDEFEMPTY.getidB())); +AddTestCase( "var Identifier, Identifier : TypeExpression = AssignmentExpression [1]", false, VARDEFEMPTY.getidAAssign() ) +AddTestCase( "var Identifier, Identifier : TypeExpression = AssignmentExpression [2]", true, VARDEFEMPTY.getidBAssign() ) +AddTestCase( "var Identifier, Identifier : TypeExpression = AssignmentExpression [3]", undefined, VARDEFEMPTY.getidAAssignB() ) +AddTestCase( "var Identifier, Identifier : TypeExpression = AssignmentExpression [4]", true, VARDEFEMPTY.getidBAssignB() ) +var arr = new Array(1,2,3); +AddTestCase( "var Identifier : TypeExpressionA, Identifier : TypeExpressionB = [1]", arr, (VARDEFEMPTY.setidTypeExprA(arr), + VARDEFEMPTY.getidTypeExprA()) ); +AddTestCase( "var Identifier : TypeExpressionA, Identifier : TypeExpressionB = [2]", false, (VARDEFEMPTY.setidTypeExprB(false), + VARDEFEMPTY.getidTypeExprB()) ); +AddTestCase( "var Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [1]", arr.toString(), VARDEFEMPTY.getidTypeExprAAssign().toString()) +AddTestCase( "var Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [2]", true, VARDEFEMPTY.getidTypeExprBAssign() ) +AddTestCase( "var Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [3]", null, VARDEFEMPTY.getidTypeExprAAssignB()) +AddTestCase( "var Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [4]", true, VARDEFEMPTY.getidTypeExprBAssignB() ) +AddTestCase( "var Identifier, Identifier : TypeExpressionA, Identifier : TypeExpressionB = [1]", true, (VARDEFEMPTY.setidId(true), + VARDEFEMPTY.getidId()) ); +AddTestCase( "var Identifier, Identifier : TypeExpressionA, Identifier : TypeExpressionB = [2]", arr, (VARDEFEMPTY.setidIdTypeExprA(arr), + VARDEFEMPTY.getidIdTypeExprA()) ); +AddTestCase( "var Identifier, Identifier : TypeExpressionA, Identifier : TypeExpressionB = [3]", false, (VARDEFEMPTY.setidIdTypeExprB(false), + VARDEFEMPTY.getidIdTypeExprB()) ); +AddTestCase( "var Identififer, Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [1]", false, VARDEFEMPTY.getidIdAssign()); +AddTestCase( "var Identififer, Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [2]", arr.toString(), VARDEFEMPTY.getidIdTypeExprAAssign().toString()); +AddTestCase( "var Identififer, Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [3]", true, VARDEFEMPTY.getidIdTypeExprBAssign()); +AddTestCase( "var Identififer, Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [4]", undefined, VARDEFEMPTY.getidIdAssignB()); +AddTestCase( "var Identififer, Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [5]", null, VARDEFEMPTY.getidIdTypeExprAAssignB()); +AddTestCase( "var Identififer, Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [6]", true, VARDEFEMPTY.getidIdTypeExprBAssignB()); + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Variable/VarDefPrivateStatic/VarDefPrivateStaticClass.as b/mozilla/js/tamarin/test/as3/Definitions/Variable/VarDefPrivateStatic/VarDefPrivateStaticClass.as new file mode 100644 index 00000000000..4730bbe114b --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Variable/VarDefPrivateStatic/VarDefPrivateStaticClass.as @@ -0,0 +1,148 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package VarDefPrivateStatic{ + + public class VarDefPrivateStaticClass { + + // var Identifier = + private static var id; + + // var Identifier : TypeExpression = + private static var idTypeExpr : Boolean; + + // var Identifier = AssignmentExpression + private static var idAssignExpr = true; + + // var Identifier : TypeExpression = AssignmentExpression + private static var idTypeExprAssignExpr : Boolean = true; + + // var VariableBindingList, Identifier = + private static var id1, id2, id3; + + // var VariableBindingList, Identifier : TypeExpression = + private static var id1TypeExpr:Boolean, id2TypeExpr:Boolean, id3TypeExpr:Boolean; + + // var VariableBindingList, Identifier = AssignmentExpression + private static var id1AssignExpr = true, id2AssignExpr = false, id3AssignExpr = true; + private static var id1AssignExprB, id2AssignExprB, id3AssignExprB = true; + + // var VariableBindingList, Identifier : TypeExpression = AssignmentExpression + private static var id1TypeExprAssignExpr:Boolean = true, id2TypeExprAssignExpr:Boolean = false, id3TypeExprAssignExpr:Boolean = true; + private static var id1TypeExprAssignExprB:Boolean, id2TypeExprAssignExprB:Boolean, id3TypeExprAssignExprB:Boolean = true; + + // var Identifier, Identifier : TypeExpression + private static var idA, idB:Boolean; + + // var Identifier, Identifier : TypeExpression = AssignmentExpression + private static var idAAssign = false, idBAssign:Boolean = true; + private static var idAAssignB, idBAssignB:Boolean = true; + + // var Identifier : TypeExpressionA, Identifier : TypeExpressionB = + private static var idTypeExprA:Array, idTypeExprB:Boolean; + + // var Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression + private static var idTypeExprAAssign : Array = new Array(1,2,3), idTypeExprBAssign : Boolean = true; + private static var idTypeExprAAssignB : Array, idTypeExprBAssignB : Boolean = true; + + // var Identifier, Identifier:TypeExpressionA, Identifier:TypeExpressionB = + private static var idId, idIdTypeExprA:Array, idIdTypeExprB:Boolean; + + // var Identifier, Identifier:TypeExpressionA, Identifier:TypeExpressionB = AssignmentExpression + private static var idIdAssign = false, idIdTypeExprAAssign:Array = new Array(1,2,3), idIdTypeExprBAssign:Boolean = true; + private static var idIdAssignB, idIdTypeExprAAssignB:Array, idIdTypeExprBAssignB:Boolean = true; + + // ***************************************************************************************** + // access methods - only used for runtime testing + // ***************************************************************************************** + + public function getid() { return id; } + public function setid(x) { id = x; } + public function getidTypeExpr():Boolean { return idTypeExpr; } + public function setidTypeExpr(x:Boolean) { idTypeExpr = x; } + public function getidAssignExpr() { return idAssignExpr; } + public function setidAssignExpr(x) { idAssignExpr = x; } + public function getidTypeExprAssignExpr():Boolean { return idTypeExprAssignExpr; } + public function setidTypeExprAssignExpr(x:Boolean) { idTypeExprAssignExpr = x; } + public function getid1() { return id1; } + public function setid1(x) { id1 = x; } + public function getid2() { return id2; } + public function setid2(x) { id2 = x; } + public function getid3() { return id3; } + public function setid3(x) { id3 = x; } + public function getid1TypeExpr():Boolean { return id1TypeExpr; } + public function setid1TypeExpr(x:Boolean) { id1TypeExpr = x; } + public function getid2TypeExpr():Boolean { return id2TypeExpr; } + public function setid2TypeExpr(x:Boolean) { id2TypeExpr = x; } + public function getid3TypeExpr():Boolean { return id3TypeExpr; } + public function setid3TypeExpr(x:Boolean) { id3TypeExpr = x; } + public function getid1AssignExpr() { return id1AssignExpr; } + public function getid2AssignExpr() { return id2AssignExpr; } + public function getid3AssignExpr() { return id3AssignExpr; } + public function getid1AssignExprB() { return id1AssignExprB; } + public function getid2AssignExprB() { return id2AssignExprB; } + public function getid3AssignExprB() { return id3AssignExprB; } + public function getid1TypeExprAssignExpr():Boolean { return id1TypeExprAssignExpr; } + public function getid2TypeExprAssignExpr():Boolean { return id2TypeExprAssignExpr; } + public function getid3TypeExprAssignExpr():Boolean { return id3TypeExprAssignExpr; } + public function getid1TypeExprAssignExprB():Boolean { return id1TypeExprAssignExprB; } + public function getid2TypeExprAssignExprB():Boolean { return id2TypeExprAssignExprB; } + public function getid3TypeExprAssignExprB():Boolean { return id3TypeExprAssignExprB; } + public function getidA() { return idA; } + public function setidA(x) { idA = x; } + public function getidB():Boolean { return idB; } + public function setidB(x:Boolean) { idB = x; } + public function getidAAssign() { return idAAssign; } + public function getidBAssign():Boolean { return idBAssign; } + public function getidAAssignB() { return idAAssignB; } + public function getidBAssignB():Boolean { return idBAssignB; } + public function getidTypeExprA() : Array { return idTypeExprA; } + public function setidTypeExprA(x:Array) { idTypeExprA = x; } + public function getidTypeExprB() : Boolean { return idTypeExprB; } + public function setidTypeExprB(x:Boolean) { idTypeExprB = x; } + public function getidTypeExprAAssign() : Array { return idTypeExprAAssign; } + public function getidTypeExprBAssign() : Boolean { return idTypeExprBAssign; } + public function getidTypeExprAAssignB() : Array { return idTypeExprAAssignB; } + public function getidTypeExprBAssignB() : Boolean { return idTypeExprBAssignB; } + public function getidId() { return idId; } + public function setidId(x) { idId = x; } + public function getidIdTypeExprA() : Array { return idIdTypeExprA; } + public function setidIdTypeExprA(x:Array) { idIdTypeExprA = x; } + public function getidIdTypeExprB() : Boolean{ return idIdTypeExprB; } + public function setidIdTypeExprB(x:Boolean) { idIdTypeExprB = x; } + public function getidIdAssign() { return idIdAssign; } + public function getidIdTypeExprAAssign() : Array { return idIdTypeExprAAssign; } + public function getidIdTypeExprBAssign() : Boolean{ return idIdTypeExprBAssign; } + public function getidIdAssignB() { return idIdAssignB; } + public function getidIdTypeExprAAssignB() : Array { return idIdTypeExprAAssignB; } + public function getidIdTypeExprBAssignB() : Boolean{ return idIdTypeExprBAssignB; } + } +} + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Variable/VarDefPublic.as b/mozilla/js/tamarin/test/as3/Definitions/Variable/VarDefPublic.as new file mode 100644 index 00000000000..132518603a1 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Variable/VarDefPublic.as @@ -0,0 +1,119 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "Clean AS2"; // Version of JavaScript or ECMA +var TITLE = "Public Variable Definition"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +import VarDefPublic.*; + +var VARDEFEMPTY = new VarDefPublicClass(); +AddTestCase( "Public Variable Definition defined inside class", 1, 1); + +AddTestCase( "var Identifier = ", "id", (VARDEFEMPTY.setid("id"), VARDEFEMPTY.getid())); +AddTestCase( "var Identifier : TypeExpression = ", true, (VARDEFEMPTY.setidTypeExpr(true), + VARDEFEMPTY.getidTypeExpr())); +AddTestCase( "var Identifier = AssignmentExpression", true, VARDEFEMPTY.getidAssignExpr()); +AddTestCase( "var Identifier : TypeExpression = AssignmentExpression", true, VARDEFEMPTY.getidTypeExprAssignExpr()); +AddTestCase( "var VariableBindingList, Identifier = [1]", true, (VARDEFEMPTY.setid1(true), + VARDEFEMPTY.getid1())); +AddTestCase( "var VariableBindingList, Identifier = [2]", true, (VARDEFEMPTY.setid2(true), + VARDEFEMPTY.getid2())); +AddTestCase( "var VariableBindingList, Identifier = [3]", true, (VARDEFEMPTY.setid3(true), + VARDEFEMPTY.getid3())); +AddTestCase( "var VariableBindingList, Identifier : TypeExpression = [1]", true, (VARDEFEMPTY.setid1TypeExpr(true), + VARDEFEMPTY.getid1TypeExpr())); +AddTestCase( "var VariableBindingList, Identifier : TypeExpression = [2]", true, (VARDEFEMPTY.setid2TypeExpr(true), + VARDEFEMPTY.getid2TypeExpr())); +AddTestCase( "var VariableBindingList, Identifier : TypeExpression = [3]", true, (VARDEFEMPTY.setid3TypeExpr(true), + VARDEFEMPTY.getid3TypeExpr())); +AddTestCase( "var VariableBindingList, Identifier = AssignmentExpression [1]", true, VARDEFEMPTY.getid1AssignExpr()); +AddTestCase( "var VariableBindingList, Identifier = AssignmentExpression [2]", false, VARDEFEMPTY.getid2AssignExpr()); +AddTestCase( "var VariableBindingList, Identifier = AssignmentExpression [3]", true, VARDEFEMPTY.getid3AssignExpr()); +AddTestCase( "var VariableBindingList, Identifier = AssignmentExpression [4]", undefined, VARDEFEMPTY.getid1AssignExprB()); +AddTestCase( "var VariableBindingList, Identifier = AssignmentExpression [5]", undefined, VARDEFEMPTY.getid2AssignExprB()); +AddTestCase( "var VariableBindingList, Identifier = AssignmentExpression [6]", true, VARDEFEMPTY.getid3AssignExprB()); +AddTestCase( "var VariableBindingList, Identifier : TypeExpression = AssignmentExpression [1]", true, VARDEFEMPTY.getid1TypeExprAssignExpr()); +AddTestCase( "var VariableBindingList, Identifier : TypeExpression = AssignmentExpression [2]", false, VARDEFEMPTY.getid2TypeExprAssignExpr()); +AddTestCase( "var VariableBindingList, Identifier : TypeExpression = AssignmentExpression [3]", true, VARDEFEMPTY.getid3TypeExprAssignExpr()); +AddTestCase( "var VariableBindingList, Identifier : TypeExpression = AssignmentExpression [4]", false, VARDEFEMPTY.getid1TypeExprAssignExprB()); +AddTestCase( "var VariableBindingList, Identifier : TypeExpression = AssignmentExpression [5]", false, VARDEFEMPTY.getid2TypeExprAssignExprB()); +AddTestCase( "var VariableBindingList, Identifier : TypeExpression = AssignmentExpression [6]", true, VARDEFEMPTY.getid3TypeExprAssignExprB()); +AddTestCase( "var Identifier, Identifier : TypeExpression = [1]", true, (VARDEFEMPTY.setidA(true), + VARDEFEMPTY.getidA())); +AddTestCase( "var Identifier, Identifier : TypeExpression = [2]", true, (VARDEFEMPTY.setidB(true), + VARDEFEMPTY.getidB())); +AddTestCase( "var Identifier, Identifier : TypeExpression = AssignmentExpression [1]", false, VARDEFEMPTY.getidAAssign() ) +AddTestCase( "var Identifier, Identifier : TypeExpression = AssignmentExpression [2]", true, VARDEFEMPTY.getidBAssign() ) +AddTestCase( "var Identifier, Identifier : TypeExpression = AssignmentExpression [3]", undefined, VARDEFEMPTY.getidAAssignB() ) +AddTestCase( "var Identifier, Identifier : TypeExpression = AssignmentExpression [4]", true, VARDEFEMPTY.getidBAssignB() ) +var arr = new Array(1,2,3); +AddTestCase( "var Identifier : TypeExpressionA, Identifier : TypeExpressionB = [1]", arr, (VARDEFEMPTY.setidTypeExprA(arr), + VARDEFEMPTY.getidTypeExprA()) ); +AddTestCase( "var Identifier : TypeExpressionA, Identifier : TypeExpressionB = [2]", false, (VARDEFEMPTY.setidTypeExprB(false), + VARDEFEMPTY.getidTypeExprB()) ); +AddTestCase( "var Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [1]", arr.toString(), VARDEFEMPTY.getidTypeExprAAssign().toString()) +AddTestCase( "var Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [2]", true, VARDEFEMPTY.getidTypeExprBAssign() ) +AddTestCase( "var Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [3]", null, VARDEFEMPTY.getidTypeExprAAssignB()) +AddTestCase( "var Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [4]", true, VARDEFEMPTY.getidTypeExprBAssignB() ) +AddTestCase( "var Identifier, Identifier : TypeExpressionA, Identifier : TypeExpressionB = [1]", true, (VARDEFEMPTY.setidId(true), + VARDEFEMPTY.getidId()) ); +AddTestCase( "var Identifier, Identifier : TypeExpressionA, Identifier : TypeExpressionB = [2]", arr, (VARDEFEMPTY.setidIdTypeExprA(arr), + VARDEFEMPTY.getidIdTypeExprA()) ); +AddTestCase( "var Identifier, Identifier : TypeExpressionA, Identifier : TypeExpressionB = [3]", false, (VARDEFEMPTY.setidIdTypeExprB(false), + VARDEFEMPTY.getidIdTypeExprB()) ); +AddTestCase( "var Identififer, Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [1]", false, VARDEFEMPTY.getidIdAssign()); +thisError="no error"; +/*try{ + VARDEFEMPTY.getidIdTypeExprAAssign().toString(); +}catch(e:TypeError){ + thisError=e.toString(); +}finally{ + AddTestCase( "var Identififer, Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [2]","TypeError: Error #1055" , typeError(thisError)); +}*/ +AddTestCase( "var Identififer, Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [2]", arr.toString(), VARDEFEMPTY.getidIdTypeExprAAssign().toString()); +AddTestCase( "var Identififer, Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [3]", true, VARDEFEMPTY.getidIdTypeExprBAssign()); +AddTestCase( "var Identififer, Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [4]", undefined, VARDEFEMPTY.getidIdAssignB()); +AddTestCase( "var Identififer, Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [5]", null, VARDEFEMPTY.getidIdTypeExprAAssignB()); +AddTestCase( "var Identififer, Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [6]", true, VARDEFEMPTY.getidIdTypeExprBAssignB()); + + + + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Variable/VarDefPublic/VarDefPublicClass.as b/mozilla/js/tamarin/test/as3/Definitions/Variable/VarDefPublic/VarDefPublicClass.as new file mode 100644 index 00000000000..54958b515f3 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Variable/VarDefPublic/VarDefPublicClass.as @@ -0,0 +1,152 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package VarDefPublic { + + + public class VarDefPublicClass { + + // var Identifier = + public var id; + + // var Identifier : TypeExpression = + public var idTypeExpr : Boolean; + + // var Identifier = AssignmentExpression + public var idAssignExpr = true; + + // var Identifier : TypeExpression = AssignmentExpression + public var idTypeExprAssignExpr : Boolean = true; + + // var VariableBindingList, Identifier = + public var id1, id2, id3; + + // var VariableBindingList, Identifier : TypeExpression = + public var id1TypeExpr:Boolean, id2TypeExpr:Boolean, id3TypeExpr:Boolean; + + // var VariableBindingList, Identifier = AssignmentExpression + public var id1AssignExpr = true, id2AssignExpr = false, id3AssignExpr = true; + public var id1AssignExprB, id2AssignExprB, id3AssignExprB = true; + + // var VariableBindingList, Identifier : TypeExpression = AssignmentExpression + public var id1TypeExprAssignExpr:Boolean = true, id2TypeExprAssignExpr:Boolean = false, id3TypeExprAssignExpr:Boolean = true; + public var id1TypeExprAssignExprB:Boolean, id2TypeExprAssignExprB:Boolean, id3TypeExprAssignExprB:Boolean = true; + + // var Identifier, Identifier : TypeExpression + public var idA, idB:Boolean; + + // var Identifier, Identifier : TypeExpression = AssignmentExpression + public var idAAssign = false, idBAssign:Boolean = true; + public var idAAssignB, idBAssignB:Boolean = true; + + // var Identifier : TypeExpressionA, Identifier : TypeExpressionB = + public var idTypeExprA:Array, idTypeExprB:Boolean; + + // var Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression + public var idTypeExprAAssign : Array = new Array(1,2,3), idTypeExprBAssign : Boolean = true; + public var idTypeExprAAssignB : Array, idTypeExprBAssignB : Boolean = true; + + // var Identifier, Identifier:TypeExpressionA, Identifier:TypeExpressionB = + public var idId, idIdTypeExprA:Array, idIdTypeExprB:Boolean; + + // var Identifier, Identifier:TypeExpressionA, Identifier:TypeExpressionB = AssignmentExpression + public var idIdAssign = false, idIdTypeExprAAssign:Array = new Array(1,2,3), idIdTypeExprBAssign:Boolean = true; + public var idIdAssignB, idIdTypeExprAAssignB:Array, idIdTypeExprBAssignB:Boolean = true; + + // ***************************************************************************************** + // access methods - only used for runtime testing + // ***************************************************************************************** + + public function getid() { return id; } + public function setid(x) { id = x; } + public function getidTypeExpr():Boolean { return idTypeExpr; } + public function setidTypeExpr(x:Boolean) { idTypeExpr = x; } + public function getidAssignExpr() { return idAssignExpr; } + public function setidAssignExpr(x) { idAssignExpr = x; } + public function getidTypeExprAssignExpr():Boolean { return idTypeExprAssignExpr; } + public function setidTypeExprAssignExpr(x:Boolean) { idTypeExprAssignExpr = x; } + public function getid1() { return id1; } + public function setid1(x) { id1 = x; } + public function getid2() { return id2; } + public function setid2(x) { id2 = x; } + public function getid3() { return id3; } + public function setid3(x) { id3 = x; } + public function getid1TypeExpr():Boolean { return id1TypeExpr; } + public function setid1TypeExpr(x:Boolean) { id1TypeExpr = x; } + public function getid2TypeExpr():Boolean { return id2TypeExpr; } + public function setid2TypeExpr(x:Boolean) { id2TypeExpr = x; } + public function getid3TypeExpr():Boolean { return id3TypeExpr; } + public function setid3TypeExpr(x:Boolean) { id3TypeExpr = x; } + public function getid1AssignExpr() { return id1AssignExpr; } + public function getid2AssignExpr() { return id2AssignExpr; } + public function getid3AssignExpr() { return id3AssignExpr; } + public function getid1AssignExprB() { return id1AssignExprB; } + public function getid2AssignExprB() { return id2AssignExprB; } + public function getid3AssignExprB() { return id3AssignExprB; } + public function getid1TypeExprAssignExpr():Boolean { return id1TypeExprAssignExpr; } + public function getid2TypeExprAssignExpr():Boolean { return id2TypeExprAssignExpr; } + public function getid3TypeExprAssignExpr():Boolean { return id3TypeExprAssignExpr; } + public function getid1TypeExprAssignExprB():Boolean { return id1TypeExprAssignExprB; } + public function getid2TypeExprAssignExprB():Boolean { return id2TypeExprAssignExprB; } + public function getid3TypeExprAssignExprB():Boolean { return id3TypeExprAssignExprB; } + public function getidA() { return idA; } + public function setidA(x) { idA = x; } + public function getidB():Boolean { return idB; } + public function setidB(x:Boolean) { idB = x; } + public function getidAAssign() { return idAAssign; } + public function getidBAssign():Boolean { return idBAssign; } + public function getidAAssignB() { return idAAssignB; } + public function getidBAssignB():Boolean { return idBAssignB; } + public function getidTypeExprA() : Array { return idTypeExprA; } + public function setidTypeExprA(x:Array) { idTypeExprA = x; } + public function getidTypeExprB() : Boolean { return idTypeExprB; } + public function setidTypeExprB(x:Boolean) { idTypeExprB = x; } + public function getidTypeExprAAssign() : Array { return idTypeExprAAssign; } + public function getidTypeExprBAssign() : Boolean { return idTypeExprBAssign; } + public function getidTypeExprAAssignB() : Array { return idTypeExprAAssignB; } + public function getidTypeExprBAssignB() : Boolean { return idTypeExprBAssignB; } + public function getidId() { return idId; } + public function setidId(x) { idId = x; } + public function getidIdTypeExprA() : Array { return idIdTypeExprA; } + public function setidIdTypeExprA(x:Array) { idIdTypeExprA = x; } + public function getidIdTypeExprB() : Boolean{ return idIdTypeExprB; } + public function setidIdTypeExprB(x:Boolean) { idIdTypeExprB = x; } + public function getidIdAssign() { return idIdAssign; } + public function getidIdTypeExprAAssign() : Array { return idIdTypeExprAAssign; } + public function getidIdTypeExprBAssign() : Boolean{ return idIdTypeExprBAssign; } + public function getidIdAssignB() { return idIdAssignB; } + public function getidIdTypeExprAAssignB() : Array { return idIdTypeExprAAssignB; } + public function getidIdTypeExprBAssignB() : Boolean{ return idIdTypeExprBAssignB; } + + + } +} + + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Variable/VarDefPublicStatic.as b/mozilla/js/tamarin/test/as3/Definitions/Variable/VarDefPublicStatic.as new file mode 100644 index 00000000000..8fd44221505 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Variable/VarDefPublicStatic.as @@ -0,0 +1,113 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "Clean AS2"; // Version of JavaScript or ECMA +var TITLE = "Public Static Variable Definition"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +import VarDefPublicStatic.*; + + + +var VARDEFEMPTY = new VarDefPublicStaticClass(); +AddTestCase( "Public Static Variable Definition defined inside class", 1, 1); + +AddTestCase( "var Identifier = ", "id", (VARDEFEMPTY.setid("id"), VARDEFEMPTY.getid())); +AddTestCase( "var Identifier : TypeExpression = ", true, (VARDEFEMPTY.setidTypeExpr(true), + VARDEFEMPTY.getidTypeExpr())); +AddTestCase( "var Identifier = AssignmentExpression", true, VARDEFEMPTY.getidAssignExpr()); +AddTestCase( "var Identifier : TypeExpression = AssignmentExpression", true, VARDEFEMPTY.getidTypeExprAssignExpr()); +AddTestCase( "var VariableBindingList, Identifier = [1]", true, (VARDEFEMPTY.setid1(true), + VARDEFEMPTY.getid1())); +AddTestCase( "var VariableBindingList, Identifier = [2]", true, (VARDEFEMPTY.setid2(true), + VARDEFEMPTY.getid2())); +AddTestCase( "var VariableBindingList, Identifier = [3]", true, (VARDEFEMPTY.setid3(true), + VARDEFEMPTY.getid3())); +AddTestCase( "var VariableBindingList, Identifier : TypeExpression = [1]", true, (VARDEFEMPTY.setid1TypeExpr(true), + VARDEFEMPTY.getid1TypeExpr())); +AddTestCase( "var VariableBindingList, Identifier : TypeExpression = [2]", true, (VARDEFEMPTY.setid2TypeExpr(true), + VARDEFEMPTY.getid2TypeExpr())); +AddTestCase( "var VariableBindingList, Identifier : TypeExpression = [3]", true, (VARDEFEMPTY.setid3TypeExpr(true), + VARDEFEMPTY.getid3TypeExpr())); +AddTestCase( "var VariableBindingList, Identifier = AssignmentExpression [1]", true, VARDEFEMPTY.getid1AssignExpr()); +AddTestCase( "var VariableBindingList, Identifier = AssignmentExpression [2]", false, VARDEFEMPTY.getid2AssignExpr()); +AddTestCase( "var VariableBindingList, Identifier = AssignmentExpression [3]", true, VARDEFEMPTY.getid3AssignExpr()); +AddTestCase( "var VariableBindingList, Identifier = AssignmentExpression [4]", undefined, VARDEFEMPTY.getid1AssignExprB()); +AddTestCase( "var VariableBindingList, Identifier = AssignmentExpression [5]", undefined, VARDEFEMPTY.getid2AssignExprB()); +AddTestCase( "var VariableBindingList, Identifier = AssignmentExpression [6]", true, VARDEFEMPTY.getid3AssignExprB()); +AddTestCase( "var VariableBindingList, Identifier : TypeExpression = AssignmentExpression [1]", true, VARDEFEMPTY.getid1TypeExprAssignExpr()); +AddTestCase( "var VariableBindingList, Identifier : TypeExpression = AssignmentExpression [2]", false, VARDEFEMPTY.getid2TypeExprAssignExpr()); +AddTestCase( "var VariableBindingList, Identifier : TypeExpression = AssignmentExpression [3]", true, VARDEFEMPTY.getid3TypeExprAssignExpr()); +AddTestCase( "var VariableBindingList, Identifier : TypeExpression = AssignmentExpression [4]", false, VARDEFEMPTY.getid1TypeExprAssignExprB()); +AddTestCase( "var VariableBindingList, Identifier : TypeExpression = AssignmentExpression [5]", false, VARDEFEMPTY.getid2TypeExprAssignExprB()); +AddTestCase( "var VariableBindingList, Identifier : TypeExpression = AssignmentExpression [6]", true, VARDEFEMPTY.getid3TypeExprAssignExprB()); +AddTestCase( "var Identifier, Identifier : TypeExpression = [1]", true, (VARDEFEMPTY.setidA(true), + VARDEFEMPTY.getidA())); +AddTestCase( "var Identifier, Identifier : TypeExpression = [2]", true, (VARDEFEMPTY.setidB(true), + VARDEFEMPTY.getidB())); +AddTestCase( "var Identifier, Identifier : TypeExpression = AssignmentExpression [1]", false, VARDEFEMPTY.getidAAssign() ) +AddTestCase( "var Identifier, Identifier : TypeExpression = AssignmentExpression [2]", true, VARDEFEMPTY.getidBAssign() ) +AddTestCase( "var Identifier, Identifier : TypeExpression = AssignmentExpression [3]", undefined, VARDEFEMPTY.getidAAssignB() ) +AddTestCase( "var Identifier, Identifier : TypeExpression = AssignmentExpression [4]", true, VARDEFEMPTY.getidBAssignB() ) +var arr = new Array(1,2,3); +AddTestCase( "var Identifier : TypeExpressionA, Identifier : TypeExpressionB = [1]", arr, (VARDEFEMPTY.setidTypeExprA(arr), + VARDEFEMPTY.getidTypeExprA()) ); +AddTestCase( "var Identifier : TypeExpressionA, Identifier : TypeExpressionB = [2]", false, (VARDEFEMPTY.setidTypeExprB(false), + VARDEFEMPTY.getidTypeExprB()) ); +AddTestCase( "var Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [1]", arr.toString(), VARDEFEMPTY.getidTypeExprAAssign().toString()) +AddTestCase( "var Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [2]", true, VARDEFEMPTY.getidTypeExprBAssign() ) +AddTestCase( "var Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [3]", null, VARDEFEMPTY.getidTypeExprAAssignB()) +AddTestCase( "var Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [4]", true, VARDEFEMPTY.getidTypeExprBAssignB() ) +AddTestCase( "var Identifier, Identifier : TypeExpressionA, Identifier : TypeExpressionB = [1]", true, (VARDEFEMPTY.setidId(true), + VARDEFEMPTY.getidId()) ); +AddTestCase( "var Identifier, Identifier : TypeExpressionA, Identifier : TypeExpressionB = [2]", arr, (VARDEFEMPTY.setidIdTypeExprA(arr), + VARDEFEMPTY.getidIdTypeExprA()) ); +AddTestCase( "var Identifier, Identifier : TypeExpressionA, Identifier : TypeExpressionB = [3]", false, (VARDEFEMPTY.setidIdTypeExprB(false), + VARDEFEMPTY.getidIdTypeExprB()) ); +AddTestCase( "var Identififer, Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [1]", false, VARDEFEMPTY.getidIdAssign()); +AddTestCase( "var Identififer, Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [2]", arr.toString(), VARDEFEMPTY.getidIdTypeExprAAssign().toString()); +AddTestCase( "var Identififer, Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [3]", true, VARDEFEMPTY.getidIdTypeExprBAssign()); +AddTestCase( "var Identififer, Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [4]", undefined, VARDEFEMPTY.getidIdAssignB()); +AddTestCase( "var Identififer, Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [5]", null, VARDEFEMPTY.getidIdTypeExprAAssignB()); +AddTestCase( "var Identififer, Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [6]", true, VARDEFEMPTY.getidIdTypeExprBAssignB()); + + + + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Variable/VarDefPublicStatic/VarDefPublicStaticClass.as b/mozilla/js/tamarin/test/as3/Definitions/Variable/VarDefPublicStatic/VarDefPublicStaticClass.as new file mode 100644 index 00000000000..ef89f3f9b0a --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Variable/VarDefPublicStatic/VarDefPublicStaticClass.as @@ -0,0 +1,151 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package VarDefPublicStatic { + + + public class VarDefPublicStaticClass { + + // var Identifier = + public static var id; + + // var Identifier : TypeExpression = + public static var idTypeExpr : Boolean; + + // var Identifier = AssignmentExpression + public static var idAssignExpr = true; + + // var Identifier : TypeExpression = AssignmentExpression + public static var idTypeExprAssignExpr : Boolean = true; + + // var VariableBindingList, Identifier = + public static var id1, id2, id3; + + // var VariableBindingList, Identifier : TypeExpression = + public static var id1TypeExpr:Boolean, id2TypeExpr:Boolean, id3TypeExpr:Boolean; + + // var VariableBindingList, Identifier = AssignmentExpression + public static var id1AssignExpr = true, id2AssignExpr = false, id3AssignExpr = true; + public static var id1AssignExprB, id2AssignExprB, id3AssignExprB = true; + + // var VariableBindingList, Identifier : TypeExpression = AssignmentExpression + public static var id1TypeExprAssignExpr:Boolean = true, id2TypeExprAssignExpr:Boolean = false, id3TypeExprAssignExpr:Boolean = true; + public static var id1TypeExprAssignExprB:Boolean, id2TypeExprAssignExprB:Boolean, id3TypeExprAssignExprB:Boolean = true; + + // var Identifier, Identifier : TypeExpression + public static var idA, idB:Boolean; + + // var Identifier, Identifier : TypeExpression = AssignmentExpression + public static var idAAssign = false, idBAssign:Boolean = true; + public static var idAAssignB, idBAssignB:Boolean = true; + + // var Identifier : TypeExpressionA, Identifier : TypeExpressionB = + public static var idTypeExprA:Array, idTypeExprB:Boolean; + + // var Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression + public static var idTypeExprAAssign : Array = new Array(1,2,3), idTypeExprBAssign : Boolean = true; + public static var idTypeExprAAssignB : Array, idTypeExprBAssignB : Boolean = true; + + // var Identifier, Identifier:TypeExpressionA, Identifier:TypeExpressionB = + public static var idId, idIdTypeExprA:Array, idIdTypeExprB:Boolean; + + // var Identifier, Identifier:TypeExpressionA, Identifier:TypeExpressionB = AssignmentExpression + public static var idIdAssign = false, idIdTypeExprAAssign:Array = new Array(1,2,3), idIdTypeExprBAssign:Boolean = true; + public static var idIdAssignB, idIdTypeExprAAssignB:Array, idIdTypeExprBAssignB:Boolean = true; + + // ***************************************************************************************** + // access methods - only used for runtime testing + // ***************************************************************************************** + + public function getid() { return id; } + public function setid(x) { id = x; } + public function getidTypeExpr():Boolean { return idTypeExpr; } + public function setidTypeExpr(x:Boolean) { idTypeExpr = x; } + public function getidAssignExpr() { return idAssignExpr; } + public function setidAssignExpr(x) { idAssignExpr = x; } + public function getidTypeExprAssignExpr():Boolean { return idTypeExprAssignExpr; } + public function setidTypeExprAssignExpr(x:Boolean) { idTypeExprAssignExpr = x; } + public function getid1() { return id1; } + public function setid1(x) { id1 = x; } + public function getid2() { return id2; } + public function setid2(x) { id2 = x; } + public function getid3() { return id3; } + public function setid3(x) { id3 = x; } + public function getid1TypeExpr():Boolean { return id1TypeExpr; } + public function setid1TypeExpr(x:Boolean) { id1TypeExpr = x; } + public function getid2TypeExpr():Boolean { return id2TypeExpr; } + public function setid2TypeExpr(x:Boolean) { id2TypeExpr = x; } + public function getid3TypeExpr():Boolean { return id3TypeExpr; } + public function setid3TypeExpr(x:Boolean) { id3TypeExpr = x; } + public function getid1AssignExpr() { return id1AssignExpr; } + public function getid2AssignExpr() { return id2AssignExpr; } + public function getid3AssignExpr() { return id3AssignExpr; } + public function getid1AssignExprB() { return id1AssignExprB; } + public function getid2AssignExprB() { return id2AssignExprB; } + public function getid3AssignExprB() { return id3AssignExprB; } + public function getid1TypeExprAssignExpr():Boolean { return id1TypeExprAssignExpr; } + public function getid2TypeExprAssignExpr():Boolean { return id2TypeExprAssignExpr; } + public function getid3TypeExprAssignExpr():Boolean { return id3TypeExprAssignExpr; } + public function getid1TypeExprAssignExprB():Boolean { return id1TypeExprAssignExprB; } + public function getid2TypeExprAssignExprB():Boolean { return id2TypeExprAssignExprB; } + public function getid3TypeExprAssignExprB():Boolean { return id3TypeExprAssignExprB; } + public function getidA() { return idA; } + public function setidA(x) { idA = x; } + public function getidB():Boolean { return idB; } + public function setidB(x:Boolean) { idB = x; } + public function getidAAssign() { return idAAssign; } + public function getidBAssign():Boolean { return idBAssign; } + public function getidAAssignB() { return idAAssignB; } + public function getidBAssignB():Boolean { return idBAssignB; } + public function getidTypeExprA() : Array { return idTypeExprA; } + public function setidTypeExprA(x:Array) { idTypeExprA = x; } + public function getidTypeExprB() : Boolean { return idTypeExprB; } + public function setidTypeExprB(x:Boolean) { idTypeExprB = x; } + public function getidTypeExprAAssign() : Array { return idTypeExprAAssign; } + public function getidTypeExprBAssign() : Boolean { return idTypeExprBAssign; } + public function getidTypeExprAAssignB() : Array { return idTypeExprAAssignB; } + public function getidTypeExprBAssignB() : Boolean { return idTypeExprBAssignB; } + public function getidId() { return idId; } + public function setidId(x) { idId = x; } + public function getidIdTypeExprA() : Array { return idIdTypeExprA; } + public function setidIdTypeExprA(x:Array) { idIdTypeExprA = x; } + public function getidIdTypeExprB() : Boolean{ return idIdTypeExprB; } + public function setidIdTypeExprB(x:Boolean) { idIdTypeExprB = x; } + public function getidIdAssign() { return idIdAssign; } + public function getidIdTypeExprAAssign() : Array { return idIdTypeExprAAssign; } + public function getidIdTypeExprBAssign() : Boolean{ return idIdTypeExprBAssign; } + public function getidIdAssignB() { return idIdAssignB; } + public function getidIdTypeExprAAssignB() : Array { return idIdTypeExprAAssignB; } + public function getidIdTypeExprBAssignB() : Boolean{ return idIdTypeExprBAssignB; } + + + } +} + diff --git a/mozilla/js/tamarin/test/as3/Definitions/Variable/VarDefStatic.as b/mozilla/js/tamarin/test/as3/Definitions/Variable/VarDefStatic.as new file mode 100644 index 00000000000..e329b8c4393 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Variable/VarDefStatic.as @@ -0,0 +1,111 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "Clean AS2"; // Version of JavaScript or ECMA +var TITLE = "Static Variable Definition"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +import VarDefStatic.*; + +var VARDEFEMPTY = new VarDefStaticClass(); +AddTestCase( "Static Variable Definition defined inside class", 1, 1); + +AddTestCase( "var Identifier = ", "id", (VARDEFEMPTY.setid("id"), VARDEFEMPTY.getid())); +AddTestCase( "var Identifier : TypeExpression = ", true, (VARDEFEMPTY.setidTypeExpr(true), + VARDEFEMPTY.getidTypeExpr())); +AddTestCase( "var Identifier = AssignmentExpression", true, VARDEFEMPTY.getidAssignExpr()); +AddTestCase( "var Identifier : TypeExpression = AssignmentExpression", true, VARDEFEMPTY.getidTypeExprAssignExpr()); +AddTestCase( "var VariableBindingList, Identifier = [1]", true, (VARDEFEMPTY.setid1(true), + VARDEFEMPTY.getid1())); +AddTestCase( "var VariableBindingList, Identifier = [2]", true, (VARDEFEMPTY.setid2(true), + VARDEFEMPTY.getid2())); +AddTestCase( "var VariableBindingList, Identifier = [3]", true, (VARDEFEMPTY.setid3(true), + VARDEFEMPTY.getid3())); +AddTestCase( "var VariableBindingList, Identifier : TypeExpression = [1]", true, (VARDEFEMPTY.setid1TypeExpr(true), + VARDEFEMPTY.getid1TypeExpr())); +AddTestCase( "var VariableBindingList, Identifier : TypeExpression = [2]", true, (VARDEFEMPTY.setid2TypeExpr(true), + VARDEFEMPTY.getid2TypeExpr())); +AddTestCase( "var VariableBindingList, Identifier : TypeExpression = [3]", true, (VARDEFEMPTY.setid3TypeExpr(true), + VARDEFEMPTY.getid3TypeExpr())); +AddTestCase( "var VariableBindingList, Identifier = AssignmentExpression [1]", true, VARDEFEMPTY.getid1AssignExpr()); +AddTestCase( "var VariableBindingList, Identifier = AssignmentExpression [2]", false, VARDEFEMPTY.getid2AssignExpr()); +AddTestCase( "var VariableBindingList, Identifier = AssignmentExpression [3]", true, VARDEFEMPTY.getid3AssignExpr()); +AddTestCase( "var VariableBindingList, Identifier = AssignmentExpression [4]", undefined, VARDEFEMPTY.getid1AssignExprB()); +AddTestCase( "var VariableBindingList, Identifier = AssignmentExpression [5]", undefined, VARDEFEMPTY.getid2AssignExprB()); +AddTestCase( "var VariableBindingList, Identifier = AssignmentExpression [6]", true, VARDEFEMPTY.getid3AssignExprB()); +AddTestCase( "var VariableBindingList, Identifier : TypeExpression = AssignmentExpression [1]", true, VARDEFEMPTY.getid1TypeExprAssignExpr()); +AddTestCase( "var VariableBindingList, Identifier : TypeExpression = AssignmentExpression [2]", false, VARDEFEMPTY.getid2TypeExprAssignExpr()); +AddTestCase( "var VariableBindingList, Identifier : TypeExpression = AssignmentExpression [3]", true, VARDEFEMPTY.getid3TypeExprAssignExpr()); +AddTestCase( "var VariableBindingList, Identifier : TypeExpression = AssignmentExpression [4]", false, VARDEFEMPTY.getid1TypeExprAssignExprB()); +AddTestCase( "var VariableBindingList, Identifier : TypeExpression = AssignmentExpression [5]", false, VARDEFEMPTY.getid2TypeExprAssignExprB()); +AddTestCase( "var VariableBindingList, Identifier : TypeExpression = AssignmentExpression [6]", true, VARDEFEMPTY.getid3TypeExprAssignExprB()); +AddTestCase( "var Identifier, Identifier : TypeExpression = [1]", true, (VARDEFEMPTY.setidA(true), + VARDEFEMPTY.getidA())); +AddTestCase( "var Identifier, Identifier : TypeExpression = [2]", true, (VARDEFEMPTY.setidB(true), + VARDEFEMPTY.getidB())); +AddTestCase( "var Identifier, Identifier : TypeExpression = AssignmentExpression [1]", false, VARDEFEMPTY.getidAAssign() ) +AddTestCase( "var Identifier, Identifier : TypeExpression = AssignmentExpression [2]", true, VARDEFEMPTY.getidBAssign() ) +AddTestCase( "var Identifier, Identifier : TypeExpression = AssignmentExpression [3]", undefined, VARDEFEMPTY.getidAAssignB() ) +AddTestCase( "var Identifier, Identifier : TypeExpression = AssignmentExpression [4]", true, VARDEFEMPTY.getidBAssignB() ) +var arr = new Array(1,2,3); +AddTestCase( "var Identifier : TypeExpressionA, Identifier : TypeExpressionB = [1]", arr, (VARDEFEMPTY.setidTypeExprA(arr), + VARDEFEMPTY.getidTypeExprA()) ); +AddTestCase( "var Identifier : TypeExpressionA, Identifier : TypeExpressionB = [2]", false, (VARDEFEMPTY.setidTypeExprB(false), + VARDEFEMPTY.getidTypeExprB()) ); +AddTestCase( "var Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [1]", arr.toString(), VARDEFEMPTY.getidTypeExprAAssign().toString()) +AddTestCase( "var Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [2]", true, VARDEFEMPTY.getidTypeExprBAssign() ) +AddTestCase( "var Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [3]", null, VARDEFEMPTY.getidTypeExprAAssignB()) +AddTestCase( "var Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [4]", true, VARDEFEMPTY.getidTypeExprBAssignB() ) +AddTestCase( "var Identifier, Identifier : TypeExpressionA, Identifier : TypeExpressionB = [1]", true, (VARDEFEMPTY.setidId(true), + VARDEFEMPTY.getidId()) ); +AddTestCase( "var Identifier, Identifier : TypeExpressionA, Identifier : TypeExpressionB = [2]", arr, (VARDEFEMPTY.setidIdTypeExprA(arr), + VARDEFEMPTY.getidIdTypeExprA()) ); +AddTestCase( "var Identifier, Identifier : TypeExpressionA, Identifier : TypeExpressionB = [3]", false, (VARDEFEMPTY.setidIdTypeExprB(false), + VARDEFEMPTY.getidIdTypeExprB()) ); +AddTestCase( "var Identififer, Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [1]", false, VARDEFEMPTY.getidIdAssign()); +AddTestCase( "var Identififer, Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [2]", arr.toString(), VARDEFEMPTY.getidIdTypeExprAAssign().toString()); +AddTestCase( "var Identififer, Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [3]", true, VARDEFEMPTY.getidIdTypeExprBAssign()); +AddTestCase( "var Identififer, Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [4]", undefined, VARDEFEMPTY.getidIdAssignB()); +AddTestCase( "var Identififer, Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [5]", null, VARDEFEMPTY.getidIdTypeExprAAssignB()); +AddTestCase( "var Identififer, Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression [6]", true, VARDEFEMPTY.getidIdTypeExprBAssignB()); + + + + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Definitions/Variable/VarDefStatic/VarDefStaticClass.as b/mozilla/js/tamarin/test/as3/Definitions/Variable/VarDefStatic/VarDefStaticClass.as new file mode 100644 index 00000000000..2ce8493eb69 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/Variable/VarDefStatic/VarDefStaticClass.as @@ -0,0 +1,150 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package VarDefStatic { + + public class VarDefStaticClass { + + // var Identifier = + static var id; + + // var Identifier : TypeExpression = + static var idTypeExpr : Boolean; + + // var Identifier = AssignmentExpression + static var idAssignExpr = true; + + // var Identifier : TypeExpression = AssignmentExpression + static var idTypeExprAssignExpr : Boolean = true; + + // var VariableBindingList, Identifier = + static var id1, id2, id3; + + // var VariableBindingList, Identifier : TypeExpression = + static var id1TypeExpr:Boolean, id2TypeExpr:Boolean, id3TypeExpr:Boolean; + + // var VariableBindingList, Identifier = AssignmentExpression + static var id1AssignExpr = true, id2AssignExpr = false, id3AssignExpr = true; + static var id1AssignExprB, id2AssignExprB, id3AssignExprB = true; + + // var VariableBindingList, Identifier : TypeExpression = AssignmentExpression + static var id1TypeExprAssignExpr:Boolean = true, id2TypeExprAssignExpr:Boolean = false, id3TypeExprAssignExpr:Boolean = true; + static var id1TypeExprAssignExprB:Boolean, id2TypeExprAssignExprB:Boolean, id3TypeExprAssignExprB:Boolean = true; + + // var Identifier, Identifier : TypeExpression + static var idA, idB:Boolean; + + // var Identifier, Identifier : TypeExpression = AssignmentExpression + static var idAAssign = false, idBAssign:Boolean = true; + static var idAAssignB, idBAssignB:Boolean = true; + + // var Identifier : TypeExpressionA, Identifier : TypeExpressionB = + static var idTypeExprA:Array, idTypeExprB:Boolean; + + // var Identifier : TypeExpressionA, Identifier : TypeExpressionB = AssignmentExpression + static var idTypeExprAAssign : Array = new Array(1,2,3), idTypeExprBAssign : Boolean = true; + static var idTypeExprAAssignB : Array, idTypeExprBAssignB : Boolean = true; + + // var Identifier, Identifier:TypeExpressionA, Identifier:TypeExpressionB = + static var idId, idIdTypeExprA:Array, idIdTypeExprB:Boolean; + + // var Identifier, Identifier:TypeExpressionA, Identifier:TypeExpressionB = AssignmentExpression + static var idIdAssign = false, idIdTypeExprAAssign:Array = new Array(1,2,3), idIdTypeExprBAssign:Boolean = true; + static var idIdAssignB, idIdTypeExprAAssignB:Array, idIdTypeExprBAssignB:Boolean = true; + + // ***************************************************************************************** + // access methods - only used for runtime testing + // ***************************************************************************************** + + public function getid() { return id; } + public function setid(x) { id = x; } + public function getidTypeExpr():Boolean { return idTypeExpr; } + public function setidTypeExpr(x:Boolean) { idTypeExpr = x; } + public function getidAssignExpr() { return idAssignExpr; } + public function setidAssignExpr(x) { idAssignExpr = x; } + public function getidTypeExprAssignExpr():Boolean { return idTypeExprAssignExpr; } + public function setidTypeExprAssignExpr(x:Boolean) { idTypeExprAssignExpr = x; } + public function getid1() { return id1; } + public function setid1(x) { id1 = x; } + public function getid2() { return id2; } + public function setid2(x) { id2 = x; } + public function getid3() { return id3; } + public function setid3(x) { id3 = x; } + public function getid1TypeExpr():Boolean { return id1TypeExpr; } + public function setid1TypeExpr(x:Boolean) { id1TypeExpr = x; } + public function getid2TypeExpr():Boolean { return id2TypeExpr; } + public function setid2TypeExpr(x:Boolean) { id2TypeExpr = x; } + public function getid3TypeExpr():Boolean { return id3TypeExpr; } + public function setid3TypeExpr(x:Boolean) { id3TypeExpr = x; } + public function getid1AssignExpr() { return id1AssignExpr; } + public function getid2AssignExpr() { return id2AssignExpr; } + public function getid3AssignExpr() { return id3AssignExpr; } + public function getid1AssignExprB() { return id1AssignExprB; } + public function getid2AssignExprB() { return id2AssignExprB; } + public function getid3AssignExprB() { return id3AssignExprB; } + public function getid1TypeExprAssignExpr():Boolean { return id1TypeExprAssignExpr; } + public function getid2TypeExprAssignExpr():Boolean { return id2TypeExprAssignExpr; } + public function getid3TypeExprAssignExpr():Boolean { return id3TypeExprAssignExpr; } + public function getid1TypeExprAssignExprB():Boolean { return id1TypeExprAssignExprB; } + public function getid2TypeExprAssignExprB():Boolean { return id2TypeExprAssignExprB; } + public function getid3TypeExprAssignExprB():Boolean { return id3TypeExprAssignExprB; } + public function getidA() { return idA; } + public function setidA(x) { idA = x; } + public function getidB():Boolean { return idB; } + public function setidB(x:Boolean) { idB = x; } + public function getidAAssign() { return idAAssign; } + public function getidBAssign():Boolean { return idBAssign; } + public function getidAAssignB() { return idAAssignB; } + public function getidBAssignB():Boolean { return idBAssignB; } + public function getidTypeExprA() : Array { return idTypeExprA; } + public function setidTypeExprA(x:Array) { idTypeExprA = x; } + public function getidTypeExprB() : Boolean { return idTypeExprB; } + public function setidTypeExprB(x:Boolean) { idTypeExprB = x; } + public function getidTypeExprAAssign() : Array { return idTypeExprAAssign; } + public function getidTypeExprBAssign() : Boolean { return idTypeExprBAssign; } + public function getidTypeExprAAssignB() : Array { return idTypeExprAAssignB; } + public function getidTypeExprBAssignB() : Boolean { return idTypeExprBAssignB; } + public function getidId() { return idId; } + public function setidId(x) { idId = x; } + public function getidIdTypeExprA() : Array { return idIdTypeExprA; } + public function setidIdTypeExprA(x:Array) { idIdTypeExprA = x; } + public function getidIdTypeExprB() : Boolean{ return idIdTypeExprB; } + public function setidIdTypeExprB(x:Boolean) { idIdTypeExprB = x; } + public function getidIdAssign() { return idIdAssign; } + public function getidIdTypeExprAAssign() : Array { return idIdTypeExprAAssign; } + public function getidIdTypeExprBAssign() : Boolean{ return idIdTypeExprBAssign; } + public function getidIdAssignB() { return idIdAssignB; } + public function getidIdTypeExprAAssignB() : Array { return idIdTypeExprAAssignB; } + public function getidIdTypeExprBAssignB() : Boolean{ return idIdTypeExprBAssignB; } + + + } +} + diff --git a/mozilla/js/tamarin/test/as3/Definitions/const/ConstAccessFromClass.as b/mozilla/js/tamarin/test/as3/Definitions/const/ConstAccessFromClass.as new file mode 100644 index 00000000000..02124340d6a --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/const/ConstAccessFromClass.as @@ -0,0 +1,59 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + +var SECTION = "Directives\const"; // provide a document reference (ie, ECMA section) +var VERSION = "ActionScript 3.0"; // Version of JavaScript or ECMA +var TITLE = "'const' outside a class access from inside the class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/*===========================================================================*/ + + +const myConst = 50; + +class ConstClass { + + var myConstAdd = 20 + myConst; +} + +var Obj = new ConstClass(); +myObjConst = Obj.myConstAdd; + +AddTestCase( "Testing the 'const' keywords access from an object of a class: var myConstAdd = 20 + myConst;", 70, myObjConst ); + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/const/ConstAccessWithinClass.as b/mozilla/js/tamarin/test/as3/Definitions/const/ConstAccessWithinClass.as new file mode 100644 index 00000000000..a126257a49d --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/const/ConstAccessWithinClass.as @@ -0,0 +1,58 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + +var SECTION = "Directives\const"; // provide a document reference (ie, ECMA section) +var VERSION = "ActionScript 3.0"; // Version of JavaScript or ECMA +var TITLE = "'const' inside a class access from outside the class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/*===========================================================================*/ + + +class ConstClass { + + const myConst = 10; +} + +var Obj = new ConstClass(); +myObjConst = Obj.myConst; + + +AddTestCase( "Testing the 'const' keywords access from an object of a class: const myConst = 10;", 10, myObjConst ); + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/const/ConstAndClassFuncArgWithSameName.as b/mozilla/js/tamarin/test/as3/Definitions/const/ConstAndClassFuncArgWithSameName.as new file mode 100644 index 00000000000..b4eb980c877 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/const/ConstAndClassFuncArgWithSameName.as @@ -0,0 +1,53 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions\const"; // provide a document reference (ie, ECMA section) +var VERSION = "ActionScript 3.0"; // Version of JavaScript or ECMA +var TITLE = "const & class function arg with same name"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); + +class Test +{ + const num1:Number = 1; + const num2:Number = 3; + + function getNumber(num1:Number, num2:Number) + { + return num1 + num2; + } +} + +var obj:Test = new Test(); +AddTestCase("const and class function arg with same name. should return the sum of function arg", 2, obj.getNumber(1, 1)); + +test(); diff --git a/mozilla/js/tamarin/test/as3/Definitions/const/ConstAndClassFuncArgWithSameName2.as b/mozilla/js/tamarin/test/as3/Definitions/const/ConstAndClassFuncArgWithSameName2.as new file mode 100644 index 00000000000..917378b2615 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/const/ConstAndClassFuncArgWithSameName2.as @@ -0,0 +1,53 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions\const"; // provide a document reference (ie, ECMA section) +var VERSION = "ActionScript 3.0"; // Version of JavaScript or ECMA +var TITLE = "using const in package in a class"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); + +class Test +{ + const num1:Number = 1; + const num2:Number = 3; + + function getNumber(num1:Number, num2:Number) + { + return this.num1 + this.num2; + } +} + +var obj:Test = new Test(); +AddTestCase("const and class function arg with same name, access const with this. should return the sum of function arg", 4, obj.getNumber(1, 1)); + +test(); diff --git a/mozilla/js/tamarin/test/as3/Definitions/const/ConstAndFunctionArgWithSameName.as b/mozilla/js/tamarin/test/as3/Definitions/const/ConstAndFunctionArgWithSameName.as new file mode 100644 index 00000000000..5316c1d8b94 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/const/ConstAndFunctionArgWithSameName.as @@ -0,0 +1,49 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions\const"; // provide a document reference (ie, ECMA section) +var VERSION = "ActionScript 3.0"; // Version of JavaScript or ECMA +var TITLE = "const & function arg with same name"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); + +const num1:Number = 1; +const num2:Number = 3; + +function getNumber(num1:Number, num2:Number) +{ + return num1 + num2; +} + +AddTestCase("const and function arg with same name. should return the sum of function arg", 2, getNumber(1, 1)); + +test(); diff --git a/mozilla/js/tamarin/test/as3/Definitions/const/ConstAndFunctionArgWithSameName2.as b/mozilla/js/tamarin/test/as3/Definitions/const/ConstAndFunctionArgWithSameName2.as new file mode 100644 index 00000000000..d5157d504d7 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/const/ConstAndFunctionArgWithSameName2.as @@ -0,0 +1,49 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions\const"; // provide a document reference (ie, ECMA section) +var VERSION = "ActionScript 3.0"; // Version of JavaScript or ECMA +var TITLE = "const & function arg with same name"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); + +const num1:Number = 1; +const num2:Number = 3; + +function getNumber(num1:Number, num2:Number) +{ + return this.num1 + this.num2; +} + +AddTestCase("const and function arg share same name, access const with this. should return the sum of the two const", 4, getNumber(1, 1)); + +test(); diff --git a/mozilla/js/tamarin/test/as3/Definitions/const/ConstAsVarReplacement.as b/mozilla/js/tamarin/test/as3/Definitions/const/ConstAsVarReplacement.as new file mode 100644 index 00000000000..64215262f30 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/const/ConstAsVarReplacement.as @@ -0,0 +1,51 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions\const"; // provide a document reference (ie, ECMA section) +var VERSION = "ActionScript 3.0"; // Version of JavaScript or ECMA +var TITLE = "'const' as a subsitute for 'var'"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/*===========================================================================*/ + +// Test case for checking the CONST keyword. + +const myConstVar = 10; + +AddTestCase( "const myConstVar = 10;", 10, myConstVar ); + + +test(); // Leave this function alone. + // This function is for executing the test case and then + // displaying the result on to the console or the LOG file. diff --git a/mozilla/js/tamarin/test/as3/Definitions/const/ConstConditionalInitialization.as b/mozilla/js/tamarin/test/as3/Definitions/const/ConstConditionalInitialization.as new file mode 100644 index 00000000000..61937d4b12f --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/const/ConstConditionalInitialization.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions\const"; // provide a document reference (ie, ECMA section) +var VERSION = "ActionScript 3.0"; // Version of JavaScript or ECMA +var TITLE = "conditional initialization of const globally"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +var cond:Boolean = true; + +const num1:Number = (cond)? 3 : 0; + +startTest(); + +AddTestCase("Conditional initiailization of const", 3, num1); + +test(); diff --git a/mozilla/js/tamarin/test/as3/Definitions/const/ConstConditionalInitializationInClass.as b/mozilla/js/tamarin/test/as3/Definitions/const/ConstConditionalInitializationInClass.as new file mode 100644 index 00000000000..cd6b6425c4e --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/const/ConstConditionalInitializationInClass.as @@ -0,0 +1,56 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions\const"; // provide a document reference (ie, ECMA section) +var VERSION = "ActionScript 3.0"; // Version of JavaScript or ECMA +var TITLE = "conditional initialization inside class constructor"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +class MagicBall +{ + const num1:Number; + + function MagicBall(cond:Boolean) + { + num1 = (cond)? 6 : -8; + } + + function getNumber():Number + { + return num1; + } +} + +startTest(); + +AddTestCase("Conditional initiailization of const inside a class constructor", -8, new MagicBall(false).getNumber()); + +test(); diff --git a/mozilla/js/tamarin/test/as3/Definitions/const/ConstConditionalInitializationInClass2.as b/mozilla/js/tamarin/test/as3/Definitions/const/ConstConditionalInitializationInClass2.as new file mode 100644 index 00000000000..88b36ed4deb --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/const/ConstConditionalInitializationInClass2.as @@ -0,0 +1,63 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions\const"; // provide a document reference (ie, ECMA section) +var VERSION = "ActionScript 3.0"; // Version of JavaScript or ECMA +var TITLE = "conditional initialization inside class constructor"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +class MagicBall +{ + const num1:Number; + + function MagicBall(cond:Boolean) + { + if (cond) + { + num1 = 6; + } + else + { + num1 = -8; + } + } + + function getNumber():Number + { + return num1; + } +} + +startTest(); + +AddTestCase("Conditional initiailization of const inside a class constructor", -8, new MagicBall(false).getNumber()); + +test(); diff --git a/mozilla/js/tamarin/test/as3/Definitions/const/ConstConditionalInitializationInClass3_rt.as b/mozilla/js/tamarin/test/as3/Definitions/const/ConstConditionalInitializationInClass3_rt.as new file mode 100644 index 00000000000..a0593d10195 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Definitions/const/ConstConditionalInitializationInClass3_rt.as @@ -0,0 +1,71 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions\const"; // provide a document reference (ie, ECMA section) +var VERSION = "ActionScript 3.0"; // Version of JavaScript or ECMA +var TITLE = "conditional initialization inside class constructor"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +class MagicBall +{ + const num1:Number; + + function MagicBall(count:Number) + { + for (i=0; i; +} catch (err) { + result = err.toString(); +} finally { + AddTestCase("Runtime Error", TYPEERROR + CODE, typeError(result)); +} + +//----------------------------------------------------------- +test(); +//----------------------------------------------------------- diff --git a/mozilla/js/tamarin/test/as3/RuntimeErrors/Error1084XmlQNameProductionMismatch.as b/mozilla/js/tamarin/test/as3/RuntimeErrors/Error1084XmlQNameProductionMismatch.as new file mode 100644 index 00000000000..4610df852ab --- /dev/null +++ b/mozilla/js/tamarin/test/as3/RuntimeErrors/Error1084XmlQNameProductionMismatch.as @@ -0,0 +1,49 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +var CODE = 1084; // Element or attribute ("_") does not match QName production: QName::=(NCName':')?NCName. + +//----------------------------------------------------------- +startTest(); +//----------------------------------------------------------- + +try { + var result = "no error"; + var x = "<::/>"; + var y = new XML(x); +} catch (err) { + result = err.toString(); +} finally { + AddTestCase("Runtime Error", TYPEERROR + CODE, typeError(result)); +} + +//----------------------------------------------------------- +test(); +//----------------------------------------------------------- diff --git a/mozilla/js/tamarin/test/as3/RuntimeErrors/Error1085XmlEndTagMissing.as b/mozilla/js/tamarin/test/as3/RuntimeErrors/Error1085XmlEndTagMissing.as new file mode 100644 index 00000000000..5882674df1f --- /dev/null +++ b/mozilla/js/tamarin/test/as3/RuntimeErrors/Error1085XmlEndTagMissing.as @@ -0,0 +1,49 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +var CODE = 1085; // The element type "_" must be terminated by the matching end-tag "". + +//----------------------------------------------------------- +startTest(); +//----------------------------------------------------------- + +try { + var result = "no error"; + var x = "
    "; + var y = new XML(x); +} catch (err) { + result = err.toString(); +} finally { + AddTestCase("Runtime Error", TYPEERROR + CODE, typeError(result)); +} + +//----------------------------------------------------------- +test(); +//----------------------------------------------------------- diff --git a/mozilla/js/tamarin/test/as3/RuntimeErrors/Error1086XmlMethodOnlyOnListWithOneItem.as b/mozilla/js/tamarin/test/as3/RuntimeErrors/Error1086XmlMethodOnlyOnListWithOneItem.as new file mode 100644 index 00000000000..10d8761ac24 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/RuntimeErrors/Error1086XmlMethodOnlyOnListWithOneItem.as @@ -0,0 +1,49 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +var CODE = 1086; // The _ method only works on lists containing one item. + +//----------------------------------------------------------- +startTest(); +//----------------------------------------------------------- + +try { + var result = "no error"; + var a = new XMLList(); + a.name(); +} catch (err) { + result = err.toString(); +} finally { + AddTestCase("Runtime Error", TYPEERROR + CODE, typeError(result)); +} + +//----------------------------------------------------------- +test(); +//----------------------------------------------------------- diff --git a/mozilla/js/tamarin/test/as3/RuntimeErrors/Error1087XmlAssignToIndexedXml.as b/mozilla/js/tamarin/test/as3/RuntimeErrors/Error1087XmlAssignToIndexedXml.as new file mode 100644 index 00000000000..f49cf3424e1 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/RuntimeErrors/Error1087XmlAssignToIndexedXml.as @@ -0,0 +1,50 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +var CODE = 1087; // Assignment to indexed XML is not allowed. + +//----------------------------------------------------------- +startTest(); +//----------------------------------------------------------- + +var expected = "Error #" + CODE; +var result = "no error"; +try { + var xml = new XML("123"); + xml[0] = 5; +} catch (err) { + result = grabError(err, err.toString()); +} finally { + AddTestCase("Runtime Error", expected, result); +} + +//----------------------------------------------------------- +test(); +//----------------------------------------------------------- diff --git a/mozilla/js/tamarin/test/as3/RuntimeErrors/Error1088XmlDocNotWellFormed.as b/mozilla/js/tamarin/test/as3/RuntimeErrors/Error1088XmlDocNotWellFormed.as new file mode 100644 index 00000000000..f2244d3c0fb --- /dev/null +++ b/mozilla/js/tamarin/test/as3/RuntimeErrors/Error1088XmlDocNotWellFormed.as @@ -0,0 +1,50 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +var CODE = 1088; // The markup in the document following the root element must be well-formed. + +//----------------------------------------------------------- +startTest(); +//----------------------------------------------------------- + +try { + var result = "no error"; + var x = ; + var y = x.attributes(); + var z = new XML(y); +} catch (err) { + result = err.toString(); +} finally { + AddTestCase("Runtime Error", TYPEERROR + CODE, typeError(result)); +} + +//----------------------------------------------------------- +test(); +//----------------------------------------------------------- diff --git a/mozilla/js/tamarin/test/as3/RuntimeErrors/Error1089XmlAssignToMoreThanOneItemList.as b/mozilla/js/tamarin/test/as3/RuntimeErrors/Error1089XmlAssignToMoreThanOneItemList.as new file mode 100644 index 00000000000..46cfab61b1b --- /dev/null +++ b/mozilla/js/tamarin/test/as3/RuntimeErrors/Error1089XmlAssignToMoreThanOneItemList.as @@ -0,0 +1,50 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +var CODE = 1089; // Assignment to lists with more than one item is not supported. + +//----------------------------------------------------------- +startTest(); +//----------------------------------------------------------- + +var expected = "Error #" + CODE; +var result = "no error"; +try { + var x1 = new XMLList("123"); + x1.length = 0; +} catch (err) { + result = grabError(err, err.toString()); +} finally { + AddTestCase("Runtime Error", expected, result); +} + +//----------------------------------------------------------- +test(); +//----------------------------------------------------------- diff --git a/mozilla/js/tamarin/test/as3/RuntimeErrors/Error1090XmlElementMalformed.as b/mozilla/js/tamarin/test/as3/RuntimeErrors/Error1090XmlElementMalformed.as new file mode 100644 index 00000000000..55440d8c9e8 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/RuntimeErrors/Error1090XmlElementMalformed.as @@ -0,0 +1,49 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +var CODE = 1090; // XML parser failure: element is malformed. + +//----------------------------------------------------------- +startTest(); +//----------------------------------------------------------- + +try { + var result = "no error"; + var x = "; +} catch (err) { + result = err.toString(); +} finally { + AddTestCase("Runtime Error", TYPEERROR + CODE, typeError(result)); +} + +//----------------------------------------------------------- +test(); +//----------------------------------------------------------- diff --git a/mozilla/js/tamarin/test/as3/RuntimeErrors/Error1112ArgCountMismatchOnClassCoercion.as b/mozilla/js/tamarin/test/as3/RuntimeErrors/Error1112ArgCountMismatchOnClassCoercion.as new file mode 100644 index 00000000000..e2cf4cfba79 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/RuntimeErrors/Error1112ArgCountMismatchOnClassCoercion.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +var CODE = 1112; // Argument count mismatch on class coercion. Expected 1, got _. + +//----------------------------------------------------------- +startTest(); +//----------------------------------------------------------- + +var expected = "Error #" + CODE; +var result = "no error"; +try { + class a { + function a() {} + } + var b = a(1,2); +} catch (err) { + result = grabError(err, err.toString()); +} finally { + AddTestCase("Runtime Error", expected, result); +} + +//----------------------------------------------------------- +test(); +//----------------------------------------------------------- diff --git a/mozilla/js/tamarin/test/as3/RuntimeErrors/Error1115NotAConstructor.as b/mozilla/js/tamarin/test/as3/RuntimeErrors/Error1115NotAConstructor.as new file mode 100644 index 00000000000..5276c9ff0a1 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/RuntimeErrors/Error1115NotAConstructor.as @@ -0,0 +1,49 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +var CODE = 1115; // _ is not a constructor. + +//----------------------------------------------------------- +startTest(); +//----------------------------------------------------------- + +try { + var z = "no error"; + var OBJECT = new Object(); + var o = new OBJECT(); +} catch (err) { + z = err.toString(); +} finally { + AddTestCase("Runtime Error", "TypeError: Error #" + CODE, typeError(z)); +} + +//----------------------------------------------------------- +test(); +//----------------------------------------------------------- diff --git a/mozilla/js/tamarin/test/as3/RuntimeErrors/Error1116FunctionProtoApply2ndArgMustBeArr.as b/mozilla/js/tamarin/test/as3/RuntimeErrors/Error1116FunctionProtoApply2ndArgMustBeArr.as new file mode 100644 index 00000000000..0785499848b --- /dev/null +++ b/mozilla/js/tamarin/test/as3/RuntimeErrors/Error1116FunctionProtoApply2ndArgMustBeArr.as @@ -0,0 +1,48 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +var CODE = 1116; // second argument to Function.prototype.apply must be an array. + +//----------------------------------------------------------- +startTest(); +//----------------------------------------------------------- + +try { + var result = "no error"; + Function.prototype.apply(1, 1); +} catch (err) { + result = err.toString(); +} finally { + AddTestCase("Runtime Error", TYPEERROR + CODE, typeError(result)); +} + +//----------------------------------------------------------- +test(); +//----------------------------------------------------------- diff --git a/mozilla/js/tamarin/test/as3/RuntimeErrors/Error1117InvalidXmlName.as b/mozilla/js/tamarin/test/as3/RuntimeErrors/Error1117InvalidXmlName.as new file mode 100644 index 00000000000..8efc04becae --- /dev/null +++ b/mozilla/js/tamarin/test/as3/RuntimeErrors/Error1117InvalidXmlName.as @@ -0,0 +1,50 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +var CODE = 1117; // Invalid XML name: _. + +//----------------------------------------------------------- +startTest(); +//----------------------------------------------------------- + +var expected = "Error #" + CODE; +var result = "no error"; +try { + var xml = new XML(""); + xml.setName(undefined); +} catch (err) { + result = grabError(err, err.toString()); +} finally { + AddTestCase("Runtime Error", expected, result); +} + +//----------------------------------------------------------- +test(); +//----------------------------------------------------------- diff --git a/mozilla/js/tamarin/test/as3/RuntimeErrors/Error1118IllegalCyclicalLoop.as b/mozilla/js/tamarin/test/as3/RuntimeErrors/Error1118IllegalCyclicalLoop.as new file mode 100644 index 00000000000..793ae13c5e7 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/RuntimeErrors/Error1118IllegalCyclicalLoop.as @@ -0,0 +1,54 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +var CODE = 1118; // Illegal cyclical loop between nodes. + +//----------------------------------------------------------- +startTest(); +//----------------------------------------------------------- + +var expected = "Error #" + CODE; +var result = "no error"; +try { + var xml:XML = + + burger + soda + ; + xml.insertChildAfter(xml.item[0], xml); +} catch (err) { + result = grabError(err, err.toString()); +} finally { + AddTestCase("Runtime Error", expected, result); +} + +//----------------------------------------------------------- +test(); +//----------------------------------------------------------- diff --git a/mozilla/js/tamarin/test/as3/RuntimeErrors/Error1119DeleteDoesNotSupportXMLListOperand.as b/mozilla/js/tamarin/test/as3/RuntimeErrors/Error1119DeleteDoesNotSupportXMLListOperand.as new file mode 100644 index 00000000000..89e7594bc4d --- /dev/null +++ b/mozilla/js/tamarin/test/as3/RuntimeErrors/Error1119DeleteDoesNotSupportXMLListOperand.as @@ -0,0 +1,53 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +var CODE = 1119; // Delete operator is not supported with operand of type _. + +//----------------------------------------------------------- +startTest(); +//----------------------------------------------------------- + +var expected = "Error #" + CODE; +var result = "no error"; +try { + var books:XML = + + + ; + delete books.book.(@publisher == "Adobe"); +} catch (err) { + result = grabError(err, err.toString()); +} finally { + AddTestCase("Runtime Error", expected, result); +} + +//----------------------------------------------------------- +test(); +//----------------------------------------------------------- diff --git a/mozilla/js/tamarin/test/as3/RuntimeErrors/Error1120CannotDeleteProperty.as b/mozilla/js/tamarin/test/as3/RuntimeErrors/Error1120CannotDeleteProperty.as new file mode 100644 index 00000000000..5d159a77487 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/RuntimeErrors/Error1120CannotDeleteProperty.as @@ -0,0 +1,49 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +var CODE = 1120; // Cannot delete property _ on _. + +//----------------------------------------------------------- +startTest(); +//----------------------------------------------------------- + +var expected = "Error #" + CODE; +var result = "no error"; +try { + delete "".length; +} catch (err) { + result = grabError(err, err.toString()); +} finally { + AddTestCase("Runtime Error", expected, result); +} + +//----------------------------------------------------------- +test(); +//----------------------------------------------------------- diff --git a/mozilla/js/tamarin/test/as3/RuntimeErrors/SpecialTestCases/Error1042InvalidABCFile/Error1042InvalidABCFile.as b/mozilla/js/tamarin/test/as3/RuntimeErrors/SpecialTestCases/Error1042InvalidABCFile/Error1042InvalidABCFile.as new file mode 100644 index 00000000000..3b268252916 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/RuntimeErrors/SpecialTestCases/Error1042InvalidABCFile/Error1042InvalidABCFile.as @@ -0,0 +1,31 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +var obj = new Object(); diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocks2.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocks2.as new file mode 100644 index 00000000000..fa740d8e6ac --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocks2.as @@ -0,0 +1,82 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + +import MultipleCatchBlocks2.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Testing try block with multiple catch blocks"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var z = new MyErrors2(); +thisError = "no error"; +thisError1 = "no error"; +thisError2 = "no error"; +thisError3 = "no error"; +thisError4 = "no error"; +thisError5 = "no error"; +thisError6 = "no error"; +thisError7 = "no error"; +try { + z.MyArgumentError(); + }catch(e:ReferenceError){ + thisError=(e.toString()).substr(0,26);//print(thisError); + }catch(e1:TypeError){ + thisError1=(e1.toString()).substr(0,26);//print(thisError1); + }catch(e2:ArgumentError){ + thisError2=(e2.toString()).substr(0,26);//print(thisError2); + }catch(e3:URIError){ + thisError3=(e3.toString()).substr(0,26);//print(thisError3); + }catch(e4:UninitializedError){ + thisError4=(e4.toString()).substr(0,26);//print(thisError4); + }catch(e5:EvalError){ + thisError5=(e5.toString()).substr(0,26);//print(thisError5); + }catch(e6:RangeError){ + thisError6=(e6.toString()).substr(0,26);//print(thisError6); + }catch(e7:Error){ + thisError7=(e7.toString()).substr(0,26);//print(thisError7); + }finally{ +AddTestCase( "Testing catch block with Reference Error", "no error" ,thisError); +AddTestCase( "Testing catch block with Type Error", "no error" ,thisError1); +AddTestCase( "Testing catch block with Argument Error", "ArgumentError: Error #1063",thisError2); +AddTestCase( "Testing catch block with URIError", "no error" ,thisError3); +AddTestCase( "Testing catch block with Eval Error", "no error" ,thisError5); +AddTestCase( "Testing catch block with Range Error", "no error" ,thisError6); +AddTestCase( "Testing catch block with Error", "no error" ,thisError7); + } + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocks2/MyErrors2.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocks2/MyErrors2.as new file mode 100644 index 00000000000..d82b3fcb38d --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocks2/MyErrors2.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package MultipleCatchBlocks2{ + public class MyErrors2{ + + var a:Number; + + public function MyArgumentError(a):String + { + var k:String = decodeURI("!@#$%^&*()<>?"); + eval(m); + var arr:Array=new Array(-10); + return 6; + } + + } +} diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksArgument.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksArgument.as new file mode 100644 index 00000000000..a07a12ff35d --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksArgument.as @@ -0,0 +1,75 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + +import MultipleCatchBlocksArgument.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Testing try block with multiple catch blocks"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var z = new ArgumentErrors(); +thisError = "no error"; + +try{ + z.MyArgumentError(); + }catch(e:ReferenceError){ + thisError=e.toString(); + }catch(e1:TypeError){ + thisError=e1.toString(); + }catch(e2:ArgumentError){ + thisError=(e2.toString()).substr(0,26);//print(thisError); + }catch(e3:URIError){ + thisError=e3.toString() + }catch(e4:UninitializedError){ + thisError=e4.toString(); + }catch(e5:EvalError){ + thisError=e5.toString(); + }catch(e6:RangeError){ + thisError=e6.toString(); + }catch(e7:DefinitionError){ + thisError="This is Definition Error"; + }catch(e8:SyntaxError){ + thisError="This is Syntax Error"; + }catch(e9:VerifyError){ + thisError="This is Verify Error"; + }catch(e10:Error){ + thisError=e7.toString(); + }finally{ + AddTestCase( "Testing catch block with Argument Error", "ArgumentError: Error #1063",thisError); + } + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksArgument/ArgumentErrors.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksArgument/ArgumentErrors.as new file mode 100644 index 00000000000..3592f6b2c86 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksArgument/ArgumentErrors.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package MultipleCatchBlocksArgument +{ + public class ArgumentErrors + { + var a:Number; + + public function MyArgumentError(a):Number + { + + return 6; + + } + + } +} diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksEval.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksEval.as new file mode 100644 index 00000000000..b161dda3dc4 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksEval.as @@ -0,0 +1,75 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + +import MultipleCatchBlocksEval.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Testing try block with multiple catch blocks"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var z = new EvalErrors(); +thisError = "no error"; + +try{ + z.MyArgumentError(6); + }catch(e:ReferenceError){ + thisError=e.toString(); + }catch(e1:TypeError){ + thisError=e1.toString(); + }catch(e2:ArgumentError){ + thisError=e2.toString(); + }catch(e3:URIError){ + thisError=e3.toString() + }catch(e4:UninitializedError){ + thisError=e4.toString(); + }catch(e5:EvalError){ + thisError=e5.toString(); + }catch(e6:RangeError){ + thisError=e6.toString(); + }catch(e7:DefinitionError){ + thisError="This is Definition Error"; + }catch(e8:SyntaxError){ + thisError="This is Syntax Error"; + }catch(e9:VerifyError){ + thisError="This is Verify Error"; + }catch(e10:Error){ + thisError=e7.toString(); + }finally{ + AddTestCase( "Testing catch block with Eval Error", "EvalError",thisError); + } + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksEval/EvalErrors.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksEval/EvalErrors.as new file mode 100644 index 00000000000..eb3b3c6e896 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksEval/EvalErrors.as @@ -0,0 +1,44 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package MultipleCatchBlocksEval +{ + public class EvalErrors + { + var a:Number; + + public function MyArgumentError(a):Number + { + throw new EvalError(); + + } + + } +} diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksRange.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksRange.as new file mode 100644 index 00000000000..7fe82c394bc --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksRange.as @@ -0,0 +1,75 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + +import MultipleCatchBlocksRange.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Testing try block with multiple catch blocks"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var z = new RangeErrors(); +thisError = "no error"; + +try{ + z.MyArgumentError(6); + }catch(e:ReferenceError){ + thisError=e.toString(); + }catch(e1:TypeError){ + thisError=e1.toString(); + }catch(e2:ArgumentError){ + thisError=e2.toString(); + }catch(e3:URIError){ + thisError=e3.toString() + }catch(e4:UninitializedError){ + thisError=e4.toString(); + }catch(e5:EvalError){ + thisError=e5.toString(); + }catch(e6:RangeError){ + thisError=(e6.toString()).substring(0,10); + }catch(e7:DefinitionError){ + thisError="This is Definition Error"; + }catch(e8:SyntaxError){ + thisError="This is Syntax Error"; + }catch(e9:VerifyError){ + thisError="This is Verify Error"; + }catch(e10:Error){ + thisError=e7.toString(); + }finally{ + AddTestCase( "Testing catch block with Range Error","RangeError",thisError); + } + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksRange/RangeErrors.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksRange/RangeErrors.as new file mode 100644 index 00000000000..c4ad7586c97 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksRange/RangeErrors.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package MultipleCatchBlocksRange +{ + public class RangeErrors + { + var a:Number; + + public function MyArgumentError(a):Number + { + var arr = new Array(-10); + return 6; + + } + + } +} diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksRefErrorCaughtWithError.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksRefErrorCaughtWithError.as new file mode 100644 index 00000000000..80431f44652 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksRefErrorCaughtWithError.as @@ -0,0 +1,64 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Testing try block with multiple catch blocks, the catch block with parameter of type Error catching the reference error when there is no catch block with a parameter of type reference error"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +thisError = "no error"; + +try { + throw new ReferenceError(); + }catch(e1:ArgumentError){ + thisError="This is Argument Error"; + }catch(e2:URIError){ + thisError="This is URI Error"; + }catch(e3:EvalError){ + thisError="This is Eval Error"; + }catch(e4:RangeError){ + thisError="This is Range Error"; + }catch(e4:TypeError){ + thisError="This is Type Error"; + }catch(e5:SecurityError){ + thisError="This is security Error"; + }catch(e6:Error){ + thisError = e6.toString(); + }finally{//print(thisError); + AddTestCase( "Testing try block with throw statement", "ReferenceError" ,thisError); + } + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksReference.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksReference.as new file mode 100644 index 00000000000..41aa56cb9c1 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksReference.as @@ -0,0 +1,75 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + +import MultipleCatchBlocksReference.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Testing try block with multiple catch blocks"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var z = new ReferenceErrors(); +thisError = "no error"; + +try{ + z.MyArgumentError(6); + }catch(e:ReferenceError){ + thisError=(e.toString()).substr(0,27); + }catch(e1:TypeError){ + thisError=e1.toString(); + }catch(e2:ArgumentError){ + thisError=e2.toString(); + }catch(e3:URIError){ + thisError=e3.toString() + }catch(e4:UninitializedError){ + thisError=e4.toString(); + }catch(e5:EvalError){ + thisError=e5.toString(); + }catch(e6:RangeError){ + thisError=e6.toString(); + }catch(e7:DefinitionError){ + thisError="This is Definition Error"; + }catch(e8:SyntaxError){ + thisError="This is Syntax Error"; + }catch(e9:VerifyError){ + thisError="This is Verify Error"; + }catch(e10:Error){ + thisError=e7.toString(); + }finally{ + AddTestCase( "Testing catch block with Reference Error", "ReferenceError: Error #1065",thisError); + } + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksReference/ReferenceErrors.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksReference/ReferenceErrors.as new file mode 100644 index 00000000000..1f7393c5c50 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksReference/ReferenceErrors.as @@ -0,0 +1,46 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package MultipleCatchBlocksReference +{ + public class ReferenceErrors + { + var a:Number; + + public function MyArgumentError(a):Number + { + m=m+1; + return 6; + + } + + + } +} diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksType.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksType.as new file mode 100644 index 00000000000..2cbda1c71b3 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksType.as @@ -0,0 +1,80 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + +import MultipleCatchBlocksType.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Testing try block with multiple catch blocks and using a catch block with parameter of type TypeError to catch the type error"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var z = new TypeErrors(); +thisError = "no error"; +thisError1 = "no error"; + +try{ + z.MyArgumentError("blah"); + + }catch(e:ReferenceError){ + thisError=e.toString(); + }catch(e1:TypeError){ + thisError=(e1.toString()).substr(0,22); + }catch(e2:ArgumentError){ + thisError=e2.toString(); + }catch(e3:URIError){ + thisError=e3.toString() + }catch(e4:UninitializedError){ + thisError=e4.toString(); + }catch(e5:EvalError){ + thisError=e5.toString(); + }catch(e6:RangeError){ + thisError=e6.toString(); + }catch(e7:DefinitionError){ + thisError="This is Definition Error"; + }catch(e8:SyntaxError){ + thisError="This is Syntax Error"; + }catch(e9:VerifyError){ + thisError="This is Verify Error"; + }catch(e10:Error){//print(e10.toString()); + thisError=e10.toString(); + }finally{ + AddTestCase( "Testing catch block with Type Error", "TypeError" ,thisError); + } + + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksType/TypeErrors.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksType/TypeErrors.as new file mode 100644 index 00000000000..6f99d319d4c --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksType/TypeErrors.as @@ -0,0 +1,45 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package MultipleCatchBlocksType +{ + public class TypeErrors + { + + + public function MyArgumentError(a):int + { + throw new TypeError(); + + + } + } + +} diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksType1.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksType1.as new file mode 100644 index 00000000000..4dc34586484 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksType1.as @@ -0,0 +1,66 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Testing try block with multiple catch blocks, the first catch block catching the type error"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +thisError = "no error"; + +try { + throw new TypeError(); + } catch(e:TypeError){ + thisError="This is Type Error"; + }catch(e1:ReferenceError){ + thisError="This is Reference Error"; + }catch(e2:ArgumentError){ + thisError="This is Argument Error"; + }catch(e3:URIError){ + thisError="This is URI Error" + }catch(e4:EvalError){ + thisError="This is Eval Error"; + }catch(e5:RangeError){ + thisError="This is Range Error"; + }catch(e6:SecurityError){ + thisError="This is Security Error!!!"; + }catch(e7:Error){ + thisError = "This is an error"; + }finally{ + AddTestCase( "Testing try block with throw statement", "This is Type Error" ,thisError); + } + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksType2.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksType2.as new file mode 100644 index 00000000000..c7ac6442949 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksType2.as @@ -0,0 +1,66 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Testing try block with multiple catch blocks, the second catch block catching the type error"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +thisError = "no error"; + +try { + throw new TypeError(); + } catch(e:ReferenceError){ + thisError="This is Reference error"; + }catch(e1:TypeError){ + thisError="This is Type Error"; + }catch(e2:ArgumentError){ + thisError="This is Argument Error"; + }catch(e3:URIError){ + thisError="This is URI Error" + }catch(e4:EvalError){ + thisError="This is Eval Error"; + }catch(e5:RangeError){ + thisError="This is Range Error"; + }catch(e6:SecurityError){ + thisError="This is Security Error!!!"; + }catch(e7:Error){ + thisError = "This is an error"; + }finally{ + AddTestCase( "Testing try block with throw statement", "This is Type Error" ,thisError); + } + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksType3.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksType3.as new file mode 100644 index 00000000000..191b74240c5 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksType3.as @@ -0,0 +1,66 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Testing try block with multiple catch blocks, the third catch block catching the type error"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +thisError = "no error"; + +try { + throw new TypeError(); + } catch(e:ReferenceError){ + thisError="This is Reference Error"; + }catch(e1:ArgumentError){ + thisError="This is Argument Error"; + }catch(e2:TypeError){ + thisError="This is Type Error"; + }catch(e3:URIError){ + thisError="This is URI Error" + }catch(e4:EvalError){ + thisError="This is Eval Error"; + }catch(e5:RangeError){ + thisError="This is Range Error"; + }catch(e6:SecurityError){ + thisError="This is Security Error!!!"; + }catch(e7:Error){ + thisError = "This is an error"; + }finally{ + AddTestCase( "Testing try block with throw statement", "This is Type Error" ,thisError); + } + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksType4.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksType4.as new file mode 100644 index 00000000000..afee091ad1e --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksType4.as @@ -0,0 +1,66 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Testing try block with multiple catch blocks, the fourth catch block catching the type error"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +thisError = "no error"; + +try { + throw new TypeError(); + } catch(e:ReferenceError){ + thisError="This is Reference Error"; + }catch(e1:ArgumentError){ + thisError="This is Argument Error"; + }catch(e2:URIError){ + thisError="This is URI Error"; + }catch(e3:TypeError){ + thisError="This is Type Error"; + }catch(e4:EvalError){ + thisError="This is Eval Error"; + }catch(e5:RangeError){ + thisError="This is Range Error"; + }catch(e6:SecurityError){ + thisError="This is Security Error!!!"; + }catch(e7:Error){ + thisError = "This is an error"; + }finally{ + AddTestCase( "Testing try block with throw statement", "This is Type Error" ,thisError); + } + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksType5.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksType5.as new file mode 100644 index 00000000000..41c04cff9be --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksType5.as @@ -0,0 +1,66 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Testing try block with multiple catch blocks, the fifth catch block catching the type error"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +thisError = "no error"; + +try { + throw new TypeError(); + } catch(e:ReferenceError){ + thisError="This is Reference Error"; + }catch(e1:ArgumentError){ + thisError="This is Argument Error"; + }catch(e2:URIError){ + thisError="This is URI Error"; + }catch(e3:EvalError){ + thisError="This is Eval Error"; + }catch(e4:TypeError){ + thisError="This is Type Error"; + }catch(e5:RangeError){ + thisError="This is Range Error"; + }catch(e6:SecurityError){ + thisError="This is Security Error!!!"; + }catch(e7:Error){ + thisError = "This is an error"; + }finally{ + AddTestCase( "Testing try block with throw statement", "This is Type Error" ,thisError); + } + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksType6.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksType6.as new file mode 100644 index 00000000000..cf942cded86 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksType6.as @@ -0,0 +1,66 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Testing try block with multiple catch blocks, the sixth catch block catching the type error"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +thisError = "no error"; + +try { + throw new TypeError(); + } catch(e:ReferenceError){ + thisError="This is Reference Error"; + }catch(e1:ArgumentError){ + thisError="This is Argument Error"; + }catch(e2:URIError){ + thisError="This is URI Error"; + }catch(e3:EvalError){ + thisError="This is Eval Error"; + }catch(e4:RangeError){ + thisError="This is Range Error"; + }catch(e5:TypeError){ + thisError="This is Type Error"; + }catch(e6:SecurityError){ + thisError="This is Security Error!!!"; + }catch(e7:Error){ + thisError = "This is an error"; + }finally{ + AddTestCase( "Testing try block with throw statement", "This is Type Error" ,thisError); + } + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksType7.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksType7.as new file mode 100644 index 00000000000..7133ee34421 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksType7.as @@ -0,0 +1,66 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Testing try block with multiple catch blocks, the seventh catch block catching the type error"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +thisError = "no error"; + +try { + throw new TypeError(); + } catch(e:ReferenceError){ + thisError="This is Reference Error"; + }catch(e1:ArgumentError){ + thisError="This is Argument Error"; + }catch(e2:URIError){ + thisError="This is URI Error"; + }catch(e3:EvalError){ + thisError="This is Eval Error"; + }catch(e4:RangeError){ + thisError="This is Range Error"; + }catch(e5:SecurityError){ + thisError="This is security Error"; + }catch(e6:TypeError){ + thisError="This is Type Error"; + }catch(e7:Error){ + thisError = "This is an error"; + }finally{ + AddTestCase( "Testing try block with throw statement", "This is Type Error" ,thisError); + } + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksURI.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksURI.as new file mode 100644 index 00000000000..3bd0ebfcda3 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksURI.as @@ -0,0 +1,75 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + +import MultipleCatchBlocksURI.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Testing try block with multiple catch blocks"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var z = new URIErrors(); +thisError = "no error"; + +try{ + z.MyArgumentError(6); + }catch(e:ReferenceError){ + thisError=e.toString(); + }catch(e1:TypeError){ + thisError=e1.toString(); + }catch(e2:ArgumentError){ + thisError=e2.toString(); + }catch(e3:URIError){ + thisError=(e3.toString()).substr(0,21); + }catch(e4:UninitializedError){ + thisError=e4.toString(); + }catch(e5:EvalError){ + thisError=e5.toString(); + }catch(e6:RangeError){ + thisError=e6.toString(); + }catch(e7:DefinitionError){ + thisError="This is Definition Error"; + }catch(e8:SyntaxError){ + thisError="This is Syntax Error"; + }catch(e9:VerifyError){ + thisError="This is Verify Error"; + }catch(e10:Error){ + thisError=e7.toString(); + }finally{ + AddTestCase( "Testing catch block with URI Error", "URIError: Error #1052",thisError); + } + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksURI/URIErrors.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksURI/URIErrors.as new file mode 100644 index 00000000000..9ba0bef0be6 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksURI/URIErrors.as @@ -0,0 +1,46 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package MultipleCatchBlocksURI +{ + public class URIErrors + { + var a:Number; + + public function MyArgumentError(a):Number + { + var k:String = decodeURI("!@#$%^&*()<>?"); + return 6; + + } + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithArg1.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithArg1.as new file mode 100644 index 00000000000..daa4a5091c5 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithArg1.as @@ -0,0 +1,74 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Testing try block with multiple catch blocks, the catch block with parameter of type ArgumentError catching the Argument error "; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +thisError = "no error"; + +try { + throw new ArgumentError(); + } catch(e:ReferenceError){ + thisError="This is Reference Error"; + }catch(e1:ArgumentError){ + thisError="This is Argument Error"; + }catch(e2:URIError){ + thisError="This is URI Error"; + }catch(e3:EvalError){ + thisError="This is Eval Error"; + }catch(e4:RangeError){ + thisError="This is Range Error"; + }catch(e4:TypeError){ + thisError="This is Type Error"; + }catch(e5:SecurityError){ + thisError="This is security Error"; + }catch(e6:DefinitionError){ + thisError="This is Definition Error"; + }catch(e7:UninitializedError){ + thisError="This is Uninitialized Error"; + }catch(e8:SyntaxError){ + thisError="This is Syntax Error"; + }catch(e9:VerifyError){ + thisError="This is Verify Error"; + }catch(e10:Error){ + thisError = e10.toString(); + }finally{ + AddTestCase( "Testing try block with throw statement", "This is Argument Error" ,thisError); + } + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithArgErrorCaughtByError.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithArgErrorCaughtByError.as new file mode 100644 index 00000000000..bc85b05be73 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithArgErrorCaughtByError.as @@ -0,0 +1,72 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Testing try block with multiple catch blocks, the catch block with parameter of type Error catching the Argument error when there is no catch block with parameter of type Argument Error"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +thisError = "no error"; + +try { + throw new ArgumentError(); + } catch(e:ReferenceError){ + thisError="This is Reference Error"; + }catch(e2:URIError){ + thisError="This is URI Error"; + }catch(e3:EvalError){ + thisError="This is Eval Error"; + }catch(e4:RangeError){ + thisError="This is Range Error"; + }catch(e4:TypeError){ + thisError="This is Type Error"; + }catch(e5:SecurityError){ + thisError="This is security Error"; + }catch(e6:DefinitionError){ + thisError="This is Definition Error"; + }catch(e7:UninitializedError){ + thisError="This is Uninitialized Error"; + }catch(e8:SyntaxError){ + thisError="This is Syntax Error"; + }catch(e9:VerifyError){ + thisError="This is Verify Error"; + }catch(e10:Error){ + thisError = e10.toString(); + }finally{ + AddTestCase( "Testing try block with throw statement", "Error: ArgumentError" ,Error(thisError)+"" ); + } + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithDef1.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithDef1.as new file mode 100644 index 00000000000..7237982f7c2 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithDef1.as @@ -0,0 +1,68 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Testing try block with multiple catch blocks, the catch block with parameter of type DefinitionError catching the Definition error "; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +thisError = "no error"; + +try { + throw new DefinitionError(); + } catch(e:ReferenceError){ + thisError="This is Reference Error"; + }catch(e1:ArgumentError){ + thisError="This is Argument Error"; + }catch(e2:URIError){ + thisError="This is URI Error"; + }catch(e3:EvalError){ + thisError="This is Eval Error"; + }catch(e4:RangeError){ + thisError="This is Range Error"; + }catch(e4:TypeError){ + thisError="This is Type Error"; + }catch(e5:SecurityError){ + thisError="This is security Error"; + }catch(e6:DefinitionError){ + thisError="This is Definition Error"; + }catch(e7:Error){ + thisError = e7.toString(); + }finally{ + AddTestCase( "Testing try block with throw statement", "This is Definition Error" ,thisError ); + } + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithDefErrorCaughtWithError.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithDefErrorCaughtWithError.as new file mode 100644 index 00000000000..d63433b8f59 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithDefErrorCaughtWithError.as @@ -0,0 +1,66 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Testing try block with multiple catch blocks, the catch block with parameter of type Error catching the Definition error when there is no catch block with parameter of type Definition Error"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +thisError = "no error"; + +try { + throw new DefinitionError(); + } catch(e:ReferenceError){ + thisError="This is Reference Error"; + }catch(e1:ArgumentError){ + thisError="This is Argument Error"; + }catch(e2:URIError){ + thisError="This is URI Error"; + }catch(e3:EvalError){ + thisError="This is Eval Error"; + }catch(e4:RangeError){ + thisError="This is Range Error"; + }catch(e4:TypeError){ + thisError="This is Type Error"; + }catch(e5:SecurityError){ + thisError="This is security Error"; + }catch(e7:Error){ + thisError = e7.toString(); + }finally{ + AddTestCase( "Testing try block with throw statement", "Error: DefinitionError" ,Error(thisError)+"" ); + } + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithEval1.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithEval1.as new file mode 100644 index 00000000000..91f19f661f3 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithEval1.as @@ -0,0 +1,74 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Testing try block with multiple catch blocks, the catch block with parameter of type EvalError catching the Eval error "; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +thisError = "no error"; + +try { + throw new EvalError(); + } catch(e:ReferenceError){ + thisError="This is Reference Error"; + }catch(e1:ArgumentError){ + thisError="This is Argument Error"; + }catch(e2:URIError){ + thisError="This is URI Error"; + }catch(e3:EvalError){ + thisError="This is Eval Error"; + }catch(e4:RangeError){ + thisError="This is Range Error"; + }catch(e4:TypeError){ + thisError="This is Type Error"; + }catch(e5:SecurityError){ + thisError="This is security Error"; + }catch(e6:DefinitionError){ + thisError="This is Definition Error"; + }catch(e7:UninitializedError){ + thisError="This is Uninitialized Error"; + }catch(e8:SyntaxError){ + thisError="This is Syntax Error"; + }catch(e9:VerifyError){ + thisError="This is Verify Error"; + }catch(e10:Error){ + thisError = e10.toString(); + }finally{ + AddTestCase( "Testing try block with throw statement", "This is Eval Error" ,thisError ); + } + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithEvalErrorCaughtByError.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithEvalErrorCaughtByError.as new file mode 100644 index 00000000000..e4abe9c5180 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithEvalErrorCaughtByError.as @@ -0,0 +1,72 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Testing try block with multiple catch blocks, the catch block with parameter of type Error catching the Eval error when no catch block with parameter of type EvalError is defined"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +thisError = "no error"; + +try { + throw new EvalError(); + } catch(e:ReferenceError){ + thisError="This is Reference Error"; + }catch(e1:ArgumentError){ + thisError="This is Argument Error"; + }catch(e2:URIError){ + thisError="This is URI Error"; + }catch(e4:RangeError){ + thisError="This is Range Error"; + }catch(e4:TypeError){ + thisError="This is Type Error"; + }catch(e5:SecurityError){ + thisError="This is security Error"; + }catch(e6:DefinitionError){ + thisError="This is Definition Error"; + }catch(e7:UninitializedError){ + thisError="This is Uninitialized Error"; + }catch(e8:SyntaxError){ + thisError="This is Syntax Error"; + }catch(e9:VerifyError){ + thisError="This is Verify Error"; + }catch(e10:Error){ + thisError = e10.toString(); + }finally{ + AddTestCase( "Testing try block with throw statement", "Error: EvalError" ,Error(thisError)+"" ); + } + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithNoTypeErrorCatchBlock.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithNoTypeErrorCatchBlock.as new file mode 100644 index 00000000000..927546cd066 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithNoTypeErrorCatchBlock.as @@ -0,0 +1,64 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Testing try block with multiple catch blocks, the catch block with parameter of type Error catching the type Error as there is no catch block with parameter of type TypeError"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +thisError = "no error"; + +try { + throw new TypeError(); + } catch(e:ReferenceError){ + thisError="This is Reference Error"; + }catch(e1:ArgumentError){ + thisError="This is Argument Error"; + }catch(e2:URIError){ + thisError="This is URI Error"; + }catch(e3:EvalError){ + thisError="This is Eval Error"; + }catch(e4:RangeError){ + thisError="This is Range Error"; + }catch(e5:SecurityError){ + thisError="This is security Error"; + }catch(e6:Error){ + thisError = e6.toString(); + }finally{ + AddTestCase( "Testing try block with throw statement", "Error: TypeError" ,Error(thisError)+"" ); + } + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithRange1.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithRange1.as new file mode 100644 index 00000000000..6af8501e2b8 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithRange1.as @@ -0,0 +1,74 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Testing try block with multiple catch blocks, the catch block with parameter of type RangeError catching the Range error "; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +thisError = "no error"; + +try { + throw new RangeError(); + } catch(e:ReferenceError){ + thisError="This is Reference Error"; + }catch(e1:ArgumentError){ + thisError="This is Argument Error"; + }catch(e2:URIError){ + thisError="This is URI Error"; + }catch(e3:EvalError){ + thisError="This is Eval Error"; + }catch(e4:RangeError){ + thisError="This is Range Error"; + }catch(e4:TypeError){ + thisError="This is Type Error"; + }catch(e5:SecurityError){ + thisError="This is security Error"; + }catch(e6:DefinitionError){ + thisError="This is Definition Error"; + }catch(e7:UninitializedError){ + thisError="This is Uninitialized Error"; + }catch(e8:SyntaxError){ + thisError="This is Syntax Error"; + }catch(e9:VerifyError){ + thisError="This is Verify Error"; + }catch(e10:Error){ + thisError = e10.toString(); + }finally{ + AddTestCase( "Testing try block with throw statement", "Error: This is Range Error" ,Error(thisError)+"" ); + } + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithRangeErrorCaughtByError.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithRangeErrorCaughtByError.as new file mode 100644 index 00000000000..6cb42f92df6 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithRangeErrorCaughtByError.as @@ -0,0 +1,72 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Testing try block with multiple catch blocks, the catch block with parameter of type Error catching the Range error when there is no catch block with parameter of type Range Error defined "; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +thisError = "no error"; + +try { + throw new RangeError(); + } catch(e:ReferenceError){ + thisError="This is Reference Error"; + }catch(e1:ArgumentError){ + thisError="This is Argument Error"; + }catch(e2:URIError){ + thisError="This is URI Error"; + }catch(e3:EvalError){ + thisError="This is Eval Error"; + }catch(e4:TypeError){ + thisError="This is Type Error"; + }catch(e5:SecurityError){ + thisError="This is security Error"; + }catch(e6:DefinitionError){ + thisError="This is Definition Error"; + }catch(e7:UninitializedError){ + thisError="This is Uninitialized Error"; + }catch(e8:SyntaxError){ + thisError="This is Syntax Error"; + }catch(e9:VerifyError){ + thisError="This is Verify Error"; + }catch(e10:Error){ + thisError = e10.toString(); + }finally{ + AddTestCase( "Testing try block with throw statement", "Error: RangeError" ,Error(thisError)+"" ); + } + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithRefError1.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithRefError1.as new file mode 100644 index 00000000000..a8427b0ebbd --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithRefError1.as @@ -0,0 +1,66 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Testing try block with multiple catch blocks, the catch block with parameter of type ReferenceError catching the reference error "; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +thisError = "no error"; + +try { + throw new ReferenceError(); + } catch(e:ReferenceError){ + thisError="This is Reference Error"; + }catch(e1:ArgumentError){ + thisError="This is Argument Error"; + }catch(e2:URIError){ + thisError="This is URI Error"; + }catch(e3:EvalError){ + thisError="This is Eval Error"; + }catch(e4:RangeError){ + thisError="This is Range Error"; + }catch(e4:TypeError){ + thisError="This is Type Error"; + }catch(e5:SecurityError){ + thisError="This is security Error"; + }catch(e6:Error){ + thisError = e6.toString(); + }finally{//print(thisError); +AddTestCase( "Testing try block with throw statement", "This is Reference Error" ,thisError ); + } + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithSyntax.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithSyntax.as new file mode 100644 index 00000000000..76db9c08a4f --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithSyntax.as @@ -0,0 +1,74 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Testing try block with multiple catch blocks, the catch block with parameter of type SyntaxError catching the Syntax error. Syntax Errors are parser errors and cannot be caught by the try and catch block. They are thrown during compilation time. This test is to test throw statement throwing error of type syntax error and whether the particular catch block handles it/ignores it or some other errors are caught by the catch block with parameter of type Syntax error "; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +thisError = "no error"; + +try { + throw new SyntaxError(); + } catch(e:ReferenceError){ + thisError="This is Reference Error"; + }catch(e1:ArgumentError){ + thisError="This is Argument Error"; + }catch(e2:URIError){ + thisError="This is URI Error"; + }catch(e3:EvalError){ + thisError="This is Eval Error"; + }catch(e4:RangeError){ + thisError="This is Range Error"; + }catch(e4:TypeError){ + thisError="This is Type Error"; + }catch(e5:SecurityError){ + thisError="This is security Error"; + }catch(e6:DefinitionError){ + thisError="This is Definition Error"; + }catch(e7:UninitializedError){ + thisError="This is Uninitialized Error"; + }catch(e8:SyntaxError){ + thisError="This is Syntax Error"; + }catch(e9:VerifyError){ + thisError="This is Verify Error"; + }catch(e10:Error){ + thisError = e10.toString(); + }finally{ + AddTestCase( "Testing try block with throw statement", "This is Syntax Error" ,thisError ); + } + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithSyntaxErrorCaughtByError.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithSyntaxErrorCaughtByError.as new file mode 100644 index 00000000000..068bfcdb050 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithSyntaxErrorCaughtByError.as @@ -0,0 +1,72 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Testing try block with multiple catch blocks, the catch block with parameter of type Error catching the Syntax error when there is not catch block defined with a parameter of type SyntaxError Syntax Errors are parser errors and cannot be caught by the try and catch block. They are thrown during compilation time. This test is to test throw statement throwing error of type syntax error and whether the particular catch block handles it/ignores it or are caught by the catch block with parameter of some other type other than type Syntax error"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +thisError = "no error"; + +try { + throw new SyntaxError(); + } catch(e:ReferenceError){ + thisError="This is Reference Error"; + }catch(e1:ArgumentError){ + thisError="This is Argument Error"; + }catch(e2:URIError){ + thisError="This is URI Error"; + }catch(e3:EvalError){ + thisError="This is Eval Error"; + }catch(e4:RangeError){ + thisError="This is Range Error"; + }catch(e4:TypeError){ + thisError="This is Type Error"; + }catch(e5:SecurityError){ + thisError="This is security Error"; + }catch(e6:DefinitionError){ + thisError="This is Definition Error"; + }catch(e7:UninitializedError){ + thisError="This is Uninitialized Error"; + }catch(e9:VerifyError){ + thisError="This is Verify Error"; + }catch(e10:Error){ + thisError = e10.toString(); + }finally{ + AddTestCase( "Testing try block with throw statement", "Error: SyntaxError" ,Error(thisError)+"" ); + } + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithTwoType.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithTwoType.as new file mode 100644 index 00000000000..128228a3c04 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithTwoType.as @@ -0,0 +1,79 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + +import MultipleCatchBlocksWithTwoType.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Testing try block with multiple catch blocks and using a catch block with parameter of type TypeError to catch the type error"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var z = new TypeErrors(); +thisError = "no error"; +thisError1 = "no error"; +try{ + z.MyArgumentError(6); + }catch(e:ReferenceError){ + thisError=e.toString(); + }catch(e1:TypeError){ + thisError=e1.toString(); + }catch(e2:ArgumentError){ + thisError=e2.toString(); + }catch(e3:URIError){ + thisError=e3.toString() + }catch(e4:UninitializedError){ + thisError=e4.toString(); + }catch(e5:EvalError){ + thisError=e5.toString(); + }catch(e6:RangeError){ + thisError=e6.toString(); + }catch(e7:DefinitionError){ + thisError="This is Definition Error"; + }catch(e8:SyntaxError){ + thisError="This is Syntax Error"; + }catch(e9:VerifyError){ + thisError="This is Verify Error"; + }catch(e10:Error){//print(e10.toString()); + thisError1=e10.toString(); + }finally{//print(thisError1); + AddTestCase( "Testing catch block with Type Error", "TypeError: Error #1009" ,typeError(thisError)+"" ); + AddTestCase( "Testing catch block with Type Error", "no error" ,typeError(thisError1)+"" ); + } + + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithTwoType/TypeErrors.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithTwoType/TypeErrors.as new file mode 100644 index 00000000000..ff04d122f3c --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithTwoType/TypeErrors.as @@ -0,0 +1,48 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package MultipleCatchBlocksWithTwoType +{ + public class TypeErrors + { + var a:Number; + + public function MyArgumentError(a):String + { + var m:String; + m.k(); + return 6; + + } + + + } + +} diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithURI1.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithURI1.as new file mode 100644 index 00000000000..35b81c3b151 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithURI1.as @@ -0,0 +1,74 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Testing try block with multiple catch blocks, the catch block with parameter of type URIError catching the URI error "; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +thisError = "no error"; + +try { + throw new URIError(); + } catch(e:ReferenceError){ + thisError="This is Reference Error"; + }catch(e1:ArgumentError){ + thisError="This is Argument Error"; + }catch(e2:URIError){ + thisError="This is URI Error"; + }catch(e3:EvalError){ + thisError="This is Eval Error"; + }catch(e4:RangeError){ + thisError="This is Range Error"; + }catch(e4:TypeError){ + thisError="This is Type Error"; + }catch(e5:SecurityError){ + thisError="This is security Error"; + }catch(e6:DefinitionError){ + thisError="This is Definition Error"; + }catch(e7:UninitializedError){ + thisError="This is Uninitialized Error"; + }catch(e8:SyntaxError){ + thisError="This is Syntax Error"; + }catch(e9:VerifyError){ + thisError="This is Verify Error"; + }catch(e10:Error){ + thisError = e10.toString(); + }finally{ + AddTestCase( "Testing try block with throw statement", "This is URI Error" ,thisError ); + } + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithURICaughtByError.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithURICaughtByError.as new file mode 100644 index 00000000000..0712310d142 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithURICaughtByError.as @@ -0,0 +1,72 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Testing try block with multiple catch blocks, the catch block with parameter of type Error catching the URI error when no catch block with parameter of type URIError is defined"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +thisError = "no error"; + +try { + throw new URIError(); + } catch(e:ReferenceError){ + thisError="This is Reference Error"; + }catch(e1:ArgumentError){ + thisError="This is Argument Error"; + }catch(e3:EvalError){ + thisError="This is Eval Error"; + }catch(e4:RangeError){ + thisError="This is Range Error"; + }catch(e4:TypeError){ + thisError="This is Type Error"; + }catch(e5:SecurityError){ + thisError="This is security Error"; + }catch(e6:DefinitionError){ + thisError="This is Definition Error"; + }catch(e7:UninitializedError){ + thisError="This is Uninitialized Error"; + }catch(e8:SyntaxError){ + thisError="This is Syntax Error"; + }catch(e9:VerifyError){ + thisError="This is Verify Error"; + }catch(e10:Error){ + thisError = e10.toString(); + }finally{ + AddTestCase( "Testing try block with throw statement", "Error: URIError" ,Error(thisError)+"" ); + } + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithUninitialized1.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithUninitialized1.as new file mode 100644 index 00000000000..5fe3e00fd85 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithUninitialized1.as @@ -0,0 +1,70 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Testing try block with multiple catch blocks, the catch block with parameter of type UninitializedError catching the Uninitialized error "; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +thisError = "no error"; + +try { + throw new UninitializedError(); + } catch(e:ReferenceError){ + thisError="This is Reference Error"; + }catch(e1:ArgumentError){ + thisError="This is Argument Error"; + }catch(e2:URIError){ + thisError="This is URI Error"; + }catch(e3:EvalError){ + thisError="This is Eval Error"; + }catch(e4:RangeError){ + thisError="This is Range Error"; + }catch(e4:TypeError){ + thisError="This is Type Error"; + }catch(e5:SecurityError){ + thisError="This is security Error"; + }catch(e6:DefinitionError){ + thisError="This is Definition Error"; + }catch(e7:UninitializedError){ + thisError="This is Uninitialized Error"; + }catch(e8:Error){ + thisError = e8.toString(); + }finally{//print(thisError); +AddTestCase( "Testing try block with throw statement", "This is Uninitialized Error" ,thisError ); + } + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithUnitializedCaughtWithError.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithUnitializedCaughtWithError.as new file mode 100644 index 00000000000..4b237a39286 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithUnitializedCaughtWithError.as @@ -0,0 +1,68 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Testing try block with multiple catch blocks, the catch block with parameter of type Error catching the Uninitialized error when a catch block with Uninitialized type error is not defined"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +thisError = "no error"; + +try { + throw new UninitializedError(); + } catch(e:ReferenceError){ + thisError="This is Reference Error"; + }catch(e1:ArgumentError){ + thisError="This is Argument Error"; + }catch(e2:URIError){ + thisError="This is URI Error"; + }catch(e3:EvalError){ + thisError="This is Eval Error"; + }catch(e4:RangeError){ + thisError="This is Range Error"; + }catch(e4:TypeError){ + thisError="This is Type Error"; + }catch(e5:SecurityError){ + thisError="This is security Error"; + }catch(e6:DefinitionError){ + thisError="This is Definition Error"; + }catch(e8:Error){ + thisError = e8.toString(); + }finally{ + AddTestCase( "Testing try block with throw statement", "Error: UninitializedError" ,Error(thisError)+"" ); + } + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithVerify1.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithVerify1.as new file mode 100644 index 00000000000..29e9fa6d05a --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithVerify1.as @@ -0,0 +1,74 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Testing try block with multiple catch blocks, the catch block with parameter of type VerifyError catching the Verify error Normally verifyError cannot be caught by try and catch block. As it is usually during the link time after the compiler parses the program and before runtime This test case is to test whether the catch block with parameter of type verifyError catches it/ignores the error/catches some other error when the throw statement throws an error of VerifyError"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +thisError = "no error"; + +try { + throw new VerifyError(); + } catch(e:ReferenceError){ + thisError="This is Reference Error"; + }catch(e1:ArgumentError){ + thisError="This is Argument Error"; + }catch(e2:URIError){ + thisError="This is URI Error"; + }catch(e3:EvalError){ + thisError="This is Eval Error"; + }catch(e4:RangeError){ + thisError="This is Range Error"; + }catch(e4:TypeError){ + thisError="This is Type Error"; + }catch(e5:SecurityError){ + thisError="This is security Error"; + }catch(e6:DefinitionError){ + thisError="This is Definition Error"; + }catch(e7:UninitializedError){ + thisError="This is Uninitialized Error"; + }catch(e8:SyntaxError){ + thisError="This is Syntax Error"; + }catch(e9:VerifyError){ + thisError="This is Verify Error"; + }catch(e10:Error){ + thisError = e10.toString(); + }finally{ + AddTestCase( "Testing try block with throw statement", "This is Verify Error" ,thisError ); + } + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithVerifyCaughtByError.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithVerifyCaughtByError.as new file mode 100644 index 00000000000..b6cd526a1f4 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/MultipleCatchBlocksWithVerifyCaughtByError.as @@ -0,0 +1,72 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Testing try block with multiple catch blocks, the catch block with parameter of type Error catching the Verify error When no catch block with parameter of type Verify Error is defined Normally verifyError cannot be caught by try and catch block. As it is usually during the link time after the compiler parses the program and before runtime. This testcase is to test what happens when the throw statement throws an error of type verifyError, whether the catch block ignores it/caught by the catch block with parameter of some other error type other than verifyError. "; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +thisError = "no error"; + +try { + throw new VerifyError(); + } catch(e:ReferenceError){ + thisError="This is Reference Error"; + }catch(e1:ArgumentError){ + thisError="This is Argument Error"; + }catch(e2:URIError){ + thisError="This is URI Error"; + }catch(e3:EvalError){ + thisError="This is Eval Error"; + }catch(e4:RangeError){ + thisError="This is Range Error"; + }catch(e4:TypeError){ + thisError="This is Type Error"; + }catch(e5:SecurityError){ + thisError="This is security Error"; + }catch(e6:DefinitionError){ + thisError="This is Definition Error"; + }catch(e7:UninitializedError){ + thisError="This is Uninitialized Error"; + }catch(e8:SyntaxError){ + thisError="This is Syntax Error"; + }catch(e10:Error){ + thisError = e10.toString(); + }finally{ + AddTestCase( "Testing try block with throw statement", "Error: VerifyError" ,Error(thisError)+"" ); + } + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryBlockWithMultipleCatchBlocksTypeWithNoInnerCatchType.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryBlockWithMultipleCatchBlocksTypeWithNoInnerCatchType.as new file mode 100644 index 00000000000..8303dffa0d1 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryBlockWithMultipleCatchBlocksTypeWithNoInnerCatchType.as @@ -0,0 +1,83 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Testing try block with multiple catch blocks, the first catch block catching the type error"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +thisError = "no error"; +thisError1="no error"; +try{ + throw new ReferenceError(); +}catch(eo:ReferenceError){ + thisError1 = "This is outer reference error:"+eo.toString(); + //print(thisError1); + try { + throw new TypeError(); + }catch(ei1:ReferenceError){ + thisError="Inner reference error:"+ei1.toString(); + }catch(ei2:URIError){ + thisError="This is inner URI Error:"+ei2.toString(); + }catch(ei3:EvalError){ + thisError="This is inner Eval Error:"+ei3.toString(); + }catch(ei4:RangeError){ + thisError="This is inner Range Error:"+ei4.toString(); + }catch(ei5:SecurityError){ + thisError="This is inner Security Error!!!"+ei5.toString(); + }catch(ei6:ArgumentError){ + thisError="This is inner Argument Error"+ei6.toString(); + } +}catch(eo1:TypeError){ + thisError1="This is outer TypeError:"+eo1.toString(); +}catch(eo2:ArgumentError){ + thisError1="This is outer Argument Error"+eo2.toString(); +}catch(eo3:URIError){ + thisError1="This is outer URI Error"+eo3.toString(); +}catch(eo4:EvalError){ + thisError1="This is outer Eval Error"+eo4.toString(); +}catch(eo5:RangeError){ + thisError1="This is outer Range Error"+eo5.toString(); +}catch(eo6:SecurityError){ + thisError1="This is outer Security Error!!!"+eo6.toString(); +}catch(eo7:Error){ + thisError1="This is outer Error:"+eo7.toString(); +}finally{ + AddTestCase( "Testing Nested try block with multiple catch block inside the first catch block of the outer try block", "This is outer finally:This is outer reference error:ReferenceError","This is outer finally:"+thisError1+"" ); + test(); +} +// Move test() to finally block above since we'll never reach the line below because +// the thrown TypeError is never caught. +//test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryBlockWithMultipleCatchRefType.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryBlockWithMultipleCatchRefType.as new file mode 100644 index 00000000000..2421147fc68 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryBlockWithMultipleCatchRefType.as @@ -0,0 +1,88 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Testing try block with multiple catch blocks, the first catch block catching the type error"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +thisError = "no error"; +thisError1="no error"; +try{ + throw new ReferenceError(); + }catch(eo:ReferenceError){ + thisError1 = "This is outer reference error:"+" "+eo.toString(); + + try { + throw new TypeError(); + }catch(ei:TypeError){ + thisError="This is Inner Type Error:"+ei.toString(); + //print(thisError); + }catch(ei1:ReferenceError){ + thisError="Inner reference error:"+ei1.toString(); + }catch(ei2:URIError){ + thisError="This is inner URI Error:"+ei2.toString(); + }catch(ei3:EvalError){ + thisError="This is inner Eval Error:"+ei3.toString(); + }catch(ei4:RangeError){ + thisError="This is inner Range Error:"+ei4.toString(); + }catch(ei5:SecurityError){ + thisError="This is inner Security Error!!!"+ei5.toString(); + }catch(ei6:ArgumentError){ + thisError="This is inner Argument Error"+ei6.toString(); + }finally{ + AddTestCase( "Testing Nested try block with multiple catch block inside the first catch block of the outer try block","This is inner finally:This is Inner Type Error:TypeError","This is inner finally:"+thisError ); + } + }catch(eo1:TypeError){ + thisError1="This is outer TypeError:"+eo1.toString(); + }catch(eo2:ArgumentError){ + thisError1="This is outer Argument Error"+eo2.toString(); + }catch(eo3:URIError){ + thisError1="This is outer URI Error"+eo3.toString(); + }catch(eo4:EvalError){ + thisError1="This is outer Eval Error"+eo4.toString(); + }catch(eo5:RangeError){ + thisError1="This is outer Range Error"+eo5.toString(); + }catch(eo6:SecurityError){ + thisError1="This is outer Security Error!!!"+eo6.toString(); + }catch(eo7:Error){ + thisError1="This is outer Error:"+eo7.toString(); + }finally{ + AddTestCase( "Testing Nested try block with multiple catch block inside the first catch block of the outer try block", "This is outer finally:This is outer reference error: ReferenceError","This is outer finally:"+ thisError1 ); + } + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryWithMulitpleCatchInsideEighthCatch.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryWithMulitpleCatchInsideEighthCatch.as new file mode 100644 index 00000000000..ece3cb8cd52 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryWithMulitpleCatchInsideEighthCatch.as @@ -0,0 +1,91 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Testing try block with multiple catch blocks, the eighth catch block catching the type error"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +thisError = "no error"; +thisError1="no error"; +try{ + throw Error("This is an error"); + }catch(eo:ReferenceError){ + thisError1 = "This is outer Reference error:"+" "+eo.toString(); + //print(thisError1); + }catch(eo1:TypeError){ + thisError1="This is outer TypeError:"+eo1.toString(); + //print(thisError1); + }catch(eo2:ArgumentError){ + thisError1="This is outer Argument Error:"+eo2.toString(); + //print(thisError1); + }catch(eo3:URIError){ + thisError1="This is outer URI Error:"+eo3.toString(); + }catch(eo4:EvalError){ + thisError1="This is outer Eval Error:"+eo4.toString(); + }catch(eo5:RangeError){ + thisError1="This is outer Range Error:"+eo5.toString(); + }catch(eo6:SecurityError){ + thisError1="This is outer Security Error!!!"+eo6.toString(); + }catch(eo7:Error){ + thisError1="This is outer Error:"+eo7.toString(); + //print("This is outer error:"+eo7.toString()); + try { + throw new TypeError(); + }catch(ei:TypeError){ + thisError="This is Inner Type Error:"+ei.toString(); + //print(thisError); + }catch(ei1:ReferenceError){ + thisError="Inner reference error:"+ei1.toString(); + }catch(ei2:URIError){ + thisError="This is inner URI Error:"+ei2.toString(); + }catch(ei3:EvalError){ + thisError="This is inner Eval Error:"+ei3.toString(); + }catch(ei4:RangeError){ + thisError="This is inner Range Error:"+ei4.toString(); + }catch(ei5:SecurityError){ + thisError="This is inner Security Error!!!"+ei5.toString(); + }catch(ei6:ArgumentError){ + thisError="This is inner Argument Error"+ei6.toString(); + }finally{ + AddTestCase( "Testing Nested try block with multiple catch block inside the eighth catch block of the outer try block","This is inner finally:This is Inner Type Error:TypeError","This is inner finally:"+thisError ); + } + }finally{ + AddTestCase( "Testing Nested try block with multiple catch block inside the eighth catch block of the outer try block", "This is outer finally:This is outer Error:Error: This is an error","This is outer finally:"+ thisError1 ); + } + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryWithMulitpleCatchInsideFifthCatch.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryWithMulitpleCatchInsideFifthCatch.as new file mode 100644 index 00000000000..00ba01dc916 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryWithMulitpleCatchInsideFifthCatch.as @@ -0,0 +1,90 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Testing try block with multiple catch blocks, the fifth catch block catching the type error"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +thisError = "no error"; +thisError1="no error"; +try{ + throw new EvalError(); + }catch(eo:ReferenceError){ + thisError1 = "This is outer Reference error:"+" "+eo.toString(); + //print(thisError1); + }catch(eo1:TypeError){ + thisError1="This is outer TypeError:"+eo1.toString();//print(thisError1); + }catch(eo2:ArgumentError){ + thisError1="This is outer Argument Error:"+eo2.toString();//print(thisError1); + + }catch(eo3:URIError){ + thisError1="This is outer URI Error:"+eo3.toString(); + + }catch(eo4:EvalError){ + thisError1="This is outer Eval Error:"+eo4.toString(); + try { + throw new TypeError(); + }catch(ei:TypeError){ + thisError="This is Inner Type Error:"+ei.toString(); + //print(thisError); + }catch(ei1:ReferenceError){ + thisError="Inner reference error:"+ei1.toString(); + }catch(ei2:URIError){ + thisError="This is inner URI Error:"+ei2.toString(); + }catch(ei3:EvalError){ + thisError="This is inner Eval Error:"+ei3.toString(); + }catch(ei4:RangeError){ + thisError="This is inner Range Error:"+ei4.toString(); + }catch(ei5:SecurityError){ + thisError="This is inner Security Error!!!"+ei5.toString(); + }catch(ei6:ArgumentError){ + thisError="This is inner Argument Error"+ei6.toString(); + }finally{ + AddTestCase( "Testing Nested try block with multiple catch block inside the fifth catch block of the outer try block","This is inner finally:This is Inner Type Error:TypeError","This is inner finally:"+thisError ); + } + }catch(eo5:RangeError){ + thisError1="This is outer Range Error"+eo5.toString(); + }catch(eo6:SecurityError){ + thisError1="This is outer Security Error!!!"+eo6.toString(); + }catch(eo7:Error){ + thisError1="This is outer Error:"+eo7.toString(); + }finally{ + AddTestCase( "Testing Nested try block with multiple catch block inside the fifth catch block of the outer try block", "This is outer finally:This is outer Eval Error:EvalError","This is outer finally:"+ thisError1 ); + } + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryWithMulitpleCatchInsideSeventhCatch.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryWithMulitpleCatchInsideSeventhCatch.as new file mode 100644 index 00000000000..301c98720f8 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryWithMulitpleCatchInsideSeventhCatch.as @@ -0,0 +1,90 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Testing try block with multiple catch blocks, the seventh catch block catching the type error"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +thisError = "no error"; +thisError1="no error"; +try{ + throw new SecurityError(); + }catch(eo:ReferenceError){ + thisError1 = "This is outer Reference error:"+" "+eo.toString(); + //print(thisError1); + }catch(eo1:TypeError){ + thisError1="This is outer TypeError:"+eo1.toString(); + //print(thisError1); + }catch(eo2:ArgumentError){ + thisError1="This is outer Argument Error:"+eo2.toString(); + //print(thisError1); + }catch(eo3:URIError){ + thisError1="This is outer URI Error:"+eo3.toString(); + }catch(eo4:EvalError){ + thisError1="This is outer Eval Error:"+eo4.toString(); + }catch(eo5:RangeError){ + thisError1="This is outer Range Error:"+eo5.toString(); + }catch(eo6:SecurityError){ + thisError1="This is outer Security Error!!!:"+eo6.toString(); + try { + throw new TypeError(); + }catch(ei:TypeError){ + thisError="This is Inner Type Error:"+ei.toString(); + //print(thisError); + }catch(ei1:ReferenceError){ + thisError="Inner reference error:"+ei1.toString(); + }catch(ei2:URIError){ + thisError="This is inner URI Error:"+ei2.toString(); + }catch(ei3:EvalError){ + thisError="This is inner Eval Error:"+ei3.toString(); + }catch(ei4:RangeError){ + thisError="This is inner Range Error:"+ei4.toString(); + }catch(ei5:SecurityError){ + thisError="This is inner Security Error!!!"+ei5.toString(); + }catch(ei6:ArgumentError){ + thisError="This is inner Argument Error"+ei6.toString(); + }finally{ + AddTestCase( "Testing Nested try block with multiple catch block inside the seventh catch block of the outer try block","This is inner finally:This is Inner Type Error:TypeError","This is inner finally:"+thisError ); + } + }catch(eo7:Error){ + thisError1="This is outer error:"+eo7.toString(); + }finally{ + AddTestCase( "Testing Nested try block with multiple catch block inside the seventh catch block of the outer try block", "This is outer finally:This is outer Security Error!!!:SecurityError","This is outer finally:"+ thisError1 ); + } + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryWithMulitpleCatchInsideSixthCatch.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryWithMulitpleCatchInsideSixthCatch.as new file mode 100644 index 00000000000..699b653ada9 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryWithMulitpleCatchInsideSixthCatch.as @@ -0,0 +1,90 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Testing try block with multiple catch blocks, the sixth catch block catching the type error"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +thisError = "no error"; +thisError1="no error"; +try{ + throw new RangeError(); + }catch(eo:ReferenceError){ + thisError1 = "This is outer Reference error:"+" "+eo.toString(); + //print(thisError1); + }catch(eo1:TypeError){ + thisError1="This is outer TypeError:"+eo1.toString(); + //print(thisError1); + }catch(eo2:ArgumentError){ + thisError1="This is outer Argument Error:"+eo2.toString(); + //print(thisError1); + }catch(eo3:URIError){ + thisError1="This is outer URI Error:"+eo3.toString(); + }catch(eo4:EvalError){ + thisError1="This is outer Eval Error:"+eo4.toString(); + }catch(eo5:RangeError){ + thisError1="This is outer Range Error:"+eo5.toString(); + try { + throw new TypeError(); + }catch(ei:TypeError){ + thisError="This is Inner Type Error:"+ei.toString(); + //print(thisError); + }catch(ei1:ReferenceError){ + thisError="Inner reference error:"+ei1.toString(); + }catch(ei2:URIError){ + thisError="This is inner URI Error:"+ei2.toString(); + }catch(ei3:EvalError){ + thisError="This is inner Eval Error:"+ei3.toString(); + }catch(ei4:RangeError){ + thisError="This is inner Range Error:"+ei4.toString(); + }catch(ei5:SecurityError){ + thisError="This is inner Security Error!!!"+ei5.toString(); + }catch(ei6:ArgumentError){ + thisError="This is inner Argument Error"+ei6.toString(); + }finally{ + AddTestCase( "Testing Nested try block with multiple catch block inside the sixth catch block of the outer try block","This is inner finally:This is Inner Type Error:TypeError","This is inner finally:"+thisError ); + } + }catch(eo6:SecurityError){ + thisError1="This is outer Security Error!!!"+eo6.toString(); + }catch(eo7:Error){ + thisError1="This is outer Error:"+eo7.toString(); + }finally{ + AddTestCase( "Testing Nested try block with multiple catch block inside the sixth catch block of the outer try block", "This is outer finally:This is outer Range Error:RangeError","This is outer finally:"+ thisError1 ); + } + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryWithMultipleCatchInsideFinally.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryWithMultipleCatchInsideFinally.as new file mode 100644 index 00000000000..a09d1a35498 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryWithMultipleCatchInsideFinally.as @@ -0,0 +1,89 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Testing nested try block with multiple catch blocks, the inner try and multiple catch blocks inside the finally block of the outer try block"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +thisError = "no error"; +thisError1="no error"; +try{ + throw new ReferenceError(); + + }catch(eo:ReferenceError){ + thisError1 = "This is outer reference error:"+eo.toString(); + //print(thisError1); + }catch(eo1:TypeError){ + thisError1="This is outer TypeError:"+eo1.toString(); + }catch(eo2:ArgumentError){ + thisError1="This is outer Argument Error"+eo2.toString(); + }catch(eo3:URIError){ + thisError1="This is outer URI Error"+eo3.toString(); + }catch(eo4:EvalError){ + thisError1="This is outer Eval Error"+eo4.toString(); + }catch(eo5:RangeError){ + thisError1="This is outer Range Error"+eo5.toString(); + }catch(eo6:SecurityError){ + thisError1="This is outer Security Error!!!"+eo6.toString(); + }catch(eo7:Error){ + thisError1="This is outer Error:"+eo7.toString(); + }finally{ + AddTestCase( "Testing Nested try block with multiple catch block inside the finally block of the outer try block","This is outer finally:This is outer reference error:ReferenceError","This is outer finally:"+thisError1 ); + try { + throw new TypeError(); + }catch(ei:TypeError){ + thisError="This is Inner Type Error:"+ei.toString(); + //print(thisError); + }catch(ei1:ReferenceError){ + thisError="Inner reference error:"+ei1.toString(); + }catch(ei2:URIError){ + thisError="This is inner URI Error:"+ei2.toString(); + }catch(ei3:EvalError){ + thisError="This is inner Eval Error:"+ei3.toString(); + }catch(ei4:RangeError){ + thisError="This is inner Range Error:"+ei4.toString(); + }catch(ei5:SecurityError){ + thisError="This is inner Security Error!!!"+ei5.toString(); + }catch(ei6:ArgumentError){ + thisError="This is inner Argument Error"+ei6.toString(); + }finally{ + AddTestCase( "Testing Nested try block with multiple catch block inside the finally block of the inner try block","This is inner finally:This is Inner Type Error:TypeError","This is inner finally:"+thisError ); + } + } + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryWithMultipleCatchInsideFinallyExceptionBubbling.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryWithMultipleCatchInsideFinallyExceptionBubbling.as new file mode 100644 index 00000000000..9029fa8de2c --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryWithMultipleCatchInsideFinallyExceptionBubbling.as @@ -0,0 +1,78 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + +import NestedTryWithMultipleCatchInsideFinallyExceptionBubbling.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Testing nested try block with multiple catch blocks, inner try and catch blocks inside finally block of the outer try and multiple catch blocks"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +var z:NestedTryWithMultipleCatchInsideFinally = new NestedTryWithMultipleCatchInsideFinally(); +thisError = "no error"; +thisError1 = "no error"; +try{ + z.NestedTryWithMultipleCatchInsideFinallyFunction(); + }catch(eo:ReferenceError){ + thisError=eo.toString(); + }catch(eo1:TypeError){ + thisError="This is outer Type Error:"+eo1.toString();//print(thisError); + }catch(eo2:ArgumentError){ + thisError=eo2.toString(); + }catch(eo3:URIError){ + thisError=eo3.toString() + }catch(eo4:UninitializedError){ + thisError=eo4.toString(); + }catch(eo5:EvalError){ + thisError=eo5.toString(); + }catch(eo6:RangeError){ + thisError=eo6.toString(); + }catch(eo7:DefinitionError){ + thisError="This is Definition Error"; + }catch(eo8:SyntaxError){ + thisError="This is Syntax Error"; + }catch(eo9:VerifyError){ + thisError="This is Verify Error"; + }catch(eo10:Error){//print(e10.toString()); + thisError=eo10.toString(); + }finally{//print(eo1.toString()); +AddTestCase( "Testing catch block with Type Error", "This is outer Type Error:TypeError" ,thisError); + } + + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryWithMultipleCatchInsideFinallyExceptionBubbling/NestedTryWithMultipleCatchInsideFinally.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryWithMultipleCatchInsideFinallyExceptionBubbling/NestedTryWithMultipleCatchInsideFinally.as new file mode 100644 index 00000000000..ab556435caf --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryWithMultipleCatchInsideFinallyExceptionBubbling/NestedTryWithMultipleCatchInsideFinally.as @@ -0,0 +1,79 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package NestedTryWithMultipleCatchInsideFinallyExceptionBubbling +{ + public class NestedTryWithMultipleCatchInsideFinally + { + public function NestedTryWithMultipleCatchInsideFinallyFunction():void + { + thisError = "no error"; + thisError1="no error"; + try{ + throw new TypeError(); + + }catch(eo:ReferenceError){ + thisError1 = "This is outer reference error:"+" "+eo.toString(); + //print(thisError1); + }catch(eo2:ArgumentError){ + thisError1="This is outer Argument Error"+eo2.toString(); + }catch(eo3:URIError){ + thisError1="This is outer URI Error"+eo3.toString(); + }catch(eo4:EvalError){ + thisError1="This is outer Eval Error"+eo4.toString(); + }catch(eo5:RangeError){ + thisError1="This is outer Range Error"+eo5.toString(); + }catch(eo6:SecurityError){ + thisError1="This is outer Security Error!!!"+eo6.toString(); + }finally{ + try{ + throw new TypeError(); + }catch(ei:TypeError){ + thisError="This is Inner Type Error:"+ei.toString(); + //print(thisError); + }catch(ei1:ReferenceError){ + thisError="Inner reference error:"+ei1.toString(); + }catch(ei2:URIError){ + thisError="This is inner URI Error:"+ei2.toString(); + }catch(ei3:EvalError){ + thisError="This is inner Eval Error:"+ei3.toString(); + }catch(ei4:RangeError){ + thisError="This is inner Range Error:"+ei4.toString(); + }catch(ei5:SecurityError){ + thisError="This is inner Security Error!!!"+ei5.toString(); + }catch(ei6:ArgumentError){ + thisError="This is inner Argument Error"+ei6.toString(); + }finally{ + + } + } + } + } +} diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryWithMultipleCatchInsideFourthCatch.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryWithMultipleCatchInsideFourthCatch.as new file mode 100644 index 00000000000..d0f4e717e87 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryWithMultipleCatchInsideFourthCatch.as @@ -0,0 +1,90 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Testing nested try block with multiple catch blocks, the inner try and multiple catch block inside the fourth catch block of the outer try and multiple catch blocks"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +thisError = "no error"; +thisError1="no error"; +try{ + throw new URIError(); + }catch(eo:ReferenceError){ + thisError1 = "This is outer Reference error:"+" "+eo.toString(); + //print(thisError1); + }catch(eo1:TypeError){ + thisError1="This is outer TypeError:"+eo1.toString(); + //print(thisError1); + }catch(eo2:ArgumentError){ + thisError1="This is outer Argument Error:"+eo2.toString(); + //print(thisError1); + }catch(eo3:URIError){ + thisError1="This is outer URI Error:"+eo3.toString(); + try { + throw new TypeError(); + }catch(ei:TypeError){ + thisError="This is Inner Type Error:"+ei.toString(); + //print(thisError); + }catch(ei1:ReferenceError){ + thisError="Inner reference error:"+ei1.toString(); + }catch(ei2:URIError){ + thisError="This is inner URI Error:"+ei2.toString(); + }catch(ei3:EvalError){ + thisError="This is inner Eval Error:"+ei3.toString(); + }catch(ei4:RangeError){ + thisError="This is inner Range Error:"+ei4.toString(); + }catch(ei5:SecurityError){ + thisError="This is inner Security Error!!!"+ei5.toString(); + }catch(ei6:ArgumentError){ + thisError="This is inner Argument Error"+ei6.toString(); + }finally{ + AddTestCase( "Testing Nested try block with multiple catch block inside the fourth catch block of the outer try block","This is inner finally:This is Inner Type Error:TypeError","This is inner finally:"+thisError ); + } + }catch(eo4:EvalError){ + thisError1="This is outer Eval Error"+eo4.toString(); + }catch(eo5:RangeError){ + thisError1="This is outer Range Error"+eo5.toString(); + }catch(eo6:SecurityError){ + thisError1="This is outer Security Error!!!"+eo6.toString(); + }catch(eo7:Error){ + thisError1="This is outer Error:"+eo7.toString(); + }finally{ + AddTestCase( "Testing Nested try block with multiple catch block inside the fourth catch block of the outer try block", "This is outer finally:This is outer URI Error:URIError","This is outer finally:"+ thisError1 ); + } + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryWithMultipleCatchInsideFourthCatchWithoutMatchingCatch.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryWithMultipleCatchInsideFourthCatchWithoutMatchingCatch.as new file mode 100644 index 00000000000..b1cb3269893 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryWithMultipleCatchInsideFourthCatchWithoutMatchingCatch.as @@ -0,0 +1,85 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Testing nested try block with multiple catch blocks, the inner try and multiple catch block inside the fourth catch block of the outer try and multiple catch blocks"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +thisError = "no error"; +thisError1="no error"; +try{ + throw new URIError(); +}catch(eo:ReferenceError){ + thisError1 = "This is outer Reference error:"+" "+eo.toString(); + //print(thisError1); +}catch(eo1:TypeError){ + thisError1="This is outer TypeError:"+eo1.toString(); + //print(thisError1); +}catch(eo2:ArgumentError){ + thisError1="This is outer Argument Error:"+eo2.toString(); + //print(thisError1); +}catch(eo3:URIError){ + thisError1="This is outer URI Error:"+eo3.toString(); + try { + throw new TypeError(); + }catch(ei1:ReferenceError){ + thisError="Inner reference error:"+ei1.toString(); + }catch(ei2:URIError){ + thisError="This is inner URI Error:"+ei2.toString(); + }catch(ei3:EvalError){ + thisError="This is inner Eval Error:"+ei3.toString(); + }catch(ei4:RangeError){ + thisError="This is inner Range Error:"+ei4.toString(); + }catch(ei5:SecurityError){ + thisError="This is inner Security Error!!!"+ei5.toString(); + }catch(ei6:ArgumentError){ + thisError="This is inner Argument Error"+ei6.toString(); + } +}catch(eo4:EvalError){ + thisError1="This is outer Eval Error"+eo4.toString(); +}catch(eo5:RangeError){ + thisError1="This is outer Range Error"+eo5.toString(); +}catch(eo6:SecurityError){ + thisError1="This is outer Security Error!!!"+eo6.toString(); +}catch(eo7:Error){ + thisError="This is inner Error:"+eo7.toString(); +}finally{ + AddTestCase( "Testing Nested try block with multiple catch block inside the fourth catch block of the outer try block", "This is outer finally:This is outer URI Error:URIError","This is outer finally:"+ thisError1 ); + test(); +} +// Move test() to finally block above since we'll never reach the line below because +// the thrown TypeError is never caught. +//test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryWithMultipleCatchInsideSecondCatch.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryWithMultipleCatchInsideSecondCatch.as new file mode 100644 index 00000000000..4ce85caae5c --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryWithMultipleCatchInsideSecondCatch.as @@ -0,0 +1,89 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Testing nested try block with multiple catch blocks, the inner try and multiple catch block inside the second catch block of the outer try and multiple catch blocks"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +thisError = "no error"; +thisError1="no error"; +try{ + throw new TypeError(); + }catch(eo:ReferenceError){ + thisError1 = "This is outer Reference error:"+" "+eo.toString(); + //print(thisError1); + }catch(eo1:TypeError){ + thisError1="This is outer TypeError:"+eo1.toString(); + //print(thisError1); + try { + throw new TypeError(); + }catch(ei:TypeError){ + thisError="This is Inner Type Error:"+ei.toString(); + //print(thisError); + }catch(ei1:ReferenceError){ + thisError="Inner reference error:"+ei1.toString(); + }catch(ei2:URIError){ + thisError="This is inner URI Error:"+ei2.toString(); + }catch(ei3:EvalError){ + thisError="This is inner Eval Error:"+ei3.toString(); + }catch(ei4:RangeError){ + thisError="This is inner Range Error:"+ei4.toString(); + }catch(ei5:SecurityError){ + thisError="This is inner Security Error!!!"+ei5.toString(); + }catch(ei6:ArgumentError){ + thisError="This is inner Argument Error"+ei6.toString(); + }finally{ + AddTestCase( "Testing Nested try block with multiple catch block inside the second catch block of the outer try block","This is inner finally:This is Inner Type Error:TypeError","This is inner finally:"+thisError ); + } + }catch(eo2:ArgumentError){ + thisError1="This is outer Argument Error"+eo2.toString(); + }catch(eo3:URIError){ + thisError1="This is outer URI Error"+eo3.toString(); + }catch(eo4:EvalError){ + thisError1="This is outer Eval Error"+eo4.toString(); + }catch(eo5:RangeError){ + thisError1="This is outer Range Error"+eo5.toString(); + }catch(eo6:SecurityError){ + thisError1="This is outer Security Error!!!"+eo6.toString(); + }catch(eo7:Error){ + thisError1="This is outer Error:"+eo7.toString(); + }finally{ + AddTestCase( "Testing Nested try block with multiple catch block inside the second catch block of the outer try block", "This is outer finally:This is outer TypeError:TypeError","This is outer finally:"+ thisError1 ); + } + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryWithMultipleCatchInsideSecondCatchWithoutMatchingCatch.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryWithMultipleCatchInsideSecondCatchWithoutMatchingCatch.as new file mode 100644 index 00000000000..dff3b60621c --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryWithMultipleCatchInsideSecondCatchWithoutMatchingCatch.as @@ -0,0 +1,84 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Testing nested try block with multiple catch blocks, the inner try and multiple catch block inside the second catch block of the outer try and multiple catch blocks"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +thisError = "no error"; +thisError1="no error"; +try{ + throw new TypeError(); +}catch(eo:ReferenceError){ + thisError1 = "This is outer Reference error:"+" "+eo.toString(); + //print(thisError1); +}catch(eo1:TypeError){ + thisError1="This is outer TypeError:"+eo1.toString(); + //print(thisError1); + try { + throw new TypeError(); + }catch(ei1:ReferenceError){ + thisError="Inner reference error:"+ei1.toString(); + }catch(ei2:URIError){ + thisError="This is inner URI Error:"+ei2.toString(); + }catch(ei3:EvalError){ + thisError="This is inner Eval Error:"+ei3.toString(); + }catch(ei4:RangeError){ + thisError="This is inner Range Error:"+ei4.toString(); + }catch(ei5:SecurityError){ + thisError="This is inner Security Error!!!"+ei5.toString(); + }catch(ei6:ArgumentError){ + thisError="This is inner Argument Error"+ei6.toString(); + } +}catch(eo2:ArgumentError){ + thisError1="This is outer Argument Error"+eo2.toString(); +}catch(eo3:URIError){ + thisError1="This is outer URI Error"+eo3.toString(); +}catch(eo4:EvalError){ + thisError1="This is outer Eval Error"+eo4.toString(); +}catch(eo5:RangeError){ + thisError1="This is outer Range Error"+eo5.toString(); +}catch(eo6:SecurityError){ + thisError1="This is outer Security Error!!!"+eo6.toString(); +}catch(eo7:Error){ + thisError="This is inner Error:"+eo7.toString(); +}finally{ + AddTestCase( "Testing Nested try block with multiple catch block inside the second catch block of the outer try block", "This is outer finally:This is outer TypeError:TypeError","This is outer finally:"+ thisError1 ); + test(); +} +// Move test() to finally block above since we'll never reach the line below because +// the thrown TypeError is never caught. +//test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryWithMultipleCatchInsideThirdCatch.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryWithMultipleCatchInsideThirdCatch.as new file mode 100644 index 00000000000..2eac9089c4a --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryWithMultipleCatchInsideThirdCatch.as @@ -0,0 +1,89 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Testing nested try block with multiple catch blocks, the inner try and multiple catch block inside the third catch block of the outer try and multiple catch blocks"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +thisError = "no error"; +thisError1="no error"; +try{ + throw new ArgumentError(); + }catch(eo:ReferenceError){ + thisError1 = "This is outer Reference error:"+" "+eo.toString(); + //print(thisError1); + }catch(eo1:TypeError){ + thisError1="This is outer TypeError:"+eo1.toString();//print(thisError1); + }catch(eo2:ArgumentError){ + thisError1="This is outer Argument Error:"+eo2.toString();//print(thisError1); + try { + throw new TypeError(); + }catch(ei:TypeError){ + thisError="This is Inner Type Error:"+ei.toString(); + //print(thisError); + }catch(ei1:ReferenceError){ + thisError="Inner reference error:"+ei1.toString(); + }catch(ei2:URIError){ + thisError="This is inner URI Error:"+ei2.toString(); + }catch(ei3:EvalError){ + thisError="This is inner Eval Error:"+ei3.toString(); + }catch(ei4:RangeError){ + thisError="This is inner Range Error:"+ei4.toString(); + }catch(ei5:SecurityError){ + thisError="This is inner Security Error!!!"+ei5.toString(); + }catch(ei6:ArgumentError){ + thisError="This is inner Argument Error"+ei6.toString(); + }finally{ + AddTestCase( "Testing Nested try block with multiple catch block inside the third catch block of the outer try block","This is inner finally:This is Inner Type Error:TypeError","This is inner finally:"+thisError ); + + } + }catch(eo3:URIError){ + thisError1="This is outer URI Error"+eo3.toString(); + }catch(eo4:EvalError){ + thisError1="This is outer Eval Error"+eo4.toString(); + }catch(eo5:RangeError){ + thisError1="This is outer Range Error"+eo5.toString(); + }catch(eo6:SecurityError){ + thisError1="This is outer Security Error!!!"+eo6.toString(); + }catch(eo7:Error){ + thisError1="This is outer Error:"+eo7.toString(); + }finally{ + AddTestCase( "Testing Nested try block with multiple catch block inside the third catch block of the outer try block", "This is outer finally:This is outer Argument Error:ArgumentError","This is outer finally:"+ thisError1 ); + } + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryWithMultipleCatchInsideThirdCatchWithoutMatchingCatch.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryWithMultipleCatchInsideThirdCatchWithoutMatchingCatch.as new file mode 100644 index 00000000000..f549117f27d --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryWithMultipleCatchInsideThirdCatchWithoutMatchingCatch.as @@ -0,0 +1,83 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Testing nested try block with multiple catch blocks, the inner try and multiple catch block inside the third catch block of the outer try and multiple catch blocks"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +thisError = "no error"; +thisError1="no error"; +try{ + throw new ArgumentError(); +}catch(eo:ReferenceError){ + thisError1 = "This is outer Reference error:"+" "+eo.toString(); + //print(thisError1); +}catch(eo1:TypeError){ + thisError1="This is outer TypeError:"+eo1.toString(); + //print(thisError1); +}catch(eo2:ArgumentError){ + thisError1="This is outer Argument Error:"+eo2.toString(); + //print(thisError1); + try { + throw new EvalError(); + }catch(ei1:ReferenceError){ + thisError="Inner reference error:"+ei1.toString(); + }catch(ei2:URIError){ + thisError="This is inner URI Error:"+ei2.toString(); + }catch(ei3:EvalError){ + thisError="This is inner Eval Error:"+ei3.toString(); + }catch(ei4:RangeError){ + thisError="This is inner Range Error:"+ei4.toString(); + }catch(ei5:SecurityError){ + thisError="This is inner Security Error!!!"+ei5.toString(); + }catch(ei6:ArgumentError){ + thisError="This is inner Argument Error"+ei6.toString(); + } +}catch(eo3:URIError){ + thisError1="This is outer URI Error"+eo3.toString(); +}catch(eo4:EvalError){ + thisError1="This is outer Eval Error"+eo4.toString(); +}catch(eo5:RangeError){ + thisError1="This is outer Range Error"+eo5.toString(); +}catch(eo6:SecurityError){ + thisError1="This is outer Security Error!!!"+eo6.toString(); +}catch(eo7:Error){ + thisError="This is inner Error:"+eo7.toString(); +}finally{ + AddTestCase( "Testing Nested try block with multiple catch block inside the third catch block of the outer try block", "This is outer finally:This is outer Argument Error:ArgumentError","This is outer finally:"+ thisError1 ); +} + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryWithMultipleCatchInsideTry.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryWithMultipleCatchInsideTry.as new file mode 100644 index 00000000000..b216b74e057 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryWithMultipleCatchInsideTry.as @@ -0,0 +1,88 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Testing nested try block with multiple catch blocks, the inner try and multiple catch block inside the try block of the outer try and multiple catch blocks"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +thisError = "no error"; +thisError1="no error"; +try{ + //throw new ReferenceError(); + try { + throw new TypeError(); + }catch(ei:TypeError){ + thisError="This is Inner Type Error:"+ei.toString(); + //print(thisError); + }catch(ei1:ReferenceError){ + thisError="Inner reference error:"+ei1.toString(); + }catch(ei2:URIError){ + thisError="This is inner URI Error:"+ei2.toString(); + }catch(ei3:EvalError){ + thisError="This is inner Eval Error:"+ei3.toString(); + }catch(ei4:RangeError){ + thisError="This is inner Range Error:"+ei4.toString(); + }catch(ei5:SecurityError){ + thisError="This is inner Security Error!!!"+ei5.toString(); + }catch(ei6:ArgumentError){ + thisError="This is inner Argument Error"+ei6.toString(); + }finally{ + AddTestCase( "Testing Nested try block with multiple catch block inside the try block of the outer try block","This is inner finally:This is Inner Type Error:TypeError","This is inner finally:"+thisError ); + } + }catch(eo:ReferenceError){ + thisError1 = "This is outer reference error:"+" "+eo.toString(); + //print(thisError1); + }catch(eo1:TypeError){ + thisError1="This is outer TypeError:"+eo1.toString(); + }catch(eo2:ArgumentError){ + thisError1="This is outer Argument Error"+eo2.toString(); + }catch(eo3:URIError){ + thisError1="This is outer URI Error"+eo3.toString(); + }catch(eo4:EvalError){ + thisError1="This is outer Eval Error"+eo4.toString(); + }catch(eo5:RangeError){ + thisError1="This is outer Range Error"+eo5.toString(); + }catch(eo6:SecurityError){ + thisError1="This is outer Security Error!!!"+eo6.toString(); + }catch(eo7:Error){ + thisError1="This is outer Error:"+eo7.toString(); + }finally{ + + } + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryWithMultipleCatchInsideTryWithoutMatchingCatch.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryWithMultipleCatchInsideTryWithoutMatchingCatch.as new file mode 100644 index 00000000000..4d1a2690082 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/NestedTryWithMultipleCatchInsideTryWithoutMatchingCatch.as @@ -0,0 +1,84 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Testing nested try block with multiple catch blocks, the inner try and multiple catch block inside the try block of the outer try and multiple catch blocks"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +thisError = "no error"; +thisError1="no error"; +try{ + //throw new ReferenceError(); + try { + throw new TypeError(); + }catch(ei1:ReferenceError){ + thisError="Inner reference error:"+ei1.toString(); + }catch(ei2:URIError){ + thisError="This is inner URI Error:"+ei2.toString(); + }catch(ei3:EvalError){ + thisError="This is inner Eval Error:"+ei3.toString(); + }catch(ei4:RangeError){ + thisError="This is inner Range Error:"+ei4.toString(); + }catch(ei5:SecurityError){ + thisError="This is inner Security Error!!!"+ei5.toString(); + }catch(ei6:ArgumentError){ + thisError="This is inner Argument Error"+ei6.toString(); + } + }catch(eo:ReferenceError){ + thisError1 = "This is outer reference error:"+" "+eo.toString(); + //print(thisError1); + }catch(eo1:TypeError){ + thisError1=eo1.toString(); + }catch(eo2:ArgumentError){ + thisError1="This is outer Argument Error"+eo2.toString(); + }catch(eo3:URIError){ + thisError1="This is outer URI Error"+eo3.toString(); + }catch(eo4:EvalError){ + thisError1="This is outer Eval Error"+eo4.toString(); + }catch(eo5:RangeError){ + thisError1="This is outer Range Error"+eo5.toString(); + }catch(eo6:SecurityError){ + thisError1="This is outer Security Error!!!"+eo6.toString(); + }catch(eo7:Error){ + thisError="This is outer Error:"+eo7.toString(); + }finally{ + + AddTestCase( "Testing Nested try block with multiple catch block inside the try block of the outer try block","This is outer finally:TypeError","This is outer finally:"+thisError1 ); + } + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/TryCatchBlockPackage.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/TryCatchBlockPackage.as new file mode 100644 index 00000000000..35878a64b44 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/TryCatchBlockPackage.as @@ -0,0 +1,50 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + +import TryCatchBlockPackage.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Testing try block with multiple catch blocks"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + +var trythrow:TryAndCatchBlockWithUserDefinedErrors = new TryAndCatchBlockWithUserDefinedErrors(); +trythrow.MyTryThrowCatchFunction(); + + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/TryCatchBlockPackage/TryAndCatchBlockWithUserDefinedErrors.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/TryCatchBlockPackage/TryAndCatchBlockWithUserDefinedErrors.as new file mode 100644 index 00000000000..5440001442d --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/TryCatchBlockPackage/TryAndCatchBlockWithUserDefinedErrors.as @@ -0,0 +1,122 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package UserDefinedErrorsPackageTryBlockOutside +{ + public class BoxDimensionException extends Error + { + public function BoxDimensionException(boxErrMsg:String) + { + super(boxErrMsg); + + + } + + + } + public class BoxUnderzeroException extends BoxDimensionException + { + + public function BoxUnderzeroException(boxErrMsg2:String) + { + super(boxErrMsg2); + + } + + } + + public class BoxOverflowException extends BoxDimensionException + { + public function BoxOverflowException(boxErrMsg3:String) + { + super(boxErrMsg3); + + } + + } + + public class Box + { + private var width:Number; + + public function setWidth(w):Boolean + { + var errmsg:String="Illegal Box Dimension specified"; + var errmsg2:String="Box dimensions should be greater than 0"; + var errmsg3:String="Box dimensions must be less than Number.MAX_VALUE"; + if (w == NaN) + { + throw new BoxDimensionException(errmsg); + }else if (w<= 0) + { + throw new BoxUnderzeroException(errmsg2); + }else if (w>Number.MAX_VALUE) + { + throw new BoxOverflowException(errmsg3); + } + width = w; + + } + } + +} +package TryCatchBlockPackage +{ + import UserDefinedErrorsPackageTryBlockOutside.*; + public class TryAndCatchBlockWithUserDefinedErrors + { + var b:Box = new Box(); + var someWidth:Number=(Number.MAX_VALUE)*10; + thisError = "no error"; + + public function MyTryThrowCatchFunction():void + { + try { + b.setWidth(someWidth); + }catch(e:BoxOverflowException){ + thisError = e.message; + //trace("BoxOverflowException:"+thisError); + }catch(e1:BoxUnderzeroException){ + thisError=e1.message; + //trace("BoxUnderzeroException:"+thisError()); + }catch(e2:BoxDimensionException){ + thisError = e2.message; + //trace("BoxDimensionException Occurred:"+thisError()); + }catch(e3:Error){ + thisError = e3.toString(); + //trace("An error occurred:"+e3.toString()); + }finally{ + AddTestCase( "Testing try block and multiple catch blocks with custom error classes", "Box dimensions must be less than Number.MAX_VALUE",thisError ); + } + + } + } + +} diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/TryCatchBlockPackage2.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/TryCatchBlockPackage2.as new file mode 100644 index 00000000000..662af597e6d --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/TryCatchBlockPackage2.as @@ -0,0 +1,50 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + +import TryCatchBlockPackage2.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Testing try block with multiple catch blocks"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + +var trythrow:TryAndCatchBlockWithUserDefinedErrors = new TryAndCatchBlockWithUserDefinedErrors(); +trythrow.MyTryThrowCatchFunction(); + + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/TryCatchBlockPackage2/TryAndCatchBlockWithUserDefinedErrors.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/TryCatchBlockPackage2/TryAndCatchBlockWithUserDefinedErrors.as new file mode 100644 index 00000000000..a58fcb7c235 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/TryCatchBlockPackage2/TryAndCatchBlockWithUserDefinedErrors.as @@ -0,0 +1,121 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package UserDefinedErrorsPackageTryBlockOutside +{ + public class BoxDimensionException extends Error + { + + public function BoxDimensionException(boxErrMsg:String) + { + super(boxErrMsg); + + } + + } + public class BoxUnderzeroException extends BoxDimensionException + { + + public function BoxUnderzeroException(boxErrMsg2:String) + { + super(boxErrMsg2); + + } + + } + + public class BoxOverflowException extends BoxDimensionException + { + + public function BoxOverflowException(boxErrMsg3:String) + { + super(boxErrMsg3); + + } + + } + + public class Box + { + private var width:Number; + + public function setWidth(w):Boolean + { + var errmsg:String="Illegal Box Dimension specified"; + var errmsg2:String="Box dimensions should be greater than 0"; + var errmsg3:String="Box dimensions must be less than Number.MAX_VALUE"; + if (isNaN(w)) + { + throw new BoxDimensionException(errmsg); + }else if (w<= 0) + { + throw new BoxUnderzeroException(errmsg2); + }else if (w>Number.MAX_VALUE) + { + throw new BoxOverflowException(errmsg3); + } + + width = w; + + } + } + +} +package TryCatchBlockPackage2 +{ + import UserDefinedErrorsPackageTryBlockOutside.*; + public class TryAndCatchBlockWithUserDefinedErrors + { + var b:Box = new Box(); + var someWidth:Number=-10; + thisError = "no error"; + + public function MyTryThrowCatchFunction():void + { + try { + b.setWidth(someWidth); + }catch(e:BoxOverflowException){ + thisError = e.message; + //trace("BoxOverflowException:"+thisError); + }catch(e1:BoxUnderzeroException){ + thisError=e1.message; + //trace("BoxUnderzeroException:"+thisError); + }catch(e2:BoxDimensionException){ + thisError = e2.message; + //trace("BoxDimensionException Occurred:"+thisError); + }catch(e3:Error){ + thisError=e3.message; + //trace("An error occurred:"+e3.toString()); + }finally{ + AddTestCase( "Testing try block and multiple catch blocks with custom error classes", "Box dimensions should be greater than 0",thisError ); + } + } + } +} diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/TryCatchBlockPackage3.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/TryCatchBlockPackage3.as new file mode 100644 index 00000000000..4f3042f23e4 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/TryCatchBlockPackage3.as @@ -0,0 +1,50 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + +import TryCatchBlockPackage3.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Testing try block with multiple catch blocks"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + +var trythrow:TryAndCatchBlockWithUserDefinedErrors = new TryAndCatchBlockWithUserDefinedErrors(); +trythrow.MyTryThrowCatchFunction(); + + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/TryCatchBlockPackage3/TryAndCatchBlockWithUserDefinedErrors.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/TryCatchBlockPackage3/TryAndCatchBlockWithUserDefinedErrors.as new file mode 100644 index 00000000000..abb59940039 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/TryCatchBlockPackage3/TryAndCatchBlockWithUserDefinedErrors.as @@ -0,0 +1,114 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package UserDefinedErrorsPackageTryBlockOutside +{ + public class BoxDimensionException extends Error + { + + public function BoxDimensionException(boxErrMsg:String) + { + super(boxErrMsg); + + } + } + public class BoxUnderzeroException extends BoxDimensionException + { + + public function BoxUnderzeroException(boxErrMsg2:String) + { + super(boxErrMsg2); + } + } + + public class BoxOverflowException extends BoxDimensionException + { + + public function BoxOverflowException(boxErrMsg3:String) + { + super(boxErrMsg3); + + } + + } + + public class Box + { + private var width:Number; + + public function setWidth(w):Boolean + { + var errmsg:String="Illegal Box Dimension specified"; + var errmsg2:String="Box dimensions should be greater than 0"; + var errmsg3:String="Box dimensions must be less than Number.MAX_VALUE"; + if (isNaN(w)){ + throw new BoxDimensionException(errmsg); + }else if (w<= 0){ + throw new BoxUnderzeroException(errmsg2); + }else if (w>Number.MAX_VALUE){ + throw new BoxOverflowException(errmsg3); + } + width = w; + } + } + +} +package TryCatchBlockPackage3 +{ + import UserDefinedErrorsPackageTryBlockOutside.*; + public class TryAndCatchBlockWithUserDefinedErrors + { + var b:Box = new Box(); + var someWidth:Number=NaN; + thisError = "no error"; + + public function MyTryThrowCatchFunction():void + { + try { + b.setWidth(someWidth); + }catch(e:BoxOverflowException){ + thisError = e.message; + //trace("BoxOverflowException:"+thisError); + }catch(e1:BoxUnderzeroException){ + thisError=e1.message; + //trace("BoxUnderzeroException:"+thisError); + }catch(e2:BoxDimensionException){ + thisError = e2.message; + //trace("BoxDimensionException Occurred:"+thisError); + }catch(e3:Error){ + thisError = e3.message; + //trace("An error occurred:"+e3.toString()); + }finally{ + AddTestCase( "Testing try block and multiple catch blocks with custom error classes", "Illegal Box Dimension specified",thisError ); + } + } + + } +} diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/TryCatchBlockUserWithBuiltInExceptions.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/TryCatchBlockUserWithBuiltInExceptions.as new file mode 100644 index 00000000000..26d1e77e630 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/TryCatchBlockUserWithBuiltInExceptions.as @@ -0,0 +1,50 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + +import TryCatchBlockUserWithBuiltInExceptions.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Testing try block with multiple catch blocks"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + +var trythrow:TryAndCatchBlockWithUserDefinedErrors = new TryAndCatchBlockWithUserDefinedErrors(); +trythrow.MyTryThrowCatchFunction(); + + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/TryCatchBlockUserWithBuiltInExceptions/TryAndCatchBlockWithUserDefinedErrors.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/TryCatchBlockUserWithBuiltInExceptions/TryAndCatchBlockWithUserDefinedErrors.as new file mode 100644 index 00000000000..7e181a0d3af --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/TryCatchBlockUserWithBuiltInExceptions/TryAndCatchBlockWithUserDefinedErrors.as @@ -0,0 +1,154 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package UserDefinedErrorsPackageTryBlockOutside +{ + public class BoxDimensionException extends Error + { + public function BoxDimensionException(boxErrMsg:String) + { + super(boxErrMsg); + + } + + } + public class BoxUnderzeroException extends BoxDimensionException + { + + public function BoxUnderzeroException(boxErrMsg2:String) + { + super(boxErrMsg2); + } + } + + public class BoxOverflowException extends BoxDimensionException + { + public function BoxOverflowException(boxErrMsg3:String) + { + super(boxErrMsg3); + } + } + + public class Box + { + private var width:Number; + + public function setWidth(w):Boolean + { + var k:String = decodeURI("!@#$%^&*()<>?"); + eval(m); + var arr:Array=new Array(-10); + var MyString:String = MyString+1; + var errmsg:String="Illegal Box Dimension specified"; + var errmsg2:String="Box dimensions should be greater than 0"; + var errmsg3:String="Box dimensions must be less than Number.MAX_VALUE"; + if (isNaN(w)){ + throw new BoxDimensionException(errmsg); + }else if (w<= 0){ + throw new BoxUnderzeroException(errmsg2); + }else if (w>Number.MAX_VALUE){ + throw new BoxOverflowException(errmsg3); + } + + width = w; + + } + } +} +package TryCatchBlockUserWithBuiltInExceptions +{ + import UserDefinedErrorsPackageTryBlockOutside.*; + public class TryAndCatchBlockWithUserDefinedErrors + { + var b:Box = new Box(); + var someWidth:Number=(Number.MAX_VALUE)*10; + var thisError = "no error"; + var thisError1 = "no error"; + var thisError2 = "no error"; + var thisError3 = "no error"; + var thisError4 = "no error"; + var thisError5 = "no error"; + var thisError6 = "no error"; + var thisError11 = "no error"; + var thisError8 = "no error"; + var thisError9 = "no error"; + var thisError10 ="no error"; + public function MyTryThrowCatchFunction():void + { + try { + b.setWidth(someWidth); + }catch(e:BoxOverflowException){ + thisError = e.message; + //trace("BoxOverflowException:"+thisError); + }catch(e1:BoxUnderzeroException){ + thisError1=e1.message; + //trace("BoxUnderzeroException:"+thisError1); + }catch(e2:BoxDimensionException){ + thisError2 = e2.message; + //trace("BoxDimensionException Occurred:"+thisError2); + }catch(e3:ReferenceError){ + thisError3=e.toString(); + //print(thisError3); + }catch(e4:TypeError){ + thisError4=e4.toString(); + //print(thisError4) + }catch(e5:ArgumentError){ + thisError5=e5.toString(); + //print(thisError5) + }catch(e6:URIError){ + thisError6=e6.toString(); + //print(thisError6) + }catch(e8:UninitializedError){ + thisError8=e8.toString(); + //print(thisError8) + }catch(e9:EvalError){ + thisError9=e9.toString(); + //print(thisError9) + }catch(e10:RangeError){ + thisError10=e10.toString(); + //print(thisError10) + }catch(e11:Error){ + //print(e11.toString()); + thisError11=e11.toString(); + }finally{//print("This Error is:"+thisError); + AddTestCase( "Testing try block and multiple catch blocks with custom error classes", "no error",thisError ); + AddTestCase( "Testing catch block with type error", + "no error",typeError(thisError4) ); + AddTestCase( "Testing catch block with Argument Error", "no error" ,thisError5); + AddTestCase( "Testing catch block with URIError", + "URIError: Error #1052",uriError(thisError6)); + AddTestCase( "Testing catch block with Eval Error", + "no error" ,thisError9); AddTestCase( "Testing catch block with Range Error", + "no error",thisError10); + AddTestCase( "Testing catch block with Error", "no error" ,thisError11); + } + } + } +} diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/UserDefinedErrorsInPackage.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/UserDefinedErrorsInPackage.as new file mode 100644 index 00000000000..d07f2d7a3e3 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/UserDefinedErrorsInPackage.as @@ -0,0 +1,50 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + +import UserDefinedErrorsInPackage.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Testing try block with multiple catch blocks"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + +var trythrow = new TryAndCatchBlockWithUserDefinedErrorsInPackage(); +trythrow.MyTryThrowCatchFunction(); + + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/UserDefinedErrorsInPackage/TryAndCatchBlockWithUserDefinedErrorsInPackage.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/UserDefinedErrorsInPackage/TryAndCatchBlockWithUserDefinedErrorsInPackage.as new file mode 100644 index 00000000000..b22c4ed8ff9 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/UserDefinedErrorsInPackage/TryAndCatchBlockWithUserDefinedErrorsInPackage.as @@ -0,0 +1,120 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package UserDefinedErrorsInPackage +{ + public class BoxDimensionException extends Error + { + + public function BoxDimensionException(boxErrMsg:String) + { + super(boxErrMsg); + + } + + } + public class BoxUnderzeroException extends BoxDimensionException + { + + public function BoxUnderzeroException(boxErrMsg2:String) + { + super(boxErrMsg2); + + } + + } + + public class BoxOverflowException extends BoxDimensionException + { + + public function BoxOverflowException(boxErrMsg3:String) + { + super(boxErrMsg3); + + } + + } + class Box + { + private var width:Number; + + public function setWidth(w):Boolean + { + var errmsg:String="Illegal Box Dimension specified"; + var errmsg2:String="Box dimensions should be greater than 0"; + var errmsg3:String="Box dimensions must be less than Number.MAX_VALUE"; + if (isNaN(w)) + { + throw new BoxDimensionException(errmsg); + }else if (w<= 0) + { + throw new BoxUnderzeroException(errmsg2); + }else if (w>Number.MAX_VALUE) + { + throw new BoxOverflowException(errmsg3); + } + + width = w; + + } + } + + public class TryAndCatchBlockWithUserDefinedErrorsInPackage + { + var b:Box = new Box(); + var someWidth:Number=-10; + thisError = "no error"; + + public function MyTryThrowCatchFunction():void + { + try { + b.setWidth(someWidth); + }catch(e:BoxOverflowException){ + thisError = e.message; + //print(thisError); + //trace("BoxOverflowException:"+thisError); + /*}catch(e1:BoxUnderzeroException){ + thisError=e1.message; + //print(thisError);*/ + //trace("BoxUnderzeroException:"+thisError); + }catch(e2:BoxDimensionException){ + thisError = e2.message; + //print(thisError); + //trace("BoxDimensionException Occurred:"+thisError()); + }catch(e3:Error){ + thisError=e3.message; + //print(e3.toString()); + //trace("An error occurred:"+e3.toString()); + }finally{ + AddTestCase( "Testing try block and multiple catch blocks with custom error classes", "Box dimensions should be greater than 0",thisError ); + } + } + } +} diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/UserDefinedErrorsPackage.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/UserDefinedErrorsPackage.as new file mode 100644 index 00000000000..515213201c2 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/UserDefinedErrorsPackage.as @@ -0,0 +1,50 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + +import UserDefinedErrorsPackage.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Testing try block with multiple catch blocks"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + +var trythrow:TryAndCatchBlockWithUserDefinedErrors = new TryAndCatchBlockWithUserDefinedErrors(); +trythrow.MyTryThrowCatchFunction(); + + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/UserDefinedErrorsPackage/TryAndCatchBlockWithUserDefinedErrors.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/UserDefinedErrorsPackage/TryAndCatchBlockWithUserDefinedErrors.as new file mode 100644 index 00000000000..a888150947f --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/UserDefinedErrorsPackage/TryAndCatchBlockWithUserDefinedErrors.as @@ -0,0 +1,112 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package UserDefinedErrorsPackage +{ + class BoxDimensionException extends Error + { + public function BoxDimensionException(boxErrMsg:String) + { + super(boxErrMsg); + + + } + } + class BoxUnderzeroException extends BoxDimensionException + { + public function BoxUnderzeroException(boxErrMsg2:String) + { + super(boxErrMsg2); + + } + } + + class BoxOverflowException extends BoxDimensionException + { + public function BoxOverflowException(boxErrMsg3:String) + { + super(boxErrMsg3); + + } + } + + class Box + { + private var width:Number; + + public function setWidth(w):Boolean + { + var errmsg:String="Illegal Box Dimension specified"; + var errmsg2:String="Box dimensions should be greater than 0"; + var errmsg3:String="Box dimensions must be less than Number.MAX_VALUE"; + if (w == NaN) + { + throw new BoxDimensionException(errmsg); + }else if (w<= 0) + { + throw new BoxUnderzeroException(errmsg2); + }else if (w>Number.MAX_VALUE) + { + throw new BoxOverflowException(errmsg3); + } + width = w; + + } + } + + public class TryAndCatchBlockWithUserDefinedErrors + { + var b:Box = new Box(); + var someWidth:Number=(Number.MAX_VALUE)*10; + thisError = "no error"; + + public function MyTryThrowCatchFunction():void + { + try { + b.setWidth(someWidth); + }catch(e:BoxOverflowException){ + thisError = e.message; + //trace("BoxOverflowException:"+thisError); + }catch(e1:BoxUnderzeroException){ + thisError=e1.message; + //trace("BoxUnderzeroException:"+thisError()); + }catch(e2:BoxDimensionException){ + thisError = e2.message; + //trace("BoxDimensionException Occurred:"+thisError()); + }catch(e3:Error){ + thisError = e3.toString(); + //trace("An error occurred:"+e3.toString()); + }finally{ + AddTestCase( "Testing try block and multiple catch blocks with custom error classes", "Box dimensions must be less than Number.MAX_VALUE",thisError ); + } + + } + } +} diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/UserDefinedErrorsPackage2.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/UserDefinedErrorsPackage2.as new file mode 100644 index 00000000000..771d88ba758 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/UserDefinedErrorsPackage2.as @@ -0,0 +1,50 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + +import UserDefinedErrorsPackage2.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Testing try block with multiple catch blocks"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + +var trythrow:TryAndCatchBlockWithUserDefinedErrors2 = new TryAndCatchBlockWithUserDefinedErrors2(); +trythrow.MyTryThrowCatchFunction(); + + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/UserDefinedErrorsPackage2/TryAndCatchBlockWithUserDefinedErrors2.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/UserDefinedErrorsPackage2/TryAndCatchBlockWithUserDefinedErrors2.as new file mode 100644 index 00000000000..2f2b93d226d --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/UserDefinedErrorsPackage2/TryAndCatchBlockWithUserDefinedErrors2.as @@ -0,0 +1,112 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package UserDefinedErrorsPackage2 +{ + class BoxDimensionException extends Error + { + public function BoxDimensionException(boxErrMsg:String) + { + super(boxErrMsg); + + } + + } + class BoxUnderzeroException extends BoxDimensionException + { + public function BoxUnderzeroException(boxErrMsg2:String) + { + super(boxErrMsg2); + + } + } + + class BoxOverflowException extends BoxDimensionException + { + public function BoxOverflowException(boxErrMsg3:String) + { + super(boxErrMsg3); + + } + } + + class Box + { + private var width:Number; + + public function setWidth(w):Boolean + { + var errmsg:String="Illegal Box Dimension specified"; + var errmsg2:String="Box dimensions should be greater than 0"; + var errmsg3:String="Box dimensions must be less than Number.MAX_VALUE"; + if (isNaN(w)) + { + throw new BoxDimensionException(errmsg); + }else if (w<= 0) + { + throw new BoxUnderzeroException(errmsg2); + }else if (w>Number.MAX_VALUE) + { + throw new BoxOverflowException(errmsg3); + } + + width = w; + + } + } + + public class TryAndCatchBlockWithUserDefinedErrors2 + { + var b:Box = new Box(); + var someWidth:Number=-10; + thisError = "no error"; + + public function MyTryThrowCatchFunction():void + { + try { + b.setWidth(someWidth); + }catch(e:BoxOverflowException){ + thisError = e.message; + //trace("BoxOverflowException:"+thisError); + }catch(e1:BoxUnderzeroException){ + thisError=e1.message; + //trace("BoxUnderzeroException:"+thisError); + }catch(e2:BoxDimensionException){ + thisError = e2.message; + //trace("BoxDimensionException Occurred:"+thisError); + }catch(e3:Error){ + thisError=e3.message; + //trace("An error occurred:"+e3.toString()); + }finally{ + AddTestCase( "Testing try block and multiple catch blocks with custom error classes", "Box dimensions should be greater than 0",thisError ); + } + } + } +} diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/UserDefinedErrorsPackage3.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/UserDefinedErrorsPackage3.as new file mode 100644 index 00000000000..14ec622627b --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/UserDefinedErrorsPackage3.as @@ -0,0 +1,50 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + +import UserDefinedErrorsPackage3.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Testing try block with multiple catch blocks"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + +var trythrow:TryAndCatchBlockWithUserDefinedErrors3 = new TryAndCatchBlockWithUserDefinedErrors3(); +trythrow.MyTryThrowCatchFunction(); + + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/UserDefinedErrorsPackage3/TryAndCatchBlockWithUserDefinedErrors3.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/UserDefinedErrorsPackage3/TryAndCatchBlockWithUserDefinedErrors3.as new file mode 100644 index 00000000000..b8605b9d016 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/UserDefinedErrorsPackage3/TryAndCatchBlockWithUserDefinedErrors3.as @@ -0,0 +1,105 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package UserDefinedErrorsPackage3 +{ + class BoxDimensionException extends Error + { + public function BoxDimensionException(boxErrMsg:String) + { + super(boxErrMsg); + + } + } + class BoxUnderzeroException extends BoxDimensionException + { + public function BoxUnderzeroException(boxErrMsg2:String) + { + super(boxErrMsg2); + } + } + + class BoxOverflowException extends BoxDimensionException + { + public function BoxOverflowException(boxErrMsg3:String) + { + super(boxErrMsg3); + + } + } + + class Box + { + private var width:Number; + + public function setWidth(w):Boolean + { + var errmsg:String="Illegal Box Dimension specified"; + var errmsg2:String="Box dimensions should be greater than 0"; + var errmsg3:String="Box dimensions must be less than Number.MAX_VALUE"; + if (isNaN(w)){ + throw new BoxDimensionException(errmsg); + }else if (w<= 0){ + throw new BoxUnderzeroException(errmsg2); + }else if (w>Number.MAX_VALUE){ + throw new BoxOverflowException(errmsg3); + } + width = w; + } + } + + public class TryAndCatchBlockWithUserDefinedErrors3 + { + var b:Box = new Box(); + var someWidth:Number=NaN; + thisError = "no error"; + + public function MyTryThrowCatchFunction():void + { + try { + b.setWidth(someWidth); + }catch(e:BoxOverflowException){ + thisError = e.message; + //trace("BoxOverflowException:"+thisError); + }catch(e1:BoxUnderzeroException){ + thisError=e1.message; + //trace("BoxUnderzeroException:"+thisError); + }catch(e2:BoxDimensionException){ + thisError = e2.message; + //trace("BoxDimensionException Occurred:"+thisError); + }catch(e3:Error){ + thisError = e3.message; + //trace("An error occurred:"+e3.toString()); + }finally{ + AddTestCase( "Testing try block and multiple catch blocks with custom error classes", "Illegal Box Dimension specified",thisError ); + } + } + } +} diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/UserDefinedErrorsPackageWithoutMatchingCatch.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/UserDefinedErrorsPackageWithoutMatchingCatch.as new file mode 100644 index 00000000000..48683fc2b68 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/UserDefinedErrorsPackageWithoutMatchingCatch.as @@ -0,0 +1,50 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + +import UserDefinedErrorsPackageWithoutMatchingCatch.*; + +var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Testing try block with multiple catch blocks"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + +var trythrow = new TryAndCatchBlockWithUserDefinedErrorsWithoutMatchingcatch(); +trythrow.MyTryThrowCatchFunction(); + + + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/UserDefinedErrorsPackageWithoutMatchingCatch/TryAndCatchBlockWithUserDefinedErrorsWithoutMatchingcatch.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/UserDefinedErrorsPackageWithoutMatchingCatch/TryAndCatchBlockWithUserDefinedErrorsWithoutMatchingcatch.as new file mode 100644 index 00000000000..99c8907cfa1 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/UserDefinedErrorsPackageWithoutMatchingCatch/TryAndCatchBlockWithUserDefinedErrorsWithoutMatchingcatch.as @@ -0,0 +1,121 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package UserDefinedErrorsPackageWithoutMatchingCatch2 +{ + public class BoxDimensionException extends Error + { + + public function BoxDimensionException(boxErrMsg:String) + { + super(boxErrMsg); + + } + + } + public class BoxUnderzeroException extends BoxDimensionException + { + + public function BoxUnderzeroException(boxErrMsg2:String) + { + super(boxErrMsg2); + + } + + } + + public class BoxOverflowException extends BoxDimensionException + { + + public function BoxOverflowException(boxErrMsg3:String) + { + super(boxErrMsg3); + + } + + } + public class Box + { + private var width:Number; + + public function setWidth(w):Boolean + { + var errmsg:String="Illegal Box Dimension specified"; + var errmsg2:String="Box dimensions should be greater than 0"; + var errmsg3:String="Box dimensions must be less than Number.MAX_VALUE"; + if (isNaN(w)) + { + throw new BoxDimensionException(errmsg); + }else if (w<= 0) + { + throw new BoxUnderzeroException(errmsg2); + }else if (w>Number.MAX_VALUE) + { + throw new BoxOverflowException(errmsg3); + } + + width = w; + + } + } +} +package UserDefinedErrorsPackageWithoutMatchingCatch{ + + import UserDefinedErrorsPackageWithoutMatchingCatch2.*; + public class TryAndCatchBlockWithUserDefinedErrorsWithoutMatchingcatch + { + var b:Box = new Box(); + var someWidth:Number=-10; + thisError = "no error"; + + + public function MyTryThrowCatchFunction():void + { + try { + b.setWidth(someWidth); + }catch(e:BoxOverflowException){ + thisError = e.message; + //print(thisError); + //trace("BoxOverflowException:"+thisError); + + }catch(e2:BoxDimensionException){ + thisError = e2.message; + //print(thisError); + //trace("BoxDimensionException Occurred:"+thisError()); + }catch(e3:Error){ + thisError=e3.message; + //print(e3.toString()); + //trace("An error occurred:"+e3.toString()); + }finally{ + AddTestCase( "Testing try block and multiple catch blocks with custom error classes", "Box dimensions should be greater than 0",thisError ); + } + } + } +} diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/getStackTrace.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/getStackTrace.as new file mode 100644 index 00000000000..35e473a3349 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/getStackTrace.as @@ -0,0 +1,47 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Exceptions"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "Calling addStackTrace() on Error subclass"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +import getStackTrace.*; + +var a:StackTraceCaller = new StackTraceCaller(); +AddTestCase("Call to getStackTrace", "Error", a.doo()); + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/getStackTrace/StackTraceCaller.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/getStackTrace/StackTraceCaller.as new file mode 100644 index 00000000000..eff9f7952e4 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/getStackTrace/StackTraceCaller.as @@ -0,0 +1,57 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package getStackTrace { + + public class StackTraceCaller + { + public function StackTraceCaller() + { + + } + public function doo () + { + try + { + foo(); + } + catch (e:SubError) + { + var st = e.getStackTrace(); + return st.substr(0, 5); + } + } + + public function foo() + { + throw new SubError(); + } + } +} diff --git a/mozilla/js/tamarin/test/as3/Statements/Exceptions/getStackTrace/SubError.as b/mozilla/js/tamarin/test/as3/Statements/Exceptions/getStackTrace/SubError.as new file mode 100644 index 00000000000..0cec6391451 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/Exceptions/getStackTrace/SubError.as @@ -0,0 +1,38 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package getStackTrace { + public class SubError extends Error + { + public function SubError() + { + } + } +} diff --git a/mozilla/js/tamarin/test/as3/Statements/for-each-in/eforeachin_001.as b/mozilla/js/tamarin/test/as3/Statements/for-each-in/eforeachin_001.as new file mode 100644 index 00000000000..cb4c2c67601 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/for-each-in/eforeachin_001.as @@ -0,0 +1,385 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "forin-001"; + var VERSION = "ECMA_2"; + var TITLE = "The for each in statement"; + var BUGNUMBER=""; + + startTest(); + writeHeaderToLog( SECTION + " "+ TITLE); + + var tc = 0; + var testcases = new Array(); + + ForIn_1( { length:4, company:"netscape", year:2000, 0:"zero" } ); + ForIn_2( { length:4, company:"netscape", year:2000, 0:"zero" } ); + ForIn_3( { length:4, company:"netscape", year:2000, 0:"zero" } ); + +// ForIn_6({ length:4, company:"netscape", year:2000, 0:"zero" }); +// ForIn_7({ length:4, company:"netscape", year:2000, 0:"zero" }); + ForIn_8({ length:4, company:"netscape", year:2000, 0:"zero" }); + + test(); + + function ForIn_1( object ) { + PropertyArray = new Array(); + ValueArray = new Array(); + + for each ( PropertyArray[PropertyArray.length] in object ) { + ValueArray[ValueArray.length] = + object[PropertyArray[PropertyArray.length-1]]; + } + + tcCompany = tc+0; + tcLength = tc+1; + tcZero = tc+2; + tcYear = tc+3; + + // need a hack to make sure that the order of test cases + // is constant... ecma stats that the order that for-each-in + // is run does not have to be constant + for ( var i = 0; i < PropertyArray.length; i++ ) { + switch( PropertyArray[i] ) { + case "company": + testcases[tcCompany] = new TestCase( + SECTION, + "object[" + PropertyArray[i] +"]", + object[PropertyArray[i]], + ValueArray[i] + ); + tc++ + break; + + case "length": + testcases[tcLength] = new TestCase( + SECTION, + "object[" + PropertyArray[i] +"]", + object[PropertyArray[i]], + ValueArray[i] + ); + tc++ + break; + + case "year": + testcases[tcYear] = new TestCase( + SECTION, + "object[" + PropertyArray[i] +"]", + object[PropertyArray[i]], + ValueArray[i] + ); + tc++ + break; + + case "0": + testcases[tcZero] = new TestCase( + SECTION, + "object[" + PropertyArray[i] +"]", + object[PropertyArray[i]], + ValueArray[i] + ); + tc++ + break; + + } + } + + testcases[tc++] = new TestCase( + SECTION, + "object.length", + PropertyArray.length, + object.length ); + } + + function ForIn_2( object ) { + PropertyArray = new Array(); + ValueArray = new Array(); + var i = 0; + + for each ( PropertyArray[i++] in object ) { + ValueArray[ValueArray.length] = + object[PropertyArray[PropertyArray.length-1]]; + } + + tcCompany = tc+0; + tcLength = tc+1; + tcZero = tc+2; + tcYear = tc+3; + + // need a hack to make sure that the order of test cases + // is constant... ecma stats that the order that for-each-in + // is run does not have to be constant + for ( var i = 0; i < PropertyArray.length; i++ ) { + switch( PropertyArray[i] ) { + case "company": + testcases[tcCompany] = new TestCase( + SECTION, + "object[" + PropertyArray[i] +"]", + object[PropertyArray[i]], + ValueArray[i] + ); + tc++ + break; + + case "length": + testcases[tcLength] = new TestCase( + SECTION, + "object[" + PropertyArray[i] +"]", + object[PropertyArray[i]], + ValueArray[i] + ); + tc++ + break; + + case "year": + testcases[tcYear] = new TestCase( + SECTION, + "object[" + PropertyArray[i] +"]", + object[PropertyArray[i]], + ValueArray[i] + ); + tc++ + break; + + case "0": + testcases[tcZero] = new TestCase( + SECTION, + "object[" + PropertyArray[i] +"]", + object[PropertyArray[i]], + ValueArray[i] + ); + tc++ + break; + + } + } + + testcases[tc++] = new TestCase( + SECTION, + "object.length", + PropertyArray.length, + object.length ); + } + + function ForIn_3( object ) { + var checkBreak = "pass"; + var properties = new Array(); + var values = new Array(); + + for each ( properties[properties.length] in object ) { + values[values.length] = object[properties[properties.length-1]]; + break; + checkBreak = "fail"; + } + + testcases[tc++] = new TestCase( + SECTION, + "check break out of for...in", + "pass", + checkBreak ); + + testcases[tc++] = new TestCase( + SECTION, + "properties.length", + 1, + properties.length ); + + // we don't know which one of the properties + // because we can't predict order + var myTest = "PASSED"; + if( values[0] != object[properties[0]] ) + myTest = "FAILED"; + + testcases[tc++] = new TestCase( + SECTION, + "object[properties[0]] == values[0]", + "PASSED", + myTest ); + } + + function ForIn_4( object ) { + var result1 = 0; + var result2 = 0; + var result3 = 0; + var result4 = 0; + var i = 0; + var property = new Array(); + + butterbean: { + result1++; + + for each ( property[i++] in object ) { + result2++; + break; + result4++; + } + result3++; + } + + testcases[tc++] = new TestCase( + SECTION, + "verify labeled statement is only executed once", + true, + result1 == 1 ); + + testcases[tc++] = new TestCase( + SECTION, + "verify statements in for loop are evaluated", + true, + result2 == i ); + + testcases[tc++] = new TestCase( + SECTION, + "verify break out of labeled for each in loop", + true, + result4 == 0 ); + + testcases[tc++] = new TestCase( + SECTION, + "verify break out of labeled block", + true, + result3 == 0 ); + } + + function ForIn_5 (object) { + var result1 = 0; + var result2 = 0; + var result3 = 0; + var result4 = 0; + var i = 0; + var property = new Array(); + + bigredbird: { + result1++; + for ( property[i++] in object ) { + result2++; + break bigredbird; + result4++; + } + result3++; + } + + testcases[tc++] = new TestCase( + SECTION, + "verify labeled statement is only executed once", + true, + result1 == 1 ); + + testcases[tc++] = new TestCase( + SECTION, + "verify statements in for loop are evaluated", + true, + result2 == i ); + + testcases[tc++] = new TestCase( + SECTION, + "verify break out of labeled for each in loop", + true, + result4 == 0 ); + + testcases[tc++] = new TestCase( + SECTION, + "verify break out of labeled block", + true, + result3 == 0 ); + } + + function ForIn_7( object ) { + var result1 = 0; + var result2 = 0; + var result3 = 0; + var result4 = 0; + var i = 0; + var property = new Array(); + + //bigredbird: + for each( property[i++] in object ) { + result2++; + continue; + result4++; + } + + testcases[tc++] = new TestCase( + SECTION, + "verify statements in for loop are evaluated", + true, + result2 == i ); + + testcases[tc++] = new TestCase( + SECTION, + "verify break out of labeled for each in loop", + true, + result4 == 0 ); + + testcases[tc++] = new TestCase( + SECTION, + "verify break out of labeled block", + true, + result3 == 1 ); + } + + + function ForIn_8( object ) { + var checkBreak = "pass"; + var properties = new Array(); + var values = new Array(); + + for each ( properties[properties.length] in object ) { + values[values.length] = object[properties[properties.length-1]]; + break; + checkBreak = "fail"; + } + + testcases[tc++] = new TestCase( + SECTION, + "check break out of for each in", + "pass", + checkBreak ); + + testcases[tc++] = new TestCase( + SECTION, + "properties.length", + 1, + properties.length ); + + // we don't know which one of the properties + // because we can't predict order + var myTest = "PASSED"; + if( values[0] != object[properties[0]] ) + myTest = "FAILED"; + + + testcases[tc++] = new TestCase( + SECTION, + "object[properties[0]] == object[properties[0]]", + "PASSED", + myTest ); + } + diff --git a/mozilla/js/tamarin/test/as3/Statements/for-each-in/eforeachin_002.as b/mozilla/js/tamarin/test/as3/Statements/for-each-in/eforeachin_002.as new file mode 100644 index 00000000000..03d4402019f --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Statements/for-each-in/eforeachin_002.as @@ -0,0 +1,73 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Statements"; // provide a document reference (ie, ECMA section) +var VERSION = "AS3"; // Version of JavaScript or ECMA +var TITLE = "for each in"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + + // XML Object + + var i, s=""; + + obj1 = {}; + obj1.A = 1; + + obj2 = {}; + obj2.A = 2; + obj3 = {}; + obj3.A = 3; + + x1 = {}; + x1.z = [obj1,obj2,obj3]; + +// var xmlDoc = "123"; +// var x1 = new XML(xmlDoc); + + for each(var i in x1.z) { + s += i.A; + } + + AddTestCase( "for-each-in (var) :", true, (s=="123") ); + + s = 0; + + for each ( i in x1.z ) + s += i.A; + + AddTestCase( "for-each-in :", true, (s==6) ); + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Types/Conversions/ExplicitConversions.as b/mozilla/js/tamarin/test/as3/Types/Conversions/ExplicitConversions.as new file mode 100644 index 00000000000..7ee11b57cdd --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Types/Conversions/ExplicitConversions.as @@ -0,0 +1,113 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Types: Conversions"; +var VERSION = "as3"; +var TITLE = "type conversions"; + +startTest(); + +// "string" +AddTestCase("String('string')", "string", String("string")); +AddTestCase("String('')", "", String("")); +AddTestCase("Number('string')", NaN, Number("string")); +AddTestCase("Number('')", 0, Number("")); +AddTestCase("int('string')", 0, int("string")); +AddTestCase("int('')", 0, int("")); +AddTestCase("uint('string')", 0, uint("string")); +AddTestCase("uint('')", 0, uint("")); +AddTestCase("Boolean('string')", true, Boolean("string")); +AddTestCase("Boolean('')", false, Boolean("")); +AddTestCase("Object('string')", "string", Object("string")); +AddTestCase("Object('')", "", Object("")); + +// null + +AddTestCase( "String(null)", "null", String(null)); +AddTestCase( "Number(null)", +0, Number(null)); +AddTestCase( "int(null)", +0, int(null)); +AddTestCase( "uint(null)", +0, uint(null)); +AddTestCase( "Boolean(null)", false, Boolean(null)); +AddTestCase( "Object(null)", "[object Object]", Object(null)+""); + +// undefined +AddTestCase( "String(undefined)", "undefined", String(undefined)); +AddTestCase( "Number(undefined)", NaN, Number(undefined)); +AddTestCase( "int(undefined)", +0, int(undefined)); +AddTestCase( "uint(undefined)", +0, uint(undefined)); +AddTestCase( "Boolean(undefined)", false, Boolean(undefined)); +AddTestCase( "Object(undefined)", "[object Object]", Object(undefined)+""); + +// true +AddTestCase( "String(true)", "true", String(true)); +AddTestCase( "Number(true)", 1, Number(true)); +AddTestCase( "int(true)", 1, int(true)); +AddTestCase( "uint(true)", 1, uint(true)); +AddTestCase( "Boolean(true)", true, Boolean(true)); +AddTestCase( "Object(true)", true, Object(true)); + +// false +AddTestCase( "String(false)", "false", String(false)); +AddTestCase( "Number(false)", +0, Number(false)); +AddTestCase( "int(false)", +0, int(false)); +AddTestCase( "uint(false)", +0, uint(false)); +AddTestCase( "Boolean(false)", false, Boolean(false)); +AddTestCase( "Object(false)", false, Object(false)); + +// 1.23 +AddTestCase( "String(1.23)", "1.23", String(1.23)); +AddTestCase( "Number(1.23)", 1.23, Number(1.23)); +AddTestCase( "int(1.23)", 1, int(1.23)); +AddTestCase( "uint(1.23)", 1, uint(1.23)); +AddTestCase( "Boolean(1.23)", true, Boolean(1.23)); +AddTestCase( "Object(1.23)", 1.23, Object(1.23)); + +// -1.23 +AddTestCase( "String(-1.23)", "-1.23", String(-1.23)); +AddTestCase( "Number(-1.23)", -1.23, Number(-1.23)); +AddTestCase( "int(-1.23)", -1, int(-1.23)); +AddTestCase( "uint(-1.23)", 4294967295, uint(-1.23)); +AddTestCase( "Boolean(-1.23)", true, Boolean(-1.23)); +AddTestCase( "Object(-1.23)", -1.23, Object(-1.23)); + +// NaN +AddTestCase( "String(NaN)", "NaN", String(NaN)); +AddTestCase( "Number(NaN)", NaN, Number(NaN)); +AddTestCase( "int(NaN)", +0, int(NaN)); +AddTestCase( "uint(NaN)", +0, uint(NaN)); +AddTestCase( "Boolean(NaN)", false, Boolean(NaN)); +AddTestCase( "Object(NaN)", NaN, Object(NaN)); + + + + + +test(); diff --git a/mozilla/js/tamarin/test/as3/Types/Conversions/ImplicitConversions1_23.as b/mozilla/js/tamarin/test/as3/Types/Conversions/ImplicitConversions1_23.as new file mode 100644 index 00000000000..87343c5f567 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Types/Conversions/ImplicitConversions1_23.as @@ -0,0 +1,105 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Types: Conversions"; +var VERSION = "as3"; +var TITLE = "implicit type conversions"; + +startTest(); + + +// Value = 1.23 + +/*var thisError = "no exception thrown"; +try{ + var string:String = 1.23; +} catch (e0) { + thisError = e0.toString(); +} finally { + AddTestCase( "var string:String = 1.23", "no exception thrown", typeError(thisError)); + AddTestCase( "var string:String = 1.23", "1.23", string); +}*/ +var string:String = 1.23; +AddTestCase( "var string:String = 1.23", "1.23", string); + +var number:Number = 1.23; +AddTestCase("number:Number = 1.23", 1.23, number ); + + +/*thisError = "no exception thrown"; +try{ + var myInt:int; + myInt = 1.23; +} catch(e1) { + thisError = e1.toString(); +} finally { + AddTestCase("myInt:int = 1.23", "RangeError: Error #1061", rangeError(thisError) ); +} +print(myInt);*/ + +var myInt:int= 1.23; +AddTestCase("myint:int = 1.23", 1, myInt ); + +/*thisError = "no exception thrown"; +try{ + var myUint:uint; + myUint = 1.23; +} catch(e2) { + thisError = e2.toString(); +} finally { + AddTestCase("myUInt:uint = 1.23", "RangeError: Error #1061", rangeError(thisError) ); +}*/ + +var myUint:uint; + myUint = 1.23; +AddTestCase("myUInt:uint = 1.23", 1, myUint); + +/*thisError = "no exception thrown"; +try{ + var boolean:Boolean = 1.23; +} catch(e3) { + thisError = e3.toString(); +} finally { + AddTestCase("boolean:Boolean = 1.23", "no exception thrown", typeError(thisError) ); + AddTestCase("boolean:Boolean = 1.23", true, boolean); +}*/ + +var boolean:Boolean = 1.23; +AddTestCase("boolean:Boolean = 1.23", true, boolean); + +var object:Object = 1.23; +AddTestCase( "var object:Object = 1.23", 1.23, object); + + +test(); + + + diff --git a/mozilla/js/tamarin/test/as3/Types/Conversions/ImplicitConversionsFalse.as b/mozilla/js/tamarin/test/as3/Types/Conversions/ImplicitConversionsFalse.as new file mode 100644 index 00000000000..9ddfed7c2b8 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Types/Conversions/ImplicitConversionsFalse.as @@ -0,0 +1,97 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Types: Conversions"; +var VERSION = "as3"; +var TITLE = "implicit type conversions"; + +startTest(); + + +// Value = false + +var thisError = "no exception thrown"; +try{ + var string:String = false; +} catch (e0) { + thisError = e0.toString(); +} finally { + AddTestCase("string:String = false", "no exception thrown", typeError(thisError) ); + AddTestCase("string:String = false", "false", string); +} + +thisError = "no exception thrown"; +try{ + var number:Number = false; +} catch (e) { + thisError = e.toString(); +} finally { + AddTestCase("number:Number = false", "no exception thrown", typeError(thisError) ); + AddTestCase("number:Number = false", 0, number ); +} + +thisError = "no exception thrown"; +try{ + var myInt:int = false; +} catch(e1) { + thisError = e1.toString(); +} finally { + AddTestCase("myInt:int = false", "no exception thrown", typeError(thisError) ); + AddTestCase("myInt:int = false", 0, myInt ); +} + +thisError = "no exception thrown"; +try{ + var myUint:uint = false; +} catch(e2) { + thisError = e2.toString(); +} finally { + AddTestCase("myUInt:uint = false", "no exception thrown", typeError(thisError) ); + AddTestCase("myUInt:uint = false", 0, myUint ); +} + +thisError = "no exception thrown"; +try{ + var boolean:Boolean = false; +} catch(e3) { + thisError = e3.toString(); +} finally { + AddTestCase("boolean:Boolean = false", "no exception thrown", typeError(thisError) ); +} + +var object:Object = false; +AddTestCase( "var object:Object = false", false, object); + + +test(); + + + diff --git a/mozilla/js/tamarin/test/as3/Types/Conversions/ImplicitConversionsNaN.as b/mozilla/js/tamarin/test/as3/Types/Conversions/ImplicitConversionsNaN.as new file mode 100644 index 00000000000..222c0c98b29 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Types/Conversions/ImplicitConversionsNaN.as @@ -0,0 +1,105 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Types: Conversions"; +var VERSION = "as3"; +var TITLE = "implicit type conversions"; + +startTest(); + + +// Value = NaN + +/*var thisError = "no exception thrown"; +try{ + var string:String = NaN; +} catch (e0) { + thisError = e0.toString(); +} finally { + AddTestCase( "var string:String = NaN", "no exception thrown", typeError(thisError)); + AddTestCase( "var string:String = NaN", "NaN", string); +}*/ + +var string:String = NaN; +AddTestCase( "var string:String = NaN", "NaN", string); + +var number:Number = NaN; +AddTestCase("number:Number = NaN", NaN, number ); + +/*thisError = "no exception thrown"; +try{ + var myInt:int = NaN; +} catch(e1) { + thisError = e1.toString(); +} finally { + AddTestCase("myInt:int = NaN", "RangeError: Error #1061", rangeError(thisError) ); + AddTestCase("myInt:int = NaN", 0, myInt ); +}*/ + +var myInt:int = NaN; +AddTestCase("myInt:int = NaN", 0, myInt ); + + +/*thisError = "no exception thrown"; +try{ + var myUint:uint = NaN; +} catch(e2) { + thisError = e2.toString(); +} finally { + AddTestCase("myUInt:uint = NaN", "RangeError: Error #1061", rangeError(thisError) ); + AddTestCase("myUInt:uint = NaN", 0, myUint ); +}*/ + +var myUint:uint = NaN; +AddTestCase("myUInt:uint = NaN", 0, myUint ); + + +/*thisError = "no exception thrown"; +try{ + var boolean:Boolean = NaN; +} catch(e3) { + thisError = e3.toString(); +} finally { + AddTestCase("boolean:Boolean = NaN", "no exception thrown", typeError(thisError) ); + AddTestCase("boolean:Boolean = NaN", false, boolean ); +}*/ + +var boolean:Boolean = NaN; +AddTestCase("boolean:Boolean = NaN", false, boolean ); + +var object:Object = NaN; +AddTestCase( "var object:Object = NaN", NaN, object); + + +test(); + + + diff --git a/mozilla/js/tamarin/test/as3/Types/Conversions/ImplicitConversionsNeg1_23.as b/mozilla/js/tamarin/test/as3/Types/Conversions/ImplicitConversionsNeg1_23.as new file mode 100644 index 00000000000..8b279ebca5d --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Types/Conversions/ImplicitConversionsNeg1_23.as @@ -0,0 +1,96 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Types: Conversions"; +var VERSION = "as3"; +var TITLE = "implicit type conversions"; + +startTest(); + + +// Value = -1.23 + +var thisError = "no exception thrown"; +try{ + var string:String = -1.23; +} catch (e0) { + thisError = e0.toString(); +} finally { + AddTestCase( "var string:String = -1.23", "no exception thrown", typeError(thisError)); + AddTestCase( "var string:String = -1.23", "-1.23", string); +} + + + +var number:Number = -1.23; +AddTestCase("number:Number = undefined", -1.23, number ); + +thisError = "no exception thrown"; +try{ + var myInt:int = -1.23; +} catch(e1) { + thisError = e1.toString(); +} finally { + AddTestCase("myInt:int = -1.23", "no exception thrown", rangeError(thisError) ); + AddTestCase("myInt:int = -1.23", -1, myInt ); +} + + +thisError = "no exception thrown"; +try{ + var myUint:uint = -1.23; +} catch(e2) { + thisError = e2.toString(); +} finally { + AddTestCase("myUInt:uint = -1.23", "no exception thrown", rangeError(thisError) ); + AddTestCase("myUInt:uint = -1.23", 4294967295, myUint); +} + + + +thisError = "no exception thrown"; +try{ + var boolean:Boolean = -1.23; +} catch(e3) { + thisError = e3.toString(); +} finally { + AddTestCase("boolean:Boolean = -1.23", "no exception thrown", typeError(thisError) ); + AddTestCase("boolean:Boolean = -1.23", true, boolean ); +} + +var object:Object = -1.23; +AddTestCase( "var object:Object = -1.23", -1.23, object); + + +test(); + + + diff --git a/mozilla/js/tamarin/test/as3/Types/Conversions/ImplicitConversionsNull.as b/mozilla/js/tamarin/test/as3/Types/Conversions/ImplicitConversionsNull.as new file mode 100644 index 00000000000..cbf0ebad3f3 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Types/Conversions/ImplicitConversionsNull.as @@ -0,0 +1,91 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Types: Conversions"; +var VERSION = "as3"; +var TITLE = "implicit type conversions"; + +startTest(); + + +// Value = null + +var string:String = null; +AddTestCase( "var string:String =null", null, string ); + +var thisError = "no exception thrown"; +try{ + var mynumber:Number = null; +} catch (e) { + thisError = e.toString(); +} finally { + AddTestCase("number:Number = null", "no exception thrown", typeError(thisError) ); + AddTestCase("number:Number = null", 0, mynumber); +} + +thisError = "no exception thrown"; +try{ + var myInt:int = null; +} catch(e1) { + thisError = e1.toString(); +} finally { + AddTestCase("myInt:int = null", "no exception thrown", typeError(thisError) ); + AddTestCase("myInt:int = null", 0, myInt ); +} + +thisError = "no exception thrown"; +try{ + var myUint:uint = null; +} catch(e2) { + thisError = e2.toString(); +} finally { + AddTestCase("myUInt:uint = null", "no exception thrown", typeError(thisError) ); + AddTestCase("myUInt:uint = null", 0, myUint ); +} + +thisError = "no exception thrown"; +try{ + var myboolean:Boolean = null; +} catch(e3) { + thisError = e3.toString(); +} finally { + AddTestCase("boolean:Boolean = null", "no exception thrown", typeError(thisError) ); + AddTestCase("boolean:Boolean = null", false, myboolean); +} + +var object:Object = null; +AddTestCase( "var object:Object = null", null, object); + + +test(); + + + diff --git a/mozilla/js/tamarin/test/as3/Types/Conversions/ImplicitConversionsString.as b/mozilla/js/tamarin/test/as3/Types/Conversions/ImplicitConversionsString.as new file mode 100644 index 00000000000..5c8904cfd1e --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Types/Conversions/ImplicitConversionsString.as @@ -0,0 +1,145 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Types: Conversions"; +var VERSION = "as3"; +var TITLE = "implicit type conversions"; + +startTest(); + + +// Value = "string" + +var string:String = "string"; +AddTestCase( "var string:String ='string'", "string", string ); + +var thisError = "no exception thrown"; +try{ + var number:Number = "string"; +} catch (e) { +//print( "hello?" ); + thisError = e.toString(); +} finally { + AddTestCase("number:Number = 'string'", "no exception thrown", typeError(thisError) ); + AddTestCase("number:Number = 'string'", NaN, number ); +} + +thisError = "no exception thrown"; +try{ + var myInt:int = "string"; +} catch(e1) { + thisError = e1.toString(); +} finally { + AddTestCase("myInt:int = 'string'", "no exception thrown", typeError(thisError) ); + AddTestCase("myInt:int = 'string'", 0, myInt ); +} + + +thisError = "no exception thrown"; +try{ + var myUint:uint = "string"; +} catch(e2) { + thisError = e2.toString(); +} finally { + AddTestCase("myUInt:uint = 'string'", "no exception thrown", typeError(thisError) ); + AddTestCase("myUInt:uint = 'string'", 0, myUint ); +} + + +thisError = "no exception thrown"; +try{ + var boolean:Boolean = "string"; +} catch(e3) { + thisError = e3.toString(); +} finally { + AddTestCase("boolean:Boolean = 'string'", "no exception thrown", typeError(thisError) ); + AddTestCase("boolean:Boolean = 'string'", true, boolean ); +} + +var object:Object = "string"; +AddTestCase( "var object:Object ='string'", "string", object); + +// empty string conversions --------------------------------------------------------------------- +var emptyString:String = ""; +AddTestCase( 'var string:String =""', "", emptyString ); + +thisError = "no exception thrown"; +try{ + var number:Number = ""; +} catch (e) { + thisError = e.toString(); +} finally { + AddTestCase("number:Number = ''", "no exception thrown", typeError(thisError) ); + AddTestCase("number:Number = ''", 0, number ); +} + +thisError = "no exception thrown"; +try{ + var myInt:int = ""; +} catch(e1) { + thisError = e1.toString(); +} finally { + AddTestCase("myInt:int = ''", "no exception thrown", typeError(thisError) ); + AddTestCase("myInt:int = ''", 0, myInt ); +} + + +thisError = "no exception thrown"; +try{ + var myUint:uint = ""; +} catch(e2) { + thisError = e2.toString(); +} finally { + AddTestCase("myUInt:uint = ''", "no exception thrown", typeError(thisError) ); + AddTestCase("myUInt:uint = ''", 0, myUint ); +} + + +thisError = "no exception thrown"; +try{ + var boolean:Boolean = ""; +} catch(e3) { + thisError = e3.toString(); +} finally { + AddTestCase("boolean:Boolean = ''", "no exception thrown", typeError(thisError) ); + + //Note that the boolean result for empty string is opposite a non-empty string + AddTestCase("boolean:Boolean = ''", false, boolean ); +} + +var object:Object = ""; +AddTestCase( "var object:Object =''", "", object); + + +test(); + + + diff --git a/mozilla/js/tamarin/test/as3/Types/Conversions/ImplicitConversionsTrue.as b/mozilla/js/tamarin/test/as3/Types/Conversions/ImplicitConversionsTrue.as new file mode 100644 index 00000000000..247923e91e4 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Types/Conversions/ImplicitConversionsTrue.as @@ -0,0 +1,97 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Types: Conversions"; +var VERSION = "as3"; +var TITLE = "implicit type conversions"; + +startTest(); + + +// Value = true + +var thisError = "no exception thrown"; +try{ + var string:String = true; +} catch (e0) { + thisError = e0.toString(); +} finally { + AddTestCase("string:String = true", "no exception thrown", typeError(thisError) ); + AddTestCase("string:String = true", "true", string); +} + +thisError = "no exception thrown"; +try{ + var number:Number = true; +} catch (e) { + thisError = e.toString(); +} finally { + AddTestCase("number:Number = true", "no exception thrown", typeError(thisError) ); + AddTestCase("number:Number = true", 1, number); +} + +thisError = "no exception thrown"; +try{ + var myInt:int = true; +} catch(e1) { + thisError = e1.toString(); +} finally { + AddTestCase("myInt:int = true", "no exception thrown", typeError(thisError) ); + AddTestCase("myInt:int = true", 1, myInt); +} + +thisError = "no exception thrown"; +try{ + var myUint:uint = true; +} catch(e2) { + thisError = e2.toString(); +} finally { + AddTestCase("myUInt:uint = true", "no exception thrown", typeError(thisError) ); + AddTestCase("myUInt:uint = true", 1, myUint); +} + +thisError = "no exception thrown"; +try{ + var boolean:Boolean = true; +} catch(e3) { + thisError = e3.toString(); +} finally { + AddTestCase("boolean:Boolean = true", "no exception thrown", typeError(thisError) ); +} + +var object:Object = true; +AddTestCase( "var object:Object = true", true, object); + + +test(); + + + diff --git a/mozilla/js/tamarin/test/as3/Types/Conversions/ImplicitConversionsUndefined.as b/mozilla/js/tamarin/test/as3/Types/Conversions/ImplicitConversionsUndefined.as new file mode 100644 index 00000000000..2659e40c927 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Types/Conversions/ImplicitConversionsUndefined.as @@ -0,0 +1,99 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Types: Conversions"; +var VERSION = "as3"; +var TITLE = "implicit type conversions"; + +startTest(); + + +// Value = undefined + +var thisError = "no exception thrown"; +try{ + var string:String = undefined; +} catch (e0) { + thisError = e0.toString(); +} finally { + AddTestCase( "var string:String =null", "no exception thrown", typeError(thisError)); + AddTestCase( "var string:String =null", null,string); +} + +thisError = "no exception thrown"; +try{ + var mynumber:Number = undefined; +} catch (e) { + thisError = e.toString(); +} finally { + AddTestCase("number:Number = undefined", "no exception thrown", typeError(thisError) ); + AddTestCase("number:Number = undefined", NaN, mynumber ); +} + +thisError = "no exception thrown"; +try{ + var myInt:int = undefined; +} catch(e1) { + thisError = e1.toString(); +} finally { + AddTestCase("myInt:int = undefined", "no exception thrown", typeError(thisError) ); + AddTestCase("myInt:int = undefined", 0, myInt ); +} + +thisError = "no exception thrown"; +try{ + var myUint:uint = undefined; +} catch(e2) { + thisError = e2.toString(); +} finally { + AddTestCase("myUInt:uint = undefined", "no exception thrown", typeError(thisError)); + + AddTestCase("myUInt:uint = undefined", 0, myUint); +} + +thisError = "no exception thrown"; +try{ + var myboolean:Boolean = undefined; +} catch(e3) { + thisError = e3.toString(); +} finally { + AddTestCase("myboolean:Boolean = undefined", "no exception thrown", typeError(thisError) ); + AddTestCase("myboolean:Boolean = undefined", false, myboolean); +} + +var object:Object = undefined; +AddTestCase( "var object:Object = null", null, object); + + +test(); + + + diff --git a/mozilla/js/tamarin/test/as3/Types/Int/intConstructor.as b/mozilla/js/tamarin/test/as3/Types/Int/intConstructor.as new file mode 100644 index 00000000000..0a2aca7d548 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Types/Int/intConstructor.as @@ -0,0 +1,81 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +var SECTION = "as3"; +var VERSION = "as3"; +startTest(); +var TITLE = "The int Constructor Called as a Function"; + +writeHeaderToLog( SECTION + " "+ TITLE); + +var testcases = new Array(); + +testcases = getTestCases(); + +test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase(SECTION, "int()", 0, int() ); + array[item++] = new TestCase(SECTION, "int(void 0)", 0, int(void 0) ); + array[item++] = new TestCase(SECTION, "int(null)", 0, int(null) ); + array[item++] = new TestCase(SECTION, "int()", 0, int() ); + array[item++] = new TestCase(SECTION, "int(new int())", 0, int( new int() ) ); + array[item++] = new TestCase(SECTION, "int(0)", 0, int(0) ); + array[item++] = new TestCase(SECTION, "int(1)", 1, int(1) ); + array[item++] = new TestCase(SECTION, "int(-1)", -1, int(-1) ); + array[item++] = new TestCase(SECTION, "int('string')", 0, int( "string") ); + array[item++] = new TestCase(SECTION, "int(new String())", 0, int( new String() ) ); + array[item++] = new TestCase(SECTION, "int('')", 0, int( "" ) ); + + array[item++] = new TestCase(SECTION, "int(new MyObject(100))", 100, int(new MyObject(100)) ); + + return ( array ); +} +/*function test() { + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +" = "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value "; + } + stopTest(); + return ( testcases ); +}*/ +function MyObject( value ) { + this.value = value; + this.valueOf = function() { return this.value; } +} diff --git a/mozilla/js/tamarin/test/as3/Types/Int/intIs.as b/mozilla/js/tamarin/test/as3/Types/Int/intIs.as new file mode 100644 index 00000000000..f2f82fbfecc --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Types/Int/intIs.as @@ -0,0 +1,81 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "Types: int"; + var VERSION = "as3"; + startTest(); + var TITLE = "x is int"; + + writeHeaderToLog( SECTION + " "+ TITLE ); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var c = 0; + array[item++] = new TestCase(SECTION, "var c=0;c is int",true, c is int ); + array[item++] = new TestCase(SECTION, "0 is int",true, 0 is int ); + + var d = 1; + array[item++] = new TestCase(SECTION, "var d=1;d is int",true, d is int ); + array[item++] = new TestCase(SECTION, "1 is int",true, 1 is int ); + + var e = uint.MAX_VALUE; + array[item++] = new TestCase(SECTION, "var e=uint.MAX_VALUE;e is int",false, e is int ); + array[item++] = new TestCase(SECTION, "uint.MAX_VALUE is int",false, uint.MAX_VALUE is int ); + array[item++] = new TestCase(SECTION, "4294967295 is int",false, 4294967295 is int ); + + var f:int = -1; + array[item++] = new TestCase(SECTION, "var f=-1;f is int",true, f is int ); + array[item++] = new TestCase(SECTION, "-1 is int",true, -1 is int ); + + var g:int = int.MAX_VALUE; + array[item++] = new TestCase(SECTION, "var g=int.MAX_VALUE;g is int",true, g is int ); + array[item++] = new TestCase(SECTION, "int.MAX_VALUE is int",true, int.MAX_VALUE is int ); + array[item++] = new TestCase(SECTION, "2147483647 is int",true, 2147483647 is int ); + + return ( array ); +} + +/*function test() { + for ( tc = 0; tc < testcases.length; tc++ ) { + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +" = "+ testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : "delete should not be allowed " + } + stopTest(); + return ( testcases ); +}*/ diff --git a/mozilla/js/tamarin/test/as3/Types/Int/intMaxValue.as b/mozilla/js/tamarin/test/as3/Types/Int/intMaxValue.as new file mode 100644 index 00000000000..163184f0865 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Types/Int/intMaxValue.as @@ -0,0 +1,86 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +var SECTION = "int.MAX_VALUE"; +var VERSION = "AS3"; +startTest(); +var TITLE = "int.MAX_VALUE"; + +writeHeaderToLog( SECTION + " "+ TITLE); + +var testcases = getTestCases(); + +test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + + // MAX_VALUE + array[item++] = new TestCase( SECTION, "int.MAX_VALUE", 2147483647, int.MAX_VALUE ); + + // MAX_VALUE should be read-only + delete( int.MAX_VALUE ); + array[item++] = new TestCase( SECTION, "delete( int.MAX_VALUE ); int.MAX_VALUE", 2147483647, int.MAX_VALUE ); + array[item++] = new TestCase( SECTION, "delete( int.MAX_VALUE )", false, delete(int.MAX_VALUE) ); + + // moved to error folder + //int.MAX_VALUE=0; + //array[item++] = new TestCase( SECTION, "int.MAX_VALUE=0,int.MAX_VALUE", 2147483647, int.MAX_VALUE ); + + var string:String = ''; + for ( var prop in int ) { + string += ( prop == 'MAX_VALUE' ) ? prop : ''; + } + + array[item++] = new TestCase( + SECTION, + "var string = ''; for ( prop in int) { string += ( prop == 'MAX_VALUE' ) ? prop : '' } string;", + "", + string + ); + + return ( array ); +} + +/*function test() { + for ( tc = 0; tc < testcases.length; tc++ ) { + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +" = "+ testcases[tc].actual ); + } + stopTest(); + return ( testcases ); +}*/ + + + diff --git a/mozilla/js/tamarin/test/as3/Types/Int/intMinValue.as b/mozilla/js/tamarin/test/as3/Types/Int/intMinValue.as new file mode 100644 index 00000000000..711c3cdc225 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Types/Int/intMinValue.as @@ -0,0 +1,85 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "int.MIN_VALUE"; + var VERSION = "AS3"; + startTest(); + var TITLE = "int.MIN_VALUE"; + + writeHeaderToLog( SECTION + " "+ TITLE ); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var MIN_VAL = -2147483648; + + array[item++] = new TestCase( SECTION, "int.MIN_VALUE", MIN_VAL, int.MIN_VALUE ); + + array[item++] = new TestCase( SECTION, "delete( int.MIN_VALUE )", false, delete( int.MIN_VALUE) ); + delete( int.MIN_VALUE ); + array[item++] = new TestCase( SECTION, "delete( int.MIN_VALUE ); int.MIN_VALUE", MIN_VAL, int.MIN_VALUE ); + + // moved to error folder, now gives compiler error in strict + /*int.MIN_VALUE=0; + array[item++] = new TestCase( + SECTION, + "int.MIN_VALUE=0; int.MIN_VALUE", + int.MIN_VALUE, + int.MIN_VALUE ); +*/ + var string = ''; + for ( var prop in int ) { + string += ( prop == 'MIN_VALUE' ) ? prop : ''; + } + + array[item++] = new TestCase( + SECTION, + "var string = ''; for ( prop in int ) { string += ( prop == 'MIN_VALUE' ) ? prop : '' } string;", + "", + string + ); + + return ( array ); +} +/*function test() { + for ( tc = 0; tc < testcases.length; tc++ ) { + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +" = "+ testcases[tc].actual ); + testcases[tc].reason += ( testcases[tc].passed ) ? "" : "delete should not be allowed " + } + stopTest(); + return ( testcases ); +}*/ diff --git a/mozilla/js/tamarin/test/as3/Types/Int/intType.as b/mozilla/js/tamarin/test/as3/Types/Int/intType.as new file mode 100644 index 00000000000..bfc15007d96 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Types/Int/intType.as @@ -0,0 +1,73 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "Types: int"; + var VERSION = "as3"; + startTest(); + var TITLE = "typeof an int"; + + writeHeaderToLog( SECTION + " "+ TITLE ); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var i:int = 3; + var result; + try{ + result = typeof i; + } catch (e) { + result = "exception thrown"; + } finally { + array[item++] = new TestCase(SECTION, "typeof i:int = 3", "number", result ); + } + + var ni:int = -1; + result = typeof ni; + array[item++] = new TestCase(SECTION, "typeof i:int = -1", "number", result ); + + + return ( array ); +} +/*function test() { + for ( tc = 0; tc < testcases.length; tc++ ) { + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +" = "+ testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : "delete should not be allowed " + } + stopTest(); + return ( testcases ); +}*/ diff --git a/mozilla/js/tamarin/test/as3/Types/Int/wraparound.as b/mozilla/js/tamarin/test/as3/Types/Int/wraparound.as new file mode 100644 index 00000000000..22e8c472aed --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Types/Int/wraparound.as @@ -0,0 +1,135 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "Wraparound_Conversion"; // provide a document reference (ie, Actionscript section) +var VERSION = "AS3"; // Version of ECMAScript or ActionScript +var TITLE = "Wraparound_Conversion"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + + +/////////////////////////////////////////////////////////////// +// add your tests here + +/* + Reference max / min vals: + int.MAX_VALUE: 2147483647 + int.MIN_VALUE: -2147483648 + uint.MAX_VALUE: 4294967295 + uint.MIN_VALUE: 0 + Number.MAX_VALUE: 1.79769313486231e+308 + Number.MIN_VALUE: 4.9406564584124654e-324 +*/ + +//simple wraparound tests + +//int +var intNum:int; + +var intMaxWrapAdd:int = int.MAX_VALUE + 1; +AddTestCase( "int.MAX_VALUE + 1 = -2147483648", -2147483648, intMaxWrapAdd ); + +intNum = int.MAX_VALUE; +intNum = intNum + 1; +AddTestCase( "int.MAX_VALUE + 1 = -2147483648", -2147483648, intNum ); + +intNum = int.MAX_VALUE; +intNum++; +AddTestCase( "increment int at int.MAX_VALUE", -2147483648, intNum ); + +var intMinWrapAdd:int = int.MIN_VALUE - 1; +AddTestCase( "int.MIN_VALUE - 1 = 2147483647", 2147483647, intMinWrapAdd ); + +intNum = int.MIN_VALUE; +intNum = intNum - 1; +AddTestCase( "int.MIN_VALUE - 1 = 2147483647", 2147483647, intNum ); + +intNum = int.MIN_VALUE; +intNum--; +AddTestCase( "decrement int at int.MIN_VALUE", 2147483647, intNum ); + +var intMaxWrapMult:int = int.MAX_VALUE * 2; +AddTestCase( "int.MAX_VALUE * 2 = -2", -2, intMaxWrapMult ); + +//uint +var uintNum:uint; + +var uintMaxWrapAdd:uint = uint.MAX_VALUE + 1; +AddTestCase( "uint.MAX_VALUE + 1 = 0", 0, uintMaxWrapAdd ); + +uintNum = uint.MAX_VALUE; +uintNum = uintNum + 1; +AddTestCase( "uint.MAX_VALUE + 1 = 0", 0, uintNum ); + +uintNum = uint.MAX_VALUE; +uintNum++; +AddTestCase( "increment uint at uint.MAX_VALUE", 0, uintNum ); + +var uintMinWrapAdd:uint = uint.MIN_VALUE - 1; +AddTestCase( "uint.MIN_VALUE - 1 = 4294967295", 4294967295, uintMinWrapAdd ); + +uintNum = uint.MIN_VALUE; +uintNum = uintNum - 1; +AddTestCase( "uint.MIN_VALUE - 1 = 4294967295", 4294967295, uintNum ); + +uintNum = uint.MIN_VALUE; +uintNum--; +AddTestCase( "decrement uint at uint.MIN_VALUE", 4294967295, uintNum ); + +var uintMaxWrapMult:uint = uint.MAX_VALUE * 2; +AddTestCase( "uint.MAX_VALUE * 2 = 4294967294", 4294967294, uintMaxWrapMult ); + +//bitwise shift tests + +intNum = int.MAX_VALUE; + +intNum = intNum << 1; +AddTestCase( "int.MAX_VALUE << 1", -2, intNum ); + +uintNum = uint.MAX_VALUE; + +// uint.MAX_VALUE << 1 (FFFFFFFF << 1 = 1FFFFFFFE) then to wraparound: 1FFFFFFFE % 100000000 which gives FFFFFFFE. +uintNum = uintNum << 1; +AddTestCase( "uint.MAX_VALUE << 1", 4294967294, uintNum ); + + +// +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. + + + + + + diff --git a/mozilla/js/tamarin/test/as3/Types/Uint/UintFunctionArg.as b/mozilla/js/tamarin/test/as3/Types/Uint/UintFunctionArg.as new file mode 100644 index 00000000000..d73d4466a6a --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Types/Uint/UintFunctionArg.as @@ -0,0 +1,181 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + +startTest(); // leave this alone + + + +function Uint1Arg(n1:uint):uint { + + var n2:uint = n1; + + return n2; + +} + +function UintMultiArgs(n1:uint, n2:uint, n3:uint):uint { + + var n4:uint = n1 + n2 + n3; + + return n4; + +} + +// mt: adding different types of args test cases +function diffArgs( arg1:int, arg2:uint, arg3:Number ):uint{ + return arg1+arg2+arg3; +} + +function returnNegUint():uint { + return -10; +} + +function addNegUintInFunc(){ + var a:uint; + var b = -100; + var c = 1; + return (a = b+c); +} + +AddTestCase( "Calling function with 1 uint argument", 1 , Uint1Arg(1) ); +AddTestCase( "Calling function with 1 uint argument", 6 , UintMultiArgs(1,2,3) ); + +// RangeError precision exceptions + +var pResult = null; +try{ + Uint1Arg(-1); + pResult = "exception NOT caught"; +} catch (e) { + pResult = "exception caught"; +} +AddTestCase( "Uint1Arg(-1)", "exception NOT caught" , pResult ); +AddTestCase( "Uint1Arg(-1)", 4294967295 , Uint1Arg(-1) ); +pResult = null; +try{ + UintMultiArgs(-1,-1,-1); + pResult = "exception NOT caught"; +} catch (e) { + pResult = "exception caught"; +} +AddTestCase( "UintMultiArgs(-1,-1,-1)", "exception NOT caught" , pResult ); +AddTestCase( "UintMultiArgs(-1,-1,-1)", 4294967293, UintMultiArgs(-1,-1,-1) ) +pResult = null; +try{ + diffArgs(-1,-1,-1); + pResult = "exception NOT caught"; +} catch (e) { + pResult = "exception caught"; +} +AddTestCase( "diffArgs(-1,-1,-1)", "exception NOT caught" , pResult ); +AddTestCase( "diffArgs(-1,-1,-1)", 4294967293 , diffArgs(-1,-1,-1) ); +pResult = null; +try{ + returnNegUint(); + pResult = "exception NOT caught"; +} catch (e) { + pResult = "exception caught"; +} +AddTestCase( "returnNegUint()", "exception NOT caught" , pResult ); +AddTestCase( "returnNegUint()", 4294967286 , returnNegUint() ); + +var n:Number = -20; + +pResult = null; +try{ + Uint1Arg(n); + pResult = "exception NOT caught"; +} catch (e) { + pResult = "exception caught"; +} +AddTestCase( "var n:Number = -20; Uint1Arg(n)", "exception NOT caught" , pResult ); + + + +pResult = null; +try{ + UintMultiArgs(n,n,n); + pResult = "exception NOT caught"; +} catch (e) { + pResult = "exception caught"; +} +AddTestCase( "var n:Number = -20; UintMultiArgs(n,n,n)", "exception NOT caught" , pResult ); + +pResult = null; +try{ + diffArgs(n,n,n); + pResult = "exception NOT caught"; +} catch (e) { + pResult = "exception caught"; +} +AddTestCase( "var n:Number = -20; diffArgs(n,n,n)", "exception NOT caught" , pResult ); + +var i:int = -20; + +pResult = null; +try{ + Uint1Arg(i); + pResult = "exception NOT caught"; +} catch (e) { + pResult = "exception caught"; +} +AddTestCase( "var i:int = -20; Uint1Arg(i)", "exception NOT caught" , pResult ); + +pResult = null; +try{ + UintMultiArgs(i,i,i); + pResult = "exception NOT caught"; +} catch (e) { + pResult = "exception caught"; +} +AddTestCase( "var i:int = -20; UintMultiArgs(i,i,i)", "exception NOT caught" , pResult ); + +pResult = null; +try{ + diffArgs(i,i,i); + pResult = "exception NOT caught"; +} catch (e) { + pResult = "exception caught"; +} +AddTestCase( "var i:int = -20; diffArgs(i,i,i)", "exception NOT caught" , pResult ); + +pResult = null; +try{ + addNegUintInFunc(); + pResult = "exception NOT caught"; +} catch (e) { + pResult = "exception caught"; +} +AddTestCase( "add negitive number to uint in function", "exception NOT caught" , pResult ); + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Types/Uint/UintHex.as b/mozilla/js/tamarin/test/as3/Types/Uint/UintHex.as new file mode 100644 index 00000000000..33aab0892e4 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Types/Uint/UintHex.as @@ -0,0 +1,42 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +startTest(); // leave this alone + + +var o:Object = new Object(); +var a:uint = 0x1fffffff; + +AddTestCase( "o.a = 0x1fffffff, o.b = -1, (o.a == o.b)", false, (o.a = a, o.b = -1, o.a == o.b) ); + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Types/Uint/UintIs.as b/mozilla/js/tamarin/test/as3/Types/Uint/UintIs.as new file mode 100644 index 00000000000..fcc6eeff8d1 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Types/Uint/UintIs.as @@ -0,0 +1,81 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "Types: uint"; + var VERSION = "as3"; + startTest(); + var TITLE = "x is uint"; + + writeHeaderToLog( SECTION + " "+ TITLE ); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var c = 0; + array[item++] = new TestCase(SECTION, "var c=0;c is uint",true, c is uint ); + array[item++] = new TestCase(SECTION, "0 is uint",true, 0 is uint ); + + var d = 1; + array[item++] = new TestCase(SECTION, "var d=1;d is uint",true, d is uint ); + array[item++] = new TestCase(SECTION, "1 is uint",true, 1 is uint ); + + var e = uint.MAX_VALUE; + array[item++] = new TestCase(SECTION, "var e=uint.MAX_VALUE;e is uint",true, e is uint ); + array[item++] = new TestCase(SECTION, "uint.MAX_VALUE is uint",true, uint.MAX_VALUE is uint ); + array[item++] = new TestCase(SECTION, "4294967295 is uint",true, 4294967295 is uint ); + + var f:int = -1; + array[item++] = new TestCase(SECTION, "var f=-1;f is uint",false, f is uint ); + array[item++] = new TestCase(SECTION, "-1 is uint",false, -1 is uint ); + + var g:int = int.MAX_VALUE; + array[item++] = new TestCase(SECTION, "var g=int.MAX_VALUE;g is uint",true, g is uint ); + array[item++] = new TestCase(SECTION, "int.MAX_VALUE is uint",true, int.MAX_VALUE is uint ); + array[item++] = new TestCase(SECTION, "2147483647 is uint",true, 2147483647 is uint ); + + return ( array ); +} + +function test() { + for ( tc = 0; tc < testcases.length; tc++ ) { + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +" = "+ testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : "delete should not be allowed " + } + stopTest(); + return ( testcases ); +} diff --git a/mozilla/js/tamarin/test/as3/Types/Uint/UintPublicClassMethodArg.as b/mozilla/js/tamarin/test/as3/Types/Uint/UintPublicClassMethodArg.as new file mode 100644 index 00000000000..d954d27acff --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Types/Uint/UintPublicClassMethodArg.as @@ -0,0 +1,196 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + +startTest(); // leave this alone + + +import UintPublicClassMethodArg.*; + +var obj = new UintPublicClass(); + +AddTestCase( "Calling function with 1 uint argument", 1 , obj.oneArg(1) ); +AddTestCase( "Calling function with 2 uint arguments", 3 , obj.twoArg(1,2) ); +AddTestCase( "Calling function with 3 uint arguments", 6 , obj.threeArg(1,2,3) ); +AddTestCase( "diffArg(uint, int, Number)", 6 , obj.diffArg(1,2,3) ); +AddTestCase( "diffArg(int, uint, Number)", 6 , obj.diffArg2(1,2,3) ); +AddTestCase( "diffArg(Number, int, uint)", 6 , obj.diffArg3(1,2,3) ); +AddTestCase( "useProp(4)", 14 , obj.useProp(4) ); +AddTestCase( "obj.pubProp = 10", 10 , obj.pubProp = 10 ); +AddTestCase( "UintPublicClass.pubStatProp = 11", 11 , UintPublicClass.pubStatProp = 11 ); + +// precision runtime errors + +var pResult = null; +try{ + obj.oneArg(-1); + pResult = "exception NOT caught"; +} catch (e) { + pResult = "exception caught"; +} +AddTestCase( "Precision runtime error one arg", "exception NOT caught", pResult ); + +pResult = null; +try{ + obj.twoArg(1,-2); + pResult = "exception NOT caught"; +} catch (e) { + pResult = "exception caught"; +} +AddTestCase( "Precision runtime error two args", "exception NOT caught", pResult ); + +pResult = null; +try{ + obj.threeArg(1,-2); + pResult = "exception NOT caught"; +} catch (e) { + pResult = "exception caught"; +} +AddTestCase( "Precision runtime error three args", "exception caught", pResult ); + +pResult = null; +try{ + obj.diffArg(-1,-2,-3); + pResult = "exception NOT caught"; +} catch (e) { + pResult = "exception caught"; +} +AddTestCase( "Precision runtime error diffArg", "exception NOT caught", pResult ); + +pResult = null; +try{ + obj.diffArg2(-1,-2,-3); + pResult = "exception NOT caught"; +} catch (e) { + pResult = "exception caught"; +} +AddTestCase( "Precision runtime error diffArg2", "exception NOT caught", pResult ); + +pResult = null; +try{ + obj.diffArg3(-1,-2,-3); + pResult = "exception NOT caught"; +} catch (e) { + pResult = "exception caught"; +} +AddTestCase( "Precision runtime error diffArg3", "exception NOT caught", pResult ); + +var n:Number = -20; + +pResult = null; +try{ + obj.oneArg(n); + pResult = "exception NOT caught"; +} catch (e) { + pResult = "exception caught"; +} +AddTestCase( "var n:Number = -20; obj.oneArg(n);", "exception NOT caught", pResult ); + +pResult = null; +try{ + obj.twoArg(n); + pResult = "exception NOT caught"; +} catch (e) { + pResult = "exception caught"; +} +AddTestCase( "var n:Number = -20; obj.twoArg(n);", "exception caught", pResult ); + +pResult = null; +try{ + obj.twoArg(n,n); + pResult = "exception NOT caught"; +} catch (e) { + pResult = "exception caught"; +} +AddTestCase( "var n:Number = -20; obj.twoArg(n,n);", "exception NOT caught", pResult ); + +pResult = null; +try{ + obj.threeArg(n,n,n); + pResult = "exception NOT caught"; +} catch (e) { + pResult = "exception caught"; +} +AddTestCase( "var n:Number = -20; obj.threeArg(n,n,n);", "exception NOT caught", pResult ); + +pResult = null; +try{ + obj.diffArg(n,n,n); + pResult = "exception NOT caught"; +} catch (e) { + pResult = "exception caught"; +} +AddTestCase( "var n:Number = -20; obj.diffArg(n,n,n)", "exception NOT caught", pResult ); + +pResult = null; +try{ + obj.diffArg2(n,n,n); + pResult = "exception NOT caught"; +} catch (e) { + pResult = "exception caught"; +} +AddTestCase( "var n:Number = -20; obj.diffArg2(n,n,n)", "exception NOT caught", pResult ); + +pResult = null; +try{ + obj.diffArg3(n,n,n); + pResult = "exception NOT caught"; +} catch (e) { + pResult = "exception caught"; +} +AddTestCase( "var n:Number = -20; obj.diffArg3(n,n,n)", "exception NOT caught", pResult ); + + +// uint properties of the class + +pResult = null; +try{ + obj.pubProp = -1; + pResult = "exception NOT caught"; +} catch (e) { + pResult = "exception caught"; +} +AddTestCase( "obj.pubProp = -1", "exception NOT caught", pResult ); + +pResult = null; + +try{ + UintPublicClass.pubStatProp = -1; + pResult = "exception NOT caught"; +} catch (e) { + pResult = "exception caught"; +} +AddTestCase( "UintPublicClass.pubStatProp = -1", "exception NOT caught", pResult ); + + +test(); // leave this alone. this executes the test cases and + // displays results. + diff --git a/mozilla/js/tamarin/test/as3/Types/Uint/UintPublicClassMethodArg/UintPublicClass.as b/mozilla/js/tamarin/test/as3/Types/Uint/UintPublicClassMethodArg/UintPublicClass.as new file mode 100644 index 00000000000..679d1a31e87 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Types/Uint/UintPublicClassMethodArg/UintPublicClass.as @@ -0,0 +1,74 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +// author: Michael Tilburg + +package UintPublicClassMethodArg { + + + public class UintPublicClass{ + + public var pubProp:uint; + public static var pubStatProp:uint; + + public function oneArg(arg:uint):uint { + return arg; + } + + public function twoArg(arg1:uint, arg2:uint):uint { + return arg1+arg2; + } + + public function threeArg(arg1:uint, arg2:uint, arg3:uint):uint { + return arg1+arg2+arg3; + } + + public function diffArg(arg1:uint, arg2:int, arg3:Number):uint{ + return arg1+arg2+arg3; + } + + public function diffArg2(arg1:int, arg2:uint, arg3:Number):uint{ + return arg1+arg2+arg3; + } + + public function diffArg3(arg1:Number, arg2:int, arg3:uint):uint{ + return arg1+arg2+arg3; + } + + public function useProp(arg1:uint):uint { + pubProp = 10; + return pubProp+arg1; + } + + } +} + + + diff --git a/mozilla/js/tamarin/test/as3/Types/Uint/UintType.as b/mozilla/js/tamarin/test/as3/Types/Uint/UintType.as new file mode 100644 index 00000000000..be2e0209351 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Types/Uint/UintType.as @@ -0,0 +1,67 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "Types: uint"; + var VERSION = "as3"; + startTest(); + var TITLE = "typeof an int"; + + writeHeaderToLog( SECTION + " "+ TITLE ); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var i:uint = 3; + var result; + try{ + result = typeof i; + } catch (e) { + result = "exception thrown"; + } finally { + array[item++] = new TestCase(SECTION, "typeof i:int", "number", result ); + } + return ( array ); +} +function test() { + for ( tc = 0; tc < testcases.length; tc++ ) { + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +" = "+ testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : "delete should not be allowed " + } + stopTest(); + return ( testcases ); +} diff --git a/mozilla/js/tamarin/test/as3/Types/Uint/UintVarAsClassProp.as b/mozilla/js/tamarin/test/as3/Types/Uint/UintVarAsClassProp.as new file mode 100644 index 00000000000..7aa5fcbfc58 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Types/Uint/UintVarAsClassProp.as @@ -0,0 +1,43 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +import UintVarAsClassProp.*; + +startTest(); // leave this alone + + +var obj = new testuint(); + +AddTestCase( "Uint public property", 1, obj.num1 ); + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Types/Uint/UintVarAsClassProp/UintVarAsClassProp.as b/mozilla/js/tamarin/test/as3/Types/Uint/UintVarAsClassProp/UintVarAsClassProp.as new file mode 100644 index 00000000000..ddffc19928d --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Types/Uint/UintVarAsClassProp/UintVarAsClassProp.as @@ -0,0 +1,39 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +package UintVarAsClassProp{ + +public class testuint { + public var num1:uint = 1; +} + +} + + diff --git a/mozilla/js/tamarin/test/as3/Types/Uint/UintVarOperationInFunc.as b/mozilla/js/tamarin/test/as3/Types/Uint/UintVarOperationInFunc.as new file mode 100644 index 00000000000..e2898cbfd33 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Types/Uint/UintVarOperationInFunc.as @@ -0,0 +1,58 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + +startTest(); // leave this alone + + + +function UintArgs(n1:uint , n2:uint):uint { + + var n3:uint; + + n3 = n1 + n2; + + n3 = n3 - 10; + + n3 = n3 * 10; + + n3 = n3 / 10; + + return n3; + +} + + +AddTestCase( "Calling function with 1 uint argument", 20 , UintArgs(20,10) ); + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Types/Uint/UintVarOperationInFuncRet.as b/mozilla/js/tamarin/test/as3/Types/Uint/UintVarOperationInFuncRet.as new file mode 100644 index 00000000000..220fc8d240b --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Types/Uint/UintVarOperationInFuncRet.as @@ -0,0 +1,49 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + +startTest(); // leave this alone + + + +function UintArgs(n1:uint , n2:uint):uint { + + + return ((((n1 + n2) - 10) * 10) / 10); + +} + + +AddTestCase( "Calling function with 1 uint argument", 20 , UintArgs(20,10) ); + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/as3/Types/Uint/UintVarOperations.as b/mozilla/js/tamarin/test/as3/Types/Uint/UintVarOperations.as new file mode 100644 index 00000000000..5b1864931f6 --- /dev/null +++ b/mozilla/js/tamarin/test/as3/Types/Uint/UintVarOperations.as @@ -0,0 +1,118 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +startTest(); // leave this alone + + +var num1:uint; +var num2:uint; +var num3:uint; +var num4:Number; +var num5:Number; + +num1 = 20; +num2 = 5; +num4 = 10; +num5 = -100; + +AddTestCase( "Uint addition", 25, (num3 = (num1 + num2)) ); +AddTestCase( "Uint subtraction", 15, (num3 = (num1 - num2)) ); +AddTestCase( "Uint multiplication", 100, (num3 = (num1 * num2)) ); +AddTestCase( "Uint division", 4, (num3 = (num1 / num2)) ); + +AddTestCase( "Adding uint and Number variables", 30, (num3 = (num1 + num4)) ); +AddTestCase( "Subtracting Number variable from uint variable", 10, (num3 = (num1 - num4)) ); +AddTestCase( "Multiplying uint and Number variable", 200, (num3 = (num1 * num4)) ); +AddTestCase( "Diving uint by a Number variable", 2, (num3 = (num1 / num4)) ); + +AddTestCase( "Adding uint and Number variables", 21, (num3 = (num1 + 1)) ); +AddTestCase( "Subtracting Number variable from uint variable", 0, (num3 = (num1 - 20)) ); +AddTestCase( "Multiplying uint and Number variable", 140, (num3 = (num1 * 7)) ); +AddTestCase( "Diving uint by a Number variable", 2, (num3 = (num1 / 10)) ); + +// RangeError precision test cases +var pResult = null; +try{ + var temp:uint; + temp = num1 + num5; + pResult = "exception NOT caught"; +} catch(e) { + pResult = "exception caught"; +} +AddTestCase( "var temp:uint; num1(+20) + num5(-100)", "exception NOT caught", pResult ); + +pResult = null; + +try{ + var temp:uint; + temp = -100; + pResult = "exception NOT caught"; +} catch(e) { + pResult = "exception caught"; +} +AddTestCase( "var temp:uint; temp = -100", "exception NOT caught", pResult ); + +//divide +pResult = null; +try{ + var temp:uint; + temp = -100/2; + pResult = "exception NOT caught"; +} catch(e) { + pResult = "exception caught"; +} +AddTestCase( "var temp:uint; temp = -100/2", "exception NOT caught", pResult ); + +// multiply +pResult = null; +try{ + var temp:uint; + temp = -100*2; + pResult = "exception NOT caught"; +} catch(e) { + pResult = "exception caught"; +} +AddTestCase( "var temp:uint; temp = -100*2", "exception NOT caught", pResult ); + +// subtract +pResult = null; +try{ + var temp:uint; + temp = 1-100; + pResult = "exception NOT caught"; +} catch(e) { + pResult = "exception caught"; +} +AddTestCase( "var temp:uint; temp = 1-100", "exception NOT caught", pResult ); + + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/e4x/Expressions/e11_1_1.as b/mozilla/js/tamarin/test/e4x/Expressions/e11_1_1.as new file mode 100644 index 00000000000..6761a117082 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Expressions/e11_1_1.as @@ -0,0 +1,210 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Rob Ginda rginda@netscape.com + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("11.1.1 - Attribute Identifiers"); + +x1 = + + + + + + +TEST_XML(1, "value1", x1.bravo.@attr1); +TEST_XML(2, "value2", x1.bravo.charlie.@attr1); + +correct = new XMLList(); +correct += new XML("value1"); +correct += new XML("value2"); +TEST(3, correct, x1..@attr1); + +n = new Namespace("http://someuri"); +TEST_XML(4, "value3", x1.bravo.@n::attr1); +TEST_XML(5, "value4", x1.bravo.charlie.@n::attr1); + +correct = new XMLList(); +correct += new XML("value3"); +correct += new XML("value4"); +TEST(6, correct, x1..@n::attr1); + +q = new QName("attr1"); +q2 = new QName(q, "attr1"); + +TEST(7.3, "attr1", q.toString()); +TEST(7.4, "attr1", q2.toString()); + +q = new QName(n, "attr1"); +q2 = new QName(q, "attr1"); +TEST(7, correct, x1..@[q]); +TEST(7.1, "http://someuri::attr1", q.toString()); +TEST(7.2, "http://someuri::attr1", q2.toString()); + +correct = new XMLList(); +correct += new XML("value1"); +correct += new XML("value3"); +correct += new XML("value2"); +correct += new XML("value4"); +TEST(8, correct, x1..@*::attr1); + +TEST_XML(9, "value1", x1.bravo.@["attr1"]); +TEST_XML(10, "value3", x1.bravo.@n::["attr1"]); +TEST_XML(11, "value3", x1.bravo.@[q]); +TEST_XML(12, "value3", x1.bravo.@[q2]); + + +y = +q3 = y.name(); + +AddTestCase("q3 = y.name()", "http://someuri::attr1", q3.toString()); +AddTestCase("x1.bravo.@[q3]", new XML("value3"), x1.bravo.@[q3]); + + +var xml1 = "pinkpurpleorange"; +var xml2 = "SpotMarcelVirginia"; +var xml3 = "yellow"; +var xml4 = "rainbow"; + +try { + var xml5 = ; + var res = "no exception"; + AddTestCase("Attribute with apostrophe in it", "has an apostrophe' in it", xml5.myTag.@myAttrib.toString()); +} catch (e1) { + var res = "exception"; +} finally { + // Needs to be fixed when bug 133471 is fixed + AddTestCase("Attribute with apostrophe in it", "no exception", res); +} + + +var placeHolder = "c"; + +var ns1 = new Namespace('yo', 'http://yo-raps.tv'); +var ns2 = new Namespace('mo', 'http://maureen.name'); + +AddTestCase("x1.node1[i].@attr", "1", + ( x1 = new XML(xml1), x1.color[0].@c.toString())); + +AddTestCase("x1.node1[i].@attr = \"new value\"", "5", + ( x1 = new XML(xml1), x1.color[0].@c = "5", x1.color[0].@c.toString())); + +AddTestCase("x1.node1[i].@[placeHolder]", "1", + ( x1 = new XML(xml1), x1.color[0].@[placeHolder].toString())); + +AddTestCase("x1.node1[i].@[placeHolder] = \"new value\"", "5", + ( x1 = new XML(xml1), x1.color[0].@[placeHolder] = "5", x1.color[0].@[placeHolder].toString())); + +AddTestCase("x1.node1[i].@attr", "giraffe", + ( x1 = new XML(xml2), x1.a[2].@a.toString())); + +AddTestCase("x1.node1[i].@attr = \"new value\"", "hippopotamus", + ( x1 = new XML(xml2), x1.a[2].@a = "hippopotamus", x1.a[2].@a.toString())); + +AddTestCase("x1.node1.@[attr-with-hyphen]", "got it", + ( x1 = new XML(xml3), x1.flower.@["attr-with-hyphen"].toString())); + +AddTestCase("x1.node1.@[attr-with-hyphen] = \"new value\"", "still got it", + ( x1 = new XML(xml3), x1.flower.@["attr-with-hyphen"] = "still got it", x1.flower.@["attr-with-hyphen"].toString())); + +AddTestCase("x1.namespace1::node1.@attr", "something", + ( x1 = new XML(xml4), x1.ns1::b.@attr.toString())); + +AddTestCase("x1.namespace1::node1.@attr = \"new value\"", "something else", + ( x1 = new XML(xml4), x1.ns1::b.@attr = "something else", x1.ns1::b.@attr.toString())); + + +var ns = new Namespace("foo"); +var y1 = ; +var an = 'a'; + +AddTestCase("y1.@a", "10", y1.@a.toString()); + +AddTestCase("y1.@[an]", "10", y1.@[an].toString()); + +AddTestCase("y1.@*", "10203040", y1.@*.toString()); // Rhino bug: doesn't include qualified attributes + +AddTestCase("y1.@ns::*", 2, y1.@ns::*.length()); + +var z = ; +AddTestCase("y1.@b", "200", (z.@b = 200, z.@b.toString())); + +AddTestCase("y1.@*", "103040", (delete y1.@b, y1.@*.toString())); + +// Adding for bug 117159 +var element:XML = new XML(); +AddTestCase("Reserved keyword used as attribute name", "foo", element.@["function"].toString()); + +var xmlObj = new XML (); +xmlObj = XML (''); + +try { + e = xmlObj.(@nonExistentAttribute == "nonExistent"); + result = e; +} catch (e2) { + result = referenceError(e2.toString()); +} +AddTestCase("Access non-existent attribute", "ReferenceError: Error #1065", result); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/Expressions/e11_1_2.as b/mozilla/js/tamarin/test/e4x/Expressions/e11_1_2.as new file mode 100644 index 00000000000..8232085e70c --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Expressions/e11_1_2.as @@ -0,0 +1,213 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("11.1.2 - Qualified Identifiers"); + +x1 = + + + + DIS + + +; + +soap = new Namespace("http://schemas.xmlsoap.org/soap/envelope/"); +stock = new Namespace("http://mycompany.com/stocks"); + +encodingStyle = x1.@soap::encodingStyle; +TEST_XML(1, "http://schemas.xmlsoap.org/soap/encoding/", encodingStyle); + +correct = + + + DIS + +; + +body = x1.soap::Body; +TEST_XML(2, correct.toXMLString(), body); + +body = x1.soap::["Body"]; +TEST_XML(3, correct.toXMLString(), body); + +q = new QName(soap, "Body"); +body = x1[q]; +TEST_XML(4, correct.toXMLString(), body); + +correct = +MYCO; + +x1.soap::Body.stock::getLastTradePrice.symbol = "MYCO"; +TEST_XML(5, correct.toXMLString(), x1.soap::Body.stock::getLastTradePrice.symbol); + +// SOAP messages +var msg1 = + + + DIS + + + + +var msg2 = + + + MACR + + + + +var msg3 = + + + MACR + + + + +var msg4 = + + + box + lace + soup + + + + +var msg5 = "soupboxlacehttp://www.hooping.org"; + +// declare namespaces +var ns1 = new Namespace("http://schemas.xmlsoap.org/soap/envelope/"); +var ns2= new Namespace ("http://mycompany.com/stocks/"); +var ns3= new Namespace ("http://macromedia.com/software/central/"); + +// extract the soap encoding style and body from the soap msg1 +var encodingStyle = msg1.@ns1::encodingStyle; +var stockURL = msg1.ns1::Body.ns2::GetLastTradePrice.@ns2::blah; + +var body = msg1.ns1::Body; + +// change the stock symbol +body.ns2::GetLastTradePrice.symbol = "MACR"; + + +AddTestCase("body.ns2::GetLastTradePrice.symbol = \"MACR\"", "MACR", + ( body.ns2::GetLastTradePrice.symbol.toString())); + + +bodyQ = msg1[QName(ns1, "Body")]; + +AddTestCase("ms1.ns1::Body == msg1[QName(ns1, \"Body\")]", true, (bodyQ == body)); + +AddTestCase("msg1 == msg2", true, + ( msg1 == msg2)); + +AddTestCase("msg1.@ns1::encodingStyle", "http://schemas.xmlsoap.org/soap/encoding/", + ( msg1.@ns1::encodingStyle.toString())); + +AddTestCase("msg3.ns1::Body.ns2::GetLastTradePrice.@ns2", "http://www.hooping.org", + ( msg3.ns1::Body.ns2::GetLastTradePrice.@ns2::blah.toString())); + + +// Rhino behaves differently: + +AddTestCase("msg4.bakery.ns3::g.@*", msg5, + ( msg4.bakery.ns3::g.@*.toString())); + +var x1 = 10; +var ns = new Namespace("foo"); + +AddTestCase("x1.ns::*", new XMLList("10").toString(), x1.ns::*.toString()); + +AddTestCase("x1.ns::a", "10", x1.ns::a.toString()) + +AddTestCase("x1.*::a", "10", x1.*::a.toString()); // issue: assert + +AddTestCase("x1.ns::a", "20", (x1.ns::a = 20, x1.ns::a.toString())); + +AddTestCase("x1.@ns::['v']", "55", x1.@ns::['v'].toString()); + +AddTestCase("x1.@ns::['v']", "555", (x1.@ns::['v'] = '555', x1.@ns::['v'].toString())); + +var y1 = +AddTestCase("y1.@ns::*.length()", 2, y1.@ns::*.length()); + +var z = new XMLList(""); +AddTestCase("x1.*", z.toString(), (delete x1.ns::a, x1.*.toString())); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/Expressions/e11_1_3.as b/mozilla/js/tamarin/test/e4x/Expressions/e11_1_3.as new file mode 100644 index 00000000000..0aae9bac3bc --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Expressions/e11_1_3.as @@ -0,0 +1,103 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("11.1.3 - Wildcard Identifiers"); + +var x1 = + + one + two + + +var correct = new XMLList("onetwo"); +TEST(1, correct, x1.*); + +XML.ignoreWhitespace = false; + +var xml1 = "

    123

    "; +var xml2 = "123"; +var xml3 = "hey there23"; +var xml4 = "

    hello

    "; + +var ns1 = new Namespace('foobar', 'http://boo.org'); +var ns2 = new Namespace('fooboo', 'http://foo.org'); +var ns3 = new Namespace('booboo', 'http://goo.org'); + +AddTestCase("x.a.*", "123", (x1 = new XML(xml1), x1.a.*.toString())); + +AddTestCase("xmllist.a.*", "123", (x1 = new XMLList(xml1), x1.a.*.toString())); + +AddTestCase("xmllist.*", "123", (x1 = new XMLList(xml2), x1.*.toString())); + +AddTestCase("xmllist[0].*", "1", (x1 = new XMLList(xml2), x1[0].*.toString())); + +AddTestCase("xmllist[0].e.*", "hey there", (x1 = new XMLList(xml3), x1[0].e.*.toString())); + +AddTestCase("xml.a.@*", "avm", (x1 = new XML(xml4), x1.a.@*.toString())); + + +END(); diff --git a/mozilla/js/tamarin/test/e4x/Expressions/e11_1_4.as b/mozilla/js/tamarin/test/e4x/Expressions/e11_1_4.as new file mode 100644 index 00000000000..ed3dd9dba78 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Expressions/e11_1_4.as @@ -0,0 +1,261 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("11.1.4 - XML Initializer"); + +XML.ignoreWhitespace = true; +person = John25; +TEST(1, John25, person); + +e = + Joe20 + Sue30 + ; + +TEST_XML(2, 1, e.employee[0].@id); + +correct = Sue; +TEST(3, correct, e.employee[1].name); + +names = new Array(); +names[0] = "Alpha"; +names[1] = "Bravo"; +names[2] = "Charlie"; +names[3] = "Delta"; +names[4] = "Echo"; +names[5] = "Golf"; +names[6] = "Hotel"; +names[7] = "India"; +names[8] = "Juliet"; +names[9] = "Kilo"; + +ages = new Array(); +ages[0] = "20"; +ages[1] = "21"; +ages[2] = "22"; +ages[3] = "23"; +ages[4] = "24"; +ages[5] = "25"; +ages[6] = "26"; +ages[7] = "27"; +ages[8] = "28"; +ages[9] = "29"; + +for (i = 0; i < 10; i++) +{ + e.*[i] = + {names[i].toUpperCase()} + {ages[i]} + ; + + correct = new XML("" + names[i].toUpperCase() + "" + ages[i] + ""); + TEST(4 + i, correct, e.*[i]); +} + +tagName = "name"; +attributeName = "id"; +attributeValue = 5; +content = "Fred"; + +x1 = <{tagName} {attributeName}={attributeValue}>{content}; +TEST(14, "Fred", x1.toXMLString()); + + + +// Test {} on XML and XMLList types +x1 = + + 30 + 50 +; + +correct = + + 50 + 30 +; + +x1 = {x1.width}{x1.length}; + +TEST(15, correct, x1); + +var content = "bar"; + +x1 = {content}; +correct = ; +correct.a = content; +TEST(16, correct, x1); + +x1 = ; +correct = ; +correct.@a = content; +TEST(17, correct, x1); + +a = 5; +b = 3; +c = "x"; +x1 = <{c} a={a + " < " + b + " is " + (a < b)}>{a + " < " + b + " is " + (a < b)}; +TEST(18, "5 < 3 is false", x1.toXMLString()); + +x1 = <{c} a={a + " > " + b + " is " + (a > b)}>{a + " > " + b + " is " + (a > b)}; +TEST(19, " 3 is true\">5 > 3 is true", x1.toXMLString()); + +var tagname = "name"; +var attributename = "id"; +var attributevalue = 5; +content = "Fred"; + +var xml1 = <{tagname} {attributename}={attributevalue}>{content}; + +AddTestCase( "x = <{tagname} {attributename}={attributevalue}>{content}", true, + ( x1 = new XML('Fred'), (xml1 == x1))); + + + +names = ["Alfred", "Allie", "Maryann", "Jason", "Amy", "Katja", "Antonio", "Melvin", "Stefan", "Amber"]; +ages = [55, 21, 25, 23, 28, 30, 35, 26, 30, 30]; + +var xml2; +var xml2string = ""; +var e = new Array(); +for (i = 0; i < 10; i++) { + e[i] = + {names[i].toUpperCase()} + {ages[i]} + ; + xml2string += "" + names[i].toUpperCase() + "" + ages[i] + ""; +} +xml2 = {e[0]}{e[1]}{e[2]}{e[3]}{e[4]}{e[5]}{e[6]}{e[7]}{e[8]}{e[9]}; +xml2string += ""; + +AddTestCase( "Evaluating expressions in a for loop", true, + ( x1 = new XML(xml2string), (xml2 == x1))); + + +var xml3 = John25; + +AddTestCase( "x = John25", true, + ( x1 = new XML(xml3.toString()), (xml3 == x1))); + +var xml4 = new XML("]]>"); + +AddTestCase( "]]>", true, + ( x1 = new XML("]]>"), (xml4 == x1))); + +xml5 = heh hey; +XML.ignoreWhitespace = true; + +AddTestCase( "heh hey", true, + ( x1 = new XML("heh hey"), (xml5 == x1))); + + +AddTestCase( "x = new XML(\"\"), xml = \"\", (xml == x)", true, + ( x1 = new XML(""), xml = "", (xml == x1))); + + + +var xx = new XML("
  • A
  • B
  • ]]>
    "); + +AddTestCase( "
  • A
  • B
  • ]]>
    , xml.toXMLString()", + "" + NL() + "
  • A
  • B
  • ]]>
    " + NL() + "
    ", + xx.toXMLString()); + +AddTestCase( "
  • A
  • B
  • ]]>
    , xml.description.text()", + "characteristics:
    • A
    • B
    ", + xx.description.text().toString()); + +AddTestCase( "
  • A
  • B
  • ]]>
    , xml.description.child(0)", + "characteristics:
    • A
    • B
    ", + xx.description.child(0).toString()); + +AddTestCase( "
  • A
  • B
  • ]]>
    , xml.description.child(0).nodeKind()", + "text", + xx.description.child(0).nodeKind()); + +var desc = "this is the text"; + +x1 = {""}; + +AddTestCase("desc = \"this is the text\"; x = {\"\"};", + "text
    ]]>", x1.toString()); + + +AddTestCase("desc = \"this is the text\"; x = {\"\"};", + "<![CDATA[this is the <i>text</i>]]>", x1.toXMLString()); + +// Testing for extra directives. See bug 94230. +var xx = + +; + +AddTestCase("Testing for extra directives", "", xx.toString()); + +xx = new XML(""); + +AddTestCase("Testing for extra directives", "", xx.toString()); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/Expressions/e11_1_5.as b/mozilla/js/tamarin/test/e4x/Expressions/e11_1_5.as new file mode 100644 index 00000000000..83c270543e2 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Expressions/e11_1_5.as @@ -0,0 +1,146 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("11.1.5 - XMLList Initializer"); + +XML.ignoreWhitespace = true; + +var docfrag = <>Phil35skiing; +TEST(1, "xml", typeof(docfrag)); + +var correct = Phil; +TEST(2, correct, docfrag[0]); + +var emplist = <> + Jim25 + Joe20 + Sue30 + ; + +TEST(3, "xml", typeof(emplist)); +TEST_XML(4, 2, emplist[2].@id); + +var myVar = "kitty"; + +var xml1 = <>1; +var xml2 = <>a; +var xml3 = <>b; +var xml4 = <>catwalkdogrun; +var xml5 = <>; +var xml6 = <><{myVar}>hello; +var xml7 = <>"quotes"{curly brackets}; +var xml8 = <>5 > 4; +var empxml = <> + Jim25 + Joe20 + Sue30 +; +emplist = "Jim25Joe20Sue30"; + + +AddTestCase( "<>1 == new XMLList(\"1\")", true, + ( x1 = new XMLList('1'), (xml1 == x1))); + +AddTestCase( "<>a == new XMLList('a')", true, + ( x1 = new XMLList('a'), (xml2 == x1))); + +AddTestCase( "<>b == new XMLList('b')", true, + ( x1 = new XMLList('b'), (xml3 == x1))); + +AddTestCase( "<>[list] == new XMLList([list])", true, + ( x1 = new XMLList('catwalkdogrun'), (xml4 == x1))); + +AddTestCase( "<> == new XMLList()", true, + ( x1 = new XMLList(), (xml5 == x1))); + +AddTestCase( "<> == new XMLList(\"\")", true, + ( x1 = new XMLList(""), (xml5 == x1))); + +AddTestCase( "<><{myVar}>hello == new XMLList('hello')", true, + ( x1 = new XMLList("hello"), (xml6 == x1))); + +AddTestCase( "<>{ \\\"\\\" { == new XMLList({ \"\" })", true, + ( x1 = new XMLList("\"quotes\"{curly brackets}"), (xml7 == x1))); + +AddTestCase( "<>5 > 4 == new XMLList('5 > 4')", true, + ( x1 = new XMLList("5 > 4"), (xml8 == x1))); + +AddTestCase( "Multiline XML", true, + ( x1 = new XMLList(emplist), (empxml == x1))); + +// Testing for extra directives. See bug 94230. +var xl = <> + +a; + +AddTestCase("Testing for extra directives", <>a, xl); + +xl = new XMLList("a"); + +AddTestCase("Testing for extra directives", new XMLList("a"), xl); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/Expressions/e11_2_1.as b/mozilla/js/tamarin/test/e4x/Expressions/e11_2_1.as new file mode 100644 index 00000000000..e13d0a8649c --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Expressions/e11_2_1.as @@ -0,0 +1,293 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("11.2.1 - Property Accessors"); + +order = + + + John + Doe + + + Big Screen Television + 1299.99 + 1 + +; + +correct = + + John + Doe +; + +TEST(1, correct, order.customer); +TEST_XML(2, 123456, order.@id); + +correct = + + Big Screen Television + 1299.99 + 1 + + +TEST(3, correct, order.children()[1]); + +correct = + + John + Doe + + + + Big Screen Television + 1299.99 + 1 +; + + +TEST(4, correct, order.*); + +correct = new XMLList(); +correct += new XML("123456"); +correct += new XML("Mon Mar 10 2003 16:03:25 GMT-0800 (PST)"); +TEST(5, correct, order.@*); + +order = + + John + Doe + + + Big Screen Television + 1299.99 + 1 + + + DVD Player + 399.99 + 1 + + ; + +correct = +Big Screen Television + +DVD Player; + +TEST(6, correct, order.item.description); + +correct = new XMLList(); +correct += new XML("3456"); +correct += new XML("56789"); +TEST(7, correct, order.item.@id); + +correct = + + DVD Player + 399.99 + 1 + + +TEST(8, correct, order.item[1]); + +correct = +Big Screen Television + +1299.99 + +1 + +DVD Player + +399.99 + +1; + +TEST(9, correct, order.item.*); + +correct= +1299.99; + +TEST(10, correct, order.item.*[1]); + +// get the first (and only) order [treating single element as a list] +order = + + John + Doe + + + Big Screen Television + 1299.99 + 1 + + + DVD Player + 399.99 + 1 + + ; + + +TEST(11, order, order[0]); + +// Any other index should return undefined +TEST(12, undefined, order[1]); + +var xml = "JohnDoeB

    1299.99

    1
    A

    12.99

    1
    "; + +// XML object test cases + +AddTestCase("XML.c.f:", "John", (o = new XML(xml), o.c.f.toString())); + +AddTestCase("XML.c['f']:", "John", (o = new XML(xml), o.c['f'].toString())); + +AddTestCase("XML.c.f[0]:", "John", (o = new XML(xml), o.c.f[0].toString())); + +AddTestCase("XML.i[1].p:", "12.99", (o = new XML(xml), o.i[1].p.toString())); + +AddTestCase("XML.i[1]['p]'", "12.99", (o = new XML(xml), o.i[1]['p'].toString())); + + +// High ASCII test +var xmlHighASCII = "Sören Lehmenkühler"; + +AddTestCase("High ASCII node value:", "Sören Lehmenkühler", (o = new XML(xmlHighASCII), o.fname.toString())); + + +// XMLList object test cases + +AddTestCase("XMLList.c.f:", "John", (ol = new XMLList(xml), ol.c.f.toString())); + +AddTestCase("XMLList.c[\"f\"]:", "John", (ol = new XMLList(xml), ol.c["f"].toString())); + +AddTestCase("XMLList.c.f[0]:", "John", (o = new XMLList(xml), o.c.f[0].toString())); + +AddTestCase("XMLList.c.f[0] = \"Peter\":", "Peter", (o = new XMLList(xml), o.c.f[0] = "Peter", o.c.f[0].toString())); + +AddTestCase("XMLList.i[1].p:", "12.99", (ol = new XMLList(xml), ol.i[1].p.toString())); + +AddTestCase("XMLList.i[1][\"p\"]:", "12.99", (ol = new XMLList(xml), ol.i[1]["p"].toString())); + +AddTestCase("XMLList[1] = b", "b", (ol = new XMLList(), ol[1] = b, ol.toString())); + +AddTestCase("XMLList[1] = b; XMLList[0] = d", "d", (ol = new XMLList(), ol[1] = b, ol[0] = d, ol.toString())); + +AddTestCase("XMLList[0] = b; XMLList[1] = d", new XMLList("bd"), (ol = new XMLList(), ol[0] = b, ol[1] = d, ol)); + + +var x1 = new XML("abc"); +var y1 = x1.fname; + +AddTestCase("x1.f == x1.f[0] + x1.f[1] + x1.f[2]", x1.fname[0] + x1.fname[1] + x1.fname[2], +x1.fname); + +// comparing XML and XMLList equivalents + +AddTestCase("XML[0].fname[1] == XMLList[1]:", true, (y1 = x1.fname, (x1[0].fname[1] == y1[1]))); + +AddTestCase("XML[0].fname[0] == XMLList.fname[0]:", true, (y1 = new XMLList(x1), (x1[0].fname[0] == y1.fname[0]))); + + +var hyphenatedXML = new XML("blueorangeyellow"); + +AddTestCase("hyphenatedXML.[\"b-c\"]:", "orange", (hyphenatedXML["b-c"][1].toString())); + +AddTestCase("hyphenatedXML.[\"b-c\"][1] = \"new color\":", "pink", (hyphenatedXML["b-c"][1] = "pink", hyphenatedXML["b-c"][1].toString())); + +xL = y; + +AddTestCase("x['*']", "y", xL['*'].toString()); +AddTestCase("x['@*']", "aatrbatr", xL['@*'].toString()); +AddTestCase("x['@a']", "aatr", xL['@a'].toString()); + +xL = some text; + +AddTestCase("x1.@prop", "prop3", xL.@prop.toString()); + +function setNS1() { + use namespace foo; + AddTestCase("use namespace foo; x1.@prop", "prop1prop3", xL.@prop.toString()); +} + +function setNS2() { + namespace foo2 = "bar"; + use namespace foo2; + AddTestCase("use namespace foo2; x1.@prop", "prop2prop3", xL.@prop.toString()); +} + +function setNS3() { + use namespace foo; + namespace foo2 = "bar"; + use namespace foo2; + AddTestCase("use namespace foo2; x1.@prop", "prop1prop2prop3", xL.@prop.toString()); +} + +namespace foo = "foo"; + +setNS1(); + +setNS2(); + +setNS3(); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/Expressions/e11_2_2.as b/mozilla/js/tamarin/test/e4x/Expressions/e11_2_2.as new file mode 100644 index 00000000000..e95e18c6938 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Expressions/e11_2_2.as @@ -0,0 +1,158 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Rob Ginda rginda@netscape.com + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("11.2.2 - Function Calls"); + + +rectangle = + 50 + 75 + 20 + 30 + ; + + +TEST(1, 1, rectangle.length()); + +TEST(2, 20, rectangle.length); + +shipto = + Fred Jones + 123 Foobar Ave. + Redmond, WA, 98008 + ; + + +upperName = shipto.name.toUpperCase(); +TEST(3, "FRED JONES", upperName); + +upperName = shipto.name.toString().toUpperCase(); +TEST(4, "FRED JONES", upperName); +upperName = shipto.name.toUpperCase(); +TEST(5, "FRED JONES", upperName); + +citystatezip = shipto.citystatezip.split(", "); +state = citystatezip[1]; +TEST(6, "WA", state); +zip = citystatezip[2]; +TEST(7, "98008", zip); + + +citystatezip = shipto.citystatezip.toString().split(", "); +state = citystatezip[1]; +TEST(8, "WA", state); +zip = citystatezip[2]; +TEST(9, "98008", zip); + +foo = hello; +var1 = foo.apple; +foo.apple = "moi"; +TEST(10, moi, var1); + +// Test method name/element name conflicts + +x1 = + + Foo + Bar +; + +TEST(11, QName("alpha"), x1.name()); +TEST(12, Bar, x1.length); +TEST(13, 1, x1.length()); +TEST(14, x1, x1.(length == "Bar")); + +x1.name = "foobar"; + +TEST(15, foobar, (x1.name)); +TEST(16, QName("alpha"), (x1.name())); + +var xml = "Bubba"; + +AddTestCase("person.name:", "Bubba", (x1 = new XML(xml), x1.name.toString())); + +AddTestCase("person.name():", "person", (x1 = new XML(xml), x1.name().toString())); + + +xml = "530"; + +AddTestCase("i.length:", "5", (x1 = new XML(xml), x1.length.toString())); + +AddTestCase("i.length():", 1, (x1 = new XML(xml), x1.length())); + + +xml = "abc"; +var p = new XMLList(xml).parent; + +AddTestCase("x.parent:", p, (x1 = new XML(xml), x1.parent)); + +AddTestCase("x.parent():", undefined, (x1 = new XML(xml), x1.parent())); + +AddTestCase("x.parent.parent():", x1, (x1 = new XML(xml), x1.parent.parent())); + + + +END(); diff --git a/mozilla/js/tamarin/test/e4x/Expressions/e11_2_3.as b/mozilla/js/tamarin/test/e4x/Expressions/e11_2_3.as new file mode 100644 index 00000000000..2cbb79cb778 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Expressions/e11_2_3.as @@ -0,0 +1,128 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("11.2.3 - XML Descendant Accessor"); + +var e = + + Joe20 + Sue30 + + +names = e..name; + +correct = +Joe + +Sue; + +TEST(1, correct, names); + +e = "Joe20Sue30"; + +AddTestCase("xml..validnode:", "Joe", (x1 = new XML(e), names = x1..name, names[0].toString())); + +AddTestCase("xml..validnode length:", 2, (x1 = new XML(e), names = x1..name, names.length())); + +AddTestCase("xml..invalidnode:", undefined, (x1 = new XML(e), names = x1..hood, names[0])); + +AddTestCase("xmllist..validnode:", "Joe", (x1 = new XMLList(e), names = x1..name, names[0].toString())); + +AddTestCase("xmllist..invalidnode:", undefined, (x1 = new XMLList(e), names = x1..hood, names[0])); + +AddTestCase("xmllist..invalidnode length:", 0, (x1 = new XMLList(e), names = x1..hood, names.length())); + +e = + + Joe20 + Sue30 + + +correct = +Joe + +Sue; + +names = e..first_name; + +TEST(2, correct, names); + +e = + + Joe20 + Sue30 + + +e = + + heart + part + + +es = <>heartheartpartpart; + +AddTestCase(3, es, e..bug); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/Expressions/e11_2_4.as b/mozilla/js/tamarin/test/e4x/Expressions/e11_2_4.as new file mode 100644 index 00000000000..f9165dc13f0 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Expressions/e11_2_4.as @@ -0,0 +1,213 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("11.2.4 - XML Filtering Predicate Operator"); + +var p; + +e = + John20 + Sue30 + ; + + +correct = John20; + +john = e.employee.(fname == "John"); +TEST(1, correct, john); + +john = e.employee.(fname == "John"); +TEST(2, correct, john); + +correct = +John20 + +Sue30; + +twoEmployees = e.employee.(@id == 0 || @id == 1); +TEST(3, correct, twoEmployees); + +twoEmployees = e.employee.(@id == 0 || @id == 1); +TEST(4, correct, twoEmployees); + +i = 0; +twoEmployees = new XMLList(); +for each (p in e..employee) +{ + if (p.@id == 0 || p.@id == 1) + { + twoEmployees += p; + } +} +TEST(5, correct, twoEmployees); + +i = 0; +twoEmployees = new XMLList(); +for each (p in e..employee) +{ + if (p.@id == 0 || p.@id == 1) + { + twoEmployees[i++] = p; + } +} +TEST(6, correct, twoEmployees); + +// test with syntax +e = + John20 + Sue30 + ; + +correct = +John20 + +Sue30; + +i = 0; +twoEmployees = new XMLList(); +for each (p in e..employee) +{ + with (p) + { + if (@id == 0 || @id == 1) + { + twoEmployees[i++] = p; + } + } +} +TEST(7, correct, twoEmployees); + +var xml = "Joe20SueJoe"; +var e = new XML(xml); + +// get employee with fname Joe +AddTestCase("e.employee.(fname == \"Joe\")", 1, (joe = e.employee.(fname == "Joe"), joe.length())); + + +// employees with id's 0 & 1 +AddTestCase("employees with id's 1 & 2", 2, (emps = e.employee.(@id == 1 || @id == 2), emps.length())); + + +// name of employee with id 1 +AddTestCase("name of employee with id 1", "Joe", (emp = e.employee.(@id == 1).fname, emp.toString())); + + +// get the two employees with ids 0 and 1 using a predicate +var i = 0; +var twoEmployees = new XMLList(); +for each (p in e..employee) { + with (p) { + if (@id == 1 || @id == 2) { + twoEmployees[i++] = p; + } + } +} + +var twoEmployees = e..employee.(@id == 1 || @id == 2); + +AddTestCase("Compare to equivalent XMLList", true, (emps = e..employee.(@id == 1 || @id == 2), emps == twoEmployees)); + + var employees:XML = + + + +
    +11 Main St. +San Francisco +CA +98765 +
    +
    + + +
    +99 Broad St. +Newton +MA +01234 +
    +
    +
    ; + +for each (var id:XML in employees.employee.@id) { +trace(id); // 123-123-1234 +} + +correct = + + +
    +99 Broad St. +Newton +MA +01234 +
    +
    ; + +var idToFind:String = "2"; +AddTestCase("employees.employee.(@id == idToFind)", correct, (employees.employee.(@id == idToFind))); + + +END(); diff --git a/mozilla/js/tamarin/test/e4x/Expressions/e11_3_1.as b/mozilla/js/tamarin/test/e4x/Expressions/e11_3_1.as new file mode 100644 index 00000000000..eab3c2f797c --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Expressions/e11_3_1.as @@ -0,0 +1,515 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("11.3.1 - Delete Operator"); + +order = + + + John + Doe +
    123 Foobar Ave.
    + Bellevue + WA +
    + + Big Screen Television + 1299.99 + 1 + + + Big Screen Television + 1299.99 + 1 + + + DVD Player + 399.99 + 1 + +
    ; + +// Delete the customer address +correct = + + + John + Doe + Bellevue + WA + + + Big Screen Television + 1299.99 + 1 + + + Big Screen Television + 1299.99 + 1 + + + DVD Player + 399.99 + 1 + +; + +delete order.customer.address; +TEST_XML(1, "", order.customer.address); +TEST(2, correct, order); + +order = + + + John + Doe +
    123 Foobar Ave.
    + Bellevue + WA +
    + + Big Screen Television + 1299.99 + 1 + + + Big Screen Television + 1299.99 + 1 + + + DVD Player + 399.99 + 1 + +
    ; + +// delete the custmomer ID +correct = + + + John + Doe +
    123 Foobar Ave.
    + Bellevue + WA +
    + + Big Screen Television + 1299.99 + 1 + + + Big Screen Television + 1299.99 + 1 + + + DVD Player + 399.99 + 1 + +
    ; + +delete order.customer.@id; +TEST_XML(3, "", order.customer.@id); +TEST(4, correct, order); + +order = + + + John + Doe +
    123 Foobar Ave.
    + Bellevue + WA +
    + + Big Screen Television + 1299.99 + 1 + + + Big Screen Television + 1299.99 + 1 + + + DVD Player + 399.99 + 1 + +
    ; + +// delete the first item price +correct = + + + John + Doe +
    123 Foobar Ave.
    + Bellevue + WA +
    + + Big Screen Television + 1 + + + Big Screen Television + 1299.99 + 1 + + + DVD Player + 399.99 + 1 + +
    ; + +delete order.item.price[0]; +TEST_XML(5, "", order.item[0].price); +TEST(6, 1299.99, order.item.price[0]); +TEST(7, order, correct); + +order = + + + John + Doe +
    123 Foobar Ave.
    + Bellevue + WA +
    + + Big Screen Television + 1299.99 + 1 + + + Big Screen Television + 1299.99 + 1 + + + DVD Player + 399.99 + 1 + +
    ; + +// delete all the items +correct = + + + John + Doe +
    123 Foobar Ave.
    + Bellevue + WA +
    +
    ; + +delete order.item; +TEST_XML(8, "", order.item); +TEST(9, correct, order); + +order = + + + John + Doe +
    123 Foobar Ave.
    + Bellevue + WA +
    + + Big Screen Television + 1299.99 + 1 + + + Big Screen Television + 1299.99 + 1 + + + DVD Player + 399.99 + 1 + +
    ; + + +// delete all description tags with descendant operator +// is not supposed to do anything, see bug 149397 +correct = + + + John + Doe +
    123 Foobar Ave.
    + Bellevue + WA +
    + + Big Screen Television + 1299.99 + 1 + + + Big Screen Television + 1299.99 + 1 + + + DVD Player + 399.99 + 1 + +
    ; + + +delete order..description; +TEST(10, correct, order); + +order = + + + John + Doe +
    123 Foobar Ave.
    + Bellevue + WA +
    + + Mary + Jones +
    456 Foobar Ave.
    + Bel Air + CA +
    +
    ; + +try { + delete order.customer.(firstname == "John"); + result = order; +} catch (e1) { + result = typeError(e1.toString()); +} + +AddTestCase("Delete an XMLList", "TypeError: Error #1119", result); + +order = + + + John + Doe +
    123 Foobar Ave.
    + Bellevue + WA +
    + + Big Screen Television + 1299.99 + 1 + + + Big Screen Television + 1299.99 + 1 + + + DVD Player + 399.99 + 1 + +
    ; + +// delete all id attributes +correct = + + + John + Doe +
    123 Foobar Ave.
    + Bellevue + WA +
    + + Big Screen Television + 1299.99 + 1 + + + Big Screen Television + 1299.99 + 1 + + + DVD Player + 399.99 + 1 + +
    ; + + +delete order.item.@id; +TEST(11, correct, order); + +order = + + + + John + Doe +
    123 Foobar Ave.
    + Bellevue + WA +
    + + Big Screen Television + 1299.99 + 1 + + + Big Screen Television + 1299.99 + 1 + + + DVD Player + 399.99 + 1 + +
    +
    ; + +// delete all id attributes, using descendant operator +correct = + + + + John + Doe +
    123 Foobar Ave.
    + Bellevue + WA +
    + + Big Screen Television + 1299.99 + 1 + + + Big Screen Television + 1299.99 + 1 + + + DVD Player + 399.99 + 1 + +
    +
    ; + + +delete order..item.@id; +TEST(12, correct, order); + +//default xml namespace = "http://someuri"; +x1 = ; +x1.a.b = "foo"; +delete x1.a.b; +TEST_XML(10, "", x1.a.b); + +var ns = new Namespace(""); +x1.a.b = foo; +TEST(11, "foo", x1.a.ns::b.toString()); + +delete x1.a.b; +TEST(12, "", x1.a.ns::b.toString()); + +delete x1.a.ns::b; +TEST_XML(13, "", x1.a.ns::b); + +var y1; +x1 = new XML("CD"); +y1 = new XML("C"); + +AddTestCase("delete XML:", true, (delete x1.b.d, (x1 == y1))); + + + +x1 = new XMLList("ABC"); +y1 = new XMLList("AC"); + +AddTestCase("delete XMLList:", true, (delete x1.b, (x1 == y1))); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/Expressions/e11_3_2.as b/mozilla/js/tamarin/test/e4x/Expressions/e11_3_2.as new file mode 100644 index 00000000000..2609b4b00d3 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Expressions/e11_3_2.as @@ -0,0 +1,90 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("11.3.2 - Typeof Operator"); + +x1 = new XML(); +TEST(1, "xml", typeof(x1)); +x1 = new XMLList(); +TEST(2, "xml", typeof(x1)); + + + +x1 = new XML("CD"); +x_ = new XML("E"); + +AddTestCase( "typeof XML :", "xml", typeof(x1) ); +AddTestCase( "typeof XML :", "xml", typeof(x1.a.b+x_) ); + +x1 = new XMLList("ABC"); +x_ = new XMLList("D"); + +AddTestCase( "typeof XMLList :", "xml", typeof(x1) ); +AddTestCase( "typeof XMLList :", "xml", typeof(x1+x_) ); + + +END(); diff --git a/mozilla/js/tamarin/test/e4x/Expressions/e11_4_1.as b/mozilla/js/tamarin/test/e4x/Expressions/e11_4_1.as new file mode 100644 index 00000000000..986ffc5b380 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Expressions/e11_4_1.as @@ -0,0 +1,197 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("11.4.1 - Addition Operator"); + +employeeData = Fred + 28 + skiing; +TEST(1, "xml", typeof(employeeData)); +correct = <>Fred28skiing; +TEST(2, correct, employeeData); + +order = + + Big Screen Television + + + DVD Player + + + CD Player + + + 8-Track Player + + ; + +correct = +Big Screen Television + +CD Player + +8-Track Player; + +myItems = order.item[0] + order.item[2] + order.item[3]; +TEST(3, "xml", typeof(myItems)); +TEST(4, correct, myItems); + +correct = +Big Screen Television + +DVD Player + +CD Player + +8-Track Player + +New Item; + +newItems = order.item + New Item; +TEST(5, "xml", typeof(newItems)); +TEST(6, correct, newItems); + +order = + + + Big Screen Television + 1299.99 + + + DVD Player + 399.99 + + + CD Player + 199.99 + + + 8-Track Player + 69.99 + +; + + +totalPrice = +order.item[0].price + +order.item[1].price; +TEST(7, "number", typeof(totalPrice)); +TEST(8, 1699.98, totalPrice); + +totalPrice = +order.item[1].price + +order.item[3].price; +TEST(9, 469.98, totalPrice); + + +order = + + +
    + 123 Foobar Ave. + Bellevue + WA + 98008 +
    +
    +
    ; + +streetCity = "" + order.customer.address.street + order.customer.address.city; +TEST(10, "string", typeof(streetCity)); +TEST(11, "123 Foobar Ave.Bellevue", streetCity); + + +statezip = String(order.customer.address.state) + order.customer.address.zip; +TEST(12, "string", typeof(statezip)); +TEST(13, "WA98008", statezip); + +// XML + XML + +var x1, y1, z1; + +x1 = new XML("AB"); +y1 = new XML("CD"); +z1 = new XMLList("ABCD"); + +AddTestCase( "XML + XML: ", true, ((x1+y1)==z1) ); + + +// XML + XMLList + +x1 = new XML("AB"); +y1 = new XMLList("CDE"); +z1 = new XMLList("ABCDE"); + +AddTestCase( "XML + XMLList: ", true, ((x1+y1)==z1) ); + + +// XMLList + XML + +x1 = new XMLList("CDE"); +y1 = new XML("AB"); +z1 = new XMLList("CDEAB"); + +AddTestCase( "XMLList + XML: ", true, ((x1+y1)==z1) ); + + +// XMLList + XMLList + +x1 = new XMLList("ABC"); +y1 = new XMLList("DEF"); +z1 = new XMLList("ABCDEF"); + +AddTestCase( "XMLList + XMLList: ", true, ((x1+y1)==z1) ); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/Expressions/e11_5_1.as b/mozilla/js/tamarin/test/e4x/Expressions/e11_5_1.as new file mode 100644 index 00000000000..d271f31e3c8 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Expressions/e11_5_1.as @@ -0,0 +1,225 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("11.5.1 - Equality Operators"); + +x1 = one; +y1 = one; +TEST(1, true, (x1 == y1) && (y1 == x1)); + +var myxml:XML = foo; +var str1:String = "foo"; +TEST(17, true, myxml.hasSimpleContent()); +TEST(18, true, myxml==str1); + + +// Should return false if comparison is not XML +y1 = "one"; +TEST(2, false, (x1 == y1) || (y1 == x1)); + +y1 = undefined +TEST(3, false, (x1 == y1) || (y1 == x1)); + +y1 = null +TEST(4, false, (x1 == y1) || (y1 == x1)); + +// Should check logical equiv. +x1 = onetwo; +y1 = onetwo; +TEST(5, true, (x1 == y1) && (y1 == x1)); + +y1 = onetwo; +TEST(6, false, (x1 == y1) || (y1 == x1)); + +m = new Namespace(); +n = new Namespace(); +TEST(7, true, m == n); + +m = new Namespace("uri"); +TEST(8, false, m == n); + +n = new Namespace("ns", "uri"); +TEST(9, true, m == n); + +m = new Namespace(n); +TEST(10, true, m == n); + +TEST(11, false, m == null); +TEST(12, false, null == m); + +m = new Namespace("ns", "http://anotheruri"); +TEST(13, false, m == n); + +p = new QName("a"); +q = new QName("b"); +TEST(14, false, p == q); + +q = new QName("a"); +TEST(15, true, p == q); + +q = new QName("http://someuri", "a"); +TEST(16, false, p == q); + +q = new QName(null, "a"); +TEST(16, false, p == q); + +var x1 = new XML("ABC"); +var y0 = new XML("AB"); +var y1 = new XML("ABC"); +var y2 = new XML("ABC"); +var y3 = new XML("DeeEeeFee"); + +AddTestCase( "x=XMLList, y=XML :", false, (x1==y0) ); +AddTestCase( "x=XMLList, y=XMLList :", true, (x1==y1) ); +AddTestCase( "x=XMLList, y=XMLList :", false, (x1==y2) ); +AddTestCase( "x=XMLList, y=XMLList :", false, (x1==y3) ); + + +var xt = new XML("text"); +var xa = new XML("attribute"); +var xh = new XML("hasSimpleContent"); +var yt = new XML("text"); +var ya = new XML("attribute"); +var yh = new XML("hasSimpleContent"); + +AddTestCase( "x.[[Class]]='text, y.[[Class]]='text' :", true, (xt==yt) ); +AddTestCase( "x.[[Class]]='text, y.[[Class]]='attribute' :", false, (xt==ya.@attr) ); +AddTestCase( "x.[[Class]]='text, y.hasSimpleContent() :", false, (xt==yh) ); + +AddTestCase( "x.[[Class]]='attribute, y.[[Class]]='text' :", false, (xa.@attr==yt) ); +AddTestCase( "x.[[Class]]='attribute, y.[[Class]]='attribute' :", true, (xa.@attr==ya.@attr) ); +AddTestCase( "x.[[Class]]='attribute, y.hasSimpleContent() :", false, (xa.@attr==yh) ); + +AddTestCase( "x.hasSimpleContent(), y.[[Class]]='text' :", false, (xh==yt) ); +AddTestCase( "x.hasSimpleContent(), y.[[Class]]='attribute' :", false, (xh==ya.@attr) ); +AddTestCase( "x.hasSimpleContent(), y.hasSimpleContent() :", true, (xh==yh) ); + + +var xqn0 = new QName("n0"); +var xqn1 = new QName("ns1","n1"); + +var yqn00 = new QName("n0"); +var yqn01 = new QName("nA"); +var yqn10 = new QName("ns1", "n1" ); +var yqn11 = new QName("ns1", "nB"); +var yqn12 = new QName("nsB","n1" ); +var yqn13 = new QName("nsB","nB"); + +AddTestCase( "QName('n0'), QName('n0') :", true, (xqn0==yqn00) ); +AddTestCase( "QName('n0'), QName('nA') :", false, (xqn0==yqn01) ); +AddTestCase( "QName('n0'), QName('ns1','n1') :", false, (xqn0==yqn10) ); +AddTestCase( "QName('n0'), QName('ns1','nB') :", false, (xqn0==yqn11) ); +AddTestCase( "QName('n0'), QName('nsB','n1') :", false, (xqn0==yqn12) ); +AddTestCase( "QName('n0'), QName('naB','nB') :", false, (xqn0==yqn13) ); + +AddTestCase( "QName('ns1','n1'), QName('n0') :", false, (xqn1==yqn00) ); +AddTestCase( "QName('ns1','n1'), QName('nA') :", false, (xqn1==yqn01) ); +AddTestCase( "QName('ns1','n1'), QName('ns1','n1') :", true, (xqn1==yqn10) ); +AddTestCase( "QName('ns1','n1'), QName('ns1','nB') :", false, (xqn1==yqn11) ); +AddTestCase( "QName('ns1','n1'), QName('nsB','n1') :", false, (xqn1==yqn12) ); +AddTestCase( "QName('ns1','n1'), QName('nsB','nB') :", false, (xqn1==yqn13) ); + + +var xns0 = new Namespace(); +var xns1 = new Namespace("uri1"); +var xns2 = new Namespace("pre2","uri2"); + +var yns00 = new Namespace(); +var yns10 = new Namespace("uri1"); +var yns11 = new Namespace("uriB"); +var yns20 = new Namespace("pre2","uri2"); +var yns21 = new Namespace("pre2","uriC"); +var yns22 = new Namespace("preC","uri2"); +var yns23 = new Namespace("preC","uriC"); + + +AddTestCase( "Namespace(), Namespace() :", true, (xns0==yns00) ); +AddTestCase( "Namespace(), Namespace('uri1') :", false, (xns0==yns10) ); +AddTestCase( "Namespace(), Namespace('uriB') :", false, (xns0==yns11) ); +AddTestCase( "Namespace(), Namespace('pre2','uri2') :", false, (xns0==yns20) ); +AddTestCase( "Namespace(), Namespace('pre2','uriC') :", false, (xns0==yns21) ); +AddTestCase( "Namespace(), Namespace('preC','uri2') :", false, (xns0==yns22) ); +AddTestCase( "Namespace(), Namespace('preC','uriC') :", false, (xns0==yns23) ); + +AddTestCase( "Namespace('uri1'), Namespace() :", false, (xns1==yns00) ); +AddTestCase( "Namespace('uri1'), Namespace('uri1') :", true, (xns1==yns10) ); +AddTestCase( "Namespace('uri1'), Namespace('uriB') :", false, (xns1==yns11) ); +AddTestCase( "Namespace('uri1'), Namespace('pre2','uri2') :", false, (xns1==yns20) ); +AddTestCase( "Namespace('uri1'), Namespace('pre2','uriC') :", false, (xns1==yns21) ); +AddTestCase( "Namespace('uri1'), Namespace('preC','uri2') :", false, (xns1==yns22) ); +AddTestCase( "Namespace('uri1'), Namespace('preC','uriC') :", false, (xns1==yns23) ); + +AddTestCase( "Namespace('pre2','uri2'), Namespace() :", false, (xns2==yns00) ); +AddTestCase( "Namespace('pre2','uri2'), Namespace('uri1') :", false, (xns2==yns10) ); +AddTestCase( "Namespace('pre2','uri2'), Namespace('uriB') :", false, (xns2==yns11) ); +AddTestCase( "Namespace('pre2','uri2'), Namespace('pre2','uri2') :", true, (xns2==yns20) ); +AddTestCase( "Namespace('pre2','uri2'), Namespace('pre2','uriC') :", false, (xns2==yns21) ); +AddTestCase( "Namespace('pre2','uri2'), Namespace('preC','uri2') :", true, (xns2==yns22) ); +AddTestCase( "Namespace('pre2','uri2'), Namespace('preC','uriC') :", false, (xns2==yns23) ); + + +END(); diff --git a/mozilla/js/tamarin/test/e4x/Expressions/e11_6_1.as b/mozilla/js/tamarin/test/e4x/Expressions/e11_6_1.as new file mode 100644 index 00000000000..6b094ea0077 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Expressions/e11_6_1.as @@ -0,0 +1,522 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("11.6.1 - XML Assignment"); + +// Change the value of the id attribute on the second item +order = + + + Big Screen Television + 1299.99 + + + DVD Player + 399.99 + + + CD Player + 199.99 + + + 8-Track Player + 69.99 + +; + +correct = + + + Big Screen Television + 1299.99 + + + DVD Player + 399.99 + + + CD Player + 199.99 + + + 8-Track Player + 69.99 + +; + +order.item[1].@id = 1.23; +TEST(1, correct, order); + +// Add a new attribute to the second item +order = + + + Big Screen Television + 1299.99 + + + DVD Player + 399.99 + + + CD Player + 199.99 + + + 8-Track Player + 69.99 + +; + +correct = + + + Big Screen Television + 1299.99 + + + DVD Player + 399.99 + + + CD Player + 199.99 + + + 8-Track Player + 69.99 + +; + +order.item[1].@newattr = "new value"; +TEST(2, correct, order); + +// Construct an attribute list containing all the ids in this order +order = + + + Big Screen Television + 1299.99 + + + DVD Player + 399.99 + + + CD Player + 199.99 + + + 8-Track Player + 69.99 + +; + +order.@allids = order.item.@id; +TEST_XML(3, "1 2 3 4", order.@allids); + +// Replace first child of the order element with an XML value +order = + + + John +
    948 Ranier Ave.
    + Portland + OR +
    + + Big Screen Television + 1299.99 + + + DVD Player + 399.99 + + + CD Player + 199.99 + + + 8-Track Player + 69.99 + +
    ; + + +order.*[0] = + + Fred +
    123 Foobar Ave.
    + Bellevue + WA +
    ; + +correct = + + + Fred +
    123 Foobar Ave.
    + Bellevue + WA +
    + + Big Screen Television + 1299.99 + + + DVD Player + 399.99 + + + CD Player + 199.99 + + + 8-Track Player + 69.99 + +
    ; + +TEST(4, correct, order); + +// Replace the second child of the order element with a list of items + +order = + + + John +
    948 Ranier Ave.
    + Portland + OR +
    + + Big Screen Television + 1299.99 + + + DVD Player + 399.99 + + + CD Player + 199.99 + + + 8-Track Player + 69.99 + +
    ; + +correct = + + + John +
    948 Ranier Ave.
    + Portland + OR +
    + item one + item two + item three + + DVD Player + 399.99 + + + CD Player + 199.99 + + + 8-Track Player + 69.99 + +
    ; + +order.item[0] = item one + + item two + + item three; + +TEST(5, correct, order); + +// Replace the third child of the order with a text node +order = + + + John +
    948 Ranier Ave.
    + Portland + OR +
    + + Big Screen Television + 1299.99 + + + DVD Player + 399.99 + + + CD Player + 199.99 + + + 8-Track Player + 69.99 + +
    ; + +correct = + + + John +
    948 Ranier Ave.
    + Portland + OR +
    + + Big Screen Television + 1299.99 + + A Text Node + + CD Player + 199.99 + + + 8-Track Player + 69.99 + +
    ; + +order.item[1] = "A Text Node"; + +TEST(6, correct, order); + +// append a new item to the end of the order + +order = + + + John +
    948 Ranier Ave.
    + Portland + OR +
    + + Big Screen Television + 1299.99 + + + DVD Player + 399.99 + + + CD Player + 199.99 + + + 8-Track Player + 69.99 + +
    ; + +correct = + + + John +
    948 Ranier Ave.
    + Portland + OR +
    + + Big Screen Television + 1299.99 + + + DVD Player + 399.99 + + + CD Player + 199.99 + + + 8-Track Player + 69.99 + + new item +
    ; + +order.*[order.*.length()] = new item; + +TEST(7, correct, order); + +// Change the price of the item +item = + + Big Screen Television + 1299.99 + + +correct = + + Big Screen Television + 99.95 + + +item.price = 99.95; + +TEST(8, item, correct); + +// Change the description of the item +item = + + Big Screen Television + 1299.99 + + +correct = + + Mobile Phone + 1299.99 + + +item.description = "Mobile Phone"; + +TEST(9, item, correct); + +// property name begins with "@" + +var xx = new XML(""); +var xl = new XMLList(""); +var x_ = new XML(""); + +xx.@attr = xl.@attr; + +AddTestCase( "x.@attr=XMLList :", true, (xx==x_) ); + +xx = new XML(""); +yy = new XML(""); +xx.@attr = "B"; + +AddTestCase( "xx.@attr='B' :", "B", xx.@attr.toString() ); + +xx.@attr__ = "B"; + +AddTestCase( "xx.@attr__='B' :", true, (xx.@attr__=="B") ); + + +// property name does NOT begin with "@" and is NOT array index + +var x0 = new XML("BCD"); +var x1 = new XML("Z"); +var x0_ = new XML("ZCD"); + +x0.b = x1.b; + +AddTestCase( "Replace XML Obj - XML :", true, (x0==x0_) ); + +var x2 = new XMLList("YX"); + +x0.b = x2; + +x0_ = new XML("YXCD"); + +AddTestCase( "Replace XML Obj - XMLList :", true, (x0==x0_) ); + +x0 = new XML("BCD"); + +x0.e = new XML("E"); + +x0_ = new XML("BCDE"); + +AddTestCase( "Append new XML property :", true, (x0==x0_) ); + +x0 = new XML("B0B1B2"); +x1 = new XML("BB"); +x0_ = new XML("BB"); + +x0 = x1; + +AddTestCase( "Multiple XML objs with given name - XML :", true, (x0==x0_) ); + +x0 = new XML("B0B1B2"); +x1 = new XML("BB"); +x0_ = new XML("BB"); + +x0.b = x1; + +AddTestCase( "Multiple XML objs with given name - XMLList :", true, (x0==x0_) ); + +x0 = new XML("BC"); +x0_ = new XML("AC"); + +x0.b = "A"; + +AddTestCase( "x.b = 'A' :", true, (x0==x0_) ); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/Expressions/e11_6_2.as b/mozilla/js/tamarin/test/e4x/Expressions/e11_6_2.as new file mode 100644 index 00000000000..a2945c94685 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Expressions/e11_6_2.as @@ -0,0 +1,433 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("11.6.2 - XMLList Assignment"); + +// Set the name of the only customer in the order to Fred Jones +order = + + + John Smith + + + Big Screen Television + 1299.99 + + + DVD Player + 399.99 + +; + +correct = + + + Fred Jones + + + Big Screen Television + 1299.99 + + + DVD Player + 399.99 + +; + +//order.customer.name = "Fred Jones"; +//TEST(1, correct, order); + +// Replace all the hobbies for the only customer in the order +order = + + + John Smith + Biking + + + Big Screen Television + 1299.99 + + + DVD Player + 399.99 + +; + +correct = + + + John Smith + shopping + + + Big Screen Television + 1299.99 + + + DVD Player + 399.99 + +; + +order.customer.hobby = "shopping" +TEST(2, correct, order); + +// Attempt to set the sale date of the item. Throw an exception if more than 1 item exists. +order = + + + John Smith + + + Big Screen Television + 1299.99 + 01-05-2002 + +; + +correct = + + + John Smith + + + Big Screen Television + 1299.99 + 05-07-2002 + +; + +order.item.saledate = "05-07-2002" +TEST(3, correct, order); + +order = + + + John Smith + Biking + + + Big Screen Television + 1299.99 + + + DVD Player + 399.99 + +; + +try { + order.item.saledate = "05-07-2002"; + SHOULD_THROW(4); +} catch (ex) { + TEST(4, "TypeError", ex.name); +} + +// Replace all the employee's hobbies with their new favorite pastime +emps = + + + John + 20 + skiing + + + Sue + 30 + running + + + Ted + 35 + Biking + +; + +correct = + + + John + 20 + skiing + + + Sue + 30 + running + + + Ted + 35 + working + +; + +//emps.employee.(@id == 3).hobby = "working"; +//TEST(5, correct, emps); + +// Replace the first employee with George +emps = + + + John + 20 + + + Sue + 30 + + + Ted + 35 + +; + +correct = + + + George + 27 + + + Sue + 30 + + + Ted + 35 + +; + +emps.employee[0] = George27; +TEST(6, emps, correct); + +// Add a new employee to the end of the employee list +emps = + + + John + 20 + + + Sue + 30 + + + Ted + 35 + +; + +correct = + + + John + 20 + + + Sue + 30 + + + Ted + 35 + + + Frank + 39 + +; + +emps.employee += Frank39; +TEST(7, correct, emps); + +// Add a new employee to the end of the employee list +emps = + + + John + 20 + + + Sue + 30 + + + Ted + 35 + +; + +correct = + + + John + 20 + + + Sue + 30 + + + Ted + 35 + + + Frank + 39 + +; + +emps.employee[emps.employee.length()] = Frank39; +TEST(7, correct, emps); + + +// property name is NOT array index + +var x1 = new XML("AB"); + +x1.b.d = "C"; + +var y1 = new XML("AC"); + +AddTestCase( "property name is not array index :", true, (x1==y1) ); + + +x1 = new XML("AB"); + +x1.v.b.d = "C"; + +y1 = new XML("ABC"); + +AddTestCase("Adding new nested node at root: " , true, (x1 == y1)); + + +// property name is array index + +x1 = new XML("A0B0A1B1A2B2"); + +x1.b[1] = new XML("A3B3"); + +y1 = new XML("A0B0A3B3A2B2"); + +AddTestCase( "property name exists in XMLList :", true, (x1==y1) ); + + +// property name does NOT exist in XMLList + +x1.b[3] = new XML("A4B4"); + +y1 = new XML("A0B0A3B3A2B2A4B4"); + +AddTestCase( "property name does NOT exist in XMLList :", true, (x1==y1) ); + + +// property is XML with non-null parent + +x1 = new XML("A0B0A1B1A2B2"); + +x1.b = new XMLList("AB"); + +y1 = new XML("AB"); + +AddTestCase( "property is XML with non-null parent :", true, (x1==y1) ); + + +// AssignmentExpression = XML value + +x1 = new XML("A0B0A1B1A2B2"); + +x1.b[0] = new XML("A3B3"); + +y1 = new XML("A3B3A1B1A2B2"); + +AddTestCase( "AssignmentExpression = XML value :", true, (x1==y1) ); + + +// AssignmentExpression = XMLList object + +x1 = new XML("A0B0A1B1A2B2"); + +x1.b = new XMLList("ABC"); + +y1 = new XML("ABC"); + +AddTestCase( "AssignmentExpression = XMLList object :", true, (x1==y1) ); + + +// AssignmentExpression != XML/XMLList + +x1 = new XML("A0B0A1B1A2B2"); + +x1.b = "Hello World"; + +y1 = new XML("Hello World"); + +AddTestCase( "AssignmentExpression != XML/XMLList :", true, (x1==y1) ); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/Expressions/e11_6_3.as b/mozilla/js/tamarin/test/e4x/Expressions/e11_6_3.as new file mode 100644 index 00000000000..3724ae6b7d5 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Expressions/e11_6_3.as @@ -0,0 +1,173 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("11.6.3 - Compound Assignment"); + +// Insert employee 3 and 4 after the first employee +e = + + + Joe + 20 + + + Sue + 30 + +; + +correct = + + + Joe + 20 + + + Fred + + + Carol + + + Sue + 30 + +; + +e.employee[0] += Fred + + Carol; + +TEST(1, correct, e); + +// Append employees 3 and 4 to the end of the employee list +e = + + + Joe + 20 + + + Sue + 30 + +; + +correct = + + + Joe + 20 + + + Sue + 30 + + + Fred + + + Carol + +; + +e.employee[1] += Fred + + Carol; +TEST(2, correct, e); + +// XML += + +var x1 = new XML("A0A1B0B1C0C1"); + +x1.b[1] += new XML("D0D1"); + +var y1 = new XML("A0A1B0B1D0D1C0C1"); + +AddTestCase( "XML += :", true, (x1==y1) ); + + +// XMLList += + +x1 = new XMLList("A0A1B0B1C0C1"); + +x1 += new XML("D0D1"); + +y1 = new XMLList("A0A1B0B1C0C1D0D1"); + +AddTestCase( "XMLList += :", true, (x1==y1) ); + + +// XMLList +=, last item in XMLList is XML object with non-null parent + +x1 = new XML("A0A1B0B1C0C1"); + +x1 += new XMLList("D0E0"); + +y1 = new XMLList("A0A1B0B1C0C1D0E0"); + +AddTestCase( "XMLList += :", true, (x1==y1) ); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/Expressions/kXMLBadQNameErr.as b/mozilla/js/tamarin/test/e4x/Expressions/kXMLBadQNameErr.as new file mode 100644 index 00000000000..35ff27271ec --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Expressions/kXMLBadQNameErr.as @@ -0,0 +1,113 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("11.1.2 Qualified Identifiers - XML bad QName error"); + +var expected, result, expectedStr; + +expectedStr = "TypeError: Error #1084: Element or attribute (\":x\") do not match QName production: QName::=(NCName':')?NCName"; +expected = "Error #1084"; + +result = "error, exception not thrown"; + +namespace ns="http://www.foo.com"; +var x1 = new XML("foo"); + +try{ + +x1 = new XML("<:x>hi
    "); +throw "kXMLBadQname error not thrown"; + +} catch( e1 ){ + +result = grabError(e1, e1.toString()); + +} + + +AddTestCase("<:x>hi", expected, result); + + +expectedStr = "TypeError: Error #1084: Element or attribute (\":ns\") do not match QName production: QName::=(NCName':')?NCName"; +expected = "Error #1084"; + +try{ + +x1 = new XML("hi"); +throw "kXMLBadQname error not thrown"; + +} catch( e2 ){ + +result = grabError(e2, e2.toString()); + +} + + +AddTestCase("hi", expected, result); + +END(); + diff --git a/mozilla/js/tamarin/test/e4x/Global/e13_1_2_1.as b/mozilla/js/tamarin/test/e4x/Global/e13_1_2_1.as new file mode 100644 index 00000000000..30f849702fe --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Global/e13_1_2_1.as @@ -0,0 +1,578 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* +-*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- +* +* ***** BEGIN LICENSE BLOCK ***** +* Version: MPL 1.1/GPL 2.0/LGPL 2.1 +* +* The contents of this file are subject to the Mozilla Public License Version +* 1.1 (the "License"); you may not use this file except in compliance with +* the License. You may obtain a copy of the License at +* http://www.mozilla.org/MPL/ +* +* Software distributed under the License is distributed on an "AS IS" basis, +* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +* for the specific language governing rights and limitations under the +* License. +* +* The Original Code is Rhino code, released +* May 6, 1999. +* +* The Initial Developer of the Original Code is +* Netscape Communications Corporation. +* Portions created by the Initial Developer are Copyright (C) 1997-2000 +* the Initial Developer. All Rights Reserved. +* +* Contributor(s): +* Igor Bukanov +* +* Alternatively, the contents of this file may be used under the terms of +* either the GNU General Public License Version 2 or later (the "GPL"), or +* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +* in which case the provisions of the GPL or the LGPL are applicable instead +* of those above. If you wish to allow use of your version of this file only +* under the terms of either the GPL or the LGPL, and not to allow others to +* use your version of this file under the terms of the MPL, indicate your +* decision by deleting the provisions above and replace them with the notice +* and other provisions required by the GPL or the LGPL. If you do not delete +* the provisions above, a recipient may use your version of this file under +* the terms of any one of the MPL, the GPL or the LGPL. +* +* ***** END LICENSE BLOCK ***** */ + +START("13.1.2.1 - isXMLName()"); + +TEST(1, true, typeof isXMLName == "function"); + + +// Check converting to string +var object = { toString: function() { return "text"; } }; + +TEST(2, true, isXMLName(object)); + +// Check various cases of http://w3.org/TR/xml-names11/#NT-NCName + +TEST(5, false, isXMLName("")); + +TEST(5.1, false, isXMLName(null)); + +TEST(5.2, false, isXMLName()); + +TEST(5.3, false, isXMLName(undefined)); + +// Check various cases of http://w3.org/TR/xml-names11/#NT-NCName + +TEST(5, false, isXMLName("")); + +var BEGIN = 0x1; +var OTHER = 0x2; +var chars = init(); +var marker; + +// Letter + +// Letter::= BaseChar | Ideographic + +marker = BEGIN | OTHER; + +// BaseChar + +markRange(chars, 0x0041, 0x005A, marker); +markRange(chars, 0x0061, 0x007A, marker); +markRange(chars, 0x00C0, 0x00D6, marker); +markRange(chars, 0x00D8, 0x00F6, marker); +markRange(chars, 0x00F8, 0x00FF, marker); +markRange(chars, 0x0100, 0x0131, marker); +markRange(chars, 0x0134, 0x013E, marker); +markRange(chars, 0x0141, 0x0148, marker); +markRange(chars, 0x014A, 0x017E, marker); +markRange(chars, 0x0180, 0x01C3, marker); +markRange(chars, 0x01CD, 0x01F0, marker); +markRange(chars, 0x01F4, 0x01F5, marker); +markRange(chars, 0x01FA, 0x0217, marker); +markRange(chars, 0x0250, 0x02A8, marker); +markRange(chars, 0x02BB, 0x02C1, marker); +markRange(chars, 0x0386, 0x0386, marker); +markRange(chars, 0x0388, 0x038A, marker); +markRange(chars, 0x038C, 0x038C, marker); +markRange(chars, 0x038E, 0x03A1, marker); +markRange(chars, 0x03A3, 0x03CE, marker); +markRange(chars, 0x03D0, 0x03D6, marker); +markRange(chars, 0x03DA, 0x03DA, marker); +markRange(chars, 0x03DC, 0x03DC, marker); +markRange(chars, 0x03DE, 0x03DE, marker); +markRange(chars, 0x03E0, 0x03E0, marker); +markRange(chars, 0x03E2, 0x03F3, marker); +markRange(chars, 0x0401, 0x040C, marker); +markRange(chars, 0x040E, 0x044F, marker); +markRange(chars, 0x0451, 0x045C, marker); +markRange(chars, 0x045E, 0x0481, marker); +markRange(chars, 0x0490, 0x04C4, marker); +markRange(chars, 0x04C7, 0x04C8, marker); +markRange(chars, 0x04CB, 0x04CC, marker); +markRange(chars, 0x04D0, 0x04EB, marker); +markRange(chars, 0x04EE, 0x04F5, marker); +markRange(chars, 0x04F8, 0x04F9, marker); +markRange(chars, 0x0531, 0x0556, marker); +markRange(chars, 0x0559, 0x0559, marker); +markRange(chars, 0x0561, 0x0586, marker); +markRange(chars, 0x05D0, 0x05EA, marker); +markRange(chars, 0x05F0, 0x05F2, marker); +markRange(chars, 0x0621, 0x063A, marker); +markRange(chars, 0x0641, 0x064A, marker); +markRange(chars, 0x0671, 0x06B7, marker); +markRange(chars, 0x06BA, 0x06BE, marker); +markRange(chars, 0x06C0, 0x06CE, marker); +markRange(chars, 0x06D0, 0x06D3, marker); +markRange(chars, 0x06D5, 0x06D5, marker); +markRange(chars, 0x06E5, 0x06E6, marker); +markRange(chars, 0x0905, 0x0939, marker); +markRange(chars, 0x093D, 0x093D, marker); +markRange(chars, 0x0958, 0x0961, marker); +markRange(chars, 0x0985, 0x098C, marker); +markRange(chars, 0x098F, 0x0990, marker); +markRange(chars, 0x0993, 0x09A8, marker); +markRange(chars, 0x09AA, 0x09B0, marker); +markRange(chars, 0x09B2, 0x09B2, marker); +markRange(chars, 0x09B6, 0x09B9, marker); +markRange(chars, 0x09DC, 0x09DD, marker); +markRange(chars, 0x09DF, 0x09E1, marker); +markRange(chars, 0x09F0, 0x09F1, marker); +markRange(chars, 0x0A05, 0x0A0A, marker); +markRange(chars, 0x0A0F, 0x0A10, marker); +markRange(chars, 0x0A13, 0x0A28, marker); +markRange(chars, 0x0A2A, 0x0A30, marker); +markRange(chars, 0x0A32, 0x0A33, marker); +markRange(chars, 0x0A35, 0x0A36, marker); +markRange(chars, 0x0A38, 0x0A39, marker); +markRange(chars, 0x0A59, 0x0A5C, marker); +markRange(chars, 0x0A5E, 0x0A5E, marker); +markRange(chars, 0x0A72, 0x0A74, marker); +markRange(chars, 0x0A85, 0x0A8B, marker); +markRange(chars, 0x0A8D, 0x0A8D, marker); +markRange(chars, 0x0A8F, 0x0A91, marker); +markRange(chars, 0x0A93, 0x0AA8, marker); +markRange(chars, 0x0AAA, 0x0AB0, marker); +markRange(chars, 0x0AB2, 0x0AB3, marker); +markRange(chars, 0x0AB5, 0x0AB9, marker); +markRange(chars, 0x0ABD, 0x0ABD, marker); +markRange(chars, 0x0AE0, 0x0AE0, marker); +markRange(chars, 0x0B05, 0x0B0C, marker); +markRange(chars, 0x0B0F, 0x0B10, marker); +markRange(chars, 0x0B13, 0x0B28, marker); +markRange(chars, 0x0B2A, 0x0B30, marker); +markRange(chars, 0x0B32, 0x0B33, marker); +markRange(chars, 0x0B36, 0x0B39, marker); +markRange(chars, 0x0B3D, 0x0B3D, marker); +markRange(chars, 0x0B5C, 0x0B5D, marker); +markRange(chars, 0x0B5F, 0x0B61, marker); +markRange(chars, 0x0B85, 0x0B8A, marker); +markRange(chars, 0x0B8E, 0x0B90, marker); +markRange(chars, 0x0B92, 0x0B95, marker); +markRange(chars, 0x0B99, 0x0B9A, marker); +markRange(chars, 0x0B9C, 0x0B9C, marker); +markRange(chars, 0x0B9E, 0x0B9F, marker); +markRange(chars, 0x0BA3, 0x0BA4, marker); +markRange(chars, 0x0BA8, 0x0BAA, marker); +markRange(chars, 0x0BAE, 0x0BB5, marker); +markRange(chars, 0x0BB7, 0x0BB9, marker); +markRange(chars, 0x0C05, 0x0C0C, marker); +markRange(chars, 0x0C0E, 0x0C10, marker); +markRange(chars, 0x0C12, 0x0C28, marker); +markRange(chars, 0x0C2A, 0x0C33, marker); +markRange(chars, 0x0C35, 0x0C39, marker); +markRange(chars, 0x0C60, 0x0C61, marker); +markRange(chars, 0x0C85, 0x0C8C, marker); +markRange(chars, 0x0C8E, 0x0C90, marker); +markRange(chars, 0x0C92, 0x0CA8, marker); +markRange(chars, 0x0CAA, 0x0CB3, marker); +markRange(chars, 0x0CB5, 0x0CB9, marker); +markRange(chars, 0x0CDE, 0x0CDE, marker); +markRange(chars, 0x0CE0, 0x0CE1, marker); +markRange(chars, 0x0D05, 0x0D0C, marker); +markRange(chars, 0x0D0E, 0x0D10, marker); +markRange(chars, 0x0D12, 0x0D28, marker); +markRange(chars, 0x0D2A, 0x0D39, marker); +markRange(chars, 0x0D60, 0x0D61, marker); +markRange(chars, 0x0E01, 0x0E2E, marker); +markRange(chars, 0x0E30, 0x0E30, marker); +markRange(chars, 0x0E32, 0x0E33, marker); +markRange(chars, 0x0E40, 0x0E45, marker); +markRange(chars, 0x0E81, 0x0E82, marker); +markRange(chars, 0x0E84, 0x0E84, marker); +markRange(chars, 0x0E87, 0x0E88, marker); +markRange(chars, 0x0E8A, 0x0E8A, marker); +markRange(chars, 0x0E8D, 0x0E8D, marker); +markRange(chars, 0x0E94, 0x0E97, marker); +markRange(chars, 0x0E99, 0x0E9F, marker); +markRange(chars, 0x0EA1, 0x0EA3, marker); +markRange(chars, 0x0EA5, 0x0EA5, marker); +markRange(chars, 0x0EA7, 0x0EA7, marker); +markRange(chars, 0x0EAA, 0x0EAB, marker); +markRange(chars, 0x0EAD, 0x0EAE, marker); +markRange(chars, 0x0EB0, 0x0EB0, marker); +markRange(chars, 0x0EB2, 0x0EB3, marker); +markRange(chars, 0x0EBD, 0x0EBD, marker); +markRange(chars, 0x0EC0, 0x0EC4, marker); +markRange(chars, 0x0F40, 0x0F47, marker); +markRange(chars, 0x0F49, 0x0F69, marker); +markRange(chars, 0x10A0, 0x10C5, marker); +markRange(chars, 0x10D0, 0x10F6, marker); +markRange(chars, 0x1100, 0x1100, marker); +markRange(chars, 0x1102, 0x1103, marker); +markRange(chars, 0x1105, 0x1107, marker); +markRange(chars, 0x1109, 0x1109, marker); +markRange(chars, 0x110B, 0x110C, marker); +markRange(chars, 0x110E, 0x1112, marker); +markRange(chars, 0x113C, 0x113C, marker); +markRange(chars, 0x113E, 0x113E, marker); +markRange(chars, 0x1140, 0x1140, marker); +markRange(chars, 0x114C, 0x114C, marker); +markRange(chars, 0x114E, 0x114E, marker); +markRange(chars, 0x1150, 0x1150, marker); +markRange(chars, 0x1154, 0x1155, marker); +markRange(chars, 0x1159, 0x1159, marker); +markRange(chars, 0x115F, 0x1161, marker); +markRange(chars, 0x1163, 0x1163, marker); +markRange(chars, 0x1165, 0x1165, marker); +markRange(chars, 0x1167, 0x1167, marker); +markRange(chars, 0x1169, 0x1169, marker); +markRange(chars, 0x116D, 0x116E, marker); +markRange(chars, 0x1172, 0x1173, marker); +markRange(chars, 0x1175, 0x1175, marker); +markRange(chars, 0x119E, 0x119E, marker); +markRange(chars, 0x11A8, 0x11A8, marker); +markRange(chars, 0x11AB, 0x11AB, marker); +markRange(chars, 0x11AE, 0x11AF, marker); +markRange(chars, 0x11B7, 0x11B8, marker); +markRange(chars, 0x11BA, 0x11BA, marker); +markRange(chars, 0x11BC, 0x11C2, marker); +markRange(chars, 0x11EB, 0x11EB, marker); +markRange(chars, 0x11F0, 0x11F0, marker); +markRange(chars, 0x11F9, 0x11F9, marker); +markRange(chars, 0x1E00, 0x1E9B, marker); +markRange(chars, 0x1EA0, 0x1EF9, marker); +markRange(chars, 0x1F00, 0x1F15, marker); +markRange(chars, 0x1F18, 0x1F1D, marker); +markRange(chars, 0x1F20, 0x1F45, marker); +markRange(chars, 0x1F48, 0x1F4D, marker); +markRange(chars, 0x1F50, 0x1F57, marker); +markRange(chars, 0x1F59, 0x1F59, marker); +markRange(chars, 0x1F5B, 0x1F5B, marker); +markRange(chars, 0x1F5D, 0x1F5D, marker); +markRange(chars, 0x1F5F, 0x1F7D, marker); +markRange(chars, 0x1F80, 0x1FB4, marker); +markRange(chars, 0x1FB6, 0x1FBC, marker); +markRange(chars, 0x1FBE, 0x1FBE, marker); +markRange(chars, 0x1FC2, 0x1FC4, marker); +markRange(chars, 0x1FC6, 0x1FCC, marker); +markRange(chars, 0x1FD0, 0x1FD3, marker); +markRange(chars, 0x1FD6, 0x1FDB, marker); +markRange(chars, 0x1FE0, 0x1FEC, marker); +markRange(chars, 0x1FF2, 0x1FF4, marker); +markRange(chars, 0x1FF6, 0x1FFC, marker); +markRange(chars, 0x2126, 0x2126, marker); +markRange(chars, 0x212A, 0x212B, marker); +markRange(chars, 0x212E, 0x212E, marker); +markRange(chars, 0x2180, 0x2182, marker); +markRange(chars, 0x3041, 0x3094, marker); +markRange(chars, 0x30A1, 0x30FA, marker); +markRange(chars, 0x3105, 0x312C, marker); +markRange(chars, 0xAC00, 0xD7A3, marker); + +// Ideographic + +markRange(chars, 0x4E00, 0x9FA5, marker); +markRange(chars, 0x3007, 0x3007, marker); +markRange(chars, 0x3021, 0x3029, marker); + +// Digit + +marker = OTHER; + +markRange(chars, 0x0030, 0x0039, marker); +markRange(chars, 0x0660, 0x0669, marker); +markRange(chars, 0x06F0, 0x06F9, marker); +markRange(chars, 0x0966, 0x096F, marker); +markRange(chars, 0x09E6, 0x09EF, marker); +markRange(chars, 0x0A66, 0x0A6F, marker); +markRange(chars, 0x0AE6, 0x0AEF, marker); +markRange(chars, 0x0B66, 0x0B6F, marker); +markRange(chars, 0x0BE7, 0x0BEF, marker); +markRange(chars, 0x0C66, 0x0C6F, marker); +markRange(chars, 0x0CE6, 0x0CEF, marker); +markRange(chars, 0x0D66, 0x0D6F, marker); +markRange(chars, 0x0E50, 0x0E59, marker); +markRange(chars, 0x0ED0, 0x0ED9, marker); +markRange(chars, 0x0F20, 0x0F29, marker); + +// "Other NameChars" + +markRange(chars, 0x2e, 0x2e, marker); +markRange(chars, 0x2d, 0x2d, marker); + +marker = BEGIN | OTHER; + +markRange(chars, 0x5f, 0x5f, marker); + +// e4x excludes ':' + +// CombiningChar + +marker = OTHER; + +markRange(chars, 0x0300, 0x0345, marker); +markRange(chars, 0x0360, 0x0361, marker); +markRange(chars, 0x0483, 0x0486, marker); +markRange(chars, 0x0591, 0x05A1, marker); +markRange(chars, 0x05A3, 0x05B9, marker); +markRange(chars, 0x05BB, 0x05BD, marker); +markRange(chars, 0x05BF, 0x05BF, marker); +markRange(chars, 0x05C1, 0x05C2, marker); +markRange(chars, 0x05C4, 0x05C4, marker); +markRange(chars, 0x064B, 0x0652, marker); +markRange(chars, 0x0670, 0x0670, marker); +markRange(chars, 0x06D6, 0x06DC, marker); +markRange(chars, 0x06DD, 0x06DF, marker); +markRange(chars, 0x06E0, 0x06E4, marker); +markRange(chars, 0x06E7, 0x06E8, marker); +markRange(chars, 0x06EA, 0x06ED, marker); +markRange(chars, 0x0901, 0x0903, marker); +markRange(chars, 0x093C, 0x093C, marker); +markRange(chars, 0x093E, 0x094C, marker); +markRange(chars, 0x094D, 0x094D, marker); +markRange(chars, 0x0951, 0x0954, marker); +markRange(chars, 0x0962, 0x0963, marker); +markRange(chars, 0x0981, 0x0983, marker); +markRange(chars, 0x09BC, 0x09BC, marker); +markRange(chars, 0x09BE, 0x09BE, marker); +markRange(chars, 0x09BF, 0x09BF, marker); +markRange(chars, 0x09C0, 0x09C4, marker); +markRange(chars, 0x09C7, 0x09C8, marker); +markRange(chars, 0x09CB, 0x09CD, marker); +markRange(chars, 0x09D7, 0x09D7, marker); +markRange(chars, 0x09E2, 0x09E3, marker); +markRange(chars, 0x0A02, 0x0A02, marker); +markRange(chars, 0x0A3C, 0x0A3C, marker); +markRange(chars, 0x0A3E, 0x0A3E, marker); +markRange(chars, 0x0A3F, 0x0A3F, marker); +markRange(chars, 0x0A40, 0x0A42, marker); +markRange(chars, 0x0A47, 0x0A48, marker); +markRange(chars, 0x0A4B, 0x0A4D, marker); +markRange(chars, 0x0A70, 0x0A71, marker); +markRange(chars, 0x0A81, 0x0A83, marker); +markRange(chars, 0x0ABC, 0x0ABC, marker); +markRange(chars, 0x0ABE, 0x0AC5, marker); +markRange(chars, 0x0AC7, 0x0AC9, marker); +markRange(chars, 0x0ACB, 0x0ACD, marker); +markRange(chars, 0x0B01, 0x0B03, marker); +markRange(chars, 0x0B3C, 0x0B3C, marker); +markRange(chars, 0x0B3E, 0x0B43, marker); +markRange(chars, 0x0B47, 0x0B48, marker); +markRange(chars, 0x0B4B, 0x0B4D, marker); +markRange(chars, 0x0B56, 0x0B57, marker); +markRange(chars, 0x0B82, 0x0B83, marker); +markRange(chars, 0x0BBE, 0x0BC2, marker); +markRange(chars, 0x0BC6, 0x0BC8, marker); +markRange(chars, 0x0BCA, 0x0BCD, marker); +markRange(chars, 0x0BD7, 0x0BD7, marker); +markRange(chars, 0x0C01, 0x0C03, marker); +markRange(chars, 0x0C3E, 0x0C44, marker); +markRange(chars, 0x0C46, 0x0C48, marker); +markRange(chars, 0x0C4A, 0x0C4D, marker); +markRange(chars, 0x0C55, 0x0C56, marker); +markRange(chars, 0x0C82, 0x0C83, marker); +markRange(chars, 0x0CBE, 0x0CC4, marker); +markRange(chars, 0x0CC6, 0x0CC8, marker); +markRange(chars, 0x0CCA, 0x0CCD, marker); +markRange(chars, 0x0CD5, 0x0CD6, marker); +markRange(chars, 0x0D02, 0x0D03, marker); +markRange(chars, 0x0D3E, 0x0D43, marker); +markRange(chars, 0x0D46, 0x0D48, marker); +markRange(chars, 0x0D4A, 0x0D4D, marker); +markRange(chars, 0x0D57, 0x0D57, marker); +markRange(chars, 0x0E31, 0x0E31, marker); +markRange(chars, 0x0E34, 0x0E3A, marker); +markRange(chars, 0x0E47, 0x0E4E, marker); +markRange(chars, 0x0EB1, 0x0EB1, marker); +markRange(chars, 0x0EB4, 0x0EB9, marker); +markRange(chars, 0x0EBB, 0x0EBC, marker); +markRange(chars, 0x0EC8, 0x0ECD, marker); +markRange(chars, 0x0F18, 0x0F19, marker); +markRange(chars, 0x0F35, 0x0F35, marker); +markRange(chars, 0x0F37, 0x0F37, marker); +markRange(chars, 0x0F39, 0x0F39, marker); +markRange(chars, 0x0F3E, 0x0F3E, marker); +markRange(chars, 0x0F3F, 0x0F3F, marker); +markRange(chars, 0x0F71, 0x0F84, marker); +markRange(chars, 0x0F86, 0x0F8B, marker); +markRange(chars, 0x0F90, 0x0F95, marker); +markRange(chars, 0x0F97, 0x0F97, marker); +markRange(chars, 0x0F99, 0x0FAD, marker); +markRange(chars, 0x0FB1, 0x0FB7, marker); +markRange(chars, 0x0FB9, 0x0FB9, marker); +markRange(chars, 0x20D0, 0x20DC, marker); +markRange(chars, 0x20E1, 0x20E1, marker); +markRange(chars, 0x302A, 0x302F, marker); +markRange(chars, 0x3099, 0x3099, marker); +markRange(chars, 0x309A, 0x309A, marker); + +// Extender + +markRange(chars, 0x00B7, 0x00B7, marker); +markRange(chars, 0x02D0, 0x02D0, marker); +markRange(chars, 0x02D1, 0x02D1, marker); +markRange(chars, 0x0387, 0x0387, marker); +markRange(chars, 0x0640, 0x0640, marker); +markRange(chars, 0x0E46, 0x0E46, marker); +markRange(chars, 0x0EC6, 0x0EC6, marker); +markRange(chars, 0x3005, 0x3005, marker); +markRange(chars, 0x3031, 0x3035, marker); +markRange(chars, 0x309D, 0x309E, marker); +markRange(chars, 0x30FC, 0x30FE, marker); + +TEST(6, '', testIsXMLName(chars)); + +TEST(7, true, (testIsXMLName(chars) == '')); + +END(); + + +// Utilities + +function markRange(buffer, start, end, marker) +{ + for (var i = start; i <= end; i++) + { + buffer[i] |= marker; + } +} + +function init() +{ + var length = 0xFFFF + 1; + var chars = new Array(length); + for (var i = 0; i < length; i++) + { + chars[i] = 0; + } + return chars; +} + +function testIsXMLName(buffer) +{ + var nl = NL(); + var result = ''; + var length = buffer.length; + + var rangestart = null; + var rangeend = null; + var rangemessage = ''; + + for (var i = 0; i < length; i++) + { + var message = ''; + var c = String.fromCharCode(i); + var marker = buffer[i]; + + var namestart = isXMLName(c + 'x'); + var nameother = isXMLName('x' + c); + + if (marker == 0 && namestart) + { + message += ': Invalid char accepted as start '; + } + + if (marker == 0 && nameother) + { + message += ': Invalid Char accepted as other '; + } + + if ((marker & BEGIN) && !namestart) + { + message += ': Start char not accepted'; + } + + if ((marker & OTHER) && !nameother) + { + message += ': Other char not accepted'; + } + + + if (rangemessage && !message) + { + // no current error, previous error + // output previous error range + result += '[' + rangestart + '-' + rangeend + '] ' + + rangemessage + nl; + rangemessage = rangestart = rangeend = null; + } + else if (!rangemessage && message) + { + // current error, no previous error + // start new error range + rangemessage = message; + rangestart = rangeend = formatChar(c); + } + else if (rangemessage && message) + { + if (rangemessage == message) + { + // current error same as previous + // continue previous error range + rangeend = formatChar(c); + } + else + { + // different error, output range + result += '[' + rangestart + '-' + rangeend + '] ' + + rangemessage + nl; + rangemessage = message; + rangestart = rangeend = formatChar(c); + } + } + } + + if (rangemessage) + { + result += '[' + rangestart + '-' + rangeend + '] ' + + rangemessage + nl; + } + + return result; +} + +function formatChar(c) +{ + var s = '0x' + c.charCodeAt(0).toString(16).toUpperCase(); + return s; +} diff --git a/mozilla/js/tamarin/test/e4x/Global/isXMLNameTypeErr.as b/mozilla/js/tamarin/test/e4x/Global/isXMLNameTypeErr.as new file mode 100644 index 00000000000..bb7ff8d0ef5 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Global/isXMLNameTypeErr.as @@ -0,0 +1,112 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.1.2.1 isXMLName - Passing object to isXMLName() TypeError"); + +var expectedStr = "TypeError: Error #1050"; +var result = "error, exception not thrown"; +var expected = "Error #1050"; + +var object1 = { toString: function() { return this; } }; + +try{ + +isXMLName(object1); + +throw "TypeError not thrown"; + +} catch( e1 ){ + + result = grabError(e1, e1.toString()); +} + + +AddTestCase("var object1 = { toString: function() { return this; } }; isXMLName(object1)", expected, result); + + +// Check indirect throw of TypeError +var object2 = { toString: function() { return String(object1); } } + +try{ + +isXMLName(object2); + +throw "TypeError not thrown"; + +} catch( e2 ){ + + grabError(e2, e2.toString()); + +} + + +AddTestCase("var object2 = { toString: function() { return String(object1); } }; isXMLName(object2)", expected, result); + + + +END(); + diff --git a/mozilla/js/tamarin/test/e4x/Namespace/e13_2_1.as b/mozilla/js/tamarin/test/e4x/Namespace/e13_2_1.as new file mode 100644 index 00000000000..381c1a1258b --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Namespace/e13_2_1.as @@ -0,0 +1,116 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.2.1 - Namespace Constructor as Function"); + +n = Namespace(); +m = new Namespace(); +TEST(1, typeof(m), typeof(n)); +TEST(2, m.prefix, n.prefix); +TEST(3, m.uri, n.uri); + +n = Namespace("http://foobar/"); +m = new Namespace("http://foobar/"); +TEST(4, typeof(m), typeof(n)); +TEST(5, m.prefix, n.prefix); +TEST(6, m.uri, n.uri); + +n = Namespace("foobar", "http://foobar/"); +m = new Namespace("foobar", "http://foobar/"); +TEST(7, typeof(m), typeof(n)); +TEST(8, m.prefix, n.prefix); +TEST(9, m.uri, n.uri); + +n = Namespace(m); +TEST(10, m, n); + +var thisXML = "GiantsSan Francisco"; +var NULL_OBJECT = ""; + + +// value is not supplied +AddTestCase( "Namespace()", NULL_OBJECT, Namespace().toString()); +AddTestCase( "typeof Namespace()", "object", typeof Namespace() ); +//AddTestCase( "Namespace().__proto__ == Namespace.prototype", true, Namespace().__proto__ == Namespace.prototype); + +//One value is supplied +AddTestCase( "Namespace('pfx').toString()", 'pfx', Namespace('pfx').toString() ); +AddTestCase( "typeof Namespace('pfx')", "object", typeof Namespace('pfx') ); +//AddTestCase( "Namespace('pfx').__proto__ == Namespace.prototype", true, Namespace('pfx').__proto__ == Namespace.prototype); + +var ns = new Namespace('http://foo.bar'); +AddTestCase( "Namespace(nsObj).toString()", 'http://foo.bar', Namespace(ns).toString() ); + +//Two values are supplied +AddTestCase( "Namespace('pfx','ns') == new Namespace('pfx', 'ns')", new Namespace('pfx', 'http://www.w3.org/TR/html4/'), Namespace('pfx','http://www.w3.org/TR/html4/') ); +AddTestCase( "typeof Namespace('pfx','http://www.w3.org/TR/html4/')", "object", typeof Namespace('pfx','http://www.w3.org/TR/html4/') ); +//AddTestCase( "Namespace('pfx','http://www.w3.org/TR/html4/').__proto__ == Namespace.prototype", true, Namespace('pfx','http://www.w3.org/TR/html4/').__proto__ == Namespace.prototype ); + +ns = new Namespace('pfx', 'http://foo.bar'); +AddTestCase( "Namespace(nsObj).toString()", 'http://foo.bar', Namespace(ns).toString() ); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/Namespace/e13_2_2.as b/mozilla/js/tamarin/test/e4x/Namespace/e13_2_2.as new file mode 100644 index 00000000000..a1651df462b --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Namespace/e13_2_2.as @@ -0,0 +1,117 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.2.2 - Namespace Constructor"); + +n = new Namespace(); +TEST(1, "object", typeof(n)); +TEST(2, "", n.prefix); +TEST(3, "", n.uri); + +n = new Namespace(""); +TEST(4, "object", typeof(n)); +TEST(5, "", n.prefix); +TEST(6, "", n.uri); + +n = new Namespace("http://foobar/"); +TEST(7, "object", typeof(n)); +TEST(8, "undefined", typeof(n.prefix)); +TEST(9, "http://foobar/", n.uri); + +// Check if the undefined prefix is getting set properly +m = new Namespace(n); +TEST(10, typeof(n), typeof(m)); +TEST(11, n.prefix, m.prefix); +TEST(12, n.uri, m.uri); + +n = new Namespace("foobar", "http://foobar/"); +TEST(13, "object", typeof(n)); +TEST(14, "foobar", n.prefix); +TEST(15, "http://foobar/", n.uri); + +// Check if all the properties are getting copied +m = new Namespace(n); +TEST(16, typeof(n), typeof(m)); +TEST(17, n.prefix, m.prefix); +TEST(18, n.uri, m.uri); + +try { + n = new Namespace("ns", ""); + SHOULD_THROW(19); +} catch(ex) { + TEST(19, "TypeError", ex.name); +} + +namespace foo = "bar"; + +AddTestCase("Access inline namespace by name", "bar", foo.toString()); + +x1 = new Namespace ("p", "y"); + +AddTestCase("Access instantiated namespace by name", "y", x1.toString()); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/Namespace/e13_2_3_1.as b/mozilla/js/tamarin/test/e4x/Namespace/e13_2_3_1.as new file mode 100644 index 00000000000..019261c2e97 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Namespace/e13_2_3_1.as @@ -0,0 +1,75 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.2.3.1 - Namespace.prototype"); + +AddTestCase( "typeof Namespace.prototype", "object", typeof Namespace.prototype); +AddTestCase( "Namespace.prototype instanceof Namespace", false, Namespace.prototype instanceof Namespace); +//AddTestCase( "new Namespace().prototype instanceof Namespace", true, new Namespace().prototype instanceof Namespace); +//AddTestCase( "typeof (new Namespace().prototype)", "xml", typeof (new Namespace().prototype)); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/Namespace/e13_2_4_1.as b/mozilla/js/tamarin/test/e4x/Namespace/e13_2_4_1.as new file mode 100644 index 00000000000..81f7a37f799 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Namespace/e13_2_4_1.as @@ -0,0 +1,73 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.2.4.1 - Namespace.prototype.constructor"); + +AddTestCase( "Namespace.prototype.constructor", Namespace, Namespace.prototype.constructor); +AddTestCase( "Namespace.prototype.constructor", true, Namespace.prototype.constructor === Namespace); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/Namespace/e13_2_4_2.as b/mozilla/js/tamarin/test/e4x/Namespace/e13_2_4_2.as new file mode 100644 index 00000000000..a365bccf81f --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Namespace/e13_2_4_2.as @@ -0,0 +1,78 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.2.4.2 - Namespace.prototype.toString"); + +var n1 = new Namespace('http://www.w3.org/TR/html4/'); +var n2 = new Namespace('pfx','http://www.w3.org/TR/html4/'); +var n3 = new Namespace(); + +AddTestCase( "Namespace.prototype.toString", 'http://www.w3.org/TR/html4/', n1.toString()); +AddTestCase( "Namespace.prototype.toString", 'http://www.w3.org/TR/html4/', n2.toString()); +AddTestCase( "Namespace.prototype.toString", '', n3.toString()); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/Namespace/e13_2_5.as b/mozilla/js/tamarin/test/e4x/Namespace/e13_2_5.as new file mode 100644 index 00000000000..6e0ba7d5cdb --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Namespace/e13_2_5.as @@ -0,0 +1,228 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.2.5 - Properties of Namespace Instances"); + +n = new Namespace("ns", "http://someuri"); +TEST(1, true, n.hasOwnProperty("prefix")); +TEST(2, true, n.hasOwnProperty("uri")); +TEST(3, true, n.propertyIsEnumerable("prefix")); +TEST(4, true, n.propertyIsEnumerable("uri")); + +var prefixCount = 0; +var uriCount = 0; +var p; +for(p in n) +{ + if(p == "prefix") prefixCount++; + if(p == "uri") uriCount++; +} + +TEST(5, 1, prefixCount); +TEST(6, 1, uriCount); +TEST(7, "ns", n.prefix); +TEST(8, "http://someuri", n.uri); + +var n = new Namespace(); +AddTestCase( "Namespace.uri = blank", '', n.uri); + +n = new Namespace('http://www.w3.org/TR/html4/'); +AddTestCase( "Namespace.uri = http://www.w3.org/TR/html4/", 'http://www.w3.org/TR/html4/', n.uri); + +n = new Namespace('pfx','http://www.w3.org/TR/html4/'); +AddTestCase( "Namespace.uri = http://www.w3.org/TR/html4/", 'http://www.w3.org/TR/html4/', n.uri); + +n = new Namespace('', ''); +AddTestCase( "Namespace.uri = ''", '', n.uri); + +// Make sure uri is read-only +var thisError = "no error"; +try{ + n.uri = "hi"; +}catch(e:ReferenceError){ + thisError = e.toString(); +}finally{ + AddTestCase( "Trying to prove that Namespace.uri is read only", "ReferenceError: Error #1074", referenceError(thisError)); + } +AddTestCase( "Setting Namespace.uri", '', n.uri); + +n = new Namespace('pfx','http://www.w3.org/TR/html4/'); + + try{ + n.uri = "hi"; +}catch(e:ReferenceError){ + thisError = e.toString(); +}finally{ + AddTestCase( "Trying to prove that Namespace.uri is read only", "ReferenceError: Error #1074", referenceError(thisError)); + } + +AddTestCase( "Setting Namespace.uri", 'http://www.w3.org/TR/html4/', n.uri); + +n = new Namespace(); +AddTestCase( "Namespace.prefix = blank", '', n.prefix); + +n = new Namespace('http://www.w3.org/TR/html4/'); +AddTestCase( "Namespace.prefix = blank", undefined, n.prefix); + +n = new Namespace('pfx','http://www.w3.org/TR/html4/'); +AddTestCase( "Namespace.prefix = pfx", 'pfx', n.prefix); + +n = new Namespace('', ''); +AddTestCase( "Namespace.prefix = ''", '', n.prefix); + +// Make sure prefix is read-only +try{ + n.prefix = "hi"; +}catch(e:ReferenceError){ + thisError = e.toString(); +}finally{ + AddTestCase( "Trying to prove that Namespace.prefix is read only", "ReferenceError: Error #1074", referenceError(thisError)); + } +AddTestCase( "Setting Namespace.prefix", '', n.prefix); + +n = new Namespace('pfx','http://www.w3.org/TR/html4/'); +try{ + n.prefix = "hi"; +}catch(e:ReferenceError){ + thisError = e.toString(); +}finally{ + AddTestCase( "Trying to prove that Namespace.prefix is read only", "ReferenceError: Error #1074", referenceError(thisError)); + } +AddTestCase( "Setting Namespace.prefix", 'pfx', n.prefix); + +n = new Namespace ("http://www.w3.org/XML/1998/namespace"); + +var myXML = + +
    + +hello + +
    +
    ; + +var foo = myXML.@n::lang; + +AddTestCase("Using xml:lang namespace", "de", foo.toString()); + +AddTestCase("Getting name() of xml:lang namespace", "http://www.w3.org/XML/1998/namespace::lang", foo.name().toString()); + +AddTestCase("Getting uri of xml:lang namespace", "http://www.w3.org/XML/1998/namespace", foo.name().uri); + + +myXML = + +
    + +hello + +
    +
    ; + +foo = myXML.@n::space; + +AddTestCase("Using xml:space namespace", "false", foo.toString()); + +AddTestCase("Getting name() of xml:space namespace", "http://www.w3.org/XML/1998/namespace::space", foo.name().toString()); + +AddTestCase("Getting uri of xml:space namespace", "http://www.w3.org/XML/1998/namespace", foo.name().uri); + + +namespace foot = "bar"; +xn = new Namespace ("p", "y"); + +var for_in_values = []; +for (var nn in foot) +{ + for_in_values.push(nn); +} + +AddTestCase("Prefix in for-in loop", "prefix", for_in_values[1]); +//AddTestCase("Prefix in for-in loop BUG 125319", false, (for_in_values[1] == "prefix")); +AddTestCase("URI in for-in loop", "uri", for_in_values[0]); +//AddTestCase("URI in for-in loop BUG 125316", false, (for_in_values[0] == "uri")); + +var for_each_values = []; +for each (nn in foot) +{ + for_each_values.push(nn); +} + +AddTestCase("Prefix in for-each loop", "bar", for_each_values[0]); +//AddTestCase("Prefix in for-each loop BUG 125316", false, (for_each_values[0] == "bar")); +AddTestCase("URI in for-each loop", undefined, for_each_values[1]); + +for_each_values = []; +for each (nn in xn) +{ + for_each_values.push(nn); +} + +AddTestCase("Prefix in for-each loop", "y", for_each_values[0]); +AddTestCase("URI in for-each loop", "p", for_each_values[1]); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/QName/e13_3_1.as b/mozilla/js/tamarin/test/e4x/QName/e13_3_1.as new file mode 100644 index 00000000000..18523f16949 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/QName/e13_3_1.as @@ -0,0 +1,127 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.3.1 - QName Constructor as a Function"); + +q = QName("foobar"); +p = new QName("foobar"); +TEST(1, typeof(p), typeof(q)); +TEST(2, p.localName, q.localName); +TEST(3, p.uri, q.uri); + +q = QName("http://foobar/", "foobar"); +p = new QName("http://foobar/", "foobar"); +TEST(4, typeof(p), typeof(q)); +TEST(5, p.localName, q.localName); +TEST(6, p.uri, q.uri); + +p1 = QName(q); +p2 = new QName(q); +TEST(7, typeof(p2), typeof(p1)); +TEST(8, p2.localName, p1.localName); +TEST(9, p2.uri, p1.uri); + +n = new Namespace("http://foobar/"); +q = QName(n, "foobar"); +p = QName(n, "foobar"); +TEST(10, typeof(p), typeof(q)); +TEST(11, p.localName, q.localName); +TEST(12, p.uri, q.uri); + +p = QName(q); +TEST(13, p, q); + +// One value is supplied +AddTestCase( "QName('name').valueOf().toString()", 'name', QName('name').valueOf().toString() ); +AddTestCase( "QName('name').valueOf() == 'name'", true, QName('name').valueOf() == 'name' ); +AddTestCase( "typeof QName('name')", "object", typeof QName('name') ); +//AddTestCase( "QName('name').__proto__", Namespace.prototype, QName('name').__proto__ ); + +// If one parameter is QName, same value is returned +AddTestCase ("foo = QName('foo'), bar = Qname(foo), bar === foo", true, + (foo = QName("foo"), bar = QName(foo), bar === foo)); + +// If one parameter is QName but there is a Namespace param, different object is returned +AddTestCase ("foo = QName('foo'), bar = Qname(\"\", foo), bar === foo", false, + (foo = QName("foo"), bar = QName("", foo), bar === foo)); + + +//Two values are supplied +AddTestCase( "ns = new Namespace('duh'), QName(ns, 'name')", + "duh::name", + (ns = new Namespace('duh'), QName(ns, 'name').toString() )); + +AddTestCase( "ns = new Namespace('duh'), typeof QName(ns, 'name')", + "object", + ( ns = new Namespace('duh'), typeof QName(ns, 'name') )); + +AddTestCase( "ns = new Namespace('duh'), typeof QName(ns, 'name')", + true, + ( ns = new Namespace('duh'), QName(ns, 'name') instanceof QName)); + + +END(); diff --git a/mozilla/js/tamarin/test/e4x/QName/e13_3_2.as b/mozilla/js/tamarin/test/e4x/QName/e13_3_2.as new file mode 100644 index 00000000000..58e6a7a7bd0 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/QName/e13_3_2.as @@ -0,0 +1,178 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.3.2 - QName Constructor"); + +q = new QName("*"); +TEST(1, "object", typeof(q)); +TEST(2, "*", q.localName); +TEST(3, null, q.uri); +TEST(4, "*::*", q.toString()); + +// Default namespace +q = new QName("foobar"); +TEST(5, "object", typeof(q)); +TEST(6, "foobar", q.localName); +TEST(7, "", q.uri); +TEST(8, "foobar", q.toString()); + +q = new QName("http://foobar/", "foobar"); +TEST(9, "object", typeof(q)); +TEST(10, "foobar", q.localName); +TEST(11, "http://foobar/", q.uri); +TEST(12, "http://foobar/::foobar", q.toString()); + +p = new QName(q); +TEST(13, typeof(p), typeof(q)); +TEST(14, q.localName, p.localName); +TEST(15, q.uri, p.uri); + +n = new Namespace("http://foobar/"); +q = new QName(n, "foobar"); +TEST(16, "object", typeof(q)); + +q = new QName(null); +TEST(17, "object", typeof(q)); +TEST(18, "null", q.localName); +TEST(19, "", q.uri); +TEST(20, "null", q.toString()); + +q = new QName(null, null); +TEST(21, "object", typeof(q)); +TEST(22, "null", q.localName); +TEST(23, null, q.uri); +TEST(24, "*::null", q.toString()); + +q = new QName("attr1"); +q2 = new QName(q, "attr1"); +q3 = QName(q); + +TEST(25, "attr1", q.toString()); +TEST(26, "attr1", q2.toString()); +TEST(27, "attr1", q3.toString()); + +q = new QName(n, "attr1"); +q2 = new QName(q, "attr1"); + +TEST(28, "http://foobar/::attr1", q.toString()); +TEST(29, "http://foobar/::attr1", q2.toString()); + +// no value is supplied +AddTestCase( "ns = new QName()", "", (ns = new QName(), ns.localName) ); + +// one value is supplied +AddTestCase( "typeof new QName('name')", 'object', typeof new QName('name') ); +AddTestCase( "new QName('name') instanceof QName", true, new QName('name') instanceof QName); +AddTestCase( "new QName('name') == 'name'", true, new QName('name') == 'name'); +AddTestCase( "ns = new QName('name'), ns.uri == ''", true, + (ns = new QName('name'), ns.uri == '') ); +AddTestCase( "ns = new QName('name'), ns.uri == null", false, + (ns = new QName('name'), ns.uri == null) ); +AddTestCase( "ns = new QName('name'), ns.uri == undefined", false, + (ns = new QName('name'), ns.uri == undefined) ); +AddTestCase( "ns = new QName('name'), typeof ns.uri", 'string', + (ns = new QName('name'), typeof ns.uri) ); +AddTestCase( "ns = new QName('name'), ns.localName == 'name'", true, + (ns = new QName('name'), ns.localName == 'name') ); +AddTestCase( "ns = new QName(undefined)", "", (ns = new QName(undefined), ns.localName) ); +AddTestCase( "ns = new QName('')", "", (ns = new QName(""), ns.localName) ); +AddTestCase( "MYOB = new QName('nameofobj'),typeof new QName(MYOB)", + 'object', + (MYOB = new QName('nameofobj'), typeof new QName(MYOB)) ); + + +//two values are supplied +AddTestCase( "MYOB = new QName(null, 'nameofobj'); MYOB.toString()", + "*::nameofobj", + (MYOB = new QName(null, 'nameofobj'), MYOB.toString() )); + +AddTestCase( "MYOB = new QName(null, 'nameofobj'); MYOB.uri", null, + (MYOB = new QName(null, 'nameofobj'), MYOB.uri) ); + +AddTestCase( "MYOB = new QName(null, 'nameofobj'); MYOB.localName", 'nameofobj', + (MYOB = new QName(null, 'nameofobj'), MYOB.localName) ); +AddTestCase( "MYOB = new QName('namespace', undefined); MYOB.localName", "", + (MYOB = new QName('namespace', undefined), MYOB.localName) ); + +AddTestCase( "MYOB = new QName('namespace', ''); MYOB.localName", "", + (MYOB = new QName('namespace', ""), MYOB.localName) ); + +x1 = + + + + + + +y = +q3 = y.name(); + +AddTestCase("q3 = y.name()", "http://someuri::attr1", q3.toString()); +AddTestCase("x1.bravo.@[q3]", new XML("value3"), x1.bravo.@[q3]); + + +END(); diff --git a/mozilla/js/tamarin/test/e4x/QName/e13_3_3_1.as b/mozilla/js/tamarin/test/e4x/QName/e13_3_3_1.as new file mode 100644 index 00000000000..0c26323a308 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/QName/e13_3_3_1.as @@ -0,0 +1,73 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.3.3.1 - QName.prototype"); + +AddTestCase( "typeof QName.prototype", "object", typeof QName.prototype); +AddTestCase( "QName.prototype instanceof QName", false, QName.prototype instanceof QName); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/QName/e13_3_4_1.as b/mozilla/js/tamarin/test/e4x/QName/e13_3_4_1.as new file mode 100644 index 00000000000..3caac226d26 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/QName/e13_3_4_1.as @@ -0,0 +1,72 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.3.4.1 - QName.prototype.constructor"); + +AddTestCase( "QName.prototype.constructor", true, QName.prototype.constructor === QName); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/QName/e13_3_4_2.as b/mozilla/js/tamarin/test/e4x/QName/e13_3_4_2.as new file mode 100644 index 00000000000..84bdb430d93 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/QName/e13_3_4_2.as @@ -0,0 +1,79 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.3.4.2 - QName.prototype.toString"); + +qn = new QName('validname'); +AddTestCase( "QName.prototype.toString", 'validname', qn.toString()); + +qn = new QName('http://www.w3.org/TR/html4/','validname'); +AddTestCase( "qn.toString", 'http://www.w3.org/TR/html4/::validname', qn.toString()); + +qn = new QName(""); +AddTestCase( "qn = new QName(''), qn.toString", "", qn.toString()); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/QName/e13_3_5.as b/mozilla/js/tamarin/test/e4x/QName/e13_3_5.as new file mode 100644 index 00000000000..602f8e4ceca --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/QName/e13_3_5.as @@ -0,0 +1,109 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.3.5 - Properties of QName Instances"); + +q = new QName("http://someuri", "foo"); +TEST(1, true, q.hasOwnProperty("localName")); +TEST(2, true, q.hasOwnProperty("uri")); +TEST(3, true, q.propertyIsEnumerable("localName")); +TEST(4, true, q.propertyIsEnumerable("uri")); + +var localNameCount = 0; +var uriCount = 0; +var p; +for(p in q) +{ + if(p == "localName") localNameCount++; + if(p == "uri") uriCount++; +} + +TEST(5, 1, localNameCount); +TEST(6, 1, uriCount); +TEST(7, "http://someuri", q.uri); +TEST(8, "foo", q.localName); + +qn = new QName("validname"); +AddTestCase( "QName.localName", "validname", qn.localName); + +qn = new QName("http://www.w3.org/TR/html4/", "validname"); +AddTestCase( "QName.localName", "validname", qn.localName); + +qn = new QName("validname"); +AddTestCase( "qn = new QName('validname'), QName.uri", "", qn.uri); + +qn = new QName(null, "validname"); +AddTestCase( "qn = new QName(null, 'validname'), QName.uri", null, qn.uri); + +qn = new QName("http://www.w3.org/TR/html4/", "validname"); +AddTestCase( "QName.uri", "http://www.w3.org/TR/html4/", qn.uri); + +qn = new QName("", "validname"); +AddTestCase( "qn = new QName('', 'validname'), QName.uri", "", qn.uri); + + +END(); diff --git a/mozilla/js/tamarin/test/e4x/Regress/b121219.as b/mozilla/js/tamarin/test/e4x/Regress/b121219.as new file mode 100644 index 00000000000..33800e5bf2d --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Regress/b121219.as @@ -0,0 +1,70 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +START("QName in nested functions"); + +var bug = 121219; +var actual = ""; +var expect = "no error"; + +function doFrame() { + function nestedFunc(a, b, c) { + } + + x1 = + + + + + + + var n = new Namespace("http://someuri"); + + q = new QName(n, "attr1"); + nestedFunc(7, "value3value4", x1..@[q]); + + var xml1 = "pinkpurpleorange"; + var placeHolder = "c"; + + nestedFunc("x1.node1[i].@attr", "1",( x2 = new XML(xml1), x2.color[0].@c.toString())); +} + +try { + doFrame(); + actual = "no error"; +} catch(e1) { + actual = "error thrown: " + e1.toString(); +} + + + +AddTestCase("QName in nested function", expect, actual); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/Regress/error1085.as b/mozilla/js/tamarin/test/e4x/Regress/error1085.as new file mode 100644 index 00000000000..c97c37376ae --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Regress/error1085.as @@ -0,0 +1,86 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- *//* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is JavaScript Engine testing utilities. + * + * The Initial Developer of the Original Code is + * Mozilla Foundation. + * Portions created by the Initial Developer are Copyright (C) 2005 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): Igor Bukanov + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +START("13.3.5.4 - [[GetNamespace]]"); + +var bug = 283349; +var summary = 'Test assertion adding namespace'; +var actual = 'Crash'; +var expect = 'No Crash'; + +printBugNumber (bug); +printStatus (summary); + +var x1 = text; +var ns = new Namespace("http://foo.com/bar"); +x1.addNamespace(ns); +printStatus(x1.toXMLString()); + +actual = 'No Crash'; + +TEST("13.3.5.4 - [[GetNamespace]]", expect, actual); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/Regress/regress-257679.as b/mozilla/js/tamarin/test/e4x/Regress/regress-257679.as new file mode 100644 index 00000000000..478ab81943b --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Regress/regress-257679.as @@ -0,0 +1,75 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("Standalone should be allowed"); +BUG(257679); + +var x1 = arbirary text ]]>; + +var expected = new XML(" arbirary text ]]>"); + +TEST(1, expected, x1); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/Regress/regress-263934.as b/mozilla/js/tamarin/test/e4x/Regress/regress-263934.as new file mode 100644 index 00000000000..af27b415e1b --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Regress/regress-263934.as @@ -0,0 +1,89 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * John Schneider + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("Testing that replacing a list item with a new list that contains that item works"); +BUG(263934); + +var x1 = + + two + three +; + +// insert element in from of first element +x1.b[0] = one + x1.b[0]; + +var expected = + + one + two + three +; + + +TEST(1, expected, x1); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/Regress/regress-263935.as b/mozilla/js/tamarin/test/e4x/Regress/regress-263935.as new file mode 100644 index 00000000000..636307f7dc9 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Regress/regress-263935.as @@ -0,0 +1,90 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * John Schneider + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("Qualified names specifying all names in no namespace should only match names without namespaces"); +BUG(263935); + +var ns1 = new Namespace("http://www.ns1.com"); +var ns2 = new Namespace("http://www.ns2.com"); +var none = new Namespace(); + +var x1 = +x1.foo = "one"; +x1.ns1::foo = "two"; +x1.ns2::foo = "three"; +x1.bar = "four"; + +var actual = x1.none::*; + +var expected = +<> + one + four + + +TEST(1, expected, actual); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/Regress/regress-263936.as b/mozilla/js/tamarin/test/e4x/Regress/regress-263936.as new file mode 100644 index 00000000000..d9a5c8deb9b --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Regress/regress-263936.as @@ -0,0 +1,88 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * John Schneider + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("Testing replacing an element with a list that contains a text node"); +BUG(263936); + +var x1 = + + one + three +; + +// insert a text node "two" between elements and +x1.a += XML("two"); + +var expected = + + one + two + three +; + +TEST(1, expected, x1); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/Regress/regress-264369.as b/mozilla/js/tamarin/test/e4x/Regress/regress-264369.as new file mode 100644 index 00000000000..767c3b57549 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Regress/regress-264369.as @@ -0,0 +1,76 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * John Schneider + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("toXMLString() should escape '>'"); +BUG(264369); + +var x1 = ; +var chars = "<>&"; +x1.b = chars; + +TEST(1, "<>&", x1.b.toXMLString()); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/Regress/regress-271545.as b/mozilla/js/tamarin/test/e4x/Regress/regress-271545.as new file mode 100644 index 00000000000..dc23f94b8d1 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Regress/regress-271545.as @@ -0,0 +1,102 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1997-2000 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Werner Sharp, + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +START('XML("") should create empty text node'); +BUG(271545); + +// Check that text node should ignore any attempt to add a child to it + + +var x1; + +x1 = new XML(); +x1.a = "foo"; +TEST_XML(1, "", x1); + +x1 = new XML(""); +x1.a = "foo"; +TEST_XML(2, "", x1); + +x1 = new XML(null); +x1.a = "foo"; +TEST_XML(3, "", x1); + +x1 = new XML(undefined); +x1.a = "foo"; +TEST_XML(4, "", x1); + +var textNodeContent = "some arbitrary text without XML markup"; + +x1 = new XML(textNodeContent); +x1.a = "foo"; +TEST_XML(5, textNodeContent, x1); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/Regress/regress-277650.as b/mozilla/js/tamarin/test/e4x/Regress/regress-277650.as new file mode 100644 index 00000000000..e9220dac1dc --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Regress/regress-277650.as @@ -0,0 +1,93 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is JavaScript Engine testing utilities. + * + * The Initial Developer of the Original Code is + * Mozilla Foundation. + * Portions created by the Initial Developer are Copyright (C) 2005 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): Martin Honnen + * Bob Clary + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ +// testcase from Martin.Honnen@arcor.de + +var bug = 277650; +var summary = 'xml:lang attribute in XML literal'; +var actual = ''; +var expect = ''; + +START(summary); + +printBugNumber (bug); +printStatus (summary); + +expect = 'no error'; +try +{ + var xml = ECMAScript for XML; + actual = 'no error'; +} +catch(e) +{ + actual = e.toString(); +} + +TEST(1, expect, actual); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/Regress/regress-277664.as b/mozilla/js/tamarin/test/e4x/Regress/regress-277664.as new file mode 100644 index 00000000000..6d1963cd37b --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Regress/regress-277664.as @@ -0,0 +1,93 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is JavaScript Engine testing utilities. + * + * The Initial Developer of the Original Code is + * Mozilla Foundation. + * Portions created by the Initial Developer are Copyright (C) 2005 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): Martin Honnen + * Bob Clary + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ +// testcase from Martin.Honnen@arcor.de + +var bug = 277664; +var summary = 'duplicate attribute names'; +var actual = ''; +var expect = ''; + +START(summary); + +printBugNumber (bug); +printStatus (summary); + +expect = 'error'; +try +{ + var god = ; + actual = 'no error'; +} +catch(e) +{ + actual = 'error'; +} + +TEST(1, expect, actual); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/Regress/regress-277683.as b/mozilla/js/tamarin/test/e4x/Regress/regress-277683.as new file mode 100644 index 00000000000..60fb52d94aa --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Regress/regress-277683.as @@ -0,0 +1,94 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is JavaScript Engine testing utilities. + * + * The Initial Developer of the Original Code is + * Mozilla Foundation. + * Portions created by the Initial Developer are Copyright (C) 2005 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): Martin Honnen + * Bob Clary + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ +// testcase from Martin.Honnen@arcor.de + +var bug = 277683; +var summary = 'processing instruction with target name XML'; +var actual = ''; +var expect = ''; + +START(summary); + +printBugNumber (bug); +printStatus (summary); + +expect = 'no error'; +try +{ + XML.ignoreProcessingInstructions = false; + var xml = <>Kibo; + actual = 'no error'; +} +catch(e) +{ + actual = e.toString(); +} + +TEST(1, expect, actual); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/Regress/regress-277779.as b/mozilla/js/tamarin/test/e4x/Regress/regress-277779.as new file mode 100644 index 00000000000..84403f1418e --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Regress/regress-277779.as @@ -0,0 +1,89 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is JavaScript Engine testing utilities. + * + * The Initial Developer of the Original Code is + * Mozilla Foundation. + * Portions created by the Initial Developer are Copyright (C) 2005 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): Martin Honnen + * Bob Clary + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ +// testcase from Martin.Honnen@arcor.de + +var bug = 277779; +var summary = 'call setNamespace on element with already existing default namespace'; +var actual = ''; +var expect = ''; + +START(summary); + +printBugNumber (bug); +printStatus (summary); + +var xhtml2NS = new Namespace('http://www.w3.org/2002/06/xhtml2'); +var xml = ; +xml.setNamespace(xhtml2NS); + + +expect = 'http://www.w3.org/2002/06/xhtml2'; +actual = myGetNamespace(xml).toString(); +TEST(1, expect, actual); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/Regress/regress-278112.as b/mozilla/js/tamarin/test/e4x/Regress/regress-278112.as new file mode 100644 index 00000000000..3b8a22df3fa --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Regress/regress-278112.as @@ -0,0 +1,86 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1997-2000 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Werner Sharp, + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +START('setNamespace() should not affect namespaceDeclarations()'); +BUG('278112'); + +var xhtml1NS = new Namespace('http://www.w3.org/1999/xhtml'); +var xhtml = ; + +TEST(0, 0, xhtml.namespaceDeclarations().length); + +xhtml.setNamespace(xhtml1NS); + +TEST(1, 0, xhtml.namespaceDeclarations().length); + +TEST(2, xhtml1NS, myGetNamespace(xhtml)); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/Statements/e12_1.as b/mozilla/js/tamarin/test/e4x/Statements/e12_1.as new file mode 100644 index 00000000000..8613b1b8102 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Statements/e12_1.as @@ -0,0 +1,200 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("12.1 - Default XML Namespace"); + + +// Declare some namespaces ad a default namespace for the current block +var soap = new Namespace("soap", "http://schemas.xmlsoap.org/soap/envelope/"); +var stock = new Namespace("stock", "http://mycompany.com/stocks"); +default xml namespace = "http://schemas.xmlsoap.org/soap/envelope/"; + +// Create an XML initializer in the default (i.e., soap) namespace +message = + + + + DIS + + +; + +// Extract the soap encoding style using a QualifiedIdentifier +encodingStyle = message.@soap::encodingStyle; +TEST_XML(1, "http://schemas.xmlsoap.org/soap/encoding/", encodingStyle); + +// Extract the body from the soap message using the default namespace +correct = + + + DIS + +; + +body = message.soap::Body; +TEST_XML(2, correct.toXMLString(), body); + +// Change the stock symbol using the default namespace and qualified names +correct = + + + + MYCO + + +; + +message.soap::Body.stock::GetLastTradePrice.stock::symbol = "MYCO"; + +TEST(3, correct, message); + +function scopeTest() +{ + var x1 = ; + //TEST(4, soap.uri, x1.getNamespace().uri); + // Jeff says this is how it's supposed to work. Rhino is different. + /* + So what is going on here is that we’ve implemented a + proposed behavior, and Rhino implements the currently spec’d behavior. + The currently spec’d behavior is that the default default-xml-namespace + is the default-xml-namespace of global scope at the time of the call + until it is set by a local DXNS statement. This is hard to compile + and hard to read, so the working group has agreed to change + this behavior in two ways: 1/determine the inner default DXNS lexically + (by looking at what DXNS statement that comes most immediately before the + current function definition); and 2/if the local scope has a DXNS, the + default DXNS is the unnamed namespace (uri=""). + + Jd + */ + TEST(4, "", myGetNamespace(x1).uri); + someuri = new Namespace("someuri", "http://someuri.org"); + default xml namespace = "http://" + "someuri.org"; + x1 = ; + //TEST(5, "http://someuri.org", x1.getNamespace().uri); + TEST(5, "http://someuri.org", myGetNamespace(x1).uri); +} + +scopeTest(); +default xml namespace = soap; +x1 = foo; +//TEST(6, soap.uri, x.getNamespace().uri); +TEST(6, soap.uri, myGetNamespace(x1).uri); +//TEST(7, soap.uri, x.b.getNamespace().uri); +TEST(7, soap.uri, myGetNamespace(x1.b).uri); + +ns = new Namespace(""); +TEST(8, "foo", x1.b.ns::c.toString()); + +x1 = ; +//TEST(9, soap.uri, x1.getNamespace().uri); +TEST(9, soap.uri, myGetNamespace(x1).uri); +//TEST(10, "", x.@foo.getNamespace().uri); +TEST(10, "", myGetNamespace(x1.@foo).uri); +TEST_XML(11, "bar", x1.@foo); + +default xml namespace = ""; +x1 = ; +ns = new Namespace("sui", "http://someuri"); +default xml namespace = ns; +x1.a = "foo"; +TEST(12, "foo", x1["a"].toString()); +q = new QName("a"); +TEST(13, "foo", x1[q].toString()); + +default xml namespace = ""; +x1[q] = "bar"; +TEST(14, "bar", x1.ns::a.toString()); + +XML.prettyPrinting = false; +function f() { + var ns = new Namespace("bar"); + default xml namespace = ns; + x1 = ; + AddTestCase("Namespaces in function scope: ", 3, x1.ns::*.length()); +} +var ns = new Namespace("foo"); +default xml namespace = ns; +var x1 = ; + +AddTestCase("Namespaces in global scope: ", 3, x1.ns::*.length()) +f(); + +/* +var x1 = new XML(""); +var x_ = x.GetDefaultNameSpace(); +var y1 = "XMLNameSpace"; + +AddTestCase( "default xml namespace :", true, (x_==y1) ); +*/ + +END(); diff --git a/mozilla/js/tamarin/test/e4x/Statements/e12_2.as b/mozilla/js/tamarin/test/e4x/Statements/e12_2.as new file mode 100644 index 00000000000..ce1b4db896a --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Statements/e12_2.as @@ -0,0 +1,168 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("12.2 - For-in statement"); + +// All the employee names +e = + + + Joe + 20 + + + Sue + 30 + +; + +correct = new Array("Joe", "Sue", "Big Screen Television", "1299.99"); + +i = 0; +for (var n in e..name) +{ + TEST("1."+i, i.toString(), n); + i++; +} +TEST("1." + i, 2, i); + + +// Each child of the first item +order = + + + John Smith + + + Big Screen Television + 1299.99 + + + DVD Player + 399.99 + +; + +i = 0; +for (var child in order.item) +{ + TEST("2."+i, i.toString(), child); + i++ +} +TEST("2." + i, 2, i); + +i = 0; +for (child in order.item[0].*) +{ + TEST("3."+i, i.toString(), child); + i++ +} + +TEST("3." + i, 2, i); + +var i, s=""; + +var xmlDoc = "123
    "; + + +// XML Object + +var x1 = new XML(xmlDoc); + +for (i in x1.z) { + s += x1.z[i].A; +} + +AddTestCase( "for-in :", true, (s=="123") ); + +s = ""; + +for ( i in x1.z ) + s += x1.z[i].A; + +AddTestCase( "for-in (var) :", true, (s=="123") ); + + +// XMLList object + +var xl = new XMLList(xmlDoc); +s = ""; + +for (i in xl.z) { + s += xl.z[i].A; +} + +AddTestCase( "for-in :", true, (s=="123") ); + +s = ""; + +for ( i in xl.z ) + s += xl.z[i].A; + +AddTestCase( "for-in (var) :", true, (s=="123") ); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/Statements/e12_3.as b/mozilla/js/tamarin/test/e4x/Statements/e12_3.as new file mode 100644 index 00000000000..c52b6287dc3 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Statements/e12_3.as @@ -0,0 +1,110 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("12.3 - For-each statement"); + +// XML Object + +var i, s=""; + +var xmlDoc = "123"; +var x1 = new XML(xmlDoc); + +for each(i in x1.z) { + s += i.A; +} + +AddTestCase( "for-each-in :", true, (s=="123") ); + +s = ""; + +for each ( i in x1.z ) + s += i.A; + +AddTestCase( "for-each-in (var) :", true, (s=="123") ); + + +// XMLList Object + +xl = new XMLList(xmlDoc); + +s = ""; + +for each(i in xl.z) { + s += i.A; +} + +AddTestCase( "for-each-in :", true, (s=="123") ); + +s = ""; + +for each ( i in xl.z ) + s += i.A; + +AddTestCase( "for-each-in (var) :", true, (s=="123") ); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/TypeConversion/bug153363.as b/mozilla/js/tamarin/test/e4x/TypeConversion/bug153363.as new file mode 100644 index 00000000000..50016b2fe2b --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/TypeConversion/bug153363.as @@ -0,0 +1,108 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("bug153363 - XML.toString"); + +var myxml = + +burger +3.95 + +; + +var expected_results1:String = + + burger + 3.95 + + + +TEST(1,expected_results1,myxml.toString()); + +var myxml2 = + +burger + + +salad + +; + +var expected_results2:String = + +burger + + +salad + +; + +TEST(2,expected_results2,myxml2.toString()); + + +END(); + diff --git a/mozilla/js/tamarin/test/e4x/TypeConversion/bug153363_2.as b/mozilla/js/tamarin/test/e4x/TypeConversion/bug153363_2.as new file mode 100644 index 00000000000..9b4255f2626 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/TypeConversion/bug153363_2.as @@ -0,0 +1,108 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("bug153363_2 - XML.toXMLString"); + +var myxml = + +burger +3.95 + +; + +var expected_results1:String = + + burger + 3.95 + + + +TEST(1,expected_results1,myxml.toXMLString()); + +var myxml2 = + +burger + + +salad + +; + +var expected_results2:String = + +burger + + +salad + +; + +TEST(2,expected_results2,myxml2.toXMLString()); + + +END(); + diff --git a/mozilla/js/tamarin/test/e4x/TypeConversion/e10_1_1.as b/mozilla/js/tamarin/test/e4x/TypeConversion/e10_1_1.as new file mode 100644 index 00000000000..1610b6789fe --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/TypeConversion/e10_1_1.as @@ -0,0 +1,92 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("10.1.1 - XML.toString"); + +order = + + + John + Doe + + + Big Screen Television + 1299.99 + 1 + +; + +the_name = order.customer.firstname + " " + order.customer.lastname; + +TEST(1, "John Doe", the_name); + +total = order.item.price * order.item.quantity; + +TEST(2, 1299.99, total); + +END(); + diff --git a/mozilla/js/tamarin/test/e4x/TypeConversion/e10_1_2.as b/mozilla/js/tamarin/test/e4x/TypeConversion/e10_1_2.as new file mode 100644 index 00000000000..3fcee8af9c3 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/TypeConversion/e10_1_2.as @@ -0,0 +1,102 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("10.1.2 - XMLList.toString"); + +// One XML object + +var x1 = new XML("A"); +var x_ = x1.toString(); +var y1 = "A"; + +AddTestCase( "ToString(XMLList:one XML object) :", true, (x_==y1) ); + +/*---------------------------------------------------------------------------*/ + +x1 = new XML(""); +x_ = x1.toString(); +y1 = ""; + +AddTestCase( "ToString(XMLList:one XML object, [[Class]]='comment') :", true, (x_==y1) ); + +/*---------------------------------------------------------------------------*/ + +x1 = new XML(""); +x_ = x1.toString(); +y1 = ""; + +AddTestCase( "ToString(XMLList:one XML object, [[Class]]='processing-instruction') :", true, (x_==y1) ); + +/*---------------------------------------------------------------------------*/ +XML.prettyPrinting = false; +x1 = new XMLList("ABCD"); +x_ = x1.toString(); +y1 = "AB\nCD"; + +AddTestCase( "ToString(XMLList:multiple XML objects) :", true, (x_==y1) ); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/TypeConversion/e10_2_1.as b/mozilla/js/tamarin/test/e4x/TypeConversion/e10_2_1.as new file mode 100644 index 00000000000..df86ef8747e --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/TypeConversion/e10_2_1.as @@ -0,0 +1,108 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("10.2.1 - XML.toXMLString"); + +// text + +var x1 = new XML("abc & 123"); +var x0 = x1.toXMLString(); +var y0 = "abc & 123"; + +AddTestCase( "ToXMLString(text) :", true, (x0==y0) ); + +/*---------------------------------------------------------------------------*/ +// comment + +x1 = new XML(""); +x0 = x1.toXMLString(); +y0 = ""; + +AddTestCase( "ToXMLString(comment) :", true, (x0==y0) ); + +/*---------------------------------------------------------------------------*/ +// processing instruction + +x1 = new XML("i"); +x0 = x1.toXMLString(); +y0 = "i"; + +AddTestCase( "ToXMLString(processing-instruction) :", true, (x0==y0) ); + +/*---------------------------------------------------------------------------*/ +// ToXMLString ( x ) + +XML.ignoreWhitespace = true; + +x1 = new XML("BC"); + +x0 = x1.toXMLString(); +y0 = "\n B\n C\n"; + +AddTestCase( "ToXMLString(XML) :", true, (x0==y0) ); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/TypeConversion/e10_2_1_1.as b/mozilla/js/tamarin/test/e4x/TypeConversion/e10_2_1_1.as new file mode 100644 index 00000000000..f82de0896ac --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/TypeConversion/e10_2_1_1.as @@ -0,0 +1,75 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("10.2.1.1 - EscapeElementValue(s)"); + +AddTestCase( "EscapeElementValue('&') :", "4 & 5", (x1 = new XML("4 & 5"), x1.toXMLString()) ); +AddTestCase( "EscapeElementValue('&') :", "4 & 5", (x1 = new XML("4 & 5"), x1.toXMLString()) ); +AddTestCase( "EscapeElementValue('<') :", "4 < 5", (x1 = new XML("4 < 5"), x1.toXMLString()) ); +AddTestCase( "EscapeElementValue('>') :", "5 > 4", (x1 = new XML("5 > 4"), x1.toXMLString()) ); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/TypeConversion/e10_2_1_2.as b/mozilla/js/tamarin/test/e4x/TypeConversion/e10_2_1_2.as new file mode 100644 index 00000000000..477122383e5 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/TypeConversion/e10_2_1_2.as @@ -0,0 +1,81 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("10.2.1.2 - EscapeAttributeValue(s)"); + +AddTestCase( "EscapeElementValue('\"') :", "hi", (x1 = hi, x1.toXMLString()) ); +AddTestCase( "EscapeElementValue('<') :", "b", (x1 = b, x1.toXMLString()) ); +AddTestCase( "EscapeElementValue('>') :", " 9\">b", (x1 = b, x1.toXMLString()) ); +AddTestCase( "EscapeElementValue('&') :", "b", (x1 = b, x1.toXMLString()) ); +AddTestCase( "EscapeElementValue(' ') :", "b", (x1 = b, x1.toXMLString()) ); +AddTestCase( "EscapeElementValue(' ') :", "b", (x1 = b, x1.toXMLString()) ); +AddTestCase( "EscapeElementValue(' ') :", "b", (x1 = b, x1.toXMLString()) ); +AddTestCase( "EscapeElementValue('\u0009') :", "b", (x1 = b, x1.toXMLString()) ); +AddTestCase( "EscapeElementValue('\u000A') :", "b", (x1 = b, x1.toXMLString()) ); +AddTestCase( "EscapeElementValue('\u000D') :", "b", (x1 = b, x1.toXMLString()) ); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/TypeConversion/e10_2_2.as b/mozilla/js/tamarin/test/e4x/TypeConversion/e10_2_2.as new file mode 100644 index 00000000000..83916573ccb --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/TypeConversion/e10_2_2.as @@ -0,0 +1,78 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("10.2.2 - ToXMLString Applied to the XMLList Type"); + +//ToXMLString ( xl ) + +var x1 = new XMLList("ABC"); +var x_ = x1.toXMLString(); +var y1 = "A\nB\nC"; + +AddTestCase( "ToXMLString(XMLList) :", true, (x_==y1) ); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/TypeConversion/e10_3.as b/mozilla/js/tamarin/test/e4x/TypeConversion/e10_3.as new file mode 100644 index 00000000000..727d6a5cfd3 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/TypeConversion/e10_3.as @@ -0,0 +1,187 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("10.3 - toXML"); + +var x1; + +// boolean +x1 = new Boolean(true); +TEST_XML(1, "true", new XML(x1)); + +// number +x1 = new Number(123); +TEST_XML(2, "123", new XML(x1)); + +// String +x1 = new String("one"); +TEST(3, one, new XML(x1)); + +// XML +x1 = new XML("one"); +TEST(4, one, new XML(x1)); + +// XMLList +x1 = new XMLList("one"); +TEST(5, one, new XML(x1)); + +try { + x1 = new XMLList(one + two); + new XML(x1); + SHOULD_THROW(6); +} catch (ex) { + TEST(6, "TypeError", ex.name); +} +/* +// Undefined + +try +{ + ToXML(undefined); + AddTestCase( "ToXML(undefined) :", true, false ); +} +catch (e) +{ + AddTestCase( "ToXML(undefined) :", true, true ); +} + + +// Null + +try +{ + ToXML(null); + AddTestCase( "ToXML(null) :", true, false ); +} +catch (e) +{ + AddTestCase( "ToXML(null) :", true, true ); +} + + +// Boolean + +var xt = "true"; +var xf = "false"; + +AddTestCase( "ToXML(true) :", true, (ToXML(true)==xt) ); +AddTestCase( "ToXML(false) :", true, (ToXML(false)==xf) ); + + +// Number + +var xn = "1234"; + +AddTestCase( "ToXML(1234) :", true, (ToXML(1234)==xn) ); + + +// XML + +var x1 = new XML("A"); + +AddTestCase( "ToXML(XML) :", true, (ToXML(x1)==x1) ); + + +// XMLList + +x1 = new XML("A"); + +AddTestCase( "ToXML(XMLList) :", true, (ToXML(x1)=="A") ); + + +// XMLList - XMLList contains more than one property + +x1 = A + B + C; + +try +{ + ToXML(x); + AddTestCase( "ToXML(XMLList) :", true, false ); +} +catch (e) +{ + AddTestCase( "ToXML(XMLList) :", true, true ); +} + + +// Object + +var a = new Array(); + +try +{ + ToXML(a); + AddTestCase( "ToXML(Object) :", true, false ); +} +catch (e) +{ + AddTestCase( "ToXML(Object) :", true, true ); +} +*/ +END(); diff --git a/mozilla/js/tamarin/test/e4x/TypeConversion/e10_3_1.as b/mozilla/js/tamarin/test/e4x/TypeConversion/e10_3_1.as new file mode 100644 index 00000000000..6fa9bc1b6e5 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/TypeConversion/e10_3_1.as @@ -0,0 +1,94 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("10.3.1 - toXML applied to String type"); + +john = "John25"; +sue = "Sue32"; +tagName = "employees"; +employees = new XML("<" + tagName + ">" + john + sue + ""); + +correct = + + John25 + Sue32 +; + +TEST(1, correct, employees); +/* +var x = "A"; +var x_ = new XML("A"); + +AddTestCase( "ToXML(String) :", true, (ToXML(x)==x_) ); + + + +var xn = new XML(x); + +AddTestCase( "ToXML(String) - new XML() :", true, (xn==x_) ); +*/ +END(); diff --git a/mozilla/js/tamarin/test/e4x/TypeConversion/e10_4.as b/mozilla/js/tamarin/test/e4x/TypeConversion/e10_4.as new file mode 100644 index 00000000000..c2df8e63f12 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/TypeConversion/e10_4.as @@ -0,0 +1,108 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("10.4 - toXMLList"); + +var xl; + +// null +try { + xl = null; + xl.toString(); + SHOULD_THROW(1); +} catch (ex) { + TEST(1, "TypeError", ex.name); +} + +// number +x = new Number(123); +TEST(2, "123", new XMLList(x).toXMLString()); + +// String +x = new String("one"); +TEST(3, one, new XMLList(x)); + +x = new String("onetwo"); +TEST(4, "one" + "\n" + "two", + new XMLList(x).toXMLString()); + +// XML +x = new XML(one); +TEST(5, one, new XMLList(x)); + +x = new XML(onetwo); +TEST(6, one, new XMLList(x.alpha)); + +// XMLList +x = new XMLList(one); +TEST(7, one, new XMLList(x)); + +x = new XMLList(<>onetwo); +TEST(8, "one" + "\n" + "two", + new XMLList(x).toXMLString()); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/TypeConversion/e10_4_1.as b/mozilla/js/tamarin/test/e4x/TypeConversion/e10_4_1.as new file mode 100644 index 00000000000..fd895cf0e33 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/TypeConversion/e10_4_1.as @@ -0,0 +1,118 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("10.4.1 - toXMLList Applied to String type"); + +var x1, y1, correct; + +x1 = +<> + one + two +; + +TEST(1, "xml", typeof(x1)); +TEST(2, "one" + NL() + "two", x1.toXMLString()); + +// Load from another XMLList +// Make sure it is copied if it's an XMLList +y1 = new XMLList(x1); + +x1 += three; + +TEST(3, "one" + NL() + "two", y1.toXMLString()); + +// Load from one XML type +x1 = new XMLList(one); +TEST(4, "one", x1.toXMLString()); + +// Load from Anonymous +x1 = new XMLList(<>onetwo); +TEST(5, "one" + NL() + "two", x1.toXMLString()); + +// Load from Anonymous as string +x1 = new XMLList("onetwo"); +TEST(6, "one" + NL() + "two", x1.toXMLString()); + +// Load from illegal type +//x1 = new XMLList("foobar"); +//ADD(7, "", x); + +John = "John25"; +Sue = "Sue32"; + +correct = +<> + John25 + Sue32 +; + +var1 = new XMLList(John + Sue); + +TEST(8, correct, var1); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/TypeConversion/e10_5.as b/mozilla/js/tamarin/test/e4x/TypeConversion/e10_5.as new file mode 100644 index 00000000000..0754b345774 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/TypeConversion/e10_5.as @@ -0,0 +1,72 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("10.5 ToAttributeName"); + + + +END(); diff --git a/mozilla/js/tamarin/test/e4x/TypeConversion/e10_5_1.as b/mozilla/js/tamarin/test/e4x/TypeConversion/e10_5_1.as new file mode 100644 index 00000000000..1dedb84322e --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/TypeConversion/e10_5_1.as @@ -0,0 +1,72 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("10.5.1 - ToAttributeName applied to the String type"); + + + +END(); diff --git a/mozilla/js/tamarin/test/e4x/TypeConversion/e10_6.as b/mozilla/js/tamarin/test/e4x/TypeConversion/e10_6.as new file mode 100644 index 00000000000..5f71ef382eb --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/TypeConversion/e10_6.as @@ -0,0 +1,72 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("10.6 - ToXMLName"); + + + +END(); diff --git a/mozilla/js/tamarin/test/e4x/TypeConversion/e10_6_1.as b/mozilla/js/tamarin/test/e4x/TypeConversion/e10_6_1.as new file mode 100644 index 00000000000..c1a8210c9e5 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/TypeConversion/e10_6_1.as @@ -0,0 +1,72 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("10.6.1 - ToXMLName applied to the String type"); + + + +END(); diff --git a/mozilla/js/tamarin/test/e4x/Types/e9_1_1_1.as b/mozilla/js/tamarin/test/e4x/Types/e9_1_1_1.as new file mode 100644 index 00000000000..1f4e326f6d9 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Types/e9_1_1_1.as @@ -0,0 +1,337 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START('9.1.1.1 XML [[Get]]'); + +var x1 = + + + one + two + +; + +// . +TEST(1, onetwo, x1.bravo); +TEST(2, two, x1.bravo.charlie); +TEST(3, two, x1.bravo.charlie.parent().charlie); + +// .* +var correct = new XMLList("onetwo"); +TEST(4, correct, x1.bravo.*); +TEST_XML(5, "two", x1.bravo.charlie.*); +TEST(6, onetwo, x1.*[0]); + +// .@ +TEST_XML(7, "value1", x1.@attr1); +TEST_XML(8, "value2", x1.@attr2); + +// .. +TEST(9, onetwo, x1..bravo); +TEST(10, two, x1..charlie); + +// .@* +correct = new XMLList(); +correct += new XML("value1"); +correct += new XML("value2"); +TEST(11, correct, x1.@*); + +x1 = + + + one + two + +; + +// ..* +XML.prettyPrinting = false; +correct = new XMLList("onetwoonetwotwo"); +TEST(12, correct, x1..*); +XML.prettyPrinting = true; + +x1 = + + + one + two + +; + +// ..@ +correct = new XMLList(); +correct += new XML("value3"); +correct += new XML("value4"); +TEST(13, correct, x1..@attr3) + +// ..@* +correct = new XMLList(); +correct += new XML("value1"); +correct += new XML("value2"); +correct += new XML("value3"); +correct += new XML("value4"); +TEST(14, correct, x1..@*); + + +// Check reserved words +x1 = + + one +; + +TEST(15, one, x1.prototype); + +// Check method names +x1 = + + one + two +; + +TEST(16, one, x1.name); +TEST(17, QName("alpha"), x1.name()); +TEST(18, two, x1.toString); +TEST(19, x1.toXMLString(), x1.toString()); + +// Test super-expandos +x1 = + + one +; + +correct = + + + one + + two + + +; + +x1.bravo.charlie.delta = two; +TEST(20, correct, x1); + +x1 = + + one +; + +correct = + + + one + + two + + +; + +x1.bravo.charlie.delta = "two"; +TEST(21, correct, x1); + +x1 = + + one +; + +correct = + + + one + + two + + +; + +x1.bravo.charlie.delta = two; +TEST(22, correct, x1); + +// Also ADD with *, children() and child() +x1 = + + one +; + +correct = + + + one + + two + + +; + +x1.*.charlie.delta = two; +TEST(23, correct, x1); + +x1 = + + one +; + +correct = + + + one + + two + + +; + +x1.children().charlie.delta = two; +TEST(24, correct, x1); + +x1 = + + one +; + +correct = + + + one + + two + + +; + +x1.child("bravo").charlie.delta = two; +TEST(25, correct, x1); + +x1 = + + one +; + +correct = + + one + + + two + + +; + +x1.child("newChild").charlie.delta = two; +TEST(26, correct, x1); + +// These should fail because the XMLList is size > 1 +x1 = + + one + two +; + +try { + x1.*.charlie.delta = "more"; + SHOULD_THROW(27); +} catch (ex1) { + TEST(27, "TypeError", ex1.name); +} + +x1 = + + one + two +; + +try { + x1.children().charlie.delta = "more"; + SHOULD_THROW(28); +} catch (ex2) { + TEST(28, "TypeError", ex2.name); +} + +x1 = + + one + two +; + +try { + x1.child("bravo").charlie.delta = "more"; + SHOULD_THROW(29); +} catch (ex3) { + TEST(29, "TypeError", ex3.name); +} + +// ..@:: +var x1 = ; +var n = new Namespace("foo"); + +TEST(30, "20", x1..@n::a.toString()); + +var x1 = new XML(i); +AddTestCase("Reserved keyword used as element name", "i", x1["class"].toString()); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/Types/e9_1_1_10.as b/mozilla/js/tamarin/test/e4x/Types/e9_1_1_10.as new file mode 100644 index 00000000000..e5254206a83 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Types/e9_1_1_10.as @@ -0,0 +1,75 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("9.1.1.10 - XML [[ResolveValue]]"); + +// !FIX + +AddTestCase("No test cases", true, true); + +END(); + diff --git a/mozilla/js/tamarin/test/e4x/Types/e9_1_1_11.as b/mozilla/js/tamarin/test/e4x/Types/e9_1_1_11.as new file mode 100644 index 00000000000..8773301563c --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Types/e9_1_1_11.as @@ -0,0 +1,74 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("9.1.1.11 - XML [[Insert]]"); + +AddTestCase("No test cases", true, true); + +END(); + + diff --git a/mozilla/js/tamarin/test/e4x/Types/e9_1_1_12.as b/mozilla/js/tamarin/test/e4x/Types/e9_1_1_12.as new file mode 100644 index 00000000000..3af0f45b415 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Types/e9_1_1_12.as @@ -0,0 +1,72 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("9.1.1.12 - XML [[Replace]]"); + +AddTestCase("No test cases", true, true); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/Types/e9_1_1_13.as b/mozilla/js/tamarin/test/e4x/Types/e9_1_1_13.as new file mode 100644 index 00000000000..a78556fb831 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Types/e9_1_1_13.as @@ -0,0 +1,72 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("9.1.1.13 - XML Type [[AddInScopeNamespace]]"); + +AddTestCase("No test cases", true, true); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/Types/e9_1_1_2.as b/mozilla/js/tamarin/test/e4x/Types/e9_1_1_2.as new file mode 100644 index 00000000000..353f0f9bd44 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Types/e9_1_1_2.as @@ -0,0 +1,114 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START('9.1.1.2 - XML [[Put]]'); + + +// . +var x1 = + + + one + two + +; + +var correct = +new; + +x1.bravo.charlie = "new" +TEST(1, correct, x1.bravo.charlie) +x1.bravo = three +TEST(2, "three", x1.delta.toString()) + +// .@ +x1 = onetwo +x1.@attr1 = "newValue" +TEST_XML(3, "newValue", x1.@attr1) + +x1 = onetwo +x1.@name = "foo"; +TEST_XML(4, "foo", x1.@name) + +var a = ; + +try { + a.b[0] = a; + result = a; +} catch (e1) { + result = typeError(e1.toString()); +} + + +// This might fail in tomorrow's build. 11/02/05 +a = some junksome junksome junk; +correct = some junksome junksome junkwith some text; + +AddTestCase("blah", correct, (a.*::foo = with some text, a)); + + +END(); diff --git a/mozilla/js/tamarin/test/e4x/Types/e9_1_1_3.as b/mozilla/js/tamarin/test/e4x/Types/e9_1_1_3.as new file mode 100644 index 00000000000..6be80b352bf --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Types/e9_1_1_3.as @@ -0,0 +1,150 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("9.1.1.3 - XML [[Delete]]"); + +// .@ +x1 = +one; + +delete x1.@attr1; +TEST_XML(1, "", x1.@attr1); +TEST(2, one, x1); + +// ..@ +x1 = + + one + + two + three + +; + +xref = + + one + + two + three + +; + +correct = + + one + + two + three + +; + +delete x1..@attr3; + +//Rhino test: +//TEST(3, correct, x1); + +// We are different. Deleting descendant attributes doesn't change the original object: +TEST(3, xref.toString(), x1.toString()); + + +// ..@* +x1 = + + one + + two + three + +; + +xref = + + one + + two + three + +; + +correct = + + one + + two + three + +; + +delete x1..@*; + +// Rhino test: +//TEST(4, correct, x1); + +// We are different. Deleting descendant attributes doesn't change the original object: +TEST(4, xref.toString(), x1.toString()); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/Types/e9_1_1_4.as b/mozilla/js/tamarin/test/e4x/Types/e9_1_1_4.as new file mode 100644 index 00000000000..1e35260af94 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Types/e9_1_1_4.as @@ -0,0 +1,99 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("9.1.1.4 - XML [[DeleteByIndex]]"); + +order = + + +John +Doe +
    123 Foobar Ave.
    +Bellevue +WA +
    + +Big Screen Television +1299.99 +1 + + +Camera phone +399.99 +1 + + +DVD Player +399.99 +1 + +
    ; + +delete order.item[1]; + +TEST(1, 2, order.item.length()); + + +END(); diff --git a/mozilla/js/tamarin/test/e4x/Types/e9_1_1_5.as b/mozilla/js/tamarin/test/e4x/Types/e9_1_1_5.as new file mode 100644 index 00000000000..5fd85d64f95 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Types/e9_1_1_5.as @@ -0,0 +1,73 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +// XML Type [[Default Value]] +START("9.1.1.5 - XML [[Default Value]]"); + +AddTestCase("No test cases", true, true); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/Types/e9_1_1_6.as b/mozilla/js/tamarin/test/e4x/Types/e9_1_1_6.as new file mode 100644 index 00000000000..f9d3fc337cc --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Types/e9_1_1_6.as @@ -0,0 +1,82 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("9.1.1.6 - XML [[HasProperty]]"); + +x1 = onetwothree; +TEST(1, true, "bravo" in x1); +TEST(2, true, 0 in x1); +TEST(3, true, "charlie" in x1.bravo); +TEST(4, true, 0 in x1.bravo); +TEST(5, false, 1 in x1); +TEST(6, false, 1 in x1.bravo); +TEST(7, false, 2 in x1); +TEST(8, false, 2 in x1.bravo); +TEST(9, false, "foobar" in x1); +TEST(10, false, "foobar" in x1.bravo); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/Types/e9_1_1_7.as b/mozilla/js/tamarin/test/e4x/Types/e9_1_1_7.as new file mode 100644 index 00000000000..46f4ce1f8f6 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Types/e9_1_1_7.as @@ -0,0 +1,73 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("9.1.1.7 - XML [[DeepCopy]]"); + +AddTestCase("No test cases", true, true); + +END(); + diff --git a/mozilla/js/tamarin/test/e4x/Types/e9_1_1_8.as b/mozilla/js/tamarin/test/e4x/Types/e9_1_1_8.as new file mode 100644 index 00000000000..c4987e4b72a --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Types/e9_1_1_8.as @@ -0,0 +1,74 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +// XML Type [[Descendants]] +START("9.1.1.8 - XML [[Descendants]]"); + +AddTestCase("No test cases", true, true); + +END(); + diff --git a/mozilla/js/tamarin/test/e4x/Types/e9_1_1_9.as b/mozilla/js/tamarin/test/e4x/Types/e9_1_1_9.as new file mode 100644 index 00000000000..6f768422227 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Types/e9_1_1_9.as @@ -0,0 +1,161 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("9.1.1.9 - XML [[Equals]]"); + +x1 = one; +y1 = one; +TEST(1, true, (x1 == y1) && (y1 == x1)); + +// Should return false if comparison is not XML +y1 = "one"; +TEST(2, false, (x1 == y1) || (y1 == x1)); + +y1 = undefined +TEST(3, false, (x1 == y1) || (y1 == x1)); + +y1 = null +TEST(4, false, (x1 == y1) || (y1 == x1)); + +y1 = new Object(); +TEST(5, false, (x1 == y1) || (y1 == x1)); + +// Check with attributes +x1 = onetwo; +y1 = onetwo; +TEST(6, true, (x1 == y1) && (y1 == x1)); + +y1 = onetwo; +TEST(7, false, (x1 == y1) || (y1 == x1)); + +// Logical equality +// Attribute order. +x1 = onetwo; +y1 = onetwo; +TEST(8, true, (x1 == y1) && (y1 == x1)); + +// Skips empty text nodes +x1 = one ; +y1 = one; +TEST(9, true, (x1 == y1) && (y1 == x1)); + + +XML.ignoreWhitespace = false; + +// Doesn't trim text nodes. +x1 = one ; +y1 = one; +TEST(10, false, (x1 == y1) || (y1 == x1)); + +// Compare comments +XML.ignoreComments = false; +x1 = new XML('one'); +y1 = new XML('one'); +TEST(11, false, (x1 == y1) || (y1 == x1)); + +one = x1.*[0]; +two = y1.*[0]; +TEST(12, false, (one == two) || (two == one)); + +one = x1.*[0]; +two = y1.bravo.*[0]; +TEST(13, true, (one == two) && (two == one)); + + +// Compare processing instructions +XML.ignoreProcessingInstructions = false; +x1 = new XML('one'); +y1 = new XML('one'); +TEST(14, false, (x1 == y1) || (y1 == x1)); + +one = x1.*[0]; +two = y1.*[0]; +TEST(15, false, (one == two) || (two == one)); + +one = x1.*[0]; +two = y1.bravo.*[0]; +TEST(16, true, (one == two) && (two == one)); + +// Namespaces +x1 = one; +y1 = one; + +TEST(17, true, (x1 == y1) && (y1 == x1)); + +y1 = one; +TEST(18, false, (x1 == y1) || (y1 == x1)); + + +// Default namespace +default xml namespace = "http://foo/"; +x1 = one; +y1 = one; + +TEST(19, true, (x1 == y1) && (y1 == x1)); + + +END(); diff --git a/mozilla/js/tamarin/test/e4x/Types/e9_2_1_1.as b/mozilla/js/tamarin/test/e4x/Types/e9_2_1_1.as new file mode 100644 index 00000000000..e00305d6459 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Types/e9_2_1_1.as @@ -0,0 +1,187 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("9.2.1.1 XMLList [[Get]]"); + +var x1 = +<> + + + one + two + + + + + three + four + + +; + +// . +correct = +<> + + one + two + + + three + four + +; + +TEST(1, correct, x1.bravo); + +correct = +<> + two + four +; + +TEST(2, correct, x1.bravo.charlie); + +// .@ +correct = new XMLList(); +correct += new XML("value1"); +correct += new XML("value3"); +TEST(3, correct, x1.@attr1); + +correct = new XMLList(); +correct += new XML("value2"); +correct += new XML("value4"); +TEST(4, correct, x1.bravo.@attr2); + +// .. +correct = +<> + + one + two + + + three + four + +; + +TEST(5, correct, x1..bravo); + +correct = +<> + two + four +; + +TEST(6, correct, x1..charlie); + +// .@* +correct = new XMLList(); +correct += new XML("value1"); +correct += new XML("value3"); +TEST(7, correct, x1.@*); + +x1 = + + + one + two + +; + +// ..* +correct = <>onetwoonetwotwo; + +XML.prettyPrinting = false; +TEST(8, correct, x1..*); +XML.prettyPrinting = true; + +x1 = + + + one + two + +; + +// ..@ +correct = new XMLList(); +correct += new XML("value2"); +correct += new XML("value3"); +TEST(9, correct, x1..@attr2) + +// ..@* +correct = new XMLList(); +correct += new XML("value1"); +correct += new XML("value2"); +correct += new XML("value3"); +correct += new XML("value4"); +TEST(10, correct, x1..@*); + + +END(); diff --git a/mozilla/js/tamarin/test/e4x/Types/e9_2_1_10.as b/mozilla/js/tamarin/test/e4x/Types/e9_2_1_10.as new file mode 100644 index 00000000000..ec88db3c8e3 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Types/e9_2_1_10.as @@ -0,0 +1,73 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("9.2.1.10 XMLList [[ResolveValue]]"); + +AddTestCase("No test cases", true, true); + +END(); + diff --git a/mozilla/js/tamarin/test/e4x/Types/e9_2_1_2.as b/mozilla/js/tamarin/test/e4x/Types/e9_2_1_2.as new file mode 100644 index 00000000000..1f79141b1d1 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Types/e9_2_1_2.as @@ -0,0 +1,163 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("9.2.1.2 - XMLList [[Put]]"); + + +// element + +var x1 = new XMLList("onetwo"); + +TEST(1, "one" + NL() + "two", + x1.toXMLString()); + +x1[0] = three; +TEST(2, "three" + NL() + "two", + x1.toXMLString()); + +x1[0] = four + five; +TEST(3, "four" + NL() + "five" + NL() + "two", + x1.toXMLString()); + +var y1 = new XMLList("onetwo"); +y1[0] = "five"; + +TEST(4, "five" + NL() + "two", + y1.toXMLString()); + + + +// attribute + +var x1 = new XMLList("onetwo"); +x1[0].@attr = "fifty"; +TEST(5, "one" + NL() + "two", x1.toXMLString()); + +var x1 = new XMLList("onetwo"); +x1[0].@attr = new XMLList("sixty"); +TEST(6, "one" + NL() + "two", x1.toXMLString()); + +var x1 = new XMLList("onetwo"); +x1[0].@attr = "sixty"; +TEST(7, "sixty</att>\">one" + NL() + "two", x1.toXMLString()); + + +// text node + +var x1 = new XMLList("alphatwo"); +x1[0] = "beta"; +TEST(8, "beta" + NL() + "two", x1.toXMLString()); + +var x1 = new XMLList("onetwo"); +x1[0] = new XML("beta"); +TEST(9, "beta" + NL() + "two", x1.toXMLString()); + +var x1 = new XMLList("onetwo"); +x1[0] = new XMLList("beta"); +TEST(10, "beta" + NL() + "two", x1.toXMLString()); + +var x1 = new XMLList("alphatwo"); +x1[0] = new XML("beta"); +TEST(11, "beta" + NL() + "two", x1.toXMLString()); + + +// comment + +var x1 = new XMLList(""); +x1.beta = new XMLList("hello"); +TEST(12, new XMLList("hello"), x1); + +var x1 = new XMLList(""); +x1.beta = new XML("hello"); +TEST(13, new XMLList("hello"), x1); + +var x1 = new XMLList(""); +x1.beta = "hello"; +TEST(14, new XMLList("hello"), x1); + +var x1 = new XMLList(""); +x1.beta = new XML("hello"); +TEST(15, new XMLList("hello"), x1); + + +// PI + +XML.ignoreProcessingInstructions = false; +var x1 = new XML(""); +x1.beta = new XML("instructions"); +TEST(16, new XMLList("instructions"), x1); + +XML.ignoreProcessingInstructions = false; +var x1 = new XML(""); +x1.beta = new XMLList("instructions"); +TEST(17, new XMLList("instructions"), x1); + +var x1 = new XML(""); +x1.beta = "processing instructions"; +TEST(18, new XMLList("processing instructions"), x1); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/Types/e9_2_1_3.as b/mozilla/js/tamarin/test/e4x/Types/e9_2_1_3.as new file mode 100644 index 00000000000..4292cfe4d12 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Types/e9_2_1_3.as @@ -0,0 +1,72 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("9.2.1.3 XMLList [[Delete]]"); + +AddTestCase("No test cases", true, true); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/Types/e9_2_1_4.as b/mozilla/js/tamarin/test/e4x/Types/e9_2_1_4.as new file mode 100644 index 00000000000..12f9653380a --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Types/e9_2_1_4.as @@ -0,0 +1,73 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("9.2.1.4 XMLList [[DefaultValue]]"); + +AddTestCase("No test cases", true, true); + +END(); + diff --git a/mozilla/js/tamarin/test/e4x/Types/e9_2_1_5.as b/mozilla/js/tamarin/test/e4x/Types/e9_2_1_5.as new file mode 100644 index 00000000000..a001afd67b4 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Types/e9_2_1_5.as @@ -0,0 +1,75 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("9.2.1.5 XMLList [[HasProperty]]"); + +AddTestCase("No test cases", true, true); + +END(); + + + diff --git a/mozilla/js/tamarin/test/e4x/Types/e9_2_1_6.as b/mozilla/js/tamarin/test/e4x/Types/e9_2_1_6.as new file mode 100644 index 00000000000..78a4092f1e1 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Types/e9_2_1_6.as @@ -0,0 +1,73 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("9.2.1.6 XMLList [[Append]]"); + +AddTestCase("No test cases", true, true); + +END(); + diff --git a/mozilla/js/tamarin/test/e4x/Types/e9_2_1_7.as b/mozilla/js/tamarin/test/e4x/Types/e9_2_1_7.as new file mode 100644 index 00000000000..113ee71f2ca --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Types/e9_2_1_7.as @@ -0,0 +1,73 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("9.2.1.7 XMLList [[DeepCopy]]"); + +AddTestCase("No test cases", true, true); + +END(); + diff --git a/mozilla/js/tamarin/test/e4x/Types/e9_2_1_8.as b/mozilla/js/tamarin/test/e4x/Types/e9_2_1_8.as new file mode 100644 index 00000000000..a51aada02b3 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Types/e9_2_1_8.as @@ -0,0 +1,79 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("9.2.1.8 XMLList [[Descendants]]"); + +x1 = +<> +one +two +; + +correct = <>onetwo; +TEST(1, correct, x1..bravo); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/Types/e9_2_1_9.as b/mozilla/js/tamarin/test/e4x/Types/e9_2_1_9.as new file mode 100644 index 00000000000..312b77699d8 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/Types/e9_2_1_9.as @@ -0,0 +1,104 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("9.2.1.9 XMLList [[Equals]]"); + +// Empty list should equal undefined +TEST(1, true, (new XMLList() == undefined) && (undefined == new XMLList())); + +// Compare two lists if all are equal +x1 = one + two; +y1 = one + two; +TEST(2, true, (x1 == y1) && (y1 == x1)); +y1 = one + two + three; +TEST(3, false, (x1 == y1) || (y1 == x1)); +y1 = one + not; +TEST(4, false, (x1 == y1) || (y1 == x1)); + +// If XMLList has one argument should compare with just the 0th element. +x1= new XMLList("one"); +y1 = one; +TEST(5, true, (x1 == y1) && (y1 == x1)); +y1 = "one"; +TEST(6, true, (x1 == y1) && (y1 == x1)); + +// Should return false even if list contains element equal to comparison +x1 = one + two; +y1 = one; +TEST(7, false, (x1 == y1) && (y1 == x1)); + +y1 = "one"; +TEST(8, false, (x1 == y1) || (y1 == x1)); + +// Try other types - should return false +y1 = null; +TEST(9, false, (x1 == y1) || (y1 == x1)); + +y1 = new Object(); +TEST(10, false, (x1 == y1) || (y1 == x1)); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XML/bug157597.as b/mozilla/js/tamarin/test/e4x/XML/bug157597.as new file mode 100644 index 00000000000..a9677a54b58 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XML/bug157597.as @@ -0,0 +1,88 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("bug157597 - XML insertChildAfter()"); + +//TEST(1, true, XML.prototype.hasOwnProperty("insertChildAfter")); + +var example:XML = +2 +; + +correct = + +2 +3 +; + +example.insertChildAfter(example.two, 3); + +TEST(2, correct, example); + + + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XML/bug157597_2.as b/mozilla/js/tamarin/test/e4x/XML/bug157597_2.as new file mode 100644 index 00000000000..3a9be41bbcf --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XML/bug157597_2.as @@ -0,0 +1,88 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("bug157597 - XML insertChildBefore()"); + + + +var example:XML = +2 +; + +correct = + +1 +2 +; + +example.insertChildBefore(example.two, 1); + +TEST(2, correct, example); + + + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XML/bug157735.as b/mozilla/js/tamarin/test/e4x/XML/bug157735.as new file mode 100644 index 00000000000..a5511b42d95 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XML/bug157735.as @@ -0,0 +1,78 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("bug157735 - XML comments()"); + +XML.ignoreComments = false; + +var p =

    this is normal text

    ; + +TEST(1, "this is normal text", p.toString()); + + + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XML/bug158506.as b/mozilla/js/tamarin/test/e4x/XML/bug158506.as new file mode 100644 index 00000000000..083ecaf7e3d --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XML/bug158506.as @@ -0,0 +1,83 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("bug158506"); + + +var x:XML = + + +for each( var node:XML in x..author ) +{ var name:String = node.@name; +var sign:String = node.@sign; +TEST(1, "Contino Chuck", name); +} + + + + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XML/e13_4_1.as b/mozilla/js/tamarin/test/e4x/XML/e13_4_1.as new file mode 100644 index 00000000000..577353603e6 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XML/e13_4_1.as @@ -0,0 +1,155 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.4.1 - XML Constructor as Function"); + +x1 = XML(); +TEST(1, "xml", typeof(x1)); +TEST(2, true, x1 instanceof XML); + +correct = + + + + DIS + + +; + +x1 = XML(correct); +TEST(3, correct, x1); + +text = +"" + +" " + +" " + +" DIS" + +" " + +" " + +""; + +x1 = XML(text); +TEST(4, correct, x1); + +// Make sure it's not copied if it's XML +x1 = + + two +; + +y1 = XML(x1); + +x1.bravo = "three"; + +correct = + + three +; + +TEST(5, correct, y1); + +// Make text node +x1 = XML("4"); +TEST_XML(6, 4, x1); + +x1 = XML(4); +TEST_XML(7, 4, x1); + +// Undefined and null should behave like "" +x1 = XML(null); +TEST_XML(8, "", x1); + +x1 = XML(undefined); +TEST_XML(9, "", x1); + +XML.prettyPrinting = false; + +var thisXML = "GiantsSan Francisco"; +var NULL_OBJECT = null; +// value is null +AddTestCase( "XML(null).valueOf().toString()", "", XML(null).valueOf().toString() ); +AddTestCase( "typeof XML(null)", "xml", typeof XML(null) ); + +// value is undefined +AddTestCase( "XML(undefined).valueOf().toString()", "", XML(undefined).valueOf().toString() ); +AddTestCase( "typeof XML(undefined)", "xml", typeof XML(undefined) ); + +// value is not supplied +AddTestCase( "XML().valueOf().toString()", "", XML().valueOf().toString() ); +AddTestCase( "typeof XML()", "xml", typeof XML() ); + +// value is supplied +AddTestCase( "XML(thisXML).valueOf().toString()", thisXML, XML(thisXML).valueOf().toString() ); +AddTestCase( "typeof XML(thisXML)", "xml", typeof XML(thisXML) ); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XML/e13_4_2.as b/mozilla/js/tamarin/test/e4x/XML/e13_4_2.as new file mode 100644 index 00000000000..e9cfc63fd2c --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XML/e13_4_2.as @@ -0,0 +1,203 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.4.2 - XML Constructor"); + +x1 = new XML(); +TEST(1, "xml", typeof(x1)); +TEST(2, true, x1 instanceof XML); + +correct = + + + + DIS + + +; + +x1 = new XML(correct); +TEST_XML(3, correct.toXMLString(), x1); + +text = +"" + +" " + +" " + +" DIS" + +" " + +" " + +""; + +x1 = new XML(text); +TEST(4, correct, x1); + +// Make sure it's a copy +x1 = + + one +; + +y1 = new XML(x1); + +x1.bravo.prependChild(two); + +correct = + + one +; + +TEST(5, correct, y1); + +// Make text node +x1 = new XML("4"); +TEST_XML(6, "4", x1); + +x1 = new XML(4); +TEST_XML(7, "4", x1); + +// Undefined and null should behave like "" +x1 = new XML(null); +TEST_XML(8, "", x1); + +x1 = new XML(undefined); +TEST_XML(9, "", x1); + +var thisXML = "GiantsSan Francisco"; + +// value is null +AddTestCase( "typeof new XML(null)", "xml", typeof new XML(null) ); +AddTestCase( "new XML(null) instanceof XML", true, new XML(null) instanceof XML); +AddTestCase( "(new XML(null).nodeKind())", "text", (new XML(null)).nodeKind()); +AddTestCase( "MYOB = new XML(null); MYOB.toString()", "", + (MYOB = new XML(null), MYOB.toString(), MYOB.toString()) ); + +// value is undefined +AddTestCase( "typeof new XML(undefined)", "xml", typeof new XML(undefined) ); +AddTestCase( "new XML(undefined) instanceof XML", true, new XML(undefined) instanceof XML); +AddTestCase( "(new XML(undefined).nodeKind())", "text", (new XML(undefined)).nodeKind()); +AddTestCase( "MYOB = new XML(undefined); MYOB.toString()", "", + (MYOB = new XML(undefined), MYOB.toString(), MYOB.toString()) ); + +// value is not supplied +AddTestCase( "typeof new XML()", "xml", typeof new XML() ); +AddTestCase( "new XML() instanceof XML", true, new XML() instanceof XML); +AddTestCase( "(new XML().nodeKind())", "text", (new XML()).nodeKind()); +AddTestCase( "MYOB = new XML(); MYOB.toString()", "", + (MYOB = new XML(), MYOB.toString(), MYOB.toString()) ); + +//value is a number +AddTestCase( "typeof new XML(5)", "xml", typeof new XML(5) ); +AddTestCase( "new XML(5) instanceof XML", true, new XML(5) instanceof XML); +AddTestCase( "(new XML(5).nodeKind())", "text", (new XML(5)).nodeKind()); +AddTestCase( "MYOB = new XML(5); MYOB.toString()", "5", + (MYOB = new XML(5), MYOB.toString(), MYOB.toString()) ); + +//value is + +// value is supplied +XML.prettyPrinting = false; +AddTestCase( "typeof new XML(thisXML)", "xml", typeof new XML(thisXML) ); +AddTestCase( "new XML(thisXML) instanceof XML", true, new XML(thisXML) instanceof XML); +AddTestCase( "MYOB = new XML(thisXML); MYOB.toString()", "GiantsSan Francisco", + (MYOB = new XML(thisXML), MYOB.toString(), MYOB.toString()) ); + +// Strongly typed XML objects +var MYXML1:XML = new XML(thisXML); +AddTestCase("Strongly typed XML object", new XML(thisXML).toString(), MYXML1.toString()); + +var MYXML2:XML = new XML(GiantsSan Francisco); +AddTestCase("var MYXML:XML = new XML(bd);", new XML(thisXML).toString(), MYXML2.toString()); + +var MYXML3:XML = GiantsSan Francisco; +AddTestCase("var MYXML:XML = bd;", new XML(thisXML).toString(), MYXML3.toString()); + +var MYXML4:XML = new XML(); +AddTestCase("var MYXML:XML = new XML()", new XML(), MYXML4); + +var MYXML5:XML = new XML(5); +AddTestCase("var MYXML:XML = new XML(5)", "5", MYXML5.toString()); + +var a = new XML(" compiled"); + +AddTestCase("XML with PI and comments", "compiled", a.toString()); + +try { + var b = new XML(""); + result = b; +} catch(e1) { + result = typeError(e1.toString()); +} + +AddTestCase("new XML(\"\")", "TypeError: Error #1088", result); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XML/e13_4_3.as b/mozilla/js/tamarin/test/e4x/XML/e13_4_3.as new file mode 100644 index 00000000000..87fdaf9d732 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XML/e13_4_3.as @@ -0,0 +1,241 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.4.3 - XML Properties"); + +// Test defaults +TEST(1, true, XML.ignoreComments); +TEST(2, true, XML.ignoreProcessingInstructions); +TEST(3, true, XML.ignoreWhitespace); +TEST(4, true, XML.prettyPrinting); +TEST(5, 2, XML.prettyIndent); + +// ignoreComments +x1 = one; + +correct = one; + +TEST(6, correct, x1); + +XML.ignoreComments = false; + +x1 = one; + +correct = +"" + NL() + +" " + NL() + +" one" + NL() + +""; + +TEST_XML(7, correct, x1); + + +// ignoreProcessingInstructions +XML.defaultSettings(); +x1 = +<> + + + one + +; + +correct = + + one +; + +TEST(8, correct, x1); + +XML.ignoreProcessingInstructions = false; + +x1 = +<> + + + one + +; + +correct = +"" + NL() + +" " + NL() + +" one" + NL() + +""; + +TEST_XML(9, correct, x1); + +// ignoreWhitespace +XML.defaultSettings(); +x1 = new XML(" \t\r\n\r\n \t\r\n\r\none \t\r\n\r\n"); + +correct = +"" + NL() + +" one" + NL() + +""; + +TEST_XML(10, correct, x1); + +XML.ignoreWhitespace = false; +XML.prettyPrinting = false; + +correct = " \n\n \n\none \n\n"; +x1 = new XML(correct); + +TEST_XML(11, correct, x1); + +// prettyPrinting +XML.prettyPrinting = true; + +x1 =onetwothreefour; + +correct = "" + NL() + + " one" + NL() + + " two" + NL() + + " " + NL() + + " " + NL() + + " three" + NL() + + " four" + NL() + + " " + NL() + + ""; + +TEST(12, correct, x1.toString()); +TEST(13, correct, x1.toXMLString()); + +XML.prettyPrinting = false; + +correct = "onetwothreefour"; +TEST(14, correct, x1.toString()); +TEST(15, correct, x1.toXMLString()); + +// prettyIndent +XML.prettyPrinting = true; +XML.prettyIndent = 3; + +correct = "" + NL() + + " one" + NL() + + " two" + NL() + + " " + NL() + + " " + NL() + + " three" + NL() + + " four" + NL() + + " " + NL() + + ""; + +TEST(16, correct, x1.toString()); +TEST(17, correct, x1.toXMLString()); + +XML.prettyIndent = 0; + +correct = "" + NL() + + "one" + NL() + + "two" + NL() + + "" + NL() + + "" + NL() + + "three" + NL() + + "four" + NL() + + "" + NL() + + ""; + +TEST(18, correct, x1.toString()); +TEST(19, correct, x1.toXMLString()); + +// settings() +XML.defaultSettings(); +o = XML.settings(); +TEST(20, false, o.ignoreComments); +TEST(21, false, o.ignoreProcessingInstructions); +TEST(22, false, o.ignoreWhitespace); +TEST(23, true, o.prettyPrinting); +TEST(24, 0, o.prettyIndent); + +// setSettings() +o = XML.settings(); +o.ignoreComments = false; +o.ignoreProcessingInstructions = false; +o.ignoreWhitespace = false; +o.prettyPrinting = false; +o.prettyIndent = 7; + +XML.setSettings(o); +o = XML.settings(); +TEST(25, false, o.ignoreComments); +TEST(26, false, o.ignoreProcessingInstructions); +TEST(27, false, o.ignoreWhitespace); +TEST(28, false, o.prettyPrinting); +TEST(29, 7, o.prettyIndent); + +// defaultSettings() +XML.defaultSettings(); +o = XML.settings(); +TEST(30, false, o.ignoreComments); +TEST(31, false, o.ignoreProcessingInstructions); +TEST(32, false, o.ignoreWhitespace); +TEST(33, false, o.prettyPrinting); +TEST(34, 7, o.prettyIndent); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XML/e13_4_3_1.as b/mozilla/js/tamarin/test/e4x/XML/e13_4_3_1.as new file mode 100644 index 00000000000..a79de6c8c0c --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XML/e13_4_3_1.as @@ -0,0 +1,76 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.4.3.1 - XML.prototype"); + +AddTestCase( "typeof XML.prototype", "object", typeof XML.prototype); +AddTestCase( "XML.prototype instanceof XML", false, XML.prototype instanceof XML); +AddTestCase( "new XML().prototype instanceof XML", false, new XML().prototype instanceof XML); +AddTestCase( "typeof (new XML().prototype)", "xml", typeof (new XML().prototype)); + + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XML/e13_4_3_2.as b/mozilla/js/tamarin/test/e4x/XML/e13_4_3_2.as new file mode 100644 index 00000000000..967e58d48fc --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XML/e13_4_3_2.as @@ -0,0 +1,105 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.4.3.2 - XML.ignoreComments"); + +var thisXML = "GiantsSan Francisco" + +XML.prettyPrinting = false; + +// a) initial value of ignoreComments is true + +AddTestCase( "XML.ignoreComments", true, XML.ignoreComments); + +// toggling value works ok +AddTestCase( "XML.ignoreComments = false, XML.ignoreComments", false, (XML.ignoreComments = false, XML.ignoreComments)); +AddTestCase( "XML.ignoreComments = true, XML.ignoreComments", true, (XML.ignoreComments = true, XML.ignoreComments)); + +// b) if ignoreComments is true, XML comments are ignored when construction the new XML objects +AddTestCase( "MYXML = new XML(thisXML), MYXML.toString()", "GiantsSan Francisco", + (XML.ignoreComments = true, MYXML = new XML(thisXML), MYXML.toString() )); +AddTestCase( "MYXML = new XML(thisXML), MYXML.toString() with ignoreComemnts=false", "GiantsSan Francisco", + (XML.ignoreComments = false, MYXML = new XML(thisXML), MYXML.toString() )); + +// If ignoreComments is true, XML constructor from another XML node ignores comments +XML.ignoreComments = false; +var MYXML = new XML(thisXML); // this XML node has comments +XML.ignoreComments = true; +var xml2 = new XML(MYXML); // this XML tree should not have comments +AddTestCase( "xml2 = new XML(MYXML), xml2.toString()", "GiantsSan Francisco", + (xml2.toString()) ); +XML.ignoreComments = false; +var xml3 = new XML(MYXML); // this XML tree will have comments +AddTestCase( "xml3 = new XML(MYXML), xml3.toString()", "GiantsSan Francisco", + (xml3.toString()) ); + + +// c) two attributes { DontEnum, DontDelete } +// !!@ + + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XML/e13_4_3_3.as b/mozilla/js/tamarin/test/e4x/XML/e13_4_3_3.as new file mode 100644 index 00000000000..ebd61ea275b --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XML/e13_4_3_3.as @@ -0,0 +1,106 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.4.3.3 - XML.ignoreProcessingInstructions"); + +// We set this to false so we can more easily compare string output +XML.prettyPrinting = false; + +// xml string with processing instructions +var xmlDoc = "GiantsSan Francisco" + +// a) value of ignoreProcessingInstructions +AddTestCase ("XML.ignoreProcessingInstructions", true, (XML.ignoreProcessingInstructions)); +AddTestCase( "XML.ignoreProcessingInstructions = false, XML.ignoreProcessingInstructions", false, (XML.ignoreProcessingInstructions = false, XML.ignoreProcessingInstructions)); +AddTestCase( "XML.ignoreProcessingInstructions = true, XML.ignoreProcessingInstructions", true, (XML.ignoreProcessingInstructions = true, XML.ignoreProcessingInstructions)); + +// b) if ignoreProcessingInstructions is true, XML processing instructions are ignored when construction the new XML objects +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.toString()", "GiantsSan Francisco", + (XML.ignoreProcessingInstructions = true, MYXML = new XML(xmlDoc), MYXML.toString() )); + +// !!@ note that the "" tag magically disappeared. + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.toString() with ignoreProcessingInstructions=false", + "GiantsSan Francisco", + (XML.ignoreProcessingInstructions = false, MYXML = new XML(xmlDoc), MYXML.toString() )); + + +// If ignoreProcessingInstructions is true, XML constructor from another XML node ignores processing instructions +XML.ignoreProcessingInstructions = false; +var MYXML = new XML(xmlDoc); // this XML node has processing instructions +XML.ignoreProcessingInstructions = true; +var xml2 = new XML(MYXML); // this XML tree should not have processing instructions +AddTestCase( "xml2 = new XML(MYXML), xml2.toString()", "GiantsSan Francisco", + (xml2.toString()) ); +XML.ignoreProcessingInstructions = false; +var xml3 = new XML(MYXML); // this XML tree will have processing instructions +AddTestCase( "xml3 = new XML(MYXML), xml3.toString()", + "GiantsSan Francisco", + (xml3.toString()) ); + + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XML/e13_4_3_4.as b/mozilla/js/tamarin/test/e4x/XML/e13_4_3_4.as new file mode 100644 index 00000000000..bbf6dc7cfee --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XML/e13_4_3_4.as @@ -0,0 +1,118 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.4.3.4 - XML.ignoreWhitespace"); + +// We set this to false so we can more easily compare string output +XML.prettyPrinting = false; + +// xml doc with white space +var xmlDoc = " Giants\u000DSan\u0020Francisco\u000ABaseball\u0009" + + +// a) value of ignoreWhitespace +AddTestCase( "XML.ignoreWhitespace = false, XML.ignoreWhitespace", false, (XML.ignoreWhitespace = false, XML.ignoreWhitespace)); +AddTestCase( "XML.ignoreWhitespace = true, XML.ignoreWhitespace", true, (XML.ignoreWhitespace = true, XML.ignoreWhitespace)); + + +// b) whitespace is ignored when true, not ignored when false +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.toString()", "GiantsSan FranciscoBaseball", + (XML.ignoreWhitespace = true, MYXML = new XML(xmlDoc), MYXML.toString() )); + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.toString() with ignoreWhitespace=false", + " Giants\u000DSan\u0020Francisco\u000ABaseball\u0009", + (XML.ignoreWhitespace = false, MYXML = new XML(xmlDoc), MYXML.toString() )); + +// c) whitespace characters +// tab +xmlDoc = "\ttab"; +AddTestCase( "XML with tab and XML.ignoreWhiteSpace = true", "tab", + (XML.ignoreWhitespace = true, MYXML = new XML(xmlDoc), MYXML.toString() )); + +AddTestCase( "XML with tab and XML.ignoreWhiteSpace = false", "\ttab", + (XML.ignoreWhitespace = false, MYXML = new XML(xmlDoc), MYXML.toString() )); + +// new line +xmlDoc = "\n\n\ntab\n"; +AddTestCase( "XML with new line and XML.ignoreWhiteSpace = true", "tab", + (XML.ignoreWhitespace = true, MYXML = new XML(xmlDoc), MYXML.toString() )); + +xmlDoc = "\r\ntab\r\n"; +AddTestCase( "XML with new line and XML.ignoreWhiteSpace = false", "\r\ntab\r\n", + (XML.ignoreWhitespace = false, MYXML = new XML(xmlDoc), MYXML.toString() )); + +// d) attributes + +xmlDoc = "tab"; +AddTestCase( "new XML(\"tab\")", "tab", + (XML.ignoreWhitespace = true, MYXML = new XML(xmlDoc), MYXML.toString() )); + +AddTestCase( "new XML(\"tab\")", "tab", + (XML.ignoreWhitespace = false, MYXML = new XML(xmlDoc), MYXML.toString() )); + + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XML/e13_4_3_5.as b/mozilla/js/tamarin/test/e4x/XML/e13_4_3_5.as new file mode 100644 index 00000000000..105435e25be --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XML/e13_4_3_5.as @@ -0,0 +1,95 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.4.3.5 - XML.prettyPrinting"); + +// xml doc +var xmlDoc = "GiantsSan FranciscoBaseball" + + +// a) value of prettyPrinting +AddTestCase( "XML.prettyPrinting = false, XML.prettyPrinting", false, (XML.prettyPrinting = false, XML.prettyPrinting)); +AddTestCase( "XML.prettyPrinting = true, XML.prettyPrinting", true, (XML.prettyPrinting = true, XML.prettyPrinting)); + +// b) pretty printing + +AddTestCase( "MYOB = new XML(xmlDoc); XML.prettyPrinting = false; MYOB.toString()", + "GiantsSan FranciscoBaseball", + (MYOB = new XML(xmlDoc), XML.prettyPrinting = false, MYOB.toString())); + +// !!@ very simple example of printing output + +AddTestCase( "MYOB = new XML(xmlDoc); XML.prettyPrinting = true; MYOB.toString()", + "" + NL() + " Giants" + NL() + " San Francisco" + NL() + " Baseball" + NL() + "", + (MYOB = new XML(xmlDoc), XML.prettyPrinting = true, MYOB.toString())); + + +// c) attributes + +// TODO + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XML/e13_4_3_6.as b/mozilla/js/tamarin/test/e4x/XML/e13_4_3_6.as new file mode 100644 index 00000000000..b927bd207f0 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XML/e13_4_3_6.as @@ -0,0 +1,119 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.4.3.6 - XML.prettyIndent"); + +// xml doc +XML.prettyPrinting = true; +var xmlDoc = "GiantsSan FranciscoBaseball" + + +// a) value of prettyIndent +AddTestCase( "XML.prettyIndent = 4, XML.prettyIndent", 4, (XML.prettyIndent = 4, XML.prettyIndent)); +AddTestCase( "XML.prettyIndent = 2, XML.prettyIndent", 2, (XML.prettyIndent = 2, XML.prettyIndent)); +AddTestCase( "XML.prettyIndent = -1, XML.prettyIndent", -1, (XML.prettyIndent = -1, XML.prettyIndent)); + +// b) pretty printing + +AddTestCase( "MYOB = new XML(xmlDoc); XML.prettyIndent = 2; MYOB.toString()", + "" + NL() + " Giants" + NL() + " San Francisco" + NL() + " Baseball" + NL() + "", + (MYOB = new XML(xmlDoc), XML.prettyIndent = 2, MYOB.toString())); + +AddTestCase( "MYOB = new XML(xmlDoc); XML.prettyIdent = 4; MYOB.toString()", + "" + NL() + " Giants" + NL() + " San Francisco" + NL() + " Baseball" + NL() + "", + (MYOB = new XML(xmlDoc), XML.prettyIndent = 4, MYOB.toString())); + +AddTestCase( "MYOB = new XML(xmlDoc); XML.prettyIndent = 1; MYOB.toString()", + "" + NL() + " Giants" + NL() + " San Francisco" + NL() + " Baseball" + NL() + "", + (MYOB = new XML(xmlDoc), XML.prettyIndent = 1, MYOB.toString())); + +// !!@ bad value causes pretty printing to be disabled +AddTestCase( "MYOB = new XML(xmlDoc); XML.prettyIndent = -5; MYOB.toString()", + "GiantsSan FranciscoBaseball", + //"" + NL() + " Giants" + NL() + " San Francisco" + NL() + " Baseball" + NL() + "", + (MYOB = new XML(xmlDoc), XML.prettyIndent = -5, MYOB.toString())); + + + +// !!@ very simple example of printing output +XML.prettyPrinting = true; +XML.prettyIndent = 10; +AddTestCase( "MYOB = new XML(xmlDoc); XML.prettyPrinting = true; MYOB.toString()", + "" + NL() + " Giants" + NL() + " San Francisco" + NL() + " Baseball" + NL() + "", + (MYOB = new XML(xmlDoc), XML.prettyPrinting = true, MYOB.toString())); + + +// d) attributes + +XML.prettyIndent = 5; +xmlDoc = "GiantsSan FranciscoBaseball" +AddTestCase( "MYOB = new XML(xmlDoc); XML.prettyPrinting = true; MYOB.toString()", + "" + NL() + " Giants" + NL() + " San Francisco" + NL() + " Baseball" + NL() + "", + (MYOB = new XML(xmlDoc), XML.prettyPrinting = true, MYOB.toString())); + + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XML/e13_4_3_7.as b/mozilla/js/tamarin/test/e4x/XML/e13_4_3_7.as new file mode 100644 index 00000000000..ef35a53786e --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XML/e13_4_3_7.as @@ -0,0 +1,115 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.4.3.7 - XML.settings"); + +// xmlDoc + +var settings = XML.settings(); + +AddTestCase( "XML.settings().ignoreComments; ", true, (XML.settings().ignoreComments) ); +AddTestCase( "XML.settings().ignoreProcessingInstructions; ", true, (XML.settings().ignoreProcessingInstructions) ); +AddTestCase( "XML.settings().ignoreWhitespace; ", true, (XML.settings().ignoreWhitespace) ); +AddTestCase( "XML.settings().prettyPrinting; ", true, (XML.settings().prettyPrinting) ); +AddTestCase( "XML.settings().prettyIndent; ", 2, (XML.settings().prettyIndent) ); + +XML.ignoreComments = false; +AddTestCase( "XML.settings().ignoreComments; ", false, (XML.settings().ignoreComments) ); +AddTestCase( "XML.settings().ignoreProcessingInstructions; ", true, (XML.settings().ignoreProcessingInstructions) ); +AddTestCase( "XML.settings().ignoreWhitespace; ", true, (XML.settings().ignoreWhitespace) ); +AddTestCase( "XML.settings().prettyPrinting; ", true, (XML.settings().prettyPrinting) ); +AddTestCase( "XML.settings().prettyIndent; ", 2, (XML.settings().prettyIndent) ); + +XML.ignoreProcessingInstructions = false; +AddTestCase( "XML.settings().ignoreComments; ", false, (XML.settings().ignoreComments) ); +AddTestCase( "XML.settings().ignoreProcessingInstructions; ", false, (XML.settings().ignoreProcessingInstructions) ); +AddTestCase( "XML.settings().ignoreWhitespace; ", true, (XML.settings().ignoreWhitespace) ); +AddTestCase( "XML.settings().prettyPrinting; ", true, (XML.settings().prettyPrinting) ); +AddTestCase( "XML.settings().prettyIndent; ", 2, (XML.settings().prettyIndent) ); + +XML.ignoreWhitespace = false; +AddTestCase( "XML.settings().ignoreComments; ", false, (XML.settings().ignoreComments) ); +AddTestCase( "XML.settings().ignoreProcessingInstructions; ", false, (XML.settings().ignoreProcessingInstructions) ); +AddTestCase( "XML.settings().ignoreWhitespace; ", false, (XML.settings().ignoreWhitespace) ); +AddTestCase( "XML.settings().prettyPrinting; ", true, (XML.settings().prettyPrinting) ); +AddTestCase( "XML.settings().prettyIndent; ", 2, (XML.settings().prettyIndent) ); + +XML.prettyPrinting = false; +AddTestCase( "XML.settings().ignoreComments; ", false, (XML.settings().ignoreComments) ); +AddTestCase( "XML.settings().ignoreProcessingInstructions; ", false, (XML.settings().ignoreProcessingInstructions) ); +AddTestCase( "XML.settings().ignoreWhitespace; ", false, (XML.settings().ignoreWhitespace) ); +AddTestCase( "XML.settings().prettyPrinting; ", false, (XML.settings().prettyPrinting) ); +AddTestCase( "XML.settings().prettyIndent; ", 2, (XML.settings().prettyIndent) ); + +XML.prettyIndent = 4; +AddTestCase( "XML.settings().ignoreComments; ", false, (XML.settings().ignoreComments) ); +AddTestCase( "XML.settings().ignoreProcessingInstructions; ", false, (XML.settings().ignoreProcessingInstructions) ); +AddTestCase( "XML.settings().ignoreWhitespace; ", false, (XML.settings().ignoreWhitespace) ); +AddTestCase( "XML.settings().prettyPrinting; ", false, (XML.settings().prettyPrinting) ); +AddTestCase( "XML.settings().prettyIndent; ", 4, (XML.settings().prettyIndent) ); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XML/e13_4_3_8.as b/mozilla/js/tamarin/test/e4x/XML/e13_4_3_8.as new file mode 100644 index 00000000000..4dea02c7d98 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XML/e13_4_3_8.as @@ -0,0 +1,149 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.4.3.8 - XML.setSettings(settings)"); + +// a) called with a settings object +var settings = XML.settings(); + +settings.ignoreComments = false; +settings.ignoreProcessingInstructions = false; +settings.ignoreWhitespace = false; +settings.prettyPrinting = false; +settings.prettyIndent = 4; + +AddTestCase( "XML.settings().ignoreComments; ", true, (XML.settings().ignoreComments) ); +AddTestCase( "XML.settings().ignoreProcessingInstructions; ", true, (XML.settings().ignoreProcessingInstructions) ); +AddTestCase( "XML.settings().ignoreWhitespace; ", true, (XML.settings().ignoreWhitespace) ); +AddTestCase( "XML.settings().prettyPrinting; ", true, (XML.settings().prettyPrinting) ); +AddTestCase( "XML.settings().prettyIndent; ", 2, (XML.settings().prettyIndent) ); + +XML.setSettings (settings); + +AddTestCase( "XML.settings().ignoreComments; ", false, (XML.settings().ignoreComments) ); +AddTestCase( "XML.settings().ignoreProcessingInstructions; ", false, (XML.settings().ignoreProcessingInstructions) ); +AddTestCase( "XML.settings().ignoreWhitespace; ", false, (XML.settings().ignoreWhitespace) ); +AddTestCase( "XML.settings().prettyPrinting; ", false, (XML.settings().prettyPrinting) ); +AddTestCase( "XML.settings().prettyIndent; ", 4, (XML.settings().prettyIndent) ); + +// setting null restores defaults +XML.setSettings (null); + +AddTestCase( "XML.settings(null); XML.settings().ignoreComments; ", true, (XML.settings().ignoreComments) ); +AddTestCase( "XML.settings(null); XML.settings().ignoreProcessingInstructions; ", true, (XML.settings().ignoreProcessingInstructions) ); +AddTestCase( "XML.settings(null); XML.settings().ignoreWhitespace; ", true, (XML.settings().ignoreWhitespace) ); +AddTestCase( "XML.settings(null); XML.settings().prettyPrinting; ", true, (XML.settings().prettyPrinting) ); +AddTestCase( "XML.settings(null); XML.settings().prettyIndent; ", 2, (XML.settings().prettyIndent) ); + +XML.setSettings (settings); +// does setting a bogus value restore defaults? No. +XML.setSettings ([1, 2, 3, 4]); + +AddTestCase( "XML.settings().ignoreComments; ", false, (XML.settings().ignoreComments) ); +AddTestCase( "XML.settings().ignoreProcessingInstructions; ", false, (XML.settings().ignoreProcessingInstructions) ); +AddTestCase( "XML.settings().ignoreWhitespace; ", false, (XML.settings().ignoreWhitespace) ); +AddTestCase( "XML.settings().prettyPrinting; ", false, (XML.settings().prettyPrinting) ); +AddTestCase( "XML.settings().prettyIndent; ", 4, (XML.settings().prettyIndent) ); + +// does setting a bogus value restore defaults? No. +XML.setSettings (5); + +AddTestCase( "XML.settings().ignoreComments; ", false, (XML.settings().ignoreComments) ); +AddTestCase( "XML.settings().ignoreProcessingInstructions; ", false, (XML.settings().ignoreProcessingInstructions) ); +AddTestCase( "XML.settings().ignoreWhitespace; ", false, (XML.settings().ignoreWhitespace) ); +AddTestCase( "XML.settings().prettyPrinting; ", false, (XML.settings().prettyPrinting) ); +AddTestCase( "XML.settings().prettyIndent; ", 4, (XML.settings().prettyIndent) ); + +// does setting a bogus value restore defaults? No. +XML.setSettings (""); + +AddTestCase( "XML.setSettings (\"\"); XML.settings().ignoreComments; ", false, (XML.settings().ignoreComments) ); +AddTestCase( "XML.setSettings (\"\"); XML.settings().ignoreProcessingInstructions; ", false, (XML.settings().ignoreProcessingInstructions) ); +AddTestCase( "XML.setSettings (\"\"); XML.settings().ignoreWhitespace; ", false, (XML.settings().ignoreWhitespace) ); +AddTestCase( "XML.setSettings (\"\"); XML.settings().prettyPrinting; ", false, (XML.settings().prettyPrinting) ); +AddTestCase( "XML.setSettings (\"\"); XML.settings().prettyIndent; ", 4, (XML.settings().prettyIndent) ); + +// this restores defaults +XML.setSettings (undefined); + +AddTestCase( "XML.setSettings (undefined); XML.settings().ignoreComments; ", true, (XML.settings().ignoreComments) ); +AddTestCase( "XML.setSettings (undefined); XML.settings().ignoreProcessingInstructions; ", true, (XML.settings().ignoreProcessingInstructions) ); +AddTestCase( "XML.setSettings (undefined); XML.settings().ignoreWhitespace; ", true, (XML.settings().ignoreWhitespace) ); +AddTestCase( "XML.setSettings (undefined); XML.settings().prettyPrinting; ", true, (XML.settings().prettyPrinting) ); +AddTestCase( "XML.setSettings (undefined); XML.settings().prettyIndent; ", 2, (XML.settings().prettyIndent) ); + +// this restore defaults +XML.setSettings (settings); +XML.setSettings (); + +AddTestCase( "XML.setSettings (); XML.settings().ignoreComments; ", true, (XML.settings().ignoreComments) ); +AddTestCase( "XML.setSettings (); XML.settings().ignoreProcessingInstructions; ", true, (XML.settings().ignoreProcessingInstructions) ); +AddTestCase( "XML.setSettings (); XML.settings().ignoreWhitespace; ", true, (XML.settings().ignoreWhitespace) ); +AddTestCase( "XML.setSettings (); XML.settings().prettyPrinting; ", true, (XML.settings().prettyPrinting) ); +AddTestCase( "XML.setSettings (); XML.settings().prettyIndent; ", 2, (XML.settings().prettyIndent) ); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XML/e13_4_3_9.as b/mozilla/js/tamarin/test/e4x/XML/e13_4_3_9.as new file mode 100644 index 00000000000..8851b3e7d07 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XML/e13_4_3_9.as @@ -0,0 +1,99 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.4.3.9 - XML.defaultSettings()"); + +AddTestCase( "settings = XML.defaultSettings(), settings.ignoreComments", true, + (settings = XML.defaultSettings(), settings.ignoreComments) ); +AddTestCase( "settings = XML.defaultSettings(), settings.ignoreProcessingInstructions", true, + (settings = XML.defaultSettings(), settings.ignoreProcessingInstructions) ); +AddTestCase( "settings = XML.defaultSettings(), settings.ignoreWhitespace", true, + (settings = XML.defaultSettings(), settings.ignoreWhitespace) ); +AddTestCase( "settings = XML.defaultSettings(), settings.prettyPrinting", true, + (settings = XML.defaultSettings(), settings.prettyPrinting) ); +AddTestCase( "settings = XML.defaultSettings(), settings.prettyIndent", 2, + (settings = XML.defaultSettings(), settings.prettyIndent) ); + +var tempSettings = XML.settings(); +tempSettings.ignoreComments = false; +tempSettings.ignoreProcessingInstructions = false; +tempSettings.ignoreWhitespace = false; +tempSettings.prettyPrinting = false; +tempSettings.prettyIndent = 4; + +AddTestCase( "XML.setSettings(tempSettings), XML.setSettings(XML.defaultSettings()), XML.ignoreComments", true, + (XML.setSettings(tempSettings), XML.setSettings(XML.defaultSettings()), XML.ignoreComments) ); +AddTestCase( "XML.setSettings(tempSettings), XML.setSettings(XML.defaultSettings()), XML.ignoreProcessingInstructions", true, + (XML.setSettings(tempSettings), XML.setSettings(XML.defaultSettings()), XML.ignoreProcessingInstructions) ); +AddTestCase( "XML.setSettings(tempSettings), XML.setSettings(XML.defaultSettings()), XML.ignoreWhitespace", true, + (XML.setSettings(tempSettings), XML.setSettings(XML.defaultSettings()), XML.ignoreWhitespace) ); +AddTestCase( "XML.setSettings(tempSettings), XML.setSettings(XML.defaultSettings()), XML.prettyPrinting", true, + (XML.setSettings(tempSettings), XML.setSettings(XML.defaultSettings()), XML.prettyPrinting) ); +AddTestCase( "XML.setSettings(tempSettings), XML.setSettings(XML.defaultSettings()), XML.prettyIndent", 2, + (XML.setSettings(tempSettings), XML.setSettings(XML.defaultSettings()), XML.prettyIndent) ); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XML/e13_4_4_1.as b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_1.as new file mode 100644 index 00000000000..e2101493e52 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_1.as @@ -0,0 +1,73 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.4.4.1 - XML Constructor"); + +AddTestCase( "XML.prototype.constructor == XML", true, XML.prototype.constructor == XML); +AddTestCase( "XML.prototype.constructor === XML", true, XML.prototype.constructor === XML); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XML/e13_4_4_10.as b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_10.as new file mode 100644 index 00000000000..3cdc4e0789d --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_10.as @@ -0,0 +1,113 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.4.4.10 - XML contains()"); + +//TEST(1, true, XML.prototype.hasOwnProperty("contains")); + +emps = + + Jim25 + Joe20 +; + +TEST(2, true, emps.contains(emps)); + +var xmlDoc = "GiantsSan FranciscoPadresSan Diego"; + +// same object, returns true +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.contains(MYMXL)", true, + (MYXML = new XML(xmlDoc), MYXML.contains(MYXML)) ); + +// duplicated object, returns true +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.contains(MYMXL.copy())", true, + (MYXML = new XML(xmlDoc), MYXML.contains(MYXML.copy())) ); + +// identical objects, returns true +AddTestCase( "MYXML = new XML(xmlDoc), MYXML2 = new XML(xmlDoc), MYXML.contains(MYMXL2)", true, + (MYXML = new XML(xmlDoc), MYXML2 = new XML(xmlDoc), MYXML.contains(MYXML2)) ); + +// identical objects, returns true +AddTestCase( "MYXML = new XML(xmlDoc), MYXML2 = new XML(xmlDoc), MYXML2.contains(MYMXL)", true, + (MYXML = new XML(xmlDoc), MYXML2 = new XML(xmlDoc), MYXML2.contains(MYXML)) ); + +// slightly different objects, returns false +AddTestCase( "MYXML = new XML(xmlDoc), MYXML2 = new XML(xmlDoc), MYXML2.foo = 'bar', MYXML.contains(MYMXL2)", false, + (MYXML = new XML(xmlDoc), MYXML2 = new XML(xmlDoc), MYXML2.foo = 'bar', MYXML.contains(MYXML2)) ); + +// slightly different objects #2, returns false +AddTestCase( "MYXML = new XML(xmlDoc), MYXML2 = new XML(xmlDoc), MYXML2.Team[0].foo = 'bar', MYXML.contains(MYMXL2)", false, + (MYXML = new XML(xmlDoc), MYXML2 = new XML(xmlDoc), MYXML2.Team[0].foo = 'bar', MYXML.contains(MYXML2)) ); + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.Team[0].contains('Giants')", false, + (MYXML = new XML(xmlDoc), MYXML.Team[0].contains('Giants')) ); +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.Team[1].contains('Giants')", false, + (MYXML = new XML(xmlDoc), MYXML.Team[1].contains('Giants')) ); +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.City.contains('Giants')", false, + (MYXML = new XML(xmlDoc), MYXML.City.contains('Giants')) ); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XML/e13_4_4_11.as b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_11.as new file mode 100644 index 00000000000..38b2d1a3685 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_11.as @@ -0,0 +1,135 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.4.4.11 - XML copy()"); + +//TEST(1, true, XML.prototype.hasOwnProperty("copy")); + +emps = + + Jim25 + Joe20 +; + +correct = +Jim25; + +x1 = emps.employee[0].copy(); + +TEST(2, undefined, x1.parent()); +TEST(3, correct, x1); + +// Make sure we're getting a copy, not a ref to orig. +emps = + + Jim25 + Joe20 +; + +correct = +Jim25 + +empCopy = emps.employee[0].copy(); + +emps.employee[0].fname[0] = "Sally"; + +TEST(4, correct, empCopy); + +// Try copying whole XML twice +emps = + + Jim25 + Joe20 +; + +empCopy = emps.copy(); +x1 = empCopy.copy(); + +TEST(5, x1, emps); + +XML.prettyPrinting = false; +var xmlDoc = "GiantsSan FranciscoPadresSan Diego"; + +AddTestCase( "MYXML = new XML(xmlDoc), XMLCOPY = MYXML.copy()", xmlDoc, + (MYXML = new XML(xmlDoc), XMLCOPY = MYXML.copy(), XMLCOPY.toString()) ); +AddTestCase( "MYXML = new XML(null), XMLCOPY = MYXML.copy()", "", + (MYXML = new XML(null), XMLCOPY = MYXML.copy(), XMLCOPY.toString()) ); +AddTestCase( "MYXML = new XML(undefined), XMLCOPY = MYXML.copy()", MYXML.toString(), + (MYXML = new XML(undefined), XMLCOPY = MYXML.copy(), XMLCOPY.toString()) ); +AddTestCase( "MYXML = new XML(), XMLCOPY = MYXML.copy()", MYXML.toString(), + (MYXML = new XML(), XMLCOPY = MYXML.copy(), XMLCOPY.toString()) ); +AddTestCase( "MYXML = new XML(xmlDoc), XMLCOPY = MYXML.Team.copy()", "Giants" + NL() + "Padres", + (MYXML = new XML(xmlDoc), XMLCOPY = MYXML.Team.copy(), XMLCOPY.toString()) ); + +// Make sure it's a copy +var MYXML = new XML(xmlDoc); +var MYXML2 = MYXML.copy(); +AddTestCase ("MYXML == MYXML.copy()", true, (MYXML == MYXML.copy())); +MYXML2.foo = "bar"; +AddTestCase ("MYXML == MYXML2 where MYXML2 is a copy that has been changed", false, (MYXML == MYXML2)); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XML/e13_4_4_12.as b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_12.as new file mode 100644 index 00000000000..582c3781505 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_12.as @@ -0,0 +1,135 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.4.4.12 - XML descendants"); + +//TEST(1, true, XML.prototype.hasOwnProperty("descendants")); + +x1 = + + one + + two + three + +; + +TEST(2, three, x1.charlie.descendants("bravo")); +TEST(3, new XMLList("onethree"), x1.descendants("bravo")); + +// Test * +correct = new XMLList("oneonetwothreetwothreethree"); + +XML.prettyPrinting = false; +TEST(4, correct, x1.descendants("*")); +TEST(5, correct, x1.descendants()); +XML.prettyPrinting = true; + +XML.prettyPrinting = false; + +var xmlDoc = "barGiantsbarbarSan FranciscoPadresSan Diego"; + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.descendants('Team')", "Giantsbar" + NL() + "Padres", + (MYXML = new XML(xmlDoc), MYXML.descendants('Team').toString()) ); +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.descendants('Team').length()", 2, + (MYXML = new XML(xmlDoc), MYXML.descendants('Team').length()) ); +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.descendants('Team') instanceof XMLList", true, + (MYXML = new XML(xmlDoc), MYXML.descendants('Team') instanceof XMLList) ); + +// find multiple levels of descendants +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.descendants('foo')", "bar" + NL() + "bar" + NL() + "bar", + (MYXML = new XML(xmlDoc), MYXML.descendants('foo').toString()) ); +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.descendants('foo').length()", 3, + (MYXML = new XML(xmlDoc), MYXML.descendants('foo').length()) ); +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.descendants('foo') instanceof XMLList", true, + (MYXML = new XML(xmlDoc), MYXML.descendants('foo') instanceof XMLList) ); + +// no matching descendants +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.descendants('nomatch')", "", + (MYXML = new XML(xmlDoc), MYXML.descendants('nomatch').toString()) ); +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.descendants('nomatch').length()", 0, + (MYXML = new XML(xmlDoc), MYXML.descendants('nomatch').length()) ); +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.descendants('nomatch') instanceof XMLList", true, + (MYXML = new XML(xmlDoc), MYXML.descendants('nomatch') instanceof XMLList) ); + +// descendant with hyphen + +e = + + Joe20 + Sue30 + + +correct = +Joe + +Sue; + +names = e.descendants("first-name"); + +AddTestCase("Descendant with hyphen", correct, names); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XML/e13_4_4_13.as b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_13.as new file mode 100644 index 00000000000..9105adeaf83 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_13.as @@ -0,0 +1,100 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.4.4.13 - XML elements()"); + +//TEST(1, true, XML.prototype.hasOwnProperty("elements")); + +var xmlDoc = "GiantsSan FranciscoPadresSan Diego"; + +// !!@ need to verify results of these test cases +// !!@ elements appears to be broken in Rhino + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.elements('Team').toString()", "Giants" + NL() + "Padres", + (MYXML = new XML(xmlDoc), MYXML.elements('Team').toString()) ); + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.elements('TEAM').toString()", "", + (MYXML = new XML(xmlDoc), MYXML.elements('TEAM').toString()) ); + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.elements('bogus').toString()", "", + (MYXML = new XML(xmlDoc), MYXML.elements('bogus').toString()) ); + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.elements()", "Giants" + NL() + "San Francisco" + NL() + "Padres" + NL() + "San Diego", + (MYXML = new XML(xmlDoc), MYXML.elements().toString()) ); + +xmlDoc = "GiantsSan Francisco"; + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.elements('City').toString()", "San Francisco", + (MYXML = new XML(xmlDoc), MYXML.elements('City').toString()) ); + +xmlDoc = "GiantsSan FranciscoPadresSan Diego"; + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.elements('MLB')", "" + NL() + " Giants" + NL() + " San Francisco" + NL() + " Padres" + NL() + " San Diego" + NL() + "", + (MYXML = new XML(xmlDoc), MYXML.elements('MLB').toString()) ); + + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XML/e13_4_4_14.as b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_14.as new file mode 100644 index 00000000000..efab47d3da6 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_14.as @@ -0,0 +1,110 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.4.4.14 - XML hasOwnProperty()"); + +//TEST(1, true, XML.prototype.hasOwnProperty("hasOwnProperty")); + +x1 = + + one + + two + three + four + + +; + +// Returns true for elements/attributes +TEST(2, true, x1.hasOwnProperty("bravo")); +TEST(3, true, x1.hasOwnProperty("@attr1")); +TEST(4, false, x1.hasOwnProperty("foobar")); + +// Test for XML Prototype Object - returns true for XML methods. +TEST(5, true, XML.prototype.hasOwnProperty("toString")); +TEST(6, false, XML.prototype.hasOwnProperty("foobar")); + +var xmlDoc = "JohnWalton25" + +// !!@ we're not supporting prototype properties +// propertyName as a string +AddTestCase( "XML.prototype.hasOwnProperty('copy')", true, + (XML.prototype.hasOwnProperty('copy'))); +AddTestCase( "XML.prototype.hasOwnProperty('hasSimpleContent')", true, + (XML.prototype.hasOwnProperty('hasSimpleContent'))); + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.hasOwnProperty('copy')", false, + (MYXML = new XML(xmlDoc), MYXML.hasOwnProperty('copy'))); +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.hasOwnProperty('hasSimpleContent')", false, + (MYXML = new XML(xmlDoc), MYXML.hasOwnProperty('hasSimpleContent'))); +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.hasOwnProperty('firstname')", true, + (MYXML = new XML(xmlDoc), MYXML.hasOwnProperty('firstname'))); +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.hasOwnProperty('lastname')", true, + (MYXML = new XML(xmlDoc), MYXML.hasOwnProperty('lastname'))); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XML/e13_4_4_15.as b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_15.as new file mode 100644 index 00000000000..8287ccfb8f4 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_15.as @@ -0,0 +1,126 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.4.4.15 - hasComplexContent()"); + +//TEST(1, true, XML.prototype.hasOwnProperty("hasComplexContent")); + +x1 = + + one + + two + three + four + + + five + + + six + seven + + +; + +TEST(2, true, x1.hasComplexContent()); +TEST(3, false, x1.bravo.hasComplexContent()); +TEST(4, true, x1.charlie.hasComplexContent()); +TEST(5, false, x1.delta.hasComplexContent()); +TEST(6, false, x1.foxtrot.hasComplexContent()); +TEST(7, false, x1.golf.hasComplexContent()); +TEST(8, false, x1.hotel.hasComplexContent()); +TEST(9, false, x1.@attr1.hasComplexContent()); +TEST(10, false, x1.bravo.child(0).hasComplexContent()); +TEST(11, true, x1.india.hasComplexContent()); + +var xmlDoc = "JohnWalton25" + +// propertyName as a string +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.hasComplexContent()", true, + (MYXML = new XML(xmlDoc), MYXML.hasComplexContent())); + +xmlDoc = "John" +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.hasComplexContent()", false, + (MYXML = new XML(xmlDoc), MYXML.hasComplexContent())); + +XML.ignoreComments = false; +xmlDoc = "" +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.hasComplexContent()", false, + (MYXML = new XML(xmlDoc), MYXML.hasComplexContent())); + +XML.ignoreProcessingInstructions = false; +xmlDoc = "" +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.hasComplexContent()", false, + (MYXML = new XML(xmlDoc), MYXML.hasComplexContent())); + +XML.ignoreComments = false; +xmlDoc = "foo" +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.hasComplexContent()", false, + (MYXML = new XML(xmlDoc), MYXML.hasComplexContent())); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XML/e13_4_4_16.as b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_16.as new file mode 100644 index 00000000000..05de33f064d --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_16.as @@ -0,0 +1,143 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.4.4.16 - XML hasSimpleContent()"); + +//TEST(1, true, XML.prototype.hasOwnProperty("hasSimpleContent")); + +x1 = + + one + + two + three + four + + + five + + + six + seven + + +; + +TEST(2, false, x1.hasSimpleContent()); +TEST(3, true, x1.bravo.hasSimpleContent()); +TEST(4, false, x1.charlie.hasSimpleContent()); +TEST(5, true, x1.delta.hasSimpleContent()); +TEST(6, true, x1.foxtrot.hasSimpleContent()); +TEST(7, true, x1.golf.hasSimpleContent()); +TEST(8, true, x1.hotel.hasSimpleContent()); +TEST(9, true, x1.@attr1.hasSimpleContent()); +TEST(10, true, x1.bravo.child(0).hasSimpleContent()); +TEST(11, false, x1.india.hasSimpleContent()); + +var xmlDoc = "JohnWalton25" + +// propertyName as a string +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.hasSimpleContent()", false, + (MYXML = new XML(xmlDoc), MYXML.hasSimpleContent())); + +xmlDoc = "John" +AddTestCase ("MYXML = new XML(xmlDoc), MYXML.children().length()", 1, + (MYXML = new XML(xmlDoc), MYXML.children().length())); +AddTestCase ("MYXML = new XML(xmlDoc), MYXML.children()[0].nodeKind()", "text", + (MYXML = new XML(xmlDoc), MYXML.children()[0].nodeKind())); +AddTestCase ("MYXML = new XML(xmlDoc), MYXML.children()[0].nodeKind()", "text", + (MYXML = new XML(xmlDoc), MYXML.children()[0].nodeKind())); +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.children()[0].hasSimpleContent()", true, + (MYXML = new XML(xmlDoc), MYXML.children()[0].hasSimpleContent())); + +XML.ignoreComments = false; +xmlDoc = "" +AddTestCase ("MYXML = new XML(xmlDoc), MYXML.children().length()", 1, + (MYXML = new XML(xmlDoc), MYXML.children().length())); +AddTestCase ("MYXML = new XML(xmlDoc), MYXML.children()[0].nodeKind()", "comment", + (MYXML = new XML(xmlDoc), MYXML.children()[0].nodeKind())); +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.children()[0].hasSimpleContent()", false, + (MYXML = new XML(xmlDoc), MYXML.children()[0].hasSimpleContent())); + +XML.ignoreProcessingInstructions = false; +xmlDoc = "" +AddTestCase ("MYXML = new XML(xmlDoc), MYXML.children().length()", 1, + (MYXML = new XML(xmlDoc), MYXML.children().length())); +AddTestCase ("MYXML = new XML(xmlDoc), MYXML.children()[0].nodeKind()", "processing-instruction", + (MYXML = new XML(xmlDoc), MYXML.children()[0].nodeKind())); +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.children()[0].hasSimpleContent()", false, + (MYXML = new XML(xmlDoc), MYXML.children()[0].hasSimpleContent())); + +xmlDoc = "foo" +AddTestCase ("MYXML = new XML(xmlDoc), MYXML.children().length()", 1, + (MYXML = new XML(xmlDoc), MYXML.children().length())); +AddTestCase ("MYXML = new XML(xmlDoc), MYXML.children()[0].nodeKind()", "text", + (MYXML = new XML(xmlDoc), MYXML.children()[0].nodeKind())); +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.children()[0].hasSimpleContent()", true, + (MYXML = new XML(xmlDoc), MYXML.children()[0].hasSimpleContent())); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XML/e13_4_4_17.as b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_17.as new file mode 100644 index 00000000000..572980bd0fc --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_17.as @@ -0,0 +1,144 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.4.4.17 - XML inScopeNamespaces()"); + +//TEST(1, true, XML.prototype.hasOwnProperty("inScopeNamespaces")); + +x1 = + + one +; + +namespaces = x1.bravo.inScopeNamespaces(); + + +TEST(2, "foo", namespaces[0].prefix); +TEST(3, "http://foo/", namespaces[0].uri); +TEST(4, "bar", namespaces[1].prefix); +TEST(5, "http://bar/", namespaces[1].uri); +//TEST(6, "", namespaces[2].prefix); +//TEST(7, "", namespaces[2].uri); +TEST(8, 2, namespaces.length); + +var n1 = new Namespace('pfx', 'http://w3.org'); +var n2 = new Namespace('http://us.gov'); +var n3 = new Namespace('boo', 'http://us.gov'); +var n4 = new Namespace('boo', 'http://hk.com'); +var xml = "55bird5dinosaur"; + + +AddTestCase( "Two namespaces in toplevel scope:", ('http://hk.com'), + ( x1 = new XML(xml), x1.addNamespace(n1), x1.addNamespace(n4), x1.inScopeNamespaces()[1].toString())); + +AddTestCase( "Two namespaces in toplevel scope:", ('http://w3.org'), + ( x1 = new XML(xml), x1.addNamespace(n1), x1.addNamespace(n4), x1.inScopeNamespaces()[0].toString())); + +AddTestCase( "No namespace:", (''), + ( x1 = new XML(xml), x1.inScopeNamespaces().toString())); + +try { + x1 = new XML(xml); + x1.addNamespace(); + result = "no exception"; +} catch (e1) { + result = "exception"; +} + +AddTestCase( "Undefined namespace:", "exception", result); + +AddTestCase( "Undefined namespace, length:", 1, + ( x1 = new XML(xml), x1.addNamespace(null), x1.inScopeNamespaces().length)); + +AddTestCase( "One namespace w/o prefix, length:", 1, + ( x1 = new XML(xml), x1.addNamespace(n2), x1.inScopeNamespaces().length)); + +AddTestCase( "One namespace w/ prefix, length:", 1, + ( x1 = new XML(xml), x1.addNamespace(n1), x1.inScopeNamespaces().length)); + +AddTestCase( "One namespace at toplevel, one at child, length at toplevel:", 1, + ( x1 = new XML(xml), x1.addNamespace(n3), x1.b[0].c.addNamespace(n4), x1.inScopeNamespaces().length)); + +AddTestCase( "One namespace at toplevel, two at child, length at child:", 2, + ( x1 = new XML(xml), x1.addNamespace(n3), x1.b[1].c.addNamespace(n4), x1.b[1].c.addNamespace(n1), x1.b[1].c.inScopeNamespaces().length)); + +AddTestCase( "inScopeNamespaces[0].typeof:", "object", + ( x1 = new XML(xml), x1.addNamespace(n1), x1.addNamespace(n4), typeof x1.inScopeNamespaces()[0])); + +AddTestCase( "inScopeNamespaces[1].prefix:", "boo", + ( x1 = new XML(xml), x1.addNamespace(n1), x1.addNamespace(n4), x1.inScopeNamespaces()[1].prefix)); + + +var xmlDoc = "hi"; + +AddTestCase( "Reading one toplevel namespace:", (["http://www.w3.org/TR/xsl"]).toString(), + ( x1 = new XML(xmlDoc), x1.inScopeNamespaces().toString())); + +AddTestCase( "Reading two namespaces up parent chain:", (["http://www.foo.org/","http://www.w3.org/TR/xsl"]).toString(), + ( x1 = new XML(xmlDoc), x1.b.c.inScopeNamespaces().toString())); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XML/e13_4_4_18.as b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_18.as new file mode 100644 index 00000000000..c0773ad2eb2 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_18.as @@ -0,0 +1,206 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.4.4.18 - XML insertChildAfter()"); + +//TEST(1, true, XML.prototype.hasOwnProperty("insertChildAfter")); + +x1 = + + one + two +; + +correct = + + one + three + two +; + +x1.insertChildAfter(x1.bravo[0], three); + +TEST(2, correct, x1); + +x1 = + + one + two +; + +correct = + + three + one + two +; + +x2 = new XML(); + +x2 = x1.insertChildAfter(null, three); + +TEST(3, correct, x1); + +TEST(4, correct, x2); + +// to simplify string matching +XML.prettyPrinting = false; + +var xmlDoc = ""; +var child1 = new XML("John"); +var child2 = new XML("Sue"); +var child3 = new XML("Bob"); + +var allChildren = new XMLList("JohnSueBob"); +var twoChildren = new XMLList("SueBob"); + +var wholeString = "JohnSueBob"; + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.insertChildAfter(null, child1), MYXML.toString()", + "John", + (MYXML = new XML(xmlDoc), MYXML.insertChildAfter(null, child1), MYXML.toString())); + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.insertChildAfter(null, child1), MYXML.children()[0].parent() == MYXML", + true, + (MYXML = new XML(xmlDoc), MYXML.insertChildAfter(null, child1), MYXML.children()[0].parent() == MYXML)); + +// The child is equal to child1 (but not the same object) +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.insertChildAfter(null, child1), MYXML.children()[0] == child1", + true, + (MYXML = new XML(xmlDoc), MYXML.insertChildAfter(null, child1), MYXML.children()[0] == child1)); + +// The child is a duplicate of child1 +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.insertChildAfter(null, child1), MYXML.children()[0] === child1", + true, + (MYXML = new XML(xmlDoc), MYXML.insertChildAfter(null, child1), MYXML.children()[0] === child1)); + +var MYXML = new XML(xmlDoc); +MYXML.insertChildAfter(null, child1); + +// !!@ this crashes Rhino's implementation +AddTestCase( "MYXML.insertChildAfter(child1, child2), MYXML.toString()", + "JohnSue", + (MYXML.insertChildAfter(child1, child2), MYXML.toString())); + +MYXML = new XML(xmlDoc); +MYXML.insertChildAfter(null, child1); + +AddTestCase( "MYXML.insertChildAfter(MYXML.children()[0], child2), MYXML.toString()", + "JohnSue", + (MYXML.insertChildAfter(MYXML.children()[0], child2), MYXML.toString())); + +MYXML = new XML(xmlDoc); +MYXML.insertChildAfter(null, child1); +MYXML.insertChildAfter(MYXML.children()[0], child2); + +// !!@ this crashes Rhino's implementation +AddTestCase( "MYXML.insertChildAfter(child2, child3), MYXML.toString()", + "JohnSueBob", + (MYXML.insertChildAfter(child2, child3), MYXML.toString())); + +MYXML = new XML(xmlDoc); +MYXML.insertChildAfter(null, child1); +MYXML.insertChildAfter(MYXML.children()[0], child2); + +AddTestCase( "MYXML.insertChildAfter(MYXML.children()[1], child3), MYXML.toString()", + "JohnSueBob", + (MYXML.insertChildAfter(MYXML.children()[1], child3), MYXML.toString())); + + +MYXML = new XML(xmlDoc); + +AddTestCase("MYXML.insertChildAfter(null, XMLList), MYXML.toString()", + new XML(wholeString).toString(), + (MYXML.insertChildAfter(null, allChildren), MYXML.toString())); + +MYXML = new XML(xmlDoc); +MYXML.insertChildAfter(null, child1); + +AddTestCase("MYXML.insertChildAfter(child1, XMLList), MYXML.toString()", + new XML(wholeString).toString(), + (MYXML.insertChildAfter(MYXML.children()[0], twoChildren), MYXML.toString())); + +MYXML = new XML(xmlDoc); +MYXML.insertChildAfter(null, child1); + +AddTestCase("MYXML.insertChildAfter(child1, \"string\"), MYXML.toString()", + new XML("Johnstring").toString(), + (MYXML.insertChildAfter(MYXML.children()[0], "string"), MYXML.toString())); + + +var a = ; + +try { + a.b.c.insertChildAfter (null, a); + result = a; +} catch (e1) { + result = typeError(e1.toString()); +} +AddTestCase("a = , a.b.c.insertChildAfter(null, a)", "TypeError: Error #1118", result); + + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XML/e13_4_4_19.as b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_19.as new file mode 100644 index 00000000000..9eaf208eb14 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_19.as @@ -0,0 +1,206 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.4.4.19 - insertChildBefore()"); + +//TEST(1, true, XML.prototype.hasOwnProperty("insertChildBefore")); + +x1 = + + one + two +; + +correct = + + three + one + two +; + +x1.insertChildBefore(x1.bravo[0], three); + +TEST(2, correct, x1); + +x1 = + + one + two +; + +correct = + + one + two + three +; +x2 = new XML(); + +x2 = x1.insertChildBefore(null, three); + +TEST(3, correct, x1); + +TEST(4, correct, x2); + +// to simplify string matching +XML.prettyPrinting = false; + +var xmlDoc = ""; +var child1 = new XML("John"); +var child2 = new XML("Sue"); +var child3 = new XML("Bob"); + +var allChildren = new XMLList("JohnSueBob"); +var twoChildren = new XMLList("JohnSue"); + +var wholeString = "JohnSueBob"; + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.insertChildBefore(null, child1), MYXML.toString()", + "John", + (MYXML = new XML(xmlDoc), MYXML.insertChildBefore(null, child1), MYXML.toString())); + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.insertChildBefore(null, child1), MYXML.children()[0].parent() == MYXML", + true, + (MYXML = new XML(xmlDoc), MYXML.insertChildBefore(null, child1), MYXML.children()[0].parent() == MYXML)); + +// The child is equal to child1 (but not the same object) +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.insertChildBefore(null, child1), MYXML.children()[0] == child1", + true, + (MYXML = new XML(xmlDoc), MYXML.insertChildBefore(null, child1), MYXML.children()[0] == child1)); + +// The child is a duplicate of child1 +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.insertChildBefore(null, child1), MYXML.children()[0] === child1", + true, + (MYXML = new XML(xmlDoc), MYXML.insertChildBefore(null, child1), MYXML.children()[0] === child1)); + +var MYXML = new XML(xmlDoc); +MYXML.insertChildBefore(null, child1); + +// !!@ this crashes Rhino's implementation +AddTestCase( "MYXML.insertChildBefore(child1, child2), MYXML.toString()", + "SueJohn", + (MYXML.insertChildBefore(child1, child2), MYXML.toString())); + + +var MYXML = new XML(xmlDoc); +MYXML.insertChildBefore(null, child1); + +AddTestCase( "MYXML.insertChildBefore(MYXML.children()[0], child2), MYXML.toString()", + "SueJohn", + (MYXML.insertChildBefore(MYXML.children()[0], child2), MYXML.toString())); + +MYXML = new XML(xmlDoc); +MYXML.insertChildBefore(null, child2); +MYXML.insertChildBefore(MYXML.children()[0], child1); + +// !!@ this crashes Rhino's implementation +AddTestCase( "MYXML.insertChildBefore(child2, child3), MYXML.toString()", + "JohnBobSue", + (MYXML.insertChildBefore(child2, child3), MYXML.toString())); + +MYXML = new XML(xmlDoc); +MYXML.insertChildBefore(null, child2); +MYXML.insertChildBefore(MYXML.children()[0], child1); + +AddTestCase( "MYXML.insertChildBefore(MYXML.children()[1], child3), MYXML.toString()", + "JohnBobSue", + (MYXML.insertChildBefore(MYXML.children()[1], child3), MYXML.toString())); + +MYXML = new XML(xmlDoc); + +AddTestCase("MYXML.insertChildBefore(null, XMLList), MYXML.toString()", + new XML(wholeString).toString(), + (MYXML.insertChildBefore(null, allChildren), MYXML.toString())); + +MYXML = new XML(xmlDoc); +MYXML.insertChildBefore(null, child3); + +AddTestCase("MYXML.insertChildBefore(child3, XMLList), MYXML.toString()", + new XML(wholeString).toString(), + (MYXML.insertChildBefore(MYXML.children()[0], twoChildren), MYXML.toString())); + +MYXML = new XML(xmlDoc); +MYXML.insertChildBefore(null, child1); + +AddTestCase("MYXML.insertChildBefore(child1, \"string\"), MYXML.toString()", + new XML("stringJohn").toString(), + (MYXML.insertChildBefore(MYXML.children()[0], "string"), MYXML.toString())); + +var a = ; + +try { + a.b.c.insertChildBefore (null, a); + result = a; +} catch (e1) { + result = typeError(e1.toString()); +} +AddTestCase("a = , a.b.c.insertChildBefore(null,a)", "TypeError: Error #1118", result); + + + + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XML/e13_4_4_2.as b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_2.as new file mode 100644 index 00000000000..2c5cba864ce --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_2.as @@ -0,0 +1,166 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.4.4.2 - XML addNamespace()"); + +//TEST(1, true, XML.prototype.hasOwnProperty("addNamespace")); +//TEST(2, true, XML.prototype.hasOwnProperty("children")); + +e = + + Jim25 + Joe20 +; + +n = "http://foobar/"; +e.addNamespace(n); + +n = new Namespace(); +e.addNamespace(n); + +n = new Namespace("http://foobar/"); +e.addNamespace(n); + +x1 = ; +n = new Namespace("ns", "uri"); +x1.addNamespace(n); +TEST(2, "", x1.toXMLString()); + +var n1 = new Namespace('pfx', 'http://w3.org'); +var n2 = new Namespace('http://us.gov'); +var n3 = new Namespace('boo', 'http://us.gov'); +var n4 = new Namespace('boo', 'http://hk.com'); +var xml = "55bird5dinosaur"; +var xmlwithns = "55bird5dinosaur"; + +AddTestCase( "addNamespace with prefix:", "http://w3.org", + ( x1 = new XML(xml), x1.addNamespace(n1), myGetNamespace(x1,'pfx').toString())); + +AddTestCase( "addNamespace without prefix:", undefined, + ( x1 = new XML(xml), x1.addNamespace(n2), myGetNamespace(x1, 'blah'))); + +expectedStr = "ArgumentError: Error #1063: Argument count mismatch on XML/addNamespace(). Expected 1, got 0"; +expected = "Error #1063"; +actual = "No error"; + +try { + x1.addNamespace(); +} catch(e1) { + actual = grabError(e1, e1.toString()); +} + +AddTestCase( "addNamespace(): Error. Needs 1 argument", expected, actual); + +AddTestCase( "Does namespace w/o prefix change XML object:", true, + ( x1 = new XML(xml), y1 = new XML(xml), x1.addNamespace(n1), (x1 == y1))); + +AddTestCase( "Does namespace w/ prefix change XML object:", true, + ( x1 = new XML(xml), y1 = new XML(xml), x1.addNamespace(n2), (x1 == y1))); + +AddTestCase( "Adding two different namespaces:", 'http://w3.org', + ( x1 = new XML(xml), x1.addNamespace(n1), x1.addNamespace(n3), myGetNamespace(x1, 'pfx').toString())); + +AddTestCase( "Adding two different namespaces:", 'http://us.gov', + ( x1 = new XML(xml), x1.addNamespace(n1), x1.addNamespace(n3), myGetNamespace(x1, 'boo').toString())); + +AddTestCase( "Adding namespace with pre-existing prefix:", 'http://hk.com', + ( x1 = new XML(xml), x1.addNamespace(n3), x1.addNamespace(n4), myGetNamespace(x1, 'boo').toString())); + + +AddTestCase( "Adding namespace to something other than top node:", 'http://hk.com', + ( x1 = new XML(xml), x1.b[0].d.addNamespace(n4), myGetNamespace(x1.b[0].d, 'boo').toString())); + + +AddTestCase( "Adding namespace to XMLList element:", 'http://hk.com', + ( x1 = new XMLList(xml), x1.b[1].addNamespace(n4), myGetNamespace(x1.b[1], 'boo').toString())); + + + +// namespaces with prefixes are preserved + +x2 = text; +x2s = x2.toString(); +correct = '\n text\n'; +AddTestCase("Original XML", x2s, correct); + +// Adding a namespace to a node will clear a conflicting prefix +var ns = new Namespace ("ns2", "newuri"); +x2.addNamespace (ns); +x2s = x2.toString(); + +correct = '\n text\n'; + +AddTestCase("Adding namespace that previously existed with a different prefix", correct, + x2s); + + +correct = text; + +AddTestCase("Adding totally new namespace", correct, +(ns3 = new Namespace ("newprefix", "foo"), x2.addNamespace (ns3),x2)); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XML/e13_4_4_20.as b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_20.as new file mode 100644 index 00000000000..6dca2c858c3 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_20.as @@ -0,0 +1,111 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.4.4.20 - XML length()"); + +//TEST(1, true, XML.prototype.hasOwnProperty("length")); + +x1 = + + one + + two + three + four + + +; + +TEST(2, 1, x1.length()); +TEST(3, 1, x1.bravo.length()); +TEST(4, 1, x1.charlie.length()); +TEST(5, 1, x1.delta.length()); + +var xmlDoc = "JohnWalton25SueDay32" + + +// propertyName as a string +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.length()", 1, + (MYXML = new XML(xmlDoc), MYXML.length())); + +AddTestCase( "MYXML = new XML(), MYXML.length()", 1, + (MYXML = new XML(), MYXML.length())); + +AddTestCase( "MYXML = new XML(null), MYXML.length()", 1, + (MYXML = new XML(null), MYXML.length())); + +AddTestCase( "MYXML = new XML(undefined), MYXML.length()", 1, + (MYXML = new XML(undefined), MYXML.length())); + +AddTestCase( "MYXML = new XML('foo'), MYXML.length()", 1, + (MYXML = new XML("foo"), MYXML.length())); + +XML.ignoreComments = false; +AddTestCase( "MYXML = new XML(''), MYXML.length()", 1, + (MYXML = new XML(""), MYXML.length())); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XML/e13_4_4_21.as b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_21.as new file mode 100644 index 00000000000..4a4bf51813f --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_21.as @@ -0,0 +1,134 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.4.4.21 - XML localName()"); + +//TEST(1, true, XML.prototype.hasOwnProperty("localName")); + +x1 = new XML("onetwo"); +var y1; +y1 = x1.localName(); +TEST(2, "string", typeof(y1)); +TEST(3, "alpha", y1); + +y1 = x1.bravo.localName(); +x1.bravo.setNamespace("http://someuri"); +TEST(4, "bravo", y1); + +x1 = + + one +; + +ns = new Namespace("http://foo/"); +y1 = x1.ns::bravo.localName(); +TEST(5, "string", typeof(y1)); +TEST(6, "bravo", y1); + +y1 = x1.ns::bravo.@name.localName(); +TEST(7, "name", y1); + +y1 = x1.ns::bravo.@ns::value.localName(); +TEST(8, "value", y1); + +var xmlDoc = "John California "; + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.localName()", + "company", + (MYXML = new XML(xmlDoc), MYXML.localName())); + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.localName() instanceof QName", + false, + (MYXML = new XML(xmlDoc), MYXML.localName() instanceof QName)); + +// !!@ fails in Rhino?? +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.localName() instanceof String", + true, + (MYXML = new XML(xmlDoc), MYXML.localName() instanceof String)); + +AddTestCase( "MYXML = new XML(xmlDoc), typeof(MYXML.localName())", + "string", + (MYXML = new XML(xmlDoc), typeof(MYXML.localName()))); + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.children()[0].localName()", + "employee", + (MYXML = new XML(xmlDoc), MYXML.children()[0].localName())); + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.children()[0].localName() instanceof QName", + false, + (MYXML = new XML(xmlDoc), MYXML.children()[0].localName() instanceof QName)); + +// !!@ fails in Rhino?? +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.children()[0].localName() instanceof String", + true, + (MYXML = new XML(xmlDoc), MYXML.children()[0].localName() instanceof String)); + +AddTestCase( "MYXML = new XML(xmlDoc), typeof(MYXML.children()[0].localName())", + "string", + (MYXML = new XML(xmlDoc), typeof(MYXML.children()[0].localName()))); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XML/e13_4_4_22.as b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_22.as new file mode 100644 index 00000000000..841d24e0ba3 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_22.as @@ -0,0 +1,130 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.4.4.22 - XML name()"); + +//TEST(1, true, XML.prototype.hasOwnProperty("name")); + +x1 = + + one + + two + +; + +y1 = x1.bravo.name(); + +TEST(2, "object", typeof(y1)); +TEST(3, QName("bravo"), y1); + +x1 = + + one +; + +ns = new Namespace("http://foo/"); +y1 = x1.ns::bravo.name(); + +TEST(4, "object", typeof(y1)); +TEST(5, QName("http://foo/", "bravo"), y1); + +y1 = x1.ns::bravo.@name.name(); +TEST(6, QName("name"), y1); + +y1 = x1.ns::bravo.@ns::value.name(); +TEST(7, "http://foo/", y1.uri); +TEST(8, "value", y1.localName); +TEST(9, QName("http://foo/", "value"), y1); + +var xmlDoc = "John California "; + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.name()", + new QName("company"), + (MYXML = new XML(xmlDoc), MYXML.name())); + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.name() instanceof QName", + true, + (MYXML = new XML(xmlDoc), MYXML.name() instanceof QName)); + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.name().toString()", + "company", + (MYXML = new XML(xmlDoc), MYXML.name().toString())); + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.children()[0].name()", + new QName("http://colors.com/printer/", "employee"), + (MYXML = new XML(xmlDoc), MYXML.children()[0].name())); + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.children()[0].name() instanceof QName", + true, + (MYXML = new XML(xmlDoc), MYXML.children()[0].name() instanceof QName)); + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.children()[0].name().toString()", + "http://colors.com/printer/::employee", + (MYXML = new XML(xmlDoc), MYXML.children()[0].name().toString())); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XML/e13_4_4_23.as b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_23.as new file mode 100644 index 00000000000..8e365184ae0 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_23.as @@ -0,0 +1,167 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.4.4.23 - XML getNamespace()"); + +//TEST(1, true, XML.prototype.hasOwnProperty("getNamespace")); + +// Prefix case +x1 = + + one +; + +//y = x1.getNamespace(); +y1 = myGetNamespace(x1); +TEST(2, "object", typeof(y1)); +TEST(3, Namespace("http://foo/"), y1); + +//y = x1.getNamespace("bar"); +y1 = myGetNamespace(x1, "bar"); +TEST(4, "object", typeof(y1)); +TEST(5, Namespace("http://bar/"), y1); + +// No Prefix Case +x1 = + + one +; + +//y = x1.getNamespace(); +y1 = myGetNamespace(x1); +TEST(6, "object", typeof(y1)); +TEST(7, Namespace("http://foobar/"), y1); + +// No Namespace case +x1 = + + one +; +//TEST(8, Namespace(""), x1.getNamespace()); +TEST(8, Namespace(""), myGetNamespace(x1)); + +// Namespaces of attributes +x1 = + + one +; + +var ns = new Namespace("http://bar"); +//y1 = x1.ns::bravo.@name.getNamespace(); +y1 = myGetNamespace(x1.ns::bravo.@name); +TEST(9, Namespace(""), y1); + +//y1 = x1.ns::bravo.@ns::value.getNamespace(); +y1 = myGetNamespace(x1.ns::bravo.@ns::value); +TEST(10, ns.toString(), y1.toString()); + +var xmlDoc = "hi"; +var ns1 = Namespace ("xsl", "http://www.w3.org/TR/xsl"); +var ns2 = Namespace ("foo", "http://www.foo.org"); + + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.getNamespace()", + "http://www.w3.org/TR/xsl", + (MYXML = new XML(xmlDoc), myGetNamespace(MYXML).toString())); + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.getNamespace()", + new Namespace("http://www.w3.org/TR/xsl"), + (MYXML = new XML(xmlDoc), myGetNamespace(MYXML))); + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.getNamespace('stylesheet')", + new Namespace ("http://www.w3.org/TR/xsl"), + (MYXML = new XML(xmlDoc), myGetNamespace(MYXML, 'xsl'))); + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.getNamespace('xsl')", + "http://www.w3.org/TR/xsl", (MYXML = new XML(xmlDoc), + myGetNamespace(MYXML, 'xsl').toString())); + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.getNamespace('foo')", + undefined, (MYXML = new XML(xmlDoc), + myGetNamespace(MYXML, 'foo'))); + + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.b.c.getNamespace('foo')", + "http://www.foo.org/", (MYXML = new XML(xmlDoc), + myGetNamespace(MYXML.b.c, 'foo').toString())); + + +x1 = +<> +one +b; + +try { + ns = x1.namespace(); + result = ns; +} catch (e1) { + result = typeError(e1.toString()); +} + +AddTestCase("Calling namespace on list with two items", "TypeError: Error #1086", result); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XML/e13_4_4_24.as b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_24.as new file mode 100644 index 00000000000..76db82fddb7 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_24.as @@ -0,0 +1,147 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.4.4.24 - XML namespaceDeclarations()"); + +//TEST(1, true, XML.prototype.hasOwnProperty("namespaceDeclarations")); + +x1 = + + one +; + +y1 = x1.namespaceDeclarations(); + +TEST(2, 2, y1.length); +TEST(3, "object", typeof(y1[0])); +TEST(4, "object", typeof(y1[1])); +TEST(5, "foo", y1[0].prefix); +TEST(6, Namespace("http://foo/"), y1[0]); +TEST(7, "bar", y1[1].prefix); +TEST(8, Namespace("http://bar/"), y1[1]); + +var n1 = new Namespace('pfx', 'http://w3.org'); +var n2 = new Namespace('http://us.gov'); +var n3 = new Namespace('boo', 'http://us.gov'); +var n4 = new Namespace('boo', 'http://hk.com'); +var xml1 = "55bird5dinosaur"; + +//AddTestCase( "Undefined declaration:", (''), +// ( x1 = new XML(xml1), x1.addNamespace(), x1.namespaceDeclarations().toString())); + +AddTestCase( "Undefined declaration, length:", 0, + ( x1 = new XML(xml1), x1.addNamespace(null), x1.namespaceDeclarations().length)); + +AddTestCase( "Two declarations in toplevel scope:", ('http://hk.com'), + ( x1 = new XML(xml1), x1.addNamespace(n1), x1.addNamespace(n4), x1.namespaceDeclarations()[1].toString())); + +AddTestCase( "Two declarations in toplevel scope:", ('http://w3.org'), + ( x1 = new XML(xml1), x1.addNamespace(n1), x1.addNamespace(n4), x1.namespaceDeclarations()[0].toString())); + +AddTestCase( "No declaration:", (''), + ( x1 = new XML(xml1), x1.namespaceDeclarations().toString())); + +AddTestCase( "One declaration w/o prefix, length:", 0, + ( x1 = new XML(xml1), x1.addNamespace(n2), x1.namespaceDeclarations().length)); + +AddTestCase( "One declaration w/ prefix, length:", 1, + ( x1 = new XML(xml1), x1.addNamespace(n1), x1.namespaceDeclarations().length)); + +AddTestCase( "One declaration at toplevel, one at child, length at toplevel:", 1, + ( x1 = new XML(xml1), x1.addNamespace(n3), x1.b[0].c.addNamespace(n4), x1.namespaceDeclarations().length)); + +AddTestCase( "One declaration at toplevel, two at child, length at child:", 2, + ( x1 = new XML(xml1), x1.addNamespace(n3), x1.b[1].c.addNamespace(n4), x1.b[1].c.addNamespace(n1), x1.b[1].c.namespaceDeclarations().length)); + +AddTestCase( "namespaceDeclarations[1].typeof:", "object", + ( x1 = new XML(xml1), x1.addNamespace(n1), x1.addNamespace(n4), typeof x1.namespaceDeclarations()[1])); + +AddTestCase( "namespaceDeclarations[1].prefix:", "boo", + ( x1 = new XML(xml1), x1.addNamespace(n1), x1.addNamespace(n4), x1.namespaceDeclarations()[1].prefix)); + + +var xml1Doc = "hi"; + +AddTestCase( "Reading one toplevel declaration:", "http://www.w3.org/TR/xsl", + ( x1 = new XML(xml1Doc), x1.namespaceDeclarations().toString())); + +AddTestCase( "Another declaration up parent chain:", "http://www.foo.org/", + ( x1 = new XML(xml1Doc), x1.b.c.namespaceDeclarations().toString())); + +// Adding because of Mozilla bug https://bugzilla.mozilla.org/show_bug.cgi?id=278112 + +var xhtml1NS = new Namespace('http://www.w3.org/1999/xhtml'); +var xhtml = ; + +AddTestCase("namespaceDeclarations before setNamespace()", 0, xhtml.namespaceDeclarations().length); + +xhtml.setNamespace(xhtml1NS); + +AddTestCase("namespaceDeclarations after setNamespace()", 0, xhtml.namespaceDeclarations().length); + + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XML/e13_4_4_25.as b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_25.as new file mode 100644 index 00000000000..1c615007ab1 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_25.as @@ -0,0 +1,135 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.4.4.25 - XML nodeKind()"); + +//TEST(1, true, XML.prototype.hasOwnProperty("nodeKind")); + +x1 = + + one +; + +TEST(2, "element", x1.bravo.nodeKind()); +TEST(3, "attribute", x1.@attr1.nodeKind()); + +// Non-existant node type is text +x1 = new XML(); +TEST(4, "text", x1.nodeKind()); +//TEST(5, "text", XML.prototype.nodeKind()); + +var xmlDoc = "John California "; + + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.nodeKind()", + "element", + (MYXML = new XML(xmlDoc), MYXML.nodeKind())); + +AddTestCase( "MYXML = new XML(null), MYXML.nodeKind()", + "text", + (MYXML = new XML(null), MYXML.nodeKind())); + +AddTestCase( "MYXML = new XML(undefined), MYXML.nodeKind()", + "text", + (MYXML = new XML(undefined), MYXML.nodeKind())); + +AddTestCase( "MYXML = new XML(), MYXML.nodeKind()", + "text", + (MYXML = new XML(), MYXML.nodeKind())); + +AddTestCase( "MYXML = new XML(), MYXML.children()[0].nodeKind()", + "element", + (MYXML = new XML(xmlDoc), MYXML.children()[0].nodeKind())); + +AddTestCase( "MYXML = new XML(), MYXML.children()[0].attributes()[0].nodeKind()", + "attribute", + (MYXML = new XML(xmlDoc), MYXML.children()[0].attributes()[0].nodeKind())); + +AddTestCase( "MYXML = new XML(), MYXML.children()[0].name1.children()[0].nodeKind()", + "text", + (MYXML = new XML(xmlDoc), MYXML.children()[0].name1.children()[0].nodeKind())); + +XML.ignoreComments = false +AddTestCase( "MYXML = new XML(\"\"), MYXML.nodeKind()", + "element", + (MYXML = new XML(""), MYXML.nodeKind())); + +AddTestCase( "MYXML = new XML(\"\"), MYXML.children()[0].nodeKind()", + "comment", + (MYXML = new XML(""), MYXML.children()[0].nodeKind())); + +XML.ignoreProcessingInstructions = false +AddTestCase( "MYXML = new XML(\"\"), MYXML.nodeKind()", + "element", + (MYXML = new XML(""), MYXML.nodeKind())); + +AddTestCase( "MYXML = new XML(\"\"), MYXML.children()[0].nodeKind()", + "processing-instruction", + (MYXML = new XML(""), MYXML.children()[0].nodeKind())); + + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XML/e13_4_4_26.as b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_26.as new file mode 100644 index 00000000000..9c0f47ce64f --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_26.as @@ -0,0 +1,121 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.4.4.26 - XML normalize()"); + +//TEST(1, true, XML.prototype.hasOwnProperty("normalize")); + +XML.ignoreWhitespace = false; +XML.prettyPrinting = false; + +x1 = + one ; + +TEST_XML(2, " one ", x1); +x1.normalize(); +TEST_XML(3, " one ", x1); + +x1 = + + one +; + +x1.normalize(); +TEST_XML(5, " one ", x1); + +XML.prettyPrinting = true; +var xml = new XML(""); +var a = new XML("zero"); +var b = new XML("one"); +var c = new XML("two"); +var d = new XML("two"); + +xml.appendChild (a); +xml.appendChild (b); +xml.appendChild (c); +xml.appendChild (d); + +AddTestCase( "xml has multiple text nodes, xml.normalize(), xml.toString()", + "" + NL() + " zeroonetwo" + NL() + " two" + NL() + "", + (xml.normalize(), xml.toString())); + +xml = new XMLList("b"); +a = new XMLList("one"); +b = new XMLList("two"); +c = new XMLList(""); +d = new XMLList("three"); + +xml.appendChild (a); +xml.appendChild (b); +xml.appendChild (c); +xml.appendChild (d); + +AddTestCase( "xml has multiple text nodes, xml.normalize(), xml.toString()", + "" + NL() + " bonetwo" + NL() + " " + NL() + " three" + NL() + "", +(xml.normalize(), xml.toString())); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XML/e13_4_4_27.as b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_27.as new file mode 100644 index 00000000000..48c5f34134d --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_27.as @@ -0,0 +1,127 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.4.4.27 - XML parent()"); + +//TEST(1, true, XML.prototype.hasOwnProperty("parent")); + +var x1 = + + one + + two + +; + +var y1 = x1.bravo; + +TEST(2, x1, y1.parent()); + +TEST(3, undefined, x1.parent()); + +x1 = new XML(""); +var a = new XML("text node"); +var b = new XML("bar"); + +AddTestCase ("MYXML = new(''), MYXML.parent()", undefined, x1.parent()); +AddTestCase ("MYXML = new('text node'), MYXML.parent()", undefined, a.parent()); +AddTestCase ("MYXML = new('bar'), MYXML.parent()", undefined, b.parent()); + +x1.appendChild (a); +x1.appendChild (b); + + +// Text node is a special case +AddTestCase ("a - orphan node after x.appendChild, a.parent()", undefined, a.parent()); +AddTestCase ("b - orphan node after x.appendChild, b.parent()", x1, b.parent()); + +AddTestCase ("x1.children()[0].parent()", x1, x1.children()[0].parent()); +AddTestCase ("x1.children()[1].parent()", x1, x1.children()[0].parent()); +AddTestCase ("x1.children()[0].parent() === x1", true, (x1.children()[0].parent() === x1)); +AddTestCase ("x1.children()[1].parent() === x1", true, (x1.children()[0].parent() === x1)); + +var xDoc = "John California Mary Texas "; + +AddTestCase( "x1 = new XML(xDoc), x1.employee[0].parent() == x1", true, (x1 = new XML(xDoc), x1.employee[0].parent() == x1)); +AddTestCase( "x1 = new XML(xDoc), x1.employee.name1[0].parent() == x1.employee[0]", true, (x1 = new XML(xDoc), x1.employee.name1[0].parent() == x1.employee[0])); +AddTestCase( "x1 = new XML(xDoc), x1.employee[0].attribute('id').parent() === x1.employee[0]", true, (x1 = new XML(xDoc), x1.employee[0].attribute('id').parent() === x1.employee[0])); + +AddTestCase( "x1 = new XML(xDoc), x1.employee[1].parent() == x1", true, (x1 = new XML(xDoc), x1.employee[1].parent() == x1)); +AddTestCase( "x1 = new XML(xDoc), x1.employee.name1[1].parent() == x1.employee[0]", true, (x1 = new XML(xDoc), x1.employee.name1[1].parent() == x1.employee[1])); +AddTestCase( "x1 = new XML(xDoc), x1.employee[1].attribute('id').parent() === x1.employee[1]", true, (x1 = new XML(xDoc), x1.employee[1].attribute('id').parent() === x1.employee[1])); + +XML.ignoreComments = false; +XML.ignoreProcessingInstructions = false; +xDoc = ""; + +// Tests comments and PI nodes +AddTestCase( "x1 = new XML(xDoc), x1.children()[0].parent() == x1", true, (x1 = new XML(xDoc), x1.children()[0].parent() == x1)); +AddTestCase( "x1 = new XML(xDoc), x1.children()[1].parent() == x1", true, (x1 = new XML(xDoc), x1.children()[1].parent() == x1)); +AddTestCase( "x1 = new XML(xDoc), x1.children().parent() == x1", true, (x1 = new XML(xDoc), x1.children().parent() == x1)); + + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XML/e13_4_4_28.as b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_28.as new file mode 100644 index 00000000000..37b6b426d15 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_28.as @@ -0,0 +1,140 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.4.4.28 - processingInsructions()"); + +//TEST(1, true, XML.prototype.hasOwnProperty("processingInstructions")); + +XML.ignoreProcessingInstructions = false; + +// test generic PI +var x1 = new XML("one"); + +var correct = new XMLList(""); + +TEST(2, correct, x1.processingInstructions()); +TEST(3, correct, x1.processingInstructions("*")); + +correct = ""; + +TEST_XML(4, correct, x1.processingInstructions("xyz")); + +// test XML-decl +// Un-comment these tests when we can read in doc starting with PI. +x1 = new XML("one"); + +correct = new XMLList(""); + +test(5, correct, x1.processingInstructions()); +test(6, correct, x1.processingInstructions("*")); +test(7, correct, x1.processingInstructions("xml")); + +// extra whitespace is on purpose for at the end of this string +var xmlDoc = "JohnWalton25 SueDay32" + +// propertyName as a string +XML.ignoreProcessingInstructions = true; + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.processingInstructions().toString()", "", + (MYXML = new XML(xmlDoc), MYXML.processingInstructions().toString())); + +XML.ignoreProcessingInstructions = false; + +AddTestCase( "ignorePI = false, MYXML = new XML(xmlDoc), MYXML.processingInstructions().toString()", + "\n", + (MYXML = new XML(xmlDoc), MYXML.processingInstructions().toXMLString())); + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.processingInstructions('*')", + "\n", + (MYXML = new XML(xmlDoc), MYXML.processingInstructions("*").toXMLString())); + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.processingInstructions('xml-stylesheet')", + "", + (MYXML = new XML(xmlDoc), MYXML.processingInstructions("xml-stylesheet").toString())); + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.processingInstructions(new QName('xml-stylesheet'))", + "", + (MYXML = new XML(xmlDoc), MYXML.processingInstructions(new QName("xml-stylesheet")).toString())); + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.processingInstructions(new QName('foo'))", + "", + (MYXML = new XML(xmlDoc), MYXML.processingInstructions(new QName("foo")).toString())); + +// Attribute name does not match +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.processingInstructions('@xml-stylesheet')", + "", + (MYXML = new XML(xmlDoc), MYXML.processingInstructions("@xml-stylesheet").toString())); + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.processingInstructions('xml-foo')", + "", + (MYXML = new XML(xmlDoc), MYXML.processingInstructions("xml-foo").toString())); + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.processingInstructions('child-xml')", + "", + (MYXML = new XML(xmlDoc), MYXML.processingInstructions("child-xml").toString())); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XML/e13_4_4_29.as b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_29.as new file mode 100644 index 00000000000..ec5826360d7 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_29.as @@ -0,0 +1,261 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.4.4.29 - XML prependChild()"); + +//TEST(1, true, XML.prototype.hasOwnProperty("prependChild")); + +x1 = + + + one + +; + +correct = + + + bar + one + +; + +x1.bravo.prependChild(bar); + +TEST(2, correct, x1); + +emps = + + + John + + + Sue + + + +correct = + + + Mr. + John + + + Sue + + + +emps.employee.(name == "John").prependChild(Mr.); + +TEST(3, correct, emps); + +XML.prettyPrinting = false; +var xmlDoc = ""; +var child1 = new XML("John"); +var child2 = new XML("Sue"); +var child3 = new XML("Bob"); + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.prependChild(child1), MYXML.toString()", + "John", + (MYXML = new XML(xmlDoc), MYXML.prependChild(child1), MYXML.toString())); + +var MYXML = new XML(xmlDoc); +MYXML.prependChild(child2); + +AddTestCase( "MYXML.prependChild(child1), MYXML.toString()", + "JohnSue", + (MYXML.prependChild(child1), MYXML.toString())); + +MYXML = new XML(xmlDoc); +MYXML.prependChild(child3); +MYXML.prependChild(child2); + +AddTestCase ("Making sure child added is a duplicate", true, (child2 === MYXML.children()[0])); +AddTestCase ("Making sure child added is a true copy", true, (child2 == MYXML.children()[0])); + +AddTestCase( "MYXML.prependChild(child1), MYXML.toString()", + "JohnSueBob", + (MYXML.prependChild(child1), MYXML.toString())); + +AddTestCase( "MYXML.prependChild('simple text string'), MYXML.toString()", + "simple text stringJohnSueBob", + (MYXML.prependChild("simple text string"), MYXML.toString())); + +// !!@ test cases for adding comment nodes, PI nodes + +MYXML = new XML(xmlDoc); +MYXML.prependChild(child3); +MYXML.prependChild(child2); +MYXML.prependChild(child1); + +AddTestCase( "MYXML.prependChild(''), MYXML.toString()", + "JohnSueBob", + (MYXML.prependChild(""), MYXML.toString())); + +XML.ignoreComments = false; +MYXML = new XML(xmlDoc); +MYXML.prependChild(child3); +MYXML.prependChild(child2); +MYXML.prependChild(child1); + +AddTestCase( "MYXML.prependChild(''), MYXML.toString()", + "JohnSueBob", + (MYXML.prependChild(""), MYXML.toString())); + +MYXML = new XML(xmlDoc); +MYXML.prependChild(child3); +MYXML.prependChild(child2); +MYXML.prependChild(child1); + +AddTestCase( "MYXML.prependChild(''), MYXML.toString()", + "JohnSueBob", + (MYXML.prependChild(""), MYXML.toString())); + +XML.ignoreProcessingInstructions = false; +MYXML = new XML(xmlDoc); +MYXML.prependChild(child3); +MYXML.prependChild(child2); +MYXML.prependChild(child1); + +var expected = "TypeError: error: XML declaration may only begin entities."; +var result = "error, exception not thrown"; + +AddTestCase( "MYXML.prependChild(''), MYXML.toString()", + "JohnSueBob", + (MYXML.prependChild(""), MYXML.toString())); + +try{ + +MYXML.prependChild(""); + +} catch( e1 ){ + +result = e1.toString(); + +} +//Taking test out because bug 108406 has been deferred. +//AddTestCase("OPEN BUG: 108406 - MYXML.prependChild(\"\")", expected, result); + +// !!@ setting a property that starts with an "@" that implies an attribute name?? +// Rhino throws an error + +MYXML = new XML(xmlDoc); +MYXML.prependChild(child3); +MYXML.prependChild(child2); +MYXML.prependChild(child1); +AddTestCase( "MYXML.prependChild(\"<@notanattribute>hi\"), MYXML.toString()", + "<@notanattribute>hiJohnSueBob", + (MYXML.prependChild("<@notanattribute>hi"), MYXML.toString())); + +MYXML = new XML(''); +x1 = new XMLList('GiantsRobots'); +MYXML.prependChild(x1); + +AddTestCase( "Prepend XMLList", + 'GiantsRobots', + (MYXML.toString()) ); + +MYXML = new XML(''); +x1 = "poltergeist"; +MYXML.MOVIE.prependChild(x1); + +AddTestCase( "Prepend a string to child node", + 'poltergeist', + (MYXML.toString()) ); + +// I believe the following two test cases are wrong. See bug 145184. + +MYXML = new XML(''); +x1 = "poltergeist"; +MYXML.prependChild(x1); + +AddTestCase( "Prepend a string to top node", + 'poltergeist', + (MYXML.toString()) ); + +MYXML = new XML(''); +x1 = new XML("poltergeist"); +MYXML.prependChild(x1); + +AddTestCase( "Prepend a node to child node", + 'poltergeist', + (MYXML.toString()) ); + +var a = ; + +try { + a.b.prependChild (a); + result = a; +} catch (e1) { + result = typeError(e1.toString()); +} + +AddTestCase("a = , a.b.prependChild(a)", "TypeError: Error #1118", result); + + + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XML/e13_4_4_3.as b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_3.as new file mode 100644 index 00000000000..479d0840642 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_3.as @@ -0,0 +1,208 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.4.4.3 - XML appendChild()"); + +//TEST(1, true, XML.prototype.hasOwnProperty("appendChild")); + +// Add new employee to list +emps = + + Jim25 + Joe20 +; + +correct = + + Jim25 + Joe20 + Sue30 +; + +newEmp = Sue30; + +emps.appendChild(newEmp); +TEST(2, correct, emps); + +// Add a new child element to the end of Jim's employee element +emps = + + Jim25 + Joe20 +; + +correct = + + Jim25snorkeling + Joe20 +; + +emps.employee.(name == "Jim").appendChild(snorkeling); +TEST(3, correct, emps); + +XML.prettyPrinting = false; +var xmlDoc = "GiantsPadres"; + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.appendChild('Red Sox'), MYXML.toXMLString()", + "GiantsPadresRed Sox", + (MYXML = new XML(xmlDoc), MYXML.appendChild('Red Sox'), MYXML.toXMLString()) ); + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.TEAM[0].appendChild ('San Francisco')), MYXML.toXMLString()", + "GiantsSan FranciscoPadres", + (MYXML = new XML(xmlDoc), MYXML.TEAM[0].appendChild ('San Francisco'), MYXML.toXMLString()) ); + + +// Weird behavior of new XML(null) vs XML() + +var child = new XML("Giants"); +var xml = new XML("foo"); + +AddTestCase( "MYXML = new XML(null), MYXML.appendChild(new XML('Giants')), MYXML.nodeKind()", + "text", + (MYXML = new XML(null), MYXML.appendChild(new XML("Giants")), MYXML.nodeKind()) ); + +AddTestCase( "MYXML = new XML(null), MYXML.appendChild(new XML('Giants')), MYXML.toString()", + "", + (MYXML = new XML(null), MYXML.appendChild(new XML("Giants")), MYXML.toString()) ); + +// This has weird behavior of seemingly replacing the XML() node with the appended child. It somehow +// converts the "text" (really "empty") node into a element node +// 03/07/05 [vfleisch] NOT ANYMORE. Updated test case to assert for text, instead of element. +AddTestCase( "MYXML = new XML(), MYXML.appendChild(new XML('Giants')), MYXML.nodeKind()", + "text", + (MYXML = new XML(), MYXML.appendChild(new XML("Giants")), MYXML.nodeKind()) ); + +MYXML = new XML(); +MYXML.appendChild(new XML("Giants")); + +var MYXML = new XML(''); +var x1 = new XML('Giants'); +MYXML.appendChild(x1); + +AddTestCase( "duplicate child node - MYXML.appendChild(new XML('Giants')), MYXML.toString()", + "GiantsGiants", + (MYXML.appendChild(x1), MYXML.toString()) ); + +MYXML = new XML(''); +x1 = new XML('Giants'); +MYXML.appendChild(x1); + +AddTestCase( "true duplicate child node - MYXML.appendChild(MYXML.child(0)[0]), MYXML.toString()", + "GiantsGiants", + (MYXML.appendChild(MYXML.child(0)[0]), MYXML.toString()) ); + +MYXML = new XML(''); +AddTestCase( "MYXML = new XML(''); MYXML.appendChild(\"a\"), MYXML.toString()", + "a", + (MYXML.appendChild("a"), MYXML.toString())); + +MYXML = new XML(''); +x1 = new XMLList('GiantsRobots'); +MYXML.appendChild(x1); + +AddTestCase( "Append XMLList", + 'GiantsRobots', + (MYXML.toString()) ); + +MYXML = new XML(''); +x1 = "poltergeist"; +MYXML.MOVIE.appendChild(x1); + +AddTestCase( "Append a string to child node", + 'poltergeist', + (MYXML.toString()) ); + + +MYXML = new XML(''); +x1 = "poltergeist"; +MYXML.appendChild(x1); + +AddTestCase( "Append a string to top node", + 'poltergeist', + (MYXML.toString()) ); + +MYXML = new XML(''); +x1 = new XML("poltergeist"); +MYXML.appendChild(x1); + +AddTestCase( "Append a node to child node", + 'poltergeist', + (MYXML.toString()) ); + +var a = ; + +try { + a.appendChild (a); + result = a; +} catch (e1) { + result = typeError(e1.toString()); +} + +AddTestCase("a = , a.appendChild(a)", "TypeError: Error #1118", result); + + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XML/e13_4_4_30.as b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_30.as new file mode 100644 index 00000000000..00cc388b247 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_30.as @@ -0,0 +1,97 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.4.4.30 - propertyIsEnumerable()"); + +//TEST(1, true, XML.prototype.hasOwnProperty("propertyIsEnumerable")); + +// All properties accessible by Get are enumerable +x1 = + + one +; + +TEST(2, true, x1.propertyIsEnumerable("0")); +TEST(3, true, x1.propertyIsEnumerable(0)); +TEST(5, false, x1.propertyIsEnumerable("bravo")); +TEST(6, false, x1.propertyIsEnumerable()); +TEST(7, false, x1.propertyIsEnumerable(undefined)); +TEST(8, false, x1.propertyIsEnumerable(null)); + +var xmlDoc = "JohnWalton25SueDay32" + +// propertyName as a string +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.propertyIsEnumerable(0)", true, + (MYXML = new XML(xmlDoc), MYXML.propertyIsEnumerable('0'))); +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.propertyIsEnumerable(1)", false, + (MYXML = new XML(xmlDoc), MYXML.propertyIsEnumerable('1'))); +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.propertyIsEnumerable(2)", false, + (MYXML = new XML(xmlDoc), MYXML.propertyIsEnumerable('2'))); +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.propertyIsEnumerable('employee')", false, + (MYXML = new XML(xmlDoc), MYXML.propertyIsEnumerable('employee'))); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XML/e13_4_4_31.as b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_31.as new file mode 100644 index 00000000000..3c2dd8d2c75 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_31.as @@ -0,0 +1,146 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.4.4.31 - XML removeNamespace()"); + +//TEST(1, true, XML.prototype.hasOwnProperty("removeNamespace")); + +x1 = + + one +; + +correct = + + one +; + +TEST(1.5, correct, x1); +TEST(1.6, false, (correct.toString() == x1.toString())); + +x1.removeNamespace("http://foo/"); + +TEST(2, correct.toString(), x1.toString()); + +TEST(2.5, correct, x1); + +// Shouldn't remove namespace if referenced +x1 = + + one +; + +correct = + + one +; + +x1.removeNamespace("http://foo/"); + +TEST(3, correct, x1); + + +var xmlDoc = "hi"; +var ns1 = Namespace ("xsl", "http://www.w3.org/TR/xsl"); +var ns2 = Namespace ("foo", "http://www.foo.org"); + + +// Namespace that is referenced by QName should not be removed +AddTestCase( "MYXML.removeNamespace(QName reference)", "http://www.w3.org/TR/xsl", + ( MYXML = new XML(xmlDoc), MYXML.removeNamespace('xsl'), myGetNamespace(MYXML, 'xsl').toString())); + + +// Other namespaces should be removed +AddTestCase( "MYXML.removeNamespace(no Qname reference)", undefined, + ( MYXML = new XML(xmlDoc), MYXML.b.c.removeNamespace('foo'), myGetNamespace(MYXML, 'foo')) ); + +var n1 = new Namespace('pfx', 'http://w3.org'); +var n2 = new Namespace('http://us.gov'); +var n3 = new Namespace('boo', 'http://us.gov'); +var n4 = new Namespace('boo', 'http://hk.com'); +var xml = "55bird5dinosaur"; + +AddTestCase("Two namespaces in one node", true, + ( x1 = new XML(xml), x1.addNamespace(n1), x1.addNamespace(n3), x1.removeNamespace(n3), + x1.removeNamespace(n1), (myGetNamespace(x1, 'pfx') == myGetNamespace(x1, 'boo'))) ); + +AddTestCase("Two namespaces in one node", 1, + ( x1 = new XML(xml), x1.addNamespace(n1), x1.addNamespace(n3), x1.removeNamespace(n3), + x1.removeNamespace(n1), x1.inScopeNamespaces().length) ); + +AddTestCase("Two namespace in two different nodes", undefined, + ( x1 = new XML(xml), x1.addNamespace(n3), x1.b[0].c.addNamespace(n1), + x1.removeNamespace(n1), myGetNamespace(x1.b[0].c, 'pfx'))); + +var xml1 = 55bird5dinosaur; +var xml2 = 55bird5dinosaur; + +AddTestCase("Remove namespace without prefix", xml2, + xml1.removeNamespace(n2), xml1); + + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XML/e13_4_4_32.as b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_32.as new file mode 100644 index 00000000000..9160bc5b237 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_32.as @@ -0,0 +1,154 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.4.4.32 - XML replace()"); + +//TEST(1, true, XML.prototype.hasOwnProperty("replace")); + +// Replace the first employee record with an open staff requisition +emps = + + Jim25 + Joe20 +; + +correct = + + + Joe20 +; + +emps.replace(0, ); + +TEST(2, correct, emps); + +// Replace all children with open staff requisition + +emps = + + Jim25 + Joe20 +; + +correct = + + +; + +emps.replace("*", ); + +TEST(3, correct, emps); + +// Replace all employee elements with open staff requisition + +emps = + + Jim25 + Joe20 +; + +correct = + + +; + +emps.replace("employee", ); + +TEST(4, correct, emps); + +XML.prettyPrinting = false; +var xmlDoc = "JohnWalton25" + +// propertyName as a string +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.replace(0,'Mr. John')", + "Mr. JohnWalton25", + (MYXML = new XML(xmlDoc), MYXML.replace(0,'Mr. John').toString())); + +xmlDoc = "JohnWalton25" + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.replace('phone','542144')", + "JohnWalton25", + (MYXML = new XML(xmlDoc), MYXML.replace('phone','542144').toString())); + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.replace('firstname','Johnny')", + "JohnnyWalton25", + (MYXML = new XML(xmlDoc), MYXML.replace('firstname','Johnny').toString())); + +// This should replace all the children +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.replace('*','1234567')", + "1234567", + (MYXML = new XML(xmlDoc), MYXML.replace('*',"1234567").toString())); + +// What about using an attribute name as a input parameter +// !!@ Rhino does an attribute addition after id!?!? +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.replace('@phone','7654321')", + "JohnWalton25", + (MYXML = new XML(xmlDoc), MYXML.replace('@phone',"7654321").toString())); + + + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XML/e13_4_4_33.as b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_33.as new file mode 100644 index 00000000000..2958cd7524d --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_33.as @@ -0,0 +1,121 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.4.4.33 - XML setChildren()"); + +//TEST(1, true, XML.prototype.hasOwnProperty("setChildren")); + +x1 = + + one +; + +correct = + + two +; + +x1.setChildren(two); + +TEST(2, correct, x1); + +// Replace the entire contents of Jim's employee element +emps = + + Jim25 + Joe20 +; + +correct = + + John35 + Joe20 +; + +emps.employee.(name == "Jim").setChildren(John + 35); + +TEST(3, correct, emps); + +XML.prettyPrinting = false; +var xmlDoc = "JohnWalton25" +var xmlList = new XMLList ("PaulBetlem35"); + +// propertyName as a string +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.setChildren(xmlList)", + "PaulBetlem35", + (MYXML = new XML(xmlDoc), MYXML.setChildren(xmlList).toString())); + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.setChildren(new XML (\"Fred\"))", + "Fred", + (MYXML = new XML(xmlDoc), MYXML.setChildren(new XML ("Fred")).toString())); + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.setChildren('simple string')", + "simple string", + (MYXML = new XML(xmlDoc), MYXML.setChildren("simple string").toString())); + + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XML/e13_4_4_34.as b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_34.as new file mode 100644 index 00000000000..8ed705bf8a9 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_34.as @@ -0,0 +1,168 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.4.4.34 - XML setLocalName()"); + +//TEST(1, true, XML.prototype.hasOwnProperty("setLocalName")); + +x1 = + + one +; + +correct = + + one +; + +x1.setLocalName("charlie"); + +TEST(2, correct, x1); + +x1 = + + one +; + +correct = + + one +; + +x1.setLocalName("charlie"); + +TEST(3, correct, x1); + +XML.prettyPrinting = false; +var xmlDoc = "JohnWalton25" + +// propertyName as a string +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.setLocalName('newlocalname'),MYXML.localName()", + "newlocalname", + (MYXML = new XML(xmlDoc), MYXML.setLocalName('newlocalname'),MYXML.localName())); + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.setLocalName('newlocalname'),MYXML.toString()", + "JohnWalton25", + (MYXML = new XML(xmlDoc), MYXML.setLocalName('newlocalname'),MYXML.toString())); + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.setLocalName(new QName('newlocalname')),MYXML.toString()", + "JohnWalton25", + (MYXML = new XML(xmlDoc), MYXML.setLocalName(QName('newlocalname')),MYXML.toString())); + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.setLocalName(new QName('foo', 'newlocalname')),MYXML.toString()", + "JohnWalton25", + (MYXML = new XML(xmlDoc), MYXML.setLocalName(QName('foo', 'newlocalname')),MYXML.toString())); + +MYXML = new XML(xmlDoc); + +try { + MYXML.setLocalName('@newlocalname'); + result = "no error"; +} catch (e1) { + result = typeError(e1.toString()); +} + +AddTestCase( "setLocalName('@newlocalname')", "TypeError: Error #1117", result); + + +try { + MYXML.setLocalName('*'); + result = "no error"; +} catch (e2) { + result = typeError(e2.toString()); +} + +AddTestCase( "setLocalName('*')", "TypeError: Error #1117", result); + +try { + MYXML.setLocalName('x123=5'); + result = "no error"; +} catch (e3) { + result = typeError(e3.toString()); +} + +AddTestCase( "setLocalName('x123=5')", "TypeError: Error #1117", result); + +try { + MYXML.setLocalName('123'); + result = "no error"; +} catch (e4) { + result = typeError(e4.toString()); +} + +AddTestCase( "setLocalName('123')", "TypeError: Error #1117", result); + +try { + MYXML.setLocalName('!bam'); + result = "no error"; +} catch (e5) { + result = typeError(e5.toString()); +} + +AddTestCase( "setLocalName('!bam')", "TypeError: Error #1117", result); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XML/e13_4_4_35.as b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_35.as new file mode 100644 index 00000000000..d39b553c9c0 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_35.as @@ -0,0 +1,216 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.4.4.35 - setName"); + +//TEST(1, true, XML.prototype.hasOwnProperty("setName")); + +x1 = + + one +; + +correct = + + one +; + +x1.setName("charlie"); + +TEST(2, correct, x1); + +x1 = + + one +; + +correct = + + one +; + +x1.setName("charlie"); + +TEST(3, correct, x1); + +x1 = + + one +; + +correct = + + one +; + +x1.setName(new QName("http://foobar/", "charlie")); + +TEST(4, correct, x1); + +XML.prettyPrinting = false; +var xmlDoc = "John California "; + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.setName('employees'),MYXML.name().toString()", + "employees", + (MYXML = new XML(xmlDoc),MYXML.setName('employees'), MYXML.name().toString())); + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.setName(new QName('employees')),MYXML.name().toString()", + "employees", + (MYXML = new XML(xmlDoc),MYXML.setName(new QName('employees')), MYXML.name().toString())); + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.setName(new QName('ns', 'employees')),MYXML.name().toString()", + "ns::employees", + (MYXML = new XML(xmlDoc),MYXML.setName(new QName('ns', 'employees')), MYXML.name().toString())); + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.setName('employees'),MYXML.toString()", + "JohnCalifornia", + (MYXML = new XML(xmlDoc),MYXML.setName('employees'), MYXML.toString())); + +// Calling setName() on an attribute +AddTestCase("MYXML = new XML(xmlDoc), MYXML.employee.@id.setName('num')", "num", (MYXML = new XML(xmlDoc), MYXML.employee.@id.setName("num"), MYXML.employee.@num.name().toString())); + +var TYPEERROR = "TypeError: Error #"; +function typeError( str ){ + return str.slice(0,TYPEERROR.length+4); +} +MYXML = new XML(xmlDoc); +MYXML.employee.@id.setName("num"); + +try { + MYXML.employee.@id.name(); + result = "no error"; +} catch (e1) { + result = typeError(e1.toString()); +} + +AddTestCase("MYXML = new XML(xmlDoc), MYXML.employee.@id.setName(\"num\"),MYXML.employee.@id.name())", "TypeError: Error #1086", result); +x1 = + + one +; + +ns = new Namespace("foo", "http://foo/"); +correct = + one +; + +AddTestCase("Calling setName() on an attribute with same name as namespace", correct, (x1.ns::bravo.@attr.setName("foo"), x1)); + +// throws Rhino exception - bad name +MYXML = new XML(xmlDoc); +try { + MYXML.setName('@employees'); + result = " no error"; +} catch (e2) { + result = typeError(e2.toString()); +} +AddTestCase("MYXML.setName('@employees')", "TypeError: Error #1117", result); + +try { + MYXML.setName('!hi'); + result = " no error"; +} catch (e3) { + result = typeError(e3.toString()); +} +AddTestCase("MYXML.setName('!hi')", "TypeError: Error #1117", result); + +try { + MYXML.setName('1+1=5'); + result = " no error"; +} catch (e4) { + result = typeError(e4.toString()); +} +AddTestCase("MYXML.setName('1+1=5')", "TypeError: Error #1117", result); + +try { + MYXML.setName('555'); + result = " no error"; +} catch (e5) { + result = typeError(e5.toString()); +} +AddTestCase("MYXML.setName('555')", "TypeError: Error #1117", result); + + +try { + MYXML.setName('1love'); + result = " no error"; +} catch (e6) { + result = typeError(e6.toString()); +} +AddTestCase("MYXML.setName('1love')", "TypeError: Error #1117", result); + +try { + MYXML.setName('*'); + result = " no error"; +} catch (e7) { + result = typeError(e7.toString()); +} +AddTestCase("MYXML.setName('*')", "TypeError: Error #1117", result); + + + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XML/e13_4_4_36.as b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_36.as new file mode 100644 index 00000000000..9ba3a20e1cb --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_36.as @@ -0,0 +1,192 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.4.4.36 - setNamespace"); + +//TEST(1, true, XML.prototype.hasOwnProperty("setNamespace")); + +x1 = + + one +; + +correct = + + one +; + +x1.setNamespace("http://bar/"); + +TEST(2, correct, x1); + +XML.prettyPrinting = false; +var xmlDoc = "body" + +// !!@ Rhino comes with with the "ns" prefix for this namespace. I have no idea how that happens. +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.setNamespace('http://xyx.org/xml'),MYXML.toString()", + "body", + (MYXML = new XML(xmlDoc), MYXML.setNamespace('http://xyx.org/xml'), MYXML.toString())); + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.setNamespace('http://xyx.org/xml'),MYXML.getNamespace()", + "http://xyx.org/xml", + (MYXML = new XML(xmlDoc), MYXML.setNamespace('http://xyx.org/xml'), myGetNamespace(MYXML).toString())); + + +xmlDoc = "d"; +MYXML = new XML(xmlDoc); +MYXML.setNamespace('http://foo'); +MYXML.b.c.setNamespace('http://bar'); + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.setNamespace('http://zxz.org/xml'),MYXML.toString()", + "d", + (MYXML.toString())); + +var n1 = new Namespace('zzz', 'http://www.zzz.com'); +var n2 = new Namespace('zzz', 'http://www.zzz.org'); +var n3 = new Namespace('abc', 'http://www.zzz.com'); +var n4 = new Namespace('def', 'http://www.zzz.com'); + +xmlDoc = "c"; + +AddTestCase("Adding two namespaces by uri", + "c", + (MYXML = new XML(xmlDoc), MYXML.setNamespace('http://www.zzz.com'), MYXML.b.setNamespace('http://www.zzz.org'), MYXML.toString())); + +AddTestCase("Adding two namespaces with prefix 'zzz'", + "c", + (MYXML = new XML(xmlDoc), MYXML.setNamespace(n1), MYXML.b.setNamespace(n2), MYXML.toString())); + +AddTestCase("Adding two namespaces with prefix 'zzz'", + "c", + (MYXML = new XML(xmlDoc), MYXML.setNamespace(n3), MYXML.b.setNamespace(n4), MYXML.toString())); + + +ns = new Namespace("moo", "http://moo/"); +ns2 = new Namespace("zoo", "http://zoo/"); +ns3 = new Namespace("noo", "http://mootar"); +ns4 = new Namespace("moo", "http://bar/"); +ns5 = new Namespace("poo", "http://moo/"); +x1 = + one +; + +correct = + one +; + +AddTestCase("Calling setNamespace() on an attribute", correct, (MYXML = new XML(x1), MYXML.ns::bravo.@attr.setNamespace(ns2), MYXML)); + +correct = + one +; + +AddTestCase("Calling setNamespace() on an attribute with conflicting namespace prefix", correct.toString(), (MYXML = new XML(x1), MYXML.ns::bravo.@attr.setNamespace("zoo"), MYXML.toString())); + +correct = + one +; + +AddTestCase("Calling setNamespace() on an attribute with conflicting namespace prefix", correct.toString(), (MYXML = new XML(x1), MYXML.ns::bravo.@attr.setNamespace("moo"), MYXML.toString())); + +correct = + one +; + +AddTestCase("Calling setNamespace() on an attribute with conflicting namespace prefix", correct.toString(), (MYXML = new XML(x1), MYXML.ns::bravo.@attr.setNamespace("http://zoo/"), MYXML.toString())); + +correct = + one +; +delete correct; + +AddTestCase("Calling setNamespace() on an attribute with conflicting namespace", correct.toString(), (MYXML = new XML(x1), MYXML.ns::bravo.@attr.setNamespace(ns3), MYXML.toString())); + +var correct = + one +; + +AddTestCase("Calling setNamespace() on an attribute with conflicting namespace prefix", correct.toString(), (MYXML = new XML(x1), MYXML.ns::bravo.@attr.setNamespace(ns4), MYXML.toString())); + +var correct = + one +; + +AddTestCase("Calling setNamespace() on an attribute with conflicting namespace", correct.toString(), (MYXML = new XML(x1), MYXML.ns::bravo.@attr.setNamespace(ns5), MYXML.toString())); + + +x1 = + one +; + +correct = + one +; + +AddTestCase("Calling setNamespace() on an attribute with no existing namespace", correct.toString(), (MYXML = new XML(x1), MYXML.bravo.@attr.setNamespace(ns), MYXML.toString())); + + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XML/e13_4_4_37.as b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_37.as new file mode 100644 index 00000000000..c92b8338522 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_37.as @@ -0,0 +1,120 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.4.4.37 - XML text()"); + +//TEST(1, true, XML.prototype.hasOwnProperty("text")); + +x1 = + + one + + two + +; + +TEST_XML(2, "one", x1.bravo.text()); + +correct = new XMLList(); +correct += new XML("one"); +correct += new XML("two"); +TEST(3, correct, x1..bravo.text()); +TEST_XML(4, "", x1.charlie.text()); +TEST_XML(5, "", x1.foobar.text()); +TEST_XML(6, "one", x1.*.text()); + +XML.prettyPrinting = false; +var xmlDoc = "fooJohnbarWaltonstill25reading" + +// propertyName as a string +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.text().toString()", + "foobarstillreading", + (MYXML = new XML(xmlDoc), MYXML.text().toString())); + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.text() instanceof XMLList", + true, + (MYXML = new XML(xmlDoc), MYXML.text() instanceof XMLList)); + +AddTestCase( "MYXML = new XML(''), MYXML.text().toString()", + "", + (MYXML = new XML(''), MYXML.text().toString())); + +AddTestCase( "MYXML = new XML(''), MYXML.text() instanceof XMLList", + true, + (MYXML = new XML(''), MYXML.text() instanceof XMLList)); + +xmlDoc = b; + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.text().toString()", + "b", + (MYXML = new XML(xmlDoc), MYXML.text().toString())); + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.text().toString()", + "b", + (MYXML = new XML(xmlDoc), MYXML.setName('c'), MYXML.text().toString())); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XML/e13_4_4_38.as b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_38.as new file mode 100644 index 00000000000..b6f7cd694d7 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_38.as @@ -0,0 +1,173 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.4.4.38 - XML toString()"); + +//TEST(1, true, XML.prototype.hasOwnProperty("toString")); + +XML.prettyPrinting = false; + +x1 = + + one + + two + +; + +TEST(2, "one", x1.bravo.toString()); +TEST(3, "one" + NL() + "two", x1..bravo.toString()); + +x1 = + + one + +; + +TEST(4, "", x1.charlie.toString()); + +x1 = + + one + + two + +; + +TEST(5, "two", x1.charlie.toString()); + +x1 = + + one + + two + + +; + +TEST(5, "two", x1.charlie.toString()); + +x1 = + + + +; + +TEST(6, "" + NL() + "", x1.bravo.toString()); + +x1 = + + one + two +; + +TEST(7, "one" + NL() + "two", x1.bravo.toString()); + +var xmlDoc = "JohnWalton25SueDay32" + + +XML.prettyPrinting = false; +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.employee[0].toString()", + "JohnWalton25", + (MYXML = new XML(xmlDoc), MYXML.employee[0].toString())); + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.employee[1].toString()", + "SueDay32", + (MYXML = new XML(xmlDoc), MYXML.employee[1].toString())); + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.employee[0].firstname.toString()", + "John", + (MYXML = new XML(xmlDoc), MYXML.employee[0].firstname.toString())); + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.employee[1].firstname.toString()", + "Sue", + (MYXML = new XML(xmlDoc), MYXML.employee[1].firstname.toString())); + +XML.prettyPrinting = true; +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.employee[0].toString()", + "" + NL() + " John" + NL() + " Walton" + NL() + " 25" + NL() + "", + (MYXML = new XML(xmlDoc), MYXML.employee[0].toString())); + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.employee[1].toString()", + "" + NL() + " Sue" + NL() + " Day" + NL() + " 32" + NL() + "", + (MYXML = new XML(xmlDoc), MYXML.employee[1].toString())); + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.employee[0].firstname.toString()", + "John", + (MYXML = new XML(xmlDoc), MYXML.employee[0].firstname.toString())); + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.employee[1].firstname.toString()", + "Sue", + (MYXML = new XML(xmlDoc), MYXML.employee[1].firstname.toString())); + +xmlDoc = new XML("foo"); + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.toString()", + "foo", + (MYXML = new XML(xmlDoc), MYXML.toString())); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XML/e13_4_4_39.as b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_39.as new file mode 100644 index 00000000000..a72d0beb31f --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_39.as @@ -0,0 +1,202 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.4.4.39 - XML toXMLString"); + +//TEST(1, true, XML.prototype.hasOwnProperty("toXMLString")); + +XML.prettyPrinting = false; + +x1 = + + one + + two + +; + +TEST(2, "one", x1.bravo.toXMLString()); +TEST(3, "one" + NL() + "two", x1..bravo.toXMLString()); + +x1 = + + one + +; + +TEST(4, "", x1.charlie.toXMLString()); + +x1 = + + one + + two + +; + +TEST(5, "two", x1.charlie.toXMLString()); + +x1 = + + one + + two + + +; + +TEST(6, "two", x1.charlie.toXMLString()); + +x1 = + + + +; + +TEST(7, "" + NL() + "", x1.bravo.toXMLString()); + +x1 = + + one + two +; + +TEST(8, "one" + NL() + "two", x1.bravo.toXMLString()); + +XML.prettyPrinting = true; + +x1 = + + one + two +; + +copy = x1.bravo.copy(); + +TEST(9, "one", copy.toXMLString()); + +x1 = + + one + + two + +; + +TEST(10, "String contains value one from bravo", "String contains value " + x1.bravo + " from bravo"); + +var xmlDoc = "JohnWalton25SueDay32" + + +// propertyName as a string +XML.prettyPrinting = false; +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.employee[0].toXMLString()", + "JohnWalton25", + (MYXML = new XML(xmlDoc), MYXML.employee[0].toXMLString())); + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.employee[1].toXMLString()", + "SueDay32", + (MYXML = new XML(xmlDoc), MYXML.employee[1].toXMLString())); + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.employee[0].firstname.toXMLString()", + "John", + (MYXML = new XML(xmlDoc), MYXML.employee[0].firstname.toXMLString())); + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.employee[1].firstname.toXMLString()", + "Sue", + (MYXML = new XML(xmlDoc), MYXML.employee[1].firstname.toXMLString())); + +// test case containing xml namespaces +var xmlDoc2 = "African Coffee Table80120"; +AddTestCase( "MYXML = new XML(xmlDoc2), MYXML.toXMLString()", + "African Coffee Table80120", + (MYXML = new XML(xmlDoc2), MYXML.toXMLString())); + + +XML.prettyPrinting = true; +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.employee[0].toXMLString()", + "" + NL() + " John" + NL() + " Walton" + NL() + " 25" + NL() + "", + (MYXML = new XML(xmlDoc), MYXML.employee[0].toXMLString())); + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.employee[1].toXMLString()", + "" + NL() + " Sue" + NL() + " Day" + NL() + " 32" + NL() + "", + (MYXML = new XML(xmlDoc), MYXML.employee[1].toXMLString())); + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.employee[0].firstname.toXMLString()", + "John", + (MYXML = new XML(xmlDoc), MYXML.employee[0].firstname.toXMLString())); + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.employee[1].firstname.toXMLString()", + "Sue", + (MYXML = new XML(xmlDoc), MYXML.employee[1].firstname.toXMLString())); + +xmlDoc = "foo"; +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.toXMLString()", + "foo", + (MYXML = new XML(xmlDoc), MYXML.toXMLString())); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XML/e13_4_4_4.as b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_4.as new file mode 100644 index 00000000000..cf80b8083fb --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_4.as @@ -0,0 +1,141 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.4.4.4 - XML attribute()"); + +//TEST(1, true, XML.prototype.hasOwnProperty("attribute")); + +// Get count of employees +emps = + + Jim25 + Joe20 +; + +TEST_XML(2, 2, emps.attribute("count")); + +// Get the id of the employee age 25 +emps = + + Jim25 + Joe20 +; + +TEST_XML(3, 0, emps.employee.(age == "25").attribute("id")); + +// Get the id of the employee named Jim +emps = + + Jim25 + Joe20 +; + +TEST_XML(4, 0, emps.employee.(name == "Jim").attribute("id")); + +var xmlDoc = "Giants"; + +// verify that attribute correct finds one attribute node +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.attribute('foo') instanceof XMLList", true, + (MYXML = new XML(xmlDoc), MYXML.attribute('foo') instanceof XMLList )); +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.attribute('foo') instanceof XML", false, + (MYXML = new XML(xmlDoc), MYXML.attribute('foo') instanceof XML )); +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.attribute('foo').length()", 1, + (MYXML = new XML(xmlDoc), MYXML.attribute('foo').length() )); +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.attribute('foo').toString()", "bar", + (MYXML = new XML(xmlDoc), MYXML.attribute('foo').toString() )); +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.attribute('foo')[0].nodeKind()", "attribute", + (MYXML = new XML(xmlDoc), MYXML.attribute('foo')[0].nodeKind() )); + +// verify that attribute doesn't find non-existent names +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.attribute('DOESNOTEXIST') instanceof XMLList", true, + (MYXML = new XML(xmlDoc), MYXML.attribute('DOESNOTEXIST') instanceof XMLList )); +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.attribute('DOESNOTEXIST') instanceof XML", false, + (MYXML = new XML(xmlDoc), MYXML.attribute('DOESNOTEXIST') instanceof XML )); +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.attribute('DOESNOTEXIST').length()", 0, + (MYXML = new XML(xmlDoc), MYXML.attribute('DOESNOTEXIST').length() )); +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.attribute('DOESNOTEXIST').toString()", "", + (MYXML = new XML(xmlDoc), MYXML.attribute('DOESNOTEXIST').toString() )); + +// verify that attribute doesn't find child node names +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.attribute('TEAM') instanceof XMLList", true, + (MYXML = new XML(xmlDoc), MYXML.attribute('TEAM') instanceof XMLList )); +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.attribute('TEAM') instanceof XML", false, + (MYXML = new XML(xmlDoc), MYXML.attribute('TEAM') instanceof XML )); +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.attribute('TEAM').toString()", "", + (MYXML = new XML(xmlDoc), MYXML.attribute('TEAM').toString() )); +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.attribute('TEAM').length()", 0, + (MYXML = new XML(xmlDoc), MYXML.attribute('TEAM').length() )); + +xl = y; + +AddTestCase( "attribute(new QName(\"*\"))", "aatrbatr", + ( q = new QName("*"), xl.attribute(q).toString() )); + +AddTestCase( "attribute(new QName(\"@*\"))", "", + ( q = new QName("@*"), xl.attribute(q).toString() )); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XML/e13_4_4_40.as b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_40.as new file mode 100644 index 00000000000..9751cb81712 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_40.as @@ -0,0 +1,113 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.4.4.40 - valueOf"); + +//TEST(1, true, XML.prototype.hasOwnProperty("valueOf")); + +x1 = + + one +; + +TEST(2, x1, x1.valueOf()); + +// Make sure they're the same and not copies + +x1 = + + one +; + +y1 = x1.valueOf(); + +x1.bravo = "two"; + +TEST(3, x1, y1); + +var xmlDoc = "JohnWalton25" + + +// propertyName as a string +var MYXML = new XML(xmlDoc); +AddTestCase( "MYXML = new XML(xmlDoc),MYXML.valueOf() === MYXML", + true, + (MYXML.valueOf() === MYXML)); +MYXML = new XML(); +AddTestCase( "MYXML = new XML(),MYXML.valueOf() === MYXML", + true, + (MYXML.valueOf() === MYXML)); +MYXML = new XML(''); +AddTestCase( "MYXML = new XML(''),MYXML.valueOf() === MYXML", + true, + (MYXML.valueOf() === MYXML)); +MYXML = new XML('foo'); +AddTestCase( "MYXML = new XML('foo'),MYXML.valueOf() === MYXML", + true, + (MYXML.valueOf() === MYXML)); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XML/e13_4_4_5.as b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_5.as new file mode 100644 index 00000000000..712d75e2ee8 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_5.as @@ -0,0 +1,113 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.4.4.5 - XML attributes()"); + +//TEST(1, true, XML.prototype.hasOwnProperty("attributes")); + +x1 = + + one +; + +TEST(2, "xml", typeof(x1.attributes())); + +// Iterate through the attributes of an XML value +x1 = + + one +; + +correct = new Array("value1", "value2", "value3"); +i = 0; + +for each (var a in x1.attributes()) +{ + TEST_XML(i + 3, correct[i], a); + i++; +} + +var xmlDoc = "Giants"; + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.attributes() instanceof XMLList", true, + (MYXML = new XML(xmlDoc), MYXML.attributes() instanceof XMLList )); +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.attributes() instanceof XML", false, + (MYXML = new XML(xmlDoc), MYXML.attributes() instanceof XML )); +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.attributes().length()", 2, + (MYXML = new XML(xmlDoc), MYXML.attributes().length() )); +XML.prettyPrinting = false; +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.attributes().toString()", "barsecond", + (MYXML = new XML(xmlDoc), MYXML.attributes().toString() )); +XML.prettyPrinting = true; +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.attributes().toString()", "barsecond", + (MYXML = new XML(xmlDoc), MYXML.attributes().toString() )); +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.attributes()[0].nodeKind()", "attribute", + (MYXML = new XML(xmlDoc), MYXML.attributes()[0].nodeKind() )); +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.attributes()[1].nodeKind()", "attribute", + (MYXML = new XML(xmlDoc), MYXML.attributes()[1].nodeKind() )); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XML/e13_4_4_6.as b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_6.as new file mode 100644 index 00000000000..60d70c853d1 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_6.as @@ -0,0 +1,161 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.4.4.6 - XML child()"); + +//TEST(1, true, XML.prototype.hasOwnProperty("child")); + +emps = + + Jim25 + Joe20 +; + +correct = +Jim25 + +Joe20; + + +TEST(2, correct, emps.child("employee")); + +TEST(3, Joe, emps.employee[1].child("name")); + +correct = Joe20; + +TEST(4, correct, emps.child(1)); + +var xmlDoc = "GiantsSan FranciscoPadresSan Diego"; + +// Rhino returns "Giants\nPadres>" + +// propertyName as a string +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.child('Team')", "Giants" + NL() + "Padres", + (MYXML = new XML(xmlDoc), MYXML.child('Team').toString() )); +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.child('Team') instanceof XMLList", true, + (MYXML = new XML(xmlDoc), MYXML.child('Team') instanceof XMLList )); +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.child('Team') instanceof XML", false, + (MYXML = new XML(xmlDoc), MYXML.child('Team') instanceof XML )); +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.child('Team').length()", 2, + (MYXML = new XML(xmlDoc), MYXML.child('Team').length())); +AddTestCase( "MYXML = new XML(null), MYXML.child('Team')", "", + (MYXML = new XML(null), MYXML.child('Team').toString() )); +AddTestCase( "MYXML = new XML(undefined), MYXML.child('Team')", "", + (MYXML = new XML(undefined), MYXML.child('Team').toString() )); +AddTestCase( "MYXML = new XML(), MYXML.child('Team')", "", + (MYXML = new XML(), MYXML.child('Team').toString() )); + +// propertyName as a numeric index +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.child(1) instanceof XMLList", true, + (MYXML = new XML(xmlDoc), MYXML.child(1) instanceof XMLList )); +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.child(1)", "San Francisco", + (MYXML = new XML(xmlDoc), MYXML.child(1).toString() )); +AddTestCase( "MYXML = new XML(null), MYXML.child(1)", "", + (MYXML = new XML(null), MYXML.child(1).toString() )); +AddTestCase( "MYXML = new XML(undefined), MYXML.child(1)", "", + (MYXML = new XML(undefined), MYXML.child(1).toString() )); +AddTestCase( "MYXML = new XML(), MYXML.child(1)", "", + (MYXML = new XML(), MYXML.child(1).toString() )); + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.child(0) instanceof XMLList", true, + (MYXML = new XML(xmlDoc), MYXML.child(0) instanceof XMLList )); +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.child(0)", "Giants", + (MYXML = new XML(xmlDoc), MYXML.child(0).toString() )); +AddTestCase( "MYXML = new XML(null), MYXML.child(0)", "", + (MYXML = new XML(null), MYXML.child(0).toString() )); +AddTestCase( "MYXML = new XML(undefined), MYXML.child(0)", "", + (MYXML = new XML(undefined), MYXML.child(0).toString() )); +AddTestCase( "MYXML = new XML(), MYXML.child(0)", "", + (MYXML = new XML(), MYXML.child(0).toString() )); + +// propertyName is invalid + +// invalid propertyName +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.child('DoesNotExist') instanceof XMLList", true, + (MYXML = new XML(xmlDoc), MYXML.child('DoesNotExist') instanceof XMLList )); +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.child('DoesNotExist')", "", + (MYXML = new XML(xmlDoc), MYXML.child('DoesNotExist').toString() )); +AddTestCase( "MYXML = new XML(null), MYXML.child('DoesNotExist')", "", + (MYXML = new XML(null), MYXML.child('DoesNotExist').toString() )); +AddTestCase( "MYXML = new XML(undefined), MYXML.child('DoesNotExist')", "", + (MYXML = new XML(undefined), MYXML.child('DoesNotExist').toString() )); +AddTestCase( "MYXML = new XML(), MYXML.child('DoesNotExist')", "", + (MYXML = new XML(), MYXML.child('DoesNotExist').toString() )); + +// invalid index +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.child(8) instanceof XMLList", true, + (MYXML = new XML(xmlDoc), MYXML.child(8) instanceof XMLList )); +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.child(8)", "", + (MYXML = new XML(xmlDoc), MYXML.child(8).toString() )); +AddTestCase( "MYXML = new XML(null), MYXML.child(8)", "", + (MYXML = new XML(null), MYXML.child(8).toString() )); +AddTestCase( "MYXML = new XML(undefined), MYXML.child(8)", "", + (MYXML = new XML(undefined), MYXML.child(8).toString() )); +AddTestCase( "MYXML = new XML(), MYXML.child(8)", "", + (MYXML = new XML(), MYXML.child(8).toString() )); + + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XML/e13_4_4_7.as b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_7.as new file mode 100644 index 00000000000..2ceee7a558d --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_7.as @@ -0,0 +1,99 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.4.4.7 - XML childIndex()"); + +//TEST(1, true, XML.prototype.hasOwnProperty("childIndex")); + +emps = + + Jim25 + Joe20 +; + +TEST(2, 0, emps.employee[0].childIndex()); + +// Get the ordinal index of the employee named Joe +TEST(3, 1, emps.employee.(age == "20").childIndex()); +TEST(4, 1, emps.employee.(name == "Joe").childIndex()); + +var xmlDoc = "GiantsSan FranciscoPadresSan Diego"; + +// valid test cases +// MYXML.child(0) returns an XMLList with one node +// The [0] returns the first element in the list which should be child 0 +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.child(0)[0].childIndex()", 0, + (MYXML = new XML(xmlDoc), MYXML.child(0)[0].childIndex() )); + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.child(1)[0].childIndex()", 1, + (MYXML = new XML(xmlDoc), MYXML.child(1)[0].childIndex() )); + +// what does childIndex return if there is no parent +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.childIndex()", -1, + (MYXML = new XML(xmlDoc), MYXML.childIndex() )); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XML/e13_4_4_8.as b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_8.as new file mode 100644 index 00000000000..a3bd1a332cd --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_8.as @@ -0,0 +1,106 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.4.4.8 - XML children()"); + +//TEST(1, true, XML.prototype.hasOwnProperty("children")); + +emps = + + Jim25 + Joe20 +; + +correct = new XMLList(); +correct += Jim25; +correct += Joe20; + +TEST(2, "xml", typeof(emps.children())); +TEST(3, correct, emps.children()); + +// Get the child elements of the first employee +correct = new XMLList(); +correct += Jim, +correct += 25; + +TEST(4, correct, emps.employee[0].children()); + +var xmlDoc = "John California MaryTexas"; + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.employee[0].children().toString()", "John" + NL() + "California", (MYXML = new XML(xmlDoc), MYXML.employee[0].children().toString())); + +// Same results whether or not prettyPrinting is true (XMLList.toString testing) +XML.prettyPrinting = false; +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.employee[0].children().toString()", "John" + NL() + "California", (MYXML = new XML(xmlDoc), MYXML.employee[0].children().toString())); + +//!!@This crashes ASC (because of the (id == '1') code +//!!@This does not work in Rhino +//!!@AddTestCase( "MYXML = new XML(xmlDoc), MYXML.employee.(id == '1').children()", "John, California", (MYXML = new XML(xmlDoc), MYXML.employee.(id == '1').children())); + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.employee[1].children().toString()", "Mary" + NL() + "Texas", (MYXML = new XML(xmlDoc), MYXML.employee[1].children().toString())); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XML/e13_4_4_9.as b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_9.as new file mode 100644 index 00000000000..18a88a6d0b6 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XML/e13_4_4_9.as @@ -0,0 +1,105 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.4.4.9 - XML comments()"); + +//TEST(1, true, XML.prototype.hasOwnProperty("comments")); + +XML.ignoreComments = false; + +x1 = new XML("some text"); + +TEST_XML(2, "", x1.comments()); +TEST_XML(3, "", x1..*.comments()); + +x2 = new XML("some text"); + +TEST(4, "\n", x2.comments().toXMLString()); +TEST(5, "\n", x2..*.comments().toXMLString()); + +XML.ignoreComments = true; +var xmlDoc = "John California "; + +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.comments().toString()", "", (MYXML = new XML(xmlDoc), MYXML.comments().toString())); +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.comments() instanceof XMLList", true, (MYXML = new XML(xmlDoc), MYXML.comments() instanceof XMLList)); +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.comments() instanceof XML", false, (MYXML = new XML(xmlDoc), MYXML.comments() instanceof XML)); +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.comments().length()", 0, (MYXML = new XML(xmlDoc), MYXML.comments().length() )); + +XML.prettyPrinting = true; +XML.ignoreComments = false; +AddTestCase( "XML.ignoreComments = false, MYXML = new XML(xmlDoc), MYXML.comments().toString()", + "\n", + (XML.ignoreComments = false, MYXML = new XML(xmlDoc), MYXML.comments().toXMLString())); +AddTestCase( "XML.ignoreComments = false, MYXML = new XML(xmlDoc), MYXML.comments() instanceof XMLList", true, (MYXML = new XML(xmlDoc), MYXML.comments() instanceof XMLList)); +AddTestCase( "XML.ignoreComments = false, MYXML = new XML(xmlDoc), MYXML.comments() instanceof XML", false, (MYXML = new XML(xmlDoc), MYXML.comments() instanceof XML)); +AddTestCase( "XML.ignoreComments = false, MYXML = new XML(xmlDoc), MYXML.comments().length()", 2, (MYXML = new XML(xmlDoc), MYXML.comments().length() )); + +AddTestCase( "XML.ignoreComments = false, MYXML = new XML(xmlDoc), XML.ignoreComments = true, MYXML.comments().toString()", + "\n", + (XML.ignoreComments = false, MYXML = new XML(xmlDoc), XML.ignoreComments = true, MYXML.comments().toXMLString())); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XML/kXMLAssignmentToIndexedXMLNotAllowedErr.as b/mozilla/js/tamarin/test/e4x/XML/kXMLAssignmentToIndexedXMLNotAllowedErr.as new file mode 100644 index 00000000000..1ac68ab496a --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XML/kXMLAssignmentToIndexedXMLNotAllowedErr.as @@ -0,0 +1,95 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.4 XML Object - Assignment to indexed XML not allowed error"); + +var xml; + +xml = new XML("123"); + +var expectedStr = "TypeError: Error #1087: Assignment to indexed XML is not allowed."; +var expected = "Error #1087"; +var result = "error, exception not thrown"; + + + +try{ + +xml[0] = 5; + +throw "kXMLAssignmentToIndexedXMLNotAllowed error not thrown"; + +} catch( e1 ){ + +result = grabError(e1, e1.toString()); +} + + +AddTestCase("xml[0] = 5", expected, result); + +END(); + diff --git a/mozilla/js/tamarin/test/e4x/XML/kXMLMarkupMustBeWellFormedErr.as b/mozilla/js/tamarin/test/e4x/XML/kXMLMarkupMustBeWellFormedErr.as new file mode 100644 index 00000000000..c0dc71a4d8d --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XML/kXMLMarkupMustBeWellFormedErr.as @@ -0,0 +1,115 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.4 XML Object - XML markup must be well-formed Error"); + +var xml; +var expectedStr = "TypeError: Error #1088: The markup in the document following the root element must be well-formed."; +var expected = "Error #1088"; + +var result = "error, exception not thrown"; + + + +try{ + +xml = new XML("c"); +throw "kXMLMarkupMustBeWellFormed error not thrown"; + +} catch( e1 ){ + +result = grabError(e1, e1.toString()); + +} + +AddTestCase( "new XML(\"c\")", expected, result ); + +expected = "TypeError: Error #1088: XML parser failure: element is malformed"; + +// This needs to be a compiler error test case. +/* +try{ + +xml = + + +; + +throw "element malformed error"; + +} catch( e2 ){ + +result = e2.toString(); + +} + +AddTestCase( "new XML(\"\")", expected, result ); +*/ +END(); + diff --git a/mozilla/js/tamarin/test/e4x/XML/kXMLPrefixNotBoundErr.as b/mozilla/js/tamarin/test/e4x/XML/kXMLPrefixNotBoundErr.as new file mode 100644 index 00000000000..babe182c38e --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XML/kXMLPrefixNotBoundErr.as @@ -0,0 +1,128 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.4 XML Object - XML prefix not bound error"); + +var xml; +expectedStr = "TypeError: Error #1083: The prefix \"ns\" for element \"ns:x\" is not bound."; +expected = "Error #1083"; +result = "error, exception not thrown"; + +try{ + +xml = new XML("123"); +throw new Error("kXMLPrefixNotBound error not thrown"); + +} catch( e1 ){ + +result = grabError(e1, e1.toString()); + +} + +AddTestCase( "x = new XML(var xml = new XML(\"123\")", expected, result ); + + + +expectedStr = "TypeError: Error #1083: The prefix \"ns\" for element \"ns:x\" is not bound."; +expected = "Error #1083"; +result = "error, exception not thrown"; + +try{ + +xml = new XML("123"); +throw new Error("kXMLPrefixNotBound error not thrown"); + +} catch( e2 ){ + +result = grabError(e2, e2.toString()); + +} + +AddTestCase( "x = new XML(var xml = new XML(\"123\")", expected, result ); + + + +expectedStr = "TypeError: Error #1083: The prefix \"as\" for element \"as:a\" is not bound."; +expected = "Error #1083"; +result = "error, exception not thrown"; + +try{ + +xml = new XML("1"); +throw new Error("kXMLPrefixNotBound error not thrown"); + +} catch( e3 ){ + +result = grabError(e3, e3.toString()); + +} + +AddTestCase( "x = new XML(var xml = new XML(\"1\")", expected, result ); + + +END(); + diff --git a/mozilla/js/tamarin/test/e4x/XML/kXMLUnterminatedElementTagErr.as b/mozilla/js/tamarin/test/e4x/XML/kXMLUnterminatedElementTagErr.as new file mode 100644 index 00000000000..a30036b1cd7 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XML/kXMLUnterminatedElementTagErr.as @@ -0,0 +1,110 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.4 XML Object - XML Unterminated Element Tag Error"); + +var expectedStr = "TypeError: Error #1085: The element type \"unterminated\" must be terminated by the matching end-tag \"\"."; +expected = "Error #1085"; + +var result = "error, exception not thrown"; + + + +try{ + +var xml = new XML("text"); +throw "kXMLUnterminatedElementTag"; + +} catch( e1 ){ + +result = grabError(e1, e1.toString()); + +} + + + +AddTestCase( "new XML(\"text\")", expected, result ); + + + +try{ + +xml = new XML("text"); +throw "kXMLUnterminatedElementTag"; + +} catch( e2 ){ + +result = grabError(e2, e2.toString()); + +} + + + +AddTestCase( "new XML(\"text\")", expected, result ); + +END(); + diff --git a/mozilla/js/tamarin/test/e4x/XML/misc_errors.as b/mozilla/js/tamarin/test/e4x/XML/misc_errors.as new file mode 100644 index 00000000000..039b1823bd2 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XML/misc_errors.as @@ -0,0 +1,398 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.4 XML Object - Miscellaneous errors"); + +function grabError(err, str) { + var typeIndex = str.indexOf("Error:"); + var type = str.substr(0, typeIndex + 5); + if (type == "TypeError") { + AddTestCase("Asserting for TypeError", true, (err is TypeError)); + } + var numIndex = str.indexOf("Error #"); + var num = str.substr(numIndex, 11); + return num; +} + +var expected, result; + +// missing quote after third + +expectedStr = "TypeError: Error #1095: XML parser failure: Unterminated attribute"; +expected = "Error #1095"; + +try{ + +var x1 = new XML("Blue TrainLocomotionJohn Coltrane"); +throw "missing \""; + +} catch( e1 ){ + +result = grabError(e1, e1.toString()); + +} + +AddTestCase( "missing \" after attribute", expected, result ); + + +// missing quotes around third + +expectedStr = "TypeError: Error #1090: XML parser failure: element is malformed"; +expected = "Error #1090"; + +try{ + +x1 = new XML("Blue TrainLocomotionJohn Coltrane"); +throw "missing quotes around attribute"; + +} catch( e2 ){ + +result = grabError(e2, e2.toString()); + +} + +AddTestCase( "missing quotes around attribute", expected, result ); + + +// missing starting quote around third + +expectedStr = "TypeError: Error #1090: XML parser failure: element is malformed"; +expected = "Error #1090"; + +try{ + +x1 = new XML("Blue TrainLocomotionJohn Coltrane"); +throw "missing starting quote for attribute"; + +} catch( e3 ){ + +result = grabError(e3, e3.toString()); + +} + +AddTestCase( "missing starting quote for attribute", expected, result ); + + + +// missing ! at start of CDATA section + +expectedStr = "TypeError: Error #1090: XML parser failure: element is malformed"; +expected = "Error #1090"; + +try{ + +x1 = new XML(" <[CDATA[ John Doe ]]> "); +throw "missing ! at start of CDATA section"; + +} catch( e4 ){ + +result = grabError(e4, e4.toString()); + +} + +AddTestCase( "missing ! at start of CDATA section", expected, result ); + + +// unterminated CDATA + +expectedStr = "TypeError: Error #1091: XML parser failure: Unterminated CDATA section"; +expected = "Error #1091"; + +try{ + +x1 = new XML(" John Doe ]> "); +throw "unterminated CDATA section"; + +} catch( e5 ){ + +result = grabError(e5, e5.toString()); + +} + +AddTestCase( "unterminated CDATA section", expected, result ); + + +// unterminated comment + +expectedStr = "TypeError: Error #1094: XML parser failure: Unterminated comment"; +expected = "Error #1094"; + +try{ + +x1 = new XML("this is normal text"); + + +TEST(1, "this is normal text", p2.toString()); + + + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XMLList/e13_5_1.as b/mozilla/js/tamarin/test/e4x/XMLList/e13_5_1.as new file mode 100644 index 00000000000..2dbf72b7f26 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XMLList/e13_5_1.as @@ -0,0 +1,151 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.5.1 - XMLList Constructor as Function"); + +x1 = XMLList(); + +TEST(1, "xml", typeof(x1)); +TEST(2, true, x1 instanceof XMLList); + +// Make sure it's not copied if it's an XMLList +x1 = new XMLList("onetwo"); + + +y1 = XMLList(x1); +TEST(3, x1 === y1, true); + +x1 += three; +TEST(4, x1 === y1, false); + +// Load from one XML type +x1 = XMLList(one); +TEST_XML(5, "one", x1); + +// Load from Anonymous +x1 = XMLList(<>onetwo); +correct = new XMLList(); +correct += one; +correct += two; +TEST_XML(6, correct.toString(), x1); + +// Load from Anonymous as string +x1 = XMLList(<>onetwo); +correct = new XMLList(); +correct += one; +correct += two; +TEST_XML(7, correct.toString(), x1); + +// Load from single textnode +x1 = XMLList("foobar"); +TEST_XML(8, "foobar", x1); + +x1 = XMLList(7); +TEST_XML(9, "7", x1); + +// Undefined and null should behave like "" +x1 = XMLList(null); +TEST_XML(10, "", x1); + +x1 = XMLList(undefined); +TEST_XML(11, "", x1); + +XML.prettyPrinting = false; + +var thisXML = "GiantsSan Francisco"; + +// value is null +AddTestCase( "XMLList(null).toString()", "", XMLList(null).toString() ); +AddTestCase( "typeof XMLList(null)", "xml", typeof XMLList(null) ); +AddTestCase( "XMLList(null) instanceof XMLList", true, XMLList(null) instanceof XMLList); + +// value is undefined +AddTestCase( "XMLList(undefined).toString()", "", XMLList(undefined).toString() ); +AddTestCase( "typeof XMLList(undefined)", "xml", typeof XMLList(undefined) ); +AddTestCase( "XMLList(undefined) instanceof XMLList", true, XMLList(undefined) instanceof XMLList); + +// value is not supplied +AddTestCase( "XMLList().toString()", "", XMLList().toString() ); +AddTestCase( "typeof XMLList()", "xml", typeof XMLList() ); +AddTestCase( "XMLList() instanceof XMLList", true, XMLList() instanceof XMLList); + +// value is supplied (string) +AddTestCase( "XMLList(thisXML).toString()", + "Giants" + NL() + "San Francisco", + XMLList(thisXML).toString() ); +AddTestCase( "typeof XMLList(thisXML)", "xml", typeof XMLList(thisXML) ); + +// value is supplied (xmlList) +var xl = new XMLList ("bar>bar>"); +AddTestCase( "XMLList(xl) === xl", true, XMLList(xl) === xl); + +// value is supplied (xml) +var x1 = new XML ("bar>"); +AddTestCase( "XMLList(x1).length()", 1, XMLList(x1).length()); +AddTestCase( "XMLList(x1).contains(x1)", true, XMLList(x1)[0].contains(x1)); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XMLList/e13_5_2.as b/mozilla/js/tamarin/test/e4x/XMLList/e13_5_2.as new file mode 100644 index 00000000000..0d31ce11832 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XMLList/e13_5_2.as @@ -0,0 +1,175 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.5.2 - XMLList Constructor"); + +x1 = new XMLList(); +TEST(1, "xml", typeof(x1)); +TEST(2, true, x1 instanceof XMLList); + +// Load from another XMLList +// Make sure it is copied if it's an XMLList +x1 = +<> + one + two +; + +y1 = new XMLList(x1); + +x1 += three; + +TEST(3, "one" + NL() + "two", y1.toString()); + +// Load from one XML type +x1 = new XMLList(one); +TEST_XML(4, "one", x1); + +// Load from Anonymous +x1 = new XMLList(<>onetwo); +TEST(5, "one" + NL() + "two", x1.toString()); + +// Load from Anonymous as string +x1 = new XMLList(<>onetwo); +TEST(6, "one" + NL() + "two", x1.toString()); + +// Load from single textnode +x1 = new XMLList("foobar"); +TEST_XML(7, "foobar", x1); + +x1 = XMLList(7); +TEST_XML(8, 7, x1); + +// Undefined and null should behave like "" +x1 = new XMLList(null); +TEST_XML(9, "", x1); + +x1 = new XMLList(undefined); +TEST_XML(10, "", x1); + +var thisXML = "GiantsSan Francisco"; + +// value is null +AddTestCase( "typeof new XMLList(null)", "xml", typeof new XMLList(null) ); +AddTestCase( "new XMLList(null) instanceof XMLList", true, new XMLList(null) instanceof XMLList); +AddTestCase( "(new XMLList(null).length())", 0, (new XMLList(null)).length()); +AddTestCase( "MYOB = new XMLList(null); MYOB.toString()", "", + (MYOB = new XMLList(null), MYOB.toString(), MYOB.toString()) ); + +// value is undefined +AddTestCase( "typeof new XMLList(undefined)", "xml", typeof new XMLList(undefined) ); +AddTestCase( "new XMLList(undefined) instanceof XMLList", true, new XMLList(undefined) instanceof XMLList); +AddTestCase( "(new XMLList(undefined).length())", 0, (new XMLList(undefined)).length()); +AddTestCase( "MYOB = new XMLList(undefined); MYOB.toString()", "", + (MYOB = new XMLList(undefined), MYOB.toString(), MYOB.toString()) ); + +// value is not supplied +AddTestCase( "typeof new XMLList()", "xml", typeof new XMLList() ); +AddTestCase( "new XMLList() instanceof XMLList", true, new XMLList() instanceof XMLList); +AddTestCase( "(new XMLList().length())", 0, (new XMLList()).length()); +AddTestCase( "MYOB = new XMLList(); MYOB.toString()", "", + (MYOB = new XMLList(), MYOB.toString(), MYOB.toString()) ); + +//value is a number +AddTestCase( "typeof new XMLList(5)", "xml", typeof new XMLList(5) ); +AddTestCase( "new XMLList(5) instanceof XMLList", true, new XMLList(5) instanceof XMLList); +AddTestCase( "(new XMLList(5).length())", 1, (new XMLList(5)).length()); +AddTestCase( "MYOB = new XMLList(5); MYOB.toString()", "5", + (MYOB = new XMLList(5), MYOB.toString(), MYOB.toString()) ); +AddTestCase( "MYOB = new XMLList(5); MYOB.toXMLString()", "5", + (MYOB = new XMLList(5), MYOB.toXMLString(), MYOB.toXMLString()) ); + +//value is + +// value is supplied +XML.prettyPrinting = false; +AddTestCase( "typeof new XMLList(thisXML)", "xml", typeof new XMLList(thisXML) ); +AddTestCase( "new XMLList(thisXML) instanceof XMLList", true, new XMLList(thisXML) instanceof XMLList); +AddTestCase( "(new XMLList(thisXML).length())", 2, (new XMLList(thisXML)).length()); +AddTestCase( "MYOB = new XMLList(thisXML); MYOB.toString()", + "Giants" + NL() + "San Francisco", + (MYOB = new XMLList(thisXML), MYOB.toString(), MYOB.toString()) ); + +// Strongly typed XMLList objects +var MYXML1:XMLList = new XMLList(thisXML); +AddTestCase("var MYXML:XMLList = new XMLList(\"bd\");", new XMLList(thisXML).toString(), MYXML1.toString()); + +var MYXML2:XMLList = new XMLList(<>GiantsSan Francisco); +AddTestCase("var MYXML:XMLList = new XMLList(bd);", new XMLList(thisXML).toString(), MYXML2.toString()); + +var MYXML3:XMLList = <>GiantsSan Francisco; +AddTestCase("var MYXML:XMLList = <>bd;", new XMLList(thisXML).toString(), MYXML3.toString()); + +var MYXML4:XMLList = new XMLList(); +AddTestCase("var MYXML:XMLList = new XMLList()", new XMLList(), MYXML4); + +var MYXML5:XMLList = new XMLList(5); +AddTestCase("var MYXML:XMLList = new XMLList(5)", "5", MYXML5.toString()); + + + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XMLList/e13_5_3_1.as b/mozilla/js/tamarin/test/e4x/XMLList/e13_5_3_1.as new file mode 100644 index 00000000000..bd60306cd4e --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XMLList/e13_5_3_1.as @@ -0,0 +1,75 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.5.3.1 - XMLList.prototype"); + +AddTestCase( "typeof XMLList.prototype", "object", typeof XMLList.prototype); +AddTestCase( "XMLList.prototype instanceof XMLList", false, XMLList.prototype instanceof XMLList); +AddTestCase( "new XMLList().prototype instanceof XMLList", true, new XMLList().prototype instanceof XMLList); +AddTestCase( "typeof (new XMLList().prototype)", "xml", typeof (new XMLList().prototype)); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_1.as b/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_1.as new file mode 100644 index 00000000000..f6d486f6e6c --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_1.as @@ -0,0 +1,73 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.5.4.1 - XMLList.prototype.constructor"); + +AddTestCase( "XMLList.prototype.constructor == XMLList", true, XMLList.prototype.constructor == XMLList); +AddTestCase( "XMLList.prototype.constructor === XMLList", true, XMLList.prototype.constructor === XMLList); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_10.as b/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_10.as new file mode 100644 index 00000000000..5d3c5086357 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_10.as @@ -0,0 +1,97 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.5.4.10 - XMLList elements()"); + +//TEST(1, true, XMLList.prototype.hasOwnProperty("elements")); + +var xmlDoc = "GiantsSan FranciscoPadresSan Diego"; + +// !!@ need to verify results of these test cases +// !!@ elements appears to be broken in Rhino + +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.elements('Team').toString()", "Giants" + NL() + "Padres", + (MYXML = new XMLList(xmlDoc), MYXML.elements('Team').toString()) ); + +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.elements('TEAM').toString()", "", + (MYXML = new XMLList(xmlDoc), MYXML.elements('TEAM').toString()) ); + +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.elements('bogus').toString()", "", + (MYXML = new XMLList(xmlDoc), MYXML.elements('bogus').toString()) ); + +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.elements()", "Giants" + NL() + "San Francisco" + NL() + "Padres" + NL() + "San Diego", + (MYXML = new XMLList(xmlDoc), MYXML.elements().toString()) ); + +xmlDoc = "GiantsSan Francisco"; + +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.elements('City').toString()", "San Francisco", + (MYXML = new XMLList(xmlDoc), MYXML.elements('City').toString()) ); + +xmlDoc = "GiantsSan FranciscoPadresSan Diego"; + +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.elements('MLB')", "" + NL() + " Giants" + NL() + " San Francisco" + NL() + " Padres" + NL() + " San Diego" + NL() + "", + (MYXML = new XMLList(xmlDoc), MYXML.elements('MLB').toString()) ); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_11.as b/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_11.as new file mode 100644 index 00000000000..9eeb52e604f --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_11.as @@ -0,0 +1,118 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.5.4.11 - XMLList hasOwnProperty()"); + +//TEST(1, true, XMLList.prototype.hasOwnProperty("hasOwnProperty")); + + +x1 = +<> + + one + + two + three + four + + + + + five + +; + +// Returns true for elements/attributes +TEST(2, true, x1.hasOwnProperty("bravo")); +TEST(3, true, x1.hasOwnProperty("@attr1")); +TEST(4, false, x1.hasOwnProperty("foobar")); +TEST(5, true, x1.hasOwnProperty("echo")); + +// Test for XML Prototype Object - returns true for XML methods. +TEST(5, true, XMLList.prototype.hasOwnProperty("toString")); +TEST(6, false, XMLList.prototype.hasOwnProperty("foobar")); + + +var xmlDoc = "JohnWalton26" + +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.hasOwnProperty('copy')", false, + (MYXML = new XMLList(xmlDoc), MYXML.hasOwnProperty('copy'))); +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.hasOwnProperty('hasSimpleContent')", false, + (MYXML = new XMLList(xmlDoc), MYXML.hasOwnProperty('hasSimpleContent'))); + +//!!@ we're not supporting prototype properties +AddTestCase( "XML.prototype.hasOwnProperty('copy')", true, + (XML.prototype.hasOwnProperty('copy'))); +AddTestCase( "XML.prototype.hasOwnProperty('hasSimpleContent')", true, + (XML.prototype.hasOwnProperty('hasSimpleContent'))); + +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.hasOwnProperty('firstname')", true, + (MYXML = new XMLList(xmlDoc), MYXML.hasOwnProperty('firstname'))); +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.hasOwnProperty('lastname')", true, + (MYXML = new XMLList(xmlDoc), MYXML.hasOwnProperty('lastname'))); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_12.as b/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_12.as new file mode 100644 index 00000000000..ba854546443 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_12.as @@ -0,0 +1,153 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.5.4.12 - XMLList hasComplexContent()"); + +//TEST(1, true, XMLList.prototype.hasOwnProperty("hasComplexContent")); + +// One element should be same as XML case +x1 = +<> + + one + + two + three + four + + + five + + + six + seven + + +; +; + +TEST(2, true, x1.hasComplexContent()); +TEST(3, false, x1.bravo.hasComplexContent()); +TEST(4, true, x1.charlie.hasComplexContent()); +TEST(5, false, x1.delta.hasComplexContent()); +TEST(6, false, x1.foxtrot.hasComplexContent()); +TEST(7, false, x1.golf.hasComplexContent()); +TEST(8, false, x1.hotel.hasComplexContent()); +TEST(9, false, x1.@attr1.hasComplexContent()); +TEST(10, false, x1.bravo.child(0).hasComplexContent()); +TEST(11, true, x1.india.hasComplexContent()); + +// More than one element is complex if one or more things in the list are elements. +x1 = +<> +one +two +; + +TEST(12, true, x1.hasComplexContent()); + +x1 = + + one + one +; + +TEST(13, true, x1.*.hasComplexContent()); + +x1 = + + one +; + +TEST(14, false, x1.@*.hasComplexContent()); + +var xmlDoc = "JohnWalton25" + +// propertyName as a string +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.hasComplexContent()", true, + (MYXML = new XMLList(xmlDoc), MYXML.hasComplexContent())); + +xmlDoc = "John" +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.hasComplexContent()", false, + (MYXML = new XMLList(xmlDoc), MYXML.hasComplexContent())); + +XML.ignoreComments = false; +xmlDoc = "" +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.hasComplexContent()", false, + (MYXML = new XMLList(xmlDoc), MYXML.hasComplexContent())); + +XML.ignoreProcessingInstructions = false; +xmlDoc = "" +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.hasComplexContent()", false, + (MYXML = new XMLList(xmlDoc), MYXML.hasComplexContent())); + +XML.ignoreComments = false; +xmlDoc = "foo" +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.hasComplexContent()", false, + (MYXML = new XMLList(xmlDoc), MYXML.hasComplexContent())); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_13.as b/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_13.as new file mode 100644 index 00000000000..9194df533e0 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_13.as @@ -0,0 +1,169 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.5.4.13 - XMLList hasSimpleContent()"); + +//TEST(1, true, XMLList.prototype.hasOwnProperty("hasSimpleContent")); + +// One element should be same as XML case +x1 = +<> + + one + + two + three + four + + + five + + + six + seven + + +; +; + +TEST(2, false, x1.hasSimpleContent()); +TEST(3, true, x1.bravo.hasSimpleContent()); +TEST(4, false, x1.charlie.hasSimpleContent()); +TEST(5, true, x1.delta.hasSimpleContent()); +TEST(6, true, x1.foxtrot.hasSimpleContent()); +TEST(7, true, x1.golf.hasSimpleContent()); +TEST(8, true, x1.hotel.hasSimpleContent()); +TEST(9, true, x1.@attr1.hasSimpleContent()); +TEST(10, true, x1.bravo.child(0).hasSimpleContent()); +TEST(11, false, x1.india.hasSimpleContent()); + +// More than one element is complex if one or more things in the list are elements. +x1 = +<> +one +two +; + +TEST(12, false, x1.hasSimpleContent()); + +x1 = + + one + one +; + +TEST(13, false, x1.*.hasSimpleContent()); + +x1 = + + one +; + +TEST(14, true, x1.@*.hasSimpleContent()); + +var xmlDoc = "JohnWalton25" + +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.hasSimpleContent()", true, +(MYXML = new XMLList(xmlDoc), MYXML.hasComplexContent())); + +xmlDoc = "John" +AddTestCase ("MYXML = new XML(xmlDoc), MYXML.children().length()", 1, + (MYXML = new XML(xmlDoc), MYXML.children().length())); +AddTestCase ("MYXML = new XML(xmlDoc), MYXML.children()[0].nodeKind()", "text", + (MYXML = new XML(xmlDoc), MYXML.children()[0].nodeKind())); +AddTestCase ("MYXML = new XML(xmlDoc), MYXML.children()[0].nodeKind()", "text", + (MYXML = new XML(xmlDoc), MYXML.children()[0].nodeKind())); +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.children()[0].hasSimpleContent()", true, + (MYXML = new XML(xmlDoc), MYXML.children()[0].hasSimpleContent())); + +XML.ignoreComments = false; +xmlDoc = "" +AddTestCase ("MYXML = new XML(xmlDoc), MYXML.children().length()", 1, + (MYXML = new XML(xmlDoc), MYXML.children().length())); +AddTestCase ("MYXML = new XML(xmlDoc), MYXML.children()[0].nodeKind()", "comment", + (MYXML = new XML(xmlDoc), MYXML.children()[0].nodeKind())); +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.children()[0].hasSimpleContent()", false, + (MYXML = new XML(xmlDoc), MYXML.children()[0].hasSimpleContent())); + +XML.ignoreProcessingInstructions = false; +xmlDoc = "" +AddTestCase ("MYXML = new XML(xmlDoc), MYXML.children().length()", 1, + (MYXML = new XML(xmlDoc), MYXML.children().length())); +AddTestCase ("MYXML = new XML(xmlDoc), MYXML.children()[0].nodeKind()", "processing-instruction", + (MYXML = new XML(xmlDoc), MYXML.children()[0].nodeKind())); +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.children()[0].hasSimpleContent()", false, + (MYXML = new XML(xmlDoc), MYXML.children()[0].hasSimpleContent())); + +xmlDoc = "foo" +AddTestCase ("MYXML = new XML(xmlDoc), MYXML.children().length()", 1, + (MYXML = new XML(xmlDoc), MYXML.children().length())); +AddTestCase ("MYXML = new XML(xmlDoc), MYXML.children()[0].nodeKind()", "text", + (MYXML = new XML(xmlDoc), MYXML.children()[0].nodeKind())); +AddTestCase( "MYXML = new XML(xmlDoc), MYXML.children()[0].hasSimpleContent()", true, + (MYXML = new XML(xmlDoc), MYXML.children()[0].hasSimpleContent())); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_14.as b/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_14.as new file mode 100644 index 00000000000..702aef840f1 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_14.as @@ -0,0 +1,133 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.5.4.14 - XMLList length()"); + +//TEST(1, true, XMLList.prototype.hasOwnProperty("length")); + +x1 = <>one; + +TEST(2, 1, x1.length()); + +x1 = <>onetwo; + +TEST(2, 2, x1.length()); + +emps = + + + John + + + Sue + + + +correct = + + + Mr. + John + + + Sue + + + +TEST(3,2,emps..name.length()); + +var xmlDoc = "JohnWalton25SueDay32"; + + + +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.length()", 2, + (MYXML = new XMLList(xmlDoc), MYXML.length())); + +xmlDoc = "JohnWalton25SueDay32"; + + +// propertyName as a string +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.length()", 1, + (MYXML = new XMLList(xmlDoc), MYXML.length())); + +AddTestCase( "MYXML = new XMLList(), MYXML.length()", 0, + (MYXML = new XMLList(), MYXML.length())); + +AddTestCase( "MYXML = new XMLList(null), MYXML.length()", 0, + (MYXML = new XMLList(null), MYXML.length())); + +AddTestCase( "MYXML = new XMLList(undefined), MYXML.length()", 0, + (MYXML = new XMLList(undefined), MYXML.length())); + +AddTestCase( "MYXML = new XMLList('foo'), MYXML.length()", 1, + (MYXML = new XMLList("foo"), MYXML.length())); + +XML.ignoreComments = false; +AddTestCase( "MYXML = new XMLList(''), MYXML.length()", 1, + (MYXML = new XMLList(""), MYXML.length())); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_15.as b/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_15.as new file mode 100644 index 00000000000..e78196f4302 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_15.as @@ -0,0 +1,87 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.5.4.15 - XMLList normalize()"); + +//TEST(1, true, XMLList.prototype.hasOwnProperty("normalize")); + +var x1, a, b, c, d; + +x1 = new XMLList("bonetwothree"); + +AddTestCase( "xml has multiple text nodes, xml.normalize(), xml.toString()", + "" + NL() + " b" + NL() + " " + NL() + " onetwo" + NL() + " three" + NL() + "", + (x1.normalize(), x1.toString())); + + +x1 = new XMLList("bonetwothree"); + +AddTestCase( "xml has multiple text nodes, xml.normalize(), xml.toString()", + "" + NL() + " bonetwo" + NL() + " " + NL() + " three" + NL() + "", +(x1.normalize(), x1.toString())); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_16.as b/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_16.as new file mode 100644 index 00000000000..b7edef8ce74 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_16.as @@ -0,0 +1,150 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.5.4.16 - XMLList parent()"); + +//TEST(1, true, XMLList.prototype.hasOwnProperty("parent")); + +// Empty should return undefined +x1 = new XML(); +TEST(2, undefined, x1.parent()); + +// If all XMLList items have same parent, then return that parent. +x1 = + + one + two + threefour +; + +y1 = new XMLList(); +y1 += x1.bravo; +y1 += x1.charlie; + +TEST(3, x1, y1.parent()); + +// If items have different parents then return undefined +y1 = new XMLList(); +y1 += x1.bravo; +y1 += x1.bravo.charlie; + +TEST(4, undefined, y1.parent()); + +y1 = x1..charlie; + +TEST(5, undefined, y1.parent()); + +var xDoc = "bc"; +var MYXML = new XMLList(xDoc); + +AddTestCase( "MYXML = new XMLList(xDoc), MYXML.employee[0].parent()", MYXML.name(), + (MYXML.employee[0].parent().name())); + +xDoc = "JohnWalton25Macromedia"; + +AddTestCase( "MYXML = new XMLList(xDoc), MYXML.parent()", undefined, + (MYXML = new XMLList(xDoc), MYXML.parent())); + +var x1 = new XMLList("text nodebar"); +var a = new XMLList("text node"); +var b = new XMLList("bar"); + +AddTestCase ("MYXML = new(''), MYXML.parent()", undefined, x1.parent()); +AddTestCase ("MYXML = new('text node'), MYXML.parent()", undefined, a.parent()); +AddTestCase ("MYXML = new('bar'), MYXML.parent()", undefined, b.parent()); + +//x.appendChild (a); +//x.appendChild (b); + +// Appendchild duplicates a and b so their parent should still be null +AddTestCase ("a - orphan node, a.parent()", undefined, a.parent()); +AddTestCase ("b - orphan node, b.parent()", undefined, b.parent()); + +AddTestCase ("x1.children()[0].parent()", x1[0], x1.children()[0].parent()); +AddTestCase ("x1.children()[1].parent()", x1[0], x1.children()[0].parent()); +AddTestCase ("x1.children()[0].parent() === x1[0]", true, (x1.children()[0].parent() === x1[0])); +AddTestCase ("x1.children()[1].parent() === x1[0]", true, (x1.children()[0].parent() === x1[0])); + +xDoc = "John California Mary Texas "; + +AddTestCase( "x1 = new XMLList(xDoc), x1.employee[0].parent() == x1[0]", true, (x1 = new XMLList(xDoc), x1.employee[0].parent() == x1[0])); +AddTestCase( "x1 = new XMLList(xDoc), x1.employee.name1[0].parent() == x1.employee[0]", true, (x1 = new XMLList(xDoc), x1.employee.name1[0].parent() == x1.employee[0])); +AddTestCase( "x1 = new XMLList(xDoc), x1.employee[0].attribute('id').parent() === x1.employee[0]", true, (x1 = new XMLList(xDoc), x1.employee[0].attribute('id').parent() === x1.employee[0])); + +AddTestCase( "x1 = new XMLList(xDoc), x1.employee[1].parent() == x1[0]", true, (x1 = new XMLList(xDoc), x1.employee[1].parent() == x1[0])); +AddTestCase( "x1 = new XMLList(xDoc), x1.employee.name1[1].parent() == x1.employee[0]", true, (x1 = new XMLList(xDoc), x1.employee.name1[1].parent() == x1.employee[1])); +AddTestCase( "x1 = new XMLList(xDoc), x1.employee[1].attribute('id').parent() === x1.employee[1]", true, (x1 = new XMLList(xDoc), x1.employee[1].attribute('id').parent() === x1.employee[1])); + +XML.ignoreComments = false; +XML.ignoreProcessingInstructions = false; +xDoc = ""; + +// Tests comments and PI nodes +AddTestCase( "x1 = new XMLList(xDoc), x1.children()[0].parent() == x1[0]", true, (x1 = new XMLList(xDoc), x1.children()[0].parent() == x1[0])); +AddTestCase( "x1 = new XMLList(xDoc), x1.children()[1].parent() == x1[0]", true, (x1 = new XMLList(xDoc), x1.children()[1].parent() == x1[0])); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_17.as b/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_17.as new file mode 100644 index 00000000000..4cc0d1df2f0 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_17.as @@ -0,0 +1,113 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.5.4.17 - XMLList processingInstructions()"); + +//TEST(1, true, XMLList.prototype.hasOwnProperty("processingInstructions")); + +// extra whitespace is on purpose for at the end of this string + var xmlDoc = "JohnWalton25 SueDay32"; + + XML.ignoreProcessingInstructions = true; + AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.processingInstructions().toString()", "", + (MYXML = new XMLList(xmlDoc), MYXML.processingInstructions().toXMLString())); + + XML.ignoreProcessingInstructions = false; + AddTestCase( "ignorePI = false, MYXML = new XMLList(xmlDoc), MYXML.processingInstructions().toString()", + "\n", + (MYXML = new XMLList(xmlDoc), MYXML.processingInstructions().toXMLString())); + + AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.processingInstructions('*')", + "\n", + (MYXML = new XMLList(xmlDoc), MYXML.processingInstructions("*").toXMLString())); + + AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.processingInstructions('xml-stylesheet')", + "", + (MYXML = new XMLList(xmlDoc), MYXML.processingInstructions("xml-stylesheet").toString())); + + AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.processingInstructions(new QName('xml-stylesheet'))", + "", + (MYXML = new XMLList(xmlDoc), MYXML.processingInstructions(new QName("xml-stylesheet")).toString())); + + AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.processingInstructions(new QName('foo'))", + "", + (MYXML = new XMLList(xmlDoc), MYXML.processingInstructions(new QName("foo")).toString())); + + // Attribute name does not match + AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.processingInstructions('@xml-stylesheet')", + "", + (MYXML = new XMLList(xmlDoc), MYXML.processingInstructions("@xml-stylesheet").toString())); + + AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.processingInstructions('xml-foo')", + "", + (MYXML = new XMLList(xmlDoc), MYXML.processingInstructions("xml-foo").toString())); + + AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.processingInstructions('child-xml')", + "", + (MYXML = new XMLList(xmlDoc), MYXML.processingInstructions("child-xml").toString())); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_18.as b/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_18.as new file mode 100644 index 00000000000..715cfa3e426 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_18.as @@ -0,0 +1,84 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.5.4.18 - XMLList propertyIsEnumerable()"); + +//TEST(1, true, XMLList.prototype.hasOwnProperty("propertyIsEnumerable")); + +var xmlDoc = "JohnWalton25SueDay321"; + + // propertyName as a string + AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.propertyIsEnumerable(0)", true, + (MYXML = new XMLList(xmlDoc), MYXML.propertyIsEnumerable('0'))); + AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.propertyIsEnumerable(1)", true, + (MYXML = new XMLList(xmlDoc), MYXML.propertyIsEnumerable('1'))); + AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.propertyIsEnumerable(2)", false, + (MYXML = new XMLList(xmlDoc), MYXML.propertyIsEnumerable('2'))); + AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.propertyIsEnumerable('employee')", false, + (MYXML = new XMLList(xmlDoc), MYXML.propertyIsEnumerable('employee'))); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_19.as b/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_19.as new file mode 100644 index 00000000000..926f84cbb7d --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_19.as @@ -0,0 +1,93 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.5.4.19 - XMLList text()"); + +//TEST(1, true, XMLList.prototype.hasOwnProperty("text")); + +XML.prettyPrinting = false; +var xmlDoc = "fooJohnbarWaltonstill25reading" + +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.text().toString()", + "foobarstillreading", + (MYXML = new XMLList(xmlDoc), MYXML.text().toString())); + +AddTestCase( "MYXML = new XMLList(''), MYXML.text().toString()", + "", + (MYXML = new XMLList(''), MYXML.text().toString())); + +xmlDoc = b; + +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.text().toString()", + "b", + (MYXML = new XMLList(xmlDoc), MYXML.text().toString())); + +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.text().toString()", + "b", + (MYXML = new XMLList(xmlDoc), MYXML.setName('c'), MYXML.text().toString())); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_2.as b/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_2.as new file mode 100644 index 00000000000..1ba7d00f851 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_2.as @@ -0,0 +1,156 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.5.4.2 - XMLList attribute()"); + +//TEST(1, true, XMLList.prototype.hasOwnProperty("attribute")); + +// Test with list of size 0 +emps = new XMLList(); +TEST(2, "xml", typeof(emps.attribute("id"))); +TEST_XML(3, "", emps.attribute("id")); + +// Test with list of size 1 +emps += Jim25; + +TEST(4, "xml", typeof(emps.attribute("id"))); +TEST_XML(5, 0, emps.attribute("id")); + +// Test with list of size > 1 +emps += Joe20; +TEST(6, "xml", typeof(emps.attribute("id"))); + +correct = new XMLList(); +correct += new XML("0"); +correct += new XML("1"); +TEST(7, correct, emps.attribute("id")); + +// Test one that doesn't exist - should return empty XMLList +TEST(8, "xml", typeof(emps.attribute("foobar"))); + +// Test args of null and undefined +try { + emps.attribute(null); + SHOULD_THROW(9); +} catch (ex1) { + TEST(9, "TypeError", ex1.name); +} + +try { + emps.attribute(undefined); + SHOULD_THROW(10); +} catch (ex2) { + TEST(10, "TypeError", ex2.name); +} + +var xmlDoc = "GiantsGiants"; + +// verify that attribute correct finds one attribute node +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.attribute('foo') instanceof XMLList", true, + (MYXML = new XMLList(xmlDoc), MYXML.attribute('foo') instanceof XMLList )); +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.attribute('foo') instanceof XML", false, + (MYXML = new XMLList(xmlDoc), MYXML.attribute('foo') instanceof XML )); +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.attribute('foo').length()", 1, + (MYXML = new XMLList(xmlDoc), MYXML.attribute('foo').length() )); +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.attribute('foo').toString()", "bar", + (MYXML = new XMLList(xmlDoc), MYXML.attribute('foo').toString() )); +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.attribute('foo')[0].nodeKind()", "attribute", + (MYXML = new XMLList(xmlDoc), MYXML.attribute('foo')[0].nodeKind() )); + +// verify that attribute correct finds attribute nodes across children +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.attribute('two') instanceof XMLList", true, + (MYXML = new XMLList(xmlDoc), MYXML.attribute('two') instanceof XMLList )); +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.attribute('two') instanceof XML", false, + (MYXML = new XMLList(xmlDoc), MYXML.attribute('two') instanceof XML )); +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.attribute('two').length()", 2, + (MYXML = new XMLList(xmlDoc), MYXML.attribute('two').length() )); +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.attribute('two').toString()", "secondthird", + (MYXML = new XMLList(xmlDoc), MYXML.attribute('two').toString() )); +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.attribute('two')[0].nodeKind()", "attribute", + (MYXML = new XMLList(xmlDoc), MYXML.attribute('two')[0].nodeKind() )); + +// verify that attribute doesn't find non-existent names +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.attribute('DOESNOTEXIST') instanceof XMLList", true, + (MYXML = new XMLList(xmlDoc), MYXML.attribute('DOESNOTEXIST') instanceof XMLList )); +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.attribute('DOESNOTEXIST') instanceof XML", false, + (MYXML = new XMLList(xmlDoc), MYXML.attribute('DOESNOTEXIST') instanceof XML )); +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.attribute('DOESNOTEXIST').length()", 0, + (MYXML = new XMLList(xmlDoc), MYXML.attribute('DOESNOTEXIST').length() )); +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.attribute('DOESNOTEXIST').toString()", "", + (MYXML = new XMLList(xmlDoc), MYXML.attribute('DOESNOTEXIST').toString() )); + +// verify that attribute doesn't find child node names +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.attribute('TEAM') instanceof XMLList", true, + (MYXML = new XMLList(xmlDoc), MYXML.attribute('TEAM') instanceof XMLList )); +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.attribute('TEAM') instanceof XML", false, + (MYXML = new XMLList(xmlDoc), MYXML.attribute('TEAM') instanceof XML )); +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.attribute('TEAM').toString()", "", + (MYXML = new XMLList(xmlDoc), MYXML.attribute('TEAM').toString() )); +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.attribute('TEAM').length()", 0, + (MYXML = new XMLList(xmlDoc), MYXML.attribute('TEAM').length() )); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_20.as b/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_20.as new file mode 100644 index 00000000000..b5caa5f9e87 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_20.as @@ -0,0 +1,124 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.5.4.20 - XMLList toString()"); + +//TEST(1, true, XMLList.prototype.hasOwnProperty("toString")); + +x1 = <>one; + +TEST(2, "one", x1.toString()); + +x1 = <>onetwo; + +TEST(3, "one" + NL() + "two", x1.toString()); + + +var xmlDoc = "JohnWalton25SueDay32" + + +XML.prettyPrinting = false; +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.employee[0].toString()", + "JohnWalton25", + (MYXML = new XMLList(xmlDoc), MYXML.employee[0].toString())); + +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.employee[1].toString()", + "SueDay32", + (MYXML = new XMLList(xmlDoc), MYXML.employee[1].toString())); + +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.employee[0].firstname.toString()", + "John", + (MYXML = new XMLList(xmlDoc), MYXML.employee[0].firstname.toString())); + +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.employee[1].firstname.toString()", + "Sue", + (MYXML = new XMLList(xmlDoc), MYXML.employee[1].firstname.toString())); + +XML.prettyPrinting = true; +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.employee[0].toString()", + "" + NL() + " John" + NL() + " Walton" + NL() + " 25" + NL() + "", + (MYXML = new XMLList(xmlDoc), MYXML.employee[0].toString())); + +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.employee[1].toString()", + "" + NL() + " Sue" + NL() + " Day" + NL() + " 32" + NL() + "", + (MYXML = new XMLList(xmlDoc), MYXML.employee[1].toString())); + +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.employee[0].firstname.toString()", + "John", + (MYXML = new XMLList(xmlDoc), MYXML.employee[0].firstname.toString())); + +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.employee[1].firstname.toString()", + "Sue", + (MYXML = new XMLList(xmlDoc), MYXML.employee[1].firstname.toString())); + +xmlDoc = new XMLList("foo"); + +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.toString()", + "foo", + (MYXML = new XMLList(xmlDoc), MYXML.toString())); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_21.as b/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_21.as new file mode 100644 index 00000000000..9159e2eb45a --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_21.as @@ -0,0 +1,124 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.5.4.21 - XMLList toXMLString()"); + +//TEST(1, true, XMLList.prototype.hasOwnProperty("toXMLString")); + +x1 = <>one; + +TEST(2, "one", x1.toXMLString()); + +x1 = <>onetwo; + +TEST(3, "one" + NL() + "two", x1.toXMLString()); + + +var xmlDoc = "JohnWalton25SueDay32" + + +// propertyName as a string +XML.prettyPrinting = false; +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.employee[0].toXMLString()", + "JohnWalton25", + (MYXML = new XMLList(xmlDoc), MYXML.employee[0].toXMLString())); + +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.employee[1].toXMLString()", + "SueDay32", + (MYXML = new XMLList(xmlDoc), MYXML.employee[1].toXMLString())); + +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.employee[0].firstname.toXMLString()", + "John", + (MYXML = new XMLList(xmlDoc), MYXML.employee[0].firstname.toXMLString())); + +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.employee[1].firstname.toXMLString()", + "Sue", + (MYXML = new XMLList(xmlDoc), MYXML.employee[1].firstname.toXMLString())); + +XML.prettyPrinting = true; +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.employee[0].toXMLString()", + "" + NL() + " John" + NL() + " Walton" + NL() + " 25" + NL() + "", + (MYXML = new XMLList(xmlDoc), MYXML.employee[0].toXMLString())); + +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.employee[1].toXMLString()", + "" + NL() + " Sue" + NL() + " Day" + NL() + " 32" + NL() + "", + (MYXML = new XMLList(xmlDoc), MYXML.employee[1].toXMLString())); + +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.employee[0].firstname.toXMLString()", + "John", + (MYXML = new XMLList(xmlDoc), MYXML.employee[0].firstname.toXMLString())); + +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.employee[1].firstname.toXMLString()", + "Sue", + (MYXML = new XMLList(xmlDoc), MYXML.employee[1].firstname.toXMLString())); + +xmlDoc = "foo"; +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.toXMLString()", + "foo", + (MYXML = new XMLList(xmlDoc), MYXML.toXMLString())); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_22.as b/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_22.as new file mode 100644 index 00000000000..3e47161bf4b --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_22.as @@ -0,0 +1,93 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.5.4.22 - XMLList valueOf()"); + +//TEST(1, true, XMLList.prototype.hasOwnProperty("valueOf")); + +var xmlDoc = "JohnWalton25" + + +// propertyName as a string +var MYXML = new XMLList(xmlDoc); +AddTestCase( "MYXML = new XMLList(xmlDoc),MYXML.valueOf() === MYXML", + true, + (MYXML.valueOf() === MYXML)); +MYXML = new XMLList(); +AddTestCase( "MYXML = new XMLList(),MYXML.valueOf() === MYXML", + true, + (MYXML.valueOf() === MYXML)); +MYXML = new XMLList(''); +AddTestCase( "MYXML = new XMLList(''),MYXML.valueOf() === MYXML", + true, + (MYXML.valueOf() === MYXML)); +MYXML = new XMLList('foo'); +AddTestCase( "MYXML = new XMLList('foo'),MYXML.valueOf() === MYXML", + true, + (MYXML.valueOf() === MYXML)); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_3.as b/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_3.as new file mode 100644 index 00000000000..4d95b49eebd --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_3.as @@ -0,0 +1,121 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.5.4.3 - XMLList attributes()"); + +//TEST(1, true, XMLList.prototype.hasOwnProperty("attributes")); + +// Test with XMLList of size 0 +x1 = new XMLList() +TEST(2, "xml", typeof(x1.attributes())); +TEST_XML(3, "", x1.attributes()); + +// Test with XMLList of size 1 +x1 += one; + +TEST(4, "xml", typeof(x1.attributes())); +correct = new XMLList(); +correct += new XML("value1"); +correct += new XML("value2"); +TEST(5, correct, x1.attributes()); + +// Test with XMLList of size > 1 +x1 += two; + +TEST(6, "xml", typeof(x1.attributes())); +correct = new XMLList(); +correct += new XML("value1"); +correct += new XML("value2"); +correct += new XML("value3"); +correct += new XML("value4"); +TEST(7, correct, x1.attributes()); + +var xmlDoc = "GiantsGiants"; + +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.attributes() instanceof XMLList", true, + (MYXML = new XMLList(xmlDoc), MYXML.attributes() instanceof XMLList )); +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.attributes() instanceof XML", false, + (MYXML = new XMLList(xmlDoc), MYXML.attributes() instanceof XML )); +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.attributes().length()", 3, + (MYXML = new XMLList(xmlDoc), MYXML.attributes().length() )); +XML.prettyPrinting = false; +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.attributes().toString()", "barsecondthird", + (MYXML = new XMLList(xmlDoc), MYXML.attributes().toString() )); +XML.prettyPrinting = true; +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.attributes().toString()", "barsecondthird", + (MYXML = new XMLList(xmlDoc), MYXML.attributes().toString() )); +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.attributes()[0].nodeKind()", "attribute", + (MYXML = new XMLList(xmlDoc), MYXML.attributes()[0].nodeKind() )); +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.attributes()[1].nodeKind()", "attribute", + (MYXML = new XMLList(xmlDoc), MYXML.attributes()[1].nodeKind() )); +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.attributes()[2].nodeKind()", "attribute", + (MYXML = new XMLList(xmlDoc), MYXML.attributes()[2].nodeKind() )); + +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.attributes().toXMLString()", "bar" + NL() + "second" + NL() + "third", + (MYXML = new XMLList(xmlDoc), MYXML.attributes().toXMLString() )); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_4.as b/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_4.as new file mode 100644 index 00000000000..90e3413ad0e --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_4.as @@ -0,0 +1,178 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.5.4.4 - XMLList child()"); + +//TEST(1, true, XMLList.prototype.hasOwnProperty("child")); + +// Test with XMLList of size 0 +x1 = new XMLList() +TEST(2, "xml", typeof(x1.child("bravo"))); +TEST_XML(3, "", x1.child("bravo")); + +// Test with XMLList of size 1 +x1 += onetwo; +TEST(4, "xml", typeof(x1.child("bravo"))); +TEST_XML(5, "two", x1.child("bravo")); + +x1 += three; +TEST(6, "xml", typeof(x1.child("bravo"))); + +correct = <>twothree; +TEST(7, correct, x1.child("bravo")); + +// Test no match, null and undefined +TEST(8, "xml", typeof(x1.child("foobar"))); +TEST_XML(9, "", x1.child("foobar")); + +try { + x1.child(null); + SHOULD_THROW(10); +} catch (ex) { + TEST(10, "TypeError", ex.name); +} + +// Test numeric inputs +x1 = + + one + two +; + +TEST(12, one, x1.child(0)); +TEST(13, two, x1.child(1)); + +var xmlDoc = "GiantsSan FranciscoPadresSan Diego"; + +// propertyName as a string +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.child('Team')", "Giants" + NL() + "Padres", + (MYXML = new XMLList(xmlDoc), MYXML.child('Team').toString() )); +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.child('Team') instanceof XMLList", true, + (MYXML = new XMLList(xmlDoc), MYXML.child('Team') instanceof XMLList )); +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.child('Team') instanceof XML", false, + (MYXML = new XMLList(xmlDoc), MYXML.child('Team') instanceof XML )); +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.child('Team').length()", 2, + (MYXML = new XMLList(xmlDoc), MYXML.child('Team').length())); +AddTestCase( "MYXML = new XMLList(null), MYXML.child('Team')", "", + (MYXML = new XMLList(null), MYXML.child('Team').toString() )); +AddTestCase( "MYXML = new XMLList(undefined), MYXML.child('Team')", "", + (MYXML = new XMLList(undefined), MYXML.child('Team').toString() )); +AddTestCase( "MYXML = new XMLList(), MYXML.child('Team')", "", + (MYXML = new XMLList(), MYXML.child('Team').toString() )); + +// propertyName as a numeric index +// !!@ doesn't work in Rhino. Should this return the 1st child (from 0th) +// of the MLB node which should be "San Francisco" +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.child(1) instanceof XMLList", true, + (MYXML = new XMLList(xmlDoc), MYXML.child(1) instanceof XMLList )); +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.child(1)", "San Francisco" + NL() + "San Diego", + (MYXML = new XMLList(xmlDoc), MYXML.child(1).toString() )); +AddTestCase( "MYXML = new XMLList(null), MYXML.child(1)", "", + (MYXML = new XMLList(null), MYXML.child(1).toString() )); +AddTestCase( "MYXML = new XMLList(undefined), MYXML.child(1)", "", + (MYXML = new XMLList(undefined), MYXML.child(1).toString() )); +AddTestCase( "MYXML = new XMLList(), MYXML.child(1)", "", + (MYXML = new XMLList(), MYXML.child(1).toString() )); + +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.child(0) instanceof XMLList", true, + (MYXML = new XMLList(xmlDoc), MYXML.child(0) instanceof XMLList )); +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.child(0)", "Giants" + NL() + "Padres", + (MYXML = new XMLList(xmlDoc), MYXML.child(0).toString() )); +AddTestCase( "MYXML = new XMLList(null), MYXML.child(0)", "", + (MYXML = new XMLList(null), MYXML.child(0).toString() )); +AddTestCase( "MYXML = new XMLList(undefined), MYXML.child(0)", "", + (MYXML = new XMLList(undefined), MYXML.child(0).toString() )); +AddTestCase( "MYXML = new XMLList(), MYXML.child(0)", "", + (MYXML = new XMLList(), MYXML.child(0).toString() )); + +// propertyName is invalid + +// invalid propertyName +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.child('DoesNotExist') instanceof XMLList", true, + (MYXML = new XMLList(xmlDoc), MYXML.child('DoesNotExist') instanceof XMLList )); +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.child('DoesNotExist')", "", + (MYXML = new XMLList(xmlDoc), MYXML.child('DoesNotExist').toString() )); +AddTestCase( "MYXML = new XMLList(null), MYXML.child('DoesNotExist')", "", + (MYXML = new XMLList(null), MYXML.child('DoesNotExist').toString() )); +AddTestCase( "MYXML = new XMLList(undefined), MYXML.child('DoesNotExist')", "", + (MYXML = new XMLList(undefined), MYXML.child('DoesNotExist').toString() )); +AddTestCase( "MYXML = new XMLList(), MYXML.child('DoesNotExist')", "", + (MYXML = new XMLList(), MYXML.child('DoesNotExist').toString() )); + +// invalid index +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.child(8) instanceof XMLList", true, + (MYXML = new XMLList(xmlDoc), MYXML.child(8) instanceof XMLList )); +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.child(8)", "", + (MYXML = new XMLList(xmlDoc), MYXML.child(8).toString() )); +AddTestCase( "MYXML = new XMLList(null), MYXML.child(8)", "", + (MYXML = new XMLList(null), MYXML.child(8).toString() )); +AddTestCase( "MYXML = new XMLList(undefined), MYXML.child(8)", "", + (MYXML = new XMLList(undefined), MYXML.child(8).toString() )); +AddTestCase( "MYXML = new XMLList(), MYXML.child(8)", "", + (MYXML = new XMLList(), MYXML.child(8).toString() )); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_5.as b/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_5.as new file mode 100644 index 00000000000..57f656cc0eb --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_5.as @@ -0,0 +1,126 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.5.4.5 - XMLList children()"); + +//TEST(1, true, XMLList.prototype.hasOwnProperty("children")); + +// Test with XMLList of size 0 +x1 = new XMLList() +TEST(2, "xml", typeof(x1.children())); +TEST_XML(3, "", x1.children()); + +// Test with XMLList of size 1 +x1 += onetwo; +TEST(4, "xml", typeof(x1.children())); + +correct = <>onetwo; +TEST(5, correct, x1.children()); + +// Test with XMLList of size > 1 +x1 += three; +TEST(6, "xml", typeof(x1.children())); + +correct = <>onetwothree; +TEST(7, correct, x1.children()); + +// Test no children +x1 = new XMLList(); +x1 += ; +x1 += ; +TEST(8, "xml", typeof(x1.children())); +TEST_XML(9, "", x1.children()); + +//get all grandchildren of the order that have the name price + +order = + + + John Smith + + + Big Screen Television + 1299.99 + + + DVD Player + 399.99 + +; + +correct= 1299.99 + 399.99; + +TEST(10, correct, order.children().price); + +var xmlDoc = "JohnWalton25SueDay32" + +// propertyName as a string +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.children()", + "John" + NL() + "Walton" + NL() + "25" + NL() + "Sue" + NL() + "Day" + NL() + "32", + (MYXML = new XMLList(xmlDoc), MYXML.children().toString())); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_6.as b/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_6.as new file mode 100644 index 00000000000..d0ef050d264 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_6.as @@ -0,0 +1,89 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.5.4.6 - XMLList comments()"); + +//TEST(1, true, XMLList.prototype.hasOwnProperty("comments")); + +// !!@ very strange that this does find comments in the list but only in elements of the list + +var xmlDoc = "John California "; + +XML.prettyPrinting = true; +XML.ignoreComments = false; +AddTestCase( "XML.ignoreComments = false, MYXML = new XMLList(xmlDoc), MYXML.comments().toString()", + "", + (XML.ignoreComments = false, MYXML = new XMLList(xmlDoc), MYXML.comments().toString())); +AddTestCase( "XML.ignoreComments = false, MYXML = new XMLList(xmlDoc), MYXML.comments() instanceof XMLList", true, (MYXML = new XMLList(xmlDoc), MYXML.comments() instanceof XMLList)); +AddTestCase( "XML.ignoreComments = false, MYXML = new XMLList(xmlDoc), MYXML.comments() instanceof XML", false, (MYXML = new XMLList(xmlDoc), MYXML.comments() instanceof XML)); +AddTestCase( "XML.ignoreComments = false, MYXML = new XMLList(xmlDoc), MYXML.comments().length()", 1, (MYXML = new XMLList(xmlDoc), MYXML.comments().length() )); + +AddTestCase( "XML.ignoreComments = false, MYXML = new XMLList(xmlDoc), XML.ignoreComments = true, MYXML.comments().toString()", + "", + (XML.ignoreComments = false, MYXML = new XMLList(xmlDoc), XML.ignoreComments = true, MYXML.comments().toString())); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_7.as b/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_7.as new file mode 100644 index 00000000000..f1efbbaf236 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_7.as @@ -0,0 +1,95 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.5.4.7 - XMLList contains()"); + +//TEST(1, true, XMLList.prototype.hasOwnProperty("contains")); + +emps = + + Jim25 + Joe20 +; + +TEST(2, true, emps.employee.contains(Jim25)); +TEST(3, true, emps.employee.contains(Joe20)); +TEST(4, false, emps.employee.contains(Joe20)); + +var xmlDoc = "GiantsSan FranciscoPadresSan Diego"; +var xmlobj1 = "San Francisco"; +var xmlobj2 = "56 Hill Street"; + + +// XML object passed as value exists in the XML List +AddTestCase( "MYXML = new XMLList(xmlDoc),MYOBJ = new XML(xmlobj1), MYXML.contains(MYOBJ)",true, + (MYXML = new XMLList(xmlDoc),MYOBJ = new XML(xmlobj1), MYXML.contains(MYOBJ))); + +//XML object passed as value does not exist in the XML List +AddTestCase( "MYXML = new XMLList(xmlDoc), MYOBJ = new XML(xmlobj2), MYXML.contains(MYOBJ)",false, + (MYXML = new XMLList(xmlDoc), MYOBJ = new XML(xmlobj2), MYXML.contains(MYOBJ))); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_8.as b/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_8.as new file mode 100644 index 00000000000..387a398a10f --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_8.as @@ -0,0 +1,120 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.5.4.8 - XMLList copy()"); + +//TEST(1, true, XMLList.prototype.hasOwnProperty("copy")); + +emps = new XMLList(); +emps += Jim25; +emps += Joe20; + +correct = new XMLList(); +correct += Jim25; +correct += Joe20; + +TEST(2, emps, emps.copy()); +TEST(3, correct, emps.copy()); + +// Make sure we're getting a copy, not a ref to orig. +emps = new XMLList(); +emps += Jim25; +emps += Joe20; + +correct = new XMLList(); +correct += Jim25; +correct += Joe20; + +x1 = emps.copy(); + +emps += Sue32; + +TEST(4, correct, x1); + +XML.prettyPrinting = false; +var xmlDoc = "GiantsSan FranciscoPadresSan Diego"; + +AddTestCase( "MYXML = new XMLList(xmlDoc), XMLCOPY = MYXML.copy()", xmlDoc, + (MYXML = new XMLList(xmlDoc), XMLCOPY = MYXML.copy(), XMLCOPY.toString()) ); +AddTestCase( "MYXML = new XMLList(null), XMLCOPY = MYXML.copy()", "", + (MYXML = new XMLList(null), XMLCOPY = MYXML.copy(), XMLCOPY.toString()) ); +AddTestCase( "MYXML = new XMLList(undefined), XMLCOPY = MYXML.copy()", MYXML.toString(), + (MYXML = new XMLList(undefined), XMLCOPY = MYXML.copy(), XMLCOPY.toString()) ); +AddTestCase( "MYXML = new XMLList(), XMLCOPY = MYXML.copy()", MYXML.toString(), + (MYXML = new XMLList(), XMLCOPY = MYXML.copy(), XMLCOPY.toString()) ); +AddTestCase( "MYXML = new XMLList(xmlDoc), XMLCOPY = MYXML.Team.copy()", "Giants" + NL() + "Padres", + (MYXML = new XMLList(xmlDoc), XMLCOPY = MYXML.Team.copy(), XMLCOPY.toString()) ); + +// Make sure it's a copy +var MYXML = new XMLList(xmlDoc); +var MYXML2 = MYXML.copy(); +AddTestCase ("MYXML == MYXML.copy()", true, (MYXML == MYXML.copy())); +MYXML2.foo = "bar"; +//MYXML2 = new XML("hi"); +AddTestCase ("MYXML == MYXML2 where MYXML2 is a copy that has been changed", false, (MYXML == MYXML2)); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_9.as b/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_9.as new file mode 100644 index 00000000000..f85973b2553 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XMLList/e13_5_4_9.as @@ -0,0 +1,99 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.5.4.9 - XMLList descendants()"); + +//TEST(1, true, XMLList.prototype.hasOwnProperty("descendants")); + +XML.prettyPrinting = false; + +var xmlDoc = "barGiantsbarbarSan FranciscoPadresSan Diego"; + +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.descendants('Team')", "Giantsbar" + NL() + "Padres", + (MYXML = new XMLList(xmlDoc), MYXML.descendants('Team').toString()) ); +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.descendants('Team').length()", 2, + (MYXML = new XMLList(xmlDoc), MYXML.descendants('Team').length()) ); +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.descendants('Team') instanceof XMLList", true, + (MYXML = new XMLList(xmlDoc), MYXML.descendants('Team') instanceof XMLList) ); + +// find multiple levels of descendents +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.descendants('foo')", "bar" + NL() + "bar" + NL() + "bar", + (MYXML = new XMLList(xmlDoc), MYXML.descendants('foo').toString()) ); +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.descendants('foo').length()", 3, + (MYXML = new XMLList(xmlDoc), MYXML.descendants('foo').length()) ); +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.descendants('foo') instanceof XMLList", true, + (MYXML = new XMLList(xmlDoc), MYXML.descendants('foo') instanceof XMLList) ); + +// no matching descendents +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.descendants('nomatch')", "", + (MYXML = new XMLList(xmlDoc), MYXML.descendants('nomatch').toString()) ); +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.descendants('nomatch').length()", 0, + (MYXML = new XMLList(xmlDoc), MYXML.descendants('nomatch').length()) ); +AddTestCase( "MYXML = new XMLList(xmlDoc), MYXML.descendants('nomatch') instanceof XMLList", true, + (MYXML = new XMLList(xmlDoc), MYXML.descendants('nomatch') instanceof XMLList) ); + +END(); diff --git a/mozilla/js/tamarin/test/e4x/XMLList/kXMLOnlyWorksWithOneItemListsErr.as b/mozilla/js/tamarin/test/e4x/XMLList/kXMLOnlyWorksWithOneItemListsErr.as new file mode 100644 index 00000000000..8c3bb69e653 --- /dev/null +++ b/mozilla/js/tamarin/test/e4x/XMLList/kXMLOnlyWorksWithOneItemListsErr.as @@ -0,0 +1,354 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1997-2000 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Ethan Hugg + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +START("13.5 XMLList Objects - XML only works with one item lists error"); + +var xl; +var result, expected, expectedStr; + +xl = new XMLList("123"); +expectedStr = "TypeError: Error #1086: The addNamespace method works only on lists containing one item."; +expected = "Error #1086"; +result = "error, exception not thrown"; + +try{ + +xl.addNamespace('uri'); +throw new Error("kXMLOnlyWorksWithOneItemLists error not thrown"); + +} catch( e1 ){ + +result = grabError(e1, e1.toString()); + +} + +AddTestCase( "xmllist.addNamespace('uri')", expected, result ); + + + +xl = new XMLList("123"); +expectedStr = "TypeError: Error #1086: The appendChild method works only on lists containing one item."; +expected = "Error #1086"; +result = "error, exception not thrown"; + +try{ + +xl.appendChild("f"); +throw new Error("kXMLOnlyWorksWithOneItemLists error not thrown"); + +} catch( e2 ){ + +result = grabError(e2, e2.toString()); + +} + +AddTestCase( "xmllist.appendChild('f')", expected, result ); + + + +xl = new XMLList("123"); +expectedStr = "TypeError: Error #1086: The inScopeNamespaces method works only on lists containing one item."; +expected = "Error #1086"; +result = "error, exception not thrown"; + +try{ + +xl.inScopeNamespaces(); +throw new Error("kXMLOnlyWorksWithOneItemLists error not thrown"); + +} catch( e3 ){ + +result = grabError(e3, e3.toString()); + +} + +AddTestCase( "xmllist.inScopeNamespaces()", expected, result ); + + + +xl = new XMLList("123"); +expectedStr = "TypeError: Error #1086: The insertChildAfter method works only on lists containing one item."; +expected = "Error #1086"; +result = "error, exception not thrown"; + +try{ + +xl.insertChildAfter(null, "t"); +throw new Error("kXMLOnlyWorksWithOneItemLists error not thrown"); + +} catch( e4 ){ + +result = grabError(e4, e4.toString()); + +} + +AddTestCase( "xmllist.insertChildAfter(null, \"t\")", expected, result ); + + + +xl = new XMLList("123"); +expectedStr = "TypeError: Error #1086: The insertChildBefore method works only on lists containing one item."; +expected = "Error #1086"; +result = "error, exception not thrown"; + +try{ + +xl.insertChildBefore(null, "t"); +throw new Error("kXMLOnlyWorksWithOneItemLists error not thrown"); + +} catch( e5 ){ + +result = grabError(e5, e5.toString()); + +} + +AddTestCase( "xmllist.insertChildBefore(null, \"t\")", expected, result ); + + + +xl = new XMLList("123"); +expectedStr = "TypeError: Error #1086: The name method works only on lists containing one item."; +expected = "Error #1086"; +result = "error, exception not thrown"; + +try{ + +xl.name(); +throw new Error("kXMLOnlyWorksWithOneItemLists error not thrown"); + +} catch( e6 ){ + +result = grabError(e6, e6.toString()); + +} + +AddTestCase( "xmllist.name()", expected, result ); + + + +xl = new XMLList("123"); +expectedStr = "TypeError: Error #1086: The getNamespace method works only on lists containing one item."; +expected = "Error #1086"; +result = "error, exception not thrown"; + +try{ + +//xl.getNamespace("blah"); +myGetNamespace(xl, "blah"); +throw new Error("kXMLOnlyWorksWithOneItemLists error not thrown"); + +} catch( e7 ){ + +result = grabError(e7, e7.toString()); + +} + +AddTestCase( "xmllist.getNamespace(\"blah\")", expected, result ); + + + +xl = new XMLList("123"); +expectedStr = "TypeError: Error #1086: The namespaceDeclarations method works only on lists containing one item."; +expected = "Error #1086"; +result = "error, exception not thrown"; + +try{ + +xl.namespaceDeclarations(); +throw new Error("kXMLOnlyWorksWithOneItemLists error not thrown"); + +} catch( e8 ){ + +result = grabError(e8, e8.toString()); + +} + +AddTestCase( "xmllist.namespaceDeclarations()", expected, result ); + + + +xl = new XMLList("123"); +expectedStr = "TypeError: Error #1086: The nodeKind method works only on lists containing one item."; +expected = "Error #1086"; +result = "error, exception not thrown"; + +try{ + +xl.nodeKind(); +throw new Error("kXMLOnlyWorksWithOneItemLists error not thrown"); + +} catch( e9 ){ + +result = grabError(e9, e9.toString()); + +} + +AddTestCase( "xmllist.nodeKind()", expected, result ); + + + +xl = new XMLList("123"); +expectedStr = "TypeError: Error #1086: The removeNamespace method works only on lists containing one item."; +expected = "Error #1086"; +result = "error, exception not thrown"; + +try{ + +xl.removeNamespace('pfx'); +throw new Error("kXMLOnlyWorksWithOneItemLists error not thrown"); + +} catch( e10 ){ + +result = grabError(e10, e10.toString()); + +} + +AddTestCase( "xmllist.removeNamespace('pfx')", expected, result ); + + + +xl = new XMLList("123"); +expectedStr = "TypeError: Error #1086: The setChildren method works only on lists containing one item."; +expected = "Error #1086"; +result = "error, exception not thrown"; + +try{ + +xl.setChildren("45"); +throw new Error("kXMLOnlyWorksWithOneItemLists error not thrown"); + +} catch( e11 ){ + +result = grabError(e11, e11.toString()); + +} + +AddTestCase( "xmllist.setChildren(\"45\")", expected, result ); + + + +xl = new XMLList("123"); +expectedStr = "TypeError: Error #1086: The setLocalName method works only on lists containing one item."; +expected = "Error #1086"; +result = "error, exception not thrown"; + +try{ + +xl.setLocalName("new local name"); +throw new Error("kXMLOnlyWorksWithOneItemLists error not thrown"); + +} catch( e12 ){ + +result = grabError(e12, e12.toString()); + +} + +AddTestCase( "xmllist.setLocalName(\"new local name\")", expected, result ); + + + +xl = new XMLList("123"); +expectedStr = "TypeError: Error #1086: The setName method works only on lists containing one item."; +expected = "Error #1086"; +result = "error, exception not thrown"; + +try{ + +xl.setName("myName"); +throw new Error("kXMLOnlyWorksWithOneItemLists error not thrown"); + +} catch( e13 ){ + +result = grabError(e13, e13.toString()); + +} + +AddTestCase( "xmllist.setName(\"myName\")", expected, result ); + + + +xl = new XMLList("123"); +expectedStr = "TypeError: Error #1086: The setNamespace method works only on lists containing one item."; +expected = "Error #1086"; +result = "error, exception not thrown"; + +try{ + +xl.setNamespace("pfx"); +throw new Error("kXMLOnlyWorksWithOneItemLists error not thrown"); + +} catch( e14 ){ + +result = grabError(e14, e14.toString()); + +} + +AddTestCase( "xmllist.setNamespace(\"pfx\")", expected, result ); + + +END(); + diff --git a/mozilla/js/tamarin/test/ecma3/Array/e15_4_1.as b/mozilla/js/tamarin/test/ecma3/Array/e15_4_1.as new file mode 100644 index 00000000000..ee58dada1fa --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Array/e15_4_1.as @@ -0,0 +1,119 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.4.1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "The Array Constructor Called as a Function"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + var arr; + + array[item++] = new TestCase( SECTION, + "Array() +''", + "", + Array() +"" ); + + array[item++] = new TestCase( SECTION, + "typeof Array()", + "object", + typeof Array() ); + + array[item++] = new TestCase( SECTION, + "var arr = Array(); arr.getClass = Object.prototype.toString; arr.getClass()", + "[object Array]", + (arr = Array(), arr.getClass = Object.prototype.toString, arr.getClass() ) ); + + array[item++] = new TestCase( SECTION, + "var arr = Array(); arr.toString == Array.prototype.toString", + true, + (arr = Array(), arr.toString == Array.prototype.toString ) ); + + array[item++] = new TestCase( SECTION, + "Array().length", + 0, + Array().length ); + + + array[item++] = new TestCase( SECTION, + "Array(1,2,3) +''", + "1,2,3", + Array(1,2,3) +"" ); + + array[item++] = new TestCase( SECTION, + "typeof Array(1,2,3)", + "object", + typeof Array(1,2,3) ); + + array[item++] = new TestCase( SECTION, + "var arr = Array(1,2,3); arr.getClass = Object.prototype.toString; arr.getClass()", + "[object Array]", + (arr = Array(1,2,3), arr.getClass = Object.prototype.toString, arr.getClass() ) ); + + array[item++] = new TestCase( SECTION, + "var arr = Array(1,2,3); arr.toString == Array.prototype.toString", + true, + (arr = Array(1,2,3), arr.toString == Array.prototype.toString ) ); + + array[item++] = new TestCase( SECTION, + "Array(1,2,3).length", + 3, + Array(1,2,3).length ); + + array[item++] = new TestCase( SECTION, + "typeof Array(12345)", + "object", + typeof Array(12345) ); + + array[item++] = new TestCase( SECTION, + "var arr = Array(12345); arr.getClass = Object.prototype.toString; arr.getClass()", + "[object Array]", + (arr = Array(12345), arr.getClass = Object.prototype.toString, arr.getClass() ) ); + + array[item++] = new TestCase( SECTION, + "var arr = Array(1,2,3,4,5); arr.toString == Array.prototype.toString", + true, + (arr = Array(1,2,3,4,5), arr.toString == Array.prototype.toString ) ); + + array[item++] = new TestCase( SECTION, + "Array(12345).length", + 12345, + Array(12345).length ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Array/e15_4_1_1.as b/mozilla/js/tamarin/test/ecma3/Array/e15_4_1_1.as new file mode 100644 index 00000000000..2ec9ab96716 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Array/e15_4_1_1.as @@ -0,0 +1,73 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.4.1.1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Array Constructor Called as a Function"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function ToUint32( n ) { + n = Number( n ); + if( isNaN(n) || n == 0 || n == Number.POSITIVE_INFINITY || + n == Number.NEGATIVE_INFINITY ) { + return 0; + } + var sign = n < 0 ? -1 : 1; + + return ( sign * ( n * Math.floor( Math.abs(n) ) ) ) % Math.pow(2, 32); +} + +function getTestCases() { + var array:Array = new Array(); + var item:Number = 0; + + array[item++] = new TestCase( SECTION, "typeof Array(1,2)", "object", typeof Array(1,2) ); + array[item++] = new TestCase( SECTION, "(Array(1,2)).toString", "function Function() {}", ((Array(1,2)).toString).toString() ); + + + var thisErr:String = "no error"; + var arr:Array = Array(1,2,3); + arr.toString = Object.prototype.toString; + array[item++] = new TestCase( SECTION, + "var arr = Array(1,2,3); arr.toString = Object.prototype.toString; arr.toString()","[object Array]",arr.toString()); + + array[item++] = new TestCase( SECTION, "(Array(1,2)).length", 2, (Array(1,2)).length ); + array[item++] = new TestCase( SECTION, "var arr = (Array(1,2)), arr[0]", 1, (arr = (Array(1,2)), arr[0] ) ); + array[item++] = new TestCase( SECTION, "var arr = (Array(1,2)), arr[1]", 2, (arr = (Array(1,2)), arr[1] ) ); + array[item++] = new TestCase( SECTION, "var arr = (Array(1,2)), String(arr)", "1,2", (arr = (Array(1,2)), String(arr) ) ); + + return ( array ); +} + diff --git a/mozilla/js/tamarin/test/ecma3/Array/e15_4_1_2.as b/mozilla/js/tamarin/test/ecma3/Array/e15_4_1_2.as new file mode 100644 index 00000000000..3e6740c1016 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Array/e15_4_1_2.as @@ -0,0 +1,81 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.4.1.2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Array Constructor Called as a Function: Array(len)"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "(Array()).length", 0, (Array()).length ); + array[item++] = new TestCase( SECTION, "(Array(0)).length", 0, (Array(0)).length ); + array[item++] = new TestCase( SECTION, "(Array(1)).length", 1, (Array(1)).length ); + array[item++] = new TestCase( SECTION, "(Array(10)).length", 10, (Array(10)).length ); + array[item++] = new TestCase( SECTION, "(Array('1')).length", 1, (Array('1')).length ); + array[item++] = new TestCase( SECTION, "(Array(1000)).length", 1000, (Array(1000)).length ); + array[item++] = new TestCase( SECTION, "(Array('1000')).length", 1, (Array('1000')).length ); + array[item++] = new TestCase( SECTION, "(Array(4294967295)).length", ToUint32(4294967295), (Array(4294967295)).length ); + array[item++] = new TestCase( SECTION, "(Array(Math.pow(2,31)-1)).length", ToUint32(Math.pow(2,31)-1), (Array(Math.pow(2,31)-1)).length ); + array[item++] = new TestCase( SECTION, "(Array(Math.pow(2,31))).length", ToUint32(Math.pow(2,31)), (Array(Math.pow(2,31))).length ); + array[item++] = new TestCase( SECTION, "(Array(Math.pow(2,31)+1)).length", ToUint32(Math.pow(2,31)+1), (Array(Math.pow(2,31)+1)).length ); + array[item++] = new TestCase( SECTION, "(Array('8589934592')).length", 1, (Array("8589934592")).length ); + array[item++] = new TestCase( SECTION, "(Array('4294967296')).length", 1, (Array("4294967296")).length ); + array[item++] = new TestCase( SECTION, "(Array(1073741823)).length", ToUint32(1073741823), (Array(1073741823)).length ); + array[item++] = new TestCase( SECTION, "(Array(1073741824)).length", ToUint32(1073741824), (Array(1073741824)).length ); + array[item++] = new TestCase( SECTION, "(Array('a string')).length", 1, (Array("a string")).length ); + + return ( array ); +} + +function ToUint32( n ) { + n = Number( n ); + var sign = ( n < 0 ) ? -1 : 1; + + if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY) { + return 0; + } + n = sign * Math.floor( Math.abs(n) ) + + n = n % Math.pow(2,32); + + if ( n < 0 ){ + n += Math.pow(2,32); + } + + return ( n ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Array/e15_4_1_3.as b/mozilla/js/tamarin/test/ecma3/Array/e15_4_1_3.as new file mode 100644 index 00000000000..048bf4a7e1d --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Array/e15_4_1_3.as @@ -0,0 +1,70 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.4.1.3"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Array Constructor Called as a Function: Array()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, + "typeof Array()", + "object", + typeof Array() ); + + var MYARR; + + array[item++] = new TestCase( SECTION, + "MYARR = new Array();MYARR.getClass = Object.prototype.toString;MYARR.getClass()", + "[object Array]", + (MYARR = Array(),MYARR.getClass = Object.prototype.toString,MYARR.getClass()) ); + + array[item++] = new TestCase( SECTION, + "(Array()).length", + 0, ( + Array()).length ); + + array[item++] = new TestCase( SECTION, + "Array().toString()", + "", + Array().toString() ); + + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Array/e15_4_2.as b/mozilla/js/tamarin/test/ecma3/Array/e15_4_2.as new file mode 100644 index 00000000000..ead8e8ad108 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Array/e15_4_2.as @@ -0,0 +1,63 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.4-2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Array Objects"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var arr; + + array[item++] = new TestCase( SECTION, "var arr=new Array(), arr[Math.pow(2,16)] = 'hi', arr.length", Math.pow(2,16)+1, (arr=new Array(), arr[Math.pow(2,16)] = 'hi', arr.length ) ); + + array[item++] = new TestCase( SECTION, "var arr=new Array(), arr[Math.pow(2,30)-2] = 'hi', arr.length", Math.pow(2,30)-1, (arr=new Array(), arr[Math.pow(2,30)-2] = 'hi', arr.length ) ); + array[item++] = new TestCase( SECTION, "var arr=new Array(), arr[Math.pow(2,30)-1] = 'hi', arr.length", Math.pow(2,30), (arr=new Array(), arr[Math.pow(2,30)-1] = 'hi', arr.length ) ); + array[item++] = new TestCase( SECTION, "var arr=new Array(), arr[Math.pow(2,30)] = 'hi', arr.length", Math.pow(2,30)+1, (arr=new Array(), arr[Math.pow(2,30)] = 'hi', arr.length ) ); + + array[item++] = new TestCase( SECTION, "var arr=new Array(), arr[Math.pow(2,31)-2] = 'hi', arr.length", Math.pow(2,31)-1, (arr=new Array(), arr[Math.pow(2,31)-2] = 'hi', arr.length ) ); + array[item++] = new TestCase( SECTION, "var arr=new Array(), arr[Math.pow(2,31)-1] = 'hi', arr.length", Math.pow(2,31), (arr=new Array(), arr[Math.pow(2,31)-1] = 'hi', arr.length ) ); + array[item++] = new TestCase( SECTION, "var arr=new Array(), arr[Math.pow(2,31)] = 'hi', arr.length", Math.pow(2,31)+1, (arr=new Array(), arr[Math.pow(2,31)] = 'hi', arr.length ) ); + + array[item++] = new TestCase( SECTION, "var arr = new Array(0,1,2,3,4,5), arr.length = 2, String(arr)", "0,1", (arr = new Array(0,1,2,3,4,5), arr.length = 2, String(arr) ) ); + array[item++] = new TestCase( SECTION, "var arr = new Array(0,1), arr.length = 3, String(arr)", "0,1,", (arr = new Array(0,1), arr.length = 3, String(arr) ) ); +// array[item++] = new TestCase( SECTION, "var arr = new Array(0,1,2,3,4,5), delete arr[0], arr.length", 5, (arr = new Array(0,1,2,3,4,5), delete arr[0], arr.length ) ); +// array[item++] = new TestCase( SECTION, "var arr = new Array(0,1,2,3,4,5), delete arr[6], arr.length", 5, (arr = new Array(0,1,2,3,4,5), delete arr[6], arr.length ) ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Array/e15_4_2_1_1.as b/mozilla/js/tamarin/test/ecma3/Array/e15_4_2_1_1.as new file mode 100644 index 00000000000..ae9790a08a4 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Array/e15_4_2_1_1.as @@ -0,0 +1,61 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.4.2.1-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "The Array Constructor: new Array( item0, item1, ...)"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + var arr; + + array[item++] = new TestCase( SECTION, "typeof new Array(1,2)", "object", typeof new Array(1,2) ); + array[item++] = new TestCase( SECTION, "(new Array(1,2)).toString", "function Function() {}", ((new Array(1,2)).toString).toString() ); + array[item++] = new TestCase( SECTION, + "var arr = new Array(1,2,3); arr.getClass = Object.prototype.toString; arr.getClass()", + "[object Array]", + (arr = new Array(1,2,3), arr.getClass = Object.prototype.toString, arr.getClass() ) ); + + array[item++] = new TestCase( SECTION, "(new Array(1,2)).length", 2, (new Array(1,2)).length ); + array[item++] = new TestCase( SECTION, "var arr = (new Array(1,2)), arr[0]", 1, (arr = (new Array(1,2)), arr[0] ) ); + array[item++] = new TestCase( SECTION, "var arr = (new Array(1,2)), arr[1]", 2, (arr = (new Array(1,2)), arr[1] ) ); + array[item++] = new TestCase( SECTION, "var arr = (new Array(1,2)), String(arr)", "1,2", (arr = (new Array(1,2)), String(arr) ) ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Array/e15_4_2_1_2.as b/mozilla/js/tamarin/test/ecma3/Array/e15_4_2_1_2.as new file mode 100644 index 00000000000..7d21e4936ef --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Array/e15_4_2_1_2.as @@ -0,0 +1,69 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.4.2.1-2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "The Array Constructor: new Array( item0, item1, ...)"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + testcases = getTestCases(); + + test(); + +function getTestCases() +{ + var array = new Array(); + + //var TEST_STRING = "new Array("; + var ARGUMENTS = "" + var TEST_LENGTH = Math.pow(2,10); //Math.pow(2,32); + + for ( var index = 0; index < TEST_LENGTH; index++ ) + { + ARGUMENTS += index; + ARGUMENTS += (index == (TEST_LENGTH-1) ) ? "" : ","; + } + + //TEST_STRING += ARGUMENTS + ")"; + var TEST_STRING = ARGUMENTS.split(","); + + var TEST_ARRAY = TEST_STRING; + + for ( var item = 0; item < TEST_LENGTH; item++ ) + { + array[item] = new TestCase( SECTION, "["+item+"]", item+"", TEST_ARRAY[item] ); + } + + array[item++ ] = new TestCase( SECTION, "new Array( ["+TEST_LENGTH+" arguments] ) +''", ARGUMENTS, TEST_ARRAY +"" ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Array/e15_4_2_1_3.as b/mozilla/js/tamarin/test/ecma3/Array/e15_4_2_1_3.as new file mode 100644 index 00000000000..e40a1ef03e2 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Array/e15_4_2_1_3.as @@ -0,0 +1,73 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.4.2.1-3"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "The Array Constructor: new Array( item0, item1, ...)"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + + var ARGUMENTS = "" + var TEST_LENGTH = Math.pow(2,10); //Math.pow(2,32); + + for ( var index = 0; index < TEST_LENGTH; index++ ) { + ARGUMENTS += index; + ARGUMENTS += (index == (TEST_LENGTH-1) ) ? "" : ","; + } + + var TEST_ARRAY = ARGUMENTS.split(","); + + var item; + for ( item = 0; item < TEST_LENGTH; item++ ) { + array[item] = new TestCase( SECTION, "TEST_ARRAY["+item+"]", item+"", TEST_ARRAY[item] ); + } + + array[item++] = new TestCase( SECTION, "new Array( ["+TEST_LENGTH+" arguments] ) +''", ARGUMENTS, TEST_ARRAY +"" ); + array[item++] = new TestCase( SECTION, "TEST_ARRAY.toString", "function Function() {}", (TEST_ARRAY.toString).toString()); + array[item++] = new TestCase( SECTION, "TEST_ARRAY.join", "function Function() {}", (TEST_ARRAY.join).toString() ); + array[item++] = new TestCase( SECTION, "TEST_ARRAY.sort", "function Function() {}", (TEST_ARRAY.sort).toString() ); + array[item++] = new TestCase( SECTION, "TEST_ARRAY.reverse", "function Function() {}", (TEST_ARRAY.reverse).toString()); + array[item++] = new TestCase( SECTION, "TEST_ARRAY.length", TEST_LENGTH, TEST_ARRAY.length); + + TEST_ARRAY.toString = Object.prototype.toString; + array[item++] = new TestCase( SECTION, + "TEST_ARRAY.toString = Object.prototype.toString; TEST_ARRAY.toString()", + "[object Array]", + TEST_ARRAY.toString()); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Array/e15_4_2_2_1.as b/mozilla/js/tamarin/test/ecma3/Array/e15_4_2_2_1.as new file mode 100644 index 00000000000..9cc2e7f4d0c --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Array/e15_4_2_2_1.as @@ -0,0 +1,87 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.4.2.2-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "The Array Constructor: new Array( len )"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "new Array(0)", "", (new Array(0)).toString() ); + array[item++] = new TestCase( SECTION, "typeof new Array(0)", "object", (typeof new Array(0)) ); + array[item++] = new TestCase( SECTION, "(new Array(0)).length", 0, (new Array(0)).length ); + array[item++] = new TestCase( SECTION, "(new Array(0)).toString", "function Function() {}", ((new Array(0)).toString).toString() ); + + array[item++] = new TestCase( SECTION, "new Array(1)", "", (new Array(1)).toString() ); + array[item++] = new TestCase( SECTION, "new Array(1).length", 1, (new Array(1)).length ); + array[item++] = new TestCase( SECTION, "(new Array(1)).toString", "function Function() {}", ((new Array(1)).toString).toString() ); + + array[item++] = new TestCase( SECTION, "(new Array(-0)).length", 0, (new Array(-0)).length ); + array[item++] = new TestCase( SECTION, "(new Array(0)).length", 0, (new Array(0)).length ); + + array[item++] = new TestCase( SECTION, "(new Array(10)).length", 10, (new Array(10)).length ); + array[item++] = new TestCase( SECTION, "(new Array('1')).length", 1, (new Array('1')).length ); + array[item++] = new TestCase( SECTION, "(new Array(1000)).length", 1000, (new Array(1000)).length ); + array[item++] = new TestCase( SECTION, "(new Array('1000')).length", 1, (new Array('1000')).length ); + + array[item++] = new TestCase( SECTION, "(new Array(4294967295)).length", ToUint32(4294967295), (new Array(4294967295)).length ); + + array[item++] = new TestCase( SECTION, "(new Array('8589934592')).length", 1, (new Array("8589934592")).length ); + array[item++] = new TestCase( SECTION, "(new Array('4294967296')).length", 1, (new Array("4294967296")).length ); + array[item++] = new TestCase( SECTION, "(new Array(1073741824)).length", ToUint32(1073741824), (new Array(1073741824)).length ); + + return ( array ); +} + +function ToUint32( n ) { + n = Number( n ); + var sign = ( n < 0 ) ? -1 : 1; + + if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY) { + return 0; + } + n = sign * Math.floor( Math.abs(n) ) + + n = n % Math.pow(2,32); + + if ( n < 0 ){ + n += Math.pow(2,32); + } + + return ( n ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Array/e15_4_2_2_2.as b/mozilla/js/tamarin/test/ecma3/Array/e15_4_2_2_2.as new file mode 100644 index 00000000000..50142612a5a --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Array/e15_4_2_2_2.as @@ -0,0 +1,62 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.4.2.2-2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "The Array Constructor: new Array( len )"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + var arr; + +/* cn: these tests are invalid for ES4, where there is no distinction between a number and a Number + (i.e. 1000 === new Number(1000) + array[item++] = new TestCase( SECTION, "(new Array(new Number(1073741823))).length", 1, (new Array(new Number(1073741823))).length ); + array[item++] = new TestCase( SECTION, "(new Array(new Number(0))).length", 1, (new Array(new Number(0))).length ); + array[item++] = new TestCase( SECTION, "(new Array(new Number(1000))).length", 1, (new Array(new Number(1000))).length ); +*/ + array[item++] = new TestCase( SECTION, "(new Array(new Number(1073741823))).length", 1073741823, (new Array(new Number(1073741823))).length ); + array[item++] = new TestCase( SECTION, "(new Array(new Number(0))).length", 0, (new Array(new Number(0))).length ); + array[item++] = new TestCase( SECTION, "(new Array(new Number(1000))).length", 1000, (new Array(new Number(1000))).length ); + + array[item++] = new TestCase( SECTION, "(new Array('mozilla, larryzilla, curlyzilla')).length", 1, (new Array('mozilla, larryzilla, curlyzilla')).length ); + array[item++] = new TestCase( SECTION, "(new Array(true)).length", 1, (new Array(true)).length ); + array[item++] = new TestCase( SECTION, "(new Array(false)).length", 1, (new Array(false)).length); + array[item++] = new TestCase( SECTION, "(new Array(new Boolean(true)).length", 1, (new Array(new Boolean(true))).length ); + array[item++] = new TestCase( SECTION, "(new Array(new Boolean(false)).length", 1, (new Array(new Boolean(false))).length ); + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Array/e15_4_2_3.as b/mozilla/js/tamarin/test/ecma3/Array/e15_4_2_3.as new file mode 100644 index 00000000000..f6b974ba079 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Array/e15_4_2_3.as @@ -0,0 +1,60 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.4.2.3"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "The Array Constructor: new Array()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + var arr; + array[item++] = new TestCase( SECTION, "new Array() +''", "", (new Array()) +"" ); + array[item++] = new TestCase( SECTION, "typeof new Array()", "object", (typeof new Array()) ); + array[item++] = new TestCase( SECTION, + "var arr = new Array(); arr.getClass = Object.prototype.toString; arr.getClass()", + "[object Array]", + (arr = new Array(), arr.getClass = Object.prototype.toString, arr.getClass() ) ); + + array[item++] = new TestCase( SECTION, "(new Array()).length", 0, (new Array()).length ); + array[item++] = new TestCase( SECTION, "(new Array()).toString == Array.prototype.toString", true, (new Array()).toString == Array.prototype.toString ); + array[item++] = new TestCase( SECTION, "(new Array()).join == Array.prototype.join", true, (new Array()).join == Array.prototype.join ); + array[item++] = new TestCase( SECTION, "(new Array()).reverse == Array.prototype.reverse", true, (new Array()).reverse == Array.prototype.reverse ); + array[item++] = new TestCase( SECTION, "(new Array()).sort == Array.prototype.sort", true, (new Array()).sort == Array.prototype.sort ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Array/e15_4_3.as b/mozilla/js/tamarin/test/ecma3/Array/e15_4_3.as new file mode 100644 index 00000000000..d1f6b0a3ea6 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Array/e15_4_3.as @@ -0,0 +1,49 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.4.3"; + var VERSION = "ECMA_2"; + startTest(); + var TITLE = "Properties of the Array Constructor"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "Array.constructor.prototype",Object.constructor.prototype,Array.constructor.prototype); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Array/e15_4_3_1_2.as b/mozilla/js/tamarin/test/ecma3/Array/e15_4_3_1_2.as new file mode 100644 index 00000000000..80c5774b412 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Array/e15_4_3_1_2.as @@ -0,0 +1,76 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.4.3.1-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Array.prototype"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + var ARRAY_PROTO = Array.prototype; + + var props = ''; + for ( var p in Array ) { + props += p + } + array[item++] = new TestCase( SECTION, "var props = '', for ( p in Array ) { props += p } props", "", props ); + + // avmplus will throw a ReferenceError here. Becaue we are using const instead of enum, and this + // is expected(?) behavior when using const + var thisError:String = "no error"; + + + try{ + Array.prototype = null; + result = "no exception thrown" + + } catch (e:ReferenceError) { + thisError = e.toString(); + + + + } finally { + array[item++] = new TestCase( SECTION, "Array.prototype = null; Array.prototype ", +"ReferenceError: Error #1074", referenceError(thisError) ); + + } + array[item++] = new TestCase( SECTION, "delete Array.prototype", false, delete Array.prototype ); + array[item++] = new TestCase( SECTION, "delete Array.prototype; Array.prototype", ARRAY_PROTO, (delete Array.prototype, Array.prototype) ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Array/e15_4_3_2.as b/mozilla/js/tamarin/test/ecma3/Array/e15_4_3_2.as new file mode 100644 index 00000000000..ba23de59c7b --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Array/e15_4_3_2.as @@ -0,0 +1,47 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.4.3.2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Array.length"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, "Array.length", 1, Array.length ); + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Array/e15_4_4.as b/mozilla/js/tamarin/test/ecma3/Array/e15_4_4.as new file mode 100644 index 00000000000..da9c8ecfc94 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Array/e15_4_4.as @@ -0,0 +1,63 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.4.4"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Properties of the Array Prototype Object"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "Array.prototype.length", 0, Array.prototype.length ); + array[item++] = new TestCase( SECTION, "Array.length", 1, Array.length ); + +// verify that prototype object is an Array object. + array[item++] = new TestCase( SECTION, "typeof Array.prototype", "object", typeof Array.prototype ); + + if( playerType == "AVMPlus" ){ + // *************************************************************************************** + // ISSUE: + // this is causing problems in the ATS... it doesn't like Array.prototype.toString set!!! + // *************************************************************************************** + array[item++] = new TestCase( SECTION, + "Array.prototype.toString = Object.prototype.toString; Array.prototype.toString()", + "[object Array]", + (Array.prototype.toString = Object.prototype.toString, Array.prototype.toString()) ); + } + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Array/e15_4_4_1.as b/mozilla/js/tamarin/test/ecma3/Array/e15_4_4_1.as new file mode 100644 index 00000000000..87e6de03285 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Array/e15_4_4_1.as @@ -0,0 +1,50 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.4.4.1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Array.prototype.constructor"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + /* CN: Not true for ES4, Array.prototype is a vanilla Object, its constructor is Object. */ + array[item++] = new TestCase( SECTION, "Array.prototype.constructor == Array", true, Array.prototype.constructor == Array); + //array[item++] = new TestCase( SECTION, "Array.prototype.constructor == Object", true, Array.prototype.constructor == Object); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Array/e15_4_4_10.as b/mozilla/js/tamarin/test/ecma3/Array/e15_4_4_10.as new file mode 100644 index 00000000000..27f72b49ce2 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Array/e15_4_4_10.as @@ -0,0 +1,149 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = 'As described in Netscape doc "Whats new in JavaScript 1.2"'; + var VERSION = 'no version'; + startTest(); + var TITLE = 'String:slice'; + + writeHeaderToLog('Executing script: e15_4_4_10.as'); + writeHeaderToLog( SECTION + " "+ TITLE); + + var count = 0; + var testcases = new Array(); + + + function mySlice(a, from, to) + { + var from2 = from; + var to2 = to; + var returnArray = []; + var i; + + if (from2 < 0) from2 = a.length + from; + if (to2 < 0) to2 = a.length + to; + + if ((to2 > from2)&&(to2 > 0)&&(from2 < a.length)) + { + if (from2 < 0) from2 = 0; + if (to2 > a.length) to2 = a.length; + + for (i = from2; i < to2; ++i) returnArray.push(a[i]); + } + return returnArray; + } + + // This function tests the slice command on an Array + // passed in. The arguments passed into slice range in + // value from -5 to the length of the array + 4. Every + // combination of the two arguments is tested. The expected + // result of the slice(...) method is calculated and + // compared to the actual result from the slice(...) method. + // If the Arrays are not similar false is returned. + function exhaustiveSliceTest(testname, a) + { + var x = 0; + var y = 0; + var errorMessage; + var reason = ""; + var passed = true; + + for (x = -(2 + a.length); x <= (2 + a.length); x++) + for (y = (2 + a.length); y >= -(2 + a.length); y--) + { + var b = a.slice(x,y); + var c = mySlice(a,x,y); + + if (String(b) != String(c)) + { + errorMessage = + "ERROR: 'TEST FAILED' ERROR: 'TEST FAILED' ERROR: 'TEST FAILED'\n" + + " test: " + "a.slice(" + x + "," + y + ")\n" + + " a: " + String(a) + "\n" + + " actual result: " + String(b) + "\n" + + " expected result: " + String(c) + "\n"; + writeHeaderToLog(errorMessage); + reason = reason + errorMessage; + passed = false; + } + } + var testCase = new TestCase(SECTION, testname, true, passed); + if (passed == false) + testCase.reason = reason; + return testCase; + } + + var a = ['a','test string',456,9.34,new String("string object"),[],['h','i','j','k']]; + var b = [1,2,3,4,5,6,7,8,9,0]; + + testcases[count++] = exhaustiveSliceTest("exhaustive slice test 1", a); + testcases[count++] = exhaustiveSliceTest("exhaustive slice test 2", b); testcases[count++] = new TestCase(SECTION, "slice with end parameter undefined", "9.34,string object,,h,i,j,k", a.slice(3)+""); + testcases[count++] = new TestCase(SECTION, "slice with both parameters undefined", "1,2,3,4,5,6,7,8,9,0", b.slice()+""); + testcases[count++] = new TestCase(SECTION, "slice with start parameter undefined", "1,2,3,4,5", b.slice(undefined,5)+""); + + //slice method can be transferred to other objects for use as method + + var obj = new Object(); + obj.slice = Array.prototype.slice; + obj.length = 7; + obj[0] = 'a'; + obj[1] = 'test string'; + obj[2] = 456; + obj[3] = 9.34; + obj[4] = new String("string object"); + obj[5] = []; + obj[6] = ['h','i','j','k'] + + testcases[count++] = exhaustiveSliceTest("exhaustive slice test 3", obj); + + var obj2 = new Object(); + obj2.slice = Array.prototype.slice; + obj2.length = 10; + obj2[0] = 0; + obj2[1] = 1; + obj2[2] = 2; + obj2[3] = 3; + obj2[4] = 4; + obj2[5] = 5; + obj2[6] = 6; + obj2[7] = 7; + obj2[8] = 8; + obj2[9] = 9; + + testcases[count++] = exhaustiveSliceTest("exhaustive slice test 4", obj2); + + testcases[count++] = new TestCase(SECTION, "slice with end parameter undefined", "9.34,string object,,h,i,j,k", obj.slice(3)+""); + testcases[count++] = new TestCase(SECTION, "slice with both parameters undefined", "0,1,2,3,4,5,6,7,8,9", obj2.slice()+""); + testcases[count++] = new TestCase(SECTION, "slice with start parameter undefined", "0,1,2,3,4", obj2.slice(undefined,5)+""); + testcases[count++] = new TestCase(SECTION, "Length property of slice method", 2, Array.prototype.slice.length); + + test(); + diff --git a/mozilla/js/tamarin/test/ecma3/Array/e15_4_4_11.as b/mozilla/js/tamarin/test/ecma3/Array/e15_4_4_11.as new file mode 100644 index 00000000000..f1594f724ce --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Array/e15_4_4_11.as @@ -0,0 +1,102 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * File Name: e15_4_4_11.as + * ECMA Section: 15.4.4.11 Array.prototype.sort() + * Description: Test Case for sort function of Array Class. + * The elements of the array are sorted. + * The sort is not necessary stable (this is, elements + * that compare equal do not necessarily remain in their + * original order. + + * + * Author: Gagneet Singh (gasingh@macromedia.com) + * Date: 01/09/2005 + * + */ + +var SECTION = "15.4.4.11"; +var TITLE = "Array.sort"; + +var VERSION = "ECMA_3"; + +startTest(); + +writeHeaderToLog( SECTION + " " + TITLE); + + +var testcases = getTestCases(); + +test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // Check for only numeric values. + var MYARR = new Array( 2, 1, 8, 6 ); + var EXPARR = [1,2,6,8]; + + MYARR.sort() + + for (var MYVAR = 0; ( MYVAR < MYARR.length ); MYVAR++) + { + array[item++] = new TestCase( SECTION, "MYARR = [2,1,8,6]; MYARR.sort()", EXPARR[MYVAR], MYARR[MYVAR] ); + } + + + // Check for only alpha-numeric values. + var MYARR = new Array( 'a', 'd', 'Z', 'f', 'M' ); + var EXPARR = ['M', 'Z', 'a', 'd', 'f']; + + MYARR.sort() + + for (var MYVAR = 0; ( MYVAR < MYARR.length ); MYVAR++) + { + array[item++] = new TestCase( SECTION, "MYARR = ['a','d','Z','f','M']; MYARR.sort()", EXPARR[MYVAR], MYARR[MYVAR] ); + } + + + // Check for numeric and alpha-numeric values. + var MYARR = new Array( 2, 1, 'M', 'y', 'X', 66, 104 ); + var EXPARR = [1, 104, 2, 66, 'M', 'X', 'y']; + + MYARR.sort() + + for (var MYVAR = 0; ( MYVAR < MYARR.length ); MYVAR++) + { + array[item++] = new TestCase( SECTION, "MYARR = [2, 1, 'M', 'X', 'y', 66, 104]; MYARR.sort()", EXPARR[MYVAR], MYARR[MYVAR] ); + } + + + return ( array ); + +} diff --git a/mozilla/js/tamarin/test/ecma3/Array/e15_4_4_12.as b/mozilla/js/tamarin/test/ecma3/Array/e15_4_4_12.as new file mode 100644 index 00000000000..0177d4c6da5 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Array/e15_4_4_12.as @@ -0,0 +1,82 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * File Name: e15_4_4_12.as + * ECMA Section: 15.4.4.10 Array.prototype.splice() + * Description: Test Case for push function of Array Class. + * The method takes 2 arguments - start and end. + * It returns an array containing the elements of + * the array from element start upto but not including + * the element end. + * If end is undefined then end is the last element. + * If start is negative, it is treated as (length+start) + * where length is the length of the array. + + * + * Author: Gagneet Singh (gasingh@macromedia.com) + * Date: 01/09/2005 + * + */ + +var SECTION = "15.4.4.12"; +var TITLE = "Array.splice"; + +var VERSION = "ECMA_3"; + +startTest(); + +writeHeaderToLog( SECTION + " " + TITLE); + + +var testcases = getTestCases(); + +test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var MYARR = new Array(); + MYARR = [0, 2, 3, 4, 5]; + + var RESULTARR = MYARR.splice(1); + + var EXPCTARR = [ 2, 3, 4, 5 ] + + for (var MYVAR = 0; ( MYVAR < RESULTARR.length ); MYVAR++) + { + array[item++] = new TestCase( SECTION, "MYARR = new Array( 0, 2, 3, 4, 5 ); MYARR.splice(1);", EXPCTARR[MYVAR], RESULTARR[MYVAR] ); + } + + + return ( array ); + +} diff --git a/mozilla/js/tamarin/test/ecma3/Array/e15_4_4_13.as b/mozilla/js/tamarin/test/ecma3/Array/e15_4_4_13.as new file mode 100644 index 00000000000..0c9adf6e7ff --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Array/e15_4_4_13.as @@ -0,0 +1,104 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * File Name: e15_4_4_13.as + * ECMA Section: 15.4.4.13 Array.unshift() + * Description: Test Case for unshift function of Array Class. + * The arguments given to unshift are prepended to the start + * of the array, such that their order within the array is the + * same as the order in which they appear in the argument list. + + * + * Author: Gagneet Singh (gasingh@macromedia.com) + * Date: 01/09/2005 + * Modified By: Subha Subramanian + * Date: 01/05/2006 + * Details: Added test cases to test the length of the unshift method, unshift * without any parameters and to test that the unshift can be + * transferred to other objects for use as method + */ + +var SECTION = "15.4.4.13"; +var TITLE = "Array.unshift"; + +var VERSION = "ECMA_3"; + +startTest(); + +writeHeaderToLog( SECTION + " " + TITLE); + + +var testcases = getTestCases(); + +test(); + +function getTestCases() { + var array = new Array(); + var myobj = new Object(); + var item = 0; + + array[item++] = new TestCase( SECTION, "Array.prototype.unshift.length;",0, Array.prototype.unshift.length); + + var MYEMPTYARR = new Array(); + + array[item++] = new TestCase( SECTION, "MYEMPTYARR = new Array();MYEMPTYARR.unshift();", 0, MYEMPTYARR.unshift() ); + array[item++] = new TestCase( SECTION, "MYEMPTYARR = new Array();MYEMPTYARR.unshift(0);", 1, MYEMPTYARR.unshift(0) ); + + + var MYARR = new Array(); + MYARR.push( 1, 2 ); + + + var MYVAR:Number = 3 + + array[item++] = new TestCase( SECTION, "MYARR = new Array(); MYARR.push(1, 2); MYARR.unshift(0);", MYVAR, MYARR.unshift(0) ); + + for (var i = 0;i= limit; i-- ) { + S[item] += "\'"+ String.fromCharCode(i) +"\'" ; + if ( i > limit ) { + S[item] += ","; + } + } + */ + + S[item] = (A = new Array(( 0x007A - 0x0061) + 1) ); + + var limit = 0x0061; + var index = 0; + for ( var i = 0x007A; i >= limit; i-- ) { + A[index++] = String.fromCharCode(i); + } + + item++; + + for ( var i = 0; i < S.length; i++ ) { + CheckItems( S[i] ); + } +} +function CheckItems( S ) { + var A = S; + var E = Sort( A ); + + testcases[testcases.length] = new TestCase( SECTION, + S +"; A.sort(); A.length", + E.length, + (A = S, A.sort(), A.length) ); + + for ( var i = 0; i < E.length; i++ ) { + testcases[testcases.length] = new TestCase( + SECTION, + "A["+i+ "].toString()", + E[i] +"", + A[i] +""); + + if ( A[i] == void 0 && typeof A[i] == "undefined" ) { + testcases[testcases.length] = new TestCase( + SECTION, + "typeof A["+i+ "]", + typeof E[i], + typeof A[i] ); + } + } +} +function Sort( a ) { + for ( var i = 0; i < a.length; i++ ) { + for ( var j = i+1; j < a.length; j++ ) { + var lo = a[i]; + var hi = a[j]; + var c = Compare( lo, hi ); + if ( c == 1 ) { + a[i] = hi; + a[j] = lo; + } + } + } + return a; +} +function Compare( x, y ) { + if ( x == void 0 && y == void 0 && typeof x == "undefined" && typeof y == "undefined" ) { + return +0; + } + if ( x == void 0 && typeof x == "undefined" ) { + return 1; + } + if ( y == void 0 && typeof y == "undefined" ) { + return -1; + } + x = String(x); + y = String(y); + if ( x < y ) { + return -1; + } + if ( x > y ) { + return 1; + } + return 0; +} diff --git a/mozilla/js/tamarin/test/ecma3/Array/e15_4_4_5_2.as b/mozilla/js/tamarin/test/ecma3/Array/e15_4_4_5_2.as new file mode 100644 index 00000000000..b12b667216d --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Array/e15_4_4_5_2.as @@ -0,0 +1,163 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + var SECTION = "15.4.4.5-2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Array.prototype.sort(comparefn)"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = new Array(); + getTestCases(); + test(); + +function getTestCases() { + var S = new Array(); + var item = 0; + + // array is empty. + var A = new Array(); + S[item++] = A; + + // array contains one item + A = new Array( true ); + S[item++] = A; + + // length of array is 2 + A = new Array( true, false, new Boolean(true), new Boolean(false), 'true', 'false' ) + S[item++] = A; + + + A = new Array(); + A[3] = 'undefined'; + A[6] = null; + A[8] = 'null'; + A[0] = void 0; + S[item++] = A; + + /* + S[item] = "var A = new Array( "; + + var limit = 0x0061; + for ( var i = 0x007A; i >= limit; i-- ) { + S[item] += "\'"+ String.fromCharCode(i) +"\'" ; + if ( i > limit ) { + S[item] += ","; + } + } + */ + A = new Array(( 0x007A - 0x0061) + 1); + S[item] = A; + var limit = 0x0061; + var index = 0; + for ( var i = 0x007A; i >= limit; i-- ) { + A[index++] = String.fromCharCode(i); + } + + for ( var i = 0; i < S.length; i++ ) { + CheckItems( S[i] ); + } + +} +function CheckItems( S ) { + var A = S; + var E = Sort( A ); + A = S; + A.sort(Compare); + testcases[testcases.length] = new TestCase( SECTION, + S +"; A.sort(Compare); A.length", + E.length, + A.length); + + for ( var i = 0; i < E.length; i++ ) { + testcases[testcases.length] = new TestCase( + SECTION, + "A["+i+ "].toString()", + E[i] +"", + A[i] +""); + + if ( A[i] == void 0 && typeof A[i] == "undefined" ) { + testcases[testcases.length] = new TestCase( + SECTION, + "typeof A["+i+ "]", + typeof E[i], + typeof A[i] ); + } + } +} +/* +function Object_1( value ) { + this.array = value.split(","); + this.length = this.array.length; + for ( var i = 0; i < this.length; i++ ) { + this[i] = this.array[i]; + } + this.sort = Array.prototype.sort; + this.getClass = Object.prototype.toString; +} +*/ +function Sort( a ) { + var r1 = a.length; + for ( var i = 0; i < a.length; i++ ) { + for ( var j = i+1; j < a.length; j++ ) { + var lo = a[i]; + var hi = a[j]; + var c = Compare( lo, hi ); + if ( c == 1 ) { + a[i] = hi; + a[j] = lo; + } + } + } + return a; +} +function Compare( x, y ) { + if ( x == void 0 && y == void 0 && typeof x == "undefined" && typeof y == "undefined" ) { + return +0; + } + if ( x == void 0 && typeof x == "undefined" ) { + return 1; + } + if ( y == void 0 && typeof y == "undefined" ) { + return -1; + } + x = String(x); + y = String(y); + if ( x < y ) { + return 1; + } + if ( x > y ) { + return -1; + } + return 0; +} diff --git a/mozilla/js/tamarin/test/ecma3/Array/e15_4_4_5_3.as b/mozilla/js/tamarin/test/ecma3/Array/e15_4_4_5_3.as new file mode 100644 index 00000000000..9cc8cad6502 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Array/e15_4_4_5_3.as @@ -0,0 +1,162 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + var SECTION = "15.4.4.5-3"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Array.prototype.sort(comparefn)"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = new Array(); + getTestCases(); + test("no actual"); // don't want the actual results printed to output + +function getTestCases() { + var array = new Array(); + + array[array.length] = new Date( TIME_2000 * Math.PI ); + array[array.length] = new Date( TIME_2000 * 10 ); + array[array.length] = new Date( TIME_1900 + TIME_1900 ); + array[array.length] = new Date(0); + array[array.length] = new Date( TIME_2000 ); + array[array.length] = new Date( TIME_1900 + TIME_1900 +TIME_1900 ); + array[array.length] = new Date( TIME_1900 * Math.PI ); + array[array.length] = new Date( TIME_1900 * 10 ); + array[array.length] = new Date( TIME_1900 ); + array[array.length] = new Date( TIME_2000 + TIME_2000 ); + array[array.length] = new Date( 1899, 0, 1 ); + array[array.length] = new Date( 2000, 1, 29 ); + array[array.length] = new Date( 2000, 0, 1 ); + array[array.length] = new Date( 1999, 11, 31 ); + + var testarr1 = new Array() + clone( array, testarr1 ); + testarr1.sort( comparefn1 ); + + var testarr2 = new Array() + clone( array, testarr2 ); + testarr2.sort( comparefn2 ); + + var testarr3 = new Array(); + clone( array, testarr3 ); + testarr3.sort( comparefn3 ); + + // when there's no sort function, sort sorts by the toString value of Date. + + var testarr4 = new Array() + clone( array, testarr4 ); + testarr4.sort(); + + var realarr = new Array(); + clone( array, realarr ); + realarr.sort( realsort ); + + var stringarr = new Array(); + clone( array, stringarr ); + stringarr.sort( stringsort ); + + for ( var i = 0, tc = 0; i < array.length; i++, tc++) { + testcases[tc] = new TestCase( + SECTION, + "testarr1["+i+"]", + realarr[i], + testarr1[i] ); + } + + for ( var i=0; i < array.length; i++, tc++) { + testcases[tc] = new TestCase( + SECTION, + "testarr2["+i+"]", + realarr[i], + testarr2[i] ); + } + + for ( var i=0; i < array.length; i++, tc++) { + testcases[tc] = new TestCase( + SECTION, + "testarr3["+i+"]", + realarr[i], + testarr3[i] ); + } + + for ( var i=0; i < array.length; i++, tc++) { + testcases[tc] = new TestCase( + SECTION, + "testarr4["+i+"]", + stringarr[i].toString(), + testarr4[i].toString() ); + } + +} +function comparefn1( x, y ) { + return x - y; +} +function comparefn2( x, y ) { + return x.valueOf() - y.valueOf(); +} +function realsort( x, y ) { + return ( x.valueOf() == y.valueOf() ? 0 : ( x.valueOf() > y.valueOf() ? 1 : -1 ) ); +} +function comparefn3( x, y ) { + return ( x == y ? 0 : ( x > y ? 1: -1 ) ); +} +function clone( source, target ) { + for (var i = 0; i < source.length; i++ ) { + target[i] = source[i]; + } +} +function stringsort( x, y ) { + for ( var i = 0; i < x.toString().length; i++ ) { + var d = (x.toString()).charCodeAt(i) - (y.toString()).charCodeAt(i); + if ( d > 0 ) { + return 1; + } else { + if ( d < 0 ) { + return -1; + } else { + continue; + } + } + + var d = x.length - y.length; + + if ( d > 0 ) { + return 1; + } else { + if ( d < 0 ) { + return -1; + } + } + } + return 0; +} diff --git a/mozilla/js/tamarin/test/ecma3/Array/e15_4_4_6.as b/mozilla/js/tamarin/test/ecma3/Array/e15_4_4_6.as new file mode 100644 index 00000000000..8df0c7a820b --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Array/e15_4_4_6.as @@ -0,0 +1,118 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * File Name: e15_4_4_6.as + * ECMA Section: 15.4.4.6 Array.prototype.pop() + * Description: Test Case for pop function of Array Class. + * The last element is removed from the array and returned. + * 1. Call the [[Get]] method of this object with argument "length". + * 2. Call ToUint32(Result(1)). + * 3. If Result(2) is not zero, go to step 6. + * 4. Call the [[Put]] method of this object with arguments "length" and Result(2). + * 5. Return undefined. + * 6. Call ToString(Result(2)-1). + * 7. Call the [[Get]] method of this object with argument Result(6). + * 8. Call the [[Delete]] method of this object with argument Result(6). + * 9. Call the [[Put]] method of this object with arguments "length" and (Result(2)-1). + * 10. Return Result(7). + + * Notes: + * The pop function is intentionally generic; it does not require that its 'this' value + * be an Array object. + * Therefore it can be transferred to other kinds of objects for use as a method. + * Whether the pop function can be applied successfully to a host object is implementation-dependent. + + * + * Author: Gagneet Singh (gasingh@macromedia.com) + * Date: 01/09/2005 + * Modified By: Subha Subramanian + * Date: 01/04/2006(Added test cases for calling pop() method on an array * that is empty and test case for transferring pop method to other object which is not an * array + * + */ + +var SECTION = "15.4.4.6"; +var TITLE = "Array.pop"; + +var VERSION = "ECMA_3"; + +startTest(); + +writeHeaderToLog( SECTION + " " + TITLE); + + +var testcases = getTestCases(); + +test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var MYEMPTYARRAY = new Array(); + array[item++] = new TestCase( SECTION, "MYEMPTYARRAY = new Array(); MYEMPTYARRAY.pop();", undefined, MYEMPTYARRAY.pop()); + + // Create an array from which we will pop an element. + var MYARR = new Array( 2, 1, 8, 6 ); + var EXPARR = [ 2, 1, 8 ]; + + + var EXP_RESULT = MYARR.pop(); + + array[item++] = new TestCase( SECTION, "MYARR = [2,1,8,6]; MYARR.pop();", 6, EXP_RESULT ); + + for (var MYVAR = 0; ( MYVAR < MYARR.length ); MYVAR++) + { + array[item++] = new TestCase( SECTION, "MYARR = [2,1,8,6]; MYARR.pop();", EXPARR[MYVAR], MYARR[MYVAR] ); + } + + //pop method is generic so can be transferred to other types of objects + var obj = new Object(); + obj.pop = Array.prototype.pop; + obj.length = 4; + obj[0] = 2; + obj[1] = 1; + obj[2] = 8; + obj[3] = 6; + + var EXP_OBJRESULT = obj.pop(); + + array[item++] = new TestCase( SECTION, "obj.pop()", 6, EXP_OBJRESULT ); + + for (var MYVAR1 = 0; ( MYVAR1 < obj.length ); MYVAR1++) + { + array[item++] = new TestCase( SECTION, "obj.pop()", EXPARR[MYVAR1], obj[MYVAR1] ); + } + + + + return ( array ); + +} diff --git a/mozilla/js/tamarin/test/ecma3/Array/e15_4_4_6_1.as b/mozilla/js/tamarin/test/ecma3/Array/e15_4_4_6_1.as new file mode 100644 index 00000000000..28939838316 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Array/e15_4_4_6_1.as @@ -0,0 +1,86 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * File Name: e15_4_4_6.as + * ECMA Section: 15.4.4.6 Array.prototype.pop() + * Description: Test Case for pop function of Array Class. + * The last element is removed from the array and returned. + * 1. Call the [[Get]] method of this object with argument "length". + * 2. Call ToUint32(Result(1)). + * 3. If Result(2) is not zero, go to step 6. + * 4. Call the [[Put]] method of this object with arguments "length" and Result(2). + * 5. Return undefined. + * 6. Call ToString(Result(2)-1). + * 7. Call the [[Get]] method of this object with argument Result(6). + * 8. Call the [[Delete]] method of this object with argument Result(6). + * 9. Call the [[Put]] method of this object with arguments "length" and (Result(2)-1). + * 10. Return Result(7). + + * This test case is for checking if the length of + * a non initailized array after poping is zero or not. + * Given by Werner Sharp (wsharp@macromedia.com) + + * + * Author: Gagneet Singh (gasingh@macromedia.com) + * Date: 01/09/2005 + * + */ + +var SECTION = "15.4.4.6"; +var TITLE = "Array.pop"; + +var VERSION = "ECMA_3"; + +startTest(); + +writeHeaderToLog( SECTION + " " + TITLE); + + +var testcases = getTestCases(); + +test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + + // Initialize a new Array Object. + var MYARR = new Array(); + + MYARR.pop() + + // Check if the length of the array is equivalent to 0 or not? + array[item++] = new TestCase( SECTION, "MYARR = []; MYARR.pop(); MYARR.length;", 0, MYARR.length ); + + return ( array ); + +} diff --git a/mozilla/js/tamarin/test/ecma3/Array/e15_4_4_7.as b/mozilla/js/tamarin/test/ecma3/Array/e15_4_4_7.as new file mode 100644 index 00000000000..8d96ed18974 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Array/e15_4_4_7.as @@ -0,0 +1,107 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * File Name: e15_4_4_7.as + * ECMA Section: 15.4.4.7 Array.prototype.push() + * Description: Test Case for push function of Array Class. + * The arguments are appended to the end of the array, + * in the order in which they appear. The new length of + * the array is returned as a result of the call. + + * + * Author: Gagneet Singh (gasingh@macromedia.com) + * Date: 01/09/2005 + * + */ + +var SECTION = "15.4.4.7"; +var TITLE = "Array.push"; + +var VERSION = "ECMA_3"; + +startTest(); + +writeHeaderToLog( SECTION + " " + TITLE); + + +var testcases = getTestCases(); + +test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var MYEMPTYARR:Array= new Array(); + + var EMPTYARRLENGTH = 0; + + array[item++] = new TestCase( SECTION, "MYEMPTYARR = new Array(); MYEMPTYARR.push();", EMPTYARRLENGTH, MYEMPTYARR.push() ); + + var MYEMPTYARRLENGTHAFTERPUSH = 1; + + array[item++] = new TestCase( SECTION, "MYEMPTYARR = new Array(); MYEMPTYARR.push(2);", MYEMPTYARRLENGTHAFTERPUSH, MYEMPTYARR.push(2) ); + + array[item++] = new TestCase( SECTION, "MYEMPTYARR = new Array(); MYEMPTYARR[0];", 2, MYEMPTYARR[0] ); + + + var MYARR = new Array( 1, 4 ); + + var MYVAR = 2; + var ARRLENGTH = 3; + + array[item++] = new TestCase( SECTION, "MYARR = new Array(); MYARR.push();", 2, MYARR.push() ); + + + array[item++] = new TestCase( SECTION, "MYARR = new Array(); MYARR.push(2);", ARRLENGTH, MYARR.push(MYVAR) ); + + //push function is intentionally generic. It does not require its this value to be //an array object + + var obj = new Object(); + obj.push = Array.prototype.push; + obj.length = 4 + obj[0]=0; + obj[1]=1; + obj[2]=2; + obj[3]=3; + + array[item++] = new TestCase( SECTION, "var obj = new Object(); obj.push(4);", 5, obj.push(4) ); + + var MYBIGARR = [] + + for (var i=0;i<101;i++){ + MYBIGARR[MYBIGARR.length] = i; + } + + array[item++] = new TestCase( SECTION, "var MYBIGARR[i] = i; MYBIGARR.push(101);", 102, MYBIGARR.push(101) ); + return ( array ); + +} diff --git a/mozilla/js/tamarin/test/ecma3/Array/e15_4_4_8.as b/mozilla/js/tamarin/test/ecma3/Array/e15_4_4_8.as new file mode 100644 index 00000000000..1e4c713f50b --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Array/e15_4_4_8.as @@ -0,0 +1,113 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * File Name: e15_4_4_8.as + * ECMA Section: 15.4.4.8 Array.prototype.reverse() + * Description: Test Case for reverse function of Array Class. + * The elements of the array are rearranged so as to reverse their order. + * The object is returned as the result of the call. + * 1. Call the [[Get]] method of this object with argument "length". + * 2. Call ToUint32(Result(1)). + * 3. Compute floor(Result(2)/2). + * 4. Let k be 0. + * 5. If k equals Result(3), return this object. + * 6. Compute Result(2)-k-1. + * 7. Call ToString(k). + * 8. Call ToString(Result(6)). + * 9. Call the [[Get]] method of this object with argument Result(7). + * 10. Call the [[Get]] method of this object with argument Result(8). + * 11. If this object does not have a property named by Result(8), go to step 19. + * 12. If this object does not have a property named by Result(7), go to step 16. + * 13. Call the [[Put]] method of this object with arguments Result(7) and Result(10). + * 14. Call the [[Put]] method of this object with arguments Result(8) and Result(9). + * 15. Go to step 25. + * 16. Call the [[Put]] method of this object with arguments Result(7) and Result(10). + * 17. Call the [[Delete]] method on this object, providing Result(8) as the name of the property to + * delete. + * 18. Go to step 25. + * 19. If this object does not have a property named by Result(7), go to step 23. + * 20. Call the [[Delete]] method on this object, providing Result(7) as the name of the property to + * delete.. + * 21. Call the [[Put]] method of this object with arguments Result(8) and Result(9). + * 22. Go to step 25. + * 23. Call the [[Delete]] method on this object, providing Result(7) as the name of the property to + * delete. + * 24. Call the [[Delete]] method on this object, providing Result(8) as the name of the property to + * delete. + * 25. Increase k by 1. + * 26. Go to step 5. + * + * Note: + * The reverse function is intentionally generic; it does not require that its this value be an Array + * object. Therefore, it can be transferred to other kinds of objects for use as a method. Whether the + * reverse function can be applied successfully to a host object is implementation-dependent. + + * + * Author: Gagneet Singh (gasingh@macromedia.com) + * Date: 01/09/2005 + * + */ + +var SECTION = "15.4.4.8"; +var TITLE = "Array.reverse"; + +var VERSION = "ECMA_3"; + +startTest(); + +writeHeaderToLog( SECTION + " " + TITLE); + + +var testcases = getTestCases(); + +test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // Create an array from which we will reverse the elements of the array. + var MYARR = new Array( 2, 1, 8, 6 ); + var EXPARR = [ 6, 8, 1, 2 ]; + + + MYARR.reverse(); + + + for (var MYVAR = 0; ( MYVAR < MYARR.length ); MYVAR++) + { + array[item++] = new TestCase( SECTION, "MYARR = [2,1,8,6]; MYARR.reverse();", EXPARR[MYVAR], MYARR[MYVAR] ); + } + + + return ( array ); + +} diff --git a/mozilla/js/tamarin/test/ecma3/Array/e15_4_4_9.as b/mozilla/js/tamarin/test/ecma3/Array/e15_4_4_9.as new file mode 100644 index 00000000000..e8125d661cf --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Array/e15_4_4_9.as @@ -0,0 +1,137 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * File Name: e15_4_4_9.as + * ECMA Section: 15.4.4.9 Array.prototype.shift() + * Description: Test Case for reverse function of Array Class. + * The first element of the array is removed from the array and returned. + * + * 1. Call the [[Get]] method of this object with argument "length". + * 2. Call ToUint32(Result(1)). + * 3. If Result(2) is not zero, go to step 6. + * 4. Call the [[Put]] method of this object with arguments "length" and Result(2). + * 5. Return undefined. + * 6. Call the [[Get]] method of this object with argument 0. + * 7. Let k be 1. + * 8. If k equals Result(2), go to step 18. + * 9. Call ToString(k). + * 10. Call ToString(k-1). + * 11. If this object has a property named by Result(9), go to step 12; but if this object has no property + * named by Result(9), then go to step 15. + * 12. Call the [[Get]] method of this object with argument Result(9). + * 13. Call the [[Put]] method of this object with arguments Result(10) and Result(12). + * 14. Go to step 16. + * 15. Call the [[Delete]] method of this object with argument Result(10). + * 16. Increase k by 1. + * 17. Go to step 8. + * 18. Call the [[Delete]] method of this object with argument ToString(Result(2)-1). + * 19. Call the [[Put]] method of this object with arguments "length" and (Result(2)-1). + * 20. Return Result(6). + * + * Note: + * The shift function is intentionally generic; it does not require that its this value be an Array object. + * Therefore it can be transferred to other kinds of objects for use as a method. Whether the shift + * function can be applied successfully to a host object is implementation-dependent. + + * + * Author: Gagneet Singh (gasingh@macromedia.com) + * Date: 01/09/2005 + * Modified By: Subha Subramanian + * Date: 01/04/2006 + * Added test cases to test shift function called on an empty array and test cases to test * shift function on other objects which are not array objects + */ + +var SECTION = "15.4.4.9"; +var TITLE = "Array.shift"; + +var VERSION = "ECMA_3"; + +startTest(); + +writeHeaderToLog( SECTION + " " + TITLE); + + +var testcases = getTestCases(); + +test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var MYEMPTYARR = new Array(); + + array[item++] = new TestCase( SECTION, "MYEMPTYARR = []; MYEMPTYARR.shift();", undefined, MYEMPTYARR.shift() ); + + + // Create an array from which we will shift an element. + var MYARR = new Array( 2, 1, 8, 6 ); + var EXPARR = [ 1, 8, 6 ]; + + array[item++] = new TestCase( SECTION, "MYARR = [2,1,8,6]; MYARR.shift();", 2, MYARR.shift() ); + + + + for (var MYVAR = 0; ( MYVAR < EXPARR.length ); MYVAR++) + { + array[item++] = new TestCase( SECTION, "MYARR = [2,1,8,6]; MYARR.shift();", EXPARR[MYVAR], MYARR[MYVAR] ); + } + + + array[item++] = new TestCase( SECTION, "MYARR = [2,1,8,6]; MYARR.shift();MYARR.length", 3, MYARR.length ); + + + var MYBIGARR = [] + + for (var i = 0; i<101; i++){ + MYBIGARR[MYBIGARR.length] = i; + } + + array[item++] = new TestCase( SECTION, "MYBIGARR = [0,1,2,.....,100]; MYBIGARR.shift();", 0, MYBIGARR.shift() ); + + array[item++] = new TestCase( SECTION, "MYBIGARR = [0,1,2,.....,100]; MYBIGARR.shift();MYBIGARR.length", 100, MYBIGARR.length ); + + //shift method is not generic it can transferred to other objects for use as method + var obj = new Object(); + obj.shift = Array.prototype.shift; + obj.length = 4; + obj[0] = 0; + obj[1] = 1; + obj[2] = 2; + obj[3] = 3; + + array[item++] = new TestCase( SECTION, "obj = new Object(); obj.shift()", 0, obj.shift() ); + + array[item++] = new TestCase( SECTION, "obj = new Object(); obj.shift();obj.length", 3, obj.length ); + + return ( array ); + +} diff --git a/mozilla/js/tamarin/test/ecma3/Array/e15_4_4_9_1.as b/mozilla/js/tamarin/test/ecma3/Array/e15_4_4_9_1.as new file mode 100644 index 00000000000..63ce2b1f16b --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Array/e15_4_4_9_1.as @@ -0,0 +1,105 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * File Name: e15_4_4_9.as + * ECMA Section: 15.4.4.9 Array.prototype.shift() + * Description: Test Case for reverse function of Array Class. + * The first element of the array is removed from the array and returned. + * + * 1. Call the [[Get]] method of this object with argument "length". + * 2. Call ToUint32(Result(1)). + * 3. If Result(2) is not zero, go to step 6. + * 4. Call the [[Put]] method of this object with arguments "length" and Result(2). + * 5. Return undefined. + * 6. Call the [[Get]] method of this object with argument 0. + * 7. Let k be 1. + * 8. If k equals Result(2), go to step 18. + * 9. Call ToString(k). + * 10. Call ToString(k-1). + * 11. If this object has a property named by Result(9), go to step 12; but if this object has no property + * named by Result(9), then go to step 15. + * 12. Call the [[Get]] method of this object with argument Result(9). + * 13. Call the [[Put]] method of this object with arguments Result(10) and Result(12). + * 14. Go to step 16. + * 15. Call the [[Delete]] method of this object with argument Result(10). + * 16. Increase k by 1. + * 17. Go to step 8. + * 18. Call the [[Delete]] method of this object with argument ToString(Result(2)-1). + * 19. Call the [[Put]] method of this object with arguments "length" and (Result(2)-1). + * 20. Return Result(6). + * + * Note: + * The shift function is intentionally generic; it does not require that its this value be an Array object. + * Therefore it can be transferred to other kinds of objects for use as a method. Whether the shift + * function can be applied successfully to a host object is implementation-dependent. + + * This test case is for checking if the length of + * a non initailized array after shifting; is zero or not. + * Given by Werner Sharp (wsharp@macromedia.com) + + * + * Author: Gagneet Singh (gasingh@macromedia.com) + * Date: 01/09/2005 + * + */ + +var SECTION = "15.4.4.9"; +var TITLE = "Array.shift"; + +var VERSION = "ECMA_3"; + +startTest(); + +writeHeaderToLog( SECTION + " " + TITLE); + + +var testcases = getTestCases(); + +test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // Create an array from which we will shift an element. + var MYARR = new Array(); + + // As the array is not initialized with any elements, we should get a value of zero + // for the length of the array. + MYARR.shift(); + + + array[item++] = new TestCase( SECTION, "MYARR = []; MYARR.shift(); MYARR.length", 0, MYARR.length ); + + + return ( array ); + +} diff --git a/mozilla/js/tamarin/test/ecma3/Array/e15_4_5_1_1.as b/mozilla/js/tamarin/test/ecma3/Array/e15_4_5_1_1.as new file mode 100644 index 00000000000..e29ef1fc9c4 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Array/e15_4_5_1_1.as @@ -0,0 +1,163 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.4.5.1-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Array [[Put]] (P, V)"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + + var item = 0; + + // P is "length" + + array[item++] = new TestCase( SECTION, + "var A = new Array(); A.length = 1000; A.length", + 1000, + (A = new Array(), A.length = 1000, A.length ) ); + + // A has Property P, and P is not length or an array index + array[item++] = new TestCase( SECTION, + "var A = new Array(1000); A.name = 'name of this array'; A.name", + 'name of this array', + (A = new Array(1000), A.name = 'name of this array', A.name ) ); + + array[item++] = new TestCase( SECTION, + "var A = new Array(1000); A.name = 'name of this array'; A.length", + 1000, + (A = new Array(1000), A.name = 'name of this array', A.length ) ); + + + // A has Property P, P is not length, P is an array index, and ToUint32(p) is less than the + // value of length + + array[item++] = new TestCase( SECTION, + "var A = new Array(1000); A[123] = 'hola'; A[123]", + 'hola', + (A = new Array(1000), A[123] = 'hola', A[123] ) ); + + array[item++] = new TestCase( SECTION, + "var A = new Array(1000); A[123] = 'hola'; A.length", + 1000, + (A = new Array(1000), A[123] = 'hola', A.length ) ); + + + /* + for ( var i = 0X0020, TEST_STRING = "var A = new Array( " ; i < 0x00ff; i++ ) { + TEST_STRING += "\'\\"+ String.fromCharCode( i ) +"\'"; + if ( i < 0x00FF - 1 ) { + TEST_STRING += ","; + } else { + TEST_STRING += ");" + } + } + */ + var TEST_STRING; + var LENGTH = 0x00ff - 0x0020; + var A = new Array(); + var index = 0; + for ( var i = 0X0020; i < 0x00ff; i++ ) { + A[index++] = String.fromCharCode( i ); + } + + array[item++] = new TestCase( SECTION, + TEST_STRING +" A[150] = 'hello'; A[150]", + 'hello', + (A[150] = 'hello', A[150]) ); + + array[item++] = new TestCase( SECTION, + TEST_STRING +" A[150] = 'hello', A.length", + LENGTH, + (A[150] = 'hello', A.length) ); + + // A has Property P, P is not length, P is an array index, and ToUint32(p) is not less than the + // value of length + + array[item++] = new TestCase( SECTION, + "var A = new Array(); A[123] = true; A.length", + 124, + (A = new Array(), A[123] = true, A.length ) ); + + array[item++] = new TestCase( SECTION, + "var A = new Array(0,1,2,3,4,5,6,7,8,9,10); A[15] ='15'; A.length", + 16, + (A = new Array(0,1,2,3,4,5,6,7,8,9,10), A[15] ='15', A.length ) ); + + // !!@ As of 04jan05, the AVM+ does not like the (i <= 10) line (where '15' is a different type than void 0) + for ( var i = 0; i < A.length; i++, item++ ) { + var temp; + if (i <= 10) + temp = i; + else if (i == 15) + temp = '15'; + else + temp = void 0; + + array[item] = new TestCase( SECTION, + "var A = new Array(0,1,2,3,4,5,6,7,8,9,10); A[15] ='15'; A[" +i +"]", + temp, //(i <= 10) ? i : ( i == 15 ? '15' : void 0 ), + A[i] ); + } + // P is not an array index, and P is not "length" + + try{ + thisErr = "no error"; + var A = new Array(); A.join.length = 4; A.join.length; + }catch(e:ReferenceError){ + thisErr = e.toString(); + } finally{ + array[item++] = new TestCase(SECTION, + "var A = new Array(); A.join.length = 4; A.join.length", + "ReferenceError: Error #1074", + referenceError(thisErr)); + } + + try{ + thisErr = "no error"; + var A = new Array(); A.join.length = 4; A.length; + }catch(e:ReferenceError){ + thisErr = e.toString(); + } finally{ + array[item++] = new TestCase(SECTION, + "var A = new Array(); A.join.length = 4; A.length", + "ReferenceError: Error #1074", + referenceError(thisErr)); + } + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Array/e15_4_5_1_2.as b/mozilla/js/tamarin/test/ecma3/Array/e15_4_5_1_2.as new file mode 100644 index 00000000000..d126da580aa --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Array/e15_4_5_1_2.as @@ -0,0 +1,104 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.4.5.1-2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Array [[Put]] (P,V)"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = new Array(); + + var a = new Array(); + + AddCase( "3.00", "three" ); + AddCase( "00010", "eight" ); + AddCase( "37xyz", "thirty-five" ); + AddCase("5000000000", 5) + AddCase( "-2", -3 ); + + testcases[tc++] = new TestCase( SECTION, + "a[10]", + void 0, + a[10] ); + + testcases[tc++] = new TestCase( SECTION, + "a[3]", + void 0, + a[3] ); + + a[4] = "four"; + + testcases[tc++] = new TestCase( SECTION, + "a[4] = \"four\"; a[4]", + "four", + a[4] ); + + testcases[tc++] = new TestCase( SECTION, + "a[\"4\"]", + "four", + a["4"] ); + + testcases[tc++] = new TestCase( SECTION, + "a[\"4.00\"]", + void 0, + a["4.00"] ); + + testcases[tc++] = new TestCase( SECTION, + "a.length", + 5, + a.length ); + + + a["5000000000"] = 5; + + testcases[tc++] = new TestCase( SECTION, + "a[\"5000000000\"] = 5; a.length", + 5, + a.length ); + + testcases[tc++] = new TestCase( SECTION, + "a[\"-2\"] = -3; a.length", + 5, + a.length ); + + test(); + +function AddCase ( arg, value ) { + + a[arg] = value; + + testcases[tc++] = new TestCase( SECTION, + "a[\"" + arg + "\"] = "+ value +"; a.length", + 0, + a.length ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Array/e15_4_5_2_1.as b/mozilla/js/tamarin/test/ecma3/Array/e15_4_5_2_1.as new file mode 100644 index 00000000000..cafeb8bec75 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Array/e15_4_5_2_1.as @@ -0,0 +1,84 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.4.5.2-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Array.length"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, + "var A = new Array(); A.length", + 0, + (A = new Array(), A.length ) ); + + array[item++] = new TestCase( SECTION, + "var A = new Array(); A[Math.pow(2,32)-2] = 'hi'; A.length", + Math.pow(2,32)-1, + (A = new Array(), A[Math.pow(2,32)-2] = 'hi', A.length ) ); + + array[item++] = new TestCase( SECTION, + "var A = new Array(); A.length = 123; A.length", + 123, + (A = new Array(), A.length = 123, A.length ) ); + + var A = new Array(); + A.length = 123; + var PROPS = ''; + for ( var p in A ) { + if (p == 'length') + PROPS += p; + } + + array[item++] = new TestCase( SECTION, + "var A = new Array(); A.length = 123; var PROPS = ''; for ( var p in A ) { PROPS += ( p == 'length' ? p : ''); } PROPS", + "", + PROPS ); + + + array[item++] = new TestCase( SECTION, + "var A = new Array(); A.length = 123; delete A.length", + false , + (A = new Array(), A.length = 123, delete A.length ) ); + + array[item++] = new TestCase( SECTION, + "var A = new Array(); A.length = 123; delete A.length; A.length", + 123, + (A = new Array(), A.length = 123, delete A.length, A.length ) ); + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Array/e15_4_5_2_2.as b/mozilla/js/tamarin/test/ecma3/Array/e15_4_5_2_2.as new file mode 100644 index 00000000000..b40872c95ec --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Array/e15_4_5_2_2.as @@ -0,0 +1,105 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.4.5.2-2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Array.length"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = new Array(); + + addCase( new Array(), 0, Math.pow(2,14), Math.pow(2,14) ); + + addCase( new Array(), 0, 1, 1 ); + + addCase( new Array(Math.pow(2,12)), Math.pow(2,12), 0, 0 ); + addCase( new Array(Math.pow(2,13)), Math.pow(2,13), Math.pow(2,12), Math.pow(2,12) ); + addCase( new Array(Math.pow(2,12)), Math.pow(2,12), Math.pow(2,12), Math.pow(2,12) ); + addCase( new Array(Math.pow(2,14)), Math.pow(2,14), Math.pow(2,12), Math.pow(2,12) ) + + // some tests where array is not empty + // array is populated with strings + var length = Math.pow(2,12); + var a = new Array(length); + for (var i = 0; i < Math.pow(2,12); i++ ) { + a[i] = i; + } + addCase( a, i, i, i ); + addCase( a, i, Math.pow(2,12)+i+1, Math.pow(2,12)+i+1, true ); + addCase( a, Math.pow(2,12)+5, 0, 0, true ); + + test(); + +function addCase( object, old_len, set_len, new_len, ... rest) { + var checkitems; + if( rest.length == 1 ){ + checkitems = rest[0]; + } + + object.length = set_len; + + testcases[testcases.length] = new TestCase( SECTION, + "array = new Array("+ old_len+"); array.length = " + set_len + + "; array.length", + new_len, + object.length ); + + if ( checkitems ) { + // verify that items between old and newlen are all undefined + if ( new_len < old_len ) { + var passed = true; + for ( var i = new_len; i < old_len; i++ ) { + if ( object[i] != void 0 ) { + passed = false; + } + } + testcases[testcases.length] = new TestCase( SECTION, + "verify that array items have been deleted", + true, + passed ); + } + if ( new_len > old_len ) { + var passed = true; + for ( var i = old_len; i < new_len; i++ ) { + if ( object[i] != void 0 ) { + passed = false; + } + } + testcases[testcases.length] = new TestCase( SECTION, + "verify that new items are undefined", + true, + passed ); + } + } + +} diff --git a/mozilla/js/tamarin/test/ecma3/Array/e15_4__1.as b/mozilla/js/tamarin/test/ecma3/Array/e15_4__1.as new file mode 100644 index 00000000000..6427563c610 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Array/e15_4__1.as @@ -0,0 +1,112 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.4-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Array Objects"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + var myarr; + + array[item++] = new TestCase( SECTION, + "var myarr = new Array(); myarr[Math.pow(2,32)-2]='hi'; myarr[Math.pow(2,32)-2]", + "hi", + (myarr = new Array(), myarr[Math.pow(2,32)-2]='hi', myarr[Math.pow(2,32)-2] ) + ); + array[item++] = new TestCase( SECTION, + "var myarr = new Array(); myarr[Math.pow(2,32)-2]='hi'; myarr.length", + (Math.pow(2,32)-1), + (myarr = new Array(), myarr[Math.pow(2,32)-2]='hi', myarr.length ) + ); + array[item++] = new TestCase( SECTION, + "var myarr = new Array(); myarr[Math.pow(2,32)-3]='hi'; myarr[Math.pow(2,32)-3]", + "hi", + (myarr = new Array(), myarr[Math.pow(2,32)-3]='hi', myarr[Math.pow(2,32)-3] ) + ); + array[item++] = new TestCase( SECTION, + "var myarr = new Array(); myarr[Math.pow(2,32)-3]='hi'; myarr.length", + (Math.pow(2,32)-2), + (myarr = new Array(), myarr[Math.pow(2,32)-3]='hi', myarr.length ) + ); + + array[item++] = new TestCase( SECTION, + "var myarr = new Array(); myarr[Math.pow(2,31)-2]='hi'; myarr[Math.pow(2,31)-2]", + "hi", + (myarr = new Array(), myarr[Math.pow(2,31)-2]='hi', myarr[Math.pow(2,31)-2] ) + ); + array[item++] = new TestCase( SECTION, + "var myarr = new Array(); myarr[Math.pow(2,31)-2]='hi'; myarr.length", + (Math.pow(2,31)-1), + (myarr = new Array(), myarr[Math.pow(2,31)-2]='hi', myarr.length ) + ); + + array[item++] = new TestCase( SECTION, + "var myarr = new Array(); myarr[Math.pow(2,31)-1]='hi'; myarr[Math.pow(2,31)-1]", + "hi", + (myarr = new Array(), myarr[Math.pow(2,31)-1]='hi', myarr[Math.pow(2,31)-1] ) + ); + array[item++] = new TestCase( SECTION, + "var myarr = new Array(); myarr[Math.pow(2,31)-1]='hi'; myarr.length", + (Math.pow(2,31)), + (myarr = new Array(), myarr[Math.pow(2,31)-1]='hi', myarr.length ) + ); + + + array[item++] = new TestCase( SECTION, + "var myarr = new Array(); myarr[Math.pow(2,31)]='hi'; myarr[Math.pow(2,31)]", + "hi", + (myarr = new Array(), myarr[Math.pow(2,31)]='hi', myarr[Math.pow(2,31)] ) + ); + array[item++] = new TestCase( SECTION, + "var myarr = new Array(); myarr[Math.pow(2,31)]='hi'; myarr.length", + (Math.pow(2,31)+1), + (myarr = new Array(), myarr[Math.pow(2,31)]='hi', myarr.length ) + ); + + array[item++] = new TestCase( SECTION, + "var myarr = new Array(); myarr[Math.pow(2,30)-2]='hi'; myarr[Math.pow(2,30)-2]", + "hi", + (myarr = new Array(), myarr[Math.pow(2,30)-2]='hi', myarr[Math.pow(2,30)-2] ) + ); + array[item++] = new TestCase( SECTION, + "var myarr = new Array(); myarr[Math.pow(2,30)-2]='hi'; myarr.length", + (Math.pow(2,30)-1), + (myarr = new Array(), myarr[Math.pow(2,30)-2]='hi', myarr.length ) + ); + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Array/eregress_130451.as b/mozilla/js/tamarin/test/ecma3/Array/eregress_130451.as new file mode 100644 index 00000000000..de2c3c443ac --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Array/eregress_130451.as @@ -0,0 +1,229 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* ***** BEGIN LICENSE BLOCK ***** +* Version: NPL 1.1/GPL 2.0/LGPL 2.1 +* +* The contents of this file are subject to the Netscape Public License +* Version 1.1 (the "License"); you may not use this file except in +* compliance with the License. You may obtain a copy of the License at +* http://www.mozilla.org/NPL/ +* +* Software distributed under the License is distributed on an "AS IS" basis, +* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +* for the specific language governing rights and limitations under the +* License. +* +* The Original Code is JavaScript Engine testing utilities. +* +* The Initial Developer of the Original Code is Netscape Communications Corp. +* Portions created by the Initial Developer are Copyright (C) 2002 +* the Initial Developer. All Rights Reserved. +* +* Contributor(s): brendan@mozilla.org, pschwartau@netscape.com +* +* Alternatively, the contents of this file may be used under the terms of +* either the GNU General Public License Version 2 or later (the "GPL"), or +* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +* in which case the provisions of the GPL or the LGPL are applicable instead +* of those above. If you wish to allow use of your version of this file only +* under the terms of either the GPL or the LGPL, and not to allow others to +* use your version of this file under the terms of the NPL, indicate your +* decision by deleting the provisions above and replace them with the notice +* and other provisions required by the GPL or the LGPL. If you do not delete +* the provisions above, a recipient may use your version of this file under +* the terms of any one of the NPL, the GPL or the LGPL. +* +* ***** END LICENSE BLOCK ***** +* +* +* Date: 25 Mar 2002 +* SUMMARY: Array.prototype.sort() should not (re-)define .length +* See http://bugzilla.mozilla.org/show_bug.cgi?id=130451 +* +* From the ECMA-262 Edition 3 Final spec: +* +* NOTE: The sort function is intentionally generic; it does not require that +* its |this| value be an Array object. Therefore, it can be transferred to +* other kinds of objects for use as a method. Whether the sort function can +* be applied successfully to a host object is implementation-dependent. +* +* The interesting parts of this testcase are the contrasting expectations for +* Brendan's test below, when applied to Array objects vs. non-Array objects. +* +* Modified: 28th October 2004 (gasingh@macromedia.com) +* Removed the occurence of new Function('abc'). +* This is being changed to function() { abc }. +* +* +*/ +//----------------------------------------------------------------------------- + var SECTION = "eregress_130451"; + var VERSION = "ECMA"; + var TITLE = "Array.prototype.sort() should not (re-)define .length"; + var bug = "130451"; + + startTest(); + writeHeaderToLog( SECTION + " "+ TITLE); + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var status = ''; + var actual = ''; + var expect= ''; + var arr = []; + var cmp = function() {}; + + /* + * First: test Array.prototype.sort() on Array objects + */ + status = inSection(1); + arr = [0,1,2,3]; + cmp = function(x,y) {return x-y;}; + actual = arr.sort(cmp).length; + expect = 4; + array[item++] = new TestCase(SECTION, "section 1", expect, actual ); + + status = inSection(2); + arr = [0,1,2,3]; + cmp = function(x,y) {return y-x;}; + actual = arr.sort(cmp).length; + expect = 4; + array[item++] = new TestCase(SECTION, "section 2", expect, actual ); + + status = inSection(3); + arr = [0,1,2,3]; + cmp = function(x,y) {return x-y;}; + arr.length = 1; + actual = arr.sort(cmp).length; + expect = 1; + array[item++] = new TestCase(SECTION, "section 3", expect, actual ); + + /* + * This test is by Brendan. Setting arr.length to + * 2 and then 4 should cause elements to be deleted. + */ + arr = [0,1,2,3]; + cmp = function(x,y) {return x-y;}; + arr.sort(cmp); + + status = inSection(4); + actual = arr.join(); + expect = '0,1,2,3'; + array[item++] = new TestCase(SECTION, "section 4", expect, actual ); + + status = inSection(5); + actual = arr.length; + expect = 4; + array[item++] = new TestCase(SECTION, "section 5", expect, actual ); + + status = inSection(6); + arr.length = 2; + actual = arr.join(); + expect = '0,1'; + array[item++] = new TestCase(SECTION, "section 6", expect, actual ); + + status = inSection(7); + arr.length = 4; + actual = arr.join(); + expect = '0,1,,'; //<---- see how 2,3 have been lost + array[item++] = new TestCase(SECTION, "section 7", expect, actual ); + + + + /* + * Now test Array.prototype.sort() on non-Array objects + */ + + + status = inSection(8); + var obj = new Object(); + obj.sort = Array.prototype.sort; + obj.length = 4; + obj[0] = 0; + obj[1] = 1; + obj[2] = 2; + obj[3] = 3; + cmp = function(x,y) {return x-y;}; + actual = obj.sort(cmp).length; + expect = 4; + array[item++] = new TestCase(SECTION, "section 8", expect, actual ); + + + /* + * Here again is Brendan's test. Unlike the array case + * above, the setting of obj.length to 2 and then 4 + * should NOT cause elements to be deleted + */ + obj = new Object(); + obj.sort = Array.prototype.sort; + obj.length = 4; + obj[0] = 3; + obj[1] = 2; + obj[2] = 1; + obj[3] = 0; + cmp = function(x,y) {return x-y;}; + obj.sort(cmp); //<---- this is what triggered the buggy behavior below + obj.join = Array.prototype.join; + + status = inSection(9); + actual = obj.join(); + expect = '0,1,2,3'; + array[item++] = new TestCase(SECTION, "section 9", expect, actual ); + + status = inSection(10); + actual = obj.length; + expect = 4; + array[item++] = new TestCase(SECTION, "section 10", expect, actual ); + + status = inSection(11); + obj.length = 2; + actual = obj.join(); + expect = '0,1'; + array[item++] = new TestCase(SECTION, "section 11", expect, actual ); + + /* + * Before this bug was fixed, |actual| held the value '0,1,,' + * as in the Array-object case at top. This bug only occurred + * if Array.prototype.sort() had been applied to |obj|, + * as we have done higher up. + */ + status = inSection(12); + obj.length = 4; + actual = obj.join(); + expect = '0,1,2,3'; + array[item++] = new TestCase(SECTION, "section 12", expect, actual ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Array/general1.as b/mozilla/js/tamarin/test/ecma3/Array/general1.as new file mode 100644 index 00000000000..2470f97be42 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Array/general1.as @@ -0,0 +1,68 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = 'As described in Netscape doc "Whats new in JavaScript 1.2"'; + var VERSION = 'no version'; + startTest(); + var TITLE = 'String:push,unshift,shift'; + + writeHeaderToLog('Executing script: general1.js'); + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var array1 = []; + + array1.push(123); //array1 = [123] + array1.push("dog"); //array1 = [123,dog] + array1.push(-99); //array1 = [123,dog,-99] + array1.push("cat"); //array1 = [123,dog,-99,cat] + array[item++] = new TestCase( SECTION, "array1.pop()", array1.pop(),'cat'); + //array1 = [123,dog,-99] + array1.push("mouse"); //array1 = [123,dog,-99,mouse] + array[item++] = new TestCase( SECTION, "array1.shift()", array1.shift(),123); + //array1 = [dog,-99,mouse] + array1.unshift(96); //array1 = [96,dog,-99,mouse] + array[item++] = new TestCase( SECTION, "state of array", String([96,"dog",-99,"mouse"]), String(array1)); + array[item++] = new TestCase( SECTION, "array1.length", array1.length,4); + array1.shift(); //array1 = [dog,-99,mouse] + array1.shift(); //array1 = [-99,mouse] + array1.shift(); //array1 = [mouse] + array[item++] = new TestCase( SECTION, "array1.shift()", array1.shift(),"mouse"); + array[item++] = new TestCase( SECTION, "array1.shift()", "undefined", String(array1.shift())); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Array/general2.as b/mozilla/js/tamarin/test/ecma3/Array/general2.as new file mode 100644 index 00000000000..454ce3bf729 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Array/general2.as @@ -0,0 +1,84 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = 'As described in Netscape doc "Whats new in JavaScript 1.2"'; + var VERSION = 'no version'; + startTest(); + var TITLE = 'String:push,splice,concat,unshift,sort'; + + writeHeaderToLog('Executing script: general2.js'); + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var array1 = new Array(); + var array2 = []; + var size = 10; + + // this for loop populates array1 and array2 as follows: + // array1 = [0,1,2,3,4,....,size - 2,size - 1] + // array2 = [size - 1, size - 2,...,4,3,2,1,0] + for (var i = 0; i < size; i++) + { + array1.push(i); + array2.push(size - 1 - i); + } + + // the following for loop reverses the order of array1 so + // that it should be similarly ordered to array2 + var array3; + for (i = array1.length; i > 0; i--) + { + array3 = array1.slice(1,i); + array1.splice(1,i-1); + array1 = array3.concat(array1); + } + + // the following for loop reverses the order of array1 + // and array2 + for (i = 0; i < size; i++) + { + array1.push(array1.shift()); + array2.unshift(array2.pop()); + } + + array[item++] = new TestCase( SECTION, "Array.push,pop,shift,unshift,slice,splice", true,String(array1) == String(array2)); + array1.sort(); + array2.sort(); + array[item++] = new TestCase( SECTION, "Array.sort", true,String(array1) == String(array2)); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Array/general3.as b/mozilla/js/tamarin/test/ecma3/Array/general3.as new file mode 100644 index 00000000000..28fccb1cf45 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Array/general3.as @@ -0,0 +1,106 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = 'As described in Netscape doc "Whats new in JavaScript 1.2"'; + var VERSION = 'no version'; + startTest(); + var TITLE = 'String:push,splice,concat,unshift,sort'; + + writeHeaderToLog('Executing script: general3.as'); + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var array1 = new Array(); + var array2 = []; + var array5 = [0,1,2,3,4,5,6,7,8,9]; + var array6 = [9,8,7,6,5,4,3,2,1,0]; + var size = 10; + + for (var i=0; i < size; i++) + { + array1[i] = i; + array2[i] = size-1-i; + } + + + // the following for loop reverses the order of array1 so + // that it should be similarly ordered to array2 + var array3; + for (i = array1.length; i > 0; i--) + { + array3 = array1.slice(1,i); + array1.splice(1,i-1); + array1 = array3.concat(array1); + } + + // the following for loop reverses the order of array1 so + // that it should be similarly ordered to array2 + var array3; + for (i = array5.length; i > 0; i--) + { + array7 = array5.slice(1,i); + array5.splice(1,i-1); + array5 = array7.concat(array5); + } + + // the following for loop reverses the order of array1 + // and array2 + for (i = 0; i < size; i++) + { + array1.push(array1.shift()); + array2.unshift(array2.pop()); + } + + // the following for loop reverses the order of array5 + // and array6 + for (i = 0; i < size; i++) + { + array5.push(array5.shift()); + array6.unshift(array6.pop()); + } + + array[item++] = new TestCase( SECTION, "Array.push,pop,shift,unshift,slice,splice", true,String(array1) == String(array2)); + array[item++] = new TestCase( SECTION, "Array.push,pop,shift,unshift,slice,splice", true,String(array5) == String(array6)); + array1.sort(); + array2.sort(); + array5.sort(); + array6.sort(); + array[item++] = new TestCase( SECTION, "Array.sort", true,String(array1) == String(array2)); + array[item++] = new TestCase( SECTION, "Array.sort", true,String(array5) == String(array6)); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Array/slice.as b/mozilla/js/tamarin/test/ecma3/Array/slice.as new file mode 100644 index 00000000000..c0038fb9eac --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Array/slice.as @@ -0,0 +1,114 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = 'As described in Netscape doc "Whats new in JavaScript 1.2"'; + var VERSION = 'no version'; + startTest(); + var TITLE = 'String:slice'; + + writeHeaderToLog('Executing script: slice.js'); + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + function mySlice(a, from, to) + { + var from2 = from; + var to2 = to; + var returnArray = []; + var i; + + if (from2 < 0) from2 = a.length + from; + if (to2 < 0) to2 = a.length + to; + + if ((to2 > from2)&&(to2 > 0)&&(from2 < a.length)) + { + if (from2 < 0) from2 = 0; + if (to2 > a.length) to2 = a.length; + + for (i = from2; i < to2; ++i) returnArray.push(a[i]); + } + return returnArray; + } + + // This function tests the slice command on an Array + // passed in. The arguments passed into slice range in + // value from -5 to the length of the array + 4. Every + // combination of the two arguments is tested. The expected + // result of the slice(...) method is calculated and + // compared to the actual result from the slice(...) method. + // If the Arrays are not similar false is returned. + function exhaustiveSliceTest(testname, a) + { + var x = 0; + var y = 0; + var errorMessage; + var reason = ""; + var passed = true; + + for (x = -(2 + a.length); x <= (2 + a.length); x++) + for (y = (2 + a.length); y >= -(2 + a.length); y--) + { + var b = a.slice(x,y); + var c = mySlice(a,x,y); + + if (String(b) != String(c)) + { + errorMessage = + "ERROR: 'TEST FAILED' ERROR: 'TEST FAILED' ERROR: 'TEST FAILED'\n" + + " test: " + "a.slice(" + x + "," + y + ")\n" + + " a: " + String(a) + "\n" + + " actual result: " + String(b) + "\n" + + " expected result: " + String(c) + "\n"; + writeHeaderToLog(errorMessage); + reason = reason + errorMessage; + passed = false; + } + } + var testCase = new TestCase(SECTION, testname, true, passed); + if (passed == false) + testCase.reason = reason; + return testCase; + } + + var a = ['a','test string',456,9.34,new String("string object"),[],['h','i','j','k']]; + var b = [1,2,3,4,5,6,7,8,9,0]; + + array[item++] = exhaustiveSliceTest("exhaustive slice test 1", a); + array[item++] = exhaustiveSliceTest("exhaustive slice test 2", b); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Array/sortOn.as b/mozilla/js/tamarin/test/ecma3/Array/sortOn.as new file mode 100644 index 00000000000..99f07ac6f35 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Array/sortOn.as @@ -0,0 +1,232 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * File Name: sortOn.as + * ECMA Section: 15.4.4.3 Array.sortOn() + * Description: Test Case for sortOn function of Array Class. + * Here three objects have been created and using the + * sortOn() function, we are sorting the fields in the + * Object. + * + * Author: Gagneet Singh (gasingh@macromedia.com) + * Date: 01/09/2005 + * Modified By: Subha Subramanian + * Date: 01/05/2006 + * Details: Added more tests to test sortOn method and added tests to test * sortOn method's changed sorting behavior with Array class constants + */ + +var SECTION = "sortOn"; +var TITLE = "Array.sortOn"; + +var VERSION = "ECMA_3"; + +startTest(); + +writeHeaderToLog( SECTION + " " + TITLE); + + +var testcases = getTestCases(); + +test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // Create three objects to hold + var OBJ1 = new Object(); + OBJ1.name = "Chris"; + OBJ1.city = "Dallas"; + OBJ1.zip = 72501; + + var OBJ2 = new Object(); + OBJ2.name = "Mike"; + OBJ2.city = "Newton"; + OBJ2.zip = 68144; + + var OBJ3 = new Object(); + OBJ3.name = "Greg"; + OBJ3.city = "San Francisco"; + OBJ3.zip = 94103; + + + // Create an array to hold the three objects contents in an array object. + var MYARRAY = new Array(); + + // Push the objects created into the array created. + MYARRAY.push(OBJ1); + MYARRAY.push(OBJ2); + MYARRAY.push(OBJ3); + + // Array to hold the output string as they were before. + var EXPECT_VAR = new Array(); + + // Output the current state of the array + for (var SORTVAR = 0; ( SORTVAR < MYARRAY.length ); SORTVAR++) + { + EXPECT_VAR[SORTVAR] = (MYARRAY[SORTVAR].city); + } + + + // Sort the array on the City field. + MYARRAY.sortOn("city"); + + + // Output the result of the Sort Operation. + for (var MYVAR = 0; ( MYVAR < MYARRAY.length ); MYVAR++) + { + array[item++] = new TestCase( SECTION, "MYARR.sortOn(city)", EXPECT_VAR[MYVAR], MYARRAY[MYVAR].city ); + } + var RESULT_ARRAY = new Array(); + for (var SORTVAR = 0; ( SORTVAR < MYARRAY.length ); SORTVAR++) + { + EXPECT_VAR[SORTVAR] = (MYARRAY[SORTVAR].name); + + } + RESULT_ARRAY = EXPECT_VAR.sort(); + // Sort the array on the name field. + MYARRAY.sortOn("name"); + + + // Output the result of the Sort Operation. + for (var MYVAR = 0; ( MYVAR < MYARRAY.length ); MYVAR++) + { + array[item++] = new TestCase( SECTION, "MYARR.sortOn(name)", RESULT_ARRAY[MYVAR], MYARRAY[MYVAR].name ); + } + + for (var SORTVAR = 0; ( SORTVAR < MYARRAY.length ); SORTVAR++) + { + EXPECT_VAR[SORTVAR] = (MYARRAY[SORTVAR].zip); + + } + RESULT_ARRAY = EXPECT_VAR.sort(); + // Sort the array on the zip field. + MYARRAY.sortOn("zip"); + + + // Output the result of the Sort Operation. + for (var MYVAR = 0; ( MYVAR < MYARRAY.length ); MYVAR++) + { + array[item++] = new TestCase( SECTION, "MYARR.sortOn(zip)", RESULT_ARRAY[MYVAR], MYARRAY[MYVAR].zip ); + } + + //Using constants to change the sorting behavior + + + + for (var SORTVAR = 0; ( SORTVAR < MYARRAY.length ); SORTVAR++) + { + EXPECT_VAR[SORTVAR] = (MYARRAY[SORTVAR].zip); + + } + RESULT_ARRAY = EXPECT_VAR.sort(Array.NUMERIC); + // Sort the array on the name field. + MYARRAY.sortOn("zip",Array.NUMERIC); + + + // Output the result of the Sort Operation. + for (var MYVAR = 0; ( MYVAR < MYARRAY.length ); MYVAR++) + { + array[item++] = new TestCase( SECTION, "MYARR.sortOn(zip,Array.NUMERIC)", RESULT_ARRAY[MYVAR], MYARRAY[MYVAR].zip ); + } + + + var users:Array = [{name:"Bob",age:3},{name:"barb",age:35},{name:"abcd",age:3},{name:"catchy",age:4}] + + for (var SORTVAR = 0; ( SORTVAR < users.length ); SORTVAR++) + { + EXPECT_VAR[SORTVAR] = (users[SORTVAR].name); + + } + RESULT_ARRAY = EXPECT_VAR.sort(Array.CASEINSENSITIVE); + // Sort the array on the name field. + users.sortOn("name",Array.CASEINSENSITIVE); + + + // Output the result of the Sort Operation. + for (var MYVAR = 0; ( MYVAR < users.length ); MYVAR++) + { + array[item++] = new TestCase( SECTION, "users.sortOn(name,Array.CASEINSENSITIVE)", RESULT_ARRAY[MYVAR], users[MYVAR].name ); + } + RESULT_ARRAY = EXPECT_VAR.sort(Array.CASEINSENSITIVE|Array.DESCENDING); + // Sort the array on the name field. + users.sortOn("name",Array.CASEINSENSITIVE|Array.DESCENDING); + + + // Output the result of the Sort Operation. + for (var MYVAR = 0; ( MYVAR < users.length ); MYVAR++) + { + array[item++] = new TestCase( SECTION, "users.sortOn(name,Array.CASEINSENSITIVE|Array.DESCENDING)", RESULT_ARRAY[MYVAR], users[MYVAR].name ); + } + + for (var SORTVAR = 0; ( SORTVAR < users.length ); SORTVAR++) + { + EXPECT_VAR[SORTVAR] = (users[SORTVAR].age); + + } + RESULT_ARRAY = EXPECT_VAR.sort(); + // Sort the array on the age field. + users.sortOn("age"); + + + // Output the result of the Sort Operation. + for (var MYVAR = 0; ( MYVAR < users.length ); MYVAR++) + { + array[item++] = new TestCase( SECTION, "users.sortOn(age)", RESULT_ARRAY[MYVAR], users[MYVAR].age ); + } + + RESULT_ARRAY = EXPECT_VAR.sort(Array.NUMERIC); + // Sort the array on the age field. + users.sortOn("age",Array.NUMERIC); + + + // Output the result of the Sort Operation. + for (var MYVAR = 0; ( MYVAR < users.length ); MYVAR++) + { + array[item++] = new TestCase( SECTION, "users.sortOn(age,Array.NUMERIC)", RESULT_ARRAY[MYVAR], users[MYVAR].age ); + } + + RESULT_ARRAY = EXPECT_VAR.sort(Array.DESCENDING|Array.NUMERIC); + // Sort the array on the age field. + users.sortOn("age",Array.DESCENDING|Array.NUMERIC); + + + // Output the result of the Sort Operation. + for (var MYVAR = 0; ( MYVAR < users.length ); MYVAR++) + { + array[item++] = new TestCase( SECTION, "users.sortOn(age,Array.DESCENDING|Array.NUMERIC)", RESULT_ARRAY[MYVAR], users[MYVAR].age ); + } + + + + return ( array ); + +} diff --git a/mozilla/js/tamarin/test/ecma3/Array/sparseArray.as b/mozilla/js/tamarin/test/ecma3/Array/sparseArray.as new file mode 100644 index 00000000000..34d92ad552f --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Array/sparseArray.as @@ -0,0 +1,222 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * File Name: sparseArray.as + * ECMA Section: 15.4 general Array testcases + * Description: Test Case for generic Array Class when + * Arrays are used as sparse arrays with non-consecutive integer + * properties or non-numeric properties. + * These test when a "dense" array becomes sparse and vice-versa. + + * + * Author: Werner Sharp (wsharp@macromedia.com) + * Date: 01/28/2005 + * + */ + +var SECTION = "15.4"; +var TITLE = "Array sparse tests"; + +var VERSION = "ECMA_3"; + +startTest(); + +writeHeaderToLog( SECTION + " " + TITLE); + + +var testcases = getTestCases(); + +test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + var foundOne= false; + var foundTwo = false; + var foundThree = false; + var somethingElse = false; + var result = false; + + // Test ArrayObject::deleteProperty convert a purely dense array into a sparse array + var x = new Array(1, 2, 3); + delete x[1]; + for (var i in x) + { + if( x[i] == 1 ){ + foundOne = true; + } else if (x[i] == 2 ){ + foundTwo = true; + } else if (x[i] == 3 ){ + foundThree = true; + } else { + somethingElse = true; + } + } + + if( foundOne && !foundTwo && foundThree && !somethingElse ) result = true; + + // section, description, correct result, actual result + array[item++] = new TestCase( SECTION, "new Array(1, 2, 3), delete a[1], for in array", true, result ); + + // Test ArrayObject::deleteProperty convert a purely dense array into a sparse array + var x = new Array(1, 2, 3); + delete x[1]; + for (var i in x) + { + if( x[i] == 1 ){ + foundOne = true; + } else if (x[i] == 2 ){ + foundTwo = true; + } else if (x[i] == 3 ){ + foundThree = true; + } else { + somethingElse = true; + } + } + + if( foundOne && !foundTwo && foundThree && !somethingElse ) result = true; + + // section, description, correct result, actual result + array[item++] = new TestCase( SECTION, "new Array(1, 2, 3), delete a[1], for in array", true, result); + + // Test ArrayObject::deleteProperty convert a purely dense array into a sparse array + var x = new Array(1, 2, 3); + delete x[2]; + for (var i in x) + { + if( x[i] == 1 ){ + foundOne = true; + } else if (x[i] == 2 ){ + foundTwo = true; + } else if (x[i] == 3 ){ + foundThree = true; + } else { + somethingElse = true; + } + } + + if( foundOne && foundTwo && !foundThree && !somethingElse ) result = true; + + // section, description, correct result, actual result + array[item++] = new TestCase( SECTION, "new Array(1, 2, 3), delete a[2], for in array", true, result); + + var x = new Array(1, 2, 3); + delete x[0]; + for (var i in x) + { + if( x[i] == 1 ){ + foundOne = true; + } else if (x[i] == 2 ){ + foundTwo = true; + } else if (x[i] == 3 ){ + foundThree = true; + } else { + somethingElse = true; + } + } + + if( !foundOne && foundTwo && foundThree && !somethingElse ) result = true; + + // section, description, correct result, actual result + // Results are [3 2] because of random hash table ordering. + array[item++] = new TestCase( SECTION, "new Array(1, 2, 3), delete a[0], for in array", true, result); + + + // dense array that has a sparse element added + var x = new Array(1, 2, 3); + x[4] = '5'; + array[item++] = new TestCase( SECTION, "new Array(1, 2, 3), x[4] = '5'", "1,2,3,,5", x.toString()); + + // dense array that has a sparse element added then another which should convert the whole array + // into a dense array + var x = new Array(1, 2, 3); + x[4] = '5'; + x[3] = '4'; + array[item++] = new TestCase( SECTION, "new Array(1, 2, 3), x[4] = '5', x[3] = '4'", "1,2,3,4,5", x.toString()); + + // Mixed mode - part dense and sparse for x array, pure sparse for y array + var x = new Array(); + x[0] = 0; + x[2] = 2; + var y = new Array(); + y[3] = 3 + y[5] = 4; + var z = y.concat (x); + array[item++] = new TestCase( SECTION, "create two arrays and concat them together", ",,,3,,4,0,,2", z.toString()); + + // Mixed mode - part dense and sparse for each array + var x = new Array(0,1); + x[3] = 3; + var y = new Array(0,1); + y[6] = 6 + var z = y.concat (x); + array[item++] = new TestCase( SECTION, "create two arrays and concat them together", "0,1,,,,,6,0,1,,3", z.toString()); + + // Mixed mode - part dense and sparse for each array + var x = new Array(0,1); + x[3] = 3; + var z = x.concat (10); + array[item++] = new TestCase( SECTION, "create two arrays and concat them together", "0,1,,3,10", z.toString()); + + // shift should convert sparse array into dense array + var x = new Array(); + x[1] = 1; + x[2] = 2; + x[3] = 3; + x[4] = 4; + z = x.shift(); + array[item++] = new TestCase( SECTION, "create array with 1-4 populated, then shift, array.toString", "1,2,3,4", x.toString()); + array[item++] = new TestCase( SECTION, "create array with 1-4 populated, then shift, get results", undefined, z); + + // pop of mixed mode array + var x = new Array(); + x[1] = 1; + x[2] = 2; + x[3] = 3; + z = x.pop(); + array[item++] = new TestCase( SECTION, "create array with 1-3 populated, then pop, array.toString", ",1,2", x.toString()); + array[item++] = new TestCase( SECTION, "create array with 1-3 populated, then pop, get results", 3, z); + + var x = new Array(); + x[1] = 1; + x.push (2, 3); + array[item++] = new TestCase( SECTION, "create array with 1 populated, then push(2,3), array.toString", ",1,2,3", x.toString()); + + var x = new Array(); + x[1] = 1; + x[2] = 2; + x[3] = 3; + x[4] = 4; + z = x.reverse(); + array[item++] = new TestCase( SECTION, "create array with 1-4 populated, then reverse, array.toString", "4,3,2,1,", x.toString()); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Array/splice1.as b/mozilla/js/tamarin/test/ecma3/Array/splice1.as new file mode 100644 index 00000000000..6d68c61f057 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Array/splice1.as @@ -0,0 +1,143 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = 'As described in Netscape doc "Whats new in JavaScript 1.2"'; + var VERSION = 'no version'; + startTest(); + var TITLE = 'String:splice 1'; + var BUGNUMBER="123795"; + + writeHeaderToLog('Executing script: splice1.js'); + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + function mySplice(testArray, splicedArray, first, len, elements) + { + var removedArray = []; + var adjustedFirst = first; + var adjustedLen = len; + + if (adjustedFirst < 0) adjustedFirst = testArray.length + first; + if (adjustedFirst < 0) adjustedFirst = 0; + + if (adjustedLen < 0) adjustedLen = 0; + + for (i = 0; (i < adjustedFirst)&&(i < testArray.length); ++i) + splicedArray.push(testArray[i]); + + if (adjustedFirst < testArray.length) + for (var i = adjustedFirst; (i < adjustedFirst + adjustedLen) && + (i < testArray.length); ++i) + { + removedArray.push(testArray[i]); + } + + for (var i = 0; i < elements.length; i++) splicedArray.push(elements[i]); + + for (var i = adjustedFirst + adjustedLen; i < testArray.length; i++) + splicedArray.push(testArray[i]); + + return removedArray; + } + + function exhaustiveSpliceTest(testname, testArray) + { + var errorMessage; + var passed = true; + var reason = ""; + + for (var first = -(testArray.length+2); first <= 2 + testArray.length; first++) + { + var actualSpliced = []; + var expectedSpliced = []; + var actualRemoved = []; + var expectedRemoved = []; + + for (var len = 0; len < testArray.length + 2; len++) + { + actualSpliced = []; + expectedSpliced = []; + + for (var i = 0; i < testArray.length; ++i) + actualSpliced.push(testArray[i]); + + actualRemoved = actualSpliced.splice(first,len); + expectedRemoved = mySplice(testArray,expectedSpliced,first,len,[]); + + var adjustedFirst = first; + if (adjustedFirst < 0) adjustedFirst = testArray.length + first; + if (adjustedFirst < 0) adjustedFirst = 0; + + if ( (String(actualSpliced) != String(expectedSpliced)) + ||(String(actualRemoved) != String(expectedRemoved))) + { + if ( (String(actualSpliced) == String(expectedSpliced)) + &&(String(actualRemoved) != String(expectedRemoved)) ) + { + if ( (expectedRemoved.length == 1) + &&(String(actualRemoved) == String(expectedRemoved[0]))) continue; + if ( expectedRemoved.length == 0 && actualRemoved == void 0) continue; + } + + errorMessage = + "ERROR: 'TEST FAILED'\n" + + " test: " + "a.splice(" + first + "," + len + ",-97,new String('test arg'),[],9.8)\n" + + " a: " + String(testArray) + "\n" + + " actual spliced: " + String(actualSpliced) + "\n" + + " expected spliced: " + String(expectedSpliced) + "\n" + + " actual removed: " + String(actualRemoved) + "\n" + + " expected removed: " + String(expectedRemoved) + "\n"; + writeHeaderToLog(errorMessage); + reason = reason + errorMessage; + passed = false; + } + } + } + var testcase = new TestCase( SECTION, testname, true, passed); + if (!passed) + testcase.reason = reason; + return testcase; + } + + var a = ['a','test string',456,9.34,new String("string object"),[],['h','i','j','k']]; + var b = [1,2,3,4,5,6,7,8,9,0]; + + array[item++] = exhaustiveSpliceTest("exhaustive splice w/no optional args 1",a); + array[item++] = exhaustiveSpliceTest("exhaustive splice w/no optional args 1",b); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Array/splice2.as b/mozilla/js/tamarin/test/ecma3/Array/splice2.as new file mode 100644 index 00000000000..a73d8955696 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Array/splice2.as @@ -0,0 +1,141 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = 'As described in Netscape doc "Whats new in JavaScript 1.2"'; + var VERSION = 'no version'; + startTest(); + var TITLE = 'String:splice 2'; + var BUGNUMBER="123795"; + + writeHeaderToLog('Executing script: splice2.js'); + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + function mySplice(testArray, splicedArray, first, len, elements) + { + var removedArray = []; + var adjustedFirst = first; + var adjustedLen = len; + + if (adjustedFirst < 0) adjustedFirst = testArray.length + first; + if (adjustedFirst < 0) adjustedFirst = 0; + + if (adjustedLen < 0) adjustedLen = 0; + + for (var i = 0; (i < adjustedFirst)&&(i < testArray.length); ++i) + splicedArray.push(testArray[i]); + + if (adjustedFirst < testArray.length) + for (i = adjustedFirst; (i < adjustedFirst + adjustedLen) && (i < testArray.length); ++i) + removedArray.push(testArray[i]); + + for (var i = 0; i < elements.length; i++) splicedArray.push(elements[i]); + + for (var i = adjustedFirst + adjustedLen; i < testArray.length; i++) + splicedArray.push(testArray[i]); + + return removedArray; + } + + function exhaustiveSpliceTestWithArgs(testname, testArray) + { + var passed = true; + var errorMessage; + var reason = ""; + for (var first = -(testArray.length+2); first <= 2 + testArray.length; first++) + { + var actualSpliced = []; + var expectedSpliced = []; + var actualRemoved = []; + var expectedRemoved = []; + + for (var len = 0; len < testArray.length + 2; len++) + { + actualSpliced = []; + expectedSpliced = []; + + for (var i = 0; i < testArray.length; ++i) + actualSpliced.push(testArray[i]); + + actualRemoved = actualSpliced.splice(first,len,-97,new String("test arg"),[],9.8); + expectedRemoved = mySplice(testArray,expectedSpliced,first,len,[-97,new String("test arg"),[],9.8]); + + var adjustedFirst = first; + if (adjustedFirst < 0) adjustedFirst = testArray.length + first; + if (adjustedFirst < 0) adjustedFirst = 0; + + + if ( (String(actualSpliced) != String(expectedSpliced)) + ||(String(actualRemoved) != String(expectedRemoved))) + { + if ( (String(actualSpliced) == String(expectedSpliced)) + &&(String(actualRemoved) != String(expectedRemoved)) ) + { + + if ( (expectedRemoved.length == 1) + &&(String(actualRemoved) == String(expectedRemoved[0]))) continue; + if ( expectedRemoved.length == 0 && actualRemoved == void 0 ) continue; + } + + errorMessage = + "ERROR: 'TEST FAILED' ERROR: 'TEST FAILED' ERROR: 'TEST FAILED'\n" + + " test: " + "a.splice(" + first + "," + len + ",-97,new String('test arg'),[],9.8)\n" + + " a: " + String(testArray) + "\n" + + " actual spliced: " + String(actualSpliced) + "\n" + + " expected spliced: " + String(expectedSpliced) + "\n" + + " actual removed: " + String(actualRemoved) + "\n" + + " expected removed: " + String(expectedRemoved); + reason = reason + errorMessage; + writeHeaderToLog(errorMessage); + passed = false; + } + } + } + var testcase = new TestCase(SECTION, testname, true, passed); + if (!passed) testcase.reason = reason; + return testcase; + } + + + var a = ['a','test string',456,9.34,new String("string object"),[],['h','i','j','k']]; + var b = [1,2,3,4,5,6,7,8,9,0]; + + array[item++] = exhaustiveSpliceTestWithArgs("exhaustive splice w/2 optional args 1",a); + array[item++] = exhaustiveSpliceTestWithArgs("exhaustive splice w/2 optional args 2",b); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Array/toLocaleString.as b/mozilla/js/tamarin/test/ecma3/Array/toLocaleString.as new file mode 100644 index 00000000000..a911092888b --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Array/toLocaleString.as @@ -0,0 +1,96 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.4.4.3"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Array.prototype.toLocaleString"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "Array.prototype.toLocaleString.length", 0, Array.prototype.toLocaleString.length ); + + array[item++] = new TestCase( SECTION, "(new Array()).toLocaleString()", "", (new Array()).toLocaleString() ); + array[item++] = new TestCase( SECTION, "(new Array(2)).toLocaleString()", ",", (new Array(2)).toLocaleString() ); + array[item++] = new TestCase( SECTION, "(new Array(0,1)).toLocaleString()", "0,1", (new Array(0,1)).toLocaleString() ); + array[item++] = new TestCase( SECTION, "(new Array( Number.NaN, Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY)).toLocaleString()", "NaN,Infinity,-Infinity", (new Array( Number.NaN, Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY)).toLocaleString() ); + array[item++] = new TestCase( SECTION, "(new Array(Boolean(1), Boolean(0))).toLocaleString()", "[object Boolean],[object Boolean]" , (new Array(Boolean(1), Boolean(0))).toLocaleString()); + array[item++] = new TestCase( SECTION, "(new Array(void 0,null)).toLocaleString()", ",", (new Array(void 0,null)).toLocaleString() ); + + var EXPECT_STRING = ""; + var MYARR = new Array(); + + for ( var i = -50; i < 50; i+= 0.25 ) { + MYARR[MYARR.length] = i; + EXPECT_STRING += i +","; + } + + EXPECT_STRING = EXPECT_STRING.substring( 0, EXPECT_STRING.length -1 ); + + array[item++] = new TestCase( SECTION, "MYARR.toLocaleString()", EXPECT_STRING, MYARR.toLocaleString() ); + + var MYARR2 = [0,1,2,3,4,5,6,7,8,9] + + array[item++] = new TestCase( SECTION, "MYARR2.toLocaleString()", "0,1,2,3,4,5,6,7,8,9", MYARR2.toLocaleString() ); + + + var MYARRARR = [new Array(1,2,3),new Array(4,5,6)] + + array[item++] = new TestCase( SECTION, "MYARRARR.toLocaleString()", "1,2,3,4,5,6",MYARRARR.toLocaleString() ); + + var obj; + var MYUNDEFARR = [obj]; + + array[item++] = new TestCase( SECTION, "MYUNDEFARR.toLocaleString()", "",MYUNDEFARR.toLocaleString() ); + + var MYNULLARR = [null] + + array[item++] = new TestCase( SECTION, "MYNULLARR.toLocaleString()", "",MYNULLARR.toLocaleString() ); + + var MYNULLARR2 = new Array(null); + + array[item++] = new TestCase( SECTION, "MYNULLARR2.toLocaleString()", "",MYNULLARR2.toLocaleString() ); + + var MyAllArray = new Array(new String('string'),new Array(1,2,3),new Number(100000),Boolean(0),Number.MAX_VALUE) + + array[item++] = new TestCase( SECTION, "MyAllArray.toLocaleString()", "[object String],1,2,3,100000,[object Boolean],1.79769313486231e+308",MyAllArray.toLocaleString() ); + + + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Boolean/e15_6_1.as b/mozilla/js/tamarin/test/ecma3/Boolean/e15_6_1.as new file mode 100644 index 00000000000..13d16cb0ff4 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Boolean/e15_6_1.as @@ -0,0 +1,71 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.6.1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "The Boolean constructor called as a function: Boolean( value ) and Boolean()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "Boolean(1)", true, Boolean(1) ); + array[item++] = new TestCase( SECTION, "Boolean(0)", false, Boolean(0) ); + array[item++] = new TestCase( SECTION, "Boolean(-1)", true, Boolean(-1) ); + array[item++] = new TestCase( SECTION, "Boolean('1')", true, Boolean("1") ); + array[item++] = new TestCase( SECTION, "Boolean('0')", true, Boolean("0") ); + array[item++] = new TestCase( SECTION, "Boolean('-1')", true, Boolean("-1") ); + array[item++] = new TestCase( SECTION, "Boolean(true)", true, Boolean(true) ); + array[item++] = new TestCase( SECTION, "Boolean(false)", false, Boolean(false) ); + + array[item++] = new TestCase( SECTION, "Boolean('true')", true, Boolean("true") ); + array[item++] = new TestCase( SECTION, "Boolean('false')", true, Boolean("false") ); + array[item++] = new TestCase( SECTION, "Boolean(null)", false, Boolean(null) ); + + array[item++] = new TestCase( SECTION, "Boolean(-Infinity)", true, Boolean(Number.NEGATIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "Boolean(NaN)", false, Boolean(Number.NaN) ); + array[item++] = new TestCase( SECTION, "Boolean(void(0))", false, Boolean( void(0) ) ); + array[item++] = new TestCase( SECTION, "Boolean(x=0)", false, Boolean( x=0 ) ); + array[item++] = new TestCase( SECTION, "Boolean(x=1)", true, Boolean( x=1 ) ); + array[item++] = new TestCase( SECTION, "Boolean(x=false)", false, Boolean( x=false ) ); + array[item++] = new TestCase( SECTION, "Boolean(x=true)", true, Boolean( x=true ) ); + array[item++] = new TestCase( SECTION, "Boolean(x=null)", false, Boolean( x=null ) ); + array[item++] = new TestCase( SECTION, "Boolean()", false, Boolean() ); +// array[item++] = new TestCase( SECTION, "Boolean(var someVar)", false, Boolean( someVar ) ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Boolean/e15_6_2.as b/mozilla/js/tamarin/test/ecma3/Boolean/e15_6_2.as new file mode 100644 index 00000000000..18cdcc5f43e --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Boolean/e15_6_2.as @@ -0,0 +1,133 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.6.2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "15.6.2 The Boolean Constructor; 15.6.2.1 new Boolean( value ); 15.6.2.2 new Boolean()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "typeof (new Boolean(1))", "boolean", typeof (new Boolean(1)) ); + array[item++] = new TestCase( SECTION, "(new Boolean(1)).constructor", Boolean.prototype.constructor, (new Boolean(1)).constructor ); + + var TESTBOOL:Boolean=new Boolean(1); + array[item++] = new TestCase( SECTION,"TESTBOOL.toString()","true",TESTBOOL.toString()); + array[item++] = new TestCase( SECTION, "(new Boolean(1)).valueOf()",true, (new Boolean(1)).valueOf() ); + array[item++] = new TestCase( SECTION,"typeof new Boolean(1)","boolean", typeof (new Boolean(1)) ); + array[item++] = new TestCase( SECTION, "(new Boolean(0)).constructor", Boolean.prototype.constructor, (new Boolean(0)).constructor ); + + var TESTBOOL:Boolean=new Boolean(0); + array[item++] = new TestCase( SECTION, "TESTBOOL.toString()","false",TESTBOOL.toString()); + array[item++] = new TestCase( SECTION, "(new Boolean(0)).valueOf()", false, (new Boolean(0)).valueOf() ); + array[item++] = new TestCase( SECTION, "typeof new Boolean(0)","boolean",typeof (new Boolean(0)) ); + array[item++] = new TestCase( SECTION, "(new Boolean(-1)).constructor", Boolean.prototype.constructor, (new Boolean(-1)).constructor ); + + var TESTBOOL:Boolean=new Boolean(-1); + array[item++] = new TestCase( SECTION,"TESTBOOL.toString()","true",TESTBOOL.toString()); + array[item++] = new TestCase( SECTION, "(new Boolean(-1)).valueOf()", true, (new Boolean(-1)).valueOf() ); + array[item++] = new TestCase( SECTION, "typeof new Boolean(-1)", "boolean", typeof (new Boolean(-1)) ); + array[item++] = new TestCase( SECTION, "(new Boolean('')).constructor", Boolean.prototype.constructor, (new Boolean('')).constructor ); + + var TESTBOOL:Boolean=new Boolean(""); + array[item++] = new TestCase( SECTION, "TESTBOOL.toString()", "false",TESTBOOL.toString()); + array[item++] = new TestCase( SECTION, "(new Boolean('')).valueOf()", false, (new Boolean("")).valueOf() ); + array[item++] = new TestCase( SECTION, "typeof new Boolean('')", "boolean", typeof (new Boolean("")) ); + array[item++] = new TestCase( SECTION, "(new Boolean('1')).constructor", Boolean.prototype.constructor, (new Boolean("1")).constructor ); + + var TESTBOOL:Boolean=new Boolean('1'); + array[item++] = new TestCase( SECTION, "TESTBOOL.toString()", "true",TESTBOOL.toString()); + array[item++] = new TestCase( SECTION, "(new Boolean('1')).valueOf()", true, (new Boolean('1')).valueOf() ); + array[item++] = new TestCase( SECTION, "typeof new Boolean('1')", "boolean", typeof (new Boolean('1')) ); + array[item++] = new TestCase( SECTION, "(new Boolean('0')).constructor", Boolean.prototype.constructor, (new Boolean('0')).constructor ); + + var TESTBOOL:Boolean=new Boolean('0'); + array[item++] = new TestCase( SECTION, "TESTBOOL.toString()", "true",TESTBOOL.toString()); + array[item++] = new TestCase( SECTION, "(new Boolean('0')).valueOf()", true, (new Boolean('0')).valueOf() ); + array[item++] = new TestCase( SECTION, "typeof new Boolean('0')", "boolean", typeof (new Boolean('0')) ); + array[item++] = new TestCase( SECTION, "(new Boolean('-1')).constructor", Boolean.prototype.constructor, (new Boolean('-1')).constructor ); + + var TESTBOOL:Boolean=new Boolean('-1'); + array[item++] = new TestCase( SECTION, "TESTBOOL.toString()","true",TESTBOOL.toString()); + array[item++] = new TestCase( SECTION, "(new Boolean('-1')).valueOf()", true, (new Boolean('-1')).valueOf() ); + array[item++] = new TestCase( SECTION, "typeof new Boolean('-1')", "boolean", typeof (new Boolean('-1')) ); + array[item++] = new TestCase( SECTION, "(new Boolean(new Boolean(true))).constructor", Boolean.prototype.constructor, (new Boolean(new Boolean(true))).constructor ); + + var TESTBOOL:Boolean=new Boolean(new Boolean(true)); + array[item++] = new TestCase( SECTION, "TESTBOOL.toString()", "true",TESTBOOL.toString()); + array[item++] = new TestCase( SECTION, "(new Boolean(new Boolean(true))).valueOf()", true, (new Boolean(new Boolean(true))).valueOf() ); + array[item++] = new TestCase( SECTION, "typeof new Boolean(new Boolean(true))", "boolean", typeof (new Boolean(new Boolean(true))) ); + array[item++] = new TestCase( SECTION, "(new Boolean(Number.NaN)).constructor", Boolean.prototype.constructor, (new Boolean(Number.NaN)).constructor ); + + var TESTBOOL:Boolean=new Boolean(Number.NaN); + array[item++] = new TestCase( SECTION,"TESTBOOL.toString()","false",TESTBOOL.toString()); + array[item++] = new TestCase( SECTION, "(new Boolean(Number.NaN)).valueOf()", false, (new Boolean(Number.NaN)).valueOf() ); + array[item++] = new TestCase( SECTION, "typeof new Boolean(Number.NaN)", "boolean", typeof (new Boolean(Number.NaN)) ); + array[item++] = new TestCase( SECTION, "(new Boolean(null)).constructor", Boolean.prototype.constructor, (new Boolean(null)).constructor ); + + var TESTBOOL:Boolean=new Boolean(null); + array[item++] = new TestCase( SECTION, "TESTBOOL.toString()","false",TESTBOOL.toString()); + array[item++] = new TestCase( SECTION, "(new Boolean(null)).valueOf()", false, (new Boolean(null)).valueOf() ); + array[item++] = new TestCase( SECTION, "typeof new Boolean(null)", "boolean", typeof (new Boolean(null)) ); + array[item++] = new TestCase( SECTION, "(new Boolean(void 0)).constructor", Boolean.prototype.constructor, (new Boolean(void 0)).constructor ); + + var TESTBOOL:Boolean=new Boolean(void 0); + array[item++] = new TestCase( SECTION, "TESTBOOL.toString()","false",TESTBOOL.toString()); + array[item++] = new TestCase( SECTION, "(new Boolean(void 0)).valueOf()", false, (new Boolean(void 0)).valueOf() ); + array[item++] = new TestCase( SECTION, "typeof new Boolean(void 0)", "boolean", typeof (new Boolean(void 0)) ); + array[item++] = new TestCase( SECTION, "(new Boolean(Number.POSITIVE_INFINITY)).constructor", Boolean.prototype.constructor, (new Boolean(Number.POSITIVE_INFINITY)).constructor ); + + var TESTBOOL:Boolean=new Boolean(Number.POSITIVE_INFINITY); + array[item++] = new TestCase( SECTION, "TESTBOOL.toString()", "true",TESTBOOL.toString()); + array[item++] = new TestCase( SECTION, "(new Boolean(Number.POSITIVE_INFINITY)).valueOf()", true, (new Boolean(Number.POSITIVE_INFINITY)).valueOf() ); + array[item++] = new TestCase( SECTION, "typeof new Boolean(Number.POSITIVE_INFINITY)", "boolean", typeof (new Boolean(Number.POSITIVE_INFINITY)) ); + array[item++] = new TestCase( SECTION, "(new Boolean(Number.NEGATIVE_INFINITY)).constructor", Boolean.prototype.constructor, (new Boolean(Number.NEGATIVE_INFINITY)).constructor ); + + var TESTBOOL:Boolean=new Boolean(Number.NEGATIVE_INFINITY); + array[item++] = new TestCase( SECTION, "TESTBOOL.toString()", "true",TESTBOOL.toString()); + array[item++] = new TestCase( SECTION, "(new Boolean(Number.NEGATIVE_INFINITY)).valueOf()", true, (new Boolean(Number.NEGATIVE_INFINITY)).valueOf() ); + array[item++] = new TestCase( SECTION, "typeof new Boolean(Number.NEGATIVE_INFINITY)", "boolean", typeof (new Boolean(Number.NEGATIVE_INFINITY) )); + array[item++] = new TestCase( SECTION, "(new Boolean(Number.NEGATIVE_INFINITY)).constructor", Boolean.prototype.constructor, (new Boolean(Number.NEGATIVE_INFINITY)).constructor ); + + var TESTBOOL:Boolean=new Boolean(); + array[item++] = new TestCase( "15.6.2.2", "TESTBOOL.toString()","false",TESTBOOL.toString()); + array[item++] = new TestCase( "15.6.2.2", "(new Boolean()).valueOf()", false, (new Boolean()).valueOf() ); + array[item++] = new TestCase( "15.6.2.2", "typeof new Boolean()", "boolean", typeof (new Boolean()) ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Boolean/e15_6_3.as b/mozilla/js/tamarin/test/ecma3/Boolean/e15_6_3.as new file mode 100644 index 00000000000..61eb79f4cbb --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Boolean/e15_6_3.as @@ -0,0 +1,53 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +var SECTION = "15.6.3"; +var VERSION = "ECMA_2"; +startTest(); +var TITLE = "Properties of the Boolean Constructor" +writeHeaderToLog( SECTION + TITLE ); + +var testcases = getTestCases(); + +// All tests must call a function that returns an array of TestCase objects. +test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // The Boolean is a Class in AS 3.0. + // Change when bug 149667 is fixed; should be true: + array[item++] = new TestCase( SECTION, "Boolean.constructor.prototype == Class.prototype", true, Boolean.constructor.prototype == Class.prototype ); + array[item++] = new TestCase( SECTION, "Boolean.length", 1, Boolean.length ); + + return ( array ); + +} diff --git a/mozilla/js/tamarin/test/ecma3/Boolean/e15_6_3_1.as b/mozilla/js/tamarin/test/ecma3/Boolean/e15_6_3_1.as new file mode 100644 index 00000000000..46aeb5e46ae --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Boolean/e15_6_3_1.as @@ -0,0 +1,50 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.6.3.1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Boolean.prototype"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "Boolean.prototype.valueOf()",false, Boolean.prototype.valueOf()); + array[item++] = new TestCase( SECTION, "Boolean.length", 1, Boolean.length ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Boolean/e15_6_3_1_1.as b/mozilla/js/tamarin/test/ecma3/Boolean/e15_6_3_1_1.as new file mode 100644 index 00000000000..c89a6587b02 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Boolean/e15_6_3_1_1.as @@ -0,0 +1,55 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.6.3.1-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Boolean.prototype"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + var str=''; + for ( p in Boolean ) + { + str += p; + } + array[item++] = new TestCase( SECTION, + "var str='';for ( p in Boolean ) { str += p } str;", + "", + str); + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Boolean/e15_6_3_1_2.as b/mozilla/js/tamarin/test/ecma3/Boolean/e15_6_3_1_2.as new file mode 100644 index 00000000000..741a6730087 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Boolean/e15_6_3_1_2.as @@ -0,0 +1,49 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.6.3.1-2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Boolean.prototype" + writeHeaderToLog( SECTION + TITLE ); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, + "delete( Boolean.prototype)", + false, + delete( Boolean.prototype) ); + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Boolean/e15_6_3_1_3.as b/mozilla/js/tamarin/test/ecma3/Boolean/e15_6_3_1_3.as new file mode 100644 index 00000000000..ec1a230030f --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Boolean/e15_6_3_1_3.as @@ -0,0 +1,50 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.6.3.1-3"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Boolean.prototype" + writeHeaderToLog( SECTION + TITLE ); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + delete( Boolean.prototype); + array[item++] = new TestCase( SECTION, + "delete( Boolean.prototype); Boolean.prototype", + 'false', + String(Boolean.prototype)); + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Boolean/e15_6_3_1_4.as b/mozilla/js/tamarin/test/ecma3/Boolean/e15_6_3_1_4.as new file mode 100644 index 00000000000..086d6be4994 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Boolean/e15_6_3_1_4.as @@ -0,0 +1,68 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.6.3.1-4"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Boolean.prototype" + writeHeaderToLog( SECTION + TITLE ); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var BOOL_PROTO = Boolean.prototype; + + array[item++] = new TestCase( SECTION, + "var BOOL_PROTO = Boolean.prototype; Boolean.prototype; Boolean.prototype == BOOL_PROTO", + true, + (BOOL_PROTO = Boolean.prototype, Boolean.prototype, Boolean.prototype == BOOL_PROTO ) ); + + var thisError="no error"; + + try{ + // save + var origBoolProto = Boolean.prototype; + + Boolean.prototype=null; + + // restore + Boolean.prototype = origBoolProto; + }catch(e:ReferenceError){ + thisError=e.toString(); + }finally{ + array[item++]=new TestCase(SECTION,"Trying to verify that Boolean.prototype is read-only","ReferenceError: Error #1074",referenceError(thisError)); + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Boolean/e15_6_3_1_5.as b/mozilla/js/tamarin/test/ecma3/Boolean/e15_6_3_1_5.as new file mode 100644 index 00000000000..b55c07d838a --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Boolean/e15_6_3_1_5.as @@ -0,0 +1,51 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +var VERSION = "ECMA_2"; +startTest(); +var SECTION = "15.6.3.1-5"; +var TITLE = "Boolean.prototype" + +writeHeaderToLog( SECTION + " " + TITLE ); +var tc= 0; +var testcases = getTestCases(); + +// All tests must call a function that returns an array of TestCase objects. +test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "Class.constructor.prototype == Boolean.constructor.prototype", true, Class.constructor.prototype == Boolean.constructor.prototype ); + + return ( array ); + +} diff --git a/mozilla/js/tamarin/test/ecma3/Boolean/e15_6_4.as b/mozilla/js/tamarin/test/ecma3/Boolean/e15_6_4.as new file mode 100644 index 00000000000..956eb279e44 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Boolean/e15_6_4.as @@ -0,0 +1,60 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.6.4"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Properties of the Boolean Prototype Object"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = new Array(); + + // false because prototype is now of type object + testcases[tc++] = new TestCase( SECTION, + "Boolean.prototype=([object Object])", + "false", + Boolean.prototype+""); + + //save original toString + var origToString:Function = Boolean.prototype.toString; + + Boolean.prototype.toString = Object.prototype.toString; + + testcases[tc++] = new TestCase( SECTION, + "Boolean.prototype.toString = Object.prototype.toString; Boolean.prototype.toString()", + "[object Object]", // because all prototypes are "Object" in es4 + Boolean.prototype.toString()); + + test(); + + //restore original toString + Boolean.prototype.toString = origToString; diff --git a/mozilla/js/tamarin/test/ecma3/Boolean/e15_6_4_1.as b/mozilla/js/tamarin/test/ecma3/Boolean/e15_6_4_1.as new file mode 100644 index 00000000000..6bacf5d1626 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Boolean/e15_6_4_1.as @@ -0,0 +1,50 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.6.4.1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Boolean.prototype.constructor" + writeHeaderToLog( SECTION + TITLE ); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, + "( Boolean.prototype.constructor == Boolean )", + true , + (Boolean.prototype.constructor == Boolean) ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Boolean/e15_6_4_2_1.as b/mozilla/js/tamarin/test/ecma3/Boolean/e15_6_4_2_1.as new file mode 100644 index 00000000000..12e0a2b2df6 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Boolean/e15_6_4_2_1.as @@ -0,0 +1,79 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.6.4.2-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Boolean.prototype.toString()" + writeHeaderToLog( SECTION + TITLE ); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "new Boolean(1)", "true", (new Boolean(1)).toString() ); + array[item++] = new TestCase( SECTION, "new Boolean(0)", "false", (new Boolean(0)).toString() ); + array[item++] = new TestCase( SECTION, "new Boolean(-1)", "true", (new Boolean(-1)).toString() ); + array[item++] = new TestCase( SECTION, "new Boolean('1')", "true", (new Boolean("1")).toString() ); + array[item++] = new TestCase( SECTION, "new Boolean('0')", "true", (new Boolean("0")).toString() ); + array[item++] = new TestCase( SECTION, "new Boolean(true)", "true", (new Boolean(true)).toString() ); + array[item++] = new TestCase( SECTION, "new Boolean(false)", "false", (new Boolean(false)).toString() ); + array[item++] = new TestCase( SECTION, "new Boolean('true')", "true", (new Boolean('true')).toString() ); + array[item++] = new TestCase( SECTION, "new Boolean('false')", "true", (new Boolean('false')).toString() ); + + array[item++] = new TestCase( SECTION, "new Boolean('')", "false", (new Boolean('')).toString() ); + array[item++] = new TestCase( SECTION, "new Boolean(null)", "false", (new Boolean(null)).toString() ); + array[item++] = new TestCase( SECTION, "new Boolean(void(0))", "false", (new Boolean(void(0))).toString() ); + array[item++] = new TestCase( SECTION, "new Boolean(-Infinity)", "true", (new Boolean(Number.NEGATIVE_INFINITY)).toString() ); + array[item++] = new TestCase( SECTION, "new Boolean(NaN)", "false", (new Boolean(Number.NaN)).toString() ); + array[item++] = new TestCase( SECTION, "new Boolean()", "false", (new Boolean()).toString() ); + array[item++] = new TestCase( SECTION, "new Boolean(x=1)", "true", (new Boolean(x=1)).toString() ); + array[item++] = new TestCase( SECTION, "new Boolean(x=0)", "false", (new Boolean(x=0)).toString() ); + array[item++] = new TestCase( SECTION, "new Boolean(x=false)", "false", (new Boolean(x=false)).toString() ); + array[item++] = new TestCase( SECTION, "new Boolean(x=true)", "true", (new Boolean(x=true)).toString() ); + array[item++] = new TestCase( SECTION, "new Boolean(x=null)", "false", (new Boolean(x=null)).toString() ); + array[item++] = new TestCase( SECTION, "new Boolean(x='')", "false", (new Boolean(x="")).toString() ); + array[item++] = new TestCase( SECTION, "new Boolean(x=' ')", "true", (new Boolean(x=" ")).toString() ); + + array[item++] = new TestCase( SECTION, "new Boolean(new MyObject(true))", "true", (new Boolean(new MyObject(true))).toString() ); + array[item++] = new TestCase( SECTION, "new Boolean(new MyObject(false))", "true", (new Boolean(new MyObject(false))).toString() ); + + return ( array ); +} +function MyObject( value ) { + this.value = value; + this.valueOf = function() { return this.value; } + this.valueOf = function() { return this.value; } + return this; +} diff --git a/mozilla/js/tamarin/test/ecma3/Boolean/e15_6_4_2_2.as b/mozilla/js/tamarin/test/ecma3/Boolean/e15_6_4_2_2.as new file mode 100644 index 00000000000..ffd9f096533 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Boolean/e15_6_4_2_2.as @@ -0,0 +1,70 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.6.4.2-2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Boolean.prototype.toString()" + writeHeaderToLog( SECTION + TITLE ); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + tostr=Boolean.prototype.toString; + Boolean.prototype.toString=tostr; + x=new Boolean(); + array[item++] = new TestCase( SECTION, + "tostr=Boolean.prototype.toString; Boolean.prototype.toString=tostr;x=new Boolean();x.toString()", + "false", + x.toString()); + + tostr=Boolean.prototype.toString; + Boolean.prototype.toString=tostr; + x=new Boolean(true); + array[item++] = new TestCase( SECTION, + "tostr=Boolean.prototype.toString; Boolean.prototype.toString=tostr;x=new Boolean(true);x.toString()", + "true", + x.toString()); + + tostr = Boolean.prototype.toString; + Boolean.prototype.toString=tostr; + x=new Boolean(false); + array[item++] = new TestCase( SECTION, + "tostr=Boolean.prototype.toString; Boolean.prototype.toString=tostr;x=new Boolean(false);x.toString()", + "false", + x.toString()); + return (array); + +} diff --git a/mozilla/js/tamarin/test/ecma3/Boolean/e15_6_4_2_3.as b/mozilla/js/tamarin/test/ecma3/Boolean/e15_6_4_2_3.as new file mode 100644 index 00000000000..b6249a36ffb --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Boolean/e15_6_4_2_3.as @@ -0,0 +1,60 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + var SECTION = "15.6.4.2-3"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Boolean.prototype.toString()" + writeHeaderToLog( SECTION + TITLE ); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + tostr=Boolean.prototype.toString; + Boolean.prototype.toString=tostr; + x=true; + array[item++] = new TestCase( SECTION, "tostr=Boolean.prototype.toString; Boolean.prototype.toString=tostr; x=true; x.toString()", + "true", + x.toString()); + + + x=false; + array[item++] = new TestCase( SECTION, "tostr=Boolean.prototype.toString; Boolean.prototype.toString=tostr; x=false;x.toString()", + "false", + x.toString() ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Boolean/e15_6_4_3.as b/mozilla/js/tamarin/test/ecma3/Boolean/e15_6_4_3.as new file mode 100644 index 00000000000..c81bc2b022c --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Boolean/e15_6_4_3.as @@ -0,0 +1,72 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.8.6.4.3"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Properties of the Boolean Object: valueOf" + writeHeaderToLog( SECTION + TITLE ); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "(new Boolean(1)).valueOf()", true, (new Boolean(1)).valueOf() ); + + array[item++] = new TestCase( SECTION, "(new Boolean(0)).valueOf()", false, (new Boolean(0)).valueOf() ); + array[item++] = new TestCase( SECTION, "(new Boolean(-1)).valueOf()", true, (new Boolean(-1)).valueOf() ); + array[item++] = new TestCase( SECTION, "(new Boolean('1')).valueOf()", true, (new Boolean("1")).valueOf() ); + array[item++] = new TestCase( SECTION, "(new Boolean('0')).valueOf()", true, (new Boolean("0")).valueOf() ); + array[item++] = new TestCase( SECTION, "(new Boolean(true)).valueOf()", true, (new Boolean(true)).valueOf() ); + array[item++] = new TestCase( SECTION, "(new Boolean(false)).valueOf()", false, (new Boolean(false)).valueOf() ); + array[item++] = new TestCase( SECTION, "(new Boolean('true')).valueOf()", true, (new Boolean("true")).valueOf() ); + array[item++] = new TestCase( SECTION, "(new Boolean('false')).valueOf()", true, (new Boolean('false')).valueOf() ); + + array[item++] = new TestCase( SECTION, "(new Boolean('')).valueOf()", false, (new Boolean('')).valueOf() ); + array[item++] = new TestCase( SECTION, "(new Boolean(null)).valueOf()", false, (new Boolean(null)).valueOf() ); + array[item++] = new TestCase( SECTION, "(new Boolean(void(0))).valueOf()", false, (new Boolean(void(0))).valueOf() ); + array[item++] = new TestCase( SECTION, "(new Boolean(-Infinity)).valueOf()", true, (new Boolean(Number.NEGATIVE_INFINITY)).valueOf() ); + array[item++] = new TestCase( SECTION, "(new Boolean(NaN)).valueOf()", false, (new Boolean(Number.NaN)).valueOf() ); + array[item++] = new TestCase( SECTION, "(new Boolean()).valueOf()", false, (new Boolean()).valueOf() ); + + array[item++] = new TestCase( SECTION, "(new Boolean(x=1)).valueOf()", true, (new Boolean(x=1)).valueOf() ); + array[item++] = new TestCase( SECTION, "(new Boolean(x=0)).valueOf()", false, (new Boolean(x=0)).valueOf() ); + array[item++] = new TestCase( SECTION, "(new Boolean(x=false)).valueOf()", false, (new Boolean(x=false)).valueOf() ); + array[item++] = new TestCase( SECTION, "(new Boolean(x=true)).valueOf()", true, (new Boolean(x=true)).valueOf() ); + array[item++] = new TestCase( SECTION, "(new Boolean(x=null)).valueOf()", false, (new Boolean(x=null)).valueOf() ); + array[item++] = new TestCase( SECTION, "(new Boolean(x='')).valueOf()", false, (new Boolean(x="")).valueOf() ); + array[item++] = new TestCase( SECTION, "(new Boolean(x=' ')).valueOf()", true, (new Boolean(x=" ")).valueOf() ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Boolean/e15_6_4_3_1.as b/mozilla/js/tamarin/test/ecma3/Boolean/e15_6_4_3_1.as new file mode 100644 index 00000000000..da9660ca509 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Boolean/e15_6_4_3_1.as @@ -0,0 +1,73 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.6.4.3-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Boolean.prototype.valueOf()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "new Boolean(1)", true, (new Boolean(1)).valueOf() ); + + array[item++] = new TestCase( SECTION, "new Boolean(0)", false, (new Boolean(0)).valueOf() ); + array[item++] = new TestCase( SECTION, "new Boolean(-1)", true, (new Boolean(-1)).valueOf() ); + array[item++] = new TestCase( SECTION, "new Boolean('1')", true, (new Boolean("1")).valueOf() ); + array[item++] = new TestCase( SECTION, "new Boolean('0')", true, (new Boolean("0")).valueOf() ); + array[item++] = new TestCase( SECTION, "new Boolean(true)", true, (new Boolean(true)).valueOf() ); + array[item++] = new TestCase( SECTION, "new Boolean(false)", false, (new Boolean(false)).valueOf() ); + array[item++] = new TestCase( SECTION, "new Boolean('true')", true, (new Boolean("true")).valueOf() ); + array[item++] = new TestCase( SECTION, "new Boolean('false')", true, (new Boolean('false')).valueOf() ); + + array[item++] = new TestCase( SECTION, "new Boolean('')", false, (new Boolean('')).valueOf() ); + array[item++] = new TestCase( SECTION, "new Boolean(null)", false, (new Boolean(null)).valueOf() ); + array[item++] = new TestCase( SECTION, "new Boolean(void(0))", false, (new Boolean(void(0))).valueOf() ); + array[item++] = new TestCase( SECTION, "new Boolean(-Infinity)", true, (new Boolean(Number.NEGATIVE_INFINITY)).valueOf() ); + array[item++] = new TestCase( SECTION, "new Boolean(NaN)", false, (new Boolean(Number.NaN)).valueOf() ); + array[item++] = new TestCase( SECTION, "new Boolean()", false, (new Boolean()).valueOf() ); + + array[item++] = new TestCase( SECTION, "new Boolean(x=1)", true, (new Boolean(x=1)).valueOf() ); + array[item++] = new TestCase( SECTION, "new Boolean(x=0)", false, (new Boolean(x=0)).valueOf() ); + array[item++] = new TestCase( SECTION, "new Boolean(x=false)", false, (new Boolean(x=false)).valueOf() ); + array[item++] = new TestCase( SECTION, "new Boolean(x=true)", true, (new Boolean(x=true)).valueOf() ); + array[item++] = new TestCase( SECTION, "new Boolean(x=null)", false, (new Boolean(x=null)).valueOf() ); + array[item++] = new TestCase( SECTION, "new Boolean(x='')", false, (new Boolean(x="")).valueOf() ); + array[item++] = new TestCase( SECTION, "new Boolean(x=' ')", true, (new Boolean(x=" ")).valueOf() ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Boolean/e15_6_4_3_2.as b/mozilla/js/tamarin/test/ecma3/Boolean/e15_6_4_3_2.as new file mode 100644 index 00000000000..fd757327d6f --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Boolean/e15_6_4_3_2.as @@ -0,0 +1,70 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.6.4.3-2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Boolean.prototype.valueOf()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = new Array(); + + testcases = getTestCases(); + + test(); +function getTestCases() { + var array = new Array(); + var item = 0; + + valof=Boolean.prototype.valueOf; + Boolean.prototype.valueOf=valof; + x=new Boolean(); + + array[item++] = new TestCase( SECTION, + "valof=Boolean.prototype.valueOf; Boolean.prototpye.valueOf=valof; x=new Boolean();x.valueOf()", + false, + x.valueOf()); + + x=new Boolean(true); + array[item++] = new TestCase( SECTION, + "valof=Boolean.prototype.valueOf; Boolean.prototpye.valueOf=valof; x=new Boolean(true);x.valueOf()", + true, + x.valueOf()); + + x=new Boolean(false); + array[item++] = new TestCase( SECTION, + "valof=Boolean.prototype.valueOf; Boolean.prototpye.valueOf=valof; x=new Boolean(false);x.valueOf()", + false, + x.valueOf()); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Boolean/e15_6_4_3_3.as b/mozilla/js/tamarin/test/ecma3/Boolean/e15_6_4_3_3.as new file mode 100644 index 00000000000..069a3d856e0 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Boolean/e15_6_4_3_3.as @@ -0,0 +1,61 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.6.4.3-3"; + var VERSION = "ECMA_4"; + startTest(); + var TITLE = "Boolean.prototype.valueOf()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = new Array(); + + testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + valof=Boolean.prototype.valueOf; + Boolean.prototype.valueOf=valof; + x=true; + array[item++] = new TestCase( SECTION, + "valof=Boolean.prototype.valueOf; Boolean.prototype.valueOf=valof; x=true; x.valueOf()", + true, + x.valueOf()); + x=false; + array[item++] = new TestCase( SECTION, + "valof=Boolean.prototype.valueOf; Boolean.prototype.valueOf=valof; x=false; x.valueOf()", + false, + x.valueOf()); + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Boolean/e15_6_4__1.as b/mozilla/js/tamarin/test/ecma3/Boolean/e15_6_4__1.as new file mode 100644 index 00000000000..0b589e386b6 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Boolean/e15_6_4__1.as @@ -0,0 +1,68 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + var VERSION = "ECMA_1" + startTest(); + var SECTION = "15.6.4-1"; + + writeHeaderToLog( SECTION + " Properties of the Boolean Prototype Object"); + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "typeof Boolean.prototype == typeof( new Object )", + true, + typeof Boolean.prototype == typeof( new Object ) ); + array[item++] = new TestCase( SECTION, "typeof( Boolean.prototype )", + "object", + typeof(Boolean.prototype) ); + + //save original toString + var origToString:Function = Boolean.prototype.toString; + + Boolean.prototype.toString = Object.prototype.toString; + array[item++] = new TestCase( SECTION, + "Boolean.prototype.toString = Object.prototype.toString; Boolean.prototype.toString()", + "[object Object]", + Boolean.prototype.toString()); + array[item++] = new TestCase( SECTION, "Boolean.prototype.valueOf()", + false, + Boolean.prototype.valueOf()); + + //restore original toString + Boolean.prototype.toString = origToString; + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Boolean/ecma4_sealedtype_1_rt.as b/mozilla/js/tamarin/test/ecma3/Boolean/ecma4_sealedtype_1_rt.as new file mode 100644 index 00000000000..7b3ef899c90 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Boolean/ecma4_sealedtype_1_rt.as @@ -0,0 +1,62 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + In Ecma4 there are three sealed types; Boolean, Number and String + You cannot set properties of an instance of a sealed type + + Should throw a ReferenceError + +*/ + var SECTION = "ECMA_4"; + var VERSION = "ECMA_4"; + startTest(); + var TITLE = "tostr=Boolean.prototype.toString;x=new Boolean();x.toString=tostr;"; + writeHeaderToLog( TITLE ); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + var thisError="no error"; + + try { + tostr=Boolean.prototype.toString; + x=new Boolean(); + x.toString=tostr; + } catch (e) { + thisError = e.toString(); + } finally { + array[item++] =new TestCase(SECTION,"Cannot create a property on Boolean","ReferenceError: Error #1056",referenceError( thisError ) ); + } + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Boolean/ecma4_sealedtype_2_rt.as b/mozilla/js/tamarin/test/ecma3/Boolean/ecma4_sealedtype_2_rt.as new file mode 100644 index 00000000000..802980234aa --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Boolean/ecma4_sealedtype_2_rt.as @@ -0,0 +1,60 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + In Ecma4 there are three sealed types; Boolean, Number and String + You cannot set properties of an instance of a sealed type + + Should throw a ReferenceError + +*/ + var SECTION = "ECMA_4"; + var VERSION = "ECMA_4"; + startTest(); + var TITLE = "Boolean.myString = Boolean.prototype.toString;"; + writeHeaderToLog( TITLE ); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array:Array = new Array(); + var item:Number = 0; + var thisError:String="no error"; + + try{ + Boolean.myString = Boolean.prototype.toString; + } catch (e:ReferenceError) { + thisError = e.toString(); + } finally{ + array[item++] =new TestCase(SECTION,"Cannot create a property on Boolean","no error",referenceError( thisError ) ); + } + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Boolean/ecma4_sealedtype_3_rt.as b/mozilla/js/tamarin/test/ecma3/Boolean/ecma4_sealedtype_3_rt.as new file mode 100644 index 00000000000..7a5ea1f1b6f --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Boolean/ecma4_sealedtype_3_rt.as @@ -0,0 +1,65 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + In Ecma4 there are three sealed types; Boolean, Number and String + You cannot set properties of an instance of a sealed type + + Should throw a ReferenceError + +*/ + var SECTION = "ECMA_4"; + var VERSION = "ECMA_4"; + startTest(); + var TITLE = "tostr=Boolean.prototype.toString;x=new Boolean(false);x.toString=tostr;"; + writeHeaderToLog( TITLE ); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var tostr=Boolean.prototype.toString; + var x=new Boolean(false); + + var thisError:String="no error"; + try{ + x.myString=tostr; + x.toString(); + } catch (e:ReferenceError) { + thisError = e.toString(); + } finally { + array[item++] =new TestCase(SECTION,"Cannot create a property on Boolean","ReferenceError: Error #1056",referenceError( thisError ) ); + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Boolean/ecma4_sealedtype_4_rt.as b/mozilla/js/tamarin/test/ecma3/Boolean/ecma4_sealedtype_4_rt.as new file mode 100644 index 00000000000..7ed03d6ad7d --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Boolean/ecma4_sealedtype_4_rt.as @@ -0,0 +1,61 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + In Ecma4 there are three sealed types; Boolean, Number and String + You cannot set properties of an instance of a sealed type + + Should throw a ReferenceError + +*/ + var SECTION = "ECMA_4"; + var VERSION = "ECMA_4"; + startTest(); + var TITLE = "tostr=Boolean.prototype.toString;x=false;x.toString=tostr;"; + writeHeaderToLog( TITLE ); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array:Array = new Array(); + var item:Number = 0; + var thisError:String="no error"; + try{ + var tostr=Boolean.prototype.toString; + var x:Boolean=false; + x.myString=tostr; + } catch (e:ReferenceError) { + thisError = e.toString(); + } finally { + array[item++] =new TestCase(SECTION,"Cannot create a property on Boolean","ReferenceError: Error #1056",referenceError(thisError)); + } + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Boolean/ecma4_sealedtype_5_rt.as b/mozilla/js/tamarin/test/ecma3/Boolean/ecma4_sealedtype_5_rt.as new file mode 100644 index 00000000000..c8404fd6605 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Boolean/ecma4_sealedtype_5_rt.as @@ -0,0 +1,62 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + In Ecma4 there are three sealed types; Boolean, Number and String + You cannot set properties of an instance of a sealed type + + Should throw a ReferenceError + +*/ + var SECTION = "ECMA_4"; + var VERSION = "ECMA_4"; + startTest(); + var TITLE = "tostr=Boolean.prototype.toString;x=true;x.toString=tostr;"; + writeHeaderToLog( TITLE ); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + var thisError:String="no error"; + + try{ + var tostr=Boolean.prototype.toString; + var x:Boolean=true; + x.prototype=tostr; + } catch (e:ReferenceError) { + thisError = e.toString(); + } finally { + array[item++] =new TestCase(SECTION,"Cannot set property on an instance of Boolean","ReferenceError: Error #1056",referenceError( thisError ) ); + } + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Boolean/ecma4_st_valueOf_1_rt.as b/mozilla/js/tamarin/test/ecma3/Boolean/ecma4_st_valueOf_1_rt.as new file mode 100644 index 00000000000..6c224cb934f --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Boolean/ecma4_st_valueOf_1_rt.as @@ -0,0 +1,75 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + In Ecma4 there are three sealed types; Boolean, Number and String + You cannot set properties of an instance of a sealed type + + Should throw a ReferenceError + + Author: mtilburg@macromedia.com + Date: October 13, 2004 + +*/ + var SECTION = "ECMA_4"; + var VERSION = "ECMA_4"; + startTest(); + var TITLE = "valof=Boolean.prototype.valueOf;booleanobj=true;booleanobj.valueOf=valof;"; + writeHeaderToLog( TITLE ); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var booleanObj:Boolean = new Boolean(); + + var thisError:String = "no error thrown"; + var array:Array = new Array(); + var item:Number = 0; + + var valof:Boolean=Boolean.prototype.valueOf; + try{ + booleanObj.ValueOf=true; + }catch(e:ReferenceError){ + thisError=e.toString(); + }finally{ + array[item++] =new TestCase(SECTION,"Cannot create a property on Boolean","ReferenceError: Error #1056",referenceError( thisError ) ); + } + + try{ + booleanObj.ValueOf=valof; + }catch(e1:ReferenceError){ + thisError=e1.toString(); + }finally{ + array[item++] =new TestCase(SECTION,"Cannot create a property on Boolean","ReferenceError: Error #1056",referenceError( thisError ) ); + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Boolean/ecma4_st_valueOf_2_rt.as b/mozilla/js/tamarin/test/ecma3/Boolean/ecma4_st_valueOf_2_rt.as new file mode 100644 index 00000000000..1a735527c61 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Boolean/ecma4_st_valueOf_2_rt.as @@ -0,0 +1,74 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + In Ecma4 there are three sealed types; Boolean, Number and String + You cannot set properties of an instance of a sealed type + + Should throw a ReferenceError + + Author: mtilburg@macromedia.com + Date: October 13, 2004 + +*/ + var SECTION = "ECMA_4"; + var VERSION = "ECMA_4"; + startTest(); + var TITLE = "valof=Boolean.prototype.valueOf;booleanObj=false;booleanObj.valueOf=valof;"; + writeHeaderToLog( TITLE ); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var booleanObj:Boolean = new Boolean(); + + var thisError:String = "no error thrown"; + var array:Array = new Array(); + var item:Number = 0; + var valof=Boolean.prototype.valueOf; + try{ + booleanObj.ValueOf=false; + }catch(e:ReferenceError){ + thisError=e.toString(); + }finally{ + array[item++] =new TestCase(SECTION,"Cannot create a property on Boolean","ReferenceError: Error #1056",referenceError( thisError ) ); + } + + try{ + booleanObj.ValueOf=valof; + booleanObj.ValueOf(); + }catch(e1:ReferenceError){ + thisError=e1.toString(); + }finally{ + array[item++] =new TestCase(SECTION,"Cannot create a property on Boolean","ReferenceError: Error #1056",referenceError( thisError ) ); + } + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Boolean/ecma4_st_valueOf_3_rt.as b/mozilla/js/tamarin/test/ecma3/Boolean/ecma4_st_valueOf_3_rt.as new file mode 100644 index 00000000000..67c4ab4f370 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Boolean/ecma4_st_valueOf_3_rt.as @@ -0,0 +1,68 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + In Ecma4 there are three sealed types; Boolean, Number and String + You cannot set properties of an instance of a sealed type + + Should throw a ReferenceError + + Author: mtilburg@macromedia.com + Date: October 13, 2004 + +*/ + var SECTION = "ECMA_4"; + var VERSION = "ECMA_4"; + startTest(); + var TITLE = "valof=Boolean.prototype.valueOf;booleanObj=new Boolean();booleanObj.valueOf=valof;"; + writeHeaderToLog( TITLE ); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + + var booleanObj:Boolean = new Boolean(); + + var thisError:String = "no error thrown"; + var array:Array = new Array(); + var item:Number = 0; + var valof=Boolean.prototype.valueOf; + + try{ + booleanObj.ValueOf = valof; + }catch(e:ReferenceError){ + thisError=e.toString(); + }finally{ + array[item++] =new TestCase(SECTION,"Cannot create a property on Boolean","ReferenceError: Error #1056",referenceError( thisError ) ); + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Boolean/ecma4_st_valueOf_4_rt.as b/mozilla/js/tamarin/test/ecma3/Boolean/ecma4_st_valueOf_4_rt.as new file mode 100644 index 00000000000..7765a5ac23c --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Boolean/ecma4_st_valueOf_4_rt.as @@ -0,0 +1,67 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + In Ecma4 there are three sealed types; Boolean, Number and String + You cannot set properties of an instance of a sealed type + + Should throw a ReferenceError + + Author: mtilburg@macromedia.com + Date: October 13, 2004 + +*/ + var SECTION = "ECMA_4"; + var VERSION = "ECMA_4"; + startTest(); + var TITLE = "valof=Boolean.prototype.valueOf;booleanObj=new Boolean(true);booleanObj.valueOf=valof;"; + writeHeaderToLog( TITLE ); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var booleanObj:Boolean = new Boolean(true); + + var thisError = "no error thrown"; + var array = new Array(); + var item = 0; + var valof=Boolean.prototype.valueOf; + try{ + + booleanObj.valueOf=valof; + + }catch(e){ + thisError=e.toString(); + }finally{ + array[item++] =new TestCase(SECTION,"Cannot create a property on Boolean","ReferenceError: Error #1056",referenceError( thisError ) ); + } + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Boolean/ecma4_st_valueOf_5_rt.as b/mozilla/js/tamarin/test/ecma3/Boolean/ecma4_st_valueOf_5_rt.as new file mode 100644 index 00000000000..368319277af --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Boolean/ecma4_st_valueOf_5_rt.as @@ -0,0 +1,65 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + In Ecma4 there are three sealed types; Boolean, Number and String + You cannot set properties of an instance of a sealed type + + Should throw a ReferenceError + + Author: mtilburg@macromedia.com + Date: October 13, 2004 + +*/ + var SECTION = "ECMA_4"; + var VERSION = "ECMA_4"; + startTest(); + var TITLE = "valof=Boolean.prototype.valueOf;booleanObj=new Boolean(false);booleanObj.valueOf=valof;"; + writeHeaderToLog( TITLE ); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var booleanObj = new Boolean(false); + var thisError = "no error thrown"; + var array = new Array(); + var item = 0; + + try{ + booleanObj.valueOf=true; + }catch(e){ + thisError=e.toString(); + }finally{ + array[item++] =new TestCase(SECTION,"Cannot create a property on Boolean","ReferenceError: Error #1056",referenceError( thisError ) ); + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_1_1_1.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_1_1_1.as new file mode 100644 index 00000000000..dd10067fdd3 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_1_1_1.as @@ -0,0 +1,64 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +// every one hundred years contains: +// 24 years with 366 days +// +// every four hundred years contains: +// 97 years with 366 days +// 303 years with 365 days +// +// 86400000*365*97 = 3067372800000 +// +86400000*366*303 = + 9555408000000 +// = 1.26227808e+13 + var FOUR_HUNDRED_YEARS = 1.26227808e+13; + var SECTION = "15.9.1.1-1"; + + startTest(); + var testcases = getTestCases(); + + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + for ( M_SECS = 0, CURRENT_YEAR = 1970; + M_SECS < 8640000000000000; + tc++, M_SECS += FOUR_HUNDRED_YEARS, CURRENT_YEAR += 400 ) { + + array[item++] = new TestCase( SECTION, "new Date("+M_SECS+")", CURRENT_YEAR, (new Date( M_SECS)).getUTCFullYear() ); + } + + array[item++] = new TestCase( SECTION, "new Date(Number.NaN)", NaN, (new Date( Number.NaN)).getUTCFullYear() ); + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_1_1_2.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_1_1_2.as new file mode 100644 index 00000000000..012b1765b0e --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_1_1_2.as @@ -0,0 +1,67 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.1.1-2"; + var VERSION = "ECMA_1"; + var TITLE = "Time Range"; + + startTest(); + writeHeaderToLog( SECTION + " "+ TITLE); + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // every one hundred years contains: + // 24 years with 366 days + // + // every four hundred years contains: + // 97 years with 366 days + // 303 years with 365 days + // + // 86400000*366*97 = 3067372800000 + // +86400000*365*303 = + 9555408000000 + // = 1.26227808e+13 + + var FOUR_HUNDRED_YEARS = 1.26227808e+13; + + for ( M_SECS = 0, CURRENT_YEAR = 1970; + M_SECS > -8640000000000000; + item++, M_SECS -= FOUR_HUNDRED_YEARS, CURRENT_YEAR -= 400 ) { + + array[item] = new TestCase( SECTION, "new Date("+M_SECS+")", CURRENT_YEAR, (new Date( M_SECS )).getUTCFullYear() ); + + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_2_1.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_2_1.as new file mode 100644 index 00000000000..22505817b3b --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_2_1.as @@ -0,0 +1,93 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var VERSION = "ECMA_1"; + startTest(); + var SECTION = "15.9.2.1"; + var TITLE = "Date Constructor used as a function"; + var TYPEOF = "string"; + var TOLERANCE = 1000; + + writeHeaderToLog("15.9.2.1 The Date Constructor Called as a Function: " + + "Date( year, month, date, hours, minutes, seconds, ms )" ); + var testcases = getTestCases(); + +// all tests must call a function that returns an array of TestCase objects. + test(); + + + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TODAY = new Date(); + + // Dates around 1970 + + array[item++] = new TestCase( SECTION, "Date(1970,0,1,0,0,0,0)", true, (new Date()).toString() == Date(1970,0,1,0,0,0,0) ); + array[item++] = new TestCase( SECTION, "Date(1969,11,31,15,59,59,999)", true, (new Date()).toString() == Date(1969,11,31,15,59,59,999)) + array[item++] = new TestCase( SECTION, "Date(1969,11,31,16,0,0,0)", true, (new Date()).toString() == Date(1969,11,31,16,0,0,0)) + array[item++] = new TestCase( SECTION, "Date(1969,11,31,16,0,0,1)", true, (new Date()).toString() == Date(1969,11,31,16,0,0,1)) + + // Dates around 2000 + array[item++] = new TestCase( SECTION, "Date(1999,11,15,59,59,999)", true, (new Date()).toString() == Date(1999,11,15,59,59,999)); + array[item++] = new TestCase( SECTION, "Date(1999,11,16,0,0,0,0)", true, (new Date()).toString() == Date(1999,11,16,0,0,0,0)); + array[item++] = new TestCase( SECTION, "Date(1999,11,31,23,59,59,999)", true, (new Date()).toString() == Date(1999,11,31,23,59,59,999) ); + array[item++] = new TestCase( SECTION, "Date(2000,0,1,0,0,0,0)", true, (new Date()).toString() == Date(2000,0,0,0,0,0,0) ); + array[item++] = new TestCase( SECTION, "Date(2000,0,1,0,0,0,1)", true, (new Date()).toString() == Date(2000,0,0,0,0,0,1) ); + + // Dates around 1900 + + array[item++] = new TestCase( SECTION, "Date(1899,11,31,23,59,59,999)", true, (new Date()).toString() == Date(1899,11,31,23,59,59,999)); + array[item++] = new TestCase( SECTION, "Date(1900,0,1,0,0,0,0)", true, (new Date()).toString() == Date(1900,0,1,0,0,0,0) ); + array[item++] = new TestCase( SECTION, "Date(1900,0,1,0,0,0,1)", true, (new Date()).toString() == Date(1900,0,1,0,0,0,1) ); + array[item++] = new TestCase( SECTION, "Date(1899,11,31,16,0,0,0,0)", true, (new Date()).toString() == Date(1899,11,31,16,0,0,0,0)); + + // Dates around feb 29, 2000 + + array[item++] = new TestCase( SECTION, "Date( 2000,1,29,0,0,0,0)", true, (new Date()).toString() == Date(2000,1,29,0,0,0,0)); + array[item++] = new TestCase( SECTION, "Date( 2000,1,28,23,59,59,999)", true, (new Date()).toString() == Date( 2000,1,28,23,59,59,999)); + array[item++] = new TestCase( SECTION, "Date( 2000,1,27,16,0,0,0)", true, (new Date()).toString() == Date(2000,1,27,16,0,0,0)); + + // Dates around jan 1, 2005 + array[item++] = new TestCase( SECTION, "Date(2004,11,31,23,59,59,999)", true, (new Date()).toString() == Date(2004,11,31,23,59,59,999)); + array[item++] = new TestCase( SECTION, "Date(2005,0,1,0,0,0,0)", true, (new Date()).toString() == Date(2005,0,1,0,0,0,0) ); + array[item++] = new TestCase( SECTION, "Date(2005,0,1,0,0,0,1)", true, (new Date()).toString() == Date(2005,0,1,0,0,0,1) ); + array[item++] = new TestCase( SECTION, "Date(2004,11,31,16,0,0,0,0)", true, (new Date()).toString() == Date(2004,11,31,16,0,0,0,0)); + + // Dates around jan 1, 2032 + array[item++] = new TestCase( SECTION, "Date(2031,11,31,23,59,59,999)", true, (new Date()).toString() == Date(2031,11,31,23,59,59,999)); + array[item++] = new TestCase( SECTION, "Date(2032,0,1,0,0,0,0)", true, (new Date()).toString() == Date(2032,0,1,0,0,0,0) ); + array[item++] = new TestCase( SECTION, "Date(2032,0,1,0,0,0,1)", true, (new Date()).toString() == Date(2032,0,1,0,0,0,1) ); + array[item++] = new TestCase( SECTION, "Date(2031,11,31,16,0,0,0,0)", true, (new Date()).toString() == Date(2031,11,31,16,0,0,0,0)); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_2_2_1.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_2_2_1.as new file mode 100644 index 00000000000..8e0eea9a5d3 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_2_2_1.as @@ -0,0 +1,88 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var VERSION = 9706; + startTest(); + var SECTION = "15.9.2.2"; + var TOLERANCE = 100; + var TITLE = "The Date Constructor Called as a Function"; + + writeHeaderToLog(SECTION+" "+TITLE ); + var testcases = getTestCases(); + +// all tests must call a function that returns an array of TestCase objects. + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + + // Dates around 1970 + + array[item++] = new TestCase( SECTION, "Date(1970,0,1,0,0,0)", true, (new Date()).toString() == Date(1970,0,1,0,0,0) ); + array[item++] = new TestCase( SECTION, "Date(1969,11,31,15,59,59)", true, (new Date()).toString() == Date(1969,11,31,15,59,59)) + array[item++] = new TestCase( SECTION, "Date(1969,11,31,16,0,0)", true, (new Date()).toString() == Date(1969,11,31,16,0,0)) + array[item++] = new TestCase( SECTION, "Date(1969,11,31,16,0,1)", true, (new Date()).toString() == Date(1969,11,31,16,0,1)) +/* + // Dates around 2000 + array[item++] = new TestCase( SECTION, "Date(1999,11,15,59,59)", true, (new Date()).toString() == Date(1999,11,15,59,59)); + array[item++] = new TestCase( SECTION, "Date(1999,11,16,0,0,0)", true, (new Date()).toString() == Date(1999,11,16,0,0,0)); + array[item++] = new TestCase( SECTION, "Date(1999,11,31,23,59,59)", true, (new Date()).toString() == Date(1999,11,31,23,59,59) ); + array[item++] = new TestCase( SECTION, "Date(2000,0,1,0,0,0)", true, (new Date()).toString() == Date(2000,0,0,0,0,0) ); + array[item++] = new TestCase( SECTION, "Date(2000,0,1,0,0,1)", true, (new Date()).toString() == Date(2000,0,0,0,0,1) ); + + // Dates around 1900 + + array[item++] = new TestCase( SECTION, "Date(1899,11,31,23,59,59)", true, (new Date()).toString() == Date(1899,11,31,23,59,59)); + array[item++] = new TestCase( SECTION, "Date(1900,0,1,0,0,0)", true, (new Date()).toString() == Date(1900,0,1,0,0,0) ); + array[item++] = new TestCase( SECTION, "Date(1900,0,1,0,0,1)", true, (new Date()).toString() == Date(1900,0,1,0,0,1) ); + array[item++] = new TestCase( SECTION, "Date(1899,11,31,16,0,0,0)", true, (new Date()).toString() == Date(1899,11,31,16,0,0,0)); + + // Dates around feb 29, 2000 + + array[item++] = new TestCase( SECTION, "Date( 2000,1,29,0,0,0)", true, (new Date()).toString() == Date(2000,1,29,0,0,0)); + array[item++] = new TestCase( SECTION, "Date( 2000,1,28,23,59,59)", true, (new Date()).toString() == Date( 2000,1,28,23,59,59)); + array[item++] = new TestCase( SECTION, "Date( 2000,1,27,16,0,0)", true, (new Date()).toString() == Date(2000,1,27,16,0,0)); + + // Dates around jan 1, 2005 + array[item++] = new TestCase( SECTION, "Date(2004,11,31,23,59,59)", true, (new Date()).toString() == Date(2004,11,31,23,59,59)); + array[item++] = new TestCase( SECTION, "Date(2005,0,1,0,0,0)", true, (new Date()).toString() == Date(2005,0,1,0,0,0) ); + array[item++] = new TestCase( SECTION, "Date(2005,0,1,0,0,1)", true, (new Date()).toString() == Date(2005,0,1,0,0,1) ); + array[item++] = new TestCase( SECTION, "Date(2004,11,31,16,0,0,0)", true, (new Date()).toString() == Date(2004,11,31,16,0,0,0)); + + // Dates around jan 1, 2032 + array[item++] = new TestCase( SECTION, "Date(2031,11,31,23,59,59)", true, (new Date()).toString() == Date(2031,11,31,23,59,59)); + array[item++] = new TestCase( SECTION, "Date(2032,0,1,0,0,0)", true, (new Date()).toString() == Date(2032,0,1,0,0,0) ); + array[item++] = new TestCase( SECTION, "Date(2032,0,1,0,0,1)", true, (new Date()).toString() == Date(2032,0,1,0,0,1) ); + array[item++] = new TestCase( SECTION, "Date(2031,11,31,16,0,0,0)", true, (new Date()).toString() == Date(2031,11,31,16,0,0,0)); +*/ + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_2_2_2.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_2_2_2.as new file mode 100644 index 00000000000..5b51164f09a --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_2_2_2.as @@ -0,0 +1,82 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var VERSION = 9706; + startTest(); + var SECTION = "15.9.2.2"; + var TOLERANCE = 100; + var TITLE = "The Date Constructor Called as a Function"; + + writeHeaderToLog(SECTION+" "+TITLE ); + var testcases = getTestCases(); + +// all tests must call a function that returns an array of TestCase objects. + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + + // Dates around 2000 + array[item++] = new TestCase( SECTION, "Date(1999,11,15,59,59)", true, (new Date()).toString() == Date(1999,11,15,59,59)); + array[item++] = new TestCase( SECTION, "Date(1999,11,16,0,0,0)", true, (new Date()).toString() == Date(1999,11,16,0,0,0)); + array[item++] = new TestCase( SECTION, "Date(1999,11,31,23,59,59)", true, (new Date()).toString() == Date(1999,11,31,23,59,59) ); + array[item++] = new TestCase( SECTION, "Date(2000,0,1,0,0,0)", true, (new Date()).toString() == Date(2000,0,0,0,0,0) ); + array[item++] = new TestCase( SECTION, "Date(2000,0,1,0,0,1)", true, (new Date()).toString() == Date(2000,0,0,0,0,1) ); + +/* + // Dates around 1900 + + array[item++] = new TestCase( SECTION, "Date(1899,11,31,23,59,59)", true, (new Date()).toString() == Date(1899,11,31,23,59,59)); + array[item++] = new TestCase( SECTION, "Date(1900,0,1,0,0,0)", true, (new Date()).toString() == Date(1900,0,1,0,0,0) ); + array[item++] = new TestCase( SECTION, "Date(1900,0,1,0,0,1)", true, (new Date()).toString() == Date(1900,0,1,0,0,1) ); + array[item++] = new TestCase( SECTION, "Date(1899,11,31,16,0,0,0)", true, (new Date()).toString() == Date(1899,11,31,16,0,0,0)); + + // Dates around feb 29, 2000 + + array[item++] = new TestCase( SECTION, "Date( 2000,1,29,0,0,0)", true, (new Date()).toString() == Date(2000,1,29,0,0,0)); + array[item++] = new TestCase( SECTION, "Date( 2000,1,28,23,59,59)", true, (new Date()).toString() == Date( 2000,1,28,23,59,59)); + array[item++] = new TestCase( SECTION, "Date( 2000,1,27,16,0,0)", true, (new Date()).toString() == Date(2000,1,27,16,0,0)); + + // Dates around jan 1, 2005 + array[item++] = new TestCase( SECTION, "Date(2004,11,31,23,59,59)", true, (new Date()).toString() == Date(2004,11,31,23,59,59)); + array[item++] = new TestCase( SECTION, "Date(2005,0,1,0,0,0)", true, (new Date()).toString() == Date(2005,0,1,0,0,0) ); + array[item++] = new TestCase( SECTION, "Date(2005,0,1,0,0,1)", true, (new Date()).toString() == Date(2005,0,1,0,0,1) ); + array[item++] = new TestCase( SECTION, "Date(2004,11,31,16,0,0,0)", true, (new Date()).toString() == Date(2004,11,31,16,0,0,0)); + + // Dates around jan 1, 2032 + array[item++] = new TestCase( SECTION, "Date(2031,11,31,23,59,59)", true, (new Date()).toString() == Date(2031,11,31,23,59,59)); + array[item++] = new TestCase( SECTION, "Date(2032,0,1,0,0,0)", true, (new Date()).toString() == Date(2032,0,1,0,0,0) ); + array[item++] = new TestCase( SECTION, "Date(2032,0,1,0,0,1)", true, (new Date()).toString() == Date(2032,0,1,0,0,1) ); + array[item++] = new TestCase( SECTION, "Date(2031,11,31,16,0,0,0)", true, (new Date()).toString() == Date(2031,11,31,16,0,0,0)); +*/ + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_2_2_3.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_2_2_3.as new file mode 100644 index 00000000000..6a5bfe36c51 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_2_2_3.as @@ -0,0 +1,74 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var VERSION = 9706; + startTest(); + var SECTION = "15.9.2.2"; + var TOLERANCE = 100; + var TITLE = "The Date Constructor Called as a Function"; + + writeHeaderToLog(SECTION+" "+TITLE ); + var testcases = getTestCases(); + +// all tests must call a function that returns an array of TestCase objects. + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // Dates around 1900 + + array[item++] = new TestCase( SECTION, "Date(1899,11,31,23,59,59)", true, (new Date()).toString() == Date(1899,11,31,23,59,59)); + array[item++] = new TestCase( SECTION, "Date(1900,0,1,0,0,0)", true, (new Date()).toString() == Date(1900,0,1,0,0,0) ); + array[item++] = new TestCase( SECTION, "Date(1900,0,1,0,0,1)", true, (new Date()).toString() == Date(1900,0,1,0,0,1) ); + array[item++] = new TestCase( SECTION, "Date(1899,11,31,16,0,0,0)", true, (new Date()).toString() == Date(1899,11,31,16,0,0,0)); + +/* + // Dates around feb 29, 2000 + + array[item++] = new TestCase( SECTION, "Date( 2000,1,29,0,0,0)", true, (new Date()).toString() == Date(2000,1,29,0,0,0)); + array[item++] = new TestCase( SECTION, "Date( 2000,1,28,23,59,59)", true, (new Date()).toString() == Date( 2000,1,28,23,59,59)); + array[item++] = new TestCase( SECTION, "Date( 2000,1,27,16,0,0)", true, (new Date()).toString() == Date(2000,1,27,16,0,0)); + + // Dates around jan 1, 2005 + array[item++] = new TestCase( SECTION, "Date(2004,11,31,23,59,59)", true, (new Date()).toString() == Date(2004,11,31,23,59,59)); + array[item++] = new TestCase( SECTION, "Date(2005,0,1,0,0,0)", true, (new Date()).toString() == Date(2005,0,1,0,0,0) ); + array[item++] = new TestCase( SECTION, "Date(2005,0,1,0,0,1)", true, (new Date()).toString() == Date(2005,0,1,0,0,1) ); + array[item++] = new TestCase( SECTION, "Date(2004,11,31,16,0,0,0)", true, (new Date()).toString() == Date(2004,11,31,16,0,0,0)); + + // Dates around jan 1, 2032 + array[item++] = new TestCase( SECTION, "Date(2031,11,31,23,59,59)", true, (new Date()).toString() == Date(2031,11,31,23,59,59)); + array[item++] = new TestCase( SECTION, "Date(2032,0,1,0,0,0)", true, (new Date()).toString() == Date(2032,0,1,0,0,0) ); + array[item++] = new TestCase( SECTION, "Date(2032,0,1,0,0,1)", true, (new Date()).toString() == Date(2032,0,1,0,0,1) ); + array[item++] = new TestCase( SECTION, "Date(2031,11,31,16,0,0,0)", true, (new Date()).toString() == Date(2031,11,31,16,0,0,0)); +*/ + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_2_2_4.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_2_2_4.as new file mode 100644 index 00000000000..3666c495c17 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_2_2_4.as @@ -0,0 +1,68 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var VERSION = 9706; + startTest(); + var SECTION = "15.9.2.2"; + var TOLERANCE = 100; + var TITLE = "The Date Constructor Called as a Function"; + + writeHeaderToLog(SECTION+" "+TITLE ); + var testcases = getTestCases(); + +// all tests must call a function that returns an array of TestCase objects. + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + + // Dates around feb 29, 2000 + + array[item++] = new TestCase( SECTION, "Date( 2000,1,29,0,0,0)", true, (new Date()).toString() == Date(2000,1,29,0,0,0)); + array[item++] = new TestCase( SECTION, "Date( 2000,1,28,23,59,59)", true, (new Date()).toString() == Date( 2000,1,28,23,59,59)); + array[item++] = new TestCase( SECTION, "Date( 2000,1,27,16,0,0)", true, (new Date()).toString() == Date(2000,1,27,16,0,0)); + +/* + // Dates around jan 1, 2005 + array[item++] = new TestCase( SECTION, "Date(2004,11,31,23,59,59)", true, (new Date()).toString() == Date(2004,11,31,23,59,59)); + array[item++] = new TestCase( SECTION, "Date(2005,0,1,0,0,0)", true, (new Date()).toString() == Date(2005,0,1,0,0,0) ); + array[item++] = new TestCase( SECTION, "Date(2005,0,1,0,0,1)", true, (new Date()).toString() == Date(2005,0,1,0,0,1) ); + array[item++] = new TestCase( SECTION, "Date(2004,11,31,16,0,0,0)", true, (new Date()).toString() == Date(2004,11,31,16,0,0,0)); + + // Dates around jan 1, 2032 + array[item++] = new TestCase( SECTION, "Date(2031,11,31,23,59,59)", true, (new Date()).toString() == Date(2031,11,31,23,59,59)); + array[item++] = new TestCase( SECTION, "Date(2032,0,1,0,0,0)", true, (new Date()).toString() == Date(2032,0,1,0,0,0) ); + array[item++] = new TestCase( SECTION, "Date(2032,0,1,0,0,1)", true, (new Date()).toString() == Date(2032,0,1,0,0,1) ); + array[item++] = new TestCase( SECTION, "Date(2031,11,31,16,0,0,0)", true, (new Date()).toString() == Date(2031,11,31,16,0,0,0)); +*/ + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_2_2_5.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_2_2_5.as new file mode 100644 index 00000000000..2021d0998aa --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_2_2_5.as @@ -0,0 +1,61 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var VERSION = 9706; + startTest(); + var SECTION = "15.9.2.2"; + var TOLERANCE = 100; + var TITLE = "The Date Constructor Called as a Function"; + + writeHeaderToLog(SECTION+" "+TITLE ); + var testcases = getTestCases(); + +// all tests must call a function that returns an array of TestCase objects. + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + + // Dates around jan 1, 2005 + array[item++] = new TestCase( SECTION, "Date(2004,11,31,23,59,59)", true, (new Date()).toString() == Date(2004,11,31,23,59,59)); + array[item++] = new TestCase( SECTION, "Date(2005,0,1,0,0,0)", true, (new Date()).toString() == Date(2005,0,1,0,0,0) ); + array[item++] = new TestCase( SECTION, "Date(2005,0,1,0,0,1)", true, (new Date()).toString() == Date(2005,0,1,0,0,1) ); + array[item++] = new TestCase( SECTION, "Date(2004,11,31,16,0,0,0)", true, (new Date()).toString() == Date(2004,11,31,16,0,0,0)); +/* + // Dates around jan 1, 2032 + array[item++] = new TestCase( SECTION, "Date(2031,11,31,23,59,59)", true, (new Date()).toString() == Date(2031,11,31,23,59,59)); + array[item++] = new TestCase( SECTION, "Date(2032,0,1,0,0,0)", true, (new Date()).toString() == Date(2032,0,1,0,0,0) ); + array[item++] = new TestCase( SECTION, "Date(2032,0,1,0,0,1)", true, (new Date()).toString() == Date(2032,0,1,0,0,1) ); + array[item++] = new TestCase( SECTION, "Date(2031,11,31,16,0,0,0)", true, (new Date()).toString() == Date(2031,11,31,16,0,0,0)); +*/ + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_2_2_6.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_2_2_6.as new file mode 100644 index 00000000000..84320ef43ab --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_2_2_6.as @@ -0,0 +1,55 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var VERSION = 9706; + startTest(); + var SECTION = "15.9.2.2"; + var TOLERANCE = 100; + var TITLE = "The Date Constructor Called as a Function"; + + writeHeaderToLog(SECTION+" "+TITLE ); + var testcases = getTestCases(); + +// all tests must call a function that returns an array of TestCase objects. + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + + // Dates around jan 1, 2032 + array[item++] = new TestCase( SECTION, "Date(2031,11,31,23,59,59)", true, (new Date()).toString() == Date(2031,11,31,23,59,59)); + array[item++] = new TestCase( SECTION, "Date(2032,0,1,0,0,0)", true, (new Date()).toString() == Date(2032,0,1,0,0,0) ); + array[item++] = new TestCase( SECTION, "Date(2032,0,1,0,0,1)", true, (new Date()).toString() == Date(2032,0,1,0,0,1) ); + array[item++] = new TestCase( SECTION, "Date(2031,11,31,16,0,0,0)", true, (new Date()).toString() == Date(2031,11,31,16,0,0,0)); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_3_1_1.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_3_1_1.as new file mode 100644 index 00000000000..f1415bd9590 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_3_1_1.as @@ -0,0 +1,287 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.3.1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "new Date( year, month, date, hours, minutes, seconds, ms )"; + + var TIME = 0; + var UTC_YEAR = 1; + var UTC_MONTH = 2; + var UTC_DATE = 3; + var UTC_DAY = 4; + var UTC_HOURS = 5; + var UTC_MINUTES = 6; + var UTC_SECONDS = 7; + var UTC_MS = 8; + + var YEAR = 9; + var MONTH = 10; + var DATE = 11; + var DAY = 12; + var HOURS = 13; + var MINUTES = 14; + var SECONDS = 15; + var MS = 16; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // all the "ResultArrays" below are hard-coded to Pacific Standard Time values - + var TZ_ADJUST = TZ_PST * msPerHour; + + // Dates around 1970 + + addNewTestCase( new Date( 1969,11,31,15,59,59,999), + "new Date( 1969,11,31,15,59,59,999)", + [TIME_1970-1,1969,11,31,3,23,59,59,999,1969,11,31,3,15,59,59,999] ); + + addNewTestCase( new Date( "1969","11","31","15","59","59","999"), + "new Date( '1969','11','31','15','59','59','999')", + [TIME_1970-1,1969,11,31,3,23,59,59,999,1969,11,31,3,15,59,59,999] ); + + + + addNewTestCase( new Date( 1969,11,31,23,59,59,999), + "new Date( 1969,11,31,23,59,59,999)", + [TIME_1970-TZ_ADJUST-1,1970,0,1,4,7,59,59,999,1969,11,31,3,23,59,59,999] ); + + addNewTestCase( new Date( 1970,0,1,0,0,0,0), + "new Date( 1970,0,1,0,0,0,0)", + [TIME_1970-TZ_ADJUST,1970,0,1,4,8,0,0,0,1970,0,1,4,0,0,0,0] ); + + addNewTestCase( new Date( 1969,11,31,16,0,0,0), + "new Date( 1969,11,31,16,0,0,0)", + [TIME_1970,1970,0,1,4,0,0,0,0,1969,11,31,3,16,0,0,0] ); + + addNewTestCase( new Date(1969,12,1,0,0,0,0), + "new Date(1969,12,1,0,0,0,0)", + [TIME_1970-TZ_ADJUST,1970,0,1,4,8,0,0,0,1970,0,1,4,0,0,0,0] ); + + addNewTestCase( new Date(1969,11,32,0,0,0,0), + "new Date(1969,11,32,0,0,0,0)", + [TIME_1970-TZ_ADJUST,1970,0,1,4,8,0,0,0,1970,0,1,4,0,0,0,0] ); + + addNewTestCase( new Date(1969,11,31,24,0,0,0), + "new Date(1969,11,31,24,0,0,0)", + [TIME_1970-TZ_ADJUST,1970,0,1,4,8,0,0,0,1970,0,1,4,0,0,0,0] ); + + addNewTestCase( new Date(1969,11,31,23,60,0,0), + "new Date(1969,11,31,23,60,0,0)", + [TIME_1970-TZ_ADJUST,1970,0,1,4,8,0,0,0,1970,0,1,4,0,0,0,0] ); + + addNewTestCase( new Date(1969,11,31,23,59,60,0), + "new Date(1969,11,31,23,59,60,0)", + [TIME_1970-TZ_ADJUST,1970,0,1,4,8,0,0,0,1970,0,1,4,0,0,0,0] ); + + addNewTestCase( new Date(1969,11,31,23,59,59,1000), + "new Date(1969,11,31,23,59,59,1000)", + [TIME_1970-TZ_ADJUST,1970,0,1,4,8,0,0,0,1970,0,1,4,0,0,0,0] ); + + // Dates around 2000 + + addNewTestCase( new Date( 1999,11,31,15,59,59,999), + "new Date( 1999,11,31,15,59,59,999)", + [TIME_2000-1,1999,11,31,5,23,59,59,999,1999,11,31,5,15,59,59,999] ); + + addNewTestCase( new Date( 1999,11,31,16,0,0,0), + "new Date( 1999,11,31,16,0,0,0)", + [TIME_2000,2000,0,1,6,0,0,0,0,1999,11,31,5, 16,0,0,0] ); + + addNewTestCase( new Date( 1999,11,31,23,59,59,999), + "new Date( 1999,11,31,23,59,59,999)", + [TIME_2000-TZ_ADJUST-1,2000,0,1,6,7,59,59,999,1999,11,31,5,23,59,59,999] ); + + addNewTestCase( new Date( 2000,0,1,0,0,0,0), + "new Date( 2000,0,1,0,0,0,0)", + [TIME_2000-TZ_ADJUST,2000,0,1,6,8,0,0,0,2000,0,1,6,0,0,0,0] ); + + addNewTestCase( new Date( 2000,0,1,0,0,0,1), + "new Date( 2000,0,1,0,0,0,1)", + [TIME_2000-TZ_ADJUST+1,2000,0,1,6,8,0,0,1,2000,0,1,6,0,0,0,1] ); + + // Dates around 29 Feb 2000 + + var UTC_FEB_29_2000 = TIME_2000 + ( 30 * msPerDay ) + ( 29 * msPerDay ); + + addNewTestCase( new Date(2000,1,28,16,0,0,0), + "new Date(2000,1,28,16,0,0,0)", + [UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0] ); + + addNewTestCase( new Date(2000,1,29,0,0,0,0), + "new Date(2000,1,29,0,0,0,0)", + [UTC_FEB_29_2000-TZ_ADJUST,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] ); + + addNewTestCase( new Date(2000,1,28,24,0,0,0), + "new Date(2000,1,28,24,0,0,0)", + [UTC_FEB_29_2000-TZ_ADJUST,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] ); + + addNewTestCase( new Date("2000","1","28","16","0","0","0"), + "new Date('2000','1','28','16','0','0','0')", + [UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0] ); + + addNewTestCase( new Date("2000","1","29","0","0","0","0"), + "new Date('2000','1','29','0','0','0','0')", + [UTC_FEB_29_2000-TZ_ADJUST,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] ); + + addNewTestCase( new Date("2000","1","28","24","0","0","0"), + "new Date('2000','1','28','24','0','0','0')", + [UTC_FEB_29_2000-TZ_ADJUST,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] ); + + // Dates around 1900 + + addNewTestCase( new Date(1899,11,31,16,0,0,0), + "new Date(1899,11,31,16,0,0,0)", + [TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] ); + addNewTestCase( new Date("1899","11","31","16","0","0","0"), + "new Date('1899','11','31','16','0','0','0')", + [TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] ); + + addNewTestCase( new Date(1899,11,31,15,59,59,999), + "new Date(1899,11,31,15,59,59,999)", + [TIME_1900-1,1899,11,31,0,23,59,59,999,1899,11,31,0,15,59,59,999] ); + addNewTestCase( new Date("1899","11","31","15","59","59","999"), + "new Date('1899','11','31','15','59','59','999')", + [TIME_1900-1,1899,11,31,0,23,59,59,999,1899,11,31,0,15,59,59,999] ); + + + addNewTestCase( new Date(1899,11,31,23,59,59,999), + "new Date(1899,11,31,23,59,59,999)", + [TIME_1900-TZ_ADJUST-1,1900,0,1,1,7,59,59,999,1899,11,31,0,23,59,59,999] ); + addNewTestCase( new Date("1899","11","31","23","59","59","999"), + "new Date('1899','11','31','23','59','59','999')", + [TIME_1900-TZ_ADJUST-1,1900,0,1,1,7,59,59,999,1899,11,31,0,23,59,59,999] ); + + addNewTestCase( new Date(1900,0,1,0,0,0,0), + "new Date(1900,0,1,0,0,0,0)", + [TIME_1900-TZ_ADJUST,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] ); + addNewTestCase( new Date("1900","0","1","0","0","0","0"), + "new Date('1900','0','1','0','0','0','0')", + [TIME_1900-TZ_ADJUST,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] ); + + + addNewTestCase( new Date(1900,0,1,0,0,0,1), + "new Date(1900,0,1,0,0,0,1)", + [TIME_1900-TZ_ADJUST+1,1900,0,1,1,8,0,0,1,1900,0,1,1,0,0,0,1] ); + + addNewTestCase( new Date("1900","0","1","0","0","0","1"), + "new Date('1900','0','1','0','0','0','1')", + [TIME_1900-TZ_ADJUST+1,1900,0,1,1,8,0,0,1,1900,0,1,1,0,0,0,1] ); + + // Dates around 2005 + + var UTC_YEAR_2005 = TIME_2000 + TimeInYear(2000) + TimeInYear(2001) + + TimeInYear(2002) + TimeInYear(2003) + TimeInYear(2004); + + addNewTestCase( new Date(2005,0,1,0,0,0,0), + "new Date(2005,0,1,0,0,0,0)", + [UTC_YEAR_2005-TZ_ADJUST,2005,0,1,6,8,0,0,0,2005,0,1,6,0,0,0,0] ); + addNewTestCase( new Date("2005","0","1","0","0","0","0"), + "new Date('2005','0','1','0','0','0','0')", + [UTC_YEAR_2005-TZ_ADJUST,2005,0,1,6,8,0,0,0,2005,0,1,6,0,0,0,0] ); + + addNewTestCase( new Date(2004,11,31,16,0,0,0), + "new Date(2004,11,31,16,0,0,0)", + [UTC_YEAR_2005,2005,0,1,6,0,0,0,0,2004,11,31,5,16,0,0,0] ); + addNewTestCase( new Date("2004","11","31","16","0","0","0"), + "new Date('2004','11','31','16','0','0','0')", + [UTC_YEAR_2005,2005,0,1,6,0,0,0,0,2004,11,31,5,16,0,0,0] ); + + +/* + + This test case is incorrect. Need to fix the DaylightSavings functions in + shell.js for this to work properly. + + // Daylight Savings test case + + var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour ) + + addNewTestCase( new Date(1998,3,5,1,59,59,999), + "new Date(1998,3,5,1,59,59,999)", + [DST_START_1998-1,1998,3,5,0,9,59,59,999,1998,3,5,0,1,59,59,999] ); + + addNewTestCase( new Date(1998,3,5,2,0,0,0), + "new Date(1998,3,5,2,0,0,0)", + [DST_START_1998,1998,3,5,0,10,0,0,0,1998,3,5,0,3,0,0,0]); + + var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour ); + + addNewTestCase ( new Date(1998,9,25,1,59,59,999), + "new Date(1998,9,25,1,59,59,999)", + [DST_END_1998-1,1998,9,25,0,8,59,59,999,1998,9,25,0,1,59,59,999] ); + + addNewTestCase ( new Date(1998,9,25,2,0,0,0), + "new Date(1998,9,25,2,0,0,0)", + [DST_END_1998,1998,9,25,0,9,0,0,0,1998,9,25,0,1,0,0,0] ); +*/ + + function addNewTestCase( DateCase, DateString, ResultArray ) { + //adjust hard-coded ResultArray for tester's timezone instead of PST + adjustResultArray(ResultArray); + + var item = array.length; + + array[item++] = new TestCase( SECTION, DateString+".getTime()", ResultArray[TIME], DateCase.getTime() ); + + + + array[item++] = new TestCase( SECTION, DateString+".valueOf()", ResultArray[TIME], DateCase.valueOf() ); + + array[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", ResultArray[UTC_YEAR], DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", ResultArray[UTC_MONTH], DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDate()", ResultArray[UTC_DATE], DateCase.getUTCDate() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDay()", ResultArray[UTC_DAY], DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCHours()", ResultArray[UTC_HOURS], DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", ResultArray[UTC_MINUTES],DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", ResultArray[UTC_SECONDS],DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", ResultArray[UTC_MS], DateCase.getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, DateString+".getFullYear()", ResultArray[YEAR], DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getMonth()", ResultArray[MONTH], DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getDate()", ResultArray[DATE], DateCase.getDate() ); + array[item++] = new TestCase( SECTION, DateString+".getDay()", ResultArray[DAY], DateCase.getDay() ); + array[item++] = new TestCase( SECTION, DateString+".getHours()", ResultArray[HOURS], DateCase.getHours() ); + array[item++] = new TestCase( SECTION, DateString+".getMinutes()", ResultArray[MINUTES], DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getSeconds()", ResultArray[SECONDS], DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", ResultArray[MS], DateCase.getMilliseconds() ); + + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_3_1_2.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_3_1_2.as new file mode 100644 index 00000000000..5ca20480dcc --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_3_1_2.as @@ -0,0 +1,197 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.3.1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "new Date( year, month, date, hours, minutes, seconds, ms )"; + + var TIME = 0; + var UTC_YEAR = 1; + var UTC_MONTH = 2; + var UTC_DATE = 3; + var UTC_DAY = 4; + var UTC_HOURS = 5; + var UTC_MINUTES = 6; + var UTC_SECONDS = 7; + var UTC_MS = 8; + + var YEAR = 9; + var MONTH = 10; + var DATE = 11; + var DAY = 12; + var HOURS = 13; + var MINUTES = 14; + var SECONDS = 15; + var MS = 16; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases( ) { + var array = new Array(); + var item = 0; + + // all the "ResultArrays" below are hard-coded to Pacific Standard Time values - + var TZ_ADJUST = TZ_PST * msPerHour; + + // Dates around 2000 + + addNewTestCase( new Date( 1999,11,31,15,59,59,999), + "new Date( 1999,11,31,15,59,59,999)", + [TIME_2000-1,1999,11,31,5,23,59,59,999,1999,11,31,5,15,59,59,999] ); + + addNewTestCase( new Date( 1999,11,31,16,0,0,0), + "new Date( 1999,11,31,16,0,0,0)", + [TIME_2000,2000,0,1,6,0,0,0,0,1999,11,31,5, 16,0,0,0] ); + + addNewTestCase( new Date( 1999,11,31,23,59,59,999), + "new Date( 1999,11,31,23,59,59,999)", + [TIME_2000-TZ_ADJUST-1,2000,0,1,6,7,59,59,999,1999,11,31,5,23,59,59,999] ); + + addNewTestCase( new Date( 2000,0,1,0,0,0,0), + "new Date( 2000,0,1,0,0,0,0)", + [TIME_2000-TZ_ADJUST,2000,0,1,6,8,0,0,0,2000,0,1,6,0,0,0,0] ); + + addNewTestCase( new Date( 2000,0,1,0,0,0,1), + "new Date( 2000,0,1,0,0,0,1)", + [TIME_2000-TZ_ADJUST+1,2000,0,1,6,8,0,0,1,2000,0,1,6,0,0,0,1] ); +/* + // Dates around 29 Feb 2000 + + var UTC_FEB_29_2000 = TIME_2000 + ( 30 * msPerDay ) + ( 29 * msPerDay ); + + addNewTestCase( new Date(2000,1,28,16,0,0,0), + "new Date(2000,1,28,16,0,0,0)", + [UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0] ); + + addNewTestCase( new Date(2000,1,29,0,0,0,0), + "new Date(2000,1,29,0,0,0,0)", + [UTC_FEB_29_2000-TZ_ADJUST,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] ); + + addNewTestCase( new Date(2000,1,28,24,0,0,0), + "new Date(2000,1,28,24,0,0,0)", + [UTC_FEB_29_2000-TZ_ADJUST,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] ); + + // Dates around 1900 + + addNewTestCase( new Date(1899,11,31,16,0,0,0), + "new Date(1899,11,31,16,0,0,0)", + [TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] ); + + addNewTestCase( new Date(1899,11,31,15,59,59,999), + "new Date(1899,11,31,15,59,59,999)", + [TIME_1900-1,1899,11,31,0,23,59,59,999,1899,11,31,0,15,59,59,999] ); + + addNewTestCase( new Date(1899,11,31,23,59,59,999), + "new Date(1899,11,31,23,59,59,999)", + [TIME_1900-TZ_ADJUST-1,1900,0,1,1,7,59,59,999,1899,11,31,0,23,59,59,999] ); + + addNewTestCase( new Date(1900,0,1,0,0,0,0), + "new Date(1900,0,1,0,0,0,0)", + [TIME_1900-TZ_ADJUST,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] ); + + addNewTestCase( new Date(1900,0,1,0,0,0,1), + "new Date(1900,0,1,0,0,0,1)", + [TIME_1900-TZ_ADJUST+1,1900,0,1,1,8,0,0,1,1900,0,1,1,0,0,0,1] ); + + // Dates around 2005 + + var UTC_YEAR_2005 = TIME_2000 + TimeInYear(2000) + TimeInYear(2001) + + TimeInYear(2002) + TimeInYear(2003) + TimeInYear(2004); + + addNewTestCase( new Date(2005,0,1,0,0,0,0), + "new Date(2005,0,1,0,0,0,0)", + [UTC_YEAR_2005-TZ_ADJUST,2005,0,1,6,8,0,0,0,2005,0,1,6,0,0,0,0] ); + + addNewTestCase( new Date(2004,11,31,16,0,0,0), + "new Date(2004,11,31,16,0,0,0)", + [UTC_YEAR_2005,2005,0,1,6,0,0,0,0,2004,11,31,5,16,0,0,0] ); +*/ +/* + This test case is incorrect. Need to fix the DaylightSavings functions in + shell.js for this to work properly. + + // Daylight Savings test case + + var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour ) + + addNewTestCase( new Date(1998,3,5,1,59,59,999), + "new Date(1998,3,5,1,59,59,999)", + [DST_START_1998-1,1998,3,5,0,9,59,59,999,1998,3,5,0,1,59,59,999] ); + + addNewTestCase( new Date(1998,3,5,2,0,0,0), + "new Date(1998,3,5,2,0,0,0)", + [DST_START_1998,1998,3,5,0,10,0,0,0,1998,3,5,0,3,0,0,0]); + + var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour ); + + addNewTestCase ( new Date(1998,9,25,1,59,59,999), + "new Date(1998,9,25,1,59,59,999)", + [DST_END_1998-1,1998,9,25,0,8,59,59,999,1998,9,25,0,1,59,59,999] ); + + addNewTestCase ( new Date(1998,9,25,2,0,0,0), + "new Date(1998,9,25,2,0,0,0)", + [DST_END_1998,1998,9,25,0,9,0,0,0,1998,9,25,0,1,0,0,0] ); +*/ + + function addNewTestCase( DateCase, DateString, ResultArray ) { + //adjust hard-coded ResultArray for tester's timezone instead of PST + adjustResultArray(ResultArray); + + var item = array.length; + + array[item++] = new TestCase( SECTION, DateString+".getTime()", ResultArray[TIME], DateCase.getTime() ); + array[item++] = new TestCase( SECTION, DateString+".valueOf()", ResultArray[TIME], DateCase.valueOf() ); + + array[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", ResultArray[UTC_YEAR], DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", ResultArray[UTC_MONTH], DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDate()", ResultArray[UTC_DATE], DateCase.getUTCDate() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDay()", ResultArray[UTC_DAY], DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCHours()", ResultArray[UTC_HOURS], DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", ResultArray[UTC_MINUTES],DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", ResultArray[UTC_SECONDS],DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", ResultArray[UTC_MS], DateCase.getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, DateString+".getFullYear()", ResultArray[YEAR], DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getMonth()", ResultArray[MONTH], DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getDate()", ResultArray[DATE], DateCase.getDate() ); + array[item++] = new TestCase( SECTION, DateString+".getDay()", ResultArray[DAY], DateCase.getDay() ); + array[item++] = new TestCase( SECTION, DateString+".getHours()", ResultArray[HOURS], DateCase.getHours() ); + array[item++] = new TestCase( SECTION, DateString+".getMinutes()", ResultArray[MINUTES], DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getSeconds()", ResultArray[SECONDS], DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", ResultArray[MS], DateCase.getMilliseconds() ); + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_3_1_3.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_3_1_3.as new file mode 100644 index 00000000000..6e241ad0820 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_3_1_3.as @@ -0,0 +1,175 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.3.1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "new Date( year, month, date, hours, minutes, seconds, ms )"; + + var TIME = 0; + var UTC_YEAR = 1; + var UTC_MONTH = 2; + var UTC_DATE = 3; + var UTC_DAY = 4; + var UTC_HOURS = 5; + var UTC_MINUTES = 6; + var UTC_SECONDS = 7; + var UTC_MS = 8; + + var YEAR = 9; + var MONTH = 10; + var DATE = 11; + var DAY = 12; + var HOURS = 13; + var MINUTES = 14; + var SECONDS = 15; + var MS = 16; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases( ) { + var array = new Array(); + var item = 0; + + // all the "ResultArrays" below are hard-coded to Pacific Standard Time values - + var TZ_ADJUST = TZ_PST * msPerHour; + + // Dates around 29 Feb 2000 + + var UTC_FEB_29_2000 = TIME_2000 + ( 30 * msPerDay ) + ( 29 * msPerDay ); + + addNewTestCase( new Date(2000,1,28,16,0,0,0), + "new Date(2000,1,28,16,0,0,0)", + [UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0] ); + + addNewTestCase( new Date(2000,1,29,0,0,0,0), + "new Date(2000,1,29,0,0,0,0)", + [UTC_FEB_29_2000-TZ_ADJUST,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] ); + + addNewTestCase( new Date(2000,1,28,24,0,0,0), + "new Date(2000,1,28,24,0,0,0)", + [UTC_FEB_29_2000-TZ_ADJUST,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] ); +/* + // Dates around 1900 + + addNewTestCase( new Date(1899,11,31,16,0,0,0), + "new Date(1899,11,31,16,0,0,0)", + [TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] ); + + addNewTestCase( new Date(1899,11,31,15,59,59,999), + "new Date(1899,11,31,15,59,59,999)", + [TIME_1900-1,1899,11,31,0,23,59,59,999,1899,11,31,0,15,59,59,999] ); + + addNewTestCase( new Date(1899,11,31,23,59,59,999), + "new Date(1899,11,31,23,59,59,999)", + [TIME_1900-TZ_ADJUST-1,1900,0,1,1,7,59,59,999,1899,11,31,0,23,59,59,999] ); + + addNewTestCase( new Date(1900,0,1,0,0,0,0), + "new Date(1900,0,1,0,0,0,0)", + [TIME_1900-TZ_ADJUST,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] ); + + addNewTestCase( new Date(1900,0,1,0,0,0,1), + "new Date(1900,0,1,0,0,0,1)", + [TIME_1900-TZ_ADJUST+1,1900,0,1,1,8,0,0,1,1900,0,1,1,0,0,0,1] ); + + // Dates around 2005 + + var UTC_YEAR_2005 = TIME_2000 + TimeInYear(2000) + TimeInYear(2001) + + TimeInYear(2002) + TimeInYear(2003) + TimeInYear(2004); + + addNewTestCase( new Date(2005,0,1,0,0,0,0), + "new Date(2005,0,1,0,0,0,0)", + [UTC_YEAR_2005-TZ_ADJUST,2005,0,1,6,8,0,0,0,2005,0,1,6,0,0,0,0] ); + + addNewTestCase( new Date(2004,11,31,16,0,0,0), + "new Date(2004,11,31,16,0,0,0)", + [UTC_YEAR_2005,2005,0,1,6,0,0,0,0,2004,11,31,5,16,0,0,0] ); +*/ +/* + This test case is incorrect. Need to fix the DaylightSavings functions in + shell.js for this to work properly. + + // Daylight Savings test case + + var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour ) + + addNewTestCase( new Date(1998,3,5,1,59,59,999), + "new Date(1998,3,5,1,59,59,999)", + [DST_START_1998-1,1998,3,5,0,9,59,59,999,1998,3,5,0,1,59,59,999] ); + + addNewTestCase( new Date(1998,3,5,2,0,0,0), + "new Date(1998,3,5,2,0,0,0)", + [DST_START_1998,1998,3,5,0,10,0,0,0,1998,3,5,0,3,0,0,0]); + + var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour ); + + addNewTestCase ( new Date(1998,9,25,1,59,59,999), + "new Date(1998,9,25,1,59,59,999)", + [DST_END_1998-1,1998,9,25,0,8,59,59,999,1998,9,25,0,1,59,59,999] ); + + addNewTestCase ( new Date(1998,9,25,2,0,0,0), + "new Date(1998,9,25,2,0,0,0)", + [DST_END_1998,1998,9,25,0,9,0,0,0,1998,9,25,0,1,0,0,0] ); +*/ + + function addNewTestCase( DateCase, DateString, ResultArray ) { + //adjust hard-coded ResultArray for tester's timezone instead of PST + adjustResultArray(ResultArray); + + var item = array.length; + + array[item++] = new TestCase( SECTION, DateString+".getTime()", ResultArray[TIME], DateCase.getTime() ); + array[item++] = new TestCase( SECTION, DateString+".valueOf()", ResultArray[TIME], DateCase.valueOf() ); + + array[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", ResultArray[UTC_YEAR], DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", ResultArray[UTC_MONTH], DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDate()", ResultArray[UTC_DATE], DateCase.getUTCDate() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDay()", ResultArray[UTC_DAY], DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCHours()", ResultArray[UTC_HOURS], DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", ResultArray[UTC_MINUTES],DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", ResultArray[UTC_SECONDS],DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", ResultArray[UTC_MS], DateCase.getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, DateString+".getFullYear()", ResultArray[YEAR], DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getMonth()", ResultArray[MONTH], DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getDate()", ResultArray[DATE], DateCase.getDate() ); + array[item++] = new TestCase( SECTION, DateString+".getDay()", ResultArray[DAY], DateCase.getDay() ); + array[item++] = new TestCase( SECTION, DateString+".getHours()", ResultArray[HOURS], DateCase.getHours() ); + array[item++] = new TestCase( SECTION, DateString+".getMinutes()", ResultArray[MINUTES], DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getSeconds()", ResultArray[SECONDS], DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", ResultArray[MS], DateCase.getMilliseconds() ); + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_3_1_4.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_3_1_4.as new file mode 100644 index 00000000000..a0b3de8026d --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_3_1_4.as @@ -0,0 +1,159 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.3.1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "new Date( year, month, date, hours, minutes, seconds, ms )"; + + var TIME = 0; + var UTC_YEAR = 1; + var UTC_MONTH = 2; + var UTC_DATE = 3; + var UTC_DAY = 4; + var UTC_HOURS = 5; + var UTC_MINUTES = 6; + var UTC_SECONDS = 7; + var UTC_MS = 8; + + var YEAR = 9; + var MONTH = 10; + var DATE = 11; + var DAY = 12; + var HOURS = 13; + var MINUTES = 14; + var SECONDS = 15; + var MS = 16; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases( ) { + var array = new Array(); + var item = 0; + + // all the "ResultArrays" below are hard-coded to Pacific Standard Time values - + var TZ_ADJUST = TZ_PST * msPerHour; + + // Dates around 1900 + + addNewTestCase( new Date(1899,11,31,16,0,0,0), + "new Date(1899,11,31,16,0,0,0)", + [TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] ); + + addNewTestCase( new Date(1899,11,31,15,59,59,999), + "new Date(1899,11,31,15,59,59,999)", + [TIME_1900-1,1899,11,31,0,23,59,59,999,1899,11,31,0,15,59,59,999] ); + + addNewTestCase( new Date(1899,11,31,23,59,59,999), + "new Date(1899,11,31,23,59,59,999)", + [TIME_1900-TZ_ADJUST-1,1900,0,1,1,7,59,59,999,1899,11,31,0,23,59,59,999] ); + + addNewTestCase( new Date(1900,0,1,0,0,0,0), + "new Date(1900,0,1,0,0,0,0)", + [TIME_1900-TZ_ADJUST,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] ); + + addNewTestCase( new Date(1900,0,1,0,0,0,1), + "new Date(1900,0,1,0,0,0,1)", + [TIME_1900-TZ_ADJUST+1,1900,0,1,1,8,0,0,1,1900,0,1,1,0,0,0,1] ); +/* + // Dates around 2005 + + var UTC_YEAR_2005 = TIME_2000 + TimeInYear(2000) + TimeInYear(2001) + + TimeInYear(2002) + TimeInYear(2003) + TimeInYear(2004); + + addNewTestCase( new Date(2005,0,1,0,0,0,0), + "new Date(2005,0,1,0,0,0,0)", + [UTC_YEAR_2005-TZ_ADJUST,2005,0,1,6,8,0,0,0,2005,0,1,6,0,0,0,0] ); + + addNewTestCase( new Date(2004,11,31,16,0,0,0), + "new Date(2004,11,31,16,0,0,0)", + [UTC_YEAR_2005,2005,0,1,6,0,0,0,0,2004,11,31,5,16,0,0,0] ); +*/ +/* + This test case is incorrect. Need to fix the DaylightSavings functions in + shell.js for this to work properly. + + // Daylight Savings test case + + var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour ) + + addNewTestCase( new Date(1998,3,5,1,59,59,999), + "new Date(1998,3,5,1,59,59,999)", + [DST_START_1998-1,1998,3,5,0,9,59,59,999,1998,3,5,0,1,59,59,999] ); + + addNewTestCase( new Date(1998,3,5,2,0,0,0), + "new Date(1998,3,5,2,0,0,0)", + [DST_START_1998,1998,3,5,0,10,0,0,0,1998,3,5,0,3,0,0,0]); + + var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour ); + + addNewTestCase ( new Date(1998,9,25,1,59,59,999), + "new Date(1998,9,25,1,59,59,999)", + [DST_END_1998-1,1998,9,25,0,8,59,59,999,1998,9,25,0,1,59,59,999] ); + + addNewTestCase ( new Date(1998,9,25,2,0,0,0), + "new Date(1998,9,25,2,0,0,0)", + [DST_END_1998,1998,9,25,0,9,0,0,0,1998,9,25,0,1,0,0,0] ); +*/ + + function addNewTestCase( DateCase, DateString, ResultArray ) { + //adjust hard-coded ResultArray for tester's timezone instead of PST + adjustResultArray(ResultArray); + + var item = array.length; + + array[item++] = new TestCase( SECTION, DateString+".getTime()", ResultArray[TIME], DateCase.getTime() ); + array[item++] = new TestCase( SECTION, DateString+".valueOf()", ResultArray[TIME], DateCase.valueOf() ); + + array[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", ResultArray[UTC_YEAR], DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", ResultArray[UTC_MONTH], DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDate()", ResultArray[UTC_DATE], DateCase.getUTCDate() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDay()", ResultArray[UTC_DAY], DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCHours()", ResultArray[UTC_HOURS], DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", ResultArray[UTC_MINUTES],DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", ResultArray[UTC_SECONDS],DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", ResultArray[UTC_MS], DateCase.getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, DateString+".getFullYear()", ResultArray[YEAR], DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getMonth()", ResultArray[MONTH], DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getDate()", ResultArray[DATE], DateCase.getDate() ); + array[item++] = new TestCase( SECTION, DateString+".getDay()", ResultArray[DAY], DateCase.getDay() ); + array[item++] = new TestCase( SECTION, DateString+".getHours()", ResultArray[HOURS], DateCase.getHours() ); + array[item++] = new TestCase( SECTION, DateString+".getMinutes()", ResultArray[MINUTES], DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getSeconds()", ResultArray[SECONDS], DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", ResultArray[MS], DateCase.getMilliseconds() ); + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_3_1_5.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_3_1_5.as new file mode 100644 index 00000000000..f7ac0aaa472 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_3_1_5.as @@ -0,0 +1,136 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.3.1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "new Date( year, month, date, hours, minutes, seconds, ms )"; + + var TIME = 0; + var UTC_YEAR = 1; + var UTC_MONTH = 2; + var UTC_DATE = 3; + var UTC_DAY = 4; + var UTC_HOURS = 5; + var UTC_MINUTES = 6; + var UTC_SECONDS = 7; + var UTC_MS = 8; + + var YEAR = 9; + var MONTH = 10; + var DATE = 11; + var DAY = 12; + var HOURS = 13; + var MINUTES = 14; + var SECONDS = 15; + var MS = 16; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases( ) { + var array = new Array(); + var item = 0; + + // all the "ResultArrays" below are hard-coded to Pacific Standard Time values - + var TZ_ADJUST = TZ_PST * msPerHour; + + // Dates around 2005 + + var UTC_YEAR_2005 = TIME_2000 + TimeInYear(2000) + TimeInYear(2001) + + TimeInYear(2002) + TimeInYear(2003) + TimeInYear(2004); + + addNewTestCase( new Date(2005,0,1,0,0,0,0), + "new Date(2005,0,1,0,0,0,0)", + [UTC_YEAR_2005-TZ_ADJUST,2005,0,1,6,8,0,0,0,2005,0,1,6,0,0,0,0] ); + + addNewTestCase( new Date(2004,11,31,16,0,0,0), + "new Date(2004,11,31,16,0,0,0)", + [UTC_YEAR_2005,2005,0,1,6,0,0,0,0,2004,11,31,5,16,0,0,0] ); +/* + This test case is incorrect. Need to fix the DaylightSavings functions in + shell.js for this to work properly. + + // Daylight Savings test case + + var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour ) + + addNewTestCase( new Date(1998,3,5,1,59,59,999), + "new Date(1998,3,5,1,59,59,999)", + [DST_START_1998-1,1998,3,5,0,9,59,59,999,1998,3,5,0,1,59,59,999] ); + + addNewTestCase( new Date(1998,3,5,2,0,0,0), + "new Date(1998,3,5,2,0,0,0)", + [DST_START_1998,1998,3,5,0,10,0,0,0,1998,3,5,0,3,0,0,0]); + + var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour ); + + addNewTestCase ( new Date(1998,9,25,1,59,59,999), + "new Date(1998,9,25,1,59,59,999)", + [DST_END_1998-1,1998,9,25,0,8,59,59,999,1998,9,25,0,1,59,59,999] ); + + addNewTestCase ( new Date(1998,9,25,2,0,0,0), + "new Date(1998,9,25,2,0,0,0)", + [DST_END_1998,1998,9,25,0,9,0,0,0,1998,9,25,0,1,0,0,0] ); +*/ + + function addNewTestCase( DateCase, DateString, ResultArray ) { + //adjust hard-coded ResultArray for tester's timezone instead of PST + adjustResultArray(ResultArray); + + var item = array.length; + + array[item++] = new TestCase( SECTION, DateString+".getTime()", ResultArray[TIME], DateCase.getTime() ); + array[item++] = new TestCase( SECTION, DateString+".valueOf()", ResultArray[TIME], DateCase.valueOf() ); + + array[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", ResultArray[UTC_YEAR], DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", ResultArray[UTC_MONTH], DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDate()", ResultArray[UTC_DATE], DateCase.getUTCDate() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDay()", ResultArray[UTC_DAY], DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCHours()", ResultArray[UTC_HOURS], DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", ResultArray[UTC_MINUTES],DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", ResultArray[UTC_SECONDS],DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", ResultArray[UTC_MS], DateCase.getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, DateString+".getFullYear()", ResultArray[YEAR], DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getMonth()", ResultArray[MONTH], DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getDate()", ResultArray[DATE], DateCase.getDate() ); + array[item++] = new TestCase( SECTION, DateString+".getDay()", ResultArray[DAY], DateCase.getDay() ); + array[item++] = new TestCase( SECTION, DateString+".getHours()", ResultArray[HOURS], DateCase.getHours() ); + array[item++] = new TestCase( SECTION, DateString+".getMinutes()", ResultArray[MINUTES], DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getSeconds()", ResultArray[SECONDS], DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", ResultArray[MS], DateCase.getMilliseconds() ); + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_3_2_1.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_3_2_1.as new file mode 100644 index 00000000000..bf886e7a9f1 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_3_2_1.as @@ -0,0 +1,207 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var TIME = 0; + var UTC_YEAR = 1; + var UTC_MONTH = 2; + var UTC_DATE = 3; + var UTC_DAY = 4; + var UTC_HOURS = 5; + var UTC_MINUTES = 6; + var UTC_SECONDS = 7; + var UTC_MS = 8; + + var YEAR = 9; + var MONTH = 10; + var DATE = 11; + var DAY = 12; + var HOURS = 13; + var MINUTES = 14; + var SECONDS = 15; + var MS = 16; + +// for TCMS, the testcases array must be global. + var SECTION = "15.9.3.1"; + var TITLE = "Date( year, month, date, hours, minutes, seconds )"; + + writeHeaderToLog( SECTION+" " +TITLE ); + + var testcases = getTestCases(); + +// all tests must call a function that returns an array of TestCase object + test(); + +function getTestCases( ) { + var array = new Array(); + var item = 0; + + // Dates around 1970 + + addNewTestCase( new Date( 1969,11,31,15,59,59), + "new Date( 1969,11,31,15,59,59)", + [-1000,1969,11,31,3,23,59,59,0,1969,11,31,3,15,59,59,0] ); + + addNewTestCase( new Date( 1969,11,31,16,0,0), + "new Date( 1969,11,31,16,0,0)", + [0,1970,0,1,4,0,0,0,0,1969,11,31,3,16,0,0,0] ); + + addNewTestCase( new Date( 1969,11,31,23,59,59), + "new Date( 1969,11,31,23,59,59)", + [28799000,1970,0,1,4,7,59,59,0,1969,11,31,3,23,59,59,0] ); + + addNewTestCase( new Date( 1970, 0, 1, 0, 0, 0), + "new Date( 1970, 0, 1, 0, 0, 0)", + [28800000,1970,0,1,4,8,0,0,0,1970,0,1,4,0,0,0,0] ); + + addNewTestCase( new Date( 1969,11,31,16,0,0), + "new Date( 1969,11,31,16,0,0)", + [0,1970,0,1,4,0,0,0,0,1969,11,31,3,16,0,0,0] ); +/* + // Dates around 2000 + + addNewTestCase( new Date( 1999,11,31,15,59,59), + "new Date( 1999,11,31,15,59,59)", + [946684799000,1999,11,31,5,23,59,59,0,1999,11,31,5,15,59,59,0] ); + + addNewTestCase( new Date( 1999,11,31,16,0,0), + "new Date( 1999,11,31,16,0,0)", + [946684800000,2000,0,1,6,0,0,0,0,1999,11,31,5, 16,0,0,0] ); + + addNewTestCase( new Date( 2000,0,1,0,0,0), + "new Date( 2000,0,1,0,0,0)", + [946713600000,2000,0,1,6,8,0,0,0,2000,0,1,6,0,0,0,0] ); + + // Dates around 1900 + + addNewTestCase( new Date(1899,11,31,16,0,0), + "new Date(1899,11,31,16,0,0)", + [-2208988800000,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] ); + + addNewTestCase( new Date(1899,11,31,15,59,59), + "new Date(1899,11,31,15,59,59)", + [-2208988801000,1899,11,31,0,23,59,59,0,1899,11,31,0,15,59,59,0] ); + + addNewTestCase( new Date(1900,0,1,0,0,0), + "new Date(1900,0,1,0,0,0)", + [-2208960000000,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] ); + + addNewTestCase( new Date(1900,0,1,0,0,1), + "new Date(1900,0,1,0,0,1)", + [-2208959999000,1900,0,1,1,8,0,1,0,1900,0,1,1,0,0,1,0] ); + + var UTC_FEB_29_2000 = TIME_2000 + msPerDay*31 + msPerDay*28; + var PST_FEB_29_2000 = UTC_FEB_29_2000 + 8*msPerHour; + + // Dates around Feb 29, 2000 + addNewTestCase( new Date(2000,1,28,16,0,0,0), + "new Date(2000,1,28,16,0,0,0)", + [UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0,0] ); + + addNewTestCase( new Date(2000,1,29,0,0,0,0), + "new Date(2000,1,29,0,0,0,0)", + [PST_FEB_29_2000,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] ); + + addNewTestCase( new Date(2000,1,29,24,0,0,0), + "new Date(2000,1,29,24,0,0,0)", + [PST_FEB_29_2000+msPerDay,2000,2,1,3,8,0,0,0,2000,2,1,3,0,0,0,0] ); + + // Dates around Jan 1, 2005 + + var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000) + TimeInYear(2001) + + TimeInYear(2002)+ TimeInYear(2003) + TimeInYear(2004); + var PST_JAN_1_2005 = UTC_JAN_1_2005 + 8*msPerHour; + + addNewTestCase( new Date(2005,0,1,0,0,0,0), + "new Date(2005,0,1,0,0,0,0)", + [PST_JAN_1_2005,2005,0,1,6,8,0,0,0,2005,0,1,6,0,0,0,0] ); + + addNewTestCase( new Date(2004,11,31,16,0,0,0), + "new Date(2004,11,31,16,0,0,0)", + [UTC_JAN_1_2005,2005,0,1,6,0,0,0,0,2004,11,31,5,16,0,0,0] ); +*/ +/* + This test case is incorrect. Need to fix the DaylightSavings functions in + shell.js for this to work properly. + + // Daylight Savings Time + + var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour ) + + addNewTestCase( new Date(1998,3,5,1,59,59,999), + "new Date(1998,3,5,1,59,59,999)", + [DST_START_1998-1,1998,3,5,0,9,59,59,999,1998,3,5,0,1,59,59,999] ); + + addNewTestCase( new Date(1998,3,5,2,0,0,0), + "new Date(1998,3,5,2,0,0,0)", + [DST_START_1998,1998,3,5,0,10,0,0,0,1998,3,5,0,3,0,0,0]); + + var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour ); + + addNewTestCase ( new Date(1998,9,25,1,59,59,999), + "new Date(1998,9,25,1,59,59,999)", + [DST_END_1998-1,1998,9,25,0,8,59,59,999,1998,9,25,0,1,59,59,999] ); + + addNewTestCase ( new Date(1998,9,25,2,0,0,0), + "new Date(1998,9,25,2,0,0,0)", + [DST_END_1998,1998,9,25,0,9,0,0,0,1998,9,25,0,1,0,0,0] ); +*/ + + function addNewTestCase( DateCase, DateString, ResultArray ) { + //adjust hard-coded ResultArray for tester's timezone instead of PST + adjustResultArray(ResultArray); + + item = array.length; + + array[item++] = new TestCase( SECTION, DateString+".getTime()", ResultArray[TIME], DateCase.getTime() ); + array[item++] = new TestCase( SECTION, DateString+".valueOf()", ResultArray[TIME], DateCase.valueOf() ); + + array[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", ResultArray[UTC_YEAR], DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", ResultArray[UTC_MONTH], DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDate()", ResultArray[UTC_DATE], DateCase.getUTCDate() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDay()", ResultArray[UTC_DAY], DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCHours()", ResultArray[UTC_HOURS], DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", ResultArray[UTC_MINUTES],DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", ResultArray[UTC_SECONDS],DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", ResultArray[UTC_MS], DateCase.getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, DateString+".getFullYear()", ResultArray[YEAR], DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getMonth()", ResultArray[MONTH], DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getDate()", ResultArray[DATE], DateCase.getDate() ); + array[item++] = new TestCase( SECTION, DateString+".getDay()", ResultArray[DAY], DateCase.getDay() ); + array[item++] = new TestCase( SECTION, DateString+".getHours()", ResultArray[HOURS], DateCase.getHours() ); + array[item++] = new TestCase( SECTION, DateString+".getMinutes()", ResultArray[MINUTES], DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getSeconds()", ResultArray[SECONDS], DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", ResultArray[MS], DateCase.getMilliseconds() ); + + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_3_2_2.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_3_2_2.as new file mode 100644 index 00000000000..123bd9c97be --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_3_2_2.as @@ -0,0 +1,185 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var TIME = 0; + var UTC_YEAR = 1; + var UTC_MONTH = 2; + var UTC_DATE = 3; + var UTC_DAY = 4; + var UTC_HOURS = 5; + var UTC_MINUTES = 6; + var UTC_SECONDS = 7; + var UTC_MS = 8; + + var YEAR = 9; + var MONTH = 10; + var DATE = 11; + var DAY = 12; + var HOURS = 13; + var MINUTES = 14; + var SECONDS = 15; + var MS = 16; + +// for TCMS, the testcases array must be global. + var SECTION = "15.9.3.1"; + var TITLE = "Date( year, month, date, hours, minutes, seconds )"; + + writeHeaderToLog( SECTION+" " +TITLE ); + + var testcases = getTestCases(); + +// all tests must call a function that returns an array of TestCase object + test(); + +function getTestCases( ) { + var array = new Array(); + var item = 0; + + // Dates around 2000 + + addNewTestCase( new Date( 1999,11,31,15,59,59), + "new Date( 1999,11,31,15,59,59)", + [946684799000,1999,11,31,5,23,59,59,0,1999,11,31,5,15,59,59,0] ); + + addNewTestCase( new Date( 1999,11,31,16,0,0), + "new Date( 1999,11,31,16,0,0)", + [946684800000,2000,0,1,6,0,0,0,0,1999,11,31,5, 16,0,0,0] ); + + addNewTestCase( new Date( 2000,0,1,0,0,0), + "new Date( 2000,0,1,0,0,0)", + [946713600000,2000,0,1,6,8,0,0,0,2000,0,1,6,0,0,0,0] ); +/* + // Dates around 1900 + + addNewTestCase( new Date(1899,11,31,16,0,0), + "new Date(1899,11,31,16,0,0)", + [-2208988800000,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] ); + + addNewTestCase( new Date(1899,11,31,15,59,59), + "new Date(1899,11,31,15,59,59)", + [-2208988801000,1899,11,31,0,23,59,59,0,1899,11,31,0,15,59,59,0] ); + + addNewTestCase( new Date(1900,0,1,0,0,0), + "new Date(1900,0,1,0,0,0)", + [-2208960000000,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] ); + + addNewTestCase( new Date(1900,0,1,0,0,1), + "new Date(1900,0,1,0,0,1)", + [-2208959999000,1900,0,1,1,8,0,1,0,1900,0,1,1,0,0,1,0] ); + + var UTC_FEB_29_2000 = TIME_2000 + msPerDay*31 + msPerDay*28; + var PST_FEB_29_2000 = UTC_FEB_29_2000 + 8*msPerHour; + + // Dates around Feb 29, 2000 + addNewTestCase( new Date(2000,1,28,16,0,0,0), + "new Date(2000,1,28,16,0,0,0)", + [UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0,0] ); + + addNewTestCase( new Date(2000,1,29,0,0,0,0), + "new Date(2000,1,29,0,0,0,0)", + [PST_FEB_29_2000,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] ); + + addNewTestCase( new Date(2000,1,29,24,0,0,0), + "new Date(2000,1,29,24,0,0,0)", + [PST_FEB_29_2000+msPerDay,2000,2,1,3,8,0,0,0,2000,2,1,3,0,0,0,0] ); + + // Dates around Jan 1, 2005 + + var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000) + TimeInYear(2001) + + TimeInYear(2002)+ TimeInYear(2003) + TimeInYear(2004); + var PST_JAN_1_2005 = UTC_JAN_1_2005 + 8*msPerHour; + + addNewTestCase( new Date(2005,0,1,0,0,0,0), + "new Date(2005,0,1,0,0,0,0)", + [PST_JAN_1_2005,2005,0,1,6,8,0,0,0,2005,0,1,6,0,0,0,0] ); + + addNewTestCase( new Date(2004,11,31,16,0,0,0), + "new Date(2004,11,31,16,0,0,0)", + [UTC_JAN_1_2005,2005,0,1,6,0,0,0,0,2004,11,31,5,16,0,0,0] ); +*/ +/* + This test case is incorrect. Need to fix the DaylightSavings functions in + shell.js for this to work properly. + + // Daylight Savings Time + + var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour ) + + addNewTestCase( new Date(1998,3,5,1,59,59,999), + "new Date(1998,3,5,1,59,59,999)", + [DST_START_1998-1,1998,3,5,0,9,59,59,999,1998,3,5,0,1,59,59,999] ); + + addNewTestCase( new Date(1998,3,5,2,0,0,0), + "new Date(1998,3,5,2,0,0,0)", + [DST_START_1998,1998,3,5,0,10,0,0,0,1998,3,5,0,3,0,0,0]); + + var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour ); + + addNewTestCase ( new Date(1998,9,25,1,59,59,999), + "new Date(1998,9,25,1,59,59,999)", + [DST_END_1998-1,1998,9,25,0,8,59,59,999,1998,9,25,0,1,59,59,999] ); + + addNewTestCase ( new Date(1998,9,25,2,0,0,0), + "new Date(1998,9,25,2,0,0,0)", + [DST_END_1998,1998,9,25,0,9,0,0,0,1998,9,25,0,1,0,0,0] ); +*/ + + function addNewTestCase( DateCase, DateString, ResultArray ) { + //adjust hard-coded ResultArray for tester's timezone instead of PST + adjustResultArray(ResultArray); + + item = array.length; + + array[item++] = new TestCase( SECTION, DateString+".getTime()", ResultArray[TIME], DateCase.getTime() ); + array[item++] = new TestCase( SECTION, DateString+".valueOf()", ResultArray[TIME], DateCase.valueOf() ); + + array[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", ResultArray[UTC_YEAR], DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", ResultArray[UTC_MONTH], DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDate()", ResultArray[UTC_DATE], DateCase.getUTCDate() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDay()", ResultArray[UTC_DAY], DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCHours()", ResultArray[UTC_HOURS], DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", ResultArray[UTC_MINUTES],DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", ResultArray[UTC_SECONDS],DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", ResultArray[UTC_MS], DateCase.getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, DateString+".getFullYear()", ResultArray[YEAR], DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getMonth()", ResultArray[MONTH], DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getDate()", ResultArray[DATE], DateCase.getDate() ); + array[item++] = new TestCase( SECTION, DateString+".getDay()", ResultArray[DAY], DateCase.getDay() ); + array[item++] = new TestCase( SECTION, DateString+".getHours()", ResultArray[HOURS], DateCase.getHours() ); + array[item++] = new TestCase( SECTION, DateString+".getMinutes()", ResultArray[MINUTES], DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getSeconds()", ResultArray[SECONDS], DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", ResultArray[MS], DateCase.getMilliseconds() ); + + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_3_2_3.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_3_2_3.as new file mode 100644 index 00000000000..652451ad0d1 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_3_2_3.as @@ -0,0 +1,171 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var TIME = 0; + var UTC_YEAR = 1; + var UTC_MONTH = 2; + var UTC_DATE = 3; + var UTC_DAY = 4; + var UTC_HOURS = 5; + var UTC_MINUTES = 6; + var UTC_SECONDS = 7; + var UTC_MS = 8; + + var YEAR = 9; + var MONTH = 10; + var DATE = 11; + var DAY = 12; + var HOURS = 13; + var MINUTES = 14; + var SECONDS = 15; + var MS = 16; + +// for TCMS, the testcases array must be global. + var SECTION = "15.9.3.1"; + var TITLE = "Date( year, month, date, hours, minutes, seconds )"; + + writeHeaderToLog( SECTION+" " +TITLE ); + + var testcases = getTestCases(); + +// all tests must call a function that returns an array of TestCase object + test(); + +function getTestCases( ) { + var array = new Array(); + var item = 0; + + // Dates around 1900 + + addNewTestCase( new Date(1899,11,31,16,0,0), + "new Date(1899,11,31,16,0,0)", + [-2208988800000,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] ); + + addNewTestCase( new Date(1899,11,31,15,59,59), + "new Date(1899,11,31,15,59,59)", + [-2208988801000,1899,11,31,0,23,59,59,0,1899,11,31,0,15,59,59,0] ); + + addNewTestCase( new Date(1900,0,1,0,0,0), + "new Date(1900,0,1,0,0,0)", + [-2208960000000,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] ); + + addNewTestCase( new Date(1900,0,1,0,0,1), + "new Date(1900,0,1,0,0,1)", + [-2208959999000,1900,0,1,1,8,0,1,0,1900,0,1,1,0,0,1,0] ); +/* + var UTC_FEB_29_2000 = TIME_2000 + msPerDay*31 + msPerDay*28; + var PST_FEB_29_2000 = UTC_FEB_29_2000 + 8*msPerHour; + + // Dates around Feb 29, 2000 + addNewTestCase( new Date(2000,1,28,16,0,0,0), + "new Date(2000,1,28,16,0,0,0)", + [UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0,0] ); + + addNewTestCase( new Date(2000,1,29,0,0,0,0), + "new Date(2000,1,29,0,0,0,0)", + [PST_FEB_29_2000,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] ); + + addNewTestCase( new Date(2000,1,29,24,0,0,0), + "new Date(2000,1,29,24,0,0,0)", + [PST_FEB_29_2000+msPerDay,2000,2,1,3,8,0,0,0,2000,2,1,3,0,0,0,0] ); + + // Dates around Jan 1, 2005 + + var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000) + TimeInYear(2001) + + TimeInYear(2002)+ TimeInYear(2003) + TimeInYear(2004); + var PST_JAN_1_2005 = UTC_JAN_1_2005 + 8*msPerHour; + + addNewTestCase( new Date(2005,0,1,0,0,0,0), + "new Date(2005,0,1,0,0,0,0)", + [PST_JAN_1_2005,2005,0,1,6,8,0,0,0,2005,0,1,6,0,0,0,0] ); + + addNewTestCase( new Date(2004,11,31,16,0,0,0), + "new Date(2004,11,31,16,0,0,0)", + [UTC_JAN_1_2005,2005,0,1,6,0,0,0,0,2004,11,31,5,16,0,0,0] ); +*/ +/* + This test case is incorrect. Need to fix the DaylightSavings functions in + shell.js for this to work properly. + + // Daylight Savings Time + + var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour ) + + addNewTestCase( new Date(1998,3,5,1,59,59,999), + "new Date(1998,3,5,1,59,59,999)", + [DST_START_1998-1,1998,3,5,0,9,59,59,999,1998,3,5,0,1,59,59,999] ); + + addNewTestCase( new Date(1998,3,5,2,0,0,0), + "new Date(1998,3,5,2,0,0,0)", + [DST_START_1998,1998,3,5,0,10,0,0,0,1998,3,5,0,3,0,0,0]); + + var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour ); + + addNewTestCase ( new Date(1998,9,25,1,59,59,999), + "new Date(1998,9,25,1,59,59,999)", + [DST_END_1998-1,1998,9,25,0,8,59,59,999,1998,9,25,0,1,59,59,999] ); + + addNewTestCase ( new Date(1998,9,25,2,0,0,0), + "new Date(1998,9,25,2,0,0,0)", + [DST_END_1998,1998,9,25,0,9,0,0,0,1998,9,25,0,1,0,0,0] ); +*/ + + function addNewTestCase( DateCase, DateString, ResultArray ) { + //adjust hard-coded ResultArray for tester's timezone instead of PST + adjustResultArray(ResultArray); + + item = array.length; + + array[item++] = new TestCase( SECTION, DateString+".getTime()", ResultArray[TIME], DateCase.getTime() ); + array[item++] = new TestCase( SECTION, DateString+".valueOf()", ResultArray[TIME], DateCase.valueOf() ); + + array[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", ResultArray[UTC_YEAR], DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", ResultArray[UTC_MONTH], DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDate()", ResultArray[UTC_DATE], DateCase.getUTCDate() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDay()", ResultArray[UTC_DAY], DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCHours()", ResultArray[UTC_HOURS], DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", ResultArray[UTC_MINUTES],DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", ResultArray[UTC_SECONDS],DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", ResultArray[UTC_MS], DateCase.getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, DateString+".getFullYear()", ResultArray[YEAR], DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getMonth()", ResultArray[MONTH], DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getDate()", ResultArray[DATE], DateCase.getDate() ); + array[item++] = new TestCase( SECTION, DateString+".getDay()", ResultArray[DAY], DateCase.getDay() ); + array[item++] = new TestCase( SECTION, DateString+".getHours()", ResultArray[HOURS], DateCase.getHours() ); + array[item++] = new TestCase( SECTION, DateString+".getMinutes()", ResultArray[MINUTES], DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getSeconds()", ResultArray[SECONDS], DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", ResultArray[MS], DateCase.getMilliseconds() ); + + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_3_2_4.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_3_2_4.as new file mode 100644 index 00000000000..75a1e33e180 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_3_2_4.as @@ -0,0 +1,153 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var TIME = 0; + var UTC_YEAR = 1; + var UTC_MONTH = 2; + var UTC_DATE = 3; + var UTC_DAY = 4; + var UTC_HOURS = 5; + var UTC_MINUTES = 6; + var UTC_SECONDS = 7; + var UTC_MS = 8; + + var YEAR = 9; + var MONTH = 10; + var DATE = 11; + var DAY = 12; + var HOURS = 13; + var MINUTES = 14; + var SECONDS = 15; + var MS = 16; + +// for TCMS, the testcases array must be global. + var SECTION = "15.9.3.1"; + var TITLE = "Date( year, month, date, hours, minutes, seconds )"; + + writeHeaderToLog( SECTION+" " +TITLE ); + + var testcases = getTestCases(); + +// all tests must call a function that returns an array of TestCase object + test(); + +function getTestCases( ) { + var array = new Array(); + var item = 0; + + var UTC_FEB_29_2000 = TIME_2000 + msPerDay*31 + msPerDay*28; + var PST_FEB_29_2000 = UTC_FEB_29_2000 + 8*msPerHour; + + // Dates around Feb 29, 2000 + addNewTestCase( new Date(2000,1,28,16,0,0,0), + "new Date(2000,1,28,16,0,0,0)", + [UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0,0] ); + + addNewTestCase( new Date(2000,1,29,0,0,0,0), + "new Date(2000,1,29,0,0,0,0)", + [PST_FEB_29_2000,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] ); + + addNewTestCase( new Date(2000,1,29,24,0,0,0), + "new Date(2000,1,29,24,0,0,0)", + [PST_FEB_29_2000+msPerDay,2000,2,1,3,8,0,0,0,2000,2,1,3,0,0,0,0] ); +/* + // Dates around Jan 1, 2005 + + var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000) + TimeInYear(2001) + + TimeInYear(2002)+ TimeInYear(2003) + TimeInYear(2004); + var PST_JAN_1_2005 = UTC_JAN_1_2005 + 8*msPerHour; + + addNewTestCase( new Date(2005,0,1,0,0,0,0), + "new Date(2005,0,1,0,0,0,0)", + [PST_JAN_1_2005,2005,0,1,6,8,0,0,0,2005,0,1,6,0,0,0,0] ); + + addNewTestCase( new Date(2004,11,31,16,0,0,0), + "new Date(2004,11,31,16,0,0,0)", + [UTC_JAN_1_2005,2005,0,1,6,0,0,0,0,2004,11,31,5,16,0,0,0] ); +*/ +/* + This test case is incorrect. Need to fix the DaylightSavings functions in + shell.js for this to work properly. + + // Daylight Savings Time + + var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour ) + + addNewTestCase( new Date(1998,3,5,1,59,59,999), + "new Date(1998,3,5,1,59,59,999)", + [DST_START_1998-1,1998,3,5,0,9,59,59,999,1998,3,5,0,1,59,59,999] ); + + addNewTestCase( new Date(1998,3,5,2,0,0,0), + "new Date(1998,3,5,2,0,0,0)", + [DST_START_1998,1998,3,5,0,10,0,0,0,1998,3,5,0,3,0,0,0]); + + var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour ); + + addNewTestCase ( new Date(1998,9,25,1,59,59,999), + "new Date(1998,9,25,1,59,59,999)", + [DST_END_1998-1,1998,9,25,0,8,59,59,999,1998,9,25,0,1,59,59,999] ); + + addNewTestCase ( new Date(1998,9,25,2,0,0,0), + "new Date(1998,9,25,2,0,0,0)", + [DST_END_1998,1998,9,25,0,9,0,0,0,1998,9,25,0,1,0,0,0] ); +*/ + + function addNewTestCase( DateCase, DateString, ResultArray ) { + //adjust hard-coded ResultArray for tester's timezone instead of PST + adjustResultArray(ResultArray); + + item = array.length; + + array[item++] = new TestCase( SECTION, DateString+".getTime()", ResultArray[TIME], DateCase.getTime() ); + array[item++] = new TestCase( SECTION, DateString+".valueOf()", ResultArray[TIME], DateCase.valueOf() ); + + array[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", ResultArray[UTC_YEAR], DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", ResultArray[UTC_MONTH], DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDate()", ResultArray[UTC_DATE], DateCase.getUTCDate() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDay()", ResultArray[UTC_DAY], DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCHours()", ResultArray[UTC_HOURS], DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", ResultArray[UTC_MINUTES],DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", ResultArray[UTC_SECONDS],DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", ResultArray[UTC_MS], DateCase.getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, DateString+".getFullYear()", ResultArray[YEAR], DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getMonth()", ResultArray[MONTH], DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getDate()", ResultArray[DATE], DateCase.getDate() ); + array[item++] = new TestCase( SECTION, DateString+".getDay()", ResultArray[DAY], DateCase.getDay() ); + array[item++] = new TestCase( SECTION, DateString+".getHours()", ResultArray[HOURS], DateCase.getHours() ); + array[item++] = new TestCase( SECTION, DateString+".getMinutes()", ResultArray[MINUTES], DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getSeconds()", ResultArray[SECONDS], DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", ResultArray[MS], DateCase.getMilliseconds() ); + + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_3_2_5.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_3_2_5.as new file mode 100644 index 00000000000..4b99453252e --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_3_2_5.as @@ -0,0 +1,136 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var TIME = 0; + var UTC_YEAR = 1; + var UTC_MONTH = 2; + var UTC_DATE = 3; + var UTC_DAY = 4; + var UTC_HOURS = 5; + var UTC_MINUTES = 6; + var UTC_SECONDS = 7; + var UTC_MS = 8; + + var YEAR = 9; + var MONTH = 10; + var DATE = 11; + var DAY = 12; + var HOURS = 13; + var MINUTES = 14; + var SECONDS = 15; + var MS = 16; + +// for TCMS, the testcases array must be global. + var SECTION = "15.9.3.1"; + var TITLE = "Date( year, month, date, hours, minutes, seconds )"; + + writeHeaderToLog( SECTION+" " +TITLE ); + + var testcases = getTestCases(); + +// all tests must call a function that returns an array of TestCase object + test(); + +function getTestCases( ) { + var array = new Array(); + var item = 0; + + // Dates around Jan 1, 2005 + + var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000) + TimeInYear(2001) + + TimeInYear(2002)+ TimeInYear(2003) + TimeInYear(2004); + var PST_JAN_1_2005 = UTC_JAN_1_2005 + 8*msPerHour; + + addNewTestCase( new Date(2005,0,1,0,0,0,0), + "new Date(2005,0,1,0,0,0,0)", + [PST_JAN_1_2005,2005,0,1,6,8,0,0,0,2005,0,1,6,0,0,0,0] ); + + addNewTestCase( new Date(2004,11,31,16,0,0,0), + "new Date(2004,11,31,16,0,0,0)", + [UTC_JAN_1_2005,2005,0,1,6,0,0,0,0,2004,11,31,5,16,0,0,0] ); +/* + This test case is incorrect. Need to fix the DaylightSavings functions in + shell.js for this to work properly. + + // Daylight Savings Time + + var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour ) + + addNewTestCase( new Date(1998,3,5,1,59,59,999), + "new Date(1998,3,5,1,59,59,999)", + [DST_START_1998-1,1998,3,5,0,9,59,59,999,1998,3,5,0,1,59,59,999] ); + + addNewTestCase( new Date(1998,3,5,2,0,0,0), + "new Date(1998,3,5,2,0,0,0)", + [DST_START_1998,1998,3,5,0,10,0,0,0,1998,3,5,0,3,0,0,0]); + + var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour ); + + addNewTestCase ( new Date(1998,9,25,1,59,59,999), + "new Date(1998,9,25,1,59,59,999)", + [DST_END_1998-1,1998,9,25,0,8,59,59,999,1998,9,25,0,1,59,59,999] ); + + addNewTestCase ( new Date(1998,9,25,2,0,0,0), + "new Date(1998,9,25,2,0,0,0)", + [DST_END_1998,1998,9,25,0,9,0,0,0,1998,9,25,0,1,0,0,0] ); +*/ + + function addNewTestCase( DateCase, DateString, ResultArray ) { + //adjust hard-coded ResultArray for tester's timezone instead of PST + adjustResultArray(ResultArray); + + item = array.length; + + array[item++] = new TestCase( SECTION, DateString+".getTime()", ResultArray[TIME], DateCase.getTime() ); + array[item++] = new TestCase( SECTION, DateString+".valueOf()", ResultArray[TIME], DateCase.valueOf() ); + + array[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", ResultArray[UTC_YEAR], DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", ResultArray[UTC_MONTH], DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDate()", ResultArray[UTC_DATE], DateCase.getUTCDate() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDay()", ResultArray[UTC_DAY], DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCHours()", ResultArray[UTC_HOURS], DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", ResultArray[UTC_MINUTES],DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", ResultArray[UTC_SECONDS],DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", ResultArray[UTC_MS], DateCase.getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, DateString+".getFullYear()", ResultArray[YEAR], DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getMonth()", ResultArray[MONTH], DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getDate()", ResultArray[DATE], DateCase.getDate() ); + array[item++] = new TestCase( SECTION, DateString+".getDay()", ResultArray[DAY], DateCase.getDay() ); + array[item++] = new TestCase( SECTION, DateString+".getHours()", ResultArray[HOURS], DateCase.getHours() ); + array[item++] = new TestCase( SECTION, DateString+".getMinutes()", ResultArray[MINUTES], DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getSeconds()", ResultArray[SECONDS], DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", ResultArray[MS], DateCase.getMilliseconds() ); + + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_3_8_1.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_3_8_1.as new file mode 100644 index 00000000000..3b7b985bc8c --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_3_8_1.as @@ -0,0 +1,274 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var VERSION = "ECMA_1"; + startTest(); + var SECTION = "15.9.3.8"; + var TYPEOF = "object"; + + var TIME = 0; + var UTC_YEAR = 1; + var UTC_MONTH = 2; + var UTC_DATE = 3; + var UTC_DAY = 4; + var UTC_HOURS = 5; + var UTC_MINUTES = 6; + var UTC_SECONDS = 7; + var UTC_MS = 8; + + var YEAR = 9; + var MONTH = 10; + var DATE = 11; + var DAY = 12; + var HOURS = 13; + var MINUTES = 14; + var SECONDS = 15; + var MS = 16; + + +// for TCMS, the testcases array must be global. + var tc= 0; + var TITLE = "Date constructor: new Date( value )"; + var SECTION = "15.9.3.8"; + var VERSION = "ECMA_1"; + startTest(); + + writeHeaderToLog( SECTION +" " + TITLE ); + + testcases = getTestCases(); + +// all tests must call a function that returns a boolean value + test(); + +function getTestCases( ) { + var array = new Array(); + var item = 0; + + // all the "ResultArrays" below are hard-coded to Pacific Standard Time values - + var TZ_ADJUST = -TZ_PST * msPerHour; + + + // Dates around 1970 + addNewTestCase( new Date(0), + "new Date(0)", + [0,1970,0,1,4,0,0,0,0,1969,11,31,3,16,0,0,0] ); + + addNewTestCase( new Date(1), + "new Date(1)", + [1,1970,0,1,4,0,0,0,1,1969,11,31,3,16,0,0,1] ); + + addNewTestCase( new Date(true), + "new Date(true)", + [1,1970,0,1,4,0,0,0,1,1969,11,31,3,16,0,0,1] ); + + addNewTestCase( new Date(false), + "new Date(false)", + [0,1970,0,1,4,0,0,0,0,1969,11,31,3,16,0,0,0] ); + + addNewTestCase( new Date( (new Date(0)).toString() ), + "new Date(\+ (new Date(0)).toString()+\ )", + [0,1970,0,1,4,0,0,0,0,1969,11,31,3,16,0,0,0] ); +/* +// addNewTestCase( "new Date(\""+ (new Date(0)).toLocaleString()+"\")", [0,1970,0,1,4,0,0,0,0,1969,11,31,3,16,0,0,0] ); + + addNewTestCase( new Date((new Date(0)).toUTCString()), + "new Date(\""+ (new Date(0)).toUTCString()+"\" )", + [0,1970,0,1,4,0,0,0,0,1969,11,31,3,16,0,0,0] ); + + addNewTestCase( new Date((new Date(1)).toString()), + "new Date(\""+ (new Date(1)).toString()+"\" )", + [0,1970,0,1,4,0,0,0,0,1969,11,31,3,16,0,0,0] ); + + addNewTestCase( new Date( TZ_ADJUST ), + "new Date(" + TZ_ADJUST+")", + [TZ_ADJUST,1970,0,1,4,8,0,0,0,1970,0,1,4,0,0,0,0] ); + + addNewTestCase( new Date((new Date(TZ_ADJUST)).toString()), + "new Date(\""+ (new Date(TZ_ADJUST)).toString()+"\")", + [TZ_ADJUST,1970,0,1,4,8,0,0,0,1970,0,1,4,0,0,0,0] ); + +// addNewTestCase( "new Date(\""+ (new Date(TZ_ADJUST)).toLocaleString()+"\")",[TZ_ADJUST,1970,0,1,4,8,0,0,0,1970,0,1,4,0,0,0,0] ); + + addNewTestCase( new Date( (new Date(TZ_ADJUST)).toUTCString() ), + "new Date(\""+ (new Date(TZ_ADJUST)).toUTCString()+"\")", + [TZ_ADJUST,1970,0,1,4,8,0,0,0,1970,0,1,4,0,0,0,0] ); + + // Dates around 2000 + + addNewTestCase( new Date(TIME_2000+TZ_ADJUST), + "new Date(" +(TIME_2000+TZ_ADJUST)+")", + [TIME_2000+TZ_ADJUST,2000,0,1,6,8,0,0,0,2000,0,1,6,0,0,0,0] ); + + addNewTestCase( new Date(TIME_2000), + "new Date(" +TIME_2000+")", + [TIME_2000,2000,0,1,6,0,0,0,0,1999,11,31,5,16,0,0,0] ); + + addNewTestCase( new Date( (new Date(TIME_2000+TZ_ADJUST)).toString()), + "new Date(\"" +(new Date(TIME_2000+TZ_ADJUST)).toString()+"\")", + [TIME_2000+TZ_ADJUST,2000,0,1,6,8,0,0,0,2000,0,1,6,0,0,0,0] ); + + addNewTestCase( new Date((new Date(TIME_2000)).toString()), + "new Date(\"" +(new Date(TIME_2000)).toString()+"\")", + [TIME_2000,2000,0,1,6,0,0,0,0,1999,11,31,5,16,0,0,0] ); + +// addNewTestCase( "new Date(\"" +(new Date(TIME_2000+TZ_ADJUST)).toLocaleString()+"\")", [TIME_2000+TZ_ADJUST,2000,0,1,6,8,0,0,0,2000,0,1,6,0,0,0,0] ); +// addNewTestCase( "new Date(\"" +(new Date(TIME_2000)).toLocaleString()+"\")", [TIME_2000,2000,0,1,6,0,0,0,0,1999,11,31,5,16,0,0,0] ); + + addNewTestCase( new Date( (new Date(TIME_2000+TZ_ADJUST)).toUTCString()), + "new Date(\"" +(new Date(TIME_2000+TZ_ADJUST)).toUTCString()+"\")", + [TIME_2000+TZ_ADJUST,2000,0,1,6,8,0,0,0,2000,0,1,6,0,0,0,0] ); + + addNewTestCase( new Date( (new Date(TIME_2000)).toUTCString()), + "new Date(\"" +(new Date(TIME_2000)).toUTCString()+"\")", + [TIME_2000,2000,0,1,6,0,0,0,0,1999,11,31,5,16,0,0,0] ); + + // Dates around Feb 29, 2000 + + var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerDay; + var PST_FEB_29_2000 = UTC_FEB_29_2000 + TZ_ADJUST; + + addNewTestCase( new Date(UTC_FEB_29_2000), + "new Date("+UTC_FEB_29_2000+")", + [UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0] ); + + addNewTestCase( new Date(PST_FEB_29_2000), + "new Date("+PST_FEB_29_2000+")", + [PST_FEB_29_2000,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] ); + + addNewTestCase( new Date( (new Date(UTC_FEB_29_2000)).toString() ), + "new Date(\""+(new Date(UTC_FEB_29_2000)).toString()+"\")", + [UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0] ); + + addNewTestCase( new Date( (new Date(PST_FEB_29_2000)).toString() ), + "new Date(\""+(new Date(PST_FEB_29_2000)).toString()+"\")", + [PST_FEB_29_2000,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] ); + +// Parsing toLocaleString() is not guaranteed by ECMA. +// addNewTestCase( "new Date(\""+(new Date(UTC_FEB_29_2000)).toLocaleString()+"\")", [UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0] ); +// addNewTestCase( "new Date(\""+(new Date(PST_FEB_29_2000)).toLocaleString()+"\")", [PST_FEB_29_2000,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] ); + +// 28th October 2004 +// Removing the occurance of the toGMTString from this file. +// As toGMTString will not be supported by ActionScript 3.0 +// in the current state. + + // addNewTestCase( new Date( (new Date(UTC_FEB_29_2000)).toGMTString() ), + // "new Date(\""+(new Date(UTC_FEB_29_2000)).toGMTString()+"\")", + // [UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0] ); + + // addNewTestCase( new Date( (new Date(PST_FEB_29_2000)).toGMTString() ), + // "new Date(\""+(new Date(PST_FEB_29_2000)).toGMTString()+"\")", + // [PST_FEB_29_2000,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] ); + + // Dates around 1900 + + var PST_1900 = TIME_1900 + 8*msPerHour; + + addNewTestCase( new Date( TIME_1900 ), + "new Date("+TIME_1900+")", + [TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] ); + + addNewTestCase( new Date(PST_1900), + "new Date("+PST_1900+")", + [ PST_1900,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] ); + + addNewTestCase( new Date( (new Date(TIME_1900)).toString() ), + "new Date(\""+(new Date(TIME_1900)).toString()+"\")", + [TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] ); + + addNewTestCase( new Date( (new Date(PST_1900)).toString() ), + "new Date(\""+(new Date(PST_1900 )).toString()+"\")", + [ PST_1900,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] ); + + addNewTestCase( new Date( (new Date(TIME_1900)).toUTCString() ), + "new Date(\""+(new Date(TIME_1900)).toUTCString()+"\")", + [TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] ); + + addNewTestCase( new Date( (new Date(PST_1900)).toUTCString() ), + "new Date(\""+(new Date(PST_1900 )).toUTCString()+"\")", + [ PST_1900,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] ); + +// addNewTestCase( "new Date(\""+(new Date(TIME_1900)).toLocaleString()+"\")", [TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] ); +// addNewTestCase( "new Date(\""+(new Date(PST_1900 )).toLocaleString()+"\")", [ PST_1900,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] ); + + +// This test case is incorrect. Need to fix the DaylightSavings functions in +// shell.js for this to work properly. + + var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour ) + + addNewTestCase( new Date(DST_START_1998-1), + "new Date("+(DST_START_1998-1)+")", + [DST_START_1998-1,1998,3,5,0,9,59,59,999,1998,3,5,0,1,59,59,999] ); + + addNewTestCase( new Date(DST_START_1998), + "new Date("+DST_START_1998+")", + [DST_START_1998,1998,3,5,0,10,0,0,0,1998,3,5,0,3,0,0,0]); + + var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour ); + + addNewTestCase ( new Date(DST_END_1998-1), + "new Date("+(DST_END_1998-1)+")", + [DST_END_1998-1,1998,9,25,0,8,59,59,999,1998,9,25,0,1,59,59,999] ); + + addNewTestCase ( new Date(DST_END_1998), + "new Date("+DST_END_1998+")", + [DST_END_1998,1998,9,25,0,9,0,0,0,1998,9,25,0,1,0,0,0] ); +*/ + + function addNewTestCase( DateCase, DateString, ResultArray ) { + //adjust hard-coded ResultArray for tester's timezone instead of PST + adjustResultArray(ResultArray, 'msMode'); + + item = array.length; + + array[item++] = new TestCase( SECTION, DateString+".getTime()", ResultArray[TIME], DateCase.getTime() ); + array[item++] = new TestCase( SECTION, DateString+".valueOf()", ResultArray[TIME], DateCase.valueOf() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", ResultArray[UTC_YEAR], DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", ResultArray[UTC_MONTH], DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDate()", ResultArray[UTC_DATE], DateCase.getUTCDate() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDay()", ResultArray[UTC_DAY], DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCHours()", ResultArray[UTC_HOURS], DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", ResultArray[UTC_MINUTES],DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", ResultArray[UTC_SECONDS],DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", ResultArray[UTC_MS], DateCase.getUTCMilliseconds() ); + array[item++] = new TestCase( SECTION, DateString+".getFullYear()", ResultArray[YEAR], DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getMonth()", ResultArray[MONTH], DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getDate()", ResultArray[DATE], DateCase.getDate() ); + array[item++] = new TestCase( SECTION, DateString+".getDay()", ResultArray[DAY], DateCase.getDay() ); + array[item++] = new TestCase( SECTION, DateString+".getHours()", ResultArray[HOURS], DateCase.getHours() ); + array[item++] = new TestCase( SECTION, DateString+".getMinutes()", ResultArray[MINUTES], DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getSeconds()", ResultArray[SECONDS], DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", ResultArray[MS], DateCase.getMilliseconds() ); + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_3_8_2.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_3_8_2.as new file mode 100644 index 00000000000..329eb871483 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_3_8_2.as @@ -0,0 +1,249 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var VERSION = "ECMA_1"; + startTest(); + var SECTION = "15.9.3.8"; + var TYPEOF = "object"; + + var TIME = 0; + var UTC_YEAR = 1; + var UTC_MONTH = 2; + var UTC_DATE = 3; + var UTC_DAY = 4; + var UTC_HOURS = 5; + var UTC_MINUTES = 6; + var UTC_SECONDS = 7; + var UTC_MS = 8; + + var YEAR = 9; + var MONTH = 10; + var DATE = 11; + var DAY = 12; + var HOURS = 13; + var MINUTES = 14; + var SECONDS = 15; + var MS = 16; + + +// for TCMS, the testcases array must be global. + var tc= 0; + var TITLE = "Date constructor: new Date( value )"; + var SECTION = "15.9.3.8"; + var VERSION = "ECMA_1"; + startTest(); + + writeHeaderToLog( SECTION +" " + TITLE ); + + testcases = getTestCases(); + +// all tests must call a function that returns a boolean value + test(); + +function getTestCases( ) { + var array = new Array(); + var item = 0; + + // all the "ResultArrays" below are hard-coded to Pacific Standard Time values - + var TZ_ADJUST = -TZ_PST * msPerHour; + + addNewTestCase( new Date((new Date(0)).toUTCString()), + "new Date(\""+ (new Date(0)).toUTCString()+"\" )", + [0,1970,0,1,4,0,0,0,0,1969,11,31,3,16,0,0,0] ); + + addNewTestCase( new Date((new Date(1)).toString()), + "new Date(\""+ (new Date(1)).toString()+"\" )", + [0,1970,0,1,4,0,0,0,0,1969,11,31,3,16,0,0,0] ); + + addNewTestCase( new Date( TZ_ADJUST ), + "new Date(" + TZ_ADJUST+")", + [TZ_ADJUST,1970,0,1,4,8,0,0,0,1970,0,1,4,0,0,0,0] ); + + addNewTestCase( new Date((new Date(TZ_ADJUST)).toString()), + "new Date(\+ (new Date(TZ_ADJUST)).toString()+\)", + [TZ_ADJUST,1970,0,1,4,8,0,0,0,1970,0,1,4,0,0,0,0] ); + + + addNewTestCase( new Date( (new Date(TZ_ADJUST)).toUTCString() ), + "new Date(\+ (new Date(TZ_ADJUST)).toUTCString()+\)", + [TZ_ADJUST,1970,0,1,4,8,0,0,0,1970,0,1,4,0,0,0,0] ); +/* + // Dates around 2000 + + addNewTestCase( new Date(TIME_2000+TZ_ADJUST), + "new Date(" +(TIME_2000+TZ_ADJUST)+")", + [TIME_2000+TZ_ADJUST,2000,0,1,6,8,0,0,0,2000,0,1,6,0,0,0,0] ); + + addNewTestCase( new Date(TIME_2000), + "new Date(" +TIME_2000+")", + [TIME_2000,2000,0,1,6,0,0,0,0,1999,11,31,5,16,0,0,0] ); + + addNewTestCase( new Date( (new Date(TIME_2000+TZ_ADJUST)).toString()), + "new Date(\"" +(new Date(TIME_2000+TZ_ADJUST)).toString()+"\")", + [TIME_2000+TZ_ADJUST,2000,0,1,6,8,0,0,0,2000,0,1,6,0,0,0,0] ); + + addNewTestCase( new Date((new Date(TIME_2000)).toString()), + "new Date(\"" +(new Date(TIME_2000)).toString()+"\")", + [TIME_2000,2000,0,1,6,0,0,0,0,1999,11,31,5,16,0,0,0] ); + +// addNewTestCase( "new Date(\"" +(new Date(TIME_2000+TZ_ADJUST)).toLocaleString()+"\")", [TIME_2000+TZ_ADJUST,2000,0,1,6,8,0,0,0,2000,0,1,6,0,0,0,0] ); +// addNewTestCase( "new Date(\"" +(new Date(TIME_2000)).toLocaleString()+"\")", [TIME_2000,2000,0,1,6,0,0,0,0,1999,11,31,5,16,0,0,0] ); + + addNewTestCase( new Date( (new Date(TIME_2000+TZ_ADJUST)).toUTCString()), + "new Date(\"" +(new Date(TIME_2000+TZ_ADJUST)).toUTCString()+"\")", + [TIME_2000+TZ_ADJUST,2000,0,1,6,8,0,0,0,2000,0,1,6,0,0,0,0] ); + + addNewTestCase( new Date( (new Date(TIME_2000)).toUTCString()), + "new Date(\"" +(new Date(TIME_2000)).toUTCString()+"\")", + [TIME_2000,2000,0,1,6,0,0,0,0,1999,11,31,5,16,0,0,0] ); + + // Dates around Feb 29, 2000 + + var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerDay; + var PST_FEB_29_2000 = UTC_FEB_29_2000 + TZ_ADJUST; + + addNewTestCase( new Date(UTC_FEB_29_2000), + "new Date("+UTC_FEB_29_2000+")", + [UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0] ); + + addNewTestCase( new Date(PST_FEB_29_2000), + "new Date("+PST_FEB_29_2000+")", + [PST_FEB_29_2000,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] ); + + addNewTestCase( new Date( (new Date(UTC_FEB_29_2000)).toString() ), + "new Date(\""+(new Date(UTC_FEB_29_2000)).toString()+"\")", + [UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0] ); + + addNewTestCase( new Date( (new Date(PST_FEB_29_2000)).toString() ), + "new Date(\""+(new Date(PST_FEB_29_2000)).toString()+"\")", + [PST_FEB_29_2000,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] ); + +// Parsing toLocaleString() is not guaranteed by ECMA. +// addNewTestCase( "new Date(\""+(new Date(UTC_FEB_29_2000)).toLocaleString()+"\")", [UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0] ); +// addNewTestCase( "new Date(\""+(new Date(PST_FEB_29_2000)).toLocaleString()+"\")", [PST_FEB_29_2000,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] ); + +// 28th October 2004 +// Removing the occurance of the toGMTString from this file. +// As toGMTString will not be supported by ActionScript 3.0 +// in the current state. +// + // addNewTestCase( new Date( (new Date(UTC_FEB_29_2000)).toGMTString() ), + // "new Date(\""+(new Date(UTC_FEB_29_2000)).toGMTString()+"\")", + // [UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0] ); + + // addNewTestCase( new Date( (new Date(PST_FEB_29_2000)).toGMTString() ), + // "new Date(\""+(new Date(PST_FEB_29_2000)).toGMTString()+"\")", + // [PST_FEB_29_2000,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] ); + + // Dates around 1900 + + var PST_1900 = TIME_1900 + 8*msPerHour; + + addNewTestCase( new Date( TIME_1900 ), + "new Date("+TIME_1900+")", + [TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] ); + + addNewTestCase( new Date(PST_1900), + "new Date("+PST_1900+")", + [ PST_1900,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] ); + + addNewTestCase( new Date( (new Date(TIME_1900)).toString() ), + "new Date(\""+(new Date(TIME_1900)).toString()+"\")", + [TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] ); + + addNewTestCase( new Date( (new Date(PST_1900)).toString() ), + "new Date(\""+(new Date(PST_1900 )).toString()+"\")", + [ PST_1900,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] ); + + addNewTestCase( new Date( (new Date(TIME_1900)).toUTCString() ), + "new Date(\""+(new Date(TIME_1900)).toUTCString()+"\")", + [TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] ); + + addNewTestCase( new Date( (new Date(PST_1900)).toUTCString() ), + "new Date(\""+(new Date(PST_1900 )).toUTCString()+"\")", + [ PST_1900,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] ); + +// addNewTestCase( "new Date(\""+(new Date(TIME_1900)).toLocaleString()+"\")", [TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] ); +// addNewTestCase( "new Date(\""+(new Date(PST_1900 )).toLocaleString()+"\")", [ PST_1900,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] ); + + +// This test case is incorrect. Need to fix the DaylightSavings functions in +// shell.js for this to work properly. + + var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour ) + + addNewTestCase( new Date(DST_START_1998-1), + "new Date("+(DST_START_1998-1)+")", + [DST_START_1998-1,1998,3,5,0,9,59,59,999,1998,3,5,0,1,59,59,999] ); + + addNewTestCase( new Date(DST_START_1998), + "new Date("+DST_START_1998+")", + [DST_START_1998,1998,3,5,0,10,0,0,0,1998,3,5,0,3,0,0,0]); + + var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour ); + + addNewTestCase ( new Date(DST_END_1998-1), + "new Date("+(DST_END_1998-1)+")", + [DST_END_1998-1,1998,9,25,0,8,59,59,999,1998,9,25,0,1,59,59,999] ); + + addNewTestCase ( new Date(DST_END_1998), + "new Date("+DST_END_1998+")", + [DST_END_1998,1998,9,25,0,9,0,0,0,1998,9,25,0,1,0,0,0] ); +*/ + + function addNewTestCase( DateCase, DateString, ResultArray ) { + //adjust hard-coded ResultArray for tester's timezone instead of PST + adjustResultArray(ResultArray, 'msMode'); + + item = array.length; + + array[item++] = new TestCase( SECTION, "DateString+.getTime()", ResultArray[TIME], DateCase.getTime() ); + array[item++] = new TestCase( SECTION, "DateString+.valueOf()", ResultArray[TIME], DateCase.valueOf() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCFullYear()", ResultArray[UTC_YEAR], DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCMonth()", ResultArray[UTC_MONTH], DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCDate()", ResultArray[UTC_DATE], DateCase.getUTCDate() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCDay()", ResultArray[UTC_DAY], DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCHours()", ResultArray[UTC_HOURS], DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCMinutes()", ResultArray[UTC_MINUTES],DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCSeconds()", ResultArray[UTC_SECONDS],DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCMilliseconds()", ResultArray[UTC_MS], DateCase.getUTCMilliseconds() ); + array[item++] = new TestCase( SECTION, "DateString+.getFullYear()", ResultArray[YEAR], DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, "DateString+.getMonth()", ResultArray[MONTH], DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, "DateString+.getDate()", ResultArray[DATE], DateCase.getDate() ); + array[item++] = new TestCase( SECTION, "DateString+.getDay()", ResultArray[DAY], DateCase.getDay() ); + array[item++] = new TestCase( SECTION, "DateString+.getHours()", ResultArray[HOURS], DateCase.getHours() ); + array[item++] = new TestCase( SECTION, "DateString+.getMinutes()", ResultArray[MINUTES], DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, "DateString+.getSeconds()", ResultArray[SECONDS], DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, "DateString+.getMilliseconds()", ResultArray[MS], DateCase.getMilliseconds() ); + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_3_8_3.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_3_8_3.as new file mode 100644 index 00000000000..e48a8d2ca7c --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_3_8_3.as @@ -0,0 +1,227 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var VERSION = "ECMA_1"; + startTest(); + var SECTION = "15.9.3.8"; + var TYPEOF = "object"; + + var TIME = 0; + var UTC_YEAR = 1; + var UTC_MONTH = 2; + var UTC_DATE = 3; + var UTC_DAY = 4; + var UTC_HOURS = 5; + var UTC_MINUTES = 6; + var UTC_SECONDS = 7; + var UTC_MS = 8; + + var YEAR = 9; + var MONTH = 10; + var DATE = 11; + var DAY = 12; + var HOURS = 13; + var MINUTES = 14; + var SECONDS = 15; + var MS = 16; + + +// for TCMS, the testcases array must be global. + var tc= 0; + var TITLE = "Date constructor: new Date( value )"; + var SECTION = "15.9.3.8"; + var VERSION = "ECMA_1"; + startTest(); + + writeHeaderToLog( SECTION +" " + TITLE ); + + testcases = getTestCases(); + +// all tests must call a function that returns a boolean value + test(); + +function getTestCases( ) { + var array = new Array(); + var item = 0; + + // all the "ResultArrays" below are hard-coded to Pacific Standard Time values - + var TZ_ADJUST = -TZ_PST * msPerHour; + + + // Dates around 2000 + + addNewTestCase( new Date(TIME_2000+TZ_ADJUST), + "new Date(" +(TIME_2000+TZ_ADJUST)+")", + [TIME_2000+TZ_ADJUST,2000,0,1,6,8,0,0,0,2000,0,1,6,0,0,0,0] ); + + addNewTestCase( new Date(TIME_2000), + "new Date(" +TIME_2000+")", + [TIME_2000,2000,0,1,6,0,0,0,0,1999,11,31,5,16,0,0,0] ); + + addNewTestCase( new Date( (new Date(TIME_2000+TZ_ADJUST)).toString()), + "new Date(\ +(new Date(TIME_2000+TZ_ADJUST)).toString()+\)", + [TIME_2000+TZ_ADJUST,2000,0,1,6,8,0,0,0,2000,0,1,6,0,0,0,0] ); + + addNewTestCase( new Date((new Date(TIME_2000)).toString()), + "new Date(\ +(new Date(TIME_2000)).toString()+\)", + [TIME_2000,2000,0,1,6,0,0,0,0,1999,11,31,5,16,0,0,0] ); + + + addNewTestCase( new Date( (new Date(TIME_2000+TZ_ADJUST)).toUTCString()), + "new Date(\"" +(new Date(TIME_2000+TZ_ADJUST)).toUTCString()+"\")", + [TIME_2000+TZ_ADJUST,2000,0,1,6,8,0,0,0,2000,0,1,6,0,0,0,0] ); + + addNewTestCase( new Date( (new Date(TIME_2000)).toUTCString()), + "new Date(\"" +(new Date(TIME_2000)).toUTCString()+"\")", + [TIME_2000,2000,0,1,6,0,0,0,0,1999,11,31,5,16,0,0,0] ); +/* + // Dates around Feb 29, 2000 + + var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerDay; + var PST_FEB_29_2000 = UTC_FEB_29_2000 + TZ_ADJUST; + + addNewTestCase( new Date(UTC_FEB_29_2000), + "new Date("+UTC_FEB_29_2000+")", + [UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0] ); + + addNewTestCase( new Date(PST_FEB_29_2000), + "new Date("+PST_FEB_29_2000+")", + [PST_FEB_29_2000,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] ); + + addNewTestCase( new Date( (new Date(UTC_FEB_29_2000)).toString() ), + "new Date(\""+(new Date(UTC_FEB_29_2000)).toString()+"\")", + [UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0] ); + + addNewTestCase( new Date( (new Date(PST_FEB_29_2000)).toString() ), + "new Date(\""+(new Date(PST_FEB_29_2000)).toString()+"\")", + [PST_FEB_29_2000,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] ); + +// Parsing toLocaleString() is not guaranteed by ECMA. +// addNewTestCase( "new Date(\""+(new Date(UTC_FEB_29_2000)).toLocaleString()+"\")", [UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0] ); +// addNewTestCase( "new Date(\""+(new Date(PST_FEB_29_2000)).toLocaleString()+"\")", [PST_FEB_29_2000,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] ); + + +// 28th October 2004 +// Removing the occurance of the toGMTString from this file. +// As toGMTString will not be supported by ActionScript 3.0 +// in the current state. +// + // addNewTestCase( new Date( (new Date(UTC_FEB_29_2000)).toGMTString() ), + // "new Date(\""+(new Date(UTC_FEB_29_2000)).toGMTString()+"\")", + // [UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0] ); + + // addNewTestCase( new Date( (new Date(PST_FEB_29_2000)).toGMTString() ), + // "new Date(\""+(new Date(PST_FEB_29_2000)).toGMTString()+"\")", + // [PST_FEB_29_2000,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] ); + + // Dates around 1900 + + var PST_1900 = TIME_1900 + 8*msPerHour; + + addNewTestCase( new Date( TIME_1900 ), + "new Date("+TIME_1900+")", + [TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] ); + + addNewTestCase( new Date(PST_1900), + "new Date("+PST_1900+")", + [ PST_1900,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] ); + + addNewTestCase( new Date( (new Date(TIME_1900)).toString() ), + "new Date(\""+(new Date(TIME_1900)).toString()+"\")", + [TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] ); + + addNewTestCase( new Date( (new Date(PST_1900)).toString() ), + "new Date(\""+(new Date(PST_1900 )).toString()+"\")", + [ PST_1900,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] ); + + addNewTestCase( new Date( (new Date(TIME_1900)).toUTCString() ), + "new Date(\""+(new Date(TIME_1900)).toUTCString()+"\")", + [TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] ); + + addNewTestCase( new Date( (new Date(PST_1900)).toUTCString() ), + "new Date(\""+(new Date(PST_1900 )).toUTCString()+"\")", + [ PST_1900,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] ); + +// addNewTestCase( "new Date(\""+(new Date(TIME_1900)).toLocaleString()+"\")", [TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] ); +// addNewTestCase( "new Date(\""+(new Date(PST_1900 )).toLocaleString()+"\")", [ PST_1900,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] ); + +// This test case is incorrect. Need to fix the DaylightSavings functions in +// shell.js for this to work properly. + + var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour ) + + addNewTestCase( new Date(DST_START_1998-1), + "new Date("+(DST_START_1998-1)+")", + [DST_START_1998-1,1998,3,5,0,9,59,59,999,1998,3,5,0,1,59,59,999] ); + + addNewTestCase( new Date(DST_START_1998), + "new Date("+DST_START_1998+")", + [DST_START_1998,1998,3,5,0,10,0,0,0,1998,3,5,0,3,0,0,0]); + + var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour ); + + addNewTestCase ( new Date(DST_END_1998-1), + "new Date("+(DST_END_1998-1)+")", + [DST_END_1998-1,1998,9,25,0,8,59,59,999,1998,9,25,0,1,59,59,999] ); + + addNewTestCase ( new Date(DST_END_1998), + "new Date("+DST_END_1998+")", + [DST_END_1998,1998,9,25,0,9,0,0,0,1998,9,25,0,1,0,0,0] ); +*/ + + function addNewTestCase( DateCase, DateString, ResultArray ) { + //adjust hard-coded ResultArray for tester's timezone instead of PST + adjustResultArray(ResultArray, 'msMode'); + + item = array.length; + + array[item++] = new TestCase( SECTION, DateString+".getTime()", ResultArray[TIME], DateCase.getTime() ); + array[item++] = new TestCase( SECTION, DateString+".valueOf()", ResultArray[TIME], DateCase.valueOf() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", ResultArray[UTC_YEAR], DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", ResultArray[UTC_MONTH], DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDate()", ResultArray[UTC_DATE], DateCase.getUTCDate() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDay()", ResultArray[UTC_DAY], DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCHours()", ResultArray[UTC_HOURS], DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", ResultArray[UTC_MINUTES],DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", ResultArray[UTC_SECONDS],DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", ResultArray[UTC_MS], DateCase.getUTCMilliseconds() ); + array[item++] = new TestCase( SECTION, DateString+".getFullYear()", ResultArray[YEAR], DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getMonth()", ResultArray[MONTH], DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getDate()", ResultArray[DATE], DateCase.getDate() ); + array[item++] = new TestCase( SECTION, DateString+".getDay()", ResultArray[DAY], DateCase.getDay() ); + array[item++] = new TestCase( SECTION, DateString+".getHours()", ResultArray[HOURS], DateCase.getHours() ); + array[item++] = new TestCase( SECTION, DateString+".getMinutes()", ResultArray[MINUTES], DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getSeconds()", ResultArray[SECONDS], DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", ResultArray[MS], DateCase.getMilliseconds() ); + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_3_8_4.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_3_8_4.as new file mode 100644 index 00000000000..fea4fd491a9 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_3_8_4.as @@ -0,0 +1,193 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var VERSION = "ECMA_1"; + startTest(); + var SECTION = "15.9.3.8"; + var TYPEOF = "object"; + + var TIME = 0; + var UTC_YEAR = 1; + var UTC_MONTH = 2; + var UTC_DATE = 3; + var UTC_DAY = 4; + var UTC_HOURS = 5; + var UTC_MINUTES = 6; + var UTC_SECONDS = 7; + var UTC_MS = 8; + + var YEAR = 9; + var MONTH = 10; + var DATE = 11; + var DAY = 12; + var HOURS = 13; + var MINUTES = 14; + var SECONDS = 15; + var MS = 16; + + +// for TCMS, the testcases array must be global. + var tc= 0; + var TITLE = "Date constructor: new Date( value )"; + var SECTION = "15.9.3.8"; + var VERSION = "ECMA_1"; + startTest(); + + writeHeaderToLog( SECTION +" " + TITLE ); + + testcases = getTestCases(); + +// all tests must call a function that returns a boolean value + test(); + +function getTestCases( ) { + var array = new Array(); + var item = 0; + + // all the "ResultArrays" below are hard-coded to Pacific Standard Time values - + var TZ_ADJUST = -TZ_PST * msPerHour; + + // Dates around Feb 29, 2000 + + var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerDay; + var PST_FEB_29_2000 = UTC_FEB_29_2000 + TZ_ADJUST; + + addNewTestCase( new Date(UTC_FEB_29_2000), + "new Date("+UTC_FEB_29_2000+")", + [UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0] ); + + addNewTestCase( new Date(PST_FEB_29_2000), + "new Date("+PST_FEB_29_2000+")", + [PST_FEB_29_2000,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] ); + + addNewTestCase( new Date( (new Date(UTC_FEB_29_2000)).toString() ), + "new Date(\+(new Date(UTC_FEB_29_2000)).toString()+\)", + [UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0] ); + + addNewTestCase( new Date( (new Date(PST_FEB_29_2000)).toString() ), + "new Date(\+(new Date(PST_FEB_29_2000)).toString()+\)", + [PST_FEB_29_2000,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] ); + + + // addNewTestCase( new Date( (new Date(UTC_FEB_29_2000)).toGMTString() ), + // "new Date(\""+(new Date(UTC_FEB_29_2000)).toGMTString()+"\")", + // [UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0] ); + + // addNewTestCase( new Date( (new Date(PST_FEB_29_2000)).toGMTString() ), + // "new Date(\""+(new Date(PST_FEB_29_2000)).toGMTString()+"\")", + // [PST_FEB_29_2000,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] ); + + +/* + // Dates around 1900 + + var PST_1900 = TIME_1900 + 8*msPerHour; + + addNewTestCase( new Date( TIME_1900 ), + "new Date("+TIME_1900+")", + [TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] ); + + addNewTestCase( new Date(PST_1900), + "new Date("+PST_1900+")", + [ PST_1900,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] ); + + addNewTestCase( new Date( (new Date(TIME_1900)).toString() ), + "new Date(\""+(new Date(TIME_1900)).toString()+"\")", + [TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] ); + + addNewTestCase( new Date( (new Date(PST_1900)).toString() ), + "new Date(\""+(new Date(PST_1900 )).toString()+"\")", + [ PST_1900,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] ); + + addNewTestCase( new Date( (new Date(TIME_1900)).toUTCString() ), + "new Date(\""+(new Date(TIME_1900)).toUTCString()+"\")", + [TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] ); + + addNewTestCase( new Date( (new Date(PST_1900)).toUTCString() ), + "new Date(\""+(new Date(PST_1900 )).toUTCString()+"\")", + [ PST_1900,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] ); + +// addNewTestCase( "new Date(\""+(new Date(TIME_1900)).toLocaleString()+"\")", [TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] ); +// addNewTestCase( "new Date(\""+(new Date(PST_1900 )).toLocaleString()+"\")", [ PST_1900,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] ); +*/ +/* + This test case is incorrect. Need to fix the DaylightSavings functions in + shell.js for this to work properly. + + var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour ) + + addNewTestCase( new Date(DST_START_1998-1), + "new Date("+(DST_START_1998-1)+")", + [DST_START_1998-1,1998,3,5,0,9,59,59,999,1998,3,5,0,1,59,59,999] ); + + addNewTestCase( new Date(DST_START_1998), + "new Date("+DST_START_1998+")", + [DST_START_1998,1998,3,5,0,10,0,0,0,1998,3,5,0,3,0,0,0]); + + var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour ); + + addNewTestCase ( new Date(DST_END_1998-1), + "new Date("+(DST_END_1998-1)+")", + [DST_END_1998-1,1998,9,25,0,8,59,59,999,1998,9,25,0,1,59,59,999] ); + + addNewTestCase ( new Date(DST_END_1998), + "new Date("+DST_END_1998+")", + [DST_END_1998,1998,9,25,0,9,0,0,0,1998,9,25,0,1,0,0,0] ); +*/ + + function addNewTestCase( DateCase, DateString, ResultArray ) { + //adjust hard-coded ResultArray for tester's timezone instead of PST + adjustResultArray(ResultArray, 'msMode'); + + item = array.length; + + array[item++] = new TestCase( SECTION, DateString+".getTime()", ResultArray[TIME], DateCase.getTime() ); + array[item++] = new TestCase( SECTION, DateString+".valueOf()", ResultArray[TIME], DateCase.valueOf() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", ResultArray[UTC_YEAR], DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", ResultArray[UTC_MONTH], DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDate()", ResultArray[UTC_DATE], DateCase.getUTCDate() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDay()", ResultArray[UTC_DAY], DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCHours()", ResultArray[UTC_HOURS], DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", ResultArray[UTC_MINUTES],DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", ResultArray[UTC_SECONDS],DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", ResultArray[UTC_MS], DateCase.getUTCMilliseconds() ); + array[item++] = new TestCase( SECTION, DateString+".getFullYear()", ResultArray[YEAR], DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getMonth()", ResultArray[MONTH], DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getDate()", ResultArray[DATE], DateCase.getDate() ); + array[item++] = new TestCase( SECTION, DateString+".getDay()", ResultArray[DAY], DateCase.getDay() ); + array[item++] = new TestCase( SECTION, DateString+".getHours()", ResultArray[HOURS], DateCase.getHours() ); + array[item++] = new TestCase( SECTION, DateString+".getMinutes()", ResultArray[MINUTES], DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getSeconds()", ResultArray[SECONDS], DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", ResultArray[MS], DateCase.getMilliseconds() ); + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_3_8_5.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_3_8_5.as new file mode 100644 index 00000000000..a75a0d29965 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_3_8_5.as @@ -0,0 +1,159 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var VERSION = "ECMA_1"; + startTest(); + var SECTION = "15.9.3.8"; + var TYPEOF = "object"; + + var TIME = 0; + var UTC_YEAR = 1; + var UTC_MONTH = 2; + var UTC_DATE = 3; + var UTC_DAY = 4; + var UTC_HOURS = 5; + var UTC_MINUTES = 6; + var UTC_SECONDS = 7; + var UTC_MS = 8; + + var YEAR = 9; + var MONTH = 10; + var DATE = 11; + var DAY = 12; + var HOURS = 13; + var MINUTES = 14; + var SECONDS = 15; + var MS = 16; + + +// for TCMS, the testcases array must be global. + var tc= 0; + var TITLE = "Date constructor: new Date( value )"; + var SECTION = "15.9.3.8"; + var VERSION = "ECMA_1"; + startTest(); + + writeHeaderToLog( SECTION +" " + TITLE ); + + testcases = getTestCases(); + +// all tests must call a function that returns a boolean value + test(); + +function getTestCases( ) { + var array = new Array(); + var item = 0; + + // all the "ResultArrays" below are hard-coded to Pacific Standard Time values - + var TZ_ADJUST = -TZ_PST * msPerHour; + + + // Dates around 1900 + + var PST_1900 = TIME_1900 + 8*msPerHour; + + addNewTestCase( new Date( TIME_1900 ), + "new Date("+TIME_1900+")", + [TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] ); + + addNewTestCase( new Date(PST_1900), + "new Date("+PST_1900+")", + [ PST_1900,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] ); + + addNewTestCase( new Date( (new Date(TIME_1900)).toString() ), + "new Date(\+(new Date(TIME_1900)).toString()+\)", + [TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] ); + + addNewTestCase( new Date( (new Date(PST_1900)).toString() ), + "new Date(\+(new Date(PST_1900 )).toString()+\)", + [ PST_1900,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] ); + + addNewTestCase( new Date( (new Date(TIME_1900)).toUTCString() ), + "new Date(\""+(new Date(TIME_1900)).toUTCString()+"\")", + [TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] ); + + addNewTestCase( new Date( (new Date(PST_1900)).toUTCString() ), + "new Date(\""+(new Date(PST_1900 )).toUTCString()+"\")", + [ PST_1900,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] ); + +/* + This test case is incorrect. Need to fix the DaylightSavings functions in + shell.js for this to work properly. + + var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour ) + + addNewTestCase( new Date(DST_START_1998-1), + "new Date("+(DST_START_1998-1)+")", + [DST_START_1998-1,1998,3,5,0,9,59,59,999,1998,3,5,0,1,59,59,999] ); + + addNewTestCase( new Date(DST_START_1998), + "new Date("+DST_START_1998+")", + [DST_START_1998,1998,3,5,0,10,0,0,0,1998,3,5,0,3,0,0,0]); + + var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour ); + + addNewTestCase ( new Date(DST_END_1998-1), + "new Date("+(DST_END_1998-1)+")", + [DST_END_1998-1,1998,9,25,0,8,59,59,999,1998,9,25,0,1,59,59,999] ); + + addNewTestCase ( new Date(DST_END_1998), + "new Date("+DST_END_1998+")", + [DST_END_1998,1998,9,25,0,9,0,0,0,1998,9,25,0,1,0,0,0] ); +*/ + + function addNewTestCase( DateCase, DateString, ResultArray ) { + //adjust hard-coded ResultArray for tester's timezone instead of PST + adjustResultArray(ResultArray, 'msMode'); + + item = array.length; + + array[item++] = new TestCase( SECTION, DateString+".getTime()", ResultArray[TIME], DateCase.getTime() ); + array[item++] = new TestCase( SECTION, DateString+".valueOf()", ResultArray[TIME], DateCase.valueOf() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", ResultArray[UTC_YEAR], DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", ResultArray[UTC_MONTH], DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDate()", ResultArray[UTC_DATE], DateCase.getUTCDate() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDay()", ResultArray[UTC_DAY], DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCHours()", ResultArray[UTC_HOURS], DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", ResultArray[UTC_MINUTES],DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", ResultArray[UTC_SECONDS],DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", ResultArray[UTC_MS], DateCase.getUTCMilliseconds() ); + array[item++] = new TestCase( SECTION, DateString+".getFullYear()", ResultArray[YEAR], DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getMonth()", ResultArray[MONTH], DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getDate()", ResultArray[DATE], DateCase.getDate() ); + array[item++] = new TestCase( SECTION, DateString+".getDay()", ResultArray[DAY], DateCase.getDay() ); + array[item++] = new TestCase( SECTION, DateString+".getHours()", ResultArray[HOURS], DateCase.getHours() ); + array[item++] = new TestCase( SECTION, DateString+".getMinutes()", ResultArray[MINUTES], DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getSeconds()", ResultArray[SECONDS], DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", ResultArray[MS], DateCase.getMilliseconds() ); + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_4_2.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_4_2.as new file mode 100644 index 00000000000..90b767b860b --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_4_2.as @@ -0,0 +1,191 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var VERSION = "ECMA_1"; + startTest(); + var SECTION = "15.9.4.2"; + var TITLE = "Date.parse()"; + + var TIME = 0; + var UTC_YEAR = 1; + var UTC_MONTH = 2; + var UTC_DATE = 3; + var UTC_DAY = 4; + var UTC_HOURS = 5; + var UTC_MINUTES = 6; + var UTC_SECONDS = 7; + var UTC_MS = 8; + + var YEAR = 9; + var MONTH = 10; + var DATE = 11; + var DAY = 12; + var HOURS = 13; + var MINUTES = 14; + var SECONDS = 15; + var MS = 16; + var TYPEOF = "object"; + +// for TCMS, the testcases array must be global. + writeHeaderToLog("15.9.4.2 Date.parse()" ); + var tc= 0; + testcases = getTestCases(); + +// all tests must call a function that returns an array of TestCase objects. + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // Dates around 1970 + + addNewTestCase( new Date(0), + "new Date(0)", + [0,1970,0,1,4,0,0,0,0,1969,11,31,3,16,0,0,0] ); + + addNewTestCase( new Date(-1), + "new Date(-1)", + [-1,1969,11,31,3,23,59,59,999,1969,11,31,3,15,59,59,999] ); + addNewTestCase( new Date(28799999), + "new Date(28799999)", + [28799999,1970,0,1,4,7,59,59,999,1969,11,31,3,23,59,59,999] ); + addNewTestCase( new Date(28800000), + "new Date(28800000)", + [28800000,1970,0,1,4,8,0,0,0,1970,0,1,4,0,0,0,0] ); + + // Dates around 2000 + + addNewTestCase( new Date(946684799999), + "new Date(946684799999)", + [946684799999,1999,11,31,5,23,59,59,999,1999,11,31,5,15,59,59,999] ); + addNewTestCase( new Date(946713599999), + "new Date(946713599999)", + [946713599999,2000,0,1,6,7,59,59,999,1999,11,31,5,23,59,59,999] ); + addNewTestCase( new Date(946684800000), + "new Date(946684800000)", + [946684800000,2000,0,1,6,0,0,0,0,1999,11,31,5, 16,0,0,0] ); + addNewTestCase( new Date(946713600000), + "new Date(946713600000)", + [946713600000,2000,0,1,6,8,0,0,0,2000,0,1,6,0,0,0,0] ); + + // Dates around 1900 + + addNewTestCase( new Date(-2208988800000), + "new Date(-2208988800000)", + [-2208988800000,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] ); + + addNewTestCase( new Date(-2208988800001), + "new Date(-2208988800001)", + [-2208988800001,1899,11,31,0,23,59,59,999,1899,11,31,0,15,59,59,999] ); + + addNewTestCase( new Date(-2208960000001), + "new Date(-2208960000001)", + [-2208960000001,1900,0,1,1,7,59,59,999,1899,11,31,0,23,59,59,999] ); + addNewTestCase( new Date(-2208960000000), + "new Date(-2208960000000)", + [-2208960000000,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] ); + addNewTestCase( new Date(-2208959999999), + "new Date(-2208959999999)", + [-2208959999999,1900,0,1,1,8,0,0,1,1900,0,1,1,0,0,0,1] ); + + // Dates around Feb 29, 2000 + + var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerDay; + var PST_FEB_29_2000 = UTC_FEB_29_2000 + 8*msPerHour; + addNewTestCase( new Date(UTC_FEB_29_2000), + "new Date(" + UTC_FEB_29_2000 +")", + [UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0] ); + addNewTestCase( new Date(PST_FEB_29_2000), + "new Date(" + PST_FEB_29_2000 +")", + [PST_FEB_29_2000,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0]); + + // Dates around Jan 1 2005 + + var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000) + TimeInYear(2001) + + TimeInYear(2002) + TimeInYear(2003) + TimeInYear(2004); + var PST_JAN_1_2005 = UTC_JAN_1_2005 + 8*msPerHour; + + addNewTestCase( new Date(UTC_JAN_1_2005), + "new Date("+ UTC_JAN_1_2005 +")", + [UTC_JAN_1_2005,2005,0,1,6,0,0,0,0,2004,11,31,5,16,0,0,0] ); + addNewTestCase( new Date(PST_JAN_1_2005), + "new Date("+ PST_JAN_1_2005 +")", + [PST_JAN_1_2005,2005,0,1,6,8,0,0,0,2005,0,1,6,0,0,0,0] ); + + + + function addNewTestCase( DateCase, DateString, ResultArray ) { + DateCase = DateCase; + adjustResultArray(ResultArray, 'msMode'); + item = array.length; + + array[item++] = new TestCase( SECTION, DateString+".getTime()", ResultArray[TIME], DateCase.getTime() ); + array[item++] = new TestCase( SECTION, DateString+".valueOf()", ResultArray[TIME], DateCase.valueOf() ); + array[item++] = new TestCase( SECTION, "Date.parse( + DateCase.toString() +)", Math.floor(ResultArray[TIME]/1000)*1000, Date.parse(DateCase.toString()) ); + + var mydate = new Date(0,0,0,0,0,0,0); + array[item++] = new TestCase( SECTION, "mydate.valueOf()==Date.parse(mydate.toString())", true, mydate.valueOf()==Date.parse(mydate.toString()) ); + + array[item++] = new TestCase( SECTION, "mydate.valueOf()==Date.parse(mydate.toUTCString())", true, mydate.valueOf()==Date.parse(mydate.toUTCString()) ); + + array[item++] = new TestCase( SECTION, "Date.parse(mydate.toString())==Date.parse(mydate.toUTCString())", true, Date.parse(mydate.toString())==Date.parse(mydate.toUTCString()) ); + + + // array[item++] = new TestCase( SECTION, "Date.parse(" + DateCase.toGMTString() +")", Math.floor(ResultArray[TIME]/1000)*1000, Date.parse(DateCase.toGMTString()) ); + + // Adding the test case vector for toUTCString instead of the toGMTString, if it is required later on. + array[item++] = new TestCase( SECTION, "Date.parse(" + DateCase.toUTCString() +")", Math.floor(ResultArray[TIME]/1000)*1000, Date.parse(DateCase.toUTCString()) ); + array[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", ResultArray[UTC_YEAR], DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", ResultArray[UTC_MONTH], DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDate()", ResultArray[UTC_DATE], DateCase.getUTCDate() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDay()", ResultArray[UTC_DAY], DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCHours()", ResultArray[UTC_HOURS], DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", ResultArray[UTC_MINUTES],DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", ResultArray[UTC_SECONDS],DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", ResultArray[UTC_MS], DateCase.getUTCMilliseconds() ); + + + + array[item++] = new TestCase( SECTION, DateString+".getFullYear()", ResultArray[YEAR], DateCase.getFullYear() ); + + array[item++] = new TestCase( SECTION, DateString+".getMonth()", ResultArray[MONTH], DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getDate()", ResultArray[DATE], DateCase.getDate() ); + array[item++] = new TestCase( SECTION, DateString+".getDay()", ResultArray[DAY], DateCase.getDay() ); + array[item++] = new TestCase( SECTION, DateString+".getHours()", ResultArray[HOURS], DateCase.getHours() ); + array[item++] = new TestCase( SECTION, DateString+".getMinutes()", ResultArray[MINUTES], DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getSeconds()", ResultArray[SECONDS], DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", ResultArray[MS], DateCase.getMilliseconds() ); + + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_4_2_1.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_4_2_1.as new file mode 100644 index 00000000000..cbf95512cc1 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_4_2_1.as @@ -0,0 +1,85 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* +* The contents of this file are subject to the Netscape Public +* License Version 1.1 (the "License"); you may not use this file +* except in compliance with the License. You may obtain a copy of +* the License at http://www.mozilla.org/NPL/ +* +* Software distributed under the License is distributed on an "AS +* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or +* implied. See the License for the specific language governing +* rights and limitations under the License. +* +* The Original Code is mozilla.org code. +* +* The Initial Developer of the Original Code is Netscape +* Communications Corporation. Portions created by Netscape are +* Copyright (C) 1998 Netscape Communications Corporation. All +* Rights Reserved. +* +* Contributor(s): +*/ + + + var SECTION = "15.9.4.2-1"; // provide a document reference (ie, ECMA section) + var VERSION = "ECMA"; // Version of JavaScript or ECMA + var TITLE = "Regression Test for Date.parse"; // Provide ECMA section title or a description + var BUGNUMBER = "http://bugzilla.mozilla.org/show_bug.cgi?id=4088"; // Provide URL to bugsplat or bugzilla report + + startTest(); // leave this alone + writeHeaderToLog( SECTION + " "+ TITLE); + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "new Date('1/1/1999 12:30 AM').toString()", + new Date(1999,0,1,0,30).toString(), + new Date('1/1/1999 12:30 AM').toString() ); + + array[item++] = new TestCase( SECTION, "new Date('1/1/1999 12:30 PM').toString()", + new Date( 1999,0,1,12,30 ).toString(), + new Date('1/1/1999 12:30 PM').toString() ); + + array[item++] = new TestCase( SECTION, "new Date('1/1/1999 13:30 AM')", + "Invalid Date", + new Date('1/1/1999 13:30 AM').toString() ); + + + array[item++] = new TestCase( SECTION, "new Date('1/1/1999 13:30 PM')", + "Invalid Date", + new Date('1/1/1999 13:30 PM').toString() ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_4_3.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_4_3.as new file mode 100644 index 00000000000..011abdf3d7c --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_4_3.as @@ -0,0 +1,210 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + var SECTION = "15.9.4.3"; + var TITLE = "Date.UTC( year, month, date, hours, minutes, seconds, ms )"; + + startTest(); + writeHeaderToLog(SECTION + " "+ TITLE); + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + function MyDate() { + this.year = 0; + this.month = 0; + this.date = 0; + this.hours = 0; + this.minutes = 0; + this.seconds = 0; + this.ms = 0; + } + + function utc( year, month, date, hours, minutes, seconds, ms ) { + d = new MyDate(); + d.year = Number(year); + + if (month) + d.month = Number(month); + if (date) + d.date = Number(date); + if (hours) + d.hours = Number(hours); + if (minutes) + d.minutes = Number(minutes); + if (seconds) + d.seconds = Number(seconds); + if (ms) + d.ms = Number(ms); + + if ( isNaN(d.year) && 0 <= ToInteger(d.year) && d.year <= 99 ) { + d.year = 1900 + ToInteger(d.year); + } + + if (isNaN(month) || isNaN(year) || isNaN(date) || isNaN(hours) || + isNaN(minutes) || isNaN(seconds) || isNaN(ms) ) { + d.year = Number.NaN; + d.month = Number.NaN; + d.date = Number.NaN; + d.hours = Number.NaN; + d.minutes = Number.NaN; + d.seconds = Number.NaN; + d.ms = Number.NaN; + d.value = Number.NaN; + d.time = Number.NaN; + d.day =Number.NaN; + return d; + } + + d.day = MakeDay( d.year, d.month, d.date ); + d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); + d.value = (TimeClip( MakeDate(d.day,d.time))); + + return d; + } + + function UTCTime( t ) { + sign = ( t < 0 ) ? -1 : 1; + return ( (t +(TZ_DIFF*msPerHour)) ); + } + + // Dates around 1970 + + addNewTestCase( Date.UTC( 1970,0,1,0,0,0,0), + "Date.UTC( 1970,0,1,0,0,0,0)", + utc(1970,0,1,0,0,0,0) ); + + addNewTestCase( Date.UTC( 1969,11,31,23,59,59,999), + "Date.UTC( 1969,11,31,23,59,59,999)", + utc(1969,11,31,23,59,59,999) ); + addNewTestCase( Date.UTC( 1972,1,29,23,59,59,999), + "Date.UTC( 1972,1,29,23,59,59,999)", + utc(1972,1,29,23,59,59,999) ); + addNewTestCase( Date.UTC( 1972,2,1,23,59,59,999), + "Date.UTC( 1972,2,1,23,59,59,999)", + utc(1972,2,1,23,59,59,999) ); + addNewTestCase( Date.UTC( 1968,1,29,23,59,59,999), + "Date.UTC( 1968,1,29,23,59,59,999)", + utc(1968,1,29,23,59,59,999) ); + addNewTestCase( Date.UTC( 1968,2,1,23,59,59,999), + "Date.UTC( 1968,2,1,23,59,59,999)", + utc(1968,2,1,23,59,59,999) ); + addNewTestCase( Date.UTC( 1969,0,1,0,0,0,0), + "Date.UTC( 1969,0,1,0,0,0,0)", + utc(1969,0,1,0,0,0,0) ); + addNewTestCase( Date.UTC( 1969,11,31,23,59,59,1000), + "Date.UTC( 1969,11,31,23,59,59,1000)", + utc(1970,0,1,0,0,0,0) ); + addNewTestCase( Date.UTC( 1969,Number.NaN,31,23,59,59,999), + "Date.UTC( 1969,Number.NaN,31,23,59,59,999)", + utc(1969,Number.NaN,31,23,59,59,999) ); + + // Dates around 2000 + + addNewTestCase( Date.UTC( 1999,11,31,23,59,59,999), + "Date.UTC( 1999,11,31,23,59,59,999)", + utc(1999,11,31,23,59,59,999) ); + addNewTestCase( Date.UTC( 2000,0,1,0,0,0,0), + "Date.UTC( 2000,0,1,0,0,0,0)", + utc(2000,0,1,0,0,0,0) ); + + // Dates around 1900 + addNewTestCase( Date.UTC( 1899,11,31,23,59,59,999), + "Date.UTC( 1899,11,31,23,59,59,999)", + utc(1899,11,31,23,59,59,999) ); + addNewTestCase( Date.UTC( 1900,0,1,0,0,0,0), + "Date.UTC( 1900,0,1,0,0,0,0)", + utc(1900,0,1,0,0,0,0) ); + addNewTestCase( Date.UTC( 1973,0,1,0,0,0,0), + "Date.UTC( 1973,0,1,0,0,0,0)", + utc(1973,0,1,0,0,0,0) ); + addNewTestCase( Date.UTC( 1776,6,4,12,36,13,111), + "Date.UTC( 1776,6,4,12,36,13,111)", + utc(1776,6,4,12,36,13,111) ); + addNewTestCase( Date.UTC( 2525,9,18,15,30,1,123), + "Date.UTC( 2525,9,18,15,30,1,123)", + utc(2525,9,18,15,30,1,123) ); + + // Dates around 29 Feb 2000 + + addNewTestCase( Date.UTC( 2000,1,29,0,0,0,0 ), + "Date.UTC( 2000,1,29,0,0,0,0 )", + utc(2000,1,29,0,0,0,0) ); + addNewTestCase( Date.UTC( 2000,1,29,8,0,0,0 ), + "Date.UTC( 2000,1,29,8,0,0,0 )", + utc(2000,1,29,8,0,0,0) ); + + // Dates around 1 Jan 2005 + + addNewTestCase( Date.UTC( 2005,0,1,0,0,0,0 ), + "Date.UTC( 2005,0,1,0,0,0,0 )", + utc(2005,0,1,0,0,0,0) ); + addNewTestCase( Date.UTC( 2004,11,31,16,0,0,0 ), + "Date.UTC( 2004,11,31,16,0,0,0 )", + utc(2004,11,31,16,0,0,0) ); + + function addNewTestCase( DateCase, DateString, ExpectDate) { + DateCase = DateCase; + + item = array.length; + + // fixed_year = ( ExpectDate.year >=1900 || ExpectDate.year < 2000 ) ? ExpectDate.year - 1900 : ExpectDate.year; + + array[item++] = new TestCase( SECTION, DateString, ExpectDate.value, DateCase ); + array[item++] = new TestCase( SECTION, DateString, ExpectDate.value, DateCase ); + /* + + array[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", ExpectDate.year, DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", ExpectDate.month, DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDate()", ExpectDate.date, DateCase.getUTCDate() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDay()", ExpectDate.day, DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCHours()", ExpectDate.hours, DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", ExpectDate.minutes,DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", ExpectDate.seconds,DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", ExpectDate.ms, DateCase.getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, DateString+".getFullYear()", ExpectDate.year, DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getMonth()", ExpectDate.month, DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getDate()", ExpectDate.date, DateCase.getDate() ); + // array[item++] = new TestCase( SECTION, DateString+".getDay()", ExpectDate.day, DateCase.getDay() ); + array[item++] = new TestCase( SECTION, DateString+".getHours()", ExpectDate.hours, DateCase.getHours() ); + array[item++] = new TestCase( SECTION, DateString+".getMinutes()", ExpectDate.minutes, DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getSeconds()", ExpectDate.seconds, DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", ExpectDate.ms, DateCase.getMilliseconds() ); + */ + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5.as new file mode 100644 index 00000000000..6160b2e566a --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5.as @@ -0,0 +1,65 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "15.9.5"; +var VERSION = "ECMA_1"; +startTest(); +var TITLE = "Properties of the Date Prototype Object"; + +writeHeaderToLog( SECTION + " "+ TITLE); +var testcases = getTestCases(); +test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // save + var origGetClass:Function = Date.prototype.getClass; + var origValueOf:Function = Date.prototype.valueOf; + + Date.prototype.getClass = Object.prototype.toString; + Date.prototype.valueOf=Object.prototype.toString; + array[item++] = new TestCase( SECTION, + "Date.prototype.getClass", + "[object Date]", + Date.prototype.getClass() ); + array[item++] = new TestCase( SECTION, + "Date.prototype.valueOf()", + "[object Date]", + (Date.prototype.valueOf()) ); + + // restore + Date.prototype.getClass = origGetClass; + Date.prototype.valueOf = origValueOf; + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_1.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_1.as new file mode 100644 index 00000000000..1c10d0253de --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_1.as @@ -0,0 +1,51 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.constructor"; + + writeHeaderToLog(SECTION + " "+ TITLE); + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, + "Date.prototype.constructor == Date", + true, + Date.prototype.constructor == Date ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_10.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_10.as new file mode 100644 index 00000000000..8b20b4093b6 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_10.as @@ -0,0 +1,98 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.10"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getFullYear()"; + + writeHeaderToLog(SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + // get the current time + var now = (new Date()).valueOf(); + + // calculate time for year 0 + for ( var time = 0, year = 1969; year >= 0; year-- ) { + time -= TimeInYear(year); + } + // get time for 29 feb 2000 + + var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour; + + // get time for 1 jan 2005 + + var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+ + TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004); + + // some daylight savings time cases + + var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour ) + + var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour ); + + addTestCase(time); + addTestCase(UTC_FEB_29_2000); + addTestCase(UTC_JAN_1_2005); + addTestCase( now ); + + + array[item++] = new TestCase( SECTION, + "(new Date(NaN)).getFullYear()", + NaN, + (new Date(NaN)).getFullYear() ); + + array[item++] = new TestCase( SECTION, + "Date.prototype.getFullYear.length", + 0, + Date.prototype.getFullYear.length ); + + + function addTestCase( t ) { + for ( d = 0; d < TimeInMonth(MonthFromTime(t)); d+= msPerDay ) { + t += d; + array[item++] = new TestCase( SECTION, + "(new Date(currentTime+"+d+")).getFullYear()", + true, YearFromTime(LocalTime(t)) == + (new Date(t)).getFullYear() ); + } + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_10_1.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_10_1.as new file mode 100644 index 00000000000..8cde02b314a --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_10_1.as @@ -0,0 +1,107 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.10"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getDate()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + // get the current time + var now = (new Date()).valueOf(); + + // calculate time for year 0 + for ( var time = 0, year = 1969; year >= 0; year-- ) { + time -= TimeInYear(year); + } + // get time for 29 feb 2000 + + var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour; + + // get time for 1 jan 2005 + + var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+ + TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004); + + // some daylight savings time cases + + var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour ) + + var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour ); + + addTestCase( now ); +/* + addTestCase( time ); + addTestCase( TIME_1970 ); + addTestCase( TIME_1900 ); + addTestCase( TIME_2000 ); + addTestCase( UTC_FEB_29_2000 ); + addTestCase( UTC_JAN_1_2005 ); + addTestCase( DST_START_1998 ); + addTestCase( DST_START_1998-1 ); + addTestCase( DST_START_1998+1 ); + addTestCase( DST_END_1998 ); + addTestCase( DST_END_1998-1 ); + addTestCase( DST_END_1998+1 ); +*/ + + array[item++] = new TestCase( SECTION, + "(new Date(NaN)).getDate()", + NaN, + (new Date(NaN)).getDate() ); + + array[item++] = new TestCase( SECTION, + "Date.prototype.getDate.length", + 0, + Date.prototype.getDate.length ); + + function addTestCase( t ) { + for ( d = 0; d < TimeInMonth(MonthFromTime(t)); d+= msPerDay ) { + t += d; + array[item++] = new TestCase( SECTION, + "(new Date(currentTime+"+d+")).getDate()", + true, DateFromTime(LocalTime(t)) == + (new Date(t)).getDate() ); + } + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_10_10.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_10_10.as new file mode 100644 index 00000000000..ee138f1e810 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_10_10.as @@ -0,0 +1,98 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.10"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getDate()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + // get the current time + var now = (new Date()).valueOf(); + + // calculate time for year 0 + for ( var time = 0, year = 1969; year >= 0; year-- ) { + time -= TimeInYear(year); + } + // get time for 29 feb 2000 + + var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour; + + // get time for 1 jan 2005 + + var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+ + TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004); + + // some daylight savings time cases + + var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour ) + + var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour ); + + addTestCase( DST_START_1998+1 ); +/* + addTestCase( DST_END_1998 ); + addTestCase( DST_END_1998-1 ); + addTestCase( DST_END_1998+1 ); +*/ + + array[item++] = new TestCase( SECTION, + "(new Date(NaN)).getDate()", + NaN, + (new Date(NaN)).getDate() ); + + array[item++] = new TestCase( SECTION, + "Date.prototype.getDate.length", + 0, + Date.prototype.getDate.length ); + + function addTestCase( t ) { + for ( d = 0; d < TimeInMonth(MonthFromTime(t)); d+= msPerDay ) { + t += d; + array[item++] = new TestCase( SECTION, + "(new Date(+t+)).getDate()", + DateFromTime(LocalTime(t)), + (new Date(t)).getDate() ); + } + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_10_11.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_10_11.as new file mode 100644 index 00000000000..513967163a3 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_10_11.as @@ -0,0 +1,97 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.10"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getDate()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + // get the current time + var now = (new Date()).valueOf(); + + // calculate time for year 0 + for ( var time = 0, year = 1969; year >= 0; year-- ) { + time -= TimeInYear(year); + } + // get time for 29 feb 2000 + + var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour; + + // get time for 1 jan 2005 + + var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+ + TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004); + + // some daylight savings time cases + + var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour ) + + var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour ); + + addTestCase( DST_END_1998 ); +/* + addTestCase( DST_END_1998-1 ); + addTestCase( DST_END_1998+1 ); +*/ + + array[item++] = new TestCase( SECTION, + "(new Date(NaN)).getDate()", + NaN, + (new Date(NaN)).getDate() ); + + array[item++] = new TestCase( SECTION, + "Date.prototype.getDate.length", + 0, + Date.prototype.getDate.length ); + + function addTestCase( t ) { + for ( d = 0; d < TimeInMonth(MonthFromTime(t)); d+= msPerDay ) { + t += d; + array[item++] = new TestCase( SECTION, + "(new Date(+t+)).getDate()", + DateFromTime(LocalTime(t)), + (new Date(t)).getDate() ); + } + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_10_12.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_10_12.as new file mode 100644 index 00000000000..f43db58d740 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_10_12.as @@ -0,0 +1,96 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.10"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getDate()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + // get the current time + var now = (new Date()).valueOf(); + + // calculate time for year 0 + for ( var time = 0, year = 1969; year >= 0; year-- ) { + time -= TimeInYear(year); + } + // get time for 29 feb 2000 + + var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour; + + // get time for 1 jan 2005 + + var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+ + TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004); + + // some daylight savings time cases + + var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour ) + + var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour ); + + addTestCase( DST_END_1998-1 ); +/* + addTestCase( DST_END_1998+1 ); +*/ + + array[item++] = new TestCase( SECTION, + "(new Date(NaN)).getDate()", + NaN, + (new Date(NaN)).getDate() ); + + array[item++] = new TestCase( SECTION, + "Date.prototype.getDate.length", + 0, + Date.prototype.getDate.length ); + + function addTestCase( t ) { + for ( d = 0; d < TimeInMonth(MonthFromTime(t)); d+= msPerDay ) { + t += d; + array[item++] = new TestCase( SECTION, + "(new Date(+t+)).getDate()", + DateFromTime(LocalTime(t)), + (new Date(t)).getDate() ); + } + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_10_13.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_10_13.as new file mode 100644 index 00000000000..aea6c9d22ad --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_10_13.as @@ -0,0 +1,93 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.10"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getDate()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + // get the current time + var now = (new Date()).valueOf(); + + // calculate time for year 0 + for ( var time = 0, year = 1969; year >= 0; year-- ) { + time -= TimeInYear(year); + } + // get time for 29 feb 2000 + + var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour; + + // get time for 1 jan 2005 + + var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+ + TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004); + + // some daylight savings time cases + + var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour ) + + var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour ); + + addTestCase( DST_END_1998+1 ); + + array[item++] = new TestCase( SECTION, + "(new Date(NaN)).getDate()", + NaN, + (new Date(NaN)).getDate() ); + + array[item++] = new TestCase( SECTION, + "Date.prototype.getDate.length", + 0, + Date.prototype.getDate.length ); + + function addTestCase( t ) { + for ( d = 0; d < TimeInMonth(MonthFromTime(t)); d+= msPerDay ) { + t += d; + array[item++] = new TestCase( SECTION, + "(new Date(+t+)).getDate()", + DateFromTime(LocalTime(t)), + (new Date(t)).getDate() ); + } + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_10_3.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_10_3.as new file mode 100644 index 00000000000..638d2afd55c --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_10_3.as @@ -0,0 +1,105 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.10"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getDate()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + // get the current time + var now = (new Date()).valueOf(); + + // calculate time for year 0 + for ( var time = 0, year = 1969; year >= 0; year-- ) { + time -= TimeInYear(year); + } + // get time for 29 feb 2000 + + var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour; + + // get time for 1 jan 2005 + + var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+ + TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004); + + // some daylight savings time cases + + var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour ) + + var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour ); + + addTestCase( TIME_1970 ); +/* + addTestCase( TIME_1900 ); + addTestCase( TIME_2000 ); + addTestCase( UTC_FEB_29_2000 ); + addTestCase( UTC_JAN_1_2005 ); + addTestCase( DST_START_1998 ); + addTestCase( DST_START_1998-1 ); + addTestCase( DST_START_1998+1 ); + addTestCase( DST_END_1998 ); + addTestCase( DST_END_1998-1 ); + addTestCase( DST_END_1998+1 ); +*/ + + array[item++] = new TestCase( SECTION, + "(new Date(NaN)).getDate()", + NaN, + (new Date(NaN)).getDate() ); + + array[item++] = new TestCase( SECTION, + "Date.prototype.getDate.length", + 0, + Date.prototype.getDate.length ); + + function addTestCase( t ) { + for ( d = 0; d < TimeInMonth(MonthFromTime(t)); d+= msPerDay ) { + t += d; + array[item++] = new TestCase( SECTION, + "(new Date("+t+")).getDate()", + DateFromTime(LocalTime(t)), + (new Date(t)).getDate() ); + } + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_10_4.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_10_4.as new file mode 100644 index 00000000000..dced9f01e48 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_10_4.as @@ -0,0 +1,103 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.10"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getDate()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + // get the current time + var now = (new Date()).valueOf(); + + // calculate time for year 0 + for ( var time = 0, year = 1969; year >= 0; year-- ) { + time -= TimeInYear(year); + } + // get time for 29 feb 2000 + + var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour; + + // get time for 1 jan 2005 + + var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+ + TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004); + + // some daylight savings time cases + + var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour ) + + var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour ); + + addTestCase( TIME_1900 ); +/* + addTestCase( UTC_FEB_29_2000 ); + addTestCase( UTC_JAN_1_2005 ); + addTestCase( DST_START_1998 ); + addTestCase( DST_START_1998-1 ); + addTestCase( DST_START_1998+1 ); + addTestCase( DST_END_1998 ); + addTestCase( DST_END_1998-1 ); + addTestCase( DST_END_1998+1 ); +*/ + + array[item++] = new TestCase( SECTION, + "(new Date(NaN)).getDate()", + NaN, + (new Date(NaN)).getDate() ); + + array[item++] = new TestCase( SECTION, + "Date.prototype.getDate.length", + 0, + Date.prototype.getDate.length ); + + function addTestCase( t ) { + for ( d = 0; d < TimeInMonth(MonthFromTime(t)); d+= msPerDay ) { + t += d; + array[item++] = new TestCase( SECTION, + "(new Date("+t+")).getDate()", + DateFromTime(LocalTime(t)), + (new Date(t)).getDate() ); + } + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_10_5.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_10_5.as new file mode 100644 index 00000000000..f4c5838da22 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_10_5.as @@ -0,0 +1,103 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.10"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getDate()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + // get the current time + var now = (new Date()).valueOf(); + + // calculate time for year 0 + for ( var time = 0, year = 1969; year >= 0; year-- ) { + time -= TimeInYear(year); + } + // get time for 29 feb 2000 + + var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour; + + // get time for 1 jan 2005 + + var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+ + TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004); + + // some daylight savings time cases + + var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour ) + + var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour ); + + addTestCase( TIME_2000 ); +/* + addTestCase( UTC_FEB_29_2000 ); + addTestCase( UTC_JAN_1_2005 ); + addTestCase( DST_START_1998 ); + addTestCase( DST_START_1998-1 ); + addTestCase( DST_START_1998+1 ); + addTestCase( DST_END_1998 ); + addTestCase( DST_END_1998-1 ); + addTestCase( DST_END_1998+1 ); +*/ + + array[item++] = new TestCase( SECTION, + "(new Date(NaN)).getDate()", + NaN, + (new Date(NaN)).getDate() ); + + array[item++] = new TestCase( SECTION, + "Date.prototype.getDate.length", + 0, + Date.prototype.getDate.length ); + + function addTestCase( t ) { + for ( d = 0; d < TimeInMonth(MonthFromTime(t)); d+= msPerDay ) { + t += d; + array[item++] = new TestCase( SECTION, + "(new Date("+t+")).getDate()", + DateFromTime(LocalTime(t)), + (new Date(t)).getDate() ); + } + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_10_6.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_10_6.as new file mode 100644 index 00000000000..1b982d65d4b --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_10_6.as @@ -0,0 +1,102 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.10"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getDate()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + // get the current time + var now = (new Date()).valueOf(); + + // calculate time for year 0 + for ( var time = 0, year = 1969; year >= 0; year-- ) { + time -= TimeInYear(year); + } + // get time for 29 feb 2000 + + var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour; + + // get time for 1 jan 2005 + + var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+ + TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004); + + // some daylight savings time cases + + var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour ) + + var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour ); + + addTestCase( UTC_FEB_29_2000 ); +/* + addTestCase( UTC_JAN_1_2005 ); + addTestCase( DST_START_1998 ); + addTestCase( DST_START_1998-1 ); + addTestCase( DST_START_1998+1 ); + addTestCase( DST_END_1998 ); + addTestCase( DST_END_1998-1 ); + addTestCase( DST_END_1998+1 ); +*/ + + array[item++] = new TestCase( SECTION, + "(new Date(NaN)).getDate()", + NaN, + (new Date(NaN)).getDate() ); + + array[item++] = new TestCase( SECTION, + "Date.prototype.getDate.length", + 0, + Date.prototype.getDate.length ); + + function addTestCase( t ) { + for ( d = 0; d < TimeInMonth(MonthFromTime(t)); d+= msPerDay ) { + t += d; + array[item++] = new TestCase( SECTION, + "(new Date("+t+")).getDate()", + DateFromTime(LocalTime(t)), + (new Date(t)).getDate() ); + } + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_10_7.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_10_7.as new file mode 100644 index 00000000000..db40f46b432 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_10_7.as @@ -0,0 +1,101 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.10"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getDate()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + // get the current time + var now = (new Date()).valueOf(); + + // calculate time for year 0 + for ( var time = 0, year = 1969; year >= 0; year-- ) { + time -= TimeInYear(year); + } + // get time for 29 feb 2000 + + var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour; + + // get time for 1 jan 2005 + + var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+ + TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004); + + // some daylight savings time cases + + var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour ) + + var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour ); + + addTestCase( UTC_JAN_1_2005 ); +/* + addTestCase( DST_START_1998 ); + addTestCase( DST_START_1998-1 ); + addTestCase( DST_START_1998+1 ); + addTestCase( DST_END_1998 ); + addTestCase( DST_END_1998-1 ); + addTestCase( DST_END_1998+1 ); +*/ + + array[item++] = new TestCase( SECTION, + "(new Date(NaN)).getDate()", + NaN, + (new Date(NaN)).getDate() ); + + array[item++] = new TestCase( SECTION, + "Date.prototype.getDate.length", + 0, + Date.prototype.getDate.length ); + + function addTestCase( t ) { + for ( d = 0; d < TimeInMonth(MonthFromTime(t)); d+= msPerDay ) { + t += d; + array[item++] = new TestCase( SECTION, + "(new Date("+t+")).getDate()", + DateFromTime(LocalTime(t)), + (new Date(t)).getDate() ); + } + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_10_8.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_10_8.as new file mode 100644 index 00000000000..43ea8a56f18 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_10_8.as @@ -0,0 +1,100 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.10"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getDate()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + // get the current time + var now = (new Date()).valueOf(); + + // calculate time for year 0 + for ( var time = 0, year = 1969; year >= 0; year-- ) { + time -= TimeInYear(year); + } + // get time for 29 feb 2000 + + var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour; + + // get time for 1 jan 2005 + + var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+ + TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004); + + // some daylight savings time cases + + var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour ) + + var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour ); + + addTestCase( DST_START_1998 ); +/* + addTestCase( DST_START_1998-1 ); + addTestCase( DST_START_1998+1 ); + addTestCase( DST_END_1998 ); + addTestCase( DST_END_1998-1 ); + addTestCase( DST_END_1998+1 ); +*/ + + array[item++] = new TestCase( SECTION, + "(new Date(NaN)).getDate()", + NaN, + (new Date(NaN)).getDate() ); + + array[item++] = new TestCase( SECTION, + "Date.prototype.getDate.length", + 0, + Date.prototype.getDate.length ); + + function addTestCase( t ) { + for ( d = 0; d < TimeInMonth(MonthFromTime(t)); d+= msPerDay ) { + t += d; + array[item++] = new TestCase( SECTION, + "(new Date(+t+)).getDate()", + DateFromTime(LocalTime(t)), + (new Date(t)).getDate() ); + } + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_10_9.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_10_9.as new file mode 100644 index 00000000000..ba9f2d54bcf --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_10_9.as @@ -0,0 +1,99 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.10"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getDate()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + // get the current time + var now = (new Date()).valueOf(); + + // calculate time for year 0 + for ( var time = 0, year = 1969; year >= 0; year-- ) { + time -= TimeInYear(year); + } + // get time for 29 feb 2000 + + var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour; + + // get time for 1 jan 2005 + + var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+ + TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004); + + // some daylight savings time cases + + var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour ) + + var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour ); + + addTestCase( DST_START_1998-1 ); +/* + addTestCase( DST_START_1998+1 ); + addTestCase( DST_END_1998 ); + addTestCase( DST_END_1998-1 ); + addTestCase( DST_END_1998+1 ); +*/ + + array[item++] = new TestCase( SECTION, + "(new Date(NaN)).getDate()", + NaN, + (new Date(NaN)).getDate() ); + + array[item++] = new TestCase( SECTION, + "Date.prototype.getDate.length", + 0, + Date.prototype.getDate.length ); + + function addTestCase( t ) { + for ( d = 0; d < TimeInMonth(MonthFromTime(t)); d+= msPerDay ) { + t += d; + array[item++] = new TestCase( SECTION, + "(new Date(+t+)).getDate()", + DateFromTime(LocalTime(t)), + (new Date(t)).getDate() ); + } + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_11.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_11.as new file mode 100644 index 00000000000..8bc61f738fe --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_11.as @@ -0,0 +1,94 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.11"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getUTCFullYear()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + // get the current time + var now = (new Date()).valueOf(); + + // calculate time for year 0 + for ( var time = 0, year = 1969; year >= 0; year-- ) { + time -= TimeInYear(year); + } + // get time for 29 feb 2000 + + var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour; + + // get time for 1 jan 2005 + + var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+ + TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004); + + // some daylight savings time cases + + var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour ) + + var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour ); + + addTestCase( now ); + + + array[item++] = new TestCase( SECTION, + "(new Date(NaN)).getUTCFullYear()", + NaN, + (new Date(NaN)).getUTCFullYear() ); + + array[item++] = new TestCase( SECTION, + "Date.prototype.getUTCFullYear.length", + 0, + Date.prototype.getUTCFullYear.length ); + + function addTestCase( t ) { + for ( d = 0; d < TimeInMonth(MonthFromTime(t)); d+= msPerDay ) { + t += d; + array[item++] = new TestCase( SECTION, + "(new Date(currentTime+"+d+")).getUTCFullYear()", + true, YearFromTime(t) == + (new Date(t)).getUTCFullYear() ); + } + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_11_1.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_11_1.as new file mode 100644 index 00000000000..3fe0fbda852 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_11_1.as @@ -0,0 +1,90 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.11"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getUTCDate()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + // get the current time + var now = (new Date()).valueOf(); + + addTestCase( now ); + + + function addTestCase( t ) { + for ( var m = 0; m < 11; m++ ) { + t += TimeInMonth(m); + + for ( var d = 0; d < TimeInMonth( m ); d += 7*msPerDay ) { + t += d; + array[item++] = new TestCase( SECTION, + "(new Date(currentDate)).getUTCDate()", + true, DateFromTime((t)) == + (new Date(t)).getUTCDate() ); + /* + array[item++] = new TestCase( SECTION, + "(new Date(currentDate+1).getUTCDate()", + DateFromTime((t+1)), + (new Date(t+1)).getUTCDate() ); + + array[item++] = new TestCase( SECTION, + "(new Date(currentDate-1).getUTCDate()", + DateFromTime((t-1)), + (new Date(t-1)).getUTCDate() ); + + array[item++] = new TestCase( SECTION, + "(new Date(currentdate-TZ_ADJUST).getUTCDate()", + DateFromTime((t-TZ_ADJUST)), + (new Date(t-TZ_ADJUST)).getUTCDate() ); + + array[item++] = new TestCase( SECTION, + "(new Date(currenDate+TZ_ADJUST).getUTCDate()", + DateFromTime((t+TZ_ADJUST)), + (new Date(t+TZ_ADJUST)).getUTCDate() ); + */ + } + } + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_11_3.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_11_3.as new file mode 100644 index 00000000000..5b66d10506b --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_11_3.as @@ -0,0 +1,87 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.11"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getUTCDate()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + addTestCase( TIME_1970 ); + + + function addTestCase( t ) { + for ( var m = 0; m < 11; m++ ) { + t += TimeInMonth(m); + + for ( var d = 0; d < TimeInMonth( m ); d += 7*msPerDay ) { + t += d; + array[item++] = new TestCase( SECTION, + "(new Date("+t+")).getUTCDate()", + DateFromTime((t)), + (new Date(t)).getUTCDate() ); + /* + array[item++] = new TestCase( SECTION, + "(new Date("+(t+1)+")).getUTCDate()", + DateFromTime((t+1)), + (new Date(t+1)).getUTCDate() ); + + array[item++] = new TestCase( SECTION, + "(new Date("+(t-1)+")).getUTCDate()", + DateFromTime((t-1)), + (new Date(t-1)).getUTCDate() ); + + array[item++] = new TestCase( SECTION, + "(new Date("+(t-TZ_ADJUST)+")).getUTCDate()", + DateFromTime((t-TZ_ADJUST)), + (new Date(t-TZ_ADJUST)).getUTCDate() ); + + array[item++] = new TestCase( SECTION, + "(new Date("+(t+TZ_ADJUST)+")).getUTCDate()", + DateFromTime((t+TZ_ADJUST)), + (new Date(t+TZ_ADJUST)).getUTCDate() ); + */ + } + } + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_11_4.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_11_4.as new file mode 100644 index 00000000000..cfbbc872e0b --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_11_4.as @@ -0,0 +1,87 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.11"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getUTCDate()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + addTestCase( TIME_1900 ); + + + function addTestCase( t ) { + for ( var m = 0; m < 11; m++ ) { + t += TimeInMonth(m); + + for ( var d = 0; d < TimeInMonth( m ); d += 7* msPerDay ) { + t += d; + array[item++] = new TestCase( SECTION, + "(new Date("+t+")).getUTCDate()", + DateFromTime((t)), + (new Date(t)).getUTCDate() ); + /* + array[item++] = new TestCase( SECTION, + "(new Date("+(t+1)+")).getUTCDate()", + DateFromTime((t+1)), + (new Date(t+1)).getUTCDate() ); + + array[item++] = new TestCase( SECTION, + "(new Date("+(t-1)+")).getUTCDate()", + DateFromTime((t-1)), + (new Date(t-1)).getUTCDate() ); + + array[item++] = new TestCase( SECTION, + "(new Date("+(t-TZ_ADJUST)+")).getUTCDate()", + DateFromTime((t-TZ_ADJUST)), + (new Date(t-TZ_ADJUST)).getUTCDate() ); + + array[item++] = new TestCase( SECTION, + "(new Date("+(t+TZ_ADJUST)+")).getUTCDate()", + DateFromTime((t+TZ_ADJUST)), + (new Date(t+TZ_ADJUST)).getUTCDate() ); + */ + } + } + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_11_5.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_11_5.as new file mode 100644 index 00000000000..eebaa1a4fa7 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_11_5.as @@ -0,0 +1,86 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.11"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getUTCDate()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + addTestCase( TIME_2000 ); + + function addTestCase( t ) { + for ( var m = 0; m < 11; m++ ) { + t += TimeInMonth(m); + + for ( var d = 0; d < TimeInMonth( m ); d += 7*msPerDay ) { + t += d; + array[item++] = new TestCase( SECTION, + "(new Date("+t+")).getUTCDate()", + DateFromTime((t)), + (new Date(t)).getUTCDate() ); + /* + array[item++] = new TestCase( SECTION, + "(new Date("+(t+1)+")).getUTCDate()", + DateFromTime((t+1)), + (new Date(t+1)).getUTCDate() ); + + array[item++] = new TestCase( SECTION, + "(new Date("+(t-1)+")).getUTCDate()", + DateFromTime((t-1)), + (new Date(t-1)).getUTCDate() ); + + array[item++] = new TestCase( SECTION, + "(new Date("+(t-TZ_ADJUST)+")).getUTCDate()", + DateFromTime((t-TZ_ADJUST)), + (new Date(t-TZ_ADJUST)).getUTCDate() ); + + array[item++] = new TestCase( SECTION, + "(new Date("+(t+TZ_ADJUST)+")).getUTCDate()", + DateFromTime((t+TZ_ADJUST)), + (new Date(t+TZ_ADJUST)).getUTCDate() ); + */ + } + } + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_11_6.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_11_6.as new file mode 100644 index 00000000000..662d997765f --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_11_6.as @@ -0,0 +1,88 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.11"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getUTCDate()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + var UTC_FEB_29_2000 = TIME_2000 + ( 30 * msPerDay ) + ( 29 * msPerDay ); + + addTestCase( UTC_FEB_29_2000 ); + + function addTestCase( t ) { + for ( var m = 0; m < 11; m++ ) { + t += TimeInMonth(m); + + for ( var d = 0; d < TimeInMonth( m ); d += 7*msPerDay ) { + t += d; + array[item++] = new TestCase( SECTION, + "(new Date("+t+")).getUTCDate()", + DateFromTime((t)), + (new Date(t)).getUTCDate() ); + /* + array[item++] = new TestCase( SECTION, + "(new Date("+(t+1)+")).getUTCDate()", + DateFromTime((t+1)), + (new Date(t+1)).getUTCDate() ); + + array[item++] = new TestCase( SECTION, + "(new Date("+(t-1)+")).getUTCDate()", + DateFromTime((t-1)), + (new Date(t-1)).getUTCDate() ); + + array[item++] = new TestCase( SECTION, + "(new Date("+(t-TZ_ADJUST)+")).getUTCDate()", + DateFromTime((t-TZ_ADJUST)), + (new Date(t-TZ_ADJUST)).getUTCDate() ); + + array[item++] = new TestCase( SECTION, + "(new Date("+(t+TZ_ADJUST)+")).getUTCDate()", + DateFromTime((t+TZ_ADJUST)), + (new Date(t+TZ_ADJUST)).getUTCDate() ); + */ + } + } + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_11_7.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_11_7.as new file mode 100644 index 00000000000..2ab32d806b0 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_11_7.as @@ -0,0 +1,89 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.11"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getUTCDate()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+ + TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004); + + addTestCase( UTC_JAN_1_2005 ); + + function addTestCase( t ) { + for ( var m = 0; m < 11; m++ ) { + t += TimeInMonth(m); + + for ( var d = 0; d < TimeInMonth( m ); d += 7*msPerDay ) { + t += d; + array[item++] = new TestCase( SECTION, + "(new Date("+t+")).getUTCDate()", + DateFromTime((t)), + (new Date(t)).getUTCDate() ); + /* + array[item++] = new TestCase( SECTION, + "(new Date("+(t+1)+")).getUTCDate()", + DateFromTime((t+1)), + (new Date(t+1)).getUTCDate() ); + + array[item++] = new TestCase( SECTION, + "(new Date("+(t-1)+")).getUTCDate()", + DateFromTime((t-1)), + (new Date(t-1)).getUTCDate() ); + + array[item++] = new TestCase( SECTION, + "(new Date("+(t-TZ_ADJUST)+")).getUTCDate()", + DateFromTime((t-TZ_ADJUST)), + (new Date(t-TZ_ADJUST)).getUTCDate() ); + + array[item++] = new TestCase( SECTION, + "(new Date("+(t+TZ_ADJUST)+")).getUTCDate()", + DateFromTime((t+TZ_ADJUST)), + (new Date(t+TZ_ADJUST)).getUTCDate() ); + */ + } + } + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_12.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_12.as new file mode 100644 index 00000000000..fef36d9d4a4 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_12.as @@ -0,0 +1,93 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.10"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getMonth()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + // get the current time + var now = (new Date()).valueOf(); + + // calculate time for year 0 + for ( var time = 0, year = 1969; year >= 0; year-- ) { + time -= TimeInYear(year); + } + // get time for 29 feb 2000 + + var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour; + + // get time for 1 jan 2005 + + var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+ + TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004); + + // some daylight savings time cases + + var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour ) + + var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour ); + + addTestCase( now ); + + + array[item++] = new TestCase( SECTION, + "(new Date(NaN)).getMonth()", + NaN, + (new Date(NaN)).getMonth() ); + + array[item++] = new TestCase( SECTION, + "Date.prototype.getMonth.length", + 0, + Date.prototype.getMonth.length ); + function addTestCase( t ) { + for ( d = 0; d < TimeInMonth(MonthFromTime(t)); d+= msPerDay ) { + t += d; + array[item++] = new TestCase( SECTION, + "(new Date(currentTime+"+d+")).getMonth()", + true, MonthFromTime(LocalTime(t)) == + (new Date(t)).getMonth() ); + } + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_12_1.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_12_1.as new file mode 100644 index 00000000000..1cd47e0102a --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_12_1.as @@ -0,0 +1,99 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.12"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getDay()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + // get the current time + var now = (new Date()).valueOf(); + + // calculate time for year 0 + for ( var time = 0, year = 1969; year >= 0; year-- ) { + time -= TimeInYear(year); + } + // get time for 29 feb 2000 + + var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour; + + // get time for 1 jan 2005 + + var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+ + TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004); + + addTestCase( now ); +/* + addTestCase( time ); + addTestCase( TIME_1970 ); + addTestCase( TIME_1900 ); + addTestCase( TIME_2000 ); + addTestCase( UTC_FEB_29_2000 ); + addTestCase( UTC_JAN_1_2005 ); + + array[item++] = new TestCase( SECTION, + "(new Date(NaN)).getDay()", + NaN, + (new Date(NaN)).getDay() ); + + array[item++] = new TestCase( SECTION, + "Date.prototype.getDay.length", + 0, + Date.prototype.getDay.length ); +*/ + function addTestCase( t ) { + for ( var m = 0; m < 12; m++ ) { + t += TimeInMonth(m); + + for ( d = 0; d < TimeInMonth(m); d+= msPerDay*6 ) { + t += d; + + array[item++] = new TestCase( SECTION, + "(new Date(TimeInMonth+"+d+")).getDay()", + true, WeekDay(LocalTime(t)) == + (new Date(t)).getDay() ); + } + } + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_12_3.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_12_3.as new file mode 100644 index 00000000000..6fad4317c8d --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_12_3.as @@ -0,0 +1,97 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.12"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getDay()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + // get the current time + var now = (new Date()).valueOf(); + + // calculate time for year 0 + for ( var time = 0, year = 1969; year >= 0; year-- ) { + time -= TimeInYear(year); + } + // get time for 29 feb 2000 + + var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour; + + // get time for 1 jan 2005 + + var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+ + TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004); + + addTestCase( TIME_1970 ); +/* + addTestCase( TIME_1900 ); + addTestCase( TIME_2000 ); + addTestCase( UTC_FEB_29_2000 ); + addTestCase( UTC_JAN_1_2005 ); + + array[item++] = new TestCase( SECTION, + "(new Date(NaN)).getDay()", + NaN, + (new Date(NaN)).getDay() ); + + array[item++] = new TestCase( SECTION, + "Date.prototype.getDay.length", + 0, + Date.prototype.getDay.length ); +*/ + function addTestCase( t ) { + for ( var m = 0; m < 12; m++ ) { + t += TimeInMonth(m); + + for ( d = 0; d < TimeInMonth(m); d+= msPerDay*6 ) { + t += d; + + array[item++] = new TestCase( SECTION, + "(new Date("+t+")).getDay()", + WeekDay(LocalTime(t)), + (new Date(t)).getDay() ); + } + } + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_12_4.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_12_4.as new file mode 100644 index 00000000000..09e082ed858 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_12_4.as @@ -0,0 +1,97 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.12"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getDay()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + // get the current time + var now = (new Date()).valueOf(); + + // calculate time for year 0 + for ( var time = 0, year = 1969; year >= 0; year-- ) { + time -= TimeInYear(year); + } + // get time for 29 feb 2000 + + var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour; + + // get time for 1 jan 2005 + + var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+ + TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004); + + addTestCase( TIME_1900 ); +/* + addTestCase( TIME_2000 ); + addTestCase( UTC_FEB_29_2000 ); + addTestCase( UTC_JAN_1_2005 ); + + array[item++] = new TestCase( SECTION, + "(new Date(NaN)).getDay()", + NaN, + (new Date(NaN)).getDay() ); + + array[item++] = new TestCase( SECTION, + "Date.prototype.getDay.length", + 0, + Date.prototype.getDay.length ); +*/ + + function addTestCase( t ) { + for ( var m = 0; m < 12; m++ ) { + t += TimeInMonth(m); + + for ( d = 0; d < TimeInMonth(m); d+= msPerDay*6 ) { + t += d; + + array[item++] = new TestCase( SECTION, + "(new Date("+t+")).getDay()", + WeekDay(LocalTime(t)), + (new Date(t)).getDay() ); + } + } + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_12_5.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_12_5.as new file mode 100644 index 00000000000..9c2fb83b86b --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_12_5.as @@ -0,0 +1,96 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.12"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getDay()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + // get the current time + var now = (new Date()).valueOf(); + + // calculate time for year 0 + for ( var time = 0, year = 1969; year >= 0; year-- ) { + time -= TimeInYear(year); + } + // get time for 29 feb 2000 + + var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour; + + // get time for 1 jan 2005 + + var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+ + TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004); + + addTestCase( TIME_2000 ); +/* + addTestCase( UTC_FEB_29_2000 ); + addTestCase( UTC_JAN_1_2005 ); + + array[item++] = new TestCase( SECTION, + "(new Date(NaN)).getDay()", + NaN, + (new Date(NaN)).getDay() ); + + array[item++] = new TestCase( SECTION, + "Date.prototype.getDay.length", + 0, + Date.prototype.getDay.length ); +*/ + + function addTestCase( t ) { + for ( var m = 0; m < 12; m++ ) { + t += TimeInMonth(m); + + for ( d = 0; d < TimeInMonth(m); d+= msPerDay*6 ) { + t += d; + + array[item++] = new TestCase( SECTION, + "(new Date("+t+")).getDay()", + WeekDay(LocalTime(t)), + (new Date(t)).getDay() ); + } + } + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_12_6.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_12_6.as new file mode 100644 index 00000000000..451976545ea --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_12_6.as @@ -0,0 +1,95 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.12"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getDay()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + // get the current time + var now = (new Date()).valueOf(); + + // calculate time for year 0 + for ( var time = 0, year = 1969; year >= 0; year-- ) { + time -= TimeInYear(year); + } + // get time for 29 feb 2000 + + var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour; + + // get time for 1 jan 2005 + + var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+ + TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004); + + addTestCase( UTC_FEB_29_2000 ); +/* + addTestCase( UTC_JAN_1_2005 ); + + array[item++] = new TestCase( SECTION, + "(new Date(NaN)).getDay()", + NaN, + (new Date(NaN)).getDay() ); + + array[item++] = new TestCase( SECTION, + "Date.prototype.getDay.length", + 0, + Date.prototype.getDay.length ); +*/ + + function addTestCase( t ) { + for ( var m = 0; m < 12; m++ ) { + t += TimeInMonth(m); + + for ( d = 0; d < TimeInMonth(m); d+= msPerDay*6 ) { + t += d; + + array[item++] = new TestCase( SECTION, + "(new Date("+t+")).getDay()", + WeekDay(LocalTime(t)), + (new Date(t)).getDay() ); + } + } + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_12_7.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_12_7.as new file mode 100644 index 00000000000..994fe2d6337 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_12_7.as @@ -0,0 +1,92 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.12"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getDay()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + // get the current time + var now = (new Date()).valueOf(); + + // calculate time for year 0 + for ( var time = 0, year = 1969; year >= 0; year-- ) { + time -= TimeInYear(year); + } + // get time for 29 feb 2000 + + var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour; + + // get time for 1 jan 2005 + + var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+ + TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004); + + addTestCase( UTC_JAN_1_2005 ); +/* + array[item++] = new TestCase( SECTION, + "(new Date(NaN)).getDay()", + NaN, + (new Date(NaN)).getDay() ); + + array[item++] = new TestCase( SECTION, + "Date.prototype.getDay.length", + 0, + Date.prototype.getDay.length ); +*/ + function addTestCase( t ) { + for ( var m = 0; m < 12; m++ ) { + t += TimeInMonth(m); + + for ( d = 0; d < TimeInMonth(m); d+= msPerDay*6 ) { + t += d; + + array[item++] = new TestCase( SECTION, + "(new Date("+t+")).getDay()", + WeekDay(LocalTime(t)), + (new Date(t)).getDay() ); + } + } + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_12_8.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_12_8.as new file mode 100644 index 00000000000..a6a886728e5 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_12_8.as @@ -0,0 +1,90 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.12"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getDay()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + // get the current time + var now = (new Date()).valueOf(); + + // calculate time for year 0 + for ( var time = 0, year = 1969; year >= 0; year-- ) { + time -= TimeInYear(year); + } + // get time for 29 feb 2000 + + var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour; + + // get time for 1 jan 2005 + + var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+ + TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004); + + array[item++] = new TestCase( SECTION, + "(new Date(NaN)).getDay()", + NaN, + (new Date(NaN)).getDay() ); + + array[item++] = new TestCase( SECTION, + "Date.prototype.getDay.length", + 0, + Date.prototype.getDay.length ); + + function addTestCase( t ) { + for ( var m = 0; m < 12; m++ ) { + t += TimeInMonth(m); + + for ( d = 0; d < TimeInMonth(m); d+= msPerDay*6 ) { + t += d; + + array[item++] = new TestCase( SECTION, + "(new Date("+t+")).getDay()", + WeekDay(LocalTime(t)), + (new Date(t)).getDay() ); + } + } + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_13.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_13.as new file mode 100644 index 00000000000..185922c99f5 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_13.as @@ -0,0 +1,88 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.13"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getUTCMonth()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + // get the current time + var now = (new Date()).valueOf(); + + // calculate time for year 0 + for ( var time = 0, year = 1969; year >= 0; year-- ) { + time -= TimeInYear(year); + } + // get time for 29 feb 2000 + + var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour; + + // get time for 1 jan 2005 + + var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+ + TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004); + + addTestCase( now ); + + + array[item++] = new TestCase( SECTION, + "(new Date(NaN)).getUTCMonth()", + NaN, + (new Date(NaN)).getUTCMonth() ); + + array[item++] = new TestCase( SECTION, + "Date.prototype.getUTCMonth.length", + 0, + Date.prototype.getUTCMonth.length ); + + function addTestCase( t ) { + for ( d = 0; d < TimeInMonth(MonthFromTime(t)); d+= msPerDay ) { + t += d; + array[item++] = new TestCase( SECTION, + "(new Date(currentTime+"+d+")).getUTCMonth()", + true, MonthFromTime(t) == + (new Date(t)).getUTCMonth() ); + } + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_13_1.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_13_1.as new file mode 100644 index 00000000000..620adb20763 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_13_1.as @@ -0,0 +1,69 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.13"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getUTCDay()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + // get the current time + var now = (new Date()).valueOf(); + + addTestCase( now ); + + function addTestCase( t ) { + for ( var m = 0; m < 12; m++ ) { + t += TimeInMonth(m); + + for ( d = 0; d < TimeInMonth(m); d+= msPerDay*14 ) { + t += d; + + array[item++] = new TestCase( SECTION, + "(new Date(currentDate)).getUTCDay()", + true, WeekDay((t)) == + (new Date(t)).getUTCDay() ); + } + } + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_13_2.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_13_2.as new file mode 100644 index 00000000000..fe7c362ef14 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_13_2.as @@ -0,0 +1,71 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.13"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getUTCDay()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + // calculate time for year 0 + for ( var time = 0, year = 1969; year >= 0; year-- ) { + time -= TimeInYear(year); + } + + addTestCase( time ); + + function addTestCase( t ) { + for ( var m = 0; m < 12; m++ ) { + t += TimeInMonth(m); + + for ( d = 0; d < TimeInMonth(m); d+= msPerDay*14 ) { + t += d; + + array[item++] = new TestCase( SECTION, + "(new Date("+t+")).getUTCDay()", + WeekDay((t)), + (new Date(t)).getUTCDay() ); + } + } + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_13_3.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_13_3.as new file mode 100644 index 00000000000..83d20a31370 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_13_3.as @@ -0,0 +1,66 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.13"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getUTCDay()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + addTestCase( TIME_1970 ); + + function addTestCase( t ) { + for ( var m = 0; m < 12; m++ ) { + t += TimeInMonth(m); + + for ( d = 0; d < TimeInMonth(m); d+= msPerDay*14 ) { + t += d; + + array[item++] = new TestCase( SECTION, + "(new Date("+t+")).getUTCDay()", + WeekDay((t)), + (new Date(t)).getUTCDay() ); + } + } + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_13_4.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_13_4.as new file mode 100644 index 00000000000..1f081cca9e5 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_13_4.as @@ -0,0 +1,66 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.13"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getUTCDay()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + addTestCase( TIME_1900 ); + + function addTestCase( t ) { + for ( var m = 0; m < 12; m++ ) { + t += TimeInMonth(m); + + for ( d = 0; d < TimeInMonth(m); d+= msPerDay*14 ) { + t += d; + + array[item++] = new TestCase( SECTION, + "(new Date("+t+")).getUTCDay()", + WeekDay((t)), + (new Date(t)).getUTCDay() ); + } + } + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_13_5.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_13_5.as new file mode 100644 index 00000000000..ca87ceb5b85 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_13_5.as @@ -0,0 +1,66 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.13"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getUTCDay()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + addTestCase( TIME_2000 ); + + function addTestCase( t ) { + for ( var m = 0; m < 12; m++ ) { + t += TimeInMonth(m); + + for ( d = 0; d < TimeInMonth(m); d+= msPerDay*14 ) { + t += d; + + array[item++] = new TestCase( SECTION, + "(new Date("+t+")).getUTCDay()", + WeekDay((t)), + (new Date(t)).getUTCDay() ); + } + } + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_13_6.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_13_6.as new file mode 100644 index 00000000000..bbb446cca53 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_13_6.as @@ -0,0 +1,70 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.13"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getUTCDay()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + // get time for 29 feb 2000 + + var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour; + + addTestCase( UTC_FEB_29_2000 ); + + function addTestCase( t ) { + for ( var m = 0; m < 12; m++ ) { + t += TimeInMonth(m); + + for ( d = 0; d < TimeInMonth(m); d+= msPerDay*7 ) { + t += d; + + array[item++] = new TestCase( SECTION, + "(new Date("+t+")).getUTCDay()", + WeekDay((t)), + (new Date(t)).getUTCDay() ); + } + } + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_13_7.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_13_7.as new file mode 100644 index 00000000000..b9ce591f04e --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_13_7.as @@ -0,0 +1,71 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.13"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getUTCDay()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + // get time for 1 jan 2005 + + var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+ + TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004); + + addTestCase( UTC_JAN_1_2005 ); + + function addTestCase( t ) { + for ( var m = 0; m < 12; m++ ) { + t += TimeInMonth(m); + + for ( d = 0; d < TimeInMonth(m); d+= msPerDay*7 ) { + t += d; + + array[item++] = new TestCase( SECTION, + "(new Date("+t+")).getUTCDay()", + WeekDay((t)), + (new Date(t)).getUTCDay() ); + } + } + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_13_8.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_13_8.as new file mode 100644 index 00000000000..dc4c43f1c4b --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_13_8.as @@ -0,0 +1,90 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.13"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getUTCDay()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + // get the current time + var now = (new Date()).valueOf(); + + // calculate time for year 0 + for ( var time = 0, year = 1969; year >= 0; year-- ) { + time -= TimeInYear(year); + } + // get time for 29 feb 2000 + + var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour; + + // get time for 1 jan 2005 + + var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+ + TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004); + + array[item++] = new TestCase( SECTION, + "(new Date(NaN)).getUTCDay()", + NaN, + (new Date(NaN)).getUTCDay() ); + + array[item++] = new TestCase( SECTION, + "Date.prototype.getUTCDay.length", + 0, + Date.prototype.getUTCDay.length ); + + function addTestCase( t ) { + for ( var m = 0; m < 12; m++ ) { + t += TimeInMonth(m); + + for ( d = 0; d < TimeInMonth(m); d+= msPerDay*7 ) { + t += d; + + array[item++] = new TestCase( SECTION, + "(new Date("+t+")).getUTCDay()", + WeekDay((t)), + (new Date(t)).getUTCDay() ); + } + } + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_14.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_14.as new file mode 100644 index 00000000000..920d4e0efdd --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_14.as @@ -0,0 +1,92 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.14"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getHours()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + // get the current time + var now = (new Date()).valueOf(); + + // calculate time for year 0 + for ( var time = 0, year = 1969; year >= 0; year-- ) { + time -= TimeInYear(year); + } + + // get time for 29 feb 2000 + var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour; + + // get time for 1 jan 2005 + var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001) + TimeInYear(2002) + TimeInYear(2003) + TimeInYear(2004); + + addTestCase( now ); + addTestCase( time ); + addTestCase( TIME_1970 ); + addTestCase( TIME_1900 ); + addTestCase( TIME_2000 ); + addTestCase( UTC_FEB_29_2000 ); + addTestCase( UTC_JAN_1_2005 ); + + array[item++] = new TestCase( SECTION, + "(new Date(NaN)).getHours()", + NaN, + (new Date(NaN)).getHours() ); + + array[item++] = new TestCase( SECTION, + "Date.prototype.getHours.length", + 0, + Date.prototype.getHours.length ); + + + function addTestCase( t ) { + for ( h = 0; h < 24; h+=4 ) { + t += msPerHour; + array[item++] = new TestCase( SECTION, + "(new Date(hour"+h+")).getHours()", + true, HourFromTime((LocalTime(t))) == + (new Date(t)).getHours() ); + } + } + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_15.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_15.as new file mode 100644 index 00000000000..1f3ed07bd64 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_15.as @@ -0,0 +1,106 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.15"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getUTCHours()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + // get the current time + var now = (new Date()).valueOf(); + + // calculate time for year 0 + for ( var time = 0, year = 1969; year >= 0; year-- ) { + time -= TimeInYear(year); + } + + + // get time for 29 feb 2000 + var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour; + + + // get time for 1 jan 2005 + var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+ + TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004); + + addTestCase2( now ); + addTestCase( time ); + addTestCase( TIME_1970 ); + addTestCase( TIME_1900 ); + addTestCase( TIME_2000 ); + addTestCase( UTC_FEB_29_2000 ); + addTestCase( UTC_JAN_1_2005 ); + + array[item++] = new TestCase( SECTION, + "(new Date(NaN)).getUTCHours()", + NaN, + (new Date(NaN)).getUTCHours() ); + + array[item++] = new TestCase( SECTION, + "Date.prototype.getUTCHours.length", + 0, + Date.prototype.getUTCHours.length ); + + function addTestCase( t ) { + for ( h = 0; h < 24; h+=3 ) { + t += msPerHour; + array[item++] = new TestCase( SECTION, + "(new Date("+t+")).getUTCHours()", + true, HourFromTime((t)) == + (new Date(t)).getUTCHours() ); + } + } + + + //used only for current Date + function addTestCase2( t ) { + for ( h = 0; h < 24; h+=3 ) { + t += msPerHour; + array[item++] = new TestCase( SECTION, + "(new Date(currentDate)).getUTCHours()", + true, HourFromTime((t)) == + (new Date(t)).getUTCHours() ); + } + } + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_15_1.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_15_1.as new file mode 100644 index 00000000000..9bb3af5625a --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_15_1.as @@ -0,0 +1,70 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.15.1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getUTCDate()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // get the current time + var now = (new Date()).valueOf(); + + addTestCase( now ); + array[item++] = new TestCase( SECTION, + "(new Date(NaN)).getUTCDate()", + NaN, + (new Date(NaN)).getUTCDate() ); + array[item++] = new TestCase( SECTION, + "Date.prototype.getUTCDate.length", + 0, + Date.prototype.getUTCDate.length ); + + + function addTestCase( t ) { + for ( d = 0; d < TimeInMonth(MonthFromTime(t)); d+= msPerDay ) { + t += d; + array[item++] = new TestCase( SECTION, + "(new Date(currentTime+"+d+")).getUTCDate()", + true, DateFromTime(t) == + (new Date(t)).getUTCDate() ); + } + } + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_16.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_16.as new file mode 100644 index 00000000000..d6a84298aeb --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_16.as @@ -0,0 +1,94 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.16"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getMinutes()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + // get the current time + var now = (new Date()).valueOf(); + + // calculate time for year 0 + for ( var time = 0, year = 1969; year >= 0; year-- ) { + time -= TimeInYear(year); + } + // get time for 29 feb 2000 + + var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour; + + // get time for 1 jan 2005 + + var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+ + TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004); + + addTestCase( now ); + addTestCase( time ); + addTestCase( TIME_1970 ); + addTestCase( TIME_1900 ); + addTestCase( TIME_2000 ); + addTestCase( UTC_FEB_29_2000 ); + addTestCase( UTC_JAN_1_2005 ); + + array[item++] = new TestCase( SECTION, + "(new Date(NaN)).getMinutes()", + NaN, + (new Date(NaN)).getMinutes() ); + + array[item++] = new TestCase( SECTION, + "Date.prototype.getMinutes.length", + 0, + Date.prototype.getMinutes.length ); + + + + function addTestCase( t ) { + for ( m = 0; m <= 60; m+=10 ) { + t += msPerMinute; + array[item++] = new TestCase( SECTION, + "(new Date(Minute"+m+")).getMinutes()", + true, MinFromTime((LocalTime(t))) == + (new Date(t)).getMinutes() ); + } + } + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_17.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_17.as new file mode 100644 index 00000000000..9d5f3cca204 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_17.as @@ -0,0 +1,105 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.17"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getUTCMinutes()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + // get the current time + var now = (new Date()).valueOf(); + + // calculate time for year 0 + for ( var time = 0, year = 1969; year >= 0; year-- ) { + time -= TimeInYear(year); + } + + + // get time for 29 feb 2000 + var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour; + + // get time for 1 jan 2005 + var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+ TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004); + + addTestCase2( now ); + addTestCase( time ); + addTestCase( TIME_1970 ); + addTestCase( TIME_1900 ); + addTestCase( TIME_2000 ); + addTestCase( UTC_FEB_29_2000 ); + addTestCase( UTC_JAN_1_2005 ); + + array[item++] = new TestCase( SECTION, + "(new Date(NaN)).getUTCMinutes()", + NaN, + (new Date(NaN)).getUTCMinutes() ); + + array[item++] = new TestCase( SECTION, + "Date.prototype.getUTCMinutes.length", + 0, + Date.prototype.getUTCMinutes.length ); + + + + function addTestCase( t ) { + for ( m = 0; m <= 60; m+=10 ) { + t += msPerMinute; + array[item++] = new TestCase( SECTION, + "(new Date("+t+")).getUTCMinutes()", + true, MinFromTime(t) == + (new Date(t)).getUTCMinutes() ); + } + } + + + // used only for current date that will change from day to day + function addTestCase2( t ) { + for ( m = 0; m <= 60; m+=10 ) { + t += msPerMinute; + array[item++] = new TestCase( SECTION, + "(new Date(currentDate)).getUTCMinutes()", + true, MinFromTime(t) == + (new Date(t)).getUTCMinutes() ); + } + } + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_17_1.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_17_1.as new file mode 100644 index 00000000000..c9fbdfb7336 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_17_1.as @@ -0,0 +1,70 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.17.1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getUTCDay()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // get the current time + var now = (new Date()).valueOf(); + + addTestCase( now ); + array[item++] = new TestCase( SECTION, + "(new Date(NaN)).getUTCDay()", + NaN, + (new Date(NaN)).getUTCDay() ); + array[item++] = new TestCase( SECTION, + "Date.prototype.getUTCDay.length", + 0, + Date.prototype.getUTCDay.length ); + + + function addTestCase( t ) { + for ( d = 0; d < TimeInMonth(MonthFromTime(t)); d+= msPerDay ) { + t += d; + array[item++] = new TestCase( SECTION, + "(new Date(currentTime+"+d+")).getUTCDay()", + true, WeekDay(t) == + (new Date(t)).getUTCDay() ); + } + } + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_18.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_18.as new file mode 100644 index 00000000000..b928448ebd6 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_18.as @@ -0,0 +1,91 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.18"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getSeconds()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + // get the current time + var now = (new Date()).valueOf(); + + // calculate time for year 0 + for ( var time = 0, year = 1969; year >= 0; year-- ) { + time -= TimeInYear(year); + } + + // get time for 29 feb 2000 + var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour; + + // get time for 1 jan 2005 + var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+ + TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004); + + addTestCase( now ); + addTestCase( time ); + addTestCase( TIME_1970 ); + addTestCase( TIME_1900 ); + addTestCase( TIME_2000 ); + addTestCase( UTC_FEB_29_2000 ); + addTestCase( UTC_JAN_1_2005 ); + + array[item++] = new TestCase( SECTION, + "(new Date(NaN)).getSeconds()", + NaN, + (new Date(NaN)).getSeconds() ); + + array[item++] = new TestCase( SECTION, + "Date.prototype.getSeconds.length", + 0, + Date.prototype.getSeconds.length ); + + function addTestCase( t ) { + for ( m = 0; m <= 60; m+=10 ) { + t += 1000; + array[item++] = new TestCase( SECTION, + "(new Date(minute"+m+")).getSeconds()", + true, SecFromTime(LocalTime(t)) == + (new Date(t)).getSeconds() ); + } + } + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_19.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_19.as new file mode 100644 index 00000000000..374a7b2dded --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_19.as @@ -0,0 +1,106 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.19"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getUTCSeconds()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + // get the current time + var now = (new Date()).valueOf(); + + // calculate time for year 0 + for ( var time = 0, year = 1969; year >= 0; year-- ) { + time -= TimeInYear(year); + } + // get time for 29 feb 2000 + + var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour; + + // get time for 1 jan 2005 + + var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+ + TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004); + + addTestCase2( now ); + addTestCase( time ); + addTestCase( TIME_1970 ); + addTestCase( TIME_1900 ); + addTestCase( TIME_2000 ); + addTestCase( UTC_FEB_29_2000 ); + addTestCase( UTC_JAN_1_2005 ); + + array[item++] = new TestCase( SECTION, + "(new Date(NaN)).getUTCSeconds()", + NaN, + (new Date(NaN)).getUTCSeconds() ); + + array[item++] = new TestCase( SECTION, + "Date.prototype.getUTCSeconds.length", + 0, + Date.prototype.getUTCSeconds.length ); + + + + function addTestCase( t ) { + for ( m = 0; m <= 60; m+=10 ) { + t += 1000; + array[item++] = new TestCase( SECTION, + "(new Date("+t+")).getUTCSeconds()", + true, SecFromTime(t) == + (new Date(t)).getUTCSeconds() ); + } + } + + + //used only for current Date + function addTestCase2( t ) { + for ( m = 0; m <= 60; m+=10 ) { + t += 1000; + array[item++] = new TestCase( SECTION, + "(new Date(currentDate)).getUTCSeconds()", + true, SecFromTime(t) == + (new Date(t)).getUTCSeconds() ); + } + } + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_2.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_2.as new file mode 100644 index 00000000000..e085385ea2b --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_2.as @@ -0,0 +1,138 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.toString"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, + "Date.prototype.toString.length", + 0, + Date.prototype.toString.length ); + + var now = new Date(); + + // can't test the content of the string, but can verify that the string is + // parsable by Date.parse + + array[item++] = new TestCase( SECTION, + "Math.abs(Date.parse(now.toString()) - now.valueOf()) < 1000", + true, + Math.abs(Date.parse(now.toString()) - now.valueOf()) < 1000 ); + + array[item++] = new TestCase( SECTION, + "typeof now.toString()", + "string", + typeof now.toString() ); + // 1970 + + TZ_ADJUST = TZ_DIFF * msPerHour; + + array[item++] = new TestCase( SECTION, + "Date.parse( (new Date(0)).toString() )", + 0, + Date.parse( (new Date(0)).toString() ) ) + + array[item++] = new TestCase( SECTION, + "Date.parse( (new Date(+TZ_ADJUST+)).toString() )", + TZ_ADJUST, + Date.parse( (new Date(TZ_ADJUST)).toString() ) ) + + // 1900 + array[item++] = new TestCase( SECTION, + "Date.parse( (new Date(+TIME_1900+).toString() )", + TIME_1900, + Date.parse( (new Date(TIME_1900)).toString() ) ) + + array[item++] = new TestCase( SECTION, + "Date.parse( (new Date(+TIME_1900 -TZ_ADJUST+)).toString() )", + TIME_1900 -TZ_ADJUST, + Date.parse( (new Date(TIME_1900 -TZ_ADJUST)).toString() ) ) + + // 2000 + array[item++] = new TestCase( SECTION, + "Date.parse( (new Date(+TIME_2000+)).toString() )", + TIME_2000, + Date.parse( (new Date(TIME_2000)).toString() ) ) + + array[item++] = new TestCase( SECTION, + "Date.parse( (new Date(+TIME_2000 -TZ_ADJUST+)).toString() )", + TIME_2000 -TZ_ADJUST, + Date.parse( (new Date(TIME_2000 -TZ_ADJUST)).toString() ) ) + + // 29 Feb 2000 + + var UTC_29_FEB_2000 = TIME_2000 + 31*msPerDay + 28*msPerDay; + array[item++] = new TestCase( SECTION, + "Date.parse( (new Date(+UTC_29_FEB_2000+)).toString() )", + UTC_29_FEB_2000, + Date.parse( (new Date(UTC_29_FEB_2000)).toString() ) ) + + array[item++] = new TestCase( SECTION, + "Date.parse( (new Date(+(UTC_29_FEB_2000-1000)+)).toString() )", + UTC_29_FEB_2000-1000, + Date.parse( (new Date(UTC_29_FEB_2000-1000)).toString() ) ) + + + array[item++] = new TestCase( SECTION, + "Date.parse( (new Date(+(UTC_29_FEB_2000-TZ_ADJUST)+)).toString() )", + UTC_29_FEB_2000-TZ_ADJUST, + Date.parse( (new Date(UTC_29_FEB_2000-TZ_ADJUST)).toString() ) ) + // 2O05 + + var UTC_1_JAN_2005 = TIME_2000 + TimeInYear(2000) + TimeInYear(2001) + + TimeInYear(2002) + TimeInYear(2003) + TimeInYear(2004); + array[item++] = new TestCase( SECTION, + "Date.parse( (new Date(+UTC_1_JAN_2005+)).toString() )", + UTC_1_JAN_2005, + Date.parse( (new Date(UTC_1_JAN_2005)).toString() ) ) + + array[item++] = new TestCase( SECTION, + "Date.parse( (new Date(+(UTC_1_JAN_2005-1000)+)).toString() )", + UTC_1_JAN_2005-1000, + Date.parse( (new Date(UTC_1_JAN_2005-1000)).toString() ) ) + + array[item++] = new TestCase( SECTION, + "Date.parse( (new Date(+(UTC_1_JAN_2005-TZ_ADJUST)+)).toString() )", + UTC_1_JAN_2005-TZ_ADJUST, + Date.parse( (new Date(UTC_1_JAN_2005-TZ_ADJUST)).toString() ) ) + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_20.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_20.as new file mode 100644 index 00000000000..554532c362a --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_20.as @@ -0,0 +1,93 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.20"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getMilliseconds()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + // get the current time + var now = (new Date()).valueOf(); + + // calculate time for year 0 + for ( var time = 0, year = 1969; year >= 0; year-- ) { + time -= TimeInYear(year); + } + + + // get time for 29 feb 2000 + var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour; + + // get time for 1 jan 2005 + var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+ + TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004); + + addTestCase( now ); + addTestCase( time ); + addTestCase( TIME_1970 ); + addTestCase( TIME_1900 ); + addTestCase( TIME_2000 ); + addTestCase( UTC_FEB_29_2000 ); + addTestCase( UTC_JAN_1_2005 ); + + array[item++] = new TestCase( SECTION, + "(new Date(NaN)).getMilliseconds()", + NaN, + (new Date(NaN)).getMilliseconds() ); + + array[item++] = new TestCase( SECTION, + "Date.prototype.getMilliseconds.length", + 0, + Date.prototype.getMilliseconds.length ); + + + function addTestCase( t ) { + for ( m = 0; m <= 1000; m+=100 ) { + t++; + array[item++] = new TestCase( SECTION, + "(new Date(Milliseconds"+m+")).getMilliseconds()", + true, msFromTime(LocalTime(t)) == + (new Date(t)).getMilliseconds() ); + } + } + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_21_1.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_21_1.as new file mode 100644 index 00000000000..dc087df7abe --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_21_1.as @@ -0,0 +1,103 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.21"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getUTCMilliseconds()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + // get the current time + var now = (new Date()).valueOf(); + + // calculate time for year 0 + for ( var time = 0, year = 1969; year >= 0; year-- ) { + time -= TimeInYear(year); + } + // get time for 29 feb 2000 + + var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour; + + // get time for 1 jan 2005 + + var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+ + TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004); + + addTestCase2( now ); + + addTestCase( time ); + + addTestCase( TIME_1970 ); + addTestCase( TIME_1900 ); + addTestCase( TIME_2000 ); + addTestCase( UTC_FEB_29_2000 ); + addTestCase( UTC_JAN_1_2005 ); + + array[item++] = new TestCase( SECTION, + "(new Date(NaN)).getUTCMilliseconds()", + NaN, + (new Date(NaN)).getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, + "Date.prototype.getUTCMilliseconds.length", + 0, + Date.prototype.getUTCMilliseconds.length ); + + + + function addTestCase( t ) { + array[item++] = new TestCase( SECTION, + "(new Date("+t+")).getUTCMilliseconds()", + true, msFromTime(t) == + (new Date(t)).getUTCMilliseconds() ); + } + + + // used only for current date and time + function addTestCase2( t ) { + array[item++] = new TestCase( SECTION, + "(new Date(current)).getUTCMilliseconds()", + true, msFromTime(t) == + (new Date(t)).getUTCMilliseconds() ); + } + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_21_2.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_21_2.as new file mode 100644 index 00000000000..3064c32d196 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_21_2.as @@ -0,0 +1,90 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.21"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getUTCMilliseconds()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + // get the current time + var now = (new Date()).valueOf(); + + // calculate time for year 0 + for ( var time = 0, year = 1969; year >= 0; year-- ) { + time -= TimeInYear(year); + } + // get time for 29 feb 2000 + + var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour; + + // get time for 1 jan 2005 + + var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+ + TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004); + + addTestCase( time ); +/* + addTestCase( TIME_1970 ); + addTestCase( TIME_1900 ); + addTestCase( TIME_2000 ); + addTestCase( UTC_FEB_29_2000 ); + addTestCase( UTC_JAN_1_2005 ); + + array[item++] = new TestCase( SECTION, + "(new Date(NaN)).getUTCMilliseconds()", + NaN, + (new Date(NaN)).getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, + "Date.prototype.getUTCMilliseconds.length", + 0, + Date.prototype.getUTCMilliseconds.length ); +*/ + + function addTestCase( t ) { + array[item++] = new TestCase( SECTION, + "(new Date("+t+")).getUTCMilliseconds()", + msFromTime(t), + (new Date(t)).getUTCMilliseconds() ); + } + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_21_3.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_21_3.as new file mode 100644 index 00000000000..755e92b0ff8 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_21_3.as @@ -0,0 +1,73 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.21"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getUTCMilliseconds()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + // get the current time + var now = (new Date()).valueOf(); + + // calculate time for year 0 + for ( var time = 0, year = 1969; year >= 0; year-- ) { + time -= TimeInYear(year); + } + // get time for 29 feb 2000 + + var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour; + + // get time for 1 jan 2005 + + var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+ + TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004); + + addTestCase( TIME_1970 ); + + function addTestCase( t ) { + array[item++] = new TestCase( SECTION, + "(new Date("+t+")).getUTCMilliseconds()", + msFromTime(t), + (new Date(t)).getUTCMilliseconds() ); + } + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_21_4.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_21_4.as new file mode 100644 index 00000000000..dabc8fe4144 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_21_4.as @@ -0,0 +1,73 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.21"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getUTCMilliseconds()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + // get the current time + var now = (new Date()).valueOf(); + + // calculate time for year 0 + for ( var time = 0, year = 1969; year >= 0; year-- ) { + time -= TimeInYear(year); + } + // get time for 29 feb 2000 + + var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour; + + // get time for 1 jan 2005 + + var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+ + TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004); + + addTestCase( TIME_1900 ); + + function addTestCase( t ) { + array[item++] = new TestCase( SECTION, + "(new Date("+t+")).getUTCMilliseconds()", + msFromTime(t), + (new Date(t)).getUTCMilliseconds() ); + } + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_21_5.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_21_5.as new file mode 100644 index 00000000000..187932dbfbf --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_21_5.as @@ -0,0 +1,73 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.21"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getUTCMilliseconds()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + // get the current time + var now = (new Date()).valueOf(); + + // calculate time for year 0 + for ( var time = 0, year = 1969; year >= 0; year-- ) { + time -= TimeInYear(year); + } + // get time for 29 feb 2000 + + var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour; + + // get time for 1 jan 2005 + + var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+ + TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004); + + addTestCase( TIME_2000 ); + + function addTestCase( t ) { + array[item++] = new TestCase( SECTION, + "(new Date("+t+")).getUTCMilliseconds()", + msFromTime(t), + (new Date(t)).getUTCMilliseconds() ); + } + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_21_6.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_21_6.as new file mode 100644 index 00000000000..6cdf2312242 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_21_6.as @@ -0,0 +1,73 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.21"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getUTCMilliseconds()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + // get the current time + var now = (new Date()).valueOf(); + + // calculate time for year 0 + for ( var time = 0, year = 1969; year >= 0; year-- ) { + time -= TimeInYear(year); + } + // get time for 29 feb 2000 + + var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour; + + // get time for 1 jan 2005 + + var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+ + TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004); + + addTestCase( UTC_FEB_29_2000 ); + + function addTestCase( t ) { + array[item++] = new TestCase( SECTION, + "(new Date("+t+")).getUTCMilliseconds()", + msFromTime(t), + (new Date(t)).getUTCMilliseconds() ); + } + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_21_7.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_21_7.as new file mode 100644 index 00000000000..3ebc3edae41 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_21_7.as @@ -0,0 +1,73 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.21"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getUTCMilliseconds()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + // get the current time + var now = (new Date()).valueOf(); + + // calculate time for year 0 + for ( var time = 0, year = 1969; year >= 0; year-- ) { + time -= TimeInYear(year); + } + // get time for 29 feb 2000 + + var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour; + + // get time for 1 jan 2005 + + var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+ + TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004); + + addTestCase( UTC_JAN_1_2005 ); + + function addTestCase( t ) { + array[item++] = new TestCase( SECTION, + "(new Date("+t+")).getUTCMilliseconds()", + msFromTime(t), + (new Date(t)).getUTCMilliseconds() ); + } + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_21_8.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_21_8.as new file mode 100644 index 00000000000..a27b4219421 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_21_8.as @@ -0,0 +1,76 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.21"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getUTCMilliseconds()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + // get the current time + var now = (new Date()).valueOf(); + + // calculate time for year 0 + for ( var time = 0, year = 1969; year >= 0; year-- ) { + time -= TimeInYear(year); + } + // get time for 29 feb 2000 + + var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour; + + // get time for 1 jan 2005 + + var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+ + TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004); + + array[item++] = new TestCase( SECTION, + "(new Date(NaN)).getUTCMilliseconds()", + NaN, + (new Date(NaN)).getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, + "Date.prototype.getUTCMilliseconds.length", + 0, + Date.prototype.getUTCMilliseconds.length ); + + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_22_1.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_22_1.as new file mode 100644 index 00000000000..95a01d3f415 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_22_1.as @@ -0,0 +1,94 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.22"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getTimezoneOffset()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + // get the current time + var now = (new Date()).valueOf(); + + // calculate time for year 0 + for ( var time = 0, year = 1969; year >= 0; year-- ) { + time -= TimeInYear(year); + } + // get time for 29 feb 2000 + + var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour; + + // get time for 1 jan 2005 + + var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+ + TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004); + +// addTestCase( now ); + + addTestCase( time ); + addTestCase( TIME_1970 ); + addTestCase( TIME_1900 ); + addTestCase( TIME_2000 ); + addTestCase( UTC_FEB_29_2000 ); + addTestCase( UTC_JAN_1_2005 ); + + array[item++] = new TestCase( SECTION, + "(new Date(NaN)).getTimezoneOffset()", + NaN, + (new Date(NaN)).getTimezoneOffset() ); + + array[item++] = new TestCase( SECTION, + "Date.prototype.getTimezoneOffset.length", + 0, + Date.prototype.getTimezoneOffset.length ); + + + function addTestCase( t ) { + for ( m = 0; m <= 1000; m+=100 ) { + t++; + array[item++] = new TestCase( SECTION, + "(new Date("+t+")).getTimezoneOffset()", + (t - LocalTime(t)) / msPerMinute, + (new Date(t)).getTimezoneOffset() ); + } + } + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_22_2.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_22_2.as new file mode 100644 index 00000000000..a4899bedf05 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_22_2.as @@ -0,0 +1,93 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.22"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getTimezoneOffset()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + // get the current time + var now = (new Date()).valueOf(); + + // calculate time for year 0 + for ( var time = 0, year = 1969; year >= 0; year-- ) { + time -= TimeInYear(year); + } + // get time for 29 feb 2000 + + var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour; + + // get time for 1 jan 2005 + + var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+ + TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004); + + addTestCase( time ); +/* + addTestCase( TIME_1970 ); + addTestCase( TIME_1900 ); + addTestCase( TIME_2000 ); + addTestCase( UTC_FEB_29_2000 ); + addTestCase( UTC_JAN_1_2005 ); + + array[item++] = new TestCase( SECTION, + "(new Date(NaN)).getTimezoneOffset()", + NaN, + (new Date(NaN)).getTimezoneOffset() ); + + array[item++] = new TestCase( SECTION, + "Date.prototype.getTimezoneOffset.length", + 0, + Date.prototype.getTimezoneOffset.length ); +*/ + + function addTestCase( t ) { + for ( m = 0; m <= 1000; m+=100 ) { + t++; + array[item++] = new TestCase( SECTION, + "(new Date("+t+")).getTimezoneOffset()", + (t - LocalTime(t)) / msPerMinute, + (new Date(t)).getTimezoneOffset() ); + } + } + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_22_3.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_22_3.as new file mode 100644 index 00000000000..4ec8fbf88ce --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_22_3.as @@ -0,0 +1,92 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.22"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getTimezoneOffset()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + // get the current time + var now = (new Date()).valueOf(); + + // calculate time for year 0 + for ( var time = 0, year = 1969; year >= 0; year-- ) { + time -= TimeInYear(year); + } + // get time for 29 feb 2000 + + var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour; + + // get time for 1 jan 2005 + + var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+ + TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004); + + addTestCase( TIME_1970 ); +/* + addTestCase( TIME_1900 ); + addTestCase( TIME_2000 ); + addTestCase( UTC_FEB_29_2000 ); + addTestCase( UTC_JAN_1_2005 ); + + array[item++] = new TestCase( SECTION, + "(new Date(NaN)).getTimezoneOffset()", + NaN, + (new Date(NaN)).getTimezoneOffset() ); + + array[item++] = new TestCase( SECTION, + "Date.prototype.getTimezoneOffset.length", + 0, + Date.prototype.getTimezoneOffset.length ); +*/ + + function addTestCase( t ) { + for ( m = 0; m <= 1000; m+=100 ) { + t++; + array[item++] = new TestCase( SECTION, + "(new Date("+t+")).getTimezoneOffset()", + (t - LocalTime(t)) / msPerMinute, + (new Date(t)).getTimezoneOffset() ); + } + } + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_22_4.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_22_4.as new file mode 100644 index 00000000000..0a9a24a17c4 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_22_4.as @@ -0,0 +1,91 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.22"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getTimezoneOffset()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + // get the current time + var now = (new Date()).valueOf(); + + // calculate time for year 0 + for ( var time = 0, year = 1969; year >= 0; year-- ) { + time -= TimeInYear(year); + } + // get time for 29 feb 2000 + + var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour; + + // get time for 1 jan 2005 + + var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+ + TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004); + + addTestCase( TIME_1900 ); +/* + addTestCase( TIME_2000 ); + addTestCase( UTC_FEB_29_2000 ); + addTestCase( UTC_JAN_1_2005 ); + + array[item++] = new TestCase( SECTION, + "(new Date(NaN)).getTimezoneOffset()", + NaN, + (new Date(NaN)).getTimezoneOffset() ); + + array[item++] = new TestCase( SECTION, + "Date.prototype.getTimezoneOffset.length", + 0, + Date.prototype.getTimezoneOffset.length ); +*/ + + function addTestCase( t ) { + for ( m = 0; m <= 1000; m+=100 ) { + t++; + array[item++] = new TestCase( SECTION, + "(new Date("+t+")).getTimezoneOffset()", + (t - LocalTime(t)) / msPerMinute, + (new Date(t)).getTimezoneOffset() ); + } + } + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_22_5.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_22_5.as new file mode 100644 index 00000000000..aefe74fe218 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_22_5.as @@ -0,0 +1,90 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.22"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getTimezoneOffset()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + // get the current time + var now = (new Date()).valueOf(); + + // calculate time for year 0 + for ( var time = 0, year = 1969; year >= 0; year-- ) { + time -= TimeInYear(year); + } + // get time for 29 feb 2000 + + var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour; + + // get time for 1 jan 2005 + + var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+ + TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004); + + addTestCase( TIME_2000 ); +/* + addTestCase( UTC_FEB_29_2000 ); + addTestCase( UTC_JAN_1_2005 ); + + array[item++] = new TestCase( SECTION, + "(new Date(NaN)).getTimezoneOffset()", + NaN, + (new Date(NaN)).getTimezoneOffset() ); + + array[item++] = new TestCase( SECTION, + "Date.prototype.getTimezoneOffset.length", + 0, + Date.prototype.getTimezoneOffset.length ); +*/ + + function addTestCase( t ) { + for ( m = 0; m <= 1000; m+=100 ) { + t++; + array[item++] = new TestCase( SECTION, + "(new Date("+t+")).getTimezoneOffset()", + (t - LocalTime(t)) / msPerMinute, + (new Date(t)).getTimezoneOffset() ); + } + } + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_22_6.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_22_6.as new file mode 100644 index 00000000000..2b2be210ed4 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_22_6.as @@ -0,0 +1,89 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.22"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getTimezoneOffset()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + // get the current time + var now = (new Date()).valueOf(); + + // calculate time for year 0 + for ( var time = 0, year = 1969; year >= 0; year-- ) { + time -= TimeInYear(year); + } + // get time for 29 feb 2000 + + var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour; + + // get time for 1 jan 2005 + + var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+ + TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004); + + addTestCase( UTC_FEB_29_2000 ); +/* + addTestCase( UTC_JAN_1_2005 ); + + array[item++] = new TestCase( SECTION, + "(new Date(NaN)).getTimezoneOffset()", + NaN, + (new Date(NaN)).getTimezoneOffset() ); + + array[item++] = new TestCase( SECTION, + "Date.prototype.getTimezoneOffset.length", + 0, + Date.prototype.getTimezoneOffset.length ); +*/ + + function addTestCase( t ) { + for ( m = 0; m <= 1000; m+=100 ) { + t++; + array[item++] = new TestCase( SECTION, + "(new Date("+t+")).getTimezoneOffset()", + (t - LocalTime(t)) / msPerMinute, + (new Date(t)).getTimezoneOffset() ); + } + } + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_22_7.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_22_7.as new file mode 100644 index 00000000000..46b5b315228 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_22_7.as @@ -0,0 +1,87 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.22"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getTimezoneOffset()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + // get the current time + var now = (new Date()).valueOf(); + + // calculate time for year 0 + for ( var time = 0, year = 1969; year >= 0; year-- ) { + time -= TimeInYear(year); + } + // get time for 29 feb 2000 + + var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour; + + // get time for 1 jan 2005 + + var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+ + TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004); + + addTestCase( UTC_JAN_1_2005 ); +/* + array[item++] = new TestCase( SECTION, + "(new Date(NaN)).getTimezoneOffset()", + NaN, + (new Date(NaN)).getTimezoneOffset() ); + + array[item++] = new TestCase( SECTION, + "Date.prototype.getTimezoneOffset.length", + 0, + Date.prototype.getTimezoneOffset.length ); +*/ + + function addTestCase( t ) { + for ( m = 0; m <= 1000; m+=100 ) { + t++; + array[item++] = new TestCase( SECTION, + "(new Date("+t+")).getTimezoneOffset()", + (t - LocalTime(t)) / msPerMinute, + (new Date(t)).getTimezoneOffset() ); + } + } + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_22_8.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_22_8.as new file mode 100644 index 00000000000..03c29617978 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_22_8.as @@ -0,0 +1,75 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.22"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getTimezoneOffset()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + // get the current time + var now = (new Date()).valueOf(); + + // calculate time for year 0 + for ( var time = 0, year = 1969; year >= 0; year-- ) { + time -= TimeInYear(year); + } + // get time for 29 feb 2000 + + var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour; + + // get time for 1 jan 2005 + + var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+ + TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004); + + array[item++] = new TestCase( SECTION, + "(new Date(NaN)).getTimezoneOffset()", + NaN, + (new Date(NaN)).getTimezoneOffset() ); + + array[item++] = new TestCase( SECTION, + "Date.prototype.getTimezoneOffset.length", + 0, + Date.prototype.getTimezoneOffset.length ); + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_1.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_1.as new file mode 100644 index 00000000000..80c3689b1c1 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_1.as @@ -0,0 +1,130 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.9.5.23-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.setTime()"; + + + var testcases = getTestCases(); + writeHeaderToLog( SECTION + " Date.prototype.setTime(time)"); + + test(); + +function getTestCases() { + var now = "now"; + return addTestCase( 0, 0 ); +} + +function addTestCase( startTime, setTime ) { + var array = new Array(); + var item = 0; + + if ( startTime == "now" ) { + DateCase = new Date(); + } else { + DateCase = new Date( startTime ); + } + + DateCase.setTime( setTime ); + var DateString = "var d = new Date("+startTime+"); d.setTime("+setTime+"); d" ; + var UTCDate = UTCDateFromTime ( Number(setTime) ); + var LocalDate = LocalDateFromTime( Number(setTime) ); + +// fixed_year = ( ExpectDate.year >=1900 || ExpectDate.year < 2000 ) ? ExpectDate.year - 1900 : ExpectDate.year; + + array[item++] = new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); + array[item++] = new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); + + array[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes, DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds, DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); + array[item++] = new TestCase( SECTION, DateString+".getDay()", LocalDate.day, DateCase.getDay() ); + array[item++] = new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); + array[item++] = new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); + var thisError = 'no error'; + try{ + DateCase.toString = Object.prototype.toString; + } catch (e) { + thisError = e.toString(); +} finally { + array[item++] =new TestCase(SECTION,"DateCase.toString = Object.prototype.toString","no error",referenceError( thisError ) ); + + return array; +} + + + + + + +} +function MyDate() { + this.year = 0; + this.month = 0; + this.date = 0; + this.hours = 0; + this.minutes = 0; + this.seconds = 0; + this.ms = 0; +} +function LocalDateFromTime(t) { + t = LocalTime(t); + return ( MyDateFromTime(t) ); +} +function UTCDateFromTime(t) { + return ( MyDateFromTime(t) ); +} +function MyDateFromTime( t ) { + var d = new MyDate(); + d.year = YearFromTime(t); + d.month = MonthFromTime(t); + d.date = DateFromTime(t); + d.hours = HourFromTime(t); + d.minutes = MinFromTime(t); + d.seconds = SecFromTime(t); + d.ms = msFromTime(t); + d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); + d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); + d.day = WeekDay( d.value ); + return (d); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_10.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_10.as new file mode 100644 index 00000000000..25d0d1183cf --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_10.as @@ -0,0 +1,121 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.9.5.23-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.setTime()"; + + + var testcases = getTestCases(); + writeHeaderToLog( SECTION + " Date.prototype.setTime(time)"); + test(); + +function getTestCases() { + var now = "now"; + return addTestCase( now, -2208988800000 ); +} + +function addTestCase( startTime, setTime ) { + var array = new Array(); + var item = 0; + if ( startTime == "now" ) { + DateCase = new Date(); + } else { + DateCase = new Date( startTime ); + } + + DateCase.setTime( setTime ); + var DateString = "var d = new Date("+startTime+"); d.setTime("+setTime+"); d" ; + var UTCDate = UTCDateFromTime ( Number(setTime) ); + var LocalDate = LocalDateFromTime( Number(setTime) ); + var item = testcases.length; + +// fixed_year = ( ExpectDate.year >=1900 || ExpectDate.year < 2000 ) ? ExpectDate.year - 1900 : ExpectDate.year; + + array[item++] = new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); + array[item++] = new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); + + array[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes, DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds, DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); + array[item++] = new TestCase( SECTION, DateString+".getDay()", LocalDate.day, DateCase.getDay() ); + array[item++] = new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); + array[item++] = new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); + + + DateCase.toString = Object.prototype.toString; + array[item++] =new TestCase(SECTION,"DateCase.toString = Object.prototype.toString; DateCase.toString()","[object Date]", DateCase.toString() ); + return array; +} + + + +function MyDate() { + this.year = 0; + this.month = 0; + this.date = 0; + this.hours = 0; + this.minutes = 0; + this.seconds = 0; + this.ms = 0; +} +function LocalDateFromTime(t) { + t = LocalTime(t); + return ( MyDateFromTime(t) ); +} +function UTCDateFromTime(t) { + return ( MyDateFromTime(t) ); +} +function MyDateFromTime( t ) { + var d = new MyDate(); + d.year = YearFromTime(t); + d.month = MonthFromTime(t); + d.date = DateFromTime(t); + d.hours = HourFromTime(t); + d.minutes = MinFromTime(t); + d.seconds = SecFromTime(t); + d.ms = msFromTime(t); + d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); + d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); + d.day = WeekDay( d.value ); + return (d); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_11.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_11.as new file mode 100644 index 00000000000..1f30f869938 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_11.as @@ -0,0 +1,121 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.9.5.23-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.setTime()"; + + writeHeaderToLog( SECTION + " Date.prototype.setTime(time)"); + + var testcases = getTestCases(); + + test(); + +function getTestCases() { + var now = "now"; + return addTestCase( now, -86400000 ); +} + +function addTestCase( startTime, setTime ) { + var array = new Array(); + var item = 0; + + if ( startTime == "now" ) { + DateCase = new Date(); + } else { + DateCase = new Date( startTime ); + } + + DateCase.setTime( setTime ); + var DateString = "var d = new Date("+startTime+"); d.setTime("+setTime+"); d" ; + var UTCDate = UTCDateFromTime ( Number(setTime) ); + var LocalDate = LocalDateFromTime( Number(setTime) ); + +// fixed_year = ( ExpectDate.year >=1900 || ExpectDate.year < 2000 ) ? ExpectDate.year - 1900 : ExpectDate.year; + + array[item++] = new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); + array[item++] = new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); + + array[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes, DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds, DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); + array[item++] = new TestCase( SECTION, DateString+".getDay()", LocalDate.day, DateCase.getDay() ); + array[item++] = new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); + array[item++] = new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); + + + DateCase.toString = Object.prototype.toString; + array[item++] =new TestCase(SECTION,"DateCase.toString = Object.prototype.toString; DateCase.toString()","[object Date]", DateCase.toString() ); + return array; +} + +function MyDate() { + this.year = 0; + this.month = 0; + this.date = 0; + this.hours = 0; + this.minutes = 0; + this.seconds = 0; + this.ms = 0; +} +function LocalDateFromTime(t) { + t = LocalTime(t); + return ( MyDateFromTime(t) ); +} +function UTCDateFromTime(t) { + return ( MyDateFromTime(t) ); +} +function MyDateFromTime( t ) { + var d = new MyDate(); + d.year = YearFromTime(t); + d.month = MonthFromTime(t); + d.date = DateFromTime(t); + d.hours = HourFromTime(t); + d.minutes = MinFromTime(t); + d.seconds = SecFromTime(t); + d.ms = msFromTime(t); + d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); + d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); + d.day = WeekDay( d.value ); + return (d); +} + diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_12.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_12.as new file mode 100644 index 00000000000..7bcebcab65b --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_12.as @@ -0,0 +1,120 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.9.5.23-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.setTime()"; + + + var testcases = getTestCases(); + + writeHeaderToLog( SECTION + " Date.prototype.setTime(time)"); + test(); + +function getTestCases() { + var now = "now"; + return addTestCase( now, 946684800000 ); +} + +function addTestCase( startTime, setTime ) { + var array = new Array(); + var item = 0; + + if ( startTime == "now" ) { + DateCase = new Date(); + } else { + DateCase = new Date( startTime ); + } + + DateCase.setTime( setTime ); + var DateString = "var d = new Date("+startTime+"); d.setTime("+setTime+"); d" ; + var UTCDate = UTCDateFromTime ( Number(setTime) ); + var LocalDate = LocalDateFromTime( Number(setTime) ); + var item = testcases.length; + +// fixed_year = ( ExpectDate.year >=1900 || ExpectDate.year < 2000 ) ? ExpectDate.year - 1900 : ExpectDate.year; + + array[item++] = new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); + array[item++] = new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); + + array[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes, DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds, DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); + array[item++] = new TestCase( SECTION, DateString+".getDay()", LocalDate.day, DateCase.getDay() ); + array[item++] = new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); + array[item++] = new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); + + DateCase.toString = Object.prototype.toString; + array[item++] =new TestCase(SECTION,"DateCase.toString = Object.prototype.toString; DateCase.toString()","[object Date]", DateCase.toString() ); + + return array; +} +function MyDate() { + this.year = 0; + this.month = 0; + this.date = 0; + this.hours = 0; + this.minutes = 0; + this.seconds = 0; + this.ms = 0; +} +function LocalDateFromTime(t) { + t = LocalTime(t); + return ( MyDateFromTime(t) ); +} +function UTCDateFromTime(t) { + return ( MyDateFromTime(t) ); +} +function MyDateFromTime( t ) { + var d = new MyDate(); + d.year = YearFromTime(t); + d.month = MonthFromTime(t); + d.date = DateFromTime(t); + d.hours = HourFromTime(t); + d.minutes = MinFromTime(t); + d.seconds = SecFromTime(t); + d.ms = msFromTime(t); + d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); + d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); + d.day = WeekDay( d.value ); + return (d); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_13.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_13.as new file mode 100644 index 00000000000..b5f3d82d5c3 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_13.as @@ -0,0 +1,119 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.9.5.23-13"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.setTime()"; + + + writeHeaderToLog( SECTION + " Date.prototype.setTime(time)"); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var now = "now"; + return addTestCase( now, -2208988800000 ); + +} + +function addTestCase( startTime, setTime ) { + var array = new Array(); + var item = 0; + if ( startTime == "now" ) { + DateCase = new Date(); + } else { + DateCase = new Date( startTime ); + } + + DateCase.setTime( setTime ); + var DateString = "var d = new Date("+startTime+"); d.setTime("+setTime+"); d" ; + var UTCDate = UTCDateFromTime ( Number(setTime) ); + var LocalDate = LocalDateFromTime( Number(setTime) ); + +// fixed_year = ( ExpectDate.year >=1900 || ExpectDate.year < 2000 ) ? ExpectDate.year - 1900 : ExpectDate.year; + + array[item++] = new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); + array[item++] = new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); + + array[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes, DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds, DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); + array[item++] = new TestCase( SECTION, DateString+".getDay()", LocalDate.day, DateCase.getDay() ); + array[item++] = new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); + array[item++] = new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); + + DateCase.toString = Object.prototype.toString; + array[item++] =new TestCase(SECTION,"DateCase.toString = Object.prototype.toString; DateCase.toString()","[object Date]", DateCase.toString() ); + + return array; +} +function MyDate() { + this.year = 0; + this.month = 0; + this.date = 0; + this.hours = 0; + this.minutes = 0; + this.seconds = 0; + this.ms = 0; +} +function LocalDateFromTime(t) { + t = LocalTime(t); + return ( MyDateFromTime(t) ); +} +function UTCDateFromTime(t) { + return ( MyDateFromTime(t) ); +} +function MyDateFromTime( t ) { + var d = new MyDate(); + d.year = YearFromTime(t); + d.month = MonthFromTime(t); + d.date = DateFromTime(t); + d.hours = HourFromTime(t); + d.minutes = MinFromTime(t); + d.seconds = SecFromTime(t); + d.ms = msFromTime(t); + d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); + d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); + d.day = WeekDay( d.value ); + return (d); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_14.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_14.as new file mode 100644 index 00000000000..354eb64a617 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_14.as @@ -0,0 +1,120 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.9.5.23-14"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.setTime()"; + + + writeHeaderToLog( SECTION + " Date.prototype.setTime(time)"); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var now = "now"; + return addTestCase( now, 946684800000 ); +} + +function addTestCase( startTime, setTime ) { + var array = new Array(); + var item = 0; + + if ( startTime == "now" ) { + DateCase = new Date(); + } else { + DateCase = new Date( startTime ); + } + + DateCase.setTime( setTime ); + var DateString = "var d = new Date("+startTime+"); d.setTime("+setTime+"); d" ; + var UTCDate = UTCDateFromTime ( Number(setTime) ); + var LocalDate = LocalDateFromTime( Number(setTime) ); + +// fixed_year = ( ExpectDate.year >=1900 || ExpectDate.year < 2000 ) ? ExpectDate.year - 1900 : ExpectDate.year; + + array[item++] = new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); + array[item++] = new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); + + array[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes, DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds, DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); + array[item++] = new TestCase( SECTION, DateString+".getDay()", LocalDate.day, DateCase.getDay() ); + array[item++] = new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); + array[item++] = new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); + + DateCase.toString = Object.prototype.toString; + array[item++] =new TestCase(SECTION,"DateCase.toString = Object.prototype.toString; DateCase.toString()","[object Date]", DateCase.toString() ); + + return array; +} +function MyDate() { + this.year = 0; + this.month = 0; + this.date = 0; + this.hours = 0; + this.minutes = 0; + this.seconds = 0; + this.ms = 0; +} +function LocalDateFromTime(t) { + t = LocalTime(t); + return ( MyDateFromTime(t) ); +} +function UTCDateFromTime(t) { + return ( MyDateFromTime(t) ); +} +function MyDateFromTime( t ) { + var d = new MyDate(); + d.year = YearFromTime(t); + d.month = MonthFromTime(t); + d.date = DateFromTime(t); + d.hours = HourFromTime(t); + d.minutes = MinFromTime(t); + d.seconds = SecFromTime(t); + d.ms = msFromTime(t); + d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); + d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); + d.day = WeekDay( d.value ); + return (d); +} + diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_15.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_15.as new file mode 100644 index 00000000000..df6e9376cbf --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_15.as @@ -0,0 +1,116 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.9.5.23-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.setTime()"; + + writeHeaderToLog( SECTION + " Date.prototype.setTime(time)"); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var now = "now"; + return addTestCase( now, 0 ); +} + +function addTestCase( startTime, setTime ) { + var array = new Array(); + var item = 0; + if ( startTime == "now" ) { + DateCase = new Date(); + } else { + DateCase = new Date( startTime ); + } + + DateCase.setTime( setTime ); + var DateString = "var d = new Date("+startTime+"); d.setTime("+setTime+"); d" ; + var UTCDate = UTCDateFromTime ( Number(setTime) ); + var LocalDate = LocalDateFromTime( Number(setTime) ); + +// fixed_year = ( ExpectDate.year >=1900 || ExpectDate.year < 2000 ) ? ExpectDate.year - 1900 : ExpectDate.year; + + array[item++] = new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); + array[item++] = new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); + + array[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes, DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds, DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); + array[item++] = new TestCase( SECTION, DateString+".getDay()", LocalDate.day, DateCase.getDay() ); + array[item++] = new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); + array[item++] = new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); + + DateCase.toString = Object.prototype.toString; + array[item++] =new TestCase(SECTION,"DateCase.toString = Object.prototype.toString; DateCase.toString()","[object Date]", DateCase.toString() ); + return array; +} +function MyDate() { + this.year = 0; + this.month = 0; + this.date = 0; + this.hours = 0; + this.minutes = 0; + this.seconds = 0; + this.ms = 0; +} +function LocalDateFromTime(t) { + t = LocalTime(t); + return ( MyDateFromTime(t) ); +} +function UTCDateFromTime(t) { + return ( MyDateFromTime(t) ); +} +function MyDateFromTime( t ) { + var d = new MyDate(); + d.year = YearFromTime(t); + d.month = MonthFromTime(t); + d.date = DateFromTime(t); + d.hours = HourFromTime(t); + d.minutes = MinFromTime(t); + d.seconds = SecFromTime(t); + d.ms = msFromTime(t); + d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); + d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); + d.day = WeekDay( d.value ); + return (d); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_16.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_16.as new file mode 100644 index 00000000000..e877ab6e8dc --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_16.as @@ -0,0 +1,119 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.9.5.23-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.setTime()"; + + writeHeaderToLog( SECTION + " Date.prototype.setTime(time)"); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var now = "now"; + return addTestCase( now, String( TIME_1900 ) ); +} + +function addTestCase( startTime, setTime ) { + var array = new Array(); + var item = 0; + + if ( startTime == "now" ) { + DateCase = new Date(); + } else { + DateCase = new Date( startTime ); + } + + DateCase.setTime( setTime ); + var DateString = "var d = new Date("+startTime+"); d.setTime("+setTime+"); d" ; + var UTCDate = UTCDateFromTime ( Number(setTime) ); + var LocalDate = LocalDateFromTime( Number(setTime) ); + +// fixed_year = ( ExpectDate.year >=1900 || ExpectDate.year < 2000 ) ? ExpectDate.year - 1900 : ExpectDate.year; + + array[item++] = new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); + array[item++] = new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); + + array[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes, DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds, DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); + array[item++] = new TestCase( SECTION, DateString+".getDay()", LocalDate.day, DateCase.getDay() ); + array[item++] = new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); + array[item++] = new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); + + DateCase.toString = Object.prototype.toString; + array[item++] =new TestCase(SECTION,"DateCase.toString = Object.prototype.toString; DateCase.toString()","[object Date]", DateCase.toString() ); + + return array; +} +function MyDate() { + this.year = 0; + this.month = 0; + this.date = 0; + this.hours = 0; + this.minutes = 0; + this.seconds = 0; + this.ms = 0; +} +function LocalDateFromTime(t) { + t = LocalTime(t); + return ( MyDateFromTime(t) ); +} +function UTCDateFromTime(t) { + return ( MyDateFromTime(t) ); +} +function MyDateFromTime( t ) { + var d = new MyDate(); + d.year = YearFromTime(t); + d.month = MonthFromTime(t); + d.date = DateFromTime(t); + d.hours = HourFromTime(t); + d.minutes = MinFromTime(t); + d.seconds = SecFromTime(t); + d.ms = msFromTime(t); + d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); + d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); + d.day = WeekDay( d.value ); + return (d); +} + diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_17.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_17.as new file mode 100644 index 00000000000..42ca71a6fd0 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_17.as @@ -0,0 +1,119 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.9.5.23-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.setTime()"; + + writeHeaderToLog( SECTION + " Date.prototype.setTime(time)"); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var now = "now"; + return addTestCase( now, String( TZ_DIFF* msPerHour ) ); + +} + +function addTestCase( startTime, setTime ) { + var array = new Array(); + var item = 0; + + if ( startTime == "now" ) { + DateCase = new Date(); + } else { + DateCase = new Date( startTime ); + } + + DateCase.setTime( setTime ); + var DateString = "var d = new Date("+startTime+"); d.setTime("+setTime+"); d" ; + var UTCDate = UTCDateFromTime ( Number(setTime) ); + var LocalDate = LocalDateFromTime( Number(setTime) ); + +// fixed_year = ( ExpectDate.year >=1900 || ExpectDate.year < 2000 ) ? ExpectDate.year - 1900 : ExpectDate.year; + + array[item++] = new TestCase( SECTION, "DateString+.getTime()", UTCDate.value, DateCase.getTime() ); + array[item++] = new TestCase( SECTION, "DateString+.valueOf()", UTCDate.value, DateCase.valueOf() ); + + array[item++] = new TestCase( SECTION, "DateString+.getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCMinutes()", UTCDate.minutes, DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCSeconds()", UTCDate.seconds, DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, "DateString+.getFullYear()", LocalDate.year, DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, "DateString+.getMonth()", LocalDate.month, DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, "DateString+.getDate()", LocalDate.date, DateCase.getDate() ); + array[item++] = new TestCase( SECTION, "DateString+.getDay()", LocalDate.day, DateCase.getDay() ); + array[item++] = new TestCase( SECTION, "DateString+.getHours()", LocalDate.hours, DateCase.getHours() ); + array[item++] = new TestCase( SECTION, "DateString+.getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, "DateString+.getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, "DateString+.getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); + + DateCase.toString = Object.prototype.toString; + array[item++] =new TestCase(SECTION,"DateCase.toString = Object.prototype.toString; DateCase.toString()","[object Date]", DateCase.toString() ); + return array; +} +function MyDate() { + this.year = 0; + this.month = 0; + this.date = 0; + this.hours = 0; + this.minutes = 0; + this.seconds = 0; + this.ms = 0; +} +function LocalDateFromTime(t) { + t = LocalTime(t); + return ( MyDateFromTime(t) ); +} +function UTCDateFromTime(t) { + return ( MyDateFromTime(t) ); +} +function MyDateFromTime( t ) { + var d = new MyDate(); + d.year = YearFromTime(t); + d.month = MonthFromTime(t); + d.date = DateFromTime(t); + d.hours = HourFromTime(t); + d.minutes = MinFromTime(t); + d.seconds = SecFromTime(t); + d.ms = msFromTime(t); + d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); + d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); + d.day = WeekDay( d.value ); + return (d); +} + diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_18.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_18.as new file mode 100644 index 00000000000..f3543e4bf3e --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_18.as @@ -0,0 +1,119 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.9.5.23-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.setTime()"; + + writeHeaderToLog( SECTION + " Date.prototype.setTime(time)"); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var now = "now"; + return addTestCase( now, String( TIME_2000 ) ); +} + +function addTestCase( startTime, setTime ) { + var array = new Array(); + var item = 0; + + if ( startTime == "now" ) { + DateCase = new Date(); + } else { + DateCase = new Date( startTime ); + } + + DateCase.setTime( setTime ); + var DateString = "var d = new Date("+startTime+"); d.setTime("+setTime+"); d" ; + var UTCDate = UTCDateFromTime ( Number(setTime) ); + var LocalDate = LocalDateFromTime( Number(setTime) ); + +// fixed_year = ( ExpectDate.year >=1900 || ExpectDate.year < 2000 ) ? ExpectDate.year - 1900 : ExpectDate.year; + + array[item++] = new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); + array[item++] = new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); + + array[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes, DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds, DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); + array[item++] = new TestCase( SECTION, DateString+".getDay()", LocalDate.day, DateCase.getDay() ); + array[item++] = new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); + array[item++] = new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); + + DateCase.toString = Object.prototype.toString; + array[item++] =new TestCase(SECTION,"DateCase.toString = Object.prototype.toString; DateCase.toString()","[object Date]", DateCase.toString() ); + + return array; +} +function MyDate() { + this.year = 0; + this.month = 0; + this.date = 0; + this.hours = 0; + this.minutes = 0; + this.seconds = 0; + this.ms = 0; +} +function LocalDateFromTime(t) { + t = LocalTime(t); + return ( MyDateFromTime(t) ); +} +function UTCDateFromTime(t) { + return ( MyDateFromTime(t) ); +} +function MyDateFromTime( t ) { + var d = new MyDate(); + d.year = YearFromTime(t); + d.month = MonthFromTime(t); + d.date = DateFromTime(t); + d.hours = HourFromTime(t); + d.minutes = MinFromTime(t); + d.seconds = SecFromTime(t); + d.ms = msFromTime(t); + d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); + d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); + d.day = WeekDay( d.value ); + return (d); +} + diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_2.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_2.as new file mode 100644 index 00000000000..b51aa133628 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_2.as @@ -0,0 +1,101 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.9.5.23-2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.setTime()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + // get the current time + var now = (new Date()).valueOf(); + + test_times = new Array( now, TIME_1970, TIME_1900, TIME_2000 ); + + + for ( var j = 0; j < test_times.length; j++ ) { + addTestCase( new Date(now), test_times[j] ); + } + + + array[item++] = new TestCase( SECTION, + "(new Date(NaN)).setTime()", + NaN, + (new Date(NaN)).setTime() ); + + array[item++] = new TestCase( SECTION, + "Date.prototype.setTime.length", + 1, + Date.prototype.setTime.length ); + + + function addTestCase( d, t ) { + array[item++] = new TestCase( SECTION, + "( ).setTime()", + true, t == + d.setTime(t) ); + + array[item++] = new TestCase( SECTION, + "( ).setTime()", + true, TimeClip(t+1.1) == + d.setTime(t+1.1) ); + + array[item++] = new TestCase( SECTION, + "().setTime()", + true, t+1 == + d.setTime(t+1) ); + + array[item++] = new TestCase( SECTION, + "().setTime()", + true, t-1 == + d.setTime(t-1) ); + + array[item++] = new TestCase( SECTION, + "( ).setTime()", + true, t-TZ_ADJUST == + d.setTime(t-TZ_ADJUST) ); + + array[item++] = new TestCase( SECTION, + "( ).setTime()", + true, t+TZ_ADJUST == + d.setTime(t+TZ_ADJUST) ); + } + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_3_rt.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_3_rt.as new file mode 100644 index 00000000000..162c08dd4da --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_3_rt.as @@ -0,0 +1,65 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "15.9.5.23-3-n"; +var VERSION = "ECMA_1"; +var TITLE = "Date.prototype.setTime()"; + + +startTest(); +writeHeaderToLog( SECTION + " "+ TITLE); + +var testcases = getTestCases(); +test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var MYDATE = new MyDate(TIME_1970); + thisError = "no error thrown"; + try { + MYDATE.setTime(TIME_2000); + } + catch(e){ + thisError=e.toString(); + } + finally { + array[item++] = new TestCase(SECTION, "MYDATE.setTime(TIME_2000)", "TypeError: Error #1034", typeError(thisError)); + } + return array; +} + +function MyDate(value) { + this.value = value; + this.setTime = Date.prototype.setTime; + return this; +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_4.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_4.as new file mode 100644 index 00000000000..4b4dff682c1 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_4.as @@ -0,0 +1,119 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.23-2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.setTime()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + // get the current time + var now = (new Date()).valueOf(); + + // calculate time for year 0 + for ( var time = 0, year = 1969; year >= 0; year-- ) { + time -= TimeInYear(year); + } + + + // get time for 29 feb 2000 + var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour; + + + // get time for 1 jan 2005 + var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+ + TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004); + + test_times = new Array( now, time, TIME_1970, TIME_1900, TIME_2000, + UTC_FEB_29_2000, UTC_JAN_1_2005 ); + + + for ( var j = 0; j < test_times.length; j++ ) { + addTestCase( new Date(time), test_times[j] ); + } + + + + array[item++] = new TestCase( SECTION, + "(new Date(NaN)).setTime()", + NaN, + (new Date(NaN)).setTime() ); + + array[item++] = new TestCase( SECTION, + "Date.prototype.setTime.length", + 1, + Date.prototype.setTime.length ); + + + + function addTestCase( d, t ) { + array[item++] = new TestCase( SECTION, + "( ).setTime()", + true, t == + d.setTime(t) ); + + array[item++] = new TestCase( SECTION, + "( ).setTime()", + true, TimeClip(t+1.1) == + d.setTime(t+1.1) ); + + array[item++] = new TestCase( SECTION, + "().setTime()", + true, t+1 == + d.setTime(t+1) ); + + array[item++] = new TestCase( SECTION, + "().setTime()", + true, t-1 == + d.setTime(t-1) ); + + array[item++] = new TestCase( SECTION, + "( ).setTime()", + true, t-TZ_ADJUST == + d.setTime(t-TZ_ADJUST) ); + + array[item++] = new TestCase( SECTION, + "( ).setTime()", + true, t+TZ_ADJUST == + d.setTime(t+TZ_ADJUST) ); + } + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_5.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_5.as new file mode 100644 index 00000000000..e554e374b52 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_5.as @@ -0,0 +1,118 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.23-2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.setTime()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + // get the current time + var now = (new Date()).valueOf(); + + // calculate time for year 0 + for ( var time = 0, year = 1969; year >= 0; year-- ) { + time -= TimeInYear(year); + } + + + // get time for 29 feb 2000 + var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour; + + + // get time for 1 jan 2005 + var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+ + TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004); + + test_times = new Array( now, time, TIME_1970, TIME_1900, TIME_2000, + UTC_FEB_29_2000, UTC_JAN_1_2005 ); + + + for ( var j = 0; j < test_times.length; j++ ) { + addTestCase( new Date(TIME_1970), test_times[j] ); + } + + + array[item++] = new TestCase( SECTION, + "(new Date(NaN)).setTime()", + NaN, + (new Date(NaN)).setTime() ); + + array[item++] = new TestCase( SECTION, + "Date.prototype.setTime.length", + 1, + Date.prototype.setTime.length ); + + + + function addTestCase( d, t ) { + array[item++] = new TestCase( SECTION, + "( ).setTime()", + true, t == + d.setTime(t) ); + + array[item++] = new TestCase( SECTION, + "( ).setTime()", + true, TimeClip(t+1.1) == + d.setTime(t+1.1) ); + + array[item++] = new TestCase( SECTION, + "().setTime()", + true, t+1 == + d.setTime(t+1) ); + + array[item++] = new TestCase( SECTION, + "().setTime()", + true, t-1 == + d.setTime(t-1) ); + + array[item++] = new TestCase( SECTION, + "( ).setTime()", + true, t-TZ_ADJUST == + d.setTime(t-TZ_ADJUST) ); + + array[item++] = new TestCase( SECTION, + "( ).setTime()", + true, t+TZ_ADJUST == + d.setTime(t+TZ_ADJUST) ); + } + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_6.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_6.as new file mode 100644 index 00000000000..80034d41447 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_6.as @@ -0,0 +1,115 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.23-2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.setTime()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + // get the current time + var now = (new Date()).valueOf(); + + // calculate time for year 0 + for ( var time = 0, year = 1969; year >= 0; year-- ) { + time -= TimeInYear(year); + } + + // get time for 29 feb 2000 + var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour; + + // get time for 1 jan 2005 + var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+ + TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004); + + test_times = new Array( now, time, TIME_1970, TIME_1900, TIME_2000, + UTC_FEB_29_2000, UTC_JAN_1_2005 ); + + + for ( var j = 0; j < test_times.length; j++ ) { + addTestCase( new Date(TIME_1900), test_times[j] ); + } + + + array[item++] = new TestCase( SECTION, + "(new Date(NaN)).setTime()", + NaN, + (new Date(NaN)).setTime() ); + + array[item++] = new TestCase( SECTION, + "Date.prototype.setTime.length", + 1, + Date.prototype.setTime.length ); + + + function addTestCase( d, t ) { + array[item++] = new TestCase( SECTION, + "( ).setTime()", + true, t == + d.setTime(t) ); + + array[item++] = new TestCase( SECTION, + "( ).setTime()", + true, TimeClip(t+1.1) == + d.setTime(t+1.1) ); + + array[item++] = new TestCase( SECTION, + "().setTime()", + true, t+1 == + d.setTime(t+1) ); + + array[item++] = new TestCase( SECTION, + "().setTime()", + true, t-1 == + d.setTime(t-1) ); + + array[item++] = new TestCase( SECTION, + "( ).setTime()", + true, t-TZ_ADJUST == + d.setTime(t-TZ_ADJUST) ); + + array[item++] = new TestCase( SECTION, + "( ).setTime()", + true, t+TZ_ADJUST == + d.setTime(t+TZ_ADJUST) ); + } + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_7.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_7.as new file mode 100644 index 00000000000..0535d2fa7f9 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_7.as @@ -0,0 +1,117 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.23-2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.setTime()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + // get the current time + var now = (new Date()).valueOf(); + + // calculate time for year 0 + for ( var time = 0, year = 1969; year >= 0; year-- ) { + time -= TimeInYear(year); + } + // get time for 29 feb 2000 + + var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour; + + // get time for 1 jan 2005 + + var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+ + TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004); + + test_times = new Array( now, time, TIME_1970, TIME_1900, TIME_2000, + UTC_FEB_29_2000, UTC_JAN_1_2005 ); + + + for ( var j = 0; j < test_times.length; j++ ) { + addTestCase( new Date(TIME_2000), test_times[j] ); + } + + + array[item++] = new TestCase( SECTION, + "(new Date(NaN)).setTime()", + NaN, + (new Date(NaN)).setTime() ); + + array[item++] = new TestCase( SECTION, + "Date.prototype.setTime.length", + 1, + Date.prototype.setTime.length ); + + + + function addTestCase( d, t ) { + array[item++] = new TestCase( SECTION, + "( ).setTime()", + true, t == + d.setTime(t) ); + + array[item++] = new TestCase( SECTION, + "( ).setTime()", + true, TimeClip(t+1.1) == + d.setTime(t+1.1) ); + + array[item++] = new TestCase( SECTION, + "().setTime()", + true, t+1 == + d.setTime(t+1) ); + + array[item++] = new TestCase( SECTION, + "().setTime()", + true, t-1 == + d.setTime(t-1) ); + + array[item++] = new TestCase( SECTION, + "( ).setTime()", + true, t-TZ_ADJUST == + d.setTime(t-TZ_ADJUST) ); + + array[item++] = new TestCase( SECTION, + "( ).setTime()", + true, t+TZ_ADJUST == + d.setTime(t+TZ_ADJUST) ); + } + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_8.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_8.as new file mode 100644 index 00000000000..7492e15d59c --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_8.as @@ -0,0 +1,104 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.23-2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.setTime()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + // get the current time + var now = (new Date()).valueOf(); + + // calculate time for year 0 + for ( var time = 0, year = 1969; year >= 0; year-- ) { + time -= TimeInYear(year); + } + // get time for 29 feb 2000 + + var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour; + + // get time for 1 jan 2005 + + var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+ + TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004); + test_times = new Array( now, time, TIME_1970, TIME_1900, TIME_2000, + UTC_FEB_29_2000, UTC_JAN_1_2005 ); + + + for ( var j = 0; j < test_times.length; j++ ) { + addTestCase( new Date(UTC_FEB_29_2000), test_times[j] ); + } + + + function addTestCase( d, t ) { + array[item++] = new TestCase( SECTION, + "( ).setTime()", + true, t == + d.setTime(t) ); + + array[item++] = new TestCase( SECTION, + "( ).setTime()", + true, TimeClip(t+1.1) == + d.setTime(t+1.1) ); + + array[item++] = new TestCase( SECTION, + "().setTime()", + true, t+1 == + d.setTime(t+1) ); + + array[item++] = new TestCase( SECTION, + "().setTime()", + true, t-1 == + d.setTime(t-1) ); + + array[item++] = new TestCase( SECTION, + "( ).setTime()", + true, t-TZ_ADJUST == + d.setTime(t-TZ_ADJUST) ); + + array[item++] = new TestCase( SECTION, + "( ).setTime()", + true, t+TZ_ADJUST == + d.setTime(t+TZ_ADJUST) ); + } + return array +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_9.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_9.as new file mode 100644 index 00000000000..a276a139f35 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_23_9.as @@ -0,0 +1,107 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.23-2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.setTime()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + + // get the current time + var now = (new Date()).valueOf(); + + // calculate time for year 0 + for ( var time = 0, year = 1969; year >= 0; year-- ) { + time -= TimeInYear(year); + } + // get time for 29 feb 2000 + + var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour; + + // get time for 1 jan 2005 + + var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+ + TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004); + + test_times = new Array( now, time, TIME_1970, TIME_1900, TIME_2000, + UTC_FEB_29_2000, UTC_JAN_1_2005 ); + + + for ( var j = 0; j < test_times.length; j++ ) { + addTestCase( new Date(UTC_JAN_1_2005), test_times[j] ); + } + + + function addTestCase( d, t ) { + array[item++] = new TestCase( SECTION, + "( ).setTime()", + true, t == + d.setTime(t) ); + + array[item++] = new TestCase( SECTION, + "( ).setTime()", + true, TimeClip(t+1.1) == + d.setTime(t+1.1) ); + + array[item++] = new TestCase( SECTION, + "().setTime()", + true, t+1 == + d.setTime(t+1) ); + + array[item++] = new TestCase( SECTION, + "().setTime()", + true, t-1 == + d.setTime(t-1) ); + + array[item++] = new TestCase( SECTION, + "( ).setTime()", + true, t-TZ_ADJUST == + d.setTime(t-TZ_ADJUST) ); + + array[item++] = new TestCase( SECTION, + "( ).setTime()", + true, t+TZ_ADJUST == + d.setTime(t+TZ_ADJUST) ); + } + return array; +} + diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_24_1.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_24_1.as new file mode 100644 index 00000000000..df330f597c9 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_24_1.as @@ -0,0 +1,116 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var TITLE = "Date.prototype.setTime" + var SECTION = "15.9.5.24-1"; + var VERSION = "ECMA_1"; + startTest(); + + writeHeaderToLog( SECTION + " Date.prototype.setMilliseconds(ms)"); + + var testcases:Array = getTestCases(); + test(); + +function getTestCases() { + + return addTestCase( 0, 0 ); + +} +function addTestCase( startms, newms ) { + var array = new Array(); + var item = 0; + + var DateCase:Date = new Date( startms ); + DateCase.setMilliseconds( newms ); + var DateString:String = "var date = new Date("+ startms +"); date.setMilliseconds("+ newms +"); date"; + var UTCDate = UTCDateFromTime( Number(newms) ); + var LocalDate = LocalDateFromTime( Number(newms) ); + +// fixed_year = ( ExpectDate.year >=1900 || ExpectDate.year < 2000 ) ? ExpectDate.year - 1900 : ExpectDate.year; + + array[item++] = new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); + array[item++] = new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); + + array[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); +// array[item++] = new TestCase( SECTION, DateString+".getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes,DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds,DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); +// array[item++] = new TestCase( SECTION, DateString+".getDay()", LocalDate.day, DateCase.getDay() ); + array[item++] = new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); + array[item++] = new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); + + DateCase.toString = Object.prototype.toString; + array[item++] =new TestCase(SECTION,"DateCase.toString = Object.prototype.toString; DateCase.toString()","[object Date]", DateCase.toString() ); + + return array; +} + +function MyDate() { + this.year = 0; + this.month = 0; + this.date = 0; + this.hours = 0; + this.minutes = 0; + this.seconds = 0; + this.ms = 0; +} +function LocalDateFromTime(t) { + t = LocalTime(t); + return ( MyDateFromTime(t) ); +} +function UTCDateFromTime(t) { + return ( MyDateFromTime(t) ); +} +function MyDateFromTime( t ) { + var d = new MyDate(); + d.year = YearFromTime(t); + d.month = MonthFromTime(t); + d.date = DateFromTime(t); + d.hours = HourFromTime(t); + d.minutes = MinFromTime(t); + d.seconds = SecFromTime(t); + d.ms = msFromTime(t); + + d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); + d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); + d.day = WeekDay( d.value ); + + return (d); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_24_2.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_24_2.as new file mode 100644 index 00000000000..6e9fbfd2564 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_24_2.as @@ -0,0 +1,116 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var TITLE = "Date.prototype.setTime" + var SECTION = "15.9.5.24-1"; + var VERSION = "ECMA_1"; + startTest(); + + writeHeaderToLog( SECTION + " Date.prototype.setMilliseconds(ms)"); + + var testcases:Array = getTestCases(); + test(); + +function getTestCases() { + + return addTestCase( 0, -86400000 ); + +} +function addTestCase( startms, newms ) { + var array = new Array(); + var item = 0; + + var DateCase:Date = new Date( startms ); + DateCase.setMilliseconds( newms ); + var DateString = "var date = new Date("+ startms +"); date.setMilliseconds("+ newms +"); date"; + var UTCDate = UTCDateFromTime( Number(newms) ); + var LocalDate = LocalDateFromTime( Number(newms) ); + +// fixed_year = ( ExpectDate.year >=1900 || ExpectDate.year < 2000 ) ? ExpectDate.year - 1900 : ExpectDate.year; + + array[item++] = new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); + array[item++] = new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); + + array[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); +// array[item++] = new TestCase( SECTION, DateString+".getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes,DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds,DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); +// array[item++] = new TestCase( SECTION, DateString+".getDay()", LocalDate.day, DateCase.getDay() ); + array[item++] = new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); + array[item++] = new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); + + DateCase.toString = Object.prototype.toString; + array[item++] =new TestCase(SECTION,"DateCase.toString = Object.prototype.toString; DateCase.toString()","[object Date]", DateCase.toString() ); + + return array; +} + +function MyDate() { + this.year = 0; + this.month = 0; + this.date = 0; + this.hours = 0; + this.minutes = 0; + this.seconds = 0; + this.ms = 0; +} +function LocalDateFromTime(t) { + t = LocalTime(t); + return ( MyDateFromTime(t) ); +} +function UTCDateFromTime(t) { + return ( MyDateFromTime(t) ); +} +function MyDateFromTime( t ) { + var d = new MyDate(); + d.year = YearFromTime(t); + d.month = MonthFromTime(t); + d.date = DateFromTime(t); + d.hours = HourFromTime(t); + d.minutes = MinFromTime(t); + d.seconds = SecFromTime(t); + d.ms = msFromTime(t); + + d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); + d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); + d.day = WeekDay( d.value ); + + return (d); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_24_3.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_24_3.as new file mode 100644 index 00000000000..1f768cb063b --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_24_3.as @@ -0,0 +1,114 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var TITLE = "Date.prototype.setTime" + var SECTION = "15.9.5.24-1"; + var VERSION = "ECMA_1"; + startTest(); + + writeHeaderToLog( SECTION + " Date.prototype.setMilliseconds(ms)"); + + var testcases:Array = getTestCases(); + test(); + +function getTestCases() { + + return addTestCase( 0, -2208988800000 ); +} +function addTestCase( startms, newms ) { + var array = new Array(); + var item =0; + + var DateCase:Date = new Date( startms ); + DateCase.setMilliseconds( newms ); + var DateString = "var date = new Date("+ startms +"); date.setMilliseconds("+ newms +"); date"; + var UTCDate = UTCDateFromTime( Number(newms) ); + var LocalDate = LocalDateFromTime( Number(newms) ); + +// fixed_year = ( ExpectDate.year >=1900 || ExpectDate.year < 2000 ) ? ExpectDate.year - 1900 : ExpectDate.year; + + array[item++] = new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); + array[item++] = new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); + + array[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); +// array[item++] = new TestCase( SECTION, DateString+".getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes,DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds,DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); +// array[item++] = new TestCase( SECTION, DateString+".getDay()", LocalDate.day, DateCase.getDay() ); + array[item++] = new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); + array[item++] = new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); + + DateCase.toString = Object.prototype.toString; + array[item++] =new TestCase(SECTION,"DateCase.toString = Object.prototype.toString; DateCase.toString()","[object Date]", DateCase.toString() ); + return array; +} + +function MyDate() { + this.year = 0; + this.month = 0; + this.date = 0; + this.hours = 0; + this.minutes = 0; + this.seconds = 0; + this.ms = 0; +} +function LocalDateFromTime(t) { + t = LocalTime(t); + return ( MyDateFromTime(t) ); +} +function UTCDateFromTime(t) { + return ( MyDateFromTime(t) ); +} +function MyDateFromTime( t ) { + var d = new MyDate(); + d.year = YearFromTime(t); + d.month = MonthFromTime(t); + d.date = DateFromTime(t); + d.hours = HourFromTime(t); + d.minutes = MinFromTime(t); + d.seconds = SecFromTime(t); + d.ms = msFromTime(t); + + d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); + d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); + d.day = WeekDay( d.value ); + + return (d); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_24_4.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_24_4.as new file mode 100644 index 00000000000..775f98b5da2 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_24_4.as @@ -0,0 +1,115 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var TITLE = "Date.prototype.setTime" + var SECTION = "15.9.5.24-1"; + var VERSION = "ECMA_1"; + startTest(); + + writeHeaderToLog( SECTION + " Date.prototype.setMilliseconds(ms)"); + + var testcases:Array = getTestCases(); + test(); + +function getTestCases() { + + return addTestCase( 0, 946684800000 ); +} +function addTestCase( startms, newms ) { + var array = new Array(); + var item = 0; + + var DateCase:Date = new Date( startms ); + DateCase.setMilliseconds( newms ); + var DateString:String= "var date = new Date("+ startms +"); date.setMilliseconds("+ newms +"); date"; + var UTCDate = UTCDateFromTime( Number(newms) ); + var LocalDate = LocalDateFromTime( Number(newms) ); + +// fixed_year = ( ExpectDate.year >=1900 || ExpectDate.year < 2000 ) ? ExpectDate.year - 1900 : ExpectDate.year; + + array[item++] = new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); + array[item++] = new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); + + array[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); +// array[item++] = new TestCase( SECTION, DateString+".getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes,DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds,DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); +// array[item++] = new TestCase( SECTION, DateString+".getDay()", LocalDate.day, DateCase.getDay() ); + array[item++] = new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); + array[item++] = new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); + + DateCase.toString = Object.prototype.toString; + array[item++] =new TestCase(SECTION,"DateCase.toString = Object.prototype.toString; DateCase.toString()","[object Date]", DateCase.toString() ); + + return array; +} + +function MyDate() { + this.year = 0; + this.month = 0; + this.date = 0; + this.hours = 0; + this.minutes = 0; + this.seconds = 0; + this.ms = 0; +} +function LocalDateFromTime(t) { + t = LocalTime(t); + return ( MyDateFromTime(t) ); +} +function UTCDateFromTime(t) { + return ( MyDateFromTime(t) ); +} +function MyDateFromTime( t ) { + var d = new MyDate(); + d.year = YearFromTime(t); + d.month = MonthFromTime(t); + d.date = DateFromTime(t); + d.hours = HourFromTime(t); + d.minutes = MinFromTime(t); + d.seconds = SecFromTime(t); + d.ms = msFromTime(t); + + d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); + d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); + d.day = WeekDay( d.value ); + + return (d); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_24_5.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_24_5.as new file mode 100644 index 00000000000..5a068520528 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_24_5.as @@ -0,0 +1,117 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var TITLE = "Date.prototype.setTime" + var SECTION = "15.9.5.24-1"; + var VERSION = "ECMA_1"; + startTest(); + + writeHeaderToLog( SECTION + " Date.prototype.setMilliseconds(ms)"); + + var testcases:Array = getTestCases(); + test(); + +function getTestCases() { + + return addTestCase( 0, "0" ); + +} + +function addTestCase( startms, newms ) { + var array = new Array(); + var item = 0; + + var DateCase:Date = new Date( startms ); + DateCase.setMilliseconds( newms ); + var DateString:String = "var date = new Date("+ startms +"); date.setMilliseconds("+ newms +"); date"; + var UTCDate = UTCDateFromTime( Number(newms) ); + var LocalDate = LocalDateFromTime( Number(newms) ); + +// fixed_year = ( ExpectDate.year >=1900 || ExpectDate.year < 2000 ) ? ExpectDate.year - 1900 : ExpectDate.year; + + array[item++] = new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); + array[item++] = new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); + + array[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); +// array[item++] = new TestCase( SECTION, DateString+".getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes,DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds,DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); +// array[item++] = new TestCase( SECTION, DateString+".getDay()", LocalDate.day, DateCase.getDay() ); + array[item++] = new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); + array[item++] = new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); + + DateCase.toString = Object.prototype.toString; + array[item++] =new TestCase(SECTION,"DateCase.toString = Object.prototype.toString; DateCase.toString()","[object Date]", DateCase.toString() ); + + return array; +} + +function MyDate() { + this.year = 0; + this.month = 0; + this.date = 0; + this.hours = 0; + this.minutes = 0; + this.seconds = 0; + this.ms = 0; +} +function LocalDateFromTime(t) { + t = LocalTime(t); + return ( MyDateFromTime(t) ); +} +function UTCDateFromTime(t) { + return ( MyDateFromTime(t) ); +} +function MyDateFromTime( t ) { + var d = new MyDate(); + d.year = YearFromTime(t); + d.month = MonthFromTime(t); + d.date = DateFromTime(t); + d.hours = HourFromTime(t); + d.minutes = MinFromTime(t); + d.seconds = SecFromTime(t); + d.ms = msFromTime(t); + + d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); + d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); + d.day = WeekDay( d.value ); + + return (d); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_24_6.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_24_6.as new file mode 100644 index 00000000000..a7c8c70b290 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_24_6.as @@ -0,0 +1,114 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var TITLE = "Date.prototype.setTime" + var SECTION = "15.9.5.24-1"; + var VERSION = "ECMA_1"; + startTest(); + + writeHeaderToLog( SECTION + " Date.prototype.setMilliseconds(ms)"); + + var testcases:Array = getTestCases(); + test(); + +function getTestCases() { + + return addTestCase( 0, "-2208988800000" ); +} +function addTestCase( startms, newms ) { + var array = new Array(); + var item = 0; + + var DateCase:Date = new Date( startms ); + DateCase.setMilliseconds( newms ); + var DateString:String = "var date = new Date("+ startms +"); date.setMilliseconds("+ newms +"); date"; + var UTCDate = UTCDateFromTime( Number(newms) ); + var LocalDate = LocalDateFromTime( Number(newms) ); + +// fixed_year = ( ExpectDate.year >=1900 || ExpectDate.year < 2000 ) ? ExpectDate.year - 1900 : ExpectDate.year; + + array[item++] = new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); + array[item++] = new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); + + array[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); +// array[item++] = new TestCase( SECTION, DateString+".getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes,DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds,DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); +// array[item++] = new TestCase( SECTION, DateString+".getDay()", LocalDate.day, DateCase.getDay() ); + array[item++] = new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); + array[item++] = new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); + + DateCase.toString = Object.prototype.toString; + array[item++] =new TestCase(SECTION,"DateCase.toString = Object.prototype.toString; DateCase.toString()","[object Date]", DateCase.toString() ); + return array; +} + +function MyDate() { + this.year = 0; + this.month = 0; + this.date = 0; + this.hours = 0; + this.minutes = 0; + this.seconds = 0; + this.ms = 0; +} +function LocalDateFromTime(t) { + t = LocalTime(t); + return ( MyDateFromTime(t) ); +} +function UTCDateFromTime(t) { + return ( MyDateFromTime(t) ); +} +function MyDateFromTime( t ) { + var d = new MyDate(); + d.year = YearFromTime(t); + d.month = MonthFromTime(t); + d.date = DateFromTime(t); + d.hours = HourFromTime(t); + d.minutes = MinFromTime(t); + d.seconds = SecFromTime(t); + d.ms = msFromTime(t); + + d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); + d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); + d.day = WeekDay( d.value ); + + return (d); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_24_7.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_24_7.as new file mode 100644 index 00000000000..5d4489a499f --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_24_7.as @@ -0,0 +1,116 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var TITLE = "Date.prototype.setTime" + var SECTION = "15.9.5.24-1"; + var VERSION = "ECMA_1"; + startTest(); + + writeHeaderToLog( SECTION + " Date.prototype.setMilliseconds(ms)"); + + var testcases:Array = getTestCases(); + test(); + +function getTestCases() { + + return addTestCase( 0, "-86400000" ); +} + +function addTestCase( startms, newms ) { + var array = new Array(); + var item = 0; + + var DateCase:Date = new Date( startms ); + DateCase.setMilliseconds( newms ); + var DateString:String = "var date = new Date("+ startms +"); date.setMilliseconds("+ newms +"); date"; + var UTCDate = UTCDateFromTime( Number(newms) ); + var LocalDate = LocalDateFromTime( Number(newms) ); + +// fixed_year = ( ExpectDate.year >=1900 || ExpectDate.year < 2000 ) ? ExpectDate.year - 1900 : ExpectDate.year; + + array[item++] = new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); + array[item++] = new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); + + array[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); +// array[item++] = new TestCase( SECTION, DateString+".getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes,DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds,DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); +// array[item++] = new TestCase( SECTION, DateString+".getDay()", LocalDate.day, DateCase.getDay() ); + array[item++] = new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); + array[item++] = new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); + + DateCase.toString = Object.prototype.toString; + array[item++] =new TestCase(SECTION,"DateCase.toString = Object.prototype.toString; DateCase.toString()","[object Date]", DateCase.toString() ); + + return array; +} + +function MyDate() { + this.year = 0; + this.month = 0; + this.date = 0; + this.hours = 0; + this.minutes = 0; + this.seconds = 0; + this.ms = 0; +} +function LocalDateFromTime(t) { + t = LocalTime(t); + return ( MyDateFromTime(t) ); +} +function UTCDateFromTime(t) { + return ( MyDateFromTime(t) ); +} +function MyDateFromTime( t ) { + var d = new MyDate(); + d.year = YearFromTime(t); + d.month = MonthFromTime(t); + d.date = DateFromTime(t); + d.hours = HourFromTime(t); + d.minutes = MinFromTime(t); + d.seconds = SecFromTime(t); + d.ms = msFromTime(t); + + d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); + d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); + d.day = WeekDay( d.value ); + + return (d); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_24_8.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_24_8.as new file mode 100644 index 00000000000..e1144ba21ab --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_24_8.as @@ -0,0 +1,114 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var TITLE = "Date.prototype.setTime" + var SECTION = "15.9.5.24-1"; + var VERSION = "ECMA_1"; + startTest(); + + writeHeaderToLog( SECTION + " Date.prototype.setMilliseconds(ms)"); + + var testcases:Array = getTestCases(); + test(); + +function getTestCases() { + return addTestCase( 0, "946684800000" ); +} +function addTestCase( startms, newms ) { + var array = new Array(); + var item = 0; + + var DateCase:Date = new Date( startms ); + DateCase.setMilliseconds( newms ); + var DateString = "var date = new Date("+ startms +"); date.setMilliseconds("+ newms +"); date"; + var UTCDate = UTCDateFromTime( Number(newms) ); + var LocalDate = LocalDateFromTime( Number(newms) ); + +// fixed_year = ( ExpectDate.year >=1900 || ExpectDate.year < 2000 ) ? ExpectDate.year - 1900 : ExpectDate.year; + + array[item++] = new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); + array[item++] = new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); + + array[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); +// array[item++] = new TestCase( SECTION, DateString+".getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes,DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds,DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); +// array[item++] = new TestCase( SECTION, DateString+".getDay()", LocalDate.day, DateCase.getDay() ); + array[item++] = new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); + array[item++] = new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); + + DateCase.toString = Object.prototype.toString; + array[item++] =new TestCase(SECTION,"DateCase.toString = Object.prototype.toString; DateCase.toString()","[object Date]", DateCase.toString() ); + + return array; +} + +function MyDate() { + this.year = 0; + this.month = 0; + this.date = 0; + this.hours = 0; + this.minutes = 0; + this.seconds = 0; + this.ms = 0; +} +function LocalDateFromTime(t) { + t = LocalTime(t); + return ( MyDateFromTime(t) ); +} +function UTCDateFromTime(t) { + return ( MyDateFromTime(t) ); +} +function MyDateFromTime( t ) { + var d = new MyDate(); + d.year = YearFromTime(t); + d.month = MonthFromTime(t); + d.date = DateFromTime(t); + d.hours = HourFromTime(t); + d.minutes = MinFromTime(t); + d.seconds = SecFromTime(t); + d.ms = msFromTime(t); + + d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); + d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); + d.day = WeekDay( d.value ); + + return (d); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_25_1.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_25_1.as new file mode 100644 index 00000000000..d0b2ae18d87 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_25_1.as @@ -0,0 +1,183 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.9.5.25-1"; + var VERSION = "ECMA_1"; + startTest(); + + writeHeaderToLog( SECTION + " Date.prototype.setUTCMilliseconds(ms)"); + + var testcases:Array = getTestCases(); + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + + addNewTestCase( 0, 0, "TDATE = new Date(0);(TDATE).setUTCMilliseconds(0);TDATE", + UTCDateFromTime(SetUTCMilliseconds(0,0)), + LocalDateFromTime(SetUTCMilliseconds(0,0)) ); + addNewTestCase( 28800000,999, + "TDATE = new Date(28800000);(TDATE).setUTCMilliseconds(999);TDATE", + UTCDateFromTime(SetUTCMilliseconds(28800000,999)), + LocalDateFromTime(SetUTCMilliseconds(28800000,999)) ); + addNewTestCase( 28800000,-28800000, + "TDATE = new Date(28800000);(TDATE).setUTCMilliseconds(-28800000);TDATE", + UTCDateFromTime(SetUTCMilliseconds(28800000,-28800000)), + LocalDateFromTime(SetUTCMilliseconds(28800000,-28800000)) ); + addNewTestCase( 946684800000,1234567, + "TDATE = new Date(946684800000);(TDATE).setUTCMilliseconds(1234567);TDATE", + UTCDateFromTime(SetUTCMilliseconds(946684800000,1234567)), + LocalDateFromTime(SetUTCMilliseconds(946684800000,1234567)) ); + addNewTestCase( 946684800000, 123456789, + "TDATE = new Date(946684800000);(TDATE).setUTCMilliseconds(123456789);TDATE", + UTCDateFromTime(SetUTCMilliseconds(946684800000,123456789)), + LocalDateFromTime(SetUTCMilliseconds(946684800000,123456789)) ); + + addNewTestCase( -2208988800000,123456789, + "TDATE = new Date(-2208988800000);(TDATE).setUTCMilliseconds(123456789);TDATE", + UTCDateFromTime(SetUTCMilliseconds(-2208988800000,123456789)), + LocalDateFromTime(SetUTCMilliseconds(-2208988800000,123456789)) ); + + addNewTestCase( -2208988800000,123456, + "TDATE = new Date(-2208988800000);(TDATE).setUTCMilliseconds(123456);TDATE", + UTCDateFromTime(SetUTCMilliseconds(-2208988800000,123456)), + LocalDateFromTime(SetUTCMilliseconds(-2208988800000,123456)) ); + + addNewTestCase( -2208988800000,-123456, + "TDATE = new Date(-2208988800000);(TDATE).setUTCMilliseconds(-123456);TDATE", + UTCDateFromTime(SetUTCMilliseconds(-2208988800000,-123456)), + LocalDateFromTime(SetUTCMilliseconds(-2208988800000,-123456)) ); + + addNewTestCase( 0,-999, + "TDATE = new Date(0);(TDATE).setUTCMilliseconds(-999);TDATE", + UTCDateFromTime(SetUTCMilliseconds(0,-999)), + LocalDateFromTime(SetUTCMilliseconds(0,-999)) ); +/* + addNewTestCase( "TEST_DATE = new Date(0);(TEST_DATE).setMilliseconds(0);TEST_DATE", UTCDateFromTime(0), LocalDateFromTime(0) ); +// addNewTestCase( "TEST_DATE = new Date(0);(TEST_DATE).setMilliseconds(-2208988800000);TEST_DATE", UTCDateFromTime(-2208988800000), LocalDateFromTime(-2208988800000) ); + addNewTestCase( "TEST_DATE = new Date(0);(TEST_DATE).setMilliseconds(-86400000);TEST_DATE", UTCDateFromTime(-86400000), LocalDateFromTime(-86400000) ); + addNewTestCase( "TEST_DATE = new Date(0);(TEST_DATE).setMilliseconds(946684800000);TEST_DATE", UTCDateFromTime(946684800000), LocalDateFromTime(946684800000) ); + addNewTestCase( "TEST_DATE = new Date(0);(TEST_DATE).setMilliseconds(-69609600000);TEST_DATE", UTCDateFromTime(-69609600000), LocalDateFromTime(-69609600000) ); + + + addNewTestCase( "TEST_DATE = new Date(0);(TEST_DATE).setMilliseconds('0');TEST_DATE", UTCDateFromTime(0), LocalDateFromTime(0) ); +// addNewTestCase( "TEST_DATE = new Date(0);(TEST_DATE).setMilliseconds('-2208988800000');TEST_DATE", UTCDateFromTime(-2208988800000), LocalDateFromTime(-2208988800000) ); + addNewTestCase( "TEST_DATE = new Date(0);(TEST_DATE).setMilliseconds('-86400000');TEST_DATE", UTCDateFromTime(-86400000), LocalDateFromTime(-86400000) ); + addNewTestCase( "TEST_DATE = new Date(0);(TEST_DATE).setMilliseconds('946684800000');TEST_DATE", UTCDateFromTime(946684800000), LocalDateFromTime(946684800000) ); + addNewTestCase( "TEST_DATE = new Date(0);(TEST_DATE).setMilliseconds('-69609600000');TEST_DATE", UTCDateFromTime(-69609600000), LocalDateFromTime(-69609600000) ); +*/ + + function addNewTestCase( initialTime, ms, DateString, UTCDate, LocalDate) { + var DateCase:Date = new Date(initialTime); + DateCase.setUTCMilliseconds(ms); + + // fixed_year = ( ExpectDate.year >=1900 || ExpectDate.year < 2000 ) ? ExpectDate.year - 1900 : ExpectDate.year; + + array[item++] = new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); + array[item++] = new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); + + array[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); + // array[item++] = new TestCase( SECTION, DateString+".getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes,DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds,DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); + // array[item++] = new TestCase( SECTION, DateString+".getDay()", LocalDate.day, DateCase.getDay() ); + array[item++] = new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); + array[item++] = new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); + array[item++] = new TestCase( SECTION, + DateString+".toString=Object.prototype.toString;"+DateString+".toString()", + "[object Date]", + (DateCase.myToString = Object.prototype.toString, DateCase.myToString()) ); + + + + /* array[item++] = new TestCase( SECTION, + DateString+".toString=Object.prototype.toString;"+DateString+".toString()", + "[object Date]", + DateCase.toString());*/ + + + + + } + return array; +} +function MyDate() { + this.year = 0; + this.month = 0; + this.date = 0; + this.hours = 0; + this.minutes = 0; + this.seconds = 0; + this.ms = 0; +} +function LocalDateFromTime(t) { + t = LocalTime(t); + return ( MyDateFromTime(t) ); +} +function UTCDateFromTime(t) { + return ( MyDateFromTime(t) ); +} +function MyDateFromTime( t ) { + var d= new MyDate(); + d.year = YearFromTime(t); + d.month = MonthFromTime(t); + d.date = DateFromTime(t); + d.hours = HourFromTime(t); + d.minutes = MinFromTime(t); + d.seconds = SecFromTime(t); + d.ms = msFromTime(t); + + d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); + d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); + d.day = WeekDay( d.value ); + + return (d); +} + +function SetUTCMilliseconds( T, MS ) { + var T = Number( T ); + TIME = MakeTime( HourFromTime(T), + MinFromTime(T), + SecFromTime(T), + MS ); + return( MakeDate( Day(T), TIME )); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_26_1.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_26_1.as new file mode 100644 index 00000000000..547a1f9d6ff --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_26_1.as @@ -0,0 +1,187 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.9.5.26-1"; + var VERSION = "ECMA_1"; + startTest(); + + writeHeaderToLog( SECTION + " Date.prototype.setSeconds(sec [,ms] )"); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + addNewTestCase( 0, 0, 0, + "TDATE = new Date(0);(TDATE).setSeconds(0,0);TDATE", + UTCDateFromTime(SetSeconds(0,0,0)), + LocalDateFromTime(SetSeconds(0,0,0)) ); + + addNewTestCase( 28800000,59,999, + "TDATE = new Date(28800000);(TDATE).setSeconds(59,999);TDATE", + UTCDateFromTime(SetSeconds(28800000,59,999)), + LocalDateFromTime(SetSeconds(28800000,59,999)) ); + + addNewTestCase( 28800000,999,999, + "TDATE = new Date(28800000);(TDATE).setSeconds(999,999);TDATE", + UTCDateFromTime(SetSeconds(28800000,999,999)), + LocalDateFromTime(SetSeconds(28800000,999,999)) ); + + addNewTestCase( 28800000,999, void 0, + "TDATE = new Date(28800000);(TDATE).setSeconds(999);TDATE", + UTCDateFromTime(SetSeconds(28800000,999,0)), + LocalDateFromTime(SetSeconds(28800000,999,0)) ); + + addNewTestCase( 28800000,-28800, void 0, + "TDATE = new Date(28800000);(TDATE).setSeconds(-28800);TDATE", + UTCDateFromTime(SetSeconds(28800000,-28800)), + LocalDateFromTime(SetSeconds(28800000,-28800)) ); + + addNewTestCase( 946684800000,1234567,void 0, + "TDATE = new Date(946684800000);(TDATE).setSeconds(1234567);TDATE", + UTCDateFromTime(SetSeconds(946684800000,1234567)), + LocalDateFromTime(SetSeconds(946684800000,1234567)) ); + + addNewTestCase( -2208988800000,59,999, + "TDATE = new Date(-2208988800000);(TDATE).setSeconds(59,999);TDATE", + UTCDateFromTime(SetSeconds(-2208988800000,59,999)), + LocalDateFromTime(SetSeconds(-2208988800000,59,999)) ); + +/* + addNewTestCase( "TDATE = new Date(-2208988800000);(TDATE).setUTCMilliseconds(123456789);TDATE", + UTCDateFromTime(SetUTCMilliseconds(-2208988800000,123456789)), + LocalDateFromTime(SetUTCMilliseconds(-2208988800000,123456789)) ); + + addNewTestCase( "TDATE = new Date(-2208988800000);(TDATE).setUTCMilliseconds(123456);TDATE", + UTCDateFromTime(SetUTCMilliseconds(-2208988800000,123456)), + LocalDateFromTime(SetUTCMilliseconds(-2208988800000,123456)) ); + + addNewTestCase( "TDATE = new Date(-2208988800000);(TDATE).setUTCMilliseconds(-123456);TDATE", + UTCDateFromTime(SetUTCMilliseconds(-2208988800000,-123456)), + LocalDateFromTime(SetUTCMilliseconds(-2208988800000,-123456)) ); + + addNewTestCase( "TDATE = new Date(0);(TDATE).setUTCMilliseconds(-999);TDATE", + UTCDateFromTime(SetUTCMilliseconds(0,-999)), + LocalDateFromTime(SetUTCMilliseconds(0,-999)) ); +*/ + + function addNewTestCase( startTime, sec, ms, DateString,UTCDate, LocalDate) { + var DateCase = new Date( startTime ); + if ( ms != void 0 ) { + DateCase.setSeconds( sec, ms ); + } else { + DateCase.setSeconds( sec ); + } + + // fixed_year = ( ExpectDate.year >=1900 || ExpectDate.year < 2000 ) ? ExpectDate.year - 1900 : ExpectDate.year; + + array[item++] = new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); + array[item++] = new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); + + array[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); + // array[item++] = new TestCase( SECTION, DateString+".getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes,DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds,DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); + // array[item++] = new TestCase( SECTION, DateString+".getDay()", LocalDate.day, DateCase.getDay() ); + array[item++] = new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); + array[item++] = new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); + + + + /* array[item++] = new TestCase( SECTION, + DateString+".toString=Object.prototype.toString;"+DateString+".toString()", + "[object Date]",DateCase.toString());*/ + + + + + array[item++] = new TestCase( SECTION, + DateString+".toString=Object.prototype.toString;"+DateString+".toString()", + "[object Date]", + (DateCase.myToString = Object.prototype.toString, DateCase.myToString()) ); + } + return array; +} + +function MyDate() { + this.year = 0; + this.month = 0; + this.date = 0; + this.hours = 0; + this.minutes = 0; + this.seconds = 0; + this.ms = 0; +} +function LocalDateFromTime(t) { + t = LocalTime(t); + return ( MyDateFromTime(t) ); +} +function UTCDateFromTime(t) { + return ( MyDateFromTime(t) ); +} +function MyDateFromTime( t ) { + var d = new MyDate(); + d.year = YearFromTime(t); + d.month = MonthFromTime(t); + d.date = DateFromTime(t); + d.hours = HourFromTime(t); + d.minutes = MinFromTime(t); + d.seconds = SecFromTime(t); + d.ms = msFromTime(t); + + d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); + d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); + d.day = WeekDay( d.value ); + + return (d); +} +function SetSeconds( t, s, m ) { + var MS = ( m == void 0 ) ? msFromTime(t) : Number( m ); + var TIME = LocalTime( t ); + var SEC = Number(s); + var RESULT4 = MakeTime( HourFromTime( TIME ), + MinFromTime( TIME ), + SEC, + MS ); + var UTC_TIME = UTC(MakeDate(Day(TIME), RESULT4)); + return ( TimeClip(UTC_TIME) ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_27_1.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_27_1.as new file mode 100644 index 00000000000..9af3587a020 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_27_1.as @@ -0,0 +1,187 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.9.5.27-1"; + var VERSION = "ECMA_1"; + startTest(); + + writeHeaderToLog( SECTION + " Date.prototype.setUTCSeconds(sec [,ms] )"); + + var testcases = getTestCases(); + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + addNewTestCase( 0, 0, 0, "TDATE = new Date(0);(TDATE).setUTCSeconds(0,0);TDATE", + UTCDateFromTime(SetUTCSeconds(0,0,0)), + LocalDateFromTime(SetUTCSeconds(0,0,0)) ); + + addNewTestCase( 28800000,59,999, + "TDATE = new Date(28800000);(TDATE).setUTCSeconds(59,999);TDATE", + UTCDateFromTime(SetUTCSeconds(28800000,59,999)), + LocalDateFromTime(SetUTCSeconds(28800000,59,999)) ); + + addNewTestCase( 28800000,999,999, + "TDATE = new Date(28800000);(TDATE).setUTCSeconds(999,999);TDATE", + UTCDateFromTime(SetUTCSeconds(28800000,999,999)), + LocalDateFromTime(SetUTCSeconds(28800000,999,999)) ); + + addNewTestCase( 28800000, 999, void 0, + "TDATE = new Date(28800000);(TDATE).setUTCSeconds(999);TDATE", + UTCDateFromTime(SetUTCSeconds(28800000,999,0)), + LocalDateFromTime(SetUTCSeconds(28800000,999,0)) ); + + addNewTestCase( 28800000, -28800, void 0, + "TDATE = new Date(28800000);(TDATE).setUTCSeconds(-28800);TDATE", + UTCDateFromTime(SetUTCSeconds(28800000,-28800)), + LocalDateFromTime(SetUTCSeconds(28800000,-28800)) ); + + addNewTestCase( 946684800000, 1234567, void 0, + "TDATE = new Date(946684800000);(TDATE).setUTCSeconds(1234567);TDATE", + UTCDateFromTime(SetUTCSeconds(946684800000,1234567)), + LocalDateFromTime(SetUTCSeconds(946684800000,1234567)) ); + + addNewTestCase( -2208988800000,59,999, + "TDATE = new Date(-2208988800000);(TDATE).setUTCSeconds(59,999);TDATE", + UTCDateFromTime(SetUTCSeconds(-2208988800000,59,999)), + LocalDateFromTime(SetUTCSeconds(-2208988800000,59,999)) ); +/* + addNewTestCase( "TDATE = new Date(-2208988800000);(TDATE).setUTCMilliseconds(123456789);TDATE", + UTCDateFromTime(SetUTCMilliseconds(-2208988800000,123456789)), + LocalDateFromTime(SetUTCMilliseconds(-2208988800000,123456789)) ); + + addNewTestCase( "TDATE = new Date(-2208988800000);(TDATE).setUTCMilliseconds(123456);TDATE", + UTCDateFromTime(SetUTCMilliseconds(-2208988800000,123456)), + LocalDateFromTime(SetUTCMilliseconds(-2208988800000,123456)) ); + + addNewTestCase( "TDATE = new Date(-2208988800000);(TDATE).setUTCMilliseconds(-123456);TDATE", + UTCDateFromTime(SetUTCMilliseconds(-2208988800000,-123456)), + LocalDateFromTime(SetUTCMilliseconds(-2208988800000,-123456)) ); + + addNewTestCase( "TDATE = new Date(0);(TDATE).setUTCMilliseconds(-999);TDATE", + UTCDateFromTime(SetUTCMilliseconds(0,-999)), + LocalDateFromTime(SetUTCMilliseconds(0,-999)) ); +*/ + + function addNewTestCase( startTime, sec, ms, DateString, UTCDate, LocalDate) { + var DateCase = new Date( startTime ); + if ( ms == void 0) { + DateCase.setSeconds( sec ); + } else { + DateCase.setSeconds( sec, ms ); + } + + + // fixed_year = ( ExpectDate.year >=1900 || ExpectDate.year < 2000 ) ? ExpectDate.year - 1900 : ExpectDate.year; + + array[item++] = new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); + array[item++] = new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); + + array[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); + // array[item++] = new TestCase( SECTION, DateString+".getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes,DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds,DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); + // array[item++] = new TestCase( SECTION, DateString+".getDay()", LocalDate.day, DateCase.getDay() ); + array[item++] = new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); + array[item++] = new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); + + + + /* array[item++] = new TestCase( SECTION, + DateString+".toString=Object.prototype.toString;"+DateString+".toString()", + "[object Date]", + DateCase.toString());*/ + + + + array[item++] = new TestCase( SECTION, + DateString+".toString=Object.prototype.toString;"+DateString+".toString()", + "[object Date]", + (DateCase.myToString = Object.prototype.toString, DateCase.myToString()) ); + } + return array; +} + +function MyDate() { + this.year = 0; + this.month = 0; + this.date = 0; + this.hours = 0; + this.minutes = 0; + this.seconds = 0; + this.ms = 0; +} +function LocalDateFromTime(t) { + t = LocalTime(t); + return ( MyDateFromTime(t) ); +} +function UTCDateFromTime(t) { + return ( MyDateFromTime(t) ); +} +function MyDateFromTime( t ) { + var d = new MyDate(); + d.year = YearFromTime(t); + d.month = MonthFromTime(t); + d.date = DateFromTime(t); + d.hours = HourFromTime(t); + d.minutes = MinFromTime(t); + d.seconds = SecFromTime(t); + d.ms = msFromTime(t); + + d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); + d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); + d.day = WeekDay( d.value ); + + return (d); +} + +function SetUTCSeconds( t, s, m ) { + var TIME = t; + var SEC = Number(s); + var MS = ( m == void 0 ) ? msFromTime(TIME) : Number( m ); + var RESULT4 = MakeTime( HourFromTime( TIME ), + MinFromTime( TIME ), + SEC, + MS ); + return ( TimeClip(MakeDate(Day(TIME), RESULT4)) ); +} + diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_28_1.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_28_1.as new file mode 100644 index 00000000000..20fef3002c9 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_28_1.as @@ -0,0 +1,199 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.9.5.28-1"; + var VERSION = "ECMA_1"; + startTest(); + + writeHeaderToLog( SECTION + " Date.prototype.setMinutes(sec [,ms] )"); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + addNewTestCase( 0, 0, void 0, void 0, + "TDATE = new Date(0);(TDATE).setMinutes(0);TDATE", + UTCDateFromTime(SetMinutes(0,0,0,0)), + LocalDateFromTime(SetMinutes(0,0,0,0)) ); + + addNewTestCase( 28800000, 59, 59, void 0, + "TDATE = new Date(28800000);(TDATE).setMinutes(59,59);TDATE", + UTCDateFromTime(SetMinutes(28800000,59,59)), + LocalDateFromTime(SetMinutes(28800000,59,59)) ); + + addNewTestCase( 28800000, 59, 59, 999, + "TDATE = new Date(28800000);(TDATE).setMinutes(59,59,999);TDATE", + UTCDateFromTime(SetMinutes(28800000,59,59,999)), + LocalDateFromTime(SetMinutes(28800000,59,59,999)) ); + + addNewTestCase( 28800000, 59, void 0, void 0, + "TDATE = new Date(28800000);(TDATE).setMinutes(59);TDATE", + UTCDateFromTime(SetMinutes(28800000,59,0)), + LocalDateFromTime(SetMinutes(28800000,59,0)) ); + + addNewTestCase( 28800000, -480, void 0, void 0, + "TDATE = new Date(28800000);(TDATE).setMinutes(-480);TDATE", + UTCDateFromTime(SetMinutes(28800000,-480)), + LocalDateFromTime(SetMinutes(28800000,-480)) ); + + addNewTestCase( 946684800000, 1234567, void 0, void 0, + "TDATE = new Date(946684800000);(TDATE).setMinutes(1234567);TDATE", + UTCDateFromTime(SetMinutes(946684800000,1234567)), + LocalDateFromTime(SetMinutes(946684800000,1234567)) ); + + addNewTestCase( -2208988800000,59, 59, void 0, + "TDATE = new Date(-2208988800000);(TDATE).setMinutes(59,59);TDATE", + UTCDateFromTime(SetMinutes(-2208988800000,59,59)), + LocalDateFromTime(SetMinutes(-2208988800000,59,59)) ); + + addNewTestCase( -2208988800000, 59, 59, 999, + "TDATE = new Date(-2208988800000);(TDATE).setMinutes(59,59,999);TDATE", + UTCDateFromTime(SetMinutes(-2208988800000,59,59,999)), + LocalDateFromTime(SetMinutes(-2208988800000,59,59,999)) ); +/* + addNewTestCase( "TDATE = new Date(-2208988800000);(TDATE).setUTCMilliseconds(123456789);TDATE", + UTCDateFromTime(SetUTCMilliseconds(-2208988800000,123456789)), + LocalDateFromTime(SetUTCMilliseconds(-2208988800000,123456789)) ); + + addNewTestCase( "TDATE = new Date(-2208988800000);(TDATE).setUTCMilliseconds(123456);TDATE", + UTCDateFromTime(SetUTCMilliseconds(-2208988800000,123456)), + LocalDateFromTime(SetUTCMilliseconds(-2208988800000,123456)) ); + + addNewTestCase( "TDATE = new Date(-2208988800000);(TDATE).setUTCMilliseconds(-123456);TDATE", + UTCDateFromTime(SetUTCMilliseconds(-2208988800000,-123456)), + LocalDateFromTime(SetUTCMilliseconds(-2208988800000,-123456)) ); + + addNewTestCase( "TDATE = new Date(0);(TDATE).setUTCMilliseconds(-999);TDATE", + UTCDateFromTime(SetUTCMilliseconds(0,-999)), + LocalDateFromTime(SetUTCMilliseconds(0,-999)) ); +*/ + + + function addNewTestCase( time, min, sec, ms, DateString, UTCDate, LocalDate) { + var DateCase = new Date( time ); + + if ( sec == void 0 ) { + DateCase.setMinutes( min ); + } else { + if ( ms == void 0 ) { + DateCase.setMinutes( min, sec ); + } else { + DateCase.setMinutes( min, sec, ms ); + } + } + + + // fixed_year = ( ExpectDate.year >=1900 || ExpectDate.year < 2000 ) ? ExpectDate.year - 1900 : ExpectDate.year; + + array[item++] = new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); + array[item++] = new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); + + array[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); + // array[item++] = new TestCase( SECTION, DateString+".getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes,DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds,DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); + // array[item++] = new TestCase( SECTION, DateString+".getDay()", LocalDate.day, DateCase.getDay() ); + array[item++] = new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); + array[item++] = new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); + + + + /* array[item++] = new TestCase( SECTION, + DateString+".toString=Object.prototype.toString;"+DateString+".toString()", + "[object Date]", + DateCase.toString());*/ + + + + array[item++] = new TestCase( SECTION, + DateString+".toString=Object.prototype.toString;"+DateString+".toString()", + "[object Date]", + (DateCase.myToString = Object.prototype.toString, DateCase.myToString()) ); + } + return array; +} + +function MyDate() { + this.year = 0; + this.month = 0; + this.date = 0; + this.hours = 0; + this.minutes = 0; + this.seconds = 0; + this.ms = 0; +} +function LocalDateFromTime(t) { + t = LocalTime(t); + return ( MyDateFromTime(t) ); +} +function UTCDateFromTime(t) { + return ( MyDateFromTime(t) ); +} +function MyDateFromTime( t ) { + var d = new MyDate(); + d.year = YearFromTime(t); + d.month = MonthFromTime(t); + d.date = DateFromTime(t); + d.hours = HourFromTime(t); + d.minutes = MinFromTime(t); + d.seconds = SecFromTime(t); + d.ms = msFromTime(t); + + d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); + d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); + d.day = WeekDay( d.value ); + + return (d); +} + +function SetMinutes( t, min, sec, ms ) { + var TIME = LocalTime(t); + var MIN = Number(min); + var SEC = ( sec == void 0) ? SecFromTime(TIME) : Number(sec); + var MS = ( ms == void 0 ) ? msFromTime(TIME) : Number(ms); + var RESULT5 = MakeTime( HourFromTime( TIME ), + MIN, + SEC, + MS ); + return ( TimeClip(UTC( MakeDate(Day(TIME),RESULT5))) ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_29_1.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_29_1.as new file mode 100644 index 00000000000..4a4abb00cbe --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_29_1.as @@ -0,0 +1,185 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.9.5.29-1"; + var VERSION = "ECMA_1"; + startTest(); + + writeHeaderToLog( SECTION + " Date.prototype.setUTCMinutes( min [, sec, ms] )"); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + addNewTestCase( 0, 0, void 0, void 0, + "TDATE = new Date(0);(TDATE).setUTCMinutes(0);TDATE", + UTCDateFromTime(SetUTCMinutes(0,0,0,0)), + LocalDateFromTime(SetUTCMinutes(0,0,0,0)) ); + + addNewTestCase( 28800000, 59, 59, void 0, + "TDATE = new Date(28800000);(TDATE).setUTCMinutes(59,59);TDATE", + UTCDateFromTime(SetUTCMinutes(28800000,59,59)), + LocalDateFromTime(SetUTCMinutes(28800000,59,59)) ); + + addNewTestCase( 28800000, 59, 59, 999, + "TDATE = new Date(28800000);(TDATE).setUTCMinutes(59,59,999);TDATE", + UTCDateFromTime(SetUTCMinutes(28800000,59,59,999)), + LocalDateFromTime(SetUTCMinutes(28800000,59,59,999)) ); + + addNewTestCase( 28800000, 59, void 0, void 0, + "TDATE = new Date(28800000);(TDATE).setUTCMinutes(59);TDATE", + UTCDateFromTime(SetUTCMinutes(28800000,59)), + LocalDateFromTime(SetUTCMinutes(28800000,59)) ); + + addNewTestCase( 28800000, -480, 0, 0, + "TDATE = new Date(28800000);(TDATE).setUTCMinutes(-480);TDATE", + UTCDateFromTime(SetUTCMinutes(28800000,-480)), + LocalDateFromTime(SetUTCMinutes(28800000,-480)) ); + + addNewTestCase( 946684800000, 1234567, void 0, void 0, + "TDATE = new Date(946684800000);(TDATE).setUTCMinutes(1234567);TDATE", + UTCDateFromTime(SetUTCMinutes(946684800000,1234567)), + LocalDateFromTime(SetUTCMinutes(946684800000,1234567)) ); + + addNewTestCase( -2208988800000, 59, 999, void 0, + "TDATE = new Date(-2208988800000);(TDATE).setUTCMinutes(59,999);TDATE", + UTCDateFromTime(SetUTCMinutes(-2208988800000,59,999)), + LocalDateFromTime(SetUTCMinutes(-2208988800000,59,999)) ); +/* + addNewTestCase( "TDATE = new Date(-2208988800000);(TDATE).setUTCMilliseconds(123456789);TDATE", + UTCDateFromTime(SetUTCMilliseconds(-2208988800000,123456789)), + LocalDateFromTime(SetUTCMilliseconds(-2208988800000,123456789)) ); + + addNewTestCase( "TDATE = new Date(-2208988800000);(TDATE).setUTCMilliseconds(123456);TDATE", + UTCDateFromTime(SetUTCMilliseconds(-2208988800000,123456)), + LocalDateFromTime(SetUTCMilliseconds(-2208988800000,123456)) ); + + addNewTestCase( "TDATE = new Date(-2208988800000);(TDATE).setUTCMilliseconds(-123456);TDATE", + UTCDateFromTime(SetUTCMilliseconds(-2208988800000,-123456)), + LocalDateFromTime(SetUTCMilliseconds(-2208988800000,-123456)) ); + + addNewTestCase( "TDATE = new Date(0);(TDATE).setUTCMilliseconds(-999);TDATE", + UTCDateFromTime(SetUTCMilliseconds(0,-999)), + LocalDateFromTime(SetUTCMilliseconds(0,-999)) ); +*/ + + + function addNewTestCase( time, min, sec, ms, DateString, UTCDate, LocalDate) { + var DateCase = new Date( time ); + + if ( sec == void 0 ) { + DateCase.setUTCMinutes( min ); + } else { + if ( ms == void 0 ) { + DateCase.setUTCMinutes( min, sec ); + } else { + DateCase.setUTCMinutes( min, sec, ms ); + } + } + + // fixed_year = ( ExpectDate.year >=1900 || ExpectDate.year < 2000 ) ? ExpectDate.year - 1900 : ExpectDate.year; + + array[item++] = new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); + array[item++] = new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); + + array[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); + // array[item++] = new TestCase( SECTION, DateString+".getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes,DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds,DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); + // array[item++] = new TestCase( SECTION, DateString+".getDay()", LocalDate.day, DateCase.getDay() ); + array[item++] = new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); + array[item++] = new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); + + //DateCase.toString = Object.prototype.toString; + + array[item++] = new TestCase( SECTION, + DateString+".toString=Object.prototype.toString;"+DateString+".toString()", + "[object Date]", + (DateCase.myToString= Object.prototype.toString, DateCase.myToString()) ); + } + return array; +} + +function MyDate() { + this.year = 0; + this.month = 0; + this.date = 0; + this.hours = 0; + this.minutes = 0; + this.seconds = 0; + this.ms = 0; +} +function LocalDateFromTime(t) { + t = LocalTime(t); + return ( MyDateFromTime(t) ); +} +function UTCDateFromTime(t) { + return ( MyDateFromTime(t) ); +} +function MyDateFromTime( t ) { + var d = new MyDate(); + d.year = YearFromTime(t); + d.month = MonthFromTime(t); + d.date = DateFromTime(t); + d.hours = HourFromTime(t); + d.minutes = MinFromTime(t); + d.seconds = SecFromTime(t); + d.ms = msFromTime(t); + + d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); + d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); + d.day = WeekDay( d.value ); + + return (d); +} +function SetUTCMinutes( t, min, sec, ms ) { + var TIME = t; + var MIN = Number(min); + var SEC = ( sec == void 0) ? SecFromTime(TIME) : Number(sec); + var MS = ( ms == void 0 ) ? msFromTime(TIME) : Number(ms); + var RESULT5 = MakeTime( HourFromTime( TIME ), + MIN, + SEC, + MS ); + return ( TimeClip(MakeDate(Day(TIME),RESULT5)) ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_2_1.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_2_1.as new file mode 100644 index 00000000000..081773a0862 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_2_1.as @@ -0,0 +1,139 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.toString"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, + "Date.prototype.toString.length", + 0, + Date.prototype.toString.length ); + + var now = new Date(); + + // can't test the content of the string, but can verify that the string is + // parsable by Date.parse + + array[item++] = new TestCase( SECTION, + "Math.abs(Date.parse(now.toString()) - now.valueOf()) < 1000", + true, + Math.abs(Date.parse(now.toString()) - now.valueOf()) < 1000 ); + + array[item++] = new TestCase( SECTION, + "typeof now.toString()", + "string", + typeof now.toString() ); + // 1970 + + TZ_ADJUST = TZ_DIFF * msPerHour; + + array[item++] = new TestCase( SECTION, + "Date.parse( (new Date(0)).toString() )", + 0, + Date.parse( (new Date(0)).toString() ) ) + + array[item++] = new TestCase( SECTION, + "Date.parse( (new Date(+TZ_ADJUST+)).toString() )", + TZ_ADJUST, + Date.parse( (new Date(TZ_ADJUST)).toString() ) ) + + // 1900 + array[item++] = new TestCase( SECTION, + "Date.parse( (new Date(+TIME_1900+)).toString() )", + TIME_1900, + Date.parse( (new Date(TIME_1900)).toString() ) ) + + array[item++] = new TestCase( SECTION, + "Date.parse( (new Date(+TIME_1900 -TZ_ADJUST+)).toString() )", + TIME_1900 -TZ_ADJUST, + Date.parse( (new Date(TIME_1900 -TZ_ADJUST)).toString() ) ) + + // 2000 + array[item++] = new TestCase( SECTION, + "Date.parse( (new Date(+TIME_2000+)).toString() )", + TIME_2000, + Date.parse( (new Date(TIME_2000)).toString() ) ) + + array[item++] = new TestCase( SECTION, + "Date.parse( (new Date(+TIME_2000 -TZ_ADJUST+)).toString() )", + TIME_2000 -TZ_ADJUST, + Date.parse( (new Date(TIME_2000 -TZ_ADJUST)).toString() ) ) + + // 29 Feb 2000 + + var UTC_29_FEB_2000 = TIME_2000 + 31*msPerDay + 28*msPerDay; + array[item++] = new TestCase( SECTION, + "Date.parse( (new Date(+UTC_29_FEB_2000+)).toString() )", + UTC_29_FEB_2000, + Date.parse( (new Date(UTC_29_FEB_2000)).toString() ) ) + + array[item++] = new TestCase( SECTION, + "Date.parse( (new Date(+(UTC_29_FEB_2000-1000)+)).toString() )", + UTC_29_FEB_2000-1000, + Date.parse( (new Date(UTC_29_FEB_2000-1000)).toString() ) ) + + + array[item++] = new TestCase( SECTION, + "Date.parse( (new Date(+(UTC_29_FEB_2000-TZ_ADJUST)+)).toString() )", + UTC_29_FEB_2000-TZ_ADJUST, + Date.parse( (new Date(UTC_29_FEB_2000-TZ_ADJUST)).toString() ) ) + // 2O05 + + var UTC_1_JAN_2005 = TIME_2000 + TimeInYear(2000) + TimeInYear(2001) + + TimeInYear(2002) + TimeInYear(2003) + TimeInYear(2004); + array[item++] = new TestCase( SECTION, + "Date.parse( (new Date(+UTC_1_JAN_2005+)).toString() )", + UTC_1_JAN_2005, + Date.parse( (new Date(UTC_1_JAN_2005)).toString() ) ) + + array[item++] = new TestCase( SECTION, + "Date.parse( (new Date(+(UTC_1_JAN_2005-1000)+)).toString() )", + UTC_1_JAN_2005-1000, + Date.parse( (new Date(UTC_1_JAN_2005-1000)).toString() ) ) + + array[item++] = new TestCase( SECTION, + "Date.parse( (new Date(+(UTC_1_JAN_2005-TZ_ADJUST)+)).toString() )", + UTC_1_JAN_2005-TZ_ADJUST, + Date.parse( (new Date(UTC_1_JAN_2005-TZ_ADJUST)).toString() ) ) + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_2_2_rt.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_2_2_rt.as new file mode 100644 index 00000000000..7f461dab998 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_2_2_rt.as @@ -0,0 +1,73 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.2-2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.toString"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var OBJ = new MyObject( new Date(0) ); + thisError="no Error thrown"; + try{ + OBJ.toString(); + } + catch(e){ + thisError=e.toString(); + } + finally{ + + /*array[item++] = new TestCase( SECTION, + "var OBJ = new MyObject( new Date(0) ); OBJ.toString()", + "error", + OBJ.toString() );*/ + array[item++] = new TestCase( SECTION, + "var OBJ = new MyObject( new Date(0) ); OBJ.toString()", + "TypeError: Error #1034", + typeError(thisError) ); + } + + return array; +} +function MyObject( value ) { + this.value = value; + this.valueOf = function() { return this.value }; + this.toString = Date.prototype.toString; + return this; +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_3.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_3.as new file mode 100644 index 00000000000..2a059feee62 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_3.as @@ -0,0 +1,149 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.3"; + var VERSION = "ECMA_3"; + var TITLE = "Date.prototype.toDateString()"; + + var status = ''; + var actual = ''; + var expect = ''; + + + startTest(); + writeHeaderToLog( SECTION + " "+ TITLE); + + +//----------------------------------------------------------------------------------------------------- + var testcases = getTestCases(); +//----------------------------------------------------------------------------------------------------- + + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // first, some generic tests - + + status = "typeof (now.toDateString())"; + actual = typeof (now.toDateString()); + expect = "string"; + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = "Date.prototype.toDateString.length"; + actual = Date.prototype.toDateString.length; + expect = 0; + array[item++] = new TestCase(SECTION, status, expect, actual); + + /* Date.parse is accurate to the second; valueOf() to the millisecond. + Here we expect them to coincide, as we expect a time of exactly midnight - */ + status = "(Date.parse(now.toDateString()) - (midnight(now)).valueOf()) == 0"; + actual = (Date.parse(now.toDateString()) - (midnight(now)).valueOf()) == 0; + expect = true; + array[item++] = new TestCase(SECTION, status, expect, actual); + + + + // 1970 + addDateTestCase(0); + addDateTestCase(TZ_ADJUST); + + + // 1900 + addDateTestCase(TIME_1900); + addDateTestCase(TIME_1900 - TZ_ADJUST); + + + // 2000 + addDateTestCase(TIME_2000); + addDateTestCase(TIME_2000 - TZ_ADJUST); + + + // 29 Feb 2000 + //var UTC_29_FEB_2000=946684800000+31*86400000+28*86400000; + addDateTestCase(UTC_29_FEB_2000); + + addDateTestCase(UTC_29_FEB_2000 - 1000); + addDateTestCase(UTC_29_FEB_2000 - TZ_ADJUST); + + + // 2005 + //var msPerDay =86400000; + //var TIME_2000 = 946684800000; + //UTC_1_JAN_2005 = TIME_2000 + TimeInYear(2000) + TimeInYear(2001) + + //TimeInYear(2002) + TimeInYear(2003) + TimeInYear(2004); + /*function DaysInYear( y ) { + if ( y % 4 != 0 ) { + return 365; + } + if ( (y % 4 == 0) && (y % 100 != 0) ) { + return 366; + } + if ( (y % 100 == 0) && (y % 400 != 0) ) { + return 365; + } + if ( (y % 400 == 0) ){ + return 366; + } else { + return "ERROR: DaysInYear(" + y + ") case not covered"; + } +} + function TimeInYear( y ) { + return ( DaysInYear(y) * msPerDay ); + }*/ + addDateTestCase(UTC_1_JAN_2005); + addDateTestCase(UTC_1_JAN_2005 - 1000); + addDateTestCase(UTC_1_JAN_2005 - TZ_ADJUST); + + function addTestCase() + { + array[item++] = new TestCase( SECTION, status, expect, actual); + } + + + function addDateTestCase(date_given_in_milliseconds) + { + var givenDate = new Date(date_given_in_milliseconds); + + status = 'Date.parse( + givenDate + ).toDateString())'; + actual = Date.parse(givenDate.toDateString()); + expect = Date.parse(midnight(givenDate)); + addTestCase(); + } + return array; +} + +function midnight(givenDate) +{ + // midnight on the given date - + return new Date(givenDate.getFullYear(), givenDate.getMonth(), givenDate.getDate()); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_30_1.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_30_1.as new file mode 100644 index 00000000000..c17a65d221f --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_30_1.as @@ -0,0 +1,191 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.9.5.30-1"; + var VERSION = "ECMA_1"; + startTest(); + + writeHeaderToLog( SECTION + " Date.prototype.setHours( hour [, min, sec, ms] )"); + + var testcases = getTestCases(); + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + + addNewTestCase( 0,0,0,0,void 0, + "TDATE = new Date(0);(TDATE).setHours(0);TDATE" ); + + addNewTestCase( 28800000, 23, 59, 999,void 0, + "TDATE = new Date(28800000);(TDATE).setHours(23,59,999);TDATE" ); + + addNewTestCase( 28800000, 999, 999, void 0, void 0, + "TDATE = new Date(28800000);(TDATE).setHours(999,999);TDATE" ); + + addNewTestCase( 28800000,999,0, void 0, void 0, + "TDATE = new Date(28800000);(TDATE).setHours(999);TDATE" ); + + addNewTestCase( 28800000,-8, void 0, void 0, void 0, + "TDATE = new Date(28800000);(TDATE).setHours(-8);TDATE" ); + + addNewTestCase( 946684800000,8760, void 0, void 0, void 0, + "TDATE = new Date(946684800000);(TDATE).setHours(8760);TDATE" ); + + addNewTestCase( TIME_2000 - msPerDay, 23, 59, 59, 999, + "d = new Date( " + (TIME_2000-msPerDay) +"); d.setHours(23,59,59,999)" ); + + addNewTestCase( TIME_2000 - msPerDay, 23, 59, 59, 1000, + "d = new Date( " + (TIME_2000-msPerDay) +"); d.setHours(23,59,59,1000)" ); + + +/* + addNewTestCase( "TDATE = new Date(-2208988800000);(TDATE).setHours(59,999);TDATE", + UTCDateFromTime(SetHours(-2208988800000,59,999)), + LocalDateFromTime(SetHours(-2208988800000,59,999)) ); + + addNewTestCase( "TDATE = new Date(-2208988800000);(TDATE).setUTCMilliseconds(123456789);TDATE", + UTCDateFromTime(SetUTCMilliseconds(-2208988800000,123456789)), + LocalDateFromTime(SetUTCMilliseconds(-2208988800000,123456789)) ); + + addNewTestCase( "TDATE = new Date(-2208988800000);(TDATE).setUTCMilliseconds(123456);TDATE", + UTCDateFromTime(SetUTCMilliseconds(-2208988800000,123456)), + LocalDateFromTime(SetUTCMilliseconds(-2208988800000,123456)) ); + + addNewTestCase( "TDATE = new Date(-2208988800000);(TDATE).setUTCMilliseconds(-123456);TDATE", + UTCDateFromTime(SetUTCMilliseconds(-2208988800000,-123456)), + LocalDateFromTime(SetUTCMilliseconds(-2208988800000,-123456)) ); + + addNewTestCase( "TDATE = new Date(0);(TDATE).setUTCMilliseconds(-999);TDATE", + UTCDateFromTime(SetUTCMilliseconds(0,-999)), + LocalDateFromTime(SetUTCMilliseconds(0,-999)) ); +*/ + + + function addNewTestCase( time, hours, min, sec, ms, DateString) { + var UTCDate = UTCDateFromTime( SetHours( time, hours, min, sec, ms )); + var LocalDate = LocalDateFromTime( SetHours( time, hours, min, sec, ms )); + + var DateCase = new Date( time ); + + if ( min == void 0 ) { + DateCase.setHours( hours ); + } else { + if ( sec == void 0 ) { + DateCase.setHours( hours, min ); + } else { + if ( ms == void 0 ) { + DateCase.setHours( hours, min, sec ); + } else { + DateCase.setHours( hours, min, sec, ms ); + } + } + } + + + array[item++] = new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); + array[item++] = new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); + + array[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes,DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds,DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); + array[item++] = new TestCase( SECTION, DateString+".getDay()", LocalDate.day, DateCase.getDay() ); + array[item++] = new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); + array[item++] = new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); + + DateCase.toString = Object.prototype.toString; + array[item++] =new TestCase(SECTION,"DateCase.toString = Object.prototype.toString; DateCase.toString()","[object Date]", DateCase.toString() ); + + + array[item++] = new TestCase( SECTION, + DateString+".myToString=Object.prototype.toString;"+DateString+".myToString()", + "[object Date]", + (DateCase.myToString = Object.prototype.toString, DateCase.myToString()) ); + } + return array; +} + +function MyDate() { + this.year = 0; + this.month = 0; + this.date = 0; + this.hours = 0; + this.minutes = 0; + this.seconds = 0; + this.ms = 0; +} +function LocalDateFromTime(t) { + t = LocalTime(t); + return ( MyDateFromTime(t) ); +} +function UTCDateFromTime(t) { + return ( MyDateFromTime(t) ); +} +function MyDateFromTime( t ) { + var d = new MyDate(); + d.year = YearFromTime(t); + d.month = MonthFromTime(t); + d.date = DateFromTime(t); + d.hours = HourFromTime(t); + d.minutes = MinFromTime(t); + d.seconds = SecFromTime(t); + d.ms = msFromTime(t); + + d.day = WeekDay( t ); + d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); + d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); + + return (d); +} +function SetHours( t, hour, min, sec, ms ) { + var TIME = LocalTime(t); + var HOUR = Number(hour); + var MIN = ( min == void 0) ? MinFromTime(TIME) : Number(min); + var SEC = ( sec == void 0) ? SecFromTime(TIME) : Number(sec); + var MS = ( ms == void 0 ) ? msFromTime(TIME) : Number(ms); + var RESULT6 = MakeTime( HOUR, + MIN, + SEC, + MS ); + var UTC_TIME = UTC( MakeDate(Day(TIME), RESULT6) ); + return ( TimeClip(UTC_TIME) ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_31_1.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_31_1.as new file mode 100644 index 00000000000..37b54f821e1 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_31_1.as @@ -0,0 +1,190 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.9.5.31-1"; + var VERSION = "ECMA_1"; + startTest(); + + writeHeaderToLog( SECTION + " Date.prototype.setUTCHours(hour [, min [, sec [, ms ]]] )"); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item =0; + + addNewTestCase( 0, 0, void 0, void 0, void 0, + "TDATE = new Date(0);(TDATE).setUTCHours(0);TDATE", + UTCDateFromTime(SetUTCHours(0,0,0,0)), + LocalDateFromTime(SetUTCHours(0,0,0,0)) ); + + addNewTestCase( 28800000, 23, 59, 999, void 0, + "TDATE = new Date(28800000);(TDATE).setUTCHours(23,59,999);TDATE", + UTCDateFromTime(SetUTCHours(28800000,23,59,999)), + LocalDateFromTime(SetUTCHours(28800000,23,59,999)) ); + + addNewTestCase( 28800000,999,999, void 0, void 0, + "TDATE = new Date(28800000);(TDATE).setUTCHours(999,999);TDATE", + UTCDateFromTime(SetUTCHours(28800000,999,999)), + LocalDateFromTime(SetUTCHours(28800000,999,999)) ); + + addNewTestCase( 28800000, 999, void 0, void 0, void 0, + "TDATE = new Date(28800000);(TDATE).setUTCHours(999);TDATE", + UTCDateFromTime(SetUTCHours(28800000,999,0)), + LocalDateFromTime(SetUTCHours(28800000,999,0)) ); + + addNewTestCase( 28800000, -8670, void 0, void 0, void 0, + "TDATE = new Date(28800000);(TDATE).setUTCHours(-8670);TDATE", + UTCDateFromTime(SetUTCHours(28800000,-8670)), + LocalDateFromTime(SetUTCHours(28800000,-8670)) ); + + addNewTestCase( 946684800000, 1234567, void 0, void 0, void 0, + "TDATE = new Date(946684800000);(TDATE).setUTCHours(1234567);TDATE", + UTCDateFromTime(SetUTCHours(946684800000,1234567)), + LocalDateFromTime(SetUTCHours(946684800000,1234567)) ); + + addNewTestCase( -2208988800000, 59, 999, void 0, void 0, + "TDATE = new Date(-2208988800000);(TDATE).setUTCHours(59,999);TDATE", + UTCDateFromTime(SetUTCHours(-2208988800000,59,999)), + LocalDateFromTime(SetUTCHours(-2208988800000,59,999)) ); +/* + addNewTestCase( "TDATE = new Date(-2208988800000);(TDATE).setUTCMilliseconds(123456789);TDATE", + UTCDateFromTime(SetUTCMilliseconds(-2208988800000,123456789)), + LocalDateFromTime(SetUTCMilliseconds(-2208988800000,123456789)) ); + + addNewTestCase( "TDATE = new Date(-2208988800000);(TDATE).setUTCMilliseconds(123456);TDATE", + UTCDateFromTime(SetUTCMilliseconds(-2208988800000,123456)), + LocalDateFromTime(SetUTCMilliseconds(-2208988800000,123456)) ); + + addNewTestCase( "TDATE = new Date(-2208988800000);(TDATE).setUTCMilliseconds(-123456);TDATE", + UTCDateFromTime(SetUTCMilliseconds(-2208988800000,-123456)), + LocalDateFromTime(SetUTCMilliseconds(-2208988800000,-123456)) ); + + addNewTestCase( "TDATE = new Date(0);(TDATE).setUTCMilliseconds(-999);TDATE", + UTCDateFromTime(SetUTCMilliseconds(0,-999)), + LocalDateFromTime(SetUTCMilliseconds(0,-999)) ); +*/ + + + function addNewTestCase( time, hours, min, sec, ms, DateString, UTCDate, LocalDate) { + + var DateCase = new Date(time); + if ( min == void 0 ) { + DateCase.setUTCHours( hours ); + } else { + if ( sec == void 0 ) { + DateCase.setUTCHours( hours, min ); + } else { + if ( ms == void 0 ) { + DateCase.setUTCHours( hours, min, sec ); + } else { + DateCase.setUTCHours( hours, min, sec, ms ); + } + } + } + + // fixed_year = ( ExpectDate.year >=1900 || ExpectDate.year < 2000 ) ? ExpectDate.year - 1900 : ExpectDate.year; + + array[item++] = new TestCase( SECTION, "DateString+.getTime()", UTCDate.value, DateCase.getTime() ); + array[item++] = new TestCase( SECTION, "DateString+.valueOf()", UTCDate.value, DateCase.valueOf() ); + + array[item++] = new TestCase( SECTION, "DateString+.getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCMinutes()", UTCDate.minutes,DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCSeconds()", UTCDate.seconds,DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, "DateString+.getFullYear()", LocalDate.year, DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, "DateString+.getMonth()", LocalDate.month, DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, "DateString+.getDate()", LocalDate.date, DateCase.getDate() ); + array[item++] = new TestCase( SECTION, "DateString+.getDay()", LocalDate.day, DateCase.getDay() ); + array[item++] = new TestCase( SECTION, "DateString+.getHours()", LocalDate.hours, DateCase.getHours() ); + array[item++] = new TestCase( SECTION, "DateString+.getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, "DateString+.getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, "DateString+.getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); + + DateCase.toString = Object.prototype.toString; + array[item++] =new TestCase(SECTION,"DateCase.toString = Object.prototype.toString; DateCase.toString()","[object Date]", DateCase.toString() ); + + array[item++] = new TestCase( SECTION, + "Date.prototype.toString()", + "[object Date]", + (DateCase.myToString = Object.prototype.toString,DateCase.myToString()) ); + } + return array; +} +function MyDate() { + this.year = 0; + this.month = 0; + this.date = 0; + this.hours = 0; + this.minutes = 0; + this.seconds = 0; + this.ms = 0; +} +function LocalDateFromTime(t) { + t = LocalTime(t); + return ( MyDateFromTime(t) ); +} +function UTCDateFromTime(t) { + return ( MyDateFromTime(t) ); +} +function MyDateFromTime( t ) { + var d = new MyDate(); + d.year = YearFromTime(t); + d.month = MonthFromTime(t); + d.date = DateFromTime(t); + d.hours = HourFromTime(t); + d.minutes = MinFromTime(t); + d.seconds = SecFromTime(t); + d.ms = msFromTime(t); + + d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); + d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); + d.day = WeekDay( d.value ); + + return (d); +} +function SetUTCHours( t, hour, min, sec, ms ) { + var TIME = t; + var HOUR = Number(hour); + var MIN = ( min == void 0) ? MinFromTime(TIME) : Number(min); + var SEC = ( sec == void 0) ? SecFromTime(TIME) : Number(sec); + var MS = ( ms == void 0 ) ? msFromTime(TIME) : Number(ms); + var RESULT6 = MakeTime( HOUR, + MIN, + SEC, + MS ); + return ( TimeClip(MakeDate(Day(TIME), RESULT6)) ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_32_1.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_32_1.as new file mode 100644 index 00000000000..0377086ab9d --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_32_1.as @@ -0,0 +1,142 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.9.5.32-1"; + var VERSION = "ECMA_1"; + startTest(); + + writeHeaderToLog( SECTION + " Date.prototype.setDate(date) "); + var testcases:Array = getTestCases(); + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + addNewTestCase( 0, 1, + "TDATE = new Date(0);(TDATE).setDate(1);TDATE" ); + addNewTestCase( 0, 31, + "TDATE = new Date(0);(TDATE).setDate(31);TDATE" ); + addNewTestCase( 86400000, 31, + "TDATE = new Date(86400000);(TDATE).setDate(31);TDATE" ); + addNewTestCase( 86400000, 1, + "TDATE = new Date(86400000);(TDATE).setDate(1);TDATE" ); + addNewTestCase( 28800000, 1, + "TDATE = new Date(28800000);(TDATE).setDate(1);TDATE" ); + addNewTestCase( 28800000, 31, + "TDATE = new Date(28800000);(TDATE).setDate(31);TDATE" ); + addNewTestCase( 946684800000, 1, + "TDATE = new Date(946684800000);(TDATE).setDate(1);TDATE" ); + addNewTestCase( 946684800000,31, + "TDATE = new Date(946684800000);(TDATE).setDate(31);TDATE" ); + + addNewTestCase( -2208988800000,1, + "TDATE = new Date(-2208988800000);(TDATE).setDate(1);TDATE" ); + + addNewTestCase( -2208988800000,31, + "TDATE = new Date(-2208988800000);(TDATE).setDate(31);TDATE" ); + + function addNewTestCase( t, d, DateString ) { + var DateCase:Date = new Date( t ); + DateCase.setDate( d ); + var UTCDate = UTCDateFromTime(SetDate(t, d)); + var LocalDate=LocalDateFromTime(SetDate(t,d)); + + array[item++] = new TestCase( SECTION, "DateString+.getTime()", UTCDate.value, DateCase.getTime() ); + array[item++] = new TestCase( SECTION, "DateString+.valueOf()", UTCDate.value, DateCase.valueOf() ); + + array[item++] = new TestCase( SECTION, "DateString+.getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCMinutes()", UTCDate.minutes,DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCSeconds()", UTCDate.seconds,DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, "DateString+.getFullYear()", LocalDate.year, DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, "DateString+.getMonth()", LocalDate.month, DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, "DateString+.getDate()", LocalDate.date, DateCase.getDate() ); + array[item++] = new TestCase( SECTION, "DateString+.getDay()", LocalDate.day, DateCase.getDay() ); + array[item++] = new TestCase( SECTION, "DateString+.getHours()", LocalDate.hours, DateCase.getHours() ); + array[item++] = new TestCase( SECTION, "DateString+.getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, "DateString+.getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, "DateString+.getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); + + DateCase.toString = Object.prototype.toString; + array[item++] =new TestCase(SECTION,"DateCase.toString = Object.prototype.toString; DateCase.toString()","[object Date]", DateCase.toString() ); + + array[item++] = new TestCase( SECTION, + "DateString.toString=Object.prototype.toString;DateString.toString()", + "[object Date]", + (DateCase.myToString = Object.prototype.toString, DateCase.myToString())); + } + return array; +} +function MyDate() { + this.year = 0; + this.month = 0; + this.date = 0; + this.hours = 0; + this.minutes = 0; + this.seconds = 0; + this.ms = 0; +} +function LocalDateFromTime(t) { + t = LocalTime(t); + return ( MyDateFromTime(t) ); +} +function UTCDateFromTime(t) { + return ( MyDateFromTime(t) ); +} +function MyDateFromTime( t ) { + var d = new MyDate(); + d.year = YearFromTime(t); + d.month = MonthFromTime(t); + d.date = DateFromTime(t); + d.hours = HourFromTime(t); + d.minutes = MinFromTime(t); + d.seconds = SecFromTime(t); + d.ms = msFromTime(t); + + d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); + d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); + d.day = WeekDay( d.value ); + + return (d); +} + +function SetDate( t, date ) { + var T = LocalTime( t ); + var DATE = Number( date ); + var RESULT3 = MakeDay(YearFromTime(T), MonthFromTime(T), DATE ); + var UTC_DATE = UTC( MakeDate(RESULT3, TimeWithinDay(T)) ); + return ( TimeClip(UTC_DATE) ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_33_1.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_33_1.as new file mode 100644 index 00000000000..4fe793c6e4c --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_33_1.as @@ -0,0 +1,151 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.9.5.33-1"; + var VERSION = "ECMA_1"; + startTest(); + + writeHeaderToLog( SECTION + " Date.prototype.setUTCDate(date) "); + var testcases:Array = getTestCases(); + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + + // addNewTestCase( "TDATE = new Date(0);(TDATE).setUTCDate(31);TDATE", + TDATE = new Date(0); + (TDATE).setUTCDate(31); + + addNewTestCase( TDATE, UTCDateFromTime(SetUTCDate(0,31)), LocalDateFromTime(SetUTCDate(0,31)) ); + + + // addNewTestCase( "TDATE = new Date(0);(TDATE).setUTCDate(1);TDATE", + TDATE = new Date(0); + (TDATE).setUTCDate(1); + + addNewTestCase(TDATE, UTCDateFromTime(SetUTCDate(0,1)), LocalDateFromTime(SetUTCDate(0,1)) ); + + + // addNewTestCase( "TDATE = new Date(86400000);(TDATE).setUTCDate(1);TDATE", + TDATE = new Date(86400000); + (TDATE).setUTCDate(1); + + addNewTestCase( TDATE, UTCDateFromTime(SetUTCDate(86400000,1)), LocalDateFromTime(SetUTCDate(86400000,1)) ); + + + + + function addNewTestCase( DateString, UTCDate, LocalDate) { + var DateCase:Date = new Date(); + DateCase = DateString ; + + array[item++] = new TestCase( SECTION, "Date.getTime()", UTCDate.value, DateCase.getTime() ); + array[item++] = new TestCase( SECTION, "Date.valueOf()", UTCDate.value, DateCase.valueOf() ); + + array[item++] = new TestCase( SECTION, "Date.getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, "Date.getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, "Date.getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); + array[item++] = new TestCase( SECTION, "Date.getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, "Date.getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, "Date.getUTCMinutes()", UTCDate.minutes,DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, "Date.getUTCSeconds()", UTCDate.seconds,DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, "Date.getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, "Date.getFullYear()", LocalDate.year, DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, "Date.getMonth()", LocalDate.month, DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, "Date.getDate()", LocalDate.date, DateCase.getDate() ); + array[item++] = new TestCase( SECTION, "Date.getDay()", LocalDate.day, DateCase.getDay() ); + array[item++] = new TestCase( SECTION, "Date.getHours()", LocalDate.hours, DateCase.getHours() ); + array[item++] = new TestCase( SECTION, "Date.getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, "Date.getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, "Date.getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); + + array[item++] = new TestCase( SECTION, + "Date.toString=Object.prototype.toString;"+DateString+".toString()", + "[object Date]", + (DateCase.myToString = Object.prototype.toString, DateCase.myToString()) ); + + DateCase.toString = Object.prototype.toString; + array[item++] =new TestCase(SECTION,"DateCase.toString = Object.prototype.toString; DateCase.toString()","[object Date]", DateCase.toString() ); + + + + } + return array; +} +function MyDate() { + this.year = 0; + this.month = 0; + this.date = 0; + this.hours = 0; + this.minutes = 0; + this.seconds = 0; + this.ms = 0; +} + + +function LocalDateFromTime(t) { + t = LocalTime(t); + return ( MyDateFromTime(t) ); +} + + +function UTCDateFromTime(t) { + return ( MyDateFromTime(t) ); +} + + +function MyDateFromTime( t ) { + var d = new MyDate(); + d.year = YearFromTime(t); + d.month = MonthFromTime(t); + d.date = DateFromTime(t); + d.hours = HourFromTime(t); + d.minutes = MinFromTime(t); + d.seconds = SecFromTime(t); + d.ms = msFromTime(t); + + d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); + d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); + d.day = WeekDay( d.value ); + + return (d); +} + + +function SetUTCDate( t, date ) { + var T = t; + var DATE = Number( date ); + var RESULT3 = MakeDay(YearFromTime(T), MonthFromTime(T), DATE ); + return ( TimeClip(MakeDate(RESULT3, TimeWithinDay(t))) ); +} + diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_34_1.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_34_1.as new file mode 100644 index 00000000000..47b6b244ed3 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_34_1.as @@ -0,0 +1,531 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.9.5.34-1"; + var VERSION = "ECMA_1"; + startTest(); + + writeHeaderToLog( SECTION + " Date.prototype.setMonth(mon [, date ] )"); + + var now = (new Date()).valueOf(); + var testcases:Array = getTestCases(); + + + + test(); + + + + + +function getTestCases() { + var array = new Array(); + var item = 0; + + getFunctionCases(); + + // regression test for http://scopus.mcom.com/bugsplat/show_bug.cgi?id=112404 + var d:Date = new Date(0); + + + d.setMonth(1,1); + + + addNewTestCase( + "TDATE = new Date(0); TDATE.setMonth(1,1); TDATE", + UTCDateFromTime(SetMonth(0,1,1)), + LocalDateFromTime(SetMonth(0,1,1)) ); + + var d:Date = new Date(0); + + + d.setMonth(11); + + addNewTestCase1( + "TDATE = new Date(0); TDATE.setMonth(11); TDATE", + UTCDateFromTime(SetMonth(0,11)), + LocalDateFromTime(SetMonth(0,11)) ); + + // whatever today is + + addNewTestCase2( "TDATE = new Date(now); (TDATE).setMonth(11,31); TDATE", + UTCDateFromTime(SetMonth(now,11,31)), + LocalDateFromTime(SetMonth(now,11,31)) ); + + addNewTestCase5( "TDATE = new Date(now); (TDATE).setMonth(1); TDATE", + UTCDateFromTime(SetMonth(now,1)), + LocalDateFromTime(SetMonth(now,1)) ); + + // 1970 + + addNewTestCase3( "TDATE = new Date(0);(TDATE).setMonth(0,1);TDATE", + UTCDateFromTime(SetMonth(0,0,1)), + LocalDateFromTime(SetMonth(0,0,1)) ); + + addNewTestCase4( "TDATE = new Date("+TIME_1900+"); "+ + "(TDATE).setMonth(11,31); TDATE", + UTCDateFromTime( SetMonth(TIME_1900,11,31) ), + LocalDateFromTime( SetMonth(TIME_1900,11,31) ) ); + + addNewTestCase6( "TDATE = new Date("+TIME_1900+"); "+ + "(TDATE).setMonth(1); TDATE", + UTCDateFromTime( SetMonth(TIME_1900,1) ), + LocalDateFromTime( SetMonth(TIME_1900,1) ) ); + //2000 + + addNewTestCase7( "TDATE = new Date("+TIME_2000+");"+ + "(TDATE).setMonth(1); TDATE", + UTCDateFromTime( SetMonth(TIME_2000,1) ), + LocalDateFromTime( SetMonth(TIME_2000,1) ) ); + + addNewTestCase8( "TDATE = new Date("+TIME_2000+");"+ + "(TDATE).setMonth(11,31); TDATE", + UTCDateFromTime( SetMonth(TIME_2000,11,31) ), + LocalDateFromTime( SetMonth(TIME_2000,11,31) ) ); + + + function getFunctionCases() { + // some tests for all functions + array[item++] = new TestCase( + SECTION, + "Date.prototype.setMonth.length", + 2, + Date.prototype.setMonth.length ); + + array[item++] = new TestCase( + SECTION, + "typeof Date.prototype.setMonth", + "function", + typeof Date.prototype.setMonth ); + + } + + function addNewTestCase( DateString, UTCDate, LocalDate) { + var TDATE:Date = new Date(0); + TDATE.setMonth(1,1); + var DateCase:Date = new Date() + DateCase = TDATE; + var thisError:String = "no error"; + + array[item++] = new TestCase( SECTION, DateString+".getTime()", true, UTCDate.value == DateCase.getTime() ); + array[item++] = new TestCase( SECTION, DateString+".valueOf()", true, UTCDate.value == DateCase.valueOf() ); + + array[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", true, UTCDate.year == DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", true, UTCDate.month == DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDate()", true, UTCDate.date == DateCase.getUTCDate() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDay()", true, UTCDate.day == DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCHours()", true, UTCDate.hours == DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", true, UTCDate.minutes == DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", true, UTCDate.seconds == DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", true, UTCDate.ms == DateCase.getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, DateString+".getFullYear()", true, LocalDate.year == DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getMonth()", true, LocalDate.month == DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getDate()", true, LocalDate.date == DateCase.getDate() ); + array[item++] = new TestCase( SECTION, DateString+".getDay()", true, LocalDate.day == DateCase.getDay() ); + array[item++] = new TestCase( SECTION, DateString+".getHours()", true, LocalDate.hours == DateCase.getHours() ); + array[item++] = new TestCase( SECTION, DateString+".getMinutes()", true, LocalDate.minutes == DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getSeconds()", true, LocalDate.seconds == DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", true, LocalDate.ms == DateCase.getMilliseconds() ); + + array[item++] = new TestCase( SECTION, + DateString+".toString=Object.prototype.toString;"+DateString+".toString()", + "[object Date]",(DateCase.myString=Object.prototype.toString, + DateCase.myString()) ); + + DateCase.toString = Object.prototype.toString; + array[item++] =new TestCase(SECTION,DateString+".toString=Object.prototype.toString;"+DateString+".toString()","[object Date]", DateCase.toString() ); + + + + + } + + function addNewTestCase1( DateString, UTCDate, LocalDate) { + var TDATE:Date = new Date(0); + (TDATE).setMonth(11); + var DateCase:Date = new Date() + DateCase = TDATE; + var thisError:String = "no error"; + + array[item++] = new TestCase( SECTION, DateString+".getTime()", true, UTCDate.value == DateCase.getTime() ); + array[item++] = new TestCase( SECTION, DateString+".valueOf()", true, UTCDate.value == DateCase.valueOf() ); + + array[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", true, UTCDate.year == DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", true, UTCDate.month == DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDate()", true, UTCDate.date == DateCase.getUTCDate() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDay()", true, UTCDate.day == DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCHours()", true, UTCDate.hours == DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", true, UTCDate.minutes == DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", true, UTCDate.seconds == DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", true, UTCDate.ms == DateCase.getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, DateString+".getFullYear()", true, LocalDate.year == DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getMonth()", true, LocalDate.month == DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getDate()", true, LocalDate.date == DateCase.getDate() ); + array[item++] = new TestCase( SECTION, DateString+".getDay()", true, LocalDate.day == DateCase.getDay() ); + array[item++] = new TestCase( SECTION, DateString+".getHours()", true, LocalDate.hours == DateCase.getHours() ); + array[item++] = new TestCase( SECTION, DateString+".getMinutes()", true, LocalDate.minutes == DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getSeconds()", true, LocalDate.seconds == DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", true, LocalDate.ms == DateCase.getMilliseconds() ); + + array[item++] = new TestCase( SECTION, + DateString+".toString=Object.prototype.toString;"+DateString+".toString()", + "[object Date]",(DateCase.myString=Object.prototype.toString, + DateCase.myString()) ); + + DateCase.toString = Object.prototype.toString; + array[item++] =new TestCase(SECTION,DateString+".toString=Object.prototype.toString;"+DateString+".toString()","[object Date]", DateCase.toString() ); + + + } + + function addNewTestCase2( DateString, UTCDate, LocalDate) { + var TDATE:Date = new Date(now); + (TDATE).setMonth(11,31); + var DateCase:Date = new Date(); + DateCase = TDATE; + var thisError:String = "no error"; + + array[item++] = new TestCase( SECTION, DateString+".getTime()", true, UTCDate.value == DateCase.getTime() ); + array[item++] = new TestCase( SECTION, DateString+".valueOf()", true, UTCDate.value == DateCase.valueOf() ); + + array[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", true, UTCDate.year == DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", true, UTCDate.month == DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDate()", true, UTCDate.date == DateCase.getUTCDate() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDay()", true, UTCDate.day == DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCHours()", true, UTCDate.hours == DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", true, UTCDate. minutes ==DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", true, UTCDate.seconds ==DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", true, UTCDate.ms == DateCase.getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, DateString+".getFullYear()", true, LocalDate.year == DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getMonth()", true, LocalDate.month == DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getDate()", true, LocalDate.date == DateCase.getDate() ); + array[item++] = new TestCase( SECTION, DateString+".getDay()", true, LocalDate.day == DateCase.getDay() ); + array[item++] = new TestCase( SECTION, DateString+".getHours()", true, LocalDate.hours == DateCase.getHours() ); + array[item++] = new TestCase( SECTION, DateString+".getMinutes()", true, LocalDate.minutes == DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getSeconds()", true, LocalDate.seconds == DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", true, LocalDate.ms == DateCase.getMilliseconds() ); + + array[item++] = new TestCase( SECTION, + DateString+".toString=Object.prototype.toString;"+DateString+".toString()", + "[object Date]",(DateCase.myString = Object.prototype.toString,DateCase.myString()) ); + + DateCase.toString = Object.prototype.toString; + array[item++] =new TestCase(SECTION,DateString+".toString=Object.prototype.toString;"+DateString+".toString()","[object Date]", DateCase.toString() ); + + } + + function addNewTestCase5( DateString, UTCDate, LocalDate) { + var TDATE:Date = new Date(now); + (TDATE).setMonth(1); + var DateCase:Date = new Date(); + DateCase = TDATE; + var thisError:String = "no error"; + + array[item++] = new TestCase( SECTION, DateString+".getTime()", true, UTCDate.value == DateCase.getTime() ); + array[item++] = new TestCase( SECTION, DateString+".valueOf()", true, UTCDate.value == DateCase.valueOf() ); + + array[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", true, UTCDate.year == DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", true, UTCDate.month == DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDate()", true, UTCDate.date == DateCase.getUTCDate() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDay()", true, UTCDate.day == DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCHours()", true, UTCDate.hours == DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", true, UTCDate. minutes ==DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", true, UTCDate.seconds ==DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", true, UTCDate.ms == DateCase.getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, DateString+".getFullYear()", true, LocalDate.year == DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getMonth()", true, LocalDate.month == DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getDate()", true, LocalDate.date == DateCase.getDate() ); + array[item++] = new TestCase( SECTION, DateString+".getDay()", true, LocalDate.day == DateCase.getDay() ); + array[item++] = new TestCase( SECTION, DateString+".getHours()", true, LocalDate.hours == DateCase.getHours() ); + array[item++] = new TestCase( SECTION, DateString+".getMinutes()", true, LocalDate.minutes == DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getSeconds()", true, LocalDate.seconds == DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", true, LocalDate.ms == DateCase.getMilliseconds() ); + + array[item++] = new TestCase( SECTION, + DateString+".toString=Object.prototype.toString;"+DateString+".toString()", + "[object Date]",(DateCase.myString = Object.prototype.toString,DateCase.myString()) ); + + DateCase.toString = Object.prototype.toString; + array[item++] =new TestCase(SECTION,DateString+".toString=Object.prototype.toString;"+DateString+".toString()","[object Date]", DateCase.toString() ); + + + } + + + function addNewTestCase3( DateString, UTCDate, LocalDate) { + //DateCase = eval( DateString ); + var TDATE:Date = new Date(0); + (TDATE).setMonth(0,1); + var Datecase:Date = new Date(); + DateCase = TDATE; + var thisError:String = "no error"; + + array[item++] = new TestCase( SECTION, DateString+".getTime()", true, UTCDate.value == DateCase.getTime() ); + array[item++] = new TestCase( SECTION, DateString+".valueOf()", true, UTCDate.value == DateCase.valueOf() ); + + array[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", true, UTCDate.year == DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", true, UTCDate.month == DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDate()", true, UTCDate.date == DateCase.getUTCDate() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDay()", true, UTCDate.day == DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCHours()", true, UTCDate.hours == DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", true, UTCDate. minutes ==DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", true, UTCDate.seconds ==DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", true, UTCDate.ms == DateCase.getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, DateString+".getFullYear()", true, LocalDate.year == DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getMonth()", true, LocalDate.month == DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getDate()", true, LocalDate.date == DateCase.getDate() ); + array[item++] = new TestCase( SECTION, DateString+".getDay()", true, LocalDate.day == DateCase.getDay() ); + array[item++] = new TestCase( SECTION, DateString+".getHours()", true, LocalDate.hours == DateCase.getHours() ); + array[item++] = new TestCase( SECTION, DateString+".getMinutes()", true, LocalDate.minutes == DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getSeconds()", true, LocalDate.seconds == DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", true, LocalDate.ms == DateCase.getMilliseconds() ); + + array[item++] = new TestCase( SECTION, + DateString+".toString=Object.prototype.toString;"+DateString+".toString()", + "[object Date]",(DateCase.myString=Object.prototype.toString,DateCase.myString()) ); + + DateCase.toString = Object.prototype.toString; + array[item++] =new TestCase(SECTION,DateString+".toString=Object.prototype.toString;"+DateString+".toString()","[object Date]", DateCase.toString() ); + + + + } + + + function addNewTestCase4( DateString, UTCDate, LocalDate) { + //DateCase = eval( DateString ); + var TDATE:Date = new Date(TIME_1900); + (TDATE).setMonth(11,31); + var DateCase:Date = new Date(); + DateCase = TDATE; + var thisError:String = "no error"; + + array[item++] = new TestCase( SECTION, DateString+".getTime()", true, UTCDate.value == DateCase.getTime() ); + array[item++] = new TestCase( SECTION, DateString+".valueOf()", true, UTCDate.value == DateCase.valueOf() ); + + array[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", true, UTCDate.year == DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", true, UTCDate.month == DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDate()", true, UTCDate.date == DateCase.getUTCDate() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDay()", true, UTCDate.day == DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCHours()", true, UTCDate.hours == DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", true, UTCDate. minutes ==DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", true, UTCDate.seconds ==DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", true, UTCDate.ms == DateCase.getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, DateString+".getFullYear()", true, LocalDate.year == DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getMonth()", true, LocalDate.month == DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getDate()", true, LocalDate.date == DateCase.getDate() ); + array[item++] = new TestCase( SECTION, DateString+".getDay()", true, LocalDate.day == DateCase.getDay() ); + array[item++] = new TestCase( SECTION, DateString+".getHours()", true, LocalDate.hours == DateCase.getHours() ); + array[item++] = new TestCase( SECTION, DateString+".getMinutes()", true, LocalDate.minutes == DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getSeconds()", true, LocalDate.seconds == DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", true, LocalDate.ms == DateCase.getMilliseconds() ); + + array[item++] = new TestCase( SECTION, + DateString+".toString=Object.prototype.toString;"+DateString+".toString()", + "[object Date]",(DateCase.myString=Object.prototype.toString, + DateCase.myString() )); + + DateCase.toString = Object.prototype.toString; + array[item++] =new TestCase(SECTION,DateString+".toString=Object.prototype.toString;"+DateString+".toString()","[object Date]", DateCase.toString() ); + + + } + function addNewTestCase6( DateString, UTCDate, LocalDate) { + + var TDATE:Date = new Date(TIME_1900); + (TDATE).setMonth(1); + var DateCase:Date = new Date(); + DateCase = TDATE; + var thisError:String = "no error"; + + array[item++] = new TestCase( SECTION, DateString+".getTime()", true, UTCDate.value == DateCase.getTime() ); + array[item++] = new TestCase( SECTION, DateString+".valueOf()", true, UTCDate.value == DateCase.valueOf() ); + + array[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", true, UTCDate.year == DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", true, UTCDate.month == DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDate()", true, UTCDate.date == DateCase.getUTCDate() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDay()", true, UTCDate.day == DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCHours()", true, UTCDate.hours == DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", true, UTCDate. minutes ==DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", true, UTCDate.seconds ==DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", true, UTCDate.ms == DateCase.getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, DateString+".getFullYear()", true, LocalDate.year == DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getMonth()", true, LocalDate.month == DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getDate()", true, LocalDate.date == DateCase.getDate() ); + array[item++] = new TestCase( SECTION, DateString+".getDay()", true, LocalDate.day == DateCase.getDay() ); + array[item++] = new TestCase( SECTION, DateString+".getHours()", true, LocalDate.hours == DateCase.getHours() ); + array[item++] = new TestCase( SECTION, DateString+".getMinutes()", true, LocalDate.minutes == DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getSeconds()", true, LocalDate.seconds == DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", true, LocalDate.ms == DateCase.getMilliseconds() ); + + array[item++] = new TestCase( SECTION, + DateString+".toString=Object.prototype.toString;"+DateString+".toString()", + "[object Date]",(DateCase.myString=Object.prototype.toString, + DateCase.myString() )); + + DateCase.toString = Object.prototype.toString; + array[item++] =new TestCase(SECTION,DateString+".toString=Object.prototype.toString;"+DateString+".toString()","[object Date]", DateCase.toString() ); + + } + + function addNewTestCase8( DateString, UTCDate, LocalDate) { + + var TDATE:Date = new Date(TIME_2000); + (TDATE).setMonth(11,31); + var DateCase:Date = new Date(); + DateCase = TDATE; + var thisError:String = "no error"; + + array[item++] = new TestCase( SECTION, DateString+".getTime()", true, UTCDate.value == DateCase.getTime() ); + array[item++] = new TestCase( SECTION, DateString+".valueOf()", true, UTCDate.value == DateCase.valueOf() ); + + array[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", true, UTCDate.year == DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", true, UTCDate.month == DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDate()", true, UTCDate.date == DateCase.getUTCDate() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDay()", true, UTCDate.day == DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCHours()", true, UTCDate.hours == DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", true, UTCDate. minutes ==DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", true, UTCDate.seconds ==DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", true, UTCDate.ms == DateCase.getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, DateString+".getFullYear()", true, LocalDate.year == DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getMonth()", true, LocalDate.month == DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getDate()", true, LocalDate.date == DateCase.getDate() ); + array[item++] = new TestCase( SECTION, DateString+".getDay()", true, LocalDate.day == DateCase.getDay() ); + array[item++] = new TestCase( SECTION, DateString+".getHours()", true, LocalDate.hours == DateCase.getHours() ); + array[item++] = new TestCase( SECTION, DateString+".getMinutes()", true, LocalDate.minutes == DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getSeconds()", true, LocalDate.seconds == DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", true, LocalDate.ms == DateCase.getMilliseconds() ); + + array[item++] = new TestCase( SECTION, + DateString+".toString=Object.prototype.toString;"+DateString+".toString()", + "[object Date]",(DateCase.myString=Object.prototype.toString, + DateCase.myString() )); + + DateCase.toString = Object.prototype.toString; + array[item++] =new TestCase(SECTION,DateString+".toString=Object.prototype.toString;"+DateString+".toString()","[object Date]", DateCase.toString() ); + + } + function addNewTestCase7( DateString, UTCDate, LocalDate) { + + var TDATE:Date = new Date(TIME_2000); + (TDATE).setMonth(1); + var DateCase:Date = new Date(); + DateCase = TDATE; + var thisError:String = "no error"; + + array[item++] = new TestCase( SECTION, DateString+".getTime()", true, UTCDate.value == DateCase.getTime() ); + array[item++] = new TestCase( SECTION, DateString+".valueOf()", true, UTCDate.value == DateCase.valueOf() ); + + array[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", true, UTCDate.year == DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", true, UTCDate.month == DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDate()", true, UTCDate.date == DateCase.getUTCDate() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCDay()", true, UTCDate.day == DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCHours()", true, UTCDate.hours == DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", true, UTCDate. minutes ==DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", true, UTCDate.seconds ==DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", true, UTCDate.ms == DateCase.getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, DateString+".getFullYear()", true, LocalDate.year == DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, DateString+".getMonth()", true, LocalDate.month == DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, DateString+".getDate()", true, LocalDate.date == DateCase.getDate() ); + array[item++] = new TestCase( SECTION, DateString+".getDay()", true, LocalDate.day == DateCase.getDay() ); + array[item++] = new TestCase( SECTION, DateString+".getHours()", true, LocalDate.hours == DateCase.getHours() ); + array[item++] = new TestCase( SECTION, DateString+".getMinutes()", true, LocalDate.minutes == DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, DateString+".getSeconds()", true, LocalDate.seconds == DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", true, LocalDate.ms == DateCase.getMilliseconds() ); + + array[item++] = new TestCase( SECTION, + DateString+".toString=Object.prototype.toString;"+DateString+".toString()", + "[object Date]",(DateCase.myString=Object.prototype.toString, + DateCase.myString() )); + + DateCase.toString = Object.prototype.toString; + array[item++] =new TestCase(SECTION,DateString+".toString=Object.prototype.toString;"+DateString+".toString()","[object Date]", DateCase.toString() ); + + } + + return array; +} + +function MyDate() { + this.year = 0; + this.month = 0; + this.date = 0; + this.hours = 0; + this.minutes = 0; + this.seconds = 0; + this.ms = 0; +} + + +function LocalDateFromTime(t) { + t = LocalTime(t); + return ( MyDateFromTime(t) ); +} + + +function UTCDateFromTime(t) { + return ( MyDateFromTime(t) ); +} + + +function MyDateFromTime( t ) { + var d = new MyDate(); + d.year = YearFromTime(t); + d.month = MonthFromTime(t); + d.date = DateFromTime(t); + d.hours = HourFromTime(t); + d.minutes = MinFromTime(t); + d.seconds = SecFromTime(t); + d.ms = msFromTime(t); + + d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); + d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); + d.day = WeekDay( d.value ); + + return (d); +} + + +function SetMonth( t, mon, date ) { + var TIME = LocalTime(t); + var MONTH = Number( mon ); + var DATE = ( date == void 0 ) ? DateFromTime(TIME) : Number( date ); + var DAY = MakeDay( YearFromTime(TIME), MONTH, DATE ); + return ( TimeClip (UTC(MakeDate( DAY, TimeWithinDay(TIME) ))) ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_35_1.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_35_1.as new file mode 100644 index 00000000000..549310cf3ff --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_35_1.as @@ -0,0 +1,146 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.9.5.35-1"; + var VERSION = "ECMA_1"; + startTest(); + + writeHeaderToLog( SECTION + " Date.prototype.setUTCMonth(mon [,date] ) "); + var testcases:Array=getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + +// addNewTestCase( "TDATE = new Date(0);(TDATE).setUTCMonth(0);TDATE", + var TDATE:Date = new Date(0); + (TDATE).setUTCMonth(0); + addNewTestCase( TDATE, + UTCDateFromTime(SetUTCMonth(0,0)), + LocalDateFromTime(SetUTCMonth(0,0)) ); + + // addNewTestCase( "TDATE = new Date(0);(TDATE).setUTCMonth(11);TDATE", + var TDATE:Date = new Date(0); + (TDATE).setUTCMonth(11); + addNewTestCase(TDATE, + UTCDateFromTime(SetUTCMonth(0,11)), + LocalDateFromTime(SetUTCMonth(0,11)) ); + +// addNewTestCase( "TDATE = new Date(0);(TDATE).setUTCMonth(3,4);TDATE", + var TDATE:Date = new Date(0); + (TDATE).setUTCMonth(3,4); + addNewTestCase(TDATE, + UTCDateFromTime(SetUTCMonth(0,3,4)), + LocalDateFromTime(SetUTCMonth(0,3,4)) ); + + + + function addNewTestCase( DateString, UTCDate, LocalDate) { + + DateCase = DateString ; + + // fixed_year = ( ExpectDate.year >=1900 || ExpectDate.year < 2000 ) ? ExpectDate.year - 1900 : ExpectDate.year; + + array[item++] = new TestCase( SECTION, "DateString+.getTime()", UTCDate.value, DateCase.getTime() ); + array[item++] = new TestCase( SECTION, "DateString+.valueOf()", UTCDate.value, DateCase.valueOf() ); + + array[item++] = new TestCase( SECTION, "DateString+.getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCMinutes()", UTCDate.minutes,DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCSeconds()", UTCDate.seconds,DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, "DateString+.getFullYear()", LocalDate.year, DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, "DateString+.getMonth()", LocalDate.month, DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, "DateString+.getDate()", LocalDate.date, DateCase.getDate() ); + array[item++] = new TestCase( SECTION, "DateString+.getDay()", LocalDate.day, DateCase.getDay() ); + array[item++] = new TestCase( SECTION, "DateString+.getHours()", LocalDate.hours, DateCase.getHours() ); + array[item++] = new TestCase( SECTION, "DateString+.getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, "DateString+.getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, "DateString+.getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); + + array[item++] = new TestCase( SECTION, + "DateString+.toString=Object.prototype.toString;+DateString+.toString()", + "[object Date]",(DateCase.myToString=Object.prototype.toString,DateCase.myToString()) ); + + DateCase.toString = Object.prototype.toString; + array[item++] =new TestCase(SECTION,"DateCase.toString = Object.prototype.toString; DateCase.toString()","[object Date]", DateCase.toString() ); + + + } + return array; +} + +function MyDate() { + this.year = 0; + this.month = 0; + this.date = 0; + this.hours = 0; + this.minutes = 0; + this.seconds = 0; + this.ms = 0; +} +function LocalDateFromTime(t) { + t = LocalTime(t); + return ( MyDateFromTime(t) ); +} +function UTCDateFromTime(t) { + return ( MyDateFromTime(t) ); +} +function MyDateFromTime( t ) { + var d = new MyDate(); + d.year = YearFromTime(t); + d.month = MonthFromTime(t); + d.date = DateFromTime(t); + d.hours = HourFromTime(t); + d.minutes = MinFromTime(t); + d.seconds = SecFromTime(t); + d.ms = msFromTime(t); + + d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); + d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); + d.day = WeekDay( d.value ); + + return (d); +} +function SetUTCMonth( t, month, date ) { + var T = t; + var MONTH = Number( month ); + var DATE = ( date == void 0) ? DateFromTime(T) : Number( date ); + + var RESULT4 = MakeDay(YearFromTime(T), MONTH, DATE ); + var RESULT5 = MakeDate( RESULT4, TimeWithinDay(T)); + + return ( TimeClip(RESULT5) ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_36_1.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_36_1.as new file mode 100644 index 00000000000..4834a692806 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_36_1.as @@ -0,0 +1,232 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.9.5.36-1"; + var VERSION = "ECMA_1"; + startTest(); + + writeHeaderToLog( SECTION + " Date.prototype.setFullYear(year [, mon [, date ]] )"); + var testcases:Array = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // 1969 + + + //addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(1969);TDATE", + var TDATE:Date = new Date(0); + (TDATE).setFullYear(1969); + addNewTestCase( TDATE, + UTCDateFromTime(SetFullYear(0,1969)), + LocalDateFromTime(SetFullYear(0,1969)) ); + + + //addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(1969,11);TDATE", + var TDATE:Date = new Date(0); + (TDATE).setFullYear(1969,11); + addNewTestCase( TDATE, + UTCDateFromTime(SetFullYear(0,1969,11)), + LocalDateFromTime(SetFullYear(0,1969,11)) ); + + //addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(1969,11,31);TDATE", + var TDATE:Date = new Date(0); + (TDATE).setFullYear(1969,11,31); + addNewTestCase( TDATE, + UTCDateFromTime(SetFullYear(0,1969,11,31)), + LocalDateFromTime(SetFullYear(0,1969,11,31)) ); + + +/* + // 1970 + + addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(1970);TDATE", + UTCDateFromTime(SetFullYear(0,1970)), + LocalDateFromTime(SetFullYear(0,1970)) ); + + addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(1970,0);TDATE", + UTCDateFromTime(SetFullYear(0,1970,0)), + LocalDateFromTime(SetFullYear(0,1970,0)) ); + + addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(1970,0,1);TDATE", + UTCDateFromTime(SetFullYear(0,1970,0,1)), + LocalDateFromTime(SetFullYear(0,1970,0,1)) ); + // 1971 + addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(1971);TDATE", + UTCDateFromTime(SetFullYear(0,1971)), + LocalDateFromTime(SetFullYear(0,1971)) ); + + addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(1971,0);TDATE", + UTCDateFromTime(SetFullYear(0,1971,0)), + LocalDateFromTime(SetFullYear(0,1971,0)) ); + + addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(1971,0,1);TDATE", + UTCDateFromTime(SetFullYear(0,1971,0,1)), + LocalDateFromTime(SetFullYear(0,1971,0,1)) ); + + // 1999 + addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(1999);TDATE", + UTCDateFromTime(SetFullYear(0,1999)), + LocalDateFromTime(SetFullYear(0,1999)) ); + + addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(1999,11);TDATE", + UTCDateFromTime(SetFullYear(0,1999,11)), + LocalDateFromTime(SetFullYear(0,1999,11)) ); + + addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(1999,11,31);TDATE", + UTCDateFromTime(SetFullYear(0,1999,11,31)), + LocalDateFromTime(SetFullYear(0,1999,11,31)) ); + + // 2000 + addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(2000);TDATE", + UTCDateFromTime(SetFullYear(0,2000)), + LocalDateFromTime(SetFullYear(0,2000)) ); + + addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(2000,0);TDATE", + UTCDateFromTime(SetFullYear(0,2000,0)), + LocalDateFromTime(SetFullYear(0,2000,0)) ); + + addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(2000,0,1);TDATE", + UTCDateFromTime(SetFullYear(0,2000,0,1)), + LocalDateFromTime(SetFullYear(0,2000,0,1)) ); + + // feb 29, 2000 + addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(2000);TDATE", + UTCDateFromTime(SetFullYear(0,2000)), + LocalDateFromTime(SetFullYear(0,2000)) ); + + addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(2000,1);TDATE", + UTCDateFromTime(SetFullYear(0,2000,1)), + LocalDateFromTime(SetFullYear(0,2000,1)) ); + + addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(2000,1,29);TDATE", + UTCDateFromTime(SetFullYear(0,2000,1,29)), + LocalDateFromTime(SetFullYear(0,2000,1,29)) ); + + // Jan 1, 2005 + addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(2005);TDATE", + UTCDateFromTime(SetFullYear(0,2005)), + LocalDateFromTime(SetFullYear(0,2005)) ); + + addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(2005,0);TDATE", + UTCDateFromTime(SetFullYear(0,2005,0)), + LocalDateFromTime(SetFullYear(0,2005,0)) ); + + addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(2005,0,1);TDATE", + UTCDateFromTime(SetFullYear(0,2005,0,1)), + LocalDateFromTime(SetFullYear(0,2005,0,1)) ); + +*/ + + function addNewTestCase( DateString, UTCDate, LocalDate) { + // DateCase = ( DateString ); + var DateCase = DateString ; + + // fixed_year = ( ExpectDate.year >=1900 || ExpectDate.year < 2000 ) ? ExpectDate.year - 1900 : ExpectDate.year; + + array[item++] = new TestCase( SECTION, "DateString+.getTime()", UTCDate.value, DateCase.getTime() ); + array[item++] = new TestCase( SECTION, "DateString+.valueOf()", UTCDate.value, DateCase.valueOf() ); + + array[item++] = new TestCase( SECTION, "DateString+.getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCMinutes()", UTCDate.minutes,DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCSeconds()", UTCDate.seconds,DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, "DateString+.getFullYear()", LocalDate.year, DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, "DateString+.getMonth()", LocalDate.month, DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, "DateString+.getDate()", LocalDate.date, DateCase.getDate() ); + array[item++] = new TestCase( SECTION, "DateString+.getDay()", LocalDate.day, DateCase.getDay() ); + array[item++] = new TestCase( SECTION, "DateString+.getHours()", LocalDate.hours, DateCase.getHours() ); + array[item++] = new TestCase( SECTION, "DateString+.getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, "DateString+.getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, "DateString+.getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); + + + DateCase.toString = Object.prototype.toString; + array[item++] =new TestCase(SECTION,"DateCase.toString = Object.prototype.toString; DateCase.toString()","[object Date]", DateCase.toString() ); + + array[item++] = new TestCase( SECTION, + "DateString+.toString=Object.prototype.toString;+DateString+.toString()", + "[object Date]",(DateCase.myToString=Object.prototype.toString,DateCase.myToString()) ); + + + } + return array; +} + +function MyDate() { + this.year = 0; + this.month = 0; + this.date = 0; + this.hours = 0; + this.minutes = 0; + this.seconds = 0; + this.ms = 0; +} +function LocalDateFromTime(t) { + t = LocalTime(t); + return ( MyDateFromTime(t) ); +} +function UTCDateFromTime(t) { + return ( MyDateFromTime(t) ); +} +function MyDateFromTime( t ) { + var d = new MyDate(); + d.year = YearFromTime(t); + d.month = MonthFromTime(t); + d.date = DateFromTime(t); + d.hours = HourFromTime(t); + d.minutes = MinFromTime(t); + d.seconds = SecFromTime(t); + d.ms = msFromTime(t); + + d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); + d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); + d.day = WeekDay( d.value ); + + return (d); +} +function SetFullYear( t, year, mon, date ) { + var T = ( isNaN(t) ) ? 0 : LocalTime(t) ; + var YEAR = Number( year ); + var MONTH = ( mon == void 0 ) ? MonthFromTime(T) : Number( mon ); + var DATE = ( date == void 0 ) ? DateFromTime(T) : Number( date ); + + var DAY = MakeDay( YEAR, MONTH, DATE ); + var UTC_DATE = UTC(MakeDate( DAY, TimeWithinDay(T))); + + return ( TimeClip(UTC_DATE) ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_36_2.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_36_2.as new file mode 100644 index 00000000000..fd5ec37ff4e --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_36_2.as @@ -0,0 +1,215 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.9.5.36-2"; + var VERSION = "ECMA_1"; + startTest(); + + writeHeaderToLog( SECTION + " Date.prototype.setFullYear(year [, mon [, date ]] )"); + var testcases:Array=getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // 1970 + + //addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(1970);TDATE", + var TDATE:Date = new Date(0); + (TDATE).setFullYear(1970); + addNewTestCase( TDATE, + UTCDateFromTime(SetFullYear(0,1970)), + LocalDateFromTime(SetFullYear(0,1970)) ); + + + //addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(1970,0);TDATE", + var TDATE:Date = new Date(0); + (TDATE).setFullYear(1970,0); + addNewTestCase( TDATE, + UTCDateFromTime(SetFullYear(0,1970,0)), + LocalDateFromTime(SetFullYear(0,1970,0)) ); + + //addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(1970,0,1);TDATE", + var TDATE:Date = new Date(0); + (TDATE).setFullYear(1970,0,1); + addNewTestCase( TDATE, + UTCDateFromTime(SetFullYear(0,1970,0,1)), + LocalDateFromTime(SetFullYear(0,1970,0,1)) ); +/* + // 1971 + addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(1971);TDATE", + UTCDateFromTime(SetFullYear(0,1971)), + LocalDateFromTime(SetFullYear(0,1971)) ); + + addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(1971,0);TDATE", + UTCDateFromTime(SetFullYear(0,1971,0)), + LocalDateFromTime(SetFullYear(0,1971,0)) ); + + addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(1971,0,1);TDATE", + UTCDateFromTime(SetFullYear(0,1971,0,1)), + LocalDateFromTime(SetFullYear(0,1971,0,1)) ); + + // 1999 + addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(1999);TDATE", + UTCDateFromTime(SetFullYear(0,1999)), + LocalDateFromTime(SetFullYear(0,1999)) ); + + addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(1999,11);TDATE", + UTCDateFromTime(SetFullYear(0,1999,11)), + LocalDateFromTime(SetFullYear(0,1999,11)) ); + + addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(1999,11,31);TDATE", + UTCDateFromTime(SetFullYear(0,1999,11,31)), + LocalDateFromTime(SetFullYear(0,1999,11,31)) ); + + // 2000 + addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(2000);TDATE", + UTCDateFromTime(SetFullYear(0,2000)), + LocalDateFromTime(SetFullYear(0,2000)) ); + + addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(2000,0);TDATE", + UTCDateFromTime(SetFullYear(0,2000,0)), + LocalDateFromTime(SetFullYear(0,2000,0)) ); + + addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(2000,0,1);TDATE", + UTCDateFromTime(SetFullYear(0,2000,0,1)), + LocalDateFromTime(SetFullYear(0,2000,0,1)) ); + + // feb 29, 2000 + addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(2000);TDATE", + UTCDateFromTime(SetFullYear(0,2000)), + LocalDateFromTime(SetFullYear(0,2000)) ); + + addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(2000,1);TDATE", + UTCDateFromTime(SetFullYear(0,2000,1)), + LocalDateFromTime(SetFullYear(0,2000,1)) ); + + addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(2000,1,29);TDATE", + UTCDateFromTime(SetFullYear(0,2000,1,29)), + LocalDateFromTime(SetFullYear(0,2000,1,29)) ); + + // Jan 1, 2005 + addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(2005);TDATE", + UTCDateFromTime(SetFullYear(0,2005)), + LocalDateFromTime(SetFullYear(0,2005)) ); + + addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(2005,0);TDATE", + UTCDateFromTime(SetFullYear(0,2005,0)), + LocalDateFromTime(SetFullYear(0,2005,0)) ); + + addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(2005,0,1);TDATE", + UTCDateFromTime(SetFullYear(0,2005,0,1)), + LocalDateFromTime(SetFullYear(0,2005,0,1)) ); + +*/ + + function addNewTestCase( DateString, UTCDate, LocalDate) { + // DateCase = ( DateString ); + var DateCase = DateString ; + + // fixed_year = ( ExpectDate.year >=1900 || ExpectDate.year < 2000 ) ? ExpectDate.year - 1900 : ExpectDate.year; + + array[item++] = new TestCase( SECTION, "DateString+.getTime()", UTCDate.value, DateCase.getTime() ); + array[item++] = new TestCase( SECTION, "DateString+.valueOf()", UTCDate.value, DateCase.valueOf() ); + + array[item++] = new TestCase( SECTION, "DateString+.getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCMinutes()", UTCDate.minutes,DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCSeconds()", UTCDate.seconds,DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, "DateString+.getFullYear()", LocalDate.year, DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, "DateString+.getMonth()", LocalDate.month, DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, "DateString+.getDate()", LocalDate.date, DateCase.getDate() ); + array[item++] = new TestCase( SECTION, "DateString+.getDay()", LocalDate.day, DateCase.getDay() ); + array[item++] = new TestCase( SECTION, "DateString+.getHours()", LocalDate.hours, DateCase.getHours() ); + array[item++] = new TestCase( SECTION, "DateString+.getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, "DateString+.getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, "DateString+.getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); + + array[item++] = new TestCase( SECTION, + "DateString+.toString=Object.prototype.toString;+DateString+.toString()", + "[object Date]",(DateCase.myToString=Object.prototype.toString,DateCase.myToString()) ); + + DateCase.toString = Object.prototype.toString; + array[item++] =new TestCase(SECTION,"DateCase.toString = Object.prototype.toString; DateCase.toString()","[object Date]", DateCase.toString() ); + + + } + return array; +} + +function MyDate() { + this.year = 0; + this.month = 0; + this.date = 0; + this.hours = 0; + this.minutes = 0; + this.seconds = 0; + this.ms = 0; +} +function LocalDateFromTime(t) { + t = LocalTime(t); + return ( MyDateFromTime(t) ); +} +function UTCDateFromTime(t) { + return ( MyDateFromTime(t) ); +} +function MyDateFromTime( t ) { + var d = new MyDate(); + d.year = YearFromTime(t); + d.month = MonthFromTime(t); + d.date = DateFromTime(t); + d.hours = HourFromTime(t); + d.minutes = MinFromTime(t); + d.seconds = SecFromTime(t); + d.ms = msFromTime(t); + + d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); + d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); + d.day = WeekDay( d.value ); + + return (d); +} +function SetFullYear( t, year, mon, date ) { + var T = ( isNaN(t) ) ? 0 : LocalTime(t) ; + var YEAR = Number( year ); + var MONTH = ( mon == void 0 ) ? MonthFromTime(T) : Number( mon ); + var DATE = ( date == void 0 ) ? DateFromTime(T) : Number( date ); + + var DAY = MakeDay( YEAR, MONTH, DATE ); + var UTC_DATE = UTC(MakeDate( DAY, TimeWithinDay(T))); + + return ( TimeClip(UTC_DATE) ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_36_3.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_36_3.as new file mode 100644 index 00000000000..882faff5fdf --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_36_3.as @@ -0,0 +1,201 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.9.5.36-1"; + var VERSION = "ECMA_1"; + startTest(); + + writeHeaderToLog( SECTION + " Date.prototype.setFullYear(year [, mon [, date ]] )"); + var testcases:Array=getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // 1971 + //addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(1971);TDATE", + var TDATE:Date = new Date(0); + (TDATE).setFullYear(1971); + addNewTestCase( TDATE, + UTCDateFromTime(SetFullYear(0,1971)), + LocalDateFromTime(SetFullYear(0,1971)) ); + + //addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(1971,0);TDATE", + var TDATE:Date = new Date(0); + (TDATE).setFullYear(1971,0); + addNewTestCase( TDATE, + UTCDateFromTime(SetFullYear(0,1971,0)), + LocalDateFromTime(SetFullYear(0,1971,0)) ); + + //addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(1971,0,1);TDATE", + var TDATE:Date = new Date(0); + (TDATE).setFullYear(1971,0,1); + addNewTestCase( TDATE, + UTCDateFromTime(SetFullYear(0,1971,0,1)), + LocalDateFromTime(SetFullYear(0,1971,0,1)) ); + +/* + // 1999 + addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(1999);TDATE", + UTCDateFromTime(SetFullYear(0,1999)), + LocalDateFromTime(SetFullYear(0,1999)) ); + + addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(1999,11);TDATE", + UTCDateFromTime(SetFullYear(0,1999,11)), + LocalDateFromTime(SetFullYear(0,1999,11)) ); + + addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(1999,11,31);TDATE", + UTCDateFromTime(SetFullYear(0,1999,11,31)), + LocalDateFromTime(SetFullYear(0,1999,11,31)) ); + + // 2000 + addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(2000);TDATE", + UTCDateFromTime(SetFullYear(0,2000)), + LocalDateFromTime(SetFullYear(0,2000)) ); + + addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(2000,0);TDATE", + UTCDateFromTime(SetFullYear(0,2000,0)), + LocalDateFromTime(SetFullYear(0,2000,0)) ); + + addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(2000,0,1);TDATE", + UTCDateFromTime(SetFullYear(0,2000,0,1)), + LocalDateFromTime(SetFullYear(0,2000,0,1)) ); + + // feb 29, 2000 + addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(2000);TDATE", + UTCDateFromTime(SetFullYear(0,2000)), + LocalDateFromTime(SetFullYear(0,2000)) ); + + addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(2000,1);TDATE", + UTCDateFromTime(SetFullYear(0,2000,1)), + LocalDateFromTime(SetFullYear(0,2000,1)) ); + + addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(2000,1,29);TDATE", + UTCDateFromTime(SetFullYear(0,2000,1,29)), + LocalDateFromTime(SetFullYear(0,2000,1,29)) ); + + // Jan 1, 2005 + addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(2005);TDATE", + UTCDateFromTime(SetFullYear(0,2005)), + LocalDateFromTime(SetFullYear(0,2005)) ); + + addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(2005,0);TDATE", + UTCDateFromTime(SetFullYear(0,2005,0)), + LocalDateFromTime(SetFullYear(0,2005,0)) ); + + addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(2005,0,1);TDATE", + UTCDateFromTime(SetFullYear(0,2005,0,1)), + LocalDateFromTime(SetFullYear(0,2005,0,1)) ); + +*/ + + function addNewTestCase( DateString, UTCDate, LocalDate) { + // DateCase = ( DateString ); + var DateCase = DateString ; + + // fixed_year = ( ExpectDate.year >=1900 || ExpectDate.year < 2000 ) ? ExpectDate.year - 1900 : ExpectDate.year; + + array[item++] = new TestCase( SECTION, "DateString+.getTime()", UTCDate.value, DateCase.getTime() ); + array[item++] = new TestCase( SECTION, "DateString+.valueOf()", UTCDate.value, DateCase.valueOf() ); + + array[item++] = new TestCase( SECTION, "DateString+.getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCMinutes()", UTCDate.minutes,DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCSeconds()", UTCDate.seconds,DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, "DateString+.getFullYear()", LocalDate.year, DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, "DateString+.getMonth()", LocalDate.month, DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, "DateString+.getDate()", LocalDate.date, DateCase.getDate() ); + array[item++] = new TestCase( SECTION, "DateString+.getDay()", LocalDate.day, DateCase.getDay() ); + array[item++] = new TestCase( SECTION, "DateString+.getHours()", LocalDate.hours, DateCase.getHours() ); + array[item++] = new TestCase( SECTION, "DateString+.getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, "DateString+.getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, "DateString+.getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); + + array[item++] = new TestCase( SECTION, + "DateString+.toString=Object.prototype.toString;+DateString+.toString()", + "[object Date]",(DateCase.myToString=Object.prototype.toString,DateCase.myToString()) ); + + DateCase.toString = Object.prototype.toString; + array[item++] =new TestCase(SECTION,"DateCase.toString = Object.prototype.toString; DateCase.toString()","[object Date]", DateCase.toString() ); + + + } + return array; +} + +function MyDate() { + this.year = 0; + this.month = 0; + this.date = 0; + this.hours = 0; + this.minutes = 0; + this.seconds = 0; + this.ms = 0; +} +function LocalDateFromTime(t) { + t = LocalTime(t); + return ( MyDateFromTime(t) ); +} +function UTCDateFromTime(t) { + return ( MyDateFromTime(t) ); +} +function MyDateFromTime( t ) { + var d = new MyDate(); + d.year = YearFromTime(t); + d.month = MonthFromTime(t); + d.date = DateFromTime(t); + d.hours = HourFromTime(t); + d.minutes = MinFromTime(t); + d.seconds = SecFromTime(t); + d.ms = msFromTime(t); + + d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); + d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); + d.day = WeekDay( d.value ); + + return (d); +} +function SetFullYear( t, year, mon, date ) { + var T = ( isNaN(t) ) ? 0 : LocalTime(t) ; + var YEAR = Number( year ); + var MONTH = ( mon == void 0 ) ? MonthFromTime(T) : Number( mon ); + var DATE = ( date == void 0 ) ? DateFromTime(T) : Number( date ); + + var DAY = MakeDay( YEAR, MONTH, DATE ); + var UTC_DATE = UTC(MakeDate( DAY, TimeWithinDay(T))); + + return ( TimeClip(UTC_DATE) ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_36_4.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_36_4.as new file mode 100644 index 00000000000..427e3a6ba02 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_36_4.as @@ -0,0 +1,187 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.9.5.36-1"; + var VERSION = "ECMA_1"; + startTest(); + var testcases:Array = getTestCases(); + writeHeaderToLog( SECTION + " Date.prototype.setFullYear(year [, mon [, date ]] )"); + + + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // 1999 + //addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(1999);TDATE", + var TDATE:Date = new Date(0); + (TDATE).setFullYear(1999); + addNewTestCase(TDATE, + UTCDateFromTime(SetFullYear(0,1999)), + LocalDateFromTime(SetFullYear(0,1999)) ); + + //addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(1999,11);TDATE", + var TDATE:Date = new Date(0); + (TDATE).setFullYear(1999,11); + addNewTestCase( TDATE, + UTCDateFromTime(SetFullYear(0,1999,11)), + LocalDateFromTime(SetFullYear(0,1999,11)) ); + + //addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(1999,11,31);TDATE", + var TDATE:Date = new Date(0); + (TDATE).setFullYear(1999,11,31); + addNewTestCase( TDATE, + UTCDateFromTime(SetFullYear(0,1999,11,31)), + LocalDateFromTime(SetFullYear(0,1999,11,31)) ); + +/* + // 2000 + addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(2000);TDATE", + UTCDateFromTime(SetFullYear(0,2000)), + LocalDateFromTime(SetFullYear(0,2000)) ); + + addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(2000,0);TDATE", + UTCDateFromTime(SetFullYear(0,2000,0)), + LocalDateFromTime(SetFullYear(0,2000,0)) ); + + addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(2000,0,1);TDATE", + UTCDateFromTime(SetFullYear(0,2000,0,1)), + LocalDateFromTime(SetFullYear(0,2000,0,1)) ); + + // feb 29, 2000 + addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(2000);TDATE", + UTCDateFromTime(SetFullYear(0,2000)), + LocalDateFromTime(SetFullYear(0,2000)) ); + + addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(2000,1);TDATE", + UTCDateFromTime(SetFullYear(0,2000,1)), + LocalDateFromTime(SetFullYear(0,2000,1)) ); + + addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(2000,1,29);TDATE", + UTCDateFromTime(SetFullYear(0,2000,1,29)), + LocalDateFromTime(SetFullYear(0,2000,1,29)) ); + + // Jan 1, 2005 + addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(2005);TDATE", + UTCDateFromTime(SetFullYear(0,2005)), + LocalDateFromTime(SetFullYear(0,2005)) ); + + addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(2005,0);TDATE", + UTCDateFromTime(SetFullYear(0,2005,0)), + LocalDateFromTime(SetFullYear(0,2005,0)) ); + + addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(2005,0,1);TDATE", + UTCDateFromTime(SetFullYear(0,2005,0,1)), + LocalDateFromTime(SetFullYear(0,2005,0,1)) ); + +*/ + + function addNewTestCase( DateString, UTCDate, LocalDate) { + var DateCase = ( DateString ); + + // fixed_year = ( ExpectDate.year >=1900 || ExpectDate.year < 2000 ) ? ExpectDate.year - 1900 : ExpectDate.year; + + array[item++] = new TestCase( SECTION, "DateString+.getTime()", UTCDate.value, DateCase.getTime() ); + array[item++] = new TestCase( SECTION, "DateString+.valueOf()", UTCDate.value, DateCase.valueOf() ); + + array[item++] = new TestCase( SECTION, "DateString+.getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCMinutes()", UTCDate.minutes,DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCSeconds()", UTCDate.seconds,DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, "DateString+.getFullYear()", LocalDate.year, DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, "DateString+.getMonth()", LocalDate.month, DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, "DateString+.getDate()", LocalDate.date, DateCase.getDate() ); + array[item++] = new TestCase( SECTION, "DateString+.getDay()", LocalDate.day, DateCase.getDay() ); + array[item++] = new TestCase( SECTION, "DateString+.getHours()", LocalDate.hours, DateCase.getHours() ); + array[item++] = new TestCase( SECTION, "DateString+.getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, "DateString+.getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, "DateString+.getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); + + array[item++] = new TestCase( SECTION, + "DateString+.toString=Object.prototype.toString;+DateString+.toString()", + "[object Date]",(DateCase.myToString=Object.prototype.toString,DateCase.myToString())); + + DateCase.toString = Object.prototype.toString; + array[item++] =new TestCase(SECTION,"DateCase.toString = Object.prototype.toString; DateCase.toString()","[object Date]", DateCase.toString() ); + + } + return array; +} + +function MyDate() { + this.year = 0; + this.month = 0; + this.date = 0; + this.hours = 0; + this.minutes = 0; + this.seconds = 0; + this.ms = 0; +} +function LocalDateFromTime(t) { + t = LocalTime(t); + return ( MyDateFromTime(t) ); +} +function UTCDateFromTime(t) { + return ( MyDateFromTime(t) ); +} +function MyDateFromTime( t ) { + var d = new MyDate(); + d.year = YearFromTime(t); + d.month = MonthFromTime(t); + d.date = DateFromTime(t); + d.hours = HourFromTime(t); + d.minutes = MinFromTime(t); + d.seconds = SecFromTime(t); + d.ms = msFromTime(t); + + d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); + d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); + d.day = WeekDay( d.value ); + + return (d); +} +function SetFullYear( t, year, mon, date ) { + var T = ( isNaN(t) ) ? 0 : LocalTime(t) ; + var YEAR = Number( year ); + var MONTH = ( mon == void 0 ) ? MonthFromTime(T) : Number( mon ); + var DATE = ( date == void 0 ) ? DateFromTime(T) : Number( date ); + + var DAY = MakeDay( YEAR, MONTH, DATE ); + var UTC_DATE = UTC(MakeDate( DAY, TimeWithinDay(T))); + + return ( TimeClip(UTC_DATE) ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_36_5.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_36_5.as new file mode 100644 index 00000000000..9ca33566cfb --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_36_5.as @@ -0,0 +1,186 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.9.5.36-1"; + var VERSION = "ECMA_1"; + startTest(); + + writeHeaderToLog( SECTION + " Date.prototype.setFullYear(year [, mon [, date ]] )"); + var testcases:Array=getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // 2000 + //addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(2000);TDATE", + var TDATE:Date = new Date(0); + (TDATE).setFullYear(2000); + addNewTestCase( TDATE, + UTCDateFromTime(SetFullYear(0,2000)), + LocalDateFromTime(SetFullYear(0,2000)) ); + + //addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(2000,0);TDATE", + var TDATE:Date = new Date(0); + (TDATE).setFullYear(2000,0); + addNewTestCase( TDATE, + UTCDateFromTime(SetFullYear(0,2000,0)), + LocalDateFromTime(SetFullYear(0,2000,0)) ); + + //addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(2000,0,1);TDATE", + var TDATE:Date = new Date(0); + (TDATE).setFullYear(2000,0,1); + addNewTestCase( TDATE, + UTCDateFromTime(SetFullYear(0,2000,0,1)), + LocalDateFromTime(SetFullYear(0,2000,0,1)) ); + + + // feb 29, 2000 + var TDATE:Date = new Date(0); + (TDATE).setFullYear(2000); + addNewTestCase( TDATE, + UTCDateFromTime(SetFullYear(0,2000)), + LocalDateFromTime(SetFullYear(0,2000)) ); + var TDATE:Date = new Date(0); + (TDATE).setFullYear(2000,1); + addNewTestCase( TDATE, + UTCDateFromTime(SetFullYear(0,2000,1)), + LocalDateFromTime(SetFullYear(0,2000,1)) ); + + var TDATE:Date = new Date(0); + (TDATE).setFullYear(2000,1,29); + addNewTestCase( TDATE, + UTCDateFromTime(SetFullYear(0,2000,1,29)), + LocalDateFromTime(SetFullYear(0,2000,1,29)) ); + + // Jan 1, 2005 + var TDATE:Date = new Date(0); + (TDATE).setFullYear(2005); + addNewTestCase( TDATE, + UTCDateFromTime(SetFullYear(0,2005)), + LocalDateFromTime(SetFullYear(0,2005)) ); + + var TDATE:Date = new Date(0); + (TDATE).setFullYear(2005,0); + addNewTestCase( TDATE, + UTCDateFromTime(SetFullYear(0,2005,0)), + LocalDateFromTime(SetFullYear(0,2005,0)) ); + + var TDATE:Date = new Date(0); + (TDATE).setFullYear(2005,0,1); + addNewTestCase( TDATE, + UTCDateFromTime(SetFullYear(0,2005,0,1)), + LocalDateFromTime(SetFullYear(0,2005,0,1)) ); + + + + function addNewTestCase( DateString, UTCDate, LocalDate) { + var DateCase = ( DateString ); + + + // fixed_year = ( ExpectDate.year >=1900 || ExpectDate.year < 2000 ) ? ExpectDate.year - 1900 : ExpectDate.year; + + array[item++] = new TestCase( SECTION, "DateString+.getTime()", UTCDate.value, DateCase.getTime() ); + array[item++] = new TestCase( SECTION, "DateString+.valueOf()", UTCDate.value, DateCase.valueOf() ); + + array[item++] = new TestCase( SECTION, "DateString+.getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCMinutes()", UTCDate.minutes,DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCSeconds()", UTCDate.seconds,DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, "DateString+.getFullYear()", LocalDate.year, DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, "DateString+.getMonth()", LocalDate.month, DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, "DateString+.getDate()", LocalDate.date, DateCase.getDate() ); + array[item++] = new TestCase( SECTION, "DateString+.getDay()", LocalDate.day, DateCase.getDay() ); + array[item++] = new TestCase( SECTION, "DateString+.getHours()", LocalDate.hours, DateCase.getHours() ); + array[item++] = new TestCase( SECTION, "DateString+.getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, "DateString+.getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, "DateString+.getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); + + array[item++] = new TestCase( SECTION, + "DateString+.toString=Object.prototype.toString;+DateString+.toString()", + "[object Date]",(DateCase.myToString=Object.prototype.toString,DateCase.myToString())); + + DateCase.toString = Object.prototype.toString; + array[item++] =new TestCase(SECTION,"DateCase.toString = Object.prototype.toString; DateCase.toString()","[object Date]", DateCase.toString() ); + + + } + return array; +} + +function MyDate() { + this.year = 0; + this.month = 0; + this.date = 0; + this.hours = 0; + this.minutes = 0; + this.seconds = 0; + this.ms = 0; +} +function LocalDateFromTime(t) { + t = LocalTime(t); + return ( MyDateFromTime(t) ); +} +function UTCDateFromTime(t) { + return ( MyDateFromTime(t) ); +} +function MyDateFromTime( t ) { + var d = new MyDate(); + d.year = YearFromTime(t); + d.month = MonthFromTime(t); + d.date = DateFromTime(t); + d.hours = HourFromTime(t); + d.minutes = MinFromTime(t); + d.seconds = SecFromTime(t); + d.ms = msFromTime(t); + + d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); + d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); + d.day = WeekDay( d.value ); + + return (d); +} +function SetFullYear( t, year, mon, date ) { + var T = ( isNaN(t) ) ? 0 : LocalTime(t) ; + var YEAR = Number( year ); + var MONTH = ( mon == void 0 ) ? MonthFromTime(T) : Number( mon ); + var DATE = ( date == void 0 ) ? DateFromTime(T) : Number( date ); + + var DAY = MakeDay( YEAR, MONTH, DATE ); + var UTC_DATE = UTC(MakeDate( DAY, TimeWithinDay(T))); + + return ( TimeClip(UTC_DATE) ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_36_6.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_36_6.as new file mode 100644 index 00000000000..6866fb9695b --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_36_6.as @@ -0,0 +1,166 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.9.5.36-1"; + var VERSION = "ECMA_1"; + startTest(); + + writeHeaderToLog( SECTION + " Date.prototype.setFullYear(year [, mon [, date ]] )"); + var testcases:Array = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // feb 29, 2000 + //addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(2000);TDATE", + var TDATE:Date = new Date(0); + (TDATE).setFullYear(2000); + addNewTestCase( TDATE, + UTCDateFromTime(SetFullYear(0,2000)), + LocalDateFromTime(SetFullYear(0,2000)) ); + + //addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(2000,1);TDATE", + var TDATE:Date = new Date(0); + (TDATE).setFullYear(2000,1); + addNewTestCase( TDATE, + UTCDateFromTime(SetFullYear(0,2000,1)), + LocalDateFromTime(SetFullYear(0,2000,1)) ); + + //addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(2000,1,29);TDATE", + var TDATE:Date = new Date(0); + (TDATE).setFullYear(2000,1,29); + addNewTestCase( TDATE, + UTCDateFromTime(SetFullYear(0,2000,1,29)), + LocalDateFromTime(SetFullYear(0,2000,1,29)) ); + + + // Jan 1, 2005 + var TDATE:Date = new Date(0); + (TDATE).setFullYear(2005); + addNewTestCase( TDATE, + UTCDateFromTime(SetFullYear(0,2005)), + LocalDateFromTime(SetFullYear(0,2005)) ); + + var TDATE:Date = new Date(0); + (TDATE).setFullYear(2005,0); + addNewTestCase( TDATE, + UTCDateFromTime(SetFullYear(0,2005,0)), + LocalDateFromTime(SetFullYear(0,2005,0)) ); + var TDATE:Date = new Date(0); + (TDATE).setFullYear(2005,0,1); + addNewTestCase( TDATE, + UTCDateFromTime(SetFullYear(0,2005,0,1)), + LocalDateFromTime(SetFullYear(0,2005,0,1)) ); + + + function addNewTestCase( DateString, UTCDate, LocalDate) { + var DateCase = ( DateString ); + + // fixed_year = ( ExpectDate.year >=1900 || ExpectDate.year < 2000 ) ? ExpectDate.year - 1900 : ExpectDate.year; + + array[item++] = new TestCase( SECTION, "DateString+.getTime()", UTCDate.value, DateCase.getTime() ); + array[item++] = new TestCase( SECTION, "DateString+.valueOf()", UTCDate.value, DateCase.valueOf() ); + + array[item++] = new TestCase( SECTION, "DateString+.getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCMinutes()", UTCDate.minutes,DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCSeconds()", UTCDate.seconds,DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, "DateString+.getFullYear()", LocalDate.year, DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, "DateString+.getMonth()", LocalDate.month, DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, "DateString+.getDate()", LocalDate.date, DateCase.getDate() ); + array[item++] = new TestCase( SECTION, "DateString+.getDay()", LocalDate.day, DateCase.getDay() ); + array[item++] = new TestCase( SECTION, "DateString+.getHours()", LocalDate.hours, DateCase.getHours() ); + array[item++] = new TestCase( SECTION, "DateString+.getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, "DateString+.getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, "DateString+.getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); + + array[item++] = new TestCase( SECTION, + "DateString+.toString=Object.prototype.toString;+DateString+.toString()", + "[object Date]",(DateCase.myToString=Object.prototype.toString,DateCase.myToString())); + + DateCase.toString = Object.prototype.toString; + array[item++] =new TestCase(SECTION,"DateCase.toString = Object.prototype.toString; DateCase.toString()","[object Date]", DateCase.toString() ); + + + + } + return array; +} + +function MyDate() { + this.year = 0; + this.month = 0; + this.date = 0; + this.hours = 0; + this.minutes = 0; + this.seconds = 0; + this.ms = 0; +} +function LocalDateFromTime(t) { + t = LocalTime(t); + return ( MyDateFromTime(t) ); +} +function UTCDateFromTime(t) { + return ( MyDateFromTime(t) ); +} +function MyDateFromTime( t ) { + var d = new MyDate(); + d.year = YearFromTime(t); + d.month = MonthFromTime(t); + d.date = DateFromTime(t); + d.hours = HourFromTime(t); + d.minutes = MinFromTime(t); + d.seconds = SecFromTime(t); + d.ms = msFromTime(t); + + d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); + d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); + d.day = WeekDay( d.value ); + + return (d); +} +function SetFullYear( t, year, mon, date ) { + var T = ( isNaN(t) ) ? 0 : LocalTime(t) ; + var YEAR = Number( year ); + var MONTH = ( mon == void 0 ) ? MonthFromTime(T) : Number( mon ); + var DATE = ( date == void 0 ) ? DateFromTime(T) : Number( date ); + + var DAY = MakeDay( YEAR, MONTH, DATE ); + var UTC_DATE = UTC(MakeDate( DAY, TimeWithinDay(T))); + + return ( TimeClip(UTC_DATE) ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_36_7.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_36_7.as new file mode 100644 index 00000000000..d5c07de5b5e --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_36_7.as @@ -0,0 +1,145 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.9.5.36-1"; + var VERSION = "ECMA_1"; + startTest(); + + writeHeaderToLog( SECTION + " Date.prototype.setFullYear(year [, mon [, date ]] )"); + var testcases:Array = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // Jan 1, 2005 + // addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(2005);TDATE", + var TDATE:Date = new Date(0); + (TDATE).setFullYear(2005); + addNewTestCase( TDATE, + UTCDateFromTime(SetFullYear(0,2005)), + LocalDateFromTime(SetFullYear(0,2005)) ); + + //addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(2005,0);TDATE", + var TDATE:Date = new Date(0); + (TDATE).setFullYear(2005,0); + addNewTestCase( TDATE, + UTCDateFromTime(SetFullYear(0,2005,0)), + LocalDateFromTime(SetFullYear(0,2005,0)) ); + + //addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(2005,0,1);TDATE", + var TDATE:Date = new Date(0); + (TDATE).setFullYear(2005,0,1); + addNewTestCase( TDATE, + UTCDateFromTime(SetFullYear(0,2005,0,1)), + LocalDateFromTime(SetFullYear(0,2005,0,1)) ); + + + function addNewTestCase( DateString, UTCDate, LocalDate) { + var DateCase = DateString; + + array[item++] = new TestCase( SECTION, "DateString+.getTime()", UTCDate.value, DateCase.getTime() ); + array[item++] = new TestCase( SECTION, "DateString+.valueOf()", UTCDate.value, DateCase.valueOf() ); + + array[item++] = new TestCase( SECTION, "DateString+.getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCMinutes()", UTCDate.minutes,DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCSeconds()", UTCDate.seconds,DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, "DateString+.getFullYear()", LocalDate.year, DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, "DateString+.getMonth()", LocalDate.month, DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, "DateString+.getDate()", LocalDate.date, DateCase.getDate() ); + array[item++] = new TestCase( SECTION, "DateString+.getDay()", LocalDate.day, DateCase.getDay() ); + array[item++] = new TestCase( SECTION, "DateString+.getHours()", LocalDate.hours, DateCase.getHours() ); + array[item++] = new TestCase( SECTION, "DateString+.getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, "DateString+.getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, "DateString+.getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); + + array[item++] = new TestCase( SECTION, + "DateString+.toString=Object.prototype.toString;+DateString+.toString()", + "[object Date]",(DateCase.myToString=Object.prototype.toString, + DateCase.myToString())); + + DateCase.toString = Object.prototype.toString; + array[item++] =new TestCase(SECTION,"DateCase.toString = Object.prototype.toString; DateCase.toString()","[object Date]", DateCase.toString() ); + + + } + return array; +} + +function MyDate() { + this.year = 0; + this.month = 0; + this.date = 0; + this.hours = 0; + this.minutes = 0; + this.seconds = 0; + this.ms = 0; +} +function LocalDateFromTime(t) { + t = LocalTime(t); + return ( MyDateFromTime(t) ); +} +function UTCDateFromTime(t) { + return ( MyDateFromTime(t) ); +} +function MyDateFromTime( t ) { + var d = new MyDate(); + d.year = YearFromTime(t); + d.month = MonthFromTime(t); + d.date = DateFromTime(t); + d.hours = HourFromTime(t); + d.minutes = MinFromTime(t); + d.seconds = SecFromTime(t); + d.ms = msFromTime(t); + + d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); + d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); + d.day = WeekDay( d.value ); + + return (d); +} +function SetFullYear( t, year, mon, date ) { + var T = ( isNaN(t) ) ? 0 : LocalTime(t) ; + var YEAR = Number( year ); + var MONTH = ( mon == void 0 ) ? MonthFromTime(T) : Number( mon ); + var DATE = ( date == void 0 ) ? DateFromTime(T) : Number( date ); + + var DAY = MakeDay( YEAR, MONTH, DATE ); + var UTC_DATE = UTC(MakeDate( DAY, TimeWithinDay(T))); + + return ( TimeClip(UTC_DATE) ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_37_1.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_37_1.as new file mode 100644 index 00000000000..c605b5a4fc7 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_37_1.as @@ -0,0 +1,266 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.9.5.37-1"; + var VERSION = "ECMA_1"; + startTest(); + + writeHeaderToLog( SECTION + " Date.prototype.setUTCFullYear(year [, mon [, date ]] )"); + var testcases:Array = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // Dates around 1970 + +// addNewTestCase( "TDATE = new Date(0);(TDATE).setUTCFullYear(1970);TDATE", + var TDATE:Date = new Date(0); + (TDATE).setUTCFullYear(1970); + addNewTestCase(TDATE, + UTCDateFromTime(SetUTCFullYear(0,1970)), + LocalDateFromTime(SetUTCFullYear(0,1970)) ); + var TDATE:Date = new Date(0); + (TDATE).setUTCFullYear(1970,0,0); + addNewTestCase(TDATE, + UTCDateFromTime(SetUTCFullYear(0,1970,0,0)), + LocalDateFromTime(SetUTCFullYear(0,1970,0,0)) ); + + var TDATE:Date = new Date(0); + (TDATE).setUTCFullYear(1970,0,31); + addNewTestCase(TDATE, + UTCDateFromTime(SetUTCFullYear(0,1970,0,31)), + LocalDateFromTime(SetUTCFullYear(0,1970,0,31)) ); + + +// addNewTestCase( "TDATE = new Date(0);(TDATE).setUTCFullYear(1971);TDATE", + TDATE = new Date(0); + (TDATE).setUTCFullYear(1971); + addNewTestCase(TDATE, + UTCDateFromTime(SetUTCFullYear(0,1971)), + LocalDateFromTime(SetUTCFullYear(0,1971)) ); + +// addNewTestCase( "TDATE = new Date(0);(TDATE).setUTCFullYear(1972);TDATE", + TDATE = new Date(0); + (TDATE).setUTCFullYear(1972); + addNewTestCase(TDATE, + UTCDateFromTime(SetUTCFullYear(0,1972)), + LocalDateFromTime(SetUTCFullYear(0,1972)) ); + +// addNewTestCase( "TDATE = new Date(0);(TDATE).setUTCFullYear(1968);TDATE", + TDATE = new Date(0); + (TDATE).setUTCFullYear(1968); + addNewTestCase(TDATE, + UTCDateFromTime(SetUTCFullYear(0,1968)), + LocalDateFromTime(SetUTCFullYear(0,1968)) ); + +// addNewTestCase( "TDATE = new Date(0);(TDATE).setUTCFullYear(1969);TDATE", + TDATE = new Date(0); + (TDATE).setUTCFullYear(1969); + addNewTestCase(TDATE, + UTCDateFromTime(SetUTCFullYear(0,1969)), + LocalDateFromTime(SetUTCFullYear(0,1969)) ); + +// addNewTestCase( "TDATE = new Date(0);(TDATE).setUTCFullYear(1969);TDATE", + TDATE = new Date(0); + (TDATE).setUTCFullYear(1969); + addNewTestCase(TDATE, + UTCDateFromTime(SetUTCFullYear(0,1969)), + LocalDateFromTime(SetUTCFullYear(0,1969)) ); + + // Dates around 2000 + TDATE = new Date(0); TDATE.setUTCFullYear(2000); + + addNewTestCase( TDATE, + UTCDateFromTime(SetUTCFullYear(0,2000)), + LocalDateFromTime(SetUTCFullYear(0,2000)) ); + TDATE = new Date(0); TDATE.setUTCFullYear(2001); + addNewTestCase( TDATE, + UTCDateFromTime(SetUTCFullYear(0,2001)), + LocalDateFromTime(SetUTCFullYear(0,2001)) ); + + TDATE = new Date(0); TDATE.setUTCFullYear(1999); + + addNewTestCase( TDATE, + UTCDateFromTime(SetUTCFullYear(0,1999)), + LocalDateFromTime(SetUTCFullYear(0,1999)) ); + + // Dates around 29 February 2000 + + var UTC_FEB_29_1972 = TIME_1970 + TimeInYear(1970) + TimeInYear(1971) + + 31*msPerDay + 28*msPerDay; + + var PST_FEB_29_1972 = UTC_FEB_29_1972 - TZ_DIFF * msPerHour; + + TDATE = new Date(UTC_FEB_29_1972); + TDATE.setUTCFullYear(2000); + + addNewTestCase( TDATE, + UTCDateFromTime(SetUTCFullYear(UTC_FEB_29_1972,2000)), + LocalDateFromTime(SetUTCFullYear(UTC_FEB_29_1972,2000)) ); + + + + + TDATE = new Date(PST_FEB_29_1972); + TDATE.setUTCFullYear(2000); + + addNewTestCase( TDATE, + UTCDateFromTime(SetUTCFullYear(PST_FEB_29_1972,2000)), + LocalDateFromTime(SetUTCFullYear(PST_FEB_29_1972,2000)) ); + + TDATE = new Date(UTC_FEB_29_1972); + TDATE.setUTCFullYear(2000,1,29); + + addNewTestCase( TDATE, + UTCDateFromTime(SetUTCFullYear(UTC_FEB_29_1972,2000,1,29)), + LocalDateFromTime(SetUTCFullYear(UTC_FEB_29_1972,2000,1,29)) ); + + // Dates around 2005 + + TDATE = new Date(0); TDATE.setUTCFullYear(2005); + addNewTestCase( TDATE, + UTCDateFromTime(SetUTCFullYear(0,2005)), + LocalDateFromTime(SetUTCFullYear(0,2005)) ); + + TDATE = new Date(0); TDATE.setUTCFullYear(2004); + addNewTestCase( TDATE, + UTCDateFromTime(SetUTCFullYear(0,2004)), + LocalDateFromTime(SetUTCFullYear(0,2004)) ); + + TDATE = new Date(0); TDATE.setUTCFullYear(2006); + addNewTestCase( TDATE, + UTCDateFromTime(SetUTCFullYear(0,2006)), + LocalDateFromTime(SetUTCFullYear(0,2006)) ); + + + TDATE = new Date(0); TDATE.setUTCFullYear(1900); + // Dates around 1900 + addNewTestCase( TDATE, + UTCDateFromTime(SetUTCFullYear(0,1900)), + LocalDateFromTime(SetUTCFullYear(0,1900)) ); + + TDATE = new Date(0); TDATE.setUTCFullYear(1899); + + addNewTestCase( TDATE, + UTCDateFromTime(SetUTCFullYear(0,1899)), + LocalDateFromTime(SetUTCFullYear(0,1899)) ); + + TDATE = new Date(0); TDATE.setUTCFullYear(1901); + + addNewTestCase( TDATE, + UTCDateFromTime(SetUTCFullYear(0,1901)), + LocalDateFromTime(SetUTCFullYear(0,1901)) ); + + + + function addNewTestCase( DateString, UTCDate, LocalDate) { + DateCase = DateString; + + // fixed_year = ( ExpectDate.year >=1900 || ExpectDate.year < 2000 ) ? ExpectDate.year - 1900 : ExpectDate.year; + + array[item++] = new TestCase( SECTION, "DateString+.getTime()", UTCDate.value, DateCase.getTime() ); + array[item++] = new TestCase( SECTION, "DateString+.valueOf()", UTCDate.value, DateCase.valueOf() ); + + array[item++] = new TestCase( SECTION, "DateString+.getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCMinutes()", UTCDate.minutes,DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCSeconds()", UTCDate.seconds,DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, "DateString+.getFullYear()", LocalDate.year, DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, "DateString+.getMonth()", LocalDate.month, DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, "DateString+.getDate()", LocalDate.date, DateCase.getDate() ); + array[item++] = new TestCase( SECTION, "DateString+.getDay()", LocalDate.day, DateCase.getDay() ); + array[item++] = new TestCase( SECTION, "DateString+.getHours()", LocalDate.hours, DateCase.getHours() ); + array[item++] = new TestCase( SECTION, "DateString+.getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, "DateString+.getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, "DateString+.getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); + + + + array[item++] = new TestCase( SECTION, + "DateString+.toString=Object.prototype.toString;+DateString+.toString()", + "[object Date]",(DateCase.myToString=Object.prototype.toString,DateCase.myToString())); + + DateCase.toString = Object.prototype.toString; + array[item++] =new TestCase(SECTION,"DateCase.toString = Object.prototype.toString; DateCase.toString()","[object Date]", DateCase.toString() ); + + + + } + return array; +} + +function MyDate() { + this.year = 0; + this.month = 0; + this.date = 0; + this.hours = 0; + this.minutes = 0; + this.seconds = 0; + this.ms = 0; +} +function LocalDateFromTime(t) { + t = LocalTime(t); + return ( MyDateFromTime(t) ); +} +function UTCDateFromTime(t) { + return ( MyDateFromTime(t) ); +} +function MyDateFromTime( t ) { + var d = new MyDate(); + d.year = YearFromTime(t); + d.month = MonthFromTime(t); + d.date = DateFromTime(t); + d.hours = HourFromTime(t); + d.minutes = MinFromTime(t); + d.seconds = SecFromTime(t); + d.ms = msFromTime(t); + + d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); + d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); + d.day = WeekDay( d.value ); + + return (d); +} +function SetUTCFullYear( t, year, mon, date ) { + var T = ( t != t ) ? 0 : t; + var YEAR = Number(year); + var MONTH = ( mon == void 0 ) ? MonthFromTime(T) : Number( mon ); + var DATE = ( date == void 0 ) ? DateFromTime(T) : Number( date ); + var DAY = MakeDay( YEAR, MONTH, DATE ); + + return ( TimeClip(MakeDate(DAY, TimeWithinDay(T))) ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_37_2.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_37_2.as new file mode 100644 index 00000000000..8bcf3126788 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_37_2.as @@ -0,0 +1,193 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.9.5.37-1"; + var VERSION = "ECMA_1"; + startTest(); + + writeHeaderToLog( SECTION + " Date.prototype.setUTCFullYear(year [, mon [, date ]] )"); + var testcases:Array= getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // Dates around 2000 + +// addNewTestCase( "TDATE = new Date(0); TDATE.setUTCFullYear(2000);TDATE", + var TDATE:Date = new Date(0); + TDATE.setUTCFullYear(2000); + addNewTestCase(TDATE, + UTCDateFromTime(SetUTCFullYear(0,2000)), + LocalDateFromTime(SetUTCFullYear(0,2000)) ); + +// addNewTestCase( "TDATE = new Date(0); TDATE.setUTCFullYear(2001);TDATE", + TDATE = new Date(0); + TDATE.setUTCFullYear(2001); + addNewTestCase(TDATE, + UTCDateFromTime(SetUTCFullYear(0,2001)), + LocalDateFromTime(SetUTCFullYear(0,2001)) ); + +// addNewTestCase( "TDATE = new Date(0); TDATE.setUTCFullYear(1999);TDATE", + TDATE = new Date(0); + TDATE.setUTCFullYear(1999); + addNewTestCase(TDATE, + UTCDateFromTime(SetUTCFullYear(0,1999)), + LocalDateFromTime(SetUTCFullYear(0,1999)) ); +/* + // Dates around 29 February 2000 + + var UTC_FEB_29_1972 = TIME_1970 + TimeInYear(1970) + TimeInYear(1971) + + 31*msPerDay + 28*msPerDay; + + var PST_FEB_29_1972 = UTC_FEB_29_1972 - TZ_DIFF * msPerHour; + + addNewTestCase( "TDATE = new Date("+UTC_FEB_29_1972+"); "+ + "TDATE.setUTCFullYear(2000);TDATE", + UTCDateFromTime(SetUTCFullYear(UTC_FEB_29_1972,2000)), + LocalDateFromTime(SetUTCFullYear(UTC_FEB_29_1972,2000)) ); + + addNewTestCase( "TDATE = new Date("+PST_FEB_29_1972+"); "+ + "TDATE.setUTCFullYear(2000);TDATE", + UTCDateFromTime(SetUTCFullYear(PST_FEB_29_1972,2000)), + LocalDateFromTime(SetUTCFullYear(PST_FEB_29_1972,2000)) ); + + // Dates around 2005 + + addNewTestCase( "TDATE = new Date(0); TDATE.setUTCFullYear(2005);TDATE", + UTCDateFromTime(SetUTCFullYear(0,2005)), + LocalDateFromTime(SetUTCFullYear(0,2005)) ); + + addNewTestCase( "TDATE = new Date(0); TDATE.setUTCFullYear(2004);TDATE", + UTCDateFromTime(SetUTCFullYear(0,2004)), + LocalDateFromTime(SetUTCFullYear(0,2004)) ); + + addNewTestCase( "TDATE = new Date(0); TDATE.setUTCFullYear(2006);TDATE", + UTCDateFromTime(SetUTCFullYear(0,2006)), + LocalDateFromTime(SetUTCFullYear(0,2006)) ); + + + // Dates around 1900 + addNewTestCase( "TDATE = new Date(0); TDATE.setUTCFullYear(1900);TDATE", + UTCDateFromTime(SetUTCFullYear(0,1900)), + LocalDateFromTime(SetUTCFullYear(0,1900)) ); + + addNewTestCase( "TDATE = new Date(0); TDATE.setUTCFullYear(1899);TDATE", + UTCDateFromTime(SetUTCFullYear(0,1899)), + LocalDateFromTime(SetUTCFullYear(0,1899)) ); + + addNewTestCase( "TDATE = new Date(0); TDATE.setUTCFullYear(1901);TDATE", + UTCDateFromTime(SetUTCFullYear(0,1901)), + LocalDateFromTime(SetUTCFullYear(0,1901)) ); + +*/ + + function addNewTestCase( DateString, UTCDate, LocalDate) { + // DateCase = ( DateString ); + var DateCase = DateString ; + + // fixed_year = ( ExpectDate.year >=1900 || ExpectDate.year < 2000 ) ? ExpectDate.year - 1900 : ExpectDate.year; + + array[item++] = new TestCase( SECTION, "DateString+.getTime()", UTCDate.value, DateCase.getTime() ); + array[item++] = new TestCase( SECTION, "DateString+.valueOf()", UTCDate.value, DateCase.valueOf() ); + + array[item++] = new TestCase( SECTION, "DateString+.getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCMinutes()", UTCDate.minutes,DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCSeconds()", UTCDate.seconds,DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, "DateString+.getFullYear()", LocalDate.year, DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, "DateString+.getMonth()", LocalDate.month, DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, "DateString+.getDate()", LocalDate.date, DateCase.getDate() ); + array[item++] = new TestCase( SECTION, "DateString+.getDay()", LocalDate.day, DateCase.getDay() ); + array[item++] = new TestCase( SECTION, "DateString+.getHours()", LocalDate.hours, DateCase.getHours() ); + array[item++] = new TestCase( SECTION, "DateString+.getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, "DateString+.getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, "DateString+.getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); + + array[item++] = new TestCase( SECTION, + "DateString+.myToString=Object.prototype.toString;+DateString+.toString()", + "[object Date]",(DateCase.myToString=Object.prototype.toString, + DateCase.myToString())); + + DateCase.toString = Object.prototype.toString; + array[item++] =new TestCase(SECTION,"DateCase.toString = Object.prototype.toString; DateCase.toString()","[object Date]", DateCase.toString() ); + + + } + return array; +} + +function MyDate() { + this.year = 0; + this.month = 0; + this.date = 0; + this.hours = 0; + this.minutes = 0; + this.seconds = 0; + this.ms = 0; +} +function LocalDateFromTime(t) { + t = LocalTime(t); + return ( MyDateFromTime(t) ); +} +function UTCDateFromTime(t) { + return ( MyDateFromTime(t) ); +} +function MyDateFromTime( t ) { + var d = new MyDate(); + d.year = YearFromTime(t); + d.month = MonthFromTime(t); + d.date = DateFromTime(t); + d.hours = HourFromTime(t); + d.minutes = MinFromTime(t); + d.seconds = SecFromTime(t); + d.ms = msFromTime(t); + + d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); + d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); + d.day = WeekDay( d.value ); + + return (d); +} +function SetUTCFullYear( t, year, mon, date ) { + var T = ( t != t ) ? 0 : t; + var YEAR = Number(year); + var MONTH = ( mon == void 0 ) ? MonthFromTime(T) : Number( mon ); + var DATE = ( date == void 0 ) ? DateFromTime(T) : Number( date ); + var DAY = MakeDay( YEAR, MONTH, DATE ); + + return ( TimeClip(MakeDate(DAY, TimeWithinDay(T))) ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_37_3.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_37_3.as new file mode 100644 index 00000000000..d31863e47e2 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_37_3.as @@ -0,0 +1,173 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.9.5.37-1"; + var VERSION = "ECMA_1"; + startTest(); + + writeHeaderToLog( SECTION + " Date.prototype.setUTCFullYear(year [, mon [, date ]] )"); + var testcases:Array = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // Dates around 29 February 2000 + + var UTC_FEB_29_1972 = TIME_1970 + TimeInYear(1970) + TimeInYear(1971) + + 31*msPerDay + 28*msPerDay; + + var PST_FEB_29_1972 = UTC_FEB_29_1972 - TZ_DIFF * msPerHour; + + //addNewTestCase( "TDATE = new Date("+UTC_FEB_29_1972+"); "+"TDATE.setUTCFullYear(2000);TDATE", + TDATE = new Date(UTC_FEB_29_1972); + TDATE.setUTCFullYear(2000); + addNewTestCase( TDATE, + UTCDateFromTime(SetUTCFullYear(UTC_FEB_29_1972,2000)), + LocalDateFromTime(SetUTCFullYear(UTC_FEB_29_1972,2000)) ); + + //addNewTestCase( "TDATE = new Date("+PST_FEB_29_1972+"); "+"TDATE.setUTCFullYear(2000);TDATE", + TDATE = new Date(PST_FEB_29_1972); + TDATE.setUTCFullYear(2000); + addNewTestCase(TDATE, + UTCDateFromTime(SetUTCFullYear(PST_FEB_29_1972,2000)), + LocalDateFromTime(SetUTCFullYear(PST_FEB_29_1972,2000)) ); +/* + // Dates around 2005 + + addNewTestCase( "TDATE = new Date(0); TDATE.setUTCFullYear(2005);TDATE", + UTCDateFromTime(SetUTCFullYear(0,2005)), + LocalDateFromTime(SetUTCFullYear(0,2005)) ); + + addNewTestCase( "TDATE = new Date(0); TDATE.setUTCFullYear(2004);TDATE", + UTCDateFromTime(SetUTCFullYear(0,2004)), + LocalDateFromTime(SetUTCFullYear(0,2004)) ); + + addNewTestCase( "TDATE = new Date(0); TDATE.setUTCFullYear(2006);TDATE", + UTCDateFromTime(SetUTCFullYear(0,2006)), + LocalDateFromTime(SetUTCFullYear(0,2006)) ); + + + // Dates around 1900 + addNewTestCase( "TDATE = new Date(0); TDATE.setUTCFullYear(1900);TDATE", + UTCDateFromTime(SetUTCFullYear(0,1900)), + LocalDateFromTime(SetUTCFullYear(0,1900)) ); + + addNewTestCase( "TDATE = new Date(0); TDATE.setUTCFullYear(1899);TDATE", + UTCDateFromTime(SetUTCFullYear(0,1899)), + LocalDateFromTime(SetUTCFullYear(0,1899)) ); + + addNewTestCase( "TDATE = new Date(0); TDATE.setUTCFullYear(1901);TDATE", + UTCDateFromTime(SetUTCFullYear(0,1901)), + LocalDateFromTime(SetUTCFullYear(0,1901)) ); + +*/ + + function addNewTestCase( DateString, UTCDate, LocalDate) { + var DateCase = ( DateString ); + + + // fixed_year = ( ExpectDate.year >=1900 || ExpectDate.year < 2000 ) ? ExpectDate.year - 1900 : ExpectDate.year; + + array[item++] = new TestCase( SECTION, "DateString+.getTime()", UTCDate.value, DateCase.getTime() ); + array[item++] = new TestCase( SECTION, "DateString+.valueOf()", UTCDate.value, DateCase.valueOf() ); + + array[item++] = new TestCase( SECTION, "DateString+.getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCMinutes()", UTCDate.minutes,DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCSeconds()", UTCDate.seconds,DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, "DateString+.getFullYear()", LocalDate.year, DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, "DateString+.getMonth()", LocalDate.month, DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, "DateString+.getDate()", LocalDate.date, DateCase.getDate() ); + array[item++] = new TestCase( SECTION, "DateString+.getDay()", LocalDate.day, DateCase.getDay() ); + array[item++] = new TestCase( SECTION, "DateString+.getHours()", LocalDate.hours, DateCase.getHours() ); + array[item++] = new TestCase( SECTION, "DateString+.getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, "DateString+.getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, "DateString+.getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); + + array[item++] = new TestCase( SECTION, + "DateString+.myToString=Object.prototype.toString;+DateString+.toString()", + "[object Date]",(DateCase.myToString=Object.prototype.toString, + DateCase.myToString())); + + DateCase.toString = Object.prototype.toString; + array[item++] =new TestCase(SECTION,"DateCase.toString = Object.prototype.toString; DateCase.toString()","[object Date]", DateCase.toString() ); + + } + return array; +} + +function MyDate() { + this.year = 0; + this.month = 0; + this.date = 0; + this.hours = 0; + this.minutes = 0; + this.seconds = 0; + this.ms = 0; +} +function LocalDateFromTime(t) { + t = LocalTime(t); + return ( MyDateFromTime(t) ); +} +function UTCDateFromTime(t) { + return ( MyDateFromTime(t) ); +} +function MyDateFromTime( t ) { + var d = new MyDate(); + d.year = YearFromTime(t); + d.month = MonthFromTime(t); + d.date = DateFromTime(t); + d.hours = HourFromTime(t); + d.minutes = MinFromTime(t); + d.seconds = SecFromTime(t); + d.ms = msFromTime(t); + + d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); + d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); + d.day = WeekDay( d.value ); + + return (d); +} +function SetUTCFullYear( t, year, mon, date ) { + var T = ( t != t ) ? 0 : t; + var YEAR = Number(year); + var MONTH = ( mon == void 0 ) ? MonthFromTime(T) : Number( mon ); + var DATE = ( date == void 0 ) ? DateFromTime(T) : Number( date ); + var DAY = MakeDay( YEAR, MONTH, DATE ); + + return ( TimeClip(MakeDate(DAY, TimeWithinDay(T))) ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_37_4.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_37_4.as new file mode 100644 index 00000000000..29068778037 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_37_4.as @@ -0,0 +1,160 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.9.5.37-1"; + var VERSION = "ECMA_1"; + startTest(); + + writeHeaderToLog( SECTION + " Date.prototype.setUTCFullYear(year [, mon [, date ]] )"); + var testcases:Array=getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + // Dates around 2005 + +// addNewTestCase( "TDATE = new Date(0); TDATE.setUTCFullYear(2005);TDATE", + var TDATE:Date = new Date(0); + TDATE.setUTCFullYear(2005); + addNewTestCase(TDATE, + UTCDateFromTime(SetUTCFullYear(0,2005)), + LocalDateFromTime(SetUTCFullYear(0,2005)) ); + +// addNewTestCase( "TDATE = new Date(0); TDATE.setUTCFullYear(2004);TDATE", + TDATE = new Date(0); + TDATE.setUTCFullYear(2004); + addNewTestCase(TDATE, + UTCDateFromTime(SetUTCFullYear(0,2004)), + LocalDateFromTime(SetUTCFullYear(0,2004)) ); + +// addNewTestCase( "TDATE = new Date(0); TDATE.setUTCFullYear(2006);TDATE", + TDATE = new Date(0); + TDATE.setUTCFullYear(2006); + addNewTestCase(TDATE, + UTCDateFromTime(SetUTCFullYear(0,2006)), + LocalDateFromTime(SetUTCFullYear(0,2006)) ); + +/* + // Dates around 1900 + addNewTestCase( "TDATE = new Date(0); TDATE.setUTCFullYear(1900);TDATE", + UTCDateFromTime(SetUTCFullYear(0,1900)), + LocalDateFromTime(SetUTCFullYear(0,1900)) ); + + addNewTestCase( "TDATE = new Date(0); TDATE.setUTCFullYear(1899);TDATE", + UTCDateFromTime(SetUTCFullYear(0,1899)), + LocalDateFromTime(SetUTCFullYear(0,1899)) ); + + addNewTestCase( "TDATE = new Date(0); TDATE.setUTCFullYear(1901);TDATE", + UTCDateFromTime(SetUTCFullYear(0,1901)), + LocalDateFromTime(SetUTCFullYear(0,1901)) ); + +*/ + + function addNewTestCase( DateString, UTCDate, LocalDate) { + // DateCase = ( DateString ); + var DateCase = DateString ; + + // fixed_year = ( ExpectDate.year >=1900 || ExpectDate.year < 2000 ) ? ExpectDate.year - 1900 : ExpectDate.year; + + array[item++] = new TestCase( SECTION, "DateString+.getTime()", UTCDate.value, DateCase.getTime() ); + array[item++] = new TestCase( SECTION, "DateString+.valueOf()", UTCDate.value, DateCase.valueOf() ); + + array[item++] = new TestCase( SECTION, "DateString+.getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCMinutes()", UTCDate.minutes,DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCSeconds()", UTCDate.seconds,DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, "DateString+.getFullYear()", LocalDate.year, DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, "DateString+.getMonth()", LocalDate.month, DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, "DateString+.getDate()", LocalDate.date, DateCase.getDate() ); + array[item++] = new TestCase( SECTION, "DateString+.getDay()", LocalDate.day, DateCase.getDay() ); + array[item++] = new TestCase( SECTION, "DateString+.getHours()", LocalDate.hours, DateCase.getHours() ); + array[item++] = new TestCase( SECTION, "DateString+.getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, "DateString+.getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, "DateString+.getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); + + array[item++] = new TestCase( SECTION, + "DateString+.toString=Object.prototype.toString;+DateString+.toString()", + "[object Date]",(DateCase.myToString=Object.prototype.toString,DateCase.myToString())); + + DateCase.toString = Object.prototype.toString; + array[item++] =new TestCase(SECTION,"DateCase.toString = Object.prototype.toString; DateCase.toString()","[object Date]", DateCase.toString() ); + + + } + return array; +} + +function MyDate() { + this.year = 0; + this.month = 0; + this.date = 0; + this.hours = 0; + this.minutes = 0; + this.seconds = 0; + this.ms = 0; +} +function LocalDateFromTime(t) { + t = LocalTime(t); + return ( MyDateFromTime(t) ); +} +function UTCDateFromTime(t) { + return ( MyDateFromTime(t) ); +} +function MyDateFromTime( t ) { + var d = new MyDate(); + d.year = YearFromTime(t); + d.month = MonthFromTime(t); + d.date = DateFromTime(t); + d.hours = HourFromTime(t); + d.minutes = MinFromTime(t); + d.seconds = SecFromTime(t); + d.ms = msFromTime(t); + + d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); + d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); + d.day = WeekDay( d.value ); + + return (d); +} +function SetUTCFullYear( t, year, mon, date ) { + var T = ( t != t ) ? 0 : t; + var YEAR = Number(year); + var MONTH = ( mon == void 0 ) ? MonthFromTime(T) : Number( mon ); + var DATE = ( date == void 0 ) ? DateFromTime(T) : Number( date ); + var DAY = MakeDay( YEAR, MONTH, DATE ); + + return ( TimeClip(MakeDate(DAY, TimeWithinDay(T))) ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_37_5.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_37_5.as new file mode 100644 index 00000000000..228ad3ae01a --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_37_5.as @@ -0,0 +1,146 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.9.5.37-1"; + var VERSION = "ECMA_1"; + startTest(); + + writeHeaderToLog( SECTION + " Date.prototype.setUTCFullYear(year [, mon [, date ]] )"); + var testcases:Array = getTestCases(); + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + + // Dates around 1900 +// addNewTestCase( "TDATE = new Date(0); TDATE.setUTCFullYear(1900);TDATE", + var TDATE:Date = new Date(0); + TDATE.setUTCFullYear(1900); + addNewTestCase(TDATE, + UTCDateFromTime(SetUTCFullYear(0,1900)), + LocalDateFromTime(SetUTCFullYear(0,1900)) ); + +// addNewTestCase( "TDATE = new Date(0); TDATE.setUTCFullYear(1899);TDATE", + TDATE = new Date(0); + TDATE.setUTCFullYear(1899); + addNewTestCase(TDATE, + UTCDateFromTime(SetUTCFullYear(0,1899)), + LocalDateFromTime(SetUTCFullYear(0,1899)) ); + +// addNewTestCase( "TDATE = new Date(0); TDATE.setUTCFullYear(1901);TDATE", + TDATE = new Date(0); + TDATE.setUTCFullYear(1901); + addNewTestCase(TDATE, + UTCDateFromTime(SetUTCFullYear(0,1901)), + LocalDateFromTime(SetUTCFullYear(0,1901)) ); + + function addNewTestCase( DateString, UTCDate, LocalDate) { + // DateCase = ( DateString ); + var DateCase = DateString ; + + // fixed_year = ( ExpectDate.year >=1900 || ExpectDate.year < 2000 ) ? ExpectDate.year - 1900 : ExpectDate.year; + + array[item++] = new TestCase( SECTION, "DateString+.getTime()", UTCDate.value, DateCase.getTime() ); + array[item++] = new TestCase( SECTION, "DateString+.valueOf()", UTCDate.value, DateCase.valueOf() ); + + array[item++] = new TestCase( SECTION, "DateString+.getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCMinutes()", UTCDate.minutes,DateCase.getUTCMinutes() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCSeconds()", UTCDate.seconds,DateCase.getUTCSeconds() ); + array[item++] = new TestCase( SECTION, "DateString+.getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); + + array[item++] = new TestCase( SECTION, "DateString+.getFullYear()", LocalDate.year, DateCase.getFullYear() ); + array[item++] = new TestCase( SECTION, "DateString+.getMonth()", LocalDate.month, DateCase.getMonth() ); + array[item++] = new TestCase( SECTION, "DateString+.getDate()", LocalDate.date, DateCase.getDate() ); + array[item++] = new TestCase( SECTION, "DateString+.getDay()", LocalDate.day, DateCase.getDay() ); + array[item++] = new TestCase( SECTION, "DateString+.getHours()", LocalDate.hours, DateCase.getHours() ); + array[item++] = new TestCase( SECTION, "DateString+.getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); + array[item++] = new TestCase( SECTION, "DateString+.getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); + array[item++] = new TestCase( SECTION, "DateString+.getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); + + array[item++] = new TestCase( SECTION, + "DateString+.myToString=Object.prototype.toString;+DateString+.toString()", + "[object Date]",(DateCase.myToString=Object.prototype.toString, + DateCase.myToString())); + + DateCase.toString = Object.prototype.toString; + array[item++] =new TestCase(SECTION,"DateCase.toString = Object.prototype.toString; DateCase.toString()","[object Date]", DateCase.toString() ); + + + } + return array; +} + +function MyDate() { + this.year = 0; + this.month = 0; + this.date = 0; + this.hours = 0; + this.minutes = 0; + this.seconds = 0; + this.ms = 0; +} +function LocalDateFromTime(t) { + t = LocalTime(t); + return ( MyDateFromTime(t) ); +} +function UTCDateFromTime(t) { + return ( MyDateFromTime(t) ); +} +function MyDateFromTime( t ) { + var d = new MyDate(); + d.year = YearFromTime(t); + d.month = MonthFromTime(t); + d.date = DateFromTime(t); + d.hours = HourFromTime(t); + d.minutes = MinFromTime(t); + d.seconds = SecFromTime(t); + d.ms = msFromTime(t); + + d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); + d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); + d.day = WeekDay( d.value ); + + return (d); +} +function SetUTCFullYear( t, year, mon, date ) { + var T = ( t != t ) ? 0 : t; + var YEAR = Number(year); + var MONTH = ( mon == void 0 ) ? MonthFromTime(T) : Number( mon ); + var DATE = ( date == void 0 ) ? DateFromTime(T) : Number( date ); + var DAY = MakeDay( YEAR, MONTH, DATE ); + + return ( TimeClip(MakeDate(DAY, TimeWithinDay(T))) ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_3_1_rt.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_3_1_rt.as new file mode 100644 index 00000000000..2669a20b941 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_3_1_rt.as @@ -0,0 +1,79 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.3-1-n"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.valueOf"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + //var OBJ = new MyObject( new Date(0) ); + thisError="no error thrown"; + try{ + var OBJ = new MyObject( new Date(0) ); + OBJ.valueOf(); + } + catch(e){ + thisError=e.toString(); + } + finally{ + + + /*array[item++] = new TestCase( SECTION, + "var OBJ = new MyObject( new Date(0) ); OBJ.valueOf()", + "error", + OBJ.valueOf() );*/ + array[item++] = new TestCase( SECTION, + "var OBJ = new MyObject( new Date(0) ); OBJ.valueOf()", + "TypeError: Error #1034", + typeError(thisError)); + + } + return array; +} + +function MyObject( value ) { + this.value = value; + this.valueOf = Date.prototype.valueOf; +// The following line causes an infinte loop. +// Might have been due to the new Function(). +// Changed this to function() { } +// this.toString = function() { "return this+\"\";" }; + return this; +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_3_2.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_3_2.as new file mode 100644 index 00000000000..b2b37dcea75 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_3_2.as @@ -0,0 +1,126 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.3-2"; + var VERSION = "ECMA_4"; + startTest(); + var TITLE = "Date.prototype.valueOf"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + + var TZ_ADJUST = TZ_DIFF * msPerHour; + var now = (new Date()).valueOf(); + var UTC_29_FEB_2000 = TIME_2000 + 31*msPerDay + 28*msPerDay; + var UTC_1_JAN_2005 = TIME_2000 + TimeInYear(2000) + TimeInYear(2001)+ + TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004); + + addTestCase2( now ); + addTestCase( TIME_1970 ); + addTestCase( TIME_1900 ); + addTestCase( TIME_2000 ); + addTestCase( UTC_29_FEB_2000 ); + addTestCase( UTC_1_JAN_2005 ); + + + function addTestCase( t ) { + array[item++] = new TestCase( SECTION, + "(new Date(+t+).valueOf()", + true, t == + (new Date(t)).valueOf() ); + + array[item++] = new TestCase( SECTION, + "(new Date(+(t+1)+).valueOf()", + true, t+1 == + (new Date(t+1)).valueOf() ); + + array[item++] = new TestCase( SECTION, + "(new Date(+(t-1)+).valueOf()", + true,t-1 == + (new Date(t-1)).valueOf() ); + + array[item++] = new TestCase( SECTION, + "(new Date(+(t-TZ_ADJUST)+).valueOf()", + true, t-TZ_ADJUST == + (new Date(t-TZ_ADJUST)).valueOf() ); + + array[item++] = new TestCase( SECTION, + "(new Date(+(t+TZ_ADJUST)+).valueOf()", + true, t+TZ_ADJUST == + (new Date(t+TZ_ADJUST)).valueOf() ); + } + + + // only used for current date and time + function addTestCase2( t ) { + array[item++] = new TestCase( SECTION, + "(new Date(now).valueOf()", + true, t == + (new Date(t)).valueOf() ); + + array[item++] = new TestCase( SECTION, + "(new Date(now+1).valueOf()", + true, t+1 == + (new Date(t+1)).valueOf() ); + + array[item++] = new TestCase( SECTION, + "(new Date(now-1).valueOf()", + true, t-1 == + (new Date(t-1)).valueOf() ); + + array[item++] = new TestCase( SECTION, + "(new Date(now-TZ_ADJUST).valueOf()", + true, t-TZ_ADJUST== + (new Date(t-TZ_ADJUST)).valueOf() ); + + array[item++] = new TestCase( SECTION, + "(new Date(now+TZ_ADJUST).valueOf()", + true, t+TZ_ADJUST == + (new Date(t+TZ_ADJUST)).valueOf() ); + } + return array; +} +function MyObject( value ) { + this.value = value; + this.valueOf = Date.prototype.valueOf; + +// Changed new Function() to function() { } + this.toString = function() { "return this+\"\";" }; + return this; +} + diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_4.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_4.as new file mode 100644 index 00000000000..86b269f1e0a --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_4.as @@ -0,0 +1,172 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +//----------------------------------------------------------------------------- +var SECTION = "15.9.5.4"; +var VERSION = "ECMA_3"; +var TITLE = "Date.prototype.toTimeString()"; + +var status = ''; +var actual = ''; +var expect = ''; +var givenDate; +var year = ''; +var regexp = ''; +var reducedDateString = ''; +var hopeThisIsTimeString = ''; +var cnEmptyString = ''; +var cnERR ='OOPS! FATAL ERROR: no regexp match in extractTimeString()'; + + + +startTest(); + +writeHeaderToLog( SECTION + " "+ TITLE); +var testcases = getTestCases(); +test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // first, a couple of generic tests - + + status = "typeof (now.toTimeString())"; + actual = typeof (now.toTimeString()); + expect = "string"; + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = "Date.prototype.toTimeString.length"; + actual = Date.prototype.toTimeString.length; + expect = 0; + array[item++] = new TestCase(SECTION, status, expect, actual); + + + + + // 1970 + addDateTestCase(0); + addDateTestCase(TZ_ADJUST); + + + // 1900 + addDateTestCase(TIME_1900); + addDateTestCase(TIME_1900 - TZ_ADJUST); + + + // 2000 + addDateTestCase(TIME_2000); + addDateTestCase(TIME_2000 - TZ_ADJUST); + + + // 29 Feb 2000 + addDateTestCase(UTC_29_FEB_2000); + addDateTestCase(UTC_29_FEB_2000 - 1000); + addDateTestCase(UTC_29_FEB_2000 - TZ_ADJUST); + + + // Now + addDateTestCase( TIME_NOW); + addDateTestCase( TIME_NOW - TZ_ADJUST); + + + // 2005 + addDateTestCase(UTC_1_JAN_2005); + addDateTestCase(UTC_1_JAN_2005 - 1000); + addDateTestCase(UTC_1_JAN_2005 - TZ_ADJUST); + + + function addTestCase() + { + array[item++] = new TestCase( SECTION, status, expect, actual); + } + + + function addDateTestCase(date_given_in_milliseconds) + { + givenDate = new Date(date_given_in_milliseconds); + + status = '().toTimeString()'; + // !!!!! Fix when bug 149722 is fixed!!!!! + //actual = givenDate.toTimeString(); + actual = cnERR; + // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + expect = extractTimeString(givenDate); + addTestCase(); + } + return array; +} +/* + * As of 2002-01-07, the format for JavaScript dates changed. + * See http://bugzilla.mozilla.org/show_bug.cgi?id=118266 (SpiderMonkey) + * See http://bugzilla.mozilla.org/show_bug.cgi?id=118636 (Rhino) + * + * WAS: Mon Jan 07 13:40:34 GMT-0800 (Pacific Standard Time) 2002 + * NOW: Mon Jan 07 2002 13:40:34 GMT-0800 (Pacific Standard Time) + * + * Thus, use a regexp of the form /date.toDateString()(.*)$/ + * to capture the TimeString into the first backreference - + */ +function extractTimeString(date) +{ + regexp = new RegExp(date.toDateString() + '(.*)' + '$'); + + try + { + hopeThisIsTimeString = date.toString().match(regexp)[1]; + } + catch(e) + { + return cnERR; + } + + // trim any leading or trailing spaces + return trimL(trimR(hopeThisIsTimeString)); +} + + + + +function trimL(s) +{ + if (!s) {return cnEmptyString;}; + for (var i = 0; i!=s.length; i++) {if (s.charAt(i) != ' ') {break;}} + return s.substring(i); +} + + +function trimR(s) +{ + if (!s) {return cnEmptyString;}; + for (var i = (s.length - 1); i!=-1; i--) {if (s.charAt(i) != ' ') {break;}} + return s.substring(0, i+1); +} + diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_42.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_42.as new file mode 100644 index 00000000000..6c1f5bc778e --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_42.as @@ -0,0 +1,139 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.42"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.toUTCString"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, + "Date.prototype.toUTCString.length", + 0, + Date.prototype.toString.length ); + + var now = new Date(); + + // can't test the content of the string, but can verify that the string is + // parsable by Date.parse + + array[item++] = new TestCase( SECTION, + "Math.abs(Date.parse(now.toUTCString()) - now.valueOf()) < 1000", + true, + Math.abs(Date.parse(now.toUTCString()) - now.valueOf()) < 1000 ); + + array[item++] = new TestCase( SECTION, + "typeof now.toUTCString()", + "string", + typeof now.toUTCString() ); + // 1970 + + TZ_ADJUST = TZ_DIFF * msPerHour; + + array[item++] = new TestCase( SECTION, + "Date.parse( (new Date(0)).toUTCString() )", + 0, + Date.parse( (new Date(0)).toUTCString() ) ) + + array[item++] = new TestCase( SECTION, + "Date.parse( (new Date(+TZ_ADJUST+)).toUTCString() )", + TZ_ADJUST, + Date.parse( (new Date(TZ_ADJUST)).toUTCString() ) ) + + // 1900 + array[item++] = new TestCase( SECTION, + "Date.parse( (new Date(+TIME_1900+).toUTCString() )", + TIME_1900, + Date.parse( (new Date(TIME_1900)).toUTCString() ) ) + + array[item++] = new TestCase( SECTION, + "Date.parse( (new Date(+TIME_1900 -TZ_ADJUST+)).toUTCString() )", + TIME_1900 -TZ_ADJUST, + Date.parse( (new Date(TIME_1900 -TZ_ADJUST)).toUTCString() ) ) + + // 2000 + array[item++] = new TestCase( SECTION, + "Date.parse( (new Date(+TIME_2000+)).toUTCString() )", + TIME_2000, + Date.parse( (new Date(TIME_2000)).toUTCString() ) ) + + array[item++] = new TestCase( SECTION, + "Date.parse( (new Date(+TIME_2000 -TZ_ADJUST+)).toUTCString() )", + TIME_2000 -TZ_ADJUST, + Date.parse( (new Date(TIME_2000 -TZ_ADJUST)).toUTCString() ) ) + + // 29 Feb 2000 + + var UTC_29_FEB_2000 = TIME_2000 + 31*msPerDay + 28*msPerDay; + array[item++] = new TestCase( SECTION, + "Date.parse( (new Date(+UTC_29_FEB_2000+)).toUTCString() )", + UTC_29_FEB_2000, + Date.parse( (new Date(UTC_29_FEB_2000)).toUTCString() ) ) + + array[item++] = new TestCase( SECTION, + "Date.parse( (new Date(+(UTC_29_FEB_2000-1000)+)).toUTCString() )", + UTC_29_FEB_2000-1000, + Date.parse( (new Date(UTC_29_FEB_2000-1000)).toUTCString() ) ) + + + array[item++] = new TestCase( SECTION, + "Date.parse( (new Date(+(UTC_29_FEB_2000-TZ_ADJUST)+)).toUTCString() )", + UTC_29_FEB_2000-TZ_ADJUST, + Date.parse( (new Date(UTC_29_FEB_2000-TZ_ADJUST)).toUTCString() ) ) + // 2O05 + + var UTC_1_JAN_2005 = TIME_2000 + TimeInYear(2000) + TimeInYear(2001) + + TimeInYear(2002) + TimeInYear(2003) + TimeInYear(2004); + array[item++] = new TestCase( SECTION, + "Date.parse( (new Date(+UTC_1_JAN_2005+)).toUTCString() )", + UTC_1_JAN_2005, + Date.parse( (new Date(UTC_1_JAN_2005)).toUTCString() ) ) + + array[item++] = new TestCase( SECTION, + "Date.parse( (new Date(+(UTC_1_JAN_2005-1000)+)).toUTCString() )", + UTC_1_JAN_2005-1000, + Date.parse( (new Date(UTC_1_JAN_2005-1000)).toUTCString() ) ) + + array[item++] = new TestCase( SECTION, + "Date.parse( (new Date(+(UTC_1_JAN_2005-TZ_ADJUST)+)).toUTCString() )", + UTC_1_JAN_2005-TZ_ADJUST, + Date.parse( (new Date(UTC_1_JAN_2005-TZ_ADJUST)).toUTCString() ) ) + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_4_1.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_4_1.as new file mode 100644 index 00000000000..bacbb834f8b --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_4_1.as @@ -0,0 +1,115 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.9.5.4-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Date.prototype.getTime"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TZ_ADJUST = TZ_DIFF * msPerHour; + var now = (new Date()).valueOf(); + var UTC_29_FEB_2000 = TIME_2000 + 31*msPerDay + 28*msPerDay; + var UTC_1_JAN_2005 = TIME_2000 + TimeInYear(2000) + TimeInYear(2001)+ + TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004); + + addTestCase2( now ); + addTestCase( TIME_1970 ); + addTestCase( TIME_1900 ); + addTestCase( TIME_2000 ); + addTestCase( UTC_29_FEB_2000 ); + addTestCase( UTC_1_JAN_2005 ); + + + function addTestCase( t ) { + array[item++] = new TestCase( SECTION, + "(new Date(+t+).valueOf()", + true, t == + (new Date(t)).valueOf() ); + + array[item++] = new TestCase( SECTION, + "(new Date(+(t+1)+).valueOf()", + true, t+1 == + (new Date(t+1)).valueOf() ); + + array[item++] = new TestCase( SECTION, + "(new Date(+(t-1)+).valueOf()", + true,t-1 == + (new Date(t-1)).valueOf() ); + + array[item++] = new TestCase( SECTION, + "(new Date(+(t-TZ_ADJUST)+).valueOf()", + true, t-TZ_ADJUST == + (new Date(t-TZ_ADJUST)).valueOf() ); + + array[item++] = new TestCase( SECTION, + "(new Date(+(t+TZ_ADJUST)+).valueOf()", + true, t+TZ_ADJUST == + (new Date(t+TZ_ADJUST)).valueOf() ); + } + + + // only used for current date and time + function addTestCase2( t ) { + array[item++] = new TestCase( SECTION, + "(new Date(now).valueOf()", + true, t == + (new Date(t)).valueOf() ); + + array[item++] = new TestCase( SECTION, + "(new Date(now+1).valueOf()", + true, t+1 == + (new Date(t+1)).valueOf() ); + + array[item++] = new TestCase( SECTION, + "(new Date(now-1).valueOf()", + true, t-1 == + (new Date(t-1)).valueOf() ); + + array[item++] = new TestCase( SECTION, + "(new Date(now-TZ_ADJUST).valueOf()", + true, t-TZ_ADJUST== + (new Date(t-TZ_ADJUST)).valueOf() ); + + array[item++] = new TestCase( SECTION, + "(new Date(now+TZ_ADJUST).valueOf()", + true, t+TZ_ADJUST == + (new Date(t+TZ_ADJUST)).valueOf() ); + } + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_4_2_rt.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_4_2_rt.as new file mode 100644 index 00000000000..a68dfd729c1 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_4_2_rt.as @@ -0,0 +1,62 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + +var SECTION = "15.9.5.4-2-n"; +var VERSION = "ECMA_1"; +var TITLE = "Date.prototype.getTime"; + + +startTest(); +writeHeaderToLog(SECTION + " " + TITLE); +var testcases = getTestCases(); +test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + var MYDATE = new MyDate(TIME_2000); + thisError = "no error thrown"; + try { + MYDATE.getTime(); + } + catch(e) { + thisError = e.toString(); + } + finally { + array[item++] = new TestCase(SECTION, "MYDATE.getTime()", "TypeError: Error #1034", typeError(thisError)); + } + return array; +} +function MyDate( value ) { + this.value = value; + this.getTime = Date.prototype.getTime; +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_5.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_5.as new file mode 100644 index 00000000000..6967d92e9e1 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_5.as @@ -0,0 +1,115 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.5"; + var VERSION = "ECMA_3"; + var TITLE = "Date.prototype.toLocaleString()"; + + var status = ''; + var actual = ''; + var expect = ''; + + + startTest(); + writeHeaderToLog( SECTION + " "+ TITLE); + + +//----------------------------------------------------------------------------------------------------- + var testcases = getTestCases(); +//----------------------------------------------------------------------------------------------------- + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + // first, some generic tests - + + status = "typeof (now.toLocaleString())"; + actual = typeof (now.toLocaleString()); + expect = "string"; + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = "Date.prototype.toLocaleString.length"; + actual = Date.prototype.toLocaleString.length; + expect = 0; + array[item++] = new TestCase(SECTION, status, expect, actual); + + // Date.parse is accurate to the second; valueOf() to the millisecond - + status = "Math.abs(Date.parse(now.toLocaleString()) - now.valueOf()) < 1000"; + actual = Math.abs(Date.parse(now.toLocaleString()) - now.valueOf()) < 1000; + expect = true; + array[item++] = new TestCase(SECTION, status, expect, actual); + + + // 1970 + addDateTestCase(0); + addDateTestCase(TZ_ADJUST); + + + // 1900 + addDateTestCase(TIME_1900); + addDateTestCase(TIME_1900 -TZ_ADJUST); + + + // 2000 + addDateTestCase(TIME_2000); + addDateTestCase(TIME_2000 -TZ_ADJUST); + + + // 29 Feb 2000 + addDateTestCase(UTC_29_FEB_2000); + addDateTestCase(UTC_29_FEB_2000 - 1000); + addDateTestCase(UTC_29_FEB_2000 - TZ_ADJUST); + + + // 2005 + addDateTestCase(UTC_1_JAN_2005); + addDateTestCase(UTC_1_JAN_2005 - 1000); + addDateTestCase(UTC_1_JAN_2005-TZ_ADJUST); + + + function addTestCase() + { + array[item++] = new TestCase( SECTION, status, expect, actual); + } + + + function addDateTestCase(date_given_in_milliseconds) + { + var givenDate = new Date(date_given_in_milliseconds); + + status = 'Date.parse( + givenDate + ).toLocaleString())'; + actual = Date.parse(givenDate.toLocaleString()); + expect = date_given_in_milliseconds; + addTestCase(); + } + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_6.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_6.as new file mode 100644 index 00000000000..6a2a94f2f43 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_6.as @@ -0,0 +1,125 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.9.5.6"; + var VERSION = "ECMA_3"; + var TITLE = "Date.prototype.toLocaleDateString()"; + + var status = ''; + var actual = ''; + var expect = ''; + + + startTest(); + writeHeaderToLog( SECTION + " "+ TITLE); + + +//----------------------------------------------------------------------------------------------------- + var testcases = getTestCases(); +//----------------------------------------------------------------------------------------------------- + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // first, some generic tests - + + status = "typeof (now.toLocaleDateString())"; + actual = typeof (now.toLocaleDateString()); + expect = "string"; + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = "Date.prototype.toLocaleDateString.length"; + actual = Date.prototype.toLocaleDateString.length; + expect = 0; + array[item++] = new TestCase(SECTION, status, expect, actual); + + /* Date.parse is accurate to the second; valueOf() to the millisecond. + Here we expect them to coincide, as we expect a time of exactly midnight - */ + status = "(Date.parse(now.toLocaleDateString()) - (midnight(now)).valueOf()) == 0"; + actual = (Date.parse(now.toLocaleDateString()) - (midnight(now)).valueOf()) == 0; + expect = true; + array[item++] = new TestCase(SECTION, status, expect, actual); + + + // 1970 + addDateTestCase(0); + addDateTestCase(TZ_ADJUST); + + + // 1900 + addDateTestCase(TIME_1900); + addDateTestCase(TIME_1900 - TZ_ADJUST); + + + // 2000 + addDateTestCase(TIME_2000); + addDateTestCase(TIME_2000 - TZ_ADJUST); + + + // 29 Feb 2000 + addDateTestCase(UTC_29_FEB_2000); + addDateTestCase(UTC_29_FEB_2000 - 1000); + addDateTestCase(UTC_29_FEB_2000 - TZ_ADJUST); + + + // 2005 + addDateTestCase(UTC_1_JAN_2005); + addDateTestCase(UTC_1_JAN_2005 - 1000); + addDateTestCase(UTC_1_JAN_2005 - TZ_ADJUST); + + + function addTestCase() + { + array[item++] = new TestCase( SECTION, status, expect, actual); + } + + + function addDateTestCase(date_given_in_milliseconds) + { + var givenDate = new Date(date_given_in_milliseconds); + + status = 'Date.parse( + givenDate + ).toLocaleDateString())'; + actual = Date.parse(givenDate.toLocaleDateString()); + expect = Date.parse(midnight(givenDate)); + addTestCase(); + } + return array; +} + +function midnight(givenDate) +{ + // midnight on the given date - + return new Date(givenDate.getFullYear(), givenDate.getMonth(), givenDate.getDate()); +} + + diff --git a/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_7.as b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_7.as new file mode 100644 index 00000000000..5da27323185 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Date/e15_9_5_7.as @@ -0,0 +1,186 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +//----------------------------------------------------------------------------- +var SECTION = "15.9.5.7"; +var VERSION = "ECMA_3"; +var TITLE = "Date.prototype.toLocaleTimeString()"; + +var status = ''; +var actual = ''; +var expect = ''; +var givenDate; +var year = ''; +var regexp = ''; +var TimeString = ''; +var reducedDateString = ''; +var hopeThisIsLocaleTimeString = ''; +var cnERR ='OOPS! FATAL ERROR: no regexp match in extractLocaleTimeString()'; + + +startTest(); +writeHeaderToLog( SECTION + " "+ TITLE); + + +//----------------------------------------------------------------------------------------------------- + var testcases = getTestCases(); +//----------------------------------------------------------------------------------------------------- +test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + // first, a couple generic tests - + + status = "typeof (now.toLocaleTimeString())"; + actual = typeof (now.toLocaleTimeString()); + expect = "string"; + array[item++] = new TestCase(SECTION, status, expect, actual); + + + status = "Date.prototype.toLocaleTimeString.length"; + actual = Date.prototype.toLocaleTimeString.length; + expect = 0; + array[item++] = new TestCase(SECTION, status, expect, actual); + + + // 1970 + addDateTestCase(0); + addDateTestCase(TZ_ADJUST); + + + // 1900 + addDateTestCase(TIME_1900); + addDateTestCase(TIME_1900 - TZ_ADJUST); + + + // 2000 + addDateTestCase(TIME_2000); + addDateTestCase(TIME_2000 - TZ_ADJUST); + + + // 29 Feb 2000 + addDateTestCase(UTC_29_FEB_2000); + addDateTestCase(UTC_29_FEB_2000 - 1000); + addDateTestCase(UTC_29_FEB_2000 - TZ_ADJUST); + + + // Now + addDateTestCase( TIME_NOW); + addDateTestCase( TIME_NOW - TZ_ADJUST); + + + // 2005 + addDateTestCase(UTC_1_JAN_2005); + addDateTestCase(UTC_1_JAN_2005 - 1000); + addDateTestCase(UTC_1_JAN_2005 - TZ_ADJUST); + + + + function addTestCase() + { + array[item++] = new TestCase( SECTION, status, expect, actual); + } + + + function addDateTestCase(date_given_in_milliseconds) + { + givenDate = new Date(date_given_in_milliseconds); + + status = '().toLocaleTimeString()'; + + + actual = cnERR; + expect = extractLocaleTimeString(givenDate); + + addTestCase(); + } + return array; +} + +/* + * As of 2002-01-07, the format for JavaScript dates changed. + * See http://bugzilla.mozilla.org/show_bug.cgi?id=118266 (SpiderMonkey) + * See http://bugzilla.mozilla.org/show_bug.cgi?id=118636 (Rhino) + * + * WAS: Mon Jan 07 13:40:34 GMT-0800 (Pacific Standard Time) 2002 + * NOW: Mon Jan 07 2002 13:40:34 GMT-0800 (Pacific Standard Time) + * + * So first, use a regexp of the form /date.toDateString()(.*)$/ + * to capture the TimeString into the first backreference. + * + * Then remove the GMT string from TimeString (see introduction above) + */ +function extractLocaleTimeString(date) +{ + regexp = new RegExp(date.toDateString() + '(.*)' + '$'); + try + { + TimeString = date.toString().match(regexp)[1]; + } + catch(e) + { + return cnERR; + } + + /* + * Now remove the GMT part of the TimeString. + * Guard against dates with two "GMT"s, like: + * Jan 01 00:00:00 GMT+0000 (GMT Standard Time) + */ + regexp= /([^G]*)GMT.*/; + try + { + hopeThisIsLocaleTimeString = TimeString.match(regexp)[1]; + } + catch(e) + { + return TimeString; + } + + // trim any leading or trailing spaces - + return trimL(trimR(hopeThisIsLocaleTimeString)); +} + + +function trimL(s) +{ + if (!s) {return cnEmptyString;}; + for (var i = 0; i!=s.length; i++) {if (s[i] != ' ') {break;}} + return s.substring(i); +} + + +function trimR(s) +{ + for (var i = (s.length - 1); i!=-1; i--) {if (s[i] != ' ') {break;}} + return s.substring(0, i+1); +} diff --git a/mozilla/js/tamarin/test/ecma3/ErrorObject/e15_11_1.as b/mozilla/js/tamarin/test/ecma3/ErrorObject/e15_11_1.as new file mode 100644 index 00000000000..fba4fd4dc03 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/ErrorObject/e15_11_1.as @@ -0,0 +1,144 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "ErrorObjects"; // provide a document reference (ie, Actionscript section) +var VERSION = "ES3"; // Version of ECMAScript or ActionScript +var TITLE = "The Error Constructor Called as a Function"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + +var testcases = getTestCases(); + +test(); // leave this alone. this executes the test cases and + // displays results. + +function getTestCases() { + var array = new Array(); + var item = 0; + + var error = Error(); + var ee = EvalError(); + var te = TypeError(); + var re = ReferenceError(); + var ra = RangeError(); + var SE = SyntaxError(); + var URI = URIError(); + + array[item++] = new TestCase(SECTION, "var error = Error()", "Error", error.toString() ); + array[item++] = new TestCase(SECTION, "var ee = EvalError()", "EvalError", ee.toString() ); + array[item++] = new TestCase(SECTION, "var te = TypeError()", "TypeError", te.toString() ); + array[item++] = new TestCase(SECTION, "var re = ReferenceError()", "ReferenceError", re.toString() ); + array[item++] = new TestCase(SECTION, "var ra = RangeError()", "RangeError", ra.toString() ); + array[item++] = new TestCase(SECTION, "var SE = SyntaxError()", "SyntaxError", SE.toString() ); + array[item++] = new TestCase(SECTION,"var URI = URIError()", "URIError", URI.toString() ); + + error = Error("test"); + ee = EvalError("eval error"); + te = TypeError("type error"); + re = ReferenceError("reference error"); + ra = RangeError("range error"); + var SE = SyntaxError("syntax error"); + var URI = URIError("uri error"); + + array[item++] = new TestCase(SECTION, "var error = Error('test')", "Error: test", error.toString() ); + array[item++] = new TestCase(SECTION, "var ee = EvalError('eval error')", "EvalError: eval error", ee.toString() ); + array[item++] = new TestCase(SECTION, "var te = TypeError('type error')", "TypeError: type error", te.toString() ); + array[item++] = new TestCase(SECTION, "var re = ReferenceError('reference error')", "ReferenceError: reference error", re.toString() ); + array[item++] = new TestCase(SECTION, "var ra = RangeError('range error')", "RangeError: range error", ra.toString() ); + array[item++] = new TestCase(SECTION, "var SE = SyntaxError('syntax error')", "SyntaxError: syntax error", SE.toString() ); + array[item++] = new TestCase(SECTION, "var URI = URIError('uri error')", "URIError: uri error", URI.toString() ); + + array[item++] = new TestCase(SECTION, "typeof Error()", "object", typeof Error() ); + array[item++] = new TestCase(SECTION, "typeof EvalError()", "object", typeof EvalError() ); + array[item++] = new TestCase(SECTION, "typeof TypeError()", "object", typeof TypeError() ); + array[item++] = new TestCase(SECTION, "typeof ReferenceError()", "object", typeof ReferenceError() ); + array[item++] = new TestCase(SECTION, "typeof RangeError()", "object", typeof RangeError() ); + array[item++] = new TestCase(SECTION, "typeof SyntaxError()", "object", typeof SyntaxError() ); + array[item++] = new TestCase(SECTION, "typeof URIError()", "object", typeof URIError() ); + + array[item++] = new TestCase(SECTION, "typeof Error('test')", "object", typeof Error('test') ); + array[item++] = new TestCase(SECTION, "typeof EvalError('test')", "object", typeof EvalError('test') ); + array[item++] = new TestCase(SECTION, "typeof TypeError('test')", "object", typeof TypeError('test') ); + array[item++] = new TestCase(SECTION, "typeof ReferenceError('test')", "object", typeof ReferenceError('test') ); + array[item++] = new TestCase(SECTION, "typeof RangeError('test')", "object", typeof RangeError('test') ); + array[item++] = new TestCase(SECTION, "typeof SyntaxError()", "object", typeof SyntaxError('test') ); + array[item++] = new TestCase(SECTION, "typeof URIError()", "object", typeof URIError('test') ); + + array[item++] = new TestCase(SECTION, "(err = Error(), err.getClass = Object.prototype.toString, err.getClass() )", + "[object Error]", + (err = Error(), err.getClass = Object.prototype.toString, err.getClass() ) ); + array[item++] = new TestCase(SECTION, "(err = EvalError(), err.getClass = Object.prototype.toString, err.getClass() )", + "[object EvalError]", + (err = EvalError(), err.getClass = Object.prototype.toString, err.getClass() ) ); + array[item++] = new TestCase(SECTION, "(err = TypeError(), err.getClass = Object.prototype.toString, err.getClass() )", + "[object TypeError]", + (err = TypeError(), err.getClass = Object.prototype.toString, err.getClass() ) ); + array[item++] = new TestCase(SECTION, "(err = ReferenceError(), err.getClass = Object.prototype.toString, err.getClass() )", + "[object ReferenceError]", + (err = ReferenceError(), err.getClass = Object.prototype.toString, err.getClass() ) ); + array[item++] = new TestCase(SECTION, "(err = RangeError(), err.getClass = Object.prototype.toString, err.getClass() )", + "[object RangeError]", + (err = RangeError(), err.getClass = Object.prototype.toString, err.getClass() ) ); + + array[item++] = new TestCase(SECTION, "(err = SyntaxError(), err.getClass = Object.prototype.toString, err.getClass() )", + "[object SyntaxError]", + (err = SyntaxError(), err.getClass = Object.prototype.toString, err.getClass() ) ); + + array[item++] = new TestCase(SECTION, "(err = URIError(), err.getClass = Object.prototype.toString, err.getClass() )", + "[object URIError]", + (err = URIError(), err.getClass = Object.prototype.toString, err.getClass() ) ); + + array[item++] = new TestCase(SECTION, "(err = Error('test'), err.getClass = Object.prototype.toString, err.getClass() )", + "[object Error]", + (err = Error('test'), err.getClass = Object.prototype.toString, err.getClass() ) ); + array[item++] = new TestCase(SECTION, "(err = EvalError('test'), err.getClass = Object.prototype.toString, err.getClass() )", + "[object EvalError]", + (err = EvalError('test'), err.getClass = Object.prototype.toString, err.getClass() ) ); + array[item++] = new TestCase(SECTION, "(err = TypeError('test'), err.getClass = Object.prototype.toString, err.getClass() )", + "[object TypeError]", + (err = TypeError('test'), err.getClass = Object.prototype.toString, err.getClass() ) ); + array[item++] = new TestCase(SECTION, "(err = ReferenceError('test'), err.getClass = Object.prototype.toString, err.getClass() )", + "[object ReferenceError]", + (err = ReferenceError('test'), err.getClass = Object.prototype.toString, err.getClass() ) ); + array[item++] = new TestCase(SECTION, "(err = RangeError('test'), err.getClass = Object.prototype.toString, err.getClass() )", + "[object RangeError]", + (err = RangeError('test'), err.getClass = Object.prototype.toString, err.getClass() ) ); + array[item++] = new TestCase(SECTION, "(err = SyntaxError('test'), err.getClass = Object.prototype.toString, err.getClass() )", + "[object SyntaxError]", + (err = SyntaxError('test'), err.getClass = Object.prototype.toString, err.getClass() ) ); + array[item++] = new TestCase(SECTION, "(err = URIError('test'), err.getClass = Object.prototype.toString, err.getClass() )", + "[object URIError]", + (err = URIError('test'), err.getClass = Object.prototype.toString, err.getClass() ) ); + + return array; +} + diff --git a/mozilla/js/tamarin/test/ecma3/ErrorObject/e15_11_2_1.as b/mozilla/js/tamarin/test/ecma3/ErrorObject/e15_11_2_1.as new file mode 100644 index 00000000000..79f9538fdce --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/ErrorObject/e15_11_2_1.as @@ -0,0 +1,117 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "ErrorObjects"; // provide a document reference (ie, Actionscript section) +var VERSION = "ES3"; // Version of ECMAScript or ActionScript +var TITLE = "new Error(message)"; // Provide ECMA section title or a description +var BUGNUMBER = ""; + +startTest(); // leave this alone + +var testcases = getTestCases(); + + +test(); // leave this alone. this executes the test cases and + // displays results. + +function getTestCases() { + var array = new Array(); + var item = 0; + var error = new Error(); + var ee = new EvalError(); + var te = new TypeError(); + var re = new ReferenceError(); + var ra = new RangeError(); + + array[item++] = new TestCase(SECTION, "var error = new Error()", "Error", error.toString() ); + array[item++] = new TestCase(SECTION, "var ee = new EvalError()", "EvalError", ee.toString() ); + array[item++] = new TestCase(SECTION, "var te = new TypeError()", "TypeError", te.toString() ); + array[item++] = new TestCase(SECTION, "var re = new ReferenceError()", "ReferenceError", re.toString() ); + array[item++] = new TestCase(SECTION, "var ra = new RangeError()", "RangeError", ra.toString() ); + + error = new Error("test"); + ee = new EvalError("eval error"); + te = new TypeError("type error"); + re = new ReferenceError("reference error"); + ra = new RangeError("range error"); + + array[item++] = new TestCase(SECTION, "var error = new Error('test')", "Error: test", error.toString() ); + array[item++] = new TestCase(SECTION, "var ee = new EvalError('eval error')", "EvalError: eval error", ee.toString() ); + array[item++] = new TestCase(SECTION, "var te = new TypeError('type error')", "TypeError: type error", te.toString() ); + array[item++] = new TestCase(SECTION, "var re = new ReferenceError('reference error')", "ReferenceError: reference error", re.toString() ); + array[item++] = new TestCase(SECTION, "var ra = new RangeError('range error')", "RangeError: range error", ra.toString() ); + + array[item++] = new TestCase(SECTION, "typeof new Error()", "object", typeof new Error() ); + array[item++] = new TestCase(SECTION, "typeof new EvalError()", "object", typeof new EvalError() ); + array[item++] = new TestCase(SECTION, "typeof new TypeError()", "object", typeof new TypeError() ); + array[item++] = new TestCase(SECTION, "typeof new ReferenceError()", "object", typeof new ReferenceError() ); + array[item++] = new TestCase(SECTION, "typeof new RangeError()", "object", typeof new RangeError() ); + + array[item++] = new TestCase(SECTION, "typeof new Error('test')", "object", typeof new Error('test') ); + array[item++] = new TestCase(SECTION, "typeof new EvalError('test')", "object", typeof new EvalError('test') ); + array[item++] = new TestCase(SECTION, "typeof new TypeError('test')", "object", typeof new TypeError('test') ); + array[item++] = new TestCase(SECTION, "typeof new ReferenceError('test')", "object", typeof new ReferenceError('test') ); + array[item++] = new TestCase(SECTION, "typeof new RangeError('test')", "object", typeof new RangeError('test') ); + + array[item++] = new TestCase(SECTION, "(err = new Error(), err.getClass = Object.prototype.toString, err.getClass() )", + "[object Error]", + (err = new Error(), err.getClass = Object.prototype.toString, err.getClass() ) ); + array[item++] = new TestCase(SECTION, "(err = new EvalError(), err.getClass = Object.prototype.toString, err.getClass() )", + "[object EvalError]", + (err = new EvalError(), err.getClass = Object.prototype.toString, err.getClass() ) ); + array[item++] = new TestCase(SECTION, "(err = new TypeError(), err.getClass = Object.prototype.toString, err.getClass() )", + "[object TypeError]", + (err = new TypeError(), err.getClass = Object.prototype.toString, err.getClass() ) ); + array[item++] = new TestCase(SECTION, "(err = new ReferenceError(), err.getClass = Object.prototype.toString, err.getClass() )", + "[object ReferenceError]", + (err = new ReferenceError(), err.getClass = Object.prototype.toString, err.getClass() ) ); + array[item++] = new TestCase(SECTION, "(err = new RangeError(), err.getClass = Object.prototype.toString, err.getClass() )", + "[object RangeError]", + (err = new RangeError(), err.getClass = Object.prototype.toString, err.getClass() ) ); + + array[item++] = new TestCase(SECTION, "(err = new Error('test'), err.getClass = Object.prototype.toString, err.getClass() )", + "[object Error]", + (err = new Error('test'), err.getClass = Object.prototype.toString, err.getClass() ) ); + array[item++] = new TestCase(SECTION, "(err = new EvalError('test'), err.getClass = Object.prototype.toString, err.getClass() )", + "[object EvalError]", + (err = new EvalError('test'), err.getClass = Object.prototype.toString, err.getClass() ) ); + array[item++] = new TestCase(SECTION, "(err = new TypeError('test'), err.getClass = Object.prototype.toString, err.getClass() )", + "[object TypeError]", + (err = new TypeError('test'), err.getClass = Object.prototype.toString, err.getClass() ) ); + array[item++] = new TestCase(SECTION, "(err = new ReferenceError('test'), err.getClass = Object.prototype.toString, err.getClass() )", + "[object ReferenceError]", + (err = new ReferenceError('test'), err.getClass = Object.prototype.toString, err.getClass() ) ); + array[item++] = new TestCase(SECTION, "(err = new RangeError('test'), err.getClass = Object.prototype.toString, err.getClass() )", + "[object RangeError]", + (err = new RangeError('test'), err.getClass = Object.prototype.toString, err.getClass() ) ); + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Exceptions/binding_001.as b/mozilla/js/tamarin/test/ecma3/Exceptions/binding_001.as new file mode 100644 index 00000000000..ab34a17a933 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Exceptions/binding_001.as @@ -0,0 +1,123 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* +* The contents of this file are subject to the Netscape Public +* License Version 1.1 (the "License"); you may not use this file +* except in compliance with the License. You may obtain a copy of +* the License at http://www.mozilla.org/NPL/ +* +* Software distributed under the License is distributed on an +* "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either expressed +* or implied. See the License for the specific language governing +* rights and limitations under the License. +* +* The Original Code is mozilla.org code. +* +* The Initial Developer of the Original Code is Netscape +* Communications Corporation. Portions created by Netscape are +* Copyright (C) 1998 Netscape Communications Corporation. +* All Rights Reserved. +* +* Contributor(s): brendan@mozilla.org, pschwartau@netscape.com +* Date: 2001-08-27 +* +* SUMMARY: Testing binding of function names +* +* Brendan: +* +* "... the question is, does Rhino bind 'sum' in the global object +* for the following test? If it does, it's buggy. +* +* var f = function sum(){}; +* print(sum); // should fail with 'sum is not defined' " +* +*/ +//----------------------------------------------------------------------------- + var SECTION = "binding_001"; + var VERSION = ""; + var ERR_REF_YES = 'ReferenceError'; + var ERR_REF_NO = 'did NOT generate a ReferenceError'; + + startTest(); + var TITLE = "Testing binding of function names"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + var UBound = 0; + var statusitems = []; + var actualvalues = []; + var expectedvalues = []; + var status = TITLE; + var actual = ERR_REF_NO; + var expect= ERR_REF_YES; + //var match; + + try + { + var f = function sum(){}; + + trace(sum); + } + catch (e) + { + status = 'e instanceof ReferenceError'; + actual = e instanceof ReferenceError; + expect = true; + array[item++] = new TestCase(SECTION, status, isReferenceError(expect), isReferenceError(actual)); + + + /* + * This test is more literal, and one day may not be valid. + * Searching for literal string "ReferenceError" in e.toString() + */ + status = 'e.toString().search(/ReferenceError/)'; + var match = e.toString().search(/ReferenceError/); + + actual = (match > -1); + + + expect = true; + array[item++] = new TestCase(SECTION, status, isReferenceError(expect), isReferenceError(actual)); + } + return array; +} + +// converts a Boolean result into a textual result - +function isReferenceError(bResult) +{ + return bResult? ERR_REF_YES : ERR_REF_NO; +} diff --git a/mozilla/js/tamarin/test/ecma3/Exceptions/boolean_001_rt.as b/mozilla/js/tamarin/test/ecma3/Exceptions/boolean_001_rt.as new file mode 100644 index 00000000000..df370e2bafd --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Exceptions/boolean_001_rt.as @@ -0,0 +1,142 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "boolean-001.as"; + var VERSION = "ECMA_4"; + var TITLE = "Boolean.prototype.toString()"; + startTest(); + writeHeaderToLog( SECTION +" "+ TITLE ); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var exception = "No exception thrown"; + + var TO_STRING = Boolean.prototype.toString; + + try { + var s = new String("Not a Boolean"); + s.toString = TO_STRING; + s.toString(); + } catch ( e ) { + exception = e.toString(); + }finally{ + + array[item++] = new TestCase( + SECTION, + "Assigning Boolean.prototype.toString to a String object ", + REFERENCEERROR+1056, + referenceError( exception ) ); + } + // new Boolean() + try { + var b = new Boolean(); + b.toString = TO_STRING; + b.toString(); + } catch ( e1 ) { + exception = e1.toString(); + }finally{ + + array[item++] = new TestCase( + SECTION, + "Assigning Boolean.prototype.toString to an instance of new Boolean()", + REFERENCEERROR+1056, + referenceError( exception ) ); + + } + // new Boolean(true) + try { + var b = new Boolean(true); + b.toString = TO_STRING; + b.toString(); + } catch ( e2 ) { + exception = e2.toString(); + }finally{ + + array[item++] = new TestCase( + SECTION, + "Assigning Boolean.prototype.toString to an instance of new Boolean(true)", + REFERENCEERROR+1056, + referenceError( exception ) ); + + } + // new Boolean(false) + try { + var b = new Boolean(false); + b.toString = TO_STRING; + b.toString(); + } catch ( e3 ) { + exception = e3.toString(); + }finally{ + + array[item++] = new TestCase( + SECTION, + "Assigning Boolean.prototype.toString to an instance of new Boolean(false)", + REFERENCEERROR+1056, + referenceError( exception ) ); + } + + // true + try { + var b = true; + b.toString = TO_STRING; + b.toString(); + } catch ( e4 ) { + exception = e4.toString(); + }finally{ + + array[item++] = new TestCase( + SECTION, + "Assigning Boolean.prototype.toString to an instance of 'true'", + REFERENCEERROR+1056, + referenceError( exception ) ); + } + + // false + try { + var b = false; + b.toString = TO_STRING; + b.toString(); + } catch ( e5 ) { + exception = e5.toString(); + }finally{ + + array[item++] = new TestCase( + SECTION, + "Assigning Boolean.prototype.toString to an instance of 'false'", + REFERENCEERROR+1056, + referenceError( exception ) ); + } + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Exceptions/boolean_002_rt.as b/mozilla/js/tamarin/test/ecma3/Exceptions/boolean_002_rt.as new file mode 100644 index 00000000000..238f2bbe9a2 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Exceptions/boolean_002_rt.as @@ -0,0 +1,144 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "boolean-002.as"; + var VERSION = "ECMA_4"; + var TITLE = "Boolean.prototype.valueOf()"; + startTest(); + writeHeaderToLog( SECTION +" "+ TITLE ); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var exception = "No exception thrown"; + var result = "Failed"; + + var VALUE_OF = Boolean.prototype.valueOf; + + // non-boolean type + try { + var s = new String("Not a Boolean"); + s.valueOf = VALUE_OF; + s.valueOf(); + } catch ( e ) { + exception = e.toString(); + }finally{ + + array[item++] = new TestCase( + SECTION, + "Assigning Boolean.prototype.valueOf to a String object ", + REFERENCEERROR+1056, + referenceError( exception ) ); + } + // new Boolean() + try { + var b = new Boolean(); + b.valueOf= VALUE_OF; + b.valueOf(); + } catch ( e1 ) { + exception = e1.toString(); + }finally{ + + array[item++] = new TestCase( + SECTION, + "Assigning Boolean.prototype.valueOf to an instance of new Boolean()", + REFERENCEERROR+1056, + referenceError( exception ) ); + } + + // new Boolean(true) + try { + var b = new Boolean(true); + b.valueOf = VALUE_OF; + b.valueOf(); + } catch ( e2 ) { + exception = e2.toString(); + }finally{ + + array[item++] = new TestCase( + SECTION, + "Assigning Boolean.prototype.valueOf to an instance of new Boolean(true)", + REFERENCEERROR+1056, + referenceError( exception ) ); + } + + // new Boolean(false) + try { + var b = new Boolean(false); + b.valueOf = VALUE_OF; + b.valueOf (); + } catch ( e3 ) { + exception = e3.toString(); + }finally{ + + array[item++] = new TestCase( + SECTION, + "Assigning Boolean.prototype.valueOf to an instance of new Boolean(false)", + REFERENCEERROR+1056, + referenceError( exception ) ); + } + + // true + try { + var b = true; + b.valueOf = VALUE_OF; + b.valueOf (); + } catch ( e4 ) { + exception = e4.toString(); + }finally{ + + array[item++] = new TestCase( + SECTION, + "Assigning Boolean.prototype.valueOf to an instance of 'true'", + REFERENCEERROR+1056, + referenceError( exception ) ); + + } + // false + try { + var b = false; + b.valueOf = VALUE_OF; + b.valueOf(); + } catch ( e5 ) { + exception = e5.toString(); + }finally{ + + array[item++] = new TestCase( + SECTION, + "Assigning Boolean.prototype.valueOf to an instance of 'false'", + REFERENCEERROR+1056, + referenceError( exception ) ); + } + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Exceptions/bug127913.as b/mozilla/js/tamarin/test/ecma3/Exceptions/bug127913.as new file mode 100644 index 00000000000..6ffc839e6df --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Exceptions/bug127913.as @@ -0,0 +1,59 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +var SECTION = "bug127913"; +startTest(); + +var testcases = getTestCases(); + +test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + function foo(){ foo2(); } + function foo2(){ foo(); } + + try{ + unknownfunction(); + } catch(e) { + } finally { + } + + try{ + foo(); + } catch( e ){ + } finally { + array[item++] = new TestCase(SECTION, "throw an exception in a script where there is infinite recursion", "no crash", "no crash" ); + } + return array; +} + diff --git a/mozilla/js/tamarin/test/ecma3/Exceptions/date_001_rt.as b/mozilla/js/tamarin/test/ecma3/Exceptions/date_001_rt.as new file mode 100644 index 00000000000..d4973972865 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Exceptions/date_001_rt.as @@ -0,0 +1,72 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "date-001"; + var VERSION = "JS1_4"; + var TITLE = "Date.prototype.toString"; + + startTest(); + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var result = "Failed"; + var exception = "No exception thrown"; + var expect = "Passed"; + + try { + var OBJ = new MyObject( new Date(0) ); + result = OBJ.toString(); + } catch ( e ) { + result = expect; + exception = e.toString(); + }finally{ + + array[item++] = new TestCase( + SECTION, + "OBJECT = new MyObject( new Date(0)) ; result = OBJ.toString()", + "TypeError: Error #1034", + typeError( exception )); + } + return array; +} + +function MyObject( value ) { + this.value = value; + this.valueOf = function(){ return this.value;} + this.toString = Date.prototype.toString; + return this; +} + diff --git a/mozilla/js/tamarin/test/ecma3/Exceptions/date_002_rt.as b/mozilla/js/tamarin/test/ecma3/Exceptions/date_002_rt.as new file mode 100644 index 00000000000..12a2a81d84c --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Exceptions/date_002_rt.as @@ -0,0 +1,71 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "date-002"; + var VERSION = "JS1_4"; + var TITLE = "Date.prototype.setTime()"; + + startTest(); + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var result = "Failed"; + var exception = "No exception thrown"; + var expect = "Passed"; + + try { + var MYDATE = new MyDate(); + result = MYDATE.setTime(0); + } catch ( e ) { + result = expect; + exception = e.toString(); + }finally{ + + array[item++] = new TestCase( + SECTION, + "MYDATE = new MyDate(); MYDATE.setTime(0)", + TYPEERROR+1034, + typeError(exception) ); + } + return array; +} + +function MyDate(value) { + this.value = value; + this.setTime = Date.prototype.setTime; + return this; +} + diff --git a/mozilla/js/tamarin/test/ecma3/Exceptions/date_003_rt.as b/mozilla/js/tamarin/test/ecma3/Exceptions/date_003_rt.as new file mode 100644 index 00000000000..28180e874ee --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Exceptions/date_003_rt.as @@ -0,0 +1,74 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "date-003"; + var VERSION = "JS1_4"; + var TITLE = "Date.prototype.valueOf"; + + startTest(); + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array; + var item = 0; + + var result = "Failed"; + var exception = "No exception thrown"; + var expect = "Passed"; + + try { + var OBJ = new MyObject( new Date(0) ); + result = OBJ.valueOf(); + } catch ( e ) { + result = expect; + exception = e.toString(); + }finally{ + + array[item++] = new TestCase( + SECTION, + "OBJ = new MyObject( new Date(0)); OBJ.valueOf()", + TYPEERROR+1034, + typeError(exception) ); + } + return array; +} + +function MyObject( value ) { + this.value = value; + this.valueOf = Date.prototype.valueOf; +// The following line causes an infinte loop +// this.toString = new Function( "return this+\"\";"); + return this; +} + + diff --git a/mozilla/js/tamarin/test/ecma3/Exceptions/date_004_rt.as b/mozilla/js/tamarin/test/ecma3/Exceptions/date_004_rt.as new file mode 100644 index 00000000000..f4572ec099b --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Exceptions/date_004_rt.as @@ -0,0 +1,71 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "date-004"; + var VERSION = "JS1_4"; + var TITLE = "Date.prototype.getTime"; + + startTest(); + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var result = "Failed"; + var exception = "No exception thrown"; + var expect = "Passed"; + + try { + var MYDATE = new MyDate(); + result = MYDATE.getTime(); + } catch ( e ) { + result = expect; + exception = e.toString(); + }finally{ + + array[item++] = new TestCase( + SECTION, + "MYDATE = new MyDate(); MYDATE.getTime()", + TYPEERROR+1034, + typeError( exception ) ); + } + return array; +} + +function MyDate( value ) { + this.value = value; + this.getTime = Date.prototype.getTime; +} + + diff --git a/mozilla/js/tamarin/test/ecma3/Exceptions/e15_11_4_4_1.as b/mozilla/js/tamarin/test/ecma3/Exceptions/e15_11_4_4_1.as new file mode 100644 index 00000000000..84c21be3158 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Exceptions/e15_11_4_4_1.as @@ -0,0 +1,182 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* ***** BEGIN LICENSE BLOCK ***** +* Version: NPL 1.1/GPL 2.0/LGPL 2.1 +* +* The contents of this file are subject to the Netscape Public License +* Version 1.1 (the "License"); you may not use this file except in +* compliance with the License. You may obtain a copy of the License at +* http://www.mozilla.org/NPL/ +* +* Software distributed under the License is distributed on an "AS IS" basis, +* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +* for the specific language governing rights and limitations under the +* License. +* +* The Original Code is JavaScript Engine testing utilities. +* +* The Initial Developer of the Original Code is Netscape Communications Corp. +* Portions created by the Initial Developer are Copyright (C) 2001 +* the Initial Developer. All Rights Reserved. +* +* Contributor(s): d-russo@ti.com, pschwartau@netscape.com +* +* Alternatively, the contents of this file may be used under the terms of +* either the GNU General Public License Version 2 or later (the "GPL"), or +* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +* in which case the provisions of the GPL or the LGPL are applicable instead +* of those above. If you wish to allow use of your version of this file only +* under the terms of either the GPL or the LGPL, and not to allow others to +* use your version of this file under the terms of the NPL, indicate your +* decision by deleting the provisions above and replace them with the notice +* and other provisions required by the GPL or the LGPL. If you do not delete +* the provisions above, a recipient may use your version of this file under +* the terms of any one of the NPL, the GPL or the LGPL. +* +* ***** END LICENSE BLOCK ***** +* +* +* Date: 22 Jan 2002 +* SUMMARY: Testing Error.prototype.toString() +* +* Note that ECMA-262 3rd Edition Final, Section 15.11.4.4 states that +* Error.prototype.toString() returns an implementation-dependent string. +* Therefore any testcase on this property is somewhat arbitrary. +* +* However, d-russo@ti.com pointed out that Rhino was returning this: +* +* js> err = new Error() +* undefined: undefined +* +* js> err = new Error("msg") +* undefined: msg +* +* +* We expect Rhino to return what SpiderMonkey currently does: +* +* js> err = new Error() +* Error +* +* js> err = new Error("msg") +* Error: msg +* +* +* i.e. we expect err.toString() === err.name if err.message is not defined; +* otherwise, we expect err.toString() === err.name + ': ' + err.message. +* +* See also ECMA 15.11.4.2, 15.11.4.3 +*/ +//----------------------------------------------------------------------------- +var SECTION = "e15_11_4_4_1"; +var UBound = 0; +var bug = '(none)'; +var summary = 'Testing Error.prototype.toString()'; +var status = ''; +var statusitems = []; +var actual = ''; +var actualvalues = []; +var expect= ''; +var expectedvalues = []; +var EMPTY_STRING = ''; +var EXPECTED_FORMAT = 0; + +startTest(); +var testcases = getTestCases(); +test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + status = "new Error('msg1')"; + var err1 = new Error('msg1'); + actual = examineThis(err1); + expect = EXPECTED_FORMAT; + array[item++] = new TestCase(SECTION, status, expect, actual); + array[item++] = new TestCase(SECTION, "new Error('msg1')", "Error: msg1", (new Error('msg1')).toString() ); + + status = "new Error(err1)"; + var err2 = new Error(err1); + actual = examineThis(err2); + expect = EXPECTED_FORMAT; + array[item++] = new TestCase(SECTION, status, expect, actual); + array[item++] = new TestCase(SECTION, "new Error(err1)", "Error: Error: msg1", (new Error(err1)).toString() ); + + status = "new Error()"; + var err3 = new Error(); + actual = examineThis(err3); + expect = EXPECTED_FORMAT; + array[item++] = new TestCase(SECTION, status, expect, actual); + array[item++] = new TestCase(SECTION, "new Error()", "Error", (new Error()).toString() ); + + status = "new Error('')"; + var err4 = new Error(EMPTY_STRING); + actual = examineThis(err4); + expect = EXPECTED_FORMAT; + array[item++] = new TestCase(SECTION, status, expect, actual); + array[item++] = new TestCase(SECTION, "new Error('')", "Error", (new Error('')).toString() ); + + // now generate a run-time error - + status = "run-time error"; + try + { + throw new Error(); + } + catch(err5) + { + actual = examineThis(err5); + } + expect = EXPECTED_FORMAT; + array[item++] = new TestCase(SECTION, status, expect, actual); + + return array; +} + + +/* + * Searches err.toString() for err.name + ':' + err.message, + * with possible whitespace on each side of the colon sign. + * + * We allow for no colon in case err.message was not provided by the user. + * In such a case, SpiderMonkey and Rhino currently set err.message = '', + * as allowed for by ECMA 15.11.4.3. This makes |pattern| work in this case. + * + * If this is ever changed to a non-empty string, e.g. 'undefined', + * you may have to modify |pattern| to take that into account - + * + */ +function examineThis(err) +{ + var pattern = err.name + '\\s*:?\\s*' + err.message; + return err.toString().search(RegExp(pattern)); +} + + diff --git a/mozilla/js/tamarin/test/ecma3/Exceptions/exception_001_rt.as b/mozilla/js/tamarin/test/ecma3/Exceptions/exception_001_rt.as new file mode 100644 index 00000000000..4e5475506f8 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Exceptions/exception_001_rt.as @@ -0,0 +1,65 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "exception-001"; + var VERSION = "js1_4"; + var TITLE = "Tests for JavaScript Standard Exceptions: CallError"; + + startTest(); + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + Call_1(); + + function Call_1() { + result = "failed: no exception thrown"; + exception = null; + + try { + Math(); + } catch ( e ) { + result = "passed: threw exception", + exception = e.toString(); + } finally { + array[item++] = new TestCase( + SECTION, + "Math()", + TYPEERROR+1075, + typeError( exception ) ); + } + } + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Exceptions/exception_002_rt.as b/mozilla/js/tamarin/test/ecma3/Exceptions/exception_002_rt.as new file mode 100644 index 00000000000..4ee9d08974d --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Exceptions/exception_002_rt.as @@ -0,0 +1,64 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "exception-002"; + var VERSION = "js1_4"; + var TITLE = "Tests for JavaScript Standard Exceptions: ConstructError"; + + startTest(); + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + Construct_1(); + + function Construct_1() { + result = "failed: no exception thrown"; + exception = null; + + try { + result = new Math(); + } catch ( e ) { + result = e.toString(); + } finally { + array[item++] = new TestCase( + SECTION, + "new Math()", + TYPEERROR+1076, + typeError( result ) ); + } + } + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Exceptions/exception_003_rt.as b/mozilla/js/tamarin/test/ecma3/Exceptions/exception_003_rt.as new file mode 100644 index 00000000000..1d0d8e7819f --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Exceptions/exception_003_rt.as @@ -0,0 +1,71 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "exception-003"; + var VERSION = "js1_4"; + var TITLE = "Tests for Actionscript Standard Exceptions: TargetError"; + + startTest(); + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + Target_1(); + + function Target_1() { + result = "failed: no exception thrown"; + exception = null; + + try { + + string ="hi"; + string.toString = Boolean.prototype.toString; + string.toString(); + + } catch ( e ) { + //result = "passed: threw exception", + result = e.toString(); + } finally { + array[item++] = new TestCase( + SECTION, + "string = new String(\"hi\");"+ + "string.toString = Boolean.prototype.toString" + + "string.toString()", + REFERENCEERROR+1056, + referenceError( result ) ); + } + } + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Exceptions/exception_004_rt.as b/mozilla/js/tamarin/test/ecma3/Exceptions/exception_004_rt.as new file mode 100644 index 00000000000..d3afeb3a63f --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Exceptions/exception_004_rt.as @@ -0,0 +1,65 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "exception-004"; + var VERSION = "js1_4"; + var TITLE = "Tests for Actionscript Standard Exceptions: ToObjectError"; + + startTest(); + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + ToObject_1(); + + function ToObject_1() { + result = "failed: no exception thrown"; + exception = null; + + try { + result = foo["bar"]; + } catch ( e ) { + result = "passed: threw exception", + exception = e.toString(); + } finally { + array[item++] = new TestCase( + SECTION, + "foo[\"bar\"]", + REFERENCEERROR+1065, + referenceError( exception ) ); + } + } + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Exceptions/exception_005_rt.as b/mozilla/js/tamarin/test/ecma3/Exceptions/exception_005_rt.as new file mode 100644 index 00000000000..a5c7e01614e --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Exceptions/exception_005_rt.as @@ -0,0 +1,65 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "exception-005"; + var VERSION = "js1_4"; + var TITLE = "Tests for JavaScript Standard Exceptions: ToObjectError"; + + startTest(); + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + ToObject_1(); + + function ToObject_1() { + result = "failed: no exception thrown"; + exception = null; + + try { + result = foo["bar"]; + } catch ( e ) { + result = "passed: threw exception", + exception = e.toString(); + } finally { + array[item++] = new TestCase( + SECTION, + "foo[\"bar\"] ", + REFERENCEERROR+1065, + referenceError( exception ) ); + } + } + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Exceptions/exception_006_rt.as b/mozilla/js/tamarin/test/ecma3/Exceptions/exception_006_rt.as new file mode 100644 index 00000000000..8b04a051b14 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Exceptions/exception_006_rt.as @@ -0,0 +1,72 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "exception-006"; + var VERSION = "js1_4"; + var TITLE = "Tests for JavaScript Standard Exceptions: TypeError"; + + startTest(); + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + ToPrimitive_1(); + + + function MyObject() { + this.toString = void 0; + this.valueOf = void 0; + } + + function ToPrimitive_1() { + result = "failed: no exception thrown"; + exception = null; + + try { + result = new MyObject() + new MyObject(); + } catch ( e ) { + result = "passed: threw exception", + exception = e.toString(); + } finally { + array[item++] = new TestCase( + SECTION, + "new MyObject() + new MyObject()", + "TypeError: Error #1006", + typeError( exception ) ); + } + } + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Exceptions/exception_007_rt.as b/mozilla/js/tamarin/test/ecma3/Exceptions/exception_007_rt.as new file mode 100644 index 00000000000..578ec6fec1b --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Exceptions/exception_007_rt.as @@ -0,0 +1,72 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "exception-007"; + var VERSION = "js1_4"; + var TITLE = "Tests for Actionscript Standard Exceptions: TypeError"; + var BUGNUMBER="318250"; + + startTest(); + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + DefaultValue_1(); + + + function MyObject() { + this.toString = void 0; + this.valueOf = new Object(); + } + + function DefaultValue_1() { + result = "failed: no exception thrown"; + exception = null; + + try { + result = new MyObject() + new MyObject(); + } catch ( e ) { + result = "passed: threw exception", + exception = e.toString(); + } finally { + array[item++] = new TestCase( + SECTION, + "new MyObject() + new MyObject()", + TYPEERROR+1006, + typeError( exception ) ); + } + } + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Exceptions/exception_009.as b/mozilla/js/tamarin/test/ecma3/Exceptions/exception_009.as new file mode 100644 index 00000000000..514482a9e46 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Exceptions/exception_009.as @@ -0,0 +1,71 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "exception-009"; + var VERSION = "JS1_4"; + var TITLE = "Tests for JavaScript Standard Exceptions: SyntaxError"; + var BUGNUMBER= "312964"; + + startTest(); + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + try { + expect = "passed: no exception thrown"; + result = expect; + Nested_1(); + } catch ( e ) { + result = "failed: threw " + e; + } finally { + array[item++] = new TestCase( + SECTION, + "nested try", + expect, + result ); + } + + function Nested_1() { + try { + try { + } catch (a) { + } finally { + } + } catch (b) { + } finally { + } + } + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Exceptions/exception_010_rt.as b/mozilla/js/tamarin/test/ecma3/Exceptions/exception_010_rt.as new file mode 100644 index 00000000000..df52e26bc21 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Exceptions/exception_010_rt.as @@ -0,0 +1,71 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Rob Ginda rginda@netscape.com + */ + +startTest(); + +// un-caught exception +// Null throw test. +// BUGNUMBER: 21799 + +var thisError = "Exited with uncaught exception"; + +try { + throw null; +} catch(e:Error) { + thisError = e.toString(); + trace("FAILED!: Should have exited with uncaught exception."); +} finally { + AddTestCase("Thrown null should be uncaught.", "Exited with uncaught exception", thisError); + test(); +} diff --git a/mozilla/js/tamarin/test/ecma3/Exceptions/exception_011_rt.as b/mozilla/js/tamarin/test/ecma3/Exceptions/exception_011_rt.as new file mode 100644 index 00000000000..202b623590c --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Exceptions/exception_011_rt.as @@ -0,0 +1,70 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Rob Ginda rginda@netscape.com + */ + +startTest(); + +// un-caught exception +// Undefined throw test. + +var thisError = "Exited with uncaught exception"; + +try { + throw (void 0); +} catch(e:Error) { + thisError = e.toString(); + trace("FAILED!: Should have exited with uncaught exception."); +} finally { + AddTestCase("Thrown undefined should be uncaught.", "Exited with uncaught exception", thisError); + test(); +} diff --git a/mozilla/js/tamarin/test/ecma3/Exceptions/exception_014_rt.as b/mozilla/js/tamarin/test/ecma3/Exceptions/exception_014_rt.as new file mode 100644 index 00000000000..7e09c071fae --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Exceptions/exception_014_rt.as @@ -0,0 +1,58 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "exception-014"; + var VERSION = "ECMA_4"; + var TITLE = "Regression test for bug 105083"; + var BUGNUMBER= "105083"; + + startTest(); + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + try { + throw "Exception"; + } catch ( e ) { + array[item++] = new TestCase(SECTION, "first thrown Exception", "Exception", e.toString() ); + } + + try { + throw "Exception"; + } catch ( e1 ) { + array[item++] = new TestCase(SECTION, "first thrown Exception", "Exception", e1.toString() ); + } + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Exceptions/expression_002_rt.as b/mozilla/js/tamarin/test/ecma3/Exceptions/expression_002_rt.as new file mode 100644 index 00000000000..1325d0d069a --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Exceptions/expression_002_rt.as @@ -0,0 +1,80 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "expressions-002.js"; + var VERSION = "JS1_4"; + var TITLE = "Property Accessors"; + writeHeaderToLog( SECTION + " "+TITLE ); + + startTest(); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // go through all Native Function objects, methods, and properties and get their typeof. + + var PROPERTY = new Array(); + var p = 0; + + // try to access properties of primitive types + + OBJECT = new Property( "undefined", void 0, "undefined", NaN ); + + var result = "Failed"; + var exception = "No exception thrown"; + var expect = "Passed"; + + try { + result = OBJECT.value.valueOf(); + } catch ( e:TypeError ) { + result = expect; + exception = e.toString(); + }finally{ + array[item++] = new TestCase( + SECTION, + "Get the value of an object whose value is undefined "+ + "(threw " + typeError(exception) +")", + expect, + result ); + } + return array; +} + + +function Property( object, value, string, number ) { + this.object = object; + this.string = String(value); + this.number = Number(value); + this.valueOf = value; +} diff --git a/mozilla/js/tamarin/test/ecma3/Exceptions/expression_003_rt.as b/mozilla/js/tamarin/test/ecma3/Exceptions/expression_003_rt.as new file mode 100644 index 00000000000..fb8687f2c1c --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Exceptions/expression_003_rt.as @@ -0,0 +1,76 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "expressions-003.js"; + var VERSION = "JS1_4"; + var TITLE = "Property Accessors"; + writeHeaderToLog( SECTION + " "+TITLE ); + + startTest(); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // try to access properties of primitive types + + OBJECT = new Property( "undefined", void 0, "undefined", NaN ); + + var result = "Failed"; + var exception = "No exception thrown"; + var expect = "Passed"; + + try { + result = OBJECT.value.toString(); + } catch ( e:TypeError ) { + result = expect; + exception = e.toString(); + } + + + array[item++] = new TestCase( + SECTION, + "Get the toString value of an object whose value is undefined "+ + "(threw " + typeError(exception) +": undefined has no properties)", + expect, + result ); + + return array; +} + +function Property( object, value, string, number ) { + this.object = object; + this.string = String(value); + this.number = Number(value); + this.value = value; +} diff --git a/mozilla/js/tamarin/test/ecma3/Exceptions/expression_004_rt.as b/mozilla/js/tamarin/test/ecma3/Exceptions/expression_004_rt.as new file mode 100644 index 00000000000..cb8cc2a4e07 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Exceptions/expression_004_rt.as @@ -0,0 +1,72 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "expression-004"; + var VERSION = "JS1_4"; + var TITLE = "Property Accessors"; + writeHeaderToLog( SECTION + " "+TITLE ); + startTest(); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var OBJECT = new Property( "null", null, "null", 0 ); + + var result = "Failed"; + var exception = "No exception thrown"; + var expect = "Passed"; + + try { + result = OBJECT.value.toString(); + } catch ( e ) { + result = expect; + exception = e.toString(); + } + + array[item++] = new TestCase( + SECTION, + "Get the toString value of an object whose value is null "+ + "(threw " + typeError(exception) +": null has no properties)", + expect, + result ); + + return array; +} + +function Property( object, value, string, number ) { + this.object = object; + this.string = String(value); + this.number = Number(value); + this.value = value; +} diff --git a/mozilla/js/tamarin/test/ecma3/Exceptions/expression_005_rt.as b/mozilla/js/tamarin/test/ecma3/Exceptions/expression_005_rt.as new file mode 100644 index 00000000000..f5e06612c5d --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Exceptions/expression_005_rt.as @@ -0,0 +1,65 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "expression-005"; + var VERSION = "JS1_4"; + var TITLE = "The new operator"; + + startTest(); + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var result = "Failed"; + var expect = "Passed"; + var exception = "No exception thrown"; + + try { + result = new Math(); + } catch ( e:TypeError ) { + result = expect; + exception = e.toString(); + }finally{ + + array[item++] = new TestCase( + SECTION, + "result= new Math() (threw " + typeError(exception) + ": Math is not a constructor)", + expect, + result ); + } + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Exceptions/expression_006_rt.as b/mozilla/js/tamarin/test/ecma3/Exceptions/expression_006_rt.as new file mode 100644 index 00000000000..0ff07166933 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Exceptions/expression_006_rt.as @@ -0,0 +1,66 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "expression-006.js"; + var VERSION = "JS1_4"; + var TITLE = "The new operator"; + var BUGNUMBER="327765"; + + startTest(); + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var result = "Failed"; + var exception = "No exception thrown"; + var expect = "Passed"; + + try { + var OBJECT = new Object(); + result = new OBJECT(); + } catch ( e:TypeError ) { + result = expect; + exception = e.toString(); + }finally{ + + array[item++] = new TestCase( + SECTION, + "OBJECT = new Object; result = new OBJECT()" + + " (threw " + typeError(exception) +": Instantiation attempted on a non-constructor.)", + expect, + result ); + } + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Exceptions/expression_007_rt.as b/mozilla/js/tamarin/test/ecma3/Exceptions/expression_007_rt.as new file mode 100644 index 00000000000..aa62339408c --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Exceptions/expression_007_rt.as @@ -0,0 +1,68 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "expression-007"; + var VERSION = "JS1_4"; + var TITLE = "The new operator"; + + startTest(); + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var result = "Failed"; + var exception = "No exception thrown"; + var expect = "Passed"; + var UNDEFINED = void 0; + + try { + + + UNDEFINED(); + } catch ( e:TypeError ) { + + exception = e.toString(); + }finally{ + + array[item++] = new TestCase( + SECTION, + "UNDEFINED = void 0; result = UNDEFINED()" + + " (threw " + typeError(exception) +": Call attempted on an object that is not a function.)", + "TypeError: Error #1006", + typeError(exception) ); + + } + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Exceptions/expression_008_rt.as b/mozilla/js/tamarin/test/ecma3/Exceptions/expression_008_rt.as new file mode 100644 index 00000000000..01e77183a89 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Exceptions/expression_008_rt.as @@ -0,0 +1,66 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "expression-008"; + var VERSION = "JS1_4"; + var TITLE = "The new operator"; + + startTest(); + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var NULL = null; + + + var result = "Failed"; + var exception = "No exception thrown"; + var expect = "Passed"; + + try { + result = new NULL(); + } catch ( e:TypeError ) { + result = expect; + exception = e.toString(); + } + + array[item++] = new TestCase( + SECTION, + "NULL = null; result = new NULL()" + + " (threw " + typeError(exception) +": Attempted to create a new object of a variable)", + expect, + result ); + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Exceptions/expression_009_rt.as b/mozilla/js/tamarin/test/ecma3/Exceptions/expression_009_rt.as new file mode 100644 index 00000000000..793abd69ecc --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Exceptions/expression_009_rt.as @@ -0,0 +1,65 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "expression-009"; + var VERSION = "JS1_4"; + var TITLE = "The new operator"; + + startTest(); + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var STRING = ""; + + var result = "Failed"; + var exception = "No exception thrown"; + var expect = "Passed"; + + try { + result = new STRING(); + } catch ( e:TypeError ) { + result = expect; + exception = e.toString(); + } + + array[item++] = new TestCase( + SECTION, + "STRING = ''; result = new STRING()" + + " (threw " + typeError(exception) +": Attempted to create a new object of a variable)", + expect, + result ); + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Exceptions/expression_010_rt.as b/mozilla/js/tamarin/test/ecma3/Exceptions/expression_010_rt.as new file mode 100644 index 00000000000..cbdb0652532 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Exceptions/expression_010_rt.as @@ -0,0 +1,66 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "expression-010"; + var VERSION = "JS1_4"; + var TITLE = "The new operator"; + + startTest(); + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var NUMBER = 0; + + var result = "Failed"; + var exception = "No exception thrown"; + var expect = "Passed"; + + try { + result = new NUMBER(); + } catch ( e:TypeError ) { + result = expect; + exception = e.toString(); + } + + array[item++] = new TestCase( + SECTION, + "NUMBER=0, result = new NUMBER()" + + " (threw " + typeError(exception) +": Attempted to create a new object of a variable)", + expect, + result ); + return array; +} + diff --git a/mozilla/js/tamarin/test/ecma3/Exceptions/expression_011_rt.as b/mozilla/js/tamarin/test/ecma3/Exceptions/expression_011_rt.as new file mode 100644 index 00000000000..aeafb3bc84d --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Exceptions/expression_011_rt.as @@ -0,0 +1,67 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "expression-011"; + var VERSION = "JS1_4"; + var TITLE = "The new operator"; + + startTest(); + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var BOOLEAN = true; + + var result = "Failed"; + var exception = "No exception thrown"; + var expect = "Passed"; + + try { + var OBJECT = new BOOLEAN(); + } catch ( e:TypeError ) { + result = expect; + exception = e.toString(); + } + + array[item++] = new TestCase( + SECTION, + "BOOLEAN = true; result = new BOOLEAN()" + + " (threw " + typeError(exception) +"Attempted to create a new object of a variable)", + expect, + result ); + + return array; +} + diff --git a/mozilla/js/tamarin/test/ecma3/Exceptions/expression_012_rt.as b/mozilla/js/tamarin/test/ecma3/Exceptions/expression_012_rt.as new file mode 100644 index 00000000000..f54a8c05d06 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Exceptions/expression_012_rt.as @@ -0,0 +1,67 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "expression-012"; + var VERSION = "JS1_4"; + var TITLE = "The new operator"; + var BUGNUMBER= "327765"; + + startTest(); + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var STRING = new String("hi"); + var result = "Failed"; + var exception = "No exception thrown"; + var expect = "Passed"; + + try { + result = new STRING(); + } catch ( e:TypeError ) { + result = expect; + exception = e.toString(); + } + + array[item++] = new TestCase( + SECTION, + "STRING = new String(\"hi\"); result = new STRING()" + + " (threw " + typeError(exception) +"Attempted to create a new object of a variable)", + expect, + result ); + + return array; +} + diff --git a/mozilla/js/tamarin/test/ecma3/Exceptions/expression_013_rt.as b/mozilla/js/tamarin/test/ecma3/Exceptions/expression_013_rt.as new file mode 100644 index 00000000000..50f001e0f09 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Exceptions/expression_013_rt.as @@ -0,0 +1,68 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "expression-013"; + var VERSION = "JS1_4"; + var TITLE = "The new operator"; + var BUGNUMBER= "327765"; + + startTest(); + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var NUMBER = new Number(1); + + var result = "Failed"; + var exception = "No exception thrown"; + var expect = "Passed"; + + try { + result = new NUMBER(); + } catch ( e:TypeError ) { + result = expect; + exception = e.toString(); + } + + array[item++] = new TestCase( + SECTION, + "NUMBER = new Number(1); result = new NUMBER()" + + " (threw " + typeError(exception) +"Attempted to create a new object of a variable)", + expect, + result ); + + return array; +} + diff --git a/mozilla/js/tamarin/test/ecma3/Exceptions/expression_014_rt.as b/mozilla/js/tamarin/test/ecma3/Exceptions/expression_014_rt.as new file mode 100644 index 00000000000..d41f0ac7bd0 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Exceptions/expression_014_rt.as @@ -0,0 +1,69 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "expression-014.js"; + var VERSION = "ECMA_1"; + var TITLE = "The new operator"; + var BUGNUMBER= "327765"; + + startTest(); + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var BOOLEAN = new Boolean(); + + + var result = "Failed"; + var exception = "No exception thrown"; + var expect = "Passed"; + + try { + result = new BOOLEAN(); + } catch ( e:TypeError ) { + result = expect; + exception = e.toString(); + } + + array[item++] = new TestCase( + SECTION, + "BOOLEAN = new Boolean(); result = new BOOLEAN()" + + " (threw " + typeError(exception) +"Attempted to create a new object of a variable which is not function/class)", + expect, + result ); + + return array; +} + diff --git a/mozilla/js/tamarin/test/ecma3/Exceptions/expression_016_rt.as b/mozilla/js/tamarin/test/ecma3/Exceptions/expression_016_rt.as new file mode 100644 index 00000000000..816c2fbf195 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Exceptions/expression_016_rt.as @@ -0,0 +1,64 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "expression-016"; + var VERSION = "JS1_4"; + var TITLE = "Function Calls"; + + startTest(); + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var result = "Failed"; + var exception = "No exception thrown"; + var expect = "Passed"; + + try { + result = (void 0).valueOf(); + } catch ( e:TypeError ) { + result = expect; + exception = e.toString(); + } + + array[item++] = new TestCase( + SECTION, + "(void 0).valueOf()" + + " (threw " + typeError(exception) +"Attempted to create an object of a variable that is not a function/class)", + expect, + result ); + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Exceptions/expression_017_rt.as b/mozilla/js/tamarin/test/ecma3/Exceptions/expression_017_rt.as new file mode 100644 index 00000000000..d762638a5e3 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Exceptions/expression_017_rt.as @@ -0,0 +1,64 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "expression-017"; + var VERSION = "JS1_4"; + var TITLE = "Function Calls"; + + startTest(); + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var result = "Failed"; + var exception = "No exception thrown"; + var expect = "Passed"; + + try { + result = nullvalueOf(); + } catch ( e ) { + result = expect; + exception = e.toString(); + } + + array[item++] = new TestCase( + SECTION, + "null.valueOf()" + + " (threw " + referenceError(exception) +")", + expect, + result ); + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Exceptions/expression_019_rt.as b/mozilla/js/tamarin/test/ecma3/Exceptions/expression_019_rt.as new file mode 100644 index 00000000000..bcba85f1615 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Exceptions/expression_019_rt.as @@ -0,0 +1,67 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "expression-019"; + var VERSION = "JS1_4"; + var TITLE = "The new operator"; + var BUGNUMBER= "327765"; + + startTest(); + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var result = "Failed"; + var exception = "No exception thrown"; + var expect = "Passed"; + + try { + var STRING = new String("hi"); + result = new STRING(); + } catch ( e:TypeError ) { + result = expect; + exception = e.toString(); + } + + array[item++] = new TestCase( + SECTION, + "var STRING = new String(\"hi\"); result = new STRING();" + + " (threw " + typeError(exception) + "Attempt to create a new object of an object which is not function/class)", + expect, + result ); + + return array; +} + diff --git a/mozilla/js/tamarin/test/ecma3/Exceptions/global_001_rt.as b/mozilla/js/tamarin/test/ecma3/Exceptions/global_001_rt.as new file mode 100644 index 00000000000..a3db3b88ee1 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Exceptions/global_001_rt.as @@ -0,0 +1,65 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "global-001"; + var VERSION = "ECMA_1"; + var TITLE = "The Global Object"; + + startTest(); + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + + var result = "Failed"; + var exception = "No exception thrown"; + var expect = "Passed"; + + try { + result = new this(); + } catch ( e:TypeError ) { + result = expect; + exception = e.toString(); + } + + array[item++] = new TestCase( + SECTION, + "result = new this()" + + " (threw " + typeError(exception) +")", + expect, + result ); + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Exceptions/global_002_rt.as b/mozilla/js/tamarin/test/ecma3/Exceptions/global_002_rt.as new file mode 100644 index 00000000000..ce5b2b90440 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Exceptions/global_002_rt.as @@ -0,0 +1,64 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "global-002"; + var VERSION = "JS1_4"; + var TITLE = "The Global Object"; + + startTest(); + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var result = "Failed"; + var exception = "No exception thrown"; + var expect = "Passed"; + + try { + result = this(); + } catch ( e:TypeError ) { + result = expect; + exception = e.toString(); + } + + array[item++] = new TestCase( + SECTION, + "result = this()" + + " (threw " + typeError(exception) +"Attempted to create a new object on an object that is not function/class)", + expect, + result ); + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Exceptions/number_001_rt.as b/mozilla/js/tamarin/test/ecma3/Exceptions/number_001_rt.as new file mode 100644 index 00000000000..84834e08bea --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Exceptions/number_001_rt.as @@ -0,0 +1,70 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "number-001"; + var VERSION = "JS1_4"; + var TITLE = "Exceptions for Number.toString()"; + + startTest(); + writeHeaderToLog( SECTION + " Number.prototype.toString()"); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + + var result = "Failed"; + var exception = "No exception"; + var expect = "Passed"; + + + try { + object= new Object(); + + object.toString = Number.prototype.toString; + result = object.toString(); + expect = result; + } catch ( e:Error ) { + result = expect; + exception = (e.toString()).substring(0,18); + } + + array[item++] = new TestCase( + SECTION, + "object = new Object(); object.toString = Number.prototype.toString; object.toString()" + + " (threw " + exception +")", + expect, + result ); + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Exceptions/number_002_rt.as b/mozilla/js/tamarin/test/ecma3/Exceptions/number_002_rt.as new file mode 100644 index 00000000000..21703b01a6a --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Exceptions/number_002_rt.as @@ -0,0 +1,69 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "number-002"; + var VERSION = "JS1_4"; + var TITLE = "Exceptions for Number.valueOf()"; + + startTest(); + writeHeaderToLog( SECTION + " Number.prototype.valueOf()"); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var result = "Failed"; + var exception = "No exception thrown"; + var expect = "Passed"; + + try { + object= new Object(); + + object.valueOf=Number.prototype.valueOf; + + result = object.valueOf(); + + } catch ( e ) { + result = expect; + exception = (e.toString()).substring(0,22); + } + + array[item++] = new TestCase( + SECTION, + "object = new Object(); object.valueOf = Number.prototype.valueOf; object.valueOf()" + + " (threw " + exception +")", + expect, + result ); + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Exceptions/number_003_rt.as b/mozilla/js/tamarin/test/ecma3/Exceptions/number_003_rt.as new file mode 100644 index 00000000000..df97aee9fb3 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Exceptions/number_003_rt.as @@ -0,0 +1,121 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "number-003"; + var VERSION = "ECMA_4"; + var TITLE = "Exceptions for Number.valueOf()"; + + startTest(); + writeHeaderToLog( SECTION + " Number.prototype.valueOf()"); + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + + var result = "Failed"; + var exception = "No exception thrown"; + var expect = "Passed"; + + try { + VALUE_OF = Number.prototype.valueOf; + OBJECT = new String("Infinity"); + OBJECT.valueOf = VALUE_OF; + result = OBJECT.valueOf(); + } catch ( e ) { + result = expect; + exception = e.toString(); + } + + array[item++] = new TestCase( + SECTION, + "Assigning Number.prototype.valueOf as the valueOf of a String object " + + " (threw " + referenceError(exception) +")", + expect, + result ); + + // new Number() + try { + VALUE_OF = Number.prototype.valueOf; + OBJECT = new Number(); + OBJECT.valueOf = VALUE_OF; + result = OBJECT.valueOf(); + } catch ( e1:ReferenceError ) { + result = expect; + exception = e1.toString(); + } + + array[item++] = new TestCase( + SECTION, + "Assigning Number.prototype.valueOf as the valueOf of new Number() " + + " (threw " + referenceError(exception) +")", + expect, + result ); + + // new Number(4) + try { + VALUE_OF = Number.prototype.valueOf; + OBJECT = new Number(4); + OBJECT.valueOf = VALUE_OF; + result = OBJECT.valueOf(); + } catch ( e2 ) { + result = expect; + exception = e2.toString(); + } + + array[item++] = new TestCase( + SECTION, + "Assigning Number.prototype.valueOf as the valueOf of new Number(4) " + + " (threw " + referenceError(exception) +")", + expect, + result ); + + // 4 + try { + VALUE_OF = Number.prototype.valueOf; + OBJECT = 4; + OBJECT.valueOf = VALUE_OF; + result = OBJECT.valueOf(); + } catch ( e3 ) { + result = expect; + exception = e3.toString(); + } + + array[item++] = new TestCase( + SECTION, + "Assigning Number.prototype.valueOf as the valueOf of '4' " + + " (threw " + referenceError(exception) +")", + expect, + result ); + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Exceptions/number_004_rt.as b/mozilla/js/tamarin/test/ecma3/Exceptions/number_004_rt.as new file mode 100644 index 00000000000..fdca0e9dee2 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Exceptions/number_004_rt.as @@ -0,0 +1,123 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "number-003"; + var VERSION = "ECMA_4"; + var TITLE = "Exceptions for Number.toString()"; + + startTest(); + writeHeaderToLog( SECTION + " Number.prototype.toString()"); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + + var result = "Failed"; + var exception = "No exception thrown"; + var expect = "Passed"; + + try { + tostr = Number.prototype.toString; + OBJECT = new String("Infinity"); + OBJECT.toString= tostr; + result = OBJECT.toString(); + } catch ( e:ReferenceError ) { + result = expect; + exception = e.toString(); + } + + array[item++] = new TestCase( + SECTION, + "Assigning Number.prototype.toString as the toString of a String object " + + " (threw " + referenceError(exception) +")", + expect, + result ); + + // new Number() + try { + tostr= Number.prototype.toString; + OBJECT = new Number(); + OBJECT.toString= tostr; + result = OBJECT.toString(); + } catch ( e1:ReferenceError ) { + result = expect; + exception = e1.toString(); + } + + array[item++] = new TestCase( + SECTION, + "Assigning Number.prototype.toString as the toString of new Number() " + + " (threw " + referenceError(exception) +")", + expect, + result ); + + // new Number(4) + try { + tostr= Number.prototype.toString; + OBJECT = new Number(4); + OBJECT.toString= tostr; + result = OBJECT.toString (); + } catch ( e2:ReferenceError ) { + result = expect; + exception = e2.toString(); + } + + array[item++] = new TestCase( + SECTION, + "Assigning Number.prototype.toString as the toString of new Number(4) " + + " (threw " + referenceError(exception) +")", + expect, + result ); + + // 4 + try { + tostr= Number.prototype.toString; + OBJECT = 4; + OBJECT.toString= tostr; + result = OBJECT.toString(); + } catch ( e3:ReferenceError ) { + result = expect; + exception = e3.toString(); + } + + array[item++] = new TestCase( + SECTION, + "Assigning Number.prototype.toString as the toString of '4' " + + " (threw " + referenceError(exception) +")", + expect, + result ); + + return array; +} + diff --git a/mozilla/js/tamarin/test/ecma3/Exceptions/regress_58946.as b/mozilla/js/tamarin/test/ecma3/Exceptions/regress_58946.as new file mode 100644 index 00000000000..6b74e159fa6 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Exceptions/regress_58946.as @@ -0,0 +1,92 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* +* The contents of this file are subject to the Netscape Public +* License Version 1.1 (the "License"); you may not use this file +* except in compliance with the License. You may obtain a copy of +* the License at http://www.mozilla.org/NPL/ +* +* Software distributed under the License is distributed on an "AS +* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or +* implied. See the License for the specific language governing +* rights and limitations under the License. +* +* The Original Code is mozilla.org code. +* +* The Initial Developer of the Original Code is Netscape +* Communications Corporation. Portions created by Netscape are +* Copyright (C) 1998 Netscape Communications Corporation. All +* Rights Reserved. +* +* Contributor(s): pschwartau@netscape.com +* +* +*This test arose from Bugzilla bug 58946. +*The bug was filed when we got the following error (see code below): +* +* "ReferenceError: e is not defined" +* +*There was no error if we replaced "return e" in the code below with "print(e)". +*There should be no error with "return e", either - +*/ +//------------------------------------------------------------------------------------------------- +var THE_ERROR = "return_error"; + +startTest(); + +var stat = "Testing a return statement inside a catch block inside a function"; +printStatus (stat); +var testcases = getTestCases(); +test(); + +function getTestCases() +{ + var array = new Array(); + var item = 0; + + var thisError = throwError(); + + array[item++] = new TestCase(SECTION, "throwError()", THE_ERROR, thisError); + + return array; +} + +function throwError() +{ + try + { + throw THE_ERROR; + } + catch(e) + { + return e; + } +} diff --git a/mozilla/js/tamarin/test/ecma3/Exceptions/regress_95101.as b/mozilla/js/tamarin/test/ecma3/Exceptions/regress_95101.as new file mode 100644 index 00000000000..91350ef7db8 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Exceptions/regress_95101.as @@ -0,0 +1,113 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* +* The contents of this file are subject to the Netscape Public +* License Version 1.1 (the "License"); you may not use this file +* except in compliance with the License. You may obtain a copy of +* the License at http://www.mozilla.org/NPL/ +* +* Software distributed under the License is distributed on an "AS +* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or +* implied. See the License for the specific language governing +* rights and limitations under the License. +* +* The Original Code is mozilla.org code. +* +* The Initial Developer of the Original Code is Netscape +* Communications Corporation. Portions created by Netscape are +* Copyright (C) 1998 Netscape Communications Corporation. +* All Rights Reserved. +* +* Contributor(s): pschwartau@netscape.com +* Date: 13 August 2001 +* +* SUMMARY: Invoking an undefined function should produce a ReferenceError +* See http://bugzilla.mozilla.org/show_bug.cgi?id=95101 +*/ +//----------------------------------------------------------------------------- + var SECTION = "regress_95101"; + var VERSION = ""; + var bug = 95101; + var TITLE = "Invoking an undefined function should produce a ReferenceError"; + var msgERR_REF_YES = 'ReferenceError'; + var msgERR_REF_NO = 'did NOT generate a ReferenceError'; + + printBugNumber (bug); + printStatus (TITLE); + + startTest(); + writeHeaderToLog( SECTION + " Number.prototype.valueOf()"); + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + var UBound = 0; + var status = ''; + var statusitems = []; + var actual = ''; + var actualvalues = []; + var expect= ''; + var expectedvalues = []; + + + try + { + xxxyyyzzz(); + } + catch (e) + { + status = 'Section 1 of test'; + actual = e instanceof ReferenceError; + expect = true; + array[item++] = new TestCase(SECTION, status, expect, actual); + + + /* + * This test is more literal, and may one day be invalid. + * Searching for literal string "ReferenceError" in e.toString() + */ + status = 'Section 2 of test'; + var match = e.toString().search(/ReferenceError/); + actual = (match > -1); + expect = true; + array[item++] = new TestCase(SECTION, status, expect, actual); + } + return array; +} + + +// converts a Boolean result into a textual result - +function isReferenceError(bResult) +{ + return bResult? msgERR_REF_YES : msgERR_REF_NO; +} diff --git a/mozilla/js/tamarin/test/ecma3/Exceptions/string_001_rt.as b/mozilla/js/tamarin/test/ecma3/Exceptions/string_001_rt.as new file mode 100644 index 00000000000..685129f2037 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Exceptions/string_001_rt.as @@ -0,0 +1,69 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "string-001"; + var VERSION = "JS1_4"; + var TITLE = "String.prototype.toString"; + + startTest(); + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var result = "Failed"; + var exception = "No exception thrown"; + var expect = "Passed"; + + try { + OBJECT = new Object(); + OBJECT.toString = String.prototype.toString; + result = OBJECT.toString(); + } catch ( e:TypeError) { + result = expect; + exception = e.toString(); + } + + array[item++] = new TestCase( + SECTION, + "OBJECT = new Object(); "+ + " OBJECT.toString = String.prototype.toString; OBJECT.toString()" + + " (threw " + typeError(exception) +")", + expect, + result ); + trace(exception); + + return array; +} + diff --git a/mozilla/js/tamarin/test/ecma3/Exceptions/string_002_rt.as b/mozilla/js/tamarin/test/ecma3/Exceptions/string_002_rt.as new file mode 100644 index 00000000000..c019a32051b --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Exceptions/string_002_rt.as @@ -0,0 +1,68 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "string-002"; + var VERSION = "JS1_4"; + var TITLE = "String.prototype.valueOf"; + + startTest(); + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var result = "Failed"; + var exception = "No exception thrown"; + var expect = "Passed"; + + try { + var OBJECT =new Object(); + OBJECT.valueOf = String.prototype.valueOf; + result = OBJECT.valueOf(); + } catch ( e ) { + result = expect; + exception = e.toString(); + } + + array[item++] = new TestCase( + SECTION, + "OBJECT = new Object; OBJECT.valueOf = String.prototype.valueOf;"+ + "result = OBJECT.valueOf();" + + " (threw " + exception +")", + expect, + result ); + + return array; +} + diff --git a/mozilla/js/tamarin/test/ecma3/ExecutionContexts/e10_1_3.as b/mozilla/js/tamarin/test/ecma3/ExecutionContexts/e10_1_3.as new file mode 100644 index 00000000000..6b2bc6360f7 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/ExecutionContexts/e10_1_3.as @@ -0,0 +1,85 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Rob Ginda rginda@netscape.com + */ + + + var SECTION = "10.1.3"; + var VERSION = ""; + var TITLE = "Variable Instantiation"; + var bug = "17290"; + + startTest(); + writeHeaderToLog( SECTION + " "+ TITLE); + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + function f() + { + var x; + + return typeof x; + + function x() + { + return 7; + } + } + + array[item++] = new TestCase(SECTION, "Declaration precedence test", "function", f()); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/ExecutionContexts/e10_1_3_1.as b/mozilla/js/tamarin/test/ecma3/ExecutionContexts/e10_1_3_1.as new file mode 100644 index 00000000000..64266f69fa5 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/ExecutionContexts/e10_1_3_1.as @@ -0,0 +1,205 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* ***** BEGIN LICENSE BLOCK ***** +* Version: NPL 1.1/GPL 2.0/LGPL 2.1 +* +* The contents of this file are subject to the Netscape Public License +* Version 1.1 (the "License"); you may not use this file except in +* compliance with the License. You may obtain a copy of the License at +* http://www.mozilla.org/NPL/ +* +* Software distributed under the License is distributed on an "AS IS" basis, +* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +* for the specific language governing rights and limitations under the +* License. +* +* The Original Code is JavaScript Engine testing utilities. +* +* The Initial Developer of the Original Code is Netscape Communications Corp. +* Portions created by the Initial Developer are Copyright (C) 2002 +* the Initial Developer. All Rights Reserved. +* +* Contributor(s): pschwartau@netscape.com +* +* Alternatively, the contents of this file may be used under the terms of +* either the GNU General Public License Version 2 or later (the "GPL"), or +* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +* in which case the provisions of the GPL or the LGPL are applicable instead +* of those above. If you wish to allow use of your version of this file only +* under the terms of either the GPL or the LGPL, and not to allow others to +* use your version of this file under the terms of the NPL, indicate your +* decision by deleting the provisions above and replace them with the notice +* and other provisions required by the GPL or the LGPL. If you do not delete +* the provisions above, a recipient may use your version of this file under +* the terms of any one of the NPL, the GPL or the LGPL. +* +* ***** END LICENSE BLOCK ***** +* +* +* Date: 11 Feb 2002 +* SUMMARY: Testing functions having duplicate formal parameter names +* +* Note: given function f(x,x,x,x) {return x;}; f(1,2,3,4) should return 4. +* See ECMA-262 3rd Edition Final Section 10.1.3: Variable Instantiation +* +* Also see http://bugzilla.mozilla.org/show_bug.cgi?id=124900 +*/ +//----------------------------------------------------------------------------- + var SECTION = "e10_1_3_1"; + var VERSION = ""; + var TITLE = "Testing functions having duplicate formal parameter names"; + var bug = "124900"; + + startTest(); + writeHeaderToLog( SECTION + " "+ TITLE); + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var status = ''; + var actual = ''; + var expect= ''; + + + function f1(x,x) + { + return x; + } + status = inSection(1); + actual = f1(1,2); + expect = 2; + array[item++] = new TestCase(SECTION, status, expect, actual); + + + function f2(x,x,x) + { + return x*x*x; + } + status = inSection(2); + actual = f2(1,2,3); + expect = 27; + array[item++] = new TestCase(SECTION, status, expect, actual); + + + function f3(x,x,x,x) + { + return 'a' + x + 'b' + x + 'c' + x ; + } + status = inSection(3); + actual = f3(1,2,3,4); + expect = 'a4b4c4'; + array[item++] = new TestCase(SECTION, status, expect, actual); + + + /* + * If the value of the last duplicate parameter is not provided by + * the function caller, the value of this parameter is undefined + */ + function f4(x,a,b,x,z) + { + return x; + } + status = inSection(4); + actual = f4(1,2); + expect = undefined; + array[item++] = new TestCase(SECTION, status, expect, actual); + + + /* + * f.toString() should preserve any duplicate formal parameter names that exist + */ + function f5(x,x,x,x) + { + } + status = inSection(5); + actual = f5.toString(); + expect = 'function Function() {}'; + array[item++] = new TestCase(SECTION, status, expect, actual); + + + function f6(x,x,x,x) + { + var ret = []; + + for (var i=0; i= Math.pow(2,31) ) ? n - Math.pow(2,32) : n; + + return ( n ); +} +function ToUint32( n ) { + n = Number( n ); + var sign = ( n < 0 ) ? -1 : 1; + + if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY) { + return 0; + } + n = sign * Math.floor( Math.abs(n) ) + + n = n % Math.pow(2,32); + + if ( n < 0 ){ + n += Math.pow(2,32); + } + + return ( n ); +} +function ToUint16( n ) { + var sign = ( n < 0 ) ? -1 : 1; + + if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY) { + return 0; + } + + n = ( sign * Math.floor( Math.abs(n) ) ) % Math.pow(2,16); + + if (n <0) { + n += Math.pow(2,16); + } + + return ( n ); +} +function Mask( b, n ) { + b = ToUint32BitString( b ); + b = b.substring( b.length - n ); + b = ToUint32Decimal( b ); + return ( b ); +} +function ToUint32BitString( n ) { + var b = ""; + for ( p = 31; p >=0; p-- ) { + if ( n >= Math.pow(2,p) ) { + b += "1"; + n -= Math.pow(2,p); + } else { + b += "0"; + } + } + return b; +} +function ToInt32BitString( n ) { + var b = ""; + var sign = ( n < 0 ) ? -1 : 1; + + b += ( sign == 1 ) ? "0" : "1"; + + for ( p = 30; p >=0; p-- ) { + if ( (sign == 1 ) ? sign * n >= Math.pow(2,p) : sign * n > Math.pow(2,p) ) { + b += ( sign == 1 ) ? "1" : "0"; + n -= sign * Math.pow( 2, p ); + } else { + b += ( sign == 1 ) ? "0" : "1"; + } + } + + return b; +} +function ToInt32Decimal( bin ) { + var r = 0; + var sign; + + if ( Number(bin.charAt(0)) == 0 ) { + sign = 1; + r = 0; + } else { + sign = -1; + r = -(Math.pow(2,31)); + } + + for ( var j = 0; j < 31; j++ ) { + r += Math.pow( 2, j ) * Number(bin.charAt(31-j)); + } + + return r; +} +function ToUint32Decimal( bin ) { + var r = 0; + + + for ( l = bin.length; l < 32; l++ ) { + bin = "0" + bin; + } + + for ( j = 0; j < 31; j++ ) { + r += Math.pow( 2, j ) * Number(bin.charAt(31-j)); + + } + + return r; +} +function And( s, a ) { + s = ToInt32( s ); + a = ToInt32( a ); + + var bs = ToInt32BitString( s ); + var ba = ToInt32BitString( a ); + + var result = ""; + + for ( var bit = 0; bit < bs.length; bit++ ) { + if ( bs.charAt(bit) == "1" && ba.charAt(bit) == "1" ) { + result += "1"; + } else { + result += "0"; + } + } + return ToInt32Decimal(result); +} +function Xor( s, a ) { + s = ToInt32( s ); + a = ToInt32( a ); + + var bs = ToInt32BitString( s ); + var ba = ToInt32BitString( a ); + + var result = ""; + + for ( var bit = 0; bit < bs.length; bit++ ) { + if ( (bs.charAt(bit) == "1" && ba.charAt(bit) == "0") || + (bs.charAt(bit) == "0" && ba.charAt(bit) == "1") + ) { + result += "1"; + } else { + result += "0"; + } + } + + return ToInt32Decimal(result); +} +function Or( s, a ) { + s = ToInt32( s ); + a = ToInt32( a ); + + var bs = ToInt32BitString( s ); + var ba = ToInt32BitString( a ); + + var result = ""; + + for ( var bit = 0; bit < bs.length; bit++ ) { + if ( bs.charAt(bit) == "1" || ba.charAt(bit) == "1" ) { + result += "1"; + } else { + result += "0"; + } + } + + return ToInt32Decimal(result); +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_10_2.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_10_2.as new file mode 100644 index 00000000000..78e00e0eda4 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_10_2.as @@ -0,0 +1,243 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "e11_10_2"; + var VERSION = "ECMA_1"; + startTest(); + + var testcases = getTestCases(); + + writeHeaderToLog( SECTION + " Binary Bitwise Operators: |"); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + var shiftexp = 0; + var addexp = 0; + + for ( shiftpow = 0; shiftpow < 33; shiftpow++ ) { + shiftexp += Math.pow( 2, shiftpow ); + + for ( addpow = 0; addpow < 33; addpow++ ) { + addexp += Math.pow(2, addpow); + + array[item++] = new TestCase( SECTION, + shiftexp + " | " + addexp, + Or( shiftexp, addexp ), + shiftexp | addexp ); + } + } + + return ( array ); +} +function ToInteger( n ) { + n = Number( n ); + var sign = ( n < 0 ) ? -1 : 1; + + if ( n != n ) { + return 0; + } + if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY ) { + return n; + } + return ( sign * Math.floor(Math.abs(n)) ); +} +function ToInt32( n ) { + n = Number( n ); + var sign = ( n < 0 ) ? -1 : 1; + + if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY) { + return 0; + } + + n = (sign * Math.floor( Math.abs(n) )) % Math.pow(2,32); + n = ( n >= Math.pow(2,31) ) ? n - Math.pow(2,32) : n; + + return ( n ); +} +function ToUint32( n ) { + n = Number( n ); + var sign = ( n < 0 ) ? -1 : 1; + + if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY) { + return 0; + } + n = sign * Math.floor( Math.abs(n) ) + + n = n % Math.pow(2,32); + + if ( n < 0 ){ + n += Math.pow(2,32); + } + + return ( n ); +} +function ToUint16( n ) { + var sign = ( n < 0 ) ? -1 : 1; + + if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY) { + return 0; + } + + n = ( sign * Math.floor( Math.abs(n) ) ) % Math.pow(2,16); + + if (n <0) { + n += Math.pow(2,16); + } + + return ( n ); +} +function Mask( b, n ) { + b = ToUint32BitString( b ); + b = b.substring( b.length - n ); + b = ToUint32Decimal( b ); + return ( b ); +} +function ToUint32BitString( n ) { + var b = ""; + for ( p = 31; p >=0; p-- ) { + if ( n >= Math.pow(2,p) ) { + b += "1"; + n -= Math.pow(2,p); + } else { + b += "0"; + } + } + return b; +} +function ToInt32BitString( n ) { + var b = ""; + var sign = ( n < 0 ) ? -1 : 1; + + b += ( sign == 1 ) ? "0" : "1"; + + for ( p = 30; p >=0; p-- ) { + if ( (sign == 1 ) ? sign * n >= Math.pow(2,p) : sign * n > Math.pow(2,p) ) { + b += ( sign == 1 ) ? "1" : "0"; + n -= sign * Math.pow( 2, p ); + } else { + b += ( sign == 1 ) ? "0" : "1"; + } + } + + return b; +} +function ToInt32Decimal( bin ) { + var r = 0; + var sign; + + if ( Number(bin.charAt(0)) == 0 ) { + sign = 1; + r = 0; + } else { + sign = -1; + r = -(Math.pow(2,31)); + } + + for ( var j = 0; j < 31; j++ ) { + r += Math.pow( 2, j ) * Number(bin.charAt(31-j)); + } + + return r; +} +function ToUint32Decimal( bin ) { + var r = 0; + + + for ( l = bin.length; l < 32; l++ ) { + bin = "0" + bin; + } + + for ( j = 0; j < 31; j++ ) { + r += Math.pow( 2, j ) * Number(bin.charAt(31-j)); + + } + + return r; +} +function And( s, a ) { + s = ToInt32( s ); + a = ToInt32( a ); + + var bs = ToInt32BitString( s ); + var ba = ToInt32BitString( a ); + + var result = ""; + + for ( var bit = 0; bit < bs.length; bit++ ) { + if ( bs.charAt(bit) == "1" && ba.charAt(bit) == "1" ) { + result += "1"; + } else { + result += "0"; + } + } + return ToInt32Decimal(result); +} +function Xor( s, a ) { + s = ToInt32( s ); + a = ToInt32( a ); + + var bs = ToInt32BitString( s ); + var ba = ToInt32BitString( a ); + + var result = ""; + + for ( var bit = 0; bit < bs.length; bit++ ) { + if ( (bs.charAt(bit) == "1" && ba.charAt(bit) == "0") || + (bs.charAt(bit) == "0" && ba.charAt(bit) == "1") + ) { + result += "1"; + } else { + result += "0"; + } + } + + return ToInt32Decimal(result); +} +function Or( s, a ) { + s = ToInt32( s ); + a = ToInt32( a ); + + var bs = ToInt32BitString( s ); + var ba = ToInt32BitString( a ); + + var result = ""; + + for ( var bit = 0; bit < bs.length; bit++ ) { + if ( bs.charAt(bit) == "1" || ba.charAt(bit) == "1" ) { + result += "1"; + } else { + result += "0"; + } + } + + return ToInt32Decimal(result); +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_10_3.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_10_3.as new file mode 100644 index 00000000000..a5e064e2b2a --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_10_3.as @@ -0,0 +1,242 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "e11_10_3"; + var VERSION = "ECMA_1"; + startTest(); + + var testcases = getTestCases(); + + writeHeaderToLog( SECTION + " Binary Bitwise Operators: ^"); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + var shiftexp = 0; + var addexp = 0; + + for ( shiftpow = 0; shiftpow < 33; shiftpow++ ) { + shiftexp += Math.pow( 2, shiftpow ); + + for ( addpow = 0; addpow < 33; addpow++ ) { + addexp += Math.pow(2, addpow); + + array[item++] = new TestCase( SECTION, + shiftexp + " ^ " + addexp, + Xor( shiftexp, addexp ), + shiftexp ^ addexp ); + } + } + + return ( array ); +} +function ToInteger( n ) { + n = Number( n ); + var sign = ( n < 0 ) ? -1 : 1; + + if ( n != n ) { + return 0; + } + if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY ) { + return n; + } + return ( sign * Math.floor(Math.abs(n)) ); +} +function ToInt32( n ) { + n = Number( n ); + var sign = ( n < 0 ) ? -1 : 1; + + if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY) { + return 0; + } + + n = (sign * Math.floor( Math.abs(n) )) % Math.pow(2,32); + n = ( n >= Math.pow(2,31) ) ? n - Math.pow(2,32) : n; + + return ( n ); +} +function ToUint32( n ) { + n = Number( n ); + var sign = ( n < 0 ) ? -1 : 1; + + if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY) { + return 0; + } + n = sign * Math.floor( Math.abs(n) ) + + n = n % Math.pow(2,32); + + if ( n < 0 ){ + n += Math.pow(2,32); + } + + return ( n ); +} +function ToUint16( n ) { + var sign = ( n < 0 ) ? -1 : 1; + + if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY) { + return 0; + } + + n = ( sign * Math.floor( Math.abs(n) ) ) % Math.pow(2,16); + + if (n <0) { + n += Math.pow(2,16); + } + + return ( n ); +} +function Mask( b, n ) { + b = ToUint32BitString( b ); + b = b.substring( b.length - n ); + b = ToUint32Decimal( b ); + return ( b ); +} +function ToUint32BitString( n ) { + var b = ""; + for ( p = 31; p >=0; p-- ) { + if ( n >= Math.pow(2,p) ) { + b += "1"; + n -= Math.pow(2,p); + } else { + b += "0"; + } + } + return b; +} +function ToInt32BitString( n ) { + var b = ""; + var sign = ( n < 0 ) ? -1 : 1; + + b += ( sign == 1 ) ? "0" : "1"; + + for ( p = 30; p >=0; p-- ) { + if ( (sign == 1 ) ? sign * n >= Math.pow(2,p) : sign * n > Math.pow(2,p) ) { + b += ( sign == 1 ) ? "1" : "0"; + n -= sign * Math.pow( 2, p ); + } else { + b += ( sign == 1 ) ? "0" : "1"; + } + } + + return b; +} +function ToInt32Decimal( bin ) { + var r = 0; + var sign; + + if ( Number(bin.charAt(0)) == 0 ) { + sign = 1; + r = 0; + } else { + sign = -1; + r = -(Math.pow(2,31)); + } + + for ( var j = 0; j < 31; j++ ) { + r += Math.pow( 2, j ) * Number(bin.charAt(31-j)); + } + + return r; +} +function ToUint32Decimal( bin ) { + var r = 0; + + for ( l = bin.length; l < 32; l++ ) { + bin = "0" + bin; + } + + for ( j = 0; j < 31; j++ ) { + r += Math.pow( 2, j ) * Number(bin.charAt(31-j)); + + } + + return r; +} +function And( s, a ) { + s = ToInt32( s ); + a = ToInt32( a ); + + var bs = ToInt32BitString( s ); + var ba = ToInt32BitString( a ); + + var result = ""; + + for ( var bit = 0; bit < bs.length; bit++ ) { + if ( bs.charAt(bit) == "1" && ba.charAt(bit) == "1" ) { + result += "1"; + } else { + result += "0"; + } + } + return ToInt32Decimal(result); +} +function Xor( s, a ) { + s = ToInt32( s ); + a = ToInt32( a ); + + var bs = ToInt32BitString( s ); + var ba = ToInt32BitString( a ); + + var result = ""; + + for ( var bit = 0; bit < bs.length; bit++ ) { + if ( (bs.charAt(bit) == "1" && ba.charAt(bit) == "0") || + (bs.charAt(bit) == "0" && ba.charAt(bit) == "1") + ) { + result += "1"; + } else { + result += "0"; + } + } + + return ToInt32Decimal(result); +} +function Or( s, a ) { + s = ToInt32( s ); + a = ToInt32( a ); + + var bs = ToInt32BitString( s ); + var ba = ToInt32BitString( a ); + + var result = ""; + + for ( var bit = 0; bit < bs.length; bit++ ) { + if ( bs.charAt(bit) == "1" || ba.charAt(bit) == "1" ) { + result += "1"; + } else { + result += "0"; + } + } + + return ToInt32Decimal(result); +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_11.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_11.as new file mode 100644 index 00000000000..75ca2e54b63 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_11.as @@ -0,0 +1,109 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "11.11"; + var VERSION = "ECMA_1"; + var BUGNUMBER="771111"; + + startTest(); + var testcases = getTestCases(); + writeHeaderToLog( SECTION + " The Binary Logical Operator ( && )"); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "void 0 && void 0", undefined, void 0 && void 0 ); + array[item++] = new TestCase( SECTION, "null && null", null, null && null ); + array[item++] = new TestCase( SECTION, "0 && 0", 0, 0 && 0 ); + array[item++] = new TestCase( SECTION, "1 && 1", 1, 1 && 1 ); + array[item++] = new TestCase( SECTION, "-1 && -1", -1, -1 && -1 ); + array[item++] = new TestCase( SECTION, "54 && 54", 54, 54 && 54 ); + array[item++] = new TestCase( SECTION, "54 && 45", 45, 54 && 45 ); + array[item++] = new TestCase( SECTION, "true && true", true, true && true ); + array[item++] = new TestCase( SECTION, "true && false", false, true && false ); + array[item++] = new TestCase( SECTION, "false && true", false, false && true ); + array[item++] = new TestCase( SECTION, "false && false", false, false && false ); + array[item++] = new TestCase( SECTION, "0 && true", 0, 0 && true ); + array[item++] = new TestCase( SECTION, "true && 0", 0, true && 0 ); + array[item++] = new TestCase( SECTION, "true && 1", 1, true && 1 ); + array[item++] = new TestCase( SECTION, "1 && true", true, 1 && true ); + array[item++] = new TestCase( SECTION, "-1 && true", true, -1 && true ); + array[item++] = new TestCase( SECTION, "true && -1", -1, true && -1 ); + array[item++] = new TestCase( SECTION, "true && 9", 9, true && 9 ); + array[item++] = new TestCase( SECTION, "true && -9", -9, true && -9 ); + array[item++] = new TestCase( SECTION, "9 && true", true, 9 && true ); + array[item++] = new TestCase( SECTION, "true && Number.POSITIVE_INFINITY", Number.POSITIVE_INFINITY, true && Number.POSITIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY && true", true, Number.NEGATIVE_INFINITY && true ); + array[item++] = new TestCase( SECTION, "true && 'str'", "str", true && "str" ); + array[item++] = new TestCase( SECTION, "'str' && true", true, "str" && true); + array[item++] = new TestCase( SECTION, "false && 'str'", false, false && "str" ); + array[item++] = new TestCase( SECTION, "'str' && false", false, "str" && false); + array[item++] = new TestCase( SECTION, "NaN && NaN", NaN, Number.NaN && Number.NaN ); + array[item++] = new TestCase( SECTION, "NaN && 0", NaN, Number.NaN && 0 ); + array[item++] = new TestCase( SECTION, "0 && NaN", 0, 0 && Number.NaN ); + array[item++] = new TestCase( SECTION, "NaN && Infinity", NaN, Number.NaN && Number.POSITIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "Infinity && NaN", NaN, Number.POSITIVE_INFINITY && Number.NaN ); + + array[item++] = new TestCase( SECTION, "void 0 || void 0", undefined, void 0 || void 0 ); + array[item++] = new TestCase( SECTION, "null || null", null, null || null ); + array[item++] = new TestCase( SECTION, "0 || 0", 0, 0 || 0 ); + array[item++] = new TestCase( SECTION, "1 || 1", 1, 1 || 1 ); + array[item++] = new TestCase( SECTION, "-1 || -1", -1, -1 || -1 ); + array[item++] = new TestCase( SECTION, "54 || 54", 54, 54 || 54 ); + array[item++] = new TestCase( SECTION, "54 || 45", 54, 54 || 45 ); + array[item++] = new TestCase( SECTION, "true || true", true, true || true ); + array[item++] = new TestCase( SECTION, "true || false", true, true || false ); + array[item++] = new TestCase( SECTION, "false || true", true, false || true ); + array[item++] = new TestCase( SECTION, "false || false", false, false ||false ); + array[item++] = new TestCase( SECTION, "0 || true", true, 0 || true ); + array[item++] = new TestCase( SECTION, "true || 0", true, true || 0 ); + array[item++] = new TestCase( SECTION, "true || 1", true, true || 1 ); + array[item++] = new TestCase( SECTION, "1 || true", 1, 1 || true ); + array[item++] = new TestCase( SECTION, "-1 || true", -1, -1 || true ); + array[item++] = new TestCase( SECTION, "true || -1", true, true || -1 ); + array[item++] = new TestCase( SECTION, "true || 9", true, true || 9 ); + array[item++] = new TestCase( SECTION, "true || -9", true, true || -9 ); + array[item++] = new TestCase( SECTION, "9 || true", 9, 9 || true ); + array[item++] = new TestCase( SECTION, "true || Number.POSITIVE_INFINITY", true, true || Number.POSITIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY || true", Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY ||true ); + array[item++] = new TestCase( SECTION, "true || 'str'", true, true || "str" ); + array[item++] = new TestCase( SECTION, "'str'|| true", "str", "str" || true); + array[item++] = new TestCase( SECTION, "false || 'str'", "str", false ||"str" ); + array[item++] = new TestCase( SECTION, "'str' || false", "str", "str" || false); + array[item++] = new TestCase( SECTION, "NaN || NaN", NaN, Number.NaN || Number.NaN ); + array[item++] = new TestCase( SECTION, "NaN || 0", 0, Number.NaN || 0 ); + array[item++] = new TestCase( SECTION, "0 || NaN", NaN, 0 || Number.NaN ); + array[item++] = new TestCase( SECTION, "NaN || Infinity", Infinity, Number.NaN ||Number.POSITIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "Infinity || NaN", Infinity, Number.POSITIVE_INFINITY || Number.NaN ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_12_1.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_12_1.as new file mode 100644 index 00000000000..de36b40072c --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_12_1.as @@ -0,0 +1,54 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "e11_12"; + var VERSION = "ECMA_1"; + startTest(); + var testcases = getTestCases(); + + writeHeaderToLog( SECTION + " Conditional operator( ? : )"); + test(); +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "true ? 'PASSED' : 'FAILED'", "PASSED", (true?"PASSED":"FAILED")); + array[item++] = new TestCase( SECTION, "false ? 'FAILED' : 'PASSED'", "PASSED", (false?"FAILED":"PASSED")); + + array[item++] = new TestCase( SECTION, "1 ? 'PASSED' : 'FAILED'", "PASSED", (1?"PASSED":"FAILED")); + array[item++] = new TestCase( SECTION, "0 ? 'FAILED' : 'PASSED'", "PASSED", (0?"FAILED":"PASSED")); + array[item++] = new TestCase( SECTION, "-1 ? 'PASSED' : 'FAILED'", "PASSED", (-1?"PASSED":"FAILED")); + + array[item++] = new TestCase( SECTION, "NaN ? 'FAILED' : 'PASSED'", "PASSED", (Number.NaN?"FAILED":"PASSED")); + + array[item++] = new TestCase( SECTION, "var VAR = true ? , : 'FAILED'", "PASSED", (VAR = true ? "PASSED" : "FAILED") ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_12_3.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_12_3.as new file mode 100644 index 00000000000..b784e792d9c --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_12_3.as @@ -0,0 +1,55 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "11_12_3"; + var VERSION = "ECMA_1"; + startTest(); + writeHeaderToLog( SECTION + " Conditional operator ( ? : )"); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // the following expression should NOT be an error in JS. + var MYVAR = true ? ('FAIL1', 'PASSED') : 'FAIL2'; + array[item++] = new TestCase( SECTION, + "var MYVAR = true ? ('FAIL1', 'PASSED') : 'FAIL2'; MYVAR", + "PASSED", + MYVAR ); + + // get around potential parse time error by putting expression in an eval statement + + //array[tc].actual = array[tc].actual; + return (array); +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_12_4.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_12_4.as new file mode 100644 index 00000000000..50804cb83df --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_12_4.as @@ -0,0 +1,55 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "11_12_4"; + var VERSION = "ECMA_1"; + startTest(); + writeHeaderToLog( SECTION + " Conditional operator ( ? : )"); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // the following expression should NOT be an error in JS. + true ? MYVAR1 = 'PASSED' : MYVAR1 = 'FAILED' + array[item++] = new TestCase( SECTION, + "true ? MYVAR1 = 'PASSED' : MYVAR1 = 'FAILED'; MYVAR1", + "PASSED", + MYVAR1); + + // get around potential parse time error by putting expression in an eval statement + + //array[tc].actual = ( array[tc].actual ); + return (array); +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_13.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_13.as new file mode 100644 index 00000000000..5023dcb8935 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_13.as @@ -0,0 +1,54 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "11_12"; + var VERSION = "ECMA_1"; + startTest(); + var testcases = getTestCases(); + + writeHeaderToLog( SECTION + " Conditional operator( ? : )"); + test(); +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "true ? 'PASSED' : 'FAILED'", "PASSED", (true?"PASSED":"FAILED")); + array[item++] = new TestCase( SECTION, "false ? 'FAILED' : 'PASSED'", "PASSED", (false?"FAILED":"PASSED")); + + array[item++] = new TestCase( SECTION, "1 ? 'PASSED' : 'FAILED'", "PASSED", (1?"PASSED":"FAILED")); + array[item++] = new TestCase( SECTION, "0 ? 'FAILED' : 'PASSED'", "PASSED", (0?"FAILED":"PASSED")); + array[item++] = new TestCase( SECTION, "-1 ? 'PASSED' : 'FAILED'", "PASSED", (-1?"PASSED":"FAILED")); + + array[item++] = new TestCase( SECTION, "NaN ? 'FAILED' : 'PASSED'", "PASSED", (Number.NaN?"FAILED":"PASSED")); + + array[item++] = new TestCase( SECTION, "var VAR = true ? , : 'FAILED'", "PASSED", (VAR = true ? "PASSED" : "FAILED") ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_13_1.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_13_1.as new file mode 100644 index 00000000000..650a005a08c --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_13_1.as @@ -0,0 +1,48 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "11_13_1"; + var VERSION = "ECMA_1"; + startTest(); + var testcases = getTestCases(); + + writeHeaderToLog( SECTION + " Simple Assignment ( = )"); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "SOMEVAR = true", true, SOMEVAR = true ); + + + return ( array ); +} + diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_13_2_1.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_13_2_1.as new file mode 100644 index 00000000000..28df092471c --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_13_2_1.as @@ -0,0 +1,118 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "11_13_2_1"; + var VERSION = "ECMA_1"; + startTest(); + var testcases = getTestCases(); + + writeHeaderToLog( SECTION + " Compound Assignment: *="); + test(); + +function getTestCases() +{ + var array = new Array(); + var item = 0; + + // NaN cases + + VAR1 = Number.NaN; VAR2=1; + array[item++] = new TestCase( SECTION, "VAR1 = NaN; VAR2=1; VAR1 *= VAR2", Number.NaN, VAR1 *= VAR2 ); + VAR1 = Number.NaN; VAR2=1; VAR1 *= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = NaN; VAR2=1; VAR1 *= VAR2; VAR1", Number.NaN, VAR1 ); + + // number cases + VAR1 = 0; VAR2=1; + array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2=1; VAR1 *= VAR2", 0, VAR1 *= VAR2 ); + VAR1 = 0; VAR2=1; VAR1 *= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2=1; VAR1 *= VAR2;VAR1", 0, VAR1 ); + VAR1 = 0XFF; VAR2 = 0XA; + array[item++] = new TestCase( SECTION, "VAR1 = 0xFF; VAR2 = 0xA, VAR1 *= VAR2", 2550, VAR1 *= VAR2 ); + + // special multiplication cases + VAR1 = 0; VAR2 = Number.POSITIVE_INFINITY; VAR1 *= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2= Infinity; VAR1 *= VAR2", Number.NaN, VAR1 ); + VAR1 = -0; VAR2 = Number.POSITIVE_INFINITY; VAR1 *= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = -0; VAR2= Infinity; VAR1 *= VAR2", Number.NaN, VAR1 ); + VAR1 = -0; VAR2 = Number.NEGATIVE_INFINITY; VAR1 *= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = -0; VAR2= -Infinity; VAR1 *= VAR2", Number.NaN, VAR1 ); + VAR1 = 0; VAR2 = Number.NEGATIVE_INFINITY; VAR1 *= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2= -Infinity; VAR1 *= VAR2", Number.NaN, VAR1 ); + VAR1 = 0; VAR2 = Number.POSITIVE_INFINITY; VAR2 *= VAR1; + array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2= Infinity; VAR2 *= VAR1", Number.NaN, VAR2 ); + VAR1 = -0; VAR2 = Number.POSITIVE_INFINITY; VAR2 *= VAR1; + array[item++] = new TestCase( SECTION, "VAR1 = -0; VAR2= Infinity; VAR2 *= VAR1", Number.NaN, VAR2 ); + VAR1 = -0; VAR2 = Number.NEGATIVE_INFINITY; VAR2 *= VAR1; + array[item++] = new TestCase( SECTION, "VAR1 = -0; VAR2= -Infinity; VAR2 *= VAR1", Number.NaN, VAR2 ); + VAR1 = 0; VAR2 = Number.NEGATIVE_INFINITY; VAR2 *= VAR1; + array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2= -Infinity; VAR2 *= VAR1", Number.NaN, VAR2 ); + VAR1 = Number.POSITIVE_INFINITY; VAR2 = Number.POSITIVE_INFINITY; VAR1 *= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = Infinity; VAR2= Infinity; VAR1 *= VAR2", Number.POSITIVE_INFINITY, VAR1 ); + VAR1 = Number.POSITIVE_INFINITY; VAR2 = Number.NEGATIVE_INFINITY; VAR1 *= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = Infinity; VAR2= -Infinity; VAR1 *= VAR2", Number.NEGATIVE_INFINITY, VAR1 ); + VAR1 = Number.NEGATIVE_INFINITY; VAR2 = Number.POSITIVE_INFINITY; VAR1 *= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 =-Infinity; VAR2= Infinity; VAR1 *= VAR2", Number.NEGATIVE_INFINITY, VAR1 ); + VAR1 = Number.NEGATIVE_INFINITY; VAR2 = Number.NEGATIVE_INFINITY; VAR1 *= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 =-Infinity; VAR2=-Infinity; VAR1 *= VAR2", Number.POSITIVE_INFINITY, VAR1 ); + + // string cases + VAR1 = 10; VAR2 = '255'; + array[item++] = new TestCase( SECTION, "VAR1 = 10; VAR2 = '255', VAR1 *= VAR2", 2550, VAR1 *= VAR2 ); + VAR1 = '255'; VAR2 = 10; + array[item++] = new TestCase( SECTION, "VAR1 = '255'; VAR2 = 10, VAR1 *= VAR2", 2550, VAR1 *= VAR2 ); + VAR1 = 10; VAR2 = '0XFF'; + array[item++] = new TestCase( SECTION, "VAR1 = 10; VAR2 = '0XFF', VAR1 *= VAR2", 2550, VAR1 *= VAR2 ); + VAR1 = '0XFF'; VAR2 = 0XA; + array[item++] = new TestCase( SECTION, "VAR1 = '0xFF'; VAR2 = 0xA, VAR1 *= VAR2", 2550, VAR1 *= VAR2 ); + VAR1 = '10'; VAR2 = '255'; + array[item++] = new TestCase( SECTION, "VAR1 = '10'; VAR2 = '255', VAR1 *= VAR2", 2550, VAR1 *= VAR2); + VAR1 = '10'; VAR2 = '0XFF'; + array[item++] = new TestCase( SECTION, "VAR1 = '10'; VAR2 = '0XFF', VAR1 *= VAR2", 2550, VAR1 *= VAR2); + VAR1 = '0XFF'; VAR2 = 0XA; + array[item++] = new TestCase( SECTION, "VAR1 = '0xFF'; VAR2 = 0xA, VAR1 *= VAR2", 2550, VAR1 *= VAR2); + + // boolean cases + VAR1 = true; VAR2 = false; + array[item++] = new TestCase( SECTION, "VAR1 = true; VAR2 = false; VAR1 *= VAR2", 0, VAR1 *= VAR2 ); + VAR1 = true; VAR2 = true; + array[item++] = new TestCase( SECTION, "VAR1 = true; VAR2 = true; VAR1 *= VAR2", 1, VAR1 *= VAR2); + + // object cases + VAR1 = new Boolean(true); VAR2 = 10; VAR1 *= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = new Boolean(true); VAR2 = 10; VAR1 *= VAR2;VAR1", 10, VAR1 ); + VAR1 = new Number(11); VAR2 = 10; VAR1 *= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = new Number(11); VAR2 = 10; VAR1 *= VAR2; VAR1", 110, VAR1); + VAR1 = new Number(11); VAR2 = new Number(10); + array[item++] = new TestCase( SECTION, "VAR1 = new Number(11); VAR2 = new Number(10); VAR1 *= VAR2", 110, VAR1 *= VAR2 ); + VAR1 = String('15'); VAR2 = new String('0xF'); + array[item++] = new TestCase( SECTION, "VAR1 = new String('15'); VAR2 = new String('0xF'); VAR1 *= VAR2", 225, VAR1 *= VAR2); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_13_2_2.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_13_2_2.as new file mode 100644 index 00000000000..8696798fd25 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_13_2_2.as @@ -0,0 +1,142 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "e11_13_2_2"; + var VERSION = "ECMA_1"; + startTest(); + var testcases = getTestCases(); + + writeHeaderToLog( SECTION + " Compound Assignment: /="); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // NaN cases + VAR1 = Number.NaN; VAR2=1; + array[item++] = new TestCase( SECTION, "VAR1 = NaN; VAR2=1; VAR1 /= VAR2", Number.NaN, VAR1 /= VAR2 ); + VAR1 = Number.NaN; VAR2=1; VAR1 /= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = NaN; VAR2=1; VAR1 /= VAR2; VAR1", Number.NaN, VAR1 ); + VAR1 = Number.NaN; VAR2=0; + array[item++] = new TestCase( SECTION, "VAR1 = NaN; VAR2=0; VAR1 /= VAR2", Number.NaN, VAR1 /= VAR2 ); + VAR1 = Number.NaN; VAR2=0; VAR1 /= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = NaN; VAR2=0; VAR1 /= VAR2; VAR1", Number.NaN, VAR1 ); + VAR1 = 0; VAR2=Number.NaN; + array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2=NaN; VAR1 /= VAR2", Number.NaN, VAR1 /= VAR2 ); + VAR1 = 0; VAR2=Number.NaN; VAR1 /= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2=NaN; VAR1 /= VAR2; VAR1", Number.NaN, VAR1 ); + + // number cases + VAR1 = 0; VAR2=1; + array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2=1; VAR1 /= VAR2", 0, VAR1 /= VAR2); + VAR1 = 0; VAR2=1; VAR1 /= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2=1; VAR1 /= VAR2;VAR1", 0, VAR1); + VAR1 = 0XFF; VAR2 = 0XA; + array[item++] = new TestCase( SECTION, "VAR1 = 0xFF; VAR2 = 0xA, VAR1 /= VAR2", 25.5, VAR1 /= VAR2); + + // special division cases + VAR1 = 0; VAR2 = Number.POSITIVE_INFINITY; VAR1 /= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2= Infinity; VAR1 /= VAR2", 0, VAR1); + VAR1 = -0; VAR2 = Number.POSITIVE_INFINITY; VAR1 /= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = -0; VAR2= Infinity; VAR1 /= VAR2", 0, VAR1 ); + VAR1 = -0; VAR2 = Number.NEGATIVE_INFINITY; VAR1 /= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = -0; VAR2= -Infinity; VAR1 /= VAR2", 0, VAR1); + VAR1 = 0; VAR2 = Number.NEGATIVE_INFINITY; VAR1 /= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2= -Infinity; VAR1 /= VAR2", 0, VAR1); + VAR1 = 0; VAR2 = Number.POSITIVE_INFINITY; VAR2 /= VAR1; + array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2= Infinity; VAR2 /= VAR1", Number.POSITIVE_INFINITY, VAR2); + VAR1 = -0; VAR2 = Number.POSITIVE_INFINITY; VAR2 /= VAR1; + array[item++] = new TestCase( SECTION, "VAR1 = -0; VAR2= Infinity; VAR2 /= VAR1", Number.NEGATIVE_INFINITY, VAR2); + VAR1 = -0; VAR2 = Number.NEGATIVE_INFINITY; VAR2 /= VAR1; + array[item++] = new TestCase( SECTION, "VAR1 = -0; VAR2= -Infinity; VAR2 /= VAR1", Number.POSITIVE_INFINITY, VAR2); + VAR1 = 0; VAR2 = Number.NEGATIVE_INFINITY; VAR2 /= VAR1; + array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2= -Infinity; VAR2 /= VAR1", Number.NEGATIVE_INFINITY, VAR2); + VAR1 = Number.POSITIVE_INFINITY; VAR2 = Number.POSITIVE_INFINITY; VAR1 /= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = Infinity; VAR2= Infinity; VAR1 /= VAR2", Number.NaN, VAR1); + VAR1 = Number.POSITIVE_INFINITY; VAR2 = Number.NEGATIVE_INFINITY; VAR1 /= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = Infinity; VAR2= -Infinity; VAR1 /= VAR2", Number.NaN, VAR1); + VAR1 = Number.NEGATIVE_INFINITY; VAR2 = Number.POSITIVE_INFINITY; VAR1 /= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 =-Infinity; VAR2= Infinity; VAR1 /= VAR2", Number.NaN, VAR1); + VAR1 = Number.NEGATIVE_INFINITY; VAR2 = Number.NEGATIVE_INFINITY; VAR1 /= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 =-Infinity; VAR2=-Infinity; VAR1 /= VAR2", Number.NaN, VAR1); + VAR1 = 0; VAR2 = 0; VAR1 /= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2= 0; VAR1 /= VAR2", Number.NaN, VAR1); + VAR1 = 0; VAR2 = -0; VAR1 /= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2= -0; VAR1 /= VAR2", Number.NaN, VAR1); + VAR1 = -0; VAR2 = 0; VAR1 /= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = -0; VAR2= 0; VAR1 /= VAR2", Number.NaN, VAR1); + VAR1 = -0; VAR2 = -0; VAR1 /= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = -0; VAR2= -0; VAR1 /= VAR2", Number.NaN, VAR1); + VAR1 = 1; VAR2 = 0; VAR1 /= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = 1; VAR2= 0; VAR1 /= VAR2", Number.POSITIVE_INFINITY, VAR1 ); + VAR1 = 1; VAR2 = -0; VAR1 /= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = 1; VAR2= -0; VAR1 /= VAR2", Number.NEGATIVE_INFINITY, VAR1); + VAR1 = -1; VAR2 = 0; VAR1 /= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = -1; VAR2= 0; VAR1 /= VAR2", Number.NEGATIVE_INFINITY, VAR1); + VAR1 = -1; VAR2 = -0; VAR1 /= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = -1; VAR2= -0; VAR1 /= VAR2", Number.POSITIVE_INFINITY, VAR1); + + // string cases + VAR1 = 1000; VAR2 = '10', VAR1 /= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = 1000; VAR2 = '10', VAR1 /= VAR2; VAR1", 100, VAR1); + VAR1 = '1000'; VAR2 = 10, VAR1 /= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = '1000'; VAR2 = 10, VAR1 /= VAR2; VAR1", 100, VAR1); +/* + VAR1 = 10; VAR2 = '0XFF'; + array[item++] = new TestCase( SECTION, "VAR1 = 10; VAR2 = '0XFF', VAR1 /= VAR2", 2550, VAR1 /= VAR2); + VAR1 = '0XFF'; VAR2 = 0XA; + array[item++] = new TestCase( SECTION, "VAR1 = '0xFF'; VAR2 = 0xA, VAR1 /= VAR2", 2550, VAR1 /= VAR2); + VAR1 = '10'; VAR2 = '255'; + array[item++] = new TestCase( SECTION, "VAR1 = '10'; VAR2 = '255', VAR1 /= VAR2", 2550, VAR1 /= VAR2); + VAR1 = '10'; VAR2 = '0XFF'; + array[item++] = new TestCase( SECTION, "VAR1 = '10'; VAR2 = '0XFF', VAR1 /= VAR2", 2550, VAR1 /= VAR2); + VAR1 = '0XFF'; VAR2 = 0XA; + array[item++] = new TestCase( SECTION, "VAR1 = '0xFF'; VAR2 = 0xA, VAR1 /= VAR2", 2550, VAR1 /= VAR2); + + // boolean cases + VAR1 = true; VAR2 = false; + array[item++] = new TestCase( SECTION, "VAR1 = true; VAR2 = false; VAR1 /= VAR2", 0, VAR1 /= VAR2); + VAR1 = true; VAR2 = true; + array[item++] = new TestCase( SECTION, "VAR1 = true; VAR2 = true; VAR1 /= VAR2", 1, VAR1 /= VAR2); + + // object cases + VAR1 = new Boolean(true); VAR2 = 10; VAR1 /= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = new Boolean(true); VAR2 = 10; VAR1 /= VAR2;VAR1", 10, VAR1); + VAR1 = new Number(11); VAR2 = 10; VAR1 /= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = new Number(11); VAR2 = 10; VAR1 /= VAR2; VAR1", 110, VAR1); + VAR1 = new Number(11); VAR2 = new Number(10); + array[item++] = new TestCase( SECTION, "VAR1 = new Number(11); VAR2 = new Number(10); VAR1 /= VAR2", 110, VAR1 /= VAR2); + VAR1 = String('15'); VAR2 = new String('0xF'); + array[item++] = new TestCase( SECTION, "VAR1 = new String('15'); VAR2 = new String('0xF'); VAR1 /= VAR2", 255, VAR1 /= VAR2); + +*/ + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_13_2_3.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_13_2_3.as new file mode 100644 index 00000000000..5d91f2d3650 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_13_2_3.as @@ -0,0 +1,162 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "e11_13_2_3"; + var VERSION = "ECMA_1"; + startTest(); + var testcases = getTestCases(); + + writeHeaderToLog( SECTION + " Compound Assignment: +="); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // If either operand is NaN, result is NaN + VAR1 = Number.NaN; VAR2=1; + array[item++] = new TestCase( SECTION, "VAR1 = NaN; VAR2=1; VAR1 %= VAR2", Number.NaN, VAR1 %= VAR2); + VAR1 = Number.NaN; VAR2=1; VAR1 %= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = NaN; VAR2=1; VAR1 %= VAR2; VAR1", Number.NaN, VAR1); + VAR1 = Number.NaN; VAR2=0; + array[item++] = new TestCase( SECTION, "VAR1 = NaN; VAR2=0; VAR1 %= VAR2", Number.NaN, VAR1 %= VAR2); + VAR1 = Number.NaN; VAR2=0; VAR1 %= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = NaN; VAR2=0; VAR1 %= VAR2; VAR1", Number.NaN, VAR1); + VAR1 = 0; VAR2=Number.NaN; + array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2=NaN; VAR1 %= VAR2", Number.NaN, VAR1 %= VAR2); + VAR1 = 0; VAR2=Number.NaN; VAR1 %= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2=NaN; VAR1 %= VAR2; VAR1", Number.NaN, VAR1 ); + + // if the dividend is infinity or the divisor is zero or both, the result is NaN + VAR1 = Number.POSITIVE_INFINITY; VAR2 = Number.POSITIVE_INFINITY; VAR1 %= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = Infinity; VAR2= Infinity; VAR1 %= VAR2; VAR1", Number.NaN, VAR1 ); + VAR1 = Number.POSITIVE_INFINITY; VAR2 = Number.NEGATIVE_INFINITY; VAR1 %= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = Infinity; VAR2= -Infinity; VAR1 %= VAR2; VAR1", Number.NaN, VAR1 ); + VAR1 = Number.NEGATIVE_INFINITY; VAR2 = Number.POSITIVE_INFINITY; VAR1 %= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 =-Infinity; VAR2= Infinity; VAR1 %= VAR2; VAR1", Number.NaN, VAR1 ); + VAR1 = Number.NEGATIVE_INFINITY; VAR2 = Number.NEGATIVE_INFINITY; VAR1 %= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 =-Infinity; VAR2=-Infinity; VAR1 %= VAR2; VAR1", Number.NaN, VAR1); + VAR1 = 0; VAR2 = Number.POSITIVE_INFINITY; VAR2 %= VAR1; + array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2= Infinity; VAR2 %= VAR1", Number.NaN, VAR2); + VAR1 = -0; VAR2 = Number.POSITIVE_INFINITY; VAR2 %= VAR1; + array[item++] = new TestCase( SECTION, "VAR1 = -0; VAR2= Infinity; VAR2 %= VAR1", Number.NaN, VAR2); + VAR1 = -0; VAR2 = Number.NEGATIVE_INFINITY; VAR2 %= VAR1; + array[item++] = new TestCase( SECTION, "VAR1 = -0; VAR2= -Infinity; VAR2 %= VAR1", Number.NaN, VAR2); + VAR1 = 0; VAR2 = Number.NEGATIVE_INFINITY; VAR2 %= VAR1; + array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2= -Infinity; VAR2 %= VAR1", Number.NaN, VAR2); + VAR1 = 1; VAR2 = Number.POSITIVE_INFINITY; VAR2 %= VAR1; + array[item++] = new TestCase( SECTION, "VAR1 = 1; VAR2= Infinity; VAR2 %= VAR1", Number.NaN, VAR2); + VAR1 = -1; VAR2 = Number.POSITIVE_INFINITY; VAR2 %= VAR1; + array[item++] = new TestCase( SECTION, "VAR1 = -1; VAR2= Infinity; VAR2 %= VAR1", Number.NaN, VAR2); + VAR1 = -1; VAR2 = Number.NEGATIVE_INFINITY; VAR2 %= VAR1; + array[item++] = new TestCase( SECTION, "VAR1 = -1; VAR2= -Infinity; VAR2 %= VAR1", Number.NaN, VAR2); + VAR1 = 1; VAR2 = Number.NEGATIVE_INFINITY; VAR2 %= VAR1; + array[item++] = new TestCase( SECTION, "VAR1 = 1; VAR2= -Infinity; VAR2 %= VAR1", Number.NaN, VAR2); + VAR1 = 0; VAR2 = 0; VAR1 %= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2= 0; VAR1 %= VAR2", Number.NaN, VAR1 ); + VAR1 = 0; VAR2 = -0; VAR1 %= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2= -0; VAR1 %= VAR2", Number.NaN, VAR1 ); + VAR1 = -0; VAR2 = 0; VAR1 %= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = -0; VAR2= 0; VAR1 %= VAR2", Number.NaN, VAR1 ); + VAR1 = -0; VAR2 = -0; VAR1 %= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = -0; VAR2= -0; VAR1 %= VAR2", Number.NaN, VAR1 ); + VAR1 = 1; VAR2 = 0; VAR1 %= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = 1; VAR2= 0; VAR1 %= VAR2", Number.NaN, VAR1 ); + VAR1 = 1; VAR2 = -0; VAR1 %= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = 1; VAR2= -0; VAR1 %= VAR2", Number.NaN, VAR1 ); + VAR1 = -1; VAR2 = 0; VAR1 %= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = -1; VAR2= 0; VAR1 %= VAR2", Number.NaN, VAR1 ); + VAR1 = -1; VAR2 = -0; VAR1 %= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = -1; VAR2= -0; VAR1 %= VAR2", Number.NaN, VAR1 ); + + // if the dividend is finite and the divisor is an infinity, the result equals the dividend. + VAR1 = 0; VAR2 = Number.POSITIVE_INFINITY; VAR1 %= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2= Infinity; VAR1 %= VAR2;VAR1", 0, VAR1 ); + VAR1 = -0; VAR2 = Number.POSITIVE_INFINITY; VAR1 %= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = -0; VAR2= Infinity; VAR1 %= VAR2;VAR1", -0, VAR1 ); + VAR1 = -0; VAR2 = Number.NEGATIVE_INFINITY; VAR1 %= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = -0; VAR2= -Infinity; VAR1 %= VAR2;VAR1", -0, VAR1 ); + VAR1 = 0; VAR2 = Number.NEGATIVE_INFINITY; VAR1 %= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2= -Infinity; VAR1 %= VAR2;VAR1", 0, VAR1 ); + VAR1 = 1; VAR2 = Number.POSITIVE_INFINITY; VAR1 %= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = 1; VAR2= Infinity; VAR1 %= VAR2;VAR1", 1, VAR1 ); + VAR1 = -1; VAR2 = Number.POSITIVE_INFINITY; VAR1 %= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = -1; VAR2= Infinity; VAR1 %= VAR2;VAR1", -1, VAR1 ); + VAR1 = -1; VAR2 = Number.NEGATIVE_INFINITY; VAR1 %= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = -1; VAR2= -Infinity; VAR1 %= VAR2;VAR1", -1, VAR1 ); + VAR1 = 1; VAR2 = Number.NEGATIVE_INFINITY; VAR1 %= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = 1; VAR2= -Infinity; VAR1 %= VAR2;VAR1", 1, VAR1 ); + + // if the dividend is a zero and the divisor is finite, the result is the same as the dividend + VAR1 = 0; VAR2 = 1; VAR1 %= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2= 1; VAR1 %= VAR2; VAR1", 0, VAR1 ); + VAR1 = -0; VAR2 = 1; VAR1 %= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = -0; VAR2= 1; VAR1 %= VAR2; VAR1", -0, VAR1 ); + VAR1 = -0; VAR2 = -1; VAR1 %= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = -0; VAR2= -1; VAR1 %= VAR2; VAR1", -0, VAR1 ); + VAR1 = 0; VAR2 = -1; VAR1 %= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2= -1; VAR1 %= VAR2; VAR1", 0, VAR1 ); + + // string cases + VAR1 = 1000; VAR2 = '10', VAR1 %= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = 1000; VAR2 = '10', VAR1 %= VAR2; VAR1", 0, VAR1 ); + VAR1 = '1000'; VAR2 = 10, VAR1 %= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = '1000'; VAR2 = 10, VAR1 %= VAR2; VAR1", 0, VAR1 ); +/* + VAR1 = 10; VAR2 = '0XFF'; + array[item++] = new TestCase( SECTION, "VAR1 = 10; VAR2 = '0XFF', VAR1 %= VAR2", 2550, VAR1 %= VAR2 ); + VAR1 = '0XFF'; VAR2 = 0XA; + array[item++] = new TestCase( SECTION, "VAR1 = '0xFF'; VAR2 = 0xA, VAR1 %= VAR2", 2550, VAR1 %= VAR2 ); + VAR1 = '10'; VAR2 = '255'; + array[item++] = new TestCase( SECTION, "VAR1 = '10'; VAR2 = '255', VAR1 %= VAR2", 2550, VAR1 %= VAR2 ); + VAR1 = '10'; VAR2 = '0XFF'; + array[item++] = new TestCase( SECTION, "VAR1 = '10'; VAR2 = '0XFF', VAR1 %= VAR2", 2550, VAR1 %= VAR2 ); + VAR1 = '0XFF'; VAR2 = 0XA; + array[item++] = new TestCase( SECTION, "VAR1 = '0xFF'; VAR2 = 0xA, VAR1 %= VAR2", 2550, VAR1 %= VAR2 ); + + // boolean cases + VAR1 = true; VAR2 = false; + array[item++] = new TestCase( SECTION, "VAR1 = true; VAR2 = false; VAR1 %= VAR2", 0, VAR1 %= VAR2 ); + VAR1 = true; VAR2 = true; + array[item++] = new TestCase( SECTION, "VAR1 = true; VAR2 = true; VAR1 %= VAR2", 1, VAR1 %= VAR2 ); + + // object cases + VAR1 = new Boolean(true); VAR2 = 10; VAR1 %= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = new Boolean(true); VAR2 = 10; VAR1 %= VAR2;VAR1", 10, VAR1 ); + VAR1 = new Number(11); VAR2 = 10; VAR1 %= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = new Number(11); VAR2 = 10; VAR1 %= VAR2; VAR1", 110, VAR1 ); + VAR1 = new Number(11); VAR2 = new Number(10); + array[item++] = new TestCase( SECTION, "VAR1 = new Number(11); VAR2 = new Number(10); VAR1 %= VAR2", 110, VAR1 %= VAR2 ); + VAR1 = String('15'); VAR2 = new String('0xF'); + array[item++] = new TestCase( SECTION, "VAR1 = new String('15'); VAR2 = new String('0xF'); VAR1 %= VAR2", 255, VAR1 %= VAR2 ); + +*/ + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_13_2_4.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_13_2_4.as new file mode 100644 index 00000000000..9a553a07067 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_13_2_4.as @@ -0,0 +1,140 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "11_13_2_4"; + var VERSION = "ECMA_1"; + startTest(); + var testcases = getTestCases(); + + writeHeaderToLog( SECTION + " Compound Assignment: +="); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // If either operand is NaN, result is NaN + VAR1 = Number.NaN; VAR2=1; + array[item++] = new TestCase( SECTION, "VAR1 = NaN; VAR2=1; VAR1 += VAR2", Number.NaN, VAR1 += VAR2 ); + VAR1 = Number.NaN; VAR2=1; VAR1 += VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = NaN; VAR2=1; VAR1 += VAR2; VAR1", Number.NaN, VAR1 ); + VAR1 = Number.NaN; VAR2=0; + array[item++] = new TestCase( SECTION, "VAR1 = NaN; VAR2=0; VAR1 += VAR2", Number.NaN, VAR1 += VAR2 ); + VAR1 = Number.NaN; VAR2=0; VAR1 += VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = NaN; VAR2=0; VAR1 += VAR2; VAR1", Number.NaN, VAR1 ); + VAR1 = 0; VAR2=Number.NaN; + array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2=NaN; VAR1 += VAR2", Number.NaN, VAR1 += VAR2 ); + VAR1 = 0; VAR2=Number.NaN; VAR1 += VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2=NaN; VAR1 += VAR2; VAR1", Number.NaN, VAR1 ); + + // the sum of two Infinities the same sign is the infinity of that sign + // the sum of two Infinities of opposite sign is NaN + VAR1 = Number.POSITIVE_INFINITY; VAR2 = Number.POSITIVE_INFINITY; VAR1 += VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = Infinity; VAR2= Infinity; VAR1 += VAR2; VAR1", Number.POSITIVE_INFINITY, VAR1 ); + VAR1 = Number.POSITIVE_INFINITY; VAR2 = Number.NEGATIVE_INFINITY; VAR1 += VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = Infinity; VAR2= -Infinity; VAR1 += VAR2; VAR1", Number.NaN, VAR1 ); + VAR1 = Number.NEGATIVE_INFINITY; VAR2 = Number.POSITIVE_INFINITY; VAR1 += VAR2; + array[item++] = new TestCase( SECTION, "VAR1 =-Infinity; VAR2= Infinity; VAR1 += VAR2; VAR1", Number.NaN, VAR1 ); + VAR1 = Number.NEGATIVE_INFINITY; VAR2 = Number.NEGATIVE_INFINITY; VAR1 += VAR2; + array[item++] = new TestCase( SECTION, "VAR1 =-Infinity; VAR2=-Infinity; VAR1 += VAR2; VAR1", Number.NEGATIVE_INFINITY, VAR1 ); + + // the sum of an infinity and a finite value is equal to the infinite operand + VAR1 = 0; VAR2 = Number.POSITIVE_INFINITY; VAR1 += VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2= Infinity; VAR1 += VAR2;VAR1", Number.POSITIVE_INFINITY, VAR1 ); + VAR1 = -0; VAR2 = Number.POSITIVE_INFINITY; VAR1 += VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = -0; VAR2= Infinity; VAR1 += VAR2;VAR1", Number.POSITIVE_INFINITY, VAR1 ); + VAR1 = -0; VAR2 = Number.NEGATIVE_INFINITY; VAR1 += VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = -0; VAR2= -Infinity; VAR1 += VAR2;VAR1", Number.NEGATIVE_INFINITY, VAR1 ); + VAR1 = 0; VAR2 = Number.NEGATIVE_INFINITY; VAR1 += VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2= -Infinity; VAR1 += VAR2;VAR1", Number.NEGATIVE_INFINITY, VAR1 ); + + // the sum of two negative zeros is -0. the sum of two positive zeros, or of two zeros of opposite sign, is +0 + VAR1 = 0; VAR2 = 0; VAR1 += VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2= 0; VAR1 += VAR2", 0, VAR1 ); + VAR1 = 0; VAR2 = -0; VAR1 += VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2= -0; VAR1 += VAR2", 0, VAR1 ); + VAR1 = -0; VAR2 = 0; VAR1 += VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = -0; VAR2= 0; VAR1 += VAR2", 0, VAR1 ); + VAR1 = -0; VAR2 = -0; VAR1 += VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = -0; VAR2= -0; VAR1 += VAR2", -0, VAR1 ); + + // the sum of a zero and a nonzero finite value is eqal to the nonzero operand + VAR1 = 0; VAR2 = 1; VAR2 += VAR1; + array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2= 1; VAR2 += VAR1; VAR2", 1, VAR2 ); + VAR1 = -0; VAR2 = 1; VAR2 += VAR1; + array[item++] = new TestCase( SECTION, "VAR1 = -0; VAR2= 1; VAR2 += VAR1; VAR2", 1, VAR2 ); + VAR1 = -0; VAR2 = -1; VAR2 += VAR1; + array[item++] = new TestCase( SECTION, "VAR1 = -0; VAR2= -1; VAR2 += VAR1; VAR2", -1, VAR2 ); + VAR1 = 0; VAR2 = -1; VAR2 += VAR1; + array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2= -1; VAR2 += VAR1; VAR2", -1, VAR2 ); + + // the sum of a zero and a nozero finite value is equal to the nonzero operand. + VAR1 = 0; VAR2=1; + array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2=1; VAR1 += VAR2", 1, VAR1 += VAR2 ); + VAR1 = 0; VAR2=1; VAR1 += VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2=1; VAR1 += VAR2;VAR1", 1, VAR1 ); + + // the sum of two nonzero finite values of the same magnitude and opposite sign is +0 + VAR1 = Number.MAX_VALUE; VAR2= -Number.MAX_VALUE; VAR1 += VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = Number.MAX_VALUE; VAR2= -Number.MAX_VALUE; VAR1 += VAR2; VAR1", 0, VAR1 ); + VAR1 = Number.MIN_VALUE; VAR2= -Number.MIN_VALUE; VAR1 += VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = Number.MIN_VALUE; VAR2= -Number.MIN_VALUE; VAR1 += VAR2; VAR1", 0, VAR1 ); + +/* + VAR1 = 10; VAR2 = '0XFF'; + array[item++] = new TestCase( SECTION, "VAR1 = 10; VAR2 = '0XFF', VAR1 += VAR2", 2550, VAR1 += VAR2 ); + VAR1 = '0XFF'; VAR2 = 0XA; + array[item++] = new TestCase( SECTION, "VAR1 = '0xFF'; VAR2 = 0xA, VAR1 += VAR2", 2550, VAR1 += VAR2 ); + VAR1 = '10'; VAR2 = '255'; + array[item++] = new TestCase( SECTION, "VAR1 = '10'; VAR2 = '255', VAR1 += VAR2", 2550, VAR1 += VAR2 ); + VAR1 = '10'; VAR2 = '0XFF'; + array[item++] = new TestCase( SECTION, "VAR1 = '10'; VAR2 = '0XFF', VAR1 += VAR2", 2550, VAR1 += VAR2 ); + VAR1 = '0XFF'; VAR2 = 0XA; + array[item++] = new TestCase( SECTION, "VAR1 = '0xFF'; VAR2 = 0xA, VAR1 += VAR2", 2550, VAR1 += VAR2 ); + + // boolean cases + VAR1 = true; VAR2 = false; + array[item++] = new TestCase( SECTION, "VAR1 = true; VAR2 = false; VAR1 += VAR2", 0, VAR1 += VAR2 ); + VAR1 = true; VAR2 = true; + array[item++] = new TestCase( SECTION, "VAR1 = true; VAR2 = true; VAR1 += VAR2", 1, VAR1 += VAR2 ); + + // object cases + VAR1 = new Boolean(true); VAR2 = 10; VAR1 += VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = new Boolean(true); VAR2 = 10; VAR1 += VAR2;VAR1", 10, VAR1 ); + VAR1 = new Number(11); VAR2 = 10; VAR1 += VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = new Number(11); VAR2 = 10; VAR1 += VAR2; VAR1", 110, VAR1 ); + VAR1 = new Number(11); VAR2 = new Number(10); + array[item++] = new TestCase( SECTION, "VAR1 = new Number(11); VAR2 = new Number(10); VAR1 += VAR2", 110, VAR1 += VAR2 ); + VAR1 = String('15'); VAR2 = new String('0xF'); + array[item++] = new TestCase( SECTION, "VAR1 = new String('15'); VAR2 = new String('0xF'); VAR1 += VAR2", 255, VAR1 += VAR2 ); + +*/ + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_13_2_5.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_13_2_5.as new file mode 100644 index 00000000000..5d0fe8a57d8 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_13_2_5.as @@ -0,0 +1,142 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "11_13_2_5"; + var VERSION = "ECMA_1"; + startTest(); + var testcases = getTestCases(); + + writeHeaderToLog( SECTION + " Compound Assignment: -="); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // If either operand is NaN, result is NaN + VAR1 = Number.NaN; VAR2=1; + array[item++] = new TestCase( SECTION, "VAR1 = NaN; VAR2=1; VAR1 -= VAR2", Number.NaN, VAR1 -= VAR2 ); + VAR1 = Number.NaN; VAR2=1; VAR1 -= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = NaN; VAR2=1; VAR1 -= VAR2; VAR1", Number.NaN, VAR1 ); + VAR1 = Number.NaN; VAR2=0; + array[item++] = new TestCase( SECTION, "VAR1 = NaN; VAR2=0; VAR1 -= VAR2", Number.NaN, VAR1 -= VAR2 ); + VAR1 = Number.NaN; VAR2=0; VAR1 -= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = NaN; VAR2=0; VAR1 -= VAR2; VAR1", Number.NaN, VAR1 ); + VAR1 = 0; VAR2=Number.NaN; + array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2=NaN; VAR1 -= VAR2", Number.NaN, VAR1 -= VAR2 ); + VAR1 = 0; VAR2=Number.NaN; VAR1 -= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2=NaN; VAR1 -= VAR2; VAR1", Number.NaN, VAR1 ); + + // the sum of two Infinities the same sign is the infinity of that sign + // the sum of two Infinities of opposite sign is NaN + VAR1 = Number.POSITIVE_INFINITY; VAR2 = Number.POSITIVE_INFINITY; VAR1 -= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = Infinity; VAR2= Infinity; VAR1 -= VAR2; VAR1", Number.NaN, VAR1 ); + VAR1 = Number.POSITIVE_INFINITY; VAR2 = Number.NEGATIVE_INFINITY; VAR1 -= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = Infinity; VAR2= -Infinity; VAR1 -= VAR2; VAR1", Number.POSITIVE_INFINITY, VAR1 ); + VAR1 = Number.NEGATIVE_INFINITY; VAR2 = Number.POSITIVE_INFINITY; VAR1 -= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 =-Infinity; VAR2= Infinity; VAR1 -= VAR2; VAR1", Number.NEGATIVE_INFINITY, VAR1 ); + VAR1 = Number.NEGATIVE_INFINITY; VAR2 = Number.NEGATIVE_INFINITY; VAR1 -= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 =-Infinity; VAR2=-Infinity; VAR1 -= VAR2; VAR1", Number.NaN, VAR1 ); + + // the sum of an infinity and a finite value is equal to the infinite operand + VAR1 = 0; VAR2 = Number.POSITIVE_INFINITY; VAR1 -= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2= Infinity; VAR1 -= VAR2;VAR1", Number.NEGATIVE_INFINITY, VAR1 ); + VAR1 = -0; VAR2 = Number.POSITIVE_INFINITY; VAR1 -= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = -0; VAR2= Infinity; VAR1 -= VAR2;VAR1", Number.NEGATIVE_INFINITY, VAR1 ); + VAR1 = 0; VAR2 = Number.NEGATIVE_INFINITY; VAR1 -= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2= -Infinity; VAR1 -= VAR2;VAR1", Number.POSITIVE_INFINITY,VAR1 ); + VAR1 = -0; VAR2 = Number.NEGATIVE_INFINITY; VAR1 -= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = -0; VAR2= -Infinity; VAR1 -= VAR2;VAR1", Number.POSITIVE_INFINITY, VAR1 ); + + // the sum of two negative zeros is -0. the sum of two positive zeros, or of two zeros of opposite sign, is +0 + VAR1 = 0; VAR2 = 0; VAR1 -= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2= -0; VAR1 -= VAR2", 0, VAR1 ); + VAR1 = 0; VAR2 = -0; VAR1 -= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2= 0; VAR1 -= VAR2", 0, VAR1 ); + VAR1 = -0; VAR2 = 0; VAR1 -= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = -0; VAR2= -0; VAR1 -= VAR2", 0, VAR1 ); + VAR1 = -0; VAR2 = -0; VAR1 -= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = -0; VAR2= 0; VAR1 -= VAR2", -0, VAR1 ); + + // the sum of a zero and a nonzero finite value is eqal to the nonzero operand + VAR1 = 0; VAR2 = -1; VAR1 -= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2= -1; VAR1 -= VAR2; VAR1", 1, VAR1 ); + VAR1 = -0; VAR2 = -1; VAR1 -= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = -0; VAR2= -1; VAR1 -= VAR2; VAR1", 1, VAR1 ); + VAR1 = -0; VAR2 = 1; VAR1 -= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = -0; VAR2= 1; VAR1 -= VAR2; VAR1", -1, VAR1 ); + VAR1 = 0; VAR2 = 1; VAR1 -= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2= 1; VAR1 -= VAR2; VAR1", -1, VAR1 ); + + // the sum of a zero and a nozero finite value is equal to the nonzero operand. + VAR1 = 0; VAR2=-1; VAR1 -= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2=-1; VAR1 -= VAR2", 1, VAR1 ); + VAR1 = 0; VAR2=-1; VAR1 -= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2=-1; VAR1 -= VAR2;VAR1", 1, VAR1 ); + + // the sum of two nonzero finite values of the same magnitude and opposite sign is +0 + VAR1 = Number.MAX_VALUE; VAR2= Number.MAX_VALUE; VAR1 -= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = Number.MAX_VALUE; VAR2= Number.MAX_VALUE; VAR1 -= VAR2; VAR1", 0, VAR1 ); + VAR1 = Number.MIN_VALUE; VAR2= Number.MIN_VALUE; VAR1 -= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = Number.MIN_VALUE; VAR2= Number.MIN_VALUE; VAR1 -= VAR2; VAR1", 0, VAR1 ); + + +/* + VAR1 = 10; VAR2 = '0XFF'; + array[item++] = new TestCase( SECTION, "VAR1 = 10; VAR2 = '0XFF', VAR1 -= VAR2", 2550, VAR1 -= VAR2 ); + VAR1 = '0XFF'; VAR2 = 0XA; + array[item++] = new TestCase( SECTION, "VAR1 = '0xFF'; VAR2 = 0xA, VAR1 -= VAR2", 2550, VAR1 -= VAR2 ); + VAR1 = '10'; VAR2 = '255'; + array[item++] = new TestCase( SECTION, "VAR1 = '10'; VAR2 = '255', VAR1 -= VAR2", 2550, VAR1 -= VAR2 ); + VAR1 = '10'; VAR2 = '0XFF'; + array[item++] = new TestCas( SECTION, "VAR1 = '10'; VAR2 = '0XFF', VAR1 -= VAR2", 2550, VAR1 -= VAR2 ); + VAR1 = '0XFF'; VAR2 = 0XA; + array[item++] = new TestCase( SECTION, "VAR1 = '0xFF'; VAR2 = 0xA, VAR1 -= VAR2", 2550, VAR1 -= VAR2 ); + + // boolean cases + VAR1 = true; VAR2 = false; + array[item++] = new TestCase( SECTION, "VAR1 = true; VAR2 = false; VAR1 -= VAR2", 0, VAR1 -= VAR2 ); + VAR1 = true; VAR2 = true; + array[item++] = new TestCase( SECTION, "VAR1 = true; VAR2 = true; VAR1 -= VAR2", 1, VAR1 -= VAR2 ); + + // object cases + VAR1 = new Boolean(true); VAR2 = 10; VAR1 -= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = new Boolean(true); VAR2 = 10; VAR1 -= VAR2;VAR1", 10, VAR1 ); + VAR1 = new Number(11); VAR2 = 10; VAR1 -= VAR2; + array[item++] = new TestCase( SECTION, "VAR1 = new Number(11); VAR2 = 10; VAR1 -= VAR2; VAR1", 110, VAR1 ); + VAR1 = new Number(11); VAR2 = new Number(10); + array[item++] = new TestCase( SECTION, "VAR1 = new Number(11); VAR2 = new Number(10); VAR1 -= VAR2", 110, VAR1 -= VAR2 ); + VAR1 = String('15'); VAR2 = new String('0xF'); + array[item++] = new TestCase( SECTION, "VAR1 = new String('15'); VAR2 = new String('0xF'); VAR1 -= VAR2", 255, VAR1 -= VAR2 ); + +*/ + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_14_1.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_14_1.as new file mode 100644 index 00000000000..0b76001e9f4 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_14_1.as @@ -0,0 +1,47 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "e11_14_1"; + var VERSION = "ECMA_1"; + startTest(); + var testcases = getTestCases(); + + writeHeaderToLog( SECTION + " Comma operator (,)"); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "true, false", false, (true, false) ); + array[item++] = new TestCase( SECTION, "VAR1=true, VAR2=false", false, (VAR1=true, VAR2=false) ); + array[item++] = new TestCase( SECTION, "VAR1=true, VAR2=false;VAR1", true, (VAR1=true, VAR2=false, VAR1) ); + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_1_1.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_1_1.as new file mode 100644 index 00000000000..f7ebd737260 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_1_1.as @@ -0,0 +1,102 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "11.1.1"; + var VERSION = "ECMA_1"; + startTest(); + + writeHeaderToLog( SECTION + " The this keyword"); + + var testcases = getTestCases(); + test(); + +function getTestCases(){ + var array = new Array(); + var item = 0; + + var GLOBAL_OBJECT = this.toString(); + + // this in global code should return the global object. + + array[item++] = new TestCase( SECTION, + "Global Code: this.toString()", + GLOBAL_OBJECT, + this.toString() ); + + // this in anonymous code called as a function should return the global object. + + // will work in spidermonkey but will fail in FP7, no compiler error + var MYFUNC = function(){return this.toString()} + array[item++] = new TestCase( SECTION, + "Anonymous Code: var MYFUNC = new Function('return this.toString()'); MYFUNC()", + GLOBAL_OBJECT, + MYFUNC() ); + + // thisin anonymous code called as a function should return that function's activation object + var MYFUNC = function(){return this.toString();} + + array[item++] = new TestCase( SECTION, + "Anonymous Code: var MYFUNC = function(){return this.toString;}", + GLOBAL_OBJECT, + (MYFUNC()).toString() ); + + // this in anonymous code called as a constructor should return the object + var MYFUNC = function(){this.THIS = this} + array[item++] = new TestCase( SECTION, + "Anonymous Code: var MYFUNC = new Function('this.THIS = this'); ((new MYFUNC()).THIS).toString()", + "[object Object]", + ((new MYFUNC()).THIS).toString() ); + + var MYFUNC = function(){this.THIS = this} + var FUN1 = new MYFUNC(); + array[item++] = new TestCase( SECTION, + "Anonymous Code: var MYFUNC = new Function('this.THIS = this'); var FUN1 = new MYFUNC(); FUN1.THIS == FUN1", + true, + FUN1.THIS == FUN1 ); + + // this in function code called as a function should return the global object. + array[item++] = new TestCase( SECTION, + "Function Code: ReturnThis()", + GLOBAL_OBJECT, + ReturnThis() ); + + // this in function code called as a contructor should return the object. + var MYOBJECT = new ReturnThis(); + array[item++] = new TestCase( SECTION, + "var MYOBJECT = new ReturnThis(); MYOBJECT.toString()", + "[object Object]", + MYOBJECT.toString() ); + return array; +} + + +function ReturnThis() { + return this.toString(); +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_1_4.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_1_4.as new file mode 100644 index 00000000000..b74a07b2a25 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_1_4.as @@ -0,0 +1,226 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "11.1.4"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Array Initialiser"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + Array_One = [] + + + + array[item++] = new TestCase( SECTION, + "typeof Array_One", + "object", + typeof Array_One ); + + array[item++] = new TestCase( SECTION, + "Array_One=[]; Array_One.getClass = Object.prototype.toString; Array_One.getClass()", + "[object Array]", + (Array_One.getClass = Object.prototype.toString, Array_One.getClass() ) ); + + array[item++] = new TestCase( SECTION, + "Array_One = []; Array_One.toString == Array.prototype.toString", + true, + (Array_One.toString == Array.prototype.toString ) ); + + array[item++] = new TestCase( SECTION, + "Array_One.length", + 0, + Array_One.length ); + + Array_Two = [1,2,3] + + + array[item++] = new TestCase( SECTION, + "Array_Two", + "1,2,3", + Array_Two+"" ); + + + + array[item++] = new TestCase( SECTION, + "typeof Array_Two", + "object", + typeof Array_Two); + + array[item++] = new TestCase( SECTION, + "Array_Two=[1,2,3]; arr.getClass = Object.prototype.toString; arr.getClass()", + "[object Array]", + (Array_Two.getClass = Object.prototype.toString, Array_Two.getClass() ) ); + + array[item++] = new TestCase( SECTION, + "Array_Two.toString == Array.prototype.toString", + true, + (Array_Two.toString == Array.prototype.toString ) ); + + array[item++] = new TestCase( SECTION, + "Array_Two.length", + 3, + Array_Two.length ); + + Array_Three = [12345] + + array[item++] = new TestCase( SECTION, + "typeof Array_Three", + "object", + typeof Array_Three ); + + array[item++] = new TestCase( SECTION, + "Array_Three=[12345]; Array_Three.getClass = Object.prototype.toString; Array_Three.getClass()", + "[object Array]", + (Array_Three.getClass = Object.prototype.toString, Array_Three.getClass() ) ); + + Array_Four = [1,2,3,4,5] + + array[item++] = new TestCase( SECTION, + "Array_Four.toString == Array.prototype.toString", + true, + (Array_Four.toString == Array.prototype.toString ) ); + + Array_Five = [,2,3,4,5] + + array[item++] = new TestCase( SECTION, + "Array_Five.length", + 5, + Array_Five.length ); + + array[item++] = new TestCase( SECTION, + "Array_Five[1]", + 2, + Array_Five[1] ); + + Array_Six = [1,2,3,4,5,6,7,8,9,10,11,12,13,,15,16,17,18,19,20,21,22,23,24,25] + + array[item++] = new TestCase( SECTION, + "Array_Six.length", + 25, + Array_Six.length ); + + array[item++] = new TestCase( SECTION, + "Array_Six[14]", + 15, + Array_Six[14] ); + + Array_Seven = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,] + + array[item++] = new TestCase( SECTION, + "Array_Seven.length", + 32, + Array_Seven.length ); + Array_Eight=[,,,,,,,,,,,,,,,] + + array[item++] = new TestCase( SECTION, + "Array_Eight.length", + 15, + Array_Eight.length ); + + Array_Nine = [,2,3,4,5,6,7,8,9,10,11,,13,14,15,16,17,18,19,,21,22,23,24,25,26,27,28,29,30,31,32,] + + array[item++] = new TestCase( SECTION, + "Array_Nine.length", + 32, + Array_Nine.length ); + + array[item++] = new TestCase( SECTION, + "Array_Nine[1]", + 2, + Array_Nine[1] ); + + array[item++] = new TestCase( SECTION, + "Array_Nine[0]", + undefined, + Array_Nine[0] ); + + array[item++] = new TestCase( SECTION, + "Array_Nine[11]", + undefined, + Array_Nine[11] ); + + array[item++] = new TestCase( SECTION, + "Array_Nine[12]", + 13, + Array_Nine[12] ); + + array[item++] = new TestCase( SECTION, + "Array_Nine[19]", + undefined, + Array_Nine[19] ); + + array[item++] = new TestCase( SECTION, + "Array_Nine[20]", + 21, + Array_Nine[20] ); + + array[item++] = new TestCase( SECTION, + "Array_Nine[32]", + undefined, + Array_Nine[32] ); + + var Array_Ten:Array = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]; + + array[item++] = new TestCase( SECTION, + "Multi dimensional array", + 6, + Array_Ten[1][2] ); + + var obj = new Object(); + obj.prop1 = "Good"; + obj.prop2 = "one"; + for (j in obj){ + + var myvar = obj[j]; + if (myvar=="one"){ + break; + } + //print(myvar); + } + + array[item++] = new TestCase( SECTION,"Using array initializers to dynamically set and retrieve values of an object","one",myvar ); + + + + + + + return ( array ); +} + diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_1_5.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_1_5.as new file mode 100644 index 00000000000..26049babfeb --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_1_5.as @@ -0,0 +1,119 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "11.1.5"; + var VERSION = "ECMA_4"; + startTest(); + var TITLE = "Object Initialisers"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + MyObject = {} + array[item++] = new TestCase( SECTION, "MyObject = {}", "[object Object]", MyObject.toString() ); + + array[item++] = new TestCase( SECTION, "MyObject = {}, typeof MyObject","object",typeof MyObject ); + + MyNumberObject = {MyNumber:10} + + array[item++] = new TestCase( SECTION, "MyNumberObject = {MyNumber:10}",10,MyNumberObject.MyNumber ); + + MyStringObject = {MyString:"string"} + + array[item++] = new TestCase( SECTION, "MyStringObject = {MyString:string}","string",MyStringObject.MyString ); + + MyBooleanObject = {MyBoolean:true} + + array[item++] = new TestCase( SECTION, "MyBooleanObject = {MyBoolean:true}",true,MyBooleanObject.MyBoolean ); + + function myfunc():String{ + return "Hi!!!"} + + MyObject2 = {MyNumber:10,MyString:'string',MyBoolean:true,myarr:[1,2,3],myfuncvar:myfunc} + + array[item++] = new TestCase( SECTION, "MyObject2 = {MyNumber:10,MyString:'string',MyBoolean:true,myarr:[1,2,3],myfuncvar:myfunc}",10,MyObject2.MyNumber ); + + + + array[item++] = new TestCase( SECTION, "MyObject2 = {MyNumber:10,MyString:'string',MyBoolean:true,myarr:[1,2,3],myfuncvar:myfunc}","string",MyObject2.MyString ); + + + + array[item++] = new TestCase( SECTION, "MyObject2 = {MyNumber:10,MyString:'string',MyBoolean:true,myarr:[1,2,3],myfuncvar:myfunc}",true,MyObject2.MyBoolean ); + + array[item++] = new TestCase( SECTION, "MyObject2 = {MyNumber:10,MyString:'string',MyBoolean:true,myarr:[1,2,3],myfuncvar:myfunc}","number",typeof MyObject2.MyNumber ); + + + + array[item++] = new TestCase( SECTION, "MyObject2 = {MyNumber:10,MyString:'string',MyBoolean:true,myarr:[1,2,3],myfuncvar:myfunc}","string",typeof MyObject2.MyString ); + + + + array[item++] = new TestCase( SECTION, "MyObject2 = {MyNumber:10,MyString:'string',MyBoolean:true,myarr:[1,2,3],myfuncvar:myfunc}","boolean",typeof MyObject2.MyBoolean ); + + array[item++] = new TestCase( SECTION, "MyObject2 = {MyNumber:10,MyString:'string',MyBoolean:true,myarr:[1,2,3],myfuncvar:myfunc}",3,MyObject2.myarr.length ); + + + array[item++] = new TestCase( SECTION, "MyObject2 = {MyNumber:10,MyString:'string',MyBoolean:true,myarr:[1,2,3],myfuncvar:myfunc}","object",typeof MyObject2.myarr ); + + array[item++] = new TestCase( SECTION, "MyObject2 = {MyNumber:10,MyString:'string',MyBoolean:true,myarr:[1,2,3],myfuncvar:myfunc}","Hi!!!",MyObject2.myfuncvar() ); + + array[item++] = new TestCase( SECTION, "MyObject2 = {MyNumber:10,MyString:'string',MyBoolean:true,myarr:[1,2,3],myfuncvar:myfunc}","function",typeof MyObject2.myfuncvar ); + + + MyObject3 = {myvar:this} + + array[item++] = new TestCase( SECTION, "MyObject3 = {this}","object",typeof MyObject3.myvar); + + array[item++] = new TestCase( SECTION, "MyObject3 = {this}","[object global]",MyObject3.myvar+""); + + MyObject4 = {myvar:function() {}} + + array[item++] = new TestCase( SECTION, "MyObject4 = {myvar:function() {}}","function",typeof MyObject4.myvar); + + array[item++] = new TestCase( SECTION, "MyObject4 = {myvar:function() {}}","function Function() {}",MyObject4.myvar+""); + + array[item++] = new TestCase( SECTION, "MyObject4 = {myvar:function() {}}","function Function() {}",MyObject4.myvar.toString()); + + + + + return ( array ); +} + +function MyObject( value ) { + this.value = function() {return this.value;} + this.toString = function() {return this.value+'';} +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_1_6.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_1_6.as new file mode 100644 index 00000000000..84c8e19061d --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_1_6.as @@ -0,0 +1,150 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "11.1.6"; + var VERSION = "ECMA_4"; + startTest(); + var TITLE = "The Grouping Operator"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "typeof(new Object())","object",typeof(new Object())); + + array[item++] = new TestCase( SECTION, "typeof(new Array())","object",typeof(new Array())); + + array[item++] = new TestCase( SECTION, "typeof(new Date())","object",typeof(new Date())); + + array[item++] = new TestCase( SECTION, "typeof(new Boolean())","boolean",typeof(new Boolean())); + + array[item++] = new TestCase( SECTION, "typeof(new String())","string",typeof(new String())); + + array[item++] = new TestCase( SECTION, "typeof(new Number())","number",typeof(new Number())); + + array[item++] = new TestCase( SECTION, "typeof(Math)","object",typeof(Math)); + + array[item++] = new TestCase( SECTION, "typeof(function(){})","function",typeof(function(){})); + + array[item++] = new TestCase( SECTION, "typeof(this)","object",typeof(this)); + + var MyVar:Number=10; + + array[item++] = new TestCase( SECTION, "typeof(MyVar)","number",typeof(MyVar)); + + array[item++] = new TestCase( SECTION, "typeof([])","object",typeof([])); + + array[item++] = new TestCase( SECTION, "typeof({})","object",typeof({})); + + array[item++] = new TestCase( SECTION, "typeof('')","string",typeof('')); + + var MyArray = new Array(1,2,3); + + delete(MyArray[0]) + + array[item++] = new TestCase( SECTION, "delete(MyArray[0]);MyArray[0]",undefined,MyArray[0]); + + Number.prototype.foo=10; + + delete(Number.prototype.foo); + + array[item++] = new TestCase( SECTION, "delete(Number.prototype.foo);",undefined,Number.prototype.foo); + + String.prototype.goo = 'hi'; + + delete(String.prototype.goo); + + array[item++] = new TestCase( SECTION, "delete(String.prototype.goo);",undefined,String.prototype.goo); + + Date.prototype.mydate=new Date(0); + + delete(Date.prototype.mydate); + + array[item++] = new TestCase( SECTION, "delete(Date.prototype.mydate);",undefined,Date.prototype.mydate); + + + + array[item++] = new TestCase( SECTION, "delete(new String('hi'));",true,delete(new String('hi'))); + + array[item++] = new TestCase( SECTION, "delete(new Date(0));",true,delete(new Date(0))); + + array[item++] = new TestCase( SECTION, "delete(new Number(10));",true,delete(new Number(10))); + + array[item++] = new TestCase( SECTION, "delete(new Object());",true,delete(new Object())); + + var obj = new Object(); + + array[item++] = new TestCase( SECTION, "delete(obj) Trying to delete an object of reference type should return false",false,delete(obj)); + + var a:Number = 10; + var b:Number = 20; + var c:Number = 30; + var d:Number = 40; + + /*Grouping operators are used to change the normal hierarchy of the mathematical operators, expressions inside paranthesis are calculated first before any other expressions are calculated*/ + + array[item++] = new TestCase( SECTION, "Grouping operator used in defining the hierarchy of the operators",true,(a+b*c+d)!=((a+b)*(c+d))); + +//Grouping operators are used when passing parameters through a function + + function myfunction(a):Number{ + return a*a; + } + + array[item++] = new TestCase( SECTION, "Grouping operator used in passing parameters to a function",4,myfunction(2)); + + var a:Number = 1; + var b:Number = 2; + function foo() { a += b; } + function bar() { b *= 10; } + + array[item++] = new TestCase( SECTION, "Grouping operator used in evaluating functions and returning the results of an expression",23,(foo(), bar(), a + b)); + + + + + + + + + + + return ( array ); +} + +function MyObject( value ) { + this.value = function() {return this.value;} + this.toString = function() {return this.value+'';} +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_1_1.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_1_1.as new file mode 100644 index 00000000000..62060a60329 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_1_1.as @@ -0,0 +1,361 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "11_2_1_1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Property Accessors"; + writeHeaderToLog( SECTION + " "+TITLE ); + var testcases = getTestCases(); + + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var PROPERTY = new Array(); + + + array[item++] = new TestCase( SECTION, "typeof this.NaN", "undefined", typeof (this.NaN) ); + array[item++] = new TestCase( SECTION, "typeof this['NaN']", "undefined", typeof this['NaN'] ); + array[item++] = new TestCase( SECTION, "typeof this.Infinity", "undefined", typeof this.Infinity ); + array[item++] = new TestCase( SECTION, "typeof this['Infinity']", "undefined", typeof this['Infinity'] ); + array[item++] = new TestCase( SECTION, "typeof this.parseInt", "undefined", typeof this.parseInt ); + array[item++] = new TestCase( SECTION, "typeof this['parseInt']", "undefined", typeof this['parseInt']); + array[item++] = new TestCase( SECTION, "typeof this.parseFloat", "undefined",typeof this.parseFloat ); + array[item++] = new TestCase( SECTION, "typeof this['parseFloat']","undefined",typeof this['parseFloat']); + array[item++] = new TestCase( SECTION, "typeof this.escape", "undefined",typeof this.escape ); + array[item++] = new TestCase( SECTION, "typeof this['escape']", "undefined",typeof this['escape']); + array[item++] = new TestCase( SECTION, "typeof this.unescape", "undefined",typeof this.unescape ); + array[item++] = new TestCase( SECTION, "typeof this['unescape']", "undefined",typeof this['unescape']); + array[item++] = new TestCase( SECTION, "typeof this.isNaN", "undefined",typeof this.isNaN ); + array[item++] = new TestCase( SECTION, "typeof this['isNaN']", "undefined",typeof this['isNaN']); + array[item++] = new TestCase( SECTION, "typeof this.isFinite", "undefined",typeof this.isFinite ); + array[item++] = new TestCase( SECTION, "typeof this['isFinite']", "undefined",typeof this['isFinite']); + array[item++] = new TestCase( SECTION, "typeof this.Object", "undefined", typeof this.Object); + array[item++] = new TestCase( SECTION, "typeof this['Object']", "undefined", typeof this['Object']); + array[item++] = new TestCase( SECTION, "typeof this.Number", "undefined", typeof this.Number); + array[item++] = new TestCase( SECTION, "typeof this['Number']", "undefined", typeof this['Number']); + array[item++] = new TestCase( SECTION, "typeof this.Function", "undefined", typeof this.Function); + array[item++] = new TestCase( SECTION, "typeof this['Function']", "undefined", typeof this['Function']); + array[item++] = new TestCase( SECTION, "typeof this.Array", "undefined", typeof this.Array); + array[item++] = new TestCase( SECTION, "typeof this['Array']", "undefined", typeof this['Array']); + array[item++] = new TestCase( SECTION, "typeof this.String", "undefined", typeof this.String); + array[item++] = new TestCase( SECTION, "typeof this['String']", "undefined", typeof this['String']); + array[item++] = new TestCase( SECTION, "typeof this.Boolean", "undefined", typeof this.Boolean); + array[item++] = new TestCase( SECTION, "typeof this['Boolean']", "undefined", typeof this['Boolean']); + array[item++] = new TestCase( SECTION, "typeof this.Date", "undefined", typeof this.Date); + array[item++] = new TestCase( SECTION, "typeof this['Date']", "undefined", typeof this['Date']); + array[item++] = new TestCase( SECTION, "typeof this.Math", "undefined", typeof this.Math); + array[item++] = new TestCase( SECTION, "typeof this['Math']", "undefined", typeof this['Math']); + + // properties and methods of Object objects + + array[item++] = new TestCase( SECTION, "typeof Object.prototype", "object", typeof Object.prototype ); + array[item++] = new TestCase( SECTION, "typeof Object['prototype']", "object",typeof Object['prototype']); + array[item++] = new TestCase( SECTION, "typeof Object.toString", "function", typeof Object.toString); + array[item++] = new TestCase( SECTION, "typeof Object['toString']", "function", typeof Object['toString']); + array[item++] = new TestCase( SECTION, "typeof Object.valueOf", "function", typeof Object.valueOf); + array[item++] = new TestCase( SECTION, "typeof Object['valueOf']", "function", typeof Object['valueOf']); + array[item++] = new TestCase( SECTION, "typeof Object.constructor", "object",typeof Object.constructor ); + array[item++] = new TestCase( SECTION, "typeof Object['constructor']", "object",typeof Object['constructor']); + + + // properties of the Function object + + array[item++] = new TestCase( SECTION, "typeof Function.prototype", "function",typeof Function.prototype ); + array[item++] = new TestCase( SECTION, "typeof Function['prototype']", "function",typeof Function['prototype'] ); + array[item++] = new TestCase( SECTION, "typeof Function.prototype.toString", "function",typeof Function.prototype.toString ); + array[item++] = new TestCase( SECTION, "typeof Function.prototype['toString']", "function",typeof Function.prototype['toString'] ); + array[item++] = new TestCase( SECTION, "typeof Function.prototype.length", "number", typeof Function.prototype.length); + array[item++] = new TestCase( SECTION, "typeof Function.prototype['length']", "number", typeof Function.prototype['length']); + array[item++] = new TestCase( SECTION, "typeof Function.prototype.valueOf", "function",typeof Function.prototype.valueOf ); + array[item++] = new TestCase( SECTION, "typeof Function.prototype['valueOf']", "function",typeof Function.prototype['valueOf'] ); + + //created extra property. need to delete this at the end + Function.prototype.myProperty = "hi"; + + array[item++] = new TestCase( SECTION, "typeof Function.prototype.myProperty", "string",typeof Function.prototype.myProperty ); + array[item++] = new TestCase( SECTION, "typeof Function.prototype['myProperty']", "string",typeof Function.prototype['myProperty']); + + // properties of the Array object + array[item++] = new TestCase( SECTION, "typeof Array.prototype", "object",typeof Array.prototype ); + array[item++] = new TestCase( SECTION, "typeof Array['prototype']", "object",typeof Array['prototype']); + array[item++] = new TestCase( SECTION, "typeof Array.length", "number",typeof Array.length ); + array[item++] = new TestCase( SECTION, "typeof Array['length']", "number",typeof Array['length']); + array[item++] = new TestCase( SECTION, "typeof Array.prototype.constructor", "object",typeof Array.prototype.constructor ); + array[item++] = new TestCase( SECTION, "typeof Array.prototype['constructor']", "object",typeof Array.prototype['constructor']); + array[item++] = new TestCase( SECTION, "typeof Array.prototype.toString", "function",typeof Array.prototype.toString ); + array[item++] = new TestCase( SECTION, "typeof Array.prototype['toString']", "function",typeof Array.prototype['toString']); + array[item++] = new TestCase( SECTION, "typeof Array.prototype.join", "function",typeof Array.prototype.join ); + array[item++] = new TestCase( SECTION, "typeof Array.prototype['join']", "function",typeof Array.prototype['join']); + array[item++] = new TestCase( SECTION, "typeof Array.prototype.reverse", "function",typeof Array.prototype.reverse ); + array[item++] = new TestCase( SECTION, "typeof Array.prototype['reverse']", "function",typeof Array.prototype['reverse']); + array[item++] = new TestCase( SECTION, "typeof Array.prototype.sort", "function",typeof Array.prototype.sort ); + array[item++] = new TestCase( SECTION, "typeof Array.prototype['sort']", "function",typeof Array.prototype['sort']); + + + // properties of the String object + array[item++] = new TestCase( SECTION, "typeof String.prototype", "object",typeof String.prototype ); + array[item++] = new TestCase( SECTION, "typeof String['prototype']", "object",typeof String['prototype'] ); + array[item++] = new TestCase( SECTION, "typeof String.fromCharCode", "function",typeof String.fromCharCode ); + array[item++] = new TestCase( SECTION, "typeof String['fromCharCode']", "function",typeof String['fromCharCode'] ); + array[item++] = new TestCase( SECTION, "typeof String.prototype.toString", "function",typeof String.prototype.toString ); + array[item++] = new TestCase( SECTION, "typeof String.prototype['toString']", "function",typeof String.prototype['toString'] ); + array[item++] = new TestCase( SECTION, "typeof String.prototype.constructor", "object",typeof String.prototype.constructor ); + array[item++] = new TestCase( SECTION, "typeof String.prototype['constructor']", "object",typeof String.prototype['constructor'] ); + array[item++] = new TestCase( SECTION, "typeof String.prototype.valueOf", "function",typeof String.prototype.valueOf ); + array[item++] = new TestCase( SECTION, "typeof String.prototype['valueOf']", "function",typeof String.prototype['valueOf'] ); + array[item++] = new TestCase( SECTION, "typeof String.prototype.charAt", "function", typeof String.prototype.charAt); + array[item++] = new TestCase( SECTION, "typeof String.prototype['charAt']", "function", typeof String.prototype['charAt']); + array[item++] = new TestCase( SECTION, "typeof String.prototype.charCodeAt", "function", typeof String.prototype.charCodeAt); + array[item++] = new TestCase( SECTION, "typeof String.prototype['charCodeAt']", "function", typeof String.prototype['charCodeAt']); + array[item++] = new TestCase( SECTION, "typeof String.prototype.indexOf", "function",typeof String.prototype.indexOf ); + array[item++] = new TestCase( SECTION, "typeof String.prototype['indexOf']", "function",typeof String.prototype['indexOf'] ); + array[item++] = new TestCase( SECTION, "typeof String.prototype.lastIndexOf", "function",typeof String.prototype.lastIndexOf ); + array[item++] = new TestCase( SECTION, "typeof String.prototype['lastIndexOf']", "function",typeof String.prototype['lastIndexOf'] ); + array[item++] = new TestCase( SECTION, "typeof String.prototype.split", "function", typeof String.prototype.split); + array[item++] = new TestCase( SECTION, "typeof String.prototype['split']", "function", typeof String.prototype['split']); + array[item++] = new TestCase( SECTION, "typeof String.prototype.substring", "function",typeof String.prototype.substring ); + array[item++] = new TestCase( SECTION, "typeof String.prototype['substring']", "function",typeof String.prototype['substring'] ); + array[item++] = new TestCase( SECTION, "typeof String.prototype.toLowerCase", "function", typeof String.prototype.toLowerCase); + array[item++] = new TestCase( SECTION, "typeof String.prototype['toLowerCase']", "function", typeof String.prototype['toLowerCase']); + array[item++] = new TestCase( SECTION, "typeof String.prototype.toUpperCase", "function", typeof String.prototype.toUpperCase); + array[item++] = new TestCase( SECTION, "typeof String.prototype['toUpperCase']", "function", typeof String.prototype['toUpperCase']); + array[item++] = new TestCase( SECTION, "typeof String.prototype.length", "undefined",typeof String.prototype.length ); + array[item++] = new TestCase( SECTION, "typeof String.prototype['length']", "undefined",typeof String.prototype['length'] ); + + + // properties of the Boolean object + array[item++] = new TestCase( SECTION, "typeof Boolean.prototype", "object",typeof Boolean.prototype ); + array[item++] = new TestCase( SECTION, "typeof Boolean['prototype']", "object",typeof Boolean['prototype'] ); + array[item++] = new TestCase( SECTION, "typeof Boolean.constructor", "object",typeof Boolean.constructor ); + array[item++] = new TestCase( SECTION, "typeof Boolean['constructor']", "object",typeof Boolean['constructor'] ); + array[item++] = new TestCase( SECTION, "typeof Boolean.prototype.valueOf", "function",typeof Boolean.prototype.valueOf ); + array[item++] = new TestCase( SECTION, "typeof Boolean.prototype['valueOf']", "function",typeof Boolean.prototype['valueOf']); + array[item++] = new TestCase( SECTION, "typeof Boolean.prototype.toString", "function", typeof Boolean.prototype.toString); + array[item++] = new TestCase( SECTION, "typeof Boolean.prototype['toString']", "function", typeof Boolean.prototype['toString']); + + // properties of the Number object + + array[item++] = new TestCase( SECTION, "typeof Number.MAX_VALUE", "number",typeof Number.MAX_VALUE ); + array[item++] = new TestCase( SECTION, "typeof Number['MAX_VALUE']", "number",typeof Number['MAX_VALUE']); + array[item++] = new TestCase( SECTION, "typeof Number.MIN_VALUE", "number", typeof Number.MIN_VALUE); + array[item++] = new TestCase( SECTION, "typeof Number['MIN_VALUE']", "number", typeof Number['MIN_VALUE']); + array[item++] = new TestCase( SECTION, "typeof Number.NaN", "number", typeof Number.NaN); + array[item++] = new TestCase( SECTION, "typeof Number['NaN']", "number", typeof Number['NaN']); + array[item++] = new TestCase( SECTION, "typeof Number.NEGATIVE_INFINITY", "number", typeof Number.NEGATIVE_INFINITY); + array[item++] = new TestCase( SECTION, "typeof Number['NEGATIVE_INFINITY']", "number", typeof Number['NEGATIVE_INFINITY']); + array[item++] = new TestCase( SECTION, "typeof Number.POSITIVE_INFINITY", "number", typeof Number.POSITIVE_INFINITY); + array[item++] = new TestCase( SECTION, "typeof Number['POSITIVE_INFINITY']", "number", typeof Number['POSITIVE_INFINITY']); + array[item++] = new TestCase( SECTION, "typeof Number.prototype.toString", "function",typeof Number.prototype.toString ); + array[item++] = new TestCase( SECTION, "typeof Number.prototype['toString']", "function",typeof Number.prototype['toString'] ); + array[item++] = new TestCase( SECTION, "typeof Number.prototype.constructor", "object", typeof Number.prototype.constructor); + array[item++] = new TestCase( SECTION, "typeof Number.prototype['constructor']", "object", typeof Number.prototype['constructor']); + array[item++] = new TestCase( SECTION, "typeof Number.prototype.valueOf", "function",typeof Number.prototype.valueOf ); + array[item++] = new TestCase( SECTION, "typeof Number.prototype['valueOf']", "function",typeof Number.prototype['valueOf'] ); + + // properties of the Math Object. + array[item++] = new TestCase( SECTION, "typeof Math.E", "number", typeof Math.E); + array[item++] = new TestCase( SECTION, "typeof Math['E']", "number", typeof Math['E']); + array[item++] = new TestCase( SECTION, "typeof Math.LN10", "number", typeof Math.LN10); + array[item++] = new TestCase( SECTION, "typeof Math['LN10']", "number", typeof Math['LN10']); + array[item++] = new TestCase( SECTION, "typeof Math.LN2", "number", typeof Math.LN2); + array[item++] = new TestCase( SECTION, "typeof Math['LN2']", "number", typeof Math['LN2']); + array[item++] = new TestCase( SECTION, "typeof Math.LOG2E", "number", typeof Math.LOG2E); + array[item++] = new TestCase( SECTION, "typeof Math['LOG2E']", "number", typeof Math['LOG2E']); + array[item++] = new TestCase( SECTION, "typeof Math.LOG10E", "number", typeof Math.LOG10E); + array[item++] = new TestCase( SECTION, "typeof Math['LOG10E']", "number", typeof Math['LOG10E']); + array[item++] = new TestCase( SECTION, "typeof Math.PI", "number", typeof Math.PI); + array[item++] = new TestCase( SECTION, "typeof Math['PI']", "number", typeof Math['PI']); + array[item++] = new TestCase( SECTION, "typeof Math.SQRT1_2", "number", typeof Math.SQRT1_2); + array[item++] = new TestCase( SECTION, "typeof Math['SQRT1_2']", "number", typeof Math['SQRT1_2']); + array[item++] = new TestCase( SECTION, "typeof Math.SQRT2", "number", typeof Math.SQRT2); + array[item++] = new TestCase( SECTION, "typeof Math['SQRT2']", "number", typeof Math['SQRT2']); + array[item++] = new TestCase( SECTION, "typeof Math.abs", "function", typeof Math.abs); + array[item++] = new TestCase( SECTION, "typeof Math['abs']", "function", typeof Math['abs']); + array[item++] = new TestCase( SECTION, "typeof Math.acos", "function", typeof Math.acos); + array[item++] = new TestCase( SECTION, "typeof Math['acos']", "function", typeof Math['acos']); + array[item++] = new TestCase( SECTION, "typeof Math.asin", "function", typeof Math.asin); + array[item++] = new TestCase( SECTION, "typeof Math['asin']", "function", typeof Math['asin']); + array[item++] = new TestCase( SECTION, "typeof Math.atan", "function", typeof Math.atan); + array[item++] = new TestCase( SECTION, "typeof Math['atan']", "function", typeof Math['atan']); + array[item++] = new TestCase( SECTION, "typeof Math.atan2", "function", typeof Math.atan2); + array[item++] = new TestCase( SECTION, "typeof Math['atan2']", "function", typeof Math['atan2']); + array[item++] = new TestCase( SECTION, "typeof Math.ceil", "function", typeof Math.ceil); + array[item++] = new TestCase( SECTION, "typeof Math['ceil']", "function", typeof Math['ceil']); + array[item++] = new TestCase( SECTION, "typeof Math.cos", "function", typeof Math.cos); + array[item++] = new TestCase( SECTION, "typeof Math['cos']", "function", typeof Math['cos']); + array[item++] = new TestCase( SECTION, "typeof Math.exp", "function", typeof Math.exp); + array[item++] = new TestCase( SECTION, "typeof Math['exp']", "function", typeof Math['exp']); + array[item++] = new TestCase( SECTION, "typeof Math.floor", "function", typeof Math.floor); + array[item++] = new TestCase( SECTION, "typeof Math['floor']", "function", typeof Math['floor']); + array[item++] = new TestCase( SECTION, "typeof Math.log", "function", typeof Math.log); + array[item++] = new TestCase( SECTION, "typeof Math['log']", "function", typeof Math['log']); + array[item++] = new TestCase( SECTION, "typeof Math.max", "function", typeof Math.max); + array[item++] = new TestCase( SECTION, "typeof Math['max']", "function", typeof Math['max']); + array[item++] = new TestCase( SECTION, "typeof Math.min", "function", typeof Math.min); + array[item++] = new TestCase( SECTION, "typeof Math['min']", "function", typeof Math['min']); + array[item++] = new TestCase( SECTION, "typeof Math.pow", "function", typeof Math.pow); + array[item++] = new TestCase( SECTION, "typeof Math['pow']", "function", typeof Math['pow']); + array[item++] = new TestCase( SECTION, "typeof Math.random", "function", typeof Math.random); + array[item++] = new TestCase( SECTION, "typeof Math['random']", "function", typeof Math['random']); + array[item++] = new TestCase( SECTION, "typeof Math.round", "function", typeof Math.round); + array[item++] = new TestCase( SECTION, "typeof Math['round']", "function", typeof Math['round']); + array[item++] = new TestCase( SECTION, "typeof Math.sin", "function", typeof Math.sin); + array[item++] = new TestCase( SECTION, "typeof Math['sin']", "function", typeof Math['sin']); + array[item++] = new TestCase( SECTION, "typeof Math.sqrt", "function", typeof Math.sqrt); + array[item++] = new TestCase( SECTION, "typeof Math['sqrt']", "function", typeof Math['sqrt']); + array[item++] = new TestCase( SECTION, "typeof Math.tan", "function", typeof Math.tan); + array[item++] = new TestCase( SECTION, "typeof Math['tan']", "function", typeof Math['tan']); + + // properties of the Date object + array[item++] = new TestCase( SECTION, "typeof Date.parse", "function", typeof Date.parse); + array[item++] = new TestCase( SECTION, "typeof Date['parse']", "function", typeof Date['parse']); + array[item++] = new TestCase( SECTION, "typeof Date.prototype", "object", typeof Date.prototype); + array[item++] = new TestCase( SECTION, "typeof Date['prototype']", "object", typeof Date['prototype']); + array[item++] = new TestCase( SECTION, "typeof Date.UTC", "function", typeof Date.UTC); + array[item++] = new TestCase( SECTION, "typeof Date['UTC']", "function", typeof Date['UTC']); + array[item++] = new TestCase( SECTION, "typeof Date.prototype.constructor", "object", typeof Date.prototype.constructor); + array[item++] = new TestCase( SECTION, "typeof Date.prototype['constructor']", "object", typeof Date.prototype['constructor']); + array[item++] = new TestCase( SECTION, "typeof Date.prototype.toString", "function", typeof Date.prototype.toString); + array[item++] = new TestCase( SECTION, "typeof Date.prototype['toString']", "function", typeof Date.prototype['toString']); + array[item++] = new TestCase( SECTION, "typeof Date.prototype.valueOf", "function", typeof Date.prototype.valueOf); + array[item++] = new TestCase( SECTION, "typeof Date.prototype['valueOf']", "function", typeof Date.prototype['valueOf']); + array[item++] = new TestCase( SECTION, "typeof Date.prototype.getTime", "function", typeof Date.prototype.getTime); + array[item++] = new TestCase( SECTION, "typeof Date.prototype['getTime']", "function", typeof Date.prototype['getTime']); + array[item++] = new TestCase( SECTION, "typeof Date.prototype.getYear", "undefined", typeof Date.prototype.getYear); + array[item++] = new TestCase( SECTION, "typeof Date.prototype['getYear']", "undefined", typeof Date.prototype['getYear']); + array[item++] = new TestCase( SECTION, "typeof Date.prototype.getFullYear", "function", typeof Date.prototype.getFullYear); + array[item++] = new TestCase( SECTION, "typeof Date.prototype['getFullYear']", "function", typeof Date.prototype['getFullYear']); + array[item++] = new TestCase( SECTION, "typeof Date.prototype.getUTCFullYear", "function", typeof Date.prototype.getUTCFullYear); + array[item++] = new TestCase( SECTION, "typeof Date.prototype['getUTCFullYear']", "function", typeof Date.prototype['getUTCFullYear']); + array[item++] = new TestCase( SECTION, "typeof Date.prototype.getMonth", "function", typeof Date.prototype.getMonth); + array[item++] = new TestCase( SECTION, "typeof Date.prototype['getMonth']", "function", typeof Date.prototype['getMonth']); + array[item++] = new TestCase( SECTION, "typeof Date.prototype.getUTCMonth", "function", typeof Date.prototype.getUTCMonth); + array[item++] = new TestCase( SECTION, "typeof Date.prototype['getUTCMonth']", "function", typeof Date.prototype['getUTCMonth']); + array[item++] = new TestCase( SECTION, "typeof Date.prototype.getDate", "function", typeof Date.prototype.getDate); + array[item++] = new TestCase( SECTION, "typeof Date.prototype['getDate']", "function", typeof Date.prototype['getDate']); + array[item++] = new TestCase( SECTION, "typeof Date.prototype.getUTCDate", "function", typeof Date.prototype.getUTCDate); + array[item++] = new TestCase( SECTION, "typeof Date.prototype['getUTCDate']", "function", typeof Date.prototype['getUTCDate']); + array[item++] = new TestCase( SECTION, "typeof Date.prototype.getDay", "function", typeof Date.prototype.getDay); + array[item++] = new TestCase( SECTION, "typeof Date.prototype['getDay']", "function", typeof Date.prototype['getDay']); + array[item++] = new TestCase( SECTION, "typeof Date.prototype.getUTCDay", "function", typeof Date.prototype.getUTCDay); + array[item++] = new TestCase( SECTION, "typeof Date.prototype['getUTCDay']", "function", typeof Date.prototype['getUTCDay']); + array[item++] = new TestCase( SECTION, "typeof Date.prototype.getHours", "function", typeof Date.prototype.getHours); + array[item++] = new TestCase( SECTION, "typeof Date.prototype['getHours']", "function", typeof Date.prototype['getHours']); + array[item++] = new TestCase( SECTION, "typeof Date.prototype.getUTCHours", "function", typeof Date.prototype.getUTCHours); + array[item++] = new TestCase( SECTION, "typeof Date.prototype['getUTCHours']", "function", typeof Date.prototype['getUTCHours']); + array[item++] = new TestCase( SECTION, "typeof Date.prototype.getMinutes", "function", typeof Date.prototype.getMinutes); + array[item++] = new TestCase( SECTION, "typeof Date.prototype['getMinutes']", "function", typeof Date.prototype['getMinutes']); + array[item++] = new TestCase( SECTION, "typeof Date.prototype.getUTCMinutes", "function", typeof Date.prototype.getUTCMinutes); + array[item++] = new TestCase( SECTION, "typeof Date.prototype['getUTCMinutes']", "function", typeof Date.prototype['getUTCMinutes']); + array[item++] = new TestCase( SECTION, "typeof Date.prototype.getSeconds", "function", typeof Date.prototype.getSeconds); + array[item++] = new TestCase( SECTION, "typeof Date.prototype['getSeconds']", "function", typeof Date.prototype['getSeconds']); + array[item++] = new TestCase( SECTION, "typeof Date.prototype.getUTCSeconds", "function", typeof Date.prototype.getUTCSeconds); + array[item++] = new TestCase( SECTION, "typeof Date.prototype['getUTCSeconds']", "function", typeof Date.prototype['getUTCSeconds']); + array[item++] = new TestCase( SECTION, "typeof Date.prototype.getMilliseconds","function", typeof Date.prototype.getMilliseconds); + array[item++] = new TestCase( SECTION, "typeof Date.prototype['getMilliseconds']","function", typeof Date.prototype['getMilliseconds']); + array[item++] = new TestCase( SECTION, "typeof Date.prototype.getUTCMilliseconds", "function", typeof Date.prototype.getUTCMilliseconds); + array[item++] = new TestCase( SECTION, "typeof Date.prototype['getUTCMilliseconds']", "function", typeof Date.prototype['getUTCMilliseconds']); + array[item++] = new TestCase( SECTION, "typeof Date.prototype.setTime", "function", typeof Date.prototype.setTime); + array[item++] = new TestCase( SECTION, "typeof Date.prototype['setTime']", "function", typeof Date.prototype['setTime']); + array[item++] = new TestCase( SECTION, "typeof Date.prototype.setMilliseconds","function", typeof Date.prototype.setMilliseconds); + array[item++] = new TestCase( SECTION, "typeof Date.prototype['setMilliseconds']","function", typeof Date.prototype['setMilliseconds']); + array[item++] = new TestCase( SECTION, "typeof Date.prototype.setUTCMilliseconds", "function", typeof Date.prototype.setUTCMilliseconds); + array[item++] = new TestCase( SECTION, "typeof Date.prototype['setUTCMilliseconds']", "function", typeof Date.prototype['setUTCMilliseconds']); + array[item++] = new TestCase( SECTION, "typeof Date.prototype.setSeconds", "function", typeof Date.prototype.setSeconds); + array[item++] = new TestCase( SECTION, "typeof Date.prototype['setSeconds']", "function", typeof Date.prototype['setSeconds']); + array[item++] = new TestCase( SECTION, "typeof Date.prototype.setUTCSeconds", "function", typeof Date.prototype.setUTCSeconds); + array[item++] = new TestCase( SECTION, "typeof Date.prototype['setUTCSeconds']", "function", typeof Date.prototype['setUTCSeconds']); + array[item++] = new TestCase( SECTION, "typeof Date.prototype.setMinutes", "function", typeof Date.prototype.setMinutes); + array[item++] = new TestCase( SECTION, "typeof Date.prototype['setMinutes']", "function", typeof Date.prototype['setMinutes']); + array[item++] = new TestCase( SECTION, "typeof Date.prototype.setUTCMinutes", "function", typeof Date.prototype.setUTCMinutes); + array[item++] = new TestCase( SECTION, "typeof Date.prototype['setUTCMinutes']", "function", typeof Date.prototype['setUTCMinutes']); + array[item++] = new TestCase( SECTION, "typeof Date.prototype.setHours", "function", typeof Date.prototype.setHours); + array[item++] = new TestCase( SECTION, "typeof Date.prototype['setHours']", "function", typeof Date.prototype['setHours']); + array[item++] = new TestCase( SECTION, "typeof Date.prototype.setUTCHours", "function", typeof Date.prototype.setUTCHours); + array[item++] = new TestCase( SECTION, "typeof Date.prototype['setUTCHours']", "function", typeof Date.prototype['setUTCHours']); + array[item++] = new TestCase( SECTION, "typeof Date.prototype.setDate", "function", typeof Date.prototype.setDate); + array[item++] = new TestCase( SECTION, "typeof Date.prototype['setDate']", "function", typeof Date.prototype['setDate']); + array[item++] = new TestCase( SECTION, "typeof Date.prototype.setUTCDate", "function", typeof Date.prototype.setUTCDate); + array[item++] = new TestCase( SECTION, "typeof Date.prototype['setUTCDate']", "function", typeof Date.prototype['setUTCDate']); + array[item++] = new TestCase( SECTION, "typeof Date.prototype.setMonth", "function", typeof Date.prototype.setMonth); + array[item++] = new TestCase( SECTION, "typeof Date.prototype['setMonth']", "function", typeof Date.prototype['setMonth']); + array[item++] = new TestCase( SECTION, "typeof Date.prototype.setUTCMonth", "function", typeof Date.prototype.setUTCMonth); + array[item++] = new TestCase( SECTION, "typeof Date.prototype['setUTCMonth']", "function", typeof Date.prototype['setUTCMonth']); + array[item++] = new TestCase( SECTION, "typeof Date.prototype.setFullYear", "function", typeof Date.prototype.setFullYear); + array[item++] = new TestCase( SECTION, "typeof Date.prototype['setFullYear']", "function", typeof Date.prototype['setFullYear']); + array[item++] = new TestCase( SECTION, "typeof Date.prototype.setUTCFullYear", "function", typeof Date.prototype.setUTCFullYear); + array[item++] = new TestCase( SECTION, "typeof Date.prototype['setUTCFullYear']", "function", typeof Date.prototype['setUTCFullYear']); + array[item++] = new TestCase( SECTION, "typeof Date.prototype.setYear", "undefined", typeof Date.prototype.setYear); + array[item++] = new TestCase( SECTION, "typeof Date.prototype['setYear']", "undefined", typeof Date.prototype['setYear']); + array[item++] = new TestCase( SECTION, "typeof Date.prototype.toLocaleString", "function", typeof Date.prototype.toLocaleString); + array[item++] = new TestCase( SECTION, "typeof Date.prototype['toLocaleString']", "function", typeof Date.prototype['toLocaleString']); + array[item++] = new TestCase( SECTION, "typeof Date.prototype.toUTCString", "function", typeof Date.prototype.toUTCString); + array[item++] = new TestCase( SECTION, "typeof Date.prototype['toUTCString']", "function", typeof Date.prototype['toUTCString']); + array[item++] = new TestCase( SECTION, "typeof Date.prototype.toGMTString", "undefined", typeof Date.prototype.toGMTString); + array[item++] = new TestCase( SECTION, "typeof Date.prototype['toGMTString']", "undefined", typeof Date.prototype['toGMTString']); + + for ( var i = 0, RESULT; i < PROPERTY.length; i++ ) { + RESULT = typeof (PROPERTY[i].object.PROPERTY[i].name); + + + array[item++] = new TestCase( SECTION, + "typeof " + PROPERTY[i].object + "." + PROPERTY[i].name, + PROPERTY[i].type+"", + RESULT ); + + + RESULT = typeof (PROPERTY[i].object['PROPERTY[i].name']); + + + array[item++] = new TestCase( SECTION, + "typeof " + PROPERTY[i].object + "['" + PROPERTY[i].name +"']", + PROPERTY[i].type, + RESULT ); + + } + + //restore. deleted the extra property created so it doesn't interfere with another testcase + //in ATS. + delete Function.prototype.myProperty; + return array; +} + +function MyObject( arg0, arg1, arg2, arg3, arg4 ) { + this.name = arg0; +} +function Property( object, name, type ) { + this.object = object; + this.name = name; + this.type = type; +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_1_2.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_1_2.as new file mode 100644 index 00000000000..23683591763 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_1_2.as @@ -0,0 +1,84 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "11_2_1_2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Property Accessors"; + writeHeaderToLog( SECTION + " "+TITLE ); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // go through all Native Function objects, methods, and properties and get their typeof. + + var PROPERTY = new Array(); + var p = 0; + + // try to access properties of primitive types + + PROPERTY[p++] = new Property( "hi","hi","hi",NaN ); + PROPERTY[p++] = new Property( NaN, NaN, "NaN", NaN ); +// PROPERTY[p++] = new Property( 3, 3, "3", 3 ); + PROPERTY[p++] = new Property( true, true, "true", 1 ); + PROPERTY[p++] = new Property( false, false, "false", 0 ); + + for ( var i = 0, RESULT; i < PROPERTY.length; i++ ) { + array[item++] = new TestCase( SECTION, + PROPERTY[i].object + ".valueOf()", + PROPERTY[i].value, + PROPERTY[i].object.valueOf()); + + array[item++] = new TestCase( SECTION, + PROPERTY[i].object + ".toString()", + PROPERTY[i].string, + PROPERTY[i].object.toString()); + + } + return array; +} + + +function MyObject( value ) { + this.value = value; + this.stringValue = value +""; + this.numberValue = Number(value); + return this; +} +function Property( object, value, string, number ) { + this.object = object; + this.string = String(value); + this.number = Number(value); + this.value = value; +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_1_3.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_1_3.as new file mode 100644 index 00000000000..5b0dc7f1593 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_1_3.as @@ -0,0 +1,80 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "11_2_1_2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Property Accessors"; + writeHeaderToLog( SECTION + " "+TITLE ); + + var testcases = getTestCases(); + + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // go through all Native Function objects, methods, and properties and get their typeof. + + var PROPERTY = new Array(); + var p = 0; + + // try to access properties of primitive types + + PROPERTY[p++] = new Property( "undefined", void 0, "undefined", NaN ); + + for ( var i = 0, RESULT; i < PROPERTY.length; i++ ) { + array[item++] = new TestCase( SECTION, + PROPERTY[i].object + ".valueOf()", + PROPERTY[i].value+"", + PROPERTY[i].object.valueOf()); + + array[item++] = new TestCase( SECTION, + PROPERTY[i].object + ".toString()", + PROPERTY[i].string, + PROPERTY[i].object.toString()); + + } + return array; +} + +function MyObject( value ) { + this.value = value; + this.stringValue = value +""; + this.numberValue = Number(value); + return this; +} +function Property( object, value, string, number ) { + this.object = object; + this.string = String(value); + this.number = Number(value); + this.value = value; +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_1_4_rt.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_1_4_rt.as new file mode 100644 index 00000000000..f25a42089e3 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_1_4_rt.as @@ -0,0 +1,84 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "11.2.1-4-n"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Property Accessors"; + writeHeaderToLog( SECTION + " "+TITLE ); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // go through all Native Function objects, methods, and properties and get their typeof. + + var PROPERTY = new Array(); + var p = 0; + + // try to access properties of primitive types + + PROPERTY[p++] = new Property( "null", null, "null", 0 ); + +//null.valueOf(); + + for ( var i = 0, RESULT; i < PROPERTY.length; i++ ) { + + + array[item++] = new TestCase( SECTION, + PROPERTY[i].object + ".valueOf()", + PROPERTY[i].value+"", + ( PROPERTY[i].object.valueOf()+"" ) ); + + + array[item++] = new TestCase( SECTION, + PROPERTY[i].object + ".toString()", + PROPERTY[i].string, + ( PROPERTY[i].object.toString() ) ); + } + return array; +} + + +function MyObject( value ) { + this.value = value; + this.stringValue = value +""; + this.numberValue = Number(value); + return this; +} +function Property( object, value, string, number ) { + this.object = object; + this.string = String(value); + this.number = Number(value); + this.value = value; +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_1_5.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_1_5.as new file mode 100644 index 00000000000..981ea57b4da --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_1_5.as @@ -0,0 +1,84 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "e11_2_1_5"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Property Accessors"; + writeHeaderToLog( SECTION + " "+TITLE ); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // go through all Native Function objects, methods, and properties and get their typeof. + + var PROPERTY = new Array(); + var p = 0; + + // try to access properties of primitive types + + PROPERTY[p++] = new Property( new String("hi"), "hi", "hi", NaN ); + PROPERTY[p++] = new Property( new Number(NaN), NaN, "NaN", NaN ); + PROPERTY[p++] = new Property( new Number(3), 3, "3", 3 ); + PROPERTY[p++] = new Property( new Boolean(true), true, "true", 1 ); + PROPERTY[p++] = new Property( new Boolean(false), false, "false", 0 ); + + for ( var i = 0, RESULT; i < PROPERTY.length; i++ ) { + array[item++] = new TestCase( SECTION, + PROPERTY[i].object + ".valueOf()", + PROPERTY[i].value, + (PROPERTY[i].object.valueOf())); + + array[item++] = new TestCase( SECTION, + PROPERTY[i].object + ".toString()", + PROPERTY[i].string, + (PROPERTY[i].object.toString())); + + } + return array; +} + + +function MyObject( value ) { + this.value = value; + this.stringValue = value +""; + this.numberValue = Number(value); + return this; +} +function Property( object, value, string, number ) { + this.object = object; + this.string = String(value); + this.number = Number(value); + this.value = value; +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_2_1.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_2_1.as new file mode 100644 index 00000000000..18d9d37eec3 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_2_1.as @@ -0,0 +1,97 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "11_2_2_1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "The new operator"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + + test(); + +class MyClass{ + + var MyFirstNumber:Number=0; + var MySecondNumber:Number=0; + + public function MyClass(a:Number,b:Number){ + MyFirstNumber = a; + MySecondNumber = b; + + } + + public function MyNumberOne():Number{ + return MyFirstNumber; + } + + public function MyNumberTwo():Number{ + return MySecondNumber; + } + +} + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, + "(new TestFunction(0,1,2,3,4,5)).length", + 6, + (new TestFunction(0,1,2,3,4,5)).length ); + + var myclass = new MyClass(10,20); + + array[item++] = new TestCase( SECTION, + "new operator used to create objects", + 10, + myclass.MyNumberOne() ); + + array[item++] = new TestCase( SECTION, + "new operator used to create objects", + 20, + myclass.MyNumberTwo() ); + + + + array[item++] = new TestCase( SECTION, + "new operator used to create objects", + "[object MyClass]", + myclass+"" ); + + return array; +} + +function TestFunction() { + return arguments; +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_2_10_rt.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_2_10_rt.as new file mode 100644 index 00000000000..f89310fd0a5 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_2_10_rt.as @@ -0,0 +1,68 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "11.2.2-9-n.js"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "The new operator"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var thisError="no error"; + try{ + var m = new Math(); + }catch(e:Error){ + thisError = e.toString(); + }finally{ + array[item++] = new TestCase( SECTION, + "var m = new Math()", + "TypeError: Error #1076", + typeError(thisError) ); + } + + /*array[item++] = new TestCase( SECTION, + "var m = new Math()", + "error", + m = new Math() );*/ + return array; +} + +function TestFunction() { + return arguments; +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_2_11.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_2_11.as new file mode 100644 index 00000000000..71da1eff65e --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_2_11.as @@ -0,0 +1,67 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "11.2.2-ll.as"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "The new operator"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var FUNCTION = function() { return this }; + f = new FUNCTION; + array[item++] = new TestCase( SECTION, + "var FUNCTION = new Function('return this'); f = new FUNCTION(); typeof f", + "object", + typeof f ); + return array; +} + +function test() { + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +" = "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value "; + } + stopTest(); + return ( testcases ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_2_12_rt.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_2_12_rt.as new file mode 100644 index 00000000000..e67ad16e058 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_2_12_rt.as @@ -0,0 +1,54 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "11.2.2.l2.as"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "The new operator"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var FUNCTION = new Function(); + + f = new FUNCTION(); + array[item++] = new TestCase( SECTION, + "var FUNCTION = new Function(); f = new FUNCTION(); typeof f", + "object", + typeof f ); + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_2_1_rt.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_2_1_rt.as new file mode 100644 index 00000000000..10c6372e767 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_2_1_rt.as @@ -0,0 +1,69 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "11_2_2_1_n"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "The new operator"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + + var OBJECT = new Object(); + + try{ + var o = new OBJECT(); + }catch(e:Error){ + thisError = e.toString(); + }finally{ + array[item++] = new TestCase( SECTION, + "var m = new OBJECT()", + "TypeError: Error #1007", + typeError(thisError) ); + } + + /*array[item++] = new TestCase( SECTION, + "OBJECT = new Object; var o = new OBJECT()", + "error", + o = new OBJECT() );*/ + return array; +} + +function TestFunction() { + return arguments; +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_2_2_rt.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_2_2_rt.as new file mode 100644 index 00000000000..e18b4c1da7a --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_2_2_rt.as @@ -0,0 +1,69 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "e11_2_2_2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "The new operator"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + + var UNDEFINED = void 0; + try{ + var o = new UNDEFINED(); + }catch(e:Error){ + thisError = e.toString(); + }finally{ + array[item++] = new TestCase( SECTION, + "var o = new UNDEFINED()", + "TypeError: Error #1007", + typeError(thisError) ); + } + + + /*array[item++] = new TestCase( SECTION, + "UNDEFINED = void 0; var o = new UNDEFINED()", + "error", + o = new UNDEFINED() );*/ + return array; +} + +function TestFunction() { + return arguments; +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_2_3_rt.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_2_3_rt.as new file mode 100644 index 00000000000..5b84dda81bb --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_2_3_rt.as @@ -0,0 +1,68 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "11_2_2_3_n"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "The new operator"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var NULL = null; + + try{ + var o = new NULL(); + }catch(e:Error){ + thisError = e.toString(); + }finally{ + array[item++] = new TestCase( SECTION, + "var o = new NULL()", + "TypeError: Error #1007", + typeError(thisError) ); + } + + /*array[item++] = new TestCase( SECTION, + "NULL = null; var o = new NULL()", + "error", + o = new NULL() );*/ + return array; +} + +function TestFunction() { + return arguments; +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_2_4_rt.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_2_4_rt.as new file mode 100644 index 00000000000..4092d5da60f --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_2_4_rt.as @@ -0,0 +1,69 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "e11_2_2_4"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "The new operator"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + + var STRING = ""; + + try{ + var s = new STRING(); + }catch(e:Error){ + thisError = e.toString(); + }finally{ + array[item++] = new TestCase( SECTION, + "var s = new STRING()", + "TypeError: Error #1007", + typeError(thisError) ); + } + + /*array[item++] = new TestCase( SECTION, + "STRING = '', var s = new STRING()", + "error", + s = new STRING() );*/ + return array; +} + +function TestFunction() { + return arguments; +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_2_5_rt.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_2_5_rt.as new file mode 100644 index 00000000000..73a773f1216 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_2_5_rt.as @@ -0,0 +1,68 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "e11_2_2_5_n"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "The new operator"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test() + +function getTestCases() { + var array = new Array(); + var item = 0; + + var NUMBER = 0; + + try{ + var n = new NUMBER(); + }catch(e:Error){ + thisError = e.toString(); + }finally{ + array[item++] = new TestCase( SECTION, + "var n = new NUMBER()", + "TypeError: Error #1007", + typeError(thisError) ); + } + + /*array[item++] = new TestCase( SECTION, + "NUMBER=0, var n = new NUMBER()", + "error", + n = new NUMBER() );*/ + return array; +} + +function TestFunction() { + return arguments; +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_2_6_rt.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_2_6_rt.as new file mode 100644 index 00000000000..5613230dbd5 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_2_6_rt.as @@ -0,0 +1,67 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "e11_2_2_6_n"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "The new operator"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var BOOLEAN = true; + + try{ + var b = new BOOLEAN(); + }catch(e:Error){ + thisError = e.toString(); + }finally{ + array[item++] = new TestCase( SECTION, + "var b = new BOOLEAN()", + "TypeError: Error #1007", + typeError(thisError) ); + } + + /*array[item++] = new TestCase( SECTION, + "BOOLEAN = true; var b = new BOOLEAN()", + "error", + b = new BOOLEAN() );*/ + return array; +} + +function TestFunction() { + return arguments; +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_2_7_rt.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_2_7_rt.as new file mode 100644 index 00000000000..bc1e2766cfc --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_2_7_rt.as @@ -0,0 +1,68 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "e11_2_2_7_n"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "The new operator"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var STRING = new String("hi"); + try{ + var s = new STRING(); + }catch(e:Error){ + thisError = e.toString(); + }finally{ + array[item++] = new TestCase( SECTION, + "var s = new STRING()", + "TypeError: Error #1007", + typeError(thisError) ); + } + + + /* array[item++] = new TestCase( SECTION, + "var STRING = new String('hi'); var s = new STRING()", + "error", + s = new STRING() );*/ + return array; +} + +function TestFunction() { + return arguments; +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_2_8_rt.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_2_8_rt.as new file mode 100644 index 00000000000..61a25b97a21 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_2_8_rt.as @@ -0,0 +1,68 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "e11_2_2_8_n"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "The new operator"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var NUMBER = new Number(1); + + try{ + var n = new NUMBER(); + }catch(e:Error){ + thisError = e.toString(); + }finally{ + array[item++] = new TestCase( SECTION, + "var n = new NUMBER()", + "TypeError: Error #1007", + typeError(thisError) ); + } + + /*array[item++] = new TestCase( SECTION, + "var NUMBER = new Number(1); var n = new NUMBER()", + "error", + n = new NUMBER() );*/ + return array; +} + +function TestFunction() { + return arguments; +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_2_9_rt.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_2_9_rt.as new file mode 100644 index 00000000000..d847392770d --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_2_9_rt.as @@ -0,0 +1,67 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "e11_2_2_9_n"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "The new operator"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases():Array { + var array = new Array(); + var item = 0; + + var BOOLEAN = new Boolean(); + try{ + var b = new BOOLEAN(); + }catch(e:Error){ + thisError = e.toString(); + }finally{ + array[item++] = new TestCase( SECTION, + "var b = new BOOLEAN()", + "TypeError: Error #1007", + typeError(thisError) ); + } + + /*array[item++] = new TestCase( SECTION, + "var BOOLEAN = new Boolean(); var b = new BOOLEAN()", + "error", + b = new BOOLEAN() );*/ + return array; +} + +function TestFunction() { + return arguments; +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_3_1.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_3_1.as new file mode 100644 index 00000000000..e9aa52fcf58 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_3_1.as @@ -0,0 +1,74 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "e11_2_3_1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Function Calls"; + + writeHeaderToLog( SECTION + " "+ TITLE); + var testcases = getTestCases(); + + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // MemberExpression: Identifier + + var OBJECT = true; + + array[item++] = new TestCase( SECTION, + "OBJECT.toString()", + "true", + OBJECT.toString() ); + + // MemberExpression[ Expression] + + array[item++] = new TestCase( SECTION, + "(new Array())['length'].valueOf()", + 0, + (new Array())["length"].valueOf() ); + + // MemberExpression . Identifier + array[item++] = new TestCase( SECTION, + "(new Array()).length.valueOf()", + 0, + (new Array()).length.valueOf() ); + // new MemberExpression Arguments + + array[item++] = new TestCase( SECTION, + "(new Array(20))['length'].valueOf()", + 20, + (new Array(20))["length"].valueOf() ); + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_3_3_rt.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_3_3_rt.as new file mode 100644 index 00000000000..684d95cfca3 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_3_3_rt.as @@ -0,0 +1,58 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "e11_2_3_3_n"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Function Calls"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + try{ + (void 0).valueOf(); + }catch(e:Error){ + thisError = e.toString(); + }finally{ + array[item++] = new TestCase( SECTION, + "(void 0).valueOf()", + "TypeError: Error #1010", + typeError(thisError) ); + } + return array; +} + diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_3_4_rt.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_3_4_rt.as new file mode 100644 index 00000000000..df16797d271 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_3_4_rt.as @@ -0,0 +1,58 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "e11_2_3_4_n"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Function Calls"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + try{ + null.valueOf(); + }catch(e:Error){ + thisError = e.toString(); + }finally{ + array[item++] = new TestCase( SECTION, + "null.valueOf()", + "TypeError: Error #1009", + typeError(thisError) ); + } + return array; +} + diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_3_5.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_3_5.as new file mode 100644 index 00000000000..b83f52b3422 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_3_5.as @@ -0,0 +1,50 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "e11_2_3_5_n"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Function Calls"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "true.valueOf()", true, true.valueOf() ); + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_4.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_4.as new file mode 100644 index 00000000000..067aaf520c6 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_2_4.as @@ -0,0 +1,252 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "11_2_4"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Argument List"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + + test(); + + class MyClass{} +function getTestCases() { + var array = new Array(); + var item = 0; + + //Empty argument list + + var arr = new Array(); + + array[item++] = new TestCase( SECTION, + "arr.length", + 0, + arr.length ); + + trace(arr); + + array[item++] = new TestCase( SECTION, + "Returning empty list of value of arr", + '', + arr.toString() ); + + + function MyFunction():String{ + return "Hi!"; + } + + + array[item++] = new TestCase( SECTION, + "MyFunction", + "Hi!", + MyFunction() ); + + + + //Argument list with more arguments + + var arr1 = new Array(1,2,3,4,5); + + array[item++] = new TestCase( SECTION, + "arr1.length", + 5, + arr1.length ); + + function MyFunction2(a,b,c,d,e):Number{ + return a+b+c+d+e; + } + + array[item++] = new TestCase( SECTION, + "MyFunction2 with 5 arguments", + 15, + MyFunction2(1,2,3,4,5)); + var myvar1:Number = 1; + var myvar2:Number =10; + function foo():Number{ + myvar1 = myvar1+myvar2; + return myvar1; + } + + function goo():Number{ + myvar2 = myvar2*10; + return myvar2; + } + + function MyFunction3(d,e,f):Number{ + return f; + } + + array[item++] = new TestCase( SECTION, + "MyFunction3 with 3 arguments", + 111, + MyFunction3(foo(),goo(),myvar1+myvar2)); + + var arr2 = new Array(foo(),goo(),myvar1+myvar2); + + array[item++] = new TestCase( SECTION, + "arr2.length", + 3, + arr2.length ); + + array[item++] = new TestCase( SECTION, + "arr2[0]", + 111, + arr2[0] ); + + array[item++] = new TestCase( SECTION, + "arr2[1]", + 1000, + arr2[1] ); + + array[item++] = new TestCase( SECTION, + "arr2[2]", + 1111, + arr2[2] ); + + + var myclass = new MyClass(); + + function MyFunction4(a,b,c,d,e,f):void{} + + array[item++] = new TestCase( SECTION, + "MyFunction3 with 3 arguments", + 11111, + MyFunction3(foo(),goo(),myvar1+myvar2)); + + var arr3 = new Array(1,"string",foo(),[1,2,3],true,new Date(0)); + + array[item++] = new TestCase( SECTION, + "arr3.length", + 6, + arr3.length ); + + array[item++] = new TestCase( SECTION, + "arr3[0]", + 1, + arr3[0] ); + + array[item++] = new TestCase( SECTION, + "arr3[1]", + "string", + arr3[1] ); + + array[item++] = new TestCase( SECTION, + "arr3[2]", + 11111, + arr3[2] ); + + array[item++] = new TestCase( SECTION, + "arr3[3]", + "1,2,3", + arr3[3]+"" ); + + + + array[item++] = new TestCase( SECTION, + "arr3[4]", + true, + arr3[4]); + + + array[item++] = new TestCase( SECTION, + "arr3[5]", + "Wed Dec 31 16:00:00 GMT-0800 1969", + arr3[5]+""); + + var k:Number; + var l:String; + var m:Array; + var p:Number; + var n:Boolean; + var o:Date; + var q:String; + var r:Number; + + function MyFunction4(a,b,c,d,e,f,g,h):String{ + k=a; + l=b; + m=c; + n=e; + o=f; + p=d; + q=g; + r=h; + return "passed"; + } + + array[item++] = new TestCase( SECTION, + "Function with arguments of different data types", + "passed", + MyFunction4(1,"string",[2,3,4],goo(),false,new Date(0),null,void)); + + array[item++] = new TestCase( SECTION, + "Function with arguments of different data types", + 1, + k); + + array[item++] = new TestCase( SECTION, + "Function with arguments of different data types", + 1, + k); + array[item++] = new TestCase( SECTION, + "Function with arguments of different data types", + 100000, + p); + + array[item++] = new TestCase( SECTION, + "Function with arguments of different data types", + false, + n); + + array[item++] = new TestCase( SECTION, + "Function with arguments of different data types", + "Wed Dec 31 16:00:00 GMT-0800 1969", + o+""); + + array[item++] = new TestCase( SECTION, + "Function with arguments of different data types", + null, + q); + + array[item++] = new TestCase( SECTION, + "Function with arguments of different data types", + NaN, + r); + return array; +} + + +function TestFunction() { + return arguments; +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_3_1.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_3_1.as new file mode 100644 index 00000000000..1bb0b888269 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_3_1.as @@ -0,0 +1,176 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "11_3_1"; + var VERSION = "ECMA_1"; + startTest(); + + writeHeaderToLog( SECTION + " Postfix increment operator"); + + testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // special numbers + var MYVAR; + array[item++] = new TestCase( SECTION, "var MYVAR; MYVAR++", NaN, MYVAR++ ); + var MYVAR=void 0; + array[item++] = new TestCase( SECTION, "var MYVAR= void 0; MYVAR++", NaN, MYVAR++ ); + var MYVAR=null; + array[item++] = new TestCase( SECTION, "var MYVAR=null; MYVAR++", 0, MYVAR++ ); + var MYVAR=true; + array[item++] = new TestCase( SECTION, "var MYVAR=true; MYVAR++", 1, MYVAR++ ); + var MYVAR=false; + array[item++] = new TestCase( SECTION, "var MYVAR=false; MYVAR++", 0, MYVAR++ ); + + // verify return value + var MYVAR=Number.POSITIVE_INFINITY; + array[item++] = new TestCase( SECTION, "var MYVAR=Number.POSITIVE_INFINITY;MYVAR++", Number.POSITIVE_INFINITY, MYVAR++ ); + var MYVAR=Number.NEGATIVE_INFINITY; + array[item++] = new TestCase( SECTION, "var MYVAR=Number.NEGATIVE_INFINITY;MYVAR++", Number.NEGATIVE_INFINITY, MYVAR++ ); + var MYVAR=Number.NaN; + array[item++] = new TestCase( SECTION, "var MYVAR=Number.NaN;MYVAR++", Number.NaN, MYVAR++ ); + + // verify value of variable + var MYVAR=Number.POSITIVE_INFINITY;MYVAR++; + array[item++] = new TestCase( SECTION, "var MYVAR=Number.POSITIVE_INFINITY;MYVAR++;MYVAR", Number.POSITIVE_INFINITY, MYVAR ); + var MYVAR=Number.NEGATIVE_INFINITY;MYVAR++; + array[item++] = new TestCase( SECTION, "var MYVAR=Number.NEGATIVE_INFINITY;MYVAR++;MYVAR", Number.NEGATIVE_INFINITY, MYVAR ); + var MYVAR=Number.NaN;MYVAR++; + array[item++] = new TestCase( SECTION, "var MYVAR=Number.NaN;MYVAR++;MYVAR", Number.NaN, MYVAR ); + + // number primitives + var MYVAR=0; + array[item++] = new TestCase( SECTION, "var MYVAR=0;MYVAR++", 0, MYVAR++ ); + var MYVAR=0.2345; + array[item++] = new TestCase( SECTION, "var MYVAR=0.2345;MYVAR++", 0.2345, MYVAR++ ); + var MYVAR=-0.2345; + array[item++] = new TestCase( SECTION, "var MYVAR=-0.2345;MYVAR++", -0.2345, MYVAR++ ); + + // verify value of variable + var MYVAR=0;MYVAR++; + array[item++] = new TestCase( SECTION, "var MYVAR=0;MYVAR++;MYVAR", 1, MYVAR ); + var MYVAR=0.2345;MYVAR++; + array[item++] = new TestCase( SECTION, "var MYVAR=0.2345;MYVAR++;MYVAR", 1.2345, MYVAR ); + var MYVAR=-0.2345;MYVAR++; + array[item++] = new TestCase( SECTION, "var MYVAR=-0.2345;MYVAR++;MYVAR", 0.7655000000000001, MYVAR ); + var MYVAR=0;MYVAR++; + array[item++] = new TestCase( SECTION, "var MYVAR=0;MYVAR++;MYVAR", 1, MYVAR ); + var MYVAR=0;MYVAR++; + array[item++] = new TestCase( SECTION, "var MYVAR=0;MYVAR++;MYVAR", 1, MYVAR ); + var MYVAR=0;MYVAR++; + array[item++] = new TestCase( SECTION, "var MYVAR=0;MYVAR++;MYVAR", 1, MYVAR ); + + // boolean values + // verify return value + var MYVAR=true; + array[item++] = new TestCase( SECTION, "var MYVAR=true;MYVAR++", 1, MYVAR++ ); + var MYVAR=false; + array[item++] = new TestCase( SECTION, "var MYVAR=false;MYVAR++", 0, MYVAR++ ); + // verify value of variable + var MYVAR=true;MYVAR++; + array[item++] = new TestCase( SECTION, "var MYVAR=true;MYVAR++;MYVAR", 2, MYVAR ); + var MYVAR=false;MYVAR++; + array[item++] = new TestCase( SECTION, "var MYVAR=false;MYVAR++;MYVAR", 1, MYVAR ); + + // boolean objects + // verify return value + var MYVAR=true; + array[item++] = new TestCase( SECTION, "var MYVAR=new Boolean(true);MYVAR++", 1, MYVAR++ ); + var MYVAR=false; + array[item++] = new TestCase( SECTION, "var MYVAR=new Boolean(false);MYVAR++", 0, MYVAR++ ); + // verify value of variable + var MYVAR=new Boolean(true);MYVAR++; + array[item++] = new TestCase( SECTION, "var MYVAR=new Boolean(true);MYVAR++;MYVAR", 2, MYVAR ); + var MYVAR=new Boolean(false);MYVAR++; + array[item++] = new TestCase( SECTION, "var MYVAR=new Boolean(false);MYVAR++;MYVAR", 1, MYVAR ); + + // string primitives + + var MYVAR = 'string'; + array[item++] = new TestCase( SECTION, "var MYVAR='string'; MYVAR++", Number.NaN, MYVAR++ ); + var MYVAR = '12345'; + array[item++] = new TestCase( SECTION, "var MYVAR='12345';MYVAR++", 12345, MYVAR++ ); + var MYVAR='-12345'; + array[item++] = new TestCase( SECTION, "var MYVAR='-12345';MYVAR++", -12345, MYVAR++ ); + var MYVAR='0Xf'; + array[item++] = new TestCase( SECTION, "var MYVAR='0Xf';MYVAR++", 15, MYVAR++ ); + var MYVAR='077'; + array[item++] = new TestCase( SECTION, "var MYVAR='077';MYVAR++", 77, MYVAR++ ); + var MYVAR=''; + array[item++] = new TestCase( SECTION, "var MYVAR=''; MYVAR++", 0, MYVAR++ ); + + // verify value of variable + var MYVAR='string';MYVAR++; + array[item++] = new TestCase( SECTION, "var MYVAR='string';MYVAR++;MYVAR", Number.NaN, MYVAR ); + var MYVAR='12345';MYVAR++; + array[item++] = new TestCase( SECTION, "var MYVAR='12345';MYVAR++;MYVAR", 12346, MYVAR ); + var MYVAR='-12345';MYVAR++; + array[item++] = new TestCase( SECTION, "var MYVAR='-12345';MYVAR++;MYVAR", -12344, MYVAR ); + var MYVAR='0xf';MYVAR++; + array[item++] = new TestCase( SECTION, "var MYVAR='0xf';MYVAR++;MYVAR", 16, MYVAR ); + var MYVAR='077';MYVAR++; + array[item++] = new TestCase( SECTION, "var MYVAR='077';MYVAR++;MYVAR", 78, MYVAR ); + var MYVAR='';MYVAR++; + array[item++] = new TestCase( SECTION, "var MYVAR='';MYVAR++;MYVAR", 1, MYVAR ); + + // string objects + var MYVAR=new String('string'); + array[item++] = new TestCase( SECTION, "var MYVAR=new String('string');MYVAR++", Number.NaN, MYVAR++ ); + var MYVAR=new String('12345'); + array[item++] = new TestCase( SECTION, "var MYVAR=new String('12345');MYVAR++", 12345, MYVAR++ ); + var MYVAR=new String('-12345'); + array[item++] = new TestCase( SECTION, "var MYVAR=new String('-12345');MYVAR++", -12345, MYVAR++ ); + var MYVAR=new String('0Xf'); + array[item++] = new TestCase( SECTION, "var MYVAR=new String('0Xf');MYVAR++", 15, MYVAR++ ); + var MYVAR=new String('077'); + array[item++] = new TestCase( SECTION, "var MYVAR=new String('077');MYVAR++", 77, MYVAR++ ); + var MYVAR=new String(''); + array[item++] = new TestCase( SECTION, "var MYVAR=new String(''); MYVAR++", 0, MYVAR++ ); + + // verify value of variable + var MYVAR=new String('string');MYVAR++; + array[item++] = new TestCase( SECTION, "var MYVAR=new String('string');MYVAR++;MYVAR", Number.NaN, MYVAR ); + var MYVAR=new String('12345');MYVAR++; + array[item++] = new TestCase( SECTION, "var MYVAR=new String('12345');MYVAR++;MYVAR", 12346, MYVAR ); + var MYVAR=new String('-12345');MYVAR++; + array[item++] = new TestCase( SECTION, "var MYVAR=new String('-12345');MYVAR++;MYVAR", -12344, MYVAR ); + var MYVAR=new String('0xf');MYVAR++; + array[item++] = new TestCase( SECTION, "var MYVAR=new String('0xf');MYVAR++;MYVAR", 16, MYVAR ); + var MYVAR=new String('077');MYVAR++; + array[item++] = new TestCase( SECTION, "var MYVAR=new String('077');MYVAR++;MYVAR", 78, MYVAR ); + var MYVAR=new String('');MYVAR++; + array[item++] = new TestCase( SECTION, "var MYVAR=new String('');MYVAR++;MYVAR", 1, MYVAR ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_3_2.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_3_2.as new file mode 100644 index 00000000000..ce8bb7ae39c --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_3_2.as @@ -0,0 +1,202 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "e11_3_2"; + var VERSION = "ECMA_1"; + startTest(); + var testcases = getTestCases(); + + writeHeaderToLog( SECTION + " Postfix decrement operator"); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // special numbers + var MYVAR; + array[item++] = new TestCase( SECTION, "var MYVAR; MYVAR--", NaN, MYVAR-- ); + var MYVAR = void 0; + array[item++] = new TestCase( SECTION, "var MYVAR= void 0; MYVAR--", NaN, MYVAR-- ); + var MYVAR=null; + array[item++] = new TestCase( SECTION, "var MYVAR=null; MYVAR--", 0, MYVAR-- ); + var MYVAR=true; + array[item++] = new TestCase( SECTION, "var MYVAR=true; MYVAR--", 1, MYVAR-- ); + var MYVAR=false; + array[item++] = new TestCase( SECTION, "var MYVAR=false; MYVAR--", 0, MYVAR-- ); + + // verify return value + var MYVAR=Number.POSITIVE_INFINITY; + array[item++] = new TestCase( SECTION, "var MYVAR=Number.POSITIVE_INFINITY; MYVAR--", Number.POSITIVE_INFINITY, MYVAR-- ); + var MYVAR=Number.NEGATIVE_INFINITY; + array[item++] = new TestCase( SECTION, "var MYVAR=Number.NEGATIVE_INFINITY;MYVAR--", Number.NEGATIVE_INFINITY, MYVAR-- ); + var MYVAR=Number.NaN; + array[item++] = new TestCase( SECTION, "var MYVAR=Number.NaN;MYVAR--", Number.NaN, MYVAR-- ); + + // verify value of variable + var MYVAR=Number.POSITIVE_INFINITY; + MYVAR--; + array[item++] = new TestCase( SECTION, "var MYVAR=Number.POSITIVE_INFINITY;MYVAR--;MYVAR", Number.POSITIVE_INFINITY, MYVAR ); + + var MYVAR=Number.NEGATIVE_INFINITY; + MYVAR--; + array[item++] = new TestCase( SECTION, "var MYVAR=Number.NEGATIVE_INFINITY;MYVAR--;MYVAR", Number.NEGATIVE_INFINITY, MYVAR ); + + var MYVAR=Number.NaN; + MYVAR--; + array[item++] = new TestCase( SECTION, "var MYVAR=Number.NaN;MYVAR--;MYVAR", Number.NaN, MYVAR ); + + // number primitives + var MYVAR = 0; + array[item++] = new TestCase( SECTION, "var MYVAR=0;MYVAR--", 0, MYVAR-- ); + var MYVAR = 0.2345; + array[item++] = new TestCase( SECTION, "var MYVAR=0.2345;MYVAR--", 0.2345, MYVAR-- ); + var MYVAR = -0.2345; + array[item++] = new TestCase( SECTION, "var MYVAR=-0.2345;MYVAR--", -0.2345, MYVAR-- ); + + // verify value of variable + var MYVAR=0; + MYVAR--; + array[item++] = new TestCase( SECTION, "var MYVAR=0;MYVAR--;MYVAR", -1, MYVAR ); + + var MYVAR=0.2345; + MYVAR--; + array[item++] = new TestCase( SECTION, "var MYVAR=0.2345;MYVAR--;MYVAR", -0.7655000000000001, MYVAR ); + + var MYVAR=-0.2345; + MYVAR--; + array[item++] = new TestCase( SECTION, "var MYVAR=-0.2345;MYVAR--;MYVAR", -1.2345, MYVAR ); + + var MYVAR=0; + MYVAR--; + array[item++] = new TestCase( SECTION, "var MYVAR=0;MYVAR--;MYVAR", -1, MYVAR ); + + var MYVAR=0; + MYVAR--; + array[item++] = new TestCase( SECTION, "var MYVAR=0;MYVAR--;MYVAR", -1, MYVAR ); + + var MYVAR=0; + MYVAR--; + array[item++] = new TestCase( SECTION, "var MYVAR=0;MYVAR--;MYVAR", -1, MYVAR ); + + // boolean values + // verify return value + var MYVAR=true; + array[item++] = new TestCase( SECTION, "var MYVAR=true;MYVAR--", 1, MYVAR-- ); + var MYVAR=false; + array[item++] = new TestCase( SECTION, "var MYVAR=false;MYVAR--", 0, MYVAR-- ); + // verify value of variable + + var MYVAR=true; + MYVAR--; + array[item++] = new TestCase( SECTION, "var MYVAR=true;MYVAR--;MYVAR", 0, MYVAR ); + var MYVAR=false; + MYVAR--; + array[item++] = new TestCase( SECTION, "var MYVAR=false;MYVAR--;MYVAR", -1, MYVAR ); + + // boolean objects + // verify return value + var MYVAR=new Boolean(true); + array[item++] = new TestCase( SECTION, "var MYVAR=new Boolean(true);MYVAR--", 1, MYVAR-- ); + var MYVAR=new Boolean(false); + array[item++] = new TestCase( SECTION, "var MYVAR=new Boolean(false);MYVAR--", 0, MYVAR-- ); + // verify value of variable + var MYVAR=new Boolean(true); + MYVAR--; + array[item++] = new TestCase( SECTION, "var MYVAR=new Boolean(true);MYVAR--;MYVAR", 0, MYVAR ); + var MYVAR=new Boolean(false); + MYVAR--; + array[item++] = new TestCase( SECTION, "var MYVAR=new Boolean(false);MYVAR--;MYVAR", -1, MYVAR ); + + // string primitives + var MYVAR='string'; + array[item++] = new TestCase( SECTION, "var MYVAR='string';MYVAR--", Number.NaN, MYVAR-- ); + var MYVAR='12345'; + array[item++] = new TestCase( SECTION, "var MYVAR='12345';MYVAR--", 12345, MYVAR-- ); + var MYVAR='-12345'; + array[item++] = new TestCase( SECTION, "var MYVAR='-12345';MYVAR--", -12345, MYVAR-- ); + var MYVAR='0Xf'; + array[item++] = new TestCase( SECTION, "var MYVAR='0Xf';MYVAR--", 15, MYVAR-- ); + var MYVAR='077'; + array[item++] = new TestCase( SECTION, "var MYVAR='077';MYVAR--", 77, MYVAR-- ); + var MYVAR=''; + array[item++] = new TestCase( SECTION, "var MYVAR=''; MYVAR--", 0, MYVAR-- ); + + // verify value of variable + var MYVAR='string'; + MYVAR--; + array[item++] = new TestCase( SECTION, "var MYVAR='string';MYVAR--;MYVAR", Number.NaN, MYVAR ); + var MYVAR='12345'; + MYVAR--; + array[item++] = new TestCase( SECTION, "var MYVAR='12345';MYVAR--;MYVAR", 12344, MYVAR ); + var MYVAR='-12345'; + MYVAR--; + array[item++] = new TestCase( SECTION, "var MYVAR='-12345';MYVAR--;MYVAR", -12346, MYVAR ); + var MYVAR='0xf'; + MYVAR--; + array[item++] = new TestCase( SECTION, "var MYVAR='0xf';MYVAR--;MYVAR", 14, MYVAR ); + var MYVAR='077'; + MYVAR--; + array[item++] = new TestCase( SECTION, "var MYVAR='077';MYVAR--;MYVAR", 76, MYVAR ); + var MYVAR=''; + MYVAR--; + array[item++] = new TestCase( SECTION, "var MYVAR='';MYVAR--;MYVAR", -1, MYVAR ); + + // string objects + var MYVAR=new String('string'); + array[item++] = new TestCase( SECTION, "var MYVAR=new String('string');MYVAR--", Number.NaN, MYVAR-- ); + var MYVAR=new String('12345'); + array[item++] = new TestCase( SECTION, "var MYVAR=new String('12345');MYVAR--", 12345, MYVAR-- ); + + var MYVAR=new String('-12345'); + array[item++] = new TestCase( SECTION, "var MYVAR=new String('-12345');MYVAR--", -12345, MYVAR-- ); + var MYVAR=new String('0Xf'); + array[item++] = new TestCase( SECTION, "var MYVAR=new String('0Xf');MYVAR--", 15, MYVAR-- ); + var MYVAR=new String('077'); + array[item++] = new TestCase(SECTION, "var MYVAR=new String('077');MYVAR--", 77, MYVAR-- ); + var MYVAR=new String(''); + array[item++] = new TestCase( SECTION, "var MYVAR=new String(''); MYVAR--", 0, MYVAR-- ); + + // verify value of variable + var MYVAR=new String('string');MYVAR--; + array[item++] = new TestCase( SECTION, "var MYVAR=new String('string');MYVAR--;MYVAR", Number.NaN, MYVAR ); + var MYVAR=new String('12345');MYVAR--; + array[item++] = new TestCase( SECTION, "var MYVAR=new String('12345');MYVAR--;MYVAR", 12344, MYVAR ); + var MYVAR=new String('-12345');MYVAR--; + array[item++] = new TestCase( SECTION, "var MYVAR=new String('-12345');MYVAR--;MYVAR", -12346, MYVAR ); + var MYVAR=new String('0xf');MYVAR--; + array[item++] = new TestCase( SECTION, "var MYVAR=new String('0xf');MYVAR--;MYVAR", 14, MYVAR ); + var MYVAR=new String('077');MYVAR--; + array[item++] = new TestCase( SECTION, "var MYVAR=new String('077');MYVAR--;MYVAR", 76, MYVAR ); + var MYVAR=new String('');MYVAR--; + array[item++] = new TestCase( SECTION, "var MYVAR=new String('');MYVAR--;MYVAR", -1, MYVAR ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_4_1.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_4_1.as new file mode 100644 index 00000000000..f4ffad32656 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_4_1.as @@ -0,0 +1,95 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + var SECTION = "e11_4_1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "The delete operator"; + var obj = new Object(); + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + var x; + + x=[9,8,7]; delete x[2]; + var len = x.length; + array[item++] = new TestCase( SECTION, "x=[9,8,7];delete(x[2]);x.length", 3, len ); + var str = x.toString(); + array[item++] = new TestCase( SECTION, "x=[9,8,7];delete(x[2]);x.toString()", "9,8,", str ); + var obj = new Object(); + obj.name="Jeffrey"; + delete obj.name; + array[item++] = new TestCase( SECTION, "obj=new Object();delete obj.name;", undefined, obj.name); + // the object obj should be deletable but failed! + delete obj; + array[item++] = new TestCase( SECTION, "obj=new Object();delete obj;obj.toString()", "[object Object]", obj.toString()); + + //array[item++] = new TestCase( SECTION, "delete('string primitive')", true, delete("string primitive") ); + array[item++] = new TestCase( SECTION, "delete(new String( 'string object' ) )", true, delete(new String("string object")) ); + array[item++] = new TestCase( SECTION, "delete(new Number(12345))", true, delete(new Number(12345)) ); + array[item++] = new TestCase( SECTION, "delete(Math.PI)", false, delete(Math.PI) ); + //array[item++] = new TestCase( SECTION, "delete null ", true, delete null ); + //array[item++] = new TestCase( SECTION, "delete(void(0))", true, delete(void(0)) ); + + // variables declared with the var statement are not deletable + array[item++] = new TestCase( SECTION, "delete(x=new Date())", true, delete(x=new Date()) ); + var abc; + array[item++] = new TestCase( SECTION, "var abc; delete abc", false, delete abc ); + var OB = new MyObject(); + for ( p in OB ) { + array[item++] = new TestCase( SECTION, + "var OB = new MyObject(); for ( p in OB ) { delete OB[p] }", + true, delete OB[p] ); + //trace("after delete: p = "+p+", OB[p] = "+OB[p]); + } + delete OB; + array[item++] = new TestCase( SECTION, "var OB = new MyObject();delete OB; OB.toString()", "[object Object]", OB.toString()); + return ( array ); +} + +function MyObject() { + this.prop1 = true; + this.prop2 = false; + this.prop3 = null + this.prop4 = void 0; + this.prop5 = "hi"; + this.prop6 = 42; + this.prop7 = new Date(); + this.prop8 = Math.PI; +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_4_2.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_4_2.as new file mode 100644 index 00000000000..152278c0c51 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_4_2.as @@ -0,0 +1,86 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "e11_4_2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "The void operator"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "void(new String('string object'))", void 0, void(new String( 'string object' )) ); + array[item++] = new TestCase( SECTION, "void('string primitive')", void 0, void("string primitive") ); + array[item++] = new TestCase( SECTION, "void(Number.NaN)", void 0, void(Number.NaN) ); + array[item++] = new TestCase( SECTION, "void(Number.POSITIVE_INFINITY)", void 0, void(Number.POSITIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "void(1)", void 0, void(1) ); + array[item++] = new TestCase( SECTION, "void(0)", void 0, void(0) ); + array[item++] = new TestCase( SECTION, "void(-1)", void 0, void(-1) ); + array[item++] = new TestCase( SECTION, "void(Number.NEGATIVE_INFINITY)", void 0, void(Number.NEGATIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "void(Math.PI)", void 0, void(Math.PI) ); + array[item++] = new TestCase( SECTION, "void(true)", void 0, void(true) ); + array[item++] = new TestCase( SECTION, "void(false)", void 0, void(false) ); + array[item++] = new TestCase( SECTION, "void(null)", void 0, void(null) ); + array[item++] = new TestCase( SECTION, "void new String('string object')", void 0, void new String( 'string object' ) ); + array[item++] = new TestCase( SECTION, "void 'string primitive'", void 0, void "string primitive" ); + array[item++] = new TestCase( SECTION, "void Number.NaN", void 0, void Number.NaN ); + array[item++] = new TestCase( SECTION, "void Number.POSITIVE_INFINITY", void 0, void Number.POSITIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "void 1", void 0, void 1 ); + array[item++] = new TestCase( SECTION, "void 0", void 0, void 0 ); + array[item++] = new TestCase( SECTION, "void -1", void 0, void -1 ); + array[item++] = new TestCase( SECTION, "void Number.NEGATIVE_INFINITY", void 0, void Number.NEGATIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "void Math.PI", void 0, void Math.PI ); + array[item++] = new TestCase( SECTION, "void true", void 0, void true ); + array[item++] = new TestCase( SECTION, "void false", void 0, void false ); + array[item++] = new TestCase( SECTION, "void null", void 0, void null ); + +// array[item++] = new TestCase( SECTION, "void()", void 0, void() ); + + return ( array ); +} + +function test() { + for ( i = 0; i < testcases.length; i++ ) { + testcases[i].passed = writeTestCaseResult( + testcases[i].expect, + testcases[i].actual, + testcases[i].description +" = "+ testcases[i].actual ); + testcases[i].reason += ( testcases[i].passed ) ? "" : "wrong value " + } + stopTest(); + return ( testcases ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_4_3.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_4_3.as new file mode 100644 index 00000000000..80a35991988 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_4_3.as @@ -0,0 +1,155 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "e11_4_3"; + + var VERSION = "ECMA_1"; + startTest(); + + var TITLE = " The typeof operator"; + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "typeof(void(0))", "undefined", typeof(void(0)) ); + array[item++] = new TestCase( SECTION, "typeof(null)", "object", typeof(null) ); + array[item++] = new TestCase( SECTION, "typeof(true)", "boolean", typeof(true) ); + array[item++] = new TestCase( SECTION, "typeof(false)", "boolean", typeof(false) ); + array[item++] = new TestCase( SECTION, "typeof(new Boolean())", "boolean", typeof(new Boolean()) ); + array[item++] = new TestCase( SECTION, "typeof(new Boolean(true))", "boolean", typeof(new Boolean(true)) ); + array[item++] = new TestCase( SECTION, "typeof(Boolean())", "boolean", typeof(Boolean()) ); + array[item++] = new TestCase( SECTION, "typeof(Boolean(false))", "boolean", typeof(Boolean(false)) ); + array[item++] = new TestCase( SECTION, "typeof(Boolean(true))", "boolean", typeof(Boolean(true)) ); + array[item++] = new TestCase( SECTION, "typeof(NaN)", "number", typeof(Number.NaN) ); + array[item++] = new TestCase( SECTION, "typeof(Infinity)", "number", typeof(Number.POSITIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "typeof(-Infinity)", "number", typeof(Number.NEGATIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "typeof(Math.PI)", "number", typeof(Math.PI) ); + array[item++] = new TestCase( SECTION, "typeof(0)", "number", typeof(0) ); + array[item++] = new TestCase( SECTION, "typeof(1)", "number", typeof(1) ); + array[item++] = new TestCase( SECTION, "typeof(-1)", "number", typeof(-1) ); + array[item++] = new TestCase( SECTION, "typeof('0')", "string", typeof("0") ); + array[item++] = new TestCase( SECTION, "typeof(Number())", "number", typeof(Number()) ); + array[item++] = new TestCase( SECTION, "typeof(Number(0))", "number", typeof(Number(0)) ); + array[item++] = new TestCase( SECTION, "typeof(Number(1))", "number", typeof(Number(1)) ); + array[item++] = new TestCase( SECTION, "typeof(Nubmer(-1))", "number", typeof(Number(-1)) ); + array[item++] = new TestCase( SECTION, "typeof(new Number())", "number", typeof(new Number()) ); + array[item++] = new TestCase( SECTION, "typeof(new Number(0))", "number", typeof(new Number(0)) ); + array[item++] = new TestCase( SECTION, "typeof(new Number(1))", "number", typeof(new Number(1)) ); + + // Math does not implement [[Construct]] or [[Call]] so its type is object. + + array[item++] = new TestCase( SECTION, "typeof(Math)", "object", typeof(Math) ); + + array[item++] = new TestCase( SECTION, "typeof(Number.prototype.toString)", "function", typeof(Number.prototype.toString) ); + + array[item++] = new TestCase( SECTION, "typeof('a string')", "string", typeof("a string") ); + array[item++] = new TestCase( SECTION, "typeof('')", "string", typeof("") ); + array[item++] = new TestCase( SECTION, "typeof(new Date())", "object", typeof(new Date()) ); + array[item++] = new TestCase( SECTION, "typeof(new Array(1,2,3))", "object", typeof(new Array(1,2,3)) ); + array[item++] = new TestCase( SECTION, "typeof(new String('string object'))", "string", typeof(new String("string object")) ); + array[item++] = new TestCase( SECTION, "typeof(String('string primitive'))", "string", typeof(String("string primitive")) ); + array[item++] = new TestCase( SECTION, "typeof(['array', 'of', 'strings'])", "object", typeof(["array", "of", "strings"]) ); + array[item++] = new TestCase( SECTION, "typeof(new Function())", "function", typeof( new Function() ) ); + array[item++] = new TestCase( SECTION, "typeof(parseInt)", "function", typeof( parseInt ) ); + array[item++] = new TestCase( SECTION, "typeof(test)", "function", typeof( test ) ); + array[item++] = new TestCase( SECTION, "typeof(String.fromCharCode)", "function", typeof( String.fromCharCode ) ); + + var notype; + array[item++] = new TestCase( SECTION, "typeof var notype; ", "undefined", typeof notype ); + var hnumber = 0x464d34; + array[item++] = new TestCase( SECTION, "typeof hnumber = 0x464d34; ", "number", typeof hnumber ); + var obj:Object; + array[item++] = new TestCase( SECTION, "typeof var obj:Object; ", "object", typeof obj ); + obj = new Object(); + array[item++] = new TestCase( SECTION, "typeof obj = new Object()", "object", typeof obj ); + var dt:Date; + array[item++] = new TestCase( SECTION, "typeof var dt:Date; ", "object", typeof dt ); + dt = new Date(); + array[item++] = new TestCase( SECTION, "typeof dt = new Date()", "object", typeof dt ); + var localClass:LocalClass; + array[item++] = new TestCase( SECTION, "typeof localClass:LocalClass; ", "object", typeof localClass ); + localClass = new LocalClass(); + array[item++] = new TestCase( SECTION, "typeof localClass = new LocalClass(); ", "object", typeof localClass ); + array[item++] = new TestCase( SECTION, "typeof undefined", "undefined", typeof undefined ); + array[item++] = new TestCase( SECTION, "typeof void(0)", "undefined", typeof void(0) ); + array[item++] = new TestCase( SECTION, "typeof null", "object", typeof null ); + array[item++] = new TestCase( SECTION, "typeof true", "boolean", typeof true ); + array[item++] = new TestCase( SECTION, "typeof false", "boolean", typeof false ); + array[item++] = new TestCase( SECTION, "typeof new Boolean()", "boolean", typeof new Boolean() ); + array[item++] = new TestCase( SECTION, "typeof new Boolean(true)", "boolean", typeof new Boolean(true) ); + array[item++] = new TestCase( SECTION, "typeof Boolean()", "boolean", typeof Boolean() ); + array[item++] = new TestCase( SECTION, "typeof Boolean(false)", "boolean", typeof Boolean(false) ); + array[item++] = new TestCase( SECTION, "typeof Boolean(true)", "boolean", typeof Boolean(true) ); + array[item++] = new TestCase( SECTION, "typeof Number.NaN", "number", typeof Number.NaN ); + array[item++] = new TestCase( SECTION, "typeof Number.POSITIVE_INFINITY", "number", typeof Number.POSITIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "typeof Number.NEGATIVE_INFINITY", "number", typeof Number.NEGATIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "typeof Math.PI", "number", typeof Math.PI ); + array[item++] = new TestCase( SECTION, "typeof 0", "number", typeof 0 ); + array[item++] = new TestCase( SECTION, "typeof 1", "number", typeof 1 ); + array[item++] = new TestCase( SECTION, "typeof -1", "number", typeof -1 ); + array[item++] = new TestCase( SECTION, "typeof ''", "string", typeof '' ); + array[item++] = new TestCase( SECTION, "typeof '0'", "string", typeof '0' ); + array[item++] = new TestCase( SECTION, "typeof Number()", "number", typeof Number() ); + array[item++] = new TestCase( SECTION, "typeof Number(0)", "number", typeof Number(0) ); + array[item++] = new TestCase( SECTION, "typeof Number(1)", "number", typeof Number(1) ); + array[item++] = new TestCase( SECTION, "typeof Nubmer(-1)", "number", typeof Number(-1) ); + array[item++] = new TestCase( SECTION, "typeof new Number()", "number", typeof new Number() ); + array[item++] = new TestCase( SECTION, "typeof new Number(0)", "number", typeof new Number(0) ); + array[item++] = new TestCase( SECTION, "typeof new Number(1)", "number", typeof new Number(1) ); + array[item++] = new TestCase( SECTION, "typeof Math", "object", typeof Math ); + array[item++] = new TestCase( SECTION, "typeof Number.prototype.toString", "function", typeof Number.prototype.toString ); + array[item++] = new TestCase( SECTION, "typeof String(\"a string\")", "string", typeof String("a string") ); + array[item++] = new TestCase( SECTION, "typeof String(\"\")", "string", typeof String("") ); + array[item++] = new TestCase( SECTION, "typeof String(\" \")", "string", typeof String(" ") ); + array[item++] = new TestCase( SECTION, "typeof new Date()", "object", typeof new Date() ); + array[item++] = new TestCase( SECTION, "typeof new Array(1,2,3)", "object", typeof new Array(1,2,3) ); + array[item++] = new TestCase( SECTION, "typeof new String('string object')", "string", typeof new String("string object") ); + array[item++] = new TestCase( SECTION, "typeof String('string primitive')", "string", typeof String("string primitive") ); + array[item++] = new TestCase( SECTION, "typeof ['array', 'of', 'strings']", "object", typeof ["array", "of", "strings"] ); + array[item++] = new TestCase( SECTION, "typeof new Function()", "function", typeof new Function() ); + array[item++] = new TestCase( SECTION, "typeof parseInt", "function", typeof parseInt ); + array[item++] = new TestCase( SECTION, "typeof test", "function", typeof test ); + array[item++] = new TestCase( SECTION, "typeof String.fromCharCode", "function", typeof String.fromCharCode ); + + return array; +} + +class LocalClass { + function LocalClass() { + trace("Constructor of LocalClass"); + } +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_4_4.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_4_4.as new file mode 100644 index 00000000000..530cf94c560 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_4_4.as @@ -0,0 +1,176 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "e11_4_4"; + var VERSION = "ECMA_1"; + startTest(); + var testcases = getTestCases(); + + writeHeaderToLog( SECTION + " Prefix increment operator"); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // special case: var is not defined + var MYVAR; + array[item++] = new TestCase( SECTION, "var MYVAR; ++MYVAR", NaN, ++MYVAR ); + var MYVAR=void 0; + array[item++] = new TestCase( SECTION, "var MYVAR= void 0; ++MYVAR", NaN, ++MYVAR ); + var MYVAR=null; + array[item++] = new TestCase( SECTION, "var MYVAR=null; ++MYVAR", 1, ++MYVAR ); + var MYVAR=true; + array[item++] = new TestCase( SECTION, "var MYVAR=true; ++MYVAR", 2, ++MYVAR ); + var MYVAR=false; + array[item++] = new TestCase( SECTION, "var MYVAR=false; ++MYVAR", 1, ++MYVAR ); + + // special numbers + // verify return value + var MYVAR=Number.POSITIVE_INFINITY; + array[item++] = new TestCase( SECTION, "var MYVAR=Number.POSITIVE_INFINITY;++MYVAR", Number.POSITIVE_INFINITY, ++MYVAR ); + var MYVAR=Number.NEGATIVE_INFINITY; + array[item++] = new TestCase( SECTION, "var MYVAR=Number.NEGATIVE_INFINITY;++MYVAR", Number.NEGATIVE_INFINITY, ++MYVAR ); + var MYVAR=Number.NaN; + array[item++] = new TestCase( SECTION, "var MYVAR=Number.NaN;++MYVAR", Number.NaN, ++MYVAR ); + + // verify value of variable + var MYVAR=Number.POSITIVE_INFINITY;++MYVAR; + array[item++] = new TestCase( SECTION, "var MYVAR=Number.POSITIVE_INFINITY;++MYVAR;MYVAR", Number.POSITIVE_INFINITY, MYVAR ); + var MYVAR=Number.NEGATIVE_INFINITY;++MYVAR; + array[item++] = new TestCase( SECTION, "var MYVAR=Number.NEGATIVE_INFINITY;++MYVAR;MYVAR", Number.NEGATIVE_INFINITY, MYVAR ); + var MYVAR=Number.NaN;++MYVAR; + array[item++] = new TestCase( SECTION, "var MYVAR=Number.NaN;++MYVAR;MYVAR", Number.NaN, MYVAR ); + + + // number primitives + var MYVAR=0; + array[item++] = new TestCase( SECTION, "var MYVAR=0;++MYVAR", 1, ++MYVAR ); + var MYVAR=0.2345; + array[item++] = new TestCase( SECTION, "var MYVAR=0.2345;++MYVAR", 1.2345, ++MYVAR ); + var MYVAR=-0.2345; + array[item++] = new TestCase( SECTION, "var MYVAR=-0.2345;++MYVAR", 0.7655000000000001, ++MYVAR ); + + // verify value of variable + var MYVAR=0;++MYVAR; + array[item++] = new TestCase( SECTION, "var MYVAR=0;++MYVAR;MYVAR", 1, MYVAR ); + var MYVAR=0.2345;++MYVAR; + array[item++] = new TestCase( SECTION, "var MYVAR=0.2345;++MYVAR;MYVAR", 1.2345, MYVAR ); + var MYVAR=-0.2345;++MYVAR; + array[item++] = new TestCase( SECTION, "var MYVAR=-0.2345;++MYVAR;MYVAR", 0.7655000000000001, MYVAR ); + var MYVAR=0;++MYVAR; + array[item++] = new TestCase( SECTION, "var MYVAR=0;++MYVAR;MYVAR", 1, MYVAR ); + var MYVAR=0;++MYVAR; + array[item++] = new TestCase( SECTION, "var MYVAR=0;++MYVAR;MYVAR", 1, MYVAR ); + var MYVAR=0;++MYVAR; + array[item++] = new TestCase( SECTION, "var MYVAR=0;++MYVAR;MYVAR", 1, MYVAR ); + + // boolean values + // verify return value + var MYVAR=true; + array[item++] = new TestCase( SECTION, "var MYVAR=true;++MYVAR", 2, ++MYVAR ); + var MYVAR=false; + array[item++] = new TestCase( SECTION, "var MYVAR=false;++MYVAR", 1, ++MYVAR ); + // verify value of variable + var MYVAR=true;++MYVAR; + array[item++] = new TestCase( SECTION, "var MYVAR=true;++MYVAR;MYVAR", 2, MYVAR ); + var MYVAR=false;++MYVAR; + array[item++] = new TestCase( SECTION, "var MYVAR=false;++MYVAR;MYVAR", 1, MYVAR ); + + // boolean objects + // verify return value + var MYVAR=true; + array[item++] = new TestCase( SECTION, "var MYVAR=new Boolean(true);++MYVAR", 2, ++MYVAR ); + var MYVAR=false; + array[item++] = new TestCase( SECTION, "var MYVAR=new Boolean(false);++MYVAR", 1, ++MYVAR ); + // verify value of variable + var MYVAR=new Boolean(true);++MYVAR; + array[item++] = new TestCase( SECTION, "var MYVAR=new Boolean(true);++MYVAR;MYVAR", 2, MYVAR ); + var MYVAR=new Boolean(false);++MYVAR; + array[item++] = new TestCase( SECTION, "var MYVAR=new Boolean(false);++MYVAR;MYVAR", 1, MYVAR ); + + // string primitives + var MYVAR='string'; + array[item++] = new TestCase( SECTION, "var MYVAR='string';++MYVAR", Number.NaN, ++MYVAR ); + var MYVAR='12345'; + array[item++] = new TestCase( SECTION, "var MYVAR='12345';++MYVAR", 12346, ++MYVAR ); + var MYVAR='-12345'; + array[item++] = new TestCase( SECTION, "var MYVAR='-12345';++MYVAR", -12344, ++MYVAR ); + var MYVAR='0Xf'; + array[item++] = new TestCase( SECTION, "var MYVAR='0Xf';++MYVAR", 16, ++MYVAR ); + var MYVAR='077'; + array[item++] = new TestCase( SECTION, "var MYVAR='077';++MYVAR", 78, ++MYVAR ); + var MYVAR=''; + array[item++] = new TestCase( SECTION, "var MYVAR=''; ++MYVAR", 1, ++MYVAR ); + + // verify value of variable + var MYVAR='string';++MYVAR; + array[item++] = new TestCase( SECTION, "var MYVAR='string';++MYVAR;MYVAR", Number.NaN, MYVAR ); + var MYVAR='12345';++MYVAR; + array[item++] = new TestCase( SECTION, "var MYVAR='12345';++MYVAR;MYVAR", 12346, MYVAR ); + var MYVAR='-12345';++MYVAR; + array[item++] = new TestCase( SECTION, "var MYVAR='-12345';++MYVAR;MYVAR", -12344, MYVAR ); + var MYVAR='0xf';++MYVAR; + array[item++] = new TestCase( SECTION, "var MYVAR='0xf';++MYVAR;MYVAR", 16, MYVAR ); + var MYVAR='077';++MYVAR; + array[item++] = new TestCase( SECTION, "var MYVAR='077';++MYVAR;MYVAR", 78, MYVAR ); + var MYVAR='';++MYVAR; + array[item++] = new TestCase( SECTION, "var MYVAR='';++MYVAR;MYVAR", 1, MYVAR ); + + // string objects + var MYVAR=new String('string'); + array[item++] = new TestCase( SECTION, "var MYVAR=new String('string');++MYVAR", Number.NaN, ++MYVAR ); + var MYVAR=new String('12345'); + array[item++] = new TestCase( SECTION, "var MYVAR=new String('12345');++MYVAR", 12346, ++MYVAR ); + var MYVAR=new String('-12345'); + array[item++] = new TestCase( SECTION, "var MYVAR=new String('-12345');++MYVAR", -12344, ++MYVAR ); + var MYVAR=new String('0Xf'); + array[item++] = new TestCase( SECTION, "var MYVAR=new String('0Xf');++MYVAR", 16, ++MYVAR ); + var MYVAR=new String('077'); + array[item++] = new TestCase( SECTION, "var MYVAR=new String('077');++MYVAR", 78, ++MYVAR ); + var MYVAR=new String(''); + array[item++] = new TestCase( SECTION, "var MYVAR=new String(''); ++MYVAR", 1, ++MYVAR ); + + // verify value of variable + var MYVAR=new String('string');++MYVAR; + array[item++] = new TestCase( SECTION, "var MYVAR=new String('string');++MYVAR;MYVAR", Number.NaN, MYVAR ); + var MYVAR=new String('12345');++MYVAR; + array[item++] = new TestCase( SECTION, "var MYVAR=new String('12345');++MYVAR;MYVAR", 12346, MYVAR ); + var MYVAR=new String('-12345');++MYVAR; + array[item++] = new TestCase( SECTION, "var MYVAR=new String('-12345');++MYVAR;MYVAR", -12344, MYVAR ); + var MYVAR=new String('0xf');++MYVAR; + array[item++] = new TestCase( SECTION, "var MYVAR=new String('0xf');++MYVAR;MYVAR", 16, MYVAR ); + var MYVAR=new String('077');++MYVAR; + array[item++] = new TestCase( SECTION, "var MYVAR=new String('077');++MYVAR;MYVAR", 78, MYVAR ); + var MYVAR=new String('');++MYVAR; + array[item++] = new TestCase( SECTION, "var MYVAR=new String('');++MYVAR;MYVAR", 1, MYVAR ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_4_5.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_4_5.as new file mode 100644 index 00000000000..98c5a5d65cc --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_4_5.as @@ -0,0 +1,176 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "e11_4_5"; + var VERSION = "ECMA_1"; + startTest(); + var testcases = getTestCases(); + + writeHeaderToLog( SECTION + " Prefix decrement operator"); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // + var MYVAR; + array[item++] = new TestCase( SECTION, "var MYVAR; --MYVAR", NaN, --MYVAR ); + var MYVAR=void 0; + array[item++] = new TestCase( SECTION, "var MYVAR= void 0; --MYVAR", NaN, --MYVAR ); + var MYVAR=null; + array[item++] = new TestCase( SECTION, "var MYVAR=null; --MYVAR", -1, --MYVAR ); + var MYVAR=true; + array[item++] = new TestCase( SECTION, "var MYVAR=true; --MYVAR", 0, --MYVAR ); + var MYVAR=false; + array[item++] = new TestCase( SECTION, "var MYVAR=false; --MYVAR", -1, --MYVAR ); + + // special numbers + // verify return value + var MYVAR=Number.POSITIVE_INFINITY; + array[item++] = new TestCase( SECTION, "var MYVAR=Number.POSITIVE_INFINITY;--MYVAR", Number.POSITIVE_INFINITY, --MYVAR ); + var MYVAR=Number.NEGATIVE_INFINITY; + array[item++] = new TestCase( SECTION, "var MYVAR=Number.NEGATIVE_INFINITY;--MYVAR", Number.NEGATIVE_INFINITY, --MYVAR ); + var MYVAR=Number.NaN; + array[item++] = new TestCase( SECTION, "var MYVAR=Number.NaN;--MYVAR", Number.NaN, --MYVAR ); + + // verify value of variable + var MYVAR=Number.POSITIVE_INFINITY;--MYVAR; + array[item++] = new TestCase( SECTION, "var MYVAR=Number.POSITIVE_INFINITY;--MYVAR;MYVAR", Number.POSITIVE_INFINITY, MYVAR ); + var MYVAR=Number.NEGATIVE_INFINITY;--MYVAR; + array[item++] = new TestCase( SECTION, "var MYVAR=Number.NEGATIVE_INFINITY;--MYVAR;MYVAR", Number.NEGATIVE_INFINITY, MYVAR ); + var MYVAR=Number.NaN;--MYVAR; + array[item++] = new TestCase( SECTION, "var MYVAR=Number.NaN;--MYVAR;MYVAR", Number.NaN, MYVAR ); + + + // number primitives + var MYVAR=0; + array[item++] = new TestCase( SECTION, "var MYVAR=0;--MYVAR", -1, --MYVAR ); + var MYVAR=0.2345; + array[item++] = new TestCase( SECTION, "var MYVAR=0.2345;--MYVAR", -0.7655000000000001, --MYVAR ); + var MYVAR=-0.2345; + array[item++] = new TestCase( SECTION, "var MYVAR=-0.2345;--MYVAR", -1.2345, --MYVAR ); + + // verify value of variable + var MYVAR=0;--MYVAR; + array[item++] = new TestCase( SECTION, "var MYVAR=0;--MYVAR;MYVAR", -1, MYVAR ); + var MYVAR=0.2345;--MYVAR; + array[item++] = new TestCase( SECTION, "var MYVAR=0.2345;--MYVAR;MYVAR", -0.7655000000000001, MYVAR ); + var MYVAR=-0.2345;--MYVAR; + array[item++] = new TestCase( SECTION, "var MYVAR=-0.2345;--MYVAR;MYVAR", -1.2345, MYVAR ); + var MYVAR=0;--MYVAR; + array[item++] = new TestCase( SECTION, "var MYVAR=0;--MYVAR;MYVAR", -1, MYVAR ); + var MYVAR=0;--MYVAR; + array[item++] = new TestCase( SECTION, "var MYVAR=0;--MYVAR;MYVAR", -1, MYVAR ); + var MYVAR=0;--MYVAR; + array[item++] = new TestCase( SECTION, "var MYVAR=0;--MYVAR;MYVAR", -1, MYVAR ); + + // boolean values + // verify return value + var MYVAR=true; + array[item++] = new TestCase( SECTION, "var MYVAR=true;--MYVAR", 0, --MYVAR ); + var MYVAR=false; + array[item++] = new TestCase( SECTION, "var MYVAR=false;--MYVAR", -1, --MYVAR ); + // verify value of variable + var MYVAR=true;--MYVAR; + array[item++] = new TestCase( SECTION, "var MYVAR=true;--MYVAR;MYVAR", 0, MYVAR ); + var MYVAR=false;--MYVAR; + array[item++] = new TestCase( SECTION, "var MYVAR=false;--MYVAR;MYVAR", -1, MYVAR ); + + // boolean objects + // verify return value + var MYVAR=true; + array[item++] = new TestCase( SECTION, "var MYVAR=new Boolean(true);--MYVAR", 0, --MYVAR ); + var MYVAR=false; + array[item++] = new TestCase( SECTION, "var MYVAR=new Boolean(false);--MYVAR", -1, --MYVAR ); + // verify value of variable + var MYVAR=new Boolean(true);--MYVAR; + array[item++] = new TestCase( SECTION, "var MYVAR=new Boolean(true);--MYVAR;MYVAR", 0, MYVAR ); + var MYVAR=new Boolean(false);--MYVAR; + array[item++] = new TestCase( SECTION, "var MYVAR=new Boolean(false);--MYVAR;MYVAR", -1, MYVAR ); + + // string primitives + var MYVAR='string'; + array[item++] = new TestCase( SECTION, "var MYVAR='string';--MYVAR", Number.NaN, --MYVAR ); + var MYVAR='12345'; + array[item++] = new TestCase( SECTION, "var MYVAR='12345';--MYVAR", 12344, --MYVAR ); + var MYVAR='-12345'; + array[item++] = new TestCase( SECTION, "var MYVAR='-12345';--MYVAR", -12346, --MYVAR ); + var MYVAR='0Xf'; + array[item++] = new TestCase( SECTION, "var MYVAR='0Xf';--MYVAR", 14, --MYVAR ); + var MYVAR='077'; + array[item++] = new TestCase( SECTION, "var MYVAR='077';--MYVAR", 76, --MYVAR ); + var MYVAR=''; + array[item++] = new TestCase( SECTION, "var MYVAR=''; --MYVAR", -1, --MYVAR ); + + // verify value of variable + var MYVAR='string';--MYVAR; + array[item++] = new TestCase( SECTION, "var MYVAR='string';--MYVAR;MYVAR", Number.NaN, MYVAR ); + var MYVAR='12345';--MYVAR; + array[item++] = new TestCase( SECTION, "var MYVAR='12345';--MYVAR;MYVAR", 12344, MYVAR ); + var MYVAR='-12345';--MYVAR; + array[item++] = new TestCase( SECTION, "var MYVAR='-12345';--MYVAR;MYVAR", -12346, MYVAR ); + var MYVAR='0xf';--MYVAR; + array[item++] = new TestCase( SECTION, "var MYVAR='0xf';--MYVAR;MYVAR", 14, MYVAR ); + var MYVAR='077';--MYVAR; + array[item++] = new TestCase( SECTION, "var MYVAR='077';--MYVAR;MYVAR", 76, MYVAR ); + var MYVAR='';--MYVAR; + array[item++] = new TestCase( SECTION, "var MYVAR='';--MYVAR;MYVAR", -1, MYVAR ); + + // string objects + var MYVAR=new String('string'); + array[item++] = new TestCase( SECTION, "var MYVAR=new String('string');--MYVAR", Number.NaN, --MYVAR ); + var MYVAR=new String('12345'); + array[item++] = new TestCase( SECTION, "var MYVAR=new String('12345');--MYVAR", 12344, --MYVAR ); + var MYVAR=new String('-12345'); + array[item++] = new TestCase( SECTION, "var MYVAR=new String('-12345');--MYVAR", -12346, --MYVAR ); + var MYVAR=new String('0Xf'); + array[item++] = new TestCase( SECTION, "var MYVAR=new String('0Xf');--MYVAR", 14, --MYVAR ); + var MYVAR=new String('077'); + array[item++] = new TestCase( SECTION, "var MYVAR=new String('077');--MYVAR", 76, --MYVAR ); + var MYVAR=new String(''); + array[item++] = new TestCase( SECTION, "var MYVAR=new String(''); --MYVAR", -1, --MYVAR ); + + // verify value of variable + var MYVAR=new String('string');--MYVAR; + array[item++] = new TestCase( SECTION, "var MYVAR=new String('string');--MYVAR;MYVAR", Number.NaN, MYVAR ); + var MYVAR=new String('12345');--MYVAR; + array[item++] = new TestCase( SECTION, "var MYVAR=new String('12345');--MYVAR;MYVAR", 12344, MYVAR ); + var MYVAR=new String('-12345');--MYVAR; + array[item++] = new TestCase( SECTION, "var MYVAR=new String('-12345');--MYVAR;MYVAR", -12346, MYVAR ); + var MYVAR=new String('0xf');--MYVAR; + array[item++] = new TestCase( SECTION, "var MYVAR=new String('0xf');--MYVAR;MYVAR", 14, MYVAR ); + var MYVAR=new String('077');--MYVAR; + array[item++] = new TestCase( SECTION, "var MYVAR=new String('077');--MYVAR;MYVAR", 76, MYVAR ); + var MYVAR=new String('');--MYVAR; + array[item++] = new TestCase( SECTION, "var MYVAR=new String('');--MYVAR;MYVAR", -1, MYVAR ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_4_6.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_4_6.as new file mode 100644 index 00000000000..f339bc996e7 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_4_6.as @@ -0,0 +1,289 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "e11_4_6"; + var VERSION = "ECMA_1"; + startTest(); + var testcases = getTestCases(); + var BUGNUMBER="77391"; + + writeHeaderToLog( SECTION + " Unary + operator"); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, "+('a string')", Number.NaN, +("a string") ); + array[item++] = new TestCase( SECTION, "+('')", 0, +("") ); + array[item++] = new TestCase( SECTION, "+(' ')", 0, +(" ") ); + array[item++] = new TestCase( SECTION, "+(\\t)", 0, +("\t") ); + array[item++] = new TestCase( SECTION, "+(\\n)", 0, +("\n") ); + array[item++] = new TestCase( SECTION, "+(\\r)", 0, +("\r") ); + array[item++] = new TestCase( SECTION, "+(\\f)", 0, +("\f") ); + + array[item++] = new TestCase( SECTION, "+(String.fromCharCode(0x0009)", 0, +(String.fromCharCode(0x0009)) ); + array[item++] = new TestCase( SECTION, "+(String.fromCharCode(0x0020)", 0, +(String.fromCharCode(0x0020)) ); + array[item++] = new TestCase( SECTION, "+(String.fromCharCode(0x000C)", 0, +(String.fromCharCode(0x000C)) ); + array[item++] = new TestCase( SECTION, "+(String.fromCharCode(0x000B)", 0, +(String.fromCharCode(0x000B)) ); + array[item++] = new TestCase( SECTION, "+(String.fromCharCode(0x000D)", 0, +(String.fromCharCode(0x000D)) ); + array[item++] = new TestCase( SECTION, "+(String.fromCharCode(0x000A)", 0, +(String.fromCharCode(0x000A)) ); + + // a StringNumericLiteral may be preceeded or followed by whitespace and/or + // line terminators + + array[item++] = new TestCase( SECTION, "+( ' ' + 999 )", 999, +( ' '+999) ); + array[item++] = new TestCase( SECTION, "+( '\\n' + 999 )", 999, +( '\n' +999) ); + array[item++] = new TestCase( SECTION, "+( '\\r' + 999 )", 999, +( '\r' +999) ); + array[item++] = new TestCase( SECTION, "+( '\\t' + 999 )", 999, +( '\t' +999) ); + array[item++] = new TestCase( SECTION, "+( '\\f' + 999 )", 999, +( '\f' +999) ); + + array[item++] = new TestCase( SECTION, "+( 999 + ' ' )", 999, +( 999+' ') ); + array[item++] = new TestCase( SECTION, "+( 999 + '\\n' )", 999, +( 999+'\n' ) ); + array[item++] = new TestCase( SECTION, "+( 999 + '\\r' )", 999, +( 999+'\r' ) ); + array[item++] = new TestCase( SECTION, "+( 999 + '\\t' )", 999, +( 999+'\t' ) ); + array[item++] = new TestCase( SECTION, "+( 999 + '\\f' )", 999, +( 999+'\f' ) ); + + array[item++] = new TestCase( SECTION, "+( '\\n' + 999 + '\\n' )", 999, +( '\n' +999+'\n' ) ); + array[item++] = new TestCase( SECTION, "+( '\\r' + 999 + '\\r' )", 999, +( '\r' +999+'\r' ) ); + array[item++] = new TestCase( SECTION, "+( '\\t' + 999 + '\\t' )", 999, +( '\t' +999+'\t' ) ); + array[item++] = new TestCase( SECTION, "+( '\\f' + 999 + '\\f' )", 999, +( '\f' +999+'\f' ) ); + + array[item++] = new TestCase( SECTION, "+( ' ' + '999' )", 999, +( ' '+'999') ); + array[item++] = new TestCase( SECTION, "+( '\\n' + '999' )", 999, +( '\n' +'999') ); + array[item++] = new TestCase( SECTION, "+( '\\r' + '999' )", 999, +( '\r' +'999') ); + array[item++] = new TestCase( SECTION, "+( '\\t' + '999' )", 999, +( '\t' +'999') ); + array[item++] = new TestCase( SECTION, "+( '\\f' + '999' )", 999, +( '\f' +'999') ); + + array[item++] = new TestCase( SECTION, "+( '999' + ' ' )", 999, +( '999'+' ') ); + array[item++] = new TestCase( SECTION, "+( '999' + '\\n' )", 999, +( '999'+'\n' ) ); + array[item++] = new TestCase( SECTION, "+( '999' + '\\r' )", 999, +( '999'+'\r' ) ); + array[item++] = new TestCase( SECTION, "+( '999' + '\\t' )", 999, +( '999'+'\t' ) ); + array[item++] = new TestCase( SECTION, "+( '999' + '\\f' )", 999, +( '999'+'\f' ) ); + + array[item++] = new TestCase( SECTION, "+( '\\n' + '999' + '\\n' )", 999, +( '\n' +'999'+'\n' ) ); + array[item++] = new TestCase( SECTION, "+( '\\r' + '999' + '\\r' )", 999, +( '\r' +'999'+'\r' ) ); + array[item++] = new TestCase( SECTION, "+( '\\t' + '999' + '\\t' )", 999, +( '\t' +'999'+'\t' ) ); + array[item++] = new TestCase( SECTION, "+( '\\f' + '999' + '\\f' )", 999, +( '\f' +'999'+'\f' ) ); + + array[item++] = new TestCase( SECTION, "+( String.fromCharCode(0x0009) + '99' )", 99, +( String.fromCharCode(0x0009) + '99' ) ); + array[item++] = new TestCase( SECTION, "+( String.fromCharCode(0x0020) + '99' )", 99, +( String.fromCharCode(0x0020) + '99' ) ); + array[item++] = new TestCase( SECTION, "+( String.fromCharCode(0x000C) + '99' )", 99, +( String.fromCharCode(0x000C) + '99' ) ); + array[item++] = new TestCase( SECTION, "+( String.fromCharCode(0x000B) + '99' )", 99, +( String.fromCharCode(0x000B) + '99' ) ); + array[item++] = new TestCase( SECTION, "+( String.fromCharCode(0x000D) + '99' )", 99, +( String.fromCharCode(0x000D) + '99' ) ); + array[item++] = new TestCase( SECTION, "+( String.fromCharCode(0x000A) + '99' )", 99, +( String.fromCharCode(0x000A) + '99' ) ); + + array[item++] = new TestCase( SECTION, "+( String.fromCharCode(0x0009) + '99' + String.fromCharCode(0x0009)", 99, +( String.fromCharCode(0x0009) + '99' + String.fromCharCode(0x0009)) ); + array[item++] = new TestCase( SECTION, "+( String.fromCharCode(0x0020) + '99' + String.fromCharCode(0x0020)", 99, +( String.fromCharCode(0x0009) + '99' + String.fromCharCode(0x0020)) ); + array[item++] = new TestCase( SECTION, "+( String.fromCharCode(0x000C) + '99' + String.fromCharCode(0x000C)", 99, +( String.fromCharCode(0x0009) + '99' + String.fromCharCode(0x000C)) ); + array[item++] = new TestCase( SECTION, "+( String.fromCharCode(0x000D) + '99' + String.fromCharCode(0x000D)", 99, +( String.fromCharCode(0x0009) + '99' + String.fromCharCode(0x000D)) ); + array[item++] = new TestCase( SECTION, "+( String.fromCharCode(0x000B) + '99' + String.fromCharCode(0x000B)", 99, +( String.fromCharCode(0x0009) + '99' + String.fromCharCode(0x000B)) ); + array[item++] = new TestCase( SECTION, "+( String.fromCharCode(0x000A) + '99' + String.fromCharCode(0x000A)", 99, +( String.fromCharCode(0x0009) + '99' + String.fromCharCode(0x000A)) ); + + array[item++] = new TestCase( SECTION, "+( '99' + String.fromCharCode(0x0009)", 99, +( '99' + String.fromCharCode(0x0009)) ); + array[item++] = new TestCase( SECTION, "+( '99' + String.fromCharCode(0x0020)", 99, +( '99' + String.fromCharCode(0x0020)) ); + array[item++] = new TestCase( SECTION, "+( '99' + String.fromCharCode(0x000C)", 99, +( '99' + String.fromCharCode(0x000C)) ); + array[item++] = new TestCase( SECTION, "+( '99' + String.fromCharCode(0x000D)", 99, +( '99' + String.fromCharCode(0x000D)) ); + array[item++] = new TestCase( SECTION, "+( '99' + String.fromCharCode(0x000B)", 99, +( '99' + String.fromCharCode(0x000B)) ); + array[item++] = new TestCase( SECTION, "+( '99' + String.fromCharCode(0x000A)", 99, +( '99' + String.fromCharCode(0x000A)) ); + + array[item++] = new TestCase( SECTION, "+( String.fromCharCode(0x0009) + 99 )", 99, +( String.fromCharCode(0x0009) + 99 ) ); + array[item++] = new TestCase( SECTION, "+( String.fromCharCode(0x0020) + 99 )", 99, +( String.fromCharCode(0x0020) + 99 ) ); + array[item++] = new TestCase( SECTION, "+( String.fromCharCode(0x000C) + 99 )", 99, +( String.fromCharCode(0x000C) + 99 ) ); + array[item++] = new TestCase( SECTION, "+( String.fromCharCode(0x000B) + 99 )", 99, +( String.fromCharCode(0x000B) + 99 ) ); + array[item++] = new TestCase( SECTION, "+( String.fromCharCode(0x000D) + 99 )", 99, +( String.fromCharCode(0x000D) + 99 ) ); + array[item++] = new TestCase( SECTION, "+( String.fromCharCode(0x000A) + 99 )", 99, +( String.fromCharCode(0x000A) + 99 ) ); + + array[item++] = new TestCase( SECTION, "+( String.fromCharCode(0x0009) + 99 + String.fromCharCode(0x0009)", 99, +( String.fromCharCode(0x0009) + 99 + String.fromCharCode(0x0009)) ); + array[item++] = new TestCase( SECTION, "+( String.fromCharCode(0x0020) + 99 + String.fromCharCode(0x0020)", 99, +( String.fromCharCode(0x0009) + 99 + String.fromCharCode(0x0020)) ); + array[item++] = new TestCase( SECTION, "+( String.fromCharCode(0x000C) + 99 + String.fromCharCode(0x000C)", 99, +( String.fromCharCode(0x0009) + 99 + String.fromCharCode(0x000C)) ); + array[item++] = new TestCase( SECTION, "+( String.fromCharCode(0x000D) + 99 + String.fromCharCode(0x000D)", 99, +( String.fromCharCode(0x0009) + 99 + String.fromCharCode(0x000D)) ); + array[item++] = new TestCase( SECTION, "+( String.fromCharCode(0x000B) + 99 + String.fromCharCode(0x000B)", 99, +( String.fromCharCode(0x0009) + 99 + String.fromCharCode(0x000B)) ); + array[item++] = new TestCase( SECTION, "+( String.fromCharCode(0x000A) + 99 + String.fromCharCode(0x000A)", 99, +( String.fromCharCode(0x0009) + 99 + String.fromCharCode(0x000A)) ); + + array[item++] = new TestCase( SECTION, "+( 99 + String.fromCharCode(0x0009)", 99, +( 99 + String.fromCharCode(0x0009)) ); + array[item++] = new TestCase( SECTION, "+( 99 + String.fromCharCode(0x0020)", 99, +( 99 + String.fromCharCode(0x0020)) ); + array[item++] = new TestCase( SECTION, "+( 99 + String.fromCharCode(0x000C)", 99, +( 99 + String.fromCharCode(0x000C)) ); + array[item++] = new TestCase( SECTION, "+( 99 + String.fromCharCode(0x000D)", 99, +( 99 + String.fromCharCode(0x000D)) ); + array[item++] = new TestCase( SECTION, "+( 99 + String.fromCharCode(0x000B)", 99, +( 99 + String.fromCharCode(0x000B)) ); + array[item++] = new TestCase( SECTION, "+( 99 + String.fromCharCode(0x000A)", 99, +( 99 + String.fromCharCode(0x000A)) ); + + + // StrNumericLiteral:::StrDecimalLiteral:::Infinity + + array[item++] = new TestCase( SECTION, "+('Infinity')", Math.pow(10,10000), +("Infinity") ); + array[item++] = new TestCase( SECTION, "+('-Infinity')", -Math.pow(10,10000), +("-Infinity") ); + array[item++] = new TestCase( SECTION, "+('+Infinity')", Math.pow(10,10000), +("+Infinity") ); + + // StrNumericLiteral::: StrDecimalLiteral ::: DecimalDigits . DecimalDigits opt ExponentPart opt + + array[item++] = new TestCase( SECTION, "+('0')", 0, +("0") ); + array[item++] = new TestCase( SECTION, "+('-0')", -0, +("-0") ); + array[item++] = new TestCase( SECTION, "+('+0')", 0, +("+0") ); + + array[item++] = new TestCase( SECTION, "+('1')", 1, +("1") ); + array[item++] = new TestCase( SECTION, "+('-1')", -1, +("-1") ); + array[item++] = new TestCase( SECTION, "+('+1')", 1, +("+1") ); + + array[item++] = new TestCase( SECTION, "+('2')", 2, +("2") ); + array[item++] = new TestCase( SECTION, "+('-2')", -2, +("-2") ); + array[item++] = new TestCase( SECTION, "+('+2')", 2, +("+2") ); + + array[item++] = new TestCase( SECTION, "+('3')", 3, +("3") ); + array[item++] = new TestCase( SECTION, "+('-3')", -3, +("-3") ); + array[item++] = new TestCase( SECTION, "+('+3')", 3, +("+3") ); + + array[item++] = new TestCase( SECTION, "+('4')", 4, +("4") ); + array[item++] = new TestCase( SECTION, "+('-4')", -4, +("-4") ); + array[item++] = new TestCase( SECTION, "+('+4')", 4, +("+4") ); + + array[item++] = new TestCase( SECTION, "+('5')", 5, +("5") ); + array[item++] = new TestCase( SECTION, "+('-5')", -5, +("-5") ); + array[item++] = new TestCase( SECTION, "+('+5')", 5, +("+5") ); + + array[item++] = new TestCase( SECTION, "+('6')", 6, +("6") ); + array[item++] = new TestCase( SECTION, "+('-6')", -6, +("-6") ); + array[item++] = new TestCase( SECTION, "+('+6')", 6, +("+6") ); + + array[item++] = new TestCase( SECTION, "+('7')", 7, +("7") ); + array[item++] = new TestCase( SECTION, "+('-7')", -7, +("-7") ); + array[item++] = new TestCase( SECTION, "+('+7')", 7, +("+7") ); + + array[item++] = new TestCase( SECTION, "+('8')", 8, +("8") ); + array[item++] = new TestCase( SECTION, "+('-8')", -8, +("-8") ); + array[item++] = new TestCase( SECTION, "+('+8')", 8, +("+8") ); + + array[item++] = new TestCase( SECTION, "+('9')", 9, +("9") ); + array[item++] = new TestCase( SECTION, "+('-9')", -9, +("-9") ); + array[item++] = new TestCase( SECTION, "+('+9')", 9, +("+9") ); + + array[item++] = new TestCase( SECTION, "+('3.14159')", 3.14159, +("3.14159") ); + array[item++] = new TestCase( SECTION, "+('-3.14159')", -3.14159, +("-3.14159") ); + array[item++] = new TestCase( SECTION, "+('+3.14159')", 3.14159, +("+3.14159") ); + + array[item++] = new TestCase( SECTION, "+('3.')", 3, +("3.") ); + array[item++] = new TestCase( SECTION, "+('-3.')", -3, +("-3.") ); + array[item++] = new TestCase( SECTION, "+('+3.')", 3, +("+3.") ); + + array[item++] = new TestCase( SECTION, "+('3.e1')", 30, +("3.e1") ); + array[item++] = new TestCase( SECTION, "+('-3.e1')", -30, +("-3.e1") ); + array[item++] = new TestCase( SECTION, "+('+3.e1')", 30, +("+3.e1") ); + + array[item++] = new TestCase( SECTION, "+('3.e+1')", 30, +("3.e+1") ); + array[item++] = new TestCase( SECTION, "+('-3.e+1')", -30, +("-3.e+1") ); + array[item++] = new TestCase( SECTION, "+('+3.e+1')", 30, +("+3.e+1") ); + + array[item++] = new TestCase( SECTION, "+('3.e-1')", .30, +("3.e-1") ); + array[item++] = new TestCase( SECTION, "+('-3.e-1')", -.30, +("-3.e-1") ); + array[item++] = new TestCase( SECTION, "+('+3.e-1')", .30, +("+3.e-1") ); + + // StrDecimalLiteral::: .DecimalDigits ExponentPart opt + + array[item++] = new TestCase( SECTION, "+('.00001')", 0.00001, +(".00001") ); + array[item++] = new TestCase( SECTION, "+('+.00001')", 0.00001, +("+.00001") ); + array[item++] = new TestCase( SECTION, "+('-0.0001')", -0.00001, +("-.00001") ); + + array[item++] = new TestCase( SECTION, "+('.01e2')", 1, +(".01e2") ); + array[item++] = new TestCase( SECTION, "+('+.01e2')", 1, +("+.01e2") ); + array[item++] = new TestCase( SECTION, "+('-.01e2')", -1, +("-.01e2") ); + + array[item++] = new TestCase( SECTION, "+('.01e+2')", 1, +(".01e+2") ); + array[item++] = new TestCase( SECTION, "+('+.01e+2')", 1, +("+.01e+2") ); + array[item++] = new TestCase( SECTION, "+('-.01e+2')", -1, +("-.01e+2") ); + + array[item++] = new TestCase( SECTION, "+('.01e-2')", 0.0001, +(".01e-2") ); + array[item++] = new TestCase( SECTION, "+('+.01e-2')", 0.0001, +("+.01e-2") ); + array[item++] = new TestCase( SECTION, "+('-.01e-2')", -0.0001, +("-.01e-2") ); + + // StrDecimalLiteral::: DecimalDigits ExponentPart opt + + array[item++] = new TestCase( SECTION, "+('1234e5')", 123400000, +("1234e5") ); + array[item++] = new TestCase( SECTION, "+('+1234e5')", 123400000, +("+1234e5") ); + array[item++] = new TestCase( SECTION, "+('-1234e5')", -123400000, +("-1234e5") ); + + array[item++] = new TestCase( SECTION, "+('1234e+5')", 123400000, +("1234e+5") ); + array[item++] = new TestCase( SECTION, "+('+1234e+5')", 123400000, +("+1234e+5") ); + array[item++] = new TestCase( SECTION, "+('-1234e+5')", -123400000, +("-1234e+5") ); + + array[item++] = new TestCase( SECTION, "+('1234e-5')", 0.01234, +("1234e-5") ); + array[item++] = new TestCase( SECTION, "+('+1234e-5')", 0.01234, +("+1234e-5") ); + array[item++] = new TestCase( SECTION, "+('-1234e-5')", -0.01234, +("-1234e-5") ); + + // StrNumericLiteral::: HexIntegerLiteral + + array[item++] = new TestCase( SECTION, "+('0x0')", 0, +("0x0")); + array[item++] = new TestCase( SECTION, "+('0x1')", 1, +("0x1")); + array[item++] = new TestCase( SECTION, "+('0x2')", 2, +("0x2")); + array[item++] = new TestCase( SECTION, "+('0x3')", 3, +("0x3")); + array[item++] = new TestCase( SECTION, "+('0x4')", 4, +("0x4")); + array[item++] = new TestCase( SECTION, "+('0x5')", 5, +("0x5")); + array[item++] = new TestCase( SECTION, "+('0x6')", 6, +("0x6")); + array[item++] = new TestCase( SECTION, "+('0x7')", 7, +("0x7")); + array[item++] = new TestCase( SECTION, "+('0x8')", 8, +("0x8")); + array[item++] = new TestCase( SECTION, "+('0x9')", 9, +("0x9")); + array[item++] = new TestCase( SECTION, "+('0xa')", 10, +("0xa")); + array[item++] = new TestCase( SECTION, "+('0xb')", 11, +("0xb")); + array[item++] = new TestCase( SECTION, "+('0xc')", 12, +("0xc")); + array[item++] = new TestCase( SECTION, "+('0xd')", 13, +("0xd")); + array[item++] = new TestCase( SECTION, "+('0xe')", 14, +("0xe")); + array[item++] = new TestCase( SECTION, "+('0xf')", 15, +("0xf")); + array[item++] = new TestCase( SECTION, "+('0xA')", 10, +("0xA")); + array[item++] = new TestCase( SECTION, "+('0xB')", 11, +("0xB")); + array[item++] = new TestCase( SECTION, "+('0xC')", 12, +("0xC")); + array[item++] = new TestCase( SECTION, "+('0xD')", 13, +("0xD")); + array[item++] = new TestCase( SECTION, "+('0xE')", 14, +("0xE")); + array[item++] = new TestCase( SECTION, "+('0xF')", 15, +("0xF")); + + array[item++] = new TestCase( SECTION, "+('0X0')", 0, +("0X0")); + array[item++] = new TestCase( SECTION, "+('0X1')", 1, +("0X1")); + array[item++] = new TestCase( SECTION, "+('0X2')", 2, +("0X2")); + array[item++] = new TestCase( SECTION, "+('0X3')", 3, +("0X3")); + array[item++] = new TestCase( SECTION, "+('0X4')", 4, +("0X4")); + array[item++] = new TestCase( SECTION, "+('0X5')", 5, +("0X5")); + array[item++] = new TestCase( SECTION, "+('0X6')", 6, +("0X6")); + array[item++] = new TestCase( SECTION, "+('0X7')", 7, +("0X7")); + array[item++] = new TestCase( SECTION, "+('0X8')", 8, +("0X8")); + array[item++] = new TestCase( SECTION, "+('0X9')", 9, +("0X9")); + array[item++] = new TestCase( SECTION, "+('0Xa')", 10, +("0Xa")); + array[item++] = new TestCase( SECTION, "+('0Xb')", 11, +("0Xb")); + array[item++] = new TestCase( SECTION, "+('0Xc')", 12, +("0Xc")); + array[item++] = new TestCase( SECTION, "+('0Xd')", 13, +("0Xd")); + array[item++] = new TestCase( SECTION, "+('0Xe')", 14, +("0Xe")); + array[item++] = new TestCase( SECTION, "+('0Xf')", 15, +("0Xf")); + array[item++] = new TestCase( SECTION, "+('0XA')", 10, +("0XA")); + array[item++] = new TestCase( SECTION, "+('0XB')", 11, +("0XB")); + array[item++] = new TestCase( SECTION, "+('0XC')", 12, +("0XC")); + array[item++] = new TestCase( SECTION, "+('0XD')", 13, +("0XD")); + array[item++] = new TestCase( SECTION, "+('0XE')", 14, +("0XE")); + array[item++] = new TestCase( SECTION, "+('0XF')", 15, +("0XF")); + + return array; + +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_4_7.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_4_7.as new file mode 100644 index 00000000000..402980a1887 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_4_7.as @@ -0,0 +1,238 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "e11_4_7"; + var VERSION = "ECMA_1"; + startTest(); + var testcases = getTestCases(); + var BUGNUMBER="77392"; + + writeHeaderToLog( SECTION + " Unary - operator"); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, "-('a string')", Number.NaN, -("a string") ); + array[item++] = new TestCase( SECTION, "-('34string')", Number.NaN, -("34string") ); + array[item++] = new TestCase( SECTION, "-('string63')", Number.NaN, -("string63") ); + array[item++] = new TestCase( SECTION, "-('e47')", Number.NaN, -("e47") ); + array[item++] = new TestCase( SECTION, "-('1e47')", -1e47, -("1e47") ); + array[item++] = new TestCase( SECTION, "-1e47", -1e47, -1e47 ); + array[item++] = new TestCase( SECTION, "-('')", 0, -("") ); + array[item++] = new TestCase( SECTION, "-(' ')", 0, -(" ") ); + array[item++] = new TestCase( SECTION, "-(\\t)", 0, -("\t") ); + array[item++] = new TestCase( SECTION, "-(\\n)", 0, -("\n") ); + array[item++] = new TestCase( SECTION, "-(\\r)", 0, -("\r") ); + array[item++] = new TestCase( SECTION, "-(\\f)", 0, -("\f") ); + + array[item++] = new TestCase( SECTION, "-(String.fromCharCode(0x0009)", 0, -(String.fromCharCode(0x0009)) ); + array[item++] = new TestCase( SECTION, "-(String.fromCharCode(0x0020)", 0, -(String.fromCharCode(0x0020)) ); + array[item++] = new TestCase( SECTION, "-(String.fromCharCode(0x000C)", 0, -(String.fromCharCode(0x000C)) ); + array[item++] = new TestCase( SECTION, "-(String.fromCharCode(0x000B)", 0, -(String.fromCharCode(0x000B)) ); + array[item++] = new TestCase( SECTION, "-(String.fromCharCode(0x000D)", 0, -(String.fromCharCode(0x000D)) ); + array[item++] = new TestCase( SECTION, "-(String.fromCharCode(0x000A)", 0, -(String.fromCharCode(0x000A)) ); + + // a StringNumericLiteral may be preceeded or followed by whitespace and/or + // line terminators + + array[item++] = new TestCase( SECTION, "-( ' ' + 999 )", -999, -( ' '+999) ); + array[item++] = new TestCase( SECTION, "-( '\\n' + 999 )", -999, -( '\n' +999) ); + array[item++] = new TestCase( SECTION, "-( '\\r' + 999 )", -999, -( '\r' +999) ); + array[item++] = new TestCase( SECTION, "-( '\\t' + 999 )", -999, -( '\t' +999) ); + array[item++] = new TestCase( SECTION, "-( '\\f' + 999 )", -999, -( '\f' +999) ); + + array[item++] = new TestCase( SECTION, "-( 999 + ' ' )", -999, -( 999+' ') ); + array[item++] = new TestCase( SECTION, "-( 999 + '\\n' )", -999, -( 999+'\n' ) ); + array[item++] = new TestCase( SECTION, "-( 999 + '\\r' )", -999, -( 999+'\r' ) ); + array[item++] = new TestCase( SECTION, "-( 999 + '\\t' )", -999, -( 999+'\t' ) ); + array[item++] = new TestCase( SECTION, "-( 999 + '\\f' )", -999, -( 999+'\f' ) ); + + array[item++] = new TestCase( SECTION, "-( '\\n' + 999 + '\\n' )", -999, -( '\n' +999+'\n' ) ); + array[item++] = new TestCase( SECTION, "-( '\\r' + 999 + '\\r' )", -999, -( '\r' +999+'\r' ) ); + array[item++] = new TestCase( SECTION, "-( '\\t' + 999 + '\\t' )", -999, -( '\t' +999+'\t' ) ); + array[item++] = new TestCase( SECTION, "-( '\\f' + 999 + '\\f' )", -999, -( '\f' +999+'\f' ) ); + + array[item++] = new TestCase( SECTION, "-( ' ' + '999' )", -999, -( ' '+'999') ); + array[item++] = new TestCase( SECTION, "-( '\\n' + '999' )", -999, -( '\n' +'999') ); + array[item++] = new TestCase( SECTION, "-( '\\r' + '999' )", -999, -( '\r' +'999') ); + array[item++] = new TestCase( SECTION, "-( '\\t' + '999' )", -999, -( '\t' +'999') ); + array[item++] = new TestCase( SECTION, "-( '\\f' + '999' )", -999, -( '\f' +'999') ); + + array[item++] = new TestCase( SECTION, "-( '999' + ' ' )", -999, -( '999'+' ') ); + array[item++] = new TestCase( SECTION, "-( '999' + '\\n' )", -999, -( '999'+'\n' ) ); + array[item++] = new TestCase( SECTION, "-( '999' + '\\r' )", -999, -( '999'+'\r' ) ); + array[item++] = new TestCase( SECTION, "-( '999' + '\\t' )", -999, -( '999'+'\t' ) ); + array[item++] = new TestCase( SECTION, "-( '999' + '\\f' )", -999, -( '999'+'\f' ) ); + + array[item++] = new TestCase( SECTION, "-( '\\n' + '999' + '\\n' )", -999, -( '\n' +'999'+'\n' ) ); + array[item++] = new TestCase( SECTION, "-( '\\r' + '999' + '\\r' )", -999, -( '\r' +'999'+'\r' ) ); + array[item++] = new TestCase( SECTION, "-( '\\t' + '999' + '\\t' )", -999, -( '\t' +'999'+'\t' ) ); + array[item++] = new TestCase( SECTION, "-( '\\f' + '999' + '\\f' )", -999, -( '\f' +'999'+'\f' ) ); + + array[item++] = new TestCase( SECTION, "-( String.fromCharCode(0x0009) + '99' )", -99, -( String.fromCharCode(0x0009) + '99' ) ); + array[item++] = new TestCase( SECTION, "-( String.fromCharCode(0x0020) + '99' )", -99, -( String.fromCharCode(0x0020) + '99' ) ); + array[item++] = new TestCase( SECTION, "-( String.fromCharCode(0x000C) + '99' )", -99, -( String.fromCharCode(0x000C) + '99' ) ); + array[item++] = new TestCase( SECTION, "-( String.fromCharCode(0x000B) + '99' )", -99, -( String.fromCharCode(0x000B) + '99' ) ); + array[item++] = new TestCase( SECTION, "-( String.fromCharCode(0x000D) + '99' )", -99, -( String.fromCharCode(0x000D) + '99' ) ); + array[item++] = new TestCase( SECTION, "-( String.fromCharCode(0x000A) + '99' )", -99, -( String.fromCharCode(0x000A) + '99' ) ); + + array[item++] = new TestCase( SECTION, "-( String.fromCharCode(0x0009) + '99' + String.fromCharCode(0x0009)", -99, -( String.fromCharCode(0x0009) + '99' + String.fromCharCode(0x0009)) ); + array[item++] = new TestCase( SECTION, "-( String.fromCharCode(0x0020) + '99' + String.fromCharCode(0x0020)", -99, -( String.fromCharCode(0x0009) + '99' + String.fromCharCode(0x0020)) ); + array[item++] = new TestCase( SECTION, "-( String.fromCharCode(0x000C) + '99' + String.fromCharCode(0x000C)", -99, -( String.fromCharCode(0x0009) + '99' + String.fromCharCode(0x000C)) ); + array[item++] = new TestCase( SECTION, "-( String.fromCharCode(0x000D) + '99' + String.fromCharCode(0x000D)", -99, -( String.fromCharCode(0x0009) + '99' + String.fromCharCode(0x000D)) ); + array[item++] = new TestCase( SECTION, "-( String.fromCharCode(0x000B) + '99' + String.fromCharCode(0x000B)", -99, -( String.fromCharCode(0x0009) + '99' + String.fromCharCode(0x000B)) ); + array[item++] = new TestCase( SECTION, "-( String.fromCharCode(0x000A) + '99' + String.fromCharCode(0x000A)", -99, -( String.fromCharCode(0x0009) + '99' + String.fromCharCode(0x000A)) ); + + array[item++] = new TestCase( SECTION, "-( '99' + String.fromCharCode(0x0009)", -99, -( '99' + String.fromCharCode(0x0009)) ); + array[item++] = new TestCase( SECTION, "-( '99' + String.fromCharCode(0x0020)", -99, -( '99' + String.fromCharCode(0x0020)) ); + array[item++] = new TestCase( SECTION, "-( '99' + String.fromCharCode(0x000C)", -99, -( '99' + String.fromCharCode(0x000C)) ); + array[item++] = new TestCase( SECTION, "-( '99' + String.fromCharCode(0x000D)", -99, -( '99' + String.fromCharCode(0x000D)) ); + array[item++] = new TestCase( SECTION, "-( '99' + String.fromCharCode(0x000B)", -99, -( '99' + String.fromCharCode(0x000B)) ); + array[item++] = new TestCase( SECTION, "-( '99' + String.fromCharCode(0x000A)", -99, -( '99' + String.fromCharCode(0x000A)) ); + + array[item++] = new TestCase( SECTION, "-( String.fromCharCode(0x0009) + 99 )", -99, -( String.fromCharCode(0x0009) + 99 ) ); + array[item++] = new TestCase( SECTION, "-( String.fromCharCode(0x0020) + 99 )", -99, -( String.fromCharCode(0x0020) + 99 ) ); + array[item++] = new TestCase( SECTION, "-( String.fromCharCode(0x000C) + 99 )", -99, -( String.fromCharCode(0x000C) + 99 ) ); + array[item++] = new TestCase( SECTION, "-( String.fromCharCode(0x000B) + 99 )", -99, -( String.fromCharCode(0x000B) + 99 ) ); + array[item++] = new TestCase( SECTION, "-( String.fromCharCode(0x000D) + 99 )", -99, -( String.fromCharCode(0x000D) + 99 ) ); + array[item++] = new TestCase( SECTION, "-( String.fromCharCode(0x000A) + 99 )", -99, -( String.fromCharCode(0x000A) + 99 ) ); + + array[item++] = new TestCase( SECTION, "-( String.fromCharCode(0x0009) + 99 + String.fromCharCode(0x0009)", -99, -( String.fromCharCode(0x0009) + 99 + String.fromCharCode(0x0009)) ); + array[item++] = new TestCase( SECTION, "-( String.fromCharCode(0x0020) + 99 + String.fromCharCode(0x0020)", -99, -( String.fromCharCode(0x0009) + 99 + String.fromCharCode(0x0020)) ); + array[item++] = new TestCase( SECTION, "-( String.fromCharCode(0x000C) + 99 + String.fromCharCode(0x000C)", -99, -( String.fromCharCode(0x0009) + 99 + String.fromCharCode(0x000C)) ); + array[item++] = new TestCase( SECTION, "-( String.fromCharCode(0x000D) + 99 + String.fromCharCode(0x000D)", -99, -( String.fromCharCode(0x0009) + 99 + String.fromCharCode(0x000D)) ); + array[item++] = new TestCase( SECTION, "-( String.fromCharCode(0x000B) + 99 + String.fromCharCode(0x000B)", -99, -( String.fromCharCode(0x0009) + 99 + String.fromCharCode(0x000B)) ); + array[item++] = new TestCase( SECTION, "-( String.fromCharCode(0x000A) + 99 + String.fromCharCode(0x000A)", -99, -( String.fromCharCode(0x0009) + 99 + String.fromCharCode(0x000A)) ); + + array[item++] = new TestCase( SECTION, "-( 99 + String.fromCharCode(0x0009)", -99, -( 99 + String.fromCharCode(0x0009)) ); + array[item++] = new TestCase( SECTION, "-( 99 + String.fromCharCode(0x0020)", -99, -( 99 + String.fromCharCode(0x0020)) ); + array[item++] = new TestCase( SECTION, "-( 99 + String.fromCharCode(0x000C)", -99, -( 99 + String.fromCharCode(0x000C)) ); + array[item++] = new TestCase( SECTION, "-( 99 + String.fromCharCode(0x000D)", -99, -( 99 + String.fromCharCode(0x000D)) ); + array[item++] = new TestCase( SECTION, "-( 99 + String.fromCharCode(0x000B)", -99, -( 99 + String.fromCharCode(0x000B)) ); + array[item++] = new TestCase( SECTION, "-( 99 + String.fromCharCode(0x000A)", -99, -( 99 + String.fromCharCode(0x000A)) ); + + + // StrNumericLiteral:::StrDecimalLiteral:::Infinity + + array[item++] = new TestCase( SECTION, "-('Infinity')", -Math.pow(10,10000), -("Infinity") ); + array[item++] = new TestCase( SECTION, "-('-Infinity')", Math.pow(10,10000), -("-Infinity") ); + array[item++] = new TestCase( SECTION, "+-('+Infinity')", -Math.pow(10,10000), -("+Infinity") ); + + // StrNumericLiteral::: StrDecimalLiteral ::: DecimalDigits . DecimalDigits opt ExponentPart opt + + array[item++] = new TestCase( SECTION, "-('0')", -0, -("0") ); + array[item++] = new TestCase( SECTION, "-('-0')", 0, -("-0") ); + array[item++] = new TestCase( SECTION, "-('+0')", -0, - ("+0") ); + + array[item++] = new TestCase( SECTION, "-('1')", -1, -("1") ); + array[item++] = new TestCase( SECTION, "-('-1')", 1, -("-1") ); + array[item++] = new TestCase( SECTION, "-('+1')", -1, -("+1") ); + + array[item++] = new TestCase( SECTION, "-('2')", -2, -("2") ); + array[item++] = new TestCase( SECTION, "-('-2')", 2, -("-2") ); + array[item++] = new TestCase( SECTION, "-('+2')", -2, -("+2") ); + + array[item++] = new TestCase( SECTION, "-('3.14159')", -3.14159, -("3.14159") ); + array[item++] = new TestCase( SECTION, "-('-3.14159')", 3.14159, -("-3.14159") ); + array[item++] = new TestCase( SECTION, "-('+3.14159')", -3.14159, -("+3.14159") ); + + array[item++] = new TestCase( SECTION, "-('3.')", -3, -("3.") ); + array[item++] = new TestCase( SECTION, "-('-3.')", 3, -("-3.") ); + array[item++] = new TestCase( SECTION, "-('+3.')", -3, -("+3.") ); + + array[item++] = new TestCase( SECTION, "-('3.e1')", -30, -("3.e1") ); + array[item++] = new TestCase( SECTION, "-('-3.e1')", 30, -("-3.e1") ); + array[item++] = new TestCase( SECTION, "-('+3.e1')", -30, -("+3.e1") ); + + array[item++] = new TestCase( SECTION, "-(3.e+1)", -30, -(3.e+1) ); + array[item++] = new TestCase( SECTION, "-(-3.e+1)", 30, -(-3.e+1) ); + array[item++] = new TestCase( SECTION, "-(+3.e+1)", -30, -(+3.e+1) ); + + array[item++] = new TestCase( SECTION, "-('3.e-1')", -.30, -("3.e-1") ); + array[item++] = new TestCase( SECTION, "-('-3.e-1')", .30, -("-3.e-1") ); + array[item++] = new TestCase( SECTION, "-('+3.e-1')", -.30, -("+3.e-1") ); + + // StrDecimalLiteral::: .DecimalDigits ExponentPart opt + + array[item++] = new TestCase( SECTION, "-('.00001')", -0.00001, -(".00001") ); + array[item++] = new TestCase( SECTION, "-('+.00001')", -0.00001, -("+.00001") ); + array[item++] = new TestCase( SECTION, "-('-0.0001')", 0.00001, -("-.00001") ); + + array[item++] = new TestCase( SECTION, "-('.01e2')", -1, -(".01e2") ); + array[item++] = new TestCase( SECTION, "-('+.01e2')", -1, -("+.01e2") ); + array[item++] = new TestCase( SECTION, "-('-.01e2')", 1, -("-.01e2") ); + + array[item++] = new TestCase( SECTION, "-.01e+2", -1, -.01e+2 ); + array[item++] = new TestCase( SECTION, "-(+.01e+2)", -1, -(+.01e+2) ); + array[item++] = new TestCase( SECTION, "-(-.01e+2)", 1, -(-.01e+2) ); + + array[item++] = new TestCase( SECTION, "-('.01e-2')", -0.0001, -(".01e-2") ); + array[item++] = new TestCase( SECTION, "-('+.01e-2')", -0.0001, -("+.01e-2") ); + array[item++] = new TestCase( SECTION, "-('-.01e-2')", 0.0001, -("-.01e-2") ); + + // StrDecimalLiteral::: DecimalDigits ExponentPart opt + + array[item++] = new TestCase( SECTION, "-('1234e5')", -123400000, -("1234e5") ); + array[item++] = new TestCase( SECTION, "-('+1234e5')", -123400000, -("+1234e5") ); + array[item++] = new TestCase( SECTION, "-('-1234e5')", 123400000, -("-1234e5") ); + + array[item++] = new TestCase( SECTION, "-('1234e+5')", -123400000, -("1234e+5") ); + array[item++] = new TestCase( SECTION, "-('+1234e+5')", -123400000, -("+1234e+5") ); + array[item++] = new TestCase( SECTION, "-('-1234e+5')", 123400000, -("-1234e+5") ); + + array[item++] = new TestCase( SECTION, "-('1234e-5')", -0.01234, -("1234e-5") ); + array[item++] = new TestCase( SECTION, "-('+1234e-5')", -0.01234, -("+1234e-5") ); + array[item++] = new TestCase( SECTION, "-('-1234e-5')", 0.01234, -("-1234e-5") ); + + // StrNumericLiteral::: HexIntegerLiteral + + array[item++] = new TestCase( SECTION, "-('0x0')", 0, -("0x0")); + array[item++] = new TestCase( SECTION, "-('0x1')", -1, -("0x1")); + array[item++] = new TestCase( SECTION, "-('0x2')", -2, -("0x2")); + array[item++] = new TestCase( SECTION, "-('0xd')", -13, -("0xd")); + array[item++] = new TestCase( SECTION, "-('0xe')", -14, -("0xe")); + array[item++] = new TestCase( SECTION, "-('0xf')", -15, -("0xf")); + array[item++] = new TestCase( SECTION, "-('0xA')", -10, -("0xA")); + array[item++] = new TestCase( SECTION, "-('0xB')", -11, -("0xB")); + array[item++] = new TestCase( SECTION, "-('0xC')", -12, -("0xC")); + + array[item++] = new TestCase( SECTION, "-0X0", -0, -0X0); + array[item++] = new TestCase( SECTION, "-('0X8')", -8, -("0X8")); + array[item++] = new TestCase( SECTION, "-('0X9')", -9, -("0X9")); + array[item++] = new TestCase( SECTION, "-0Xa", -10, -0Xa); + array[item++] = new TestCase( SECTION, "-('0Xb')", -11, -("0Xb")); + array[item++] = new TestCase( SECTION, "-('0XE')", -14, -("0XE")); + array[item++] = new TestCase( SECTION, "-0XF", -15, -0XF); + + return array; + +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_4_8.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_4_8.as new file mode 100644 index 00000000000..979f828025b --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_4_8.as @@ -0,0 +1,195 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "e11_4_8"; + var VERSION = "ECMA_1"; + startTest(); + var testcases = getTestCases(); + + writeHeaderToLog( SECTION + " Bitwise Not operator"); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + for ( var i = 0; i < 35; i++ ) { + var p = Math.pow(2,i); + + array[item++] = new TestCase( SECTION, "~"+p, Not(p), ~p ); + + } + for ( i = 0; i < 35; i++ ) { + var p = -Math.pow(2,i); + + array[item++] = new TestCase( SECTION, "~"+p, Not(p), ~p ); + + } + + return ( array ); +} +function ToInteger( n ) { + n = Number( n ); + var sign = ( n < 0 ) ? -1 : 1; + + if ( n != n ) { + return 0; + } + if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY ) { + return n; + } + return ( sign * Math.floor(Math.abs(n)) ); +} +function ToInt32( n ) { + n = Number( n ); + var sign = ( n < 0 ) ? -1 : 1; + + if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY) { + return 0; + } + + n = (sign * Math.floor( Math.abs(n) )) % Math.pow(2,32); + n = ( n >= Math.pow(2,31) ) ? n - Math.pow(2,32) : n; + + return ( n ); +} +function ToUint32( n ) { + n = Number( n ); + var sign = ( n < 0 ) ? -1 : 1; + + if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY) { + return 0; + } + n = sign * Math.floor( Math.abs(n) ) + + n = n % Math.pow(2,32); + + if ( n < 0 ){ + n += Math.pow(2,32); + } + + return ( n ); +} +function ToUint16( n ) { + var sign = ( n < 0 ) ? -1 : 1; + + if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY) { + return 0; + } + + n = ( sign * Math.floor( Math.abs(n) ) ) % Math.pow(2,16); + + if (n <0) { + n += Math.pow(2,16); + } + + return ( n ); +} +function Mask( b, n ) { + b = ToUint32BitString( b ); + b = b.substring( b.length - n ); + b = ToUint32Decimal( b ); + return ( b ); +} +function ToUint32BitString( n ) { + var b = ""; + for ( p = 31; p >=0; p-- ) { + if ( n >= Math.pow(2,p) ) { + b += "1"; + n -= Math.pow(2,p); + } else { + b += "0"; + } + } + return b; +} +function ToInt32BitString( n ) { + var b = ""; + var sign = ( n < 0 ) ? -1 : 1; + + b += ( sign == 1 ) ? "0" : "1"; + + for ( p = 30; p >=0; p-- ) { + if ( (sign == 1 ) ? sign * n >= Math.pow(2,p) : sign * n > Math.pow(2,p) ) { + b += ( sign == 1 ) ? "1" : "0"; + n -= sign * Math.pow( 2, p ); + } else { + b += ( sign == 1 ) ? "0" : "1"; + } + } + + return b; +} +function ToInt32Decimal( bin ) { + var r = 0; + var sign; + + if ( Number(bin.charAt(0)) == 0 ) { + sign = 1; + r = 0; + } else { + sign = -1; + r = -(Math.pow(2,31)); + } + + for ( var j = 0; j < 31; j++ ) { + r += Math.pow( 2, j ) * Number(bin.charAt(31-j)); + } + + return r; +} +function ToUint32Decimal( bin ) { + var r = 0; + + for ( l = bin.length; l < 32; l++ ) { + bin = "0" + bin; + } + + for ( j = 0; j < 31; j++ ) { + r += Math.pow( 2, j ) * Number(bin.charAt(31-j)); + } + + return r; +} +function Not( n ) { + n = ToInt32(n); + n = ToInt32BitString(n); + + r = "" + + for( var l = 0; l < n.length; l++ ) { + r += ( n.charAt(l) == "0" ) ? "1" : "0"; + } + + n = ToInt32Decimal(r); + + return n; +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_4_9.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_4_9.as new file mode 100644 index 00000000000..98ff8b9d5fb --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_4_9.as @@ -0,0 +1,78 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "e11_4_9"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Logical NOT operator (!)"; + + writeHeaderToLog( SECTION + " "+ TITLE); + +// version("130") + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "!(null)", true, !(null) ); + array[item++] = new TestCase( SECTION, "!(void 0)", true, !(void 0) ); + + array[item++] = new TestCase( SECTION, "!(false)", true, !(false) ); + array[item++] = new TestCase( SECTION, "!(true)", false, !(true) ); + array[item++] = new TestCase( SECTION, "!(0)", true, !(0) ); + array[item++] = new TestCase( SECTION, "!(-0)", true, !(-0) ); + array[item++] = new TestCase( SECTION, "!(NaN)", true, !(Number.NaN) ); + array[item++] = new TestCase( SECTION, "!(Infinity)", false, !(Number.POSITIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "!(-Infinity)", false, !(Number.NEGATIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "!(Math.PI)", false, !(Math.PI) ); + array[item++] = new TestCase( SECTION, "!(1)", false, !(1) ); + array[item++] = new TestCase( SECTION, "!(-1)", false, !(-1) ); + array[item++] = new TestCase( SECTION, "!('')", true, !("") ); + array[item++] = new TestCase( SECTION, "!('\t')", false, !("\t") ); + array[item++] = new TestCase( SECTION, "!('0')", false, !("0") ); + array[item++] = new TestCase( SECTION, "!('string')", false, !("string") ); + array[item++] = new TestCase( SECTION, "!(new String(''))", true, !(new String("")) ); + array[item++] = new TestCase( SECTION, "!(new String('string'))", false, !(new String("string")) ); + array[item++] = new TestCase( SECTION, "!(new String())", true, !(new String()) ); + array[item++] = new TestCase( SECTION, "!(new Boolean(true))", false, !(new Boolean(true)) ); + array[item++] = new TestCase( SECTION, "!(new Boolean(false))", true, !(new Boolean(false)) ); + array[item++] = new TestCase( SECTION, "!(new Array())", false, !(new Array()) ); + array[item++] = new TestCase( SECTION, "!(new Array(1,2,3)", false, !(new Array(1,2,3)) ); + array[item++] = new TestCase( SECTION, "!(new Number())", true, !(new Number()) ); + array[item++] = new TestCase( SECTION, "!(new Number(0))", true, !(new Number(0)) ); + array[item++] = new TestCase( SECTION, "!(new Number(NaN))", true, !(new Number(Number.NaN)) ); + array[item++] = new TestCase( SECTION, "!(new Number(Infinity))", false, !(new Number(Number.POSITIVE_INFINITY)) ); + + return (array); +} + diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_5_1.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_5_1.as new file mode 100644 index 00000000000..74ac4edc6b4 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_5_1.as @@ -0,0 +1,103 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "e11_5_1"; + var VERSION = "ECMA_1"; + startTest(); + var testcases = getTestCases(); + + writeHeaderToLog( SECTION + " Applying the * operator"); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "Number.NaN * Number.NaN", Number.NaN, Number.NaN * Number.NaN ); + array[item++] = new TestCase( SECTION, "Number.NaN * 1", Number.NaN, Number.NaN * 1 ); + array[item++] = new TestCase( SECTION, "1 * Number.NaN", Number.NaN, 1 * Number.NaN ); + + array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY * 0", Number.NaN, Number.POSITIVE_INFINITY * 0 ); + array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY * 0", Number.NaN, Number.NEGATIVE_INFINITY * 0 ); + array[item++] = new TestCase( SECTION, "0 * Number.POSITIVE_INFINITY", Number.NaN, 0 * Number.POSITIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "0 * Number.NEGATIVE_INFINITY", Number.NaN, 0 * Number.NEGATIVE_INFINITY ); + + array[item++] = new TestCase( SECTION, "-0 * Number.POSITIVE_INFINITY", Number.NaN, -0 * Number.POSITIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "-0 * Number.NEGATIVE_INFINITY", Number.NaN, -0 * Number.NEGATIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY * -0", Number.NaN, Number.POSITIVE_INFINITY * -0 ); + array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY * -0", Number.NaN, Number.NEGATIVE_INFINITY * -0 ); + + array[item++] = new TestCase( SECTION, "0 * -0", -0, 0 * -0 ); + array[item++] = new TestCase( SECTION, "-0 * 0", -0, -0 * 0 ); + array[item++] = new TestCase( SECTION, "-0 * -0", 0, -0 * -0 ); + array[item++] = new TestCase( SECTION, "0 * 0", 0, 0 * 0 ); + + array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY * Number.NEGATIVE_INFINITY", Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY * Number.NEGATIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY * Number.NEGATIVE_INFINITY", Number.NEGATIVE_INFINITY, Number.POSITIVE_INFINITY * Number.NEGATIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY * Number.POSITIVE_INFINITY", Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY * Number.POSITIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY * Number.POSITIVE_INFINITY", Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY * Number.POSITIVE_INFINITY ); + + array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY * 1 ", Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY * 1 ); + array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY * -1 ", Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY * -1 ); + array[item++] = new TestCase( SECTION, "1 * Number.NEGATIVE_INFINITY", Number.NEGATIVE_INFINITY, 1 * Number.NEGATIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "-1 * Number.NEGATIVE_INFINITY", Number.POSITIVE_INFINITY, -1 * Number.NEGATIVE_INFINITY ); + + array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY * 1 ", Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY * 1 ); + array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY * -1 ", Number.NEGATIVE_INFINITY, Number.POSITIVE_INFINITY * -1 ); + array[item++] = new TestCase( SECTION, "1 * Number.POSITIVE_INFINITY", Number.POSITIVE_INFINITY, 1 * Number.POSITIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "-1 * Number.POSITIVE_INFINITY", Number.NEGATIVE_INFINITY, -1 * Number.POSITIVE_INFINITY ); + + array[item++] = new TestCase( SECTION, "-1.0 * Number.MAX_VALUE", -Number.MAX_VALUE, -1.0 * Number.MAX_VALUE ); + array[item++] = new TestCase( SECTION, "1.1 * Number.MAX_VALUE", Number.POSITIVE_INFINITY, 1.1 * Number.MAX_VALUE ); + array[item++] = new TestCase( SECTION, "-1.1 * Number.MAX_VALUE", Number.NEGATIVE_INFINITY, -1.1 * Number.MAX_VALUE ); + array[item++] = new TestCase( SECTION, "Number.MAX_VALUE * Number.MAX_VALUE", Number.POSITIVE_INFINITY, Number.MAX_VALUE * Number.MAX_VALUE ); + array[item++] = new TestCase( SECTION, "(Number.MAX_VALUE-1) * (Number.MAX_VALUE-1)", Number.POSITIVE_INFINITY, (Number.MAX_VALUE-1) * (Number.MAX_VALUE-1) ); + array[item++] = new TestCase( SECTION, "-1 * Number.MAX_VALUE * Number.MAX_VALUE", Number.NEGATIVE_INFINITY, -1 * Number.MAX_VALUE * Number.MAX_VALUE ); + + array[item++] = new TestCase( SECTION, "-1 * Number.MIN_VALUE", -4.9406564584124654e-324, -1 * Number.MIN_VALUE ); + array[item++] = new TestCase( SECTION, "0.9 * Number.MIN_VALUE", 4.9406564584124654e-324, 0.9 * Number.MIN_VALUE ); + array[item++] = new TestCase( SECTION, "-0.9 * Number.MIN_VALUE", -4.9406564584124654e-324, -0.9 * Number.MIN_VALUE ); + array[item++] = new TestCase( SECTION, "0.51 * Number.MIN_VALUE", 4.9406564584124654e-324, 0.51 * Number.MIN_VALUE ); + array[item++] = new TestCase( SECTION, "-0.51 * Number.MIN_VALUE", -4.9406564584124654e-324, -0.51 * Number.MIN_VALUE ); + array[item++] = new TestCase( SECTION, "0.5 * Number.MIN_VALUE", 0, 0.5 * Number.MIN_VALUE ); + array[item++] = new TestCase( SECTION, "-0.5 * Number.MIN_VALUE", -0, -0.5 * Number.MIN_VALUE ); + array[item++] = new TestCase( SECTION, "0.1 * Number.MIN_VALUE", 0, 0.1 * Number.MIN_VALUE ); + array[item++] = new TestCase( SECTION, "-0.1 * Number.MIN_VALUE", -0, -0.1 * Number.MIN_VALUE ); + array[item++] = new TestCase( SECTION, "Number.MIN_VALUE * Number.MIN_VALUE", 0, Number.MIN_VALUE * Number.MIN_VALUE ); + + array[item++] = new TestCase( SECTION, "1 * 1", 1, 1 * 1 ); + array[item++] = new TestCase( SECTION, "-1 * 1", -1, -1 * 1 ); + array[item++] = new TestCase( SECTION, "1 * (-1)", -1, 1 * (-1) ); + array[item++] = new TestCase( SECTION, "-1 * (-1)", 1, -1 * (-1) ); + + + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_5_2.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_5_2.as new file mode 100644 index 00000000000..eaf5dcc4861 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_5_2.as @@ -0,0 +1,137 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "e11_5_2"; + var VERSION = "ECMA_1"; + startTest(); + var testcases = getTestCases(); + var BUGNUMBER="111202"; + + writeHeaderToLog( SECTION + " Applying the / operator"); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // if either operand is NaN, the result is NaN. + + array[item++] = new TestCase( SECTION, "Number.NaN / Number.NaN", Number.NaN, Number.NaN / Number.NaN ); + array[item++] = new TestCase( SECTION, "Number.NaN / 1", Number.NaN, Number.NaN / 1 ); + array[item++] = new TestCase( SECTION, "1 / Number.NaN", Number.NaN, 1 / Number.NaN ); + + array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY / Number.NaN", Number.NaN, Number.POSITIVE_INFINITY / Number.NaN ); + array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY / Number.NaN", Number.NaN, Number.NEGATIVE_INFINITY / Number.NaN ); + + // Division of an infinity by an infinity results in NaN. + + array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY / Number.NEGATIVE_INFINITY", Number.NaN, Number.NEGATIVE_INFINITY / Number.NEGATIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY / Number.NEGATIVE_INFINITY", Number.NaN, Number.POSITIVE_INFINITY / Number.NEGATIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY / Number.POSITIVE_INFINITY", Number.NaN, Number.NEGATIVE_INFINITY / Number.POSITIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY / Number.POSITIVE_INFINITY", Number.NaN, Number.POSITIVE_INFINITY / Number.POSITIVE_INFINITY ); + + // Division of an infinity by a zero results in an infinity. + + array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY / 0", Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY / 0 ); + array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY / 0", Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY / 0 ); + array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY / -0", Number.NEGATIVE_INFINITY, Number.POSITIVE_INFINITY / -0 ); + array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY / -0", Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY / -0 ); + + // Division of an infinity by a non-zero finite value results in a signed infinity. + + array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY / 1 ", Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY / 1 ); + array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY / -1 ", Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY / -1 ); + array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY / 1 ", Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY / 1 ); + array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY / -1 ", Number.NEGATIVE_INFINITY, Number.POSITIVE_INFINITY / -1 ); + + array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY / Number.MAX_VALUE ", Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY / Number.MAX_VALUE ); + array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY / -Number.MAX_VALUE ", Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY / -Number.MAX_VALUE ); + array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY / Number.MAX_VALUE ", Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY / Number.MAX_VALUE ); + array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY / -Number.MAX_VALUE ", Number.NEGATIVE_INFINITY, Number.POSITIVE_INFINITY / -Number.MAX_VALUE ); + + // Division of a finite value by an infinity results in zero. + + array[item++] = new TestCase( SECTION, "1 / Number.NEGATIVE_INFINITY", -0, 1 / Number.NEGATIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "1 / Number.POSITIVE_INFINITY", 0, 1 / Number.POSITIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "-1 / Number.POSITIVE_INFINITY", -0, -1 / Number.POSITIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "-1 / Number.NEGATIVE_INFINITY", 0, -1 / Number.NEGATIVE_INFINITY ); + + array[item++] = new TestCase( SECTION, "Number.MAX_VALUE / Number.NEGATIVE_INFINITY", -0, Number.MAX_VALUE / Number.NEGATIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "Number.MAX_VALUE / Number.POSITIVE_INFINITY", 0, Number.MAX_VALUE / Number.POSITIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "-Number.MAX_VALUE / Number.POSITIVE_INFINITY", -0, -Number.MAX_VALUE / Number.POSITIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "-Number.MAX_VALUE / Number.NEGATIVE_INFINITY", 0, -Number.MAX_VALUE / Number.NEGATIVE_INFINITY ); + + // Division of a zero by a zero results in NaN + + array[item++] = new TestCase( SECTION, "0 / -0", Number.NaN, 0 / -0 ); + array[item++] = new TestCase( SECTION, "-0 / 0", Number.NaN, -0 / 0 ); + array[item++] = new TestCase( SECTION, "-0 / -0", Number.NaN, -0 / -0 ); + array[item++] = new TestCase( SECTION, "0 / 0", Number.NaN, 0 / 0 ); + + // division of zero by any other finite value results in zero + + array[item++] = new TestCase( SECTION, "0 / 1", 0, 0 / 1 ); + array[item++] = new TestCase( SECTION, "0 / -1", -0, 0 / -1 ); + array[item++] = new TestCase( SECTION, "-0 / 1", -0, -0 / 1 ); + array[item++] = new TestCase( SECTION, "-0 / -1", 0, -0 / -1 ); + + // Division of a non-zero finite value by a zero results in a signed infinity. + + array[item++] = new TestCase( SECTION, "1 / 0", Number.POSITIVE_INFINITY, 1/0 ); + array[item++] = new TestCase( SECTION, "1 / -0", Number.NEGATIVE_INFINITY, 1/-0 ); + array[item++] = new TestCase( SECTION, "-1 / 0", Number.NEGATIVE_INFINITY, -1/0 ); + array[item++] = new TestCase( SECTION, "-1 / -0", Number.POSITIVE_INFINITY, -1/-0 ); + + array[item++] = new TestCase( SECTION, "0 / Number.POSITIVE_INFINITY", 0, 0 / Number.POSITIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "0 / Number.NEGATIVE_INFINITY", -0, 0 / Number.NEGATIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "-0 / Number.POSITIVE_INFINITY", -0, -0 / Number.POSITIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "-0 / Number.NEGATIVE_INFINITY", 0, -0 / Number.NEGATIVE_INFINITY ); + + // the sign of the result is positive if both operands have the same sign + // the sign of the result is negative if the operands have different signs + + array[item++] = new TestCase( SECTION, "1 / 1", 1, 1 / 1 ); + array[item++] = new TestCase( SECTION, "1 / -1", -1, 1 / -1 ); + array[item++] = new TestCase( SECTION, "-1 / 1", -1, -1 / 1 ); + var q = -1 / -1; + array[item++] = new TestCase( SECTION, "-1 / -1", 1, q ); + + array[item++] = new TestCase( SECTION, "Number.MIN_VALUE / Number.MAX_VALUE ", 0, Number.MIN_VALUE / Number.MAX_VALUE ); + array[item++] = new TestCase( SECTION, "Number.MAX_VALUE / Number.MIN_VALUE ", Number.POSITIVE_INFINITY, Number.MAX_VALUE / Number.MIN_VALUE ); + array[item++] = new TestCase( SECTION, "10.3 / 5e-324", Number.POSITIVE_INFINITY, 10.3 / 5e-324 ); + array[item++] = new TestCase( SECTION, "Number.MIN_VALUE / 1.1 ", 4.9406564584124654e-324, Number.MIN_VALUE / 1.1 ); + array[item++] = new TestCase( SECTION, "Number.MIN_VALUE / 1.9 ", 4.9406564584124654e-324, Number.MIN_VALUE / 1.9 ); + array[item++] = new TestCase( SECTION, "Number.MIN_VALUE / 2.0 ", 0, Number.MIN_VALUE / 2.0 ); + array[item++] = new TestCase( SECTION, "Number.MIN_VALUE / 3 ", 0, Number.MIN_VALUE / 3 ); + array[item++] = new TestCase( SECTION, "Number.MIN_VALUE / 5 ", 0, Number.MIN_VALUE / 5 ); + array[item++] = new TestCase( SECTION, "Number.MIN_VALUE / 9 ", 0, Number.MIN_VALUE / 9 ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_5_3.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_5_3.as new file mode 100644 index 00000000000..d4226dff4ce --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_5_3.as @@ -0,0 +1,145 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "e11_5_3"; + var VERSION = "ECMA_1"; + startTest(); + var testcases = getTestCases(); + var BUGNUMBER="111202"; + + writeHeaderToLog( SECTION + " Applying the % operator"); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // if either operand is NaN, the result is NaN. + + array[item++] = new TestCase( SECTION, "Number.NaN % Number.NaN", Number.NaN, Number.NaN % Number.NaN ); + array[item++] = new TestCase( SECTION, "Number.NaN % 1", Number.NaN, Number.NaN % 1 ); + array[item++] = new TestCase( SECTION, "1 % Number.NaN", Number.NaN, 1 % Number.NaN ); + + array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY % Number.NaN", Number.NaN, Number.POSITIVE_INFINITY % Number.NaN ); + array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY % Number.NaN", Number.NaN, Number.NEGATIVE_INFINITY % Number.NaN ); + + // If the dividend is an infinity, or the divisor is a zero, or both, the result is NaN. + // dividend is an infinity + + array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY % Number.NEGATIVE_INFINITY", Number.NaN, Number.NEGATIVE_INFINITY % Number.NEGATIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY % Number.NEGATIVE_INFINITY", Number.NaN, Number.POSITIVE_INFINITY % Number.NEGATIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY % Number.POSITIVE_INFINITY", Number.NaN, Number.NEGATIVE_INFINITY % Number.POSITIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY % Number.POSITIVE_INFINITY", Number.NaN, Number.POSITIVE_INFINITY % Number.POSITIVE_INFINITY ); + + array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY % 0", Number.NaN, Number.POSITIVE_INFINITY % 0 ); + array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY % 0", Number.NaN, Number.NEGATIVE_INFINITY % 0 ); + array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY % -0", Number.NaN, Number.POSITIVE_INFINITY % -0 ); + array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY % -0", Number.NaN, Number.NEGATIVE_INFINITY % -0 ); + + array[item++] = new TestCase( SECTION, "65 % 0", Number.NaN, 65 % 0 ); + array[item++] = new TestCase( SECTION, "-866.65 % 0", Number.NaN, -866.65 % 0 ); + array[item++] = new TestCase( SECTION, "54354 % -0", Number.NaN, 54354 % -0 ); + array[item++] = new TestCase( SECTION, "876.4565 % -0", Number.NaN, 876.4565 % -0 ); + + array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY % 1 ", Number.NaN, Number.NEGATIVE_INFINITY % 1 ); + array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY % -1 ", Number.NaN, Number.NEGATIVE_INFINITY % -1 ); + array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY % 1 ", Number.NaN, Number.POSITIVE_INFINITY % 1 ); + array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY % -1 ", Number.NaN, Number.POSITIVE_INFINITY % -1 ); + + array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY % Number.MAX_VALUE ", Number.NaN, Number.NEGATIVE_INFINITY % Number.MAX_VALUE ); + array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY % -Number.MAX_VALUE ", Number.NaN, Number.NEGATIVE_INFINITY % -Number.MAX_VALUE ); + array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY % Number.MAX_VALUE ", Number.NaN, Number.POSITIVE_INFINITY % Number.MAX_VALUE ); + array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY % -Number.MAX_VALUE ", Number.NaN, Number.POSITIVE_INFINITY % -Number.MAX_VALUE ); + + // divisor is 0 + array[item++] = new TestCase( SECTION, "0 % -0", Number.NaN, 0 % -0 ); + array[item++] = new TestCase( SECTION, "-0 % 0", Number.NaN, -0 % 0 ); + array[item++] = new TestCase( SECTION, "-0 % -0", Number.NaN, -0 % -0 ); + array[item++] = new TestCase( SECTION, "0 % 0", Number.NaN, 0 % 0 ); + + array[item++] = new TestCase( SECTION, "1 % 0", Number.NaN, 1%0 ); + array[item++] = new TestCase( SECTION, "1 % -0", Number.NaN, 1%-0 ); + array[item++] = new TestCase( SECTION, "-1 % 0", Number.NaN, -1%0 ); + array[item++] = new TestCase( SECTION, "-1 % -0", Number.NaN, -1%-0 ); + + array[item++] = new TestCase( SECTION, "Number.MAX_VALUE % 0", Number.NaN, Number.MAX_VALUE%0 ); + array[item++] = new TestCase( SECTION, "Number.MAX_VALUE % -0", Number.NaN, Number.MAX_VALUE%-0 ); + array[item++] = new TestCase( SECTION, "-Number.MAX_VALUE % 0", Number.NaN, -Number.MAX_VALUE%0 ); + array[item++] = new TestCase( SECTION, "-Number.MAX_VALUE % -0", Number.NaN, -Number.MAX_VALUE%-0 ); + + // If the dividend is finite and the divisor is an infinity, the result equals the dividend. + + array[item++] = new TestCase( SECTION, "1 % Number.NEGATIVE_INFINITY", 1, 1 % Number.NEGATIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "1 % Number.POSITIVE_INFINITY", 1, 1 % Number.POSITIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "-1 % Number.POSITIVE_INFINITY", -1, -1 % Number.POSITIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "-1 % Number.NEGATIVE_INFINITY", -1, -1 % Number.NEGATIVE_INFINITY ); + + array[item++] = new TestCase( SECTION, "Number.MAX_VALUE % Number.NEGATIVE_INFINITY", Number.MAX_VALUE, Number.MAX_VALUE % Number.NEGATIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "Number.MAX_VALUE % Number.POSITIVE_INFINITY", Number.MAX_VALUE, Number.MAX_VALUE % Number.POSITIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "-Number.MAX_VALUE % Number.POSITIVE_INFINITY", -Number.MAX_VALUE, -Number.MAX_VALUE % Number.POSITIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "-Number.MAX_VALUE % Number.NEGATIVE_INFINITY", -Number.MAX_VALUE, -Number.MAX_VALUE % Number.NEGATIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "Number.MIN_VALUE % Number.NEGATIVE_INFINITY", Number.MIN_VALUE, Number.MIN_VALUE % Number.NEGATIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "Number.MIN_VALUE % Number.POSITIVE_INFINITY", Number.MIN_VALUE, Number.MIN_VALUE % Number.POSITIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "-Number.MIN_VALUE % Number.POSITIVE_INFINITY", -Number.MIN_VALUE, -Number.MIN_VALUE % Number.POSITIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "-Number.MIN_VALUE % Number.NEGATIVE_INFINITY", -Number.MIN_VALUE, -Number.MIN_VALUE % Number.NEGATIVE_INFINITY ); + + + array[item++] = new TestCase( SECTION, "0 % Number.POSITIVE_INFINITY", 0, 0 % Number.POSITIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "0 % Number.NEGATIVE_INFINITY", 0, 0 % Number.NEGATIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "-0 % Number.POSITIVE_INFINITY", -0, -0 % Number.POSITIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "-0 % Number.NEGATIVE_INFINITY", -0, -0 % Number.NEGATIVE_INFINITY ); + + // If the dividend is a zero and the divisor is finite, the result is the same as the dividend. + + array[item++] = new TestCase( SECTION, "0 % 1", 0, 0 % 1 ); + array[item++] = new TestCase( SECTION, "0 % -1", 0, 0 % -1 ); + array[item++] = new TestCase( SECTION, "-0 % 1", -0, -0 % 1 ); + array[item++] = new TestCase( SECTION, "-0 % -1", -0, -0 % -1 ); + + // the sign of the result equals the sign of the dividend + + array[item++] = new TestCase( SECTION, "10 % 3", 1, 10 % 3 ); + array[item++] = new TestCase( SECTION, "-10 % 3", -1, -10 % 3 ); + array[item++] = new TestCase( SECTION, "10 % -3", 1, 10 % -3 ); + array[item++] = new TestCase( SECTION, "-10 % -3", -1, -10 % -3 ); + +// In the remaining cases, where neither an infinity, nor a zero, nor NaN is involved, the floating-point remainder r +// from a dividend n and a divisor d is defined by the mathematical relation r = n - (d * q) where q is an integer that +// is negative only if n/d is negative and positive only if n/d is positive, and whose magnitude is as large as +// possible without exceeding the magnitude of the true mathematical quotient of n and d. + + array[item++] = new TestCase( SECTION, "66.6 % 25.4", 15.799999999999997, 66.6 % 25.4 ); + array[item++] = new TestCase( SECTION, "66.6 % -25.4", 15.799999999999997, 66.6 % -25.4); + array[item++] = new TestCase( SECTION, "-66.6 % 25.4", -15.799999999999997, -66.6 % 25.4 ); + array[item++] = new TestCase( SECTION, "-66.6 % -25.4", -15.799999999999997, -66.6 % -25.4 ); + + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_6_1_1.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_6_1_1.as new file mode 100644 index 00000000000..970643898d3 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_6_1_1.as @@ -0,0 +1,144 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "e11_6_1_1"; + var VERSION = "ECMA_1"; + startTest(); + + var testcases = getTestCases(); + + writeHeaderToLog( SECTION + " The Addition operator ( + )"); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // tests for boolean primitive, boolean object, Object object, a "MyObject" whose value is + // a boolean primitive and a boolean object, + var EXP_1 = true; var EXP_2 = false; + array[item++] = new TestCase( SECTION, + "var EXP_1 = true; var EXP_2 = false; EXP_1 + EXP_2", + 1, + EXP_1 + EXP_2 ); + var EXP_1 = new Boolean(true); var EXP_2 = new Boolean(false); + array[item++] = new TestCase( SECTION, + "var EXP_1 = new Boolean(true); var EXP_2 = new Boolean(false); EXP_1 + EXP_2", + 1, + EXP_1 + EXP_2 ); + var EXP_1 = new Object(true); var EXP_2 = new Object(false); + array[item++] = new TestCase( SECTION, + "var EXP_1 = new Object(true); var EXP_2 = new Object(false); EXP_1 + EXP_2", + 1, + EXP_1 + EXP_2 ); + var EXP_1 = new Object(new Boolean(true)); var EXP_2 = new Object(new Boolean(false)); + array[item++] = new TestCase( SECTION, + "var EXP_1 = new Object(new Boolean(true)); var EXP_2 = new Object(new Boolean(false)); EXP_1 + EXP_2", + 1, + EXP_1 + EXP_2 ); + var EXP_1 = new MyObject(true); var EXP_2 = new MyObject(false); + array[item++] = new TestCase( SECTION, + "var EXP_1 = new MyObject(true); var EXP_2 = new MyObject(false); EXP_1 + EXP_2", + 1, + EXP_1 + EXP_2 ); + var EXP_1 = new MyObject(new Boolean(true)); var EXP_2 = new MyObject(new Boolean(false)); + array[item++] = new TestCase( SECTION, + "var EXP_1 = new MyObject(new Boolean(true)); var EXP_2 = new MyObject(new Boolean(false)); EXP_1 + EXP_2", + 1, + EXP_1 + EXP_2 ); + //var EXP_1 = new MyValuelessObject(true); var EXP_2 = new MyValuelessObject(false); + //array[item++] = new TestCase( SECTION, + // "var EXP_1 = new MyValuelessObject(true); var EXP_2 = new MyValuelessObject(false); EXP_1 + EXP_2", + // 1, + // EXP_1 + EXP_2 ); + //var EXP_1 = new MyValuelessObject(new Boolean(true)); var EXP_2 = new MyValuelessObject(new Boolean(false)); + //array[item++] = new TestCase( SECTION, + // "var EXP_1 = new MyValuelessObject(new Boolean(true)); var EXP_2 = new MyValuelessObject(new Boolean(false)); EXP_1 + EXP_2", + // "truefalse", + // EXP_1 + EXP_2 ); + + // tests for number primitive, number object, Object object, a "MyObject" whose value is + // a number primitive and a number object + var EXP_1 = 100; var EXP_2 = -1; + array[item++] = new TestCase( SECTION, + "var EXP_1 = 100; var EXP_2 = -1; EXP_1 + EXP_2", + 99, + EXP_1 + EXP_2 ); + var EXP_1 = new Number(100); var EXP_2 = new Number(-1); + array[item++] = new TestCase( SECTION, + "var EXP_1 = new Number(100); var EXP_2 = new Number(-1); EXP_1 + EXP_2", + 99, + EXP_1 + EXP_2 ); + var EXP_1 = new Object(100); var EXP_2 = new Object(-1); + array[item++] = new TestCase( SECTION, + "var EXP_1 = new Object(100); var EXP_2 = new Object(-1); EXP_1 + EXP_2", + 99, + EXP_1 + EXP_2 ); + var EXP_1 = new Object(new Number(100)); var EXP_2 = new Object(new Number(-1)); + array[item++] = new TestCase( SECTION, + "var EXP_1 = new Object(new Number(100)); var EXP_2 = new Object(new Number(-1)); EXP_1 + EXP_2", + 99, + EXP_1 + EXP_2 ); + var EXP_1 = new MyObject(100); var EXP_2 = new MyObject(-1); + array[item++] = new TestCase( SECTION, + "var EXP_1 = new MyObject(100); var EXP_2 = new MyObject(-1); EXP_1 + EXP_2", + 99, + EXP_1 + EXP_2 ); + var EXP_1 = new MyObject(new Number(100)); var EXP_2 = new MyObject(new Number(-1)); + array[item++] = new TestCase( SECTION, + "var EXP_1 = new MyObject(new Number(100)); var EXP_2 = new MyObject(new Number(-1)); EXP_1 + EXP_2", + 99, + EXP_1 + EXP_2 ); + + //var EXP_1 = new MyValuelessObject(100); var EXP_2 = new MyValuelessObject(-1); + //array[item++] = new TestCase( SECTION, + // "var EXP_1 = new MyValuelessObject(100); var EXP_2 = new MyValuelessObject(-1); EXP_1 + EXP_2", + // 99, + // EXP_1 + EXP_2 ); + //var EXP_1 = new MyValuelessObject(new Number(100)); var EXP_2 = new MyValuelessObject(new Number(-1)); + //array[item++] = new TestCase( SECTION, + // "var EXP_1 = new MyValuelessObject(new Number(100)); var EXP_2 = new MyValuelessObject(new Number(-1)); EXP_1 + EXP_2", + // "100-1", + // EXP_1 + EXP_2 ); + //var EXP_1 = new MyValuelessObject( new MyValuelessObject( new Boolean(true) ) ); + //array[item++] = new TestCase( SECTION, + // "var EXP_1 = new MyValuelessObject( new MyValuelessObject( new Boolean(true) ) ); EXP_1 + EXP_1", + // "truetrue", + // EXP_1 + EXP_1 ); + // + return ( array ); +} + +function MyObject( value ) { + this.toString = function(){return this.value + ''}; + this.valueOf = function(){return this.value}; + this.value = value; +} + diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_6_1_2.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_6_1_2.as new file mode 100644 index 00000000000..97d5279db53 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_6_1_2.as @@ -0,0 +1,166 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "e11_6_1_2"; + var VERSION = "ECMA_1"; + startTest(); + + var testcases = getTestCases(); + + writeHeaderToLog( SECTION + " The Addition operator ( + )"); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // tests for boolean primitive, boolean object, Object object, a "MyObject" whose value is + // a boolean primitive and a boolean object + var EXP_1 = 'string'; var EXP_2 = false; + array[item++] = new TestCase( SECTION, + "var EXP_1 = 'string'; var EXP_2 = false; EXP_1 + EXP_2", + "stringfalse", + EXP_1 + EXP_2 ); + var EXP_1 = true; var EXP_2 = 'string'; + array[item++] = new TestCase( SECTION, + "var EXP_1 = true; var EXP_2 = 'string'; EXP_1 + EXP_2", + "truestring", + EXP_1 + EXP_2 ); + var EXP_1 = new Boolean(true); var EXP_2 = new String('string'); + array[item++] = new TestCase( SECTION, + "var EXP_1 = new Boolean(true); var EXP_2 = new String('string'); EXP_1 + EXP_2", + "truestring", + EXP_1 + EXP_2 ); + var EXP_1 = new Object(true); var EXP_2 = new Object('string'); + array[item++] = new TestCase( SECTION, + "var EXP_1 = new Object(true); var EXP_2 = new Object('string'); EXP_1 + EXP_2", + "truestring", + EXP_1 + EXP_2 ); + var EXP_1 = new Object(new String('string')); var EXP_2 = new Object(new Boolean(false)); + array[item++] = new TestCase( SECTION, + "var EXP_1 = new Object(new String('string')); var EXP_2 = new Object(new Boolean(false)); EXP_1 + EXP_2", + "stringfalse", + EXP_1 + EXP_2 ); + var EXP_1 = new MyObject(true); var EXP_2 = new MyObject('string'); + array[item++] = new TestCase( SECTION, + "var EXP_1 = new MyObject(true); var EXP_2 = new MyObject('string'); EXP_1 + EXP_2", + "truestring", + EXP_1 + EXP_2 ); + var EXP_1 = new MyObject(new String('string')); var EXP_2 = new MyObject(new Boolean(false)); + array[item++] = new TestCase( SECTION, + "var EXP_1 = new MyObject(new String('string')); var EXP_2 = new MyObject(new Boolean(false)); EXP_1 + EXP_2", + "stringfalse", + EXP_1 + EXP_2 ); + //var EXP_1 = new MyValuelessObject('string'); var EXP_2 = new MyValuelessObject(false); + //array[item++] = new TestCase( SECTION, + // "var EXP_1 = new MyValuelessObject('string'); var EXP_2 = new MyValuelessObject(false); EXP_1 + EXP_2", + // "stringfalse", + // EXP_1 + EXP_2 ); + //var EXP_1 = new MyValuelessObject(new String('string')); var EXP_2 = new MyValuelessObject(new Boolean(false)); + //array[item++] = new TestCase( SECTION, + // "var EXP_1 = new MyValuelessObject(new String('string')); var EXP_2 = new MyValuelessObject(new Boolean(false)); EXP_1 + EXP_2", + // "stringfalse", + // EXP_1 + EXP_2 ); + + // tests for number primitive, number object, Object object, a "MyObject" whose value is + // a number primitive and a number object + var EXP_1 = 100; var EXP_2 = 'string'; + array[item++] = new TestCase( SECTION, + "var EXP_1 = 100; var EXP_2 = 'string'; EXP_1 + EXP_2", + "100string", + EXP_1 + EXP_2 ); + var EXP_1 = new String('string'); var EXP_2 = new Number(-1); + array[item++] = new TestCase( SECTION, + "var EXP_1 = new String('string'); var EXP_2 = new Number(-1); EXP_1 + EXP_2", + "string-1", + EXP_1 + EXP_2 ); + var EXP_1 = new Object(100); var EXP_2 = new Object('string'); + array[item++] = new TestCase( SECTION, + "var EXP_1 = new Object(100); var EXP_2 = new Object('string'); EXP_1 + EXP_2", + "100string", + EXP_1 + EXP_2 ); + var EXP_1 = new Object(new String('string')); var EXP_2 = new Object(new Number(-1)); + array[item++] = new TestCase( SECTION, + "var EXP_1 = new Object(new String('string')); var EXP_2 = new Object(new Number(-1)); EXP_1 + EXP_2", + "string-1", + EXP_1 + EXP_2 ); + + var EXP_1 = new MyObject(100); var EXP_2 = new MyObject('string'); + array[item++] = new TestCase( SECTION, + "var EXP_1 = new MyObject(100); var EXP_2 = new MyObject('string'); EXP_1 + EXP_2", + "100string", + EXP_1 + EXP_2 ); + var EXP_1 = new MyObject(new String('string')); var EXP_2 = new MyObject(new Number(-1)); + array[item++] = new TestCase( SECTION, + "var EXP_1 = new MyObject(new String('string')); var EXP_2 = new MyObject(new Number(-1)); EXP_1 + EXP_2", + "string-1", + EXP_1 + EXP_2 ); + //var EXP_1 = new MyValuelessObject(100); var EXP_2 = new MyValuelessObject('string'); + //array[item++] = new TestCase( SECTION, + // "var EXP_1 = new MyValuelessObject(100); var EXP_2 = new MyValuelessObject('string'); EXP_1 + EXP_2", + // "100string", + // EXP_1 + EXP_2 ); + //var EXP_1 = new MyValuelessObject(new String('string')); var EXP_2 = new MyValuelessObject(new Number(-1)); + //array[item++] = new TestCase( SECTION, + // "var EXP_1 = new MyValuelessObject(new String('string')); var EXP_2 = new MyValuelessObject(new Number(-1)); EXP_1 + EXP_2", + // "string-1", + // EXP_1 + EXP_2 ); + return ( array ); +} + +// cn: __proto__ is not ecma3 compliant +/* +function MyProtoValuelessObject() { +//this.valueOf = new Function ( "" ); + this.valueOf = function (){""}; + this.__proto__ = null; +} +function MyProtolessObject( value ) { +//this.valueOf = new Function( "return this.value" ); + this.valueOf = function(){return this.value}; + this.__proto__ = null; + this.value = value; +} +function MyValuelessObject(value) { + this.__proto__ = new MyPrototypeObject(value); +} +*/ +function MyPrototypeObject(value) { +// this.valueOf = new Function( "return this.value;" ); + // this.toString = new Function( "return (this.value + '');" ); + this.valueOf = function(){return this.value}; + this.toString = function(){return this.value + ''}; + this.value = value; +} +function MyObject( value ) { +//this.valueOf = new Function( "return this.value" ); + this.valueOf = function(){return this.value}; + this.value = value; +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_6_1_3.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_6_1_3.as new file mode 100644 index 00000000000..7d1c05f364b --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_6_1_3.as @@ -0,0 +1,142 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "e11_6_1_3"; + var VERSION = "ECMA_1"; + startTest(); + var testcases = getTestCases(); + + writeHeaderToLog( SECTION + " The Addition operator ( + )"); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // tests for boolean primitive, boolean object, Object object, a "MyObject" whose value is + // a boolean primitive and a boolean object, + + var DATE1 = new Date(0); + + array[item++] = new TestCase( SECTION, + "var DATE1 = new Date(); DATE1 + DATE1", + DATE1.toString() + DATE1.toString(), + DATE1 + DATE1 ); + + array[item++] = new TestCase( SECTION, + "var DATE1 = new Date(); DATE1 + 0", + DATE1.toString() + 0, + DATE1 + 0 ); + + array[item++] = new TestCase( SECTION, + "var DATE1 = new Date(); DATE1 + new Number(0)", + DATE1.toString() + 0, + DATE1 + new Number(0) ); + + array[item++] = new TestCase( SECTION, + "var DATE1 = new Date(); DATE1 + true", + DATE1.toString() + "true", + DATE1 + true ); + + array[item++] = new TestCase( SECTION, + "var DATE1 = new Date(); DATE1 + new Boolean(true)", + DATE1.toString() + "true", + DATE1 + new Boolean(true) ); + + array[item++] = new TestCase( SECTION, + "var DATE1 = new Date(); DATE1 + new Boolean(true)", + DATE1.toString() + "true", + DATE1 + new Boolean(true) ); + + var MYOB1 = new MyObject( DATE1 ); + var MYOB2 = new MyValuelessObject( DATE1 ); + //var MYOB3 = new MyProtolessObject( DATE1 ); + //var MYOB4 = new MyProtoValuelessObject( DATE1 ); + + array[item++] = new TestCase( SECTION, + "MYOB1 = new MyObject(DATE1); MYOB1 + new Number(1)", + "[object Object]1", + MYOB1 + new Number(1) ); + + array[item++] = new TestCase( SECTION, + "MYOB1 = new MyObject(DATE1); MYOB1 + 1", + "[object Object]1", + MYOB1 + 1 ); + +/* array[item++] = new TestCase( SECTION, + "MYOB2 = new MyValuelessObject(DATE1); MYOB3 + 'string'", + DATE1.toString() + "string", + MYOB2 + 'string' ); + + array[item++] = new TestCase( SECTION, + "MYOB2 = new MyValuelessObject(DATE1); MYOB3 + new String('string')", + DATE1.toString() + "string", + MYOB2 + new String('string') ); + + array[item++] = new TestCase( SECTION, + "MYOB3 = new MyProtolessObject(DATE1); MYOB3 + new Boolean(true)", + DATE1.toString() + "true", + MYOB3 + new Boolean(true) ); +*/ + array[item++] = new TestCase( SECTION, + "MYOB1 = new MyObject(DATE1); MYOB1 + true", + "[object Object]true", + MYOB1 + true ); + + return ( array ); +} + +/* cn: __proto__ is not ecma3 compliant + +function MyProtoValuelessObject() { +//this.valueOf = new Function ( "" ); + this.valueOf = function (){ ""}; + this.__proto__ = null; +} +function MyProtolessObject( value ) { +// this.valueOf = new Function( "return this.value" ); + this.valueOf = function(){return this.value}; + this.__proto__ = null; + this.value = value; +} +*/ +function MyValuelessObject(value) { + //this.__proto__ = new MyPrototypeObject(value); + this.constructor.prototype = new MyPrototypeObject(value); +} +function MyPrototypeObject(value) { + this.valueOf = function(){return this.value}; + this.toString = function(){return this.value + ''}; + this.value = value; +} +function MyObject( value ) { + this.valueOf = function(){return this.value}; + this.value = value; +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_6_2_1.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_6_2_1.as new file mode 100644 index 00000000000..f6ffa770e8b --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_6_2_1.as @@ -0,0 +1,175 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "e11_6_2_1"; + var VERSION = "ECMA_1"; + startTest(); + var testcases = getTestCases(); + + writeHeaderToLog( SECTION + " The subtraction operator ( - )"); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // tests for boolean primitive, boolean object, Object object, a "MyObject" whose value is + // a boolean primitive and a boolean object, and "MyValuelessObject", where the value is + // set in the object's prototype, not the object itself. + var EXP_1 = true; var EXP_2 = false; + array[item++] = new TestCase( SECTION, + "var EXP_1 = true; var EXP_2 = false; EXP_1 - EXP_2", + 1, + EXP_1 - EXP_2 ); + var EXP_1 = new Boolean(true); var EXP_2 = new Boolean(false); + array[item++] = new TestCase( SECTION, + "var EXP_1 = new Boolean(true); var EXP_2 = new Boolean(false); EXP_1 - EXP_2", + 1, + EXP_1 - EXP_2 ); + var EXP_1 = new Object(true); var EXP_2 = new Object(false); + array[item++] = new TestCase( SECTION, + "var EXP_1 = new Object(true); var EXP_2 = new Object(false); EXP_1 - EXP_2", + 1, + EXP_1 - EXP_2 ); + var EXP_1 = new Object(new Boolean(true)); var EXP_2 = new Object(new Boolean(false)); + array[item++] = new TestCase( SECTION, + "var EXP_1 = new Object(new Boolean(true)); var EXP_2 = new Object(new Boolean(false)); EXP_1 - EXP_2", + 1, + EXP_1 - EXP_2 ); + var EXP_1 = new MyObject(true); var EXP_2 = new MyObject(false); + array[item++] = new TestCase( SECTION, + "var EXP_1 = new MyObject(true); var EXP_2 = new MyObject(false); EXP_1 - EXP_2", + 1, + EXP_1 - EXP_2 ); + var EXP_1 = new MyObject(new Boolean(true)); var EXP_2 = new MyObject(new Boolean(false)); + array[item++] = new TestCase( SECTION, + "var EXP_1 = new MyObject(new Boolean(true)); var EXP_2 = new MyObject(new Boolean(false)); EXP_1 - EXP_2", + 1, + EXP_1 - EXP_2 ); + var EXP_1 = new MyOtherObject(new Boolean(true)); var EXP_2 = new MyOtherObject(new Boolean(false)); + array[item++] = new TestCase( SECTION, + "var EXP_1 = new MyOtherObject(new Boolean(true)); var EXP_2 = new MyOtherObject(new Boolean(false)); EXP_1 - EXP_2", + 1, + EXP_1 - EXP_2 ); + var EXP_1 = new MyValuelessObject(true); + var EXP_2 = new MyValuelessObject(false); + array[item++] = new TestCase( SECTION, + "var EXP_1 = new MyValuelessObject(true); var EXP_2 = new MyValuelessObject(false); EXP_1 - EXP_2", + NaN, + EXP_1 - EXP_2 ); + var EXP_1 = new MyValuelessObject(new Boolean(true)); + var EXP_2 = new MyValuelessObject(new Boolean(false)); + array[item++] = new TestCase( SECTION, + "var EXP_1 = new MyValuelessObject(new Boolean(true)); var EXP_2 = new MyValuelessObject(new Boolean(false)); EXP_1 - EXP_2", + 0, // true - true = 0 not NaN + EXP_1 - EXP_2 ); + + // tests for number primitive, number object, Object object, a "MyObject" whose value is + // a number primitive and a number object, and "MyValuelessObject", where the value is + // set in the object's prototype, not the object itself. + var EXP_1 = 100; var EXP_2 = 1; + array[item++] = new TestCase( SECTION, + "var EXP_1 = 100; var EXP_2 = 1; EXP_1 - EXP_2", + 99, + EXP_1 - EXP_2 ); + var EXP_1 = new Number(100); + var EXP_2 = new Number(1); + array[item++] = new TestCase( SECTION, + "var EXP_1 = new Number(100); var EXP_2 = new Number(1); EXP_1 - EXP_2", + 99, + EXP_1 - EXP_2 ); + var EXP_1 = new Object(100); + var EXP_2 = new Object(1); + array[item++] = new TestCase( SECTION, + "var EXP_1 = new Object(100); var EXP_2 = new Object(1); EXP_1 - EXP_2", + 99, + EXP_1 - EXP_2 ); + var EXP_1 = new Object(new Number(100)); var EXP_2 = new Object(new Number(1)); + array[item++] = new TestCase( SECTION, + "var EXP_1 = new Object(new Number(100)); var EXP_2 = new Object(new Number(1)); EXP_1 - EXP_2", + 99, + EXP_1 - EXP_2 ); + var EXP_1 = new MyObject(100); var EXP_2 = new MyObject(1); + array[item++] = new TestCase( SECTION, + "var EXP_1 = new MyObject(100); var EXP_2 = new MyObject(1); EXP_1 - EXP_2", + 99, + EXP_1 - EXP_2 ); + var EXP_1 = new MyObject(new Number(100)); + var EXP_2 = new MyObject(new Number(1)); + array[item++] = new TestCase( SECTION, + "var EXP_1 = new MyObject(new Number(100)); var EXP_2 = new MyObject(new Number(1)); EXP_1 - EXP_2", + 99, + EXP_1 - EXP_2 ); + var EXP_1 = new MyOtherObject(new Number(100)); var EXP_2 = new MyOtherObject(new Number(1)); + array[item++] = new TestCase( SECTION, + "var EXP_1 = new MyOtherObject(new Number(100)); var EXP_2 = new MyOtherObject(new Number(1)); EXP_1 - EXP_2", + 99, + EXP_1 - EXP_2 ); + var EXP_1 = new MyValuelessObject(100); + var EXP_2 = new MyValuelessObject(1); + array[item++] = new TestCase( SECTION, + "var EXP_1 = new MyValuelessObject(100); var EXP_2 = new MyValuelessObject(1); EXP_1 - EXP_2", + 0, + EXP_1 - EXP_2 ); + // same thing with string! + var EXP_1 = new MyOtherObject(new String('0xff')); var EXP_2 = new MyOtherObject(new String('1')); + array[item++] = new TestCase( SECTION, + "var EXP_1 = new MyOtherObject(new String('0xff')); var EXP_2 = new MyOtherObject(new String('1'); EXP_1 - EXP_2", + 254, + EXP_1 - EXP_2 ); + + return ( array ); +} +function MyProtoValuelessObject() { + this.valueOf = function (){ "" }; + this.constructor.prototype = null; +} +function MyProtolessObject( value ) { + this.valueOf = function(){return this.value}; + this.constructor.prototype= null; + this.value = value; +} +function MyValuelessObject(value) { + this.constructor.prototype= new MyPrototypeObject(value); +} +function MyPrototypeObject(value) { + this.valueOf = function(){return this.value}; + this.toString = function(){return this.value + ''}; + this.value = value; +} +function MyObject( value ) { + this.valueOf = function( ){return this.value}; + this.value = value; +} +function MyOtherObject( value ) { + this.valueOf = function( ) { return this.value; }; + this.toString = function( ) { return this.value + ''; }; + this.value = value; +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_6_3.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_6_3.as new file mode 100644 index 00000000000..77b87910b10 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_6_3.as @@ -0,0 +1,98 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "e11_6_3"; + var VERSION = "ECMA_1"; + startTest(); + var testcases = getTestCases(); + + writeHeaderToLog( SECTION + " Applying the additive operators (+,-) to numbers"); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "Number.NaN + 1", Number.NaN, Number.NaN + 1 ); + array[item++] = new TestCase( SECTION, "1 + Number.NaN", Number.NaN, 1 + Number.NaN ); + + array[item++] = new TestCase( SECTION, "Number.NaN - 1", Number.NaN, Number.NaN - 1 ); + array[item++] = new TestCase( SECTION, "1 - Number.NaN", Number.NaN, 1 - Number.NaN ); + + array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY + Number.POSITIVE_INFINITY", Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY + Number.POSITIVE_INFINITY); + array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY + Number.NEGATIVE_INFINITY", Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY + Number.NEGATIVE_INFINITY); + + array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY + Number.NEGATIVE_INFINITY", Number.NaN, Number.POSITIVE_INFINITY + Number.NEGATIVE_INFINITY); + array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY + Number.POSITIVE_INFINITY", Number.NaN, Number.NEGATIVE_INFINITY + Number.POSITIVE_INFINITY); + + array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY - Number.POSITIVE_INFINITY", Number.NaN, Number.POSITIVE_INFINITY - Number.POSITIVE_INFINITY); + array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY - Number.NEGATIVE_INFINITY", Number.NaN, Number.NEGATIVE_INFINITY - Number.NEGATIVE_INFINITY); + + array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY - Number.NEGATIVE_INFINITY", Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY - Number.NEGATIVE_INFINITY); + array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY - Number.POSITIVE_INFINITY", Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY - Number.POSITIVE_INFINITY); + + array[item++] = new TestCase( SECTION, "-0 + -0", -0, -0 + -0 ); + array[item++] = new TestCase( SECTION, "-0 - 0", -0, -0 - 0 ); + + array[item++] = new TestCase( SECTION, "0 + 0", 0, 0 + 0 ); + array[item++] = new TestCase( SECTION, "0 + -0", 0, 0 + -0 ); + array[item++] = new TestCase( SECTION, "0 - -0", 0, 0 - -0 ); + array[item++] = new TestCase( SECTION, "0 - 0", 0, 0 - 0 ); + array[item++] = new TestCase( SECTION, "-0 - -0", 0, -0 - -0 ); + array[item++] = new TestCase( SECTION, "-0 + 0", 0, -0 + 0 ); + + array[item++] = new TestCase( SECTION, "Number.MAX_VALUE - Number.MAX_VALUE", 0, Number.MAX_VALUE - Number.MAX_VALUE ); + array[item++] = new TestCase( SECTION, "1/Number.MAX_VALUE - 1/Number.MAX_VALUE", 0, 1/Number.MAX_VALUE - 1/Number.MAX_VALUE ); + + array[item++] = new TestCase( SECTION, "Number.MIN_VALUE - Number.MIN_VALUE", 0, Number.MIN_VALUE - Number.MIN_VALUE ); + +// the sum of an infinity and a finite value is equal to the infinite operand + array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY + 543.87", Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY + 543.87); + array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY + 87456.093", Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY + 87456.093); + array[item++] = new TestCase( SECTION, "95665 + Number.POSITIVE_INFINITY ", Number.POSITIVE_INFINITY, 95665 + Number.POSITIVE_INFINITY); + array[item++] = new TestCase( SECTION, "32.543906 + Number.NEGATIVE_INFINITY ", Number.NEGATIVE_INFINITY, 32.543906 + Number.NEGATIVE_INFINITY); + +// the sum of a zero and a nonzero finite value is equal to the nonzero operand + array[item++] = new TestCase( SECTION, "0 + 40453.65", 40453.65, 0 + 40453.65 ); + array[item++] = new TestCase( SECTION, "0 - 745.33", -745.33, 0 - 745.33); + array[item++] = new TestCase( SECTION, "67007.5 + 0", 67007.5 , 67007.5 + 0 ); + array[item++] = new TestCase( SECTION, "2480.00 - 0", 2480.00 , 2480.00 - 0 ); + +// the sum of two nonzero finite values of the same magnitude and opposite sign is +0 + array[item++] = new TestCase( SECTION, "2480.00 + -2480.00", +0 , 2480.00 + -2480.00 ); + array[item++] = new TestCase( SECTION, "-268.05 + 268.05", +0 , -268.05 + 268.05 ); + + array[item++] = new TestCase( SECTION, "Number.MAX_VALUE + 1", "1.79769313486231e+308", Number.MAX_VALUE + 1+""); + array[item++] = new TestCase( SECTION, "Number.MAX_VALUE + 99.99", "1.79769313486231e+308", Number.MAX_VALUE + 99.99+"" ); + array[item++] = new TestCase( SECTION, "4324.43 + (-64.000503)", 4260.429497, 4324.43 + (-64.000503) ); + + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_7_1.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_7_1.as new file mode 100644 index 00000000000..b17c8673991 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_7_1.as @@ -0,0 +1,200 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "e11_7_1"; + var VERSION = "ECMA_1"; + startTest(); + + var testcases = getTestCases(); + + writeHeaderToLog( SECTION + " The left shift operator ( << )"); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + for ( power = 0; power < 33; power++ ) { + shiftexp = Math.pow( 2, power ); + + for ( addexp = 0; addexp < 33; addexp++ ) { + array[item++] = new TestCase( SECTION, + shiftexp + " << " + addexp, + LeftShift( shiftexp, addexp ), + shiftexp << addexp ); + } + } + + return ( array ); +} +function ToInteger( n ) { + n = Number( n ); + var sign = ( n < 0 ) ? -1 : 1; + + if ( n != n ) { + return 0; + } + if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY ) { + return n; + } + return ( sign * Math.floor(Math.abs(n)) ); +} +function ToInt32( n ) { + n = Number( n ); + var sign = ( n < 0 ) ? -1 : 1; + + if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY) { + return 0; + } + + n = (sign * Math.floor( Math.abs(n) )) % Math.pow(2,32); + n = ( n >= Math.pow(2,31) ) ? n - Math.pow(2,32) : n; + + return ( n ); +} +function ToUint32( n ) { + n = Number( n ); + var sign = ( n < 0 ) ? -1 : 1; + + if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY) { + return 0; + } + n = sign * Math.floor( Math.abs(n) ) + + n = n % Math.pow(2,32); + + if ( n < 0 ){ + n += Math.pow(2,32); + } + + return ( n ); +} +function ToUint16( n ) { + var sign = ( n < 0 ) ? -1 : 1; + + if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY) { + return 0; + } + + n = ( sign * Math.floor( Math.abs(n) ) ) % Math.pow(2,16); + + if (n <0) { + n += Math.pow(2,16); + } + + return ( n ); +} +function Mask( b, n ) { + b = ToUint32BitString( b ); + b = b.substring( b.length - n ); + b = ToUint32Decimal( b ); + return ( b ); +} +function ToUint32BitString( n ) { + var b = ""; + for ( p = 31; p >=0; p-- ) { + if ( n >= Math.pow(2,p) ) { + b += "1"; + n -= Math.pow(2,p); + } else { + b += "0"; + } + } + return b; +} +function ToInt32BitString( n ) { + var b = ""; + var sign = ( n < 0 ) ? -1 : 1; + + b += ( sign == 1 ) ? "0" : "1"; + + for ( p = 30; p >=0; p-- ) { + if ( (sign == 1 ) ? sign * n >= Math.pow(2,p) : sign * n > Math.pow(2,p) ) { + b += ( sign == 1 ) ? "1" : "0"; + n -= sign * Math.pow( 2, p ); + } else { + b += ( sign == 1 ) ? "0" : "1"; + } + } + + return b; +} +function ToInt32Decimal( bin ) { + var r = 0; + var sign; + + if ( Number(bin.charAt(0)) == 0 ) { + sign = 1; + r = 0; + } else { + sign = -1; + r = -(Math.pow(2,31)); + } + + for ( var j = 0; j < 31; j++ ) { + r += Math.pow( 2, j ) * Number(bin.charAt(31-j)); + } + + return r; +} +function ToUint32Decimal( bin ) { + var r = 0; + + + for ( l = bin.length; l < 32; l++ ) { + bin = "0" + bin; + } + + for ( j = 0; j < 31; j++ ) { + r += Math.pow( 2, j ) * Number(bin.charAt(31-j)); + + } + + return r; +} +function LeftShift( s, a ) { + var shift = ToInt32( s ); + var add = ToUint32( a ); + add = Mask( add, 5 ); + var exp = LShift( shift, add ); + + return ( exp ); +} +function LShift( s, a ) { + s = ToInt32BitString( s ); + + for ( var z = 0; z < a; z++ ) { + s += "0"; + } + + s = s.substring( a, s.length); + + return ToInt32(ToInt32Decimal(s)); +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_7_2.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_7_2.as new file mode 100644 index 00000000000..e0ab1bb97ea --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_7_2.as @@ -0,0 +1,216 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "e11_7_2"; + var VERSION = "ECMA_1"; + startTest(); + var testcases = getTestCases(); + + writeHeaderToLog( SECTION + " The signed right shift operator ( >> )"); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + var power = 0; + var addexp = 0; + + for ( power = 0; power <= 32; power++ ) { + shiftexp = Math.pow( 2, power ); + + for ( addexp = 0; addexp <= 32; addexp++ ) { + array[item++] = new TestCase( SECTION, + shiftexp + " >> " + addexp, + SignedRightShift( shiftexp, addexp ), + shiftexp >> addexp ); + } + } + + for ( power = 0; power <= 32; power++ ) { + shiftexp = -Math.pow( 2, power ); + + for ( addexp = 0; addexp <= 32; addexp++ ) { + array[item++] = new TestCase( SECTION, + shiftexp + " >> " + addexp, + SignedRightShift( shiftexp, addexp ), + shiftexp >> addexp ); + } + } + + return ( array ); +} + +function ToInteger( n ) { + n = Number( n ); + var sign = ( n < 0 ) ? -1 : 1; + + if ( n != n ) { + return 0; + } + if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY ) { + return n; + } + return ( sign * Math.floor(Math.abs(n)) ); +} +function ToInt32( n ) { + n = Number( n ); + var sign = ( n < 0 ) ? -1 : 1; + + if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY) { + return 0; + } + + n = (sign * Math.floor( Math.abs(n) )) % Math.pow(2,32); + n = ( n >= Math.pow(2,31) ) ? n - Math.pow(2,32) : n; + + return ( n ); +} +function ToUint32( n ) { + n = Number( n ); + var sign = ( n < 0 ) ? -1 : 1; + + if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY) { + return 0; + } + n = sign * Math.floor( Math.abs(n) ) + + n = n % Math.pow(2,32); + + if ( n < 0 ){ + n += Math.pow(2,32); + } + + return ( n ); +} +function ToUint16( n ) { + var sign = ( n < 0 ) ? -1 : 1; + + if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY) { + return 0; + } + + n = ( sign * Math.floor( Math.abs(n) ) ) % Math.pow(2,16); + + if (n <0) { + n += Math.pow(2,16); + } + + return ( n ); +} +function Mask( b, n ) { + b = ToUint32BitString( b ); + b = b.substring( b.length - n ); + b = ToUint32Decimal( b ); + return ( b ); +} +function ToUint32BitString( n ) { + var b = ""; + for ( p = 31; p >=0; p-- ) { + if ( n >= Math.pow(2,p) ) { + b += "1"; + n -= Math.pow(2,p); + } else { + b += "0"; + } + } + return b; +} +function ToInt32BitString( n ) { + var b = ""; + var sign = ( n < 0 ) ? -1 : 1; + + b += ( sign == 1 ) ? "0" : "1"; + + for ( p = 30; p >=0; p-- ) { + if ( (sign == 1 ) ? sign * n >= Math.pow(2,p) : sign * n > Math.pow(2,p) ) { + b += ( sign == 1 ) ? "1" : "0"; + n -= sign * Math.pow( 2, p ); + } else { + b += ( sign == 1 ) ? "0" : "1"; + } + } + + return b; +} +function ToInt32Decimal( bin ) { + var r = 0; + var sign; + + if ( Number(bin.charAt(0)) == 0 ) { + sign = 1; + r = 0; + } else { + sign = -1; + r = -(Math.pow(2,31)); + } + + for ( var j = 0; j < 31; j++ ) { + r += Math.pow( 2, j ) * Number(bin.charAt(31-j)); + } + + return r; +} +function ToUint32Decimal( bin ) { + var r = 0; + + for ( l = bin.length; l < 32; l++ ) { + bin = "0" + bin; + } + + for ( j = 0; j < 31; j++ ) { + r += Math.pow( 2, j ) * Number(bin.charAt(31-j)); + } + + return r; +} +function SignedRightShift( s, a ) { + s = ToInt32( s ); + a = ToUint32( a ); + a = Mask( a, 5 ); + return ( SignedRShift( s, a ) ); +} +function SignedRShift( s, a ) { + s = ToInt32BitString( s ); + + var firstbit = s.substring(0,1); + + s = s.substring( 1, s.length ); + + for ( var z = 0; z < a; z++ ) { + s = firstbit + s; + } + + s = s.substring( 0, s.length - a); + + s = firstbit +s; + + + return ToInt32(ToInt32Decimal(s)); +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_7_3.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_7_3.as new file mode 100644 index 00000000000..ed3c9b66465 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_7_3.as @@ -0,0 +1,199 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "e11_7_3"; + var VERSION = "ECMA_1"; + startTest(); + var testcases = getTestCases(); + + writeHeaderToLog( SECTION + " The unsigned right shift operator ( >>> )"); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var addexp = 0; + var power = 0; + + for ( power = 0; power <= 32; power++ ) { + shiftexp = Math.pow( 2, power ); + + for ( addexp = 0; addexp <= 32; addexp++ ) { + array[item++] = new TestCase( SECTION, + shiftexp + " >>> " + addexp, + UnsignedRightShift( shiftexp, addexp ), + shiftexp >>> addexp ); + } + } + + return ( array ); +} + +function ToInteger( n ) { + n = Number( n ); + var sign = ( n < 0 ) ? -1 : 1; + + if ( n != n ) { + return 0; + } + if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY ) { + return n; + } + return ( sign * Math.floor(Math.abs(n)) ); +} +function ToInt32( n ) { + n = Number( n ); + var sign = ( n < 0 ) ? -1 : 1; + + if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY) { + return 0; + } + + n = (sign * Math.floor( Math.abs(n) )) % Math.pow(2,32); + n = ( n >= Math.pow(2,31) ) ? n - Math.pow(2,32) : n; + + return ( n ); +} +function ToUint32( n ) { + n = Number( n ); + var sign = ( n < 0 ) ? -1 : 1; + + if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY) { + return 0; + } + n = sign * Math.floor( Math.abs(n) ) + + n = n % Math.pow(2,32); + + if ( n < 0 ){ + n += Math.pow(2,32); + } + + return ( n ); +} +function ToUint16( n ) { + var sign = ( n < 0 ) ? -1 : 1; + + if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY) { + return 0; + } + + n = ( sign * Math.floor( Math.abs(n) ) ) % Math.pow(2,16); + + if (n <0) { + n += Math.pow(2,16); + } + + return ( n ); +} +function Mask( b, n ) { + b = ToUint32BitString( b ); + b = b.substring( b.length - n ); + b = ToUint32Decimal( b ); + return ( b ); +} +function ToUint32BitString( n ) { + var b = ""; + for ( p = 31; p >=0; p-- ) { + if ( n >= Math.pow(2,p) ) { + b += "1"; + n -= Math.pow(2,p); + } else { + b += "0"; + } + } + return b; +} +function ToInt32BitString( n ) { + var b = ""; + var sign = ( n < 0 ) ? -1 : 1; + + b += ( sign == 1 ) ? "0" : "1"; + + for ( p = 30; p >=0; p-- ) { + if ( (sign == 1 ) ? sign * n >= Math.pow(2,p) : sign * n > Math.pow(2,p) ) { + b += ( sign == 1 ) ? "1" : "0"; + n -= sign * Math.pow( 2, p ); + } else { + b += ( sign == 1 ) ? "0" : "1"; + } + } + + return b; +} +function ToInt32Decimal( bin ) { + var r = 0; + var sign; + + if ( Number(bin.charAt(0)) == 0 ) { + sign = 1; + r = 0; + } else { + sign = -1; + r = -(Math.pow(2,31)); + } + + for ( var j = 0; j < 31; j++ ) { + r += Math.pow( 2, j ) * Number(bin.charAt(31-j)); + } + + return r; +} +function ToUint32Decimal( bin ) { + var r:Number = 0; + + + for ( l = bin.length; l < 32; l++ ) { + bin = "0" + bin; + } + + for ( j = 0; j < 32; j++ ) { + r += Math.pow( 2, j ) * Number(bin.charAt(31-j)); + + } + + return r; +} +function RShift( s, a ) { + s = ToUint32BitString( s ); + for ( z = 0; z < a; z++ ) { + s = "0" + s; + } + s = s.substring( 0, s.length - a ); + + return ToUint32Decimal(s); +} +function UnsignedRightShift( s, a ) { + s = ToUint32( s ); + a = ToUint32( a ); + a = Mask( a, 5 ); + return ( RShift( s, a ) ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_8_1.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_8_1.as new file mode 100644 index 00000000000..caa5c8f4f5b --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_8_1.as @@ -0,0 +1,128 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "e11_8_1"; + var VERSION = "ECMA_1"; + startTest(); + var testcases = getTestCases(); + + writeHeaderToLog( SECTION + " The less-than operator ( < )"); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "true < false", false, true < false ); + array[item++] = new TestCase( SECTION, "false < true", true, false < true ); + array[item++] = new TestCase( SECTION, "false < false", false, false < false ); + array[item++] = new TestCase( SECTION, "true < true", false, true < true ); + + array[item++] = new TestCase( SECTION, "new Boolean(true) < new Boolean(true)", false, new Boolean(true) < new Boolean(true) ); + array[item++] = new TestCase( SECTION, "new Boolean(true) < new Boolean(false)", false, new Boolean(true) < new Boolean(false) ); + array[item++] = new TestCase( SECTION, "new Boolean(false) < new Boolean(true)", true, new Boolean(false) < new Boolean(true) ); + array[item++] = new TestCase( SECTION, "new Boolean(false) < new Boolean(false)", false, new Boolean(false) < new Boolean(false) ); + + array[item++] = new TestCase( SECTION, "new MyObject(Infinity) < new MyObject(Infinity)", false, new MyObject( Number.POSITIVE_INFINITY ) < new MyObject( Number.POSITIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "new MyObject(-Infinity) < new MyObject(Infinity)", true, new MyObject( Number.NEGATIVE_INFINITY ) < new MyObject( Number.POSITIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "new MyObject(-Infinity) < new MyObject(-Infinity)", false, new MyObject( Number.NEGATIVE_INFINITY ) < new MyObject( Number.NEGATIVE_INFINITY) ); + + array[item++] = new TestCase( SECTION, "new MyValueObject(false) < new MyValueObject(true)", true, new MyValueObject(false) < new MyValueObject(true) ); + array[item++] = new TestCase( SECTION, "new MyValueObject(true) < new MyValueObject(true)", false, new MyValueObject(true) < new MyValueObject(true) ); + array[item++] = new TestCase( SECTION, "new MyValueObject(false) < new MyValueObject(false)", false, new MyValueObject(false) < new MyValueObject(false) ); + + array[item++] = new TestCase( SECTION, "new MyStringObject(false) < new MyStringObject(true)", true, new MyStringObject(false) < new MyStringObject(true) ); + array[item++] = new TestCase( SECTION, "new MyStringObject(true) < new MyStringObject(true)", false, new MyStringObject(true) < new MyStringObject(true) ); + array[item++] = new TestCase( SECTION, "new MyStringObject(false) < new MyStringObject(false)", false, new MyStringObject(false) < new MyStringObject(false) ); + + array[item++] = new TestCase( SECTION, "Number.NaN < Number.NaN", false, Number.NaN < Number.NaN ); + array[item++] = new TestCase( SECTION, "0 < Number.NaN", false, 0 < Number.NaN ); + array[item++] = new TestCase( SECTION, "Number.NaN < 0", false, Number.NaN < 0 ); + + array[item++] = new TestCase( SECTION, "0 < -0", false, 0 < -0 ); + array[item++] = new TestCase( SECTION, "-0 < 0", false, -0 < 0 ); + + array[item++] = new TestCase( SECTION, "Infinity < 0", false, Number.POSITIVE_INFINITY < 0 ); + array[item++] = new TestCase( SECTION, "Infinity < Number.MAX_VALUE", false, Number.POSITIVE_INFINITY < Number.MAX_VALUE ); + array[item++] = new TestCase( SECTION, "Infinity < Infinity", false, Number.POSITIVE_INFINITY < Number.POSITIVE_INFINITY ); + + array[item++] = new TestCase( SECTION, "0 < Infinity", true, 0 < Number.POSITIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "Number.MAX_VALUE < Infinity", true, Number.MAX_VALUE < Number.POSITIVE_INFINITY ); + + array[item++] = new TestCase( SECTION, "0 < -Infinity", false, 0 < Number.NEGATIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "Number.MAX_VALUE < -Infinity", false, Number.MAX_VALUE < Number.NEGATIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "-Infinity < -Infinity", false, Number.NEGATIVE_INFINITY < Number.NEGATIVE_INFINITY ); + + array[item++] = new TestCase( SECTION, "-Infinity < 0", true, Number.NEGATIVE_INFINITY < 0 ); + array[item++] = new TestCase( SECTION, "-Infinity < -Number.MAX_VALUE", true, Number.NEGATIVE_INFINITY < -Number.MAX_VALUE ); + array[item++] = new TestCase( SECTION, "-Infinity < Number.MIN_VALUE", true, Number.NEGATIVE_INFINITY < Number.MIN_VALUE ); + + array[item++] = new TestCase( SECTION, "'string' < 'string'", false, 'string' < 'string' ); + array[item++] = new TestCase( SECTION, "'astring' < 'string'", true, 'astring' < 'string' ); + array[item++] = new TestCase( SECTION, "'strings' < 'stringy'", true, 'strings' < 'stringy' ); + array[item++] = new TestCase( SECTION, "'strings' < 'stringier'", false, 'strings' < 'stringier' ); + array[item++] = new TestCase( SECTION, "'string' < 'astring'", false, 'string' < 'astring' ); + array[item++] = new TestCase( SECTION, "'string' < 'strings'", true, 'string' < 'strings' ); + array[item++] = new TestCase( SECTION, "'string' < 'str'", false, 'string' < 'str' ); + + array[item++] = new TestCase( SECTION, "44 < 55", true, 44 < 55 ); + array[item++] = new TestCase( SECTION, "55 < 44", false, 55 < 44 ); + array[item++] = new TestCase( SECTION, "56.43 < 65.0", true, 56.43 < 65.0 ); + array[item++] = new TestCase( SECTION, "65.0 < 56.43", false, 65.0 < 56.43 ); + array[item++] = new TestCase( SECTION, "43247503.43 < 945540654.654", true, 43247503.43 < 945540654.654 ); + array[item++] = new TestCase( SECTION, "43247503.43<945540654.654", true, 43247503.43<945540654.654 ); + array[item++] = new TestCase( SECTION, "43247503.43< 945540654.654", true, 43247503.43< 945540654.654 ); + array[item++] = new TestCase( SECTION, "43247503.43 < 945540654.654", true, 43247503.43 < 945540654.654 ); + array[item++] = new TestCase( SECTION, "-56.43 < 65.0", true, -56.43 < 65.0 ); + array[item++] = new TestCase( SECTION, "-56.43 < -65.0", false, -56.43 < -65.0 ); + var b = (-56.43) < (-56.43); + array[item++] = new TestCase( SECTION, "-56.43 < -56.43", false, b ); + + array[item++] = new TestCase( SECTION, "100 < 100", false, 100 < 100 ); + + return ( array ); +} +function MyObject(value) { + this.value = value; + //this.valueOf = new Function( "return this.value" ); + //this.toString = new Function( "return this.value +''" ); + this.valueOf = function(){return this.value}; + this.toString = function(){return this.value +''}; +} +function MyValueObject(value) { + this.value = value; + //this.valueOf = new Function( "return this.value" ); + this.valueOf = function(){return this.value}; +} +function MyStringObject(value) { + this.value = value; + //this.toString = new Function( "return this.value +''" ); + this.toString = function(){return this.value +'' }; +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_8_2.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_8_2.as new file mode 100644 index 00000000000..da3536eabe1 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_8_2.as @@ -0,0 +1,127 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "e11_8_2"; + var VERSION = "ECMA_1"; + startTest(); + var testcases = getTestCases(); + + writeHeaderToLog( SECTION + " The greater-than operator ( > )"); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "true > false", true, true > false ); + array[item++] = new TestCase( SECTION, "false > true", false, false > true ); + array[item++] = new TestCase( SECTION, "false > false", false, false > false ); + array[item++] = new TestCase( SECTION, "true > true", false, true > true ); + + array[item++] = new TestCase( SECTION, "new Boolean(true) > new Boolean(true)", false, new Boolean(true) > new Boolean(true) ); + array[item++] = new TestCase( SECTION, "new Boolean(true) > new Boolean(false)", true, new Boolean(true) > new Boolean(false) ); + array[item++] = new TestCase( SECTION, "new Boolean(false) > new Boolean(true)", false, new Boolean(false) > new Boolean(true) ); + array[item++] = new TestCase( SECTION, "new Boolean(false) > new Boolean(false)", false, new Boolean(false) > new Boolean(false) ); + + array[item++] = new TestCase( SECTION, "new MyObject(Infinity) > new MyObject(Infinity)", false, new MyObject( Number.POSITIVE_INFINITY ) > new MyObject( Number.POSITIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "new MyObject(-Infinity) > new MyObject(Infinity)", false, new MyObject( Number.NEGATIVE_INFINITY ) > new MyObject( Number.POSITIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "new MyObject(-Infinity) > new MyObject(-Infinity)", false, new MyObject( Number.NEGATIVE_INFINITY ) > new MyObject( Number.NEGATIVE_INFINITY) ); + + array[item++] = new TestCase( SECTION, "new MyValueObject(false) > new MyValueObject(true)", false, new MyValueObject(false) > new MyValueObject(true) ); + array[item++] = new TestCase( SECTION, "new MyValueObject(true) > new MyValueObject(true)", false, new MyValueObject(true) > new MyValueObject(true) ); + array[item++] = new TestCase( SECTION, "new MyValueObject(false) > new MyValueObject(false)", false, new MyValueObject(false) > new MyValueObject(false) ); + + array[item++] = new TestCase( SECTION, "new MyStringObject(false) > new MyStringObject(true)", false, new MyStringObject(false) > new MyStringObject(true) ); + array[item++] = new TestCase( SECTION, "new MyStringObject(true) > new MyStringObject(true)", false, new MyStringObject(true) > new MyStringObject(true) ); + array[item++] = new TestCase( SECTION, "new MyStringObject(false) > new MyStringObject(false)", false, new MyStringObject(false) > new MyStringObject(false) ); + + array[item++] = new TestCase( SECTION, "Number.NaN > Number.NaN", false, Number.NaN > Number.NaN ); + array[item++] = new TestCase( SECTION, "0 > Number.NaN", false, 0 > Number.NaN ); + array[item++] = new TestCase( SECTION, "Number.NaN > 0", false, Number.NaN > 0 ); + + array[item++] = new TestCase( SECTION, "0 > -0", false, 0 > -0 ); + array[item++] = new TestCase( SECTION, "-0 > 0", false, -0 > 0 ); + + array[item++] = new TestCase( SECTION, "Infinity > 0", true, Number.POSITIVE_INFINITY > 0 ); + array[item++] = new TestCase( SECTION, "Infinity > Number.MAX_VALUE", true, Number.POSITIVE_INFINITY > Number.MAX_VALUE ); + array[item++] = new TestCase( SECTION, "Infinity > Infinity", false, Number.POSITIVE_INFINITY > Number.POSITIVE_INFINITY ); + + array[item++] = new TestCase( SECTION, "0 > Infinity", false, 0 > Number.POSITIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "Number.MAX_VALUE > Infinity", false, Number.MAX_VALUE > Number.POSITIVE_INFINITY ); + + array[item++] = new TestCase( SECTION, "0 > -Infinity", true, 0 > Number.NEGATIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "Number.MAX_VALUE > -Infinity", true, Number.MAX_VALUE > Number.NEGATIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "-Infinity > -Infinity", false, Number.NEGATIVE_INFINITY > Number.NEGATIVE_INFINITY ); + + array[item++] = new TestCase( SECTION, "-Infinity > 0", false, Number.NEGATIVE_INFINITY > 0 ); + array[item++] = new TestCase( SECTION, "-Infinity > -Number.MAX_VALUE", false, Number.NEGATIVE_INFINITY > -Number.MAX_VALUE ); + array[item++] = new TestCase( SECTION, "-Infinity > Number.MIN_VALUE", false, Number.NEGATIVE_INFINITY > Number.MIN_VALUE ); + + array[item++] = new TestCase( SECTION, "'string' > 'string'", false, 'string' > 'string' ); + array[item++] = new TestCase( SECTION, "'astring' > 'string'", false, 'astring' > 'string' ); + array[item++] = new TestCase( SECTION, "'strings' > 'stringy'", false, 'strings' > 'stringy' ); + array[item++] = new TestCase( SECTION, "'strings' > 'stringier'", true, 'strings' > 'stringier' ); + array[item++] = new TestCase( SECTION, "'string' > 'astring'", true, 'string' > 'astring' ); + array[item++] = new TestCase( SECTION, "'string' > 'strings'", false, 'string' > 'strings' ); + array[item++] = new TestCase( SECTION, "'string' > 'str'", true, 'string' > 'str' ); + + array[item++] = new TestCase( SECTION, "44 > 55", false, 44 > 55 ); + array[item++] = new TestCase( SECTION, "55 > 44", true, 55 > 44 ); + array[item++] = new TestCase( SECTION, "56.43 > 65.0", false, 56.43 > 65.0 ); + array[item++] = new TestCase( SECTION, "65.0 > 56.43", true, 65.0 > 56.43 ); + array[item++] = new TestCase( SECTION, "43247503.43 > 945540654.654", false, 43247503.43 > 945540654.654 ); + array[item++] = new TestCase( SECTION, "43247503.43>945540654.654", false, 43247503.43>945540654.654 ); + array[item++] = new TestCase( SECTION, "43247503.43> 945540654.654", false, 43247503.43> 945540654.654 ); + array[item++] = new TestCase( SECTION, "43247503.43 > 945540654.654", false, 43247503.43 > 945540654.654 ); + array[item++] = new TestCase( SECTION, "-56.43 > 65.0", false, -56.43 > 65.0 ); + array[item++] = new TestCase( SECTION, "-56.43 > -65.0", true, -56.43 > -65.0 ); + array[item++] = new TestCase( SECTION, "-56.43 > -56.43", false, -56.43 > -56.43 ); + array[item++] = new TestCase( SECTION, "100 > 100", false, 100 > 100 ); + + + return ( array ); +} +function MyObject(value) { + this.value = value; + //this.valueOf = new Function( "return this.value" ); + //this.toString = new Function( "return this.value +''" ); + this.valueOf = function(){return this.value}; + this.toString = function(){return this.value +''}; +} +function MyValueObject(value) { + this.value = value; + //this.valueOf = new Function( "return this.value" ); + this.valueOf = function(){return this.value}; +} +function MyStringObject(value) { + this.value = value; + //this.toString = new Function( "return this.value +''" ); + this.toString = function(){return this.value +''}; +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_8_3.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_8_3.as new file mode 100644 index 00000000000..2a287a5c39b --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_8_3.as @@ -0,0 +1,131 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "e11_8_3"; + var VERSION = "ECMA_1"; + startTest(); + var testcases = getTestCases(); + + writeHeaderToLog( SECTION + " The less-than-or-equal operator ( <= )"); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "true <= false", false, true <= false ); + array[item++] = new TestCase( SECTION, "false <= true", true, false <= true ); + array[item++] = new TestCase( SECTION, "false <= false", true, false <= false ); + array[item++] = new TestCase( SECTION, "true <= true", true, true <= true ); + + array[item++] = new TestCase( SECTION, "new Boolean(true) <= new Boolean(true)", true, new Boolean(true) <= new Boolean(true) ); + array[item++] = new TestCase( SECTION, "new Boolean(true) <= new Boolean(false)", false, new Boolean(true) <= new Boolean(false) ); + array[item++] = new TestCase( SECTION, "new Boolean(false) <= new Boolean(true)", true, new Boolean(false) <= new Boolean(true) ); + array[item++] = new TestCase( SECTION, "new Boolean(false) <= new Boolean(false)", true, new Boolean(false) <= new Boolean(false) ); + + array[item++] = new TestCase( SECTION, "new MyObject(Infinity) <= new MyObject(Infinity)", true, new MyObject( Number.POSITIVE_INFINITY ) <= new MyObject( Number.POSITIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "new MyObject(-Infinity) <= new MyObject(Infinity)", true, new MyObject( Number.NEGATIVE_INFINITY ) <= new MyObject( Number.POSITIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "new MyObject(-Infinity) <= new MyObject(-Infinity)", true, new MyObject( Number.NEGATIVE_INFINITY ) <= new MyObject( Number.NEGATIVE_INFINITY) ); + + array[item++] = new TestCase( SECTION, "new MyValueObject(false) <= new MyValueObject(true)", true, new MyValueObject(false) <= new MyValueObject(true) ); + array[item++] = new TestCase( SECTION, "new MyValueObject(true) <= new MyValueObject(true)", true, new MyValueObject(true) <= new MyValueObject(true) ); + array[item++] = new TestCase( SECTION, "new MyValueObject(false) <= new MyValueObject(false)", true, new MyValueObject(false) <= new MyValueObject(false) ); + + array[item++] = new TestCase( SECTION, "new MyStringObject(false) <= new MyStringObject(true)", true, new MyStringObject(false) <= new MyStringObject(true) ); + array[item++] = new TestCase( SECTION, "new MyStringObject(true) <= new MyStringObject(true)", true, new MyStringObject(true) <= new MyStringObject(true) ); + array[item++] = new TestCase( SECTION, "new MyStringObject(false) <= new MyStringObject(false)", true, new MyStringObject(false) <= new MyStringObject(false) ); + + array[item++] = new TestCase( SECTION, "Number.NaN <= Number.NaN", false, Number.NaN <= Number.NaN ); + array[item++] = new TestCase( SECTION, "0 <= Number.NaN", false, 0 <= Number.NaN ); + array[item++] = new TestCase( SECTION, "Number.NaN <= 0", false, Number.NaN <= 0 ); + + array[item++] = new TestCase( SECTION, "0 <= -0", true, 0 <= -0 ); + array[item++] = new TestCase( SECTION, "-0 <= 0", true, -0 <= 0 ); + + array[item++] = new TestCase( SECTION, "Infinity <= 0", false, Number.POSITIVE_INFINITY <= 0 ); + array[item++] = new TestCase( SECTION, "Infinity <= Number.MAX_VALUE", false, Number.POSITIVE_INFINITY <= Number.MAX_VALUE ); + array[item++] = new TestCase( SECTION, "Infinity <= Infinity", true, Number.POSITIVE_INFINITY <= Number.POSITIVE_INFINITY ); + + array[item++] = new TestCase( SECTION, "0 <= Infinity", true, 0 <= Number.POSITIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "Number.MAX_VALUE <= Infinity", true, Number.MAX_VALUE <= Number.POSITIVE_INFINITY ); + + array[item++] = new TestCase( SECTION, "0 <= -Infinity", false, 0 <= Number.NEGATIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "Number.MAX_VALUE <= -Infinity", false, Number.MAX_VALUE <= Number.NEGATIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "-Infinity <= -Infinity", true, Number.NEGATIVE_INFINITY <= Number.NEGATIVE_INFINITY ); + + array[item++] = new TestCase( SECTION, "-Infinity <= 0", true, Number.NEGATIVE_INFINITY <= 0 ); + array[item++] = new TestCase( SECTION, "-Infinity <= -Number.MAX_VALUE", true, Number.NEGATIVE_INFINITY <= -Number.MAX_VALUE ); + array[item++] = new TestCase( SECTION, "-Infinity <= Number.MIN_VALUE", true, Number.NEGATIVE_INFINITY <= Number.MIN_VALUE ); + + array[item++] = new TestCase( SECTION, "'string' <= 'string'", true, 'string' <= 'string' ); + array[item++] = new TestCase( SECTION, "'astring' <= 'string'", true, 'astring' <= 'string' ); + array[item++] = new TestCase( SECTION, "'strings' <= 'stringy'", true, 'strings' <= 'stringy' ); + array[item++] = new TestCase( SECTION, "'strings' <= 'stringier'", false, 'strings' <= 'stringier' ); + array[item++] = new TestCase( SECTION, "'string' <= 'astring'", false, 'string' <= 'astring' ); + array[item++] = new TestCase( SECTION, "'string' <= 'strings'", true, 'string' <= 'strings' ); + array[item++] = new TestCase( SECTION, "'string' <= 'str'", false, 'string' <= 'str' ); + + array[item++] = new TestCase( SECTION, "'string' <= undefined", false, 'string' <= undefined ); + array[item++] = new TestCase( SECTION, "undefined <= 'string'", false, undefined <= 'string' ); + array[item++] = new TestCase( SECTION, "6.9 <= undefined", false, 6.9 <= undefined ); + array[item++] = new TestCase( SECTION, "undefined <= 343", false, undefined <= 343); + + array[item++] = new TestCase( SECTION, "44 <= 55", true, 44 <= 55 ); + array[item++] = new TestCase( SECTION, "55 <= 44", false, 55 <= 44 ); + array[item++] = new TestCase( SECTION, "56.43 <= 65.0", true, 56.43 <= 65.0 ); + array[item++] = new TestCase( SECTION, "65.0 <= 56.43", false, 65.0 <= 56.43 ); + array[item++] = new TestCase( SECTION, "43247503.43 <= 945540654.654", true, 43247503.43 <= 945540654.654 ); + array[item++] = new TestCase( SECTION, "43247503.43<=945540654.654", true, 43247503.43<=945540654.654 ); + array[item++] = new TestCase( SECTION, "43247503.43<= 945540654.654", true, 43247503.43<= 945540654.654 ); + array[item++] = new TestCase( SECTION, "43247503.43 <= 945540654.654", true, 43247503.43 <= 945540654.654 ); + array[item++] = new TestCase( SECTION, "-56.43 <= 65.0", true, -56.43 <= 65.0 ); + array[item++] = new TestCase( SECTION, "-56.43 <= -65.0", false, -56.43 <= -65.0 ); + array[item++] = new TestCase( SECTION, "100 <= 100", true, 100 <= 100 ); + array[item++] = new TestCase( SECTION, "-56.43 <= -56.43", true, -56.43 <= -56.43 ); + + return ( array ); +} +function MyObject(value) { + this.value = value; + //this.valueOf = new Function( "return this.value" ); + //this.toString = new Function( "return this.value +''" ); + this.valueOf = function(){return this.value}; + this.toString = function(){return this.value+''}; +} +function MyValueObject(value) { + this.value = value; +// this.valueOf = new Function( "return this.value" ); + this.valueOf = function(){return this.value}; +} +function MyStringObject(value) { + this.value = value; +// this.toString = new Function( "return this.value +''" ); + this.toString = function(){return this.value+''}; +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_8_4.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_8_4.as new file mode 100644 index 00000000000..105d5e5f792 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_8_4.as @@ -0,0 +1,132 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "e11_8_4"; + var VERSION = "ECMA_1"; + startTest(); + var testcases = getTestCases(); + + writeHeaderToLog( SECTION + " The greater-than-or-equal operator ( >= )"); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "true >= false", true, true >= false ); + array[item++] = new TestCase( SECTION, "false >= true", false, false >= true ); + array[item++] = new TestCase( SECTION, "false >= false", true, false >= false ); + array[item++] = new TestCase( SECTION, "true >= true", true, true >= true ); + + array[item++] = new TestCase( SECTION, "new Boolean(true) >= new Boolean(true)", true, new Boolean(true) >= new Boolean(true) ); + array[item++] = new TestCase( SECTION, "new Boolean(true) >= new Boolean(false)", true, new Boolean(true) >= new Boolean(false) ); + array[item++] = new TestCase( SECTION, "new Boolean(false) >= new Boolean(true)", false, new Boolean(false) >= new Boolean(true) ); + array[item++] = new TestCase( SECTION, "new Boolean(false) >= new Boolean(false)", true, new Boolean(false) >= new Boolean(false) ); + + array[item++] = new TestCase( SECTION, "new MyObject(Infinity) >= new MyObject(Infinity)", true, new MyObject( Number.POSITIVE_INFINITY ) >= new MyObject( Number.POSITIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "new MyObject(-Infinity) >= new MyObject(Infinity)", false, new MyObject( Number.NEGATIVE_INFINITY ) >= new MyObject( Number.POSITIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "new MyObject(-Infinity) >= new MyObject(-Infinity)", true, new MyObject( Number.NEGATIVE_INFINITY ) >= new MyObject( Number.NEGATIVE_INFINITY) ); + + array[item++] = new TestCase( SECTION, "new MyValueObject(false) >= new MyValueObject(true)", false, new MyValueObject(false) >= new MyValueObject(true) ); + array[item++] = new TestCase( SECTION, "new MyValueObject(true) >= new MyValueObject(true)", true, new MyValueObject(true) >= new MyValueObject(true) ); + array[item++] = new TestCase( SECTION, "new MyValueObject(false) >= new MyValueObject(false)", true, new MyValueObject(false) >= new MyValueObject(false) ); + + array[item++] = new TestCase( SECTION, "new MyStringObject(false) >= new MyStringObject(true)", false, new MyStringObject(false) >= new MyStringObject(true) ); + array[item++] = new TestCase( SECTION, "new MyStringObject(true) >= new MyStringObject(true)", true, new MyStringObject(true) >= new MyStringObject(true) ); + array[item++] = new TestCase( SECTION, "new MyStringObject(false) >= new MyStringObject(false)", true, new MyStringObject(false) >= new MyStringObject(false) ); + + array[item++] = new TestCase( SECTION, "Number.NaN >= Number.NaN", false, Number.NaN >= Number.NaN ); + array[item++] = new TestCase( SECTION, "0 >= Number.NaN", false, 0 >= Number.NaN ); + array[item++] = new TestCase( SECTION, "Number.NaN >= 0", false, Number.NaN >= 0 ); + + array[item++] = new TestCase( SECTION, "0 >= -0", true, 0 >= -0 ); + array[item++] = new TestCase( SECTION, "-0 >= 0", true, -0 >= 0 ); + + array[item++] = new TestCase( SECTION, "Infinity >= 0", true, Number.POSITIVE_INFINITY >= 0 ); + array[item++] = new TestCase( SECTION, "Infinity >= Number.MAX_VALUE", true, Number.POSITIVE_INFINITY >= Number.MAX_VALUE ); + array[item++] = new TestCase( SECTION, "Infinity >= Infinity", true, Number.POSITIVE_INFINITY >= Number.POSITIVE_INFINITY ); + + array[item++] = new TestCase( SECTION, "0 >= Infinity", false, 0 >= Number.POSITIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "Number.MAX_VALUE >= Infinity", false, Number.MAX_VALUE >= Number.POSITIVE_INFINITY ); + + array[item++] = new TestCase( SECTION, "0 >= -Infinity", true, 0 >= Number.NEGATIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "Number.MAX_VALUE >= -Infinity", true, Number.MAX_VALUE >= Number.NEGATIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "-Infinity >= -Infinity", true, Number.NEGATIVE_INFINITY >= Number.NEGATIVE_INFINITY ); + + array[item++] = new TestCase( SECTION, "-Infinity >= 0", false, Number.NEGATIVE_INFINITY >= 0 ); + array[item++] = new TestCase( SECTION, "-Infinity >= -Number.MAX_VALUE", false, Number.NEGATIVE_INFINITY >= -Number.MAX_VALUE ); + array[item++] = new TestCase( SECTION, "-Infinity >= Number.MIN_VALUE", false, Number.NEGATIVE_INFINITY >= Number.MIN_VALUE ); + + array[item++] = new TestCase( SECTION, "'string' >= 'string'", true, 'string' >= 'string' ); + array[item++] = new TestCase( SECTION, "'astring' >= 'string'", false, 'astring' >= 'string' ); + array[item++] = new TestCase( SECTION, "'strings' >= 'stringy'", false, 'strings' >= 'stringy' ); + array[item++] = new TestCase( SECTION, "'strings' >= 'stringier'", true, 'strings' >= 'stringier' ); + array[item++] = new TestCase( SECTION, "'string' >= 'astring'", true, 'string' >= 'astring' ); + array[item++] = new TestCase( SECTION, "'string' >= 'strings'", false, 'string' >= 'strings' ); + array[item++] = new TestCase( SECTION, "'string' >= 'str'", true, 'string' >= 'str' ); + + array[item++] = new TestCase( SECTION, "'string' >= undefined", false, 'string' >= undefined ); + array[item++] = new TestCase( SECTION, "undefined >= 'string'", false, undefined >= 'string' ); + array[item++] = new TestCase( SECTION, "6.9 >= undefined", false, 6.9 >= undefined ); + array[item++] = new TestCase( SECTION, "undefined >= 343", false, undefined >= 343); + + array[item++] = new TestCase( SECTION, "44 >= 55", false, 44 >= 55 ); + array[item++] = new TestCase( SECTION, "55 >= 44", true, 55 >= 44 ); + array[item++] = new TestCase( SECTION, "56.43 >= 65.0", false, 56.43 >= 65.0 ); + array[item++] = new TestCase( SECTION, "65.0 >= 56.43", true, 65.0 >= 56.43 ); + array[item++] = new TestCase( SECTION, "43247503.43 >= 945540654.654", false, 43247503.43 >= 945540654.654 ); + array[item++] = new TestCase( SECTION, "43247503.43>=945540654.654", false, 43247503.43>=945540654.654 ); + array[item++] = new TestCase( SECTION, "43247503.43>= 945540654.654", false, 43247503.43>= 945540654.654 ); + array[item++] = new TestCase( SECTION, "43247503.43 >= 945540654.654", false, 43247503.43 >= 945540654.654 ); + array[item++] = new TestCase( SECTION, "-56.43 >= 65.0", false, -56.43 >= 65.0 ); + array[item++] = new TestCase( SECTION, "-56.43 >= -65.0", true, -56.43 >= -65.0 ); + array[item++] = new TestCase( SECTION, "100 >= 100", true, 100 >= 100 ); + array[item++] = new TestCase( SECTION, "-56.43 >= -56.43", true, -56.43 >= -56.43 ); + + + return ( array ); +} +function MyObject(value) { + this.value = value; + //this.valueOf = new Function( "return this.value" ); + //this.toString = new Function( "return this.value +''" ); + this.valueOf = function(){return this.value}; + this.toString = function(){return this.value+''}; +} +function MyValueObject(value) { + this.value = value; + //this.valueOf = new Function( "return this.value" ); + this.valueOf = function(){return this.value}; +} +function MyStringObject(value) { + this.value = value; + //this.toString = new Function( "return this.value +''" ); + this.toString = function(){return this.value+''}; +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_8_7.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_8_7.as new file mode 100644 index 00000000000..ee7e6e28fa2 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_8_7.as @@ -0,0 +1,241 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "11.8.7"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "The in operator"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var Array_One = new Array(0,1,2,3); + + + + array[item++] = new TestCase( SECTION, + "0 in Array_One", + true, + 0 in Array_One); + + array[item++] = new TestCase( SECTION, + "1 in Array_One", + true, + 1 in Array_One); + + array[item++] = new TestCase( SECTION, + "2 in Array_One", + true, + 2 in Array_One); + + array[item++] = new TestCase( SECTION, + "3 in Array_One", + true, + 3 in Array_One); + + + + array[item++] = new TestCase( SECTION, + "4 in Array_One", + false, + 4 in Array_One); + + var Array_Two = new Array('z','y','x','w'); + + array[item++] = new TestCase( SECTION, + "0 in Array_Two", + true, + 0 in Array_Two); + + array[item++] = new TestCase( SECTION, + "1 in Array_Two", + true, + 1 in Array_Two); + + array[item++] = new TestCase( SECTION, + "2 in Array_Two", + true, + 2 in Array_Two); + + array[item++] = new TestCase( SECTION, + "3 in Array_Two", + true, + 3 in Array_Two); + + + + array[item++] = new TestCase( SECTION, + "4 in Array_Two", + false, + 4 in Array_Two); + + array[item++] = new TestCase( SECTION, + "a in Array_Two", + false, + 'a' in Array_Two); + + array[item++] = new TestCase( SECTION, + "length in Array_Two", + true, + "length" in Array_Two); + + var myobj = {obj1:"string1",obj2:"string2"} + + array[item++] = new TestCase( SECTION, + "obj1 in myobj", + true, + "obj1" in myobj); + + array[item++] = new TestCase( SECTION, + "obj2 in myobj", + true, + "obj2" in myobj); + + function myfunc():String{ + return "Hi!!!"} + + MyObject2 = {MyNumber:10,MyString:'string',MyBoolean:true,myarr:[1,2,3],myfuncvar:myfunc} + + array[item++] = new TestCase( SECTION, + "MyNumber in MyObject2", + true, + "MyNumber" in MyObject2); + + array[item++] = new TestCase( SECTION, + "MyString in MyObject2", + true, + "MyString" in MyObject2); + + array[item++] = new TestCase( SECTION, + "MyBoolean in MyObject2", + true, + "MyBoolean" in MyObject2); + + + + array[item++] = new TestCase( SECTION, + "myarr in MyObject2", + true, + "myarr" in MyObject2); + + array[item++] = new TestCase( SECTION, + "myfuncvar in MyObject2", + true, + "myfuncvar" in MyObject2); + + + var mystring1 = new String("string1"); + + array[item++] = new TestCase( SECTION, + "length in mystring1", + true, + "length" in mystring1); + + var mystring2 = "string2"; + + + array[item++] = new TestCase( SECTION, + "length in mystring2", + true, + "length" in mystring2); + + MyObject3 = {MyNumber1:10,MyString1:'string',MyBoolean1:true,myarr1:[1,2,3],myfuncvar1:myfunc} + + delete MyObject3.MyNumber1; + + + array[item++] = new TestCase( SECTION, + "MyNumber1 in MyObject3", + false, + "MyNumber1" in MyObject3); + + + delete MyObject3.myfuncvar1; + + array[item++] = new TestCase( SECTION, + "myfuncvar1 in MyObject3", + false, + "myfuncvar1" in MyObject3); + + MyObject3.MyNumber1 = undefined; + + array[item++] = new TestCase( SECTION, + "MyNumber1 in MyObject3", + true, + "MyNumber1" in MyObject3); + + myarr3 = [0,1,2,3]; + + delete myarr3[3]; + + array[item++] = new TestCase( SECTION, + "3 in myarr3", + false, + 3 in myarr3); + + myarr3[3] = undefined; + + array[item++] = new TestCase( SECTION, + "3 in myarr3", + true, + 3 in myarr3); + + + + array[item++] = new TestCase( SECTION, + "PI in Math", + true, + "PI" in Math); + + array[item++] = new TestCase( SECTION, + "myproperty in Math", + false, + "myproperty" in Math); + + array[item++] = new TestCase( SECTION, + "myproperty in Object", + false, + "myproperty" in Object) + + + + + + + return ( array ); +} + diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_9_1.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_9_1.as new file mode 100644 index 00000000000..3bad507ae3f --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_9_1.as @@ -0,0 +1,145 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "11.9.1"; + var VERSION = "ECMA_1"; + startTest(); + var BUGNUMBER="77391"; + + + var testcases = getTestCases(); + + writeHeaderToLog( SECTION + " The equals operator ( == )"); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // type x and type y are the same. if type x is undefined or null, return true + + array[item++] = new TestCase( SECTION, "void 0 = void 0", true, void 0 == void 0 ); + array[item++] = new TestCase( SECTION, "null == null", true, null == null ); + + // if x is NaN, return false. if y is NaN, return false. + + array[item++] = new TestCase( SECTION, "NaN == NaN", false, Number.NaN == Number.NaN ); + array[item++] = new TestCase( SECTION, "NaN == 0", false, Number.NaN == 0 ); + array[item++] = new TestCase( SECTION, "0 == NaN", false, 0 == Number.NaN ); + array[item++] = new TestCase( SECTION, "NaN == Infinity", false, Number.NaN == Number.POSITIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "Infinity == NaN", false, Number.POSITIVE_INFINITY == Number.NaN ); + + // if x is the same number value as y, return true. + + array[item++] = new TestCase( SECTION, "Number.MAX_VALUE == Number.MAX_VALUE", true, Number.MAX_VALUE == Number.MAX_VALUE ); + array[item++] = new TestCase( SECTION, "Number.MIN_VALUE == Number.MIN_VALUE", true, Number.MIN_VALUE == Number.MIN_VALUE ); + array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY == Number.POSITIVE_INFINITY", true, Number.POSITIVE_INFINITY == Number.POSITIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY == Number.NEGATIVE_INFINITY", true, Number.NEGATIVE_INFINITY == Number.NEGATIVE_INFINITY ); + + // if xis 0 and y is -0, return true. if x is -0 and y is 0, return true. + + array[item++] = new TestCase( SECTION, "0 == 0", true, 0 == 0 ); + array[item++] = new TestCase( SECTION, "0 == -0", true, 0 == -0 ); + array[item++] = new TestCase( SECTION, "-0 == 0", true, -0 == 0 ); + array[item++] = new TestCase( SECTION, "-0 == -0", true, -0 == -0 ); + + // return false. + + array[item++] = new TestCase( SECTION, "0.9 == 1", false, 0.9 == 1 ); + array[item++] = new TestCase( SECTION, "0.999999 == 1", false, 0.999999 == 1 ); + array[item++] = new TestCase( SECTION, "0.9999999999 == 1", false, 0.9999999999 == 1 ); + array[item++] = new TestCase( SECTION, "0.9999999999999 == 1", false, 0.9999999999999 == 1 ); + + // type x and type y are the same type, but not numbers. + + + // x and y are strings. return true if x and y are exactly the same sequence of characters. + // otherwise, return false. + + array[item++] = new TestCase( SECTION, "'hello' == 'hello'", true, "hello" == "hello" ); + + // x and y are booleans. return true if both are true or both are false. + + array[item++] = new TestCase( SECTION, "true == true", true, true == true ); + array[item++] = new TestCase( SECTION, "false == false", true, false == false ); + array[item++] = new TestCase( SECTION, "true == false", false, true == false ); + array[item++] = new TestCase( SECTION, "false == true", false, false == true ); + + // return true if x and y refer to the same object. otherwise return false. + + array[item++] = new TestCase( SECTION, "new MyObject(true) == new MyObject(true)", false, new MyObject(true) == new MyObject(true) ); + array[item++] = new TestCase( SECTION, "new Boolean(true) == new Boolean(true)", true, new Boolean(true) == new Boolean(true) ); + array[item++] = new TestCase( SECTION, "new Boolean(false) == new Boolean(false)", true, new Boolean(false) == new Boolean(false) ); + + x = new MyObject(true); y = x; z = x; + array[item++] = new TestCase( SECTION, "x = new MyObject(true); y = x; z = x; z == y", true, z == y ); + x = new MyObject(false); y = x; z = x; + array[item++] = new TestCase( SECTION, "x = new MyObject(false); y = x; z = x; z == y", true, z == y ); + x = new Boolean(true); y = x; z = x; + array[item++] = new TestCase( SECTION, "x = new Boolean(true); y = x; z = x; z == y", true, z == y ); + x = new Boolean(false); y = x; z = x; + array[item++] = new TestCase( SECTION, "x = new Boolean(false); y = x; z = x; z == y", true, z == y ); + + array[item++] = new TestCase( SECTION, "new Boolean(true) == new Boolean(true)", true, new Boolean(true) == new Boolean(true) ); + array[item++] = new TestCase( SECTION, "new Boolean(false) == new Boolean(false)", true, new Boolean(false) == new Boolean(false) ); + + // if x is null and y is undefined, return true. if x is undefined and y is null return true. + + array[item++] = new TestCase( SECTION, "null == void 0", true, null == void 0 ); + array[item++] = new TestCase( SECTION, "void 0 == null", true, void 0 == null ); + + // if type(x) is Number and type(y) is string, return the result of the comparison x == ToNumber(y). + + array[item++] = new TestCase( SECTION, "1 == '1'", true, 1 == '1' ); + array[item++] = new TestCase( SECTION, "255 == '0xff'", true, 255 == '0xff' ); + array[item++] = new TestCase( SECTION, "0 == '\r'", true, 0 == "\r" ); + array[item++] = new TestCase( SECTION, "1e19 == '1e19'", true, 1e19 == "1e19" ); + + + array[item++] = new TestCase( SECTION, "new Boolean(true) == true", true, true == new Boolean(true) ); + array[item++] = new TestCase( SECTION, "new MyObject(true) == true", true, true == new MyObject(true) ); + + array[item++] = new TestCase( SECTION, "new Boolean(false) == false", true, new Boolean(false) == false ); + array[item++] = new TestCase( SECTION, "new MyObject(false) == false", true, new MyObject(false) == false ); + + array[item++] = new TestCase( SECTION, "true == new Boolean(true)", true, true == new Boolean(true) ); + array[item++] = new TestCase( SECTION, "true == new MyObject(true)", true, true == new MyObject(true) ); + + array[item++] = new TestCase( SECTION, "false == new Boolean(false)", true, false == new Boolean(false) ); + array[item++] = new TestCase( SECTION, "false == new MyObject(false)", true, false == new MyObject(false) ); + + return ( array ); +} + +function MyObject( value ) { + this.value = value; + //this.valueOf = new Function( "return this.value" ); + this.valueOf = function(){return this.value}; +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_9_2.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_9_2.as new file mode 100644 index 00000000000..6629fc0c49c --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_9_2.as @@ -0,0 +1,144 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "11.9.2"; + var VERSION = "ECMA_1"; + startTest(); + var BUGNUMBER="77391"; + + var testcases = getTestCases(); + + writeHeaderToLog( SECTION + " The equals operator ( == )"); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // type x and type y are the same. if type x is undefined or null, return true + + array[item++] = new TestCase( SECTION, "void 0 == void 0", false, void 0 != void 0 ); + array[item++] = new TestCase( SECTION, "null == null", false, null != null ); + + // if x is NaN, return false. if y is NaN, return false. + + array[item++] = new TestCase( SECTION, "NaN != NaN", true, Number.NaN != Number.NaN ); + array[item++] = new TestCase( SECTION, "NaN != 0", true, Number.NaN != 0 ); + array[item++] = new TestCase( SECTION, "0 != NaN", true, 0 != Number.NaN ); + array[item++] = new TestCase( SECTION, "NaN != Infinity", true, Number.NaN != Number.POSITIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "Infinity != NaN", true, Number.POSITIVE_INFINITY != Number.NaN ); + + // if x is the same number value as y, return true. + + array[item++] = new TestCase( SECTION, "Number.MAX_VALUE != Number.MAX_VALUE", false, Number.MAX_VALUE != Number.MAX_VALUE ); + array[item++] = new TestCase( SECTION, "Number.MIN_VALUE != Number.MIN_VALUE", false, Number.MIN_VALUE != Number.MIN_VALUE ); + array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY != Number.POSITIVE_INFINITY", false, Number.POSITIVE_INFINITY != Number.POSITIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY != Number.NEGATIVE_INFINITY", false, Number.NEGATIVE_INFINITY != Number.NEGATIVE_INFINITY ); + + // if xis 0 and y is -0, return true. if x is -0 and y is 0, return true. + + array[item++] = new TestCase( SECTION, "0 != 0", false, 0 != 0 ); + array[item++] = new TestCase( SECTION, "0 != -0", false, 0 != -0 ); + array[item++] = new TestCase( SECTION, "-0 != 0", false, -0 != 0 ); + array[item++] = new TestCase( SECTION, "-0 != -0", false, -0 != -0 ); + + // return false. + + array[item++] = new TestCase( SECTION, "0.9 != 1", true, 0.9 != 1 ); + array[item++] = new TestCase( SECTION, "0.999999 != 1", true, 0.999999 != 1 ); + array[item++] = new TestCase( SECTION, "0.9999999999 != 1", true, 0.9999999999 != 1 ); + array[item++] = new TestCase( SECTION, "0.9999999999999 != 1", true, 0.9999999999999 != 1 ); + + // type x and type y are the same type, but not numbers. + + + // x and y are strings. return true if x and y are exactly the same sequence of characters. + // otherwise, return false. + + array[item++] = new TestCase( SECTION, "'hello' != 'hello'", false, "hello" != "hello" ); + + // x and y are booleans. return true if both are true or both are false. + + array[item++] = new TestCase( SECTION, "true != true", false, true != true ); + array[item++] = new TestCase( SECTION, "false != false", false, false != false ); + array[item++] = new TestCase( SECTION, "true != false", true, true != false ); + array[item++] = new TestCase( SECTION, "false != true", true, false != true ); + + // return true if x and y refer to the same object. otherwise return false. + + array[item++] = new TestCase( SECTION, "new MyObject(true) != new MyObject(true)", true, new MyObject(true) != new MyObject(true) ); + array[item++] = new TestCase( SECTION, "new Boolean(true) != new Boolean(true)", false, new Boolean(true) != new Boolean(true) ); + array[item++] = new TestCase( SECTION, "new Boolean(false) != new Boolean(false)", false, new Boolean(false) != new Boolean(false) ); + + x = new MyObject(true); y = x; z = x; + array[item++] = new TestCase( SECTION, "x = new MyObject(true); y = x; z = x; z != y", false, z != y ); + x = new MyObject(false); y = x; z = x; + array[item++] = new TestCase( SECTION, "x = new MyObject(false); y = x; z = x; z != y", false, z != y ); + x = new Boolean(true); y = x; z = x; + array[item++] = new TestCase( SECTION, "x = new Boolean(true); y = x; z = x; z != y", false, z != y); + x = new Boolean(false); y = x; z = x; + array[item++] = new TestCase( SECTION, "x = new Boolean(false); y = x; z = x; z != y", false, z != y ); + + array[item++] = new TestCase( SECTION, "new Boolean(true) != new Boolean(true)", false, new Boolean(true) != new Boolean(true) ); + array[item++] = new TestCase( SECTION, "new Boolean(false) != new Boolean(false)", false, new Boolean(false) != new Boolean(false) ); + + // if x is null and y is undefined, return true. if x is undefined and y is null return true. + + array[item++] = new TestCase( SECTION, "null != void 0", false, null != void 0 ); + array[item++] = new TestCase( SECTION, "void 0 != null", false, void 0 != null ); + + // if type(x) is Number and type(y) is string, return the result of the comparison x != ToNumber(y). + + array[item++] = new TestCase( SECTION, "1 != '1'", false, 1 != '1' ); + array[item++] = new TestCase( SECTION, "255 != '0xff'", false, 255 != '0xff' ); + array[item++] = new TestCase( SECTION, "0 != '\r'", false, 0 != "\r" ); + array[item++] = new TestCase( SECTION, "1e19 != '1e19'", false, 1e19 != "1e19" ); + + + array[item++] = new TestCase( SECTION, "new Boolean(true) != true", false, true != new Boolean(true) ); + array[item++] = new TestCase( SECTION, "new MyObject(true) != true", false, true != new MyObject(true) ); + + array[item++] = new TestCase( SECTION, "new Boolean(false) != false", false, new Boolean(false) != false ); + array[item++] = new TestCase( SECTION, "new MyObject(false) != false", false, new MyObject(false) != false ); + + array[item++] = new TestCase( SECTION, "true != new Boolean(true)", false, true != new Boolean(true) ); + array[item++] = new TestCase( SECTION, "true != new MyObject(true)", false, true != new MyObject(true) ); + + array[item++] = new TestCase( SECTION, "false != new Boolean(false)", false, false != new Boolean(false) ); + array[item++] = new TestCase( SECTION, "false != new MyObject(false)", false, false != new MyObject(false) ); + + return ( array ); +} + +function MyObject( value ) { + this.value = value; + //this.valueOf = new Function( "return this.value" ); + this.valueOf = function(){return this.value}; +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_9_3.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_9_3.as new file mode 100644 index 00000000000..8cb41a1c8c1 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_9_3.as @@ -0,0 +1,141 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "11.9.3"; + var VERSION = "ECMA_1"; + startTest(); + var BUGNUMBER="77391"; + + var testcases = getTestCases(); + + writeHeaderToLog( SECTION + " The equals operator ( == )"); + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + + // type x and type y are the same. if type x is undefined or null, return true + + array[item++] = new TestCase( SECTION, "void 0 = void 0", true, void 0 == void 0 ); + array[item++] = new TestCase( SECTION, "null == null", true, null == null ); + + // if x is NaN, return false. if y is NaN, return false. + + array[item++] = new TestCase( SECTION, "NaN == NaN", false, Number.NaN == Number.NaN ); + array[item++] = new TestCase( SECTION, "NaN == 0", false, Number.NaN == 0 ); + array[item++] = new TestCase( SECTION, "0 == NaN", false, 0 == Number.NaN ); + array[item++] = new TestCase( SECTION, "NaN == Infinity", false, Number.NaN == Number.POSITIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "Infinity == NaN", false, Number.POSITIVE_INFINITY == Number.NaN ); + + // if x is the same number value as y, return true. + + array[item++] = new TestCase( SECTION, "Number.MAX_VALUE == Number.MAX_VALUE", true, Number.MAX_VALUE == Number.MAX_VALUE ); + array[item++] = new TestCase( SECTION, "Number.MIN_VALUE == Number.MIN_VALUE", true, Number.MIN_VALUE == Number.MIN_VALUE ); + array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY == Number.POSITIVE_INFINITY", true, Number.POSITIVE_INFINITY == Number.POSITIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY == Number.NEGATIVE_INFINITY", true, Number.NEGATIVE_INFINITY == Number.NEGATIVE_INFINITY ); + + // if xis 0 and y is -0, return true. if x is -0 and y is 0, return true. + + array[item++] = new TestCase( SECTION, "0 == 0", true, 0 == 0 ); + array[item++] = new TestCase( SECTION, "0 == -0", true, 0 == -0 ); + array[item++] = new TestCase( SECTION, "-0 == 0", true, -0 == 0 ); + array[item++] = new TestCase( SECTION, "-0 == -0", true, -0 == -0 ); + + // return false. + + array[item++] = new TestCase( SECTION, "0.9 == 1", false, 0.9 == 1 ); + array[item++] = new TestCase( SECTION, "0.999999 == 1", false, 0.999999 == 1 ); + array[item++] = new TestCase( SECTION, "0.9999999999 == 1", false, 0.9999999999 == 1 ); + array[item++] = new TestCase( SECTION, "0.9999999999999 == 1", false, 0.9999999999999 == 1 ); + + // type x and type y are the same type, but not numbers. + + + // x and y are strings. return true if x and y are exactly the same sequence of characters. + // otherwise, return false. + + array[item++] = new TestCase( SECTION, "'hello' == 'hello'", true, "hello" == "hello" ); + + // x and y are booleans. return true if both are true or both are false. + + array[item++] = new TestCase( SECTION, "true == true", true, true == true ); + array[item++] = new TestCase( SECTION, "false == false", true, false == false ); + array[item++] = new TestCase( SECTION, "true == false", false, true == false ); + array[item++] = new TestCase( SECTION, "false == true", false, false == true ); + + // return true if x and y refer to the same object. otherwise return false. + + array[item++] = new TestCase( SECTION, "new MyObject(true) == new MyObject(true)", false, new MyObject(true) == new MyObject(true) ); + array[item++] = new TestCase( SECTION, "new Boolean(true) == new Boolean(true)", true, new Boolean(true) == new Boolean(true) ); + array[item++] = new TestCase( SECTION, "new Boolean(false) == new Boolean(false)", true, new Boolean(false) == new Boolean(false) ); + + array[item++] = new TestCase( SECTION, "x = new MyObject(true); y = x; z = x; z == y", true, (x = new MyObject(true), y = x, z = x, z == y) ); + array[item++] = new TestCase( SECTION, "x = new MyObject(false); y = x; z = x; z == y", true, (x = new MyObject(false), y = x, z = x, z == y) ); + array[item++] = new TestCase( SECTION, "x = new Boolean(true); y = x; z = x; z == y", true, (x = new Boolean(true), y = x, z = x, z == y) ); + array[item++] = new TestCase( SECTION, "x = new Boolean(false); y = x; z = x; z == y", true, (x = new Boolean(false), y = x, z = x, z == y) ); + + array[item++] = new TestCase( SECTION, "new Boolean(true) == new Boolean(true)", true, new Boolean(true) == new Boolean(true) ); + array[item++] = new TestCase( SECTION, "new Boolean(false) == new Boolean(false)", true, new Boolean(false) == new Boolean(false) ); + + // if x is null and y is undefined, return true. if x is undefined and y is null return true. + + array[item++] = new TestCase( SECTION, "null == void 0", true, null == void 0 ); + array[item++] = new TestCase( SECTION, "void 0 == null", true, void 0 == null ); + + // if type(x) is Number and type(y) is string, return the result of the comparison x == ToNumber(y). + + array[item++] = new TestCase( SECTION, "1 == '1'", true, 1 == '1' ); + array[item++] = new TestCase( SECTION, "255 == '0xff'", true, 255 == '0xff' ); + array[item++] = new TestCase( SECTION, "0 == '\r'", true, 0 == "\r" ); + array[item++] = new TestCase( SECTION, "1e19 == '1e19'", true, 1e19 == "1e19" ); + + + array[item++] = new TestCase( SECTION, "new Boolean(true) == true", true, true == new Boolean(true) ); + array[item++] = new TestCase( SECTION, "new MyObject(true) == true", true, true == new MyObject(true) ); + + array[item++] = new TestCase( SECTION, "new Boolean(false) == false", true, new Boolean(false) == false ); + array[item++] = new TestCase( SECTION, "new MyObject(false) == false", true, new MyObject(false) == false ); + + array[item++] = new TestCase( SECTION, "true == new Boolean(true)", true, true == new Boolean(true) ); + array[item++] = new TestCase( SECTION, "true == new MyObject(true)", true, true == new MyObject(true) ); + + array[item++] = new TestCase( SECTION, "false == new Boolean(false)", true, false == new Boolean(false) ); + array[item++] = new TestCase( SECTION, "false == new MyObject(false)", true, false == new MyObject(false) ); + + return ( array ); +} + +function MyObject( value ) { + this.value = value; + //this.valueOf = new Function( "return this.value" ); + this.valueOf = function(){return this.value}; +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_9_4.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_9_4.as new file mode 100644 index 00000000000..3943690bc13 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_9_4.as @@ -0,0 +1,157 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "11.9.4"; + var VERSION = "ECMA_1"; + var BUGNUMBER="77393"; + + startTest(); + var testcases = getTestCases(); + writeHeaderToLog( SECTION + " The Strict Equals Operator ( === )"); + test(); + +class AObj { + function AObj() {} +} + +function MyObject( value ) { + this.value = value; + //this.valueOf = new Function( "return this.value" ); + this.valueOf = function(){return this.value}; +} + +function getTestCases() { + var array = new Array(); + var item = 0; + + // type x and type y are the same. if type x is undefined or null, return true + array[item++] = new TestCase( SECTION, "void 0 === void 0", true, void 0 === void 0 ); + array[item++] = new TestCase( SECTION, "null === null", true, null === null ); + + // if x is NaN, return false. if y is NaN, return false + array[item++] = new TestCase( SECTION, "NaN === NaN", false, Number.NaN === Number.NaN ); + array[item++] = new TestCase( SECTION, "NaN === 0", false, Number.NaN === 0 ); + array[item++] = new TestCase( SECTION, "0 === NaN", false, 0 === Number.NaN ); + array[item++] = new TestCase( SECTION, "NaN === Infinity", false, Number.NaN === Number.POSITIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "Infinity === NaN", false, Number.POSITIVE_INFINITY === Number.NaN ); + + // if x is the same number value as y, return true + var bn = (12345.6789 === 12345.678900); + array[item++] = new TestCase( SECTION, "12345.6789 === 12345.678900", true, bn); + array[item++] = new TestCase( SECTION, "Number.MAX_VALUE === Number.MAX_VALUE", true, Number.MAX_VALUE === Number.MAX_VALUE ); + array[item++] = new TestCase( SECTION, "Number.MIN_VALUE === Number.MIN_VALUE", true, Number.MIN_VALUE === Number.MIN_VALUE ); + array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY === Number.POSITIVE_INFINITY", true, Number.POSITIVE_INFINITY === Number.POSITIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY === Number.NEGATIVE_INFINITY", true, Number.NEGATIVE_INFINITY === Number.NEGATIVE_INFINITY ); + + // if x is 0 and y is -0, return true. if x is -0 and y is 0, return true. + array[item++] = new TestCase( SECTION, "0 === 0", true, 0 === 0 ); + array[item++] = new TestCase( SECTION, "0 === -0", true, 0 === -0 ); + array[item++] = new TestCase( SECTION, "-0 === 0", true, -0 === 0 ); + var b0 = (-0 === -0); + array[item++] = new TestCase( SECTION, "-0 === -0", true, b0); + + // return false. + array[item++] = new TestCase( SECTION, "0.9 === 1", false, 0.9 === 1 ); + array[item++] = new TestCase( SECTION, "0.999999 === 1", false, 0.999999 === 1 ); + array[item++] = new TestCase( SECTION, "0.9999999999 === 1", false, 0.9999999999 === 1 ); + array[item++] = new TestCase( SECTION, "0.9999999999999 === 1", false, 0.9999999999999 === 1 ); + + // type x and type y are the same type, but not numbers + // x and y are strings. return true if x and y are exactly the same sequence of characters + // otherwise, return false + array[item++] = new TestCase( SECTION, "'hello' === 'hello'", true, "hello" === "hello" ); + array[item++] = new TestCase( SECTION, "'helloWorld' === 'hello'", false, "helloWorld" === "hello" ); + + // x and y are booleans. return true if both are true or both are false + array[item++] = new TestCase( SECTION, "true === true", true, true === true ); + array[item++] = new TestCase( SECTION, "false === false", true, false === false ); + array[item++] = new TestCase( SECTION, "true === false", false, true === false ); + array[item++] = new TestCase( SECTION, "false === true", false, false === true ); + + // return true if x and y refer to the same object. otherwise return false + var myobj1 = new MyObject(true); + var myobj2 = myobj1; + array[item++] = new TestCase( SECTION, "var myobj1 = new MyObject(true); var myobj2 = myobj1; myobj1 === myobj2", true, myobj1 === myobj2 ); + array[item++] = new TestCase( SECTION, "new MyObject(true) === new MyObject(true)", false, new MyObject(true) === new MyObject(true) ); + array[item++] = new TestCase( SECTION, "new Boolean(true) === new Boolean(true)", true, new Boolean(true) === new Boolean(true) ); + array[item++] = new TestCase( SECTION, "new Boolean(false) === new Boolean(false)", true, new Boolean(false) === new Boolean(false) ); + + x = new MyObject(true); y = x; z = x; + array[item++] = new TestCase( SECTION, "x = new MyObject(true); y = x; z = x; z === y", true, z === y ); + x = new MyObject(false); y = x; z = x; + array[item++] = new TestCase( SECTION, "x = new MyObject(false); y = x; z = x; z === y", true, z === y ); + x = new Boolean(true); y = x; z = x; + array[item++] = new TestCase( SECTION, "x = new Boolean(true); y = x; z = x; z === y", true, z === y ); + x = new Boolean(false); y = x; z = x; + array[item++] = new TestCase( SECTION, "x = new Boolean(false); y = x; z = x; z === y", true, z === y ); + + array[item++] = new TestCase( SECTION, "new String(\"string\") === new String(\"string\")", true, new String("string") === new String("string") ); + array[item++] = new TestCase( SECTION, "new String(\"string\") === \"string\"", true, new String("string") === "string" ); + + // if Type(x) is different from Type(y), return false + array[item++] = new TestCase( SECTION, "null === void 0", false, null === void 0 ); + array[item++] = new TestCase( SECTION, "void 0 === null", false, void 0 === null ); + array[item++] = new TestCase( SECTION, "undefined === 5.44", false, undefined === 5.44 ); + array[item++] = new TestCase( SECTION, "null === \"fdsee3f\" ", false, null === "fdsee3f" ); + + // if Type(x) is Undefined, return true + var an_undefined_var; + var obj:Object; + array[item++] = new TestCase( SECTION, "undefined === an_undefined_var", true, undefined === an_undefined_var ); + array[item++] = new TestCase( SECTION, "var obj:Object; obj === an_undefined_var", false, obj === an_undefined_var ); + + // if Type(x) is Null, return true + var nullobj:AObj; + var b = (nullobj === null); + //trace("nullobj = "+nullobj); + array[item++] = new TestCase( SECTION, "var nullobj:AObj; nullobj === null ", true, b ); + + // if type(x) is Number and type(y) is string, return false + array[item++] = new TestCase( SECTION, "1 === '1'", false, 1 === '1' ); + array[item++] = new TestCase( SECTION, "255 === '0xff'", false, 255 === '0xff' ); + array[item++] = new TestCase( SECTION, "0 === '\r'", false, 0 === "\r" ); + array[item++] = new TestCase( SECTION, "1e19 === '1e19'", false, 1e19 === "1e19" ); + + array[item++] = new TestCase( SECTION, "new Boolean(true) === true", true, true === new Boolean(true) ); + array[item++] = new TestCase( SECTION, "new MyObject(true) === true", false, true === new MyObject(true) ); + + array[item++] = new TestCase( SECTION, "new Boolean(false) === false", true, new Boolean(false) === false ); + array[item++] = new TestCase( SECTION, "new MyObject(false) === false", false, new MyObject(false) === false ); + + array[item++] = new TestCase( SECTION, "true === new Boolean(true)", true, true === new Boolean(true) ); + array[item++] = new TestCase( SECTION, "true === new MyObject(true)", false, true === new MyObject(true) ); + + array[item++] = new TestCase( SECTION, "false === new Boolean(false)", true, false === new Boolean(false) ); + array[item++] = new TestCase( SECTION, "false === new MyObject(false)", false, false === new MyObject(false) ); + + return ( array ); +} + + diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_9_5.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_9_5.as new file mode 100644 index 00000000000..d52237402a9 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_9_5.as @@ -0,0 +1,154 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "11.9.5"; + var VERSION = "ECMA_1"; + var BUGNUMBER="77394"; + + startTest(); + var testcases = getTestCases(); + writeHeaderToLog( SECTION + " The Strict Does-not-equal Operator ( !== )"); + test(); + +class AObj { + function AObj() {} +} + +function MyObject( value ) { + this.value = value; + //this.valueOf = new Function( "return this.value" ); + this.valueOf = function(){return this.value}; +} + +function getTestCases() { + var array = new Array(); + var item = 0; + + // type x and type y are the same. if type x is undefined or null, return true + array[item++] = new TestCase( SECTION, "void 0 !== void 0", false, void 0 !== void 0 ); + array[item++] = new TestCase( SECTION, "null !== null", false, null !== null ); + + // if x is NaN, return true. if y is NaN, return true + array[item++] = new TestCase( SECTION, "NaN !== NaN", true, Number.NaN !== Number.NaN ); + array[item++] = new TestCase( SECTION, "NaN !== 0", true, Number.NaN !== 0 ); + array[item++] = new TestCase( SECTION, "0 !== NaN", true, 0 !== Number.NaN ); + array[item++] = new TestCase( SECTION, "NaN !== Infinity", true, Number.NaN !== Number.POSITIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "Infinity !== NaN", true, Number.POSITIVE_INFINITY !== Number.NaN ); + + // if x is the same number value as y, return false + var bn = (12345.6789 !== 12345.678900); + array[item++] = new TestCase( SECTION, "12345.6789 !== 12345.678900", false, bn); + array[item++] = new TestCase( SECTION, "Number.MAX_VALUE !== Number.MAX_VALUE", false, Number.MAX_VALUE !== Number.MAX_VALUE ); + array[item++] = new TestCase( SECTION, "Number.MIN_VALUE !== Number.MIN_VALUE", false, Number.MIN_VALUE !== Number.MIN_VALUE ); + array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY !== Number.POSITIVE_INFINITY", false, Number.POSITIVE_INFINITY !== Number.POSITIVE_INFINITY ); + array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY !== Number.NEGATIVE_INFINITY", false, Number.NEGATIVE_INFINITY !== Number.NEGATIVE_INFINITY ); + + // if x is 0 and y is -0, return false; if x is -0 and y is 0, return false + array[item++] = new TestCase( SECTION, "0 !== 0", false, 0 !== 0 ); + array[item++] = new TestCase( SECTION, "0 !== -0", false, 0 !== -0 ); + array[item++] = new TestCase( SECTION, "-0 !== 0", false, -0 !== 0 ); + var b0 = (-0 !== -0); + array[item++] = new TestCase( SECTION, "-0 !== -0", false, b0 ); + + // return true. + array[item++] = new TestCase( SECTION, "0.9 !== 1", true, 0.9 !== 1 ); + array[item++] = new TestCase( SECTION, "0.999999 !== 1", true, 0.999999 !== 1 ); + array[item++] = new TestCase( SECTION, "0.9999999999 !== 1", true, 0.9999999999 !== 1 ); + array[item++] = new TestCase( SECTION, "0.9999999999999 !== 1", true, 0.9999999999999 !== 1 ); + + // type x and type y are the same type, but not numbers + // x and y are strings. return false if x and y are exactly the same sequence of characters + // otherwise, return true + array[item++] = new TestCase( SECTION, "'hello' !== 'hello'", false, "hello" !== "hello" ); + array[item++] = new TestCase( SECTION, "'helloWorld' !== 'hello'", true, "helloWorld" !== "hello" ); + + // x and y are booleans. return false if both are true or both are false + array[item++] = new TestCase( SECTION, "true !== true", false, true !== true ); + array[item++] = new TestCase( SECTION, "false !== false", false, false !== false ); + array[item++] = new TestCase( SECTION, "true !== false", true, true !== false ); + array[item++] = new TestCase( SECTION, "false !== true", true, false !== true ); + + // return false if x and y refer to the same object. otherwise return true + var myobj1 = new MyObject(true); + var myobj2 = myobj1; + array[item++] = new TestCase( SECTION, "var myobj1 = new MyObject(true); var myobj2 = myobj1; myobj1 !== myobj2", false, myobj1 !== myobj2 ); + array[item++] = new TestCase( SECTION, "new MyObject(true) !== new MyObject(true)", true, new MyObject(true) !== new MyObject(true) ); + array[item++] = new TestCase( SECTION, "new Boolean(true) !== new Boolean(true)", false, new Boolean(true) !== new Boolean(true) ); + array[item++] = new TestCase( SECTION, "new Boolean(false) !== new Boolean(false)", false, new Boolean(false) !== new Boolean(false) ); + + x = new MyObject(true); y = x; z = x; + array[item++] = new TestCase( SECTION, "x = new MyObject(true); y = x; z = x; z !== y", false, z !== y ); + x = new MyObject(false); y = x; z = x; + array[item++] = new TestCase( SECTION, "x = new MyObject(false); y = x; z = x; z !== y", false, z !== y ); + x = new Boolean(true); y = x; z = x; + array[item++] = new TestCase( SECTION, "x = new Boolean(true); y = x; z = x; z !== y", false, z !== y ); + x = new Boolean(false); y = x; z = x; + array[item++] = new TestCase( SECTION, "x = new Boolean(false); y = x; z = x; z !== y", false, z !== y ); + + array[item++] = new TestCase( SECTION, "new String(\"string\") !== new String(\"string\")", false, new String("string") !== new String("string") ); + array[item++] = new TestCase( SECTION, "new String(\"string\") !== \"string\"", false, new String("string") !== "string" ); + + // if Type(x) is different from Type(y), return true + array[item++] = new TestCase( SECTION, "null !== void 0", true, null !== void 0 ); + array[item++] = new TestCase( SECTION, "void 0 !== null", true, void 0 !== null ); + array[item++] = new TestCase( SECTION, "undefined !== 5.44", true, undefined !== 5.44 ); + array[item++] = new TestCase( SECTION, "null !== \"fdsee3f\" ", true, null !== "fdsee3f" ); + + // if Type(x) is Undefined, return false + var an_undefined_var; + var obj:Object; + array[item++] = new TestCase( SECTION, "undefined !== an_undefined_var", false, undefined !== an_undefined_var ); + array[item++] = new TestCase( SECTION, "var obj:Object; obj !== an_undefined_var", true, obj !== an_undefined_var ); + + // if Type(x) is Null, return false + var nullobj:AObj; + var b = (nullobj !== null); + array[item++] = new TestCase( SECTION, "var nullobj:AObj; nullobj !== null ", false, b ); + + // if type(x) is Number and type(y) is string, return true + array[item++] = new TestCase( SECTION, "1 !== '1'", true, 1 !== '1' ); + array[item++] = new TestCase( SECTION, "255 !== '0xff'", true, 255 !== '0xff' ); + array[item++] = new TestCase( SECTION, "0 !== '\r'", true, 0 !== "\r" ); + array[item++] = new TestCase( SECTION, "1e19 !== '1e19'", true, 1e19 !== "1e19" ); + + array[item++] = new TestCase( SECTION, "new Boolean(true) !== true", false, true !== new Boolean(true) ); + array[item++] = new TestCase( SECTION, "new MyObject(true) !== true", true, true !== new MyObject(true) ); + + array[item++] = new TestCase( SECTION, "new Boolean(false) !== false", false, new Boolean(false) !== false ); + array[item++] = new TestCase( SECTION, "new MyObject(false) !== false", true, new MyObject(false) !== false ); + + array[item++] = new TestCase( SECTION, "true !== new Boolean(true)", false, true !== new Boolean(true) ); + array[item++] = new TestCase( SECTION, "true !== new MyObject(true)", true, true !== new MyObject(true) ); + + array[item++] = new TestCase( SECTION, "false !== new Boolean(false)", false, false !== new Boolean(false) ); + array[item++] = new TestCase( SECTION, "false !== new MyObject(false)", true, false !== new MyObject(false) ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Expressions/e11_9_6_1.as b/mozilla/js/tamarin/test/ecma3/Expressions/e11_9_6_1.as new file mode 100644 index 00000000000..9121ee7f5f0 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Expressions/e11_9_6_1.as @@ -0,0 +1,228 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* ***** BEGIN LICENSE BLOCK ***** +* Version: NPL 1.1/GPL 2.0/LGPL 2.1 +* +* The contents of this file are subject to the Netscape Public License +* Version 1.1 (the "License"); you may not use this file except in +* compliance with the License. You may obtain a copy of the License at +* http://www.mozilla.org/NPL/ +* +* Software distributed under the License is distributed on an "AS IS" basis, +* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +* for the specific language governing rights and limitations under the +* License. +* +* The Original Code is JavaScript Engine testing utilities. +* +* The Initial Developer of the Original Code is Netscape Communications Corp. +* Portions created by the Initial Developer are Copyright (C) 2002 +* the Initial Developer. All Rights Reserved. +* +* Contributor(s): pschwartau@netscape.com +* +* Alternatively, the contents of this file may be used under the terms of +* either the GNU General Public License Version 2 or later (the "GPL"), or +* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +* in which case the provisions of the GPL or the LGPL are applicable instead +* of those above. If you wish to allow use of your version of this file only +* under the terms of either the GPL or the LGPL, and not to allow others to +* use your version of this file under the terms of the NPL, indicate your +* decision by deleting the provisions above and replace them with the notice +* and other provisions required by the GPL or the LGPL. If you do not delete +* the provisions above, a recipient may use your version of this file under +* the terms of any one of the NPL, the GPL or the LGPL. +* +* ***** END LICENSE BLOCK ***** +* +* +* Date: 20 Feb 2002 +* SUMMARY: Testing the comparison |undefined === null| +* See http://bugzilla.mozilla.org/show_bug.cgi?id=126722 +* +*/ +//----------------------------------------------------------------------------- + var SECTION = "e11_9_6_1"; + var VERSION = ""; + var TITLE = "Testing the comparison |undefined === null|" + var bug = 126722; + startTest(); + + var testcases = getTestCases(); + + writeHeaderToLog( SECTION + " " + TITLE); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var UBound = 0; + var summary = 'Testing the comparison |undefined === null|'; + var status = ''; + var statusitems = []; + var actual = ''; + var actualvalues = []; + var expect= ''; + var expectedvalues = []; + + + status = inSection(1); + if (undefined === null) + actual = true; + else + actual = false; + expect = false; + //addThis(); + array[item++] = new TestCase(SECTION, status + ": if(undefined === null)", expect, actual); + + + status = inSection(2); + switch(true) + { + case (undefined === null) : + actual = true; + break; + + default: + actual = false; + } + expect = false; + //addThis(); + array[item++] = new TestCase(SECTION, status + ": case(undefined === null)", expect, actual); + + + + status = inSection(3); + function f3(x) + { + var res = false; + + switch(true) + { + case (x === null) : + res = true; + break; + + default: + // do nothing + } + + return res; + } + + actual = f3(undefined); + expect = false; + //addThis(); + array[item++] = new TestCase(SECTION, status + ": f3(x); undefined === null", expect, actual); + + + + status = inSection(4); + function f4(arr) + { + var elt = ''; + var res = false; + + for (i=0; i function f\u02B1 () {} +* +* js> f\u02B1.toSource(); +* function f¦() {} +* +* js> f\u02B1.toSource().toSource(); +* (new String("function f\xB1() {}")) +* +* +* See how the high-byte information (the 02) has been lost? +* The same thing was happening with the toString() method: +* +* js> f\u02B1.toString(); +* +* function f¦() { +* } +* +* js> f\u02B1.toString().toSource(); +* (new String("\nfunction f\xB1() {\n}\n")) +* +*/ +//----------------------------------------------------------------------------- + var SECTION = ""; + var VERSION = ""; + + startTest(); + + var ERR = 'UNEXPECTED ERROR! \n'; + var ERR_MALFORMED_NAME = ERR + 'Could not find function name in: \n\n'; + var TITLE = "Testing functions with double-byte names"; + var bug = 58274; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var UBound = 0; + + var summary = 'Testing functions with double-byte names'; + var status = ''; + var statusitems = []; + var actual = ''; + var actualvalues = []; + var expect= ''; + var expectedvalues = []; + var sEval; + var sName; + + //Commenting out as eval is not supported any more + + /*try{ + sEval = "function f\u02B2() {return 42;}"; + eval(sEval); + }catch(e:Error){ + thisError=e.toString(); + }finally{ + status = 'In the try and catch block'; + actual = thisError; + expect = "EvalError: eval is not supported"; + addThis(); + }*/ + function f\u02B2() {return 42}; + //eval(sEval); + sName = getFunctionName(f\u02B2); + + + // Test function call - + status = inSection(1); + actual = f\u02B2(); + expect = 42; + //addThis(); + array[item++] = new TestCase(SECTION, status, expect, actual); + + //Expected results should be changed after bug 164523 is fixed + // Test both characters of function name - + status = inSection(2); + actual = sName.charAt(0); + expect = 'F'; + //addThis(); + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = inSection(3); + actual = sName.charAt(1); + expect = 'u'; + //addThis(); + array[item++] = new TestCase(SECTION, status, expect, actual); + + + + function f\u02B2\u0AAA () {return 84;}; + //eval(sEval); + sName = getFunctionName(f\u02B2\u0AAA); + + + // Test function call - + status = inSection(4); + actual = f\u02B2\u0AAA(); + expect = 84; + //addThis(); + array[item++] = new TestCase(SECTION, status, expect, actual); + + // Test all three characters of function name - + status = inSection(5); + actual = sName.charAt(0); + expect = 'F'; + //addThis(); + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = inSection(6); + actual = sName.charAt(1); + expect = 'u'; + //addThis(); + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = inSection(7); + actual = sName.charAt(2); + expect = 'n'; + //addThis(); + array[item++] = new TestCase(SECTION, status, expect, actual); + + return array; +} + + + +/* + * Goal: test that f.toString() contains the proper function name. + * + * Note, however, f.toString() is implementation-independent. For example, + * it may begin with '\nfunction' instead of 'function'. Therefore we use + * a regexp to make sure we extract the name properly. + * + * Here we assume that f has been defined by means of a function statement, + * and not a function expression (where it wouldn't have to have a name). + * + * Rhino uses a Unicode representation for f.toString(); whereas + * SpiderMonkey uses an ASCII representation, putting escape sequences + * for non-ASCII characters. For example, if a function is called f\u02B1, + * then in Rhino the toString() method will present a 2-character Unicode + * string for its name, whereas SpiderMonkey will present a 7-character + * ASCII string for its name: the string literal 'f\u02B1'. + * + * So we force the lexer to condense the string before using it. + * This will give uniform results in Rhino and SpiderMonkey. + */ +function getFunctionName(f) +{ + var s = condenseStr(f.toString()); + var re = /\s*function\s+(\S+)\s*\(/; + var arr = s.match(re); + + if (!(arr && arr[1])) + return ERR_MALFORMED_NAME + s; + return arr[1]; +} + + +/* + * This function is the opposite of functions like escape(), which take + * Unicode characters and return escape sequences for them. Here, we force + * the lexer to turn escape sequences back into single characters. + * + * Note we can't simply do |eval(str)|, since in practice |str| will be an + * identifier somewhere in the program (e.g. a function name); thus |eval(str)| + * would return the object that the identifier represents: not what we want. + * + * So we surround |str| lexicographically with quotes to force the lexer to + * evaluate it as a string. Have to strip out any linefeeds first, however - + */ +function condenseStr(str) +{ + /* + * You won't be able to do the next step if |str| has + * any carriage returns or linefeeds in it. For example: + * + * js> eval("'" + '\nHello' + "'"); + * 1: SyntaxError: unterminated string literal: + * 1: ' + * 1: ^ + * + * So replace them with the empty string - + */ + str = str.replace(/[\r\n]/g, '') + + //return eval("'" + str + "'"); + return ("'"+ str + "'"); +} + +/* +function addThis() +{ + statusitems[UBound] = status; + actualvalues[UBound] = actual; + expectedvalues[UBound] = expect; + UBound++; +} +*/ + +/* +function test() +{ + enterFunc('test'); + printBugNumber(bug); + printStatus(summary); + + for (var i=0; i 0; PAD-- ) { + string = "0" + string; + } + + return string; +} +function ToHexString( n ) { + var hex = new Array(); + + for ( var mag = 1; Math.pow(16,mag) <= n ; mag++ ) { + ; + } + + for ( index = 0, mag -= 1; mag > 0; index++, mag-- ) { + hex[index] = Math.floor( n / Math.pow(16,mag) ); + n -= Math.pow(16,mag) * Math.floor( n/Math.pow(16,mag) ); + } + + hex[hex.length] = n % 16; + + var string =""; + + for ( var index = 0 ; index < hex.length ; index++ ) { + switch ( hex[index] ) { + case 10: + string += "A"; + break; + case 11: + string += "B"; + break; + case 12: + string += "C"; + break; + case 13: + string += "D"; + break; + case 14: + string += "E"; + break; + case 15: + string += "F"; + break; + default: + string += hex[index]; + } + } + + if ( string.length == 1 ) { + string = "0" + string; + } + return string; +} diff --git a/mozilla/js/tamarin/test/ecma3/GlobalObject/e15_1_2_5_1.as b/mozilla/js/tamarin/test/ecma3/GlobalObject/e15_1_2_5_1.as new file mode 100644 index 00000000000..904b21d7a6c --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/GlobalObject/e15_1_2_5_1.as @@ -0,0 +1,182 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.1.2.5-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "unescape(string)"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "unescape.length", 1, unescape.length ); + //array[item++] = new TestCase( SECTION, "unescape.length = null; unescape.length", 1, eval("unescape.length=null; unescape.length") ); + + var thisError:String + try + { + unescape.length=null; + } + catch(e:ReferenceError) + { + thisError = e.toString(); + } + finally + { + array[item++] = new TestCase(SECTION, "unescape.length = null", "ReferenceError: Error #1074", referenceError(thisError)); + } + array[item++] = new TestCase( SECTION, "delete unescape.length", false, delete unescape.length ); + //array[item++] = new TestCase( SECTION, "delete unescape.length; unescape.length", 1, eval("delete unescape.length; unescape.length") ); + delete unescape.length; + array[item++] = new TestCase( SECTION, "delete unescape.length; unescape.length", 1, unescape.length); + + var MYPROPS=''; + for ( var p in unescape ) { + MYPROPS+= p; + } + + array[item++] = new TestCase( SECTION, "var MYPROPS='', for ( var p in unescape ) { MYPROPS+= p }, MYPROPS", "", MYPROPS ); + + array[item++] = new TestCase( SECTION, "unescape()", "undefined", unescape() ); + array[item++] = new TestCase( SECTION, "unescape('')", "", unescape('') ); + array[item++] = new TestCase( SECTION, "unescape( null )", "null", unescape(null) ); + array[item++] = new TestCase( SECTION, "unescape( void 0 )", "null", unescape(void 0) ); + array[item++] = new TestCase( SECTION, "unescape( true )", "true", unescape( true ) ); + array[item++] = new TestCase( SECTION, "unescape( false )", "false", unescape( false ) ); + + array[item++] = new TestCase( SECTION, "unescape( new Boolean(true) )", "true", unescape(new Boolean(true)) ); + array[item++] = new TestCase( SECTION, "unescape( new Boolean(false) )", "false", unescape(new Boolean(false)) ); + + array[item++] = new TestCase( SECTION, "unescape( Number.NaN )", "NaN", unescape(Number.NaN) ); + array[item++] = new TestCase( SECTION, "unescape( -0 )", "0", unescape( -0 ) ); + array[item++] = new TestCase( SECTION, "unescape( 'Infinity' )", "Infinity", unescape( "Infinity" ) ); + array[item++] = new TestCase( SECTION, "unescape( Number.POSITIVE_INFINITY )", "Infinity", unescape( Number.POSITIVE_INFINITY ) ); + array[item++] = new TestCase( SECTION, "unescape( Number.NEGATIVE_INFINITY )", "-Infinity", unescape( Number.NEGATIVE_INFINITY ) ); + + var ASCII_TEST_STRING = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789@*_+-./"; + + array[item++] = new TestCase( SECTION, "unescape( " +ASCII_TEST_STRING+" )", ASCII_TEST_STRING, unescape( ASCII_TEST_STRING ) ); + + // escaped chars with ascii values less than 256 + + for ( var CHARCODE = 0; CHARCODE < 256; CHARCODE++ ) { + array[item++] = new TestCase( SECTION, + "unescape( %"+ ToHexString(CHARCODE)+" )", + String.fromCharCode(CHARCODE), + unescape( "%" + ToHexString(CHARCODE) ) ); + } + + // unicode chars represented by two hex digits + for ( var CHARCODE = 0; CHARCODE < 256; CHARCODE++ ) { + array[item++] = new TestCase( SECTION, + "unescape( %u"+ ToHexString(CHARCODE)+" )", + "%u"+ToHexString(CHARCODE), + unescape( "%u" + ToHexString(CHARCODE) ) ); + } +/* + for ( var CHARCODE = 0; CHARCODE < 256; CHARCODE++ ) { + array[item++] = new TestCase( SECTION, + "unescape( %u"+ ToUnicodeString(CHARCODE)+" )", + String.fromCharCode(CHARCODE), + unescape( "%u" + ToUnicodeString(CHARCODE) ) ); + } + for ( var CHARCODE = 256; CHARCODE < 65536; CHARCODE+= 333 ) { + array[item++] = new TestCase( SECTION, + "unescape( %u"+ ToUnicodeString(CHARCODE)+" )", + String.fromCharCode(CHARCODE), + unescape( "%u" + ToUnicodeString(CHARCODE) ) ); + } +*/ + return ( array ); +} + +function ToUnicodeString( n ) { + var string = ToHexString(n); + + for ( var PAD = (4 - string.length ); PAD > 0; PAD-- ) { + string = "0" + string; + } + + return string; +} +function ToHexString( n ) { + var hex = new Array(); + + for ( var mag = 1; Math.pow(16,mag) <= n ; mag++ ) { + ; + } + + for ( index = 0, mag -= 1; mag > 0; index++, mag-- ) { + hex[index] = Math.floor( n / Math.pow(16,mag) ); + n -= Math.pow(16,mag) * Math.floor( n/Math.pow(16,mag) ); + } + + hex[hex.length] = n % 16; + + var string =""; + + for ( var index = 0 ; index < hex.length ; index++ ) { + switch ( hex[index] ) { + case 10: + string += "A"; + break; + case 11: + string += "B"; + break; + case 12: + string += "C"; + break; + case 13: + string += "D"; + break; + case 14: + string += "E"; + break; + case 15: + string += "F"; + break; + default: + string += hex[index]; + } + } + + if ( string.length == 1 ) { + string = "0" + string; + } + return string; +} diff --git a/mozilla/js/tamarin/test/ecma3/GlobalObject/e15_1_2_5_2.as b/mozilla/js/tamarin/test/ecma3/GlobalObject/e15_1_2_5_2.as new file mode 100644 index 00000000000..22b3bc59460 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/GlobalObject/e15_1_2_5_2.as @@ -0,0 +1,135 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.1.2.5-2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "unescape(string)"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // since there is only one character following "%", no conversion should occur. + + for ( var CHARCODE = 0; CHARCODE < 256; CHARCODE += 16 ) { + array[item++] = new TestCase( SECTION, + "unescape( %"+ (ToHexString(CHARCODE)).substring(0,1) +" )", + "%"+(ToHexString(CHARCODE)).substring(0,1), + unescape( "%" + (ToHexString(CHARCODE)).substring(0,1) ) ); + } + + // since there is only one character following "%u", no conversion should occur. + + for ( var CHARCODE = 0; CHARCODE < 256; CHARCODE +=16 ) { + array[item++] = new TestCase( SECTION, + "unescape( %u"+ (ToHexString(CHARCODE)).substring(0,1) +" )", + "%u"+(ToHexString(CHARCODE)).substring(0,1), + unescape( "%u" + (ToHexString(CHARCODE)).substring(0,1) ) ); + } + + + // three char unicode string. no conversion should occur + + for ( var CHARCODE = 1024; CHARCODE < 65536; CHARCODE+= 1234 ) { + array[item++] = new TestCase + ( SECTION, + "unescape( %u"+ (ToUnicodeString(CHARCODE)).substring(0,3)+ " )", + + "%u"+(ToUnicodeString(CHARCODE)).substring(0,3), + unescape( "%u"+(ToUnicodeString(CHARCODE)).substring(0,3) ) + ); + } + + return ( array ); +} + +function ToUnicodeString( n ) { + var string = ToHexString(n); + + for ( var PAD = (4 - string.length ); PAD > 0; PAD-- ) { + string = "0" + string; + } + + return string; +} +function ToHexString( n ) { + var hex = new Array(); + + for ( var mag = 1; Math.pow(16,mag) <= n ; mag++ ) { + ; + } + + for ( index = 0, mag -= 1; mag > 0; index++, mag-- ) { + hex[index] = Math.floor( n / Math.pow(16,mag) ); + n -= Math.pow(16,mag) * Math.floor( n/Math.pow(16,mag) ); + } + + hex[hex.length] = n % 16; + + var string =""; + + for ( var index = 0 ; index < hex.length ; index++ ) { + switch ( hex[index] ) { + case 10: + string += "A"; + break; + case 11: + string += "B"; + break; + case 12: + string += "C"; + break; + case 13: + string += "D"; + break; + case 14: + string += "E"; + break; + case 15: + string += "F"; + break; + default: + string += hex[index]; + } + } + + if ( string.length == 1 ) { + string = "0" + string; + } + return string; +} diff --git a/mozilla/js/tamarin/test/ecma3/GlobalObject/e15_1_2_5_3.as b/mozilla/js/tamarin/test/ecma3/GlobalObject/e15_1_2_5_3.as new file mode 100644 index 00000000000..cdd836c18f5 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/GlobalObject/e15_1_2_5_3.as @@ -0,0 +1,157 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + var SECTION = "15.1.2.5-3"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "unescape(string)"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + for ( var CHARCODE = 0, NONHEXCHARCODE = 0; CHARCODE < 256; CHARCODE++, NONHEXCHARCODE++ ) { + NONHEXCHARCODE = getNextNonHexCharCode( NONHEXCHARCODE ); + + array[item++] = new TestCase( SECTION, + "unescape( %"+ (ToHexString(CHARCODE)).substring(0,1) + + String.fromCharCode( NONHEXCHARCODE ) +" )" + + "[where last character is String.fromCharCode("+NONHEXCHARCODE+")]", + "%"+(ToHexString(CHARCODE)).substring(0,1)+ + String.fromCharCode( NONHEXCHARCODE ), + unescape( "%" + (ToHexString(CHARCODE)).substring(0,1)+ + String.fromCharCode( NONHEXCHARCODE ) ) ); + } + for ( var CHARCODE = 0, NONHEXCHARCODE = 0; CHARCODE < 256; CHARCODE++, NONHEXCHARCODE++ ) { + NONHEXCHARCODE = getNextNonHexCharCode( NONHEXCHARCODE ); + + array[item++] = new TestCase( SECTION, + "unescape( %u"+ (ToHexString(CHARCODE)).substring(0,1) + + String.fromCharCode( NONHEXCHARCODE ) +" )" + + "[where last character is String.fromCharCode("+NONHEXCHARCODE+")]", + "%u"+(ToHexString(CHARCODE)).substring(0,1)+ + String.fromCharCode( NONHEXCHARCODE ), + unescape( "%u" + (ToHexString(CHARCODE)).substring(0,1)+ + String.fromCharCode( NONHEXCHARCODE ) ) ); + } + + for ( var CHARCODE = 0, NONHEXCHARCODE = 0 ; CHARCODE < 65536; CHARCODE+= 54321, NONHEXCHARCODE++ ) { + NONHEXCHARCODE = getNextNonHexCharCode( NONHEXCHARCODE ); + var x = "0x" + (ToUnicodeString(CHARCODE)).substring(0,2); + array[item++] = new TestCase( SECTION, + "unescape( %u"+ (ToUnicodeString(CHARCODE)).substring(0,3) + + String.fromCharCode( NONHEXCHARCODE ) +" )" + + "[where last character is String.fromCharCode("+NONHEXCHARCODE+")]", + + String.fromCharCode(x) + + (ToUnicodeString(CHARCODE)).substring(2,3) + + String.fromCharCode( NONHEXCHARCODE ), + + unescape( "%" + (ToUnicodeString(CHARCODE)).substring(0,3)+ + String.fromCharCode( NONHEXCHARCODE ) ) ); + } + + return ( array ); +} +function getNextNonHexCharCode( n ) { + for ( ; n < Math.pow(2,16); n++ ) { + if ( ( n == 43 || n == 45 || n == 46 || n == 47 || + (n >= 71 && n <= 90) || (n >= 103 && n <= 122) || + n == 64 || n == 95 ) ) { + break; + } else { + n = ( n > 122 ) ? 0 : n; + } + } + return n; +} +function ToUnicodeString( n ) { + var string = ToHexString(n); + + for ( var PAD = (4 - string.length ); PAD > 0; PAD-- ) { + string = "0" + string; + } + + return string; +} +function ToHexString( n ) { + var hex = new Array(); + + for ( var mag = 1; Math.pow(16,mag) <= n ; mag++ ) { + ; + } + + for ( index = 0, mag -= 1; mag > 0; index++, mag-- ) { + hex[index] = Math.floor( n / Math.pow(16,mag) ); + n -= Math.pow(16,mag) * Math.floor( n/Math.pow(16,mag) ); + } + + hex[hex.length] = n % 16; + + var string =""; + + for ( var index = 0 ; index < hex.length ; index++ ) { + switch ( hex[index] ) { + case 10: + string += "A"; + break; + case 11: + string += "B"; + break; + case 12: + string += "C"; + break; + case 13: + string += "D"; + break; + case 14: + string += "E"; + break; + case 15: + string += "F"; + break; + default: + string += hex[index]; + } + } + + if ( string.length == 1 ) { + string = "0" + string; + } + return string; +} diff --git a/mozilla/js/tamarin/test/ecma3/GlobalObject/e15_1_2_6.as b/mozilla/js/tamarin/test/ecma3/GlobalObject/e15_1_2_6.as new file mode 100644 index 00000000000..020c381a890 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/GlobalObject/e15_1_2_6.as @@ -0,0 +1,161 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.1.2.6"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "isNaN( x )"; + + var BUGNUMBER = "77391"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "isNaN.length", 1, isNaN.length ); + + var MYPROPS=''; + for ( var p in isNaN ) { + MYPROPS+= p; + } + + array[item++] = new TestCase( SECTION, "var MYPROPS='', for ( var p in isNaN ) { MYPROPS+= p }, MYPROPS", "", MYPROPS ); + + var thisError:String = "no error"; + try + { + isNaN.length=null; + } + catch (e:ReferenceError) + { + thisError = e.toString(); + } + finally + { + array[item++] = new TestCase(SECTION, "isNaN.length = null", "ReferenceError: Error #1074", referenceError(thisError)); + } + array[item++] = new TestCase( SECTION, "delete isNaN.length", false, delete isNaN.length ); + //array[item++] = new TestCase( SECTION, "delete isNaN.length; isNaN.length", 1, eval("delete isNaN.length; isNaN.length") ); + delete isNaN.length; + array[item++] = new TestCase( SECTION, "delete isNaN.length; isNaN.length", 1, isNaN.length); + +// array[item++] = new TestCase( SECTION, "isNaN.__proto__", Function.prototype, isNaN.__proto__ ); + + array[item++] = new TestCase( SECTION, "isNaN()", true, isNaN() ); + array[item++] = new TestCase( SECTION, "isNaN( null )", false, isNaN(null) ); + array[item++] = new TestCase( SECTION, "isNaN( void 0 )", true, isNaN(void 0) ); + array[item++] = new TestCase( SECTION, "isNaN( true )", false, isNaN(true) ); + array[item++] = new TestCase( SECTION, "isNaN( false)", false, isNaN(false) ); + array[item++] = new TestCase( SECTION, "isNaN( ' ' )", false, isNaN( " " ) ); + + array[item++] = new TestCase( SECTION, "isNaN( 0 )", false, isNaN(0) ); + array[item++] = new TestCase( SECTION, "isNaN( 1 )", false, isNaN(1) ); + array[item++] = new TestCase( SECTION, "isNaN( 2 )", false, isNaN(2) ); + array[item++] = new TestCase( SECTION, "isNaN( 3 )", false, isNaN(3) ); + array[item++] = new TestCase( SECTION, "isNaN( 4 )", false, isNaN(4) ); + array[item++] = new TestCase( SECTION, "isNaN( 5 )", false, isNaN(5) ); + array[item++] = new TestCase( SECTION, "isNaN( 6 )", false, isNaN(6) ); + array[item++] = new TestCase( SECTION, "isNaN( 7 )", false, isNaN(7) ); + array[item++] = new TestCase( SECTION, "isNaN( 8 )", false, isNaN(8) ); + array[item++] = new TestCase( SECTION, "isNaN( 9 )", false, isNaN(9) ); + array[item++] = new TestCase( SECTION, "isNaN( -1 )", false, isNaN(-1) ); + + array[item++] = new TestCase( SECTION, "isNaN( '-1' )", false, isNaN(-1) ); + + array[item++] = new TestCase( SECTION, "isNaN( 1.23 )", false, isNaN(1.23) ); + + array[item++] = new TestCase( SECTION, "isNaN('1.23')", false, isNaN(1.23) ); + + array[item++] = new TestCase( SECTION, "isNaN( -1.23 )", false, isNaN(-1.23) ); + + array[item++] = new TestCase( SECTION, "isNaN( '-1.23' )", false, isNaN(-1.23) ); + + array[item++] = new TestCase( SECTION, "isNaN( '0' )", false, isNaN('0') ); + array[item++] = new TestCase( SECTION, "isNaN( '1' )", false, isNaN('1') ); + array[item++] = new TestCase( SECTION, "isNaN( '2' )", false, isNaN('2') ); + array[item++] = new TestCase( SECTION, "isNaN( '3' )", false, isNaN('3') ); + array[item++] = new TestCase( SECTION, "isNaN( '4' )", false, isNaN('4') ); + array[item++] = new TestCase( SECTION, "isNaN( '5' )", false, isNaN('5') ); + array[item++] = new TestCase( SECTION, "isNaN( '6' )", false, isNaN('6') ); + array[item++] = new TestCase( SECTION, "isNaN( '7' )", false, isNaN('7') ); + array[item++] = new TestCase( SECTION, "isNaN( '8' )", false, isNaN('8') ); + array[item++] = new TestCase( SECTION, "isNaN( '9' )", false, isNaN('9') ); + + + array[item++] = new TestCase( SECTION, "isNaN( 0x0a )", false, isNaN( 0x0a ) ); + array[item++] = new TestCase( SECTION, "isNaN( 0xaa )", false, isNaN( 0xaa ) ); + array[item++] = new TestCase( SECTION, "isNaN( 0x0A )", false, isNaN( 0x0A ) ); + array[item++] = new TestCase( SECTION, "isNaN( 0xAA )", false, isNaN( 0xAA ) ); + + array[item++] = new TestCase( SECTION, "isNaN( '0x0a' )", false, isNaN( "0x0a" ) ); + array[item++] = new TestCase( SECTION, "isNaN( '0xaa' )", false, isNaN( "0xaa" ) ); + array[item++] = new TestCase( SECTION, "isNaN( '0x0A' )", false, isNaN( "0x0A" ) ); + array[item++] = new TestCase( SECTION, "isNaN( '0xAA' )", false, isNaN( "0xAA" ) ); + + array[item++] = new TestCase( SECTION, "isNaN( 077 )", false, isNaN( 077 ) ); + array[item++] = new TestCase( SECTION, "isNaN( '077' )", false, isNaN( "077" ) ); + + + array[item++] = new TestCase( SECTION, "isNaN( Number.NaN )", true, isNaN(Number.NaN) ); + array[item++] = new TestCase( SECTION, "isNaN( Number.POSITIVE_INFINITY )", false, isNaN(Number.POSITIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "isNaN( Number.NEGATIVE_INFINITY )", false, isNaN(Number.NEGATIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "isNaN( Number.MAX_VALUE )", false, isNaN(Number.MAX_VALUE) ); + array[item++] = new TestCase( SECTION, "isNaN( Number.MIN_VALUE )", false, isNaN(Number.MIN_VALUE) ); + + array[item++] = new TestCase( SECTION, "isNaN( NaN )", true, isNaN(NaN) ); + array[item++] = new TestCase( SECTION, "isNaN( Infinity )", false, isNaN(Infinity) ); + + array[item++] = new TestCase( SECTION, "isNaN( 'Infinity' )", false, isNaN("Infinity") ); + array[item++] = new TestCase( SECTION, "isNaN( '-Infinity' )", false, isNaN("-Infinity") ); + + array[item++] = new TestCase( SECTION, "isNaN( 'string' )", true, isNaN("string") ); + + array[item++] = new TestCase( SECTION, "isNaN({} )",true, isNaN({})); + + array[item++] = new TestCase( SECTION, "isNaN(undefined)",true, isNaN(undefined)); + + + var arr= new Array(); + array[item++] = new TestCase( SECTION, "isNaN(arr)",false, isNaN(arr)); + + var obj = new Object(); + array[item++] = new TestCase( SECTION, "isNaN(obj)",true, isNaN(obj)); + + var mydate = new Date(0); + array[item++] = new TestCase( SECTION, "isNaN(mydate)",false, isNaN(mydate)); + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/GlobalObject/e15_1_2_7.as b/mozilla/js/tamarin/test/ecma3/GlobalObject/e15_1_2_7.as new file mode 100644 index 00000000000..4e94c0a6974 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/GlobalObject/e15_1_2_7.as @@ -0,0 +1,140 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.1.2.7"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "isFinite( x )"; + + var BUGNUMBER= "77391"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "isFinite.length", 1, isFinite.length ); + //array[item++] = new TestCase( SECTION, "isFinite.length = null; isFinite.length", 1, eval("isFinite.length=null; isFinite.length") ); + + var thisError:String = "no error"; + try + { + isFinite.length=null; + } + catch(e:ReferenceError) + { + thisError = e.toString(); + } + finally + { + array[item++] = new TestCase(SECTION, "isFinite.length = null", "ReferenceError: Error #1074", referenceError(thisError)); + } + array[item++] = new TestCase( SECTION, "delete isFinite.length", false, delete isFinite.length ); + //array[item++] = new TestCase( SECTION, "delete isFinite.length; isFinite.length", 1, eval("delete isFinite.length; isFinite.length") ); + delete isFinite.length; + array[item++] = new TestCase( SECTION, "delete isFinite.length; isFinite.length", 1, isFinite.length); + + var MYPROPS=''; + for ( var p in isFinite ) { + MYPROPS += p; + } + + + array[item++] = new TestCase( SECTION, "var MYPROPS='', for ( var p in isFinite ) { MYPROPS+= p }, MYPROPS", "", MYPROPS ); + + array[item++] = new TestCase( SECTION, "isFinite()", false, isFinite() ); + array[item++] = new TestCase( SECTION, "isFinite( null )", true, isFinite(null) ); + array[item++] = new TestCase( SECTION, "isFinite( void 0 )", false, isFinite(void 0) ); + array[item++] = new TestCase( SECTION, "isFinite( false )", true, isFinite(false) ); + array[item++] = new TestCase( SECTION, "isFinite( true)", true, isFinite(true) ); + array[item++] = new TestCase( SECTION, "isFinite( ' ' )", true, isFinite( " " ) ); + + array[item++] = new TestCase( SECTION, "isFinite( new Boolean(true) )", true, isFinite(new Boolean(true)) ); + array[item++] = new TestCase( SECTION, "isFinite( new Boolean(false) )", true, isFinite(new Boolean(false)) ); + + array[item++] = new TestCase( SECTION, "isFinite( 0 )", true, isFinite(0) ); + array[item++] = new TestCase( SECTION, "isFinite( 1 )", true, isFinite(1) ); + array[item++] = new TestCase( SECTION, "isFinite( 2 )", true, isFinite(2) ); + array[item++] = new TestCase( SECTION, "isFinite( 3 )", true, isFinite(3) ); + array[item++] = new TestCase( SECTION, "isFinite( 4 )", true, isFinite(4) ); + array[item++] = new TestCase( SECTION, "isFinite( 5 )", true, isFinite(5) ); + array[item++] = new TestCase( SECTION, "isFinite( 6 )", true, isFinite(6) ); + array[item++] = new TestCase( SECTION, "isFinite( 7 )", true, isFinite(7) ); + array[item++] = new TestCase( SECTION, "isFinite( 8 )", true, isFinite(8) ); + array[item++] = new TestCase( SECTION, "isFinite( 9 )", true, isFinite(9) ); + + array[item++] = new TestCase( SECTION, "isFinite( '0' )", true, isFinite('0') ); + array[item++] = new TestCase( SECTION, "isFinite( '1' )", true, isFinite('1') ); + array[item++] = new TestCase( SECTION, "isFinite( '2' )", true, isFinite('2') ); + array[item++] = new TestCase( SECTION, "isFinite( '3' )", true, isFinite('3') ); + array[item++] = new TestCase( SECTION, "isFinite( '4' )", true, isFinite('4') ); + array[item++] = new TestCase( SECTION, "isFinite( '5' )", true, isFinite('5') ); + array[item++] = new TestCase( SECTION, "isFinite( '6' )", true, isFinite('6') ); + array[item++] = new TestCase( SECTION, "isFinite( '7' )", true, isFinite('7') ); + array[item++] = new TestCase( SECTION, "isFinite( '8' )", true, isFinite('8') ); + array[item++] = new TestCase( SECTION, "isFinite( '9' )", true, isFinite('9') ); + + array[item++] = new TestCase( SECTION, "isFinite( 0x0a )", true, isFinite( 0x0a ) ); + array[item++] = new TestCase( SECTION, "isFinite( 0xaa )", true, isFinite( 0xaa ) ); + array[item++] = new TestCase( SECTION, "isFinite( 0x0A )", true, isFinite( 0x0A ) ); + array[item++] = new TestCase( SECTION, "isFinite( 0xAA )", true, isFinite( 0xAA ) ); + + array[item++] = new TestCase( SECTION, "isFinite( '0x0a' )", true, isFinite( "0x0a" ) ); + array[item++] = new TestCase( SECTION, "isFinite( '0xaa' )", true, isFinite( "0xaa" ) ); + array[item++] = new TestCase( SECTION, "isFinite( '0x0A' )", true, isFinite( "0x0A" ) ); + array[item++] = new TestCase( SECTION, "isFinite( '0xAA' )", true, isFinite( "0xAA" ) ); + + array[item++] = new TestCase( SECTION, "isFinite( 077 )", true, isFinite( 077 ) ); + array[item++] = new TestCase( SECTION, "isFinite( '077' )", true, isFinite( "077" ) ); + + array[item++] = new TestCase( SECTION, "isFinite( new String('Infinity') )", false, isFinite(new String("Infinity")) ); + array[item++] = new TestCase( SECTION, "isFinite( new String('-Infinity') )", false, isFinite(new String("-Infinity")) ); + + array[item++] = new TestCase( SECTION, "isFinite( 'Infinity' )", false, isFinite("Infinity") ); + array[item++] = new TestCase( SECTION, "isFinite( '-Infinity' )", false, isFinite("-Infinity") ); + array[item++] = new TestCase( SECTION, "isFinite( Number.POSITIVE_INFINITY )", false, isFinite(Number.POSITIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "isFinite( Number.NEGATIVE_INFINITY )", false, isFinite(Number.NEGATIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "isFinite( Number.NaN )", false, isFinite(Number.NaN) ); + + array[item++] = new TestCase( SECTION, "isFinite( Infinity )", false, isFinite(Infinity) ); + array[item++] = new TestCase( SECTION, "isFinite( -Infinity )", false, isFinite(-Infinity) ); + array[item++] = new TestCase( SECTION, "isFinite( NaN )", false, isFinite(NaN) ); + + + array[item++] = new TestCase( SECTION, "isFinite( Number.MAX_VALUE )", true, isFinite(Number.MAX_VALUE) ); + array[item++] = new TestCase( SECTION, "isFinite( Number.MIN_VALUE )", true, isFinite(Number.MIN_VALUE) ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/GlobalObject/e15_1_2_n.as b/mozilla/js/tamarin/test/ecma3/GlobalObject/e15_1_2_n.as new file mode 100644 index 00000000000..3eb7a72c58c --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/GlobalObject/e15_1_2_n.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.1-2-n"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "The Global Object"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = new Array(); + thisError="no error"; + try{ + this(); + }catch(e:TypeError){ + thisError=e.toString(); + }finally{ + + testcases[tc] = new TestCase( SECTION, + "this()", + "TypeError: Error #1006", + typeError(thisError) ); + } + test(); diff --git a/mozilla/js/tamarin/test/ecma3/GlobalObject/e15_1_3.as b/mozilla/js/tamarin/test/ecma3/GlobalObject/e15_1_3.as new file mode 100644 index 00000000000..b8e8923c74d --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/GlobalObject/e15_1_3.as @@ -0,0 +1,57 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + var SECTION = "15-1.3"; + var VERSION = "ECMA_3"; + startTest(); + var TITLE = "Unicode Surrogate pairs"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + try { + decodeURI('\uD800'); + } catch (e ){ + trace( "Exception thrown" ); + } + + array[item++] = new TestCase( SECTION, "escape( false )", "false", escape( false ) ); + array[item++] = new TestCase( SECTION, "encodeURI('\u007f')", "%7F", encodeURI('\u007f') ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/GlobalObject/encodeURI.as b/mozilla/js/tamarin/test/ecma3/GlobalObject/encodeURI.as new file mode 100644 index 00000000000..4bbbdb5533b --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/GlobalObject/encodeURI.as @@ -0,0 +1,126 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.1.3.3"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "encodeURI"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + str1 = new String("h"); + + array[item++] = new TestCase( SECTION, "encodeURI('Empty String')", "", encodeURI("") ); + array[item++] = new TestCase( SECTION, "encodeURI('Single Character')", "h", encodeURI(str1) ); + + str2 = new String("http://www.macromedia.com/flash player"); + + array[item++] = new TestCase( SECTION, "encodeURI(str2)", "http://www.macromedia.com/flash%20player", encodeURI(str2) ); + + array[item++] = new TestCase( SECTION, "encodeURI('http://www.macromedia.com')", "http://www.macromedia.com", encodeURI("http://www.macromedia.com") ); + + array[item++] = new TestCase( SECTION, "encodeURI('http://www.macromedia.com')", "http://www.macromedia.com/flashA1player", encodeURI("http://www.macromedia.com/flash\u0041\u0031player") ); + + array[item++] = new TestCase( SECTION, "encodeURI('http://www.macromedia.com/flash player')", "http://www.macromedia.com/flash%20player", encodeURI("http://www.macromedia.com/flash player") ); + + array[item++] = new TestCase( SECTION, "encodeURI('http://www.macromedia.com/flasha player')", "http://www.macromedia.com/flasha%20player", encodeURI("http://www.macromedia.com/flasha player") ); + + array[item++] = new TestCase( SECTION, "encodeURI('http://www.macromedia.com/flashA player')", "http://www.macromedia.com/flashA%20player", encodeURI("http://www.macromedia.com/flashA player") ); + + array[item++] = new TestCase( SECTION, "encodeURI('http://www.macromedia.com/flash_ player')", "http://www.macromedia.com/flash_%20player", encodeURI("http://www.macromedia.com/flash_ player") ); + + array[item++] = new TestCase( SECTION, "encodeURI('http://www.macromedia.com/flash- player')", "http://www.macromedia.com/flash-%20player", encodeURI("http://www.macromedia.com/flash- player") ); + + array[item++] = new TestCase( SECTION, "encodeURI('http://www.macromedia.com/flash. player')", "http://www.macromedia.com/flash.%20player", encodeURI("http://www.macromedia.com/flash. player") ); + + array[item++] = new TestCase( SECTION, "encodeURI('http://www.macromedia.com/flash! player')", "http://www.macromedia.com/flash!%20player", encodeURI("http://www.macromedia.com/flash! player") ); + + array[item++] = new TestCase( SECTION, "encodeURI('http://www.macromedia.com/flash~ player')", "http://www.macromedia.com/flash~%20player", encodeURI("http://www.macromedia.com/flash~ player") ); + + array[item++] = new TestCase( SECTION, "encodeURI('http://www.macromedia.com/flash* player')", "http://www.macromedia.com/flash*%20player", encodeURI("http://www.macromedia.com/flash* player") ); + + array[item++] = new TestCase( SECTION, "encodeURI('http://www.macromedia.com/'flash player'')", "http://www.macromedia.com/'flash%20player'", encodeURI("http://www.macromedia.com/'flash player'") ); + + array[item++] = new TestCase( SECTION, "encodeURI('http://www.macromedia.com/(flash player)')", "http://www.macromedia.com/(flash%20player)", encodeURI("http://www.macromedia.com/(flash player)") ); + + array[item++] = new TestCase( SECTION, "encodeURI('http://www.macromedia.com//tflash player')", "http://www.macromedia.com//tflash%20player", encodeURI("http://www.macromedia.com//tflash player") ); + + array[item++] = new TestCase( SECTION, "encodeURI('http://www.macromedia.com/\tflash player')", "http://www.macromedia.com/%09flash%20player", encodeURI("http://www.macromedia.com/\tflash player") ); + + array[item++] = new TestCase( SECTION, "encodeURI('http://www.macromedia.com/0987654321flash player')", "http://www.macromedia.com/0987654321flash%20player", encodeURI("http://www.macromedia.com/0987654321flash player") ); + + array[item++] = new TestCase( SECTION, "encodeURI('http://www.macromedia.com/flash; player')", "http://www.macromedia.com/flash;%20player", encodeURI("http://www.macromedia.com/flash; player") ); + + array[item++] = new TestCase( SECTION, "encodeURI('http://www.macromedia.com/flash player?')", "http://www.macromedia.com/flash%20player?", encodeURI("http://www.macromedia.com/flash player?") ); + + array[item++] = new TestCase( SECTION, "encodeURI('http://www.macromedia.com/flash player@')", "http://www.macromedia.com/flash%20player@", encodeURI("http://www.macromedia.com/flash player@") ); + + array[item++] = new TestCase( SECTION, "encodeURI('http://www.macromedia.com/flash player&')", "http://www.macromedia.com/flash%20player&", encodeURI("http://www.macromedia.com/flash player&") ); + + array[item++] = new TestCase( SECTION, "encodeURI('http://www.macromedia.com/flash player=')", "http://www.macromedia.com/flash%20player=", encodeURI("http://www.macromedia.com/flash player=") ); + + array[item++] = new TestCase( SECTION, "encodeURI('http://www.macromedia.com/flash player$')", "http://www.macromedia.com/flash%20player$", encodeURI("http://www.macromedia.com/flash player$") ); + + + array[item++] = new TestCase( SECTION, "encodeURI('http://www.macromedia.com/flash player,')", "http://www.macromedia.com/flash%20player,", encodeURI("http://www.macromedia.com/flash player,") ); + + + array[item++] = new TestCase( SECTION, "encodeURI('aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ')", "aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ", encodeURI("aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ") ); + + array[item++] = new TestCase( SECTION, "encodeURI('aA_bB-cC.dD!eE~fF*gG'hH(iI)jJ;kK/lL?mM:nN@oO&pP=qQ+rR$sS,tT9uU8vV7wW6xX5yY4zZ')", "aA_bB-cC.dD!eE~fF*gG'hH(iI)jJ;kK/lL?mM:nN@oO&pP=qQ+rR$sS,tT9uU8vV7wW6xX5yY4zZ", encodeURI("aA_bB-cC.dD!eE~fF*gG'hH(iI)jJ;kK/lL?mM:nN@oO&pP=qQ+rR$sS,tT9uU8vV7wW6xX5yY4zZ") ); + + array[item++] = new TestCase( SECTION, "encodeURI('http://www.macromedia.com/flash\n player,')", "http://www.macromedia.com/flash%0Aplayer", encodeURI("http://www.macromedia.com/flash\nplayer") ); + + array[item++] = new TestCase( SECTION, "encodeURI('http://www.macromedia.com/flash\v player,')", "http://www.macromedia.com/flash%0Bplayer", encodeURI("http://www.macromedia.com/flash\vplayer") ); + + array[item++] = new TestCase( SECTION, "encodeURI('http://www.macromedia.com/flash\f player,')", "http://www.macromedia.com/flash%0Cplayer", encodeURI("http://www.macromedia.com/flash\fplayer") ); + + array[item++] = new TestCase( SECTION, "encodeURI('http://www.macromedia.com/flash\r player,')", "http://www.macromedia.com/flash%0Dplayer", encodeURI("http://www.macromedia.com/flash\rplayer") ); + + array[item++] = new TestCase( SECTION, "encodeURI('http://www.macromedia.com/flash\" player,')", "http://www.macromedia.com/flash%22player", encodeURI("http://www.macromedia.com/flash\"player") ); + + array[item++] = new TestCase( SECTION, "encodeURI('http://www.macromedia.com/flash\' player,')", "http://www.macromedia.com/flash'player", encodeURI("http://www.macromedia.com/flash\'player") ); + + array[item++] = new TestCase( SECTION, "encodeURI('http://www.macromedia.com/flash\\ player,')", "http://www.macromedia.com/flash%5Cplayer", encodeURI("http://www.macromedia.com/flash\\player") ); + + array[item++] = new TestCase( SECTION, "encodeURI('http://www.macromedia.com/flash# player,')", "http://www.macromedia.com/flash#player", encodeURI("http://www.macromedia.com/flash#player") ); + + array[item++] = new TestCase( SECTION, "encodeURI('http://www.macromedia.com/flash\u0000\u0041player,')", "http://www.macromedia.com/flash%00Aplayer", encodeURI("http://www.macromedia.com/flash\u0000\u0041player") ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/GlobalObject/encodeURIComponent.as b/mozilla/js/tamarin/test/ecma3/GlobalObject/encodeURIComponent.as new file mode 100644 index 00000000000..854e60d9b86 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/GlobalObject/encodeURIComponent.as @@ -0,0 +1,91 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.1.3.4"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "encodeURIComponent"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + str1 = new String("h"); + + array[item++] = new TestCase( SECTION, "encodeURIComponent('')", "", encodeURIComponent("") ); + + array[item++] = new TestCase( SECTION, "encodeURIComponent(str1)", "h", encodeURIComponent(str1) ); + + array[item++] = new TestCase( SECTION, "encodeURIComponent('Hello{[World]}')", "Hello%7B%5BWorld%5D%7D", encodeURIComponent("Hello{[World]}") ); + array[item++] = new TestCase( SECTION, "encodeURIComponent('Macromedia - Flash')", "Macromedia%20-%20Flash", encodeURIComponent("Macromedia - Flash") ); + array[item++] = new TestCase( SECTION, "encodeURIComponent('2 * 4 + [8 + 5 ] - 3')", "2%20*%204%20%2B%20%5B8%20%2B%205%20%5D%20-%203", encodeURIComponent("2 * 4 + [8 + 5 ] - 3") ); + array[item++] = new TestCase( SECTION, "encodeURIComponent('Flash(Macromedia)')", "Flash(Macromedia)", encodeURIComponent("Flash(Macromedia)") ); + array[item++] = new TestCase( SECTION, "encodeURIComponent('BugID #17485')", "BugID%20%2317485", encodeURIComponent("BugID #17485") ); + + array[item++] = new TestCase( SECTION, "encodeURIComponent('http://www.macromedia.com/flasha player')", "http%3A%2F%2Fwww.macromedia.com%2Fflasha%20player", encodeURIComponent("http://www.macromedia.com/flasha player") ); + + array[item++] = new TestCase( SECTION, "encodeURIComponent('http://www.macromedia.com/flashA player')", "http%3A%2F%2Fwww.macromedia.com%2FflashA%20player", encodeURIComponent("http://www.macromedia.com/flashA player") ); + + array[item++] = new TestCase( SECTION, "encodeURIComponent('http://www.macromedia.com/flash_ player')", "http%3A%2F%2Fwww.macromedia.com%2Fflash_%20player", encodeURIComponent("http://www.macromedia.com/flash_ player") ); + + array[item++] = new TestCase( SECTION, "encodeURIComponent('http://www.macromedia.com/flash- player')", "http%3A%2F%2Fwww.macromedia.com%2Fflash-%20player", encodeURIComponent("http://www.macromedia.com/flash- player") ); + + array[item++] = new TestCase( SECTION, "encodeURIComponent('http://www.macromedia.com/flash. player')", "http%3A%2F%2Fwww.macromedia.com%2Fflash.%20player", encodeURIComponent("http://www.macromedia.com/flash. player") ); + + array[item++] = new TestCase( SECTION, "encodeURIComponent('http://www.macromedia.com/flash! player')", "http%3A%2F%2Fwww.macromedia.com%2Fflash!%20player", encodeURIComponent("http://www.macromedia.com/flash! player") ); + + array[item++] = new TestCase( SECTION, "encodeURIComponent('http://www.macromedia.com/flash~ player')", "http%3A%2F%2Fwww.macromedia.com%2Fflash~%20player", encodeURIComponent("http://www.macromedia.com/flash~ player") ); + + array[item++] = new TestCase( SECTION, "encodeURIComponent('http://www.macromedia.com/flash* player')", "http%3A%2F%2Fwww.macromedia.com%2Fflash*%20player", encodeURIComponent("http://www.macromedia.com/flash* player") ); + + array[item++] = new TestCase( SECTION, "encodeURIComponent('http://www.macromedia.com/'flash player'')", "http%3A%2F%2Fwww.macromedia.com%2F'flash%20player'", encodeURIComponent("http://www.macromedia.com/'flash player'") ); + + array[item++] = new TestCase( SECTION, "encodeURIComponent('http://www.macromedia.com/(flash player)')", "http%3A%2F%2Fwww.macromedia.com%2F(flash%20player)", encodeURIComponent("http://www.macromedia.com/(flash player)") ); + + array[item++] = new TestCase( SECTION, "encodeURIComponent('http%3A%2F%2Fwww.macromedia.com/flash; player')", "http%3A%2F%2Fwww.macromedia.com%2Fflash%3B%20player", encodeURIComponent("http://www.macromedia.com/flash; player")+"" ); + + array[item++] = new TestCase( SECTION, "encodeURIComponent('http://www.macromedia.com/flash player?')", "http%3A%2F%2Fwww.macromedia.com%2Fflash%20player%3F", encodeURIComponent("http://www.macromedia.com/flash player?")+"" ); + + array[item++] = new TestCase( SECTION, "encodeURIComponent('http://www.macromedia.com/flash player@')", "http%3A%2F%2Fwww.macromedia.com%2Fflash%20player%40", encodeURIComponent("http://www.macromedia.com/flash player@")+"" ); + + array[item++] = new TestCase( SECTION, "encodeURIComponent('http://www.macromedia.com/flash player&')", "http%3A%2F%2Fwww.macromedia.com%2Fflash%20player%26", encodeURIComponent("http://www.macromedia.com/flash player&")+"" ); + + array[item++] = new TestCase( SECTION, "encodeURIComponent('http://www.macromedia.com/flash player=')", "http%3A%2F%2Fwww.macromedia.com%2Fflash%20player%3D", encodeURIComponent("http://www.macromedia.com/flash player=")+"" ); + + array[item++] = new TestCase( SECTION, "encodeURIComponent('http://www.macromedia.com/flash player$')", "http%3A%2F%2Fwww.macromedia.com%2Fflash%20player%24", encodeURIComponent("http://www.macromedia.com/flash player$")+"" ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/GlobalObject/undefined.as b/mozilla/js/tamarin/test/ecma3/GlobalObject/undefined.as new file mode 100644 index 00000000000..334e8837a43 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/GlobalObject/undefined.as @@ -0,0 +1,51 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.1.1.3"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "undefined"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "undefined", undefined, undefined ); + array[item++] = new TestCase( SECTION, "this.undefined", undefined, this.undefined ); + array[item++] = new TestCase( SECTION, "typeof undefined", "undefined", typeof undefined ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_1_1.as b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_1_1.as new file mode 100644 index 00000000000..3575f40ce11 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_1_1.as @@ -0,0 +1,87 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "7.1-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "White Space"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + + // whitespace between var reserved word and identifier + array[item++] = new TestCase( SECTION, "Testing white space","var MYVAR1=10",'var'+' '+'MYVAR1'+'='+'10'); + + // No-breakspace between var reserved word and identifier + //array[item++] = new TestCase( SECTION, "Testing No break space","var-áMYVAR1=10" ,'var'+'\u00A0'+'MYVAR1=10;MYVAR1'); + + + // tab between var reserved word and identifier + var MYVAR1=10; + array[item++] = new TestCase( SECTION, 'var'+'\t'+'MYVAR1=10;MYVAR1', 10, MYVAR1 ); + + // newline between var reserved word and identifier + var +MYVAR2=10; + array[item++] = new TestCase( SECTION, 'var'+'\n'+'MYVAR2=10;MYVAR2', 10, MYVAR2 ); + + //backspace between var reserved word and Result should be vaMYVAR2=10;MYVAR2 = 10 //PASSED! + array[item++] = new TestCase( SECTION, 'var'+'\b'+'MYVAR2=10;MYVAR2', 10, MYVAR2 ); + + //vertical tabspace between var reserved word and identifier + array[item++] = new TestCase( SECTION, 'var'+'\v'+'MYVAR2=10;MYVAR2', 10, MYVAR2 ); + + //form feed between var reserved word and identifier + array[item++] = new TestCase( SECTION, 'var'+'\f'+'MYVAR2=10;MYVAR2', 10, MYVAR2 ); + + //carriage return between var reserved word and identifier + array[item++] = new TestCase( SECTION, 'var'+'\r'+'MYVAR2=10;MYVAR2', 10, MYVAR2 ); + + //double quotes between var reserved word and identifier + array[item++] = new TestCase( SECTION, 'var'+'\"'+'MYVAR2=10;MYVAR2', 10, MYVAR2 ); + + //single quote between var reserved word and identifier + array[item++] = new TestCase( SECTION, 'var'+'\''+'MYVAR2=10;MYVAR2', 10, MYVAR2 ); + + //backslash between var reserved word and identifier + array[item++] = new TestCase( SECTION, 'var'+'\\'+'MYVAR2=10;MYVAR2', 10, MYVAR2 ); + + + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_2_10_rt.as b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_2_10_rt.as new file mode 100644 index 00000000000..deacec27ce1 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_2_10_rt.as @@ -0,0 +1,53 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "7.2-2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Line Terminators"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + var a=10; + var b=10; + var c; + + c=a+ +b + array[item++] = new TestCase( "7.2", "a", 20 , c); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_2_2_rt.as b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_2_2_rt.as new file mode 100644 index 00000000000..4005fc89013 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_2_2_rt.as @@ -0,0 +1,53 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "7.2-2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Line Terminators"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + var b=10; + var a; + a = + +b; + array[item++] = new TestCase( "7.2", "a", 10, a); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_2_3_rt.as b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_2_3_rt.as new file mode 100644 index 00000000000..2e51eb33ee6 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_2_3_rt.as @@ -0,0 +1,56 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "7.2-3"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Line Terminators"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + var b; + + + + b = + +20; + + array[item++] = new TestCase( "7.2", "b20", 20, b); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_2_4_rt.as b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_2_4_rt.as new file mode 100644 index 00000000000..2edc90640ca --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_2_4_rt.as @@ -0,0 +1,54 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "7.2-4"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Line Terminators"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + var a=10; +var b=10; +var c; + + c= +a+b + + array[item++] = new TestCase( "7.2", "ca+b", 20, c); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_2_5_rt.as b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_2_5_rt.as new file mode 100644 index 00000000000..6a98daa8722 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_2_5_rt.as @@ -0,0 +1,59 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "7.2-5"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Line Terminators"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + var a=10; +var b=10; +var c; + + + +c= +a ++ +b + + array[item++] = new TestCase( "7.2", "ca+b", 20, c); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_2_6_rt.as b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_2_6_rt.as new file mode 100644 index 00000000000..73e8181c2b3 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_2_6_rt.as @@ -0,0 +1,58 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "7.2-6"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Line Terminators"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + var a=10; +var b=10; +var c; + + + +c= +a +* +b + + array[item++] = new TestCase( "7.2", "ca*b", 100, c); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_2_7_rt.as b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_2_7_rt.as new file mode 100644 index 00000000000..f0d295982df --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_2_7_rt.as @@ -0,0 +1,58 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "7.2-7"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Line Terminators"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + var a=10; +var b=10; +var c; + + + +c= +a +/ +b + + array[item++] = new TestCase( "7.2", "ca/b", 1, c); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_2_8_rt.as b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_2_8_rt.as new file mode 100644 index 00000000000..8cce9d63226 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_2_8_rt.as @@ -0,0 +1,58 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "7.2-8"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Line Terminators"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + var a=20; +var b=10; +var c; + + + +c= +a +< +b + + array[item++] = new TestCase( "7.2", "ca<b", false, c); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_2_9_rt.as b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_2_9_rt.as new file mode 100644 index 00000000000..954223af5fe --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_2_9_rt.as @@ -0,0 +1,55 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "7.2-9"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Line Terminators"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + var a=10; +var b=10; +var c; + + c=a ++b + + array[item++] = new TestCase( "7.2", "c=a+b", 20, c); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_3_1.as b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_3_1.as new file mode 100644 index 00000000000..b8f2a351bcc --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_3_1.as @@ -0,0 +1,60 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "7.3-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Comments"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, + "a comment with a line terminator string, and text following", + "pass", + "pass"); + + // "\u000A" array[item].actual = "fail"; + + array[item] = new TestCase( SECTION, + "// test \\n array[item].actual = \"pass\"", + "pass", + "" ); + + array[item++].actual = 'pass'; + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_3_10.as b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_3_10.as new file mode 100644 index 00000000000..f82d441303b --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_3_10.as @@ -0,0 +1,51 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "7.3-10"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Comments"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, + "code following multiline comment", + "pass", + "fail"); + /*//*/array[0].actual="pass"; + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_3_11.as b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_3_11.as new file mode 100644 index 00000000000..44f3bb19082 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_3_11.as @@ -0,0 +1,50 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "7.3-11"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Comments"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, + "code following multiline comment", + "pass", + "pass"); + ////array[0].actual="fail"; + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_3_12.as b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_3_12.as new file mode 100644 index 00000000000..53e76ee77e8 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_3_12.as @@ -0,0 +1,50 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "7.3-12"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Comments"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, + "code following multiline comment", + "pass", + "pass"); + /*array[0].actual="fail";**/ + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_3_2.as b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_3_2.as new file mode 100644 index 00000000000..f6c3b86bd13 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_3_2.as @@ -0,0 +1,51 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "7.3-2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Comments"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, + "a comment with a carriage return, and text following", + "pass", + "pass"); + // "\u000D" array[0].actual = "fail"; + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_3_3.as b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_3_3.as new file mode 100644 index 00000000000..7ece6cf14a9 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_3_3.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "7.3-3"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Comments"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, + "source text directly following a single-line comment", + "pass", + "fail"); + // a comment string + array[0].actual = "pass"; + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_3_4.as b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_3_4.as new file mode 100644 index 00000000000..141bfc3a8e0 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_3_4.as @@ -0,0 +1,51 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "7.3-4"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Comments"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, + "multiline comment ", + "pass", + "pass"); + /*array[0].actual = "fail";*/ + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_3_5.as b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_3_5.as new file mode 100644 index 00000000000..d5c315eb8d4 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_3_5.as @@ -0,0 +1,50 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "7.3-5"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Comments"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, + "a comment with a carriage return, and text following", + "pass", + "pass"); + // "\u000A" array[0].actual = "fail"; + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_3_6.as b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_3_6.as new file mode 100644 index 00000000000..8ae503a2879 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_3_6.as @@ -0,0 +1,53 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "7.3-6"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Comments"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, + "comment with multiple asterisks", + "pass", + "fail"); + /* + ***/array[0].actual="pass"; + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_3_7.as b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_3_7.as new file mode 100644 index 00000000000..866fed85987 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_3_7.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "7.3-7"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Comments"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, + "single line comment following multiline comment", + "pass", + "pass"); + /* + ***///array[0].actual="fail"; + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_3_9.as b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_3_9.as new file mode 100644 index 00000000000..9a93f5998b2 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_3_9.as @@ -0,0 +1,51 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "7.3-9"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Comments"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, + "code following multiline comment", + "pass", + "fail"); + /*/*/array[0].actual="pass"; + return ( array ); +} + diff --git a/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_5_1.as b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_5_1.as new file mode 100644 index 00000000000..5679879f046 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_5_1.as @@ -0,0 +1,56 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "7.5-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Identifiers"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + //array[item++] = new TestCase( SECTION, "var $123 = 5", 5, eval("var $123 = 5;$123") ); + var $123 = 5; + array[item++] = new TestCase( SECTION, "var $123 = 5", 5, $123 ); + //array[item++] = new TestCase( SECTION, "var _123 = 5", 5, eval("var _123 = 5;_123") ); + var _123 = 5; + array[item++] = new TestCase( SECTION, "var _123 = 5", 5, _123); + var MyNumber:Number = 100 + var mynumber:Number = 20 + array[item++] = new TestCase( SECTION, "Testing case sensitivity of identifier", false, MyNumber==20); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_5_6.as b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_5_6.as new file mode 100644 index 00000000000..6f3c7e2c370 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_5_6.as @@ -0,0 +1,48 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "7.5-6"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Identifiers"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + var _0abc = 5; + array[item++] = new TestCase( SECTION, "var _0abc = 5", 5, _0abc ); + return ( array ); +} + diff --git a/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_5_7.as b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_5_7.as new file mode 100644 index 00000000000..4a0ae6f2a52 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_5_7.as @@ -0,0 +1,48 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "7.5-7"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Identifiers"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + var $0abc = 5; + array[item++] = new TestCase( SECTION, "var $0abc = 5", 5, $0abc ); + return ( array ); +} + diff --git a/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_6.as b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_6.as new file mode 100644 index 00000000000..4d4cbea2dd8 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_6.as @@ -0,0 +1,445 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "7.6"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Punctuators"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + //original, made changes to make it run in fp7 + + // == + var c:Number=1; + var d:String=1; + array[item++] = new TestCase( SECTION, + "var c,d;c==d", + true, + (c==d) ); + // === + var c; + var d; + array[item++] = new TestCase( SECTION, + "var c,d;c===d", + false, + (c===d) ); + + // = +var a=true; + array[item++] = new TestCase( SECTION, + "var a=true;a", + true, + (a) ); + + // > + var a=true; + var b=false; + array[item++] = new TestCase( SECTION, + "var a=true,b=false;a>b", + true, + (a>b) ); + + // < + var a=true; + var b=false; + array[item++] = new TestCase( SECTION, + "var a=true,b=false;a= + var a=0xFFFF; + var b=0XFFFE; + array[item++] = new TestCase( SECTION, + "var a=0xFFFF,b=0XFFFE;a>=b", + true, + a>=b); + //!= + var a=true; + var b=false; + array[item++] = new TestCase( SECTION, + "var a=true,b=false;a!=b", + true, + (a!=b) ); + +var a=false; +var b=false; + array[item++] = new TestCase( SECTION, + "var a=false,b=false;a!=b", + false, + (a!=b) ); + + //!== + var a=true; + var b=false; + array[item++] = new TestCase( SECTION, + "var a=true,b=false;a!==b", + true, + (a!==b) ); + +var a=false; +var b=false; + array[item++] = new TestCase( SECTION, + "var a=false,b=false;a!==b", + false, + (a!==b) ); + + var s1 = "5"; + var s2 = "5"; + + array[item++] = new TestCase( SECTION, + "var s1='5',s2='5';s1!==s2", + false, + (s1!==s2) ); + var n:Number = 5; + + array[item++] = new TestCase( SECTION, + "var s1='5',n=5;s1!==n", + true, + (s1!==n) ); + + var b:Boolean = true; + + array[item++] = new TestCase( SECTION, + "var s1='5',b=true;s1!==b", + true, + (s1!==b) ); + + + + // , +var a=true; +var b=false; + array[item++] = new TestCase( SECTION, + "var a=true,b=false;a,b", + false, + (a,b) ); + // ! + var a=true; + var b=false; + array[item++] = new TestCase( SECTION, + "var a=true,b=false;!a", + false, + (!a) ); + + // ~ + var a=true; + array[item++] = new TestCase( SECTION, + "var a=true;~a", + -2, + (~a) ); + // ? + array[item++] = new TestCase( SECTION, + "var a=true; (a ? 'PASS' : '')", + "PASS", + (a=true, (a ? 'PASS' : '') ) ); + + // : + + array[item++] = new TestCase( SECTION, + "var a=false; (a ? 'FAIL' : 'PASS')", + "PASS", + (a=false, (a ? 'FAIL' : 'PASS') ) ); + // . + +var a=Number; + array[item++] = new TestCase( SECTION, + "var a=Number;a.NaN", + NaN, + (a.NaN) ); + + // && + + var a=true; + var b=true; + var mResult; + if(a&&b){ + mResult = 'PASS' + } else { mResult = 'FAIL'; } + array[item++] = new TestCase( SECTION, + "var a=true,b=true;if(a&&b)'PASS';else'FAIL'", + "PASS", + mResult ); + + // || + var a=true; + var b=true; + var mResult; + if(a||b){ + mResult = 'PASS' + } else { mResult = 'FAIL'; } + array[item++] = new TestCase( SECTION, + "var a=false,b=false;if(a||b)'FAIL';else'PASS'", + "PASS", + mResult ); + // ++ + var a=false; + var b=false; + array[item++] = new TestCase( SECTION, + "var a=false,b=false;++a", + 1, + (++a) ); + // -- + var a=true; + var b=false; + array[item++] = new TestCase( SECTION, + "var a=true,b=false--a", + 0, + (--a) ); + // + + var a=true; + var b=true; + array[item++] = new TestCase( SECTION, + "var a=true,b=true;a+b", + 2, + (a+b) ); + // - + var a=true; + var b=true; + array[item++] = new TestCase( SECTION, + "var a=true,b=true;a-b", + 0, + (a-b) ); + // * + var a=true; + var b=true; + array[item++] = new TestCase( SECTION, + "var a=true,b=true;a*b", + 1, + (a*b) ); + // / + var a=true; + var b=true; + array[item++] = new TestCase( SECTION, + "var a=true,b=true;a/b", + 1, + (a/b) ); + // & +var a1=3; +var b1=2; + array[item++] = new TestCase( SECTION, + "var a1=3,b1=2;a1&b1", + 2, + ((a1)&(b1)) ); + // | + var a2=4; + var b2=3; + array[item++] = new TestCase( SECTION, + "var a2=4,b2=3;a2|b2", + 7, + ((a2)|(b2)) ); + + // | + var a3=4; + var b3=3; + array[item++] = new TestCase( SECTION, + "var a3=4,b3=3;a^b", + 7, + ((a3)^(b3)) ); + + // % + var a4=4; + var b4=3; + array[item++] = new TestCase( SECTION, + "var a4=4,b4=3;a4%b4", + 1, + ((a4)%(b4)) ); + + // << + var a5=4; + var b5=3; + array[item++] = new TestCase( SECTION, + "var a5=4,b5=3;a5<> + var a6=4; + var b6=1; + array[item++] = new TestCase( SECTION, + "var a6=4,b6=1;a6>>b6", + 2, + ((a6)>>(b6)) ); + + // >>> + var a7=1; + var b7=1; + array[item++] = new TestCase( SECTION, + "var a7=1,b7=1;a7>>>b7", + 0, + ((a7)>>>(b7)) ); + // += + var a8=4; + var b8=3; + a8+=b8; + array[item++] = new TestCase( SECTION, + "var a8=4,b8=3;a8+=b8;a8", + 7, + (a8) ); + + // -= + var a9=4; + var b9=3; + a9-=b9; + array[item++] = new TestCase( SECTION, + "var a9=4,b9=3;a9-=b9;a9", + 1, + (a9) ); + // *= + var a10=4; + var b10=3; + a10*=b10; + array[item++] = new TestCase( SECTION, + "var a10=4,b10=3;a10*=b10;a10", + 12, + (a10) ); + // += + var a11=4; + var b11=3; + a11+=b11; + array[item++] = new TestCase( SECTION, + "var a11=4,b11=3;a11+=b11;a11", + 7, + (a11) ); + // /= + var a12=12; + var b12=3; + a12/=b12; + array[item++] = new TestCase( SECTION, + "var a12=12,b12=3;a12/=b12;a12", + 4, + (a12) ); + + // &= + var a12=4; + var b12=5;a12&=b12; + array[item++] = new TestCase( SECTION, + "var a12=4,b12=5;a12&=b12;a12", + 4, + (a12) ); + + // |= + var a13=4; + var b13=5; + a13|=b13; + array[item++] = new TestCase( SECTION, + "var a13=4,b13=5;a13&=b13;a13", + 5, + (a13) ); + // ^= + var a14=4; + var b14=5; + a14^=b14; + array[item++] = new TestCase( SECTION, + "var a14=4,b14=5;a14^=b14;a14", + 1, + (a14) ); + // %= + var a15=12; + var b15=5; + a15%=b15; + array[item++] = new TestCase( SECTION, + "var a15=12,b15=5;a15%=b15;a15", + 2, + (a15) ); + // <<= + var a16=4; + var b16=3; + a16<<=b16; + array[item++] = new TestCase( SECTION, + "var a16=4,b16=3;a16<<=b16;a16", + 32, + (a16) ); + + // >> + var a17=4; + var b17=1; + a17>>=b17; + array[item++] = new TestCase( SECTION, + "var a17=4,b17=1;a17>>=b17;a17", + 2, + (a17) ); + + // >>> + var a18=1; + var b18=1; + a18>>>=b18; + array[item++] = new TestCase( SECTION, + "var a18=1,b18=1;a18>>>=b18;a18", + 0, + (a18) ); + + // () + var a=4; + var b=3; + array[item++] = new TestCase( SECTION, + "var a=4,b=3;(a)", + 4, + (a) ); + // {} + var a19=4; + var b19=3; + + array[item++] = new TestCase( SECTION, + "var a19=4,b19=3;{b19}", + 3, + b19 ); + + // [] + var a=new Array('hi'); + array[item++] = new TestCase( SECTION, + "var a=new Array('hi');a[0]", + "hi", + (a[0]) ); + + array[item++] = new TestCase( SECTION, + ";", + void 0, + void 0 ); + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_7_1.as b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_7_1.as new file mode 100644 index 00000000000..365b9be61cb --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_7_1.as @@ -0,0 +1,49 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "7.7.1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Null Literals"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "null", null, null); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_7_2.as b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_7_2.as new file mode 100644 index 00000000000..ef22bbe89b8 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_7_2.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "7.7.2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Boolean Literals"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // StringLiteral:: "" and '' + + array[item++] = new TestCase( SECTION, "true", Boolean(true), true ); + array[item++] = new TestCase( SECTION, "false", Boolean(false), false ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_7_3.as b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_7_3.as new file mode 100644 index 00000000000..40e87aa1e51 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_7_3.as @@ -0,0 +1,316 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "7.7.3"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Numeric Literals"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "0", 0, 0 ); + array[item++] = new TestCase( SECTION, "1", 1, 1 ); + array[item++] = new TestCase( SECTION, "2", 2, 2 ); + array[item++] = new TestCase( SECTION, "3", 3, 3 ); + array[item++] = new TestCase( SECTION, "4", 4, 4 ); + array[item++] = new TestCase( SECTION, "5", 5, 5 ); + array[item++] = new TestCase( SECTION, "6", 6, 6 ); + array[item++] = new TestCase( SECTION, "7", 7, 7 ); + array[item++] = new TestCase( SECTION, "8", 8, 8 ); + array[item++] = new TestCase( SECTION, "9", 9, 9 ); + + array[item++] = new TestCase( SECTION, "0.", 0, 0. ); + array[item++] = new TestCase( SECTION, "1.", 1, 1. ); + array[item++] = new TestCase( SECTION, "2.", 2, 2. ); + array[item++] = new TestCase( SECTION, "3.", 3, 3. ); + array[item++] = new TestCase( SECTION, "4.", 4, 4. ); + + array[item++] = new TestCase( SECTION, "0.e0", 0, 0.e0 ); + array[item++] = new TestCase( SECTION, "1.e1", 10, 1.e1 ); + array[item++] = new TestCase( SECTION, "2.e2", 200, 2.e2 ); + array[item++] = new TestCase( SECTION, "3.e3", 3000, 3.e3 ); + array[item++] = new TestCase( SECTION, "4.e4", 40000, 4.e4 ); + + array[item++] = new TestCase( SECTION, "0.1e0", .1, 0.1e0 ); + array[item++] = new TestCase( SECTION, "1.1e1", 11, 1.1e1 ); + array[item++] = new TestCase( SECTION, "2.2e2", 220, 2.2e2 ); + array[item++] = new TestCase( SECTION, "3.3e3", 3300, 3.3e3 ); + array[item++] = new TestCase( SECTION, "4.4e4", 44000, 4.4e4 ); + + array[item++] = new TestCase( SECTION, ".1e0", .1, .1e0 ); + array[item++] = new TestCase( SECTION, ".1e1", 1, .1e1 ); + array[item++] = new TestCase( SECTION, ".2e2", 20, .2e2 ); + array[item++] = new TestCase( SECTION, ".3e3", 300, .3e3 ); + array[item++] = new TestCase( SECTION, ".4e4", 4000, .4e4 ); + + array[item++] = new TestCase( SECTION, "0e0", 0, 0e0 ); + array[item++] = new TestCase( SECTION, "1e1", 10, 1e1 ); + array[item++] = new TestCase( SECTION, "2e2", 200, 2e2 ); + array[item++] = new TestCase( SECTION, "3e3", 3000, 3e3 ); + array[item++] = new TestCase( SECTION, "4e4", 40000, 4e4 ); + + array[item++] = new TestCase( SECTION, "0e0", 0, 0e0 ); + array[item++] = new TestCase( SECTION, "1e1", 10, 1e1 ); + array[item++] = new TestCase( SECTION, "2e2", 200, 2e2 ); + array[item++] = new TestCase( SECTION, "3e3", 3000, 3e3 ); + array[item++] = new TestCase( SECTION, "4e4", 40000, 4e4 ); + + array[item++] = new TestCase( SECTION, "0E0", 0, 0E0 ); + array[item++] = new TestCase( SECTION, "1E1", 10, 1E1 ); + array[item++] = new TestCase( SECTION, "2E2", 200, 2E2 ); + array[item++] = new TestCase( SECTION, "3E3", 3000, 3E3 ); + array[item++] = new TestCase( SECTION, "4E4", 40000, 4E4 ); + + array[item++] = new TestCase( SECTION, "1.e-1", 0.1, 1.e-1 ); + array[item++] = new TestCase( SECTION, "2.e-2", 0.02, 2.e-2 ); + array[item++] = new TestCase( SECTION, "3.e-3", 0.003, 3.e-3 ); + array[item++] = new TestCase( SECTION, "4.e-4", 0.0004, 4.e-4 ); + + array[item++] = new TestCase( SECTION, "0.1e-0", .1, 0.1e-0 ); + array[item++] = new TestCase( SECTION, "1.1e-1", 0.11, 1.1e-1 ); + array[item++] = new TestCase( SECTION, "2.2e-2", .022, 2.2e-2 ); + array[item++] = new TestCase( SECTION, "3.3e-3", .0033, 3.3e-3 ); + array[item++] = new TestCase( SECTION, "4.4e-4", .00044, 4.4e-4 ); + + array[item++] = new TestCase( SECTION, ".1e-0", .1, .1e-0 ); + array[item++] = new TestCase( SECTION, ".1e-1", .01, .1e-1 ); + array[item++] = new TestCase( SECTION, ".2e-2", .002, .2e-2 ); + array[item++] = new TestCase( SECTION, ".3e-3", .0003, .3e-3 ); + array[item++] = new TestCase( SECTION, ".4e-4", .00004, .4e-4 ); + + array[item++] = new TestCase( SECTION, "1.e+1", 10, 1.e+1 ); + array[item++] = new TestCase( SECTION, "2.e+2", 200, 2.e+2 ); + array[item++] = new TestCase( SECTION, "3.e+3", 3000, 3.e+3 ); + array[item++] = new TestCase( SECTION, "4.e+4", 40000, 4.e+4 ); + + array[item++] = new TestCase( SECTION, "0.1e+0", .1, 0.1e+0 ); + array[item++] = new TestCase( SECTION, "1.1e+1", 11, 1.1e+1 ); + array[item++] = new TestCase( SECTION, "2.2e+2", 220, 2.2e+2 ); + array[item++] = new TestCase( SECTION, "3.3e+3", 3300, 3.3e+3 ); + array[item++] = new TestCase( SECTION, "4.4e+4", 44000, 4.4e+4 ); + + array[item++] = new TestCase( SECTION, ".1e+0", .1, .1e+0 ); + array[item++] = new TestCase( SECTION, ".1e+1", 1, .1e+1 ); + array[item++] = new TestCase( SECTION, ".2e+2", 20, .2e+2 ); + array[item++] = new TestCase( SECTION, ".3e+3", 300, .3e+3 ); + array[item++] = new TestCase( SECTION, ".4e+4", 4000, .4e+4 ); + + array[item++] = new TestCase( SECTION, "0x0", 0, 0x0 ); + array[item++] = new TestCase( SECTION, "0x1", 1, 0x1 ); + array[item++] = new TestCase( SECTION, "0x2", 2, 0x2 ); + array[item++] = new TestCase( SECTION, "0x3", 3, 0x3 ); + array[item++] = new TestCase( SECTION, "0x4", 4, 0x4 ); + array[item++] = new TestCase( SECTION, "0x5", 5, 0x5 ); + array[item++] = new TestCase( SECTION, "0x6", 6, 0x6 ); + array[item++] = new TestCase( SECTION, "0x7", 7, 0x7 ); + array[item++] = new TestCase( SECTION, "0x8", 8, 0x8 ); + array[item++] = new TestCase( SECTION, "0x9", 9, 0x9 ); + array[item++] = new TestCase( SECTION, "0xa", 10, 0xa ); + array[item++] = new TestCase( SECTION, "0xb", 11, 0xb ); + array[item++] = new TestCase( SECTION, "0xc", 12, 0xc ); + array[item++] = new TestCase( SECTION, "0xd", 13, 0xd ); + array[item++] = new TestCase( SECTION, "0xe", 14, 0xe ); + array[item++] = new TestCase( SECTION, "0xf", 15, 0xf ); + + array[item++] = new TestCase( SECTION, "0X0", 0, 0X0 ); + array[item++] = new TestCase( SECTION, "0X1", 1, 0X1 ); + array[item++] = new TestCase( SECTION, "0X2", 2, 0X2 ); + array[item++] = new TestCase( SECTION, "0X3", 3, 0X3 ); + array[item++] = new TestCase( SECTION, "0X4", 4, 0X4 ); + array[item++] = new TestCase( SECTION, "0X5", 5, 0X5 ); + array[item++] = new TestCase( SECTION, "0X6", 6, 0X6 ); + array[item++] = new TestCase( SECTION, "0X7", 7, 0X7 ); + array[item++] = new TestCase( SECTION, "0X8", 8, 0X8 ); + array[item++] = new TestCase( SECTION, "0X9", 9, 0X9 ); + array[item++] = new TestCase( SECTION, "0Xa", 10, 0Xa ); + array[item++] = new TestCase( SECTION, "0Xb", 11, 0Xb ); + array[item++] = new TestCase( SECTION, "0Xc", 12, 0Xc ); + array[item++] = new TestCase( SECTION, "0Xd", 13, 0Xd ); + array[item++] = new TestCase( SECTION, "0Xe", 14, 0Xe ); + array[item++] = new TestCase( SECTION, "0Xf", 15, 0Xf ); + + array[item++] = new TestCase( SECTION, "0x0", 0, 0x0 ); + array[item++] = new TestCase( SECTION, "0x1", 1, 0x1 ); + array[item++] = new TestCase( SECTION, "0x2", 2, 0x2 ); + array[item++] = new TestCase( SECTION, "0x3", 3, 0x3 ); + array[item++] = new TestCase( SECTION, "0x4", 4, 0x4 ); + array[item++] = new TestCase( SECTION, "0x5", 5, 0x5 ); + array[item++] = new TestCase( SECTION, "0x6", 6, 0x6 ); + array[item++] = new TestCase( SECTION, "0x7", 7, 0x7 ); + array[item++] = new TestCase( SECTION, "0x8", 8, 0x8 ); + array[item++] = new TestCase( SECTION, "0x9", 9, 0x9 ); + array[item++] = new TestCase( SECTION, "0xA", 10, 0xA ); + array[item++] = new TestCase( SECTION, "0xB", 11, 0xB ); + array[item++] = new TestCase( SECTION, "0xC", 12, 0xC ); + array[item++] = new TestCase( SECTION, "0xD", 13, 0xD ); + array[item++] = new TestCase( SECTION, "0xE", 14, 0xE ); + array[item++] = new TestCase( SECTION, "0xF", 15, 0xF ); + + array[item++] = new TestCase( SECTION, "0X0", 0, 0X0 ); + array[item++] = new TestCase( SECTION, "0X1", 1, 0X1 ); + array[item++] = new TestCase( SECTION, "0X2", 2, 0X2 ); + array[item++] = new TestCase( SECTION, "0X3", 3, 0X3 ); + array[item++] = new TestCase( SECTION, "0X4", 4, 0X4 ); + array[item++] = new TestCase( SECTION, "0X5", 5, 0X5 ); + array[item++] = new TestCase( SECTION, "0X6", 6, 0X6 ); + array[item++] = new TestCase( SECTION, "0X7", 7, 0X7 ); + array[item++] = new TestCase( SECTION, "0X8", 8, 0X8 ); + array[item++] = new TestCase( SECTION, "0X9", 9, 0X9 ); + array[item++] = new TestCase( SECTION, "0XA", 10, 0XA ); + array[item++] = new TestCase( SECTION, "0XB", 11, 0XB ); + array[item++] = new TestCase( SECTION, "0XC", 12, 0XC ); + array[item++] = new TestCase( SECTION, "0XD", 13, 0XD ); + array[item++] = new TestCase( SECTION, "0XE", 14, 0XE ); + array[item++] = new TestCase( SECTION, "0XF", 15, 0XF ); + + + // we will not support octal for flash 8 + array[item++] = new TestCase( SECTION, "00", 0, 00 ); + array[item++] = new TestCase( SECTION, "01", 1, 01 ); + array[item++] = new TestCase( SECTION, "02", 2, 02 ); + array[item++] = new TestCase( SECTION, "03", 3, 03 ); + array[item++] = new TestCase( SECTION, "04", 4, 04 ); + array[item++] = new TestCase( SECTION, "05", 5, 05 ); + array[item++] = new TestCase( SECTION, "06", 6, 06 ); + array[item++] = new TestCase( SECTION, "07", 7, 07 ); + + array[item++] = new TestCase( SECTION, "000", 0, 000 ); + array[item++] = new TestCase( SECTION, "011", 11, 011 ); + array[item++] = new TestCase( SECTION, "022", 22, 022 ); + array[item++] = new TestCase( SECTION, "033", 33, 033 ); + array[item++] = new TestCase( SECTION, "044", 44, 044 ); + array[item++] = new TestCase( SECTION, "055", 55, 055 ); + array[item++] = new TestCase( SECTION, "066", 66, 066 ); + array[item++] = new TestCase( SECTION, "077", 77, 077 ); + + array[item++] = new TestCase( SECTION, "0.00000000001", 0.00000000001, 0.00000000001 ); + array[item++] = new TestCase( SECTION, "0.00000000001e-2", 0.0000000000001, 0.00000000001e-2 ); + + + array[item++] = new TestCase( SECTION, + "123456789012345671.9999", + "123456789012345660", + 123456789012345671.9999 +""); + array[item++] = new TestCase( SECTION, + "123456789012345672", + "123456789012345660", + 123456789012345672 +""); + + array[item++] = new TestCase( SECTION, + "123456789012345672.000000000000000000000000000", + "123456789012345660", + 123456789012345672.000000000000000000000000000 +""); + + array[item++] = new TestCase( SECTION, + "123456789012345672.01", + "123456789012345680", + 123456789012345672.01 +""); + + array[item++] = new TestCase( SECTION, + "123456789012345672.000000000000000000000000001+'' == 123456789012345680 || 123456789012345660", + true, + ( 123456789012345672.00000000000000000000000000 +"" == 1234567890 * 100000000 + 12345680 ) + || + ( 123456789012345672.00000000000000000000000000 +"" == 1234567890 * 100000000 + 12345660) ); + + array[item++] = new TestCase( SECTION, + "123456789012345673", + "123456789012345680", + 123456789012345673 +"" ); + + array[item++] = new TestCase( SECTION, + "-123456789012345671.9999", + "-123456789012345660", + -123456789012345671.9999 +"" ); + + array[item++] = new TestCase( SECTION, + "-123456789012345672", + "-123456789012345660", + -123456789012345672+""); + + array[item++] = new TestCase( SECTION, + "-123456789012345672.000000000000000000000000000", + "-123456789012345660", + -123456789012345672.000000000000000000000000000 +""); + + array[item++] = new TestCase( SECTION, + "-123456789012345672.01", + "-123456789012345680", + -123456789012345672.01 +"" ); + + array[item++] = new TestCase( SECTION, + "-123456789012345672.000000000000000000000000001 == -123456789012345680 or -123456789012345660", + true, + (-123456789012345672.000000000000000000000000001 == -1234567890 * 100000000 -12345680) + || + (-123456789012345672.000000000000000000000000001 == -1234567890 * 100000000 -12345660)); + + array[item++] = new TestCase( SECTION, + -123456789012345673, + "-123456789012345680", + -123456789012345673 +""); + + array[item++] = new TestCase( SECTION, + "12345678901234567890", + "12345678901234567000", + 12345678901234567890 +"" ); + + + + /*array[item++] = new TestCase( SECTION, "12345678901234567", "12345678901234567", 12345678901234567+"" ); + array[item++] = new TestCase( SECTION, "123456789012345678", "123456789012345678", 123456789012345678+"" ); + array[item++] = new TestCase( SECTION, "1234567890123456789", "1234567890123456789", 1234567890123456789+"" ); + array[item++] = new TestCase( SECTION, "12345678901234567890", "12345678901234567890", 12345678901234567890+"" ); + array[item++] = new TestCase( SECTION, "123456789012345678900", "123456789012345678900", 123456789012345678900+"" ); + array[item++] = new TestCase( SECTION, "1234567890123456789000", "1234567890123456789000", 1234567890123456789000+"" );*/ + + array[item++] = new TestCase( SECTION, "0x1", 1, 0x1 ); + array[item++] = new TestCase( SECTION, "0x10", 16, 0x10 ); + array[item++] = new TestCase( SECTION, "0x100", 256, 0x100 ); + array[item++] = new TestCase( SECTION, "0x1000", 4096, 0x1000 ); + array[item++] = new TestCase( SECTION, "0x10000", 65536, 0x10000 ); + array[item++] = new TestCase( SECTION, "0x100000", 1048576, 0x100000 ); + array[item++] = new TestCase( SECTION, "0x1000000", 16777216, 0x1000000 ); + array[item++] = new TestCase( SECTION, "0x10000000", 268435456, 0x10000000 ); + + array[item++] = new TestCase( SECTION, "0x100000000", 4294967296, 0x100000000 ); + array[item++] = new TestCase( SECTION, "0x1000000000", 68719476736, 0x1000000000 ); + array[item++] = new TestCase( SECTION, "0x10000000000", 1099511627776, 0x10000000000 ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_7_3_1.as b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_7_3_1.as new file mode 100644 index 00000000000..82c692dc403 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_7_3_1.as @@ -0,0 +1,180 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "7.7.3-1"; +var VERSION = "ECMA_1"; + startTest(); +var TITLE = "Numeric Literals"; +var BUGNUMBER="122877"; + +writeHeaderToLog( SECTION + " "+ TITLE); + +var testcases = getTestCases(); + +test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, + "0x12345678", + 305419896, + 0x12345678 ); + + array[item++] = new TestCase( SECTION, + "0x80000000", + 2147483648, + 0x80000000 ); + + array[item++] = new TestCase( SECTION, + "0xffffffff", + 4294967295, + 0xffffffff ); + + array[item++] = new TestCase( SECTION, + "0x100000000", + 4294967296, + 0x100000000 ); + + // we will not support octal for flash 8 + /*array[item++] = new TestCase( SECTION, + "077777777777777777", + 2251799813685247, + 077777777777777777 ); + + array[item++] = new TestCase( SECTION, + "077777777777777776", + 2251799813685246, + 077777777777777776 ); + */ + array[item++] = new TestCase( SECTION, + "0x1fffffffffffff", + 9007199254740991, + 0x1fffffffffffff ); + + array[item++] = new TestCase( SECTION, + "0x20000000000000", + 9007199254740992, + 0x20000000000000 ); + + array[item++] = new TestCase( SECTION, + "0x20123456789abc", + 9027215253084860, + 0x20123456789abc ); + + array[item++] = new TestCase( SECTION, + "0x20123456789abd", + 9027215253084860, + 0x20123456789abd ); + + array[item++] = new TestCase( SECTION, + "0x20123456789abe", + 9027215253084862, + 0x20123456789abe ); + + array[item++] = new TestCase( SECTION, + "0x20123456789abf", + 9027215253084864, + 0x20123456789abf ); + + array[item++] = new TestCase( SECTION, + "0x1000000000000080", + 1152921504606847000, + 0x1000000000000080 ); + + array[item++] = new TestCase( SECTION, + "0x1000000000000081", + 1152921504606847200, + 0x1000000000000081 ); + + array[item++] = new TestCase( SECTION, + "0x1000000000000100", + 1152921504606847200, + 0x1000000000000100 ); + + array[item++] = new TestCase( SECTION, + "0x100000000000017f", + 1152921504606847200, + 0x100000000000017f ); + + array[item++] = new TestCase( SECTION, + "0x1000000000000180", + (1152921504606847500), + 0x1000000000000180); + + array[item++] = new TestCase( SECTION, + "0x1000000000000181", + 1152921504606847500, + 0x1000000000000181 ); + + array[item++] = new TestCase( SECTION, + "0x10000000000001f0", + 1152921504606847500, + 0x10000000000001f0 ); + + array[item++] = new TestCase( SECTION, + "0x1000000000000200", + 1152921504606847500, + 0x1000000000000200 ); + + array[item++] = new TestCase( SECTION, + "0x100000000000027f", + 1152921504606847500, + 0x100000000000027f ); + + array[item++] = new TestCase( SECTION, + "0x1000000000000280", + 1152921504606847500, + 0x1000000000000280 ); + + array[item++] = new TestCase( SECTION, + "0x1000000000000281", + 1152921504606847700, + 0x1000000000000281 ); + + array[item++] = new TestCase( SECTION, + "0x10000000000002ff", + 1152921504606847700, + 0x10000000000002ff ); + + array[item++] = new TestCase( SECTION, + "0x1000000000000300", + 1152921504606847700, + 0x1000000000000300 ); + + array[item++] = new TestCase( SECTION, + "0x10000000000000000", + 18446744073709552000, + 0x10000000000000000 ); + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_7_3_2.as b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_7_3_2.as new file mode 100644 index 00000000000..29c21173df6 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_7_3_2.as @@ -0,0 +1,69 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "7.7.3-2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Numeric Literals"; + var BUGNUMBER="122884"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, + "9", + 9, + 9 ); + + array[item++] = new TestCase( SECTION, + "09", + 9, + 09 ); + + array[item++] = new TestCase( SECTION, + "099", + 99, + 099 ); + + + array[item++] = new TestCase( SECTION, + "077", + 77, + 077 ); + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_7_4.as b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_7_4.as new file mode 100644 index 00000000000..4dd732ec895 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_7_4.as @@ -0,0 +1,209 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "7.7.4"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "String Literals"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // StringLiteral:: "" and '' + + array[item++] = new TestCase( SECTION, "\"\"", "", "" ); + array[item++] = new TestCase( SECTION, "\'\'", "", '' ); + + // DoubleStringCharacters:: DoubleStringCharacter :: EscapeSequence :: CharacterEscapeSequence + array[item++] = new TestCase( SECTION, "\\\"", String.fromCharCode(0x0022), "\"" ); + array[item++] = new TestCase( SECTION, "\\\'", String.fromCharCode(0x0027), "\'" ); + array[item++] = new TestCase( SECTION, "\\", String.fromCharCode(0x005C), "\\" ); + array[item++] = new TestCase( SECTION, "\\b", String.fromCharCode(0x0008), "\b" ); + array[item++] = new TestCase( SECTION, "\\f", String.fromCharCode(0x000C), "\f" ); + array[item++] = new TestCase( SECTION, "\\n", String.fromCharCode(0x000A), "\n" ); + array[item++] = new TestCase( SECTION, "\\r", String.fromCharCode(0x000D), "\r" ); + array[item++] = new TestCase( SECTION, "\\t", String.fromCharCode(0x0009), "\t" ); + array[item++] = new TestCase( SECTION, "\\v", String.fromCharCode(0x000B), "\v" ); + +// following line commented out as it causes a compile time error +// array[item++] = new TestCase( SECTION, "\\444", "444", "\444" ); + + // DoubleStringCharacters:DoubleStringCharacter::EscapeSequence::HexEscapeSequence +/* + array[item++] = new TestCase( SECTION, "\\x0", String.fromCharCode(0), "\x0" ); + array[item++] = new TestCase( SECTION, "\\x1", String.fromCharCode(1), "\x1" ); + array[item++] = new TestCase( SECTION, "\\x2", String.fromCharCode(2), "\x2" ); + array[item++] = new TestCase( SECTION, "\\x3", String.fromCharCode(3), "\x3" ); + array[item++] = new TestCase( SECTION, "\\x4", String.fromCharCode(4), "\x4" ); + array[item++] = new TestCase( SECTION, "\\x5", String.fromCharCode(5), "\x5" ); + array[item++] = new TestCase( SECTION, "\\x6", String.fromCharCode(6), "\x6" ); + array[item++] = new TestCase( SECTION, "\\x7", String.fromCharCode(7), "\x7" ); + array[item++] = new TestCase( SECTION, "\\x8", String.fromCharCode(8), "\x8" ); + array[item++] = new TestCase( SECTION, "\\x9", String.fromCharCode(9), "\x9" ); + array[item++] = new TestCase( SECTION, "\\xA", String.fromCharCode(10), "\xA" ); + array[item++] = new TestCase( SECTION, "\\xB", String.fromCharCode(11), "\xB" ); + array[item++] = new TestCase( SECTION, "\\xC", String.fromCharCode(12), "\xC" ); + array[item++] = new TestCase( SECTION, "\\xD", String.fromCharCode(13), "\xD" ); + array[item++] = new TestCase( SECTION, "\\xE", String.fromCharCode(14), "\xE" ); + array[item++] = new TestCase( SECTION, "\\xF", String.fromCharCode(15), "\xF" ); + +*/ + array[item++] = new TestCase( SECTION, "\\xF0", String.fromCharCode(240), "\xF0" ); + array[item++] = new TestCase( SECTION, "\\xE1", String.fromCharCode(225), "\xE1" ); + array[item++] = new TestCase( SECTION, "\\xD2", String.fromCharCode(210), "\xD2" ); + array[item++] = new TestCase( SECTION, "\\xC3", String.fromCharCode(195), "\xC3" ); + array[item++] = new TestCase( SECTION, "\\xB4", String.fromCharCode(180), "\xB4" ); + array[item++] = new TestCase( SECTION, "\\xA5", String.fromCharCode(165), "\xA5" ); + array[item++] = new TestCase( SECTION, "\\x96", String.fromCharCode(150), "\x96" ); + array[item++] = new TestCase( SECTION, "\\x87", String.fromCharCode(135), "\x87" ); + array[item++] = new TestCase( SECTION, "\\x78", String.fromCharCode(120), "\x78" ); + array[item++] = new TestCase( SECTION, "\\x69", String.fromCharCode(105), "\x69" ); + array[item++] = new TestCase( SECTION, "\\x5A", String.fromCharCode(90), "\x5A" ); + array[item++] = new TestCase( SECTION, "\\x4B", String.fromCharCode(75), "\x4B" ); + array[item++] = new TestCase( SECTION, "\\x3C", String.fromCharCode(60), "\x3C" ); + array[item++] = new TestCase( SECTION, "\\x2D", String.fromCharCode(45), "\x2D" ); + array[item++] = new TestCase( SECTION, "\\x1E", String.fromCharCode(30), "\x1E" ); + array[item++] = new TestCase( SECTION, "\\x0F", String.fromCharCode(15), "\x0F" ); + + // string literals only take up to two hext digits. therefore, the third character in this string + // should be interpreted as a StringCharacter and not part of the HextEscapeSequence + + array[item++] = new TestCase( SECTION, "\\xF0F", String.fromCharCode(240)+"F", "\xF0F" ); + array[item++] = new TestCase( SECTION, "\\xE1E", String.fromCharCode(225)+"E", "\xE1E" ); + array[item++] = new TestCase( SECTION, "\\xD2D", String.fromCharCode(210)+"D", "\xD2D" ); + array[item++] = new TestCase( SECTION, "\\xC3C", String.fromCharCode(195)+"C", "\xC3C" ); + array[item++] = new TestCase( SECTION, "\\xB4B", String.fromCharCode(180)+"B", "\xB4B" ); + array[item++] = new TestCase( SECTION, "\\xA5A", String.fromCharCode(165)+"A", "\xA5A" ); + array[item++] = new TestCase( SECTION, "\\x969", String.fromCharCode(150)+"9", "\x969" ); + array[item++] = new TestCase( SECTION, "\\x878", String.fromCharCode(135)+"8", "\x878" ); + array[item++] = new TestCase( SECTION, "\\x787", String.fromCharCode(120)+"7", "\x787" ); + array[item++] = new TestCase( SECTION, "\\x696", String.fromCharCode(105)+"6", "\x696" ); + array[item++] = new TestCase( SECTION, "\\x5A5", String.fromCharCode(90)+"5", "\x5A5" ); + array[item++] = new TestCase( SECTION, "\\x4B4", String.fromCharCode(75)+"4", "\x4B4" ); + array[item++] = new TestCase( SECTION, "\\x3C3", String.fromCharCode(60)+"3", "\x3C3" ); + array[item++] = new TestCase( SECTION, "\\x2D2", String.fromCharCode(45)+"2", "\x2D2" ); + array[item++] = new TestCase( SECTION, "\\x1E1", String.fromCharCode(30)+"1", "\x1E1" ); + array[item++] = new TestCase( SECTION, "\\x0F0", String.fromCharCode(15)+"0", "\x0F0" ); + + // G is out of hex range + + array[item++] = new TestCase( SECTION, "\\xG", "xG", "\xG" ); + array[item++] = new TestCase( SECTION, "\\xCG", "xCG", "\xCG" ); + + // DoubleStringCharacter::EscapeSequence::CharacterEscapeSequence::\ NonEscapeCharacter + array[item++] = new TestCase( SECTION, "\\a", "a", "\a" ); + array[item++] = new TestCase( SECTION, "\\c", "c", "\c" ); + array[item++] = new TestCase( SECTION, "\\d", "d", "\d" ); + array[item++] = new TestCase( SECTION, "\\e", "e", "\e" ); + array[item++] = new TestCase( SECTION, "\\g", "g", "\g" ); + array[item++] = new TestCase( SECTION, "\\h", "h", "\h" ); + array[item++] = new TestCase( SECTION, "\\i", "i", "\i" ); + array[item++] = new TestCase( SECTION, "\\j", "j", "\j" ); + array[item++] = new TestCase( SECTION, "\\k", "k", "\k" ); + array[item++] = new TestCase( SECTION, "\\l", "l", "\l" ); + array[item++] = new TestCase( SECTION, "\\m", "m", "\m" ); + array[item++] = new TestCase( SECTION, "\\o", "o", "\o" ); + array[item++] = new TestCase( SECTION, "\\p", "p", "\p" ); + array[item++] = new TestCase( SECTION, "\\q", "q", "\q" ); + array[item++] = new TestCase( SECTION, "\\s", "s", "\s" ); + array[item++] = new TestCase( SECTION, "\\u", "u", "\u" ); + + array[item++] = new TestCase( SECTION, "\\w", "w", "\w" ); + array[item++] = new TestCase( SECTION, "\\x", "x", "\x" ); + array[item++] = new TestCase( SECTION, "\\y", "y", "\y" ); + array[item++] = new TestCase( SECTION, "\\z", "z", "\z" ); + array[item++] = new TestCase( SECTION, "\\9", "9", "\9" ); + + array[item++] = new TestCase( SECTION, "\\A", "A", "\A" ); + array[item++] = new TestCase( SECTION, "\\B", "B", "\B" ); + array[item++] = new TestCase( SECTION, "\\C", "C", "\C" ); + array[item++] = new TestCase( SECTION, "\\D", "D", "\D" ); + array[item++] = new TestCase( SECTION, "\\E", "E", "\E" ); + array[item++] = new TestCase( SECTION, "\\F", "F", "\F" ); + array[item++] = new TestCase( SECTION, "\\G", "G", "\G" ); + array[item++] = new TestCase( SECTION, "\\H", "H", "\H" ); + array[item++] = new TestCase( SECTION, "\\I", "I", "\I" ); + array[item++] = new TestCase( SECTION, "\\J", "J", "\J" ); + array[item++] = new TestCase( SECTION, "\\K", "K", "\K" ); + array[item++] = new TestCase( SECTION, "\\L", "L", "\L" ); + array[item++] = new TestCase( SECTION, "\\M", "M", "\M" ); + array[item++] = new TestCase( SECTION, "\\N", "N", "\N" ); + array[item++] = new TestCase( SECTION, "\\O", "O", "\O" ); + array[item++] = new TestCase( SECTION, "\\P", "P", "\P" ); + array[item++] = new TestCase( SECTION, "\\Q", "Q", "\Q" ); + array[item++] = new TestCase( SECTION, "\\R", "R", "\R" ); + array[item++] = new TestCase( SECTION, "\\S", "S", "\S" ); + array[item++] = new TestCase( SECTION, "\\T", "T", "\T" ); + array[item++] = new TestCase( SECTION, "\\U", "U", "\U" ); + array[item++] = new TestCase( SECTION, "\\V", "V", "\V" ); + array[item++] = new TestCase( SECTION, "\\W", "W", "\W" ); + array[item++] = new TestCase( SECTION, "\\X", "X", "\X" ); + array[item++] = new TestCase( SECTION, "\\Y", "Y", "\Y" ); + array[item++] = new TestCase( SECTION, "\\Z", "Z", "\Z" ); + + // DoubleStringCharacter::EscapeSequence::UnicodeEscapeSequence + + array[item++] = new TestCase( SECTION, "\\u0020", " ", "\u0020" ); + array[item++] = new TestCase( SECTION, "\\u0021", "!", "\u0021" ); + array[item++] = new TestCase( SECTION, "\\u0022", "\"", "\u0022" ); + array[item++] = new TestCase( SECTION, "\\u0023", "#", "\u0023" ); + array[item++] = new TestCase( SECTION, "\\u0024", "$", "\u0024" ); + array[item++] = new TestCase( SECTION, "\\u0025", "%", "\u0025" ); + array[item++] = new TestCase( SECTION, "\\u0026", "&", "\u0026" ); + array[item++] = new TestCase( SECTION, "\\u0027", "'", "\u0027" ); + array[item++] = new TestCase( SECTION, "\\u0028", "(", "\u0028" ); + array[item++] = new TestCase( SECTION, "\\u0029", ")", "\u0029" ); + array[item++] = new TestCase( SECTION, "\\u002A", "*", "\u002A" ); + array[item++] = new TestCase( SECTION, "\\u002B", "+", "\u002B" ); + array[item++] = new TestCase( SECTION, "\\u002C", ",", "\u002C" ); + array[item++] = new TestCase( SECTION, "\\u002D", "-", "\u002D" ); + array[item++] = new TestCase( SECTION, "\\u002E", ".", "\u002E" ); + array[item++] = new TestCase( SECTION, "\\u002F", "/", "\u002F" ); + array[item++] = new TestCase( SECTION, "\\u0030", "0", "\u0030" ); + array[item++] = new TestCase( SECTION, "\\u0031", "1", "\u0031" ); + array[item++] = new TestCase( SECTION, "\\u0032", "2", "\u0032" ); + array[item++] = new TestCase( SECTION, "\\u0033", "3", "\u0033" ); + array[item++] = new TestCase( SECTION, "\\u0034", "4", "\u0034" ); + array[item++] = new TestCase( SECTION, "\\u0035", "5", "\u0035" ); + array[item++] = new TestCase( SECTION, "\\u0036", "6", "\u0036" ); + array[item++] = new TestCase( SECTION, "\\u0037", "7", "\u0037" ); + array[item++] = new TestCase( SECTION, "\\u0038", "8", "\u0038" ); + array[item++] = new TestCase( SECTION, "\\u0039", "9", "\u0039" ); + + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_9_1.as b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_9_1.as new file mode 100644 index 00000000000..a949a40281e --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/LexicalConventions/e7_9_1.as @@ -0,0 +1,73 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION="7.8.2"; + var VERSION="ECMA_1" + startTest(); + writeHeaderToLog(SECTION+" "+"Examples of Semicolon Insertion"); + + testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; +{1 +2}3 //This sentence is not valid ECMAScript sentence if semicolon not inserted //automatically this sentence + //will throw compiler error + + + array[item++] = new TestCase( "7.8.2", "Semicolon is inserted automatically", "passed","passed" ); + +var a:Number = 10; +var b:Number = 20; +var c:Number = 0; + +function MyNumber(){ +return +a+b +} + +function MyAnotherNumber():Number{ +return a+b +} + + array[item++] = new TestCase( "7.8.2", "Semicolon is inserted automatically", true,MyNumber()!=MyAnotherNumber() ); + +a=b +++c + array[item++] = new TestCase( "7.8.2", "Semicolon is inserted automatically",20,a ); + + + + return ( array ); +} + diff --git a/mozilla/js/tamarin/test/ecma3/LexicalConventions/eregexp_literals_001.as b/mozilla/js/tamarin/test/ecma3/LexicalConventions/eregexp_literals_001.as new file mode 100644 index 00000000000..4e108328d67 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/LexicalConventions/eregexp_literals_001.as @@ -0,0 +1,93 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "LexicalConventions/regexp-literals-001.js"; + var VERSION = "ECMA_2"; + var TITLE = "Regular Expression Literals"; + + startTest(); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // Regular Expression Literals may not be empty; // should be regarded + // as a comment, not a RegExp literal. + + s = //; + + "passed"; + + array[item++] = new TestCase(SECTION, + "// should be a comment, not a regular expression literal", + "passed", + String(s)); + + array[item++] = new TestCase(SECTION, + "// typeof object should be type of object declared on following line", + "passed", + (typeof s) == "string" ? "passed" : "failed" ); + + array[item++] = new TestCase(SECTION, + "// should not return an object of the type RegExp", + "passed", + (typeof s == "object") ? "failed" : "passed" ); + + + + var regexp1:RegExp = /a*b/; + var regexp2:RegExp = /a*b/; + + array[item++] = new TestCase(SECTION, + "Two regular expression literals should never compare as === to each other even if the two literals contents are the same", + "failed", + (regexp1 === regexp2) ? "passed" : "failed" ); + + var regexp3:RegExp = new RegExp(); + + + + array[item++] = new TestCase(SECTION, + "creating RegExp object using new keyword", + "true", + ((regexp3 instanceof RegExp).toString())); + + var regexp4:RegExp = RegExp(); + + array[item++] = new TestCase(SECTION, + "creating RegExp object using new keyword", + "true", + ((regexp4 instanceof RegExp).toString())); + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/LexicalConventions/eregexp_literals_002.as b/mozilla/js/tamarin/test/ecma3/LexicalConventions/eregexp_literals_002.as new file mode 100644 index 00000000000..95cb39bd3e4 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/LexicalConventions/eregexp_literals_002.as @@ -0,0 +1,258 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "LexicalConventions/regexp-literals-002.js"; + var VERSION = "ECMA_2"; + var TITLE = "Regular Expression Literals"; + + startTest(); + var testcases = getTestCases(); + + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + // A regular expression literal represents an object of type RegExp. + + array[item++] = new TestCase(SECTION, + "// A regular expression literal represents an object of type RegExp.", + "true", + (/x*/ instanceof RegExp).toString() ); + + array[item++] = new TestCase(SECTION, + "// A regular expression literal represents an object of type RegExp.", + "true", + (/x*y/ instanceof RegExp).toString() ); + + array[item++] = new TestCase(SECTION, + "// A regular expression literal represents an object of type RegExp.", + "true", + (/xy*yz/ instanceof RegExp).toString() ); + + array[item++] = new TestCase(SECTION, + "// A regular expression literal represents an object of type RegExp.", + "true", + (/.{1}/ instanceof RegExp).toString() ); + + array[item++] = new TestCase(SECTION, + "// A regular expression literal represents an object of type RegExp.", + "true", + (/.{3,4}/ instanceof RegExp).toString() ); + + array[item++] = new TestCase(SECTION, + "// A regular expression literal represents an object of type RegExp.", + "true", + (/ab{0,}bc/ instanceof RegExp).toString() ); + + array[item++] = new TestCase(SECTION, + "// A regular expression literal represents an object of type RegExp.", + "true", + (/xy+yz/ instanceof RegExp).toString() ); + + array[item++] = new TestCase(SECTION, + "// A regular expression literal represents an object of type RegExp.", + "true", + (/xy{1,}yz/ instanceof RegExp).toString() ); + + array[item++] = new TestCase(SECTION, + "// A regular expression literal represents an object of type RegExp.", + "true", + (/xy{1,3}yz/ instanceof RegExp).toString() ); + + array[item++] = new TestCase(SECTION, + "// A regular expression literal represents an object of type RegExp.", + "true", + (/xy?yz/ instanceof RegExp).toString() ); + + array[item++] = new TestCase(SECTION, + "// A regular expression literal represents an object of type RegExp.", + "true", + (/$/ instanceof RegExp).toString() ); + + array[item++] = new TestCase(SECTION, + "// A regular expression literal represents an object of type RegExp.", + "true", + (/x.*y/ instanceof RegExp).toString() ); + + array[item++] = new TestCase(SECTION, + "// A regular expression literal represents an object of type RegExp.", + "true", + (/x[yz]m/ instanceof RegExp).toString() ); + + array[item++] = new TestCase(SECTION, + "// A regular expression literal represents an object of type RegExp.", + "true", + (/x[^yz]m/ instanceof RegExp).toString() ); + + array[item++] = new TestCase(SECTION, + "// A regular expression literal represents an object of type RegExp.", + "true", + (/x[^-z]m/ instanceof RegExp).toString() ); + + array[item++] = new TestCase(SECTION, + "// A regular expression literal represents an object of type RegExp.", + "true", + (/x\yz\y/ instanceof RegExp).toString() ); + + array[item++] = new TestCase(SECTION, + "// A regular expression literal represents an object of type RegExp.", + "true", + (/a\Sb/ instanceof RegExp).toString() ); + + array[item++] = new TestCase(SECTION, + "// A regular expression literal represents an object of type RegExp.", + "true", + (/\d/ instanceof RegExp).toString() ); + + array[item++] = new TestCase(SECTION, + "// A regular expression literal represents an object of type RegExp.", + "true", + (/\D/ instanceof RegExp).toString() ); + + array[item++] = new TestCase(SECTION, + "// A regular expression literal represents an object of type RegExp.", + "true", + (/xy|yz/ instanceof RegExp).toString() ); + + array[item++] = new TestCase(SECTION, + "// A regular expression literal represents an object of type RegExp.", + "true", + (/()ef/ instanceof RegExp).toString() ); + + array[item++] = new TestCase(SECTION, + "// A regular expression literal represents an object of type RegExp.", + "true", + (/a\(b/ instanceof RegExp).toString() ); + + array[item++] = new TestCase(SECTION, + "// A regular expression literal represents an object of type RegExp.", + "true", + (/a\\b/ instanceof RegExp).toString() ); + + array[item++] = new TestCase(SECTION, + "// A regular expression literal represents an object of type RegExp.", + "true", + (/(a)b(c)/ instanceof RegExp).toString() ); + + array[item++] = new TestCase(SECTION, + "// A regular expression literal represents an object of type RegExp.", + "true", + (/a+b+c/ instanceof RegExp).toString() ); + + array[item++] = new TestCase(SECTION, + "// A regular expression literal represents an object of type RegExp.", + "true", + (/a.+?c/ instanceof RegExp).toString() ); + + array[item++] = new TestCase(SECTION, + "// A regular expression literal represents an object of type RegExp.", + "true", + (/(a+|b*)/ instanceof RegExp).toString() ); + + + array[item++] = new TestCase(SECTION, + "// A regular expression literal represents an object of type RegExp.", + "true", + (/(a+|b){0,}/ instanceof RegExp).toString() ); + + + array[item++] = new TestCase(SECTION, + "// A regular expression literal represents an object of type RegExp.", + "true", + (/(a+|b)+/ instanceof RegExp).toString() ); + + array[item++] = new TestCase(SECTION, + "// A regular expression literal represents an object of type RegExp.", + "true", + (/(a+|b)?/ instanceof RegExp).toString() ); + + array[item++] = new TestCase(SECTION, + "// A regular expression literal represents an object of type RegExp.", + "true", + (/(a+|b){0,1}/ instanceof RegExp).toString() ); + + array[item++] = new TestCase(SECTION, + "// A regular expression literal represents an object of type RegExp.", + "true", + (/[^ab]*/ instanceof RegExp).toString() ); + + array[item++] = new TestCase(SECTION, + "// A regular expression literal represents an object of type RegExp.", + "true", + (/([abc])*d/ instanceof RegExp).toString() ); + + array[item++] = new TestCase(SECTION, + "// A regular expression literal represents an object of type RegExp.", + "true", + (/a|b|c|d|e/ instanceof RegExp).toString() ); + + array[item++] = new TestCase(SECTION, + "// A regular expression literal represents an object of type RegExp.", + "true", + (/(a|b|c|d|e)f/ instanceof RegExp).toString() ); + + array[item++] = new TestCase(SECTION, + "// A regular expression literal represents an object of type RegExp.", + "true", + (/[a-zA-Z_][a-zA-Z0-9_]*/ instanceof RegExp).toString() ); + + array[item++] = new TestCase(SECTION, + "// A regular expression literal represents an object of type RegExp.", + "true", + (/^a(bc+|b[eh])g|.h$/ instanceof RegExp).toString() ); + + array[item++] = new TestCase(SECTION, + "// A regular expression literal represents an object of type RegExp.", + "true", + (/(bc+d$|ef*g.|h?i(j|k))/ instanceof RegExp).toString() ); + + array[item++] = new TestCase(SECTION, + "// A regular expression literal represents an object of type RegExp.", + "true", + (/((((((((((a))))))))))\10/ instanceof RegExp).toString() ); + + array[item++] = new TestCase(SECTION, + "// A regular expression literal represents an object of type RegExp.", + "true", + (/(.*)c(.*)/ instanceof RegExp).toString() ); + + array[item++] = new TestCase(SECTION, + "// A regular expression literal represents an object of type RegExp.", + "true", + (/abc/i instanceof RegExp).toString() ); + + array[item++] = new TestCase(SECTION, + "// A regular expression literal represents an object of type RegExp.", + "true", + (/ab{0,1}?c/i instanceof RegExp).toString() ); + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Math/e15_8_1.as b/mozilla/js/tamarin/test/ecma3/Math/e15_8_1.as new file mode 100644 index 00000000000..5fbc7ae4dfc --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Math/e15_8_1.as @@ -0,0 +1,72 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.8.1" + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Value Properties of the Math Object"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( "15.8.1.1", "Math.E", 2.7182818284590452354, Math.E ); + array[item++] = new TestCase( "15.8.1.1", "typeof Math.E", "number", typeof Math.E ); + array[item++] = new TestCase( "15.8.1.2", "Math.LN10", 2.302585092994046, Math.LN10 ); + array[item++] = new TestCase( "15.8.1.2", "typeof Math.LN10", "number", typeof Math.LN10 ); + array[item++] = new TestCase( "15.8.1.3", "Math.LN2", 0.6931471805599453, Math.LN2 ); + array[item++] = new TestCase( "15.8.1.3", "typeof Math.LN2", "number", typeof Math.LN2 ); + array[item++] = new TestCase( "15.8.1.4", "Math.LOG2E", 1.4426950408889634, Math.LOG2E ); + array[item++] = new TestCase( "15.8.1.4", "typeof Math.LOG2E", "number", typeof Math.LOG2E ); + array[item++] = new TestCase( "15.8.1.5", "Math.LOG10E", 0.4342944819032518, Math.LOG10E); + array[item++] = new TestCase( "15.8.1.5", "typeof Math.LOG10E", "number", typeof Math.LOG10E); + array[item++] = new TestCase( "15.8.1.6", "Math.PI", 3.14159265358979323846, Math.PI ); + array[item++] = new TestCase( "15.8.1.6", "typeof Math.PI", "number", typeof Math.PI ); + array[item++] = new TestCase( "15.8.1.7", "Math.SQRT1_2", 0.7071067811865476, Math.SQRT1_2); + array[item++] = new TestCase( "15.8.1.7", "typeof Math.SQRT1_2", "number", typeof Math.SQRT1_2); + array[item++] = new TestCase( "15.8.1.8", "Math.SQRT2", 1.4142135623730951, Math.SQRT2 ); + array[item++] = new TestCase( "15.8.1.8", "typeof Math.SQRT2", "number", typeof Math.SQRT2 ); + + MATHPROPS=''; + for( p in Math ){ + MATHPROPS +=p; + } + + array[item++] = new TestCase( SECTION, "var MATHPROPS='';for( p in Math ){ MATHPROPS +=p; };MATHPROPS", + "", + MATHPROPS ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Math/e15_8_1_1_1.as b/mozilla/js/tamarin/test/ecma3/Math/e15_8_1_1_1.as new file mode 100644 index 00000000000..f070779fd91 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Math/e15_8_1_1_1.as @@ -0,0 +1,53 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.8.1.1-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Math.E"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + try{ + Math.E=0; + }catch(e:ReferenceError){ + thisError=e.toString(); + }finally{ + array[item++]=new TestCase(SECTION,"Trying to verify the ReadOnly attribute of Math.E","ReferenceError: Error #1074",referenceError(thisError)); + } + array[item++] = new TestCase( SECTION, "Math.E = 0; Math.E", 2.7182818284590452354, Math.E ); + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Math/e15_8_1_1_2.as b/mozilla/js/tamarin/test/ecma3/Math/e15_8_1_1_2.as new file mode 100644 index 00000000000..43331af9cff --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Math/e15_8_1_1_2.as @@ -0,0 +1,50 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.8.1.1-2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Math.E"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var MATH_E = 2.7182818284590452354 + array[item++] = new TestCase( SECTION, "delete(Math.E)", false, delete Math.E ); + delete Math.E; + array[item++] = new TestCase( SECTION, "delete(Math.E); Math.E", MATH_E, Math.E ); + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Math/e15_8_1_2_1.as b/mozilla/js/tamarin/test/ecma3/Math/e15_8_1_2_1.as new file mode 100644 index 00000000000..40215fa40e5 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Math/e15_8_1_2_1.as @@ -0,0 +1,53 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.8.1.2-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Math.LN10"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + try{ + Math.LN10=0; + }catch(e:ReferenceError){ + thisError=e.toString(); + }finally{ + array[item++]= new TestCase(SECTION,"Trying to verify the ReadOnly attribute of Math.LN10","ReferenceError: Error #1074",referenceError(thisError)); + } + array[item++] = new TestCase( SECTION, "Math.LN10=0; Math.LN10", 2.302585092994046, Math.LN10 ); + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Math/e15_8_1_2_2.as b/mozilla/js/tamarin/test/ecma3/Math/e15_8_1_2_2.as new file mode 100644 index 00000000000..dd1ab04b7ae --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Math/e15_8_1_2_2.as @@ -0,0 +1,48 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.8.1.2-2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Math.LN10"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); +function getTestCases() { + var array = new Array(); + var item = 0; + delete(Math.LN10); + array[item++] = new TestCase( SECTION, "delete( Math.LN10 ); Math.LN10", 2.302585092994046, Math.LN10 ); + array[item++] = new TestCase( SECTION, "delete( Math.LN10 ); ", false, delete(Math.LN10) ); + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Math/e15_8_1_3_1.as b/mozilla/js/tamarin/test/ecma3/Math/e15_8_1_3_1.as new file mode 100644 index 00000000000..bc932151a7d --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Math/e15_8_1_3_1.as @@ -0,0 +1,56 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.8.1.3-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Math.LN2"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + var thisError:String="no error"; + + try{ + Math.LN2=0; + }catch(e:ReferenceError){ + thisError=e.toString(); + }finally{ + array[item++]=new TestCase(SECTION,"Trying to verify the ReadOnly attribute of Math.LN2","ReferenceError: Error #1074",referenceError(thisError)); + } + array[item++] = new TestCase( SECTION, "Math.LN2=0; Math.LN2", 0.6931471805599453, Math.LN2 ); + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Math/e15_8_1_3_2.as b/mozilla/js/tamarin/test/ecma3/Math/e15_8_1_3_2.as new file mode 100644 index 00000000000..45a371549f6 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Math/e15_8_1_3_2.as @@ -0,0 +1,55 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.8.1.3-2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Math.LN2"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + + var MATH_LN2 = 0.6931471805599453; + + array[item++] = new TestCase( SECTION, "delete(Math.LN2)", false, delete(Math.LN2) ); + + delete(Math.LN2); + array[item++] = new TestCase( SECTION, "delete(Math.LN2); Math.LN2", MATH_LN2, Math.LN2 ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Math/e15_8_1_4_1.as b/mozilla/js/tamarin/test/ecma3/Math/e15_8_1_4_1.as new file mode 100644 index 00000000000..d950bccf8ef --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Math/e15_8_1_4_1.as @@ -0,0 +1,55 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.8.1.4-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Math.LOG2E"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + var thisError:String="no error"; + try{ + Math.LOG2E=0; + }catch(e:ReferenceError){ + thisError=e.toString(); + }finally{ + array[item++]=new TestCase(SECTION,"Trying to verify the ReadOnly attribute of Math.LOG2E","ReferenceError: Error #1074",referenceError(thisError)); + } + array[item++] = new TestCase( SECTION, "Math.L0G2E=0; Math.LOG2E", 1.4426950408889634, Math.LOG2E ); + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Math/e15_8_1_4_2.as b/mozilla/js/tamarin/test/ecma3/Math/e15_8_1_4_2.as new file mode 100644 index 00000000000..eebaac3b7a1 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Math/e15_8_1_4_2.as @@ -0,0 +1,50 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.8.1.4-2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Math.LOG2E"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + delete(Math.LOG2E); + array[item++] = new TestCase( SECTION, "delete(Math.L0G2E);Math.LOG2E", 1.4426950408889634, Math.LOG2E ); + array[item++] = new TestCase( SECTION, "delete(Math.L0G2E)", false, delete(Math.LOG2E) ); + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Math/e15_8_1_5_1.as b/mozilla/js/tamarin/test/ecma3/Math/e15_8_1_5_1.as new file mode 100644 index 00000000000..d11d229c74c --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Math/e15_8_1_5_1.as @@ -0,0 +1,58 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + var SECTION = "15.8.1.5-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Math.LOG10E"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + + + +function getTestCases() { + var array = new Array(); + var item = 0; + var thisError:String = "no error" + try{ + Math.LOG10E=0; + }catch(e:ReferenceError){ + thisError=e.toString(); + }finally{ + array[item++]=new TestCase(SECTION,"Trying to verify the ReadOnly attribute of Math.LOG10E","ReferenceError: Error #1074",referenceError(thisError)); + } + array[item++] = new TestCase( SECTION, "Math.LOG10E=0; Math.LOG10E", 0.4342944819032518, Math.LOG10E ); + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Math/e15_8_1_5_2.as b/mozilla/js/tamarin/test/ecma3/Math/e15_8_1_5_2.as new file mode 100644 index 00000000000..fecd15cd5ae --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Math/e15_8_1_5_2.as @@ -0,0 +1,51 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.8.1.5-2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Math.LOG10E"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + + delete Math.LOG10E; + array[item++] = new TestCase( SECTION, "delete Math.LOG10E; Math.LOG10E", 0.4342944819032518, Math.LOG10E ); + array[item++] = new TestCase( SECTION, "delete Math.LOG10E", false, delete Math.LOG10E ); + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Math/e15_8_1_6_1.as b/mozilla/js/tamarin/test/ecma3/Math/e15_8_1_6_1.as new file mode 100644 index 00000000000..72cebfb5d89 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Math/e15_8_1_6_1.as @@ -0,0 +1,55 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.8.1.6-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Math.PI"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + var thisError:String=""; + try{ + Math.PI=0; + }catch(e:ReferenceError){ + thisError=e.toString(); + }finally{ + array[item++]=new TestCase(SECTION,"Trying to verify the ReadOnly attribute of Math.PI","ReferenceError: Error #1074",referenceError(thisError)); + } + array[item++] = new TestCase( SECTION, "Math.PI=0; Math.PI", 3.141592653589793, Math.PI ); + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Math/e15_8_1_6_2.as b/mozilla/js/tamarin/test/ecma3/Math/e15_8_1_6_2.as new file mode 100644 index 00000000000..5e0301a6118 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Math/e15_8_1_6_2.as @@ -0,0 +1,50 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.8.1.6-2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Math.PI"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + delete Math.PI; + array[item++] = new TestCase( SECTION, "delete Math.PI; Math.PI", 3.141592653589793, Math.PI ); + array[item++] = new TestCase( SECTION, "delete Math.PI; Math.PI", false, delete Math.PI ); + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Math/e15_8_1_7_1.as b/mozilla/js/tamarin/test/ecma3/Math/e15_8_1_7_1.as new file mode 100644 index 00000000000..31ec888c3f5 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Math/e15_8_1_7_1.as @@ -0,0 +1,56 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.8.1.7-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Math.SQRT1_2"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + var thisError:String="no error"; + try{ + Math.SQRT1_2=0; + }catch(e:ReferenceError){ + thisError=e.toString(); + }finally{ + array[item++] = new TestCase(SECTION,"Trying to verify the ReadOnly attribute of Math.SQRT1_2","ReferenceError: Error #1074",referenceError(thisError)); + } + array[item++] = new TestCase( SECTION, "Math.SQRT1_2=0; Math.SQRT1_2", 0.7071067811865476, Math.SQRT1_2 ); + return ( array ); +} + diff --git a/mozilla/js/tamarin/test/ecma3/Math/e15_8_1_7_2.as b/mozilla/js/tamarin/test/ecma3/Math/e15_8_1_7_2.as new file mode 100644 index 00000000000..aabd0b41ce8 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Math/e15_8_1_7_2.as @@ -0,0 +1,50 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.8.1.7-2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Math.SQRT1_2"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + delete Math.SQRT1_2; + array[item++] = new TestCase( SECTION, "delete Math.SQRT1_2; Math.SQRT1_2", 0.7071067811865476, Math.SQRT1_2 ); + array[item++] = new TestCase( SECTION, "delete Math.SQRT1_2", false, delete Math.SQRT1_2 ); + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Math/e15_8_1_8_1.as b/mozilla/js/tamarin/test/ecma3/Math/e15_8_1_8_1.as new file mode 100644 index 00000000000..49dc8d25f1c --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Math/e15_8_1_8_1.as @@ -0,0 +1,55 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.8.1.8-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Math.SQRT2"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + var thisError:String="no error"; + try{ + Math.SQRT2=0; + }catch(e:ReferenceError){ + thisError=e.toString(); + }finally{ + array[item++]=new TestCase(SECTION,"Trying to verify the ReadOnly attribute of Math.SQRT2","ReferenceError: Error #1074",referenceError(thisError)); + } + array[item++] = new TestCase( SECTION, "Math.SQRT2=0; Math.SQRT2", 1.4142135623730951, Math.SQRT2 ); + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Math/e15_8_1_8_2.as b/mozilla/js/tamarin/test/ecma3/Math/e15_8_1_8_2.as new file mode 100644 index 00000000000..fc08452a043 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Math/e15_8_1_8_2.as @@ -0,0 +1,49 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.8.1.8-2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Math.SQRT2"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + delete Math.SQRT2; + array[item++] = new TestCase( SECTION, "delete Math.SQRT2; Math.SQRT2", 1.4142135623730951, Math.SQRT2 ); + array[item++] = new TestCase( SECTION, "delete Math.SQRT2", false, delete Math.SQRT2 ); + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Math/e15_8_1_8_3.as b/mozilla/js/tamarin/test/ecma3/Math/e15_8_1_8_3.as new file mode 100644 index 00000000000..09e7eb03453 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Math/e15_8_1_8_3.as @@ -0,0 +1,44 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.8.1.8-3"; + var VERSION = "ECMA_1"; + startTest(); + var testcases = getTestCases(); + + writeHeaderToLog( SECTION + " Math.SQRT2: DontDelete"); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, "delete Math.SQRT2", false, delete Math.SQRT2 ); + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Math/e15_8_2_1.as b/mozilla/js/tamarin/test/ecma3/Math/e15_8_2_1.as new file mode 100644 index 00000000000..879d0e58158 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Math/e15_8_2_1.as @@ -0,0 +1,151 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.8.2.1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Math.abs()"; + var BUGNUMBER = "77391"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "Math.abs.length", 1, Math.abs.length ); + var thisError="no error"; + try{ + Math.abs(); + }catch(e:Error){ + thisError=(e.toString()).substring(0,26); + }finally{ + array[item++] = new TestCase( SECTION, "Math.abs()","ArgumentError: Error #1063",thisError); + } + + array[item++] = new TestCase( SECTION, "Math.abs( void 0 )", Number.NaN, Math.abs(void 0) ); + array[item++] = new TestCase( SECTION, "Math.abs( null )", 0, Math.abs(null) ); + array[item++] = new TestCase( SECTION, "Math.abs( true )", 1, Math.abs(true) ); + array[item++] = new TestCase( SECTION, "Math.abs( false )", 0, Math.abs(false) ); + array[item++] = new TestCase( SECTION, "Math.abs( string primitive)", Number.NaN, Math.abs("a string primitive") ); + array[item++] = new TestCase( SECTION, "Math.abs( string object )", Number.NaN, Math.abs(new String( 'a String object' )) ); + array[item++] = new TestCase( SECTION, "Math.abs( Number.NaN )", Number.NaN, Math.abs(Number.NaN) ); + + array[item++] = new TestCase( SECTION, "Math.abs(0)", 0, Math.abs( 0 ) ); + array[item++] = new TestCase( SECTION, "Math.abs( -0 )", 0, Math.abs(-0) ); + array[item++] = new TestCase( SECTION, "Infinity/Math.abs(-0)", Infinity, Infinity/Math.abs(-0) ); + + array[item++] = new TestCase( SECTION, "Math.abs( -Infinity )", Number.POSITIVE_INFINITY, Math.abs( Number.NEGATIVE_INFINITY ) ); + array[item++] = new TestCase( SECTION, "Math.abs( Infinity )", Number.POSITIVE_INFINITY, Math.abs( Number.POSITIVE_INFINITY ) ); + array[item++] = new TestCase( SECTION, "Math.abs( - MAX_VALUE )", Number.MAX_VALUE, Math.abs( - Number.MAX_VALUE ) ); + array[item++] = new TestCase( SECTION, "Math.abs( - MIN_VALUE )", Number.MIN_VALUE, Math.abs( -Number.MIN_VALUE ) ); + array[item++] = new TestCase( SECTION, "Math.abs( MAX_VALUE )", Number.MAX_VALUE, Math.abs( Number.MAX_VALUE ) ); + array[item++] = new TestCase( SECTION, "Math.abs( MIN_VALUE )", Number.MIN_VALUE, Math.abs( Number.MIN_VALUE ) ); + + array[item++] = new TestCase( SECTION, "Math.abs( -1 )", 1, Math.abs( -1 ) ); + array[item++] = new TestCase( SECTION, "Math.abs( new Number( -1 ) )", 1, Math.abs( new Number(-1) ) ); + array[item++] = new TestCase( SECTION, "Math.abs( 1 )", 1, Math.abs( 1 ) ); + array[item++] = new TestCase( SECTION, "Math.abs( Math.PI )", Math.PI, Math.abs( Math.PI ) ); + array[item++] = new TestCase( SECTION, "Math.abs( -Math.PI )", Math.PI, Math.abs( -Math.PI ) ); + array[item++] = new TestCase( SECTION, "Math.abs(-1/100000000)", 1/100000000, Math.abs(-1/100000000) ); + array[item++] = new TestCase( SECTION, "Math.abs(-Math.pow(2,32))", Math.pow(2,32), Math.abs(-Math.pow(2,32)) ); + array[item++] = new TestCase( SECTION, "Math.abs(Math.pow(2,32))", Math.pow(2,32), Math.abs(Math.pow(2,32)) ); + array[item++] = new TestCase( SECTION, "Math.abs( -0xfff )", 4095, Math.abs( -0xfff ) ); + array[item++] = new TestCase( SECTION, "Math.abs( -0777 )", 777, Math.abs(-0777 ) ); + + array[item++] = new TestCase( SECTION, "Math.abs('-1e-1')", 0.1, Math.abs('-1e-1') ); + array[item++] = new TestCase( SECTION, "Math.abs('0xff')", 255, Math.abs('0xff') ); + array[item++] = new TestCase( SECTION, "Math.abs('077')", 77, Math.abs('077') ); + array[item++] = new TestCase( SECTION, "Math.abs( 'Infinity' )", Infinity, Math.abs('Infinity') ); + array[item++] = new TestCase( SECTION, "Math.abs( '-Infinity' )", Infinity, Math.abs('-Infinity') ); + + array[item++] = new TestCase( SECTION, "Math.abs(1)", "1", Math.abs(1)+""); + + array[item++] = new TestCase( SECTION, "Math.abs(10)", "10", Math.abs(10)+""); + + array[item++] = new TestCase( SECTION, "Math.abs(100)", "100", Math.abs(100)+""); + + array[item++] = new TestCase( SECTION, "Math.abs(1000)", "1000", Math.abs(1000)+""); + + array[item++] = new TestCase( SECTION, "Math.abs(10000)", "10000", Math.abs(10000)+""); + + array[item++] = new TestCase( SECTION, "Math.abs(10000000000)", "10000000000",Math.abs(10000000000)+""); + + array[item++] = new TestCase( SECTION, "Math.abs(10000000000000000000)", "10000000000000000000",Math.abs(10000000000000000000)+""); + + array[item++] = new TestCase( SECTION, "Math.abs(100000000000000000000)", "100000000000000000000",Math.abs(100000000000000000000)+"" ); + + array[item++] = new TestCase( SECTION, "Math.abs(-12345 )", "12345",Math.abs(-12345)+""); + + array[item++] = new TestCase( SECTION, "Math.abs(-1234567890)", "1234567890",Math.abs(-1234567890)+""); + + array[item++] = new TestCase( SECTION, "Math.abs(-10 )", "10",Math.abs(-10)+""); + + array[item++] = new TestCase( SECTION, "Math.abs(-100 )", "100",Math.abs(-100)+""); + array[item++] = new TestCase( SECTION, "Math.abs(-1000 )", "1000",Math.abs(-1000)+""); + + array[item++] = new TestCase( SECTION, "Math.abs(-1000000000 )", "1000000000",Math.abs(-1000000000 )+""); + + array[item++] = new TestCase( SECTION, "Math.abs(-1000000000000000)", "1000000000000000",Math.abs(-1000000000000000)+""); + + array[item++] = new TestCase( SECTION, "Math.abs(-100000000000000000000)", "100000000000000000000",Math.abs(-100000000000000000000)+""); + + + array[item++] = new TestCase( SECTION, "Math.abs(-1000000000000000000000)", "1e+21",Math.abs(-1000000000000000000000)+"" ); + + array[item++] = new TestCase( SECTION, "Math.abs(1.0000001)", "1.0000001",Math.abs(1.0000001 )+""); + + array[item++] = new TestCase( SECTION, "Math.abs(1000000000000000000000)", "1e+21",Math.abs(1000000000000000000000)+""); + + + array[item++] = new TestCase( SECTION, "Math.abs(1.2345)", "1.2345",Math.abs(1.2345)+"" ); + + + array[item++] = new TestCase( SECTION, "Math.abs(1.234567890)", "1.23456789",Math.abs(1.234567890)+""); + + + array[item++] = new TestCase( SECTION, "Math.abs(.12345)", "0.12345",Math.abs(.12345)+""); + + array[item++] = new TestCase( SECTION, "Math.abs(.012345)", "0.012345",Math.abs(.012345)+"" ); + + + array[item++] = new TestCase( SECTION, "Math.abs(.00012345)", "0.00012345",Math.abs(.00012345)+""); + + array[item++] = new TestCase( SECTION, "Math.abs(.000012345)", "0.000012345",Math.abs(.000012345)+"" ); + + array[item++] = new TestCase( SECTION, "Math.abs(.0000012345)", "0.0000012345",Math.abs(.0000012345)+""); + + array[item++] = new TestCase( SECTION, "Math.abs(.00000012345)", "1.2345e-7",Math.abs(.00000012345)+""); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Math/e15_8_2_10.as b/mozilla/js/tamarin/test/ecma3/Math/e15_8_2_10.as new file mode 100644 index 00000000000..867764cae3f --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Math/e15_8_2_10.as @@ -0,0 +1,82 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.8.2.10"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Math.log(x)"; + var BUGNUMBER = "77391"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "Math.log.length", 1, Math.log.length ); + /*thisError="no error"; + try{ + Math.log(); + }catch(e:Error){ + thisError=(e.toString()).substring(0,26); + }finally{//print(thisError); + array[item++] = new TestCase( SECTION, "Math.log()","ArgumentError: Error #1063",thisError); + } + array[item++] = new TestCase( SECTION, "Math.log()", Number.NaN, Math.log() );*/ + array[item++] = new TestCase( SECTION, "Math.log(void 0)", Number.NaN, Math.log(void 0) ); + array[item++] = new TestCase( SECTION, "Math.log(null)", Number.NEGATIVE_INFINITY, Math.log(null) ); + array[item++] = new TestCase( SECTION, "Math.log(true)", 0, Math.log(true) ); + array[item++] = new TestCase( SECTION, "Math.log(false)", -Infinity, Math.log(false) ); + array[item++] = new TestCase( SECTION, "Math.log('0')", -Infinity, Math.log('0') ); + array[item++] = new TestCase( SECTION, "Math.log('1')", 0, Math.log('1') ); + array[item++] = new TestCase( SECTION, "Math.log('Infinity')", Infinity, Math.log("Infinity") ); + + array[item++] = new TestCase( SECTION, "Math.log(NaN)", Number.NaN, Math.log(Number.NaN) ); + array[item++] = new TestCase( SECTION, "Math.log(-0.0000001)", Number.NaN, Math.log(-0.000001) ); + array[item++] = new TestCase( SECTION, "Math.log(0.0000001)", -13.815510557964274, Math.log(0.000001) ); + array[item++] = new TestCase( SECTION, "Math.log(-1)", Number.NaN, Math.log(-1) ); + array[item++] = new TestCase( SECTION, "Math.log(0)", Number.NEGATIVE_INFINITY, Math.log(0) ); + array[item++] = new TestCase( SECTION, "Math.log(-0)", Number.NEGATIVE_INFINITY, Math.log(-0)); + array[item++] = new TestCase( SECTION, "Math.log(1)", 0, Math.log(1) ); + array[item++] = new TestCase( SECTION, "Math.log(2)",0.6931471805599453, Math.log(2) ); + array[item++] = new TestCase( SECTION, "Math.log(3)", 1.0986122886681098, Math.log(3) ); + array[item++] = new TestCase( SECTION, "Math.log(4)",1.3862943611198906, Math.log(4) ); + array[item++] = new TestCase( SECTION, "Math.log(Infinity)", Number.POSITIVE_INFINITY, Math.log(Number.POSITIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "Math.log(-Infinity)", Number.NaN, Math.log(Number.NEGATIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "Math.log(10)",2.302585092994046, Math.log(10) ); + array[item++] = new TestCase( SECTION, "Math.log(100)",4.605170185988092, Math.log(100) ); + array[item++] = new TestCase( SECTION, "Math.log(100000)",11.512925464970229, Math.log(100000) ); + array[item++] = new TestCase( SECTION, "Math.log(300000)",12.611537753638338, Math.log(300000) ); + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Math/e15_8_2_11.as b/mozilla/js/tamarin/test/ecma3/Math/e15_8_2_11.as new file mode 100644 index 00000000000..1d3d8ac9215 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Math/e15_8_2_11.as @@ -0,0 +1,85 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.8.2.11"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Math.max(x, y)"; + var BUGNUMBER="76439"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "Math.max.length", 2, Math.max.length ); + + array[item++] = new TestCase( SECTION, "Math.max()", -Infinity, Math.max() ); + array[item++] = new TestCase( SECTION, "Math.max(void 0, 1)", Number.NaN, Math.max( void 0, 1 ) ); + array[item++] = new TestCase( SECTION, "Math.max(void 0, void 0)", Number.NaN, Math.max( void 0, void 0 ) ); + array[item++] = new TestCase( SECTION, "Math.max(null, 1)", 1, Math.max( null, 1 ) ); + array[item++] = new TestCase( SECTION, "Math.max(-1, null)", 0, Math.max( -1, null ) ); + array[item++] = new TestCase( SECTION, "Math.max(true, false)", 1, Math.max(true,false) ); + + array[item++] = new TestCase( SECTION, "Math.max('-99','99')", 99, Math.max( "-99","99") ); + + array[item++] = new TestCase( SECTION, "Math.max(NaN,Infinity)",Number.NaN, Math.max(Number.NaN,Number.POSITIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "Math.max(NaN, 0)",Number.NaN, Math.max(Number.NaN, 0) ); + + array[item++] = new TestCase( SECTION, "Math.max('a string', 0)", Number.NaN, Math.max("a string", 0) ); + array[item++] = new TestCase( SECTION, "Math.max(NaN, 1)", Number.NaN, Math.max(Number.NaN,1) ); + array[item++] = new TestCase( SECTION, "Math.max('a string',Infinity)", Number.NaN, Math.max("a string", Number.POSITIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "Math.max(Infinity, NaN)", Number.NaN, Math.max( Number.POSITIVE_INFINITY, Number.NaN) ); + array[item++] = new TestCase( SECTION, "Math.max(NaN, NaN)", Number.NaN, Math.max(Number.NaN, Number.NaN) ); + array[item++] = new TestCase( SECTION, "Math.max(0,NaN)", Number.NaN, Math.max(0,Number.NaN) ); + array[item++] = new TestCase( SECTION, "Math.max(1, NaN)", Number.NaN, Math.max(1, Number.NaN) ); + array[item++] = new TestCase( SECTION, "Math.max(0,0)", 0, Math.max(0,0) ); + array[item++] = new TestCase( SECTION, "Math.max(0,-0)", 0, Math.max(0,-0) ); + array[item++] = new TestCase( SECTION, "Math.max(-0,0)", 0, Math.max(-0,0) ); + array[item++] = new TestCase( SECTION, "Math.max(-0,-0)", -0, Math.max(-0,-0) ); + array[item++] = new TestCase( SECTION, "Infinity/Math.max(-0,-0)", -Infinity, Infinity/Math.max(-0,-0) ); + array[item++] = new TestCase( SECTION, "Math.max(Infinity, Number.MAX_VALUE)", Number.POSITIVE_INFINITY, Math.max(Number.POSITIVE_INFINITY, Number.MAX_VALUE) ); + array[item++] = new TestCase( SECTION, "Math.max(Infinity, Infinity)", Number.POSITIVE_INFINITY, Math.max(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "Math.max(-Infinity,-Infinity)", Number.NEGATIVE_INFINITY, Math.max(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "Math.max(1,.99999999999999)", 1, Math.max(1,.99999999999999) ); + array[item++] = new TestCase( SECTION, "Math.max(-1,-.99999999999999)", -.99999999999999, Math.max(-1,-.99999999999999) ); + + array[item++] = new TestCase( SECTION, "Math.max(Infinity, Number.MAX_VALUE,Number.MIN_VALUE,Number.NEGATIVE_INFINITY)", Number.POSITIVE_INFINITY, Math.max(Number.POSITIVE_INFINITY,Number.MAX_VALUE,Number.MIN_VALUE,Number.NEGATIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "Math.max(Infinity, Number.MAX_VALUE,Number.MIN_VALUE,Number.NEGATIVE_INFINITY,0,-0,1,-1,'string',Number.NaN,null,void 0)", Number.NaN, Math.max(Number.POSITIVE_INFINITY,Number.MAX_VALUE,Number.MIN_VALUE,Number.NEGATIVE_INFINITY,0,-0,1,-1,'string',Number.NaN,null,void 0) ); + array[item++] = new TestCase( SECTION, "Math.max(Infinity, Number.MAX_VALUE,Number.MIN_VALUE,Number.NEGATIVE_INFINITY,0,-0,1,-1)", Infinity, Math.max(Number.POSITIVE_INFINITY,Number.MAX_VALUE,Number.MIN_VALUE,Number.NEGATIVE_INFINITY,0,-0,1) ); + + return ( array ); +} + diff --git a/mozilla/js/tamarin/test/ecma3/Math/e15_8_2_12.as b/mozilla/js/tamarin/test/ecma3/Math/e15_8_2_12.as new file mode 100644 index 00000000000..52f9f81fcae --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Math/e15_8_2_12.as @@ -0,0 +1,86 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + var SECTION = "15.8.2.12"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Math.min(x, y)"; + var BUGNUMBER="76439"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "Math.min.length", 2, Math.min.length ); + + array[item++] = new TestCase( SECTION, "Math.min()", Infinity, Math.min() ); + array[item++] = new TestCase( SECTION, "Math.min(void 0, 1)", Number.NaN, Math.min( void 0, 1 ) ); + array[item++] = new TestCase( SECTION, "Math.min(void 0, void 0)", Number.NaN, Math.min( void 0, void 0 ) ); + array[item++] = new TestCase( SECTION, "Math.min(null, 1)", 0, Math.min( null, 1 ) ); + array[item++] = new TestCase( SECTION, "Math.min(-1, null)", -1, Math.min( -1, null ) ); + array[item++] = new TestCase( SECTION, "Math.min(true, false)", 0, Math.min(true,false) ); + + array[item++] = new TestCase( SECTION, "Math.min('-99','99')", -99, Math.min( "-99","99") ); + + /*array[item++] = new TestCase( SECTION, "Math.min(NaN,0)", Number.NaN, Math.min(Number.NaN,0) );*/ + array[item++] = new TestCase( SECTION, "Math.min(NaN,0)", Number.NaN, Math.min(Number.NaN,0) ); + array[item++] = new TestCase( SECTION, "Math.min(NaN,1)", Number.NaN, Math.min(Number.NaN,1) ); + + + /* array[item++] = new TestCase( SECTION, "Math.min(NaN,-1)", Number.NaN, Math.min(Number.NaN,-1) );*/ + + + array[item++] = new TestCase( SECTION, "Math.min(NaN,-1)", Number.NaN, Math.min(Number.NaN,-1) ); + array[item++] = new TestCase( SECTION, "Math.min(0,NaN)", Number.NaN, Math.min(0,Number.NaN) ); + array[item++] = new TestCase( SECTION, "Math.min(1,NaN)", Number.NaN, Math.min(1,Number.NaN) ); + array[item++] = new TestCase( SECTION, "Math.min(-1,NaN)", Number.NaN, Math.min(-1,Number.NaN) ); + array[item++] = new TestCase( SECTION, "Math.min(NaN,NaN)", Number.NaN, Math.min(Number.NaN,Number.NaN) ); + array[item++] = new TestCase( SECTION, "Math.min(1,1.0000000001)", 1, Math.min(1,1.0000000001) ); + array[item++] = new TestCase( SECTION, "Math.min(1.0000000001,1)", 1, Math.min(1.0000000001,1) ); + array[item++] = new TestCase( SECTION, "Math.min(0,0)", 0, Math.min(0,0) ); + array[item++] = new TestCase( SECTION, "Math.min(0,-0)", -0, Math.min(0,-0) ); + array[item++] = new TestCase( SECTION, "Math.min(-0,-0)", -0, Math.min(-0,-0) ); + + array[item++] = new TestCase( SECTION, "Infinity/Math.min(0,-0)", -Infinity, Infinity/Math.min(0,-0) ); + array[item++] = new TestCase( SECTION, "Infinity/Math.min(-0,-0)", -Infinity, Infinity/Math.min(-0,-0) ); + array[item++] = new TestCase( SECTION, "Math.min(Infinity, Number.MAX_VALUE,Number.MIN_VALUE,Number.NEGATIVE_INFINITY)", Number.NEGATIVE_INFINITY, Math.min(Number.POSITIVE_INFINITY,Number.MAX_VALUE,Number.MIN_VALUE,Number.NEGATIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "Math.min(Infinity, Number.MAX_VALUE,Number.MIN_VALUE,Number.NEGATIVE_INFINITY,0,-0,1,-1,'string',Number.NaN,null,void 0)", Number.NaN, Math.min(Number.POSITIVE_INFINITY,Number.MAX_VALUE,Number.MIN_VALUE,Number.NEGATIVE_INFINITY,0,-0,1,-1,'string',Number.NaN,null,void 0) ); + array[item++] = new TestCase( SECTION, "Math.min(Infinity, Number.MAX_VALUE,Number.MIN_VALUE,Number.NEGATIVE_INFINITY,0,-0,1,-1)", -Infinity, Math.min(Number.POSITIVE_INFINITY,Number.MAX_VALUE,Number.MIN_VALUE,Number.NEGATIVE_INFINITY,0,-0,1) ); + + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Math/e15_8_2_13.as b/mozilla/js/tamarin/test/ecma3/Math/e15_8_2_13.as new file mode 100644 index 00000000000..830186ae09a --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Math/e15_8_2_13.as @@ -0,0 +1,127 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.8.2.13"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Math.pow(x, y)"; + var BUGNUMBER="77141"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "Math.pow.length", 2, Math.pow.length ); +/*thisError="no error"; + try{ + Math.pow(); + }catch(e:Error){ + thisError=(e.toString()).substring(0,26); + }finally{//print(thisError); + array[item++] = new TestCase( SECTION, "Math.pow()","ArgumentError: Error #1063",thisError); + } + array[item++] = new TestCase( SECTION, "Math.pow()", Number.NaN, Math.pow() );*/ + array[item++] = new TestCase( SECTION, "Math.pow(null, null)", 1, Math.pow(null,null) ); + array[item++] = new TestCase( SECTION, "Math.pow(void 0, void 0)", Number.NaN, Math.pow(void 0, void 0)); + array[item++] = new TestCase( SECTION, "Math.pow(true, false)", 1, Math.pow(true, false) ); + array[item++] = new TestCase( SECTION, "Math.pow(false,true)", 0, Math.pow(false,true) ); + array[item++] = new TestCase( SECTION, "Math.pow('2','32')", 4294967296, Math.pow('2','32') ); + + array[item++] = new TestCase( SECTION, "Math.pow(1,NaN)", Number.NaN, Math.pow(1,Number.NaN) ); + array[item++] = new TestCase( SECTION, "Math.pow(0,NaN)", Number.NaN, Math.pow(0,Number.NaN) ); + array[item++] = new TestCase( SECTION, "Math.pow(NaN,0)", 1, Math.pow(Number.NaN,0) ); + array[item++] = new TestCase( SECTION, "Math.pow(NaN,-0)", 1, Math.pow(Number.NaN,-0) ); + array[item++] = new TestCase( SECTION, "Math.pow(NaN,1)", Number.NaN, Math.pow(Number.NaN, 1) ); + array[item++] = new TestCase( SECTION, "Math.pow(NaN,.5)", Number.NaN, Math.pow(Number.NaN, .5) ); + array[item++] = new TestCase( SECTION, "Math.pow(1.00000001, Infinity)", Number.POSITIVE_INFINITY, Math.pow(1.00000001, Number.POSITIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "Math.pow(1.00000001, -Infinity)", 0, Math.pow(1.00000001, Number.NEGATIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "Math.pow(-1.00000001, Infinity)", Number.POSITIVE_INFINITY, Math.pow(-1.00000001,Number.POSITIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "Math.pow(-1.00000001, -Infinity)", 0, Math.pow(-1.00000001,Number.NEGATIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "Math.pow(1, Infinity)", Number.NaN, Math.pow(1, Number.POSITIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "Math.pow(1, -Infinity)", Number.NaN, Math.pow(1, Number.NEGATIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "Math.pow(-1, Infinity)", Number.NaN, Math.pow(-1, Number.POSITIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "Math.pow(-1, -Infinity)", Number.NaN, Math.pow(-1, Number.NEGATIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "Math.pow(.0000000009, Infinity)", 0, Math.pow(.0000000009, Number.POSITIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "Math.pow(-.0000000009, Infinity)", 0, Math.pow(-.0000000009, Number.POSITIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "Math.pow(.0000000009, -Infinity)", Number.POSITIVE_INFINITY, Math.pow(-.0000000009, Number.NEGATIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "Math.pow(Infinity, .00000000001)", Number.POSITIVE_INFINITY, Math.pow(Number.POSITIVE_INFINITY,.00000000001) ); + array[item++] = new TestCase( SECTION, "Math.pow(Infinity, 1)", Number.POSITIVE_INFINITY, Math.pow(Number.POSITIVE_INFINITY, 1) ); + array[item++] = new TestCase( SECTION, "Math.pow(Infinity, -.00000000001)",0, Math.pow(Number.POSITIVE_INFINITY, -.00000000001) ); + array[item++] = new TestCase( SECTION, "Math.pow(Infinity, -1)", 0, Math.pow(Number.POSITIVE_INFINITY, -1) ); + array[item++] = new TestCase( SECTION, "Math.pow(-Infinity, 1)", Number.NEGATIVE_INFINITY, Math.pow(Number.NEGATIVE_INFINITY, 1) ); + array[item++] = new TestCase( SECTION, "Math.pow(-Infinity, 333)", Number.NEGATIVE_INFINITY, Math.pow(Number.NEGATIVE_INFINITY, 333) ); + array[item++] = new TestCase( SECTION, "Math.pow(Infinity, 2)", Number.POSITIVE_INFINITY, Math.pow(Number.POSITIVE_INFINITY, 2) ); + array[item++] = new TestCase( SECTION, "Math.pow(-Infinity, 666)", Number.POSITIVE_INFINITY, Math.pow(Number.NEGATIVE_INFINITY, 666) ); + array[item++] = new TestCase( SECTION, "Math.pow(-Infinity, 0.5)", Number.POSITIVE_INFINITY, Math.pow(Number.NEGATIVE_INFINITY, 0.5) ); + array[item++] = new TestCase( SECTION, "Math.pow(-Infinity, Infinity)", Number.POSITIVE_INFINITY, Math.pow(Number.NEGATIVE_INFINITY, Number.POSITIVE_INFINITY) ); + + array[item++] = new TestCase( SECTION, "Math.pow(-Infinity, -1)", -0, Math.pow(Number.NEGATIVE_INFINITY, -1) ); + array[item++] = new TestCase( SECTION, "Infinity/Math.pow(-Infinity, -1)", -Infinity, Infinity/Math.pow(Number.NEGATIVE_INFINITY, -1) ); + + array[item++] = new TestCase( SECTION, "Math.pow(-Infinity, -3)", -0, Math.pow(Number.NEGATIVE_INFINITY, -3) ); + array[item++] = new TestCase( SECTION, "Math.pow(-Infinity, -2)", 0, Math.pow(Number.NEGATIVE_INFINITY, -2) ); + array[item++] = new TestCase( SECTION, "Math.pow(-Infinity, -0.5)", 0, Math.pow(Number.NEGATIVE_INFINITY,-0.5) ); + array[item++] = new TestCase( SECTION, "Math.pow(-Infinity, -Infinity)", 0, Math.pow(Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "Math.pow(0, 1)", 0, Math.pow(0,1) ); + array[item++] = new TestCase( SECTION, "Math.pow(0, 0)", 1, Math.pow(0,0) ); + array[item++] = new TestCase( SECTION, "Math.pow(1, 0)", 1, Math.pow(1,0) ); + array[item++] = new TestCase( SECTION, "Math.pow(-1, 0)", 1, Math.pow(-1,0) ); + array[item++] = new TestCase( SECTION, "Math.pow(0, 0.5)", 0, Math.pow(0,0.5) ); + array[item++] = new TestCase( SECTION, "Math.pow(0, 1000)", 0, Math.pow(0,1000) ); + array[item++] = new TestCase( SECTION, "Math.pow(0, Infinity)", 0, Math.pow(0, Number.POSITIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "Math.pow(0, -1)", Number.POSITIVE_INFINITY, Math.pow(0, -1) ); + array[item++] = new TestCase( SECTION, "Math.pow(0, -0.5)", Number.POSITIVE_INFINITY, Math.pow(0, -0.5) ); + array[item++] = new TestCase( SECTION, "Math.pow(0, -1000)", Number.POSITIVE_INFINITY, Math.pow(0, -1000) ); + array[item++] = new TestCase( SECTION, "Math.pow(0, -Infinity)", Number.POSITIVE_INFINITY, Math.pow(0, Number.NEGATIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "Math.pow(-0, 1)", -0, Math.pow(-0, 1) ); + array[item++] = new TestCase( SECTION, "Math.pow(-0, 3)", -0, Math.pow(-0,3) ); + + array[item++] = new TestCase( SECTION, "Infinity/Math.pow(-0, 1)", -Infinity, Infinity/Math.pow(-0, 1) ); + array[item++] = new TestCase( SECTION, "Infinity/Math.pow(-0, 3)", -Infinity, Infinity/Math.pow(-0,3) ); + + array[item++] = new TestCase( SECTION, "Math.pow(-0, 2)", 0, Math.pow(-0,2) ); + array[item++] = new TestCase( SECTION, "Math.pow(-0, Infinity)", 0, Math.pow(-0, Number.POSITIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "Math.pow(-0, -1)", Number.NEGATIVE_INFINITY, Math.pow(-0, -1) ); + array[item++] = new TestCase( SECTION, "Math.pow(-0, -10001)", Number.NEGATIVE_INFINITY, Math.pow(-0, -10001) ); + array[item++] = new TestCase( SECTION, "Math.pow(-0, -2)", Number.POSITIVE_INFINITY, Math.pow(-0, -2) ); + array[item++] = new TestCase( SECTION, "Math.pow(-0, 0.5)", 0, Math.pow(-0, 0.5) ); + array[item++] = new TestCase( SECTION, "Math.pow(-0, Infinity)", 0, Math.pow(-0, Number.POSITIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "Math.pow(-1, 0.5)", Number.NaN, Math.pow(-1, 0.5) ); + array[item++] = new TestCase( SECTION, "Math.pow(-1, NaN)", Number.NaN, Math.pow(-1, Number.NaN) ); + array[item++] = new TestCase( SECTION, "Math.pow(-1, -0.5)", Number.NaN, Math.pow(-1, -0.5) ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Math/e15_8_2_14.as b/mozilla/js/tamarin/test/ecma3/Math/e15_8_2_14.as new file mode 100644 index 00000000000..424aaea6c8f --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Math/e15_8_2_14.as @@ -0,0 +1,79 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.8.2.14"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Math.random()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + + for ( item = 0; item < 100; item++ ) { + array[item] = new TestCase( SECTION, "Math.random()", "pass", null ); + } + + return ( array ); +} +function getRandom( caseno ) { + testcases[caseno].reason = Math.random(); + testcases[caseno].actual = "pass"; + + if ( ! ( testcases[caseno].reason >= 0) ) { + testcases[caseno].actual = "fail"; + } + + if ( ! (testcases[caseno].reason < 1) ) { + testcases[caseno].actual = "fail"; + } +} + +function test() { + for ( tc=0; tc < testcases.length; tc++ ) { + getRandom( tc ); + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +" = "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value "; + } + stopTest(); + return ( testcases ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Math/e15_8_2_15.as b/mozilla/js/tamarin/test/ecma3/Math/e15_8_2_15.as new file mode 100644 index 00000000000..bdfd8dcf4e6 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Math/e15_8_2_15.as @@ -0,0 +1,87 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.8.2.15"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Math.round(x)"; + var BUGNUMBER="331411"; + + var EXCLUDE = "true"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "Math.round.length", 1, Math.round.length ); + /*thisError="no error"; + try{ + Math.round(); + }catch(e:Error){ + thisError=(e.toString()).substring(0,26); + }finally{//print(thisError); + array[item++] = new TestCase( SECTION, "Math.round()","ArgumentError: Error #1063",thisError); + } + array[item++] = new TestCase( SECTION, "Math.round()", Number.NaN, Math.round() );*/ + array[item++] = new TestCase( SECTION, "Math.round(null)", 0, Math.round(0) ); + array[item++] = new TestCase( SECTION, "Math.round(void 0)", Number.NaN, Math.round(void 0) ); + array[item++] = new TestCase( SECTION, "Math.round(true)", 1, Math.round(true) ); + array[item++] = new TestCase( SECTION, "Math.round(false)", 0, Math.round(false) ); + array[item++] = new TestCase( SECTION, "Math.round('.99999')", 1, Math.round('.99999') ); + array[item++] = new TestCase( SECTION, "Math.round('12345e-2')", 123, Math.round('12345e-2') ); + + array[item++] = new TestCase( SECTION, "Math.round(NaN)", Number.NaN, Math.round(Number.NaN) ); + array[item++] = new TestCase( SECTION, "Math.round(0)", 0, Math.round(0) ); + array[item++] = new TestCase( SECTION, "Math.round(-0)", 0, Math.round(-0)); + array[item++] = new TestCase( SECTION, "Infinity/Math.round(-0)", Infinity, Infinity/Math.round(-0) ); + + array[item++] = new TestCase( SECTION, "Math.round(Infinity)", Number.POSITIVE_INFINITY, Math.round(Number.POSITIVE_INFINITY)); + array[item++] = new TestCase( SECTION, "Math.round(-Infinity)",Number.NEGATIVE_INFINITY, Math.round(Number.NEGATIVE_INFINITY)); + array[item++] = new TestCase( SECTION, "Math.round(0.49)", 0, Math.round(0.49)); + array[item++] = new TestCase( SECTION, "Math.round(0.5)", 1, Math.round(0.5)); + array[item++] = new TestCase( SECTION, "Math.round(0.51)", 1, Math.round(0.51)); + + array[item++] = new TestCase( SECTION, "Math.round(-0.49)", 0, Math.round(-0.49)); + array[item++] = new TestCase( SECTION, "Math.round(-0.5)", 0, Math.round(-0.5)); + array[item++] = new TestCase( SECTION, "Infinity/Math.round(-0.49)", Infinity, Infinity/Math.round(-0.49)); + array[item++] = new TestCase( SECTION, "Infinity/Math.round(-0.5)", Infinity, Infinity/Math.round(-0.5)); + + array[item++] = new TestCase( SECTION, "Math.round(-0.51)", -1, Math.round(-0.51)); + array[item++] = new TestCase( SECTION, "Math.round(3.5)", 4, Math.round(3.5)); + array[item++] = new TestCase( SECTION, "Math.round(-3.5)", -3, Math.round(-3)); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Math/e15_8_2_16.as b/mozilla/js/tamarin/test/ecma3/Math/e15_8_2_16.as new file mode 100644 index 00000000000..638c54c2552 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Math/e15_8_2_16.as @@ -0,0 +1,71 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.8.2.16"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Math.sin(x)"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "Math.sin.length", 1, Math.sin.length ); + /*thisError="no error"; + try{ + Math.sin(); + }catch(e:Error){ + thisError=(e.toString()).substring(0,26); + }finally{//print(thisError); + array[item++] = new TestCase( SECTION, "Math.sin()","ArgumentError: Error #1063",thisError); + } + array[item++] = new TestCase( SECTION, "Math.sin()", Number.NaN, Math.sin() );*/ + array[item++] = new TestCase( SECTION, "Math.sin(null)", 0, Math.sin(null) ); + array[item++] = new TestCase( SECTION, "Math.sin(void 0)", Number.NaN, Math.sin(void 0) ); + array[item++] = new TestCase( SECTION, "Math.sin(false)", 0, Math.sin(false) ); + array[item++] = new TestCase( SECTION, "Math.sin('2.356194490192')", 0.7071067811867916, Math.sin('2.356194490192') ); + + array[item++] = new TestCase( SECTION, "Math.sin(NaN)", Number.NaN, Math.sin(Number.NaN) ); + array[item++] = new TestCase( SECTION, "Math.sin(0)", 0, Math.sin(0) ); + array[item++] = new TestCase( SECTION, "Math.sin(-0)", -0, Math.sin(-0)); + array[item++] = new TestCase( SECTION, "Math.sin(Infinity)", Number.NaN, Math.sin(Number.POSITIVE_INFINITY)); + array[item++] = new TestCase( SECTION, "Math.sin(-Infinity)", Number.NaN, Math.sin(Number.NEGATIVE_INFINITY)); + array[item++] = new TestCase( SECTION, "Math.sin(0.7853981633974)", 0.7071067811865134, Math.sin(0.7853981633974)); + array[item++] = new TestCase( SECTION, "Math.sin(1.570796326795)", 1, Math.sin(1.570796326795)); + array[item++] = new TestCase( SECTION, "Math.sin(2.356194490192)", 0.7071067811867916, Math.sin(2.356194490192)); + array[item++] = new TestCase( SECTION, "Math.sin(3.14159265359)", -2.0682311115474694e-13, Math.sin(3.14159265359)); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Math/e15_8_2_17.as b/mozilla/js/tamarin/test/ecma3/Math/e15_8_2_17.as new file mode 100644 index 00000000000..d7e9b5080ac --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Math/e15_8_2_17.as @@ -0,0 +1,88 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.8.2.17"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Math.sqrt(x)"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "Math.sqrt.length", 1, Math.sqrt.length ); + /*thisError="no error"; + try{ + Math.sqrt(); + }catch(e:Error){ + thisError=(e.toString()).substring(0,26); + }finally{//print(thisError); + array[item++] = new TestCase( SECTION, "Math.sqrt()","ArgumentError: Error #1063",thisError); + } + array[item++] = new TestCase( SECTION, "Math.sqrt()", Number.NaN, Math.sqrt() );*/ + array[item++] = new TestCase( SECTION, "Math.sqrt(void 0)", Number.NaN, Math.sqrt(void 0) ); + array[item++] = new TestCase( SECTION, "Math.sqrt(null)", 0, Math.sqrt(null) ); + array[item++] = new TestCase( SECTION, "Math.sqrt(true)", 1, Math.sqrt(1) ); + array[item++] = new TestCase( SECTION, "Math.sqrt(false)", 0, Math.sqrt(false) ); + array[item++] = new TestCase( SECTION, "Math.sqrt('225')", 15, Math.sqrt('225') ); + + array[item++] = new TestCase( SECTION, "Math.sqrt(NaN)", Number.NaN, Math.sqrt(Number.NaN) ); + array[item++] = new TestCase( SECTION, "Math.sqrt(-Infinity)", Number.NaN, Math.sqrt(Number.NEGATIVE_INFINITY)); + array[item++] = new TestCase( SECTION, "Math.sqrt(-1)", Number.NaN, Math.sqrt(-1)); + array[item++] = new TestCase( SECTION, "Math.sqrt(-0.5)", Number.NaN, Math.sqrt(-0.5)); + array[item++] = new TestCase( SECTION, "Math.sqrt(0)", 0, Math.sqrt(0)); + array[item++] = new TestCase( SECTION, "Math.sqrt(-0)", -0, Math.sqrt(-0)); + array[item++] = new TestCase( SECTION, "Infinity/Math.sqrt(-0)", -Infinity, Infinity/Math.sqrt(-0) ); + array[item++] = new TestCase( SECTION, "Math.sqrt(Infinity)", Number.POSITIVE_INFINITY, Math.sqrt(Number.POSITIVE_INFINITY)); + array[item++] = new TestCase( SECTION, "Math.sqrt(1)", 1, Math.sqrt(1)); + array[item++] = new TestCase( SECTION, "Math.sqrt(2)", Math.SQRT2, Math.sqrt(2)); + array[item++] = new TestCase( SECTION, "Math.sqrt(0.5)", Math.SQRT1_2, Math.sqrt(0.5)); + array[item++] = new TestCase( SECTION, "Math.sqrt(4)", 2, Math.sqrt(4)); + array[item++] = new TestCase( SECTION, "Math.sqrt(9)", 3, Math.sqrt(9)); + array[item++] = new TestCase( SECTION, "Math.sqrt(16)", 4, Math.sqrt(16)); + array[item++] = new TestCase( SECTION, "Math.sqrt(25)", 5, Math.sqrt(25)); + array[item++] = new TestCase( SECTION, "Math.sqrt(36)", 6, Math.sqrt(36)); + array[item++] = new TestCase( SECTION, "Math.sqrt(49)", 7, Math.sqrt(49)); + array[item++] = new TestCase( SECTION, "Math.sqrt(64)", 8, Math.sqrt(64)); + array[item++] = new TestCase( SECTION, "Math.sqrt(256)", 16, Math.sqrt(256)); + array[item++] = new TestCase( SECTION, "Math.sqrt(10000)", 100, Math.sqrt(10000)); + array[item++] = new TestCase( SECTION, "Math.sqrt(65536)", 256, Math.sqrt(65536)); + array[item++] = new TestCase( SECTION, "Math.sqrt(0.09)", 0.3, Math.sqrt(0.09)); + array[item++] = new TestCase( SECTION, "Math.sqrt(0.01)", 0.1, Math.sqrt(0.01)); + array[item++] = new TestCase( SECTION, "Math.sqrt(0.00000001)",0.0001, Math.sqrt(0.00000001)); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Math/e15_8_2_17_1.as b/mozilla/js/tamarin/test/ecma3/Math/e15_8_2_17_1.as new file mode 100644 index 00000000000..230ae37eae5 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Math/e15_8_2_17_1.as @@ -0,0 +1,66 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.8.2.17"; + var VERSION = "ECMA_4"; + startTest(); + var TITLE = "Math.sqrt(x)"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var x = 3; + for( var i = 0; i < 20; i++ ){ + array[item++] = new TestCase( SECTION, "Math.sqrt("+x+")", Number(1.73205080756887719318).toFixed(i).toString(), Math.sqrt(x).toFixed(i).toString() ); + } + + x = 2; + for( var i = 0; i < 20; i++ ){ + array[item++] = new TestCase( SECTION, "Math.sqrt("+x+")", Number(1.4142135623730951455).toFixed(i).toString(), Math.sqrt(x).toFixed(i).toString() ); + } + + + var twenty = 100000000000000000000.1; + + for( var i = 0; i < 20; i++ ){ + + + array[item++] = new TestCase( SECTION, "Math.sqrt("+x+")", Number(1.4142135623730951455).toFixed(i).toString(), Math.sqrt(x).toFixed(i).toString() ); + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Math/e15_8_2_18.as b/mozilla/js/tamarin/test/ecma3/Math/e15_8_2_18.as new file mode 100644 index 00000000000..15df3bee36c --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Math/e15_8_2_18.as @@ -0,0 +1,88 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.8.2.18"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Math.tan(x)"; + var EXCLUDE = "true"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "Math.tan.length", 1, Math.tan.length ); + /*thisError="no error"; + try{ + Math.tan(); + }catch(e:Error){ + thisError=(e.toString()).substring(0,26); + }finally{//print(thisError); + array[item++] = new TestCase( SECTION, "Math.tan()","ArgumentError: Error #1063",thisError); + } + array[item++] = new TestCase( SECTION, "Math.tan()", Number.NaN, Math.tan() );*/ + array[item++] = new TestCase( SECTION, "Math.tan(void 0)", Number.NaN, Math.tan(void 0)); + array[item++] = new TestCase( SECTION, "Math.tan(null)", 0, Math.tan(null) ); + array[item++] = new TestCase( SECTION, "Math.tan(false)", 0, Math.tan(false) ); + + array[item++] = new TestCase( SECTION, "Math.tan(NaN)", Number.NaN, Math.tan(Number.NaN) ); + array[item++] = new TestCase( SECTION, "Math.tan(0)", 0, Math.tan(0)); + array[item++] = new TestCase( SECTION, "Math.tan(-0)", -0, Math.tan(-0)); + array[item++] = new TestCase( SECTION, "Math.tan(Infinity)", Number.NaN, Math.tan(Number.POSITIVE_INFINITY)); + array[item++] = new TestCase( SECTION, "Math.tan(-Infinity)", Number.NaN, Math.tan(Number.NEGATIVE_INFINITY)); + array[item++] = new TestCase( SECTION, "Math.tan(Math.PI/4)", 0.9999999999999999, Math.tan(Math.PI/4)); + array[item++] = new TestCase( SECTION, "Math.tan(3*Math.PI/4)", -1.0000000000000002, Math.tan(3*Math.PI/4)); + array[item++] = new TestCase( SECTION, "Math.tan(Math.PI)", -1.2246063538223773e-16, Math.tan(Math.PI)); + array[item++] = new TestCase( SECTION, "Math.tan(5*Math.PI/4)", 0.9999999999999997, Math.tan(5*Math.PI/4)); + array[item++] = new TestCase( SECTION, "Math.tan(7*Math.PI/4)", -1.0000000000000004, Math.tan(7*Math.PI/4)); + array[item++] = new TestCase( SECTION, "Infinity/Math.tan(-0)", -Infinity, Infinity/Math.tan(-0) ); + +/* + Arctan (x) ~ PI/2 - 1/x for large x. For x = 1.6x10^16, 1/x is about the last binary digit of double precision PI/2. + That is to say, perturbing PI/2 by this much is about the smallest rounding error possible. + + This suggests that the answer Christine is getting and a real Infinity are "adjacent" results from the tangent function. I + suspect that tan (PI/2 + one ulp) is a negative result about the same size as tan (PI/2) and that this pair are the closest + results to infinity that the algorithm can deliver. + + In any case, my call is that the answer we're seeing is "right". I suggest the test pass on any result this size or larger. + = C = +*/ + array[item++] = new TestCase( SECTION, "Math.tan(3*Math.PI/2) >= 5443000000000000", true, Math.tan(3*Math.PI/2) >= 5443000000000000 ); + array[item++] = new TestCase( SECTION, "Math.tan(Math.PI/2) >= 5443000000000000", true, Math.tan(Math.PI/2) >= 5443000000000000 ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Math/e15_8_2_2.as b/mozilla/js/tamarin/test/ecma3/Math/e15_8_2_2.as new file mode 100644 index 00000000000..8d83213cdcf --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Math/e15_8_2_2.as @@ -0,0 +1,102 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + var SECTION = "15.8.2.2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Math.acos()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "Math.acos.length", 1, Math.acos.length ); + + array[item++] = new TestCase( SECTION, "Math.acos(void 0)", Number.NaN, Math.acos(void 0) ); + + /* thisError="no error"; + try{ + Math.acos(); + }catch(e:Error){ + thisError=(e.toString()).substring(0,26); + }finally{//print(thisError); + array[item++] = new TestCase( SECTION, "Math.acos()","ArgumentError: Error #1063",thisError); + }*/ + /*array[item++] = new TestCase( SECTION, "Math.acos()", Number.NaN, Math.acos() );*/ + array[item++] = new TestCase( SECTION, "Math.acos(null)", Math.PI/2, Math.acos(null) ); + array[item++] = new TestCase( SECTION, "Math.acos(NaN)", Number.NaN, Math.acos(Number.NaN) ); + + array[item++] = new TestCase( SECTION, "Math.acos(a string)", Number.NaN, Math.acos("a string") ); + array[item++] = new TestCase( SECTION, "Math.acos('0')", Math.PI/2, Math.acos('0') ); + array[item++] = new TestCase( SECTION, "Math.acos('1')", 0, Math.acos('1') ); + array[item++] = new TestCase( SECTION, "Math.acos('-1')", Math.PI, Math.acos('-1') ); + + array[item++] = new TestCase( SECTION, "Math.acos(1.00000001)", Number.NaN, Math.acos(1.00000001) ); + array[item++] = new TestCase( SECTION, "Math.acos(11.00000001)", Number.NaN, Math.acos(-1.00000001) ); + array[item++] = new TestCase( SECTION, "Math.acos(1)", 0, Math.acos(1) ); + array[item++] = new TestCase( SECTION, "Math.acos(-1)", Math.PI, Math.acos(-1) ); + array[item++] = new TestCase( SECTION, "Math.acos(0)", Math.PI/2, Math.acos(0) ); + array[item++] = new TestCase( SECTION, "Math.acos(-0)", Math.PI/2, Math.acos(-0) ); + array[item++] = new TestCase( SECTION, "Math.acos(Math.SQRT1_2)", Math.PI/4, Math.acos(Math.SQRT1_2)); + array[item++] = new TestCase( SECTION, "Math.acos(-Math.SQRT1_2)", Math.PI/4*3, Math.acos(-Math.SQRT1_2)); + + + + + // test order number 16 + // [amemon 9/14/2006] This test case breaks on mac PPC and linux because of an OS precision error. Fixing... + // Linux gives this: 0.008726646256686873 + // Mac probably gives the same as linux + // Windows gives this: 0.008726646256688278 + // changing from the following to that which follows the following... + // array[item++] = new TestCase( SECTION, "Math.acos(0.9999619230642)", 0.008726646256688278, Math.acos(0.9999619230642)); + + var maxAcceptable16:Number = 0.00872664625669; + var minAcceptable16:Number = 0.00872664625668; + + array[item++] = new TestCase( SECTION, "Math.acos(0.9999619230642)", true, + ( + Math.acos(0.9999619230642) > minAcceptable16 && + Math.acos(0.9999619230642) < maxAcceptable16 + ) + ); + + + + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Math/e15_8_2_3.as b/mozilla/js/tamarin/test/ecma3/Math/e15_8_2_3.as new file mode 100644 index 00000000000..00e844c2cc4 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Math/e15_8_2_3.as @@ -0,0 +1,77 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.8.2.3"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Math.asin()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + /* var thisError="no error"; + try{ + Math.asin(); + }catch(e:Error){ + thisError=(e.toString()).substring(0,26); + }finally{//print(thisError); + array[item++] = new TestCase( SECTION, "Math.asin()","ArgumentError: Error #1063",thisError); + } + array[item++] = new TestCase( SECTION, "Math.asin()", Number.NaN, Math.asin() );*/ + array[item++] = new TestCase( SECTION, "Math.asin(void 0)", Number.NaN, Math.asin(void 0) ); + array[item++] = new TestCase( SECTION, "Math.asin(null)", 0, Math.asin(null) ); + array[item++] = new TestCase( SECTION, "Math.asin(NaN)", Number.NaN, Math.asin(Number.NaN) ); + + array[item++] = new TestCase( SECTION, "Math.asin('string')", Number.NaN, Math.asin("string") ); + array[item++] = new TestCase( SECTION, "Math.asin('0')", 0, Math.asin("0") ); + array[item++] = new TestCase( SECTION, "Math.asin('1')", Math.PI/2, Math.asin("1") ); + array[item++] = new TestCase( SECTION, "Math.asin('-1')", -Math.PI/2, Math.asin("-1") ); + array[item++] = new TestCase( SECTION, "Math.asin(Math.SQRT1_2+'')", 0.7853981633974484, Math.asin(Math.SQRT1_2+'') ); + array[item++] = new TestCase( SECTION, "Math.asin(-Math.SQRT1_2+'')", -0.7853981633974484, Math.asin(-Math.SQRT1_2+'') ); + + array[item++] = new TestCase( SECTION, "Math.asin(1.000001)", Number.NaN, Math.asin(1.000001) ); + array[item++] = new TestCase( SECTION, "Math.asin(-1.000001)", Number.NaN, Math.asin(-1.000001) ); + array[item++] = new TestCase( SECTION, "Math.asin(0)", 0, Math.asin(0) ); + array[item++] = new TestCase( SECTION, "Math.asin(-0)", -0, Math.asin(-0) ); + + array[item++] = new TestCase( SECTION, "Infinity/Math.asin(-0)", -Infinity, Infinity/Math.asin(-0) ); + + array[item++] = new TestCase( SECTION, "Math.asin(1)", Math.PI/2, Math.asin(1) ); + array[item++] = new TestCase( SECTION, "Math.asin(-1)", -Math.PI/2, Math.asin(-1) ); + array[item++] = new TestCase( SECTION, "Math.asin(Math.SQRT1_2))", 0.7853981633974484, Math.asin(Math.SQRT1_2) ); + array[item++] = new TestCase( SECTION, "Math.asin(-Math.SQRT1_2))", -0.7853981633974484, Math.asin(-Math.SQRT1_2)); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Math/e15_8_2_4.as b/mozilla/js/tamarin/test/ecma3/Math/e15_8_2_4.as new file mode 100644 index 00000000000..43a4d91d964 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Math/e15_8_2_4.as @@ -0,0 +1,76 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.8.2.4"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Math.atan()"; + var BUGNUMBER="77391"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "Math.atan.length", 1, Math.atan.length ); + /* var thisError="no error"; + try{ + Math.atan(); + }catch(e:Error){ + thisError=(e.toString()).substring(0,26); + }finally{//print(thisError); + array[item++] = new TestCase( SECTION, "Math.atan()","ArgumentError: Error #1063",thisError); + } + array[item++] = new TestCase( SECTION, "Math.atan()", Number.NaN, Math.atan() );*/ + array[item++] = new TestCase( SECTION, "Math.atan(void 0)", Number.NaN, Math.atan(void 0) ); + array[item++] = new TestCase( SECTION, "Math.atan(null)", 0, Math.atan(null) ); + array[item++] = new TestCase( SECTION, "Math.atan(NaN)", Number.NaN, Math.atan(Number.NaN) ); + + array[item++] = new TestCase( SECTION, "Math.atan('a string')", Number.NaN, Math.atan("a string") ); + array[item++] = new TestCase( SECTION, "Math.atan('0')", 0, Math.atan('0') ); + array[item++] = new TestCase( SECTION, "Math.atan('1')", Math.PI/4, Math.atan('1') ); + array[item++] = new TestCase( SECTION, "Math.atan('-1')", -Math.PI/4, Math.atan('-1') ); + array[item++] = new TestCase( SECTION, "Math.atan('Infinity)", Math.PI/2, Math.atan('Infinity') ); + array[item++] = new TestCase( SECTION, "Math.atan('-Infinity)", -Math.PI/2, Math.atan('-Infinity') ); + + array[item++] = new TestCase( SECTION, "Math.atan(0)", 0, Math.atan(0) ); + array[item++] = new TestCase( SECTION, "Math.atan(-0)", -0, Math.atan(-0) ); + array[item++] = new TestCase( SECTION, "Infinity/Math.atan(-0)", -Infinity, Infinity/Math.atan(-0) ); + array[item++] = new TestCase( SECTION, "Math.atan(Infinity)", Math.PI/2, Math.atan(Number.POSITIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "Math.atan(-Infinity)", -Math.PI/2, Math.atan(Number.NEGATIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "Math.atan(1)", Math.PI/4, Math.atan(1) ); + array[item++] = new TestCase( SECTION, "Math.atan(-1)", -Math.PI/4, Math.atan(-1) ); + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Math/e15_8_2_5.as b/mozilla/js/tamarin/test/ecma3/Math/e15_8_2_5.as new file mode 100644 index 00000000000..0e6b8a34173 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Math/e15_8_2_5.as @@ -0,0 +1,100 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.8.2.5"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Math.atan2(x,y)"; + var BUGNUMBER="76111"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "Math.atan2.length", 2, Math.atan2.length ); + + array[item++] = new TestCase( SECTION, "Math.atan2(NaN, 0)", Number.NaN, Math.atan2(Number.NaN,0) ); + array[item++] = new TestCase( SECTION, "Math.atan2(null, null)", 0, Math.atan2(null, null) ); + array[item++] = new TestCase( SECTION, "Math.atan2(void 0, void 0)", Number.NaN, Math.atan2(void 0, void 0) ); + + /* thisError="no error"; + try{ + Math.atan2(); + }catch(e:Error){ + thisError=(e.toString()).substring(0,26); + }finally{//print(thisError); + array[item++] = new TestCase( SECTION, "Math.atan2()","ArgumentError: Error #1063",thisError); + } + array[item++] = new TestCase( SECTION, "Math.atan2()", Number.NaN, Math.atan2() );*/ + + array[item++] = new TestCase( SECTION, "Math.atan2(0, NaN)", Number.NaN, Math.atan2(0,Number.NaN) ); + array[item++] = new TestCase( SECTION, "Math.atan2(1, 0)", Math.PI/2, Math.atan2(1,0) ); + array[item++] = new TestCase( SECTION, "Math.atan2(1,-0)", Math.PI/2, Math.atan2(1,-0) ); + array[item++] = new TestCase( SECTION, "Math.atan2(0,0.001)", 0, Math.atan2(0,0.001) ); + array[item++] = new TestCase( SECTION, "Math.atan2(0,0)", 0, Math.atan2(0,0) ); + array[item++] = new TestCase( SECTION, "Math.atan2(0, -0)", Math.PI, Math.atan2(0,-0) ); + array[item++] = new TestCase( SECTION, "Math.atan2(0, -1)", Math.PI, Math.atan2(0, -1) ); + + array[item++] = new TestCase( SECTION, "Math.atan2(-0, 1)", -0, Math.atan2(-0, 1) ); + array[item++] = new TestCase( SECTION, "Infinity/Math.atan2(-0, 1)", -Infinity, Infinity/Math.atan2(-0,1) ); + + array[item++] = new TestCase( SECTION, "Math.atan2(-0, 0)", -0, Math.atan2(-0,0) ); + array[item++] = new TestCase( SECTION, "Math.atan2(-0, -0)", -Math.PI, Math.atan2(-0, -0) ); + array[item++] = new TestCase( SECTION, "Math.atan2(-0, -1)", -Math.PI, Math.atan2(-0, -1) ); + array[item++] = new TestCase( SECTION, "Math.atan2(-1, 0)", -Math.PI/2, Math.atan2(-1, 0) ); + array[item++] = new TestCase( SECTION, "Math.atan2(-1, -0)", -Math.PI/2, Math.atan2(-1, -0) ); + array[item++] = new TestCase( SECTION, "Math.atan2(1, Infinity)", 0, Math.atan2(1, Number.POSITIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "Math.atan2(1,-Infinity)", Math.PI, Math.atan2(1, Number.NEGATIVE_INFINITY) ); + + array[item++] = new TestCase( SECTION, "Math.atan2(-1, Infinity)", -0, Math.atan2(-1,Number.POSITIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "Infinity/Math.atan2(-1, Infinity)", -Infinity, Infinity/Math.atan2(-1,Infinity) ); + + array[item++] = new TestCase( SECTION, "Math.atan2(-1,-Infinity)", -Math.PI, Math.atan2(-1,Number.NEGATIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "Math.atan2(Infinity, 0)", Math.PI/2, Math.atan2(Number.POSITIVE_INFINITY, 0) ); + array[item++] = new TestCase( SECTION, "Math.atan2(Infinity, 1)", Math.PI/2, Math.atan2(Number.POSITIVE_INFINITY, 1) ); + array[item++] = new TestCase( SECTION, "Math.atan2(Infinity,-1)", Math.PI/2, Math.atan2(Number.POSITIVE_INFINITY,-1) ); + array[item++] = new TestCase( SECTION, "Math.atan2(Infinity,-0)", Math.PI/2, Math.atan2(Number.POSITIVE_INFINITY,-0) ); + array[item++] = new TestCase( SECTION, "Math.atan2(-Infinity, 0)", -Math.PI/2, Math.atan2(Number.NEGATIVE_INFINITY, 0) ); + array[item++] = new TestCase( SECTION, "Math.atan2(-Infinity,-0)", -Math.PI/2, Math.atan2(Number.NEGATIVE_INFINITY,-0) ); + array[item++] = new TestCase( SECTION, "Math.atan2(-Infinity, 1)", -Math.PI/2, Math.atan2(Number.NEGATIVE_INFINITY, 1) ); + array[item++] = new TestCase( SECTION, "Math.atan2(-Infinity, -1)", -Math.PI/2, Math.atan2(Number.NEGATIVE_INFINITY,-1) ); + array[item++] = new TestCase( SECTION, "Math.atan2(Infinity, Infinity)", Math.PI/4, Math.atan2(Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "Math.atan2(Infinity, -Infinity)", 3*Math.PI/4, Math.atan2(Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "Math.atan2(-Infinity, Infinity)", -Math.PI/4, Math.atan2(Number.NEGATIVE_INFINITY, Number.POSITIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "Math.atan2(-Infinity, -Infinity)", -3*Math.PI/4, Math.atan2(Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "Math.atan2(-1, 1)", -Math.PI/4, Math.atan2( -1, 1) ); + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Math/e15_8_2_6.as b/mozilla/js/tamarin/test/ecma3/Math/e15_8_2_6.as new file mode 100644 index 00000000000..541ca6d9d02 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Math/e15_8_2_6.as @@ -0,0 +1,104 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.8.2.6"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Math.ceil(x)"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "Math.ceil.length", 1, Math.ceil.length ); + + array[item++] = new TestCase( SECTION, "Math.ceil(NaN)", Number.NaN, Math.ceil(Number.NaN) ); + array[item++] = new TestCase( SECTION, "Math.ceil(null)", 0, Math.ceil(null) ); + + /*thisError="no error"; + try{ + Math.ceil(); + }catch(e:Error){ + thisError=(e.toString()).substring(0,26); + }finally{//print(thisError); + array[item++] = new TestCase( SECTION, "Math.ceil()","ArgumentError: Error #1063",thisError); + } + array[item++] = new TestCase( SECTION, "Math.ceil()", Number.NaN, Math.ceil() );*/ + array[item++] = new TestCase( SECTION, "Math.ceil(void 0)", Number.NaN, Math.ceil(void 0) ); + + array[item++] = new TestCase( SECTION, "Math.ceil('0')", 0, Math.ceil('0') ); + array[item++] = new TestCase( SECTION, "Math.ceil('-0')", -0, Math.ceil('-0') ); + array[item++] = new TestCase( SECTION, "Infinity/Math.ceil('0')", Infinity, Infinity/Math.ceil('0')); + array[item++] = new TestCase( SECTION, "Infinity/Math.ceil('-0')", -Infinity, Infinity/Math.ceil('-0')); + + array[item++] = new TestCase( SECTION, "Math.ceil(0)", 0, Math.ceil(0) ); + array[item++] = new TestCase( SECTION, "Math.ceil(-0)", -0, Math.ceil(-0) ); + array[item++] = new TestCase( SECTION, "Infinity/Math.ceil(0)", Infinity, Infinity/Math.ceil(0)); + array[item++] = new TestCase( SECTION, "Infinity/Math.ceil(-0)", -Infinity, Infinity/Math.ceil(-0)); + + array[item++] = new TestCase( SECTION, "Math.ceil(Infinity)", Number.POSITIVE_INFINITY, Math.ceil(Number.POSITIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "Math.ceil(-Infinity)", Number.NEGATIVE_INFINITY, Math.ceil(Number.NEGATIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "Math.ceil(-Number.MIN_VALUE)", -0, Math.ceil(-Number.MIN_VALUE) ); + array[item++] = new TestCase( SECTION, "Infinity/Math.ceil(-Number.MIN_VALUE)", -Infinity, Infinity/Math.ceil(-Number.MIN_VALUE) ); + array[item++] = new TestCase( SECTION, "Math.ceil(1)", 1, Math.ceil(1) ); + array[item++] = new TestCase( SECTION, "Math.ceil(-1)", -1, Math.ceil(-1) ); + array[item++] = new TestCase( SECTION, "Math.ceil(-0.9)", -0, Math.ceil(-0.9) ); + array[item++] = new TestCase( SECTION, "Infinity/Math.ceil(-0.9)", -Infinity, Infinity/Math.ceil(-0.9) ); + array[item++] = new TestCase( SECTION, "Math.ceil(0.9 )", 1, Math.ceil( 0.9) ); + array[item++] = new TestCase( SECTION, "Math.ceil(-1.1)", -1, Math.ceil( -1.1)); + array[item++] = new TestCase( SECTION, "Math.ceil( 1.1)", 2, Math.ceil( 1.1)); + + array[item++] = new TestCase( SECTION, "Math.ceil(Infinity)", -Math.floor(-Infinity), Math.ceil(Number.POSITIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "Math.ceil(-Infinity)", -Math.floor(Infinity), Math.ceil(Number.NEGATIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "Math.ceil(-Number.MIN_VALUE)", -Math.floor(Number.MIN_VALUE), Math.ceil(-Number.MIN_VALUE) ); + array[item++] = new TestCase( SECTION, "Math.ceil(1)", -Math.floor(-1), Math.ceil(1) ); + array[item++] = new TestCase( SECTION, "Math.ceil(-1)", -Math.floor(1), Math.ceil(-1) ); + array[item++] = new TestCase( SECTION, "Math.ceil(-0.9)", -Math.floor(0.9), Math.ceil(-0.9) ); + array[item++] = new TestCase( SECTION, "Math.ceil(0.9 )", -Math.floor(-0.9), Math.ceil( 0.9) ); + array[item++] = new TestCase( SECTION, "Math.ceil(-1.1)", -Math.floor(1.1), Math.ceil( -1.1)); + array[item++] = new TestCase( SECTION, "Math.ceil( 1.1)", -Math.floor(-1.1), Math.ceil( 1.1)); + array[item++] = new TestCase( SECTION, "Math.ceil( .012345)", 1, Math.ceil( .012345)); + array[item++] = new TestCase( SECTION, "Math.ceil( .0012345)", 1, Math.ceil( .0012345)); + array[item++] = new TestCase( SECTION, "Math.ceil( .00012345)", 1, Math.ceil( .00012345)); + array[item++] = new TestCase( SECTION, "Math.ceil( .0000012345)", 1, Math.ceil( .0000012345)); + array[item++] = new TestCase( SECTION, "Math.ceil( .00000012345)", 1, Math.ceil( .00000012345)); + array[item++] = new TestCase( SECTION, "Math.ceil( 5.01)", 6, Math.ceil( 5.01)); + array[item++] = new TestCase( SECTION, "Math.ceil( 5.001)", 6, Math.ceil( 5.001)); + array[item++] = new TestCase( SECTION, "Math.ceil( 5.0001)", 6, Math.ceil( 5.0001)); + array[item++] = new TestCase( SECTION, "Math.ceil( 5.00001)", 6, Math.ceil( 5.00001)); + array[item++] = new TestCase( SECTION, "Math.ceil( 5.000001)", 6, Math.ceil( 5.000001)); + array[item++] = new TestCase( SECTION, "Math.ceil( 5.0000001)", 6, Math.ceil( 5.0000001)); + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Math/e15_8_2_7.as b/mozilla/js/tamarin/test/ecma3/Math/e15_8_2_7.as new file mode 100644 index 00000000000..aab38770687 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Math/e15_8_2_7.as @@ -0,0 +1,103 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.8.2.7"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Math.cos(x)"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "Math.cos.length", 1, Math.cos.length ); + /*thisError="no error"; + try{ + Math.cos(); + }catch(e:Error){ + thisError=(e.toString()).substring(0,26); + }finally{//print(thisError); + array[item++] = new TestCase( SECTION, "Math.cos()","ArgumentError: Error #1063",thisError); + } + array[item++] = new TestCase( SECTION, "Math.cos()", Number.NaN, Math.cos() );*/ + array[item++] = new TestCase( SECTION, "Math.cos(void 0)", Number.NaN, Math.cos(void 0) ); + array[item++] = new TestCase( SECTION, "Math.cos(false)", 1, Math.cos(false) ); + array[item++] = new TestCase( SECTION, "Math.cos(null)", 1, Math.cos(null) ); + + array[item++] = new TestCase( SECTION, "Math.cos('0')", 1, Math.cos('0') ); + array[item++] = new TestCase( SECTION, "Math.cos('Infinity')", Number.NaN, Math.cos("Infinity") ); + array[item++] = new TestCase( SECTION, "Math.cos('3.14159265359')", -1, Math.cos('3.14159265359') ); + + array[item++] = new TestCase( SECTION, "Math.cos(NaN)", Number.NaN, Math.cos(Number.NaN) ); + array[item++] = new TestCase( SECTION, "Math.cos(0)", 1, Math.cos(0) ); + array[item++] = new TestCase( SECTION, "Math.cos(-0)", 1, Math.cos(-0) ); + array[item++] = new TestCase( SECTION, "Math.cos(Infinity)", Number.NaN, Math.cos(Number.POSITIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "Math.cos(-Infinity)", Number.NaN, Math.cos(Number.NEGATIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "Math.cos(0.7853981633974)", 0.7071067811865817, Math.cos(0.7853981633974) ); + array[item++] = new TestCase( SECTION, "Math.cos(1.570796326795)", -1.0341155557737347e-13, Math.cos(1.570796326795) ); + array[item++] = new TestCase( SECTION, "Math.cos(2.356194490192)", -0.7071067811863034, Math.cos(2.356194490192) ); + array[item++] = new TestCase( SECTION, "Math.cos(3.14159265359)", -1, Math.cos(3.14159265359) ); + array[item++] = new TestCase( SECTION, "Math.cos(3.926990816987)", -0.7071067811867184, Math.cos(3.926990816987) ); + array[item++] = new TestCase( SECTION, "Math.cos(4.712388980385)", 3.0979057752227035e-13, Math.cos(4.712388980385) ); + array[item++] = new TestCase( SECTION, "Math.cos(5.497787143782)", 0.70710678118645, Math.cos(5.497787143782) ); + array[item++] = new TestCase( SECTION, "Math.cos(Math.PI*2)", 1, Math.cos(Math.PI*2) ); + array[item++] = new TestCase( SECTION, "Math.cos(Math.PI/4)", Math.SQRT2/2, Math.cos(Math.PI/4) ); + array[item++] = new TestCase( SECTION, "Math.cos(Math.PI/2)", 6.123031769111886e-17, Math.cos(Math.PI/2) ); + array[item++] = new TestCase( SECTION, "Math.cos(3*Math.PI/4)", -0.7071067811865475, Math.cos(3*Math.PI/4) ); + array[item++] = new TestCase( SECTION, "Math.cos(Math.PI)", -1, Math.cos(Math.PI) ); + array[item++] = new TestCase( SECTION, "Math.cos(5*Math.PI/4)", -0.7071067811865477, Math.cos(5*Math.PI/4) ); + array[item++] = new TestCase( SECTION, "Math.cos(3*Math.PI/2)", -1.836909530733566e-16, Math.cos(3*Math.PI/2) ); + array[item++] = new TestCase( SECTION, "Math.cos(7*Math.PI/4)", 0.7071067811865474, Math.cos(7*Math.PI/4) ); + array[item++] = new TestCase( SECTION, "Math.cos(Math.PI*2)", 1, Math.cos(2*Math.PI) ); + array[item++] = new TestCase( SECTION, "Math.cos(-0.7853981633974)", 0.7071067811865817, Math.cos(-0.7853981633974) ); + array[item++] = new TestCase( SECTION, "Math.cos(-1.570796326795)", -1.0341155557737347e-13, Math.cos(-1.570796326795) ); + array[item++] = new TestCase( SECTION, "Math.cos(-2.3561944901920)", -0.7071067811863034, Math.cos(2.3561944901920) ); + array[item++] = new TestCase( SECTION, "Math.cos(-3.14159265359)", -1, Math.cos(3.14159265359) ); + array[item++] = new TestCase( SECTION, "Math.cos(-3.926990816987)", -0.7071067811867184, Math.cos(3.926990816987) ); + array[item++] = new TestCase( SECTION, "Math.cos(-4.712388980385)", 3.0979057752227035e-13, Math.cos(4.712388980385) ); + array[item++] = new TestCase( SECTION, "Math.cos(-5.497787143782)", 0.70710678118645, Math.cos(5.497787143782) ); + array[item++] = new TestCase( SECTION, "Math.cos(-6.28318530718)", 1, Math.cos(6.28318530718) ); + array[item++] = new TestCase( SECTION, "Math.cos(-Math.PI/4)", Math.SQRT2/2, Math.cos(-Math.PI/4) ); + array[item++] = new TestCase( SECTION, "Math.cos(-Math.PI/2)", 6.123031769111886e-17, Math.cos(-Math.PI/2) ); + array[item++] = new TestCase( SECTION, "Math.cos(-3*Math.PI/4)", -0.7071067811865475, Math.cos(-3*Math.PI/4) ); + array[item++] = new TestCase( SECTION, "Math.cos(-Math.PI)", -1, Math.cos(-Math.PI) ); + array[item++] = new TestCase( SECTION, "Math.cos(-5*Math.PI/4)", -0.7071067811865477, Math.cos(-5*Math.PI/4) ); + array[item++] = new TestCase( SECTION, "Math.cos(-3*Math.PI/2)", -1.836909530733566e-16, Math.cos(-3*Math.PI/2) ); + array[item++] = new TestCase( SECTION, "Math.cos(-7*Math.PI/4)", 0.7071067811865474, Math.cos(-7*Math.PI/4) ); + array[item++] = new TestCase( SECTION, "Math.cos(-Math.PI*2)", 1, Math.cos(-Math.PI*2) ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Math/e15_8_2_8.as b/mozilla/js/tamarin/test/ecma3/Math/e15_8_2_8.as new file mode 100644 index 00000000000..65c28853666 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Math/e15_8_2_8.as @@ -0,0 +1,109 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + var SECTION = "15.8.2.8"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Math.exp(x)"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "Math.exp.length", 1, Math.exp.length ); + var thisError="no error"; + try{ + Math.exp(); + }catch(e:Error){ + thisError=(e.toString()).substring(0,26); + }finally{//print(thisError); + array[item++] = new TestCase( SECTION, "Math.exp()","ArgumentError: Error #1063",thisError); + } + /*array[item++] = new TestCase( SECTION, "Math.exp()", Number.NaN, Math.exp() );*/ + array[item++] = new TestCase( SECTION, "Math.exp(null)", 1, Math.exp(null) ); + array[item++] = new TestCase( SECTION, "Math.exp(void 0)", Number.NaN, Math.exp(void 0) ); + array[item++] = new TestCase( SECTION, "Math.exp(1)", Math.E, Math.exp(1) ); + + array[item++] = new TestCase( SECTION, "Math.exp(true)", Math.E, Math.exp(true) ); + array[item++] = new TestCase( SECTION, "Math.exp(false)", 1, Math.exp(false) ); + + array[item++] = new TestCase( SECTION, "Math.exp('1')", Math.E, Math.exp('1') ); + array[item++] = new TestCase( SECTION, "Math.exp('0')", 1, Math.exp('0') ); + + array[item++] = new TestCase( SECTION, "Math.exp(NaN)", Number.NaN, Math.exp(Number.NaN) ); + array[item++] = new TestCase( SECTION, "Math.exp(0)", 1, Math.exp(0) ); + array[item++] = new TestCase( SECTION, "Math.exp(-0)", 1, Math.exp(-0) ); + array[item++] = new TestCase( SECTION, "Math.exp(Infinity)", Number.POSITIVE_INFINITY, Math.exp(Number.POSITIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "Math.exp(-Infinity)", 0, Math.exp(Number.NEGATIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "Math.exp(2)", 7.38905609893065, Math.exp(2) ); + + + // test order number 15 + // [amemon 9/14/2006] This test case breaks on mac PPC and linux because of an OS precision error. Fixing... + // array[item++] = new TestCase( SECTION, "Math.exp(10)", 22026.465794806725, Math.exp(10) ); + var maxCorrect15:Number = 22026.4657948068; + var minCorrect15:Number = 22026.4657948067; + + array[item++] = new TestCase( SECTION, "Math.exp(10)", true, + (Math.exp(10) > minCorrect15 && Math.exp(10) < maxCorrect15) ); + + + + + // test order number 16 + // [amemon 9/14/2006] This test case breaks on mac PPC and linux because of an OS precision error. Fixing... + // array[item++] = new TestCase( SECTION, "Math.exp(100)","2.68811714181616e+43", Math.exp(100)+"" ); + array[item++] = new TestCase( SECTION, "Math.exp(100)", true, + ( + (String(Math.exp(100)+"").indexOf("2.6881171418161") != -1) && + (String(Math.exp(100)+"").indexOf("e+43") != -1) + ) + ); + + + + + + + array[item++] = new TestCase( SECTION, "Math.exp(1000)",Infinity, Math.exp(1000)); + array[item++] = new TestCase( SECTION, "Math.exp(-1000)",0, Math.exp(-1000)); + array[item++] = new TestCase( SECTION, "Math.exp(100000)",Infinity, Math.exp(100000)); + array[item++] = new TestCase( SECTION, "Math.exp(Number.MAX_VALUE)",Infinity, Math.exp(Number.MAX_VALUE)); + array[item++] = new TestCase( SECTION, "Math.exp(Number.MIN_VALUE)",1, Math.exp(Number.MIN_VALUE)); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Math/e15_8_2_9.as b/mozilla/js/tamarin/test/ecma3/Math/e15_8_2_9.as new file mode 100644 index 00000000000..0f770e92473 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Math/e15_8_2_9.as @@ -0,0 +1,117 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.8.2.9"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Math.floor(x)"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "Math.floor.length", 1, Math.floor.length ); + /*thisError="no error"; + try{ + Math.floor(); + }catch(e:Error){ + thisError=(e.toString()).substring(0,26); + }finally{//print(thisError); + array[item++] = new TestCase( SECTION, "Math.floor()","ArgumentError: Error #1063",thisError); + } + array[item++] = new TestCase( SECTION, "Math.floor()", Number.NaN, Math.floor() );*/ + array[item++] = new TestCase( SECTION, "Math.floor(void 0)", Number.NaN, Math.floor(void 0) ); + array[item++] = new TestCase( SECTION, "Math.floor(null)", 0, Math.floor(null) ); + array[item++] = new TestCase( SECTION, "Math.floor(true)", 1, Math.floor(true) ); + array[item++] = new TestCase( SECTION, "Math.floor(false)", 0, Math.floor(false) ); + + array[item++] = new TestCase( SECTION, "Math.floor('1.1')", 1, Math.floor("1.1") ); + array[item++] = new TestCase( SECTION, "Math.floor('-1.1')", -2, Math.floor("-1.1") ); + array[item++] = new TestCase( SECTION, "Math.floor('0.1')", 0, Math.floor("0.1") ); + array[item++] = new TestCase( SECTION, "Math.floor('-0.1')", -1, Math.floor("-0.1") ); + + array[item++] = new TestCase( SECTION, "Math.floor(NaN)", Number.NaN, Math.floor(Number.NaN) ); + array[item++] = new TestCase( SECTION, "Math.floor(NaN)==-Math.ceil(-NaN)", false, Math.floor(Number.NaN) == -Math.ceil(-Number.NaN) ); + + array[item++] = new TestCase( SECTION, "Math.floor(0)", 0, Math.floor(0) ); + array[item++] = new TestCase( SECTION, "Math.floor(0)==-Math.ceil(-0)", true, Math.floor(0) == -Math.ceil(-0) ); + + array[item++] = new TestCase( SECTION, "Math.floor(-0)", -0, Math.floor(-0) ); + array[item++] = new TestCase( SECTION, "Infinity/Math.floor(-0)", -Infinity, Infinity/Math.floor(-0) ); + array[item++] = new TestCase( SECTION, "Math.floor(-0)==-Math.ceil(0)", true, Math.floor(-0)== -Math.ceil(0) ); + + array[item++] = new TestCase( SECTION, "Math.floor(Infinity)", Number.POSITIVE_INFINITY, Math.floor(Number.POSITIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "Math.floor(Infinity)==-Math.ceil(-Infinity)", true, Math.floor(Number.POSITIVE_INFINITY) == -Math.ceil(Number.NEGATIVE_INFINITY) ); + + array[item++] = new TestCase( SECTION, "Math.floor(-Infinity)", Number.NEGATIVE_INFINITY, Math.floor(Number.NEGATIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "Math.floor(-Infinity)==-Math.ceil(Infinity)", true, Math.floor(Number.NEGATIVE_INFINITY) == -Math.ceil(Number.POSITIVE_INFINITY) ); + + array[item++] = new TestCase( SECTION, "Math.floor(0.0000001)", 0, Math.floor(0.0000001) ); + array[item++] = new TestCase( SECTION, "Math.floor(0.0000001)==-Math.ceil(0.0000001)", true, Math.floor(0.0000001)==-Math.ceil(-0.0000001) ); + + array[item++] = new TestCase( SECTION, "Math.floor(-0.0000001)", -1, Math.floor(-0.0000001) ); + array[item++] = new TestCase( SECTION, "Math.floor(0.0000001)==-Math.ceil(0.0000001)", true, Math.floor(-0.0000001)==-Math.ceil(0.0000001) ); + array[item++] = new TestCase( SECTION, "Math.floor(1)", 1, Math.floor(1) ); + array[item++] = new TestCase( SECTION, "Math.floor(-1)", -1, Math.floor(-1) ); + array[item++] = new TestCase( SECTION, "Math.floor(-0.9)", -1, Math.floor(-0.9) ); + array[item++] = new TestCase( SECTION, "Infinity/Math.floor(-0.9)", -Infinity, Infinity/Math.floor(-0.9) ); + array[item++] = new TestCase( SECTION, "Math.floor(0.9 )", 0, Math.floor( 0.9) ); + array[item++] = new TestCase( SECTION, "Math.floor(-1.1)", -2, Math.floor( -1.1)); + array[item++] = new TestCase( SECTION, "Math.floor( 1.1)", 1, Math.floor( 1.1)); + + array[item++] = new TestCase( SECTION, "Math.floor(Infinity)", -Math.ceil(-Infinity), Math.floor(Number.POSITIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "Math.floor(-Infinity)", -Math.ceil(Infinity), Math.floor(Number.NEGATIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "Math.floor(-Number.MIN_VALUE)", -Math.ceil(Number.MIN_VALUE), Math.floor(-Number.MIN_VALUE) ); + array[item++] = new TestCase( SECTION, "Math.floor(1)", -Math.ceil(-1), Math.floor(1) ); + array[item++] = new TestCase( SECTION, "Math.floor(-1)", -Math.ceil(1), Math.floor(-1) ); + array[item++] = new TestCase( SECTION, "Math.floor(-0.9)", -Math.ceil(0.9), Math.floor(-0.9) ); + array[item++] = new TestCase( SECTION, "Math.floor(0.9 )", -Math.ceil(-0.9), Math.floor( 0.9) ); + array[item++] = new TestCase( SECTION, "Math.floor(-1.1)", -Math.ceil(1.1), Math.floor( -1.1)); + array[item++] = new TestCase( SECTION, "Math.floor( 1.1)", -Math.ceil(-1.1), Math.floor( 1.1)); + array[item++] = new TestCase( SECTION, "Math.floor( .012345)", 0, Math.floor( .012345)); + array[item++] = new TestCase( SECTION, "Math.floor( .0012345)", 0, Math.floor(.0012345)); + array[item++] = new TestCase( SECTION, "Math.floor( .00012345)", 0, Math.floor(.00012345)); + array[item++] = new TestCase( SECTION, "Math.floor( .0000012345)", 0, Math.floor( .0000012345)); + array[item++] = new TestCase( SECTION, "Math.floor( .00000012345)", 0, Math.floor( .00000012345)); + array[item++] = new TestCase( SECTION, "Math.floor( 5.01)", 5, Math.floor( 5.01)); + array[item++] = new TestCase( SECTION, "Math.floor( 5.001)", 5, Math.floor( 5.001)); + array[item++] = new TestCase( SECTION, "Math.floor( 5.0001)", 5, Math.floor( 5.0001)); + array[item++] = new TestCase( SECTION, "Math.floor( 5.00001)", 5, Math.floor( 5.00001)); + array[item++] = new TestCase( SECTION, "Math.floor( 5.000001)", 5, Math.floor( 5.000001)); + array[item++] = new TestCase( SECTION, "Math.floor( 5.0000001)", 5, Math.floor(5.0000001)); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Math/e15_8_2_rt.as b/mozilla/js/tamarin/test/ecma3/Math/e15_8_2_rt.as new file mode 100644 index 00000000000..a522fd0971f --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Math/e15_8_2_rt.as @@ -0,0 +1,61 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.8-2-n"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "The Math Object"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + var thisError="no error"; + try{ + + var MYMATH = new Math(); + } + catch(e){ + thisError=e.toString(); + } + finally{ + array[item++] = new TestCase( SECTION, + "MYMATH = new Math()", + "TypeError: Error #1076", + typeError(thisError) ); + } + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Math/e15_8_3_rt.as b/mozilla/js/tamarin/test/ecma3/Math/e15_8_3_rt.as new file mode 100644 index 00000000000..e71b2461dd2 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Math/e15_8_3_rt.as @@ -0,0 +1,58 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.8-3-n"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "The Math Object"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + thisError="no error"; + var MYMATH; + try{ + MYMATH = Math(); + }catch(e:TypeError){ + thisError=e.toString(); + }finally{ + array[item++] = new TestCase( SECTION, + "MYMATH = Math()", + "TypeError: Error #1075", + typeError(thisError)); + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Math/e15_8__1.as b/mozilla/js/tamarin/test/ecma3/Math/e15_8__1.as new file mode 100644 index 00000000000..9bf23ca2a85 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Math/e15_8__1.as @@ -0,0 +1,56 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.8-1"; + var VERSION = "ECMA_2"; + startTest(); + var TITLE = "The Math Object"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, + "Math.constructor.prototype == Class.prototype", + true, + Math.constructor.prototype == Class.prototype ); + + array[item++] = new TestCase( SECTION, + "Object.constructor.prototype", + Object.prototype+"", + Object.constructor.prototype+""); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Misc/smoke.as b/mozilla/js/tamarin/test/ecma3/Misc/smoke.as new file mode 100644 index 00000000000..2178b0b30fa --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Misc/smoke.as @@ -0,0 +1,89 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* +* The contents of this file are subject to the Netscape Public +* License Version 1.1 (the "License"); you may not use this file +* except in compliance with the License. You may obtain a copy of +* the License at http://www.mozilla.org/NPL/ +* +* Software distributed under the License is distributed on an "AS +* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or +* implied. See the License for the specific language governing +* rights and limitations under the License. +* +* The Original Code is mozilla.org code. +* +* The Initial Developer of the Original Code is Netscape +* Communications Corporation. Portions created by Netscape are +* Copyright (C) 1998 Netscape Communications Corporation. All +* Rights Reserved. +* +* Contributor(s): +*/ + + + + var SECTION = "test"; // provide a document reference (ie, ECMA section) + var VERSION = "ECMA_2"; // Version of JavaScript or ECMA + var TITLE = "test"; // Provide ECMA section title or a description + var BUGNUMBER = ""; // Provide URL to bugsplat or bugzilla report + + startTest(); // leave this alone + + var testcases = getTestCases(); + + test(); // leave this alone. this executes the test cases and + // displays results. + +function getTestCases() { + var array = new Array(); + var item = 0; + /* + * Calls to AddTestCase here. AddTestCase is a function that is defined + * in shell.js and takes three arguments: + * - a string representation of what is being tested + * - the expected result + * - the actual result + * + * For example, a test might look like this: + * + * var zip = /[\d]{5}$/; + * + * AddTestCase( + * "zip = /[\d]{5}$/; \"PO Box 12345 Boston, MA 02134\".match(zip)", // description of the test + * "02134", // expected result + * "PO Box 12345 Boston, MA 02134".match(zip) ); // actual result + * + */ + var helloWorld = "Hello World"; + array[item++] = new TestCase("", "[Hello World Test]", "Hello World", helloWorld ); + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/NativeObjects/e15_2_rt.as b/mozilla/js/tamarin/test/ecma3/NativeObjects/e15_2_rt.as new file mode 100644 index 00000000000..e89b174a3d4 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/NativeObjects/e15_2_rt.as @@ -0,0 +1,55 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15-2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Native ECMAScript Objects"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "Object.constructor.prototype", Object.prototype+"", Object.constructor.prototype+"" ); + array[item++] = new TestCase( SECTION, "Array.constructor.prototype", Object.prototype+"", Array.constructor.prototype+""); + array[item++] = new TestCase( SECTION, "String.constructor.prototype", Object.prototype+"", String.constructor.prototype+""); + array[item++] = new TestCase( SECTION, "Boolean.constructor.prototype", Object.prototype+"", Boolean.constructor.prototype+""); + array[item++] = new TestCase( SECTION, "Number.constructor.prototype", Object.prototype+"", Number.constructor.prototype+""); + array[item++] = new TestCase( SECTION, "Date.constructor.prototype", Object.prototype+"", Date.constructor.prototype+""); + array[item++] = new TestCase( SECTION, "TestCase.constructor.prototype", Function.prototype+"", TestCase.constructor.prototype+""); + array[item++] = new TestCase( SECTION, "Math.pow.constructor.prototype", Function.prototype+"", Math.pow.constructor.prototype+""); + array[item++] = new TestCase( SECTION, "String.prototype.indexOf.constructor.prototype", Function.prototype+"", String.prototype.indexOf.constructor.prototype+""); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Number/e15_7_1.as b/mozilla/js/tamarin/test/ecma3/Number/e15_7_1.as new file mode 100644 index 00000000000..c432aec0f1c --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Number/e15_7_1.as @@ -0,0 +1,180 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.7.1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "The Number Constructor Called as a Function"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase(SECTION, "Number()", 0, Number() ); + array[item++] = new TestCase(SECTION, "Number(void 0)", Number.NaN, Number(void 0) ); + array[item++] = new TestCase(SECTION, "Number(null)", 0, Number(null) ); + array[item++] = new TestCase(SECTION, "Number()", 0, Number() ); + array[item++] = new TestCase(SECTION, "Number(new Number())", 0, Number( new Number() ) ); + array[item++] = new TestCase(SECTION, "Number(0)", 0, Number(0) ); + array[item++] = new TestCase(SECTION, "Number(1)", 1, Number(1) ); + array[item++] = new TestCase(SECTION, "Number(-1)", -1, Number(-1) ); + array[item++] = new TestCase(SECTION, "Number(NaN)", Number.NaN, Number( Number.NaN ) ); + array[item++] = new TestCase(SECTION, "Number('string')", Number.NaN, Number( "string") ); + array[item++] = new TestCase(SECTION, "Number(new String())", 0, Number( new String() ) ); + array[item++] = new TestCase(SECTION, "Number('')", 0, Number( "" ) ); + array[item++] = new TestCase(SECTION, "Number(Infinity)", Number.POSITIVE_INFINITY, Number("Infinity") ); + + array[item++] = new TestCase(SECTION, "Number(-Infinity)", Number.NEGATIVE_INFINITY, Number("-Infinity") ); + + array[item++] = new TestCase(SECTION, "Number(3.141592653589793)", Math.PI, Number("3.141592653589793") ); + + array[item++] = new TestCase(SECTION, "Number(4294967297)", (Math.pow(2,32)+1), Number("4294967297") ); + + array[item++] = new TestCase(SECTION, "Number(1e2000)", Infinity, Number(1e2000) ); + + array[item++] = new TestCase(SECTION, "Number(-1e2000)", -Infinity, Number(-1e2000) ); + + array[item++] = new TestCase(SECTION, "Number(1e-2000)", 0, Number(1e-2000) ); + + array[item++] = new TestCase(SECTION, "Number(1/1e-2000)", Infinity, Number(1/1e-2000) ); + + array[item++] = new TestCase(SECTION, "Number(true)", 1, Number(true) ); + + array[item++] = new TestCase(SECTION, "Number(false)", 0, Number(false) ); + + array[item++] = new TestCase(SECTION, "Number(new Boolean(false)", 0, Number(new Boolean(false)) ); + + array[item++] = new TestCase(SECTION, "Number(new String('Number.POSITIVE_INFINITY')", Infinity, Number(new String(Number.POSITIVE_INFINITY)) ); + + array[item++] = new TestCase(SECTION, "Number(new Number(false)", 0, Number(new Number(false)) ); + + + array[item++] = new TestCase(SECTION, "Number('3000000000.25')", (3000000000.25), Number("3000000000.25") ); + + array[item++] = new TestCase(SECTION, "Number(-'3000000000.25')", (-3000000000.25), Number(-"3000000000.25") ); + + array[item++] = new TestCase(SECTION, "Number('1.79769313486231e+308')",(Number.MAX_VALUE+""),Number("1.79769313486231e+308")+"" ); + array[item++] = new TestCase(SECTION, "Number('4.9406564584124654e-324')",(Number.MIN_VALUE+""),Number("4.9406564584124654e-324")+"" ); + array[item++] = new TestCase(SECTION, "Number(new MyObject(100))", 100, Number(new MyObject(100)) ); + + var s:String = +"0xFFFFFFFFFFFFF80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"; + + array[item++] = new TestCase(SECTION, "Number(s)",parseInt(s), Number(s) ); + + array[item++] = new TestCase(SECTION, "Number(-s)",((-5.03820925841965e+263)+""), Number(-s)+"" ); + + array[item++] = new TestCase( SECTION, + "Number(-\"\")", + 0, + Number(-"" )); + + array[item++] = new TestCase( SECTION, + "Number(-\" \")", + 0, + Number(-" " )); + array[item++] = new TestCase( SECTION, + "Number(-\"999\")", + -999, + Number(-"999") ); + + array[item++] = new TestCase( SECTION, + "Number(-\" 999\")", + -999, + Number(-" 999") ); + + array[item++] = new TestCase( SECTION, + "Number(-\"\\t999\")", + -999, + Number(-"\t999") ); + + array[item++] = new TestCase( SECTION, + "Number(-\"013 \")", + -13, + Number(-"013 " )); + + array[item++] = new TestCase( SECTION, + "Number(-\"999\\t\")", + -999, + Number(-"999\t") ); + + array[item++] = new TestCase( SECTION, + "Number(-\"-Infinity\")", + Infinity, + Number(-"-Infinity" )); + + array[item++] = new TestCase( SECTION, + "Number(-\"-infinity\")", + NaN, + Number(-"-infinity")); + + + array[item++] = new TestCase( SECTION, + "Number(-\"+Infinity\")", + -Infinity, + Number(-"+Infinity") ); + + array[item++] = new TestCase( SECTION, + "Number(-\"+Infiniti\")", + NaN, + Number(-"+Infiniti")); + + array[item++] = new TestCase( SECTION, + "Number(- -\"0x80000000\")", + 2147483648, + Number(- -"0x80000000")); + + array[item++] = new TestCase( SECTION, + "Number(- -\"0x100000000\")", + 4294967296, + Number(- -"0x100000000") ); + + array[item++] = new TestCase( SECTION, + "Number(- \"-0x123456789abcde8\")", + 81985529216486880, + Number(- "-0x123456789abcde8")); + + + + return ( array ); +} + +function MyObject( value ) { + this.value = value; + this.valueOf = function() { return this.value; } +} diff --git a/mozilla/js/tamarin/test/ecma3/Number/e15_7_2.as b/mozilla/js/tamarin/test/ecma3/Number/e15_7_2.as new file mode 100644 index 00000000000..93bcc6dd5bf --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Number/e15_7_2.as @@ -0,0 +1,306 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.7.2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "The Number Constructor"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = new Array(); + + testcases = getTestCases(); + + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // To verify that the object's prototype is the Number.prototype, check to see if the // object's + // constructor property is the same as Number.prototype.constructor. + + array[item++] = new TestCase(SECTION, "(new Number()).constructor", Number.prototype.constructor, (new Number()).constructor ); + + array[item++] = new TestCase(SECTION, "typeof (new Number())", "number", typeof (new Number()) ); + array[item++] = new TestCase(SECTION, "(new Number()).valueOf()", 0, (new Number()).valueOf() ); + + + NUMB = new Number(); + + array[item++] = new TestCase(SECTION, + "NUMB = new Number();NUMB.toString=Object.prototype.toString;NUMB.toString()", + "0", + NUMB.toString() ); + + array[item++] = new TestCase(SECTION, "(new Number(0)).constructor", Number.prototype.constructor, (new Number(0)).constructor ); + array[item++] = new TestCase(SECTION, "typeof (new Number(0))", "number", typeof (new Number(0)) ); + array[item++] = new TestCase(SECTION, "(new Number(0)).valueOf()", 0, (new Number(0)).valueOf() ); + + NUMB = new Number(0); + + array[item++] = new TestCase(SECTION, + "NUMB = new Number(0);NUMB.toString=Object.prototype.toString;NUMB.toString()", + "0", + NUMB.toString() ); + + array[item++] = new TestCase(SECTION, "(new Number(1)).constructor", Number.prototype.constructor, (new Number(1)).constructor ); + array[item++] = new TestCase(SECTION, "typeof (new Number(1))", "number", typeof (new Number(1)) ); + array[item++] = new TestCase(SECTION, "(new Number(1)).valueOf()", 1, (new Number(1)).valueOf() ); + + NUMB = new Number(1); + + array[item++] = new TestCase(SECTION, + "NUMB = new Number(1);NUMB.toString=Object.prototype.toString;NUMB.toString()", + "1", + NUMB.toString() ); + + array[item++] = new TestCase(SECTION, "(new Number(-1)).constructor", Number.prototype.constructor, (new Number(-1)).constructor ); + array[item++] = new TestCase(SECTION, "typeof (new Number(-1))", "number", typeof (new Number(-1)) ); + array[item++] = new TestCase(SECTION, "(new Number(-1)).valueOf()", -1, (new Number(-1)).valueOf() ); + + NUMB = new Number(-1); + + array[item++] = new TestCase(SECTION, + "NUMB = new Number(-1);NUMB.toString=Object.prototype.toString;NUMB.toString()", + "-1", + NUMB.toString() ); + + array[item++] = new TestCase(SECTION, "(new Number(Number.NaN)).constructor", Number.prototype.constructor, (new Number(Number.NaN)).constructor ); + array[item++] = new TestCase(SECTION, "typeof (new Number(Number.NaN))", "number", typeof (new Number(Number.NaN)) ); + array[item++] = new TestCase(SECTION, "(new Number(Number.NaN)).valueOf()", Number.NaN, (new Number(Number.NaN)).valueOf() ); + + NUMB = new Number(Number.NaN); + + array[item++] = new TestCase(SECTION, + "NUMB = new Number(Number.NaN);NUMB.toString=Object.prototype.toString;NUMB.toString()", + "NaN", + NUMB.toString() ); + + array[item++] = new TestCase(SECTION, "(new Number('string')).constructor", Number.prototype.constructor, (new Number('string')).constructor ); + array[item++] = new TestCase(SECTION, "typeof (new Number('string'))", "number", typeof (new Number('string')) ); + array[item++] = new TestCase(SECTION, "(new Number('string')).valueOf()", Number.NaN, (new Number('string')).valueOf() ); + + NUMB = new Number('string'); + + array[item++] = new TestCase(SECTION, + "NUMB = new Number('string');NUMB.toString=Object.prototype.toString;NUMB.toString()", + "NaN", + NUMB.toString() ); + + array[item++] = new TestCase(SECTION, "(new Number(new String())).constructor", Number.prototype.constructor, (new Number(new String())).constructor ); + array[item++] = new TestCase(SECTION, "typeof (new Number(new String()))", "number", typeof (new Number(new String())) ); + array[item++] = new TestCase(SECTION, "(new Number(new String())).valueOf()", 0, (new Number(new String())).valueOf() ); + + NUMB = new Number(new String()); + + array[item++] = new TestCase(SECTION, + "NUMB = new Number(new String());NUMB.toString=Object.prototype.toString;NUMB.toString()", + "0", + NUMB.toString() ); + + array[item++] = new TestCase(SECTION, "(new Number('')).constructor", Number.prototype.constructor, (new Number('')).constructor ); + array[item++] = new TestCase(SECTION, "typeof (new Number(''))", "number", typeof (new Number('')) ); + array[item++] = new TestCase(SECTION, "(new Number('')).valueOf()", 0, (new Number('')).valueOf() ); + + NUMB = new Number(''); + + array[item++] = new TestCase(SECTION, + "NUMB = new Number('');NUMB.toString=Object.prototype.toString;NUMB.toString()", + "0", + NUMB.toString() ); + + array[item++] = new TestCase(SECTION, "(new Number(Number.POSITIVE_INFINITY)).constructor", Number.prototype.constructor, (new Number(Number.POSITIVE_INFINITY)).constructor ); + array[item++] = new TestCase(SECTION, "typeof (new Number(Number.POSITIVE_INFINITY))", "number", typeof (new Number(Number.POSITIVE_INFINITY)) ); + array[item++] = new TestCase(SECTION, "(new Number(Number.POSITIVE_INFINITY)).valueOf()", Number.POSITIVE_INFINITY, (new Number(Number.POSITIVE_INFINITY)).valueOf() ); + + NUMB = new Number(Number.POSITIVE_INFINITY); + + array[item++] = new TestCase(SECTION, + "NUMB = new Number(Number.POSITIVE_INFINITY);NUMB.toString=Object.prototype.toString;NUMB.toString()", + "Infinity", + NUMB.toString() ); + + array[item++] = new TestCase(SECTION, "(new Number(Number.NEGATIVE_INFINITY)).constructor", Number.prototype.constructor, (new Number(Number.NEGATIVE_INFINITY)).constructor ); + array[item++] = new TestCase(SECTION, "typeof (new Number(Number.NEGATIVE_INFINITY))", "number", typeof (new Number(Number.NEGATIVE_INFINITY)) ); + array[item++] = new TestCase(SECTION, "(new Number(Number.NEGATIVE_INFINITY)).valueOf()", Number.NEGATIVE_INFINITY, (new Number(Number.NEGATIVE_INFINITY)).valueOf() ); + + NUMB = new Number(Number.NEGATIVE_INFINITY); + + array[item++] = new TestCase(SECTION, + "NUMB = new Number(Number.NEGATIVE_INFINITY);NUMB.toString=Object.prototype.toString;NUMB.toString()", + "-Infinity", + NUMB.toString() ); + + + array[item++] = new TestCase(SECTION, "(new Number()).constructor", Number.prototype.constructor, (new Number()).constructor ); + array[item++] = new TestCase(SECTION, "typeof (new Number())", "number", typeof (new Number()) ); + array[item++] = new TestCase(SECTION, "(new Number()).valueOf()", 0, (new Number()).valueOf() ); + + NUMB = new Number(); + + array[item++] = new TestCase(SECTION, + "NUMB = new Number();NUMB.toString=Object.prototype.toString;NUMB.toString()", + "0", + NUMB.toString() ); + + array[item++] = new TestCase(SECTION, "new Number()", 0, new Number() ); + array[item++] = new TestCase(SECTION, "new Number(void 0)", Number.NaN, new Number(void 0) ); + array[item++] = new TestCase(SECTION, "new Number(null)", 0, new Number(null) ); + + array[item++] = new TestCase(SECTION, "new Number(new Number())", 0, Number( new Number() ) ); + array[item++] = new TestCase(SECTION, "new Number(0)", 0, new Number(0) ); + array[item++] = new TestCase(SECTION, "new Number(1)", 1, new Number(1) ); + array[item++] = new TestCase(SECTION, "new Number(-1)", -1, new Number(-1) ); + array[item++] = new TestCase(SECTION, "new Number(NaN)", Number.NaN, new Number( Number.NaN ) ); + array[item++] = new TestCase(SECTION, "new Number('string')", Number.NaN, new Number( "string") ); + array[item++] = new TestCase(SECTION, "new Number(new String())", 0, new Number( new String() ) ); + array[item++] = new TestCase(SECTION, "new Number('')", 0, new Number( "" ) ); + array[item++] = new TestCase(SECTION, "new Number(Infinity)", Number.POSITIVE_INFINITY, new Number("Infinity") ); + + array[item++] = new TestCase(SECTION, "new Number(-Infinity)", Number.NEGATIVE_INFINITY, new Number("-Infinity") ); + + array[item++] = new TestCase(SECTION, "new Number(3.141592653589793)", Math.PI, new Number("3.141592653589793") ); + + array[item++] = new TestCase(SECTION, "new Number(4294967297)", (Math.pow(2,32)+1), new Number("4294967297") ); + + array[item++] = new TestCase(SECTION, "new Number(1e2000)", Infinity, new Number(1e2000) ); + + array[item++] = new TestCase(SECTION, "new Number(-1e2000)", -Infinity, new Number(-1e2000) ); + + array[item++] = new TestCase(SECTION, "new Number(1e-2000)", 0, new Number(1e-2000) ); + + array[item++] = new TestCase(SECTION, "new Number(1/1e-2000)", Infinity, new Number(1/1e-2000) ); + + array[item++] = new TestCase(SECTION, "new Number(true)", 1, new Number(true) ); + + array[item++] = new TestCase(SECTION, "new Number(false)", 0, new Number(false) ); + + array[item++] = new TestCase(SECTION, "new Number(new Boolean(false)", 0, new Number(new Boolean(false)) ); + + array[item++] = new TestCase(SECTION, "new Number(new String('Number.POSITIVE_INFINITY')", Infinity, new Number(new String(Number.POSITIVE_INFINITY)) ); + + array[item++] = new TestCase(SECTION, "new Number(new Number(false)", 0, new Number(new Number(false)) ); + + + array[item++] = new TestCase(SECTION, "new Number('3000000000.25')", (3000000000.25), new Number("3000000000.25") ); + + array[item++] = new TestCase(SECTION, "new Number(-'3000000000.25')", (-3000000000.25), new Number(-"3000000000.25") ); + + array[item++] = new TestCase(SECTION, "new Number('1.79769313486231e+308')",(Number.MAX_VALUE+""),new Number("1.79769313486231e+308")+"" ); + array[item++] = new TestCase(SECTION, "new Number('4.9406564584124654e-324')",(Number.MIN_VALUE+""),new Number("4.9406564584124654e-324")+"" ); + array[item++] = new TestCase(SECTION, "new Number(new MyObject(100))", 100, new Number(new MyObject(100)) ); + + var s:String = +"0xFFFFFFFFFFFFF80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"; + + array[item++] = new TestCase(SECTION, "new Number(s)",parseInt(s),new Number(s) ); + + array[item++] = new TestCase(SECTION, "new Number(-s)",((-5.03820925841965e+263)+""), new Number(-s)+"" ); + + array[item++] = new TestCase( SECTION, + "new Number(-\"\")", + 0, + new Number(-"" )); + + array[item++] = new TestCase( SECTION, + "new Number(-\" \")", + 0, + new Number(-" " )); + array[item++] = new TestCase( SECTION, + "new Number(-\"999\")", + -999, + new Number(-"999") ); + + array[item++] = new TestCase( SECTION, + "new Number(-\" 999\")", + -999, + new Number(-" 999") ); + + array[item++] = new TestCase( SECTION, + "new Number(-\"\\t999\")", + -999, + new Number(-"\t999") ); + + array[item++] = new TestCase( SECTION, + "new Number(-\"013 \")", + -13, + new Number(-"013 " )); + + array[item++] = new TestCase( SECTION, + "new Number(-\"999\\t\")", + -999, + new Number(-"999\t") ); + + array[item++] = new TestCase( SECTION, + "new Number(-\"-Infinity\")", + Infinity, + new Number(-"-Infinity" )); + + array[item++] = new TestCase( SECTION, + "new Number(-\"-infinity\")", + NaN, + new Number(-"-infinity")); + + + array[item++] = new TestCase( SECTION, + "new Number(-\"+Infinity\")", + -Infinity, + new Number(-"+Infinity") ); + + array[item++] = new TestCase( SECTION, + "new Number(-\"+Infiniti\")", + NaN, + new Number(-"+Infiniti")); + + array[item++] = new TestCase( SECTION, + "new Number(- -\"0x80000000\")", + 2147483648, + new Number(- -"0x80000000")); + + array[item++] = new TestCase( SECTION, + "new Number(- -\"0x100000000\")", + 4294967296, + new Number(- -"0x100000000") ); + + array[item++] = new TestCase( SECTION, + "new Number(- \"-0x123456789abcde8\")", + 81985529216486880, + new Number(- "-0x123456789abcde8")); + + + return ( array ); +} +function MyObject( value ) { + this.value = value; + this.valueOf = function() { return this.value; } +} diff --git a/mozilla/js/tamarin/test/ecma3/Number/e15_7_3.as b/mozilla/js/tamarin/test/ecma3/Number/e15_7_3.as new file mode 100644 index 00000000000..f20392e4e2f --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Number/e15_7_3.as @@ -0,0 +1,49 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.7.3"; + var VERSION = "ECMA_2"; + startTest(); + var TITLE = "Properties of the Number Constructor"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase(SECTION, "Number.constructor.prototype", Class.prototype, Number.constructor.prototype); + array[item++] = new TestCase(SECTION, "Number.length", 1, Number.length ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_1_1.as b/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_1_1.as new file mode 100644 index 00000000000..da44ed085bd --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_1_1.as @@ -0,0 +1,55 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + +var SECTION = "15.7.3.1-1"; +var VERSION = "ECMA_1"; + startTest(); +var TITLE = "Number.prototype"; + +writeHeaderToLog( SECTION +" "+ TITLE); + +var testcases = getTestCases(); +test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + + var NUM_PROT = Number.prototype; + delete( Number.prototype ); + array[item++] = new TestCase(SECTION, "var NUM_PROT = Number.prototype; delete( Number.prototype ); NUM_PROT == Number.prototype", true, NUM_PROT == Number.prototype ); + array[item++] = new TestCase(SECTION, "delete( Number.prototype )", false, delete( Number.prototype ) ); + + return ( array ); +} + diff --git a/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_1_2.as b/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_1_2.as new file mode 100644 index 00000000000..9c83be643c7 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_1_2.as @@ -0,0 +1,76 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + var SECTION = "15.7.3.1-2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Number.prototype"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + var thisError:String="no error"; + var NUM_PROT = Number.prototype + try{ + Number.prototype = null; + }catch(e:ReferenceError){ + thisError=e.toString(); + }finally{ + array[item++]= new TestCase(SECTION,"Trying to verify the ReadOnly attribute of Number.prototype","ReferenceError: Error #1074",referenceError(thisError)); + } + + array[item++] = new TestCase( SECTION, + "var NUM_PROT = Number.prototype; Number.prototype = null; Number.prototype == NUM_PROT", + true, + (Number.prototype == NUM_PROT ) ); + + + try{ + Number.prototype=0; + }catch(e:ReferenceError){ + thisError=e.toString(); + }finally{ + array[item++]= new TestCase(SECTION,"Trying to verify the ReadOnly property of Number.prototype","ReferenceError: Error #1074",referenceError(thisError)); + } + array[item++] = new TestCase( SECTION, + "Number.prototype=0; Number.prototype", + Number.prototype, + Number.prototype ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_1_3.as b/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_1_3.as new file mode 100644 index 00000000000..f0d2211915a --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_1_3.as @@ -0,0 +1,60 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var VERSION = "ECMA_1"; + startTest(); + var SECTION = "15.7.3.1-3"; + var TITLE = "Number.prototype"; + + writeHeaderToLog( SECTION + " Number.prototype: DontEnum Attribute"); + + var testcases = getTestCases(); + + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + string = ''; + for ( prop in Number ) { + string += ( prop == 'prototype' ) ? prop : ''; + } + + array[item++] = new TestCase( + SECTION, + "var string = ''; for ( prop in Number ) { string += ( prop == 'prototype' ) ? prop: '' } string;", + "", + string + ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_2_1.as b/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_2_1.as new file mode 100644 index 00000000000..f4af73ce735 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_2_1.as @@ -0,0 +1,51 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.7.3.2-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Number.MAX_VALUE"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "Number.MAX_VALUE", 1.7976931348623157e308, Number.MAX_VALUE ); + + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_2_2.as b/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_2_2.as new file mode 100644 index 00000000000..2c201a6bcdb --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_2_2.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.7.3.2-2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Number.MAX_VALUE: DontDelete Attribute"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + + delete( Number.MAX_VALUE ); + array[item++] = new TestCase( SECTION, "delete( Number.MAX_VALUE ); Number.MAX_VALUE", 1.7976931348623157e308, Number.MAX_VALUE ); + array[item++] = new TestCase( SECTION, "delete( Number.MAX_VALUE )", false, delete(Number.MAX_VALUE) ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_2_3.as b/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_2_3.as new file mode 100644 index 00000000000..c602191a45a --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_2_3.as @@ -0,0 +1,60 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.7.3.2-3"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Number.MAX_VALUE"; + + writeHeaderToLog( SECTION + " "+ TITLE ); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var MAX_VAL = 1.7976931348623157e308; + var thisError = "no error"; + try{ + Number.MAX_VALUE=0; + }catch(e:ReferenceError){ + thisError=e.toString(); + }finally{ + array[item++]= new TestCase(SECTION,"Trying to verify the ReadOnly attribute of Number.MAX_VALUE","ReferenceError: Error #1074",referenceError(thisError)); + } + array[item++] = new TestCase( SECTION, + "Number.MAX_VALUE=0; Number.MAX_VALUE", + MAX_VAL, + Number.MAX_VALUE ); + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_2_4.as b/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_2_4.as new file mode 100644 index 00000000000..ed369c4348c --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_2_4.as @@ -0,0 +1,57 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.7.3.2-4"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Number.MAX_VALUE: DontEnum Attribute"; + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + string = ''; + for ( prop in Number ) { + string += ( prop == 'MAX_VALUE' ) ? prop : ''; + } + + array[item++] = new TestCase( + SECTION, + "var string = ''; for ( prop in Number ) { string += ( prop == 'MAX_VALUE' ) ? prop : '' } string;", + "", + string + ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_3_1.as b/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_3_1.as new file mode 100644 index 00000000000..d23385566d3 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_3_1.as @@ -0,0 +1,51 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + var SECTION = "15.7.3.3-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Number.MIN_VALUE"; + + writeHeaderToLog( SECTION + " "+ TITLE ); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var MIN_VAL = 5e-324; + + array[item++] = new TestCase( SECTION, "Number.MIN_VALUE", MIN_VAL, Number.MIN_VALUE ); + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_3_2.as b/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_3_2.as new file mode 100644 index 00000000000..21d98e38948 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_3_2.as @@ -0,0 +1,53 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + var SECTION = "15.7.3.3-2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Number.MIN_VALUE"; + + writeHeaderToLog( SECTION + " "+ TITLE ); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var MIN_VAL = 5e-324; + + array[item++] = new TestCase( SECTION, "delete( Number.MIN_VALUE )", false, delete( Number.MIN_VALUE) ); + delete( Number.MIN_VALUE ); + array[item++] = new TestCase( SECTION, "delete( Number.MIN_VALUE ); Number.MIN_VALUE", MIN_VAL, Number.MIN_VALUE ); + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_3_3.as b/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_3_3.as new file mode 100644 index 00000000000..838c2d57423 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_3_3.as @@ -0,0 +1,58 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.7.3.3-3"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Number.MIN_VALUE: ReadOnly Attribute"; + + writeHeaderToLog( SECTION + " "+TITLE ); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + var thisError:String="no error"; + try{ + Number.MIN_VALUE=0; + }catch(e:ReferenceError){ + thisError=e.toString(); + }finally{ + array[item++]=new TestCase(SECTION,"Trying to verify the ReadOnly attribute of Number.MIN_VALUE","ReferenceError: Error #1074",referenceError(thisError)); + } + array[item++] = new TestCase( + SECTION, + "Number.MIN_VALUE=0; Number.MIN_VALUE", + Number.MIN_VALUE, + Number.MIN_VALUE ); + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_3_4.as b/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_3_4.as new file mode 100644 index 00000000000..422fdb9d88d --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_3_4.as @@ -0,0 +1,59 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + var SECTION = "15.7.3.3-4"; + var VERSION = "ECMA_1"; + startTest(); + + writeHeaderToLog( SECTION + " Number.MIN_VALUE: DontEnum Attribute"); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + string = ''; + for ( prop in Number ) { + string += ( prop == 'MIN_VALUE' ) ? prop : ''; + } + + array[item++] = new TestCase( + SECTION, + "var string = ''; for ( prop in Number ) { string += ( prop == 'MIN_VALUE' ) ? prop : '' } string;", + "", + string + ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_4_1.as b/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_4_1.as new file mode 100644 index 00000000000..23004f21f05 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_4_1.as @@ -0,0 +1,48 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + var SECTION = "15.7.3.4-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Number.NaN"; + + writeHeaderToLog( SECTION + " "+ TITLE ); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase(SECTION, "NaN", NaN, Number.NaN ); + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_4_2.as b/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_4_2.as new file mode 100644 index 00000000000..88243224fba --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_4_2.as @@ -0,0 +1,53 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + var SECTION = "15.7.3.4-2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Number.NaN"; + + writeHeaderToLog( SECTION + " "+ TITLE ); + + var testcases = getTestCases(); + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + + delete( Number.NaN ); + array[item++] = new TestCase(SECTION, "delete( Number.NaN ); Number.NaN", NaN, Number.NaN ); + array[item++] = new TestCase( SECTION, "delete( Number.NaN )", false, delete( Number.NaN ) ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_4_3.as b/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_4_3.as new file mode 100644 index 00000000000..f29d8403852 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_4_3.as @@ -0,0 +1,61 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.7.3.4-3"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Number.NaN"; + + writeHeaderToLog( SECTION + " "+ TITLE ); + + var testcases = getTestCases(); + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + var thisError = "no error"; + try{ + Number.NaN=0; + }catch(e:ReferenceError){ + thisError=e.toString(); + }finally{ + array[item++]=new TestCase(SECTION,"Trying to verify the ReadOnly attribute of Number.NaN","ReferenceError: Error #1074",referenceError(thisError)); + } + array[item++] = new TestCase( + SECTION, + "Number.NaN=0; Number.NaN", + Number.NaN, + Number.NaN ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_4_4.as b/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_4_4.as new file mode 100644 index 00000000000..39749256a08 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_4_4.as @@ -0,0 +1,59 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.7.3.4-4"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Number.NaN"; + + writeHeaderToLog( SECTION + " " + TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + string = ''; + for ( prop in Number ) { + string += ( prop == 'NaN' ) ? prop : ''; + } + + array[item++] = new TestCase( + SECTION, + "var string = ''; for ( prop in Number ) { string += ( prop == 'NaN' ) ? prop : '' } string;", + "", + string + ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_5_1.as b/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_5_1.as new file mode 100644 index 00000000000..e10e7680b41 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_5_1.as @@ -0,0 +1,47 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.7.3.5-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Number.NEGATIVE_INFINITY"; + + writeHeaderToLog( SECTION + " "+TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase(SECTION, "Number.NEGATIVE_INFINITY", -Infinity, Number.NEGATIVE_INFINITY ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_5_2.as b/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_5_2.as new file mode 100644 index 00000000000..88e042460ea --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_5_2.as @@ -0,0 +1,59 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.7.3.5-2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Number.NEGATIVE_INFINITY"; + + writeHeaderToLog( SECTION + " "+TITLE); + + var testcases = getTestCases(); + test(); + + + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, + "delete( Number.NEGATIVE_INFINITY )", + false, + delete( Number.NEGATIVE_INFINITY ) ); + + delete( Number.NEGATIVE_INFINITY ); + array[item++] = new TestCase( SECTION, + "delete( Number.NEGATIVE_INFINITY ); Number.NEGATIVE_INFINITY", + -Infinity, + Number.NEGATIVE_INFINITY ); + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_5_3_rt.as b/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_5_3_rt.as new file mode 100644 index 00000000000..ad81008ca63 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_5_3_rt.as @@ -0,0 +1,60 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.7.3.5-3"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Number.NEGATIVE_INFINITY"; + + writeHeaderToLog( SECTION + " "+TITLE); + + var testcases = getTestCases(); + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + var thisError:String="no error"; + try{ + Number.NEGATIVE_INFINITY=0; + }catch(e:ReferenceError){ + thisError=e.toString(); + }finally{ + array[item++]=new TestCase(SECTION,"Trying to verify the ReadOnly attribute of Number.NEGATIVE_INFINITY","ReferenceError: Error #1074",referenceError(thisError)); + } + array[item++] = new TestCase( + SECTION, + "Number.NEGATIVE_INFINITY=0; Number.NEGATIVE_INFINITY", + -Infinity, + Number.NEGATIVE_INFINITY ); + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_5_4.as b/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_5_4.as new file mode 100644 index 00000000000..68d242a6ae9 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_5_4.as @@ -0,0 +1,56 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.7.3.5-4"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Number.NEGATIVE_INFINITY"; + + writeHeaderToLog( SECTION + " "+TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + string = ''; + for ( prop in Number ) { string += ( prop == 'NEGATIVE_INFINITY' ) ? prop : ''; } + + array[item++] = new TestCase( + SECTION, + "var string = ''; for ( prop in Number ) { string += ( prop == 'NEGATIVE_INFINITY' ) ? prop : '' } string;", + "", + string + ); + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_6_1.as b/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_6_1.as new file mode 100644 index 00000000000..7664824837a --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_6_1.as @@ -0,0 +1,46 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.7.3.6-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Number.POSITIVE_INFINITY"; + + writeHeaderToLog( SECTION + " "+TITLE); + + var testcases = getTestCases(); + test(); +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY", Infinity, Number.POSITIVE_INFINITY ); + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_6_2.as b/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_6_2.as new file mode 100644 index 00000000000..cd0e4c66585 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_6_2.as @@ -0,0 +1,50 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.7.3.6-2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Number.POSITIVE_INFINITY"; + + writeHeaderToLog( SECTION + " "+TITLE); + + var testcases = getTestCases(); + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase(SECTION, "delete( Number.POSITIVE_INFINITY )", false, delete( Number.POSITIVE_INFINITY ) ); + delete( Number.POSITIVE_INFINITY ); + array[item++] = new TestCase(SECTION, "delete( Number.POSITIVE_INFINITY ); Number.POSITIVE_INFINITY", Infinity, Number.POSITIVE_INFINITY ); + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_6_3_rt.as b/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_6_3_rt.as new file mode 100644 index 00000000000..6c2d9c4c2ae --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_6_3_rt.as @@ -0,0 +1,65 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + Modified 1/5/2005 by Sushant Dutta (sdutta@macromedia.com) + + Changed the expected result from Number.POSITIVE_INFINITY to Infinity +*/ + + var SECTION = "15.7.3.6-3"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Number.POSITIVE_INFINITY"; + + writeHeaderToLog( SECTION + " "+TITLE); + + var testcases = getTestCases(); + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + var thisError:String = "no error" + try{ + Number.POSITIVE_INFINITY=0; + }catch(e:ReferenceError){ + thisError=e.toString(); + }finally{ + array[item++]=new TestCase(SECTION,"Verifying the ReadOnly attribute of Number.POSITIVE_INFINITY","ReferenceError: Error #1074",referenceError(thisError)); + } + array[item++] = new TestCase( + SECTION, + "Number.POSITIVE_INFINITY=0; Number.POSITIVE_INFINITY", + Infinity, + Number.POSITIVE_INFINITY ); + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_6_4.as b/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_6_4.as new file mode 100644 index 00000000000..1d9f7713916 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Number/e15_7_3_6_4.as @@ -0,0 +1,56 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.7.3.6-4"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Number.POSITIVE_INFINITY"; + + writeHeaderToLog( SECTION + " "+TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + string = ''; + for ( prop in Number ) { string += ( prop == 'POSITIVE_INFINITY' ) ? prop : ''; } + + array[item++] = new TestCase( + SECTION, + "var string = ''; for ( prop in Number ) { string += ( prop == 'POSITIVE_INFINITY' ) ? prop : '' } string;", + "", + string + ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Number/e15_7_4_1.as b/mozilla/js/tamarin/test/ecma3/Number/e15_7_4_1.as new file mode 100644 index 00000000000..568fc1cfe1c --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Number/e15_7_4_1.as @@ -0,0 +1,50 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.7.4.1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Number.prototype.constructor"; + + writeHeaderToLog( SECTION + " "+TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, + "Number.prototype.constructor", + Number, + Number.prototype.constructor ); + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Number/e15_7_4_2_1_rt.as b/mozilla/js/tamarin/test/ecma3/Number/e15_7_4_2_1_rt.as new file mode 100644 index 00000000000..27e1963d482 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Number/e15_7_4_2_1_rt.as @@ -0,0 +1,115 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.7.4.2-1"; + var VERSION = "ECMA_1"; + startTest(); + var testcases = getTestCases(); + + writeHeaderToLog( SECTION + " Number.prototype.toString()"); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var thisError="no error thrown"; + try{ + thisError = Number.prototype.toString(); + } + catch(e) + { + thisError=e.toString(); + }finally{ + array[item++] = new TestCase(SECTION, "Number.prototype.toString()", + "0", + thisError); + } + + array[item++] = new TestCase(SECTION, "typeof(Number.prototype.toString())", "string", typeof(Number.prototype.toString()) ); + + + thisError="no error thrown"; + try{ + s = Number.prototype.toString; + o = new Number(); + o.toString = s; + } + catch(e1) + { + thisError=e1.toString(); + }finally{ + array[item++] = new TestCase(SECTION, "s = Number.prototype.toString", + "ReferenceError: Error #1056", + referenceError(thisError)); + } + + thisError="no error thrown"; + try{ + s = Number.prototype.toString; + o = new Number(1); + o.toString = s; + } + catch(e2){ + thisError=e2.toString(); + }finally{ + array[item++] = new TestCase(SECTION, "s = Number.prototype.toString", + "ReferenceError: Error #1056", + referenceError(thisError)); + } + + thisError="no error thrown"; + try{ + s = Number.prototype.toString; + o = new Number(-1); + o.toString = s; + } + catch(e3){ + thisError=e3.toString(); + }finally{ + array[item++] = new TestCase(SECTION, "s = Number.prototype.toString", + "ReferenceError: Error #1056", + referenceError(thisError)); + } + + var MYNUM = new Number(255); + array[item++] = new TestCase(SECTION, "var MYNUM = new Number(255); MYNUM.toString(10)", "255", MYNUM.toString(10) ); + + var MYNUM = new Number(Number.NaN); + array[item++] = new TestCase(SECTION, "var MYNUM = new Number(Number.NaN); MYNUM.toString(10)", "NaN", MYNUM.toString(10) ); + + var MYNUM = new Number(Infinity); + array[item++] = new TestCase(SECTION, "var MYNUM = new Number(Infinity); MYNUM.toString(10)", "Infinity", MYNUM.toString(10) ); + + var MYNUM = new Number(-Infinity); + array[item++] = new TestCase(SECTION, "var MYNUM = new Number(-Infinity); MYNUM.toString(10)", "-Infinity", MYNUM.toString(10) ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Number/e15_7_4_2_2_rt.as b/mozilla/js/tamarin/test/ecma3/Number/e15_7_4_2_2_rt.as new file mode 100644 index 00000000000..4da1d0eaf24 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Number/e15_7_4_2_2_rt.as @@ -0,0 +1,59 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.7.4.2-2-n"; + var VERSION = "ECMA_1"; + startTest(); + var testcases = getTestCases(); + + writeHeaderToLog( SECTION + " Number.prototype.toString()"); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + o = new Object(); + o.toString = Number.prototype.toString; + + thisError="no error"; + try{ + o.toString(); + }catch(e:Error){ + thisError=(e.toString()).substring(0,18); + }finally{trace(thisError); + array[item++] = new TestCase(SECTION, "o = new Object(); o.toString = Number.prototype.toString; o.toString()", "TypeError: Error #",thisError ); + } + /*array[item++] = new TestCase(SECTION, "o = new Object(); o.toString = Number.prototype.toString; o.toString()", "NaN", o.toString(10) );*/ + //array[item++] = new TestCase(SECTION, "o = new String(); o.toString = Number.prototype.toString; o.toString()", "error", "o = new String(); o.toString = Number.prototype.toString; o.toString()" ); + //array[item++] = new TestCase(SECTION, "o = 3; o.toString = Number.prototype.toString; o.toString()", "error", "o = 3; o.toString = Number.prototype.toString; o.toString()" ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Number/e15_7_4_2_3_rt.as b/mozilla/js/tamarin/test/ecma3/Number/e15_7_4_2_3_rt.as new file mode 100644 index 00000000000..dfbcb8629c9 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Number/e15_7_4_2_3_rt.as @@ -0,0 +1,61 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.7.4.2-3-n"; + var VERSION = "ECMA_1"; + startTest(); + var testcases = getTestCases(); + + writeHeaderToLog( SECTION + " Number.prototype.toString()"); + test(); + +function getTestCases() { + var array:Array = new Array(); + var item:Number= 0; + var thisError:String = "no error thrown"; + var o:String = new String(); + try{ + + o.toString = Number.prototype.toString; + o.toString(); + }catch(e:ReferenceError){ + thisError=e.toString(); + }finally{ + array[item++] = new TestCase(SECTION, "o = new String(); o.toString = Number.prototype.toString; o.toString()", "ReferenceError: Error #1056",referenceError(thisError)); + + } + + //o = new String(); + //o.toString = Number.prototype.toString; + + //array[item++] = new TestCase(SECTION, "o = new String(); o.toString = //Number.prototype.toString; o.toString()", "error", o.toString() ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Number/e15_7_4_2_4.as b/mozilla/js/tamarin/test/ecma3/Number/e15_7_4_2_4.as new file mode 100644 index 00000000000..90d18c5ef4d --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Number/e15_7_4_2_4.as @@ -0,0 +1,225 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.7.4.2-4"; + var VERSION = "ECMA_4"; + startTest(); + var testcases = getTestCases(); + + writeHeaderToLog( SECTION + " Number.prototype.toString()"); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + + var o = 3; + array[item++] = new TestCase(SECTION,"o = 3;o.toString()", + "3", + o.toString() ); + + var o = new Number(3); + array[item++] = new TestCase(SECTION, "o = new Number(3);o.toString()", + "3", + o.toString() ); + + var o = new Number(); + array[item++] = new TestCase(SECTION,"o = new Number();o.toString()", + "0", + o.toString() ); + + + var o = new Number(3); + array[item++] = new TestCase(SECTION,"o = new Number(3);o.toString()", + "3", + o.toString(10) ); + + o = new Number(3); + array[item++] = new TestCase(SECTION,"o = new Number(3);o.toString()", + "11", + o.toString(2) ); + + o = new Number(3); + array[item++] = new TestCase(SECTION,"o = new Number(3);o.toString()", + "3", + o.toString(8) ); + + o = new Number(11); + array[item++] = new TestCase(SECTION,"o = new Number(11);o.toString()", + "13", + o.toString(8) ); + + o= new Number(3); + array[item++] = new TestCase(SECTION,"o = new Number(3);o.toString()", + "3", + o.toString(16) ); + + o= new Number(17); + array[item++] = new TestCase(SECTION,"o = new Number(17);o.toString()", + "11", + o.toString(16) ); + + o=new Number(true); + + array[item++] = new TestCase( SECTION, "o=new Number(true)", "1",o.toString() ); + + o=new Number(false); + array[item++] = new TestCase( SECTION, "o=new Number(false)", "0", o.toString() ); + o=new Number(new Array()); + array[item++] = new TestCase( SECTION, "o=new Number(new Array())", "0", o.toString() ); + o=Number.NaN; + array[item++] = new TestCase( SECTION, "o=Number.NaN;o.toString()", "NaN", o.toString() ); + o=new Number(0) + array[item++] = new TestCase( SECTION, "o=0;o.toString()", "0", o.toString()); + o=new Number(-0); + array[item++] = new TestCase( SECTION, "o=-0;o.toString()", "0", o.toString() ); + + o=new Number(Number.POSITIVE_INFINITY); + array[item++] = new TestCase( SECTION, "o=new Number(Number.POSITIVE_INFINITY)", "Infinity", o.toString() ); + o=new Number(Number.NEGATIVE_INFINITY); + array[item++] = new TestCase( SECTION, "o=new Number(Number.NEGATIVE_INFINITY);o.toString()", "-Infinity", o.toString() ); + + o=new Number(-1); + array[item++] = new TestCase( SECTION, "o=new Number(-1);o.toString()", "-1", o.toString() ); + + // cases in step 6: integers 1e21 > x >= 1 or -1 >= x > -1e21 + + o=new Number(1); + array[item++] = new TestCase( SECTION, "o=new Number(1);o.toString()", "1", o.toString() ); + o=new Number(10); + array[item++] = new TestCase( SECTION, "o=new Number(10);o.toString()", "10", o.toString() ); + o=new Number(100); + array[item++] = new TestCase( SECTION, "o=new Number(100);o.toString()", "100", o.toString() ); + o=new Number(1000); + array[item++] = new TestCase( SECTION, "o=new Number(1000);o.toString()", "1000", o.toString() ); + o=new Number(10000); + array[item++] = new TestCase( SECTION, "o=new Number(10000);o.toString()", "10000", o.toString() ); + o=new Number(10000000000); + array[item++] = new TestCase( SECTION, "o=new Number(10000000000);o.toString()", "10000000000",o.toString() ); + o=new Number(10000000000000000000); + array[item++] = new TestCase( SECTION, "o=new Number(10000000000000000000);o.toString()", "10000000000000000000",o.toString() ); + o=new Number(100000000000000000000); + array[item++] = new TestCase( SECTION, "o=new Number(100000000000000000000);o.toString()", "100000000000000000000",o.toString() ); + o=new Number(12345 ); + array[item++] = new TestCase( SECTION, "o=new Number(12345 );o.toString()", "12345",o.toString() ); + o=new Number(1234567890 ); + array[item++] = new TestCase( SECTION, "o=new Number(1234567890);o.toString()", "1234567890",o.toString() ); + o=new Number(-1); + array[item++] = new TestCase( SECTION, "o=new Number(-1);o.toString()", "-1",o.toString() ); + o=new Number(-10 ); + array[item++] = new TestCase( SECTION, "o=new Number(-10 );o.toString()", "-10",o.toString() ); + + o=new Number(-100 ); + array[item++] = new TestCase( SECTION, "o=new Number(-100 );o.toString()", "-100",o.toString() ); + o=new Number(-1000 ); + array[item++] = new TestCase( SECTION, "o=new Number(-1000 );o.toString()", "-1000",o.toString() ); + o=new Number(-1000000000 ); + array[item++] = new TestCase( SECTION, "o=new Number(-1000000000 );o.toString()", "-1000000000",o.toString() ); + o=new Number(-1000000000000000); + array[item++] = new TestCase( SECTION, "o=new Number(-1000000000000000);o.toString()", "-1000000000000000",o.toString() ); + o=new Number(-100000000000000000000); + array[item++] = new TestCase( SECTION, "o=new Number(-100000000000000000000);o.toString()", "-100000000000000000000",o.toString() ); + + o=new Number(-1000000000000000000000); + array[item++] = new TestCase( SECTION, "o=new Number(-1000000000000000000000);o.toString()", "-1e+21",o.toString() ); + + o=new Number(1.0000001 ); + array[item++] = new TestCase( SECTION, "o=new Number(1.0000001);o.toString()", "1.0000001",o.toString() ); + o=new Number(1000000000000000000000); + array[item++] = new TestCase( SECTION, "o=new Number(1000000000000000000000);o.toString()", "1e+21",o.toString() ); + + o=new Number(1.2345); + array[item++] = new TestCase( SECTION, "o=new Number(1.2345);o.toString()", "1.2345",o.toString() ); + + o=new Number(1.234567890); + array[item++] = new TestCase( SECTION, "o=new Number(1.234567890);o.toString()", "1.23456789",o.toString() ); + + o=new Number(.12345); + array[item++] = new TestCase( SECTION, "o=new Number(.12345);o.toString()", "0.12345",o.toString() ); + + o=new Number(.012345); + array[item++] = new TestCase( SECTION, "o=new Number(.012345);o.toString()", "0.012345",o.toString() ); + + o=new Number(.0012345); + array[item++] = new TestCase( SECTION, "o=new Number(.0012345);o.toString()", "0.0012345",o.toString() ); + o=new Number(.00012345); + array[item++] = new TestCase( SECTION, "o=new Number(.00012345);o.toString()", "0.00012345",o.toString() ); + o=new Number(.000012345); + array[item++] = new TestCase( SECTION, "o=new Number(.000012345);o.toString()", "0.000012345",o.toString() ); + o=new Number(.0000012345); + array[item++] = new TestCase( SECTION, "o=new Number(.0000012345);o.toString()", "0.0000012345",o.toString() ); + o=new Number(.00000012345); + array[item++] = new TestCase( SECTION, "o=new Number(.00000012345);o.toString()", "1.2345e-7",o.toString() ); + o=new Number(); + array[item++] = new TestCase( SECTION, "o=new Number();o.toString()", "0",o.toString() ); + + var date = new Date(0); + var thisError="no error"; + try{ + date.myToString=Number.prototype.toString + date.myToString(); + }catch(e:TypeError){ + thisError = e.toString() + } + + array[item++] = new TestCase(SECTION, + "date.myToString=Number.prototype.toString;date.myToString()", + "TypeError: Error #1004", + typeError(thisError) ); + + var o = new Number(3); + + try{ + o.toString(1); + }catch(e:RangeError){ + thisError=e.toString(); + } + + array[item++] = new TestCase(SECTION, + "var o=new Number(3);o.toString(1)","RangeError: Error #1003", + rangeError(thisError) ); + + var o = new Number(3); + + try{ + o.toString(37); + }catch(e:RangeError){ + thisError=e.toString(); + } + + array[item++] = new TestCase(SECTION, + "var o=new Number(3);o.toString(37)","RangeError: Error #1003", + rangeError(thisError) ); + + + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Number/e15_7_4_3_1_rt.as b/mozilla/js/tamarin/test/ecma3/Number/e15_7_4_3_1_rt.as new file mode 100644 index 00000000000..1ebbdcd5065 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Number/e15_7_4_3_1_rt.as @@ -0,0 +1,55 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.7.4.3-1"; + var VERSION = "ECMA_1"; + startTest(); + var testcases = getTestCases(); + + writeHeaderToLog( SECTION + " Number.prototype.valueOf()"); + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + +// the following two line causes navigator to crash -- cmb 9/16/97 + array[item++] = new TestCase("15.7.4.1", "Number.prototype.valueOf()", 0, Number.prototype.valueOf() ); + + array[item++] = new TestCase("15.7.4.1", "(new Number(1)).valueOf()", 1, (new Number(1)).valueOf() ); + array[item++] = new TestCase("15.7.4.1", "(new Number(-1)).valueOf()", -1, (new Number(-1)).valueOf() ); + array[item++] = new TestCase("15.7.4.1", "(new Number(0)).valueOf()", 0, (new Number(0)).valueOf() ); + array[item++] = new TestCase("15.7.4.1", "(new Number(Number.POSITIVE_INFINITY)).valueOf()", Number.POSITIVE_INFINITY, (new Number(Number.POSITIVE_INFINITY)).valueOf() ); + array[item++] = new TestCase("15.7.4.1", "(new Number(Number.NaN)).valueOf()", Number.NaN, (new Number(Number.NaN)).valueOf() ); + array[item++] = new TestCase("15.7.4.1", "(new Number()).valueOf()", 0, (new Number()).valueOf() ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Number/e15_7_4_3_2.as b/mozilla/js/tamarin/test/ecma3/Number/e15_7_4_3_2.as new file mode 100644 index 00000000000..b793470b87d --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Number/e15_7_4_3_2.as @@ -0,0 +1,64 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.7.4.3-2"; + var VERSION = "ECMA_4"; + startTest(); + var testcases = getTestCases(); + + writeHeaderToLog( SECTION + " Number.prototype.valueOf()"); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + v = Number.prototype.valueOf; + Number.prototype.valueOf=v; + num = 3; + array[item++] = new TestCase(SECTION, + "v = Number.prototype.valueOf; Number.prototype.valueof=v;num = 3;num.valueOf()", + 3, + num.valueOf() ); + + num = new Number(3); + array[item++] = new TestCase(SECTION, + "v = Number.prototype.valueOf; Number.prototype.valueof=v;num = 3;num.valueOf()", + 3, + num.valueOf() ); + + num = new Number(); + array[item++] = new TestCase(SECTION, + "v = Number.prototype.valueOf; Number.prototype.valueof=v;num = 3;num.valueOf()", + 0, + num.valueOf() ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Number/e15_7_4_3_3_rt.as b/mozilla/js/tamarin/test/ecma3/Number/e15_7_4_3_3_rt.as new file mode 100644 index 00000000000..c6b8dc616da --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Number/e15_7_4_3_3_rt.as @@ -0,0 +1,65 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.7.4.3-3-n"; + var VERSION = "ECMA_1"; + startTest(); + var testcases = getTestCases(); + + writeHeaderToLog( SECTION + " Number.prototype.valueOf()"); + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + +// array[item++] = new TestCase("15.7.4.1", "v = Number.prototype.valueOf; num = 3; num.valueOf = v; num.valueOf()", "error", "v = Number.prototype.valueOf; num = 3; num.valueOf = v; num.valueOf()" ); +/* + v = Number.prototype.valueOf; + o = new String('Infinity'); + o.valueOf = v; + array[item++] = new TestCase("15.7.4.1", "v = Number.prototype.valueOf; o = new String('Infinity'); o.valueOf = v; o.valueOf()", "error", o.valueOf() );*/ +// array[item++] = new TestCase("15.7.4.1", "v = Number.prototype.valueOf; o = new Object(); o.valueOf = v; o.valueOf()", "error", "v = Number.prototype.valueOf; o = new Object(); o.valueOf = v; o.valueOf()" ); + var v = Number.prototype.valueOf; + var o = new String('Infinity'); + try{ + o.valueOf = v; + o.valueOf(); + }catch(e:ReferenceError){ + thisError=e.toString(); + }finally{ + array[item++] = new TestCase("15.7.4.1", "v = Number.prototype.valueOf; o = new String('Infinity'); o.valueOf = v; o.valueOf()", "ReferenceError: Error #1056", referenceError(thisError) ); + } + + + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Number/e15_7_4_6_1.as b/mozilla/js/tamarin/test/ecma3/Number/e15_7_4_6_1.as new file mode 100644 index 00000000000..47d0a80cccd --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Number/e15_7_4_6_1.as @@ -0,0 +1,208 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* +* The contents of this file are subject to the Netscape Public +* License Version 1.1 (the "License"); you may not use this file +* except in compliance with the License. You may obtain a copy of +* the License at http://www.mozilla.org/NPL/ +* +* Software distributed under the License is distributed on an +* "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either expressed +* or implied. See the License for the specific language governing +* rights and limitations under the License. +* +* The Original Code is mozilla.org code. +* +* The Initial Developer of the Original Code is Netscape +* Communications Corporation. Portions created by Netscape are +* Copyright (C) 1998 Netscape Communications Corporation. +* All Rights Reserved. +* +* Contributor(s): pschwartau@netscape.com +* Date: 2001-07-15 +* +* SUMMARY: Testing Number.prototype.toExponential(fractionDigits) +* See EMCA 262 Edition 3 Section 15.7.4.6 +* +*/ +//----------------------------------------------------------------------------- + var SECTION = "15.7.4.6-1"; + var VERSION = ""; + var TITLE = "Testing Number.prototype.toExponential(fractionDigits)"; + var bug = '(none)'; + startTest(); + var testcases = getTestCases(); + + writeHeaderToLog( SECTION + " " + TITLE); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var UBound = 0; + + var cnIsRangeError = 'instanceof RangeError'; + var cnNotRangeError = 'NOT instanceof RangeError'; + var cnNoErrorCaught = 'NO ERROR CAUGHT...'; + var status = ''; + var statusitems = []; + var actual = ''; + var actualvalues = []; + var expect= ''; + var expectedvalues = []; + var testNum = 77.1234; + var testNum2=NaN; + var testNum3=0; + var testNum4=Number.POSITIVE_INFINITY; + var testNum5=315003; + + + status = 'Section A of test: no error intended!'; + actual = testNum.toExponential(4); + expect = '7.7123e+1'; + //captureThis(); + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = 'Section B of test: no error intended!'; + actual = Number.prototype.toExponential.length + expect = 1 + //captureThis(); + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = 'Section C of test: no error intended!'; + actual = testNum.toExponential(); + expect = '7.71234e+1'; + //captureThis(); + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = 'Section D of test: no error intended!'; + actual = testNum.toExponential(5); + expect = '7.71234e+1'; + //captureThis(); + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = 'Section E of test: no error intended!'; + actual = testNum2.toExponential(5); + expect = 'NaN'; + //captureThis(); + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = 'Section F of test: no error intended!'; + actual = testNum3.toExponential(5); + expect = '0.00000e-16'; + //captureThis(); + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = 'Section G of test: no error intended!'; + actual = testNum4.toExponential(4); + expect = 'Infinity'; + //captureThis(); + array[item++] = new TestCase(SECTION, status, expect, actual); + + var thisError:String="no error"; + try{ + testNum.toExponential(-1); + }catch(e:RangeError){ + thisError=e.toString() + } + + status = 'Section H of test: error intended!'; + actual = rangeError(thisError); + expect = "RangeError: Error #1002"; + //captureThis(); + array[item++] = new TestCase(SECTION, status, expect, actual); + + var thisError:String="no error"; + try{ + testNum.toExponential(21); + }catch(e:RangeError){ + thisError=e.toString() + } + + status = 'Section I of test: error intended!'; + actual = rangeError(thisError); + expect = "RangeError: Error #1002"; + //captureThis(); + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = 'Section J of test: no error intended!'; + actual = testNum5.toExponential(2); + expect = '3.15e+5'; + //captureThis(); + array[item++] = new TestCase(SECTION, status, expect, actual); + + +/////////////////////////// OOPS.... /////////////////////////////// + + return array; +} + +/* +function captureThis() +{ + statusitems[UBound] = status; + actualvalues[UBound] = actual; + expectedvalues[UBound] = expect; + UBound++; +} +*/ + +/* +function test() +{ + enterFunc ('test'); + printBugNumber (bug); + printStatus (summary); + + for (var i = 0; i < UBound; i++) + { + reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]); + } + + exitFunc ('test'); +} +*/ + +function catchError(sEval) +{ + try {eval(sEval);} + catch(e) {return isRangeError(e);} + return cnNoErrorCaught; +} + + +function isRangeError(obj) +{ + if (obj instanceof RangeError) + return cnIsRangeError; + return cnNotRangeError; +} diff --git a/mozilla/js/tamarin/test/ecma3/Number/e15_7_4_7_1.as b/mozilla/js/tamarin/test/ecma3/Number/e15_7_4_7_1.as new file mode 100644 index 00000000000..52de7601513 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Number/e15_7_4_7_1.as @@ -0,0 +1,225 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* +* The contents of this file are subject to the Netscape Public +* License Version 1.1 (the "License"); you may not use this file +* except in compliance with the License. You may obtain a copy of +* the License at http://www.mozilla.org/NPL/ +* +* Software distributed under the License is distributed on an +* "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either expressed +* or implied. See the License for the specific language governing +* rights and limitations under the License. +* +* The Original Code is mozilla.org code. +* +* The Initial Developer of the Original Code is Netscape +* Communications Corporation. Portions created by Netscape are +* Copyright (C) 1998 Netscape Communications Corporation. +* All Rights Reserved. +* +* Contributor(s): pschwartau@netscape.com +* Date: 2001-07-15 +* +* SUMMARY: Testing Number.prototype.toPrecision(precision) +* See EMCA 262 Edition 3 Section 15.7.4.7 +* +*/ +//----------------------------------------------------------------------------- + var SECTION = "15.7.4.6-1"; + var VERSION = ""; + var TITLE = "Testing Number.prototype.toPrecision(precision)"; + var bug = '(none)'; + startTest(); + var testcases = getTestCases(); + + writeHeaderToLog( SECTION + " " + TITLE); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var UBound = 0; + var cnIsRangeError = 'instanceof RangeError'; + var cnNotRangeError = 'NOT instanceof RangeError'; + var cnNoErrorCaught = 'NO ERROR CAUGHT...'; + var status = ''; + var statusitems = []; + var actual = ''; + var actualvalues = []; + var expect= ''; + var expectedvalues = []; + var testNum:Number = 5.123456; + var testNum2 = NaN + var testNum3 = Number.POSITIVE_INFINITY + var testNum4 = 0; + var testNum5 = 4000; + + + status = 'Section A of test: no error intended!'; + actual = testNum.toPrecision(4); + expect = '5.123'; + //captureThis(); + array[item++] = new TestCase(SECTION, status, expect, actual); + + + status = 'Section B of test: no error intended!'; + actual = testNum.toPrecision(undefined); + expect = testNum.toString(); + //captureThis(); + array[item++] = new TestCase(SECTION, status, expect, actual); + + + + + status = 'Section C of test: no error intended!'; + actual = Number.prototype.toPrecision.length + expect = 1 + //captureThis(); + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = 'Section D of test: no error intended!'; + actual = testNum2.toPrecision(6); + expect = "NaN" + //captureThis(); + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = 'Section E of test: no error intended!'; + actual = testNum3.toPrecision(6); + expect = "Infinity" + //captureThis(); + array[item++] = new TestCase(SECTION, status, expect, actual); + + var thisError:String="no error"; + try{ + testNum.toPrecision(0) + }catch(e:RangeError){ + thisError=e.toString(); + } + + status = 'Section F of test: error intended!'; + actual = rangeError(thisError); + expect = "RangeError: Error #1002" + //captureThis(); + array[item++] = new TestCase(SECTION, status, expect, actual); + + + status = 'Section G of test: no error intended!'; + actual = testNum.toPrecision(21); + expect = "5.12345600000000001017" + //captureThis(); + array[item++] = new TestCase(SECTION, status, expect, actual); + + var thisError:String="no error"; + try{ + testNum.toPrecision(-1) + }catch(e:RangeError){ + thisError=e.toString(); + } + + status = 'Section H of test: error intended!'; + actual = rangeError(thisError); + expect = "RangeError: Error #1002" + //captureThis(); + array[item++] = new TestCase(SECTION, status, expect, actual); + + var thisError:String="no error"; + try{ + testNum.toPrecision(22) + }catch(e:RangeError){ + thisError=e.toString(); + } + + status = 'Section I of test: error intended!'; + actual = rangeError(thisError); + expect = "RangeError: Error #1002" + //captureThis(); + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = 'Section J of test: no error intended!'; + actual = testNum4.toPrecision(4); + expect = '0.0000'; + //captureThis(); + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = 'Section K of test: no error intended!'; + actual = testNum5.toPrecision(3); + expect = '4.00e+3'; + //captureThis(); + array[item++] = new TestCase(SECTION, status, expect, actual); + + +/////////////////////////// OOPS.... /////////////////////////////// + + return array; +} + +/* +function captureThis() +{ + statusitems[UBound] = status; + actualvalues[UBound] = actual; + expectedvalues[UBound] = expect; + UBound++; +} +*/ + +/* +function test() +{ + enterFunc ('test'); + printBugNumber (bug); + printStatus (summary); + + for (var i = 0; i < UBound; i++) + { + reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]); + } + + exitFunc ('test'); +} +*/ + +function catchError(sEval) +{ + try {eval(sEval);} + catch(e) {return isRangeError(e);} + return cnNoErrorCaught; +} + + +function isRangeError(obj) +{ + if (obj instanceof RangeError) + return cnIsRangeError; + return cnNotRangeError; +} diff --git a/mozilla/js/tamarin/test/ecma3/Number/e15_7_4__1_rt.as b/mozilla/js/tamarin/test/ecma3/Number/e15_7_4__1_rt.as new file mode 100644 index 00000000000..1817ca9416a --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Number/e15_7_4__1_rt.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + var SECTION = "15.7.4-1"; + var VERSION = "ECMA_1"; + startTest(); + writeHeaderToLog( SECTION + "Properties of the Number prototype object"); + + var testcases = getTestCases(); + + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase(SECTION, "Number.prototype.valueOf()", 0, Number.prototype.valueOf() ); + array[item++] = new TestCase(SECTION, "typeof(Number.prototype)", "object", typeof(Number.prototype) ); + array[item++] = new TestCase(SECTION, "Number.prototype.constructor == Number", true, Number.prototype.constructor == Number ); +// array[item++] = new TestCase(SECTION, "Number.prototype == Number.__proto__", true, Number.prototype == Number.__proto__ ); + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Number/e15_7_4_rt.as b/mozilla/js/tamarin/test/ecma3/Number/e15_7_4_rt.as new file mode 100644 index 00000000000..912b8118d39 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Number/e15_7_4_rt.as @@ -0,0 +1,59 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.7.4"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Properties of the Number Prototype Object"; + + writeHeaderToLog( SECTION + " "+TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var origToString:Function = Number.prototype.toString; + + Number.prototype.toString=Object.prototype.toString; + array[item++] = new TestCase( SECTION, + "Number.prototype.toString=Object.prototype.toString;Number.prototype.toString()", + "[object Object]", + Number.prototype.toString() ); + array[item++] = new TestCase( SECTION, "typeof Number.prototype", "object", typeof Number.prototype ); + array[item++] = new TestCase( SECTION, "Number.prototype.valueOf()", 0, Number.prototype.valueOf() ); + + //restore original prototype + Number.prototype.toString = origToString; + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Number/ecma4_sealedtype_1_rt.as b/mozilla/js/tamarin/test/ecma3/Number/ecma4_sealedtype_1_rt.as new file mode 100644 index 00000000000..36b79a80418 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Number/ecma4_sealedtype_1_rt.as @@ -0,0 +1,65 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + In Ecma4 there are three sealed types; Boolean, Number and String + You cannot set properties of an instance of a sealed type + + Should throw a ReferenceError + +*/ + var SECTION = "ECMA_4"; + var VERSION = "ECMA_4"; + startTest(); + var TITLE = "tostr=Number.prototype.toString;x=new Number();x.toString=tostr;"; + writeHeaderToLog( TITLE ); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array:Array= new Array(); + var item:Number = 0; + + var thisError:String = "no exception thrown" + //var tostr=Number.prototype.toString; + var x:Number=new Number(); + try{ + x.toString=Number.prototype.toString; + + } catch (e:ReferenceError) { + thisError = e.toString(); + } finally { + array[item] = new TestCase( SECTION,"toStr=Number.prototype.toString;x=new Number();x.toString=tostr", + "ReferenceError: Error #1056", + referenceError(thisError) ); + } + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Number/ecma4_sealedtype_2_rt.as b/mozilla/js/tamarin/test/ecma3/Number/ecma4_sealedtype_2_rt.as new file mode 100644 index 00000000000..e47faa8053f --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Number/ecma4_sealedtype_2_rt.as @@ -0,0 +1,66 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + In Ecma4 there are three sealed types; Boolean, Number and String + You cannot set properties of an instance of a sealed type + + Should throw a ReferenceError + +*/ + var SECTION = "ECMA_4"; + var VERSION = "ECMA_4"; + startTest(); + var TITLE = "tostr=Number.prototype.toString;x=new Number(4);x.toString=tostr;"; + writeHeaderToLog( TITLE ); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array:Array = new Array(); + var item:Number = 0; + + var thisError:String = "no Exception thrown"; + var tostr=Number.prototype.toString; + var x:Number=new Number(4); + try{ + + x.toString=tostr; + x.toString(); + } catch(e:ReferenceError){ + thisError = e.toString(); + } finally { + array[item] = new TestCase( SECTION,"toStr=Number.prototype.toString;x=new Number(4);x.toString=tostr", + "ReferenceError: Error #1056", + referenceError(thisError) ); + } + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Number/ecma4_sealedtype_3_rt.as b/mozilla/js/tamarin/test/ecma3/Number/ecma4_sealedtype_3_rt.as new file mode 100644 index 00000000000..5f6a718778f --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Number/ecma4_sealedtype_3_rt.as @@ -0,0 +1,66 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + In Ecma4 there are three sealed types; Boolean, Number and String + You cannot set properties of an instance of a sealed type + + Should throw a ReferenceError + +*/ + var SECTION = "ECMA_4"; + var VERSION = "ECMA_4"; + startTest(); + var TITLE = "tostr=Number.prototype.toString;x=4;x.toString=tostr;"; + writeHeaderToLog( TITLE ); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array:Array = new Array(); + var item:Number= 0; + + var thisError = "no exception thrown"; + var tostr=Number.prototype.toString; + var x:Number=4; + try{ + + x.toString=tostr; + x.toString(); + } catch (e:ReferenceError) { + thisError = e.toString(); + } finally { + array[item] = new TestCase( SECTION,"toStr=Number.prototype.toString;x=4;x.toString=tostr", + "ReferenceError: Error #1056", + referenceError(thisError) ); + } + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Number/ecma4_sealedtype_4_rt.as b/mozilla/js/tamarin/test/ecma3/Number/ecma4_sealedtype_4_rt.as new file mode 100644 index 00000000000..8a74a337d37 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Number/ecma4_sealedtype_4_rt.as @@ -0,0 +1,69 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +var SECTION = "ecma4_selaedtype_4_rt"; +startTest(); // leave this alone + +var testcases = getTestCases(); + +test(); // leave this alone. this executes the test cases and + // displays results. + + +function getTestCases() { + var array = new Array(); + var item = 0; + + var n = 5; + var expected = "error"; + var exception; + + try { + n.someVar = 3; + actual = "no error"; + } catch(e1) { + actual = "error"; + exception = e1.toString(); + } + + array[item++] = new TestCase(SECTION, "n = 5, n.someVar = 3: ", "ReferenceError: Error #1056", referenceError(exception)); + + try { + v = n.someVar; + actual = "no error"; + } catch(e2) { + actual = "error"; + exception = e2.toString(); + } + + array[item++] = new TestCase(SECTION, "n = 5, v = n.someVar: ", "ReferenceError: Error #1069", referenceError(exception)); + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Number/ecma4_st_valueOf_1_rt.as b/mozilla/js/tamarin/test/ecma3/Number/ecma4_st_valueOf_1_rt.as new file mode 100644 index 00000000000..a86aa028535 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Number/ecma4_st_valueOf_1_rt.as @@ -0,0 +1,71 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + In Ecma4 there are three sealed types; Boolean, Number and String + You cannot set properties of an instance of a sealed type + + Should throw a ReferenceError + + Author: mtilburg@macromedia.com + Date: October 13, 2004 + +*/ + var SECTION = "ECMA_4"; + var VERSION = "ECMA_4"; + startTest(); + var TITLE = "valof=Number.prototype.valueOf;x=new Number();x.valueOf=valof;"; + writeHeaderToLog( TITLE ); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array:Array = new Array(); + var item:Number = 0; + + var thisError:String = "no exception thrown"; + + var valof=Number.prototype.valueOf; + var x:Number=new Number(); + try{ + + x.valueOf=valof; + x.valueOf(); + } catch(e:ReferenceError){ + thisError = e.toString(); + } finally { + array[item] = new TestCase( SECTION,"valof=Number.prototype.valueOf;x=new Number();x.valueOf=valof", + "ReferenceError: Error #1056", + referenceError(thisError) ); + } + return ( array ); +} + diff --git a/mozilla/js/tamarin/test/ecma3/Number/ecma4_st_valueOf_2_rt.as b/mozilla/js/tamarin/test/ecma3/Number/ecma4_st_valueOf_2_rt.as new file mode 100644 index 00000000000..f40afca3766 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Number/ecma4_st_valueOf_2_rt.as @@ -0,0 +1,70 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + In Ecma4 there are three sealed types; Boolean, Number and String + You cannot set properties of an instance of a sealed type + + Should throw a ReferenceError + + Author: mtilburg@macromedia.com + Date: October 13, 2004 + +*/ + var SECTION = "ECMA_4"; + var VERSION = "ECMA_4"; + startTest(); + var TITLE = "valof=Number.prototype.valueOf;x=new Number(4);x.valueOf=valof;"; + writeHeaderToLog( TITLE ); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array:Array = new Array(); + var item:Number = 0; + + var thisError = "no exception thrown"; + var valof=Number.prototype.valueOf; + var x:Number=new Number(4); + try{ + + x.valueOf=valof; + x.valueOf(); + } catch(e:ReferenceError) { + thisError = e.toString(); + } finally { + array[item] = new TestCase( SECTION,"valof=Number.prototype.valueOf;x=new Number(4);x.valueOf=valof", + "ReferenceError: Error #1056", + referenceError(thisError) ); + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Number/ecma4_st_valueOf_3_rt.as b/mozilla/js/tamarin/test/ecma3/Number/ecma4_st_valueOf_3_rt.as new file mode 100644 index 00000000000..d2a1bc688a9 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Number/ecma4_st_valueOf_3_rt.as @@ -0,0 +1,69 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + In Ecma4 there are three sealed types; Boolean, Number and String + You cannot set properties of an instance of a sealed type + + Should throw a ReferenceError + + Author: mtilburg@macromedia.com + Date: October 13, 2004 + +*/ + var SECTION = "ECMA_4"; + var VERSION = "ECMA_4"; + startTest(); + var TITLE = "valof=Number.prototype.valueOf;x=4;x.valueOf=valof;"; + writeHeaderToLog( TITLE ); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array:Array = new Array(); + var item:Number = 0; + + var thisError:String = "no exception thrown"; + var valof=Number.prototype.valueOf; + var x:Number=4; + try{ + + x.valueOf=valof; + x.valueOf(); + } catch (e:ReferenceError) { + thisError = e.toString(); + } finally { + array[item] = new TestCase( SECTION,"valof=Number.prototype.valueOf;x=4;x.valueOf=valof", + "ReferenceError: Error #1056", + referenceError(thisError) ); + } + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Number/eregress_121952.as b/mozilla/js/tamarin/test/ecma3/Number/eregress_121952.as new file mode 100644 index 00000000000..61946f26cef --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Number/eregress_121952.as @@ -0,0 +1,129 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.7.4.5"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Number.toFixed"; + + writeHeaderToLog( SECTION + " "+TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, + "Number.prototype.toFixed.length", + 1, + Number.prototype.toFixed.length ); + + var profits = 2489.8237 + + array[item++] = new TestCase( SECTION, + "Number.toFixed -- rounding up", + "2489.824", + profits.toFixed(3)+"" ); + + array[item++] = new TestCase( SECTION, + "Number.toFixed", + "2489.82", + profits.toFixed(2)+"" ); + + array[item++] = new TestCase( SECTION, + "Number.toFixed -- padding", + "2489.8237000", + profits.toFixed(7)+"" ); + + array[item++] = new TestCase( SECTION, + "Number.toFixed -- padding", + "2489.8237000", + profits.toFixed(7)+"" ); + + array[item++] = new TestCase( SECTION, + "Number.toFixed(undefined)", + "2490", + profits.toFixed()+"" ); + + array[item++] = new TestCase( SECTION, + "Number.toFixed(0)", + "2490", + profits.toFixed(0)+"" ); + array[item++] = new TestCase( SECTION, + "Number.toFixed(null)", + "2490", + profits.toFixed(null)+"" ); + + + var thisError:String="no error" + + try{ + profits.toFixed(-1); + }catch(e:RangeError){ + thisError=e.toString(); + }finally{ + array[item++] = new TestCase( SECTION, + "Number.toFixed(0)", + "RangeError: Error #1002", + rangeError(thisError)); + } + + try{ + profits.toFixed(21); + }catch(e:RangeError){ + thisError=e.toString(); + }finally{ + array[item++] = new TestCase( SECTION, + "Number.toFixed(21)", + "RangeError: Error #1002", + rangeError(thisError)); + } + + + + var MYNUM=1000000000000000128 + + array[item++] = new TestCase( SECTION, + "Number.toFixed(0)", + "1000000000000000128", + MYNUM.toFixed(0)+"" ); + + var MYNUM2 = 4; + + array[item++] = new TestCase( SECTION, + "Number.toFixed(2)", + "4.00", + MYNUM2.toFixed(2)+"" ); + + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Number/toLocaleString2_rt.as b/mozilla/js/tamarin/test/ecma3/Number/toLocaleString2_rt.as new file mode 100644 index 00000000000..536a6de98ad --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Number/toLocaleString2_rt.as @@ -0,0 +1,51 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.7.4.3"; + var VERSION = "ECMA_1"; + startTest(); + var testcases = getTestCases(); + + writeHeaderToLog( SECTION + " Number.prototype.toLocaleString()"); + test(); + + +function getTestCases() { + var array:Array = new Array(); + var item:Number = 0; + + var o:* = new Object(); + o.toString = Number.prototype.toString; + array[item++] = new TestCase(SECTION, "o = new Object(); o.toString = Number.prototype.toString; o.toLocaleString()", "[object Object]", o.toLocaleString() ); +// array[item++] = new TestCase(SECTION, "o = new String(); o.toString = Number.prototype.toString; o.toLocaleString()", "error", "o = new String(); o.toString = Number.prototype.toString; o.toLocaleString()" ); +// array[item++] = new TestCase(SECTION, "o = 3; o.toString = Number.prototype.toString; o.toLocaleString()", "error", "o = 3; o.toString = Number.prototype.toString; o.toLocaleString()" ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Number/toLocaleString3_rt.as b/mozilla/js/tamarin/test/ecma3/Number/toLocaleString3_rt.as new file mode 100644 index 00000000000..bb2bbd8f80a --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Number/toLocaleString3_rt.as @@ -0,0 +1,55 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.7.4.3"; + var VERSION = "ECMA_1"; + startTest(); + var testcases = getTestCases(); + + writeHeaderToLog( SECTION + " Number.prototype.toLocaleString()"); + test(); + +function getTestCases() { + var array:Array = new Array(); + var item:Number = 0; + var o:String = new String(); + var thisError:String = "no exception thrown"; + try{ + + o.toString = Number.prototype.toString; + } catch(e:ReferenceError) { + thisError = e.toString(); + } finally { + array[item++] = new TestCase(SECTION, "o = new String(); o.toString = Number.prototype.toString; o.toLocaleString()", + "ReferenceError: Error #1056", + referenceError(thisError) ); + } + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Number/toLocaleString4_rt.as b/mozilla/js/tamarin/test/ecma3/Number/toLocaleString4_rt.as new file mode 100644 index 00000000000..571aeaf16ec --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Number/toLocaleString4_rt.as @@ -0,0 +1,58 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.7.4.3"; + var VERSION = "ECMA_1"; + startTest(); + var testcases = getTestCases(); + + writeHeaderToLog( SECTION + " Number.prototype.toLocaleString()"); + test(); + +function getTestCases() { + var array:Array = new Array(); + var item:Number = 0; + var o:Number = 3; + + var thisError:String = "no error thrown"; + try{ + + o.toString = Number.prototype.toString; + } catch (e:ReferenceError) { + thisError = e.toString(); + } finally { + array[item++] = new TestCase(SECTION, "o = 3; o.toString = Number.prototype.toString; o.toLocaleString()", + "ReferenceError: Error #1056", + referenceError(thisError) ); + } + + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Number/toLocaleString_rt.as b/mozilla/js/tamarin/test/ecma3/Number/toLocaleString_rt.as new file mode 100644 index 00000000000..600fcf8f0f3 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Number/toLocaleString_rt.as @@ -0,0 +1,197 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.7.4.3"; + var VERSION = "ECMA_1"; + startTest(); + var testcases = getTestCases(); + + writeHeaderToLog( SECTION + " Number.prototype.toLocaleString()"); + test(); + +function getTestCases() { + var array:Array = new Array(); + var item:Number= 0; + var o:Number = new Number(); + + array[item++] = new TestCase(SECTION, "Number.prototype.toLocaleString()", "0", Number.prototype.toLocaleString() ); + array[item++] = new TestCase(SECTION, "typeof(Number.prototype.toLocaleString())", "string", typeof(Number.prototype.toLocaleString()) ); + var s:Number=new Number(); + + var thisError:String = "no exception thrown"; + try{ + s = Number.prototype.toLocaleString; + + o.toLocaleString = s; + } catch (e:ReferenceError) { + thisError = e.toString(); + } finally { + array[item++] = new TestCase(SECTION, "s = Number.prototype.toLocaleString; o = new Number(); o.toLocaleString = s; o.toLocaleString()", + "ReferenceError: Error #1056", + referenceError( thisError ) ); + } + + thisError = "no exception thrown"; + var o:Number = new Number(1); + try{ + s = Number.prototype.toLocaleString; + + o.toLocaleString = s; + } catch(e1:ReferenceError) { + thisError = e1.toString(); + } finally { + array[item++] = new TestCase(SECTION, "s = Number.prototype.toLocaleString; o = new Number(1); o.toLocaleString = s; o.toLocaleString()", + "ReferenceError: Error #1056", + referenceError( thisError) ); + } + + thisError = "no exception thrown"; + var o:Number= new Number(-1); + try{ + s = Number.prototype.toLocaleString; + + o.toLocaleString = s; + } catch (e2:ReferenceError) { + thisError = e2.toString(); + } finally { + array[item++] = new TestCase(SECTION, "s = Number.prototype.toLocaleString; o = new Number(-1); o.toLocaleString = s; o.toLocaleString()", + "ReferenceError: Error #1056", + referenceError(thisError) ); + } + + var MYNUM = new Number(255); + array[item++] = new TestCase(SECTION, "var MYNUM = new Number(255); MYNUM.toLocaleString()", "255", MYNUM.toLocaleString() ); + + var MYNUM = new Number(Number.NaN); + array[item++] = new TestCase(SECTION, "var MYNUM = new Number(Number.NaN); MYNUM.toLocaleString()", "NaN", MYNUM.toLocaleString() ); + + var MYNUM = new Number(Infinity); + array[item++] = new TestCase(SECTION, "var MYNUM = new Number(Infinity); MYNUM.toLocaleString()", "Infinity", MYNUM.toLocaleString() ); + + var MYNUM = new Number(-Infinity); + array[item++] = new TestCase(SECTION, "var MYNUM = new Number(-Infinity); MYNUM.toLocaleString()", "-Infinity", MYNUM.toLocaleString() ); + + var o=new Number(true); + + array[item++] = new TestCase( SECTION, "o=new Number(true);o.toLocaleString()", "1",o.toLocaleString() ); + + o=new Number(false); + array[item++] = new TestCase( SECTION, "o=new Number(false);o.toLocaleString()", "0", o.toLocaleString() ); + o=new Number(new Array()); + array[item++] = new TestCase( SECTION, "o=new Number(new Array());o.toLocaleString()", "0", o.toLocaleString() ); + o=new Number(Number.NaN); + array[item++] = new TestCase( SECTION, "o=Number.NaN;o.toLocaleString()", "NaN", o.toLocaleString() ); + o=new Number(0) + array[item++] = new TestCase( SECTION, "o=0;o.toLocaleString()", "0", o.toLocaleString()); + o=new Number(-0); + array[item++] = new TestCase( SECTION, "o=-0;o.toLocaleString()", "0", o.toLocaleString() ); + + o=new Number(Number.POSITIVE_INFINITY); + array[item++] = new TestCase( SECTION, "o=new Number(Number.POSITIVE_INFINITY)", "Infinity", o.toLocaleString() ); + o=new Number(Number.NEGATIVE_INFINITY); + array[item++] = new TestCase( SECTION, "o=new Number(Number.NEGATIVE_INFINITY);o.toLocaleString()", "-Infinity", o.toLocaleString() ); + + o=new Number(-1); + array[item++] = new TestCase( SECTION, "o=new Number(-1);o.toLocaleString()", "-1", o.toLocaleString() ); + + // cases in step 6: integers 1e21 > x >= 1 or -1 >= x > -1e21 + + o=new Number(1); + array[item++] = new TestCase( SECTION, "o=new Number(1);o.toLocaleString()", "1", o.toLocaleString() ); + o=new Number(10); + array[item++] = new TestCase( SECTION, "o=new Number(10);o.toLocaleString()", "10", o.toLocaleString() ); + o=new Number(100); + array[item++] = new TestCase( SECTION, "o=new Number(100);o.toLocaleString()", "100", o.toLocaleString() ); + o=new Number(1000); + array[item++] = new TestCase( SECTION, "o=new Number(1000);o.toLocaleString()", "1000", o.toLocaleString() ); + o=new Number(10000); + array[item++] = new TestCase( SECTION, "o=new Number(10000);o.toLocaleString()", "10000", o.toLocaleString() ); + o=new Number(10000000000); + array[item++] = new TestCase( SECTION, "o=new Number(10000000000);o.toLocaleString()", "10000000000",o.toLocaleString() ); + o=new Number(10000000000000000000); + array[item++] = new TestCase( SECTION, "o=new Number(10000000000000000000);o.toString()", "10000000000000000000",o.toString() ); + o=new Number(100000000000000000000); + array[item++] = new TestCase( SECTION, "o=new Number(100000000000000000000);o.toLocaleString()", "100000000000000000000",o.toLocaleString() ); + o=new Number(12345 ); + array[item++] = new TestCase( SECTION, "o=new Number(12345 );o.toLocaleString()", "12345",o.toLocaleString() ); + o=new Number(1234567890 ); + array[item++] = new TestCase( SECTION, "o=new Number(1234567890);o.toLocaleString()", "1234567890",o.toLocaleString() ); + o=new Number(-1); + array[item++] = new TestCase( SECTION, "o=new Number(-1);o.toLocaleString()", "-1",o.toLocaleString() ); + o=new Number(-10 ); + array[item++] = new TestCase( SECTION, "o=new Number(-10 );o.toLocaleString()", "-10",o.toLocaleString() ); + + o=new Number(-100 ); + array[item++] = new TestCase( SECTION, "o=new Number(-100 );o.toLocaleString()", "-100",o.toLocaleString() ); + o=new Number(-1000 ); + array[item++] = new TestCase( SECTION, "o=new Number(-1000 );o.toLocaleString()", "-1000",o.toLocaleString() ); + o=new Number(-1000000000 ); + array[item++] = new TestCase( SECTION, "o=new Number(-1000000000 );o.toLocaleString()", "-1000000000",o.toLocaleString() ); + o=new Number(-1000000000000000); + array[item++] = new TestCase( SECTION, "o=new Number(-1000000000000000);o.toLocaleString()", "-1000000000000000",o.toLocaleString() ); + o=new Number(-100000000000000000000); + array[item++] = new TestCase( SECTION, "o=new Number(-100000000000000000000);o.toLocaleString()", "-100000000000000000000",o.toLocaleString() ); + + o=new Number(-1000000000000000000000); + array[item++] = new TestCase( SECTION, "o=new Number(-1000000000000000000000);o.toLocaleString()", "-1e+21",o.toLocaleString() ); + + o=new Number(1.0000001 ); + array[item++] = new TestCase( SECTION, "o=new Number(1.0000001);o.toLocaleString()", "1.0000001",o.toLocaleString() ); + o=new Number(1000000000000000000000); + array[item++] = new TestCase( SECTION, "o=new Number(1000000000000000000000);o.toLocaleString()", "1e+21",o.toLocaleString() ); + + o=new Number(1.2345); + array[item++] = new TestCase( SECTION, "o=new Number(1.2345);o.toLocaleString()", "1.2345",o.toLocaleString() ); + + o=new Number(1.234567890); + array[item++] = new TestCase( SECTION, "o=new Number(1.234567890);o.toLocaleString()", "1.23456789",o.toLocaleString() ); + + o=new Number(.12345); + array[item++] = new TestCase( SECTION, "o=new Number(.12345);o.toLocaleString()", "0.12345",o.toLocaleString() ); + + o=new Number(.012345); + array[item++] = new TestCase( SECTION, "o=new Number(.012345);o.toLocaleString()", "0.012345",o.toLocaleString() ); + + o=new Number(.0012345); + array[item++] = new TestCase( SECTION, "o=new Number(.0012345);o.toLocaleString()", "0.0012345",o.toLocaleString() ); + o=new Number(.00012345); + array[item++] = new TestCase( SECTION, "o=new Number(.00012345);o.toLocaleString()", "0.00012345",o.toLocaleString() ); + o=new Number(.000012345); + array[item++] = new TestCase( SECTION, "o=new Number(.000012345);o.toLocaleString()", "0.000012345",o.toLocaleString() ); + o=new Number(.0000012345); + array[item++] = new TestCase( SECTION, "o=new Number(.0000012345);o.toLocaleString()", "0.0000012345",o.toLocaleString() ); + o=new Number(.00000012345); + array[item++] = new TestCase( SECTION, "o=new Number(.00000012345);o.toLocaleString()", "1.2345e-7",o.toLocaleString() ); + o=new Number(); + array[item++] = new TestCase( SECTION, "o=new Number();o.toLocaleString()", "0",o.toLocaleString() ); + + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Number/tostring_001.as b/mozilla/js/tamarin/test/ecma3/Number/tostring_001.as new file mode 100644 index 00000000000..3c5951f619e --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Number/tostring_001.as @@ -0,0 +1,80 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Rob Ginda rginda@netscape.com + */ +var SECTION = "tostring_001" +printStatus ("Number formatting test."); +printBugNumber ("11178"); + +startTest(); +var testcases = getTestCases(); +test(); + +function getTestCases() +{ + var array = new Array(); + var item = 0; + + var n0 = 1e23; + var n1 = 5e22; + var n2 = 1.6e24; + + array[item++] = new TestCase(SECTION, "1e+23", n0.toString(),"1e+23" ); + + array[item++] = new TestCase(SECTION, "5e+22", n1.toString(), "5e+22"); + + array[item++] = new TestCase(SECTION, "1.6e+24", n2.toString(), "1.6e+24"); + + return array; +} + + diff --git a/mozilla/js/tamarin/test/ecma3/ObjectObjects/bug129539.as b/mozilla/js/tamarin/test/ecma3/ObjectObjects/bug129539.as new file mode 100644 index 00000000000..414155b2837 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/ObjectObjects/bug129539.as @@ -0,0 +1,67 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "bug129539"; +var VERSION = ""; +var TITLE = ""; +var bug = "129539"; + +startTest(); +writeHeaderToLog(SECTION + " " + TITLE); +var testcases = getTestCases(); +test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var a; + + if( !a ){ + array[item++] = new TestCase(SECTION, "var a;!a", true, true); + } else { + array[item++] = new TestCase(SECTION, "var a;!a", false, true); + } + + if( a == null ){ + array[item++] = new TestCase(SECTION, "var a;a == null", true, true); + } else { + array[item++] = new TestCase(SECTION, "var a;a == null", false, true); + } + + if( a == undefined ){ + array[item++] = new TestCase(SECTION, "var a;a == undefined", true, true); + } else { + array[item++] = new TestCase(SECTION, "var a;a == undefined", false, true); + } + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/ObjectObjects/class_001.as b/mozilla/js/tamarin/test/ecma3/ObjectObjects/class_001.as new file mode 100644 index 00000000000..bbaca276ed5 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/ObjectObjects/class_001.as @@ -0,0 +1,141 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* +* The contents of this file are subject to the Netscape Public +* License Version 1.1 (the "License"); you may not use this file +* except in compliance with the License. You may obtain a copy of +* the License at http://www.mozilla.org/NPL/ +* +* Software distributed under the License is distributed on an "AS IS" +* basis, WITHOUT WARRANTY OF ANY KIND, either expressed +* or implied. See the License for the specific language governing +* rights and limitations under the License. +* +* The Original Code is mozilla.org code. +* +* The Initial Developer of the Original Code is Netscape +* Communications Corporation. Portions created by Netscape are +* Copyright (C) 1998 Netscape Communications Corporation. All +* Rights Reserved. +* +* Contributor(s): pschwartau@netscape.com +* Date: 14 Mar 2001 +* +* SUMMARY: Testing the internal [[Class]] property of objects +* See ECMA-262 Edition 3 13-Oct-1999, Section 8.6.2 +* +* The getJSClass() function we use is in a utility file, e.g. "shell.js". +* +* Modified: 28th October 2004 (gasingh@macromedia.com) +* Removed the occurence of new Function('abc'). +* This is being changed to function() { abc }. +* +*/ +//------------------------------------------------------------------------------------------------- +var SECTION = "class_001"; +var VERSION = ""; +var TITLE = "Testing the internal [[Class]] property of objects"; +var bug = "(none)"; + +startTest(); +writeHeaderToLog(SECTION + " " + TITLE); +var testcases = getTestCases(); +test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var status = ''; + var actual = ''; + var expect= ''; + var k = new Function(); + + + status = 'the global object'; + actual = getJSClass(this); + expect = 'global'; + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = 'new Object()'; + actual = getJSClass(new Object()); + expect = 'Object'; + array[item++] = new TestCase(SECTION, status, expect, actual); + + // new Function() will be dropped in ecma4, will return undefined + // new Function() has been replaced by function() {} + /*status = 'new Function()'; + actual = getJSClass(k)+""; + expect = 'Function'; + array[item++] = new TestCase(SECTION, status, expect, actual);*/ + + status = 'new Array()'; + actual = getJSClass(new Array()); + expect = 'Array'; + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = 'new String()'; + actual = getJSClass(new String()); + expect = 'String'; + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = 'new Boolean()'; + actual = getJSClass(new Boolean()); + expect = 'Boolean'; + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = 'new Number()'; + actual = getJSClass(new Number()); + expect = 'Number'; + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = 'Math'; + actual = getJSClass(Math); // can't use 'new' with the Math object (EMCA3, 15.8) + expect = 'Math'; + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = 'new Date()'; + actual = getJSClass(new Date()); + expect = 'Date'; + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = 'new RegExp()'; + actual = getJSClass(new RegExp()); + expect = 'RegExp'; + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = 'new Error()'; + actual = getJSClass(new Error()); + expect = 'Error'; + array[item++] = new TestCase(SECTION, status, expect, actual); + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/ObjectObjects/class_002.as b/mozilla/js/tamarin/test/ecma3/ObjectObjects/class_002.as new file mode 100644 index 00000000000..5c9492ef9a7 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/ObjectObjects/class_002.as @@ -0,0 +1,129 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* +* The contents of this file are subject to the Netscape Public +* License Version 1.1 (the "License"); you may not use this file +* except in compliance with the License. You may obtain a copy of +* the License at http://www.mozilla.org/NPL/ +* +* Software distributed under the License is distributed on an "AS IS" +* basis, WITHOUT WARRANTY OF ANY KIND, either expressed +* or implied. See the License for the specific language governing +* rights and limitations under the License. +* +* The Original Code is mozilla.org code. +* +* The Initial Developer of the Original Code is Netscape +* Communications Corporation. Portions created by Netscape are +* Copyright (C) 1998 Netscape Communications Corporation. All +* Rights Reserved. +* +* Contributor(s): pschwartau@netscape.com +* Date: 14 Mar 2001 +* +* SUMMARY: Testing the [[Class]] property of native constructors. +* See ECMA-262 Edition 3 13-Oct-1999, Section 8.6.2 re [[Class]] property. +* +* Same as class-001.js - but testing the constructors here, not object instances. +* Therefore we expect the [[Class]] property to equal 'Function' in each case. +* +* The getJSClass() function we use is in a utility file, e.g. "shell.js" +*/ +//------------------------------------------------------------------------------------------------- +var SECTION = "class_002"; +var VERSION = ""; +var TITLE = "Testing the internal [[Class]] property of native constructors"; +var bug = "(none)"; + +startTest(); +writeHeaderToLog(SECTION + " " + TITLE); +var testcases = getTestCases(); +test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var status = ''; + var actual = ''; + var expect= ''; + + /* + * We set the expect variable each time only for readability. + * We expect 'Function' every time; see discussion above - + */ + status = 'Object'; + actual = getJSClass(Object); + expect = 'Object'; + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = 'Function'; + actual = getJSClass(Function); + expect = 'Function'; + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = 'Array'; + actual = getJSClass(Array); + expect = 'Array'; + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = 'String'; + actual = getJSClass(String); + expect = 'String'; + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = 'Boolean'; + actual = getJSClass(Boolean); + expect = 'Boolean'; + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = 'Number'; + actual = getJSClass(Number); + expect = 'Number'; + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = 'Date'; + actual = getJSClass(Date); + expect = 'Date'; + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = 'RegExp'; + actual = getJSClass(RegExp); + expect = 'RegExp'; + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = 'Error'; + actual = getJSClass(Error); + expect = 'Error'; + array[item++] = new TestCase(SECTION, status, expect, actual); + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/ObjectObjects/class_003.as b/mozilla/js/tamarin/test/ecma3/ObjectObjects/class_003.as new file mode 100644 index 00000000000..3002ae3d357 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/ObjectObjects/class_003.as @@ -0,0 +1,123 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* +* The contents of this file are subject to the Netscape Public +* License Version 1.1 (the "License"); you may not use this file +* except in compliance with the License. You may obtain a copy of +* the License at http://www.mozilla.org/NPL/ +* +* Software distributed under the License is distributed on an "AS IS" +* basis, WITHOUT WARRANTY OF ANY KIND, either expressed +* or implied. See the License for the specific language governing +* rights and limitations under the License. +* +* The Original Code is mozilla.org code. +* +* The Initial Developer of the Original Code is Netscape +* Communications Corporation. Portions created by Netscape are +* Copyright (C) 1998 Netscape Communications Corporation. All +* Rights Reserved. +* +* Contributor(s): pschwartau@netscape.com +* Date: 14 Mar 2001 +* +* SUMMARY: Testing the [[Class]] property of native error types. +* See ECMA-262 Edition 3, Section 8.6.2 for the [[Class]] property. +* +* Same as class-001.js - but testing only the native error types here. +* See ECMA-262 Edition 3, Section 15.11.6 for a list of these types. +* +* ECMA expects the [[Class]] property to equal 'Error' in each case. +* See ECMA-262 Edition 3, Sections 15.11.1.1 and 15.11.7.2 for this. +* See http://bugzilla.mozilla.org/show_bug.cgi?id=56868 +* +* The getJSClass() function we use is in a utility file, e.g. "shell.js" +*/ +//------------------------------------------------------------------------------------------------- +var SECTION = "class_003"; +var VERSION = ""; +var TITLE = "Testing the internal [[Class]] property of native error types"; +var bug = "56868"; + +startTest(); +writeHeaderToLog(SECTION + " " + TITLE); +var testcases = getTestCases(); +test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var status = ''; + var actual = ''; + var expect= ''; + + /* + * We set the expect variable each time only for readability. + * We expect 'Error' every time; see discussion above - + */ + status = 'new Error()'; + actual = getJSClass(new Error()); + expect = 'Error'; + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = 'new EvalError()'; + actual = getJSClass(new EvalError()); + expect = 'EvalError'; + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = 'new RangeError()'; + actual = getJSClass(new RangeError()); + expect = 'RangeError'; + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = 'new ReferenceError()'; + actual = getJSClass(new ReferenceError()); + expect = 'ReferenceError'; + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = 'new SyntaxError()'; + actual = getJSClass(new SyntaxError()); + expect = 'SyntaxError'; + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = 'new TypeError()'; + actual = getJSClass(new TypeError()); + expect = 'TypeError'; + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = 'new URIError()'; + actual = getJSClass(new URIError()); + expect = 'URIError'; + array[item++] = new TestCase(SECTION, status, expect, actual); + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/ObjectObjects/class_004.as b/mozilla/js/tamarin/test/ecma3/ObjectObjects/class_004.as new file mode 100644 index 00000000000..107c30e9409 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/ObjectObjects/class_004.as @@ -0,0 +1,122 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* +* The contents of this file are subject to the Netscape Public +* License Version 1.1 (the "License"); you may not use this file +* except in compliance with the License. You may obtain a copy of +* the License at http://www.mozilla.org/NPL/ +* +* Software distributed under the License is distributed on an "AS IS" +* basis, WITHOUT WARRANTY OF ANY KIND, either expressed +* or implied. See the License for the specific language governing +* rights and limitations under the License. +* +* The Original Code is mozilla.org code. +* +* The Initial Developer of the Original Code is Netscape +* Communications Corporation. Portions created by Netscape are +* Copyright (C) 1998 Netscape Communications Corporation. All +* Rights Reserved. +* +* Contributor(s): pschwartau@netscape.com +* Date: 14 Mar 2001 +* +* SUMMARY: Testing [[Class]] property of native error constructors. +* See ECMA-262 Edition 3, Section 8.6.2 for the [[Class]] property. +* +* See ECMA-262 Edition 3, Section 15.11.6 for the native error types. +* See http://bugzilla.mozilla.org/show_bug.cgi?id=56868 +* +* Same as class-003.js - but testing the constructors here, not object instances. +* Therefore we expect the [[Class]] property to equal 'Function' in each case. +* +* The getJSClass() function we use is in a utility file, e.g. "shell.js" +*/ +//------------------------------------------------------------------------------------------------- +var SECTION = "class_004"; +var VERSION = ""; +var TITLE = "Testing the internal [[Class]] property of native error constructors"; +var bug = "56868"; + +startTest(); +writeHeaderToLog(SECTION + " " + TITLE); +var testcases = getTestCases(); +test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var status = ''; + var actual = ''; + var expect= ''; + + /* + * We set the expect variable each time only for readability. + * We expect 'Function' every time; see discussion above - + */ + status = 'Error'; + actual = getJSClass(Error); + expect = 'Error'; + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = 'EvalError'; + actual = getJSClass(EvalError); + expect = 'EvalError'; + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = 'RangeError'; + actual = getJSClass(RangeError); + expect = 'RangeError'; + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = 'ReferenceError'; + actual = getJSClass(ReferenceError); + expect = 'ReferenceError'; + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = 'SyntaxError'; + actual = getJSClass(SyntaxError); + expect = 'SyntaxError'; + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = 'TypeError'; + actual = getJSClass(TypeError); + expect = 'TypeError'; + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = 'URIError'; + actual = getJSClass(TypeError); + expect = 'TypeError'; + array[item++] = new TestCase(SECTION, status, expect, actual); + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/ObjectObjects/class_005.as b/mozilla/js/tamarin/test/ecma3/ObjectObjects/class_005.as new file mode 100644 index 00000000000..35f4308ae8c --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/ObjectObjects/class_005.as @@ -0,0 +1,108 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* +* The contents of this file are subject to the Netscape Public +* License Version 1.1 (the "License"); you may not use this file +* except in compliance with the License. You may obtain a copy of +* the License at http://www.mozilla.org/NPL/ +* +* Software distributed under the License is distributed on an "AS IS" +* basis, WITHOUT WARRANTY OF ANY KIND, either expressed +* or implied. See the License for the specific language governing +* rights and limitations under the License. +* +* The Original Code is mozilla.org code. +* +* The Initial Developer of the Original Code is Netscape +* Communications Corporation. Portions created by Netscape are +* Copyright (C) 1998 Netscape Communications Corporation. All +* Rights Reserved. +* +* Contributor(s): pschwartau@netscape.com +* Date: 14 Mar 2001 +* +* SUMMARY: Testing the internal [[Class]] property of user-defined types. +* See ECMA-262 Edition 3 13-Oct-1999, Section 8.6.2 re [[Class]] property. +* +* Same as class-001.js - but testing user-defined types here, not native types. +* Therefore we expect the [[Class]] property to equal 'Object' in each case - +* +* The getJSClass() function we use is in a utility file, e.g. "shell.js" +*/ +//------------------------------------------------------------------------------------------------- +var SECTION = "class_005"; +var VERSION = ""; +var TITLE = "Testing the internal [[Class]] property of user-defined types"; +var bug = "(none)"; + +startTest(); +writeHeaderToLog(SECTION + " " + TITLE); +var testcases = getTestCases(); +test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var status = ''; + var actual = ''; + var expect= ''; + + Calf.prototype= new Cow(); + + /* + * We set the expect variable each time only for readability. + * We expect 'Object' every time; see discussion above - + */ + status = 'new Cow()'; + actual = getJSClass(new Cow()); + expect = 'Object'; + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = 'new Calf()'; + actual = getJSClass(new Calf()); + expect = 'Object'; + array[item++] = new TestCase(SECTION, status, expect, actual); + + + function Cow(name) + { + this.name=name; + } + + + function Calf(name) + { + this.name=name; + } + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/ObjectObjects/class_006.as b/mozilla/js/tamarin/test/ecma3/ObjectObjects/class_006.as new file mode 100644 index 00000000000..0564c814c42 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/ObjectObjects/class_006.as @@ -0,0 +1,154 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* +* The contents of this file are subject to the Netscape Public +* License Version 1.1 (the "License"); you may not use this file +* except in compliance with the License. You may obtain a copy of +* the License at http://www.mozilla.org/NPL/ +* +* Software distributed under the License is distributed on an "AS IS" +* basis, WITHOUT WARRANTY OF ANY KIND, either expressed +* or implied. See the License for the specific language governing +* rights and limitations under the License. +* +* The Original Code is mozilla.org code. +* +* The Initial Developer of the Original Code is Netscape +* Communications Corporation. Portions created by Netscape are +* Copyright (C) 1998 Netscape Communications Corporation. All +* Rights Reserved. +* +* Contributor(s): pschwartau@netscape.com +* Date: 14 Mar 2001 +* +* SUMMARY: Testing the internal [[Class]] property of objects +* See ECMA-262 Edition 3 13-Oct-1999, Section 8.6.2 +* +* The getJSClass() function we use is in a utility file, e.g. "shell.js". +* +* Modified: 28th October 2004 (gasingh@macromedia.com) +* Removed the occurence of new Function('abc'). +* This is being changed to function() { abc }. +* +*/ +//------------------------------------------------------------------------------------------------- +var SECTION = "class_006"; +var VERSION = ""; +var TITLE = "Testing the internal [[Class]] property of objects"; +var bug = "(none)"; + +startTest(); +writeHeaderToLog(SECTION + " " + TITLE); +var testcases = getTestCases(); +test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var status = ''; + var actual = ''; + var expect= ''; + var k = new Function(); + + + + + // new Function() will be dropped in ecma4, will return undefined + // new Function() has been replaced by function() {} + status = 'new Function()'; + actual = getJSClass(new Function()); + expect = 'Function'; + array[item++] = new TestCase(SECTION, status, expect, actual); + + + + return array; +} +var cnNoObject = 'Unexpected Error!!! Parameter to this function must be an object'; +var cnNoClass = 'Unexpected Error!!! Cannot find Class property'; +var cnObjectToString = Object.prototype.toString; +var k = new Function(); + + +// checks that it's safe to call findType() +function getJSType(obj) +{ + if (isObject(obj)) + return (findType(obj)); + return cnNoObject; +} + +// checks that it's safe to call findType() +function getJSClass(obj) +{ + if (isObject(obj)) + return findClass(findType(obj)); + return cnNoObject; +} + + +function findType(obj) +{ + return ((cnObjectToString.apply(obj)).substring(0,16)+"]"); +} + + +// given '[object Number]', return 'Number' +function findClass(sType) +{ + var re = /^\[.*\s+(\w+)\s*\]$/; + var a = sType.match(re); + + // work around for bug 175820 + + if( Capabilities.isDebugger ) + { + if (a && a[1]) + return a[1]; + + return cnNoClass; + } + else + { + return "Function"; + } +} + + +function isObject(obj) +{ + return obj instanceof Object; +} + + + + diff --git a/mozilla/js/tamarin/test/ecma3/ObjectObjects/e15_2_1_1_rt.as b/mozilla/js/tamarin/test/ecma3/ObjectObjects/e15_2_1_1_rt.as new file mode 100644 index 00000000000..ac4b1a13924 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/ObjectObjects/e15_2_1_1_rt.as @@ -0,0 +1,310 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.2.1.1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Object( value )"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var NULL_OBJECT = Object(null); + + + array[item++] = new TestCase( SECTION, "Object(null).valueOf()", NULL_OBJECT,NULL_OBJECT.valueOf()); + + array[item++] = new TestCase( SECTION, "typeof Object(null)", "object", typeof (Object(null)) ); + + array[item++] = new TestCase( SECTION, "Object(null).constructor.prototype", "[object Object]",Object(null).constructor.prototype+""); + + + + + + var UNDEFINED_OBJECT = Object( void 0 ); + + array[item++] = new TestCase( SECTION, "Object(void 0).valueOf()", UNDEFINED_OBJECT,UNDEFINED_OBJECT.valueOf()); + + + + array[item++] = new TestCase( SECTION, "typeof Object(void 0)", "object", typeof (Object(void 0)) ); + + array[item++] = new TestCase( SECTION, "Object(void 0).constructor.prototype", "[object Object]",(Object(void 0)).constructor.prototype+""); + + + var UNDEFINED_OBJECT2 = Object(undefined); + + array[item++] = new TestCase( SECTION, "Object(undefined).valueOf", UNDEFINED_OBJECT2,UNDEFINED_OBJECT2.valueOf()); + + + + array[item++] = new TestCase( SECTION, "typeof Object(undefined)", "object", typeof (Object(undefined)) ); + + array[item++] = new TestCase( SECTION, "Object(undefined).constructor.prototype", "[object Object]",(Object(undefined)).constructor.prototype+""); + + + array[item++] = new TestCase( SECTION, "Object(true).valueOf()", true, (Object(true)).valueOf() ); + array[item++] = new TestCase( SECTION, "typeof Object(true)", "boolean", typeof Object(true) ); + thisError = "no error"; + try{ + var MYOB = Object(true); + MYOB.toString = Object.prototype.toString; + MYOB.toString() + }catch(e4:Error){ + thisError=e4.toString(); + }finally{ + array[item++] = new TestCase( SECTION, "var MYOB = Object(true), MYOB.toString = Object.prototype.toString, MYOB.toString()", "ReferenceError: Error #1056",referenceError(thisError)); + } + + + array[item++] = new TestCase( SECTION, "Object(false).valueOf()", false, (Object(false)).valueOf() ); + array[item++] = new TestCase( SECTION, "typeof Object(false)", "boolean", typeof Object(false) ); + + + thisError = "no error"; + try{ + var MYOB = Object(false); + MYOB.toString = Object.prototype.toString; + MYOB.toString() + }catch(e5:Error){ + thisError=e5.toString(); + }finally{ + array[item++] = new TestCase( SECTION, "var MYOB = Object(false), MYOB.toString = Object.prototype.toString, MYOB.toString()", "ReferenceError: Error #1056",referenceError(thisError)); + } + + + array[item++] = new TestCase( SECTION, "Object(0).valueOf()", 0, (Object(0)).valueOf() ); + array[item++] = new TestCase( SECTION, "typeof Object(0)", "number", typeof Object(0) ); + thisError = "no error"; + try{ + var MYOB = Object(0); + MYOB.toString = Object.prototype.toString; + MYOB.toString() + }catch(e6:Error){ + thisError=e6.toString(); + }finally{ + array[item++] = new TestCase( SECTION, "var MYOB = Object(0), MYOB.toString = Object.prototype.toString, MYOB.toString()", "ReferenceError: Error #1056",referenceError(thisError)); + } + + + + + array[item++] = new TestCase( SECTION, "Object(-0).valueOf()", -0, (Object(-0)).valueOf() ); + array[item++] = new TestCase( SECTION, "typeof Object(-0)", "number", typeof Object(-0) ); + + + thisError = "no error"; + try{ + var MYOB = Object(-0); + MYOB.toString = Object.prototype.toString; + MYOB.toString() + }catch(e7:Error){ + thisError=e7.toString(); + }finally{ + array[item++] = new TestCase( SECTION, "var MYOB = Object(-0), MYOB.toString", "ReferenceError: Error #1056",referenceError(thisError)); + } + + + array[item++] = new TestCase( SECTION, "Object(1).valueOf()", 1, (Object(1)).valueOf() ); + array[item++] = new TestCase( SECTION, "typeof Object(1)", "number", typeof Object(1) ); + thisError = "no error"; + try{ + var MYOB = Object(1); + MYOB.toString = Object.prototype.toString; + MYOB.toString() + }catch(e8:Error){ + thisError=e8.toString(); + }finally{ + array[item++] = new TestCase( SECTION, "var MYOB = Object(1), MYOB.toString", "ReferenceError: Error #1056",referenceError(thisError)); + } + + + + array[item++] = new TestCase( SECTION, "Object(-1).valueOf()", -1, (Object(-1)).valueOf() ); + array[item++] = new TestCase( SECTION, "typeof Object(-1)", "number", typeof Object(-1) ); + + thisError = "no error"; + try{ + var MYOB = Object(-1); + MYOB.toString = Object.prototype.toString; + MYOB.toString() + }catch(e9:Error){ + thisError=e9.toString(); + }finally{ + array[item++] = new TestCase( SECTION, "var MYOB = Object(-1), MYOB.toString", "ReferenceError: Error #1056",referenceError(thisError)); + } + + + array[item++] = new TestCase( SECTION, "Object(Number.MAX_VALUE).valueOf()", 1.7976931348623157e308, (Object(Number.MAX_VALUE)).valueOf() ); + array[item++] = new TestCase( SECTION, "typeof Object(Number.MAX_VALUE)", "number", typeof Object(Number.MAX_VALUE) ); + + thisError = "no error"; + try{ + var MYOB = Object(Number.MAX_VALUE); + MYOB.toString = Object.prototype.toString; + MYOB.toString() + }catch(e10:Error){ + thisError=e10.toString(); + }finally{ + array[item++] = new TestCase( SECTION, "var MYOB = Object(Number.MAX_VALUE), MYOB.toString", "ReferenceError: Error #1056",referenceError(thisError)); + } + + array[item++] = new TestCase( SECTION, "Object(Number.MIN_VALUE).valueOf()", 5e-324, (Object(Number.MIN_VALUE)).valueOf() ); + array[item++] = new TestCase( SECTION, "typeof Object(Number.MIN_VALUE)", "number", typeof Object(Number.MIN_VALUE) ); + + thisError = "no error"; + try{ + var MYOB = Object(Number.MIN_VALUE); + MYOB.toString = Object.prototype.toString; + MYOB.toString() + }catch(e11:Error){ + thisError=e11.toString(); + }finally{ + array[item++] = new TestCase( SECTION, "var MYOB = Object(Number.MIN_VALUE), MYOB.toString", "ReferenceError: Error #1056",referenceError(thisError)); + } + + + array[item++] = new TestCase( SECTION, "Object(Number.POSITIVE_INFINITY).valueOf()", Number.POSITIVE_INFINITY, (Object(Number.POSITIVE_INFINITY)).valueOf() ); + array[item++] = new TestCase( SECTION, "typeof Object(Number.POSITIVE_INFINITY)", "number", typeof Object(Number.POSITIVE_INFINITY) ); + + thisError = "no error"; + try{ + var MYOB = Object(Number.POSITIVE_INFINITY); + MYOB.toString = Object.prototype.toString; + MYOB.toString() + }catch(e12:Error){ + thisError=e12.toString(); + }finally{ + array[item++] = new TestCase( SECTION, "var MYOB = Object(Number.POSITIVE_INFINITY), MYOB.toString", "ReferenceError: Error #1056",referenceError(thisError)); + } + + + array[item++] = new TestCase( SECTION, "Object(Number.NEGATIVE_INFINITY).valueOf()", Number.NEGATIVE_INFINITY, (Object(Number.NEGATIVE_INFINITY)).valueOf() ); + array[item++] = new TestCase( SECTION, "typeof Object(Number.NEGATIVE_INFINITY)", "number", typeof Object(Number.NEGATIVE_INFINITY) ); + + thisError = "no error"; + try{ + var MYOB = Object(Number.NEGATIVE_INFINITY); + MYOB.toString = Object.prototype.toString; + MYOB.toString() + }catch(e13:Error){ + thisError=e13.toString(); + }finally{ + array[item++] = new TestCase( SECTION, "var MYOB = Object(Number.NEGATIVE_INFINITY), MYOB.toString", "ReferenceError: Error #1056",referenceError(thisError)); + } + + array[item++] = new TestCase( SECTION, "Object(Number.NaN).valueOf()", Number.NaN, (Object(Number.NaN)).valueOf() ); + array[item++] = new TestCase( SECTION, "typeof Object(Number.NaN)", "number", typeof Object(Number.NaN) ); + thisError = "no error"; + try{ + var MYOB = Object(Number.NaN); + MYOB.toString = Object.prototype.toString; + MYOB.toString() + }catch(e14:Error){ + thisError=e14.toString(); + }finally{ + array[item++] = new TestCase( SECTION, "var MYOB = Object(Number.NaN), MYOB.toString", "ReferenceError: Error #1056",referenceError(thisError)); + } + + + + array[item++] = new TestCase( SECTION, "Object('a string').valueOf()", "a string", (Object("a string")).valueOf() ); + array[item++] = new TestCase( SECTION, "typeof Object('a string')", "string", typeof (Object("a string")) ); + + thisError = "no error"; + try{ + var MYOB = Object('a string'); + MYOB.toString = Object.prototype.toString; + MYOB.toString() + }catch(e15:Error){ + thisError=e15.toString(); + }finally{ + array[item++] = new TestCase( SECTION, "var MYOB = Object('a string'), MYOB.toString", "ReferenceError: Error #1056",referenceError(thisError)); + } + + array[item++] = new TestCase( SECTION, "Object('').valueOf()", "", (Object("")).valueOf() ); + array[item++] = new TestCase( SECTION, "typeof Object('')", "string", typeof (Object("")) ); + + thisError = "no error"; + try{ + var MYOB = Object(''); + MYOB.toString = Object.prototype.toString; + MYOB.toString() + }catch(e16:Error){ + thisError=e16.toString(); + }finally{ + array[item++] = new TestCase( SECTION, "var MYOB = Object(''), MYOB.toString", "ReferenceError: Error #1056",referenceError(thisError)); + } + + + array[item++] = new TestCase( SECTION, "Object('\\r\\t\\b\\n\\v\\f').valueOf()", "\r\t\b\n\v\f", (Object("\r\t\b\n\v\f")).valueOf() ); + array[item++] = new TestCase( SECTION, "typeof Object('\\r\\t\\b\\n\\v\\f')", "string", typeof (Object("\\r\\t\\b\\n\\v\\f")) ); + + thisError = "no error"; + try{ + var MYOB = Object('\\r\\t\\b\\n\\v\\f'); + MYOB.toString = Object.prototype.toString; + MYOB.toString() + }catch(e17:Error){ + thisError=e17.toString(); + }finally{ + array[item++] = new TestCase( SECTION, "var MYOB = Object('\\r\\t\\b\\n\\v\\f'), MYOB.toString", "ReferenceError: Error #1056",referenceError(thisError)); + } + + + array[item++] = new TestCase( SECTION, "Object( '\\\'\\\"\\' ).valueOf()", "\'\"\\", (Object("\'\"\\")).valueOf() ); + array[item++] = new TestCase( SECTION, "typeof Object( '\\\'\\\"\\' )", "string", typeof Object("\'\"\\") ); + + var MYOB = Object('\\\'\\\"\\' ); + thisError = "no error"; + try{ + + MYOB.toString = Object.prototype.toString; + MYOB.toString() + }catch(e18:Error){ + thisError=e18.toString(); + }finally{ + array[item++] = new TestCase( SECTION, "var MYOB = Object('\\\'\\\"\\' ), MYOB.toString", "ReferenceError: Error #1056",referenceError(thisError)); + } + + + + + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/ObjectObjects/e15_2_1_2_rt.as b/mozilla/js/tamarin/test/ecma3/ObjectObjects/e15_2_1_2_rt.as new file mode 100644 index 00000000000..728dec6f9a5 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/ObjectObjects/e15_2_1_2_rt.as @@ -0,0 +1,60 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.2.1.2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Object()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var MYOB = Object(); + + array[item++] = new TestCase( SECTION, "var MYOB = Object(); MYOB.valueOf()", MYOB,MYOB.valueOf()); + + + + array[item++] = new TestCase( SECTION, "typeof Object()", "object", typeof (Object(null)) ); + + + array[item++] = new TestCase( SECTION, "var MYOB = Object(); MYOB.toString()", "[object Object]",MYOB.toString()); + + + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/ObjectObjects/e15_2_2_1_rt.as b/mozilla/js/tamarin/test/ecma3/ObjectObjects/e15_2_2_1_rt.as new file mode 100644 index 00000000000..0e713ac660d --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/ObjectObjects/e15_2_2_1_rt.as @@ -0,0 +1,146 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.2.2.1"; + var VERSION = "ECMA_4"; + startTest(); + var TITLE = "new Object( value )"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "typeof new Object(null)", "object", typeof new Object(null) ); + MYOB = new Object(null); + MYOB.toString = Object.prototype.toString; + array[item++] = new TestCase( SECTION, "MYOB = new Object(null); MYOB.toString = Object.prototype.toString; MYOB.toString()", "[object Object]", MYOB.toString()); + + array[item++] = new TestCase( SECTION, "typeof new Object(void 0)", "object", typeof new Object(void 0) ); + MYOB = new Object(new Object(void 0)); + MYOB.toString = Object.prototype.toString; + array[item++] = new TestCase( SECTION, "MYOB = new Object(new Object(void 0)); MYOB.toString = Object.prototype.toString; MYOB.toString()", "[object Object]", MYOB.toString()); + + array[item++] = new TestCase( SECTION, "typeof new Object(undefined)", "object", typeof new Object(undefined) ); + MYOB = new Object(new Object(undefined)); + MYOB.toString = Object.prototype.toString; + array[item++] = new TestCase( SECTION, "MYOB = new Object(new Object(undefined)); MYOB.toString = Object.prototype.toString; MYOB.toString()", "[object Object]", MYOB.toString()); + + array[item++] = new TestCase( SECTION, "typeof new Object('string')", "string", typeof new Object('string') ); + + MYOB = new Object('string'); + array[item++] = new TestCase( SECTION, "MYOB = (new Object('string'); MYOB.toString = Object.prototype.toString; MYOB.toString()", "string", MYOB.toString()); + + array[item++] = new TestCase( SECTION, "(new Object('string').valueOf()", "string", (new Object('string')).valueOf() ); + + array[item++] = new TestCase( SECTION, "typeof new Object('')", "string", typeof new Object('') ); + MYOB = new Object(''); + array[item++] = new TestCase( SECTION, "MYOB = (new Object(''); MYOB.toString = Object.prototype.toString; MYOB.toString()", "", MYOB.toString()); + + array[item++] = new TestCase( SECTION, "(new Object('').valueOf()", "", (new Object('')).valueOf() ); + + array[item++] = new TestCase( SECTION, "typeof new Object(Number.NaN)", "number", typeof new Object(Number.NaN) ); + MYOB = new Object(Number.NaN); + array[item++] = new TestCase( SECTION, "MYOB = (new Object(Number.NaN); MYOB.toStriobjectng = Object.prototype.toString; MYOB.toString()", "NaN", MYOB.toString() ); + array[item++] = new TestCase( SECTION, "(new Object(Number.NaN).valueOf()", Number.NaN, (new Object(Number.NaN)).valueOf() ); + + array[item++] = new TestCase( SECTION, "typeof new Object(0)", "number", typeof new Object(0) ); + MYOB = new Object(0); + array[item++] = new TestCase( SECTION, "MYOB = (new Object(0); MYOB.toString = Object.prototype.toString; MYOB.toString()", "0", MYOB.toString()); + array[item++] = new TestCase( SECTION, "(new Object(0).valueOf()", 0, (new Object(0)).valueOf() ); + + array[item++] = new TestCase( SECTION, "typeof new Object(-0)", "number", typeof new Object(-0) ); + MYOB = new Object(-0); + array[item++] = new TestCase( SECTION, "MYOB = (new Object(-0); MYOB.toString = Object.prototype.toString; MYOB.toString()", "0", MYOB.toString() ); + array[item++] = new TestCase( SECTION, "(new Object(-0).valueOf()", -0, (new Object(-0)).valueOf() ); + + array[item++] = new TestCase( SECTION, "typeof new Object(1)", "number", typeof new Object(1) ); + MYOB = new Object(1); + array[item++] = new TestCase( SECTION, "MYOB = (new Object(1); MYOB.toString = Object.prototype.toString; MYOB.toString()", "1", MYOB.toString() ); + array[item++] = new TestCase( SECTION, "(new Object(1).valueOf()", 1, (new Object(1)).valueOf() ); + + array[item++] = new TestCase( SECTION, "typeof new Object(-1)", "number", typeof new Object(-1) ); + MYOB = new Object(-1); + array[item++] = new TestCase( SECTION, "MYOB = (new Object(-1); MYOB.toString = Object.prototype.toString; MYOB.toString()", "-1", MYOB.toString() ); + array[item++] = new TestCase( SECTION, "(new Object(-1).valueOf()", -1, (new Object(-1)).valueOf() ); + + array[item++] = new TestCase( SECTION, "typeof new Object(true)", "boolean", typeof new Object(true) ); + Boolean.prototype.valueOf=Object.prototype.valueOf; + MYOB = new Object(true); + array[item++] = new TestCase( SECTION, "MYOB = (new Object(true); MYOB.toString = Object.prototype.toString; MYOB.toString()", "true", MYOB.toString() ); + array[item++] = new TestCase( SECTION, "(new Object(true).valueOf()", true, (new Object(true)).valueOf() ); + + array[item++] = new TestCase( SECTION, "typeof new Object(false)", "boolean", typeof new Object(false) ); + MYOB = new Object(false); + array[item++] = new TestCase( SECTION, "MYOB = (new Object(false); MYOB.toString = Object.prototype.toString; MYOB.toString()", "false", MYOB.toString() ); + array[item++] = new TestCase( SECTION, "(new Object(false).valueOf()", false, (new Object(false)).valueOf() ); + + array[item++] = new TestCase( SECTION, "typeof new Object(Boolean())", "boolean", typeof new Object(Boolean()) ); + MYOB = new Object(Boolean()); + array[item++] = new TestCase( SECTION, "MYOB = (new Object(Boolean()); MYOB.toString = Object.prototype.toString; MYOB.toString()", "false", MYOB.toString() ); + array[item++] = new TestCase( SECTION, "(new Object(Boolean()).valueOf()", Boolean(), (new Object(Boolean())).valueOf() ); + + var myglobal = this; + var myobject = new Object( "my new object" ); + var myarray = new Array(); + var myboolean = new Boolean(); + var mynumber = new Number(); + var mystring = new String(); + var myobject = new Object(); + myfunction = function(x){return x;} + var mymath = Math; + var myregexp = new RegExp(new String('')); + + function myobj():String{ + function f():String{ + return "hi!"; + } + return f(); + } + + array[item++] = new TestCase( SECTION, "myglobal = new Object( this )", myglobal, new Object(this) ); + array[item++] = new TestCase( SECTION, "myobject = new Object('my new object'); new Object(myobject)", myobject, new Object(myobject) ); + array[item++] = new TestCase( SECTION, "myarray = new Array(); new Object(myarray)", myarray, new Object(myarray) ); + array[item++] = new TestCase( SECTION, "myboolean = new Boolean(); new Object(myboolean)", myboolean, new Object(myboolean) ); + array[item++] = new TestCase( SECTION, "mynumber = new Number(); new Object(mynumber)", mynumber, new Object(mynumber) ); + array[item++] = new TestCase( SECTION, "mystring = new String(); new Object(mystring)", mystring, new Object(mystring) ); + array[item++] = new TestCase( SECTION, "myobject = new Object(); new Object(myobject)", myobject, new Object(myobject) ); + array[item++] = new TestCase( SECTION, "myfunction = function(x){return x;} new Object(myfunction)", myfunction, new Object(myfunction) ); + array[item++] = new TestCase( SECTION, "function myobj(){function f(){}return f() new Object(myobj)", myobj, new Object(myobj) ); + array[item++] = new TestCase( SECTION, "mymath = Math; new Object(mymath)", mymath, new Object(mymath) ); + array[item++] = new TestCase( SECTION, "myregexp = new RegExp(new String('')), new Object(myregexp)", myregexp, new Object(myregexp) ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/ObjectObjects/e15_2_2_2.as b/mozilla/js/tamarin/test/ecma3/ObjectObjects/e15_2_2_2.as new file mode 100644 index 00000000000..d310b3a9db1 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/ObjectObjects/e15_2_2_2.as @@ -0,0 +1,50 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.2.2.2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "new Object()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "typeof new Object()", "object", typeof new Object() ); + array[item++] = new TestCase( SECTION, "Object.prototype.toString()", "[object Object]", Object.prototype.toString() ); + array[item++] = new TestCase( SECTION, "(new Object()).toString()", "[object Object]", (new Object()).toString() ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/ObjectObjects/e15_2_3_1_1.as b/mozilla/js/tamarin/test/ecma3/ObjectObjects/e15_2_3_1_1.as new file mode 100644 index 00000000000..f62c8433181 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/ObjectObjects/e15_2_3_1_1.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.2.3.1-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Object.prototype"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + str = ''; for ( p in Object ) { str += p; } + + array[item++] = new TestCase( SECTION, "var str = '';for ( p in Object ) { str += p; }; str", + "", + str + ); + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/ObjectObjects/e15_2_3_1_2.as b/mozilla/js/tamarin/test/ecma3/ObjectObjects/e15_2_3_1_2.as new file mode 100644 index 00000000000..a12fb7bb670 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/ObjectObjects/e15_2_3_1_2.as @@ -0,0 +1,55 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.2.3.1-2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Object.prototype"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + /*array[item++] = new TestCase( SECTION, "delete( Object.prototype )", + false, + "delete( Object.prototype )" + ); + */ + array[item++] = new TestCase( SECTION, "delete( Object.prototype )", + false, + (delete( Object.prototype )) + ); + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/ObjectObjects/e15_2_3_1_3.as b/mozilla/js/tamarin/test/ecma3/ObjectObjects/e15_2_3_1_3.as new file mode 100644 index 00000000000..4d9632ebdf6 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/ObjectObjects/e15_2_3_1_3.as @@ -0,0 +1,65 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.2.3.1-3"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Object.prototype"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var thisError="no exception thrown"; + try{ + // save + var origPrototype = Object.prototype; + + Object.prototype = null; + + // restore + Object.prototype = origPrototype; + } catch (e:ReferenceError) { + thisError=e.toString(); + } finally { + array[item++] = new TestCase( SECTION, "Object.prototype = null; Object.prototype", + "ReferenceError: Error #1074", + referenceError(thisError) + ); + } + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/ObjectObjects/e15_2_3_1_4.as b/mozilla/js/tamarin/test/ecma3/ObjectObjects/e15_2_3_1_4.as new file mode 100644 index 00000000000..eec4a171ab7 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/ObjectObjects/e15_2_3_1_4.as @@ -0,0 +1,50 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.2.3.1-4"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Object.prototype"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, "delete( Object.prototype ); Object.prototype", + Object.prototype, + (delete(Object.prototype), Object.prototype) + ); + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/ObjectObjects/e15_2_3_1_rt.as b/mozilla/js/tamarin/test/ecma3/ObjectObjects/e15_2_3_1_rt.as new file mode 100644 index 00000000000..37efdc2fdc5 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/ObjectObjects/e15_2_3_1_rt.as @@ -0,0 +1,47 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.2.3"; + var VERSION = "ECMA_4"; + startTest(); + var testcases = getTestCases(); + + writeHeaderToLog( SECTION + " Properties of the Object Constructor"); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "Object.constructor.prototype", Object.prototype+"", Object.constructor.prototype+""); + array[item++] = new TestCase( SECTION, "Object.length", 1, Object.length ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/ObjectObjects/e15_2_3_rt.as b/mozilla/js/tamarin/test/ecma3/ObjectObjects/e15_2_3_rt.as new file mode 100644 index 00000000000..a1c5dcedb1b --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/ObjectObjects/e15_2_3_rt.as @@ -0,0 +1,50 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.2.3"; + var VERSION = "ECMA_4"; + startTest(); + var TITLE = "Properties of the Object Constructor"; + + writeHeaderToLog( SECTION + " " + TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "Object.constructor.prototype", Object.prototype+"", Object.constructor.prototype+""); + array[item++] = new TestCase( SECTION, "Object.length", 1, Object.length ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/ObjectObjects/e15_2_4_1_rt.as b/mozilla/js/tamarin/test/ecma3/ObjectObjects/e15_2_4_1_rt.as new file mode 100644 index 00000000000..0beda22ec24 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/ObjectObjects/e15_2_4_1_rt.as @@ -0,0 +1,49 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.2.4.1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Object.prototype.constructor"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, "Object.prototype.constructor", + Object, + Object.prototype.constructor + ); + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/ObjectObjects/e15_2_4_2.as b/mozilla/js/tamarin/test/ecma3/ObjectObjects/e15_2_4_2.as new file mode 100644 index 00000000000..cb95abc347e --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/ObjectObjects/e15_2_4_2.as @@ -0,0 +1,158 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.2.4.2"; + var VERSION = "ECMA_4"; + startTest(); + var TITLE = "Object.prototype.toString()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "(new Object()).toString()", "[object Object]", (new Object()).toString() ); + + myvar = this; + myvar.toString = Object.prototype.toString; + array[item++] = new TestCase( SECTION, "myvar = this; myvar.toString = Object.prototype.toString; myvar.toString()", + GLOBAL, + myvar.toString()); + + +/* myvar = MyObject; + myvar.toString = Object.prototype.toString; + array[item++] = new TestCase( SECTION, "myvar = MyObject; myvar.toString = Object.prototype.toString; myvar.toString()", + "[object Function]", + myvar.toString() ); +*/ + myvar = new MyObject( true ); + myvar.toString = Object.prototype.toString; + array[item++] = new TestCase( SECTION, "myvar = new MyObject( true ); myvar.toString = Object.prototype.toString; myvar.toString()", + '[object Object]', + myvar.toString()); + + // save + var origNumProto = Number.prototype.toString; + + Number.prototype.toString=Object.prototype.toString; + myvar = new Number(0); + array[item++] = new TestCase( SECTION, "myvar = new Number(0); myvar.toString = Object.prototype.toString; myvar.toString()", + "[object Number]", + myvar.toString()); + + // restore + Number.prototype.toString = origNumProto + + //save + var origStrProto = String.prototype.toString; + + String.prototype.toString=Object.prototype.toString; + myvar = new String(''); + array[item++] = new TestCase( SECTION, "myvar = new String(''); myvar.toString = Object.prototype.toString; myvar.toString()", + "[object String]", + myvar.toString() ); + + // restore + String.prototype.toString = origStrProto; + + myvar = Math; + + var thisError = "no exception thrown"; + +// The new Funtion() has been replaced by function() {} + myvar = function() {}; + myvar.toString = Object.prototype.toString; + // work around for bug 175820 + var expRes = "[object Function-3]"; + try{ + if( Capabilities.isDebugger == false) + expRes = "[object null]"; + } catch (es) { + // do nothing + } + array[item++] = new TestCase( SECTION, "myvar = function() {}; myvar.toString = Object.prototype.toString; myvar.toString()", + expRes, + myvar.toString()); + +/* + myvar = new Array(); + myvar.toString = Object.prototype.toString; + array[item++] = new TestCase( SECTION, "myvar = new Array(); myvar.toString = Object.prototype.toString; myvar.toString()", + "[object Array]", + myvar.toString()); + + // save + var origBoolProto = Boolean.prototype.toString; + + Boolean.prototype.toString=Object.prototype.toString; + myvar = new Boolean(); + array[item++] = new TestCase( SECTION, "myvar = new Boolean(); myvar.toString = Object.prototype.toString; myvar.toString()", + "[object Boolean]", + myvar.toString()); + + // restore + Boolean.prototype.toString = origBoolProto; + + myvar = new Date(); + myvar.toString = Object.prototype.toString; + array[item++] = new TestCase( SECTION, "myvar = new Date(); myvar.toString = Object.prototype.toString; myvar.toString()", + "[object Date]", + myvar.toString()); + +*/ + + array[item++] = new TestCase( SECTION, "var MYVAR = new Object( this ); MYVAR.toString()", + GLOBAL, + (MYVAR = new Object( this ), MYVAR.toString() ) ); + + array[item++] = new TestCase( SECTION, "var MYVAR = new Object(); MYVAR.toString()", + "[object Object]", + (MYVAR = new Object(), MYVAR.toString() ) ); + + array[item++] = new TestCase( SECTION, "var MYVAR = new Object(void 0); MYVAR.toString()", + "[object Object]", + (MYVAR = new Object(void 0), MYVAR.toString() ) ); + + array[item++] = new TestCase( SECTION, "var MYVAR = new Object(null); MYVAR.toString()", + "[object Object]", + (MYVAR = new Object(null), MYVAR.toString() ) ); + + return ( array ); +} + +function MyObject( value ) { + this.value = function() {return this.value;} + this.toString = function() {return this.value+'';} +} diff --git a/mozilla/js/tamarin/test/ecma3/ObjectObjects/e15_2_4_3.as b/mozilla/js/tamarin/test/ecma3/ObjectObjects/e15_2_4_3.as new file mode 100644 index 00000000000..f7cdaf3eadf --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/ObjectObjects/e15_2_4_3.as @@ -0,0 +1,166 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.2.4.3"; + var VERSION = "ECMA_4"; + startTest(); + var TITLE = "Object.prototype.valueOf()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // save + var origNumProto = Number.prototype.valueOf; + var origBoolProto = Boolean.prototype.valueOf; + + var myarray = new Array(); + myarray.valueOf = Object.prototype.valueOf; + //Boolean.prototype.valueOf=Object.prototype.valueOf; + //var myboolean = new Boolean(); + var myfunction = function() {}; + myfunction.valueOf = Object.prototype.valueOf; + var myobject = new Object(); + myobject.valueOf = Object.prototype.valueOf; + var mymath = Math; + //mymath.valueOf = Object.prototype.valueOf; + var mydate = new Date(); + //mydate.valueOf = Object.prototype.valueOf; + Number.prototype.valueOf=Object.prototype.valueOf; + var mynumber = new Number(); + //String.prototype.valueOf=Object.prototype.valueOf; + var mystring = new String(); + + array[item++] = new TestCase( SECTION, "Object.prototype.valueOf.length", 0, Object.prototype.valueOf.length ); + + array[item++] = new TestCase( SECTION, + "myarray = new Array(); myarray.valueOf = Object.prototype.valueOf; myarray.valueOf()", + myarray, + myarray.valueOf() ); + Boolean.prototype.valueOf=Object.prototype.valueOf; + var myboolean:Boolean = new Boolean(); + var thisError:String="no error"; + try{ + + myboolean.valueOf = Object.prototype.valueOf; + myboolean.valueOf(); + }catch(e:Error){ + thisError=e.toString(); + }finally{//print(thisError); + array[item++] = new TestCase( SECTION, + "myboolean = new Boolean(); myboolean.valueOf = Object.prototype.valueOf; myboolean.valueOf()", + "ReferenceError: Error #1056", + referenceError(thisError) ); + } + /*array[item++] = new TestCase( SECTION, + "myboolean = new Boolean(); myboolean.valueOf = Object.prototype.valueOf; myboolean.valueOf()", + myboolean, + myboolean.valueOf() );*/ + array[item++] = new TestCase( SECTION, + "myfunction = function() {}; myfunction.valueOf = Object.prototype.valueOf; myfunction.valueOf()", + myfunction, + myfunction.valueOf() ); + + array[item++] = new TestCase( SECTION, + "myobject = new Object(); myobject.valueOf = Object.prototype.valueOf; myobject.valueOf()", + myobject, + myobject.valueOf() ); + + try{ + mymath.valueOf = Object.prototype.valueOf; + mymath.valueOf(); + }catch(e1:Error){ + thisError=e1.toString(); + }finally{//print(thisError); + array[item++] = new TestCase( SECTION, + "mymath = Math; mymath.valueOf = Object.prototype.valueOf;mymath.valueOf()", + "ReferenceError: Error #1056",referenceError(thisError) ); + } + /* array[item++] = new TestCase( SECTION, + "mymath = Math; mymath.valueOf = Object.prototype.valueOf; mymath.valueOf()", + mymath, + mymath.valueOf() );*/ + try{ + mynumber.valueOf = Object.prototype.valueOf; + mynumber.valueOf(); + }catch(e2:ReferenceError){ + thisError=e2.toString(); + }finally{//print(thisError); + array[item++] = new TestCase( SECTION, + "mynumber = new Number(); mynumber.valueOf = Object.prototype.valueOf; mynumber.valueOf()", + "ReferenceError: Error #1056",referenceError(thisError) ); + } + + /*array[item++] = new TestCase( SECTION, + "mynumber = new Number(); mynumber.valueOf = Object.prototype.valueOf; mynumber.valueOf()", + mynumber, + mynumber.valueOf() );*/ + + try{ + mystring.valueOf = Object.prototype.valueOf; + mystring.valueOf(); + }catch(e3:Error){ + thisError=e3.toString(); + }finally{//print(thisError); + array[item++] = new TestCase( SECTION, + "mystring = new String(); mystring.valueOf = Object.prototype.valueOf; mystring.valueOf()", + "ReferenceError: Error #1056",referenceError(thisError) ); + } + /* array[item++] = new TestCase( SECTION, + "mystring = new String(); mystring.valueOf = Object.prototype.valueOf; mystring.valueOf()", + mystring, + mystring.valueOf() );*/ + + try{ + mydate.valueOf = Object.prototype.valueOf; + mydate.valueOf(); + }catch(e4:Error){ + thisError=e4.toString(); + }finally{//print(thisError); + array[item++] = new TestCase( SECTION, + "mydate = new Date(); mydate.valueOf = Object.prototype.valueOf; mydate.valueOf()", + "ReferenceError: Error #1056",referenceError(thisError) ); + } + /*array[item++] = new TestCase( SECTION, + "mydate = new Date(); mydate.valueOf = Object.prototype.valueOf; mydate.valueOf()", + mydate, + mydate.valueOf());*/ + + // restore + Number.prototype.valueOf = origNumProto; + Boolean.prototype.valueOf = origBoolProto; + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/ObjectObjects/e8_6_2_6_001.as b/mozilla/js/tamarin/test/ecma3/ObjectObjects/e8_6_2_6_001.as new file mode 100644 index 00000000000..d5aeecdea04 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/ObjectObjects/e8_6_2_6_001.as @@ -0,0 +1,117 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* ***** BEGIN LICENSE BLOCK ***** +* Version: NPL 1.1/GPL 2.0/LGPL 2.1 +* +* The contents of this file are subject to the Netscape Public License +* Version 1.1 (the "License"); you may not use this file except in +* compliance with the License. You may obtain a copy of the License at +* http://www.mozilla.org/NPL/ +* +* Software distributed under the License is distributed on an "AS IS" basis, +* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +* for the specific language governing rights and limitations under the +* License. +* +* The Original Code is JavaScript Engine testing utilities. +* +* The Initial Developer of the Original Code is Netscape Communications Corp. +* Portions created by the Initial Developer are Copyright (C) 2002 +* the Initial Developer. All Rights Reserved. +* +* Contributor(s): pschwartau@netscape.com +* +* Alternatively, the contents of this file may be used under the terms of +* either the GNU General Public License Version 2 or later (the "GPL"), or +* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +* in which case the provisions of the GPL or the LGPL are applicable instead +* of those above. If you wish to allow use of your version of this file only +* under the terms of either the GPL or the LGPL, and not to allow others to +* use your version of this file under the terms of the NPL, indicate your +* decision by deleting the provisions above and replace them with the notice +* and other provisions required by the GPL or the LGPL. If you do not delete +* the provisions above, a recipient may use your version of this file under +* the terms of any one of the NPL, the GPL or the LGPL. +* +* ***** END LICENSE BLOCK ***** +* +* +* Date: 09 September 2002 +* SUMMARY: Test for TypeError on invalid default string value of object +* See ECMA reference at http://bugzilla.mozilla.org/show_bug.cgi?id=167325 +* +*/ +//----------------------------------------------------------------------------- +var SECTION = "e8_6_2_6_001"; +var VERSION = ""; +var TITLE = "Test for TypeError on invalid default string value of object"; +var bug = "167325"; + +startTest(); +writeHeaderToLog(SECTION + " " + TITLE); +var testcases = getTestCases(); +test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TEST_PASSED = 'TypeError'; + var TEST_FAILED = 'Generated an error, but NOT a TypeError!'; + var TEST_FAILED_BADLY = 'Did not generate ANY error!!!'; + var status = ''; + var actual = ''; + var expect= ''; + + + status = inSection(1); + expect = TEST_PASSED; + actual = TEST_FAILED_BADLY; + /* + * This should generate a TypeError. See ECMA reference + * at http://bugzilla.mozilla.org/show_bug.cgi?id=167325 + */ + try + { + var obj = {toString: function() {return new Object();}} + obj == 'abc'; + } + catch(e) + { + if (e instanceof TypeError) + actual = TEST_PASSED; + else + actual = TEST_FAILED; + } + array[item++] = new TestCase(SECTION, status, expect, actual); + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/ObjectObjects/hasOwnProperty.as b/mozilla/js/tamarin/test/ecma3/ObjectObjects/hasOwnProperty.as new file mode 100644 index 00000000000..9f1defb1e82 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/ObjectObjects/hasOwnProperty.as @@ -0,0 +1,69 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = '15.2.4.5'; + var VERSION = 'no version'; + startTest(); + var TITLE = 'hasOwnProperty'; + + writeHeaderToLog('Executing script: hasOwnProperty.as'); + writeHeaderToLog( SECTION + " "+ TITLE); + + var count = 0; + var testcases = new Array(); + + + testcases[count++] = new TestCase( SECTION, "String.prototype.hasOwnProperty(\"split\")", true,String.prototype.hasOwnProperty("split")); + + var str = new String("JScript"); + + testcases[count++] = new TestCase( SECTION, "str.hasOwnProperty(\"split\")", false,str.hasOwnProperty("split")); + + testcases[count++] = new TestCase( SECTION, "Array.prototype.hasOwnProperty(\"pop\")", true,Array.prototype.hasOwnProperty("pop")); + + testcases[count++] = new TestCase( SECTION, "Number.prototype.hasOwnProperty(\"toPrecision\")", true,Number.prototype.hasOwnProperty("toPrecision")); + + testcases[count++] = new TestCase( SECTION, "Date.prototype.hasOwnProperty(\"getTime\")", true,Date.prototype.hasOwnProperty("getTime")); + + testcases[count++] = new TestCase( SECTION, "RegExp.prototype.hasOwnProperty(\"exec\")", true,RegExp.prototype.hasOwnProperty("exec")); + + testcases[count++] = new TestCase( SECTION, "String.prototype.hasOwnProperty(\"random\")", false,String.prototype.hasOwnProperty("random")); + + testcases[count++] = new TestCase( SECTION, "Object.prototype.hasOwnProperty(\"constructor\")", true,Object.prototype.hasOwnProperty("constructor")); + + testcases[count++] = new TestCase( SECTION, "Object.prototype.hasOwnProperty(\"getTime\")", false,Object.prototype.hasOwnProperty("getTime")); + + var myobj = new Object(); + + testcases[count++] = new TestCase( SECTION, "myobj.hasOwnProperty(\"constructor\")", false,myobj.hasOwnProperty("constructor")); + + + test(); diff --git a/mozilla/js/tamarin/test/ecma3/ObjectObjects/isPrototypeOf.as b/mozilla/js/tamarin/test/ecma3/ObjectObjects/isPrototypeOf.as new file mode 100644 index 00000000000..d9c90204a80 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/ObjectObjects/isPrototypeOf.as @@ -0,0 +1,71 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = '15.2.4.6'; + var VERSION = 'no version'; + startTest(); + var TITLE = 'isPrototypeOf'; + + writeHeaderToLog('Executing script: isPrototypeOf'); + writeHeaderToLog( SECTION + " "+ TITLE); + + var count = 0; + var testcases = new Array(); + + var re = new RegExp(); + + + testcases[count++] = new TestCase( SECTION, "RegExp.prototype.isPrototypeOf(re))", true,RegExp.prototype.isPrototypeOf(re)); + + var str = new String("JScript"); + + testcases[count++] = new TestCase( SECTION, "String.prototype.isPrototypeOf(str)", true,String.prototype.isPrototypeOf(str)); + + testcases[count++] = new TestCase( SECTION, "String.prototype.isPrototypeOf(re)", false,String.prototype.isPrototypeOf(re)); + + testcases[count++] = new TestCase( SECTION, "String.prototype.isPrototypeOf(new Number())", false,String.prototype.isPrototypeOf(new Number())); + + testcases[count++] = new TestCase( SECTION, "Object.prototype.isPrototypeOf(str)", true,Object.prototype.isPrototypeOf(str)); + + testcases[count++] = new TestCase( SECTION, "Object.prototype.isPrototypeOf(re)", true,Object.prototype.isPrototypeOf(re)); + + var myobj = new Object(); + + + testcases[count++] = new TestCase( SECTION, "String.prototype.isPrototypeOf(myobj)", false,String.prototype.isPrototypeOf(myobj)); + + var myobj2 = null; + + testcases[count++] = new TestCase( SECTION, "Object.prototype.isPrototypeOf(myobj2)", false,Object.prototype.isPrototypeOf(myobj2)); + + + test(); + diff --git a/mozilla/js/tamarin/test/ecma3/ObjectObjects/propertyIsEnumerable.as b/mozilla/js/tamarin/test/ecma3/ObjectObjects/propertyIsEnumerable.as new file mode 100644 index 00000000000..104a90deeb4 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/ObjectObjects/propertyIsEnumerable.as @@ -0,0 +1,53 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = '15.2.4.7'; + var VERSION = 'no version'; + startTest(); + var TITLE = 'propertyIsEnumerable'; + + writeHeaderToLog('Executing script: propertyIsEnumerable.as'); + writeHeaderToLog( SECTION + " "+ TITLE); + + var count = 0; + var testcases = new Array(); + + var a = new Array("apple", "banana", "cactus", "orange"); + + + testcases[count++] = new TestCase( SECTION, "a.propertyIsEnumerable(0)", true, a.propertyIsEnumerable(0)); + testcases[count++] = new TestCase( SECTION, "a.propertyIsEnumerable(1)", true, a.propertyIsEnumerable(1)); + testcases[count++] = new TestCase( SECTION, "a.propertyIsEnumerable(2)", true, a.propertyIsEnumerable(2)); + testcases[count++] = new TestCase( SECTION, "a.propertyIsEnumerable(3)", true, a.propertyIsEnumerable(3)); + testcases[count++] = new TestCase( SECTION, "a.propertyIsEnumerable(4)", false, a.propertyIsEnumerable(4)); + + + test(); diff --git a/mozilla/js/tamarin/test/ecma3/ObjectObjects/regress_72773_rt.as b/mozilla/js/tamarin/test/ecma3/ObjectObjects/regress_72773_rt.as new file mode 100644 index 00000000000..21d717897c4 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/ObjectObjects/regress_72773_rt.as @@ -0,0 +1,105 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* +* The contents of this file are subject to the Netscape Public +* License Version 1.1 (the "License"); you may not use this file +* except in compliance with the License. You may obtain a copy of +* the License at http://www.mozilla.org/NPL/ +* +* Software distributed under the License is distributed on an "AS IS" +* basis, WITHOUT WARRANTY OF ANY KIND, either expressed +* or implied. See the License for the specific language governing +* rights and limitations under the License. +* +* The Original Code is mozilla.org code. +* +* The Initial Developer of the Original Code is Netscape +* Communications Corporation. Portions created by Netscape are +* Copyright (C) 1998 Netscape Communications Corporation. All +* Rights Reserved. +* +* Contributor(s): pschwartau@netscape.com +* Date: 09 May 2001 +* +* SUMMARY: Regression test: we shouldn't crash on this code +* See http://bugzilla.mozilla.org/show_bug.cgi?id=72773 +* +* See ECMA-262 Edition 3 13-Oct-1999, Section 8.6.2 re [[Class]] property. +* +* Same as class-001.js - but testing user-defined types here, not native types. +* Therefore we expect the [[Class]] property to equal 'Object' in each case - +* +* The getJSClass() function we use is in a utility file, e.g. "shell.js" +*/ +//------------------------------------------------------------------------------------------------- +var SECTION = "regress_72773_rt"; +var VERSION = ""; +var TITLE = "Regression test: we shouldn't crash on this code"; +var bug = "72773"; + +startTest(); +writeHeaderToLog(SECTION + " " + TITLE); +var testcases = getTestCases(); +test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var status = ''; + var actual = ''; + var expect = ''; + var sToEval = ''; + + /* + * This code should produce an error, but not a crash. + * 'TypeError: Function.prototype.toString called on incompatible object' + */ + sToEval += 'function Cow(name){this.name = name;}' + sToEval += 'function Calf(str){this.name = str;}' + sToEval += 'Calf.prototype = Cow;' + sToEval += 'new Calf().toString();' + + status = 'Trying to catch an expected error'; + try + { + eval(sToEval); + } + catch(e) + { + actual = getJSClass(e); + expect = 'ReferenceError'; + } + + array[item++] = new TestCase(SECTION, status, expect, actual); + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/ObjectObjects/regress_79129_001.as b/mozilla/js/tamarin/test/ecma3/ObjectObjects/regress_79129_001.as new file mode 100644 index 00000000000..62baebf5b16 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/ObjectObjects/regress_79129_001.as @@ -0,0 +1,91 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* +* The contents of this file are subject to the Netscape Public +* License Version 1.1 (the "License"); you may not use this file +* except in compliance with the License. You may obtain a copy of +* the License at http://www.mozilla.org/NPL/ +* +* Software distributed under the License is distributed on an "AS IS" +* basis, WITHOUT WARRANTY OF ANY KIND, either expressed +* or implied. See the License for the specific language governing +* rights and limitations under the License. +* +* The Original Code is mozilla.org code. +* +* The Initial Developer of the Original Code is Netscape +* Communications Corporation. Portions created by Netscape are +* Copyright (C) 1998 Netscape Communications Corporation. +* All Rights Reserved. +* +* Contributor(s): pschwartau@netscape.com +* Date: 06 May 2001 +* +* SUMMARY: Regression test: we shouldn't crash on this code +* +* See http://bugzilla.mozilla.org/show_bug.cgi?id=79129 +*/ +//------------------------------------------------------------------------------------------------- +var SECTION = "regress_79129_001"; +var VERSION = ""; +var TITLE = "Regression test: we shouldn't crash on this code"; +var bug = "79129;"; + +startTest(); +writeHeaderToLog(SECTION + " " + TITLE); +var testcases = getTestCases(); +test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + tryThis(); + + array[item++] = new TestCase(SECTION, "Make sure there is no crash", true, true); + + function tryThis() + { + obj={}; + obj.a = obj.b = obj.c = 1; + delete obj.a; + delete obj.b; + delete obj.c; + obj.d = obj.e = 1; + obj.a=1; + obj.b=1; + obj.c=1; + obj.d=1; + obj.e=1; + } + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/ObjectObjects/toLocaleString_rt.as b/mozilla/js/tamarin/test/ecma3/ObjectObjects/toLocaleString_rt.as new file mode 100644 index 00000000000..a942b082c13 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/ObjectObjects/toLocaleString_rt.as @@ -0,0 +1,122 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.2.4.3"; + var VERSION = "ECMA_4"; + startTest(); + var TITLE = "Object.prototype.toLocaleString()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "(new Object()).toLocaleString()", "[object Object]", (new Object()).toLocaleString() ); + + array[item++] = new TestCase( SECTION, "myvar = this; myvar.toLocaleString = Object.prototype.toLocaleString; myvar.toLocaleString()", + GLOBAL, + (myvar = this, myvar.toLocaleString = Object.prototype.toLocaleString, myvar.toLocaleString()) ); + + // work around for bug 175820 + var expRes = "[object Function-4]"; + try{ + if(Capabilities.isDebugger == false) + expRes = "[object null]"; + } catch( sd ) { + // do nothing + } + array[item++] = new TestCase( SECTION, "myvar = MyObject; myvar.toLocaleString = Object.prototype.toLocaleString; myvar.toLocaleString()", + expRes, + (myvar = MyObject, myvar.toLocaleString = Object.prototype.toLocaleString, myvar.toLocaleString()) ); + + array[item++] = new TestCase( SECTION, "myvar = new MyObject( true ); myvar.toLocaleString = Object.prototype.toLocaleString; myvar.toLocaleString()", + '[object Object]', + (myvar = new MyObject( true ), myvar.toLocaleString = Object.prototype.toLocaleString, myvar.toLocaleString()) ); + + Number.prototype.toLocaleString; + //Object.prototpye.toLocaleString; + array[item++] = new TestCase( SECTION, "myvar = new Number(0); myvar.toLocaleString = Object.prototype.toLocaleString; myvar.toLocaleString()", + "0", + (myvar = new Number(0), myvar.toLocaleString()) ); + +/* array[item++] = new TestCase( SECTION, "myvar = new String(''); myvar.toLocaleString = Object.prototype.toLocaleString; myvar.toLocaleString()", + "[object String]", + eval("myvar = new String(''); myvar.toLocaleString = Object.prototype.toLocaleString; myvar.toLocaleString()") ); + + array[item++] = new TestCase( SECTION, "myvar = Math; myvar.toLocaleString = Object.prototype.toLocaleString; myvar.toLocaleString()", + "[object Math]", + eval("myvar = Math; myvar.toLocaleString = Object.prototype.toLocaleString; myvar.toLocaleString()") ); + + array[item++] = new TestCase( SECTION, "myvar = function() {}; myvar.toLocaleString = Object.prototype.toLocaleString; myvar.toLocaleString()", + "[object Function]", + eval("myvar = function() {}; myvar.toLocaleString = Object.prototype.toLocaleString; myvar.toLocaleString()") ); + + array[item++] = new TestCase( SECTION, "myvar = new Array(); myvar.toLocaleString = Object.prototype.toLocaleString; myvar.toLocaleString()", + "[object Array]", + eval("myvar = new Array(); myvar.toLocaleString = Object.prototype.toLocaleString; myvar.toLocaleString()") ); + + array[item++] = new TestCase( SECTION, "myvar = new Boolean(); myvar.toLocaleString = Object.prototype.toLocaleString; myvar.toLocaleString()", + "[object Boolean]", + eval("myvar = new Boolean(); myvar.toLocaleString = Object.prototype.toLocaleString; myvar.toLocaleString()") ); + + array[item++] = new TestCase( SECTION, "myvar = new Date(); myvar.toLocaleString = Object.prototype.toLocaleString; myvar.toLocaleString()", + "[object Date]", + eval("myvar = new Date(); myvar.toLocaleString = Object.prototype.toLocaleString; myvar.toLocaleString()") ); + + array[item++] = new TestCase( SECTION, "var MYVAR = new Object( this ); MYVAR.toLocaleString()", + GLOBAL, + (MYVAR = new Object( this ), MYVAR.toLocaleString() ) ); + + array[item++] = new TestCase( SECTION, "var MYVAR = new Object(); MYVAR.toLocaleString()", + "[object Object]", + (MYVAR = new Object(), MYVAR.toLocaleString() ) ); + + array[item++] = new TestCase( SECTION, "var MYVAR = new Object(void 0); MYVAR.toLocaleString()", + "[object Object]", + (MYVAR = new Object(void 0), MYVAR.toLocaleString() ) ); + + array[item++] = new TestCase( SECTION, "var MYVAR = new Object(null); MYVAR.toLocaleString()", + "[object Object]", + (MYVAR = new Object(null), MYVAR.toLocaleString() ) ); +*/ + return ( array ); +} + +function MyObject( value ) { + this.value = function() { return this.value; } + this.toLocaleString = function() { return this.value+''; } + + this.value = function() {return this.value;} + this.toLocaleString = function() {return this.value+'';} +} diff --git a/mozilla/js/tamarin/test/ecma3/RegExp/e15_10_2_1.as b/mozilla/js/tamarin/test/ecma3/RegExp/e15_10_2_1.as new file mode 100644 index 00000000000..41fab0efe1f --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/RegExp/e15_10_2_1.as @@ -0,0 +1,190 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* ***** BEGIN LICENSE BLOCK ***** +* Version: NPL 1.1/GPL 2.0/LGPL 2.1 +* +* The contents of this file are subject to the Netscape Public License +* Version 1.1 (the "License"); you may not use this file except in +* compliance with the License. You may obtain a copy of the License at +* http://www.mozilla.org/NPL/ +* +* Software distributed under the License is distributed on an "AS IS" basis, +* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +* for the specific language governing rights and limitations under the +* License. +* +* The Original Code is JavaScript Engine testing utilities. +* +* The Initial Developer of the Original Code is Netscape Communications Corp. +* Portions created by the Initial Developer are Copyright (C) 2002 +* the Initial Developer. All Rights Reserved. +* +* Contributor(s): rogerl@netscape.com, pschwartau@netscape.com +* +* Alternatively, the contents of this file may be used under the terms of +* either the GNU General Public License Version 2 or later (the "GPL"), or +* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +* in which case the provisions of the GPL or the LGPL are applicable instead +* of those above. If you wish to allow use of your version of this file only +* under the terms of either the GPL or the LGPL, and not to allow others to +* use your version of this file under the terms of the NPL, indicate your +* decision by deleting the provisions above and replace them with the notice +* and other provisions required by the GPL or the LGPL. If you do not delete +* the provisions above, a recipient may use your version of this file under +* the terms of any one of the NPL, the GPL or the LGPL. +* +* ***** END LICENSE BLOCK ***** +* +* +* Date: 09 July 2002 +* SUMMARY: RegExp conformance test +* +* These testcases are derived from the examples in the ECMA-262 Ed.3 spec +* scattered through section 15.10.2. +* +*/ +//----------------------------------------------------------------------------- + +var SECTION = "e15_10_2_1"; +var VERSION = ""; +var TITLE = "RegExp conformance test"; +var bug = "(none)"; + +startTest(); +writeHeaderToLog(SECTION + " " + TITLE); +var testcases = getTestCases(); +test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var status = ''; + var pattern = ''; + var string = ''; + var actualmatch = ''; + var expectedmatch = ''; + + status = inSection(1); + pattern = /a|ab/; + string = 'abc'; + actualmatch = string.match(pattern); + expectedmatch = Array('a'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(2); + pattern = /((a)|(ab))((c)|(bc))/; + string = 'abc'; + actualmatch = string.match(pattern); + expectedmatch = Array('abc', 'a', 'a', undefined, 'bc', undefined, 'bc'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(3); + pattern = /a[a-z]{2,4}/; + string = 'abcdefghi'; + actualmatch = string.match(pattern); + expectedmatch = Array('abcde'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(4); + pattern = /a[a-z]{2,4}?/; + string = 'abcdefghi'; + actualmatch = string.match(pattern); + expectedmatch = Array('abc'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(5); + pattern = /(aa|aabaac|ba|b|c)*/; + string = 'aabaac'; + actualmatch = string.match(pattern); + expectedmatch = Array('aaba', 'ba'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(6); + pattern = /^(a+)\1*,\1+$/; + string = 'aaaaaaaaaa,aaaaaaaaaaaaaaa'; + actualmatch = string.match(pattern); + expectedmatch = Array('aaaaaaaaaa,aaaaaaaaaaaaaaa', 'aaaaa'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(7); + pattern = /(z)((a+)?(b+)?(c))*/; + string = 'zaacbbbcac'; + actualmatch = string.match(pattern); + expectedmatch = Array('zaacbbbcac', 'z', 'ac', 'a', undefined, 'c'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(8); + pattern = /(a*)*/; + string = 'b'; + actualmatch = string.match(pattern); + expectedmatch = Array('', ""); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(9); + pattern = /(a*)b\1+/; + string = 'baaaac'; + actualmatch = string.match(pattern); + expectedmatch = Array('b', ''); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(10); + pattern = /(?=(a+))/; + string = 'baaabac'; + actualmatch = string.match(pattern); + expectedmatch = Array('', 'aaa'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(11); + pattern = /(?=(a+))a*b\1/; + string = 'baaabac'; + actualmatch = string.match(pattern); + expectedmatch = Array('aba', 'a'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(12); + pattern = /(.*?)a(?!(a+)b\2c)\2(.*)/; + string = 'baaabaac'; + actualmatch = string.match(pattern); + + expectedmatch = Array('baaabaac', 'ba', undefined, 'abaac'); + + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(13); + pattern = /(?=(a+))/; + string = 'baaabac'; + actualmatch = string.match(pattern); + expectedmatch = Array('', 'aaa'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/RegExp/e15_10_3_1_1.as b/mozilla/js/tamarin/test/ecma3/RegExp/e15_10_3_1_1.as new file mode 100644 index 00000000000..dd33c745626 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/RegExp/e15_10_3_1_1.as @@ -0,0 +1,144 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* +* The contents of this file are subject to the Netscape Public +* License Version 1.1 (the "License"); you may not use this file +* except in compliance with the License. You may obtain a copy of +* the License at http://www.mozilla.org/NPL/ +* +* Software distributed under the License is distributed on an "AS +* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or +* implied. See the License for the specific language governing +* rights and limitations under the License. +* +* The Original Code is mozilla.org code. +* +* The Initial Developer of the Original Code is Netscape +* Communications Corporation. Portions created by Netscape are +* Copyright (C) 1998 Netscape Communications Corporation. All +* Rights Reserved. +* +* Contributor(s): pschwartau@netscape.com +* Date: 26 November 2000 +* +* +* SUMMARY: Passing (RegExp object, flag) to RegExp() function. +* This test arose from Bugzilla bug 61266. The ECMA3 section is: +* +* 15.10.3 The RegExp Constructor Called as a Function +* +* 15.10.3.1 RegExp(pattern, flags) +* +* If pattern is an object R whose [[Class]] property is "RegExp" +* and flags is undefined, then return R unchanged. Otherwise +* call the RegExp constructor (section 15.10.4.1), passing it the +* pattern and flags arguments and return the object constructed +* by that constructor. +* +* +* The current test will check the first scenario outlined above: +* +* "pattern" is itself a RegExp object R +* "flags" is undefined +* +* The flags parameter will be undefined in the sense of not being +* provided. We check that RegExp(R) returns R - +*/ +//------------------------------------------------------------------------------------------------- + +var SECTION = "e15_10_3_1_1"; +var VERSION = ""; +var TITLE = "Passing (RegExp object,flag) to RegExp() function"; +var bug = "61266"; + +startTest(); +writeHeaderToLog(SECTION + " " + TITLE); +var testcases = getTestCases(); +test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var i = -1; var j = -1; var s = ''; var f = ''; + var obj = {}; var status = ''; var actual = ''; var expect = ''; + var patterns = new Array(); + var flags = new Array(); + var cnSUCCESS = 'RegExp() returned the supplied RegExp object'; + var cnFAILURE = 'RegExp() did NOT return the supplied RegExp object'; + + // various regular expressions to try - + patterns[0] = ''; + patterns[1] = 'abc'; + patterns[2] = '(.*)(3-1)\s\w'; + patterns[3] = '(.*)(...)\\s\\w'; + patterns[4] = '[^A-Za-z0-9_]'; + patterns[5] = '[^\f\n\r\t\v](123.5)([4 - 8]$)'; + + // various flags to try - + flags[0] = 'i'; + flags[1] = 'g'; + flags[2] = 'm'; + flags[3] = undefined; + + for (i in patterns) + { + s = patterns[i]; + for (j in flags) + { + f = flags[j]; + status = getStatus(s, f); + obj = new RegExp(s, f); + + actual = (obj == RegExp(obj))? cnSUCCESS : cnFAILURE; + expect = cnSUCCESS; + array[item++] = new TestCase(SECTION, status, expect, actual); + } + } + + + var statprefix = 'RegExp(new RegExp('; + var comma = ', '; + var singlequote = "'"; + var closeparens = '))'; + + function getStatus(regexp, flag) + { + return (statprefix + quote(regexp) + comma + flag + closeparens); + } + + function quote(text) + { + return (singlequote + text + singlequote); + } + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/RegExp/e15_10_3_1_2.as b/mozilla/js/tamarin/test/ecma3/RegExp/e15_10_3_1_2.as new file mode 100644 index 00000000000..41a24f2560f --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/RegExp/e15_10_3_1_2.as @@ -0,0 +1,157 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* +* The contents of this file are subject to the Netscape Public +* License Version 1.1 (the "License"); you may not use this file +* except in compliance with the License. You may obtain a copy of +* the License at http://www.mozilla.org/NPL/ +* +* Software distributed under the License is distributed on an "AS +* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or +* implied. See the License for the specific language governing +* rights and limitations under the License. +* +* The Original Code is mozilla.org code. +* +* The Initial Developer of the Original Code is Netscape +* Communications Corporation. Portions created by Netscape are +* Copyright (C) 1998 Netscape Communications Corporation. All +* Rights Reserved. +* +* Contributor(s): pschwartau@netscape.com +* Date: 26 November 2000 +* +* +* SUMMARY: Passing (RegExp object, flag) to RegExp() function. +* This test arose from Bugzilla bug 61266. The ECMA3 section is: +* +* 15.10.3 The RegExp Constructor Called as a Function +* +* 15.10.3.1 RegExp(pattern, flags) +* +* If pattern is an object R whose [[Class]] property is "RegExp" +* and flags is undefined, then return R unchanged. Otherwise +* call the RegExp constructor (section 15.10.4.1), passing it the +* pattern and flags arguments and return the object constructed +* by that constructor. +* +* +* The current test will check the first scenario outlined above: +* +* "pattern" is itself a RegExp object R +* "flags" is undefined +* +* This test is identical to test 15.10.3.1-1.js, except here we do: +* +* RegExp(R, undefined); +* +* instead of: +* +* RegExp(R); +* +* +* We check that RegExp(R, undefined) returns R - +*/ +//------------------------------------------------------------------------------------------------- + +var SECTION = "e15_10_3_1_2"; +var VERSION = ""; +var TITLE = "Passing (RegExp object,flag) to RegExp() function"; +var bug = "61266"; + +startTest(); +writeHeaderToLog(SECTION + " " + TITLE); +var testcases = getTestCases(); +test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var statprefix = 'RegExp(new RegExp('; + var comma = ', '; var singlequote = "'"; var closeparens = '))'; + var cnSUCCESS = 'RegExp() returned the supplied RegExp object'; + var cnFAILURE = 'RegExp() did NOT return the supplied RegExp object'; + var i = -1; var j = -1; var s = ''; var f = ''; + var obj = {}; + var status=''; var actual=''; var expect=''; + var patterns = new Array(); + var flags = new Array(); + + + // various regular expressions to try - + patterns[0] = ''; + patterns[1] = 'abc'; + patterns[2] = '(.*)(3-1)\s\w'; + patterns[3] = '(.*)(...)\\s\\w'; + patterns[4] = '[^A-Za-z0-9_]'; + patterns[5] = '[^\f\n\r\t\v](123.5)([4 - 8]$)'; + + // various flags to try - + flags[0] = 'i'; + flags[1] = 'g'; + flags[2] = 'm'; + flags[3] = undefined; + + + for (i in patterns) + { + s = patterns[i]; + + for (j in flags) + { + f = flags[j]; + status = getStatus(s, f); + obj = new RegExp(s, f); + + // this is incorrectly giving a TypeError... uncomment when bug 110188 is fixed + actual =(obj == RegExp(obj, undefined))? cnSUCCESS : cnFAILURE ; + expect = cnSUCCESS; + ////////////////////////////////// + + array[item++] = new TestCase(SECTION, status, expect, actual); + } + } + + + function getStatus(regexp, flag) + { + return (statprefix + quote(regexp) + comma + flag + closeparens); + } + + + function quote(text) + { + return (singlequote + text + singlequote); + } + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/RegExp/e15_10_4_1_1.as b/mozilla/js/tamarin/test/ecma3/RegExp/e15_10_4_1_1.as new file mode 100644 index 00000000000..a5a2633c3a2 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/RegExp/e15_10_4_1_1.as @@ -0,0 +1,164 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* +* The contents of this file are subject to the Netscape Public +* License Version 1.1 (the "License"); you may not use this file +* except in compliance with the License. You may obtain a copy of +* the License at http://www.mozilla.org/NPL/ +* +* Software distributed under the License is distributed on an "AS +* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or +* implied. See the License for the specific language governing +* rights and limitations under the License. +* +* The Original Code is mozilla.org code. +* +* The Initial Developer of the Original Code is Netscape +* Communications Corporation. Portions created by Netscape are +* Copyright (C) 1998 Netscape Communications Corporation. All +* Rights Reserved. +* +* Contributor(s): pschwartau@netscape.com +* Date: 26 November 2000 +* +* +*SUMMARY: Passing a RegExp object to a RegExp() constructor. +*This test arose from Bugzilla bug 61266. The ECMA3 section is: +* +* 15.10.4.1 new RegExp(pattern, flags) +* +* If pattern is an object R whose [[Class]] property is "RegExp" and +* flags is undefined, then let P be the pattern used to construct R +* and let F be the flags used to construct R. If pattern is an object R +* whose [[Class]] property is "RegExp" and flags is not undefined, +* then throw a TypeError exception. Otherwise, let P be the empty string +* if pattern is undefined and ToString(pattern) otherwise, and let F be +* the empty string if flags is undefined and ToString(flags) otherwise. +* +* +*The current test will check the first scenario outlined above: +* +* "pattern" is itself a RegExp object R +* "flags" is undefined +* +* We check that a new RegExp object obj2 defined from these parameters +* is morally the same as the original RegExp object obj1. Of course, they +* can't be equal as objects - so we check their enumerable properties... +* +* In this test, the initial RegExp object obj1 will not include a flag. The flags +* parameter for obj2 will be undefined in the sense of not being provided. +*/ +//------------------------------------------------------------------------------------------------- + +var SECTION = "e15_10_4_1_1"; +var VERSION = ""; +var TITLE = "Passing a RegExp object to a RegExp() constructor"; +var bug = "61266"; + +startTest(); +writeHeaderToLog(SECTION + " " + TITLE); +var testcases = getTestCases(); +test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var statprefix = 'Applying RegExp() twice to pattern '; + var statsuffix = '; testing property '; + var singlequote = "'"; + var i = -1; var s = ''; + var obj1 = null; var obj2 = null; + var status = ''; var actual = ''; var expect = ''; var msg = ''; + var patterns = new Array(); + + + // various regular expressions to try - + patterns[0] = ''; + patterns[1] = 'abc'; + patterns[2] = '(.*)(3-1)\s\w'; + patterns[3] = '(.*)(...)\\s\\w'; + patterns[4] = '[^A-Za-z0-9_]'; + patterns[5] = '[^\f\n\r\t\v](123.5)([4 - 8]$)'; + + + for (i in patterns) + { + s = patterns[i]; + status = getStatus(s); + obj1 = new RegExp(s); + obj2 = new RegExp(obj1); + + msg = status + quote("dotall"); + actual = obj2.dotall; + expect = obj1.dotall; + array[item++] = new TestCase(SECTION, msg, expect, actual); + + msg = status + quote("extended"); + actual = obj2.extended; + expect = obj1.extended; + array[item++] = new TestCase(SECTION, msg, expect, actual); + + msg = status + quote("ignoreCase"); + actual = obj2.ignoreCase; + expect = obj1.ignoreCase; + array[item++] = new TestCase(SECTION, msg, expect, actual); + + msg = status + quote("lastIndex"); + actual = obj2.lastIndex; + expect = obj1.lastIndex; + array[item++] = new TestCase(SECTION, msg, expect, actual); + + msg = status + quote("multiline"); + actual = obj2.multiline; + expect = obj1.multiline; + array[item++] = new TestCase(SECTION, msg, expect, actual); + + msg = status + quote("source"); + actual = obj2.source; + expect = obj1.source; + array[item++] = new TestCase(SECTION, msg, expect, actual); + } + + + function getStatus(regexp) + { + return (statprefix + quote(regexp) + statsuffix); + } + + + function quote(text) + { + return (singlequote + text + singlequote); + } + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/RegExp/e15_10_4_1_2.as b/mozilla/js/tamarin/test/ecma3/RegExp/e15_10_4_1_2.as new file mode 100644 index 00000000000..4e46e50c4d9 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/RegExp/e15_10_4_1_2.as @@ -0,0 +1,173 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* +* The contents of this file are subject to the Netscape Public +* License Version 1.1 (the "License"); you may not use this file +* except in compliance with the License. You may obtain a copy of +* the License at http://www.mozilla.org/NPL/ +* +* Software distributed under the License is distributed on an "AS +* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or +* implied. See the License for the specific language governing +* rights and limitations under the License. +* +* The Original Code is mozilla.org code. +* +* The Initial Developer of the Original Code is Netscape +* Communications Corporation. Portions created by Netscape are +* Copyright (C) 1998 Netscape Communications Corporation. All +* Rights Reserved. +* +* Contributor(s): pschwartau@netscape.com +* Date: 26 November 2000 +* +* +*SUMMARY: Passing a RegExp object to a RegExp() constructor. +*This test arose from Bugzilla bug 61266. The ECMA3 section is: +* +* 15.10.4.1 new RegExp(pattern, flags) +* +* If pattern is an object R whose [[Class]] property is "RegExp" and +* flags is undefined, then let P be the pattern used to construct R +* and let F be the flags used to construct R. If pattern is an object R +* whose [[Class]] property is "RegExp" and flags is not undefined, +* then throw a TypeError exception. Otherwise, let P be the empty string +* if pattern is undefined and ToString(pattern) otherwise, and let F be +* the empty string if flags is undefined and ToString(flags) otherwise. +* +* +*The current test will check the first scenario outlined above: +* +* "pattern" is itself a RegExp object R +* "flags" is undefined +* +* We check that a new RegExp object obj2 defined from these parameters +* is morally the same as the original RegExp object obj1. Of course, they +* can't be equal as objects - so we check their enumerable properties... +* +* In this test, the initial RegExp object obj1 will not include a flag. This test is +* identical to test 15.10.4.1-1.js, except that here we use this syntax: +* +* obj2 = new RegExp(obj1, undefined); +* +* instead of: +* +* obj2 = new RegExp(obj1); +*/ +//------------------------------------------------------------------------------------------------- + +var SECTION = "e15_10_4_1_2"; +var VERSION = ""; +var TITLE = "Passing a RegExp object to a RegExp() constructor"; +var bug = "61266"; + +startTest(); +writeHeaderToLog(SECTION + " " + TITLE); +var testcases = getTestCases(); +test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var statprefix = 'Applying RegExp() twice to pattern '; + var statsuffix = '; testing property '; + var singlequote = "'"; + var i = -1; var s = ''; + var obj1 = null; var obj2 = null; + var status = ''; var actual = ''; var expect = ''; var msg = ''; + var patterns = new Array(); + + + // various regular expressions to try - + patterns[0] = ''; + patterns[1] = 'abc'; + patterns[2] = '(.*)(3-1)\s\w'; + patterns[3] = '(.*)(...)\\s\\w'; + patterns[4] = '[^A-Za-z0-9_]'; + patterns[5] = '[^\f\n\r\t\v](123.5)([4 - 8]$)'; + + + // ********************************************** + // uncomment after 110188 is fixed + // ********************************************** + for (i in patterns) + { + s = patterns[i]; + status =getStatus(s); + obj1 = new RegExp(s); + obj2 = new RegExp(obj1, undefined); // see introduction to bug + + msg = status + quote("dotall"); + actual = obj2.dotall; + expect = obj1.dotall; + array[item++] = new TestCase(SECTION, msg, expect, actual); + + msg = status + quote("extended"); + actual = obj2.extended; + expect = obj1.extended; + array[item++] = new TestCase(SECTION, msg, expect, actual); + + msg = status + quote("ignoreCase"); + actual = obj2.ignoreCase; + expect = obj1.ignoreCase; + array[item++] = new TestCase(SECTION, msg, expect, actual); + + msg = status + quote("lastIndex"); + actual = obj2.lastIndex; + expect = obj1.lastIndex; + array[item++] = new TestCase(SECTION, msg, expect, actual); + + msg = status + quote("multiline"); + actual = obj2.multiline; + expect = obj1.multiline; + array[item++] = new TestCase(SECTION, msg, expect, actual); + + msg = status + quote("source"); + actual = obj2.source; + expect = obj1.source; + array[item++] = new TestCase(SECTION, msg, expect, actual); + } + + + function getStatus(regexp) + { + return (statprefix + quote(regexp) + statsuffix); + } + + + function quote(text) + { + return (singlequote + text + singlequote); + } + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/RegExp/e15_10_4_1_3.as b/mozilla/js/tamarin/test/ecma3/RegExp/e15_10_4_1_3.as new file mode 100644 index 00000000000..8e585e41f1f --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/RegExp/e15_10_4_1_3.as @@ -0,0 +1,177 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* +* The contents of this file are subject to the Netscape Public +* License Version 1.1 (the "License"); you may not use this file +* except in compliance with the License. You may obtain a copy of +* the License at http://www.mozilla.org/NPL/ +* +* Software distributed under the License is distributed on an "AS +* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or +* implied. See the License for the specific language governing +* rights and limitations under the License. +* +* The Original Code is mozilla.org code. +* +* The Initial Developer of the Original Code is Netscape +* Communications Corporation. Portions created by Netscape are +* Copyright (C) 1998 Netscape Communications Corporation. All +* Rights Reserved. +* +* Contributor(s): pschwartau@netscape.com +* Date: 26 November 2000 +* +* +*SUMMARY: Passing a RegExp object to a RegExp() constructor. +*This test arose from Bugzilla bug 61266. The ECMA3 section is: +* +* 15.10.4.1 new RegExp(pattern, flags) +* +* If pattern is an object R whose [[Class]] property is "RegExp" and +* flags is undefined, then let P be the pattern used to construct R +* and let F be the flags used to construct R. If pattern is an object R +* whose [[Class]] property is "RegExp" and flags is not undefined, +* then throw a TypeError exception. Otherwise, let P be the empty string +* if pattern is undefined and ToString(pattern) otherwise, and let F be +* the empty string if flags is undefined and ToString(flags) otherwise. +* +* +*The current test will check the first scenario outlined above: +* +* "pattern" is itself a RegExp object R +* "flags" is undefined +* +* We check that a new RegExp object obj2 defined from these parameters +* is morally the same as the original RegExp object obj1. Of course, they +* can't be equal as objects - so we check their enumerable properties... +* +* In this test, the initial RegExp obj1 will include a flag. The flags +* parameter for obj2 will be undefined in the sense of not being provided. +*/ +//------------------------------------------------------------------------------------------------- + +var SECTION = "e15_10_4_1_3"; +var VERSION = ""; +var TITLE = "Passing a RegExp object to a RegExp() constructor"; +var bug = "61266"; + +startTest(); +writeHeaderToLog(SECTION + " " + TITLE); +var testcases = getTestCases(); +test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var statprefix = 'Applying RegExp() twice to pattern '; + var statmiddle = ' and flag '; + var statsuffix = '; testing property '; + var singlequote = "'"; + var i = -1; var j = -1; var s = ''; + var obj1 = null; var obj2 = null; + var status = ''; var actual = ''; var expect = ''; var msg = ''; + var patterns = new Array(); + var flags = new Array(); + + + // various regular expressions to try - + patterns[0] = ''; + patterns[1] = 'abc'; + patterns[2] = '(.*)(3-1)\s\w'; + patterns[3] = '(.*)(...)\\s\\w'; + patterns[4] = '[^A-Za-z0-9_]'; + patterns[5] = '[^\f\n\r\t\v](123.5)([4 - 8]$)'; + + // various flags to try - + flags[0] = 'i'; + flags[1] = 'g'; + flags[2] = 'm'; + flags[3] = undefined; + + + for (i in patterns) + { + s = patterns[i]; + + for (j in flags) + { + f = flags[j]; + status = getStatus(s, f); + obj1 = new RegExp(s, f); + obj2 = new RegExp(obj1); + + msg = status + quote("dotall"); + actual = obj2.dotall; + expect = obj1.dotall; + array[item++] = new TestCase(SECTION, msg, expect, actual); + + msg = status + quote("extended"); + actual = obj2.extended; + expect = obj1.extended; + array[item++] = new TestCase(SECTION, msg, expect, actual); + + msg = status + quote("ignoreCase"); + actual = obj2.ignoreCase; + expect = obj1.ignoreCase; + array[item++] = new TestCase(SECTION, msg, expect, actual); + + msg = status + quote("lastIndex"); + actual = obj2.lastIndex; + expect = obj1.lastIndex; + array[item++] = new TestCase(SECTION, msg, expect, actual); + + msg = status + quote("multiline"); + actual = obj2.multiline; + expect = obj1.multiline; + array[item++] = new TestCase(SECTION, msg, expect, actual); + + msg = status + quote("source"); + actual = obj2.source; + expect = obj1.source; + array[item++] = new TestCase(SECTION, msg, expect, actual); + } + } + + + function getStatus(regexp, flag) + { + return (statprefix + quote(regexp) + statmiddle + flag + statsuffix); + } + + + function quote(text) + { + return (singlequote + text + singlequote); + } + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/RegExp/e15_10_4_1_4.as b/mozilla/js/tamarin/test/ecma3/RegExp/e15_10_4_1_4.as new file mode 100644 index 00000000000..77ae0de74bf --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/RegExp/e15_10_4_1_4.as @@ -0,0 +1,126 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* +* The contents of this file are subject to the Netscape Public +* License Version 1.1 (the "License"); you may not use this file +* except in compliance with the License. You may obtain a copy of +* the License at http://www.mozilla.org/NPL/ +* +* Software distributed under the License is distributed on an "AS +* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or +* implied. See the License for the specific language governing +* rights and limitations under the License. +* +* The Original Code is mozilla.org code. +* +* The Initial Developer of the Original Code is Netscape +* Communications Corporation. Portions created by Netscape are +* Copyright (C) 1998 Netscape Communications Corporation. All +* Rights Reserved. +* +* Contributor(s): pschwartau@netscape.com +* Date: 26 November 2000 +* +* +*SUMMARY: Passing a RegExp object to a RegExp() constructor. +*This test arose from Bugzilla bug 61266. The ECMA3 section is: +* +* 15.10.4.1 new RegExp(pattern, flags) +* +* If pattern is an object R whose [[Class]] property is "RegExp" and +* flags is undefined, then let P be the pattern used to construct R +* and let F be the flags used to construct R. If pattern is an object R +* whose [[Class]] property is "RegExp" and flags is not undefined, +* then throw a TypeError exception. Otherwise, let P be the empty string +* if pattern is undefined and ToString(pattern) otherwise, and let F be +* the empty string if flags is undefined and ToString(flags) otherwise. +* +* +*The current test will check the first scenario outlined above: +* +* "pattern" is itself a RegExp object R +* "flags" is undefined +* +* We check that a new RegExp object obj2 defined from these parameters +* is morally the same as the original RegExp object obj1. Of course, they +* can't be equal as objects - so we check their enumerable properties... +* +* In this test, the initial RegExp object obj1 will include a flag. This test is +* identical to test 15.10.4.1-3.js, except that here we use this syntax: +* +* obj2 = new RegExp(obj1, undefined); +* +* instead of: +* +* obj2 = new RegExp(obj1); +*/ +//------------------------------------------------------------------------------------------------- + +var SECTION = "e15_10_4_1_4"; +var VERSION = ""; +var TITLE = "Passing a RegExp object to a RegExp() constructor"; +var bug = "61266"; + +startTest(); +writeHeaderToLog(SECTION + " " + TITLE); +var testcases = getTestCases(); +test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var statprefix = 'Applying RegExp() twice to pattern '; + var statmiddle = ' and flag '; + var statsuffix = '; testing property '; + var singlequote = "'"; + var i = -1; var j = -1; var s = ''; + var obj1 = {}; var obj2 = {}; + var status = ''; var actual = ''; var expect = ''; var msg = ''; + var patterns = new Array(); + var flags = new Array(); + + + // various regular expressions to try - + patterns[0] = ''; + patterns[1] = 'abc'; + patterns[2] = '(.*)(3-1)\s\w'; + patterns[3] = '(.*)(...)\\s\\w'; + patterns[4] = '[^A-Za-z0-9_]'; + patterns[5] = '[^\f\n\r\t\v](123.5)([4 - 8]$)'; + + // various flags to try - + flags[0] = 'i'; + flags[1] = 'g'; + flags[2] = 'm'; + flags[3] = undefined; + + diff --git a/mozilla/js/tamarin/test/ecma3/RegExp/e15_10_4_1_5_rt.as b/mozilla/js/tamarin/test/ecma3/RegExp/e15_10_4_1_5_rt.as new file mode 100644 index 00000000000..b9046d37e40 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/RegExp/e15_10_4_1_5_rt.as @@ -0,0 +1,151 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* +* The contents of this file are subject to the Netscape Public +* License Version 1.1 (the "License"); you may not use this file +* except in compliance with the License. You may obtain a copy of +* the License at http://www.mozilla.org/NPL/ +* +* Software distributed under the License is distributed on an "AS +* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or +* implied. See the License for the specific language governing +* rights and limitations under the License. +* +* The Original Code is mozilla.org code. +* +* The Initial Developer of the Original Code is Netscape +* Communications Corporation. Portions created by Netscape are +* Copyright (C) 1998 Netscape Communications Corporation. All +* Rights Reserved. +* +* Contributor(s): pschwartau@netscape.com +* Date: 26 November 2000 +* +* +*SUMMARY: Passing a RegExp object to a RegExp() constructor. +*This test arose from Bugzilla bug 61266. The ECMA3 section is: +* +* 15.10.4.1 new RegExp(pattern, flags) +* +* If pattern is an object R whose [[Class]] property is "RegExp" and +* flags is undefined, then let P be the pattern used to construct R +* and let F be the flags used to construct R. If pattern is an object R +* whose [[Class]] property is "RegExp" and flags is not undefined, +* then throw a TypeError exception. Otherwise, let P be the empty string +* if pattern is undefined and ToString(pattern) otherwise, and let F be +* the empty string if flags is undefined and ToString(flags) otherwise. +* +* +*The current test will check the second scenario outlined above: +* +* "pattern" is itself a RegExp object R +* "flags" is NOT undefined +* +* This should throw an exception ... we test for this. +* +*/ +//------------------------------------------------------------------------------------------------- + +var SECTION = "e15_10_4_1_5_rt"; +var VERSION = ""; +var TITLE = "Negative test: Passing (RegExp object, flag) to RegExp() constructor"; +var bug = "61266"; + +startTest(); +writeHeaderToLog(SECTION + " " + TITLE); +var testcases = getTestCases(); +test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var statprefix = 'Passing RegExp object on pattern '; + var statsuffix = '; passing flag '; + var cnSUCCESS = 'Got expected exception -'; + var cnFAILURE = 'Expected an exception to be thrown, but none was -'; + var singlequote = "'"; + var i = -1; var j = -1; var s = ''; var f = ''; + var obj1 = null; var obj2 = null; + var patterns = new Array(); + var flags = new Array(); + var thisError = "no error"; + + // various regular expressions to try - + patterns[0] = ''; + patterns[1] = 'abc'; + patterns[2] = '(.*)(3-1)\s\w'; + patterns[3] = '(.*)(...)\\s\\w'; + patterns[4] = '[^A-Za-z0-9_]'; + patterns[5] = '[^\f\n\r\t\v](123.5)([4 - 8]$)'; + + // various flags to try - + flags[0] = 'i'; + flags[1] = 'g'; + flags[2] = 'm'; + + + for (i in patterns) + { + s = patterns[i]; + + for (j in flags) + { + f = flags[j]; + msg = getStatus(s, f); + expect = cnSUCCESS; + actual = ""; + obj1 = new RegExp(s, f); + try{ + obj2 = new RegExp(obj1, f); // this should cause an exception + actual = cnFAILURE; + }catch(e:Error){ + actual = cnSUCCESS; + }finally{ + array[item++] = new TestCase(SECTION, msg, expect, actual); + } + } + } + + + function getStatus(regexp, flag) + { + return (statprefix + quote(regexp) + statsuffix + flag); + } + + + function quote(text) + { + return (singlequote + text + singlequote); + } + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/RegExp/e15_10_6_1.as b/mozilla/js/tamarin/test/ecma3/RegExp/e15_10_6_1.as new file mode 100644 index 00000000000..1fdea4ffc59 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/RegExp/e15_10_6_1.as @@ -0,0 +1,50 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.10.6.1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "RegExp.prototype.constructor" + writeHeaderToLog( SECTION + TITLE ); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, + "( RegExp.prototype.constructor == RegExp )", + true , + (RegExp.prototype.constructor == RegExp) ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/RegExp/e15_10_6_2_1.as b/mozilla/js/tamarin/test/ecma3/RegExp/e15_10_6_2_1.as new file mode 100644 index 00000000000..019a3ddad22 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/RegExp/e15_10_6_2_1.as @@ -0,0 +1,131 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* +* The contents of this file are subject to the Netscape Public +* License Version 1.1 (the "License"); you may not use this file +* except in compliance with the License. You may obtain a copy of +* the License at http://www.mozilla.org/NPL/ +* +* Software distributed under the License is distributed on an "AS IS" +* basis, WITHOUT WARRANTY OF ANY KIND, either expressed +* or implied. See the License for the specific language governing +* rights and limitations under the License. +* +* The Original Code is mozilla.org code. +* +* The Initial Developer of the Original Code is Netscape +* Communications Corporation. Portions created by Netscape are +* Copyright (C) 1998 Netscape Communications Corporation. +* All Rights Reserved. +* +* Contributor(s): pschwartau@netscape.com +* Date: 23 October 2001 +* +* SUMMARY: Testing regexps with the global flag set. +* NOT every substring fitting the given pattern will be matched. +* The parent string is CONSUMED as successive matches are found. +* +* From the ECMA-262 Final spec: +* +* 15.10.6.2 RegExp.prototype.exec(string) +* Performs a regular expression match of string against the regular +* expression and returns an Array object containing the results of +* the match, or null if the string did not match. +* +* The string ToString(string) is searched for an occurrence of the +* regular expression pattern as follows: +* +* 1. Let S be the value of ToString(string). +* 2. Let length be the length of S. +* 3. Let lastIndex be the value of the lastIndex property. +* 4. Let i be the value of ToInteger(lastIndex). +* 5. If the global property is false, let i = 0. +* 6. If i < 0 or i > length then set lastIndex to 0 and return null. +* 7. Call [[Match]], giving it the arguments S and i. +* If [[Match]] returned failure, go to step 8; +* otherwise let r be its State result and go to step 10. +* 8. Let i = i+1. +* 9. Go to step 6. +* 10. Let e be r's endIndex value. +* 11. If the global property is true, set lastIndex to e. +* +* etc. +* +* +* So when the global flag is set, |lastIndex| is incremented every time +* there is a match; not from i to i+1, but from i to "endIndex" e: +* +* e = (index of last input character matched so far by the pattern) + 1 +* +* Thus in the example below, the first endIndex e occurs after the +* first match 'a b'. The next match will begin AFTER this, and so +* will NOT be 'b c', but rather 'c d'. Similarly, 'd e' won't be matched. +*/ +//----------------------------------------------------------------------------- + +var SECTION = "e15_10_6_2_1"; +var VERSION = ""; +var TITLE = "Testing regexps with the global flag set"; +var bug = "(none)"; + +startTest(); +writeHeaderToLog(SECTION + " " + TITLE); +var testcases = getTestCases(); +test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var status = ''; + var pattern = ''; + var string = ''; + var actualmatch = ''; + var expectedmatch = ''; + + + status = inSection(1); + string = 'a b c d e'; + pattern = /\w\s\w/g; + actualmatch = string.match(pattern); + expectedmatch = ['a b','c d']; // see above explanation - + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + + status = inSection(2); + string = '12345678'; + pattern = /\d\d\d/g; + actualmatch = string.match(pattern); + expectedmatch = ['123', '456']; + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/RegExp/e15_10_6_2_2.as b/mozilla/js/tamarin/test/ecma3/RegExp/e15_10_6_2_2.as new file mode 100644 index 00000000000..1ac4f0ff39a --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/RegExp/e15_10_6_2_2.as @@ -0,0 +1,370 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* ***** BEGIN LICENSE BLOCK ***** +* Version: NPL 1.1/GPL 2.0/LGPL 2.1 +* +* The contents of this file are subject to the Netscape Public License +* Version 1.1 (the "License"); you may not use this file except in +* compliance with the License. You may obtain a copy of the License at +* http://www.mozilla.org/NPL/ +* +* Software distributed under the License is distributed on an "AS IS" basis, +* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +* for the specific language governing rights and limitations under the +* License. +* +* The Original Code is JavaScript Engine testing utilities. +* +* The Initial Developer of the Original Code is Netscape Communications Corp. +* Portions created by the Initial Developer are Copyright (C) 2002 +* the Initial Developer. All Rights Reserved. +* +* Contributor(s): pschwartau@netscape.com +* +* Alternatively, the contents of this file may be used under the terms of +* either the GNU General Public License Version 2 or later (the "GPL"), or +* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +* in which case the provisions of the GPL or the LGPL are applicable instead +* of those above. If you wish to allow use of your version of this file only +* under the terms of either the GPL or the LGPL, and not to allow others to +* use your version of this file under the terms of the NPL, indicate your +* decision by deleting the provisions above and replace them with the notice +* and other provisions required by the GPL or the LGPL. If you do not delete +* the provisions above, a recipient may use your version of this file under +* the terms of any one of the NPL, the GPL or the LGPL. +* +* ***** END LICENSE BLOCK ***** +* +* +* Date: 18 Feb 2002 +* SUMMARY: Testing re.exec(str) when re.lastIndex is < 0 or > str.length +* +* Case 1: If re has the global flag set, then re(str) should be null +* Case 2: If re doesn't have this set, then re(str) should be unaffected +* +* See http://bugzilla.mozilla.org/show_bug.cgi?id=76717 +* +* +* From the ECMA-262 Final spec: +* +* 15.10.6.2 RegExp.prototype.exec(string) +* Performs a regular expression match of string against the regular +* expression and returns an Array object containing the results of +* the match, or null if the string did not match. +* +* The string ToString(string) is searched for an occurrence of the +* regular expression pattern as follows: +* +* 1. Let S be the value of ToString(string). +* 2. Let length be the length of S. +* 3. Let lastIndex be the value of the lastIndex property. +* 4. Let i be the value of ToInteger(lastIndex). +* 5. If the global property is false, let i = 0. +* 6. If i < 0 or i > length then set lastIndex to 0 and return null. +* 7. Call [[Match]], giving it the arguments S and i. +* If [[Match]] returned failure, go to step 8; +* otherwise let r be its State result and go to step 10. +* 8. Let i = i+1. +* 9. Go to step 6. +* 10. Let e be r's endIndex value. +* 11. If the global property is true, set lastIndex to e. +* +* etc. +* +* +* So: +* +* A. If the global flag is not set, |lastIndex| is set to 0 +* before the match is attempted; thus the match is unaffected. +* +* B. If the global flag IS set and re.lastIndex is >= 0 and <= str.length, +* |lastIndex| is incremented every time there is a match; not from +* i to i+1, but from i to "endIndex" e: +* +* e = (index of last input character matched so far by the pattern) + 1 +* +* The match is then attempted from this position in the string (Step 7). +* +* C. When the global flag IS set and re.lastIndex is < 0 or > str.length, +* |lastIndex| is set to 0 and the match returns null. +* +* +* Note the |lastIndex| property is writeable, and may be set arbitrarily +* by the programmer - and we will do that below. +* +*/ +//----------------------------------------------------------------------------- + +var SECTION = "e15_10_6_2_2"; +var VERSION = ""; +var TITLE = "Testing re.exec(str) when re.lastIndex is < 0 or > str.length"; +var bug = "76717"; + +startTest(); +writeHeaderToLog(SECTION + " " + TITLE); +var testcases = getTestCases(); +test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var status = ''; + var pattern = ''; + var string = ''; + var actualmatch = ''; + var expectedmatch = ''; + + + pattern = /abc/gi; + string = 'AbcaBcabC'; + + status = inSection(1); + actualmatch = pattern.exec(string); + expectedmatch = Array('Abc'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(2); + actualmatch = pattern.exec(string); + expectedmatch = Array('aBc'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(3); + actualmatch = pattern.exec(string); + expectedmatch = Array('abC'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + /* + * At this point |lastIndex| is > string.length, so the match should be null - + */ + status = inSection(4); + actualmatch = pattern.exec(string); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + /* + * Now let's set |lastIndex| to -1, so the match should again be null - + */ + status = inSection(5); + pattern.lastIndex = -1; + actualmatch = pattern.exec(string); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + /* + * Now try some edge-case values. Thanks to the work done in + * http://bugzilla.mozilla.org/show_bug.cgi?id=124339, |lastIndex| + * is now stored as a double instead of a uint32 (unsigned integer). + * + * Note 2^32 -1 is the upper bound for uint32's, but doubles can go + * all the way up to Number.MAX_VALUE. So that's why we need cases + * between those two numbers. + */ + /* + ***** leave commmented out until we decide the size of lastIndex ****** + + status = inSection(6); + pattern.lastIndex = Math.pow(2,32); + actualmatch = pattern.exec(string); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(7); + pattern.lastIndex = -Math.pow(2,32); + actualmatch = pattern.exec(string); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(8); + pattern.lastIndex = Math.pow(2,32) + 1; + actualmatch = pattern.exec(string); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(9); + pattern.lastIndex = -(Math.pow(2,32) + 1); + actualmatch = pattern.exec(string); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(10); + pattern.lastIndex = Math.pow(2,32) * 2; + actualmatch = pattern.exec(string); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(11); + pattern.lastIndex = -Math.pow(2,32) * 2; + actualmatch = pattern.exec(string); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(12); + pattern.lastIndex = Math.pow(2,40); + actualmatch = pattern.exec(string); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(13); + pattern.lastIndex = -Math.pow(2,40); + actualmatch = pattern.exec(string); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(14); + pattern.lastIndex = Number.MAX_VALUE; + actualmatch = pattern.exec(string); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(15); + pattern.lastIndex = -Number.MAX_VALUE; + actualmatch = pattern.exec(string); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + */ + + + + pattern = /abc/i; + string = 'AbcaBcabC'; + + /* status = inSection(16); + actualmatch = pattern.exec(string); + expectedmatch = Array('Abc'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(17); + actualmatch = pattern.exec(string); + expectedmatch = Array('Abc'); // NOT Array('aBc') as before - + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(18); + actualmatch = pattern.exec(string); + expectedmatch = Array('Abc'); // NOT Array('abC') as before - + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + */ + /* + * At this point above, |lastIndex| WAS > string.length, but not here - + */ + /* status = inSection(19); + actualmatch = pattern.exec(string); + expectedmatch = Array('Abc') // NOT null as before - + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + */ + /* + * Now let's set |lastIndex| to -1 + */ + /* status = inSection(20); + pattern.lastIndex = -1; + actualmatch = pattern.exec(string); + expectedmatch = Array('Abc') // NOT null as before - + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + */ + /* + * Now try some edge-case values. Thanks to the work done in + * http://bugzilla.mozilla.org/show_bug.cgi?id=124339, |lastIndex| + * is now stored as a double instead of a uint32 (unsigned integer). + * + * Note 2^32 -1 is the upper bound for uint32's, but doubles can go + * all the way up to Number.MAX_VALUE. So that's why we need cases + * between those two numbers. + */ + /* status = inSection(21); + pattern.lastIndex = Math.pow(2,32); + actualmatch = pattern.exec(string); + expectedmatch = Array('Abc') // NOT null as before - + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(22); + pattern.lastIndex = -Math.pow(2,32); + actualmatch = pattern.exec(string); + expectedmatch = Array('Abc') // NOT null as before - + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(23); + pattern.lastIndex = Math.pow(2,32) + 1; + actualmatch = pattern.exec(string); + expectedmatch = Array('Abc') // NOT null as before - + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(24); + pattern.lastIndex = -(Math.pow(2,32) + 1); + actualmatch = pattern.exec(string); + expectedmatch = Array('Abc') // NOT null as before - + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(25); + pattern.lastIndex = Math.pow(2,32) * 2; + actualmatch = pattern.exec(string); + expectedmatch = Array('Abc') // NOT null as before - + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(26); + pattern.lastIndex = -Math.pow(2,32) * 2; + actualmatch = pattern.exec(string); + expectedmatch = Array('Abc') // NOT null as before - + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(27); + pattern.lastIndex = Math.pow(2,40); + actualmatch = pattern.exec(string); + expectedmatch = Array('Abc') // NOT null as before -; + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(28); + pattern.lastIndex = -Math.pow(2,40); + actualmatch = pattern.exec(string); + expectedmatch = Array('Abc') // NOT null as before - + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(29); + pattern.lastIndex = Number.MAX_VALUE; + actualmatch = pattern.exec(string); + expectedmatch = Array('Abc') // NOT null as before - + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(30); + pattern.lastIndex = -Number.MAX_VALUE; + actualmatch = pattern.exec(string); + expectedmatch = Array('Abc') // NOT null as before - + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + */ + + // added from regress_24712 + status = inSection(31); + pattern = /([\S]+([ \t]+[\S]+)*)[ \t]*=[ \t]*[\S]+/; + actualmatch = pattern.exec("Course_Creator = Test"); + expectedmatch = ["Course_Creator = Test", "Course_Creator", undefined]; + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/RegExp/e15_10_6_3.as b/mozilla/js/tamarin/test/ecma3/RegExp/e15_10_6_3.as new file mode 100644 index 00000000000..7d91af3ee5d --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/RegExp/e15_10_6_3.as @@ -0,0 +1,165 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.10.6.3"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "RegExp.prototype.test(string)" + writeHeaderToLog( SECTION + TITLE ); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + var string = "mystring" + + array[item++] = new TestCase( SECTION, + "( RegExp.prototype.test(string) )", + true , + RegExp.prototype.test(string) ); + + var regexp = new RegExp("a|ab"); + var string = 'abc' + + array[item++] = new TestCase( SECTION, + "( RegExp.prototype.test(string) )", + true , + (regexp.test(string)) ); + + var regexp = new RegExp("d|ef"); + var string = 'abc' + + array[item++] = new TestCase( SECTION, + "( RegExp.prototype.test(string) )", + false , + (regexp.test(string)) ); + + + var pattern = /((a)|(ab))((c)|(bc))/; + var string = 'abc'; + + array[item++] = new TestCase( SECTION, + "( RegExp.prototype.test(string) )", + true , + (pattern.test(string)) ); + + var pattern = /a[a-z]{2,4}/; + var string = 'abcdefghi'; + + array[item++] = new TestCase( SECTION, + "( RegExp.prototype.test(string) )", + true , + (pattern.test(string)) ); + + var pattern = /a[a-z]{2,4}?/; + var string = 'abcdefghi'; + + array[item++] = new TestCase( SECTION, + "( RegExp.prototype.test(string) )", + true , + (pattern.test(string)) ); + + var pattern = /(aa|aabaac|ba|b|c)*/; + var string = 'aabaac'; + + array[item++] = new TestCase( SECTION, + "( RegExp.prototype.test(string) )", + true , + (pattern.test(string)) ); + + var pattern = /^(a+)\1*,\1+$/; + var string = 'aaaaaaaaaa,aaaaaaaaaaaaaaa'; + + array[item++] = new TestCase( SECTION, + "( RegExp.prototype.test(string) )", + true , + (pattern.test(string)) ); + + var pattern = /(z)((a+)?(b+)?(c))*/; + var string = 'zaacbbbcac'; + + array[item++] = new TestCase( SECTION, + "( RegExp.prototype.test(string) )", + true , + (pattern.test(string)) ); + + var pattern = /(a*)*/; + var string = 'b'; + + array[item++] = new TestCase( SECTION, + "( RegExp.prototype.test(string) )", + true , + (pattern.test(string)) ); + + var pattern = /(a*)b\1+/; + var string = 'baaaac'; + + array[item++] = new TestCase( SECTION, + "( RegExp.prototype.test(string) )", + true , + (pattern.test(string)) ); + + var pattern = /(?=(a+))/; + var string = 'baaabac'; + + array[item++] = new TestCase( SECTION, + "( RegExp.prototype.test(string) )", + true , + (pattern.test(string)) ); + + var pattern = /(?=(a+))a*b\1/; + var string = 'baaabac'; + + array[item++] = new TestCase( SECTION, + "( RegExp.prototype.test(string) )", + true , + (pattern.test(string)) ); + + + + + + var pattern = /(.*?)a(?!(a+)b\2c)\2(.*)/; + var string = 'baaabac'; + + array[item++] = new TestCase( SECTION, + "( RegExp.prototype.test(string) )", + true , + (pattern.test(string)) ); + + + + + + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/RegExp/e15_10_6_4.as b/mozilla/js/tamarin/test/ecma3/RegExp/e15_10_6_4.as new file mode 100644 index 00000000000..3cac791a5c1 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/RegExp/e15_10_6_4.as @@ -0,0 +1,199 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* ***** BEGIN LICENSE BLOCK ***** +* Version: NPL 1.1/GPL 2.0/LGPL 2.1 +* +* The contents of this file are subject to the Netscape Public License +* Version 1.1 (the "License"); you may not use this file except in +* compliance with the License. You may obtain a copy of the License at +* http://www.mozilla.org/NPL/ +* +* Software distributed under the License is distributed on an "AS IS" basis, +* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +* for the specific language governing rights and limitations under the +* License. +* +* The Original Code is JavaScript Engine testing utilities. +* +* The Initial Developer of the Original Code is Netscape Communications Corp. +* Portions created by the Initial Developer are Copyright (C) 2002 +* the Initial Developer. All Rights Reserved. +* +* Contributor(s): rogerl@netscape.com, pschwartau@netscape.com +* +* Alternatively, the contents of this file may be used under the terms of +* either the GNU General Public License Version 2 or later (the "GPL"), or +* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +* in which case the provisions of the GPL or the LGPL are applicable instead +* of those above. If you wish to allow use of your version of this file only +* under the terms of either the GPL or the LGPL, and not to allow others to +* use your version of this file under the terms of the NPL, indicate your +* decision by deleting the provisions above and replace them with the notice +* and other provisions required by the GPL or the LGPL. If you do not delete +* the provisions above, a recipient may use your version of this file under +* the terms of any one of the NPL, the GPL or the LGPL. +* +* ***** END LICENSE BLOCK ***** +* +* +* Date: 09 July 2002 +* SUMMARY: RegExp conformance test +* +* These testcases are derived from the examples in the ECMA-262 Ed.3 spec +* scattered through section 15.10.2. +* +*/ +//----------------------------------------------------------------------------- + +var SECTION = "e15_10_2_1"; +var VERSION = ""; +var TITLE = "RegExp conformance test"; +var bug = "(none)"; + +startTest(); +writeHeaderToLog(SECTION + " " + TITLE); +var testcases = getTestCases(); +test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var status = ''; + var pattern = ''; + var string = ''; + var actualmatch = ''; + var expectedmatch = ''; + + + status = inSection(1); + pattern = "a|ab"; + var regexp = new RegExp(pattern); + string = 'abc'; + var regexp2 = pattern.toString(); + actualmatch = string.match(regexp2); + expectedmatch = Array('a'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(2); + pattern = "((a)|(ab))((c)|(bc))"; + string = 'abc'; + var regexp = new RegExp(pattern); + regexp2 = pattern.toString(); + actualmatch = string.match(regexp2); + expectedmatch = Array('abc', 'a', 'a', undefined, 'bc', undefined, 'bc'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(3); + pattern = "a[a-z]{2,4}"; + var regexp = new RegExp(pattern); + string = 'abcdefghi'; + regexp2 = pattern.toString(); + actualmatch = string.match(regexp2); + expectedmatch = Array('abcde'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(4); + pattern = "a[a-z]{2,4}?"; + string = 'abcdefghi'; + var regexp = new RegExp(pattern); + regexp2 = pattern.toString(); + actualmatch = string.match(regexp2); + expectedmatch = Array('abc'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(5); + pattern = "(aa|aabaac|ba|b|c)*"; + var regexp = new RegExp(pattern); + string = 'aabaac'; + regexp2 = pattern.toString(); + actualmatch = string.match(regexp2); + expectedmatch = Array('aaba', 'ba'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + + + status = inSection(6); + pattern = "(z)((a+)?(b+)?(c))*"; + string = 'zaacbbbcac'; + regexp = pattern.toString(); + actualmatch = string.match(regexp); + expectedmatch = Array('zaacbbbcac', 'z', 'ac', 'a', undefined, 'c'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(7); + pattern = "(a*)*"; + string = 'b'; + regexp = pattern.toString(); + actualmatch = string.match(regexp); + expectedmatch = Array('', ""); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + + + status = inSection(8); + pattern = "(?=(a+))"; + string = 'baaabac'; + regexp = pattern.toString(); + actualmatch = string.match(regexp); + expectedmatch = Array('', 'aaa'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + + + status = inSection(9); + pattern = "(.*?)a(?!(a+)b\2c)\2(.*)"; + string = 'baaabaac'; + regexp = pattern.toString(); + actualmatch = string.match(regexp); + + /* This will need to be changed when bug 110184 is fixed + ////////////////////////////// + */ + + //expectedmatch = Array('baaabaac', 'ba', undefined, 'abaac'); + expectedmatch = null; + + /* + ////////////////////////////// + */ + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(10); + pattern = "(?=(a+))"; + string = 'baaabac'; + var regexp = pattern.toString(); + actualmatch = string.match(regexp); + expectedmatch = Array('', 'aaa'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/RegExp/econstructor_001.as b/mozilla/js/tamarin/test/ecma3/RegExp/econstructor_001.as new file mode 100644 index 00000000000..f722cc4d317 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/RegExp/econstructor_001.as @@ -0,0 +1,93 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "RegExp/constructor-001"; + var VERSION = "ECMA_2"; + var TITLE = "new RegExp()"; + + startTest(); + writeHeaderToLog(SECTION + " " + TITLE); + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + /* + * for each test case, verify: + * - verify that [[Class]] property is RegExp + * - prototype property should be set to RegExp.prototype + * - source is set to the empty string + * - global property is set to false + * - ignoreCase property is set to false + * - multiline property is set to false + * - lastIndex property is set to 0 + */ + + RegExp.prototype.getClassProperty = Object.prototype.toString; + var re = new RegExp(); + + array[item++] = new TestCase(SECTION, + "RegExp.prototype.getClassProperty = Object.prototype.toString; " + + "(new RegExp()).getClassProperty()", + "[object RegExp]", + re.getClassProperty() ); + + array[item++] = new TestCase(SECTION, + "(new RegExp()).source", + "", + re.source ); + + array[item++] = new TestCase(SECTION, + "(new RegExp()).global", + false, + re.global ); + + array[item++] = new TestCase(SECTION, + "(new RegExp()).ignoreCase", + false, + re.ignoreCase ); + + array[item++] = new TestCase(SECTION, + "(new RegExp()).multiline", + false, + re.multiline ); + + array[item++] = new TestCase(SECTION, + "(new RegExp()).lastIndex", + 0, + re.lastIndex ); + + //restore + delete RegExp.prototype.getClassProperty; + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/RegExp/eexec_001.as b/mozilla/js/tamarin/test/ecma3/RegExp/eexec_001.as new file mode 100644 index 00000000000..65ac1c8915b --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/RegExp/eexec_001.as @@ -0,0 +1,64 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "RegExp/exec-001"; +var VERSION = "ECMA_2"; +var TITLE = "RegExp.prototype.exec(string)"; + +startTest(); +writeHeaderToLog(SECTION + " " + TITLE); +var testcases = getTestCases(); +test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + /* + * for each test case, verify: + * - type of object returned + * - length of the returned array + * - value of lastIndex + * - value of index + * - value of input + * - value of the array indices + */ + + // test cases without subpatterns + // test cases with subpatterns + // global property is true + // global property is false + // test cases in which the exec returns null + + array[item++] = new TestCase(SECTION, "NO TESTS EXIST", "PASSED", "PASSED"); + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/RegExp/eexec_002.as b/mozilla/js/tamarin/test/ecma3/RegExp/eexec_002.as new file mode 100644 index 00000000000..91bb0bc3c5f --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/RegExp/eexec_002.as @@ -0,0 +1,212 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +var SECTION = "RegExp/exec-002"; +var VERSION = "ECMA_2"; +var TITLE = "RegExp.prototype.exec(string)"; + +startTest(); +writeHeaderToLog(SECTION + " " + TITLE); +var testcases = getTestCases(); +test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + /* + * for each test case, verify: + * - type of object returned + * - length of the returned array + * - value of lastIndex + * - value of index + * - value of input + * - value of the array indices + */ + + AddRegExpCases( + /(a|d|q|)x/i, + "bcaDxqy", + 3, + ["Dx", "D"] ); + + AddRegExpCases( + /(a|(e|q))(x|y)/, + "bcaddxqy", + 6, + ["qy","q","q","y"] ); + + + AddRegExpCases( + /a+b+d/, + "aabbeeaabbs", + 0, + null ); + + AddRegExpCases( + /a*b/, + "aaadaabaaa", + 4, + ["aab"] ); + + AddRegExpCases( + /a*b/, + "dddb", + 3, + ["b"] ); + + AddRegExpCases( + /a*b/, + "xxx", + 0, + null ); + + AddRegExpCases( + /x\d\dy/, + "abcx45ysss235", + 3, + ["x45y"] ); + + AddRegExpCases( + /[^abc]def[abc]+/, + "abxdefbb", + 2, + ["xdefbb"] ); + + AddRegExpCases( + /(a*)baa/, + "ccdaaabaxaabaa", + 9, + ["aabaa", "aa"] ); + + AddRegExpCases( + /(a*)baa/, + "aabaa", + 0, + ["aabaa", "aa"] ); + + AddRegExpCases( + /q(a|b)*q/, + "xxqababqyy", + 2, + ["qababq", "b"] ); + + AddRegExpCases( + /(a(.|[^d])c)*/, + "adcaxc", + 0, + ["adcaxc", "axc", "x"] ); + + AddRegExpCases( + /(a*)b\1/, + "abaaaxaabaayy", + 0, + ["aba", "a"] ); + + AddRegExpCases( + /(a*)b\1/, + "abaaaxaabaayy", + 0, + ["aba", "a"] ); + + AddRegExpCases( + /(a*)b\1/, + "cccdaaabaxaabaayy", + 6, + ["aba", "a"] ); + + AddRegExpCases( + /(a*)b\1/, + "cccdaaabqxaabaayy", + 7, + ["b", ""] ); + + AddRegExpCases( + /"(.|[^"\\\\])*"/, + 'xx\"makudonarudo\"yy', + 2, + ["\"makudonarudo\"", "o"] ); + + AddRegExpCases( + /"(.|[^"\\\\])*"/, + "xx\"ma\"yy", + 2, + ["\"ma\"", "a"] ); + + + function AddRegExpCases( + regexp, pattern, index, matches_array ) { + + // prevent a runtime error + + if ( regexp.exec(pattern) == null || matches_array == null ) { + array[item++] = new TestCase(SECTION, + regexp + ".exec(" + pattern +")", + matches_array, + regexp.exec(pattern) ); + + return; + } + array[item++] = new TestCase(SECTION, + regexp + ".exec(" + pattern +").length", + matches_array.length, + regexp.exec(pattern).length ); + + array[item++] = new TestCase(SECTION, + regexp + ".exec(" + pattern +").index", + index, + regexp.exec(pattern).index ); + + array[item++] = new TestCase(SECTION, + regexp + ".exec(" + pattern +").input", + pattern, + regexp.exec(pattern).input ); + + array[item++] = new TestCase(SECTION, + regexp + ".exec(" + pattern +").toString()", + matches_array.toString(), + regexp.exec(pattern).toString() ); + /* + var limit = matches_array.length > regexp.exec(pattern).length + ? matches_array.length + : regexp.exec(pattern).length; + + for ( var matches = 0; matches < limit; matches++ ) { + array[item++] = new TestCase(SECTION, + regexp + ".exec(" + pattern +")[" + matches +"]", + matches_array[matches], + regexp.exec(pattern)[matches] ); + } + */ + } + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/RegExp/efunction_001.as b/mozilla/js/tamarin/test/ecma3/RegExp/efunction_001.as new file mode 100644 index 00000000000..525af7d047e --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/RegExp/efunction_001.as @@ -0,0 +1,99 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "RegExp/function-001"; + var VERSION = "ECMA_2"; + var TITLE = "RegExp( pattern, flags )"; + + startTest(); + writeHeaderToLog(SECTION + " " + TITLE); + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + /* + * for each test case, verify: + * - verify that [[Class]] property is RegExp + * - prototype property should be set to RegExp.prototype + * - source is set to the empty string + * - global property is set to false + * - ignoreCase property is set to false + * - multiline property is set to false + * - lastIndex property is set to 0 + */ + + RegExp.prototype.getClassProperty = Object.prototype.toString; + var re = new RegExp(); + + /*array[item++] = new TestCase(SECTION, + "new RegExp().constructor.prototype", + RegExp.prototype, + re.constructor.prototype + );*/ + + array[item++] = new TestCase(SECTION, + "RegExp.prototype.getClassProperty = Object.prototype.toString; " + + "(new RegExp()).getClassProperty()", + "[object RegExp]", + re.getClassProperty() ); + + array[item++] = new TestCase(SECTION, + "(new RegExp()).source", + "", + re.source ); + + array[item++] = new TestCase(SECTION, + "(new RegExp()).global", + false, + re.global ); + + array[item++] = new TestCase(SECTION, + "(new RegExp()).ignoreCase", + false, + re.ignoreCase ); + + array[item++] = new TestCase(SECTION, + "(new RegExp()).multiline", + false, + re.multiline ); + + array[item++] = new TestCase(SECTION, + "(new RegExp()).lastIndex", + 0, + re.lastIndex ); + + //restore + delete RegExp.prototype.getClassProperty; + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/RegExp/ehex_001.as b/mozilla/js/tamarin/test/ecma3/RegExp/ehex_001.as new file mode 100644 index 00000000000..532fb87a3b1 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/RegExp/ehex_001.as @@ -0,0 +1,95 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "RegExp/hex-001"; + var VERSION = "ECMA_2"; + var TITLE = "RegExp patterns that contain HexicdecimalEscapeSequences"; + + startTest(); + writeHeaderToLog(SECTION + " " + TITLE); + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // These examples come from 15.7.1, HexidecimalEscapeSequence + + + AddRegExpCases( new RegExp("\x41"), "new RegExp('\\x41')", "A", "A", 1, 0, ["A"] ); + AddRegExpCases( new RegExp("\x412"),"new RegExp('\\x412')", "A2", "A2", 1, 0, ["A2"] ); + AddRegExpCases( new RegExp("\x1g"), "new RegExp('\\x1g')", "x1g","x1g", 1, 0, ["x1g"] ); + + AddRegExpCases( new RegExp("A"), "new RegExp('A')", "\x41", "\\x41", 1, 0, ["A"] ); + AddRegExpCases( new RegExp("A"), "new RegExp('A')", "\x412", "\\x412", 1, 0, ["A"] ); + AddRegExpCases( new RegExp("^x"), "new RegExp('^x')", "x412", "x412", 1, 0, ["x"]); + AddRegExpCases( new RegExp("A"), "new RegExp('A')", "A2", "A2", 1, 0, ["A"] ); + + + function AddRegExpCases( + regexp, str_regexp, pattern, str_pattern, length, index, matches_array ) { + + // prevent a runtime error + + if ( regexp.exec(pattern) == null || matches_array == null ) { + /*array[item++] = new TestCase(SECTION, + str_regexp + ".exec(" + pattern +")", + matches_array, + regexp.exec(pattern) ); + */ + return; + } + + array[item++] = new TestCase(SECTION, + str_regexp + ".exec(" + str_pattern +").length", + length, + regexp.exec(pattern).length ); + + array[item++] = new TestCase(SECTION, + str_regexp + ".exec(" + str_pattern +").index", + index, + regexp.exec(pattern).index ); + + array[item++] = new TestCase(SECTION, + str_regexp + ".exec(" + str_pattern +").input", + pattern, + regexp.exec(pattern).input ); + + for ( var matches = 0; matches < matches_array.length; matches++ ) { + array[item++] = new TestCase(SECTION, + str_regexp + ".exec(" + str_pattern +")[" + matches +"]", + matches_array[matches], + regexp.exec(pattern)[matches] ); + } + } + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/RegExp/emultiline_001.as b/mozilla/js/tamarin/test/ecma3/RegExp/emultiline_001.as new file mode 100644 index 00000000000..877bd026402 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/RegExp/emultiline_001.as @@ -0,0 +1,93 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "RegExp/multiline-001"; + var VERSION = "ECMA_2"; + var TITLE = "RegExp: multiline flag"; + var BUGNUMBER="343901"; + + startTest(); + writeHeaderToLog(SECTION + " " + TITLE); + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var woodpeckers = "ivory-billed\ndowny\nhairy\nacorn\nyellow-bellied sapsucker\n" + + "northern flicker\npileated\n"; + + AddRegExpCases( /.*[y]$/m, woodpeckers, woodpeckers.indexOf("downy"), ["downy"] ); + + AddRegExpCases( /.*[d]$/m, woodpeckers, woodpeckers.indexOf("ivory-billed"), ["ivory-billed"] ); + + + function AddRegExpCases + ( regexp, pattern, index, matches_array ) { + + // prevent a runtime error + + if ( regexp.exec(pattern) == null || matches_array == null ) { + array[item++] = new TestCase(SECTION, + regexp + ".exec(" + pattern +")", + matches_array, + regexp.exec(pattern) ); + + return; + } + + array[item++] = new TestCase(SECTION, + regexp.toString() + ".exec(" + pattern +").length", + matches_array.length, + regexp.exec(pattern).length ); + + array[item++] = new TestCase(SECTION, + regexp.toString() + ".exec(" + pattern +").index", + index, + regexp.exec(pattern).index ); + + array[item++] = new TestCase(SECTION, + regexp + ".exec(" + pattern +").input", + pattern, + regexp.exec(pattern).input ); + + + for ( var matches = 0; matches < matches_array.length; matches++ ) { + array[item++] = new TestCase(SECTION, + regexp + ".exec(" + pattern +")[" + matches +"]", + matches_array[matches], + regexp.exec(pattern)[matches] ); + } + } + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/RegExp/eoctal_001.as b/mozilla/js/tamarin/test/ecma3/RegExp/eoctal_001.as new file mode 100644 index 00000000000..dbf3521ce6e --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/RegExp/eoctal_001.as @@ -0,0 +1,143 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* ***** BEGIN LICENSE BLOCK ***** +* Version: NPL 1.1/GPL 2.0/LGPL 2.1 +* +* The contents of this file are subject to the Netscape Public License +* Version 1.1 (the "License"); you may not use this file except in +* compliance with the License. You may obtain a copy of the License at +* http://www.mozilla.org/NPL/ +* +* Software distributed under the License is distributed on an "AS IS" basis, +* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +* for the specific language governing rights and limitations under the +* License. +* +* The Original Code is JavaScript Engine testing utilities. +* +* The Initial Developer of the Original Code is Netscape Communications Corp. +* Portions created by the Initial Developer are Copyright (C) 2002 +* the Initial Developer. All Rights Reserved. +* +* Contributor(s): pschwartau@netscape.com +* +* Alternatively, the contents of this file may be used under the terms of +* either the GNU General Public License Version 2 or later (the "GPL"), or +* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +* in which case the provisions of the GPL or the LGPL are applicable instead +* of those above. If you wish to allow use of your version of this file only +* under the terms of either the GPL or the LGPL, and not to allow others to +* use your version of this file under the terms of the NPL, indicate your +* decision by deleting the provisions above and replace them with the notice +* and other provisions required by the GPL or the LGPL. If you do not delete +* the provisions above, a recipient may use your version of this file under +* the terms of any one of the NPL, the GPL or the LGPL. +* +* ***** END LICENSE BLOCK ***** +* +* +* Date: 18 July 2002 +* SUMMARY: Testing octal sequences in regexps +* See http://bugzilla.mozilla.org/show_bug.cgi?id=141078 +* +*/ +//----------------------------------------------------------------------------- + +var SECTION = "eoctal_001"; +var VERSION = ""; +var TITLE = "Testing octal sequences in regexps"; +var bug = "141078"; + +startTest(); +writeHeaderToLog(SECTION + " " + TITLE); +var testcases = getTestCases(); +test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var status = ''; + var pattern = ''; + var string = ''; + var actualmatch = ''; + var expectedmatch = ''; + + + status = inSection(1); + pattern = /\240/; + string = 'abc'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + /* + * In the following sections, we test the octal escape sequence '\052'. + * This is character code 42, representing the asterisk character '*'. + * The Unicode escape for it would be '\u002A', the hex escape '\x2A'. + */ + status = inSection(2); + pattern = /ab\052c/; + string = 'ab*c'; + actualmatch = string.match(pattern); + expectedmatch = Array('ab*c'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(3); + pattern = /ab\052*c/; + string = 'abc'; + actualmatch = string.match(pattern); + expectedmatch = Array('abc'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(4); + pattern = /ab(\052)+c/; + string = 'ab****c'; + actualmatch = string.match(pattern); + expectedmatch = Array('ab****c', '*'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(5); + pattern = /ab((\052)+)c/; + string = 'ab****c'; + actualmatch = string.match(pattern); + expectedmatch = Array('ab****c', '****', '*'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(6); + pattern = /(?:\052)c/; + string = 'ab****c'; + actualmatch = string.match(pattern); + expectedmatch = Array('*c'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/RegExp/eoctal_003.as b/mozilla/js/tamarin/test/ecma3/RegExp/eoctal_003.as new file mode 100644 index 00000000000..57c04ee7e35 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/RegExp/eoctal_003.as @@ -0,0 +1,95 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "RegExp/octal-003.js"; + var VERSION = "ECMA_2"; + var TITLE = "RegExp patterns that contain OctalEscapeSequences"; + var BUGNUMBER="http://scopus/bugsplat/show_bug.cgi?id=346132"; + +startTest(); +writeHeaderToLog(SECTION + " " + TITLE); +var testcases = getTestCases(); +test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + AddRegExpCases( /.\011/, "/\\011/", "a" + String.fromCharCode(0) + "11", "a\\011", 0, null ); + + + function AddRegExpCases( + regexp, str_regexp, pattern, str_pattern, index, matches_array ) { + + // prevent a runtime error + + if ( regexp.exec(pattern) == null || matches_array == null ) { + array[item++] = new TestCase(SECTION, + regexp + ".exec(" + str_pattern +")", + matches_array, + regexp.exec(pattern) ); + + return; + } + array[item++] = new TestCase(SECTION, + str_regexp + ".exec(" + str_pattern +").length", + matches_array.length, + regexp.exec(pattern).length ); + + array[item++] = new TestCase(SECTION, + str_regexp + ".exec(" + str_pattern +").index", + index, + regexp.exec(pattern).index ); + + array[item++] = new TestCase(SECTION, + str_regexp + ".exec(" + str_pattern +").input", + escape(pattern), + escape(regexp.exec(pattern).input) ); + + array[item++] = new TestCase(SECTION, + str_regexp + ".exec(" + str_pattern +").toString()", + matches_array.toString(), + escape(regexp.exec(pattern).toString()) ); + + var limit = matches_array.length > regexp.exec(pattern).length + ? matches_array.length + : regexp.exec(pattern).length; + + for ( var matches = 0; matches < limit; matches++ ) { + array[item++] = new TestCase(SECTION, + str_regexp + ".exec(" + str_pattern +")[" + matches +"]", + matches_array[matches], + escape(regexp.exec(pattern)[matches]) ); + } + + } + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/RegExp/eperlstress_001.as b/mozilla/js/tamarin/test/ecma3/RegExp/eperlstress_001.as new file mode 100644 index 00000000000..c3660f5cdf7 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/RegExp/eperlstress_001.as @@ -0,0 +1,3227 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* ***** BEGIN LICENSE BLOCK ***** +* Version: NPL 1.1/GPL 2.0/LGPL 2.1 +* +* The contents of this file are subject to the Netscape Public License +* Version 1.1 (the "License"); you may not use this file except in +* compliance with the License. You may obtain a copy of the License at +* http://www.mozilla.org/NPL/ +* +* Software distributed under the License is distributed on an "AS IS" basis, +* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +* for the specific language governing rights and limitations under the +* License. +* +* The Original Code is JavaScript Engine testing utilities. +* +* The Initial Developer of the Original Code is Netscape Communications Corp. +* Portions created by the Initial Developer are Copyright (C) 2002 +* the Initial Developer. All Rights Reserved. +* +* Contributor(s): pschwartau@netscape.com, rogerl@netscape.com +* +* Alternatively, the contents of this file may be used under the terms of +* either the GNU General Public License Version 2 or later (the "GPL"), or +* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +* in which case the provisions of the GPL or the LGPL are applicable instead +* of those above. If you wish to allow use of your version of this file only +* under the terms of either the GPL or the LGPL, and not to allow others to +* use your version of this file under the terms of the NPL, indicate your +* decision by deleting the provisions above and replace them with the notice +* and other provisions required by the GPL or the LGPL. If you do not delete +* the provisions above, a recipient may use your version of this file under +* the terms of any one of the NPL, the GPL or the LGPL. +* +* ***** END LICENSE BLOCK ***** +* +* +* Date: 2002-07-07 +* SUMMARY: Testing JS RegExp engine against Perl 5 RegExp engine. +* Adjust cnLBOUND, cnUBOUND below to restrict which sections are tested. +* +* This test was created by running various patterns and strings through the +* Perl 5 RegExp engine. We saved the results below to test the JS engine. +* +* NOTE: ECMA/JS and Perl do differ on certain points. We have either commented +* out such sections altogether, or modified them to fit what we expect from JS. +* +* EXAMPLES: +* +* - In JS, regexp captures (/(a) etc./) must hold |undefined| if not used. +* See http://bugzilla.mozilla.org/show_bug.cgi?id=123437. +* By contrast, in Perl, unmatched captures hold the empty string. +* We have modified such sections accordingly. Example: + + pattern = /^([^a-z])|(\^)$/; + string = '.'; + actualmatch = string.match(pattern); + //expectedmatch = Array('.', '.', ''); <<<--- Perl + expectedmatch = Array('.', '.', undefined); <<<--- JS + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + +* - In JS, you can't refer to a capture before it's encountered & completed +* +* - Perl supports ] & ^] inside a [], ECMA does not +* +* - ECMA does support (?: (?= and (?! operators, but doesn't support (?< etc. +* +* - ECMA doesn't support (?imsx or (?-imsx +* +* - ECMA doesn't support (?(condition) +* +* - Perl has \Z has end-of-line, ECMA doesn't +* +* - In ECMA, ^ matches only the empty string before the first character +* +* - In ECMA, $ matches only the empty string at end of input (unless multiline) +* +* - ECMA spec says that each atom in a range must be a single character +* +* - ECMA doesn't support \A +* +* - ECMA doesn't have rules for [: +* +*/ +//----------------------------------------------------------------------------- + +var SECTION = "eperlstress_001"; +var VERSION = ""; +var TITLE = "Testing regular expression edge cases"; +var bug = "85721"; + +startTest(); +writeHeaderToLog(SECTION + " " + TITLE); +var testcases = getTestCases(); +test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var status = ''; + var pattern = ''; + var string = ''; + var actualmatch = ''; + var expectedmatch = ''; + + + status = inSection(1); + pattern = /abc/; + string = 'abc'; + actualmatch = string.match(pattern); + expectedmatch = Array('abc'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(2); + pattern = /abc/; + string = 'xabcy'; + actualmatch = string.match(pattern); + expectedmatch = Array('abc'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(3); + pattern = /abc/; + string = 'ababc'; + actualmatch = string.match(pattern); + expectedmatch = Array('abc'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(4); + pattern = /ab*c/; + string = 'abc'; + actualmatch = string.match(pattern); + expectedmatch = Array('abc'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(5); + pattern = /ab*bc/; + string = 'abc'; + actualmatch = string.match(pattern); + expectedmatch = Array('abc'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(6); + pattern = /ab*bc/; + string = 'abbc'; + actualmatch = string.match(pattern); + expectedmatch = Array('abbc'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(7); + pattern = /ab*bc/; + string = 'abbbbc'; + actualmatch = string.match(pattern); + expectedmatch = Array('abbbbc'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(8); + pattern = /.{1}/; + string = 'abbbbc'; + actualmatch = string.match(pattern); + expectedmatch = Array('a'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(9); + pattern = /.{3,4}/; + string = 'abbbbc'; + actualmatch = string.match(pattern); + expectedmatch = Array('abbb'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(10); + pattern = /ab{0,}bc/; + string = 'abbbbc'; + actualmatch = string.match(pattern); + expectedmatch = Array('abbbbc'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(11); + pattern = /ab+bc/; + string = 'abbc'; + actualmatch = string.match(pattern); + expectedmatch = Array('abbc'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(12); + pattern = /ab+bc/; + string = 'abbbbc'; + actualmatch = string.match(pattern); + expectedmatch = Array('abbbbc'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(13); + pattern = /ab{1,}bc/; + string = 'abbbbc'; + actualmatch = string.match(pattern); + expectedmatch = Array('abbbbc'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(14); + pattern = /ab{1,3}bc/; + string = 'abbbbc'; + actualmatch = string.match(pattern); + expectedmatch = Array('abbbbc'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(15); + pattern = /ab{3,4}bc/; + string = 'abbbbc'; + actualmatch = string.match(pattern); + expectedmatch = Array('abbbbc'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(16); + pattern = /ab?bc/; + string = 'abbc'; + actualmatch = string.match(pattern); + expectedmatch = Array('abbc'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(17); + pattern = /ab?bc/; + string = 'abc'; + actualmatch = string.match(pattern); + expectedmatch = Array('abc'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(18); + pattern = /ab{0,1}bc/; + string = 'abc'; + actualmatch = string.match(pattern); + expectedmatch = Array('abc'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(19); + pattern = /ab?c/; + string = 'abc'; + actualmatch = string.match(pattern); + expectedmatch = Array('abc'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(20); + pattern = /ab{0,1}c/; + string = 'abc'; + actualmatch = string.match(pattern); + expectedmatch = Array('abc'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(21); + pattern = /^abc$/; + string = 'abc'; + actualmatch = string.match(pattern); + expectedmatch = Array('abc'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(22); + pattern = /^abc/; + string = 'abcc'; + actualmatch = string.match(pattern); + expectedmatch = Array('abc'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(23); + pattern = /abc$/; + string = 'aabc'; + actualmatch = string.match(pattern); + expectedmatch = Array('abc'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(24); + pattern = /^/; + string = 'abc'; + actualmatch = string.match(pattern); + expectedmatch = Array(''); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(25); + pattern = /$/; + string = 'abc'; + actualmatch = string.match(pattern); + expectedmatch = Array(''); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(26); + pattern = /a.c/; + string = 'abc'; + actualmatch = string.match(pattern); + expectedmatch = Array('abc'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(27); + pattern = /a.c/; + string = 'axc'; + actualmatch = string.match(pattern); + expectedmatch = Array('axc'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(28); + pattern = /a.*c/; + string = 'axyzc'; + actualmatch = string.match(pattern); + expectedmatch = Array('axyzc'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(29); + pattern = /a[bc]d/; + string = 'abd'; + actualmatch = string.match(pattern); + expectedmatch = Array('abd'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(30); + pattern = /a[b-d]e/; + string = 'ace'; + actualmatch = string.match(pattern); + expectedmatch = Array('ace'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(31); + pattern = /a[b-d]/; + string = 'aac'; + actualmatch = string.match(pattern); + expectedmatch = Array('ac'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(32); + pattern = /a[-b]/; + string = 'a-'; + actualmatch = string.match(pattern); + expectedmatch = Array('a-'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(33); + pattern = /a[b-]/; + string = 'a-'; + actualmatch = string.match(pattern); + expectedmatch = Array('a-'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(34); + pattern = /a]/; + string = 'a]'; + actualmatch = string.match(pattern); + expectedmatch = Array('a]'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + /* Perl supports ] & ^] inside a [], ECMA does not + pattern = /a[]]b/; + status = inSection(35); + string = 'a]b'; + actualmatch = string.match(pattern); + expectedmatch = Array('a]b'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + */ + + status = inSection(36); + pattern = /a[^bc]d/; + string = 'aed'; + actualmatch = string.match(pattern); + expectedmatch = Array('aed'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(37); + pattern = /a[^-b]c/; + string = 'adc'; + actualmatch = string.match(pattern); + expectedmatch = Array('adc'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + /* Perl supports ] & ^] inside a [], ECMA does not + status = inSection(38); + pattern = /a[^]b]c/; + string = 'adc'; + actualmatch = string.match(pattern); + expectedmatch = Array('adc'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + */ + + status = inSection(39); + pattern = /\ba\b/; + string = 'a-'; + actualmatch = string.match(pattern); + expectedmatch = Array('a'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(40); + pattern = /\ba\b/; + string = '-a'; + actualmatch = string.match(pattern); + expectedmatch = Array('a'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(41); + pattern = /\ba\b/; + string = '-a-'; + actualmatch = string.match(pattern); + expectedmatch = Array('a'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(42); + pattern = /\By\b/; + string = 'xy'; + actualmatch = string.match(pattern); + expectedmatch = Array('y'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(43); + pattern = /\by\B/; + string = 'yz'; + actualmatch = string.match(pattern); + expectedmatch = Array('y'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(44); + pattern = /\By\B/; + string = 'xyz'; + actualmatch = string.match(pattern); + expectedmatch = Array('y'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(45); + pattern = /\w/; + string = 'a'; + actualmatch = string.match(pattern); + expectedmatch = Array('a'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(46); + pattern = /\W/; + string = '-'; + actualmatch = string.match(pattern); + expectedmatch = Array('-'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(47); + pattern = /a\Sb/; + string = 'a-b'; + actualmatch = string.match(pattern); + expectedmatch = Array('a-b'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(48); + pattern = /\d/; + string = '1'; + actualmatch = string.match(pattern); + expectedmatch = Array('1'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(49); + pattern = /\D/; + string = '-'; + actualmatch = string.match(pattern); + expectedmatch = Array('-'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(50); + pattern = /[\w]/; + string = 'a'; + actualmatch = string.match(pattern); + expectedmatch = Array('a'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(51); + pattern = /[\W]/; + string = '-'; + actualmatch = string.match(pattern); + expectedmatch = Array('-'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(52); + pattern = /a[\S]b/; + string = 'a-b'; + actualmatch = string.match(pattern); + expectedmatch = Array('a-b'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(53); + pattern = /[\d]/; + string = '1'; + actualmatch = string.match(pattern); + expectedmatch = Array('1'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(54); + pattern = /[\D]/; + string = '-'; + actualmatch = string.match(pattern); + expectedmatch = Array('-'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(55); + pattern = /ab|cd/; + string = 'abc'; + actualmatch = string.match(pattern); + expectedmatch = Array('ab'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(56); + pattern = /ab|cd/; + string = 'abcd'; + actualmatch = string.match(pattern); + expectedmatch = Array('ab'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(57); + pattern = /()ef/; + string = 'def'; + actualmatch = string.match(pattern); + expectedmatch = Array('ef', ''); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(58); + pattern = /a\(b/; + string = 'a(b'; + actualmatch = string.match(pattern); + expectedmatch = Array('a(b'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(59); + pattern = /a\(*b/; + string = 'ab'; + actualmatch = string.match(pattern); + expectedmatch = Array('ab'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(60); + pattern = /a\(*b/; + string = 'a((b'; + actualmatch = string.match(pattern); + expectedmatch = Array('a((b'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(61); + pattern = /a\\b/; + string = 'a\\b'; + actualmatch = string.match(pattern); + expectedmatch = Array('a\\b'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(62); + pattern = /((a))/; + string = 'abc'; + actualmatch = string.match(pattern); + expectedmatch = Array('a', 'a', 'a'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(63); + pattern = /(a)b(c)/; + string = 'abc'; + actualmatch = string.match(pattern); + expectedmatch = Array('abc', 'a', 'c'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(64); + pattern = /a+b+c/; + string = 'aabbabc'; + actualmatch = string.match(pattern); + expectedmatch = Array('abc'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(65); + pattern = /a{1,}b{1,}c/; + string = 'aabbabc'; + actualmatch = string.match(pattern); + expectedmatch = Array('abc'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(66); + pattern = /a.+?c/; + string = 'abcabc'; + actualmatch = string.match(pattern); + expectedmatch = Array('abc'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(67); + pattern = /(a+|b)*/; + string = 'ab'; + actualmatch = string.match(pattern); + expectedmatch = Array('ab', 'b'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(68); + pattern = /(a+|b){0,}/; + string = 'ab'; + actualmatch = string.match(pattern); + expectedmatch = Array('ab', 'b'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(69); + pattern = /(a+|b)+/; + string = 'ab'; + actualmatch = string.match(pattern); + expectedmatch = Array('ab', 'b'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(70); + pattern = /(a+|b){1,}/; + string = 'ab'; + actualmatch = string.match(pattern); + expectedmatch = Array('ab', 'b'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(71); + pattern = /(a+|b)?/; + string = 'ab'; + actualmatch = string.match(pattern); + expectedmatch = Array('a', 'a'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(72); + pattern = /(a+|b){0,1}/; + string = 'ab'; + actualmatch = string.match(pattern); + expectedmatch = Array('a', 'a'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(73); + pattern = /[^ab]*/; + string = 'cde'; + actualmatch = string.match(pattern); + expectedmatch = Array('cde'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(74); + pattern = /([abc])*d/; + string = 'abbbcd'; + actualmatch = string.match(pattern); + expectedmatch = Array('abbbcd', 'c'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(75); + pattern = /([abc])*bcd/; + string = 'abcd'; + actualmatch = string.match(pattern); + expectedmatch = Array('abcd', 'a'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(76); + pattern = /a|b|c|d|e/; + string = 'e'; + actualmatch = string.match(pattern); + expectedmatch = Array('e'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(77); + pattern = /(a|b|c|d|e)f/; + string = 'ef'; + actualmatch = string.match(pattern); + expectedmatch = Array('ef', 'e'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(78); + pattern = /abcd*efg/; + string = 'abcdefg'; + actualmatch = string.match(pattern); + expectedmatch = Array('abcdefg'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(79); + pattern = /ab*/; + string = 'xabyabbbz'; + actualmatch = string.match(pattern); + expectedmatch = Array('ab'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(80); + pattern = /ab*/; + string = 'xayabbbz'; + actualmatch = string.match(pattern); + expectedmatch = Array('a'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(81); + pattern = /(ab|cd)e/; + string = 'abcde'; + actualmatch = string.match(pattern); + expectedmatch = Array('cde', 'cd'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(82); + pattern = /[abhgefdc]ij/; + string = 'hij'; + actualmatch = string.match(pattern); + expectedmatch = Array('hij'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(83); + pattern = /(abc|)ef/; + string = 'abcdef'; + actualmatch = string.match(pattern); + expectedmatch = Array('ef', ''); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(84); + pattern = /(a|b)c*d/; + string = 'abcd'; + actualmatch = string.match(pattern); + expectedmatch = Array('bcd', 'b'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(85); + pattern = /(ab|ab*)bc/; + string = 'abc'; + actualmatch = string.match(pattern); + expectedmatch = Array('abc', 'a'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(86); + pattern = /a([bc]*)c*/; + string = 'abc'; + actualmatch = string.match(pattern); + expectedmatch = Array('abc', 'bc'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(87); + pattern = /a([bc]*)(c*d)/; + string = 'abcd'; + actualmatch = string.match(pattern); + expectedmatch = Array('abcd', 'bc', 'd'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(88); + pattern = /a([bc]+)(c*d)/; + string = 'abcd'; + actualmatch = string.match(pattern); + expectedmatch = Array('abcd', 'bc', 'd'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(89); + pattern = /a([bc]*)(c+d)/; + string = 'abcd'; + actualmatch = string.match(pattern); + expectedmatch = Array('abcd', 'b', 'cd'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(90); + pattern = /a[bcd]*dcdcde/; + string = 'adcdcde'; + actualmatch = string.match(pattern); + expectedmatch = Array('adcdcde'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(91); + pattern = /(ab|a)b*c/; + string = 'abc'; + actualmatch = string.match(pattern); + expectedmatch = Array('abc', 'ab'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(92); + pattern = /((a)(b)c)(d)/; + string = 'abcd'; + actualmatch = string.match(pattern); + expectedmatch = Array('abcd', 'abc', 'a', 'b', 'd'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(93); + pattern = /[a-zA-Z_][a-zA-Z0-9_]*/; + string = 'alpha'; + actualmatch = string.match(pattern); + expectedmatch = Array('alpha'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(94); + pattern = /^a(bc+|b[eh])g|.h$/; + string = 'abh'; + actualmatch = string.match(pattern); + expectedmatch = Array('bh', undefined); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(95); + pattern = /(bc+d$|ef*g.|h?i(j|k))/; + string = 'effgz'; + actualmatch = string.match(pattern); + + expectedmatch = Array('effgz', 'effgz', undefined); + + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(96); + pattern = /(bc+d$|ef*g.|h?i(j|k))/; + string = 'ij'; + actualmatch = string.match(pattern); + expectedmatch = Array('ij', 'ij', 'j'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(97); + pattern = /(bc+d$|ef*g.|h?i(j|k))/; + string = 'reffgz'; + actualmatch = string.match(pattern); + + expectedmatch = Array('effgz', 'effgz', undefined); + + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(98); + pattern = /((((((((((a))))))))))/; + string = 'a'; + actualmatch = string.match(pattern); + expectedmatch = Array('a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(99); + pattern = /((((((((((a))))))))))\10/; + string = 'aa'; + actualmatch = string.match(pattern); + expectedmatch = Array('aa', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(100); + pattern = /((((((((((a))))))))))/; + string = 'a!'; + actualmatch = string.match(pattern); + expectedmatch = Array('a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(101); + pattern = /(((((((((a)))))))))/; + string = 'a'; + actualmatch = string.match(pattern); + expectedmatch = Array('a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(102); + pattern = /(.*)c(.*)/; + string = 'abcde'; + actualmatch = string.match(pattern); + expectedmatch = Array('abcde', 'ab', 'de'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(103); + pattern = /abcd/; + string = 'abcd'; + actualmatch = string.match(pattern); + expectedmatch = Array('abcd'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(104); + pattern = /a(bc)d/; + string = 'abcd'; + actualmatch = string.match(pattern); + expectedmatch = Array('abcd', 'bc'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(105); + pattern = /a[-]?c/; + string = 'ac'; + actualmatch = string.match(pattern); + expectedmatch = Array('ac'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(106); + pattern = /(abc)\1/; + string = 'abcabc'; + actualmatch = string.match(pattern); + expectedmatch = Array('abcabc', 'abc'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(107); + pattern = /([a-c]*)\1/; + string = 'abcabc'; + actualmatch = string.match(pattern); + expectedmatch = Array('abcabc', 'abc'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(108); + pattern = /(a)|\1/; + string = 'a'; + actualmatch = string.match(pattern); + expectedmatch = Array('a', 'a'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(109); + pattern = /(([a-c])b*?\2)*/; + string = 'ababbbcbc'; + actualmatch = string.match(pattern); + expectedmatch = Array('ababb', 'bb', 'b'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(110); + pattern = /(([a-c])b*?\2){3}/; + string = 'ababbbcbc'; + actualmatch = string.match(pattern); + expectedmatch = Array('ababbbcbc', 'cbc', 'c'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + /* Can't refer to a capture before it's encountered & completed + status = inSection(111); + pattern = /((\3|b)\2(a)x)+/; + string = 'aaaxabaxbaaxbbax'; + actualmatch = string.match(pattern); + expectedmatch = Array('bbax', 'bbax', 'b', 'a'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(112); + pattern = /((\3|b)\2(a)){2,}/; + string = 'bbaababbabaaaaabbaaaabba'; + actualmatch = string.match(pattern); + expectedmatch = Array('bbaaaabba', 'bba', 'b', 'a'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + */ + + status = inSection(113); + pattern = /abc/i; + string = 'ABC'; + actualmatch = string.match(pattern); + expectedmatch = Array('ABC'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(114); + pattern = /abc/i; + string = 'XABCY'; + actualmatch = string.match(pattern); + expectedmatch = Array('ABC'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(115); + pattern = /abc/i; + string = 'ABABC'; + actualmatch = string.match(pattern); + expectedmatch = Array('ABC'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(116); + pattern = /ab*c/i; + string = 'ABC'; + actualmatch = string.match(pattern); + expectedmatch = Array('ABC'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(117); + pattern = /ab*bc/i; + string = 'ABC'; + actualmatch = string.match(pattern); + expectedmatch = Array('ABC'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(118); + pattern = /ab*bc/i; + string = 'ABBC'; + actualmatch = string.match(pattern); + expectedmatch = Array('ABBC'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(119); + pattern = /ab*?bc/i; + string = 'ABBBBC'; + actualmatch = string.match(pattern); + expectedmatch = Array('ABBBBC'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(120); + pattern = /ab{0,}?bc/i; + string = 'ABBBBC'; + actualmatch = string.match(pattern); + expectedmatch = Array('ABBBBC'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(121); + pattern = /ab+?bc/i; + string = 'ABBC'; + actualmatch = string.match(pattern); + expectedmatch = Array('ABBC'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(122); + pattern = /ab+bc/i; + string = 'ABBBBC'; + actualmatch = string.match(pattern); + expectedmatch = Array('ABBBBC'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(123); + pattern = /ab{1,}?bc/i; + string = 'ABBBBC'; + actualmatch = string.match(pattern); + expectedmatch = Array('ABBBBC'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(124); + pattern = /ab{1,3}?bc/i; + string = 'ABBBBC'; + actualmatch = string.match(pattern); + expectedmatch = Array('ABBBBC'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(125); + pattern = /ab{3,4}?bc/i; + string = 'ABBBBC'; + actualmatch = string.match(pattern); + expectedmatch = Array('ABBBBC'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(126); + pattern = /ab??bc/i; + string = 'ABBC'; + actualmatch = string.match(pattern); + expectedmatch = Array('ABBC'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(127); + pattern = /ab??bc/i; + string = 'ABC'; + actualmatch = string.match(pattern); + expectedmatch = Array('ABC'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(128); + pattern = /ab{0,1}?bc/i; + string = 'ABC'; + actualmatch = string.match(pattern); + expectedmatch = Array('ABC'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(129); + pattern = /ab??c/i; + string = 'ABC'; + actualmatch = string.match(pattern); + expectedmatch = Array('ABC'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(130); + pattern = /ab{0,1}?c/i; + string = 'ABC'; + actualmatch = string.match(pattern); + expectedmatch = Array('ABC'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(131); + pattern = /^abc$/i; + string = 'ABC'; + actualmatch = string.match(pattern); + expectedmatch = Array('ABC'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(132); + pattern = /^abc/i; + string = 'ABCC'; + actualmatch = string.match(pattern); + expectedmatch = Array('ABC'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(133); + pattern = /abc$/i; + string = 'AABC'; + actualmatch = string.match(pattern); + expectedmatch = Array('ABC'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(134); + pattern = /^/i; + string = 'ABC'; + actualmatch = string.match(pattern); + expectedmatch = Array(''); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(135); + pattern = /$/i; + string = 'ABC'; + actualmatch = string.match(pattern); + expectedmatch = Array(''); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(136); + pattern = /a.c/i; + string = 'ABC'; + actualmatch = string.match(pattern); + expectedmatch = Array('ABC'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(137); + pattern = /a.c/i; + string = 'AXC'; + actualmatch = string.match(pattern); + expectedmatch = Array('AXC'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(138); + pattern = /a.*?c/i; + string = 'AXYZC'; + actualmatch = string.match(pattern); + expectedmatch = Array('AXYZC'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(139); + pattern = /a[bc]d/i; + string = 'ABD'; + actualmatch = string.match(pattern); + expectedmatch = Array('ABD'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(140); + pattern = /a[b-d]e/i; + string = 'ACE'; + actualmatch = string.match(pattern); + expectedmatch = Array('ACE'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(141); + pattern = /a[b-d]/i; + string = 'AAC'; + actualmatch = string.match(pattern); + expectedmatch = Array('AC'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(142); + pattern = /a[-b]/i; + string = 'A-'; + actualmatch = string.match(pattern); + expectedmatch = Array('A-'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(143); + pattern = /a[b-]/i; + string = 'A-'; + actualmatch = string.match(pattern); + expectedmatch = Array('A-'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(144); + pattern = /a]/i; + string = 'A]'; + actualmatch = string.match(pattern); + expectedmatch = Array('A]'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + /* Perl supports ] & ^] inside a [], ECMA does not + status = inSection(145); + pattern = /a[]]b/i; + string = 'A]B'; + actualmatch = string.match(pattern); + expectedmatch = Array('A]B'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + */ + + status = inSection(146); + pattern = /a[^bc]d/i; + string = 'AED'; + actualmatch = string.match(pattern); + expectedmatch = Array('AED'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(147); + pattern = /a[^-b]c/i; + string = 'ADC'; + actualmatch = string.match(pattern); + expectedmatch = Array('ADC'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + /* Perl supports ] & ^] inside a [], ECMA does not + status = inSection(148); + pattern = /a[^]b]c/i; + string = 'ADC'; + actualmatch = string.match(pattern); + expectedmatch = Array('ADC'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + */ + + status = inSection(149); + pattern = /ab|cd/i; + string = 'ABC'; + actualmatch = string.match(pattern); + expectedmatch = Array('AB'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(150); + pattern = /ab|cd/i; + string = 'ABCD'; + actualmatch = string.match(pattern); + expectedmatch = Array('AB'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(151); + pattern = /()ef/i; + string = 'DEF'; + actualmatch = string.match(pattern); + expectedmatch = Array('EF', ''); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(152); + pattern = /a\(b/i; + string = 'A(B'; + actualmatch = string.match(pattern); + expectedmatch = Array('A(B'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(153); + pattern = /a\(*b/i; + string = 'AB'; + actualmatch = string.match(pattern); + expectedmatch = Array('AB'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(154); + pattern = /a\(*b/i; + string = 'A((B'; + actualmatch = string.match(pattern); + expectedmatch = Array('A((B'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(155); + pattern = /a\\b/i; + string = 'A\\B'; + actualmatch = string.match(pattern); + expectedmatch = Array('A\\B'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(156); + pattern = /((a))/i; + string = 'ABC'; + actualmatch = string.match(pattern); + expectedmatch = Array('A', 'A', 'A'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(157); + pattern = /(a)b(c)/i; + string = 'ABC'; + actualmatch = string.match(pattern); + expectedmatch = Array('ABC', 'A', 'C'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(158); + pattern = /a+b+c/i; + string = 'AABBABC'; + actualmatch = string.match(pattern); + expectedmatch = Array('ABC'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(159); + pattern = /a{1,}b{1,}c/i; + string = 'AABBABC'; + actualmatch = string.match(pattern); + expectedmatch = Array('ABC'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(160); + pattern = /a.+?c/i; + string = 'ABCABC'; + actualmatch = string.match(pattern); + expectedmatch = Array('ABC'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(161); + pattern = /a.*?c/i; + string = 'ABCABC'; + actualmatch = string.match(pattern); + expectedmatch = Array('ABC'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(162); + pattern = /a.{0,5}?c/i; + string = 'ABCABC'; + actualmatch = string.match(pattern); + expectedmatch = Array('ABC'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(163); + pattern = /(a+|b)*/i; + string = 'AB'; + actualmatch = string.match(pattern); + expectedmatch = Array('AB', 'B'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(164); + pattern = /(a+|b){0,}/i; + string = 'AB'; + actualmatch = string.match(pattern); + expectedmatch = Array('AB', 'B'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(165); + pattern = /(a+|b)+/i; + string = 'AB'; + actualmatch = string.match(pattern); + expectedmatch = Array('AB', 'B'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(166); + pattern = /(a+|b){1,}/i; + string = 'AB'; + actualmatch = string.match(pattern); + expectedmatch = Array('AB', 'B'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(167); + pattern = /(a+|b)?/i; + string = 'AB'; + actualmatch = string.match(pattern); + expectedmatch = Array('A', 'A'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(168); + pattern = /(a+|b){0,1}/i; + string = 'AB'; + actualmatch = string.match(pattern); + expectedmatch = Array('A', 'A'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(169); + pattern = /(a+|b){0,1}?/i; + string = 'AB'; + actualmatch = string.match(pattern); + + expectedmatch = Array('', undefined); + + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(170); + pattern = /[^ab]*/i; + string = 'CDE'; + actualmatch = string.match(pattern); + expectedmatch = Array('CDE'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(171); + pattern = /([abc])*d/i; + string = 'ABBBCD'; + actualmatch = string.match(pattern); + expectedmatch = Array('ABBBCD', 'C'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(172); + pattern = /([abc])*bcd/i; + string = 'ABCD'; + actualmatch = string.match(pattern); + expectedmatch = Array('ABCD', 'A'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(173); + pattern = /a|b|c|d|e/i; + string = 'E'; + actualmatch = string.match(pattern); + expectedmatch = Array('E'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(174); + pattern = /(a|b|c|d|e)f/i; + string = 'EF'; + actualmatch = string.match(pattern); + expectedmatch = Array('EF', 'E'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(175); + pattern = /abcd*efg/i; + string = 'ABCDEFG'; + actualmatch = string.match(pattern); + expectedmatch = Array('ABCDEFG'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(176); + pattern = /ab*/i; + string = 'XABYABBBZ'; + actualmatch = string.match(pattern); + expectedmatch = Array('AB'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(177); + pattern = /ab*/i; + string = 'XAYABBBZ'; + actualmatch = string.match(pattern); + expectedmatch = Array('A'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(178); + pattern = /(ab|cd)e/i; + string = 'ABCDE'; + actualmatch = string.match(pattern); + expectedmatch = Array('CDE', 'CD'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(179); + pattern = /[abhgefdc]ij/i; + string = 'HIJ'; + actualmatch = string.match(pattern); + expectedmatch = Array('HIJ'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(180); + pattern = /(abc|)ef/i; + string = 'ABCDEF'; + actualmatch = string.match(pattern); + expectedmatch = Array('EF', ''); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(181); + pattern = /(a|b)c*d/i; + string = 'ABCD'; + actualmatch = string.match(pattern); + expectedmatch = Array('BCD', 'B'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(182); + pattern = /(ab|ab*)bc/i; + string = 'ABC'; + actualmatch = string.match(pattern); + expectedmatch = Array('ABC', 'A'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(183); + pattern = /a([bc]*)c*/i; + string = 'ABC'; + actualmatch = string.match(pattern); + expectedmatch = Array('ABC', 'BC'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(184); + pattern = /a([bc]*)(c*d)/i; + string = 'ABCD'; + actualmatch = string.match(pattern); + expectedmatch = Array('ABCD', 'BC', 'D'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(185); + pattern = /a([bc]+)(c*d)/i; + string = 'ABCD'; + actualmatch = string.match(pattern); + expectedmatch = Array('ABCD', 'BC', 'D'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(186); + pattern = /a([bc]*)(c+d)/i; + string = 'ABCD'; + actualmatch = string.match(pattern); + expectedmatch = Array('ABCD', 'B', 'CD'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(187); + pattern = /a[bcd]*dcdcde/i; + string = 'ADCDCDE'; + actualmatch = string.match(pattern); + expectedmatch = Array('ADCDCDE'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(188); + pattern = /(ab|a)b*c/i; + string = 'ABC'; + actualmatch = string.match(pattern); + expectedmatch = Array('ABC', 'AB'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(189); + pattern = /((a)(b)c)(d)/i; + string = 'ABCD'; + actualmatch = string.match(pattern); + expectedmatch = Array('ABCD', 'ABC', 'A', 'B', 'D'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(190); + pattern = /[a-zA-Z_][a-zA-Z0-9_]*/i; + string = 'ALPHA'; + actualmatch = string.match(pattern); + expectedmatch = Array('ALPHA'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(191); + pattern = /^a(bc+|b[eh])g|.h$/i; + string = 'ABH'; + actualmatch = string.match(pattern); + expectedmatch = Array('BH', undefined); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(192); + pattern = /(bc+d$|ef*g.|h?i(j|k))/i; + string = 'EFFGZ'; + actualmatch = string.match(pattern); + + expectedmatch = Array('EFFGZ', 'EFFGZ', undefined); + + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(193); + pattern = /(bc+d$|ef*g.|h?i(j|k))/i; + string = 'IJ'; + actualmatch = string.match(pattern); + expectedmatch = Array('IJ', 'IJ', 'J'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(194); + pattern = /(bc+d$|ef*g.|h?i(j|k))/i; + string = 'REFFGZ'; + actualmatch = string.match(pattern); + + expectedmatch = Array('EFFGZ', 'EFFGZ', undefined); + + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(195); + pattern = /((((((((((a))))))))))/i; + string = 'A'; + actualmatch = string.match(pattern); + expectedmatch = Array('A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(196); + pattern = /((((((((((a))))))))))\10/i; + string = 'AA'; + actualmatch = string.match(pattern); + expectedmatch = Array('AA', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(197); + pattern = /((((((((((a))))))))))/i; + string = 'A!'; + actualmatch = string.match(pattern); + expectedmatch = Array('A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(198); + pattern = /(((((((((a)))))))))/i; + string = 'A'; + actualmatch = string.match(pattern); + expectedmatch = Array('A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(199); + pattern = /(?:(?:(?:(?:(?:(?:(?:(?:(?:(a))))))))))/i; + string = 'A'; + actualmatch = string.match(pattern); + expectedmatch = Array('A', 'A'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(200); + pattern = /(?:(?:(?:(?:(?:(?:(?:(?:(?:(a|b|c))))))))))/i; + string = 'C'; + actualmatch = string.match(pattern); + expectedmatch = Array('C', 'C'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(201); + pattern = /(.*)c(.*)/i; + string = 'ABCDE'; + actualmatch = string.match(pattern); + expectedmatch = Array('ABCDE', 'AB', 'DE'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(202); + pattern = /abcd/i; + string = 'ABCD'; + actualmatch = string.match(pattern); + expectedmatch = Array('ABCD'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(203); + pattern = /a(bc)d/i; + string = 'ABCD'; + actualmatch = string.match(pattern); + expectedmatch = Array('ABCD', 'BC'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(204); + pattern = /a[-]?c/i; + string = 'AC'; + actualmatch = string.match(pattern); + expectedmatch = Array('AC'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(205); + pattern = /(abc)\1/i; + string = 'ABCABC'; + actualmatch = string.match(pattern); + expectedmatch = Array('ABCABC', 'ABC'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(206); + pattern = /([a-c]*)\1/i; + string = 'ABCABC'; + actualmatch = string.match(pattern); + expectedmatch = Array('ABCABC', 'ABC'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(207); + pattern = /a(?!b)./; + string = 'abad'; + actualmatch = string.match(pattern); + expectedmatch = Array('ad'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(208); + pattern = /a(?=d)./; + string = 'abad'; + actualmatch = string.match(pattern); + expectedmatch = Array('ad'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(209); + pattern = /a(?=c|d)./; + string = 'abad'; + actualmatch = string.match(pattern); + expectedmatch = Array('ad'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(210); + pattern = /a(?:b|c|d)(.)/; + string = 'ace'; + actualmatch = string.match(pattern); + expectedmatch = Array('ace', 'e'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(211); + pattern = /a(?:b|c|d)*(.)/; + string = 'ace'; + actualmatch = string.match(pattern); + expectedmatch = Array('ace', 'e'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(212); + pattern = /a(?:b|c|d)+?(.)/; + string = 'ace'; + actualmatch = string.match(pattern); + expectedmatch = Array('ace', 'e'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(213); + pattern = /a(?:b|c|d)+?(.)/; + string = 'acdbcdbe'; + actualmatch = string.match(pattern); + expectedmatch = Array('acd', 'd'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(214); + pattern = /a(?:b|c|d)+(.)/; + string = 'acdbcdbe'; + actualmatch = string.match(pattern); + expectedmatch = Array('acdbcdbe', 'e'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(215); + pattern = /a(?:b|c|d){2}(.)/; + string = 'acdbcdbe'; + actualmatch = string.match(pattern); + expectedmatch = Array('acdb', 'b'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(216); + pattern = /a(?:b|c|d){4,5}(.)/; + string = 'acdbcdbe'; + actualmatch = string.match(pattern); + expectedmatch = Array('acdbcdb', 'b'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(217); + pattern = /a(?:b|c|d){4,5}?(.)/; + string = 'acdbcdbe'; + actualmatch = string.match(pattern); + expectedmatch = Array('acdbcd', 'd'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + // MODIFIED - ECMA has different rules for paren contents + status = inSection(218); + pattern = /((foo)|(bar))*/; + string = 'foobar'; + actualmatch = string.match(pattern); + //expectedmatch = Array('foobar', 'bar', 'foo', 'bar'); + expectedmatch = Array('foobar', 'bar', undefined, 'bar'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(219); + pattern = /a(?:b|c|d){6,7}(.)/; + string = 'acdbcdbe'; + actualmatch = string.match(pattern); + expectedmatch = Array('acdbcdbe', 'e'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(220); + pattern = /a(?:b|c|d){6,7}?(.)/; + string = 'acdbcdbe'; + actualmatch = string.match(pattern); + expectedmatch = Array('acdbcdbe', 'e'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(221); + pattern = /a(?:b|c|d){5,6}(.)/; + string = 'acdbcdbe'; + actualmatch = string.match(pattern); + expectedmatch = Array('acdbcdbe', 'e'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(222); + pattern = /a(?:b|c|d){5,6}?(.)/; + string = 'acdbcdbe'; + actualmatch = string.match(pattern); + expectedmatch = Array('acdbcdb', 'b'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(223); + pattern = /a(?:b|c|d){5,7}(.)/; + string = 'acdbcdbe'; + actualmatch = string.match(pattern); + expectedmatch = Array('acdbcdbe', 'e'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(224); + pattern = /a(?:b|c|d){5,7}?(.)/; + string = 'acdbcdbe'; + actualmatch = string.match(pattern); + expectedmatch = Array('acdbcdb', 'b'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(225); + pattern = /a(?:b|(c|e){1,2}?|d)+?(.)/; + string = 'ace'; + actualmatch = string.match(pattern); + expectedmatch = Array('ace', 'c', 'e'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(226); + pattern = /^(.+)?B/; + string = 'AB'; + actualmatch = string.match(pattern); + expectedmatch = Array('AB', 'A'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + /* MODIFIED - ECMA has different rules for paren contents */ + status = inSection(227); + pattern = /^([^a-z])|(\^)$/; + string = '.'; + actualmatch = string.match(pattern); + expectedmatch = Array('.', '.', undefined); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(228); + pattern = /^[<>]&/; + string = '<&OUT'; + actualmatch = string.match(pattern); + expectedmatch = Array('<&'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + /* Can't refer to a capture before it's encountered & completed + status = inSection(229); + pattern = /^(a\1?){4}$/; + string = 'aaaaaaaaaa'; + actualmatch = string.match(pattern); + expectedmatch = Array('aaaaaaaaaa', 'aaaa'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(230); + pattern = /^(a(?(1)\1)){4}$/; + string = 'aaaaaaaaaa'; + actualmatch = string.match(pattern); + expectedmatch = Array('aaaaaaaaaa', 'aaaa'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + */ + + status = inSection(231); + pattern = /((a{4})+)/; + string = 'aaaaaaaaa'; + actualmatch = string.match(pattern); + expectedmatch = Array('aaaaaaaa', 'aaaaaaaa', 'aaaa'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(232); + pattern = /(((aa){2})+)/; + string = 'aaaaaaaaaa'; + actualmatch = string.match(pattern); + expectedmatch = Array('aaaaaaaa', 'aaaaaaaa', 'aaaa', 'aa'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(233); + pattern = /(((a{2}){2})+)/; + string = 'aaaaaaaaaa'; + actualmatch = string.match(pattern); + expectedmatch = Array('aaaaaaaa', 'aaaaaaaa', 'aaaa', 'aa'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(234); + pattern = /(?:(f)(o)(o)|(b)(a)(r))*/; + string = 'foobar'; + actualmatch = string.match(pattern); + expectedmatch = Array('foobar', 'f', 'o', 'o', 'b', 'a', 'r'); + //expectedmatch = Array('foobar', undefined, undefined, undefined, 'b', 'a', 'r'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + /* ECMA supports (?: (?= and (?! but doesn't support (?< etc. + status = inSection(235); + pattern = /(?<=a)b/; + string = 'ab'; + actualmatch = string.match(pattern); + expectedmatch = Array('b'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(236); + pattern = /(? + status = inSection(311); + pattern = /(?>a+)b/; + string = 'aaab'; + actualmatch = string.match(pattern); + expectedmatch = Array('aaab'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + */ + + status = inSection(312); + pattern = /([[:]+)/; + string = 'a:[b]:'; + actualmatch = string.match(pattern); + expectedmatch = Array(':[', ':['); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(313); + pattern = /([[=]+)/; + string = 'a=[b]='; + actualmatch = string.match(pattern); + expectedmatch = Array('=[', '=['); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(314); + pattern = /([[.]+)/; + string = 'a.[b].'; + actualmatch = string.match(pattern); + expectedmatch = Array('.[', '.['); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + /* ECMA doesn't have rules for [: + status = inSection(315); + pattern = /[a[:]b[:c]/; + string = 'abc'; + actualmatch = string.match(pattern); + expectedmatch = Array('abc'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + */ + + /* ECMA doesn't support (?> + status = inSection(316); + pattern = /((?>a+)b)/; + string = 'aaab'; + actualmatch = string.match(pattern); + expectedmatch = Array('aaab', 'aaab'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(317); + pattern = /(?>(a+))b/; + string = 'aaab'; + actualmatch = string.match(pattern); + expectedmatch = Array('aaab', 'aaa'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(318); + pattern = /((?>[^()]+)|\([^()]*\))+/; + string = '((abc(ade)ufh()()x'; + actualmatch = string.match(pattern); + expectedmatch = Array('abc(ade)ufh()()x', 'x'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + */ + + /* Perl has \Z has end-of-line, ECMA doesn't + status = inSection(319); + pattern = /\Z/; + string = 'a\nb\n'; + actualmatch = string.match(pattern); + expectedmatch = Array(''); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(320); + pattern = /\z/; + string = 'a\nb\n'; + actualmatch = string.match(pattern); + expectedmatch = Array(''); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + */ + + status = inSection(321); + pattern = /$/; + string = 'a\nb\n'; + actualmatch = string.match(pattern); + expectedmatch = Array(''); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + /* Perl has \Z has end-of-line, ECMA doesn't + status = inSection(322); + pattern = /\Z/; + string = 'b\na\n'; + actualmatch = string.match(pattern); + expectedmatch = Array(''); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(323); + pattern = /\z/; + string = 'b\na\n'; + actualmatch = string.match(pattern); + expectedmatch = Array(''); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + */ + + status = inSection(324); + pattern = /$/; + string = 'b\na\n'; + actualmatch = string.match(pattern); + expectedmatch = Array(''); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + /* Perl has \Z has end-of-line, ECMA doesn't + status = inSection(325); + pattern = /\Z/; + string = 'b\na'; + actualmatch = string.match(pattern); + expectedmatch = Array(''); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(326); + pattern = /\z/; + string = 'b\na'; + actualmatch = string.match(pattern); + expectedmatch = Array(''); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + */ + + status = inSection(327); + pattern = /$/; + string = 'b\na'; + actualmatch = string.match(pattern); + expectedmatch = Array(''); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + /* Perl has \Z has end-of-line, ECMA doesn't + status = inSection(328); + pattern = /\Z/m; + string = 'a\nb\n'; + actualmatch = string.match(pattern); + expectedmatch = Array(''); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(329); + pattern = /\z/m; + string = 'a\nb\n'; + actualmatch = string.match(pattern); + expectedmatch = Array(''); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + */ + + status = inSection(330); + pattern = /$/m; + string = 'a\nb\n'; + actualmatch = string.match(pattern); + expectedmatch = Array(''); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + /* Perl has \Z has end-of-line, ECMA doesn't + status = inSection(331); + pattern = /\Z/m; + string = 'b\na\n'; + actualmatch = string.match(pattern); + expectedmatch = Array(''); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(332); + pattern = /\z/m; + string = 'b\na\n'; + actualmatch = string.match(pattern); + expectedmatch = Array(''); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + */ + + status = inSection(333); + pattern = /$/m; + string = 'b\na\n'; + actualmatch = string.match(pattern); + expectedmatch = Array(''); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + /* Perl has \Z has end-of-line, ECMA doesn't + status = inSection(334); + pattern = /\Z/m; + string = 'b\na'; + actualmatch = string.match(pattern); + expectedmatch = Array(''); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(335); + pattern = /\z/m; + string = 'b\na'; + actualmatch = string.match(pattern); + expectedmatch = Array(''); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + */ + + status = inSection(336); + pattern = /$/m; + string = 'b\na'; + actualmatch = string.match(pattern); + expectedmatch = Array(''); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + /* Perl has \Z has end-of-line, ECMA doesn't + status = inSection(337); + pattern = /a\Z/; + string = 'b\na\n'; + actualmatch = string.match(pattern); + expectedmatch = Array('a'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + */ + + /* $ only matches end of input unless multiline + status = inSection(338); + pattern = /a$/; + string = 'b\na\n'; + actualmatch = string.match(pattern); + expectedmatch = Array('a'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + */ + + /* Perl has \Z has end-of-line, ECMA doesn't + status = inSection(339); + pattern = /a\Z/; + string = 'b\na'; + actualmatch = string.match(pattern); + expectedmatch = Array('a'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(340); + pattern = /a\z/; + string = 'b\na'; + actualmatch = string.match(pattern); + expectedmatch = Array('a'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + */ + + status = inSection(341); + pattern = /a$/; + string = 'b\na'; + actualmatch = string.match(pattern); + expectedmatch = Array('a'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(342); + pattern = /a$/m; + string = 'a\nb\n'; + actualmatch = string.match(pattern); + expectedmatch = Array('a'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + /* Perl has \Z has end-of-line, ECMA doesn't + status = inSection(343); + pattern = /a\Z/m; + string = 'b\na\n'; + actualmatch = string.match(pattern); + expectedmatch = Array('a'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + */ + + status = inSection(344); + pattern = /a$/m; + string = 'b\na\n'; + actualmatch = string.match(pattern); + expectedmatch = Array('a'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + /* Perl has \Z has end-of-line, ECMA doesn't + status = inSection(345); + pattern = /a\Z/m; + string = 'b\na'; + actualmatch = string.match(pattern); + expectedmatch = Array('a'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(346); + pattern = /a\z/m; + string = 'b\na'; + actualmatch = string.match(pattern); + expectedmatch = Array('a'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + */ + + status = inSection(347); + pattern = /a$/m; + string = 'b\na'; + actualmatch = string.match(pattern); + expectedmatch = Array('a'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + /* Perl has \Z has end-of-line, ECMA doesn't + status = inSection(348); + pattern = /aa\Z/; + string = 'b\naa\n'; + actualmatch = string.match(pattern); + expectedmatch = Array('aa'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + */ + + /* $ only matches end of input unless multiline + status = inSection(349); + pattern = /aa$/; + string = 'b\naa\n'; + actualmatch = string.match(pattern); + expectedmatch = Array('aa'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + */ + + /* Perl has \Z has end-of-line, ECMA doesn't + status = inSection(350); + pattern = /aa\Z/; + string = 'b\naa'; + actualmatch = string.match(pattern); + expectedmatch = Array('aa'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(351); + pattern = /aa\z/; + string = 'b\naa'; + actualmatch = string.match(pattern); + expectedmatch = Array('aa'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + */ + + status = inSection(352); + pattern = /aa$/; + string = 'b\naa'; + actualmatch = string.match(pattern); + expectedmatch = Array('aa'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(353); + pattern = /aa$/m; + string = 'aa\nb\n'; + actualmatch = string.match(pattern); + expectedmatch = Array('aa'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + /* Perl has \Z has end-of-line, ECMA doesn't + status = inSection(354); + pattern = /aa\Z/m; + string = 'b\naa\n'; + actualmatch = string.match(pattern); + expectedmatch = Array('aa'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + */ + + status = inSection(355); + pattern = /aa$/m; + string = 'b\naa\n'; + actualmatch = string.match(pattern); + expectedmatch = Array('aa'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + /* Perl has \Z has end-of-line, ECMA doesn't + status = inSection(356); + pattern = /aa\Z/m; + string = 'b\naa'; + actualmatch = string.match(pattern); + expectedmatch = Array('aa'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(357); + pattern = /aa\z/m; + string = 'b\naa'; + actualmatch = string.match(pattern); + expectedmatch = Array('aa'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + */ + + status = inSection(358); + pattern = /aa$/m; + string = 'b\naa'; + actualmatch = string.match(pattern); + expectedmatch = Array('aa'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + /* Perl has \Z has end-of-line, ECMA doesn't + status = inSection(359); + pattern = /ab\Z/; + string = 'b\nab\n'; + actualmatch = string.match(pattern); + expectedmatch = Array('ab'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + */ + + /* $ only matches end of input unless multiline + status = inSection(360); + pattern = /ab$/; + string = 'b\nab\n'; + actualmatch = string.match(pattern); + expectedmatch = Array('ab'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + */ + + /* Perl has \Z has end-of-line, ECMA doesn't + status = inSection(361); + pattern = /ab\Z/; + string = 'b\nab'; + actualmatch = string.match(pattern); + expectedmatch = Array('ab'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(362); + pattern = /ab\z/; + string = 'b\nab'; + actualmatch = string.match(pattern); + expectedmatch = Array('ab'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + */ + + status = inSection(363); + pattern = /ab$/; + string = 'b\nab'; + actualmatch = string.match(pattern); + expectedmatch = Array('ab'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(364); + pattern = /ab$/m; + string = 'ab\nb\n'; + actualmatch = string.match(pattern); + expectedmatch = Array('ab'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + /* Perl has \Z has end-of-line, ECMA doesn't + status = inSection(365); + pattern = /ab\Z/m; + string = 'b\nab\n'; + actualmatch = string.match(pattern); + expectedmatch = Array('ab'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + */ + + status = inSection(366); + pattern = /ab$/m; + string = 'b\nab\n'; + actualmatch = string.match(pattern); + expectedmatch = Array('ab'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + /* Perl has \Z has end-of-line, ECMA doesn't + status = inSection(367); + pattern = /ab\Z/m; + string = 'b\nab'; + actualmatch = string.match(pattern); + expectedmatch = Array('ab'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(368); + pattern = /ab\z/m; + string = 'b\nab'; + actualmatch = string.match(pattern); + expectedmatch = Array('ab'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + */ + + status = inSection(369); + pattern = /ab$/m; + string = 'b\nab'; + actualmatch = string.match(pattern); + expectedmatch = Array('ab'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + /* Perl has \Z has end-of-line, ECMA doesn't + status = inSection(370); + pattern = /abb\Z/; + string = 'b\nabb\n'; + actualmatch = string.match(pattern); + expectedmatch = Array('abb'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + */ + + /* $ only matches end of input unless multiline + status = inSection(371); + pattern = /abb$/; + string = 'b\nabb\n'; + actualmatch = string.match(pattern); + expectedmatch = Array('abb'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + */ + + /* Perl has \Z has end-of-line, ECMA doesn't + status = inSection(372); + pattern = /abb\Z/; + string = 'b\nabb'; + actualmatch = string.match(pattern); + expectedmatch = Array('abb'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(373); + pattern = /abb\z/; + string = 'b\nabb'; + actualmatch = string.match(pattern); + expectedmatch = Array('abb'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + */ + + status = inSection(374); + pattern = /abb$/; + string = 'b\nabb'; + actualmatch = string.match(pattern); + expectedmatch = Array('abb'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(375); + pattern = /abb$/m; + string = 'abb\nb\n'; + actualmatch = string.match(pattern); + expectedmatch = Array('abb'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + /* Perl has \Z has end-of-line, ECMA doesn't + status = inSection(376); + pattern = /abb\Z/m; + string = 'b\nabb\n'; + actualmatch = string.match(pattern); + expectedmatch = Array('abb'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + */ + + status = inSection(377); + pattern = /abb$/m; + string = 'b\nabb\n'; + actualmatch = string.match(pattern); + expectedmatch = Array('abb'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + /* Perl has \Z has end-of-line, ECMA doesn't + status = inSection(378); + pattern = /abb\Z/m; + string = 'b\nabb'; + actualmatch = string.match(pattern); + expectedmatch = Array('abb'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(379); + pattern = /abb\z/m; + string = 'b\nabb'; + actualmatch = string.match(pattern); + expectedmatch = Array('abb'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + */ + + status = inSection(380); + pattern = /abb$/m; + string = 'b\nabb'; + actualmatch = string.match(pattern); + expectedmatch = Array('abb'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(381); + pattern = /(^|x)(c)/; + string = 'ca'; + actualmatch = string.match(pattern); + expectedmatch = Array('c', '', 'c'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(382); + pattern = /foo.bart/; + string = 'foo.bart'; + actualmatch = string.match(pattern); + expectedmatch = Array('foo.bart'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(383); + pattern = /^d[x][x][x]/m; + string = 'abcd\ndxxx'; + actualmatch = string.match(pattern); + expectedmatch = Array('dxxx'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(384); + pattern = /tt+$/; + string = 'xxxtt'; + actualmatch = string.match(pattern); + expectedmatch = Array('tt'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + /* ECMA spec says that each atom in a range must be a single character + status = inSection(385); + pattern = /([a-\d]+)/; + string = 'za-9z'; + actualmatch = string.match(pattern); + expectedmatch = Array('9', '9'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(386); + pattern = /([\d-z]+)/; + string = 'a0-za'; + actualmatch = string.match(pattern); + expectedmatch = Array('0-z', '0-z'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + */ + + /* ECMA doesn't support [: + status = inSection(387); + pattern = /([a-[:digit:]]+)/; + string = 'za-9z'; + actualmatch = string.match(pattern); + expectedmatch = Array('a-9', 'a-9'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(388); + pattern = /([[:digit:]-z]+)/; + string = '=0-z='; + actualmatch = string.match(pattern); + expectedmatch = Array('0-z', '0-z'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(389); + pattern = /([[:digit:]-[:alpha:]]+)/; + string = '=0-z='; + actualmatch = string.match(pattern); + expectedmatch = Array('0-z', '0-z'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + */ + + status = inSection(390); + pattern = /(\d+\.\d+)/; + string = '3.1415926'; + actualmatch = string.match(pattern); + expectedmatch = Array('3.1415926', '3.1415926'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(391); + pattern = /\.c(pp|xx|c)?$/i; + string = 'IO.c'; + actualmatch = string.match(pattern); + expectedmatch = Array('.c', undefined); + + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(392); + pattern = /(\.c(pp|xx|c)?$)/i; + string = 'IO.c'; + actualmatch = string.match(pattern); + + expectedmatch = Array('.c', '.c', undefined); + + + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(393); + pattern = /(^|a)b/; + string = 'ab'; + actualmatch = string.match(pattern); + expectedmatch = Array('ab', 'a'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(394); + pattern = /^([ab]*?)(b)?(c)$/; + string = 'abac'; + actualmatch = string.match(pattern); + expectedmatch = Array('abac', 'aba', undefined, 'c'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(395); + pattern = /^(?:.,){2}c/i; + string = 'a,b,c'; + actualmatch = string.match(pattern); + expectedmatch = Array('a,b,c'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(396); + pattern = /^(.,){2}c/i; + string = 'a,b,c'; + actualmatch = string.match(pattern); + expectedmatch = Array('a,b,c', 'b,'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(397); + pattern = /^(?:[^,]*,){2}c/; + string = 'a,b,c'; + actualmatch = string.match(pattern); + expectedmatch = Array('a,b,c'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(398); + pattern = /^([^,]*,){2}c/; + string = 'a,b,c'; + actualmatch = string.match(pattern); + expectedmatch = Array('a,b,c', 'b,'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(399); + pattern = /^([^,]*,){3}d/; + string = 'aaa,b,c,d'; + actualmatch = string.match(pattern); + expectedmatch = Array('aaa,b,c,d', 'c,'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(400); + pattern = /^([^,]*,){3,}d/; + string = 'aaa,b,c,d'; + actualmatch = string.match(pattern); + expectedmatch = Array('aaa,b,c,d', 'c,'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(401); + pattern = /^([^,]*,){0,3}d/; + string = 'aaa,b,c,d'; + actualmatch = string.match(pattern); + expectedmatch = Array('aaa,b,c,d', 'c,'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(402); + pattern = /^([^,]{1,3},){3}d/i; + string = 'aaa,b,c,d'; + actualmatch = string.match(pattern); + expectedmatch = Array('aaa,b,c,d', 'c,'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(403); + pattern = /^([^,]{1,3},){3,}d/; + string = 'aaa,b,c,d'; + actualmatch = string.match(pattern); + expectedmatch = Array('aaa,b,c,d', 'c,'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(404); + pattern = /^([^,]{1,3},){0,3}d/; + string = 'aaa,b,c,d'; + actualmatch = string.match(pattern); + expectedmatch = Array('aaa,b,c,d', 'c,'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(405); + pattern = /^([^,]{1,},){3}d/; + string = 'aaa,b,c,d'; + actualmatch = string.match(pattern); + expectedmatch = Array('aaa,b,c,d', 'c,'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(406); + pattern = /^([^,]{1,},){3,}d/; + string = 'aaa,b,c,d'; + actualmatch = string.match(pattern); + expectedmatch = Array('aaa,b,c,d', 'c,'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(407); + pattern = /^([^,]{1,},){0,3}d/; + string = 'aaa,b,c,d'; + actualmatch = string.match(pattern); + expectedmatch = Array('aaa,b,c,d', 'c,'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(408); + pattern = /^([^,]{0,3},){3}d/i; + string = 'aaa,b,c,d'; + actualmatch = string.match(pattern); + expectedmatch = Array('aaa,b,c,d', 'c,'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(409); + pattern = /^([^,]{0,3},){3,}d/; + string = 'aaa,b,c,d'; + actualmatch = string.match(pattern); + expectedmatch = Array('aaa,b,c,d', 'c,'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(410); + pattern = /^([^,]{0,3},){0,3}d/; + string = 'aaa,b,c,d'; + actualmatch = string.match(pattern); + expectedmatch = Array('aaa,b,c,d', 'c,'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + /* ECMA doesn't support \A + status = inSection(411); + pattern = /(?!\A)x/m; + string = 'a\nxb\n'; + actualmatch = string.match(pattern); + expectedmatch = Array('\n'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + */ + + status = inSection(412); + pattern = /^(a(b)?)+$/; + string = 'aba'; + actualmatch = string.match(pattern); + expectedmatch = Array('aba', 'a', undefined); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(413); + pattern = /^(aa(bb)?)+$/; + string = 'aabbaa'; + actualmatch = string.match(pattern); + expectedmatch = Array('aabbaa', 'aa', undefined); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(414); + pattern = /^.{9}abc.*\n/m; + string = '123\nabcabcabcabc\n'; + actualmatch = string.match(pattern); + expectedmatch = Array('abcabcabcabc\n'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(415); + pattern = /^(a)?a$/; + string = 'a'; + actualmatch = string.match(pattern); + expectedmatch = Array('a', undefined); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(416); + pattern = /^(a\1?)(a\1?)(a\2?)(a\3?)$/; + string = 'aaaaaa'; + actualmatch = string.match(pattern); + expectedmatch = Array('aaaaaa', 'a', 'aa', 'a', 'aa'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + /* Can't refer to a capture before it's encountered & completed + status = inSection(417); + pattern = /^(a\1?){4}$/; + string = 'aaaaaa'; + actualmatch = string.match(pattern); + expectedmatch = Array('aaaaaa', 'aaa'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + */ + + status = inSection(418); + pattern = /^(0+)?(?:x(1))?/; + string = 'x1'; + actualmatch = string.match(pattern); + expectedmatch = Array('x1', undefined, '1'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(419); + pattern = /^([0-9a-fA-F]+)(?:x([0-9a-fA-F]+)?)(?:x([0-9a-fA-F]+))?/; + string = '012cxx0190'; + actualmatch = string.match(pattern); + expectedmatch = Array('012cxx0190', '012c', undefined, '0190'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(420); + pattern = /^(b+?|a){1,2}c/; + string = 'bbbac'; + actualmatch = string.match(pattern); + expectedmatch = Array('bbbac', 'a'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(421); + pattern = /^(b+?|a){1,2}c/; + string = 'bbbbac'; + actualmatch = string.match(pattern); + expectedmatch = Array('bbbbac', 'a'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(422); + pattern = /((?:aaaa|bbbb)cccc)?/; + string = 'aaaacccc'; + actualmatch = string.match(pattern); + expectedmatch = Array('aaaacccc', 'aaaacccc'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(423); + pattern = /((?:aaaa|bbbb)cccc)?/; + string = 'bbbbcccc'; + actualmatch = string.match(pattern); + expectedmatch = Array('bbbbcccc', 'bbbbcccc'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/RegExp/eperlstress_002.as b/mozilla/js/tamarin/test/ecma3/RegExp/eperlstress_002.as new file mode 100644 index 00000000000..cfa569855d5 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/RegExp/eperlstress_002.as @@ -0,0 +1,1822 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* ***** BEGIN LICENSE BLOCK ***** +* Version: NPL 1.1/GPL 2.0/LGPL 2.1 +* +* The contents of this file are subject to the Netscape Public License +* Version 1.1 (the "License"); you may not use this file except in +* compliance with the License. You may obtain a copy of the License at +* http://www.mozilla.org/NPL/ +* +* Software distributed under the License is distributed on an "AS IS" basis, +* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +* for the specific language governing rights and limitations under the +* License. +* +* The Original Code is JavaScript Engine testing utilities. +* +* The Initial Developer of the Original Code is Netscape Communications Corp. +* Portions created by the Initial Developer are Copyright (C) 2002 +* the Initial Developer. All Rights Reserved. +* +* Contributor(s): pschwartau@netscape.com, rogerl@netscape.com +* +* Alternatively, the contents of this file may be used under the terms of +* either the GNU General Public License Version 2 or later (the "GPL"), or +* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +* in which case the provisions of the GPL or the LGPL are applicable instead +* of those above. If you wish to allow use of your version of this file only +* under the terms of either the GPL or the LGPL, and not to allow others to +* use your version of this file under the terms of the NPL, indicate your +* decision by deleting the provisions above and replace them with the notice +* and other provisions required by the GPL or the LGPL. If you do not delete +* the provisions above, a recipient may use your version of this file under +* the terms of any one of the NPL, the GPL or the LGPL. +* +* ***** END LICENSE BLOCK ***** +* +* +* Date: 2002-07-07 +* SUMMARY: Testing JS RegExp engine against Perl 5 RegExp engine. +* Adjust cnLBOUND, cnUBOUND below to restrict which sections are tested. +* +* This test was created by running various patterns and strings through the +* Perl 5 RegExp engine. We saved the results below to test the JS engine. +* +* Each of the examples below is a negative test; that is, each produces a +* null match in Perl. Therefore we set expectedmatch = |null| in each section. +* +* NOTE: ECMA/JS and Perl do differ on certain points. We have either commented +* out such sections altogether, or modified them to fit what we expect from JS. +* +* EXAMPLES: +* +* - ECMA does support (?: (?= and (?! operators, but doesn't support (?< etc. +* +* - ECMA doesn't support (?(condition) +* +*/ +//----------------------------------------------------------------------------- +var SECTION = "eperlstress_002"; +var VERSION = ""; +var TITLE = "Testing regular expression edge cases"; +var bug = 85721; + +startTest(); +writeHeaderToLog(SECTION + " " + TITLE); +var testcases = getTestCases(); +test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var status = ''; + var pattern = ''; + var string = ''; + var actualmatch = ''; + var expectedmatch = ''; + + status = inSection(1); + pattern = /abc/; + string = 'xbc'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(2); + pattern = /abc/; + string = 'axc'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(3); + pattern = /abc/; + string = 'abx'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(4); + pattern = /ab+bc/; + string = 'abc'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(5); + pattern = /ab+bc/; + string = 'abq'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(6); + pattern = /ab{1,}bc/; + string = 'abq'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(7); + pattern = /ab{4,5}bc/; + string = 'abbbbc'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(8); + pattern = /ab?bc/; + string = 'abbbbc'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(9); + pattern = /^abc$/; + string = 'abcc'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(10); + pattern = /^abc$/; + string = 'aabc'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(11); + pattern = /abc$/; + string = 'aabcd'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(12); + pattern = /a.*c/; + string = 'axyzd'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(13); + pattern = /a[bc]d/; + string = 'abc'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(14); + pattern = /a[b-d]e/; + string = 'abd'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(15); + pattern = /a[^bc]d/; + string = 'abd'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(16); + pattern = /a[^-b]c/; + string = 'a-c'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(17); + pattern = /a[^]b]c/; + string = 'a]c'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(18); + pattern = /\by\b/; + string = 'xy'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(19); + pattern = /\by\b/; + string = 'yz'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(20); + pattern = /\by\b/; + string = 'xyz'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(21); + pattern = /\Ba\B/; + string = 'a-'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(22); + pattern = /\Ba\B/; + string = '-a'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(23); + pattern = /\Ba\B/; + string = '-a-'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(24); + pattern = /\w/; + string = '-'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(25); + pattern = /\W/; + string = 'a'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(26); + pattern = /a\sb/; + string = 'a-b'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(27); + pattern = /\d/; + string = '-'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(28); + pattern = /\D/; + string = '1'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(29); + pattern = /[\w]/; + string = '-'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(30); + pattern = /[\W]/; + string = 'a'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(31); + pattern = /a[\s]b/; + string = 'a-b'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(32); + pattern = /[\d]/; + string = '-'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(33); + pattern = /[\D]/; + string = '1'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(34); + pattern = /$b/; + string = 'b'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(35); + pattern = /^(ab|cd)e/; + string = 'abcde'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(36); + pattern = /a[bcd]+dcdcde/; + string = 'adcdcde'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(37); + pattern = /(bc+d$|ef*g.|h?i(j|k))/; + string = 'effg'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(38); + pattern = /(bc+d$|ef*g.|h?i(j|k))/; + string = 'bcdd'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(39); + pattern = /[k]/; + string = 'ab'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + // MODIFIED - ECMA has different rules for paren contents. + status = inSection(40); + pattern = /(a)|\1/; + string = 'x'; + actualmatch = string.match(pattern); + //expectedmatch = null; + + expectedmatch = Array("", undefined); + + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + // MODIFIED - ECMA has different rules for paren contents. + status = inSection(41); + pattern = /((\3|b)\2(a)x)+/; + string = 'aaxabxbaxbbx'; + actualmatch = string.match(pattern); + //expectedmatch = null; + expectedmatch = Array("ax", "ax", "", "a"); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(42); + pattern = /abc/i; + string = 'XBC'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(43); + pattern = /abc/i; + string = 'AXC'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(44); + pattern = /abc/i; + string = 'ABX'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(45); + pattern = /ab+bc/i; + string = 'ABC'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(46); + pattern = /ab+bc/i; + string = 'ABQ'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(47); + pattern = /ab{1,}bc/i; + string = 'ABQ'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(48); + pattern = /ab{4,5}?bc/i; + string = 'ABBBBC'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(49); + pattern = /ab??bc/i; + string = 'ABBBBC'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(50); + pattern = /^abc$/i; + string = 'ABCC'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(51); + pattern = /^abc$/i; + string = 'AABC'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(52); + pattern = /a.*c/i; + string = 'AXYZD'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(53); + pattern = /a[bc]d/i; + string = 'ABC'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(54); + pattern = /a[b-d]e/i; + string = 'ABD'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(55); + pattern = /a[^bc]d/i; + string = 'ABD'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(56); + pattern = /a[^-b]c/i; + string = 'A-C'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(57); + pattern = /a[^]b]c/i; + string = 'A]C'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(58); + pattern = /$b/i; + string = 'B'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(59); + pattern = /^(ab|cd)e/i; + string = 'ABCDE'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(60); + pattern = /a[bcd]+dcdcde/i; + string = 'ADCDCDE'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(61); + pattern = /(bc+d$|ef*g.|h?i(j|k))/i; + string = 'EFFG'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(62); + pattern = /(bc+d$|ef*g.|h?i(j|k))/i; + string = 'BCDD'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(63); + pattern = /[k]/i; + string = 'AB'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(64); + pattern = /^(a\1?){4}$/; + string = 'aaaaaaaaa'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(65); + pattern = /^(a\1?){4}$/; + string = 'aaaaaaaaaaa'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + /* ECMA doesn't support (?( + status = inSection(66); + pattern = /^(a(?(1)\1)){4}$/; + string = 'aaaaaaaaa'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(67); + pattern = /^(a(?(1)\1)){4}$/; + string = 'aaaaaaaaaaa'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + */ + + status = inSection(68); + pattern = /(?<=a)b/; + string = 'cb'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(69); + pattern = /(?<=a)b/; + string = 'b'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(70); + pattern = /(?a+)ab/; + string = 'aaab'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(106); + pattern = /a\Z/; + string = 'a\nb\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(107); + pattern = /a\z/; + string = 'a\nb\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(108); + pattern = /a$/; + string = 'a\nb\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(109); + pattern = /a\z/; + string = 'b\na\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(110); + pattern = /a\z/m; + string = 'a\nb\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(111); + pattern = /a\z/m; + string = 'b\na\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(112); + pattern = /aa\Z/; + string = 'aa\nb\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(113); + pattern = /aa\z/; + string = 'aa\nb\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(114); + pattern = /aa$/; + string = 'aa\nb\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(115); + pattern = /aa\z/; + string = 'b\naa\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(116); + pattern = /aa\z/m; + string = 'aa\nb\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(117); + pattern = /aa\z/m; + string = 'b\naa\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(118); + pattern = /aa\Z/; + string = 'ac\nb\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(119); + pattern = /aa\z/; + string = 'ac\nb\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(120); + pattern = /aa$/; + string = 'ac\nb\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(121); + pattern = /aa\Z/; + string = 'b\nac\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(122); + pattern = /aa\z/; + string = 'b\nac\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(123); + pattern = /aa$/; + string = 'b\nac\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(124); + pattern = /aa\Z/; + string = 'b\nac'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(125); + pattern = /aa\z/; + string = 'b\nac'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(126); + pattern = /aa$/; + string = 'b\nac'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(127); + pattern = /aa\Z/m; + string = 'ac\nb\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(128); + pattern = /aa\z/m; + string = 'ac\nb\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(129); + pattern = /aa$/m; + string = 'ac\nb\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(130); + pattern = /aa\Z/m; + string = 'b\nac\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(131); + pattern = /aa\z/m; + string = 'b\nac\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(132); + pattern = /aa$/m; + string = 'b\nac\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(133); + pattern = /aa\Z/m; + string = 'b\nac'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(134); + pattern = /aa\z/m; + string = 'b\nac'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(135); + pattern = /aa$/m; + string = 'b\nac'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(136); + pattern = /aa\Z/; + string = 'ca\nb\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(137); + pattern = /aa\z/; + string = 'ca\nb\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(138); + pattern = /aa$/; + string = 'ca\nb\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(139); + pattern = /aa\Z/; + string = 'b\nca\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(140); + pattern = /aa\z/; + string = 'b\nca\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(141); + pattern = /aa$/; + string = 'b\nca\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(142); + pattern = /aa\Z/; + string = 'b\nca'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(143); + pattern = /aa\z/; + string = 'b\nca'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(144); + pattern = /aa$/; + string = 'b\nca'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(145); + pattern = /aa\Z/m; + string = 'ca\nb\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(146); + pattern = /aa\z/m; + string = 'ca\nb\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(147); + pattern = /aa$/m; + string = 'ca\nb\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(148); + pattern = /aa\Z/m; + string = 'b\nca\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(149); + pattern = /aa\z/m; + string = 'b\nca\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(150); + pattern = /aa$/m; + string = 'b\nca\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(151); + pattern = /aa\Z/m; + string = 'b\nca'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(152); + pattern = /aa\z/m; + string = 'b\nca'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(153); + pattern = /aa$/m; + string = 'b\nca'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(154); + pattern = /ab\Z/; + string = 'ab\nb\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(155); + pattern = /ab\z/; + string = 'ab\nb\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(156); + pattern = /ab$/; + string = 'ab\nb\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(157); + pattern = /ab\z/; + string = 'b\nab\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(158); + pattern = /ab\z/m; + string = 'ab\nb\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(159); + pattern = /ab\z/m; + string = 'b\nab\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(160); + pattern = /ab\Z/; + string = 'ac\nb\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(161); + pattern = /ab\z/; + string = 'ac\nb\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(162); + pattern = /ab$/; + string = 'ac\nb\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(163); + pattern = /ab\Z/; + string = 'b\nac\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(164); + pattern = /ab\z/; + string = 'b\nac\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(165); + pattern = /ab$/; + string = 'b\nac\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(166); + pattern = /ab\Z/; + string = 'b\nac'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(167); + pattern = /ab\z/; + string = 'b\nac'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(168); + pattern = /ab$/; + string = 'b\nac'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(169); + pattern = /ab\Z/m; + string = 'ac\nb\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(170); + pattern = /ab\z/m; + string = 'ac\nb\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(171); + pattern = /ab$/m; + string = 'ac\nb\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(172); + pattern = /ab\Z/m; + string = 'b\nac\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(173); + pattern = /ab\z/m; + string = 'b\nac\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(174); + pattern = /ab$/m; + string = 'b\nac\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(175); + pattern = /ab\Z/m; + string = 'b\nac'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(176); + pattern = /ab\z/m; + string = 'b\nac'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(177); + pattern = /ab$/m; + string = 'b\nac'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(178); + pattern = /ab\Z/; + string = 'ca\nb\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(179); + pattern = /ab\z/; + string = 'ca\nb\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(180); + pattern = /ab$/; + string = 'ca\nb\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(181); + pattern = /ab\Z/; + string = 'b\nca\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(182); + pattern = /ab\z/; + string = 'b\nca\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(183); + pattern = /ab$/; + string = 'b\nca\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(184); + pattern = /ab\Z/; + string = 'b\nca'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(185); + pattern = /ab\z/; + string = 'b\nca'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(186); + pattern = /ab$/; + string = 'b\nca'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(187); + pattern = /ab\Z/m; + string = 'ca\nb\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(188); + pattern = /ab\z/m; + string = 'ca\nb\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(189); + pattern = /ab$/m; + string = 'ca\nb\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(190); + pattern = /ab\Z/m; + string = 'b\nca\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(191); + pattern = /ab\z/m; + string = 'b\nca\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(192); + pattern = /ab$/m; + string = 'b\nca\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(193); + pattern = /ab\Z/m; + string = 'b\nca'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(194); + pattern = /ab\z/m; + string = 'b\nca'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(195); + pattern = /ab$/m; + string = 'b\nca'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(196); + pattern = /abb\Z/; + string = 'abb\nb\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(197); + pattern = /abb\z/; + string = 'abb\nb\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(198); + pattern = /abb$/; + string = 'abb\nb\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(199); + pattern = /abb\z/; + string = 'b\nabb\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(200); + pattern = /abb\z/m; + string = 'abb\nb\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(201); + pattern = /abb\z/m; + string = 'b\nabb\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(202); + pattern = /abb\Z/; + string = 'ac\nb\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(203); + pattern = /abb\z/; + string = 'ac\nb\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(204); + pattern = /abb$/; + string = 'ac\nb\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(205); + pattern = /abb\Z/; + string = 'b\nac\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(206); + pattern = /abb\z/; + string = 'b\nac\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(207); + pattern = /abb$/; + string = 'b\nac\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(208); + pattern = /abb\Z/; + string = 'b\nac'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(209); + pattern = /abb\z/; + string = 'b\nac'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(210); + pattern = /abb$/; + string = 'b\nac'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(211); + pattern = /abb\Z/m; + string = 'ac\nb\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(212); + pattern = /abb\z/m; + string = 'ac\nb\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(213); + pattern = /abb$/m; + string = 'ac\nb\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(214); + pattern = /abb\Z/m; + string = 'b\nac\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(215); + pattern = /abb\z/m; + string = 'b\nac\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(216); + pattern = /abb$/m; + string = 'b\nac\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(217); + pattern = /abb\Z/m; + string = 'b\nac'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(218); + pattern = /abb\z/m; + string = 'b\nac'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(219); + pattern = /abb$/m; + string = 'b\nac'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(220); + pattern = /abb\Z/; + string = 'ca\nb\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(221); + pattern = /abb\z/; + string = 'ca\nb\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(222); + pattern = /abb$/; + string = 'ca\nb\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(223); + pattern = /abb\Z/; + string = 'b\nca\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(224); + pattern = /abb\z/; + string = 'b\nca\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(225); + pattern = /abb$/; + string = 'b\nca\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(226); + pattern = /abb\Z/; + string = 'b\nca'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(227); + pattern = /abb\z/; + string = 'b\nca'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(228); + pattern = /abb$/; + string = 'b\nca'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(229); + pattern = /abb\Z/m; + string = 'ca\nb\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(230); + pattern = /abb\z/m; + string = 'ca\nb\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(231); + pattern = /abb$/m; + string = 'ca\nb\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(232); + pattern = /abb\Z/m; + string = 'b\nca\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(233); + pattern = /abb\z/m; + string = 'b\nca\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(234); + pattern = /abb$/m; + string = 'b\nca\n'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(235); + pattern = /abb\Z/m; + string = 'b\nca'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(236); + pattern = /abb\z/m; + string = 'b\nca'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(237); + pattern = /abb$/m; + string = 'b\nca'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(238); + pattern = /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/; + string = 'x'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(239); + pattern = /\GX.*X/; + string = 'aaaXbX'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(240); + pattern = /\.c(pp|xx|c)?$/i; + string = 'Changes'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(241); + pattern = /^([a-z]:)/; + string = 'C:/'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(242); + pattern = /(\w)?(abc)\1b/; + string = 'abcab'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + /* ECMA doesn't support (?( + status = inSection(243); + pattern = /^(a)?(?(1)a|b)+$/; + string = 'a'; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + */ + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/RegExp/eproperties_001.as b/mozilla/js/tamarin/test/ecma3/RegExp/eproperties_001.as new file mode 100644 index 00000000000..79f4e14c690 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/RegExp/eproperties_001.as @@ -0,0 +1,197 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "RegExp/properties-001.js"; + var VERSION = "ECMA_2"; + var TITLE = "Properties of RegExp Instances"; + var BUGNUMBER ="http://scopus/bugsplat/show_bug.cgi?id=346000"; + +startTest(); +writeHeaderToLog(SECTION + " " + TITLE); +var testcases = getTestCases(); +test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + AddRegExpCases( new RegExp, "", false, false, false, 0 ); + AddRegExpCases( /.*/, ".*", false, false, false, 0 ); + AddRegExpCases( /[\d]{5}/g, "[\\d]{5}", true, false, false, 0 ); + AddRegExpCases( /[\S]?$/i, "[\\S]?$", false, true, false, 0 ); + AddRegExpCases( /^([a-z]*)[^\w\s\f\n\r]+/m, "^([a-z]*)[^\\w\\s\\f\\n\\r]+", false, false, true, 0 ); + AddRegExpCases( /[\D]{1,5}[\ -][\d]/gi, "[\\D]{1,5}[\\ -][\\d]", true, true, false, 0 ); + AddRegExpCases( /[a-zA-Z0-9]*/gm, "[a-zA-Z0-9]*", true, false, true, 0 ); + AddRegExpCases( /x|y|z/gim, "x|y|z", true, true, true, 0 ); + + AddRegExpCases( /\u0051/im, "\u0051", false, true, true, 0 ); + AddRegExpCases( /\x45/gm, "\\x45", true, false, true, 0 ); + AddRegExpCases( /\097/gi, "\\097", true, true, false, 0 ); + + function AddRegExpCases( re, s, g, i, m, l ) { + + array[item++] = new TestCase(SECTION, + re + ".test == RegExp.prototype.test", + true, + re.test == RegExp.prototype.test ); + + array[item++] = new TestCase(SECTION, + re + ".toString == RegExp.prototype.toString", + true, + re.toString == RegExp.prototype.toString ); + + array[item++] = new TestCase(SECTION, + re + ".constructor == RegExp.prototype.constructor", + true, + re.constructor == RegExp.prototype.constructor ); + + array[item++] = new TestCase(SECTION, + re + ".compile == RegExp.prototype.compile", + true, + re.compile == RegExp.prototype.compile ); + + array[item++] = new TestCase(SECTION, + re + ".exec == RegExp.prototype.exec", + true, + re.exec == RegExp.prototype.exec ); + + // properties + + array[item++] = new TestCase(SECTION, + re + ".source", + s, + re.source ); + try{ + re.source = "k"; + }catch(e:ReferenceError){ + thisError = e.toString(); + }finally{ + array[item++] = new TestCase(SECTION, + re + ".source='k'", + "ReferenceError: Error #1074", + referenceError(thisError) ); + } + + + + array[item++] = new TestCase(SECTION, + "delete"+re + ".source", + false, + delete re.source); + + + + array[item++] = new TestCase(SECTION, + re + ".toString()", + "/" + s +"/" + (g?"g":"") + (i?"i":"") +(m?"m":""), + re.toString() ); + + array[item++] = new TestCase(SECTION, + re + ".global", + g, + re.global ); + + try{ + re.global = true; + }catch(e:ReferenceError){ + thisError = e.toString(); + }finally{ + array[item++] = new TestCase(SECTION, + re + ".global=true", + "ReferenceError: Error #1074", + referenceError(thisError) ); + } + + + + array[item++] = new TestCase(SECTION, + "delete"+re + ".global", + false, + delete re.global); + + array[item++] = new TestCase(SECTION, + re + ".ignoreCase", + i, + re.ignoreCase ); + + try{ + re.ignoreCase = true; + }catch(e:ReferenceError){ + thisError = e.toString(); + }finally{ + array[item++] = new TestCase(SECTION, + re + ".ignoreCase=true", + "ReferenceError: Error #1074", + referenceError(thisError) ); + } + + + + array[item++] = new TestCase(SECTION, + "delete"+re + ".ignoreCase", + false, + delete re.ignoreCase); + + array[item++] = new TestCase(SECTION, + re + ".multiline", + m, + re.multiline); + + try{ + re.multiline = true; + }catch(e:ReferenceError){ + thisError = e.toString(); + }finally{ + array[item++] = new TestCase(SECTION, + re + ".multiline=true", + "ReferenceError: Error #1074", + referenceError(thisError) ); + } + + + + array[item++] = new TestCase(SECTION, + "delete"+re + ".multiline", + false, + delete re.multiline); + + array[item++] = new TestCase(SECTION, + re + ".lastIndex", + l, + re.lastIndex ); + + array[item++] = new TestCase(SECTION, + "delete"+re + ".lastIndex", + false, + delete re.lastIndex); + } + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/RegExp/eproperties_002.as b/mozilla/js/tamarin/test/ecma3/RegExp/eproperties_002.as new file mode 100644 index 00000000000..c9e10ec8c65 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/RegExp/eproperties_002.as @@ -0,0 +1,156 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + //----------------------------------------------------------------------------- +var SECTION = "RegExp/properties-002.js"; +var VERSION = "ECMA_2"; +var TITLE = "Properties of RegExp Instances"; +var BUGNUMBER ="http://scopus/bugsplat/show_bug.cgi?id=346032"; +// ALSO SEE http://bugzilla.mozilla.org/show_bug.cgi?id=124339 + +startTest(); +writeHeaderToLog(SECTION + " " + TITLE); +var testcases = getTestCases(); +test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + re_1 = /\cA?/g; + re_1.lastIndex = Math.pow(2,30); + AddRegExpCases( re_1, "\\cA?", true, false, false, Math.pow(2,30) ); + + re_2 = /\w*/i; + re_2.lastIndex = Math.pow(2,30) -1; + AddRegExpCases( re_2, "\\w*", false, true, false, Math.pow(2,30)-1 ); + + re_3 = /\*{0,80}/m; + re_3.lastIndex = Math.pow(2,30) -1; + AddRegExpCases( re_3, "\\*{0,80}", false, false, true, Math.pow(2,30) -1 ); + + re_4 = /^./gim; + re_4.lastIndex = Math.pow(2,30) -1; + AddRegExpCases( re_4, "^.", true, true, true, Math.pow(2,30) -1 ); + + re_5 = /\B/; + re_5.lastIndex = Math.pow(2,30); + AddRegExpCases( re_5, "\\B", false, false, false, Math.pow(2,30) ); + + /* + * Brendan: "need to test cases Math.pow(2,32) and greater to see + * whether they round-trip." Reason: thanks to the work done in + * http://bugzilla.mozilla.org/show_bug.cgi?id=124339, lastIndex + * is now stored as a double instead of a uint32 (unsigned integer). + * + * Note 2^32 -1 is the upper bound for uint32's, but doubles can go + * all the way up to Number.MAX_VALUE. So that's why we need cases + * between those two numbers. + * + */ + re_6 = /\B/; + re_6.lastIndex = Math.pow(2,30); + AddRegExpCases( re_6, "\\B", false, false, false, Math.pow(2,30) ); + + re_7 = /\B/; + re_7.lastIndex = Math.pow(2,29) + 1; + AddRegExpCases( re_7, "\\B", false, false, false, Math.pow(2,29) + 1 ); + + re_8 = /\B/; + re_8.lastIndex = Math.pow(2,29) * 2; + AddRegExpCases( re_8, "\\B", false, false, false, Math.pow(2,29) * 2 ); + + re_9 = /\B/; + re_9.lastIndex = Math.pow(2,30); + AddRegExpCases( re_9, "\\B", false, false, false, Math.pow(2,30) ); + + + function AddRegExpCases( re, s, g, i, m, l ){ + + array[item++] = new TestCase(SECTION, + re + ".test == RegExp.prototype.test", + true, + re.test == RegExp.prototype.test ); + + array[item++] = new TestCase(SECTION, + re + ".toString == RegExp.prototype.toString", + true, + re.toString == RegExp.prototype.toString ); + + array[item++] = new TestCase(SECTION, + re + ".constructor == RegExp.prototype.constructor", + true, + re.constructor == RegExp.prototype.constructor ); + + array[item++] = new TestCase(SECTION, + re + ".compile == RegExp.prototype.compile", + true, + re.compile == RegExp.prototype.compile ); + + array[item++] = new TestCase(SECTION, + re + ".exec == RegExp.prototype.exec", + true, + re.exec == RegExp.prototype.exec ); + + // properties + + array[item++] = new TestCase(SECTION, + re + ".source", + s, + re.source ); + + array[item++] = new TestCase(SECTION, + re + ".toString()", + "/" + s +"/" + (g?"g":"") + (i?"i":"") +(m?"m":""), + re.toString() ); + + array[item++] = new TestCase(SECTION, + re + ".global", + g, + re.global ); + + array[item++] = new TestCase(SECTION, + re + ".ignoreCase", + i, + re.ignoreCase ); + + array[item++] = new TestCase(SECTION, + re + ".multiline", + m, + re.multiline); + + array[item++] = new TestCase(SECTION, + re + ".lastIndex", + l, + re.lastIndex ); + } + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/RegExp/eregexp_enumerate_001.as b/mozilla/js/tamarin/test/ecma3/RegExp/eregexp_enumerate_001.as new file mode 100644 index 00000000000..8fd2dec74a1 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/RegExp/eregexp_enumerate_001.as @@ -0,0 +1,92 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "regexp-enumerate-001"; + var VERSION = "ECMA_2"; + var TITLE = "Regression Test for Enumerating Properties"; + var BUGNUMBER="339403"; + +startTest(); +writeHeaderToLog(SECTION + " " + TITLE); +var testcases = getTestCases(); +test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + /* + * This test expects RegExp instances to have four enumerated properties: + * source, global, ignoreCase, and lastIndex + * + * 99.01.25: now they also have a multiLine instance property. + * + */ + var r = new RegExp(); + var e = new Array(); + var t = new TestRegExp(); + + for ( p in r ) { + e[e.length] = { property:p, value:r[p] }; t.addProperty( p, r[p]) + }; + + array[item++] = new TestCase(SECTION, + "r = new RegExp(); e = new Array(); "+ + "for ( p in r ) { e[e.length] = { property:p, value:r[p] }; e.length", + 0, + e.length ); + + function TestRegExp() { + this.addProperty = addProperty; + } + function addProperty(name, value) { + var pass = false; + + if ( this.name != void 0 ) { + pass = true; + } else { + this.name = false ; + } + + testcases[testcases.length] = new TestCase( SECTION, + "Property: " + name +" already enumerated?", + false, + pass ); + + if ( testcases[ testcases.length-1].passed == false ) { + testcases[testcases.length-1].reason = "property already enumerated"; + + } + + } + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/RegExp/eregress_001.as b/mozilla/js/tamarin/test/ecma3/RegExp/eregress_001.as new file mode 100644 index 00000000000..519d58c0b1d --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/RegExp/eregress_001.as @@ -0,0 +1,68 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "RegExp/hex-001.js"; + var VERSION = "ECMA_2"; + var TITLE = "JS regexp anchoring on empty match bug"; + var BUGNUMBER = "http://bugzilla.mozilla.org/show_bug.cgi?id=2157"; + +startTest(); +writeHeaderToLog(SECTION + " " + TITLE); +var testcases = getTestCases(); +test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + AddRegExpCases( /a||b/(''), + "//a||b/('')", + 1, + [''] ); + + + function AddRegExpCases( regexp, str_regexp, length, matches_array ) { + + array[item++] = new TestCase(SECTION, + "( " + str_regexp + " ).length", + regexp.length, + regexp.length ); + + + for ( var matches = 0; matches < matches_array.length; matches++ ) { + array[item++] = new TestCase(SECTION, + "( " + str_regexp + " )[" + matches +"]", + matches_array[matches], + regexp[matches] ); + } + } + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/RegExp/eregress_100199.as b/mozilla/js/tamarin/test/ecma3/RegExp/eregress_100199.as new file mode 100644 index 00000000000..973c1ea8d30 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/RegExp/eregress_100199.as @@ -0,0 +1,297 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* +* The contents of this file are subject to the Netscape Public +* License Version 1.1 (the "License"); you may not use this file +* except in compliance with the License. You may obtain a copy of +* the License at http://www.mozilla.org/NPL/ +* +* Software distributed under the License is distributed on an "AS IS" +* basis, WITHOUT WARRANTY OF ANY KIND, either expressed +* or implied. See the License for the specific language governing +* rights and limitations under the License. +* +* The Original Code is mozilla.org code. +* +* The Initial Developer of the Original Code is Netscape +* Communications Corporation. Portions created by Netscape are +* Copyright (C) 1998 Netscape Communications Corporation. +* All Rights Reserved. +* +* Contributor(s): pschwartau@netscape.com +* Date: 17 September 2001 +* +* SUMMARY: Regression test for Bugzilla bug 100199 +* See http://bugzilla.mozilla.org/show_bug.cgi?id=100199 +* +* The empty character class [] is a valid RegExp construct: the condition +* that a given character belong to a set containing no characters. As such, +* it can never be met and is always FALSE. Similarly, [^] is a condition +* that matches any given character and is always TRUE. +* +* Neither one of these conditions should cause syntax errors in a RegExp. +*/ +//----------------------------------------------------------------------------- + +var SECTION = "eregress_100199"; +var VERSION = ""; +var TITLE = "[], [^] are valid RegExp conditions. Should not cause errors -"; +var bug = "100199"; + +startTest(); +writeHeaderToLog(SECTION + " " + TITLE); +var testcases = getTestCases(); +test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var status = ''; + var pattern = ''; + var string = ''; + var actualmatch = ''; + var expectedmatch = ''; + + + /*pattern = /[]/; + string = 'abc'; + status = inSection(1); + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + string = ''; + status = inSection(2); + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + string = '['; + status = inSection(3); + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + string = '/'; + status = inSection(4); + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + string = '['; + status = inSection(5); + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + string = ']'; + status = inSection(6); + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + string = '[]'; + status = inSection(7); + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + string = '[ ]'; + status = inSection(8); + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + string = ']['; + status = inSection(9); + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + + pattern = /a[]/; + string = 'abc'; + status = inSection(10); + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + string = ''; + status = inSection(11); + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + string = 'a['; + status = inSection(12); + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + string = 'a[]'; + status = inSection(13); + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + string = '['; + status = inSection(14); + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + string = ']'; + status = inSection(15); + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + string = '[]'; + status = inSection(16); + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + string = '[ ]'; + status = inSection(17); + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + string = ']['; + status = inSection(18); + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + + pattern = /[^]/; + string = 'abc'; + status = inSection(19); + actualmatch = string.match(pattern); + expectedmatch = Array('a'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + string = ''; + status = inSection(20); + actualmatch = string.match(pattern); + expectedmatch = null; //there are no characters to test against the condition + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + string = '\/'; + status = inSection(21); + actualmatch = string.match(pattern); + expectedmatch = Array('/'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + string = '\['; + status = inSection(22); + actualmatch = string.match(pattern); + expectedmatch = Array('['); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + string = '['; + status = inSection(23); + actualmatch = string.match(pattern); + expectedmatch = Array('['); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + string = ']'; + status = inSection(24); + actualmatch = string.match(pattern); + expectedmatch = Array(']'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + string = '[]'; + status = inSection(25); + actualmatch = string.match(pattern); + expectedmatch = Array('['); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + string = '[ ]'; + status = inSection(26); + actualmatch = string.match(pattern); + expectedmatch = Array('['); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + string = ']['; + status = inSection(27); + actualmatch = string.match(pattern); + expectedmatch = Array(']'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString());*/ + + + pattern = /a[^]/; + string = 'abc'; + status = inSection(28); + actualmatch = string.match(pattern); + expectedmatch = Array('ab'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + string = ''; + status = inSection(29); + actualmatch = string.match(pattern); + expectedmatch = null; //there are no characters to test against the condition + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + string = 'a['; + status = inSection(30); + actualmatch = string.match(pattern); + expectedmatch = Array('a['); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + string = 'a]'; + status = inSection(31); + actualmatch = string.match(pattern); + expectedmatch = Array('a]'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + string = 'a[]'; + status = inSection(32); + actualmatch = string.match(pattern); + expectedmatch = Array('a['); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + string = 'a[ ]'; + status = inSection(33); + actualmatch = string.match(pattern); + expectedmatch = Array('a['); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + string = 'a]['; + status = inSection(34); + actualmatch = string.match(pattern); + expectedmatch = Array('a]'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/RegExp/eregress_103087.as b/mozilla/js/tamarin/test/ecma3/RegExp/eregress_103087.as new file mode 100644 index 00000000000..680dc8c5191 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/RegExp/eregress_103087.as @@ -0,0 +1,174 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* +* The contents of this file are subject to the Netscape Public +* License Version 1.1 (the "License"); you may not use this file +* except in compliance with the License. You may obtain a copy of +* the License at http://www.mozilla.org/NPL/ +* +* Software distributed under the License is distributed on an "AS IS" +* basis, WITHOUT WARRANTY OF ANY KIND, either expressed +* or implied. See the License for the specific language governing +* rights and limitations under the License. +* +* The Original Code is mozilla.org code. +* +* The Initial Developer of the Original Code is Netscape +* Communications Corporation. Portions created by Netscape are +* Copyright (C) 1998 Netscape Communications Corporation. +* All Rights Reserved. +* +* Contributor(s): bedney@technicalpursuit.com, pschwartau@netscape.com +* Date: 04 October 2001 +* +* SUMMARY: Arose from Bugzilla bug 103087: +* "The RegExp MarkupSPE in demo crashes Mozilla" +* +* See http://bugzilla.mozilla.org/show_bug.cgi?id=103087 +* The SpiderMonkey shell crashed on some of these regexps. +* +* The reported crash was on i=24 below ('MarkupSPE' regexp) +* I crashed on that, and also on i=43 ('XML_SPE' regexp) +*/ +//----------------------------------------------------------------------------- + +var SECTION = "eregress_103087.as"; +var VERSION = ""; +var TITLE = "Testing that we don't crash on any of these regexps -"; +var bug = "103087"; + +startTest(); +writeHeaderToLog(SECTION + " " + TITLE); +var testcases = getTestCases(); +test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var re = ''; + var lm = ''; + var lc = ''; + var rc = ''; + + + // the regexps are built in pieces - + var NameStrt = "[A-Za-z_:]|[^\\x00-\\x7F]"; + var NameChar = "[A-Za-z0-9_:.-]|[^\\x00-\\x7F]"; + var Name = "(" + NameStrt + ")(" + NameChar + ")*"; + var TextSE = "[^<]+"; + var UntilHyphen = "[^-]*-"; + var Until2Hyphens = UntilHyphen + "([^-]" + UntilHyphen + ")*-"; + var CommentCE = Until2Hyphens + ">?"; + var UntilRSBs = "[^]]*]([^]]+])*]+"; + var CDATA_CE = UntilRSBs + "([^]>]" + UntilRSBs + ")*>"; + var S = "[ \\n\\t\\r]+"; + var QuoteSE = '"[^"]' + "*" + '"' + "|'[^']*'"; + var DT_IdentSE = S + Name + "(" + S + "(" + Name + "|" + QuoteSE + "))*"; + var MarkupDeclCE = "([^]\"'><]+|" + QuoteSE + ")*>"; + var S1 = "[\\n\\r\\t ]"; + var UntilQMs = "[^?]*\\?+"; + var PI_Tail = "\\?>|" + S1 + UntilQMs + "([^>?]" + UntilQMs + ")*>"; + var DT_ItemSE = "<(!(--" + Until2Hyphens + ">|[^-]" + MarkupDeclCE + ")|\\?" + Name + "(" + PI_Tail + "))|%" + Name + ";|" + S; + var DocTypeCE = DT_IdentSE + "(" + S + ")?(\\[(" + DT_ItemSE + ")*](" + S + ")?)?>?"; + var DeclCE = "--(" + CommentCE + ")?|\\[CDATA\\[(" + CDATA_CE + ")?|DOCTYPE(" + DocTypeCE + ")?"; + var PI_CE = Name + "(" + PI_Tail + ")?"; + var EndTagCE = Name + "(" + S + ")?>?"; + var AttValSE = '"[^<"]' + "*" + '"' + "|'[^<']*'"; + var ElemTagCE = Name + "(" + S + Name + "(" + S + ")?=(" + S + ")?(" + AttValSE + "))*(" + S + ")?/?>?"; + var MarkupSPE = "<(!(" + DeclCE + ")?|\\?(" + PI_CE + ")?|/(" + EndTagCE + ")?|(" + ElemTagCE + ")?)"; + var XML_SPE = TextSE + "|" + MarkupSPE; + var CommentRE = ")|(<([\$\w:\.\-]+)((([ ][^\/>]*)?\/>)|(([ ][^>]*)?>)))/; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + status = inSection(2); + pattern = /()|(<(tagPattern)((([ ][^\/>]*)?\/>)|(([ ][^>]*)?>)))/; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + // This was the one causing a Rhino crash - + status = inSection(3); + pattern = /()|(<(tagPattern)((([ ][^\/>]*)?\/>)|(([ ][^>]*)?>)))|(<\/tagPattern[^>]*>)/; + actualmatch = string.match(pattern); + expectedmatch = null; + array[item++] = new TestCase(SECTION, status, expectedmatch, actualmatch); + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/RegExp/eregress_78156.as b/mozilla/js/tamarin/test/ecma3/RegExp/eregress_78156.as new file mode 100644 index 00000000000..4047ddca476 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/RegExp/eregress_78156.as @@ -0,0 +1,113 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* +* The contents of this file are subject to the Netscape Public +* License Version 1.1 (the "License"); you may not use this file +* except in compliance with the License. You may obtain a copy of +* the License at http://www.mozilla.org/NPL/ +* +* Software distributed under the License is distributed on an "AS IS" +* basis, WITHOUT WARRANTY OF ANY KIND, either expressed +* or implied. See the License for the specific language governing +* rights and limitations under the License. +* +* The Original Code is mozilla.org code. +* +* The Initial Developer of the Original Code is Netscape +* Communications Corporation. Portions created by Netscape are +* Copyright (C) 1998 Netscape Communications Corporation. +* All Rights Reserved. +* +* Contributor(s): pschwartau@netscape.com +* Date: 06 February 2001 +* +* SUMMARY: Arose from Bugzilla bug 78156: +* "m flag of regular expression does not work with $" +* +* See http://bugzilla.mozilla.org/show_bug.cgi?id=78156 +* +* The m flag means a regular expression should search strings +* across multiple lines, i.e. across '\n', '\r'. +*/ +//------------------------------------------------------------------------------------------------- +var SECTION = "eregress_78156"; +var VERSION = ""; +var TITLE = "Testing regular expressions with ^, $, and the m flag -"; +var bug = "78156"; + +startTest(); +writeHeaderToLog(SECTION + " " + TITLE); +var testcases = getTestCases(); +test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + +var status = ''; +var pattern = ''; +var string = ''; +var actualmatch = ''; +var expectedmatch = ''; + +/* + * All patterns have an m flag; all strings are multiline. + * Looking for digit characters at beginning/end of lines. + */ + +string = 'aaa\n789\r\nccc\r\n345'; + status = inSection(1); + pattern = /^\d/gm; + actualmatch = string.match(pattern); + expectedmatch = ['7', '3']; + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(2); + pattern = /\d$/gm; + actualmatch = string.match(pattern); + expectedmatch = ['9','5']; + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + +string = 'aaa\n789\r\nccc\r\nddd'; + status = inSection(3); + pattern = /^\d/gm; + actualmatch = string.match(pattern); + expectedmatch = ['7']; + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(4); + pattern = /\d$/gm; + actualmatch = string.match(pattern); + expectedmatch = ['9']; + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/RegExp/eregress_87231.as b/mozilla/js/tamarin/test/ecma3/RegExp/eregress_87231.as new file mode 100644 index 00000000000..2c1bf7d6dec --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/RegExp/eregress_87231.as @@ -0,0 +1,136 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* +* The contents of this file are subject to the Netscape Public +* License Version 1.1 (the "License"); you may not use this file +* except in compliance with the License. You may obtain a copy of +* the License at http://www.mozilla.org/NPL/ +* +* Software distributed under the License is distributed on an "AS IS" +* basis, WITHOUT WARRANTY OF ANY KIND, either expressed +* or implied. See the License for the specific language governing +* rights and limitations under the License. +* +* The Original Code is mozilla.org code. +* +* The Initial Developer of the Original Code is Netscape +* Communications Corporation. Portions created by Netscape are +* Copyright (C) 1998 Netscape Communications Corporation. +* All Rights Reserved. +* +* Contributor(s): pschwartau@netscape.com +* Date: 22 June 2001 +* +* SUMMARY: Regression test for Bugzilla bug 87231: +* "Regular expression /(A)?(A.*)/ picks 'A' twice" +* +* See http://bugzilla.mozilla.org/show_bug.cgi?id=87231 +* Key case: +* +* pattern = /^(A)?(A.*)$/; +* string = 'A'; +* expectedmatch = Array('A', '', 'A'); +* +* +* We expect the 1st subexpression (A)? NOT to consume the single 'A'. +* Recall that "?" means "match 0 or 1 times". Here, it should NOT do +* greedy matching: it should match 0 times instead of 1. This allows +* the 2nd subexpression to make the only match it can: the single 'A'. +* Such "altruism" is the only way there can be a successful global match... +*/ +//------------------------------------------------------------------------------------------------- + +var SECTION = "eregress_87231"; +var VERSION = ""; +var TITLE = "Testing regular expression /(A)?(A.*)/"; +var bug = "87231"; + +startTest(); +writeHeaderToLog(SECTION + " " + TITLE); +var testcases = getTestCases(); +test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + +var cnEmptyString = ''; +var status = ''; +var pattern = ''; +var string = ''; +var actualmatch = ''; +var expectedmatch = ''; + + +pattern = /^(A)?(A.*)$/; + status = inSection(1); + string = 'AAA'; + actualmatch = string.match(pattern); + expectedmatch = Array('AAA', 'A', 'AA'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(2); + string = 'AA'; + actualmatch = string.match(pattern); + expectedmatch = Array('AA', 'A', 'A'); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(3); + string = 'A'; + actualmatch = string.match(pattern); + expectedmatch = Array('A', undefined, 'A'); // 'altruistic' case: see above + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + +pattern = /(A)?(A.*)/; +var strL = 'zxcasd;fl\\\ ^'; +var strR = 'aaAAaaaf;lrlrzs'; + + status = inSection(4); + string = strL + 'AAA' + strR; + actualmatch = string.match(pattern); + expectedmatch = Array('AAA' + strR, 'A', 'AA' + strR); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(5); + string = strL + 'AA' + strR; + actualmatch = string.match(pattern); + expectedmatch = Array('AA' + strR, 'A', 'A' + strR); + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + status = inSection(6); + string = strL + 'A' + strR; + actualmatch = string.match(pattern); + expectedmatch = Array('A' + strR, undefined, 'A' + strR); // 'altruistic' case: see above + array[item++] = new TestCase(SECTION, status, expectedmatch.toString(), actualmatch.toString()); + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/RegExp/eregress_98306.as b/mozilla/js/tamarin/test/ecma3/RegExp/eregress_98306.as new file mode 100644 index 00000000000..4d61131ae27 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/RegExp/eregress_98306.as @@ -0,0 +1,113 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* +* The contents of this file are subject to the Netscape Public +* License Version 1.1 (the "License"); you may not use this file +* except in compliance with the License. You may obtain a copy of +* the License at http://www.mozilla.org/NPL/ +* +* Software distributed under the License is distributed on an "AS IS" +* basis, WITHOUT WARRANTY OF ANY KIND, either expressed +* or implied. See the License for the specific language governing +* rights and limitations under the License. +* +* The Original Code is mozilla.org code. +* +* The Initial Developer of the Original Code is Netscape +* Communications Corporation. Portions created by Netscape are +* Copyright (C) 1998 Netscape Communications Corporation. +* All Rights Reserved. +* +* Contributor(s): jrgm@netscape.com, pschwartau@netscape.com +* Date: 04 September 2001 +* +* SUMMARY: Regression test for Bugzilla bug 98306 +* "JS parser crashes in ParseAtom for script using Regexp()" +* +* See http://bugzilla.mozilla.org/show_bug.cgi?id=98306 +*/ +//----------------------------------------------------------------------------- + +var SECTION = "eregress_98306"; +var VERSION = ""; +var TITLE = "Testing that we don't crash on this code -"; +var bug = "98306"; + +startTest(); +writeHeaderToLog(SECTION + " " + TITLE); +var testcases = getTestCases(); +test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var cnUBOUND = 10; + var re; + var s; + + + s = '"Hello".match(/[/]/)'; + tryThis(s); + + s = 're = /[/'; + tryThis(s); + + s = 're = /[/]/'; + tryThis(s); + + s = 're = /[//]/'; + tryThis(s); + + // Try to provoke a crash - + function tryThis(sCode) + { + var thisError = "no error"; + + // sometimes more than one attempt is necessary - + for (var i=0; i 0xF300) // these are invalid unicode chars + { // (Actually, there are a few valid chars in this range, but very few and this is simple test). + var q = String.fromCharCode(y); + var r = (/bA/g).exec(q + "Ab" + q + "bA"); + if (!r || r.index != 4) + indexErrors += y.toString(16) + ', '; + } +} + +AddTestCase( ".index regex property broken multibyte chars:", "", indexErrors); + +// +//////////////////////////////////////////////////////////////// + +test(); // leave this alone. this executes the test cases and + // displays results. diff --git a/mozilla/js/tamarin/test/ecma3/SourceText/e6_1.as b/mozilla/js/tamarin/test/ecma3/SourceText/e6_1.as new file mode 100644 index 00000000000..0184ccc2008 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/SourceText/e6_1.as @@ -0,0 +1,124 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "6-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Source Text"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, + "// the following character should not be interpreted as a line terminator in a comment: \u000A", + 'PASSED', + "PASSED" ); + + // \u000A array[item++].actual = "FAILED!"; + + array[item++] = new TestCase( SECTION, + "// the following character should not be interpreted as a line terminator in a comment: \\n 'FAILED'", + 'PASSED', + 'PASSED' ); + + // the following character should not be interpreted as a line terminator: \\n array[item++].actual = "FAILED" + + array[item++] = new TestCase( SECTION, + "// the following character should not be interpreted as a line terminator in a comment: \\u000A 'FAILED'", + 'PASSED', + 'PASSED' ) + + // the following character should not be interpreted as a line terminator: \u000A array[item++].actual = "FAILED" + + array[item++] = new TestCase( SECTION, + "// the following character should not be interpreted as a line terminator in a comment: \n 'PASSED'", + 'PASSED', + 'PASSED' ) + // the following character should not be interpreted as a line terminator: \n array[item++].actual = 'FAILED' + + array[item++] = new TestCase( SECTION, + "// the following character should not be interpreted as a line terminator in a comment: u000D", + 'PASSED', + 'PASSED' ) + + // the following character should not be interpreted as a line terminator: \u000D array[item++].actual = "FAILED" + + array[item++] = new TestCase( SECTION, + "// the following character should not be interpreted as a line terminator in a comment: u2028", + 'PASSED', + 'PASSED' ) + + // the following character should not be interpreted as a line terminator: \u2028 array[item++].actual = "FAILED" + + array[item++] = new TestCase( SECTION, + "// the following character should not be interpreted as a line terminator in a comment: u2029", + 'PASSED', + 'PASSED' ) + + // the following character should not be interpreted as a line terminator: \u2029 array[item++].actual = "FAILED" + + array[item++] = new TestCase( SECTION, + "the following character should be interpreted as backspace in a string: \u0008",'abc\bdef', + 'abc\u0008def' ) + array[item++] = new TestCase( SECTION, + "the following character should be interpreted as whitespace(Tab) in a string: \u0009",'abc\tdef', + 'abc\u0009def' ) + array[item++] = new TestCase( SECTION, + "the following character should be interpreted as vertical tab in a string: \u000B",'abc\vdef', + 'abc\u000Bdef' ) + + array[item++] = new TestCase( SECTION, + "the following character should be interpreted as form feed in a string: \u000C",'abc\fdef','abc\u000Cdef' ) + + + array[item++] = new TestCase( SECTION, + "the following character should be interpreted as double quotes in a string and should not terminate a string but should just add a character to the string: \u0022",'abc\"def', + 'abc\u0022def' ) + + array[item++] = new TestCase( SECTION, + "the following character should be interpreted as single quote in a string and should not terminate a string but should just add a character to the string : \u0027",'abc\'def', + 'abc\u0027def' ) + + array[item++] = new TestCase( SECTION, + "the following character should be interpreted as single blackslash in a string : \u005C",'abc\\def','abc\u005Cdef' ) + + array[item++] = new TestCase( SECTION, + "the following character should be interpreted as space in a string : \u0020",'abc def','abc\u0020def' ) + + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/SourceText/e6_2.as b/mozilla/js/tamarin/test/ecma3/SourceText/e6_2.as new file mode 100644 index 00000000000..78c2ee254c7 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/SourceText/e6_2.as @@ -0,0 +1,90 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "6-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Source Text"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // encoded quotes should not end a quote + + var s = 'PAS\u0022SED'; + + array[item++]= new TestCase( SECTION, + "var s = 'PAS\\u0022SED'; s", + "PAS\"SED", + s); + var s = "PAS\u0022SED"; + + array[item++]= new TestCase( SECTION, + 'var s = "PAS\\u0022SED"; s', + "PAS\"SED", + s ); + + var s = 'PAS\u0027SED'; + + array[item++]= new TestCase( SECTION, + "var s = 'PAS\\u0027SED'; s", + "PAS\'SED", + s); + + var s = "PAS\u0027SED"; + + array[item++]= new TestCase( SECTION, + 'var s = "PAS\\u0027SED"; s', + "PAS\'SED", + s ); + var s = "PAS\u0027SED"; + + array[item++] = new TestCase( SECTION, + 'var s = "PAS\\u0027SED"; s', + "PAS\'SED", + s ) + + var s = "PAS\u0022SED"; + array[item++]= new TestCase( SECTION, + 'var s = "PAS\\u0027SED"; s', + "PAS\"SED", + s ); + + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Statements/block.as b/mozilla/js/tamarin/test/ecma3/Statements/block.as new file mode 100644 index 00000000000..98e7655e8c0 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Statements/block.as @@ -0,0 +1,80 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = '12.1'; + var VERSION = 'no version'; + startTest(); + var TITLE = 'Statement:block'; + + writeHeaderToLog('Executing script: block.as'); + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var t; + Block: + { + var x = 3; + var y= 5; + t = x + y; + + } + + array[item++] = new TestCase( SECTION, "Block:{t}", 8, t); + + { + var k = 100; + var l = 50; + thisError ="no error"; + try{ + t=k/l; + t= n+10; + }catch(e:ReferenceError){ + thisError=e.toString(); + } + k=k+50; + + + } + + array[item++] = new TestCase( SECTION, "Block in which exception is thrown", "ReferenceError: Error #1065", referenceError(thisError)); + + array[item++] = new TestCase( SECTION, "Block in which exception is thrown",2, t); + array[item++] = new TestCase( SECTION, "Block in which exception is thrown",150, k); + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Statements/e12_10.as b/mozilla/js/tamarin/test/ecma3/Statements/e12_10.as new file mode 100644 index 00000000000..5c182781262 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Statements/e12_10.as @@ -0,0 +1,56 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "12.10-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "The with statement"; + + var testcases = getTestCases(); + + writeHeaderToLog( SECTION +" "+ TITLE); + + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var x; + with(7) x = valueOf(); + array[item++] = new TestCase( SECTION, + "var x; with (7) x = valueOf(); typeof x;", + "number", + (typeof x) ); + //print( "FAILED: bug 103243 filed" ); + + return ( array ); +} + diff --git a/mozilla/js/tamarin/test/ecma3/Statements/e12_10_1.as b/mozilla/js/tamarin/test/ecma3/Statements/e12_10_1.as new file mode 100644 index 00000000000..0360abdeb90 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Statements/e12_10_1.as @@ -0,0 +1,144 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "12.10-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "The with statment"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // although the scope chain changes, the this value is immutable for a given + // execution context. + + var x; + with( new Number() ) + { + x = this +''; + } + array[item++] = new TestCase( SECTION, + "with( new Number() ) { this +'' }", + "[object global]", + x); + // the object's functions and properties should override those of the + // global object. + + var MYOB = new WithObject(true); with (MYOB) { y=parseInt() } + array[item++] = new TestCase( + SECTION, + "var MYOB = new WithObject(true); with (MYOB) { parseInt() }", + true, + y ); + + var MYOB = new WithObject(false); + with (MYOB) + { + z = NaN; + } + array[item++] = new TestCase( + SECTION, + "var MYOB = new WithObject(false); with (MYOB) { NaN }", + false, + z ); + + var MYOB = new WithObject(NaN); + with (MYOB) { r = Infinity } + array[item++] = new TestCase( + SECTION, + "var MYOB = new WithObject(NaN); with (MYOB) { Infinity }", + Number.NaN, + r); + + var MYOB = new WithObject(false); with (MYOB) { } + array[item++] = new TestCase( + SECTION, + "var MYOB = new WithObject(false); with (MYOB) { }; Infinity", + Number.POSITIVE_INFINITY, + Infinity ); + + + var MYOB = new WithObject(0); with (MYOB) { delete Infinity; } + array[item++] = new TestCase( + SECTION, + "var MYOB = new WithObject(0); with (MYOB) { delete Infinity; Infinity }", + Number.POSITIVE_INFINITY, + Infinity ); + + + // let us leave the with block via a break. + + var MYOB = new WithObject(false); while (true) { with (MYOB) { MYOB = Infinity; break; } } + array[item++] = new TestCase( + SECTION, + "var MYOB = new WithObject(false); while (true) { with (MYOB) { Infinity; break; } }", + false, + MYOB ); + + var MYOB = new WithObject(true); + with (MYOB) { MYOB = Infinity;f(); } + array[item++] = new TestCase( + SECTION, + "var MYOB = new WithObject(true); with (MYOB) { Infinity }", + true, + MYOB); +function f(a,b){} + + + + return ( array ); +} +function WithObject( value ) { + this.prop1 = 1; + this.prop2 = new Boolean(true); + this.prop3 = "a string"; + this.value = value; + + // now we will override global functions + + //this.parseInt = new Function( "return this.value" ); + this.parseInt = function(){return this.value;} + this.NaN = value; + this.Infinity = value; + this.unescape = function(){return this.value;} + this.escape = function(){return this.value;} + this.eval = function(){return this.value;} + this.parseFloat = function(){return this.value;} + this.isNaN = function(){return this.value;} + this.isFinite = function(){return this.value;} +} diff --git a/mozilla/js/tamarin/test/ecma3/Statements/e12_2_1.as b/mozilla/js/tamarin/test/ecma3/Statements/e12_2_1.as new file mode 100644 index 00000000000..e4b1181f13e --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Statements/e12_2_1.as @@ -0,0 +1,135 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "12.2-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "The variable statement"; + + writeHeaderToLog( SECTION +" "+ TITLE); + + var testcases = getTestCases(); + + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var x = 3; + function f() { var a = x; x = 23; return a; } + + array[item++] = new TestCase( "SECTION", + "var x = 3; function f() { var a = x; var x = 23; return a; }; f()",3,f() ); + + array[item++] = new TestCase( "SECTION", + "var x created with global scope with property attribute {DontDelete}",false,delete x); + + array[item++] = new TestCase( "SECTION", + "var x created with global scope with property attribute {DontDelete}",23,x); + + function g(){ + var y = 20; + } + var thisError="no error"; + try{ + y++; + + }catch(e:ReferenceError){ + thisError=e.toString(); + }finally{ + array[item++] = new TestCase( "SECTION", + "var y created with function scope","ReferenceError: Error #1065",referenceError(thisError)); + } + + function h(){ + var i; + return i; + } + + array[item++] = new TestCase( "SECTION", + "undefined variables created with function scope",undefined,h()); + + function MyFunction(){ + var myvar1:int=10,myvar2:int=20,myvar3:int; + myvar3=myvar1+myvar2; + return myvar3; + } + + array[item++] = new TestCase( "SECTION", + "variables created with function scope and assigned with values",30,MyFunction()); + + + var l,m,n; + + array[item++] = new TestCase( "SECTION", + "undefined variables",undefined,l); + + array[item++] = new TestCase( "SECTION", + "undefined variables",undefined,m); + + array[item++] = new TestCase( "SECTION", + "undefined variables",undefined,n); + var t;var u;var v; + + array[item++] = new TestCase( "SECTION", + "undefined variables",undefined,t); + + array[item++] = new TestCase( "SECTION", + "undefined variables",undefined,u); + + array[item++] = new TestCase( "SECTION", + "undefined variables",undefined,v); + + v=u; + + array[item++] = new TestCase( "SECTION", + "undefined variables",undefined,v); + v=x; + + array[item++] = new TestCase( "SECTION", + "variable assigned with value when the variable statement is executed",23,v); + + var d:Number=100,b:Array=new Array(1,2,3),k:Boolean=true,g:String="string"; + + array[item++] = new TestCase( "SECTION", + "variable assigned with value when the variable statement is executed",100,d); + + array[item++] = new TestCase( "SECTION", + "variable assigned with value when the variable statement is executed","1,2,3",b+""); + + array[item++] = new TestCase( "SECTION", + "variable assigned with value when the variable statement is executed",true,k); + + array[item++] = new TestCase( "SECTION", + "variable assigned with value when the variable statement is executed","string",g); + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Statements/e12_5_1.as b/mozilla/js/tamarin/test/ecma3/Statements/e12_5_1.as new file mode 100644 index 00000000000..0e2cd75457b --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Statements/e12_5_1.as @@ -0,0 +1,101 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + var SECTION = "12.5-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "The if statment"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + var MYVAR; + if ( true ) + MYVAR='PASSED'; + else + MYVAR= 'FAILED'; + array[item++] = new TestCase( SECTION, + "var MYVAR; if ( true ) MYVAR='PASSED'; else MYVAR= 'FAILED';", + "PASSED", + MYVAR); + var MYVAR; + if ( false ) + MYVAR='FAILED'; + else + MYVAR= 'PASSED'; + array[item++] = new TestCase( SECTION, + "var MYVAR; if ( false ) MYVAR='FAILED'; else MYVAR= 'PASSED';", + "PASSED", + MYVAR); + var MYVAR; + if ( new Boolean(true) ) + MYVAR='PASSED'; + else + MYVAR= 'FAILED'; + array[item++] = new TestCase( SECTION, + "var MYVAR; if ( new Boolean(true) ) MYVAR='PASSED'; else MYVAR= 'FAILED';", + "PASSED", + MYVAR); + var MYVAR; + if ( new Boolean(false) ) + MYVAR='PASSED'; + else + MYVAR= 'FAILED'; + array[item++] = new TestCase( SECTION, + "var MYVAR; if ( new Boolean(false) ) MYVAR='PASSED'; else MYVAR= 'FAILED';", + "FAILED", + MYVAR); + var MYVAR; + if ( 1 ) + MYVAR='PASSED'; + else + MYVAR= 'FAILED'; + array[item++] = new TestCase( SECTION, + "var MYVAR; if ( 1 ) MYVAR='PASSED'; else MYVAR= 'FAILED';", + "PASSED", + MYVAR); + var MYVAR; + if ( 0 ) + MYVAR='FAILED'; + else + MYVAR= 'PASSED'; + array[item++] = new TestCase( SECTION, + "var MYVAR; if ( 0 ) MYVAR='FAILED'; else MYVAR= 'PASSED';", + "PASSED", + MYVAR); + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Statements/e12_5_2.as b/mozilla/js/tamarin/test/ecma3/Statements/e12_5_2.as new file mode 100644 index 00000000000..0d9d0fec53a --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Statements/e12_5_2.as @@ -0,0 +1,87 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "12.5-2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "The if statement" ; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var MYVAR; if ( true ) MYVAR='PASSED'; + array[item++] = new TestCase( SECTION, + "var MYVAR; if ( true ) MYVAR='PASSED'; MYVAR", + "PASSED", + MYVAR); + var MYVAR="PASSED"; + if ( false ) + MYVAR='FAILED'; + array[item++] = new TestCase( SECTION, + "var MYVAR; if ( false ) MYVAR='FAILED'; MYVAR;", + "PASSED", + MYVAR); + var MYVAR; + if ( new Boolean(true) ) + MYVAR='PASSED'; + array[item++] = new TestCase( SECTION, + "var MYVAR; if ( new Boolean(true) ) MYVAR='PASSED'; MYVAR", + "PASSED", + MYVAR ); + var MYVAR; + if ( new Boolean(false) ) + MYVAR='PASSED'; + array[item++] = new TestCase( SECTION, + "var MYVAR; if ( new Boolean(false) ) MYVAR='PASSED'; MYVAR", + "PASSED", + MYVAR); + var MYVAR; + if ( 1 ) + MYVAR='PASSED'; + array[item++] = new TestCase( SECTION, + "var MYVAR; if ( 1 ) MYVAR='PASSED'; MYVAR", + "PASSED", + MYVAR ); + var MYVAR="PASSED"; + if ( 0 ) + MYVAR='FAILED'; + array[item++] = new TestCase( SECTION, + "var MYVAR; if ( 0 ) MYVAR='FAILED'; MYVAR;", + "PASSED", + MYVAR); + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Statements/e12_5_3.as b/mozilla/js/tamarin/test/ecma3/Statements/e12_5_3.as new file mode 100644 index 00000000000..cfad3eeb555 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Statements/e12_5_3.as @@ -0,0 +1,176 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + var SECTION = "12.5"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "The if statment"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var MYVAR; + if ( true ) + MYVAR='PASSED'; + else if(false) + MYVAR= 'FAILED'; + array[item++] = new TestCase( SECTION, + "var MYVAR; if ( true ) MYVAR='PASSED'; else if (false) MYVAR= 'FAILED';", + "PASSED", + MYVAR); + var MYVAR; + if ( false ) + MYVAR='FAILED'; + else if (true) + MYVAR= 'PASSED'; + array[item++] = new TestCase( SECTION, + "var MYVAR; if ( false ) MYVAR='FAILED'; else if (true) MYVAR= 'PASSED';", + "PASSED", + MYVAR); + var MYVAR; + if ( new Boolean(true) ) + MYVAR='PASSED'; + else if (new Boolean(false)) + MYVAR= 'FAILED'; + array[item++] = new TestCase( SECTION, + "var MYVAR; if ( new Boolean(true) ) MYVAR='PASSED'; else if (new Boolean(false))MYVAR= 'FAILED';", + "PASSED", + MYVAR); + var MYVAR; + if ( new Boolean(false) ) + MYVAR='PASSED'; + else if (new Boolean(true)) + MYVAR= 'FAILED'; + array[item++] = new TestCase( SECTION, + "var MYVAR; if ( new Boolean(false) ) MYVAR='PASSED'; else if (new Boolean(true)) MYVAR= 'FAILED';", + "FAILED", + MYVAR); + var MYVAR; + if ( 1 ) + MYVAR='PASSED'; + else if (0) + MYVAR= 'FAILED'; + array[item++] = new TestCase( SECTION, + "var MYVAR; if ( 1 ) MYVAR='PASSED'; else if (0) MYVAR= 'FAILED';", + "PASSED", + MYVAR); + var MYVAR; + if ( 0 ) + MYVAR='FAILED'; + else if (1) + MYVAR= 'PASSED'; + array[item++] = new TestCase( SECTION, + "var MYVAR; if ( 0 ) MYVAR='FAILED'; else if (1) MYVAR= 'PASSED';","PASSED",MYVAR); + + var MyVar1 = 50; + var MyVar2 = 100; + + if (MyVar1>MyVar2) + result="MyVar1 is greater than MyVar2"; + else if (MyVar2==MyVar1) + result="MyVar2 equals MyVar1"; + else + result="MyVar2 greater than MyVar1"; + + array[item++] = new TestCase( SECTION,"Testing if elseif else","MyVar2 greater than MyVar1",result); + + var MyVar1 = 100; + var MyVar2 = 50; + + if (MyVar1>MyVar2) + result="MyVar1 is greater than MyVar2"; + else if (MyVar2==MyVar1) + result="MyVar2 equals MyVar1"; + else + result="MyVar2 greater than MyVar1"; + + array[item++] = new TestCase( SECTION,"Testing if elseif else","MyVar1 is greater than MyVar2",result); + + var MyVar1 = 50; + var MyVar2 = 50; + + if (MyVar1>MyVar2) + result="MyVar1 is greater than MyVar2"; + else if (MyVar2==MyVar1) + result="MyVar2 equals MyVar1"; + else + result="MyVar2 greater than MyVar1"; + + array[item++] = new TestCase( SECTION,"Testing if elseif else","MyVar2 equals MyVar1",result); + + + var MyStringVar1 = "string" + var MyStringVar2 = "string"; + + if (MyStringVar1>MyStringVar2) + result="MyStringVar1 is greater than MyStringVar2"; + else if (MyStringVar2==MyStringVar1) + result="MyStringVar2 equals MyStringVar1"; + else + result="MyStringVar2 greater than MyStringVar1"; + + array[item++] = new TestCase( SECTION,"Testing if elseif else","MyStringVar2 equals MyStringVar1",result); + + var MyStringVar1 = "String"; + var MyStringVar2 = "string"; + + if (MyStringVar1>MyStringVar2) + result="MyStringVar1 is greater than MyStringVar2"; + else if (MyStringVar2==MyStringVar1) + result="MyStringVar2 equals MyStringVar1"; + else + result="MyStringVar2 greater than MyStringVar1"; + + array[item++] = new TestCase( SECTION,"Testing if elseif else","MyStringVar2 greater than MyStringVar1",result); + + + var MyStringVar1 = "strings"; + var MyStringVar2 = "string"; + + if (MyStringVar1>MyStringVar2) + result="MyStringVar1 is greater than MyStringVar2"; + else if (MyStringVar2==MyStringVar1) + result="MyStringVar2 equals MyStringVar1"; + else + result="MyStringVar2 greater than MyStringVar1"; + + array[item++] = new TestCase( SECTION,"Testing if elseif else","MyStringVar1 is greater than MyStringVar2",result); + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Statements/e12_6_1_1.as b/mozilla/js/tamarin/test/ecma3/Statements/e12_6_1_1.as new file mode 100644 index 00000000000..6445da8f1b3 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Statements/e12_6_1_1.as @@ -0,0 +1,70 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "12.6.1-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "The While statement"; + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var MYVAR = 0; while( MYVAR++ < 100) { if ( MYVAR < 100 ) break; } + array[item++] = new TestCase( SECTION, + "var MYVAR = 0; while( MYVAR++ < 100) { if ( MYVAR < 100 ) break; } MYVAR ", + 1, + MYVAR); + + var MYVAR = 0; while( MYVAR++ < 100) { if ( MYVAR < 100 ) continue; else break; } + array[item++] = new TestCase( SECTION, + "var MYVAR = 0; while( MYVAR++ < 100) { if ( MYVAR < 100 ) continue; else break; } MYVAR ", + 100, + MYVAR); + + + function MYFUN( arg1 ) + { + while ( arg1++ < 100 ) + { + if ( arg1 < 100 ) return arg1; + } + } + array[item++] = new TestCase( SECTION, + "function MYFUN( arg1 ) { while ( arg1++ < 100 ) { if ( arg1 < 100 ) return arg1; } }; MYFUN(1)", + 2, + (MYFUN(1))); + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Statements/e12_6_2_1.as b/mozilla/js/tamarin/test/ecma3/Statements/e12_6_2_1.as new file mode 100644 index 00000000000..a3591b8a566 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Statements/e12_6_2_1.as @@ -0,0 +1,60 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "12.6.2-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "The for statment"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( "12.6.2-1", "for statement", 99, testprogram() ); + return ( array ); +} + +function testprogram() { + myVar = 0; + + for ( ; ; ) { + if ( ++myVar == 99 ) + break; + } + + return myVar; +} diff --git a/mozilla/js/tamarin/test/ecma3/Statements/e12_6_2_2.as b/mozilla/js/tamarin/test/ecma3/Statements/e12_6_2_2.as new file mode 100644 index 00000000000..cdebdb7d532 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Statements/e12_6_2_2.as @@ -0,0 +1,61 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "12.6.2-2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "The for statment"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, "for statement", 99, testprogram() ); + return ( array ); +} + +function testprogram() { + myVar = 0; + + for ( ; ; myVar++ ) { + if ( myVar < 99 ) { + continue; + } else { + break; + } + } + + return myVar; +} diff --git a/mozilla/js/tamarin/test/ecma3/Statements/e12_6_2_3.as b/mozilla/js/tamarin/test/ecma3/Statements/e12_6_2_3.as new file mode 100644 index 00000000000..a68d409a5ab --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Statements/e12_6_2_3.as @@ -0,0 +1,58 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "12.6.2-3"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "The for statment"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "for statement", 100, testprogram() ); + + return array; +} + +function testprogram() { + myVar = 0; + + for ( ; myVar < 100 ; myVar++ ) { + continue; + } + + return myVar; +} diff --git a/mozilla/js/tamarin/test/ecma3/Statements/e12_6_2_4.as b/mozilla/js/tamarin/test/ecma3/Statements/e12_6_2_4.as new file mode 100644 index 00000000000..e077bda6f7f --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Statements/e12_6_2_4.as @@ -0,0 +1,59 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "12.6.2-4"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "The for statment"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, + "for statement", 100, testprogram() ); + return array; +} + +function testprogram() { + myVar = 0; + + for ( ; myVar < 100 ; myVar++ ) { + } + + return myVar; +} diff --git a/mozilla/js/tamarin/test/ecma3/Statements/e12_6_2_5.as b/mozilla/js/tamarin/test/ecma3/Statements/e12_6_2_5.as new file mode 100644 index 00000000000..2f8f285f1e7 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Statements/e12_6_2_5.as @@ -0,0 +1,58 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "12.6.2-5"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "The for statment"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, "for statement", 99, testprogram() ); + return ( array ); +} + +function testprogram() { + myVar = 0; + + for ( ; myVar < 100 ; myVar++ ) { + if (myVar == 99) + break; + } + + return myVar; +} diff --git a/mozilla/js/tamarin/test/ecma3/Statements/e12_6_2_6.as b/mozilla/js/tamarin/test/ecma3/Statements/e12_6_2_6.as new file mode 100644 index 00000000000..28d0667b51d --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Statements/e12_6_2_6.as @@ -0,0 +1,60 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "12.6.2-6"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "The for statment"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( "12.6.2-6", "for statement", 256, testprogram() ); + return ( array ); +} + +function testprogram() { + var myVar; + + for ( myVar=2; ; myVar *= myVar ) { + + if (myVar > 100) + break; + continue; + } + + return myVar; +} diff --git a/mozilla/js/tamarin/test/ecma3/Statements/e12_6_2_7.as b/mozilla/js/tamarin/test/ecma3/Statements/e12_6_2_7.as new file mode 100644 index 00000000000..8ef1becd60b --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Statements/e12_6_2_7.as @@ -0,0 +1,58 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "12.6.2-7"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "The for statment"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, "for statement", 256, testprogram() ); + return ( array ); +} + +function testprogram() { + var myVar; + + for ( myVar=2; myVar < 100 ; myVar *= myVar ) { + + continue; + } + + return myVar; +} diff --git a/mozilla/js/tamarin/test/ecma3/Statements/e12_6_2_8.as b/mozilla/js/tamarin/test/ecma3/Statements/e12_6_2_8.as new file mode 100644 index 00000000000..a5f3a733d75 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Statements/e12_6_2_8.as @@ -0,0 +1,55 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "12.6.2-8"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "The for statment"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, "for statement", 256, testprogram() ); + return ( array ); +} +function testprogram() { + var myVar; + + for ( myVar=2; myVar < 256; myVar *= myVar ) { + } + + return myVar; +} diff --git a/mozilla/js/tamarin/test/ecma3/Statements/e12_6_3_1.as b/mozilla/js/tamarin/test/ecma3/Statements/e12_6_3_1.as new file mode 100644 index 00000000000..6b24fa18460 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Statements/e12_6_3_1.as @@ -0,0 +1,72 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "12.6.3-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "The for..in statment"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var x; + Number.prototype.foo = 34; + for ( j in 7 ) + { + x = j; + if(x = "foo"){ //The property foo will be returned during anytime using for..in //loop. So added this if statement and break to test that foo is returned + break; //--Subha Subramanian + } + } + + if( x != "foo" ){ + x = "not foo"; + } + + array[item++] = new TestCase( SECTION, + "var x; Number.prototype.foo = 34; for ( j in 7 ) x = j; x", + "foo", + x); + return ( array ); +} + + +function MyObject(a, b, c, d, e) { + + +} diff --git a/mozilla/js/tamarin/test/ecma3/Statements/e12_6_3_10.as b/mozilla/js/tamarin/test/ecma3/Statements/e12_6_3_10.as new file mode 100644 index 00000000000..33b5af91ac2 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Statements/e12_6_3_10.as @@ -0,0 +1,92 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "12.6.3-10"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "The for..in statment"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // for ( LeftHandSideExpression in Expression ) + // LeftHandSideExpression:NewExpression:MemberExpression + + var count = 0; + function f() { + //print( "f called" ); + count++; + return new Array("h","e","l","o"); + } + + var myArray = new Array("h","e","l","o"); + + var result = ""; + for ( p in f() ) { result += f()[p] }; + + array[item++] = new TestCase( SECTION, + "count = 0; result = \"\"; "+ + "function f() { count++; return new Array(\"h\",\"e\",\"l\",\"o\"); }"+ + "for ( p in f() ) { result += f()[p] }; count", + 5, + count ); + + // ecma does not gaurantee the order that for in will run... changed + // to verify that all letters of hello are called + var result2 = "PASSED"; + for( var x = 0; x 1000 ) + break; + } while( object.value ); + + array[item++] = new TestCase( + SECTION, + "loop iterations", + object.iterations, + i + ); + + array[item++] = new TestCase( + SECTION, + "object.value", + object.endvalue, + Number( object.value ) + ); + + } + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Statements/edowhile_004.as b/mozilla/js/tamarin/test/ecma3/Statements/edowhile_004.as new file mode 100644 index 00000000000..6591084129c --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Statements/edowhile_004.as @@ -0,0 +1,89 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "dowhile-004"; + var VERSION = "ECMA_2"; + var TITLE = "do...while with a labeled continue statement"; + + startTest(); + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + DoWhile( 0, 1 ); + DoWhile( 1, 1 ); + DoWhile( -1, 1 ); + DoWhile( 5, 5 ); + + + function DoWhile( limit, expect ) { + i = 0; + result1 = "pass"; + result2 = "failed: broke out of labeled statement unexpectedly"; + + foo: { + do { + i++; + if ( ! (i < limit) ) { + break; + result1 = "fail: evaluated statement after a labeled break"; + } + } while ( true ); + + result2 = "pass"; + } + + array[item++] = new TestCase( + SECTION, + "do while ( " + i +" < " + limit +" )", + expect, + i ); + + array[item++] = new TestCase( + SECTION, + "breaking out of a do... while loop", + "pass", + result1 ); + + + array[item++] = new TestCase( + SECTION, + "breaking out of a labeled do...while loop", + "pass", + result2 ); + } + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Statements/edowhile_005.as b/mozilla/js/tamarin/test/ecma3/Statements/edowhile_005.as new file mode 100644 index 00000000000..51969217e88 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Statements/edowhile_005.as @@ -0,0 +1,91 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "dowhile-005"; + var VERSION = "ECMA_2"; + var TITLE = "do...while with a labeled continue statement"; + var BUGNUMBER = "316293"; + + startTest(); + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + NestedLabel(); + + + function NestedLabel() { + i = 0; + result1 = "pass"; + result2 = "fail: did not hit code after inner loop"; + result3 = "pass"; + + outer: { + do { + inner: { +// print( i ); + break inner; + result1 = "fail: did not break out of inner label"; + } + result2 = "pass"; + break outer; + trace(i); + } while ( i++ < 100 ); + + } + + result3 = "fail: did not break out of outer label"; + + array[item++] = new TestCase( + SECTION, + "number of loop iterations", + 0, + i ); + + array[item++] = new TestCase( + SECTION, + "break out of inner loop", + "pass", + result1 ); + + array[item++] = new TestCase( + SECTION, + "break out of outer loop", + "pass", + result2 ); + } + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Statements/edowhile_006.as b/mozilla/js/tamarin/test/ecma3/Statements/edowhile_006.as new file mode 100644 index 00000000000..51385ea1b40 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Statements/edowhile_006.as @@ -0,0 +1,114 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "dowhile-006"; + var VERSION = "ECMA_2"; + var TITLE = "do...while"; + + startTest(); + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + DoWhile( new DoWhileObject( false, false, 10 ) ); + DoWhile( new DoWhileObject( true, false, 2 ) ); + DoWhile( new DoWhileObject( false, true, 3 ) ); + DoWhile( new DoWhileObject( true, true, 4 ) ); + + + function looping( object ) { + object.iterations--; + + if ( object.iterations <= 0 ) { + return false; + } else { + return true; + } + } + function DoWhileObject( breakOut, breakIn, iterations, loops ) { + this.iterations = iterations; + this.loops = loops; + this.breakOut = breakOut; + this.breakIn = breakIn; + this.looping = looping; + } + function DoWhile( object ) { + var result1 = false; + var result2 = false; + + outie: { + innie: { + do { + if ( object.breakOut ) + break outie; + + if ( object.breakIn ) + break innie; + + } while ( looping(object) ); + + // statements should be executed if: + // do...while exits normally + // do...while exits abruptly with no label + + result1 = true; + + } + + // statements should be executed if: + // do...while breaks out with label "innie" + // do...while exits normally + // do...while does not break out with "outie" + + result2 = true; + } + + array[item++] = new TestCase( + SECTION, + "hit code after loop in inner loop", + ( object.breakIn || object.breakOut ) ? false : true , + result1 ); + + array[item++] = new TestCase( + SECTION, + "hit code after loop in outer loop", + ( object.breakOut ) ? false : true, + result2 ); + + + } + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Statements/edowhile_007.as b/mozilla/js/tamarin/test/ecma3/Statements/edowhile_007.as new file mode 100644 index 00000000000..8d309330aa8 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Statements/edowhile_007.as @@ -0,0 +1,120 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "dowhile-007"; + var VERSION = "ECMA_2"; + var TITLE = "do...while"; + + startTest(); + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + DoWhile( new DoWhileObject( false, false, false, false )); + DoWhile( new DoWhileObject( true, false, false, false )); + DoWhile( new DoWhileObject( true, true, false, false )); + DoWhile( new DoWhileObject( true, true, true, false )); + DoWhile( new DoWhileObject( true, true, true, true )); + DoWhile( new DoWhileObject( false, false, false, true )); + DoWhile( new DoWhileObject( false, false, true, true )); + DoWhile( new DoWhileObject( false, true, true, true )); + DoWhile( new DoWhileObject( false, false, true, false )); + + + function DoWhileObject( out1, out2, out3, in1 ) { + this.breakOutOne = out1; + this.breakOutTwo = out2; + this.breakOutThree = out3; + this.breakIn = in1; + } + function DoWhile( object ) { + result1 = false; + result2 = false; + result3 = false; + result4 = false; + + outie: + do { + if ( object.breakOutOne ) { + break outie; + } + result1 = true; + + innie: + do { + if ( object.breakOutTwo ) { + break outie; + } + result2 = true; + + if ( object.breakIn ) { + break innie; + } + result3 = true; + + } while ( false ); + if ( object.breakOutThree ) { + break outie; + } + result4 = true; + } while ( false ); + + array[item++] = new TestCase( + SECTION, + "break one: ", + (object.breakOutOne) ? false : true, + result1 ); + + array[item++] = new TestCase( + SECTION, + "break two: ", + (object.breakOutOne||object.breakOutTwo) ? false : true, + result2 ); + + array[item++] = new TestCase( + SECTION, + "break three: ", + (object.breakOutOne||object.breakOutTwo||object.breakIn) ? false : true, + result3 ); + + array[item++] = new TestCase( + SECTION, + "break four: ", + (object.breakOutOne||object.breakOutTwo||object.breakOutThree) ? false: true, + result4 ); + } + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Statements/eforin_001.as b/mozilla/js/tamarin/test/ecma3/Statements/eforin_001.as new file mode 100644 index 00000000000..2fc4ca8d1ec --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Statements/eforin_001.as @@ -0,0 +1,388 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "forin-001"; + var VERSION = "ECMA_2"; + var TITLE = "The for...in statement"; + var BUGNUMBER="330890"; + var BUGNUMBER="http://scopus.mcom.com/bugsplat/show_bug.cgi?id=344855"; + + startTest(); + writeHeaderToLog( SECTION + " "+ TITLE); + + var tc = 0; + var testcases = new Array(); + + ForIn_1( { length:4, company:"netscape", year:2000, 0:"zero" } ); + ForIn_2( { length:4, company:"netscape", year:2000, 0:"zero" } ); + ForIn_3( { length:4, company:"netscape", year:2000, 0:"zero" } ); + +// ForIn_6({ length:4, company:"netscape", year:2000, 0:"zero" }); +// ForIn_7({ length:4, company:"netscape", year:2000, 0:"zero" }); + ForIn_8({ length:4, company:"netscape", year:2000, 0:"zero" }); + + test(); + + function ForIn_1( object ) { + PropertyArray = new Array(); + ValueArray = new Array(); + + for ( PropertyArray[PropertyArray.length] in object ) { + ValueArray[ValueArray.length] = + object[PropertyArray[PropertyArray.length-1]]; + + } + + tcCompany = tc+0; + tcLength = tc+1; + tcZero = tc+2; + tcYear = tc+3; + + // need a hack to make sure that the order of test cases + // is constant... ecma stats that the order that for-in + // is run does not have to be constant + for ( var i = 0; i < PropertyArray.length; i++ ) { + + switch( PropertyArray[i] ) { + case "company": + testcases[tcCompany] = new TestCase( + SECTION, + "object[" + PropertyArray[i] +"]", + object[PropertyArray[i]], + ValueArray[i] + ); + tc++; + break; + + case "length": + testcases[tcLength] = new TestCase( + SECTION, + "object[" + PropertyArray[i] +"]", + object[PropertyArray[i]], + ValueArray[i] + ); + tc++; + break; + + case "year": + testcases[tcYear] = new TestCase( + SECTION, + "object[" + PropertyArray[i] +"]", + object[PropertyArray[i]], + ValueArray[i] + ); + tc++; + break; + + case "0": + testcases[tcZero] = new TestCase( + SECTION, + "object[" + PropertyArray[i] +"]", + object[PropertyArray[i]], + ValueArray[i] + ); + tc++; + break; + + } + } + + testcases[tc++] = new TestCase( + SECTION, + "object.length", + PropertyArray.length, + object.length ); + } + + function ForIn_2( object ) { + PropertyArray = new Array(); + ValueArray = new Array(); + var i = 0; + + for ( PropertyArray[i++] in object ) { + ValueArray[ValueArray.length] = + object[PropertyArray[PropertyArray.length-1]]; + } + + tcCompany = tc+0; + tcLength = tc+1; + tcZero = tc+2; + tcYear = tc+3; + + // need a hack to make sure that the order of test cases + // is constant... ecma stats that the order that for-in + // is run does not have to be constant + for ( var i = 0; i < PropertyArray.length; i++ ) { + switch( PropertyArray[i] ) { + case "company": + testcases[tcCompany] = new TestCase( + SECTION, + "object[" + PropertyArray[i] +"]", + object[PropertyArray[i]], + ValueArray[i] + ); + tc++ + break; + + case "length": + testcases[tcLength] = new TestCase( + SECTION, + "object[" + PropertyArray[i] +"]", + object[PropertyArray[i]], + ValueArray[i] + ); + tc++ + break; + + case "year": + testcases[tcYear] = new TestCase( + SECTION, + "object[" + PropertyArray[i] +"]", + object[PropertyArray[i]], + ValueArray[i] + ); + tc++ + break; + + case "0": + testcases[tcZero] = new TestCase( + SECTION, + "object[" + PropertyArray[i] +"]", + object[PropertyArray[i]], + ValueArray[i] + ); + tc++ + break; + + } + } + + testcases[tc++] = new TestCase( + SECTION, + "object.length", + PropertyArray.length, + object.length ); + } + + function ForIn_3( object ) { + var checkBreak = "pass"; + var properties = new Array(); + var values = new Array(); + + for ( properties[properties.length] in object ) { + values[values.length] = object[properties[properties.length-1]]; + break; + checkBreak = "fail"; + } + + testcases[tc++] = new TestCase( + SECTION, + "check break out of for...in", + "pass", + checkBreak ); + + testcases[tc++] = new TestCase( + SECTION, + "properties.length", + 1, + properties.length ); + + // we don't know which one of the properties + // because we can't predict order + var myTest = "PASSED"; + if( values[0] != object[properties[0]] ) + myTest = "FAILED"; + + testcases[tc++] = new TestCase( + SECTION, + "object[properties[0]] == values[0]", + "PASSED", + myTest ); + } + + function ForIn_4( object ) { + var result1 = 0; + var result2 = 0; + var result3 = 0; + var result4 = 0; + var i = 0; + var property = new Array(); + + butterbean: { + result1++; + + for ( property[i++] in object ) { + result2++; + break; + result4++; + } + result3++; + } + + testcases[tc++] = new TestCase( + SECTION, + "verify labeled statement is only executed once", + true, + result1 == 1 ); + + testcases[tc++] = new TestCase( + SECTION, + "verify statements in for loop are evaluated", + true, + result2 == i ); + + testcases[tc++] = new TestCase( + SECTION, + "verify break out of labeled for...in loop", + true, + result4 == 0 ); + + testcases[tc++] = new TestCase( + SECTION, + "verify break out of labeled block", + true, + result3 == 0 ); + } + + function ForIn_5 (object) { + var result1 = 0; + var result2 = 0; + var result3 = 0; + var result4 = 0; + var i = 0; + var property = new Array(); + + bigredbird: { + result1++; + for ( property[i++] in object ) { + result2++; + break bigredbird; + result4++; + } + result3++; + } + + testcases[tc++] = new TestCase( + SECTION, + "verify labeled statement is only executed once", + true, + result1 == 1 ); + + testcases[tc++] = new TestCase( + SECTION, + "verify statements in for loop are evaluated", + true, + result2 == i ); + + testcases[tc++] = new TestCase( + SECTION, + "verify break out of labeled for...in loop", + true, + result4 == 0 ); + + testcases[tc++] = new TestCase( + SECTION, + "verify break out of labeled block", + true, + result3 == 0 ); + } + + function ForIn_7( object ) { + var result1 = 0; + var result2 = 0; + var result3 = 0; + var result4 = 0; + var i = 0; + var property = new Array(); + + bigredbird: + for ( property[i++] in object ) { + result2++; + continue bigredbird; + result4++; + } + + testcases[tc++] = new TestCase( + SECTION, + "verify statements in for loop are evaluated", + true, + result2 == i ); + + testcases[tc++] = new TestCase( + SECTION, + "verify break out of labeled for...in loop", + true, + result4 == 0 ); + + testcases[tc++] = new TestCase( + SECTION, + "verify break out of labeled block", + true, + result3 == 1 ); + } + + + function ForIn_8( object ) { + var checkBreak = "pass"; + var properties = new Array(); + var values = new Array(); + + for ( properties[properties.length] in object ) { + values[values.length] = object[properties[properties.length-1]]; + break; + checkBreak = "fail"; + } + + testcases[tc++] = new TestCase( + SECTION, + "check break out of for...in", + "pass", + checkBreak ); + + testcases[tc++] = new TestCase( + SECTION, + "properties.length", + 1, + properties.length ); + + // we don't know which one of the properties + // because we can't predict order + var myTest = "PASSED"; + if( values[0] != object[properties[0]] ) + myTest = "FAILED"; + + + testcases[tc++] = new TestCase( + SECTION, + "object[properties[0]] == object[properties[0]]", + "PASSED", + myTest ); + } + diff --git a/mozilla/js/tamarin/test/ecma3/Statements/eforin_002.as b/mozilla/js/tamarin/test/ecma3/Statements/eforin_002.as new file mode 100644 index 00000000000..00a315e7e49 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Statements/eforin_002.as @@ -0,0 +1,198 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "forin-002"; + var VERSION = "ECMA_2"; + var TITLE = "The for...in statement"; + + startTest(); + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + function MyObject( value ) { + this.value = value; + this.valueOf = function(){return this.value;} + this.toString = function(){return this.value + '';} + this.toNumber = function(){return this.value + 0;} + this.toBoolean = function(){return Boolean( this.value );} + } + + var resultArray = new Array( "value", "valueOf", "toString", "toNumber", "toBoolean" ); + + //ForIn_1(this); + //ForIn_2(this); + + ForIn_1(new MyObject(true)); + ForIn_2(new MyObject(true)); + //ForIn_2(new MyObject(new Boolean(true))); + + //ForIn_2(3); + + function ForIn_1( object) { + var tcValue = item+0; + var tcValueOf = item+1; + var tcString = item+2; + var tcNumber = item+3; + var tcBoolean = item+4; + + var index = 0; + with ( object ) { + for ( property in object ) { + switch( property ){ + case "value": + array[tcValue] = new TestCase( + SECTION, + "for...in loop in a with loop. ("+object+")["+property +"] == "+ + property, + true, + property == resultArray[0] ); + item++; + break; + + case "valueOf": + array[tcValueOf] = new TestCase( + SECTION, + "for...in loop in a with loop. ("+object+")["+property +"] == "+ + property, + true, + property == resultArray[1] ); + item++; + break; + + case "toString": + array[tcString] = new TestCase( + SECTION, + "for...in loop in a with loop. ("+object+")["+property +"] == "+ + property, + true, + property == resultArray[2] ); + item++; + break; + + case "toNumber": + array[tcNumber] = new TestCase( + SECTION, + "for...in loop in a with loop. ("+object+")["+property +"] == "+ + property, + true, + property == resultArray[3] ); + item++; + break; + + case "toBoolean": + array[tcBoolean] = new TestCase( + SECTION, + "for...in loop in a with loop. ("+object+")["+property +"] == "+ + property, + true, + property == resultArray[4] ); + item++; + break; + + + } + } + } + } + + function ForIn_2(object) { + var tcValue = item+0; + var tcValueOf = item+1; + var tcString = item+2; + var tcNumber = item+3; + var tcBoolean = item+4; + + var index = 0 + for ( property in object ) { + with ( object ) { + switch( property ){ + case "value": + array[tcValue] = new TestCase( + SECTION, + "with loop in a for...in loop. ("+object+")["+property +"] == "+ + property, + true, + property == resultArray[0] ); + item++; + break; + + case "valueOf": + array[tcValueOf] = new TestCase( + SECTION, + "with loop in a for...in loop. ("+object+")["+property +"] == "+ + property, + true, + property == resultArray[1] ); + item++; + break; + + case "toString": + array[tcString] = new TestCase( + SECTION, + "with loop in a for...in loop. ("+object+")["+property +"] == "+ + property, + true, + property == resultArray[2] ); + item++; + break; + + case "toNumber": + array[tcNumber] = new TestCase( + SECTION, + "with loop in a for...in loop. ("+object+")["+property +"] == "+ + property, + true, + property == resultArray[3] ); + item++; + break; + + case "toBoolean": + array[tcBoolean] = new TestCase( + SECTION, + "with loop in a for...in loop. ("+object+")["+property +"] == "+ + property, + true, + property == resultArray[4] ); + item++; + break; + } + + } + } + } + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Statements/eif_001.as b/mozilla/js/tamarin/test/ecma3/Statements/eif_001.as new file mode 100644 index 00000000000..72c9e94c26b --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Statements/eif_001.as @@ -0,0 +1,61 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "for-001"; + var VERSION = "ECMA_2"; + var TITLE = "The if statement"; + var BUGNUMBER="148822"; + + startTest(); + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var a = 0; + var b = 0; + var result = "passed"; + + if ( a = b ) { + result = "failed: a = b should return 0"; + } + + array[item++] = new TestCase( + SECTION, + "if ( a = b ), where a and b are both equal to 0", + "passed", + result ); + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Statements/elabel_001.as b/mozilla/js/tamarin/test/ecma3/Statements/elabel_001.as new file mode 100644 index 00000000000..841f96bcf54 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Statements/elabel_001.as @@ -0,0 +1,64 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "label-003"; + var VERSION = "ECMA_2"; + var TITLE = "Labeled statements"; + + startTest(); + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + LabelTest(0, 0); + LabelTest(1, 1) + LabelTest(-1, 1000); + LabelTest(false, 0); + LabelTest(true, 1); + + test(); + + function LabelTest( limit, expect) { + woo: for ( var result = 0; result < 1000; result++ ) { if (result == limit) { break woo; } else { continue woo; } }; + + array[item++] = new TestCase( + SECTION, + "break out of a labeled for loop: "+ limit, + expect, + result ); + } + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Statements/elabel_002.as b/mozilla/js/tamarin/test/ecma3/Statements/elabel_002.as new file mode 100644 index 00000000000..4a341eaa34c --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Statements/elabel_002.as @@ -0,0 +1,78 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "label-002"; + var VERSION = "ECMA_2"; + var TITLE = "Labeled statements"; + + startTest(); + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + LabelTest( { p1:"hi,", p2:" norris" }, "hi, norris", " norrishi," ); + LabelTest( { 0:"zero", 1:"one" }, "zeroone", "onezero" ); + + LabelTest2( { p1:"hi,", p2:" norris" }, "hi,", " norris" ); + LabelTest2( { 0:"zero", 1:"one" }, "zero", "one" ); + + + + function LabelTest( object, expect1, expect2 ) { + result = ""; + + yoohoo: { for ( property in object ) { result += object[property]; }; break yoohoo }; + + array[item++] = new TestCase( + SECTION, + "yoohoo: for ( property in object ) { result += object[property]; } break yoohoo }", + true, + result == expect1 || result == expect2 ); + } + + function LabelTest2( object, expect1, expect2 ) { + result = ""; + + yoohoo: { for ( property in object ) { result += object[property]; break yoohoo } }; ; + + array[item++] = new TestCase( + SECTION, + "yoohoo: for ( property in object ) { result += object[property]; break yoohoo }}", + true, + result == expect1 || result == expect2 ); + } + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Statements/eregress_131348.as b/mozilla/js/tamarin/test/ecma3/Statements/eregress_131348.as new file mode 100644 index 00000000000..486120132f7 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Statements/eregress_131348.as @@ -0,0 +1,229 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* ***** BEGIN LICENSE BLOCK ***** +* Version: NPL 1.1/GPL 2.0/LGPL 2.1 +* +* The contents of this file are subject to the Netscape Public License +* Version 1.1 (the "License"); you may not use this file except in +* compliance with the License. You may obtain a copy of the License at +* http://www.mozilla.org/NPL/ +* +* Software distributed under the License is distributed on an "AS IS" basis, +* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +* for the specific language governing rights and limitations under the +* License. +* +* The Original Code is JavaScript Engine testing utilities. +* +* The Initial Developer of the Original Code is Netscape Communications Corp. +* Portions created by the Initial Developer are Copyright (C) 2002 +* the Initial Developer. All Rights Reserved. +* +* Contributor(s): pschwartau@netscape.com +* +* Alternatively, the contents of this file may be used under the terms of +* either the GNU General Public License Version 2 or later (the "GPL"), or +* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +* in which case the provisions of the GPL or the LGPL are applicable instead +* of those above. If you wish to allow use of your version of this file only +* under the terms of either the GPL or the LGPL, and not to allow others to +* use your version of this file under the terms of the NPL, indicate your +* decision by deleting the provisions above and replace them with the notice +* and other provisions required by the GPL or the LGPL. If you do not delete +* the provisions above, a recipient may use your version of this file under +* the terms of any one of the NPL, the GPL or the LGPL. +* +* ***** END LICENSE BLOCK ***** +* +* +* Date: 10 Apr 2002 +* Revised: 14 July 2002 +* +* SUMMARY: JS should NOT error on |for(i in undefined)|, |for(i in null)| +* +* ECMA-262 3rd Edition Final spec says such statements SHOULD error. See: +* +* Section 12.6.4 The for-in Statement +* Section 9.9 ToObject +* +* +* But SpiderMonkey has decided NOT to follow this; it's a bug in the spec. +* See http://bugzilla.mozilla.org/show_bug.cgi?id=131348 +* +* Update: Rhino has also decided not to follow the spec on this +* See http://bugzilla.mozilla.org/show_bug.cgi?id=136893 +*/ +//----------------------------------------------------------------------------- + var SECTION = "eregress_131348"; + var VERSION = ""; + var TITLE = "JS should not error on |for(i in undefined)|, |for(i in null)|"; +var bug = 131348; + + startTest(); + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + +var UBound = 0; +var bug = 131348; +var summary = 'JS should not error on |for(i in undefined)|, |for(i in null)|'; +var TEST_PASSED = 'No error'; +var TEST_FAILED = 'An error was generated!!!'; +var status = ''; +var statusitems = []; +var actual = ''; +var actualvalues = []; +var expect= ''; +var expectedvalues = []; + + + +status = inSection(1); +expect = TEST_PASSED; +actual = TEST_PASSED; +try +{ + for (var i in undefined) + { + trace(i); + } +} +catch(e) +{ + actual = TEST_FAILED; +} +//addThis(); +array[item++] = new TestCase(SECTION, status, expect, actual); + + + +status = inSection(2); +expect = TEST_PASSED; +actual = TEST_PASSED; +try +{ + for (var i in null) + { + trace(i); + } +} +catch(e) +{ + actual = TEST_FAILED; +} +//addThis(); +array[item++] = new TestCase(SECTION, status, expect, actual); + + + +status = inSection(3); +expect = TEST_PASSED; +actual = TEST_PASSED; +/* + * Variable names that cannot be looked up generate ReferenceErrors; however, + * property names like obj.ZZZ that cannot be looked up are set to |undefined| + * + * Therefore, this should indirectly test | for (var i in undefined) | + */ +try +{ + for (var i in this.ZZZ) + { + trace(i); + } +} +catch(e) +{ + actual = TEST_FAILED; +} +//addThis(); +array[item++] = new TestCase(SECTION, status, expect, actual); + + + +status = inSection(4); +expect = TEST_PASSED; +actual = TEST_PASSED; +/* + * The result of an unsuccessful regexp match is the null value + * Therefore, this should indirectly test | for (var i in null) | + */ +try +{ + for (var i in 'bbb'.match(/aaa/)) + { + trace(i); + } +} +catch(e) +{ + actual = TEST_FAILED; +} +//addThis(); +array[item++] = new TestCase(SECTION, status, expect, actual); + + + return array; +} + +/* +function addThis() +{ + statusitems[UBound] = status; + actualvalues[UBound] = actual; + expectedvalues[UBound] = expect; + UBound++; +} +*/ + +/* + +function test() +{ + enterFunc('test'); + printBugNumber(bug); + printStatus(summary); + + for (var i=0; i x >= 1 or -1 >= x > -1e21 + + array[item++] = new TestCase( SECTION, "String( 1 )", "1", String( 1 ) ); + array[item++] = new TestCase( SECTION, "String( 10 )", "10", String( 10 ) ); + array[item++] = new TestCase( SECTION, "String( 100 )", "100", String( 100 ) ); + array[item++] = new TestCase( SECTION, "String( 1000 )", "1000", String( 1000 ) ); + array[item++] = new TestCase( SECTION, "String( 10000 )", "10000", String( 10000 ) ); + array[item++] = new TestCase( SECTION, "String( 10000000000 )", "10000000000", String( 10000000000 ) ); + array[item++] = new TestCase( SECTION, "String( 10000000000000000000 )", "10000000000000000000", String( 10000000000000000000 ) ); + array[item++] = new TestCase( SECTION, "String( 100000000000000000000 )","100000000000000000000",String( 100000000000000000000 ) ); + + array[item++] = new TestCase( SECTION, "String( 12345 )", "12345", String( 12345 ) ); + array[item++] = new TestCase( SECTION, "String( 1234567890 )", "1234567890", String( 1234567890 ) ); + + array[item++] = new TestCase( SECTION, "String( -1 )", "-1", String( -1 ) ); + array[item++] = new TestCase( SECTION, "String( -10 )", "-10", String( -10 ) ); + array[item++] = new TestCase( SECTION, "String( -100 )", "-100", String( -100 ) ); + array[item++] = new TestCase( SECTION, "String( -1000 )", "-1000", String( -1000 ) ); + array[item++] = new TestCase( SECTION, "String( -1000000000 )", "-1000000000", String( -1000000000 ) ); + array[item++] = new TestCase( SECTION, "String( -1000000000000000 )", "-1000000000000000", String( -1000000000000000 ) ); + array[item++] = new TestCase( SECTION, "String( -100000000000000000000 )", "-100000000000000000000", String( -100000000000000000000 ) ); + array[item++] = new TestCase( SECTION, "String( -1000000000000000000000 )", "-1e+21", String( -1000000000000000000000 ) ); + + array[item++] = new TestCase( SECTION, "String( -12345 )", "-12345", String( -12345 ) ); + array[item++] = new TestCase( SECTION, "String( -1234567890 )", "-1234567890", String( -1234567890 ) ); + + // cases in step 7: numbers with a fractional component, 1e21> x >1 or -1 > x > -1e21, + array[item++] = new TestCase( SECTION, "String( 1.0000001 )", "1.0000001", String( 1.0000001 ) ); + + + // cases in step 8: fractions between 1 > x > -1, exclusive of 0 and -0 + + // cases in step 9: numbers with 1 significant digit >= 1e+21 or <= 1e-6 + + array[item++] = new TestCase( SECTION, "String( 1000000000000000000000 )", "1e+21", String( 1000000000000000000000 ) ); + array[item++] = new TestCase( SECTION, "String( 10000000000000000000000 )", "1e+22", String( 10000000000000000000000 ) ); + + // cases in step 10: numbers with more than 1 significant digit >= 1e+21 or <= 1e-6 + array[item++] = new TestCase( SECTION, "String( 1.2345 )", "1.2345", String( 1.2345)); + array[item++] = new TestCase( SECTION, "String( 1.234567890 )", "1.23456789", String( 1.234567890 )); + + array[item++] = new TestCase( SECTION, "String( .12345 )", "0.12345", String(.12345 ) ); + array[item++] = new TestCase( SECTION, "String( .012345 )", "0.012345", String(.012345) ); + array[item++] = new TestCase( SECTION, "String( .0012345 )", "0.0012345", String(.0012345) ); + array[item++] = new TestCase( SECTION, "String( .00012345 )", "0.00012345", String(.00012345) ); + array[item++] = new TestCase( SECTION, "String( .000012345 )", "0.000012345", String(.000012345) ); + array[item++] = new TestCase( SECTION, "String( .0000012345 )", "0.0000012345", String(.0000012345) ); + array[item++] = new TestCase( SECTION, "String( .00000012345 )", "1.2345e-7", String(.00000012345)); + + array[item++] = new TestCase( "15.5.2", "String()","",String() ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/String/e15_5_2.as b/mozilla/js/tamarin/test/ecma3/String/e15_5_2.as new file mode 100644 index 00000000000..f0850a25916 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/e15_5_2.as @@ -0,0 +1,152 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.5.2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "The String Constructor"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + String.prototype.myToString=Object.prototype.toString; + TESTSTRING = new String('string primitive'); + + array[item++] = new TestCase( SECTION, "typeof new String('string primitive')", "string", typeof new String('string primitive') ); + array[item++] = new TestCase( SECTION, "var TESTSTRING = new String('string primitive'), TESTSTRING.myToString=Object.prototype.toString,TESTSTRING.myToString()", "[object String]", TESTSTRING.myToString() ); + array[item++] = new TestCase( SECTION, "(new String('string primitive')).valueOf()", 'string primitive', (new String('string primitive')).valueOf() ); + array[item++] = new TestCase( SECTION, "(new String('string primitive')).substring", "function Function() {}",((new String('string primitive')).substring+"") ); + + array[item++] = new TestCase( SECTION, "typeof new String(void 0)", "string", typeof new String(void 0) ); + array[item++] = new TestCase( SECTION, "var TESTSTRING = new String(void 0), TESTSTRING.myToString=Object.prototype.toString,TESTSTRING.myToString()", "[object String]", (TESTSTRING = new String(void 0), TESTSTRING.myToString() ) ); + array[item++] = new TestCase( SECTION, "(new String(void 0)).valueOf()", "undefined", (new String(void 0)).valueOf() ); + array[item++] = new TestCase( SECTION, "(new String(void 0)).toString", "function Function() {}",((new String(void 0)).toString+"") ); + + array[item++] = new TestCase( SECTION, "typeof new String(null)", "string", typeof new String(null) ); + array[item++] = new TestCase( SECTION, "var TESTSTRING = new String(null), TESTSTRING.myToString=Object.prototype.toString,TESTSTRING.myToString()", "[object String]", (TESTSTRING = new String(null), TESTSTRING.myToString() ) ); + array[item++] = new TestCase( SECTION, "(new String(null)).valueOf()", "null", (new String(null)).valueOf() ); + array[item++] = new TestCase( SECTION, "(new String(null)).valueOf", (String.prototype.valueOf+""), ((new String(null)).valueOf+"") ); + + array[item++] = new TestCase( SECTION, "typeof new String(true)", "string", typeof new String(true) ); + array[item++] = new TestCase( SECTION, "var TESTSTRING = new String(true), TESTSTRING.myToString=Object.prototype.toString,TESTSTRING.myToString()", "[object String]", (TESTSTRING = new String(true), TESTSTRING.myToString() ) ); + array[item++] = new TestCase( SECTION, "(new String(true)).valueOf()", "true", (new String(true)).valueOf() ); + array[item++] = new TestCase( SECTION, "(new String(true)).charAt", (String.prototype.charAt+""),((new String(true)).charAt+"") ); + + array[item++] = new TestCase( SECTION, "typeof new String(false)", "string", typeof new String(false) ); + array[item++] = new TestCase( SECTION, "var TESTSTRING = new String(false), TESTSTRING.myToString=Object.prototype.toString,TESTSTRING.myToString()", "[object String]", (TESTSTRING = new String(false), TESTSTRING.myToString() ) ); + array[item++] = new TestCase( SECTION, "(new String(false)).valueOf()", "false", (new String(false)).valueOf() ); + array[item++] = new TestCase( SECTION, "(new String(false)).charCodeAt", (String.prototype.charCodeAt+""), ((new String(false)).charCodeAt+"") ); + + array[item++] = new TestCase( SECTION, "typeof new String(new Boolean(true))", "string", typeof new String(new Boolean(true)) ); + array[item++] = new TestCase( SECTION, "var TESTSTRING = new String(new Boolean(true)), TESTSTRING.toString=Object.prototype.toString,TESTSTRING.toString()", "true", (TESTSTRING = new String(new Boolean(true)), TESTSTRING.toString() ) ); + array[item++] = new TestCase( SECTION, "(new String(new Boolean(true))).valueOf()", "true", (new String(new Boolean(true))).valueOf() ); + array[item++] = new TestCase( SECTION, "(new String(new Boolean(true))).indexOf", (String.prototype.indexOf+""),((new String(new Boolean(true))).indexOf+"") ); + + array[item++] = new TestCase( SECTION, "typeof new String()", "string", typeof new String() ); + array[item++] = new TestCase( SECTION, "var TESTSTRING = new String(), TESTSTRING.myToString=Object.prototype.toString,TESTSTRING.myToString()", "[object String]", (TESTSTRING = new String(), TESTSTRING.myToString() ) ); + array[item++] = new TestCase( SECTION, "(new String()).valueOf()", '', (new String()).valueOf() ); + array[item++] = new TestCase( SECTION, "(new String()).lastIndexOf", (String.prototype.lastIndexOf+""),((new String()).lastIndexOf+"") ); + + array[item++] = new TestCase( SECTION, "typeof new String('')", "string", typeof new String('') ); + array[item++] = new TestCase( SECTION, "var TESTSTRING = new String(''), TESTSTRING.myToString=Object.prototype.toString,TESTSTRING.myToString()", "[object String]", (TESTSTRING = new String(''), TESTSTRING.myToString() ) ); + array[item++] = new TestCase( SECTION, "(new String('')).valueOf()", '', (new String('')).valueOf() ); + array[item++] = new TestCase( SECTION, "(new String('')).split", (String.prototype.split+""),((new String('')).split+"") ); + array[item++] = new TestCase( SECTION, "new String(true)", "true",new String( true) ); + array[item++] = new TestCase( SECTION, "new String(false)", "false", new String( false ) ); + array[item++] = new TestCase( SECTION, "new String(new Array())", "", new String( new Array()) ); + array[item++] = new TestCase( SECTION, "new String(new Array(1,2,3))", "1,2,3", new String( new Array(1,2,3)) ); + array[item++] = new TestCase( SECTION, "new String( Number.NaN )", "NaN", new String( Number.NaN ) ); + array[item++] = new TestCase( SECTION, "new String( 0 )", "0", new String( 0 ) ); + array[item++] = new TestCase( SECTION, "new String( -0 )", "0", new String( -0 ) ); + array[item++] = new TestCase( SECTION, "new String( Number.POSITIVE_INFINITY )", "Infinity", new String( Number.POSITIVE_INFINITY ) ); + array[item++] = new TestCase( SECTION, "new String( Number.NEGATIVE_INFINITY )", "-Infinity", new String( Number.NEGATIVE_INFINITY ) ); + array[item++] = new TestCase( SECTION, "new String( -1 )", "-1", new String( -1 ) ); + + // cases in step 6: integers 1e21 > x >= 1 or -1 >= x > -1e21 + + array[item++] = new TestCase( SECTION, "new String( 1 )", "1", new String( 1 ) ); + array[item++] = new TestCase( SECTION, "new String( 10 )", "10", new String( 10 ) ); + array[item++] = new TestCase( SECTION, "new String( 100 )", "100", new String( 100 ) ); + array[item++] = new TestCase( SECTION, "new String( 1000 )", "1000", new String( 1000 ) ); + array[item++] = new TestCase( SECTION, "new String( 10000 )", "10000", new String( 10000 ) ); + array[item++] = new TestCase( SECTION, "new String( 10000000000 )", "10000000000",new String( 10000000000 ) ); + array[item++] = new TestCase( SECTION, "new String( 10000000000000000000 )", "10000000000000000000", new String( 10000000000000000000 ) ); + array[item++] = new TestCase( SECTION, "new String( 100000000000000000000 )","100000000000000000000",new String( 100000000000000000000 ) ); + + array[item++] = new TestCase( SECTION, "new String( 12345 )", "12345", new String( 12345 ) ); + array[item++] = new TestCase( SECTION, "new String( 1234567890 )", "1234567890", new String( 1234567890) ); + + array[item++] = new TestCase( SECTION, "new String( -1 )", "-1", new String( -1 ) ); + array[item++] = new TestCase( SECTION, "new String( -10 )", "-10", new String( -10 ) ); + array[item++] = new TestCase( SECTION, "new String( -100 )", "-100", new String( -100 ) ); + array[item++] = new TestCase( SECTION, "new String( -1000 )", "-1000", new String( -1000 ) ); + array[item++] = new TestCase( SECTION, "new String( -1000000000 )", "-1000000000", new String( -1000000000 ) ); + array[item++] = new TestCase( SECTION, "new String( -1000000000000000 )", "-1000000000000000", new String( -1000000000000000 ) ); + array[item++] = new TestCase( SECTION, "new String( -100000000000000000000 )", "-100000000000000000000", new String( -100000000000000000000 ) ); + array[item++] = new TestCase( SECTION, "new String( -1000000000000000000000 )", "-1e+21", new String( -1000000000000000000000 ) ); + + array[item++] = new TestCase( SECTION, "new String( -12345 )", "-12345", new String( -12345 ) ); + array[item++] = new TestCase( SECTION, "new String( -1234567890 )", "-1234567890",new String( -1234567890 ) ); + + // cases in step 7: numbers with a fractional component, 1e21> x >1 or -1 > x > -1e21, + array[item++] = new TestCase( SECTION, "new String( 1.0000001 )", "1.0000001",new String( 1.0000001 ) ); + + + // cases in step 8: fractions between 1 > x > -1, exclusive of 0 and -0 + + // cases in step 9: numbers with 1 significant digit >= 1e+21 or <= 1e-6 + + array[item++] = new TestCase( SECTION, "new String( 1000000000000000000000 )", "1e+21", new String( 1000000000000000000000 ) ); + array[item++] = new TestCase( SECTION, "new String( 10000000000000000000000 )", "1e+22",new String( 10000000000000000000000 ) ); + + // cases in step 10: numbers with more than 1 significant digit >= 1e+21 or <= 1e-6 + array[item++] = new TestCase( SECTION, "new String( 1.2345 )", "1.2345",new String( 1.2345)); + array[item++] = new TestCase( SECTION, "new String( 1.234567890 )", "1.23456789",new String( 1.234567890 )); + + array[item++] = new TestCase( SECTION, "new String( .12345 )", "0.12345",new String(.12345 ) ); + array[item++] = new TestCase( SECTION, "new String( .012345 )", "0.012345",new String(.012345) ); + array[item++] = new TestCase( SECTION, "new String( .0012345 )", "0.0012345",new String(.0012345) ); + array[item++] = new TestCase( SECTION, "new String( .00012345 )", "0.00012345",new String(.00012345) ); + array[item++] = new TestCase( SECTION, "new String( .000012345 )", "0.000012345",new String(.000012345) ); + array[item++] = new TestCase( SECTION, "new String( .0000012345 )", "0.0000012345",new String(.0000012345) ); + array[item++] = new TestCase( SECTION, "new String( .00000012345 )", "1.2345e-7",new String(.00000012345)); + + array[item++] = new TestCase( "15.5.2", "new String()","",new String() ); + + return ( array ); +} + diff --git a/mozilla/js/tamarin/test/ecma3/String/e15_5_3.as b/mozilla/js/tamarin/test/ecma3/String/e15_5_3.as new file mode 100644 index 00000000000..8043187a2e8 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/e15_5_3.as @@ -0,0 +1,49 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.5.3"; + var VERSION = "ECMA_2"; + startTest(); + var passed = true; + writeHeaderToLog( SECTION + " Properties of the String Constructor" ); + + var testcases = getTestCases(); + + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "String.prototype", Object.constructor.prototype, String.constructor.prototype); + array[item++] = new TestCase( SECTION, "String.length", 1, String.length ); + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/String/e15_5_3_1_1.as b/mozilla/js/tamarin/test/ecma3/String/e15_5_3_1_1.as new file mode 100644 index 00000000000..4485c4f2a0a --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/e15_5_3_1_1.as @@ -0,0 +1,61 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.5.3.1-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Properties of the String Constructor"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + + // bug 104702 NAB - since we decided String.prototype is a vanilla object + array[item++] = new TestCase( SECTION, "String.prototype.length", undefined, String.prototype.length ); + + var str = ''; + for (p in String ) { + if ( p == 'prototype' ) + str += p; + } str + + array[item++] = new TestCase( SECTION, + "var str='';for ( p in String ) { if ( p == 'prototype' ) str += p; } str", + "", + str ); + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/String/e15_5_3_1_2.as b/mozilla/js/tamarin/test/ecma3/String/e15_5_3_1_2.as new file mode 100644 index 00000000000..b88c1286dc8 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/e15_5_3_1_2.as @@ -0,0 +1,58 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.5.3.1-2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Properties of the String Constructor"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var thisError = "no exception thrown"; + try{ + String.prototype=null; + } catch(e) { + thisError=e.toString() + } finally { + array[item++] = new TestCase( SECTION, + "String.prototype=null;String.prototype", + "ReferenceError: Error #1074", + referenceError( thisError) ); + } + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/String/e15_5_3_1_3.as b/mozilla/js/tamarin/test/ecma3/String/e15_5_3_1_3.as new file mode 100644 index 00000000000..5b5c0a13bed --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/e15_5_3_1_3.as @@ -0,0 +1,48 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.5.3.1-3"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Properties of the String Constructor"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "delete( String.prototype )", false, (delete ( String.prototype )) ); + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/String/e15_5_3_1_4.as b/mozilla/js/tamarin/test/ecma3/String/e15_5_3_1_4.as new file mode 100644 index 00000000000..a3499168890 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/e15_5_3_1_4.as @@ -0,0 +1,49 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.5.3.1-4"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Properties of the String Constructor"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "delete( String.prototype );String.prototype", String.prototype, (delete ( String.prototype ),String.prototype) ); + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/String/e15_5_3_2_1.as b/mozilla/js/tamarin/test/ecma3/String/e15_5_3_2_1.as new file mode 100644 index 00000000000..457008e02ee --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/e15_5_3_2_1.as @@ -0,0 +1,181 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + use namespace AS3; + var SECTION = "15.5.3.2-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "String.fromCharCode()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + + var array = new Array(); + var item = 0; + //var x = new String(); + var thisError="no error"; + array[item++] = new TestCase( SECTION, "typeof String.fromCharCode", "function", typeof String.fromCharCode ); + array[item++] = new TestCase( SECTION, "typeof String.prototype.fromCharCode", "undefined", typeof String.prototype.fromCharCode ); + try{ + var x = new String(); + x.fromCharcode; + }catch(e:ReferenceError){ + thisError=(e.toString()).substring(0,27); + }finally{ + array[item++] = new TestCase( SECTION, "var x = new String(), typeof x.fromCharCode","ReferenceError: Error #1069",thisError); + } + /*array[item++] = new TestCase( SECTION, "var x = new String(), typeof x.fromCharCode","undefined",typeof x.fromCharCode );*/ + array[item++] = new TestCase( SECTION, "String.fromCharCode.length", 0, String.fromCharCode.length ); + array[item++] = new TestCase( SECTION, "String.fromCharCode()", "", String.fromCharCode() ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0020)", " ", String.fromCharCode(0x0020) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0021)", "!", String.fromCharCode(0x0021) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0022)", "\"", String.fromCharCode(0x0022) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0023)", "#", String.fromCharCode(0x0023) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0024)", "$", String.fromCharCode(0x0024) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0025)", "%", String.fromCharCode(0x0025) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0026)", "&", String.fromCharCode(0x0026) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0027)", "\'", String.fromCharCode(0x0027) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0028)", "(", String.fromCharCode(0x0028) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0029)", ")", String.fromCharCode(0x0029) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x002A)", "*", String.fromCharCode(0x002A) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x002B)", "+", String.fromCharCode(0x002B) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x002C)", ",", String.fromCharCode(0x002C) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x002D)", "-", String.fromCharCode(0x002D) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x002E)", ".", String.fromCharCode(0x002E) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x002F)", "/", String.fromCharCode(0x002F) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0030)", "0", String.fromCharCode(0x0030) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0031)", "1", String.fromCharCode(0x0031) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0032)", "2", String.fromCharCode(0x0032) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0033)", "3", String.fromCharCode(0x0033) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0034)", "4", String.fromCharCode(0x0034) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0035)", "5", String.fromCharCode(0x0035) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0036)", "6", String.fromCharCode(0x0036) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0037)", "7", String.fromCharCode(0x0037) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0038)", "8", String.fromCharCode(0x0038) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0039)", "9", String.fromCharCode(0x0039) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x003A)", ":", String.fromCharCode(0x003A) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x003B)", ";", String.fromCharCode(0x003B) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x003C)", "<", String.fromCharCode(0x003C) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x003D)", "=", String.fromCharCode(0x003D) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x003E)", ">", String.fromCharCode(0x003E) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x003F)", "?", String.fromCharCode(0x003F) ); + + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0040)", "@", String.fromCharCode(0x0040) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0041)", "A", String.fromCharCode(0x0041) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0042)", "B", String.fromCharCode(0x0042) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0043)", "C", String.fromCharCode(0x0043) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0044)", "D", String.fromCharCode(0x0044) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0045)", "E", String.fromCharCode(0x0045) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0046)", "F", String.fromCharCode(0x0046) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0047)", "G", String.fromCharCode(0x0047) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0048)", "H", String.fromCharCode(0x0048) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0049)", "I", String.fromCharCode(0x0049) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x004A)", "J", String.fromCharCode(0x004A) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x004B)", "K", String.fromCharCode(0x004B) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x004C)", "L", String.fromCharCode(0x004C) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x004D)", "M", String.fromCharCode(0x004D) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x004E)", "N", String.fromCharCode(0x004E) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x004F)", "O", String.fromCharCode(0x004F) ); + + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0040)", "@", String.fromCharCode(0x0040) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0041)", "A", String.fromCharCode(0x0041) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0042)", "B", String.fromCharCode(0x0042) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0043)", "C", String.fromCharCode(0x0043) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0044)", "D", String.fromCharCode(0x0044) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0045)", "E", String.fromCharCode(0x0045) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0046)", "F", String.fromCharCode(0x0046) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0047)", "G", String.fromCharCode(0x0047) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0048)", "H", String.fromCharCode(0x0048) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0049)", "I", String.fromCharCode(0x0049) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x004A)", "J", String.fromCharCode(0x004A) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x004B)", "K", String.fromCharCode(0x004B) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x004C)", "L", String.fromCharCode(0x004C) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x004D)", "M", String.fromCharCode(0x004D) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x004E)", "N", String.fromCharCode(0x004E) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x004F)", "O", String.fromCharCode(0x004F) ); + + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0050)", "P", String.fromCharCode(0x0050) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0051)", "Q", String.fromCharCode(0x0051) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0052)", "R", String.fromCharCode(0x0052) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0053)", "S", String.fromCharCode(0x0053) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0054)", "T", String.fromCharCode(0x0054) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0055)", "U", String.fromCharCode(0x0055) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0056)", "V", String.fromCharCode(0x0056) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0057)", "W", String.fromCharCode(0x0057) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0058)", "X", String.fromCharCode(0x0058) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0059)", "Y", String.fromCharCode(0x0059) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x005A)", "Z", String.fromCharCode(0x005A) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x005B)", "[", String.fromCharCode(0x005B) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x005C)", "\\", String.fromCharCode(0x005C) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x005D)", "]", String.fromCharCode(0x005D) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x005E)", "^", String.fromCharCode(0x005E) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x005F)", "_", String.fromCharCode(0x005F) ); + + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0060)", "`", String.fromCharCode(0x0060) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0061)", "a", String.fromCharCode(0x0061) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0062)", "b", String.fromCharCode(0x0062) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0063)", "c", String.fromCharCode(0x0063) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0064)", "d", String.fromCharCode(0x0064) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0065)", "e", String.fromCharCode(0x0065) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0066)", "f", String.fromCharCode(0x0066) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0067)", "g", String.fromCharCode(0x0067) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0068)", "h", String.fromCharCode(0x0068) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0069)", "i", String.fromCharCode(0x0069) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x006A)", "j", String.fromCharCode(0x006A) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x006B)", "k", String.fromCharCode(0x006B) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x006C)", "l", String.fromCharCode(0x006C) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x006D)", "m", String.fromCharCode(0x006D) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x006E)", "n", String.fromCharCode(0x006E) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x006F)", "o", String.fromCharCode(0x006F) ); + + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0070)", "p", String.fromCharCode(0x0070) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0071)", "q", String.fromCharCode(0x0071) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0072)", "r", String.fromCharCode(0x0072) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0073)", "s", String.fromCharCode(0x0073) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0074)", "t", String.fromCharCode(0x0074) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0075)", "u", String.fromCharCode(0x0075) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0076)", "v", String.fromCharCode(0x0076) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0077)", "w", String.fromCharCode(0x0077) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0078)", "x", String.fromCharCode(0x0078) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0079)", "y", String.fromCharCode(0x0079) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x007A)", "z", String.fromCharCode(0x007A) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x007B)", "{", String.fromCharCode(0x007B) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x007C)", "|", String.fromCharCode(0x007C) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x007D)", "}", String.fromCharCode(0x007D) ); + array[item++] = new TestCase( SECTION, "String.fromCharCode(0x007E)", "~", String.fromCharCode(0x007E) ); +// array[item++] = new TestCase( SECTION, "String.fromCharCode(0x0020, 0x007F)", "", String.fromCharCode(0x0040, 0x007F) ); + + return array; +} + diff --git a/mozilla/js/tamarin/test/ecma3/String/e15_5_3_2_2.as b/mozilla/js/tamarin/test/ecma3/String/e15_5_3_2_2.as new file mode 100644 index 00000000000..ae7da96779b --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/e15_5_3_2_2.as @@ -0,0 +1,79 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.5.3.2-2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "String.fromCharCode()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + + + + var args=''; + for ( i = 0x0020; i < 0x007f; i++ ) { + args += ( i == 0x007e ) ? i : i + ', '; + } + + //print (args); + + var MYSTRING = String.fromCharCode( 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126 ); + + array[item++] = new TestCase( SECTION, + "var MYSTRING = String.fromCharCode( args)", + " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~", + MYSTRING); + + /* + var MYSTRING = String.fromCharCode(args); + array[item++] = new TestCase( SECTION, + "MYSTRING", + " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~", + MYSTRING); + */ + array[item++] = new TestCase( SECTION, + "MYSTRING.length", + 0x007f - 0x0020, + MYSTRING.length ); + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/String/e15_5_3_2_3.as b/mozilla/js/tamarin/test/ecma3/String/e15_5_3_2_3.as new file mode 100644 index 00000000000..313f27ea5b4 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/e15_5_3_2_3.as @@ -0,0 +1,100 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.5.3.2-3"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "String.fromCharCode()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + for ( CHARCODE = 0; CHARCODE < 256; CHARCODE++ ) { + array[item++] = new TestCase( SECTION, + "(String.fromCharCode(" + CHARCODE +")).charCodeAt(0)", + ToUint16(CHARCODE), + (String.fromCharCode(CHARCODE)).charCodeAt(0) + ); + } + for ( CHARCODE = 256; CHARCODE < 65536; CHARCODE+=333 ) { + array[item++] = new TestCase( SECTION, + "(String.fromCharCode(" + CHARCODE +")).charCodeAt(0)", + ToUint16(CHARCODE), + (String.fromCharCode(CHARCODE)).charCodeAt(0) + ); + } + for ( CHARCODE = 65535; CHARCODE < 65538; CHARCODE++ ) { + array[item++] = new TestCase( SECTION, + "(String.fromCharCode(" + CHARCODE +")).charCodeAt(0)", + ToUint16(CHARCODE), + (String.fromCharCode(CHARCODE)).charCodeAt(0) + ); + } + for ( CHARCODE = Math.pow(2,32)-1; CHARCODE < Math.pow(2,32)+1; CHARCODE++ ) { + array[item++] = new TestCase( SECTION, + "(String.fromCharCode(" + CHARCODE +")).charCodeAt(0)", + ToUint16(CHARCODE), + (String.fromCharCode(CHARCODE)).charCodeAt(0) + ); + } + for ( CHARCODE = 0; CHARCODE > -65536; CHARCODE-=3333 ) { + array[item++] = new TestCase( SECTION, + "(String.fromCharCode(" + CHARCODE +")).charCodeAt(0)", + ToUint16(CHARCODE), + (String.fromCharCode(CHARCODE)).charCodeAt(0) + ); + } + array[item++] = new TestCase( SECTION, "(String.fromCharCode(65535)).charCodeAt(0)", 65535, (String.fromCharCode(65535)).charCodeAt(0) ); + array[item++] = new TestCase( SECTION, "(String.fromCharCode(65536)).charCodeAt(0)", 0, (String.fromCharCode(65536)).charCodeAt(0) ); + array[item++] = new TestCase( SECTION, "(String.fromCharCode(65537)).charCodeAt(0)", 1, (String.fromCharCode(65537)).charCodeAt(0) ); + + return array; +} +function ToUint16( num ) { + num = Number( num ); + if ( isNaN( num ) || num == 0 || num == Number.POSITIVE_INFINITY || num == Number.NEGATIVE_INFINITY ) { + return 0; + } + + var sign = ( num < 0 ) ? -1 : 1; + + num = sign * Math.floor( Math.abs( num ) ); + num = num % Math.pow(2,16); + num = ( num > -65536 && num < 0) ? 65536 + num : num; + return num; +} + diff --git a/mozilla/js/tamarin/test/ecma3/String/e15_5_4.as b/mozilla/js/tamarin/test/ecma3/String/e15_5_4.as new file mode 100644 index 00000000000..5e4eff2b95f --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/e15_5_4.as @@ -0,0 +1,62 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.5.4"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Properties of the String Prototype object"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "typeof String.prototype", "object", typeof String.prototype ); + array[item++] = new TestCase( SECTION, "String.prototype.valueOf()", + "", + (String.prototype.valueOf()).toString() ); + var origStringGetClass = String.prototype.getClass; + array[item++] = new TestCase( SECTION, + "String.prototype.getClass = Object.prototype.toString; String.prototype.getClass()", + "[object Object]", + (String.prototype.getClass = Object.prototype.toString, String.prototype.getClass()) ); + array[item++] = new TestCase( SECTION, "String.prototype +''", "", String.prototype + '' ); + array[item++] = new TestCase( SECTION, "String.prototype.length", undefined, String.prototype.length ); + array[item++] = new TestCase( SECTION, "String.length", 1, String.length ); + + //restore + String.prototype.getClass = origStringGetClass; + return ( array ); +} + diff --git a/mozilla/js/tamarin/test/ecma3/String/e15_5_4_10_1_rt.as b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_10_1_rt.as new file mode 100644 index 00000000000..9e233c8a638 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_10_1_rt.as @@ -0,0 +1,226 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +/* +//s = new String('this is a string object'); +//s.substring(Infinity, Infinity) +a = -22; +b = -a; +b = 0 - a; +x = -Infinity; +//y = Infinity; +*/ + + var SECTION = "15.5.4.10-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "String.prototype.substring( start, end )"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, "String.prototype.substring.length", 2, String.prototype.substring.length ); + array[item++] = new TestCase( SECTION, "delete String.prototype.substring.length", false, delete String.prototype.substring.length ); + array[item++] = new TestCase( SECTION, "delete String.prototype.substring.length; String.prototype.substring.length", 2, (delete String.prototype.substring.length, String.prototype.substring.length) ); + + // test cases for when substring is called with no arguments. + + // this is a string object + + array[item++] = new TestCase( SECTION, + "var s = new String('this is a string object'); typeof s.substring()", + "string", + (s = new String('this is a string object'), typeof s.substring() ) ); + + array[item++] = new TestCase( SECTION, + "var s = new String(''); s.substring(1,0)", + "", + (s = new String(''), s.substring(1,0) ) ); + + array[item++] = new TestCase( SECTION, + "var s = new String('this is a string object'); s.substring(true, false)", + "t", + (s = new String('this is a string object'), s.substring(false, true) ) ); + + array[item++] = new TestCase( SECTION, + "var s = new String('this is a string object'); s.substring(NaN, Infinity)", + "this is a string object", + (s = new String('this is a string object'), s.substring(NaN, Infinity) ) ); + + + array[item++] = new TestCase( SECTION, + "var s = new String('this is a string object'); s.substring(Infinity, NaN)", + "this is a string object", + (s = new String('this is a string object'), s.substring(Infinity, NaN) ) ); + + + array[item++] = new TestCase( SECTION, + "var s = new String('this is a string object'); s.substring(Infinity, Infinity)", + "", + (s = new String('this is a string object'), s.substring(Infinity, Infinity) ) ); + + array[item++] = new TestCase( SECTION, + "var s = new String('this is a string object'); s.substring(-0.01, 0)", + "", + (s = new String('this is a string object'), s.substring(-0.01,0) ) ); + + + array[item++] = new TestCase( SECTION, + "var s = new String('this is a string object'); s.substring(s.length, s.length)", + "", + (s = new String('this is a string object'), s.substring(s.length, s.length) ) ); + + array[item++] = new TestCase( SECTION, + "var s = new String('this is a string object'); s.substring(s.length+1, 0)", + "this is a string object", + (s = new String('this is a string object'), s.substring(s.length+1, 0) ) ); + + array[item++] = new TestCase( SECTION, + "var s = new String('this is a string object'); s.substring(-Infinity, -Infinity)", + "", + (s = new String('this is a string object'), s.substring(-Infinity, -Infinity) ) ); + + // this is not a String object, start is not an integer + + + array[item++] = new TestCase( SECTION, + "var s = new Array(1,2,3,4,5); s.substring = String.prototype.substring; s.substring(Infinity,-Infinity)", + "1,2,3,4,5", + (s = new Array(1,2,3,4,5), s.substring = String.prototype.substring, s.substring(Infinity,-Infinity) ) ); + + array[item++] = new TestCase( SECTION, + "var s = new Array(1,2,3,4,5); s.substring = String.prototype.substring; s.substring(9,-Infinity)", + "1,2,3,4,5", + (s = new Array(1,2,3,4,5), s.substring = String.prototype.substring, s.substring(9,-Infinity) ) ); + + + array[item++] = new TestCase( SECTION, + "var s = new Array(1,2,3,4,5); s.substring = String.prototype.substring; s.substring(true, false)", + "1", + (s = new Array(1,2,3,4,5), s.substring = String.prototype.substring, s.substring(true, false) ) ); + + array[item++] = new TestCase( SECTION, + "var s = new Array(1,2,3,4,5); s.substring = String.prototype.substring; s.substring('4', '5')", + "3", + (s = new Array(1,2,3,4,5), s.substring = String.prototype.substring, s.substring('4', '5') ) ); + + + // this is an object object + array[item++] = new TestCase( SECTION, + "var obj = new Object(); obj.substring = String.prototype.substring; obj.substring(8,0)", + "[object ", + (obj = new Object(), obj.substring = String.prototype.substring, obj.substring(8,0) ) ); + + array[item++] = new TestCase( SECTION, + "var obj = new Object(); obj.substring = String.prototype.substring; obj.substring(8,obj.toString().length)", + "Object]", + (obj = new Object(), obj.substring = String.prototype.substring, obj.substring(8, obj.toString().length) ) ); + + + // this is a function object + /* array[item++] = new TestCase( SECTION, + "var obj = function() {}; obj.substring = String.prototype.substring; obj.toString = Object.prototype.toString; obj.substring(8, Infinity)", + "Function]", + (obj = function() {}, obj.substring = String.prototype.substring,obj.toString = Object.prototype.toString; obj.substring(8,Infinity) ) );*/ + + array[item++] = new TestCase( SECTION, + "var obj = function() {}; obj.substring = String.prototype.substring; obj.toString = Object.prototype.toString; obj.substring(8, Infinity)", + " Function() {}", + (obj = function() {}, obj.substring = String.prototype.substring, obj.substring(8,Infinity) ) ); + + // this is a number object + thisError="no error"; + try{ + var obj = new Number(NaN); + obj.substring = String.prototype.substring; + obj.substring(Infinity, NaN); + }catch(e2:Error){ + thisError=e2.toString(); + }finally{ + array[item++] = new TestCase( SECTION, + "var obj = new Number(NaN); obj.substring = String.prototype.substring; obj.substring(Infinity, NaN)", + "ReferenceError: Error #1056", + thisError.substring(0,27) ); + } + /*array[item++] = new TestCase( SECTION, + "var obj = new Number(NaN); obj.substring = String.prototype.substring; obj.substring(Infinity, NaN)", + "NaN", + (obj = new Number(NaN), obj.substring = String.prototype.substring, obj.substring(Infinity, NaN) ) );*/ + + + // this is the Math object + array[item++] = new TestCase( SECTION, + "var obj = Math; obj.substring = String.prototype.substring; obj.substring(Math.PI, -10)", + "[cl", + (obj = Math, obj.substring = String.prototype.substring, obj.substring(Math.PI, -10) ) ); + + // this is a Boolean object + thisError="no error"; + try{ + var obj = new Boolean(); + obj.substring = String.prototype.substring; + obj.substring(new Array(), new Boolean(1)); + }catch(e:Error){ + thisError=e.toString(); + }finally{ + array[item++] = new TestCase( SECTION, + "var obj = new Boolean(); obj.substring = String.prototype.substring; obj.substring(new Array(), new Boolean(1))", + "ReferenceError: Error #1056", + thisError.substring(0,27) ); + } + + + + /*array[item++] = new TestCase( SECTION, + "var obj = new Boolean(); obj.substring = String.prototype.substring; obj.substring(new Array(), new Boolean(1))", + "f", + (obj = new Boolean(), obj.substring = String.prototype.substring, obj.substring(new Array(), new Boolean(1)) ) );*/ + + // this is a user defined object + array[item++] = new TestCase( SECTION, + "var obj = new MyObject( void 0 ); obj.substring(0, 100)", + "undefined", + (obj = new MyObject( void 0 ), obj.substring(0,100) )); + + return array; +} + +function MyObject( value ) { + this.value = value; + this.substring = String.prototype.substring; + this.toString = function() { return this.value+''; } +} + diff --git a/mozilla/js/tamarin/test/ecma3/String/e15_5_4_11_1.as b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_11_1.as new file mode 100644 index 00000000000..fde896c075a --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_11_1.as @@ -0,0 +1,496 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.5.4.11-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "String.prototype.toLowerCase()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "String.prototype.toLowerCase.length", 0, String.prototype.toLowerCase.length ); + array[item++] = new TestCase( SECTION, "delete String.prototype.toLowerCase.length", false, delete String.prototype.toLowerCase.length ); + array[item++] = new TestCase( SECTION, "delete String.prototype.toLowerCase.length; String.prototype.toLowerCase.length", 0, (delete String.prototype.toLowerCase.length, String.prototype.toLowerCase.length) ); + + // Basic Latin, Latin-1 Supplement, Latin Extended A + for ( var i = 0; i <= 0x017f; i++ ) { + var U = new Unicode(i); + var s = new String(String.fromCharCode(i)); +/* + array[item++] = new TestCase( SECTION, + "var s = new String( String.fromCharCode("+i+") ); s.toLowerCase()", + String.fromCharCode(U.lower), + (s = new String( String.fromCharCode("+i+ ) ), s.toLowerCase()") ); +*/ + array[item++] = new TestCase( SECTION, + "var s = new String( String.fromCharCode("+i+") ); s.toLowerCase().charCodeAt(0)", + U.lower, + ( s.toLowerCase().charCodeAt(0) ) ); + + } + + return array; +} +function MyObject( value ) { + this.value = value; + this.substring = String.prototype.substring; + this.toString = function() { return this.value+'';} +} +function Unicode( c ) { + u = GetUnicodeValues( c ); + this.upper = u[0]; + this.lower = u[1] + return this; +} +function GetUnicodeValues( c ) { + u = new Array(); + + u[0] = c; + u[1] = c; + + // upper case Basic Latin + + if ( c >= 0x0041 && c <= 0x005A) { + u[0] = c; + u[1] = c + 32; + return u; + } + + // lower case Basic Latin + if ( c >= 0x0061 && c <= 0x007a ) { + u[0] = c - 32; + u[1] = c; + return u; + } + + // upper case Latin-1 Supplement + if ( (c >= 0x00C0 && c <= 0x00D6) || (c >= 0x00D8 && c<=0x00DE) ) { + u[0] = c; + u[1] = c + 32; + return u; + } + + // lower case Latin-1 Supplement + if ( (c >= 0x00E0 && c <= 0x00F6) || (c >= 0x00F8 && c <= 0x00FE) ) { + u[0] = c - 32; + u[1] = c; + return u; + } + if ( c == 0x00FF ) { + u[0] = 0x0178; + u[1] = c; + return u; + } + // Latin Extended A + if ( (c >= 0x0100 && c < 0x0138) || (c > 0x0149 && c < 0x0178) ) { + // special case for capital I + if ( c == 0x0130 ) { + u[0] = c; + u[1] = 0x0069; + return u; + } + if ( c == 0x0131 ) { + u[0] = 0x0049; + u[1] = c; + return u; + } + + if ( c % 2 == 0 ) { + // if it's even, it's a capital and the lower case is c +1 + u[0] = c; + u[1] = c+1; + } else { + // if it's odd, it's a lower case and upper case is c-1 + u[0] = c-1; + u[1] = c; + } + return u; + } + if ( c == 0x0178 ) { + u[0] = c; + u[1] = 0x00FF; + return u; + } + + if ( (c >= 0x0139 && c < 0x0149) || (c > 0x0178 && c < 0x017F) ) { + if ( c % 2 == 1 ) { + // if it's odd, it's a capital and the lower case is c +1 + u[0] = c; + u[1] = c+1; + } else { + // if it's even, it's a lower case and upper case is c-1 + u[0] = c-1; + u[1] = c; + } + return u; + } + if ( c == 0x017F ) { + u[0] = 0x0053; + u[1] = c; + } + + // Latin Extended B + // need to improve this set + + if ( c >= 0x0200 && c <= 0x0217 ) { + if ( c % 2 == 0 ) { + u[0] = c; + u[1] = c+1; + } else { + u[0] = c-1; + u[1] = c; + } + return u; + } + + // Latin Extended Additional + // Range: U+1E00 to U+1EFF + // http://www.unicode.org/Unicode.charts/glyphless/U1E00.html + + // Spacing Modifier Leters + // Range: U+02B0 to U+02FF + + // Combining Diacritical Marks + // Range: U+0300 to U+036F + + // skip Greek for now + // Greek + // Range: U+0370 to U+03FF + + // Cyrillic + // Range: U+0400 to U+04FF + + if ( (c >= 0x0401 && c <= 0x040C) || ( c>= 0x040E && c <= 0x040F ) ) { + u[0] = c; + u[1] = c + 80; + return u; + } + + + if ( c >= 0x0410 && c <= 0x042F ) { + u[0] = c; + u[1] = c + 32; + return u; + } + + if ( c >= 0x0430 && c<= 0x044F ) { + u[0] = c - 32; + u[1] = c; + return u; + + } + if ( (c >= 0x0451 && c <= 0x045C) || (c >=0x045E && c<= 0x045F) ) { + u[0] = c -80; + u[1] = c; + return u; + } + + if ( c >= 0x0460 && c <= 0x047F ) { + if ( c % 2 == 0 ) { + u[0] = c; + u[1] = c +1; + } else { + u[0] = c - 1; + u[1] = c; + } + return u; + } + + // Armenian + // Range: U+0530 to U+058F + if ( c >= 0x0531 && c <= 0x0556 ) { + u[0] = c; + u[1] = c + 48; + return u; + } + if ( c >= 0x0561 && c < 0x0587 ) { + u[0] = c - 48; + u[1] = c; + return u; + } + + // Hebrew + // Range: U+0590 to U+05FF + + + // Arabic + // Range: U+0600 to U+06FF + + // Devanagari + // Range: U+0900 to U+097F + + + // Bengali + // Range: U+0980 to U+09FF + + + // Gurmukhi + // Range: U+0A00 to U+0A7F + + + // Gujarati + // Range: U+0A80 to U+0AFF + + + // Oriya + // Range: U+0B00 to U+0B7F + // no capital / lower case + + + // Tamil + // Range: U+0B80 to U+0BFF + // no capital / lower case + + + // Telugu + // Range: U+0C00 to U+0C7F + // no capital / lower case + + + // Kannada + // Range: U+0C80 to U+0CFF + // no capital / lower case + + + // Malayalam + // Range: U+0D00 to U+0D7F + + // Thai + // Range: U+0E00 to U+0E7F + + + // Lao + // Range: U+0E80 to U+0EFF + + + // Tibetan + // Range: U+0F00 to U+0FBF + + // Georgian + // Range: U+10A0 to U+10F0 + if ( c >= 0x10A0 && c <= 0x10C5 ) { + u[0] = c; + u[1] = c + 48; + return u; + } + if ( c >= 0x10D0 && c <= 0x10F5 ) { + u[0] = c; + u[1] = c; + return u; + } + + // Hangul Jamo + // Range: U+1100 to U+11FF + + // Greek Extended + // Range: U+1F00 to U+1FFF + // skip for now + + + // General Punctuation + // Range: U+2000 to U+206F + + // Superscripts and Subscripts + // Range: U+2070 to U+209F + + // Currency Symbols + // Range: U+20A0 to U+20CF + + + // Combining Diacritical Marks for Symbols + // Range: U+20D0 to U+20FF + // skip for now + + + // Number Forms + // Range: U+2150 to U+218F + // skip for now + + + // Arrows + // Range: U+2190 to U+21FF + + // Mathematical Operators + // Range: U+2200 to U+22FF + + // Miscellaneous Technical + // Range: U+2300 to U+23FF + + // Control Pictures + // Range: U+2400 to U+243F + + // Optical Character Recognition + // Range: U+2440 to U+245F + + // Enclosed Alphanumerics + // Range: U+2460 to U+24FF + + // Box Drawing + // Range: U+2500 to U+257F + + // Block Elements + // Range: U+2580 to U+259F + + // Geometric Shapes + // Range: U+25A0 to U+25FF + + // Miscellaneous Symbols + // Range: U+2600 to U+26FF + + // Dingbats + // Range: U+2700 to U+27BF + + // CJK Symbols and Punctuation + // Range: U+3000 to U+303F + + // Hiragana + // Range: U+3040 to U+309F + + // Katakana + // Range: U+30A0 to U+30FF + + // Bopomofo + // Range: U+3100 to U+312F + + // Hangul Compatibility Jamo + // Range: U+3130 to U+318F + + // Kanbun + // Range: U+3190 to U+319F + + + // Enclosed CJK Letters and Months + // Range: U+3200 to U+32FF + + // CJK Compatibility + // Range: U+3300 to U+33FF + + // Hangul Syllables + // Range: U+AC00 to U+D7A3 + + // High Surrogates + // Range: U+D800 to U+DB7F + + // Private Use High Surrogates + // Range: U+DB80 to U+DBFF + + // Low Surrogates + // Range: U+DC00 to U+DFFF + + // Private Use Area + // Range: U+E000 to U+F8FF + + // CJK Compatibility Ideographs + // Range: U+F900 to U+FAFF + + // Alphabetic Presentation Forms + // Range: U+FB00 to U+FB4F + + // Arabic Presentation Forms-A + // Range: U+FB50 to U+FDFF + + // Combining Half Marks + // Range: U+FE20 to U+FE2F + + // CJK Compatibility Forms + // Range: U+FE30 to U+FE4F + + // Small Form Variants + // Range: U+FE50 to U+FE6F + + // Arabic Presentation Forms-B + // Range: U+FE70 to U+FEFF + + // Halfwidth and Fullwidth Forms + // Range: U+FF00 to U+FFEF + + if ( c >= 0xFF21 && c <= 0xFF3A ) { + u[0] = c; + u[1] = c + 32; + return u; + } + + if ( c >= 0xFF41 && c <= 0xFF5A ) { + u[0] = c - 32; + u[1] = c; + return u; + } + + // Specials + // Range: U+FFF0 to U+FFFF + + return u; +} + +function DecimalToHexString( n ) { + n = Number( n ); + var h = "0x"; + + for ( var i = 3; i >= 0; i-- ) { + if ( n >= Math.pow(16, i) ){ + var t = Math.floor( n / Math.pow(16, i)); + n -= t * Math.pow(16, i); + if ( t >= 10 ) { + if ( t == 10 ) { + h += "A"; + } + if ( t == 11 ) { + h += "B"; + } + if ( t == 12 ) { + h += "C"; + } + if ( t == 13 ) { + h += "D"; + } + if ( t == 14 ) { + h += "E"; + } + if ( t == 15 ) { + h += "F"; + } + } else { + h += String( t ); + } + } else { + h += "0"; + } + } + + return h; +} diff --git a/mozilla/js/tamarin/test/ecma3/String/e15_5_4_11_2.as b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_11_2.as new file mode 100644 index 00000000000..322dd0b2f16 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_11_2.as @@ -0,0 +1,493 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.5.4.11-2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "String.prototype.toLowerCase()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // Georgian + // Range: U+10A0 to U+10FF + for ( var i = 0x10A0; i <= 0x10FF; i++ ) { + var U = new Unicode( i ); + +/* + array[item++] = new TestCase( SECTION, + "var s = new String( String.fromCharCode("+i+") ); s.toLowerCase()", + String.fromCharCode(U.lower), + (s = new String( String.fromCharCode("+i+ ) ), s.toLowerCase()") ); +*/ + array[item++] = new TestCase( SECTION, + "var s = new String( String.fromCharCode("+i+") ); s.toLowerCase().charCodeAt(0)", + U.lower, + (s = new String( String.fromCharCode(i) ), s.toLowerCase().charCodeAt(0) ) ); + } + + return array; +} + +function MyObject( value ) { + this.value = value; + this.substring = String.prototype.substring; + this.toString = function() { return this.value+''; } +} +function Unicode( c ) { + u = GetUnicodeValues( c ); + this.upper = u[0]; + this.lower = u[1] + return this; +} +function GetUnicodeValues( c ) { + u = new Array(); + + u[0] = c; + u[1] = c; + + // upper case Basic Latin + + if ( c >= 0x0041 && c <= 0x005A) { + u[0] = c; + u[1] = c + 32; + return u; + } + + // lower case Basic Latin + if ( c >= 0x0061 && c <= 0x007a ) { + u[0] = c - 32; + u[1] = c; + return u; + } + + // upper case Latin-1 Supplement + if ( (c >= 0x00C0 && c <= 0x00D6) || (c >= 0x00D8 && c<=0x00DE) ) { + u[0] = c; + u[1] = c + 32; + return u; + } + + // lower case Latin-1 Supplement + if ( (c >= 0x00E0 && c <= 0x00F6) || (c >= 0x00F8 && c <= 0x00FE) ) { + u[0] = c - 32; + u[1] = c; + return u; + } + if ( c == 0x00FF ) { + u[0] = 0x0178; + u[1] = c; + return u; + } + // Latin Extended A + if ( (c >= 0x0100 && c < 0x0138) || (c > 0x0149 && c < 0x0178) ) { + // special case for capital I + if ( c == 0x0130 ) { + u[0] = c; + u[1] = 0x0069; + return u; + } + if ( c == 0x0131 ) { + u[0] = 0x0049; + u[1] = c; + return u; + } + + if ( c % 2 == 0 ) { + // if it's even, it's a capital and the lower case is c +1 + u[0] = c; + u[1] = c+1; + } else { + // if it's odd, it's a lower case and upper case is c-1 + u[0] = c-1; + u[1] = c; + } + return u; + } + if ( c == 0x0178 ) { + u[0] = c; + u[1] = 0x00FF; + return u; + } + + if ( (c >= 0x0139 && c < 0x0149) || (c > 0x0178 && c < 0x017F) ) { + if ( c % 2 == 1 ) { + // if it's odd, it's a capital and the lower case is c +1 + u[0] = c; + u[1] = c+1; + } else { + // if it's even, it's a lower case and upper case is c-1 + u[0] = c-1; + u[1] = c; + } + return u; + } + if ( c == 0x017F ) { + u[0] = 0x0053; + u[1] = c; + } + + // Latin Extended B + // need to improve this set + + if ( c >= 0x0200 && c <= 0x0217 ) { + if ( c % 2 == 0 ) { + u[0] = c; + u[1] = c+1; + } else { + u[0] = c-1; + u[1] = c; + } + return u; + } + + // Latin Extended Additional + // Range: U+1E00 to U+1EFF + // http://www.unicode.org/Unicode.charts/glyphless/U1E00.html + + // Spacing Modifier Leters + // Range: U+02B0 to U+02FF + + // Combining Diacritical Marks + // Range: U+0300 to U+036F + + // skip Greek for now + // Greek + // Range: U+0370 to U+03FF + + // Cyrillic + // Range: U+0400 to U+04FF + + if ( (c >= 0x0401 && c <= 0x040C) || ( c>= 0x040E && c <= 0x040F ) ) { + u[0] = c; + u[1] = c + 80; + return u; + } + + + if ( c >= 0x0410 && c <= 0x042F ) { + u[0] = c; + u[1] = c + 32; + return u; + } + + if ( c >= 0x0430 && c<= 0x044F ) { + u[0] = c - 32; + u[1] = c; + return u; + + } + if ( (c >= 0x0451 && c <= 0x045C) || (c >=0x045E && c<= 0x045F) ) { + u[0] = c -80; + u[1] = c; + return u; + } + + if ( c >= 0x0460 && c <= 0x047F ) { + if ( c % 2 == 0 ) { + u[0] = c; + u[1] = c +1; + } else { + u[0] = c - 1; + u[1] = c; + } + return u; + } + + // Armenian + // Range: U+0530 to U+058F + if ( c >= 0x0531 && c <= 0x0556 ) { + u[0] = c; + u[1] = c + 48; + return u; + } + if ( c >= 0x0561 && c < 0x0587 ) { + u[0] = c - 48; + u[1] = c; + return u; + } + + // Hebrew + // Range: U+0590 to U+05FF + + + // Arabic + // Range: U+0600 to U+06FF + + // Devanagari + // Range: U+0900 to U+097F + + + // Bengali + // Range: U+0980 to U+09FF + + + // Gurmukhi + // Range: U+0A00 to U+0A7F + + + // Gujarati + // Range: U+0A80 to U+0AFF + + + // Oriya + // Range: U+0B00 to U+0B7F + // no capital / lower case + + + // Tamil + // Range: U+0B80 to U+0BFF + // no capital / lower case + + + // Telugu + // Range: U+0C00 to U+0C7F + // no capital / lower case + + + // Kannada + // Range: U+0C80 to U+0CFF + // no capital / lower case + + + // Malayalam + // Range: U+0D00 to U+0D7F + + // Thai + // Range: U+0E00 to U+0E7F + + + // Lao + // Range: U+0E80 to U+0EFF + + + // Tibetan + // Range: U+0F00 to U+0FBF + + // Georgian + // Range: U+10A0 to U+10F0 + if ( c >= 0x10A0 && c <= 0x10C5 ) { + u[0] = c; + u[1] = c + 48; + return u; + } + + if ( c >= 0x10D0 && c <= 0x10F5 ) { + u[0] = c; + u[1] = c; + return u; + } + + // Hangul Jamo + // Range: U+1100 to U+11FF + + // Greek Extended + // Range: U+1F00 to U+1FFF + // skip for now + + + // General Punctuation + // Range: U+2000 to U+206F + + // Superscripts and Subscripts + // Range: U+2070 to U+209F + + // Currency Symbols + // Range: U+20A0 to U+20CF + + + // Combining Diacritical Marks for Symbols + // Range: U+20D0 to U+20FF + // skip for now + + + // Number Forms + // Range: U+2150 to U+218F + // skip for now + + + // Arrows + // Range: U+2190 to U+21FF + + // Mathematical Operators + // Range: U+2200 to U+22FF + + // Miscellaneous Technical + // Range: U+2300 to U+23FF + + // Control Pictures + // Range: U+2400 to U+243F + + // Optical Character Recognition + // Range: U+2440 to U+245F + + // Enclosed Alphanumerics + // Range: U+2460 to U+24FF + + // Box Drawing + // Range: U+2500 to U+257F + + // Block Elements + // Range: U+2580 to U+259F + + // Geometric Shapes + // Range: U+25A0 to U+25FF + + // Miscellaneous Symbols + // Range: U+2600 to U+26FF + + // Dingbats + // Range: U+2700 to U+27BF + + // CJK Symbols and Punctuation + // Range: U+3000 to U+303F + + // Hiragana + // Range: U+3040 to U+309F + + // Katakana + // Range: U+30A0 to U+30FF + + // Bopomofo + // Range: U+3100 to U+312F + + // Hangul Compatibility Jamo + // Range: U+3130 to U+318F + + // Kanbun + // Range: U+3190 to U+319F + + + // Enclosed CJK Letters and Months + // Range: U+3200 to U+32FF + + // CJK Compatibility + // Range: U+3300 to U+33FF + + // Hangul Syllables + // Range: U+AC00 to U+D7A3 + + // High Surrogates + // Range: U+D800 to U+DB7F + + // Private Use High Surrogates + // Range: U+DB80 to U+DBFF + + // Low Surrogates + // Range: U+DC00 to U+DFFF + + // Private Use Area + // Range: U+E000 to U+F8FF + + // CJK Compatibility Ideographs + // Range: U+F900 to U+FAFF + + // Alphabetic Presentation Forms + // Range: U+FB00 to U+FB4F + + // Arabic Presentation Forms-A + // Range: U+FB50 to U+FDFF + + // Combining Half Marks + // Range: U+FE20 to U+FE2F + + // CJK Compatibility Forms + // Range: U+FE30 to U+FE4F + + // Small Form Variants + // Range: U+FE50 to U+FE6F + + // Arabic Presentation Forms-B + // Range: U+FE70 to U+FEFF + + // Halfwidth and Fullwidth Forms + // Range: U+FF00 to U+FFEF + + if ( c >= 0xFF21 && c <= 0xFF3A ) { + u[0] = c; + u[1] = c + 32; + return u; + } + + if ( c >= 0xFF41 && c <= 0xFF5A ) { + u[0] = c - 32; + u[1] = c; + return u; + } + + // Specials + // Range: U+FFF0 to U+FFFF + return u; +} + +function DecimalToHexString( n ) { + n = Number( n ); + var h = "0x"; + + for ( var i = 3; i >= 0; i-- ) { + if ( n >= Math.pow(16, i) ){ + var t = Math.floor( n / Math.pow(16, i)); + n -= t * Math.pow(16, i); + if ( t >= 10 ) { + if ( t == 10 ) { + h += "A"; + } + if ( t == 11 ) { + h += "B"; + } + if ( t == 12 ) { + h += "C"; + } + if ( t == 13 ) { + h += "D"; + } + if ( t == 14 ) { + h += "E"; + } + if ( t == 15 ) { + h += "F"; + } + } else { + h += String( t ); + } + } else { + h += "0"; + } + } + + return h; +} diff --git a/mozilla/js/tamarin/test/ecma3/String/e15_5_4_11_3.as b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_11_3.as new file mode 100644 index 00000000000..d9602d25520 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_11_3.as @@ -0,0 +1,491 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.5.4.11-2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "String.prototype.toLowerCase()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + // Halfwidth and Fullwidth Forms + // Range: U+FF00 to U+FFEF + for ( var i = 0xFF00; i <= 0xFFEF; i++ ) { + var U = new Unicode(i); +/* + array[item++] = new TestCase( SECTION, + "var s = new String( String.fromCharCode("+i+") ); s.toLowerCase()", + String.fromCharCode(U.lower), + (s = new String( String.fromCharCode("+i+ ) ), s.toLowerCase()") ); +*/ + array[item++] = new TestCase( SECTION, + "var s = new String( String.fromCharCode("+i+") ); s.toLowerCase().charCodeAt(0)", + U.lower, + (s = new String( String.fromCharCode(i) ), s.toLowerCase().charCodeAt(0) ) ); + } + + return array; +} + +function MyObject( value ) { + this.value = value; + this.substring = String.prototype.substring; + this.toString = function() { return this.value+''; } +} +function Unicode( c ) { + u = GetUnicodeValues( c ); + this.upper = u[0]; + this.lower = u[1] + return this; +} +function GetUnicodeValues( c ) { + u = new Array(); + + u[0] = c; + u[1] = c; + + // upper case Basic Latin + + if ( c >= 0x0041 && c <= 0x005A) { + u[0] = c; + u[1] = c + 32; + return u; + } + + // lower case Basic Latin + if ( c >= 0x0061 && c <= 0x007a ) { + u[0] = c - 32; + u[1] = c; + return u; + } + + // upper case Latin-1 Supplement + if ( (c >= 0x00C0 && c <= 0x00D6) || (c >= 0x00D8 && c<=0x00DE) ) { + u[0] = c; + u[1] = c + 32; + return u; + } + + // lower case Latin-1 Supplement + if ( (c >= 0x00E0 && c <= 0x00F6) || (c >= 0x00F8 && c <= 0x00FE) ) { + u[0] = c - 32; + u[1] = c; + return u; + } + if ( c == 0x00FF ) { + u[0] = 0x0178; + u[1] = c; + return u; + } + // Latin Extended A + if ( (c >= 0x0100 && c < 0x0138) || (c > 0x0149 && c < 0x0178) ) { + // special case for capital I + if ( c == 0x0130 ) { + u[0] = c; + u[1] = 0x0069; + return u; + } + if ( c == 0x0131 ) { + u[0] = 0x0049; + u[1] = c; + return u; + } + + if ( c % 2 == 0 ) { + // if it's even, it's a capital and the lower case is c +1 + u[0] = c; + u[1] = c+1; + } else { + // if it's odd, it's a lower case and upper case is c-1 + u[0] = c-1; + u[1] = c; + } + return u; + } + if ( c == 0x0178 ) { + u[0] = c; + u[1] = 0x00FF; + return u; + } + + if ( (c >= 0x0139 && c < 0x0149) || (c > 0x0178 && c < 0x017F) ) { + if ( c % 2 == 1 ) { + // if it's odd, it's a capital and the lower case is c +1 + u[0] = c; + u[1] = c+1; + } else { + // if it's even, it's a lower case and upper case is c-1 + u[0] = c-1; + u[1] = c; + } + return u; + } + if ( c == 0x017F ) { + u[0] = 0x0053; + u[1] = c; + } + + // Latin Extended B + // need to improve this set + + if ( c >= 0x0200 && c <= 0x0217 ) { + if ( c % 2 == 0 ) { + u[0] = c; + u[1] = c+1; + } else { + u[0] = c-1; + u[1] = c; + } + return u; + } + + // Latin Extended Additional + // Range: U+1E00 to U+1EFF + // http://www.unicode.org/Unicode.charts/glyphless/U1E00.html + + // Spacing Modifier Leters + // Range: U+02B0 to U+02FF + + // Combining Diacritical Marks + // Range: U+0300 to U+036F + + // skip Greek for now + // Greek + // Range: U+0370 to U+03FF + + // Cyrillic + // Range: U+0400 to U+04FF + + if ( (c >= 0x0401 && c <= 0x040C) || ( c>= 0x040E && c <= 0x040F ) ) { + u[0] = c; + u[1] = c + 80; + return u; + } + + + if ( c >= 0x0410 && c <= 0x042F ) { + u[0] = c; + u[1] = c + 32; + return u; + } + + if ( c >= 0x0430 && c<= 0x044F ) { + u[0] = c - 32; + u[1] = c; + return u; + + } + if ( (c >= 0x0451 && c <= 0x045C) || (c >=0x045E && c<= 0x045F) ) { + u[0] = c -80; + u[1] = c; + return u; + } + + if ( c >= 0x0460 && c <= 0x047F ) { + if ( c % 2 == 0 ) { + u[0] = c; + u[1] = c +1; + } else { + u[0] = c - 1; + u[1] = c; + } + return u; + } + + // Armenian + // Range: U+0530 to U+058F + if ( c >= 0x0531 && c <= 0x0556 ) { + u[0] = c; + u[1] = c + 48; + return u; + } + if ( c >= 0x0561 && c < 0x0587 ) { + u[0] = c - 48; + u[1] = c; + return u; + } + + // Hebrew + // Range: U+0590 to U+05FF + + + // Arabic + // Range: U+0600 to U+06FF + + // Devanagari + // Range: U+0900 to U+097F + + + // Bengali + // Range: U+0980 to U+09FF + + + // Gurmukhi + // Range: U+0A00 to U+0A7F + + + // Gujarati + // Range: U+0A80 to U+0AFF + + + // Oriya + // Range: U+0B00 to U+0B7F + // no capital / lower case + + + // Tamil + // Range: U+0B80 to U+0BFF + // no capital / lower case + + + // Telugu + // Range: U+0C00 to U+0C7F + // no capital / lower case + + + // Kannada + // Range: U+0C80 to U+0CFF + // no capital / lower case + + + // Malayalam + // Range: U+0D00 to U+0D7F + + // Thai + // Range: U+0E00 to U+0E7F + + + // Lao + // Range: U+0E80 to U+0EFF + + + // Tibetan + // Range: U+0F00 to U+0FBF + + // Georgian + // Range: U+10A0 to U+10F0 + if ( c >= 0x10A0 && c <= 0x10C5 ) { + u[0] = c; + u[1] = c + 48; + return u; + } + if ( c >= 0x10D0 && c <= 0x10F5 ) { + u[0] = c; + u[1] = c; + return u; + } + + // Hangul Jamo + // Range: U+1100 to U+11FF + + // Greek Extended + // Range: U+1F00 to U+1FFF + // skip for now + + + // General Punctuation + // Range: U+2000 to U+206F + + // Superscripts and Subscripts + // Range: U+2070 to U+209F + + // Currency Symbols + // Range: U+20A0 to U+20CF + + + // Combining Diacritical Marks for Symbols + // Range: U+20D0 to U+20FF + // skip for now + + + // Number Forms + // Range: U+2150 to U+218F + // skip for now + + + // Arrows + // Range: U+2190 to U+21FF + + // Mathematical Operators + // Range: U+2200 to U+22FF + + // Miscellaneous Technical + // Range: U+2300 to U+23FF + + // Control Pictures + // Range: U+2400 to U+243F + + // Optical Character Recognition + // Range: U+2440 to U+245F + + // Enclosed Alphanumerics + // Range: U+2460 to U+24FF + + // Box Drawing + // Range: U+2500 to U+257F + + // Block Elements + // Range: U+2580 to U+259F + + // Geometric Shapes + // Range: U+25A0 to U+25FF + + // Miscellaneous Symbols + // Range: U+2600 to U+26FF + + // Dingbats + // Range: U+2700 to U+27BF + + // CJK Symbols and Punctuation + // Range: U+3000 to U+303F + + // Hiragana + // Range: U+3040 to U+309F + + // Katakana + // Range: U+30A0 to U+30FF + + // Bopomofo + // Range: U+3100 to U+312F + + // Hangul Compatibility Jamo + // Range: U+3130 to U+318F + + // Kanbun + // Range: U+3190 to U+319F + + + // Enclosed CJK Letters and Months + // Range: U+3200 to U+32FF + + // CJK Compatibility + // Range: U+3300 to U+33FF + + // Hangul Syllables + // Range: U+AC00 to U+D7A3 + + // High Surrogates + // Range: U+D800 to U+DB7F + + // Private Use High Surrogates + // Range: U+DB80 to U+DBFF + + // Low Surrogates + // Range: U+DC00 to U+DFFF + + // Private Use Area + // Range: U+E000 to U+F8FF + + // CJK Compatibility Ideographs + // Range: U+F900 to U+FAFF + + // Alphabetic Presentation Forms + // Range: U+FB00 to U+FB4F + + // Arabic Presentation Forms-A + // Range: U+FB50 to U+FDFF + + // Combining Half Marks + // Range: U+FE20 to U+FE2F + + // CJK Compatibility Forms + // Range: U+FE30 to U+FE4F + + // Small Form Variants + // Range: U+FE50 to U+FE6F + + // Arabic Presentation Forms-B + // Range: U+FE70 to U+FEFF + + // Halfwidth and Fullwidth Forms + // Range: U+FF00 to U+FFEF + + if ( c >= 0xFF21 && c <= 0xFF3A ) { + u[0] = c; + u[1] = c + 32; + return u; + } + + if ( c >= 0xFF41 && c <= 0xFF5A ) { + u[0] = c - 32; + u[1] = c; + return u; + } + + // Specials + // Range: U+FFF0 to U+FFFF + + return u; +} + +function DecimalToHexString( n ) { + n = Number( n ); + var h = "0x"; + + for ( var i = 3; i >= 0; i-- ) { + if ( n >= Math.pow(16, i) ){ + var t = Math.floor( n / Math.pow(16, i)); + n -= t * Math.pow(16, i); + if ( t >= 10 ) { + if ( t == 10 ) { + h += "A"; + } + if ( t == 11 ) { + h += "B"; + } + if ( t == 12 ) { + h += "C"; + } + if ( t == 13 ) { + h += "D"; + } + if ( t == 14 ) { + h += "E"; + } + if ( t == 15 ) { + h += "F"; + } + } else { + h += String( t ); + } + } else { + h += "0"; + } + } + + return h; +} diff --git a/mozilla/js/tamarin/test/ecma3/String/e15_5_4_11_4.as b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_11_4.as new file mode 100644 index 00000000000..0ed5eedb356 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_11_4.as @@ -0,0 +1,485 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.5.4.11-2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "String.prototype.toLowerCase()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // Hiragana (no upper / lower case) + // Range: U+3040 to U+309F + + for ( var i = 0x3040; i <= 0x309F; i++ ) { + var U = new Unicode( i ); +/* + array[item++] = new TestCase( SECTION, + "var s = new String( String.fromCharCode("+i+") ); s.toLowerCase()", + String.fromCharCode(U.lower), + (s = new String( String.fromCharCode("+i+ ) ), s.toLowerCase()") ); +*/ + array[item++] = new TestCase( SECTION, + "var s = new String( String.fromCharCode("+i+") ); s.toLowerCase().charCodeAt(0)", + U.lower, + (s = new String( String.fromCharCode(i) ), s.toLowerCase().charCodeAt(0) ) ); + } + + return array; +} + +function MyObject( value ) { + this.value = value; + this.substring = String.prototype.substring; + this.toString = function () { return this.value+''; } +} +function Unicode( c ) { + this.upper = c; + this.lower = c; + + // upper case Basic Latin + + if ( c >= 0x0041 && c <= 0x005A) { + this.upper = c; + this.lower = c + 32; + return this; + } + + // lower case Basic Latin + if ( c >= 0x0061 && c <= 0x007a ) { + this.upper = c - 32; + this.lower = c; + return this; + } + + // upper case Latin-1 Supplement + if ( (c >= 0x00C0 && c <= 0x00D6) || (c >= 0x00D8 && c<=0x00DE) ) { + this.upper = c; + this.lower = c + 32; + return this; + } + + // lower case Latin-1 Supplement + if ( (c >= 0x00E0 && c <= 0x00F6) || (c >= 0x00F8 && c <= 0x00FE) ) { + this.upper = c - 32; + this.lower = c; + return this; + } + if ( c == 0x00FF ) { + this.upper = 0x0178; + this.lower = c; + return this; + } + // Latin Extended A + if ( (c >= 0x0100 && c < 0x0138) || (c > 0x0149 && c < 0x0178) ) { + // special case for capital I + if ( c == 0x0130 ) { + this.upper = c; + this.lower = 0x0069; + return this; + } + if ( c == 0x0131 ) { + this.upper = 0x0049; + this.lower = c; + return this; + } + + if ( c % 2 == 0 ) { + // if it's even, it's a capital and the lower case is c +1 + this.upper = c; + this.lower = c+1; + } else { + // if it's odd, it's a lower case and upper case is c-1 + this.upper = c-1; + this.lower = c; + } + return this; + } + if ( c == 0x0178 ) { + this.upper = c; + this.lower = 0x00FF; + return this; + } + + if ( (c >= 0x0139 && c < 0x0149) || (c > 0x0178 && c < 0x017F) ) { + if ( c % 2 == 1 ) { + // if it's odd, it's a capital and the lower case is c +1 + this.upper = c; + this.lower = c+1; + } else { + // if it's even, it's a lower case and upper case is c-1 + this.upper = c-1; + this.lower = c; + } + return this; + } + if ( c == 0x017F ) { + this.upper = 0x0053; + this.lower = c; + } + + // Latin Extended B + // need to improve this set + + if ( c >= 0x0200 && c <= 0x0217 ) { + if ( c % 2 == 0 ) { + this.upper = c; + this.lower = c+1; + } else { + this.upper = c-1; + this.lower = c; + } + return this; + } + + // Latin Extended Additional + // Range: U+1E00 to U+1EFF + // http://www.unicode.org/Unicode.charts/glyphless/U1E00.html + + // Spacing Modifier Leters + // Range: U+02B0 to U+02FF + + // Combining Diacritical Marks + // Range: U+0300 to U+036F + + // skip Greek for now + // Greek + // Range: U+0370 to U+03FF + + // Cyrillic + // Range: U+0400 to U+04FF + + if ( (c >= 0x0401 && c <= 0x040C) || ( c>= 0x040E && c <= 0x040F ) ) { + this.upper = c; + this.lower = c + 80; + return this; + } + + + if ( c >= 0x0410 && c <= 0x042F ) { + this.upper = c; + this.lower = c + 32; + return this; + } + + if ( c >= 0x0430 && c<= 0x044F ) { + this.upper = c - 32; + this.lower = c; + return this; + + } + if ( (c >= 0x0451 && c <= 0x045C) || (c >=0x045E && c<= 0x045F) ) { + this.upper = c -80; + this.lower = c; + return this; + } + + if ( c >= 0x0460 && c <= 0x047F ) { + if ( c % 2 == 0 ) { + this.upper = c; + this.lower = c +1; + } else { + this.upper = c - 1; + this.lower = c; + } + return this; + } + + // Armenian + // Range: U+0530 to U+058F + if ( c >= 0x0531 && c <= 0x0556 ) { + this.upper = c; + this.lower = c + 48; + return this; + } + if ( c >= 0x0561 && c < 0x0587 ) { + this.upper = c - 48; + this.lower = c; + return this; + } + + // Hebrew + // Range: U+0590 to U+05FF + + + // Arabic + // Range: U+0600 to U+06FF + + // Devanagari + // Range: U+0900 to U+097F + + + // Bengali + // Range: U+0980 to U+09FF + + + // Gurmukhi + // Range: U+0A00 to U+0A7F + + + // Gujarati + // Range: U+0A80 to U+0AFF + + + // Oriya + // Range: U+0B00 to U+0B7F + // no capital / lower case + + + // Tamil + // Range: U+0B80 to U+0BFF + // no capital / lower case + + + // Telugu + // Range: U+0C00 to U+0C7F + // no capital / lower case + + + // Kannada + // Range: U+0C80 to U+0CFF + // no capital / lower case + + + // Malayalam + // Range: U+0D00 to U+0D7F + + // Thai + // Range: U+0E00 to U+0E7F + + + // Lao + // Range: U+0E80 to U+0EFF + + + // Tibetan + // Range: U+0F00 to U+0FBF + + // Georgian + // Range: U+10A0 to U+10F0 + if ( c >= 0x10A0 && c <= 0x10C5 ) { + this.upper = c; + this.lower = c + 48; + return this; + } + if ( c >= 0x10D0 && c <= 0x10F5 ) { + this.upper = c; + this.lower = c; + return this; + } + + // Hangul Jamo + // Range: U+1100 to U+11FF + + // Greek Extended + // Range: U+1F00 to U+1FFF + // skip for now + + + // General Punctuation + // Range: U+2000 to U+206F + + // Superscripts and Subscripts + // Range: U+2070 to U+209F + + // Currency Symbols + // Range: U+20A0 to U+20CF + + + // Combining Diacritical Marks for Symbols + // Range: U+20D0 to U+20FF + // skip for now + + + // Number Forms + // Range: U+2150 to U+218F + // skip for now + + + // Arrows + // Range: U+2190 to U+21FF + + // Mathematical Operators + // Range: U+2200 to U+22FF + + // Miscellaneous Technical + // Range: U+2300 to U+23FF + + // Control Pictures + // Range: U+2400 to U+243F + + // Optical Character Recognition + // Range: U+2440 to U+245F + + // Enclosed Alphanumerics + // Range: U+2460 to U+24FF + + // Box Drawing + // Range: U+2500 to U+257F + + // Block Elements + // Range: U+2580 to U+259F + + // Geometric Shapes + // Range: U+25A0 to U+25FF + + // Miscellaneous Symbols + // Range: U+2600 to U+26FF + + // Dingbats + // Range: U+2700 to U+27BF + + // CJK Symbols and Punctuation + // Range: U+3000 to U+303F + + // Hiragana + // Range: U+3040 to U+309F + + // Katakana + // Range: U+30A0 to U+30FF + + // Bopomofo + // Range: U+3100 to U+312F + + // Hangul Compatibility Jamo + // Range: U+3130 to U+318F + + // Kanbun + // Range: U+3190 to U+319F + + + // Enclosed CJK Letters and Months + // Range: U+3200 to U+32FF + + // CJK Compatibility + // Range: U+3300 to U+33FF + + // Hangul Syllables + // Range: U+AC00 to U+D7A3 + + // High Surrogates + // Range: U+D800 to U+DB7F + + // Private Use High Surrogates + // Range: U+DB80 to U+DBFF + + // Low Surrogates + // Range: U+DC00 to U+DFFF + + // Private Use Area + // Range: U+E000 to U+F8FF + + // CJK Compatibility Ideographs + // Range: U+F900 to U+FAFF + + // Alphabetic Presentation Forms + // Range: U+FB00 to U+FB4F + + // Arabic Presentation Forms-A + // Range: U+FB50 to U+FDFF + + // Combining Half Marks + // Range: U+FE20 to U+FE2F + + // CJK Compatibility Forms + // Range: U+FE30 to U+FE4F + + // Small Form Variants + // Range: U+FE50 to U+FE6F + + // Arabic Presentation Forms-B + // Range: U+FE70 to U+FEFF + + // Halfwidth and Fullwidth Forms + // Range: U+FF00 to U+FFEF + + if ( c >= 0xFF21 && c <= 0xFF3A ) { + this.upper = c; + this.lower = c + 32; + return this; + } + + if ( c >= 0xFF41 && c <= 0xFF5A ) { + this.upper = c - 32; + this.lower = c; + return this; + } + + // Specials + // Range: U+FFF0 to U+FFFF + + return this; +} + +function DecimalToHexString( n ) { + n = Number( n ); + var h = "0x"; + + for ( var i = 3; i >= 0; i-- ) { + if ( n >= Math.pow(16, i) ){ + var t = Math.floor( n / Math.pow(16, i)); + n -= t * Math.pow(16, i); + if ( t >= 10 ) { + if ( t == 10 ) { + h += "A"; + } + if ( t == 11 ) { + h += "B"; + } + if ( t == 12 ) { + h += "C"; + } + if ( t == 13 ) { + h += "D"; + } + if ( t == 14 ) { + h += "E"; + } + if ( t == 15 ) { + h += "F"; + } + } else { + h += String( t ); + } + } else { + h += "0"; + } + } + + return h; +} diff --git a/mozilla/js/tamarin/test/ecma3/String/e15_5_4_11_5.as b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_11_5.as new file mode 100644 index 00000000000..6f4e94ec8ba --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_11_5.as @@ -0,0 +1,499 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.5.4.11-5"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "String.prototype.toLowerCase()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "String.prototype.toLowerCase.length", 0, String.prototype.toLowerCase.length ); + array[item++] = new TestCase( SECTION, "delete String.prototype.toLowerCase.length", false, delete String.prototype.toLowerCase.length ); + array[item++] = new TestCase( SECTION, "delete String.prototype.toLowerCase.length; String.prototype.toLowerCase.length", 0, (delete String.prototype.toLowerCase.length, String.prototype.toLowerCase.length) ); + + // Cyrillic (part) + // Range: U+0400 to U+04FF + for ( var i = 0x0400; i <= 0x047F; i++ ) { + var U = new Unicode( i ); +/* + array[item++] = new TestCase( SECTION, + "var s = new String( String.fromCharCode("+i+") ); s.toLowerCase()", + String.fromCharCode(U.lower), + (s = new String( String.fromCharCode("+i+ ) ), s.toLowerCase()") ); +*/ + array[item++] = new TestCase( SECTION, + "var s = new String( String.fromCharCode("+i+") ); s.toLowerCase().charCodeAt(0)", + U.lower, + (s = new String( String.fromCharCode(i) ), s.toLowerCase().charCodeAt(0) ) ); + + } + return array; +} + +function MyObject( value ) { + this.value = value; + this.substring = String.prototype.substring; + this.toString = function () { return this.value+''; } +} +function Unicode( c ) { + u = GetUnicodeValues( c ); + this.upper = u[0]; + this.lower = u[1] + return this; +} +function GetUnicodeValues( c ) { + u = new Array(); + + u[0] = c; + u[1] = c; + + // upper case Basic Latin + + if ( c >= 0x0041 && c <= 0x005A) { + u[0] = c; + u[1] = c + 32; + return u; + } + + // lower case Basic Latin + if ( c >= 0x0061 && c <= 0x007a ) { + u[0] = c - 32; + u[1] = c; + return u; + } + + // upper case Latin-1 Supplement + if ( (c >= 0x00C0 && c <= 0x00D6) || (c >= 0x00D8 && c<=0x00DE) ) { + u[0] = c; + u[1] = c + 32; + return u; + } + + // lower case Latin-1 Supplement + if ( (c >= 0x00E0 && c <= 0x00F6) || (c >= 0x00F8 && c <= 0x00FE) ) { + u[0] = c - 32; + u[1] = c; + return u; + } + if ( c == 0x00FF ) { + u[0] = 0x0178; + u[1] = c; + return u; + } + // Latin Extended A + if ( (c >= 0x0100 && c < 0x0138) || (c > 0x0149 && c < 0x0178) ) { + // special case for capital I + if ( c == 0x0130 ) { + u[0] = c; + u[1] = 0x0069; + return u; + } + if ( c == 0x0131 ) { + u[0] = 0x0049; + u[1] = c; + return u; + } + + if ( c % 2 == 0 ) { + // if it's even, it's a capital and the lower case is c +1 + u[0] = c; + u[1] = c+1; + } else { + // if it's odd, it's a lower case and upper case is c-1 + u[0] = c-1; + u[1] = c; + } + return u; + } + if ( c == 0x0178 ) { + u[0] = c; + u[1] = 0x00FF; + return u; + } + + if ( (c >= 0x0139 && c < 0x0149) || (c > 0x0178 && c < 0x017F) ) { + if ( c % 2 == 1 ) { + // if it's odd, it's a capital and the lower case is c +1 + u[0] = c; + u[1] = c+1; + } else { + // if it's even, it's a lower case and upper case is c-1 + u[0] = c-1; + u[1] = c; + } + return u; + } + if ( c == 0x017F ) { + u[0] = 0x0053; + u[1] = c; + } + + // Latin Extended B + // need to improve this set + + if ( c >= 0x0200 && c <= 0x0217 ) { + if ( c % 2 == 0 ) { + u[0] = c; + u[1] = c+1; + } else { + u[0] = c-1; + u[1] = c; + } + return u; + } + + // Latin Extended Additional + // Range: U+1E00 to U+1EFF + // http://www.unicode.org/Unicode.charts/glyphless/U1E00.html + + // Spacing Modifier Leters + // Range: U+02B0 to U+02FF + + // Combining Diacritical Marks + // Range: U+0300 to U+036F + + // skip Greek for now + // Greek + // Range: U+0370 to U+03FF + + // Cyrillic + // Range: U+0400 to U+04FF + + if ( c >= 0x0400 && c <= 0x040F ) { + u[0] = c; + u[1] = c + 80; + return u; + } + + + + + + if ( c >= 0x0410 && c <= 0x042F ) { + u[0] = c; + u[1] = c + 32; + return u; + } + + if ( c >= 0x0430 && c<= 0x044F ) { + u[0] = c - 32; + u[1] = c; + return u; + + } + if ( (c >= 0x0451 && c <= 0x045C) || (c >=0x045E && c<= 0x045F) ) { + u[0] = c -80; + u[1] = c; + return u; + } + + if ( c >= 0x0460 && c <= 0x047F ) { + if ( c % 2 == 0 ) { + u[0] = c; + u[1] = c +1; + } else { + u[0] = c - 1; + u[1] = c; + } + return u; + } + + // Armenian + // Range: U+0530 to U+058F + if ( c >= 0x0531 && c <= 0x0556 ) { + u[0] = c; + u[1] = c + 48; + return u; + } + if ( c >= 0x0561 && c < 0x0587 ) { + u[0] = c - 48; + u[1] = c; + return u; + } + + // Hebrew + // Range: U+0590 to U+05FF + + + // Arabic + // Range: U+0600 to U+06FF + + // Devanagari + // Range: U+0900 to U+097F + + + // Bengali + // Range: U+0980 to U+09FF + + + // Gurmukhi + // Range: U+0A00 to U+0A7F + + + // Gujarati + // Range: U+0A80 to U+0AFF + + + // Oriya + // Range: U+0B00 to U+0B7F + // no capital / lower case + + + // Tamil + // Range: U+0B80 to U+0BFF + // no capital / lower case + + + // Telugu + // Range: U+0C00 to U+0C7F + // no capital / lower case + + + // Kannada + // Range: U+0C80 to U+0CFF + // no capital / lower case + + + // Malayalam + // Range: U+0D00 to U+0D7F + + // Thai + // Range: U+0E00 to U+0E7F + + + // Lao + // Range: U+0E80 to U+0EFF + + + // Tibetan + // Range: U+0F00 to U+0FBF + + // Georgian + // Range: U+10A0 to U+10F0 + if ( c >= 0x10A0 && c <= 0x10C5 ) { + u[0] = c; + u[1] = c + 48; + return u; + } + if ( c >= 0x10D0 && c <= 0x10F5 ) { + u[0] = c; + u[1] = c; + return u; + } + + // Hangul Jamo + // Range: U+1100 to U+11FF + + // Greek Extended + // Range: U+1F00 to U+1FFF + // skip for now + + + // General Punctuation + // Range: U+2000 to U+206F + + // Superscripts and Subscripts + // Range: U+2070 to U+209F + + // Currency Symbols + // Range: U+20A0 to U+20CF + + + // Combining Diacritical Marks for Symbols + // Range: U+20D0 to U+20FF + // skip for now + + + // Number Forms + // Range: U+2150 to U+218F + // skip for now + + + // Arrows + // Range: U+2190 to U+21FF + + // Mathematical Operators + // Range: U+2200 to U+22FF + + // Miscellaneous Technical + // Range: U+2300 to U+23FF + + // Control Pictures + // Range: U+2400 to U+243F + + // Optical Character Recognition + // Range: U+2440 to U+245F + + // Enclosed Alphanumerics + // Range: U+2460 to U+24FF + + // Box Drawing + // Range: U+2500 to U+257F + + // Block Elements + // Range: U+2580 to U+259F + + // Geometric Shapes + // Range: U+25A0 to U+25FF + + // Miscellaneous Symbols + // Range: U+2600 to U+26FF + + // Dingbats + // Range: U+2700 to U+27BF + + // CJK Symbols and Punctuation + // Range: U+3000 to U+303F + + // Hiragana + // Range: U+3040 to U+309F + + // Katakana + // Range: U+30A0 to U+30FF + + // Bopomofo + // Range: U+3100 to U+312F + + // Hangul Compatibility Jamo + // Range: U+3130 to U+318F + + // Kanbun + // Range: U+3190 to U+319F + + + // Enclosed CJK Letters and Months + // Range: U+3200 to U+32FF + + // CJK Compatibility + // Range: U+3300 to U+33FF + + // Hangul Syllables + // Range: U+AC00 to U+D7A3 + + // High Surrogates + // Range: U+D800 to U+DB7F + + // Private Use High Surrogates + // Range: U+DB80 to U+DBFF + + // Low Surrogates + // Range: U+DC00 to U+DFFF + + // Private Use Area + // Range: U+E000 to U+F8FF + + // CJK Compatibility Ideographs + // Range: U+F900 to U+FAFF + + // Alphabetic Presentation Forms + // Range: U+FB00 to U+FB4F + + // Arabic Presentation Forms-A + // Range: U+FB50 to U+FDFF + + // Combining Half Marks + // Range: U+FE20 to U+FE2F + + // CJK Compatibility Forms + // Range: U+FE30 to U+FE4F + + // Small Form Variants + // Range: U+FE50 to U+FE6F + + // Arabic Presentation Forms-B + // Range: U+FE70 to U+FEFF + + // Halfwidth and Fullwidth Forms + // Range: U+FF00 to U+FFEF + + if ( c >= 0xFF21 && c <= 0xFF3A ) { + u[0] = c; + u[1] = c + 32; + return u; + } + + if ( c >= 0xFF41 && c <= 0xFF5A ) { + u[0] = c - 32; + u[1] = c; + return u; + } + + // Specials + // Range: U+FFF0 to U+FFFF + + return u; +} + +function DecimalToHexString( n ) { + n = Number( n ); + var h = "0x"; + + for ( var i = 3; i >= 0; i-- ) { + if ( n >= Math.pow(16, i) ){ + var t = Math.floor( n / Math.pow(16, i)); + n -= t * Math.pow(16, i); + if ( t >= 10 ) { + if ( t == 10 ) { + h += "A"; + } + if ( t == 11 ) { + h += "B"; + } + if ( t == 12 ) { + h += "C"; + } + if ( t == 13 ) { + h += "D"; + } + if ( t == 14 ) { + h += "E"; + } + if ( t == 15 ) { + h += "F"; + } + } else { + h += String( t ); + } + } else { + h += "0"; + } + } + + return h; +} diff --git a/mozilla/js/tamarin/test/ecma3/String/e15_5_4_11_6.as b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_11_6.as new file mode 100644 index 00000000000..b2a4bd69bd1 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_11_6.as @@ -0,0 +1,493 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.5.4.11-6"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "String.prototype.toLowerCase()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // Armenian + // Range: U+0530 to U+058F + for ( var i = 0x0530; i <= 0x058F; i++ ) { + + var U = new Unicode( i ); +/* + array[item++] = new TestCase( SECTION, + "var s = new String( String.fromCharCode("+i+") ); s.toLowerCase()", + String.fromCharCode(U.lower), + (s = new String( String.fromCharCode("+i+ ) ), s.toLowerCase()") ); +*/ + array[item++] = new TestCase( SECTION, + "var s = new String( String.fromCharCode("+i+") ); s.toLowerCase().charCodeAt(0)", + U.lower, + (s = new String( String.fromCharCode(i) ), s.toLowerCase().charCodeAt(0) ) ); + + } + return array; +} + +function MyObject( value ) { + this.value = value; + this.substring = String.prototype.substring; + this.toString = function () { return this.value+''; } +} +function Unicode( c ) { + u = GetUnicodeValues( c ); + this.upper = u[0]; + this.lower = u[1] + return this; +} +function GetUnicodeValues( c ) { + u = new Array(); + + u[0] = c; + u[1] = c; + + // upper case Basic Latin + + if ( c >= 0x0041 && c <= 0x005A) { + u[0] = c; + u[1] = c + 32; + return u; + } + + // lower case Basic Latin + if ( c >= 0x0061 && c <= 0x007a ) { + u[0] = c - 32; + u[1] = c; + return u; + } + + // upper case Latin-1 Supplement + if ( (c >= 0x00C0 && c <= 0x00D6) || (c >= 0x00D8 && c<=0x00DE) ) { + u[0] = c; + u[1] = c + 32; + return u; + } + + // lower case Latin-1 Supplement + if ( (c >= 0x00E0 && c <= 0x00F6) || (c >= 0x00F8 && c <= 0x00FE) ) { + u[0] = c - 32; + u[1] = c; + return u; + } + if ( c == 0x00FF ) { + u[0] = 0x0178; + u[1] = c; + return u; + } + // Latin Extended A + if ( (c >= 0x0100 && c < 0x0138) || (c > 0x0149 && c < 0x0178) ) { + // special case for capital I + if ( c == 0x0130 ) { + u[0] = c; + u[1] = 0x0069; + return u; + } + if ( c == 0x0131 ) { + u[0] = 0x0049; + u[1] = c; + return u; + } + + if ( c % 2 == 0 ) { + // if it's even, it's a capital and the lower case is c +1 + u[0] = c; + u[1] = c+1; + } else { + // if it's odd, it's a lower case and upper case is c-1 + u[0] = c-1; + u[1] = c; + } + return u; + } + if ( c == 0x0178 ) { + u[0] = c; + u[1] = 0x00FF; + return u; + } + + if ( (c >= 0x0139 && c < 0x0149) || (c > 0x0178 && c < 0x017F) ) { + if ( c % 2 == 1 ) { + // if it's odd, it's a capital and the lower case is c +1 + u[0] = c; + u[1] = c+1; + } else { + // if it's even, it's a lower case and upper case is c-1 + u[0] = c-1; + u[1] = c; + } + return u; + } + if ( c == 0x017F ) { + u[0] = 0x0053; + u[1] = c; + } + + // Latin Extended B + // need to improve this set + + if ( c >= 0x0200 && c <= 0x0217 ) { + if ( c % 2 == 0 ) { + u[0] = c; + u[1] = c+1; + } else { + u[0] = c-1; + u[1] = c; + } + return u; + } + + // Latin Extended Additional + // Range: U+1E00 to U+1EFF + // http://www.unicode.org/Unicode.charts/glyphless/U1E00.html + + // Spacing Modifier Leters + // Range: U+02B0 to U+02FF + + // Combining Diacritical Marks + // Range: U+0300 to U+036F + + // skip Greek for now + // Greek + // Range: U+0370 to U+03FF + + // Cyrillic + // Range: U+0400 to U+04FF + + if ( (c >= 0x0401 && c <= 0x040C) || ( c>= 0x040E && c <= 0x040F ) ) { + u[0] = c; + u[1] = c + 80; + return u; + } + + + if ( c >= 0x0410 && c <= 0x042F ) { + u[0] = c; + u[1] = c + 32; + return u; + } + + if ( c >= 0x0430 && c<= 0x044F ) { + u[0] = c - 32; + u[1] = c; + return u; + + } + if ( (c >= 0x0451 && c <= 0x045C) || (c >=0x045E && c<= 0x045F) ) { + u[0] = c -80; + u[1] = c; + return u; + } + + if ( c >= 0x0460 && c <= 0x047F ) { + if ( c % 2 == 0 ) { + u[0] = c; + u[1] = c +1; + } else { + u[0] = c - 1; + u[1] = c; + } + return u; + } + + // Armenian + // Range: U+0530 to U+058F + if ( c >= 0x0531 && c <= 0x0556 ) { + u[0] = c; + u[1] = c + 48; + return u; + } + if ( c >= 0x0561 && c < 0x0587 ) { + u[0] = c - 48; + u[1] = c; + return u; + } + + // Hebrew + // Range: U+0590 to U+05FF + + + // Arabic + // Range: U+0600 to U+06FF + + // Devanagari + // Range: U+0900 to U+097F + + + // Bengali + // Range: U+0980 to U+09FF + + + // Gurmukhi + // Range: U+0A00 to U+0A7F + + + // Gujarati + // Range: U+0A80 to U+0AFF + + + // Oriya + // Range: U+0B00 to U+0B7F + // no capital / lower case + + + // Tamil + // Range: U+0B80 to U+0BFF + // no capital / lower case + + + // Telugu + // Range: U+0C00 to U+0C7F + // no capital / lower case + + + // Kannada + // Range: U+0C80 to U+0CFF + // no capital / lower case + + + // Malayalam + // Range: U+0D00 to U+0D7F + + // Thai + // Range: U+0E00 to U+0E7F + + + // Lao + // Range: U+0E80 to U+0EFF + + + // Tibetan + // Range: U+0F00 to U+0FBF + + // Georgian + // Range: U+10A0 to U+10F0 + if ( c >= 0x10A0 && c <= 0x10C5 ) { + u[0] = c; + u[1] = c + 48; + return u; + } + if ( c >= 0x10D0 && c <= 0x10F5 ) { + u[0] = c; + u[1] = c; + return u; + } + + // Hangul Jamo + // Range: U+1100 to U+11FF + + // Greek Extended + // Range: U+1F00 to U+1FFF + // skip for now + + + // General Punctuation + // Range: U+2000 to U+206F + + // Superscripts and Subscripts + // Range: U+2070 to U+209F + + // Currency Symbols + // Range: U+20A0 to U+20CF + + + // Combining Diacritical Marks for Symbols + // Range: U+20D0 to U+20FF + // skip for now + + + // Number Forms + // Range: U+2150 to U+218F + // skip for now + + + // Arrows + // Range: U+2190 to U+21FF + + // Mathematical Operators + // Range: U+2200 to U+22FF + + // Miscellaneous Technical + // Range: U+2300 to U+23FF + + // Control Pictures + // Range: U+2400 to U+243F + + // Optical Character Recognition + // Range: U+2440 to U+245F + + // Enclosed Alphanumerics + // Range: U+2460 to U+24FF + + // Box Drawing + // Range: U+2500 to U+257F + + // Block Elements + // Range: U+2580 to U+259F + + // Geometric Shapes + // Range: U+25A0 to U+25FF + + // Miscellaneous Symbols + // Range: U+2600 to U+26FF + + // Dingbats + // Range: U+2700 to U+27BF + + // CJK Symbols and Punctuation + // Range: U+3000 to U+303F + + // Hiragana + // Range: U+3040 to U+309F + + // Katakana + // Range: U+30A0 to U+30FF + + // Bopomofo + // Range: U+3100 to U+312F + + // Hangul Compatibility Jamo + // Range: U+3130 to U+318F + + // Kanbun + // Range: U+3190 to U+319F + + + // Enclosed CJK Letters and Months + // Range: U+3200 to U+32FF + + // CJK Compatibility + // Range: U+3300 to U+33FF + + // Hangul Syllables + // Range: U+AC00 to U+D7A3 + + // High Surrogates + // Range: U+D800 to U+DB7F + + // Private Use High Surrogates + // Range: U+DB80 to U+DBFF + + // Low Surrogates + // Range: U+DC00 to U+DFFF + + // Private Use Area + // Range: U+E000 to U+F8FF + + // CJK Compatibility Ideographs + // Range: U+F900 to U+FAFF + + // Alphabetic Presentation Forms + // Range: U+FB00 to U+FB4F + + // Arabic Presentation Forms-A + // Range: U+FB50 to U+FDFF + + // Combining Half Marks + // Range: U+FE20 to U+FE2F + + // CJK Compatibility Forms + // Range: U+FE30 to U+FE4F + + // Small Form Variants + // Range: U+FE50 to U+FE6F + + // Arabic Presentation Forms-B + // Range: U+FE70 to U+FEFF + + // Halfwidth and Fullwidth Forms + // Range: U+FF00 to U+FFEF + + if ( c >= 0xFF21 && c <= 0xFF3A ) { + u[0] = c; + u[1] = c + 32; + return u; + } + + if ( c >= 0xFF41 && c <= 0xFF5A ) { + u[0] = c - 32; + u[1] = c; + return u; + } + + // Specials + // Range: U+FFF0 to U+FFFF + + return u; +} + +function DecimalToHexString( n ) { + n = Number( n ); + var h = "0x"; + + for ( var i = 3; i >= 0; i-- ) { + if ( n >= Math.pow(16, i) ){ + var t = Math.floor( n / Math.pow(16, i)); + n -= t * Math.pow(16, i); + if ( t >= 10 ) { + if ( t == 10 ) { + h += "A"; + } + if ( t == 11 ) { + h += "B"; + } + if ( t == 12 ) { + h += "C"; + } + if ( t == 13 ) { + h += "D"; + } + if ( t == 14 ) { + h += "E"; + } + if ( t == 15 ) { + h += "F"; + } + } else { + h += String( t ); + } + } else { + h += "0"; + } + } + + return h; +} diff --git a/mozilla/js/tamarin/test/ecma3/String/e15_5_4_12_1.as b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_12_1.as new file mode 100644 index 00000000000..96d1cf78063 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_12_1.as @@ -0,0 +1,496 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.5.4.12-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "String.prototype.toUpperCase()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "String.prototype.toUpperCase.length", 0, String.prototype.toUpperCase.length ); + array[item++] = new TestCase( SECTION, "delete String.prototype.toUpperCase.length", false, delete String.prototype.toUpperCase.length ); + array[item++] = new TestCase( SECTION, "delete String.prototype.toupperCase.length; String.prototype.toupperCase.length", 0, (delete String.prototype.toUpperCase.length, String.prototype.toUpperCase.length) ); + + // Basic Latin, Latin-1 Supplement, Latin Extended A + for ( var i = 0; i <= 0x017f; i++ ) { + var U = new Unicode( i ); + + // XXX DF fails in java + + if ( i == 0x00DF ) { + continue; + } + + + array[item++] = new TestCase( SECTION, + "var s = new String( String.fromCharCode("+i+") ); s.toUpperCase().charCodeAt(0)", + U.upper, + (s = new String( String.fromCharCode(i) ), s.toUpperCase().charCodeAt(0) ) ); + } + + return array; +} +function MyObject( value ) { + this.value = value; + this.substring = String.prototype.substring; + this.toString = function () { return this.value+''; } +} +function Unicode( c ) { + u = GetUnicodeValues( c ); + this.upper = u[0]; + this.lower = u[1] + return this; +} +function GetUnicodeValues( c ) { + u = new Array(); + + u[0] = c; + u[1] = c; + + // upper case Basic Latin + + if ( c >= 0x0041 && c <= 0x005A) { + u[0] = c; + u[1] = c + 32; + return u; + } + + // lower case Basic Latin + if ( c >= 0x0061 && c <= 0x007a ) { + u[0] = c - 32; + u[1] = c; + return u; + } + + // upper case Latin-1 Supplement + if ( (c >= 0x00C0 && c <= 0x00D6) || (c >= 0x00D8 && c<=0x00DE) ) { + u[0] = c; + u[1] = c + 32; + return u; + } + + // lower case Latin-1 Supplement + if ( (c >= 0x00E0 && c <= 0x00F6) || (c >= 0x00F8 && c <= 0x00FE) ) { + u[0] = c - 32; + u[1] = c; + return u; + } + if ( c == 0x00FF ) { + u[0] = 0x0178; + u[1] = c; + return u; + } + // Latin Extended A + if ( (c >= 0x0100 && c < 0x0138) || (c > 0x0149 && c < 0x0178) ) { + // special case for capital I + if ( c == 0x0130 ) { + u[0] = c; + u[1] = 0x0069; + return u; + } + if ( c == 0x0131 ) { + u[0] = 0x0049; + u[1] = c; + return u; + } + + if ( c % 2 == 0 ) { + // if it's even, it's a capital and the lower case is c +1 + u[0] = c; + u[1] = c+1; + } else { + // if it's odd, it's a lower case and upper case is c-1 + u[0] = c-1; + u[1] = c; + } + return u; + } + if ( c == 0x0178 ) { + u[0] = c; + u[1] = 0x00FF; + return u; + } + + if ( (c >= 0x0139 && c < 0x0149) || (c > 0x0178 && c < 0x017F) ) { + if ( c % 2 == 1 ) { + // if it's odd, it's a capital and the lower case is c +1 + u[0] = c; + u[1] = c+1; + } else { + // if it's even, it's a lower case and upper case is c-1 + u[0] = c-1; + u[1] = c; + } + return u; + } + if ( c == 0x017F ) { + u[0] = 0x0053; + u[1] = c; + } + + // Latin Extended B + // need to improve this set + + if ( c >= 0x0200 && c <= 0x0217 ) { + if ( c % 2 == 0 ) { + u[0] = c; + u[1] = c+1; + } else { + u[0] = c-1; + u[1] = c; + } + return u; + } + + // Latin Extended Additional + // Range: U+1E00 to U+1EFF + // http://www.unicode.org/Unicode.charts/glyphless/U1E00.html + + // Spacing Modifier Leters + // Range: U+02B0 to U+02FF + + // Combining Diacritical Marks + // Range: U+0300 to U+036F + + // skip Greek for now + // Greek + // Range: U+0370 to U+03FF + + // Cyrillic + // Range: U+0400 to U+04FF + + if ( (c >= 0x0401 && c <= 0x040C) || ( c>= 0x040E && c <= 0x040F ) ) { + u[0] = c; + u[1] = c + 80; + return u; + } + + + if ( c >= 0x0410 && c <= 0x042F ) { + u[0] = c; + u[1] = c + 32; + return u; + } + + if ( c >= 0x0430 && c<= 0x044F ) { + u[0] = c - 32; + u[1] = c; + return u; + + } + if ( (c >= 0x0451 && c <= 0x045C) || (c >=0x045E && c<= 0x045F) ) { + u[0] = c -80; + u[1] = c; + return u; + } + + if ( c >= 0x0460 && c <= 0x047F ) { + if ( c % 2 == 0 ) { + u[0] = c; + u[1] = c +1; + } else { + u[0] = c - 1; + u[1] = c; + } + return u; + } + + // Armenian + // Range: U+0530 to U+058F + if ( c >= 0x0531 && c <= 0x0556 ) { + u[0] = c; + u[1] = c + 48; + return u; + } + if ( c >= 0x0561 && c < 0x0587 ) { + u[0] = c - 48; + u[1] = c; + return u; + } + + // Hebrew + // Range: U+0590 to U+05FF + + + // Arabic + // Range: U+0600 to U+06FF + + // Devanagari + // Range: U+0900 to U+097F + + + // Bengali + // Range: U+0980 to U+09FF + + + // Gurmukhi + // Range: U+0A00 to U+0A7F + + + // Gujarati + // Range: U+0A80 to U+0AFF + + + // Oriya + // Range: U+0B00 to U+0B7F + // no capital / lower case + + + // Tamil + // Range: U+0B80 to U+0BFF + // no capital / lower case + + + // Telugu + // Range: U+0C00 to U+0C7F + // no capital / lower case + + + // Kannada + // Range: U+0C80 to U+0CFF + // no capital / lower case + + + // Malayalam + // Range: U+0D00 to U+0D7F + + // Thai + // Range: U+0E00 to U+0E7F + + + // Lao + // Range: U+0E80 to U+0EFF + + + // Tibetan + // Range: U+0F00 to U+0FBF + + // Georgian + // Range: U+10A0 to U+10F0 + if ( c >= 0x10A0 && c <= 0x10C5 ) { + u[0] = c; + u[1] = c + 48; + return u; + } + if ( c >= 0x10D0 && c <= 0x10F5 ) { + u[0] = c; + u[1] = c; + return u; + } + + // Hangul Jamo + // Range: U+1100 to U+11FF + + // Greek Extended + // Range: U+1F00 to U+1FFF + // skip for now + + + // General Punctuation + // Range: U+2000 to U+206F + + // Superscripts and Subscripts + // Range: U+2070 to U+209F + + // Currency Symbols + // Range: U+20A0 to U+20CF + + + // Combining Diacritical Marks for Symbols + // Range: U+20D0 to U+20FF + // skip for now + + + // Number Forms + // Range: U+2150 to U+218F + // skip for now + + + // Arrows + // Range: U+2190 to U+21FF + + // Mathematical Operators + // Range: U+2200 to U+22FF + + // Miscellaneous Technical + // Range: U+2300 to U+23FF + + // Control Pictures + // Range: U+2400 to U+243F + + // Optical Character Recognition + // Range: U+2440 to U+245F + + // Enclosed Alphanumerics + // Range: U+2460 to U+24FF + + // Box Drawing + // Range: U+2500 to U+257F + + // Block Elements + // Range: U+2580 to U+259F + + // Geometric Shapes + // Range: U+25A0 to U+25FF + + // Miscellaneous Symbols + // Range: U+2600 to U+26FF + + // Dingbats + // Range: U+2700 to U+27BF + + // CJK Symbols and Punctuation + // Range: U+3000 to U+303F + + // Hiragana + // Range: U+3040 to U+309F + + // Katakana + // Range: U+30A0 to U+30FF + + // Bopomofo + // Range: U+3100 to U+312F + + // Hangul Compatibility Jamo + // Range: U+3130 to U+318F + + // Kanbun + // Range: U+3190 to U+319F + + + // Enclosed CJK Letters and Months + // Range: U+3200 to U+32FF + + // CJK Compatibility + // Range: U+3300 to U+33FF + + // Hangul Syllables + // Range: U+AC00 to U+D7A3 + + // High Surrogates + // Range: U+D800 to U+DB7F + + // Private Use High Surrogates + // Range: U+DB80 to U+DBFF + + // Low Surrogates + // Range: U+DC00 to U+DFFF + + // Private Use Area + // Range: U+E000 to U+F8FF + + // CJK Compatibility Ideographs + // Range: U+F900 to U+FAFF + + // Alphabetic Presentation Forms + // Range: U+FB00 to U+FB4F + + // Arabic Presentation Forms-A + // Range: U+FB50 to U+FDFF + + // Combining Half Marks + // Range: U+FE20 to U+FE2F + + // CJK Compatibility Forms + // Range: U+FE30 to U+FE4F + + // Small Form Variants + // Range: U+FE50 to U+FE6F + + // Arabic Presentation Forms-B + // Range: U+FE70 to U+FEFF + + // Halfwidth and Fullwidth Forms + // Range: U+FF00 to U+FFEF + + if ( c >= 0xFF21 && c <= 0xFF3A ) { + u[0] = c; + u[1] = c + 32; + return u; + } + + if ( c >= 0xFF41 && c <= 0xFF5A ) { + u[0] = c - 32; + u[1] = c; + return u; + } + + // Specials + // Range: U+FFF0 to U+FFFF + + return u; +} + +function DecimalToHexString( n ) { + n = Number( n ); + var h = "0x"; + + for ( var i = 3; i >= 0; i-- ) { + if ( n >= Math.pow(16, i) ){ + var t = Math.floor( n / Math.pow(16, i)); + n -= t * Math.pow(16, i); + if ( t >= 10 ) { + if ( t == 10 ) { + h += "A"; + } + if ( t == 11 ) { + h += "B"; + } + if ( t == 12 ) { + h += "C"; + } + if ( t == 13 ) { + h += "D"; + } + if ( t == 14 ) { + h += "E"; + } + if ( t == 15 ) { + h += "F"; + } + } else { + h += String( t ); + } + } else { + h += "0"; + } + } + + return h; +} diff --git a/mozilla/js/tamarin/test/ecma3/String/e15_5_4_12_2.as b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_12_2.as new file mode 100644 index 00000000000..15b72c254fa --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_12_2.as @@ -0,0 +1,496 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.5.4.12-2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "String.prototype.toUpperCase()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TEST_STRING = ""; + var EXPECT_STRING = ""; + + // basic latin test + + for ( var i = 0; i < 0x007B; i++ ) { + var u = new Unicode(i); + TEST_STRING += String.fromCharCode(i); + EXPECT_STRING += String.fromCharCode( u.upper ); + } + + // don't print out the value of the strings since they contain control + // characters that break the driver + var isEqual = EXPECT_STRING == (new String( TEST_STRING )).toUpperCase(); + + array[item++] = new TestCase( SECTION, + "isEqual", + true, + isEqual); + return array; +} + +function MyObject( value ) { + this.value = value; + this.substring = String.prototype.substring; + this.toString = function () { return this.value+''; } +} +function Unicode( c ) { + u = GetUnicodeValues( c ); + this.upper = u[0]; + this.lower = u[1] + return this; +} +function GetUnicodeValues( c ) { + u = new Array(); + + u[0] = c; + u[1] = c; + + // upper case Basic Latin + + if ( c >= 0x0041 && c <= 0x005A) { + u[0] = c; + u[1] = c + 32; + return u; + } + + // lower case Basic Latin + if ( c >= 0x0061 && c <= 0x007a ) { + u[0] = c - 32; + u[1] = c; + return u; + } + + // upper case Latin-1 Supplement + if ( (c >= 0x00C0 && c <= 0x00D6) || (c >= 0x00D8 && c<=0x00DE) ) { + u[0] = c; + u[1] = c + 32; + return u; + } + + // lower case Latin-1 Supplement + if ( (c >= 0x00E0 && c <= 0x00F6) || (c >= 0x00F8 && c <= 0x00FE) ) { + u[0] = c - 32; + u[1] = c; + return u; + } + if ( c == 0x00FF ) { + u[0] = 0x0178; + u[1] = c; + return u; + } + // Latin Extended A + if ( (c >= 0x0100 && c < 0x0138) || (c > 0x0149 && c < 0x0178) ) { + // special case for capital I + if ( c == 0x0130 ) { + u[0] = c; + u[1] = 0x0069; + return u; + } + if ( c == 0x0131 ) { + u[0] = 0x0049; + u[1] = c; + return u; + } + + if ( c % 2 == 0 ) { + // if it's even, it's a capital and the lower case is c +1 + u[0] = c; + u[1] = c+1; + } else { + // if it's odd, it's a lower case and upper case is c-1 + u[0] = c-1; + u[1] = c; + } + return u; + } + if ( c == 0x0178 ) { + u[0] = c; + u[1] = 0x00FF; + return u; + } + + if ( (c >= 0x0139 && c < 0x0149) || (c > 0x0178 && c < 0x017F) ) { + if ( c % 2 == 1 ) { + // if it's odd, it's a capital and the lower case is c +1 + u[0] = c; + u[1] = c+1; + } else { + // if it's even, it's a lower case and upper case is c-1 + u[0] = c-1; + u[1] = c; + } + return u; + } + if ( c == 0x017F ) { + u[0] = 0x0053; + u[1] = c; + } + + // Latin Extended B + // need to improve this set + + if ( c >= 0x0200 && c <= 0x0217 ) { + if ( c % 2 == 0 ) { + u[0] = c; + u[1] = c+1; + } else { + u[0] = c-1; + u[1] = c; + } + return u; + } + + // Latin Extended Additional + // Range: U+1E00 to U+1EFF + // http://www.unicode.org/Unicode.charts/glyphless/U1E00.html + + // Spacing Modifier Leters + // Range: U+02B0 to U+02FF + + // Combining Diacritical Marks + // Range: U+0300 to U+036F + + // skip Greek for now + // Greek + // Range: U+0370 to U+03FF + + // Cyrillic + // Range: U+0400 to U+04FF + + if ( (c >= 0x0401 && c <= 0x040C) || ( c>= 0x040E && c <= 0x040F ) ) { + u[0] = c; + u[1] = c + 80; + return u; + } + + + if ( c >= 0x0410 && c <= 0x042F ) { + u[0] = c; + u[1] = c + 32; + return u; + } + + if ( c >= 0x0430 && c<= 0x044F ) { + u[0] = c - 32; + u[1] = c; + return u; + + } + if ( (c >= 0x0451 && c <= 0x045C) || (c >=0x045E && c<= 0x045F) ) { + u[0] = c -80; + u[1] = c; + return u; + } + + if ( c >= 0x0460 && c <= 0x047F ) { + if ( c % 2 == 0 ) { + u[0] = c; + u[1] = c +1; + } else { + u[0] = c - 1; + u[1] = c; + } + return u; + } + + // Armenian + // Range: U+0530 to U+058F + if ( c >= 0x0531 && c <= 0x0556 ) { + u[0] = c; + u[1] = c + 48; + return u; + } + if ( c >= 0x0561 && c < 0x0587 ) { + u[0] = c - 48; + u[1] = c; + return u; + } + + // Hebrew + // Range: U+0590 to U+05FF + + + // Arabic + // Range: U+0600 to U+06FF + + // Devanagari + // Range: U+0900 to U+097F + + + // Bengali + // Range: U+0980 to U+09FF + + + // Gurmukhi + // Range: U+0A00 to U+0A7F + + + // Gujarati + // Range: U+0A80 to U+0AFF + + + // Oriya + // Range: U+0B00 to U+0B7F + // no capital / lower case + + + // Tamil + // Range: U+0B80 to U+0BFF + // no capital / lower case + + + // Telugu + // Range: U+0C00 to U+0C7F + // no capital / lower case + + + // Kannada + // Range: U+0C80 to U+0CFF + // no capital / lower case + + + // Malayalam + // Range: U+0D00 to U+0D7F + + // Thai + // Range: U+0E00 to U+0E7F + + + // Lao + // Range: U+0E80 to U+0EFF + + + // Tibetan + // Range: U+0F00 to U+0FBF + + // Georgian + // Range: U+10A0 to U+10F0 + if ( c >= 0x10A0 && c <= 0x10C5 ) { + u[0] = c; + u[1] = c + 48; + return u; + } + if ( c >= 0x10D0 && c <= 0x10F5 ) { + u[0] = c; + u[1] = c; + return u; + } + + // Hangul Jamo + // Range: U+1100 to U+11FF + + // Greek Extended + // Range: U+1F00 to U+1FFF + // skip for now + + + // General Punctuation + // Range: U+2000 to U+206F + + // Superscripts and Subscripts + // Range: U+2070 to U+209F + + // Currency Symbols + // Range: U+20A0 to U+20CF + + + // Combining Diacritical Marks for Symbols + // Range: U+20D0 to U+20FF + // skip for now + + + // Number Forms + // Range: U+2150 to U+218F + // skip for now + + + // Arrows + // Range: U+2190 to U+21FF + + // Mathematical Operators + // Range: U+2200 to U+22FF + + // Miscellaneous Technical + // Range: U+2300 to U+23FF + + // Control Pictures + // Range: U+2400 to U+243F + + // Optical Character Recognition + // Range: U+2440 to U+245F + + // Enclosed Alphanumerics + // Range: U+2460 to U+24FF + + // Box Drawing + // Range: U+2500 to U+257F + + // Block Elements + // Range: U+2580 to U+259F + + // Geometric Shapes + // Range: U+25A0 to U+25FF + + // Miscellaneous Symbols + // Range: U+2600 to U+26FF + + // Dingbats + // Range: U+2700 to U+27BF + + // CJK Symbols and Punctuation + // Range: U+3000 to U+303F + + // Hiragana + // Range: U+3040 to U+309F + + // Katakana + // Range: U+30A0 to U+30FF + + // Bopomofo + // Range: U+3100 to U+312F + + // Hangul Compatibility Jamo + // Range: U+3130 to U+318F + + // Kanbun + // Range: U+3190 to U+319F + + + // Enclosed CJK Letters and Months + // Range: U+3200 to U+32FF + + // CJK Compatibility + // Range: U+3300 to U+33FF + + // Hangul Syllables + // Range: U+AC00 to U+D7A3 + + // High Surrogates + // Range: U+D800 to U+DB7F + + // Private Use High Surrogates + // Range: U+DB80 to U+DBFF + + // Low Surrogates + // Range: U+DC00 to U+DFFF + + // Private Use Area + // Range: U+E000 to U+F8FF + + // CJK Compatibility Ideographs + // Range: U+F900 to U+FAFF + + // Alphabetic Presentation Forms + // Range: U+FB00 to U+FB4F + + // Arabic Presentation Forms-A + // Range: U+FB50 to U+FDFF + + // Combining Half Marks + // Range: U+FE20 to U+FE2F + + // CJK Compatibility Forms + // Range: U+FE30 to U+FE4F + + // Small Form Variants + // Range: U+FE50 to U+FE6F + + // Arabic Presentation Forms-B + // Range: U+FE70 to U+FEFF + + // Halfwidth and Fullwidth Forms + // Range: U+FF00 to U+FFEF + + if ( c >= 0xFF21 && c <= 0xFF3A ) { + u[0] = c; + u[1] = c + 32; + return u; + } + + if ( c >= 0xFF41 && c <= 0xFF5A ) { + u[0] = c - 32; + u[1] = c; + return u; + } + + // Specials + // Range: U+FFF0 to U+FFFF + + return u; +} + +function DecimalToHexString( n ) { + n = Number( n ); + var h = "0x"; + + for ( var i = 3; i >= 0; i-- ) { + if ( n >= Math.pow(16, i) ){ + var t = Math.floor( n / Math.pow(16, i)); + n -= t * Math.pow(16, i); + if ( t >= 10 ) { + if ( t == 10 ) { + h += "A"; + } + if ( t == 11 ) { + h += "B"; + } + if ( t == 12 ) { + h += "C"; + } + if ( t == 13 ) { + h += "D"; + } + if ( t == 14 ) { + h += "E"; + } + if ( t == 15 ) { + h += "F"; + } + } else { + h += String( t ); + } + } else { + h += "0"; + } + } + + return h; +} + diff --git a/mozilla/js/tamarin/test/ecma3/String/e15_5_4_12_3.as b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_12_3.as new file mode 100644 index 00000000000..ad1fc158527 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_12_3.as @@ -0,0 +1,539 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.5.4.12-3"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "String.prototype.toUpperCase()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // Georgian + // Range: U+10A0 to U+10FF + for ( var i = 0x10A0; i <= 0x10FF; i++ ) { + var U = new Unicode( i ); + array[item++] = new TestCase( SECTION, + "var s = new String( String.fromCharCode("+i+") ); s.toUpperCase()", + String.fromCharCode(U.upper), + (s = new String( String.fromCharCode(i) ), s.toUpperCase()) ); + + array[item++] = new TestCase( SECTION, + "var s = new String( String.fromCharCode("+i+") ); s.toUpperCase().charCodeAt(0)", + U.upper, + (s = new String( String.fromCharCode(i) ), s.toUpperCase().charCodeAt(0) ) ); + + } + + // Halfwidth and Fullwidth Forms + // Range: U+FF00 to U+FFEF + for ( var i = 0xFF00; i <= 0xFFEF; i++ ) { + + array[item++] = new TestCase( SECTION, + "var s = new String( String.fromCharCode("+i+") ); s.toUpperCase()", + (u = new Unicode( i ), String.fromCharCode(u.upper) ), + (s = new String( String.fromCharCode(i) ), s.toUpperCase()) ); + + + array[item++] = new TestCase( SECTION, + "var s = new String( String.fromCharCode("+i+") ); s.toUpperCase().charCodeAt(0)", + (u = new Unicode( i ), u.upper ), + (s = new String( String.fromCharCode(i) ), s.toUpperCase().charCodeAt(0)) ); + } + + // Hiragana (no upper / lower case) + // Range: U+3040 to U+309F + + for ( var i = 0x3040; i <= 0x309F; i++ ) { + array[item++] = new TestCase( SECTION, + "var s = new String( String.fromCharCode("+i+") ); s.toUpperCase()", + (u = new Unicode( i ), String.fromCharCode(u.upper) ), + (s = new String( String.fromCharCode(i) ), s.toUpperCase()) ); + + array[item++] = new TestCase( SECTION, + "var s = new String( String.fromCharCode("+i+") ); s.toUpperCase().charCodeAt(0)", + (u = new Unicode( i ), u.upper ), + (s = new String( String.fromCharCode(i) ), s.toUpperCase().charCodeAt(0)) ); + } + + +/* + var TEST_STRING = ""; + var EXPECT_STRING = ""; + + // basic latin test + + for ( var i = 0; i < 0x007A; i++ ) { + var u = new Unicode(i); + TEST_STRING += String.fromCharCode(i); + EXPECT_STRING += String.fromCharCode( u.upper ); + } +*/ + + + + return array; +} + +function MyObject( value ) { + this.value = value; + this.substring = String.prototype.substring; + this.toString = function() { return this.value+''; }; +} +function Unicode( c ) { + u = GetUnicodeValues( c ); + this.upper = u[0]; + this.lower = u[1] + return this; +} +function GetUnicodeValues( c ) { + u = new Array(); + + u[0] = c; + u[1] = c; + + // upper case Basic Latin + + if ( c >= 0x0041 && c <= 0x005A) { + u[0] = c; + u[1] = c + 32; + return u; + } + + // lower case Basic Latin + if ( c >= 0x0061 && c <= 0x007a ) { + u[0] = c - 32; + u[1] = c; + return u; + } + + // upper case Latin-1 Supplement + if ( (c >= 0x00C0 && c <= 0x00D6) || (c >= 0x00D8 && c<=0x00DE) ) { + u[0] = c; + u[1] = c + 32; + return u; + } + + // lower case Latin-1 Supplement + if ( (c >= 0x00E0 && c <= 0x00F6) || (c >= 0x00F8 && c <= 0x00FE) ) { + u[0] = c - 32; + u[1] = c; + return u; + } + if ( c == 0x00FF ) { + u[0] = 0x0178; + u[1] = c; + return u; + } + // Latin Extended A + if ( (c >= 0x0100 && c < 0x0138) || (c > 0x0149 && c < 0x0178) ) { + // special case for capital I + if ( c == 0x0130 ) { + u[0] = c; + u[1] = 0x0069; + return u; + } + if ( c == 0x0131 ) { + u[0] = 0x0049; + u[1] = c; + return u; + } + + if ( c % 2 == 0 ) { + // if it's even, it's a capital and the lower case is c +1 + u[0] = c; + u[1] = c+1; + } else { + // if it's odd, it's a lower case and upper case is c-1 + u[0] = c-1; + u[1] = c; + } + return u; + } + if ( c == 0x0178 ) { + u[0] = c; + u[1] = 0x00FF; + return u; + } + + if ( (c >= 0x0139 && c < 0x0149) || (c > 0x0178 && c < 0x017F) ) { + if ( c % 2 == 1 ) { + // if it's odd, it's a capital and the lower case is c +1 + u[0] = c; + u[1] = c+1; + } else { + // if it's even, it's a lower case and upper case is c-1 + u[0] = c-1; + u[1] = c; + } + return u; + } + if ( c == 0x017F ) { + u[0] = 0x0053; + u[1] = c; + } + + // Latin Extended B + // need to improve this set + + if ( c >= 0x0200 && c <= 0x0217 ) { + if ( c % 2 == 0 ) { + u[0] = c; + u[1] = c+1; + } else { + u[0] = c-1; + u[1] = c; + } + return u; + } + + // Latin Extended Additional + // Range: U+1E00 to U+1EFF + // http://www.unicode.org/Unicode.charts/glyphless/U1E00.html + + // Spacing Modifier Leters + // Range: U+02B0 to U+02FF + + // Combining Diacritical Marks + // Range: U+0300 to U+036F + + // skip Greek for now + // Greek + // Range: U+0370 to U+03FF + + // Cyrillic + // Range: U+0400 to U+04FF + + if ( (c >= 0x0401 && c <= 0x040C) || ( c>= 0x040E && c <= 0x040F ) ) { + u[0] = c; + u[1] = c + 80; + return u; + } + + + if ( c >= 0x0410 && c <= 0x042F ) { + u[0] = c; + u[1] = c + 32; + return u; + } + + if ( c >= 0x0430 && c<= 0x044F ) { + u[0] = c - 32; + u[1] = c; + return u; + + } + if ( (c >= 0x0451 && c <= 0x045C) || (c >=0x045E && c<= 0x045F) ) { + u[0] = c -80; + u[1] = c; + return u; + } + + if ( c >= 0x0460 && c <= 0x047F ) { + if ( c % 2 == 0 ) { + u[0] = c; + u[1] = c +1; + } else { + u[0] = c - 1; + u[1] = c; + } + return u; + } + + // Armenian + // Range: U+0530 to U+058F + if ( c >= 0x0531 && c <= 0x0556 ) { + u[0] = c; + u[1] = c + 48; + return u; + } + if ( c >= 0x0561 && c < 0x0587 ) { + u[0] = c - 48; + u[1] = c; + return u; + } + + // Hebrew + // Range: U+0590 to U+05FF + + + // Arabic + // Range: U+0600 to U+06FF + + // Devanagari + // Range: U+0900 to U+097F + + + // Bengali + // Range: U+0980 to U+09FF + + + // Gurmukhi + // Range: U+0A00 to U+0A7F + + + // Gujarati + // Range: U+0A80 to U+0AFF + + + // Oriya + // Range: U+0B00 to U+0B7F + // no capital / lower case + + + // Tamil + // Range: U+0B80 to U+0BFF + // no capital / lower case + + + // Telugu + // Range: U+0C00 to U+0C7F + // no capital / lower case + + + // Kannada + // Range: U+0C80 to U+0CFF + // no capital / lower case + + + // Malayalam + // Range: U+0D00 to U+0D7F + + // Thai + // Range: U+0E00 to U+0E7F + + + // Lao + // Range: U+0E80 to U+0EFF + + + // Tibetan + // Range: U+0F00 to U+0FBF + + // Georgian + // Range: U+10A0 to U+10F0 + if ( c >= 0x10A0 && c <= 0x10C5 ) { + u[0] = c; + u[1] = c + 48; + return u; + } + if ( c >= 0x10D0 && c <= 0x10F5 ) { + u[0] = c; + u[1] = c; + return u; + } + + // Hangul Jamo + // Range: U+1100 to U+11FF + + // Greek Extended + // Range: U+1F00 to U+1FFF + // skip for now + + + // General Punctuation + // Range: U+2000 to U+206F + + // Superscripts and Subscripts + // Range: U+2070 to U+209F + + // Currency Symbols + // Range: U+20A0 to U+20CF + + + // Combining Diacritical Marks for Symbols + // Range: U+20D0 to U+20FF + // skip for now + + + // Number Forms + // Range: U+2150 to U+218F + // skip for now + + + // Arrows + // Range: U+2190 to U+21FF + + // Mathematical Operators + // Range: U+2200 to U+22FF + + // Miscellaneous Technical + // Range: U+2300 to U+23FF + + // Control Pictures + // Range: U+2400 to U+243F + + // Optical Character Recognition + // Range: U+2440 to U+245F + + // Enclosed Alphanumerics + // Range: U+2460 to U+24FF + + // Box Drawing + // Range: U+2500 to U+257F + + // Block Elements + // Range: U+2580 to U+259F + + // Geometric Shapes + // Range: U+25A0 to U+25FF + + // Miscellaneous Symbols + // Range: U+2600 to U+26FF + + // Dingbats + // Range: U+2700 to U+27BF + + // CJK Symbols and Punctuation + // Range: U+3000 to U+303F + + // Hiragana + // Range: U+3040 to U+309F + + // Katakana + // Range: U+30A0 to U+30FF + + // Bopomofo + // Range: U+3100 to U+312F + + // Hangul Compatibility Jamo + // Range: U+3130 to U+318F + + // Kanbun + // Range: U+3190 to U+319F + + + // Enclosed CJK Letters and Months + // Range: U+3200 to U+32FF + + // CJK Compatibility + // Range: U+3300 to U+33FF + + // Hangul Syllables + // Range: U+AC00 to U+D7A3 + + // High Surrogates + // Range: U+D800 to U+DB7F + + // Private Use High Surrogates + // Range: U+DB80 to U+DBFF + + // Low Surrogates + // Range: U+DC00 to U+DFFF + + // Private Use Area + // Range: U+E000 to U+F8FF + + // CJK Compatibility Ideographs + // Range: U+F900 to U+FAFF + + // Alphabetic Presentation Forms + // Range: U+FB00 to U+FB4F + + // Arabic Presentation Forms-A + // Range: U+FB50 to U+FDFF + + // Combining Half Marks + // Range: U+FE20 to U+FE2F + + // CJK Compatibility Forms + // Range: U+FE30 to U+FE4F + + // Small Form Variants + // Range: U+FE50 to U+FE6F + + // Arabic Presentation Forms-B + // Range: U+FE70 to U+FEFF + + // Halfwidth and Fullwidth Forms + // Range: U+FF00 to U+FFEF + + if ( c >= 0xFF21 && c <= 0xFF3A ) { + u[0] = c; + u[1] = c + 32; + return u; + } + + if ( c >= 0xFF41 && c <= 0xFF5A ) { + u[0] = c - 32; + u[1] = c; + return u; + } + + // Specials + // Range: U+FFF0 to U+FFFF + + return u; +} + +function DecimalToHexString( n ) { + n = Number( n ); + var h = "0x"; + + for ( var i = 3; i >= 0; i-- ) { + if ( n >= Math.pow(16, i) ){ + var t = Math.floor( n / Math.pow(16, i)); + n -= t * Math.pow(16, i); + if ( t >= 10 ) { + if ( t == 10 ) { + h += "A"; + } + if ( t == 11 ) { + h += "B"; + } + if ( t == 12 ) { + h += "C"; + } + if ( t == 13 ) { + h += "D"; + } + if ( t == 14 ) { + h += "E"; + } + if ( t == 15 ) { + h += "F"; + } + } else { + h += String( t ); + } + } else { + h += "0"; + } + } + + return h; +} diff --git a/mozilla/js/tamarin/test/ecma3/String/e15_5_4_12_4.as b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_12_4.as new file mode 100644 index 00000000000..4c0b60a222a --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_12_4.as @@ -0,0 +1,493 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.5.4.12-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "String.prototype.toUpperCase()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // Cyrillic (part) + // Range: U+0400 to U+04FF + for ( var i = 0x0400; i <= 0x047F; i++ ) { + var U =new Unicode( i ); +/* + array[item++] = new TestCase( SECTION, + "var s = new String( String.fromCharCode("+i+") ); s.toUpperCase()", + U.upper, + (s = new String( String.fromCharCode("+i+ ) ), s.toUpperCase()") ); +*/ + array[item++] = new TestCase( SECTION, + "var s = new String( String.fromCharCode("+i+") ); s.toUpperCase().charCodeAt(0)", + U.upper, + (s = new String( String.fromCharCode(i) ), s.toUpperCase().charCodeAt(0) ) ); + + } + + return array; +} + +function MyObject( value ) { + this.value = value; + this.substring = String.prototype.substring; + this.toString = function () { return this.value+'' } +} +function Unicode( c ) { + u = GetUnicodeValues( c ); + this.upper = u[0]; + this.lower = u[1] + return this; +} +function GetUnicodeValues( c ) { + u = new Array(); + + u[0] = c; + u[1] = c; + + // upper case Basic Latin + + if ( c >= 0x0041 && c <= 0x005A) { + u[0] = c; + u[1] = c + 32; + return u; + } + + // lower case Basic Latin + if ( c >= 0x0061 && c <= 0x007a ) { + u[0] = c - 32; + u[1] = c; + return u; + } + + // upper case Latin-1 Supplement + if ( (c >= 0x00C0 && c <= 0x00D6) || (c >= 0x00D8 && c<=0x00DE) ) { + u[0] = c; + u[1] = c + 32; + return u; + } + + // lower case Latin-1 Supplement + if ( (c >= 0x00E0 && c <= 0x00F6) || (c >= 0x00F8 && c <= 0x00FE) ) { + u[0] = c - 32; + u[1] = c; + return u; + } + if ( c == 0x00FF ) { + u[0] = 0x0178; + u[1] = c; + return u; + } + // Latin Extended A + if ( (c >= 0x0100 && c < 0x0138) || (c > 0x0149 && c < 0x0178) ) { + // special case for capital I + if ( c == 0x0130 ) { + u[0] = c; + u[1] = 0x0069; + return u; + } + if ( c == 0x0131 ) { + u[0] = 0x0049; + u[1] = c; + return u; + } + + if ( c % 2 == 0 ) { + // if it's even, it's a capital and the lower case is c +1 + u[0] = c; + u[1] = c+1; + } else { + // if it's odd, it's a lower case and upper case is c-1 + u[0] = c-1; + u[1] = c; + } + return u; + } + if ( c == 0x0178 ) { + u[0] = c; + u[1] = 0x00FF; + return u; + } + + if ( (c >= 0x0139 && c < 0x0149) || (c > 0x0178 && c < 0x017F) ) { + if ( c % 2 == 1 ) { + // if it's odd, it's a capital and the lower case is c +1 + u[0] = c; + u[1] = c+1; + } else { + // if it's even, it's a lower case and upper case is c-1 + u[0] = c-1; + u[1] = c; + } + return u; + } + if ( c == 0x017F ) { + u[0] = 0x0053; + u[1] = c; + } + + // Latin Extended B + // need to improve this set + + if ( c >= 0x0200 && c <= 0x0217 ) { + if ( c % 2 == 0 ) { + u[0] = c; + u[1] = c+1; + } else { + u[0] = c-1; + u[1] = c; + } + return u; + } + + // Latin Extended Additional + // Range: U+1E00 to U+1EFF + // http://www.unicode.org/Unicode.charts/glyphless/U1E00.html + + // Spacing Modifier Leters + // Range: U+02B0 to U+02FF + + // Combining Diacritical Marks + // Range: U+0300 to U+036F + + // skip Greek for now + // Greek + // Range: U+0370 to U+03FF + + // Cyrillic + // Range: U+0400 to U+04FF + + if ( (c >= 0x0401 && c <= 0x040C) || ( c>= 0x040E && c <= 0x040F ) ) { + u[0] = c; + u[1] = c + 80; + return u; + } + + + if ( c >= 0x0410 && c <= 0x042F ) { + u[0] = c; + u[1] = c + 32; + return u; + } + + if ( c >= 0x0430 && c<= 0x044F ) { + u[0] = c - 32; + u[1] = c; + return u; + + } + if ( (c >= 0x0450 && c <= 0x045C) || (c >=0x045D && c<= 0x045F) ) { + u[0] = c -80; + u[1] = c; + return u; + } + + if ( c >= 0x0460 && c <= 0x047F ) { + if ( c % 2 == 0 ) { + u[0] = c; + u[1] = c +1; + } else { + u[0] = c - 1; + u[1] = c; + } + return u; + } + + // Armenian + // Range: U+0530 to U+058F + if ( c >= 0x0531 && c <= 0x0556 ) { + u[0] = c; + u[1] = c + 48; + return u; + } + if ( c >= 0x0561 && c < 0x0587 ) { + u[0] = c - 48; + u[1] = c; + return u; + } + + // Hebrew + // Range: U+0590 to U+05FF + + + // Arabic + // Range: U+0600 to U+06FF + + // Devanagari + // Range: U+0900 to U+097F + + + // Bengali + // Range: U+0980 to U+09FF + + + // Gurmukhi + // Range: U+0A00 to U+0A7F + + + // Gujarati + // Range: U+0A80 to U+0AFF + + + // Oriya + // Range: U+0B00 to U+0B7F + // no capital / lower case + + + // Tamil + // Range: U+0B80 to U+0BFF + // no capital / lower case + + + // Telugu + // Range: U+0C00 to U+0C7F + // no capital / lower case + + + // Kannada + // Range: U+0C80 to U+0CFF + // no capital / lower case + + + // Malayalam + // Range: U+0D00 to U+0D7F + + // Thai + // Range: U+0E00 to U+0E7F + + + // Lao + // Range: U+0E80 to U+0EFF + + + // Tibetan + // Range: U+0F00 to U+0FBF + + // Georgian + // Range: U+10A0 to U+10F0 + if ( c >= 0x10A0 && c <= 0x10C5 ) { + u[0] = c; + u[1] = c + 48; + return u; + } + if ( c >= 0x10D0 && c <= 0x10F5 ) { + u[0] = c; + u[1] = c; + return u; + } + + // Hangul Jamo + // Range: U+1100 to U+11FF + + // Greek Extended + // Range: U+1F00 to U+1FFF + // skip for now + + + // General Punctuation + // Range: U+2000 to U+206F + + // Superscripts and Subscripts + // Range: U+2070 to U+209F + + // Currency Symbols + // Range: U+20A0 to U+20CF + + + // Combining Diacritical Marks for Symbols + // Range: U+20D0 to U+20FF + // skip for now + + + // Number Forms + // Range: U+2150 to U+218F + // skip for now + + + // Arrows + // Range: U+2190 to U+21FF + + // Mathematical Operators + // Range: U+2200 to U+22FF + + // Miscellaneous Technical + // Range: U+2300 to U+23FF + + // Control Pictures + // Range: U+2400 to U+243F + + // Optical Character Recognition + // Range: U+2440 to U+245F + + // Enclosed Alphanumerics + // Range: U+2460 to U+24FF + + // Box Drawing + // Range: U+2500 to U+257F + + // Block Elements + // Range: U+2580 to U+259F + + // Geometric Shapes + // Range: U+25A0 to U+25FF + + // Miscellaneous Symbols + // Range: U+2600 to U+26FF + + // Dingbats + // Range: U+2700 to U+27BF + + // CJK Symbols and Punctuation + // Range: U+3000 to U+303F + + // Hiragana + // Range: U+3040 to U+309F + + // Katakana + // Range: U+30A0 to U+30FF + + // Bopomofo + // Range: U+3100 to U+312F + + // Hangul Compatibility Jamo + // Range: U+3130 to U+318F + + // Kanbun + // Range: U+3190 to U+319F + + + // Enclosed CJK Letters and Months + // Range: U+3200 to U+32FF + + // CJK Compatibility + // Range: U+3300 to U+33FF + + // Hangul Syllables + // Range: U+AC00 to U+D7A3 + + // High Surrogates + // Range: U+D800 to U+DB7F + + // Private Use High Surrogates + // Range: U+DB80 to U+DBFF + + // Low Surrogates + // Range: U+DC00 to U+DFFF + + // Private Use Area + // Range: U+E000 to U+F8FF + + // CJK Compatibility Ideographs + // Range: U+F900 to U+FAFF + + // Alphabetic Presentation Forms + // Range: U+FB00 to U+FB4F + + // Arabic Presentation Forms-A + // Range: U+FB50 to U+FDFF + + // Combining Half Marks + // Range: U+FE20 to U+FE2F + + // CJK Compatibility Forms + // Range: U+FE30 to U+FE4F + + // Small Form Variants + // Range: U+FE50 to U+FE6F + + // Arabic Presentation Forms-B + // Range: U+FE70 to U+FEFF + + // Halfwidth and Fullwidth Forms + // Range: U+FF00 to U+FFEF + + if ( c >= 0xFF21 && c <= 0xFF3A ) { + u[0] = c; + u[1] = c + 32; + return u; + } + + if ( c >= 0xFF41 && c <= 0xFF5A ) { + u[0] = c - 32; + u[1] = c; + return u; + } + + // Specials + // Range: U+FFF0 to U+FFFF + + return u; +} + +function DecimalToHexString( n ) { + n = Number( n ); + var h = "0x"; + + for ( var i = 3; i >= 0; i-- ) { + if ( n >= Math.pow(16, i) ){ + var t = Math.floor( n / Math.pow(16, i)); + n -= t * Math.pow(16, i); + if ( t >= 10 ) { + if ( t == 10 ) { + h += "A"; + } + if ( t == 11 ) { + h += "B"; + } + if ( t == 12 ) { + h += "C"; + } + if ( t == 13 ) { + h += "D"; + } + if ( t == 14 ) { + h += "E"; + } + if ( t == 15 ) { + h += "F"; + } + } else { + h += String( t ); + } + } else { + h += "0"; + } + } + + return h; +} diff --git a/mozilla/js/tamarin/test/ecma3/String/e15_5_4_12_5.as b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_12_5.as new file mode 100644 index 00000000000..455ed4875d2 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_12_5.as @@ -0,0 +1,493 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.5.4.12-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "String.prototype.toUpperCase()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // Armenian + // Range: U+0530 to U+058F + for ( var i = 0x0530; i <= 0x058F; i++ ) { + var U = new Unicode( i ); +/* + array[item++] = new TestCase( SECTION, + "var s = new String( String.fromCharCode("+i+") ); s.toUpperCase()", + String.fromCharCode(U.upper), + (s = new String( String.fromCharCode("+i+ ) ), s.toUpperCase()") ); +*/ + array[item++] = new TestCase( SECTION, + "var s = new String( String.fromCharCode("+i+") ); s.toUpperCase().charCodeAt(0)", + U.upper, + (s = new String( String.fromCharCode(i) ), s.toUpperCase().charCodeAt(0) ) ); + + } + + return array; +} + +function MyObject( value ) { + this.value = value; + this.substring = String.prototype.substring; + this.toString = function () { return this.value+'' } +} +function Unicode( c ) { + u = GetUnicodeValues( c ); + this.upper = u[0]; + this.lower = u[1] + return this; +} +function GetUnicodeValues( c ) { + u = new Array(); + + u[0] = c; + u[1] = c; + + // upper case Basic Latin + + if ( c >= 0x0041 && c <= 0x005A) { + u[0] = c; + u[1] = c + 32; + return u; + } + + // lower case Basic Latin + if ( c >= 0x0061 && c <= 0x007a ) { + u[0] = c - 32; + u[1] = c; + return u; + } + + // upper case Latin-1 Supplement + if ( (c >= 0x00C0 && c <= 0x00D6) || (c >= 0x00D8 && c<=0x00DE) ) { + u[0] = c; + u[1] = c + 32; + return u; + } + + // lower case Latin-1 Supplement + if ( (c >= 0x00E0 && c <= 0x00F6) || (c >= 0x00F8 && c <= 0x00FE) ) { + u[0] = c - 32; + u[1] = c; + return u; + } + if ( c == 0x00FF ) { + u[0] = 0x0178; + u[1] = c; + return u; + } + // Latin Extended A + if ( (c >= 0x0100 && c < 0x0138) || (c > 0x0149 && c < 0x0178) ) { + // special case for capital I + if ( c == 0x0130 ) { + u[0] = c; + u[1] = 0x0069; + return u; + } + if ( c == 0x0131 ) { + u[0] = 0x0049; + u[1] = c; + return u; + } + + if ( c % 2 == 0 ) { + // if it's even, it's a capital and the lower case is c +1 + u[0] = c; + u[1] = c+1; + } else { + // if it's odd, it's a lower case and upper case is c-1 + u[0] = c-1; + u[1] = c; + } + return u; + } + if ( c == 0x0178 ) { + u[0] = c; + u[1] = 0x00FF; + return u; + } + + if ( (c >= 0x0139 && c < 0x0149) || (c > 0x0178 && c < 0x017F) ) { + if ( c % 2 == 1 ) { + // if it's odd, it's a capital and the lower case is c +1 + u[0] = c; + u[1] = c+1; + } else { + // if it's even, it's a lower case and upper case is c-1 + u[0] = c-1; + u[1] = c; + } + return u; + } + if ( c == 0x017F ) { + u[0] = 0x0053; + u[1] = c; + } + + // Latin Extended B + // need to improve this set + + if ( c >= 0x0200 && c <= 0x0217 ) { + if ( c % 2 == 0 ) { + u[0] = c; + u[1] = c+1; + } else { + u[0] = c-1; + u[1] = c; + } + return u; + } + + // Latin Extended Additional + // Range: U+1E00 to U+1EFF + // http://www.unicode.org/Unicode.charts/glyphless/U1E00.html + + // Spacing Modifier Leters + // Range: U+02B0 to U+02FF + + // Combining Diacritical Marks + // Range: U+0300 to U+036F + + // skip Greek for now + // Greek + // Range: U+0370 to U+03FF + + // Cyrillic + // Range: U+0400 to U+04FF + + if ( (c >= 0x0401 && c <= 0x040C) || ( c>= 0x040E && c <= 0x040F ) ) { + u[0] = c; + u[1] = c + 80; + return u; + } + + + if ( c >= 0x0410 && c <= 0x042F ) { + u[0] = c; + u[1] = c + 32; + return u; + } + + if ( c >= 0x0430 && c<= 0x044F ) { + u[0] = c - 32; + u[1] = c; + return u; + + } + if ( (c >= 0x0451 && c <= 0x045C) || (c >=0x045E && c<= 0x045F) ) { + u[0] = c -80; + u[1] = c; + return u; + } + + if ( c >= 0x0460 && c <= 0x047F ) { + if ( c % 2 == 0 ) { + u[0] = c; + u[1] = c +1; + } else { + u[0] = c - 1; + u[1] = c; + } + return u; + } + + // Armenian + // Range: U+0530 to U+058F + if ( c >= 0x0531 && c <= 0x0556 ) { + u[0] = c; + u[1] = c + 48; + return u; + } + if ( c >= 0x0561 && c < 0x0587 ) { + u[0] = c - 48; + u[1] = c; + return u; + } + + // Hebrew + // Range: U+0590 to U+05FF + + + // Arabic + // Range: U+0600 to U+06FF + + // Devanagari + // Range: U+0900 to U+097F + + + // Bengali + // Range: U+0980 to U+09FF + + + // Gurmukhi + // Range: U+0A00 to U+0A7F + + + // Gujarati + // Range: U+0A80 to U+0AFF + + + // Oriya + // Range: U+0B00 to U+0B7F + // no capital / lower case + + + // Tamil + // Range: U+0B80 to U+0BFF + // no capital / lower case + + + // Telugu + // Range: U+0C00 to U+0C7F + // no capital / lower case + + + // Kannada + // Range: U+0C80 to U+0CFF + // no capital / lower case + + + // Malayalam + // Range: U+0D00 to U+0D7F + + // Thai + // Range: U+0E00 to U+0E7F + + + // Lao + // Range: U+0E80 to U+0EFF + + + // Tibetan + // Range: U+0F00 to U+0FBF + + // Georgian + // Range: U+10A0 to U+10F0 + if ( c >= 0x10A0 && c <= 0x10C5 ) { + u[0] = c; + u[1] = c + 48; + return u; + } + if ( c >= 0x10D0 && c <= 0x10F5 ) { + u[0] = c; + u[1] = c; + return u; + } + + // Hangul Jamo + // Range: U+1100 to U+11FF + + // Greek Extended + // Range: U+1F00 to U+1FFF + // skip for now + + + // General Punctuation + // Range: U+2000 to U+206F + + // Superscripts and Subscripts + // Range: U+2070 to U+209F + + // Currency Symbols + // Range: U+20A0 to U+20CF + + + // Combining Diacritical Marks for Symbols + // Range: U+20D0 to U+20FF + // skip for now + + + // Number Forms + // Range: U+2150 to U+218F + // skip for now + + + // Arrows + // Range: U+2190 to U+21FF + + // Mathematical Operators + // Range: U+2200 to U+22FF + + // Miscellaneous Technical + // Range: U+2300 to U+23FF + + // Control Pictures + // Range: U+2400 to U+243F + + // Optical Character Recognition + // Range: U+2440 to U+245F + + // Enclosed Alphanumerics + // Range: U+2460 to U+24FF + + // Box Drawing + // Range: U+2500 to U+257F + + // Block Elements + // Range: U+2580 to U+259F + + // Geometric Shapes + // Range: U+25A0 to U+25FF + + // Miscellaneous Symbols + // Range: U+2600 to U+26FF + + // Dingbats + // Range: U+2700 to U+27BF + + // CJK Symbols and Punctuation + // Range: U+3000 to U+303F + + // Hiragana + // Range: U+3040 to U+309F + + // Katakana + // Range: U+30A0 to U+30FF + + // Bopomofo + // Range: U+3100 to U+312F + + // Hangul Compatibility Jamo + // Range: U+3130 to U+318F + + // Kanbun + // Range: U+3190 to U+319F + + + // Enclosed CJK Letters and Months + // Range: U+3200 to U+32FF + + // CJK Compatibility + // Range: U+3300 to U+33FF + + // Hangul Syllables + // Range: U+AC00 to U+D7A3 + + // High Surrogates + // Range: U+D800 to U+DB7F + + // Private Use High Surrogates + // Range: U+DB80 to U+DBFF + + // Low Surrogates + // Range: U+DC00 to U+DFFF + + // Private Use Area + // Range: U+E000 to U+F8FF + + // CJK Compatibility Ideographs + // Range: U+F900 to U+FAFF + + // Alphabetic Presentation Forms + // Range: U+FB00 to U+FB4F + + // Arabic Presentation Forms-A + // Range: U+FB50 to U+FDFF + + // Combining Half Marks + // Range: U+FE20 to U+FE2F + + // CJK Compatibility Forms + // Range: U+FE30 to U+FE4F + + // Small Form Variants + // Range: U+FE50 to U+FE6F + + // Arabic Presentation Forms-B + // Range: U+FE70 to U+FEFF + + // Halfwidth and Fullwidth Forms + // Range: U+FF00 to U+FFEF + + if ( c >= 0xFF21 && c <= 0xFF3A ) { + u[0] = c; + u[1] = c + 32; + return u; + } + + if ( c >= 0xFF41 && c <= 0xFF5A ) { + u[0] = c - 32; + u[1] = c; + return u; + } + + // Specials + // Range: U+FFF0 to U+FFFF + + return u; +} + +function DecimalToHexString( n ) { + n = Number( n ); + var h = "0x"; + + for ( var i = 3; i >= 0; i-- ) { + if ( n >= Math.pow(16, i) ){ + var t = Math.floor( n / Math.pow(16, i)); + n -= t * Math.pow(16, i); + if ( t >= 10 ) { + if ( t == 10 ) { + h += "A"; + } + if ( t == 11 ) { + h += "B"; + } + if ( t == 12 ) { + h += "C"; + } + if ( t == 13 ) { + h += "D"; + } + if ( t == 14 ) { + h += "E"; + } + if ( t == 15 ) { + h += "F"; + } + } else { + h += String( t ); + } + } else { + h += "0"; + } + } + + return h; +} diff --git a/mozilla/js/tamarin/test/ecma3/String/e15_5_4_13.as b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_13.as new file mode 100644 index 00000000000..bd6f0bf0cf6 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_13.as @@ -0,0 +1,145 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + var SECTION = "15.5.4.13"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "String.prototype.slice( start, end )"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, "String.prototype.slice.length", 2, String.prototype.slice.length ); + array[item++] = new TestCase( SECTION, "delete String.prototype.slice.length", false, delete String.prototype.slice.length ); + array[item++] = new TestCase( SECTION, "delete String.prototype.slice.length; String.prototype.slice.length", 2, (delete String.prototype.slice.length, String.prototype.slice.length) ); + + // test cases for when slice is called with no arguments. + + // this is a string object + + array[item++] = new TestCase( SECTION, + "var s = new String('this is a string object'); typeof s.slice()", + "string", + (s = new String('this is a string object'), typeof s.slice() ) ); + + array[item++] = new TestCase( SECTION, + "var s = new String(''); s.slice(1,0)", + "", + (s = new String(''), s.slice(1,0) ) ); + + array[item++] = new TestCase( SECTION, + "var s = new String('this is a string object'); s.slice(true, false)", + "t", + (s = new String('this is a string object'), s.slice(false, true) ) ); + + array[item++] = new TestCase( SECTION, + "var s = new String('this is a string object'); s.slice(NaN, Infinity)", + "this is a string object", + (s = new String('this is a string object'), s.slice(NaN, Infinity) ) ); + + + array[item++] = new TestCase( SECTION, + "var s = new String('this is a string object'); s.slice(Infinity, NaN)", + "", + (s = new String('this is a string object'), s.slice(Infinity, NaN) ) ); + + + array[item++] = new TestCase( SECTION, + "var s = new String('this is a string object'); s.slice(Infinity, Infinity)", + "", + (s = new String('this is a string object'), s.slice(Infinity, Infinity) ) ); + + array[item++] = new TestCase( SECTION, + "var s = new String('this is a string object'); s.slice(-0.01, 0)", + "", + (s = new String('this is a string object'), s.slice(-0.01,0) ) ); + + + array[item++] = new TestCase( SECTION, + "var s = new String('this is a string object'); s.slice(s.length, s.length)", + "", + (s = new String('this is a string object'), s.slice(s.length, s.length) ) ); + + array[item++] = new TestCase( SECTION, + "var s = new String('this is a string object'); s.slice(s.length+1, 0)", + "", + (s = new String('this is a string object'), s.slice(s.length+1, 0) ) ); + + array[item++] = new TestCase( SECTION, + "var s = new String('this is a string object'); s.slice(-Infinity, -Infinity)", + "", + (s = new String('this is a string object'), s.slice(-Infinity, -Infinity) ) ); + + + + + // this is an object object + array[item++] = new TestCase( SECTION, + "var obj = new Object(); obj.slice = String.prototype.slice; obj.slice(0,8)", + "[object ", + (obj = new Object(), obj.toString= Object.prototype.toString,obj.slice = String.prototype.slice, obj.slice(0,8) ) ); + + array[item++] = new TestCase( SECTION, + "var obj = new Object(); obj.slice = String.prototype.slice; obj.slice(8,obj.toString().length)", + "Object]", + (obj = new Object(), obj.slice = String.prototype.slice, obj.slice(8, obj.toString().length) ) ); + + + // this is a function object + array[item++] = new TestCase( SECTION, + "var obj = function() {}; obj.slice = Object.prototype.slice; obj.slice(8, Infinity)", + " Function() {}", + (obj = function() {}, obj.slice = String.prototype.slice,obj.slice(8,Infinity)+"" ) ); + + + + + // this is a user defined object + array[item++] = new TestCase( SECTION, + "var obj = new MyObject( void 0 ); obj.slice(0, 100)", + "undefined", + (obj = new MyObject( void 0 ), obj.slice(0,100) )); + + return array; +} +function MyObject( value ) { + this.value = value; + this.slice= String.prototype.slice; + this.substring = String.prototype.substring; + this.toString = function() { return this.value+''; } +} + diff --git a/mozilla/js/tamarin/test/ecma3/String/e15_5_4_1_rt.as b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_1_rt.as new file mode 100644 index 00000000000..a1b120c47eb --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_1_rt.as @@ -0,0 +1,62 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + //print( String( 10000000000000000000 ) ) + var SECTION = "15.5.4.1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "String.prototype.constructor"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "String.prototype.constructor == String", true, String.prototype.constructor == String ); + thisError="no error"; + STRING = new String.prototype.constructor('hi'); + try{ + STRING.getClass = Object.prototype.toString; + STRING.getClass(); + }catch(e:Error){ + thisError=e.toString(); + }finally{ + array[item++] = new TestCase( SECTION, "var STRING = new String.prototype.constructor('hi'); STRING.getClass = Object.prototype.toString; STRING.getClass()","ReferenceError: Error #1056",referenceError(thisError)); + } + + /*array[item++] = new TestCase( SECTION, "var STRING = new String.prototype.constructor('hi'); STRING.getClass = Object.prototype.toString; STRING.getClass()","[object String]",(STRING = new String.prototype.constructor('hi'), STRING.getClass = Object.prototype.toString, STRING.getClass() ) );*/ + return ( array ); +} + diff --git a/mozilla/js/tamarin/test/ecma3/String/e15_5_4_2_1.as b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_2_1.as new file mode 100644 index 00000000000..1f607fbde53 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_2_1.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.5.4.2-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "String.prototype.toString"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, "String.prototype.toString()", "", String.prototype.toString() ); + array[item++] = new TestCase( SECTION, "(new String()).toString()", "", (new String()).toString() ); + array[item++] = new TestCase( SECTION, "(new String(\"\")).toString()", "", (new String("")).toString() ); + array[item++] = new TestCase( SECTION, "(new String( String() )).toString()","", (new String(String())).toString() ); + array[item++] = new TestCase( SECTION, "(new String( \"h e l l o\" )).toString()", "h e l l o", (new String("h e l l o")).toString() ); + array[item++] = new TestCase( SECTION, "(new String( 0 )).toString()", "0", (new String(0)).toString() ); + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/String/e15_5_4_2_3.as b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_2_3.as new file mode 100644 index 00000000000..e6b8f1bc982 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_2_3.as @@ -0,0 +1,68 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + var SECTION = "15.5.4.2-3"; + var VERSION = "ECMA_4"; + startTest(); + var TITLE = "String.prototype.toString"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var tostr=String.prototype.toString; + String.prototype.toString=tostr; + var astring; + array[item++] = new TestCase( SECTION, + "var tostr=String.prototype.toString, String.prototype.toString=tostr,astring=new String(), astring.toString()", + "", + (astring=new String(), astring.toString()) ); + array[item++] = new TestCase( SECTION, + "var tostr=String.prototype.toString, String.prototype.toString=tostr,astring=new String(0),astring.toString()", + "0", + (astring=new String(0),astring.toString()) ); + array[item++] = new TestCase( SECTION, + "var tostr=String.prototype.toString, String.prototype.toString=tostr,astring=new String('hello'), astring.toString()", + "hello", + (astring=new String('hello'), astring.toString()) ); + array[item++] = new TestCase( SECTION, + "var tostr=String.prototype.toString, String.prototype.toString=tostr,astring=new String(''), astring.toString()", + "", + (astring=new String(''), astring.toString()) ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/String/e15_5_4_2_rt.as b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_2_rt.as new file mode 100644 index 00000000000..001716ad564 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_2_rt.as @@ -0,0 +1,77 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.5.4.2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "String.prototype.tostring"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + /* array[item++] = new TestCase( SECTION, "String.prototype.toString.__proto__", Function.prototype, String.prototype.toString.__proto__ );*/ + array[item++] = new TestCase( SECTION, + "String.prototype.toString() == String.prototype.valueOf()", + true, + String.prototype.toString() == String.prototype.valueOf() ); + + array[item++] = new TestCase( SECTION, "String.prototype.toString()", "", String.prototype.toString() ); + array[item++] = new TestCase( SECTION, "String.prototype.toString.length", 0, String.prototype.toString.length ); + + + array[item++] = new TestCase( SECTION, + "TESTSTRING = new String(),TESTSTRING.valueOf() == TESTSTRING.toString()", + true, + (TESTSTRING = new String(),TESTSTRING.valueOf() == TESTSTRING.toString()) ); + array[item++] = new TestCase( SECTION, + "TESTSTRING = new String(true),TESTSTRING.valueOf() == TESTSTRING.toString()", + true, + (TESTSTRING = new String(true),TESTSTRING.valueOf() == TESTSTRING.toString()) ); + array[item++] = new TestCase( SECTION, + "TESTSTRING = new String(false),TESTSTRING.valueOf() == TESTSTRING.toString()", + true, + (TESTSTRING = new String(false),TESTSTRING.valueOf() == TESTSTRING.toString()) ); + array[item++] = new TestCase( SECTION, + "TESTSTRING = new String(Math.PI),TESTSTRING.valueOf() == TESTSTRING.toString()", + true, + (TESTSTRING = new String(Math.PI),TESTSTRING.valueOf() == TESTSTRING.toString()) ); + array[item++] = new TestCase( SECTION, + "TESTSTRING = new String(),TESTSTRING.valueOf() == TESTSTRING.toString()", + true, + (TESTSTRING = new String(),TESTSTRING.valueOf() == TESTSTRING.toString()) ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/String/e15_5_4_3_1.as b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_3_1.as new file mode 100644 index 00000000000..e46057d0ad5 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_3_1.as @@ -0,0 +1,55 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.5.4.3-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "String.prototype.valueOf"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "String.prototype.valueOf.length", 0, String.prototype.valueOf.length ); + + array[item++] = new TestCase( SECTION, "String.prototype.valueOf()", "", String.prototype.valueOf() ); + array[item++] = new TestCase( SECTION, "(new String()).valueOf()", "", (new String()).valueOf() ); + array[item++] = new TestCase( SECTION, "(new String(\"\")).valueOf()", "", (new String("")).valueOf() ); + array[item++] = new TestCase( SECTION, "(new String( String() )).valueOf()","", (new String(String())).valueOf() ); + array[item++] = new TestCase( SECTION, "(new String( \"h e l l o\" )).valueOf()", "h e l l o", (new String("h e l l o")).valueOf() ); + array[item++] = new TestCase( SECTION, "(new String( 0 )).valueOf()", "0", (new String(0)).valueOf() ); + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/String/e15_5_4_3_2.as b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_3_2.as new file mode 100644 index 00000000000..5e6528c64bf --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_3_2.as @@ -0,0 +1,69 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + var SECTION = "15.5.4.3-2"; + var VERSION = "ECMA_4"; + startTest(); + var TITLE = "String.prototype.valueOf"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + valof=String.prototype.valueOf; + String.prototype.valueOf=valof; + + var astring=new String(); + array[item++] = new TestCase( SECTION, + "valof=String.prototype.valueOf,String.prototype.valueOf=valof,astring=new String(), astring.valueOf()", + "", + (astring=new String(), astring.valueOf()) ); + array[item++] = new TestCase( SECTION, + "valof=String.prototype.valueOf,String.prototype.valueOf=valof,astring=new String(0), astring.valueOf()", + "0", + (astring=new String(0), astring.valueOf()) ); + array[item++] = new TestCase( SECTION, + "valof=String.prototype.valueOf,String.prototype.valueOf=valof,astring=new String('hello'), astring.valueOf()", + "hello", + (astring=new String('hello'), astring.valueOf()) ); + array[item++] = new TestCase( SECTION, + "valof=String.prototype.valueOf,String.prototype.valueOf=valof,astring=new String(''), astring.valueOf()", + "", + (astring=new String(''), astring.valueOf()) ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/String/e15_5_4_3_3_rt.as b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_3_3_rt.as new file mode 100644 index 00000000000..226dd2098d3 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_3_3_rt.as @@ -0,0 +1,61 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + var SECTION = "15.5.4.3-3-n"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "String.prototype.valueOf"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + var valof=String.prototype.valueOf; + astring=new Number(); + + try{ + astring.valueOf = valof; + }catch(e:Error){ + thisError=e.toString(); + }finally{ + array[item++] = new TestCase( SECTION, + "var valof=String.prototype.valueOf; astring=new Number(); astring.valueOf = valof; astring.valueOf()","ReferenceError: Error #1056",referenceError(thisError) ) + } + + + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/String/e15_5_4_4_1.as b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_4_1.as new file mode 100644 index 00000000000..a46ad23a6c6 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_4_1.as @@ -0,0 +1,66 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.5.4.4-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "String.prototype.charAt"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var TEST_STRING = new String( " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~" ); + + var testcases = getTestCases(); + + writeLineToLog( "TEST_STRING = new String(\" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\")" ); + + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + for ( i = 0x0020; i < 0x007e; i++, item++) { + array[item] = new TestCase( SECTION, + "TEST_STRING.charAt("+item+")", + String.fromCharCode( i ), + TEST_STRING.charAt( item ) ); + } + for ( i = 0x0020; i < 0x007e; i++, item++) { + array[item] = new TestCase( SECTION, + "TEST_STRING.charAt("+item+") == TEST_STRING.substring( "+item +", "+ (item+1) + ")", + true, + TEST_STRING.charAt( item ) == TEST_STRING.substring( item, item+1 ) + ); + } + array[item++] = new TestCase( SECTION, "String.prototype.charAt.length", 1, String.prototype.charAt.length ); + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/String/e15_5_4_4_2.as b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_4_2.as new file mode 100644 index 00000000000..d05eedef2f8 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_4_2.as @@ -0,0 +1,110 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.5.4.4-2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "String.prototype.charAt"; + + //writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + /*array[item++] = new TestCase( SECTION, "x = new Boolean(true); x.charAt=String.prototype.charAt;x.charAt(0)", "t", (x = new Boolean(true), x.charAt=String.prototype.charAt,x.charAt(0)) ); + array[item++] = new TestCase( SECTION, "x = new Boolean(true); x.charAt=String.prototype.charAt;x.charAt(1)", "r", (x = new Boolean(true), x.charAt=String.prototype.charAt,x.charAt(1)) ); + array[item++] = new TestCase( SECTION, "x = new Boolean(true); x.charAt=String.prototype.charAt;x.charAt(2)", "u", (x = new Boolean(true), x.charAt=String.prototype.charAt,x.charAt(2)) ); + array[item++] = new TestCase( SECTION, "x = new Boolean(true); x.charAt=String.prototype.charAt;x.charAt(3)", "e", (x = new Boolean(true), x.charAt=String.prototype.charAt,x.charAt(3)) ); + array[item++] = new TestCase( SECTION, "x = new Boolean(true); x.charAt=String.prototype.charAt;x.charAt(4)", "", (x = new Boolean(true), x.charAt=String.prototype.charAt,x.charAt(4)) ); + array[item++] = new TestCase( SECTION, "x = new Boolean(true); x.charAt=String.prototype.charAt;x.charAt(-1)", "", (x = new Boolean(true), x.charAt=String.prototype.charAt,x.charAt(-1)) ); + + array[item++] = new TestCase( SECTION, "x = new Boolean(true); x.charAt=String.prototype.charAt;x.charAt(true)", "r", (x = new Boolean(true), x.charAt=String.prototype.charAt,x.charAt(true)) ); + array[item++] = new TestCase( SECTION, "x = new Boolean(true); x.charAt=String.prototype.charAt;x.charAt(false)", "t", (x = new Boolean(true), x.charAt=String.prototype.charAt,x.charAt(false)) );*/ + + array[item++] = new TestCase( SECTION, "x = new String(); x.charAt(0)", "", (x=new String(),x.charAt(0)) ); + array[item++] = new TestCase( SECTION, "x = new String(); x.charAt(1)", "", (x=new String(),x.charAt(1)) ); + array[item++] = new TestCase( SECTION, "x = new String(); x.charAt(-1)", "", (x=new String(),x.charAt(-1)) ); + + array[item++] = new TestCase( SECTION, "x = new String(); x.charAt(NaN)", "", (x=new String(),x.charAt(Number.NaN)) ); + array[item++] = new TestCase( SECTION, "x = new String(); x.charAt(Number.POSITIVE_INFINITY)", "", (x=new String(),x.charAt(Number.POSITIVE_INFINITY)) ); + array[item++] = new TestCase( SECTION, "x = new String(); x.charAt(Number.NEGATIVE_INFINITY)", "", (x=new String(),x.charAt(Number.NEGATIVE_INFINITY)) ); + + var MYOB = new MyObject(1234567890); + array[item++] = new TestCase( SECTION, "var MYOB = new MyObject(1234567890), MYOB.charAt(0)", "1", (MYOB.charAt(0) ) ); + array[item++] = new TestCase( SECTION, "var MYOB = new MyObject(1234567890), MYOB.charAt(1)", "2", (MYOB.charAt(1) ) ); + array[item++] = new TestCase( SECTION, "var MYOB = new MyObject(1234567890), MYOB.charAt(2)", "3", (MYOB.charAt(2) ) ); + array[item++] = new TestCase( SECTION, "var MYOB = new MyObject(1234567890), MYOB.charAt(3)", "4", (MYOB.charAt(3) ) ); + array[item++] = new TestCase( SECTION, "var MYOB = new MyObject(1234567890), MYOB.charAt(4)", "5", (MYOB.charAt(4) ) ); + array[item++] = new TestCase( SECTION, "var MYOB = new MyObject(1234567890), MYOB.charAt(5)", "6", (MYOB.charAt(5) ) ); + array[item++] = new TestCase( SECTION, "var MYOB = new MyObject(1234567890), MYOB.charAt(6)", "7", (MYOB.charAt(6) ) ); + array[item++] = new TestCase( SECTION, "var MYOB = new MyObject(1234567890), MYOB.charAt(7)", "8", (MYOB.charAt(7) ) ); + array[item++] = new TestCase( SECTION, "var MYOB = new MyObject(1234567890), MYOB.charAt(8)", "9", (MYOB.charAt(8) ) ); + array[item++] = new TestCase( SECTION, "var MYOB = new MyObject(1234567890), MYOB.charAt(9)", "0", (MYOB.charAt(9) ) ); + array[item++] = new TestCase( SECTION, "var MYOB = new MyObject(1234567890), MYOB.charAt(10)", "", (MYOB.charAt(10) ) ); + + array[item++] = new TestCase( SECTION, "var MYOB = new MyObject(1234567890), MYOB.charAt(Math.PI)", "4", (MYOB = new MyObject(1234567890), MYOB.charAt(Math.PI) ) ); + + // MyOtherObject.toString will return "[object Object] + + var MYOB = new MyOtherObject(1234567890); + array[item++] = new TestCase( SECTION, "var MYOB = new MyOtherObject(1234567890), MYOB.charAt(0)", "[", (MYOB.charAt(0) ) ); + array[item++] = new TestCase( SECTION, "var MYOB = new MyOtherObject(1234567890), MYOB.charAt(1)", "o", (MYOB.charAt(1) ) ); + array[item++] = new TestCase( SECTION, "var MYOB = new MyOtherObject(1234567890), MYOB.charAt(2)", "b", (MYOB.charAt(2) ) ); + array[item++] = new TestCase( SECTION, "var MYOB = new MyOtherObject(1234567890), MYOB.charAt(3)", "j", (MYOB.charAt(3) ) ); + array[item++] = new TestCase( SECTION, "var MYOB = new MyOtherObject(1234567890), MYOB.charAt(4)", "e", (MYOB.charAt(4) ) ); + array[item++] = new TestCase( SECTION, "var MYOB = new MyOtherObject(1234567890), MYOB.charAt(5)", "c", (MYOB.charAt(5) ) ); + array[item++] = new TestCase( SECTION, "var MYOB = new MyOtherObject(1234567890), MYOB.charAt(6)", "t", (MYOB.charAt(6) ) ); + array[item++] = new TestCase( SECTION, "var MYOB = new MyOtherObject(1234567890), MYOB.charAt(7)", " ", (MYOB.charAt(7) ) ); + array[item++] = new TestCase( SECTION, "var MYOB = new MyOtherObject(1234567890), MYOB.charAt(8)", "O", (MYOB.charAt(8) ) ); + array[item++] = new TestCase( SECTION, "var MYOB = new MyOtherObject(1234567890), MYOB.charAt(9)", "b", (MYOB.charAt(9) ) ); + array[item++] = new TestCase( SECTION, "var MYOB = new MyOtherObject(1234567890), MYOB.charAt(10)", "j", (MYOB.charAt(10) ) ); + array[item++] = new TestCase( SECTION, "var MYOB = new MyOtherObject(1234567890), MYOB.charAt(11)", "e", (MYOB.charAt(11) ) ); + array[item++] = new TestCase( SECTION, "var MYOB = new MyOtherObject(1234567890), MYOB.charAt(12)", "c", (MYOB.charAt(12) ) ); + array[item++] = new TestCase( SECTION, "var MYOB = new MyOtherObject(1234567890), MYOB.charAt(13)", "t", (MYOB.charAt(13) ) ); + array[item++] = new TestCase( SECTION, "var MYOB = new MyOtherObject(1234567890), MYOB.charAt(14)", "]", (MYOB.charAt(14) ) ); + + return (array ); +} + +function MyObject( value ) { + this.value = value; + this.valueOf = function() { return this.value; } + this.toString = function() { return this.value +'' } + this.charAt = String.prototype.charAt; +} +function MyOtherObject(value) { + this.value = value; + this.valueOf = function() { return this.value; } + this.charAt = String.prototype.charAt; +} diff --git a/mozilla/js/tamarin/test/ecma3/String/e15_5_4_4_3.as b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_4_3.as new file mode 100644 index 00000000000..39e8366b074 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_4_3.as @@ -0,0 +1,80 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.5.4.4-3"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "String.prototype.charAt"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function MyObject (v) { + this.value = v; + this.toString = function() { return this.value +''; } + this.valueOf = function() { return this.value } + this.charAt = String.prototype.charAt; +} +function getTestCases() { + var array = new Array(); + var item = 0; + + var foo = new MyObject('hello'); + + + array[item++] = new TestCase( SECTION, "var foo = new MyObject('hello'); ", "h", foo.charAt(0) ); + array[item++] = new TestCase( SECTION, "var foo = new MyObject('hello'); ", "e", foo.charAt(1) ); + array[item++] = new TestCase( SECTION, "var foo = new MyObject('hello'); ", "l", foo.charAt(2) ); + array[item++] = new TestCase( SECTION, "var foo = new MyObject('hello'); ", "l", foo.charAt(3) ); + array[item++] = new TestCase( SECTION, "var foo = new MyObject('hello'); ", "o", foo.charAt(4) ); + array[item++] = new TestCase( SECTION, "var foo = new MyObject('hello'); ", "", foo.charAt(-1) ); + array[item++] = new TestCase( SECTION, "var foo = new MyObject('hello'); ", "", foo.charAt(5) ); + + var boo = new MyObject(true); + + array[item++] = new TestCase( SECTION, "var boo = new MyObject(true); ", "t", boo.charAt(0) ); + array[item++] = new TestCase( SECTION, "var boo = new MyObject(true); ", "r", boo.charAt(1) ); + array[item++] = new TestCase( SECTION, "var boo = new MyObject(true); ", "u", boo.charAt(2) ); + array[item++] = new TestCase( SECTION, "var boo = new MyObject(true); ", "e", boo.charAt(3) ); + + var noo = new MyObject( Math.PI ); + + array[item++] = new TestCase( SECTION, "var noo = new MyObject(Math.PI); ", "3", noo.charAt(0) ); + array[item++] = new TestCase( SECTION, "var noo = new MyObject(Math.PI); ", ".", noo.charAt(1) ); + array[item++] = new TestCase( SECTION, "var noo = new MyObject(Math.PI); ", "1", noo.charAt(2) ); + array[item++] = new TestCase( SECTION, "var noo = new MyObject(Math.PI); ", "4", noo.charAt(3) ); + array[item++] = new TestCase( SECTION, "var noo = new MyObject(Math.PI); ", "1", noo.charAt(4) ); + array[item++] = new TestCase( SECTION, "var noo = new MyObject(Math.PI); ", "5", noo.charAt(5) ); + array[item++] = new TestCase( SECTION, "var noo = new MyObject(Math.PI); ", "9", noo.charAt(6) ); + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/String/e15_5_4_4_4_rt.as b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_4_4_rt.as new file mode 100644 index 00000000000..68f42ee44f5 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_4_4_rt.as @@ -0,0 +1,525 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.5.4.4-4"; + var VERSION = "ECMA_2"; + startTest(); + var TITLE = "String.prototype.charAt"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var thisError="no error"; + var x = null; + try{ + + x.__proto.charAt = String.prototype.charAt; + x.charAt(0); + }catch(eP1:Error){ + thisError=eP1.toString(); + }finally{ + array[item++] = new TestCase( SECTION,"x.__proto.charAt = String.prototype.charAt; x.charAt(0)","TypeError: Error #1009", typeError(thisError)); + } + + thisError="no error"; + x = null; + + try{ + + x.__proto.charAt = String.prototype.charAt; + x.charAt(1); + }catch(eP2:Error){ + thisError=eP2.toString(); + }finally{ + array[item++] = new TestCase( SECTION,"x.__proto.charAt = String.prototype.charAt; x.charAt(1)","TypeError: Error #1009", typeError(thisError)); + } + + thisError="no error"; + x = null; + try{ + + x.__proto.charAt = String.prototype.charAt; + x.charAt(2); + }catch(eP3:Error){ + thisError=eP3.toString(); + }finally{ + array[item++] = new TestCase( SECTION,"x.__proto.charAt = String.prototype.charAt; x.charAt(2)","TypeError: Error #1009", typeError(thisError)); + } + thisError="no error"; + x = null; + try{ + + x.__proto.charAt = String.prototype.charAt; + x.charAt(3); + }catch(eP4:Error){ + thisError=eP4.toString(); + }finally{ + array[item++] = new TestCase( SECTION,"x.__proto.charAt = String.prototype.charAt; x.charAt(3)","TypeError: Error #1009", typeError(thisError)); + } + /*array[item++] = new TestCase( SECTION, "x = null; x.__proto.charAt = String.prototype.charAt; x.charAt(0)", "n", (x=null; x.__proto__.charAt = String.prototype.charAt, x.charAt(0)) ); + array[item++] = new TestCase( SECTION, "x = null; x.__proto.charAt = String.prototype.charAt; x.charAt(1)", "u", (x=null; x.__proto__.charAt = String.prototype.charAt, x.charAt(1)) ); + array[item++] = new TestCase( SECTION, "x = null; x.__proto.charAt = String.prototype.charAt; x.charAt(2)", "l", (x=null; x.__proto__.charAt = String.prototype.charAt, x.charAt(2)) ); + array[item++] = new TestCase( SECTION, "x = null; x.__proto.charAt = String.prototype.charAt; x.charAt(3)", "l", (x=null; x.__proto__.charAt = String.prototype.charAt, x.charAt(3)) );*/ + + thisError="no error"; + x = undefined; + try{ + + x.__proto.charAt = String.prototype.charAt; + x.charAt(0); + }catch(eP5:Error){ + thisError=eP5.toString(); + }finally{ + array[item++] = new TestCase( SECTION,"x.__proto.charAt = String.prototype.charAt; x.charAt(0)","TypeError: Error #1010", typeError(thisError)); + } + + thisError="no error"; + x = undefined; + try{ + + x.__proto.charAt = String.prototype.charAt; + x.charAt(1); + }catch(eP6:Error){ + thisError=eP6.toString(); + }finally{ + array[item++] = new TestCase( SECTION,"x.__proto.charAt = String.prototype.charAt; x.charAt(1)","TypeError: Error #1010", typeError(thisError)); + } + + thisError="no error"; + x = undefined; + try{ + + x.__proto.charAt = String.prototype.charAt; + x.charAt(2); + }catch(eP7:Error){ + thisError=eP7.toString(); + }finally{ + array[item++] = new TestCase( SECTION,"x.__proto.charAt = String.prototype.charAt; x.charAt(2)","TypeError: Error #1010", typeError(thisError)); + } + + thisError="no error"; + x = undefined; + try{ + + x.__proto.charAt = String.prototype.charAt; + x.charAt(3); + }catch(eP8:Error){ + thisError=eP8.toString(); + }finally{ + array[item++] = new TestCase( SECTION,"x.__proto.charAt = String.prototype.charAt; x.charAt(3)","TypeError: Error #1010", typeError(thisError)); + } + + /*array[item++] = new TestCase( SECTION, "x = undefined; x.__proto.charAt = String.prototype.charAt; x.charAt(0)", "u", (x=undefined; x.__proto__.charAt = String.prototype.charAt, x.charAt(0)) ); + array[item++] = new TestCase( SECTION, "x = undefined; x.__proto.charAt = String.prototype.charAt; x.charAt(1)", "n", (x=undefined; x.__proto__.charAt = String.prototype.charAt, x.charAt(1)) ); + array[item++] = new TestCase( SECTION, "x = undefined; x.__proto.charAt = String.prototype.charAt; x.charAt(2)", "d", (x=undefined; x.__proto__.charAt = String.prototype.charAt, x.charAt(2)) ); + array[item++] = new TestCase( SECTION, "x = undefined; x.__proto.charAt = String.prototype.charAt; x.charAt(3)", "e", (x=undefined; x.__proto__.charAt = String.prototype.charAt, x.charAt(3)) );*/ + + thisError="no error"; + x = false; + try{ + + x.__proto.charAt = String.prototype.charAt; + x.charAt(0); + }catch(eP9:Error){ + thisError=eP9.toString(); + }finally{ + array[item++] = new TestCase( SECTION,"x.__proto.charAt = String.prototype.charAt; x.charAt(0)","ReferenceError: Error #1069", referenceError(thisError)); + } + + thisError="no error"; + x = false; + try{ + + x.__proto.charAt = String.prototype.charAt; + x.charAt(1); + }catch(eP10:Error){ + thisError=eP10.toString(); + }finally{ + array[item++] = new TestCase( SECTION,"x.__proto.charAt = String.prototype.charAt; x.charAt(1)","ReferenceError: Error #1069", referenceError(thisError)); + } + + thisError="no error"; + x = false; + try{ + + x.__proto.charAt = String.prototype.charAt; + x.charAt(2); + }catch(eP11:Error){ + thisError=eP11.toString(); + }finally{ + array[item++] = new TestCase( SECTION,"x.__proto.charAt = String.prototype.charAt; x.charAt(2)","ReferenceError: Error #1069", referenceError(thisError)); + } + + thisError="no error"; + x = false; + try{ + + x.__proto.charAt = String.prototype.charAt; + x.charAt(3); + }catch(eP12:Error){ + thisError=eP12.toString(); + }finally{ + array[item++] = new TestCase( SECTION,"x.__proto.charAt = String.prototype.charAt; x.charAt(3)","ReferenceError: Error #1069", referenceError(thisError)); + } + + thisError="no error"; + x = false; + try{ + + x.__proto.charAt = String.prototype.charAt; + x.charAt(4); + }catch(eP13:Error){ + thisError=eP13.toString(); + }finally{ + array[item++] = new TestCase( SECTION,"x.__proto.charAt = String.prototype.charAt; x.charAt(4)","ReferenceError: Error #1069", referenceError(thisError)); + } + + + + /*array[item++] = new TestCase( SECTION, "x = false; x.__proto.charAt = String.prototype.charAt; x.charAt(0)", "f", (x=false, x.__proto__.charAt = String.prototype.charAt, x.charAt(0)) ); + array[item++] = new TestCase( SECTION, "x = false; x.__proto.charAt = String.prototype.charAt; x.charAt(1)", "a", (x=false, x.__proto__.charAt = String.prototype.charAt, x.charAt(1)) ); + array[item++] = new TestCase( SECTION, "x = false; x.__proto.charAt = String.prototype.charAt; x.charAt(2)", "l", (x=false, x.__proto__.charAt = String.prototype.charAt, x.charAt(2)) ); + array[item++] = new TestCase( SECTION, "x = false; x.__proto.charAt = String.prototype.charAt; x.charAt(3)", "s", (x=false, x.__proto__.charAt = String.prototype.charAt, x.charAt(3)) ); + array[item++] = new TestCase( SECTION, "x = false; x.__proto.charAt = String.prototype.charAt; x.charAt(4)", "e", (x=false, x.__proto__.charAt = String.prototype.charAt, x.charAt(4)) );*/ + + thisError="no error"; + x = true; + try{ + + x.__proto.charAt = String.prototype.charAt; + x.charAt(0); + }catch(eP14:ReferenceError){ + thisError=eP14.toString(); + }finally{ + array[item++] = new TestCase( SECTION,"x.__proto.charAt = String.prototype.charAt; x.charAt(0)","ReferenceError: Error #1069", referenceError(thisError)); + } + + thisError="no error"; + x = true; + try{ + + x.__proto.charAt = String.prototype.charAt; + x.charAt(1); + }catch(eP15:Error){ + thisError=eP15.toString(); + }finally{ + array[item++] = new TestCase( SECTION,"x.__proto.charAt = String.prototype.charAt; x.charAt(1)","ReferenceError: Error #1069", referenceError(thisError)); + } + + thisError="no error"; + x = true; + try{ + + x.__proto.charAt = String.prototype.charAt; + x.charAt(2); + }catch(eP16:Error){ + thisError=eP16.toString(); + }finally{ + array[item++] = new TestCase( SECTION,"x.__proto.charAt = String.prototype.charAt; x.charAt(2)","ReferenceError: Error #1069", referenceError(thisError)); + } + + thisError="no error"; + x = true; + try{ + + x.__proto.charAt = String.prototype.charAt; + x.charAt(3); + }catch(eP17:Error){ + thisError=eP17.toString(); + }finally{ + array[item++] = new TestCase( SECTION,"x.__proto.charAt = String.prototype.charAt; x.charAt(3)","ReferenceError: Error #1069", referenceError(thisError)); + } + + thisError="no error"; + x = true; + try{ + + x.__proto.charAt = String.prototype.charAt; + x.charAt(4); + }catch(eP18:Error){ + thisError=eP18.toString(); + }finally{ + array[item++] = new TestCase( SECTION,"x.__proto.charAt = String.prototype.charAt; x.charAt(4)","ReferenceError: Error #1069", referenceError(thisError)); + } + + /* array[item++] = new TestCase( SECTION, "x = true; x.__proto.charAt = String.prototype.charAt; x.charAt(0)", "t", (x=true, x.__proto__.charAt = String.prototype.charAt, x.charAt(0)) ); + array[item++] = new TestCase( SECTION, "x = true; x.__proto.charAt = String.prototype.charAt; x.charAt(1)", "r", (x=true, x.__proto__.charAt = String.prototype.charAt, x.charAt(1)) ); + array[item++] = new TestCase( SECTION, "x = true; x.__proto.charAt = String.prototype.charAt; x.charAt(2)", "u", (x=true, x.__proto__.charAt = String.prototype.charAt, x.charAt(2)) ); + array[item++] = new TestCase( SECTION, "x = true; x.__proto.charAt = String.prototype.charAt; x.charAt(3)", "e", (x=true, x.__proto__.charAt = String.prototype.charAt, x.charAt(3)) );*/ + + thisError="no error"; + x = NaN; + try{ + + x.__proto.charAt = String.prototype.charAt; + x.charAt(0); + }catch(eP19:Error){ + thisError=eP19.toString(); + }finally{ + array[item++] = new TestCase( SECTION,"x.__proto.charAt = String.prototype.charAt; x.charAt(0)","ReferenceError: Error #1069", referenceError(thisError)); + } + + thisError="no error"; + x = NaN; + try{ + + x.__proto.charAt = String.prototype.charAt; + x.charAt(1); + }catch(eP20:Error){ + thisError=eP20.toString(); + }finally{ + array[item++] = new TestCase( SECTION,"x.__proto.charAt = String.prototype.charAt; x.charAt(1)","ReferenceError: Error #1069", referenceError(thisError)); + } + + thisError="no error"; + x = NaN; + try{ + + x.__proto.charAt = String.prototype.charAt; + x.charAt(2); + }catch(eP21:Error){ + thisError=eP21.toString(); + }finally{ + array[item++] = new TestCase( SECTION,"x.__proto.charAt = String.prototype.charAt; x.charAt(2)","ReferenceError: Error #1069", referenceError(thisError)); + } + + thisError="no error"; + x = NaN; + try{ + + x.__proto.charAt = String.prototype.charAt; + x.charAt(3); + }catch(eP22:Error){ + thisError=eP22.toString(); + }finally{ + array[item++] = new TestCase( SECTION,"x.__proto.charAt = String.prototype.charAt; x.charAt(3)","ReferenceError: Error #1069", referenceError(thisError)); + } + + thisError="no error"; + x = NaN; + try{ + + x.__proto.charAt = String.prototype.charAt; + x.charAt(4); + }catch(eP23:Error){ + thisError=eP23.toString(); + }finally{ + array[item++] = new TestCase( SECTION,"x.__proto.charAt = String.prototype.charAt; x.charAt(4)","ReferenceError: Error #1069", referenceError(thisError)); + } + + /* array[item++] = new TestCase( SECTION, "x = NaN; x.__proto.charAt = String.prototype.charAt; x.charAt(0)", "N", (x=NaN, x.__proto__.charAt = String.prototype.charAt, x.charAt(0)) ); + array[item++] = new TestCase( SECTION, "x = NaN; x.__proto.charAt = String.prototype.charAt; x.charAt(1)", "a", (x=NaN, x.__proto__.charAt = String.prototype.charAt, x.charAt(1)) ); + array[item++] = new TestCase( SECTION, "x = NaN; x.__proto.charAt = String.prototype.charAt; x.charAt(2)", "N", (x=NaN, x.__proto__.charAt = String.prototype.charAt, x.charAt(2)) );*/ + + thisError="no error"; + x = 123; + try{ + + x.__proto.charAt = String.prototype.charAt; + x.charAt(0); + }catch(eP24:Error){ + thisError=eP24.toString(); + }finally{ + array[item++] = new TestCase( SECTION,"x.__proto.charAt = String.prototype.charAt; x.charAt(0)","ReferenceError: Error #1069", referenceError(thisError)); + } + + thisError="no error"; + x = 123; + try{ + + x.__proto.charAt = String.prototype.charAt; + x.charAt(1); + }catch(eP25:Error){ + thisError=eP25.toString(); + }finally{ + array[item++] = new TestCase( SECTION,"x.__proto.charAt = String.prototype.charAt; x.charAt(1)","ReferenceError: Error #1069", referenceError(thisError)); + } + + thisError="no error"; + x = 123; + try{ + + x.__proto.charAt = String.prototype.charAt; + x.charAt(2); + }catch(eP26:Error){ + thisError=eP26.toString(); + }finally{ + array[item++] = new TestCase( SECTION,"x.__proto.charAt = String.prototype.charAt; x.charAt(2)","ReferenceError: Error #1069", referenceError(thisError)); + } + + thisError="no error"; + x = 123; + try{ + + x.__proto.charAt = String.prototype.charAt; + x.charAt(3); + }catch(eP27:Error){ + thisError=eP27.toString(); + }finally{ + array[item++] = new TestCase( SECTION,"x.__proto.charAt = String.prototype.charAt; x.charAt(3)","ReferenceError: Error #1069", referenceError(thisError)); + } + + thisError="no error"; + x = 123; + try{ + + x.__proto.charAt = String.prototype.charAt; + x.charAt(4); + }catch(eP28:Error){ + thisError=eP28.toString(); + }finally{ + array[item++] = new TestCase( SECTION,"x.__proto.charAt = String.prototype.charAt; x.charAt(4)","ReferenceError: Error #1069", referenceError(thisError)); + } + + /* array[item++] = new TestCase( SECTION, "x = 123; x.__proto.charAt = String.prototype.charAt; x.charAt(0)", "1", (x=123, x.__proto__.charAt = String.prototype.charAt, x.charAt(0)) ); + array[item++] = new TestCase( SECTION, "x = 123; x.__proto.charAt = String.prototype.charAt; x.charAt(1)", "2", (x=123, x.__proto__.charAt = String.prototype.charAt, x.charAt(1)) ); + array[item++] = new TestCase( SECTION, "x = 123; x.__proto.charAt = String.prototype.charAt; x.charAt(2)", "3", (x=123, x.__proto__.charAt = String.prototype.charAt, x.charAt(2)) ); +*/ + + array[item++] = new TestCase( SECTION, "x = new Array(1,2,3); x.charAt = String.prototype.charAt; x.charAt(0)", "1", (x=new Array(1,2,3), x.charAt = String.prototype.charAt, x.charAt(0)) ); + array[item++] = new TestCase( SECTION, "x = new Array(1,2,3); x.charAt = String.prototype.charAt; x.charAt(1)", ",", (x=new Array(1,2,3), x.charAt = String.prototype.charAt, x.charAt(1)) ); + array[item++] = new TestCase( SECTION, "x = new Array(1,2,3); x.charAt = String.prototype.charAt; x.charAt(2)", "2", (x=new Array(1,2,3), x.charAt = String.prototype.charAt, x.charAt(2)) ); + array[item++] = new TestCase( SECTION, "x = new Array(1,2,3); x.charAt = String.prototype.charAt; x.charAt(3)", ",", (x=new Array(1,2,3), x.charAt = String.prototype.charAt, x.charAt(3)) ); + array[item++] = new TestCase( SECTION, "x = new Array(1,2,3); x.charAt = String.prototype.charAt; x.charAt(4)", "3", (x=new Array(1,2,3), x.charAt = String.prototype.charAt, x.charAt(4)) ); + + array[item++] = new TestCase( SECTION, "x = new Array(); x.charAt = String.prototype.charAt; x.charAt(0)", "", (x = new Array(), x.charAt = String.prototype.charAt, x.charAt(0)) ); + + thisError="no error"; + x = new Number(123); + try{ + + x.charAt = String.prototype.charAt; + x.charAt(0); + }catch(eN1:Error){ + thisError=eN1.toString(); + }finally{ + array[item++] = new TestCase( SECTION,"x = new Number(123); x.charAt = String.prototype.charAt; x.charAt(0)","ReferenceError: Error #1056", referenceError(thisError)); + } + + thisError="no error"; + x = new Number(123); + try{ + + x.charAt = String.prototype.charAt; + x.charAt(1); + }catch(eN2:Error){ + thisError=eN2.toString(); + }finally{ + array[item++] = new TestCase( SECTION,"x = new Number(123); x.charAt = String.prototype.charAt; x.charAt(1)","ReferenceError: Error #1056", referenceError(thisError)); + } + + thisError="no error"; + x = new Number(123); + try{ + + x.charAt = String.prototype.charAt; + x.charAt(2); + }catch(eN3:Error){ + thisError=eN3.toString(); + }finally{ + array[item++] = new TestCase( SECTION,"x = new Number(123); x.charAt = String.prototype.charAt; x.charAt(2)","ReferenceError: Error #1056", referenceError(thisError)); + } + + /*array[item++] = new TestCase( SECTION, "x = new Number(123); x.charAt = String.prototype.charAt; x.charAt(0)", "1", (x=new Number(123), x.charAt = String.prototype.charAt, x.charAt(0)) ); + array[item++] = new TestCase( SECTION, "x = new Number(123); x.charAt = String.prototype.charAt; x.charAt(1)", "2", (x=new Number(123), x.charAt = String.prototype.charAt, x.charAt(1)) ); + array[item++] = new TestCase( SECTION, "x = new Number(123); x.charAt = String.prototype.charAt; x.charAt(2)", "3", (x=new Number(123), x.charAt = String.prototype.charAt, x.charAt(2)) );*/ + + array[item++] = new TestCase( SECTION, "x = new Object(); x.charAt = String.prototype.charAt; x.charAt(0)", "[", (x=new Object(), x.charAt = String.prototype.charAt, x.charAt(0)) ); + array[item++] = new TestCase( SECTION, "x = new Object(); x.charAt = String.prototype.charAt; x.charAt(1)", "o", (x=new Object(), x.charAt = String.prototype.charAt, x.charAt(1)) ); + array[item++] = new TestCase( SECTION, "x = new Object(); x.charAt = String.prototype.charAt; x.charAt(2)", "b", (x=new Object(), x.charAt = String.prototype.charAt, x.charAt(2)) ); + array[item++] = new TestCase( SECTION, "x = new Object(); x.charAt = String.prototype.charAt; x.charAt(3)", "j", (x=new Object(), x.charAt = String.prototype.charAt, x.charAt(3)) ); + array[item++] = new TestCase( SECTION, "x = new Object(); x.charAt = String.prototype.charAt; x.charAt(4)", "e", (x=new Object(), x.charAt = String.prototype.charAt, x.charAt(4)) ); + array[item++] = new TestCase( SECTION, "x = new Object(); x.charAt = String.prototype.charAt; x.charAt(5)", "c", (x=new Object(), x.charAt = String.prototype.charAt, x.charAt(5)) ); + array[item++] = new TestCase( SECTION, "x = new Object(); x.charAt = String.prototype.charAt; x.charAt(6)", "t", (x=new Object(), x.charAt = String.prototype.charAt, x.charAt(6)) ); + array[item++] = new TestCase( SECTION, "x = new Object(); x.charAt = String.prototype.charAt; x.charAt(7)", " ", (x=new Object(), x.charAt = String.prototype.charAt, x.charAt(7)) ); + array[item++] = new TestCase( SECTION, "x = new Object(); x.charAt = String.prototype.charAt; x.charAt(8)", "O", (x=new Object(), x.charAt = String.prototype.charAt, x.charAt(8)) ); + array[item++] = new TestCase( SECTION, "x = new Object(); x.charAt = String.prototype.charAt; x.charAt(9)", "b", (x=new Object(), x.charAt = String.prototype.charAt, x.charAt(9)) ); + array[item++] = new TestCase( SECTION, "x = new Object(); x.charAt = String.prototype.charAt; x.charAt(10)", "j", (x=new Object(), x.charAt = String.prototype.charAt, x.charAt(10)) ); + array[item++] = new TestCase( SECTION, "x = new Object(); x.charAt = String.prototype.charAt; x.charAt(11)", "e", (x=new Object(), x.charAt = String.prototype.charAt, x.charAt(11)) ); + array[item++] = new TestCase( SECTION, "x = new Object(); x.charAt = String.prototype.charAt; x.charAt(12)", "c", (x=new Object(), x.charAt = String.prototype.charAt, x.charAt(12)) ); + array[item++] = new TestCase( SECTION, "x = new Object(); x.charAt = String.prototype.charAt; x.charAt(13)", "t", (x=new Object(), x.charAt = String.prototype.charAt, x.charAt(13)) ); + array[item++] = new TestCase( SECTION, "x = new Object(); x.charAt = String.prototype.charAt; x.charAt(14)", "]", (x=new Object(), x.charAt = String.prototype.charAt, x.charAt(14)) ); + +/* Commenting out due to deferred bug 175096 - could put functionallity to differentiate btwn debug and release player.... + + array[item++] = new TestCase( SECTION, "x = function() {}; x.toString = Object.prototype.toString; x.charAt = String.prototype.charAt; x.charAt(0)", "[", (x=function() {}, x.toString = Object.prototype.toString, x.charAt = String.prototype.charAt, x.charAt(0)) ); + + array[item++] = new TestCase( SECTION, "x = function() {}; x.toString = Object.prototype.toString; x.charAt = String.prototype.charAt; x.charAt(1)", "o", (x=function() {}, x.toString = Object.prototype.toString, x.charAt = String.prototype.charAt, x.charAt(1)) ); + array[item++] = new TestCase( SECTION, "x = function() {}; x.toString = Object.prototype.toString; x.charAt = String.prototype.charAt; x.charAt(2)", "b", (x=function() {}, x.toString = Object.prototype.toString, x.charAt = String.prototype.charAt, x.charAt(2)) ); + + array[item++] = new TestCase( SECTION, "x = function() {}; x.toString = Object.prototype.toString; x.charAt = String.prototype.charAt; x.charAt(3)", "j", (x=function() {}, x.toString = Object.prototype.toString, x.charAt = String.prototype.charAt, x.charAt(3)) ); + array[item++] = new TestCase( SECTION, "x = function() {}; x.toString = Object.prototype.toString; x.charAt = String.prototype.charAt; x.charAt(4)", "e", (x=function() {}, x.toString = Object.prototype.toString, x.charAt = String.prototype.charAt, x.charAt(4)) ); + + array[item++] = new TestCase( SECTION, "x = function() {}; x.toString = Object.prototype.toString; x.charAt = String.prototype.charAt; x.charAt(5)", "c", (x=function() {}, x.toString = Object.prototype.toString, x.charAt = String.prototype.charAt, x.charAt(5)) ); + + array[item++] = new TestCase( SECTION, "x = function() {}; x.toString = Object.prototype.toString; x.charAt = String.prototype.charAt; x.charAt(6)", "t", (x=function() {}, x.toString = Object.prototype.toString, x.charAt = String.prototype.charAt, x.charAt(6)) ); + + array[item++] = new TestCase( SECTION, "x = function() {}; x.toString = Object.prototype.toString; x.charAt = String.prototype.charAt; x.charAt(7)", " ", (x=function() {}, x.toString = Object.prototype.toString, x.charAt = String.prototype.charAt, x.charAt(7)) ); + + + array[item++] = new TestCase( SECTION, "x = function() {}; x.toString = Object.prototype.toString; x.charAt = String.prototype.charAt; x.charAt(8)", "F", (x=function() {}, x.toString = Object.prototype.toString, x.charAt = String.prototype.charAt, x.charAt(8)) ); + + array[item++] = new TestCase( SECTION, "x = function() {}; x.toString = Object.prototype.toString; x.charAt = String.prototype.charAt; x.charAt(9)", "u", (x=function() {}, x.toString = Object.prototype.toString, x.charAt = String.prototype.charAt, x.charAt(9)) ); + + array[item++] = new TestCase( SECTION, "x = function() {}; x.toString = Object.prototype.toString; x.charAt = String.prototype.charAt; x.charAt(10)", "n", (x=function() {}, x.toString = Object.prototype.toString, x.charAt = String.prototype.charAt, x.charAt(10)) ); + + array[item++] = new TestCase( SECTION, "x = function() {}; x.toString = Object.prototype.toString; x.charAt = String.prototype.charAt; x.charAt(11)", "c", (x=function() {}, x.toString = Object.prototype.toString, x.charAt = String.prototype.charAt, x.charAt(11)) ); + + array[item++] = new TestCase( SECTION, "x = function() {}; x.toString = Object.prototype.toString; x.charAt = String.prototype.charAt; x.charAt(12)", "t", (x=function() {}, x.toString = Object.prototype.toString, x.charAt = String.prototype.charAt, x.charAt(12)) ); + + array[item++] = new TestCase( SECTION, "x = function() {}; x.toString = Object.prototype.toString; x.charAt = String.prototype.charAt; x.charAt(13)", "i", (x=function() {}, x.toString = Object.prototype.toString, x.charAt = String.prototype.charAt, x.charAt(13)) ); + + array[item++] = new TestCase( SECTION, "x = function() {}; x.toString = Object.prototype.toString; x.charAt = String.prototype.charAt; x.charAt(14)", "o", (x=function() {}, x.toString = Object.prototype.toString, x.charAt = String.prototype.charAt, x.charAt(14)) ); + + array[item++] = new TestCase( SECTION, "x = function() {}; x.toString = Object.prototype.toString; x.charAt = String.prototype.charAt; x.charAt(15)", "n", (x=function() {}, x.toString = Object.prototype.toString, x.charAt = String.prototype.charAt, x.charAt(15)) ); + + array[item++] = new TestCase( SECTION, "x = function() {}; x.toString = Object.prototype.toString; x.charAt = String.prototype.charAt; x.charAt(16)", "-", (x=function() {}, x.toString = Object.prototype.toString, x.charAt = String.prototype.charAt, x.charAt(16)) ); + + array[item++] = new TestCase( SECTION, "x = function() {}; x.toString = Object.prototype.toString; x.charAt = String.prototype.charAt; x.charAt(17)", "1", (x=function() {}, x.toString = Object.prototype.toString, x.charAt = String.prototype.charAt, x.charAt(17)) ); + + array[item++] = new TestCase( SECTION, "x = function() {}; x.toString = Object.prototype.toString; x.charAt = String.prototype.charAt; x.charAt(18)", "8", (x=function() {}, x.toString = Object.prototype.toString, x.charAt = String.prototype.charAt, x.charAt(18)) ); + + array[item++] = new TestCase( SECTION, "x = function() {}; x.toString = Object.prototype.toString; x.charAt = String.prototype.charAt; x.charAt(19)", "]", (x=function() {}, x.toString = Object.prototype.toString, x.charAt = String.prototype.charAt, x.charAt(19)) ); + + + array[item++] = new TestCase( SECTION, "x = function() {}; x.toString = Object.prototype.toString; x.charAt = String.prototype.charAt; x.charAt(22)","", (x=function() {}, x.charAt = String.prototype.charAt, x.charAt(22)) ); + + array[item++] = new TestCase( SECTION, "x = function() {}; x.toString = Object.prototype.toString; x.charAt = String.prototype.charAt; x.charAt(-1)","", (x=function() {}, x.charAt = String.prototype.charAt, x.charAt(-1)) ); +*/ + return array; + +} + diff --git a/mozilla/js/tamarin/test/ecma3/String/e15_5_4_5_1.as b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_5_1.as new file mode 100644 index 00000000000..cea6f2269f9 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_5_1.as @@ -0,0 +1,54 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.5.4.5-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "String.prototype.charCodeAt"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var TEST_STRING = new String( " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~" ); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + + for ( j = 0, i = 0x0020; i < 0x007e; i++, j++ ) { + array[j] = new TestCase( SECTION, "TEST_STRING.charCodeAt("+j+")", i, TEST_STRING.charCodeAt( j ) ); + } + + item = array.length; + + array[item++] = new TestCase( SECTION, 'TEST_STRING.charCodeAt('+i+')', NaN, TEST_STRING.charCodeAt( i ) ); + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/String/e15_5_4_5_2.as b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_5_2.as new file mode 100644 index 00000000000..7a7d835e3f8 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_5_2.as @@ -0,0 +1,122 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.5.4.5-2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "String.prototype.charCodeAt"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var TEST_STRING = new String( " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~" ); + + var testcases = getTestCases(); + + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + + var x; + + var origBooleanCharCodeAt = Boolean.prototype.charCodeAt; + Boolean.prototype.charCodeAt=String.prototype.charCodeAt; + + array[item++] = new TestCase( SECTION, + "x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(0)", + 0x0074, + (x = new Boolean(true), x.charCodeAt(0)) ); + array[item++] = new TestCase( SECTION, + "x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(1)", + 0x0072, + (x = new Boolean(true), x.charCodeAt(1)) ); + array[item++] = new TestCase( SECTION, + "x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(2)", + 0x0075, + (x = new Boolean(true), x.charCodeAt(2)) ); + array[item++] = new TestCase( SECTION, + "x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(3)", + 0x0065, + (x = new Boolean(true), x.charCodeAt(3)) ); + array[item++] = new TestCase( SECTION, + "x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(4)", + Number.NaN, + (x = new Boolean(true), x.charCodeAt(4)) ); + array[item++] = new TestCase( SECTION, + "x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(-1)", + Number.NaN, + (x = new Boolean(true), x.charCodeAt(-1)) ); + + array[item++] = new TestCase( SECTION, + "x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(true)", + 0x0072, + (x = new Boolean(true), x.charCodeAt(true)) ); + array[item++] = new TestCase( SECTION, + "x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(false)", + 0x0074, + (x = new Boolean(true), x.charCodeAt(false)) ); + + array[item++] = new TestCase( SECTION, "x = new String(); x.charCodeAt(0)", Number.NaN, (x=new String(),x.charCodeAt(0)) ); + array[item++] = new TestCase( SECTION, "x = new String(); x.charCodeAt(1)", Number.NaN, (x=new String(),x.charCodeAt(1)) ); + array[item++] = new TestCase( SECTION, "x = new String(); x.charCodeAt(-1)", Number.NaN, (x=new String(),x.charCodeAt(-1)) ); + + array[item++] = new TestCase( SECTION, "x = new String(); x.charCodeAt(NaN)", Number.NaN, (x=new String(),x.charCodeAt(Number.NaN)) ); + array[item++] = new TestCase( SECTION, "x = new String(); x.charCodeAt(Number.POSITIVE_INFINITY)", Number.NaN, (x=new String(),x.charCodeAt(Number.POSITIVE_INFINITY)) ); + array[item++] = new TestCase( SECTION, "x = new String(); x.charCodeAt(Number.NEGATIVE_INFINITY)", Number.NaN, (x=new String(),x.charCodeAt(Number.NEGATIVE_INFINITY)) ); + + array[item++] = new TestCase( SECTION, "x = new Array(1,2,3); x.charCodeAt = String.prototype.charCodeAt; x.charCodeAt(0)", 0x0031, (x = new Array(1,2,3), x.charCodeAt = String.prototype.charCodeAt, x.charCodeAt(0)) ); + array[item++] = new TestCase( SECTION, "x = new Array(1,2,3); x.charCodeAt = String.prototype.charCodeAt; x.charCodeAt(1)", 0x002C, (x = new Array(1,2,3), x.charCodeAt = String.prototype.charCodeAt, x.charCodeAt(1)) ); + array[item++] = new TestCase( SECTION, "x = new Array(1,2,3); x.charCodeAt = String.prototype.charCodeAt; x.charCodeAt(2)", 0x0032, (x = new Array(1,2,3), x.charCodeAt = String.prototype.charCodeAt, x.charCodeAt(2)) ); + array[item++] = new TestCase( SECTION, "x = new Array(1,2,3); x.charCodeAt = String.prototype.charCodeAt; x.charCodeAt(3)", 0x002C, (x = new Array(1,2,3), x.charCodeAt = String.prototype.charCodeAt, x.charCodeAt(3)) ); + array[item++] = new TestCase( SECTION, "x = new Array(1,2,3); x.charCodeAt = String.prototype.charCodeAt; x.charCodeAt(4)", 0x0033, (x = new Array(1,2,3), x.charCodeAt = String.prototype.charCodeAt, x.charCodeAt(4)) ); + array[item++] = new TestCase( SECTION, "x = new Array(1,2,3); x.charCodeAt = String.prototype.charCodeAt; x.charCodeAt(5)", NaN, (x = new Array(1,2,3), x.charCodeAt = String.prototype.charCodeAt, x.charCodeAt(5)) ); + + array[item++] = new TestCase( SECTION, "x = function() { this.charCodeAt = String.prototype.charCodeAt }; f = new x(); f.charCodeAt(0)", 0x005B, (x = function() { this.charCodeAt = String.prototype.charCodeAt; }, f = new x(), f.charCodeAt(0)) ); + array[item++] = new TestCase( SECTION, "x = function() { this.charCodeAt = String.prototype.charCodeAt }; f = new x(); f.charCodeAt(1)", 0x006F, (x = function() { this.charCodeAt = String.prototype.charCodeAt; }, f = new x(), f.charCodeAt(1)) ); + array[item++] = new TestCase( SECTION, "x = function() { this.charCodeAt = String.prototype.charCodeAt }; f = new x(); f.charCodeAt(2)", 0x0062, (x = function() { this.charCodeAt = String.prototype.charCodeAt; }, f = new x(), f.charCodeAt(2)) ); + array[item++] = new TestCase( SECTION, "x = function() { this.charCodeAt = String.prototype.charCodeAt }; f = new x(); f.charCodeAt(3)", 0x006A, (x = function() { this.charCodeAt = String.prototype.charCodeAt; }, f = new x(), f.charCodeAt(3)) ); + array[item++] = new TestCase( SECTION, "x = function() { this.charCodeAt = String.prototype.charCodeAt }; f = new x(); f.charCodeAt(4)", 0x0065, (x = function() { this.charCodeAt = String.prototype.charCodeAt; }, f = new x(), f.charCodeAt(4)) ); + array[item++] = new TestCase( SECTION, "x = function() { this.charCodeAt = String.prototype.charCodeAt }; f = new x(); f.charCodeAt(5)", 0x0063, (x = function() { this.charCodeAt = String.prototype.charCodeAt; }, f = new x(), f.charCodeAt(5)) ); + array[item++] = new TestCase( SECTION, "x = function() { this.charCodeAt = String.prototype.charCodeAt }; f = new x(); f.charCodeAt(6)", 0x0074, (x = function() { this.charCodeAt = String.prototype.charCodeAt; }, f = new x(), f.charCodeAt(6)) ); + + array[item++] = new TestCase( SECTION, "x = function() { this.charCodeAt = String.prototype.charCodeAt }; f = new x(); f.charCodeAt(7)", 0x0020, (x = function() { this.charCodeAt = String.prototype.charCodeAt; }, f = new x(), f.charCodeAt(7)) ); + + array[item++] = new TestCase( SECTION, "x = function() { this.charCodeAt = String.prototype.charCodeAt }; f = new x(); f.charCodeAt(8)", 0x004F, (x = function() { this.charCodeAt = String.prototype.charCodeAt; }, f = new x(), f.charCodeAt(8)) ); + array[item++] = new TestCase( SECTION, "x = function() { this.charCodeAt = String.prototype.charCodeAt }; f = new x(); f.charCodeAt(9)", 0x0062, (x = function() { this.charCodeAt = String.prototype.charCodeAt; }, f = new x(), f.charCodeAt(9)) ); + array[item++] = new TestCase( SECTION, "x = function() { this.charCodeAt = String.prototype.charCodeAt }; f = new x(); f.charCodeAt(10)", 0x006A, (x = function() { this.charCodeAt = String.prototype.charCodeAt; }, f = new x(), f.charCodeAt(10)) ); + + //restore + Boolean.prototype.charCodeAt = origBooleanCharCodeAt; + + return (array ); +} + diff --git a/mozilla/js/tamarin/test/ecma3/String/e15_5_4_5_3.as b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_5_3.as new file mode 100644 index 00000000000..ac381c5bac6 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_5_3.as @@ -0,0 +1,98 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.5.4.5-3"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "String.prototype.charCodeAt"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var TEST_STRING = new String( " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~" ); + + var testcases = getTestCases(); + test(); + +function MyObject (v) { + this.value = v; + //this.toString = new Function ( "return this.value +\"\"" ); + this.toString = function (){return this.value+'';} + this.charCodeAt = String.prototype.charCodeAt; +} + +function getTestCases() { + var array = new Array(); + var item = 0; + + var foo = new MyObject('hello'); + + array[item++] = new TestCase( SECTION, "var foo = new MyObject('hello');foo.charCodeAt(0)", 0x0068, foo.charCodeAt(0) ); + array[item++] = new TestCase( SECTION, "var foo = new MyObject('hello');foo.charCodeAt(1)", 0x0065, foo.charCodeAt(1) ); + array[item++] = new TestCase( SECTION, "var foo = new MyObject('hello');foo.charCodeAt(2)", 0x006c, foo.charCodeAt(2) ); + array[item++] = new TestCase( SECTION, "var foo = new MyObject('hello');foo.charCodeAt(3)", 0x006c, foo.charCodeAt(3) ); + array[item++] = new TestCase( SECTION, "var foo = new MyObject('hello');foo.charCodeAt(4)", 0x006f, foo.charCodeAt(4) ); + array[item++] = new TestCase( SECTION, "var foo = new MyObject('hello');foo.charCodeAt(-1)", Number.NaN, foo.charCodeAt(-1) ); + array[item++] = new TestCase( SECTION, "var foo = new MyObject('hello');foo.charCodeAt(5)", Number.NaN, foo.charCodeAt(5) ); + + var boo = new MyObject(true); + + array[item++] = new TestCase( SECTION, "var boo = new MyObject(true);boo.charCodeAt(0)", 0x0074, boo.charCodeAt(0) ); + array[item++] = new TestCase( SECTION, "var boo = new MyObject(true);boo.charCodeAt(1)", 0x0072, boo.charCodeAt(1) ); + array[item++] = new TestCase( SECTION, "var boo = new MyObject(true);boo.charCodeAt(2)", 0x0075, boo.charCodeAt(2) ); + array[item++] = new TestCase( SECTION, "var boo = new MyObject(true);boo.charCodeAt(3)", 0x0065, boo.charCodeAt(3) ); + + var noo = new MyObject( Math.PI ); + + array[item++] = new TestCase( SECTION, "var noo = new MyObject(Math.PI);noo.charCodeAt(0)", 0x0033, noo.charCodeAt(0) ); + array[item++] = new TestCase( SECTION, "var noo = new MyObject(Math.PI);noo.charCodeAt(1)", 0x002E, noo.charCodeAt(1) ); + array[item++] = new TestCase( SECTION, "var noo = new MyObject(Math.PI);noo.charCodeAt(2)", 0x0031, noo.charCodeAt(2) ); + array[item++] = new TestCase( SECTION, "var noo = new MyObject(Math.PI);noo.charCodeAt(3)", 0x0034, noo.charCodeAt(3) ); + array[item++] = new TestCase( SECTION, "var noo = new MyObject(Math.PI);noo.charCodeAt(4)", 0x0031, noo.charCodeAt(4) ); + array[item++] = new TestCase( SECTION, "var noo = new MyObject(Math.PI);noo.charCodeAt(5)", 0x0035, noo.charCodeAt(5) ); + array[item++] = new TestCase( SECTION, "var noo = new MyObject(Math.PI);noo.charCodeAt(6)", 0x0039, noo.charCodeAt(6) ); + + var noo = new MyObject( null ); + + array[item++] = new TestCase( SECTION, "var noo = new MyObject(null);noo.charCodeAt(0)", 0x006E, noo.charCodeAt(0) ); + array[item++] = new TestCase( SECTION, "var noo = new MyObject(null);noo.charCodeAt(1)", 0x0075, noo.charCodeAt(1) ); + array[item++] = new TestCase( SECTION, "var noo = new MyObject(null);noo.charCodeAt(2)", 0x006C, noo.charCodeAt(2) ); + array[item++] = new TestCase( SECTION, "var noo = new MyObject(null);noo.charCodeAt(3)", 0x006C, noo.charCodeAt(3) ); + array[item++] = new TestCase( SECTION, "var noo = new MyObject(null);noo.charCodeAt(4)", NaN, noo.charCodeAt(4) ); + + var noo = new MyObject( void 0 ); + + array[item++] = new TestCase( SECTION, "var noo = new MyObject(void 0);noo.charCodeAt(0)", 0x0075, noo.charCodeAt(0) ); + array[item++] = new TestCase( SECTION, "var noo = new MyObject(void 0);noo.charCodeAt(1)", 0x006E, noo.charCodeAt(1) ); + array[item++] = new TestCase( SECTION, "var noo = new MyObject(void 0);noo.charCodeAt(2)", 0x0064, noo.charCodeAt(2) ); + array[item++] = new TestCase( SECTION, "var noo = new MyObject(void 0);noo.charCodeAt(3)", 0x0065, noo.charCodeAt(3) ); + array[item++] = new TestCase( SECTION, "var noo = new MyObject(void 0);noo.charCodeAt(4)", 0x0066, noo.charCodeAt(4) ); + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/String/e15_5_4_5_4.as b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_5_4.as new file mode 100644 index 00000000000..293de4c8241 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_5_4.as @@ -0,0 +1,63 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var VERSION = "0697"; + startTest(); + var SECTION = "15.5.4.5-4"; + + writeHeaderToLog( SECTION + " String.prototype.charCodeAt(pos)" ); + + var testcases = getTestCases(); + +// all tests must call a function that returns an array of TestCase objects. + test(); + +function getTestCases() { + var array = new Array(); + var MAXCHARCODE = Math.pow(2,16); + var item=0, CHARCODE; + + for ( CHARCODE=0; CHARCODE <256; CHARCODE++ ) { + array[item++] = new TestCase( SECTION, + "(String.fromCharCode("+CHARCODE+")).charCodeAt(0)", + CHARCODE, + (String.fromCharCode(CHARCODE)).charCodeAt(0) ); + } + for ( CHARCODE=256; CHARCODE < 65536; CHARCODE+=999 ) { + array[item++] = new TestCase( SECTION, + "(String.fromCharCode("+CHARCODE+")).charCodeAt(0)", + CHARCODE, + (String.fromCharCode(CHARCODE)).charCodeAt(0) ); + } + + array[item++] = new TestCase( SECTION, "(String.fromCharCode(65535)).charCodeAt(0)", 65535, (String.fromCharCode(65535)).charCodeAt(0) ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/String/e15_5_4_5_5.as b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_5_5.as new file mode 100644 index 00000000000..28ed873c921 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_5_5.as @@ -0,0 +1,81 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.5.4.5-5"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "String.prototype.charCodeAt"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var TEST_STRING = ""; + + for ( var i = 0x0000; i < 255; i++ ) { + TEST_STRING += String.fromCharCode( i ); + } + + + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var origBooleanCharCodeAt = Boolean.prototype.charCodeAt; + Boolean.prototype.charCodeAt=String.prototype.charCodeAt; + + array[item++] = new TestCase( SECTION, "x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(0)", 0x0074, (x = new Boolean(true), x.charCodeAt(0)) ); + array[item++] = new TestCase( SECTION, "x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(1)", 0x0072, (x = new Boolean(true), x.charCodeAt(1)) ); + array[item++] = new TestCase( SECTION, "x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(2)", 0x0075, (x = new Boolean(true), x.charCodeAt(2)) ); + array[item++] = new TestCase( SECTION, "x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(3)", 0x0065, (x = new Boolean(true), x.charCodeAt(3)) ); + array[item++] = new TestCase( SECTION, "x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(4)", Number.NaN, (x = new Boolean(true), x.charCodeAt(4)) ); + array[item++] = new TestCase( SECTION, "x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(-1)", Number.NaN, (x = new Boolean(true), x.charCodeAt(-1)) ); + + array[item++] = new TestCase( SECTION, "x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(true)", 0x0072, (x = new Boolean(true), x.charCodeAt(true)) ); + array[item++] = new TestCase( SECTION, "x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(false)", 0x0074, (x = new Boolean(true), x.charCodeAt(false)) ); + + array[item++] = new TestCase( SECTION, "x = new String(); x.charCodeAt(0)", Number.NaN, (x=new String(),x.charCodeAt(0)) ); + array[item++] = new TestCase( SECTION, "x = new String(); x.charCodeAt(1)", Number.NaN, (x=new String(),x.charCodeAt(1)) ); + array[item++] = new TestCase( SECTION, "x = new String(); x.charCodeAt(-1)", Number.NaN, (x=new String(),x.charCodeAt(-1)) ); + + array[item++] = new TestCase( SECTION, "x = new String(); x.charCodeAt(NaN)", Number.NaN, (x=new String(),x.charCodeAt(Number.NaN)) ); + array[item++] = new TestCase( SECTION, "x = new String(); x.charCodeAt(Number.POSITIVE_INFINITY)", Number.NaN, (x=new String(),x.charCodeAt(Number.POSITIVE_INFINITY)) ); + array[item++] = new TestCase( SECTION, "x = new String(); x.charCodeAt(Number.NEGATIVE_INFINITY)", Number.NaN, (x=new String(),x.charCodeAt(Number.NEGATIVE_INFINITY)) ); + + for ( var j = 0; j < 255; j++ ) { + array[item++] = new TestCase( SECTION, "TEST_STRING.charCodeAt("+j+")", j, TEST_STRING.charCodeAt(j) ); + } + + Boolean.prototype.charCodeAt = origBooleanCharCodeAt; + + return (array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/String/e15_5_4_5_6_rt.as b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_5_6_rt.as new file mode 100644 index 00000000000..c2a0df91ed5 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_5_6_rt.as @@ -0,0 +1,195 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.5.4.5-6"; + var VERSION = "ECMA_2"; + startTest(); + var TITLE = "String.prototype.charCodeAt"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var thisError="no error"; + var obj = true; + var s = '' + + var origBooleanCharCodeAt = Boolean.prototype.charCodeAt; + Boolean.prototype.charCodeAt= String.prototype.charCodeAt; + try{ + + obj.__proto__.charAt = String.prototype.charAt; + for ( var i = 0; i < 4; i++ ) + s+= String.fromCharCode( obj.charCodeAt(i) ); + }catch(eP0:ReferenceError){ + thisError=eP0.toString(); + } + array[item++] = new TestCase( SECTION,"var obj = true; obj.__proto__.charCodeAt = String.prototype.charCodeAt; var s = ''; for ( var i = 0; i < 4; i++ ) s+= String.fromCharCode( obj.charCodeAt(i) ); s","ReferenceError: Error #1069", referenceError(thisError)); + + + /*var obj = true; + obj.__proto__.charCodeAt = String.prototype.charCodeAt; + var s = ''; + for ( var i = 0; i < 4; i++ ) + s+= String.fromCharCode( obj.charCodeAt(i) ); + + array[item++] = new TestCase( SECTION, + "var obj = true; obj.__proto__.charCodeAt = String.prototype.charCodeAt; var s = ''; for ( var i = 0; i < 4; i++ ) s+= String.fromCharCode( obj.charCodeAt(i) ); s", + "true", + s);*/ + + thisError="no error"; + var obj = 1234; + var s = ''; + try{ + + obj.__proto__.charAt = String.prototype.charAt; + for ( var i = 0; i < 4; i++ ) + s+= String.fromCharCode( obj.charCodeAt(i) ); + }catch(eP1:Error){ + thisError=eP1.toString(); + } + array[item++] = new TestCase( SECTION,"var obj = 1234; obj.__proto__.charCodeAt = String.prototype.charCodeAt; var s = ''; for ( var i = 0; i < 4; i++ ) s+= String.fromCharCode( obj.charCodeAt(i) ); s", "ReferenceError: Error #1069",referenceError(thisError)); + + + /*obj = 1234; + obj.__proto__.charCodeAt = String.prototype.charCodeAt; + s = ''; + for ( var i = 0; i < 4; i++ ) + s+= String.fromCharCode( obj.charCodeAt(i) ); + + array[item++] = new TestCase( SECTION, + "var obj = 1234; obj.__proto__.charCodeAt = String.prototype.charCodeAt; var s = ''; for ( var i = 0; i < 4; i++ ) s+= String.fromCharCode( obj.charCodeAt(i) ); s", + "1234", + s);*/ + thisError="no error"; + var obj = 'hello'; + var s = ''; + try{ + + obj.__proto__.charAt = String.prototype.charAt; + for ( var i = 0; i < 4; i++ ) + s+= String.fromCharCode( obj.charCodeAt(i) ); + }catch(eP2:Error){ + thisError=eP2.toString(); + } + array[item++] = new TestCase( SECTION,"var obj = 1234; obj.__proto__.charCodeAt = String.prototype.charCodeAt; var s = ''; for ( var i = 0; i < 4; i++ ) s+= String.fromCharCode( obj.charCodeAt(i) ); s", "ReferenceError: Error #1069",referenceError(thisError)); + + + /* obj = 'hello'; + obj.__proto__.charCodeAt = String.prototype.charCodeAt; + s = ''; + for ( var i = 0; i < 5; i++ ) + s+= String.fromCharCode( obj.charCodeAt(i) ); + + array[item++] = new TestCase( SECTION, + "var obj = 'hello'; obj.__proto__.charCodeAt = String.prototype.charCodeAt; var s = ''; for ( var i = 0; i < 5; i++ ) s+= String.fromCharCode( obj.charCodeAt(i) ); s", + "hello", + s );*/ + + var myvar = new String(true); + var s = ''; + for ( var i = 0; i < 4; i++ ) + s+= String.fromCharCode( myvar.charCodeAt(i)) + + array[item++] = new TestCase( SECTION, + "var myvar = new String(true); var s = ''; for ( var i = 0; i < 4; i++ ) s+= String.fromCharCode( myvar.charCodeAt(i) ); s", + "true", + s); + + var myvar = new String(1234); + var s = ''; + for ( var i = 0; i < 4; i++ ) + s+= String.fromCharCode( myvar.charCodeAt(i)) + + array[item++] = new TestCase( SECTION, + "var myvar = new String(1234); var s = ''; for ( var i = 0; i < 4; i++ ) s+= String.fromCharCode( myvar.charCodeAt(i) ); s", + "1234", + s); + + var myvar = new String('hello'); + var s = ''; + for ( var i = 0; i < myvar.length; i++ ) + s+= String.fromCharCode( myvar.charCodeAt(i)) + + array[item++] = new TestCase( SECTION, + "var myvar = new String('hello'); var s = ''; for ( var i = 0; i < 4; i++ ) s+= String.fromCharCode( myvar.charCodeAt(i) ); s", + "hello", + s); + + var myvar = new String('hello'); + var s = ''; + s = myvar.charCodeAt(-1); + + array[item++] = new TestCase( SECTION, + "var myvar = new String('hello'); var s = myvar.charCodeAt(-1)",NaN,s); + + var myvar = new String(1234); + var s = ''; + s = myvar.charCodeAt(0); + + array[item++] = new TestCase( SECTION, + "var myvar = new String(1234); var s = myvar.charCodeAt(0)",49,s); + + var myvar = new String(1234); + var s = ''; + s = String.fromCharCode(myvar.charCodeAt()); + + array[item++] = new TestCase( SECTION, + "var myvar = new String(1234); var s = String.fromCharCode(myvar.charCodeAt())","1",s); + + var myvar = new String(1234); + var s = ''; + s = myvar.charCodeAt(5); + + array[item++] = new TestCase( SECTION, + "var myvar = new String(1234); var s = myvar.charCodeAt(5)",NaN,s); + + var myobj = new Object(); + myobj.length = 5 + myobj.charCodeAt = String.prototype.charCodeAt; + myobj[0]='h'; + myobj[1]='e'; + myobj[2]='l'; + myobj[3]='l'; + myobj[4]='o'; + array[item++] = new TestCase( SECTION, + "var myobj = new Object();myobj.charCodeAt = String.prototype.charCodeAt; myobj.charCodeAt(4)",101,myobj.charCodeAt(4)); + + + Boolean.prototype.charCodeAt= origBooleanCharCodeAt; + + return (array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/String/e15_5_4_6_1.as b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_6_1.as new file mode 100644 index 00000000000..99fb187927f --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_6_1.as @@ -0,0 +1,127 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.5.4.6-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "String.protoype.indexOf"; + + var TEST_STRING = new String( " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~" ); + + writeHeaderToLog( SECTION + " "+ TITLE); + writeLineToLog( "TEST_STRING = new String(\" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\")" ); + + var testcases = getTestCases(); + test(); + + +function getTestCases() { + var array = new Array(); + var j = 0; + + for ( k = 0, i = 0x0020; i < 0x007e; i++, j++, k++ ) { + array[j] = new TestCase( SECTION, + "String.indexOf(" +String.fromCharCode(i)+ ", 0)", + k, + TEST_STRING.indexOf( String.fromCharCode(i), 0 ) ); + } + + for ( k = 0, i = 0x0020; i < 0x007e; i++, j++, k++ ) { + array[j] = new TestCase( SECTION, + "String.indexOf("+String.fromCharCode(i)+ ", "+ k +")", + k, + TEST_STRING.indexOf( String.fromCharCode(i), k ) ); + } + + for ( k = 0, i = 0x0020; i < 0x007e; i++, j++, k++ ) { + array[j] = new TestCase( SECTION, + "String.indexOf("+String.fromCharCode(i)+ ", "+k+1+")", + -1, + TEST_STRING.indexOf( String.fromCharCode(i), k+1 ) ); + } + + for ( k = 0, i = 0x0020; i < 0x007d; i++, j++, k++ ) { + array[j] = new TestCase( SECTION, + "String.indexOf("+(String.fromCharCode(i) + + String.fromCharCode(i+1)+ + String.fromCharCode(i+2)) +", "+0+")", + k, + TEST_STRING.indexOf( (String.fromCharCode(i)+ + String.fromCharCode(i+1)+ + String.fromCharCode(i+2)), + 0 ) ); + } + + for ( k = 0, i = 0x0020; i < 0x007d; i++, j++, k++ ) { + array[j] = new TestCase( SECTION, + "String.indexOf("+(String.fromCharCode(i) + + String.fromCharCode(i+1)+ + String.fromCharCode(i+2)) +", "+ k +")", + k, + TEST_STRING.indexOf( (String.fromCharCode(i)+ + String.fromCharCode(i+1)+ + String.fromCharCode(i+2)), + k ) ); + } + for ( k = 0, i = 0x0020; i < 0x007d; i++, j++, k++ ) { + array[j] = new TestCase( SECTION, + "String.indexOf("+(String.fromCharCode(i) + + String.fromCharCode(i+1)+ + String.fromCharCode(i+2)) +", "+ k+1 +")", + -1, + TEST_STRING.indexOf( (String.fromCharCode(i)+ + String.fromCharCode(i+1)+ + String.fromCharCode(i+2)), + k+1 ) ); + } + + array[j++] = new TestCase( SECTION, "String.indexOf(" +TEST_STRING + ", 0 )", 0, TEST_STRING.indexOf( TEST_STRING, 0 ) ); + array[j++] = new TestCase( SECTION, "String.indexOf(" +TEST_STRING + ", 1 )", -1, TEST_STRING.indexOf( TEST_STRING, 1 )); + + var TEST_STRING2 = " "; + array[j++] = new TestCase( SECTION, "String.indexOf(" +TEST_STRING2 + ", 0 )", 0, TEST_STRING.indexOf( TEST_STRING2, 0 )); + array[j++] = new TestCase( SECTION, "String.indexOf(" +TEST_STRING2 + ", 1 )", -1, TEST_STRING.indexOf( TEST_STRING2, 1 )); + array[j++] = new TestCase( SECTION, "String.indexOf(" +TEST_STRING2 + ", 1 )", 0, TEST_STRING.indexOf( TEST_STRING2)); + + var TEST_STRING3:String = "abc def"; + + for (i=0;i<7;i++){ + array[j++] = new TestCase( SECTION, "String.indexOf(" +TEST_STRING3 + ", i )", i, TEST_STRING3.indexOf( TEST_STRING3.charAt(i))); + } + + array[j++] = new TestCase( SECTION, "String.indexOf(" +TEST_STRING3 + ", 8 )",0, TEST_STRING3.indexOf( TEST_STRING3.charAt(8))); + array[j++] = new TestCase( SECTION, "String.indexOf(" +TEST_STRING3+ " )",-1, TEST_STRING3.indexOf()); + array[j++] = new TestCase( SECTION, "String.indexOf(" +TEST_STRING3+ " )",3, TEST_STRING3.indexOf(" ")); + array[j++] = new TestCase( SECTION, "String.indexOf(" +TEST_STRING3+ " )",-1, TEST_STRING3.indexOf(null)); + array[j++] = new TestCase( SECTION, "String.indexOf(" +TEST_STRING3+ " )",-1, TEST_STRING3.indexOf(null,0)); + + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/String/e15_5_4_6_2_rt.as b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_6_2_rt.as new file mode 100644 index 00000000000..73d2e1300b8 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_6_2_rt.as @@ -0,0 +1,303 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + use namespace AS3; + var SECTION = "15.5.4.6-2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "String.protoype.indexOf"; + var BUGNUMBER="105721"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + + +// the following test regresses http://scopus/bugsplat/show_bug.cgi?id=105721 + +function f() { + return this; +} +function g() { + var h = f; + return h(); +} + +function MyObject (v) { + this.value = v; + this.toString = function () { return this.value +""; }; + this.indexOf = String.prototype.indexOf; +} + +function getTestCases() { + var array = new Array(); + var item = 0; + + // regress http://scopus/bugsplat/show_bug.cgi?id=105721 + + array[item++] = new TestCase( SECTION, "function f() { return this; }; function g() { var h = f; return h(); }; g().toString()", GLOBAL, g().toString() ); + + array[item++] = new TestCase( SECTION, "String.prototype.indexOf.length", 2, String.prototype.indexOf.length ); + //length property is read-only + //array[item++] = new TestCase( SECTION, "String.prototype.indexOf.length = null; String.prototype.indexOf.length", 2, (String.prototype.indexOf.length=null,String.prototype.indexOf.length) ); + array[item++] = new TestCase( SECTION, "delete String.prototype.indexOf.length", false, delete String.prototype.indexOf.length ); + array[item++] = new TestCase( SECTION, "delete String.prototype.indexOf.length; String.prototype.indexOf.length", 2, (delete String.prototype.indexOf.length, String.prototype.indexOf.length) ); + + array[item++] = new TestCase( SECTION, "var s = new String(), s.indexOf()", -1, (s = new String(), s.indexOf() ) ); + + // some Unicode tests. + + // generate a test string. + + var TEST_STRING = ""; + + for ( var u = 0x00A1; u <= 0x00FF; u++ ) { + TEST_STRING += String.fromCharCode( u ); + } + + for ( var u = 0x00A1, i = 0; u <= 0x00FF; u++, i++ ) { + array[item++] = new TestCase( SECTION, + "TEST_STRING.indexOf( " + String.fromCharCode(u) + " )", + i, + TEST_STRING.indexOf( String.fromCharCode(u) ) ); + } + for ( var u = 0x00A1, i = 0; u <= 0x00FF; u++, i++ ) { + array[item++] = new TestCase( SECTION, + "TEST_STRING.indexOf( " + String.fromCharCode(u) + ", void 0 )", + i, + TEST_STRING.indexOf( String.fromCharCode(u), void 0 ) ); + } + + + + var foo = new MyObject('hello'); + + array[item++] = new TestCase( SECTION, "var foo = new MyObject('hello');foo.indexOf('h')", 0, foo.indexOf("h") ); + array[item++] = new TestCase( SECTION, "var foo = new MyObject('hello');foo.indexOf('e')", 1, foo.indexOf("e") ); + array[item++] = new TestCase( SECTION, "var foo = new MyObject('hello');foo.indexOf('l')", 2, foo.indexOf("l") ); + array[item++] = new TestCase( SECTION, "var foo = new MyObject('hello');foo.indexOf('l')", 2, foo.indexOf("l") ); + array[item++] = new TestCase( SECTION, "var foo = new MyObject('hello');foo.indexOf('o')", 4, foo.indexOf("o") ); + array[item++] = new TestCase( SECTION, "var foo = new MyObject('hello');foo.indexOf('X')", -1, foo.indexOf("X") ); + array[item++] = new TestCase( SECTION, "var foo = new MyObject('hello');foo.indexOf(5) ", -1, foo.indexOf(5) ); + + var boo = new MyObject(true); + + array[item++] = new TestCase( SECTION, "var boo = new MyObject(true);boo.indexOf('t')", 0, boo.indexOf("t") ); + array[item++] = new TestCase( SECTION, "var boo = new MyObject(true);boo.indexOf('r')", 1, boo.indexOf("r") ); + array[item++] = new TestCase( SECTION, "var boo = new MyObject(true);boo.indexOf('u')", 2, boo.indexOf("u") ); + array[item++] = new TestCase( SECTION, "var boo = new MyObject(true);boo.indexOf('e')", 3, boo.indexOf("e") ); + array[item++] = new TestCase( SECTION, "var boo = new MyObject(true);boo.indexOf('true')", 0, boo.indexOf("true") ); + array[item++] = new TestCase( SECTION, "var boo = new MyObject(true);boo.indexOf('rue')", 1, boo.indexOf("rue") ); + array[item++] = new TestCase( SECTION, "var boo = new MyObject(true);boo.indexOf('ue')", 2, boo.indexOf("ue") ); + array[item++] = new TestCase( SECTION, "var boo = new MyObject(true);boo.indexOf('oy')", -1, boo.indexOf("oy") ); + + + var noo = new MyObject( Math.PI ); + array[item++] = new TestCase( SECTION, "var noo = new MyObject(Math.PI); noo.indexOf('3') ", 0, noo.indexOf('3') ); + array[item++] = new TestCase( SECTION, "var noo = new MyObject(Math.PI); noo.indexOf('.') ", 1, noo.indexOf('.') ); + array[item++] = new TestCase( SECTION, "var noo = new MyObject(Math.PI); noo.indexOf('1') ", 2, noo.indexOf('1') ); + array[item++] = new TestCase( SECTION, "var noo = new MyObject(Math.PI); noo.indexOf('4') ", 3, noo.indexOf('4') ); + array[item++] = new TestCase( SECTION, "var noo = new MyObject(Math.PI); noo.indexOf('1') ", 2, noo.indexOf('1') ); + array[item++] = new TestCase( SECTION, "var noo = new MyObject(Math.PI); noo.indexOf('5') ", 5, noo.indexOf('5') ); + array[item++] = new TestCase( SECTION, "var noo = new MyObject(Math.PI); noo.indexOf('9') ", 6, noo.indexOf('9') ); + + array[item++] = new TestCase( SECTION, + "var arr = new Array('new','zoo','revue'); arr.indexOf = String.prototype.indexOf; arr.indexOf('new')", + 0, + (arr = new Array('new','zoo','revue'), arr.indexOf('new') ) ); + + array[item++] = new TestCase( SECTION, + "var arr = new Array('new','zoo','revue'); arr.indexOf = String.prototype.indexOf; arr.indexOf(',zoo,')", + 1, + (arr = new Array('new','zoo','revue'), arr.indexOf('zoo') ) ); + + + + array[item++] = new TestCase( SECTION, + "var obj = new Object(); obj.indexOf = String.prototype.indexOf; obj.indexOf('[object Object]')", + 0, + (obj = new Object(), obj.indexOf = String.prototype.indexOf, obj.indexOf('[object Object]') ) ); + + array[item++] = new TestCase( SECTION, + "var obj = new Object(); obj.indexOf = String.prototype.indexOf; obj.indexOf('bject')", + 2, + (obj = new Object(), obj.indexOf = String.prototype.indexOf, obj.indexOf('bject') ) ); + + array[item++] = new TestCase( SECTION, + "var f = new Object( String.prototype.indexOf ); f('"+GLOBAL+"')", + 0, + (f = new Object( String.prototype.indexOf ), f(String(GLOBAL))) ); + + // work around for bug 175820 + var expRes1 = "[object Function-97]"; + if( !Capabilities.isDebugger ) + expRes1 = "[object null]"; + + array[item++]= new TestCase(SECTION,"Assigning Object.prototype.toString to f.toString",expRes1, (f.toString=Object.prototype.toString, f.toString())); + + // work around for bug 175820 + var expRes2 = 0; + if( !Capabilities.isDebugger ) + expRes2 = -1; + + array[item++] = new TestCase( SECTION, + "var f = function() {}; f.toString = Object.prototype.toString; f.indexOf = String.prototype.indexOf; f.indexOf('[object Function-0]')", + expRes2, + (f = function() {}, f.toString = Object.prototype.toString, f.indexOf = String.prototype.indexOf, f.indexOf('[object Function-0]') ) ); + + try{ + var b = new Boolean(); + b.indexOf = String.prototype.indexOf; + b.indexOf('true'); + } + catch(e2){ + thisError=e2.toString(); + } + finally{ + array[item++] = new TestCase( SECTION, + "var b = new Boolean(); b.indexOf = String.prototype.indexOf; b.indexOf('true')","ReferenceError: Error #1056",referenceError(thisError)); + } + try{ + var b = new Boolean(); + b.indexOf = String.prototype.indexOf; + b.indexOf('false',1); + } + catch(e3){ + thisError=e3.toString(); + } + finally{ + array[item++] = new TestCase( SECTION, + "var b = new Boolean(); b.indexOf = String.prototype.indexOf; b.indexOf('true')","ReferenceError: Error #1056",referenceError(thisError)); + } + try{ + var b = new Boolean(); + b.indexOf = String.prototype.indexOf; + b.indexOf('false',0); + } + catch(e4){ + thisError=e4.toString(); + } + finally{ + array[item++] = new TestCase( SECTION, + "var b = new Boolean(); b.indexOf = String.prototype.indexOf; b.indexOf('true')","ReferenceError: Error #1056",referenceError(thisError)); + } + try{ + n = new Number(1e21); + n.indexOf = String.prototype.indexOf; + n.indexOf('e'); + } + catch(e5){ + thisError=e5.toString(); + } + finally{ + array[item++] = new TestCase( SECTION, + "var n = new Number(1e21); n.indexOf = String.prototype.indexOf; n.indexOf('e')","ReferenceError: Error #1056",referenceError(thisError)); + } + try{ + n = new Number(-Infinity); + n.indexOf = String.prototype.indexOf; + n.indexOf('-'); + } + catch(e6){ + thisError=e6.toString(); + } + finally{ + array[item++] = new TestCase( SECTION, + "var n = new Number(-Infinity); n.indexOf = String.prototype.indexOf; n.indexOf('-')","ReferenceError: Error #1056",referenceError(thisError)); + } + try{ + var n = new Number(0xFF); + n.indexOf = String.prototype.indexOf; + n.indexOf('5'); + } + catch(e7){ + thisError=e7.toString(); + } + finally{ + array[item++] = new TestCase( SECTION, + "var n = new Number(0xFF); n.indexOf = String.prototype.indexOf; n.indexOf('5')","ReferenceError: Error #1056",referenceError(thisError)); + } + try{ + var m = Math; + m.indexOf = String.prototype.indexOf; m.indexOf( 'Math' ); + }catch(e8){ + thisError=e8.toString(); + }finally{ + array[item++] = new TestCase( SECTION, + "var m = Math; m.indexOf = String.prototype.indexOf; m.indexOf( 'Math' )","ReferenceError: Error #1056",referenceError(thisError)); + + } + + + /*array[item++] = new TestCase( SECTION, + "var b = new Boolean(); b.indexOf = String.prototype.indexOf; b.indexOf('true')", + -1, + (b = new Boolean(), b.indexOf = String.prototype.indexOf, b.indexOf('true') ) ); + + array[item++] = new TestCase( SECTION, + "var b = new Boolean(); b.indexOf = String.prototype.indexOf; b.indexOf('false', 1)", + -1, + (b = new Boolean(), b.indexOf = String.prototype.indexOf, b.indexOf('false', 1) ) ); + + array[item++] = new TestCase( SECTION, + "var b = new Boolean(); b.indexOf = String.prototype.indexOf; b.indexOf('false', 0)", + 0, + (b = new Boolean(), b.indexOf = String.prototype.indexOf, b.indexOf('false', 0) ) ); + + array[item++] = new TestCase( SECTION, + "var n = new Number(1e21); n.indexOf = String.prototype.indexOf; n.indexOf('e')", + 1, + (n = new Number(1e21), n.indexOf = String.prototype.indexOf, n.indexOf('e') ) ); + + array[item++] = new TestCase( SECTION, + "var n = new Number(-Infinity); n.indexOf = String.prototype.indexOf; n.indexOf('-')", + 0, + (n = new Number(-Infinity), n.indexOf = String.prototype.indexOf, n.indexOf('-') ) ); + + array[item++] = new TestCase( SECTION, + "var n = new Number(0xFF); n.indexOf = String.prototype.indexOf; n.indexOf('5')", + 1, + (n = new Number(0xFF), n.indexOf = String.prototype.indexOf, n.indexOf('5') ) ); + + array[item++] = new TestCase( SECTION, + "var m = Math; m.indexOf = String.prototype.indexOf; m.indexOf( 'Math' )", + 8, + (m = Math, m.indexOf = String.prototype.indexOf, m.indexOf( 'Math' ) ) );*/ + + // new Date(0) has '31' or '01' at index 8 depending on whether tester is (GMT-) or (GMT+), respectively + array[item++] = new TestCase( SECTION, + "var d = new Date(0); d.indexOf = String.prototype.indexOf; d.getTimezoneOffset()>0 ? d.indexOf('31') : d.indexOf('01')", + 8, + (d = new Date(0), d.indexOf = String.prototype.indexOf, d.getTimezoneOffset()>0 ? d.indexOf('31') : d.indexOf('01') ) ); + + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/String/e15_5_4_7_1.as b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_7_1.as new file mode 100644 index 00000000000..208a2af5c3b --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_7_1.as @@ -0,0 +1,178 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.5.4.7-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "String.protoype.lastIndexOf"; + + var TEST_STRING = new String( " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~" ); + + writeHeaderToLog( SECTION + " "+ TITLE); + writeLineToLog( "TEST_STRING = new String(\" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\")" ); + + var testcases = getTestCases(); + test(); + + +function getTestCases() { + var array = new Array(); + var j = 0; + + for ( k = 0, i = 0x0021; i < 0x007e; i++, j++, k++ ) { + array[j] = new TestCase( SECTION, + "String.lastIndexOf(" +String.fromCharCode(i)+ ", 0)", + -1, + TEST_STRING.lastIndexOf( String.fromCharCode(i), 0 ) ); + } + + for ( k = 0, i = 0x0020; i < 0x007e; i++, j++, k++ ) { + array[j] = new TestCase( SECTION, + "String.lastIndexOf("+String.fromCharCode(i)+ ", "+ k +")", + k, + TEST_STRING.lastIndexOf( String.fromCharCode(i), k ) ); + } + + for ( k = 0, i = 0x0020; i < 0x007e; i++, j++, k++ ) { + array[j] = new TestCase( SECTION, + "String.lastIndexOf("+String.fromCharCode(i)+ ", "+k+1+")", + k, + TEST_STRING.lastIndexOf( String.fromCharCode(i), k+1 ) ); + } + + for ( k = 9, i = 0x0021; i < 0x007d; i++, j++, k++ ) { + array[j] = new TestCase( SECTION, + + "String.lastIndexOf("+(String.fromCharCode(i) + + String.fromCharCode(i+1)+ + String.fromCharCode(i+2)) +", "+ 0 + ")", + LastIndexOf( TEST_STRING, String.fromCharCode(i) + + String.fromCharCode(i+1)+String.fromCharCode(i+2), 0), + TEST_STRING.lastIndexOf( (String.fromCharCode(i)+ + String.fromCharCode(i+1)+ + String.fromCharCode(i+2)), + 0 ) ); + } + + for ( k = 0, i = 0x0020; i < 0x007d; i++, j++, k++ ) { + array[j] = new TestCase( SECTION, + "String.lastIndexOf("+(String.fromCharCode(i) + + String.fromCharCode(i+1)+ + String.fromCharCode(i+2)) +", "+ k +")", + k, + TEST_STRING.lastIndexOf( (String.fromCharCode(i)+ + String.fromCharCode(i+1)+ + String.fromCharCode(i+2)), + k ) ); + } + for ( k = 0, i = 0x0020; i < 0x007d; i++, j++, k++ ) { + array[j] = new TestCase( SECTION, + "String.lastIndexOf("+(String.fromCharCode(i) + + String.fromCharCode(i+1)+ + String.fromCharCode(i+2)) +", "+ k+1 +")", + k, + TEST_STRING.lastIndexOf( (String.fromCharCode(i)+ + String.fromCharCode(i+1)+ + String.fromCharCode(i+2)), + k+1 ) ); + } + for ( k = 0, i = 0x0020; i < 0x007d; i++, j++, k++ ) { + array[j] = new TestCase( SECTION, + "String.lastIndexOf("+ + (String.fromCharCode(i) + + String.fromCharCode(i+1)+ + String.fromCharCode(i+2)) +", "+ (k-1) +")", + LastIndexOf( TEST_STRING, String.fromCharCode(i) + + String.fromCharCode(i+1)+String.fromCharCode(i+2), k-1), + TEST_STRING.lastIndexOf( (String.fromCharCode(i)+ + String.fromCharCode(i+1)+ + String.fromCharCode(i+2)), + k-1 ) ); + } + + array[j++] = new TestCase( SECTION, "String.lastIndexOf(" +TEST_STRING + ", 0 )", 0, TEST_STRING.lastIndexOf( TEST_STRING, 0 ) ); +// array[j++] = new TestCase( SECTION, "String.lastIndexOf(" +TEST_STRING + ", 1 )", 0, TEST_STRING.lastIndexOf( TEST_STRING, 1 )); + array[j++] = new TestCase( SECTION, "String.lastIndexOf(" +TEST_STRING + ")", 0, TEST_STRING.lastIndexOf( TEST_STRING )); + + return array; +} + +function LastIndexOf( string, search, position ) { + string = String( string ); + search = String( search ); + + position = Number( position ) + + if ( isNaN( position ) ) { + position = Infinity; + } else { + position = ToInteger( position ); + } + + result5= string.length; + result6 = Math.min(Math.max(position, 0), result5); + result7 = search.length; + + if (result7 == 0) { + return Math.min(position, result5); + } + + result8 = -1; + + for ( k = 0; k <= result6; k++ ) { + if ( k+ result7 > result5 ) { + break; + } + for ( j = 0; j < result7; j++ ) { + if ( string.charAt(k+j) != search.charAt(j) ){ + break; + } else { + if ( j == result7 -1 ) { + result8 = k; + } + } + } + } + + return result8; +} +function ToInteger( n ) { + n = Number( n ); + if ( isNaN(n) ) { + return 0; + } + if ( Math.abs(n) == 0 || Math.abs(n) == Infinity ) { + return n; + } + + var sign = ( n < 0 ) ? -1 : 1; + + return ( sign * Math.floor(Math.abs(n)) ); +} diff --git a/mozilla/js/tamarin/test/ecma3/String/e15_5_4_7_2.as b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_7_2.as new file mode 100644 index 00000000000..ec60f38fc9f --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_7_2.as @@ -0,0 +1,198 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.5.4.7-2"; + var VERSION = "ECMA_4"; + startTest(); + var TITLE = "String.protoype.lastIndexOf"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "String.prototype.lastIndexOf.length", 2, String.prototype.lastIndexOf.length ); + array[item++] = new TestCase( SECTION, "delete String.prototype.lastIndexOf.length", false, delete String.prototype.lastIndexOf.length ); + array[item++] = new TestCase( SECTION, "delete String.prototype.lastIndexOf.length; String.prototype.lastIndexOf.length", 2, (delete String.prototype.lastIndexOf.length, String.prototype.lastIndexOf.length ) ); + + array[item++] = new TestCase( SECTION, "var s = new String(''), s.lastIndexOf('', 0)", LastIndexOf("","",0), (s = new String(''), s.lastIndexOf('', 0) ) ); + array[item++] = new TestCase( SECTION, "var s = new String(''), s.lastIndexOf('')", LastIndexOf("",""), (s = new String(''), s.lastIndexOf('') ) ); + array[item++] = new TestCase( SECTION, "var s = new String('hello'), s.lastIndexOf('', 0)", LastIndexOf("hello","",0), (s = new String('hello'), s.lastIndexOf('',0) ) ); + array[item++] = new TestCase( SECTION, "var s = new String('hello'), s.lastIndexOf('')", LastIndexOf("hello",""), (s = new String('hello'), s.lastIndexOf('') ) ); + + array[item++] = new TestCase( SECTION, "var s = new String('hello'), s.lastIndexOf('ll')", LastIndexOf("hello","ll" ), (s = new String('hello'), s.lastIndexOf('ll') ) ); + array[item++] = new TestCase( SECTION, "var s = new String('hello'), s.lastIndexOf('ll', 0)", LastIndexOf("hello","ll",0), (s = new String('hello'), s.lastIndexOf('ll', 0) ) ); + array[item++] = new TestCase( SECTION, "var s = new String('hello'), s.lastIndexOf('ll', 1)", LastIndexOf("hello","ll",1), (s = new String('hello'), s.lastIndexOf('ll', 1) ) ); + array[item++] = new TestCase( SECTION, "var s = new String('hello'), s.lastIndexOf('ll', 2)", LastIndexOf("hello","ll",2), (s = new String('hello'), s.lastIndexOf('ll', 2) ) ); + array[item++] = new TestCase( SECTION, "var s = new String('hello'), s.lastIndexOf('ll', 3)", LastIndexOf("hello","ll",3), (s = new String('hello'), s.lastIndexOf('ll', 3) ) ); + array[item++] = new TestCase( SECTION, "var s = new String('hello'), s.lastIndexOf('ll', 4)", LastIndexOf("hello","ll",4), (s = new String('hello'), s.lastIndexOf('ll', 4) ) ); + array[item++] = new TestCase( SECTION, "var s = new String('hello'), s.lastIndexOf('ll', 5)", LastIndexOf("hello","ll",5), (s = new String('hello'), s.lastIndexOf('ll', 5) ) ); + array[item++] = new TestCase( SECTION, "var s = new String('hello'), s.lastIndexOf('ll', 6)", LastIndexOf("hello","ll",6), (s = new String('hello'), s.lastIndexOf('ll', 6) ) ); + + array[item++] = new TestCase( SECTION, "var s = new String('hello'), s.lastIndexOf('ll', 1.5)", LastIndexOf('hello','ll', 1.5), (s = new String('hello'), s.lastIndexOf('ll', 1.5) ) ); + array[item++] = new TestCase( SECTION, "var s = new String('hello'), s.lastIndexOf('ll', 2.5)", LastIndexOf('hello','ll', 2.5), (s = new String('hello'), s.lastIndexOf('ll', 2.5) ) ); + array[item++] = new TestCase( SECTION, "var s = new String('hello'), s.lastIndexOf('ll', -1)", LastIndexOf('hello','ll', -1), (s = new String('hello'), s.lastIndexOf('ll', -1) ) ); + array[item++] = new TestCase( SECTION, "var s = new String('hello'), s.lastIndexOf('ll', -1.5)",LastIndexOf('hello','ll', -1.5), (s = new String('hello'), s.lastIndexOf('ll', -1.5) ) ); + + + array[item++] = new TestCase( SECTION, "var s = new String('hello'), s.lastIndexOf('ll', -Infinity)", LastIndexOf("hello","ll",-Infinity), (s = new String('hello'), s.lastIndexOf('ll', -Infinity) ) ); + array[item++] = new TestCase( SECTION, "var s = new String('hello'), s.lastIndexOf('ll', Infinity)", LastIndexOf("hello","ll",Infinity), (s = new String('hello'), s.lastIndexOf('ll', Infinity) ) ); + array[item++] = new TestCase( SECTION, "var s = new String('hello'), s.lastIndexOf('ll', NaN)", LastIndexOf("hello","ll",NaN), (s = new String('hello'), s.lastIndexOf('ll', NaN) ) ); + array[item++] = new TestCase( SECTION, "var s = new String('hello'), s.lastIndexOf('ll', -0)", LastIndexOf("hello","ll",-0), (s = new String('hello'), s.lastIndexOf('ll', -0) ) ); + + for ( var i = 0; i < ( "[object Object]" ).length; i++ ) { + array[item++] = new TestCase( SECTION, + "var o = new Object(); o.lastIndexOf = String.prototype.lastIndexOf; o.lastIndexOf('b', "+ i + ")", + ( i < 2 ? -1 : ( i < 9 ? 2 : 9 )) , + (o = new Object(), o.lastIndexOf = String.prototype.lastIndexOf, o.lastIndexOf('b', i )) ); + } + + var origBooleanLastIndexOf = Boolean.prototype.lastIndexOf; + Boolean.prototype.lastIndexOf = String.prototype.lastIndexOf; + for ( var i = 0; i < 5; i ++ ) { + array[item++] = new TestCase( SECTION, + "var b = new Boolean(); b.lastIndexOf = String.prototype.lastIndexOf; b.lastIndexOf('l', "+ i + ")", + ( i < 2 ? -1 : 2 ), + (b = new Boolean(), b.lastIndexOf('l', i )) ); + } + + var origBooleanToString = Boolean.prototype.toString; + Boolean.prototype.toString=Object.prototype.toString; + for ( var i = 0; i < 5; i ++ ) { + array[item++] = new TestCase( SECTION, + "var b = new Boolean(); b.toString = Object.prototype.toString; b.lastIndexOf = String.prototype.lastIndexOf; b.lastIndexOf('o', "+ i + ")", + (-1), + (b = new Boolean(), b.lastIndexOf('o', i )) ); + } + + var origNumberLastIndexOf = Number.prototype.lastIndexOf; + Number.prototype.lastIndexOf=String.prototype.lastIndexOf; + for ( var i = 0; i < 9; i++ ) { + array[item++] = new TestCase( SECTION, + "var n = new Number(Infinity); n.lastIndexOf = String.prototype.lastIndexOf; n.lastIndexOf( 'i', " + i + " )", + ( i < 3 ? -1 : ( i < 5 ? 3 : 5 ) ), + (n = new Number(Infinity), n.lastIndexOf( 'i', i ) ) ); + } + var a = new Array( "abc","def","ghi","jkl","mno","pqr","stu","vwx","yz" ); + a.lastIndexOf = String.prototype.lastIndexOf; + + for ( var i = 0; i < (a.toString()).length; i++ ) { + array[item++] = new TestCase( SECTION, + "var a = new Array( 'abc','def','ghi','jkl','mno','pqr','stu','vwx','yz' ); a.lastIndexOf = String.prototype.lastIndexOf; a.lastIndexOf( ',mno,p', "+i+" )", + ( i < 15 ? -1 : 15 ), + (a.lastIndexOf( ',mno,p', i ) ) ); + } + + + var origMathLastIndexOf = Math.lastIndexOf; + for ( var i = 0; i < 15; i ++ ) { + array[item++] = new TestCase( SECTION, + "var m = Math; m.lastIndexOf = String.prototype.lastIndexOf; m.lastIndexOf('t', "+ i + ")", + ( i < 9 ? -1 : 9 ), + (m = Math, m.lastIndexOf = String.prototype.lastIndexOf, m.lastIndexOf('t', i)) ); + } + + + +/* + for ( var i = 0; i < 15; i++ ) { + array[item++] = new TestCase( SECTION, + "var d = new Date(); d.lastIndexOf = String.prototype.lastIndexOf; d.lastIndexOf( '0' )", + (d = new Date(), d.lastIndexOf = String.prototype.lastIndexOf, d.lastIndexOf( '0' )) + ) + } + +*/ + + //restore + Boolean.prototype.lastIndexOf = origBooleanLastIndexOf; + Boolean.prototype.toString = origBooleanToString; + Number.prototype.lastIndexOf = origNumberLastIndexOf; + + return array; +} + +function LastIndexOf( string, search, position ) { + string = String( string ); + search = String( search ); + + position = Number( position ) + + if ( isNaN( position ) ) { + position = Infinity; + } else { + position = ToInteger( position ); + } + + result5= string.length; + result6 = Math.min(Math.max(position, 0), result5); + result7 = search.length; + + if (result7 == 0) { + return Math.min(position, result5); + } + + result8 = -1; + + for ( k = 0; k <= result6; k++ ) { + if ( k+ result7 > result5 ) { + break; + } + for ( j = 0; j < result7; j++ ) { + if ( string.charAt(k+j) != search.charAt(j) ){ + break; + } else { + if ( j == result7 -1 ) { + result8 = k; + } + } + } + } + + return result8; +} +function ToInteger( n ) { + n = Number( n ); + if ( isNaN(n) ) { + return 0; + } + if ( Math.abs(n) == 0 || Math.abs(n) == Infinity ) { + return n; + } + + var sign = ( n < 0 ) ? -1 : 1; + + return ( sign * Math.floor(Math.abs(n)) ); +} diff --git a/mozilla/js/tamarin/test/ecma3/String/e15_5_4_7_3_rt.as b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_7_3_rt.as new file mode 100644 index 00000000000..7d624adb2b2 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_7_3_rt.as @@ -0,0 +1,189 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "15.5.4.7-3"; + var VERSION = "ECMA_2"; + startTest(); + var TITLE = "String.protoype.lastIndexOf"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + + var thisError="no error"; + var b = true; + try{ + b.__proto__.lastIndexOf = String.prototype.lastIndexOf; + b.lastIndexOf('r', 0 ); + }catch(e:Error){ + thisError=e.toString(); + }finally{ + array[item++] = new TestCase( SECTION, + "var b = true; b.__proto__.lastIndexOf = String.prototype.lastIndexOf; b.lastIndexOf('r', 0 )","ReferenceError: Error #1069" +,referenceError(thisError)); + } + + /* array[item++] = new TestCase( SECTION, + "var b = true; b.__proto__.lastIndexOf = String.prototype.lastIndexOf; b.lastIndexOf('r', 0 )", + -1, + (b = true, b.__proto__.lastIndexOf = String.prototype.lastIndexOf, b.lastIndexOf('r', 0 ) ) );*/ + + thisError="no error"; + var b = true; + try{ + b.__proto__.lastIndexOf = String.prototype.lastIndexOf; + b.lastIndexOf('r', 1 ); + }catch(e1:Error){ + thisError=e1.toString(); + }finally{ + array[item++] = new TestCase( SECTION, + "var b = true; b.__proto__.lastIndexOf = String.prototype.lastIndexOf; b.lastIndexOf('r', 1 )","ReferenceError: Error #1069" +,referenceError(thisError)); + } + + /* array[item++] = new TestCase( SECTION, + "var b = true; b.__proto__.lastIndexOf = String.prototype.lastIndexOf; b.lastIndexOf('r', 1 )", + 1, + (b = true, b.__proto__.lastIndexOf = String.prototype.lastIndexOf, b.lastIndexOf('r', 1 ) ) );*/ + + thisError="no error"; + var b = true; + try{ + b.__proto__.lastIndexOf = String.prototype.lastIndexOf; + b.lastIndexOf('r', 2 ); + }catch(e2:Error){ + thisError=e2.toString(); + }finally{ + array[item++] = new TestCase( SECTION, + "var b = true; b.__proto__.lastIndexOf = String.prototype.lastIndexOf; b.lastIndexOf('r', 2 )","ReferenceError: Error #1069" +,referenceError(thisError)); + } + + /* array[item++] = new TestCase( SECTION, + "var b = true; b.__proto__.lastIndexOf = String.prototype.lastIndexOf; b.lastIndexOf('r', 2 )", + 1, + (b = true, b.__proto__.lastIndexOf = String.prototype.lastIndexOf, b.lastIndexOf('r', 2 ) ) );*/ + + thisError="no error"; + var b = true; + try{ + b.__proto__.lastIndexOf = String.prototype.lastIndexOf; + b.lastIndexOf('r', 10 ); + }catch(e10:Error){ + thisError=e10.toString(); + }finally{ + array[item++] = new TestCase( SECTION, + "var b = true; b.__proto__.lastIndexOf = String.prototype.lastIndexOf; b.lastIndexOf('r', 10 )","ReferenceError: Error #1069" +,referenceError(thisError)); + } + + /*array[item++] = new TestCase( SECTION, + "var b = true; b.__proto__.lastIndexOf = String.prototype.lastIndexOf; b.lastIndexOf('r', 10 )", + 1, + (b = true, b.__proto__.lastIndexOf = String.prototype.lastIndexOf, b.lastIndexOf('r', 10 ) ) );*/ + thisError="no error"; + var b = true; + try{ + b.__proto__.lastIndexOf = String.prototype.lastIndexOf; + b.lastIndexOf('r' ); + }catch(e3:Error){ + thisError=e3.toString(); + }finally{ + array[item++] = new TestCase( SECTION, + "var b = true; b.__proto__.lastIndexOf = String.prototype.lastIndexOf; b.lastIndexOf('r')","ReferenceError: Error #1069" +,referenceError(thisError)); + } + + /*array[item++] = new TestCase( SECTION, + "var b = true; b.__proto__.lastIndexOf = String.prototype.lastIndexOf; b.lastIndexOf('r' )", + 1, + (b = true, b.__proto__.lastIndexOf = String.prototype.lastIndexOf, b.lastIndexOf('r' ) ) );*/ + + return array; +} + +function LastIndexOf( string, search, position ) { + string = String( string ); + search = String( search ); + + position = Number( position ) + + if ( isNaN( position ) ) { + position = Infinity; + } else { + position = ToInteger( position ); + } + + result5= string.length; + result6 = Math.min(Math.max(position, 0), result5); + result7 = search.length; + + if (result7 == 0) { + return Math.min(position, result5); + } + + result8 = -1; + + for ( k = 0; k <= result6; k++ ) { + if ( k+ result7 > result5 ) { + break; + } + for ( j = 0; j < result7; j++ ) { + if ( string.charAt(k+j) != search.charAt(j) ){ + break; + } else { + if ( j == result7 -1 ) { + result8 = k; + } + } + } + } + + return result8; +} +function ToInteger( n ) { + n = Number( n ); + if ( isNaN(n) ) { + return 0; + } + if ( Math.abs(n) == 0 || Math.abs(n) == Infinity ) { + return n; + } + + var sign = ( n < 0 ) ? -1 : 1; + + return ( sign * Math.floor(Math.abs(n)) ); +} diff --git a/mozilla/js/tamarin/test/ecma3/String/e15_5_4_8_1_rt.as b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_8_1_rt.as new file mode 100644 index 00000000000..4419264e830 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_8_1_rt.as @@ -0,0 +1,340 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.5.4.8-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "String.prototype.split"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "String.prototype.split.length", 2, String.prototype.split.length ); + array[item++] = new TestCase( SECTION, "delete String.prototype.split.length", false, delete String.prototype.split.length ); + array[item++] = new TestCase( SECTION, "delete String.prototype.split.length; String.prototype.split.length", 2, (delete String.prototype.split.length, String.prototype.split.length)); + + // test cases for when split is called with no arguments. + + // this is a string object + + array[item++] = new TestCase( SECTION, + "var s = new String('this is a string object'); typeof s.split()", + "object", + (s = new String('this is a string object'), typeof s.split() ) ); + + array[item++] = new TestCase( SECTION, + "var s = new String('this is a string object'); Array.prototype.getClass = Object.prototype.toString; (s.split()).getClass()", + "[object Array]", + (s = new String('this is a string object'), Array.prototype.getClass = Object.prototype.toString, (s.split()).getClass() ) ); + + array[item++] = new TestCase( SECTION, + "var s = new String('this is a string object'); s.split().length", + 1, + (s = new String('this is a string object'), s.split().length ) ); + + + array[item++] = new TestCase( SECTION, + "var s = new String('this is a string object'); s.split()[0]", + "this is a string object", + (s = new String('this is a string object'), s.split()[0] ) ); + + + // this is an object object + array[item++] = new TestCase( SECTION, + "var obj = new Object(); obj.split = String.prototype.split; typeof obj.split()", + "object", + (obj = new Object(), obj.split = String.prototype.split, typeof obj.split() ) ); + + array[item++] = new TestCase( SECTION, + "var obj = new Object(); obj.split = String.prototype.split; Array.prototype.getClass = Object.prototype.toString; obj.getClass()", + "[object Array]", + (obj = new Object(), obj.split = String.prototype.split, Array.prototype.getClass = Object.prototype.toString, obj.split().getClass() ) ); + + array[item++] = new TestCase( SECTION, + "var obj = new Object(); obj.split = String.prototype.split; obj.split().length", + 1, + (obj = new Object(), obj.split = String.prototype.split, obj.split().length ) ); + + array[item++] = new TestCase( SECTION, + "var obj = new Object(); obj.split = String.prototype.split; obj.split()[0]", + "[object Object]", + (obj = new Object(), obj.split = String.prototype.split, obj.split()[0] ) ); + + + + // this is a function object + array[item++] = new TestCase( SECTION, + "var obj = function() {}; obj.split = String.prototype.split; typeof obj.split()", + "object", + (obj = function() {}, obj.split = String.prototype.split, typeof obj.split() ) ); + + array[item++] = new TestCase( SECTION, + "var obj = function() {}; obj.split = String.prototype.split; Array.prototype.getClass = Object.prototype.toString; obj.getClass()", + "[object Array]", + (obj = function() {}, obj.split = String.prototype.split, Array.prototype.getClass = Object.prototype.toString, obj.split().getClass() ) ); + + array[item++] = new TestCase( SECTION, + "var obj = function() {}; obj.split = String.prototype.split; obj.split().length", + 1, + (obj = function() {}, obj.split = String.prototype.split, obj.split().length ) ); + + /* commenting out due to bug 175096 + array[item++] = new TestCase( SECTION, + "var obj = function() {}; obj.split = String.prototype.split; obj.toString = Object.prototype.toString; obj.split()[0]", + "[object Function]", + (obj = function() {}, obj.split = String.prototype.split, obj.toString = Object.prototype.toString, (obj.split()[0]).substring(0,16)+"]")); + */ + + // this is a number object + + thisError="no error"; + var obj = new Number(NaN); + try{ + + obj.split = String.prototype.split; + + }catch(e1:Error){ + thisError=e1.toString(); + }finally{//print(thisError); + array[item++] = new TestCase(SECTION,"var obj = new Number(NaN); obj.split = String.prototype.split; typeof obj.split()", +"ReferenceError: Error #1056",referenceError(thisError)); + } + + + + /* array[item++] = new TestCase( SECTION, + "var obj = new Number(NaN); obj.split = String.prototype.split; typeof obj.split()", + "object", + (obj = new Number(NaN), obj.split = String.prototype.split, typeof obj.split() ) );*/ + + thisError="no error"; + var obj = new Number(NaN); + try{ + + obj.split = String.prototype.split; + Array.prototype.getClass = Object.prototype.toString; + obj.getClass(); + }catch(e2:Error){ + thisError=e2.toString(); + }finally{//print(thisError); + array[item++] = new TestCase(SECTION,"var obj = new Number(Infinity); obj.split = String.prototype.split; Array.prototype.getClass = Object.prototype.toString; obj.getClass()", +"ReferenceError: Error #1056",referenceError(thisError)); + } + + /* array[item++] = new TestCase( SECTION, + "var obj = new Number(Infinity); obj.split = String.prototype.split; Array.prototype.getClass = Object.prototype.toString; obj.getClass()", + "[object Array]", + (obj = new Number(Infinity), obj.split = String.prototype.split, Array.prototype.getClass = Object.prototype.toString, obj.split().getClass() ) );*/ + + thisError="no error"; + var obj = new Number(-1234567890); + try{ + obj.split = String.prototype.split; + obj.split().length; + }catch(e3:Error){ + thisError=e3.toString(); + }finally{//print(thisError); + array[item++] = new TestCase(SECTION,"var obj = new Number(-1234567890); obj.split = String.prototype.split; obj.split().length","ReferenceError: Error #1056",referenceError(thisError)); + } + + + /*array[item++] = new TestCase( SECTION, + "var obj = new Number(-1234567890); obj.split = String.prototype.split; obj.split().length", + 1, + (obj = new Number(-1234567890), obj.split = String.prototype.split, obj.split().length ) );*/ + + thisError="no error"; + var obj = new Number(-1e21); + try{ + obj.split = String.prototype.split; + obj.split()[0]; + }catch(e4:Error){ + thisError=e4.toString(); + }finally{//print(thisError); + array[item++] = new TestCase(SECTION,"var obj = new Number(-1e21); obj.split = String.prototype.split; obj.split()[0]","ReferenceError: Error #1056",referenceError(thisError)); + } + + /*array[item++] = new TestCase( SECTION, + "var obj = new Number(-1e21); obj.split = String.prototype.split; obj.split()[0]", + "-1e+21", + (obj = new Number(-1e21), obj.split = String.prototype.split, obj.split()[0] ) );*/ + + + // this is the Math object + + array[item++] = new TestCase( SECTION, + "var obj = Math; obj.split = String.prototype.split; typeof obj.split()", + "object", + (obj = Math, obj.split = String.prototype.split, typeof obj.split() ) ); + + thisError="no error"; + var obj = Math; + try{ + obj.split = String.prototype.split; + Array.prototype.getClass = Object.prototype.toString; + obj.getClass(); + }catch(e6:Error){ + thisError=e6.toString(); + }finally{ + array[item++] = new TestCase(SECTION,"var obj = Math; obj.split = String.prototype.split;Array.prototype.getClass = Object.prototype.toString; obj.getClass()","TypeError: Error #1006",typeError(thisError)); + } + + /* array[item++] = new TestCase( SECTION, + "var obj = Math; obj.split = String.prototype.split; Array.prototype.getClass = Object.prototype.toString; obj.getClass()", + "[object Array]", + (obj = Math, obj.split = String.prototype.split, Array.prototype.getClass = Object.prototype.toString, obj.split().getClass() ) );*/ + + array[item++] = new TestCase( SECTION, + "var obj = Math; obj.split = String.prototype.split; obj.split().length", + 1, + (obj = Math, obj.split = String.prototype.split, obj.split().length ) ); + + array[item++] = new TestCase( SECTION, + "var obj = Math; obj.split = String.prototype.split; obj.split()[0]", + "[class Math]", + (obj = Math, obj.split = String.prototype.split, obj.split()[0] ) ); + + // this is an array object + array[item++] = new TestCase( SECTION, + "var obj = new Array(1,2,3,4,5); obj.split = String.prototype.split; typeof obj.split()", + "object", + (obj = new Array(1,2,3,4,5), obj.split = String.prototype.split, typeof obj.split() ) ); + + array[item++] = new TestCase( SECTION, + "var obj = new Array(1,2,3,4,5); obj.split = String.prototype.split; Array.prototype.getClass = Object.prototype.toString; obj.getClass()", + "[object Array]", + (obj = new Array(1,2,3,4,5), obj.split = String.prototype.split, Array.prototype.getClass = Object.prototype.toString, obj.split().getClass() ) ); + + array[item++] = new TestCase( SECTION, + "var obj = new Array(1,2,3,4,5); obj.split = String.prototype.split; obj.split().length", + 1, + (obj = new Array(1,2,3,4,5), obj.split = String.prototype.split, obj.split().length ) ); + + array[item++] = new TestCase( SECTION, + "var obj = new Array(1,2,3,4,5); obj.split = String.prototype.split; obj.split()[0]", + "1,2,3,4,5", + (obj = new Array(1,2,3,4,5), obj.split = String.prototype.split, obj.split()[0] ) ); + + // this is a Boolean object + + thisError="no error"; + var obj = new Boolean(); + try{ + + obj.split = String.prototype.split; + + }catch(e9:Error){ + thisError=e9.toString(); + }finally{//print(thisError); + array[item++] = new TestCase(SECTION,"var obj = new Boolean(); obj.split = String.prototype.split; typeof obj.split()", +"ReferenceError: Error #1056",referenceError(thisError)); + } + + + + /* array[item++] = new TestCase( SECTION, + "var obj = new Boolean(); obj.split = String.prototype.split; typeof obj.split()", + "object", + (obj = new Boolean(), obj.split = String.prototype.split, typeof obj.split() ) );*/ + + thisError="no error"; + var obj = new Boolean(); + try{ + + obj.split = String.prototype.split; + Array.prototype.getClass = Object.prototype.toString; + obj.getClass(); + + }catch(e10:Error){ + thisError=e10.toString(); + }finally{//print(thisError); + array[item++] = new TestCase(SECTION,"var obj = new Boolean(); obj.split = String.prototype.split; Array.prototype.getClass = Object.prototype.toString; obj.getClass()", +"ReferenceError: Error #1056",referenceError(thisError)); + } + + + /* array[item++] = new TestCase( SECTION, + "var obj = new Boolean(); obj.split = String.prototype.split; Array.prototype.getClass = Object.prototype.toString; obj.getClass()", + "[object Array]", + (obj = new Boolean(), obj.split = String.prototype.split, Array.prototype.getClass = Object.prototype.toString, obj.split().getClass() ) );*/ + + thisError="no error"; + var obj = new Boolean(); + try{ + + obj.split = String.prototype.split; + obj.split().length; + + + }catch(e11:Error){ + thisError=e11.toString(); + }finally{//print(thisError); + array[item++] = new TestCase(SECTION,"var obj = new Boolean(); obj.split = String.prototype.split;obj.split().length", +"ReferenceError: Error #1056",referenceError(thisError)); + } + + /* array[item++] = new TestCase( SECTION, + "var obj = new Boolean(); obj.split = String.prototype.split; obj.split().length", + 1, + (obj = new Boolean(), obj.split = String.prototype.split, obj.split().length ) );*/ + + thisError="no error"; + var obj = new Boolean(); + try{ + + obj.split = String.prototype.split; + obj.split()[0]; + + + }catch(e12:Error){ + thisError=e12.toString(); + }finally{//print(thisError); + array[item++] = new TestCase(SECTION,"var obj = new Boolean(); obj.split = String.prototype.split;obj.split()[0]", +"ReferenceError: Error #1056",referenceError(thisError)); + } + + /*array[item++] = new TestCase( SECTION, + "var obj = new Boolean(); obj.split = String.prototype.split; obj.split()[0]", + "false", + (obj = new Boolean(), obj.split = String.prototype.split, obj.split()[0] ) );*/ + + + //delete extra property created + delete Array.prototype.getClass; + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/String/e15_5_4_8_2.as b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_8_2.as new file mode 100644 index 00000000000..2d85fccb3f6 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_8_2.as @@ -0,0 +1,189 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.5.4.8-2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "String.prototype.split"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // case where separator is the empty string. + + var TEST_STRING = "this is a string object"; + + array[item++] = new TestCase( SECTION, + "var s = new String( "+ TEST_STRING +" ); s.split('').length", + TEST_STRING.length, + (s = new String( TEST_STRING ), s.split('').length ) ); + + for ( var i = 0; i < TEST_STRING.length; i++ ) { + + array[item++] = new TestCase( SECTION, + "var s = new String( "+TEST_STRING+" ); s.split('')["+i+"]", + TEST_STRING.charAt(i), + (s = new String( TEST_STRING ), s.split('')[i]) ); + } + + // case where the value of the separator is undefined. in this case. the value of the separator + // should be ToString( separator ), or "undefined". + + var TEST_STRING = "thisundefinedisundefinedaundefinedstringundefinedobject"; + var EXPECT_STRING = new Array( "this", "is", "a", "string", "object" ); + + array[item++] = new TestCase( SECTION, + "var s = new String( "+ TEST_STRING +" ); s.split(void 0).length", + EXPECT_STRING.length, + (s = new String( TEST_STRING ), s.split(void 0).length ) ); + + for ( var i = 0; i < EXPECT_STRING.length; i++ ) { + array[item++] = new TestCase( SECTION, + "var s = new String( "+TEST_STRING+" ); s.split(void 0)["+i+"]", + EXPECT_STRING[i], + (s = new String( TEST_STRING ), s.split(void 0)[i]) ); + } + + // case where the value of the separator is null. in this case the value of the separator is "null". + TEST_STRING = "thisnullisnullanullstringnullobject"; + var EXPECT_STRING = new Array( "this", "is", "a", "string", "object" ); + + array[item++] = new TestCase( SECTION, + "var s = new String( "+ TEST_STRING +" ); s.split(null).length", + EXPECT_STRING.length, + (s = new String( TEST_STRING ), s.split(null).length ) ); + + for ( var i = 0; i < EXPECT_STRING.length; i++ ) { + array[item++] = new TestCase( SECTION, + "var s = new String( "+TEST_STRING+" ); s.split(null)["+i+"]", + EXPECT_STRING[i], + (s = new String( TEST_STRING ), s.split(null)[i]) ); + } + + // case where the value of the separator is a boolean. + TEST_STRING = "thistrueistrueatruestringtrueobject"; + var EXPECT_STRING = new Array( "this", "is", "a", "string", "object" ); + + array[item++] = new TestCase( SECTION, + "var s = new String( "+ TEST_STRING +" ); s.split(true).length", + EXPECT_STRING.length, + (s = new String( TEST_STRING ), s.split(true).length ) ); + + for ( var i = 0; i < EXPECT_STRING.length; i++ ) { + array[item++] = new TestCase( SECTION, + "var s = new String( "+TEST_STRING+" ); s.split(true)["+i+"]", + EXPECT_STRING[i], + (s = new String( TEST_STRING ), s.split(true)[i]) ); + } + + // case where the value of the separator is a number + TEST_STRING = "this123is123a123string123object"; + var EXPECT_STRING = new Array( "this", "is", "a", "string", "object" ); + + array[item++] = new TestCase( SECTION, + "var s = new String( "+ TEST_STRING +" ); s.split(123).length", + EXPECT_STRING.length, + (s = new String( TEST_STRING ), s.split(123).length ) ); + + for ( var i = 0; i < EXPECT_STRING.length; i++ ) { + array[item++] = new TestCase( SECTION, + "var s = new String( "+TEST_STRING+" ); s.split(123)["+i+"]", + EXPECT_STRING[i], + (s = new String( TEST_STRING ), s.split(123)[i]) ); + } + + + // case where the value of the separator is a number + TEST_STRING = "this123is123a123string123object"; + var EXPECT_STRING = new Array( "this", "is", "a", "string", "object" ); + + array[item++] = new TestCase( SECTION, + "var s = new String( "+ TEST_STRING +" ); s.split(123).length", + EXPECT_STRING.length, + (s = new String( TEST_STRING ), s.split(123).length ) ); + + for ( var i = 0; i < EXPECT_STRING.length; i++ ) { + array[item++] = new TestCase( SECTION, + "var s = new String( "+TEST_STRING+" ); s.split(123)["+i+"]", + EXPECT_STRING[i], + (s = new String( TEST_STRING ), s.split(123)[i]) ); + } + + // case where the separator is not in the string + TEST_STRING = "this is a string"; + EXPECT_STRING = new Array( "this is a string" ); + + array[item++] = new TestCase( SECTION, + "var s = new String( " + TEST_STRING + " ); s.split(':').length", + 1, + (s = new String( TEST_STRING ), s.split(':').length ) ); + + array[item++] = new TestCase( SECTION, + "var s = new String( " + TEST_STRING + " ); s.split(':')[0]", + TEST_STRING, + (s = new String( TEST_STRING ), s.split(':')[0] ) ); + + // case where part but not all of separator is in the string. + TEST_STRING = "this is a string"; + EXPECT_STRING = new Array( "this is a string" ); + array[item++] = new TestCase( SECTION, + "var s = new String( " + TEST_STRING + " ); s.split('strings').length", + 1, + (s = new String( TEST_STRING ), s.split('strings').length ) ); + + array[item++] = new TestCase( SECTION, + "var s = new String( " + TEST_STRING + " ); s.split('strings')[0]", + TEST_STRING, + (s = new String( TEST_STRING ), s.split('strings')[0] ) ); + + // case where the separator is at the end of the string + TEST_STRING = "this is a string"; + EXPECT_STRING = new Array( "this is a " ); + array[item++] = new TestCase( SECTION, + "var s = new String( " + TEST_STRING + " ); s.split('string').length", + 2, + (s = new String( TEST_STRING ), s.split('string').length ) ); + + for ( var i = 0; i < EXPECT_STRING.length; i++ ) { + array[item++] = new TestCase( SECTION, + "var s = new String( "+TEST_STRING+" ); s.split('string')["+i+"]", + EXPECT_STRING[i], + (s = new String( TEST_STRING ), s.split('string')[i]) ); + } + return array; +} + diff --git a/mozilla/js/tamarin/test/ecma3/String/e15_5_4_8_3.as b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_8_3.as new file mode 100644 index 00000000000..0aa4c939d20 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_8_3.as @@ -0,0 +1,146 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.5.4.8-3"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "String.prototype.split"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TEST_STRING = ""; + var EXPECT = new Array(); + + // this.toString is the empty string. + + array[item++] = new TestCase( SECTION, + "var s = new String(); s.split().length", + 1, + (s = new String(), s.split().length ) ); + + array[item++] = new TestCase( SECTION, + "var s = new String(); s.split()[0]", + "", + (s = new String(), s.split()[0] ) ); + + // this.toString() is the empty string, separator is specified. + + array[item++] = new TestCase( SECTION, + "var s = new String(); s.split('').length", + 1, + (s = new String(), s.split('').length ) ); + + array[item++] = new TestCase( SECTION, + "var s = new String(); s.split(' ').length", + 1, + (s = new String(), s.split(' ').length ) ); + + // this to string is " " + array[item++] = new TestCase( SECTION, + "var s = new String(' '); s.split().length", + 1, + (s = new String(' '), s.split().length ) ); + + array[item++] = new TestCase( SECTION, + "var s = new String(' '); s.split()[0]", + " ", + (s = new String(' '), s.split()[0] ) ); + + array[item++] = new TestCase( SECTION, + "var s = new String(' '); s.split('').length", + 1, + (s = new String(' '), s.split('').length ) ); + + array[item++] = new TestCase( SECTION, + "var s = new String(' '); s.split('')[0]", + " ", + (s = new String(' '), s.split('')[0] ) ); + + array[item++] = new TestCase( SECTION, + "var s = new String(' '); s.split(' ').length", + 2, + (s = new String(' '), s.split(' ').length ) ); + + array[item++] = new TestCase( SECTION, + "var s = new String(' '); s.split(' ')[0]", + "", + (s = new String(' '), s.split(' ')[0] ) ); + + array[item++] = new TestCase( SECTION, + "\"\".split(\"\").length", + 1, + ("".split("")).length ); + + array[item++] = new TestCase( SECTION, + "\"\".split(\"x\").length", + 1, + ("".split("x")).length ); + + array[item++] = new TestCase( SECTION, + "\"\".split(\"x\")[0]", + "", + ("".split("x"))[0] ); + + return array; +} + +function Split( string, separator ) { + string = String( string ); + + var A = new Array(); + + if ( arguments.length < 2 ) { + A[0] = string; + return A; + } + + separator = String( separator ); + + var str_len = String( string ).length; + var sep_len = String( separator ).length; + + var p = 0; + var k = 0; + + if ( sep_len == 0 ) { + for ( ; p < str_len; p++ ) { + A[A.length] = String( string.charAt(p) ); + } + } + return A; +} diff --git a/mozilla/js/tamarin/test/ecma3/String/e15_5_4_9_1_rt.as b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_9_1_rt.as new file mode 100644 index 00000000000..81a9bdc8954 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/e15_5_4_9_1_rt.as @@ -0,0 +1,206 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.5.4.9-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "String.prototype.substring( start )"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "String.prototype.substring.length", 2, String.prototype.substring.length ); + array[item++] = new TestCase( SECTION, "delete String.prototype.substring.length", false, delete String.prototype.substring.length ); + array[item++] = new TestCase( SECTION, "delete String.prototype.substring.length; String.prototype.substring.length", 2, (delete String.prototype.substring.length, String.prototype.substring.length) ); + + // test cases for when substring is called with no arguments. + + // this is a string object + + array[item++] = new TestCase( SECTION, + "var s = new String('this is a string object'); typeof s.substring()", + "string", + (s = new String('this is a string object'), typeof s.substring() ) ); + + array[item++] = new TestCase( SECTION, + "var s = new String(''); s.substring()", + "", + (s = new String(''), s.substring() ) ); + + + array[item++] = new TestCase( SECTION, + "var s = new String('this is a string object'); s.substring()", + "this is a string object", + (s = new String('this is a string object'), s.substring() ) ); + + array[item++] = new TestCase( SECTION, + "var s = new String('this is a string object'); s.substring(NaN)", + "this is a string object", + (s = new String('this is a string object'), s.substring(NaN) ) ); + + + array[item++] = new TestCase( SECTION, + "var s = new String('this is a string object'); s.substring(-0.01)", + "this is a string object", + (s = new String('this is a string object'), s.substring(-0.01) ) ); + + + array[item++] = new TestCase( SECTION, + "var s = new String('this is a string object'); s.substring(s.length)", + "", + (s = new String('this is a string object'), s.substring(s.length) ) ); + + array[item++] = new TestCase( SECTION, + "var s = new String('this is a string object'); s.substring(s.length+1)", + "", + (s = new String('this is a string object'), s.substring(s.length+1) ) ); + + + array[item++] = new TestCase( SECTION, + "var s = new String('this is a string object'); s.substring(Infinity)", + "", + (s = new String('this is a string object'), s.substring(Infinity) ) ); + + array[item++] = new TestCase( SECTION, + "var s = new String('this is a string object'); s.substring(-Infinity)", + "this is a string object", + (s = new String('this is a string object'), s.substring(-Infinity) ) ); + + // this is not a String object, start is not an integer + + + array[item++] = new TestCase( SECTION, + "var s = new Array(1,2,3,4,5); s.substring = String.prototype.substring; s.substring()", + "1,2,3,4,5", + (s = new Array(1,2,3,4,5), s.substring = String.prototype.substring, s.substring() ) ); + + array[item++] = new TestCase( SECTION, + "var s = new Array(1,2,3,4,5); s.substring = String.prototype.substring; s.substring(true)", + ",2,3,4,5", + (s = new Array(1,2,3,4,5), s.substring = String.prototype.substring, s.substring(true) ) ); + + array[item++] = new TestCase( SECTION, + "var s = new Array(1,2,3,4,5); s.substring = String.prototype.substring; s.substring('4')", + "3,4,5", + (s = new Array(1,2,3,4,5), s.substring = String.prototype.substring, s.substring('4') ) ); + + array[item++] = new TestCase( SECTION, + "var s = new Array(); s.substring = String.prototype.substring; s.substring('4')", + "", + (s = new Array(), s.substring = String.prototype.substring, s.substring('4') ) ); + + // this is an object object + array[item++] = new TestCase( SECTION, + "var obj = new Object(); obj.substring = String.prototype.substring; obj.substring(8)", + "Object]", + (obj = new Object(), obj.substring = String.prototype.substring, obj.substring(8) ) ); + + // this is a function object + + // work around for bug 175820 + var expRes = "Function-2]"; + if( !Capabilities.isDebugger ) + expRes = "null]"; + + array[item++] = new TestCase( SECTION, + "var obj = function() {}; obj.substring = String.prototype.substring; obj.toString = Object.prototype.toString; obj.substring(8)", + expRes, + (obj = function() {}, obj.substring = String.prototype.substring, obj.toString = Object.prototype.toString, obj.substring(8) ) ); + // this is a number object + + thisError="no error"; + try{ + var obj = new Number(NaN); + obj.substring = String.prototype.substring; + obj.substring(false); + }catch(e1:Error){ + thisError=e1.toString(); + }finally{ + array[item++] = new TestCase( SECTION, + "var obj = new Number(NaN); obj.substring = String.prototype.substring; obj.substring(false)", + "ReferenceError: Error #1056",referenceError(thisError) + ); + } + /* array[item++] = new TestCase( SECTION, + "var obj = new Number(NaN); obj.substring = String.prototype.substring; obj.substring(false)", + "NaN", + (obj = new Number(NaN), obj.substring = String.prototype.substring, obj.substring(false) ) );*/ + + + // this is the Math object + array[item++] = new TestCase( SECTION, + "var obj = Math; obj.substring = String.prototype.substring; obj.substring(Math.PI)", + "ass Math]", + (obj = Math, obj.substring = String.prototype.substring, obj.substring(Math.PI) ) ); + + // this is a Boolean object + + thisError="no error"; + try{ + var obj = new Boolean(); + obj.substring = String.prototype.substring; + obj.substring(new Array()); + }catch(e3:Error){ + thisError=e3.toString(); + }finally{ + array[item++] = new TestCase( SECTION, + "var obj = new Boolean(); obj.substring = String.prototype.substring; obj.substring(new Array())", + "ReferenceError: Error #1056",referenceError(thisError) + ); + } + + /*array[item++] = new TestCase( SECTION, + "var obj = new Boolean(); obj.substring = String.prototype.substring; obj.substring(new Array())", + "false", + (obj = new Boolean(), obj.substring = String.prototype.substring, obj.substring(new Array()) ) );*/ + + // this is a user defined object + + + + array[item++] = new TestCase( SECTION, + "var obj = new MyObject( null ); obj.substring(0)", + "null", + (obj = new MyObject( null ), obj.substring(0) ) ); + + return array; +} +function MyObject( value ) { + this.value = value; + this.substring = String.prototype.substring; + this.toString = function () { return this.value+'' } +} diff --git a/mozilla/js/tamarin/test/ecma3/String/e15_5_5_1.as b/mozilla/js/tamarin/test/ecma3/String/e15_5_5_1.as new file mode 100644 index 00000000000..0525d0ad8cc --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/e15_5_5_1.as @@ -0,0 +1,132 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.5.5.1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "String.length"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + var thisError:String="no error"; + var s:String = new String(); + try{ + s.length=10; + }catch(e:ReferenceError){ + thisError=e.toString(); + }finally{ + array[item++]=new TestCase(SECTION,"var s= new String();s.length=10","ReferenceError: Error #1074",referenceError(thisError)); + } + + array[item++] = new TestCase( SECTION, + "var s = new String(); s.length", + 0, + (s.length ) ); + + + + + + var s = new String(); + var props = ''; + for ( var p in s ) + { + props += p; + } + + array[item++] = new TestCase( SECTION, + "var s = new String(); var props = ''; for ( var p in s ) { props += p; }; props", + '', + s); + + + var thisError = "no error" + s = new String(); + try{ + delete s.length; + }catch(e1:ReferenceError){ + thisError = e1.toString(); + } + array[item++] = new TestCase( SECTION, + "var s = new String(); delete s.length", + "ReferenceError: Error #1120", + referenceError(thisError) ); + + + array[item++] = new TestCase( SECTION, + "var s = new String(); delete s.length", + 0, + (s = new String(), s.length ) ); + s = new String('hello'); + try{ + delete s.length; + }catch(e2:ReferenceError){ + thisError = e2.toString(); + } + array[item++] = new TestCase( SECTION, + "var s = new String('hello'); delete s.length", + "ReferenceError: Error #1120", + referenceError(thisError) ); + + array[item++] = new TestCase( SECTION, + "var s = new String('hello'); delete s.length; s.length", + 5, + ( s.length ) ); + s='abcdefghijklmnopqrstuvwxyz'; + + array[item++] = new TestCase( SECTION, + "delete s.length", + "ReferenceError: Error #1120", + referenceError(thisError) ); + try{ + s.length=10; + }catch(e:ReferenceError){ + thisError=e.toString(); + }finally{ + array[item++]=new TestCase(SECTION,"var s= new String();s.length=10","ReferenceError: Error #1074",referenceError(thisError)); + } + + array[item++] = new TestCase( SECTION, + "var s = new String('hello');s='abcdefghijklmnopqrstuvwxyz'; delete s.length; s.length", + 26, + ( s.length ) ); + + + + return array; + +} diff --git a/mozilla/js/tamarin/test/ecma3/String/ematch_001.as b/mozilla/js/tamarin/test/ecma3/String/ematch_001.as new file mode 100644 index 00000000000..4fcac84e71c --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/ematch_001.as @@ -0,0 +1,130 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +/* + * String.match( regexp ) + * + * If regexp is not an object of type RegExp, it is replaced with result + * of the expression new RegExp(regexp). Let string denote the result of + * converting the this value to a string. If regexp.global is false, + * return the result obtained by invoking RegExp.prototype.exec (see + * section 15.7.5.3) on regexp with string as parameter. + * + * Otherwise, set the regexp.lastIndex property to 0 and invoke + * RegExp.prototype.exec repeatedly until there is no match. If there is a + * match with an empty string (in other words, if the value of + * regexp.lastIndex is left unchanged) increment regexp.lastIndex by 1. + * The value returned is an array with the properties 0 through n-1 + * corresponding to the first element of the result of each matching + * invocation of RegExp.prototype.exec. + * + * Note that the match function is intentionally generic; it does not + * require that its this value be a string object. Therefore, it can be + * transferred to other kinds of objects for use as a method. + */ + + var SECTION = "String/match-001.js"; + var VERSION = "ECMA_2"; + var TITLE = "String.prototype.match( regexp )"; + + startTest(); + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // the regexp argument is not a RegExp object + // this is not a string object + + // cases in which the regexp global property is false + +// AddRegExpCases( 3, "3", "1234567890", 1, 2, ["3"] ); + + // cases in which the regexp object global property is true + + AddGlobalRegExpCases( /34/g, "/34/g", "343443444", 3, ["34", "34", "34"] ); + AddGlobalRegExpCases( /\d{1}/g, "/d{1}/g", "123456abcde7890", 10, + ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"] ); + + AddGlobalRegExpCases( /\d{2}/g, "/d{2}/g", "123456abcde7890", 5, + ["12", "34", "56", "78", "90"] ); + + AddGlobalRegExpCases( /\D{2}/g, "/d{2}/g", "123456abcde7890", 2, + ["ab", "cd"] ); + + + function AddRegExpCases( + regexp, str_regexp, string, length, index, matches_array ) { + + array[item++] = new TestCase(SECTION, + "( " + string + " ).match(" + str_regexp +").length", + length, + string.match(regexp).length ); + + array[item++] = new TestCase(SECTION, + "( " + string + " ).match(" + str_regexp +").index", + index, + string.match(regexp).index ); + + array[item++] = new TestCase(SECTION, + "( " + string + " ).match(" + str_regexp +").input", + string, + string.match(regexp).input ); + + for ( var matches = 0; matches < matches_array.length; matches++ ) { + array[item++] = new TestCase(SECTION, + "( " + string + " ).match(" + str_regexp +")[" + matches +"]", + matches_array[matches], + string.match(regexp)[matches] ); + } + } + + function AddGlobalRegExpCases( + regexp, str_regexp, string, length, matches_array ) { + + array[item++] = new TestCase(SECTION, + "( " + string + " ).match(" + str_regexp +").length", + length, + string.match(regexp).length ); + + for ( var matches = 0; matches < matches_array.length; matches++ ) { + // adding toString on result... this is ok since we now distinguish + // between string and object. + array[item++] = new TestCase(SECTION, + "( " + string + " ).match(" + str_regexp +")[" + matches +"]", + matches_array[matches], + string.match(regexp)[matches].toString() ); + } + } + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/String/ematch_002.as b/mozilla/js/tamarin/test/ecma3/String/ematch_002.as new file mode 100644 index 00000000000..64ddd80654b --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/ematch_002.as @@ -0,0 +1,197 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +/* + * String.match( regexp ) + * + * If regexp is not an object of type RegExp, it is replaced with result + * of the expression new RegExp(regexp). Let string denote the result of + * converting the this value to a string. If regexp.global is false, + * return the result obtained by invoking RegExp.prototype.exec (see + * section 15.7.5.3) on regexp with string as parameter. + * + * Otherwise, set the regexp.lastIndex property to 0 and invoke + * RegExp.prototype.exec repeatedly until there is no match. If there is a + * match with an empty string (in other words, if the value of + * regexp.lastIndex is left unchanged) increment regexp.lastIndex by 1. + * The value returned is an array with the properties 0 through n-1 + * corresponding to the first element of the result of each matching + * invocation of RegExp.prototype.exec. + * + * Note that the match function is intentionally generic; it does not + * require that its this value be a string object. Therefore, it can be + * transferred to other kinds of objects for use as a method. + * + * This file tests cases in which regexp.global is false. Therefore, + * results should behave as regexp.exec with string passed as a parameter. + * + */ + + var SECTION = "String/match-002.js"; + var VERSION = "ECMA_2"; + var TITLE = "String.prototype.match( regexp )"; + + startTest(); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // the regexp argument is not a RegExp object + // this is not a string object + + AddRegExpCases( /([\d]{5})([-\ ]?[\d]{4})?$/, + "/([\d]{5})([-\ ]?[\d]{4})?$/", + "Boston, Mass. 02134", + 14, + ["02134", "02134", undefined]); + + AddGlobalRegExpCases( /([\d]{5})([-\ ]?[\d]{4})?$/g, + "/([\d]{5})([-\ ]?[\d]{4})?$/g", + "Boston, Mass. 02134", + ["02134"]); + + // set the value of lastIndex + re = /([\d]{5})([-\ ]?[\d]{4})?$/; + re.lastIndex = 0; + + s = "Boston, MA 02134"; + + AddRegExpCases( re, + "re = /([\d]{5})([-\ ]?[\d]{4})?$/; re.lastIndex =0", + s, + s.lastIndexOf("0"), + ["02134", "02134", undefined]); + + + re.lastIndex = s.length; + + AddRegExpCases( re, + "re = /([\d]{5})([-\ ]?[\d]{4})?$/; re.lastIndex = " + + s.length, + s, + s.lastIndexOf("0"), + ["02134", "02134", undefined] ); + + re.lastIndex = s.lastIndexOf("0"); + + AddRegExpCases( re, + "re = /([\d]{5})([-\ ]?[\d]{4})?$/; re.lastIndex = " + + s.lastIndexOf("0"), + s, + s.lastIndexOf("0"), + ["02134", "02134", undefined]); + + re.lastIndex = s.lastIndexOf("0") + 1; + + AddRegExpCases( re, + "re = /([\d]{5})([-\ ]?[\d]{4})?$/; re.lastIndex = " + + s.lastIndexOf("0") +1, + s, + s.lastIndexOf("0"), + ["02134", "02134", undefined]); + + + function AddRegExpCases( + regexp, str_regexp, string, index, matches_array ) { + + // prevent a runtime error + if ( regexp.exec(string) == null || matches_array == null ) { + array[item++] = new TestCase(SECTION, + string + ".match(" + regexp +")", + matches_array, + string.match(regexp) ); + + return; + } + + array[item++] = new TestCase(SECTION, + "( " + string + " ).match(" + str_regexp +").length", + matches_array.length, + string.match(regexp).length ); + + array[item++] = new TestCase(SECTION, + "( " + string + " ).match(" + str_regexp +").index", + index, + string.match(regexp).index ); + + array[item++] = new TestCase(SECTION, + "( " + string + " ).match(" + str_regexp +").input", + string, + string.match(regexp).input ); + + var limit = matches_array.length > string.match(regexp).length ? + matches_array.length : + string.match(regexp).length; + + for ( var matches = 0; matches < limit; matches++ ) { + array[item++] = new TestCase(SECTION, + "( " + string + " ).match(" + str_regexp +")[" + matches +"]", + matches_array[matches], + string.match(regexp)[matches] ); + } + } + + function AddGlobalRegExpCases( + regexp, str_regexp, string, matches_array ) { + + // prevent a runtime error + + if ( regexp.exec(string) == null || matches_array == null ) { + array[item++] = new TestCase(SECTION, + regexp + ".exec(" + string +")", + matches_array, + regexp.exec(string) ); + + return; + } + + array[item++] = new TestCase(SECTION, + "( " + string + " ).match(" + str_regexp +").length", + matches_array.length, + string.match(regexp).length ); + + var limit = matches_array.length > string.match(regexp).length ? + matches_array.length : + string.match(regexp).length; + + for ( var matches = 0; matches < limit; matches++ ) { + array[item++] = new TestCase(SECTION, + "( " + string + " ).match(" + str_regexp +")[" + matches +"]", + matches_array[matches], + string.match(regexp)[matches] ); + } + } + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/String/ematch_003.as b/mozilla/js/tamarin/test/ecma3/String/ematch_003.as new file mode 100644 index 00000000000..1d9ca05e2fb --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/ematch_003.as @@ -0,0 +1,156 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +/* + * String.match( regexp ) + * + * If regexp is not an object of type RegExp, it is replaced with result + * of the expression new RegExp(regexp). Let string denote the result of + * converting the this value to a string. If regexp.global is false, + * return the result obtained by invoking RegExp.prototype.exec (see + * section 15.7.5.3) on regexp with string as parameter. + * + * Otherwise, set the regexp.lastIndex property to 0 and invoke + * RegExp.prototype.exec repeatedly until there is no match. If there is a + * match with an empty string (in other words, if the value of + * regexp.lastIndex is left unchanged) increment regexp.lastIndex by 1. + * The value returned is an array with the properties 0 through n-1 + * corresponding to the first element of the result of each matching + * invocation of RegExp.prototype.exec. + * + * Note that the match function is intentionally generic; it does not + * require that its this value be a string object. Therefore, it can be + * transferred to other kinds of objects for use as a method. + */ + + var SECTION = "String/match-003.js"; + var VERSION = "ECMA_2"; + var TITLE = "String.prototype.match( regexp )"; + + startTest(); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // the regexp argument is not a RegExp object + // this is not a string object + + +// [if regexp.global is true] set the regexp.lastIndex property to 0 and +// invoke RegExp.prototype.exec repeatedly until there is no match. If +// there is a match with an empty string (in other words, if the value of +// regexp.lastIndex is left unchanged) increment regexp.lastIndex by 1. +// The value returned is an array with the properties 0 through n-1 +// corresponding to the first element of the result of each matching invocation +// of RegExp.prototype.exec. + + + // set the value of lastIndex + re = /([\d]{5})([-\ ]?[\d]{4})?$/g; + + + s = "Boston, MA 02134"; + + AddGlobalRegExpCases( re, + "re = " + re, + s, + ["02134" ]); + + re.lastIndex = 0; + + AddGlobalRegExpCases( + re, + "re = " + re + "; re.lastIndex = 0 ", + s, + ["02134"]); + + + re.lastIndex = s.length; + + AddGlobalRegExpCases( + re, + "re = " + re + "; re.lastIndex = " + s.length, + s, + ["02134"] ); + + re.lastIndex = s.lastIndexOf("0"); + + AddGlobalRegExpCases( + re, + "re = "+ re +"; re.lastIndex = " + s.lastIndexOf("0"), + s, + ["02134"]); + + re.lastIndex = s.lastIndexOf("0") + 1; + + AddGlobalRegExpCases( + re, + "re = " +re+ "; re.lastIndex = " + (s.lastIndexOf("0") +1), + s, + ["02134"]); + + + function AddGlobalRegExpCases( + regexp, str_regexp, string, matches_array ) { + + // prevent a runtime error + + if ( string.match(regexp) == null || matches_array == null ) { + array[item++] = new TestCase(SECTION, + string + ".match(" + str_regexp +")", + matches_array, + string.match(regexp) ); + + return; + } + + array[item++] = new TestCase(SECTION, + "( " + string + " ).match(" + str_regexp +").length", + matches_array.length, + string.match(regexp).length ); + + var limit = matches_array.length > string.match(regexp).length ? + matches_array.length : + string.match(regexp).length; + + for ( var matches = 0; matches < limit; matches++ ) { + array[item++] = new TestCase(SECTION, + "( " + string + " ).match(" + str_regexp +")[" + matches +"]", + matches_array[matches], + string.match(regexp)[matches] ); + } + } + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/String/ematch_004.as b/mozilla/js/tamarin/test/ecma3/String/ematch_004.as new file mode 100644 index 00000000000..90ba37945f7 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/ematch_004.as @@ -0,0 +1,200 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +/* + * String.match( regexp ) + * + * If regexp is not an object of type RegExp, it is replaced with result + * of the expression new RegExp(regexp). Let string denote the result of + * converting the this value to a string. If regexp.global is false, + * return the result obtained by invoking RegExp.prototype.exec (see + * section 15.7.5.3) on regexp with string as parameter. + * + * Otherwise, set the regexp.lastIndex property to 0 and invoke + * RegExp.prototype.exec repeatedly until there is no match. If there is a + * match with an empty string (in other words, if the value of + * regexp.lastIndex is left unchanged) increment regexp.lastIndex by 1. + * The value returned is an array with the properties 0 through n-1 + * corresponding to the first element of the result of each matching + * invocation of RegExp.prototype.exec. + * + * Note that the match function is intentionally generic; it does not + * require that its this value be a string object. Therefore, it can be + * transferred to other kinds of objects for use as a method. + * + * + * The match function should be intentionally generic, and not require + * this to be a string. + * + */ + + var SECTION = "String/match-004.js"; + var VERSION = "ECMA_2"; + var TITLE = "String.prototype.match( regexp )"; + + var BUGNUMBER="http://scopus/bugsplat/show_bug.cgi?id=345818"; + + startTest(); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // set the value of lastIndex + re = /0./; + s = 10203040506070809000; + + var origNumberMatch = Number.prototype.match; + Number.prototype.match = String.prototype.match; + + AddRegExpCases( re, + "re = " + re , + s, + String(s), + 1, + ["02"]); + + + re.lastIndex = 0; + AddRegExpCases( re, + "re = " + re +" [lastIndex is " + re.lastIndex+"]", + s, + String(s), + 1, + ["02"]); +/* + + re.lastIndex = s.length; + + AddRegExpCases( re, + "re = /([\d]{5})([-\ ]?[\d]{4})?$/; re.lastIndex = " + + s.length, + s, + s.lastIndexOf("0"), + null ); + + re.lastIndex = s.lastIndexOf("0"); + + AddRegExpCases( re, + "re = /([\d]{5})([-\ ]?[\d]{4})?$/; re.lastIndex = " + + s.lastIndexOf("0"), + s, + s.lastIndexOf("0"), + ["02134"]); + + re.lastIndex = s.lastIndexOf("0") + 1; + + AddRegExpCases( re, + "re = /([\d]{5})([-\ ]?[\d]{4})?$/; re.lastIndex = " + + s.lastIndexOf("0") +1, + s, + 0, + null); +*/ + Number.prototype.match = origNumberMatch; + + + function AddRegExpCases( + regexp, str_regexp, string, str_string, index, matches_array ) { + + // prevent a runtime error + + if ( regexp.exec(string) == null || matches_array == null ) { + AddTestCase( + string + ".match(" + regexp +")", + matches_array, + string.match(regexp) ); + + return; + } + + array[item++] = new TestCase(SECTION, + "( " + string + " ).match(" + str_regexp +").length", + matches_array.length, + string.match(regexp).length ); + + array[item++] = new TestCase(SECTION, + "( " + string + " ).match(" + str_regexp +").index", + index, + string.match(regexp).index ); + + array[item++] = new TestCase(SECTION, + "( " + string + " ).match(" + str_regexp +").input", + str_string, + string.match(regexp).input ); + + var limit = matches_array.length > string.match(regexp).length ? + matches_array.length : + string.match(regexp).length; + + for ( var matches = 0; matches < limit; matches++ ) { + array[item++] = new TestCase(SECTION, + "( " + string + " ).match(" + str_regexp +")[" + matches +"]", + matches_array[matches], + string.match(regexp)[matches] ); + } + } + + function AddGlobalRegExpCases( + regexp, str_regexp, string, matches_array ) { + + // prevent a runtime error + + if ( regexp.exec(string) == null || matches_array == null ) { + array[item++] = new TestCase(SECTION, + regexp + ".exec(" + string +")", + matches_array, + regexp.exec(string) ); + + return; + } + + array[item++] = new TestCase(SECTION, + "( " + string + " ).match(" + str_regexp +").length", + matches_array.length, + string.match(regexp).length ); + + var limit = matches_array.length > string.match(regexp).length ? + matches_array.length : + string.match(regexp).length; + + for ( var matches = 0; matches < limit; matches++ ) { + array[item++] = new TestCase(SECTION, + "( " + string + " ).match(" + str_regexp +")[" + matches +"]", + matches_array[matches], + string.match(regexp)[matches] ); + } + } + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/String/eregress_104375.as b/mozilla/js/tamarin/test/ecma3/String/eregress_104375.as new file mode 100644 index 00000000000..1dc23c59ada --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/eregress_104375.as @@ -0,0 +1,110 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* +* The contents of this file are subject to the Netscape Public +* License Version 1.1 (the "License"); you may not use this file +* except in compliance with the License. You may obtain a copy of +* the License at http://www.mozilla.org/NPL/ +* +* Software distributed under the License is distributed on an "AS +* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or +* implied. See the License for the specific language governing +* rights and limitations under the License. +* +* The Original Code is mozilla.org code. +* +* The Initial Developer of the Original Code is Netscape +* Communications Corporation. Portions created by Netscape are +* Copyright (C) 1998 Netscape Communications Corporation. +* All Rights Reserved. +* +* Contributor(s): k.mike@gmx.net, pschwartau@netscape.com +* Date: 12 October 2001 +* +* SUMMARY: Regression test for string.replace bug 104375 +* See http://bugzilla.mozilla.org/show_bug.cgi?id=104375 +*/ +//----------------------------------------------------------------------------- + var SECTION = "eregress_104375"; + var VERSION = ""; + var bug = 104375; + + startTest(); + var TITLE = "Testing string.replace() with backreferences"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + + var UBound = 0; + var status = ''; + var statusitems = []; + var actual = ''; + var actualvalues = []; + var expect= ''; + var expectedvalues = []; + + + /* + * Use the regexp to replace 'uid=31' with 'uid=15' + * + * In the second parameter of string.replace() method, + * "$1" refers to the first backreference: 'uid=' + */ + var str = 'uid=31'; + var re = /(uid=)(\d+)/; + + // try the numeric literal 15 + status = inSection(1); + actual = str.replace (re, "$1" + 15); + expect = 'uid=15'; + array[item++] = new TestCase(SECTION, status, expect, actual); + + // try the string literal '15' + status = inSection(2); + actual = str.replace (re, "$1" + '15'); + expect = 'uid=15'; + array[item++] = new TestCase(SECTION, status, expect, actual); + + // try a letter before the '15' + status = inSection(3); + actual = str.replace (re, "$1" + 'A15'); + expect = 'uid=A15'; + array[item++] = new TestCase(SECTION, status, expect, actual); + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/String/eregress_137879.as b/mozilla/js/tamarin/test/ecma3/String/eregress_137879.as new file mode 100644 index 00000000000..9797348a13c --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/eregress_137879.as @@ -0,0 +1,80 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.5.5.1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Parameters to string methods should be declared Number not int"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var a = "abcdefg"; + + array[item++] = new TestCase( SECTION, + "charAt(Infinity)", + "", + a.charAt(Infinity) ); + array[item++] = new TestCase( SECTION, + "a.charAt(4294967296)", + "", + a.charAt(4294967296) ); + array[item++] = new TestCase( SECTION, + "a.charAt(4294967296+1) ", + "", + a.charAt(4294967296+1) ); + array[item++] = new TestCase( SECTION, + "a.indexOf('2',4294967296)", + -1, + a.indexOf('2',4294967296) ); + array[item++] = new TestCase( SECTION, + "a.charCodeAt(4294967296)", + NaN, + a.charCodeAt(4294967296)); + array[item++] = new TestCase( SECTION, + "a.substring(4294967296,4294967296+2)", + "", + a.substring(4294967296,4294967296+2)); + array[item++] = new TestCase( SECTION, + "a.substring(NaN,Infinity)", + "abcdefg", + a.substring(NaN,Infinity)); + + + return array; + +} diff --git a/mozilla/js/tamarin/test/ecma3/String/eregress_137890.as b/mozilla/js/tamarin/test/ecma3/String/eregress_137890.as new file mode 100644 index 00000000000..be0ae40fd66 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/eregress_137890.as @@ -0,0 +1,57 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.5.5.1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Using + operator to concatenate a string and a value"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + + + array[item++] = new TestCase( SECTION, + "'string'+0x4455", + "string17493", + "string"+0x4455 ); + + + + return array; + +} diff --git a/mozilla/js/tamarin/test/ecma3/String/eregress_83293.as b/mozilla/js/tamarin/test/ecma3/String/eregress_83293.as new file mode 100644 index 00000000000..0e42997fe53 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/eregress_83293.as @@ -0,0 +1,152 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* +* The contents of this file are subject to the Netscape Public +* License Version 1.1 (the "License"); you may not use this file +* except in compliance with the License. You may obtain a copy of +* the License at http://www.mozilla.org/NPL/ +* +* Software distributed under the License is distributed on an "AS +* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or +* implied. See the License for the specific language governing +* rights and limitations under the License. +* +* The Original Code is mozilla.org code. +* +* The Initial Developer of the Original Code is Netscape +* Communications Corporation. Portions created by Netscape are +* Copyright (C) 1998 Netscape Communications Corporation. All +* Rights Reserved. +* +* Contributor(s): pschwartau@netscape.com, jim@jibbering.com +* Creation Date: 30 May 2001 +* Correction Date: 14 Aug 2001 +* +* SUMMARY: Regression test for bugs 83293, 103351 +* See http://bugzilla.mozilla.org/show_bug.cgi?id=83293 +* http://bugzilla.mozilla.org/show_bug.cgi?id=103351 +* http://bugzilla.mozilla.org/show_bug.cgi?id=92942 +* +* +* ******************** CORRECTION !!! ***************************** +* +* When I originally wrote this test, I thought this was true: +* str.replace(strA, strB) == str.replace(new RegExp(strA),strB). +* See ECMA-262 Final Draft, 15.5.4.11 String.prototype.replace +* +* However, in http://bugzilla.mozilla.org/show_bug.cgi?id=83293 +* Jim Ley points out the ECMA-262 Final Edition changed on this. +* String.prototype.replace (searchValue, replaceValue), if provided +* a searchValue that is not a RegExp, is NO LONGER to replace it with +* +* new RegExp(searchValue) +* but rather: +* String(searchValue) +* +* This puts the replace() method at variance with search() and match(), +* which continue to follow the RegExp conversion of the Final Draft. +* It also makes most of this testcase, as originally written, invalid. +********************************************************************** +*/ +//----------------------------------------------------------------------------- + var SECTION = "eregress_104375"; + var VERSION = ""; + var bug = 103351; // <--- (Outgrowth of original bug 83293) + + startTest(); + var summ_OLD = 'Testing str.replace(strA, strB) == str.replace(new RegExp(strA),strB)'; + var TITLE = "Testing String.prototype.replace(x,y) when x is a string"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + var status = ''; + var actual = ''; + var expect= ''; + var cnEmptyString = ''; + var str = 'abc'; + var strA = cnEmptyString; + var strB = 'Z'; + +////////////////////////// OK, LET'S START OVER ////////////////////////////// + + status = 'Section 1 of test'; + actual = 'abc'.replace('a', 'Z'); + expect = 'Zbc'; + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = 'Section 2 of test'; + actual = 'abc'.replace('b', 'Z'); + expect = 'aZc'; + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = 'Section 3 of test'; + actual = 'abc'.replace(undefined, 'Z'); + expect = 'abc'; // String(undefined) == 'undefined'; no replacement possible + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = 'Section 4 of test'; + actual = 'abc'.replace(null, 'Z'); + expect = 'abc'; // String(null) == 'null'; no replacement possible + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = 'Section 5 of test'; + actual = 'abc'.replace(true, 'Z'); + expect = 'abc'; // String(true) == 'true'; no replacement possible + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = 'Section 6 of test'; + actual = 'abc'.replace(false, 'Z'); + expect = 'abc'; // String(false) == 'false'; no replacement possible + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = 'Section 7 of test'; + actual = 'aa$aa'.replace('$', 'Z'); + expect = 'aaZaa'; // NOT 'aa$aaZ' as in ECMA Final Draft; see above + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = 'Section 8 of test'; + actual = 'abc'.replace('.*', 'Z'); + expect = 'abc'; // not 'Z' as in EMCA Final Draft + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = 'Section 9 of test'; + actual = 'abc'.replace('', 'Z'); + expect = 'Zabc'; // Still expect 'Zabc' for this + array[item++] = new TestCase(SECTION, status, expect, actual); + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/String/ereplace_001.as b/mozilla/js/tamarin/test/ecma3/String/ereplace_001.as new file mode 100644 index 00000000000..8ef5e1adc47 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/ereplace_001.as @@ -0,0 +1,227 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "String/replace-001.as"; + var VERSION = "ECMA_2"; + var TITLE = "String.prototype.replace( regexp, replaceValue )"; + + startTest(); + + /* + * If regexp is not an object of type RegExp, it is replaced with the + * result of the expression new RegExp(regexp). Let string denote the + * result of converting the this value to a string. String is searched + * for the first occurrence of the regular expression pattern regexp if + * regexp.global is false, or all occurrences if regexp.global is true. + * + * The match is performed as in String.prototype.match, including the + * update of regexp.lastIndex. Let m be the number of matched + * parenthesized subexpressions as specified in section 15.7.5.3. + * + * If replaceValue is a function, then for each matched substring, call + * the function with the following m + 3 arguments. Argument 1 is the + * substring that matched. The next m arguments are all of the matched + * subexpressions. Argument m + 2 is the length of the left context, and + * argument m + 3 is string. + * + * The result is a string value derived from the original input by + * replacing each matched substring with the corresponding return value + * of the function call, converted to a string if need be. + * + * Otherwise, let newstring denote the result of converting replaceValue + * to a string. The result is a string value derived from the original + * input string by replacing each matched substring with a string derived + * from newstring by replacing characters in newstring by replacement text + * as specified in the following table: + * + * $& The matched substring. + * $‘ The portion of string that precedes the matched substring. + * $’ The portion of string that follows the matched substring. + * $+ The substring matched by the last parenthesized subexpressions in + * the regular expression. + * $n The corresponding matched parenthesized subexpression n, where n + * is a single digit 0-9. If there are fewer than n subexpressions, “$n + * is left unchanged. + * + * Note that the replace function is intentionally generic; it does not + * require that its this value be a string object. Therefore, it can be + * transferred to other kinds of objects for use as a method. + */ + + + + + +//----------------------------------------------------------------------------- + + var SECTION = "eregress_104375"; + var VERSION = ""; + + startTest(); + var TITLE = "Testing String.prototype.replace( regexp, replaceValue )"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var UBound = 0; + var summary=""; + var status = ''; + var statusitems = []; + var actual = ''; + var actualvalues = []; + var expect= ''; + var expectedvalues = []; + + + /* + * Use the regexp to replace 'uid=31' with 'uid=15' + * + * In the second parameter of string.replace() method, + * "$1" refers to the first backreference: 'uid=' + */ + var str = 'She sells seashells by the seashore.'; + var re = /sh/g; + + + status = inSection(1); + actual = str.replace (re,'sch'); + expect = 'She sells seaschells by the seaschore.'; + array[item++] = new TestCase(SECTION, status, expect, actual); + + + status = inSection(2); + actual = str.replace (re, "$$" + 'sch'); + expect = 'She sells sea$schells by the sea$schore.'; + array[item++] = new TestCase(SECTION, status, expect, actual); + + + status = inSection(3); + actual = str.replace (re, "$&" + 'sch'); + expect = 'She sells seashschells by the seashschore.'; + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = inSection(4); + actual = str.replace (re, "$`" + 'sch'); + expect = 'She sells seaShe sells seaschells by the seaShe sells seashells by the seaschore.'; + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = inSection(5); + actual = str.replace (re, "$'" + 'sch'); + expect = 'She sells seaells by the seashore.schells by the seaore.schore.'; + array[item++] = new TestCase(SECTION, status, expect, actual); + + var str2 = 'She sells seashells by the seashore.'; + var re = /sh/; + + + status = inSection(6); + actual = str2.replace (re,'sch'); + expect = 'She sells seaschells by the seashore.'; + array[item++] = new TestCase(SECTION, status, expect, actual); + + + status = inSection(7); + actual = str2.replace (re, "$$" + 'sch'); + expect = 'She sells sea$schells by the seashore.'; + array[item++] = new TestCase(SECTION, status, expect, actual); + + + status = inSection(8); + actual = str2.replace (re, "$&" + 'sch'); + expect = 'She sells seashschells by the seashore.'; + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = inSection(9); + actual = str2.replace (re, "$`" + 'sch'); + expect = 'She sells seaShe sells seaschells by the seashore.'; + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = inSection(10); + actual = str2.replace (re, "$'" + 'sch'); + expect = 'She sells seaells by the seashore.schells by the seashore.'; + array[item++] = new TestCase(SECTION, status, expect, actual); + + var str1 = 'uid=31'; + var re1 = /(uid=)(\d+)/; + + status = inSection(11); + actual = str1.replace (re1, "$11" + 15); + expect = 'uid=115'; + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = inSection(12); + actual = str1.replace (re1, "$11" + '15'); + expect = 'uid=115'; + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = inSection(13); + actual = str1.replace (re1, "$11" + 'A15'); + expect = 'uid=1A15'; + array[item++] = new TestCase(SECTION, status, expect, actual); + + var str1:String = "abc12 def34"; + var pattern:RegExp = /([a-z]+)([0-9]+)/; + var str2:String = str1.replace(pattern, replFN); + + function replFN():String { + return arguments[2] + arguments[1]; + } + + status = inSection(14); + actual = str2 + expect = '12abc def34'; + array[item++] = new TestCase(SECTION, status, expect, actual); + + var str1:String = "abc12 def34"; + var pattern:RegExp = /([a-z]+)([0-9]+)/g; + var str2:String = str1.replace(pattern, replFN); + + function replFN():String { + return arguments[2] + arguments[1]; + } + + status = inSection(14); + actual = str2 + expect = '12abc 34def'; + array[item++] = new TestCase(SECTION, status, expect, actual); + + return array; +} + + + + diff --git a/mozilla/js/tamarin/test/ecma3/String/esplit_001.as b/mozilla/js/tamarin/test/ecma3/String/esplit_001.as new file mode 100644 index 00000000000..9b3d59ca097 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/esplit_001.as @@ -0,0 +1,135 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +/* + * Since regular expressions have been part of JavaScript since 1.2, there + * are already tests for regular expressions in the js1_2/regexp folder. + * + * These new tests try to supplement the existing tests, and verify that + * our implementation of RegExp conforms to the ECMA specification, but + * does not try to be as exhaustive as in previous tests. + * + * The [,limit] argument to String.split is new, and not covered in any + * existing tests. + * + * String.split cases are covered in ecma/String/15.5.4.8-*.js. + * String.split where separator is a RegExp are in + * js1_2/regexp/string_split.js + * + */ + + var SECTION = "ecma_2/String/split-001.js"; + var VERSION = "ECMA_2"; + var TITLE = "String.prototype.split( regexp, [,limit] )"; + + startTest(); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // the separator is not supplied + // separator is undefined + // separator is an empty string + + AddSplitCases( "splitme", "", "''", ["s", "p", "l", "i", "t", "m", "e"] ); + AddSplitCases( "splitme", new RegExp(), "new RegExp()", ["s", "p", "l", "i", "t", "m", "e"] ); + + // separartor is a regexp + // separator regexp value global setting is set + // string is an empty string + // if separator is an empty string, split each by character + + // this is not a String object + + // limit is not a number + // limit is undefined + // limit is larger than 2^32-1 + // limit is a negative number + + function AddSplitCases( string, separator, str_sep, split_array ) { + + // verify that the result of split is an object of type Array + array[item++] = new TestCase(SECTION, + "( " + string + " ).split(" + str_sep +").constructor == Array", + true, + string.split(separator).constructor == Array ); + + // check the number of items in the array + array[item++] = new TestCase(SECTION, + "( " + string + " ).split(" + str_sep +").length", + split_array.length, + string.split(separator).length ); + + // check the value of each array item + var limit = (split_array.length > string.split(separator).length ) + ? split_array.length : string.split(separator).length; + + for ( var matches = 0; matches < split_array.length; matches++ ) { + array[item++] = new TestCase(SECTION, + "( " + string + " ).split(" + str_sep +")[" + matches +"]", + split_array[matches], + string.split( separator )[matches] ); + } + } + + function AddLimitedSplitCases( + string, separator, str_sep, limit, str_limit, split_array ) { + + // verify that the result of split is an object of type Array + + array[item++] = new TestCase(SECTION, + "( " + string + " ).split(" + str_sep +", " + str_limit + + " ).constructor == Array", + true, + string.split(separator, limit).constructor == Array ); + + // check the length of the array + + array[item++] = new TestCase(SECTION, + "( " + string + " ).split(" + str_sep +", " + str_limit + " ).length", + length, + string.split(separator).length ); + + // check the value of each array item + + for ( var matches = 0; matches < split_array.length; matches++ ) { + array[item++] = new TestCase(SECTION, + "( " + string + " ).split(" + str_sep +", " + str_limit + " )[" + matches +"]", + split_array[matches], + string.split( separator )[matches] ); + } + } + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/String/esplit_002.as b/mozilla/js/tamarin/test/ecma3/String/esplit_002.as new file mode 100644 index 00000000000..25c09ee2c57 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/esplit_002.as @@ -0,0 +1,289 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +/* + * Since regular expressions have been part of JavaScript since 1.2, there + * are already tests for regular expressions in the js1_2/regexp folder. + * + * These new tests try to supplement the existing tests, and verify that + * our implementation of RegExp conforms to the ECMA specification, but + * does not try to be as exhaustive as in previous tests. + * + * The [,limit] argument to String.split is new, and not covered in any + * existing tests. + * + * String.split cases are covered in ecma/String/15.5.4.8-*.js. + * String.split where separator is a RegExp are in + * js1_2/regexp/string_split.js + * + */ + + var SECTION = "ecma_2/String/split-002.js"; + var VERSION = "ECMA_2"; + var TITLE = "String.prototype.split( regexp, [,limit] )"; + + startTest(); + + // the separator is not supplied + // separator is undefined + // separator is an empty string + +// AddSplitCases( "splitme", "", "''", ["s", "p", "l", "i", "t", "m", "e"] ); +// AddSplitCases( "splitme", new RegExp(), "new RegExp()", ["s", "p", "l", "i", "t", "m", "e"] ); + + // separator is an empty regexp + // separator is not supplied + //uncomment after bug 159449 is fixed + + CompareSplit( "hello", "ll" ); + + CompareSplit( "hello", "l" ); + CompareSplit( "hello", "x" ); + CompareSplit( "hello", "h" ); + CompareSplit( "hello", "o" ); + CompareSplit( "hello", "hello" ); + CompareSplit( "hello", undefined ); + + CompareSplit( "hello", ""); + CompareSplit( "hello", "hellothere" ); + + CompareSplit( new String("hello" ) ); + + var origNumberSplit = Number.prototype.split; + Number.prototype.split = String.prototype.split; + + CompareSplit( new Number(100111122133144155), 1 ); + CompareSplitWithLimit(new Number(100111122133144155), 1, 1 ); + + CompareSplitWithLimit(new Number(100111122133144155), 1, 2 ); + CompareSplitWithLimit(new Number(100111122133144155), 1, 0 ); + CompareSplitWithLimit(new Number(100111122133144155), 1, 100 ); + CompareSplitWithLimit(new Number(100111122133144155), 1, void 0 ); + CompareSplitWithLimit(new Number(100111122133144155), 1, Math.pow(2,32)-1 ); + CompareSplitWithLimit(new Number(100111122133144155), 1, "boo" ); + CompareSplitWithLimit(new Number(100111122133144155), 1, -(Math.pow(2,32)-1) ); + CompareSplitWithLimit( "hello", "l", NaN ); + CompareSplitWithLimit( "hello", "l", 0 ); + CompareSplitWithLimit( "hello", "l", 1 ); + CompareSplitWithLimit( "hello", "l", 2 ); + CompareSplitWithLimit( "hello", "l", 3 ); + CompareSplitWithLimit( "hello", "l", 4 ); + + +/* + CompareSplitWithLimit( "hello", "ll", 0 ); + CompareSplitWithLimit( "hello", "ll", 1 ); + CompareSplitWithLimit( "hello", "ll", 2 ); + CompareSplit( "", " " ); + CompareSplit( "" ); +*/ + + // separartor is a regexp + // separator regexp value global setting is set + // string is an empty string + // if separator is an empty string, split each by character + + // this is not a String object + + // limit is not a number + // limit is undefined + // limit is larger than 2^32-1 + // limit is a negative number + + Number.prototype.split = origNumberSplit; + + test(); + +function CompareSplit( string, separator ) { + split_1 = string.split( separator ); + split_2 = string_split( string, separator ); + + AddTestCase( + "( " + string +".split(" + separator + ") ).length" , + split_2.length, + split_1.length ); + + var limit = split_1.length > split_2.length ? + split_1.length : split_2.length; + + for ( var split_item = 0; split_item < limit; split_item++ ) { + AddTestCase( + string + ".split(" + separator + ")["+split_item+"]", + split_2[split_item], + split_1[split_item] ); + } +} + +function CompareSplitWithLimit( string, separator, splitlimit ) { + split_1 = string.split( separator, splitlimit ); + split_2 = string_split( string, separator, splitlimit ); + + AddTestCase( + "( " + string +".split(" + separator + ", " + splitlimit+") ).length" , + split_2.length, + split_1.length ); + + var limit = split_1.length > split_2.length ? + split_1.length : split_2.length; + + for ( var split_item = 0; split_item < limit; split_item++ ) { + AddTestCase( + string + ".split(" + separator + ", " + splitlimit+")["+split_item+"]", + split_2[split_item], + split_1[split_item] ); + } +} + +function string_split ( __this, separator, limit ) { + var S = String(__this ); // 1 + + var A = new Array(); // 2 + + if ( limit == undefined ) { // 3 + lim = Math.pow(2, 31 ) -1; + } else { + lim = ToUint32( limit ); + } + + var s = S.length; // 4 + var p = 0; // 5 + + if ( separator == undefined ) { // 8 + A[0] = S; + return A; + } + + if ( separator.constructor == RegExp ) // 6 + R = separator; + else + R = separator.toString(); + + if (lim == 0) return A; // 7 + + if ( separator == undefined ) { // 8 + A[0] = S; + return A; + } + + if (s == 0) { // 9 + z = SplitMatch(R, S, 0); + if (z != false) return A; + A[0] = S; + return A; + } + + var q = p; // 10 +loop: + while (true ) { + + if ( q == s ) break; // 11 + + z = SplitMatch(R, S, q); // 12 + +//print("Returned ", z); + + if (z != false) { // 13 + e = z.endIndex; // 14 + cap = z.captures; // 14 + if (e != p) { // 15 +//print("S = ", S, ", p = ", p, ", q = ", q); + T = S.slice(p, q); // 16 +//print("T = ", T); + A[A.length] = T; // 17 + if (A.length == lim) return A; // 18 + p = e; // 19 + i = 0; // 20 + while (true) { // 25 + if (i == cap.length) { // 21 + q = p; // 10 + continue loop; + } + i = i + 1; // 22 + A[A.length] = cap[i] // 23 + if (A.length == lim) return A; // 24 + } + } + } + + q = q + 1; // 26 + } + + T = S.slice(p, q); + A[A.length] = T; + return A; +} + +function SplitMatch(R, S, q) +{ + if (R.constructor == RegExp) { // 1 + var reResult = R.match(S, q); // 8 + if (reResult == undefined) + return false; + else { + a = new Array(reResult.length - 1); + for (var i = 1; i < reResult.length; i++) + a[a.length] = reResult[i]; + return { endIndex : reResult.index + reResult[0].length, captures : cap }; + } + } + else { + var r = R.length; // 2 + s = S.length; // 3 + if ((q + r) > s) return false; // 4 + for (var i = 0; i < r; i++) { +//print("S.charAt(", q + i, ") = ", S.charAt(q + i), ", R.charAt(", i, ") = ", R.charAt(i)); + if (S.charAt(q + i) != R.charAt(i)) // 5 + return false; + } + cap = new Array(); // 6 + return { endIndex : q + r, captures : cap }; // 7 + } +} + +function ToUint32( n ) { + n = Number( n ); + var sign = ( n < 0 ) ? -1 : 1; + + if ( Math.abs( n ) == 0 + || Math.abs( n ) == Number.POSITIVE_INFINITY + || n != n) { + return 0; + } + n = sign * Math.floor( Math.abs(n) ) + + n = n % Math.pow(2,32); + + if ( n < 0 ){ + n += Math.pow(2,32); + } + + return ( n ); +} diff --git a/mozilla/js/tamarin/test/ecma3/String/esplit_003.as b/mozilla/js/tamarin/test/ecma3/String/esplit_003.as new file mode 100644 index 00000000000..8de07999969 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/esplit_003.as @@ -0,0 +1,147 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + +/* + * Since regular expressions have been part of JavaScript since 1.2, there + * are already tests for regular expressions in the js1_2/regexp folder. + * + * These new tests try to supplement the existing tests, and verify that + * our implementation of RegExp conforms to the ECMA specification, but + * does not try to be as exhaustive as in previous tests. + * + * The [,limit] argument to String.split is new, and not covered in any + * existing tests. + * + * String.split cases are covered in ecma/String/15.5.4.8-*.js. + * String.split where separator is a RegExp are in + * js1_2/regexp/string_split.js + * + */ + + var SECTION = "ecma_2/String/split-003.js"; + var VERSION = "ECMA_2"; + var TITLE = "String.prototype.split( regexp, [,limit] )"; + + startTest(); + + // separartor is a regexp + // separator regexp value global setting is set + // string is an empty string + // if separator is an empty string, split each by character + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + AddSplitCases( "hello", new RegExp, "new RegExp", ["h","e","l","l","o"] ); + + AddSplitCases( "hello", /l/, "/l/", ["he","","o"] ); + AddLimitedSplitCases( "hello", /l/, "/l/", 0, [] ); + AddLimitedSplitCases( "hello", /l/, "/l/", 1, ["he"] ); + AddLimitedSplitCases( "hello", /l/, "/l/", 2, ["he",""] ); + AddLimitedSplitCases( "hello", /l/, "/l/", 3, ["he","","o"] ); + AddLimitedSplitCases( "hello", /l/, "/l/", 4, ["he","","o"] ); + AddLimitedSplitCases( "hello", /l/, "/l/", void 0, ["he","","o"] ); + AddLimitedSplitCases( "hello", /l/, "/l/", "hi", [] ); + AddLimitedSplitCases( "hello", /l/, "/l/", undefined, ["he","","o"] ); + + AddSplitCases( "hello", new RegExp, "new RegExp", ["h","e","l","l","o"] ); + AddLimitedSplitCases( "hello", new RegExp, "new RegExp", 0, [] ); + AddLimitedSplitCases( "hello", new RegExp, "new RegExp", 1, ["h"] ); + AddLimitedSplitCases( "hello", new RegExp, "new RegExp", 2, ["h","e"] ); + AddLimitedSplitCases( "hello", new RegExp, "new RegExp", 3, ["h","e","l"] ); + AddLimitedSplitCases( "hello", new RegExp, "new RegExp", 4, ["h","e","l","l"] ); + AddLimitedSplitCases( "hello", new RegExp, "new RegExp", void 0, ["h","e","l","l","o"] ); + AddLimitedSplitCases( "hello", new RegExp, "new RegExp", "hi", [] ); + AddLimitedSplitCases( "hello", new RegExp, "new RegExp", undefined, ["h","e","l","l","o"] ); + + + function AddSplitCases( string, separator, str_sep, split_array ) { + // verify that the result of split is an object of type Array + array[item++] = new TestCase(SECTION, + "( " + string + " ).split(" + str_sep +").constructor == Array", + true, + string.split(separator).constructor == Array ); + + // check the number of items in the array + array[item++] = new TestCase(SECTION, + "( " + string + " ).split(" + str_sep +").length", + split_array.length, + string.split(separator).length ); + + // check the value of each array item + var limit = (split_array.length > string.split(separator).length ) + ? split_array.length : string.split(separator).length; + + for ( var matches = 0; matches < split_array.length; matches++ ) { + array[item++] = new TestCase(SECTION, + "( " + string + " ).split(" + str_sep +")[" + matches +"]", + split_array[matches], + string.split( separator )[matches] ); + } + } + + function AddLimitedSplitCases( + string, separator, str_sep, limit, split_array ) { + + // verify that the result of split is an object of type Array + + array[item++] = new TestCase(SECTION, + "( " + string + " ).split(" + str_sep +", " + limit + + " ).constructor == Array", + true, + string.split(separator, limit).constructor == Array ); + + // check the length of the array + + array[item++] = new TestCase(SECTION, + "( " + string + " ).split(" + str_sep +", " + limit + " ).length", + split_array.length, + string.split(separator, limit).length ); + + // check the value of each array item + + var slimit = (split_array.length > string.split(separator).length ) + ? split_array.length : string.split(separator, limit).length; + + for ( var matches = 0; matches < slimit; matches++ ) { + array[item++] = new TestCase(SECTION, + "( " + string + " ).split(" + str_sep +", " + limit + " )[" + matches +"]", + split_array[matches], + string.split( separator, limit )[matches] ); + } + } + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/String/localeCompare_rt.as b/mozilla/js/tamarin/test/ecma3/String/localeCompare_rt.as new file mode 100644 index 00000000000..a9d103ebf0a --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/localeCompare_rt.as @@ -0,0 +1,75 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.5.4.9"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "String.prototype.localeCompare"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var str1 = new String("h"); + var str2 = new String ("H"); + array[item++] = new TestCase( SECTION, "str1.localeCompare(str2)", 32, str1.localeCompare(str2) ); + + var str2 = new String ("hello"); + array[item++] = new TestCase( SECTION, "str1.localeCompare(str2)", -1, str1.localeCompare(str2) ); + + var str2 = new String ("flash"); + array[item++] = new TestCase( SECTION, "str1.localeCompare(str2)", 2, str1.localeCompare(str2) ) + + var str1 = "h" + var str2 = "H" + var thisError = "no error"; + try{ + String.prototype.localeCompare(str2,str1) + }catch(e:ArgumentError){ + thisError = (e.toString()).substring(0,26); + }finally{ + array[item++] = new TestCase( SECTION, "String.prototype.localeCompare(str2,str1)","ArgumentError: Error #1063",thisError) + } + + /*var str2 = "hello"; + array[item++] = new TestCase( SECTION, "localeCompare(str1,str2)",-13, String.prototype.localeCompare(str1,str2) ) + + var str2 = "flash" + array[item++] = new TestCase( SECTION, "localeCompare(str1,str2)",-11, String.prototype.localeCompare(str2,str1) )*/ + + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/String/search.as b/mozilla/js/tamarin/test/ecma3/String/search.as new file mode 100644 index 00000000000..439818d7034 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/search.as @@ -0,0 +1,69 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = '15.5.4.12'; + var VERSION = 'no version'; + startTest(); + var TITLE = 'String:search(regexp)'; + + writeHeaderToLog('Executing script: search.as'); + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var aString = new String("test string"); + var bString = new String("one two three four five"); + + var regExp = /Four/; + + result = aString.search("string").toString(); + array[item++] = new TestCase( SECTION, "aString.search(\"string\")", "5", result); + result = aString.search("String").toString(); + array[item++] = new TestCase( SECTION, "aString.search(\"String\")", "-1", result); + array[item++] = new TestCase( SECTION, "aString.search(/String/i)", "5", aString.search(/String/i).toString()); + array[item++] = new TestCase( SECTION, "bString.search(regExp)", "-1", bString.search(regExp).toString()); + + + regExp = /four/; + array[item++] = new TestCase( SECTION, "bString.search(regExp)", "14", bString.search(regExp).toString()); + array[item++] = new TestCase( SECTION, "bString.search(/Four/i)", "14", bString.search(/Four/i).toString()); + result = aString.search("notexist").toString(); + array[item++] = new TestCase( SECTION, "aString.search(/notexist/)", "-1", result); + result = bString.search("notexist").toString(); + array[item++] = new TestCase( SECTION, "bString.search(\"notexist\")", "-1", result); + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/String/substr.as b/mozilla/js/tamarin/test/ecma3/String/substr.as new file mode 100644 index 00000000000..01b3a623525 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/substr.as @@ -0,0 +1,175 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + + var SECTION = "substr"; + var VERSION = "AS3.0"; + startTest(); + var TITLE = "String.substr( start, end )"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, "String.prototype.substr.length", 2, String.prototype.substr.length ); + array[item++] = new TestCase( SECTION, "delete String.prototype.substr.length", false, delete String.prototype.substr.length ); + array[item++] = new TestCase( SECTION, "delete String.prototype.substr.length; String.prototype.substr.length", 2, (delete String.prototype.substr.length, String.prototype.substr.length) ); + + // test cases for when substr is called with no arguments. + + // this is a string object + + array[item++] = new TestCase( SECTION, + "var s = new String('this is a string object'); typeof s.substr()", + "string", + (s = new String('this is a string object'), typeof s.substr() ) ); + + array[item++] = new TestCase( SECTION, + "var s = new String(''); s.substr(1,0)", + "", + (s = new String(''), s.substr(1,0) ) ); + + array[item++] = new TestCase( SECTION, + "var s = new String('this is a string object'); s.substr(true, false)", + "t", + (s = new String('this is a string object'), s.substr(false, true) ) ); + + array[item++] = new TestCase( SECTION, + "var s = new String('this is a string object'); s.substr(NaN, Infinity)", + "this is a string object", + (s = new String('this is a string object'), s.substr(NaN, Infinity) ) ); + + + array[item++] = new TestCase( SECTION, + "var s = new String('this is a string object'); s.substr(Infinity, NaN)", + "", + (s = new String('this is a string object'), s.substr(Infinity, NaN) ) ); + + + array[item++] = new TestCase( SECTION, + "var s = new String('this is a string object'); s.substr(Infinity, Infinity)", + "", + (s = new String('this is a string object'), s.substr(Infinity, Infinity) ) ); + + array[item++] = new TestCase( SECTION, + "var s = new String('this is a string object'); s.substr(-0.01, 0)", + "", + (s = new String('this is a string object'), s.substr(-0.01,0) ) ); + + + array[item++] = new TestCase( SECTION, + "var s = new String('this is a string object'); s.substr(s.length, s.length)", + "", + (s = new String('this is a string object'), s.substr(s.length, s.length) ) ); + + array[item++] = new TestCase( SECTION, + "var s = new String('this is a string object'); s.substr(s.length+1, 0)", + "", + (s = new String('this is a string object'), s.substr(s.length+1, 0) ) ); + + array[item++] = new TestCase( SECTION, + "var s = new String('this is a string object'); s.substr(-Infinity, -Infinity)", + "", + (s = new String('this is a string object'), s.substr(-Infinity, -Infinity) ) ); + + + array[item++] = new TestCase( SECTION, + "var s = new String('this is a string object'); s.substr(NaN)", + "this is a string object", + (s = new String('this is a string object'), s.substr(NaN) ) ); + + + array[item++] = new TestCase( SECTION, + "var s = new String('this is a string object'); s.substr(-0.01)", + "this is a string object", + (s = new String('this is a string object'), s.substr(-0.01) ) ); + + + array[item++] = new TestCase( SECTION, + "var s = new String('this is a string object'); s.substr(s.length)", + "", + (s = new String('this is a string object'), s.substr(s.length) ) ); + + array[item++] = new TestCase( SECTION, + "var s = new String('this is a string object'); s.substr(s.length+1)", + "", + (s = new String('this is a string object'), s.substr(s.length+1) ) ); + + + array[item++] = new TestCase( SECTION, + "var s = new String('this is a string object'); s.substr(Infinity)", + "", + (s = new String('this is a string object'), s.substr(Infinity) ) ); + + array[item++] = new TestCase( SECTION, + "var s = new String('this is a string object'); s.substr(-Infinity)", + "this is a string object", + (s = new String('this is a string object'), s.substr(-Infinity) ) ); + + array[item++] = new TestCase( SECTION, + "var obj = new Object(); obj.substr = String.prototype.substr; obj.substr(0,8)", + "[object ", + (obj = new Object(), obj.substr = String.prototype.substr, obj.substr(0,8) ) ); + + array[item++] = new TestCase( SECTION, + "var obj = new Object(); obj.substr = String.prototype.substr; obj.substr(8,obj.toString().length)", + "Object]", + (obj = new Object(), obj.substr = String.prototype.substr, obj.substr(8, obj.toString().length) ) ); + + array[item++] = new TestCase( SECTION, + "var obj = function() {}; obj.substr = String.prototype.substr; obj.substr(8, Infinity)", + " Function() {}", + (obj = function() {}, obj.substr= String.prototype.substr, obj.substr(8,Infinity) ) ); + + array[item++] = new TestCase( SECTION, + "var obj = new Object(); obj.substr = String.prototype.substr; obj.substr(8)", + "Object]", + (obj = new Object(), obj.substr = String.prototype.substr, obj.substr(8) ) ); + + array[item++] = new TestCase( SECTION, + "var obj = function() {}; obj.substr = String.prototype.substr; obj.substr(8)", + " Function() {}", + (obj = function() {}, obj.substr = String.prototype.substr, obj.substr(8) ) ); + + + return array; +} + +function MyObject( value ) { + this.value = value; + this.substring = String.prototype.substring; + this.toString = function() { return this.value+''; } +} + diff --git a/mozilla/js/tamarin/test/ecma3/String/toLocaleLowerCase.as b/mozilla/js/tamarin/test/ecma3/String/toLocaleLowerCase.as new file mode 100644 index 00000000000..667e49d8550 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/toLocaleLowerCase.as @@ -0,0 +1,498 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.5.4.17"; + var VERSION = "ECMA_1"; + + startTest(); + var TITLE = "String.prototype.toLocaleLowerCase()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "String.prototype.toLowerCase.length", 0, String.prototype.toLowerCase.length ); + array[item++] = new TestCase( SECTION, "delete String.prototype.toLowerCase.length", false, delete String.prototype.toLowerCase.length ); + array[item++] = new TestCase( SECTION, "delete String.prototype.toLowerCase.length; String.prototype.toLowerCase.length", 0, (delete String.prototype.toLowerCase.length, String.prototype.toLowerCase.length) ); + + // Basic Latin, Latin-1 Supplement, Latin Extended A + for ( var i = 0; i <= 0x017f; i++ ) { + var U = new Unicode(i); + var s = new String( String.fromCharCode(i) ) +/* + array[item++] = new TestCase( SECTION, + "var s = new String( String.fromCharCode("+i+") ); s.toLocaleLowerCase()", + String.fromCharCode(U.lower), + (s = new String( String.fromCharCode("+i+ ) ), s.toLocaleLowerCase()") ); +*/ + array[item++] = new TestCase( SECTION, + "var s = new String( String.fromCharCode("+i+") ); s.toLocaleLowerCase().charCodeAt(0)", + U.lower, + (s.toLocaleLowerCase().charCodeAt(0) ) ); + + } + + return array; +} + +function MyObject( value ) { + this.value = value; + this.substring = String.prototype.substring; + this.toString = function() { return this.value+'';} +} +function Unicode( c ) { + u = GetUnicodeValues( c ); + this.upper = u[0]; + this.lower = u[1] + return this; +} +function GetUnicodeValues( c ) { + u = new Array(); + + u[0] = c; + u[1] = c; + + // upper case Basic Latin + + if ( c >= 0x0041 && c <= 0x005A) { + u[0] = c; + u[1] = c + 32; + return u; + } + + // lower case Basic Latin + if ( c >= 0x0061 && c <= 0x007a ) { + u[0] = c - 32; + u[1] = c; + return u; + } + + // upper case Latin-1 Supplement + if ( (c >= 0x00C0 && c <= 0x00D6) || (c >= 0x00D8 && c<=0x00DE) ) { + u[0] = c; + u[1] = c + 32; + return u; + } + + // lower case Latin-1 Supplement + if ( (c >= 0x00E0 && c <= 0x00F6) || (c >= 0x00F8 && c <= 0x00FE) ) { + u[0] = c - 32; + u[1] = c; + return u; + } + if ( c == 0x00FF ) { + u[0] = 0x0178; + u[1] = c; + return u; + } + // Latin Extended A + if ( (c >= 0x0100 && c < 0x0138) || (c > 0x0149 && c < 0x0178) ) { + // special case for capital I + if ( c == 0x0130 ) { + u[0] = c; + u[1] = 0x0069; + return u; + } + if ( c == 0x0131 ) { + u[0] = 0x0049; + u[1] = c; + return u; + } + + if ( c % 2 == 0 ) { + // if it's even, it's a capital and the lower case is c +1 + u[0] = c; + u[1] = c+1; + } else { + // if it's odd, it's a lower case and upper case is c-1 + u[0] = c-1; + u[1] = c; + } + return u; + } + if ( c == 0x0178 ) { + u[0] = c; + u[1] = 0x00FF; + return u; + } + + if ( (c >= 0x0139 && c < 0x0149) || (c > 0x0178 && c < 0x017F) ) { + if ( c % 2 == 1 ) { + // if it's odd, it's a capital and the lower case is c +1 + u[0] = c; + u[1] = c+1; + } else { + // if it's even, it's a lower case and upper case is c-1 + u[0] = c-1; + u[1] = c; + } + return u; + } + if ( c == 0x017F ) { + u[0] = 0x0053; + u[1] = c; + } + + // Latin Extended B + // need to improve this set + + if ( c >= 0x0200 && c <= 0x0217 ) { + if ( c % 2 == 0 ) { + u[0] = c; + u[1] = c+1; + } else { + u[0] = c-1; + u[1] = c; + } + return u; + } + + // Latin Extended Additional + // Range: U+1E00 to U+1EFF + // http://www.unicode.org/Unicode.charts/glyphless/U1E00.html + + // Spacing Modifier Leters + // Range: U+02B0 to U+02FF + + // Combining Diacritical Marks + // Range: U+0300 to U+036F + + // skip Greek for now + // Greek + // Range: U+0370 to U+03FF + + // Cyrillic + // Range: U+0400 to U+04FF + + if ( (c >= 0x0401 && c <= 0x040C) || ( c>= 0x040E && c <= 0x040F ) ) { + u[0] = c; + u[1] = c + 80; + return u; + } + + + if ( c >= 0x0410 && c <= 0x042F ) { + u[0] = c; + u[1] = c + 32; + return u; + } + + if ( c >= 0x0430 && c<= 0x044F ) { + u[0] = c - 32; + u[1] = c; + return u; + + } + if ( (c >= 0x0451 && c <= 0x045C) || (c >=0x045E && c<= 0x045F) ) { + u[0] = c -80; + u[1] = c; + return u; + } + + if ( c >= 0x0460 && c <= 0x047F ) { + if ( c % 2 == 0 ) { + u[0] = c; + u[1] = c +1; + } else { + u[0] = c - 1; + u[1] = c; + } + return u; + } + + // Armenian + // Range: U+0530 to U+058F + if ( c >= 0x0531 && c <= 0x0556 ) { + u[0] = c; + u[1] = c + 48; + return u; + } + if ( c >= 0x0561 && c < 0x0587 ) { + u[0] = c - 48; + u[1] = c; + return u; + } + + // Hebrew + // Range: U+0590 to U+05FF + + + // Arabic + // Range: U+0600 to U+06FF + + // Devanagari + // Range: U+0900 to U+097F + + + // Bengali + // Range: U+0980 to U+09FF + + + // Gurmukhi + // Range: U+0A00 to U+0A7F + + + // Gujarati + // Range: U+0A80 to U+0AFF + + + // Oriya + // Range: U+0B00 to U+0B7F + // no capital / lower case + + + // Tamil + // Range: U+0B80 to U+0BFF + // no capital / lower case + + + // Telugu + // Range: U+0C00 to U+0C7F + // no capital / lower case + + + // Kannada + // Range: U+0C80 to U+0CFF + // no capital / lower case + + + // Malayalam + // Range: U+0D00 to U+0D7F + + // Thai + // Range: U+0E00 to U+0E7F + + + // Lao + // Range: U+0E80 to U+0EFF + + + // Tibetan + // Range: U+0F00 to U+0FBF + + // Georgian + // Range: U+10A0 to U+10F0 + if ( c >= 0x10A0 && c <= 0x10C5 ) { + u[0] = c; + u[1] = c + 48; + return u; + } + if ( c >= 0x10D0 && c <= 0x10F5 ) { + u[0] = c; + u[1] = c; + return u; + } + + // Hangul Jamo + // Range: U+1100 to U+11FF + + // Greek Extended + // Range: U+1F00 to U+1FFF + // skip for now + + + // General Punctuation + // Range: U+2000 to U+206F + + // Superscripts and Subscripts + // Range: U+2070 to U+209F + + // Currency Symbols + // Range: U+20A0 to U+20CF + + + // Combining Diacritical Marks for Symbols + // Range: U+20D0 to U+20FF + // skip for now + + + // Number Forms + // Range: U+2150 to U+218F + // skip for now + + + // Arrows + // Range: U+2190 to U+21FF + + // Mathematical Operators + // Range: U+2200 to U+22FF + + // Miscellaneous Technical + // Range: U+2300 to U+23FF + + // Control Pictures + // Range: U+2400 to U+243F + + // Optical Character Recognition + // Range: U+2440 to U+245F + + // Enclosed Alphanumerics + // Range: U+2460 to U+24FF + + // Box Drawing + // Range: U+2500 to U+257F + + // Block Elements + // Range: U+2580 to U+259F + + // Geometric Shapes + // Range: U+25A0 to U+25FF + + // Miscellaneous Symbols + // Range: U+2600 to U+26FF + + // Dingbats + // Range: U+2700 to U+27BF + + // CJK Symbols and Punctuation + // Range: U+3000 to U+303F + + // Hiragana + // Range: U+3040 to U+309F + + // Katakana + // Range: U+30A0 to U+30FF + + // Bopomofo + // Range: U+3100 to U+312F + + // Hangul Compatibility Jamo + // Range: U+3130 to U+318F + + // Kanbun + // Range: U+3190 to U+319F + + + // Enclosed CJK Letters and Months + // Range: U+3200 to U+32FF + + // CJK Compatibility + // Range: U+3300 to U+33FF + + // Hangul Syllables + // Range: U+AC00 to U+D7A3 + + // High Surrogates + // Range: U+D800 to U+DB7F + + // Private Use High Surrogates + // Range: U+DB80 to U+DBFF + + // Low Surrogates + // Range: U+DC00 to U+DFFF + + // Private Use Area + // Range: U+E000 to U+F8FF + + // CJK Compatibility Ideographs + // Range: U+F900 to U+FAFF + + // Alphabetic Presentation Forms + // Range: U+FB00 to U+FB4F + + // Arabic Presentation Forms-A + // Range: U+FB50 to U+FDFF + + // Combining Half Marks + // Range: U+FE20 to U+FE2F + + // CJK Compatibility Forms + // Range: U+FE30 to U+FE4F + + // Small Form Variants + // Range: U+FE50 to U+FE6F + + // Arabic Presentation Forms-B + // Range: U+FE70 to U+FEFF + + // Halfwidth and Fullwidth Forms + // Range: U+FF00 to U+FFEF + + if ( c >= 0xFF21 && c <= 0xFF3A ) { + u[0] = c; + u[1] = c + 32; + return u; + } + + if ( c >= 0xFF41 && c <= 0xFF5A ) { + u[0] = c - 32; + u[1] = c; + return u; + } + + // Specials + // Range: U+FFF0 to U+FFFF + + return u; +} + +function DecimalToHexString( n ) { + n = Number( n ); + var h = "0x"; + + for ( var i = 3; i >= 0; i-- ) { + if ( n >= Math.pow(16, i) ){ + var t = Math.floor( n / Math.pow(16, i)); + n -= t * Math.pow(16, i); + if ( t >= 10 ) { + if ( t == 10 ) { + h += "A"; + } + if ( t == 11 ) { + h += "B"; + } + if ( t == 12 ) { + h += "C"; + } + if ( t == 13 ) { + h += "D"; + } + if ( t == 14 ) { + h += "E"; + } + if ( t == 15 ) { + h += "F"; + } + } else { + h += String( t ); + } + } else { + h += "0"; + } + } + + return h; +} diff --git a/mozilla/js/tamarin/test/ecma3/String/toLocaleLowerCase2.as b/mozilla/js/tamarin/test/ecma3/String/toLocaleLowerCase2.as new file mode 100644 index 00000000000..d66cf6905f5 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/toLocaleLowerCase2.as @@ -0,0 +1,494 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.5.4.17"; + var VERSION = "ECMA_1"; + + startTest(); + var TITLE = "String.prototype.toLocaleLowerCase()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // Georgian + // Range: U+10A0 to U+10FF + for ( var i = 0x10A0; i <= 0x10FF; i++ ) { + var U = new Unicode( i ); + +/* + array[item++] = new TestCase( SECTION, + "var s = new String( String.fromCharCode("+i+") ); s.toLocaleLowerCase()", + String.fromCharCode(U.lower), + (s = new String( String.fromCharCode("+i+ ) ), s.toLocaleLowerCase()") ); +*/ + array[item++] = new TestCase( SECTION, + "var s = new String( String.fromCharCode("+i+") ); s.toLocaleLowerCase().charCodeAt(0)", + U.lower, + (s = new String( String.fromCharCode(i) ), s.toLocaleLowerCase().charCodeAt(0) ) ); + } + + return array; +} + +function MyObject( value ) { + this.value = value; + this.substring = String.prototype.substring; + this.toString = function() { return this.value+''; } +} +function Unicode( c ) { + u = GetUnicodeValues( c ); + this.upper = u[0]; + this.lower = u[1] + return this; +} +function GetUnicodeValues( c ) { + u = new Array(); + + u[0] = c; + u[1] = c; + + // upper case Basic Latin + + if ( c >= 0x0041 && c <= 0x005A) { + u[0] = c; + u[1] = c + 32; + return u; + } + + // lower case Basic Latin + if ( c >= 0x0061 && c <= 0x007a ) { + u[0] = c - 32; + u[1] = c; + return u; + } + + // upper case Latin-1 Supplement + if ( (c >= 0x00C0 && c <= 0x00D6) || (c >= 0x00D8 && c<=0x00DE) ) { + u[0] = c; + u[1] = c + 32; + return u; + } + + // lower case Latin-1 Supplement + if ( (c >= 0x00E0 && c <= 0x00F6) || (c >= 0x00F8 && c <= 0x00FE) ) { + u[0] = c - 32; + u[1] = c; + return u; + } + if ( c == 0x00FF ) { + u[0] = 0x0178; + u[1] = c; + return u; + } + // Latin Extended A + if ( (c >= 0x0100 && c < 0x0138) || (c > 0x0149 && c < 0x0178) ) { + // special case for capital I + if ( c == 0x0130 ) { + u[0] = c; + u[1] = 0x0069; + return u; + } + if ( c == 0x0131 ) { + u[0] = 0x0049; + u[1] = c; + return u; + } + + if ( c % 2 == 0 ) { + // if it's even, it's a capital and the lower case is c +1 + u[0] = c; + u[1] = c+1; + } else { + // if it's odd, it's a lower case and upper case is c-1 + u[0] = c-1; + u[1] = c; + } + return u; + } + if ( c == 0x0178 ) { + u[0] = c; + u[1] = 0x00FF; + return u; + } + + if ( (c >= 0x0139 && c < 0x0149) || (c > 0x0178 && c < 0x017F) ) { + if ( c % 2 == 1 ) { + // if it's odd, it's a capital and the lower case is c +1 + u[0] = c; + u[1] = c+1; + } else { + // if it's even, it's a lower case and upper case is c-1 + u[0] = c-1; + u[1] = c; + } + return u; + } + if ( c == 0x017F ) { + u[0] = 0x0053; + u[1] = c; + } + + // Latin Extended B + // need to improve this set + + if ( c >= 0x0200 && c <= 0x0217 ) { + if ( c % 2 == 0 ) { + u[0] = c; + u[1] = c+1; + } else { + u[0] = c-1; + u[1] = c; + } + return u; + } + + // Latin Extended Additional + // Range: U+1E00 to U+1EFF + // http://www.unicode.org/Unicode.charts/glyphless/U1E00.html + + // Spacing Modifier Leters + // Range: U+02B0 to U+02FF + + // Combining Diacritical Marks + // Range: U+0300 to U+036F + + // skip Greek for now + // Greek + // Range: U+0370 to U+03FF + + // Cyrillic + // Range: U+0400 to U+04FF + + if ( (c >= 0x0401 && c <= 0x040C) || ( c>= 0x040E && c <= 0x040F ) ) { + u[0] = c; + u[1] = c + 80; + return u; + } + + + if ( c >= 0x0410 && c <= 0x042F ) { + u[0] = c; + u[1] = c + 32; + return u; + } + + if ( c >= 0x0430 && c<= 0x044F ) { + u[0] = c - 32; + u[1] = c; + return u; + + } + if ( (c >= 0x0451 && c <= 0x045C) || (c >=0x045E && c<= 0x045F) ) { + u[0] = c -80; + u[1] = c; + return u; + } + + if ( c >= 0x0460 && c <= 0x047F ) { + if ( c % 2 == 0 ) { + u[0] = c; + u[1] = c +1; + } else { + u[0] = c - 1; + u[1] = c; + } + return u; + } + + // Armenian + // Range: U+0530 to U+058F + if ( c >= 0x0531 && c <= 0x0556 ) { + u[0] = c; + u[1] = c + 48; + return u; + } + if ( c >= 0x0561 && c < 0x0587 ) { + u[0] = c - 48; + u[1] = c; + return u; + } + + // Hebrew + // Range: U+0590 to U+05FF + + + // Arabic + // Range: U+0600 to U+06FF + + // Devanagari + // Range: U+0900 to U+097F + + + // Bengali + // Range: U+0980 to U+09FF + + + // Gurmukhi + // Range: U+0A00 to U+0A7F + + + // Gujarati + // Range: U+0A80 to U+0AFF + + + // Oriya + // Range: U+0B00 to U+0B7F + // no capital / lower case + + + // Tamil + // Range: U+0B80 to U+0BFF + // no capital / lower case + + + // Telugu + // Range: U+0C00 to U+0C7F + // no capital / lower case + + + // Kannada + // Range: U+0C80 to U+0CFF + // no capital / lower case + + + // Malayalam + // Range: U+0D00 to U+0D7F + + // Thai + // Range: U+0E00 to U+0E7F + + + // Lao + // Range: U+0E80 to U+0EFF + + + // Tibetan + // Range: U+0F00 to U+0FBF + + // Georgian + // Range: U+10A0 to U+10F0 + if ( c >= 0x10A0 && c <= 0x10C5 ) { + u[0] = c; + u[1] = c + 48; + return u; + } + if ( c >= 0x10D0 && c <= 0x10F5 ) { + u[0] = c; + u[1] = c; + return u; + } + + // Hangul Jamo + // Range: U+1100 to U+11FF + + // Greek Extended + // Range: U+1F00 to U+1FFF + // skip for now + + + // General Punctuation + // Range: U+2000 to U+206F + + // Superscripts and Subscripts + // Range: U+2070 to U+209F + + // Currency Symbols + // Range: U+20A0 to U+20CF + + + // Combining Diacritical Marks for Symbols + // Range: U+20D0 to U+20FF + // skip for now + + + // Number Forms + // Range: U+2150 to U+218F + // skip for now + + + // Arrows + // Range: U+2190 to U+21FF + + // Mathematical Operators + // Range: U+2200 to U+22FF + + // Miscellaneous Technical + // Range: U+2300 to U+23FF + + // Control Pictures + // Range: U+2400 to U+243F + + // Optical Character Recognition + // Range: U+2440 to U+245F + + // Enclosed Alphanumerics + // Range: U+2460 to U+24FF + + // Box Drawing + // Range: U+2500 to U+257F + + // Block Elements + // Range: U+2580 to U+259F + + // Geometric Shapes + // Range: U+25A0 to U+25FF + + // Miscellaneous Symbols + // Range: U+2600 to U+26FF + + // Dingbats + // Range: U+2700 to U+27BF + + // CJK Symbols and Punctuation + // Range: U+3000 to U+303F + + // Hiragana + // Range: U+3040 to U+309F + + // Katakana + // Range: U+30A0 to U+30FF + + // Bopomofo + // Range: U+3100 to U+312F + + // Hangul Compatibility Jamo + // Range: U+3130 to U+318F + + // Kanbun + // Range: U+3190 to U+319F + + + // Enclosed CJK Letters and Months + // Range: U+3200 to U+32FF + + // CJK Compatibility + // Range: U+3300 to U+33FF + + // Hangul Syllables + // Range: U+AC00 to U+D7A3 + + // High Surrogates + // Range: U+D800 to U+DB7F + + // Private Use High Surrogates + // Range: U+DB80 to U+DBFF + + // Low Surrogates + // Range: U+DC00 to U+DFFF + + // Private Use Area + // Range: U+E000 to U+F8FF + + // CJK Compatibility Ideographs + // Range: U+F900 to U+FAFF + + // Alphabetic Presentation Forms + // Range: U+FB00 to U+FB4F + + // Arabic Presentation Forms-A + // Range: U+FB50 to U+FDFF + + // Combining Half Marks + // Range: U+FE20 to U+FE2F + + // CJK Compatibility Forms + // Range: U+FE30 to U+FE4F + + // Small Form Variants + // Range: U+FE50 to U+FE6F + + // Arabic Presentation Forms-B + // Range: U+FE70 to U+FEFF + + // Halfwidth and Fullwidth Forms + // Range: U+FF00 to U+FFEF + + if ( c >= 0xFF21 && c <= 0xFF3A ) { + u[0] = c; + u[1] = c + 32; + return u; + } + + if ( c >= 0xFF41 && c <= 0xFF5A ) { + u[0] = c - 32; + u[1] = c; + return u; + } + + // Specials + // Range: U+FFF0 to U+FFFF + + return u; +} + +function DecimalToHexString( n ) { + n = Number( n ); + var h = "0x"; + + for ( var i = 3; i >= 0; i-- ) { + if ( n >= Math.pow(16, i) ){ + var t = Math.floor( n / Math.pow(16, i)); + n -= t * Math.pow(16, i); + if ( t >= 10 ) { + if ( t == 10 ) { + h += "A"; + } + if ( t == 11 ) { + h += "B"; + } + if ( t == 12 ) { + h += "C"; + } + if ( t == 13 ) { + h += "D"; + } + if ( t == 14 ) { + h += "E"; + } + if ( t == 15 ) { + h += "F"; + } + } else { + h += String( t ); + } + } else { + h += "0"; + } + } + + return h; +} diff --git a/mozilla/js/tamarin/test/ecma3/String/toLocaleLowerCase3.as b/mozilla/js/tamarin/test/ecma3/String/toLocaleLowerCase3.as new file mode 100644 index 00000000000..4d140ff9899 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/toLocaleLowerCase3.as @@ -0,0 +1,493 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.5.4.17"; + var VERSION = "ECMA_1"; + + startTest(); + var TITLE = "String.prototype.toLocaleLowerCase()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + // Halfwidth and Fullwidth Forms + // Range: U+FF00 to U+FFEF + for ( var i = 0xFF00; i <= 0xFFEF; i++ ) { + var U = new Unicode(i); +/* + array[item++] = new TestCase( SECTION, + "var s = new String( String.fromCharCode("+i+") ); s.toLocaleLowerCase()", + String.fromCharCode(U.lower), + (s = new String( String.fromCharCode("+i+ ) ), s.toLocaleLowerCase()") ); +*/ + s = new String(String.fromCharCode(i)); + array[item++] = new TestCase( SECTION, + "var s = new String( String.fromCharCode("+i+") ); s.toLocaleLowerCase().charCodeAt(0)", + U.lower, + s.toLocaleLowerCase().charCodeAt(0)); + } + + return array; +} + +function MyObject( value ) { + this.value = value; + this.substring = String.prototype.substring; + this.toString = function() { return this.value+''; } +} +function Unicode( c ) { + u = GetUnicodeValues( c ); + this.upper = u[0]; + this.lower = u[1] + return this; +} +function GetUnicodeValues( c ) { + u = new Array(); + + u[0] = c; + u[1] = c; + + // upper case Basic Latin + + if ( c >= 0x0041 && c <= 0x005A) { + u[0] = c; + u[1] = c + 32; + return u; + } + + // lower case Basic Latin + if ( c >= 0x0061 && c <= 0x007a ) { + u[0] = c - 32; + u[1] = c; + return u; + } + + // upper case Latin-1 Supplement + if ( (c >= 0x00C0 && c <= 0x00D6) || (c >= 0x00D8 && c<=0x00DE) ) { + u[0] = c; + u[1] = c + 32; + return u; + } + + // lower case Latin-1 Supplement + if ( (c >= 0x00E0 && c <= 0x00F6) || (c >= 0x00F8 && c <= 0x00FE) ) { + u[0] = c - 32; + u[1] = c; + return u; + } + if ( c == 0x00FF ) { + u[0] = 0x0178; + u[1] = c; + return u; + } + // Latin Extended A + if ( (c >= 0x0100 && c < 0x0138) || (c > 0x0149 && c < 0x0178) ) { + // special case for capital I + if ( c == 0x0130 ) { + u[0] = c; + u[1] = 0x0069; + return u; + } + if ( c == 0x0131 ) { + u[0] = 0x0049; + u[1] = c; + return u; + } + + if ( c % 2 == 0 ) { + // if it's even, it's a capital and the lower case is c +1 + u[0] = c; + u[1] = c+1; + } else { + // if it's odd, it's a lower case and upper case is c-1 + u[0] = c-1; + u[1] = c; + } + return u; + } + if ( c == 0x0178 ) { + u[0] = c; + u[1] = 0x00FF; + return u; + } + + if ( (c >= 0x0139 && c < 0x0149) || (c > 0x0178 && c < 0x017F) ) { + if ( c % 2 == 1 ) { + // if it's odd, it's a capital and the lower case is c +1 + u[0] = c; + u[1] = c+1; + } else { + // if it's even, it's a lower case and upper case is c-1 + u[0] = c-1; + u[1] = c; + } + return u; + } + if ( c == 0x017F ) { + u[0] = 0x0053; + u[1] = c; + } + + // Latin Extended B + // need to improve this set + + if ( c >= 0x0200 && c <= 0x0217 ) { + if ( c % 2 == 0 ) { + u[0] = c; + u[1] = c+1; + } else { + u[0] = c-1; + u[1] = c; + } + return u; + } + + // Latin Extended Additional + // Range: U+1E00 to U+1EFF + // http://www.unicode.org/Unicode.charts/glyphless/U1E00.html + + // Spacing Modifier Leters + // Range: U+02B0 to U+02FF + + // Combining Diacritical Marks + // Range: U+0300 to U+036F + + // skip Greek for now + // Greek + // Range: U+0370 to U+03FF + + // Cyrillic + // Range: U+0400 to U+04FF + + if ( (c >= 0x0401 && c <= 0x040C) || ( c>= 0x040E && c <= 0x040F ) ) { + u[0] = c; + u[1] = c + 80; + return u; + } + + + if ( c >= 0x0410 && c <= 0x042F ) { + u[0] = c; + u[1] = c + 32; + return u; + } + + if ( c >= 0x0430 && c<= 0x044F ) { + u[0] = c - 32; + u[1] = c; + return u; + + } + if ( (c >= 0x0451 && c <= 0x045C) || (c >=0x045E && c<= 0x045F) ) { + u[0] = c -80; + u[1] = c; + return u; + } + + if ( c >= 0x0460 && c <= 0x047F ) { + if ( c % 2 == 0 ) { + u[0] = c; + u[1] = c +1; + } else { + u[0] = c - 1; + u[1] = c; + } + return u; + } + + // Armenian + // Range: U+0530 to U+058F + if ( c >= 0x0531 && c <= 0x0556 ) { + u[0] = c; + u[1] = c + 48; + return u; + } + if ( c >= 0x0561 && c < 0x0587 ) { + u[0] = c - 48; + u[1] = c; + return u; + } + + // Hebrew + // Range: U+0590 to U+05FF + + + // Arabic + // Range: U+0600 to U+06FF + + // Devanagari + // Range: U+0900 to U+097F + + + // Bengali + // Range: U+0980 to U+09FF + + + // Gurmukhi + // Range: U+0A00 to U+0A7F + + + // Gujarati + // Range: U+0A80 to U+0AFF + + + // Oriya + // Range: U+0B00 to U+0B7F + // no capital / lower case + + + // Tamil + // Range: U+0B80 to U+0BFF + // no capital / lower case + + + // Telugu + // Range: U+0C00 to U+0C7F + // no capital / lower case + + + // Kannada + // Range: U+0C80 to U+0CFF + // no capital / lower case + + + // Malayalam + // Range: U+0D00 to U+0D7F + + // Thai + // Range: U+0E00 to U+0E7F + + + // Lao + // Range: U+0E80 to U+0EFF + + + // Tibetan + // Range: U+0F00 to U+0FBF + + // Georgian + // Range: U+10A0 to U+10F0 + if ( c >= 0x10A0 && c <= 0x10C5 ) { + u[0] = c; + u[1] = c + 48; + return u; + } + if ( c >= 0x10D0 && c <= 0x10F5 ) { + u[0] = c; + u[1] = c; + return u; + } + + // Hangul Jamo + // Range: U+1100 to U+11FF + + // Greek Extended + // Range: U+1F00 to U+1FFF + // skip for now + + + // General Punctuation + // Range: U+2000 to U+206F + + // Superscripts and Subscripts + // Range: U+2070 to U+209F + + // Currency Symbols + // Range: U+20A0 to U+20CF + + + // Combining Diacritical Marks for Symbols + // Range: U+20D0 to U+20FF + // skip for now + + + // Number Forms + // Range: U+2150 to U+218F + // skip for now + + + // Arrows + // Range: U+2190 to U+21FF + + // Mathematical Operators + // Range: U+2200 to U+22FF + + // Miscellaneous Technical + // Range: U+2300 to U+23FF + + // Control Pictures + // Range: U+2400 to U+243F + + // Optical Character Recognition + // Range: U+2440 to U+245F + + // Enclosed Alphanumerics + // Range: U+2460 to U+24FF + + // Box Drawing + // Range: U+2500 to U+257F + + // Block Elements + // Range: U+2580 to U+259F + + // Geometric Shapes + // Range: U+25A0 to U+25FF + + // Miscellaneous Symbols + // Range: U+2600 to U+26FF + + // Dingbats + // Range: U+2700 to U+27BF + + // CJK Symbols and Punctuation + // Range: U+3000 to U+303F + + // Hiragana + // Range: U+3040 to U+309F + + // Katakana + // Range: U+30A0 to U+30FF + + // Bopomofo + // Range: U+3100 to U+312F + + // Hangul Compatibility Jamo + // Range: U+3130 to U+318F + + // Kanbun + // Range: U+3190 to U+319F + + + // Enclosed CJK Letters and Months + // Range: U+3200 to U+32FF + + // CJK Compatibility + // Range: U+3300 to U+33FF + + // Hangul Syllables + // Range: U+AC00 to U+D7A3 + + // High Surrogates + // Range: U+D800 to U+DB7F + + // Private Use High Surrogates + // Range: U+DB80 to U+DBFF + + // Low Surrogates + // Range: U+DC00 to U+DFFF + + // Private Use Area + // Range: U+E000 to U+F8FF + + // CJK Compatibility Ideographs + // Range: U+F900 to U+FAFF + + // Alphabetic Presentation Forms + // Range: U+FB00 to U+FB4F + + // Arabic Presentation Forms-A + // Range: U+FB50 to U+FDFF + + // Combining Half Marks + // Range: U+FE20 to U+FE2F + + // CJK Compatibility Forms + // Range: U+FE30 to U+FE4F + + // Small Form Variants + // Range: U+FE50 to U+FE6F + + // Arabic Presentation Forms-B + // Range: U+FE70 to U+FEFF + + // Halfwidth and Fullwidth Forms + // Range: U+FF00 to U+FFEF + + if ( c >= 0xFF21 && c <= 0xFF3A ) { + u[0] = c; + u[1] = c + 32; + return u; + } + + if ( c >= 0xFF41 && c <= 0xFF5A ) { + u[0] = c - 32; + u[1] = c; + return u; + } + + // Specials + // Range: U+FFF0 to U+FFFF + + return u; +} + +function DecimalToHexString( n ) { + n = Number( n ); + var h = "0x"; + + for ( var i = 3; i >= 0; i-- ) { + if ( n >= Math.pow(16, i) ){ + var t = Math.floor( n / Math.pow(16, i)); + n -= t * Math.pow(16, i); + if ( t >= 10 ) { + if ( t == 10 ) { + h += "A"; + } + if ( t == 11 ) { + h += "B"; + } + if ( t == 12 ) { + h += "C"; + } + if ( t == 13 ) { + h += "D"; + } + if ( t == 14 ) { + h += "E"; + } + if ( t == 15 ) { + h += "F"; + } + } else { + h += String( t ); + } + } else { + h += "0"; + } + } + + return h; +} diff --git a/mozilla/js/tamarin/test/ecma3/String/toLocaleLowerCase4.as b/mozilla/js/tamarin/test/ecma3/String/toLocaleLowerCase4.as new file mode 100644 index 00000000000..71ea39c9d9b --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/toLocaleLowerCase4.as @@ -0,0 +1,486 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.5.4.17"; + var VERSION = "ECMA_1"; + + startTest(); + var TITLE = "String.prototype.toLocaleLowerCase()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // Hiragana (no upper / lower case) + // Range: U+3040 to U+309F + + for ( var i = 0x3040; i <= 0x309F; i++ ) { + var U = new Unicode( i ); +/* + array[item++] = new TestCase( SECTION, + "var s = new String( String.fromCharCode("+i+") ); s.toLocaleLowerCase()", + String.fromCharCode(U.lower), + (s = new String( String.fromCharCode("+i+ ) ), s.toLocaleLowerCase()") ); +*/ + array[item++] = new TestCase( SECTION, + "var s = new String( String.fromCharCode("+i+") ); s.toLocaleLowerCase().charCodeAt(0)", + U.lower, + (s = new String( String.fromCharCode(i) ), s.toLocaleLowerCase().charCodeAt(0) ) ); + } + + return array; +} + +function MyObject( value ) { + this.value = value; + this.substring = String.prototype.substring; + this.toString = function () { return this.value+''; } +} +function Unicode( c ) { + this.upper = c; + this.lower = c; + + // upper case Basic Latin + + if ( c >= 0x0041 && c <= 0x005A) { + this.upper = c; + this.lower = c + 32; + return this; + } + + // lower case Basic Latin + if ( c >= 0x0061 && c <= 0x007a ) { + this.upper = c - 32; + this.lower = c; + return this; + } + + // upper case Latin-1 Supplement + if ( (c >= 0x00C0 && c <= 0x00D6) || (c >= 0x00D8 && c<=0x00DE) ) { + this.upper = c; + this.lower = c + 32; + return this; + } + + // lower case Latin-1 Supplement + if ( (c >= 0x00E0 && c <= 0x00F6) || (c >= 0x00F8 && c <= 0x00FE) ) { + this.upper = c - 32; + this.lower = c; + return this; + } + if ( c == 0x00FF ) { + this.upper = 0x0178; + this.lower = c; + return this; + } + // Latin Extended A + if ( (c >= 0x0100 && c < 0x0138) || (c > 0x0149 && c < 0x0178) ) { + // special case for capital I + if ( c == 0x0130 ) { + this.upper = c; + this.lower = 0x0069; + return this; + } + if ( c == 0x0131 ) { + this.upper = 0x0049; + this.lower = c; + return this; + } + + if ( c % 2 == 0 ) { + // if it's even, it's a capital and the lower case is c +1 + this.upper = c; + this.lower = c+1; + } else { + // if it's odd, it's a lower case and upper case is c-1 + this.upper = c-1; + this.lower = c; + } + return this; + } + if ( c == 0x0178 ) { + this.upper = c; + this.lower = 0x00FF; + return this; + } + + if ( (c >= 0x0139 && c < 0x0149) || (c > 0x0178 && c < 0x017F) ) { + if ( c % 2 == 1 ) { + // if it's odd, it's a capital and the lower case is c +1 + this.upper = c; + this.lower = c+1; + } else { + // if it's even, it's a lower case and upper case is c-1 + this.upper = c-1; + this.lower = c; + } + return this; + } + if ( c == 0x017F ) { + this.upper = 0x0053; + this.lower = c; + } + + // Latin Extended B + // need to improve this set + + if ( c >= 0x0200 && c <= 0x0217 ) { + if ( c % 2 == 0 ) { + this.upper = c; + this.lower = c+1; + } else { + this.upper = c-1; + this.lower = c; + } + return this; + } + + // Latin Extended Additional + // Range: U+1E00 to U+1EFF + // http://www.unicode.org/Unicode.charts/glyphless/U1E00.html + + // Spacing Modifier Leters + // Range: U+02B0 to U+02FF + + // Combining Diacritical Marks + // Range: U+0300 to U+036F + + // skip Greek for now + // Greek + // Range: U+0370 to U+03FF + + // Cyrillic + // Range: U+0400 to U+04FF + + if ( (c >= 0x0401 && c <= 0x040C) || ( c>= 0x040E && c <= 0x040F ) ) { + this.upper = c; + this.lower = c + 80; + return this; + } + + + if ( c >= 0x0410 && c <= 0x042F ) { + this.upper = c; + this.lower = c + 32; + return this; + } + + if ( c >= 0x0430 && c<= 0x044F ) { + this.upper = c - 32; + this.lower = c; + return this; + + } + if ( (c >= 0x0451 && c <= 0x045C) || (c >=0x045E && c<= 0x045F) ) { + this.upper = c -80; + this.lower = c; + return this; + } + + if ( c >= 0x0460 && c <= 0x047F ) { + if ( c % 2 == 0 ) { + this.upper = c; + this.lower = c +1; + } else { + this.upper = c - 1; + this.lower = c; + } + return this; + } + + // Armenian + // Range: U+0530 to U+058F + if ( c >= 0x0531 && c <= 0x0556 ) { + this.upper = c; + this.lower = c + 48; + return this; + } + if ( c >= 0x0561 && c < 0x0587 ) { + this.upper = c - 48; + this.lower = c; + return this; + } + + // Hebrew + // Range: U+0590 to U+05FF + + + // Arabic + // Range: U+0600 to U+06FF + + // Devanagari + // Range: U+0900 to U+097F + + + // Bengali + // Range: U+0980 to U+09FF + + + // Gurmukhi + // Range: U+0A00 to U+0A7F + + + // Gujarati + // Range: U+0A80 to U+0AFF + + + // Oriya + // Range: U+0B00 to U+0B7F + // no capital / lower case + + + // Tamil + // Range: U+0B80 to U+0BFF + // no capital / lower case + + + // Telugu + // Range: U+0C00 to U+0C7F + // no capital / lower case + + + // Kannada + // Range: U+0C80 to U+0CFF + // no capital / lower case + + + // Malayalam + // Range: U+0D00 to U+0D7F + + // Thai + // Range: U+0E00 to U+0E7F + + + // Lao + // Range: U+0E80 to U+0EFF + + + // Tibetan + // Range: U+0F00 to U+0FBF + + // Georgian + // Range: U+10A0 to U+10F0 + if ( c >= 0x10A0 && c <= 0x10C5 ) { + this.upper = c; + this.lower = c + 48; + return this; + } + if ( c >= 0x10D0 && c <= 0x10F5 ) { + this.upper = c; + this.lower = c; + return this; + } + + // Hangul Jamo + // Range: U+1100 to U+11FF + + // Greek Extended + // Range: U+1F00 to U+1FFF + // skip for now + + + // General Punctuation + // Range: U+2000 to U+206F + + // Superscripts and Subscripts + // Range: U+2070 to U+209F + + // Currency Symbols + // Range: U+20A0 to U+20CF + + + // Combining Diacritical Marks for Symbols + // Range: U+20D0 to U+20FF + // skip for now + + + // Number Forms + // Range: U+2150 to U+218F + // skip for now + + + // Arrows + // Range: U+2190 to U+21FF + + // Mathematical Operators + // Range: U+2200 to U+22FF + + // Miscellaneous Technical + // Range: U+2300 to U+23FF + + // Control Pictures + // Range: U+2400 to U+243F + + // Optical Character Recognition + // Range: U+2440 to U+245F + + // Enclosed Alphanumerics + // Range: U+2460 to U+24FF + + // Box Drawing + // Range: U+2500 to U+257F + + // Block Elements + // Range: U+2580 to U+259F + + // Geometric Shapes + // Range: U+25A0 to U+25FF + + // Miscellaneous Symbols + // Range: U+2600 to U+26FF + + // Dingbats + // Range: U+2700 to U+27BF + + // CJK Symbols and Punctuation + // Range: U+3000 to U+303F + + // Hiragana + // Range: U+3040 to U+309F + + // Katakana + // Range: U+30A0 to U+30FF + + // Bopomofo + // Range: U+3100 to U+312F + + // Hangul Compatibility Jamo + // Range: U+3130 to U+318F + + // Kanbun + // Range: U+3190 to U+319F + + + // Enclosed CJK Letters and Months + // Range: U+3200 to U+32FF + + // CJK Compatibility + // Range: U+3300 to U+33FF + + // Hangul Syllables + // Range: U+AC00 to U+D7A3 + + // High Surrogates + // Range: U+D800 to U+DB7F + + // Private Use High Surrogates + // Range: U+DB80 to U+DBFF + + // Low Surrogates + // Range: U+DC00 to U+DFFF + + // Private Use Area + // Range: U+E000 to U+F8FF + + // CJK Compatibility Ideographs + // Range: U+F900 to U+FAFF + + // Alphabetic Presentation Forms + // Range: U+FB00 to U+FB4F + + // Arabic Presentation Forms-A + // Range: U+FB50 to U+FDFF + + // Combining Half Marks + // Range: U+FE20 to U+FE2F + + // CJK Compatibility Forms + // Range: U+FE30 to U+FE4F + + // Small Form Variants + // Range: U+FE50 to U+FE6F + + // Arabic Presentation Forms-B + // Range: U+FE70 to U+FEFF + + // Halfwidth and Fullwidth Forms + // Range: U+FF00 to U+FFEF + + if ( c >= 0xFF21 && c <= 0xFF3A ) { + this.upper = c; + this.lower = c + 32; + return this; + } + + if ( c >= 0xFF41 && c <= 0xFF5A ) { + this.upper = c - 32; + this.lower = c; + return this; + } + + // Specials + // Range: U+FFF0 to U+FFFF + + return this; +} + +function DecimalToHexString( n ) { + n = Number( n ); + var h = "0x"; + + for ( var i = 3; i >= 0; i-- ) { + if ( n >= Math.pow(16, i) ){ + var t = Math.floor( n / Math.pow(16, i)); + n -= t * Math.pow(16, i); + if ( t >= 10 ) { + if ( t == 10 ) { + h += "A"; + } + if ( t == 11 ) { + h += "B"; + } + if ( t == 12 ) { + h += "C"; + } + if ( t == 13 ) { + h += "D"; + } + if ( t == 14 ) { + h += "E"; + } + if ( t == 15 ) { + h += "F"; + } + } else { + h += String( t ); + } + } else { + h += "0"; + } + } + + return h; +} diff --git a/mozilla/js/tamarin/test/ecma3/String/toLocaleLowerCase5.as b/mozilla/js/tamarin/test/ecma3/String/toLocaleLowerCase5.as new file mode 100644 index 00000000000..7e5dbdaf7f3 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/toLocaleLowerCase5.as @@ -0,0 +1,497 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.5.4.17"; + var VERSION = "ECMA_1"; + + startTest(); + var TITLE = "String.prototype.toLocaleLowerCase()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "String.prototype.toLowerCase.length", 0, String.prototype.toLowerCase.length ); + array[item++] = new TestCase( SECTION, "delete String.prototype.toLowerCase.length", false, delete String.prototype.toLowerCase.length ); + array[item++] = new TestCase( SECTION, "delete String.prototype.toLowerCase.length; String.prototype.toLowerCase.length", 0, (delete String.prototype.toLowerCase.length, String.prototype.toLowerCase.length) ); + + // Cyrillic (part) + // Range: U+0400 to U+04FF + for ( var i = 0x0400; i <= 0x047F; i++ ) { + var U = new Unicode( i ); +/* + array[item++] = new TestCase( SECTION, + "var s = new String( String.fromCharCode("+i+") ); s.toLocaleLowerCase()", + String.fromCharCode(U.lower), + (s = new String( String.fromCharCode("+i+ ) ), s.toLocaleLowerCase()") ); +*/ + array[item++] = new TestCase( SECTION, + "var s = new String( String.fromCharCode("+i+") ); s.toLocaleLowerCase().charCodeAt(0)", + U.lower, + (s = new String( String.fromCharCode(i) ), s.toLocaleLowerCase().charCodeAt(0) ) ); + + } + return array; +} + +function MyObject( value ) { + this.value = value; + this.substring = String.prototype.substring; + this.toString = function () { return this.value+''; } +} +function Unicode( c ) { + u = GetUnicodeValues( c ); + this.upper = u[0]; + this.lower = u[1] + return this; +} +function GetUnicodeValues( c ) { + u = new Array(); + + u[0] = c; + u[1] = c; + + // upper case Basic Latin + + if ( c >= 0x0041 && c <= 0x005A) { + u[0] = c; + u[1] = c + 32; + return u; + } + + // lower case Basic Latin + if ( c >= 0x0061 && c <= 0x007a ) { + u[0] = c - 32; + u[1] = c; + return u; + } + + // upper case Latin-1 Supplement + if ( (c >= 0x00C0 && c <= 0x00D6) || (c >= 0x00D8 && c<=0x00DE) ) { + u[0] = c; + u[1] = c + 32; + return u; + } + + // lower case Latin-1 Supplement + if ( (c >= 0x00E0 && c <= 0x00F6) || (c >= 0x00F8 && c <= 0x00FE) ) { + u[0] = c - 32; + u[1] = c; + return u; + } + if ( c == 0x00FF ) { + u[0] = 0x0178; + u[1] = c; + return u; + } + // Latin Extended A + if ( (c >= 0x0100 && c < 0x0138) || (c > 0x0149 && c < 0x0178) ) { + // special case for capital I + if ( c == 0x0130 ) { + u[0] = c; + u[1] = 0x0069; + return u; + } + if ( c == 0x0131 ) { + u[0] = 0x0049; + u[1] = c; + return u; + } + + if ( c % 2 == 0 ) { + // if it's even, it's a capital and the lower case is c +1 + u[0] = c; + u[1] = c+1; + } else { + // if it's odd, it's a lower case and upper case is c-1 + u[0] = c-1; + u[1] = c; + } + return u; + } + if ( c == 0x0178 ) { + u[0] = c; + u[1] = 0x00FF; + return u; + } + + if ( (c >= 0x0139 && c < 0x0149) || (c > 0x0178 && c < 0x017F) ) { + if ( c % 2 == 1 ) { + // if it's odd, it's a capital and the lower case is c +1 + u[0] = c; + u[1] = c+1; + } else { + // if it's even, it's a lower case and upper case is c-1 + u[0] = c-1; + u[1] = c; + } + return u; + } + if ( c == 0x017F ) { + u[0] = 0x0053; + u[1] = c; + } + + // Latin Extended B + // need to improve this set + + if ( c >= 0x0200 && c <= 0x0217 ) { + if ( c % 2 == 0 ) { + u[0] = c; + u[1] = c+1; + } else { + u[0] = c-1; + u[1] = c; + } + return u; + } + + // Latin Extended Additional + // Range: U+1E00 to U+1EFF + // http://www.unicode.org/Unicode.charts/glyphless/U1E00.html + + // Spacing Modifier Leters + // Range: U+02B0 to U+02FF + + // Combining Diacritical Marks + // Range: U+0300 to U+036F + + // skip Greek for now + // Greek + // Range: U+0370 to U+03FF + + // Cyrillic + // Range: U+0400 to U+04FF + + if ( c >= 0x0400 && c <= 0x040F ) { + u[0] = c; + u[1] = c + 80; + return u; + } + + + if ( c >= 0x0410 && c <= 0x042F ) { + u[0] = c; + u[1] = c + 32; + return u; + } + + if ( c >= 0x0430 && c<= 0x044F ) { + u[0] = c - 32; + u[1] = c; + return u; + + } + if ( (c >= 0x0451 && c <= 0x045C) || (c >=0x045E && c<= 0x045F) ) { + u[0] = c -80; + u[1] = c; + return u; + } + + if ( c >= 0x0460 && c <= 0x047F ) { + if ( c % 2 == 0 ) { + u[0] = c; + u[1] = c +1; + } else { + u[0] = c - 1; + u[1] = c; + } + return u; + } + + // Armenian + // Range: U+0530 to U+058F + if ( c >= 0x0531 && c <= 0x0556 ) { + u[0] = c; + u[1] = c + 48; + return u; + } + if ( c >= 0x0561 && c < 0x0587 ) { + u[0] = c - 48; + u[1] = c; + return u; + } + + // Hebrew + // Range: U+0590 to U+05FF + + + // Arabic + // Range: U+0600 to U+06FF + + // Devanagari + // Range: U+0900 to U+097F + + + // Bengali + // Range: U+0980 to U+09FF + + + // Gurmukhi + // Range: U+0A00 to U+0A7F + + + // Gujarati + // Range: U+0A80 to U+0AFF + + + // Oriya + // Range: U+0B00 to U+0B7F + // no capital / lower case + + + // Tamil + // Range: U+0B80 to U+0BFF + // no capital / lower case + + + // Telugu + // Range: U+0C00 to U+0C7F + // no capital / lower case + + + // Kannada + // Range: U+0C80 to U+0CFF + // no capital / lower case + + + // Malayalam + // Range: U+0D00 to U+0D7F + + // Thai + // Range: U+0E00 to U+0E7F + + + // Lao + // Range: U+0E80 to U+0EFF + + + // Tibetan + // Range: U+0F00 to U+0FBF + + // Georgian + // Range: U+10A0 to U+10F0 + if ( c >= 0x10A0 && c <= 0x10C5 ) { + u[0] = c; + u[1] = c + 48; + return u; + } + if ( c >= 0x10D0 && c <= 0x10F5 ) { + u[0] = c; + u[1] = c; + return u; + } + + // Hangul Jamo + // Range: U+1100 to U+11FF + + // Greek Extended + // Range: U+1F00 to U+1FFF + // skip for now + + + // General Punctuation + // Range: U+2000 to U+206F + + // Superscripts and Subscripts + // Range: U+2070 to U+209F + + // Currency Symbols + // Range: U+20A0 to U+20CF + + + // Combining Diacritical Marks for Symbols + // Range: U+20D0 to U+20FF + // skip for now + + + // Number Forms + // Range: U+2150 to U+218F + // skip for now + + + // Arrows + // Range: U+2190 to U+21FF + + // Mathematical Operators + // Range: U+2200 to U+22FF + + // Miscellaneous Technical + // Range: U+2300 to U+23FF + + // Control Pictures + // Range: U+2400 to U+243F + + // Optical Character Recognition + // Range: U+2440 to U+245F + + // Enclosed Alphanumerics + // Range: U+2460 to U+24FF + + // Box Drawing + // Range: U+2500 to U+257F + + // Block Elements + // Range: U+2580 to U+259F + + // Geometric Shapes + // Range: U+25A0 to U+25FF + + // Miscellaneous Symbols + // Range: U+2600 to U+26FF + + // Dingbats + // Range: U+2700 to U+27BF + + // CJK Symbols and Punctuation + // Range: U+3000 to U+303F + + // Hiragana + // Range: U+3040 to U+309F + + // Katakana + // Range: U+30A0 to U+30FF + + // Bopomofo + // Range: U+3100 to U+312F + + // Hangul Compatibility Jamo + // Range: U+3130 to U+318F + + // Kanbun + // Range: U+3190 to U+319F + + + // Enclosed CJK Letters and Months + // Range: U+3200 to U+32FF + + // CJK Compatibility + // Range: U+3300 to U+33FF + + // Hangul Syllables + // Range: U+AC00 to U+D7A3 + + // High Surrogates + // Range: U+D800 to U+DB7F + + // Private Use High Surrogates + // Range: U+DB80 to U+DBFF + + // Low Surrogates + // Range: U+DC00 to U+DFFF + + // Private Use Area + // Range: U+E000 to U+F8FF + + // CJK Compatibility Ideographs + // Range: U+F900 to U+FAFF + + // Alphabetic Presentation Forms + // Range: U+FB00 to U+FB4F + + // Arabic Presentation Forms-A + // Range: U+FB50 to U+FDFF + + // Combining Half Marks + // Range: U+FE20 to U+FE2F + + // CJK Compatibility Forms + // Range: U+FE30 to U+FE4F + + // Small Form Variants + // Range: U+FE50 to U+FE6F + + // Arabic Presentation Forms-B + // Range: U+FE70 to U+FEFF + + // Halfwidth and Fullwidth Forms + // Range: U+FF00 to U+FFEF + + if ( c >= 0xFF21 && c <= 0xFF3A ) { + u[0] = c; + u[1] = c + 32; + return u; + } + + if ( c >= 0xFF41 && c <= 0xFF5A ) { + u[0] = c - 32; + u[1] = c; + return u; + } + + // Specials + // Range: U+FFF0 to U+FFFF + + return u; +} + +function DecimalToHexString( n ) { + n = Number( n ); + var h = "0x"; + + for ( var i = 3; i >= 0; i-- ) { + if ( n >= Math.pow(16, i) ){ + var t = Math.floor( n / Math.pow(16, i)); + n -= t * Math.pow(16, i); + if ( t >= 10 ) { + if ( t == 10 ) { + h += "A"; + } + if ( t == 11 ) { + h += "B"; + } + if ( t == 12 ) { + h += "C"; + } + if ( t == 13 ) { + h += "D"; + } + if ( t == 14 ) { + h += "E"; + } + if ( t == 15 ) { + h += "F"; + } + } else { + h += String( t ); + } + } else { + h += "0"; + } + } + + return h; +} diff --git a/mozilla/js/tamarin/test/ecma3/String/toLocaleLowerCase6.as b/mozilla/js/tamarin/test/ecma3/String/toLocaleLowerCase6.as new file mode 100644 index 00000000000..38aa07c6e1f --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/toLocaleLowerCase6.as @@ -0,0 +1,494 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.5.4.17"; + var VERSION = "ECMA_1"; + + startTest(); + var TITLE = "String.prototype.toLocaleLowerCase()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // Armenian + // Range: U+0530 to U+058F + for ( var i = 0x0530; i <= 0x058F; i++ ) { + + var U = new Unicode( i ); +/* + array[item++] = new TestCase( SECTION, + "var s = new String( String.fromCharCode("+i+") ); s.toLocaleLowerCase()", + String.fromCharCode(U.lower), + (s = new String( String.fromCharCode("+i+ ) ), s.toLocaleLowerCase()") ); +*/ + array[item++] = new TestCase( SECTION, + "var s = new String( String.fromCharCode("+i+") ); s.toLocaleLowerCase().charCodeAt(0)", + U.lower, + (s = new String( String.fromCharCode(i) ), s.toLocaleLowerCase().charCodeAt(0) ) ); + + } + return array; +} + +function MyObject( value ) { + this.value = value; + this.substring = String.prototype.substring; + this.toString = function () { return this.value+''; } +} +function Unicode( c ) { + u = GetUnicodeValues( c ); + this.upper = u[0]; + this.lower = u[1] + return this; +} +function GetUnicodeValues( c ) { + u = new Array(); + + u[0] = c; + u[1] = c; + + // upper case Basic Latin + + if ( c >= 0x0041 && c <= 0x005A) { + u[0] = c; + u[1] = c + 32; + return u; + } + + // lower case Basic Latin + if ( c >= 0x0061 && c <= 0x007a ) { + u[0] = c - 32; + u[1] = c; + return u; + } + + // upper case Latin-1 Supplement + if ( (c >= 0x00C0 && c <= 0x00D6) || (c >= 0x00D8 && c<=0x00DE) ) { + u[0] = c; + u[1] = c + 32; + return u; + } + + // lower case Latin-1 Supplement + if ( (c >= 0x00E0 && c <= 0x00F6) || (c >= 0x00F8 && c <= 0x00FE) ) { + u[0] = c - 32; + u[1] = c; + return u; + } + if ( c == 0x00FF ) { + u[0] = 0x0178; + u[1] = c; + return u; + } + // Latin Extended A + if ( (c >= 0x0100 && c < 0x0138) || (c > 0x0149 && c < 0x0178) ) { + // special case for capital I + if ( c == 0x0130 ) { + u[0] = c; + u[1] = 0x0069; + return u; + } + if ( c == 0x0131 ) { + u[0] = 0x0049; + u[1] = c; + return u; + } + + if ( c % 2 == 0 ) { + // if it's even, it's a capital and the lower case is c +1 + u[0] = c; + u[1] = c+1; + } else { + // if it's odd, it's a lower case and upper case is c-1 + u[0] = c-1; + u[1] = c; + } + return u; + } + if ( c == 0x0178 ) { + u[0] = c; + u[1] = 0x00FF; + return u; + } + + if ( (c >= 0x0139 && c < 0x0149) || (c > 0x0178 && c < 0x017F) ) { + if ( c % 2 == 1 ) { + // if it's odd, it's a capital and the lower case is c +1 + u[0] = c; + u[1] = c+1; + } else { + // if it's even, it's a lower case and upper case is c-1 + u[0] = c-1; + u[1] = c; + } + return u; + } + if ( c == 0x017F ) { + u[0] = 0x0053; + u[1] = c; + } + + // Latin Extended B + // need to improve this set + + if ( c >= 0x0200 && c <= 0x0217 ) { + if ( c % 2 == 0 ) { + u[0] = c; + u[1] = c+1; + } else { + u[0] = c-1; + u[1] = c; + } + return u; + } + + // Latin Extended Additional + // Range: U+1E00 to U+1EFF + // http://www.unicode.org/Unicode.charts/glyphless/U1E00.html + + // Spacing Modifier Leters + // Range: U+02B0 to U+02FF + + // Combining Diacritical Marks + // Range: U+0300 to U+036F + + // skip Greek for now + // Greek + // Range: U+0370 to U+03FF + + // Cyrillic + // Range: U+0400 to U+04FF + + if ( (c >= 0x0401 && c <= 0x040C) || ( c>= 0x040E && c <= 0x040F ) ) { + u[0] = c; + u[1] = c + 80; + return u; + } + + + if ( c >= 0x0410 && c <= 0x042F ) { + u[0] = c; + u[1] = c + 32; + return u; + } + + if ( c >= 0x0430 && c<= 0x044F ) { + u[0] = c - 32; + u[1] = c; + return u; + + } + if ( (c >= 0x0451 && c <= 0x045C) || (c >=0x045E && c<= 0x045F) ) { + u[0] = c -80; + u[1] = c; + return u; + } + + if ( c >= 0x0460 && c <= 0x047F ) { + if ( c % 2 == 0 ) { + u[0] = c; + u[1] = c +1; + } else { + u[0] = c - 1; + u[1] = c; + } + return u; + } + + // Armenian + // Range: U+0530 to U+058F + if ( c >= 0x0531 && c <= 0x0556 ) { + u[0] = c; + u[1] = c + 48; + return u; + } + if ( c >= 0x0561 && c < 0x0587 ) { + u[0] = c - 48; + u[1] = c; + return u; + } + + // Hebrew + // Range: U+0590 to U+05FF + + + // Arabic + // Range: U+0600 to U+06FF + + // Devanagari + // Range: U+0900 to U+097F + + + // Bengali + // Range: U+0980 to U+09FF + + + // Gurmukhi + // Range: U+0A00 to U+0A7F + + + // Gujarati + // Range: U+0A80 to U+0AFF + + + // Oriya + // Range: U+0B00 to U+0B7F + // no capital / lower case + + + // Tamil + // Range: U+0B80 to U+0BFF + // no capital / lower case + + + // Telugu + // Range: U+0C00 to U+0C7F + // no capital / lower case + + + // Kannada + // Range: U+0C80 to U+0CFF + // no capital / lower case + + + // Malayalam + // Range: U+0D00 to U+0D7F + + // Thai + // Range: U+0E00 to U+0E7F + + + // Lao + // Range: U+0E80 to U+0EFF + + + // Tibetan + // Range: U+0F00 to U+0FBF + + // Georgian + // Range: U+10A0 to U+10F0 + if ( c >= 0x10A0 && c <= 0x10C5 ) { + u[0] = c; + u[1] = c + 48; + return u; + } + if ( c >= 0x10D0 && c <= 0x10F5 ) { + u[0] = c; + u[1] = c; + return u; + } + + // Hangul Jamo + // Range: U+1100 to U+11FF + + // Greek Extended + // Range: U+1F00 to U+1FFF + // skip for now + + + // General Punctuation + // Range: U+2000 to U+206F + + // Superscripts and Subscripts + // Range: U+2070 to U+209F + + // Currency Symbols + // Range: U+20A0 to U+20CF + + + // Combining Diacritical Marks for Symbols + // Range: U+20D0 to U+20FF + // skip for now + + + // Number Forms + // Range: U+2150 to U+218F + // skip for now + + + // Arrows + // Range: U+2190 to U+21FF + + // Mathematical Operators + // Range: U+2200 to U+22FF + + // Miscellaneous Technical + // Range: U+2300 to U+23FF + + // Control Pictures + // Range: U+2400 to U+243F + + // Optical Character Recognition + // Range: U+2440 to U+245F + + // Enclosed Alphanumerics + // Range: U+2460 to U+24FF + + // Box Drawing + // Range: U+2500 to U+257F + + // Block Elements + // Range: U+2580 to U+259F + + // Geometric Shapes + // Range: U+25A0 to U+25FF + + // Miscellaneous Symbols + // Range: U+2600 to U+26FF + + // Dingbats + // Range: U+2700 to U+27BF + + // CJK Symbols and Punctuation + // Range: U+3000 to U+303F + + // Hiragana + // Range: U+3040 to U+309F + + // Katakana + // Range: U+30A0 to U+30FF + + // Bopomofo + // Range: U+3100 to U+312F + + // Hangul Compatibility Jamo + // Range: U+3130 to U+318F + + // Kanbun + // Range: U+3190 to U+319F + + + // Enclosed CJK Letters and Months + // Range: U+3200 to U+32FF + + // CJK Compatibility + // Range: U+3300 to U+33FF + + // Hangul Syllables + // Range: U+AC00 to U+D7A3 + + // High Surrogates + // Range: U+D800 to U+DB7F + + // Private Use High Surrogates + // Range: U+DB80 to U+DBFF + + // Low Surrogates + // Range: U+DC00 to U+DFFF + + // Private Use Area + // Range: U+E000 to U+F8FF + + // CJK Compatibility Ideographs + // Range: U+F900 to U+FAFF + + // Alphabetic Presentation Forms + // Range: U+FB00 to U+FB4F + + // Arabic Presentation Forms-A + // Range: U+FB50 to U+FDFF + + // Combining Half Marks + // Range: U+FE20 to U+FE2F + + // CJK Compatibility Forms + // Range: U+FE30 to U+FE4F + + // Small Form Variants + // Range: U+FE50 to U+FE6F + + // Arabic Presentation Forms-B + // Range: U+FE70 to U+FEFF + + // Halfwidth and Fullwidth Forms + // Range: U+FF00 to U+FFEF + + if ( c >= 0xFF21 && c <= 0xFF3A ) { + u[0] = c; + u[1] = c + 32; + return u; + } + + if ( c >= 0xFF41 && c <= 0xFF5A ) { + u[0] = c - 32; + u[1] = c; + return u; + } + + // Specials + // Range: U+FFF0 to U+FFFF + + return u; +} + +function DecimalToHexString( n ) { + n = Number( n ); + var h = "0x"; + + for ( var i = 3; i >= 0; i-- ) { + if ( n >= Math.pow(16, i) ){ + var t = Math.floor( n / Math.pow(16, i)); + n -= t * Math.pow(16, i); + if ( t >= 10 ) { + if ( t == 10 ) { + h += "A"; + } + if ( t == 11 ) { + h += "B"; + } + if ( t == 12 ) { + h += "C"; + } + if ( t == 13 ) { + h += "D"; + } + if ( t == 14 ) { + h += "E"; + } + if ( t == 15 ) { + h += "F"; + } + } else { + h += String( t ); + } + } else { + h += "0"; + } + } + + return h; +} diff --git a/mozilla/js/tamarin/test/ecma3/String/toLocaleUpperCase.as b/mozilla/js/tamarin/test/ecma3/String/toLocaleUpperCase.as new file mode 100644 index 00000000000..85ab9ec7b9a --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/toLocaleUpperCase.as @@ -0,0 +1,494 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.5.4.19"; + var VERSION = "ECMA_1"; + + startTest(); + var TITLE = "String.prototype.toLocaleUpperCase()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // Armenian + // Range: U+0530 to U+058F + for ( var i = 0x0530; i <= 0x058F; i++ ) { + var U = new Unicode( i ); +/* + array[item++] = new TestCase( SECTION, + "var s = new String( String.fromCharCode("+i+") ); s.toLocaleUpperCase()", + String.fromCharCode(U.upper), + (s = new String( String.fromCharCode("+i+ ) ), s.toLocaleUpperCase()") ); +*/ + array[item++] = new TestCase( SECTION, + "var s = new String( String.fromCharCode("+i+") ); s.toLocaleUpperCase().charCodeAt(0)", + U.upper, + (s = new String( String.fromCharCode(i) ), s.toLocaleUpperCase().charCodeAt(0) ) ); + + } + + return array; +} + +function MyObject( value ) { + this.value = value; + this.substring = String.prototype.substring; + this.toString = function () { return this.value+'' } +} +function Unicode( c ) { + u = GetUnicodeValues( c ); + this.upper = u[0]; + this.lower = u[1] + return this; +} +function GetUnicodeValues( c ) { + u = new Array(); + + u[0] = c; + u[1] = c; + + // upper case Basic Latin + + if ( c >= 0x0041 && c <= 0x005A) { + u[0] = c; + u[1] = c + 32; + return u; + } + + // lower case Basic Latin + if ( c >= 0x0061 && c <= 0x007a ) { + u[0] = c - 32; + u[1] = c; + return u; + } + + // upper case Latin-1 Supplement + if ( (c >= 0x00C0 && c <= 0x00D6) || (c >= 0x00D8 && c<=0x00DE) ) { + u[0] = c; + u[1] = c + 32; + return u; + } + + // lower case Latin-1 Supplement + if ( (c >= 0x00E0 && c <= 0x00F6) || (c >= 0x00F8 && c <= 0x00FE) ) { + u[0] = c - 32; + u[1] = c; + return u; + } + if ( c == 0x00FF ) { + u[0] = 0x0178; + u[1] = c; + return u; + } + // Latin Extended A + if ( (c >= 0x0100 && c < 0x0138) || (c > 0x0149 && c < 0x0178) ) { + // special case for capital I + if ( c == 0x0130 ) { + u[0] = c; + u[1] = 0x0069; + return u; + } + if ( c == 0x0131 ) { + u[0] = 0x0049; + u[1] = c; + return u; + } + + if ( c % 2 == 0 ) { + // if it's even, it's a capital and the lower case is c +1 + u[0] = c; + u[1] = c+1; + } else { + // if it's odd, it's a lower case and upper case is c-1 + u[0] = c-1; + u[1] = c; + } + return u; + } + if ( c == 0x0178 ) { + u[0] = c; + u[1] = 0x00FF; + return u; + } + + if ( (c >= 0x0139 && c < 0x0149) || (c > 0x0178 && c < 0x017F) ) { + if ( c % 2 == 1 ) { + // if it's odd, it's a capital and the lower case is c +1 + u[0] = c; + u[1] = c+1; + } else { + // if it's even, it's a lower case and upper case is c-1 + u[0] = c-1; + u[1] = c; + } + return u; + } + if ( c == 0x017F ) { + u[0] = 0x0053; + u[1] = c; + } + + // Latin Extended B + // need to improve this set + + if ( c >= 0x0200 && c <= 0x0217 ) { + if ( c % 2 == 0 ) { + u[0] = c; + u[1] = c+1; + } else { + u[0] = c-1; + u[1] = c; + } + return u; + } + + // Latin Extended Additional + // Range: U+1E00 to U+1EFF + // http://www.unicode.org/Unicode.charts/glyphless/U1E00.html + + // Spacing Modifier Leters + // Range: U+02B0 to U+02FF + + // Combining Diacritical Marks + // Range: U+0300 to U+036F + + // skip Greek for now + // Greek + // Range: U+0370 to U+03FF + + // Cyrillic + // Range: U+0400 to U+04FF + + if ( (c >= 0x0401 && c <= 0x040C) || ( c>= 0x040E && c <= 0x040F ) ) { + u[0] = c; + u[1] = c + 80; + return u; + } + + + if ( c >= 0x0410 && c <= 0x042F ) { + u[0] = c; + u[1] = c + 32; + return u; + } + + if ( c >= 0x0430 && c<= 0x044F ) { + u[0] = c - 32; + u[1] = c; + return u; + + } + if ( (c >= 0x0451 && c <= 0x045C) || (c >=0x045E && c<= 0x045F) ) { + u[0] = c -80; + u[1] = c; + return u; + } + + if ( c >= 0x0460 && c <= 0x047F ) { + if ( c % 2 == 0 ) { + u[0] = c; + u[1] = c +1; + } else { + u[0] = c - 1; + u[1] = c; + } + return u; + } + + // Armenian + // Range: U+0530 to U+058F + if ( c >= 0x0531 && c <= 0x0556 ) { + u[0] = c; + u[1] = c + 48; + return u; + } + if ( c >= 0x0561 && c < 0x0587 ) { + u[0] = c - 48; + u[1] = c; + return u; + } + + // Hebrew + // Range: U+0590 to U+05FF + + + // Arabic + // Range: U+0600 to U+06FF + + // Devanagari + // Range: U+0900 to U+097F + + + // Bengali + // Range: U+0980 to U+09FF + + + // Gurmukhi + // Range: U+0A00 to U+0A7F + + + // Gujarati + // Range: U+0A80 to U+0AFF + + + // Oriya + // Range: U+0B00 to U+0B7F + // no capital / lower case + + + // Tamil + // Range: U+0B80 to U+0BFF + // no capital / lower case + + + // Telugu + // Range: U+0C00 to U+0C7F + // no capital / lower case + + + // Kannada + // Range: U+0C80 to U+0CFF + // no capital / lower case + + + // Malayalam + // Range: U+0D00 to U+0D7F + + // Thai + // Range: U+0E00 to U+0E7F + + + // Lao + // Range: U+0E80 to U+0EFF + + + // Tibetan + // Range: U+0F00 to U+0FBF + + // Georgian + // Range: U+10A0 to U+10F0 + if ( c >= 0x10A0 && c <= 0x10C5 ) { + u[0] = c; + u[1] = c + 48; + return u; + } + if ( c >= 0x10D0 && c <= 0x10F5 ) { + u[0] = c; + u[1] = c; + return u; + } + + // Hangul Jamo + // Range: U+1100 to U+11FF + + // Greek Extended + // Range: U+1F00 to U+1FFF + // skip for now + + + // General Punctuation + // Range: U+2000 to U+206F + + // Superscripts and Subscripts + // Range: U+2070 to U+209F + + // Currency Symbols + // Range: U+20A0 to U+20CF + + + // Combining Diacritical Marks for Symbols + // Range: U+20D0 to U+20FF + // skip for now + + + // Number Forms + // Range: U+2150 to U+218F + // skip for now + + + // Arrows + // Range: U+2190 to U+21FF + + // Mathematical Operators + // Range: U+2200 to U+22FF + + // Miscellaneous Technical + // Range: U+2300 to U+23FF + + // Control Pictures + // Range: U+2400 to U+243F + + // Optical Character Recognition + // Range: U+2440 to U+245F + + // Enclosed Alphanumerics + // Range: U+2460 to U+24FF + + // Box Drawing + // Range: U+2500 to U+257F + + // Block Elements + // Range: U+2580 to U+259F + + // Geometric Shapes + // Range: U+25A0 to U+25FF + + // Miscellaneous Symbols + // Range: U+2600 to U+26FF + + // Dingbats + // Range: U+2700 to U+27BF + + // CJK Symbols and Punctuation + // Range: U+3000 to U+303F + + // Hiragana + // Range: U+3040 to U+309F + + // Katakana + // Range: U+30A0 to U+30FF + + // Bopomofo + // Range: U+3100 to U+312F + + // Hangul Compatibility Jamo + // Range: U+3130 to U+318F + + // Kanbun + // Range: U+3190 to U+319F + + + // Enclosed CJK Letters and Months + // Range: U+3200 to U+32FF + + // CJK Compatibility + // Range: U+3300 to U+33FF + + // Hangul Syllables + // Range: U+AC00 to U+D7A3 + + // High Surrogates + // Range: U+D800 to U+DB7F + + // Private Use High Surrogates + // Range: U+DB80 to U+DBFF + + // Low Surrogates + // Range: U+DC00 to U+DFFF + + // Private Use Area + // Range: U+E000 to U+F8FF + + // CJK Compatibility Ideographs + // Range: U+F900 to U+FAFF + + // Alphabetic Presentation Forms + // Range: U+FB00 to U+FB4F + + // Arabic Presentation Forms-A + // Range: U+FB50 to U+FDFF + + // Combining Half Marks + // Range: U+FE20 to U+FE2F + + // CJK Compatibility Forms + // Range: U+FE30 to U+FE4F + + // Small Form Variants + // Range: U+FE50 to U+FE6F + + // Arabic Presentation Forms-B + // Range: U+FE70 to U+FEFF + + // Halfwidth and Fullwidth Forms + // Range: U+FF00 to U+FFEF + + if ( c >= 0xFF21 && c <= 0xFF3A ) { + u[0] = c; + u[1] = c + 32; + return u; + } + + if ( c >= 0xFF41 && c <= 0xFF5A ) { + u[0] = c - 32; + u[1] = c; + return u; + } + + // Specials + // Range: U+FFF0 to U+FFFF + + return u; +} + +function DecimalToHexString( n ) { + n = Number( n ); + var h = "0x"; + + for ( var i = 3; i >= 0; i-- ) { + if ( n >= Math.pow(16, i) ){ + var t = Math.floor( n / Math.pow(16, i)); + n -= t * Math.pow(16, i); + if ( t >= 10 ) { + if ( t == 10 ) { + h += "A"; + } + if ( t == 11 ) { + h += "B"; + } + if ( t == 12 ) { + h += "C"; + } + if ( t == 13 ) { + h += "D"; + } + if ( t == 14 ) { + h += "E"; + } + if ( t == 15 ) { + h += "F"; + } + } else { + h += String( t ); + } + } else { + h += "0"; + } + } + + return h; +} diff --git a/mozilla/js/tamarin/test/ecma3/String/toLocaleUpperCase2.as b/mozilla/js/tamarin/test/ecma3/String/toLocaleUpperCase2.as new file mode 100644 index 00000000000..eadbc92341c --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/toLocaleUpperCase2.as @@ -0,0 +1,494 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.5.4.19"; + var VERSION = "ECMA_1"; + + startTest(); + var TITLE = "String.prototype.toLocaleUpperCase()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // Cyrillic (part) + // Range: U+0400 to U+04FF + for ( var i = 0x0400; i <= 0x047F; i++ ) { + var U =new Unicode( i ); +/* + array[item++] = new TestCase( SECTION, + "var s = new String( String.fromCharCode("+i+") ); s.toLocaleUpperCase()", + U.upper, + (s = new String( String.fromCharCode("+i+ ) ), s.toLocaleUpperCase()") ); +*/ + array[item++] = new TestCase( SECTION, + "var s = new String( String.fromCharCode("+i+") ); s.toLocaleUpperCase().charCodeAt(0)", + U.upper, + (s = new String( String.fromCharCode(i) ), s.toLocaleUpperCase().charCodeAt(0) ) ); + + } + + return array; +} + +function MyObject( value ) { + this.value = value; + this.substring = String.prototype.substring; + this.toString = function () { return this.value+'' } +} +function Unicode( c ) { + u = GetUnicodeValues( c ); + this.upper = u[0]; + this.lower = u[1] + return this; +} +function GetUnicodeValues( c ) { + u = new Array(); + + u[0] = c; + u[1] = c; + + // upper case Basic Latin + + if ( c >= 0x0041 && c <= 0x005A) { + u[0] = c; + u[1] = c + 32; + return u; + } + + // lower case Basic Latin + if ( c >= 0x0061 && c <= 0x007a ) { + u[0] = c - 32; + u[1] = c; + return u; + } + + // upper case Latin-1 Supplement + if ( (c >= 0x00C0 && c <= 0x00D6) || (c >= 0x00D8 && c<=0x00DE) ) { + u[0] = c; + u[1] = c + 32; + return u; + } + + // lower case Latin-1 Supplement + if ( (c >= 0x00E0 && c <= 0x00F6) || (c >= 0x00F8 && c <= 0x00FE) ) { + u[0] = c - 32; + u[1] = c; + return u; + } + if ( c == 0x00FF ) { + u[0] = 0x0178; + u[1] = c; + return u; + } + // Latin Extended A + if ( (c >= 0x0100 && c < 0x0138) || (c > 0x0149 && c < 0x0178) ) { + // special case for capital I + if ( c == 0x0130 ) { + u[0] = c; + u[1] = 0x0069; + return u; + } + if ( c == 0x0131 ) { + u[0] = 0x0049; + u[1] = c; + return u; + } + + if ( c % 2 == 0 ) { + // if it's even, it's a capital and the lower case is c +1 + u[0] = c; + u[1] = c+1; + } else { + // if it's odd, it's a lower case and upper case is c-1 + u[0] = c-1; + u[1] = c; + } + return u; + } + if ( c == 0x0178 ) { + u[0] = c; + u[1] = 0x00FF; + return u; + } + + if ( (c >= 0x0139 && c < 0x0149) || (c > 0x0178 && c < 0x017F) ) { + if ( c % 2 == 1 ) { + // if it's odd, it's a capital and the lower case is c +1 + u[0] = c; + u[1] = c+1; + } else { + // if it's even, it's a lower case and upper case is c-1 + u[0] = c-1; + u[1] = c; + } + return u; + } + if ( c == 0x017F ) { + u[0] = 0x0053; + u[1] = c; + } + + // Latin Extended B + // need to improve this set + + if ( c >= 0x0200 && c <= 0x0217 ) { + if ( c % 2 == 0 ) { + u[0] = c; + u[1] = c+1; + } else { + u[0] = c-1; + u[1] = c; + } + return u; + } + + // Latin Extended Additional + // Range: U+1E00 to U+1EFF + // http://www.unicode.org/Unicode.charts/glyphless/U1E00.html + + // Spacing Modifier Leters + // Range: U+02B0 to U+02FF + + // Combining Diacritical Marks + // Range: U+0300 to U+036F + + // skip Greek for now + // Greek + // Range: U+0370 to U+03FF + + // Cyrillic + // Range: U+0400 to U+04FF + + if ( (c >= 0x0400 && c <= 0x040F ) ) { + u[0] = c; + u[1] = c + 80; + return u; + } + + + if ( c >= 0x0410 && c <= 0x042F ) { + u[0] = c; + u[1] = c + 32; + return u; + } + + if ( c >= 0x0430 && c<= 0x044F ) { + u[0] = c - 32; + u[1] = c; + return u; + + } + if ( (c >= 0x0450 && c<= 0x045F) ) { + u[0] = c -80; + u[1] = c; + return u; + } + + if ( c >= 0x0460 && c <= 0x047F ) { + if ( c % 2 == 0 ) { + u[0] = c; + u[1] = c +1; + } else { + u[0] = c - 1; + u[1] = c; + } + return u; + } + + // Armenian + // Range: U+0530 to U+058F + if ( c >= 0x0531 && c <= 0x0556 ) { + u[0] = c; + u[1] = c + 48; + return u; + } + if ( c >= 0x0561 && c < 0x0587 ) { + u[0] = c - 48; + u[1] = c; + return u; + } + + // Hebrew + // Range: U+0590 to U+05FF + + + // Arabic + // Range: U+0600 to U+06FF + + // Devanagari + // Range: U+0900 to U+097F + + + // Bengali + // Range: U+0980 to U+09FF + + + // Gurmukhi + // Range: U+0A00 to U+0A7F + + + // Gujarati + // Range: U+0A80 to U+0AFF + + + // Oriya + // Range: U+0B00 to U+0B7F + // no capital / lower case + + + // Tamil + // Range: U+0B80 to U+0BFF + // no capital / lower case + + + // Telugu + // Range: U+0C00 to U+0C7F + // no capital / lower case + + + // Kannada + // Range: U+0C80 to U+0CFF + // no capital / lower case + + + // Malayalam + // Range: U+0D00 to U+0D7F + + // Thai + // Range: U+0E00 to U+0E7F + + + // Lao + // Range: U+0E80 to U+0EFF + + + // Tibetan + // Range: U+0F00 to U+0FBF + + // Georgian + // Range: U+10A0 to U+10F0 + if ( c >= 0x10A0 && c <= 0x10C5 ) { + u[0] = c; + u[1] = c + 48; + return u; + } + if ( c >= 0x10D0 && c <= 0x10F5 ) { + u[0] = c; + u[1] = c; + return u; + } + + // Hangul Jamo + // Range: U+1100 to U+11FF + + // Greek Extended + // Range: U+1F00 to U+1FFF + // skip for now + + + // General Punctuation + // Range: U+2000 to U+206F + + // Superscripts and Subscripts + // Range: U+2070 to U+209F + + // Currency Symbols + // Range: U+20A0 to U+20CF + + + // Combining Diacritical Marks for Symbols + // Range: U+20D0 to U+20FF + // skip for now + + + // Number Forms + // Range: U+2150 to U+218F + // skip for now + + + // Arrows + // Range: U+2190 to U+21FF + + // Mathematical Operators + // Range: U+2200 to U+22FF + + // Miscellaneous Technical + // Range: U+2300 to U+23FF + + // Control Pictures + // Range: U+2400 to U+243F + + // Optical Character Recognition + // Range: U+2440 to U+245F + + // Enclosed Alphanumerics + // Range: U+2460 to U+24FF + + // Box Drawing + // Range: U+2500 to U+257F + + // Block Elements + // Range: U+2580 to U+259F + + // Geometric Shapes + // Range: U+25A0 to U+25FF + + // Miscellaneous Symbols + // Range: U+2600 to U+26FF + + // Dingbats + // Range: U+2700 to U+27BF + + // CJK Symbols and Punctuation + // Range: U+3000 to U+303F + + // Hiragana + // Range: U+3040 to U+309F + + // Katakana + // Range: U+30A0 to U+30FF + + // Bopomofo + // Range: U+3100 to U+312F + + // Hangul Compatibility Jamo + // Range: U+3130 to U+318F + + // Kanbun + // Range: U+3190 to U+319F + + + // Enclosed CJK Letters and Months + // Range: U+3200 to U+32FF + + // CJK Compatibility + // Range: U+3300 to U+33FF + + // Hangul Syllables + // Range: U+AC00 to U+D7A3 + + // High Surrogates + // Range: U+D800 to U+DB7F + + // Private Use High Surrogates + // Range: U+DB80 to U+DBFF + + // Low Surrogates + // Range: U+DC00 to U+DFFF + + // Private Use Area + // Range: U+E000 to U+F8FF + + // CJK Compatibility Ideographs + // Range: U+F900 to U+FAFF + + // Alphabetic Presentation Forms + // Range: U+FB00 to U+FB4F + + // Arabic Presentation Forms-A + // Range: U+FB50 to U+FDFF + + // Combining Half Marks + // Range: U+FE20 to U+FE2F + + // CJK Compatibility Forms + // Range: U+FE30 to U+FE4F + + // Small Form Variants + // Range: U+FE50 to U+FE6F + + // Arabic Presentation Forms-B + // Range: U+FE70 to U+FEFF + + // Halfwidth and Fullwidth Forms + // Range: U+FF00 to U+FFEF + + if ( c >= 0xFF21 && c <= 0xFF3A ) { + u[0] = c; + u[1] = c + 32; + return u; + } + + if ( c >= 0xFF41 && c <= 0xFF5A ) { + u[0] = c - 32; + u[1] = c; + return u; + } + + // Specials + // Range: U+FFF0 to U+FFFF + + return u; +} + +function DecimalToHexString( n ) { + n = Number( n ); + var h = "0x"; + + for ( var i = 3; i >= 0; i-- ) { + if ( n >= Math.pow(16, i) ){ + var t = Math.floor( n / Math.pow(16, i)); + n -= t * Math.pow(16, i); + if ( t >= 10 ) { + if ( t == 10 ) { + h += "A"; + } + if ( t == 11 ) { + h += "B"; + } + if ( t == 12 ) { + h += "C"; + } + if ( t == 13 ) { + h += "D"; + } + if ( t == 14 ) { + h += "E"; + } + if ( t == 15 ) { + h += "F"; + } + } else { + h += String( t ); + } + } else { + h += "0"; + } + } + + return h; +} diff --git a/mozilla/js/tamarin/test/ecma3/String/toLocaleUpperCase3.as b/mozilla/js/tamarin/test/ecma3/String/toLocaleUpperCase3.as new file mode 100644 index 00000000000..318793e5e18 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/toLocaleUpperCase3.as @@ -0,0 +1,543 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.5.4.19"; + var VERSION = "ECMA_1"; + + startTest(); + var TITLE = "String.prototype.toLocaleUpperCase()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // Georgian + // Range: U+10A0 to U+10FF + for ( var i = 0x10A0; i <= 0x10FF; i++ ) { + var U = new Unicode( i ); +/* + array[item++] = new TestCase( SECTION, + "var s = new String( String.fromCharCode("+i+") ); s.toLocaleUpperCase()", + String.fromCharCode(U.upper), + (s = new String( String.fromCharCode("+i+ ) ), s.toLocaleUpperCase()") ); +*/ + s = new String( String.fromCharCode(i) ); + array[item++] = new TestCase( SECTION, + "var s = new String( String.fromCharCode("+i+") ); s.toLocaleUpperCase().charCodeAt(0)", + U.upper, + s.toLocaleUpperCase().charCodeAt(0)); + + } + + // Halfwidth and Fullwidth Forms + // Range: U+FF00 to U+FFEF + for ( var i = 0xFF00; i <= 0xFFEF; i++ ) { + s = new String( String.fromCharCode(i)); + array[item++] = new TestCase( SECTION, + "var s = new String( String.fromCharCode('+i+') ); s.toLocaleUpperCase()", + (u = new Unicode( i ), String.fromCharCode(u.upper) ), + (s.toLocaleUpperCase()) ); + s = new String( String.fromCharCode(i) ); + array[item++] = new TestCase( SECTION, + "var s = new String( String.fromCharCode('+i+') ); s.toLocaleUpperCase().charCodeAt(0)", + (u = new Unicode( i ), u.upper ), + (s.toLocaleUpperCase().charCodeAt(0)) ); + } + + // Hiragana (no upper / lower case) + // Range: U+3040 to U+309F + + for ( var i = 0x3040; i <= 0x309F; i++ ) { + s = new String( String.fromCharCode(i) ); + array[item++] = new TestCase( SECTION, + "var s = new String( String.fromCharCode("+i+") ); s.toLocaleUpperCase()", + (u = new Unicode( i ), String.fromCharCode(u.upper) ), + (s.toLocaleUpperCase()) ); + s = new String( String.fromCharCode(i) ); + array[item++] = new TestCase( SECTION, + "var s = new String( String.fromCharCode("+i+") ); s.toLocaleUpperCase().charCodeAt(0)", + (u = new Unicode( i ), u.upper ), + (s.toLocaleUpperCase().charCodeAt(0)) ); + } + + +/* + var TEST_STRING = ""; + var EXPECT_STRING = ""; + + // basic latin test + + for ( var i = 0; i < 0x007A; i++ ) { + var u = new Unicode(i); + TEST_STRING += String.fromCharCode(i); + EXPECT_STRING += String.fromCharCode( u.upper ); + } +*/ + + + + return array; +} + +function MyObject( value ) { + this.value = value; + this.substring = String.prototype.substring; + //this.toString = new Function ( "return this.value+''" ); + this.toString = function (){return this.value;} +} +function Unicode( c ) { + u = GetUnicodeValues( c ); + this.upper = u[0]; + this.lower = u[1] + return this; +} +function GetUnicodeValues( c ) { + u = new Array(); + + u[0] = c; + u[1] = c; + + // upper case Basic Latin + + if ( c >= 0x0041 && c <= 0x005A) { + u[0] = c; + u[1] = c + 32; + return u; + } + + // lower case Basic Latin + if ( c >= 0x0061 && c <= 0x007a ) { + u[0] = c - 32; + u[1] = c; + return u; + } + + // upper case Latin-1 Supplement + if ( (c >= 0x00C0 && c <= 0x00D6) || (c >= 0x00D8 && c<=0x00DE) ) { + u[0] = c; + u[1] = c + 32; + return u; + } + + // lower case Latin-1 Supplement + if ( (c >= 0x00E0 && c <= 0x00F6) || (c >= 0x00F8 && c <= 0x00FE) ) { + u[0] = c - 32; + u[1] = c; + return u; + } + if ( c == 0x00FF ) { + u[0] = 0x0178; + u[1] = c; + return u; + } + // Latin Extended A + if ( (c >= 0x0100 && c < 0x0138) || (c > 0x0149 && c < 0x0178) ) { + // special case for capital I + if ( c == 0x0130 ) { + u[0] = c; + u[1] = 0x0069; + return u; + } + if ( c == 0x0131 ) { + u[0] = 0x0049; + u[1] = c; + return u; + } + + if ( c % 2 == 0 ) { + // if it's even, it's a capital and the lower case is c +1 + u[0] = c; + u[1] = c+1; + } else { + // if it's odd, it's a lower case and upper case is c-1 + u[0] = c-1; + u[1] = c; + } + return u; + } + if ( c == 0x0178 ) { + u[0] = c; + u[1] = 0x00FF; + return u; + } + + if ( (c >= 0x0139 && c < 0x0149) || (c > 0x0178 && c < 0x017F) ) { + if ( c % 2 == 1 ) { + // if it's odd, it's a capital and the lower case is c +1 + u[0] = c; + u[1] = c+1; + } else { + // if it's even, it's a lower case and upper case is c-1 + u[0] = c-1; + u[1] = c; + } + return u; + } + if ( c == 0x017F ) { + u[0] = 0x0053; + u[1] = c; + } + + // Latin Extended B + // need to improve this set + + if ( c >= 0x0200 && c <= 0x0217 ) { + if ( c % 2 == 0 ) { + u[0] = c; + u[1] = c+1; + } else { + u[0] = c-1; + u[1] = c; + } + return u; + } + + // Latin Extended Additional + // Range: U+1E00 to U+1EFF + // http://www.unicode.org/Unicode.charts/glyphless/U1E00.html + + // Spacing Modifier Leters + // Range: U+02B0 to U+02FF + + // Combining Diacritical Marks + // Range: U+0300 to U+036F + + // skip Greek for now + // Greek + // Range: U+0370 to U+03FF + + // Cyrillic + // Range: U+0400 to U+04FF + + if ( (c >= 0x0401 && c <= 0x040C) || ( c>= 0x040E && c <= 0x040F ) ) { + u[0] = c; + u[1] = c + 80; + return u; + } + + + if ( c >= 0x0410 && c <= 0x042F ) { + u[0] = c; + u[1] = c + 32; + return u; + } + + if ( c >= 0x0430 && c<= 0x044F ) { + u[0] = c - 32; + u[1] = c; + return u; + + } + if ( (c >= 0x0451 && c <= 0x045C) || (c >=0x045E && c<= 0x045F) ) { + u[0] = c -80; + u[1] = c; + return u; + } + + if ( c >= 0x0460 && c <= 0x047F ) { + if ( c % 2 == 0 ) { + u[0] = c; + u[1] = c +1; + } else { + u[0] = c - 1; + u[1] = c; + } + return u; + } + + // Armenian + // Range: U+0530 to U+058F + if ( c >= 0x0531 && c <= 0x0556 ) { + u[0] = c; + u[1] = c + 48; + return u; + } + if ( c >= 0x0561 && c < 0x0587 ) { + u[0] = c - 48; + u[1] = c; + return u; + } + + // Hebrew + // Range: U+0590 to U+05FF + + + // Arabic + // Range: U+0600 to U+06FF + + // Devanagari + // Range: U+0900 to U+097F + + + // Bengali + // Range: U+0980 to U+09FF + + + // Gurmukhi + // Range: U+0A00 to U+0A7F + + + // Gujarati + // Range: U+0A80 to U+0AFF + + + // Oriya + // Range: U+0B00 to U+0B7F + // no capital / lower case + + + // Tamil + // Range: U+0B80 to U+0BFF + // no capital / lower case + + + // Telugu + // Range: U+0C00 to U+0C7F + // no capital / lower case + + + // Kannada + // Range: U+0C80 to U+0CFF + // no capital / lower case + + + // Malayalam + // Range: U+0D00 to U+0D7F + + // Thai + // Range: U+0E00 to U+0E7F + + + // Lao + // Range: U+0E80 to U+0EFF + + + // Tibetan + // Range: U+0F00 to U+0FBF + + // Georgian + // Range: U+10A0 to U+10F0 + if ( c >= 0x10A0 && c <= 0x10C5 ) { + u[0] = c; + u[1] = c + 48; + return u; + } + if ( c >= 0x10D0 && c <= 0x10F5 ) { + u[0] = c; + u[1] = c; + return u; + } + + // Hangul Jamo + // Range: U+1100 to U+11FF + + // Greek Extended + // Range: U+1F00 to U+1FFF + // skip for now + + + // General Punctuation + // Range: U+2000 to U+206F + + // Superscripts and Subscripts + // Range: U+2070 to U+209F + + // Currency Symbols + // Range: U+20A0 to U+20CF + + + // Combining Diacritical Marks for Symbols + // Range: U+20D0 to U+20FF + // skip for now + + + // Number Forms + // Range: U+2150 to U+218F + // skip for now + + + // Arrows + // Range: U+2190 to U+21FF + + // Mathematical Operators + // Range: U+2200 to U+22FF + + // Miscellaneous Technical + // Range: U+2300 to U+23FF + + // Control Pictures + // Range: U+2400 to U+243F + + // Optical Character Recognition + // Range: U+2440 to U+245F + + // Enclosed Alphanumerics + // Range: U+2460 to U+24FF + + // Box Drawing + // Range: U+2500 to U+257F + + // Block Elements + // Range: U+2580 to U+259F + + // Geometric Shapes + // Range: U+25A0 to U+25FF + + // Miscellaneous Symbols + // Range: U+2600 to U+26FF + + // Dingbats + // Range: U+2700 to U+27BF + + // CJK Symbols and Punctuation + // Range: U+3000 to U+303F + + // Hiragana + // Range: U+3040 to U+309F + + // Katakana + // Range: U+30A0 to U+30FF + + // Bopomofo + // Range: U+3100 to U+312F + + // Hangul Compatibility Jamo + // Range: U+3130 to U+318F + + // Kanbun + // Range: U+3190 to U+319F + + + // Enclosed CJK Letters and Months + // Range: U+3200 to U+32FF + + // CJK Compatibility + // Range: U+3300 to U+33FF + + // Hangul Syllables + // Range: U+AC00 to U+D7A3 + + // High Surrogates + // Range: U+D800 to U+DB7F + + // Private Use High Surrogates + // Range: U+DB80 to U+DBFF + + // Low Surrogates + // Range: U+DC00 to U+DFFF + + // Private Use Area + // Range: U+E000 to U+F8FF + + // CJK Compatibility Ideographs + // Range: U+F900 to U+FAFF + + // Alphabetic Presentation Forms + // Range: U+FB00 to U+FB4F + + // Arabic Presentation Forms-A + // Range: U+FB50 to U+FDFF + + // Combining Half Marks + // Range: U+FE20 to U+FE2F + + // CJK Compatibility Forms + // Range: U+FE30 to U+FE4F + + // Small Form Variants + // Range: U+FE50 to U+FE6F + + // Arabic Presentation Forms-B + // Range: U+FE70 to U+FEFF + + // Halfwidth and Fullwidth Forms + // Range: U+FF00 to U+FFEF + + if ( c >= 0xFF21 && c <= 0xFF3A ) { + u[0] = c; + u[1] = c + 32; + return u; + } + + if ( c >= 0xFF41 && c <= 0xFF5A ) { + u[0] = c - 32; + u[1] = c; + return u; + } + + // Specials + // Range: U+FFF0 to U+FFFF + + return u; +} + +function DecimalToHexString( n ) { + n = Number( n ); + var h = "0x"; + + for ( var i = 3; i >= 0; i-- ) { + if ( n >= Math.pow(16, i) ){ + var t = Math.floor( n / Math.pow(16, i)); + n -= t * Math.pow(16, i); + if ( t >= 10 ) { + if ( t == 10 ) { + h += "A"; + } + if ( t == 11 ) { + h += "B"; + } + if ( t == 12 ) { + h += "C"; + } + if ( t == 13 ) { + h += "D"; + } + if ( t == 14 ) { + h += "E"; + } + if ( t == 15 ) { + h += "F"; + } + } else { + h += String( t ); + } + } else { + h += "0"; + } + } + + return h; +} diff --git a/mozilla/js/tamarin/test/ecma3/String/toLocaleUpperCase4.as b/mozilla/js/tamarin/test/ecma3/String/toLocaleUpperCase4.as new file mode 100644 index 00000000000..3ad44e84af4 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/toLocaleUpperCase4.as @@ -0,0 +1,496 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.5.4.19"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "String.prototype.toLocaleUpperCase()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var TEST_STRING = ""; + var EXPECT_STRING = ""; + + // basic latin test + + for ( var i = 0; i < 0x007B; i++ ) { + var u = new Unicode(i); + TEST_STRING += String.fromCharCode(i); + EXPECT_STRING += String.fromCharCode( u.upper ); + } + + // don't print out the value of the strings since they contain control + // characters that break the driver + var isEqual = EXPECT_STRING == (new String( TEST_STRING )).toLocaleUpperCase(); + + array[item++] = new TestCase( SECTION, + "isEqual", + true, + isEqual); + return array; +} + +function MyObject( value ) { + this.value = value; + this.substring = String.prototype.substring; + this.toString = function () { return this.value+''; } +} +function Unicode( c ) { + u = GetUnicodeValues( c ); + this.upper = u[0]; + this.lower = u[1] + return this; +} +function GetUnicodeValues( c ) { + u = new Array(); + + u[0] = c; + u[1] = c; + + // upper case Basic Latin + + if ( c >= 0x0041 && c <= 0x005A) { + u[0] = c; + u[1] = c + 32; + return u; + } + + // lower case Basic Latin + if ( c >= 0x0061 && c <= 0x007a ) { + u[0] = c - 32; + u[1] = c; + return u; + } + + // upper case Latin-1 Supplement + if ( (c >= 0x00C0 && c <= 0x00D6) || (c >= 0x00D8 && c<=0x00DE) ) { + u[0] = c; + u[1] = c + 32; + return u; + } + + // lower case Latin-1 Supplement + if ( (c >= 0x00E0 && c <= 0x00F6) || (c >= 0x00F8 && c <= 0x00FE) ) { + u[0] = c - 32; + u[1] = c; + return u; + } + if ( c == 0x00FF ) { + u[0] = 0x0178; + u[1] = c; + return u; + } + // Latin Extended A + if ( (c >= 0x0100 && c < 0x0138) || (c > 0x0149 && c < 0x0178) ) { + // special case for capital I + if ( c == 0x0130 ) { + u[0] = c; + u[1] = 0x0069; + return u; + } + if ( c == 0x0131 ) { + u[0] = 0x0049; + u[1] = c; + return u; + } + + if ( c % 2 == 0 ) { + // if it's even, it's a capital and the lower case is c +1 + u[0] = c; + u[1] = c+1; + } else { + // if it's odd, it's a lower case and upper case is c-1 + u[0] = c-1; + u[1] = c; + } + return u; + } + if ( c == 0x0178 ) { + u[0] = c; + u[1] = 0x00FF; + return u; + } + + if ( (c >= 0x0139 && c < 0x0149) || (c > 0x0178 && c < 0x017F) ) { + if ( c % 2 == 1 ) { + // if it's odd, it's a capital and the lower case is c +1 + u[0] = c; + u[1] = c+1; + } else { + // if it's even, it's a lower case and upper case is c-1 + u[0] = c-1; + u[1] = c; + } + return u; + } + if ( c == 0x017F ) { + u[0] = 0x0053; + u[1] = c; + } + + // Latin Extended B + // need to improve this set + + if ( c >= 0x0200 && c <= 0x0217 ) { + if ( c % 2 == 0 ) { + u[0] = c; + u[1] = c+1; + } else { + u[0] = c-1; + u[1] = c; + } + return u; + } + + // Latin Extended Additional + // Range: U+1E00 to U+1EFF + // http://www.unicode.org/Unicode.charts/glyphless/U1E00.html + + // Spacing Modifier Leters + // Range: U+02B0 to U+02FF + + // Combining Diacritical Marks + // Range: U+0300 to U+036F + + // skip Greek for now + // Greek + // Range: U+0370 to U+03FF + + // Cyrillic + // Range: U+0400 to U+04FF + + if ( (c >= 0x0401 && c <= 0x040C) || ( c>= 0x040E && c <= 0x040F ) ) { + u[0] = c; + u[1] = c + 80; + return u; + } + + + if ( c >= 0x0410 && c <= 0x042F ) { + u[0] = c; + u[1] = c + 32; + return u; + } + + if ( c >= 0x0430 && c<= 0x044F ) { + u[0] = c - 32; + u[1] = c; + return u; + + } + if ( (c >= 0x0451 && c <= 0x045C) || (c >=0x045E && c<= 0x045F) ) { + u[0] = c -80; + u[1] = c; + return u; + } + + if ( c >= 0x0460 && c <= 0x047F ) { + if ( c % 2 == 0 ) { + u[0] = c; + u[1] = c +1; + } else { + u[0] = c - 1; + u[1] = c; + } + return u; + } + + // Armenian + // Range: U+0530 to U+058F + if ( c >= 0x0531 && c <= 0x0556 ) { + u[0] = c; + u[1] = c + 48; + return u; + } + if ( c >= 0x0561 && c < 0x0587 ) { + u[0] = c - 48; + u[1] = c; + return u; + } + + // Hebrew + // Range: U+0590 to U+05FF + + + // Arabic + // Range: U+0600 to U+06FF + + // Devanagari + // Range: U+0900 to U+097F + + + // Bengali + // Range: U+0980 to U+09FF + + + // Gurmukhi + // Range: U+0A00 to U+0A7F + + + // Gujarati + // Range: U+0A80 to U+0AFF + + + // Oriya + // Range: U+0B00 to U+0B7F + // no capital / lower case + + + // Tamil + // Range: U+0B80 to U+0BFF + // no capital / lower case + + + // Telugu + // Range: U+0C00 to U+0C7F + // no capital / lower case + + + // Kannada + // Range: U+0C80 to U+0CFF + // no capital / lower case + + + // Malayalam + // Range: U+0D00 to U+0D7F + + // Thai + // Range: U+0E00 to U+0E7F + + + // Lao + // Range: U+0E80 to U+0EFF + + + // Tibetan + // Range: U+0F00 to U+0FBF + + // Georgian + // Range: U+10A0 to U+10F0 + if ( c >= 0x10A0 && c <= 0x10C5 ) { + u[0] = c; + u[1] = c + 48; + return u; + } + if ( c >= 0x10D0 && c <= 0x10F5 ) { + u[0] = c; + u[1] = c; + return u; + } + + // Hangul Jamo + // Range: U+1100 to U+11FF + + // Greek Extended + // Range: U+1F00 to U+1FFF + // skip for now + + + // General Punctuation + // Range: U+2000 to U+206F + + // Superscripts and Subscripts + // Range: U+2070 to U+209F + + // Currency Symbols + // Range: U+20A0 to U+20CF + + + // Combining Diacritical Marks for Symbols + // Range: U+20D0 to U+20FF + // skip for now + + + // Number Forms + // Range: U+2150 to U+218F + // skip for now + + + // Arrows + // Range: U+2190 to U+21FF + + // Mathematical Operators + // Range: U+2200 to U+22FF + + // Miscellaneous Technical + // Range: U+2300 to U+23FF + + // Control Pictures + // Range: U+2400 to U+243F + + // Optical Character Recognition + // Range: U+2440 to U+245F + + // Enclosed Alphanumerics + // Range: U+2460 to U+24FF + + // Box Drawing + // Range: U+2500 to U+257F + + // Block Elements + // Range: U+2580 to U+259F + + // Geometric Shapes + // Range: U+25A0 to U+25FF + + // Miscellaneous Symbols + // Range: U+2600 to U+26FF + + // Dingbats + // Range: U+2700 to U+27BF + + // CJK Symbols and Punctuation + // Range: U+3000 to U+303F + + // Hiragana + // Range: U+3040 to U+309F + + // Katakana + // Range: U+30A0 to U+30FF + + // Bopomofo + // Range: U+3100 to U+312F + + // Hangul Compatibility Jamo + // Range: U+3130 to U+318F + + // Kanbun + // Range: U+3190 to U+319F + + + // Enclosed CJK Letters and Months + // Range: U+3200 to U+32FF + + // CJK Compatibility + // Range: U+3300 to U+33FF + + // Hangul Syllables + // Range: U+AC00 to U+D7A3 + + // High Surrogates + // Range: U+D800 to U+DB7F + + // Private Use High Surrogates + // Range: U+DB80 to U+DBFF + + // Low Surrogates + // Range: U+DC00 to U+DFFF + + // Private Use Area + // Range: U+E000 to U+F8FF + + // CJK Compatibility Ideographs + // Range: U+F900 to U+FAFF + + // Alphabetic Presentation Forms + // Range: U+FB00 to U+FB4F + + // Arabic Presentation Forms-A + // Range: U+FB50 to U+FDFF + + // Combining Half Marks + // Range: U+FE20 to U+FE2F + + // CJK Compatibility Forms + // Range: U+FE30 to U+FE4F + + // Small Form Variants + // Range: U+FE50 to U+FE6F + + // Arabic Presentation Forms-B + // Range: U+FE70 to U+FEFF + + // Halfwidth and Fullwidth Forms + // Range: U+FF00 to U+FFEF + + if ( c >= 0xFF21 && c <= 0xFF3A ) { + u[0] = c; + u[1] = c + 32; + return u; + } + + if ( c >= 0xFF41 && c <= 0xFF5A ) { + u[0] = c - 32; + u[1] = c; + return u; + } + + // Specials + // Range: U+FFF0 to U+FFFF + + return u; +} + +function DecimalToHexString( n ) { + n = Number( n ); + var h = "0x"; + + for ( var i = 3; i >= 0; i-- ) { + if ( n >= Math.pow(16, i) ){ + var t = Math.floor( n / Math.pow(16, i)); + n -= t * Math.pow(16, i); + if ( t >= 10 ) { + if ( t == 10 ) { + h += "A"; + } + if ( t == 11 ) { + h += "B"; + } + if ( t == 12 ) { + h += "C"; + } + if ( t == 13 ) { + h += "D"; + } + if ( t == 14 ) { + h += "E"; + } + if ( t == 15 ) { + h += "F"; + } + } else { + h += String( t ); + } + } else { + h += "0"; + } + } + + return h; +} + diff --git a/mozilla/js/tamarin/test/ecma3/String/toLocaleUpperCase5.as b/mozilla/js/tamarin/test/ecma3/String/toLocaleUpperCase5.as new file mode 100644 index 00000000000..0e8a7446060 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/String/toLocaleUpperCase5.as @@ -0,0 +1,497 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "15.5.4.19"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "String.prototype.toLocaleUpperCase()"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "String.prototype.toUpperCase.length", 0, String.prototype.toUpperCase.length ); + array[item++] = new TestCase( SECTION, "delete String.prototype.toUpperCase.length", false, delete String.prototype.toUpperCase.length ); + array[item++] = new TestCase( SECTION, "delete String.prototype.toupperCase.length; String.prototype.toupperCase.length", 0, (delete String.prototype.toUpperCase.length, String.prototype.toUpperCase.length) ); + + // Basic Latin, Latin-1 Supplement, Latin Extended A + for ( var i = 0; i <= 0x017f; i++ ) { + var U = new Unicode( i ); + + // XXX DF fails in java + + if ( i == 0x00DF ) { + continue; + } + + + array[item++] = new TestCase( SECTION, + "var s = new String( String.fromCharCode("+i+") ); s.toLocaleUpperCase().charCodeAt(0)", + U.upper, + (s = new String( String.fromCharCode(i) ), s.toLocaleUpperCase().charCodeAt(0) ) ); + } + + return array; +} + +function MyObject( value ) { + this.value = value; + this.substring = String.prototype.substring; + this.toString = function () { return this.value+''; } +} +function Unicode( c ) { + u = GetUnicodeValues( c ); + this.upper = u[0]; + this.lower = u[1] + return this; +} +function GetUnicodeValues( c ) { + u = new Array(); + + u[0] = c; + u[1] = c; + + // upper case Basic Latin + + if ( c >= 0x0041 && c <= 0x005A) { + u[0] = c; + u[1] = c + 32; + return u; + } + + // lower case Basic Latin + if ( c >= 0x0061 && c <= 0x007a ) { + u[0] = c - 32; + u[1] = c; + return u; + } + + // upper case Latin-1 Supplement + if ( (c >= 0x00C0 && c <= 0x00D6) || (c >= 0x00D8 && c<=0x00DE) ) { + u[0] = c; + u[1] = c + 32; + return u; + } + + // lower case Latin-1 Supplement + if ( (c >= 0x00E0 && c <= 0x00F6) || (c >= 0x00F8 && c <= 0x00FE) ) { + u[0] = c - 32; + u[1] = c; + return u; + } + if ( c == 0x00FF ) { + u[0] = 0x0178; + u[1] = c; + return u; + } + // Latin Extended A + if ( (c >= 0x0100 && c < 0x0138) || (c > 0x0149 && c < 0x0178) ) { + // special case for capital I + if ( c == 0x0130 ) { + u[0] = c; + u[1] = 0x0069; + return u; + } + if ( c == 0x0131 ) { + u[0] = 0x0049; + u[1] = c; + return u; + } + + if ( c % 2 == 0 ) { + // if it's even, it's a capital and the lower case is c +1 + u[0] = c; + u[1] = c+1; + } else { + // if it's odd, it's a lower case and upper case is c-1 + u[0] = c-1; + u[1] = c; + } + return u; + } + if ( c == 0x0178 ) { + u[0] = c; + u[1] = 0x00FF; + return u; + } + + if ( (c >= 0x0139 && c < 0x0149) || (c > 0x0178 && c < 0x017F) ) { + if ( c % 2 == 1 ) { + // if it's odd, it's a capital and the lower case is c +1 + u[0] = c; + u[1] = c+1; + } else { + // if it's even, it's a lower case and upper case is c-1 + u[0] = c-1; + u[1] = c; + } + return u; + } + if ( c == 0x017F ) { + u[0] = 0x0053; + u[1] = c; + } + + // Latin Extended B + // need to improve this set + + if ( c >= 0x0200 && c <= 0x0217 ) { + if ( c % 2 == 0 ) { + u[0] = c; + u[1] = c+1; + } else { + u[0] = c-1; + u[1] = c; + } + return u; + } + + // Latin Extended Additional + // Range: U+1E00 to U+1EFF + // http://www.unicode.org/Unicode.charts/glyphless/U1E00.html + + // Spacing Modifier Leters + // Range: U+02B0 to U+02FF + + // Combining Diacritical Marks + // Range: U+0300 to U+036F + + // skip Greek for now + // Greek + // Range: U+0370 to U+03FF + + // Cyrillic + // Range: U+0400 to U+04FF + + if ( (c >= 0x0401 && c <= 0x040C) || ( c>= 0x040E && c <= 0x040F ) ) { + u[0] = c; + u[1] = c + 80; + return u; + } + + + if ( c >= 0x0410 && c <= 0x042F ) { + u[0] = c; + u[1] = c + 32; + return u; + } + + if ( c >= 0x0430 && c<= 0x044F ) { + u[0] = c - 32; + u[1] = c; + return u; + + } + if ( (c >= 0x0451 && c <= 0x045C) || (c >=0x045E && c<= 0x045F) ) { + u[0] = c -80; + u[1] = c; + return u; + } + + if ( c >= 0x0460 && c <= 0x047F ) { + if ( c % 2 == 0 ) { + u[0] = c; + u[1] = c +1; + } else { + u[0] = c - 1; + u[1] = c; + } + return u; + } + + // Armenian + // Range: U+0530 to U+058F + if ( c >= 0x0531 && c <= 0x0556 ) { + u[0] = c; + u[1] = c + 48; + return u; + } + if ( c >= 0x0561 && c < 0x0587 ) { + u[0] = c - 48; + u[1] = c; + return u; + } + + // Hebrew + // Range: U+0590 to U+05FF + + + // Arabic + // Range: U+0600 to U+06FF + + // Devanagari + // Range: U+0900 to U+097F + + + // Bengali + // Range: U+0980 to U+09FF + + + // Gurmukhi + // Range: U+0A00 to U+0A7F + + + // Gujarati + // Range: U+0A80 to U+0AFF + + + // Oriya + // Range: U+0B00 to U+0B7F + // no capital / lower case + + + // Tamil + // Range: U+0B80 to U+0BFF + // no capital / lower case + + + // Telugu + // Range: U+0C00 to U+0C7F + // no capital / lower case + + + // Kannada + // Range: U+0C80 to U+0CFF + // no capital / lower case + + + // Malayalam + // Range: U+0D00 to U+0D7F + + // Thai + // Range: U+0E00 to U+0E7F + + + // Lao + // Range: U+0E80 to U+0EFF + + + // Tibetan + // Range: U+0F00 to U+0FBF + + // Georgian + // Range: U+10A0 to U+10F0 + if ( c >= 0x10A0 && c <= 0x10C5 ) { + u[0] = c; + u[1] = c + 48; + return u; + } + if ( c >= 0x10D0 && c <= 0x10F5 ) { + u[0] = c; + u[1] = c; + return u; + } + + // Hangul Jamo + // Range: U+1100 to U+11FF + + // Greek Extended + // Range: U+1F00 to U+1FFF + // skip for now + + + // General Punctuation + // Range: U+2000 to U+206F + + // Superscripts and Subscripts + // Range: U+2070 to U+209F + + // Currency Symbols + // Range: U+20A0 to U+20CF + + + // Combining Diacritical Marks for Symbols + // Range: U+20D0 to U+20FF + // skip for now + + + // Number Forms + // Range: U+2150 to U+218F + // skip for now + + + // Arrows + // Range: U+2190 to U+21FF + + // Mathematical Operators + // Range: U+2200 to U+22FF + + // Miscellaneous Technical + // Range: U+2300 to U+23FF + + // Control Pictures + // Range: U+2400 to U+243F + + // Optical Character Recognition + // Range: U+2440 to U+245F + + // Enclosed Alphanumerics + // Range: U+2460 to U+24FF + + // Box Drawing + // Range: U+2500 to U+257F + + // Block Elements + // Range: U+2580 to U+259F + + // Geometric Shapes + // Range: U+25A0 to U+25FF + + // Miscellaneous Symbols + // Range: U+2600 to U+26FF + + // Dingbats + // Range: U+2700 to U+27BF + + // CJK Symbols and Punctuation + // Range: U+3000 to U+303F + + // Hiragana + // Range: U+3040 to U+309F + + // Katakana + // Range: U+30A0 to U+30FF + + // Bopomofo + // Range: U+3100 to U+312F + + // Hangul Compatibility Jamo + // Range: U+3130 to U+318F + + // Kanbun + // Range: U+3190 to U+319F + + + // Enclosed CJK Letters and Months + // Range: U+3200 to U+32FF + + // CJK Compatibility + // Range: U+3300 to U+33FF + + // Hangul Syllables + // Range: U+AC00 to U+D7A3 + + // High Surrogates + // Range: U+D800 to U+DB7F + + // Private Use High Surrogates + // Range: U+DB80 to U+DBFF + + // Low Surrogates + // Range: U+DC00 to U+DFFF + + // Private Use Area + // Range: U+E000 to U+F8FF + + // CJK Compatibility Ideographs + // Range: U+F900 to U+FAFF + + // Alphabetic Presentation Forms + // Range: U+FB00 to U+FB4F + + // Arabic Presentation Forms-A + // Range: U+FB50 to U+FDFF + + // Combining Half Marks + // Range: U+FE20 to U+FE2F + + // CJK Compatibility Forms + // Range: U+FE30 to U+FE4F + + // Small Form Variants + // Range: U+FE50 to U+FE6F + + // Arabic Presentation Forms-B + // Range: U+FE70 to U+FEFF + + // Halfwidth and Fullwidth Forms + // Range: U+FF00 to U+FFEF + + if ( c >= 0xFF21 && c <= 0xFF3A ) { + u[0] = c; + u[1] = c + 32; + return u; + } + + if ( c >= 0xFF41 && c <= 0xFF5A ) { + u[0] = c - 32; + u[1] = c; + return u; + } + + // Specials + // Range: U+FFF0 to U+FFFF + + return u; +} + +function DecimalToHexString( n ) { + n = Number( n ); + var h = "0x"; + + for ( var i = 3; i >= 0; i-- ) { + if ( n >= Math.pow(16, i) ){ + var t = Math.floor( n / Math.pow(16, i)); + n -= t * Math.pow(16, i); + if ( t >= 10 ) { + if ( t == 10 ) { + h += "A"; + } + if ( t == 11 ) { + h += "B"; + } + if ( t == 12 ) { + h += "C"; + } + if ( t == 13 ) { + h += "D"; + } + if ( t == 14 ) { + h += "E"; + } + if ( t == 15 ) { + h += "F"; + } + } else { + h += String( t ); + } + } else { + h += "0"; + } + } + + return h; +} diff --git a/mozilla/js/tamarin/test/ecma3/TypeConversion/e9_2_rt.as b/mozilla/js/tamarin/test/ecma3/TypeConversion/e9_2_rt.as new file mode 100644 index 00000000000..56b3ca449f0 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/TypeConversion/e9_2_rt.as @@ -0,0 +1,97 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "9.2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "ToBoolean"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // special cases here + + array[item++] = new TestCase( SECTION, "Boolean()", false, Boolean() ); + var x; + array[item++] = new TestCase( SECTION, "Boolean(var x)", false, Boolean(x) ); + array[item++] = new TestCase( SECTION, "Boolean(void 0)", false, Boolean(void 0) ); + array[item++] = new TestCase( SECTION, "Boolean(null)", false, Boolean(null) ); + array[item++] = new TestCase( SECTION, "Boolean(false)", false, Boolean(false) ); + array[item++] = new TestCase( SECTION, "Boolean(true)", true, Boolean(true) ); + array[item++] = new TestCase( SECTION, "Boolean(0)", false, Boolean(0) ); + array[item++] = new TestCase( SECTION, "Boolean(-0)", false, Boolean(-0) ); + array[item++] = new TestCase( SECTION, "Boolean(NaN)", false, Boolean(Number.NaN) ); + array[item++] = new TestCase( SECTION, "Boolean('')", false, Boolean("") ); + + // normal test cases here + + array[item++] = new TestCase( SECTION, "Boolean(Infinity)", true, Boolean(Number.POSITIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "Boolean(-Infinity)", true, Boolean(Number.NEGATIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "Boolean(Math.PI)", true, Boolean(Math.PI) ); + array[item++] = new TestCase( SECTION, "Boolean(1)", true, Boolean(1) ); + array[item++] = new TestCase( SECTION, "Boolean(-1)", true, Boolean(-1) ); + array[item++] = new TestCase( SECTION, "Boolean([tab])", true, Boolean("\t") ); + array[item++] = new TestCase( SECTION, "Boolean('0')", true, Boolean("0") ); + array[item++] = new TestCase( SECTION, "Boolean('string')", true, Boolean("string") ); + + // ToBoolean (object) should always return true. + array[item++] = new TestCase( SECTION, "Boolean(new String() )", false, Boolean(new String()) ); + array[item++] = new TestCase( SECTION, "Boolean(new String('') )", false, Boolean(new String("")) ); + + array[item++] = new TestCase( SECTION, "Boolean(new Boolean(true))", true, Boolean(new Boolean(true)) ); + array[item++] = new TestCase( SECTION, "Boolean(new Boolean(false))", false, Boolean(new Boolean(false)) ); + array[item++] = new TestCase( SECTION, "Boolean(new Boolean() )", false, Boolean(new Boolean()) ); + + array[item++] = new TestCase( SECTION, "Boolean(new Array())", true, Boolean(new Array()) ); + + array[item++] = new TestCase( SECTION, "Boolean(new Number())", false, Boolean(new Number()) ); + array[item++] = new TestCase( SECTION, "Boolean(new Number(-0))", false, Boolean(new Number(-0)) ); + array[item++] = new TestCase( SECTION, "Boolean(new Number(0))", false, Boolean(new Number(0)) ); + array[item++] = new TestCase( SECTION, "Boolean(new Number(NaN))", false, Boolean(new Number(Number.NaN)) ); + + array[item++] = new TestCase( SECTION, "Boolean(new Number(-1))", true, Boolean(new Number(-1)) ); + array[item++] = new TestCase( SECTION, "Boolean(new Number(Infinity))", true, Boolean(new Number(Number.POSITIVE_INFINITY)) ); + array[item++] = new TestCase( SECTION, "Boolean(new Number(-Infinity))",true, Boolean(new Number(Number.NEGATIVE_INFINITY)) ); + + array[item++] = new TestCase( SECTION, "Boolean(new Object())", true, Boolean(new Object()) ); + array[item++] = new TestCase( SECTION, "Boolean(new Function())", true, Boolean(new Function()) ); + array[item++] = new TestCase( SECTION, "Boolean(new Date())", true, Boolean(new Date()) ); + array[item++] = new TestCase( SECTION, "Boolean(new Date(0))", true, Boolean(new Date(0)) ); + array[item++] = new TestCase( SECTION, "Boolean(Math)", true, Boolean(Math) ); + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/TypeConversion/e9_3.as b/mozilla/js/tamarin/test/ecma3/TypeConversion/e9_3.as new file mode 100644 index 00000000000..faa3d77bc27 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/TypeConversion/e9_3.as @@ -0,0 +1,67 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "9.3"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "ToNumber"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // special cases here + + array[item++] = new TestCase( SECTION, "Number()", 0, Number() ); + //array[item++] = new TestCase( SECTION, "Number(eval('var x'))", Number.NaN, Number(eval("var x")) ); + var x; + array[item++] = new TestCase( SECTION, "Number(var x)", Number.NaN, Number(x) ); + array[item++] = new TestCase( SECTION, "Number(void 0)", Number.NaN, Number(void 0) ); + array[item++] = new TestCase( SECTION, "Number(null)", 0, Number(null) ); + array[item++] = new TestCase( SECTION, "Number(true)", 1, Number(true) ); + array[item++] = new TestCase( SECTION, "Number(false)", 0, Number(false) ); + array[item++] = new TestCase( SECTION, "Number(0)", 0, Number(0) ); + array[item++] = new TestCase( SECTION, "Number(-0)", -0, Number(-0) ); + array[item++] = new TestCase( SECTION, "Number(1)", 1, Number(1) ); + array[item++] = new TestCase( SECTION, "Number(-1)", -1, Number(-1) ); + array[item++] = new TestCase( SECTION, "Number(Number.MAX_VALUE)", 1.7976931348623157e308, Number(Number.MAX_VALUE) ); + array[item++] = new TestCase( SECTION, "Number(Number.MIN_VALUE)", 5e-324, Number(Number.MIN_VALUE) ); + + array[item++] = new TestCase( SECTION, "Number(Number.NaN)", Number.NaN, Number(Number.NaN) ); + array[item++] = new TestCase( SECTION, "Number(Number.POSITIVE_INFINITY)", Number.POSITIVE_INFINITY, Number(Number.POSITIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "Number(Number.NEGATIVE_INFINITY)", Number.NEGATIVE_INFINITY, Number(Number.NEGATIVE_INFINITY) ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/TypeConversion/e9_3_1.as b/mozilla/js/tamarin/test/ecma3/TypeConversion/e9_3_1.as new file mode 100644 index 00000000000..76de379399f --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/TypeConversion/e9_3_1.as @@ -0,0 +1,83 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "9.3-1"; + var VERSION = "ECMA_1"; + startTest(); + var TYPE = "number"; + var testcases = getTestCases(); + + writeHeaderToLog( SECTION + " ToNumber"); + test(); + +function test() { + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +" = "+ + testcases[tc].actual ); + + testcases[tc].passed = writeTestCaseResult( + TYPE, + typeof(testcases[tc].actual), + "typeof( " + testcases[tc].description + + " ) = " + typeof(testcases[tc].actual) ) + ? testcases[tc].passed + : false; + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value "; + } + stopTest(); + return ( testcases ); +} +function getTestCases() { + var array = new Array(); + var item = 0; + + // object is Number + array[item++] = new TestCase( SECTION, "Number(new Number())", 0, Number(new Number()) ); + array[item++] = new TestCase( SECTION, "Number(new Number(Number.NaN))",Number.NaN, Number(new Number(Number.NaN)) ); + array[item++] = new TestCase( SECTION, "Number(new Number(0))", 0, Number(new Number(0)) ); + array[item++] = new TestCase( SECTION, "Number(new Number(null))", 0, Number(new Number(null)) ); +// array[item++] = new TestCase( SECTION, "Number(new Number(void 0))", Number.NaN, Number(new Number(void 0)) ); + array[item++] = new TestCase( SECTION, "Number(new Number(true))", 1, Number(new Number(true)) ); + array[item++] = new TestCase( SECTION, "Number(new Number(false))", 0, Number(new Number(false)) ); + + // object is boolean + + array[item++] = new TestCase( SECTION, "Number(new Boolean(true))", 1, Number(new Boolean(true)) ); + array[item++] = new TestCase( SECTION, "Number(new Boolean(false))", 0, Number(new Boolean(false)) ); + + // object is array + array[item++] = new TestCase( SECTION, "Number(new Array(2,4,8,16,32))", Number.NaN, Number(new Array(2,4,8,16,32)) ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/TypeConversion/e9_3_1_1.as b/mozilla/js/tamarin/test/ecma3/TypeConversion/e9_3_1_1.as new file mode 100644 index 00000000000..ca73eefc131 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/TypeConversion/e9_3_1_1.as @@ -0,0 +1,299 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "9.3.1-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "ToNumber applied to the String type"; + var BUGNUMBER="77391"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // StringNumericLiteral:::StrWhiteSpace:::StrWhiteSpaceChar StrWhiteSpace::: + // + // Name Unicode Value Escape Sequence + // 0X0009 \t + // 0X0020 + // 0X000C \f + // 0X000B + // 0X000D \r + // 0X000A \n + array[item++] = new TestCase( SECTION, "Number('')", 0, Number("") ); + array[item++] = new TestCase( SECTION, "Number(' ')", 0, Number(" ") ); + array[item++] = new TestCase( SECTION, "Number(\\t)", 0, Number("\t") ); + array[item++] = new TestCase( SECTION, "Number(\\n)", 0, Number("\n") ); + array[item++] = new TestCase( SECTION, "Number(\\r)", 0, Number("\r") ); + array[item++] = new TestCase( SECTION, "Number(\\f)", 0, Number("\f") ); + + array[item++] = new TestCase( SECTION, "Number(String.fromCharCode(0x0009)", 0, Number(String.fromCharCode(0x0009)) ); + array[item++] = new TestCase( SECTION, "Number(String.fromCharCode(0x0020)", 0, Number(String.fromCharCode(0x0020)) ); + array[item++] = new TestCase( SECTION, "Number(String.fromCharCode(0x000C)", 0, Number(String.fromCharCode(0x000C)) ); + array[item++] = new TestCase( SECTION, "Number(String.fromCharCode(0x000B)", 0, Number(String.fromCharCode(0x000B)) ); + array[item++] = new TestCase( SECTION, "Number(String.fromCharCode(0x000D)", 0, Number(String.fromCharCode(0x000D)) ); + array[item++] = new TestCase( SECTION, "Number(String.fromCharCode(0x000A)", 0, Number(String.fromCharCode(0x000A)) ); + + // a StringNumericLiteral may be preceeded or followed by whitespace and/or + // line terminators + + array[item++] = new TestCase( SECTION, "Number( ' ' + 999 )", 999, Number( ' '+999) ); + array[item++] = new TestCase( SECTION, "Number( '\\n' + 999 )", 999, Number( '\n' +999) ); + array[item++] = new TestCase( SECTION, "Number( '\\r' + 999 )", 999, Number( '\r' +999) ); + array[item++] = new TestCase( SECTION, "Number( '\\t' + 999 )", 999, Number( '\t' +999) ); + array[item++] = new TestCase( SECTION, "Number( '\\f' + 999 )", 999, Number( '\f' +999) ); + + array[item++] = new TestCase( SECTION, "Number( 999 + ' ' )", 999, Number( 999+' ') ); + array[item++] = new TestCase( SECTION, "Number( 999 + '\\n' )", 999, Number( 999+'\n' ) ); + array[item++] = new TestCase( SECTION, "Number( 999 + '\\r' )", 999, Number( 999+'\r' ) ); + array[item++] = new TestCase( SECTION, "Number( 999 + '\\t' )", 999, Number( 999+'\t' ) ); + array[item++] = new TestCase( SECTION, "Number( 999 + '\\f' )", 999, Number( 999+'\f' ) ); + + array[item++] = new TestCase( SECTION, "Number( '\\n' + 999 + '\\n' )", 999, Number( '\n' +999+'\n' ) ); + array[item++] = new TestCase( SECTION, "Number( '\\r' + 999 + '\\r' )", 999, Number( '\r' +999+'\r' ) ); + array[item++] = new TestCase( SECTION, "Number( '\\t' + 999 + '\\t' )", 999, Number( '\t' +999+'\t' ) ); + array[item++] = new TestCase( SECTION, "Number( '\\f' + 999 + '\\f' )", 999, Number( '\f' +999+'\f' ) ); + + array[item++] = new TestCase( SECTION, "Number( ' ' + '999' )", 999, Number( ' '+'999') ); + array[item++] = new TestCase( SECTION, "Number( '\\n' + '999' )", 999, Number( '\n' +'999') ); + array[item++] = new TestCase( SECTION, "Number( '\\r' + '999' )", 999, Number( '\r' +'999') ); + array[item++] = new TestCase( SECTION, "Number( '\\t' + '999' )", 999, Number( '\t' +'999') ); + array[item++] = new TestCase( SECTION, "Number( '\\f' + '999' )", 999, Number( '\f' +'999') ); + + array[item++] = new TestCase( SECTION, "Number( '999' + ' ' )", 999, Number( '999'+' ') ); + array[item++] = new TestCase( SECTION, "Number( '999' + '\\n' )", 999, Number( '999'+'\n' ) ); + array[item++] = new TestCase( SECTION, "Number( '999' + '\\r' )", 999, Number( '999'+'\r' ) ); + array[item++] = new TestCase( SECTION, "Number( '999' + '\\t' )", 999, Number( '999'+'\t' ) ); + array[item++] = new TestCase( SECTION, "Number( '999' + '\\f' )", 999, Number( '999'+'\f' ) ); + + array[item++] = new TestCase( SECTION, "Number( '\\n' + '999' + '\\n' )", 999, Number( '\n' +'999'+'\n' ) ); + array[item++] = new TestCase( SECTION, "Number( '\\r' + '999' + '\\r' )", 999, Number( '\r' +'999'+'\r' ) ); + array[item++] = new TestCase( SECTION, "Number( '\\t' + '999' + '\\t' )", 999, Number( '\t' +'999'+'\t' ) ); + array[item++] = new TestCase( SECTION, "Number( '\\f' + '999' + '\\f' )", 999, Number( '\f' +'999'+'\f' ) ); + + array[item++] = new TestCase( SECTION, "Number( String.fromCharCode(0x0009) + '99' )", 99, Number( String.fromCharCode(0x0009) + '99' ) ); + array[item++] = new TestCase( SECTION, "Number( String.fromCharCode(0x0020) + '99' )", 99, Number( String.fromCharCode(0x0020) + '99' ) ); + array[item++] = new TestCase( SECTION, "Number( String.fromCharCode(0x000C) + '99' )", 99, Number( String.fromCharCode(0x000C) + '99' ) ); + array[item++] = new TestCase( SECTION, "Number( String.fromCharCode(0x000B) + '99' )", 99, Number( String.fromCharCode(0x000B) + '99' ) ); + array[item++] = new TestCase( SECTION, "Number( String.fromCharCode(0x000D) + '99' )", 99, Number( String.fromCharCode(0x000D) + '99' ) ); + array[item++] = new TestCase( SECTION, "Number( String.fromCharCode(0x000A) + '99' )", 99, Number( String.fromCharCode(0x000A) + '99' ) ); + + array[item++] = new TestCase( SECTION, "Number( String.fromCharCode(0x0009) + '99' + String.fromCharCode(0x0009)", 99, Number( String.fromCharCode(0x0009) + '99' + String.fromCharCode(0x0009)) ); + array[item++] = new TestCase( SECTION, "Number( String.fromCharCode(0x0020) + '99' + String.fromCharCode(0x0020)", 99, Number( String.fromCharCode(0x0009) + '99' + String.fromCharCode(0x0020)) ); + array[item++] = new TestCase( SECTION, "Number( String.fromCharCode(0x000C) + '99' + String.fromCharCode(0x000C)", 99, Number( String.fromCharCode(0x0009) + '99' + String.fromCharCode(0x000C)) ); + array[item++] = new TestCase( SECTION, "Number( String.fromCharCode(0x000D) + '99' + String.fromCharCode(0x000D)", 99, Number( String.fromCharCode(0x0009) + '99' + String.fromCharCode(0x000D)) ); + array[item++] = new TestCase( SECTION, "Number( String.fromCharCode(0x000B) + '99' + String.fromCharCode(0x000B)", 99, Number( String.fromCharCode(0x0009) + '99' + String.fromCharCode(0x000B)) ); + array[item++] = new TestCase( SECTION, "Number( String.fromCharCode(0x000A) + '99' + String.fromCharCode(0x000A)", 99, Number( String.fromCharCode(0x0009) + '99' + String.fromCharCode(0x000A)) ); + + array[item++] = new TestCase( SECTION, "Number( '99' + String.fromCharCode(0x0009)", 99, Number( '99' + String.fromCharCode(0x0009)) ); + array[item++] = new TestCase( SECTION, "Number( '99' + String.fromCharCode(0x0020)", 99, Number( '99' + String.fromCharCode(0x0020)) ); + array[item++] = new TestCase( SECTION, "Number( '99' + String.fromCharCode(0x000C)", 99, Number( '99' + String.fromCharCode(0x000C)) ); + array[item++] = new TestCase( SECTION, "Number( '99' + String.fromCharCode(0x000D)", 99, Number( '99' + String.fromCharCode(0x000D)) ); + array[item++] = new TestCase( SECTION, "Number( '99' + String.fromCharCode(0x000B)", 99, Number( '99' + String.fromCharCode(0x000B)) ); + array[item++] = new TestCase( SECTION, "Number( '99' + String.fromCharCode(0x000A)", 99, Number( '99' + String.fromCharCode(0x000A)) ); + + array[item++] = new TestCase( SECTION, "Number( String.fromCharCode(0x0009) + 99 )", 99, Number( String.fromCharCode(0x0009) + 99 ) ); + array[item++] = new TestCase( SECTION, "Number( String.fromCharCode(0x0020) + 99 )", 99, Number( String.fromCharCode(0x0020) + 99 ) ); + array[item++] = new TestCase( SECTION, "Number( String.fromCharCode(0x000C) + 99 )", 99, Number( String.fromCharCode(0x000C) + 99 ) ); + array[item++] = new TestCase( SECTION, "Number( String.fromCharCode(0x000B) + 99 )", 99, Number( String.fromCharCode(0x000B) + 99 ) ); + array[item++] = new TestCase( SECTION, "Number( String.fromCharCode(0x000D) + 99 )", 99, Number( String.fromCharCode(0x000D) + 99 ) ); + array[item++] = new TestCase( SECTION, "Number( String.fromCharCode(0x000A) + 99 )", 99, Number( String.fromCharCode(0x000A) + 99 ) ); + + array[item++] = new TestCase( SECTION, "Number( String.fromCharCode(0x0009) + 99 + String.fromCharCode(0x0009)", 99, Number( String.fromCharCode(0x0009) + 99 + String.fromCharCode(0x0009)) ); + array[item++] = new TestCase( SECTION, "Number( String.fromCharCode(0x0020) + 99 + String.fromCharCode(0x0020)", 99, Number( String.fromCharCode(0x0009) + 99 + String.fromCharCode(0x0020)) ); + array[item++] = new TestCase( SECTION, "Number( String.fromCharCode(0x000C) + 99 + String.fromCharCode(0x000C)", 99, Number( String.fromCharCode(0x0009) + 99 + String.fromCharCode(0x000C)) ); + array[item++] = new TestCase( SECTION, "Number( String.fromCharCode(0x000D) + 99 + String.fromCharCode(0x000D)", 99, Number( String.fromCharCode(0x0009) + 99 + String.fromCharCode(0x000D)) ); + array[item++] = new TestCase( SECTION, "Number( String.fromCharCode(0x000B) + 99 + String.fromCharCode(0x000B)", 99, Number( String.fromCharCode(0x0009) + 99 + String.fromCharCode(0x000B)) ); + array[item++] = new TestCase( SECTION, "Number( String.fromCharCode(0x000A) + 99 + String.fromCharCode(0x000A)", 99, Number( String.fromCharCode(0x0009) + 99 + String.fromCharCode(0x000A)) ); + + array[item++] = new TestCase( SECTION, "Number( 99 + String.fromCharCode(0x0009)", 99, Number( 99 + String.fromCharCode(0x0009)) ); + array[item++] = new TestCase( SECTION, "Number( 99 + String.fromCharCode(0x0020)", 99, Number( 99 + String.fromCharCode(0x0020)) ); + array[item++] = new TestCase( SECTION, "Number( 99 + String.fromCharCode(0x000C)", 99, Number( 99 + String.fromCharCode(0x000C)) ); + array[item++] = new TestCase( SECTION, "Number( 99 + String.fromCharCode(0x000D)", 99, Number( 99 + String.fromCharCode(0x000D)) ); + array[item++] = new TestCase( SECTION, "Number( 99 + String.fromCharCode(0x000B)", 99, Number( 99 + String.fromCharCode(0x000B)) ); + array[item++] = new TestCase( SECTION, "Number( 99 + String.fromCharCode(0x000A)", 99, Number( 99 + String.fromCharCode(0x000A)) ); + + + // StrNumericLiteral:::StrDecimalLiteral:::Infinity + + array[item++] = new TestCase( SECTION, "Number('Infinity')", Math.pow(10,10000), Number("Infinity") ); + array[item++] = new TestCase( SECTION, "Number('-Infinity')", -Math.pow(10,10000), Number("-Infinity") ); + array[item++] = new TestCase( SECTION, "Number('+Infinity')", Math.pow(10,10000), Number("+Infinity") ); + + // StrNumericLiteral::: StrDecimalLiteral ::: DecimalDigits . DecimalDigits opt ExponentPart opt + + array[item++] = new TestCase( SECTION, "Number('0')", 0, Number("0") ); + array[item++] = new TestCase( SECTION, "Number('-0')", -0, Number("-0") ); + array[item++] = new TestCase( SECTION, "Number('+0')", 0, Number("+0") ); + + array[item++] = new TestCase( SECTION, "Number('1')", 1, Number("1") ); + array[item++] = new TestCase( SECTION, "Number('-1')", -1, Number("-1") ); + array[item++] = new TestCase( SECTION, "Number('+1')", 1, Number("+1") ); + + array[item++] = new TestCase( SECTION, "Number('2')", 2, Number("2") ); + array[item++] = new TestCase( SECTION, "Number('-2')", -2, Number("-2") ); + array[item++] = new TestCase( SECTION, "Number('+2')", 2, Number("+2") ); + + array[item++] = new TestCase( SECTION, "Number('3')", 3, Number("3") ); + array[item++] = new TestCase( SECTION, "Number('-3')", -3, Number("-3") ); + array[item++] = new TestCase( SECTION, "Number('+3')", 3, Number("+3") ); + + array[item++] = new TestCase( SECTION, "Number('4')", 4, Number("4") ); + array[item++] = new TestCase( SECTION, "Number('-4')", -4, Number("-4") ); + array[item++] = new TestCase( SECTION, "Number('+4')", 4, Number("+4") ); + + array[item++] = new TestCase( SECTION, "Number('5')", 5, Number("5") ); + array[item++] = new TestCase( SECTION, "Number('-5')", -5, Number("-5") ); + array[item++] = new TestCase( SECTION, "Number('+5')", 5, Number("+5") ); + + array[item++] = new TestCase( SECTION, "Number('6')", 6, Number("6") ); + array[item++] = new TestCase( SECTION, "Number('-6')", -6, Number("-6") ); + array[item++] = new TestCase( SECTION, "Number('+6')", 6, Number("+6") ); + + array[item++] = new TestCase( SECTION, "Number('7')", 7, Number("7") ); + array[item++] = new TestCase( SECTION, "Number('-7')", -7, Number("-7") ); + array[item++] = new TestCase( SECTION, "Number('+7')", 7, Number("+7") ); + + array[item++] = new TestCase( SECTION, "Number('8')", 8, Number("8") ); + array[item++] = new TestCase( SECTION, "Number('-8')", -8, Number("-8") ); + array[item++] = new TestCase( SECTION, "Number('+8')", 8, Number("+8") ); + + array[item++] = new TestCase( SECTION, "Number('9')", 9, Number("9") ); + array[item++] = new TestCase( SECTION, "Number('-9')", -9, Number("-9") ); + array[item++] = new TestCase( SECTION, "Number('+9')", 9, Number("+9") ); + + array[item++] = new TestCase( SECTION, "Number('3.14159')", 3.14159, Number("3.14159") ); + array[item++] = new TestCase( SECTION, "Number('-3.14159')", -3.14159, Number("-3.14159") ); + array[item++] = new TestCase( SECTION, "Number('+3.14159')", 3.14159, Number("+3.14159") ); + + array[item++] = new TestCase( SECTION, "Number('3.')", 3, Number("3.") ); + array[item++] = new TestCase( SECTION, "Number('-3.')", -3, Number("-3.") ); + array[item++] = new TestCase( SECTION, "Number('+3.')", 3, Number("+3.") ); + + array[item++] = new TestCase( SECTION, "Number('3.e1')", 30, Number("3.e1") ); + array[item++] = new TestCase( SECTION, "Number('-3.e1')", -30, Number("-3.e1") ); + array[item++] = new TestCase( SECTION, "Number('+3.e1')", 30, Number("+3.e1") ); + + array[item++] = new TestCase( SECTION, "Number('3.e+1')", 30, Number("3.e+1") ); + array[item++] = new TestCase( SECTION, "Number('-3.e+1')", -30, Number("-3.e+1") ); + array[item++] = new TestCase( SECTION, "Number('+3.e+1')", 30, Number("+3.e+1") ); + + array[item++] = new TestCase( SECTION, "Number('3.e-1')", .30, Number("3.e-1") ); + array[item++] = new TestCase( SECTION, "Number('-3.e-1')", -.30, Number("-3.e-1") ); + array[item++] = new TestCase( SECTION, "Number('+3.e-1')", .30, Number("+3.e-1") ); + + // StrDecimalLiteral::: .DecimalDigits ExponentPart opt + + array[item++] = new TestCase( SECTION, "Number('.00001')", 0.00001, Number(".00001") ); + array[item++] = new TestCase( SECTION, "Number('+.00001')", 0.00001, Number("+.00001") ); + array[item++] = new TestCase( SECTION, "Number('-0.0001')", -0.00001, Number("-.00001") ); + + array[item++] = new TestCase( SECTION, "Number('.01e2')", 1, Number(".01e2") ); + array[item++] = new TestCase( SECTION, "Number('+.01e2')", 1, Number("+.01e2") ); + array[item++] = new TestCase( SECTION, "Number('-.01e2')", -1, Number("-.01e2") ); + + array[item++] = new TestCase( SECTION, "Number('.01e+2')", 1, Number(".01e+2") ); + array[item++] = new TestCase( SECTION, "Number('+.01e+2')", 1, Number("+.01e+2") ); + array[item++] = new TestCase( SECTION, "Number('-.01e+2')", -1, Number("-.01e+2") ); + + array[item++] = new TestCase( SECTION, "Number('.01e-2')", 0.0001, Number(".01e-2") ); + array[item++] = new TestCase( SECTION, "Number('+.01e-2')", 0.0001, Number("+.01e-2") ); + array[item++] = new TestCase( SECTION, "Number('-.01e-2')", -0.0001, Number("-.01e-2") ); + + // StrDecimalLiteral::: DecimalDigits ExponentPart opt + + array[item++] = new TestCase( SECTION, "Number('1234e5')", 123400000, Number("1234e5") ); + array[item++] = new TestCase( SECTION, "Number('+1234e5')", 123400000, Number("+1234e5") ); + array[item++] = new TestCase( SECTION, "Number('-1234e5')", -123400000, Number("-1234e5") ); + + array[item++] = new TestCase( SECTION, "Number('1234e+5')", 123400000, Number("1234e+5") ); + array[item++] = new TestCase( SECTION, "Number('+1234e+5')", 123400000, Number("+1234e+5") ); + array[item++] = new TestCase( SECTION, "Number('-1234e+5')", -123400000, Number("-1234e+5") ); + + array[item++] = new TestCase( SECTION, "Number('1234e-5')", 0.01234, Number("1234e-5") ); + array[item++] = new TestCase( SECTION, "Number('+1234e-5')", 0.01234, Number("+1234e-5") ); + array[item++] = new TestCase( SECTION, "Number('-1234e-5')", -0.01234, Number("-1234e-5") ); + + // StrNumericLiteral::: HexIntegerLiteral + + array[item++] = new TestCase( SECTION, "Number('0x0')", 0, Number("0x0")); + array[item++] = new TestCase( SECTION, "Number('0x1')", 1, Number("0x1")); + array[item++] = new TestCase( SECTION, "Number('0x2')", 2, Number("0x2")); + array[item++] = new TestCase( SECTION, "Number('0x3')", 3, Number("0x3")); + array[item++] = new TestCase( SECTION, "Number('0x4')", 4, Number("0x4")); + array[item++] = new TestCase( SECTION, "Number('0x5')", 5, Number("0x5")); + array[item++] = new TestCase( SECTION, "Number('0x6')", 6, Number("0x6")); + array[item++] = new TestCase( SECTION, "Number('0x7')", 7, Number("0x7")); + array[item++] = new TestCase( SECTION, "Number('0x8')", 8, Number("0x8")); + array[item++] = new TestCase( SECTION, "Number('0x9')", 9, Number("0x9")); + array[item++] = new TestCase( SECTION, "Number('0xa')", 10, Number("0xa")); + array[item++] = new TestCase( SECTION, "Number('0xb')", 11, Number("0xb")); + array[item++] = new TestCase( SECTION, "Number('0xc')", 12, Number("0xc")); + array[item++] = new TestCase( SECTION, "Number('0xd')", 13, Number("0xd")); + array[item++] = new TestCase( SECTION, "Number('0xe')", 14, Number("0xe")); + array[item++] = new TestCase( SECTION, "Number('0xf')", 15, Number("0xf")); + array[item++] = new TestCase( SECTION, "Number('0xA')", 10, Number("0xA")); + array[item++] = new TestCase( SECTION, "Number('0xB')", 11, Number("0xB")); + array[item++] = new TestCase( SECTION, "Number('0xC')", 12, Number("0xC")); + array[item++] = new TestCase( SECTION, "Number('0xD')", 13, Number("0xD")); + array[item++] = new TestCase( SECTION, "Number('0xE')", 14, Number("0xE")); + array[item++] = new TestCase( SECTION, "Number('0xF')", 15, Number("0xF")); + + array[item++] = new TestCase( SECTION, "Number('0X0')", 0, Number("0X0")); + array[item++] = new TestCase( SECTION, "Number('0X1')", 1, Number("0X1")); + array[item++] = new TestCase( SECTION, "Number('0X2')", 2, Number("0X2")); + array[item++] = new TestCase( SECTION, "Number('0X3')", 3, Number("0X3")); + array[item++] = new TestCase( SECTION, "Number('0X4')", 4, Number("0X4")); + array[item++] = new TestCase( SECTION, "Number('0X5')", 5, Number("0X5")); + array[item++] = new TestCase( SECTION, "Number('0X6')", 6, Number("0X6")); + array[item++] = new TestCase( SECTION, "Number('0X7')", 7, Number("0X7")); + array[item++] = new TestCase( SECTION, "Number('0X8')", 8, Number("0X8")); + array[item++] = new TestCase( SECTION, "Number('0X9')", 9, Number("0X9")); + array[item++] = new TestCase( SECTION, "Number('0Xa')", 10, Number("0Xa")); + array[item++] = new TestCase( SECTION, "Number('0Xb')", 11, Number("0Xb")); + array[item++] = new TestCase( SECTION, "Number('0Xc')", 12, Number("0Xc")); + array[item++] = new TestCase( SECTION, "Number('0Xd')", 13, Number("0Xd")); + array[item++] = new TestCase( SECTION, "Number('0Xe')", 14, Number("0Xe")); + array[item++] = new TestCase( SECTION, "Number('0Xf')", 15, Number("0Xf")); + array[item++] = new TestCase( SECTION, "Number('0XA')", 10, Number("0XA")); + array[item++] = new TestCase( SECTION, "Number('0XB')", 11, Number("0XB")); + array[item++] = new TestCase( SECTION, "Number('0XC')", 12, Number("0XC")); + array[item++] = new TestCase( SECTION, "Number('0XD')", 13, Number("0XD")); + array[item++] = new TestCase( SECTION, "Number('0XE')", 14, Number("0XE")); + array[item++] = new TestCase( SECTION, "Number('0XF')", 15, Number("0XF")); + + return ( array ); +} + diff --git a/mozilla/js/tamarin/test/ecma3/TypeConversion/e9_3_1_2.as b/mozilla/js/tamarin/test/ecma3/TypeConversion/e9_3_1_2.as new file mode 100644 index 00000000000..4edcab35e77 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/TypeConversion/e9_3_1_2.as @@ -0,0 +1,64 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "9.3.1-2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "ToNumber applied to the String type"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // A StringNumericLiteral may not use octal notation + + array[item++] = new TestCase( SECTION, "Number(00)", 0, Number("00")); + array[item++] = new TestCase( SECTION, "Number(01)", 1, Number("01")); + array[item++] = new TestCase( SECTION, "Number(02)", 2, Number("02")); + array[item++] = new TestCase( SECTION, "Number(03)", 3, Number("03")); + array[item++] = new TestCase( SECTION, "Number(04)", 4, Number("04")); + array[item++] = new TestCase( SECTION, "Number(05)", 5, Number("05")); + array[item++] = new TestCase( SECTION, "Number(06)", 6, Number("06")); + array[item++] = new TestCase( SECTION, "Number(07)", 7, Number("07")); + array[item++] = new TestCase( SECTION, "Number(010)", 10, Number("010")); + array[item++] = new TestCase( SECTION, "Number(011)", 11, Number("011")); + + // A StringNumericLIteral may have any number of leading 0 digits + + array[item++] = new TestCase( SECTION, "Number(001)", 1, Number("001")); + array[item++] = new TestCase( SECTION, "Number(0001)", 1, Number("0001")); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/TypeConversion/e9_3_1_3_rt.as b/mozilla/js/tamarin/test/ecma3/TypeConversion/e9_3_1_3_rt.as new file mode 100644 index 00000000000..84661729027 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/TypeConversion/e9_3_1_3_rt.as @@ -0,0 +1,604 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +// Revised 10/20/06 - cpeyer@adobe.com - Changed all instances of Number.MAX_VALUE from 1.7976931348623157e+308 to 1.79769313486231e+308 since our implementation only goes to 14 digits. + + + var SECTION = "9.3.1-3"; + var VERSION = "ECMA_1"; + startTest(); + var BUGNUMBER="129087"; + + var TITLE = "Number To String, String To Number"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // test case from http://scopus.mcom.com/bugsplat/show_bug.cgi?id=312954 + var z = 0; + + array[item++] = new TestCase( + SECTION, + "var z = 0; print(1/-z)", + -Infinity, + 1/-z ); + + // test cases from bug http://scopus.mcom.com/bugsplat/show_bug.cgi?id=122882 + + array[item++] = new TestCase( SECTION, + '- -"0x80000000"', + 2147483648, + - -"0x80000000" ); + + array[item++] = new TestCase( SECTION, + '- -"0x100000000"', + 4294967296, + - -"0x100000000" ); + + array[item++] = new TestCase( SECTION, + '- "-0x123456789abcde8"', + 81985529216486880, + - "-0x123456789abcde8" ); + + // Convert some large numbers to string + + + array[item++] = new TestCase( SECTION, + "1e2000 +''", + "Infinity", + 1e2000 +"" ); + + array[item++] = new TestCase( SECTION, + "1e2000", + Infinity, + 1e2000 ); + + array[item++] = new TestCase( SECTION, + "-1e2000 +''", + "-Infinity", + -1e2000 +"" ); + + array[item++] = new TestCase( SECTION, + "-\"1e2000\"", + -Infinity, + -"1e2000" ); + + array[item++] = new TestCase( SECTION, + "-\"-1e2000\" +''", + "Infinity", + -"-1e2000" +"" ); + + array[item++] = new TestCase( SECTION, + "1e-2000", + 0, + 1e-2000 ); + + array[item++] = new TestCase( SECTION, + "1/1e-2000", + Infinity, + 1/1e-2000 ); + + // convert some strings to large numbers + + array[item++] = new TestCase( SECTION, + "1/-1e-2000", + -Infinity, + 1/-1e-2000 ); + + array[item++] = new TestCase( SECTION, + "1/\"1e-2000\"", + Infinity, + 1/"1e-2000" ); + + array[item++] = new TestCase( SECTION, + "1/\"-1e-2000\"", + -Infinity, + 1/"-1e-2000" ); + + array[item++] = new TestCase( SECTION, + "parseFloat(\"1e2000\")", + Infinity, + parseFloat("1e2000") ); + + array[item++] = new TestCase( SECTION, + "parseFloat(\"1e-2000\")", + 0, + parseFloat("1e-2000") ); + + array[item++] = new TestCase( SECTION, + "1.7976931348623157E+308", + 1.79769313486231e+308, + 1.7976931348623157E+308 ); + + array[item++] = new TestCase( SECTION, + "1.7976931348623158e+308", + 1.79769313486231e+308, + 1.7976931348623158e+308 ); + + array[item++] = new TestCase( SECTION, + "1.7976931348623159e+308", + Infinity, + 1.7976931348623159e+308 ); + + s = + "17976931348623158079372897140530341507993413271003782693617377898044496829276475094664901797758720709633028641669288791094655554785194040263065748867150582068"; + + array[item++] = new TestCase( SECTION, + "s = " + s +"; s +="+ + "\"190890200070838367627385484581771153176447573027006985557136695962284291481986083493647529271907416844436551070434271155969950809304288017790417449779\""+ + + +"; s", + "17976931348623158079372897140530341507993413271003782693617377898044496829276475094664901797758720709633028641669288791094655554785194040263065748867150582068190890200070838367627385484581771153176447573027006985557136695962284291481986083493647529271907416844436551070434271155969950809304288017790417449779", + s += + "190890200070838367627385484581771153176447573027006985557136695962284291481986083493647529271907416844436551070434271155969950809304288017790417449779" + ); + + s1 = s+1; + + array[item++] = new TestCase( SECTION, + "s1 = s+1; s1", + "179769313486231580793728971405303415079934132710037826936173778980444968292764750946649017977587207096330286416692887910946555547851940402630657488671505820681908902000708383676273854845817711531764475730270069855571366959622842914819860834936475292719074168444365510704342711559699508093042880177904174497791", + s1 ); + + array[item++] = new TestCase( SECTION, + "-s1 == -1.79769313486231e+308 || -s1 == -Infinity", + true, + -s1 == -1.79769313486231e+308 || -s1 == -Infinity ); + + s2 = s + 2; + + array[item++] = new TestCase( SECTION, + "s2 = s+2; s2", + "179769313486231580793728971405303415079934132710037826936173778980444968292764750946649017977587207096330286416692887910946555547851940402630657488671505820681908902000708383676273854845817711531764475730270069855571366959622842914819860834936475292719074168444365510704342711559699508093042880177904174497792", + s2 ); + + // ***** This answer is preferred but -1.79769313486231e+308 is also acceptable here ***** + array[item++] = new TestCase( SECTION, + "-s2 == -Infinity || -s2 == -1.79769313486231e+308 ", + true, + -s2 == -Infinity || -s2 == -1.79769313486231e+308 ); + + s3 = s+3; + + array[item++] = new TestCase( SECTION, + "s3 = s+3; s3", + "179769313486231580793728971405303415079934132710037826936173778980444968292764750946649017977587207096330286416692887910946555547851940402630657488671505820681908902000708383676273854845817711531764475730270069855571366959622842914819860834936475292719074168444365510704342711559699508093042880177904174497793", + s3 ); + + + array[item++] = new TestCase( SECTION, + "0x1000000000000080", + 1152921504606847000, + 0x1000000000000080 ); + + array[item++] = new TestCase( SECTION, + "0x1000000000000081", + 1152921504606847200, + 0x1000000000000081 ); + + array[item++] = new TestCase( SECTION, + "0x1000000000000100", + 1152921504606847200, + 0x1000000000000100 ); + array[item++] = new TestCase( SECTION, + "0x100000000000017f", + 1152921504606847200, + 0x100000000000017f ); + + array[item++] = new TestCase( SECTION, + "0x1000000000000180", + 1152921504606847400, + 0x1000000000000180 ); + + array[item++] = new TestCase( SECTION, + "0x1000000000000181", + 1152921504606847400, + 0x1000000000000181 ); + + array[item++] = new TestCase( SECTION, + "0x10000000000001f0", + 1152921504606847400, + 0x10000000000001f0 ); + + array[item++] = new TestCase( SECTION, + "0x1000000000000200", + 1152921504606847400, + 0x1000000000000200 ); + + array[item++] = new TestCase( SECTION, + "0x100000000000027f", + 1152921504606847400, + 0x100000000000027f ); + + array[item++] = new TestCase( SECTION, + "0x1000000000000280", + 1152921504606847400, + 0x1000000000000280 ); + + array[item++] = new TestCase( SECTION, + "0x1000000000000281", + 1152921504606847700, + 0x1000000000000281 ); + + array[item++] = new TestCase( SECTION, + "0x10000000000002ff", + 1152921504606847700, + 0x10000000000002ff ); + + array[item++] = new TestCase( SECTION, + "0x1000000000000300", + 1152921504606847700, + 0x1000000000000300 ); + + array[item++] = new TestCase( SECTION, + "0x10000000000000000", + 18446744073709552000, + 0x10000000000000000 ); + + array[item++] = new TestCase( SECTION, + "parseInt(\"000000100000000100100011010001010110011110001001101010111100\",2)", + 9027215253084860, + parseInt("000000100000000100100011010001010110011110001001101010111100",2) ); + + array[item++] = new TestCase( SECTION, + "parseInt(\"000000100000000100100011010001010110011110001001101010111101\",2)", + 9027215253084860, + parseInt("000000100000000100100011010001010110011110001001101010111101",2) ); + + array[item++] = new TestCase( SECTION, + "parseInt(\"000000100000000100100011010001010110011110001001101010111111\",2)", + 9027215253084864, + parseInt("000000100000000100100011010001010110011110001001101010111111",2) ); + + array[item++] = new TestCase( SECTION, + "parseInt(\"0000001000000001001000110100010101100111100010011010101111010\",2)", + 18054430506169720, + parseInt("0000001000000001001000110100010101100111100010011010101111010",2)); + + array[item++] = new TestCase( SECTION, + "parseInt(\"0000001000000001001000110100010101100111100010011010101111011\",2)", + 18054430506169724, + parseInt("0000001000000001001000110100010101100111100010011010101111011",2) ); + + array[item++] = new TestCase( SECTION, + "parseInt(\"0000001000000001001000110100010101100111100010011010101111100\",2)", + 18054430506169724, + parseInt("0000001000000001001000110100010101100111100010011010101111100",2)); + + array[item++] = new TestCase( SECTION, + "parseInt(\"0000001000000001001000110100010101100111100010011010101111110\",2)", + 18054430506169728, + parseInt("0000001000000001001000110100010101100111100010011010101111110",2)); + + array[item++] = new TestCase( SECTION, + "parseInt(\"yz\",35)", + 34, + parseInt("yz",35) ); + + array[item++] = new TestCase( SECTION, + "parseInt(\"yz\",36)", + 1259, + parseInt("yz",36) ); + + array[item++] = new TestCase( SECTION, + "parseInt(\"yz\",37)", + NaN, + parseInt("yz",37) ); + + array[item++] = new TestCase( SECTION, + "parseInt(\"+77\")", + 77, + parseInt("+77") ); + + array[item++] = new TestCase( SECTION, + "parseInt(\"-77\",9)", + -70, + parseInt("-77",9) ); + + array[item++] = new TestCase( SECTION, + "parseInt(\"\\u20001234\\u2000\")", + 1234, + parseInt("\u20001234\u2000") ); + + array[item++] = new TestCase( SECTION, + "parseInt(\"123456789012345678\")", + 123456789012345700, + parseInt("123456789012345678") ); + + array[item++] = new TestCase( SECTION, + "parseInt(\"9\",8)", + NaN, + parseInt("9",8) ); + + array[item++] = new TestCase( SECTION, + "parseInt(\"1e2\")", + 1, + parseInt("1e2") ); + + array[item++] = new TestCase( SECTION, + "parseInt(\"1.9999999999999999999\")", + 1, + parseInt("1.9999999999999999999") ); + + array[item++] = new TestCase( SECTION, + "parseInt(\"0x10\")", + 16, + parseInt("0x10") ); + + array[item++] = new TestCase( SECTION, + "parseInt(\"0x10\",10)", + 0, + parseInt("0x10",10) ); + + /*array[item++] = new TestCase( SECTION, + "parseInt(\"0022\")", + 18, + parseInt("0022") ); + */ + array[item++] = new TestCase( SECTION, + "parseInt(\"0022\",10)", + 22, + parseInt("0022",10) ); + + array[item++] = new TestCase( SECTION, + "parseInt(\"0x1000000000000080\")", + 1152921504606847000, + parseInt("0x1000000000000080") ); + + array[item++] = new TestCase( SECTION, + "parseInt(\"0x1000000000000081\")", + 1152921504606847200, + parseInt("0x1000000000000081") ); + + s = + "0xFFFFFFFFFFFFF80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"; + + array[item++] = new TestCase( SECTION, "s = "+ + "\"0xFFFFFFFFFFFFF80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\";"+ + "s", + "0xFFFFFFFFFFFFF80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + s ); + + + array[item++] = new TestCase( SECTION, "s +="+ + "\"0000000000000000000000000000000000000\"; s", + "0xFFFFFFFFFFFFF800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + s += "0000000000000000000000000000000000000" ); + + array[item++] = new TestCase( SECTION, "-s", + -1.79769313486231e+308, + -s ); + + s = + "0xFFFFFFFFFFFFF80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"; + + array[item++] = new TestCase( SECTION, "s ="+ + "\"0xFFFFFFFFFFFFF80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\";"+ + "s", + "0xFFFFFFFFFFFFF80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + s ); + + array[item++] = new TestCase( SECTION, + "s += \"0000000000000000000000000000000000001\"", + "0xFFFFFFFFFFFFF800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", + s += "0000000000000000000000000000000000001" ); + + array[item++] = new TestCase( SECTION, + "-s", + -1.79769313486231e+308, + -s ); + + s = + "0xFFFFFFFFFFFFFC0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"; + + array[item++] = new TestCase( SECTION, + "s ="+ + "\"0xFFFFFFFFFFFFFC0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\";"+ + "s", + "0xFFFFFFFFFFFFFC0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + s ); + + + array[item++] = new TestCase( SECTION, + "s += \"0000000000000000000000000000000000000\"", + "0xFFFFFFFFFFFFFC00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + s += "0000000000000000000000000000000000000"); + + + array[item++] = new TestCase( SECTION, + "-s", + -Infinity, + -s ); + + s = + "0xFFFFFFFFFFFFFB0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"; + + array[item++] = new TestCase( SECTION, + "s = "+ + "\"0xFFFFFFFFFFFFFB0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\";s", + "0xFFFFFFFFFFFFFB0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + s); + + array[item++] = new TestCase( SECTION, + "s += \"0000000000000000000000000000000000001\"", + "0xFFFFFFFFFFFFFB00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", + s += "0000000000000000000000000000000000001" ); + + array[item++] = new TestCase( SECTION, + "-s", + -1.79769313486231e+308, + -s ); + + array[item++] = new TestCase( SECTION, + "s += \"0\"", + "0xFFFFFFFFFFFFFB000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010", + s += "0" ); + + array[item++] = new TestCase( SECTION, + "-s", + -Infinity, + -s ); + + array[item++] = new TestCase( SECTION, + "parseInt(s)", + Infinity, + parseInt(s) ); + + array[item++] = new TestCase( SECTION, + "parseInt(s,32)", + 0, + parseInt(s,32) ); + + array[item++] = new TestCase( SECTION, + "parseInt(s,36)", + Infinity, + parseInt(s,36) ); + + array[item++] = new TestCase( SECTION, + "-\"\"", + 0, + -"" ); + + array[item++] = new TestCase( SECTION, + "-\" \"", + 0, + -" " ); + + array[item++] = new TestCase( SECTION, + "-\"999\"", + -999, + -"999" ); + + array[item++] = new TestCase( SECTION, + "-\" 999\"", + -999, + -" 999" ); + + array[item++] = new TestCase( SECTION, + "-\"\\t999\"", + -999, + -"\t999" ); + + array[item++] = new TestCase( SECTION, + "-\"013 \"", + -13, + -"013 " ); + + array[item++] = new TestCase( SECTION, + "-\"999\\t\"", + -999, + -"999\t" ); + + array[item++] = new TestCase( SECTION, + "-\"-Infinity\"", + Infinity, + -"-Infinity" ); + + array[item++] = new TestCase( SECTION, + "-\"-infinity\"", + NaN, + -"-infinity" ); + + + array[item++] = new TestCase( SECTION, + "-\"+Infinity\"", + -Infinity, + -"+Infinity" ); + + array[item++] = new TestCase( SECTION, + "-\"+Infiniti\"", + NaN, + -"+Infiniti" ); + + array[item++] = new TestCase( SECTION, + "- -\"0x80000000\"", + 2147483648, + - -"0x80000000" ); + + array[item++] = new TestCase( SECTION, + "- -\"0x100000000\"", + 4294967296, + - -"0x100000000" ); + + array[item++] = new TestCase( SECTION, + "- \"-0x123456789abcde8\"", + 81985529216486880, + - "-0x123456789abcde8" ); + + // the following two tests are not strictly ECMA 1.0 + + array[item++] = new TestCase( SECTION, + "-\"\\u20001234\\u2001\"", + -1234, + -"\u20001234\u2001" ); + + array[item++] = new TestCase( SECTION, + "-\"\\u20001234\\0\"", + -12340, + -"\u20001234\0" ); + + array[item++] = new TestCase( SECTION, + "-\"0x10\"", + -16, + -"0x10" ); + + array[item++] = new TestCase( SECTION, + "-\"+\"", + NaN, + -"+" ); + + array[item++] = new TestCase( SECTION, + "-\"-\"", + NaN, + -"-" ); + + array[item++] = new TestCase( SECTION, + "-\"-0-\"", + NaN, + -"-0-" ); + + array[item++] = new TestCase( SECTION, + "-\"1e-\"", + NaN, + -"1e-" ); + + array[item++] = new TestCase( SECTION, + "-\"1e-1\"", + -0.1, + -"1e-1" ); + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/TypeConversion/e9_4_1.as b/mozilla/js/tamarin/test/ecma3/TypeConversion/e9_4_1.as new file mode 100644 index 00000000000..a287443f685 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/TypeConversion/e9_4_1.as @@ -0,0 +1,92 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "9.4-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "ToInteger"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // some special cases + td = new Date(Number.NaN); + array[item++] = new TestCase( SECTION, "td = new Date(Number.NaN); td.valueOf()", Number.NaN, td.valueOf()); + td = new Date(Number.POSITIVE_INFINITY); + array[item++] = new TestCase( SECTION, "td = new Date(Infinity); td.valueOf()", Number.NaN, td.valueOf()); + td = new Date(Number.NEGATIVE_INFINITY); + array[item++] = new TestCase( SECTION, "td = new Date(-Infinity); td.valueOf()", Number.NaN, td.valueOf()); + td = new Date(-0); + array[item++] = new TestCase( SECTION, "td = new Date(-0); td.valueOf()", -0, td.valueOf()); + td = new Date(0); + array[item++] = new TestCase( SECTION, "td = new Date(0); td.valueOf()", 0, td.valueOf()); + + // value is not an integer + td = new Date(3.14159); + array[item++] = new TestCase( SECTION, "td = new Date(3.14159); td.valueOf()", 3, td.valueOf() ); + td = new Date(Math.PI); + array[item++] = new TestCase( SECTION, "td = new Date(Math.PI); td.valueOf()", 3, td.valueOf() ); + td = new Date(-Math.PI); + array[item++] = new TestCase( SECTION, "td = new Date(-Math.PI);td.valueOf()", -3, td.valueOf() ); + td = new Date(3.14159e2); + array[item++] = new TestCase( SECTION, "td = new Date(3.14159e2); td.valueOf()", 314, td.valueOf() ); + td = new Date(.692147e1); + array[item++] = new TestCase( SECTION, "td = new Date(.692147e1); td.valueOf()", 6, td.valueOf() ); + td = new Date(-.692147e1); + array[item++] = new TestCase( SECTION, "td = new Date(-.692147e1);td.valueOf()", -6, td.valueOf() ); + + // value is not a number + td = new Date(true); + array[item++] = new TestCase( SECTION, "td = new Date(true); td.valueOf()", 1, td.valueOf() ); + td = new Date(false); + array[item++] = new TestCase( SECTION, "td = new Date(false); td.valueOf()", 0, td.valueOf() ); + td = new Date(new Number(Math.PI)); + array[item++] = new TestCase( SECTION, "td = new Date(new Number(Math.PI)); td.valueOf()", 3, td.valueOf() ); + td = new Date(new Number(Math.PI)); + array[item++] = new TestCase( SECTION, "td = new Date(new Number(Math.PI)); td.valueOf()", 3, td.valueOf() ); + + // edge cases + td = new Date(8.64e15); + array[item++] = new TestCase( SECTION, "td = new Date(8.64e15); td.valueOf()", 8.64e15, td.valueOf() ); + td = new Date(-8.64e15); + array[item++] = new TestCase( SECTION, "td = new Date(-8.64e15); td.valueOf()", -8.64e15, td.valueOf() ); + td = new Date(8.64e-15); + array[item++] = new TestCase( SECTION, "td = new Date(8.64e-15); td.valueOf()", 0, td.valueOf() ); + td = new Date(-8.64e-15); + array[item++] = new TestCase( SECTION, "td = new Date(-8.64e-15); td.valueOf()", 0, td.valueOf()); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/TypeConversion/e9_4_2.as b/mozilla/js/tamarin/test/ecma3/TypeConversion/e9_4_2.as new file mode 100644 index 00000000000..63ca9e5c5ad --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/TypeConversion/e9_4_2.as @@ -0,0 +1,92 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "9.4-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "ToInteger"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // some special cases + td = new Date(Number.NaN); + array[item++] = new TestCase( SECTION, "td = new Date(Number.NaN); td.valueOf()", Number.NaN, td.valueOf() ); + td = new Date(Infinity); + array[item++] = new TestCase( SECTION, "td = new Date(Infinity); td.valueOf()", Number.NaN, td.valueOf() ); + td = new Date(-Infinity); + array[item++] = new TestCase( SECTION, "td = new Date(-Infinity); td.valueOf()", Number.NaN, td.valueOf() ); + td = new Date(-0); + array[item++] = new TestCase( SECTION, "td = new Date(-0); td.valueOf()", -0, td.valueOf() ); + td = new Date(0); + array[item++] = new TestCase( SECTION, "td = new Date(0); td.valueOf()", 0, td.valueOf() ); + + // value is not an integer + td = new Date(3.14159); + array[item++] = new TestCase( SECTION, "td = new Date(3.14159); td.valueOf()", 3, td.valueOf() ); + td = new Date(Math.PI); + array[item++] = new TestCase( SECTION, "td = new Date(Math.PI); td.valueOf()", 3, td.valueOf() ); + td = new Date(-Math.PI); + array[item++] = new TestCase( SECTION, "td = new Date(-Math.PI);td.valueOf()", -3, td.valueOf() ); + td = new Date(3.14159e2); + array[item++] = new TestCase( SECTION, "td = new Date(3.14159e2); td.valueOf()", 314, td.valueOf()); + td = new Date(.692147e1); + array[item++] = new TestCase( SECTION, "td = new Date(.692147e1); td.valueOf()", 6, td.valueOf() ); + td = new Date(-.692147e1); + array[item++] = new TestCase( SECTION, "td = new Date(-.692147e1);td.valueOf()", -6, td.valueOf() ); + + // value is not a number + td = new Date(true); + array[item++] = new TestCase( SECTION, "td = new Date(true); td.valueOf()", 1, td.valueOf() ); + td = new Date(false); + array[item++] = new TestCase( SECTION, "td = new Date(false); td.valueOf()", 0, td.valueOf()); + td = new Date(new Number(Math.PI)); + array[item++] = new TestCase( SECTION, "td = new Date(new Number(Math.PI)); td.valueOf()", 3, td.valueOf() ); + td = new Date(new Number(Math.PI)); + array[item++] = new TestCase( SECTION, "td = new Date(new Number(Math.PI)); td.valueOf()", 3, td.valueOf() ); + + // edge cases + td = new Date(8.64e15); + array[item++] = new TestCase( SECTION, "td = new Date(8.64e15); td.valueOf()", 8.64e15, td.valueOf() ); + td = new Date(-8.64e15); + array[item++] = new TestCase( SECTION, "td = new Date(-8.64e15); td.valueOf()", -8.64e15, td.valueOf() ); + td = new Date(8.64e-15); + array[item++] = new TestCase( SECTION, "td = new Date(8.64e-15); td.valueOf()", 0, td.valueOf() ); + td = new Date(-8.64e-15); + array[item++] = new TestCase( SECTION, "td = new Date(-8.64e-15); td.valueOf()", 0, td.valueOf() ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/TypeConversion/e9_5_2.as b/mozilla/js/tamarin/test/ecma3/TypeConversion/e9_5_2.as new file mode 100644 index 00000000000..8725d76ff28 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/TypeConversion/e9_5_2.as @@ -0,0 +1,137 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "9.5-2"; + var VERSION = "ECMA_1"; + startTest(); + var testcases = getTestCases(); + + writeHeaderToLog( SECTION + " ToInt32"); + test(); + +function ToInt32( n ) { + n = Number( n ); + var sign = ( n < 0 ) ? -1 : 1; + + if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY) { + return 0; + } + + n = (sign * Math.floor( Math.abs(n) )) % Math.pow(2,32); + if ( sign == -1 ) { + n = ( n < -Math.pow(2,31) ) ? n + Math.pow(2,32) : n; + } else{ + n = ( n >= Math.pow(2,31) ) ? n - Math.pow(2,32) : n; + } + + return ( n ); +} +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "0 << 0", 0, 0 << 0 ); + array[item++] = new TestCase( SECTION, "-0 << 0", 0, -0 << 0 ); + array[item++] = new TestCase( SECTION, "Infinity << 0", 0, "Infinity" << 0 ); + array[item++] = new TestCase( SECTION, "-Infinity << 0", 0, "-Infinity" << 0 ); + array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY << 0", 0, Number.POSITIVE_INFINITY << 0 ); + array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY << 0", 0, Number.NEGATIVE_INFINITY << 0 ); + array[item++] = new TestCase( SECTION, "Number.NaN << 0", 0, Number.NaN << 0 ); + + array[item++] = new TestCase( SECTION, "Number.MIN_VALUE << 0", 0, Number.MIN_VALUE << 0 ); + array[item++] = new TestCase( SECTION, "-Number.MIN_VALUE << 0", 0, -Number.MIN_VALUE << 0 ); + array[item++] = new TestCase( SECTION, "0.1 << 0", 0, 0.1 << 0 ); + array[item++] = new TestCase( SECTION, "-0.1 << 0", 0, -0.1 << 0 ); + array[item++] = new TestCase( SECTION, "1 << 0", 1, 1 << 0 ); + array[item++] = new TestCase( SECTION, "1.1 << 0", 1, 1.1 << 0 ); + array[item++] = new TestCase( SECTION, "-1 << 0", ToInt32(-1), -1 << 0 ); + + + array[item++] = new TestCase( SECTION, "2147483647 << 0", ToInt32(2147483647), 2147483647 << 0 ); + array[item++] = new TestCase( SECTION, "2147483648 << 0", ToInt32(2147483648), 2147483648 << 0 ); + array[item++] = new TestCase( SECTION, "2147483649 << 0", ToInt32(2147483649), 2147483649 << 0 ); + + array[item++] = new TestCase( SECTION, "(Math.pow(2,31)-1) << 0", ToInt32(2147483647), (Math.pow(2,31)-1) << 0 ); + array[item++] = new TestCase( SECTION, "Math.pow(2,31) << 0", ToInt32(2147483648), Math.pow(2,31) << 0 ); + array[item++] = new TestCase( SECTION, "(Math.pow(2,31)+1) << 0", ToInt32(2147483649), (Math.pow(2,31)+1) << 0 ); + + array[item++] = new TestCase( SECTION, "(Math.pow(2,32)-1) << 0", ToInt32(4294967295), (Math.pow(2,32)-1) << 0 ); + array[item++] = new TestCase( SECTION, "(Math.pow(2,32)) << 0", ToInt32(4294967296), (Math.pow(2,32)) << 0 ); + array[item++] = new TestCase( SECTION, "(Math.pow(2,32)+1) << 0", ToInt32(4294967297), (Math.pow(2,32)+1) << 0 ); + + array[item++] = new TestCase( SECTION, "4294967295 << 0", ToInt32(4294967295), 4294967295 << 0 ); + array[item++] = new TestCase( SECTION, "4294967296 << 0", ToInt32(4294967296), 4294967296 << 0 ); + array[item++] = new TestCase( SECTION, "4294967297 << 0", ToInt32(4294967297), 4294967297 << 0 ); + + array[item++] = new TestCase( SECTION, "'2147483647' << 0", ToInt32(2147483647), '2147483647' << 0 ); + array[item++] = new TestCase( SECTION, "'2147483648' << 0", ToInt32(2147483648), '2147483648' << 0 ); + array[item++] = new TestCase( SECTION, "'2147483649' << 0", ToInt32(2147483649), '2147483649' << 0 ); + + array[item++] = new TestCase( SECTION, "'4294967295' << 0", ToInt32(4294967295), '4294967295' << 0 ); + array[item++] = new TestCase( SECTION, "'4294967296' << 0", ToInt32(4294967296), '4294967296' << 0 ); + array[item++] = new TestCase( SECTION, "'4294967297' << 0", ToInt32(4294967297), '4294967297' << 0 ); + + array[item++] = new TestCase( SECTION, "-2147483647 << 0", ToInt32(-2147483647), -2147483647 << 0 ); + array[item++] = new TestCase( SECTION, "-2147483648 << 0", ToInt32(-2147483648), -2147483648 << 0 ); + array[item++] = new TestCase( SECTION, "-2147483649 << 0", ToInt32(-2147483649), -2147483649 << 0 ); + + array[item++] = new TestCase( SECTION, "-4294967295 << 0", ToInt32(-4294967295), -4294967295 << 0 ); + array[item++] = new TestCase( SECTION, "-4294967296 << 0", ToInt32(-4294967296), -4294967296 << 0 ); + array[item++] = new TestCase( SECTION, "-4294967297 << 0", ToInt32(-4294967297), -4294967297 << 0 ); + + /* + * Numbers between 2^31 and 2^32 will have a negative ToInt32 per ECMA (see step 5 of introduction) + * (These are by stevechapel@earthlink.net; cf. http://bugzilla.mozilla.org/show_bug.cgi?id=120083) + */ + array[item++] = new TestCase( SECTION, "2147483648.25 << 0", ToInt32(2147483648.25), 2147483648.25 << 0 ); + array[item++] = new TestCase( SECTION, "2147483648.5 << 0", ToInt32(2147483648.5), 2147483648.5 << 0 ); + array[item++] = new TestCase( SECTION, "2147483648.75 << 0", ToInt32(2147483648.75), 2147483648.75 << 0 ); + array[item++] = new TestCase( SECTION, "4294967295.25 << 0", ToInt32(4294967295.25), 4294967295.25 << 0 ); + array[item++] = new TestCase( SECTION, "4294967295.5 << 0", ToInt32(4294967295.5), 4294967295.5 << 0 ); + array[item++] = new TestCase( SECTION, "4294967295.75 << 0", ToInt32(4294967295.75), 4294967295.75 << 0 ); + array[item++] = new TestCase( SECTION, "3000000000.25 << 0", ToInt32(3000000000.25), 3000000000.25 << 0 ); + array[item++] = new TestCase( SECTION, "3000000000.5 << 0", ToInt32(3000000000.5), 3000000000.5 << 0 ); + array[item++] = new TestCase( SECTION, "3000000000.75 << 0", ToInt32(3000000000.75), 3000000000.75 << 0 ); + + /* + * Numbers between - 2^31 and - 2^32 + */ + array[item++] = new TestCase( SECTION, "-2147483648.25 << 0", ToInt32(-2147483648.25), -2147483648.25 << 0 ); + array[item++] = new TestCase( SECTION, "-2147483648.5 << 0", ToInt32(-2147483648.5), -2147483648.5 << 0 ); + array[item++] = new TestCase( SECTION, "-2147483648.75 << 0", ToInt32(-2147483648.75), -2147483648.75 << 0 ); + array[item++] = new TestCase( SECTION, "-4294967295.25 << 0", ToInt32(-4294967295.25), -4294967295.25 << 0 ); + array[item++] = new TestCase( SECTION, "-4294967295.5 << 0", ToInt32(-4294967295.5), -4294967295.5 << 0 ); + array[item++] = new TestCase( SECTION, "-4294967295.75 << 0", ToInt32(-4294967295.75), -4294967295.75 << 0 ); + array[item++] = new TestCase( SECTION, "-3000000000.25 << 0", ToInt32(-3000000000.25), -3000000000.25 << 0 ); + array[item++] = new TestCase( SECTION, "-3000000000.5 << 0", ToInt32(-3000000000.5), -3000000000.5 << 0 ); + array[item++] = new TestCase( SECTION, "-3000000000.75 << 0", ToInt32(-3000000000.75), -3000000000.75 << 0 ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/TypeConversion/e9_6.as b/mozilla/js/tamarin/test/ecma3/TypeConversion/e9_6.as new file mode 100644 index 00000000000..4cec92920df --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/TypeConversion/e9_6.as @@ -0,0 +1,106 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "9.6"; + var VERSION = "ECMA_1"; + startTest(); + var testcases = getTestCases(); + + writeHeaderToLog( SECTION + " Type Conversion: ToUint32"); + test(); + +function ToUint32( n ) { + n = Number( n ); + var sign = ( n < 0 ) ? -1 : 1; + + if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY) { + return 0; + } + n = sign * Math.floor( Math.abs(n) ) + + n = n % Math.pow(2,32); + + if ( n < 0 ){ + n += Math.pow(2,32); + } + + return ( n ); +} +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "0 >>> 0", 0, 0 >>> 0 ); +// array[item++] = new TestCase( SECTION, "+0 >>> 0", 0, +0 >>> 0); + array[item++] = new TestCase( SECTION, "-0 >>> 0", 0, -0 >>> 0 ); + array[item++] = new TestCase( SECTION, "'Infinity' >>> 0", 0, "Infinity" >>> 0 ); + array[item++] = new TestCase( SECTION, "'-Infinity' >>> 0", 0, "-Infinity" >>> 0); + array[item++] = new TestCase( SECTION, "'+Infinity' >>> 0", 0, "+Infinity" >>> 0 ); + array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY >>> 0", 0, Number.POSITIVE_INFINITY >>> 0 ); + array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY >>> 0", 0, Number.NEGATIVE_INFINITY >>> 0 ); + array[item++] = new TestCase( SECTION, "Number.NaN >>> 0", 0, Number.NaN >>> 0 ); + + array[item++] = new TestCase( SECTION, "Number.MIN_VALUE >>> 0", 0, Number.MIN_VALUE >>> 0 ); + array[item++] = new TestCase( SECTION, "-Number.MIN_VALUE >>> 0", 0, Number.MIN_VALUE >>> 0 ); + array[item++] = new TestCase( SECTION, "0.1 >>> 0", 0, 0.1 >>> 0 ); + array[item++] = new TestCase( SECTION, "-0.1 >>> 0", 0, -0.1 >>> 0 ); + array[item++] = new TestCase( SECTION, "1 >>> 0", 1, 1 >>> 0 ); + array[item++] = new TestCase( SECTION, "1.1 >>> 0", 1, 1.1 >>> 0 ); + + array[item++] = new TestCase( SECTION, "-1.1 >>> 0", ToUint32(-1.1), -1.1 >>> 0 ); + array[item++] = new TestCase( SECTION, "-1 >>> 0", ToUint32(-1), -1 >>> 0 ); + + array[item++] = new TestCase( SECTION, "2147483647 >>> 0", ToUint32(2147483647), 2147483647 >>> 0 ); + array[item++] = new TestCase( SECTION, "2147483648 >>> 0", ToUint32(2147483648), 2147483648 >>> 0 ); + array[item++] = new TestCase( SECTION, "2147483649 >>> 0", ToUint32(2147483649), 2147483649 >>> 0 ); + + array[item++] = new TestCase( SECTION, "4294967295 >>> 0", ToUint32(4294967295), 4294967295 >>> 0 ); + array[item++] = new TestCase( SECTION, "4294967296 >>> 0", ToUint32(4294967296), 4294967296 >>> 0 ); + array[item++] = new TestCase( SECTION, "4294967297 >>> 0", ToUint32(4294967297), 4294967297 >>> 0 ); + + array[item++] = new TestCase( SECTION, "-2147483647 >>> 0", ToUint32(-2147483647), -2147483647 >>> 0 ); + array[item++] = new TestCase( SECTION, "-2147483648 >>> 0", ToUint32(-2147483648), -2147483648 >>> 0 ); + array[item++] = new TestCase( SECTION, "-2147483649 >>> 0", ToUint32(-2147483649), -2147483649 >>> 0 ); + + array[item++] = new TestCase( SECTION, "-4294967295 >>> 0", ToUint32(-4294967295), -4294967295 >>> 0 ); + array[item++] = new TestCase( SECTION, "-4294967296 >>> 0", ToUint32(-4294967296), -4294967296 >>> 0 ); + array[item++] = new TestCase( SECTION, "-4294967297 >>> 0", ToUint32(-4294967297), -4294967297 >>> 0 ); + + array[item++] = new TestCase( SECTION, "'2147483647' >>> 0", ToUint32(2147483647), '2147483647' >>> 0 ); + array[item++] = new TestCase( SECTION, "'2147483648' >>> 0", ToUint32(2147483648), '2147483648' >>> 0 ); + array[item++] = new TestCase( SECTION, "'2147483649' >>> 0", ToUint32(2147483649), '2147483649' >>> 0 ); + + array[item++] = new TestCase( SECTION, "'4294967295' >>> 0", ToUint32(4294967295), '4294967295' >>> 0 ); + array[item++] = new TestCase( SECTION, "'4294967296' >>> 0", ToUint32(4294967296), '4294967296' >>> 0 ); + array[item++] = new TestCase( SECTION, "'4294967297' >>> 0", ToUint32(4294967297), '4294967297' >>> 0 ); + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/TypeConversion/e9_7.as b/mozilla/js/tamarin/test/ecma3/TypeConversion/e9_7.as new file mode 100644 index 00000000000..97d6ef2d303 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/TypeConversion/e9_7.as @@ -0,0 +1,136 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "9.7"; + var VERSION = "ECMA_1"; + startTest(); + var testcases = getTestCases(); + + writeHeaderToLog( SECTION + " Type Conversion: ToInt16"); + test(); + +function ToInt16( num ) { + num = Number( num ); + if ( isNaN( num ) || num == 0 || num == Number.POSITIVE_INFINITY || num == Number.NEGATIVE_INFINITY ) { + return 0; + } + + var sign = ( num < 0 ) ? -1 : 1; + + num = sign * Math.floor( Math.abs( num ) ); + + num = num % Math.pow(2,16); + + num = ( num > -65536 && num < 0) ? 65536 + num : num; + + return num; +} + +function getTestCases() { + var array = new Array(); + var item = 0; +/* + array[item++] = new TestCase( "9.7", "String.fromCharCode(0).charCodeAt(0)", 0, String.fromCharCode(0).charCodeAt(0) ); + array[item++] = new TestCase( "9.7", "String.fromCharCode(-0).charCodeAt(0)", 0, String.fromCharCode(-0).charCodeAt(0) ); + array[item++] = new TestCase( "9.7", "String.fromCharCode(1).charCodeAt(0)", 1, String.fromCharCode(1).charCodeAt(0) ); + array[item++] = new TestCase( "9.7", "String.fromCharCode(64).charCodeAt(0)", 64, String.fromCharCode(64).charCodeAt(0) ); + array[item++] = new TestCase( "9.7", "String.fromCharCode(126).charCodeAt(0)", 126, String.fromCharCode(126).charCodeAt(0) ); + array[item++] = new TestCase( "9.7", "String.fromCharCode(127).charCodeAt(0)", 127, String.fromCharCode(127).charCodeAt(0) ); + array[item++] = new TestCase( "9.7", "String.fromCharCode(128).charCodeAt(0)", 128, String.fromCharCode(128).charCodeAt(0) ); + array[item++] = new TestCase( "9.7", "String.fromCharCode(130).charCodeAt(0)", 130, String.fromCharCode(130).charCodeAt(0) ); + array[item++] = new TestCase( "9.7", "String.fromCharCode(255).charCodeAt(0)", 255, String.fromCharCode(255).charCodeAt(0) ); + array[item++] = new TestCase( "9.7", "String.fromCharCode(256).charCodeAt(0)", 256, String.fromCharCode(256).charCodeAt(0) ); + array[item++] = new TestCase( "9.7", "String.fromCharCode(Math.pow(2,16)-1).charCodeAt(0)", 65535, String.fromCharCode(Math.pow(2,16)-1).charCodeAt(0) ); + array[item++] = new TestCase( "9.7", "String.fromCharCode(Math.pow(2,16)).charCodeAt(0)", 0, String.fromCharCode(Math.pow(2,16)).charCodeAt(0) ); +*/ + + + array[item++] = new TestCase( "9.7", "String.fromCharCode(0).charCodeAt(0)", ToInt16(0), String.fromCharCode(0).charCodeAt(0) ); + array[item++] = new TestCase( "9.7", "String.fromCharCode(-0).charCodeAt(0)", ToInt16(0), String.fromCharCode(-0).charCodeAt(0) ); + array[item++] = new TestCase( "9.7", "String.fromCharCode(1).charCodeAt(0)", ToInt16(1), String.fromCharCode(1).charCodeAt(0) ); + array[item++] = new TestCase( "9.7", "String.fromCharCode(64).charCodeAt(0)", ToInt16(64), String.fromCharCode(64).charCodeAt(0) ); + array[item++] = new TestCase( "9.7", "String.fromCharCode(126).charCodeAt(0)", ToInt16(126), String.fromCharCode(126).charCodeAt(0) ); + array[item++] = new TestCase( "9.7", "String.fromCharCode(127).charCodeAt(0)", ToInt16(127), String.fromCharCode(127).charCodeAt(0) ); + array[item++] = new TestCase( "9.7", "String.fromCharCode(128).charCodeAt(0)", ToInt16(128), String.fromCharCode(128).charCodeAt(0) ); + array[item++] = new TestCase( "9.7", "String.fromCharCode(130).charCodeAt(0)", ToInt16(130), String.fromCharCode(130).charCodeAt(0) ); + array[item++] = new TestCase( "9.7", "String.fromCharCode(255).charCodeAt(0)", ToInt16(255), String.fromCharCode(255).charCodeAt(0) ); + array[item++] = new TestCase( "9.7", "String.fromCharCode(256).charCodeAt(0)", ToInt16(256), String.fromCharCode(256).charCodeAt(0) ); + + array[item++] = new TestCase( "9.7", "String.fromCharCode(Math.pow(2,16)-1).charCodeAt(0)", 65535, String.fromCharCode(Math.pow(2,16)-1).charCodeAt(0) ); + array[item++] = new TestCase( "9.7", "String.fromCharCode(Math.pow(2,16)).charCodeAt(0)", 0, String.fromCharCode(Math.pow(2,16)).charCodeAt(0) ); + + array[item++] = new TestCase( "9.7", "String.fromCharCode(65535).charCodeAt(0)", ToInt16(65535), String.fromCharCode(65535).charCodeAt(0) ); + array[item++] = new TestCase( "9.7", "String.fromCharCode(65536).charCodeAt(0)", ToInt16(65536), String.fromCharCode(65536).charCodeAt(0) ); + array[item++] = new TestCase( "9.7", "String.fromCharCode(65537).charCodeAt(0)", ToInt16(65537), String.fromCharCode(65537).charCodeAt(0) ); + + array[item++] = new TestCase( "9.7", "String.fromCharCode(131071).charCodeAt(0)", ToInt16(131071), String.fromCharCode(131071).charCodeAt(0) ); + array[item++] = new TestCase( "9.7", "String.fromCharCode(131072).charCodeAt(0)", ToInt16(131072), String.fromCharCode(131072).charCodeAt(0) ); + array[item++] = new TestCase( "9.7", "String.fromCharCode(131073).charCodeAt(0)", ToInt16(131073), String.fromCharCode(131073).charCodeAt(0) ); + + array[item++] = new TestCase( "9.7", "String.fromCharCode('65535').charCodeAt(0)", 65535, String.fromCharCode("65535").charCodeAt(0) ); + array[item++] = new TestCase( "9.7", "String.fromCharCode('65536').charCodeAt(0)", 0, String.fromCharCode("65536").charCodeAt(0) ); + + array[item++] = new TestCase( "9.7", "String.fromCharCode(-1).charCodeAt(0)", ToInt16(-1), String.fromCharCode(-1).charCodeAt(0) ); + array[item++] = new TestCase( "9.7", "String.fromCharCode(-64).charCodeAt(0)", ToInt16(-64), String.fromCharCode(-64).charCodeAt(0) ); + array[item++] = new TestCase( "9.7", "String.fromCharCode(-126).charCodeAt(0)", ToInt16(-126), String.fromCharCode(-126).charCodeAt(0) ); + array[item++] = new TestCase( "9.7", "String.fromCharCode(-127).charCodeAt(0)", ToInt16(-127), String.fromCharCode(-127).charCodeAt(0) ); + array[item++] = new TestCase( "9.7", "String.fromCharCode(-128).charCodeAt(0)", ToInt16(-128), String.fromCharCode(-128).charCodeAt(0) ); + array[item++] = new TestCase( "9.7", "String.fromCharCode(-130).charCodeAt(0)", ToInt16(-130), String.fromCharCode(-130).charCodeAt(0) ); + array[item++] = new TestCase( "9.7", "String.fromCharCode(-255).charCodeAt(0)", ToInt16(-255), String.fromCharCode(-255).charCodeAt(0) ); + array[item++] = new TestCase( "9.7", "String.fromCharCode(-256).charCodeAt(0)", ToInt16(-256), String.fromCharCode(-256).charCodeAt(0) ); + + array[item++] = new TestCase( "9.7", "String.fromCharCode(-Math.pow(2,16)-1).charCodeAt(0)", 65535, String.fromCharCode(-Math.pow(2,16)-1).charCodeAt(0) ); + array[item++] = new TestCase( "9.7", "String.fromCharCode(-Math.pow(2,16)).charCodeAt(0)", 0, String.fromCharCode(-Math.pow(2,16)).charCodeAt(0) ); + + array[item++] = new TestCase( "9.7", "String.fromCharCode(-65535).charCodeAt(0)", ToInt16(-65535), String.fromCharCode(-65535).charCodeAt(0) ); + array[item++] = new TestCase( "9.7", "String.fromCharCode(-65536).charCodeAt(0)", ToInt16(-65536), String.fromCharCode(-65536).charCodeAt(0) ); + array[item++] = new TestCase( "9.7", "String.fromCharCode(-65537).charCodeAt(0)", ToInt16(-65537), String.fromCharCode(-65537).charCodeAt(0) ); + + array[item++] = new TestCase( "9.7", "String.fromCharCode(-131071).charCodeAt(0)", ToInt16(-131071), String.fromCharCode(-131071).charCodeAt(0) ); + array[item++] = new TestCase( "9.7", "String.fromCharCode(-131072).charCodeAt(0)", ToInt16(-131072), String.fromCharCode(-131072).charCodeAt(0) ); + array[item++] = new TestCase( "9.7", "String.fromCharCode(-131073).charCodeAt(0)", ToInt16(-131073), String.fromCharCode(-131073).charCodeAt(0) ); + + array[item++] = new TestCase( "9.7", "String.fromCharCode('-65535').charCodeAt(0)", ToInt16(-65535), String.fromCharCode("-65535").charCodeAt(0) ); + array[item++] = new TestCase( "9.7", "String.fromCharCode('-65536').charCodeAt(0)", ToInt16(-65536), String.fromCharCode("-65536").charCodeAt(0) ); + + +// array[item++] = new TestCase( "9.7", "String.fromCharCode(2147483648).charCodeAt(0)", ToInt16(2147483648), String.fromCharCode(2147483648).charCodeAt(0) ); + + + +// the following test cases cause a runtime error. see: http://scopus.mcom.com/bugsplat/show_bug.cgi?id=78878 + +// array[item++] = new TestCase( "9.7", "String.fromCharCode(Infinity).charCodeAt(0)", 0, String.fromCharCode("Infinity").charCodeAt(0) ); +// array[item++] = new TestCase( "9.7", "String.fromCharCode(-Infinity).charCodeAt(0)", 0, String.fromCharCode("-Infinity").charCodeAt(0) ); +// array[item++] = new TestCase( "9.7", "String.fromCharCode(NaN).charCodeAt(0)", 0, String.fromCharCode(Number.NaN).charCodeAt(0) ); +// array[item++] = new TestCase( "9.7", "String.fromCharCode(Number.POSITIVE_INFINITY).charCodeAt(0)", 0, String.fromCharCode(Number.POSITIVE_INFINITY).charCodeAt(0) ); +// array[item++] = new TestCase( "9.7", "String.fromCharCode(Number.NEGATIVE_INFINITY).charCodeAt(0)", 0, String.fromCharCode(Number.NEGATIVE_INFINITY).charCodeAt(0) ); + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/TypeConversion/e9_8_1.as b/mozilla/js/tamarin/test/ecma3/TypeConversion/e9_8_1.as new file mode 100644 index 00000000000..487b9723e7b --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/TypeConversion/e9_8_1.as @@ -0,0 +1,103 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "9.8.1"; + var VERSION = "ECMA_1"; + startTest(); + var testcases = getTestCases(); + + writeHeaderToLog( SECTION + " ToString applied to the Number type"); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "Number.NaN", "NaN", Number.NaN + "" ); + array[item++] = new TestCase( SECTION, "0", "0", 0 + "" ); + array[item++] = new TestCase( SECTION, "-0", "0", -0 + "" ); + array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY", "Infinity", Number.POSITIVE_INFINITY + "" ); + array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY", "-Infinity", Number.NEGATIVE_INFINITY + "" ); + array[item++] = new TestCase( SECTION, "-1", "-1", -1 + "" ); + + // cases in step 6: integers 1e21 > x >= 1 or -1 >= x > -1e21 + + array[item++] = new TestCase( SECTION, "1", "1", 1 + "" ); + array[item++] = new TestCase( SECTION, "10", "10", 10 + "" ); + array[item++] = new TestCase( SECTION, "100", "100", 100 + "" ); + array[item++] = new TestCase( SECTION, "1000", "1000", 1000 + "" ); + array[item++] = new TestCase( SECTION, "10000", "10000", 10000 + "" ); + array[item++] = new TestCase( SECTION, "10000000000", "10000000000", 10000000000 + "" ); + array[item++] = new TestCase( SECTION, "10000000000000000000", "10000000000000000000", 10000000000000000000 + "" ); + array[item++] = new TestCase( SECTION, "100000000000000000000","100000000000000000000",100000000000000000000 + "" ); + + array[item++] = new TestCase( SECTION, "12345", "12345", 12345 + "" ); + array[item++] = new TestCase( SECTION, "1234567890", "1234567890", 1234567890 + "" ); + + array[item++] = new TestCase( SECTION, "-1", "-1", -1 + "" ); + array[item++] = new TestCase( SECTION, "-10", "-10", -10 + "" ); + array[item++] = new TestCase( SECTION, "-100", "-100", -100 + "" ); + array[item++] = new TestCase( SECTION, "-1000", "-1000", -1000 + "" ); + array[item++] = new TestCase( SECTION, "-1000000000", "-1000000000", -1000000000 + "" ); + array[item++] = new TestCase( SECTION, "-1000000000000000", "-1000000000000000", -1000000000000000 + "" ); + array[item++] = new TestCase( SECTION, "-100000000000000000000", "-100000000000000000000", -100000000000000000000 + "" ); + array[item++] = new TestCase( SECTION, "-1000000000000000000000", "-1e+21", -1000000000000000000000 + "" ); + + array[item++] = new TestCase( SECTION, "-12345", "-12345", -12345 + "" ); + array[item++] = new TestCase( SECTION, "-1234567890", "-1234567890", -1234567890 + "" ); + + // cases in step 7: numbers with a fractional component, 1e21> x >1 or -1 > x > -1e21, + array[item++] = new TestCase( SECTION, "1.0000001", "1.0000001", 1.0000001 + "" ); + + // cases in step 8: fractions between 1 > x > -1, exclusive of 0 and -0 + + // cases in step 9: numbers with 1 significant digit >= 1e+21 or <= 1e-6 + + array[item++] = new TestCase( SECTION, "1000000000000000000000", "1e+21", 1000000000000000000000 + "" ); + array[item++] = new TestCase( SECTION, "10000000000000000000000", "1e+22", 10000000000000000000000 + "" ); + + // cases in step 10: numbers with more than 1 significant digit >= 1e+21 or <= 1e-6 + + array[item++] = new TestCase( SECTION, "1.2345", "1.2345", String( 1.2345)); + array[item++] = new TestCase( SECTION, "1.234567890", "1.23456789", String( 1.234567890 )); + + + array[item++] = new TestCase( SECTION, ".12345", "0.12345", String(.12345 ) ); + array[item++] = new TestCase( SECTION, ".012345", "0.012345", String(.012345) ); + array[item++] = new TestCase( SECTION, ".0012345", "0.0012345", String(.0012345) ); + array[item++] = new TestCase( SECTION, ".00012345", "0.00012345", String(.00012345) ); + array[item++] = new TestCase( SECTION, ".000012345", "0.000012345", String(.000012345) ); + array[item++] = new TestCase( SECTION, ".0000012345", "0.0000012345", String(.0000012345) ); + array[item++] = new TestCase( SECTION, ".00000012345", "1.2345e-7", String(.00000012345)); + + array[item++] = new TestCase( SECTION, "-1e21", "-1e+21", String(-1e21) ); + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/TypeConversion/e9_9_1_rt.as b/mozilla/js/tamarin/test/ecma3/TypeConversion/e9_9_1_rt.as new file mode 100644 index 00000000000..8b8bd7e25cf --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/TypeConversion/e9_9_1_rt.as @@ -0,0 +1,118 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var VERSION = "ECMA_1"; + startTest(); + var SECTION = "9.9-1"; + + writeHeaderToLog( SECTION + " Type Conversion: ToObject" ); + var tc= 0; + var testcases = getTestCases(); + +// all tests must call a function that returns an array of TestCase objects. + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "Object(true).valueOf()", true, (Object(true)).valueOf() ); + array[item++] = new TestCase( SECTION, "typeof Object(true)", "boolean", typeof Object(true) ); + array[item++] = new TestCase( SECTION, "(Object(true)).__proto__", Boolean.prototype, (Object(true)).constructor.prototype); + + array[item++] = new TestCase( SECTION, "Object(false).valueOf()", false, (Object(false)).valueOf() ); + array[item++] = new TestCase( SECTION, "typeof Object(false)", "boolean", typeof Object(false) ); + array[item++] = new TestCase( SECTION, "(Object(true)).__proto__", Boolean.prototype, (Object(true)).constructor.prototype); + + array[item++] = new TestCase( SECTION, "Object(0).valueOf()", 0, (Object(0)).valueOf() ); + array[item++] = new TestCase( SECTION, "typeof Object(0)", "number", typeof Object(0) ); + array[item++] = new TestCase( SECTION, "(Object(0)).__proto__", Number.prototype, (Object(0)).constructor.prototype); + + array[item++] = new TestCase( SECTION, "Object(-0).valueOf()", -0, (Object(-0)).valueOf() ); + array[item++] = new TestCase( SECTION, "typeof Object(-0)", "number", typeof Object(-0) ); + array[item++] = new TestCase( SECTION, "(Object(-0)).__proto__", Number.prototype, (Object(-0)).constructor.prototype); + + array[item++] = new TestCase( SECTION, "Object(1).valueOf()", 1, (Object(1)).valueOf() ); + array[item++] = new TestCase( SECTION, "typeof Object(1)", "number", typeof Object(1) ); + array[item++] = new TestCase( SECTION, "(Object(1)).__proto__", Number.prototype, (Object(1)).constructor.prototype); + + array[item++] = new TestCase( SECTION, "Object(-1).valueOf()", -1, (Object(-1)).valueOf() ); + array[item++] = new TestCase( SECTION, "typeof Object(-1)", "number", typeof Object(-1) ); + array[item++] = new TestCase( SECTION, "(Object(-1)).__proto__", Number.prototype, (Object(-1)).constructor.prototype); + + array[item++] = new TestCase( SECTION, "Object(Number.MAX_VALUE).valueOf()", 1.7976931348623157e308, (Object(Number.MAX_VALUE)).valueOf() ); + array[item++] = new TestCase( SECTION, "typeof Object(Number.MAX_VALUE)", "number", typeof Object(Number.MAX_VALUE) ); + array[item++] = new TestCase( SECTION, "(Object(Number.MAX_VALUE)).__proto__", Number.prototype, (Object(Number.MAX_VALUE)).constructor.prototype); + + array[item++] = new TestCase( SECTION, "Object(Number.MIN_VALUE).valueOf()", 5e-324, (Object(Number.MIN_VALUE)).valueOf() ); + array[item++] = new TestCase( SECTION, "typeof Object(Number.MIN_VALUE)", "number", typeof Object(Number.MIN_VALUE) ); + array[item++] = new TestCase( SECTION, "(Object(Number.MIN_VALUE)).__proto__", Number.prototype, (Object(Number.MIN_VALUE)).constructor.prototype); + + array[item++] = new TestCase( SECTION, "Object(Number.POSITIVE_INFINITY).valueOf()", Number.POSITIVE_INFINITY, (Object(Number.POSITIVE_INFINITY)).valueOf() ); + array[item++] = new TestCase( SECTION, "typeof Object(Number.POSITIVE_INFINITY)", "number", typeof Object(Number.POSITIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "(Object(Number.POSITIVE_INFINITY)).__proto__", Number.prototype, (Object(Number.POSITIVE_INFINITY)).constructor.prototype); + + array[item++] = new TestCase( SECTION, "Object(Number.NEGATIVE_INFINITY).valueOf()", Number.NEGATIVE_INFINITY, (Object(Number.NEGATIVE_INFINITY)).valueOf() ); + array[item++] = new TestCase( SECTION, "typeof Object(Number.NEGATIVE_INFINITY)", "number", typeof Object(Number.NEGATIVE_INFINITY) ); + array[item++] = new TestCase( SECTION, "(Object(Number.NEGATIVE_INFINITY)).__proto__", Number.prototype, (Object(Number.NEGATIVE_INFINITY)).constructor.prototype); + + array[item++] = new TestCase( SECTION, "Object(Number.NaN).valueOf()", Number.NaN, (Object(Number.NaN)).valueOf() ); + array[item++] = new TestCase( SECTION, "typeof Object(Number.NaN)", "number", typeof Object(Number.NaN) ); + array[item++] = new TestCase( SECTION, "(Object(Number.NaN)).__proto__", Number.prototype, (Object(Number.NaN)).constructor.prototype); + + array[item++] = new TestCase( SECTION, "Object('a string').valueOf()", "a string", (Object("a string")).valueOf() ); + array[item++] = new TestCase( SECTION, "typeof Object('a string')", "string", typeof (Object("a string")) ); + array[item++] = new TestCase( SECTION, "(Object('a string')).__proto__", String.prototype, (Object("a string")).constructor.prototype); + + array[item++] = new TestCase( SECTION, "Object('').valueOf()", "", (Object("")).valueOf() ); + array[item++] = new TestCase( SECTION, "typeof Object('')", "string", typeof (Object("")) ); + array[item++] = new TestCase( SECTION, "(Object('')).__proto__", String.prototype, (Object("")).constructor.prototype); + + array[item++] = new TestCase( SECTION, "Object('\\r\\t\\b\\n\\v\\f').valueOf()", "\r\t\b\n\v\f", (Object("\r\t\b\n\v\f")).valueOf() ); + array[item++] = new TestCase( SECTION, "typeof Object('\\r\\t\\b\\n\\v\\f')", "string", typeof (Object("\\r\\t\\b\\n\\v\\f")) ); + array[item++] = new TestCase( SECTION, "(Object('\\r\\t\\b\\n\\v\\f')).__proto__", String.prototype, (Object("\\r\\t\\b\\n\\v\\f")).constructor.prototype); + + array[item++] = new TestCase( SECTION, "Object( '\\\'\\\"\\' ).valueOf()", "\'\"\\", (Object("\'\"\\")).valueOf() ); + array[item++] = new TestCase( SECTION, "typeof Object( '\\\'\\\"\\' )", "string", typeof Object("\'\"\\") ); + array[item++] = new TestCase( SECTION, "Object( '\\\'\\\"\\' ).__proto__", String.prototype, (Object("\'\"\\")).constructor.prototype); + + array[item++] = new TestCase( SECTION, "Object( new MyObject(true) ).valueOf()", true, Object( new MyObject(true) ).valueOf()); + array[item++] = new TestCase( SECTION, "typeof Object( new MyObject(true) )", "object", typeof Object( new MyObject(true)) ); + array[item++] = new TestCase( SECTION, "(Object( new MyObject(true) )).toString()", "[object Object]", Object( new MyObject(true) ).toString()); + + return ( array ); +} + +function MyObject( value ) { + this.value = value; + // this.valueOf = new Function ( "return this.value" ); + this.valueOf = function (){ return this.value; } +} diff --git a/mozilla/js/tamarin/test/ecma3/Types/e8_1.as b/mozilla/js/tamarin/test/ecma3/Types/e8_1.as new file mode 100644 index 00000000000..78fa7ec8139 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Types/e8_1.as @@ -0,0 +1,62 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "8.1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "The undefined type"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var x; + array[item++] = new TestCase( SECTION, + "var x; typeof x", + "undefined", + typeof x); + var x; + array[item++] = new TestCase( SECTION, + "var x; typeof x == 'undefined", + true, + typeof x == 'undefined'); + var x; + array[item++] = new TestCase( SECTION, + "var x; x == void 0", + true, + x == void 0); + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Types/e8_2.as b/mozilla/js/tamarin/test/ecma3/Types/e8_2.as new file mode 100644 index 00000000000..7e0fb263bf9 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Types/e8_2.as @@ -0,0 +1,57 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "8.2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "The null type"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var x = null; + array[item++] = new TestCase( SECTION, + "var x = null; typeof x", + null, + x); + + array[item++] = new TestCase( SECTION, + "typeof null", + "object", + typeof null); + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Types/e8_3.as b/mozilla/js/tamarin/test/ecma3/Types/e8_3.as new file mode 100644 index 00000000000..494709f7c04 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Types/e8_3.as @@ -0,0 +1,70 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "8.3"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "The Boolean type"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var x:Boolean; + array[item++] = new TestCase( SECTION, + "var x:Boolean; typeof x", + "boolean", + typeof x); + var x:Boolean; + array[item++] = new TestCase( SECTION, + "var x:Boolean; typeof x == 'boolean'", + true, + typeof x == 'boolean'); + var x:Boolean; + array[item++] = new TestCase( SECTION, + "var x:Boolean; x == false", + true, + x == false); + + + + var x:Boolean; + array[item++] = new TestCase( SECTION, + "var x:Boolean; !x == true", + true, + !x == true); + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Types/e8_4.as b/mozilla/js/tamarin/test/ecma3/Types/e8_4.as new file mode 100644 index 00000000000..e22115225ec --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Types/e8_4.as @@ -0,0 +1,111 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "8.4"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "The String type"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, + "var s = ''; s.length", + 0, + (s = '', s.length ) ); + + array[item++] = new TestCase( SECTION, + "var s = ''; s.charAt(0)", + "", + (s = '', s.charAt(0) ) ); + + + for ( var i = 0x0041, TEST_STRING = "", EXPECT_STRING = ""; i < 0x007B; i++ ) { + TEST_STRING += ("\\u"+ DecimalToHexString( i ) ); + EXPECT_STRING += String.fromCharCode(i); + } + //TEST_STRING = '\u0041\u0042\u0043\u0044\u0045\u0046\u0047\u0048\u0049\u004A\u004B\u004C\u004D\u004E\u004F\u0050\u0051\u0052\u0053\u0054\u0055\u0056\u0057\u0058\u0059\u005A\u005B\u005C\u005D\u005E\u005F\u0060\u0061\u0062\u0063\u0064\u0065\u0066\u0067\u0068\u0069\u006A\u006B\u006C\u006D\u006E\u006F\u0070\u0071\u0072\u0073\u0074\u0075\u0076\u0077\u0078\u0079\u007A' + + array[item++] = new TestCase( SECTION, + "var s = '" + TEST_STRING+ "'; s", + EXPECT_STRING, + (s = '\u0041\u0042\u0043\u0044\u0045\u0046\u0047\u0048\u0049\u004A\u004B\u004C\u004D\u004E\u004F\u0050\u0051\u0052\u0053\u0054\u0055\u0056\u0057\u0058\u0059\u005A\u005B\u005C\u005D\u005E\u005F\u0060\u0061\u0062\u0063\u0064\u0065\u0066\u0067\u0068\u0069\u006A\u006B\u006C\u006D\u006E\u006F\u0070\u0071\u0072\u0073\u0074\u0075\u0076\u0077\u0078\u0079\u007A', s ) ); + + array[item++] = new TestCase( SECTION, + "var s = '" + TEST_STRING+ "'; s.length", + 0x007B-0x0041, + (s = '\u0041\u0042\u0043\u0044\u0045\u0046\u0047\u0048\u0049\u004A\u004B\u004C\u004D\u004E\u004F\u0050\u0051\u0052\u0053\u0054\u0055\u0056\u0057\u0058\u0059\u005A\u005B\u005C\u005D\u005E\u005F\u0060\u0061\u0062\u0063\u0064\u0065\u0066\u0067\u0068\u0069\u006A\u006B\u006C\u006D\u006E\u006F\u0070\u0071\u0072\u0073\u0074\u0075\u0076\u0077\u0078\u0079\u007A', s.length ) ); + + return array; +} +function DecimalToHexString( n ) { + n = Number( n ); + var h = ""; + + for ( var i = 3; i >= 0; i-- ) { + if ( n >= Math.pow(16, i) ){ + var t = Math.floor( n / Math.pow(16, i)); + n -= t * Math.pow(16, i); + if ( t >= 10 ) { + if ( t == 10 ) { + h += "A"; + } + if ( t == 11 ) { + h += "B"; + } + if ( t == 12 ) { + h += "C"; + } + if ( t == 13 ) { + h += "D"; + } + if ( t == 14 ) { + h += "E"; + } + if ( t == 15 ) { + h += "F"; + } + } else { + h += String( t ); + } + } else { + h += "0"; + } + } + + return h; +} diff --git a/mozilla/js/tamarin/test/ecma3/Types/e8_5.as b/mozilla/js/tamarin/test/ecma3/Types/e8_5.as new file mode 100644 index 00000000000..904fcf9a14d --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Types/e8_5.as @@ -0,0 +1,161 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "8.4"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "The Number type"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + //NaN values of ECMAScript + + var s:Number = 'string' + array[item++] = new TestCase( SECTION, + "var s:Number = 'string'", + NaN,s ); + var k:Number = 'string' + + array[item++] = new TestCase( SECTION, + "Two NaN values are different from each other", + true, + (k!=s) ); + + //Positive Infinity and Negative Infinity + + array[item++] = new TestCase( SECTION, + "The special value positive Infinity", + Infinity, + Number.POSITIVE_INFINITY ); + + array[item++] = new TestCase( SECTION, + "The special value negative Infinity", + -Infinity, + Number.NEGATIVE_INFINITY ); + + //Positive zero and Negative Zero + + var x:Number = +0; + + array[item++] = new TestCase( SECTION, + "positive zero", + +0, + x ); + + array[item++] = new TestCase( SECTION, + "positive zero", + true, + x==0 ); + + var y:Number = -0; + + array[item++] = new TestCase( SECTION, + "Negative zero", + -0, + y ); + + + array[item++] = new TestCase( SECTION, + "Negative zero", + true, + y==0 ); + + array[item++] = new TestCase( SECTION, + "Negative zero==Positive zero", + true, + y==x ); + + //Finite Non-zero values + + //Finite nonzero values that are Normalised having the form s*m*2**e + // where s is +1 or -1, m is a positive integer less than 2**53 but not + // less than s**52 and e is an integer ranging from -1074 to 971 + + array[item++] = new TestCase( SECTION,"Positive finite Non zero values where e is -1074",4.4501477170144023e-308,(1*((Math.pow(2,53))-1)*(Math.pow(2,-1074))) ); + + + array[item++] = new TestCase( SECTION,"Positive finite Non zero values where e is -1074",2.2250738585072014e-308,(1*(Math.pow(2,52))*(Math.pow(2,-1074))) ); + + array[item++] = new TestCase( SECTION,"Positive finite Non zero values where e is 971", "1e+308",(1*(Math.pow(2,52))*(Math.pow(2,971)))+"" ); + + array[item++] = new TestCase( SECTION,"Positive finite Non zero values where e is 971", "1.79769313486231e+308",(1*((Math.pow(2,53))-1)*(Math.pow(2,971)))+"" ); + + array[item++] = new TestCase( SECTION,"Negative finite Non zero values where e is -1074",-2.2250738585072014e-308,(-1*(Math.pow(2,52))*(Math.pow(2,-1074))) ); + + array[item++] = new TestCase( SECTION,"Negative finite Non zero values where e is 971", "-e+308",(-1*(Math.pow(2,52))*(Math.pow(2,971)))+"" ); + + + //Finite nonzero values that are denormalised having the form s*m*2**e + // where s is +1 or -1, m is a positive integer less than 2**52 + // and e is -1074 + + array[item++] = new TestCase( SECTION,"Positive finite Non zero values where e is -1074",1.1125369292536007e-308,(1*(Math.pow(2,51))*(Math.pow(2,-1074))) ); + + array[item++] = new TestCase( SECTION,"Positive finite Non zero values where e is -1074",-1.1125369292536007e-308,(-1*(Math.pow(2,51))*(Math.pow(2,-1074))) ); + + //When number value for Y is closest to 2**1024 should convert to Infinity where x is + // nonzero real mathematical quantity + + var Y:Number = 1e+308*2 + + array[item++] = new TestCase( SECTION,"the number value for x closest to 2**1024",Infinity,Y); + + array[item++] = new TestCase( SECTION,"the number value for x closest to 2**1024",Infinity,(1*(Math.pow(2,53))*(Math.pow(2,971)))); + + + + //When number value for z is closest to -2**1024 should convert to Infinity where x is + // nonzero real mathematical quantity + + var z:Number = -1e+308*3 + + array[item++] = new TestCase( SECTION,"the number value for x closest to -2**1024",-Infinity,z); + + //When number value for l is closest to +0 should convert to -0 where l is + // nonzero real mathematical quantity and less than 0 + // Expected result should be -0, however, base 10 approximations of a base 2 number results in loss of precision + + var l:Number = 1e-308*2 + + array[item++] = new TestCase( SECTION,"the number value for x closest to +0",1.9999999999999998e-308,l); + + var m:Number = -1e-308*3 + + array[item++] = new TestCase( SECTION,"the number value for x closest to +0",-2.9999999999999997e-308,m); + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Types/e8_6_1.as b/mozilla/js/tamarin/test/ecma3/Types/e8_6_1.as new file mode 100644 index 00000000000..461fe2c4b8a --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Types/e8_6_1.as @@ -0,0 +1,98 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "8.6.1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Property attributes of Object type"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var OBJ_PROT = Object.prototype; + + try{ + Object.prototype=null + }catch(e:ReferenceError){ + thisError=e.toString(); + }finally{ + array[item++]=new TestCase(SECTION,"Verifying the read only property of Object.prototype","ReferenceError: Error #1074",referenceError(thisError)); + } + array[item++] = new TestCase( SECTION, + "var OBJ_PROT = Object.prototype; Object.prototype = null; Object.prototype == OBJ_PROT", + true, + (OBJ_PROT = Object.prototype, Object.prototype == OBJ_PROT ) ); + + + try{ + Object.prototype=0 + }catch(e:ReferenceError){ + thisError=e.toString(); + }finally{ + array[item++]=new TestCase(SECTION,"Verifying the read only property of Object.prototype","ReferenceError: Error #1074",referenceError(thisError)); + } + array[item++] = new TestCase( SECTION, + "Object.prototype=0; Object.prototype", + Object.prototype, + Object.prototype ); + + var OBJ_PROT1 = Object.prototype; + delete( Object.prototype ); + array[item++] = new TestCase(SECTION, "var OBJ_PROT1 = Object.prototype; delete( Object.prototype ); OBJ_PROT1 == Object.prototype", true, OBJ_PROT1 == Object.prototype); + array[item++] = new TestCase(SECTION, "delete( Object.prototype )", false, delete( Object.prototype ) ); + + var string = ''; + for ( prop in Object ) { + string += ( prop == 'prototype' ) ? prop : ''; + } + + array[item++] = new TestCase(SECTION,"var string = ''; for ( prop in Object ) { string += ( prop == 'prototype' ) ? prop: '' } string;","",string); + + + + return ( array ); +} + + +function MyObject( value ) { + this.value = value; + + // the new Function() changes to function() {}. + this.valueOf = function() { return this.value; } + this.toString = function() { return this.value+''; } + this.valueOf = function() { return this.value; } + this.toString = function() { return this.value +'';} +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u0000_BasicLatin.as b/mozilla/js/tamarin/test/ecma3/Unicode/u0000_BasicLatin.as new file mode 100644 index 00000000000..d8a40f11f60 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u0000_BasicLatin.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Basic Latin"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Basic Latin + testUnicodeRange(0x0001, 0x007F); + negativeTestUnicodeRange(0x0001, 0x007F); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u0080_Latin_1Supplement.as b/mozilla/js/tamarin/test/ecma3/Unicode/u0080_Latin_1Supplement.as new file mode 100644 index 00000000000..3010bc1bd94 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u0080_Latin_1Supplement.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Latin-1 Supplement"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Latin-1 Supplement + testUnicodeRange(0x0080, 0x00FF); + negativeTestUnicodeRange(0x0080, 0x00FF); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u0100_LatinExtended_A.as b/mozilla/js/tamarin/test/ecma3/Unicode/u0100_LatinExtended_A.as new file mode 100644 index 00000000000..1c82bf3af0f --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u0100_LatinExtended_A.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Latin Extended-A"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Latin Extended-A + testUnicodeRange(0x0100, 0x017F); + negativeTestUnicodeRange(0x0100, 0x017F); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u0180_LatinExtended_B.as b/mozilla/js/tamarin/test/ecma3/Unicode/u0180_LatinExtended_B.as new file mode 100644 index 00000000000..84fc57d7473 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u0180_LatinExtended_B.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Latin Extended-B"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Latin Extended-B + testUnicodeRange(0x0180, 0x024F); + negativeTestUnicodeRange(0x0180, 0x024F); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u0250_IPAExtensions.as b/mozilla/js/tamarin/test/ecma3/Unicode/u0250_IPAExtensions.as new file mode 100644 index 00000000000..4fecec6f0cd --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u0250_IPAExtensions.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "IPA Extensions"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // IPA Extensions + testUnicodeRange(0x0250, 0x02AF); + negativeTestUnicodeRange(0x0250, 0x02AF); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u02B0_SpacingModifierLetters.as b/mozilla/js/tamarin/test/ecma3/Unicode/u02B0_SpacingModifierLetters.as new file mode 100644 index 00000000000..490533fef0f --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u02B0_SpacingModifierLetters.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Spacing Modifier Letters"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Spacing Modifier Letters + testUnicodeRange(0x02B0, 0x02FF); + negativeTestUnicodeRange(0x02B0, 0x02FF); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u0300_CombiningDiacriticalMarks.as b/mozilla/js/tamarin/test/ecma3/Unicode/u0300_CombiningDiacriticalMarks.as new file mode 100644 index 00000000000..287f0acd37e --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u0300_CombiningDiacriticalMarks.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Combining Diacritical Marks"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Combining Diacritical Marks + testUnicodeRange(0x0300, 0x036F); + negativeTestUnicodeRange(0x0300, 0x036F); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u0370_GreekandCoptic.as b/mozilla/js/tamarin/test/ecma3/Unicode/u0370_GreekandCoptic.as new file mode 100644 index 00000000000..408afa17d05 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u0370_GreekandCoptic.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Greek and Coptic"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Greek and Coptic + testUnicodeRange(0x0370, 0x03FF); + negativeTestUnicodeRange(0x0370, 0x03FF); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u0400_Cyrillic.as b/mozilla/js/tamarin/test/ecma3/Unicode/u0400_Cyrillic.as new file mode 100644 index 00000000000..9483a11f97c --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u0400_Cyrillic.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Cyrillic"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Cyrillic + testUnicodeRange(0x0400, 0x04FF); + negativeTestUnicodeRange(0x0400, 0x04FF); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u0500_CyrillicSupplementary.as b/mozilla/js/tamarin/test/ecma3/Unicode/u0500_CyrillicSupplementary.as new file mode 100644 index 00000000000..0eaf2e3b2c2 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u0500_CyrillicSupplementary.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Cyrillic Supplementary"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Cyrillic Supplementary + testUnicodeRange(0x0500, 0x052F); + negativeTestUnicodeRange(0x0500, 0x052F); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u0530_Armenian.as b/mozilla/js/tamarin/test/ecma3/Unicode/u0530_Armenian.as new file mode 100644 index 00000000000..f97fbfe1479 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u0530_Armenian.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Armenian"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Armenian + testUnicodeRange(0x0530, 0x058F); + negativeTestUnicodeRange(0x0530, 0x058F); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u0590_Hebrew.as b/mozilla/js/tamarin/test/ecma3/Unicode/u0590_Hebrew.as new file mode 100644 index 00000000000..db6ac8d15f1 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u0590_Hebrew.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Hebrew"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Hebrew + testUnicodeRange(0x0590, 0x05FF); + negativeTestUnicodeRange(0x0590, 0x05FF); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u0600_Arabic.as b/mozilla/js/tamarin/test/ecma3/Unicode/u0600_Arabic.as new file mode 100644 index 00000000000..26144de386d --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u0600_Arabic.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Arabic"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Arabic + testUnicodeRange(0x0600, 0x06FF); + negativeTestUnicodeRange(0x0600, 0x06FF); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u0700_Syriac.as b/mozilla/js/tamarin/test/ecma3/Unicode/u0700_Syriac.as new file mode 100644 index 00000000000..c3ed017e317 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u0700_Syriac.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Syriac"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Syriac + testUnicodeRange(0x0700, 0x074F); + negativeTestUnicodeRange(0x0700, 0x074F); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u0780_Thaana.as b/mozilla/js/tamarin/test/ecma3/Unicode/u0780_Thaana.as new file mode 100644 index 00000000000..0920672c500 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u0780_Thaana.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Thaana"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Thaana + testUnicodeRange(0x0780, 0x07BF); + negativeTestUnicodeRange(0x0780, 0x07BF); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u0900_Devanagari.as b/mozilla/js/tamarin/test/ecma3/Unicode/u0900_Devanagari.as new file mode 100644 index 00000000000..14426e0c720 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u0900_Devanagari.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Devanagari"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Devanagari + testUnicodeRange(0x0900, 0x097F); + negativeTestUnicodeRange(0x0900, 0x097F); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u0980_Bengali.as b/mozilla/js/tamarin/test/ecma3/Unicode/u0980_Bengali.as new file mode 100644 index 00000000000..96537afff25 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u0980_Bengali.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Bengali"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Bengali + testUnicodeRange(0x0980, 0x09FF); + negativeTestUnicodeRange(0x0980, 0x09FF); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u0A00_Gurmukhi.as b/mozilla/js/tamarin/test/ecma3/Unicode/u0A00_Gurmukhi.as new file mode 100644 index 00000000000..a940bf7d960 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u0A00_Gurmukhi.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Gurmukhi"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Gurmukhi + testUnicodeRange(0x0A00, 0x0A7F); + negativeTestUnicodeRange(0x0A00, 0x0A7F); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u0A80_Gujarati.as b/mozilla/js/tamarin/test/ecma3/Unicode/u0A80_Gujarati.as new file mode 100644 index 00000000000..532debb7e3d --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u0A80_Gujarati.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Gujarati"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Gujarati + testUnicodeRange(0x0A80, 0x0AFF); + negativeTestUnicodeRange(0x0A80, 0x0AFF); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u0B00_Oriya.as b/mozilla/js/tamarin/test/ecma3/Unicode/u0B00_Oriya.as new file mode 100644 index 00000000000..902e75efafb --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u0B00_Oriya.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Oriya"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Oriya + testUnicodeRange(0x0B00, 0x0B7F); + negativeTestUnicodeRange(0x0B00, 0x0B7F); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u0B80_Tamil.as b/mozilla/js/tamarin/test/ecma3/Unicode/u0B80_Tamil.as new file mode 100644 index 00000000000..d03d604d9df --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u0B80_Tamil.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Tamil"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Tamil + testUnicodeRange(0x0B80, 0x0BFF); + negativeTestUnicodeRange(0x0B80, 0x0BFF); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u0C00_Telugu.as b/mozilla/js/tamarin/test/ecma3/Unicode/u0C00_Telugu.as new file mode 100644 index 00000000000..87786780878 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u0C00_Telugu.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Telugu"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Telugu + testUnicodeRange(0x0C00, 0x0C7F); + negativeTestUnicodeRange(0x0C00, 0x0C7F); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u0C80_Kannada.as b/mozilla/js/tamarin/test/ecma3/Unicode/u0C80_Kannada.as new file mode 100644 index 00000000000..6b6b38004b5 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u0C80_Kannada.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Kannada"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Kannada + testUnicodeRange(0x0C80, 0x0CFF); + negativeTestUnicodeRange(0x0C80, 0x0CFF); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u0D00_Malayalam.as b/mozilla/js/tamarin/test/ecma3/Unicode/u0D00_Malayalam.as new file mode 100644 index 00000000000..026382ad7be --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u0D00_Malayalam.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Malayalam"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Malayalam + testUnicodeRange(0x0D00, 0x0D7F); + negativeTestUnicodeRange(0x0D00, 0x0D7F); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u0D80_Sinhala.as b/mozilla/js/tamarin/test/ecma3/Unicode/u0D80_Sinhala.as new file mode 100644 index 00000000000..4dae64c83e5 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u0D80_Sinhala.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Sinhala"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Sinhala + testUnicodeRange(0x0D80, 0x0DFF); + negativeTestUnicodeRange(0x0D80, 0x0DFF); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u0E00_Thai.as b/mozilla/js/tamarin/test/ecma3/Unicode/u0E00_Thai.as new file mode 100644 index 00000000000..34136d25a7f --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u0E00_Thai.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Thai"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Thai + testUnicodeRange(0x0E00, 0x0E7F); + negativeTestUnicodeRange(0x0E00, 0x0E7F); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u0E80_Lao.as b/mozilla/js/tamarin/test/ecma3/Unicode/u0E80_Lao.as new file mode 100644 index 00000000000..d6c03727a34 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u0E80_Lao.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Lao"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Lao + testUnicodeRange(0x0E80, 0x0EFF); + negativeTestUnicodeRange(0x0E80, 0x0EFF); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u0F00_Tibetan.as b/mozilla/js/tamarin/test/ecma3/Unicode/u0F00_Tibetan.as new file mode 100644 index 00000000000..2e855a8bc10 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u0F00_Tibetan.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Tibetan"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Tibetan + testUnicodeRange(0x0F00, 0x0FFF); + negativeTestUnicodeRange(0x0F00, 0x0FFF); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u1000_Myanmar.as b/mozilla/js/tamarin/test/ecma3/Unicode/u1000_Myanmar.as new file mode 100644 index 00000000000..11e03d8b415 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u1000_Myanmar.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Myanmar"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Myanmar + testUnicodeRange(0x1000, 0x109F); + negativeTestUnicodeRange(0x1000, 0x109F); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u10A0_Georgian.as b/mozilla/js/tamarin/test/ecma3/Unicode/u10A0_Georgian.as new file mode 100644 index 00000000000..66e9dbe66d3 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u10A0_Georgian.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Georgian"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Georgian + testUnicodeRange(0x10A0, 0x10FF); + negativeTestUnicodeRange(0x10A0, 0x10FF); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u1100_HangulJamo.as b/mozilla/js/tamarin/test/ecma3/Unicode/u1100_HangulJamo.as new file mode 100644 index 00000000000..e5a8bfd51a9 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u1100_HangulJamo.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Hangul Jamo"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Hangul Jamo + testUnicodeRange(0x1100, 0x11FF); + negativeTestUnicodeRange(0x1100, 0x11FF); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u1200_Ethiopic.as b/mozilla/js/tamarin/test/ecma3/Unicode/u1200_Ethiopic.as new file mode 100644 index 00000000000..e3db51b2999 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u1200_Ethiopic.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Ethiopic"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Ethiopic + testUnicodeRange(0x1200, 0x137F); + negativeTestUnicodeRange(0x1200, 0x137F); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u13A0_Cherokee.as b/mozilla/js/tamarin/test/ecma3/Unicode/u13A0_Cherokee.as new file mode 100644 index 00000000000..0006533e7ed --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u13A0_Cherokee.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Cherokee"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Cherokee + testUnicodeRange(0x13A0, 0x13FF); + negativeTestUnicodeRange(0x13A0, 0x13FF); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u1400_UnifiedCanadianAboriginalSyllabics.as b/mozilla/js/tamarin/test/ecma3/Unicode/u1400_UnifiedCanadianAboriginalSyllabics.as new file mode 100644 index 00000000000..746a8c88b1a --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u1400_UnifiedCanadianAboriginalSyllabics.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Unified Canadian Aboriginal Syllabics"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Unified Canadian Aboriginal Syllabics + testUnicodeRange(0x1400, 0x167F); + negativeTestUnicodeRange(0x1400, 0x167F); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u1680_Ogham.as b/mozilla/js/tamarin/test/ecma3/Unicode/u1680_Ogham.as new file mode 100644 index 00000000000..d208e8e4e81 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u1680_Ogham.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Ogham"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Ogham + testUnicodeRange(0x1680, 0x169F); + negativeTestUnicodeRange(0x1680, 0x169F); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u16A0_Runic.as b/mozilla/js/tamarin/test/ecma3/Unicode/u16A0_Runic.as new file mode 100644 index 00000000000..94d0ed01806 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u16A0_Runic.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Runic"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Runic + testUnicodeRange(0x16A0, 0x16FF); + negativeTestUnicodeRange(0x16A0, 0x16FF); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u1700_Tagalog.as b/mozilla/js/tamarin/test/ecma3/Unicode/u1700_Tagalog.as new file mode 100644 index 00000000000..08fe69754d3 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u1700_Tagalog.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Tagalog"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Tagalog + testUnicodeRange(0x1700, 0x171F); + negativeTestUnicodeRange(0x1700, 0x171F); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u1720_Hanunoo.as b/mozilla/js/tamarin/test/ecma3/Unicode/u1720_Hanunoo.as new file mode 100644 index 00000000000..51958675895 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u1720_Hanunoo.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Hanunoo"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Hanunoo + testUnicodeRange(0x1720, 0x173F); + negativeTestUnicodeRange(0x1720, 0x173F); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u1740_Buhid.as b/mozilla/js/tamarin/test/ecma3/Unicode/u1740_Buhid.as new file mode 100644 index 00000000000..d5d5ae8dcb1 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u1740_Buhid.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Buhid"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Buhid + testUnicodeRange(0x1740, 0x175F); + negativeTestUnicodeRange(0x1740, 0x175F); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u1760_Tagbanwa.as b/mozilla/js/tamarin/test/ecma3/Unicode/u1760_Tagbanwa.as new file mode 100644 index 00000000000..1f3e4b9e78b --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u1760_Tagbanwa.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Tagbanwa"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Tagbanwa + testUnicodeRange(0x1760, 0x177F); + negativeTestUnicodeRange(0x1760, 0x177F); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u1780_Khmer.as b/mozilla/js/tamarin/test/ecma3/Unicode/u1780_Khmer.as new file mode 100644 index 00000000000..7e4e62ebf18 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u1780_Khmer.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Khmer"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Khmer + testUnicodeRange(0x1780, 0x17FF); + negativeTestUnicodeRange(0x1780, 0x17FF); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u1800_Mongolian.as b/mozilla/js/tamarin/test/ecma3/Unicode/u1800_Mongolian.as new file mode 100644 index 00000000000..4e35a8dbeb3 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u1800_Mongolian.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Mongolian"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Mongolian + testUnicodeRange(0x1800, 0x18AF); + negativeTestUnicodeRange(0x1800, 0x18AF); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u1E00_LatinExtendedAdditional.as b/mozilla/js/tamarin/test/ecma3/Unicode/u1E00_LatinExtendedAdditional.as new file mode 100644 index 00000000000..d81ba766ff1 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u1E00_LatinExtendedAdditional.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Latin Extended Additional"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Latin Extended Additional + testUnicodeRange(0x1E00, 0x1EFF); + negativeTestUnicodeRange(0x1E00, 0x1EFF); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u1F00_GreekExtended.as b/mozilla/js/tamarin/test/ecma3/Unicode/u1F00_GreekExtended.as new file mode 100644 index 00000000000..e86a7e951e4 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u1F00_GreekExtended.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Greek Extended"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Greek Extended + testUnicodeRange(0x1F00, 0x1FFF); + negativeTestUnicodeRange(0x1F00, 0x1FFF); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u2000_GeneralPunctuation.as b/mozilla/js/tamarin/test/ecma3/Unicode/u2000_GeneralPunctuation.as new file mode 100644 index 00000000000..084765d3d86 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u2000_GeneralPunctuation.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "General Punctuation"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // General Punctuation + testUnicodeRange(0x2000, 0x206F); + negativeTestUnicodeRange(0x2000, 0x206F); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u2070_SuperscriptsandSubscripts.as b/mozilla/js/tamarin/test/ecma3/Unicode/u2070_SuperscriptsandSubscripts.as new file mode 100644 index 00000000000..cb6fccba26b --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u2070_SuperscriptsandSubscripts.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Superscripts and Subscripts"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Superscripts and Subscripts + testUnicodeRange(0x2070, 0x209F); + negativeTestUnicodeRange(0x2070, 0x209F); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u20A0_CurrencySymbols.as b/mozilla/js/tamarin/test/ecma3/Unicode/u20A0_CurrencySymbols.as new file mode 100644 index 00000000000..528d4e5ed1e --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u20A0_CurrencySymbols.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Currency Symbols"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Currency Symbols + testUnicodeRange(0x20A0, 0x20CF); + negativeTestUnicodeRange(0x20A0, 0x20CF); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u20D0_CombiningDiacriticalMarksforSymbols.as b/mozilla/js/tamarin/test/ecma3/Unicode/u20D0_CombiningDiacriticalMarksforSymbols.as new file mode 100644 index 00000000000..39d7ca3392b --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u20D0_CombiningDiacriticalMarksforSymbols.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Combining Diacritical Marks for Symbols"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Combining Diacritical Marks for Symbols + testUnicodeRange(0x20D0, 0x20FF); + negativeTestUnicodeRange(0x20D0, 0x20FF); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u2100_LetterlikeSymbols.as b/mozilla/js/tamarin/test/ecma3/Unicode/u2100_LetterlikeSymbols.as new file mode 100644 index 00000000000..c45ed9a75b6 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u2100_LetterlikeSymbols.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Letterlike Symbols"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Letterlike Symbols + testUnicodeRange(0x2100, 0x214F); + negativeTestUnicodeRange(0x2100, 0x214F); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u2150_NumberForms.as b/mozilla/js/tamarin/test/ecma3/Unicode/u2150_NumberForms.as new file mode 100644 index 00000000000..bd5b4ab999c --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u2150_NumberForms.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Number Forms"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Number Forms + testUnicodeRange(0x2150, 0x218F); + negativeTestUnicodeRange(0x2150, 0x218F); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u2190_Arrows.as b/mozilla/js/tamarin/test/ecma3/Unicode/u2190_Arrows.as new file mode 100644 index 00000000000..bc3cb8c3a15 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u2190_Arrows.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Arrows"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Arrows + testUnicodeRange(0x2190, 0x21FF); + negativeTestUnicodeRange(0x2190, 0x21FF); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u2200_MathematicalOperators.as b/mozilla/js/tamarin/test/ecma3/Unicode/u2200_MathematicalOperators.as new file mode 100644 index 00000000000..1f5484abf8c --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u2200_MathematicalOperators.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Mathematical Operators"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Mathematical Operators + testUnicodeRange(0x2200, 0x22FF); + negativeTestUnicodeRange(0x2200, 0x22FF); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u2300_MiscellaneousTechnical.as b/mozilla/js/tamarin/test/ecma3/Unicode/u2300_MiscellaneousTechnical.as new file mode 100644 index 00000000000..05b11be057b --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u2300_MiscellaneousTechnical.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Miscellaneous Technical"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Miscellaneous Technical + testUnicodeRange(0x2300, 0x23FF); + negativeTestUnicodeRange(0x2300, 0x23FF); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u2400_ControlPictures.as b/mozilla/js/tamarin/test/ecma3/Unicode/u2400_ControlPictures.as new file mode 100644 index 00000000000..64b72ddcdb9 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u2400_ControlPictures.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Control Pictures"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Control Pictures + testUnicodeRange(0x2400, 0x243F); + negativeTestUnicodeRange(0x2400, 0x243F); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u2440_OpticalCharacterRecognition.as b/mozilla/js/tamarin/test/ecma3/Unicode/u2440_OpticalCharacterRecognition.as new file mode 100644 index 00000000000..95d0f8b0e5c --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u2440_OpticalCharacterRecognition.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Optical Character Recognition"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Optical Character Recognition + testUnicodeRange(0x2440, 0x245F); + negativeTestUnicodeRange(0x2440, 0x245F); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u2460_EnclosedAlphanumerics.as b/mozilla/js/tamarin/test/ecma3/Unicode/u2460_EnclosedAlphanumerics.as new file mode 100644 index 00000000000..e7b8986c7e8 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u2460_EnclosedAlphanumerics.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Enclosed Alphanumerics"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Enclosed Alphanumerics + testUnicodeRange(0x2460, 0x24FF); + negativeTestUnicodeRange(0x2460, 0x24FF); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u2500_BoxDrawing.as b/mozilla/js/tamarin/test/ecma3/Unicode/u2500_BoxDrawing.as new file mode 100644 index 00000000000..d50d7384ecc --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u2500_BoxDrawing.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Box Drawing"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Box Drawing + testUnicodeRange(0x2500, 0x257F); + negativeTestUnicodeRange(0x2500, 0x257F); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u2580_BlockElements.as b/mozilla/js/tamarin/test/ecma3/Unicode/u2580_BlockElements.as new file mode 100644 index 00000000000..973ca400746 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u2580_BlockElements.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Block Elements"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Block Elements + testUnicodeRange(0x2580, 0x259F); + negativeTestUnicodeRange(0x2580, 0x259F); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u25A0_GeometricShapes.as b/mozilla/js/tamarin/test/ecma3/Unicode/u25A0_GeometricShapes.as new file mode 100644 index 00000000000..98adaa56648 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u25A0_GeometricShapes.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Geometric Shapes"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Geometric Shapes + testUnicodeRange(0x25A0, 0x25FF); + negativeTestUnicodeRange(0x25A0, 0x25FF); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u2600_MiscellaneousSymbols.as b/mozilla/js/tamarin/test/ecma3/Unicode/u2600_MiscellaneousSymbols.as new file mode 100644 index 00000000000..c07809d5e52 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u2600_MiscellaneousSymbols.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Miscellaneous Symbols"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Miscellaneous Symbols + testUnicodeRange(0x2600, 0x26FF); + negativeTestUnicodeRange(0x2600, 0x26FF); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u2700_Dingbats.as b/mozilla/js/tamarin/test/ecma3/Unicode/u2700_Dingbats.as new file mode 100644 index 00000000000..37928cea261 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u2700_Dingbats.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Dingbats"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Dingbats + testUnicodeRange(0x2700, 0x27BF); + negativeTestUnicodeRange(0x2700, 0x27BF); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u27C0_MiscellaneousMathematicalSymbols_A.as b/mozilla/js/tamarin/test/ecma3/Unicode/u27C0_MiscellaneousMathematicalSymbols_A.as new file mode 100644 index 00000000000..446e02698e9 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u27C0_MiscellaneousMathematicalSymbols_A.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Miscellaneous Mathematical Symbols-A"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Miscellaneous Mathematical Symbols-A + testUnicodeRange(0x27C0, 0x27EF); + negativeTestUnicodeRange(0x27C0, 0x27EF); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u27F0_SupplementalArrows_A.as b/mozilla/js/tamarin/test/ecma3/Unicode/u27F0_SupplementalArrows_A.as new file mode 100644 index 00000000000..4f2bfaaad8b --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u27F0_SupplementalArrows_A.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Supplemental Arrows-A"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Supplemental Arrows-A + testUnicodeRange(0x27F0, 0x27FF); + negativeTestUnicodeRange(0x27F0, 0x27FF); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u2800_BraillePatterns.as b/mozilla/js/tamarin/test/ecma3/Unicode/u2800_BraillePatterns.as new file mode 100644 index 00000000000..9c7ccda2840 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u2800_BraillePatterns.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Braille Patterns"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Braille Patterns + testUnicodeRange(0x2800, 0x28FF); + negativeTestUnicodeRange(0x2800, 0x28FF); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u2900_SupplementalArrows_B.as b/mozilla/js/tamarin/test/ecma3/Unicode/u2900_SupplementalArrows_B.as new file mode 100644 index 00000000000..fe9db0155bf --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u2900_SupplementalArrows_B.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Supplemental Arrows-B"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Supplemental Arrows-B + testUnicodeRange(0x2900, 0x297F); + negativeTestUnicodeRange(0x2900, 0x297F); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u2980_MiscellaneousMathematicalSymbols_B.as b/mozilla/js/tamarin/test/ecma3/Unicode/u2980_MiscellaneousMathematicalSymbols_B.as new file mode 100644 index 00000000000..54c7e82eabe --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u2980_MiscellaneousMathematicalSymbols_B.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Miscellaneous Mathematical Symbols-B"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Miscellaneous Mathematical Symbols-B + testUnicodeRange(0x2980, 0x29FF); + negativeTestUnicodeRange(0x2980, 0x29FF); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u2A00_SupplementalMathematicalOperators.as b/mozilla/js/tamarin/test/ecma3/Unicode/u2A00_SupplementalMathematicalOperators.as new file mode 100644 index 00000000000..4541d076124 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u2A00_SupplementalMathematicalOperators.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Supplemental Mathematical Operators"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Supplemental Mathematical Operators + testUnicodeRange(0x2A00, 0x2AFF); + negativeTestUnicodeRange(0x2A00, 0x2AFF); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u2E80_CJKRadicalsSupplement.as b/mozilla/js/tamarin/test/ecma3/Unicode/u2E80_CJKRadicalsSupplement.as new file mode 100644 index 00000000000..c2b5a78c709 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u2E80_CJKRadicalsSupplement.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "CJK Radicals Supplement"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // CJK Radicals Supplement + testUnicodeRange(0x2E80, 0x2EFF); + negativeTestUnicodeRange(0x2E80, 0x2EFF); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u2F00_KangxiRadicals.as b/mozilla/js/tamarin/test/ecma3/Unicode/u2F00_KangxiRadicals.as new file mode 100644 index 00000000000..f9d0ee7598c --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u2F00_KangxiRadicals.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Kangxi Radicals"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Kangxi Radicals + testUnicodeRange(0x2F00, 0x2FDF); + negativeTestUnicodeRange(0x2F00, 0x2FDF); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u2FF0_IdeographicDescriptionCharacters.as b/mozilla/js/tamarin/test/ecma3/Unicode/u2FF0_IdeographicDescriptionCharacters.as new file mode 100644 index 00000000000..22541440723 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u2FF0_IdeographicDescriptionCharacters.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Ideographic Description Characters"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Ideographic Description Characters + testUnicodeRange(0x2FF0, 0x2FFF); + negativeTestUnicodeRange(0x2FF0, 0x2FFF); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u3000_CJKSymbolsandPunctuation.as b/mozilla/js/tamarin/test/ecma3/Unicode/u3000_CJKSymbolsandPunctuation.as new file mode 100644 index 00000000000..965ca5c1141 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u3000_CJKSymbolsandPunctuation.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "CJK Symbols and Punctuation"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // CJK Symbols and Punctuation + testUnicodeRange(0x3000, 0x303F); + negativeTestUnicodeRange(0x3000, 0x303F); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u3040_Hiragana.as b/mozilla/js/tamarin/test/ecma3/Unicode/u3040_Hiragana.as new file mode 100644 index 00000000000..972fbee6b00 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u3040_Hiragana.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Hiragana"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Hiragana + testUnicodeRange(0x3040, 0x309F); + negativeTestUnicodeRange(0x3040, 0x309F); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u30A0_Katakana.as b/mozilla/js/tamarin/test/ecma3/Unicode/u30A0_Katakana.as new file mode 100644 index 00000000000..a483ebd6b66 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u30A0_Katakana.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Katakana"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Katakana + testUnicodeRange(0x30A0, 0x30FF); + negativeTestUnicodeRange(0x30A0, 0x30FF); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u3100_Bopomofo.as b/mozilla/js/tamarin/test/ecma3/Unicode/u3100_Bopomofo.as new file mode 100644 index 00000000000..b75d68662c4 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u3100_Bopomofo.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Bopomofo"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Bopomofo + testUnicodeRange(0x3100, 0x312F); + negativeTestUnicodeRange(0x3100, 0x312F); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u3130_HangulCompatibilityJamo.as b/mozilla/js/tamarin/test/ecma3/Unicode/u3130_HangulCompatibilityJamo.as new file mode 100644 index 00000000000..a4bedb2b5ab --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u3130_HangulCompatibilityJamo.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Hangul Compatibility Jamo"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Hangul Compatibility Jamo + testUnicodeRange(0x3130, 0x318F); + negativeTestUnicodeRange(0x3130, 0x318F); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u3190_Kanbun.as b/mozilla/js/tamarin/test/ecma3/Unicode/u3190_Kanbun.as new file mode 100644 index 00000000000..537abfd0b47 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u3190_Kanbun.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Kanbun"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Kanbun + testUnicodeRange(0x3190, 0x319F); + negativeTestUnicodeRange(0x3190, 0x319F); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u31A0_BopomofoExtended.as b/mozilla/js/tamarin/test/ecma3/Unicode/u31A0_BopomofoExtended.as new file mode 100644 index 00000000000..01b247f9b1c --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u31A0_BopomofoExtended.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Bopomofo Extended"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Bopomofo Extended + testUnicodeRange(0x31A0, 0x31BF); + negativeTestUnicodeRange(0x31A0, 0x31BF); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u31F0_KatakanaPhoneticExtensions.as b/mozilla/js/tamarin/test/ecma3/Unicode/u31F0_KatakanaPhoneticExtensions.as new file mode 100644 index 00000000000..a7c8987113f --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u31F0_KatakanaPhoneticExtensions.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Katakana Phonetic Extensions"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Katakana Phonetic Extensions + testUnicodeRange(0x31F0, 0x31FF); + negativeTestUnicodeRange(0x31F0, 0x31FF); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u3200_EnclosedCJKLettersandMonths.as b/mozilla/js/tamarin/test/ecma3/Unicode/u3200_EnclosedCJKLettersandMonths.as new file mode 100644 index 00000000000..68db90bf80b --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u3200_EnclosedCJKLettersandMonths.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Enclosed CJK Letters and Months"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Enclosed CJK Letters and Months + testUnicodeRange(0x3200, 0x32FF); + negativeTestUnicodeRange(0x3200, 0x32FF); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u3300_CJKCompatibility.as b/mozilla/js/tamarin/test/ecma3/Unicode/u3300_CJKCompatibility.as new file mode 100644 index 00000000000..4e240781d2e --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u3300_CJKCompatibility.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "CJK Compatibility"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // CJK Compatibility + testUnicodeRange(0x3300, 0x33FF); + negativeTestUnicodeRange(0x3300, 0x33FF); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u3400_CJKUnifiedIdeographsExtensionA.as b/mozilla/js/tamarin/test/ecma3/Unicode/u3400_CJKUnifiedIdeographsExtensionA.as new file mode 100644 index 00000000000..8c6edc767a5 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u3400_CJKUnifiedIdeographsExtensionA.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "CJK Unified Ideographs Extension A"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // CJK Unified Ideographs Extension A + testUnicodeRange(0x3400, 0x4DBF); + negativeTestUnicodeRange(0x3400, 0x4DBF); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u4E00_CJKUnifiedIdeographs.as b/mozilla/js/tamarin/test/ecma3/Unicode/u4E00_CJKUnifiedIdeographs.as new file mode 100644 index 00000000000..48ae0164a03 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u4E00_CJKUnifiedIdeographs.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "CJK Unified Ideographs"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // CJK Unified Ideographs + testUnicodeRange(0x4E00, 0x4FFF); + negativeTestUnicodeRange(0x4E00, 0x4FFF); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u5000_CJKUnifiedIdeographs.as b/mozilla/js/tamarin/test/ecma3/Unicode/u5000_CJKUnifiedIdeographs.as new file mode 100644 index 00000000000..07b6e4274cd --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u5000_CJKUnifiedIdeographs.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "CJK Unified Ideographs"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // CJK Unified Ideographs + testUnicodeRange(0x5000, 0x5FFF); + negativeTestUnicodeRange(0x5000, 0x5FFF); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u6000_CJKUnifiedIdeographs.as b/mozilla/js/tamarin/test/ecma3/Unicode/u6000_CJKUnifiedIdeographs.as new file mode 100644 index 00000000000..8cd01af344e --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u6000_CJKUnifiedIdeographs.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "CJK Unified Ideographs"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // CJK Unified Ideographs + testUnicodeRange(0x6000, 0x6FFF); + negativeTestUnicodeRange(0x6000, 0x6FFF); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u7000_CJKUnifiedIdeographs.as b/mozilla/js/tamarin/test/ecma3/Unicode/u7000_CJKUnifiedIdeographs.as new file mode 100644 index 00000000000..e13a6501133 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u7000_CJKUnifiedIdeographs.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "CJK Unified Ideographs"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // CJK Unified Ideographs + testUnicodeRange(0x7000, 0x7FFF); + negativeTestUnicodeRange(0x7000, 0x7FFF); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u8000_CJKUnifiedIdeographs.as b/mozilla/js/tamarin/test/ecma3/Unicode/u8000_CJKUnifiedIdeographs.as new file mode 100644 index 00000000000..e592324cd7a --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u8000_CJKUnifiedIdeographs.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "CJK Unified Ideographs"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // CJK Unified Ideographs + testUnicodeRange(0x8000, 0x8FFF); + negativeTestUnicodeRange(0x8000, 0x8FFF); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/u9000_CJKUnifiedIdeographs.as b/mozilla/js/tamarin/test/ecma3/Unicode/u9000_CJKUnifiedIdeographs.as new file mode 100644 index 00000000000..b4c2b44f1b5 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/u9000_CJKUnifiedIdeographs.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "CJK Unified Ideographs"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // CJK Unified Ideographs + testUnicodeRange(0x9000, 0x9FFF); + negativeTestUnicodeRange(0x9000, 0x9FFF); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/uA000_YiSyllables.as b/mozilla/js/tamarin/test/ecma3/Unicode/uA000_YiSyllables.as new file mode 100644 index 00000000000..2573c4eca64 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/uA000_YiSyllables.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Yi Syllables"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Yi Syllables + testUnicodeRange(0xA000, 0xA48F); + negativeTestUnicodeRange(0xA000, 0xA48F); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/uA490_YiRadicals.as b/mozilla/js/tamarin/test/ecma3/Unicode/uA490_YiRadicals.as new file mode 100644 index 00000000000..85b0645c0a4 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/uA490_YiRadicals.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Yi Radicals"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Yi Radicals + testUnicodeRange(0xA490, 0xA4CF); + negativeTestUnicodeRange(0xA490, 0xA4CF); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/uAC00_HangulSyllables.as b/mozilla/js/tamarin/test/ecma3/Unicode/uAC00_HangulSyllables.as new file mode 100644 index 00000000000..78fdc5a24c1 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/uAC00_HangulSyllables.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Hangul Syllables"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Hangul Syllables + testUnicodeRange(0xAC00, 0xD7AF); + negativeTestUnicodeRange(0xAC00, 0xD7AF); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/uD800_HighSurrogates.as b/mozilla/js/tamarin/test/ecma3/Unicode/uD800_HighSurrogates.as new file mode 100644 index 00000000000..4654996d899 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/uD800_HighSurrogates.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "High Surrogates"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // High Surrogates + testUnicodeRange(0xD800, 0xDB7F); + negativeTestUnicodeRange(0xD800, 0xDB7F); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/uDB80_HighPrivateUseSurrogates.as b/mozilla/js/tamarin/test/ecma3/Unicode/uDB80_HighPrivateUseSurrogates.as new file mode 100644 index 00000000000..1be729401bc --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/uDB80_HighPrivateUseSurrogates.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "High Private Use Surrogates"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // High Private Use Surrogates + testUnicodeRange(0xDB80, 0xDBFF); + negativeTestUnicodeRange(0xDB80, 0xDBFF); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/uDC00_LowSurrogates.as b/mozilla/js/tamarin/test/ecma3/Unicode/uDC00_LowSurrogates.as new file mode 100644 index 00000000000..eae06475e85 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/uDC00_LowSurrogates.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Low Surrogates"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Low Surrogates + testUnicodeRange(0xDC00, 0xDFFF); + negativeTestUnicodeRange(0xDC00, 0xDFFF); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/uE000_PrivateUseArea.as b/mozilla/js/tamarin/test/ecma3/Unicode/uE000_PrivateUseArea.as new file mode 100644 index 00000000000..75139dffd85 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/uE000_PrivateUseArea.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Private Use Area"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Private Use Area + testUnicodeRange(0xE000, 0xF8FF); + negativeTestUnicodeRange(0xE000, 0xF8FF); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/uF900_CJKCompatibilityIdeographs.as b/mozilla/js/tamarin/test/ecma3/Unicode/uF900_CJKCompatibilityIdeographs.as new file mode 100644 index 00000000000..984ec64d99c --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/uF900_CJKCompatibilityIdeographs.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "CJK Compatibility Ideographs"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // CJK Compatibility Ideographs + testUnicodeRange(0xF900, 0xFAFF); + negativeTestUnicodeRange(0xF900, 0xFAFF); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/uFB00_AlphabeticPresentationForms.as b/mozilla/js/tamarin/test/ecma3/Unicode/uFB00_AlphabeticPresentationForms.as new file mode 100644 index 00000000000..9d9dba621cf --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/uFB00_AlphabeticPresentationForms.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Alphabetic Presentation Forms"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Alphabetic Presentation Forms + testUnicodeRange(0xFB00, 0xFB4F); + negativeTestUnicodeRange(0xFB00, 0xFB4F); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/uFB50_ArabicPresentationForms_A.as b/mozilla/js/tamarin/test/ecma3/Unicode/uFB50_ArabicPresentationForms_A.as new file mode 100644 index 00000000000..514456b90f5 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/uFB50_ArabicPresentationForms_A.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Arabic Presentation Forms-A"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Arabic Presentation Forms-A + testUnicodeRange(0xFB50, 0xFDFF); + negativeTestUnicodeRange(0xFB50, 0xFDFF); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/uFE00_VariationSelectors.as b/mozilla/js/tamarin/test/ecma3/Unicode/uFE00_VariationSelectors.as new file mode 100644 index 00000000000..ba05cdcc3cc --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/uFE00_VariationSelectors.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Variation Selectors"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Variation Selectors + testUnicodeRange(0xFE00, 0xFE0F); + negativeTestUnicodeRange(0xFE00, 0xFE0F); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/uFE20_CombiningHalfMarks.as b/mozilla/js/tamarin/test/ecma3/Unicode/uFE20_CombiningHalfMarks.as new file mode 100644 index 00000000000..bbc20e0b9fd --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/uFE20_CombiningHalfMarks.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Combining Half Marks"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Combining Half Marks + testUnicodeRange(0xFE20, 0xFE2F); + negativeTestUnicodeRange(0xFE20, 0xFE2F); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/uFE30_CJKCompatibilityForms.as b/mozilla/js/tamarin/test/ecma3/Unicode/uFE30_CJKCompatibilityForms.as new file mode 100644 index 00000000000..a551001bed1 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/uFE30_CJKCompatibilityForms.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "CJK Compatibility Forms"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // CJK Compatibility Forms + testUnicodeRange(0xFE30, 0xFE4F); + negativeTestUnicodeRange(0xFE30, 0xFE4F); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/uFE50_SmallFormVariants.as b/mozilla/js/tamarin/test/ecma3/Unicode/uFE50_SmallFormVariants.as new file mode 100644 index 00000000000..00c66629068 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/uFE50_SmallFormVariants.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Small Form Variants"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Small Form Variants + testUnicodeRange(0xFE50, 0xFE6F); + negativeTestUnicodeRange(0xFE50, 0xFE6F); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/uFE70_ArabicPresentationForms_B.as b/mozilla/js/tamarin/test/ecma3/Unicode/uFE70_ArabicPresentationForms_B.as new file mode 100644 index 00000000000..68337fcb47a --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/uFE70_ArabicPresentationForms_B.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Arabic Presentation Forms-B"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Arabic Presentation Forms-B + testUnicodeRange(0xFE70, 0xFEFF); + negativeTestUnicodeRange(0xFE70, 0xFEFF); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/uFF00_HalfwidthandFullwidthForms.as b/mozilla/js/tamarin/test/ecma3/Unicode/uFF00_HalfwidthandFullwidthForms.as new file mode 100644 index 00000000000..9c42959a9cc --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/uFF00_HalfwidthandFullwidthForms.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Halfwidth and Fullwidth Forms"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Halfwidth and Fullwidth Forms + testUnicodeRange(0xFF00, 0xFFEF); + negativeTestUnicodeRange(0xFF00, 0xFFEF); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/uFFF0_Specials.as b/mozilla/js/tamarin/test/ecma3/Unicode/uFFF0_Specials.as new file mode 100644 index 00000000000..c4988f2b231 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/uFFF0_Specials.as @@ -0,0 +1,52 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +include "unicodeUtil.as"; +include "unicodeNegativeUtil.as"; + +var SECTION = "Specials"; +var VERSION = "ECMA_3"; +startTest(); +var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; + +writeHeaderToLog(SECTION + " "+ TITLE); + +var array = new Array(); +var item = 0; +getTestCases(); + +var testcases = array; +test(); + +function getTestCases():void { + // Specials + testUnicodeRange(0xFFF0, 0xFFFF); + negativeTestUnicodeRange(0xFFF0, 0xFFFF); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/uc_001.as b/mozilla/js/tamarin/test/ecma3/Unicode/uc_001.as new file mode 100644 index 00000000000..e6e5ab30bd1 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/uc_001.as @@ -0,0 +1,86 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Rob Ginda rginda@netscape.com + */ + + var SECTION = ""; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Unicode Characters 1C-1F negative test"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + + // Unicode Characters 1C-1F negative test + + array[item++] = new TestCase( SECTION, "Number(00)", false, + ("no error" == ('no' + "\u001C" +' error'))); + + array[item++] = new TestCase( SECTION, "Number(01)", false, + ("no error" == ('no' + "\u001D" +' error'))); + + array[item++] = new TestCase( SECTION, "Number(02)", false, + ("no error" == ('no' + "\u001E" +' error'))); + + array[item++] = new TestCase( SECTION, "Number(03)", false, + ("no error" == ('no' + "\u001F" +' error'))); + + + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/uc_003.as b/mozilla/js/tamarin/test/ecma3/Unicode/uc_003.as new file mode 100644 index 00000000000..9fa30dec460 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/uc_003.as @@ -0,0 +1,99 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Rob Ginda rginda@netscape.com + * + * + * Modified 2/7/2005 by Sushant Dutta (sdutta@macromedia.com) + * "eval" function had to be removed and so the actual values + * had to be modified. + */ + var SECTION = "uc_003"; + var VERSION = ""; + var TITLE = "Escapes in identifiers test."; + printBugNumber (23608); + printBugNumber (23607); + + startTest(); + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() +{ + var array = new Array(); + var item = 0; + + var \u0041 = 5; + var A\u03B2 = 15; + var c\u0061se = 25; + + +/* + array[item++] = new TestCase(SECTION, "Escaped ASCII Identifier test.", 5, ("\u0041")); + array[item++] = new TestCase(SECTION, "Escaped ASCII Identifier test", 6, ("++\u0041")); + array[item++] = new TestCase(SECTION, "Escaped non-ASCII Identifier test", 15, ("A\u03B2")); + array[item++] = new TestCase(SECTION, "Escaped non-ASCII Identifier test", 16, ("++A\u03B2")); + array[item++] = new TestCase(SECTION, "Escaped keyword Identifier test", 25, ("c\\u00" + "61se")); + array[item++] = new TestCase(SECTION, "Escaped keyword Identifier test", 26, ("++c\\u00" + "61se")); + */ + + array[item++] = new TestCase(SECTION, "Escaped ASCII Identifier test.", 5, (\u0041)); + array[item++] = new TestCase(SECTION, "Escaped ASCII Identifier test", 6, (++\u0041)); + array[item++] = new TestCase(SECTION, "Escaped non-ASCII Identifier test", 15, (A\u03B2)); + array[item++] = new TestCase(SECTION, "Escaped non-ASCII Identifier test", 16, (++A\u03B2)); + array[item++] = new TestCase(SECTION, "Escaped keyword Identifier test", 25, (c\u0061se)); + array[item++] = new TestCase(SECTION, "Escaped keyword Identifier test", 26, (++c\u0061se)); + + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/uc_004.as b/mozilla/js/tamarin/test/ecma3/Unicode/uc_004.as new file mode 100644 index 00000000000..823ebe873a8 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/uc_004.as @@ -0,0 +1,82 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Rob Ginda rginda@netscape.com + */ + var SECTION = "uc_004"; + var VERSION = ""; + var TITLE = "Unicode Characters 1C-1F with regexps test."; + printBugNumber (23612); + + startTest(); + + var bug = '(none)'; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() +{ + var array = new Array(); + var item = 0; + var ary = ["\u001Cfoo", "\u001Dfoo", "\u001Efoo", "\u001Ffoo"]; + + for (var i in ary) + { + array[item++] = new TestCase(SECTION, "Unicode characters 1C-1F in regexps, ary[" + + i + "] did not match \\S test (it should not.)", 0, ary[Number(i)].search(/^\Sfoo$/)); + array[item++] = new TestCase(SECTION, "Unicode characters 1C-1F in regexps, ary[" + + i + "] matched \\s test (it should not.)", -1, ary[Number(i)].search(/^\sfoo$/)); + } + return array; +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/uc_005.as b/mozilla/js/tamarin/test/ecma3/Unicode/uc_005.as new file mode 100644 index 00000000000..523592bfb3c --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/uc_005.as @@ -0,0 +1,340 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* ***** BEGIN LICENSE BLOCK ***** +* Version: NPL 1.1/GPL 2.0/LGPL 2.1 +* +* The contents of this file are subject to the Netscape Public License +* Version 1.1 (the "License"); you may not use this file except in +* compliance with the License. You may obtain a copy of the License at +* http://www.mozilla.org/NPL/ +* +* Software distributed under the License is distributed on an "AS IS" basis, +* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +* for the specific language governing rights and limitations under the +* License. +* +* The Original Code is JavaScript Engine testing utilities. +* +* The Initial Developer of the Original Code is Netscape Communications Corp. +* Portions created by the Initial Developer are Copyright (C) 2002 +* the Initial Developer. All Rights Reserved. +* +* Contributor(s): rogerl@netscape.com, pschwartau@netscape.com +* +* Alternatively, the contents of this file may be used under the terms of +* either the GNU General Public License Version 2 or later (the "GPL"), or +* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +* in which case the provisions of the GPL or the LGPL are applicable instead +* of those above. If you wish to allow use of your version of this file only +* under the terms of either the GPL or the LGPL, and not to allow others to +* use your version of this file under the terms of the NPL, indicate your +* decision by deleting the provisions above and replace them with the notice +* and other provisions required by the GPL or the LGPL. If you do not delete +* the provisions above, a recipient may use your version of this file under +* the terms of any one of the NPL, the GPL or the LGPL. +* +* ***** END LICENSE BLOCK ***** +* +* +* Date: 15 July 2002 +* SUMMARY: Testing identifiers with double-byte names +* See http://bugzilla.mozilla.org/show_bug.cgi?id=58274 +* +* Here is a sample of the problem: +* +* js> function f\u02B1 () {} +* +* js> f\u02B1.toSource(); +* function f¦() {} +* +* js> f\u02B1.toSource().toSource(); +* (new String("function f\xB1() {}")) +* +* +* See how the high-byte information (the 02) has been lost? +* The same thing was happening with the toString() method: +* +* js> f\u02B1.toString(); +* +* function f¦() { +* } +* +* js> f\u02B1.toString().toSource(); +* (new String("\nfunction f\xB1() {\n}\n")) +* +* +* +* Modified 2/14/2005 By Sushant Dutta (sdutta@macromedia.com) +* Passing the string sEval to the getIdentifiers function. Removed calls +* to the eval function. +* +*/ +//----------------------------------------------------------------------------- + + var SECTION = ""; + var VERSION = ""; + + startTest(); + + var TITLE = "Testing identifiers with double-byte names"; + var bug = 58274; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + + var array = new Array(); + var item = 0; + var UBound = 0; + + var summary = ''; + var status = ''; + var statusitems = []; + var actual = ''; + var actualvalues = []; + var expect= ''; + var expectedvalues = []; + + + /* + * Define a function that uses double-byte identifiers in + * "every possible way" + * + * Then recover each double-byte identifier via f.toString(). + * To make this easier, put a 'Z' token before every one. + * + * Our eval string will be: + * + * sEval = "function Z\u02b1(Z\u02b2, b) { + * try { Z\u02b3 : var Z\u02b4 = Z\u02b1; } + * catch (Z\u02b5) { for (var Z\u02b6 in Z\u02b5) + * {for (1; 1<0; Z\u02b7++) {new Array()[Z\u02b6] = 1;} };} }"; + * + * It will be helpful to build this string in stages: + */ + var s0 = 'function Z'; + var s1 = '\u02b1(Z'; + var s2 = '\u02b2, b) {try { Z'; + var s3 = '\u02b3 : var Z'; + var s4 = '\u02b4 = Z'; + var s5 = '\u02b1; } catch (Z' + var s6 = '\u02b5) { for (var Z'; + var s7 = '\u02b6 in Z'; + var s8 = '\u02b5){for (1; 1<0; Z'; + var s9 = '\u02b7++) {new Array()[Z'; + var s10 = '\u02b6] = 1;} };} }'; + + + /* + * Concatenate these and eval() to create the function Z\u02b1 + */ + var sEval = s0 + s1 + s2 + s3 + s4 + s5 + s6 + s7 + s8 + s9 + s10; + + + /* + * Recover all the double-byte identifiers via Z\u02b1.toString(). + * We'll recover the 1st one as arrID[1], the 2nd one as arrID[2], + * and so on ... + */ + var arrID = getIdentifiers(sEval); + + + /* + * Now check that we got back what we put in - + */ + + status = inSection(1); + actual = arrID[1]; + expect = s1.charAt(0); + //addThis(); + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = inSection(2); + actual = arrID[2]; + expect = s2.charAt(0); + //addThis(); + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = inSection(3); + actual = arrID[3]; + expect = s3.charAt(0); + //addThis(); + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = inSection(4); + actual = arrID[4]; + expect = s4.charAt(0); + //addThis(); + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = inSection(5); + actual = arrID[5]; + expect = s5.charAt(0); + //addThis(); + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = inSection(6); + actual = arrID[6]; + expect = s6.charAt(0); + //addThis(); + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = inSection(7); + actual = arrID[7]; + expect = s7.charAt(0); + //addThis(); + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = inSection(8); + actual = arrID[8]; + expect = s8.charAt(0); + //addThis(); + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = inSection(9); + actual = arrID[9]; + expect = s9.charAt(0); + //addThis(); + array[item++] = new TestCase(SECTION, status, expect, actual); + + status = inSection(10); + actual = arrID[10]; + expect = s10.charAt(0); + //addThis(); + array[item++] = new TestCase(SECTION, status, expect, actual); + + return array; +} + + +/* + * Goal: recover the double-byte identifiers from f.toString() + * by getting the very next character after each 'Z' token. + * + * The return value will be an array |arr| indexed such that + * |arr[1]| is the 1st identifier, |arr[2]| the 2nd, and so on. + * + * Note, however, f.toString() is implementation-independent. + * For example, it may begin with '\nfunction' instead of 'function'. + * + * Rhino uses a Unicode representation for f.toString(); whereas + * SpiderMonkey uses an ASCII representation, putting escape sequences + * for non-ASCII characters. For example, if a function is called f\u02B1, + * then in Rhino the toString() method will present a 2-character Unicode + * string for its name, whereas SpiderMonkey will present a 7-character + * ASCII string for its name: the string literal 'f\u02B1'. + * + * So we force the lexer to condense the string before we use it. + * This will give uniform results in Rhino and SpiderMonkey. + */ +function getIdentifiers(f) +{ + var str = condenseStr(f.toString()); + + //print("Before calling split()"); + //print(str); + + var arr = str.split('Z'); + + //print("After calling split()"); + //print(arr); + + /* + * The identifiers are the 1st char of each split substring + * EXCEPT the first one, which is just ('\n' +) 'function '. + * + * Thus note the 1st identifier will be stored in |arr[1]|, + * the 2nd one in |arr[2]|, etc., making the indexing easy - + */ + for (i in arr) { + arr[i] = arr[i].charAt(0); + } + return arr; +} + + +/* + * This function is the opposite of a functions like escape(), which take + * Unicode characters and return escape sequences for them. Here, we force + * the lexer to turn escape sequences back into single characters. + * + * Note we can't simply do |eval(str)|, since in practice |str| will be an + * identifier somewhere in the program (e.g. a function name); thus |eval(str)| + * would return the object that the identifier represents: not what we want. + * + * So we surround |str| lexicographically with quotes to force the lexer to + * evaluate it as a string. Have to strip out any linefeeds first, however - + */ +function condenseStr(str) +{ + /* + * You won't be able to do the next step if |str| has + * any carriage returns or linefeeds in it. For example: + * + * js> eval("'" + '\nHello' + "'"); + * 1: SyntaxError: unterminated string literal: + * 1: ' + * 1: ^ + * + * So replace them with the empty string - + */ + str = str.replace(/[\r\n]/g, '') + return ("'" + str + "'") +} + +/* +function addThis() +{ + statusitems[UBound] = status; + actualvalues[UBound] = actual; + expectedvalues[UBound] = expect; + UBound++; +} +*/ + +/* +function test() +{ + enterFunc('test'); + printBugNumber(bug); + printStatus(summary); + + for (var i=0; i= 0; i-- ) { + if ( n >= Math.pow(16, i) ){ + var t = Math.floor( n / Math.pow(16, i)); + n -= t * Math.pow(16, i); + if ( t >= 10 ) { + if ( t == 10 ) { h += "A"; } + if ( t == 11 ) { h += "B"; } + if ( t == 12 ) { h += "C"; } + if ( t == 13 ) { h += "D"; } + if ( t == 14 ) { h += "E"; } + if ( t == 15 ) { h += "F"; } + } else { + h += String( t ); + } + } else { + h += "0"; + } + } + return h; +} diff --git a/mozilla/js/tamarin/test/ecma3/Unicode/unicodeUtil.as b/mozilla/js/tamarin/test/ecma3/Unicode/unicodeUtil.as new file mode 100644 index 00000000000..9880e18efff --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/Unicode/unicodeUtil.as @@ -0,0 +1,315 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* +Description: +Concatenate the unicode characters in the given range and test against it. +For each char in the given range: + - search for the char in the test string + - search for a string of 3 chars in the test string + - match the char in the test string + - split the test string around the char + - insert a B, S, CS, WS char into the test string and split around the inserted char + - replace the char with an empty string + - replace the char with the first and last chars in the given unicode range + +Modifications: +10/04/06 - cpeyer - change to single testcase for each range, to decrease # of +testcases. + +*/ + +function testUnicodeRange(hexFrom, hexTo) +{ + // split the range into smaller more mangeable set + var range = 250; + for (var i = hexFrom; i <= hexTo; i= i+range+1 ) { + var subHexFrom = i; + var subHexTo = (i+range <= hexTo) ? i+range:hexTo; + testUnicodeRangeHelper(subHexFrom, subHexTo); + } +} + +function testUnicodeRangeHelper(hexFrom, hexTo) { + var offset:int = hexFrom; + var testStr = ""; + for (var i = hexFrom; i <= hexTo; i++ ) { + testStr += String.fromCharCode(i); + } + + // The following vars hold the results of the unicode tests in the for loop + var stringSearchResult:String = ''; + var string3SearchResult:String = ''; + var stringMatchResult:String = ''; + var stringSplitResult:String = ''; + + + for (var i = hexFrom; i <= hexTo; i++ ) { + var charStr = String.fromCharCode(i); + var charStrPattern = stringPatternFromCharCode(i); + + // 1. String.search() + var searchExpect = i - offset; + var searchResult:int = testStr.search(charStrPattern); + if (searchExpect != searchResult) stringSearchResult += decimalToHexString(searchExpect) + ' '; + + // search a string of 3 chars + var searchPattern = ""; + for (var j = i; j <= hexTo && j < i + 3; j++) { + searchPattern += stringPatternFromCharCode(j); + } + searchResult = testStr.search(searchPattern); + if (searchExpect != searchResult) string3SearchResult += decimalToHexString(searchExpect) + ' '; + + // 2. String.match() + var matchResult:Array = testStr.match(charStrPattern); + if (matchResult == null) { + stringMatchResult += "Failed to find match: " + charStrPattern + " "; + } else if (charStr != matchResult[0]) { + stringMatchResult += "Failed to match chars: "+charStr + " with " + matchResult[0] + ' '; + } + + // 3. String.split() + var re = new RegExp("(" + charStrPattern + ")"); + var splitResult:Array = testStr.split(re); + if (splitResult == null) { + stringSplitResult += "Failed to split string on: " + charStr + ' '; + } else { + // test string before searched char + if (testStr.substring(0,searchResult) != splitResult[0]) + stringSplitResult += "split failed before: " + charStr + ' '; + // test searched char + if (charStr != splitResult[1]) + stringSplitResult += "split failed on: " + charStr + ' '; + // test string after searched char + if (testStr.substring(searchResult + 1, testStr.length) != splitResult[2]) + stringSplitResult += "split failed after: " + charStr + ' '; + } + + } // for loop + + // Output test results + this.array[this.item++] = new TestCase(SECTION, + "Unicode String.search from " + decimalToHexString(hexFrom) + " to " + decimalToHexString(hexFrom), + '', stringSearchResult); + this.array[this.item++] = new TestCase(SECTION, + "Unicode String.search for 3 chars from " + decimalToHexString(hexFrom) + " to " + decimalToHexString(hexFrom), + '', string3SearchResult); + this.array[this.item++] = new TestCase(SECTION, + "Unicode String.match", '', stringMatchResult); + this.array[this.item++] = new TestCase(SECTION, + "Unicode String.split", '', stringSplitResult); + + testReplace(hexFrom, hexTo); + + testSplitOnMark(testStr, B, "B"); + testSplitOnMark(testStr, S, "S"); + testSplitOnMark(testStr, CS, "CS"); + testSplitOnMark(testStr, WS, "WS"); +} + +function testReplace(hexFrom, hexTo) +{ + var offset:int = hexFrom; + var testStr = ""; + for (var i = hexFrom; i <= hexTo; i++ ) { + testStr += String.fromCharCode(i); + } + + var stringReplaceResult:String = ''; + + for (var i = hexFrom; i <= hexTo; i++ ) { + var charStr = String.fromCharCode(i); + var charStrPattern = stringPatternFromCharCode(i); + + // 4. String.replace() + var index = i - offset; + + var replaceResult:String = testStr.replace(charStr, ""); + var replaceExpect = testStr.substring(0, index); + replaceExpect += testStr.substring(index + 1, testStr.length); + if (replaceExpect != replaceResult) + stringReplaceResult += "Replace failed on: " + charStr + " "; + + // replace with first and last char in given Unicode range + var firstLastChars = stringPatternFromCharCode(hexFrom) + stringPatternFromCharCode(hexTo); + var replaceResult2:String = testStr.replace(charStr, firstLastChars); + var replaceExpect2 = testStr.substring(0, index); + replaceExpect2 += firstLastChars; + replaceExpect2 += testStr.substring(index + 1, testStr.length); + if (replaceExpect2 != replaceResult2) + stringReplaceResult += "Replace failed swapping: " + firstLastChars + " "; + } + + this.array[this.item++] = new TestCase(SECTION, + "Unicode String.replace", '', stringReplaceResult); + +} + +function testSplitOnMark(testStr:String, markArray:Array, markArrayName:String) { + var testSplitResult:String = ''; //holds results of splitting + + for (var i = 0; i < markArray.length; i++) { + var mark = markArray[i]; + var markStr = String.fromCharCode(mark); + var markStrPattern = stringPatternFromCharCode(mark); + + // insert the mark character into the middle of testStr + var insertIndex = Math.floor(testStr.length / 2); + var markedStr = testStr.substring(0, insertIndex); + markedStr += markStr; + markedStr += testStr.substring(insertIndex, testStr.length); + + // split around the mark + + var markRE = new RegExp("(" + markStrPattern + ")"); + var splitMarkedResult:Array = markedStr.split(markRE); + var splitMessage = "Split on " + markArrayName + " mark " + decimalToHexString(mark); + if (splitMarkedResult == null) { + testSplitResult += 'array is null, expected not null!'; + } else { + var markIndex = markedStr.indexOf(markStr, 0); + + // test segment before mark + if (markedStr.substring(0, markIndex) != splitMarkedResult[0]) + testSplitResult += "Split failed before: " + decimalToHexString(mark); + + // test the mark we split on + if (markedStr.substring(markIndex, markIndex + 1) != splitMarkedResult[1]) + testSplitResult += "Split failed on: " + decimalToHexString(mark); + + // test segment after mark + var segmentEnd = markedStr.indexOf(markStr, markIndex + 1); + if (segmentEnd == -1) { + segmentEnd = markedStr.length; + } + if (markedStr.substring(markIndex + 1, segmentEnd) != splitMarkedResult[2]) + testSplitResult += "Split failed after: " + decimalToHexString(mark); + } // else + } // for + + this.array[this.item++] = new TestCase(SECTION, + "Unicode Split on Mark", '', stringReplaceResult); + +} + +function regexpReserved(charCode) { + return (charCode == 36) // $ + || (charCode == 40) // ( + || (charCode == 41) // ) + || (charCode == 42) // * + || (charCode == 43) // + + || (charCode == 46) // . + || (charCode == 63) // ? + || (charCode == 91) // [ + || (charCode == 92) // \ + || (charCode == 94) // ^ + || (charCode == 124); // | +} + +var B = new Array(0x000A, // line feed + 0x000D, // carriage return + 0x001C, + 0x001D, + 0x001E, + 0x0085, + 0x2029); + +var S = new Array(0x0009, + 0x000B, + 0x001F); + +var CS = new Array(0x002C, + 0x002E, + 0x002F, + 0x003A, + 0x00A0, + 0x060C, + 0x2044, + 0xFE50, + 0xFE52, + 0xFE55, + 0xFF0C, + 0xFF0E, + 0xFF1A); + +var WS = new Array(0x000C, + 0x0020, + 0x1680, + 0x180E, + 0x2000, + 0x2001, + 0x2002, + 0x2003, + 0x2004, + 0x2005, + 0x2006, + 0x2007, + 0x2008, + 0x2009, + 0x200A, + 0x2028, + 0x202F, + 0x205F, + 0x3000); + +function stringPatternFromCharCode(charCode) { + var result = ""; + if (regexpReserved(charCode)) { + result += "\\"; + } + result += String.fromCharCode(charCode); + return result; +} + +function decimalToHexString( n ) { + n = Number( n ); + var h = "0x"; + + for ( var i = 3; i >= 0; i-- ) { + if ( n >= Math.pow(16, i) ){ + var t = Math.floor( n / Math.pow(16, i)); + n -= t * Math.pow(16, i); + if ( t >= 10 ) { + if ( t == 10 ) { h += "A"; } + if ( t == 11 ) { h += "B"; } + if ( t == 12 ) { h += "C"; } + if ( t == 13 ) { h += "D"; } + if ( t == 14 ) { h += "E"; } + if ( t == 15 ) { h += "F"; } + } else { + h += String( t ); + } + } else { + h += "0"; + } + } + return h; +} diff --git a/mozilla/js/tamarin/test/ecma3/instanceof/instanceof_001.as b/mozilla/js/tamarin/test/ecma3/instanceof/instanceof_001.as new file mode 100644 index 00000000000..7a35b3e5035 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/instanceof/instanceof_001.as @@ -0,0 +1,58 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + + var SECTION = "instaceof_001"; + var VERSION = "ECMA_2"; + startTest(); + var TITLE = "instanceof operator"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var b = new Boolean(); + + array[item++] = new TestCase( SECTION, + "var b = new Boolean(); b instanceof Boolean", + true, + b instanceof Boolean ); + + array[item++] = new TestCase( SECTION, + "b instanceof Object", + true, + b instanceof Object ); + return ( array ); +} diff --git a/mozilla/js/tamarin/test/ecma3/instanceof/instanceof_002.as b/mozilla/js/tamarin/test/ecma3/instanceof/instanceof_002.as new file mode 100644 index 00000000000..6b5462fea6b --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/instanceof/instanceof_002.as @@ -0,0 +1,73 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "instaceof_002"; + var VERSION = "ECMA_2"; + startTest(); + + var TITLE = "The Call Constructor"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + var b = new Boolean(); + + array[item++] = new TestCase( SECTION, + "var b = new Boolean(); b instanceof Boolean", + true, + b instanceof Boolean ); + + array[item++] = new TestCase( SECTION, + "b instanceof Object", + true, + b instanceof Object ); + + array[item++] = new TestCase( SECTION, + "b instanceof Array", + false, + b instanceof Array ); + + array[item++] = new TestCase( SECTION, + "true instanceof Boolean", + true, + true instanceof Boolean ); + + array[item++] = new TestCase( SECTION, + "Boolean instanceof Object", + true, + Boolean instanceof Object ); + return (array); +} diff --git a/mozilla/js/tamarin/test/ecma3/instanceof/instanceof_003_rt.as b/mozilla/js/tamarin/test/ecma3/instanceof/instanceof_003_rt.as new file mode 100644 index 00000000000..fde720b9b27 --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/instanceof/instanceof_003_rt.as @@ -0,0 +1,74 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ + var SECTION = "instanceof-003"; + var VERSION = "ECMA_2"; + startTest(); + + var TITLE = "instanceof operator"; + var BUGNUMBER ="http://bugzilla.mozilla.org/show_bug.cgi?id=7635"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function Foo() {}; +function getTestCases() { + var array = new Array(); + var item = 0; + + var theproto = {}; + Foo.prototype = theproto; + + array[item++] = new TestCase(SECTION, + "function Foo() = {}; theproto = {}; Foo.prototype = theproto; " + + "theproto instanceof Foo", + false, + theproto instanceof Foo ); + + + var o = {}; + + /* AddTestCase( + "o = {}; o instanceof o", + false, + o instanceof o );*/ + var thisError="no error"; + try{ + o instanceof o; + }catch(e:Error){ + thisError = e.toString(); + }finally{ + array[item++] = new TestCase( SECTION, "o = {}; o instanceof o","TypeError: Error #1040",typeError(thisError)); + } + + return (array); +} diff --git a/mozilla/js/tamarin/test/ecma3/instanceof/regress_7635_rt.as b/mozilla/js/tamarin/test/ecma3/instanceof/regress_7635_rt.as new file mode 100644 index 00000000000..6a229ccb32a --- /dev/null +++ b/mozilla/js/tamarin/test/ecma3/instanceof/regress_7635_rt.as @@ -0,0 +1,118 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* +* The contents of this file are subject to the Netscape Public +* License Version 1.1 (the "License"); you may not use this file +* except in compliance with the License. You may obtain a copy of +* the License at http://www.mozilla.org/NPL/ +* +* Software distributed under the License is distributed on an "AS +* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or +* implied. See the License for the specific language governing +* rights and limitations under the License. +* +* The Original Code is mozilla.org code. +* +* The Initial Developer of the Original Code is Netscape +* Communications Corporation. Portions created by Netscape are +* Copyright (C) 1998 Netscape Communications Corporation. All +* Rights Reserved. +* +* Contributor(s): +*/ + + + var SECTION = "instanceof"; // provide a document reference (ie, ECMA section) + var VERSION = "ECMA_2"; // Version of JavaScript or ECMA + startTest(); // leave this alone + + var TITLE = "Regression test for Bugzilla #7635"; // Provide ECMA section title or a description + var BUGNUMBER = "http://bugzilla.mozilla.org/show_bug.cgi?id=7635"; // Provide URL to bugsplat or bugzilla report + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + + test(); // leave this alone. this executes the test cases and + // displays results. + + /* + * Calls to AddTestCase here. AddTestCase is a function that is defined + * in shell.js and takes three arguments: + * - a string representation of what is being tested + * - the expected result + * - the actual result + * + * For example, a test might look like this: + * + * var zip = /[\d]{5}$/; + * + * AddTestCase( + * "zip = /[\d]{5}$/; \"PO Box 12345 Boston, MA 02134\".match(zip)", // description of the test + * "02134", // expected result + * "PO Box 12345 Boston, MA 02134".match(zip) ); // actual result + * + */ + + +function getTestCases() { +function Foo() {} + var array = new Array(); + var item = 0; + + var theproto = {}; + Foo.prototype = theproto + //theproto instanceof Foo + + array[item++] = new TestCase( SECTION, + "function Foo() {}; theproto = {}; Foo.prototype = theproto; theproto instanceof Foo", + false, + theproto instanceof Foo ); + + var o = {}; + + //AddTestCase( "var o = {}; o instanceof o", false, o instanceof o ); + var thisError="no error"; + try{ + o instanceof o; + }catch(e:Error){ + thisError = e.toString(); + }finally{ + array[item++] = new TestCase( SECTION, + "o = {}; o instanceof o","TypeError: Error #1040",typeError(thisError)); + } + + var f = new Function(); + + array[item++] = new TestCase( SECTION, "var f = new Function(); f instanceof f", false, f instanceof f ); + + return (array); +} diff --git a/mozilla/js/tamarin/test/shell.as b/mozilla/js/tamarin/test/shell.as new file mode 100644 index 00000000000..e18e4408c6b --- /dev/null +++ b/mozilla/js/tamarin/test/shell.as @@ -0,0 +1,850 @@ +/* ***** BEGIN LICENSE BLOCK ***** + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version 1.1 (the +"License"); you may not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT +WARRANTY OF ANY KIND, either express or implied. See the License for the specific +language governing rights and limitations under the License. + +The Original Code is [Open Source Virtual Machine.] + +The Initial Developer of the Original Code is Adobe System Incorporated. Portions created +by the Initial Developer are Copyright (C)[ 2005-2006 ] Adobe Systems Incorporated. All Rights +Reserved. + +Contributor(s): Adobe AS3 Team + +Alternatively, the contents of this file may be used under the terms of either the GNU +General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public +License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the +LGPL are applicable instead of those above. If you wish to allow use of your version of this +file only under the terms of either the GPL or the LGPL, and not to allow others to use your +version of this file under the terms of the MPL, indicate your decision by deleting provisions +above and replace them with the notice and other provisions required by the GPL or the +LGPL. If you do not delete the provisions above, a recipient may use your version of this file +under the terms of any one of the MPL, the GPL or the LGPL. + + ***** END LICENSE BLOCK ***** */ +/* + * JavaScript shared functions file for running the tests in either + * stand-alone JavaScript engine. To run a test, first load this file, + * then load the test script. + */ + +import flash.system.*; +import flash.display.*; +import flash.util.*; + +var completed = false; +var testcases; // ISSUE:: need to know why we need to comment this out +var tc = 0; +//var version; // ISSUE:: need to know why we need to comment this out + +SECTION = ""; +VERSION = ""; +var BUGNUMBER = ""; + +// constant strings + +var GLOBAL = "[object global]"; +var PASSED = " PASSED!" +var FAILED = " FAILED! expected: "; +var PACKAGELIST = "{public,$1$private,flash.system,flash.display,flash.util}::"; +var TYPEERROR = "TypeError: Error #"; +var REFERENCEERROR = "ReferenceError: Error #"; +var RANGEERROR = "RangeError: Error #"; +var URIERROR = "URIError: Error #"; +var EVALERROR = "EvalError: Error #"; +var VERIFYERROR = "VerifyError: Error #"; + +var DEBUG = false; + +function typeError( str ){ + return str.slice(0,TYPEERROR.length+4); +} + +function referenceError( str ){ + return str.slice(0,REFERENCEERROR.length+4); +} +function rangeError( str ){ + return str.slice(0,RANGEERROR.length+4); +} +function uriError( str ){ + return str.slice(0,URIERROR.length+4); +} + +function evalError( str ){ + return str.slice(0,EVALERROR.length+4); +} + +function verifyError( str ){ + return str.slice(0,VERIFYERROR.length+4); +} + +// wrapper for test cas constructor that doesn't require the SECTION +// argument. + + +function AddTestCase( description, expect, actual ) { + testcases[tc++] = new TestCase( SECTION, description, expect, actual ); +} + + +// TestCase constructor + + +function TestCase( n, d, e, a ) { + this.name = n; + this.description = d; + this.expect = e; + this.actual = a; + this.passed = true; + this.reason = ""; + //this.bugnumber = BUGNUMBER; + + this.passed = getTestCaseResult( this.expect, this.actual ); + if ( DEBUG ) { + writeLineToLog( "added " + this.description ); + } +} + + +// Set up test environment. + + +function startTest() { + + // print out bugnumber + /*if ( BUGNUMBER ) { + writeLineToLog ("BUGNUMBER: " + BUGNUMBER ); + }*/ + + testcases = new Array(); + tc = 0; +} + + +function test(... rest:Array) { + + if( rest.length == 0 ){ + // no args sent, use default test + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +" = "+ testcases[tc].actual ); + testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value "; + } + } else { + // we need to use a specialized call to writeTestCaseResult + if( rest[0] == "no actual" ){ + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description ); + testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value "; + } + } + } + stopTest(); + return ( testcases ); +} + + +// Compare expected result to the actual result and figure out whether +// the test case passed. + +function getTestCaseResult( expect, actual ) { + // because ( NaN == NaN ) always returns false, need to do + // a special compare to see if we got the right result. + if ( actual != actual ) { + if ( typeof actual == "object" ) { + actual = "NaN object"; + } else { + actual = "NaN number"; + } + } + if ( expect != expect ) { + if ( typeof expect == "object" ) { + expect = "NaN object"; + } else { + expect = "NaN number"; + } + } + + var passed = ( expect == actual ) ? true : false; + + // if both objects are numbers + // need to replace w/ IEEE standard for rounding + if ( !passed + && typeof(actual) == "number" + && typeof(expect) == "number" + ) { + if ( Math.abs(actual-expect) < 0.0000001 ) { + passed = true; + } + } + + // verify type is the same + if ( typeof(expect) != typeof(actual) ) { + passed = false; + } + + return passed; +} + +// Begin printing functions. These functions use the shell's +// print function. When running tests in the browser, these +// functions, override these functions with functions that use +// document.write. + +function writeTestCaseResult( expect, actual, string ) { + var passed = getTestCaseResult( expect, actual ); + writeFormattedResult( expect, actual, string, passed ); + return passed; +} +function writeFormattedResult( expect, actual, string, passed ) { + var s = string ; + s += ( passed ) ? PASSED : FAILED + expect; + writeLineToLog( s); + return passed; +} +function writeLineToLog( string ) { + trace( string ); +} +function writeHeaderToLog( string ) { + trace( string ); +} +// end of print functions + + + +// When running in the shell, run the garbage collector after the +// test has completed. + + +function stopTest() { +} + + +// Date functions used by tests in Date suite + +// Originally, the test suite used a hard-coded value TZ_DIFF = -8. +// But that was only valid for testers in the Pacific Standard Time Zone! +// We calculate the proper number dynamically for any tester. We just +// have to be careful not to use a date subject to Daylight Savings Time... + +function getTimeZoneDiff() +{ + // re-hard coding to -8 because Date object is not implemented yet + // mtilburg 3/15/2004 + //return -8; + return -((new Date(2000, 1, 1)).getTimezoneOffset())/60; +} + +var msPerDay = 86400000; +var HoursPerDay = 24; +var MinutesPerHour = 60; +var SecondsPerMinute = 60; +var msPerSecond = 1000; +var msPerMinute = 60000; // msPerSecond * SecondsPerMinute +var msPerHour = 3600000; // msPerMinute * MinutesPerHour +var TZ_DIFF = getTimeZoneDiff(); // offset of tester's timezone from UTC +var TZ_PST = -8; // offset of Pacific Standard Time from UTC +var PST_DIFF = TZ_DIFF - TZ_PST; // offset of tester's timezone from PST +var TIME_1970 = 0; +var TIME_2000 = 946684800000; +var TIME_1900 = -2208988800000; +var now = new Date(); +var TZ_DIFF = getTimeZoneDiff(); +var TZ_ADJUST = TZ_DIFF * msPerHour; +var UTC_29_FEB_2000 = TIME_2000 + 31*msPerDay + 28*msPerDay; +var UTC_1_JAN_2005 = TIME_2000 + TimeInYear(2000) + TimeInYear(2001) + + TimeInYear(2002) + TimeInYear(2003) + TimeInYear(2004); +var TIME_NOW = now.valueOf(); + + + + + +// Date test "ResultArrays" are hard-coded for Pacific Standard Time. +// We must adjust them for the tester's own timezone - + +function adjustResultArray(ResultArray, msMode) +{ + // If the tester's system clock is in PST, no need to continue - + if (!PST_DIFF) {return;} + + // The date testcases instantiate Date objects in two different ways: + // + // millisecond mode: e.g. dt = new Date(10000000); + // year-month-day mode: dt = new Date(2000, 5, 1, ...); + // + // In the first case, the date is measured from Time 0 in Greenwich (i.e. UTC). + // In the second case, it is measured with reference to the tester's local timezone. + // + // In the first case we must correct those values expected for local measurements, + // like dt.getHours() etc. No correction is necessary for dt.getUTCHours() etc. + // + // In the second case, it is exactly the other way around - + + var t; + if (msMode) + { + // The hard-coded UTC milliseconds from Time 0 derives from a UTC date. + // Shift to the right by the offset between UTC and the tester. + t = ResultArray[TIME] + TZ_DIFF*msPerHour; + + // Use our date arithmetic functions to determine the local hour, day, etc. + ResultArray[HOURS] = HourFromTime(t); + ResultArray[DAY] = WeekDay(t); + ResultArray[DATE] = DateFromTime(t); + ResultArray[MONTH] = MonthFromTime(t); + ResultArray[YEAR] = YearFromTime(t); + } + else + { + // The hard-coded UTC milliseconds from Time 0 derives from a PST date. + // Shift to the left by the offset between PST and the tester. + t = ResultArray[TIME] - PST_DIFF*msPerHour; + + // Use our date arithmetic functions to determine the UTC hour, day, etc. + ResultArray[TIME] = t; + ResultArray[UTC_HOURS] = HourFromTime(t); + ResultArray[UTC_DAY] = WeekDay(t); + ResultArray[UTC_DATE] = DateFromTime(t); + ResultArray[UTC_MONTH] = MonthFromTime(t); + ResultArray[UTC_YEAR] = YearFromTime(t); + } +} + + +function Day( t ) { + return ( Math.floor(t/msPerDay ) ); +} +function DaysInYear( y ) { + if ( y % 4 != 0 ) { + return 365; + } + if ( (y % 4 == 0) && (y % 100 != 0) ) { + return 366; + } + if ( (y % 100 == 0) && (y % 400 != 0) ) { + return 365; + } + if ( (y % 400 == 0) ){ + return 366; + } else { + trace("ERROR: DaysInYear(" + y + ") case not covered"); + return Math.NaN; //"ERROR: DaysInYear(" + y + ") case not covered"; + } +} +function TimeInYear( y ) { + return ( DaysInYear(y) * msPerDay ); +} +function DayNumber( t ) { + return ( Math.floor( t / msPerDay ) ); +} +function TimeWithinDay( t ) { + if ( t < 0 ) { + return ( (t % msPerDay) + msPerDay ); + } else { + return ( t % msPerDay ); + } +} +function YearNumber( t ) { +} +function TimeFromYear( y ) { + return ( msPerDay * DayFromYear(y) ); +} +function DayFromYear( y ) { + return ( 365*(y-1970) + + Math.floor((y-1969)/4) - + Math.floor((y-1901)/100) + + Math.floor((y-1601)/400) ); +} +function InLeapYear( t ) { + if ( DaysInYear(YearFromTime(t)) == 365 ) { + return 0; + } + if ( DaysInYear(YearFromTime(t)) == 366 ) { + return 1; + } else { + return "ERROR: InLeapYear("+ t + ") case not covered"; + } +} +function YearFromTime( t ) { + t = Number( t ); + var sign = ( t < 0 ) ? -1 : 1; + var year = ( sign < 0 ) ? 1969 : 1970; + + for ( var timeToTimeZero = t; ; ) { + // subtract the current year's time from the time that's left. + timeToTimeZero -= sign * TimeInYear(year) + if (isNaN(timeToTimeZero)) + return NaN; + + // if there's less than the current year's worth of time left, then break. + if ( sign < 0 ) { + if ( sign * timeToTimeZero <= 0 ) { + break; + } else { + year += sign; + } + } else { + if ( sign * timeToTimeZero < 0 ) { + break; + } else { + year += sign; + } + } + } + return ( year ); +} +function MonthFromTime( t ) { + // i know i could use switch but i'd rather not until it's part of ECMA + var day = DayWithinYear( t ); + var leap = InLeapYear(t); + + if ( (0 <= day) && (day < 31) ) { + return 0; + } + if ( (31 <= day) && (day < (59+leap)) ) { + return 1; + } + if ( ((59+leap) <= day) && (day < (90+leap)) ) { + return 2; + } + if ( ((90+leap) <= day) && (day < (120+leap)) ) { + return 3; + } + if ( ((120+leap) <= day) && (day < (151+leap)) ) { + return 4; + } + if ( ((151+leap) <= day) && (day < (181+leap)) ) { + return 5; + } + if ( ((181+leap) <= day) && (day < (212+leap)) ) { + return 6; + } + if ( ((212+leap) <= day) && (day < (243+leap)) ) { + return 7; + } + if ( ((243+leap) <= day) && (day < (273+leap)) ) { + return 8; + } + if ( ((273+leap) <= day) && (day < (304+leap)) ) { + return 9; + } + if ( ((304+leap) <= day) && (day < (334+leap)) ) { + return 10; + } + if ( ((334+leap) <= day) && (day < (365+leap)) ) { + return 11; + } else { + return "ERROR: MonthFromTime("+t+") not known"; + } +} +function DayWithinYear( t ) { + return( Day(t) - DayFromYear(YearFromTime(t))); +} +function DateFromTime( t ) { + var day = DayWithinYear(t); + var month = MonthFromTime(t); + + if ( month == 0 ) { + return ( day + 1 ); + } + if ( month == 1 ) { + return ( day - 30 ); + } + if ( month == 2 ) { + return ( day - 58 - InLeapYear(t) ); + } + if ( month == 3 ) { + return ( day - 89 - InLeapYear(t)); + } + if ( month == 4 ) { + return ( day - 119 - InLeapYear(t)); + } + if ( month == 5 ) { + return ( day - 150- InLeapYear(t)); + } + if ( month == 6 ) { + return ( day - 180- InLeapYear(t)); + } + if ( month == 7 ) { + return ( day - 211- InLeapYear(t)); + } + if ( month == 8 ) { + return ( day - 242- InLeapYear(t)); + } + if ( month == 9 ) { + return ( day - 272- InLeapYear(t)); + } + if ( month == 10 ) { + return ( day - 303- InLeapYear(t)); + } + if ( month == 11 ) { + return ( day - 333- InLeapYear(t)); + } + + return ("ERROR: DateFromTime("+t+") not known" ); +} +function WeekDay( t ) { + var weekday = (Day(t)+4) % 7; + return( weekday < 0 ? 7 + weekday : weekday ); +} + +// missing daylight savins time adjustment + +function HourFromTime( t ) { + var h = Math.floor( t / msPerHour ) % HoursPerDay; + return ( (h<0) ? HoursPerDay + h : h ); +} +function MinFromTime( t ) { + var min = Math.floor( t / msPerMinute ) % MinutesPerHour; + return( ( min < 0 ) ? MinutesPerHour + min : min ); +} +function SecFromTime( t ) { + var sec = Math.floor( t / msPerSecond ) % SecondsPerMinute; + return ( (sec < 0 ) ? SecondsPerMinute + sec : sec ); +} +function msFromTime( t ) { + var ms = t % msPerSecond; + return ( (ms < 0 ) ? msPerSecond + ms : ms ); +} +function LocalTZA() { + return ( TZ_DIFF * msPerHour ); +} +function UTC( t ) { + return ( t - LocalTZA() - DaylightSavingTA(t - LocalTZA()) ); +} + +function DaylightSavingTA( t ) { + t = t - LocalTZA(); + + var dst_start = GetFirstSundayInApril(t) + 2*msPerHour; + var dst_end = GetLastSundayInOctober(t)+ 2*msPerHour; + + if ( t >= dst_start && t < dst_end ) { + return msPerHour; + } else { + return 0; + } + + // Daylight Savings Time starts on the first Sunday in April at 2:00AM in + // PST. Other time zones will need to override this function. + trace( new Date( UTC(dst_start + LocalTZA())) ); + + return UTC(dst_start + LocalTZA()); +} +function GetFirstSundayInApril( t ) { + var year = YearFromTime(t); + var leap = InLeapYear(t); + + var april = TimeFromYear(year) + TimeInMonth(0, leap) + TimeInMonth(1,leap) + + TimeInMonth(2,leap); + + for ( var first_sunday = april; WeekDay(first_sunday) > 0; + first_sunday += msPerDay ) + { + ; + } + + return first_sunday; +} +function GetLastSundayInOctober( t ) { + var year = YearFromTime(t); + var leap = InLeapYear(t); + + for ( var oct = TimeFromYear(year), m = 0; m < 9; m++ ) { + oct += TimeInMonth(m, leap); + } + for ( var last_sunday = oct + 30*msPerDay; WeekDay(last_sunday) > 0; + last_sunday -= msPerDay ) + { + ; + } + return last_sunday; +} +function LocalTime( t ) { + return ( t + LocalTZA() + DaylightSavingTA(t) ); +} +function MakeTime( hour, min, sec, ms ) { + if ( isNaN( hour ) || isNaN( min ) || isNaN( sec ) || isNaN( ms ) ) { + return Number.NaN; + } + + hour = ToInteger(hour); + min = ToInteger( min); + sec = ToInteger( sec); + ms = ToInteger( ms ); + + return( (hour*msPerHour) + (min*msPerMinute) + + (sec*msPerSecond) + ms ); +} +function MakeDay( year, month, date ) { + if ( isNaN(year) || isNaN(month) || isNaN(date) ) { + return Number.NaN; + } + year = ToInteger(year); + month = ToInteger(month); + date = ToInteger(date ); + + var sign = ( year < 1970 ) ? -1 : 1; + var t = ( year < 1970 ) ? 1 : 0; + var y = ( year < 1970 ) ? 1969 : 1970; + + var result5 = year + Math.floor( month/12 ); + var result6 = month % 12; + + if ( year < 1970 ) { + for ( y = 1969; y >= year; y += sign ) { + t += sign * TimeInYear(y); + } + } else { + for ( y = 1970 ; y < year; y += sign ) { + t += sign * TimeInYear(y); + } + } + + var leap = InLeapYear( t ); + + for ( var m = 0; m < month; m++ ) { + t += TimeInMonth( m, leap ); + } + + if ( YearFromTime(t) != result5 ) { + return Number.NaN; + } + if ( MonthFromTime(t) != result6 ) { + return Number.NaN; + } + if ( DateFromTime(t) != 1 ) { + return Number.NaN; + } + + return ( (Day(t)) + date - 1 ); +} +function TimeInMonth( month, leap ) { + // september april june november + // jan 0 feb 1 mar 2 apr 3 may 4 june 5 jul 6 + // aug 7 sep 8 oct 9 nov 10 dec 11 + + if ( month == 3 || month == 5 || month == 8 || month == 10 ) { + return ( 30*msPerDay ); + } + + // all the rest + if ( month == 0 || month == 2 || month == 4 || month == 6 || + month == 7 || month == 9 || month == 11 ) { + return ( 31*msPerDay ); + } + + // save february + return ( (leap == 0) ? 28*msPerDay : 29*msPerDay ); +} +function MakeDate( day, time ) { + if ( day == Number.POSITIVE_INFINITY || + day == Number.NEGATIVE_INFINITY || + day == Number.NaN ) { + return Number.NaN; + } + if ( time == Number.POSITIVE_INFINITY || + time == Number.POSITIVE_INFINITY || + day == Number.NaN) { + return Number.NaN; + } + return ( day * msPerDay ) + time; +} +function TimeClip( t ) { + if ( isNaN( t ) ) { + return ( Number.NaN ); + } + if ( Math.abs( t ) > 8.64e15 ) { + return ( Number.NaN ); + } + + return ( ToInteger( t ) ); +} +function ToInteger( t ) { + t = Number( t ); + + if ( isNaN( t ) ){ + return ( Number.NaN ); + } + if ( t == 0 || t == -0 || + t == Number.POSITIVE_INFINITY || t == Number.NEGATIVE_INFINITY ) { + return 0; + } + + var sign = ( t < 0 ) ? -1 : 1; + + return ( sign * Math.floor( Math.abs( t ) ) ); +} +function Enumerate ( o ) { + var p; + for ( p in o ) { + trace( p +": " + o[p] ); + } +} + + + +function START(summary) +{ + // print out bugnumber + + /*if ( BUGNUMBER ) { + writeLineToLog ("BUGNUMBER: " + BUGNUMBER ); + }*/ + XML.setSettings (null); + testcases = new Array(); + + // text field for results + tc = 0; + /*this.addChild ( tf ); + tf.x = 30; + tf.y = 50; + tf.width = 200; + tf.height = 400;*/ + + trace(summary); + var summaryParts = summary.split(" "); + trace("section: " + summaryParts[0] + "!"); + //fileName = summaryParts[0]; + +} + +function BUG(bug) +{ + printBugNumber(bug); +} + +function TEST(section, expected, actual) +{ + /*if( actual == "this will never match"){ + // hack for strict mode + var fileName; + }*/ + + + // Testcase Description + this[fileName+"Str"].push(section); + + // Testcase Actual Values Returned + this[fileName].push(actual); + + // Testcase Expected Values Returned + this[fileName+"Ans"].push(expected); + + var expected_t = typeof expected; + var actual_t = typeof actual; + var output = ""; + + // Testcase Description + this[fileName+"Str"].push(section + "type test"); + + // Testcase Actual Values Returned + this[fileName].push(actual_t); + + // Testcase Expected Values Returned + this[fileName+"Ans"].push(expected_t); + + if (expected_t != actual_t) + output += "Type mismatch, expected type " + expected_t + + ", actual type " + actual_t + "\n"; + else if (VERBOSE) + printStatus ("Expected type '" + actual_t + "' matched actual " + + "type '" + expected_t + "'"); + + if (expected != actual) { + output += "Expected value:\n" + toPrinted(expected) + "\nActual value:\n" + toPrinted(actual) + "\n"; + } + else if (VERBOSE) + printStatus ("Expected value '" + toPrinted(actual) + "' matched actual value"); + + if (output != "") + { + reportFailure (output); + } +} + +function TEST_XML(section, expected, actual) +{ + var actual_t = typeof actual; + var expected_t = typeof expected; + + if (actual_t != "xml") { + // force error on type mismatch + TEST(section, new XML(), actual); + return; + } + + if (expected_t == "string") { + + TEST(section, expected, actual.toXMLString()); + } else if (expected_t == "number") { + + TEST(section, String(expected), actual.toXMLString()); + } else { + reportFailure ("Bad TEST_XML usage: type of expected is "+expected_t+", should be number or string"); + } +} + +function SHOULD_THROW(section) +{ + reportFailure(section, "Expected to generate exception, actual behavior: no exception was thrown"); +} + +function END() +{ + test(); +} + +function NL() +{ + //return java.lang.System.getProperty("line.separator"); + return "\n"; +} + +function printBugNumber (num) +{ + //writeLineToLog (BUGNUMBER + num); +} + +function toPrinted(value) +{ + if (typeof value == "xml") { + return value.toXMLString(); + } else { + return String(value); + } +} + +function grabError(err, str) { + var typeIndex = str.indexOf("Error:"); + var type = str.substr(0, typeIndex + 5); + if (type == "TypeError") { + AddTestCase("Asserting for TypeError", true, (err is TypeError)); + } else if (type == "ArgumentError") { + AddTestCase("Asserting for ArgumentError", true, (err is ArgumentError)); + } + var numIndex = str.indexOf("Error #"); + var num; + if (numIndex >= 0) { + num = str.substr(numIndex, 11); + } else { + num = str; + } + return num; +} + + + + diff --git a/mozilla/js/tamarin/utils/abcdump.as b/mozilla/js/tamarin/utils/abcdump.as new file mode 100644 index 00000000000..dc0245b0db1 --- /dev/null +++ b/mozilla/js/tamarin/utils/abcdump.as @@ -0,0 +1,1660 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + + + +package abcdump +{ + import flash.utils.ByteArray + import avmplus.System + + const TAB = " " + + // method flags + const NEED_ARGUMENTS:int = 0x01 + const NEED_ACTIVATION:int = 0x02 + const NEED_REST:int = 0x04 + const HAS_OPTIONAL:int = 0x08 + const IGNORE_REST:int = 0x10 + const NATIVE:int = 0x20 + const HAS_ParamNames:int = 0x80 + + const CONSTANT_Utf8 :int = 0x01 + const CONSTANT_Int :int = 0x03 + const CONSTANT_UInt :int = 0x04 + const CONSTANT_PrivateNs :int = 0x05 // non-shared namespace + const CONSTANT_Double :int = 0x06 + const CONSTANT_Qname :int = 0x07 // o.ns::name, ct ns, ct name + const CONSTANT_Namespace :int = 0x08 + const CONSTANT_Multiname :int = 0x09 // o.name, ct nsset, ct name + const CONSTANT_False :int = 0x0A + const CONSTANT_True :int = 0x0B + const CONSTANT_Null :int = 0x0C + const CONSTANT_QnameA :int = 0x0D // o.@ns::name, ct ns, ct attr-name + const CONSTANT_MultinameA :int = 0x0E // o.@name, ct attr-name + const CONSTANT_RTQname :int = 0x0F // o.ns::name, rt ns, ct name + const CONSTANT_RTQnameA :int = 0x10 // o.@ns::name, rt ns, ct attr-name + const CONSTANT_RTQnameL :int = 0x11 // o.ns::[name], rt ns, rt name + const CONSTANT_RTQnameLA :int = 0x12 // o.@ns::[name], rt ns, rt attr-name + const CONSTANT_NameL :int = 0x13 // o.[], ns=public implied, rt name + const CONSTANT_NameLA :int = 0x14 // o.@[], ns=public implied, rt attr-name + const CONSTANT_NamespaceSet :int = 0x15 + const CONSTANT_PackageNs :int = 0x16 + const CONSTANT_PackageInternalNs :int = 0x17 + const CONSTANT_ProtectedNs :int = 0x18 + const CONSTANT_StaticProtectedNs :int = 0x19 + const CONSTANT_StaticProtectedNs2 :int = 0x1a + const CONSTANT_MultinameL :int = 0x1B + const CONSTANT_MultinameLA :int = 0x1C + + const constantKinds:Array = [ "0", "utf8", "2", + "int", "uint", "private", "double", "qname", "namespace", + "multiname", "false", "true", "null", "@qname", "@multiname", "rtqname", + "@rtqname", "[qname]", "@[qname]", "[name]", "@[name]", "nsset" + ] + + const TRAIT_Slot :int = 0x00 + const TRAIT_Method :int = 0x01 + const TRAIT_Getter :int = 0x02 + const TRAIT_Setter :int = 0x03 + const TRAIT_Class :int = 0x04 + const TRAIT_Function :int = 0x05 + const TRAIT_Const :int = 0x06 + + const traitKinds:Array = [ + "var", "function", "function get", "function set", "class", "function", "const" + ] + + const OP_bkpt:int = 0x01 + const OP_nop:int = 0x02 + const OP_throw:int = 0x03 + const OP_getsuper:int = 0x04 + const OP_setsuper:int = 0x05 + const OP_dxns:int = 0x06 + const OP_dxnslate:int = 0x07 + const OP_kill:int = 0x08 + const OP_label:int = 0x09 + const OP_ifnlt:int = 0x0C + const OP_ifnle:int = 0x0D + const OP_ifngt:int = 0x0E + const OP_ifnge:int = 0x0F + const OP_jump:int = 0x10 + const OP_iftrue:int = 0x11 + const OP_iffalse:int = 0x12 + const OP_ifeq:int = 0x13 + const OP_ifne:int = 0x14 + const OP_iflt:int = 0x15 + const OP_ifle:int = 0x16 + const OP_ifgt:int = 0x17 + const OP_ifge:int = 0x18 + const OP_ifstricteq:int = 0x19 + const OP_ifstrictne:int = 0x1A + const OP_lookupswitch:int = 0x1B + const OP_pushwith:int = 0x1C + const OP_popscope:int = 0x1D + const OP_nextname:int = 0x1E + const OP_hasnext:int = 0x1F + const OP_pushnull:int = 0x20 + const OP_pushundefined:int = 0x21 + const OP_pushconstant:int = 0x22 + const OP_nextvalue:int = 0x23 + const OP_pushbyte:int = 0x24 + const OP_pushshort:int = 0x25 + const OP_pushtrue:int = 0x26 + const OP_pushfalse:int = 0x27 + const OP_pushnan:int = 0x28 + const OP_pop:int = 0x29 + const OP_dup:int = 0x2A + const OP_swap:int = 0x2B + const OP_pushstring:int = 0x2C + const OP_pushint:int = 0x2D + const OP_pushuint:int = 0x2E + const OP_pushdouble:int = 0x2F + const OP_pushscope:int = 0x30 + const OP_pushnamespace:int = 0x31 + const OP_hasnext2:int = 0x32 + const OP_newfunction:int = 0x40 + const OP_call:int = 0x41 + const OP_construct:int = 0x42 + const OP_callmethod:int = 0x43 + const OP_callstatic:int = 0x44 + const OP_callsuper:int = 0x45 + const OP_callproperty:int = 0x46 + const OP_returnvoid:int = 0x47 + const OP_returnvalue:int = 0x48 + const OP_constructsuper:int = 0x49 + const OP_constructprop:int = 0x4A + const OP_callsuperid:int = 0x4B + const OP_callproplex:int = 0x4C + const OP_callinterface:int = 0x4D + const OP_callsupervoid:int = 0x4E + const OP_callpropvoid:int = 0x4F + const OP_newobject:int = 0x55 + const OP_newarray:int = 0x56 + const OP_newactivation:int = 0x57 + const OP_newclass:int = 0x58 + const OP_getdescendants:int = 0x59 + const OP_newcatch:int = 0x5A + const OP_findpropstrict:int = 0x5D + const OP_findproperty:int = 0x5E + const OP_finddef:int = 0x5F + const OP_getlex:int = 0x60 + const OP_setproperty:int = 0x61 + const OP_getlocal:int = 0x62 + const OP_setlocal:int = 0x63 + const OP_getglobalscope:int = 0x64 + const OP_getscopeobject:int = 0x65 + const OP_getproperty:int = 0x66 + const OP_getpropertylate:int = 0x67 + const OP_initproperty:int = 0x68 + const OP_setpropertylate:int = 0x69 + const OP_deleteproperty:int = 0x6A + const OP_deletepropertylate:int = 0x6B + const OP_getslot:int = 0x6C + const OP_setslot:int = 0x6D + const OP_getglobalslot:int = 0x6E + const OP_setglobalslot:int = 0x6F + const OP_convert_s:int = 0x70 + const OP_esc_xelem:int = 0x71 + const OP_esc_xattr:int = 0x72 + const OP_convert_i:int = 0x73 + const OP_convert_u:int = 0x74 + const OP_convert_d:int = 0x75 + const OP_convert_b:int = 0x76 + const OP_convert_o:int = 0x77 + const OP_coerce:int = 0x80 + const OP_coerce_b:int = 0x81 + const OP_coerce_a:int = 0x82 + const OP_coerce_i:int = 0x83 + const OP_coerce_d:int = 0x84 + const OP_coerce_s:int = 0x85 + const OP_astype:int = 0x86 + const OP_astypelate:int = 0x87 + const OP_coerce_u:int = 0x88 + const OP_coerce_o:int = 0x89 + const OP_negate:int = 0x90 + const OP_increment:int = 0x91 + const OP_inclocal:int = 0x92 + const OP_decrement:int = 0x93 + const OP_declocal:int = 0x94 + const OP_typeof:int = 0x95 + const OP_not:int = 0x96 + const OP_bitnot:int = 0x97 + const OP_concat:int = 0x9A + const OP_add_d:int = 0x9B + const OP_add:int = 0xA0 + const OP_subtract:int = 0xA1 + const OP_multiply:int = 0xA2 + const OP_divide:int = 0xA3 + const OP_modulo:int = 0xA4 + const OP_lshift:int = 0xA5 + const OP_rshift:int = 0xA6 + const OP_urshift:int = 0xA7 + const OP_bitand:int = 0xA8 + const OP_bitor:int = 0xA9 + const OP_bitxor:int = 0xAA + const OP_equals:int = 0xAB + const OP_strictequals:int = 0xAC + const OP_lessthan:int = 0xAD + const OP_lessequals:int = 0xAE + const OP_greaterthan:int = 0xAF + const OP_greaterequals:int = 0xB0 + const OP_instanceof:int = 0xB1 + const OP_istype:int = 0xB2 + const OP_istypelate:int = 0xB3 + const OP_in:int = 0xB4 + const OP_increment_i:int = 0xC0 + const OP_decrement_i:int = 0xC1 + const OP_inclocal_i:int = 0xC2 + const OP_declocal_i:int = 0xC3 + const OP_negate_i:int = 0xC4 + const OP_add_i:int = 0xC5 + const OP_subtract_i:int = 0xC6 + const OP_multiply_i:int = 0xC7 + const OP_getlocal0:int = 0xD0 + const OP_getlocal1:int = 0xD1 + const OP_getlocal2:int = 0xD2 + const OP_getlocal3:int = 0xD3 + const OP_setlocal0:int = 0xD4 + const OP_setlocal1:int = 0xD5 + const OP_setlocal2:int = 0xD6 + const OP_setlocal3:int = 0xD7 + const OP_debug:int = 0xEF + const OP_debugline:int = 0xF0 + const OP_debugfile:int = 0xF1 + const OP_bkptline:int = 0xF2 + + const opNames = [ + "OP_0x00 ", + "bkpt ", + "nop ", + "throw ", + "getsuper ", + "setsuper ", + "dxns ", + "dxnslate ", + "kill ", + "label ", + "OP_0x0A ", + "OP_0x0B ", + "ifnlt ", + "ifnle ", + "ifngt ", + "ifnge ", + "jump ", + "iftrue ", + "iffalse ", + "ifeq ", + "ifne ", + "iflt ", + "ifle ", + "ifgt ", + "ifge ", + "ifstricteq ", + "ifstrictne ", + "lookupswitch ", + "pushwith ", + "popscope ", + "nextname ", + "hasnext ", + "pushnull ", + "pushundefined ", + "pushconstant ", + "nextvalue ", + "pushbyte ", + "pushshort ", + "pushtrue ", + "pushfalse ", + "pushnan ", + "pop ", + "dup ", + "swap ", + "pushstring ", + "pushint ", + "pushuint ", + "pushdouble ", + "pushscope ", + "pushnamespace ", + "hasnext2 ", + "OP_0x33 ", + "OP_0x34 ", + "OP_0x35 ", + "OP_0x36 ", + "OP_0x37 ", + "OP_0x38 ", + "OP_0x39 ", + "OP_0x3A ", + "OP_0x3B ", + "OP_0x3C ", + "OP_0x3D ", + "OP_0x3E ", + "OP_0x3F ", + "newfunction ", + "call ", + "construct ", + "callmethod ", + "callstatic ", + "callsuper ", + "callproperty ", + "returnvoid ", + "returnvalue ", + "constructsuper", + "constructprop ", + "callsuperid ", + "callproplex ", + "callinterface ", + "callsupervoid ", + "callpropvoid ", + "OP_0x50 ", + "OP_0x51 ", + "OP_0x52 ", + "OP_0x53 ", + "OP_0x54 ", + "newobject ", + "newarray ", + "newactivation ", + "newclass ", + "getdescendants", + "newcatch ", + "OP_0x5B ", + "OP_0x5C ", + "findpropstrict", + "findproperty ", + "finddef ", + "getlex ", + "setproperty ", + "getlocal ", + "setlocal ", + "getglobalscope", + "getscopeobject", + "getproperty ", + "OP_0x67 ", + "initproperty ", + "OP_0x69 ", + "deleteproperty", + "OP_0x6A ", + "getslot ", + "setslot ", + "getglobalslot ", + "setglobalslot ", + "convert_s ", + "esc_xelem ", + "esc_xattr ", + "convert_i ", + "convert_u ", + "convert_d ", + "convert_b ", + "convert_o ", + "checkfilter ", + "OP_0x79 ", + "OP_0x7A ", + "OP_0x7B ", + "OP_0x7C ", + "OP_0x7D ", + "OP_0x7E ", + "OP_0x7F ", + "coerce ", + "coerce_b ", + "coerce_a ", + "coerce_i ", + "coerce_d ", + "coerce_s ", + "astype ", + "astypelate ", + "coerce_u ", + "coerce_o ", + "OP_0x8A ", + "OP_0x8B ", + "OP_0x8C ", + "OP_0x8D ", + "OP_0x8E ", + "OP_0x8F ", + "negate ", + "increment ", + "inclocal ", + "decrement ", + "declocal ", + "typeof ", + "not ", + "bitnot ", + "OP_0x98 ", + "OP_0x99 ", + "concat ", + "add_d ", + "OP_0x9C ", + "OP_0x9D ", + "OP_0x9E ", + "OP_0x9F ", + "add ", + "subtract ", + "multiply ", + "divide ", + "modulo ", + "lshift ", + "rshift ", + "urshift ", + "bitand ", + "bitor ", + "bitxor ", + "equals ", + "strictequals ", + "lessthan ", + "lessequals ", + "greaterthan ", + "greaterequals ", + "instanceof ", + "istype ", + "istypelate ", + "in ", + "OP_0xB5 ", + "OP_0xB6 ", + "OP_0xB7 ", + "OP_0xB8 ", + "OP_0xB9 ", + "OP_0xBA ", + "OP_0xBB ", + "OP_0xBC ", + "OP_0xBD ", + "OP_0xBE ", + "OP_0xBF ", + "increment_i ", + "decrement_i ", + "inclocal_i ", + "declocal_i ", + "negate_i ", + "add_i ", + "subtract_i ", + "multiply_i ", + "OP_0xC8 ", + "OP_0xC9 ", + "OP_0xCA ", + "OP_0xCB ", + "OP_0xCC ", + "OP_0xCD ", + "OP_0xCE ", + "OP_0xCF ", + "getlocal0 ", + "getlocal1 ", + "getlocal2 ", + "getlocal3 ", + "setlocal0 ", + "setlocal1 ", + "setlocal2 ", + "setlocal3 ", + "OP_0xD8 ", + "OP_0xD9 ", + "OP_0xDA ", + "OP_0xDB ", + "OP_0xDC ", + "OP_0xDD ", + "OP_0xDE ", + "OP_0xDF ", + "OP_0xE0 ", + "OP_0xE1 ", + "OP_0xE2 ", + "OP_0xE3 ", + "OP_0xE4 ", + "OP_0xE5 ", + "OP_0xE6 ", + "OP_0xE7 ", + "OP_0xE8 ", + "OP_0xE9 ", + "OP_0xEA ", + "OP_0xEB ", + "OP_0xEC ", + "OP_0xED ", + "OP_0xEE ", + "debug ", + "debugline ", + "debugfile ", + "bkptline ", + "timestamp ", + "OP_0xF4 ", + "verifypass ", + "alloc ", + "mark ", + "wb ", + "prologue ", + "sendenter ", + "doubletoatom ", + "sweep ", + "codegenop ", + "verifyop ", + "decode " + ]; + + var totalSize:int + var opSizes:Array = new Array(256) + + class Multiname + { + var nsset:Array + var name:String + function Multiname(nsset:Array, name:String) + { + this.nsset = nsset + this.name = name + } + + public function toString() + { + return /*'{' + nsset + '}::' + */name + } + } + + dynamic class MetaData + { + var name:String + public function toString():String + { + var last:String + var s:String = last = '['+name+'(' + var n + for (n in this) + s = (last = s + n + "=" + '"' + this[n] + '"') + ',' + return last + ')]' + } + } + + class MemberInfo + { + var id:int + var kind:int + var name + var metadata:Array + } + + dynamic class LabelInfo + { + var count:int + function labelFor (target:int):String + { + if (target in this) + return this[target] + return this[target] = "L" + (++count) + } + } + + class MethodInfo extends MemberInfo + { + var flags:int + var debugName + var paramTypes + var optionalValues + var returnType + var local_count:int + var max_scope:int + var max_stack:int + var code_length:uint + var code:ByteArray + var activation:Traits + var anon:Boolean + + public function toString():String + { + return format() + } + + public function format():String + { + var s:String = "" + if (flags & NATIVE) + s = "native " + + return s + traitKinds[kind] + " " + name + "(" + paramTypes + "):" + returnType + "\t/* disp_id " + id + "*/" + } + + function dump(abc:Abc, indent:String, attr:String="") + { + print("") + + if (metadata) { + for each (var md in metadata) + print(indent+md) + } + + print(indent+attr+format()) + if (code) + { + print(indent+"{") + var oldindent = indent + indent += TAB + if (flags & NEED_ACTIVATION) { + print(indent+"activation {") + activation.dump(abc, indent+TAB, "") + print(indent+"}") + } + print(indent+"// local_count="+local_count+ + " max_scope=" + max_scope + + " max_stack=" + max_stack + + " code_len=" + code.length) + code.position = 0 + var labels:LabelInfo = new LabelInfo() + while (code.bytesAvailable > 0) + { + var start:int = code.position + var s = indent + start + while (s.length < 12) s += ' '; + var opcode = code.readUnsignedByte() + + if (opcode == OP_label || ((code.position-1) in labels)) { + print(indent) + print(indent + labels.labelFor(code.position-1) + ": ") + } + + s += opNames[opcode] + s += opNames[opcode].length < 8 ? "\t\t" : "\t" + + switch(opcode) + { + case OP_debugfile: + case OP_pushstring: + s += '"' + abc.strings[readU32()].replace(/\n/g,"\\n").replace(/\t/g,"\\t") + '"' + break + case OP_pushnamespace: + s += abc.namespaces[readU32()] + break + case OP_pushint: + var i:int = abc.ints[readU32()] + s += i + "\t// 0x" + i.toString(16) + break + case OP_pushuint: + var u:uint = abc.uints[readU32()] + s += u + "\t// 0x" + u.toString(16) + break; + case OP_pushdouble: + s += abc.doubles[readU32()] + break; + case OP_getsuper: + case OP_setsuper: + case OP_getproperty: + case OP_initproperty: + case OP_setproperty: + case OP_getlex: + case OP_findpropstrict: + case OP_findproperty: + case OP_finddef: + case OP_deleteproperty: + case OP_istype: + case OP_coerce: + case OP_astype: + case OP_getdescendants: + s += abc.names[readU32()] + break; + case OP_constructprop: + case OP_callproperty: + case OP_callproplex: + case OP_callsuper: + case OP_callsupervoid: + case OP_callpropvoid: + s += abc.names[readU32()] + s += " (" + readU32() + ")" + break; + case OP_newfunction: { + var method_id = readU32() + s += abc.methods[method_id] + abc.methods[method_id].anon = true + break; + } + case OP_callstatic: + s += abc.methods[readU32()] + s += " (" + readU32() + ")" + break; + case OP_newclass: + s += abc.instances[readU32()] + break; + case OP_lookupswitch: + var pos = code.position-1; + var target = pos + readS24() + var maxindex = readU32() + s += "default:" + labels.labelFor(target) // target + "("+(target-pos)+")" + s += " maxcase:" + maxindex + for (var i:int=0; i <= maxindex; i++) { + target = pos + readS24(); + s += " " + labels.labelFor(target) // target + "("+(target-pos)+")" + } + break; + case OP_jump: + case OP_iftrue: case OP_iffalse: + case OP_ifeq: case OP_ifne: + case OP_ifge: case OP_ifnge: + case OP_ifgt: case OP_ifngt: + case OP_ifle: case OP_ifnle: + case OP_iflt: case OP_ifnlt: + case OP_ifstricteq: case OP_ifstrictne: + var offset = readS24() + var target = code.position+offset + //s += target + " ("+offset+")" + s += labels.labelFor(target) + if (!((code.position) in labels)) + s += "\n" + break; + case OP_inclocal: + case OP_declocal: + case OP_inclocal_i: + case OP_declocal_i: + case OP_getlocal: + case OP_kill: + case OP_setlocal: + case OP_debugline: + case OP_getglobalslot: + case OP_getslot: + case OP_setglobalslot: + case OP_setslot: + case OP_pushshort: + case OP_newcatch: + s += readU32() + break + case OP_debug: + s += code.readUnsignedByte() + s += " " + readU32() + s += " " + code.readUnsignedByte() + s += " " + readU32() + break; + case OP_newobject: + s += "{" + readU32() + "}" + break; + case OP_newarray: + s += "[" + readU32() + "]" + break; + case OP_call: + case OP_construct: + case OP_constructsuper: + s += "(" + readU32() + ")" + break; + case OP_pushbyte: + case OP_getscopeobject: + s += code.readByte() + break; + case OP_hasnext2: + s += readU32() + " " + readU32() + default: + /*if (opNames[opcode] == ("0x"+opcode.toString(16).toUpperCase())) + s += " UNKNOWN OPCODE"*/ + break + } + var size:int = code.position - start + totalSize += size + opSizes[opcode] = int(opSizes[opcode]) + size + print(s) + } + print(oldindent+"}\n") + } + } + + function readU32():int + { + var result:int = code.readUnsignedByte(); + if (!(result & 0x00000080)) + return result; + result = result & 0x0000007f | code.readUnsignedByte()<<7; + if (!(result & 0x00004000)) + return result; + result = result & 0x00003fff | code.readUnsignedByte()<<14; + if (!(result & 0x00200000)) + return result; + result = result & 0x001fffff | code.readUnsignedByte()<<21; + if (!(result & 0x10000000)) + return result; + return result & 0x0fffffff | code.readUnsignedByte()<<28; + } + + function readS24():int + { + var b:int = code.readUnsignedByte() + b |= code.readUnsignedByte()<<8 + b |= code.readByte()<<16 + return b + } + } + + class SlotInfo extends MemberInfo + { + var type + var value + public function format():String + { + return traitKinds[kind] + " " + name + ":" + type + + (value !== undefined ? (" = " + (value is String ? ('"'+value+'"') : value)) : "") + + "\t/* slot_id " + id + " */" + } + function dump(abc:Abc, indent:String, attr:String="") + { + + if (kind == TRAIT_Const || kind == TRAIT_Slot) + { + if (metadata) { + for each (var md in metadata) + print(indent+md) + } + print(indent+attr+format()) + return + } + + // else, class + + var ct:Traits = value + var it:Traits = ct.itraits + print('') + if (metadata) { + for each (var md in metadata) + print(indent+md) + } + var def:String; + if (it.flags & CLASS_FLAG_interface) + def = "interface" + else { + def = "class"; + if (!(it.flags & CLASS_FLAG_sealed)) + def = "dynamic " + def; + if (it.flags & CLASS_FLAG_final) + def = "final " + def; + + } + print(indent+attr+def+" "+name+" extends "+it.base) + var oldindent = indent + indent += TAB + if (it.interfaces.length > 0) + print(indent+"implements "+it.interfaces) + print(oldindent+"{") + it.init.dump(abc,indent) + it.dump(abc,indent) + ct.dump(abc,indent,"static ") + ct.init.dump(abc,indent,"static ") + print(oldindent+"}\n") + } + } + + class Traits + { + var name + var init:MethodInfo + var itraits:Traits + var base + var flags:int + var protectedNs:Namespace + const interfaces:Array = [] + const names:Object = {} + const slots:Array = [] + const methods:Array = [] + const members:Array = [] + + public function toString():String + { + return String(name) + } + + public function dump(abc:Abc, indent:String, attr:String="") + { + for each (var m in members) + m.dump(abc,indent,attr) + } + } + + const ATTR_final :int = 0x01; // 1=final, 0=virtual + const ATTR_override :int = 0x02; // 1=override, 0=new + const ATTR_metadata :int = 0x04; // 1=has metadata, 0=no metadata + const ATTR_public :int = 0x08; // 1=add public namespace + + const CLASS_FLAG_sealed :int = 0x01; + const CLASS_FLAG_final :int = 0x02; + const CLASS_FLAG_interface :int = 0x04; + + class Abc + { + private var data:ByteArray + + var major:int + var minor:int + + var ints:Array + var uints:Array + var doubles:Array + var strings:Array + var namespaces:Array + var nssets:Array + var names:Array + + var defaults:Array = new Array(constantKinds.length) + + var methods:Array + var instances:Array + var classes:Array + var scripts:Array + + var publicNs = new Namespace("") + var anyNs = new Namespace("*") + + var magic:int + + function Abc(data:ByteArray) + { + data.position = 0 + this.data = data + magic = data.readInt() + + print("magic " + magic.toString(16)) + + if (magic != (46<<16|14) && magic != (46<<16|15) && magic != (46<<16|16)) + throw new Error("not an abc file. magic=" + magic.toString(16)) + + parseCpool() + + defaults[CONSTANT_Utf8] = strings + defaults[CONSTANT_Int] = ints + defaults[CONSTANT_UInt] = uints + defaults[CONSTANT_Double] = doubles + defaults[CONSTANT_Int] = ints + defaults[CONSTANT_False] = { 10:false } + defaults[CONSTANT_True] = { 11:true } + defaults[CONSTANT_Namespace] = namespaces + defaults[CONSTANT_PrivateNs] = namespaces + defaults[CONSTANT_PackageNs] = namespaces + defaults[CONSTANT_PackageInternalNs] = namespaces + defaults[CONSTANT_ProtectedNs] = namespaces + defaults[CONSTANT_StaticProtectedNs] = namespaces + defaults[CONSTANT_StaticProtectedNs2] = namespaces + defaults[CONSTANT_Null] = { 12: null } + + parseMethodInfos() + parseMetadataInfos() + parseInstanceInfos() + parseClassInfos() + parseScriptInfos() + parseMethodBodies() + } + + function readU32():int + { + var result:int = data.readUnsignedByte(); + if (!(result & 0x00000080)) + return result; + result = result & 0x0000007f | data.readUnsignedByte()<<7; + if (!(result & 0x00004000)) + return result; + result = result & 0x00003fff | data.readUnsignedByte()<<14; + if (!(result & 0x00200000)) + return result; + result = result & 0x001fffff | data.readUnsignedByte()<<21; + if (!(result & 0x10000000)) + return result; + return result & 0x0fffffff | data.readUnsignedByte()<<28; + } + + function parseCpool() + { + var i:int, j:int + var n:int + var kind:int + + var start:int = data.position + + // ints + n = readU32() + ints = [0] + for (i=1; i < n; i++) + ints[i] = readU32() + + // uints + n = readU32() + uints = [0] + for (i=1; i < n; i++) + uints[i] = uint(readU32()) + + // doubles + n = readU32() + doubles = [NaN] + for (i=1; i < n; i++) + doubles[i] = data.readDouble() + + print("Cpool numbers size "+(data.position-start)+" "+int(100*(data.position-start)/data.length)+" %") + start = data.position + + // strings + n = readU32() + strings = [""] + for (i=1; i < n; i++) + strings[i] = data.readUTFBytes(readU32()) + + print("Cpool strings count "+ n +" size "+(data.position-start)+" "+int(100*(data.position-start)/data.length)+" %") + start = data.position + + // namespaces + n = readU32() + namespaces = [publicNs] + for (i=1; i < n; i++) + switch (data.readByte()) + { + case CONSTANT_Namespace: + case CONSTANT_PackageNs: + case CONSTANT_PackageInternalNs: + case CONSTANT_ProtectedNs: + case CONSTANT_StaticProtectedNs: + case CONSTANT_StaticProtectedNs2: + { + namespaces[i] = new Namespace(strings[readU32()]) + // todo mark kind of namespace. + break; + } + case CONSTANT_PrivateNs: + readU32(); + namespaces[i] = new Namespace(null, "private") + break; + } + + print("Cpool namespaces count "+ n +" size "+(data.position-start)+" "+int(100*(data.position-start)/data.length)+" %") + start = data.position + + // namespace sets + n = readU32() + nssets = [null] + for (i=1; i < n; i++) + { + var count:int = readU32() + var nsset = nssets[i] = [] + for (j=0; j < count; j++) + nsset[j] = namespaces[readU32()] + } + + print("Cpool nssets count "+ n +" size "+(data.position-start)+" "+int(100*(data.position-start)/data.length)+" %") + start = data.position + + // multinames + n = readU32() + names = [null] + namespaces[0] = anyNs + strings[0] = "*" // any name + for (i=1; i < n; i++) + switch (data.readByte()) + { + case CONSTANT_Qname: + case CONSTANT_QnameA: + names[i] = new QName(namespaces[readU32()], strings[readU32()]) + break; + + case CONSTANT_RTQname: + case CONSTANT_RTQnameA: + names[i] = new QName(strings[readU32()]) + break; + + case CONSTANT_RTQnameL: + case CONSTANT_RTQnameLA: + names[i] = null + break; + + case CONSTANT_NameL: + case CONSTANT_NameLA: + names[i] = new QName(new Namespace(""), null) + break; + + case CONSTANT_Multiname: + case CONSTANT_MultinameA: + var name = strings[readU32()] + names[i] = new Multiname(nssets[readU32()], name) + break; + + case CONSTANT_MultinameL: + case CONSTANT_MultinameLA: + names[i] = new Multiname(nssets[readU32()], null) + break; + + default: + throw new Error("invalid kind " + data[data.position-1]) + } + + print("Cpool names count "+ n +" size "+(data.position-start)+" "+int(100*(data.position-start)/data.length)+" %") + start = data.position + + namespaces[0] = publicNs + strings[0] = "*" + } + + function parseMethodInfos() + { + var start:int = data.position + names[0] = new QName(publicNs,"*") + var method_count:int = readU32() + methods = [] + for (var i:int=0; i < method_count; i++) + { + var m = methods[i] = new MethodInfo() + var param_count:int = readU32() + m.returnType = names[readU32()] + m.paramTypes = [] + for (var j:int=0; j < param_count; j++) + m.paramTypes[j] = names[readU32()] + m.debugName = strings[readU32()] + m.flags = data.readByte() + if (m.flags & HAS_OPTIONAL) + { + // has_optional + var optional_count:int = readU32(); + m.optionalValues = [] + for( var k:int = param_count-optional_count; k < param_count; ++k) + { + var index = readU32() // optional value index + var kind:int = data.readByte() // kind byte for each default value + if (index == 0) + { + // kind is ignored, default value is based on type + m.optionalValues[k] = undefined + } + else + { + if (!defaults[kind]) + print("ERROR kind="+kind+" method_id " + i) + else + m.optionalValues[k] = defaults[kind][index] + } + } + } + if (m.flags & HAS_ParamNames) + { + // has_paramnames + for( var k:int = 0; k < param_count; ++k) + { + readU32(); + } + } + } + print("MethodInfo count " +method_count+ " size "+(data.position-start)+" "+int(100*(data.position-start)/data.length)+" %") + } + + function parseMetadataInfos() + { + var count:int = readU32() + metadata = [] + for (var i:int=0; i < count; i++) + { + // MetadataInfo + var m = metadata[i] = new MetaData() + m.name = strings[readU32()]; + var values_count:int = readU32(); + var names:Array = [] + for(var q:int = 0; q < values_count; ++q) + names[q] = strings[readU32()] // name + for(var q:int = 0; q < values_count; ++q) + m[names[q]] = strings[readU32()] // value + } + } + + function parseInstanceInfos() + { + var start:int = data.position + var count:int = readU32() + instances = [] + for (var i:int=0; i < count; i++) + { + var t = instances[i] = new Traits() + t.name = names[readU32()] + t.base = names[readU32()] + t.flags = data.readByte() + if (t.flags & 8) + t.protectedNs = namespaces[readU32()] + var interface_count = readU32() + for (var j:int=0; j < interface_count; j++) + t.interfaces[i] = names[readU32()] + var m = t.init = methods[readU32()] + m.name = t.name + m.kind = TRAIT_Method + m.id = -1 + parseTraits(t) + } + print("InstanceInfo size "+(data.position-start)+" "+int(100*(data.position-start)/data.length)+" %") + } + + function parseTraits(t:Traits) + { + var namecount = readU32() + for (var i:int=0; i < namecount; i++) + { + var name = names[readU32()] + var tag = data.readByte() + var kind = tag & 0xf + var member + switch(kind) { + case TRAIT_Slot: + case TRAIT_Const: + case TRAIT_Class: + var slot = member = new SlotInfo() + slot.id = readU32() + t.slots[slot.id] = slot + if (kind==TRAIT_Slot || kind==TRAIT_Const) + { + slot.type = names[readU32()] + var index=readU32() + if (index) + slot.value = defaults[data.readByte()][index] + } + else // (kind == TRAIT_Class) + { + slot.value = classes[readU32()] + } + break; + case TRAIT_Method: + case TRAIT_Getter: + case TRAIT_Setter: + var disp_id = readU32() + var method = member = methods[readU32()] + t.methods[disp_id] = method + method.id = disp_id + //print("\t",traitKinds[kind],name,disp_id,method,"// disp_id", disp_id) + break; + } + if (!member) + print("error trait kind "+kind) + member.kind = kind + member.name = name + t.names[String(name)] = t.members[i] = member + + if ( (tag >> 4) & ATTR_metadata ) { + member.metadata = [] + for(var j:int=0, mdCount:int=readU32(); j < mdCount; ++j) + member.metadata[j] = metadata[readU32()] + } + } + } + + function parseClassInfos() + { + var start:int = data.position + var count:int = instances.length + classes = [] + for (var i:int=0; i < count; i++) + { + var t:Traits = classes[i] = new Traits() + t.init = methods[readU32()] + t.base = "Class" + t.itraits = instances[i] + t.name = t.itraits.name + "$" + t.init.name = t.itraits.name + "$cinit" + t.init.kind = TRAIT_Method + parseTraits(t) + } + print("ClassInfo size "+(data.position-start)+" "+int(100*(data.position-start)/data.length)+"%") + } + + function parseScriptInfos() + { + var start:int = data.position + var count:int = readU32() + scripts = [] + for (var i:int=0; i < count; i++) + { + var t = new Traits() + scripts[i] = t + t.name = "script" + i + t.base = names[0] // Object + t.init = methods[readU32()] + t.init.name = t.name + "$init" + t.init.kind = TRAIT_Method + parseTraits(t) + } + print("ScriptInfo size "+(data.position-start)+" "+int(100*(data.position-start)/data.length)+" %") + } + + function parseMethodBodies() + { + var start:int = data.position + var count:int = readU32() + for (var i:int=0; i < count; i++) + { + var m = methods[readU32()] + m.max_stack = readU32() + m.local_count = readU32() + var initScopeDepth = readU32() + var maxScopeDepth = readU32() + m.max_scope = maxScopeDepth - initScopeDepth + var code_length = readU32() + m.code = new ByteArray() + m.code.endian = "littleEndian" + if (code_length > 0) + data.readBytes(m.code, 0, code_length) + var ex_count = readU32() + for (var j:int = 0; j < ex_count; j++) + { + var from = readU32() + var to = readU32() + var target = readU32() + var type = names[readU32()] + //print("magic " + magic.toString(16)) + //if (magic >= (46<<16|16)) + var name = names[readU32()]; + } + parseTraits(m.activation = new Traits) + } + print("MethodBodies size "+(data.position-start)+" "+int(100*(data.position-start)/data.length)+" %") + } + + function dump(indent:String="") + { + for each (var t in scripts) + { + print(indent+t.name) + t.dump(this,indent) + t.init.dump(this,indent) + } + + for each (var m in methods) + { + if (m.anon) { + m.dump(this,indent) + } + } + + print("OPCODE\tSIZE\t% OF "+totalSize) + var done = [] + for (;;) + { + var max:int = -1; + var maxsize:int = 0; + for (var i:int=0; i < 256; i++) + { + if (opSizes[i] > maxsize && !done[i]) + { + max = i; + maxsize = opSizes[i]; + } + } + if (max == -1) + break; + done[max] = 1; + print(opNames[max]+"\t"+int(opSizes[max])+"\t"+int(100*opSizes[max]/totalSize)+"%") + } + } + } + + class Rect + { + var nBits:int + var xMin:int, xMax:int + var yMin:int, yMax:int + public function toString() + { + return "[Rect "+xMin+" "+yMin+" "+xMax+" "+yMax+"]" + } + } + + const stagDoABC :int = 72; // embedded .abc (AVM+) bytecode + const stagSymbolClass :int = 76; + const stagDoABC2 :int = 82; // revised ABC version with a name + + var tagNames:Array = [ + "End", // 00 + "ShowFrame", // 01 + "DefineShape", // 02 + "FreeCharacter", // 03 + "PlaceObject", // 04 + "RemoveObject", // 05 + "DefineBits", // 06 + "DefineButton", // 07 + "JPEGTables", // 08 + "SetBackgroundColor", // 09 + + "DefineFont", // 10 + "DefineText", // 11 + "DoAction", // 12 + "DefineFontInfo", // 13 + + "DefineSound", // 14 + "StartSound", // 15 + "StopSound", // 16 + + "DefineButtonSound", // 17 + + "SoundStreamHead", // 18 + "SoundStreamBlock", // 19 + + "DefineBitsLossless", // 20 + "DefineBitsJPEG2", // 21 + + "DefineShape2", // 22 + "DefineButtonCxform", // 23 + + "Protect", // 24 + + "PathsArePostScript", // 25 + + "PlaceObject2", // 26 + "27 (invalid)", // 27 + "RemoveObject2", // 28 + + "SyncFrame", // 29 + "30 (invalid)", // 30 + "FreeAll", // 31 + + "DefineShape3", // 32 + "DefineText2", // 33 + "DefineButton2", // 34 + "DefineBitsJPEG3", // 35 + "DefineBitsLossless2", // 36 + "DefineEditText", // 37 + + "DefineVideo", // 38 + + "DefineSprite", // 39 + "NameCharacter", // 40 + "ProductInfo", // 41 + "DefineTextFormat", // 42 + "FrameLabel", // 43 + "DefineBehavior", // 44 + "SoundStreamHead2", // 45 + "DefineMorphShape", // 46 + "FrameTag", // 47 + "DefineFont2", // 48 + "GenCommand", // 49 + "DefineCommandObj", // 50 + "CharacterSet", // 51 + "FontRef", // 52 + + "DefineFunction", // 53 + "PlaceFunction", // 54 + + "GenTagObject", // 55 + + "ExportAssets", // 56 + "ImportAssets", // 57 + + "EnableDebugger", // 58 + + "DoInitAction", // 59 + "DefineVideoStream", // 60 + "VideoFrame", // 61 + + "DefineFontInfo2", // 62 + "DebugID", // 63 + "EnableDebugger2", // 64 + "ScriptLimits", // 65 + + "SetTabIndex", // 66 + + "DefineShape4", // 67 + "DefineMorphShape2", // 68 + + "FileAttributes", // 69 + + "PlaceObject3", // 70 + "ImportAssets2", // 71 + + "DoABC", // 72 + "73 (invalid)", // 73 + "74 (invalid)", // 74 + "75 (invalid)", // 75 + "SymbolClass", // 76 + "77 (invalid)", // 77 + "78 (invalid)", // 78 + "79 (invalid)", // 79 + "80 (invalid)", // 80 + "81 (invalid)", // 81 + "DoABC2", // 82 + "83 (invalid)" // 83 + ] + + + class Swf + { + private var bitPos:int + private var bitBuf:int + + private var data:ByteArray + + function Swf(data:ByteArray) + { + this.data = data + print("size "+decodeRect()) + print("frame rate "+(data.readUnsignedByte()<<8|data.readUnsignedByte())) + print("frame count "+data.readUnsignedShort()) + decodeTags() + } + + private function decodeTags() + { + var type:int, h:int, length:int + var offset:int + + while (data.position < data.length) + { + type = (h = data.readUnsignedShort()) >> 6; + + if (((length = h & 0x3F) == 0x3F)) + length = data.readInt(); + + print(tagNames[type]+" "+length+"b "+int(100*length/data.length)+"%") + switch (type) + { + case 0: return + case stagDoABC2: + var pos1:int = data.position + data.readInt() + print("\nabc name "+readString()) + length -= (data.position-pos1) + // fall through + case stagDoABC: + var data2 = new ByteArray + data2.endian = "littleEndian" + data.readBytes(data2,0,length) + new Abc(data2).dump(" ") + print("") + break + default: + data.position += length + } + } + } + + private function readString():String + { + var s:String = "" + var c:int + + while (c=data.readUnsignedByte()) + s += String.fromCharCode(c) + + return s + } + + private function syncBits() + { + bitPos = 0 + } + + private function decodeRect():Rect + { + syncBits(); + + var rect:Rect = new Rect(); + + var nBits:int = readUBits(5) + rect.xMin = readSBits(nBits); + rect.xMax = readSBits(nBits); + rect.yMin = readSBits(nBits); + rect.yMax = readSBits(nBits); + + return rect; + } + + function readSBits(numBits:int):int + { + if (numBits > 32) + throw new Error("Number of bits > 32"); + + var num:int = readUBits(numBits); + var shift:int = 32-numBits; + // sign extension + num = (num << shift) >> shift; + return num; + } + + function readUBits(numBits:int):uint + { + if (numBits == 0) + return 0 + + var bitsLeft:int = numBits; + var result:int = 0; + + if (bitPos == 0) //no value in the buffer - read a byte + { + bitBuf = data.readUnsignedByte() + bitPos = 8; + } + + while (true) + { + var shift:int = bitsLeft - bitPos; + if (shift > 0) + { + // Consume the entire buffer + result |= bitBuf << shift; + bitsLeft -= bitPos; + + // Get the next byte from the input stream + bitBuf = data.readUnsignedByte(); + bitPos = 8; + } + else + { + // Consume a portion of the buffer + result |= bitBuf >> -shift; + bitPos -= bitsLeft; + bitBuf &= 0xff >> (8 - bitPos); // mask off the consumed bits + + // if (print) System.out.println(" read"+numBits+" " + result); + return result; + } + } + } + } + + // main + + for each (var file in System.argv) + { + var data:ByteArray = ByteArray.readFile(file) + data.endian = "littleEndian" + var version:uint = data.readUnsignedInt() + switch (version) { + case 46<<16|14: + case 46<<16|15: + case 46<<16|16: + var abc:Abc = new Abc(data) + abc.dump() + break + case 67|87<<8|83<<16|9<<24: // SWC9 + case 67|87<<8|83<<16|8<<24: // SWC8 + case 67|87<<8|83<<16|7<<24: // SWC7 + case 67|87<<8|83<<16|6<<24: // SWC6 + var udata:ByteArray = new ByteArray + udata.endian = "littleEndian" + data.position = 8 + data.readBytes(udata,0,data.length-data.position) + var csize:int = udata.length + udata.uncompress() + print("decompressed swf "+csize+" -> "+udata.length) + udata.position = 0 + /*var swf:Swf =*/ new Swf(udata) + break + case 70|87<<8|83<<16|9<<24: // SWC9 + case 70|87<<8|83<<16|8<<24: // SWC8 + case 70|87<<8|83<<16|7<<24: // SWC7 + case 70|87<<8|83<<16|6<<24: // SWC6 + case 70|87<<8|83<<16|5<<24: // SWC5 + case 70|87<<8|83<<16|4<<24: // SWC4 + data.position = 8 // skip header and length + /*var swf:Swf =*/ new Swf(data) + break + default: + print('unknown format '+version) + break + } + } +} + diff --git a/mozilla/js/tamarin/utils/errorgen.as b/mozilla/js/tamarin/utils/errorgen.as new file mode 100644 index 00000000000..b114d55d6a6 --- /dev/null +++ b/mozilla/js/tamarin/utils/errorgen.as @@ -0,0 +1,754 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the + * "License"); you may not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is [Open Source Virtual Machine.] + * + * The Initial Developer of the Original Code is Adobe System Incorporated. Portions created + * by the Initial Developer are Copyright (C)[ 2004-2006 ] Adobe Systems Incorporated. All Rights + * Reserved. + * + * Contributor(s): Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of either the GNU + * General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public + * License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the + * LGPL are applicable instead of those above. If you wish to allow use of your version of this + * file only under the terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by deleting provisions + * above and replace them with the notice and other provisions required by the GPL or the + * LGPL. If you do not delete the provisions above, a recipient may use your version of this file + * under the terms of any one of the MPL, the GPL or the LGPL. + * + ***** END LICENSE BLOCK ***** */ + +import avmplus.* + +function assert(b) { if (!b) {throw new Error("Asserted");} } + +if (System.argv.length<1) +{ + print("You need to specific at least one xml file"); + System.exit(1); +} + +// parse / function call tables +var op_table:Array = []; +var operator:Array = []; +initTables(); + +// expression stacks used while parsing +var tStack:Array = []; +var exprStack:Array = []; + +// main +var contexts:Array = []; +var currentOutput:String = ""; +var showStatus:Boolean = false; +var debug:Boolean = false; +var i:int = 0; +while(i < System.argv.length) +{ + if (System.argv[i].charAt(0) == "+") + { + // option paramters + if (System.argv[i]=="+s") + showStatus = true; + else if (System.argv[i]=="+d") + debug = true; + i++; + continue; + } + + var context:XML = ; + load(context); + contexts.push(context); + + // generate + for each (var item:XML in context..Generate.children()) + { + var name = item.@name; + if (item.@disable == "true") + continue; + + var content:String = express(item); + + if (item.name() == "File") + File.write(name, content); + else + print(content); + } +} + +// create and push a new context node for any loops i.e. 'repeats' +function acquireContext():XML +{ + var ctx:XML = ; + contexts.push(ctx); + return ctx; +} + +function releaseContext(ctx:XML) +{ + assert(ctx == contexts[contexts.length-1]); // pop them off in order please + contexts.pop(); +} + +function repeat(x:XML):String +{ + var repeatName:String = x.attribute("repeat"); + var mergeName:String = x.attribute("mergeWith"); + var usedMergeName:String = mergeName; + var skip:Boolean = (x.attribute("skipUnattributed") == "false") ? false : true; + var useOrig:Boolean = (x.attribute("useOriginalIfMergeFail") == "false") ? false : true; + + var over:XML = lookup( parseVar(repeatName) ); + var mergeWith:XML = lookup( parseVar(mergeName) ); + + var mergeAttr:String = (mergeWith != null) ? x.attribute("mergeAttribute") : null; + + if (over==null) + print("ERROR: in repeat attribute, '"+repeatName+"' not found"); + + var n:String = ""; + var count:int = 0; + + var us:XML = parse(x.toString()); +// print("repeat "+us+" on "+x.toString()+" named "+repeatName+" over "+over.children().toXMLString()); + // set up a new context for lookups + var ctx:XML = acquireContext(); + + // use pseudo name for merge node + mergeName = "merge"; + + // put parent in current context + x.prependChild({count}); + ctx.prependChild(x); + if (mergeWith != null) ctx.prependChild(<{mergeName}/>); + + for each (var item:XML in over.children()) + { + if (skip && String(item.attributes()).length < 1) + continue; // skip un-attributed nodes + + // make the merge node available + if (mergeWith != null) + { + var node = childMatchingAttribute(mergeWith, String(mergeAttr), String(item.@[mergeAttr])); + if (node != null) + ctx[mergeName].appendChild(node); + else + { + print("Warning: no node with "+String(mergeAttr)+" = '"+String(item.@[mergeAttr])+"' in "+usedMergeName+" while merging with "+repeatName); + if (useOrig) + { + ctx[mergeName].appendChild(item[0]); + if (showStatus) print("Using "+item.toXMLString()); + } + } + } + + // make nodes visible in our context + x.replace("count", {count}); + ctx.prependChild(item); + + if (debug) print("Context pre-resolve "+ctx.toXMLString()); + + // now that our state is current we can expand the text of the node. + n += resolve(us); + count++; + + delete ctx.*[0]; + if (mergeWith != null) delete ctx[mergeName].*; + + if (debug) print("Context post-resolve "+ctx.toXMLString()); + } + + // trim the output? + if (x.attribute("trim") > 0) + n = n.slice(0, n.length-Number(x.attribute("trim"))); + + // make repeat count available in 'global' + delete contexts[0].*[0].last_repeat_count; + contexts[0].*[0].prependChild({count}); + + delete x.count; + releaseContext(ctx); + return n; +} + +function childMatchingAttribute(x:XML, attrName:String, attrValue:String):XML +{ + // find a child that has an attribute of a specific value + for each (var item in x.children()) + { + var val = item.@[attrName]; + if (val) + { + if (String(val) == attrValue) + return item; + } + } + return null; +} + + +function lookup(r:XML):XML +{ + if (r == null) + return null; + + // resolve lhs + var arr:Array = argsFor(r, "__dot"); + var x:XML = arr.pop(); + var ref:String = evaluate(x.*[0]); + var ctx = contextFor(ref); + var name:String = ref; + do + { + ref = evaluate(x.*[1]); + assert(x.*[1].name() != "__dot"); // shouldn't recurse in lookup() + name += "."+ref; + ctx = ctx[ref]; + x = arr.pop(); + } + while(x != null && ctx != null); + + if (ctx == null || ctx.length() == 0) + print("Warning: Could not find '"+name+"'"); + else if (ctx instanceof XMLList) + ctx = ctx[0]; + + return ctx; +} + +function argsFor(r:XML, tag:String="__comma"):Array +{ + var arr:Array = []; + while(r.name() == tag) + { + arr.push(r); + r = r.*[0]; + } + return arr; +} + +function contextFor(s:String):XML +{ + if (s == null || s.length == 0) + return null; + + // try each context + var x = null; + var len:int = contexts.length; + for(var i:int=len-1; i>-1; i--) + { + var context = contexts[i]; + if (s == "*" || (context[s].length() == 1 && context[s].name() == s)) + { + x = context[s]; + break; + } + } + + if (x == null) + print("ERROR: Can't find xml node "+s); + + if (x instanceof XMLList) + x = x[0]; + + return x; +} + +function express(n:XML):String +{ + if (debug) print("expressing '"+n+"'"); + + // special processing directives? + contexts.push({n}); + var s:String = ""; + if (n.attribute("repeat").length() > 0) + s = repeat(n); + else + { + var x:XML = parse(n.toString()); + s = resolve(x); + } + contexts.pop(); + return s; +} + +function resolve(r:XML):String +{ + var s:String = ""; + for each(var item:XML in r.children()) + { + s += evaluate(item); + currentOutput = s; + } + return s; +} + +function evaluate(r:XML):String +{ + var s:String = ""; + var f = op_table[r.name()]; + if (f == null) + print("Warning: function '"+r.name()+"' unknown for "+r.toXMLString()); + else + s = f.call(this, r); + return s; +} + +function parse(s:String):XML +{ + var subs:String = ""; + var len:int = s.length; + var tree:XML = ; + for(var i:int=0; i1) && (tStack[tStack.length-1].attribute("prec") >= opPrec) ) + popOperation(); + + if (String(op.name()).indexOf("Close") == 0) + { + // we stopped popping up to the close, so we need to peel off the open which is tos + popOperation(); + + // mondo hack that causes issues with expressions such as g + (2) but + // allows us to easily support function-like notation such as g(2) + var at = exprStack.length-2; + if ( (at>-1) && (exprStack[at].name() == "__oprnd") && !Number(exprStack[at]) ) + { + tStack.push( exprStack.pop() ); +// popOperation(); + var nm:XML = exprStack.pop(); + var name:String = "__" + nm.toString(); + tStack[tStack.length-1].setName(name); + exprStack.push( tStack.pop() ); + } + } + else + { + tStack.push(op); + } + } +} + +function opFor(c:String) +{ + var op:XML = operator[c]; + if (op == null) + op = operator[c.charAt(0)]; + + if (op != null && op.name() == "__ignore") + op = null; + return (op == null) ? null : new XML(op); +} + +function addOperand(s:String) +{ + if (s.length>0) + exprStack.push( <__oprnd prec='18' >{s} ); +} + +function appendConst(tree:XML, s:String) +{ + XML.ignoreWhitespace = false; + if (s.length>0) + { + var str = <__str/>; + str.appendChild( new XML("") ); + tree.appendChild( str ); + } + XML.ignoreWhitespace = true; +} + +function isWhitespace(c:String) +{ + var itIs:Boolean = false + if ( (c == " ") || (c == "\r") || (c == "\n") || (c == "\t") ) + itIs = true; + return itIs; +} + +function shows(s:String=""):String +{ + for(var i:int=0; i 0) + { + if (x.attribute("loaded") == 'true') + return; + + var fn = x.attribute("file"); + if (showStatus) print("Loading "+fn); + var c:XML = XML(File.read(fn)); + if (c.toXMLString().length == 0) + { + print("ERROR: Unable to find file "+fn); + System.exit(2); + } + + x.@loaded='true'; + x.appendChild(c); + } + + // expand children + for each (var item in x.children()) + load(item); +} + +// ops + +function f__OpenParen(x:XML) { assert(x.*[1] == null); return String(evaluate(x.*[0])); } +function f__OpenExpr(x:XML) { assert(x.*[1] == null); return String(evaluate(x.*[0])); } +function f__comma(x:XML) { assert(false); } +function f__Assignment(x:XML) { assert(false); } //String( evaluate(x.*[0]) = evaluate(x.*[1]) ); } +function f__LogicOr(x:XML) { return String( Boolean(evaluate(x.*[0])) || Boolean(evaluate(x.*[1])) ); } +function f__LogicAnd(x:XML) { return String( Boolean(evaluate(x.*[0])) && Boolean(evaluate(x.*[1])) ); } +function f__Or(x:XML) { return String( Number(evaluate(x.*[0])) | Number(evaluate(x.*[1])) ); } +function f__Xor(x:XML) { return String( Number(evaluate(x.*[0])) ^ Number(evaluate(x.*[1])) ); } +function f__And(x:XML) { return String( Number(evaluate(x.*[0])) & Number(evaluate(x.*[1])) ); } +function f__Eq(x:XML) { return String( Boolean(evaluate(x.*[0])) == Boolean(evaluate(x.*[1])) ); } +function f__Neq(x:XML) { return String( Boolean(evaluate(x.*[0])) != Boolean(evaluate(x.*[1])) ); } +function f__LT(x:XML) { return String( Boolean(evaluate(x.*[0])) < Boolean(evaluate(x.*[1])) ); } +function f__GT(x:XML) { return String( Boolean(evaluate(x.*[0])) > Boolean(evaluate(x.*[1])) ); } +function f__LTEq(x:XML) { return String( Boolean(evaluate(x.*[0])) <= Boolean(evaluate(x.*[1])) ); } +function f__GTEq(x:XML) { return String( Boolean(evaluate(x.*[0])) >= Boolean(evaluate(x.*[1])) ); } +function f__LShift(x:XML) { return String( Number(evaluate(x.*[0])) << Number(evaluate(x.*[1])) ); } +function f__RShift(x:XML) { return String( Number(evaluate(x.*[0])) >> Number(evaluate(x.*[1])) ); } +function f__Add(x:XML) { return String( Number(evaluate(x.*[0])) + Number(evaluate(x.*[1])) ); } +function f__Sub(x:XML) { return String( Number(evaluate(x.*[0])) - Number(evaluate(x.*[1])) ); } +function f__Mult(x:XML) { return String( Number(evaluate(x.*[0])) * Number(evaluate(x.*[1])) ); } +function f__Div(x:XML) { return String( Number(evaluate(x.*[0])) / Number(evaluate(x.*[1])) ); } +function f__Mod(x:XML) { return String( Number(evaluate(x.*[0])) % Number(evaluate(x.*[1])) ); } +function f__LogicNot(x:XML) { return String( !Boolean(evaluate(x.*[0])) ); } +function f__BitNot(x:XML) { return String( ~Number(evaluate(x.*[0])) ); } +function f__array(x:XML) { return String(x); } +function f__str(x:XML):String { return String(x); } +function f__strlen(x:XML):String { return String ( evaluate(x.*[0]).length ); } + +function initTables() +{ + operator["tree"] = ; // fake node which forces expressions to resolve + operator["}}"] = ; + operator["{{"] = <__OpenExpr view='}}' prec='-9' singleOperand='true' twoToken='true'/>; + + operator[")"] = ; + operator["("] = <__OpenParen view='(' prec='-1' singleOperand='true' />; + + operator["]"] = + operator["["] = <__OpenBracket view='[' prec='-1' singleOperand='true' /> + + operator[","] = <__comma view=',' prec='1'/>; + operator["="] = <__Assignment view='=' prec='2'/>; + operator["||"] = <__LogicOr view='||' prec ='4' twoToken='true'/>; + operator["&&"] = <__LogicAnd view='&&' prec='5' twoToken='true'/>; + operator["|"] = <__Or view='|' prec='6'/>; + operator["^"] = <__Xor view='^' prec='7'/>; + operator["&"] = <__And view='&' prec='8'/>; + operator["=="] = <__Eq view='==' prec='9' twoToken='true'/>; + operator["!="] = <__Neq view='!=' prec='9' twoToken='true'/>; + operator["<"] = <__LT view='<' prec='10'/>; + operator[">"] = <__GT view='>' prec='10'/>; + operator["<="] = <__LTEq view='<=' prec='10' twoToken='true'/>; + operator[">="] = <__GTEq view='>=' prec='10' twoToken='true'/>; + operator["<<"] = <__LShift view='<<' prec='11' twoToken='true'/>; + operator[">>"] = <__RShift view='>>' prec='11' twoToken='true'/>; + operator["+"] = <__Add view='+' prec='12'/>; + operator["-"] = <__Sub view='-' prec='12'/>; + operator["*"] = <__Mult view='*' prec='13'/>; + operator["/"] = <__Div view='/' prec='13'/>; + operator["%"] = <__Mod view='%' prec='13'/>; + operator["!"] = <__LogicNot view='!' prec='15' singleOperand='true'/>; + operator["~"] = <__BitNot view='~' prec='15' singleOperand='true'/>; + operator["."] = <__dot view='.' prec='17'/>; + operator["array"] = ; + operator["*."] = <__ignore />; // allow * in dot expressions + + // functions + op_table["__OpenExpr"] = f__OpenExpr; + op_table["__OpenParen"] = f__OpenParen; +// op_table["__OpenBracket"] = f__OpenBracket; + op_table["__comma"] = f__comma; + op_table["__Assignment"] = null; //f__Assignment; + op_table["__LogicOr"] = f__LogicOr; + op_table["__LogicAnd"] = f__LogicAnd; + op_table["__Or"] = f__Or; + op_table["__Xor"] = f__Xor; + op_table["__And"] = f__And; + op_table["__Eq"] = f__Eq; + op_table["__Neq"] = f__Neq; + op_table["__LT"] = f__LT; + op_table["__GT"] = f__GT; + op_table["__LTEq"] = f__LTEq; + op_table["__GTEq"] = f__GTEq; + op_table["__LShift"] = f__LShift; + op_table["__RShift"] = f__RShift; + op_table["__Add"] = f__Add; + op_table["__Sub"] = f__Sub; + op_table["__Mult"] = f__Mult; + op_table["__Div"] = f__Div; + op_table["__Mod"] = f__Mod; + op_table["__LogicNot"] = f__LogicNot; + op_table["__BitNot"] = f__BitNot; + op_table["__dot"] = f__dot; + op_table["__array"] = f__array; + op_table["__str"] = f__str; + op_table["__oprnd"] = f__oprnd; + op_table["__strlen"] = f__strlen; + op_table["__substring"] = f__substring; + op_table["__escape"] = f__escape; + op_table["__spaces"] = f__spaces; + op_table["__column"] = f__column; + op_table["__context"] = f__context; + op_table["__parseTree"] = f__parseTree; + op_table["__showTree"] = f__showTree; +} + +function f__dot(x:XML):String +{ + var r = lookup(x); + var s:String = ""; + + if (r == null) + s = ""; // lookup has already issued a warning + else if (r instanceof XML) + s = express(r); + else + s = String(r); + return s; +} + +function f__oprnd(x:XML):String +{ + var s:String = String(x); + return s; +} + +function f__escape(x:XML):String +{ + var args = argsFor(x.*[0]); + var charsToEscape:String = "\""; + var withSeq:String = "\\\""; + var arg0:XML = x.*[0]; + if (args.length>1) + { + // three args or 1 arg + charsToEscape = evaluate(args[1].*[1]); + withSeq = evaluate(args[0].*[1]); + arg0 = args[1].*[0]; + } + var s = evaluate(arg0); + var n:String = ""; + var len:int = s.length; + for(var i:int=0; i -1) + n += withSeq; + else + n += c; + } + return n; +} + +function f__substring(x:XML):String +{ + // + var args = argsFor(x.*[0]); + if (args.length<1) + { + print("WARNING: substring requires at least 1 argument"); + return ""; + } + else if (args.length<2) + { + var from = Number( evaluate(args[0].*[1]) ); + return evaluate(args[0].*[0]).substring(from); + } + else + { + var from = Number( evaluate(args[1].*[1]) ); + var to = Number ( evaluate(args[0].*[1]) ); + return evaluate(args[1].*[0]).substring(from, to); + } +} + +function f__spaces(x:XML):String +{ + var c:Number = Number( evaluate(x.*[0]) ); + var n:String=""; + while(c-->0) + n+= " "; + return n; +} + +function f__column(x:XML):String +{ + var num:Number = Number( evaluate(x.*[0]) ); + + // lets figure out which column we're at and the appropriate amount of padding + var cr:int = currentOutput.lastIndexOf("\n"); + var c:int = num-(currentOutput.length-int(cr)-1); + var n:String=""; + while(c-->0) + n+= " "; + return n; +} + +function f__context(x:XML):String +{ + var num:Number = Number( evaluate(x.*[0]) ); + if (isNaN(num) || (num<0) || (num>(contexts.length-1)) ) + num = contexts.length-1; + return contexts[num].toString(); +} + +function f__parseTree(x:XML):String +{ + return x.toString(); +} + +function f__showTree(x:XML, d:int=0):String +{ + var s:String=""; + if (x.children().length() > 0) + { + var paren:Boolean = x.attribute("view") == "(" ? true : false; + var len:int = x.children().length(); + if (len == 1) + s = f__showTree(x.*[0]); + else if (len == 2) + s = f__showTree(x.*[0]) + x.attribute("view") + f__showTree(x.*[1]); + else + { + for(var i:int=0; i +crt kernel32:KERNEL32.dll +crt advapi32:ADVAPI32.dll +crt winmm:WINMM.dll +crt LIBCMT: * +crt Dll:: * +crt _E32Dll * +crt __cpp * + +MMGC mmgc: * +MMGC avmplus:GC * +MMGC avmplus:FixedAlloc.obj +MMGC avmplus:FixedMalloc.obj +MMGC MMgc:: * +MMGC operator * + +MIR avmplus:CodegenMIR.obj +MIR avmplus:Ia32Assembler.obj +MIR avmplus:GrowableBuffer.obj +MIR win32cpuid.obj +MIR avmplus::CodegenMIR +MIR avmplus::ArmAssembler +MIR avmplus::GrowableBuffer +MIR avmplus::ImtBuilder + +Interp avmplus:Interpreter.obj +Interp avmplus::Interpreter + +Verify avmplus:Verifier.obj +Verify avmplus:AbcParser.obj +Verify avmplus::Verifier +Verify avmplus::AbcParser +Verify avmplus::SortedIntMap +Verify avmplus::FrameState + +Math avmplus:MathUtils.obj +Math avmplus:MathClass.obj +Math avmplus:MathUtilsWin.obj +Math avmplus:BigInteger.obj +Math avmplus::MathUtils +Math avmplus::MathClass +Math avmplus::BigInteger +Math avmplus::D2A +Math avmplus::kPowersOfTen +Math avmplus::Random_Xor_Masks +Math avmplus::quickBigPowTen +Math avmplus::quickPowTen +Math avmplus::quickPowTwo +Math avmplus::powInt + +Number avmplus:NumberClass.obj +Number avmplus:IntClass.obj +Number avmplus::NumberClass +Number avmplus::IntClass +Number avmplus::UintClass + +Error avmplus:ErrorClass.obj +Error avmplus:Exception.obj +Error avmplus::ErrorClass +Error avmplus::NativeErrorClass +Error avmplus::ErrorObject +Error avmplus::ExceptionFrame +Error avmplus::Exception +Error avmplus::ExceptionHandlerTable + +RegExp avmplus:pcre_ * +RegExp avmplus:RegExp * +RegExp avmplus::RegExp * +RegExp pcre_ * +RegExp _pcre_ * +RegExp find_ * +RegExp is_ * +RegExp compile_ * +RegExp match_ * +RegExp check_ * +RegExp posix_ * +RegExp first_ * +RegExp auto_callout +RegExp match +RegExp set_start_bits +RegExp digitab +RegExp could_be_empty_branch +RegExp error_texts +RegExp escapes +RegExp byteflip +RegExp complete_callout +RegExp avmplus::fmalloc +RegExp avmplus::ffree +RegExp rep_min +RegExp rep_max +RegExp set_bit +RegExp adjust_recurse +RegExp read_repeat_counts + +ZLIB deflate.obj +ZLIB inflate.obj +ZLIB trees.obj +ZLIB infback.obj +ZLIB inftrees.obj +ZLIB inffas86.obj +ZLIB adler32.obj +ZLIB compress.obj +ZLIB zutil.obj +ZLIB uncompr.obj +ZLIB crc32.obj + +E4X avmplus:XMLObject.obj +E4X avmplus:XMLListObject.obj +E4X avmplus:XMLClass.obj +E4X avmplus:XMLListClass.obj +E4X avmplus:E4XNode.obj +E4X avmplus:XMLParser16.obj +E4X avmplus::CommentE4XNode +E4X avmplus::AttributeE4XNode +E4X avmplus::CDATAE4XNode +E4X avmplus::TextE4XNode +E4X avmplus::PIE4XNode +E4X avmplus::ElementE4XNode +E4X avmplus::E4XNode * +E4X avmplus::XML * +E4X avmplus::QName * +E4X avmplus::stripPrefix + +Builtin.as avmplus:AbcData.obj +Builtin.as avmplus::builtin_abc_data + +Runtime avmplus:AvmCore.obj +Runtime avmplus:MethodEnv.obj +Runtime avmplus:Toplevel.obj +Runtime avmplus:AvmCore.obj +Runtime avmplus:MethodEnv.obj +Runtime avmplus:Toplevel.obj +Runtime avmplus:PoolObject.obj +Runtime avmplus:Traits.obj +Runtime avmplus:AbstractFunction.obj +Runtime avmplus:PrintWriter.obj +Runtime avmplus:Multiname.obj +Runtime avmplus:NamespaceSet.obj +Runtime avmplus:BuiltinTraits.obj +Runtime avmplus:Domain.obj +Runtime avmplus:DomainEnv.obj +Runtime avmplus:VTable.obj +Runtime avmplus:NativeFunction.obj +Runtime avmplus:StringBuffer.obj +Runtime avmplus:MethodInfo.obj +Runtime avmplus:AbcGen.obj +Runtime avmplus:win32setjmp.obj +Runtime avmplus:OSDepWin.obj +Runtime avmplus:AbcEnv.obj +Runtime avmplus:ActionBlockConstants.obj +Runtime avmplus:MultinameHashtable.obj +Runtime avmplus::OSDep +Runtime avmplus::Domain * +Runtime avmplus::NativeObjectHelpers * +Runtime avmplus::NativeMethod * +Runtime avmplus::AvmCore +Runtime avmplus::MethodEnv +Runtime avmplus::ScriptEnv +Runtime avmplus::Toplevel +Runtime avmplus::PoolObject +Runtime avmplus::Traits +Runtime avmplus::List +Runtime avmplus::Multiname * +Runtime avmplus::PrintWriter +Runtime avmplus::BuiltinTraits +Runtime avmplus::letterTable +Runtime avmplus::AbstractFunction +Runtime avmplus::ActionBlockConstants +Runtime avmplus::VTable +Runtime avmplus::combiningCharTable +Runtime avmplus::parseDateNumber +Runtime avmplus::AbcGen +Date avmplus::parseDateKeyword +Runtime avmplus::UIntClass + +Object avmplus:ScriptObject.obj +Object avmplus:ObjectClass.obj +Object avmplus:avmplusHashtable.obj +Object avmplus::ObjectClass +Object avmplus::ScriptObject +Object avmplus::Hashtable +Object avmplus::WeakValueHashtable +Object avmplus::WeakKeyHashtable + +Array avmplus:ArrayClass.obj +Array avmplus:ArrayObject.obj +Array avmplus:AtomArray.obj +Array avmplus::ArrayObject +Array avmplus::ArrayClass +Array avmplus::AtomArray +Array avmplus::ArraySort + +String avmplus:StringClass.obj +String avmplus:StringObject.obj +String avmplus:UnicodeUtils.obj +String avmplus::String +String avmplus::StringClass +String avmplus::UnicodeUtils +String avmplus::StringOutputStream +String avmplus::StringBuffer +String avmplus::wcharEquals +String avmplus::UsesUTF8String +String avmplus::upperCaseBase +String avmplus::lowerCaseBase +String avmplus::upperCaseConversion +String avmplus::lowerCaseConversion +String avmplus::g_tolower_map +String avmplus::g_toupper_map +String avmplus::operator * +String minUCS4@_ZN7avmplus12UnicodeUtils10Utf8ToUcs4EPKhiPm_0 + +Namespace avmplus:Namespace.obj +Namespace avmplus:NamespaceClass.obj +Namespace avmplus::Namespace * + +Boolean avmplus:BooleanClass.obj +Boolean avmplus::Boolean * + +Class avmplus:ClassClosure.obj +Class avmplus:ClassClass.obj +Class avmplus::ClassClosure +Class avmplus::ClassClass + +Function avmplus:MethodClosure.obj +Function avmplus:FunctionClass.obj +Function avmplus::FunctionClass +Function avmplus::MethodClosure +Function avmplus::MethodClosureClass + +Date avmplus:DateClass.obj +Date avmplus:DateObject.obj +Date avmplus:Date.obj +Date avmplus:DateWin.obj +Date avmplus::UTC +Date avmplus::Date * +Date avmplus::Day * + +SHELL avmshell.obj +SHELL DomainClass.obj +SHELL DomainObject.obj +SHELL StringBuilderClass.obj +SHELL StringBuilderObject.obj +SHELL TypedArrayClass.obj +SHELL TypedArrayObject.obj +SHELL ByteArrayGlue.obj +SHELL DataIO.obj +SHELL FileClass.obj +SHELL DictionaryGlue.obj +SHELL SystemClass.obj +SHELL ConsoleOutputStream.obj +SHELL FileInputStream.obj +SHELL JavaGlue.obj + + +DarkMatter stale.raw +find ../. -name \*.as -exec cat {} \; >> stale.raw +find ../. -name \*.h -exec cat {} \; >> stale.raw + +echo "Restoring files " +mv -v ../core/ErrorConstants.a ../core/ErrorConstants.as +mv -v ../core/ErrorConstants.ash ../core/ErrorConstants.h + +echo "Generating constant list" +./avmplus ./errorgen.abc -- stale.xml + +echo "Searching for unused constants" +MISSING=" "; +for PATT in `cat stale.lst` +do + grep -Hniq $PATT stale.raw + if [ "${?}" != 0 ]; then + MISSING=`echo -e $MISSING "\r\n" $PATT` + fi +done + +echo "Removing monster big file " +rm stale.raw +rm stale.lst + +echo "Unused : " + +for CHK in ${MISSING} +do + echo " " $CHK + #add some commands here to help you pin down this missing constants +done